aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorno-author <no-author@gcc.gnu.org>2002-02-20 18:48:23 +0000
committerno-author <no-author@gcc.gnu.org>2002-02-20 18:48:23 +0000
commit26d7ea7d7e035d4a0857da77d90a04376ce577b6 (patch)
tree6af4d3ca0cec003948682079269e7efa84581b79
parenta77e41f20ecff0f4731ab8d43e54629b25d29e50 (diff)
This commit was manufactured by cvs2svn to create taggcc_3_0_4_release
'gcc_3_0_4_release'. git-svn-id: https://gcc.gnu.org/svn/gcc/tags/gcc_3_0_4_release@49907 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--.cvsignore2
-rw-r--r--ChangeLog416
-rw-r--r--INSTALL/README8
-rw-r--r--MAINTAINERS17
-rw-r--r--Makefile.in73
-rw-r--r--README26
-rw-r--r--boehm-gc/ChangeLog150
-rw-r--r--boehm-gc/Makefile.am5
-rw-r--r--boehm-gc/Makefile.in19
-rw-r--r--boehm-gc/acinclude.m414
-rw-r--r--boehm-gc/aclocal.m414
-rwxr-xr-xboehm-gc/configure542
-rw-r--r--boehm-gc/configure.in50
-rw-r--r--boehm-gc/finalize.c16
-rw-r--r--boehm-gc/gc_priv.h18
-rw-r--r--boehm-gc/gcconfig.h33
-rw-r--r--boehm-gc/gcj_mlc.c1
-rw-r--r--boehm-gc/linux_threads.c2
-rw-r--r--boehm-gc/mach_dep.c13
-rw-r--r--boehm-gc/malloc.c2
-rw-r--r--boehm-gc/misc.c16
-rw-r--r--boehm-gc/os_dep.c25
-rw-r--r--boehm-gc/solaris_threads.c13
-rw-r--r--boehm-gc/test.c8
-rw-r--r--config-ml.in45
-rwxr-xr-xconfig.guess574
-rwxr-xr-xconfig.sub160
-rw-r--r--config/ChangeLog32
-rw-r--r--config/mpw/ChangeLog32
-rw-r--r--config/mt-linux3
-rwxr-xr-xconfigure17
-rw-r--r--configure.in156
-rw-r--r--contrib/ChangeLog185
-rw-r--r--contrib/PR3145.patch3806
-rwxr-xr-xcontrib/gcc_build6
-rwxr-xr-xcontrib/gcc_release543
-rwxr-xr-xcontrib/gcc_update54
-rwxr-xr-xcontrib/gennews15
-rw-r--r--contrib/release252
-rwxr-xr-xcontrib/test_summary8
-rwxr-xr-xcontrib/texi2pod.pl50
-rw-r--r--fastjar/ChangeLog32
-rw-r--r--fastjar/Makefile.am8
-rw-r--r--fastjar/Makefile.in22
-rw-r--r--gcc/ChangeLog7150
-rw-r--r--gcc/ChangeLog.196
-rw-r--r--gcc/ChangeLog.350
-rw-r--r--gcc/ChangeLog.4170
-rw-r--r--gcc/ChangeLog.lib438
-rw-r--r--gcc/Makefile.in918
-rw-r--r--gcc/NEWS1448
-rw-r--r--gcc/README26
-rw-r--r--gcc/README.ACORN18
-rw-r--r--gcc/README.ALTOS55
-rw-r--r--gcc/README.C4X48
-rw-r--r--gcc/README.DWARF574
-rw-r--r--gcc/README.RS6000148
-rw-r--r--gcc/README.X11447
-rw-r--r--gcc/acconfig.h3
-rw-r--r--gcc/aclocal.m4116
-rw-r--r--gcc/alias.c119
-rw-r--r--gcc/assert.h54
-rw-r--r--gcc/basic-block.h10
-rw-r--r--gcc/bb-reorder.c15
-rw-r--r--gcc/builtins.c36
-rw-r--r--gcc/builtins.def1
-rw-r--r--gcc/c-common.c113
-rw-r--r--gcc/c-common.def10
-rw-r--r--gcc/c-common.h66
-rw-r--r--gcc/c-convert.c10
-rw-r--r--gcc/c-decl.c174
-rw-r--r--gcc/c-dump.c163
-rw-r--r--gcc/c-dump.h6
-rw-r--r--gcc/c-format.c26
-rw-r--r--gcc/c-gperf.h252
-rw-r--r--gcc/c-lang.c12
-rw-r--r--gcc/c-lex.c57
-rw-r--r--gcc/c-lex.h1
-rw-r--r--gcc/c-parse.in222
-rw-r--r--gcc/c-pragma.c67
-rw-r--r--gcc/c-pragma.h6
-rw-r--r--gcc/c-semantics.c56
-rw-r--r--gcc/c-tree.h7
-rw-r--r--gcc/c-typeck.c73
-rw-r--r--gcc/calls.c113
-rw-r--r--gcc/ch/ChangeLog12190
-rw-r--r--gcc/ch/Make-lang.in186
-rw-r--r--gcc/ch/Makefile.in330
-rw-r--r--gcc/ch/README43
-rw-r--r--gcc/ch/actions.c1836
-rw-r--r--gcc/ch/ch-tree.def114
-rw-r--r--gcc/ch/ch-tree.h1157
-rw-r--r--gcc/ch/chill.brochure252
-rw-r--r--gcc/ch/chill.in130
-rw-r--r--gcc/ch/chill.texi1231
-rw-r--r--gcc/ch/config-lang.in41
-rwxr-xr-xgcc/ch/configure635
-rw-r--r--gcc/ch/convert.c1249
-rw-r--r--gcc/ch/decl.c4967
-rw-r--r--gcc/ch/except.c707
-rw-r--r--gcc/ch/expr.c4512
-rw-r--r--gcc/ch/gperf166
-rw-r--r--gcc/ch/grant.c3061
-rw-r--r--gcc/ch/hash.h1370
-rw-r--r--gcc/ch/inout.c4691
-rw-r--r--gcc/ch/lang-options.h40
-rw-r--r--gcc/ch/lang.c305
-rw-r--r--gcc/ch/lex.c2234
-rw-r--r--gcc/ch/lex.h98
-rw-r--r--gcc/ch/loop.c1234
-rw-r--r--gcc/ch/nloop.c1246
-rw-r--r--gcc/ch/parse.c4332
-rw-r--r--gcc/ch/parse.h70
-rw-r--r--gcc/ch/satisfy.c629
-rw-r--r--gcc/ch/tasking.c3432
-rw-r--r--gcc/ch/timing.c491
-rw-r--r--gcc/ch/tree.c298
-rw-r--r--gcc/ch/typeck.c3825
-rw-r--r--gcc/ch/xtypeck.c283
-rw-r--r--gcc/collect2.c49
-rw-r--r--gcc/combine.c235
-rw-r--r--gcc/config.gcc301
-rw-r--r--gcc/config.in41
-rw-r--r--gcc/config/1750a/1750a.h2
-rw-r--r--gcc/config/a29k/a29k.c1
-rw-r--r--gcc/config/a29k/rtems.h4
-rw-r--r--gcc/config/a29k/xm-a29k.h5
-rw-r--r--gcc/config/a29k/xm-unix.h4
-rw-r--r--gcc/config/alpha/alpha-protos.h1
-rw-r--r--gcc/config/alpha/alpha.c93
-rw-r--r--gcc/config/alpha/alpha.h43
-rw-r--r--gcc/config/alpha/alpha.md65
-rw-r--r--gcc/config/alpha/elf.h35
-rw-r--r--gcc/config/alpha/freebsd.h4
-rw-r--r--gcc/config/alpha/linux.h60
-rw-r--r--gcc/config/alpha/osf.h65
-rw-r--r--gcc/config/alpha/osf5.h34
-rw-r--r--gcc/config/alpha/t-interix5
-rw-r--r--gcc/config/alpha/t-osf410
-rw-r--r--gcc/config/alpha/xm-alpha.h5
-rw-r--r--gcc/config/arc/arc.c1
-rw-r--r--gcc/config/arc/arc.h9
-rw-r--r--gcc/config/arc/initfini.c2
-rw-r--r--gcc/config/arc/xm-arc.h4
-rw-r--r--gcc/config/arm/aof.h2
-rw-r--r--gcc/config/arm/arm.c17
-rw-r--r--gcc/config/arm/arm.h23
-rw-r--r--gcc/config/arm/arm.md12
-rw-r--r--gcc/config/arm/coff.h7
-rw-r--r--gcc/config/arm/conix-elf.h17
-rw-r--r--gcc/config/arm/elf.h13
-rw-r--r--gcc/config/arm/lib1funcs.asm10
-rw-r--r--gcc/config/arm/linux-elf.h54
-rw-r--r--gcc/config/arm/rtems-elf.h10
-rw-r--r--gcc/config/arm/unknown-elf.h17
-rw-r--r--gcc/config/arm/xm-arm.h6
-rw-r--r--gcc/config/avr/avr.c18
-rw-r--r--gcc/config/avr/avr.h9
-rw-r--r--gcc/config/avr/avr.md9
-rw-r--r--gcc/config/avr/libgcc.S5
-rw-r--r--gcc/config/c4x/c4x.c2
-rw-r--r--gcc/config/c4x/c4x.h30
-rw-r--r--gcc/config/c4x/rtems.h4
-rw-r--r--gcc/config/c4x/xm-c4x.h5
-rw-r--r--gcc/config/clipper/clipper.c1
-rw-r--r--gcc/config/clipper/xm-clix.h4
-rw-r--r--gcc/config/convex/convex.c1
-rw-r--r--gcc/config/convex/xm-convex.h4
-rw-r--r--gcc/config/d30v/d30v.c1
-rw-r--r--gcc/config/d30v/d30v.h22
-rw-r--r--gcc/config/d30v/xm-d30v.h4
-rw-r--r--gcc/config/dbxelf.h22
-rw-r--r--gcc/config/dsp16xx/dsp16xx.c1
-rw-r--r--gcc/config/dsp16xx/dsp16xx.h3
-rw-r--r--gcc/config/dsp16xx/xm-dsp16xx.h4
-rw-r--r--gcc/config/elfos.h19
-rw-r--r--gcc/config/elxsi/xm-elxsi.h5
-rw-r--r--gcc/config/float-i128.h2
-rw-r--r--gcc/config/float-i32.h2
-rw-r--r--gcc/config/float-i386.h2
-rw-r--r--gcc/config/float-i64.h2
-rw-r--r--gcc/config/float-m68k.h27
-rw-r--r--gcc/config/float-sh.h2
-rw-r--r--gcc/config/float-sparc.h2
-rw-r--r--gcc/config/fp-bit.h2
-rw-r--r--gcc/config/fr30/fr30.c1
-rw-r--r--gcc/config/fr30/xm-fr30.h4
-rw-r--r--gcc/config/freebsd-nthr.h (renamed from gcc/ch/tasking.h)13
-rw-r--r--gcc/config/freebsd.h191
-rw-r--r--gcc/config/freebsd3.h (renamed from gcc/config/arm/linux-elf26.h)12
-rw-r--r--gcc/config/freebsd4.h (renamed from gcc/ch/lang-specs.h)16
-rw-r--r--gcc/config/freebsd5.h (renamed from gcc/config/arm/linux-oldld.h)15
-rw-r--r--gcc/config/freebsd6.h22
-rw-r--r--gcc/config/h8300/fixunssfsi.c43
-rw-r--r--gcc/config/h8300/h8300.c18
-rw-r--r--gcc/config/h8300/h8300.h20
-rw-r--r--gcc/config/h8300/h8300.md104
-rw-r--r--gcc/config/h8300/lib1funcs.asm42
-rw-r--r--gcc/config/h8300/rtems.h4
-rw-r--r--gcc/config/h8300/t-h83008
-rw-r--r--gcc/config/h8300/xm-h8300.h5
-rw-r--r--gcc/config/i370/i370.c1
-rw-r--r--gcc/config/i370/i370.h1
-rw-r--r--gcc/config/i370/i370.md4
-rw-r--r--gcc/config/i370/xm-i370.h5
-rw-r--r--gcc/config/i370/xm-linux.h4
-rw-r--r--gcc/config/i370/xm-mvs.h5
-rw-r--r--gcc/config/i370/xm-oe.h3
-rw-r--r--gcc/config/i386/att.h7
-rw-r--r--gcc/config/i386/beos-elf.h12
-rw-r--r--gcc/config/i386/bsd.h5
-rw-r--r--gcc/config/i386/cygwin.h163
-rw-r--r--gcc/config/i386/dgux.c4
-rw-r--r--gcc/config/i386/djgpp.h41
-rw-r--r--gcc/config/i386/freebsd-aout.h12
-rw-r--r--gcc/config/i386/freebsd.h4
-rw-r--r--gcc/config/i386/gas.h1
-rw-r--r--gcc/config/i386/gnu.h3
-rw-r--r--gcc/config/i386/i386-aout.h2
-rw-r--r--gcc/config/i386/i386-coff.h2
-rw-r--r--gcc/config/i386/i386-interix.h2
-rw-r--r--gcc/config/i386/i386-protos.h6
-rw-r--r--gcc/config/i386/i386.c530
-rw-r--r--gcc/config/i386/i386.h79
-rw-r--r--gcc/config/i386/i386.md266
-rw-r--r--gcc/config/i386/i386afe.h37
-rw-r--r--gcc/config/i386/i386elf.h34
-rw-r--r--gcc/config/i386/linux.h123
-rw-r--r--gcc/config/i386/mingw32.h22
-rw-r--r--gcc/config/i386/netbsd-elf.h192
-rw-r--r--gcc/config/i386/netbsd.h5
-rw-r--r--gcc/config/i386/openbsd.h7
-rw-r--r--gcc/config/i386/osf1elf.h15
-rw-r--r--gcc/config/i386/osfrose.h112
-rw-r--r--gcc/config/i386/ptx4-i.h34
-rw-r--r--gcc/config/i386/rtems.h4
-rw-r--r--gcc/config/i386/rtemself.h91
-rw-r--r--gcc/config/i386/sco5.h65
-rw-r--r--gcc/config/i386/sol2.h36
-rw-r--r--gcc/config/i386/sun386.h5
-rw-r--r--gcc/config/i386/svr3gas.h4
-rw-r--r--gcc/config/i386/sysv4.h60
-rw-r--r--gcc/config/i386/t-beos3
-rw-r--r--gcc/config/i386/t-cygwin2
-rw-r--r--gcc/config/i386/t-interix3
-rw-r--r--gcc/config/i386/t-openbsd6
-rw-r--r--gcc/config/i386/t-rtems-i38643
-rw-r--r--gcc/config/i386/t-sco5gas2
-rw-r--r--gcc/config/i386/unix.h5
-rw-r--r--gcc/config/i386/vsta.h4
-rw-r--r--gcc/config/i386/win-nt.h4
-rw-r--r--gcc/config/i386/win32.h4
-rw-r--r--gcc/config/i386/winnt.c39
-rw-r--r--gcc/config/i386/xm-aix.h2
-rw-r--r--gcc/config/i386/xm-cygwin.h25
-rw-r--r--gcc/config/i386/xm-i386.h4
-rw-r--r--gcc/config/i386/xm-osf.h2
-rw-r--r--gcc/config/i860/i860.c1
-rw-r--r--gcc/config/i860/varargs.asm201
-rw-r--r--gcc/config/i860/xm-i860.h4
-rw-r--r--gcc/config/i960/i960.c4
-rw-r--r--gcc/config/i960/i960.h1
-rw-r--r--gcc/config/i960/rtems.h4
-rw-r--r--gcc/config/i960/xm-i960.h4
-rw-r--r--gcc/config/ia64/crtbegin.asm45
-rw-r--r--gcc/config/ia64/crtend.asm14
-rw-r--r--gcc/config/ia64/elf.h42
-rw-r--r--gcc/config/ia64/fde-glibc.c160
-rw-r--r--gcc/config/ia64/frame-ia64.c1272
-rw-r--r--gcc/config/ia64/freebsd.h89
-rw-r--r--gcc/config/ia64/hpux.h97
-rw-r--r--gcc/config/ia64/ia64.c510
-rw-r--r--gcc/config/ia64/ia64.h188
-rw-r--r--gcc/config/ia64/ia64.md118
-rw-r--r--gcc/config/ia64/lib1funcs.asm11
-rw-r--r--gcc/config/ia64/libgcc-ia64.ver1
-rw-r--r--gcc/config/ia64/linux.h12
-rw-r--r--gcc/config/ia64/sysv4.h7
-rw-r--r--gcc/config/ia64/t-hpux6
-rw-r--r--gcc/config/ia64/t-ia643
-rw-r--r--gcc/config/ia64/unwind-ia64.c2015
-rw-r--r--gcc/config/ia64/unwind-ia64.h (renamed from gcc/config/ia64/frame-ia64.h)23
-rw-r--r--gcc/config/ia64/xm-ia64.h4
-rw-r--r--gcc/config/linux.h13
-rw-r--r--gcc/config/m32r/m32r.c1
-rw-r--r--gcc/config/m32r/xm-m32r.h4
-rw-r--r--gcc/config/m68hc11/larith.asm255
-rw-r--r--gcc/config/m68hc11/m68hc11-protos.h11
-rw-r--r--gcc/config/m68hc11/m68hc11.c678
-rw-r--r--gcc/config/m68hc11/m68hc11.h220
-rw-r--r--gcc/config/m68hc11/m68hc11.md1230
-rw-r--r--gcc/config/m68hc11/m68hc12.h5
-rw-r--r--gcc/config/m68hc11/t-m68hc11-gas6
-rw-r--r--gcc/config/m68k/3b1.h4
-rw-r--r--gcc/config/m68k/auxgas.h8
-rw-r--r--gcc/config/m68k/crds.h4
-rw-r--r--gcc/config/m68k/hp320.h4
-rw-r--r--gcc/config/m68k/linux-aout.h3
-rw-r--r--gcc/config/m68k/linux.h3
-rw-r--r--gcc/config/m68k/m68k.c7
-rw-r--r--gcc/config/m68k/m68k.h136
-rw-r--r--gcc/config/m68k/m68k.md606
-rw-r--r--gcc/config/m68k/m68kv4.h18
-rw-r--r--gcc/config/m68k/mot3300.h8
-rw-r--r--gcc/config/m68k/news.h5
-rw-r--r--gcc/config/m68k/rtems.h4
-rw-r--r--gcc/config/m68k/rtemself.h6
-rw-r--r--gcc/config/m68k/sgs.h7
-rw-r--r--gcc/config/m68k/t-m68kbare6
-rw-r--r--gcc/config/m68k/t-openbsd5
-rw-r--r--gcc/config/m68k/tower-as.h5
-rw-r--r--gcc/config/m68k/xm-m68k.h5
-rw-r--r--gcc/config/m88k/m88k.c6
-rw-r--r--gcc/config/m88k/xm-m88k.h5
-rw-r--r--gcc/config/mcore/mcore-elf.h14
-rw-r--r--gcc/config/mcore/mcore.c11
-rw-r--r--gcc/config/mcore/t-mcore3
-rw-r--r--gcc/config/mcore/t-mcore-pe3
-rw-r--r--gcc/config/mcore/xm-mcore.h5
-rw-r--r--gcc/config/mips/abi64.h17
-rw-r--r--gcc/config/mips/ecoff.h1
-rw-r--r--gcc/config/mips/elf.h6
-rw-r--r--gcc/config/mips/elf64.h6
-rw-r--r--gcc/config/mips/gnu.h18
-rw-r--r--gcc/config/mips/iris4.h25
-rw-r--r--gcc/config/mips/iris5.h36
-rw-r--r--gcc/config/mips/iris6.h67
-rw-r--r--gcc/config/mips/irix6-libc-compat.c140
-rw-r--r--gcc/config/mips/linux.h107
-rw-r--r--gcc/config/mips/mips.c843
-rw-r--r--gcc/config/mips/mips.h188
-rw-r--r--gcc/config/mips/mips.md292
-rw-r--r--gcc/config/mips/osfrose.h29
-rw-r--r--gcc/config/mips/rtems.h2
-rw-r--r--gcc/config/mips/rtems64.h4
-rw-r--r--gcc/config/mips/sni-svr4.h9
-rw-r--r--gcc/config/mips/t-iris614
-rw-r--r--gcc/config/mips/xm-mips.h5
-rw-r--r--gcc/config/mn10200/mn10200.c1
-rw-r--r--gcc/config/mn10200/t-mn102004
-rw-r--r--gcc/config/mn10200/xm-mn10200.h4
-rw-r--r--gcc/config/mn10300/mn10300.c1
-rw-r--r--gcc/config/mn10300/mn10300.h11
-rw-r--r--gcc/config/mn10300/xm-mn10300.h4
-rw-r--r--gcc/config/nextstep.h5
-rw-r--r--gcc/config/ns32k/ns32k.c1
-rw-r--r--gcc/config/ns32k/xm-ns32k.h4
-rw-r--r--gcc/config/openbsd.h11
-rw-r--r--gcc/config/pa/lib2funcs.asm1
-rw-r--r--gcc/config/pa/long_double.h3
-rw-r--r--gcc/config/pa/pa-hpux10.h5
-rw-r--r--gcc/config/pa/pa.c295
-rw-r--r--gcc/config/pa/pa.h41
-rw-r--r--gcc/config/pa/pa.md109
-rw-r--r--gcc/config/pa/pa32-regs.h2
-rw-r--r--gcc/config/pa/quadlib.c9
-rw-r--r--gcc/config/pa/rtems.h4
-rw-r--r--gcc/config/pa/som.h57
-rw-r--r--gcc/config/pa/xm-linux.h4
-rw-r--r--gcc/config/pa/xm-pa.h4
-rw-r--r--gcc/config/pa/xm-pa64hpux.h5
-rw-r--r--gcc/config/pa/xm-pahpux.h6
-rw-r--r--gcc/config/pa/xm-papro.h4
-rw-r--r--gcc/config/pdp11/pdp11.c1
-rw-r--r--gcc/config/pdp11/pdp11.h4
-rw-r--r--gcc/config/pj/lib1funcs.S18
-rw-r--r--gcc/config/pj/pj.c1
-rw-r--r--gcc/config/pj/pj.h12
-rw-r--r--gcc/config/pj/xm-pj.h4
-rw-r--r--gcc/config/psos.h12
-rw-r--r--gcc/config/ptx4.h15
-rw-r--r--gcc/config/romp/romp.c1
-rw-r--r--gcc/config/romp/xm-romp.h5
-rw-r--r--gcc/config/rs6000/aix.h58
-rw-r--r--gcc/config/rs6000/aix43.h4
-rw-r--r--gcc/config/rs6000/aix51.h30
-rw-r--r--gcc/config/rs6000/linux.h66
-rw-r--r--gcc/config/rs6000/netbsd.h61
-rw-r--r--gcc/config/rs6000/rs6000-protos.h12
-rw-r--r--gcc/config/rs6000/rs6000.c941
-rw-r--r--gcc/config/rs6000/rs6000.h164
-rw-r--r--gcc/config/rs6000/rs6000.md694
-rw-r--r--gcc/config/rs6000/rtems.h14
-rw-r--r--gcc/config/rs6000/sysv4.h113
-rw-r--r--gcc/config/rs6000/t-ppccomm36
-rw-r--r--gcc/config/rs6000/tramp.asm2
-rw-r--r--gcc/config/rs6000/xm-beos.h7
-rw-r--r--gcc/config/rs6000/xm-rs6000.h5
-rw-r--r--gcc/config/rs6000/xm-sysv4.h5
-rw-r--r--gcc/config/s390/fixdfdi.h301
-rw-r--r--gcc/config/s390/linux.h381
-rw-r--r--gcc/config/s390/linux64.h80
-rw-r--r--gcc/config/s390/s390-protos.h86
-rw-r--r--gcc/config/s390/s390.c3182
-rw-r--r--gcc/config/s390/s390.h1881
-rw-r--r--gcc/config/s390/s390.md5764
-rw-r--r--gcc/config/s390/t-linux6
-rw-r--r--gcc/config/s390/xm-s390.h (renamed from gcc/ch/actions.h)31
-rw-r--r--gcc/config/s390/xm-s390x.h41
-rw-r--r--gcc/config/sh/crti.asm6
-rw-r--r--gcc/config/sh/crtn.asm6
-rw-r--r--gcc/config/sh/lib1funcs.asm17
-rw-r--r--gcc/config/sh/rtems.h4
-rw-r--r--gcc/config/sh/rtemself.h4
-rw-r--r--gcc/config/sh/sh.c243
-rw-r--r--gcc/config/sh/sh.h20
-rw-r--r--gcc/config/sh/sh.md94
-rw-r--r--gcc/config/sh/xm-sh.h4
-rw-r--r--gcc/config/sparc/linux-aout.h6
-rw-r--r--gcc/config/sparc/linux.h13
-rw-r--r--gcc/config/sparc/linux64.h13
-rw-r--r--gcc/config/sparc/openbsd.h3
-rw-r--r--gcc/config/sparc/rtems.h6
-rw-r--r--gcc/config/sparc/rtemself.h8
-rw-r--r--gcc/config/sparc/sol2-sld-64.h26
-rw-r--r--gcc/config/sparc/sol2.h19
-rw-r--r--gcc/config/sparc/sp64-elf.h38
-rw-r--r--gcc/config/sparc/sparc.c43
-rw-r--r--gcc/config/sparc/sparc.h6
-rw-r--r--gcc/config/sparc/sparc.md124
-rw-r--r--gcc/config/sparc/t-openbsd5
-rw-r--r--gcc/config/sparc/xm-sparc.h5
-rw-r--r--gcc/config/sparc/xm-sysv4.h5
-rw-r--r--gcc/config/t-freebsd6
-rw-r--r--gcc/config/t-freebsd-thread2
-rw-r--r--gcc/config/t-libgcc-pic2
-rw-r--r--gcc/config/t-linux22
-rw-r--r--gcc/config/t-linux-aout3
-rw-r--r--gcc/config/t-netbsd3
-rw-r--r--gcc/config/t-openbsd2
-rw-r--r--gcc/config/t-rtems3
-rw-r--r--gcc/config/t-slibgcc-elf-ver (renamed from gcc/config/sparc/t-slibgcc)13
-rw-r--r--gcc/config/t-slibgcc-sld (renamed from gcc/config/sparc/t-slibgcc-sld)10
-rw-r--r--gcc/config/v850/rtems.h4
-rw-r--r--gcc/config/v850/v850.c4
-rw-r--r--gcc/config/v850/xm-v850.h4
-rw-r--r--gcc/config/vax/vax.c1
-rw-r--r--gcc/config/vax/vax.h53
-rw-r--r--gcc/config/vax/xm-vax.h5
-rw-r--r--gcc/config/vax/xm-vms.h4
-rw-r--r--gcc/config/we32k/xm-we32k.h5
-rw-r--r--gcc/config/x-linux3
-rw-r--r--gcc/config/xm-lynx.h4
-rw-r--r--gcc/config/xm-std32.h4
-rw-r--r--gcc/config/xtensa/elf.h138
-rw-r--r--gcc/config/xtensa/lib1funcs.asm428
-rw-r--r--gcc/config/xtensa/lib2funcs.S214
-rw-r--r--gcc/config/xtensa/linux.h94
-rw-r--r--gcc/config/xtensa/t-xtensa28
-rw-r--r--gcc/config/xtensa/xm-xtensa.h44
-rw-r--r--gcc/config/xtensa/xtensa-config.h50
-rw-r--r--gcc/config/xtensa/xtensa-protos.h116
-rw-r--r--gcc/config/xtensa/xtensa.c2662
-rw-r--r--gcc/config/xtensa/xtensa.h2431
-rw-r--r--gcc/config/xtensa/xtensa.md2415
-rwxr-xr-xgcc/configure1188
-rw-r--r--gcc/configure.in419
-rw-r--r--gcc/convert.c6
-rw-r--r--gcc/cp/ChangeLog1581
-rw-r--r--gcc/cp/Make-lang.in63
-rw-r--r--gcc/cp/NEWS10
-rw-r--r--gcc/cp/call.c437
-rw-r--r--gcc/cp/class.c2163
-rw-r--r--gcc/cp/cp-tree.def8
-rw-r--r--gcc/cp/cp-tree.h291
-rw-r--r--gcc/cp/cvt.c27
-rw-r--r--gcc/cp/decl.c1041
-rw-r--r--gcc/cp/decl2.c433
-rw-r--r--gcc/cp/dump.c68
-rw-r--r--gcc/cp/errfn.c3
-rw-r--r--gcc/cp/error.c37
-rw-r--r--gcc/cp/except.c1021
-rw-r--r--gcc/cp/expr.c36
-rw-r--r--gcc/cp/friend.c48
-rw-r--r--gcc/cp/gxxint.texi1859
-rw-r--r--gcc/cp/init.c187
-rw-r--r--gcc/cp/lang-options.h141
-rw-r--r--gcc/cp/lang-specs.h40
-rw-r--r--gcc/cp/lex.c33
-rw-r--r--gcc/cp/mangle.c287
-rw-r--r--gcc/cp/method.c1995
-rw-r--r--gcc/cp/operators.def123
-rw-r--r--gcc/cp/optimize.c378
-rw-r--r--gcc/cp/parse.y38
-rw-r--r--gcc/cp/pt.c361
-rw-r--r--gcc/cp/repo.c29
-rw-r--r--gcc/cp/rtti.c628
-rw-r--r--gcc/cp/search.c123
-rw-r--r--gcc/cp/semantics.c288
-rw-r--r--gcc/cp/spew.c55
-rw-r--r--gcc/cp/tree.c94
-rw-r--r--gcc/cp/typeck.c473
-rw-r--r--gcc/cp/typeck2.c28
-rw-r--r--gcc/cpp.1731
-rw-r--r--gcc/cpp.texi3695
-rw-r--r--gcc/cppdefault.c7
-rw-r--r--gcc/cpperror.c3
-rw-r--r--gcc/cppexp.c7
-rw-r--r--gcc/cppfiles.c910
-rw-r--r--gcc/cpphash.h60
-rw-r--r--gcc/cppinit.c223
-rw-r--r--gcc/cpplex.c191
-rw-r--r--gcc/cpplib.c105
-rw-r--r--gcc/cpplib.h12
-rw-r--r--gcc/cppmacro.c106
-rw-r--r--gcc/cppmain.c12
-rw-r--r--gcc/cppspec.c3
-rw-r--r--gcc/cross-make3
-rw-r--r--gcc/crtstuff.c68
-rw-r--r--gcc/cse.c104
-rw-r--r--gcc/dbxout.c69
-rw-r--r--gcc/defaults.h79
-rw-r--r--gcc/diagnostic.c128
-rw-r--r--gcc/doc/.cvsignore3
-rw-r--r--gcc/doc/c-tree.texi (renamed from gcc/c-tree.texi)404
-rw-r--r--gcc/doc/contrib.texi (renamed from gcc/contrib.texi)202
-rw-r--r--gcc/doc/cpp.1721
-rw-r--r--gcc/doc/cpp.texi4287
-rw-r--r--gcc/doc/cppinternals.texi (renamed from gcc/cppinternals.texi)220
-rw-r--r--gcc/doc/extend.texi (renamed from gcc/extend.texi)956
-rw-r--r--gcc/doc/fsf-funding.7185
-rw-r--r--gcc/doc/gcc.1 (renamed from gcc/gcc.1)4804
-rw-r--r--gcc/doc/gcc.texi (renamed from gcc/gcc.texi)2086
-rw-r--r--gcc/doc/gcov.1 (renamed from gcc/gcov.1)193
-rw-r--r--gcc/doc/gcov.texi (renamed from gcc/gcov.texi)191
-rw-r--r--gcc/doc/gfdl.7515
-rw-r--r--gcc/doc/gpl.7536
-rw-r--r--gcc/doc/include/fdl.texi434
-rw-r--r--gcc/doc/include/funding.texi60
-rw-r--r--gcc/doc/include/gpl.texi409
-rw-r--r--gcc/doc/include/texinfo.tex (renamed from gcc/texinfo.tex)113
-rw-r--r--gcc/doc/install-old.texi843
-rw-r--r--gcc/doc/install.texi3583
-rwxr-xr-xgcc/doc/install.texi2html30
-rw-r--r--gcc/doc/invoke.texi (renamed from gcc/invoke.texi)4178
-rw-r--r--gcc/doc/md.texi (renamed from gcc/md.texi)353
-rw-r--r--gcc/doc/objc.texi (renamed from libobjc/objc-features.texi)260
-rw-r--r--gcc/doc/rtl.texi (renamed from gcc/rtl.texi)208
-rw-r--r--gcc/doc/tm.texi (renamed from gcc/tm.texi)787
-rw-r--r--gcc/doloop.c121
-rw-r--r--gcc/dwarf2.h31
-rw-r--r--gcc/dwarf2asm.c1032
-rw-r--r--gcc/dwarf2asm.h80
-rw-r--r--gcc/dwarf2out.c2663
-rw-r--r--gcc/dwarf2out.h3
-rw-r--r--gcc/dwarfout.c561
-rw-r--r--gcc/eh-common.h162
-rw-r--r--gcc/emit-rtl.c65
-rw-r--r--gcc/errors.c55
-rw-r--r--gcc/errors.h13
-rw-r--r--gcc/except.c5678
-rw-r--r--gcc/except.h573
-rw-r--r--gcc/explow.c2
-rw-r--r--gcc/expmed.c13
-rw-r--r--gcc/expr.c177
-rw-r--r--gcc/expr.h27
-rw-r--r--gcc/f/BUGS158
-rw-r--r--gcc/f/ChangeLog191
-rw-r--r--gcc/f/Make-lang.in70
-rw-r--r--gcc/f/NEWS432
-rw-r--r--gcc/f/bugs.texi55
-rw-r--r--gcc/f/com.c42
-rw-r--r--gcc/f/g77.texi842
-rw-r--r--gcc/f/g77install.texi505
-rw-r--r--gcc/f/intdoc.c11
-rw-r--r--gcc/f/lang-options.h231
-rw-r--r--gcc/f/lang-specs.h24
-rw-r--r--gcc/f/lex.c6
-rw-r--r--gcc/f/news.texi44
-rw-r--r--gcc/f/proj.h21
-rw-r--r--gcc/f/root.texi6
-rw-r--r--gcc/f/ste.c4
-rw-r--r--gcc/f/target.h2
-rw-r--r--gcc/f/top.c17
-rw-r--r--gcc/f/version.c2
-rw-r--r--gcc/final.c84
-rw-r--r--gcc/fixinc/Makefile.in17
-rw-r--r--gcc/fixinc/README22
-rw-r--r--gcc/fixinc/check.tpl120
-rw-r--r--gcc/fixinc/fixfixes.c8
-rwxr-xr-xgcc/fixinc/fixinc.dgux8
-rw-r--r--gcc/fixinc/fixinc.interix8
-rw-r--r--gcc/fixinc/fixinc.ptx8
-rwxr-xr-xgcc/fixinc/fixinc.svr48
-rw-r--r--gcc/fixinc/fixinc.winnt8
-rwxr-xr-xgcc/fixinc/fixinc.wrap8
-rw-r--r--gcc/fixinc/fixincl.c33
-rwxr-xr-xgcc/fixinc/fixincl.sh15
-rw-r--r--gcc/fixinc/fixincl.tpl251
-rw-r--r--gcc/fixinc/fixincl.x1665
-rw-r--r--gcc/fixinc/fixlib.h13
-rw-r--r--gcc/fixinc/fixtests.c17
-rwxr-xr-xgcc/fixinc/genfixes10
-rw-r--r--gcc/fixinc/gnu-regex.c9
-rw-r--r--gcc/fixinc/inclhack.def631
-rwxr-xr-xgcc/fixinc/mkfixinc.sh113
-rw-r--r--gcc/fixinc/server.c38
-rw-r--r--gcc/fixinc/tests/base/arpa/inet.h2
-rw-r--r--gcc/fixinc/tests/base/assert.h5
-rw-r--r--gcc/fixinc/tests/base/curses.h5
-rw-r--r--gcc/fixinc/tests/base/fixinc-test-limits.h19
-rw-r--r--gcc/fixinc/tests/base/math.h15
-rw-r--r--gcc/fixinc/tests/base/pthread.h16
-rw-r--r--gcc/fixinc/tests/base/stdio.h15
-rw-r--r--gcc/fixinc/tests/base/stdlib.h6
-rw-r--r--gcc/fixinc/tests/base/sys/cdefs.h (renamed from gcc/fixinc/tests/base/machine/ansi.h)8
-rw-r--r--gcc/fixinc/tests/base/sys/types.h4
-rw-r--r--gcc/fixinc/tests/base/testing.h53
-rw-r--r--gcc/fixinc/tests/base/types/vxTypesBase.h2
-rw-r--r--gcc/flags.h12
-rw-r--r--gcc/flow.c820
-rw-r--r--gcc/fold-const.c310
-rw-r--r--gcc/frame-dwarf2.c778
-rw-r--r--gcc/frame.c337
-rw-r--r--gcc/frame.h287
-rw-r--r--gcc/function.c249
-rw-r--r--gcc/function.h176
-rw-r--r--gcc/gcc.c362
-rw-r--r--gcc/gcc.h12
-rwxr-xr-xgcc/gccbug.in35
-rw-r--r--gcc/gccspec.c64
-rw-r--r--gcc/gcse.c56
-rw-r--r--gcc/genemit.c2
-rw-r--r--gcc/genflags.c7
-rw-r--r--gcc/genopinit.c2
-rw-r--r--gcc/genoutput.c2
-rw-r--r--gcc/genrecog.c2
-rw-r--r--gcc/gensupport.c20
-rw-r--r--gcc/ggc-common.c15
-rw-r--r--gcc/ggc-none.c6
-rw-r--r--gcc/ggc-page.c10
-rw-r--r--gcc/ggc-simple.c25
-rw-r--r--gcc/ggc.h9
-rw-r--r--gcc/ginclude/ppc-asm.h8
-rw-r--r--gcc/glimits.h7
-rw-r--r--gcc/gsyslimits.h2
-rw-r--r--gcc/gthr-dce.h34
-rw-r--r--gcc/gthr-posix.h58
-rw-r--r--gcc/gthr-rtems.h17
-rw-r--r--gcc/gthr-single.h39
-rw-r--r--gcc/gthr-solaris.h2
-rw-r--r--gcc/gthr-win32.h2
-rw-r--r--gcc/haifa-sched.c40
-rw-r--r--gcc/hash.c10
-rw-r--r--gcc/hash.h18
-rw-r--r--gcc/ifcvt.c110
-rw-r--r--gcc/install.texi2288
-rw-r--r--gcc/integrate.c300
-rw-r--r--gcc/integrate.h9
-rw-r--r--gcc/intl/ChangeLog32
-rwxr-xr-xgcc/intl/po2tbl.sed.in2
-rw-r--r--gcc/java/ChangeLog713
-rw-r--r--gcc/java/Make-lang.in34
-rw-r--r--gcc/java/boehm.c3
-rw-r--r--gcc/java/check-init.c4
-rw-r--r--gcc/java/class.c146
-rw-r--r--gcc/java/config-lang.in9
-rw-r--r--gcc/java/constants.c10
-rw-r--r--gcc/java/decl.c107
-rw-r--r--gcc/java/except.c66
-rw-r--r--gcc/java/expr.c72
-rw-r--r--gcc/java/gcj.texi528
-rw-r--r--gcc/java/gjavah.c88
-rw-r--r--gcc/java/java-tree.def4
-rw-r--r--gcc/java/java-tree.h65
-rw-r--r--gcc/java/jcf-io.c4
-rw-r--r--gcc/java/jcf-parse.c361
-rw-r--r--gcc/java/jcf-reader.c28
-rw-r--r--gcc/java/jcf-write.c154
-rw-r--r--gcc/java/jcf.h9
-rw-r--r--gcc/java/jv-scan.c2
-rw-r--r--gcc/java/jvgenmain.c14
-rw-r--r--gcc/java/jvspec.c188
-rw-r--r--gcc/java/lang-options.h51
-rw-r--r--gcc/java/lang-specs.h10
-rw-r--r--gcc/java/lang.c19
-rw-r--r--gcc/java/lex.c106
-rw-r--r--gcc/java/lex.h4
-rw-r--r--gcc/java/mangle.c30
-rw-r--r--gcc/java/parse-scan.y40
-rw-r--r--gcc/java/parse.h36
-rw-r--r--gcc/java/parse.y838
-rw-r--r--gcc/java/typeck.c28
-rw-r--r--gcc/java/verify.c28
-rw-r--r--gcc/java/zipfile.h2
-rw-r--r--gcc/jump.c150
-rw-r--r--gcc/libgcc-std.ver158
-rw-r--r--gcc/libgcc2.c1455
-rw-r--r--gcc/libgcc2.h11
-rw-r--r--gcc/limity.h2
-rwxr-xr-xgcc/listing227
-rw-r--r--gcc/lists.c9
-rw-r--r--gcc/longlong.h3
-rw-r--r--gcc/loop.c185
-rw-r--r--gcc/loop.h2
-rw-r--r--gcc/mbchar.c2
-rw-r--r--gcc/mips-tfile.c46
-rw-r--r--gcc/mkconfig.sh71
-rw-r--r--gcc/mkdeps.c21
-rw-r--r--gcc/mklibgcc.in63
-rw-r--r--gcc/objc/lang-options.h19
-rw-r--r--gcc/objc/lang-specs.h8
-rw-r--r--gcc/objc/objc-act.c74
-rw-r--r--gcc/optabs.c27
-rw-r--r--gcc/output.h2
-rw-r--r--gcc/params.c84
-rw-r--r--gcc/params.def91
-rw-r--r--gcc/params.h99
-rw-r--r--gcc/po/ChangeLog59
-rw-r--r--gcc/po/Makefile.in.in5
-rw-r--r--gcc/po/POTFILES.in488
-rw-r--r--gcc/po/cat-id-tbl.c5466
-rw-r--r--gcc/po/gcc.pot9115
-rw-r--r--gcc/predict.c3
-rw-r--r--gcc/print-rtl.c21
-rw-r--r--gcc/print-tree.c9
-rw-r--r--gcc/profile.c51
-rw-r--r--gcc/protoize.c9
-rw-r--r--gcc/pself.c1
-rw-r--r--gcc/pself1.c1
-rw-r--r--gcc/pself2.c1
-rw-r--r--gcc/pself3.c1
-rw-r--r--gcc/pself4.c2
-rw-r--r--gcc/pself5.c5
-rw-r--r--gcc/recog.c14
-rw-r--r--gcc/reg-stack.c55
-rw-r--r--gcc/regclass.c143
-rw-r--r--gcc/regmove.c157
-rw-r--r--gcc/regrename.c35
-rw-r--r--gcc/reload.c39
-rw-r--r--gcc/reload1.c185
-rw-r--r--gcc/reorg.c169
-rw-r--r--gcc/resource.c40
-rw-r--r--gcc/rtl.c46
-rw-r--r--gcc/rtl.def5
-rw-r--r--gcc/rtl.h35
-rw-r--r--gcc/rtlanal.c121
-rw-r--r--gcc/sched-deps.c120
-rw-r--r--gcc/sched-int.h8
-rw-r--r--gcc/sdbout.c65
-rw-r--r--gcc/sibcall.c15
-rw-r--r--gcc/simplify-rtx.c29
-rw-r--r--gcc/stmt.c1308
-rw-r--r--gcc/stor-layout.c5
-rw-r--r--gcc/stringpool.c21
-rw-r--r--gcc/sys-protos.h1
-rw-r--r--gcc/system.h35
-rw-r--r--gcc/testsuite/ChangeLog1090
-rw-r--r--gcc/testsuite/g++.dg/mangle1.C28
-rw-r--r--gcc/testsuite/g++.dg/ref1.C47
-rw-r--r--gcc/testsuite/g++.dg/sizeof1.C15
-rw-r--r--gcc/testsuite/g++.dg/special/ecos.exp23
-rw-r--r--gcc/testsuite/g++.dg/special/initp1.C (renamed from gcc/testsuite/g++.old-deja/g++.ext/initp1.C)17
-rw-r--r--gcc/testsuite/g++.dg/unify1.C26
-rw-r--r--gcc/testsuite/g++.dg/vtgc1.C44
-rw-r--r--gcc/testsuite/g++.old-deja/g++.abi/bitfields.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.abi/crash1.C21
-rw-r--r--gcc/testsuite/g++.old-deja/g++.abi/cxa_vec.C4
-rw-r--r--gcc/testsuite/g++.old-deja/g++.abi/empty2.C136
-rw-r--r--gcc/testsuite/g++.old-deja/g++.abi/empty3.C24
-rw-r--r--gcc/testsuite/g++.old-deja/g++.abi/empty4.C84
-rw-r--r--gcc/testsuite/g++.old-deja/g++.abi/mangle1.C7
-rw-r--r--gcc/testsuite/g++.old-deja/g++.abi/primary3.C14
-rw-r--r--gcc/testsuite/g++.old-deja/g++.abi/ptrmem.C39
-rw-r--r--gcc/testsuite/g++.old-deja/g++.abi/vbase2.C27
-rw-r--r--gcc/testsuite/g++.old-deja/g++.abi/vbase3.C26
-rw-r--r--gcc/testsuite/g++.old-deja/g++.abi/vbase4.C165
-rw-r--r--gcc/testsuite/g++.old-deja/g++.abi/vbase5.C22
-rw-r--r--gcc/testsuite/g++.old-deja/g++.abi/vbase6.C22
-rw-r--r--gcc/testsuite/g++.old-deja/g++.abi/vbase7.C40
-rw-r--r--gcc/testsuite/g++.old-deja/g++.abi/vbase8-10.C74
-rw-r--r--gcc/testsuite/g++.old-deja/g++.abi/vbase8-21.C74
-rw-r--r--gcc/testsuite/g++.old-deja/g++.abi/vbase8-22.C79
-rw-r--r--gcc/testsuite/g++.old-deja/g++.abi/vbase8-5.C79
-rw-r--r--gcc/testsuite/g++.old-deja/g++.abi/vbase8-9.C76
-rw-r--r--gcc/testsuite/g++.old-deja/g++.abi/vbase9.C60
-rw-r--r--gcc/testsuite/g++.old-deja/g++.abi/vtable2.C20
-rw-r--r--gcc/testsuite/g++.old-deja/g++.abi/vtable3.h12
-rw-r--r--gcc/testsuite/g++.old-deja/g++.abi/vthunk1.C45
-rw-r--r--gcc/testsuite/g++.old-deja/g++.benjamin/15071.C4
-rw-r--r--gcc/testsuite/g++.old-deja/g++.brendan/copy9.C7
-rw-r--r--gcc/testsuite/g++.old-deja/g++.brendan/crash15.C10
-rw-r--r--gcc/testsuite/g++.old-deja/g++.brendan/crash38.C4
-rw-r--r--gcc/testsuite/g++.old-deja/g++.brendan/crash49.C6
-rw-r--r--gcc/testsuite/g++.old-deja/g++.brendan/crash52.C4
-rw-r--r--gcc/testsuite/g++.old-deja/g++.brendan/crash62.C10
-rw-r--r--gcc/testsuite/g++.old-deja/g++.brendan/cvt1.C4
-rw-r--r--gcc/testsuite/g++.old-deja/g++.brendan/err-msg3.C4
-rw-r--r--gcc/testsuite/g++.old-deja/g++.brendan/misc13.C11
-rw-r--r--gcc/testsuite/g++.old-deja/g++.brendan/nest21.C38
-rw-r--r--gcc/testsuite/g++.old-deja/g++.brendan/ptolemy2.C8
-rw-r--r--gcc/testsuite/g++.old-deja/g++.eh/catch13.C19
-rw-r--r--gcc/testsuite/g++.old-deja/g++.eh/catch14.C33
-rw-r--r--gcc/testsuite/g++.old-deja/g++.eh/crash3.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.eh/crash5.C12
-rw-r--r--gcc/testsuite/g++.old-deja/g++.eh/crash6.C26
-rw-r--r--gcc/testsuite/g++.old-deja/g++.eh/new1.C14
-rw-r--r--gcc/testsuite/g++.old-deja/g++.eh/new2.C9
-rw-r--r--gcc/testsuite/g++.old-deja/g++.eh/spec7.C19
-rw-r--r--gcc/testsuite/g++.old-deja/g++.eh/vbase3.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.ext/anon3.C36
-rw-r--r--gcc/testsuite/g++.old-deja/g++.ext/arrnew.C4
-rw-r--r--gcc/testsuite/g++.old-deja/g++.ext/attrib5.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.ext/comint1.C1
-rw-r--r--gcc/testsuite/g++.old-deja/g++.ext/instantiate1.C22
-rw-r--r--gcc/testsuite/g++.old-deja/g++.ext/instantiate2.C16
-rw-r--r--gcc/testsuite/g++.old-deja/g++.ext/instantiate3.C3
-rw-r--r--gcc/testsuite/g++.old-deja/g++.ext/overload1.C20
-rw-r--r--gcc/testsuite/g++.old-deja/g++.ext/realpt1.C12
-rw-r--r--gcc/testsuite/g++.old-deja/g++.jason/2371.C6
-rw-r--r--gcc/testsuite/g++.old-deja/g++.jason/template24.C7
-rw-r--r--gcc/testsuite/g++.old-deja/g++.jason/template31.C9
-rw-r--r--gcc/testsuite/g++.old-deja/g++.jason/thunk1.C3
-rw-r--r--gcc/testsuite/g++.old-deja/g++.jason/thunk2.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.jason/thunk3.C3
-rw-r--r--gcc/testsuite/g++.old-deja/g++.jason/typeid1.C6
-rw-r--r--gcc/testsuite/g++.old-deja/g++.law/arg1.C11
-rw-r--r--gcc/testsuite/g++.old-deja/g++.law/arg8.C16
-rw-r--r--gcc/testsuite/g++.old-deja/g++.law/arm12.C10
-rw-r--r--gcc/testsuite/g++.old-deja/g++.law/arm9.C11
-rw-r--r--gcc/testsuite/g++.old-deja/g++.law/bad-error7.C10
-rw-r--r--gcc/testsuite/g++.old-deja/g++.law/builtin1.C3
-rw-r--r--gcc/testsuite/g++.old-deja/g++.law/code-gen5.C41
-rw-r--r--gcc/testsuite/g++.old-deja/g++.law/ctors10.C10
-rw-r--r--gcc/testsuite/g++.old-deja/g++.law/ctors12.C12
-rw-r--r--gcc/testsuite/g++.old-deja/g++.law/ctors13.C8
-rw-r--r--gcc/testsuite/g++.old-deja/g++.law/ctors17.C4
-rw-r--r--gcc/testsuite/g++.old-deja/g++.law/ctors6.C6
-rw-r--r--gcc/testsuite/g++.old-deja/g++.law/cvt16.C5
-rw-r--r--gcc/testsuite/g++.old-deja/g++.law/cvt2.C25
-rw-r--r--gcc/testsuite/g++.old-deja/g++.law/cvt7.C18
-rw-r--r--gcc/testsuite/g++.old-deja/g++.law/except5.C5
-rw-r--r--gcc/testsuite/g++.old-deja/g++.law/missed-error2.C6
-rw-r--r--gcc/testsuite/g++.old-deja/g++.law/nest3.C8
-rw-r--r--gcc/testsuite/g++.old-deja/g++.law/operators32.C6
-rw-r--r--gcc/testsuite/g++.old-deja/g++.law/vbase1.C5
-rw-r--r--gcc/testsuite/g++.old-deja/g++.law/virtual3.C10
-rw-r--r--gcc/testsuite/g++.old-deja/g++.law/visibility1.C12
-rw-r--r--gcc/testsuite/g++.old-deja/g++.law/visibility10.C7
-rw-r--r--gcc/testsuite/g++.old-deja/g++.law/visibility13.C6
-rw-r--r--gcc/testsuite/g++.old-deja/g++.law/visibility17.C12
-rw-r--r--gcc/testsuite/g++.old-deja/g++.law/visibility2.C12
-rw-r--r--gcc/testsuite/g++.old-deja/g++.law/visibility22.C7
-rw-r--r--gcc/testsuite/g++.old-deja/g++.law/visibility25.C9
-rw-r--r--gcc/testsuite/g++.old-deja/g++.law/visibility7.C6
-rw-r--r--gcc/testsuite/g++.old-deja/g++.law/vtable2.C1
-rw-r--r--gcc/testsuite/g++.old-deja/g++.law/weak.C12
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/eh2.C13
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/eh33.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/eh50.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/memoize1.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/net34.C12
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/net46.C8
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/net5.C10
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p2846.C15
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p5469.C4
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p5469a.C4
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/p658.C10
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/rtti1.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/thunk1.C1
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/thunk2.C4
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/thunk3.C4
-rw-r--r--gcc/testsuite/g++.old-deja/g++.ns/ns14.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.ns/template15.C5
-rw-r--r--gcc/testsuite/g++.old-deja/g++.ns/template17.C37
-rw-r--r--gcc/testsuite/g++.old-deja/g++.ns/template18.C24
-rw-r--r--gcc/testsuite/g++.old-deja/g++.ns/type2.C19
-rw-r--r--gcc/testsuite/g++.old-deja/g++.oliva/ChangeLog36
-rw-r--r--gcc/testsuite/g++.old-deja/g++.oliva/delete1.C4
-rw-r--r--gcc/testsuite/g++.old-deja/g++.oliva/delete3.C9
-rw-r--r--gcc/testsuite/g++.old-deja/g++.oliva/friend1.C12
-rw-r--r--gcc/testsuite/g++.old-deja/g++.oliva/thunk1.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/anon8.C22
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/array4.C10
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/array5.C20
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/asm2.C11
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/builtins1.C13
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/builtins2.C20
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/builtins3.C16
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/builtins4.C16
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/call1.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/cond7.C26
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/conv7.C45
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/copy3.C23
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/crash14.C1
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/crash18.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/crash27.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/crash31.C3
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/crash40.C19
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/crash41.C13
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/crash42.C17
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/debug7.C11
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/debug8.C21
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/decl9.C9
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/defarg9.C52
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/delete8.C39
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/eh4.C12
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/empty1.C6
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/empty2.C10
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/empty3.C28
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/enum3.C13
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/externC5.C19
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/fnname1.C8
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/friend11.C12
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/init16.C27
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/inline19.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/inline20.C58
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/inline21.C39
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/inline8.C14
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/lex1.C12
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/lineno5.C19
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/linkage7.C14
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/lookup22.C13
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/lookup23.C13
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/mangle1.C58
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/mangle3.C41
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/new7.C39
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/op2.C36
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/op3.C36
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/optimize1.C70
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/optimize2.C74
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/optimize3.C38
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/optimize4.C31
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/overload14.C31
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/override1.C20
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/override2.C9
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/perf1.C78
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/pod1.C21
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/ptrmem6.C4
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/ref4.C28
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/regstack.C31
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/return1.C17
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/sibcall1.C6
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/static8.C13
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/std1.C1
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/thunk1.C35
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/typeid1.C15
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/using9.C21
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/vector1.C16
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/warn5.C19
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/warn6.C17
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/warn7.C45
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/array7.C11
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/const2.C9
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/crash68.C70
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/deduct5.C33
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/deduct6.C24
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/deduct7.C14
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/friend48.C17
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/friend49.C26
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/mangle2.C40
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/memtemp100.C40
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/memtemp99.C10
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/ptrmem2.C5
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/ref4.C25
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/repo4.C15
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/spec40.C13
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/static3.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/static6.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/typename28.C27
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/unify8.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/using1.C36
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/using2.C26
-rw-r--r--gcc/testsuite/g++.old-deja/g++.robertl/eb109.C4
-rw-r--r--gcc/testsuite/g++.old-deja/g++.robertl/eb113.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.robertl/eb115.C4
-rw-r--r--gcc/testsuite/g++.old-deja/g++.robertl/eb118.C7
-rw-r--r--gcc/testsuite/g++.old-deja/g++.robertl/eb130.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.robertl/eb133.C3
-rw-r--r--gcc/testsuite/g++.old-deja/g++.robertl/eb15.C13
-rw-r--r--gcc/testsuite/g++.old-deja/g++.robertl/eb21.C4
-rw-r--r--gcc/testsuite/g++.old-deja/g++.robertl/eb24.C4
-rw-r--r--gcc/testsuite/g++.old-deja/g++.robertl/eb27.C10
-rw-r--r--gcc/testsuite/g++.old-deja/g++.robertl/eb3.C4
-rw-r--r--gcc/testsuite/g++.old-deja/g++.robertl/eb30.C7
-rw-r--r--gcc/testsuite/g++.old-deja/g++.robertl/eb31.C4
-rw-r--r--gcc/testsuite/g++.old-deja/g++.robertl/eb33.C8
-rw-r--r--gcc/testsuite/g++.old-deja/g++.robertl/eb39.C13
-rw-r--r--gcc/testsuite/g++.old-deja/g++.robertl/eb4.C4
-rw-r--r--gcc/testsuite/g++.old-deja/g++.robertl/eb41.C6
-rw-r--r--gcc/testsuite/g++.old-deja/g++.robertl/eb42.C13
-rw-r--r--gcc/testsuite/g++.old-deja/g++.robertl/eb44.C8
-rw-r--r--gcc/testsuite/g++.old-deja/g++.robertl/eb46.C7
-rw-r--r--gcc/testsuite/g++.old-deja/g++.robertl/eb54.C9
-rw-r--r--gcc/testsuite/g++.old-deja/g++.robertl/eb55.C4
-rw-r--r--gcc/testsuite/g++.old-deja/g++.robertl/eb63.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.robertl/eb66.C4
-rw-r--r--gcc/testsuite/g++.old-deja/g++.robertl/eb73.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.robertl/eb77.C10
-rw-r--r--gcc/testsuite/g++.old-deja/g++.robertl/eb79.C4
-rw-r--r--gcc/testsuite/g++.old-deja/g++.robertl/eb83.C4
-rw-r--r--gcc/testsuite/g++.old-deja/g++.warn/iomanip.C5
-rw-r--r--gcc/testsuite/g++.old-deja/g++.warn/virt1.C10
-rw-r--r--gcc/testsuite/g77.dg/20010216-1.f51
-rw-r--r--gcc/testsuite/g77.dg/dg.exp (renamed from libstdc++-v3/testsuite/libstdc++.tests/tests.exp)27
-rw-r--r--gcc/testsuite/g77.f-torture/compile/20000629-1.x10
-rw-r--r--gcc/testsuite/g77.f-torture/compile/20010321-1.f8
-rw-r--r--gcc/testsuite/g77.f-torture/compile/20010519-1.f1326
-rw-r--r--gcc/testsuite/g77.f-torture/compile/cpp2.F7
-rw-r--r--gcc/testsuite/g77.f-torture/execute/20010116.x2
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20000804-1.x10
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20001205-1.x8
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20001226-1.x13
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20010327-1.c2
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20010328-1.c80
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20010329-1.c17
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20010404-1.c15
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20010408-1.c77
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20010421-1.c8
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20010423-1.c16
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20010503-1.c17
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20010525-1.c6
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20010605-1.c15
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20010610-1.c19
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20010611-1.c24
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20010903-1.c28
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20011010-1.c10
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20011029-1.c9
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20011109-1.c51
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20011205-1.c10
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/920520-1.x9
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/920723-1.c10
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/920729-1.c2
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/930621-1.c10
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/961203-1.x7
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/981006-1.x1
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/991214-2.c8
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/20001227-1.c32
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/20001229-1.c1
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/20010122-1.c2
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/20010122-1.x2
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/20010123-1.x2
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/20010222-1.c9
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/20010224-1.c44
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/20010325-1.c15
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/20010329-1.c14
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/20010403-1.c36
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/20010422-1.c15
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/20010604-1.c14
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/20010605-1.c11
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/20010605-2.c36
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/20010724-1.c59
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/20010724-1.x3
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/20010904-1.c11
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/20010904-2.c11
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/20010910-1.c59
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/20011008-3.c99
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/920501-8.x5
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/920730-1t.c5
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/930513-1.x5
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/931018-1.c2
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/980709-1.x5
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/990208-1.x14
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/990826-0.x5
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/ieee/20010114-2.c (renamed from gcc/testsuite/gcc.c-torture/execute/20010114-2.c)0
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-1.c16
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-2.c16
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-3.c16
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/ieee/ieee.exp22
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/ieee/rbug.x2
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/loop-2b.x15
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/memcheck/blkarg.x9
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/memcheck/memcheck.exp8
-rw-r--r--gcc/testsuite/gcc.c-torture/unsorted/msp.c7
-rw-r--r--gcc/testsuite/gcc.dg/20000724-1.c28
-rw-r--r--gcc/testsuite/gcc.dg/20010520-1.c10
-rw-r--r--gcc/testsuite/gcc.dg/20010622-1.c11
-rw-r--r--gcc/testsuite/gcc.dg/20010912-1.c48
-rw-r--r--gcc/testsuite/gcc.dg/array-5.c42
-rw-r--r--gcc/testsuite/gcc.dg/bconstp-1.c25
-rw-r--r--gcc/testsuite/gcc.dg/c90-hexfloat-1.c4
-rw-r--r--gcc/testsuite/gcc.dg/c99-float-1.c4
-rw-r--r--gcc/testsuite/gcc.dg/concat.c16
-rw-r--r--gcc/testsuite/gcc.dg/cpp/macro7.c10
-rw-r--r--gcc/testsuite/gcc.dg/cpp/multiline.c2
-rw-r--r--gcc/testsuite/gcc.dg/cpp/redef2.c9
-rw-r--r--gcc/testsuite/gcc.dg/cpp/tr-define.c2
-rw-r--r--gcc/testsuite/gcc.dg/direct2.c37
-rw-r--r--gcc/testsuite/gcc.dg/direct2s.c39
-rw-r--r--gcc/testsuite/gcc.dg/noncompile/20010524-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/noncompile/redecl-1.c4
-rw-r--r--gcc/testsuite/gcc.dg/sequence-pt-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/ultrasp2.c1
-rw-r--r--gcc/testsuite/gcc.dg/wchar_t-1.c17
-rw-r--r--gcc/testsuite/gcc.dg/wint_t-1.c17
-rw-r--r--gcc/testsuite/gcc.dg/wtr-conversion-1.c66
-rw-r--r--gcc/testsuite/gcc.misc-tests/gcov-3.c45
-rw-r--r--gcc/testsuite/gcc.misc-tests/linkage.exp23
-rw-r--r--gcc/testsuite/gcc.misc-tests/mg.exp2
-rw-r--r--gcc/testsuite/lib/g++.exp24
-rw-r--r--gcc/testsuite/lib/g77-dg.exp161
-rw-r--r--gcc/testsuite/lib/objc.exp19
-rw-r--r--gcc/testsuite/lib/old-dejagnu.exp9
-rw-r--r--gcc/testsuite/lib/target-supports.exp7
-rw-r--r--gcc/testsuite/objc/execute/IMP.m39
-rw-r--r--gcc/testsuite/objc/execute/_cmd.m30
-rw-r--r--gcc/testsuite/objc/execute/accessing_ivars.m55
-rw-r--r--gcc/testsuite/objc/execute/bycopy-3.m69
-rw-r--r--gcc/testsuite/objc/execute/class-1.m23
-rw-r--r--gcc/testsuite/objc/execute/class-10.m77
-rw-r--r--gcc/testsuite/objc/execute/class-11.m81
-rw-r--r--gcc/testsuite/objc/execute/class-12.m50
-rw-r--r--gcc/testsuite/objc/execute/class-13.m71
-rw-r--r--gcc/testsuite/objc/execute/class-14.m76
-rw-r--r--gcc/testsuite/objc/execute/class-2.m29
-rw-r--r--gcc/testsuite/objc/execute/class-3.m43
-rw-r--r--gcc/testsuite/objc/execute/class-4.m52
-rw-r--r--gcc/testsuite/objc/execute/class-5.m71
-rw-r--r--gcc/testsuite/objc/execute/class-6.m71
-rw-r--r--gcc/testsuite/objc/execute/class-7.m59
-rw-r--r--gcc/testsuite/objc/execute/class-8.m74
-rw-r--r--gcc/testsuite/objc/execute/class-9.m74
-rw-r--r--gcc/testsuite/objc/execute/class-tests-1.h137
-rw-r--r--gcc/testsuite/objc/execute/class-tests-2.h67
-rw-r--r--gcc/testsuite/objc/execute/compatibility_alias.m12
-rw-r--r--gcc/testsuite/objc/execute/encode-1.m31
-rw-r--r--gcc/testsuite/objc/execute/formal_protocol-1.m44
-rw-r--r--gcc/testsuite/objc/execute/formal_protocol-2.m45
-rw-r--r--gcc/testsuite/objc/execute/formal_protocol-3.m58
-rw-r--r--gcc/testsuite/objc/execute/formal_protocol-4.m40
-rw-r--r--gcc/testsuite/objc/execute/formal_protocol-5.m33
-rw-r--r--gcc/testsuite/objc/execute/formal_protocol-6.cexp2
-rw-r--r--gcc/testsuite/objc/execute/formal_protocol-6.m25
-rw-r--r--gcc/testsuite/objc/execute/formal_protocol-7.m44
-rw-r--r--gcc/testsuite/objc/execute/informal_protocol.m13
-rw-r--r--gcc/testsuite/objc/execute/initialize.m36
-rw-r--r--gcc/testsuite/objc/execute/load-2.m46
-rw-r--r--gcc/testsuite/objc/execute/load-3.m108
-rw-r--r--gcc/testsuite/objc/execute/load.m30
-rw-r--r--gcc/testsuite/objc/execute/many_args_method.m56
-rw-r--r--gcc/testsuite/objc/execute/nested-1.m12
-rw-r--r--gcc/testsuite/objc/execute/nested-2.m17
-rw-r--r--gcc/testsuite/objc/execute/nested-3.m37
-rw-r--r--gcc/testsuite/objc/execute/no_clash.m41
-rw-r--r--gcc/testsuite/objc/execute/object_is_class.m42
-rw-r--r--gcc/testsuite/objc/execute/object_is_meta_class.m41
-rw-r--r--gcc/testsuite/objc/execute/private.m32
-rw-r--r--gcc/testsuite/objc/execute/protocol.m5
-rw-r--r--gcc/testsuite/objc/execute/redefining_self.m31
-rw-r--r--gcc/testsuite/objc/execute/root_methods.m42
-rw-r--r--gcc/testsuite/objc/execute/selector-1.m17
-rw-r--r--gcc/testsuite/objc/execute/static-1.m34
-rw-r--r--gcc/testsuite/objc/execute/static-2.m37
-rw-r--r--gcc/testsuite/objc/execute/string1.m8
-rw-r--r--gcc/testsuite/objc/execute/string2.m9
-rw-r--r--gcc/testsuite/objc/execute/string3.m14
-rw-r--r--gcc/testsuite/objc/execute/string4.m12
-rw-r--r--gcc/testsuite/objc/execute/va_method.m44
-rw-r--r--gcc/timevar.c8
-rw-r--r--gcc/tlink.c9
-rw-r--r--gcc/toplev.c736
-rw-r--r--gcc/toplev.h11
-rw-r--r--gcc/tradcpp.c116
-rw-r--r--gcc/tree.c137
-rw-r--r--gcc/tree.def33
-rw-r--r--gcc/tree.h134
-rw-r--r--gcc/unroll.c79
-rw-r--r--gcc/unwind-dw2-fde.c1006
-rw-r--r--gcc/unwind-dw2-fde.h161
-rw-r--r--gcc/unwind-dw2.c1186
-rw-r--r--gcc/unwind-pe.h258
-rw-r--r--gcc/unwind-sjlj.c272
-rw-r--r--gcc/unwind.h192
-rw-r--r--gcc/unwind.inc236
-rw-r--r--gcc/varasm.c133
-rw-r--r--gcc/version.c2
-rw-r--r--gcc/xcoffout.c44
-rw-r--r--gcc/xcoffout.h9
-rw-r--r--include/ChangeLog48
-rw-r--r--include/demangle.h28
-rw-r--r--include/libiberty.h4
-rw-r--r--include/safe-ctype.h4
-rw-r--r--include/splay-tree.h6
-rw-r--r--libchill/ChangeLog859
-rw-r--r--libchill/Makefile.in246
-rw-r--r--libchill/abstime.c139
-rw-r--r--libchill/allgmem.c68
-rw-r--r--libchill/allmem.c80
-rw-r--r--libchill/allocate.c74
-rw-r--r--libchill/andps.c83
-rw-r--r--libchill/auxtypes.h53
-rw-r--r--libchill/basicio.c483
-rw-r--r--libchill/bitstring.h37
-rw-r--r--libchill/cardps.c106
-rw-r--r--libchill/cause.c54
-rw-r--r--libchill/checkcycle.c73
-rw-r--r--libchill/chillrt0.c155
-rw-r--r--libchill/chillstdio.c218
-rw-r--r--libchill/concatps.c101
-rw-r--r--libchill/concatstr.c80
-rwxr-xr-xlibchill/configure1686
-rw-r--r--libchill/configure.in162
-rw-r--r--libchill/continue.c91
-rw-r--r--libchill/convdurrtstime.c60
-rw-r--r--libchill/copyps.c118
-rw-r--r--libchill/delaycase.c229
-rw-r--r--libchill/delete.c50
-rw-r--r--libchill/diffps.c81
-rw-r--r--libchill/eoln.c38
-rw-r--r--libchill/eqps.c74
-rw-r--r--libchill/eqstr.c64
-rw-r--r--libchill/exh.c162
-rw-r--r--libchill/exhstack.c47
-rw-r--r--libchill/existing.c39
-rw-r--r--libchill/ffsetclrps.c92
-rw-r--r--libchill/ffsetps.c116
-rw-r--r--libchill/fileio.h161
-rw-r--r--libchill/flsetclrps.c89
-rw-r--r--libchill/flsetps.c114
-rw-r--r--libchill/format.c2194
-rw-r--r--libchill/format.h79
-rw-r--r--libchill/getassoc.c45
-rw-r--r--libchill/gettextaccess.c39
-rw-r--r--libchill/gettextindex.c38
-rw-r--r--libchill/gettextrecord.c38
-rw-r--r--libchill/getusage.c48
-rw-r--r--libchill/inbitstr.c81
-rw-r--r--libchill/indexable.c39
-rw-r--r--libchill/inps.c72
-rw-r--r--libchill/inttime.c93
-rw-r--r--libchill/ioerror.c53
-rw-r--r--libchill/ioerror.h169
-rw-r--r--libchill/iomodes.h259
-rw-r--r--libchill/isassociated.c37
-rw-r--r--libchill/leps.c83
-rw-r--r--libchill/ltps.c93
-rw-r--r--libchill/ltstr.c65
-rw-r--r--libchill/memmove.c75
-rw-r--r--libchill/neps.c59
-rw-r--r--libchill/notps.c88
-rw-r--r--libchill/orps.c82
-rw-r--r--libchill/outoffile.c48
-rw-r--r--libchill/powerset.h106
-rw-r--r--libchill/printbuffer.c125
-rw-r--r--libchill/printevent.c102
-rw-r--r--libchill/queuelength.c87
-rw-r--r--libchill/readable.c40
-rw-r--r--libchill/readrecord.c217
-rw-r--r--libchill/remaintime.c91
-rw-r--r--libchill/retmem.c59
-rw-r--r--libchill/rtltypes.h89
-rw-r--r--libchill/rts.c663
-rw-r--r--libchill/rts.h159
-rw-r--r--libchill/rtsdummy.c72
-rw-r--r--libchill/sendbuffer.c184
-rw-r--r--libchill/sequencible.c40
-rw-r--r--libchill/setbitps.c96
-rw-r--r--libchill/setbits.c92
-rw-r--r--libchill/settextaccess.c47
-rw-r--r--libchill/settextindex.c46
-rw-r--r--libchill/settextrecord.c45
-rw-r--r--libchill/sliceps.c72
-rw-r--r--libchill/terminate.c67
-rw-r--r--libchill/unhex.c64
-rw-r--r--libchill/unhex1.c65
-rw-r--r--libchill/variable.c39
-rw-r--r--libchill/waitbuffer.c306
-rw-r--r--libchill/waituntil.c82
-rw-r--r--libchill/writeable.c39
-rw-r--r--libchill/writerecord.c141
-rw-r--r--libchill/xorps.c83
-rw-r--r--libf2c/ChangeLog192
-rw-r--r--libf2c/libF77/Makefile.in1
-rw-r--r--libf2c/libF77/Version.c2
-rw-r--r--libf2c/libI77/Makefile.in16
-rw-r--r--libf2c/libI77/Version.c2
-rw-r--r--libf2c/libI77/backspace.c1
-rw-r--r--libf2c/libI77/close.c1
-rw-r--r--libf2c/libI77/config.h.in47
-rwxr-xr-xlibf2c/libI77/configure326
-rw-r--r--libf2c/libI77/configure.in19
-rw-r--r--libf2c/libI77/dfe.c1
-rw-r--r--libf2c/libI77/dolio.c1
-rw-r--r--libf2c/libI77/due.c1
-rw-r--r--libf2c/libI77/endfile.c20
-rw-r--r--libf2c/libI77/err.c1
-rw-r--r--libf2c/libI77/fmt.c1
-rw-r--r--libf2c/libI77/fmtlib.c1
-rw-r--r--libf2c/libI77/ftell_.c1
-rw-r--r--libf2c/libI77/ilnw.c1
-rw-r--r--libf2c/libI77/inquire.c1
-rw-r--r--libf2c/libI77/lread.c1
-rw-r--r--libf2c/libI77/open.c1
-rw-r--r--libf2c/libI77/rdfmt.c1
-rw-r--r--libf2c/libI77/rsfe.c1
-rw-r--r--libf2c/libI77/rsne.c1
-rw-r--r--libf2c/libI77/stamp-h.in1
-rw-r--r--libf2c/libI77/sue.c1
-rw-r--r--libf2c/libI77/typesize.c1
-rw-r--r--libf2c/libI77/util.c1
-rw-r--r--libf2c/libI77/wrtfmt.c1
-rw-r--r--libf2c/libI77/wsle.c1
-rw-r--r--libf2c/libI77/xwsne.c1
-rw-r--r--libf2c/libU77/Version.c2
-rw-r--r--libffi/ChangeLog121
-rw-r--r--libffi/Makefile.am43
-rw-r--r--libffi/Makefile.in357
-rwxr-xr-xlibffi/configure1470
-rw-r--r--libffi/configure.in19
-rw-r--r--libffi/include/ffi.h.in20
-rw-r--r--libffi/src/alpha/ffi.c11
-rw-r--r--libffi/src/alpha/osf.S77
-rw-r--r--libffi/src/ffitest.c6
-rw-r--r--libffi/src/ia64/unix.S9
-rw-r--r--libffi/src/powerpc/ffi.c606
-rw-r--r--libffi/src/powerpc/ppc_closure.S181
-rw-r--r--libffi/src/powerpc/sysv.S173
-rw-r--r--libffi/src/types.c10
-rw-r--r--libffi/src/x86/sysv.S33
-rw-r--r--libffi/src/x86/win32.S127
-rw-r--r--libiberty/ChangeLog103
-rw-r--r--libiberty/Makefile.in16
-rwxr-xr-xlibiberty/configure129
-rw-r--r--libiberty/configure.in9
-rw-r--r--libiberty/cp-demangle.c131
-rw-r--r--libiberty/cplus-dem.c7
-rw-r--r--libiberty/hashtab.c65
-rw-r--r--libiberty/lbasename.c89
-rw-r--r--libiberty/memchr.c2
-rw-r--r--libiberty/splay-tree.c36
-rw-r--r--libiberty/strerror.c2
-rw-r--r--libiberty/strsignal.c2
-rw-r--r--libiberty/testsuite/demangle-expected4
-rw-r--r--libjava/ChangeLog1321
-rw-r--r--libjava/HACKING63
-rw-r--r--libjava/Makefile.am77
-rw-r--r--libjava/Makefile.in112
-rw-r--r--libjava/THANKS1
-rw-r--r--libjava/acconfig.h3
-rw-r--r--libjava/acinclude.m4116
-rw-r--r--libjava/aclocal.m4116
-rwxr-xr-xlibjava/configure1321
-rw-r--r--libjava/configure.host11
-rw-r--r--libjava/configure.in209
-rw-r--r--libjava/defineclass.cc147
-rw-r--r--libjava/doc/cni.sgml25
-rw-r--r--libjava/doc/java-applet.texi141
-rw-r--r--libjava/doc/java-awt-color.texi48
-rw-r--r--libjava/doc/java-awt-event.texi357
-rw-r--r--libjava/doc/java-awt-geom.texi576
-rw-r--r--libjava/doc/java-awt-image.texi1149
-rw-r--r--libjava/doc/java-awt-peer.texi265
-rw-r--r--libjava/doc/java-awt.texi2757
-rw-r--r--libjava/doc/java-beans-beancontext.texi543
-rw-r--r--libjava/doc/java-beans.texi810
-rw-r--r--libjava/doc/java-io.texi2592
-rw-r--r--libjava/doc/java-lang-ref.texi34
-rw-r--r--libjava/doc/java-lang-reflect.texi294
-rw-r--r--libjava/doc/java-lang.texi855
-rw-r--r--libjava/doc/java-math.texi206
-rw-r--r--libjava/doc/java-net.texi558
-rw-r--r--libjava/doc/java-security-spec.texi0
-rw-r--r--libjava/doc/java-security.texi354
-rw-r--r--libjava/doc/java-sql.texi2892
-rw-r--r--libjava/doc/java-text.texi859
-rw-r--r--libjava/doc/java-util-jar.texi188
-rw-r--r--libjava/doc/java-util-zip.texi352
-rw-r--r--libjava/doc/java-util.texi2425
-rw-r--r--libjava/exception.cc468
-rw-r--r--libjava/gcj/Makefile.am2
-rw-r--r--libjava/gcj/Makefile.in20
-rw-r--r--libjava/gcj/cni.h6
-rw-r--r--libjava/gcj/javaprims.h15
-rw-r--r--libjava/gij.cc4
-rw-r--r--libjava/gnu/awt/j2d/AbstractGraphicsState.java7
-rw-r--r--libjava/gnu/awt/j2d/DirectRasterGraphics.java2
-rw-r--r--libjava/gnu/awt/j2d/IntegerGraphicsState.java3
-rw-r--r--libjava/gnu/gcj/convert/IOConverter.java5
-rw-r--r--libjava/gnu/gcj/convert/UnicodeToBytes.java2
-rw-r--r--libjava/gnu/gcj/io/shs.cc4
-rw-r--r--libjava/gnu/gcj/math/MPN.java43
-rw-r--r--libjava/gnu/gcj/runtime/VMClassLoader.java15
-rw-r--r--libjava/gnu/gcj/runtime/natFirstThread.cc17
-rw-r--r--libjava/include/Makefile.am2
-rw-r--r--libjava/include/Makefile.in23
-rw-r--r--libjava/include/config.h.in24
-rw-r--r--libjava/include/dwarf2-signal.h85
-rw-r--r--libjava/include/i386-signal.h41
-rw-r--r--libjava/include/java-interp.h13
-rw-r--r--libjava/include/jni.h86
-rw-r--r--libjava/include/jvm.h51
-rw-r--r--libjava/include/posix-threads.h4
-rw-r--r--libjava/include/posix.h5
-rw-r--r--libjava/include/ppc-signal.h115
-rw-r--r--libjava/interpret.cc33
-rw-r--r--libjava/java/io/BlockDataException.java39
-rw-r--r--libjava/java/io/BufferedReader.java18
-rw-r--r--libjava/java/io/BufferedWriter.java56
-rw-r--r--libjava/java/io/ByteArrayInputStream.java7
-rw-r--r--libjava/java/io/CharArrayReader.java32
-rw-r--r--libjava/java/io/CharArrayWriter.java59
-rw-r--r--libjava/java/io/File.java377
-rw-r--r--libjava/java/io/FilterReader.java7
-rw-r--r--libjava/java/io/InvalidClassException.java101
-rw-r--r--libjava/java/io/ObjectInputStream.java26
-rw-r--r--libjava/java/io/ObjectStreamClass.java83
-rw-r--r--libjava/java/io/OutputStreamWriter.java12
-rw-r--r--libjava/java/io/PipedReader.java7
-rw-r--r--libjava/java/io/PipedWriter.java4
-rw-r--r--libjava/java/io/PrintStream.java74
-rw-r--r--libjava/java/io/natFile.cc213
-rw-r--r--libjava/java/io/natFileDescriptorPosix.cc4
-rw-r--r--libjava/java/io/natFileWin32.cc95
-rw-r--r--libjava/java/lang/Class.h19
-rw-r--r--libjava/java/lang/Class.java4
-rw-r--r--libjava/java/lang/ClassLoader.java52
-rw-r--r--libjava/java/lang/ExceptionInInitializerError.java28
-rw-r--r--libjava/java/lang/Integer.java14
-rw-r--r--libjava/java/lang/Long.java14
-rw-r--r--libjava/java/lang/Runtime.java6
-rw-r--r--libjava/java/lang/String.java1
-rw-r--r--libjava/java/lang/System.java2
-rw-r--r--libjava/java/lang/ThreadGroup.java37
-rw-r--r--libjava/java/lang/Throwable.java2
-rw-r--r--libjava/java/lang/natClass.cc52
-rw-r--r--libjava/java/lang/natClassLoader.cc43
-rw-r--r--libjava/java/lang/natDouble.cc48
-rw-r--r--libjava/java/lang/natRuntime.cc12
-rw-r--r--libjava/java/lang/natString.cc107
-rw-r--r--libjava/java/lang/natSystem.cc14
-rw-r--r--libjava/java/lang/natThrowable.cc17
-rw-r--r--libjava/java/lang/reflect/Constructor.java4
-rw-r--r--libjava/java/lang/reflect/Method.java4
-rw-r--r--libjava/java/lang/reflect/natConstructor.cc4
-rw-r--r--libjava/java/lang/reflect/natField.cc15
-rw-r--r--libjava/java/math/BigInteger.java25
-rw-r--r--libjava/java/net/URLStreamHandler.java2
-rw-r--r--libjava/java/net/natInetAddress.cc2
-rw-r--r--libjava/java/net/natPlainDatagramSocketImpl.cc34
-rw-r--r--libjava/java/net/natPlainSocketImpl.cc49
-rw-r--r--libjava/java/text/MessageFormat.java2
-rw-r--r--libjava/java/text/SimpleDateFormat.java857
-rw-r--r--libjava/java/util/AbstractSequentialList.java1
-rw-r--r--libjava/java/util/Collection.java253
-rw-r--r--libjava/java/util/Collections.java20
-rw-r--r--libjava/java/util/Comparator.java68
-rw-r--r--libjava/java/util/Dictionary.java95
-rw-r--r--libjava/java/util/HashMap.java31
-rw-r--r--libjava/java/util/HashSet.java9
-rw-r--r--libjava/java/util/Hashtable.java21
-rw-r--r--libjava/java/util/Iterator.java73
-rw-r--r--libjava/java/util/ListIterator.java158
-rw-r--r--libjava/java/util/Map.java47
-rw-r--r--libjava/java/util/ResourceBundle.java4
-rw-r--r--libjava/java/util/Set.java7
-rw-r--r--libjava/java/util/SortedSet.java5
-rw-r--r--libjava/java/util/TimeZone.java200
-rw-r--r--libjava/java/util/TreeMap.java1454
-rw-r--r--libjava/java/util/TreeSet.java290
-rw-r--r--libjava/java/util/natGregorianCalendar.cc46
-rw-r--r--libjava/java/util/zip/DeflaterOutputStream.java48
-rw-r--r--libjava/java/util/zip/ZipOutputStream.java98
-rw-r--r--libjava/javax/naming/Context.java4
-rw-r--r--libjava/javax/naming/InitialContext.java16
-rw-r--r--libjava/javax/naming/Name.java1
-rw-r--r--libjava/jni.cc101
-rw-r--r--libjava/libgcj.spec.in4
-rw-r--r--libjava/libltdl/ChangeLog30
-rw-r--r--libjava/libltdl/Makefile.in18
-rwxr-xr-xlibjava/libltdl/configure301
-rw-r--r--libjava/libltdl/configure.in10
-rw-r--r--libjava/libtool-version2
-rw-r--r--libjava/name-finder.cc10
-rw-r--r--libjava/posix-threads.cc4
-rw-r--r--libjava/posix.cc10
-rw-r--r--libjava/prims.cc14
-rw-r--r--libjava/resolve.cc37
-rw-r--r--libjava/testsuite/ChangeLog88
-rw-r--r--libjava/testsuite/Makefile.am16
-rw-r--r--libjava/testsuite/Makefile.in22
-rw-r--r--libjava/testsuite/lib/libjava.exp155
-rw-r--r--libjava/testsuite/libjava.compile/PR207.xfail1
-rw-r--r--libjava/testsuite/libjava.compile/PR208.xfail1
-rw-r--r--libjava/testsuite/libjava.compile/PR374.xfail2
-rw-r--r--libjava/testsuite/libjava.compile/PR375.xfail1
-rw-r--r--libjava/testsuite/libjava.compile/assignment.xfail2
-rw-r--r--libjava/testsuite/libjava.compile/assignment_2.xfail2
-rw-r--r--libjava/testsuite/libjava.compile/uesc.java9
-rw-r--r--libjava/testsuite/libjava.compile/uesc.xfail1
-rw-r--r--libjava/testsuite/libjava.compile/weirddecl.xfail2
-rw-r--r--libjava/testsuite/libjava.lang/PR162.xfail1
-rw-r--r--libjava/testsuite/libjava.lang/Shazam.xfail1
-rw-r--r--libjava/testsuite/libjava.lang/Thread_Alive.xfail1
-rw-r--r--libjava/testsuite/libjava.lang/Thread_Interrupt.xfail1
-rw-r--r--libjava/testsuite/libjava.lang/Thread_Join.xfail1
-rw-r--r--libjava/testsuite/libjava.lang/Thread_Monitor.xfail1
-rw-r--r--libjava/testsuite/libjava.lang/Thread_Sleep.xfail1
-rw-r--r--libjava/testsuite/libjava.lang/Thread_Wait.xfail1
-rw-r--r--libjava/testsuite/libjava.lang/Thread_Wait_2.xfail1
-rw-r--r--libjava/testsuite/libjava.lang/Thread_Wait_Interrupt.xfail1
-rw-r--r--libjava/testsuite/libjava.lang/err11.xfail1
-rw-r--r--libjava/testsuite/libjava.lang/instinit2.out1
-rw-r--r--libjava/testsuite/libjava.lang/pr83.xfail1
-rw-r--r--libobjc/ChangeLog83
-rw-r--r--libobjc/Makefile.in17
-rw-r--r--libobjc/THREADS43
-rwxr-xr-xlibobjc/configure305
-rw-r--r--libobjc/encoding.c7
-rw-r--r--libobjc/init.c8
-rw-r--r--libobjc/libobjc.def2
-rw-r--r--libobjc/objc/objc-api.h16
-rw-r--r--libobjc/objc/thr.h2
-rw-r--r--libobjc/sendmsg.c1
-rw-r--r--libobjc/thr.c29
-rw-r--r--libstdc++-v3/ChangeLog3156
-rw-r--r--libstdc++-v3/Makefile.am43
-rw-r--r--libstdc++-v3/Makefile.in112
-rw-r--r--libstdc++-v3/README39
-rw-r--r--libstdc++-v3/acconfig.h29
-rw-r--r--libstdc++-v3/acinclude.m4710
-rw-r--r--libstdc++-v3/aclocal.m4726
-rw-r--r--libstdc++-v3/config.h.in217
-rw-r--r--libstdc++-v3/config/basic_file_libio.cc194
-rw-r--r--libstdc++-v3/config/basic_file_libio.h (renamed from libstdc++-v3/config/c_io_libio.cc)176
-rw-r--r--libstdc++-v3/config/basic_file_stdio.cc (renamed from libstdc++-v3/config/threads-posix.h)71
-rw-r--r--libstdc++-v3/config/basic_file_stdio.h (renamed from libstdc++-v3/config/c_io_stdio.cc)69
-rw-r--r--libstdc++-v3/config/c_io_libio.h9
-rw-r--r--libstdc++-v3/config/c_io_stdio.h90
-rw-r--r--libstdc++-v3/config/c_locale_gnu.h2
-rw-r--r--libstdc++-v3/config/cpu/alpha/bits/atomicity.h46
-rw-r--r--libstdc++-v3/config/cpu/arm/bits/atomicity.h40
-rw-r--r--libstdc++-v3/config/cpu/generic/bits/atomicity.h46
-rw-r--r--libstdc++-v3/config/cpu/generic/bits/limits.h40
-rw-r--r--libstdc++-v3/config/cpu/i386/bits/atomicity.h46
-rw-r--r--libstdc++-v3/config/cpu/i386/bits/limits.h33
-rw-r--r--libstdc++-v3/config/cpu/i486/bits/atomicity.h46
-rw-r--r--libstdc++-v3/config/cpu/ia64/bits/atomicity.h46
-rw-r--r--libstdc++-v3/config/cpu/m68k/bits/atomicity.h158
-rw-r--r--libstdc++-v3/config/cpu/mips/bits/atomicity.h105
-rw-r--r--libstdc++-v3/config/cpu/powerpc/bits/atomicity.h40
-rw-r--r--libstdc++-v3/config/cpu/powerpc/bits/limits.h33
-rw-r--r--libstdc++-v3/config/cpu/s390/bits/atomicity.h60
-rw-r--r--libstdc++-v3/config/cpu/sparc/sparc32/bits/atomicity.h61
-rw-r--r--libstdc++-v3/config/cpu/sparc/sparc64/bits/atomicity.h42
-rw-r--r--libstdc++-v3/config/os/aix/bits/atomicity.h46
-rw-r--r--libstdc++-v3/config/os/aix/bits/ctype_base.h2
-rw-r--r--libstdc++-v3/config/os/aix/bits/os_defines.h10
-rw-r--r--libstdc++-v3/config/os/bsd/freebsd/bits/os_defines.h1
-rw-r--r--libstdc++-v3/config/os/djgpp/bits/ctype_base.h31
-rw-r--r--libstdc++-v3/config/os/djgpp/bits/ctype_inline.h12
-rw-r--r--libstdc++-v3/config/os/djgpp/bits/ctype_noninline.h17
-rw-r--r--libstdc++-v3/config/os/generic/bits/os_defines.h4
-rw-r--r--libstdc++-v3/config/os/gnu-linux/bits/os_defines.h28
-rw-r--r--libstdc++-v3/config/os/hpux/bits/ctype_base.h22
-rw-r--r--libstdc++-v3/config/os/hpux/bits/os_defines.h4
-rw-r--r--libstdc++-v3/config/os/irix/bits/atomicity.h40
-rw-r--r--libstdc++-v3/config/os/irix/irix5.2/bits/atomicity.h50
-rw-r--r--libstdc++-v3/config/os/irix/irix5.2/bits/ctype_base.h55
-rw-r--r--libstdc++-v3/config/os/irix/irix5.2/bits/ctype_inline.h72
-rw-r--r--libstdc++-v3/config/os/irix/irix5.2/bits/ctype_noninline.h71
-rw-r--r--libstdc++-v3/config/os/irix/irix5.2/bits/os_defines.h (renamed from libstdc++-v3/config/os/irix/bits/os_defines.h)3
-rw-r--r--libstdc++-v3/config/os/irix/irix6.5/bits/atomicity.h50
-rw-r--r--libstdc++-v3/config/os/irix/irix6.5/bits/ctype_base.h (renamed from libstdc++-v3/config/os/irix/bits/ctype_base.h)0
-rw-r--r--libstdc++-v3/config/os/irix/irix6.5/bits/ctype_inline.h (renamed from libstdc++-v3/config/os/irix/bits/ctype_inline.h)0
-rw-r--r--libstdc++-v3/config/os/irix/irix6.5/bits/ctype_noninline.h (renamed from libstdc++-v3/config/os/irix/bits/ctype_noninline.h)0
-rw-r--r--libstdc++-v3/config/os/irix/irix6.5/bits/os_defines.h62
-rw-r--r--libstdc++-v3/config/os/solaris/solaris2.5/bits/os_defines.h12
-rw-r--r--libstdc++-v3/config/os/solaris/solaris2.6/bits/os_defines.h10
-rw-r--r--libstdc++-v3/config/os/solaris/solaris2.7/bits/os_defines.h12
-rwxr-xr-xlibstdc++-v3/configure4646
-rw-r--r--libstdc++-v3/configure.host12
-rw-r--r--libstdc++-v3/configure.in122
-rw-r--r--libstdc++-v3/configure.target64
-rw-r--r--libstdc++-v3/docs/doxygen/mainpage.doxy62
-rw-r--r--libstdc++-v3/docs/doxygen/maint.cfg.in740
-rw-r--r--libstdc++-v3/docs/doxygen/run_doxygen141
-rw-r--r--libstdc++-v3/docs/doxygen/style.css20
-rw-r--r--libstdc++-v3/docs/doxygen/user.cfg.in821
-rw-r--r--libstdc++-v3/docs/html/17_intro/BADNAMES7
-rw-r--r--libstdc++-v3/docs/html/17_intro/BUGS2
-rw-r--r--libstdc++-v3/docs/html/17_intro/C++STYLE4
-rw-r--r--libstdc++-v3/docs/html/17_intro/CHECKLIST2
-rw-r--r--libstdc++-v3/docs/html/17_intro/COPYING.DOC355
-rw-r--r--libstdc++-v3/docs/html/17_intro/DESIGN2
-rw-r--r--libstdc++-v3/docs/html/17_intro/RELEASE-NOTES85
-rw-r--r--libstdc++-v3/docs/html/17_intro/TODO4
-rw-r--r--libstdc++-v3/docs/html/17_intro/concept_check.diff382
-rw-r--r--libstdc++-v3/docs/html/17_intro/headers_cc.txt2
-rw-r--r--libstdc++-v3/docs/html/17_intro/howto.html270
-rw-r--r--libstdc++-v3/docs/html/17_intro/license.html107
-rw-r--r--libstdc++-v3/docs/html/17_intro/porting-howto.html1518
-rw-r--r--libstdc++-v3/docs/html/17_intro/porting-howto.xml787
-rw-r--r--libstdc++-v3/docs/html/17_intro/porting.html841
-rw-r--r--libstdc++-v3/docs/html/17_intro/porting.texi510
-rw-r--r--libstdc++-v3/docs/html/18_support/howto.html244
-rw-r--r--libstdc++-v3/docs/html/19_diagnostics/howto.html231
-rw-r--r--libstdc++-v3/docs/html/20_util/howto.html265
-rw-r--r--libstdc++-v3/docs/html/21_strings/howto.html320
-rw-r--r--libstdc++-v3/docs/html/22_locale/codecvt.html284
-rw-r--r--libstdc++-v3/docs/html/22_locale/ctype.html122
-rw-r--r--libstdc++-v3/docs/html/22_locale/howto.html269
-rw-r--r--libstdc++-v3/docs/html/22_locale/locale.html111
-rw-r--r--libstdc++-v3/docs/html/22_locale/messages.html404
-rw-r--r--libstdc++-v3/docs/html/23_containers/howto.html479
-rw-r--r--libstdc++-v3/docs/html/24_iterators/howto.html201
-rw-r--r--libstdc++-v3/docs/html/25_algorithms/howto.html138
-rw-r--r--libstdc++-v3/docs/html/26_numerics/howto.html211
-rw-r--r--libstdc++-v3/docs/html/27_io/howto.html541
-rw-r--r--libstdc++-v3/docs/html/27_io/iostreams_hierarchy.pdf1
-rw-r--r--libstdc++-v3/docs/html/Makefile10
-rw-r--r--libstdc++-v3/docs/html/configopts.html299
-rw-r--r--libstdc++-v3/docs/html/documentation.html149
-rw-r--r--libstdc++-v3/docs/html/explanations.html84
-rw-r--r--libstdc++-v3/docs/html/ext/howto.html592
-rw-r--r--libstdc++-v3/docs/html/ext/lwg-active.html5603
-rw-r--r--libstdc++-v3/docs/html/ext/lwg-defects.html6708
-rw-r--r--libstdc++-v3/docs/html/ext/sgiexts.html237
-rw-r--r--libstdc++-v3/docs/html/faq/index.html1260
-rw-r--r--libstdc++-v3/docs/html/faq/index.txt755
-rw-r--r--libstdc++-v3/docs/html/install.html468
-rw-r--r--libstdc++-v3/include/Makefile.am447
-rw-r--r--libstdc++-v3/include/Makefile.in634
-rw-r--r--libstdc++-v3/include/backward/algo.h165
-rw-r--r--libstdc++-v3/include/backward/algobase.h76
-rw-r--r--libstdc++-v3/include/backward/alloc.h61
-rw-r--r--libstdc++-v3/include/backward/backward_warning.h38
-rw-r--r--libstdc++-v3/include/backward/bvector.h50
-rw-r--r--libstdc++-v3/include/backward/complex.h1
-rw-r--r--libstdc++-v3/include/backward/defalloc.h30
-rw-r--r--libstdc++-v3/include/backward/deque.h34
-rw-r--r--libstdc++-v3/include/backward/fstream.h7
-rw-r--r--libstdc++-v3/include/backward/function.h167
-rw-r--r--libstdc++-v3/include/backward/hash_map.h47
-rw-r--r--libstdc++-v3/include/backward/hash_set.h47
-rw-r--r--libstdc++-v3/include/backward/hashtable.h38
-rw-r--r--libstdc++-v3/include/backward/heap.h45
-rw-r--r--libstdc++-v3/include/backward/iomanip.h27
-rw-r--r--libstdc++-v3/include/backward/iostream.h3
-rw-r--r--libstdc++-v3/include/backward/istream.h3
-rw-r--r--libstdc++-v3/include/backward/iterator.h113
-rw-r--r--libstdc++-v3/include/backward/list.h36
-rw-r--r--libstdc++-v3/include/backward/map.h36
-rw-r--r--libstdc++-v3/include/backward/multimap.h36
-rw-r--r--libstdc++-v3/include/backward/multiset.h36
-rw-r--r--libstdc++-v3/include/backward/new.h1
-rw-r--r--libstdc++-v3/include/backward/ostream.h3
-rw-r--r--libstdc++-v3/include/backward/pair.h47
-rw-r--r--libstdc++-v3/include/backward/queue.h41
-rw-r--r--libstdc++-v3/include/backward/rope.h46
-rw-r--r--libstdc++-v3/include/backward/set.h36
-rw-r--r--libstdc++-v3/include/backward/slist.h34
-rw-r--r--libstdc++-v3/include/backward/stack.h42
-rw-r--r--libstdc++-v3/include/backward/stream.h3
-rw-r--r--libstdc++-v3/include/backward/streambuf.h1
-rw-r--r--libstdc++-v3/include/backward/strstream39
-rw-r--r--libstdc++-v3/include/backward/strstream.h2
-rw-r--r--libstdc++-v3/include/backward/tempbuf.h52
-rw-r--r--libstdc++-v3/include/backward/tree.h61
-rw-r--r--libstdc++-v3/include/backward/vector.h36
-rw-r--r--libstdc++-v3/include/bits/basic_file.h140
-rw-r--r--libstdc++-v3/include/bits/basic_ios.h48
-rw-r--r--libstdc++-v3/include/bits/basic_ios.tcc31
-rw-r--r--libstdc++-v3/include/bits/basic_string.h28
-rw-r--r--libstdc++-v3/include/bits/basic_string.tcc226
-rw-r--r--libstdc++-v3/include/bits/boost_concept_check.h889
-rw-r--r--libstdc++-v3/include/bits/c++config85
-rw-r--r--libstdc++-v3/include/bits/char_traits.h55
-rw-r--r--libstdc++-v3/include/bits/codecvt.h14
-rw-r--r--libstdc++-v3/include/bits/concept_check.h81
-rw-r--r--libstdc++-v3/include/bits/cpp_type_traits.h6
-rw-r--r--libstdc++-v3/include/bits/exception_support.h79
-rw-r--r--libstdc++-v3/include/bits/fpos.h67
-rw-r--r--libstdc++-v3/include/bits/fstream.tcc251
-rw-r--r--libstdc++-v3/include/bits/functexcept.h85
-rw-r--r--libstdc++-v3/include/bits/gslice.h6
-rw-r--r--libstdc++-v3/include/bits/gslice_array.h4
-rw-r--r--libstdc++-v3/include/bits/indirect_array.h6
-rw-r--r--libstdc++-v3/include/bits/ios_base.h27
-rw-r--r--libstdc++-v3/include/bits/istream.tcc1139
-rw-r--r--libstdc++-v3/include/bits/limits_generic.h52
-rw-r--r--libstdc++-v3/include/bits/locale_facets.h117
-rw-r--r--libstdc++-v3/include/bits/locale_facets.tcc111
-rw-r--r--libstdc++-v3/include/bits/localefwd.h38
-rw-r--r--libstdc++-v3/include/bits/mask_array.h4
-rw-r--r--libstdc++-v3/include/bits/ostream.tcc584
-rw-r--r--libstdc++-v3/include/bits/pthread_allocimpl.h47
-rw-r--r--libstdc++-v3/include/bits/sbuf_iter.h159
-rw-r--r--libstdc++-v3/include/bits/sequence_concepts.h8
-rw-r--r--libstdc++-v3/include/bits/slice.h9
-rw-r--r--libstdc++-v3/include/bits/slice_array.h7
-rw-r--r--libstdc++-v3/include/bits/sstream.tcc21
-rw-r--r--libstdc++-v3/include/bits/std_algorithm.h31
-rw-r--r--libstdc++-v3/include/bits/std_bitset.h174
-rw-r--r--libstdc++-v3/include/bits/std_complex.h85
-rw-r--r--libstdc++-v3/include/bits/std_deque.h33
-rw-r--r--libstdc++-v3/include/bits/std_fstream.h145
-rw-r--r--libstdc++-v3/include/bits/std_functional.h34
-rw-r--r--libstdc++-v3/include/bits/std_iomanip.h11
-rw-r--r--libstdc++-v3/include/bits/std_ios.h6
-rw-r--r--libstdc++-v3/include/bits/std_iosfwd.h30
-rw-r--r--libstdc++-v3/include/bits/std_iostream.h2
-rw-r--r--libstdc++-v3/include/bits/std_istream.h28
-rw-r--r--libstdc++-v3/include/bits/std_iterator.h39
-rw-r--r--libstdc++-v3/include/bits/std_limits.h1982
-rw-r--r--libstdc++-v3/include/bits/std_list.h31
-rw-r--r--libstdc++-v3/include/bits/std_locale.h2
-rw-r--r--libstdc++-v3/include/bits/std_map.h31
-rw-r--r--libstdc++-v3/include/bits/std_memory.h53
-rw-r--r--libstdc++-v3/include/bits/std_numeric.h32
-rw-r--r--libstdc++-v3/include/bits/std_ostream.h21
-rw-r--r--libstdc++-v3/include/bits/std_queue.h32
-rw-r--r--libstdc++-v3/include/bits/std_set.h31
-rw-r--r--libstdc++-v3/include/bits/std_sstream.h137
-rw-r--r--libstdc++-v3/include/bits/std_stack.h31
-rw-r--r--libstdc++-v3/include/bits/std_stdexcept.h41
-rw-r--r--libstdc++-v3/include/bits/std_streambuf.h43
-rw-r--r--libstdc++-v3/include/bits/std_string.h14
-rw-r--r--libstdc++-v3/include/bits/std_utility.h32
-rw-r--r--libstdc++-v3/include/bits/std_valarray.h28
-rw-r--r--libstdc++-v3/include/bits/std_vector.h35
-rw-r--r--libstdc++-v3/include/bits/stl_algo.h1539
-rw-r--r--libstdc++-v3/include/bits/stl_algobase.h396
-rw-r--r--libstdc++-v3/include/bits/stl_alloc.h131
-rw-r--r--libstdc++-v3/include/bits/stl_bvector.h727
-rw-r--r--libstdc++-v3/include/bits/stl_config.h9
-rw-r--r--libstdc++-v3/include/bits/stl_construct.h38
-rw-r--r--libstdc++-v3/include/bits/stl_deque.h395
-rw-r--r--libstdc++-v3/include/bits/stl_function.h51
-rw-r--r--libstdc++-v3/include/bits/stl_heap.h114
-rw-r--r--libstdc++-v3/include/bits/stl_iterator.h577
-rw-r--r--libstdc++-v3/include/bits/stl_iterator_base_funcs.h181
-rw-r--r--libstdc++-v3/include/bits/stl_iterator_base_types.h214
-rw-r--r--libstdc++-v3/include/bits/stl_list.h191
-rw-r--r--libstdc++-v3/include/bits/stl_map.h104
-rw-r--r--libstdc++-v3/include/bits/stl_multimap.h96
-rw-r--r--libstdc++-v3/include/bits/stl_multiset.h128
-rw-r--r--libstdc++-v3/include/bits/stl_numeric.h97
-rw-r--r--libstdc++-v3/include/bits/stl_pair.h80
-rw-r--r--libstdc++-v3/include/bits/stl_pthread_alloc.h38
-rw-r--r--libstdc++-v3/include/bits/stl_queue.h127
-rw-r--r--libstdc++-v3/include/bits/stl_range_errors.h74
-rw-r--r--libstdc++-v3/include/bits/stl_raw_storage_iter.h44
-rw-r--r--libstdc++-v3/include/bits/stl_relops.h37
-rw-r--r--libstdc++-v3/include/bits/stl_set.h123
-rw-r--r--libstdc++-v3/include/bits/stl_stack.h62
-rw-r--r--libstdc++-v3/include/bits/stl_tempbuf.h44
-rw-r--r--libstdc++-v3/include/bits/stl_threads.h176
-rw-r--r--libstdc++-v3/include/bits/stl_tree.h162
-rw-r--r--libstdc++-v3/include/bits/stl_uninitialized.h44
-rw-r--r--libstdc++-v3/include/bits/stl_vector.h213
-rw-r--r--libstdc++-v3/include/bits/streambuf.tcc43
-rw-r--r--libstdc++-v3/include/bits/stringfwd.h7
-rw-r--r--libstdc++-v3/include/bits/type_traits.h176
-rw-r--r--libstdc++-v3/include/bits/valarray_array.h2
-rw-r--r--libstdc++-v3/include/bits/valarray_meta.h21
-rw-r--r--libstdc++-v3/include/c_shadow/bits/std_cstdlib.h6
-rw-r--r--libstdc++-v3/include/c_shadow/stdlib.h2
-rw-r--r--libstdc++-v3/include/c_std/bits/cmath.tcc3
-rw-r--r--libstdc++-v3/include/c_std/bits/std_cctype.h44
-rw-r--r--libstdc++-v3/include/c_std/bits/std_cerrno.h16
-rw-r--r--libstdc++-v3/include/c_std/bits/std_cfloat.h3
-rw-r--r--libstdc++-v3/include/c_std/bits/std_climits.h7
-rw-r--r--libstdc++-v3/include/c_std/bits/std_clocale.h11
-rw-r--r--libstdc++-v3/include/c_std/bits/std_cmath.h687
-rw-r--r--libstdc++-v3/include/c_std/bits/std_csetjmp.h9
-rw-r--r--libstdc++-v3/include/c_std/bits/std_csignal.h6
-rw-r--r--libstdc++-v3/include/c_std/bits/std_cstdarg.h7
-rw-r--r--libstdc++-v3/include/c_std/bits/std_cstddef.h2
-rw-r--r--libstdc++-v3/include/c_std/bits/std_cstdio.h180
-rw-r--r--libstdc++-v3/include/c_std/bits/std_cstdlib.h172
-rw-r--r--libstdc++-v3/include/c_std/bits/std_cstring.h73
-rw-r--r--libstdc++-v3/include/c_std/bits/std_ctime.h21
-rw-r--r--libstdc++-v3/include/c_std/bits/std_cwchar.h227
-rw-r--r--libstdc++-v3/include/c_std/bits/std_cwctype.h51
-rw-r--r--libstdc++-v3/include/ext/bvector8
-rw-r--r--libstdc++-v3/include/ext/hash_map164
-rw-r--r--libstdc++-v3/include/ext/hash_set173
-rw-r--r--libstdc++-v3/include/ext/rope29
-rw-r--r--libstdc++-v3/include/ext/ropeimpl.h141
-rw-r--r--libstdc++-v3/include/ext/slist198
-rw-r--r--libstdc++-v3/include/ext/stl_bvector.h2
-rw-r--r--libstdc++-v3/include/ext/stl_hash_fun.h56
-rw-r--r--libstdc++-v3/include/ext/stl_hashtable.h172
-rw-r--r--libstdc++-v3/include/ext/stl_rope.h346
-rw-r--r--libstdc++-v3/include/std/algorithm29
-rw-r--r--libstdc++-v3/include/std/bitset29
-rw-r--r--libstdc++-v3/include/std/cassert29
-rw-r--r--libstdc++-v3/include/std/cctype29
-rw-r--r--libstdc++-v3/include/std/cerrno29
-rw-r--r--libstdc++-v3/include/std/cfloat29
-rw-r--r--libstdc++-v3/include/std/ciso64628
-rw-r--r--libstdc++-v3/include/std/climits29
-rw-r--r--libstdc++-v3/include/std/clocale29
-rw-r--r--libstdc++-v3/include/std/cmath29
-rw-r--r--libstdc++-v3/include/std/complex29
-rw-r--r--libstdc++-v3/include/std/csetjmp28
-rw-r--r--libstdc++-v3/include/std/csignal28
-rw-r--r--libstdc++-v3/include/std/cstdarg28
-rw-r--r--libstdc++-v3/include/std/cstddef29
-rw-r--r--libstdc++-v3/include/std/cstdio29
-rw-r--r--libstdc++-v3/include/std/cstdlib29
-rw-r--r--libstdc++-v3/include/std/cstring29
-rw-r--r--libstdc++-v3/include/std/ctime29
-rw-r--r--libstdc++-v3/include/std/cwchar29
-rw-r--r--libstdc++-v3/include/std/cwctype29
-rw-r--r--libstdc++-v3/include/std/deque29
-rw-r--r--libstdc++-v3/include/std/fstream29
-rw-r--r--libstdc++-v3/include/std/functional29
-rw-r--r--libstdc++-v3/include/std/iomanip29
-rw-r--r--libstdc++-v3/include/std/ios29
-rw-r--r--libstdc++-v3/include/std/iosfwd29
-rw-r--r--libstdc++-v3/include/std/iostream29
-rw-r--r--libstdc++-v3/include/std/istream29
-rw-r--r--libstdc++-v3/include/std/iterator29
-rw-r--r--libstdc++-v3/include/std/limits29
-rw-r--r--libstdc++-v3/include/std/list29
-rw-r--r--libstdc++-v3/include/std/locale29
-rw-r--r--libstdc++-v3/include/std/map29
-rw-r--r--libstdc++-v3/include/std/memory29
-rw-r--r--libstdc++-v3/include/std/numeric29
-rw-r--r--libstdc++-v3/include/std/ostream29
-rw-r--r--libstdc++-v3/include/std/queue29
-rw-r--r--libstdc++-v3/include/std/set29
-rw-r--r--libstdc++-v3/include/std/sstream29
-rw-r--r--libstdc++-v3/include/std/stack29
-rw-r--r--libstdc++-v3/include/std/stdexcept29
-rw-r--r--libstdc++-v3/include/std/streambuf29
-rw-r--r--libstdc++-v3/include/std/string29
-rw-r--r--libstdc++-v3/include/std/utility29
-rw-r--r--libstdc++-v3/include/std/valarray29
-rw-r--r--libstdc++-v3/include/std/vector29
-rw-r--r--libstdc++-v3/libio/ChangeLog24
-rw-r--r--libstdc++-v3/libio/Makefile.am9
-rw-r--r--libstdc++-v3/libio/Makefile.in49
-rw-r--r--libstdc++-v3/libmath/Makefile.am19
-rw-r--r--libstdc++-v3/libmath/Makefile.in53
-rw-r--r--libstdc++-v3/libmath/atan2f.c39
-rw-r--r--libstdc++-v3/libmath/expf.c39
-rw-r--r--libstdc++-v3/libmath/hypot.c38
-rw-r--r--libstdc++-v3/libmath/hypotf.c48
-rw-r--r--libstdc++-v3/libmath/hypotl.c37
-rw-r--r--libstdc++-v3/libmath/mathconf.h154
-rw-r--r--libstdc++-v3/libmath/stubs.c271
-rw-r--r--libstdc++-v3/libsupc++/Makefile.am68
-rw-r--r--libstdc++-v3/libsupc++/Makefile.in155
-rw-r--r--libstdc++-v3/libsupc++/cxxabi.h24
-rw-r--r--libstdc++-v3/libsupc++/del_op.cc1
-rw-r--r--libstdc++-v3/libsupc++/del_opnt.cc1
-rw-r--r--libstdc++-v3/libsupc++/del_opv.cc1
-rw-r--r--libstdc++-v3/libsupc++/del_opvnt.cc1
-rw-r--r--libstdc++-v3/libsupc++/eh_alloc.cc163
-rw-r--r--libstdc++-v3/libsupc++/eh_aux_runtime.cc56
-rw-r--r--libstdc++-v3/libsupc++/eh_catch.cc103
-rw-r--r--libstdc++-v3/libsupc++/eh_exception.cc44
-rw-r--r--libstdc++-v3/libsupc++/eh_globals.cc118
-rw-r--r--libstdc++-v3/libsupc++/eh_personality.cc443
-rw-r--r--libstdc++-v3/libsupc++/eh_terminate.cc87
-rw-r--r--libstdc++-v3/libsupc++/eh_throw.cc102
-rw-r--r--libstdc++-v3/libsupc++/exception41
-rw-r--r--libstdc++-v3/libsupc++/exception_defines.h42
-rw-r--r--libstdc++-v3/libsupc++/exception_support.cc391
-rw-r--r--libstdc++-v3/libsupc++/exception_support.h66
-rw-r--r--libstdc++-v3/libsupc++/new28
-rw-r--r--libstdc++-v3/libsupc++/new_handler.cc4
-rw-r--r--libstdc++-v3/libsupc++/new_op.cc10
-rw-r--r--libstdc++-v3/libsupc++/new_opnt.cc4
-rw-r--r--libstdc++-v3/libsupc++/new_opv.cc1
-rw-r--r--libstdc++-v3/libsupc++/new_opvnt.cc1
-rw-r--r--libstdc++-v3/libsupc++/pure.cc23
-rw-r--r--libstdc++-v3/libsupc++/tinfo.cc506
-rw-r--r--libstdc++-v3/libsupc++/tinfo.h217
-rw-r--r--libstdc++-v3/libsupc++/tinfo2.cc298
-rw-r--r--libstdc++-v3/libsupc++/typeinfo57
-rw-r--r--libstdc++-v3/libsupc++/unwind-cxx.h163
-rw-r--r--libstdc++-v3/libsupc++/vec.cc515
-rwxr-xr-xlibstdc++-v3/mkcheck.in86
-rwxr-xr-xlibstdc++-v3/mknumeric_limits36
-rw-r--r--libstdc++-v3/porting.texi105
-rw-r--r--libstdc++-v3/src/Makefile.am265
-rw-r--r--libstdc++-v3/src/Makefile.in261
-rw-r--r--libstdc++-v3/src/bitset.cc44
-rw-r--r--libstdc++-v3/src/cmath.cc48
-rw-r--r--libstdc++-v3/src/complex_io.cc99
-rw-r--r--libstdc++-v3/src/functexcept.cc152
-rw-r--r--libstdc++-v3/src/gen-num-limits.cc461
-rw-r--r--libstdc++-v3/src/globals.cc80
-rw-r--r--libstdc++-v3/src/ios.cc167
-rw-r--r--libstdc++-v3/src/limits.cc427
-rw-r--r--libstdc++-v3/src/locale-inst.cc32
-rw-r--r--libstdc++-v3/src/locale.cc290
-rw-r--r--libstdc++-v3/src/localename.cc14
-rw-r--r--libstdc++-v3/src/misc-inst.cc31
-rw-r--r--libstdc++-v3/src/stdexcept.cc27
-rw-r--r--libstdc++-v3/src/stl-inst.cc30
-rw-r--r--libstdc++-v3/src/string-inst.cc5
-rw-r--r--libstdc++-v3/src/strstream.cc37
-rw-r--r--libstdc++-v3/src/valarray-inst.cc46
-rw-r--r--libstdc++-v3/src/wstring-inst.cc6
-rw-r--r--libstdc++-v3/tests_flags.in160
-rw-r--r--libstdc++-v3/testsuite/17_intro/header_cassert.cc40
-rw-r--r--libstdc++-v3/testsuite/17_intro/header_cerrno.cc40
-rw-r--r--libstdc++-v3/testsuite/17_intro/header_ciso646.cc10
-rw-r--r--libstdc++-v3/testsuite/17_intro/header_csetjmp.cc41
-rw-r--r--libstdc++-v3/testsuite/17_intro/header_cstdarg.cc46
-rw-r--r--libstdc++-v3/testsuite/17_intro/header_cstddef.cc46
-rw-r--r--libstdc++-v3/testsuite/17_intro/header_cstdio.cc7
-rw-r--r--libstdc++-v3/testsuite/17_intro/header_cstdlib.cc20
-rw-r--r--libstdc++-v3/testsuite/17_intro/header_cstring.cc5
-rw-r--r--libstdc++-v3/testsuite/17_intro/header_ctime.cc6
-rw-r--r--libstdc++-v3/testsuite/17_intro/header_cwchar.cc5
-rw-r--r--libstdc++-v3/testsuite/17_intro/header_cwctype.cc28
-rw-r--r--libstdc++-v3/testsuite/17_intro/header_fstream.cc8
-rw-r--r--libstdc++-v3/testsuite/17_intro/header_iomanip.cc8
-rw-r--r--libstdc++-v3/testsuite/17_intro/header_ios.cc8
-rw-r--r--libstdc++-v3/testsuite/17_intro/header_iosfwd.cc8
-rw-r--r--libstdc++-v3/testsuite/17_intro/header_iostream.cc8
-rw-r--r--libstdc++-v3/testsuite/17_intro/header_istream.cc8
-rw-r--r--libstdc++-v3/testsuite/17_intro/header_ostream.cc8
-rw-r--r--libstdc++-v3/testsuite/17_intro/header_sstream.cc8
-rw-r--r--libstdc++-v3/testsuite/17_intro/header_streambuf.cc4
-rw-r--r--libstdc++-v3/testsuite/17_intro/headers.cc2
-rw-r--r--libstdc++-v3/testsuite/17_intro/headers_c++.cc16
-rw-r--r--libstdc++-v3/testsuite/17_intro/headers_c.cc10
-rw-r--r--libstdc++-v3/testsuite/18_support/numeric_limits.cc7
-rw-r--r--libstdc++-v3/testsuite/19_diagnostics/stdexceptions.cc116
-rw-r--r--libstdc++-v3/testsuite/20_util/auto_ptr.cc2
-rw-r--r--libstdc++-v3/testsuite/20_util/binders.cc51
-rw-r--r--libstdc++-v3/testsuite/21_strings/append.cc8
-rw-r--r--libstdc++-v3/testsuite/21_strings/c_strings.cc91
-rw-r--r--libstdc++-v3/testsuite/21_strings/capacity.cc25
-rw-r--r--libstdc++-v3/testsuite/21_strings/char_traits_requirements.cc (renamed from libstdc++-v3/testsuite/21_strings/char_traits.cc)12
-rw-r--r--libstdc++-v3/testsuite/21_strings/char_traits_typedefs.cc (renamed from libstdc++-v3/testsuite/21_strings/char_traits-int_type.C)7
-rw-r--r--libstdc++-v3/testsuite/21_strings/compare.cc8
-rw-r--r--libstdc++-v3/testsuite/21_strings/ctor_copy_dtor.cc33
-rw-r--r--libstdc++-v3/testsuite/21_strings/element_access.cc10
-rw-r--r--libstdc++-v3/testsuite/21_strings/find.cc8
-rw-r--r--libstdc++-v3/testsuite/21_strings/insert.cc9
-rw-r--r--libstdc++-v3/testsuite/21_strings/inserters_extractors.cc38
-rw-r--r--libstdc++-v3/testsuite/21_strings/invariants.cc8
-rw-r--r--libstdc++-v3/testsuite/21_strings/nonmember.cc12
-rw-r--r--libstdc++-v3/testsuite/21_strings/operations.cc4
-rw-r--r--libstdc++-v3/testsuite/21_strings/replace.cc8
-rw-r--r--libstdc++-v3/testsuite/21_strings/rfind.cc3
-rw-r--r--libstdc++-v3/testsuite/21_strings/substr.cc8
-rw-r--r--libstdc++-v3/testsuite/22_locale/codecvt_char_char.cc5
-rw-r--r--libstdc++-v3/testsuite/22_locale/codecvt_unicode_char.cc5
-rw-r--r--libstdc++-v3/testsuite/22_locale/codecvt_unicode_wchar_t.cc5
-rw-r--r--libstdc++-v3/testsuite/22_locale/codecvt_wchar_t_char.cc5
-rw-r--r--libstdc++-v3/testsuite/22_locale/ctor_copy_dtor.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/ctype.cc13
-rw-r--r--libstdc++-v3/testsuite/22_locale/ctype_char_members.cc4
-rw-r--r--libstdc++-v3/testsuite/22_locale/ctype_wchar_t_members.cc4
-rw-r--r--libstdc++-v3/testsuite/22_locale/facet.cc10
-rw-r--r--libstdc++-v3/testsuite/22_locale/global_templates.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/members.cc5
-rw-r--r--libstdc++-v3/testsuite/22_locale/numpunct_byname.cc5
-rw-r--r--libstdc++-v3/testsuite/22_locale/numpunct_char_members.cc3
-rw-r--r--libstdc++-v3/testsuite/22_locale/operators.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/static_members.cc2
-rw-r--r--libstdc++-v3/testsuite/23_containers/bitset_ctor.cc2
-rw-r--r--libstdc++-v3/testsuite/23_containers/bitset_members.cc59
-rw-r--r--libstdc++-v3/testsuite/23_containers/bitset_shift.cc2
-rw-r--r--libstdc++-v3/testsuite/23_containers/map_insert.cc69
-rw-r--r--libstdc++-v3/testsuite/23_containers/map_operators.cc38
-rw-r--r--libstdc++-v3/testsuite/23_containers/multiset.cc1
-rw-r--r--libstdc++-v3/testsuite/23_containers/set_operators.cc14
-rw-r--r--libstdc++-v3/testsuite/23_containers/vector_capacity.cc2
-rw-r--r--libstdc++-v3/testsuite/23_containers/vector_ctor.cc5
-rw-r--r--libstdc++-v3/testsuite/23_containers/vector_element_access.cc5
-rw-r--r--libstdc++-v3/testsuite/23_containers/vector_modifiers.cc6
-rw-r--r--libstdc++-v3/testsuite/24_iterators/istreambuf_iterator.cc45
-rw-r--r--libstdc++-v3/testsuite/24_iterators/iterator.cc5
-rw-r--r--libstdc++-v3/testsuite/24_iterators/ostreambuf_iterator.cc98
-rw-r--r--libstdc++-v3/testsuite/25_algorithms/equal.cc41
-rw-r--r--libstdc++-v3/testsuite/25_algorithms/lower_bound.cc5
-rw-r--r--libstdc++-v3/testsuite/25_algorithms/min_max.cc5
-rw-r--r--libstdc++-v3/testsuite/26_numerics/binary_closure.cc1
-rw-r--r--libstdc++-v3/testsuite/26_numerics/buggy_complex.cc1
-rw-r--r--libstdc++-v3/testsuite/26_numerics/c99_classification_macros_c++.cc91
-rw-r--r--libstdc++-v3/testsuite/26_numerics/c99_classification_macros_c.cc (renamed from libstdc++-v3/config/threads-no.h)54
-rw-r--r--libstdc++-v3/testsuite/26_numerics/c_math.cc3
-rw-r--r--libstdc++-v3/testsuite/26_numerics/complex_inserters_extractors.cc48
-rw-r--r--libstdc++-v3/testsuite/26_numerics/complex_value.cc2
-rw-r--r--libstdc++-v3/testsuite/26_numerics/fabs_inline.cc37
-rw-r--r--libstdc++-v3/testsuite/26_numerics/valarray.cc3
-rw-r--r--libstdc++-v3/testsuite/26_numerics/valarray_const_bracket.cc48
-rw-r--r--libstdc++-v3/testsuite/27_io/filebuf.cc62
-rw-r--r--libstdc++-v3/testsuite/27_io/filebuf_members.cc18
-rw-r--r--libstdc++-v3/testsuite/27_io/filebuf_virtuals.cc62
-rw-r--r--libstdc++-v3/testsuite/27_io/fpos.cc14
-rw-r--r--libstdc++-v3/testsuite/27_io/fstream_members.cc70
-rw-r--r--libstdc++-v3/testsuite/27_io/ifstream_members.cc46
-rw-r--r--libstdc++-v3/testsuite/27_io/ios_base_callbacks.cc6
-rw-r--r--libstdc++-v3/testsuite/27_io/ios_base_members_static.cc12
-rw-r--r--libstdc++-v3/testsuite/27_io/ios_base_storage.cc6
-rw-r--r--libstdc++-v3/testsuite/27_io/ios_ctor.cc3
-rw-r--r--libstdc++-v3/testsuite/27_io/ios_init.cc88
-rw-r--r--libstdc++-v3/testsuite/27_io/ios_manip_basefield.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/ios_manip_fmtflags.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/ios_members.cc4
-rw-r--r--libstdc++-v3/testsuite/27_io/istream.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/istream_extractor_arith.cc99
-rw-r--r--libstdc++-v3/testsuite/27_io/istream_extractor_char.cc3
-rw-r--r--libstdc++-v3/testsuite/27_io/istream_extractor_other.cc45
-rw-r--r--libstdc++-v3/testsuite/27_io/istream_manip.cc10
-rw-r--r--libstdc++-v3/testsuite/27_io/istream_seeks-1.tst7
-rw-r--r--libstdc++-v3/testsuite/27_io/istream_seeks-1.txt7
-rw-r--r--libstdc++-v3/testsuite/27_io/istream_seeks-2.tst (renamed from libjava/doc/java-awt-datatransfer.texi)0
-rw-r--r--libstdc++-v3/testsuite/27_io/istream_seeks-3.tst10
-rw-r--r--libstdc++-v3/testsuite/27_io/istream_seeks.cc116
-rw-r--r--libstdc++-v3/testsuite/27_io/istream_sentry.cc15
-rw-r--r--libstdc++-v3/testsuite/27_io/istream_unformatted-1.tst1507
-rw-r--r--libstdc++-v3/testsuite/27_io/istream_unformatted-1.txt1507
-rw-r--r--libstdc++-v3/testsuite/27_io/istream_unformatted-2.tst0
-rw-r--r--libstdc++-v3/testsuite/27_io/istream_unformatted-3.tst1500
-rw-r--r--libstdc++-v3/testsuite/27_io/istream_unformatted-3.txt1500
-rw-r--r--libstdc++-v3/testsuite/27_io/istream_unformatted.cc67
-rw-r--r--libstdc++-v3/testsuite/27_io/istringstream_members.cc69
-rw-r--r--libstdc++-v3/testsuite/27_io/narrow_stream_objects.cc27
-rw-r--r--libstdc++-v3/testsuite/27_io/ofstream_members.cc47
-rw-r--r--libstdc++-v3/testsuite/27_io/ostream.cc1
-rw-r--r--libstdc++-v3/testsuite/27_io/ostream_inserter_arith.cc12
-rw-r--r--libstdc++-v3/testsuite/27_io/ostream_inserter_char.cc3
-rw-r--r--libstdc++-v3/testsuite/27_io/ostream_inserter_other.cc21
-rw-r--r--libstdc++-v3/testsuite/27_io/ostream_manip.cc8
-rw-r--r--libstdc++-v3/testsuite/27_io/ostream_seeks.cc10
-rw-r--r--libstdc++-v3/testsuite/27_io/ostream_unformatted.cc3
-rw-r--r--libstdc++-v3/testsuite/27_io/ostringstream_members.cc105
-rw-r--r--libstdc++-v3/testsuite/27_io/streambuf.cc26
-rw-r--r--libstdc++-v3/testsuite/27_io/stringbuf.cc24
-rw-r--r--libstdc++-v3/testsuite/27_io/stringbuf_virtuals.cc46
-rw-r--r--libstdc++-v3/testsuite/27_io/stringstream.cc18
-rw-r--r--libstdc++-v3/testsuite/27_io/stringstream_members.cc131
-rw-r--r--libstdc++-v3/testsuite/27_io/wide_stream_objects.cc2
-rw-r--r--libstdc++-v3/testsuite/Makefile.am15
-rw-r--r--libstdc++-v3/testsuite/Makefile.in282
-rw-r--r--libstdc++-v3/testsuite/README154
-rw-r--r--libstdc++-v3/testsuite/config/default.exp7
-rw-r--r--libstdc++-v3/testsuite/debug_assert.h51
-rw-r--r--libstdc++-v3/testsuite/ext/headers.cc4
-rw-r--r--libstdc++-v3/testsuite/lib/libstdc++-v3-dg.exp188
-rw-r--r--libstdc++-v3/testsuite/lib/libstdc++.exp304
-rw-r--r--libstdc++-v3/testsuite/libstdc++-v3.dg/dg.exp47
-rw-r--r--libstdc++-v3/testsuite/testsuite_hooks.h104
-rwxr-xr-xlibstdc++-v3/testsuite_flags.in60
-rw-r--r--libtool.m4234
-rw-r--r--ltcf-c.sh284
-rw-r--r--ltcf-cxx.sh378
-rw-r--r--ltcf-gcj.sh216
-rwxr-xr-xltconfig384
-rw-r--r--ltmain.sh1011
-rw-r--r--zlib/ChangeLog26
-rw-r--r--zlib/ChangeLog.gcj12
-rw-r--r--zlib/Makefile.in62
-rw-r--r--zlib/acinclude.m49
-rw-r--r--zlib/aclocal.m4613
-rwxr-xr-xzlib/configure1073
-rw-r--r--zlib/configure.in44
2048 files changed, 183880 insertions, 175361 deletions
diff --git a/.cvsignore b/.cvsignore
index bde48527b00..e2952dc9ac3 100644
--- a/.cvsignore
+++ b/.cvsignore
@@ -29,4 +29,4 @@ dir.info
Makefile
lost+found
update.out
-
+LAST_UPDATED
diff --git a/ChangeLog b/ChangeLog
index 242850cf35f..f66a580ce1a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,329 @@
+2002-02-20 Release Manager
+
+ * GCC 3.0.4 Released.
+
+2002-02-20 Release Manager
+
+ * GCC 3.0.4 Released.
+
+2002-01-31 Bob Wilson <bob.wilson@acm.org>
+
+ * config.sub: Add support for Xtensa processors.
+
+2001-12-20 Release Manager
+
+ * GCC 3.0.3 Released.
+
+2001-10-23 Release Manager
+
+ * GCC 3.0.2 Released.
+
+2001-10-03 Eric Christopher <echristo@redhat.com>
+
+ * MAINTAINERS: Replace Gavin with myself as MIPS maintainer.
+
+2001-10-02 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * configure: Handle temporary files securely using mkdir.
+
+2001-08-19 Release Manager
+
+ * GCC 3.0.1 Released.
+
+2001-08-19 Release Manager
+
+ * GCC 3.0.1 Released.
+
+2001-08-19 Release Manager
+
+ * GCC 3.0.1 Released.
+
+2001-08-13 Andreas Jaeger <aj@suse.de>
+
+ * configure.in: Disable libgcj on s390*-linux targets.
+
+2001-08-10 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * MAINTAINERS (Various maintainers: s390 port): Added myself
+ and Hartmut Penner <hpenner@de.ibm.com>.
+
+2001-07-30 Jeff Sturm <jsturm@one-pont.com>
+
+ * ltcf-c.sh: Use $objext, not $ac_objext.
+
+2001-07-28 Richard Henderson <rth@redhat.com>
+
+ * .cvsignore: Add LAST_UPDATED.
+
+2001-07-27 Mark Kettenis <kettenis@gnu.org>
+
+ * ltcf-cxx.sh: Add support for GNU.
+
+2001-07-22 Timothy Wall <twall@redhat.com>
+
+ * ltcf-c.sh: Don't disable shared libraries for AIX5/IA64. Preserve
+ default settings if using GNU tools with that configuration.
+ * ltcf-cxx.sh: Ditto.
+ * ltcf-gcj.sh: Ditto.
+
+2001-07-21 Michael Chastain <chastain@redhat.com>
+
+ * ltconfig: Set max_cmd_len to a maximum of 512Kb, as it seems some
+ HPUX 11.0 systems have trouble with 1MB. Mark as gcc-local.
+ * ltmain.sh: Mark as gcc-local.
+
+2001-07-16 Aldy Hernandez <aldyh@redhat.com>
+
+ * config.sub: Fix mips64vr5000el typo in CPU-COMPANY.
+
+2001-07-12 Stephane Carrez <Stephane.Carrez@worldnet.fr>
+
+ * configure.in (noconfigdirs): Don't compile libiberty, libstdcxx
+ and libgcj on m68hc11/m68hc12.
+
+20010617 Release Manager
+
+ * GCC 3.0 Released.
+
+2001-06-13 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * README: Remove version number.
+
+2001-06-13 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
+
+ * INSTALL/README: Update wrt. to the installation instructions now
+ residing in gcc/doc/install.texi.
+
+2001-06-13 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * README: Replace with a cut-down and updated version of gcc/README.
+
+2001-06-12 David Edelsohn <edelsohn@gnu.org>
+
+ * config-ml.in (powerpc-*-* | rs6000-*-*): Allow aix64 and pthread
+ multilibs to be disabled.
+
+2001-06-09 Alexandre Oliva <aoliva@redhat.com>
+
+ * config.guess: Import CVS version 1.195.
+ * config.sub: Import CVS version 1.212.
+
+2001-06-08 Loren J. Rittle <ljrittle@acm.org>
+
+ * MAINTAINERS: Update e-mail address changes from mainline.
+ Add myself to write after approval list.
+
+2001-06-08 Alexandre Oliva <aoliva@redhat.com>, Jeff Sturm <jsturm@one-point.com>
+
+ * Makefile.in (AS_FOR_TARGET, LD_FOR_TARGET, NM_FOR_TARGET): If
+ gcc/xgcc is built, use -print-prog-name to find out the program
+ name to use.
+
+2001-06-04 Phil Edwards <pme@sources.redhat.com>
+
+ * config.guess: Import CVS version 1.194. All gcc-local changes
+ appear to also be in the master copy.
+ * config.sub: Import CVS version 1.211.
+
+Mon Jun 4 16:32:58 2001 Mark Mitchell <mark@codesourcery.com>
+
+ * ltcf-c.sh (archive_cmds, archive_expsym_cmds) [solaris,
+ with_gcc]: Use `gcc -shared' to build a shared library.
+
+Mon Jun 4 16:24:56 2001 John David Anglin <dave@hiauly1.hia.nrc.ca>
+
+ * ltcf-c.sh (archive_cmd) [hpux, with_gcc]: Use gcc to link shared
+ archives.
+
+Fri Jun 1 18:55:19 2001 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * MAINTAINERS (Write After Approval): Add myself.
+
+2001-05-30 Hans-Peter Nilsson <hp@axis.com>
+
+ * configure.in (libstdcxx_flags): Do not try to execute
+ libstdc++-v3/testsuite_flags until it exists.
+
+2001-05-28 Simon Patarin <simon.patarin@inria.fr>
+
+ * ltcf-cxx.sh (osf3/osf4/osf5): Support creation of C++ shared
+ libraries when using g++ with native linker.
+
+2001-05-28 Alexandre Oliva <aoliva@redhat.com>
+
+ * ltconfig, ltmain.sh: Upgrade to libtool 1.4a 1.641.2.256.
+
+2001-05-22 Alexandre Oliva <aoliva@redhat.com>
+
+ * ltcf-cxx.sh (allow_undefined_flag, no_undefined_flag)
+ [aix4*|aix5*]: Prepend blank.
+
+2001-05-20 Alexandre Oliva <aoliva@redhat.com>
+
+ * ltconfig, ltmain.sh, libtool.m4, ltcf-c.sh, ltcf-cxx.sh,
+ ltcf-gcj.sh: Upgraded to libtool 1.4a 1.641.2.254. Rebuilt a number
+ of subdir/configure scripts to use the new libtool.m4.
+
+2001-05-18 Benjamin Kosnik <bkoz@redhat.com>
+
+ * configure.in (libstdcxx_flags): Remove reference to libstdc++.INC.
+
+2001-05-07 Mark Mitchell <mark@codesourcery.com>
+
+ * configure.in (target_libs): Remove target-libchill.
+
+2001-05-03 Alexandre Oliva <aoliva@redhat.com>
+
+ * configure.in (noconfigdirs) [*-cygwin*, *-mingw*, *-beos]: Disable
+ libgcj.
+
+Fri Apr 27 14:39:25 2001 Alexandre Oliva <aoliva@redhat.com>
+
+ * ltcf-cxx.sh: Add -nostdlib to HP-UX GCC archive_cmds.
+
+Fri Apr 27 10:23:04 2001 Mark P Mitchell <mark@codesourcery.com>
+
+ * ltcf-cxx.sh: Add -nostdlib to IRIX 6 archive_cmds.
+
+Thu Apr 26 02:13:41 2001 Alexandre Oliva <aoliva@redhat.com>
+
+ * configure.in (noconfigdirs): Don't reset it from scratch in the
+ target case; only append to it.
+
+Thu Apr 26 02:13:07 2001 Alexandre Oliva <aoliva@redhat.com>
+
+ * configure.in (noconfigdirs) [hppa*-*-*, mips*-*-irix6*,
+ sparc-*-solaris2.8]: Disable ${libgcj}.
+
+Wed Apr 25 18:35:30 2001 Alexandre Oliva <aoliva@redhat.com>
+
+ * configure.in (libgcj_saved): Copy from $libgcj.
+ (libgcj): Zero out if --enable-libgcj; add to noconfigdirs is
+ --disable-libgcj.
+
+Mon Apr 23 09:15:03 2001 Anthony Green <green@redhat.com>
+
+ * configure.in: Move *-chorusos target case to the proper switch.
+ Disable libgcj.
+
+2001-04-20 Alexandre Oliva <aoliva@redhat.com>
+
+ * ltconfig, ltmain.sh, ltcf-cxx.sh: Upgraded to libtool 1.4a
+ 1.641.2.228.
+
+2001-04-13 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
+
+ * Makefile.in (STAGE1_CFLAGS): Pass down.
+
+2001-04-12 Alexandre Oliva <aoliva@redhat.com>
+
+ * ltconfig, ltmain.sh, libtool.m4, ltcf-c.sh, ltcf-cxx.sh,
+ ltcf-gcj.sh: Upgraded to libtool 1.4a 1.641.2.226.
+
+2001-04-10 Loren J. Rittle <ljrittle@acm.org>
+
+ * ltcf-cxx.sh: Support creation of C++ shared libraries on
+ recent versions of FreeBSD (release 3 or later).
+ * ltconfig: On FreeBSD, -lc must not be provided when building
+ a shared library or else the standard -pthread gcc option is
+ rendered worthless to later users of the built library.
+
+2001-04-08 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
+
+ * MAINTAINERS: Add myself as "documentation co-maintainer".
+
+2001-04-06 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * MAINTAINERS: Add self and RTH as C front end maintainers.
+
+2001-04-01 Alexandre Oliva <aoliva@redhat.com>
+
+ * Makefile.in (CXX_FOR_TARGET_FOR_RECURSIVE_MAKE, RECURSE_FLAGS):
+ New macros.
+ (bootstrap, cross): Use RECURSE_FLAGS.
+ * configure.in: Subst CXX_FOR_TARGET_FOR_RECURSIVE_MAKE.
+
+2001-04-01 Alexandre Oliva <aoliva@redhat.com>
+
+ * Makefile.in (CXX_FOR_TARGET_FOR_RECURSIVE_MAKE, RECURSE_FLAGS):
+ New macros.
+ (bootstrap, cross): Use RECURSE_FLAGS.
+ * configure.in: Subst CXX_FOR_TARGET_FOR_RECURSIVE_MAKE.
+
+2001-03-27 Alexandre Oliva <aoliva@redhat.com>
+
+ * configure.in (CXX_FOR_TARGET): Use xgcc for libstdc++-v3.
+
+2001-03-22 Alexandre Oliva <aoliva@redhat.com>
+
+ Re-installed:
+ 2001-01-02 Laurynas Biveinis <lauras@softhome.net>
+ * ltcf-c.sh: Clear ac_cv_prog_cc_pic for DJGPP. Do not add
+ '-DPIC' to ac_cv_prog_cc_pic for DJGPP.
+ * ltcf-cxx.sh: Likewise.
+ * ltcf-gcj.sh: Likewise.
+
+ * ltconfig, ltmain.sh, libtool.m4, ltcf-c.sh, ltcf-cxx.sh,
+ ltcf-gcj.sh: Upgraded to libtool 1.4a 1.641.2.198.
+
+2001-03-19 Tom Tromey <tromey@redhat.com>
+
+ * config-ml.in: Handle GCJ and GCJFLAGS.
+
+2001-03-10 Ovidiu Predescu <ovidiu@cup.hp.com>
+
+ * MAINTAINERS: Added Stan Shebs as new maintainer for Objective-C.
+
+2001-03-09 Nicola Pero <n.pero@mi.flashnet.it>
+
+ * configure.in: Only use `lang_requires' for languages athat are
+ actually enabled.
+
+2001-03-08 Alexandre Oliva <aoliva@redhat.com>
+
+ * Makefile.in (ALL_GCC, ALL_GCC_C, ALL_GCC_CXX): Set before use.
+
+2001-03-07 Tom Tromey <tromey@redhat.com>
+
+ * configure.in: Allow config-lang.in to set `lang_requires' to list
+ of other required languages.
+
+2001-02-20 Laurynas Biveinis <lauras@softhome.net>
+
+ * MAINTAINERS: add myself to Write After Approval list.
+
+2001-02-19 Benjamin Kosnik <bkoz@purist.soma.redhat.com>
+
+ * configure.in (target_libs): Remove libg++.
+ (noconfigdirs): Remove libg++.
+ (noconfigdirs): Same.
+ (noconfigdirs): Same.
+ (noconfigdirs): Same.
+
+ * config-ml.in: Remove libg++ references.
+
+ * Makefile.in (TARGET_CONFIGDIRS): Remove libio, libstdc++, libg++.
+ (ALL_TARGET_MODULES): Same.
+ (configure-target-libg++): Remove.
+ (all-target-libg++): Remove.
+ (configure-target-libio): Remove.
+ (all-target-libio): Remove.
+ (check-target-libio): Remove.
+ (.PHONY): Remove.
+ (libg++.tar.bz2): Remove.
+ (all-target-cygmon): Remove libio.
+ (all-target-libstdc++): Remove.
+ (configure-target-libstdc++): Remove.
+ (TARGET_LIB_PATH): Remove libstdc++.
+ (ALL_GCC_CXX): Remove libstdc++.
+ (all-target-gperf): Correct.
+
+2001-02-15 Anthony Green <green@redhat.com>
+
+ * configure: Introduce GCJ_FOR_TARGET.
+ * configure.in: Ditto.
+ * Makefile.in: Ditto.
+
2001-02-08 Chandrakala Chavva <cchavva@redhat.com>
* configure.in: for *-chorusos, don't config target-newlib and
@@ -130,12 +456,12 @@
2000-12-18 Benjamin Kosnik <bkoz@redhat.com>
- * Makefile.in (BASE_FLAGS_TO_PASS): Alphabetize.
+ * Makefile.in (BASE_FLAGS_TO_PASS): Alphabetize.
(libstdcxx_incdir): Pass down.
* config.if: Remove expired bits for cxx_interface, add stub.
(libstdcxx_incdir): Add variable for g++ include directory.
* configure.in (gxx_include_dir): Use it.
-
+
2000-12-18 Alexandre Oliva <aoliva@redhat.com>
* MAINTAINERS: Added self as sh port co-maintainer. Removed entry
@@ -152,11 +478,11 @@
* MAINTAINERS: Added gcj developers.
2000-12-13 Anthony Green <green@redhat.com>
-
+
* configure.in: Disable libgcj for any target not specifically
- listed. Disable libgcj for x86 and Alpha Linux until compatible
- with g++ abi.
-
+ listed. Disable libgcj for x86 and Alpha Linux until compatible
+ with g++ abi.
+
2000-12-13 Mike Stump <mrs@wrs.com>
* Makefile.in (local-distclean): Also remove fastjar.
@@ -305,7 +631,7 @@ Mon Nov 6 14:19:35 2000 Christopher Faylor <cgf@cygnus.com>
* MAINTAINERS: Rename <name>@cygnus.com addresses to
<name>@redhat.com. Also installed new email address for Clint
Popetz.
-
+
2000-10-30 Joseph S. Myers <jsm28@cam.ac.uk>
* etc: Remove directory from GCC.
@@ -315,8 +641,8 @@ Mon Nov 6 14:19:35 2000 Christopher Faylor <cgf@cygnus.com>
* configure (gcc/configargs.h): Only create if there is a build GCC
directory created.
-2000-10-16 Matthias Klose <doko@debian.org>
-
+2000-10-16 Matthias Klose <doko@debian.org>
+
* config.if: Search libstdc++-v3/configure.in for INTERFACE,
when configured for libstdc++-v3.
@@ -454,7 +780,7 @@ Wed Sep 13 11:11:29 2000 Jeffrey A Law (law@cygnus.com)
* configure.in (libstdcxx_flags): Remove -isystem $$s/libio/stdio.
- * configure: Make enable_threads and enable_shared defaults
+ * configure: Make enable_threads and enable_shared defaults
explicit. Substitute enable_threads into generated Makefiles.
* configure.in: Accept *-*-linux* not just *-*-linux-gnu*.
* libtool.m4: Accept *-*-linux* not just *-*-linux-gnu*.
@@ -536,7 +862,7 @@ Wed Sep 13 11:11:29 2000 Jeffrey A Law (law@cygnus.com)
* libtool.m4, ltcf-c.sh, ltcf-cxx.sh, ltcf-gcj.sh: New files from
the libtool CVS tree multi-language branch.
* ltconfig, ltmain.sh: Updated.
-
+
2000-07-27 Alexandre Oliva <aoliva@redhat.com>
* Makefile.in (clean-target-libgcc): Remove gcc/libgcc.
@@ -659,7 +985,7 @@ Tue May 16 09:57:35 2000 Andrew Cagney <cagney@b1.cygnus.com>
Wed Apr 26 17:03:53 2000 Andrew Cagney <cagney@b1.cygnus.com>:
* Makefile.in (do-djunpack): New target. Update djunpack.bat with
- current version information. Add to proto-toplev directory.
+ current version information. Add to proto-toplev directory.
(gdb-taz): Build do-djunpack.
2000-05-15 David Edelsohn <edelsohn@gnu.org>
@@ -703,9 +1029,9 @@ Sat May 6 21:12:55 CDT 2000 Jason Eckhardt <jle@cygnus.com>
Wed Apr 19 12:46:26 2000 Andrew Cagney <cagney@b1.cygnus.com>
* Makefile.in (taz, gdb-taz, gas.tar.bz2, binutils.tar.bz2,
- gas+binutils.tar.bz2, libg++.tar.bz2, gnats.tar.bz2, gdb.tar.bz2,
- dejagnu.tar.bz2, gdb+dejagnu.tar.bz2, insight.tar.bz2,
- insight+dejagnu.tar.bz2, newlib.tar.bz2): Pass MD5PROG to sub-make.
+ gas+binutils.tar.bz2, libg++.tar.bz2, gnats.tar.bz2, gdb.tar.bz2,
+ dejagnu.tar.bz2, gdb+dejagnu.tar.bz2, insight.tar.bz2,
+ insight+dejagnu.tar.bz2, newlib.tar.bz2): Pass MD5PROG to sub-make.
2000-04-16 Dave Pitts <dpitts@cozx.com>
@@ -724,11 +1050,11 @@ Wed Apr 12 16:42:48 2000 Andrew Cagney <cagney@b1.cygnus.com>
(PACKAGE): Default to TOOL.
(VER): Default to a shell script.
(taz): Rewrite target. Move real work to do-proto-toplev. Include
- md5 checksum generation.
+ md5 checksum generation.
(do-proto-toplev): New target. Create $(PACKAGE)-$(VER) link.
(do-tar-bz2): Delete creation of $(PACKAGE)-$(VER) link.
(gdb.tar.bz2, dejagnu.tar.bz2, gdb+dejagnu.tar.bz2,
- insight.tar.bz2): Use gdb-taz to create archive.
+ insight.tar.bz2): Use gdb-taz to create archive.
Fri Apr 7 18:10:29 2000 Andrew Cagney <cagney@b1.cygnus.com>
@@ -773,7 +1099,7 @@ Fri Mar 3 18:44:08 2000 Andrew Cagney <cagney@b1.cygnus.com>
(do-tar-bz2): Replace TOOL with PACKAGE.
(gdb.tar.bz2): Remove GDBTK from GDB package.
(gdb+dejagnu.tar.bz2, insight.tar.bz2, insight+dejagnu.tar.bz2,
- dejagnu.tar.bz2): New packages.
+ dejagnu.tar.bz2): New packages.
2000-02-27 Andreas Jaeger <aj@suse.de>
@@ -791,7 +1117,7 @@ Fri Mar 3 18:44:08 2000 Andrew Cagney <cagney@b1.cygnus.com>
Thu Feb 24 16:15:56 2000 Andrew Cagney <cagney@b1.cygnus.com>
* config.guess, config.sub: Updated to match config's 2000-02-15
- version.
+ version.
2000-02-23 Linas Vepstas <linas@linas.org>
@@ -1152,7 +1478,7 @@ Wed Mar 10 18:35:07 1999 Jeff Johnston <jjohnstn@cygnus.com>
Wed Mar 10 17:39:09 1999 Drew Moseley <dmoseley@cygnus.com>
* configure.in: Added bsp support to arm-*-coff and arm-*-elf
- targets.
+ targets.
1999-03-02 Nick Clifton <nickc@cygnus.com>
@@ -1280,7 +1606,7 @@ Thu Dec 17 01:22:30 1998 Jeffrey A Law (law@cygnus.com)
Tue Dec 15 17:02:58 1998 Bob Manson <manson@charmed.cygnus.com>
* configure.in: Add cygmon for x86-coff and x86-elf. Configure
- cygmon for all sparclite targets, regardless of object format.
+ cygmon for all sparclite targets, regardless of object format.
1998-12-15 Mark Salter <msalter@cygnus.com>
@@ -1667,7 +1993,7 @@ Sat Jun 27 22:46:32 1998 Jeffrey A Law (law@cygnus.com)
Wed Jun 24 16:01:59 1998 John Metzler <jmetzler@cygnus.com>
* configure.in (noconfigdirs): Add configure pattern for mips tx39
- cygmon
+ cygmon
Tue Jun 23 22:42:32 1998 Mark Alexander <marka@cygnus.com>
@@ -2319,7 +2645,7 @@ Mon Sep 29 00:38:08 1997 Aaron Jackson <jackson@negril.msrce.howard.edu>
Wed Sep 24 18:06:27 1997 Stu Grossman <grossman@babylon-5.cygnus.com>
* configure.in (d30v): Remove tcl, tk, expect, gdb, itcl, tix, db,
- sn, and gnuserv from noconfigdirs.
+ sn, and gnuserv from noconfigdirs.
Wed Sep 24 15:18:32 1997 Ian Lance Taylor <ian@cygnus.com>
@@ -2339,7 +2665,7 @@ Thu Sep 18 21:43:23 1997 Alexandre Oliva <oliva@dcc.unicamp.br>
Thu Sep 18 15:37:42 1997 Andrew Cagney <cagney@b1.cygnus.com>
* configure (tooldir): enable_gdbtk=YES for cygwin32, NO for
- windows. Consistent with gdb/configure.
+ windows. Consistent with gdb/configure.
1997-09-15 02:37 Ulrich Drepper <drepper@cygnus.com>
@@ -2520,13 +2846,13 @@ Tue Aug 5 12:12:44 1997 Andrew Cagney <cagney@b1.cygnus.com>
Mon Aug 4 22:59:02 1997 Andrew Cagney <cagney@b1.cygnus.com>
* Makefile.in (CC_FOR_TARGET): When winsup/Makefile present,
- correctly specify the target build directory $(TARGET_SUBDIR)/winsup
- for libraries.
+ correctly specify the target build directory $(TARGET_SUBDIR)/winsup
+ for libraries.
Mon Aug 4 12:40:24 1997 Jason Merrill <jason@yorick.cygnus.com>
* Makefile.in (EXTRA_GCC_FLAGS): Fix handling of macros with values
- separated by spaces.
+ separated by spaces.
Thu Jul 31 19:49:49 1997 Ian Lance Taylor <ian@cygnus.com>
@@ -2657,7 +2983,7 @@ Mon Jun 16 11:11:10 1997 Ian Lance Taylor <ian@cygnus.com>
$(DEFAULT_YACC).
* configure.in: Build itl, db, sn, etc., when building for native
- cygwin32.
+ cygwin32.
* Makefile.in (LD): New variable.
(EXTRA_HOST_FLAGS): Pass down LD.
@@ -2670,7 +2996,7 @@ Mon Jun 16 11:10:35 1997 Philip Blundell <Philip.Blundell@pobox.com>
Fri Jun 13 10:22:56 1997 Bob Manson <manson@charmed.cygnus.com>
* configure.in (targargs): Strip out any supplied --build argument
- before adding our own. Always add --build.
+ before adding our own. Always add --build.
Thu Jun 12 21:12:28 1997 Bob Manson <manson@charmed.cygnus.com>
@@ -2865,7 +3191,7 @@ Tue Feb 25 18:46:14 1997 Stan Shebs <shebs@andros.cygnus.com>
Tue Feb 25 13:19:14 1997 Andrew Cagney <cagney@kremvax.tpgi.com.au>
* configure.in (noconfigdirs): Disable target-newlib,
- target-examples and target-libiberty for d30v.
+ target-examples and target-libiberty for d30v.
Fri Feb 21 17:56:25 1997 Martin M. Hunt <hunt@pizza.cygnus.com>
@@ -2878,7 +3204,7 @@ Fri Feb 21 20:58:51 1997 Michael Meissner <meissner@cygnus.com>
Sun Feb 16 15:41:09 1997 Andrew Cagney <cagney@critters.cygnus.com>
* configure.in (d30v-*): Remove sim directory from list of
- unsupported d30v directories
+ unsupported d30v directories
Tue Feb 18 17:32:42 1997 Martin M. Hunt <hunt@pizza.cygnus.com>
@@ -3061,7 +3387,7 @@ Fri Nov 8 11:34:58 1996 David J. MacKenzie <djm@geech.gnu.ai.mit.edu>
LynxOs is not a hardware supplier.
* config.guess: Contributions from bug-gnu-utils to add support for:
- OpenBSD like NetBSD.
+ OpenBSD like NetBSD.
Stratus systems.
More Pyramid systems.
i[n>4]86 Intel chips.
@@ -3202,7 +3528,7 @@ Wed Oct 2 15:52:36 1996 Klaus Kaempf <kkaempf@progis.de>
Tue Oct 1 01:28:41 1996 James G. Smith <jsmith@cygnus.co.uk>
* configure.in (noconfigdirs): Don't build libgloss for arm-coff
- targets.
+ targets.
Mon Sep 30 14:24:01 1996 Stan Shebs <shebs@andros.cygnus.com>
@@ -3429,7 +3755,7 @@ Sun Jun 23 22:41:54 1996 Geoffrey Noer <noer@cygnus.com>
Sat Jun 22 11:39:01 1996 Jason Merrill <jason@yorick.cygnus.com>
* Makefile.in (TARGET_SUBDIR): Move comment to previous line so we
- don't get ". ".
+ don't get ". ".
Fri Jun 21 17:24:48 1996 Jim Wilson <wilson@cygnus.com>
@@ -3876,7 +4202,7 @@ Fri Dec 29 07:56:11 1995 Michael Meissner <meissner@tiktok.cygnus.com>
* Makefile.in (EXTRA_GCC_FLAGS): If any of the make variables
LANGUAGES, BOOT_CFLAGS, STMP_FIXPROTO, LIMITS_H_TEST,
LIBGCC1_TEST, LIBGCC2_CFLAGS, LIBGCC2_INCLUDES, and ENQUIRE are
- non-empty, pass them on to the GCC make.
+ non-empty, pass them on to the GCC make.
(all-bootstrap): New rule that is like all-gcc, except it executes
the GCC bootstrap rule instead of the GCC all rule.
@@ -3956,7 +4282,7 @@ Mon Dec 4 12:38:15 1995 Ian Lance Taylor <ian@cygnus.com>
Thu Nov 30 14:45:25 1995 J.T. Conklin <jtc@rtl.cygnus.com>
* config/mt-v810 (CC_FOR_TARGET): Add -ansi flag. NEC compiler
- defaults to K&R mode, but doesn't have varargs.h, so we have to
+ defaults to K&R mode, but doesn't have varargs.h, so we have to
compile in ANSI mode.
Thu Nov 30 16:57:33 1995 Per Bothner <bothner@wombat.gnu.ai.mit.edu>
@@ -4068,15 +4394,15 @@ Mon Nov 13 12:34:20 1995 Stan Shebs <shebs@andros.cygnus.com>
* mpw-config.in: Configure grez if targeting Mac.
* config.sub: Accept pmac and pmac-mpw as names for PowerMacs,
- accept mpw and mac-mpw as names for m68k Macs, change macos7 to
- just macos.
+ accept mpw and mac-mpw as names for m68k Macs, change macos7 to
+ just macos.
* configure.in: Configure grez resource compiler if targeting Mac.
* Makefile.in (all-grez, install-grez): New targets.
Wed Nov 8 17:33:51 1995 Jason Merrill <jason@yorick.cygnus.com>
* configure: CXX defaults to gcc, not g++. If we find
- gcc in the path, set CC to gcc -O2.
+ gcc in the path, set CC to gcc -O2.
Tue Nov 7 15:45:17 1995 Ian Lance Taylor <ian@cygnus.com>
@@ -4126,8 +4452,8 @@ Wed Nov 1 12:23:20 1995 Ian Lance Taylor <ian@cygnus.com>
Tue Oct 31 17:52:39 1995 J.T. Conklin <jtc@slave.cygnus.com>
* configure.in (host_makefile_frag): Use m68k-sun-sunos* instead
- of m68k-sun-* when selecting mh-sun3 to avoid matching NetBSD/sun3
- systems.
+ of m68k-sun-* when selecting mh-sun3 to avoid matching NetBSD/sun3
+ systems.
Tue Oct 31 16:57:32 1995 Jim Wilson <wilson@chestnut.cygnus.com>
@@ -4405,7 +4731,7 @@ Thu Sep 7 20:03:41 1995 Ken Raeburn <raeburn@cygnus.com>
Fri Sep 1 08:06:58 1995 James G. Smith <jsmith@beauty.cygnus.com>
* config.sub: recognise mips64vr4300 and mips64vr4300el as valid
- targets.
+ targets.
Wed Aug 30 21:06:50 1995 Jason Molenda (crash@phydeaux.cygnus.com)
@@ -5399,8 +5725,8 @@ Tue Apr 26 18:11:33 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
Mon Apr 25 15:06:34 1994 Stan Shebs (shebs@andros.cygnus.com)
- * configure.in (*-*-lynxos*): Don't configure newlib for either
- native or cross Lynx.
+ * configure.in (*-*-lynxos*): Don't configure newlib for either
+ native or cross Lynx.
Sat Apr 16 11:58:16 1994 Doug Evans (dje@canuck.cygnus.com)
@@ -7145,7 +7471,7 @@ Thu Aug 27 13:04:42 1992 Brendan Kehoe (brendan@rtl.cygnus.com)
Mon Aug 24 14:05:14 1992 Ian Lance Taylor (ian@cygnus.com)
- * config.sub, configure.in: accept OSE68000 and OSE68k.
+ * config.sub, configure.in: accept OSE68000 and OSE68k.
* Makefile.in: don't create all directories for ``make install'';
let the subdirectories create the ones they need.
diff --git a/INSTALL/README b/INSTALL/README
index bdbe2f7b84a..27bd1738bca 100644
--- a/INSTALL/README
+++ b/INSTALL/README
@@ -1,8 +1,6 @@
This directory has been obsoleted for GCC snapshots and CVS access.
-Instead check out the toplevel "wwwdocs" module as a sibling of
-your "gcc" tree or read these files via the GCC web site
-<http://www.gnu.org/software/gcc/>.
+For releases the installation documentation is generated from
+gcc/doc/install.texi and copied into this directory.
-Copies of the relevant files will be copied into this directory
-for releases.
+To read this documentation, please point your HTML browser to "index.html".
diff --git a/MAINTAINERS b/MAINTAINERS
index b09d6194421..e54e08452fb 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -37,7 +37,7 @@ m68k port (?) Jeff Law law@redhat.com
m68k-motorola-sysv port Philippe De Muyter phdm@macqel.be
rs6000 port Geoff Keating geoffk@redhat.com
rs6000 port David Edelsohn dje@watson.ibm.com
-mips port Gavin Romig-Koch gavin@redhat.com
+mips port Eric Christopher echristo@redhat.com
ia64 port Jim Wilson wilson@redhat.com
i860 port Jason Eckhardt jle@redhat.com
i960 port Jim Wilson wilson@redhat.com
@@ -51,6 +51,8 @@ c4x port Michael Hayes m.hayes@elec.canterbury.ac.nz
arc port Richard Kenner kenner@nyu.edu
fr30 port Nick Clifton niclc@redhat.com
vax port Dave Anglin dave.anglin@nrc.ca
+s390 port Hartmut Penner hpenner@de.ibm.com
+s390 port Ulrich Weigand uweigand@de.ibm.com
fortran Richard Henderson rth@redhat.com
fortran Toon Moene toon@moene.indiv.nluug.nl
c++ Jason Merrill jason@redhat.com
@@ -60,10 +62,11 @@ chill Per Bothner per@bothner.com
java Per Bothner per@bothner.com
java Alexandre Petit-Bianco apbianco@redhat.com
mercury Fergus Henderson fjh@cs.mu.oz.au
+objective-c Stan Shebs shebs@apple.com
objective-c Ovidiu Predescu ovidiu@cup.hp.com
cpplib Dave Brolley brolley@redhat.com
cpplib Per Bothner per@bothner.com
-cpplib Zack Weinberg zack@wolery.cumb.org
+cpplib Zack Weinberg zackw@stanford.edu
cpplib Neil Booth neil@daikokuya.demon.co.uk
alias analysis John Carr jfc@mit.edu
loop unrolling Jim Wilson wilson@redhat.com
@@ -87,6 +90,8 @@ global opt framework Jeff Law law@redhat.com
jump.c David S. Miller davem@redhat.com
web pages Gerald Pfeifer pfeifer@dbai.tuwien.ac.at
C front end/ISO C99 Gavin Romig-Koch gavin@redhat.com
+C front end/ISO C99 Joseph Myers jsm28@cam.ac.uk
+C front end/ISO C99 Richard Henderson rth@redhat.com
config.sub/config.guess Ben Elliston bje@redhat.com
avr port Denis Chertykov denisc@overta.ru
Marek Michalkiewicz marekm@linux.org.pl
@@ -99,6 +104,7 @@ DJGPP DJ Delorie dj@delorie.com
libiberty DJ Delorie dj@redhat.com
build machinery (*.in) DJ Delorie dj@redhat.com
build machinery (*.in) Alexandre Oliva aoliva@redhat.com
+docs co-maintainer Gerald Pfeifer pfeifer@dbai.tuwien.ac.at
Note individuals who maintain parts of the compiler need approval to check
in changes outside of the parts of the compiler they maintain.
@@ -106,6 +112,7 @@ in changes outside of the parts of the compiler they maintain.
Write After Approval
Scott Bambrough scottb@netwinder.org
+Laurynas Biveinis lauras@softhome.net
Phil Blundell pb@futuretv.com
Hans Boehm hboehm@gcc.gnu.org
Andrew cagney cagney@redhat.com
@@ -143,19 +150,20 @@ Greg McGary gkm@gnu.org
Bryce McKinlay bryce@gcc.gnu.org
Toon Moene toon@moene.indiv.nluug.nl
Catherine Moore clm@redhat.com
-Joseph Myers jsm28@cam.ac.uk
Hans-Peter Nilsson hp@bitrange.com
Diego Novillo dnovillo@redhat.com
David O'Brien obrien@FreeBSD.org
Jeffrey D. Oldham oldham@codesourcery.com
+Rainer Orth ro@TechFak.Uni-Bielefeld.DE
Alexandre Petit-Bianco apbianco@redhat.com
Clinton Popetz cpopetz@cpopetz.com
Ken Raeburn raeburn@redhat.com
Rolf Rasmussen rolfwr@gcc.gnu.org
Gabriel Dos Reis dosreis@cmla.ens-cachan.fr
+Loren J. Rittle ljrittle@acm.org
Alex Samuel samuel@codesourcery.com
Bernd Schmidt bernds@redhat.com
-Andreas Schwab schwab@issan.informatik.uni-dortmund.de
+Andreas Schwab schwab@suse.de
Stan Shebs shebs@apple.com
Nathan Sidwell nathan@acm.org
Franz Sirl franz.sirl-kernel@lauterbach.com
@@ -169,4 +177,3 @@ John Wehle john@feith.com
Mark Wielaard mark@gcc.gnu.org
* Indicates folks we need to get Kerberos/ssh accounts ready so they
can write in the source tree
-
diff --git a/Makefile.in b/Makefile.in
index 24182f9bf5f..5170cbe92b9 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -169,7 +169,7 @@ OTHERS =
# This is set by the configure script to the list of directories which
# should be built using the target tools.
-TARGET_CONFIGDIRS = libiberty libgloss $(SPECIAL_LIBS) newlib libio librx libstdc++ libg++ winsup opcodes bsp libstub cygmon libf2c libchill libobjc
+TARGET_CONFIGDIRS = libiberty libgloss $(SPECIAL_LIBS) newlib librx winsup opcodes bsp libstub cygmon libf2c libchill libobjc
# Target libraries are put under this directory:
# Changed by configure to $(target_alias) if cross.
@@ -192,7 +192,7 @@ HOST_LIB_PATH = $$r/bfd:$$r/opcodes
# This is the list of directories that may be needed in RPATH_ENVVAR
# so that prorgams built for the target machine work.
-TARGET_LIB_PATH = $$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs:$$r/$(TARGET_SUBDIR)/libstdc++
+TARGET_LIB_PATH = $$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs:
# configure.in sets SET_LIB_PATH to this if --enable-shared was used.
# Some platforms don't like blank entries, so we remove duplicate,
@@ -220,6 +220,8 @@ FLAGS_FOR_TARGET =
CC_FOR_TARGET =
CHILL_FOR_TARGET =
CXX_FOR_TARGET =
+CXX_FOR_TARGET_FOR_RECURSIVE_MAKE =
+GCJ_FOR_TARGET =
# If GCC_FOR_TARGET is not overriden on the command line, then this
# variable is passed down to the gcc Makefile, where it is used to
@@ -230,6 +232,8 @@ GCC_FOR_TARGET = $$r/gcc/xgcc -B$$r/gcc/ $(FLAGS_FOR_TARGET)
AS_FOR_TARGET = ` \
if [ -f $$r/gas/as-new ] ; then \
echo $$r/gas/as-new ; \
+ elif [ -f $$r/gcc/xgcc ]; then \
+ $(CC_FOR_TARGET) -print-prog-name=as ; \
else \
if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
echo $(AS); \
@@ -241,6 +245,8 @@ AS_FOR_TARGET = ` \
LD_FOR_TARGET = ` \
if [ -f $$r/ld/ld-new ] ; then \
echo $$r/ld/ld-new ; \
+ elif [ -f $$r/gcc/xgcc ]; then \
+ $(CC_FOR_TARGET) -print-prog-name=ld ; \
else \
if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
echo $(LD); \
@@ -296,6 +302,8 @@ RANLIB_FOR_TARGET = ` \
NM_FOR_TARGET = ` \
if [ -f $$r/binutils/nm-new ] ; then \
echo $$r/binutils/nm-new ; \
+ elif [ -f $$r/gcc/xgcc ]; then \
+ $(CC_FOR_TARGET) -print-prog-name=nm ; \
else \
if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
echo $(NM); \
@@ -333,6 +341,7 @@ BASE_FLAGS_TO_PASS = \
"CHILLFLAGS=$(CHILLFLAGS)" \
"CHILL_FOR_TARGET=$(CHILL_FOR_TARGET)" \
"CHILL_LIB=$(CHILL_LIB)" \
+ "GCJ_FOR_TARGET=$(GCJ_FOR_TARGET)" \
"CXX_FOR_BUILD=$(CXX_FOR_BUILD)" \
"CXXFLAGS=$(CXXFLAGS)" \
"CXXFLAGS_FOR_TARGET=$(CXXFLAGS_FOR_TARGET)" \
@@ -386,6 +395,14 @@ BASE_FLAGS_TO_PASS = \
"gcc_version_trigger=$(gcc_version_trigger)" \
"target_alias=$(target_alias)"
+# For any flags above that may contain shell code that varies from one
+# target library to another. When doing recursive invocations of the
+# top-level Makefile, we don't want the outer make to evaluate them,
+# so we pass these variables down unchanged. They must not contain
+# single nor double quotes.
+RECURSE_FLAGS = \
+ CXX_FOR_TARGET='$(CXX_FOR_TARGET_FOR_RECURSIVE_MAKE)'
+
# Flags to pass down to most sub-makes, in which we're building with
# the host environment.
# If any variables are added here, they must be added to do-*, below.
@@ -462,6 +479,7 @@ EXTRA_GCC_FLAGS = \
"`echo 'LIBGCC2_DEBUG_CFLAGS=$(LIBGCC2_DEBUG_CFLAGS)' | sed -e s/.*=$$/XFOO=/`" \
"`echo 'LIBGCC2_INCLUDES=$(LIBGCC2_INCLUDES)' | sed -e s/.*=$$/XFOO=/`" \
"`echo 'ENQUIRE=$(ENQUIRE)' | sed -e s/.*=$$/XFOO=/`" \
+ "`echo 'STAGE1_CFLAGS=$(STAGE1_CFLAGS)' | sed -e s/.*=$$/XFOO=/`" \
"`echo 'BOOT_CFLAGS=$(BOOT_CFLAGS)' | sed -e s/.*=$$/XFOO=/`"
GCC_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS)
@@ -730,11 +748,8 @@ INSTALL_X11_MODULES = \
# This is a list of the targets for all of the modules which are compiled
# using $(TARGET_FLAGS_TO_PASS).
ALL_TARGET_MODULES = \
- all-target-libio \
- all-target-libstdc++ \
all-target-libstdc++-v3 \
all-target-librx \
- all-target-libg++ \
all-target-newlib \
all-target-libf2c \
all-target-libchill \
@@ -757,11 +772,8 @@ ALL_TARGET_MODULES = \
# This is a list of the configure targets for all of the modules which
# are compiled using the target tools.
CONFIGURE_TARGET_MODULES = \
- configure-target-libio \
- configure-target-libstdc++ \
configure-target-libstdc++-v3 \
configure-target-librx \
- configure-target-libg++ \
configure-target-newlib \
configure-target-libf2c \
configure-target-libchill \
@@ -784,10 +796,7 @@ CONFIGURE_TARGET_MODULES = \
# This is a list of the check targets for all of the modules which are
# compiled using $(TARGET_FLAGS_TO_PASS).
CHECK_TARGET_MODULES = \
- check-target-libio \
- check-target-libstdc++ \
check-target-libstdc++-v3 \
- check-target-libg++ \
check-target-newlib \
check-target-libf2c \
check-target-libchill \
@@ -804,10 +813,7 @@ CHECK_TARGET_MODULES = \
# This is a list of the install targets for all of the modules which are
# compiled using $(TARGET_FLAGS_TO_PASS).
INSTALL_TARGET_MODULES = \
- install-target-libio \
- install-target-libstdc++ \
install-target-libstdc++-v3 \
- install-target-libg++ \
install-target-newlib \
install-target-libf2c \
install-target-libchill \
@@ -894,11 +900,8 @@ CLEAN_MODULES = \
# All of the target modules that can be cleaned
CLEAN_TARGET_MODULES = \
- clean-target-libio \
- clean-target-libstdc++ \
clean-target-libstdc++-v3 \
clean-target-librx \
- clean-target-libg++ \
clean-target-newlib \
clean-target-libf2c \
clean-target-libchill \
@@ -1280,6 +1283,7 @@ $(CONFIGURE_TARGET_MODULES):
CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
CXX="$(CXX_FOR_TARGET)"; export CXX; \
CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
+ GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \
DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
LD="$(LD_FOR_TARGET)"; export LD; \
LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \
@@ -1355,7 +1359,8 @@ $(ALL_TARGET_MODULES):
r=`pwd`; export r; \
s=`cd $(srcdir); pwd`; export s; \
$(SET_LIB_PATH) \
- (cd $(TARGET_SUBDIR)/$${dir}; $(MAKE) $(TARGET_FLAGS_TO_PASS) all); \
+ (cd $(TARGET_SUBDIR)/$${dir}; \
+ $(MAKE) $(TARGET_FLAGS_TO_PASS) all); \
else \
true; \
fi
@@ -1369,7 +1374,8 @@ $(CHECK_TARGET_MODULES):
r=`pwd`; export r; \
s=`cd $(srcdir); pwd`; export s; \
$(SET_LIB_PATH) \
- (cd $(TARGET_SUBDIR)/$${dir};$(MAKE) $(TARGET_FLAGS_TO_PASS) check);\
+ (cd $(TARGET_SUBDIR)/$${dir}; \
+ $(MAKE) $(TARGET_FLAGS_TO_PASS) check);\
else \
true; \
fi
@@ -1484,7 +1490,7 @@ bootstrap bootstrap-lean bootstrap2 bootstrap2-lean bootstrap3 bootstrap3-lean b
s=`cd $(srcdir); pwd` ; export s; \
$(SET_LIB_PATH) \
echo "Building runtime libraries"; \
- $(MAKE) $(BASE_FLAGS_TO_PASS) all
+ $(MAKE) $(BASE_FLAGS_TO_PASS) $(RECURSE_FLAGS) all
.PHONY: cross
cross: all-texinfo all-bison all-byacc all-binutils all-gas all-ld
@@ -1497,7 +1503,8 @@ cross: all-texinfo all-bison all-byacc all-binutils all-gas all-ld
s=`cd $(srcdir); pwd` ; export s; \
$(SET_LIB_PATH) \
echo "Building runtime libraries"; \
- $(MAKE) $(BASE_FLAGS_TO_PASS) all LANGUAGES="c c++"
+ $(MAKE) $(BASE_FLAGS_TO_PASS) $(RECURSE_FLAGS) \
+ LANGUAGES="c c++" all
.PHONY: check-gcc
check-gcc:
@@ -1548,6 +1555,9 @@ install-dosrel: installdirs info
install-dosrel-fake:
+ALL_GCC = all-gcc
+ALL_GCC_C = $(ALL_GCC) all-target-newlib all-target-libgloss
+ALL_GCC_CXX = $(ALL_GCC_C) all-target-libstdc++-v3
# This is a list of inter-dependencies among modules.
all-apache:
@@ -1567,7 +1577,7 @@ all-bzip2:
all-cgen: all-libiberty
all-cvssrc:
configure-target-cygmon: $(ALL_GCC_C)
-all-target-cygmon: configure-target-cygmon all-target-libiberty all-target-libio all-target-libstub all-target-bsp
+all-target-cygmon: configure-target-cygmon all-target-libiberty all-target-libstub all-target-bsp
all-db:
all-dejagnu: all-tcl all-expect all-tk
all-diff: all-libiberty
@@ -1584,9 +1594,6 @@ all-flex: all-libiberty all-bison all-byacc
all-gas: all-libiberty all-opcodes all-bfd all-intl
all-gash: all-tcl
all-gawk:
-ALL_GCC = all-gcc
-ALL_GCC_C = $(ALL_GCC) all-target-newlib all-target-libgloss
-ALL_GCC_CXX = $(ALL_GCC_C) all-target-libstdc++ all-target-libstdc++-v3
all-gcc: all-bison all-byacc all-binutils all-gas all-ld all-zlib
all-bootstrap: all-libiberty all-texinfo all-bison all-byacc all-binutils all-gas all-ld all-zlib
GDB_TK = all-tk all-tcl all-itcl all-tix all-libgui
@@ -1594,7 +1601,7 @@ all-gdb: all-libiberty all-opcodes all-bfd all-mmalloc all-readline all-bison al
all-gettext:
all-gnuserv:
configure-target-gperf: $(ALL_GCC_C)
-all-target-gperf: configure-target-gperf all-target-libiberty all-target-libstdc++
+all-target-gperf: configure-target-gperf all-target-libiberty all-target-libstdc++-v3
all-gprof: all-libiberty all-bfd all-opcodes all-intl
all-grep: all-libiberty
all-grez: all-libiberty all-bfd all-opcodes
@@ -1608,13 +1615,8 @@ all-intl:
all-ispell: all-emacs19
all-itcl: all-tcl all-tk all-tcl8.1 all-tk8.1
all-ld: all-libiberty all-bfd all-opcodes all-bison all-byacc all-flex all-intl
-configure-target-libg++: $(ALL_GCC_CXX) configure-target-librx
-all-target-libg++: configure-target-libg++ all-target-libiberty all-target-librx
configure-target-libgloss: $(ALL_GCC)
all-target-libgloss: configure-target-libgloss configure-target-newlib
-configure-target-libio: $(ALL_GCC_C)
-all-target-libio: configure-target-libio all-gas all-ld all-gcc all-target-libiberty all-target-newlib
-check-target-libio: all-target-libstdc++
all-libgui: all-tcl all-tk all-tcl8.1 all-tk8.1 all-itcl
all-libiberty:
configure-target-libffi: $(ALL_GCC_C)
@@ -1623,8 +1625,6 @@ configure-target-libjava: $(ALL_GCC_CXX) configure-target-zlib configure-target-
all-target-libjava: configure-target-libjava all-fastjar all-target-zlib all-target-boehm-gc all-target-qthreads all-target-libffi
configure-target-librx: $(ALL_GCC_C)
all-target-librx: configure-target-librx
-configure-target-libstdc++: $(ALL_GCC_C)
-all-target-libstdc++: configure-target-libstdc++ all-target-libiberty all-target-libio
configure-target-libstdc++-v3: $(ALL_GCC_C)
all-target-libstdc++-v3: configure-target-libstdc++-v3 all-target-libiberty
configure-target-libstub: $(ALL_GCC_C)
@@ -1892,13 +1892,6 @@ gas+binutils.tar.bz2: $(DIST_SUPPORT) $(GASB_SUPPORT_DIRS) gas
MD5PROG="$(MD5PROG)" \
SUPPORT_FILES="$(GASB_SUPPORT_DIRS)"
-.PHONY: libg++.tar.bz2
-LIBGXX_SUPPORT_DIRS=include libstdc++ libio librx libiberty
-libg++.tar.bz2: $(DIST_SUPPORT) libg++
- $(MAKE) -f Makefile.in taz TOOL=libg++ \
- MD5PROG="$(MD5PROG)" \
- SUPPORT_FILES="$(LIBGXX_SUPPORT_DIRS)"
-
GNATS_SUPPORT_DIRS=include libiberty send-pr
gnats.tar.bz2: $(DIST_SUPPORT) $(GNATS_SUPPORT_DIRS) gnats
$(MAKE) -f Makefile.in taz TOOL=gnats \
diff --git a/README b/README
index 660ab17735f..3a495133bee 100644
--- a/README
+++ b/README
@@ -1,17 +1,17 @@
- README for GNU development tools
+This directory contains the GNU Compiler Collection (GCC).
-This directory contains various GNU compilers, assemblers, linkers,
-debuggers, etc., plus their support routines, definitions, and documentation.
+The GNU Compiler Collection is free software. See the file COPYING
+for copying permission. The manuals, and some of the runtime
+libraries, are under different terms; see the individual source files
+for details.
+The directory INSTALL contains copies of the installation information
+as HTML and plain text. The source of this information is
+gcc/doc/install.texi. The installation information includes details
+of what is included in the GCC sources and what files GCC installs.
-Check the INSTALL directory for detailed configuration and installation
-instructions.
+See the file gcc/doc/gcc.texi (together with other files that it
+includes) for usage and porting information. An online readable
+version of the manual is in the files gcc/doc/gcc.info*.
-
-Much of the code and documentation enclosed is copyright by
-the Free Software Foundation, Inc. See the file COPYING or
-COPYING.LIB in the various directories, for a description of the
-GNU General Public License terms under which you can copy the files.
-
-REPORTING BUGS: Again, see gdb/README, binutils/README, etc., for info
-on where and how to report problems.
+See http://gcc.gnu.org/bugs.html for how to report bugs usefully.
diff --git a/boehm-gc/ChangeLog b/boehm-gc/ChangeLog
index 2ae9240ed32..fe74f9cb2c6 100644
--- a/boehm-gc/ChangeLog
+++ b/boehm-gc/ChangeLog
@@ -1,3 +1,153 @@
+2002-02-20 Release Manager
+
+ * GCC 3.0.4 Released.
+
+2002-02-20 Release Manager
+
+ * GCC 3.0.4 Released.
+
+2001-12-20 Release Manager
+
+ * GCC 3.0.3 Released.
+
+2001-10-23 Release Manager
+
+ * GCC 3.0.2 Released.
+
+2001-09-26 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * mach_dep.c (GC_push_regs) [I386 && (SVR4 || SCO || SCO_ELF)
+ && __GNUC__ ]: Call GC_push_one in C to allow for PIC code.
+ Fixes PR bootstrap/4162.
+
+2001-09-26 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * solaris_threads.c (MAX_ORIG_STACK_SIZE) [I386]: Provide special
+ Solaris 2/Intel definition.
+ (GC_get_orig_stack_size): NL-terminate warning message.
+
+ * configure.in (i?86-*-solaris2.[89]*): Define
+ SOLARIS25_PROC_VDB_BUG_FIXED.
+ * gcconfig.h [I386 && SUNOS5]: Use it.
+ * configure: Regenerate.
+
+ * gcconfig.h [I386 && SUNOS5] (DATASTART): Use _etext.
+ (DATAEND): Define using _end.
+ (STACKBOTTOM): Define.
+
+2001-08-19 Release Manager
+
+ * GCC 3.0.1 Released.
+
+2001-08-19 Release Manager
+
+ * GCC 3.0.1 Released.
+
+2001-08-19 Release Manager
+
+ * GCC 3.0.1 Released.
+
+2001-07-03 Tom Tromey <tromey@redhat.com>
+
+ Fix for PR bootstrap/3281:
+ * aclocal.m4, configure, Makefile.in: Rebuilt.
+ * acinclude.m4: Set mkinstalldirs for in-tree build.
+
+20010617 Release Manager
+
+ * GCC 3.0 Released.
+
+2001-06-12 Tom Tromey <tromey@redhat.com>
+
+ * aclocal.m4, configure: Rebuilt.
+ * acinclude.m4: Find configure.host in srcdir.
+
+2001-06-07 Tom Tromey <tromey@redhat.com>
+
+ For PR bootstrap/3075:
+ * configure, aclocal.m4, Makefile.in: Rebuilt.
+ * configure.in: Don't call AC_CONFIG_AUX_DIR or
+ AC_CANONICAL_SYSTEM.
+ * acinclude.m4 (BOEHM_CONFIGURE): Call AC_CONFIG_AUX_DIR and
+ AC_CANONICAL_SYSTEM here.
+ * Makefile.am (CONFIG_STATUS_DEPENDENCIES): Use srcdir, not
+ boehm_gc_basedir.
+
+2001-05-01 Jeffrey Oldham <oldham@codesourcery.com>
+
+ * gc_priv.h (UNLOCK): Change type of GC_noop1 argument.
+ (GC_noop1): Change declaration to take one argument.
+
+2001-04-26 Alexandre Oliva <aoliva@redhat.com>
+
+ * configure.in: Obtain THREADS with `gcc -v'.
+ * configure: Rebuilt.
+
+2001-04-05 Hans Boehm <hans_boehm@hp.com>
+
+ * misc.c: Back out buggy changes to stack clearing code.
+ Reduce CLEAR_SIZE to 1/4 of original value to reduce time
+ spent clearing memory.
+
+2001-04-04 Hans Boehm <hans_boehm@hp.com>
+
+ * finalize.c:
+ - Accomodate finalization requests for static objects.
+ (Will be required by hash synchronization. May be needed
+ in some configurations now.)
+
+ * gc_priv.h:
+ - Define MIN_WORDS. All allocation requests are rounded
+ up to at least this size. Removes a subtle assumption that
+ Java objects have a 2 word header.
+
+ * gcconfig.h:
+ - Adjust Linux/IA64 configuration for non-ancient kernels.
+ (Necessary fix for IA64.)
+
+ * linux_threads.c:
+ - Fix syntax error in currently unused code. Will be needed
+ for Linux/PA-RISC.
+
+ * malloc.c:
+ - Handle MIN_WORDS.
+
+ * misc.c:
+ - Handle MIN_WORDS.
+ - Change stack cleaning code to typically clear about one tenth
+ the memory it used to in the threads configuration. Occasionally
+ still clear more. (This is really a fix for a long-standing
+ and fairly significant performance bug with threads.)
+
+ * os_dep.c:
+ - Fix the code for finding the beginning of the data segment under
+ Linux. I believe this is necessary for some IA64 Linux
+ distributions. It will also helo other platforms, though those
+ may additionally require a gcconfig.h adjustment. (This basically
+ works around the absence of a data_start or __data_start
+ definition in glibc.)
+
+ * test.c:
+ - Handle rounding due to MIN_WORDS.
+
+2001-03-22 Tom Tromey <tromey@redhat.com>
+
+ * Makefile.am (gctest_LDFLAGS): Use -shared-libgcc.
+
+2001-03-19 Tom Tromey <tromey@redhat.com>
+
+ * Makefile.in: Rebuilt.
+ * Makefile.am (gctest_LDFLAGS): new macro.
+
+2001-03-16 Tom Tromey <tromey@redhat.com>
+
+ * Makefile.in: Rebuilt.
+ * Makefile.am (TESTS_ENVIRONMENT): New macro.
+
+2001-01-23 Rod Stewart <stewart@lab43.org>
+
+ * gcconfig.h: Check for `__arm__', not `arm'.
+
2000-12-30 Bryce McKinlay <bryce@albatross.co.nz>
* configure.in: Rename THREADLIB to THREADLIBS.
diff --git a/boehm-gc/Makefile.am b/boehm-gc/Makefile.am
index 06d740b15af..bf8ed3d47a8 100644
--- a/boehm-gc/Makefile.am
+++ b/boehm-gc/Makefile.am
@@ -49,7 +49,8 @@ AM_CFLAGS = @BOEHM_GC_CFLAGS@
check_PROGRAMS = gctest
gctest_SOURCES = test.c
gctest_LDADD = ./libgcjgc.la $(THREADLIBS) $(EXTRA_TEST_LIBS)
-
+gctest_LDFLAGS = -shared-libgcc
+TESTS_ENVIRONMENT = LD_LIBRARY_PATH=../../$(MULTIBUILDTOP)gcc
TESTS = gctest
## FIXME: relies on internal code generated by automake.
@@ -112,7 +113,7 @@ AM_MAKEFLAGS = \
"RANLIB=$(RANLIB)" \
"DESTDIR=$(DESTDIR)"
-CONFIG_STATUS_DEPENDENCIES = $(boehm_gc_basedir)/configure.host
+CONFIG_STATUS_DEPENDENCIES = $(srcdir)/configure.host
# Multilib support.
.PHONY: all-multi mostlyclean-multi clean-multi distclean-multi \
diff --git a/boehm-gc/Makefile.in b/boehm-gc/Makefile.in
index ec91baa62df..f794685d213 100644
--- a/boehm-gc/Makefile.in
+++ b/boehm-gc/Makefile.in
@@ -91,6 +91,7 @@ THREADLIBS = @THREADLIBS@
VERSION = @VERSION@
addobjs = @addobjs@
boehm_gc_basedir = @boehm_gc_basedir@
+mkinstalldirs = @mkinstalldirs@
target_all = @target_all@
AUTOMAKE_OPTIONS = cygnus
@@ -102,9 +103,12 @@ MULTIDIRS =
MULTISUBDIR =
MULTIDO = true
MULTICLEAN = true
-@USE_LIBDIR_TRUE@toolexeclibdir = @USE_LIBDIR_TRUE@$(libdir)$(MULTISUBDIR)
-@USE_LIBDIR_FALSE@toolexeclibdir = @USE_LIBDIR_FALSE@$(toolexecdir)/lib$(MULTISUBDIR)
-@USE_LIBDIR_FALSE@toolexecdir = @USE_LIBDIR_FALSE@$(exec_prefix)/$(target_alias)
+@USE_LIBDIR_TRUE@toolexeclibdir = \
+@USE_LIBDIR_TRUE@$(libdir)$(MULTISUBDIR)
+@USE_LIBDIR_FALSE@toolexeclibdir = \
+@USE_LIBDIR_FALSE@$(toolexecdir)/lib$(MULTISUBDIR)
+@USE_LIBDIR_FALSE@toolexecdir = \
+@USE_LIBDIR_FALSE@$(exec_prefix)/$(target_alias)
toolexeclib_LTLIBRARIES = $(target_all)
EXTRA_LTLIBRARIES = libgcjgc.la
@@ -135,7 +139,8 @@ AM_CFLAGS = @BOEHM_GC_CFLAGS@
check_PROGRAMS = gctest
gctest_SOURCES = test.c
gctest_LDADD = ./libgcjgc.la $(THREADLIBS) $(EXTRA_TEST_LIBS)
-
+gctest_LDFLAGS = -shared-libgcc
+TESTS_ENVIRONMENT = LD_LIBRARY_PATH=../../$(MULTIBUILDTOP)gcc
TESTS = gctest
all_objs = @addobjs@ $(libgcjgc_la_OBJECTS)
@@ -188,11 +193,10 @@ AM_MAKEFLAGS = \
"DESTDIR=$(DESTDIR)"
-CONFIG_STATUS_DEPENDENCIES = $(boehm_gc_basedir)/configure.host
+CONFIG_STATUS_DEPENDENCIES = $(srcdir)/configure.host
MAKEOVERRIDES =
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs
CONFIG_CLEAN_FILES =
LTLIBRARIES = $(toolexeclib_LTLIBRARIES)
@@ -210,7 +214,6 @@ solaris_threads.lo stubborn.lo typd_mlc.lo
check_PROGRAMS = gctest$(EXEEXT)
gctest_OBJECTS = test.$(OBJEXT)
gctest_DEPENDENCIES = ./libgcjgc.la
-gctest_LDFLAGS =
CXXFLAGS = @CXXFLAGS@
CXXCOMPILE = $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
LTCXXCOMPILE = $(LIBTOOL) --mode=compile $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
@@ -406,7 +409,7 @@ distdir: $(DISTFILES)
@for file in $(DISTFILES); do \
if test -f $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
- cp -pr $$d/$$file $(distdir)/$$file; \
+ cp -pr $$/$$file $(distdir)/$$file; \
else \
test -f $(distdir)/$$file \
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
diff --git a/boehm-gc/acinclude.m4 b/boehm-gc/acinclude.m4
index fc1e0e80156..58a6415739e 100644
--- a/boehm-gc/acinclude.m4
+++ b/boehm-gc/acinclude.m4
@@ -28,8 +28,18 @@ else
boehm_gc_basedir="[$]{srcdir}/$1"
fi
AC_SUBST(boehm_gc_basedir)
+AC_CONFIG_AUX_DIR($boehm_gc_basedir/..)
+if :; then :; else
+ # This overrides the previous occurrence for automake, but not for
+ # autoconf, which is exactly what we want.
+ AC_CONFIG_AUX_DIR(..)
+fi
+
+AC_CANONICAL_SYSTEM
-AC_CANONICAL_HOST
+# This works around an automake problem.
+mkinstalldirs="`cd $ac_aux_dir && pwd`/mkinstalldirs"
+AC_SUBST(mkinstalldirs)
AM_INIT_AUTOMAKE(boehm-gc, 5.1, no-define)
@@ -134,7 +144,7 @@ if false; then
AC_EXEEXT
fi
-. [$]{boehm_gc_basedir}/configure.host
+. [$]{srcdir}/configure.host
case [$]{boehm_gc_basedir} in
/* | [A-Za-z]:[/\\]*) boehm_gc_flagbasedir=[$]{boehm_gc_basedir} ;;
diff --git a/boehm-gc/aclocal.m4 b/boehm-gc/aclocal.m4
index 15266a981da..3ff290e21ed 100644
--- a/boehm-gc/aclocal.m4
+++ b/boehm-gc/aclocal.m4
@@ -40,8 +40,18 @@ else
boehm_gc_basedir="[$]{srcdir}/$1"
fi
AC_SUBST(boehm_gc_basedir)
+AC_CONFIG_AUX_DIR($boehm_gc_basedir/..)
+if :; then :; else
+ # This overrides the previous occurrence for automake, but not for
+ # autoconf, which is exactly what we want.
+ AC_CONFIG_AUX_DIR(..)
+fi
+
+AC_CANONICAL_SYSTEM
-AC_CANONICAL_HOST
+# This works around an automake problem.
+mkinstalldirs="`cd $ac_aux_dir && pwd`/mkinstalldirs"
+AC_SUBST(mkinstalldirs)
AM_INIT_AUTOMAKE(boehm-gc, 5.1, no-define)
@@ -146,7 +156,7 @@ if false; then
AC_EXEEXT
fi
-. [$]{boehm_gc_basedir}/configure.host
+. [$]{srcdir}/configure.host
case [$]{boehm_gc_basedir} in
/* | [A-Za-z]:[/\\]*) boehm_gc_flagbasedir=[$]{boehm_gc_basedir} ;;
diff --git a/boehm-gc/configure b/boehm-gc/configure
index c11cf55f7f1..a530a4bba2d 100755
--- a/boehm-gc/configure
+++ b/boehm-gc/configure
@@ -37,8 +37,6 @@ ac_help="$ac_help
--enable-maintainer-mode enable make rules and dependencies not useful
(and sometimes confusing) to the casual installer"
ac_help="$ac_help
- --enable-threads=TYPE choose threading package"
-ac_help="$ac_help
--enable-java-gc=TYPE choose garbage collector [boehm]"
ac_help="$ac_help
--with-ecos enable runtime eCos target support"
@@ -553,116 +551,6 @@ fi
-ac_aux_dir=
-for ac_dir in .. $srcdir/..; do
- if test -f $ac_dir/install-sh; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/install-sh -c"
- break
- elif test -f $ac_dir/install.sh; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/install.sh -c"
- break
- fi
-done
-if test -z "$ac_aux_dir"; then
- { echo "configure: error: can not find install-sh or install.sh in .. $srcdir/.." 1>&2; exit 1; }
-fi
-ac_config_guess=$ac_aux_dir/config.guess
-ac_config_sub=$ac_aux_dir/config.sub
-ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
-
-
-
-# Do some error checking and defaulting for the host and target type.
-# The inputs are:
-# configure --host=HOST --target=TARGET --build=BUILD NONOPT
-#
-# The rules are:
-# 1. You are not allowed to specify --host, --target, and nonopt at the
-# same time.
-# 2. Host defaults to nonopt.
-# 3. If nonopt is not specified, then host defaults to the current host,
-# as determined by config.guess.
-# 4. Target and build default to nonopt.
-# 5. If nonopt is not specified, then target and build default to host.
-
-# The aliases save the names the user supplied, while $host etc.
-# will get canonicalized.
-case $host---$target---$nonopt in
-NONE---*---* | *---NONE---* | *---*---NONE) ;;
-*) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;;
-esac
-
-
-# Make sure we can run config.sub.
-if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
-else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
-fi
-
-echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:605: checking host system type" >&5
-
-host_alias=$host
-case "$host_alias" in
-NONE)
- case $nonopt in
- NONE)
- if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
- else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
- fi ;;
- *) host_alias=$nonopt ;;
- esac ;;
-esac
-
-host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
-host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
-host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
-host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
-echo "$ac_t""$host" 1>&6
-
-echo $ac_n "checking target system type""... $ac_c" 1>&6
-echo "configure:626: checking target system type" >&5
-
-target_alias=$target
-case "$target_alias" in
-NONE)
- case $nonopt in
- NONE) target_alias=$host_alias ;;
- *) target_alias=$nonopt ;;
- esac ;;
-esac
-
-target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias`
-target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
-target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
-target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
-echo "$ac_t""$target" 1>&6
-
-echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:644: checking build system type" >&5
-
-build_alias=$build
-case "$build_alias" in
-NONE)
- case $nonopt in
- NONE) build_alias=$host_alias ;;
- *) build_alias=$nonopt ;;
- esac ;;
-esac
-
-build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias`
-build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
-build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
-build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
-echo "$ac_t""$build" 1>&6
-
-test "$host_alias" != "$target_alias" &&
- test "$program_prefix$program_suffix$program_transform_name" = \
- NONENONEs,x,x, &&
- program_prefix=${target_alias}-
-
-
# Find a good install program. We prefer a C program (faster),
# so one script is as good as another. But avoid the broken or
# incompatible versions:
@@ -675,7 +563,7 @@ test "$host_alias" != "$target_alias" &&
# 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:679: checking for a BSD compatible install" >&5
+echo "configure:567: 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
@@ -728,7 +616,7 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
-echo "configure:732: checking whether build environment is sane" >&5
+echo "configure:620: checking whether build environment is sane" >&5
# Just in case
sleep 1
echo timestamp > conftestfile
@@ -785,7 +673,7 @@ test "$program_suffix" != NONE &&
test "$program_transform_name" = "" && program_transform_name="s,x,x,"
echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:789: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:677: 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
@@ -818,12 +706,12 @@ else
fi
echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
-echo "configure:822: checking for Cygwin environment" >&5
+echo "configure:710: checking for Cygwin environment" >&5
if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 827 "configure"
+#line 715 "configure"
#include "confdefs.h"
int main() {
@@ -834,7 +722,7 @@ int main() {
return __CYGWIN__;
; return 0; }
EOF
-if { (eval echo configure:838: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:726: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_cygwin=yes
else
@@ -851,19 +739,19 @@ echo "$ac_t""$ac_cv_cygwin" 1>&6
CYGWIN=
test "$ac_cv_cygwin" = yes && CYGWIN=yes
echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
-echo "configure:855: checking for mingw32 environment" >&5
+echo "configure:743: checking for mingw32 environment" >&5
if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 860 "configure"
+#line 748 "configure"
#include "confdefs.h"
int main() {
return __MINGW32__;
; return 0; }
EOF
-if { (eval echo configure:867: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:755: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_mingw32=yes
else
@@ -903,6 +791,69 @@ else
boehm_gc_basedir="${srcdir}/."
fi
+ac_aux_dir=
+for ac_dir in $boehm_gc_basedir/.. $srcdir/$boehm_gc_basedir/..; do
+ if test -f $ac_dir/install-sh; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install-sh -c"
+ break
+ elif test -f $ac_dir/install.sh; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install.sh -c"
+ break
+ fi
+done
+if test -z "$ac_aux_dir"; then
+ { echo "configure: error: can not find install-sh or install.sh in $boehm_gc_basedir/.. $srcdir/$boehm_gc_basedir/.." 1>&2; exit 1; }
+fi
+ac_config_guess=$ac_aux_dir/config.guess
+ac_config_sub=$ac_aux_dir/config.sub
+ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
+
+if :; then :; else
+ # This overrides the previous occurrence for automake, but not for
+ # autoconf, which is exactly what we want.
+ ac_aux_dir=
+for ac_dir in .. $srcdir/..; do
+ if test -f $ac_dir/install-sh; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install-sh -c"
+ break
+ elif test -f $ac_dir/install.sh; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install.sh -c"
+ break
+ fi
+done
+if test -z "$ac_aux_dir"; then
+ { echo "configure: error: can not find install-sh or install.sh in .. $srcdir/.." 1>&2; exit 1; }
+fi
+ac_config_guess=$ac_aux_dir/config.guess
+ac_config_sub=$ac_aux_dir/config.sub
+ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
+
+fi
+
+
+# Do some error checking and defaulting for the host and target type.
+# The inputs are:
+# configure --host=HOST --target=TARGET --build=BUILD NONOPT
+#
+# The rules are:
+# 1. You are not allowed to specify --host, --target, and nonopt at the
+# same time.
+# 2. Host defaults to nonopt.
+# 3. If nonopt is not specified, then host defaults to the current host,
+# as determined by config.guess.
+# 4. Target and build default to nonopt.
+# 5. If nonopt is not specified, then target and build default to host.
+
+# The aliases save the names the user supplied, while $host etc.
+# will get canonicalized.
+case $host---$target---$nonopt in
+NONE---*---* | *---NONE---* | *---*---NONE) ;;
+*) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;;
+esac
# Make sure we can run config.sub.
@@ -911,7 +862,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
fi
echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:915: checking host system type" >&5
+echo "configure:866: checking host system type" >&5
host_alias=$host
case "$host_alias" in
@@ -931,6 +882,51 @@ host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
echo "$ac_t""$host" 1>&6
+echo $ac_n "checking target system type""... $ac_c" 1>&6
+echo "configure:887: checking target system type" >&5
+
+target_alias=$target
+case "$target_alias" in
+NONE)
+ case $nonopt in
+ NONE) target_alias=$host_alias ;;
+ *) target_alias=$nonopt ;;
+ esac ;;
+esac
+
+target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias`
+target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$target" 1>&6
+
+echo $ac_n "checking build system type""... $ac_c" 1>&6
+echo "configure:905: checking build system type" >&5
+
+build_alias=$build
+case "$build_alias" in
+NONE)
+ case $nonopt in
+ NONE) build_alias=$host_alias ;;
+ *) build_alias=$nonopt ;;
+ esac ;;
+esac
+
+build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias`
+build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$build" 1>&6
+
+test "$host_alias" != "$target_alias" &&
+ test "$program_prefix$program_suffix$program_transform_name" = \
+ NONENONEs,x,x, &&
+ program_prefix=${target_alias}-
+
+
+# This works around an automake problem.
+mkinstalldirs="`cd $ac_aux_dir && pwd`/mkinstalldirs"
+
PACKAGE=boehm-gc
@@ -945,7 +941,7 @@ fi
missing_dir=`cd $ac_aux_dir && pwd`
echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
-echo "configure:949: checking for working aclocal" >&5
+echo "configure:945: checking for working aclocal" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh.
@@ -958,7 +954,7 @@ else
fi
echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
-echo "configure:962: checking for working autoconf" >&5
+echo "configure:958: checking for working autoconf" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh.
@@ -971,7 +967,7 @@ else
fi
echo $ac_n "checking for working automake""... $ac_c" 1>&6
-echo "configure:975: checking for working automake" >&5
+echo "configure:971: checking for working automake" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh.
@@ -984,7 +980,7 @@ else
fi
echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
-echo "configure:988: checking for working autoheader" >&5
+echo "configure:984: checking for working autoheader" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh.
@@ -997,7 +993,7 @@ else
fi
echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
-echo "configure:1001: checking for working makeinfo" >&5
+echo "configure:997: checking for working makeinfo" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh.
@@ -1023,7 +1019,7 @@ fi
# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1027: checking for $ac_word" >&5
+echo "configure:1023: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1053,7 +1049,7 @@ if test -z "$CC"; then
# Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1057: checking for $ac_word" >&5
+echo "configure:1053: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1102,7 +1098,7 @@ fi
fi
echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:1106: checking whether we are using GNU C" >&5
+echo "configure:1102: checking whether we are using GNU C" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1111,7 +1107,7 @@ else
yes;
#endif
EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1115: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1111: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
ac_cv_prog_gcc=yes
else
ac_cv_prog_gcc=no
@@ -1126,7 +1122,7 @@ if test $ac_cv_prog_gcc = yes; then
ac_save_CFLAGS="$CFLAGS"
CFLAGS=
echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:1130: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:1126: checking whether ${CC-cc} accepts -g" >&5
if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1163,7 +1159,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:1167: checking for $ac_word" >&5
+echo "configure:1163: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1196,7 +1192,7 @@ test -n "$CXX" || CXX="gcc"
test -z "$CXX" && { echo "configure: error: no acceptable c++ found in \$PATH" 1>&2; exit 1; }
echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6
-echo "configure:1200: checking whether we are using GNU C++" >&5
+echo "configure:1196: checking whether we are using GNU C++" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1205,7 +1201,7 @@ else
yes;
#endif
EOF
-if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:1209: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:1205: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
ac_cv_prog_gxx=yes
else
ac_cv_prog_gxx=no
@@ -1220,7 +1216,7 @@ if test $ac_cv_prog_gxx = yes; then
ac_save_CXXFLAGS="$CXXFLAGS"
CXXFLAGS=
echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6
-echo "configure:1224: checking whether ${CXX-g++} accepts -g" >&5
+echo "configure:1220: checking whether ${CXX-g++} accepts -g" >&5
if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1253,7 +1249,7 @@ fi
# NEWLIB_CONFIGURE, which doesn't work because that means that it will
# be run before AC_CANONICAL_HOST.
echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:1257: checking build system type" >&5
+echo "configure:1253: checking build system type" >&5
build_alias=$build
case "$build_alias" in
@@ -1274,7 +1270,7 @@ echo "$ac_t""$build" 1>&6
# Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args.
set dummy ${ac_tool_prefix}as; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1278: checking for $ac_word" >&5
+echo "configure:1274: 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
@@ -1306,7 +1302,7 @@ fi
# Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
set dummy ${ac_tool_prefix}ar; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1310: checking for $ac_word" >&5
+echo "configure:1306: 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
@@ -1338,7 +1334,7 @@ fi
# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
set dummy ${ac_tool_prefix}ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1342: checking for $ac_word" >&5
+echo "configure:1338: 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
@@ -1370,7 +1366,7 @@ if test -n "$ac_tool_prefix"; 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:1374: checking for $ac_word" >&5
+echo "configure:1370: 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
@@ -1415,7 +1411,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:1419: checking for a BSD compatible install" >&5
+echo "configure:1415: 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
@@ -1469,7 +1465,7 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
-echo "configure:1473: checking whether to enable maintainer-specific portions of Makefiles" >&5
+echo "configure:1469: 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"
@@ -1503,7 +1499,7 @@ if false; then
echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:1507: checking for executable suffix" >&5
+echo "configure:1503: checking for executable suffix" >&5
if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1513,7 +1509,7 @@ else
rm -f conftest*
echo 'int main () { return 0; }' > conftest.$ac_ext
ac_cv_exeext=
- if { (eval echo configure:1517: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+ if { (eval echo configure:1513: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
for file in conftest.*; do
case $file in
*.c | *.o | *.obj) ;;
@@ -1535,7 +1531,7 @@ ac_exeext=$EXEEXT
fi
-. ${boehm_gc_basedir}/configure.host
+. ${srcdir}/configure.host
case ${boehm_gc_basedir} in
/* | A-Za-z:/\\*) boehm_gc_flagbasedir=${boehm_gc_basedir} ;;
@@ -1559,7 +1555,7 @@ BOEHM_GC_CFLAGS=${boehm_gc_cflags}
if test "${enable_shared+set}" = set; then
enableval="$enable_shared"
p=${PACKAGE-default}
-case "$enableval" in
+case $enableval in
yes) enable_shared=yes ;;
no) enable_shared=no ;;
*)
@@ -1582,7 +1578,7 @@ fi
if test "${enable_static+set}" = set; then
enableval="$enable_static"
p=${PACKAGE-default}
-case "$enableval" in
+case $enableval in
yes) enable_static=yes ;;
no) enable_static=no ;;
*)
@@ -1605,7 +1601,7 @@ fi
if test "${enable_fast_install+set}" = set; then
enableval="$enable_fast_install"
p=${PACKAGE-default}
-case "$enableval" in
+case $enableval in
yes) enable_fast_install=yes ;;
no) enable_fast_install=no ;;
*)
@@ -1633,10 +1629,10 @@ else
fi
ac_prog=ld
-if test "$ac_cv_prog_gcc" = yes; then
+if test "$GCC" = yes; then
# Check if gcc -print-prog-name=ld gives a path.
echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
-echo "configure:1640: checking for ld used by GCC" >&5
+echo "configure:1636: checking for ld used by GCC" >&5
case $host in
*-*-mingw*)
# gcc leaves a trailing carriage return which upsets mingw
@@ -1644,7 +1640,7 @@ echo "configure:1640: checking for ld used by GCC" >&5
*)
ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
esac
- case "$ac_prog" in
+ case $ac_prog in
# Accept absolute paths.
[\\/]* | [A-Za-z]:[\\/]*)
re_direlt='/[^/][^/]*/\.\./'
@@ -1666,12 +1662,12 @@ echo "configure:1640: checking for ld used by GCC" >&5
esac
elif test "$with_gnu_ld" = yes; then
echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
-echo "configure:1670: checking for GNU ld" >&5
+echo "configure:1666: checking for GNU ld" >&5
else
echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
-echo "configure:1673: checking for non-GNU ld" >&5
+echo "configure:1669: checking for non-GNU ld" >&5
fi
-if eval "test \"`echo '$''{'ac_cv_path_LD'+set}'`\" = set"; then
+if eval "test \"`echo '$''{'lt_cv_path_LD'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test -z "$LD"; then
@@ -1679,11 +1675,11 @@ else
for ac_dir in $PATH; do
test -z "$ac_dir" && ac_dir=.
if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
- ac_cv_path_LD="$ac_dir/$ac_prog"
+ lt_cv_path_LD="$ac_dir/$ac_prog"
# Check to see if the program is GNU ld. I'd rather use --version,
# but apparently some GNU ld's only accept -v.
# Break only if it was the GNU/non-GNU ld that we prefer.
- if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
+ if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
test "$with_gnu_ld" != no && break
else
test "$with_gnu_ld" != yes && break
@@ -1692,11 +1688,11 @@ else
done
IFS="$ac_save_ifs"
else
- ac_cv_path_LD="$LD" # Let the user override the test with a path.
+ lt_cv_path_LD="$LD" # Let the user override the test with a path.
fi
fi
-LD="$ac_cv_path_LD"
+LD="$lt_cv_path_LD"
if test -n "$LD"; then
echo "$ac_t""$LD" 1>&6
else
@@ -1704,24 +1700,24 @@ else
fi
test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
-echo "configure:1708: checking if the linker ($LD) is GNU ld" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_gnu_ld'+set}'`\" = set"; then
+echo "configure:1704: checking if the linker ($LD) is GNU ld" >&5
+if eval "test \"`echo '$''{'lt_cv_prog_gnu_ld'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# I'd rather use --version here, but apparently some GNU ld's only accept -v.
if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
- ac_cv_prog_gnu_ld=yes
+ lt_cv_prog_gnu_ld=yes
else
- ac_cv_prog_gnu_ld=no
+ lt_cv_prog_gnu_ld=no
fi
fi
-echo "$ac_t""$ac_cv_prog_gnu_ld" 1>&6
-with_gnu_ld=$ac_cv_prog_gnu_ld
+echo "$ac_t""$lt_cv_prog_gnu_ld" 1>&6
+with_gnu_ld=$lt_cv_prog_gnu_ld
echo $ac_n "checking for $LD option to reload object files""... $ac_c" 1>&6
-echo "configure:1725: checking for $LD option to reload object files" >&5
+echo "configure:1721: checking for $LD option to reload object files" >&5
if eval "test \"`echo '$''{'lt_cv_ld_reload_flag'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1733,13 +1729,13 @@ reload_flag=$lt_cv_ld_reload_flag
test -n "$reload_flag" && reload_flag=" $reload_flag"
echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
-echo "configure:1737: checking for BSD-compatible nm" >&5
-if eval "test \"`echo '$''{'ac_cv_path_NM'+set}'`\" = set"; then
+echo "configure:1733: checking for BSD-compatible nm" >&5
+if eval "test \"`echo '$''{'lt_cv_path_NM'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test -n "$NM"; then
# Let the user override the test.
- ac_cv_path_NM="$NM"
+ lt_cv_path_NM="$NM"
else
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
@@ -1751,27 +1747,27 @@ else
# nm: unknown option "B" ignored
# Tru64's nm complains that /dev/null is an invalid object file
if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then
- ac_cv_path_NM="$tmp_nm -B"
+ lt_cv_path_NM="$tmp_nm -B"
break
elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
- ac_cv_path_NM="$tmp_nm -p"
+ lt_cv_path_NM="$tmp_nm -p"
break
else
- ac_cv_path_NM=${ac_cv_path_NM="$tmp_nm"} # keep the first match, but
+ lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
continue # so that we can try to find one that supports BSD flags
fi
fi
done
IFS="$ac_save_ifs"
- test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
+ test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
fi
fi
-NM="$ac_cv_path_NM"
+NM="$lt_cv_path_NM"
echo "$ac_t""$NM" 1>&6
echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:1775: checking whether ln -s works" >&5
+echo "configure:1771: checking whether ln -s works" >&5
if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1792,7 +1788,7 @@ else
fi
echo $ac_n "checking how to recognise dependant libraries""... $ac_c" 1>&6
-echo "configure:1796: checking how to recognise dependant libraries" >&5
+echo "configure:1792: checking how to recognise dependant libraries" >&5
if eval "test \"`echo '$''{'lt_cv_deplibs_check_method'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1810,8 +1806,8 @@ lt_cv_deplibs_check_method='unknown'
# If you have `file' or equivalent on your system and you're not sure
# whether `pass_all' will *always* work, you probably want this one.
-case "$host_os" in
-aix4*)
+case $host_os in
+aix*)
lt_cv_deplibs_check_method=pass_all
;;
@@ -1820,8 +1816,8 @@ beos*)
;;
bsdi4*)
- lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
- lt_cv_file_magic_cmd='/usr/bin/file -L'
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
+ lt_cv_file_magic_cmd='/usr/bin/file -L'
lt_cv_file_magic_test_file=/shlib/libc.so
;;
@@ -1830,14 +1826,27 @@ cygwin* | mingw* |pw32*)
lt_cv_file_magic_cmd='$OBJDUMP -f'
;;
+darwin* | rhapsody*)
+ lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library'
+ lt_cv_file_magic_cmd='/usr/bin/file -L'
+ case "$host_os" in
+ rhapsody* | darwin1.012)
+ lt_cv_file_magic_test_file='/System/Library/Frameworks/System.framework/System'
+ ;;
+ *) # Darwin 1.3 on
+ lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib'
+ ;;
+ esac
+ ;;
+
freebsd* )
if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
- case "$host_cpu" in
+ case $host_cpu in
i*86 )
# Not sure whether the presence of OpenBSD here was a mistake.
# Let's accept both of them until this is cleared up.
- lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library'
- lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library'
+ lt_cv_file_magic_cmd=/usr/bin/file
lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
;;
esac
@@ -1850,29 +1859,28 @@ gnu*)
lt_cv_deplibs_check_method=pass_all
;;
-hpux10.20*)
- # TODO: Does this work for hpux-11 too?
- lt_cv_deplibs_check_method='file_magic (s0-90-90-9|PA-RISC0-9.0-9) shared library'
+hpux10.20*|hpux11*)
+ lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library'
lt_cv_file_magic_cmd=/usr/bin/file
lt_cv_file_magic_test_file=/usr/lib/libc.sl
;;
irix5* | irix6*)
- case "$host_os" in
+ case $host_os in
irix5*)
# this will be overridden with pass_all, but let us keep it just in case
lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1"
;;
*)
- case "$LD" in
+ case $LD in
*-32|*"-32 ") libmagic=32-bit;;
*-n32|*"-n32 ") libmagic=N32;;
*-64|*"-64 ") libmagic=64-bit;;
*) libmagic=never-match;;
esac
# this will be overridden with pass_all, but let us keep it just in case
- lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1"
- ;;
+ lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1"
+ ;;
esac
lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*`
lt_cv_deplibs_check_method=pass_all
@@ -1880,25 +1888,30 @@ irix5* | irix6*)
# This must be Linux ELF.
linux-gnu*)
- case "$host_cpu" in
- alpha* | i*86 | powerpc* | sparc* | ia64* )
+ case $host_cpu in
+ alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* )
lt_cv_deplibs_check_method=pass_all ;;
*)
# glibc up to 2.1.1 does not perform some relocations on ARM
- lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;;
- esac
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;;
+ esac
lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
;;
netbsd*)
- if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then :
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
else
- lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object'
- lt_cv_file_magic_cmd='/usr/bin/file -L'
- lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so$'
fi
;;
+newsos6)
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=/usr/lib/libnls.so
+ ;;
+
osf3* | osf4* | osf5*)
# this will be overridden with pass_all, but let us keep it just in case
lt_cv_deplibs_check_method='file_magic COFF format alpha shared library'
@@ -1915,14 +1928,18 @@ solaris*)
lt_cv_file_magic_test_file=/lib/libc.so
;;
+sysv5uw[78]* | sysv4*uw2*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
- case "$host_vendor" in
+ case $host_vendor in
ncr)
lt_cv_deplibs_check_method=pass_all
;;
motorola)
- lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
- lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
;;
esac
;;
@@ -1935,13 +1952,13 @@ file_magic_cmd=$lt_cv_file_magic_cmd
deplibs_check_method=$lt_cv_deplibs_check_method
echo $ac_n "checking for object suffix""... $ac_c" 1>&6
-echo "configure:1939: checking for object suffix" >&5
+echo "configure:1956: checking for object suffix" >&5
if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
rm -f conftest*
echo 'int i = 1;' > conftest.$ac_ext
-if { (eval echo configure:1945: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1962: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
for ac_file in conftest.*; do
case $ac_file in
*.c) ;;
@@ -1961,15 +1978,15 @@ ac_objext=$ac_cv_objext
# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
# Only perform the check for file, if the check method requires it
-case "$deplibs_check_method" in
+case $deplibs_check_method in
file_magic*)
if test "$file_magic_cmd" = '$MAGIC_CMD'; then
echo $ac_n "checking for ${ac_tool_prefix}file""... $ac_c" 1>&6
-echo "configure:1969: checking for ${ac_tool_prefix}file" >&5
+echo "configure:1986: checking for ${ac_tool_prefix}file" >&5
if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
- case "$MAGIC_CMD" in
+ case $MAGIC_CMD in
/*)
lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
;;
@@ -1985,7 +2002,7 @@ else
if test -f $ac_dir/${ac_tool_prefix}file; then
lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file"
if test -n "$file_magic_test_file"; then
- case "$deplibs_check_method" in
+ case $deplibs_check_method in
"file_magic "*)
file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
@@ -2027,11 +2044,11 @@ fi
if test -z "$lt_cv_path_MAGIC_CMD"; then
if test -n "$ac_tool_prefix"; then
echo $ac_n "checking for file""... $ac_c" 1>&6
-echo "configure:2031: checking for file" >&5
+echo "configure:2048: checking for file" >&5
if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
- case "$MAGIC_CMD" in
+ case $MAGIC_CMD in
/*)
lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
;;
@@ -2047,7 +2064,7 @@ else
if test -f $ac_dir/file; then
lt_cv_path_MAGIC_CMD="$ac_dir/file"
if test -n "$file_magic_test_file"; then
- case "$deplibs_check_method" in
+ case $deplibs_check_method in
"file_magic "*)
file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
@@ -2098,7 +2115,7 @@ esac
# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
set dummy ${ac_tool_prefix}ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2102: checking for $ac_word" >&5
+echo "configure:2119: 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
@@ -2130,7 +2147,7 @@ if test -n "$ac_tool_prefix"; 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:2134: checking for $ac_word" >&5
+echo "configure:2151: 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
@@ -2165,7 +2182,7 @@ fi
# Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
set dummy ${ac_tool_prefix}strip; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2169: checking for $ac_word" >&5
+echo "configure:2186: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2197,7 +2214,7 @@ if test -n "$ac_tool_prefix"; then
# Extract the first word of "strip", so it can be a program name with args.
set dummy strip; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2201: checking for $ac_word" >&5
+echo "configure:2218: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2235,8 +2252,8 @@ libtool_flags="--cache-file=$cache_file"
test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
-test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
-test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
+test "$GCC" = yes && libtool_flags="$libtool_flags --with-gcc"
+test "$lt_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
# Check whether --enable-libtool-lock or --disable-libtool-lock was given.
@@ -2261,12 +2278,12 @@ test x"$pic_mode" = xno && libtool_flags="$libtool_flags --prefer-non-pic"
# Some flags need to be propagated to the compiler or linker for good
# libtool support.
-case "$host" in
+case $host in
*-*-irix6*)
# Find out which ABI we are using.
- echo '#line 2268 "configure"' > conftest.$ac_ext
- if { (eval echo configure:2269: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- case "`/usr/bin/file conftest.o`" in
+ echo '#line 2285 "configure"' > conftest.$ac_ext
+ if { (eval echo configure:2286: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ case `/usr/bin/file conftest.$ac_objext` in
*32-bit*)
LD="${LD-ld} -32"
;;
@@ -2286,7 +2303,7 @@ case "$host" in
SAVE_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -belf"
echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6
-echo "configure:2290: checking whether the C compiler needs -belf" >&5
+echo "configure:2307: checking whether the C compiler needs -belf" >&5
if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2299,14 +2316,14 @@ ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$a
cross_compiling=$ac_cv_prog_cc_cross
cat > conftest.$ac_ext <<EOF
-#line 2303 "configure"
+#line 2320 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
-if { (eval echo configure:2310: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2327: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
lt_cv_cc_needs_belf=yes
else
@@ -2336,7 +2353,7 @@ echo "$ac_t""$lt_cv_cc_needs_belf" 1>&6
esac
echo $ac_n "checking how to run the C++ preprocessor""... $ac_c" 1>&6
-echo "configure:2340: checking how to run the C++ preprocessor" >&5
+echo "configure:2357: checking how to run the C++ preprocessor" >&5
if test -z "$CXXCPP"; then
if eval "test \"`echo '$''{'ac_cv_prog_CXXCPP'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -2349,12 +2366,12 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes
cross_compiling=$ac_cv_prog_cxx_cross
CXXCPP="${CXX-g++} -E"
cat > conftest.$ac_ext <<EOF
-#line 2353 "configure"
+#line 2370 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2358: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2375: \"$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
:
@@ -2461,12 +2478,11 @@ exec 5>>./config.log
-
LIBTOOL_DEPS=$LIBTOOL_DEPS" $ac_aux_dir/ltcf-cxx.sh"
lt_save_CC="$CC"
lt_save_CFLAGS="$CFLAGS"
AR="$AR" LTCC="$CC" CC="$CXX" CXX="$CXX" CFLAGS="$CXXFLAGS" CPPFLAGS="$CPPFLAGS" \
-MAGIC_CMD="$MAGIC_CMD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
+MAGIC_CMD="$MAGIC_CMD" LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" STRIP="$STRIP" \
AS="$AS" DLLTOOL="$DLLTOOL" OBJDUMP="$OBJDUMP" \
objext="$OBJEXT" exeext="$EXEEXT" reload_flag="$reload_flag" \
@@ -2482,7 +2498,6 @@ CFLAGS="$lt_save_CFLAGS"
# clobbered by the next message.
exec 5>>./config.log
-
@@ -2503,7 +2518,7 @@ fi
echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
-echo "configure:2507: checking whether to enable maintainer-specific portions of Makefiles" >&5
+echo "configure:2522: 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"
@@ -2532,7 +2547,7 @@ if test "x" = "y"; then
echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:2536: checking for executable suffix" >&5
+echo "configure:2551: checking for executable suffix" >&5
if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2542,7 +2557,7 @@ else
rm -f conftest*
echo 'int main () { return 0; }' > conftest.$ac_ext
ac_cv_exeext=
- if { (eval echo configure:2546: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+ if { (eval echo configure:2561: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
for file in conftest.*; do
case $file in
*.c | *.o | *.obj) ;;
@@ -2564,49 +2579,10 @@ ac_exeext=$EXEEXT
fi
-echo $ac_n "checking for threads package to use""... $ac_c" 1>&6
-echo "configure:2569: checking for threads package to use" >&5
-# Check whether --enable-threads or --disable-threads was given.
-if test "${enable_threads+set}" = set; then
- enableval="$enable_threads"
- THREADS=$enableval
-else
- THREADS=no
-fi
-
-
-if test "$THREADS" = yes; then
- case "$host" in
- *-*-vxworks*)
- THREADS=vxworks
- ;;
- *-*-linux*)
- # FIXME: this isn't correct in all cases.
- THREADS=posix
- ;;
- *-*-win*)
- THREADS=win32
- ;;
- *-*-irix[1-5].*)
- # No built-in threads library on IRIX 5.* and older.
- THREADS=none
- ;;
- *-*-irix*)
- # FIXME: for now, choose POSIX, because we implement that.
- # Later, choose irix threads.
- THREADS=posix
- ;;
- *-*-solaris*)
- # FIXME: for now, choose POSIX, because we implement that.
- # Later, choose solaris threads.
- THREADS=posix
- ;;
- *)
- # For now.
- THREADS=none
- ;;
- esac
-fi
+echo $ac_n "checking for thread model used by GCC""... $ac_c" 1>&6
+echo "configure:2584: checking for thread model used by GCC" >&5
+THREADS=`$CC -v 2>&1 | sed -n 's/^Thread model: //p'`
+echo "$ac_t""$THREADS" 1>&6
INCLUDES=
THREADLIBS=
@@ -2653,11 +2629,10 @@ EOF
{ echo "configure: error: $THREADS is an unknown thread package" 1>&2; exit 1; }
;;
esac
-echo "$ac_t""$THREADS" 1>&6
echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
-echo "configure:2661: checking for dlopen in -ldl" >&5
+echo "configure:2636: checking for dlopen in -ldl" >&5
ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -2665,7 +2640,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2669 "configure"
+#line 2644 "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
@@ -2676,7 +2651,7 @@ int main() {
dlopen()
; return 0; }
EOF
-if { (eval echo configure:2680: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2655: \"$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
@@ -2748,6 +2723,12 @@ case "$host" in
# alpha*-*-*)
# machdep="alpha_mach_dep.lo"
# ;;
+ i?86-*-solaris2.[89]*)
+ cat >> confdefs.h <<\EOF
+#define SOLARIS25_PROC_VDB_BUG_FIXED 1
+EOF
+
+ ;;
mipstx39-*-elf*)
machdep="mips_ultrix_mach_dep.lo"
cat >> confdefs.h <<\EOF
@@ -3000,6 +2981,7 @@ s%@includedir@%$includedir%g
s%@oldincludedir@%$oldincludedir%g
s%@infodir@%$infodir%g
s%@mandir@%$mandir%g
+s%@boehm_gc_basedir@%$boehm_gc_basedir%g
s%@host@%$host%g
s%@host_alias@%$host_alias%g
s%@host_cpu@%$host_cpu%g
@@ -3015,7 +2997,7 @@ s%@build_alias@%$build_alias%g
s%@build_cpu@%$build_cpu%g
s%@build_vendor@%$build_vendor%g
s%@build_os@%$build_os%g
-s%@boehm_gc_basedir@%$boehm_gc_basedir%g
+s%@mkinstalldirs@%$mkinstalldirs%g
s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
s%@INSTALL_DATA@%$INSTALL_DATA%g
diff --git a/boehm-gc/configure.in b/boehm-gc/configure.in
index 6a75b192b70..589481cfd56 100644
--- a/boehm-gc/configure.in
+++ b/boehm-gc/configure.in
@@ -2,11 +2,6 @@ dnl Process this file with autoconf to produce configure.
AC_INIT(gc_mark.h)
-dnl Can't be done in BOEHM_CONFIGURE because that confuses automake.
-AC_CONFIG_AUX_DIR(..)
-
-AC_CANONICAL_SYSTEM
-
BOEHM_CONFIGURE(.)
AM_PROG_LIBTOOL
@@ -26,44 +21,9 @@ if test "x" = "y"; then
AC_EXEEXT
fi
-AC_MSG_CHECKING([for threads package to use])
-AC_ARG_ENABLE(threads, [ --enable-threads=TYPE choose threading package],
- THREADS=$enableval,
- dnl FIXME: figure out native threads to use here.
- THREADS=no)
-
-if test "$THREADS" = yes; then
- case "$host" in
- *-*-vxworks*)
- THREADS=vxworks
- ;;
- *-*-linux*)
- # FIXME: this isn't correct in all cases.
- THREADS=posix
- ;;
- *-*-win*)
- THREADS=win32
- ;;
- *-*-irix[[1-5]].*)
- # No built-in threads library on IRIX 5.* and older.
- THREADS=none
- ;;
- *-*-irix*)
- # FIXME: for now, choose POSIX, because we implement that.
- # Later, choose irix threads.
- THREADS=posix
- ;;
- *-*-solaris*)
- # FIXME: for now, choose POSIX, because we implement that.
- # Later, choose solaris threads.
- THREADS=posix
- ;;
- *)
- # For now.
- THREADS=none
- ;;
- esac
-fi
+AC_MSG_CHECKING([for thread model used by GCC])
+THREADS=`$CC -v 2>&1 | sed -n 's/^Thread model: //p'`
+AC_MSG_RESULT([$THREADS])
INCLUDES=
THREADLIBS=
@@ -95,7 +55,6 @@ case "$THREADS" in
AC_MSG_ERROR($THREADS is an unknown thread package)
;;
esac
-AC_MSG_RESULT($THREADS)
AC_SUBST(THREADLIBS)
AC_CHECK_LIB(dl, dlopen, EXTRA_TEST_LIBS="$EXTRA_TEST_LIBS -ldl")
@@ -146,6 +105,9 @@ case "$host" in
# alpha*-*-*)
# machdep="alpha_mach_dep.lo"
# ;;
+ i?86-*-solaris2.[[89]]*)
+ AC_DEFINE(SOLARIS25_PROC_VDB_BUG_FIXED)
+ ;;
mipstx39-*-elf*)
machdep="mips_ultrix_mach_dep.lo"
AC_DEFINE(STACKBASE, __stackbase)
diff --git a/boehm-gc/finalize.c b/boehm-gc/finalize.c
index e70a9ff1e99..7ff6798cfa5 100644
--- a/boehm-gc/finalize.c
+++ b/boehm-gc/finalize.c
@@ -324,6 +324,7 @@ finalization_mark_proc * mp;
struct finalizable_object * curr_fo, * prev_fo;
int index;
struct finalizable_object *new_fo;
+ hdr *hhdr;
DCL_LOCK_STATE;
# ifdef THREADS
@@ -402,6 +403,19 @@ finalization_mark_proc * mp;
# endif
return;
}
+ GET_HDR(base, hhdr);
+ if (0 == hhdr) {
+ /* We won't collect it, hence finalizer wouldn't be run. */
+ /* This is changed for gcj, but it will be in version 6.0 of the */
+ /* standard collector distribution. It costs virtually nothing */
+ /* here, but it's expensive to check in the hash synchronization */
+ /* code, where it matters. -HB */
+# ifdef THREADS
+ UNLOCK();
+ ENABLE_SIGNALS();
+# endif
+ return;
+ }
# ifdef THREADS
new_fo = (struct finalizable_object *)
GC_generic_malloc_inner(sizeof(struct finalizable_object),NORMAL);
@@ -413,7 +427,7 @@ finalization_mark_proc * mp;
new_fo -> fo_hidden_base = (word)HIDE_POINTER(base);
new_fo -> fo_fn = fn;
new_fo -> fo_client_data = (ptr_t)cd;
- new_fo -> fo_object_size = GC_size(base);
+ new_fo -> fo_object_size = hhdr -> hb_sz;
new_fo -> fo_mark_proc = mp;
fo_set_next(new_fo, fo_head[index]);
GC_fo_entries++;
diff --git a/boehm-gc/gc_priv.h b/boehm-gc/gc_priv.h
index c0fa5d6e93c..9623ef7bd72 100644
--- a/boehm-gc/gc_priv.h
+++ b/boehm-gc/gc_priv.h
@@ -628,7 +628,7 @@ void GC_print_callers (/* struct callinfo info[NFRAMES] */);
# ifdef HPUX_THREADS
# define LOCK() { if (!GC_test_and_clear(&GC_allocate_lock)) GC_lock(); }
/* The following is INCORRECT, since the memory model is too weak. */
-# define UNLOCK() { GC_noop1(&GC_allocate_lock); \
+# define UNLOCK() { GC_noop1((word)&GC_allocate_lock); \
*(volatile unsigned long *)(&GC_allocate_lock) = 1; }
# else
# define LOCK() { if (GC_test_and_set(&GC_allocate_lock, 1)) GC_lock(); }
@@ -641,7 +641,7 @@ void GC_print_callers (/* struct callinfo info[NFRAMES] */);
/* This is probably not necessary for ucode or gcc 2.8. */
/* It may be necessary for Ragnarok and future gcc */
/* versions. */
-# define UNLOCK() { GC_noop1(&GC_allocate_lock); \
+# define UNLOCK() { GC_noop1((word)&GC_allocate_lock); \
*(volatile unsigned long *)(&GC_allocate_lock) = 0; }
# endif
# endif
@@ -890,6 +890,18 @@ extern GC_warn_proc GC_current_warn_proc;
# define SMALL_OBJ(bytes) ((bytes) <= WORDS_TO_BYTES(MAXOBJSZ))
# define ADD_SLOP(bytes) (bytes)
# endif
+# ifndef MIN_WORDS
+ /* MIN_WORDS is the size of the smallest allocated object. */
+ /* 1 and 2 are the only valid values. */
+ /* 2 must be used if: */
+ /* - GC_gcj_malloc can be used for objects of requested */
+ /* size smaller than 2 words */
+# if defined(GC_GCJ_SUPPORT)
+# define MIN_WORDS 2 /* Smallest allocated object. */
+# else
+# define MIN_WORDS 1
+# endif
+# endif
/*
@@ -1839,7 +1851,7 @@ void GC_dump();
GC_API void GC_noop();
# endif
-void GC_noop1(/* word arg */);
+void GC_noop1 GC_PROTO((word));
/* Logging and diagnostic output: */
GC_API void GC_printf GC_PROTO((char * format, long, long, long, long, long, long));
diff --git a/boehm-gc/gcconfig.h b/boehm-gc/gcconfig.h
index 05223ced0d2..9bbd5a3ae90 100644
--- a/boehm-gc/gcconfig.h
+++ b/boehm-gc/gcconfig.h
@@ -1,6 +1,6 @@
/*
* Copyright 1988, 1989 Hans-J. Boehm, Alan J. Demers
- * Copyright (c) 1991-1994 by Xerox Corporation. All rights reserved.
+ * Copyright (c) 1991-1994, 2001 by Xerox Corporation. All rights reserved.
* Copyright (c) 1996 by Silicon Graphics. All rights reserved.
*
* THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
@@ -166,7 +166,7 @@
# define SPARC
# define mach_type_known
# endif
-# if defined(LINUX) && defined(arm)
+# if defined(LINUX) && defined(__arm__)
# define ARM32
# define mach_type_known
# endif
@@ -722,12 +722,16 @@
# endif
# ifdef SUNOS5
# define OS_TYPE "SUNOS5"
- extern int etext, _start;
+ extern int _etext, _end;
extern char * GC_SysVGetDataStart();
-# define DATASTART GC_SysVGetDataStart(0x1000, &etext)
-# define STACKBOTTOM ((ptr_t)(&_start))
+# define DATASTART GC_SysVGetDataStart(0x1000, &_etext)
+# define DATAEND (&_end)
+# include <sys/vm.h>
+# define STACKBOTTOM USRSTACK
/** At least in Solaris 2.5, PROC_VDB gives wrong values for dirty bits. */
-/*# define PROC_VDB*/
+# ifdef SOLARIS25_PROC_VDB_BUG_FIXED
+# define PROC_VDB
+# endif
# define DYNAMIC_LOADING
# ifndef USE_MMAP
# define USE_MMAP
@@ -1116,11 +1120,20 @@
# define CPP_WORDSZ 64
/* This should really be done through /proc, but that */
/* requires we run on an IA64 kernel. */
-# define STACKBOTTOM ((ptr_t) 0xa000000000000000l)
+ /* The following works on NUE and older kernels: */
+/* # define STACKBOTTOM ((ptr_t) 0xa000000000000000l) */
+ /* This does not work on NUE: */
+# define LINUX_STACKBOTTOM
/* We also need the base address of the register stack */
- /* backing store. There is probably a better way to */
- /* get that, too ... */
-# define BACKING_STORE_BASE ((ptr_t) 0x9fffffff80000000l)
+ /* backing store. There should be a better way to get */
+ /* this: */
+# define APPROX_BS_BASE ((word)GC_stackbottom-0x80000000)
+ /* We round to the next multiple of 1 MB, to compensate */
+ /* for the fact that the stack base is displaced by */
+ /* the environment, etc. */
+# define BACKING_STORE_BASE \
+ (ptr_t)((APPROX_BS_BASE + 0xfffff) & ~0xfffff)
+
# if 1
# define SEARCH_FOR_DATA_START
# define DATASTART GC_data_start
diff --git a/boehm-gc/gcj_mlc.c b/boehm-gc/gcj_mlc.c
index d7b912c5a9b..519c5cb916c 100644
--- a/boehm-gc/gcj_mlc.c
+++ b/boehm-gc/gcj_mlc.c
@@ -267,7 +267,6 @@ DCL_LOCK_STATE;
} else {
*opp = obj_link(op);
GC_words_allocd += lw;
- FASTUNLOCK();
}
*(void **)op = ptr_to_struct_containing_descr;
UNLOCK();
diff --git a/boehm-gc/linux_threads.c b/boehm-gc/linux_threads.c
index cac52374d72..2c856f567a0 100644
--- a/boehm-gc/linux_threads.c
+++ b/boehm-gc/linux_threads.c
@@ -611,7 +611,7 @@ void * GC_start_routine(void * arg)
/* Needs to be plausible, since an asynchronous stack mark */
/* should not crash. */
# else
- me -> stack_end = (ptr_t)(((word)(&dummy) & ~(GC_page_size - 1));
+ me -> stack_end = (ptr_t)((word)(&dummy) & ~(GC_page_size - 1));
me -> stack_ptr = me -> stack_end + 0x10;
# endif
/* This is dubious, since we may be more than a page into the stack, */
diff --git a/boehm-gc/mach_dep.c b/boehm-gc/mach_dep.c
index 2936fd7f992..b6c5585463d 100644
--- a/boehm-gc/mach_dep.c
+++ b/boehm-gc/mach_dep.c
@@ -281,6 +281,18 @@ void GC_push_regs()
# if defined(I386) && (defined(SVR4) || defined(SCO) || defined(SCO_ELF))
/* I386 code, SVR4 variant, generic code does not appear to work */
+# ifdef __GNUC__
+ /* This is necessary to support PIC code. */
+# define call_push(REGNAME) \
+ { register word reg __asm__( #REGNAME ); GC_push_one (reg); }
+
+# ifndef PIC
+ call_push(ebx)
+# endif
+ call_push(ebp)
+ call_push(esi)
+ call_push(edi)
+# else /* !__GNUC__ */
asm("pushl %eax"); asm("call GC_push_one"); asm("addl $4,%esp");
asm("pushl %ebx"); asm("call GC_push_one"); asm("addl $4,%esp");
asm("pushl %ecx"); asm("call GC_push_one"); asm("addl $4,%esp");
@@ -288,6 +300,7 @@ void GC_push_regs()
asm("pushl %ebp"); asm("call GC_push_one"); asm("addl $4,%esp");
asm("pushl %esi"); asm("call GC_push_one"); asm("addl $4,%esp");
asm("pushl %edi"); asm("call GC_push_one"); asm("addl $4,%esp");
+# endif /* !__GNUC__ */
# endif
# ifdef NS32K
diff --git a/boehm-gc/malloc.c b/boehm-gc/malloc.c
index a5a93ad8119..c9222245362 100644
--- a/boehm-gc/malloc.c
+++ b/boehm-gc/malloc.c
@@ -52,7 +52,7 @@ register ptr_t *opp;
lw = GC_size_map[lb];
# else
lw = ALIGNED_WORDS(lb);
- if (lw == 0) lw = 1;
+ if (lw == 0) lw = MIN_WORDS;
# endif
opp = &(kind -> ok_freelist[lw]);
if( (op = *opp) == 0 ) {
diff --git a/boehm-gc/misc.c b/boehm-gc/misc.c
index dd42961c4b3..9edb9453bb4 100644
--- a/boehm-gc/misc.c
+++ b/boehm-gc/misc.c
@@ -107,13 +107,17 @@ extern signed_word GC_mem_found;
{
register unsigned i;
- /* Map size 0 to 1. This avoids problems at lower levels. */
- GC_size_map[0] = 1;
+ /* Map size 0 to something bigger. */
+ /* This avoids problems at lower levels. */
/* One word objects don't have to be 2 word aligned. */
- for (i = 1; i < sizeof(word); i++) {
- GC_size_map[i] = 1;
+ for (i = 0; i < sizeof(word); i++) {
+ GC_size_map[i] = MIN_WORDS;
}
- GC_size_map[sizeof(word)] = ROUNDED_UP_WORDS(sizeof(word));
+# if MIN_WORDS > 1
+ GC_size_map[sizeof(word)] = MIN_WORDS;
+# else
+ GC_size_map[sizeof(word)] = ROUNDED_UP_WORDS(sizeof(word));
+# endif
for (i = sizeof(word) + 1; i <= 8 * sizeof(word); i++) {
# ifdef ALIGN_DOUBLE
GC_size_map[i] = (ROUNDED_UP_WORDS(i) + 1) & (~1);
@@ -202,7 +206,7 @@ extern signed_word GC_mem_found;
*/
word GC_stack_last_cleared = 0; /* GC_no when we last did this */
# ifdef THREADS
-# define CLEAR_SIZE 2048
+# define CLEAR_SIZE 512
# else
# define CLEAR_SIZE 213
# endif
diff --git a/boehm-gc/os_dep.c b/boehm-gc/os_dep.c
index 87f84e7bccd..a192d35a21a 100644
--- a/boehm-gc/os_dep.c
+++ b/boehm-gc/os_dep.c
@@ -144,20 +144,37 @@
#endif
#if defined(SEARCH_FOR_DATA_START)
- /* The following doesn't work if the GC is in a dynamic library. */
/* The I386 case can be handled without a search. The Alpha case */
/* used to be handled differently as well, but the rules changed */
/* for recent Linux versions. This seems to be the easiest way to */
/* cover all versions. */
- ptr_t GC_data_start;
- extern char * GC_copyright[]; /* Any data symbol would do. */
+# ifdef LINUX
+# pragma weak __data_start
+ extern int __data_start;
+# pragma weak data_start
+ extern int data_start;
+# endif /* LINUX */
+ extern int _end;
+
+ ptr_t GC_data_start;
void GC_init_linux_data_start()
{
extern ptr_t GC_find_limit();
- GC_data_start = GC_find_limit((ptr_t)GC_copyright, FALSE);
+# ifdef LINUX
+ /* Try the easy approaches first: */
+ if (&__data_start != 0) {
+ GC_data_start = (ptr_t)(&__data_start);
+ return;
+ }
+ if (&data_start != 0) {
+ GC_data_start = (ptr_t)(&data_start);
+ return;
+ }
+# endif /* LINUX */
+ GC_data_start = GC_find_limit((ptr_t)(&_end), FALSE);
}
#endif
diff --git a/boehm-gc/solaris_threads.c b/boehm-gc/solaris_threads.c
index c3b0b15b97c..c6de85d2630 100644
--- a/boehm-gc/solaris_threads.c
+++ b/boehm-gc/solaris_threads.c
@@ -616,7 +616,18 @@ GC_thread GC_lookup_thread(thread_t id)
return(p);
}
+/* Solaris 2/Intel uses an initial stack size limit slightly bigger than the
+ SPARC default of 8 MB. Account for this to warn only if the user has
+ raised the limit beyond the default.
+
+ This is identical to DFLSSIZ defined in <sys/vm_machparam.h>. This file
+ is installed in /usr/platform/`uname -m`/include, which is not in the
+ default include directory list, so copy the definition here. */
+#ifdef I386
+# define MAX_ORIG_STACK_SIZE (8 * 1024 * 1024 + ((USRSTACK) & 0x3FFFFF))
+#else
# define MAX_ORIG_STACK_SIZE (8 * 1024 * 1024)
+#endif
word GC_get_orig_stack_size() {
struct rlimit rl;
@@ -627,7 +638,7 @@ word GC_get_orig_stack_size() {
result = (word)rl.rlim_cur & ~(HBLKSIZE-1);
if (result > MAX_ORIG_STACK_SIZE) {
if (!warned) {
- WARN("Large stack limit(%ld): only scanning 8 MB", result);
+ WARN("Large stack limit(%ld): only scanning 8 MB\n", result);
warned = 1;
}
result = MAX_ORIG_STACK_SIZE;
diff --git a/boehm-gc/test.c b/boehm-gc/test.c
index 96a54150a86..9254fa8370d 100644
--- a/boehm-gc/test.c
+++ b/boehm-gc/test.c
@@ -958,17 +958,17 @@ void run_one_test()
"This test program is not designed for leak detection mode\n");
(void)GC_printf0("Expect lots of problems.\n");
# endif
- if (GC_size(GC_malloc(7)) != 8
+ if (GC_size(GC_malloc(7)) != 8 &&
+ GC_size(GC_malloc(7)) != MIN_WORDS * sizeof(GC_word)
|| GC_size(GC_malloc(15)) != 16) {
(void)GC_printf0("GC_size produced unexpected results\n");
FAIL;
}
- if (GC_size(GC_malloc(0)) != 4 && GC_size(GC_malloc(0)) != 8) {
+ if (GC_size(GC_malloc(0)) != MIN_WORDS * sizeof(GC_word)) {
(void)GC_printf0("GC_malloc(0) failed\n");
FAIL;
}
- if (GC_size(GC_malloc_uncollectable(0)) != 4
- && GC_size(GC_malloc_uncollectable(0)) != 8) {
+ if (GC_size(GC_malloc_uncollectable(0)) != MIN_WORDS * sizeof(GC_word)) {
(void)GC_printf0("GC_malloc_uncollectable(0) failed\n");
FAIL;
}
diff --git a/config-ml.in b/config-ml.in
index 42a2dd31c9d..16885f95f0e 100644
--- a/config-ml.in
+++ b/config-ml.in
@@ -17,8 +17,6 @@
# . ${srcdir}/../config-ml.in
# fi
#
-# See librx/configure.in in the libg++ distribution for an example of how
-# to handle autoconf'd libraries.
#
# Things are complicated because 6 separate cases must be handled:
# 2 (native, cross) x 3 (absolute-path, relative-not-dot, dot) = 6.
@@ -30,13 +28,10 @@
# The build tree is layed out as
#
# ./
-# libg++
# newlib
# m68020/
-# libg++
# newlib
# m68881/
-# libg++
# newlib
#
# The nice feature about this arrangement is that inter-library references
@@ -156,7 +151,7 @@ done
if [ "${enable_multilib}" = yes ]; then
# Compute whether this is the library's top level directory
-# (ie: not a multilib subdirectory, and not a subdirectory like libg++/src).
+# (ie: not a multilib subdirectory, and not a subdirectory like newlib/src).
# ${with_multisubdir} tells us we're in the right branch, but we could be
# in a subdir of that.
# ??? The previous version could void this test by separating the process into
@@ -397,6 +392,28 @@ mips*-*-*)
esac
;;
powerpc*-*-* | rs6000*-*-*)
+ if [ x$enable_aix64 = xno ]
+ then
+ old_multidirs="${multidirs}"
+ multidirs=""
+ for x in ${old_multidirs}; do
+ case "$x" in
+ *ppc64* ) : ;;
+ *) multidirs="${multidirs} ${x}" ;;
+ esac
+ done
+ fi
+ if [ x$enable_pthread = xno ]
+ then
+ old_multidirs="${multidirs}"
+ multidirs=""
+ for x in ${old_multidirs}; do
+ case "$x" in
+ *pthread* ) : ;;
+ *) multidirs="${multidirs} ${x}" ;;
+ esac
+ done
+ fi
if [ x$enable_softfloat = xno ]
then
old_multidirs="${multidirs}"
@@ -531,6 +548,7 @@ multi-do:
CFLAGS="$(CFLAGS) $${flags}" \
prefix="$(prefix)" \
exec_prefix="$(exec_prefix)" \
+ GCJFLAGS="$(GCJFLAGS) $${flags}" \
CXXFLAGS="$(CXXFLAGS) $${flags}" \
LIBCFLAGS="$(LIBCFLAGS) $${flags}" \
LIBCXXFLAGS="$(LIBCXXFLAGS) $${flags}" \
@@ -753,11 +771,12 @@ if [ -n "${multidirs}" ] && [ -z "${ml_norecursion}" ]; then
break
fi
done
- ml_config_env='CC="${CC_}$flags" CXX="${CXX_}$flags"'
+ ml_config_env='CC="${CC_}$flags" CXX="${CXX_}$flags" GCJ="${GCJ_}$flags"'
if [ "${with_target_subdir}" = "." ]; then
CC_=$CC' '
CXX_=$CXX' '
+ GCJ_=$GCJ' '
else
# Create a regular expression that matches any string as long
# as ML_POPDIR.
@@ -786,6 +805,18 @@ if [ -n "${multidirs}" ] && [ -z "${ml_norecursion}" ]; then
esac
done
+ GCJ_=
+ for arg in ${GCJ}; do
+ case $arg in
+ -[BIL]"${ML_POPDIR}"/*)
+ GCJ_="${GCJ_}"`echo "X${arg}" | sed -n "s/X\\(-[BIL]${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X-[BIL]${popdir_rx}\\(.*\\)/\\1/p"`' ' ;;
+ "${ML_POPDIR}"/*)
+ GCJ_="${GCJ_}"`echo "X${arg}" | sed -n "s/X\\(${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X${popdir_rx}\\(.*\\)/\\1/p"`' ' ;;
+ *)
+ GCJ_="${GCJ_}${arg} " ;;
+ esac
+ done
+
if test "x${LD_LIBRARY_PATH+set}" = xset; then
LD_LIBRARY_PATH_=
for arg in `echo "$LD_LIBRARY_PATH" | tr ':' ' '`; do
diff --git a/config.guess b/config.guess
index 93e03c68885..31ec915609e 100755
--- a/config.guess
+++ b/config.guess
@@ -1,9 +1,9 @@
#! /bin/sh
# Attempt to guess a canonical system name.
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
# Free Software Foundation, Inc.
-version='2000-10-03'
+timestamp='2001-06-05'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@@ -32,30 +32,41 @@ version='2000-10-03'
# exits with 0. Otherwise, it exits with 1.
#
# The plan is that this can be called by configure scripts if you
-# don't specify an explicit system type (host/target name).
-#
-# Only a few systems have been added to this list; please add others
-# (but try to keep the structure clean).
-#
+# don't specify an explicit build system type.
me=`echo "$0" | sed -e 's,.*/,,'`
usage="\
Usage: $0 [OPTION]
-Output the configuration name of this system.
+Output the configuration name of the system \`$me' is run on.
Operation modes:
- -h, --help print this help, then exit
- -V, --version print version number, then exit"
+ -h, --help print this help, then exit
+ -t, --time-stamp print date of last modification, then exit
+ -v, --version print version number, then exit
+
+Report bugs and patches to <config-patches@gnu.org>."
+
+version="\
+GNU config.guess ($timestamp)
+
+Originally written by Per Bothner.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions. There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
help="
Try \`$me --help' for more information."
# Parse command line
while test $# -gt 0 ; do
- case "$1" in
- --version | --vers* | -V )
+ case $1 in
+ --time-stamp | --time* | -t )
+ echo "$timestamp" ; exit 0 ;;
+ --version | -v )
echo "$version" ; exit 0 ;;
--help | --h* | -h )
echo "$usage"; exit 0 ;;
@@ -64,9 +75,7 @@ while test $# -gt 0 ; do
- ) # Use stdin as input.
break ;;
-* )
- exec >&2
- echo "$me: invalid option $1"
- echo "$help"
+ echo "$me: invalid option $1$help" >&2
exit 1 ;;
* )
break ;;
@@ -78,19 +87,30 @@ if test $# != 0; then
exit 1
fi
-# Use $HOST_CC if defined. $CC may point to a cross-compiler
-if test x"$CC_FOR_BUILD" = x; then
- if test x"$HOST_CC" != x; then
- CC_FOR_BUILD="$HOST_CC"
- else
- if test x"$CC" != x; then
- CC_FOR_BUILD="$CC"
- else
- CC_FOR_BUILD=cc
- fi
- fi
-fi
+dummy=dummy-$$
+trap 'rm -f $dummy.c $dummy.o $dummy.rel $dummy; exit 1' 1 2 15
+
+# CC_FOR_BUILD -- compiler used by this script.
+# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
+# use `HOST_CC' if defined, but it is deprecated.
+
+case $CC_FOR_BUILD,$HOST_CC,$CC in
+ ,,) echo "int dummy(){}" > $dummy.c
+ for c in cc gcc c89 ; do
+ ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1
+ if test $? = 0 ; then
+ CC_FOR_BUILD="$c"; break
+ fi
+ done
+ rm -f $dummy.c $dummy.o $dummy.rel
+ if test x"$CC_FOR_BUILD" = x ; then
+ CC_FOR_BUILD=no_compiler_found
+ fi
+ ;;
+ ,,*) CC_FOR_BUILD=$CC ;;
+ ,*,*) CC_FOR_BUILD=$HOST_CC ;;
+esac
# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
# (ghazi@noc.rutgers.edu 8/24/94.)
@@ -100,12 +120,9 @@ fi
UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
-UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
+UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
-dummy=dummy-$$
-trap 'rm -f $dummy.c $dummy.o $dummy; exit 1' 1 2 15
-
# Note: order is significant - the case branches are not exclusive.
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
@@ -129,16 +146,24 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
ibmrt|romp-ibm) machine=romp-ibm ;;
*) machine=${UNAME_MACHINE}-unknown ;;
esac
- # The Operating System including object format.
- if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
- | grep __ELF__ >/dev/null
- then
- # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
- # Return netbsd for either. FIX?
- os=netbsd
- else
- os=netbsdelf
- fi
+ # The Operating System including object format, if it has switched
+ # to ELF recently, or will in the future.
+ case "${UNAME_MACHINE}" in
+ i386|sparc|amiga|arm*|hp300|mvme68k|vax|atari|luna68k|mac68k|news68k|next68k|pc532|sun3*|x68k)
+ if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep __ELF__ >/dev/null
+ then
+ # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
+ # Return netbsd for either. FIX?
+ os=netbsd
+ else
+ os=netbsdelf
+ fi
+ ;;
+ *)
+ os=netbsd
+ ;;
+ esac
# The OS release
release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
@@ -247,7 +272,7 @@ EOF
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
echo arm-acorn-riscix${UNAME_RELEASE}
exit 0;;
- SR2?01:HI-UX/MPP:*:*)
+ SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
echo hppa1.1-hitachi-hiuxmpp
exit 0;;
Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
@@ -383,10 +408,13 @@ EOF
EOF
$CC_FOR_BUILD $dummy.c -o $dummy \
&& ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
- && rm $dummy.c $dummy && exit 0
+ && rm -f $dummy.c $dummy && exit 0
rm -f $dummy.c $dummy
echo mips-mips-riscos${UNAME_RELEASE}
exit 0 ;;
+ Motorola:PowerMAX_OS:*:*)
+ echo powerpc-motorola-powermax
+ exit 0 ;;
Night_Hawk:Power_UNIX:*:*)
echo powerpc-harris-powerunix
exit 0 ;;
@@ -434,9 +462,17 @@ EOF
????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX '
- i?86:AIX:*:*)
+ i*86:AIX:*:*)
echo i386-ibm-aix
exit 0 ;;
+ ia64:AIX:*:*)
+ if [ -x /usr/bin/oslevel ] ; then
+ IBM_REV=`/usr/bin/oslevel`
+ else
+ IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+ fi
+ echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
+ exit 0 ;;
*:AIX:2:3)
if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
sed 's/^ //' << EOF >$dummy.c
@@ -450,7 +486,7 @@ EOF
exit(0);
}
EOF
- $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0
+ $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0
rm -f $dummy.c $dummy
echo rs6000-ibm-aix3.2.5
elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
@@ -459,9 +495,9 @@ EOF
echo rs6000-ibm-aix3.2
fi
exit 0 ;;
- *:AIX:*:4)
+ *:AIX:*:[45])
IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'`
- if /usr/sbin/lsattr -EHl ${IBM_CPU_ID} | grep POWER >/dev/null 2>&1; then
+ if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
IBM_ARCH=rs6000
else
IBM_ARCH=powerpc
@@ -469,7 +505,7 @@ EOF
if [ -x /usr/bin/oslevel ] ; then
IBM_REV=`/usr/bin/oslevel`
else
- IBM_REV=4.${UNAME_RELEASE}
+ IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
fi
echo ${IBM_ARCH}-ibm-aix${IBM_REV}
exit 0 ;;
@@ -495,10 +531,28 @@ EOF
echo m68k-hp-bsd4.4
exit 0 ;;
9000/[34678]??:HP-UX:*:*)
+ HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
case "${UNAME_MACHINE}" in
9000/31? ) HP_ARCH=m68000 ;;
9000/[34]?? ) HP_ARCH=m68k ;;
9000/[678][0-9][0-9])
+ case "${HPUX_REV}" in
+ 11.[0-9][0-9])
+ if [ -x /usr/bin/getconf ]; then
+ sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
+ sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
+ case "${sc_cpu_version}" in
+ 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
+ 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
+ 532) # CPU_PA_RISC2_0
+ case "${sc_kernel_bits}" in
+ 32) HP_ARCH="hppa2.0n" ;;
+ 64) HP_ARCH="hppa2.0w" ;;
+ esac ;;
+ esac
+ fi ;;
+ esac
+ if [ "${HP_ARCH}" = "" ]; then
sed 's/^ //' << EOF >$dummy.c
#define _HPUX_SOURCE
@@ -533,11 +587,16 @@ EOF
}
EOF
(CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy`
+ if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi
rm -f $dummy.c $dummy
+ fi ;;
esac
- HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
echo ${HP_ARCH}-hp-hpux${HPUX_REV}
exit 0 ;;
+ ia64:HP-UX:*:*)
+ HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+ echo ia64-hp-hpux${HPUX_REV}
+ exit 0 ;;
3050*:HI-UX:*:*)
sed 's/^ //' << EOF >$dummy.c
#include <unistd.h>
@@ -564,7 +623,7 @@ EOF
exit (0);
}
EOF
- $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0
+ $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0
rm -f $dummy.c $dummy
echo unknown-hitachi-hiuxwe2
exit 0 ;;
@@ -583,7 +642,7 @@ EOF
hp8??:OSF1:*:*)
echo hppa1.0-hp-osf
exit 0 ;;
- i?86:OSF1:*:*)
+ i*86:OSF1:*:*)
if [ -x /usr/sbin/sysversion ] ; then
echo ${UNAME_MACHINE}-unknown-osf1mk
else
@@ -628,27 +687,28 @@ EOF
CRAY*TS:*:*:*)
echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit 0 ;;
- CRAY*T3E:*:*:*)
+ CRAY*T3D:*:*:*)
echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit 0 ;;
+ CRAY*T3E:*:*:*)
+ echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit 0 ;;
CRAY*SV1:*:*:*)
echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit 0 ;;
CRAY-2:*:*:*)
echo cray2-cray-unicos
exit 0 ;;
- F300:UNIX_System_V:*:*)
+ F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
+ FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
- echo "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+ echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
exit 0 ;;
- F301:UNIX_System_V:*:*)
- echo f301-fujitsu-uxpv`echo $UNAME_RELEASE | sed 's/ .*//'`
- exit 0 ;;
hp300:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
- i?86:BSD/386:*:* | i?86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
+ i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
exit 0 ;;
sparc*:BSD/OS:*:*)
@@ -693,56 +753,38 @@ EOF
i*86:Minix:*:*)
echo ${UNAME_MACHINE}-pc-minix
exit 0 ;;
- *:Linux:*:*)
-
- # The BFD linker knows what the default object file format is, so
- # first see if it will tell us. cd to the root directory to prevent
- # problems with other programs or directories called `ld' in the path.
- ld_supported_emulations=`cd /; ld --help 2>&1 \
- | sed -ne '/supported emulations:/!d
- s/[ ][ ]*/ /g
- s/.*supported emulations: *//
- s/ .*//
- p'`
- case "$ld_supported_emulations" in
- *ia64)
- echo "${UNAME_MACHINE}-unknown-linux"
- exit 0
- ;;
- i?86linux)
- echo "${UNAME_MACHINE}-pc-linux-gnuaout"
- exit 0
- ;;
- elf_i?86)
- TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
- ;;
- i?86coff)
- echo "${UNAME_MACHINE}-pc-linux-gnucoff"
- exit 0
- ;;
- sparclinux)
- echo "${UNAME_MACHINE}-unknown-linux-gnuaout"
- exit 0
- ;;
- armlinux)
- echo "${UNAME_MACHINE}-unknown-linux-gnuaout"
- exit 0
- ;;
- elf32arm*)
- echo "${UNAME_MACHINE}-unknown-linux-gnuoldld"
- exit 0
- ;;
- armelf_linux*)
- echo "${UNAME_MACHINE}-unknown-linux-gnu"
- exit 0
- ;;
- m68klinux)
- echo "${UNAME_MACHINE}-unknown-linux-gnuaout"
- exit 0
- ;;
- elf32ppc | elf32ppclinux)
- # Determine Lib Version
- cat >$dummy.c <<EOF
+ arm*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit 0 ;;
+ ia64:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux
+ exit 0 ;;
+ m68*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit 0 ;;
+ mips:Linux:*:*)
+ cat >$dummy.c <<EOF
+#ifdef __cplusplus
+#include <stdio.h> /* for printf() prototype */
+int main (int argc, char *argv[]) {
+#else
+int main (argc, argv) int argc; char *argv[]; {
+#endif
+#ifdef __MIPSEB__
+ printf ("%s-unknown-linux-gnu\n", argv[1]);
+#endif
+#ifdef __MIPSEL__
+ printf ("%sel-unknown-linux-gnu\n", argv[1]);
+#endif
+ return 0;
+}
+EOF
+ $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm -f $dummy.c $dummy && exit 0
+ rm -f $dummy.c $dummy
+ ;;
+ ppc:Linux:*:*)
+ # Determine Lib Version
+ cat >$dummy.c <<EOF
#include <features.h>
#if defined(__GLIBC__)
extern char __libc_version[];
@@ -755,129 +797,116 @@ main(argc, argv)
#if defined(__GLIBC__)
printf("%s %s\n", __libc_version, __libc_release);
#else
- printf("unkown\n");
+ printf("unknown\n");
#endif
return 0;
}
EOF
- LIBC=""
- $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null
+ LIBC=""
+ $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null
+ if test "$?" = 0 ; then
+ ./$dummy | grep 1\.99 > /dev/null
+ if test "$?" = 0 ; then LIBC="libc1" ; fi
+ fi
+ rm -f $dummy.c $dummy
+ echo powerpc-unknown-linux-gnu${LIBC}
+ exit 0 ;;
+ alpha:Linux:*:*)
+ cat <<EOF >$dummy.s
+ .data
+ \$Lformat:
+ .byte 37,100,45,37,120,10,0 # "%d-%x\n"
+ .text
+ .globl main
+ .align 4
+ .ent main
+ main:
+ .frame \$30,16,\$26,0
+ ldgp \$29,0(\$27)
+ .prologue 1
+ .long 0x47e03d80 # implver \$0
+ lda \$2,-1
+ .long 0x47e20c21 # amask \$2,\$1
+ lda \$16,\$Lformat
+ mov \$0,\$17
+ not \$1,\$18
+ jsr \$26,printf
+ ldgp \$29,0(\$26)
+ mov 0,\$16
+ jsr \$26,exit
+ .end main
+EOF
+ LIBC=""
+ $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
+ if test "$?" = 0 ; then
+ case `./$dummy` in
+ 0-0) UNAME_MACHINE="alpha" ;;
+ 1-0) UNAME_MACHINE="alphaev5" ;;
+ 1-1) UNAME_MACHINE="alphaev56" ;;
+ 1-101) UNAME_MACHINE="alphapca56" ;;
+ 2-303) UNAME_MACHINE="alphaev6" ;;
+ 2-307) UNAME_MACHINE="alphaev67" ;;
+ esac
+ objdump --private-headers $dummy | \
+ grep ld.so.1 > /dev/null
if test "$?" = 0 ; then
- ./$dummy | grep 1\.99 > /dev/null
- if test "$?" = 0 ; then
- LIBC="libc1"
- fi
+ LIBC="libc1"
fi
- rm -f $dummy.c $dummy
- echo powerpc-unknown-linux-gnu${LIBC}
- exit 0
- ;;
- shelf_linux)
- echo "${UNAME_MACHINE}-unknown-linux-gnu"
- exit 0
+ fi
+ rm -f $dummy.s $dummy
+ echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
+ exit 0 ;;
+ parisc:Linux:*:* | hppa:Linux:*:*)
+ # Look for CPU level
+ case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
+ PA7*) echo hppa1.1-unknown-linux-gnu ;;
+ PA8*) echo hppa2.0-unknown-linux-gnu ;;
+ *) echo hppa-unknown-linux-gnu ;;
+ esac
+ exit 0 ;;
+ parisc64:Linux:*:* | hppa64:Linux:*:*)
+ echo hppa64-unknown-linux-gnu
+ exit 0 ;;
+ s390:Linux:*:* | s390x:Linux:*:*)
+ echo ${UNAME_MACHINE}-ibm-linux
+ exit 0 ;;
+ sh*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit 0 ;;
+ sparc:Linux:*:* | sparc64:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit 0 ;;
+ x86_64:Linux:*:*)
+ echo x86_64-unknown-linux-gnu
+ exit 0 ;;
+ i*86:Linux:*:*)
+ # The BFD linker knows what the default object file format is, so
+ # first see if it will tell us. cd to the root directory to prevent
+ # problems with other programs or directories called `ld' in the path.
+ ld_supported_targets=`cd /; ld --help 2>&1 \
+ | sed -ne '/supported targets:/!d
+ s/[ ][ ]*/ /g
+ s/.*supported targets: *//
+ s/ .*//
+ p'`
+ case "$ld_supported_targets" in
+ elf32-i386)
+ TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
;;
+ a.out-i386-linux)
+ echo "${UNAME_MACHINE}-pc-linux-gnuaout"
+ exit 0 ;;
+ coff-i386)
+ echo "${UNAME_MACHINE}-pc-linux-gnucoff"
+ exit 0 ;;
+ "")
+ # Either a pre-BFD a.out linker (linux-gnuoldld) or
+ # one that does not give us useful --help.
+ echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
+ exit 0 ;;
esac
-
- if test "${UNAME_MACHINE}" = "alpha" ; then
- cat <<EOF >$dummy.s
- .data
- \$Lformat:
- .byte 37,100,45,37,120,10,0 # "%d-%x\n"
-
- .text
- .globl main
- .align 4
- .ent main
- main:
- .frame \$30,16,\$26,0
- ldgp \$29,0(\$27)
- .prologue 1
- .long 0x47e03d80 # implver \$0
- lda \$2,-1
- .long 0x47e20c21 # amask \$2,\$1
- lda \$16,\$Lformat
- mov \$0,\$17
- not \$1,\$18
- jsr \$26,printf
- ldgp \$29,0(\$26)
- mov 0,\$16
- jsr \$26,exit
- .end main
-EOF
- LIBC=""
- $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
- if test "$?" = 0 ; then
- case `./$dummy` in
- 0-0)
- UNAME_MACHINE="alpha"
- ;;
- 1-0)
- UNAME_MACHINE="alphaev5"
- ;;
- 1-1)
- UNAME_MACHINE="alphaev56"
- ;;
- 1-101)
- UNAME_MACHINE="alphapca56"
- ;;
- 2-303)
- UNAME_MACHINE="alphaev6"
- ;;
- 2-307)
- UNAME_MACHINE="alphaev67"
- ;;
- esac
-
- objdump --private-headers $dummy | \
- grep ld.so.1 > /dev/null
- if test "$?" = 0 ; then
- LIBC="libc1"
- fi
- fi
- rm -f $dummy.s $dummy
- echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} ; exit 0
- elif test "${UNAME_MACHINE}" = "mips" ; then
- cat >$dummy.c <<EOF
-#ifdef __cplusplus
-#include <stdio.h> /* for printf() prototype */
- int main (int argc, char *argv[]) {
-#else
- int main (argc, argv) int argc; char *argv[]; {
-#endif
-#ifdef __MIPSEB__
- printf ("%s-unknown-linux-gnu\n", argv[1]);
-#endif
-#ifdef __MIPSEL__
- printf ("%sel-unknown-linux-gnu\n", argv[1]);
-#endif
- return 0;
-}
-EOF
- $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0
- rm -f $dummy.c $dummy
- elif test "${UNAME_MACHINE}" = "s390"; then
- echo s390-ibm-linux && exit 0
- elif test "${UNAME_MACHINE}" = "x86_64"; then
- echo x86_64-unknown-linux-gnu && exit 0
- else
- # Either a pre-BFD a.out linker (linux-gnuoldld)
- # or one that does not give us useful --help.
- # GCC wants to distinguish between linux-gnuoldld and linux-gnuaout.
- # If ld does not provide *any* "supported emulations:"
- # that means it is gnuoldld.
- test -z "$ld_supported_emulations" \
- && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0
-
- case "${UNAME_MACHINE}" in
- i?86)
- VENDOR=pc;
- ;;
- *)
- VENDOR=unknown;
- ;;
- esac
- # Determine whether the default compiler is a.out or elf
- cat >$dummy.c <<EOF
+ # Determine whether the default compiler is a.out or elf
+ cat >$dummy.c <<EOF
#include <features.h>
#ifdef __cplusplus
#include <stdio.h> /* for printf() prototype */
@@ -888,29 +917,29 @@ EOF
#ifdef __ELF__
# ifdef __GLIBC__
# if __GLIBC__ >= 2
- printf ("%s-${VENDOR}-linux-gnu\n", argv[1]);
+ printf ("%s-pc-linux-gnu\n", argv[1]);
# else
- printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]);
+ printf ("%s-pc-linux-gnulibc1\n", argv[1]);
# endif
# else
- printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]);
+ printf ("%s-pc-linux-gnulibc1\n", argv[1]);
# endif
#else
- printf ("%s-${VENDOR}-linux-gnuaout\n", argv[1]);
+ printf ("%s-pc-linux-gnuaout\n", argv[1]);
#endif
return 0;
}
EOF
- $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0
- rm -f $dummy.c $dummy
- test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
- fi ;;
+ $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm -f $dummy.c $dummy && exit 0
+ rm -f $dummy.c $dummy
+ test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
+ ;;
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions
# are messed up and put the nodename in both sysname and nodename.
- i?86:DYNIX/ptx:4*:*)
+ i*86:DYNIX/ptx:4*:*)
echo i386-sequent-sysv4
exit 0 ;;
- i?86:UNIX_SV:4.2MP:2.*)
+ i*86:UNIX_SV:4.2MP:2.*)
# Unixware is an offshoot of SVR4, but it has its own version
# number series starting with 2...
# I am not positive that other SVR4 systems won't match this,
@@ -918,7 +947,7 @@ EOF
# Use sysv4.2uw... so that sysv4* matches it.
echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
exit 0 ;;
- i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*)
+ i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
@@ -926,7 +955,7 @@ EOF
echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
fi
exit 0 ;;
- i?86:*:5:7*)
+ i*86:*:5:7*)
# Fixed at (any) Pentium or better
UNAME_MACHINE=i586
if [ ${UNAME_SYSTEM} = "UnixWare" ] ; then
@@ -935,7 +964,7 @@ EOF
echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE}
fi
exit 0 ;;
- i?86:*:3.2:*)
+ i*86:*:3.2:*)
if test -f /usr/options/cb.name; then
UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
@@ -953,7 +982,7 @@ EOF
echo ${UNAME_MACHINE}-pc-sysv32
fi
exit 0 ;;
- i?86:*DOS:*:*)
+ i*86:*DOS:*:*)
echo ${UNAME_MACHINE}-pc-msdosdjgpp
exit 0 ;;
pc:*:*:*)
@@ -981,7 +1010,7 @@ EOF
exit 0 ;;
M68*:*:R3V[567]*:*)
test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
- 3[34]??:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0)
+ 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0)
OS_REL=''
test -r /etc/.relid \
&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
@@ -992,21 +1021,24 @@ EOF
3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
&& echo i486-ncr-sysv4 && exit 0 ;;
- m68*:LynxOS:2.*:*)
+ m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
echo m68k-unknown-lynxos${UNAME_RELEASE}
exit 0 ;;
mc68030:UNIX_System_V:4.*:*)
echo m68k-atari-sysv4
exit 0 ;;
- i?86:LynxOS:2.*:* | i?86:LynxOS:3.[01]*:*)
+ i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
echo i386-unknown-lynxos${UNAME_RELEASE}
exit 0 ;;
TSUNAMI:LynxOS:2.*:*)
echo sparc-unknown-lynxos${UNAME_RELEASE}
exit 0 ;;
- rs6000:LynxOS:2.*:* | PowerPC:LynxOS:2.*:*)
+ rs6000:LynxOS:2.*:*)
echo rs6000-unknown-lynxos${UNAME_RELEASE}
exit 0 ;;
+ PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
+ echo powerpc-unknown-lynxos${UNAME_RELEASE}
+ exit 0 ;;
SM[BE]S:UNIX_SV:*:*)
echo mips-dde-sysv${UNAME_RELEASE}
exit 0 ;;
@@ -1086,6 +1118,9 @@ EOF
NSR-[KW]:NONSTOP_KERNEL:*:*)
echo nsr-tandem-nsk${UNAME_RELEASE}
exit 0 ;;
+ *:NonStop-UX:*:*)
+ echo mips-compaq-nonstopux
+ exit 0 ;;
BS2000:POSIX*:*:*)
echo bs2000-siemens-sysv
exit 0 ;;
@@ -1103,6 +1138,29 @@ EOF
fi
echo ${UNAME_MACHINE}-unknown-plan9
exit 0 ;;
+ i*86:OS/2:*:*)
+ # If we were able to find `uname', then EMX Unix compatibility
+ # is probably installed.
+ echo ${UNAME_MACHINE}-pc-os2-emx
+ exit 0 ;;
+ *:TOPS-10:*:*)
+ echo pdp10-unknown-tops10
+ exit 0 ;;
+ *:TENEX:*:*)
+ echo pdp10-unknown-tenex
+ exit 0 ;;
+ KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
+ echo pdp10-dec-tops20
+ exit 0 ;;
+ XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
+ echo pdp10-xkl-tops20
+ exit 0 ;;
+ *:TOPS-20:*:*)
+ echo pdp10-unknown-tops20
+ exit 0 ;;
+ *:ITS:*:*)
+ echo pdp10-unknown-its
+ exit 0 ;;
esac
#echo '(No uname command or uname output not recognized.)' 1>&2
@@ -1194,11 +1252,24 @@ main ()
#endif
#if defined (vax)
-#if !defined (ultrix)
- printf ("vax-dec-bsd\n"); exit (0);
-#else
- printf ("vax-dec-ultrix\n"); exit (0);
-#endif
+# if !defined (ultrix)
+# include <sys/param.h>
+# if defined (BSD)
+# if BSD == 43
+ printf ("vax-dec-bsd4.3\n"); exit (0);
+# else
+# if BSD == 199006
+ printf ("vax-dec-bsd4.3reno\n"); exit (0);
+# else
+ printf ("vax-dec-bsd\n"); exit (0);
+# endif
+# endif
+# else
+ printf ("vax-dec-bsd\n"); exit (0);
+# endif
+# else
+ printf ("vax-dec-ultrix\n"); exit (0);
+# endif
#endif
#if defined (alliant) && defined (i860)
@@ -1209,7 +1280,7 @@ main ()
}
EOF
-$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm $dummy.c $dummy && exit 0
+$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm -f $dummy.c $dummy && exit 0
rm -f $dummy.c $dummy
# Apollos put the system type in the environment.
@@ -1245,8 +1316,9 @@ fi
cat >&2 <<EOF
$0: unable to guess system type
-The $version version of this script cannot recognize your system type.
-Please download the most up to date version of the config scripts:
+This script, last modified $timestamp, has failed to recognize
+the operating system you are using. It is advised that you
+download the most up to date version of the config scripts from
ftp://ftp.gnu.org/pub/gnu/config/
@@ -1255,7 +1327,7 @@ send the following data and any information you think might be
pertinent to <config-patches@gnu.org> in order to provide the needed
information to handle your system.
-config.guess version = $version
+config.guess timestamp = $timestamp
uname -m = `(uname -m) 2>/dev/null || echo unknown`
uname -r = `(uname -r) 2>/dev/null || echo unknown`
@@ -1282,7 +1354,7 @@ exit 1
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "version='"
+# time-stamp-start: "timestamp='"
# time-stamp-format: "%:y-%02m-%02d"
# time-stamp-end: "'"
# End:
diff --git a/config.sub b/config.sub
index af79d70a907..3b3dc123ba9 100755
--- a/config.sub
+++ b/config.sub
@@ -1,9 +1,9 @@
#! /bin/sh
-# Configuration validation subroutine script, version 1.1.
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000
+# Configuration validation subroutine script.
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
# Free Software Foundation, Inc.
-version='2000-11-02'
+timestamp='2001-06-08'
# This file is (in principle) common to ALL GNU software.
# The presence of a machine in this file suggests that SOME GNU software
@@ -60,16 +60,30 @@ Usage: $0 [OPTION] CPU-MFR-OPSYS
Canonicalize a configuration name.
Operation modes:
- -h, --help print this help, then exit
- -V, --version print version number, then exit"
+ -h, --help print this help, then exit
+ -t, --time-stamp print date of last modification, then exit
+ -v, --version print version number, then exit
+
+Report bugs and patches to <config-patches@gnu.org>."
+
+version="\
+GNU config.sub ($timestamp)
+
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions. There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
help="
Try \`$me --help' for more information."
# Parse command line
while test $# -gt 0 ; do
- case "$1" in
- --version | --vers* | -V )
+ case $1 in
+ --time-stamp | --time* | -t )
+ echo "$timestamp" ; exit 0 ;;
+ --version | -v )
echo "$version" ; exit 0 ;;
--help | --h* | -h )
echo "$usage"; exit 0 ;;
@@ -78,9 +92,7 @@ while test $# -gt 0 ; do
- ) # Use stdin as input.
break ;;
-* )
- exec >&2
- echo "$me: invalid option $1"
- echo "$help"
+ echo "$me: invalid option $1$help"
exit 1 ;;
*local*)
@@ -105,7 +117,7 @@ esac
# Here we must recognize all the valid KERNEL-OS combinations.
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
case $maybe_os in
- nto-qnx* | linux-gnu* | storm-chaos*)
+ nto-qnx* | linux-gnu* | storm-chaos* | os2-emx* | windows32-*)
os=-$maybe_os
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
;;
@@ -211,22 +223,27 @@ esac
case $basic_machine in
# Recognize the basic CPU types without company name.
# Some are omitted here because they have special meanings below.
- tahoe | i860 | ia64 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \
- | arme[lb] | armv[2345] | armv[345][lb] | pyramid | mn10200 | mn10300 | tron | a29k \
+ tahoe | i860 | ia64 | m32r | m68k | m68000 | m88k | ns32k | arc \
+ | arm | arme[lb] | arm[bl]e | armv[2345] | armv[345][lb] | strongarm | xscale \
+ | pyramid | mn10200 | mn10300 | tron | a29k \
| 580 | i960 | h8300 \
- | x86 | ppcbe | mipsbe | mipsle | shbe | shle | armbe | armle \
+ | x86 | ppcbe | mipsbe | mipsle | shbe | shle \
| hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w | hppa2.0n \
| hppa64 \
| alpha | alphaev[4-8] | alphaev56 | alphapca5[67] \
| alphaev6[78] \
| we32k | ns16k | clipper | i370 | sh | sh[34] \
| powerpc | powerpcle \
- | 1750a | dsp16xx | pdp11 | mips16 | mips64 | mipsel | mips64el \
+ | 1750a | dsp16xx | pdp10 | pdp11 \
+ | mips16 | mips64 | mipsel | mips64el \
| mips64orion | mips64orionel | mipstx39 | mipstx39el \
| mips64vr4300 | mips64vr4300el | mips64vr4100 | mips64vr4100el \
- | mips64vr5000 | miprs64vr5000el | mcore \
- | sparc | sparclet | sparclite | sparc64 | sparcv9 | v850 | c4x \
- | thumb | d10v | d30v | fr30 | avr)
+ | mips64vr5000 | mips64vr5000el | mcore | s390 | s390x \
+ | xtensa \
+ | sparc | sparclet | sparclite | sparc64 | sparcv9 | sparcv9b \
+ | v850 | c4x \
+ | thumb | d10v | d30v | fr30 | avr | openrisc | tic80 \
+ | pj | pjl | h8500 | z8k)
basic_machine=$basic_machine-unknown
;;
m6811 | m68hc11 | m6812 | m68hc12)
@@ -234,13 +251,13 @@ case $basic_machine in
basic_machine=$basic_machine-unknown
os=-none
;;
- m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | z8k | v70 | h8500 | w65 | pj | pjl)
+ m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
;;
# We use `pc' rather than `unknown'
# because (1) that's what they normally are, and
# (2) the word "unknown" tends to confuse beginning users.
- i[234567]86 | x86_64)
+ i*86 | x86_64)
basic_machine=$basic_machine-pc
;;
# Object if more than one company name word.
@@ -250,27 +267,31 @@ case $basic_machine in
;;
# Recognize the basic CPU types with company name.
# FIXME: clean up the formatting here.
- vax-* | tahoe-* | i[234567]86-* | i860-* | ia64-* | m32r-* | m68k-* | m68000-* \
- | m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \
+ vax-* | tahoe-* | i*86-* | i860-* | ia64-* | m32r-* | m68k-* | m68000-* \
+ | m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | c[123]* \
+ | arm-* | armbe-* | armle-* | armv*-* | strongarm-* | xscale-* \
| mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \
| power-* | none-* | 580-* | cray2-* | h8300-* | h8500-* | i960-* \
| xmp-* | ymp-* \
- | x86-* | ppcbe-* | mipsbe-* | mipsle-* | shbe-* | shle-* | armbe-* | armle-* \
+ | x86-* | ppcbe-* | mipsbe-* | mipsle-* | shbe-* | shle-* \
| hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* | hppa2.0w-* \
| hppa2.0n-* | hppa64-* \
| alpha-* | alphaev[4-8]-* | alphaev56-* | alphapca5[67]-* \
| alphaev6[78]-* \
| we32k-* | cydra-* | ns16k-* | pn-* | np1-* | xps100-* \
| clipper-* | orion-* \
- | sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \
- | sparc64-* | sparcv9-* | sparc86x-* | mips16-* | mips64-* | mipsel-* \
+ | sparclite-* | pdp10-* | pdp11-* | sh-* | sh[34]-* | sh[34]eb-* \
+ | powerpc-* | powerpcle-* | sparc64-* | sparcv9-* | sparcv9b-* | sparc86x-* \
+ | mips16-* | mips64-* | mipsel-* \
| mips64el-* | mips64orion-* | mips64orionel-* \
| mips64vr4100-* | mips64vr4100el-* | mips64vr4300-* | mips64vr4300el-* \
| mipstx39-* | mipstx39el-* | mcore-* \
- | f301-* | armv*-* | s390-* | sv1-* | t3e-* \
+ | xtensa-* \
+ | f30[01]-* | f700-* | s390-* | s390x-* | sv1-* | t3e-* \
+ | [cjt]90-* \
| m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | d10v-* \
- | thumb-* | v850-* | d30v-* | tic30-* | c30-* | fr30-* \
- | bs2000-* | tic54x-* | c54x-* | x86_64-*)
+ | thumb-* | v850-* | d30v-* | tic30-* | tic80-* | c30-* | fr30-* \
+ | bs2000-* | tic54x-* | c54x-* | x86_64-* | pj-* | pjl-*)
;;
# Recognize the various machine names and aliases which stand
# for a CPU type and a company and sometimes even an OS.
@@ -361,8 +382,8 @@ case $basic_machine in
basic_machine=cray2-cray
os=-unicos
;;
- [ctj]90-cray)
- basic_machine=c90-cray
+ [cjt]90)
+ basic_machine=${basic_machine}-cray
os=-unicos
;;
crds | unos)
@@ -418,6 +439,10 @@ case $basic_machine in
basic_machine=tron-gmicro
os=-sysv
;;
+ go32)
+ basic_machine=i386-pc
+ os=-go32
+ ;;
h3050r* | hiux*)
basic_machine=hppa1.1-hitachi
os=-hiuxwe2
@@ -493,19 +518,19 @@ case $basic_machine in
basic_machine=i370-ibm
;;
# I'm not sure what "Sysv32" means. Should this be sysv3.2?
- i[34567]86v32)
+ i*86v32)
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-sysv32
;;
- i[34567]86v4*)
+ i*86v4*)
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-sysv4
;;
- i[34567]86v)
+ i*86v)
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-sysv
;;
- i[34567]86sol2)
+ i*86sol2)
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-solaris2
;;
@@ -517,18 +542,6 @@ case $basic_machine in
basic_machine=i386-unknown
os=-vsta
;;
- i386-go32 | go32)
- basic_machine=i386-unknown
- os=-go32
- ;;
- i386-mingw32 | mingw32)
- basic_machine=i386-unknown
- os=-mingw32
- ;;
- i[34567]86-pw32 | pw32)
- basic_machine=i586-unknown
- os=-pw32
- ;;
iris | iris4d)
basic_machine=mips-sgi
case $os in
@@ -554,6 +567,10 @@ case $basic_machine in
basic_machine=ns32k-utek
os=-sysv
;;
+ mingw32)
+ basic_machine=i386-pc
+ os=-mingw32
+ ;;
miniframe)
basic_machine=m68000-convergent
;;
@@ -584,7 +601,7 @@ case $basic_machine in
os=-coff
;;
msdos)
- basic_machine=i386-unknown
+ basic_machine=i386-pc
os=-msdos
;;
mvs)
@@ -648,6 +665,10 @@ case $basic_machine in
basic_machine=i960-intel
os=-mon960
;;
+ nonstopux)
+ basic_machine=mips-compaq
+ os=-nonstopux
+ ;;
np1)
basic_machine=np1-gould
;;
@@ -683,28 +704,28 @@ case $basic_machine in
pc532 | pc532-*)
basic_machine=ns32k-pc532
;;
- pentium | p5 | k5 | k6 | nexen)
+ pentium | p5 | k5 | k6 | nexgen)
basic_machine=i586-pc
;;
pentiumpro | p6 | 6x86 | athlon)
basic_machine=i686-pc
;;
pentiumii | pentium2)
- basic_machine=i786-pc
+ basic_machine=i686-pc
;;
- pentium-* | p5-* | k5-* | k6-* | nexen-*)
+ pentium-* | p5-* | k5-* | k6-* | nexgen-*)
basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pentiumpro-* | p6-* | 6x86-* | athlon-*)
basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pentiumii-* | pentium2-*)
- basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
+ basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pn)
basic_machine=pn-gould
;;
- power) basic_machine=rs6000-ibm
+ power) basic_machine=power-ibm
;;
ppc) basic_machine=powerpc-unknown
;;
@@ -719,6 +740,10 @@ case $basic_machine in
ps2)
basic_machine=i386-ibm
;;
+ pw32)
+ basic_machine=i586-unknown
+ os=-pw32
+ ;;
rom68k)
basic_machine=m68k-rom68k
os=-coff
@@ -866,6 +891,10 @@ case $basic_machine in
basic_machine=hppa1.1-winbond
os=-proelf
;;
+ windows32)
+ basic_machine=i386-pc
+ os=-windows32-msvcrt
+ ;;
xmp)
basic_machine=xmp-cray
os=-unicos
@@ -909,6 +938,10 @@ case $basic_machine in
vax)
basic_machine=vax-dec
;;
+ pdp10)
+ # there are many clones, so DEC is not a safe bet
+ basic_machine=pdp10-unknown
+ ;;
pdp11)
basic_machine=pdp11-dec
;;
@@ -916,9 +949,9 @@ case $basic_machine in
basic_machine=we32k-att
;;
sh3 | sh4)
- base_machine=sh-unknown
+ basic_machine=sh-unknown
;;
- sparc | sparcv9)
+ sparc | sparcv9 | sparcv9b)
basic_machine=sparc-sun
;;
cydra)
@@ -940,6 +973,9 @@ case $basic_machine in
basic_machine=c4x-none
os=-coff
;;
+ *-unknown)
+ # Make sure to match an already-canonicalized machine name.
+ ;;
*)
echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
exit 1
@@ -1000,12 +1036,13 @@ case $os in
| -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
| -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
| -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \
- | -openstep* | -oskit* | -conix* | -pw32* | -storm-chaos*)
+ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
+ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* | -os2*)
# Remember, each alternative MUST END IN *, to match a version number.
;;
-qnx*)
case $basic_machine in
- x86-* | i[34567]86-*)
+ x86-* | i*86-*)
;;
*)
os=-nto$os
@@ -1098,7 +1135,7 @@ case $os in
-xenix)
os=-xenix
;;
- -*mint | -*MiNT)
+ -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
os=-mint
;;
-none)
@@ -1132,6 +1169,9 @@ case $basic_machine in
arm*-semi)
os=-aout
;;
+ pdp10-*)
+ os=-tops20
+ ;;
pdp11-*)
os=-none
;;
@@ -1240,7 +1280,7 @@ case $basic_machine in
*-masscomp)
os=-rtu
;;
- f301-fujitsu)
+ f30[01]-fujitsu | f700-fujitsu)
os=-uxpv
;;
*-rom68k)
@@ -1318,7 +1358,7 @@ case $basic_machine in
-mpw* | -macos*)
vendor=apple
;;
- -*mint | -*MiNT)
+ -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
vendor=atari
;;
esac
@@ -1331,7 +1371,7 @@ exit 0
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "version='"
+# time-stamp-start: "timestamp='"
# time-stamp-format: "%:y-%02m-%02d"
# time-stamp-end: "'"
# End:
diff --git a/config/ChangeLog b/config/ChangeLog
index 4f32d00058b..0bce73de73a 100644
--- a/config/ChangeLog
+++ b/config/ChangeLog
@@ -1,3 +1,35 @@
+2002-02-20 Release Manager
+
+ * GCC 3.0.4 Released.
+
+2002-02-20 Release Manager
+
+ * GCC 3.0.4 Released.
+
+2001-12-20 Release Manager
+
+ * GCC 3.0.3 Released.
+
+2001-10-23 Release Manager
+
+ * GCC 3.0.2 Released.
+
+2001-08-19 Release Manager
+
+ * GCC 3.0.1 Released.
+
+2001-08-19 Release Manager
+
+ * GCC 3.0.1 Released.
+
+20010617 Release Manager
+
+ * GCC 3.0 Released.
+
+2001-05-22 Jason Merrill <jason_merrill@redhat.com>
+
+ * mt-linux (CXXFLAGS_FOR_TARGET): Lose -fvtable-thunks.
+
2001-01-27 Richard Henderson <rth@redhat.com>
* mt-alphaieee: New file.
diff --git a/config/mpw/ChangeLog b/config/mpw/ChangeLog
index 3cdefbf7a75..185b8043f1a 100644
--- a/config/mpw/ChangeLog
+++ b/config/mpw/ChangeLog
@@ -1,3 +1,35 @@
+2002-02-20 Release Manager
+
+ * GCC 3.0.4 Released.
+
+2002-02-20 Release Manager
+
+ * GCC 3.0.4 Released.
+
+2001-12-20 Release Manager
+
+ * GCC 3.0.3 Released.
+
+2001-10-23 Release Manager
+
+ * GCC 3.0.2 Released.
+
+2001-08-19 Release Manager
+
+ * GCC 3.0.1 Released.
+
+2001-08-19 Release Manager
+
+ * GCC 3.0.1 Released.
+
+2001-08-19 Release Manager
+
+ * GCC 3.0.1 Released.
+
+20010617 Release Manager
+
+ * GCC 3.0 Released.
+
Tue Nov 26 12:34:12 1996 Stan Shebs <shebs@andros.cygnus.com>
* g-mpw-make.sed: Fix some comments.
diff --git a/config/mt-linux b/config/mt-linux
index a09e6f18af5..15bf4171603 100644
--- a/config/mt-linux
+++ b/config/mt-linux
@@ -1,2 +1 @@
-# When using glibc 2 on Linux we must always use vtable thunks.
-CXXFLAGS_FOR_TARGET = $(CXXFLAGS) -fvtable-thunks -D_GNU_SOURCE
+CXXFLAGS_FOR_TARGET = $(CXXFLAGS) -D_GNU_SOURCE
diff --git a/configure b/configure
index ec87e327fc9..54037b37fba 100755
--- a/configure
+++ b/configure
@@ -3,7 +3,7 @@
### WARNING: this file contains embedded tabs. Do not run untabify on this file.
# Configuration script
-# Copyright (C) 1988, 90, 91, 92, 93, 94, 95, 96, 97, 98, 1999
+# Copyright (C) 1988, 90, 91, 92, 93, 94, 95, 96, 97, 98, 1999, 2000, 2001
# Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
@@ -89,7 +89,7 @@ subdirs=
target_alias=NOTARGET
target_makefile_frag=
undefs=NOUNDEFS
-version="$Revision: 1.33 $"
+version="$Revision: 1.34.2.1 $"
x11=default
bindir='${exec_prefix}/bin'
sbindir='${exec_prefix}/sbin'
@@ -663,13 +663,15 @@ case "${TMPDIR}" in
esac
# keep this filename short for &%*%$*# 14 char file names and 8+3 file names
-tmpfile=${TMPDIR}/cNf$$
+tmpdir=${TMPDIR}/cNf$$
+mkdir ${tmpdir} || exit 1
+tmpfile=${tmpdir}/cNf$$
# Note that under many versions of sh a trap handler for 0 will *override* any
# exit status you explicitly specify! At this point, the only non-error exit
# is at the end of the script; these actions are duplicated there, minus
# the "exit 1". Don't use "exit 0" anywhere after this without resetting the
# trap handler, or you'll lose.
-trap "rm -f Makefile.tem ${tmpfile}.com ${tmpfile}.tgt ${tmpfile}.hst ${tmpfile}.pos; exit 1" 0 1 2 15
+trap "rm -rf Makefile.tem ${tmpdir}; exit 1" 0 1 2 15
# split ${srcdir}/configure.in into common, per-host, per-target,
# and post-target parts. Post-target is optional.
@@ -696,7 +698,7 @@ if test -f skip-this-dir; then
# Perform the same cleanup as the trap handler, minus the "exit 1" of course,
# and reset the trap handler.
trap 0
- rm -f Makefile* ${tmpfile}.com ${tmpfile}.tgt ${tmpfile}.hst ${tmpfile}.pos
+ rm -rf Makefile* ${tmpdir}
# Execute the final clean-up actions
${config_shell} skip-this-dir
# and stop configuring this directory.
@@ -914,7 +916,7 @@ if [ "${build}" != "${host}" ]; then
# are not the same, we set reasonable default values for the tools.
tools="AR AR_FOR_TARGET AS AS_FOR_TARGET BISON CC_FOR_BUILD"
- tools="${tools} CC_FOR_TARGET CXX_FOR_TARGET"
+ tools="${tools} CC_FOR_TARGET CXX_FOR_TARGET GCJ_FOR_TARGET"
tools="${tools} DLLTOOL DLLTOOL_FOR_TARGET GCC_FOR_TARGET HOST_PREFIX"
tools="${tools} HOST_PREFIX_1 LD LD_FOR_TARGET LEX MAKEINFO NM"
tools="${tools} NM_FOR_TARGET RANLIB RANLIB_FOR_TARGET"
@@ -949,6 +951,7 @@ t loop
CC_FOR_BUILD=${CC_FOR_BUILD-gcc}
CC_FOR_TARGET=${CC_FOR_TARGET-${target_alias}-gcc}
CXX_FOR_TARGET=${CXX_FOR_TARGET-${target_alias}-c++}
+ GCJ_FOR_TARGET=${GCJ_FOR_TARGET-${target_alias}-gcj}
DLLTOOL=${DLLTOOL-${host_alias}-dlltool}
DLLTOOL_FOR_TARGET=${DLLTOOL_FOR_TARGET-${target_alias}-dlltool}
GCC_FOR_TARGET=${GCC_FOR_TARGET-${CC_FOR_TARGET-${target_alias}-gcc}}
@@ -1599,7 +1602,7 @@ fi
# Perform the same cleanup as the trap handler, minus the "exit 1" of course,
# and reset the trap handler.
-rm -f ${tmpfile}.com ${tmpfile}.tgt ${tmpfile}.hst ${tmpfile}.pos
+rm -rf ${tmpdir}
trap 0
exit 0
diff --git a/configure.in b/configure.in
index 1b8d95ffdee..816a93d2b57 100644
--- a/configure.in
+++ b/configure.in
@@ -15,7 +15,7 @@
## for 'Autoconf' (autoconf.texi) and 'Configure' (configure.texi).
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998,
-# 1999, 2000 Free Software Foundation, Inc.
+# 1999, 2000, 2001 Free Software Foundation, Inc.
#
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@@ -50,7 +50,7 @@ fi
libstdcxx_version="target-libstdc++-v3"
# Don't use libstdc++-v3's flags to configure/build itself.
-libstdcxx_flags='`case $$dir in libstdc++-v3) ;; *) cat $$r/$(TARGET_SUBDIR)/libstdc++-v3/src/libstdc++.INC 2>/dev/null || : ;; esac` -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs'
+libstdcxx_flags='`case $$dir in libstdc++-v3) ;; *) test ! -f $$r/$(TARGET_SUBDIR)/libstdc++-v3/testsuite_flags || $(SHELL) $$r/$(TARGET_SUBDIR)/libstdc++-v3/testsuite_flags --build-includes;; esac` -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs'
# these tools are built for the host environment
# Note, the powerpc-eabi build depends on sim occurring before gdb in order to
@@ -72,9 +72,7 @@ target_libs="target-libiberty \
target-newlib \
target-librx \
${libstdcxx_version} \
- target-libg++ \
target-libf2c \
- target-libchill \
${libgcj}
target-libobjc"
@@ -349,9 +347,6 @@ fi
# per-target:
case "${target}" in
- *-*-chorusos)
- noconfigdirs="$noconfigdirs target-newlib target-libgloss"
- ;;
v810*)
target_makefile_frag="${target_makefile_frag} config/mt-v810"
;;
@@ -589,9 +584,28 @@ case "${host}" in
;;
esac
+# Save it here so that, even in case of --enable-libgcj, if the Java
+# front-end isn't enabled, we still get libgcj disabled.
+libgcj_saved=$libgcj
+case $enable_libgcj in
+yes)
+ # If we reset it here, it won't get added to noconfigdirs in the
+ # target-specific build rules, so it will be forcibly enabled
+ # (unless the Java language itself isn't enabled).
+ libgcj=
+ ;;
+no)
+ # Make sure we get it printed in the list of not supported target libs.
+ noconfigdirs="$noconfigdirs ${libgcj}"
+ ;;
+esac
+
case "${target}" in
+ *-*-chorusos)
+ noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
+ ;;
*-*-netware)
- noconfigdirs="$noconfigdirs target-libg++ ${libstdcxx_version} target-librx target-newlib target-libiberty target-libgloss ${libgcj}"
+ noconfigdirs="$noconfigdirs ${libstdcxx_version} target-librx target-newlib target-libiberty target-libgloss ${libgcj}"
;;
*-*-rtems*)
noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
@@ -655,7 +669,7 @@ case "${target}" in
noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
;;
c4x-*-*)
- noconfigdirs="$noconfigdirs target-libg++ ${libstdcxx_version} target-librx target-libgloss ${libgcj}"
+ noconfigdirs="$noconfigdirs ${libstdcxx_version} target-librx target-libgloss ${libgcj}"
;;
c54x*-*-* | tic54x-*-*)
noconfigdirs="$noconfigdirs ${libstdcxx_version} target-libgloss ${libgcj} gcc gdb newlib"
@@ -700,26 +714,26 @@ case "${target}" in
noconfigdirs="$noconfigdirs ld target-libgloss ${libgcj}"
;;
d10v-*-*)
- noconfigdirs="$noconfigdirs target-librx target-libg++ ${libstdcxx_version} target-libgloss ${libgcj}"
+ noconfigdirs="$noconfigdirs target-librx ${libstdcxx_version} target-libgloss ${libgcj}"
;;
d30v-*-*)
- noconfigdirs="${libgcj}"
+ noconfigdirs="$noconfigdirs ${libgcj}"
;;
fr30-*-elf*)
- noconfigdirs="${libgcj}"
+ noconfigdirs="$noconfigdirs ${libgcj}"
if [ x${is_cross_compiler} != xno ] ; then
target_configdirs="${target_configdirs} target-bsp target-libstub target-cygmon"
fi
;;
h8300*-*-* | \
h8500-*-*)
- noconfigdirs="$noconfigdirs target-libg++ ${libstdcxx_version} target-librx target-libgloss ${libgcj}"
+ noconfigdirs="$noconfigdirs ${libstdcxx_version} target-librx target-libgloss ${libgcj}"
;;
hppa*-*-*elf* | \
hppa*-*-linux* | \
hppa*-*-lites* | \
hppa*64*-*-*)
- noconfigdirs="${libgcj}"
+ noconfigdirs="$noconfigdirs ${libgcj}"
# Do configure ld/binutils/gas for this case.
;;
hppa*-*-*)
@@ -730,25 +744,33 @@ case "${target}" in
"" | cc*) noconfigdirs="$noconfigdirs emacs emacs19" ;;
*) ;;
esac
- noconfigdirs="$noconfigdirs ld shellutils"
+ # According to Alexandre Oliva <aoliva@redhat.com>, libjava won't
+ # build on HP-UX 10.20.
+ noconfigdirs="$noconfigdirs ld shellutils ${libgcj}"
;;
ia64*-*-elf*)
# No gdb support yet.
noconfigdirs="$noconfigdirs tix readline mmalloc libgui itcl gdb"
;;
i[3456]86-*-coff | i[3456]86-*-elf)
- noconfigdirs="${libgcj}"
+ noconfigdirs="$noconfigdirs ${libgcj}"
if [ x${is_cross_compiler} != xno ] ; then
target_configdirs="${target_configdirs} target-libstub target-cygmon"
fi
;;
+ s390*-*-linux*)
+ # linux has rx in libc
+ skipdirs="$skipdirs target-librx"
+ # The libffi port is not yet in the GCC tree, boehm-gc does not work.
+ noconfigdirs="$noconfigdirs ${libgcj}"
+ ;;
*-*-linux*)
# linux has rx in libc
skipdirs="$skipdirs target-librx"
;;
i[3456]86-*-mingw32*)
target_configdirs="$target_configdirs target-mingw"
- noconfigdirs="$noconfigdirs expect target-libgloss"
+ noconfigdirs="$noconfigdirs expect target-libgloss ${libgcj}"
# Can't build gdb for mingw32 if not native.
case "${host}" in
@@ -759,7 +781,7 @@ case "${target}" in
;;
*-*-cygwin*)
target_configdirs="$target_configdirs target-libtermcap target-winsup"
- noconfigdirs="$noconfigdirs target-gperf target-libgloss"
+ noconfigdirs="$noconfigdirs target-gperf target-libgloss ${libgcj}"
# always build newlib.
skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'`
@@ -771,7 +793,7 @@ case "${target}" in
esac
;;
i[3456]86-*-pe)
- noconfigdirs="$noconfigdirs target-libg++ ${libstdcxx_version} target-librx target-libgloss ${libgcj}"
+ noconfigdirs="$noconfigdirs ${libstdcxx_version} target-librx target-libgloss ${libgcj}"
;;
i[3456]86-*-sco3.2v5*)
# The linker does not yet know about weak symbols in COFF,
@@ -794,16 +816,19 @@ case "${target}" in
noconfigdirs="$noconfigdirs emacs emacs19 target-libgloss ${libgcj}"
;;
i[3456]86-*-beos*)
- noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss"
+ noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss ${libgcj}"
;;
+ m68hc11-*-*|m6811-*-*|m68hc12-*-*|m6812-*-*)
+ noconfigdirs="$noconfigdirs target-libiberty ${libstdcxx_version} ${libgcj}"
+ ;;
m68k-*-elf*)
- noconfigdirs="${libgcj}"
+ noconfigdirs="$noconfigdirs ${libgcj}"
if [ x${is_cross_compiler} != xno ] ; then
target_configdirs="${target_configdirs} target-bsp target-cygmon"
fi
;;
m68k-*-coff*)
- noconfigdirs="${libgcj}"
+ noconfigdirs="$noconfigdirs ${libgcj}"
if [ x${is_cross_compiler} != xno ] ; then
target_configdirs="${target_configdirs} target-bsp target-cygmon"
fi
@@ -843,7 +868,7 @@ case "${target}" in
noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss ${libgcj}"
;;
powerpc-*-eabi)
- noconfigdirs="${libgcj}"
+ noconfigdirs="$noconfigdirs ${libgcj}"
if [ x${is_cross_compiler} != xno ] ; then
target_configdirs="${target_configdirs} target-bsp target-libstub target-cygmon"
fi
@@ -874,7 +899,11 @@ case "${target}" in
mips*-*-irix6*)
# The GNU assembler does not support IRIX 6.
# emacs is emacs 18, which does not work on Irix 5 (emacs19 does work)
- noconfigdirs="$noconfigdirs gas gprof emacs target-libgloss"
+ # Linking libjava exceeds command-line length limits on at least
+ # IRIX 6.2, but not on IRIX 6.5.
+ # Also, boehm-gc won't build on IRIX 6.5, according to Jeffrey Oldham
+ # <oldham@codesourcery.com>
+ noconfigdirs="$noconfigdirs gas gprof emacs target-libgloss ${libgcj}"
;;
mips*-dec-bsd*)
noconfigdirs="$noconfigdirs gprof target-libgloss ${libgcj}"
@@ -915,10 +944,10 @@ case "${target}" in
if [ x${is_cross_compiler} != xno ] ; then
target_configdirs="${target_configdirs} target-bsp target-libstub target-cygmon"
fi
- noconfigdirs="${libgcj}"
+ noconfigdirs="$noconfigdirs ${libgcj}"
;;
sparc-*-sunos4*)
- noconfigdirs="${libgcj}"
+ noconfigdirs="$noconfigdirs ${libgcj}"
if [ x${is_cross_compiler} != xno ] ; then
noconfigdirs="$noconfigdirs gdb gdbtest target-newlib target-libgloss"
else
@@ -926,9 +955,18 @@ case "${target}" in
fi
;;
sparc-*-solaris*)
+ case "${host}" in
+ sparc-*-solaris2.8)
+ # According to Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>, libjava
+ # won't build correctly on Solaris 8 if there's a
+ # previously-installed version of GCC in the configured prefix.
+ # This problem does not show up on earlier versions of Solaris.
+ noconfigdirs="$noconfigdirs ${libgcj}"
+ ;;
+ esac
;;
v810-*-*)
- noconfigdirs="$noconfigdirs bfd binutils gas gcc gdb ld target-libg++ ${libstdcxx_version} opcodes target-libgloss ${libgcj}"
+ noconfigdirs="$noconfigdirs bfd binutils gas gcc gdb ld ${libstdcxx_version} opcodes target-libgloss ${libgcj}"
;;
v850-*-*)
noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
@@ -952,10 +990,10 @@ case "${target}" in
*-*-mpw*)
# Macs want a resource compiler.
configdirs="$configdirs grez"
- noconfigdirs="${libgcj}"
+ noconfigdirs="$noconfigdirs ${libgcj}"
;;
*-*-*)
- noconfigdirs="${libgcj}"
+ noconfigdirs="$noconfigdirs ${libgcj}"
;;
esac
@@ -994,6 +1032,39 @@ else
exit 1
fi
fi
+
+# 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
+ ..)
+ ;;
+ # 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
+ case ,${enable_languages}, in
+ *,$other,*)
+ ;;
+ *,all,*)
+ ;;
+ *,$lang_alias,*)
+ echo " \`$other' language required by \`$lang_alias'; enabling" 1>&2
+ enable_languages="$enable_languages,$other"
+ ;;
+ esac
+ done
+ ;;
+ esac
+done
+
subdirs=
for lang in ${srcdir}/gcc/*/config-lang.in ..
do
@@ -1027,7 +1098,6 @@ do
esac
done
-
# Remove the entries in $skipdirs and $noconfigdirs from $configdirs and
# $target_configdirs.
# If we have the source for $noconfigdirs entries, add them to $notsupp.
@@ -1292,7 +1362,7 @@ fi
# provide a proper gxx_include_dir.
# Note, if you change the default, make sure to fix both here and in
-# the gcc, libio, libstdc++ and libg++ subdirectories.
+# the gcc and libstdc++-v3 subdirectories.
# Check whether --with-gxx-include-dir or --without-gxx-include-dir was given.
gxx_include_dir=
if test -n "${with_gxx_include_dir}"; then
@@ -1412,10 +1482,20 @@ case $CHILL_FOR_TARGET in
*) CHILL_FOR_TARGET=$CHILL_FOR_TARGET' $(FLAGS_FOR_TARGET)' ;;
esac
+if test "x${GCJ_FOR_TARGET+set}" = xset; then
+ :
+elif test -d ${topsrcdir}/gcc; then
+ GCJ_FOR_TARGET='$$r/gcc/gcj -B$$r/gcc/'
+elif test "$host" = "$target"; then
+ GCJ_FOR_TARGET='gcj'
+else
+ GCJ_FOR_TARGET=`echo gcj | sed -e 's/x/x/' ${program_transform_name}`
+fi
+
if test "x${CXX_FOR_TARGET+set}" = xset; then
:
elif test -d ${topsrcdir}/gcc; then
- CXX_FOR_TARGET='$$r/gcc/g++ -B$$r/gcc/ -nostdinc++ '$libstdcxx_flags
+ CXX_FOR_TARGET='$$r/gcc/`case $$dir in libstdc++-v3) echo xgcc ;; *) echo g++ ;; esac` -B$$r/gcc/ -nostdinc++ '$libstdcxx_flags
elif test "$host" = "$target"; then
CXX_FOR_TARGET='$(CXX)'
else
@@ -1425,7 +1505,15 @@ case $CXX_FOR_TARGET in
*' $(FLAGS_FOR_TARGET)') ;;
*) CXX_FOR_TARGET=$CXX_FOR_TARGET' $(FLAGS_FOR_TARGET)' ;;
esac
-qCXX_FOR_TARGET=`echo "$CXX_FOR_TARGET" | sed 's,&,\\\&,g'`
+qCXX_FOR_TARGET=`echo "$CXX_FOR_TARGET" | sed 's,[&%],\\\&,g'`
+
+# We want to defer the evaluation of `cmd`s and shell variables in
+# CXX_FOR_TARGET when recursing in the top-level Makefile, such as for
+# bootstrap. We'll enclose CXX_FOR_TARGET_FOR_RECURSIVE_MAKE in single
+# quotes, but we still have to duplicate `$'s so that shell variables
+# can be expanded by the nested make as shell variables, not as make
+# macros.
+qqCXX_FOR_TARGET=`echo "$qCXX_FOR_TARGET" | sed -e 's,[$][$],$$$$,g'`
targargs="--cache-file=../config.cache --host=${target_alias} --build=${build_alias} ${targargs}"
sed -e "s:^TARGET_CONFIGDIRS[ ]*=.*$:TARGET_CONFIGDIRS = ${target_configdirs}:" \
@@ -1433,7 +1521,9 @@ sed -e "s:^TARGET_CONFIGDIRS[ ]*=.*$:TARGET_CONFIGDIRS = ${target_configdirs}:"
-e "s%^FLAGS_FOR_TARGET[ ]*=.*$%FLAGS_FOR_TARGET = ${FLAGS_FOR_TARGET}%" \
-e "s%^CC_FOR_TARGET[ ]*=.*$%CC_FOR_TARGET = ${CC_FOR_TARGET}%" \
-e "s%^CHILL_FOR_TARGET[ ]*=.*$%CHILL_FOR_TARGET = ${CHILL_FOR_TARGET}%" \
+ -e "s%^GCJ_FOR_TARGET[ ]*=.*$%GCJ_FOR_TARGET = ${GCJ_FOR_TARGET}%" \
-e "s%^CXX_FOR_TARGET[ ]*=.*$%CXX_FOR_TARGET = ${qCXX_FOR_TARGET}%" \
+ -e "s%^CXX_FOR_TARGET_FOR_RECURSIVE_MAKE[ ]*=.*$%CXX_FOR_TARGET_FOR_RECURSIVE_MAKE = ${qqCXX_FOR_TARGET}%" \
-e "s%^TARGET_SUBDIR[ ]*=.*$%TARGET_SUBDIR = ${target_subdir}%" \
-e "s%^gxx_include_dir[ ]*=.*$%gxx_include_dir=${gxx_include_dir}%" \
Makefile > Makefile.tem
diff --git a/contrib/ChangeLog b/contrib/ChangeLog
index 9ed5e31b0e3..9112eed4468 100644
--- a/contrib/ChangeLog
+++ b/contrib/ChangeLog
@@ -1,3 +1,186 @@
+2002-02-20 Release Manager
+
+ * GCC 3.0.4 Released.
+
+2002-02-20 Release Manager
+
+ * GCC 3.0.4 Released.
+
+2002-02-03 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
+
+ * PR3145.patch: Update.
+
+2002-01-26 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
+
+ * gennews (files): Replace gcc-2.95/gcc-2.95.html,
+ gcc-2.95/gcc-2.95.1.html, gcc-2.95/gcc-2.95.2.html,
+ and gcc-2.95/gcc-2.95.3.html by gcc-2.95/index.html.
+
+2002-01-16 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
+
+ * gennews (files): Replace egcs-1.1/egcs-1.1.2.html,
+ egcs-1.1/egcs-1.1.1.html, and egcs-1.1/egcs-1.1.html by
+ egcs-1.1/index.html.
+
+2001-12-20 Release Manager
+
+ * GCC 3.0.3 Released.
+
+2001-12-10 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
+
+ * PR3145.patch: Update.
+
+2001-12-01 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
+
+ * PR3145.patch: Backported bugfix.
+
+2001-11-18 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * gcc_update (files_and_dependencies): Add the new *.7 man pages.
+
+2001-11-14 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * texi2pod.pl: Handle @ifnottex, @iftex and @display. Handle @var
+ in verbatim blocks specially. Handle @unnumbered, @unnumberedsec
+ and @center. Allow [a-z] after @enumerate. Handle 0 and numbers
+ greater than 9 in enumerations.
+
+2001-10-23 Release Manager
+
+ * GCC 3.0.2 Released.
+
+2001-08-24 Mark Mitchell <mark@codesourcery.com>
+
+ * gcc_release: Correct quoting.
+
+2001-08-19 Release Manager
+
+ * GCC 3.0.1 Released.
+
+2001-08-19 Release Manager
+
+ * GCC 3.0.1 Released.
+
+2001-08-13 Mark Mitchell <mark@codesourcery.com>
+
+ * gcc_release: Remove restriction against minor revisions.
+
+2001-07-28 Richard Henderson <rth@redhat.com>
+
+ * test_summary: Copy LAST_UPDATED UTC time to head of summary.
+ * gcc_update: Dump timestamp in LAST_UPDATED.
+
+2001-07-03 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * texi2pod.pl: Handle @r inside @item.
+
+2001-06-21 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * gcc_release: Add another space to ChangeLog headers. Use tab to
+ indent ChangeLog message. Update release status in Fortran
+ version files.
+
+2001-06-18 Mark Mitchell <mark@codesourcery.com>
+
+ * gcc_release (build_sources): Fix dates generated
+ for ChangeLogs.
+
+ * gcc_release: Add support for modifying ChangeLogs and
+ updating versions.
+
+20010617 Release Manager
+
+ * GCC 3.0 Released.
+
+2001-06-14 Albert Chin-A-Young <china@thewrittenword.com>
+
+ * contrib/gcc_update: Fix timestamp on gcc/f/intdoc.texi.
+
+2001-06-14 Mark Mitchell <mark@codesourcery.com>
+ Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
+
+ * gcc_release (build_sources): Generate more files from
+ web documents.
+ (CVS): Use compression everywhere.
+
+2001-06-14 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
+
+ * gcc_release (build_sources): Obtain some documentation files
+ from the wwwdocs module.
+
+2001-06-13 Mark Mitchell <mark@codesourcery.com>
+
+ * gcc_release (-b): Remove option.
+ (build_sources): Generate NEWS files.
+ (build_tarfiles): Set permissions on directories and files.
+ Always generate BZIP2 files.
+ * gennews: Set TERM to vt100 for Lynx.
+
+2001-06-13 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
+
+ * gcc_release (build_sources): Generate documentation in HTML from
+ gcc/doc/install.texi.
+
+2001-06-13 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
+
+ * release: Remove.
+
+2001-06-11 Mark Mitchell <mark@codesourcery.com>
+
+ * gcc_build: Output information about the commands used to
+ configure the compiler.
+
+2001-06-09 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * gcc_update: Update for move of documentation to gcc/doc.
+
+2001-06-07 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * gennews: Update for GCC 3.0.
+
+2001-06-07 Nathan Sidwell <nathan@codesourcery.com>
+
+ * gcc_release: Tweaks for solaris /bin/sh.
+
+2001-06-02 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
+
+ * gcc_release: Fail for unknown modes instead of ignoring them.
+
+2001-05-28 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * contrib/test_summary (files): Sort before evaluating.
+
+2001-05-27 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * gcc_release: Support creating diffs. Support creating .bz2
+ files. Support creating CVS tags. Support creating snapshots
+ without generated files. Move generated .gmo files to the source
+ directory. Update comments. Fix typos.
+
+2001-05-21 Mark Mitchell <mark@codesourcery.com>
+
+ * gcc_build: Use -d when invoking gcc_update.
+
+2001-05-18 Andreas Jaeger <aj@suse.de>
+
+ * gcc_update: Add rules for libf2c/libI77.
+
+2001-05-17 Alexandre Oliva <aoliva@redhat.com>
+
+ * gcc_update (touch_files): Use simpler, yet as portable, syntax.
+
+2001-05-14 Loren J. Rittle <ljrittle@acm.org>
+
+ * gcc_update (touch_files): Enhance make portability.
+
+2001-05-14 Alexandre Oliva <aoliva@redhat.com>
+
+ * gcc_update (touch_files): Use a Makefile to touch files.
+
+2001-05-03 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * texi2pod.pl: Add copyright and GPL notices.
+
2001-01-24 Joseph S. Myers <jsm28@cam.ac.uk>
* texi2pod.pl: Handle "\,".
@@ -153,7 +336,7 @@ Sat Nov 11 17:29:03 2000 Mark P Mitchell <mark@codesourcery.com>
2000-09-28 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
* gcc_update (touch_files): Add some informative output.
-
+
2000-09-16 Andreas Jaeger <aj@suse.de>
* gcc_update: Remove gcc/c-parse.gperf.
diff --git a/contrib/PR3145.patch b/contrib/PR3145.patch
new file mode 100644
index 00000000000..7bcacb35a02
--- /dev/null
+++ b/contrib/PR3145.patch
@@ -0,0 +1,3806 @@
+
+This patch is a quick backport of Nathan Sidwell's patch to fix PR c++/3145,
+the infamous "virtual inheritance" bug. This affected especially KDE2
+(eg. artsd).
+
+Apply in the in GCC's toplevel source dir with:
+
+ patch -p0 <contrib/PR3145.patch
+
+Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
+
+
+
+2001-12-04 Jason Merrill <jason@redhat.com>
+
+ * init.c (resolve_offset_ref): Don't check access for the base
+ conversion to access a FIELD_DECL.
+
+2001-11-22 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR g++/3145
+ * class.c (build_vbase_pointer): Remove.
+ (build_vbase_path): Remove.
+ (build_base_path): New function.
+ * cp-tree.h (base_access, base_kind): New enumerations.
+ (build_base_path): Declare.
+ (convert_pointer_to_real): Remove.
+ (convert_pointer_to): Remove.
+ (lookup_base): Declare.
+ (convert_pointer_to_vbase): Remove.
+ * call.c (build_scoped_method_call): Use lookup_base &
+ build_base_path instead of convert_pointer_to_real,
+ get_base_distance & get_binfo.
+ (build_over_call): Likewise.
+ * cvt.c (cp_convert_to_pointer): Likewise.
+ (convert_to_pointer_force): Likewise.
+ (build_up_reference): Likewise.
+ (convert_pointer_to_real): Remove.
+ (convert_pointer_to): Remove.
+ * init.c (dfs_initialize_vtbl_ptrs): Use build_base_path
+ instead of convert_pointer_to_vbase & build_vbase_path.
+ (emit_base_init): Use build_base_path instead of
+ convert_pointer_to_real.
+ (expand_virtual_init): Lose unrequired conversions.
+ (resolve_offset_ref): Use lookup_base and build_base_path
+ instead of convert_pointer_to.
+ *rtti.c (build_dynamic_cast_1): Use lookup_base &
+ build_base_path instead of get_base_distance & build_vbase_path.
+ *search.c (get_vbase_1): Remove.
+ (get_vbase): Remove.
+ (convert_pointer_to_vbase): Remove.
+ (lookup_base_recursive): New function.
+ (lookup_base): New function.
+ * typeck.c (require_complete_type): Use lookup_base &
+ build_base_path instead of convert_pointer_to.
+ (build_component_ref): Likewise.
+ (build_x_function_call): Likewise.
+ (get_member_function_from_ptrfunc): Likewise.
+ (build_component_addr): Likewise.
+ * typeck2.c (build_scoped_ref): Likewise.
+
+2001-07-31 Nathan Sidwell <nathan@codesourcery.com>
+
+ The 3.0 ABI no longer has vbase pointer fields.
+ * cp-tree.h (VBASE_NAME, VBASE_NAME_FORMAT, VBASE_NAME_P,
+ FORMAT_VBASE_NAME): Remove.
+ * method.c (do_build_copy_constructor): Adjust.
+ (do_build_assign_ref): Adjust.
+ * search.c (lookup_field_r): Adjust.
+ * typeck.c (build_component_ref): Adjust.
+
+ The 3.0 ABI always has a vtable pointer at the start of every
+ polymorphic class.
+ * rtti.c (build_headof_sub): Remove.
+ (build_headof): Adjust.
+ (get_tinfo_decl_dynamic): No need to check flag_rtti
+ here. Adjust.
+ (create_real_tinfo_var): Explain why we need a hidden name.
+
+2001-07-20 Nathan Sidwell <nathan@codesourcery.com>
+
+ Remove flag_vtable_thunk. It is always on for the 3.0 ABI.
+ * cp-tree.h (CPTI_DELTA2_IDENTIFIER): Remove.
+ (CPTI_INDEX_IDENTIFIER): Remove.
+ (CPT_PFN_OR_DELTA2_IDENTIFIER): Remove.
+ (delta2_identifier): Remove.
+ (index_identifier): Remove.
+ (pfn_or_delta2_identifier): Remove.
+ (flag_vtable_thunks): Remove.
+ (VTABLE_DELTA2_NAME): Remove.
+ (VTABLE_INDEX_NAME): Remove.
+ (FNADDR_FROM_VTABLE_ENTRY): Adjust.
+ (vfunc_ptr_type_node): Adjust.
+ (VTABLE_NAME_PREFIX): Adjust.
+ (build_vfn_ref): Lose first parameter.
+ (fixup_all_virtual_upcast_offsets): Remove.
+ * decl.c (initialize_predefined_identifiers): Remove
+ delta2_identifier, index_identifier, pfn_or_delta2_identifier.
+ (init_decl_processing): Remove no-vtable-thunk code.
+ * decl2.c (flag_vtable_thunks): Remove.
+ (mark_vtable_entries): Remove no-vtable-thunk code.
+ * error.c (dump_decl): Remove no-vtable-thunk code.
+ (dump_expr): Adjust ptr to member function code.
+ * init.c (initialize_vtable_ptrs): Remove no-vtable-thunk
+ code.
+ * rtti.c (build_headof): Remove no-vtable-thunk code.
+ (get_tinfo_decl_dynamic): Adjust build_vfn_ref call.
+ * search.c (get_base_distance): Remove expand_upcast_fixups case.
+ (virtual_context) Remove.
+ (expand_upcast_fixups): Remove.
+ (fixup_virtual_upcast_offsets): Remove.
+ (fixup_all_virtual_upcast_offsets): Remove.
+ * typeck.c (get_member_function_from_ptrfunc): Remove
+ no-vtable-thunk code.
+ * call.c (build_over_call): Adjust call to build_vfn_ref.
+ * class.c (build_vfn_ref): Lose first parameter. Remove
+ no-vtable-thunk code.
+ (build_rtti_vtbl_entries): Remove no-vtable-thunk code.
+ (build_vtable_entry): Remove no-vtable-thunk code.
+
+2001-07-20 Nathan Sidwell <nathan@codesourcery.com>
+
+ Remove old-abi remnants. Remove comments about old abi
+ behaviour. Remove refences to 'new-abi' in comments.
+ * cp-tree.h: Adjust comments.
+ (vbase_offsets_in_vtable_p): Delete.
+ (vcall_offsets_in_vtable_p): Delete.
+ (vptrs_present_everywhere_p): Delete.
+ (all_overridden_vfuns_in_vtables_p): Delete.
+ (merge_primary_and_secondary_vtables_p): Delete.
+ (TYPE_CONTAINS_VPTR_P): Adjust.
+ (VTT_NAME_PREFIX): Remove.
+ (CTOR_VTBL_NAME_PREFIX): Remove.
+ (init_vbase_pointers): Remove.
+ * class.c: Adjust coments.
+ (build_vbase_pointer_fields): Delete.
+ (build_vbase_pointer): Remove old-abi code.
+ (build_secondary_vtable): Likewise.
+ (modify_all_vtables): Likewise.
+ (create_vtable_ptr): Likewise.
+ (layout_class_type): Likewise.
+ (finish_struct_1): Likewise.
+ (finish_vtbls): Likewise.
+ (dfs_finish_vtbls): Delete.
+ (build_vbase_offset_vtbl_entries): Remove old-abi code.
+ * cvt.c: Adjust comments.
+ * decl.c: Adjust comments.
+ * decl2.c: Adjust comments.
+ * init.c: Adjust comments.
+ (construct_virtual_bases): Remove old-abi code.
+ * lang-specs.h: Remove -fno-new-abi.
+ * mangle.c: Adjust comments.
+ * rtti.c: Adjust comments.
+ (get_base_offset): Remove old-abi-code.
+ * search.c: Adjust comments.
+ (dfs_init_vbase_pointers): Remove.
+ (dfs_vtable_path_unmark): Remove.
+ (init_vbase_pointers): Remove.
+ * semantics.c: Adjust comments.
+ (emit_associated_thunks): Remove old-abi code.
+ * typeck.c: Adjust comments.
+
+Index: gcc/cp/call.c
+===================================================================
+RCS file: /cvs/gcc/gcc/gcc/cp/call.c,v
+retrieving revision 1.255.2.20
+diff -u -p -r1.255.2.20 call.c
+--- gcc/cp/call.c 2001/11/29 20:16:18 1.255.2.20
++++ gcc/cp/call.c 2002/02/01 22:44:17
+@@ -288,7 +288,7 @@ build_scoped_method_call (exp, basetype,
+
+ if (! binfo)
+ {
+- binfo = get_binfo (basetype, type, 1);
++ binfo = lookup_base (type, basetype, ba_check, NULL);
+ if (binfo == error_mark_node)
+ return error_mark_node;
+ if (! binfo)
+@@ -298,9 +298,12 @@ build_scoped_method_call (exp, basetype,
+ if (binfo)
+ {
+ if (TREE_CODE (exp) == INDIRECT_REF)
+- decl = build_indirect_ref
+- (convert_pointer_to_real
+- (binfo, build_unary_op (ADDR_EXPR, exp, 0)), NULL_PTR);
++ {
++ decl = build_base_path (PLUS_EXPR,
++ build_unary_op (ADDR_EXPR, exp, 0),
++ binfo, 1);
++ decl = build_indirect_ref (decl, NULL);
++ }
+ else
+ decl = build_scoped_ref (exp, basetype);
+
+@@ -4126,7 +4129,9 @@ build_over_call (cand, args, flags)
+ So we can assume that anything passed as 'this' is non-null, and
+ optimize accordingly. */
+ my_friendly_assert (TREE_CODE (parmtype) == POINTER_TYPE, 19990811);
+- t = convert_pointer_to_real (TREE_TYPE (parmtype), TREE_VALUE (arg));
++ t = lookup_base (TREE_TYPE (TREE_TYPE (TREE_VALUE (arg))),
++ TREE_TYPE (parmtype), ba_ignore, NULL);
++ t = build_base_path (PLUS_EXPR, TREE_VALUE (arg), t, 1);
+ converted_args = tree_cons (NULL_TREE, t, converted_args);
+ parm = TREE_CHAIN (parm);
+ arg = TREE_CHAIN (arg);
+@@ -4300,16 +4305,19 @@ build_over_call (cand, args, flags)
+ if (DECL_VINDEX (fn) && (flags & LOOKUP_NONVIRTUAL) == 0)
+ {
+ tree t, *p = &TREE_VALUE (converted_args);
+- tree binfo = get_binfo
+- (DECL_VIRTUAL_CONTEXT (fn), TREE_TYPE (TREE_TYPE (*p)), 0);
+- *p = convert_pointer_to_real (binfo, *p);
++ tree binfo = lookup_base (TREE_TYPE (TREE_TYPE (*p)),
++ DECL_VIRTUAL_CONTEXT (fn),
++ ba_any, NULL);
++ my_friendly_assert (binfo && binfo != error_mark_node, 20010730);
++
++ *p = build_base_path (PLUS_EXPR, *p, binfo, 1);
+ if (TREE_SIDE_EFFECTS (*p))
+ *p = save_expr (*p);
+ t = build_pointer_type (TREE_TYPE (fn));
+ if (DECL_CONTEXT (fn) && TYPE_JAVA_INTERFACE (DECL_CONTEXT (fn)))
+ fn = build_java_interface_fn_ref (fn, *p);
+ else
+- fn = build_vfn_ref (p, build_indirect_ref (*p, 0), DECL_VINDEX (fn));
++ fn = build_vfn_ref (build_indirect_ref (*p, 0), DECL_VINDEX (fn));
+ TREE_TYPE (fn) = t;
+ }
+ else if (DECL_INLINE (fn))
+Index: gcc/cp/class.c
+===================================================================
+RCS file: /cvs/gcc/gcc/gcc/cp/class.c,v
+retrieving revision 1.358.2.40
+diff -u -p -r1.358.2.40 class.c
+--- gcc/cp/class.c 2002/01/03 11:39:44 1.358.2.40
++++ gcc/cp/class.c 2002/02/01 22:44:24
+@@ -106,13 +106,11 @@ varray_type local_classes;
+
+ static tree get_vfield_name PARAMS ((tree));
+ static void finish_struct_anon PARAMS ((tree));
+-static tree build_vbase_pointer PARAMS ((tree, tree));
+ static tree build_vtable_entry PARAMS ((tree, tree, tree));
+ static tree get_vtable_name PARAMS ((tree));
+ static tree get_basefndecls PARAMS ((tree, tree));
+ static int build_primary_vtable PARAMS ((tree, tree));
+ static int build_secondary_vtable PARAMS ((tree, tree));
+-static tree dfs_finish_vtbls PARAMS ((tree, void *));
+ static void finish_vtbls PARAMS ((tree));
+ static void modify_vtable_entry PARAMS ((tree, tree, tree, tree, tree *));
+ static void add_virtual_function PARAMS ((tree *, tree *, int *, tree, tree));
+@@ -146,7 +144,6 @@ static bool build_base_field PARAMS ((re
+ splay_tree, tree));
+ static bool build_base_fields PARAMS ((record_layout_info, int *,
+ splay_tree, tree));
+-static tree build_vbase_pointer_fields PARAMS ((record_layout_info, int *));
+ static tree build_vtbl_or_vbase_field PARAMS ((tree, tree, tree, tree, tree,
+ int *));
+ static void check_methods PARAMS ((tree));
+@@ -237,277 +234,122 @@ int n_build_method_call = 0;
+ int n_inner_fields_searched = 0;
+ #endif
+
+-/* Virtual base class layout. */
++/* Convert to or from a base subobject. EXPR is an expression of type
++ `A' or `A*', an expression of type `B' or `B*' is returned. To
++ convert A to a base B, CODE is PLUS_EXPR and BINFO is the binfo for
++ the B base instance within A. To convert base A to derived B, CODE
++ is MINUS_EXPR and BINFO is the binfo for the A instance within B.
++ In this latter case, A must not be a morally virtual base of B.
++ NONNULL is true if EXPR is known to be non-NULL (this is only
++ needed when EXPR is of pointer type). CV qualifiers are preserved
++ from EXPR. */
+
+-/* Returns a list of virtual base class pointers as a chain of
+- FIELD_DECLS. */
+-
+-static tree
+-build_vbase_pointer_fields (rli, empty_p)
+- record_layout_info rli;
+- int *empty_p;
+-{
+- /* Chain to hold all the new FIELD_DECLs which point at virtual
+- base classes. */
+- tree rec = rli->t;
+- tree vbase_decls = NULL_TREE;
+- tree binfos = TYPE_BINFO_BASETYPES (rec);
+- int n_baseclasses = CLASSTYPE_N_BASECLASSES (rec);
+- tree decl;
+- int i;
+-
+- /* Under the new ABI, there are no vbase pointers in the object.
+- Instead, the offsets are stored in the vtable. */
+- if (vbase_offsets_in_vtable_p ())
+- return NULL_TREE;
+-
+- /* Loop over the baseclasses, adding vbase pointers as needed. */
+- for (i = 0; i < n_baseclasses; i++)
+- {
+- register tree base_binfo = TREE_VEC_ELT (binfos, i);
+- register tree basetype = BINFO_TYPE (base_binfo);
+-
+- if (!COMPLETE_TYPE_P (basetype))
+- /* This error is now reported in xref_tag, thus giving better
+- location information. */
+- continue;
+-
+- /* All basetypes are recorded in the association list of the
+- derived type. */
+-
+- if (TREE_VIA_VIRTUAL (base_binfo))
+- {
+- int j;
+- const char *name;
+-
+- /* The offset for a virtual base class is only used in computing
+- virtual function tables and for initializing virtual base
+- pointers. It is built once `get_vbase_types' is called. */
+-
+- /* If this basetype can come from another vbase pointer
+- without an additional indirection, we will share
+- that pointer. If an indirection is involved, we
+- make our own pointer. */
+- for (j = 0; j < n_baseclasses; j++)
+- {
+- tree other_base_binfo = TREE_VEC_ELT (binfos, j);
+- if (! TREE_VIA_VIRTUAL (other_base_binfo)
+- && binfo_for_vbase (basetype, BINFO_TYPE (other_base_binfo)))
+- goto got_it;
+- }
+- FORMAT_VBASE_NAME (name, basetype);
+- decl = build_vtbl_or_vbase_field (get_identifier (name),
+- get_identifier (VTABLE_BASE),
+- build_pointer_type (basetype),
+- rec,
+- basetype,
+- empty_p);
+- BINFO_VPTR_FIELD (base_binfo) = decl;
+- TREE_CHAIN (decl) = vbase_decls;
+- place_field (rli, decl);
+- vbase_decls = decl;
+- *empty_p = 0;
+-
+- got_it:
+- /* The space this decl occupies has already been accounted for. */
+- ;
+- }
+- }
+-
+- return vbase_decls;
+-}
+-
+-/* Returns a pointer to the virtual base class of EXP that has the
+- indicated TYPE. EXP is of class type, not a pointer type. */
+-
+-static tree
+-build_vbase_pointer (exp, type)
+- tree exp, type;
+-{
+- if (vbase_offsets_in_vtable_p ())
+- {
+- tree vbase;
+- tree vbase_ptr;
+-
+- /* Find the shared copy of TYPE; that's where the vtable offset
+- is recorded. */
+- vbase = binfo_for_vbase (type, TREE_TYPE (exp));
+- /* Find the virtual function table pointer. */
+- vbase_ptr = build_vfield_ref (exp, TREE_TYPE (exp));
+- /* Compute the location where the offset will lie. */
+- vbase_ptr = build (PLUS_EXPR,
+- TREE_TYPE (vbase_ptr),
+- vbase_ptr,
+- BINFO_VPTR_FIELD (vbase));
+- vbase_ptr = build1 (NOP_EXPR,
+- build_pointer_type (ptrdiff_type_node),
+- vbase_ptr);
+- /* Add the contents of this location to EXP. */
+- return build (PLUS_EXPR,
+- build_pointer_type (type),
+- build_unary_op (ADDR_EXPR, exp, /*noconvert=*/0),
+- build1 (INDIRECT_REF, ptrdiff_type_node, vbase_ptr));
+- }
+- else
+- {
+- char *name;
+- FORMAT_VBASE_NAME (name, type);
+- return build_component_ref (exp, get_identifier (name), NULL_TREE, 0);
+- }
+-}
+-
+-/* Build multi-level access to EXPR using hierarchy path PATH.
+- CODE is PLUS_EXPR if we are going with the grain,
+- and MINUS_EXPR if we are not (in which case, we cannot traverse
+- virtual baseclass links).
+-
+- TYPE is the type we want this path to have on exit.
+-
+- NONNULL is non-zero if we know (for any reason) that EXPR is
+- not, in fact, zero. */
+-
+ tree
+-build_vbase_path (code, type, expr, path, nonnull)
++build_base_path (code, expr, binfo, nonnull)
+ enum tree_code code;
+- tree type, expr, path;
++ tree expr;
++ tree binfo;
+ int nonnull;
+ {
+- register int changed = 0;
+- tree last = NULL_TREE, last_virtual = NULL_TREE;
++ tree v_binfo = NULL_TREE;
++ tree t;
++ tree probe;
++ tree offset;
++ tree target_type;
++ tree null_test = NULL;
++ tree ptr_target_type;
+ int fixed_type_p;
+- tree null_expr = 0, nonnull_expr;
+- tree basetype;
+- tree offset = integer_zero_node;
++ int want_pointer = TREE_CODE (TREE_TYPE (expr)) == POINTER_TYPE;
+
+- if (BINFO_INHERITANCE_CHAIN (path) == NULL_TREE)
+- return build1 (NOP_EXPR, type, expr);
++ if (expr == error_mark_node || binfo == error_mark_node || !binfo)
++ return error_mark_node;
++
++ for (probe = binfo; probe;
++ t = probe, probe = BINFO_INHERITANCE_CHAIN (probe))
++ if (!v_binfo && TREE_VIA_VIRTUAL (probe))
++ v_binfo = probe;
++
++ probe = TYPE_MAIN_VARIANT (TREE_TYPE (expr));
++ if (want_pointer)
++ probe = TYPE_MAIN_VARIANT (TREE_TYPE (probe));
++
++ my_friendly_assert (code == MINUS_EXPR
++ ? same_type_p (BINFO_TYPE (binfo), probe)
++ : code == PLUS_EXPR
++ ? same_type_p (BINFO_TYPE (t), probe)
++ : false, 20010723);
++
++ if (code == MINUS_EXPR && v_binfo)
++ {
++ cp_error ("cannot convert from base `%T' to derived type `%T' via virtual base `%T'",
++ BINFO_TYPE (binfo), BINFO_TYPE (t), BINFO_TYPE (v_binfo));
++ return error_mark_node;
++ }
+
+- /* We could do better if we had additional logic to convert back to the
+- unconverted type (the static type of the complete object), and then
+- convert back to the type we want. Until that is done, we only optimize
+- if the complete type is the same type as expr has. */
+ fixed_type_p = resolves_to_fixed_type_p (expr, &nonnull);
+ if (fixed_type_p < 0)
+ /* Virtual base layout is not fixed, even in ctors and dtors. */
+ fixed_type_p = 0;
+-
+ if (!fixed_type_p && TREE_SIDE_EFFECTS (expr))
+ expr = save_expr (expr);
+- nonnull_expr = expr;
+-
+- path = reverse_path (path);
+-
+- basetype = BINFO_TYPE (path);
+-
+- while (path)
++
++ if (!want_pointer)
++ expr = build_unary_op (ADDR_EXPR, expr, 0);
++ else if (!nonnull)
++ null_test = build (EQ_EXPR, boolean_type_node, expr, integer_zero_node);
++
++ offset = BINFO_OFFSET (binfo);
++
++ if (v_binfo && !fixed_type_p)
+ {
+- if (TREE_VIA_VIRTUAL (TREE_VALUE (path)))
+- {
+- last_virtual = BINFO_TYPE (TREE_VALUE (path));
+- if (code == PLUS_EXPR)
+- {
+- changed = ! fixed_type_p;
+-
+- if (changed)
+- {
+- tree ind;
+-
+- /* We already check for ambiguous things in the caller, just
+- find a path. */
+- if (last)
+- {
+- tree binfo = get_binfo (last, TYPE_MAIN_VARIANT (TREE_TYPE (TREE_TYPE (nonnull_expr))), 0);
+- nonnull_expr = convert_pointer_to_real (binfo, nonnull_expr);
+- }
+- ind = build_indirect_ref (nonnull_expr, NULL_PTR);
+- nonnull_expr = build_vbase_pointer (ind, last_virtual);
+- if (nonnull == 0
+- && TREE_CODE (type) == POINTER_TYPE
+- && null_expr == NULL_TREE)
+- {
+- null_expr = build1 (NOP_EXPR, build_pointer_type (last_virtual), integer_zero_node);
+- expr = build (COND_EXPR, build_pointer_type (last_virtual),
+- build (EQ_EXPR, boolean_type_node, expr,
+- integer_zero_node),
+- null_expr, nonnull_expr);
+- }
+- }
+- /* else we'll figure out the offset below. */
++ /* Going via virtual base V_BINFO. We need the static offset
++ from V_BINFO to BINFO, and the dynamic offset from T to
++ V_BINFO. That offset is an entry in T's vtable. */
++ tree v_offset = build_vfield_ref (build_indirect_ref (expr, NULL),
++ TREE_TYPE (TREE_TYPE (expr)));
++
++ v_binfo = binfo_for_vbase (BINFO_TYPE (v_binfo), BINFO_TYPE (t));
++
++ v_offset = build (PLUS_EXPR, TREE_TYPE (v_offset),
++ v_offset, BINFO_VPTR_FIELD (v_binfo));
++ v_offset = build1 (NOP_EXPR,
++ build_pointer_type (ptrdiff_type_node),
++ v_offset);
++ v_offset = build_indirect_ref (v_offset, NULL);
++
++ offset = cp_convert (ptrdiff_type_node,
++ size_diffop (offset, BINFO_OFFSET (v_binfo)));
+
+- /* Happens in the case of parse errors. */
+- if (nonnull_expr == error_mark_node)
+- return error_mark_node;
+- }
+- else
+- {
+- cp_error ("cannot cast up from virtual baseclass `%T'",
+- last_virtual);
+- return error_mark_node;
+- }
+- }
+- last = TREE_VALUE (path);
+- path = TREE_CHAIN (path);
++ if (!integer_zerop (offset))
++ offset = build (code, ptrdiff_type_node, v_offset, offset);
++ else
++ offset = v_offset;
+ }
+- /* LAST is now the last basetype assoc on the path. */
+
+- /* A pointer to a virtual base member of a non-null object
+- is non-null. Therefore, we only need to test for zeroness once.
+- Make EXPR the canonical expression to deal with here. */
+- if (null_expr)
+- {
+- TREE_OPERAND (expr, 2) = nonnull_expr;
+- TREE_TYPE (expr) = TREE_TYPE (TREE_OPERAND (expr, 1))
+- = TREE_TYPE (nonnull_expr);
+- }
+- else
+- expr = nonnull_expr;
++ target_type = code == PLUS_EXPR ? BINFO_TYPE (binfo) : BINFO_TYPE (t);
++
++ target_type = cp_build_qualified_type
++ (target_type, CP_TYPE_QUALS (TREE_TYPE (TREE_TYPE (expr))));
++ ptr_target_type = build_pointer_type (target_type);
++ if (want_pointer)
++ target_type = ptr_target_type;
++
++ expr = build1 (NOP_EXPR, ptr_target_type, expr);
+
+- /* If we go through any virtual base pointers, make sure that
+- casts to BASETYPE from the last virtual base class use
+- the right value for BASETYPE. */
+- if (changed)
+- {
+- tree intype = TREE_TYPE (TREE_TYPE (expr));
+-
+- if (TYPE_MAIN_VARIANT (intype) != BINFO_TYPE (last))
+- offset
+- = BINFO_OFFSET (get_binfo (last, TYPE_MAIN_VARIANT (intype), 0));
+- }
++ if (!integer_zerop (offset))
++ expr = build (code, ptr_target_type, expr, offset);
+ else
+- offset = BINFO_OFFSET (last);
+-
+- if (! integer_zerop (offset))
+- {
+- /* Bash types to make the backend happy. */
+- offset = cp_convert (type, offset);
+-
+- /* If expr might be 0, we need to preserve that zeroness. */
+- if (nonnull == 0)
+- {
+- if (null_expr)
+- TREE_TYPE (null_expr) = type;
+- else
+- null_expr = build1 (NOP_EXPR, type, integer_zero_node);
+- if (TREE_SIDE_EFFECTS (expr))
+- expr = save_expr (expr);
+-
+- return build (COND_EXPR, type,
+- build (EQ_EXPR, boolean_type_node, expr, integer_zero_node),
+- null_expr,
+- build (code, type, expr, offset));
+- }
+- else return build (code, type, expr, offset);
+- }
++ null_test = NULL;
++
++ if (!want_pointer)
++ expr = build_indirect_ref (expr, NULL);
+
+- /* Cannot change the TREE_TYPE of a NOP_EXPR here, since it may
+- be used multiple times in initialization of multiple inheritance. */
+- if (null_expr)
+- {
+- TREE_TYPE (expr) = type;
+- return expr;
+- }
+- else
+- return build1 (NOP_EXPR, type, expr);
++ if (null_test)
++ expr = build (COND_EXPR, target_type, null_test,
++ build1 (NOP_EXPR, target_type, integer_zero_node),
++ expr);
++
++ return expr;
+ }
+
+
+@@ -533,8 +375,6 @@ build_vtable_entry_ref (basetype, vtbl,
+ s = build_tree_list (build_string (1, "s"), s);
+
+ i = build_array_ref (vtbl, idx);
+- if (!flag_vtable_thunks)
+- i = build_component_ref (i, pfn_identifier, vtable_entry_type, 0);
+ i = build_c_cast (ptrdiff_type_node, build_unary_op (ADDR_EXPR, i, 0));
+ i2 = build_array_ref (vtbl, build_int_2(0,0));
+ i2 = build_c_cast (ptrdiff_type_node, build_unary_op (ADDR_EXPR, i2, 0));
+@@ -603,8 +443,8 @@ build_vtbl_ref (instance, idx)
+ {
+ vtbl = TYPE_BINFO_VTABLE (basetype);
+ /* Knowing the dynamic type of INSTANCE we can easily obtain
+- the correct vtable entry. In the new ABI, we resolve
+- this back to be in terms of the primary vtable. */
++ the correct vtable entry. We resolve this back to be in
++ terms of the primary vtable. */
+ if (TREE_CODE (vtbl) == PLUS_EXPR)
+ {
+ idx = fold (build (PLUS_EXPR,
+@@ -632,45 +472,22 @@ build_vtbl_ref (instance, idx)
+ }
+
+ /* Given an object INSTANCE, return an expression which yields the
+- virtual function corresponding to INDEX. There are many special
+- cases for INSTANCE which we take care of here, mainly to avoid
+- creating extra tree nodes when we don't have to. */
++ virtual function corresponding to IDX. */
+
+ tree
+-build_vfn_ref (ptr_to_instptr, instance, idx)
+- tree *ptr_to_instptr, instance;
++build_vfn_ref (instance, idx)
++ tree instance;
+ tree idx;
+ {
+ tree aref = build_vtbl_ref (instance, idx);
+-
+- /* When using thunks, there is no extra delta, and we get the pfn
+- directly. */
+- if (flag_vtable_thunks)
+- {
+- /* When using function descriptors, the address of the
+- vtable entry is treated as a function pointer. */
+- if (TARGET_VTABLE_USES_DESCRIPTORS)
+- return build1 (NOP_EXPR, TREE_TYPE (aref),
+- build_unary_op (ADDR_EXPR, aref, /*noconvert=*/1));
+-
+- return aref;
+- }
+-
+- if (ptr_to_instptr)
+- {
+- /* Save the intermediate result in a SAVE_EXPR so we don't have to
+- compute each component of the virtual function pointer twice. */
+- if (TREE_CODE (aref) == INDIRECT_REF)
+- TREE_OPERAND (aref, 0) = save_expr (TREE_OPERAND (aref, 0));
+
+- *ptr_to_instptr
+- = build (PLUS_EXPR, TREE_TYPE (*ptr_to_instptr),
+- *ptr_to_instptr,
+- cp_convert (ptrdiff_type_node,
+- build_component_ref (aref, delta_identifier, NULL_TREE, 0)));
+- }
++ /* When using function descriptors, the address of the
++ vtable entry is treated as a function pointer. */
++ if (TARGET_VTABLE_USES_DESCRIPTORS)
++ return build1 (NOP_EXPR, TREE_TYPE (aref),
++ build_unary_op (ADDR_EXPR, aref, /*noconvert=*/1));
+
+- return build_component_ref (aref, pfn_identifier, NULL_TREE, 0);
++ return aref;
+ }
+
+ /* Return the name of the virtual function table (as an IDENTIFIER_NODE)
+@@ -826,15 +643,15 @@ build_primary_vtable (binfo, type)
+ return 1;
+ }
+
+-/* Give TYPE a new virtual function table which is initialized
++/* Give BINFO a new virtual function table which is initialized
+ with a skeleton-copy of its original initialization. The only
+ entry that changes is the `delta' entry, so we can really
+ share a lot of structure.
+
+- FOR_TYPE is the derived type which caused this table to
++ FOR_TYPE is the most derived type which caused this table to
+ be needed.
+
+- BINFO is the type association which provided TYPE for FOR_TYPE.
++ Returns non-zero if we haven't met BINFO before.
+
+ The order in which vtables are built (by calling this function) for
+ an object must remain the same, otherwise a binary incompatibility
+@@ -844,143 +661,28 @@ static int
+ build_secondary_vtable (binfo, for_type)
+ tree binfo, for_type;
+ {
+- tree basetype;
+- tree orig_decl = BINFO_VTABLE (binfo);
+- tree name;
+- tree new_decl;
+- tree offset;
+- tree path = binfo;
+- char *buf;
+- const char *buf2;
+- char joiner = '_';
+- int i;
+-
+-#ifdef JOINER
+- joiner = JOINER;
+-#endif
+-
+- if (TREE_VIA_VIRTUAL (binfo))
+- my_friendly_assert (binfo == binfo_for_vbase (BINFO_TYPE (binfo),
+- current_class_type),
+- 170);
++ my_friendly_assert (binfo == CANONICAL_BINFO (binfo, for_type), 20010605);
+
+- if (BINFO_NEW_VTABLE_MARKED (binfo, current_class_type))
++ if (BINFO_NEW_VTABLE_MARKED (binfo, for_type))
+ /* We already created a vtable for this base. There's no need to
+ do it again. */
+ return 0;
+
+ /* Remember that we've created a vtable for this BINFO, so that we
+ don't try to do so again. */
+- SET_BINFO_NEW_VTABLE_MARKED (binfo, current_class_type);
++ SET_BINFO_NEW_VTABLE_MARKED (binfo, for_type);
+
+ /* Make fresh virtual list, so we can smash it later. */
+ BINFO_VIRTUALS (binfo) = copy_virtuals (binfo);
+-
+- my_friendly_assert (binfo == CANONICAL_BINFO (binfo, for_type), 20010605);
+- offset = BINFO_OFFSET (binfo);
+-
+- /* In the new ABI, secondary vtables are laid out as part of the
+- same structure as the primary vtable. */
+- if (merge_primary_and_secondary_vtables_p ())
+- {
+- BINFO_VTABLE (binfo) = NULL_TREE;
+- return 1;
+- }
+-
+- /* Create the declaration for the secondary vtable. */
+- basetype = TYPE_MAIN_VARIANT (BINFO_TYPE (binfo));
+- buf2 = TYPE_ASSEMBLER_NAME_STRING (basetype);
+- i = TYPE_ASSEMBLER_NAME_LENGTH (basetype) + 1;
+-
+- /* We know that the vtable that we are going to create doesn't exist
+- yet in the global namespace, and when we finish, it will be
+- pushed into the global namespace. In complex MI hierarchies, we
+- have to loop while the name we are thinking of adding is globally
+- defined, adding more name components to the vtable name as we
+- loop, until the name is unique. This is because in complex MI
+- cases, we might have the same base more than once. This means
+- that the order in which this function is called for vtables must
+- remain the same, otherwise binary compatibility can be
+- compromised. */
+-
+- while (1)
+- {
+- char *buf1 = (char *) alloca (TYPE_ASSEMBLER_NAME_LENGTH (for_type)
+- + 1 + i);
+- char *new_buf2;
+-
+- sprintf (buf1, "%s%c%s", TYPE_ASSEMBLER_NAME_STRING (for_type), joiner,
+- buf2);
+- buf = (char *) alloca (strlen (VTABLE_NAME_PREFIX) + strlen (buf1) + 1);
+- sprintf (buf, "%s%s", VTABLE_NAME_PREFIX, buf1);
+- name = get_identifier (buf);
+-
+- /* If this name doesn't clash, then we can use it, otherwise
+- we add more to the name until it is unique. */
+-
+- if (! IDENTIFIER_GLOBAL_VALUE (name))
+- break;
+-
+- /* Set values for next loop through, if the name isn't unique. */
+-
+- path = BINFO_INHERITANCE_CHAIN (path);
+-
+- /* We better not run out of stuff to make it unique. */
+- my_friendly_assert (path != NULL_TREE, 368);
+-
+- basetype = TYPE_MAIN_VARIANT (BINFO_TYPE (path));
+-
+- if (for_type == basetype)
+- {
+- /* If we run out of basetypes in the path, we have already
+- found created a vtable with that name before, we now
+- resort to tacking on _%d to distinguish them. */
+- int j = 2;
+- i = TYPE_ASSEMBLER_NAME_LENGTH (basetype) + 1 + i + 1 + 3;
+- buf1 = (char *) alloca (i);
+- do {
+- sprintf (buf1, "%s%c%s%c%d",
+- TYPE_ASSEMBLER_NAME_STRING (basetype), joiner,
+- buf2, joiner, j);
+- buf = (char *) alloca (strlen (VTABLE_NAME_PREFIX)
+- + strlen (buf1) + 1);
+- sprintf (buf, "%s%s", VTABLE_NAME_PREFIX, buf1);
+- name = get_identifier (buf);
+-
+- /* If this name doesn't clash, then we can use it,
+- otherwise we add something different to the name until
+- it is unique. */
+- } while (++j <= 999 && IDENTIFIER_GLOBAL_VALUE (name));
+-
+- /* Hey, they really like MI don't they? Increase the 3
+- above to 6, and the 999 to 999999. :-) */
+- my_friendly_assert (j <= 999, 369);
+-
+- break;
+- }
+
+- i = TYPE_ASSEMBLER_NAME_LENGTH (basetype) + 1 + i;
+- new_buf2 = (char *) alloca (i);
+- sprintf (new_buf2, "%s%c%s",
+- TYPE_ASSEMBLER_NAME_STRING (basetype), joiner, buf2);
+- buf2 = new_buf2;
+- }
+-
+- new_decl = build_vtable (for_type, name, TREE_TYPE (orig_decl));
+- DECL_ALIGN (new_decl) = DECL_ALIGN (orig_decl);
+- DECL_USER_ALIGN (new_decl) = DECL_USER_ALIGN (orig_decl);
+- BINFO_VTABLE (binfo) = pushdecl_top_level (new_decl);
+-
+-#ifdef GATHER_STATISTICS
+- n_vtables += 1;
+- n_vtable_elems += list_length (BINFO_VIRTUALS (binfo));
+-#endif
+-
++ /* Secondary vtables are laid out as part of the same structure as
++ the primary vtable. */
++ BINFO_VTABLE (binfo) = NULL_TREE;
+ return 1;
+ }
+
+ /* Create a new vtable for BINFO which is the hierarchy dominated by
+- T. */
++ T. Return non-zero if we actually created a new vtable. */
+
+ static int
+ make_new_vtable (t, binfo)
+@@ -1965,9 +1667,8 @@ determine_primary_base (t, vfuns_p)
+ if (!CLASSTYPE_HAS_PRIMARY_BASE_P (t))
+ CLASSTYPE_RTTI (t) = CLASSTYPE_RTTI (basetype);
+
+- /* A virtual baseclass can't be the primary base under the
+- old ABI. And under the new ABI we still prefer a
+- non-virtual base. */
++ /* We prefer a non-virtual base, although a virtual one will
++ do. */
+ if (TREE_VIA_VIRTUAL (base_binfo))
+ continue;
+
+@@ -2036,9 +1737,8 @@ determine_primary_base (t, vfuns_p)
+ }
+ }
+
+- /* The new ABI allows for the use of a "nearly-empty" virtual base
+- class as the primary base class if no non-virtual polymorphic
+- base can be found. */
++ /* A "nearly-empty" virtual base class can be the primary base
++ class, if no non-virtual polymorphic base can be found. */
+ if (!CLASSTYPE_HAS_PRIMARY_BASE_P (t))
+ {
+ /* If not NULL, this is the best primary base candidate we have
+@@ -2921,9 +2621,6 @@ dfs_modify_vtables (binfo, data)
+
+ t = (tree) data;
+
+- /* If we're supporting RTTI then we always need a new vtable to
+- point to the RTTI information. Under the new ABI we may need
+- a new vtable to contain vcall and vbase offsets. */
+ make_new_vtable (t, binfo);
+
+ /* Now, go through each of the virtual functions in the virtual
+@@ -2960,10 +2657,9 @@ modify_all_vtables (t, vfuns_p, overridd
+ int *vfuns_p;
+ tree overridden_virtuals;
+ {
+- tree binfo;
++ tree binfo = TYPE_BINFO (t);
++ tree *fnsp;
+
+- binfo = TYPE_BINFO (t);
+-
+ /* Update all of the vtables. */
+ dfs_walk (binfo,
+ dfs_modify_vtables,
+@@ -2971,43 +2667,35 @@ modify_all_vtables (t, vfuns_p, overridd
+ t);
+ dfs_walk (binfo, dfs_unmark, dfs_marked_real_bases_queue_p, t);
+
+- /* If we should include overriding functions for secondary vtables
+- in our primary vtable, add them now. */
+- if (all_overridden_vfuns_in_vtables_p ())
++ /* Include overriding functions for secondary vtables in our primary
++ vtable. */
++ for (fnsp = &overridden_virtuals; *fnsp; )
+ {
+- tree *fnsp = &overridden_virtuals;
++ tree fn = TREE_VALUE (*fnsp);
+
+- while (*fnsp)
++ if (!BINFO_VIRTUALS (binfo)
++ || !value_member (fn, BINFO_VIRTUALS (binfo)))
+ {
+- tree fn = TREE_VALUE (*fnsp);
+-
+- if (!BINFO_VIRTUALS (binfo)
+- || !value_member (fn, BINFO_VIRTUALS (binfo)))
+- {
+- /* Set the vtable index. */
+- set_vindex (fn, vfuns_p);
+- /* We don't need to convert to a base class when calling
+- this function. */
+- DECL_VIRTUAL_CONTEXT (fn) = t;
+-
+- /* We don't need to adjust the `this' pointer when
+- calling this function. */
+- BV_DELTA (*fnsp) = integer_zero_node;
+- BV_VCALL_INDEX (*fnsp) = NULL_TREE;
+-
+- /* This is an overridden function not already in our
+- vtable. Keep it. */
+- fnsp = &TREE_CHAIN (*fnsp);
+- }
+- else
+- /* We've already got an entry for this function. Skip
+- it. */
+- *fnsp = TREE_CHAIN (*fnsp);
++ /* Set the vtable index. */
++ set_vindex (fn, vfuns_p);
++ /* We don't need to convert to a base class when calling
++ this function. */
++ DECL_VIRTUAL_CONTEXT (fn) = t;
++
++ /* We don't need to adjust the `this' pointer when
++ calling this function. */
++ BV_DELTA (*fnsp) = integer_zero_node;
++ BV_VCALL_INDEX (*fnsp) = NULL_TREE;
++
++ /* This is an overridden function not already in our
++ vtable. Keep it. */
++ fnsp = &TREE_CHAIN (*fnsp);
+ }
++ else
++ /* We've already got an entry for this function. Skip it. */
++ *fnsp = TREE_CHAIN (*fnsp);
+ }
+- else
+- overridden_virtuals = NULL_TREE;
+-
++
+ return overridden_virtuals;
+ }
+
+@@ -4222,8 +3910,7 @@ build_base_fields (rli, empty_p, offsets
+ int i;
+ bool atend = 0;
+
+- /* Under the new ABI, the primary base class is always allocated
+- first. */
++ /* The primary base class is always allocated first. */
+ if (CLASSTYPE_HAS_PRIMARY_BASE_P (rec))
+ build_base_field (rli, CLASSTYPE_PRIMARY_BINFO (rec),
+ empty_p, offsets, t);
+@@ -4235,8 +3922,8 @@ build_base_fields (rli, empty_p, offsets
+
+ base_binfo = BINFO_BASETYPE (TYPE_BINFO (rec), i);
+
+- /* Under the new ABI, the primary base was already allocated
+- above, so we don't need to allocate it again here. */
++ /* The primary base was already allocated above, so we don't
++ need to allocate it again here. */
+ if (base_binfo == CLASSTYPE_PRIMARY_BINFO (rec))
+ continue;
+
+@@ -4722,9 +4409,7 @@ create_vtable_ptr (t, empty_p, vfuns_p,
+ here. Even if there weren't any new virtual functions, we might need a
+ new virtual function table if we're supposed to include vptrs in
+ all classes that need them. */
+- if (!TYPE_VFIELD (t)
+- && (*vfuns_p
+- || (TYPE_CONTAINS_VPTR_P (t) && vptrs_present_everywhere_p ())))
++ if (!TYPE_VFIELD (t) && (*vfuns_p || TYPE_CONTAINS_VPTR_P (t)))
+ {
+ /* We build this decl with vtbl_ptr_type_node, which is a
+ `vtable_entry_type*'. It might seem more precise to use
+@@ -4929,10 +4614,8 @@ layout_virtual_bases (t, offsets)
+ TYPE_ALIGN (t) = MAX (TYPE_ALIGN (t), BITS_PER_UNIT);
+
+ /* Go through the virtual bases, allocating space for each virtual
+- base that is not already a primary base class. Under the old
+- ABI, these are allocated according to a depth-first left-to-right
+- postorder traversal; in the new ABI, inheritance graph order is
+- used instead. */
++ base that is not already a primary base class. These are
++ allocated in inheritance graph order. */
+ for (vbases = TYPE_BINFO (t);
+ vbases;
+ vbases = TREE_CHAIN (vbases))
+@@ -4959,8 +4642,8 @@ layout_virtual_bases (t, offsets)
+ appropriately aligned offset. */
+ dsize = CEIL (dsize, desired_align) * desired_align;
+
+- /* Under the new ABI, we try to squish empty virtual bases in
+- just like ordinary empty bases. */
++ /* We try to squish empty virtual bases in just like
++ ordinary empty bases. */
+ if (is_empty_class (basetype))
+ layout_empty_base (vbase,
+ size_int (CEIL (dsize, BITS_PER_UNIT)),
+@@ -5142,8 +4825,7 @@ layout_class_type (t, empty_p, vfuns_p,
+ vptr = create_vtable_ptr (t, empty_p, vfuns_p,
+ new_virtuals_p, overridden_virtuals_p);
+
+- /* Under the new ABI, the vptr is always the first thing in the
+- class. */
++ /* The vptr is always the first thing in the class. */
+ if (vptr)
+ {
+ TYPE_FIELDS (t) = chainon (vptr, TYPE_FIELDS (t));
+@@ -5156,10 +4838,6 @@ layout_class_type (t, empty_p, vfuns_p,
+ if (build_base_fields (rli, empty_p, empty_base_offsets, t))
+ CLASSTYPE_NEARLY_EMPTY_P (t) = 0;
+
+- /* Add pointers to all of our virtual base-classes. */
+- TYPE_FIELDS (t) = chainon (build_vbase_pointer_fields (rli, empty_p),
+- TYPE_FIELDS (t));
+-
+ /* CLASSTYPE_INLINE_FRIENDS is really TYPE_NONCOPIED_PARTS. Thus,
+ we have to save this before we zap TYPE_NONCOPIED_PARTS. */
+ fixup_inline_methods (t);
+@@ -5181,10 +4859,8 @@ layout_class_type (t, empty_p, vfuns_p,
+ type = TREE_TYPE (field);
+
+ /* If this field is a bit-field whose width is greater than its
+- type, then there are some special rules for allocating it
+- under the new ABI. Under the old ABI, there were no special
+- rules, but the back-end can't handle bitfields longer than a
+- `long long', so we use the same mechanism. */
++ type, then there are some special rules for allocating
++ it. */
+ if (DECL_C_BIT_FIELD (field)
+ && INT_CST_LT (TYPE_SIZE (type), DECL_SIZE (field)))
+ {
+@@ -5249,10 +4925,10 @@ layout_class_type (t, empty_p, vfuns_p,
+ }
+
+ /* We make all structures have at least one element, so that they
+- have non-zero size. In the new ABI, the class may be empty even
+- if it has basetypes. Therefore, we add the fake field after all
+- the other fields; if there are already FIELD_DECLs on the list,
+- their offsets will not be disturbed. */
++ have non-zero size. The class may be empty even if it has
++ basetypes. Therefore, we add the fake field after all the other
++ fields; if there are already FIELD_DECLs on the list, their
++ offsets will not be disturbed. */
+ if (!eoc && *empty_p)
+ {
+ tree padding;
+@@ -5413,9 +5089,7 @@ finish_struct_1 (t)
+ = chainon (CLASSTYPE_VFIELDS (t), build_tree_list (NULL_TREE, t));
+
+ /* If necessary, create the primary vtable for this class. */
+- if (new_virtuals
+- || overridden_virtuals
+- || (TYPE_CONTAINS_VPTR_P (t) && vptrs_present_everywhere_p ()))
++ if (new_virtuals || overridden_virtuals || TYPE_CONTAINS_VPTR_P (t))
+ {
+ new_virtuals = nreverse (new_virtuals);
+ /* We must enter these virtuals into the table. */
+@@ -5727,11 +5401,12 @@ fixed_type_or_null (instance, nonnull, c
+ }
+ }
+
+-/* Return non-zero if the dynamic type of INSTANCE is known, and equivalent
+- to the static type. We also handle the case where INSTANCE is really
+- a pointer. Return negative if this is a ctor/dtor. There the dynamic type
+- is known, but this might not be the most derived base of the original object,
+- and hence virtual bases may not be layed out according to this type.
++/* Return non-zero if the dynamic type of INSTANCE is known, and
++ equivalent to the static type. We also handle the case where
++ INSTANCE is really a pointer. Return negative if this is a
++ ctor/dtor. There the dynamic type is known, but this might not be
++ the most derived base of the original object, and hence virtual
++ bases may not be layed out according to this type.
+
+ Used to determine whether the virtual function table is needed
+ or not.
+@@ -6783,10 +6458,9 @@ note_name_declared_in_class (name, decl)
+ }
+ }
+
+-/* Returns the VAR_DECL for the complete vtable associated with
+- BINFO. (Under the new ABI, secondary vtables are merged with
+- primary vtables; this function will return the VAR_DECL for the
+- primary vtable.) */
++/* Returns the VAR_DECL for the complete vtable associated with BINFO.
++ Secondary vtables are merged with primary vtables; this function
++ will return the VAR_DECL for the primary vtable. */
+
+ tree
+ get_vtbl_decl_for_binfo (binfo)
+@@ -7134,77 +6808,47 @@ static void
+ finish_vtbls (t)
+ tree t;
+ {
+- if (merge_primary_and_secondary_vtables_p ())
+- {
+- tree list;
+- tree vbase;
+- int i;
+-
+- /* Under the new ABI, we lay out the primary and secondary
+- vtables in one contiguous vtable. The primary vtable is
+- first, followed by the non-virtual secondary vtables in
+- inheritance graph order. */
+- list = build_tree_list (TYPE_BINFO_VTABLE (t), NULL_TREE);
+- accumulate_vtbl_inits (TYPE_BINFO (t), TYPE_BINFO (t),
+- TYPE_BINFO (t), t, list);
+- /* Then come the virtual bases, also in inheritance graph
+- order. */
+- for (vbase = TYPE_BINFO (t); vbase; vbase = TREE_CHAIN (vbase))
+- {
+- tree real_base;
+-
+- if (!TREE_VIA_VIRTUAL (vbase))
+- continue;
+-
+- /* Although we walk in inheritance order, that might not get the
+- canonical base. */
+- real_base = binfo_for_vbase (BINFO_TYPE (vbase), t);
+-
+- accumulate_vtbl_inits (real_base, real_base,
+- TYPE_BINFO (t), t, list);
+- }
++ tree list;
++ tree vbase;
++ int i;
+
+- /* Fill in BINFO_VPTR_FIELD in the immediate binfos for our virtual
+- base classes, for the benefit of the debugging backends. */
+- for (i = 0; i < BINFO_N_BASETYPES (TYPE_BINFO (t)); ++i)
+- {
+- tree base = BINFO_BASETYPE (TYPE_BINFO (t), i);
+- if (TREE_VIA_VIRTUAL (base))
+- {
+- tree vbase = binfo_for_vbase (BINFO_TYPE (base), t);
+- BINFO_VPTR_FIELD (base) = BINFO_VPTR_FIELD (vbase);
+- }
+- }
++ /* We lay out the primary and secondary vtables in one contiguous
++ vtable. The primary vtable is first, followed by the non-virtual
++ secondary vtables in inheritance graph order. */
++ list = build_tree_list (TYPE_BINFO_VTABLE (t), NULL_TREE);
++ accumulate_vtbl_inits (TYPE_BINFO (t), TYPE_BINFO (t),
++ TYPE_BINFO (t), t, list);
+
+- if (TYPE_BINFO_VTABLE (t))
+- initialize_vtable (TYPE_BINFO (t), TREE_VALUE (list));
+- }
+- else
++ /* Then come the virtual bases, also in inheritance graph order. */
++ for (vbase = TYPE_BINFO (t); vbase; vbase = TREE_CHAIN (vbase))
+ {
+- dfs_walk (TYPE_BINFO (t), dfs_finish_vtbls,
+- dfs_unmarked_real_bases_queue_p, t);
+- dfs_walk (TYPE_BINFO (t), dfs_unmark,
+- dfs_marked_real_bases_queue_p, t);
+- }
+-}
++ tree real_base;
+
+-/* Called from finish_vtbls via dfs_walk. */
++ if (!TREE_VIA_VIRTUAL (vbase))
++ continue;
+
+-static tree
+-dfs_finish_vtbls (binfo, data)
+- tree binfo;
+- void *data;
+-{
+- tree t = (tree) data;
++ /* Although we walk in inheritance order, that might not get the
++ canonical base. */
++ real_base = binfo_for_vbase (BINFO_TYPE (vbase), t);
+
+- if (BINFO_NEW_VTABLE_MARKED (binfo, t))
+- initialize_vtable (binfo,
+- build_vtbl_initializer (binfo, binfo, t,
+- TYPE_BINFO (t), NULL));
++ accumulate_vtbl_inits (real_base, real_base,
++ TYPE_BINFO (t), t, list);
++ }
+
+- SET_BINFO_MARKED (binfo);
++ /* Fill in BINFO_VPTR_FIELD in the immediate binfos for our virtual
++ base classes, for the benefit of the debugging backends. */
++ for (i = 0; i < BINFO_N_BASETYPES (TYPE_BINFO (t)); ++i)
++ {
++ tree base = BINFO_BASETYPE (TYPE_BINFO (t), i);
++ if (TREE_VIA_VIRTUAL (base))
++ {
++ tree vbase = binfo_for_vbase (BINFO_TYPE (base), t);
++ BINFO_VPTR_FIELD (base) = BINFO_VPTR_FIELD (vbase);
++ }
++ }
+
+- return NULL_TREE;
++ if (TYPE_BINFO_VTABLE (t))
++ initialize_vtable (TYPE_BINFO (t), TREE_VALUE (list));
+ }
+
+ /* Initialize the vtable for BINFO with the INITS. */
+@@ -7677,9 +7321,8 @@ accumulate_vtbl_inits (binfo, orig_binfo
+ }
+ }
+
+-/* Called from accumulate_vtbl_inits when using the new ABI.
+- Accumulates the vtable initializers for all of the vtables into
+- TREE_VALUE (DATA). Returns the initializers for the BINFO vtable. */
++/* Called from accumulate_vtbl_inits. Returns the initializers for
++ the BINFO vtable. */
+
+ static tree
+ dfs_accumulate_vtbl_inits (binfo, orig_binfo, rtti_binfo, t, l)
+@@ -7987,11 +7630,6 @@ build_vbase_offset_vtbl_entries (binfo,
+ tree t;
+ tree non_primary_binfo;
+
+- /* Under the old ABI, pointers to virtual bases are stored in each
+- object. */
+- if (!vbase_offsets_in_vtable_p ())
+- return;
+-
+ /* If there are no virtual baseclasses, then there is nothing to
+ do. */
+ if (!TYPE_USES_VIRTUAL_BASECLASSES (BINFO_TYPE (binfo)))
+@@ -8093,11 +7731,6 @@ build_vcall_offset_vtbl_entries (binfo,
+ tree binfo;
+ vtbl_init_data *vid;
+ {
+- /* Under the old ABI, the adjustments to the `this' pointer were made
+- elsewhere. */
+- if (!vcall_offsets_in_vtable_p ())
+- return;
+-
+ /* We only need these entries if this base is a virtual base. */
+ if (!TREE_VIA_VIRTUAL (binfo))
+ return;
+@@ -8352,16 +7985,12 @@ build_rtti_vtbl_entries (binfo, vid)
+ vid->last_init = &TREE_CHAIN (*vid->last_init);
+
+ /* Add the offset-to-top entry. It comes earlier in the vtable that
+- the the typeinfo entry. */
+- if (flag_vtable_thunks)
+- {
+- /* Convert the offset to look like a function pointer, so that
+- we can put it in the vtable. */
+- init = build1 (NOP_EXPR, vfunc_ptr_type_node, offset);
+- TREE_CONSTANT (init) = 1;
+- *vid->last_init = build_tree_list (NULL_TREE, init);
+- vid->last_init = &TREE_CHAIN (*vid->last_init);
+- }
++ the the typeinfo entry. Convert the offset to look like a
++ function pointer, so that we can put it in the vtable. */
++ init = build1 (NOP_EXPR, vfunc_ptr_type_node, offset);
++ TREE_CONSTANT (init) = 1;
++ *vid->last_init = build_tree_list (NULL_TREE, init);
++ vid->last_init = &TREE_CHAIN (*vid->last_init);
+ }
+
+ /* Build an entry in the virtual function table. DELTA is the offset
+@@ -8378,55 +8007,20 @@ build_vtable_entry (delta, vcall_index,
+ tree vcall_index;
+ tree entry;
+ {
+- if (flag_vtable_thunks)
+- {
+- tree fn;
++ tree fn;
+
+- fn = TREE_OPERAND (entry, 0);
+- if ((!integer_zerop (delta) || vcall_index != NULL_TREE)
+- && fn != abort_fndecl
+- && !DECL_TINFO_FN_P (fn))
+- {
+- entry = make_thunk (entry, delta, vcall_index);
+- entry = build1 (ADDR_EXPR, vtable_entry_type, entry);
+- TREE_READONLY (entry) = 1;
+- TREE_CONSTANT (entry) = 1;
+- }
+-#ifdef GATHER_STATISTICS
+- n_vtable_entries += 1;
+-#endif
+- return entry;
+- }
+- else
++ fn = TREE_OPERAND (entry, 0);
++ if ((!integer_zerop (delta) || vcall_index != NULL_TREE)
++ && fn != abort_fndecl
++ && !DECL_TINFO_FN_P (fn))
+ {
+- tree elems = tree_cons (NULL_TREE, delta,
+- tree_cons (NULL_TREE, integer_zero_node,
+- build_tree_list (NULL_TREE, entry)));
+- tree entry = build (CONSTRUCTOR, vtable_entry_type, NULL_TREE, elems);
+-
+- /* We don't use vcall offsets when not using vtable thunks. */
+- my_friendly_assert (vcall_index == NULL_TREE, 20000125);
+-
+- /* DELTA used to be constructed by `size_int' and/or size_binop,
+- which caused overflow problems when it was negative. That should
+- be fixed now. */
+-
+- if (! int_fits_type_p (delta, delta_type_node))
+- {
+- if (flag_huge_objects)
+- sorry ("object size exceeds built-in limit for virtual function table implementation");
+- else
+- sorry ("object size exceeds normal limit for virtual function table implementation, recompile all source and use -fhuge-objects");
+- }
+-
+- TREE_CONSTANT (entry) = 1;
+- TREE_STATIC (entry) = 1;
++ entry = make_thunk (entry, delta, vcall_index);
++ entry = build1 (ADDR_EXPR, vtable_entry_type, entry);
+ TREE_READONLY (entry) = 1;
+-
++ TREE_CONSTANT (entry) = 1;
++ }
+ #ifdef GATHER_STATISTICS
+- n_vtable_entries += 1;
++ n_vtable_entries += 1;
+ #endif
+-
+- return entry;
+- }
++ return entry;
+ }
+Index: gcc/cp/cp-tree.h
+===================================================================
+RCS file: /cvs/gcc/gcc/gcc/cp/cp-tree.h,v
+retrieving revision 1.572.2.36
+diff -u -p -r1.572.2.36 cp-tree.h
+--- gcc/cp/cp-tree.h 2001/12/08 16:12:51 1.572.2.36
++++ gcc/cp/cp-tree.h 2002/02/01 22:44:27
+@@ -135,11 +135,9 @@ Boston, MA 02111-1307, USA. */
+ does not have a BV_FN; it is just an offset.
+
+ BINFO_VTABLE
+- Sometimes this is a VAR_DECL. Under the new ABI, it is instead
+- an expression with POINTER_TYPE pointing that gives the value
++ This is an expression with POINTER_TYPE that gives the value
+ to which the vptr should be initialized. Use get_vtbl_decl_for_binfo
+- to extract the VAR_DECL for the complete vtable; that macro works
+- in both ABIs.
++ to extract the VAR_DECL for the complete vtable.
+
+ DECL_ARGUMENTS
+ For a VAR_DECL this is DECL_ANON_UNION_ELEMS.
+@@ -226,40 +224,6 @@ extern int flag_rtti;
+
+ extern int flag_huge_objects;
+
+-/* Nonzero if virtual base class offsets are stored in the virtual
+- function table. Zero if, instead, a pointer to the virtual base is
+- stored in the object itself. */
+-#define vbase_offsets_in_vtable_p() (1)
+-
+-/* Nonzero if displacements to the `this' pointer to use when calling
+- virtual functions in a virtual base class are present in the
+- vtable. */
+-#define vcall_offsets_in_vtable_p() (1)
+-
+-/* Nonzero if a derived class that needs a vptr should always get one,
+- even if a non-primary base class already has one. For example,
+- given:
+-
+- struct S { int i; virtual void f(); };
+- struct T : virtual public S {};
+-
+- one could either reuse the vptr in `S' for `T', or create a new
+- vptr for `T'. If this flag is nonzero we choose the latter
+- alternative; otherwise, we choose the former. */
+-#define vptrs_present_everywhere_p() (1)
+-
+-/* Nonzero if the vtable for a derived class should contain the
+- virtual functions from the primary base and all virtual functions
+- present in the class itself. Zero if, instead, it should contain
+- only those virtual functions from the primary base together with
+- the functions declared in the derived class (but not in any base
+- class). */
+-#define all_overridden_vfuns_in_vtables_p() (1)
+-
+-/* Nonzero if primary and secondary vtables are combined into a single
+- vtable. */
+-#define merge_primary_and_secondary_vtables_p() (1)
+-
+
+ /* Language-dependent contents of an identifier. */
+
+@@ -601,15 +565,12 @@ enum cp_tree_index
+ CPTI_COMPLETE_DTOR_IDENTIFIER,
+ CPTI_BASE_DTOR_IDENTIFIER,
+ CPTI_DELETING_DTOR_IDENTIFIER,
+- CPTI_DELTA2_IDENTIFIER,
+ CPTI_DELTA_IDENTIFIER,
+ CPTI_IN_CHARGE_IDENTIFIER,
+ CPTI_VTT_PARM_IDENTIFIER,
+- CPTI_INDEX_IDENTIFIER,
+ CPTI_NELTS_IDENTIFIER,
+ CPTI_THIS_IDENTIFIER,
+ CPTI_PFN_IDENTIFIER,
+- CPTI_PFN_OR_DELTA2_IDENTIFIER,
+ CPTI_VPTR_IDENTIFIER,
+ CPTI_STD_IDENTIFIER,
+
+@@ -643,8 +604,7 @@ extern tree cp_global_trees[CPTI_MAX];
+ #define wchar_decl_node cp_global_trees[CPTI_WCHAR_DECL]
+ #define vtable_entry_type cp_global_trees[CPTI_VTABLE_ENTRY_TYPE]
+ /* The type used to represent an offset by which to adjust the `this'
+- pointer in pointer-to-member types and, when not using vtable
+- thunks, in vtables. */
++ pointer in pointer-to-member types. */
+ #define delta_type_node cp_global_trees[CPTI_DELTA_TYPE]
+ /* The type used to represent an index into the vtable. */
+ #define vtable_index_type cp_global_trees[CPTI_VTABLE_INDEX_TYPE]
+@@ -720,20 +680,14 @@ extern tree cp_global_trees[CPTI_MAX];
+ /* The name of a destructor that destroys virtual base classes, and
+ then deletes the entire object. */
+ #define deleting_dtor_identifier cp_global_trees[CPTI_DELETING_DTOR_IDENTIFIER]
+-
+-#define delta2_identifier cp_global_trees[CPTI_DELTA2_IDENTIFIER]
+ #define delta_identifier cp_global_trees[CPTI_DELTA_IDENTIFIER]
+ #define in_charge_identifier cp_global_trees[CPTI_IN_CHARGE_IDENTIFIER]
+-
+ /* The name of the parameter that contains a pointer to the VTT to use
+ for this subobject constructor or destructor. */
+ #define vtt_parm_identifier cp_global_trees[CPTI_VTT_PARM_IDENTIFIER]
+-
+-#define index_identifier cp_global_trees[CPTI_INDEX_IDENTIFIER]
+ #define nelts_identifier cp_global_trees[CPTI_NELTS_IDENTIFIER]
+ #define this_identifier cp_global_trees[CPTI_THIS_IDENTIFIER]
+ #define pfn_identifier cp_global_trees[CPTI_PFN_IDENTIFIER]
+-#define pfn_or_delta2_identifier cp_global_trees[CPTI_PFN_OR_DELTA2_IDENTIFIER]
+ #define vptr_identifier cp_global_trees[CPTI_VPTR_IDENTIFIER]
+ /* The name of the std namespace. */
+ #define std_identifier cp_global_trees[CPTI_STD_IDENTIFIER]
+@@ -1081,11 +1035,6 @@ extern int warn_reorder;
+
+ extern int flag_signed_bitfields;
+
+-/* True for more efficient but incompatible (not fully tested)
+- vtable implementation (using thunks).
+- 0 is old behavior; 1 is new behavior. */
+-extern int flag_vtable_thunks;
+-
+ /* INTERFACE_ONLY nonzero means that we are in an "interface"
+ section of the compiler. INTERFACE_UNKNOWN nonzero means
+ we cannot trust the value of INTERFACE_ONLY. If INTERFACE_UNKNOWN
+@@ -1234,11 +1183,9 @@ enum languages { lang_c, lang_cplusplus,
+ /* Virtual function addresses can be gotten from a virtual function
+ table entry using this macro. */
+ #define FNADDR_FROM_VTABLE_ENTRY(ENTRY) \
+- (!flag_vtable_thunks ? \
+- TREE_VALUE (TREE_CHAIN (TREE_CHAIN (CONSTRUCTOR_ELTS (ENTRY)))) \
+- : !DECL_THUNK_P (TREE_OPERAND ((ENTRY), 0)) \
+- ? (ENTRY) \
+- : DECL_INITIAL (TREE_OPERAND ((ENTRY), 0)))
++ (DECL_THUNK_P (TREE_OPERAND ((ENTRY), 0)) \
++ : DECL_INITIAL (TREE_OPERAND ((ENTRY), 0)) \
++ ? (ENTRY))
+
+ #define FUNCTION_ARG_CHAIN(NODE) \
+ (TREE_CHAIN (TYPE_ARG_TYPES (TREE_TYPE (NODE))))
+@@ -2478,8 +2425,7 @@ struct lang_decl
+ /* Nonzero if this class has a virtual function table pointer. */
+ #define TYPE_CONTAINS_VPTR_P(NODE) \
+ (TYPE_POLYMORPHIC_P (NODE) \
+- || (vbase_offsets_in_vtable_p () \
+- && TYPE_USES_VIRTUAL_BASECLASSES (NODE)))
++ || TYPE_USES_VIRTUAL_BASECLASSES (NODE))
+
+ extern int flag_new_for_scope;
+
+@@ -2634,67 +2580,15 @@ extern int flag_new_for_scope;
+
+ /* A pointer-to-function member type looks like:
+
+- struct {
+- short __delta;
+- short __index;
+- union {
+- P __pfn;
+- short __delta2;
+- } __pfn_or_delta2;
+- };
+-
+- where P is a POINTER_TYPE to a METHOD_TYPE appropriate for the
+- pointer to member. The fields are used as follows:
+-
+- If __INDEX is -1, then the function to call is non-virtual, and
+- is located at the address given by __PFN.
+-
+- If __INDEX is zero, then this a NULL pointer-to-member.
+-
+- Otherwise, the function to call is virtual. Then, __DELTA2 gives
+- the offset from an instance of the object to the virtual function
+- table, and __INDEX - 1 is the index into the vtable to use to
+- find the function.
+-
+- The value to use for the THIS parameter is the address of the
+- object plus __DELTA.
+-
+- For example, given:
+-
+- struct B1 {
+- int i;
+- };
+-
+- struct B2 {
+- double d;
+- void f();
+- };
+-
+- struct S : public B1, B2 {};
+-
+- the pointer-to-member for `&S::f' looks like:
+-
+- { 4, -1, { &f__2B2 } };
+-
+- The `4' means that given an `S*' you have to add 4 bytes to get to
+- the address of the `B2*'. Then, the -1 indicates that this is a
+- non-virtual function. Of course, `&f__2B2' is the name of that
+- function.
+-
+- (Of course, the exact values may differ depending on the mangling
+- scheme, sizes of types, and such.).
+-
+- Under the new ABI, we do:
+-
+ struct {
+ __P __pfn;
+ ptrdiff_t __delta;
+ };
+
+- (We don't need DELTA2, because the vtable is always the first thing
+- in the object.) If the function is virtual, then PFN is one plus
+- twice the index into the vtable; otherwise, it is just a pointer to
+- the function.
++ (As the vtable is always the first thing in the object, we don't
++ need an offset to it.) If the function is virtual, then PFN is one
++ plus twice the index into the vtable; otherwise, it is just a
++ pointer to the function.
+
+ Unfortunately, using the lowest bit of PFN doesn't work in
+ architectures that don't impose alignment requirements on function
+@@ -3201,6 +3095,29 @@ typedef enum instantiate_type_flags {
+ itf_ptrmem_ok = 1 << 2, /* pointers to member ok (internal use) */
+ } instantiate_type_flags;
+
++/* The kind of checking we can do looking in a class heirarchy. */
++typedef enum base_access {
++ ba_any = -2, /* Do not check access, allow an ambiguous base,
++ prefer a non-virtual base */
++ ba_ignore = -1, /* Do not check access */
++ ba_check = 0, /* Check access */
++ ba_not_special /* Do not consider special privilege
++ current_class_type might give. */
++} base_access;
++
++/* The kind of base we can find, looking in a class heirarchy.
++ values <0 indicate we failed. */
++typedef enum base_kind {
++ bk_inaccessible = -3, /* The base is inaccessible */
++ bk_ambig = -2, /* The base is ambiguous */
++ bk_not_base = -1, /* It is not a base */
++ bk_same_type = 0, /* It is the same type */
++ bk_proper_base = 1, /* It is a proper base */
++ bk_via_virtual = 2 /* It is a proper base, but via a virtual
++ path. This might not be the canonical
++ binfo. */
++} base_kind;
++
+ /* Nonzero means allow Microsoft extensions without a pedwarn. */
+ extern int flag_ms_extensions;
+
+@@ -3226,8 +3143,7 @@ extern tree pending_vtables;
+
+ /* Node for "pointer to (virtual) function".
+ This may be distinct from ptr_type_node so gdb can distinguish them. */
+-#define vfunc_ptr_type_node \
+- (flag_vtable_thunks ? vtable_entry_type : ptr_type_node)
++#define vfunc_ptr_type_node vtable_entry_type
+
+
+ /* For building calls to `delete'. */
+@@ -3295,12 +3211,10 @@ extern varray_type local_classes;
+ #define AUTO_TEMP_NAME "_$tmp_"
+ #define AUTO_TEMP_FORMAT "_$tmp_%d"
+ #define VTABLE_BASE "$vb"
+-#define VTABLE_NAME_PREFIX (flag_vtable_thunks ? "__vt_" : "_vt$")
++#define VTABLE_NAME_PREFIX "__vt_"
+ #define VFIELD_BASE "$vf"
+ #define VFIELD_NAME "_vptr$"
+ #define VFIELD_NAME_FORMAT "_vptr$%s"
+-#define VBASE_NAME "_vb$"
+-#define VBASE_NAME_FORMAT "_vb$%s"
+ #define STATIC_NAME_FORMAT "_%s$%s"
+ #define ANON_AGGRNAME_FORMAT "$_%d"
+
+@@ -3317,12 +3231,10 @@ extern varray_type local_classes;
+ #define AUTO_TEMP_NAME "_.tmp_"
+ #define AUTO_TEMP_FORMAT "_.tmp_%d"
+ #define VTABLE_BASE ".vb"
+-#define VTABLE_NAME_PREFIX (flag_vtable_thunks ? "__vt_" : "_vt.")
++#define VTABLE_NAME_PREFIX "__vt_"
+ #define VFIELD_BASE ".vf"
+ #define VFIELD_NAME "_vptr."
+ #define VFIELD_NAME_FORMAT "_vptr.%s"
+-#define VBASE_NAME "_vb."
+-#define VBASE_NAME_FORMAT "_vb.%s"
+ #define STATIC_NAME_FORMAT "_%s.%s"
+
+ #define ANON_AGGRNAME_FORMAT "._%d"
+@@ -3346,7 +3258,7 @@ extern varray_type local_classes;
+ #define AUTO_TEMP_FORMAT "__tmp_%d"
+ #define VTABLE_BASE "__vtb"
+ #define VTABLE_NAME "__vt_"
+-#define VTABLE_NAME_PREFIX (flag_vtable_thunks ? "__vt_" : "_vt_")
++#define VTABLE_NAME_PREFIX "__vt_"
+ #define VTABLE_NAME_P(ID_NODE) \
+ (!strncmp (IDENTIFIER_POINTER (ID_NODE), VTABLE_NAME, \
+ sizeof (VTABLE_NAME) - 1))
+@@ -3356,11 +3268,6 @@ extern varray_type local_classes;
+ (!strncmp (IDENTIFIER_POINTER (ID_NODE), VFIELD_NAME, \
+ sizeof (VFIELD_NAME) - 1))
+ #define VFIELD_NAME_FORMAT "_vptr_%s"
+-#define VBASE_NAME "__vb_"
+-#define VBASE_NAME_P(ID_NODE) \
+- (!strncmp (IDENTIFIER_POINTER (ID_NODE), VBASE_NAME, \
+- sizeof (VBASE_NAME) - 1))
+-#define VBASE_NAME_FORMAT "__vb_%s"
+ #define STATIC_NAME_FORMAT "__static_%s_%s"
+
+ #define ANON_AGGRNAME_PREFIX "__anon_"
+@@ -3386,21 +3293,10 @@ extern varray_type local_classes;
+
+ #define VTBL_PTR_TYPE "__vtbl_ptr_type"
+ #define VTABLE_DELTA_NAME "__delta"
+-#define VTABLE_INDEX_NAME "__index"
+ #define VTABLE_PFN_NAME "__pfn"
+-#define VTABLE_DELTA2_NAME "__delta2"
+
+ #define EXCEPTION_CLEANUP_NAME "exception cleanup"
+
+-/* The name used as a prefix for VTTs. When the new ABI mangling
+- scheme is implemented, this should be removed. */
+-
+-#define VTT_NAME_PREFIX "__vtt_"
+-
+-/* The name used as a prefix for construction vtables. */
+-
+-#define CTOR_VTBL_NAME_PREFIX "__ctorvt_"
+-
+ #define THIS_NAME_P(ID_NODE) (strcmp(IDENTIFIER_POINTER (ID_NODE), "this") == 0)
+
+ #if !defined(NO_DOLLAR_IN_LABEL) || !defined(NO_DOT_IN_LABEL)
+@@ -3414,10 +3310,6 @@ extern varray_type local_classes;
+ && IDENTIFIER_POINTER (ID_NODE)[2] == 't' \
+ && IDENTIFIER_POINTER (ID_NODE)[3] == JOINER)
+
+-#define VBASE_NAME_P(ID_NODE) (IDENTIFIER_POINTER (ID_NODE)[1] == 'v' \
+- && IDENTIFIER_POINTER (ID_NODE)[2] == 'b' \
+- && IDENTIFIER_POINTER (ID_NODE)[3] == JOINER)
+-
+ #define TEMP_NAME_P(ID_NODE) (!strncmp (IDENTIFIER_POINTER (ID_NODE), AUTO_TEMP_NAME, sizeof (AUTO_TEMP_NAME)-1))
+ #define VFIELD_NAME_P(ID_NODE) (!strncmp (IDENTIFIER_POINTER (ID_NODE), VFIELD_NAME, sizeof(VFIELD_NAME)-1))
+
+@@ -3431,14 +3323,6 @@ extern varray_type local_classes;
+ && IDENTIFIER_POINTER (ID_NODE)[1] <= '9')
+ #endif /* !defined(NO_DOLLAR_IN_LABEL) || !defined(NO_DOT_IN_LABEL) */
+
+-/* Store the vbase pointer field name for type TYPE into pointer BUF. */
+-#define FORMAT_VBASE_NAME(BUF,TYPE) do { \
+- char *wbuf = (char *) alloca (TYPE_ASSEMBLER_NAME_LENGTH (TYPE) \
+- + sizeof (VBASE_NAME) + 1); \
+- sprintf (wbuf, VBASE_NAME_FORMAT, TYPE_ASSEMBLER_NAME_STRING (TYPE)); \
+- (BUF) = wbuf; \
+-} while (0)
+-
+ /* Returns non-zero iff NODE is a declaration for the global function
+ `main'. */
+ #define DECL_MAIN_P(NODE) \
+@@ -3742,9 +3626,10 @@ extern tree strip_top_quals
+ extern tree perform_implicit_conversion PARAMS ((tree, tree));
+
+ /* in class.c */
++extern tree build_base_path PARAMS ((enum tree_code, tree, tree, int));
+ extern tree build_vbase_path PARAMS ((enum tree_code, tree, tree, tree, int));
+ extern tree build_vtbl_ref PARAMS ((tree, tree));
+-extern tree build_vfn_ref PARAMS ((tree *, tree, tree));
++extern tree build_vfn_ref PARAMS ((tree, tree));
+ extern tree get_vtable_decl PARAMS ((tree, int));
+ extern void add_method PARAMS ((tree, tree, int));
+ extern int currently_open_class PARAMS ((tree));
+@@ -3781,8 +3666,6 @@ extern tree get_primary_binfo
+ extern tree convert_to_reference PARAMS ((tree, tree, int, int, tree));
+ extern tree convert_from_reference PARAMS ((tree));
+ extern tree convert_lvalue PARAMS ((tree, tree));
+-extern tree convert_pointer_to_real PARAMS ((tree, tree));
+-extern tree convert_pointer_to PARAMS ((tree, tree));
+ extern tree ocp_convert PARAMS ((tree, tree, int, int));
+ extern tree cp_convert PARAMS ((tree, tree));
+ extern tree convert_to_void PARAMS ((tree, const char */*implicit context*/));
+@@ -4216,6 +4099,7 @@ extern int tinfo_decl_p
+ extern int emit_tinfo_decl PARAMS((tree *, void *));
+
+ /* in search.c */
++extern tree lookup_base PARAMS ((tree, tree, base_access, base_kind *));
+ extern int types_overlap_p PARAMS ((tree, tree));
+ extern tree get_vbase PARAMS ((tree, tree));
+ extern tree get_binfo PARAMS ((tree, tree, int));
+@@ -4229,7 +4113,6 @@ extern tree lookup_fnfields PARAMS ((t
+ extern tree lookup_member PARAMS ((tree, tree, int, int));
+ extern int look_for_overrides PARAMS ((tree, tree));
+ extern void get_pure_virtuals PARAMS ((tree));
+-extern tree init_vbase_pointers PARAMS ((tree, tree));
+ extern void get_vbase_types PARAMS ((tree));
+ extern void maybe_suppress_debug_info PARAMS ((tree));
+ extern void note_debug_info_needed PARAMS ((tree));
+@@ -4265,11 +4148,9 @@ extern tree dfs_marked_real_bases_queue_
+ extern tree dfs_skip_vbases PARAMS ((tree, void *));
+ extern tree marked_vtable_pathp PARAMS ((tree, void *));
+ extern tree unmarked_vtable_pathp PARAMS ((tree, void *));
+-extern tree convert_pointer_to_vbase PARAMS ((tree, tree));
+ extern tree find_vbase_instance PARAMS ((tree, tree));
+ extern tree binfo_for_vbase PARAMS ((tree, tree));
+ extern tree binfo_via_virtual PARAMS ((tree, tree));
+-extern void fixup_all_virtual_upcast_offsets PARAMS ((tree));
+
+ /* in semantics.c */
+ extern void init_cp_semantics PARAMS ((void));
+Index: gcc/cp/cvt.c
+===================================================================
+RCS file: /cvs/gcc/gcc/gcc/cp/cvt.c,v
+retrieving revision 1.97.2.3
+diff -u -p -r1.97.2.3 cvt.c
+--- gcc/cp/cvt.c 2001/08/17 04:31:27 1.97.2.3
++++ gcc/cp/cvt.c 2002/02/01 22:44:28
+@@ -141,44 +141,35 @@ cp_convert_to_pointer (type, expr, force
+ && TREE_CODE (TREE_TYPE (type)) == RECORD_TYPE
+ && IS_AGGR_TYPE (TREE_TYPE (type))
+ && IS_AGGR_TYPE (TREE_TYPE (intype))
+- && TREE_CODE (TREE_TYPE (intype)) == RECORD_TYPE
+- /* If EXPR is NULL, then we don't need to do any arithmetic
+- to convert it:
+-
+- [conv.ptr]
+-
+- The null pointer value is converted to the null pointer
+- value of the destination type. */
+- && !integer_zerop (expr))
++ && TREE_CODE (TREE_TYPE (intype)) == RECORD_TYPE)
+ {
+ enum tree_code code = PLUS_EXPR;
+- tree binfo = get_binfo (TREE_TYPE (type), TREE_TYPE (intype), 1);
+- if (binfo == error_mark_node)
+- return error_mark_node;
+- if (binfo == NULL_TREE)
++ tree binfo;
++
++ /* Try derived to base conversion. */
++ binfo = lookup_base (TREE_TYPE (intype), TREE_TYPE (type),
++ ba_check, NULL);
++ if (!binfo)
+ {
+- binfo = get_binfo (TREE_TYPE (intype), TREE_TYPE (type), 1);
+- if (binfo == error_mark_node)
+- return error_mark_node;
++ /* Try base to derived conversion. */
++ binfo = lookup_base (TREE_TYPE (type), TREE_TYPE (intype),
++ ba_check, NULL);
+ code = MINUS_EXPR;
+ }
++ if (binfo == error_mark_node)
++ return error_mark_node;
+ if (binfo)
+ {
+- if (TYPE_USES_VIRTUAL_BASECLASSES (TREE_TYPE (type))
+- || TYPE_USES_VIRTUAL_BASECLASSES (TREE_TYPE (intype))
+- || ! BINFO_OFFSET_ZEROP (binfo))
++ expr = build_base_path (code, expr, binfo, 0);
++ /* Add any qualifier conversions. */
++ if (!same_type_p (TREE_TYPE (TREE_TYPE (expr)),
++ TREE_TYPE (type)))
+ {
+- /* Need to get the path we took. */
+- tree path;
+-
+- if (code == PLUS_EXPR)
+- get_base_distance (TREE_TYPE (type), TREE_TYPE (intype),
+- 0, &path);
+- else
+- get_base_distance (TREE_TYPE (intype), TREE_TYPE (type),
+- 0, &path);
+- return build_vbase_path (code, type, expr, path, 0);
++ expr = build1 (NOP_EXPR, type, expr);
++ TREE_CONSTANT (expr) =
++ TREE_CONSTANT (TREE_OPERAND (expr, 0));
+ }
++ return expr;
+ }
+ }
+
+@@ -187,36 +178,29 @@ cp_convert_to_pointer (type, expr, force
+ tree b1;
+ tree b2;
+ tree binfo;
+- tree virt_binfo;
+- enum tree_code code;
++ enum tree_code code = PLUS_EXPR;
++ base_kind bk;
+
+ b1 = TYPE_OFFSET_BASETYPE (TREE_TYPE (type));
+ b2 = TYPE_OFFSET_BASETYPE (TREE_TYPE (intype));
+- binfo = get_binfo (b2, b1, 1);
+-
+- if (binfo == NULL_TREE)
++ binfo = lookup_base (b1, b2, ba_check, &bk);
++ if (!binfo)
+ {
+- binfo = get_binfo (b1, b2, 1);
++ binfo = lookup_base (b2, b1, ba_check, &bk);
+ code = MINUS_EXPR;
+ }
+- else
+- code = PLUS_EXPR;
+-
+ if (binfo == error_mark_node)
+ return error_mark_node;
+
+- virt_binfo = binfo_from_vbase (binfo);
+- if (virt_binfo)
++ if (bk == bk_via_virtual)
+ {
+ if (force)
+- cp_warning ("pointer to member cast via virtual base `%T' of `%T'",
+- BINFO_TYPE (virt_binfo),
+- BINFO_TYPE (BINFO_INHERITANCE_CHAIN (virt_binfo)));
++ cp_warning ("pointer to member cast from `%T' to `%T' is via virtual base",
++ TREE_TYPE (intype), TREE_TYPE (type));
+ else
+ {
+- cp_error ("pointer to member cast via virtual base `%T' of `%T'",
+- BINFO_TYPE (virt_binfo),
+- BINFO_TYPE (BINFO_INHERITANCE_CHAIN (virt_binfo)));
++ cp_error ("pointer to member cast from `%T' to `%T' is via virtual base",
++ TREE_TYPE (intype), TREE_TYPE (type));
+ return error_mark_node;
+ }
+ /* This is a reinterpret cast, whose result is unspecified.
+@@ -259,8 +243,8 @@ cp_convert_to_pointer (type, expr, force
+ return build_ptrmemfunc (TYPE_PTRMEMFUNC_FN_TYPE (type), expr, 0);
+
+ if (TYPE_PTRMEM_P (type))
+- /* Under the new ABI, a NULL pointer-to-member is represented
+- by -1, not by zero. */
++ /* A NULL pointer-to-member is represented by -1, not by
++ zero. */
+ expr = build_int_2 (-1, -1);
+ else
+ expr = build_int_2 (0, 0);
+@@ -319,34 +303,32 @@ convert_to_pointer_force (type, expr)
+ && TREE_CODE (TREE_TYPE (intype)) == RECORD_TYPE)
+ {
+ enum tree_code code = PLUS_EXPR;
+- tree path;
+- int distance = get_base_distance (TREE_TYPE (type),
+- TREE_TYPE (intype), 0, &path);
+- if (distance == -2)
++ tree binfo;
++
++ binfo = lookup_base (TREE_TYPE (intype), TREE_TYPE (type),
++ ba_ignore, NULL);
++ if (!binfo)
+ {
+- cp_error ("type `%T' is ambiguous base of `%T'",
+- TREE_TYPE (type),
+- TREE_TYPE (intype));
+- return error_mark_node;
++ binfo = lookup_base (TREE_TYPE (type), TREE_TYPE (intype),
++ ba_ignore, NULL);
++ code = MINUS_EXPR;
+ }
+- if (distance == -1)
++ if (binfo == error_mark_node)
++ return error_mark_node;
++ if (binfo)
+ {
+- distance = get_base_distance (TREE_TYPE (intype),
+- TREE_TYPE (type), 0, &path);
+- if (distance == -2)
+- {
+- cp_error ("type `%T' is ambiguous base of `%T'",
+- TREE_TYPE (intype),
+- TREE_TYPE (type));
+- return error_mark_node;
+- }
+- if (distance < 0)
+- /* Doesn't need any special help from us. */
+- return build1 (NOP_EXPR, type, expr);
+-
+- code = MINUS_EXPR;
++ expr = build_base_path (code, expr, binfo, 0);
++ /* Add any qualifier conversions. */
++ if (!same_type_p (TREE_TYPE (TREE_TYPE (expr)),
++ TREE_TYPE (type)))
++ {
++ expr = build1 (NOP_EXPR, type, expr);
++ TREE_CONSTANT (expr) =
++ TREE_CONSTANT (TREE_OPERAND (expr, 0));
++ }
++ return expr;
+ }
+- return build_vbase_path (code, type, expr, path, 0);
++
+ }
+ }
+
+@@ -406,12 +388,12 @@ build_up_reference (type, arg, flags)
+ && IS_AGGR_TYPE (target_type))
+ {
+ /* We go through get_binfo for the access control. */
+- tree binfo = get_binfo (target_type, argtype, 1);
++ tree binfo = lookup_base (argtype, target_type, ba_check, NULL);
+ if (binfo == error_mark_node)
+ return error_mark_node;
+ if (binfo == NULL_TREE)
+ return error_not_base_type (target_type, argtype);
+- rval = convert_pointer_to_real (binfo, rval);
++ rval = build_base_path (PLUS_EXPR, rval, binfo, 1);
+ }
+ else
+ rval
+@@ -610,87 +592,6 @@ convert_lvalue (totype, expr)
+ expr = convert_to_reference (totype, expr, CONV_IMPLICIT, LOOKUP_NORMAL,
+ NULL_TREE);
+ return convert_from_reference (expr);
+-}
+-
+-/* Call this when we know (for any reason) that expr is not, in fact,
+- zero. This routine is like convert_pointer_to, but it pays
+- attention to which specific instance of what type we want to
+- convert to. This routine should eventually become
+- convert_to_pointer after all references to convert_to_pointer
+- are removed. */
+-
+-tree
+-convert_pointer_to_real (binfo, expr)
+- tree binfo, expr;
+-{
+- register tree intype = TREE_TYPE (expr);
+- tree ptr_type;
+- tree type, rval;
+-
+- if (intype == error_mark_node)
+- return error_mark_node;
+-
+- if (TREE_CODE (binfo) == TREE_VEC)
+- type = BINFO_TYPE (binfo);
+- else if (IS_AGGR_TYPE (binfo))
+- {
+- type = binfo;
+- }
+- else
+- {
+- type = binfo;
+- binfo = NULL_TREE;
+- }
+-
+- ptr_type = cp_build_qualified_type (type,
+- CP_TYPE_QUALS (TREE_TYPE (intype)));
+- ptr_type = build_pointer_type (ptr_type);
+- if (same_type_p (ptr_type, TYPE_MAIN_VARIANT (intype)))
+- return expr;
+-
+- my_friendly_assert (!integer_zerop (expr), 191);
+-
+- intype = TYPE_MAIN_VARIANT (TREE_TYPE (intype));
+- if (TREE_CODE (type) == RECORD_TYPE
+- && TREE_CODE (intype) == RECORD_TYPE
+- && type != intype)
+- {
+- tree path;
+- int distance
+- = get_base_distance (binfo, intype, 0, &path);
+-
+- /* This function shouldn't be called with unqualified arguments
+- but if it is, give them an error message that they can read. */
+- if (distance < 0)
+- {
+- cp_error ("cannot convert a pointer of type `%T' to a pointer of type `%T'",
+- intype, type);
+-
+- if (distance == -2)
+- cp_error ("because `%T' is an ambiguous base class", type);
+- return error_mark_node;
+- }
+-
+- return build_vbase_path (PLUS_EXPR, ptr_type, expr, path, 1);
+- }
+- rval = build1 (NOP_EXPR, ptr_type,
+- TREE_CODE (expr) == NOP_EXPR ? TREE_OPERAND (expr, 0) : expr);
+- TREE_CONSTANT (rval) = TREE_CONSTANT (expr);
+- return rval;
+-}
+-
+-/* Call this when we know (for any reason) that expr is
+- not, in fact, zero. This routine gets a type out of the first
+- argument and uses it to search for the type to convert to. If there
+- is more than one instance of that type in the expr, the conversion is
+- ambiguous. This routine should eventually go away, and all
+- callers should use convert_to_pointer_real. */
+-
+-tree
+-convert_pointer_to (binfo, expr)
+- tree binfo, expr;
+-{
+- return convert_pointer_to_real (binfo, expr);
+ }
+
+ /* C++ conversions, preference to static cast conversions. */
+Index: gcc/cp/decl.c
+===================================================================
+RCS file: /cvs/gcc/gcc/gcc/cp/decl.c,v
+retrieving revision 1.747.2.36
+diff -u -p -r1.747.2.36 decl.c
+--- gcc/cp/decl.c 2002/01/18 03:36:08 1.747.2.36
++++ gcc/cp/decl.c 2002/02/01 22:44:37
+@@ -51,8 +51,7 @@ extern tree global_namespace;
+ extern int (*valid_lang_attribute) PARAMS ((tree, tree, tree, tree));
+
+ #ifndef BOOL_TYPE_SIZE
+-/* In the new ABI, `bool' has size and alignment `1', on all
+- platforms. */
++/* `bool' has size and alignment `1', on all platforms. */
+ #define BOOL_TYPE_SIZE CHAR_TYPE_SIZE
+ #endif
+
+@@ -166,28 +165,13 @@ tree error_mark_list;
+
+ tree vtable_entry_type;
+ tree delta_type_node;
+-#if 0
+- Old rtti stuff.
+- tree __baselist_desc_type_node;
+- tree __i_desc_type_node, __m_desc_type_node;
+- tree __t_desc_array_type, __i_desc_array_type, __m_desc_array_type;
+-#endif
+ tree __t_desc_type_node;
+-#if 0
+- tree __tp_desc_type_node;
+-#endif
+ tree ti_desc_type_node;
+ tree bltn_desc_type_node, ptr_desc_type_node;
+ tree ary_desc_type_node, func_desc_type_node, enum_desc_type_node;
+ tree class_desc_type_node, si_class_desc_type_node, vmi_class_desc_type_node;
+ tree ptm_desc_type_node;
+ tree base_desc_type_node;
+-#if 0
+- Not needed yet? May be needed one day?
+- tree __bltn_desc_array_type, __user_desc_array_type, __class_desc_array_type;
+- tree __ptr_desc_array_type, __attr_dec_array_type, __func_desc_array_type;
+- tree __ptmf_desc_array_type, __ptmd_desc_array_type;
+-#endif
+
+ tree class_type_node, record_type_node, union_type_node, enum_type_node;
+ tree unknown_type_node;
+@@ -6317,14 +6301,11 @@ initialize_predefined_identifiers ()
+ { "__comp_dtor", &complete_dtor_identifier, 1 },
+ { "__base_dtor", &base_dtor_identifier, 1 },
+ { "__deleting_dtor", &deleting_dtor_identifier, 1 },
+- { VTABLE_DELTA2_NAME, &delta2_identifier, 0 },
+- { VTABLE_DELTA_NAME, &delta_identifier, 0 },
+ { IN_CHARGE_NAME, &in_charge_identifier, 0 },
+- { VTABLE_INDEX_NAME, &index_identifier, 0 },
+ { "nelts", &nelts_identifier, 0 },
+ { THIS_NAME, &this_identifier, 0 },
++ { VTABLE_DELTA_NAME, &delta_identifier, 0 },
+ { VTABLE_PFN_NAME, &pfn_identifier, 0 },
+- { "__pfn_or_delta2", &pfn_or_delta2_identifier, 0 },
+ { "_vptr", &vptr_identifier, 0 },
+ { "__vtt_parm", &vtt_parm_identifier, 0 },
+ { "std", &std_identifier, 0 },
+@@ -6349,11 +6330,6 @@ init_decl_processing ()
+ {
+ tree fields[20];
+
+- /* Check to see that the user did not specify an invalid combination
+- of command-line options. */
+- if (!flag_vtable_thunks)
+- error ("the ABI requires vtable thunks");
+-
+ /* Create all the identifiers we need. */
+ initialize_predefined_identifiers ();
+
+@@ -6493,41 +6469,16 @@ init_decl_processing ()
+ TYPE_POINTER_TO (unknown_type_node) = unknown_type_node;
+ TYPE_REFERENCE_TO (unknown_type_node) = unknown_type_node;
+
+- if (flag_vtable_thunks)
+- {
+- /* Make sure we get a unique function type, so we can give
+- its pointer type a name. (This wins for gdb.) */
+- tree vfunc_type = make_node (FUNCTION_TYPE);
+- TREE_TYPE (vfunc_type) = integer_type_node;
+- TYPE_ARG_TYPES (vfunc_type) = NULL_TREE;
+- layout_type (vfunc_type);
+-
+- vtable_entry_type = build_pointer_type (vfunc_type);
+- }
+- else
+- {
+- vtable_entry_type = make_aggr_type (RECORD_TYPE);
+- fields[0] = build_decl (FIELD_DECL, delta_identifier,
+- delta_type_node);
+- fields[1] = build_decl (FIELD_DECL, index_identifier,
+- delta_type_node);
+- fields[2] = build_decl (FIELD_DECL, pfn_identifier,
+- ptr_type_node);
+- finish_builtin_type (vtable_entry_type, VTBL_PTR_TYPE, fields, 2,
+- double_type_node);
+-
+- /* Make this part of an invisible union. */
+- fields[3] = copy_node (fields[2]);
+- TREE_TYPE (fields[3]) = delta_type_node;
+- DECL_NAME (fields[3]) = delta2_identifier;
+- DECL_MODE (fields[3]) = TYPE_MODE (delta_type_node);
+- DECL_SIZE (fields[3]) = TYPE_SIZE (delta_type_node);
+- DECL_SIZE_UNIT (fields[3]) = TYPE_SIZE_UNIT (delta_type_node);
+- TREE_UNSIGNED (fields[3]) = 0;
+- TREE_CHAIN (fields[2]) = fields[3];
+- vtable_entry_type = build_qualified_type (vtable_entry_type,
+- TYPE_QUAL_CONST);
+- }
++ {
++ /* Make sure we get a unique function type, so we can give
++ its pointer type a name. (This wins for gdb.) */
++ tree vfunc_type = make_node (FUNCTION_TYPE);
++ TREE_TYPE (vfunc_type) = integer_type_node;
++ TYPE_ARG_TYPES (vfunc_type) = NULL_TREE;
++ layout_type (vfunc_type);
++
++ vtable_entry_type = build_pointer_type (vfunc_type);
++ }
+ record_builtin_type (RID_MAX, VTBL_PTR_TYPE, vtable_entry_type);
+
+ vtbl_type_node
+@@ -9473,7 +9424,6 @@ check_special_function_return_type (sfk,
+ if (type)
+ cp_error ("return type specification for constructor invalid");
+
+- /* In the new ABI constructors do not return a value. */
+ type = void_type_node;
+ break;
+
+Index: gcc/cp/decl2.c
+===================================================================
+RCS file: /cvs/gcc/gcc/gcc/cp/decl2.c,v
+retrieving revision 1.437.2.29
+diff -u -p -r1.437.2.29 decl2.c
+--- gcc/cp/decl2.c 2001/11/30 03:12:42 1.437.2.29
++++ gcc/cp/decl2.c 2002/02/01 22:44:40
+@@ -200,11 +200,6 @@ int warn_long_long = 1;
+
+ int warn_ctor_dtor_privacy = 1;
+
+-/* True if we want to implement vtables using "thunks".
+- The default is off. */
+-
+-int flag_vtable_thunks = 1;
+-
+ /* Nonzero means generate separate instantiation control files and juggle
+ them at link time. */
+
+@@ -2262,12 +2257,9 @@ mark_vtable_entries (decl)
+
+ for (; entries; entries = TREE_CHAIN (entries))
+ {
+- tree fnaddr;
++ tree fnaddr = TREE_VALUE (entries);
+ tree fn;
+
+- fnaddr = (flag_vtable_thunks ? TREE_VALUE (entries)
+- : FNADDR_FROM_VTABLE_ENTRY (TREE_VALUE (entries)));
+-
+ if (TREE_CODE (fnaddr) != ADDR_EXPR
+ && TREE_CODE (fnaddr) != FDESC_EXPR)
+ /* This entry is an offset: a virtual base class offset, a
+@@ -2307,12 +2299,12 @@ comdat_linkage (decl)
+ address, and this will not hold when we emit multiple copies of
+ the function. However, there's little else we can do.
+
+- Also, by default, the typeinfo implementation for the new ABI
+- assumes that there will be only one copy of the string used as
+- the name for each type. Therefore, if weak symbols are
+- unavailable, the run-time library should perform a more
+- conservative check; it should perform a string comparison,
+- rather than an address comparison. */
++ Also, by default, the typeinfo implementation assumes that
++ there will be only one copy of the string used as the name for
++ each type. Therefore, if weak symbols are unavailable, the
++ run-time library should perform a more conservative check; it
++ should perform a string comparison, rather than an address
++ comparison. */
+ TREE_PUBLIC (decl) = 0;
+ else
+ {
+@@ -2751,8 +2743,8 @@ get_guard (decl)
+ {
+ tree guard_type;
+
+- /* Under the new ABI, we use a type that is big enough to
+- contain a mutex as well as an integer counter. */
++ /* We use a type that is big enough to contain a mutex as well
++ as an integer counter. */
+ guard_type = long_long_integer_type_node;
+ guard = build_decl (VAR_DECL, sname, guard_type);
+
+@@ -2779,8 +2771,8 @@ static tree
+ get_guard_bits (guard)
+ tree guard;
+ {
+- /* Under the new ABI, we only set the first byte of the guard,
+- in order to leave room for a mutex in the high-order bits. */
++ /* We only set the first byte of the guard, in order to leave room
++ for a mutex in the high-order bits. */
+ guard = build1 (ADDR_EXPR,
+ build_pointer_type (TREE_TYPE (guard)),
+ guard);
+Index: gcc/cp/error.c
+===================================================================
+RCS file: /cvs/gcc/gcc/gcc/cp/error.c,v
+retrieving revision 1.149.2.5
+diff -u -p -r1.149.2.5 error.c
+--- gcc/cp/error.c 2001/09/15 19:43:41 1.149.2.5
++++ gcc/cp/error.c 2002/02/01 22:44:43
+@@ -950,13 +950,8 @@ dump_decl (t, flags)
+ if (DECL_NAME (t) && VTABLE_NAME_P (DECL_NAME (t)))
+ {
+ output_add_string (scratch_buffer, "vtable for ");
+- if (TYPE_P (DECL_CONTEXT (t)))
+- dump_type (DECL_CONTEXT (t), flags);
+- else
+- /* This case can arise with -fno-vtable-thunks. See
+- expand_upcast_fixups. It's not clear what to print
+- here. */
+- print_identifier (scratch_buffer, "<unknown type>");
++ my_friendly_assert (TYPE_P (DECL_CONTEXT (t)), 20010720);
++ dump_type (DECL_CONTEXT (t), flags);
+ break;
+ }
+ /* else fall through */
+@@ -1918,16 +1913,9 @@ dump_expr (t, flags)
+ case CONSTRUCTOR:
+ if (TREE_TYPE (t) && TYPE_PTRMEMFUNC_P (TREE_TYPE (t)))
+ {
+- tree idx = build_component_ref (t, index_identifier, NULL_TREE, 0);
++ tree idx = build_component_ref (t, pfn_identifier, NULL_TREE, 0);
+
+- if (integer_all_onesp (idx))
+- {
+- tree pfn = PFN_FROM_PTRMEMFUNC (t);
+- dump_unary_op ("&", pfn, flags | TFF_EXPR_IN_PARENS);
+- break;
+- }
+- else if (TREE_CODE (idx) == INTEGER_CST
+- && tree_int_cst_equal (idx, integer_zero_node))
++ if (integer_zerop (idx))
+ {
+ /* A NULL pointer-to-member constant. */
+ output_add_string (scratch_buffer, "((");
+Index: gcc/cp/init.c
+===================================================================
+RCS file: /cvs/gcc/gcc/gcc/cp/init.c,v
+retrieving revision 1.232.2.10
+diff -u -p -r1.232.2.10 init.c
+--- gcc/cp/init.c 2002/01/23 12:47:11 1.232.2.10
++++ gcc/cp/init.c 2002/02/01 22:44:44
+@@ -130,7 +130,9 @@ finish_init_stmts (stmt_expr, compound_s
+
+ /* Constructors */
+
+-/* Called from initialize_vtbl_ptrs via dfs_walk. */
++/* Called from initialize_vtbl_ptrs via dfs_walk. BINFO is the base
++ which we want to initialize the vtable pointer for, DATA is
++ TREE_LIST whose TREE_VALUE is the this ptr expression. */
+
+ static tree
+ dfs_initialize_vtbl_ptrs (binfo, data)
+@@ -142,16 +144,7 @@ dfs_initialize_vtbl_ptrs (binfo, data)
+ {
+ tree base_ptr = TREE_VALUE ((tree) data);
+
+- if (TREE_VIA_VIRTUAL (binfo))
+- base_ptr = convert_pointer_to_vbase (BINFO_TYPE (binfo),
+- base_ptr);
+- else
+- base_ptr
+- = build_vbase_path (PLUS_EXPR,
+- build_pointer_type (BINFO_TYPE (binfo)),
+- base_ptr,
+- binfo,
+- /*nonnull=*/1);
++ base_ptr = build_base_path (PLUS_EXPR, base_ptr, binfo, /*nonnull=*/1);
+
+ expand_virtual_init (binfo, base_ptr);
+ }
+@@ -175,21 +168,13 @@ initialize_vtbl_ptrs (addr)
+ list = build_tree_list (type, addr);
+
+ /* Walk through the hierarchy, initializing the vptr in each base
+- class. We do these in pre-order because under the new ABI we
+- can't find the virtual bases for a class until we've initialized
+- the vtbl for that class. */
++ class. We do these in pre-order because can't find the virtual
++ bases for a class until we've initialized the vtbl for that
++ class. */
+ dfs_walk_real (TYPE_BINFO (type), dfs_initialize_vtbl_ptrs,
+ NULL, dfs_unmarked_real_bases_queue_p, list);
+ dfs_walk (TYPE_BINFO (type), dfs_unmark,
+ dfs_marked_real_bases_queue_p, type);
+-
+- /* If we're not using thunks, we may need to adjust the deltas in
+- the vtable to handle virtual base classes correctly. When we are
+- using thunks, we either use construction vtables (which are
+- preloaded with the right answers) or nothing (in which case
+- vitual function calls sometimes don't work right.) */
+- if (TYPE_USES_VIRTUAL_BASECLASSES (type) && !flag_vtable_thunks)
+- fixup_all_virtual_upcast_offsets (addr);
+ }
+
+ /* [dcl.init]:
+@@ -748,7 +733,8 @@ emit_base_init (mem_init_list, base_init
+
+ if (init != void_list_node)
+ {
+- member = convert_pointer_to_real (base_binfo, current_class_ptr);
++ member = build_base_path (PLUS_EXPR, current_class_ptr,
++ base_binfo, 1);
+ expand_aggr_init_1 (base_binfo, NULL_TREE,
+ build_indirect_ref (member, NULL_PTR), init,
+ LOOKUP_NORMAL);
+@@ -839,20 +825,14 @@ static void
+ expand_virtual_init (binfo, decl)
+ tree binfo, decl;
+ {
+- tree type = BINFO_TYPE (binfo);
+ tree vtbl, vtbl_ptr;
+- tree vtype, vtype_binfo;
+ tree vtt_index;
+
+- /* Compute the location of the vtable. */
+- vtype = DECL_CONTEXT (TYPE_VFIELD (type));
+- vtype_binfo = get_binfo (vtype, TREE_TYPE (TREE_TYPE (decl)), 0);
+-
+ /* Compute the initializer for vptr. */
+ vtbl = build_vtbl_address (binfo);
+
+- /* Under the new ABI, we may get this vptr from a VTT, if this is a
+- subobject constructor or subobject destructor. */
++ /* We may get this vptr from a VTT, if this is a subobject
++ constructor or subobject destructor. */
+ vtt_index = BINFO_VPTR_INDEX (binfo);
+ if (vtt_index)
+ {
+@@ -879,10 +859,9 @@ expand_virtual_init (binfo, decl)
+ }
+
+ /* Compute the location of the vtpr. */
+- decl = convert_pointer_to_real (vtype_binfo, decl);
+- vtbl_ptr = build_vfield_ref (build_indirect_ref (decl, NULL_PTR), vtype);
+- if (vtbl_ptr == error_mark_node)
+- return;
++ vtbl_ptr = build_vfield_ref (build_indirect_ref (decl, NULL),
++ TREE_TYPE (binfo));
++ my_friendly_assert (vtbl_ptr != error_mark_node, 20010730);
+
+ /* Assign the vtable to the vptr. */
+ vtbl = convert_force (TREE_TYPE (vtbl_ptr), vtbl, 0);
+@@ -951,22 +930,6 @@ construct_virtual_bases (type, this_ref,
+ /* If there are no virtual baseclasses, we shouldn't even be here. */
+ my_friendly_assert (TYPE_USES_VIRTUAL_BASECLASSES (type), 19990621);
+
+- /* First set the pointers in our object that tell us where to find
+- our virtual baseclasses. */
+- if (!vbase_offsets_in_vtable_p ())
+- {
+- tree if_stmt;
+- tree result;
+-
+- if_stmt = begin_if_stmt ();
+- finish_if_stmt_cond (flag, if_stmt);
+- result = init_vbase_pointers (type, this_ptr);
+- if (result)
+- finish_expr_stmt (build_compound_expr (result));
+- finish_then_clause (if_stmt);
+- finish_if_stmt ();
+- }
+-
+ /* Now, run through the baseclasses, initializing each. */
+ for (vbases = CLASSTYPE_VBASECLASSES (type); vbases;
+ vbases = TREE_CHAIN (vbases))
+@@ -1919,14 +1882,17 @@ resolve_offset_ref (exp)
+ if (TREE_CODE (exp) == OFFSET_REF && TREE_CODE (type) == OFFSET_TYPE)
+ base = build_scoped_ref (base, TYPE_OFFSET_BASETYPE (type));
+
+- addr = build_unary_op (ADDR_EXPR, base, 0);
+- addr = convert_pointer_to (basetype, addr);
++ /* Don't check access on the conversion; we might be after a member
++ promoted by an access- or using-declaration, and we have already
++ checked access for the member itself. */
++ basetype = lookup_base (TREE_TYPE (base), basetype, ba_ignore, NULL);
++ expr = build_base_path (PLUS_EXPR, base, basetype, 1);
+
+- if (addr == error_mark_node)
++ if (expr == error_mark_node)
+ return error_mark_node;
+
+ expr = build (COMPONENT_REF, TREE_TYPE (member),
+- build_indirect_ref (addr, NULL_PTR), member);
++ expr, member);
+ return convert_from_reference (expr);
+ }
+
+@@ -1949,7 +1915,10 @@ resolve_offset_ref (exp)
+ }
+
+ basetype = TYPE_OFFSET_BASETYPE (TREE_TYPE (TREE_TYPE (member)));
+- addr = convert_pointer_to (basetype, addr);
++ basetype = lookup_base (TREE_TYPE (TREE_TYPE (addr)),
++ basetype, ba_check, NULL);
++ addr = build_base_path (PLUS_EXPR, addr, basetype, 1);
++
+ member = cp_convert (ptrdiff_type_node, member);
+
+ addr = build (PLUS_EXPR, build_pointer_type (type), addr, member);
+@@ -2212,7 +2181,7 @@ build_java_class_ref (type)
+ jclass_node = TREE_TYPE (jclass_node);
+ }
+
+- /* Mangle the class$ field, new and old ABI */
++ /* Mangle the class$ field */
+ {
+ tree field;
+ for (field = TYPE_FIELDS (type); field; field = TREE_CHAIN (field))
+@@ -2251,8 +2220,8 @@ get_cookie_size (type)
+ {
+ tree cookie_size;
+
+- /* Under the new ABI, we need to allocate an additional max
+- (sizeof (size_t), alignof (true_type)) bytes. */
++ /* We need to allocate an additional max (sizeof (size_t), alignof
++ (true_type)) bytes. */
+ tree sizetype_size;
+ tree type_align;
+
+@@ -2359,9 +2328,7 @@ build_new_1 (exp)
+ if (!has_array || !TYPE_VEC_NEW_USES_COOKIE (true_type))
+ use_cookie = 0;
+ /* When using placement new, users may not realize that they need
+- the extra storage. Under the old ABI, we don't allocate the
+- cookie whenever they use one placement argument of type `void
+- *'. Under the new ABI, we require that the operator called be
++ the extra storage. We require that the operator called be
+ the global placement operator delete[]. */
+ else if (placement && !TREE_CHAIN (placement)
+ && same_type_p (TREE_TYPE (TREE_VALUE (placement)),
+@@ -2478,9 +2445,8 @@ build_new_1 (exp)
+ tree cookie;
+
+ /* Store the number of bytes allocated so that we can know how
+- many elements to destroy later. Under the new ABI, we use
+- the last sizeof (size_t) bytes to store the number of
+- elements. */
++ many elements to destroy later. We use the last sizeof
++ (size_t) bytes to store the number of elements. */
+ cookie = build (MINUS_EXPR, build_pointer_type (sizetype),
+ alloc_node, size_in_bytes (sizetype));
+ cookie = build_indirect_ref (cookie, NULL_PTR);
+Index: gcc/cp/lang-specs.h
+===================================================================
+RCS file: /cvs/gcc/gcc/gcc/cp/lang-specs.h,v
+retrieving revision 1.39.2.4
+diff -u -p -r1.39.2.4 lang-specs.h
+--- gcc/cp/lang-specs.h 2001/06/08 00:00:32 1.39.2.4
++++ gcc/cp/lang-specs.h 2002/02/01 22:44:45
+@@ -38,14 +38,14 @@ Boston, MA 02111-1307, USA. */
+ "%{E|M|MM:cpp0 -lang-c++ %{!no-gcc:-D__GNUG__=%v1}\
+ %{!Wno-deprecated:-D__GXX_DEPRECATED}\
+ %{!fno-exceptions:-D__EXCEPTIONS}\
+- %{!fno-new-abi:-D__GXX_ABI_VERSION=100}\
++ -D__GXX_ABI_VERSION=100\
+ %{ansi:-D__STRICT_ANSI__ -trigraphs -$} %(cpp_options)}\
+ %{!E:%{!M:%{!MM:\
+ %{save-temps:cpp0 -lang-c++ \
+ %{!no-gcc:-D__GNUG__=%v1}\
+ %{!Wno-deprecated:-D__GXX_DEPRECATED}\
+ %{!fno-exceptions:-D__EXCEPTIONS}\
+- %{!fno-new-abi:-D__GXX_ABI_VERSION=100}\
++ -D__GXX_ABI_VERSION=100\
+ %{ansi:-D__STRICT_ANSI__ -trigraphs -$}\
+ %(cpp_options) %b.ii \n}\
+ cc1plus %{save-temps:-fpreprocessed %b.ii}\
+@@ -53,7 +53,7 @@ Boston, MA 02111-1307, USA. */
+ %{!no-gcc:-D__GNUG__=%v1} \
+ %{!Wno-deprecated:-D__GXX_DEPRECATED}\
+ %{!fno-exceptions:-D__EXCEPTIONS}\
+- %{!fno-new-abi:-D__GXX_ABI_VERSION=100}\
++ -D__GXX_ABI_VERSION=100\
+ %{ansi:-D__STRICT_ANSI__}}\
+ %{ansi:-trigraphs -$}\
+ %(cc1_options) %2 %{+e1*}\
+Index: gcc/cp/mangle.c
+===================================================================
+RCS file: /cvs/gcc/gcc/gcc/cp/mangle.c,v
+retrieving revision 1.26.4.9
+diff -u -p -r1.26.4.9 mangle.c
+--- gcc/cp/mangle.c 2001/12/03 17:38:50 1.26.4.9
++++ gcc/cp/mangle.c 2002/02/01 22:44:46
+@@ -1,4 +1,4 @@
+-/* Name mangling for the new standard C++ ABI.
++/* Name mangling for the 3.0 C++ ABI.
+ Copyright (C) 2000, 2001 Free Software Foundation, Inc.
+ Written by Alex Samuel <sameul@codesourcery.com>
+
+@@ -1195,10 +1195,7 @@ write_special_name_constructor (ctor)
+ <special-name> ::= D0 # deleting (in-charge) destructor
+ ::= D1 # complete object (in-charge) destructor
+ ::= D2 # base object (not-in-charge) destructor
+-
+- We also need to provide unique mngled names for old-ABI
+- destructors, sometimes. These should only be used internally. We
+- use "D*INTERNAL*" for these. */
++ */
+
+ static void
+ write_special_name_destructor (dtor)
+Index: gcc/cp/method.c
+===================================================================
+RCS file: /cvs/gcc/gcc/gcc/cp/method.c,v
+retrieving revision 1.190.2.15
+diff -u -p -r1.190.2.15 method.c
+--- gcc/cp/method.c 2002/01/07 20:51:38 1.190.2.15
++++ gcc/cp/method.c 2002/02/01 22:44:46
+@@ -600,8 +600,6 @@ do_build_copy_constructor (fndecl)
+ {
+ if (VFIELD_NAME_P (DECL_NAME (field)))
+ continue;
+- if (VBASE_NAME_P (DECL_NAME (field)))
+- continue;
+
+ /* True for duplicate members. */
+ if (IDENTIFIER_CLASS_VALUE (DECL_NAME (field)) != field)
+@@ -689,8 +687,6 @@ do_build_assign_ref (fndecl)
+ if (DECL_NAME (field))
+ {
+ if (VFIELD_NAME_P (DECL_NAME (field)))
+- continue;
+- if (VBASE_NAME_P (DECL_NAME (field)))
+ continue;
+
+ /* True for duplicate members. */
+Index: gcc/cp/rtti.c
+===================================================================
+RCS file: /cvs/gcc/gcc/gcc/cp/rtti.c,v
+retrieving revision 1.109.2.7
+diff -u -p -r1.109.2.7 rtti.c
+--- gcc/cp/rtti.c 2001/12/06 12:54:19 1.109.2.7
++++ gcc/cp/rtti.c 2002/02/01 22:44:47
+@@ -41,7 +41,6 @@ Boston, MA 02111-1307, USA. */
+
+ extern struct obstack permanent_obstack;
+
+-static tree build_headof_sub PARAMS((tree));
+ static tree build_headof PARAMS((tree));
+ static tree ifnonnull PARAMS((tree, tree));
+ static tree tinfo_name PARAMS((tree));
+@@ -86,23 +85,6 @@ init_rtti_processing ()
+ build_qualified_type (type_info_type_node, TYPE_QUAL_CONST);
+ }
+
+-/* Given a pointer to an object with at least one virtual table
+- pointer somewhere, return a pointer to a possible sub-object that
+- has a virtual table pointer in it that is the vtable parent for
+- that sub-object. */
+-
+-static tree
+-build_headof_sub (exp)
+- tree exp;
+-{
+- tree type = TREE_TYPE (TREE_TYPE (exp));
+- tree basetype = CLASSTYPE_RTTI (type);
+- tree binfo = get_binfo (basetype, type, 0);
+-
+- exp = convert_pointer_to_real (binfo, exp);
+- return exp;
+-}
+-
+ /* Given the expression EXP of type `class *', return the head of the
+ object pointed to by EXP with type cv void*, if the class has any
+ virtual functions (TYPE_POLYMORPHIC_P), else just return the
+@@ -113,7 +95,6 @@ build_headof (exp)
+ tree exp;
+ {
+ tree type = TREE_TYPE (exp);
+- tree aref;
+ tree offset;
+ tree index;
+
+@@ -128,24 +109,14 @@ build_headof (exp)
+ return error_mark_node;
+ }
+
+- /* If we don't have rtti stuff, get to a sub-object that does. */
+- if (!CLASSTYPE_VFIELDS (TREE_TYPE (TREE_TYPE (exp))))
+- exp = build_headof_sub (exp);
+-
+ /* We use this a couple of times below, protect it. */
+ exp = save_expr (exp);
+
+- /* Under the new ABI, the offset-to-top field is at index -2 from
+- the vptr. */
++ /* The offset-to-top field is at index -2 from the vptr. */
+ index = build_int_2 (-2, -1);
+
+- aref = build_vtbl_ref (build_indirect_ref (exp, NULL_PTR), index);
++ offset = build_vtbl_ref (build_indirect_ref (exp, NULL), index);
+
+- if (flag_vtable_thunks)
+- offset = aref;
+- else
+- offset = build_component_ref (aref, delta_identifier, NULL_TREE, 0);
+-
+ type = build_qualified_type (ptr_type_node,
+ CP_TYPE_QUALS (TREE_TYPE (exp)));
+ return build (PLUS_EXPR, type, exp,
+@@ -220,22 +191,12 @@ get_tinfo_decl_dynamic (exp)
+ tree t;
+ tree index;
+
+- if (! flag_rtti)
+- error ("taking dynamic typeid of object with -fno-rtti");
+ if (CLASSTYPE_COM_INTERFACE (type))
+ {
+ cp_error ("RTTI not supported for COM interface type `%T'", type);
+ return error_mark_node;
+ }
+
+- /* If we don't have rtti stuff, get to a sub-object that does. */
+- if (! CLASSTYPE_VFIELDS (type))
+- {
+- exp = build_unary_op (ADDR_EXPR, exp, 0);
+- exp = build_headof_sub (exp);
+- exp = build_indirect_ref (exp, NULL_PTR);
+- }
+-
+ /* The RTTI information is at index -1. */
+ index = integer_minus_one_node;
+ t = build_vtbl_ref (exp, index);
+@@ -462,36 +423,12 @@ get_base_offset (binfo, parent)
+ {
+ if (! TREE_VIA_VIRTUAL (binfo))
+ return BINFO_OFFSET (binfo);
+- else if (! vbase_offsets_in_vtable_p ())
+- {
+- const char *name;
+- tree result;
+- tree field;
+-
+- FORMAT_VBASE_NAME (name, BINFO_TYPE (binfo));
+- field = lookup_field (parent, get_identifier (name), 0, 0);
+- result = byte_position (field);
+-
+- if (DECL_CONTEXT (field) != parent)
+- {
+- /* The vbase pointer might be in a non-virtual base of PARENT.
+- * Adjust for the offset of that base in PARENT. */
+- tree path;
+-
+- get_base_distance (DECL_CONTEXT (field), parent, -1, &path);
+- result = build (PLUS_EXPR, TREE_TYPE (result),
+- result, BINFO_OFFSET (path));
+- result = fold (result);
+- }
+- return result;
+- }
+ else
+- /* Under the new ABI, we store the vtable offset at which
+- the virtual base offset can be found. */
++ /* We store the vtable offset at which the virtual base offset can
++ be found. */
+ return convert (sizetype,
+ BINFO_VPTR_FIELD (binfo_for_vbase (BINFO_TYPE (binfo),
+ parent)));
+-
+ }
+
+ /* Execute a dynamic cast, as described in section 5.2.6 of the 9/93 working
+@@ -600,28 +537,15 @@ build_dynamic_cast_1 (type, expr)
+ /* If *type is an unambiguous accessible base class of *exprtype,
+ convert statically. */
+ {
+- int distance;
+- tree path;
+-
+- distance = get_base_distance (TREE_TYPE (type), TREE_TYPE (exprtype), 1,
+- &path);
++ tree binfo;
+
+- if (distance == -2)
+- {
+- cp_error ("dynamic_cast from `%T' to ambiguous base class `%T'",
+- TREE_TYPE (exprtype), TREE_TYPE (type));
+- return error_mark_node;
+- }
+- if (distance == -3)
+- {
+- cp_error ("dynamic_cast from `%T' to private base class `%T'",
+- TREE_TYPE (exprtype), TREE_TYPE (type));
+- return error_mark_node;
+- }
++ binfo = lookup_base (TREE_TYPE (exprtype), TREE_TYPE (type),
++ ba_not_special, NULL);
+
+- if (distance >= 0)
++ if (binfo)
+ {
+- expr = build_vbase_path (PLUS_EXPR, type, expr, path, 0);
++ expr = build_base_path (PLUS_EXPR, convert_from_reference (expr),
++ binfo, 0);
+ if (TREE_CODE (exprtype) == POINTER_TYPE)
+ expr = non_lvalue (expr);
+ return expr;
+@@ -843,8 +767,8 @@ tinfo_base_init (desc, target)
+ DECL_EXTERNAL (name_decl) = 0;
+ TREE_PUBLIC (name_decl) = 1;
+ comdat_linkage (name_decl);
+- /* The new ABI specifies the external name of the string
+- containing the type's name. */
++ /* External name of the string containing the type's name has a
++ special name. */
+ SET_DECL_ASSEMBLER_NAME (name_decl,
+ mangle_typeinfo_string_for_type (target));
+ DECL_INITIAL (name_decl) = name_string;
+@@ -1232,7 +1156,11 @@ create_real_tinfo_var (target_type, name
+ tree decl;
+ tree hidden_name;
+ char hidden[30];
+-
++
++ /* We cannot give this the name NAME, as that already is globally
++ bound to the tinfo_decl we originally created for this type in
++ get_tinfo_decl. */
++
+ sprintf (hidden, "%.*s_%d",
+ IDENTIFIER_LENGTH (tinfo_decl_id), IDENTIFIER_POINTER (tinfo_decl_id),
+ count++);
+@@ -1314,8 +1242,7 @@ create_pseudo_type_info VPARAMS((const c
+ vtable_decl = get_vtable_decl (real_type, /*complete=*/1);
+ vtable_decl = build_unary_op (ADDR_EXPR, vtable_decl, 0);
+
+- /* Under the new ABI, we need to point into the middle of the
+- vtable. */
++ /* We need to point into the middle of the vtable. */
+ vtable_decl = build (PLUS_EXPR,
+ TREE_TYPE (vtable_decl),
+ vtable_decl,
+Index: gcc/cp/search.c
+===================================================================
+RCS file: /cvs/gcc/gcc/gcc/cp/search.c,v
+retrieving revision 1.202.2.6
+diff -u -p -r1.202.2.6 search.c
+--- gcc/cp/search.c 2001/06/08 17:12:41 1.202.2.6
++++ gcc/cp/search.c 2002/02/01 22:44:49
+@@ -83,26 +83,21 @@ struct vbase_info
+ tree inits;
+ };
+
+-static tree get_vbase_1 PARAMS ((tree, tree, unsigned int *));
+ static tree lookup_field_1 PARAMS ((tree, tree));
+ static int is_subobject_of_p PARAMS ((tree, tree, tree));
+-static tree virtual_context PARAMS ((tree, tree, tree));
+ static tree dfs_check_overlap PARAMS ((tree, void *));
+ static tree dfs_no_overlap_yet PARAMS ((tree, void *));
+ static int get_base_distance_recursive
+ PARAMS ((tree, int, int, int, int *, tree *, tree,
+ int, int *, int, int));
++static base_kind lookup_base_r
++ PARAMS ((tree, tree, base_access,
++ int, int, int, tree *));
+ static int dynamic_cast_base_recurse PARAMS ((tree, tree, int, tree *));
+-static void expand_upcast_fixups
+- PARAMS ((tree, tree, tree, tree, tree, tree, tree *));
+-static void fixup_virtual_upcast_offsets
+- PARAMS ((tree, tree, int, int, tree, tree, tree, tree,
+- tree *));
+ static tree marked_pushdecls_p PARAMS ((tree, void *));
+ static tree unmarked_pushdecls_p PARAMS ((tree, void *));
+ static tree dfs_debug_unmarkedp PARAMS ((tree, void *));
+ static tree dfs_debug_mark PARAMS ((tree, void *));
+-static tree dfs_init_vbase_pointers PARAMS ((tree, void *));
+ static tree dfs_get_vbase_types PARAMS ((tree, void *));
+ static tree dfs_push_type_decls PARAMS ((tree, void *));
+ static tree dfs_push_decls PARAMS ((tree, void *));
+@@ -140,7 +135,6 @@ static tree get_shared_vbase_if_not_prim
+ static tree dfs_find_vbase_instance PARAMS ((tree, void *));
+ static tree dfs_get_pure_virtuals PARAMS ((tree, void *));
+ static tree dfs_build_inheritance_graph_order PARAMS ((tree, void *));
+-static tree dfs_vtable_path_unmark PARAMS ((tree, void *));
+
+ /* Allocate a level of searching. */
+
+@@ -177,76 +171,6 @@ static int n_contexts_saved;
+ #endif /* GATHER_STATISTICS */
+
+
+-/* Get a virtual binfo that is found inside BINFO's hierarchy that is
+- the same type as the type given in PARENT. To be optimal, we want
+- the first one that is found by going through the least number of
+- virtual bases.
+-
+- This uses a clever algorithm that updates *depth when we find the vbase,
+- and cuts off other paths of search when they reach that depth. */
+-
+-static tree
+-get_vbase_1 (parent, binfo, depth)
+- tree parent, binfo;
+- unsigned int *depth;
+-{
+- tree binfos;
+- int i, n_baselinks;
+- tree rval = NULL_TREE;
+- int virtualp = TREE_VIA_VIRTUAL (binfo) != 0;
+-
+- *depth -= virtualp;
+- if (virtualp && BINFO_TYPE (binfo) == parent)
+- {
+- *depth = 0;
+- return binfo;
+- }
+-
+- binfos = BINFO_BASETYPES (binfo);
+- n_baselinks = binfos ? TREE_VEC_LENGTH (binfos) : 0;
+-
+- /* Process base types. */
+- for (i = 0; i < n_baselinks; i++)
+- {
+- tree base_binfo = TREE_VEC_ELT (binfos, i);
+- tree nrval;
+-
+- if (*depth == 0)
+- break;
+-
+- nrval = get_vbase_1 (parent, base_binfo, depth);
+- if (nrval)
+- rval = nrval;
+- }
+- *depth += virtualp;
+- return rval;
+-}
+-
+-/* Return the shortest path to vbase PARENT within BINFO, ignoring
+- access and ambiguity. */
+-
+-tree
+-get_vbase (parent, binfo)
+- tree parent;
+- tree binfo;
+-{
+- unsigned int d = (unsigned int)-1;
+- return get_vbase_1 (parent, binfo, &d);
+-}
+-
+-/* Convert EXPR to a virtual base class of type TYPE. We know that
+- EXPR is a non-null POINTER_TYPE to RECORD_TYPE. We also know that
+- the type of what expr points to has a virtual base of type TYPE. */
+-
+-tree
+-convert_pointer_to_vbase (type, expr)
+- tree type;
+- tree expr;
+-{
+- tree vb = get_vbase (type, TYPE_BINFO (TREE_TYPE (TREE_TYPE (expr))));
+- return convert_pointer_to_real (vb, expr);
+-}
+-
+ /* Check whether the type given in BINFO is derived from PARENT. If
+ it isn't, return 0. If it is, but the derivation is MI-ambiguous
+ AND protect != 0, emit an error message and return error_mark_node.
+@@ -414,9 +338,6 @@ get_base_distance_recursive (binfo, dept
+ If PROTECT is greater than 1, ignore any special access the current
+ scope might have when determining whether PARENT is inaccessible.
+
+- PARENT can also be a binfo, in which case that exact parent is found
+- and no other. convert_pointer_to_real uses this functionality.
+-
+ If BINFO is a binfo, its BINFO_INHERITANCE_CHAIN will be left alone. */
+
+ int
+@@ -476,21 +397,198 @@ get_base_distance (parent, binfo, protec
+ if (rval && protect && rval_private)
+ return -3;
+
+- /* If they gave us the real vbase binfo, which isn't in the main binfo
+- tree, deal with it. This happens when we are called from
+- expand_upcast_fixups. */
+- if (rval == -1 && TREE_CODE (parent) == TREE_VEC
+- && parent == binfo_for_vbase (BINFO_TYPE (parent), type))
+- {
+- new_binfo = parent;
+- rval = 1;
+- }
+-
+ if (path_ptr)
+ *path_ptr = new_binfo;
+ return rval;
+ }
+
++/* Worker for lookup_base. BINFO is the binfo we are searching at,
++ BASE is the RECORD_TYPE we are searching for. ACCESS is the
++ required access checks. WITHIN_CURRENT_SCOPE, IS_NON_PUBLIC and
++ IS_VIRTUAL indicate how BINFO was reached from the start of the
++ search. WITHIN_CURRENT_SCOPE is true if we met the current scope,
++ or friend thereof (this allows us to determine whether a protected
++ base is accessible or not). IS_NON_PUBLIC indicates whether BINFO
++ is accessible and IS_VIRTUAL indicates if it is morally virtual.
++
++ If BINFO is of the required type, then *BINFO_PTR is examined to
++ compare with any other instance of BASE we might have already
++ discovered. *BINFO_PTR is initialized and a base_kind return value
++ indicates what kind of base was located.
++
++ Otherwise BINFO's bases are searched. */
++
++static base_kind
++lookup_base_r (binfo, base, access, within_current_scope,
++ is_non_public, is_virtual, binfo_ptr)
++ tree binfo, base;
++ base_access access;
++ int within_current_scope;
++ int is_non_public; /* inside a non-public part */
++ int is_virtual; /* inside a virtual part */
++ tree *binfo_ptr;
++{
++ int i;
++ tree bases;
++ base_kind found = bk_not_base;
++
++ if (access == ba_check
++ && !within_current_scope
++ && is_friend (BINFO_TYPE (binfo), current_scope ()))
++ {
++ within_current_scope = 1;
++ is_non_public = 0;
++ }
++
++ if (same_type_p (BINFO_TYPE (binfo), base))
++ {
++ /* We have found a base. Check against what we have found
++ already. */
++ found = bk_same_type;
++ if (is_virtual)
++ found = bk_via_virtual;
++ if (is_non_public)
++ found = bk_inaccessible;
++
++ if (!*binfo_ptr)
++ *binfo_ptr = binfo;
++ else if (!is_virtual || !tree_int_cst_equal (BINFO_OFFSET (binfo),
++ BINFO_OFFSET (*binfo_ptr)))
++ {
++ if (access != ba_any)
++ *binfo_ptr = NULL;
++ else if (found != is_virtual)
++ /* Prefer a non-virtual base. */
++ *binfo_ptr = binfo;
++ found = bk_ambig;
++ }
++ else if (found == bk_via_virtual)
++ *binfo_ptr = binfo;
++
++ return found;
++ }
++
++ bases = BINFO_BASETYPES (binfo);
++ if (!bases)
++ return bk_not_base;
++
++ for (i = TREE_VEC_LENGTH (bases); i--;)
++ {
++ tree base_binfo = TREE_VEC_ELT (bases, i);
++ int this_non_public = is_non_public;
++ int this_virtual = is_virtual;
++
++ if (access <= ba_ignore)
++ ; /* no change */
++ else if (TREE_VIA_PUBLIC (base_binfo))
++ ; /* no change */
++ else if (access == ba_not_special)
++ this_non_public = 1;
++ else if (TREE_VIA_PROTECTED (base_binfo) && within_current_scope)
++ ; /* no change */
++ else if (is_friend (BINFO_TYPE (binfo), current_scope ()))
++ ; /* no change */
++ else
++ this_non_public = 1;
++
++ if (TREE_VIA_VIRTUAL (base_binfo))
++ this_virtual = 1;
++
++ base_kind bk = lookup_base_r (base_binfo, base,
++ access, within_current_scope,
++ this_non_public, this_virtual,
++ binfo_ptr);
++
++ switch (bk)
++ {
++ case bk_ambig:
++ if (access != ba_any)
++ return bk;
++ found = bk;
++ break;
++
++ case bk_inaccessible:
++ if (found == bk_not_base)
++ found = bk;
++ my_friendly_assert (found == bk_via_virtual
++ || found == bk_inaccessible, 20010723);
++
++ break;
++
++ case bk_same_type:
++ bk = bk_proper_base;
++ /* FALLTHROUGH */
++ case bk_proper_base:
++ my_friendly_assert (found == bk_not_base, 20010723);
++ found = bk;
++ break;
++
++ case bk_via_virtual:
++ my_friendly_assert (found == bk_not_base
++ || found == bk_via_virtual
++ || found == bk_inaccessible, 20010723);
++ found = bk;
++ break;
++
++ case bk_not_base:
++ break;
++ }
++ }
++ return found;
++}
++
++/* Lookup BASE in the hierarchy dominated by T. Do access checking as
++ ACCESS specifies. Return the binfo we discover (which might not be
++ canonical). If KIND_PTR is non-NULL, fill with information about
++ what kind of base we discoveded.
++
++ Issue an error message if an inaccessible or ambiguous base is
++ discovered, and return error_mark_node. */
++
++tree
++lookup_base (t, base, access, kind_ptr)
++ tree t, base;
++ base_access access;
++ base_kind *kind_ptr;
++{
++ tree binfo = NULL; /* The binfo we've found so far. */
++ base_kind bk;
++
++ if (t == error_mark_node || base == error_mark_node)
++ {
++ if (kind_ptr)
++ *kind_ptr = bk_not_base;
++ return error_mark_node;
++ }
++
++ t = TYPE_MAIN_VARIANT (t);
++ base = TYPE_MAIN_VARIANT (base);
++
++ bk = lookup_base_r (TYPE_BINFO (t), base, access, 0, 0, 0, &binfo);
++
++ switch (bk)
++ {
++ case bk_inaccessible:
++ cp_error ("`%T' is an inaccessible base of `%T'", base, t);
++ binfo = error_mark_node;
++ break;
++ case bk_ambig:
++ if (access != ba_any)
++ {
++ cp_error ("`%T' is an ambiguous base of `%T'", base, t);
++ binfo = error_mark_node;
++ }
++ break;
++
++ default:;
++ }
++
++ if (kind_ptr)
++ *kind_ptr = bk;
++
++ return binfo;
++}
++
+ /* Worker function for get_dynamic_cast_base_type. */
+
+ static int
+@@ -1467,15 +1565,6 @@ lookup_field_r (binfo, data)
+ }
+ else
+ {
+- /* If the thing we're looking for is a virtual base class, then
+- we know we've got what we want at this point; there's no way
+- to get an ambiguity. */
+- if (VBASE_NAME_P (lfi->name))
+- {
+- lfi->rval = nval;
+- return nval;
+- }
+-
+ if (from_dep_base_p && TREE_CODE (nval) != TYPE_DECL
+ /* We need to return a member template class so we can
+ define partial specializations. Is there a better
+@@ -2333,391 +2422,6 @@ dfs_unmark (binfo, data)
+ }
+
+
+-static tree
+-dfs_init_vbase_pointers (binfo, data)
+- tree binfo;
+- void *data;
+-{
+- struct vbase_info *vi = (struct vbase_info *) data;
+- tree type = BINFO_TYPE (binfo);
+- tree fields;
+- tree this_vbase_ptr;
+-
+- /* Don't initialize the same base more than once. */
+- SET_BINFO_VTABLE_PATH_MARKED (binfo);
+-
+- /* We know that VI->DECL_PTR points to the complete object. So,
+- finding a pointer to this subobject is easy. */
+- this_vbase_ptr = build (PLUS_EXPR,
+- build_pointer_type (type),
+- vi->decl_ptr,
+- BINFO_OFFSET (binfo));
+-
+- /* We're going to iterate through all the pointers to virtual
+- base-classes. They come at the beginning of the class. */
+- fields = TYPE_FIELDS (type);
+-
+- if (fields == NULL_TREE
+- || DECL_NAME (fields) == NULL_TREE
+- || ! VBASE_NAME_P (DECL_NAME (fields)))
+- return NULL_TREE;
+-
+- if (build_pointer_type (type)
+- != TYPE_MAIN_VARIANT (TREE_TYPE (this_vbase_ptr)))
+- my_friendly_abort (125);
+-
+- while (fields && DECL_NAME (fields) && VBASE_NAME_P (DECL_NAME (fields)))
+- {
+- tree ref = build (COMPONENT_REF, TREE_TYPE (fields),
+- build_indirect_ref (this_vbase_ptr, NULL_PTR), fields);
+- tree init;
+- tree vbase_type;
+- tree vbase_binfo;
+-
+- vbase_type = TREE_TYPE (TREE_TYPE (fields));
+- vbase_binfo = binfo_for_vbase (vbase_type, vi->type);
+- init = build (PLUS_EXPR,
+- build_pointer_type (vbase_type),
+- vi->decl_ptr,
+- BINFO_OFFSET (vbase_binfo));
+- vi->inits
+- = tree_cons (vbase_binfo,
+- build_modify_expr (ref, NOP_EXPR, init),
+- vi->inits);
+- fields = TREE_CHAIN (fields);
+- }
+-
+- return NULL_TREE;
+-}
+-
+-/* Call CLEAR_BINFO_VTABLE_PATH_MARKED for BINFO. */
+-
+-static tree
+-dfs_vtable_path_unmark (binfo, data)
+- tree binfo;
+- void *data ATTRIBUTE_UNUSED;
+-{
+- CLEAR_BINFO_VTABLE_PATH_MARKED (binfo);
+- return NULL_TREE;
+-}
+-
+-tree
+-init_vbase_pointers (type, decl_ptr)
+- tree type;
+- tree decl_ptr;
+-{
+- my_friendly_assert (!vbase_offsets_in_vtable_p (), 20000516);
+-
+- if (TYPE_USES_VIRTUAL_BASECLASSES (type))
+- {
+- struct vbase_info vi;
+- tree binfo = TYPE_BINFO (type);
+-
+- /* Find all the virtual base classes, marking them for later
+- initialization. */
+- vi.type = type;
+- vi.decl_ptr = decl_ptr;
+- vi.inits = NULL_TREE;
+-
+- /* Build up a list of the initializers. */
+- dfs_walk_real (binfo,
+- dfs_init_vbase_pointers, 0,
+- unmarked_vtable_pathp,
+- &vi);
+- dfs_walk (binfo,
+- dfs_vtable_path_unmark,
+- marked_vtable_pathp,
+- NULL);
+-
+- return vi.inits;
+- }
+-
+- return 0;
+-}
+-
+-/* get the virtual context (the vbase that directly contains the
+- DECL_CONTEXT of the FNDECL) that the given FNDECL is declared in,
+- or NULL_TREE if there is none.
+-
+- FNDECL must come from a virtual table from a virtual base to ensure
+- that there is only one possible DECL_CONTEXT.
+-
+- We know that if there is more than one place (binfo) the fndecl that the
+- declared, they all refer to the same binfo. See get_class_offset_1 for
+- the check that ensures this. */
+-
+-static tree
+-virtual_context (fndecl, t, vbase)
+- tree fndecl, t, vbase;
+-{
+- tree path;
+- if (get_base_distance (DECL_CONTEXT (fndecl), t, 0, &path) < 0)
+- {
+- /* DECL_CONTEXT can be ambiguous in t. */
+- if (get_base_distance (DECL_CONTEXT (fndecl), vbase, 0, &path) >= 0)
+- {
+- while (path)
+- {
+- /* Not sure if checking path == vbase is necessary here, but just in
+- case it is. */
+- if (TREE_VIA_VIRTUAL (path) || path == vbase)
+- return binfo_for_vbase (BINFO_TYPE (path), t);
+- path = BINFO_INHERITANCE_CHAIN (path);
+- }
+- }
+- /* This shouldn't happen, I don't want errors! */
+- warning ("recoverable compiler error, fixups for virtual function");
+- return vbase;
+- }
+- while (path)
+- {
+- if (TREE_VIA_VIRTUAL (path))
+- return binfo_for_vbase (BINFO_TYPE (path), t);
+- path = BINFO_INHERITANCE_CHAIN (path);
+- }
+- return 0;
+-}
+-
+-/* Fixups upcast offsets for one vtable.
+- Entries may stay within the VBASE given, or
+- they may upcast into a direct base, or
+- they may upcast into a different vbase.
+-
+- We only need to do fixups in case 2 and 3. In case 2, we add in
+- the virtual base offset to effect an upcast, in case 3, we add in
+- the virtual base offset to effect an upcast, then subtract out the
+- offset for the other virtual base, to effect a downcast into it.
+-
+- This routine mirrors fixup_vtable_deltas in functionality, though
+- this one is runtime based, and the other is compile time based.
+- Conceivably that routine could be removed entirely, and all fixups
+- done at runtime.
+-
+- VBASE_OFFSETS is an association list of virtual bases that contains
+- offset information for the virtual bases, so the offsets are only
+- calculated once. */
+-
+-static void
+-expand_upcast_fixups (binfo, addr, orig_addr, vbase, vbase_addr, t,
+- vbase_offsets)
+- tree binfo, addr, orig_addr, vbase, vbase_addr, t, *vbase_offsets;
+-{
+- tree virtuals;
+- tree vc;
+- tree delta;
+- HOST_WIDE_INT n;
+-
+- while (BINFO_PRIMARY_P (binfo))
+- {
+- binfo = BINFO_INHERITANCE_CHAIN (binfo);
+- if (TREE_VIA_VIRTUAL (binfo))
+- return;
+- }
+-
+- delta = purpose_member (vbase, *vbase_offsets);
+- if (! delta)
+- {
+- delta = build (PLUS_EXPR,
+- build_pointer_type (BINFO_TYPE (vbase)),
+- orig_addr,
+- BINFO_OFFSET (vbase));
+- delta = build (MINUS_EXPR, ptrdiff_type_node, delta, vbase_addr);
+- delta = save_expr (delta);
+- delta = tree_cons (vbase, delta, *vbase_offsets);
+- *vbase_offsets = delta;
+- }
+-
+- for (virtuals = BINFO_VIRTUALS (binfo), n = 0;
+- virtuals;
+- virtuals = TREE_CHAIN (virtuals), ++n)
+- {
+- tree current_fndecl = TREE_VALUE (virtuals);
+-
+- if (current_fndecl
+- && current_fndecl != abort_fndecl
+- && (vc=virtual_context (current_fndecl, t, vbase)) != vbase)
+- {
+- /* This may in fact need a runtime fixup. */
+- tree idx = build_int_2 (n, 0);
+- tree vtbl = BINFO_VTABLE (binfo);
+- tree nvtbl = lookup_name (DECL_NAME (vtbl), 0);
+- tree aref, ref, naref;
+- tree old_delta, new_delta;
+- tree init;
+-
+- if (nvtbl == NULL_TREE
+- || nvtbl == IDENTIFIER_GLOBAL_VALUE (DECL_NAME (vtbl)))
+- {
+- /* Dup it if it isn't in local scope yet. */
+- nvtbl = build_decl
+- (VAR_DECL, DECL_NAME (vtbl),
+- TYPE_MAIN_VARIANT (TREE_TYPE (vtbl)));
+- DECL_ALIGN (nvtbl) = MAX (TYPE_ALIGN (double_type_node),
+- DECL_ALIGN (nvtbl));
+- TREE_READONLY (nvtbl) = 0;
+- DECL_ARTIFICIAL (nvtbl) = 1;
+- nvtbl = pushdecl (nvtbl);
+- init = NULL_TREE;
+- cp_finish_decl (nvtbl, init, NULL_TREE,
+- LOOKUP_ONLYCONVERTING);
+-
+- /* We don't set DECL_VIRTUAL_P and DECL_CONTEXT on nvtbl
+- because they wouldn't be useful; everything that wants to
+- look at the vtable will look at the decl for the normal
+- vtable. Setting DECL_CONTEXT also screws up
+- decl_function_context. */
+-
+- init = build (MODIFY_EXPR, TREE_TYPE (nvtbl),
+- nvtbl, vtbl);
+- finish_expr_stmt (init);
+- /* Update the vtable pointers as necessary. */
+- ref = build_vfield_ref
+- (build_indirect_ref (addr, NULL_PTR),
+- DECL_CONTEXT (TYPE_VFIELD (BINFO_TYPE (binfo))));
+- finish_expr_stmt
+- (build_modify_expr (ref, NOP_EXPR, nvtbl));
+- }
+- assemble_external (vtbl);
+- aref = build_array_ref (vtbl, idx);
+- naref = build_array_ref (nvtbl, idx);
+- old_delta = build_component_ref (aref, delta_identifier,
+- NULL_TREE, 0);
+- new_delta = build_component_ref (naref, delta_identifier,
+- NULL_TREE, 0);
+-
+- /* This is a upcast, so we have to add the offset for the
+- virtual base. */
+- old_delta = cp_build_binary_op (PLUS_EXPR, old_delta,
+- TREE_VALUE (delta));
+- if (vc)
+- {
+- /* If this is set, we need to subtract out the delta
+- adjustments for the other virtual base that we
+- downcast into. */
+- tree vc_delta = purpose_member (vc, *vbase_offsets);
+- if (! vc_delta)
+- {
+- tree vc_addr = convert_pointer_to_real (vc, orig_addr);
+- vc_delta = build (PLUS_EXPR,
+- build_pointer_type (BINFO_TYPE (vc)),
+- orig_addr,
+- BINFO_OFFSET (vc));
+- vc_delta = build (MINUS_EXPR, ptrdiff_type_node,
+- vc_delta, vc_addr);
+- vc_delta = save_expr (vc_delta);
+- *vbase_offsets = tree_cons (vc, vc_delta, *vbase_offsets);
+- }
+- else
+- vc_delta = TREE_VALUE (vc_delta);
+-
+- /* This is a downcast, so we have to subtract the offset
+- for the virtual base. */
+- old_delta = cp_build_binary_op (MINUS_EXPR, old_delta, vc_delta);
+- }
+-
+- TREE_READONLY (new_delta) = 0;
+- TREE_TYPE (new_delta) =
+- cp_build_qualified_type (TREE_TYPE (new_delta),
+- CP_TYPE_QUALS (TREE_TYPE (new_delta))
+- & ~TYPE_QUAL_CONST);
+- finish_expr_stmt (build_modify_expr (new_delta, NOP_EXPR,
+- old_delta));
+- }
+- }
+-}
+-
+-/* Fixup upcast offsets for all direct vtables. Patterned after
+- expand_direct_vtbls_init. */
+-
+-static void
+-fixup_virtual_upcast_offsets (real_binfo, binfo, init_self, can_elide, addr, orig_addr, type, vbase, vbase_offsets)
+- tree real_binfo, binfo;
+- int init_self, can_elide;
+- tree addr, orig_addr, type, vbase, *vbase_offsets;
+-{
+- tree real_binfos = BINFO_BASETYPES (real_binfo);
+- tree binfos = BINFO_BASETYPES (binfo);
+- int i, n_baselinks = real_binfos ? TREE_VEC_LENGTH (real_binfos) : 0;
+-
+- for (i = 0; i < n_baselinks; i++)
+- {
+- tree real_base_binfo = TREE_VEC_ELT (real_binfos, i);
+- tree base_binfo = TREE_VEC_ELT (binfos, i);
+- int is_not_base_vtable
+- = !BINFO_PRIMARY_P (real_base_binfo);
+- if (! TREE_VIA_VIRTUAL (real_base_binfo))
+- fixup_virtual_upcast_offsets (real_base_binfo, base_binfo,
+- is_not_base_vtable, can_elide, addr,
+- orig_addr, type, vbase, vbase_offsets);
+- }
+-#if 0
+- /* Before turning this on, make sure it is correct. */
+- if (can_elide && ! BINFO_MODIFIED (binfo))
+- return;
+-#endif
+- /* Should we use something besides CLASSTYPE_VFIELDS? */
+- if (init_self && CLASSTYPE_VFIELDS (BINFO_TYPE (real_binfo)))
+- {
+- tree new_addr = convert_pointer_to_real (binfo, addr);
+- expand_upcast_fixups (real_binfo, new_addr, orig_addr, vbase, addr,
+- type, vbase_offsets);
+- }
+-}
+-
+-/* Fixup all the virtual upcast offsets for TYPE. DECL_PTR is the
+- address of the sub-object being initialized. */
+-
+-void
+-fixup_all_virtual_upcast_offsets (decl_ptr)
+- tree decl_ptr;
+-{
+- tree if_stmt;
+- tree in_charge_node;
+- tree vbases;
+- tree type;
+-
+- /* Only tweak the vtables if we're in charge. */
+- in_charge_node = current_in_charge_parm;
+- if (!in_charge_node)
+- /* There's no need for any fixups in this case. */
+- return;
+- in_charge_node = cp_build_binary_op (EQ_EXPR,
+- in_charge_node, integer_zero_node);
+- if_stmt = begin_if_stmt ();
+- finish_if_stmt_cond (in_charge_node, if_stmt);
+-
+- /* Iterate through the virtual bases, fixing up the upcast offset
+- for each one. */
+- type = TREE_TYPE (TREE_TYPE (decl_ptr));
+- for (vbases = CLASSTYPE_VBASECLASSES (type);
+- vbases;
+- vbases = TREE_CHAIN (vbases))
+- {
+- if (flag_vtable_thunks)
+- /* We don't have dynamic thunks yet! So for now, just fail
+- silently. */
+- ;
+- else
+- {
+- tree vbase;
+- tree vbase_offsets;
+- tree addr;
+-
+- vbase = find_vbase_instance (TREE_PURPOSE (vbases), type);
+- vbase_offsets = NULL_TREE;
+- addr = convert_pointer_to_vbase (TREE_PURPOSE (vbases), decl_ptr);
+- fixup_virtual_upcast_offsets (vbase,
+- TYPE_BINFO (TREE_PURPOSE (vbases)),
+- 1, 0, addr, decl_ptr,
+- type, vbase, &vbase_offsets);
+- }
+- }
+-
+- /* Close out the if-statement. */
+- finish_then_clause (if_stmt);
+- finish_if_stmt ();
+-}
+-
+ /* get virtual base class types.
+ This adds type to the vbase_types list in reverse dfs order.
+ Ordering is very important, so don't change it. */
+Index: gcc/cp/semantics.c
+===================================================================
+RCS file: /cvs/gcc/gcc/gcc/cp/semantics.c,v
+retrieving revision 1.189.2.19
+diff -u -p -r1.189.2.19 semantics.c
+--- gcc/cp/semantics.c 2002/01/31 22:46:46 1.189.2.19
++++ gcc/cp/semantics.c 2002/02/01 22:44:51
+@@ -2349,7 +2349,7 @@ emit_associated_thunks (fn)
+ is so that you can know statically the entire set of thunks that
+ will ever be needed for a given virtual function, thereby
+ enabling you to output all the thunks with the function itself. */
+- if (vcall_offsets_in_vtable_p () && DECL_VIRTUAL_P (fn))
++ if (DECL_VIRTUAL_P (fn))
+ {
+ tree binfo;
+ tree v;
+@@ -2415,8 +2415,8 @@ expand_body (fn)
+ simplify_aggr_init_exprs_r,
+ NULL);
+
+- /* If this is a constructor or destructor body, we have to clone it
+- under the new ABI. */
++ /* If this is a constructor or destructor body, we have to clone
++ it. */
+ if (maybe_clone_body (fn))
+ {
+ /* We don't want to process FN again, so pretend we've written
+Index: gcc/cp/tree.c
+===================================================================
+RCS file: /cvs/gcc/gcc/gcc/cp/tree.c,v
+retrieving revision 1.232.2.10
+diff -u -p -r1.232.2.10 tree.c
+--- gcc/cp/tree.c 2001/11/30 03:12:44 1.232.2.10
++++ gcc/cp/tree.c 2002/02/01 22:44:52
+@@ -2220,12 +2220,6 @@ cp_valid_lang_attribute (attr_name, attr
+ }
+ if (is_attribute_p ("com_interface", attr_name))
+ {
+- if (! flag_vtable_thunks)
+- {
+- error ("`com_interface' only supported with -fvtable-thunks");
+- return 0;
+- }
+-
+ if (attr_args != NULL_TREE
+ || decl != NULL_TREE
+ || ! CLASS_TYPE_P (type)
+Index: gcc/cp/typeck.c
+===================================================================
+RCS file: /cvs/gcc/gcc/gcc/cp/typeck.c,v
+retrieving revision 1.337.2.11
+diff -u -p -r1.337.2.11 typeck.c
+--- gcc/cp/typeck.c 2001/11/20 04:39:23 1.337.2.11
++++ gcc/cp/typeck.c 2002/02/01 22:44:58
+@@ -114,8 +114,11 @@ require_complete_type (value)
+ {
+ tree base, member = TREE_OPERAND (value, 1);
+ tree basetype = TYPE_OFFSET_BASETYPE (type);
++
+ my_friendly_assert (TREE_CODE (member) == FIELD_DECL, 305);
+- base = convert_pointer_to (basetype, current_class_ptr);
++ basetype = lookup_base (current_class_type, basetype, ba_check, NULL);
++ base = build_base_path (PLUS_EXPR, current_class_ptr, basetype, 1);
++
+ value = build (COMPONENT_REF, TREE_TYPE (member),
+ build_indirect_ref (base, NULL_PTR), member);
+ return require_complete_type (value);
+@@ -2235,23 +2238,15 @@ build_component_ref (datum, component, b
+ /* Handle base classes here... */
+ if (base != basetype && TYPE_BASE_CONVS_MAY_REQUIRE_CODE_P (basetype))
+ {
+- tree addr = build_unary_op (ADDR_EXPR, datum, 0);
+- if (integer_zerop (addr))
++ tree binfo = lookup_base (TREE_TYPE (datum), base, ba_check, NULL);
++
++ if (TREE_CODE (datum) == INDIRECT_REF
++ && integer_zerop (TREE_OPERAND (datum, 0)))
+ {
+ error ("invalid reference to NULL ptr, use ptr-to-member instead");
+ return error_mark_node;
+- }
+- if (VBASE_NAME_P (DECL_NAME (field)))
+- {
+- /* It doesn't matter which vbase pointer we grab, just
+- find one of them. */
+- tree binfo = get_binfo (base,
+- TREE_TYPE (TREE_TYPE (addr)), 0);
+- addr = convert_pointer_to_real (binfo, addr);
+ }
+- else
+- addr = convert_pointer_to (base, addr);
+- datum = build_indirect_ref (addr, NULL_PTR);
++ datum = build_base_path (PLUS_EXPR, datum, binfo, 1);
+ if (datum == error_mark_node)
+ return error_mark_node;
+ }
+@@ -2842,8 +2837,11 @@ build_x_function_call (function, params,
+ if (TREE_CODE (TREE_TYPE (decl)) != POINTER_TYPE
+ && ! TYPE_PTRMEMFUNC_P (TREE_TYPE (decl)))
+ {
++ tree binfo = lookup_base (TREE_TYPE (decl), TREE_TYPE (ctypeptr),
++ ba_check, NULL);
++
+ decl = build_unary_op (ADDR_EXPR, decl, 0);
+- decl = convert_pointer_to (TREE_TYPE (ctypeptr), decl);
++ decl = build_base_path (PLUS_EXPR, decl, binfo, 1);
+ }
+ else
+ decl = build_c_cast (ctypeptr, decl);
+@@ -2862,13 +2860,11 @@ get_member_function_from_ptrfunc (instan
+ tree function;
+ {
+ if (TREE_CODE (function) == OFFSET_REF)
+- {
+- function = TREE_OPERAND (function, 1);
+- }
++ function = TREE_OPERAND (function, 1);
+
+ if (TYPE_PTRMEMFUNC_P (TREE_TYPE (function)))
+ {
+- tree fntype, idx, e1, delta, delta2, e2, e3, aref, vtbl;
++ tree fntype, idx, e1, delta, delta2, e2, e3, vtbl;
+ tree instance, basetype;
+
+ tree instance_ptr = *instance_ptrptr;
+@@ -2893,14 +2889,18 @@ get_member_function_from_ptrfunc (instan
+ fntype = TYPE_PTRMEMFUNC_FN_TYPE (TREE_TYPE (function));
+ basetype = TYPE_METHOD_BASETYPE (TREE_TYPE (fntype));
+
+- /* Convert down to the right base, before using the instance. */
+- instance = convert_pointer_to_real (basetype, instance_ptr);
++ /* Convert down to the right base, before using the instance. */
++ instance = lookup_base (TREE_TYPE (TREE_TYPE (instance_ptr)), basetype,
++ ba_check, NULL);
++ instance = build_base_path (PLUS_EXPR, instance_ptr, instance, 1);
+ if (instance == error_mark_node && instance_ptr != error_mark_node)
+ return instance;
+
+ e3 = PFN_FROM_PTRMEMFUNC (function);
+-
+- vtbl = convert_pointer_to (ptr_type_node, instance);
++
++ vtbl = build1 (NOP_EXPR, build_pointer_type (ptr_type_node), instance);
++ TREE_CONSTANT (vtbl) = TREE_CONSTANT (instance);
++
+ delta = cp_convert (ptrdiff_type_node,
+ build_component_ref (function, delta_identifier,
+ NULL_TREE, 0));
+@@ -2950,27 +2950,8 @@ get_member_function_from_ptrfunc (instan
+ build_pointer_type (build_pointer_type (vtable_entry_type)),
+ vtbl, cp_convert (ptrdiff_type_node, delta2));
+ vtbl = build_indirect_ref (vtbl, NULL_PTR);
+- aref = build_array_ref (vtbl, idx);
+-
+- if (! flag_vtable_thunks)
+- {
+- aref = save_expr (aref);
+-
+- delta = cp_build_binary_op
+- (PLUS_EXPR,
+- build_conditional_expr (e1,
+- build_component_ref (aref,
+- delta_identifier,
+- NULL_TREE, 0),
+- integer_zero_node),
+- delta);
+- }
++ e2 = build_array_ref (vtbl, idx);
+
+- if (flag_vtable_thunks)
+- e2 = aref;
+- else
+- e2 = build_component_ref (aref, pfn_identifier, NULL_TREE, 0);
+-
+ /* When using function descriptors, the address of the
+ vtable entry is treated as a function pointer. */
+ if (TARGET_VTABLE_USES_DESCRIPTORS)
+@@ -4277,8 +4258,11 @@ build_component_addr (arg, argtype)
+ /* Can't convert directly to ARGTYPE, since that
+ may have the same pointer type as one of our
+ baseclasses. */
+- rval = build1 (NOP_EXPR, argtype,
+- convert_pointer_to (basetype, rval));
++ tree binfo = lookup_base (TREE_TYPE (TREE_TYPE (rval)), basetype,
++ ba_check, NULL);
++
++ rval = build_base_path (PLUS_EXPR, rval, binfo, 1);
++ rval = build1 (NOP_EXPR, argtype, rval);
+ TREE_CONSTANT (rval) = TREE_CONSTANT (TREE_OPERAND (rval, 0));
+ }
+ else
+@@ -6107,8 +6091,7 @@ build_ptrmemfunc (type, pfn, force)
+ delta = build_component_ref (pfn, delta_identifier, NULL_TREE, 0);
+ }
+
+- /* Under the new ABI, the conversion is easy. Just adjust
+- the DELTA field. */
++ /* Just adjust the DELTA field. */
+ delta = cp_convert (ptrdiff_type_node, delta);
+ if (TARGET_PTRMEMFUNC_VBIT_LOCATION == ptrmemfunc_vbit_in_delta)
+ n = cp_build_binary_op (LSHIFT_EXPR, n, integer_one_node);
+@@ -6173,10 +6156,9 @@ expand_ptrmemfunc_cst (cst, delta, pfn)
+ *delta = fold (build (PLUS_EXPR, TREE_TYPE (*delta),
+ *delta, BINFO_OFFSET (binfo)));
+
+- /* Under the new ABI, we set PFN to the vtable offset at
+- which the function can be found, plus one (unless
+- ptrmemfunc_vbit_in_delta, in which case delta is shifted
+- left, and then incremented). */
++ /* We set PFN to the vtable offset at which the function can be
++ found, plus one (unless ptrmemfunc_vbit_in_delta, in which
++ case delta is shifted left, and then incremented). */
+ *pfn = DECL_VINDEX (fn);
+ *pfn = fold (build (MULT_EXPR, integer_type_node, *pfn,
+ TYPE_SIZE_UNIT (vtable_entry_type)));
+Index: gcc/cp/typeck2.c
+===================================================================
+RCS file: /cvs/gcc/gcc/gcc/cp/typeck2.c,v
+retrieving revision 1.97.2.2
+diff -u -p -r1.97.2.2 typeck2.c
+--- gcc/cp/typeck2.c 2001/04/12 05:26:11 1.97.2.2
++++ gcc/cp/typeck2.c 2002/02/01 22:44:58
+@@ -980,12 +980,17 @@ build_scoped_ref (datum, basetype)
+ tree basetype;
+ {
+ tree ref;
++ tree binfo;
+
+ if (datum == error_mark_node)
+ return error_mark_node;
++ binfo = lookup_base (TREE_TYPE (datum), basetype, ba_check, NULL);
+
++ if (!binfo)
++ return error_not_base_type (TREE_TYPE (datum), basetype);
++
+ ref = build_unary_op (ADDR_EXPR, datum, 0);
+- ref = convert_pointer_to (basetype, ref);
++ ref = build_base_path (PLUS_EXPR, ref, binfo, 1);
+
+ return build_indirect_ref (ref, "(compiler error in build_scoped_ref)");
+ }
diff --git a/contrib/gcc_build b/contrib/gcc_build
index 61b34e21fc5..4d0eea30b6b 100755
--- a/contrib/gcc_build
+++ b/contrib/gcc_build
@@ -9,7 +9,7 @@
# Contents:
# Script to automatically download and build GCC.
#
-# Copyright (c) 2000 Free Software Foundation.
+# Copyright (c) 2000, 2001 Free Software Foundation.
#
# This file is part of GNU CC.
#
@@ -127,7 +127,7 @@ update_gcc() {
changedir ${DESTINATION}
# Update the tree
- ./contrib/gcc_update || \
+ ./contrib/gcc_update -d || \
error "Could not update GCC"
}
@@ -146,6 +146,7 @@ configure_gcc() {
changedir ${OBJDIR}
# Configure the tree.
+ echo "Configuring: ${DESTINATION}/configure ${CONFIGURE_OPTIONS}"
eval ${DESTINATION}/configure ${CONFIGURE_OPTIONS} || \
error "Could not configure the compiler"
}
@@ -159,6 +160,7 @@ bootstrap_gcc() {
changedir ${OBJDIR}
# Bootstrap the compiler
+ echo "Building: ${MAKE} ${MAKE_BOOTSTRAP_OPTIONS} bootstrap"
eval ${MAKE} ${MAKE_BOOTSTRAP_OPTIONS} bootstrap || \
error "Could not bootstrap the compiler"
}
diff --git a/contrib/gcc_release b/contrib/gcc_release
new file mode 100755
index 00000000000..a4e4f83ddaa
--- /dev/null
+++ b/contrib/gcc_release
@@ -0,0 +1,543 @@
+#! /bin/sh
+
+########################################################################
+#
+# File: gcc_release
+# Author: Jeffrey Law, Bernd Schmidt, Mark Mitchell
+# Date: 2001-05-25
+#
+# Contents:
+# Script to create a GCC release.
+#
+# Copyright (c) 2001 Free Software Foundation.
+#
+# This file is part of GNU CC.
+#
+# GNU CC is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# GNU CC is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU CC; see the file COPYING. If not, write to
+# the Free Software Foundation, 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+#
+########################################################################
+
+########################################################################
+# Notes
+########################################################################
+
+# Here is an example usage of this script, to create a GCC 3.0.2
+# prerelease:
+#
+# gcc_release -r 3.0.2
+#
+# This script will automatically use the head of the release branch
+# to generate the release.
+
+########################################################################
+# Functions
+########################################################################
+
+# Issue the error message given by $1 and exit with a non-zero
+# exit code.
+
+error() {
+ echo "gcc_release: error: $1"
+ exit 1
+}
+
+# Issue the informational message given by $1.
+
+inform() {
+ echo "gcc_release: $1"
+}
+
+# Issue a usage message explaining how to use this script.
+
+usage() {
+cat <<EOF
+gcc_release [-d destination]
+ [-u username]
+ [-r release]
+ [-t tag]
+ [-p previous-tarball]
+ [-s] [-f]
+EOF
+ exit 1
+}
+
+# Change to the directory given by $1.
+
+changedir() {
+ cd $1 || \
+ error "Could not change directory to $1"
+}
+
+# Each of the arguments is a directory name, relative to the top
+# of the source tree. Return another name for that directory, relative
+# to the working directory.
+
+adjust_dirs() {
+ for x in $@; do
+ echo `basename ${SOURCE_DIRECTORY}`/$x
+ done
+}
+
+# Build the source tree that will be the basis for the release
+# in ${WORKING_DIRECTORY}/gcc-${RELEASE}.
+
+build_sources() {
+ # If the WORKING_DIRECTORY already exists, do not risk destroying it.
+ if [ -r ${WORKING_DIRECTORY} ]; then
+ error "\`${WORKING_DIRECTORY}' already exists"
+ fi
+ # Create the WORKING_DIRECTORY.
+ mkdir "${WORKING_DIRECTORY}" \
+ || error "Could not create \`${WORKING_DIRECTORY}'"
+ changedir "${WORKING_DIRECTORY}"
+
+ # If this is a final release, make sure that the ChangeLogs
+ # and version strings are updated.
+ if [ ${FINAL} -ne 0 ]; then
+ inform "Updating ChangeLogs and version files"
+
+ ${CVS} co -d "`basename ${SOURCE_DIRECTORY}`" \
+ -r ${BRANCH} gcc || \
+ error "Could not check out release sources"
+ for x in `find ${SOURCE_DIRECTORY} -name ChangeLog`; do
+ cat - ${x} > ${x}.new <<EOF
+`date "+%Y-%m-%d"` Release Manager
+
+ * GCC ${RELEASE} Released.
+
+EOF
+ mv ${x}.new ${x} || \
+ error "Could not update ${x}"
+ (changedir `dirname ${x}` && \
+ ${CVS} ci -m 'Mark ChangeLog' `basename ${x}`) || \
+ error "Could not commit ${x}"
+ done
+
+ # Update `gcc/version.c'. There are other version files
+ # as well, which should have release status updated.
+ for x in gcc/version.c; do
+ y=`basename ${x}`
+ (changedir `dirname ${SOURCE_DIRECTORY}/${x}` && \
+ sed -e 's|= \".*\"|= \"'${RELEASE}'\"|g' < ${y} > ${y}.new && \
+ mv ${y}.new ${y} && \
+ ${CVS} ci -m 'Update version' ${y}) || \
+ error "Could not update ${x}"
+ done
+ for x in gcc/f/version.c libf2c/libF77/Version.c \
+ libf2c/libI77/Version.c libf2c/libU77/Version.c; do
+ y=`basename ${x}`
+ (changedir `dirname ${SOURCE_DIRECTORY}/${x}` && \
+ sed -e 's/experimental\|prerelease/release/g' < ${y} > ${y}.new && \
+ mv ${y}.new ${y} && \
+ ${CVS} ci -m 'Update version' ${y}) || \
+ error "Could not update ${x}"
+ done
+
+ # Make sure we tag the sources for a final release.
+ TAG="gcc_`echo ${RELEASE} | tr . _`_release"
+
+ rm -rf ${SOURCE_DIRECTORY}
+ fi
+
+ # Tag the sources.
+ if [ -n "${TAG}" ]; then
+ inform "Tagging release sources"
+ ${CVS} rtag -r ${BRANCH} -F ${TAG} gcc || \
+ error "Could not tag release sources"
+ BRANCH=$TAG
+ fi
+
+ # Export the current sources.
+ inform "Retrieving release sources"
+ ${CVS} \
+ export -d "`basename ${SOURCE_DIRECTORY}`" \
+ -r ${BRANCH} gcc || \
+ error "Could not retrieve release sources"
+
+ # Run gcc_update on them to set up the timestamps nicely.
+ changedir "gcc-${RELEASE}"
+ contrib/gcc_update --touch
+
+ # Obtain some documentation files from the wwwdocs module.
+ inform "Retrieving HTML documentation"
+ changedir "${WORKING_DIRECTORY}"
+ for x in bugs gnats faq; do
+ (${CVS} export -r HEAD wwwdocs/htdocs/${x}.html && \
+ cp ${WORKING_DIRECTORY}/wwwdocs/htdocs/${x}.html \
+ ${SOURCE_DIRECTORY}) || \
+ error "Could not retrieve ${x}.html"
+ done
+
+ inform "Generating plain-text documentation from HTML"
+ changedir "${SOURCE_DIRECTORY}"
+ for file in *.html; do
+ newfile=`echo $file | sed -e 's/.html//' | tr "[:lower:]" "[:upper:]"`
+ (${ENV} TERM=vt100 lynx -dump $file \
+ | sed -e "s#file://localhost`/bin/pwd`\(.*\)#http://gcc.gnu.org\1#g" \
+ > $newfile) || \
+ error "Could not regenerate documentation"
+ done
+
+ # For a prerelease or real release, we need to generate additional
+ # files not present in CVS.
+ changedir "${SOURCE_DIRECTORY}"
+ if [ $SNAPSHOT -ne 1 ]; then
+ # Generate the documentation.
+ inform "Building install docs"
+ SOURCEDIR=${SOURCE_DIRECTORY}/gcc/doc
+ DESTDIR=${SOURCE_DIRECTORY}/INSTALL
+ export SOURCEDIR
+ export DESTDIR
+ ${SOURCE_DIRECTORY}/gcc/doc/install.texi2html
+
+ # Regenerate the NEWS file.
+ contrib/gennews > gcc/NEWS || \
+ error "Could not regenerate NEWS files"
+
+ # Now, we must build the compiler in order to create any generated
+ # files that are supposed to go in the source directory. This is
+ # also a good sanity check to make sure that the release builds
+ # on at least one platform.
+ inform "Building compiler"
+ OBJECT_DIRECTORY=../objdir
+ contrib/gcc_build -d ${SOURCE_DIRECTORY} -o ${OBJECT_DIRECTORY} build || \
+ error "Could not rebuild GCC"
+
+ # Regenerate the Fotran NEWS and BUGS files.
+ (cd ${OBJECT_DIRECTORY}/gcc && make f77.rebuilt) || \
+ error "Could not regenerate Fortran NEWS and BUGS files"
+ fi
+
+ # Move message catalogs to source directory.
+ mv ../objdir/gcc/po/*.gmo gcc/po/
+
+ # Create a `.brik' file to use for checking the validity of the
+ # release.
+ changedir "${SOURCE_DIRECTORY}"
+ BRIK_FILE=`mktemp /tmp/gcc_release.XXXXXXX`
+ ((find . -type f | sort > $BRIK_FILE) && \
+ brik -Gb -f ${BRIK_FILE} > .brik && \
+ rm ${BRIK_FILE}) || \
+ error "Could not compute brik checksum"
+}
+
+# Buid a single tarfile. The first argument is the name of the name
+# of the tarfile to build, without any suffixes. They will be added
+# automatically. The rest of the arguments are the files or
+# directories to include.
+
+build_tarfile() {
+ # Get the name of the destination tar file.
+ TARFILE="$1.tar.gz"
+ shift
+
+ # Build the tar file itself.
+ (${TAR} cf - "$@" | ${GZIP} > ${TARFILE}) || \
+ error "Could not build tarfile"
+ FILE_LIST="${FILE_LIST} ${TARFILE}"
+}
+
+# Build the various tar files for the release.
+
+build_tarfiles() {
+ inform "Building tarfiles"
+
+ changedir "${WORKING_DIRECTORY}"
+
+ # The GNU Coding Standards specify that all files should
+ # world readable.
+ chmod -R a+r ${SOURCE_DIRECTORY}
+ # And that all directories have mode 777.
+ find ${SOURCE_DIRECTORY} -type d -exec chmod 777 {} \;
+
+ # Build one huge tarfile for the entire distribution.
+ build_tarfile gcc-${RELEASE} `basename ${SOURCE_DIRECTORY}`
+
+ # Now, build one for each of the languages.
+ build_tarfile gcc-g++-${RELEASE} ${CPLUSPLUS_DIRS}
+ build_tarfile gcc-g77-${RELEASE} ${FORTRAN_DIRS}
+ build_tarfile gcc-java-${RELEASE} ${JAVA_DIRS}
+ build_tarfile gcc-objc-${RELEASE} ${OBJECTIVEC_DIRS}
+ build_tarfile gcc-testsuite-${RELEASE} ${TESTSUITE_DIRS}
+
+ # The core is everything else.
+ EXCLUDES=""
+ for x in ${CPLUSPLUS_DIRS} ${FORTRAN_DIRS} ${JAVA_DIRS} \
+ ${OBJECTIVEC_DIRS} ${TESTSUITE_DIRS}; do
+ EXCLUDES="${EXCLUDES} --exclude $x"
+ done
+ build_tarfile gcc-core-${RELEASE} ${EXCLUDES} \
+ `basename ${SOURCE_DIRECTORY}`
+
+ # Possibly build diffs.
+ if [ -n "$OLD_TARS" ]; then
+ for old_tar in $OLD_TARS; do
+ build_diffs $old_tar
+ done
+ fi
+
+ # Build .bz2 files.
+ for f in ${FILE_LIST}; do
+ bzfile=${f%.gz}.bz2
+ zcat $f | ${BZIP2} > ${bzfile}
+ FILE_LIST="${FILE_LIST} ${bzfile}"
+ done
+}
+
+# Build diffs against an old release.
+build_diffs() {
+ old_dir=${1%/*}
+ old_file=${1##*/}
+ old_vers=${old_file%.tar.gz}
+ old_vers=${old_vers#gcc-}
+ inform "Building diffs against version $old_vers"
+ for f in gcc 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
+ if [ -e $old_tar ] && [ -e $new_tar ]; then
+ build_diff $old_tar gcc-${old_vers} $new_tar gcc-${RELEASE} \
+ ${f}-${old_vers}-${RELEASE}.diff.gz
+ fi
+ done
+}
+
+# Build an individual diff.
+build_diff() {
+ changedir "${WORKING_DIRECTORY}"
+ 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 | ${GZIP} > ../$5
+ if [ $? -eq 2 ]; then
+ error "Trouble making diffs from $1 to $3"
+ fi
+ changedir ..
+ rm -rf $tmpdir
+ FILE_LIST="${FILE_LIST} $5"
+}
+
+# Upload the files to the FTP server.
+
+upload_files() {
+ inform "Uploading files"
+
+ changedir "${WORKING_DIRECTORY}"
+
+ # Copy the tar files to the FTP server.
+ for x in gcc*.gz gcc*.bz2; do
+ if [ -e ${x} ]; then
+ # Make sure the file will be readable on the server.
+ chmod a+r ${x}
+ # Copy it.
+ ${SCP} -p ${x} ${FTP_PATH} || \
+ error "Could not upload ${x}"
+ fi
+ done
+}
+
+########################################################################
+# Initialization
+########################################################################
+
+# Today's date.
+DATE=`date "+%Y%m%d"`
+
+# The CVS server containing the GCC repository.
+CVS_SERVER="gcc.gnu.org"
+# The path to the repository on that server.
+CVS_REPOSITORY="/cvs/gcc"
+# The CVS protocol to use.
+CVS_PROTOCOL="ext"
+# The username to use when connecting to the server.
+CVS_USERNAME="${USER}"
+
+# The path to the directory where the files are uploaded for FTP.
+FTP_PATH="gccadmin@gcc.gnu.org:~ftp/pub/gcc"
+
+# The major number for the release. For release `3.0.2' this would be
+# `3'
+RELEASE_MAJOR=""
+# The minor number for the release. For release `3.0.2' this would be
+# `0'.
+RELEASE_MINOR=""
+# The revision number for the release. For release `3.0.2' this would
+# be `2'.
+RELEASE_REVISION=""
+# The complete name of the release.
+RELEASE=""
+
+# The name of the branch from which the release should be made.
+BRANCH=""
+
+# The tag to apply to the sources used for the release.
+TAG=""
+
+# The old tarballs from which to generate diffs.
+OLD_TARS=""
+
+# The directory that will be used to construct the release. The
+# release itself will be placed in a subdirectory of this diretory.
+DESTINATION=${HOME}
+# The subdirectory.
+WORKING_DIRECTORY=""
+# The directory that will contain the GCC sources.
+SOURCE_DIRECTORY=""
+
+# The directories that should be part of the various language-specific
+# tar files. These are all relative to the top of the source tree.
+CPLUSPLUS_DIRS="gcc/cp libstdc++-v3"
+FORTRAN_DIRS="gcc/f libf2c"
+JAVA_DIRS="gcc/java libjava libffi fastjar zlib boehm-gc"
+OBJECTIVEC_DIRS="gcc/objc libobjc"
+TESTSUITE_DIRS="gcc/testsuite"
+
+# Non-zero if this is the final release, rather than a prerelease.
+FINAL=0
+
+# Non-zero if we are building a snapshot, and don't build gcc or
+# include generated files.
+SNAPSHOT=0
+
+# Major operation modes.
+MODE_SOURCES=0
+MODE_TARFILES=0
+MODE_UPLOAD=0
+
+# Files generated to upload.
+FILE_LIST=""
+
+# Programs we use.
+
+BZIP2="${BZIP2:-bzip2}"
+CVS="${CVS:-cvs -f -Q -z9}"
+DIFF="${DIFF:-diff -Nrc3pad}"
+ENV="${ENV:-env}"
+GZIP="${GZIP:-gzip --best}"
+SCP="${SCP:-scp}"
+TAR="${TAR:-tar}"
+
+########################################################################
+# Command Line Processing
+########################################################################
+
+# Parse the options.
+while getopts "d:fr:u:t:p:s" ARG; do
+ case $ARG in
+ d) DESTINATION="${OPTARG}";;
+ r) RELEASE="${OPTARG}";;
+ t) TAG="${OPTARG}";;
+ u) CVS_USERNAME="${OPTARG}";;
+ f) FINAL=1;;
+ s) SNAPSHOT=1;;
+ p) OLD_TARS="${OLD_TARS} ${OPTARG}";;
+ \?) usage;;
+ esac
+done
+shift `expr ${OPTIND} - 1`
+
+# Perform consistency checking.
+if [ -z ${CVS_USERNAME} ]; then
+ error "No username specified"
+fi
+
+if [ -z ${RELEASE} ]; then
+ error "No release number specified"
+fi
+
+if [ ! -d ${DESTINATION} ]; then
+ error "\`${DESTINATION}' is not a directory"
+fi
+
+# Compute the major and minor release numbers.
+RELEASE_MAJOR=`echo $RELEASE | awk --assign FS=. '{ print $1; }'`
+RELEASE_MINOR=`echo $RELEASE | awk --assign FS=. '{ print $2; }'`
+RELEASE_REVISION=`echo $RELEASE | awk --assign FS=. '{ print $3; }'`
+
+if [ -z "${RELEASE_MAJOR}" ] || [ -z "${RELEASE_MINOR}" ]; then
+ error "Release number \`${RELEASE}' is invalid"
+fi
+
+# Compute the full name of the release.
+if [ -z "${RELEASE_REVISION}" ]; then
+ RELEASE="${RELEASE_MAJOR}.${RELEASE_MINOR}"
+else
+ RELEASE="${RELEASE_MAJOR}.${RELEASE_MINOR}.${RELEASE_REVISION}"
+fi
+
+# Compute the name of the branch, which is based solely on the major
+# and minor release numbers.
+BRANCH="gcc-${RELEASE_MAJOR}_${RELEASE_MINOR}-branch"
+
+# If this is not a final release, set various parameters acordingly.
+if [ ${FINAL} -ne 1 ]; then
+ RELEASE="${RELEASE}-${DATE}"
+ FTP_PATH="${FTP_PATH}/snapshots"
+else
+ FTP_PATH="${FTP_PATH}/releases/gcc-${RELEASE}"
+fi
+
+# Compute the name of the WORKING_DIRECTORY and the SOURCE_DIRECTORY.
+WORKING_DIRECTORY="${DESTINATION}/gcc-${RELEASE}"
+SOURCE_DIRECTORY="${WORKING_DIRECTORY}/gcc-${RELEASE}"
+
+# Recompute the names of all the language-specific directories,
+# relative to the WORKING_DIRECTORY.
+CPLUSPLUS_DIRS=`adjust_dirs ${CPLUSPLUS_DIRS}`
+FORTRAN_DIRS=`adjust_dirs ${FORTRAN_DIRS}`
+JAVA_DIRS=`adjust_dirs ${JAVA_DIRS}`
+OBJECTIVEC_DIRS=`adjust_dirs ${OBJECTIVEC_DIRS}`
+TESTSUITE_DIRS=`adjust_dirs ${TESTSUITE_DIRS}`
+
+# Set up CVSROOT.
+CVSROOT=":${CVS_PROTOCOL}:${CVS_USERNAME}@"
+CVSROOT="${CVSROOT}${CVS_SERVER}:${CVS_REPOSITORY}"
+export CVSROOT
+
+########################################################################
+# Main Program
+########################################################################
+
+# Handle the major modes.
+while [ $# -ne 0 ]; do
+ case $1 in
+ sources) MODE_SOURCES=1;;
+ tarfiles) MODE_TARFILES=1;;
+ upload) MODE_UPLOAD=1;;
+ all) MODE_SOURCES=1; MODE_TARFILES=1; MODE_UPLOAD=1;;
+ *) error "Unknown mode $1";;
+ esac
+ shift
+done
+
+# Build the source directory.
+
+if [ $MODE_SOURCES -ne 0 ]; then
+ build_sources
+fi
+
+# Build the tar files.
+
+if [ $MODE_TARFILES -ne 0 ]; then
+ build_tarfiles
+fi
+
+# Upload them to the FTP server.
+
+if [ $MODE_UPLOAD -ne 0 ]; then
+ upload_files
+fi
diff --git a/contrib/gcc_update b/contrib/gcc_update
index 573b0bd6ff8..2f4fe660b05 100755
--- a/contrib/gcc_update
+++ b/contrib/gcc_update
@@ -66,16 +66,21 @@ gcc/configure: gcc/configure.in
gcc/cstamp-h.in: gcc/configure.in gcc/acconfig.h
gcc/config.in: gcc/cstamp-h.in
gcc/fixinc/fixincl.x: gcc/fixinc/fixincl.tpl gcc/fixinc/inclhack.def
-gcc/gcov.1: gcc/gcov.texi
-gcc/cpp.1: gcc/cpp.texi
-gcc/gcc.1: gcc/invoke.texi
+gcc/doc/gcov.1: gcc/doc/gcov.texi
+gcc/doc/cpp.1: gcc/doc/cpp.texi
+gcc/doc/gcc.1: gcc/doc/invoke.texi
+gcc/doc/fsf-funding.7: gcc/doc/include/funding.texi
+gcc/doc/gfdl.7: gcc/doc/include/fdl.texi
+gcc/doc/gpl.7: gcc/doc/include/gpl.texi
# And then, language-specific files
-# (None at present.)
+gcc/f/intdoc.texi: gcc/f/intdoc.in gcc/f/intdoc.c gcc/f/intrin.h gcc/f/intrin.def
# And libraries, at last
libchill/configure: libchill/configure.in
libf2c/configure: libf2c/configure.in
libf2c/libF77/configure: libf2c/libF77/configure.in
libf2c/libI77/configure: libf2c/libI77/configure.in
+libf2c/libI77/stamp-h.in: libf2c/libI77/configure.in
+libf2c/libI77/config.h.in: libf2c/libI77/configure.in libf2c/libI77/stamp-h.in
libf2c/libU77/configure: libf2c/libU77/configure.in
libf2c/libU77/stamp-h.in: libf2c/libU77/configure.in libf2c/libU77/acconfig.h
libobjc/configure: libobjc/configure.in
@@ -98,31 +103,28 @@ EOF
}
-# This function checks whether its first argument is newer than all
-# the other arguments. It returns success (0) otherwise.
-is_out_of_date () {
- test `ls -1dt ${1+"$@"} | sed 1q` != "$1"
-}
-
-
# This function touches generated files such that the ``end'' user does
# not have to rebuild them.
touch_files () {
- files_and_dependencies | while read f deps; do
- if test -f $f && is_out_of_date "$f" $deps; then
- echo Touching "$f"...
- touch $f
- if is_out_of_date "$f" $deps; then
- # Hmm, it may have got the same timestamp as one of
- # its touched dependencies. Wait a second and retry.
- sleep 1
- echo Touching "$f" once more...
- touch $f
- fi
- fi
- done
+ rm -f Makefile.$$
+ echo 'all: \' > Makefile.$$
+ files_and_dependencies | sed 's, .*, \\,' >> Makefile.$$
+ echo '; @true' >> Makefile.$$
+ files_and_dependencies | sed 's, ,: ,' >> Makefile.$$
+ files_and_dependencies | sed 's, .*, \\,' >> Makefile.$$
+ echo ':' >> Makefile.$$
+ echo ' @for f in $?; do test -f $$f || exit 0; done; \' >> Makefile.$$
+ echo ' echo Touching $@...; \' >> Makefile.$$
+ echo ' echo Touching $@... 1>&2; \' >> Makefile.$$
+ echo ' touch $@' >> Makefile.$$
+ files_and_dependencies | sed 's,[^ ]* ,,;s,$, :,' >> Makefile.$$
+ while ${MAKE-make} -f Makefile.$$ all | grep . > /dev/null; do
+ sleep 1
+ done 2>&1
+ rm -f Makefile.$$
}
+
# Whenever we update the tree or install a patch, we may be modifying
# this script. By re-execing it, we ensure that the appropriate
# dependencies and rules will be used.
@@ -215,4 +217,8 @@ if [ $? -ne 0 ]; then
exit 1
fi
+{
+ date
+ TZ=UTC date
+} > LAST_UPDATED
touch_files_reexec
diff --git a/contrib/gennews b/contrib/gennews
index 8d4b2a29f00..2afc2be3d79 100755
--- a/contrib/gennews
+++ b/contrib/gennews
@@ -3,7 +3,7 @@
# Script to generate the NEWS file from online release notes.
# Contributed by Joseph Myers <jsm28@cam.ac.uk>.
#
-# Copyright (C) 2000 Free Software Foundation, Inc.
+# Copyright (C) 2000, 2001 Free Software Foundation, Inc.
# This file is part of GNU CC.
#
# GNU CC is free software; you can redistribute it and/or modify
@@ -22,11 +22,9 @@
# Boston, MA 02111-1307, USA.
website=http://gcc.gnu.org/
-files="gcc-2.95/gcc-2.95.3.html gcc-2.95/gcc-2.95.2.html
- gcc-2.95/gcc-2.95.1.html gcc-2.95/gcc-2.95.html
- gcc-2.95/features.html gcc-2.95/caveats.html
- egcs-1.1/egcs-1.1.2.html egcs-1.1/egcs-1.1.1.html egcs-1.1/egcs-1.1.html
- egcs-1.1/features.html egcs-1.1/caveats.html
+files="gcc-3.0/gcc-3.0.html gcc-3.0/features.html gcc-3.0/caveats.html
+ gcc-2.95/index.html gcc-2.95/features.html gcc-2.95/caveats.html
+ egcs-1.1/index.html egcs-1.1/features.html egcs-1.1/caveats.html
egcs-1.0/egcs-1.0.3.html egcs-1.0/egcs-1.0.2.html egcs-1.0/egcs-1.0.1.html
egcs-1.0/egcs-1.0.html egcs-1.0/features.html egcs-1.0/caveats.html"
@@ -48,6 +46,9 @@ echo $header
for file in $files; do
wfile=$website$file
echo $wfile
- lynx -dump $wfile
+ # We lie to Lynx about the kind of terminal in use because we
+ # want to get consistent output everywhere, and we want this
+ # script to work even when it is not run interactively.
+ env TERM=vt100 lynx -dump $wfile
echo $header
done
diff --git a/contrib/release b/contrib/release
deleted file mode 100644
index b0e6a55f37e..00000000000
--- a/contrib/release
+++ /dev/null
@@ -1,252 +0,0 @@
-#! /bin/sh -x
-#
-# GCC release generation script.
-#
-# Originally written by Jeff Law <law@redhat.com>.
-
-# We need separate variables for the tag in the CVS sources and the
-# name of the release directory. Consider if we have a packaging problem
-# and need to respin the release. The sources do not change, but the release
-# name changes.
-#
-# [[ Not clear. You can purge the old tag and make a new one, too.
-# That way they continue to match. Maximize consistency. ]]
-#
-# We used to use a tag to get the previous release, but it is more reliable to
-# actually unpack the previous release from the ftp directory. Consider files
-# like .brik which are in the release, but not in the repository.
-#
-if test $# != 6 ; then
- echo "usage: release release-tag release-name release_branch last-release-name prerelease dotag"
- exit 1
-fi
-
-release_tag=$1
-release_name=$2
-release_suffix=`echo $release_name | sed -e s#gcc-##`
-release_branch=$3
-last_release_name=$4
-last_release_suffix=`echo $last_release_name | sed -e s#gcc-##`
-prerelease=$5
-dotag=$6
-
-case $last_release_name in
- egcs-1.0*)
- echo "unprotoize.c and README.gcc need special handling"
- exit 1;
- ;;
- egcs-1.1*)
- echo "No java or chill in egcs-1.1*"
- ;;
-
- gcc-2.95*)
- echo "No testsuites in gcc-2.95*"
- ;;
-esac
-
-STATEDIR=${STATEDIR-/home/law}
-GCCBASE=${GCCBASE-${STATEDIR}/gcc}
-TMPDIR=${TMPDIR-/var/tmp}
-export TMPDIR STATEDIR GCCBASE
-
-PATH=${GCCBASE}:$PATH
-
-[ -f ${GCCBASE}/gcc.pot ] || {
- echo "'${GCCBASE}/gcc.pot' is missing"
- exit 1
-}
-
-[ -f ${STATEDIR}/bin/brik ] || {
- echo "'${STATEDIR}/bin/brik' is missing"
- exit 1
-}
-
-# We run this on the cvs server itself so we can get at the cvs
-# files quickly. It also assumes access to my home dir for some
-# programs.
-CVSROOT=/cvs/gcc
-export CVSROOT
-
-# Get somewhere useful with a lot of disk space.
-cd $TMPDIR
-
-# Get into a temporary directory so as not to be confused by
-# any existing CVS administration files.
-rm -rf $$
-mkdir $$
-cd $$
-
-if test $prerelease = no -a $dotag = yes; then
- update_changelogs $release_name $release_branch
-fi
-
-# If requested, tag the branch. Three steps, first remove the old tag from
-# the repository, then check out the release branch, then retag the release
-# branch.
-if test $dotag = yes; then
- rm -rf gcc
- cvs -Q rtag -d $release_tag gcc
- cvs -Q co -r $release_branch gcc
- cvs -Q tag -f $release_tag
- rm -rf gcc
-fi
-
-# Get a copy of the previous release. Get it from the ftp dir to avoid minor
-# issues with files like .brik not being in the repository.
-if test $prerelease = yes; then
- echo "Yow!"
- exit 1;
- zcat ~ftp/pub/gcc/snapshots/egcs-1.1.2-prerelease/$last_release_name.tar.gz | tar xf -
-else
- zcat ~ftp/pub/gcc/releases/$last_release_name/$last_release_name.tar.gz | tar xf -
-fi
-
-# Files/directories which are not part of the gcc-core module.
-noncore_files="gcc/cp libio libstdc++ gcc/f libf2c gcc/objc libobjc gcc/ch libchill gcc/java libjava gcc/testsuite"
-
-# Get the gcc core. Note that the gcc-core module doesn't work yet, so
-# we get the whole directory, then prune the things we do not want.
-#
-# Also, get the latest copy of the installation instructions and the
-# faq in html, build plaintext versions of those documents.
-cvs -Q export -ko -r$release_tag gcc
-cd gcc
-contrib/gcc_update --touch
-cp ${GCCBASE}/gcc.pot gcc/po
-cd ..
-cvs -Q export -ko -Dnow wwwdocs/htdocs/install
-cvs -Q export -ko -Dnow wwwdocs/htdocs/faq.html
-#cvs -Q export -ko -Dnow wwwdocs/htdocs/bugs.html
-mv gcc $release_name
-release_docs $release_name $$
-
-# Build a list of files in this release.
-cd $release_name
-find . -type f -print | sort > ../files_$release_name
-${STATEDIR}/bin/brik -Gb -f ../files_$release_name > ../.brik_$release_name
-cp ../.brik_$release_name ./.brik
-
-# Get back to the directory with the two releases in it.
-cd ..
-
-# Remove anything that is not part of the core
-for file in $noncore_files; do
- rm -rf $last_release_name/$file
- rm -rf $release_name/$file
-done
-
-# Make the core tarball
-tar cf - $release_name | gzip --best > gcc-core-$release_suffix.tar.gz
-
-# make empty directories for directories that disappeared so that
-# patch will delete any files in those directories when patching up to
-# this release
-case $last_release_name in
- gcc-2.95*)
- mkdir $release_name/xiberty
- mkdir $release_name/contrib/fixinc
- ;;
-esac
-
-# Diff the core modules
-diff -x de.gmo -x fr.gmo -Nrc3p $last_release_name $release_name > gcc-core-$last_release_suffix-$release_suffix.diff
-
-# Remove the core gunk
-rm -rf $last_release_name
-rm -rf $release_name
-
-
-# Go back and get the full distributions.
-if test $prerelease = yes; then
- zcat ~ftp/pub/gcc/snapshots/egcs-1.1.2-prerelease/$last_release_name.tar.gz | tar xf -
-else
- zcat ~ftp/pub/gcc/releases/$last_release_name/$last_release_name.tar.gz | tar xf -
-fi
-
-cvs -Q export -ko -r$release_tag gcc
-cd gcc
-contrib/gcc_update --touch
-cp ${GCCBASE}/gcc.pot gcc/po
-cd ..
-cvs -Q export -ko -Dnow wwwdocs/htdocs/install
-cvs -Q export -ko -Dnow wwwdocs/htdocs/faq.html
-#cvs -Q export -ko -Dnow wwwdocs/htdocs/bugs.html
-mv gcc $release_name
-find $release_name/gcc/testsuite -type f -print | xargs rm -f
-release_docs $release_name $$
-
-
-# No need to regenerate the .brik file. We didn't delete it.
-cp .brik_$release_name $release_name/.brik
-
-# We don't need this anymore.
-rm .brik_$release_name
-rm .brik_$last_release_name
-
-# Make tarballs
-
-tar cf - $release_name/.brik $release_name/gcc/f $release_name/libf2c | gzip --best > gcc-g77-$release_suffix.tar.gz
-tar cf - $release_name/.brik $release_name/gcc/java | gzip --best > gcc-java-$release_suffix.tar.gz
-tar cf - $release_name/.brik $release_name/gcc/ch $release_name/libchill | gzip --best > gcc-chill-$release_suffix.tar.gz
-#tar cf - $release_name/.brik $release_name/gcc/testsuite/g77.f-torture | gzip --best > gcc-g77-testsuite-$release_suffix.tar.gz
-tar cf - $release_name/.brik $release_name/gcc/objc $release_name/libobjc | gzip --best > gcc-objc-$release_suffix.tar.gz
-tar cf - $release_name/.brik $release_name/gcc/cp $release_name/libio $release_name/libstdc++ | gzip --best > gcc-g++-$release_suffix.tar.gz
-#tar cf - $release_name/.brik $release_name/gcc/testsuite/g++.old-deja | gzip --best > gcc-g++-tests-$release_suffix.tar.gz
-#tar cf - $release_name/.brik $release_name/gcc/testsuite | gzip --best > gcc-tests-$release_suffix.tar.gz
-tar cf - $release_name | gzip --best > $release_name.tar.gz
-# make empty directories for directories that disappeared so that
-# patch will delete any files in those directories when patching up to
-# this release
-# make empty directories for directories that disappeared so that
-# patch will delete any files in those directories when patching up to
-# this release
-case $last_release_name in
- gcc-2.95*)
- mkdir $release_name/xiberty
- mkdir $release_name/contrib/fixinc
- ;;
-esac
-
-# Now make diffs for g77, g77-testsuite objc, g++, g++-testsuite, testsuite,
-# then the whole bloody thing. Add libobjc, java & chill for next major
-#release.
-diff -x de.gmo -x fr.gmo -Nrc3p $last_release_name/gcc/f $release_name/gcc/f > gcc-g77-$last_release_suffix-$release_suffix.diff
-diff -x de.gmo -x fr.gmo -Nrc3p $last_release_name/libf2c $release_name/libf2c >> gcc-g77-$last_release_suffix-$release_suffix.diff
-
-#diff -x de.gmo -x fr.gmo -Nrc3p $last_release_name/gcc/testsuite/g77.f-torture $release_name/gcc/testsuite/g77.f-torture > gcc-g77-testsuite-$last_release_suffix-$release_suffix.diff
-
-diff -x de.gmo -x fr.gmo -Nrc3p $last_release_name/gcc/ch $release_name/gcc/ch > gcc-chill-$last_release_suffix-$release_suffix.diff
-diff -x de.gmo -x fr.gmo -Nrc3p $last_release_name/libchill $release_name/libchill >> gcc-chill-$last_release_suffix-$release_suffix.diff
-
-diff -x de.gmo -x fr.gmo -Nrc3p $last_release_name/gcc/java $release_name/gcc/java > gcc-java-$last_release_suffix-$release_suffix.diff
-#diff -x de.gmo -x fr.gmo -Nrc3p $last_release_name/libf2c $release_name/libf2c >> gcc-java-$last_release_suffix-$release_suffix.diff
-
-diff -x de.gmo -x fr.gmo -Nrc3p $last_release_name/gcc/objc $release_name/gcc/objc > gcc-objc-$last_release_suffix-$release_suffix.diff
-mkdir $last_release_name/libobjc
-diff -x de.gmo -x fr.gmo -Nrc3p $last_release_name/libobjc $release_name/libobjc >> gcc-objc-$last_release_suffix-$release_suffix.diff
-
-diff -x de.gmo -x fr.gmo -Nrc3p $last_release_name/gcc/cp $release_name/gcc/cp > gcc-g++-$last_release_suffix-$release_suffix.diff
-diff -x de.gmo -x fr.gmo -Nrc3p $last_release_name/libio $release_name/libio >> gcc-g++-$last_release_suffix-$release_suffix.diff
-diff -x de.gmo -x fr.gmo -Nrc3p $last_release_name/libstdc++ $release_name/libstdc++ >> gcc-g++-$last_release_suffix-$release_suffix.diff
-
-#diff -x de.gmo -x fr.gmo -Nrc3p $last_release_name/gcc/testsuite/g++.old-deja $release_name/gcc/testsuite/g++.old-deja > gcc-g++-tests-$last_release_suffix-$release_suffix.diff
-
-#diff -x de.gmo -x fr.gmo -Nrc3p $last_release_name/gcc/testsuite $release_name/gcc/testsuite > gcc-tests-$last_release_suffix-$release_suffix.diff
-
-diff -x de.gmo -x fr.gmo -Nrc3p $last_release_name $release_name > gcc-$last_release_suffix-$release_suffix.diff
-
-
-# Remove the old snapshot, we're done with it.
-rm -rf $last_release_name
-
-
-# Compress the diff files.
-gzip --best *.diff
-
-# bzip everything too
-
-# Copy them to the FTP server XXX
-
-# Update links on the ftp server XXX
-
-# Announce it XXX
diff --git a/contrib/test_summary b/contrib/test_summary
index 65b9a764ffa..a1bf474d7eb 100755
--- a/contrib/test_summary
+++ b/contrib/test_summary
@@ -63,7 +63,7 @@ while true; do
esac
done
: ${mailto="\" address \""}; export mailto
-files=`find . -name \*.sum$filesuffix -print`
+files=`find . -name \*.sum$filesuffix -print | sort`
anyfile=false anychange=$forcemail &&
for file in $files; do
[ -f $file ] &&
@@ -95,6 +95,12 @@ BEGIN {
'${prepend_logs+" system(\"cat $prepend_logs\"); "}'
}
$1 ~ /\/configure$/ {
+ srcdir = $1;
+ gsub(/\/configure$/, "", srcdir);
+ printf "LAST_UPDATED: ";
+ system("tail -1 " srcdir "/LAST_UPDATED");
+ print "";
+
$1 = "configure flags:"; configflags = $0;
gsub(/--with-gcc-version-trigger=[^ ]* /, "", configflags);
gsub(/ --norecursion/, "", configflags)
diff --git a/contrib/texi2pod.pl b/contrib/texi2pod.pl
index a58bca08012..8c8b4f98593 100755
--- a/contrib/texi2pod.pl
+++ b/contrib/texi2pod.pl
@@ -1,5 +1,24 @@
#! /usr/bin/perl -w
+# Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
+
+# This file is part of GNU CC.
+
+# GNU CC is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# GNU CC is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with GNU CC; see the file COPYING. If not, write to
+# the Free Software Foundation, 59 Temple Place - Suite 330,
+# Boston MA 02111-1307, USA.
+
# This does trivial (and I mean _trivial_) conversion of Texinfo
# markup to Perl POD format. It's intended to be used to extract
# something suitable for a manpage from a Texinfo document.
@@ -52,6 +71,7 @@ while(<STDIN>)
|(?:end\s+)?group # @group .. @end group: ditto
|page # @page: ditto
|node # @node: useful only in .info file
+ |(?:end\s+)?ifnottex # @ifnottex .. @end ifnottex: use contents
)\b/x and next;
chomp;
@@ -83,17 +103,17 @@ while(<STDIN>)
# Ignore @end foo, where foo is not an operation which may
# cause us to skip, if we are presently skipping.
my $ended = $1;
- next if $skipping && $ended !~ /^(?:ifset|ifclear|ignore|menu)$/;
+ next if $skipping && $ended !~ /^(?:ifset|ifclear|ignore|menu|iftex)$/;
die "\@end $ended without \@$ended at line $.\n" unless defined $endw;
die "\@$endw ended by \@end $ended at line $.\n" unless $ended eq $endw;
$endw = pop @endwstack;
- if ($ended =~ /^(?:ifset|ifclear|ignore|menu)$/) {
+ if ($ended =~ /^(?:ifset|ifclear|ignore|menu|iftex)$/) {
$skipping = pop @skstack;
next;
- } elsif ($ended =~ /^(?:example|smallexample)$/) {
+ } elsif ($ended =~ /^(?:example|smallexample|display)$/) {
$shift = "";
$_ = ""; # need a paragraph break
} elsif ($ended =~ /^(?:itemize|enumerate|table)$/) {
@@ -123,7 +143,7 @@ while(<STDIN>)
next;
};
- /^\@(ignore|menu)\b/ and do {
+ /^\@(ignore|menu|iftex)\b/ and do {
push @endwstack, $endw;
push @skstack, $skipping;
$endw = $1;
@@ -152,6 +172,12 @@ while(<STDIN>)
s/\@\{/&lbrace;/g;
s/\@\}/&rbrace;/g;
s/\@\@/&at;/g;
+
+ # Inside a verbatim block, handle @var specially.
+ if ($shift ne "") {
+ s/\@var\{([^\}]*)\}/<$1>/g;
+ }
+
# POD doesn't interpret E<> inside a verbatim block.
if ($shift eq "") {
s/</&lt;/g;
@@ -165,7 +191,7 @@ while(<STDIN>)
/^\@set\s+([a-zA-Z0-9_-]+)\s*(.*)$/ and $defs{$1} = $2, next;
/^\@clear\s+([a-zA-Z0-9_-]+)/ and delete $defs{$1}, next;
- /^\@section\s+(.+)$/ and $_ = "\n=head2 $1\n";
+ /^\@(?:section|unnumbered|unnumberedsec|center)\s+(.+)$/ and $_ = "\n=head2 $1\n";
/^\@subsection\s+(.+)$/ and $_ = "\n=head3 $1\n";
# Block command handlers:
@@ -177,7 +203,7 @@ while(<STDIN>)
$endw = "itemize";
};
- /^\@enumerate(?:\s+([A-Z0-9]+))?/ and do {
+ /^\@enumerate(?:\s+([a-zA-Z0-9]+))?/ and do {
push @endwstack, $endw;
push @icstack, $ic;
if (defined $1) {
@@ -201,7 +227,7 @@ while(<STDIN>)
$endw = "table";
};
- /^\@((?:small)?example)/ and do {
+ /^\@((?:small)?example|display)/ and do {
push @endwstack, $endw;
$endw = $1;
$shift = "\t";
@@ -214,7 +240,8 @@ while(<STDIN>)
$_ = "\n=item $ic\&LT;$1\&GT;\n";
} else {
$_ = "\n=item $ic\n";
- $ic =~ y/A-Ya-y1-8/B-Zb-z2-9/;
+ $ic =~ y/A-Ya-y/B-Zb-z/;
+ $ic =~ s/(\d+)/$1 + 1/eg;
}
};
@@ -260,9 +287,6 @@ sub postprocess
s/\@w\{([^\}]*)\}/S<$1>/g;
s/\@(?:dmn|math)\{([^\}]*)\}/$1/g;
- # Handle @r inside bold.
- 1 while s/B<((?:[^<>]|I<[^<>]*>)*)R<([^>]*)>/B<$1>${2}B</g;
-
# Cross references are thrown away, as are @noindent and @refill.
# (@noindent is impossible in .pod, and @refill is unnecessary.)
# @* is also impossible in .pod; we discard it and any newline that
@@ -284,9 +308,11 @@ sub postprocess
s/\@uref\{([^\},]*),([^\},]*),([^\},]*)\}/$3/g;
# Turn B<blah I<blah> blah> into B<blah> I<blah> B<blah> to
- # match Texinfo semantics of @emph inside @samp.
+ # match Texinfo semantics of @emph inside @samp. Also handle @r
+ # inside bold.
s/&LT;/</g;
s/&GT;/>/g;
+ 1 while s/B<((?:[^<>]|I<[^<>]*>)*)R<([^>]*)>/B<$1>${2}B</g;
1 while (s/B<([^<>]*)I<([^>]+)>/B<$1>I<$2>B</g);
1 while (s/I<([^<>]*)B<([^>]+)>/I<$1>B<$2>I</g);
s/[BI]<>//g;
diff --git a/fastjar/ChangeLog b/fastjar/ChangeLog
index d34f7d8c3aa..f3e48719b58 100644
--- a/fastjar/ChangeLog
+++ b/fastjar/ChangeLog
@@ -1,3 +1,35 @@
+2002-02-20 Release Manager
+
+ * GCC 3.0.4 Released.
+
+2002-02-20 Release Manager
+
+ * GCC 3.0.4 Released.
+
+2001-12-20 Release Manager
+
+ * GCC 3.0.3 Released.
+
+2001-10-23 Release Manager
+
+ * GCC 3.0.2 Released.
+
+2001-08-19 Release Manager
+
+ * GCC 3.0.1 Released.
+
+2001-08-19 Release Manager
+
+ * GCC 3.0.1 Released.
+
+20010617 Release Manager
+
+ * GCC 3.0 Released.
+
+2001-05-15 Per Bothner <per@bothner.com>
+
+ * Makefile.am (bin_PROGRAMS): Renamed from "fastjar" to "jar".
+
2001-01-21 Tom Tromey <tromey@redhat.com>
* Makefile.in: Rebuilt.
diff --git a/fastjar/Makefile.am b/fastjar/Makefile.am
index b75f077b907..a4393fa55c4 100644
--- a/fastjar/Makefile.am
+++ b/fastjar/Makefile.am
@@ -40,11 +40,11 @@ AM_MAKEFLAGS = \
INCLUDES = -I. -I$(top_srcdir) $(ZINCS)
-bin_PROGRAMS = fastjar
+bin_PROGRAMS = jar
EXTRA_PROGRAMS = grepjar
-fastjar_SOURCES = jartool.c dostime.c compress.c pushback.c jartool.h zipfile.h dostime.h compress.h pushback.h
-fastjar_LDADD = $(ZLIBS)
-fastjar_DEPENDENCIES = $(ZDEPS)
+jar_SOURCES = jartool.c dostime.c compress.c pushback.c jartool.h zipfile.h dostime.h compress.h pushback.h
+jar_LDADD = $(ZLIBS)
+jar_DEPENDENCIES = $(ZDEPS)
grepjar_SOURCES = jargrep.c dostime.c compress.c pushback.c jartool.h zipfile.h dostime.h compress.h pushback.h
grepjar_LDADD = $(ZLIBS)
grepjar_DEPENDENCIES = $(ZDEPS)
diff --git a/fastjar/Makefile.in b/fastjar/Makefile.in
index acb85e335ef..04f93c1645d 100644
--- a/fastjar/Makefile.in
+++ b/fastjar/Makefile.in
@@ -114,11 +114,11 @@ AM_MAKEFLAGS = \
INCLUDES = -I. -I$(top_srcdir) $(ZINCS)
-bin_PROGRAMS = fastjar
+bin_PROGRAMS = jar
EXTRA_PROGRAMS = grepjar
-fastjar_SOURCES = jartool.c dostime.c compress.c pushback.c jartool.h zipfile.h dostime.h compress.h pushback.h
-fastjar_LDADD = $(ZLIBS)
-fastjar_DEPENDENCIES = $(ZDEPS)
+jar_SOURCES = jartool.c dostime.c compress.c pushback.c jartool.h zipfile.h dostime.h compress.h pushback.h
+jar_LDADD = $(ZLIBS)
+jar_DEPENDENCIES = $(ZDEPS)
grepjar_SOURCES = jargrep.c dostime.c compress.c pushback.c jartool.h zipfile.h dostime.h compress.h pushback.h
grepjar_LDADD = $(ZLIBS)
grepjar_DEPENDENCIES = $(ZDEPS)
@@ -137,8 +137,8 @@ LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
grepjar_OBJECTS = jargrep.o dostime.o compress.o pushback.o
grepjar_LDFLAGS =
-fastjar_OBJECTS = jartool.o dostime.o compress.o pushback.o
-fastjar_LDFLAGS =
+jar_OBJECTS = jartool.o dostime.o compress.o pushback.o
+jar_LDFLAGS =
CFLAGS = @CFLAGS@
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
@@ -152,8 +152,8 @@ DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = tar
GZIP_ENV = --best
-SOURCES = $(grepjar_SOURCES) $(fastjar_SOURCES)
-OBJECTS = $(grepjar_OBJECTS) $(fastjar_OBJECTS)
+SOURCES = $(grepjar_SOURCES) $(jar_SOURCES)
+OBJECTS = $(grepjar_OBJECTS) $(jar_OBJECTS)
all: all-redirect
.SUFFIXES:
@@ -251,9 +251,9 @@ grepjar: $(grepjar_OBJECTS) $(grepjar_DEPENDENCIES)
@rm -f grepjar
$(LINK) $(grepjar_LDFLAGS) $(grepjar_OBJECTS) $(grepjar_LDADD) $(LIBS)
-fastjar: $(fastjar_OBJECTS) $(fastjar_DEPENDENCIES)
- @rm -f fastjar
- $(LINK) $(fastjar_LDFLAGS) $(fastjar_OBJECTS) $(fastjar_LDADD) $(LIBS)
+jar: $(jar_OBJECTS) $(jar_DEPENDENCIES)
+ @rm -f jar
+ $(LINK) $(jar_LDFLAGS) $(jar_OBJECTS) $(jar_LDADD) $(LIBS)
tags: TAGS
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index fbaa4c6cd60..a01d55607fd 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,7115 @@
+2002-02-20 Release Manager
+
+ * GCC 3.0.4 Released.
+
+2002-02-20 Release Manager
+
+ * GCC 3.0.4 Released.
+
+2002-02-19 Eric Christopher <echristo@redhat.com>
+
+ PR 5405 Backport march/mtune patches for compatibility with
+ recent binutils.
+ * config/mips/mips.c (mips_parse_cpu): New.
+ (mips_arch, mips_arch_string): Ditto.
+ (mips_tune, mips_tune_string): Ditto.
+ (override_options): Use above. Add warning for isa and arch
+ incompatibility.
+ (mips_asm_file_start): Use above.
+ * config/mips/mips.h (mips_cpu_attr): Use mips_tune.
+ (TARGET_OPTIONS): Add mtune/march.
+ Change mips_cpu to mips_tune for scheduling.
+ * config/mips/mips.md: Change mips_cpu to mips_arch in patterns.
+
+2002-02-19 Robert Lipe <robertlipe@usa.net>
+
+ * config/i386/t-sco5gas: (CRTSTUFF_T_CFLAGS_S): Delete -mcoff.
+
+2002-02-14 Bob Wilson <bob.wilson@acm.org>
+
+ * config/xtensa/xm-xtensa.h: Add missing SUCCESS_EXIT_CODE
+ and FATAL_EXIT_CODE; remove HAVE_VPRINTF and HAVE_PUTENV.
+ * config/xtensa/lib1funcs.asm: Fix copyright to include
+ special case for libgcc files.
+ * config/xtensa/lib2funcs.S: Likewise.
+
+2002-02-14 Janis Johnson <janis187@us.ibm.com>
+
+ * config.gcc (i*86-sequent-sysv4): Fix setting of tm_file.
+
+2002-02-13 Jeroen Dobbelaere <jeroen.dobbelaere@acunia.com>
+
+ * config/arm/linux-elf.h (CPLUSPLUS_CPP_SPEC): Define.
+ Required for libstdc++ to work with glibc.
+
+2002-02-08 Philip Blundell <pb@nexus.co.uk>
+
+ Fix PR 5209:
+ * rtlanal.c (parms_set, find_first_parameter_load): Break out
+ from ...
+ * except.c (sjlj_mark_call_sites): ... here. Handle multiple
+ sets.
+ * rtl.h (find_first_parameter_load): Add prototype.
+
+2002-02-05 Dale Johannesen <dalej@apple.com>
+
+ * config/rs6000/rs6000.c (rs6000_emit_cmove): Fix mode of
+ if_then_else to match result, not operands.
+
+2002-02-05 Phil Edwards <pme@gcc.gnu.org>
+
+ * configure.in (leb128 support): Test as versions more carefully.
+ * configure: Regenerated.
+
+2002-02-04 Craig Rodrigues <rodrigc@gcc.gnu.org>
+
+ PR target/5584
+ * config/rs6000/aix.h (UNIQUE_SECTION): Fix use of alloca.
+
+2002-02-02 Richard Henderson <rth@redhat.com>
+
+ PR opt/5076
+ * rtl.h (NOTE_INSN_LOOP_END_TOP_COND): New.
+ * rtl.c (note_insn_name): Update.
+ * emit-rtl.c (remove_unnecessary_notes): Kill it.
+ * stmt.c (expand_end_loop): Kill jump opt code. Use LOOP_END_TOP_COND
+ to perform loop rotation.
+ (expand_exit_loop_top_cond): New.
+ * tree.h (expand_exit_loop_top_cond): Declare it.
+ * c-semantics.c (genrtl_while_stmt): Use it.
+ (genrtl_for_stmt): Likewise.
+
+2002-02-01 Craig Rodrigues <rodrigc@gcc.gnu.org>
+
+ * doc/install.texi (avr): Update outdated URL.
+
+2002-01-31 Zack Weinberg <zack@codesourcery.com>
+
+ * c-decl.c (c_expand_body): Reset input_filename from
+ DECL_SOURCE_FILE (fndecl) before calling init_function_start.
+
+2002-01-31 Jeffrey A Law <law@redhat.com>
+
+ * c-common.c (c_expand_start_cond): Expect the IF_STMT node to
+ be passed in, do not build it.
+ (c_begin_if_stmt): New function.
+ (c_begin_while_stmt, c_finish_while_stmt_cond): Likewise.
+ * c-common.h (c_expand_start_cond): Update prototype.
+ (c_begin_if_stmt): Prototype new function.
+ (c_begin_while_stmt, c_finish_while_stmt_cond): Likewise.
+ * c-parse.in (if_prefix): Use c_begin_if_stmt,
+ c_begin_while_stmt and c_finish_while_stmt_cond.
+
+2002-01-31 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * doc/gcc.1: Regenerate.
+
+2002-01-31 Bob Wilson <bob.wilson@acm.org>
+
+ * config/xtensa/elf.h: New file.
+ * config/xtensa/lib1funcs.asm: New file.
+ * config/xtensa/lib2funcs.S: New file.
+ * config/xtensa/linux.h: New file.
+ * config/xtensa/t-xtensa: New file.
+ * config/xtensa/xm-xtensa.h: New file.
+ * config/xtensa/xtensa-config.h: New file.
+ * config/xtensa/xtensa-protos.h: New file.
+ * config/xtensa/xtensa.c: New file.
+ * config/xtensa/xtensa.h: New file.
+ * config/xtensa/xtensa.md: New file.
+ * config.gcc (xtensa-*-elf*): New target.
+ (xtensa-*-linux*): New target.
+ * cse.c (canon_hash): Compare rtx pointers instead of register
+ numbers. This is required for the Xtensa port.
+ * integrate.c (copy_insn_list): Handle case where the static
+ chain is in memory and the memory address has to be copied to
+ a register.
+ * doc/invoke.texi (Option Summary): Add Xtensa options.
+ (Xtensa Options): New node.
+ * doc/md.texi (Machine Constraints): Add Xtensa machine constraints.
+ * doc/install.texi (xtensa-*-elf): New target.
+ (xtensa-*-linux*): New target.
+ * doc/contrib.texi: Add myself.
+
+2002-01-29 Richard Henderson <rth@redhat.com>
+
+ 2001-10-19 Jakub Jelinek <jakub@redhat.com>
+ * config/alpha/alpha.c (summarize_insn): Don't abort on ASM_INPUT.
+
+2002-01-26 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * doc/cpp.1, doc/fsf-funding.7, doc/gcc.1, doc/gcov.1, doc/gfdl.7,
+ doc/gpl.7: Regenerate.
+
+2002-01-24 Alexandre Oliva <aoliva@redhat.com>
+
+ * config/sparc/sparc.md (fix_trunctfdi2): Correct typo in mode.
+
+2002-01-24 Jason Merrill <jason@redhat.com>
+
+ PR c++/2432
+ * config/sparc/sparc.md (call-jump peepholes): Pass the right insn
+ to can_throw_internal.
+
+2002-01-23 Neil Booth <neil@daikokuya.demon.co.uk>
+
+ PR c/3504
+ * doc/extend.texi: Correct documentation of __alignof__.
+
+2002-01-22 Craig Rodrigues <rodrigc@gcc.gnu.org>
+
+ PR java/4972
+ * aclocal.m4 (AM_ICONV): Put linking flags for libiconv
+ in LIBICONV variable.
+ * configure: Regenerated.
+
+2002-01-22 Richard Henderson <rth@redhat.com>
+
+ 2001-09-25 Andrew Haley <aph@cambridge.redhat.com>
+ * except.c (sjlj_mark_call_sites): Change address inside sequence.
+
+2002-01-22 Craig Rodrigues <rodrigc@gcc.gnu.org>
+
+ PR other/5450
+ * config/i386/sysv4.h (CPP_SPEC): Define, and add CPU
+ preprocessor flags.
+
+2001-12-11 Richard Henderson <rth@redhat.com>
+
+ * expmed.c (expand_divmod): Ignore sdiv_pow2_cheap for modes in
+ which there is no divide expander.
+
+2002-01-21 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
+
+ * config/rs6000/t-ppccomm (CRTSTUFF_T_CFLAGS_S): Re-add -fPIC.
+
+2002-01-21 Zack Weinberg <zack@codesourcery.com>
+
+ PR target/5410
+ * config.gcc (i?86-*-netbsdelf*): New stanza.
+ * config/i386/netbsd-elf.h: New file (backport from mainline).
+
+2002-01-21 Neil Booth <neil@daikokuya.demon.co.uk>
+
+ PR preprocessor/3571
+ * tradcpp.c (handle_directive): Skip non-vertical space.
+
+2002-01-18 Craig Rodrigues <rodrigc@gcc.gnu.org>
+
+ * doc/install.texi (hppa*-hp-hpux11): Clarify that GCC 2.95.x cannot
+ be used for bootstrapping GCC 3.0. Clarify that --enable-threads
+ does not work.
+
+2002-01-17 David Edelsohn <edelsohn@gnu.org>
+
+ * doc/install.texi (*-ibm-aix*): Update assembler and exception
+ handling information.
+ * doc/gcc.texi (Interoperation): Add libstdc++ information
+ for AIX.
+ (Misunderstandings): Add template instantiation and static template
+ member information for AIX.
+
+2002-01-15 Jason Merrill <jason@redhat.com>
+
+ * c-common.def (FILE_STMT): New code.
+ * c-common.c (statement_code_p): It's a statement.
+ * c-common.h (stmt_tree_s): Add x_last_filename.
+ (FILE_STMT_FILENAME_NODE, FILE_STMT_FILENAME): New macros.
+ (last_expr_filename): New macro.
+ * c-semantics.c (begin_stmt_tree): Initialize it.
+ (add_stmt): If the filename changed, also insert a
+ FILE_STMT.
+ (expand_stmt): Handle seeing one.
+
+2002-01-13 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
+
+ * doc/install.texi (Binaries): Make link to ftp.writtenword.com
+ more generic.
+
+2002-01-02 David Edelsohn <edelsohn@gnu.org>
+
+ * gcc.c (init_gcc_spec): Do not link with static libgcc.a if
+ gcc invoked with -shared.
+
+ * config/rs6000/t-aix43: Revert previous change.
+
+2002-01-02 Hans-Peter Nilsson <hp@bitrange.com>
+
+ * unwind-dw2-fde.c (fde_unencoded_compare): Derefer pc_begin
+ fields when comparing.
+
+2002-01-02 Richard Henderson <rth@redhat.com>
+
+ * unwind-dw2-fde.c (fde_compare_t): Change return type to int.
+ (fde_unencoded_compare): Likewise. Don't use subtraction to get
+ a tristate comparison value.
+ (fde_single_encoding_compare, fde_mixed_encoding_compare): Likewise.
+
+2001-12-20 Release Manager
+
+ * GCC 3.0.3 Released.
+
+2001-12-13 Richard Henderson <rth@redhat.com>
+
+ * stmt.c (expand_asm_operands): Correct and simplify the
+ conditions for spilling an output operand to memory.
+
+2001-12-12 Bruce Korb <bkorb@gnu.org>
+ Rodney Brown <rbrown64@csc.com.au>
+
+ * fixinc/inclhack.def (strict_ansi_not_ctd): Update for UnixWare 2.1.3.
+ * fixinc/mkfixinc.sh: Use C fixincludes for UnixWare 2.1.3.
+ * fixinc/tests/base/math.h: update for new test text for rework
+
+2001-12-13 Alan Modra <amodra@bigpond.net.au>
+
+ * config/rs6000/rs6000.c (rs6000_unique_section): Simplify and
+ correct code selecting section.
+
+2001-12-11 Richard Henderson <rth@redhat.com>
+
+ * except.c (sjlj_find_directly_reachable_regions): Don't
+ consider RNL_BLOCKED a directly reachable region.
+ (sjlj_assign_call_site_values): Trust directly_reachable.
+ (sjlj_emit_dispatch_table): Likewise.
+
+2001-12-11 Neil Booth <neil@daikokuya.demon.co.uk>
+
+ * c-common.c (combine_strings): Complain if concatenating
+ __FUNCTION__.
+ * c-parse.in (yylexname): Flag artificial strings.
+ * tree.h (TREE_ARTIFICIAL_STRING_P): New.
+doc:
+ * extend.texi: Update.
+
+2001-12-09 David Edelsohn <edelsohn@gnu.org>
+
+ * stor-layout.c (place_union_field): Apply ADJUST_FIELD_ALIGN
+ to unions.
+
+2001-12-08 Alan Modra <amodra@bigpond.net.au>
+
+ * config/rs6000/rs6000.c (rs6000_unique_section): Add missing
+ parentheses.
+
+2001-12-07 Craig Rodrigues <rodrigc@gcc.gnu.org
+
+ PR c++/5041
+ * expr.c: Merge from mainline:
+ 2001-09-20 DJ Delorie <dj@redhat.com>
+ * expr.c (store_constructor): Handle zero-length arrays and
+ flexible arrays correctly.
+
+2001-12-07 David O'Brien <obrien@FreeBSD.org>
+
+ * elfos.h (_USING_ELFOS_H): Rename to USING_ELFOS_H, to match mainline.
+ * rs6000/rs6000.c (_USING_ELFOS_H): Likewise.
+
+2001-12-06 Nick Clifton <nickc@cambridge.redhat.com>
+
+ * config/arm/arm.h (STRUCT_VALUE): Suppress definition.
+ (STRUCT_VALUE_REGNUM): Restore definition.
+
+2001-12-06 Richard Henderson <rth@redhat.com>
+
+ * stmt.c (parse_input_constraint): Break out from ...
+ (expand_asm_operands): ... here. Loop over the operands twice,
+ the first time only calling mark_addressable.
+
+2001-12-06 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * fixinc/inclhack.def (stdio_va_list): Handle __VA_LIST__ in Tru64
+ UNIX V5.1A stdio.h.
+ * fixinc/fixincl.x: Regenerate.
+ Fixes PR libf2c/4826.
+
+2001-12-05 Neil Booth <neil@daikokuya.demon.co.uk>
+
+ * cppspec.c (lang_specific_driver): Set is_cpp_driver.
+ * gcc.c (process_command): Ensure the cpp driver sees
+ --help and --target-help, and that the help is printed
+ exactly once.
+
+2001-12-04 DJ Delorie <dj@redhat.com>
+
+ * fixinc/fixincl.c (initialize): Avoid problemsome macro
+ parameter names (PR 3388).
+
+2001-12-04 Loren J. Rittle <ljrittle@acm.org>
+
+ bootstrap/4422
+ * configure.in: Setup ability to run ./stage[1234]/xgcc in
+ fixinc *as if* it were a proper lang subdirectory.
+ * configure: Rebuilt.
+
+2001-12-04 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * doc/install.texi: Use the GFDL. Include years from old install
+ manual in copyright notice. Include copyright and GFDL notice on
+ HTML index page. Include usual footer on testing.html.
+ * doc/install.texi2html: Build gfdl.html. Use -I
+ $SOURCEDIR/include.
+ * doc/include/fdl.texi: Adapt for use in the install manual.
+
+2001-12-04 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * doc/install.texi: Document that installed native compiler for
+ building cross compilers should be GCC 2.95 or later.
+
+2001-12-03 Neil Booth <neil@daikokuya.demon.co.uk>
+
+ PR c/4988
+ * gcc.c (process_command): Don't add a preprocessor option for
+ --help and --target-help; cc1 is enough.
+
+2001-12-03 Jason Merrill <jason@redhat.com>
+
+ * dwarf2out.c (add_data_member_location_attribute): Do the
+ right thing for virtual bases.
+ * dbxout.c (dbxout_type): For a virtual base, print the offset
+ within the vtable.
+
+2001-12-01 Olivier Hainque <hainque@act-europe.fr>
+
+ * unroll.c (loop_iterations): Give up on jumps with null JUMP_LABEL
+ while scanning for multiple back edges.
+
+2001-12-01 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
+
+ * ginclude/ppc-asm.h (JUMP_TARGET): New macro.
+ * config/rs6000/tramp.asm: Use it.
+
+2001-11-30 Stephane Carrez <Stephane.Carrez@sun.com>
+
+ * config/sparc/sparc.c (DF_MODES_NO_S): Fix pr/3623, define to
+ accept DFmode and DImode only.
+
+2001-11-20 Zoltan Hidvegi <hzoli@hzoli.2y.net>
+
+ * doloop.c (doloop_modify_runtime): Correct calculation of
+ iterations.
+ * unroll.c (unroll_loop): Correct special exit cases.
+
+2001-11-30 Jakub Jelinek <jakub@redhat.com>
+
+ * config/sparc/sparc.md (movdf): Avoid calling validize_mem during
+ or after reload.
+
+2001-11-27 John David Anglin <dave@hiauly1.hia.nrc.ca>
+ Bruce Korb <bkorb@gnu.org>
+
+ * inclhack.def (AAA_time): Delete.
+ (hpux_size_t): Revise select and fix for HP-UX 11.11.
+ (hpux11_vsnprintf): Adapt to above hack.
+
+2001-08-14 Steve Ellcey <sje@cup.hp.com>
+
+ * tlink.c (scan_linker_output): Check string for unsatisfied in
+ addition to undefined and unresolved.
+
+2001-11-29 Zoltan Hidvegi <hzoli@hzoli.2y.net>
+
+ * doloop.c (doloop_valid_p): Check for LTU and GTU as well.
+
+2001-11-29 Richard Henderson <rth@redhat.com>
+
+ * ifcvt.c (noce_try_store_flag_constants): Test for overflow
+ in computing DIFF.
+
+2001-11-29 Craig Rodrigues <rodrigc@gcc.gnu.org>
+
+ PR other/4932
+ * config/i386/i386.c (print_operand): Verify that the
+ argument to %c is a constant and not a conditional which
+ needs to be reversed.
+
+2001-11-27 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * gcc.c (set_input): Export.
+ Move declaration ...
+ gcc.h (set_input): ... here.
+
+2001-11-27 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * gcc.c (set_collect_gcc_options): New function, split out from
+ main.
+ Ignore elided switches.
+ (do_spec): Invoke before executing command.
+ (do_spec_1): Likewise.
+ Fixes PR other/3968.
+
+2001-11-27 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * config/i386/sol2.h (WINT_TYPE): Redefine.
+ (WINT_TYPE_SIZE): Likewise.
+
+2001-11-26 Ian Lance Taylor <ian@zembu.com>
+
+ * config/i386/i386.md (movstrsi): Use strmovqi rather than
+ strmovsi for final byte move.
+
+2001-11-26 Alan Modra <amodra@bigpond.net.au>
+
+ * final.c: (insn_lengths): Make it an int *, so that large jump
+ tables don't overflow.
+
+2001-11-25 Stephane Carrez <Stephane.Carrez@worldnet.fr>
+
+ * config/m68hc11/m68hc11.md (peephole2): New peephole2 to optimize
+ address computations.
+
+2001-11-25 Stephane Carrez <Stephane.Carrez@worldnet.fr>
+
+ * config/m68hc11/m68hc11.c (d_register_operand): Must accept
+ register b (low part of d).
+
+2001-11-25 Stephane Carrez <Stephane.Carrez@worldnet.fr>
+
+ * config/m68hc11/m68hc11.h (FUNCTION_PROFILER): Fix label name
+ passed to mcount.
+
+2001-11-24 Neil Booth <neil@daikokuya.demon.co.uk>
+
+ * cppmacro.c (warn_of_redefinition): Warn regardless of -pedantic.
+ * cppinit.c (init_dependency_output): Suppress other stdout
+ output when dumping dependencies.
+
+2001-11-19 Brad Kaiser <bkaiser@acelink.net>
+
+ * reload1.c (elimination_effects): Use function_invariant_p
+ instead of CONSTANT_P when considering register equivalences.
+
+2001-11-18 Craig Rodrigues <rodrigc@gcc.gnu.org>
+
+ PR bootstrap/4020
+ * mklibgcc.in: Add missing semi-colons.
+ * Makefile.in: Same.
+
+2001-11-18 Craig Rodrigues <rodrigc@gcc.gnu.org>
+
+ PR c/4448
+ * gthr-win32.h: (__gthread_objc_thread_exit): Fix variable
+ name __objc_thread_exit_status so that it matches the
+ variable defined in objc/thr.h.
+
+2001-11-18 Craig Rodrigues <rodrigc@gcc.gnu.org>
+
+ PR optimization/4815
+ * alias.c: Merge from mainline:
+ 2001-08-05 Bernd Schmidt <bernds@redhat.com>
+ * alias.c (rtx_equal_for_memref_p): VALUEs are only identical
+ if their CSELIB_VAL_PTRs are.
+ 2001-07-25 Andrew Haley <aph@cambridge.redhat.com>
+ * alias.c (rtx_equal_for_memref_p): Allow strings as types in
+ operands.
+
+2001-11-17 Craig Rodrigues <rodrigc@gcc.gnu.org>
+
+ PR target/4606
+ * config.gcc: Remove reference to va-clipper.h.
+
+2001-11-17 Christopher Faylor <cgf@redhat.com>
+ Corinna Vinschen <vinschen@redhat.com>
+
+ * config/i386/cygwin.h: Search target specific include directory for
+ w32api stuff, if appropriate.
+
+2001-11-15 Kazu Hirata <kazu@hxi.com>
+
+ * config/h8300/h8300.md: Fix insn length of bit insns.
+
+2001-11-15 Richard Hodson <hodsonr@dionecorp.com>
+
+ * config/h8300/h8300.c (dosize): Avoid corrupting R3 in interrupt
+ routines.
+
+2001-11-14 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * Makefile.in (POD2MAN): Don't include --section=1.
+ (manext): Rename to man1ext. All users changed.
+ (man7ext): New.
+ (man7dir): New.
+ (generated-manpages): Also depend on $(docdir)/gfdl.7,
+ $(docdir)/gpl.7, and $(docdir)/fsf-funding.7.
+ ($(docdir)/gcov.1, $(docdir)/cpp.1, $(docdir)/gcc.1): Include
+ --section=1 in calls to $(POD2MAN).
+ ($(docdir)/gfdl.7, $(docdir)/gpl.7, $(docdir)/fsf-funding.7): New.
+ (maintainer-clean, install, uninstall): Handle the new man pages.
+ ($(docdir)/cpp.info, cpp.dvi): Depend on fdl.texi.
+ (installdirs): Create man7dir.
+ * doc/cpp.texi: Include GFDL in this manual. In the man page,
+ refer to gfdl(7) for the GFDL. Apply Front Cover and Back Cover
+ texts to man page. Include gpl(7), gfdl(7) and fsf-funding(7) in
+ the SEE ALSO man page section.
+ * doc/gcov.texi: Apply GFDL to man page. Include gpl(7), gfdl(7)
+ and fsf-funding(7) in the SEE ALSO man page section.
+ * doc/invoke.texi: Apply GFDL to man page. Include gpl(7),
+ gfdl(7) and fsf-funding(7) in the SEE ALSO man page section.
+ * doc/include/fdl.texi, doc/include/funding.texi,
+ doc/include/gpl.texi: Adjust for conversion by texi2pod.pl.
+ * doc/cpp.1, doc/gcc.1, doc/gcov.1: Regenerate.
+ * doc/gpl.7, doc/gfdl.7, doc/fsf-funding.7: New.
+
+2001-11-13 Jeff Sturm <jsturm@one-point.com>
+
+ * doc/install.texi (sparc-*-linux*): Mention requirements for
+ binutils and glibc.
+
+2001-11-12 Craig Rodrigues <rodrigc@gcc.gnu.org>
+
+ PR bootstrap/3451
+ * c-pragma.c: Rename macros BAD, BAD2, BAD_ACTION to
+ GCC_BAD, GCC_BAD2, GCC_BAD_ACTION.
+
+2001-11-12 David O'Brien <obrien@FreeBSD.org>
+
+ * config/ia64/freebsd.h: Fix comment (sync with mainline).
+
+2001-05-15 Geoffrey Keating <geoffk@redhat.com>
+
+ * config/rs6000/sysv4.h (ASM_PREFERRED_EH_DATA_FORMAT): Treat
+ TARGET_RELOCATABLE like flag_pic for now.
+
+2001-05-13 Geoff Keating <geoffk@redhat.com>
+
+ * config/rs6000/rs6000.h (EXCEPTION_SECTION): Move to...
+ * config/rs6000/aix.h (EXCEPTION_SECTION): ... here.
+ * config/rs6000/sysv4.h (CONST_SECTION_ASM_OP): Delete.
+ (ASM_PREFERRED_EH_DATA_FORMAT): Define.
+ (EXCEPTION_SECTION): Define.
+
+2001-11-09 Jason Eckhardt <jle@rice.edu>
+
+ * config/mips/mips.c (mips_output_conditional_branch): Do not hard
+ code the branch target as ".+16/.+12", but rather use labels.
+
+2001-11-09 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
+
+ * doc/install.texi2html: Use $MAKEINFO --no-split.
+
+2001-11-08 Richard Henderson <rth@redhat.com>
+
+ * Makefile.in (GCC_FOR_TARGET): Add build_tooldir/sys-include.
+ (CROSS_SYSTEM_HEADER_DIR): Use build_tooldir not tooldir.
+ (ORDINARY_FLAGS_TO_PASS, stmp-fixinc): Likewise.
+
+2001-11-08 Richard Henderson <rth@redhat.com>
+
+ 2001-07-11 Richard Sandiford <rsandifo@redhat.com>,
+ H.J. Lu <hjl@gnu.org>
+ * mips.md (call_internal1): Use CONSTANT_ADDRESS_P to check for
+ constant addresses.
+ (call_internal2): Likewise.
+ (call_value_internal1): Likewise.
+ (call_value_internal2): Likewise.
+ (call_value_multiple_internal1): Likewise.
+ (call_value_multiple_internal2): Likewise.
+
+ * config/mips/mips.c (save_restore_insns): Remove GP from the
+ restore registers mask early instead of special casing it inside
+ the loop.
+
+ * config/fp-bit.h (usi_to_float): Define for US_SOFTWARE_GOFAST
+ case as well.
+
+ * Makefile.in (NM_FOR_TARGET): Single build tree uses nm-new.
+
+2001-11-07 Neil Booth <neil@daikokuya.demon.co.uk>
+ Per Bothner <per@bothner.com>
+ H.J. Lu <hjl@gnu.org>
+
+ * acconfig.h (PREFIX_INCLUDE_DIR): New variable.
+ * config.in: Rebuild.
+ * cppdefault.c (cpp_include_defaults): Also search PREFIX_INCLUDE_DIR.
+ * Makefile.in (includedir): Rename to local_includedir.
+ (includedir): Define as $(prefix)/include.
+ * config.in (PREFIX_INCLUDE_DIR): New variable.
+ * configure.in (PREFIX_INCLUDE_DIR): Test for new variable.
+
+2001-11-07 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * doc/gcc.texi: Move terminology and spelling conventions to
+ htdocs/codingconventions.html.
+
+2001-11-06 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * doc/install.texi: Document that configure options not listed in
+ this file are unsupported. Document --with-system-zlib.
+
+2001-11-05 Alan Modra <amodra@bigpond.net.au>
+
+ * config/rs6000/rs6000.md (load_toc_aix_{si,di}): Mark r2 as used.
+
+2001-11-05 Zack Weinberg <zack@codesourcery.com>
+
+ * configure.in: AC_SUBST xm_defines.
+ * configure: Regenerate.
+ * Makefile.in: Set DEFINES=$(xm_defines) when building
+ tconfig.h.
+
+2001-09-15 Roman Lechtchinsky <rl@cs.tu-berlin.de>
+
+ * c-common.c (c_promoting_integer_type_p): Handle ?Imode types.
+
+2001-08-18 Zack Weinberg <zackw@panix.com>
+
+ * combine.c (make_compound_operation, simplify_comparison):
+ Fix typos testing for this or that instruction.
+
+2001-07-26 Kazu Hirata <kazu@hxi.com>
+
+ * regmove.c (regmove_optimize): Don't replace a reg with
+ another reg of a different mode.
+
+2001-06-16 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
+
+ * gccspec.c (lang_specific_driver): If compiling ObjC, add
+ -shared-libgcc when necessary.
+ * Makefile.in (gccspec.o): Compile with DRIVER_DEFINES.
+
+2001-06-11 Aldy Hernandez <aldyh@redhat.com>
+
+ * loop.c (scan_loop): Do not combine asm statements.
+
+2001-11-03 David O'Brien <obrien@FreeBSD.org>
+
+ * config.gcc: Add FreeBSD/IA-64 target. Move inclusion of IA-64
+ target headers to tm_file.
+ * config/ia64/ia64.h (TARGET_VERSION,ASM_SPEC,LINK_SPEC): Remove,
+ they are OS specific. Use CPP_CPU_SPEC rather than CPP_PREDEFINES,
+ so OS specific files and use CPP_PREDEFINES for their needs.
+ * config/ia64/elf.h (TARGET_VERSION): Add. Also, move inclusion of
+ target headers to tm_file.
+ * config/ia64/linux.h (TARGET_VERSION): Likewise.
+ * config/ia64/freebsd.h: New file.
+ * config/freebsd.h: Tidy up.
+ (_USING_CONFIG_FREEBSD): Define.
+ (FBSD_CPP_PREDEFINES): Add __KPRINTF_ATTRIBUTE__.
+ (FBSD_CPP_SPEC): Define generic FreeBSD spec.
+ (FBSD_STARTFILE_SPEC): Likewise.
+ (FBSD_ENDFILE_SPEC): Likewise.
+ (FBSD_LIB_SPEC): Likewise.
+ (WCHAR_UNSIGNED): Undefine, FreeBSD's wchars are signed.
+ (USER_LABEL_PREFIX): Define to ELF compatible value as some CPU headers
+ set an ELF-improper one.
+
+2001-11-03 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * doc/extend.texi, doc/gcc.texi, doc/install.texi, doc/tm.texi:
+ Use "invalid" instead of "illegal". Use @r in comments in
+ examples.
+
+2001-11-01 Richard Sandiford <rsandifo@redhat.com>
+
+ * config/mips/mips.c (save_restore_insns): Don't mark any register
+ save slots as unchanging if current_function_calls_eh_return.
+
+2001-11-01 Kazu Hirata <kazu@hxi.com>
+
+ * config/h8300/h8300.c (h8300_encode_label): Compute a string
+ before passing it to ggc_alloc_string.
+
+2001-10-30 Jakub Jelinek <jakub@redhat.com>
+
+ * flow.c (merge_blocks): Don't merge blocks if second block is
+ nonlocal_goto handler.
+
+2001-10-28 David Edelsohn <edelsohn@gnu.org>
+
+ * config/rs6000/rs6000.c (output_mi_thunk): Fix typo.
+
+2001-10-28 David O'Brien <obrien@FreeBSD.org>
+
+ * config/rs6000/sysv4.h (CPP_PREDEFINES): Quiet warning when overriden.
+
+2001-10-28 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * toplev.c: Fix spelling errors.
+
+2001-10-28 David O'Brien <obrien@FreeBSD.org>
+
+ * config/elfos.h (_USING_ELFOS_H): Define.
+ * config/rs6000/rs6000.c: Test for _USING_ELFOS_H rather than
+ USING_SVR4_H to know when to turn on ELF support.
+
+2001-10-28 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * doc/invoke.texi: Fix spelling.
+
+ * doc/gcc.texi: Document use of "dependent" and American spelling.
+
+2001-10-26 Andrew Cagney <ac131313@redhat.com>
+
+ Import 2001-07-11 Andrew Cagney <ac131313@redhat.com>:
+
+ * config.gcc: Recognize powerpc-*-netbsd*.
+
+ * doc/install.texi (Host/target specific installation notes for
+ GCC): Mention powerpc-*-netbsd*.
+
+ * config/rs6000/netbsd.h: New file.
+ (STANDARD_STARTFILE_PREFIX, LINK_SHLIB_SPEC): Redefine.
+ (LIB_DEFAULT_SPEC, STARTFILE_DEFAULT_SPEC): Redefine.
+ (ENDFILE_DEFAULT_SPEC, LINK_START_DEFAULT_SPEC): Redefine.
+ (LINK_OS_DEFAULT_SPEC, CPP_OS_DEFAULT_SPEC): Redefine.
+ (TARGET_VERSION): Redefine.
+
+ * config/rs6000/t-ppccomm (MULTILIB_MATCHES_SYSV): Recognize
+ mcall-netbsd as a match for mcall-sysv.
+ (EXTRA_MULTILIB_PARTS): Add ncrti$(objext) and ncrtn$(objext).
+ (ncrti.S, ncrtn.S): New targets.
+ ($(T)ncrti$(objext), $(T)ncrtn$(objext)): New targets.
+
+ * config/rs6000/sysv4.h (SUBTARGET_OVERRIDE_OPTIONS): Recognize
+ "netbsd' as a V4 ABI.
+ (ASM_SPEC): Check for -mcall-netbsd.
+ (CC1_SPEC, CC1_SPEC, LINK_START_SPEC, LINK_OS_SPEC): Ditto.
+ (CPP_ENDIAN_SPEC, CPP_SPEC, STARTFILE_SPEC): Ditto.
+ (LIB_SPEC, ENDFILE_SPEC): Ditto.
+ (LIB_NETBSD_SPEC, STARTFILE_NETBSD_SPEC): Define.
+ (ENDFILE_NETBSD_SPEC, LINK_START_NETBSD_SPEC): Define.
+ (LINK_OS_NETBSD_SPEC, CPP_OS_NETBSD_SPEC): Define.
+ (SUBTARGET_EXTRA_SPECS): Add NetBSD specs.
+
+ * doc/invoke.texi (Option Summary): Add -mcall-netbsd.
+ (RS/6000 and PowerPC Options): Mention -mcall-netbsd.
+
+2001-10-26 David Edelsohn <edelsohn@gnu.org>
+
+ * config/rs6000/rs6000.md (cr_logical): Swap order of CODE and
+ MODE arguments to gen_rtx and compare operand with const0_rtx.
+
+2001-10-26 Christopher Faylor <cgf@redhat.com>
+
+ * config/i386/cygwin.h: Search target specfic include directory, if
+ appropriate.
+
+2001-10-24 Christopher Faylor <cgf@redhat.com>
+
+ * config/i386/cygwin.h: Use proper path for mingw crt files when
+ -mno-cygwin.
+
+2001-10-23 Release Manager
+
+ * GCC 3.0.2 Released.
+
+2001-10-23 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * doc/gcc.texi (Sending Patches): Remove.
+
+2001-10-17 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * doc/gcc.1: Regenerate.
+
+2001-10-16 Matt Kraai <kraai@alumni.carnegiemellon.edu>
+
+ * c-tree.texi: Eliminate duplicated word.
+ * cpp.texi: Likewise.
+ * install.texi: Likewise.
+ * invoke.texi: Likewise.
+ * tm.texi: Likewise.
+
+2001-10-14 Craig Rodrigues <rodrigc@gcc.gnu.org>
+
+ PR c/4157
+ * config/i386/cygwin.h: Add missing space to MINGW_INCLUDES.
+
+2001-10-13 Craig Rodrigues <rodrigc@gcc.gnu.org>
+
+ * doc/invoke.texi: Remove -fvtable-gc.
+ * doc/gcc.1: Likewise.
+
+2001-10-12 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * doc/cpp.1, doc/gcc.1, doc/gcov.1: Regenerate.
+
+2001-10-11 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
+
+ * unroll.c (loop_iterations): Extend check for multiple back edges.
+
+2001-10-11 Mark Mitchell <mark@codesourcery.com>
+
+ Revert these changes:
+
+ 2001-10-10 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
+ PR c++/4512
+ * unroll.c (loop_iterations): Ignore insns generated by loop
+ unrolling.
+ 2001-10-08 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
+ * unroll.c (loop_iterations): Extend check for multiple back edges.
+
+2001-10-10 Danny Smith <danny_r_smith_2001@yahoo.co.nz>
+
+ * config/i386/mingw32.h (WIN32_NO_ABSOLUTE_INST_DIRS): New define.
+ (Thanks to Chris Faylor for suggesting macro name).
+ (CPP_PREDEFINES): Define __MINGW32__ but don't set value; add more
+ WIN32 defines.
+ (STANDARD_INCLUDE_DIR): Remove i386- from directory name.
+ (STANDARD_INCLUDE_COMPONENT): Change to MINGW.
+ (MATH_LIBRARY): Undef before definition.
+ (OUTPUT_QUOTED_STRING): Likewise.
+ * config/i386/cygwin.h: Use WIN32_NO_ABSOLUTE_INST_DIRS.
+
+2001-10-10 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
+
+ PR c++/4512
+ * unroll.c (loop_iterations): Ignore insns generated by loop
+ unrolling.
+
+2001-10-10 Hartmut Schirmer <SchirmerH@Innovative-Systems.de>
+
+ * config/float-i128.h: Make sure __STDC__VERSION__ is defined
+ before using it.
+ * config/float/i32.h: Likewise.
+ * config/float-i386.h: Likewise.
+ * config/float-i64.h: Likewise.
+ * config/float-m68k.h: Likewise.
+ * config/float-sh.h: Likewise.
+ * config/float-sparc.h: Likewise.
+
+2001-10-09 Danny Smith <danny_r_smith_2001@yahoo.co.nz>
+
+ * config.gcc (i[34567]86-*-mingw32*): Make msvcrt-dependent
+ version default.
+
+2001-10-10 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * doc/c-tree.texi, doc/extend.texi, doc/install.texi, doc/md.texi,
+ doc/rtl.texi, doc/tm.texi: Consistently use "nonzero" instead of
+ "non-zero".
+
+2001-10-09 Kazu Hirata <kazu@hxi.com>
+
+ * doc/cpp.texi: Fix typos.
+ * doc/c-tree.texi: Likewise.
+ * doc/extend.texi: Likewise.
+ * doc/invoke.texi: Likewise.
+ * doc/objc.texi: Likewise.
+
+2001-10-09 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * doc/gcc.texi: Document preference for "nonzero" over "non-zero".
+
+2001-10-08 Neil Booth <neil@daikokuya.demon.co.uk>
+
+ * doc/cpp.texi: Update.
+
+2001-10-08 Neil Booth <neil@daikokuya.demon.co.uk>
+
+ * cppmacro.c (_cpp_create_definition): Leave comments off.
+ * cpplex.c (_cpp_lex_token): Don't save comments if skipping.
+
+ * doc/cpp.texi: Update.
+
+2001-10-08 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
+
+ * unroll.c (loop_iterations): Extend check for multiple back edges.
+
+2001-10-08 Jeffrey A Law <law@cygnus.com>
+
+ * sibcall.c (optimize_sibling_and_tail_recursive_calls): Call
+ purge_mem_unchanging_flag on all instructions, not just on those
+ before NOTE_INSN_FUNCTION_BEG.
+
+2001-10-07 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * doc/gcc.texi: Fix spelling error of "separate" as "seperate".
+
+2001-10-07 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * doc/c-tree.texi, doc/tm.texi: Consistently put NULL and
+ NULL_TREE inside @code.
+
+2001-10-07 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * doc/gcc.texi: Document consistent style of "32-bit",
+ "Objective-C", and "@code{NULL}".
+
+2001-10-05 Richard Henderson <rth@redhat.com>
+
+ * i386.md (movsi_xor): Export.
+ (setcc peep2): Use it when available.
+
+2001-10-05 Richard Henderson <rth@redhat.com>
+
+ * dwarf2out.c (FRAME_BEGIN_LABEL): New.
+ (output_call_frame_info): Use it instead of __FRAME_BEGIN__ and
+ the gas section-name-as-label feature.
+
+2001-10-04 Loren J. Rittle <ljrittle@acm.org>
+
+ * Makefile.in (STAGE2_FLAGS_TO_PASS): Remove patch which
+ propagated HOST_CC.
+
+Thu Oct 4 16:18:12 CEST 2001 Jan Hubicka <jh@suse.cz.
+
+ * i386.c (setcc peep2): Do not use clobber of flags.
+
+2001-10-02 Zack Weinberg <zack@codesourcery.com>
+
+ * gcc.c (main): Set this_file_error if the appropriate
+ compiler for a language has not been installed.
+
+2001-10-01 Loren J. Rittle <ljrittle@acm.org>
+
+ * Makefile.in (STAGE2_FLAGS_TO_PASS): Propagate HOST_CC.
+ (fixinc.sh): Map CC, CFLAGS and LDFLAGS to HOST_* versions for
+ later recursive make invocation.
+
+2001-10-01 Stephane Carrez <Stephane.Carrez@worldnet.fr>
+
+ * config/m68hc11/m68hc11.md ("add-split"): Fix add split when
+ operand 2 is the stack pointer.
+ ("addr-peephole"): Fix address computation peephole when operand 2
+ is the stack pointer.
+
+2001-09-30 Stephane Carrez <Stephane.Carrez@worldnet.fr>
+
+ * config/m68hc11/m68hc11.md ("cmpqi_1"): Fix constraints.
+ ("tsthi_1"): Avoid allocation in register y.
+ ("*movqi_68hc12"): Reorganize and fix constraints.
+ ("zero_extendqisi2"): Prefer d over x and y for operand 1.
+ ("addqi3"): Likewise.
+ ("addhi3"): Fix constraints.
+ ("*logicalhi3_zexthi"): Disparage soft registers.
+
+2001-09-30 Stephane Carrez <Stephane.Carrez@worldnet.fr>
+
+ * config/m68hc11/m68hc11.c (m68hc11_gen_movhi): Fix move of sp
+ to tmp reg.
+
+2001-09-30 Stephane Carrez <Stephane.Carrez@worldnet.fr>
+
+ * config/m68hc11/m68hc11.h(INCOMING_RETURN_ADDR_RTX): Remove so
+ that we use setjmp/longjmp exceptions.
+
+2001-09-30 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * config/s390/s390.c (s390_adjust_cost): Fixed incorrect scheduling.
+ * config/s390/s390.md (function units): Likewise.
+
+ * config/s390/s390.md (addsi3_cc, addsi3_cconly, addsi3_cconly2,
+ subsi3_cc, subsi3_cconly): Removed.
+
+ * config/s390/s390.c (legitimate_la_operand_p): New.
+ * config/s390/s390-protos.h (legitimate_la_operand_p): Add.
+ * config/s390/s390.md (movsi): Convert load address patterns to
+ arithmetic operations when necessary.
+ (addaddr_picR, addaddr_picL, addaddr_picN): Removed.
+ (do_la): Renamed to *do_la and use legitimate_la_operand_p.
+ (*do_la_reg_0): Don't use before reload.
+
+ * config/s390/s390.c (legitimize_address): Make more efficient
+ use of two-register addressing mode.
+
+ * config/s390/s390.c (s390_function_prologue): Fix incorrect prolog
+ with -mno-backchain in some corner cases.
+
+ * config/s390/s390.md (cmpsi_cct): Operands 0 and 1 do not commute.
+
+2001-09-29 Alexandre Oliva <aoliva@redhat.com>
+
+ * reload.c (find_reloads): Mark new USE insns with QImode.
+ (find_reloads_toplev, find_reloads_address, subst_reg_equivs,
+ find_reloads_subreg_address): Likewise.
+ * regrename.c (note_sets, clear_dead_regs): Abort if pseudos are
+ encountered.
+ * reload1.c (reload_combine_note_use): Likewise, inside USEs and
+ CLOBBERs.
+ (reload): Make sure there are no USEs with mode other than
+ VOIDmode. At the end, remove those marked with QImode.
+
+2001-09-28 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * config/i386/sol2.h (CPLUSPLUS_CPP_SPEC): Define.
+
+2001-09-27 Richard Henderson <rth@redhat.com>
+
+ * dwarf2out.c (dwarf2out_frame_finish): Never elide .debug_frame
+ in favour of .eh_frame; fix eh test wrt USING_SJLJ_EXCEPTIONS.
+
+Tue Sep 25 15:09:03 2001 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * doc/install.texi (Specific, sparc-sun-solaris2*): Document
+ 64-bit support.
+
+2001-09-25 Janis Johnson <janis187@us.ibm.com>
+ Jim Wilson <wilson@redhat.com>
+
+ * doc/install.texi (Specific, ia64-*-linux): Document.
+
+2001-09-24 David Edelsohn <edelsohn@gnu.org>
+
+ * rs6000.c (lwa_operand): Address must be word aligned.
+
+2001-09-24 Janis Johnson <janis187@us.ibm.com>
+
+ * doc/install.texi (Final install): Request additional information
+ in mail about successful builds.
+
+2001-09-24 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * doc/install.texi: Markup fixes.
+ Use Solaris 2, SunOS 4 as appropriate.
+ (Specific, *-*-solaris2*): Explain this.
+ Unconditionally warn against /usr/ucb tools.
+ Remove Sun as warning, obsolete.
+ Move X11 header bug workaround here, update patches.
+ (Specific, sparc-sun-solaris2*): Detail Sun as fix status.
+ (Specific, sparc-sun-solaris2.7): Update patch 106950 status.
+
+2001-09-21 Richard Henderson <rth@redhat.com>
+
+ * tree.def (FDESC_EXPR): New.
+ * expr.c (expand_expr): Handle it.
+ * varasm.c (initializer_constant_valid_p): Likewise.
+ (output_constant): Likewise.
+ * defaults.h (TARGET_VTABLE_USES_DESCRIPTORS): New.
+ * config/ia64/ia64.h (TARGET_VTABLE_USES_DESCRIPTORS): New.
+ (ASM_OUTPUT_FDESC): New.
+
+2001-09-20 Andrew MacLeod <amacleod@redhat.com>
+
+ * testsuite/gcc.c-torture/execute/990208-1.x: New. XFAIL at -O3
+ on ia64.
+
+Thu Sep 20 12:49:34 2001 J"orn Rennecke <amylaar@redhat.com>
+
+ * sh.c (shiftcosts): Don't use shiftcosts array for modes wider
+ than SImode.
+
+Thu Sep 20 12:18:41 2001 J"orn Rennecke <amylaar@redhat.com>
+
+ * sh.c (initial_elimination_offset): When seeing
+ RETURN_ADDRESS_POINTER_REGNUM, force pr to be live.
+ Fix FROM == RETURN_ADDRESS_POINTER_REGNUM case.
+
+2001-08-21 Richard Henderson <rth@redhat.com>
+
+ * config/ia64/ia64.c (ia64_return_in_memory): True for variable
+ sized types.
+
+2001-06-19 Bernd Schmidt <bernds@redhat.com>
+
+ * regmove.c (optimize_reg_copy_3): Do nothing if previous insn
+ carries a REG_EQUIV note. If it carries REG_EQUAL, delete the
+ note.
+
+2001-09-18 Philip Blundell <philb@gnu.org>
+
+ * config/arm/lib1funcs.asm (L_dvmd_lnx): Don't rely on kernel
+ header files.
+
+2001-09-17 Jeff Sturm <jsturm@one-point.com>
+
+ * except.c (dw2_build_landing_pads): New local
+ clobbers_hard_regs. Emit an ASM_INPUT as a scheduling
+ barrier after clobbers. Fixes c++/4012.
+
+2001-09-17 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
+
+ * gcse.c (hash_scan_set): Fix merge glitch in last patch.
+
+2001-09-17 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * listing: Remove obsolete file.
+
+2001-09-15 Richard Henderson <rth@redhat.com>
+
+ * c-typeck.c (comptypes): Handle zero-length arrays properly.
+
+2001-09-15 David Edelsohn <edelsohn@gnu.org>
+
+ * doc/install.texi: Explain AIX exception handling work-around.
+ Update URL for AIX fixes.
+
+2001-09-15 Neil Booth <neil@daikokuya.demon.co.uk>
+
+ * cpplib.c (do_pragma): Never expand macros.
+
+2001-09-14 Richard Henderson <rth@redhat.com>
+
+ * config/i386/i386.c (internal_label_prefix): New.
+ (internal_label_prefix_len): New.
+ (override_options): Set them.
+ (local_symbolic_operand): New.
+ (legitimate_pic_address_disp_p): Use it.
+ (legitimize_pic_address): Likewise.
+
+2001-09-14 Marc Espie <espie@openbsd.org>
+
+ * config/i386/unix.h (ASM_OUTPUT_MI_THUNK): Generate reference to GOT
+ correctly.
+
+2001-09-13 Markus Werle <numerical.simulation@web.de>
+ Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
+
+ * doc/install.texi (Binaries): Add "Binaries for HP-UX 11.00 at
+ Aachen University of Technology".
+
+2001-09-13 Andreas Schwab <schwab@suse.de>
+
+ * config/float-m68k.h: Define DECIMAL_DIG and FLT_EVAL_METHOD for
+ C99.
+
+2001-09-12 Josh Martin <josh.martin@abq.sc.philips.com>
+
+ * fixinc/inclhack.def(hpux11_size_t): Keep HP-UX headers from
+ defining __size_t and leaving size_t undefined.
+
+2001-09-12 Jakub Jelinek <jakub@redhat.com>
+
+ * gcse.c (gcse_main): Fix comment typo.
+ (delete_null_pointer_check): Likewise.
+ (hash_scan_set): Don't consider sets with REG_EQUIV MEM notes.
+ * cse.c (cse_insn): Likewise.
+ * function.c (fixup_var_refs_insns_with_hash): The sequence is
+ toplevel.
+
+2001-09-11 Jim Wilson <wilson@redhat.com>
+
+ * alias.c (clear_reg_alias_info): Only handle pseudo registers.
+
+2001-09-10 Tim Freeman <tim@fungibole.com>
+
+ * dwarf2out.c (incomplete_types, decl_scope_table): Make them
+ into varray's and register them as roots with the garbage
+ collector so they are not collected too soon.
+
+2001-09-10 David Edelsohn <edelsohn@gnu.org>
+
+ * config/rs6000/rs6000.c (scc_eq_operand): New predicate.
+ * config/rs6000/rs6000-protos.h: Declare it.
+ * config/rs6000/rs6000.h (PREDICATE_CODES): Add it.
+ * config/rs6000/rs6000.md (SCC eq:DI): Use it.
+ * config/rs6000/t-aix43 (SHLIB_INSTALL): Use mode 751 (a+x,r-o).
+
+2001-09-07 Jim Wilson <wilson@redhat.com>
+
+ * alias.c (clear_reg_alias_info): New.
+ * flow.c (attempt_auto_inc): Call clear_reg_alias_info.
+ * rtl.h (clear_reg_alias_info): Declare.
+
+2001-09-06 Richard Henderson <rth@redhat.com>
+
+ * simplify-rtx.c (simplify_binary_operation): Revert last change.
+
+2001-09-06 Richard Henderson <rth@redhat.com>
+
+ * simplify-rtx.c (simplify_binary_operation): Simplify contents
+ of CONST.
+
+2001-09-06 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
+
+ * config/rs6000/rs6000.c (rs6000_emit_prologue): Fix DWARF2 register
+ number used for CR register.
+
+2001-09-06 Alan Modra <amodra@bigpond.net.au>
+
+ * config/rs6000/rs6000.c (mask_operand): Use signed vars to avoid
+ compiler warnings.
+ (mask64_operand): Likewise.
+ (includes_rldic_lshift_p): Likewise.
+ (includes_rldicr_lshift_p): Likewise.
+
+2001-09-05 Alan Modra <amodra@bigpond.net.au>
+
+ * config/rs6000/rs6000.c (mask_operand): Rewrite without
+ bit-shifting loop.
+ (mask64_operand): Likewise.
+ (rldic_operand): Delete.
+ (includes_lshift64_p): Delete.
+ (includes_rldic_lshift_p): New function.
+ (includes_rldicr_lshift_p): New function.
+ (print_operand): Don't call rldic_operand in case 'W'.
+ * config/rs6000/rs6000-protos.h (rldic_operand): Remove.
+ (includes_lshift64_p): Remove.
+ (includes_rldic_lshift_p): Declare.
+ (includes_rldicr_lshift_p): Declare.
+ * config/rs6000/rs6000.h (PREDICATE_CODES): Remove rldic_operand.
+ * config/rs6000/rs6000.md <ashldi3_internal 64 bit patterns>:
+ Replace match_operand rldic_operand predicate with
+ const_int_operand. Replace includes_lshift64_p condition with
+ includes_rldic_lshift_p.
+ <ashldi3_internal 64 bit rldicr patterns>: New.
+
+2001-09-05 David S. Miller <davem@redhat.com>
+
+ * config/sparc/linux.h: Set CPLUSPLUS_CPP_SPEC.
+ * config/sparc/linux64.h: Likewise.
+
+2001-09-05 Andreas Jaeger <aj@suse.de>
+
+ * doc/invoke.texi (i386 Options): -mwide-multiply is not
+ available anymore, remove the documentation.
+ (i386 Options): Fix typo, cleanup index entries.
+
+2001-09-05 Jakub Jelinek <jakub@redhat.com>
+
+ * stor-layout.c (layout_type) [ARRAY_TYPE]: Copy elements
+ TYPE_USER_ALIGN.
+
+ * loop.c (express_from_1): Fix CONSTANT_P(a) case.
+
+2001-09-04 Richard Henderson <rth@redhat.com>
+
+ * unwind.h (_UA_END_OF_STACK): New flag.
+ * unwind.inc (_Unwind_ForcedUnwind_Phase2): Set it.
+
+Thu Aug 30 18:50:37 2001 J"orn Rennecke <amylaar@redhat.com>
+
+ * t-h8300 (LIB1ASMFUNCS): Add _fixunssfdi and _fixunssfsi_asm.
+ (LIB2FUNCS_EXTRA): Define.
+ config/h8300/lib1funcs.asm: New part: L_fixunssfsi_asm .
+ config/h8300/fixunssfsi.c: New file.
+
+Thu Aug 30 16:00:31 2001 J"orn Rennecke <amylaar@redhat.com>
+
+ * h8300.c (dosize): Fix test for "sub".
+
+2001-08-29 Kazu Hirata <kazu@hxi.com>
+
+ * config/h8300/lib1funcs.asm: Update the copyright. Fix
+ comment typos.
+
+2001-08-29 Kazu Hirata <kazu@hxi.com>
+
+ * config/h8300/h8300.md (anonymous movhi pattern): Don't move
+ (reg n) to (mem (pre_dec (reg n)).
+ (anonymous movsi pattern): Likewise.
+
+2001-08-29 Kazu Hirata <kazu@hxi.com>
+
+ * config/h8300/h8300.h (RETURN_ADDR_RTX): New.
+
+2001-08-29 Kazu Hirata <kazu@hxi.com>
+
+ * config/h8300/lib1funcs.asm: Fix comment typos.
+
+2001-08-28 Richard Henderson <rth@redhat.com>
+
+ * config/ia64/ia64.md (andcmbi3, iorcmbi3): Fix typos.
+ (one_cmplbi2 splitter): Remove redundant test.
+
+2001-08-28 Danny Smith <dannysmith@users.sourceforge.net>
+
+ * config/i386/cygwin.h (BIGGEST_FIELD_ALIGNMENT): Set to 64.
+
+2001-08-24 David Edelsohn <edelsohn@gnu.org>
+
+ * config/rs6000/rs6000.c (rs6000_initialize_trampoline): Function
+ descriptor members are pointer size, not constant 4.
+
+2001-08-23 Neil Booth <neil@daikokuya.demon.co.uk>
+
+ * cppmacro.c (enter_macro_context): Push macro expansions even
+ if empty.
+
+2001-08-23 Kazu Hirata <kazu@hxi.com>
+
+ * config/h8300/h8300.md (zero_extendqihi2): Correct the insn
+ length.
+
+2001-08-19 Release Manager
+
+ * GCC 3.0.1 Released.
+
+2001-08-19 Release Manager
+
+ * GCC 3.0.1 Released.
+
+2001-08-17 Janis Johnson <janis187@us.ibm.com>
+
+ * doc/install.texi (Install GCC): Add links to build status pages.
+ (Specific): Ditto.
+ (Final install): Ditto; request updates for specific info
+
+2001-08-17 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
+
+ * doc/invoke.texi (Optimize Options): The default for
+ -finline-limit is 600.
+
+2001-08-16 Joel Sherrill <joel@OARcorp.com>
+
+ * config/rs6000/rtems.h: Set STARTFILE_DEFAULT_SPEC and
+ ENDFILE_DEFAULT_SPEC to correctly include ecrti and ecrtn.
+ * config/arm/rtems-elf.h: Remove bad -Darm and -Darm_elf.
+
+2001-08-14 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * config/s390/linux64.h (CPP_PREDEFINES): Define __s390__
+ also on 64-bit s390x targets.
+
+2001-08-14 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
+
+ * doc/install.texi (Specific, avr): Fix markup.
+ (Specific, c4x): Ditto.
+
+2001-08-13 Andreas Jaeger <aj@suse.de>
+
+ * config.gcc: Use t-slibgcc-elf to build shared libgcc_s on
+ s390*linux.
+
+2001-08-13 Roman Zippel <zippel@linux-m68k.org>
+ Richard Henderson <rth@redhat.com>
+
+ * regmove.c (regmove_optimize): Avoid setting a register twice in
+ a parallel set.
+
+2001-08-12 David Edelsohn <edelsohn@gnu.org>
+
+ Revert:
+ 2001-08-02 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+ * gcc.c (set_collect_gcc_options): New function, split out from
+ main.
+ Ignore elided switches.
+ (do_spec_1): Invoke before executing command.
+ (set_input): Export.
+ Move declaration ...
+ * gcc.h (set_input): ... here.
+ * config/alpha/osf.h (ASM_FINAL_SPEC): Use %U.s to refer to input
+ file.
+
+2001-08-11 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
+
+ * doc/install.texi (Specific, c4x): Fix cross-reference to the
+ main manual to work both for info and HTML versions.
+
+2001-08-10 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * glimits.h (__LONG_MAX__): Add s390x as 64-bit architecture.
+
+ * config/s390/s390.c (legitimize_pic_address): Don't generate
+ unnecessary moves (to avoid confusing loop optimization).
+ (check_and_change_labels): Replace jump_long by indirect_jump.
+ (s390_final_chunkify): Don't start a new literal pool on section
+ switch in 64-bit code.
+ (s390_va_start, s390_va_arg): Fixed incorrect sizes for 64-bit.
+
+ * config/s390/s390.h (HARD_REGNO_MODE_OK, RETURN_IN_MEMORY):
+ Support complex integer modes correctly.
+ (reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS): Remove CC_REGS.
+ (EH_RETURN_HANDLER_RTX): Fixed incorrect offset for 64-bit.
+ (CONST_COSTS): Fixed incorrect costs.
+
+ * config/s390/s390.md (divsi3, modsi3): Clobber low word of
+ divmoddisi3 before shifting (to avoid confusing flow analysis).
+ (cjump_long, icjump_long, jump_long, indirect_jump, casesi_jump):
+ Never use "address_operand" without "p" or "memory_operand"
+ without mode.
+ (builtin_setjmp_setup, builtin_setjmp_receiver, builtin_longjmp):
+ Fixed broken setjmp/longjmp handling.
+ (do_builtin_setjmp_setup): Removed.
+
+2001-08-10 John David Anglin <dave@hiauly1.hia.nrc.ca>
+
+ * doc/install.texi (vax-dec-ultrix): Change `Vax' to VAX.
+
+2001-08-10 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
+
+ * doc/install.texi (Specific, avr): Fix cross-reference to the
+ main manual to work both for info and HTML versions.
+
+2001-08-09 Jakub Jelinek <jakub@redhat.com>
+
+ * config/ia64/fde-glibc.c: Require glibc 2.2.4+ headers.
+ (find_fde_for_dso): Remove.
+ (_Unwind_IteratePhdrCallback): New.
+ (_Unwind_FindTableEntry): Use dl_iterate_phdr.
+ * config/ia64/crtbegin.asm (__ia64_app_header): Remove.
+
+2001-08-08 Kelley Cook <kelley.cook@home.com>
+
+ * Makefile.in: Move many of the *_H definitions eariler in the file,
+ so that rules in t-* files that use them for dependencies will work
+ in a parallel build.
+ * config/i386/t-cygwin (winnt.o): Depend on $(CONFIG_H).
+
+2001-08-08 Mark Mitchell <mark@codesourcery.com>
+
+ * except.c (remove_fixup_regions): Fix typo.
+
+2001-08-07 Daniel Jacobowitz <drow@mvista.com>
+
+ * config.gcc: Quote target_cpu_default2 correctly for
+ powerpc*-*-* targets.
+
+2001-08-07 David Edelsohn <edelsohn@gnu.org>
+
+ * doc/install.texi: Document fine-grained multilib configuration.
+
+2001-08-06 Richard Henderson <rth@redhat.com>
+
+ * config/i386/i386.h (FORCE_PREFERRED_STACK_BOUNDARY_IN_MAIN): New.
+ * function.c (expand_main_function): Implement it.
+ * doc/tm.texi: Document it.
+
+ * i386-protos.h, i386.c, i386.h, osf1elf.h, osfrose.h: Revert 08-01
+ ix86_output_main_function_alignment_hack patch.
+
+2001-08-06 Richard Henderson <rth@redhat.com>
+
+ 2001-07-23 Richard Henderson <rth@redhat.com>
+ * config/i386/i386.c (ix86_expand_setcc): Don't use method 0
+ before CSE.
+ * config/i386/i386.md: New setcc+movzbl peephole2.
+
+ 2001-07-22 Richard Henderson <rth@redhat.com>
+ * fold-const.c (fold): Test vs FLOAT_TYPE_P instead of
+ INTEGRAL_TYPE_P when folding comparisons with operand_equal_p
+ arguments.
+
+2001-08-06 John David Anglin <dave@hiauly1.hia.nrc.ca>
+
+ * varasm.c (output_constant_def_contents): Use for the length of a
+ string constant either its TREE_STRING_LENGTH or its int_size_in_bytes
+ depending on which is larger.
+
+2001-08-04 Hans-Peter Nilsson <hp@bitrange.com>
+
+ * doc/extend.texi (Other Builtins): Fix typo in last change.
+
+2001-08-04 Stephane Carrez <Stephane.Carrez@worldnet.fr>
+
+ * config/m68hc11/m68hc11.md ("cmphi_1", "cmpqi_1"): Allow memory
+ and soft register for operand 0.
+ ("cmphi_z_used", "cmpqi_z_used"): Allow memory for operand 0.
+
+2001-08-04 Stephane Carrez <Stephane.Carrez@worldnet.fr>
+
+ * config/m68hc11/m68hc11.md ("bitcmpqi"): Allow memory and soft
+ register for operand 0.
+ ("bitcmpqi_z_used"): Allow memory for operand 0.
+ (split "bitcmpqi"): New split to handle address reg as operand 1.
+
+2001-08-03 Zack Weinberg <zackw@stanford.edu>
+
+ * builtins.c (fold_builtin_constant_p): Return integer_zero_node
+ for complex expressions when cfun == 0.
+ * doc/extend.texi: Document that __builtin_constant_p can be
+ used in data initializers as well as functions.
+
+2001-08-03 Richard Henderson <rth@redhat.com>
+
+ * except.c (collect_one_action_chain): Add an explicit cleanup
+ action if regions surrounding a catch were encoded entirely
+ within the call-site entry.
+
+2001-08-03 Stephane Carrez <Stephane.Carrez@worldnet.fr>
+
+ * config/m68hc11/t-m68hc11-gas (T_CPPFLAGS): Add _ctor and _dtor.
+ * config/m68hc11/larith.asm (_exit): Split in several sub-sections
+ merged by linker script to get a final _exit().
+ (__do_global_dtors): New for destructor handling in specific exit
+ section.
+ (__do_global_ctors): New for constructors in specific install section.
+ (__map_data_section): Map data sections before running constructors.
+ * config/m68hc11/m68hc11.h (INT_ASM_OP): Define to use .word.
+ (CTORS_SECTION_ASM_OP): Define to put in readonly section.
+ (DTORS_SECTION_ASM_OP): Likewise.
+ (CTORS_SECTION_FUNCTION): Define to force a reference to
+ __do_global_ctors.
+ (DTORS_SECTION_FUNCTION): Likewise for __do_global_dtors.
+
+2001-08-03 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * config.gcc (s390-*-linux*, s390x-*-linux*): Added.
+ * doc/install.texi: Add s390 and s390x targets.
+ * doc/invoke.texi: Add s390 and s390x target options.
+ * doc/md.texi: Add s390 and s390x extra constraints.
+ * config/s390/s390.c: New. Subroutines for code generation.
+ * config/s390/s390.h: New. Definitions for S/390.
+ * config/s390/s390-protos.h: New. Prototypes.
+ * config/s390/linux.h: New. Definitions for Linux for S/390.
+ * config/s390/linux64.h: New. Definitions for Linux for zSeries.
+ * config/s390/t-linux: New. Makefile fragment.
+ * config/s390/s390.md: New. Machine description for S/390 and zSeries.
+ * config/s390/xm-390.h: New. Host definitions for S/390.
+ * config/s390/xm-390x.h: New. Host definitions for zSeries.
+ * config/s390/fixdfdi.h: New. Fix L_fix*di.
+
+2001-08-03 Neil Booth <neil@cat.daikokuya.demon.co.uk>
+
+ * cpplex.c (parse_string): Warn once per string.
+ * cpplib.c (_cpp_do_file_change): Call hook correctly.
+
+2001-08-03 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * doc/install.texi (Configuration): Fix markup.
+ (Specific, i?86-*-udk): Likewise.
+ (Specific, alpha*-dec-osf*): Warn against --with-gnu-as,
+ --with-gnu-ld.
+ Document --enable-threads and --enable-libgcj status.
+ (Specific, mips-sgi-irix*): Canonicalize triples.
+ (Specific, mips-sgi-irix5): Warn about problems with this config.
+ Mention required GNU as patch.
+ Native assembler problems are fixed.
+ (Specific, mips-sgi-irix6): Update O32 ABI support status.
+ Document --enable-threads and --enable-libgcj status.
+
+2001-08-02 David Edelsohn <edelsohn@gnu.org>
+
+ * doc/install.texi (Install GCC: Binaries): Update Bull info.
+
+2001-08-02 Nathan Sidwell <nathan@codesourcery.com>
+
+ Remove -fhonor-std.
+ * doc/invoke.texi (C++ Dialect Options): Remove -fno-honor-std.
+
+2001-08-02 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * gcc.c (set_collect_gcc_options): New function, split out from
+ main.
+ Ignore elided switches.
+ (do_spec_1): Invoke before executing command.
+ (set_input): Export.
+ Move declaration ...
+ * gcc.h (set_input): ... here.
+ * config/alpha/osf.h (ASM_FINAL_SPEC): Use %U.s to refer to input
+ file.
+
+2001-08-01 Hartmut Penner <hpenner@de.ibm.com>
+
+ * varasm.c (decode_rtx_const): Allow unspec (symbol_ref) in
+ constant pool to be identical by string address and index.
+
+2001-08-01 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
+
+ * params.def (PARAM_MAX_INLINE_INSNS): Change default to 600.
+ Correct comment that had been missed in the previous change.
+
+2001-08-01 Robert Lipe <robertl@caldera.com>
+
+ * dwarfout.c: Remove reference to README.DWARF.
+
+2001-08-01 Richard Henderson <rth@redhat.com>
+
+ * rtl.c (read_name): Consider \r whitespace.
+
+2001-08-01 Mark Kettenis <kettenis@gnu.org>
+
+ * unwind-pe.h (base_of_encoded_value, read_encoded_value): Define
+ only if NO_BASE_OF_ENCODED_VALUE isn't defined.
+ * unwind-dw2-fde.c (NO_BASE_OF_ENCODED_VALUE): Define before
+ including "unwind-pe.h".
+
+Wed Aug 1 20:15:33 CEST 2001 Jan Hubicka <jh@suse.cz>
+
+ * i386-protos.h (ix86_output_main_function_alignment_hack): Declare.
+ * i386.c (ix86_output_main_function_alignment_hack): New global
+ function.
+ * i386.h (FUNCTION_PROLOGUE): New macro.
+ * osf1elf.h (FUNCTION_PROLOGUE): Call new function.
+ * osfrose.h (FUNCTION_PROLOGUE): Likewise.
+
+2001-08-01 H.J. Lu <hjl@gnu.org>
+
+ * config/mips/linux.h (ASM_OUTPUT_IDENT): Defined.
+
+2001-08-01 H.J. Lu <hjl@gnu.org>
+
+ * gcc/config/mips/linux.h (ASM_OUTPUT_SOURCE_LINE): Defined.
+
+2001-07-31 Jeff Sturm <jsturm@one-point.com>
+
+ * except.c (duplicate_eh_regions): Test n_array[i] for NULL.
+
+2001-07-30 Roman Zippel <zippel@linux-m68k.org>
+
+ * config/m68k/m68k.md: Replace all general_operand with
+ nonimmediate_operand for all destinations.
+ * config/m68k/m68k.c: Include expr.h and reload.h.
+ (not_sp_operand): Check nonimmediate_operand.
+
+2001-07-30 Roman Zippel <zippel@linux-m68k.org>
+
+ * config/m68k/m68k.h (TARGET_SWITCHES/TARGET_OPTIONS):
+ Add missing doc strings.
+ * config/m68k/linux-aout.h (SUBTARGET_SWITCHES): Likewise.
+ * config/m68k/linux.h (SUBTARGET_SWITCHES): Likewise.
+
+2001-07-30 H.J. Lu <hjl@gnu.org>
+
+ * config/mips/linux.h (CPLUSPLUS_CPP_SPEC): Add -D_GNU_SOURCE.
+ (ASM_DECLARE_FUNCTION_NAME): Defined.
+ (ASM_DECLARE_FUNCTION_SIZE): Likewise.
+ (FUNCTION_NAME_ALREADY_DECLARED): Likewise.
+
+2001-07-30 Janis Johnson <janis@us.ibm.com>
+
+ * profile.c (branch_prob): Fix .bbg info for computed gotos
+ and C++ EH code.
+
+2001-07-28 Golubev I. N. <gin@mo.msk.ru>
+
+ * config/i386/sco5.h (DWARF2_DEBUGGING_INFO): Define.
+
+2001-07-27 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
+
+ * doc/install.texi (Configuration): Properly link the host
+ specific instructions also when generating HTML.
+
+2001-07-26 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * glimits.h (_MACH_MACHLIMITS_H_): Delete.
+
+Thu Jul 26 22:01:30 2001 Denis Chertykov <denisc@overta.ru>
+
+ * cse.c (cse_process_notes): Replace any registers if the address
+ remains valid.
+
+2001-07-26 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * Makefile.in (LIBICONV): Define.
+
+2001-07-26 Andrew MacLeod <amacleod@redhat.com>
+
+ * params.def (PARAM_MAX_PENDING_LIST_LENGTH): Add parameter to
+ limit length of dependancy flush list.
+ * params.h (MAX_PENDING_LIST_LENGTH): Define.
+ * sched-int.h (struct deps): Add pending_flush_length field.
+ * sched-deps.c (flush_pending_lists): Last_pending_memory_flush now
+ has 1 element in it.
+ (sched_analyze_1): Use MAX_PENDING_LIST_LENGTH.
+ (sched_analyze): After a jump, if the pending memory flush list is too
+ large, flush the pending lists.
+ (init_deps): Initialize pending_flush_length to 0.
+ * doc/invoke.texi (max_pending_list_length): Document parameter.
+
+2001-07-25 Richard Henderson <rth@redhat.com>
+
+ * varasm.c (assemble_variable): Create DECL_RTL before setting
+ TREE_ASM_WRITTEN.
+
+2001-07-25 Andrew MacLeod <amacleod@redhat.com>
+ Janis Johnson <janis@us.ibm.com>
+
+ * stmt.c (expand_goto): A nonlocal goto can be a call too.
+ * builtins.c (expand_builtin_longjmp): Reverse label and static chain
+ pointer parameters to match documented usage of nonlocal_goto.
+ * config/ia64/ia64.md (nonlocal_goto): Revert label and static chain
+ parameters to their correct order.
+ * config/sparc/sparc.md (nonlocal_goto): Revert label and static chain
+ parameters to their correct order.
+
+2001-07-25 Andrew MacLeod <amacleod@redhat.com>
+
+ * config/ia64/ia64.h (STRIP_NAME_ENCODING): Strip out '*' as well.
+
+2001-07-24 Joel Sherrill <joel@OARcorp.com>
+
+ * config/i960/i960.h (CPP_SPEC): Define _SOFT_FLOAT for -msoft-float.
+
+2001-07-24 Joel Sherrill <joel@OARcorp.com>
+
+ * config/sparc/rtems.h (CPP_PREDEFINES): Remove redundant
+ -Acpu and -Amachine.h.
+ * config/sparc/rtemself.h (CPP_PREDEFINES): Likewise.
+ Corrected header to say ELF not a.out.
+ * config/sparc/sparc.h (CPP_CPU_SPEC): Define _SOFT_FLOAT
+ when given -msoft-float.
+
+2001-07-24 Joel Sherrill <joel@OARcorp.com>
+
+ * config.gcc (arm*-*-rtems*): Include crtinit.o and crtfini.o as
+ extra multilib parts like arm-elf.
+ (i960-*-coff*, i960-*-rtems): Should not use collect2.
+ (m68020-*-elf*, m68k-*-elf*, m68k-*-rtems*): Include crtinit.o and
+ crtfini.o as extra multilib parts.
+
+2001-07-24 Joel Sherrill <joel@OARcorp.com>
+
+ * configure.in: Add rtems as a supported thread model.
+ * gthr-rtems.h: Add missing entry point __gthread_active_p.
+ * configure: Rebuilt.
+
+2001-07-24 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * config/mips/irix6-libc-compat.c: New file.
+ * config/mips/t-iris6 (LIB2FUNCS_STATIC_EXTRA): Use it.
+ * doc/install.texi (Specific, mips*-sgi-irix6): Mention structure
+ passing workaround.
+
+2001-07-23 Kazu Hirata <kazu@hxi.com>
+
+ * reload.c: Fix comment typos.
+
+2001-07-23 Richard Henderson <rth@redhat.com>
+
+ * config/i386/i386.c (ix86_expand_setcc): Don't use method 0
+ before CSE.
+ * config/i386/i386.md: New setcc+movzbl peephole2.
+
+2001-07-23 lars brinkhoff <lars@nocrew.org>
+
+ * tm.texi (TARGET_FLOAT_FORMAT): Document IBM_FLOAT_FORMAT
+ and C4X_FLOAT_FORMAT.
+ (BOOL_TYPE_SIZE): Document.
+
+2001-07-22 Richard Henderson <rth@redhat.com>
+
+ * fold-const.c (fold): Test vs FLOAT_TYPE_P instead of
+ INTEGRAL_TYPE_P when folding comparisons with operand_equal_p
+ arguments.
+
+2001-07-22 Alexandre Oliva <aoliva@redhat.com>
+
+ * config/i386/freebsd-aout.h (ASM_PREFERRED_EH_DATA_FORMAT): Use
+ the definition in defaults.h.
+
+2001-07-22 Richard Henderson <rth@redhat.com>
+
+ * regrename.c (regrename_optimize): Compute nregs for each
+ potential target register.
+
+2001-07-20 Stephane Carrez <Stephane.Carrez@worldnet.fr>
+
+ * config/m68hc11/m68hc11.md ("andqi3"): Accept d as second operand.
+ ("iorqi3"): Likewise.
+ ("xorqi3"): Likewise.
+ ("*addhi3"): Fix constraint to avoid reloading in a soft register.
+ ("*subhi3_sp): Likewise.
+ ("*subhi3"): Likewise.
+ ("extendhisi2"): Accept D, X and Y as source operand to avoid
+ reload problems.
+
+2001-07-20 Bruce Korb <bkorb@gnu.org>
+
+ * fixinc/fixincl.c(test_for_changes): force unsigned char comparisons
+ because getc() and char* may disagree on signedness.
+
+2001-07-20 Richard Henderson <rth@redhat.com>
+
+ Wed May 9 10:40:25 2001 Alexandre Oliva <aoliva@redhat.com>
+ * regclass.c (scan_one_insn): Update REG_N_REFS when optimizing
+ handling of two-address insns.
+
+2001-07-20 Stephane Carrez <Stephane.Carrez@worldnet.fr>
+
+ * config/m68hc11/m68hc11.md ("movdi", "movdi_internal"): Use an
+ expand to emit the pattern; put a REG_INC note for push/pop
+ instructions.
+ ("movdf", "movdf_internal"): Likewise.
+ ("movsi", "movsi_internal"): Likewise.
+ ("movsf", "movsf_internal"): Likewise.
+ ("movhi", "movqi"): Emit a REG_INC note for push/pop instructions.
+
+2001-07-20 Stephane Carrez <Stephane.Carrez@worldnet.fr>
+
+ * config/m68hc11/m68hc11.c (m68hc11_gen_highpart): Don't use
+ gen_highpart.
+
+2001-07-20 Daniel Berlin <dan@cgsoftware.com>
+
+ * params.def: Change default max inline insns to 100.
+
+2001-06-20 Kelley Cook <kelley.cook@home.com>
+
+ * doc/install.texi (sparc-sun-solaris*): Add in 4.x assembler bug
+ information. Move rest into ...
+ (*-*-solaris): ... here. Eliminate redundant information and
+ reword necessary packages section. Delete 4.x assembler bug info.
+ (sparc-sun-*): Merge into ...
+ (sparc-sun-sunos*): here.
+
+2001-07-19 Mark Mitchell <mark@codesourcery.com>
+
+ * reorg.c (fill_simple_delay_slots): If an instruction might throw
+ an exception that will be caught within this function, do not fill
+ its delay slot with any subsequent instruction.
+
+2001-07-19 Mark Kettenis <kettenis@wins.uva.nl>
+ Jakub Jelinek <jakub@redhat.com>
+
+ * unwind-dw2.c (_Unwind_FrameState): Add eh_ptr.
+ (extract_cie_info): Handle "eh" augmentation properly,
+ remember eh_ptr.
+ (struct frame_state, __frame_state_for): New.
+
+2001-07-19 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * config/alpha/osf.h (ASM_OUTPUT_WEAK_ALIAS, ASM_WEAKEN_LABEL,
+ HANDLE_SYSV_PRAGMA): Define.
+ * mips-tfile.c (add_ext_symbol): Pass complete symbol ptr, inline
+ previous args.
+ (copy_object): Caller changed.
+
+2001-07-19 Andreas Schwab <schwab@suse.de>
+
+ * configure.in (assembler dwarf2 debug_line support): Define nop
+ insn for m68k.
+ * configure: Regenerated.
+
+2001-07-18 Jeff Sturm <jsturm@one-point.com>
+
+ * dwarf2out.c (dwarf2out_abstract_function): Don't emit
+ in-class declaration at -g1. Fixes c++/2814.
+
+2001-07-18 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * defaults.h (ASM_OUTPUT_WEAK_ALIAS): Check for ASM_WEAKEN_LABEL.
+
+2001-07-18 Andreas Schwab <schwab@suse.de>
+
+ * configure.in (assembler eh_frame optimization): Handle big
+ endian.
+ * configure: Regenerated.
+
+2001-07-18 Tom Tromey <tromey@redhat.com>
+
+ For PR java/2812:
+ * configure: Rebuilt.
+ * configure.in: Don't check for iconv.h or iconv(); use AM_ICONV
+ instead.
+ * aclocal.m4 (AM_ICONV): New macro from Bruno Haible.
+
+Wed Jul 18 12:05:29 2001 Nicola Pero <n.pero@mi.flashnet.it>
+
+ * gthr-posix.h (__gthread_objc_mutex_trylock): Fixed return value
+ on error. We can't blindly return the result of
+ pthread_mutex_trylock because it returns a positive number on
+ error, while we must return -1 on error.
+ (__gthread_objc_mutex_lock, __gthread_objc_mutex_unlock): Similar
+ fixes.
+ Reported by Stephen Brandon <stephen@brandonitconsulting.co.uk>.
+
+2001-07-17 H.J. Lu <hjl@gnu.org>
+ Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * c-pragma.h (HANDLE_PRAGMA_WEAK): Define iff ASM_WEAKEN_LABEL and
+ ASM_OUTPUT_WEAK_ALIAS are defined.
+ * defaults.h (ASM_OUTPUT_WEAK_ALIAS): Define if possible.
+ * config/mips/iris6.h (ASM_OUTPUT_WEAK_ALIAS, ASM_WEAKEN_LABEL):
+ Moved ...
+ * config/mips/iris5.h: ... here.
+ (HANDLE_SYSV_PRAGMA): Defined as 1.
+ * varasm.c (weak_finish): Use ASM_OUTPUT_WEAK_ALIAS.
+ * doc/tm.texi (ASM_OUTPUT_WEAK_ALIAS): Support the undefined weak
+ symbol.
+
+2001-07-15 Richard Henderson <rth@redhat.com>
+
+ * config/alpha/alpha.c (alpha_emit_xfloating_compare): Use CCmode
+ instead of COMPARE for the EQUIV expression.
+
+2001-07-14 David Edelsohn <edelsohn@gnu.org>
+
+ * rs6000.c (reg_or_{add,sub}_cint64_operand): New predicates.
+ (add_operand): Compare CONST_INT with fewer function calls.
+ (print_operand, case 'p'): Ensure positive operand.
+ * rs6000.h (CONST_OK_FOR_LETTER_P, case 'N'): Ensure positive value.
+ (PREDICATE_CODES): Add new predicates.
+ * rs6000.md (addsi3): Split 32-bit constants more correctly.
+ (divsi3, modsi3): Ensure positive power-of-2.
+ (adddi3): Use new predicate. Split 32-bit constants more
+ correctly. Re-arrange splitter to handle any constant.
+ (subdi3): Use new predicate.
+ (divdi3, moddi3): Ensure positive power-of-2.
+
+2001-07-13 Kazu Hirata <kazu@hxi.com>
+
+ * jump.c (reversed_comparison_code_parts): Fix comment typos.
+
+2001-07-13 Marc Espie <espie@cvs.openbsd.org>
+
+ * config.gcc (*-*-openbsd*): Add fragment to compile libgcc
+ correctly for shared configurations.
+ * config/t-libgcc-pic: New.
+ * config/{i386,m68k,sparc}/t-openbsd: New.
+ * config/openbsd.h: Include cpu_spec in cpp_spec where needed.
+ Support -shared. Support debugging libraries with -g.
+ * config/i386/openbsd.h: Correct ASM_COMMENT_START. Ensure dwarf2
+ frame information does not emit pointer diffs.
+ * config/sparc/openbsd.h: Ensure dwarf2 frame information does not
+ emit pointer diffs.
+
+2001-07-13 David Edelsohn <edelsohn@gnu.org>
+
+ * combine.c (try_combine): Ensure const_int pow2 is positive.
+
+2001-07-11 Kazu Hirata <kazu@hxi.com>
+
+ * recog.c (validate_change): Fix a comment typo.
+
+2001-07-11 Mark Mitchell <mark@codesourcery.com>
+
+ * stmt.c (parse_output_constraint): New function, split out
+ from ...
+ (expand_asm_operands): ... here. Use parse_output_constraint.
+ * tree.h (parse_output_constraint): Declare it.
+
+2001-07-10 Kazu Hirata <kazu@hxi.com>
+
+ * calls.c (emit_library_call_value_1): Fix a comment typo.
+ * dwarf2out.c (mem_loc_descriptor): Likewise.
+
+2001-07-09 Kazu Hirata <kazu@hxi.com>
+
+ * config/h8300/t-h8300 (LIB1ASMFUNCS): Add _floatdisf and _fixsfdi.
+ * config/mn10200/t-mn10200 (LIB1ASMFUNCS): Likewise.
+
+2001-07-09 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * doc/c-tree.texi: Document representation of attributes.
+
+2001-07-08 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * doc/tm.texi: Fix typo.
+
+2001-07-07 Stephane Carrez <Stephane.Carrez@worldnet.fr>
+
+ * config/m68hc11/m68hc11.c (m68hc11_initial_elimination_offset):
+ Take into account m68hc11_sp_correction for FRAME_POINTER_REGNUM
+ elimination.
+ * config/m68hc11/m68hc11.h (STARTING_FRAME_OFFSET): Use 0.
+
+2001-07-06 Richard Henderson <rth@redhat.com>
+
+ * except.h (MUST_USE_SJLJ_EXCEPTIONS): Examine the value of
+ DWARF2_UNWIND_INFO not just whether it is defined.
+
+2001-07-06 DJ Delorie <dj@redhat.com>
+
+ * doc/gcc.texi (Makefile): Rename to be a more general purpose
+ chapter about various build hints and history. Add section
+ talking about the various types of native and cross builds.
+
+2001-07-05 David Edelsohn <edelsohn@gnu.org>
+
+ * doc/install.texi (Install GCC: Binaries): Fix typo.
+
+2001-07-04 Stephane Carrez <Stephane.Carrez@worldnet.fr>
+
+ * config/m68hc11/m68hc11.md ("*ashlsi3"): Operand 1 can be a memory
+ reference using the stack pointer, adjust it since we push Y
+ temporarily.
+ ("*ashrsi3"): Likewise.
+ ("*lshrsi3"): Likewise.
+
+2001-07-05 Stephane Carrez <Stephane.Carrez@worldnet.fr>
+
+ * config/m68hc11/m68hc11.h (RETURN_ADDR_RTX): Fix return address
+ when -fomit-frame-pointer is used.
+
+2001-07-05 Brad Lucier <lucier@math.purdue.edu>
+ Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
+
+ * doc/invoke.texi (Optimize Options): Document that -fgcse may
+ cause programs using computed gotos to run more slowly.
+
+2001-07-04 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * doc/install.texi (Specific): Markup, spelling and typo fixes.
+ Fixed sorting.
+ Consistently require binutils 2.11.2, not prereleases.
+ (Specific, decstation-*): Canonicalize as mips-dec-*.
+ (Specific, i?86-*-sco3.2v5*): Remove make bootstrap requirement,
+ always necessary.
+ (Specific, m68k-altos): Removed reference to README.altos, deleted.
+ (Specific, mips-*): Reword MIPS C compiler requirements.
+ (Specific, powerpc*-*-*): New, mention --with-cpu once.
+ (Specific, sunv5): Removed, obsolete.
+
+2001-07-04 Kazu Hirata <kazu@hxi.com>
+
+ * config/h8300/h8300.c (get_shift_alg): Remove an extra operand
+ from shll.
+
+2001-07-04 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * doc/include: New directory.
+ * doc/fdl.texi: Move to doc/include/fdl.texi.
+ * doc/texinfo.tex: Move to doc/include/texinfo.tex.
+ * doc/include/funding.texi, doc/include/gpl.texi: New files.
+ * doc/gcc.texi: Use funding.texi and gpl.texi.
+ * Makefile.in ($(docdir)/cpp.info, $(docdir)/gcc.info,
+ $(docdir)/cppinternals.info, cpp.dvi. gcc.dvi. cppinternals.dvi):
+ Update dependencies and use -I $(docdir)/include.
+
+2001-07-04 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
+
+ * doc/install.texi (sparc64-*-*): Remove garbage.
+
+2001-07-04 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
+
+ * doc/install.texi (Specific): Update information for *-*-solaris*.
+
+2001-07-03 Jan Hubicka <jh@suse.cz>
+
+ * optabs.c (expand_twoval_binop): Avoid undefined behaviour.
+
+2001-07-03 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * config/i386/sol2.h (ASM_PREFERRED_EH_DATA_FORMAT): Define.
+ Fixes PRs bootstrap/3067, bootstrap/3249, bootstrap/3275.
+
+2001-07-03 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * doc/cppinternals.texi: Improve formatting and logical markup.
+
+2001-07-03 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * doc/cppinternals.texi: Merge from mainline.
+
+ * doc/extend.texi, doc/gcc.texi, doc/invoke.texi, doc/md.texi,
+ doc/rtl.texi, doc/tm.texi: Improve formatting. Improve
+ documentation of -std and -Wwrite-strings.
+ * doc/cpp.1, doc/gcc.1: Regenerate.
+
+2001-07-02 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * doc/install.texi: Various spelling and markup fixes.
+ (Installing GCC): Component specific installation instructions are
+ gone.
+ Fix reference.
+ Warn about removing old install dir in the presence of shared libs.
+ (Configuration): Invoke with options target to match configure
+ --help.
+ Consistently refer to gas, gld pathnames.
+ Invert --enable-multilib documentation.
+ Remove references to old compiler versions.
+
+2001-07-02 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * doc/install.texi (Specific, mips*-sgi-irix4): Split from IRIX 5
+ section.
+ (Specific, mips*-sgi-irix5): Note IDO download.
+ Reworded MIPS C hints.
+ Use GNU as instead of GAS.
+ Markup fixes.
+ Removed SGI Freeware reference, IRIX 6 only.
+ (Specific, mips*-sgi-irix6): Removed ranlib caveats, obsolete.
+ Note N64 library requirement/workaround.
+ Update O32 hints.
+ Complete list of structure passing bug victims.
+
+2001-07-02 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
+
+ * doc/install.texi: Remove CVS Id.
+
+2001-07-01 Mark Mitchell <mark@codesourcery.com>
+
+ * expr.c (expand_expr, case ARRAY_REF): Correct check for
+ side-effects in the value of an array element.
+
+2001-06-29 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * objc/objc-act.c (handle_class_ref): Always place decl in
+ variable section.
+ (handle_impent): Always place decl in readonly data section.
+ Fixes PRs libobjc/917, libobjc/3237, bootstrap/3251.
+
+2001-06-29 Alan Modra <amodra@bigpond.net.au>
+
+ * recog.c (validate_replace_rtx_1): Exit early if nothing changed
+ in args of commutative of comparison operations.
+
+2001-06-28 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * gthr-posix.h [LIBOBJC]: Add weak definitions of
+ sched_get_priority_max, sched_get_priority_min.
+
+Thu Jun 28 11:32:24 CEST 2001 Jan Hubicka <jh@suse.cz>
+
+ * i386.c (x86_use_loop): Disable for K6 temporarily.
+
+2001-06-27 Bruce Korb <bkorb@gnu.org>
+
+ * fixinc/inclhack.def(hpux11_cpp_pow_inline): new, but real similar to
+ hpux10_cpp_pow_inline. Not similar enough.
+ (solaris_mutex_init): renamed. PTHREAD_*_INITIALIZER is a problem for
+ all Solaris versions. This fix patches MUTEX and COND initializers,
+ the RWLOCK one will wait for someone to complain. For now, anyway.
+ (uw7_byteorder_fix): It was looking for the byteorder.h file in the
+ wrong directory.
+
+Thu Jun 28 00:31:24 2001 Denis Chertykov <denisc@overta.ru>
+
+ * config/avr/avr.md (strlenhi): PARALLEL keyword removed.
+ * config/avr/avr.c (legitimate_address_p): Return value changed
+ from letter to register classes. For better debugging.
+
+2001-06-27 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * doc/c-tree.texi, doc/contrib.texi, doc/cpp.texi,
+ doc/cppinternals.texi, doc/extend.texi, doc/gcc.texi,
+ doc/gcov.texi, doc/install-old.texi, doc/install.texi,
+ doc/invoke.texi, doc/md.texi, doc/rtl.texi, doc/tm.texi: Replace
+ . at end of sentences preceded by a capital letter with @..
+
+2001-06-18 Jason Merrill <jason_merrill@redhat.com>
+
+ * expr.c (clear_storage): Set TREE_NOTHROW on the decl for memset.
+ (emit_block_move): Likewise.
+
+2001-06-27 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * doc/cpp.texi, doc/cppinternals.texi, doc/extend.texi,
+ doc/gcc.texi, doc/install.texi, doc/invoke.texi, doc/md.texi,
+ doc/tm.texi: Use @: where necessary when a full stop does not end
+ a sentence.
+
+2001-06-27 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * doc/gcc.texi, doc/install.texi, doc/invoke.texi: Remove trailing
+ whitespace.
+
+2001-06-26 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * doc/c-tree.texi, doc/cpp.texi, doc/extend.texi, doc/gcc.texi,
+ doc/install.texi, doc/invoke.texi, doc/objc.texi, doc/rtl.texi,
+ doc/tm.texi: Use two spaces after ends of sentences.
+
+2001-06-26 Daniel Berlin <dan@cgsoftware.com>
+
+ * toplev.c (display_help): Fix param thinko.
+ * Makefile.in: Fix params.h dependencies.
+
+2001-06-26 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * config/i386/sol2.h (CPP_SPEC): Pass -P for .S files.
+
+2001-06-26 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * config/mips/iris5.h (UNALIGNED_INT_ASM_OP,
+ UNALIGNED_SHORT_ASM_OP): Define.
+ * config/mips/iris6.h (UNALIGNED_INT_ASM_OP,
+ UNALIGNED_SHORT_ASM_OP): Undef.
+
+2001-06-26 Aldy Hernandez <aldyh@redhat.com>
+
+ * config/sh/sh.md (interrupt_function): Use
+ current_function_interrupt.
+ (define_delay): Schedule in delay slot if TARGET_SH3, even if it is
+ an interrupt function.
+
+ * config/sh/sh.h (current_function_interrupt): Define extern.
+
+ * config/sh/sh.c (current_function_interrupt): New global.
+ (sh_expand_prologue): Set current_function_interrupt.
+
+2001-06-25 Neil Booth <neil@daikokuya.demon.co.uk>
+
+ * cppmacro.c (make_string_token): Null terminate.
+ * doc/cpp.texi: Update.
+ * doc/cpp.1: Regenerate.
+
+2001-06-25 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * doc/c-tree.texi, doc/contrib.texi, doc/extend.texi,
+ doc/gcc.texi, doc/gcov.texi, doc/install.texi, doc/invoke.texi,
+ doc/md.texi, doc/rtl.texi, doc/tm.texi: Be more consistent about
+ the use of "GCC" and related terms.
+ * doc/gcc.1, doc/gcov.1: Regenerate.
+
+2001-06-24 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * doc/extend.texi, doc/gcc.texi, doc/install-old.texi,
+ doc/invoke.texi, doc/md.texi, doc/rtl.texi, doc/tm.texi: Remove
+ uses of @refill.
+
+2001-06-24 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * doc/install-old.texi: Remove more documentation of configure
+ options.
+ * doc/install.texi: Add it here.
+
+2001-06-23 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * doc/install.texi: Merge from mainline:
+ 2001-06-21 Phil Edwards <pme@sources.redhat.com>
+ * doc/install.texi: Add 'c' to list of --enable-languages choices.
+ 2001-06-21 Stan Shebs <shebs@apple.com>
+ * doc/install.texi: Use the correct name "Objective-C" everywhere
+ instead of "Objective C".
+ 2001-06-15 Loren J. Rittle <ljrittle@acm.org>
+ * doc/install.texi: Use correct markup hints.
+ 2001-06-15 Loren J. Rittle <ljrittle@acm.org>
+ * doc/install.texi: Update --enable-threads to match reality.
+
+2001-06-22 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * doc/gcc.texi: Update documentation of source files of C
+ compiler.
+
+2001-06-22 Toshiyasu Morita (toshiyasu.morita@hsa.hitachi.com)
+
+ * predict.c: (expected_value_to_br_prob): Check for const_true_rtx
+ instead of const1_rtx for true case.
+
+2001-06-22 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * doc/c-tree.texi, doc/contrib.texi, doc/extend.texi,
+ doc/gcc.texi, doc/install-old.texi, doc/install.texi,
+ doc/invoke.texi, doc/rtl.texi: Consistently use "front end" and
+ "back end" as nouns and "front-end" and "back-end" as adjectives.
+
+2001-06-22 Toshiyasu Morita <toshiyasu.morita@hsa.hitachi.com>
+
+ * config/v850/v850.c (v850_mark_machine_status): Don't mark the
+ p->machine->ra_rtx for GC if p->machine has already been
+ freed.
+
+2001-06-22 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * c-common.c (verify_tree): Check for x being NULL.
+ * doc/c-tree.texi: Document COMPOUND_BODY of an empty
+ COMPOUND_STMT.
+ Fixes PR c/3259.
+
+2001-06-21 Geoff Keating <geoffk@redhat.com>
+
+ * config/rs6000/rs6000.md (maxsf3): Use rs6000_emit_minmax.
+ (maxsf3+1): Delete.
+ (minsf3): Use rs6000_emit_minmax.
+ (minsf3+1): Generalize to handle both SMIN and SMAX. Use
+ rs6000_emit_minmax.
+ (movsfcc): Use rs6000_emit_cmove.
+ (fselsfsf4): Don't compare a CONST_INT with a floating-point value.
+ Don't generate emit_fselsfsf4.
+ (fseldfsf4): Likewise.
+ (maxdf3): Use rs6000_emit_minmax.
+ (maxdf3+1): Delete.
+ (mindf3): Use rs6000_emit_minmax.
+ (mindf3+1): Generalize to handle both SMIN and SMAX. Use
+ rs6000_emit_minmax.
+ (movdfcc): Use rs6000_emit_cmove.
+ (fseldfdf4): Don't compare a CONST_INT with a floating-point value.
+ Don't generate emit_fselsfsf4.
+ (fselsfdf4): Likewise.
+ * config/rs6000/rs6000.c (zero_fp_constant): New predicate.
+ (min_max_operator): New predicate.
+ (rs6000_emit_cmove): New function.
+ (rs6000_emit_minmax): New function.
+ * config/rs6000/rs6000-protos.h: Prototype new functions.
+ * config/rs6000/rs6000.h (PREDICATE_CODES): Add zero_fp_constant
+ and min_max_operator.
+
+ * config/rs6000/rs6000.c (output_cbranch): Handle all
+ conditional types in the switch statement.
+
+20010617 Release Manager
+
+ * GCC 3.0 Released.
+
+2001-06-15 Andreas Jaeger <aj@suse.de>
+
+ * doc/install.texi (Specific): Mention that glibc cannot be
+ compiled with GCC 3.0.
+
+2001-06-15 Zack Weinberg <zackw@stanford.edu>
+
+ * doc/cpp.texi: Formatting corrections.
+ Correct buggy example of use of __GNUC__ etc.
+ Clarify $ in identifiers.
+ * doc/cpp.1: Regenerate.
+
+2001-06-15 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * doc/install.texi (Specific, alpha*-*-*): Fixed Tru64 UNIX
+ etc. spelling.
+ (Specific, alpha-*-osf1): Renamed to alpha*-*-osf*.
+ Added Tru64 UNIX V5.1 bootstrap hints.
+ (Specific, alpha*-*-osf*): Removed old section, obsolete.
+
+2001-06-15 Zack Weinberg <zackw@stanford.edu>
+
+ * doc/cpp.texi: Revised and brought up to date.
+ * doc/cpp.1: Regenerate.
+
+2001-06-14 Bruce Korb <bkorb@gnu.org>
+
+ * fixinc/inclhack.def(hpux10_cpp_pow_inline): add a phoney file for
+ testing purposes
+ * fixinc/fixincl.x: regenerate with the phoney file
+ * fixinc/tests/base/fixinc-test-limits.h: Add new test results
+
+2001-06-15 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
+
+ * doc/install.texi: Update for C4x.
+ * README.C4X: Remove.
+
+2001-06-14 John David Anglin <dave@hiauly1.hia.nrc.ca>
+
+ * objc-act.c (handle_class_ref): Put the class reference in the
+ variable section for hpux only.
+ (handle_impent): Put the objc class and category name labels in
+ the readonly data section for hpux only.
+
+2001-06-14 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * doc/c-tree.texi, doc/contrib.texi, doc/extend.texi,
+ doc/gcc.texi, doc/install.texi, doc/invoke.texi, doc/md.texi,
+ doc/objc.texi, doc/rtl.texi, doc/tm.texi: Fix spelling and typos.
+ Consistently use "built-in" and "bit-field". Minor logical markup
+ improvements.
+ * doc/gcc.1: Regenerate.
+
+2001-06-14 Richard Henderson <rth@redhat.com>
+
+ * config/mips/mips.h (ASM_OUTPUT_ASCII): Rename local variables
+ to avoid shadowing parameters.
+
+ * config/mips/mips.md (exception_receiver): New.
+
+2001-06-14 Daniel J. Berlin <dan@cgsoftware.com>
+
+ * doc/gcc.texi: Update passes documentation to be more in tune
+ with reality.
+
+2001-06-14 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * doc/c-tree.texi, doc/contrib.texi, doc/extend.texi,
+ doc/gcc.texi, doc/gcov.texi, doc/install-old.texi,
+ doc/invoke.texi, doc/md.texi, doc/rtl.texi, doc/tm.texi: Use more
+ logical markup. Use TeX quotes and dashes. Use @dots{} and
+ @minus{}. Avoid spaces inside @var. Update last modification
+ date in gcc.texi.
+ * doc/gcc.1, doc/gcov.1: Regenerate.
+
+2001-06-14 John David Anglin <dave@hiauly1.hia.nrc.ca>
+
+ * fixinc/inclhack.def (hpux10_cpp_pow_inline): New hack.
+ * fixinc/fixincl.x: Rebuilt.
+
+2001-06-13 Richard Henderson <rth@redhat.com>
+
+ * ifcvt.c (dead_or_predicable): Fix return value last patch.
+
+2001-06-13 Philip Blundell <philb@gnu.org>
+
+ * config/arm/arm.c (add_minipool_backward_ref): Check that the
+ entire object will be reachable in the constant pool.
+
+2001-06-13 Mark Mitchell <mark@codesourcery.com>
+
+ * NEWS: Remove.
+
+2001-06-13 Richard Henderson <rth@redhat.com>
+
+ * ifcvt.c (cond_exec_get_condition): Use reversed_comparison_code.
+ (cond_exec_process_if_block, dead_or_predicable): Likewise.
+
+2001-06-13 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * mips-tfile.c (copy_object): Always pass indexNil for symbol
+ table index.
+
+2001-06-13 Kazu Hirata <kazu@hxi.com>
+
+ * config/h8300/h8300.h (OK_FOR_T): Remove.
+ (EXTRA_CONSTRAINT): Do not use OK_FOR_T.
+ * config/h8300/h8300.md: Remove alternatives involving inc and dec
+ in the helper patterns for addhi3 and addsi3.
+
+2001-06-13 John David Anglin <dave@hiauly1.hia.nrc.ca>
+
+ * gthr-dce.h (UNUSED): Attribute unused macro.
+ (__GTHREAD_MUTEX_INIT_FUNCTION and __GTHREAD_MUTEX_INIT_DEFAULT): New
+ macros for mutex initialization.
+ (__gthread_key_dtor): Make arguments UNUSED.
+ (__gthread_key_delete): Unsupported. Argument UNUSED.
+ (__gthread_mutex_init_function): New function for mutex initialization.
+
+2001-06-13 Phil Edwards <pme@sources.redhat.com>
+
+ * doc/contrib.texi: Link to libstdc++'s thanks.html for now.
+
+2001-06-13 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * doc/install.texi: Use more logical markup. Include @node
+ commands in the source when generating any non-HTML.
+
+2001-06-13 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * README: Remove. Some of the contents moved to ../README.
+
+2001-06-13 Alexandre Oliva <aoliva@redhat.com>
+
+ * doc/install.texi (--enable-shared): List package names
+ recognized by GCC.
+
+2001-06-13 Richard Earnshaw (rearnsha@arm.com)
+
+ * arm.c (arm_reload_in_hi): Handle the scratch operand overlapping
+ with the output operand.
+
+2001-06-12 Zack Weinberg <zackw@stanford.edu>
+
+ * Makefile.in: Move _bb and __gcc_bcmp from LIB2FUNCS to
+ LIB2FUNCS_ST.
+ * libgcc-std.ver: Don't export __bb* or __gcc_bcmp.
+ * config/t-slibgcc-elf-ver, config/t-slibgcc-sld,
+ config/alpha/t-osf4, config/mips/t-iris6: Bump libgcc soname
+ to .so.1.
+
+2001-06-13 Alexandre Oliva <aoliva@redhat.com>
+
+ * doc/texinfo.texi: Copied from mainline.
+
+ * doc/install.texi (ix86-*-solaris*): Removed, outdated.
+ (*-*-solaris*): Document problem in /bin/sh that affects
+ configuring libraries.
+ (sparc-*-solaris*): Recommend GNU binutils 2.11.1 or vendor tools.
+ (*-sun-solaris2.8): Document linker problem that explains why
+ libjava is disabled by default.
+
+2001-06-09 Mark Mitchell <mark@codesourcery.com>
+
+ Revert this patch:
+ * toplev.c (rest_of_compilation): Remove dead code before
+ purge_addressof.
+
+2001-06-12 Jim Wilson <wilson@redhat.com>
+
+ * loop.c (strength_reduce): Move bl->all_reduced set before
+ check_ext_dependant_givs call.
+ (check_ext_dependant_givs): Clear bl->all_reduced when ignoring givs.
+
+2001-06-12 Alexandre Oliva <aoliva@redhat.com>
+
+ Reverted:
+ 2001-06-07 Nathan Sidwell <nathan@codesourcery.com>
+ * configure.in (sparc*-*-*): Check assembler R_SPARC_UA32 support.
+ * configure: Rebuilt.
+
+ * doc/extend.texi (Function Attributes): Document SH's sp_switch
+ and trap_exit.
+
+2001-06-13 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * doc/invoke.texi: Use more logical markup. Use TeX quotes,
+ dashes and @dots{}.
+
+2001-06-12 Zack Weinberg <zackw@stanford.edu>
+
+ * configure.in (ALL_LINGUAS): Set to nothing.
+ * configure: Regenerate.
+
+2001-06-12 Richard Henderson <rth@redhat.com>
+
+ * config/i386/i386.c (ix86_expand_prologue): Always use
+ gen_pro_epilogue_adjust_stack; update arguments.
+ (ix86_emit_epilogue_esp_adjustment): Likewise.
+ (ix86_expand_epilogue): Likewise.
+ * config/i386/i386.md (pro_epilogue_adjust_stack): Use a BLKmode
+ clobber of scratch memory instead of a modification of EBP as the
+ barrier. Update all peepholes to match.
+
+2001-06-12 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * doc/gcc.texi: Change the font used for @def... commands to a
+ fixed width font.
+ * doc/extend.texi: Use more logical markup. Use "built-in"
+ instead of "builtin". Use @deftypefn to mark up built-in
+ functions; specify their types in the @deftypefn and not in the
+ descriptive text. Use TeX quotes and dashes. Add more index
+ entries.
+
+2001-06-12 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * doc/install.texi (--exec-prefix, --bindir, --libdir,
+ --with-slibdir, --infodir, --mandir, --with-cpp-install-dir):
+ Document.
+ (--enable-cpp): Change to document --disable-cpp instead; update
+ to reflect current default.
+ (--without-fast-fixincludes): Remove documentation.
+ (Final install): Document installation directories in more
+ detail. Document use of make dvi.
+
+2001-06-12 lars brinkhoff <lars@nocrew.org>
+
+ * gcc.texi (HOST_BITS_PER_LONGLONG): Document.
+ (DIR_SEPARATOR_2): Likewise.
+
+2001-06-12 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * c-decl.c (grokdeclarator): Use INTEGRAL_TYPE_P.
+
+ * c-typeck.c (c_start_case): Likewise.
+
+2001-06-12 Mark Mitchell <mark@codesourcery.com>
+
+ * expr.c (store_field): Don't set MEM_ALIAS_SET for a field
+ in a structure at a variable address.
+
+2001-06-12 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * doc/gcov.texi: Use more logical markup.
+
+2001-06-11 Stephane Carrez <Stephane.Carrez@worldnet.fr>
+
+ * config/m68hc11/m68hc11.c: Remove ifdef'ed gcc-2.95 code.
+ (m68hc11_reorg): Remove the gcc-2.95 compatible code.
+ (m68hc11_split_all_insns): Likewise, delete.
+ * config/m68hc11/m68hc11.h: Remove ifdef'ed gcc-2.95 code.
+ * config/m68hc11/m68hc11-protos.h: Likewise.
+
+2001-06-11 Stephane Carrez <Stephane.Carrez@worldnet.fr>
+
+ * config/m68hc11/m68hc11.md ("*lshrdi3_const32"): Mark the clobber
+ as an early clobber to make sure it is not used by reload in
+ one of the operands.
+
+2001-06-11 Mark Mitchell <mark@codesourcery.com>
+
+ * toplev.c (lang_independent_f_options): Remove
+ -feliminate-dwarf2-dups, -fbounded-pointers, and -fbounds-check.
+ * doc/c-tree.texi: Update information about flag_honor_std.
+ * doc/install.texi: Note that binutils is required on HPUX 11.
+ * doc/invoke.texi (-fhonor-std): Note that -fno-honor-std is
+ now the default.
+
+ * config/mips/abi64.h (RETURN_IN_MEMORY): Fix handling of
+ variable-sized types.
+
+2001-06-11 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * doc/md.texi: Use TeX dashes and quotes.
+
+2001-06-11 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * doc/rtl.texi: Reference manual chapter about trees.
+
+2001-06-11 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * config/mips/iris6.h (NO_BUILTIN_WINT_TYPE): Define.
+ (WINT_TYPE): Override.
+ (WINT_TYPE_SIZE): Likewise.
+ (SUBTARGET_CPP_SIZE_SPEC): Define __WINT_TYPE__ as appropriate.
+
+ * config/sparc/sol2.h (WINT_TYPE): Define.
+ (WINT_TYPE_SIZE): Likewise.
+
+ * config/sparc/sol2-sld-64.h (NO_BUILTIN_WINT_TYPE): Define.
+ (WINT_TYPE): Override.
+ (WINT_TYPE_SIZE): Likewise.
+ (CPP_ARCH32_SPEC): Add __WINT_TYPE__ definition.
+ (CPP_ARCH64_SPEC): Likewise.
+
+2001-06-11 Richard Henderson <rth@redhat.com>
+
+ * unwind-dw2-fde.c (__deregister_frame_info): Don't play games
+ with alias attribute.
+
+ * config/linux.h (CPLUSPLUS_CPP_SPEC): Use %(cpp) not $(cpp_cpu).
+ * config/alpha/linux.h (CPLUSPLUS_CPP_SPEC): Likewise.
+
+2001-06-11 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
+
+ * config/rs6000/linux.h (CPLUSPLUS_CPP_SPEC): New.
+
+2001-06-11 Richard Henderson <rth@redhat.com>
+
+ * config/alpha/osf5.h (TARGET_LD_BUGGY_LDGP): New.
+ * config/alpha/alpha.h (TARGET_LD_BUGGY_LDGP): Default.
+ (struct machine_function): Add gp_save_rtx.
+ * config/alpha/alpha.c (alpha_mark_machine_status): Mark it.
+ (alpha_gp_save_rtx): New.
+ * config/alpha/alpha-protos.h: Declare it.
+ * config/alpha/alpha.md (exception_receiver): Make an expander.
+ Use alpha_gp_save_rtx if TARGET_LD_BUGGY_LDGP.
+
+2001-06-11 Richard Henderson <rth@redhat.com>
+
+ * config/alpha/osf.h (LINK_SPEC): Hide _GLOBAL_* symbols.
+
+2001-06-11 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * configure.in: Align --help messages.
+ Remove trailing full stops.
+ Consistently use lower case.
+ Fix DWARF 2 spelling.
+ * configure: Rebuilt.
+
+2001-06-11 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * c-decl.c (store_parm_decls): When comparing types in an
+ old-style function declaration with those from a previous
+ prototype, compare the unqualified versions of parameter types.
+ Fixes PR c/3116.
+
+2001-06-11 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * doc/objc.texi: Use more logical markup. Use TeX dashes.
+
+2001-06-11 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * doc/c-tree.texi: Use more logical markup.
+
+2001-06-11 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * doc/install.texi: Update details of what components are included
+ in the GCC distribution. Update default directory for g++
+ includes. Update documentation relating to old libio. Adjust
+ documentation on DejaGnu environment variables. Remove
+ documentation of --enable-cpplib.
+
+2001-06-11 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * doc/contrib.texi: Fix alphabetical order. Fix typos. Improve
+ markup.
+
+2001-06-10 Richard Henderson <rth@redhat.com>
+
+ * ifcvt.c (life_data_ok): New.
+ (merge_if_block): Use it to determine whether to update
+ global_live_at_end.
+ (if_convert): Set it.
+
+2001-06-10 Richard Henderson <rth@redhat.com>
+
+ * config/alpha/osf5.h (ASM_OLDAS_SPEC): Add -c.
+
+2001-06-10 Alexandre Oliva <aoliva@redhat.com>
+
+ * doc/invoke.texi (MN10300 Options): Document -mno-crt0.
+ (SH Options): Document -mieee.
+ * doc/install.texi (Final install): Remove obsolete information
+ about installing cross compilers.
+ * doc/gcc.1: Rebuilt.
+
+2001-06-10 Richard Henderson <rth@redhat.com>
+
+ * config/alpha/alpha.c (override_options): Set align_loops,
+ align_jumps, and align_functions.
+ * config/alpha/alpha.h (FUNCTION_BOUNDARY): Set to 32 bits.
+ (LOOP_ALIGN, LABEL_ALIGN_AFTER_BARRIER): Remove.
+
+2001-06-10 Richard Henderson <rth@redhat.com>
+
+ * doc/invoke.texi (Optimization Options): Document -fpeephole2.
+ (Code Generation Options): Document -fnon-call-exceptions.
+
+2001-06-10 Mark Kettenis <kettenis@gnu.org>
+
+ * config/i386/gnu.h (MD_FALLBACK_FRAME_STATE_FOR): Undefine.
+
+2001-06-10 Stephane Carrez <Stephane.Carrez@worldnet.fr>
+
+ * m68hc11.md (peepholes): Remove unused and wrong peepholes.
+
+2001-06-10 Stephane Carrez <Stephane.Carrez@worldnet.fr>
+
+ * config/m68hc11/m68hc11.md ("extendhisi2"): Fix constraints to
+ prefer a memory for operand 1.
+ ("*addsi3"): Fix constraints, the '!' was too strong.
+ ("*addsi3_split"): Accept soft register and split accordingly.
+
+2001-06-10 Stephane Carrez <Stephane.Carrez@worldnet.fr>
+
+ * config/m68hc11/m68hc11-protos.h (m68hc11_initialize_trampoline):
+ Move definition in the RTX_CODE section.
+
+2001-06-10 Stephane Carrez <Stephane.Carrez@worldnet.fr>
+
+ * config/m68hc11/m68hc11.h (RETURN_ADDR_RTX): Define the return
+ address as relative to the argument pointer.
+
+2001-06-09 Alexandre Oliva <aoliva@redhat.com>
+
+ * doc/invoke.texi (C Dialect Options): Document -aux-info.
+ (Debugging Options): Document -print-multi-directory and
+ -print-multi-lib.
+ * doc/gcc.1: Rebuilt.
+
+ * toplev.c (independent_decode_option): Require `=' between
+ `-aux-info' and filename in the same argument.
+ * gcc.c: Don't pass -aux-info=filename twice.
+
+2001-06-10 Neil Booth <neil@daikokuya.demon.co.uk>
+
+ * cppinit.c (print_help): Document -fpreprocessed.
+ * invoke.texi: Similarly.
+
+2001-06-09 Mark Mitchell <mark@codesourcery.com>
+
+ * expr.c (expand_expr, case ARRAY_REF): Do not replace
+ an array element with the known initializing value if it has
+ side-effects.
+
+ * toplev.c (rest_of_compilation): Remove dead code before
+ purge_addressof.
+
+2001-06-09 Richard Henderson <rth@redhat.com>
+
+ * defaults.h (ACCUMULATE_OUTGOING_ARGS, PUSH_ARGS): Move from ...
+ * calls.c: ... here.
+ * combine.c, expr.c, final.c, function.c toplev.c: Don't provide
+ defaults for them here.
+
+2001-06-09 Peter Jakubek <pjak@snafu.de>
+
+ * config/m68k/m68k.md (ashrdi_const): Fix right shift by 16.
+
+2001-06-09 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * doc/gcc.texi: Use @defcodeindex for the index of options. Add
+ more index entries. Use more logical markup where appropriate.
+ Use TeX quotes and dashes.
+
+2001-06-09 Nicola Pero <nicola@brainstorm.co.uk>
+
+ * gthr-posix.h (__gthread_objc_init_thread_system): If
+ pthread_key_create fails, it's not clear what the return value is.
+ This obvious fix makes sure it always returns -1 if a problem
+ occurs.
+
+2001-06-09 Benjamin Kosnik <bkoz@redhat.com>
+
+ * unwind-pe.h: Conditionally qualify references to abort with
+ std::.
+
+2001-06-09 John David Anglin <dave@hiauly1.hia.nrc.ca>
+
+ * vax.h (NOTICE_UPDATE_CC): Set CC_NO_OVERFLOW in cc_status.flags
+ for integer operations that don't update C bit.
+
+2001-06-09 Julian Foad <julian_foad@hotmail.com>
+
+ * invoke.texi: Remove superfluous text.
+
+2001-06-08 Richard Henderson <rth@redhat.com>
+
+ * config/alpha/linux.h (CPLUSPLUS_CPP_SPEC): New.
+ (LIB_SPEC): Mirror config/linux.h version.
+
+2001-06-08 Richard Henderson <rth@redhat.com>
+
+ 2001-03-29 Richard Henderson <rth@redhat.com>
+ * libgcc2.c [L__main]: Include unwind-dw2-fde.h instead of frame.h.
+
+2001-06-08 Richard Henderson <rth@redhat.com>
+
+ * except.c (get_exception_pointer, get_exception_filter): Take a
+ struct function. Update all callers.
+ * except.h (get_exception_pointer): Update declaration.
+ * expr.c (expand_expr): Update get_exception_pointer call.
+ * integrate.c (expand_inline_function): Remap the exception pointer
+ from callee to caller.
+
+2001-06-08 Mark Mitchell <mark@codesourcery.com>
+
+ * c-decl.c (grokdeclarator): Make the TREE_TYPE for declarations
+ accurately reflect its cv-qualification.
+ * c-typeck.c (type_lists_compatible_p): Ignore the top-levl
+ cv-qualifiers on function types.
+
+2001-06-07 Loren J. Rittle <ljrittle@acm.org>
+
+ * config/alpha/elf.h (MAKE_DECL_ONE_ONLY): Copy definition
+ from config/elfos.h.
+
+2001-06-08 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * doc/gcc.texi, doc/invoke.texi: Add index of command line
+ options. Use @opindex to index them rather than other indexing
+ commands. Use @var{...} instead of <...>. Avoid spaces in names
+ inside @var. Don't use @kindex to index escape sequences in
+ source code.
+
+2001-06-08 Jason Merrill <jason_merrill@redhat.com>
+
+ * dbxout.c (dbxout_symbol): Use DECL_RTL_SET_P.
+
+2001-06-08 Jakub Jelinek <jakub@redhat.com>
+
+ * config/ia64/ia64.c (ia64_function_arg): Use [SDT]Fmode as gr_mode
+ for complex floats passed to unprototyped functions.
+
+2001-06-08 Jakub Jelinek <jakub@redhat.com>
+
+ * jump.c (mark_modified_reg): Allow jump threading if condition
+ codes are represented by a hard register.
+
+2001-06-08 Jakub Jelinek <jakub@redhat.com>
+
+ * config/ia64/ia64.h (CC1_SPEC): Define.
+ * config/ia64/linux.h (CC1_SPEC): Define.
+
+2001-06-08 Jakub Jelinek <jakub@redhat.com>
+
+ * tradcpp.c (do_define): Make sure we don't walk past limit.
+
+2001-06-08 Jakub Jelinek <jakub@redhat.com
+
+ * gcc.c (cpp_options): Define __NO_INLINE__ unless we are honoring
+ "inline" keyword.
+ * doc/cpp.texi (__NO_INLINE): Document it.
+
+2001-06-08 Mark Mitchell <mark@codesourcery.com>
+
+ * except.c (expand_eh_region_end_allowed): Call
+ do_pending_stack_adjust as necessary.
+
+2001-06-08 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
+
+ * doc/install.texi2html (MAKEINFO): Keep value if set already.
+
+2001-06-07 Mark Mitchell <mark@codesourcery.com>
+
+ * tree.h (DECL_SOURCE_FILE): Improve documentation.
+ (DECL_SOURCE_LINE): Likewise.
+
+2001-06-07 Phil Edwards <pme@sources.redhat.com>
+
+ * linux.h (CPLUSPLUS_CPP_SPEC): Move -D_GNU_SOURCE to here.
+ * pa/pa-linux.h: Allow CPLUSPLUS_CPP_SPEC to remain.
+
+2001-06-08 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * doc/contrib.texi: Add copyright notice.
+
+2001-06-08 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * doc/md.texi: Use four digit years in copyright notice.
+
+2001-06-07 DJ Delorie <dj@redhat.com>
+
+ * c-tree.texi, contrib.texi, cpp.texi, cppinternals.texi,
+ extend.texi, fdl.texi, gcov.texi, invoke.texi, md.texi,
+ objc.texi, rtl.texi, tm.texi, texinfo.tex, gcc.1, cpp.1,
+ gcov.1: Move to doc subdirectory.
+ * install.texi: Move to doc/install-old.texi.
+ * gcc.texi: Move to doc, refer to install-old.texi.
+ * Makefile.in: Reflect move of docs to doc/.
+ * f/Make-lang.in: Ditto.
+ * java/Make-lang.in: Ditto.
+ * doc/.cvsignore: New.
+
+2001-06-07 Theodore Papadopoulo <Theodore.Papadopoulo@sophia.inria.fr>
+
+ * c-tree.texi: Reformat the manual as a single chapter now
+ included by gcc.texi.
+ * gcc.texi: Include c-tree.texi. Merge all indexes.
+ * Makefile.in (dvi): Add generation for the cppinternals
+ documentation. Added dependencies on fdl.texi and c-tree.texi
+ where appropriate. Use TEXI2DVI instead of custom tex calls.
+ (info): Added dependencies on fdl.texi and c-tree.texi where
+ appropriate. Remove the target c-tree.info.
+
+2001-06-07 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * NEWS: Regenerate.
+
+2001-06-07 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * gthr-posix.h (__gthread_objc_thread_detach): Simply cast
+ pthread_t to objc_thread_t.
+ (__gthread_objc_thread_id): Likewise.
+
+2001-06-07 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * alpha/osf5.h (CPP_XFLOAT_SPEC): Override default definition.
+ (ASM_OLDAS_SPEC): Likewise.
+
+ * alpha/osf.h (CPP_XFLOAT_SPEC): Define.
+ (CPP_SUBTARGET_SPEC): Use it.
+ (ASM_OLDAS_SPEC): Define.
+ (ASM_SPEC): Use it.
+ (SUBTARGET_EXTRA_SPECS): Define, declare the new specs above.
+
+2001-06-07 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * config/alpha/alpha.c (alpha_va_arg): Handle TFmode, TCmode args,
+ passed by reference.
+
+2001-06-07 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * tm.texi (TARGET_SWITCHES, TARGET_OPTIONS): Adjust markup.
+ Document use of N_(...), and show it in examples. Note that
+ documentation should be added to invoke.texi. Avoid an overfull
+ hbox.
+
+2001-06-07 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
+
+ * pself.c, pself1.c, pself2.c, pself3.c, pself4.c, pself5.c:
+ Remove.
+
+2001-06-07 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * install.texi: Remove more obsolete documentation.
+
+2001-06-07 Nathan Sidwell <nathan@codesourcery.com>
+
+ * configure.in (sparc*-*-*): Check assembler R_SPARC_UA32 support.
+ * configure: Rebuilt.
+
+2001-06-06 Richard Henderson <rth@redhat.com>
+
+ * flow.c (mark_used_reg): Clean up looping over multiple hard
+ registers. Do conditional life bits across multiple hard regs.
+
+2001-06-05 Jeffrey D. Oldham <oldham@codesourcery.com>
+
+ * reload1.c (reload): Revert Schmidt's change so all USEs are not
+ deleted during reload.
+
+2001-06-05 Mark Mitchell <mark@codesourcery.com>
+
+ * c-semantics.c (genrtl_scope_stmt): Write out nested inline
+ functions here, instead of ...
+ * c-decl.c (c_expand_body): ... here.
+
+2001-06-05 Richard Henderson <rth@redhat.com>
+
+ * dwarf2.h (DW_EH_PE_aligned): New.
+ * dwarf2asm.c (eh_data_format_name): Name it.
+ (dw2_asm_output_encoded_addr_rtx): Align for it.
+ * dwarf2out.c (output_call_frame_info): Handle it for personality
+ routine and LSDA pointers.
+
+ * unwind-pe.h (DW_EH_PE_aligned): New.
+ (base_of_encoded_value): Handle it.
+ (read_encoded_value_with_base): Likewise.
+ * unwind-dw2-fde.c (base_from_object): Likewise.
+ (get_cie_encoding): Likewise.
+
+ * config/alpha/elf.h: Remove ecoff commentary.
+ * config/alpha/osf.h (ASM_PREFERRED_EH_DATA_FORMAT): New.
+
+2001-06-05 Mark Mitchell <mark@codesourcery.com>
+
+ * print-rtl.c (xspaces): Remove.
+ (print_rtx): Use printf field-width, rather than xpsaces, to
+ indent.
+ * toplev.c (main): Disable sibling-call optimization if we are
+ handling exceptions.
+
+2001-06-05 Bernd Schmidt <bernds@redhat.com>
+
+ * reload1.c (reload): Delete all USEs generated during reload.
+
+Tue Jun 5 21:08:39 2001 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * config.gcc (i?86-*-solaris2*): Enable shared libgcc.
+
+2001-06-05 Phil Edwards <pme@sources.redhat.com>
+
+ * gccbug.in: Remove high priority.
+
+2001-06-05 scott snyder <snyder@fnal.gov>
+
+ * gccbug.in: Fix typo.
+
+2001-06-05 David Edelsohn <edelsohn@gnu.org>
+
+ * rs6000/aix51.h (CPP_SPEC, CPLUSPLUS_CPP_SPEC): Fix typo in
+ __WCHAR_TYPE__ definition.
+ (WCHAR_TYPE_SIZE): #undef before #define.
+
+2001-06-05 Nathan Sidwell <nathan@codesourcery.com>
+
+ * c-common.h (flag_dump_translation_unit): Remove.
+ (enum tree_dump_index): Define.
+ (TDF_ADDRESS, TDF_SLIM): New #defines.
+ (dump_node_to_file): Remove.
+ (dump_node): Make extern. Add flags.
+ (dump_flag, dump_enabled_p, dump_begin, dump_end,
+ dump_switch_p): Prototype.
+ * c-common.c (flag_dump_translation_unit): Remove.
+ * c-decl.c (c_decode_option): Remove -fdump-translation-unit
+ logic. Use dump_switch_p.
+ * c-dump.h (struct dump_info): Add node and user fields.
+ (dump_pointer): Declare.
+ * c-dump.c (dump_node): Make extern. Add flags.
+ (SOL_COLUMN, EOL_COLUMN, COLUMN_ALIGNMENT): New #defines.
+ (dump_new_line, dump_maybe_newline): Use them.
+ (dump_pointer): New function.
+ (dequeue_and_dump): Check TDF_SLIM before dumping a _DECL's
+ chain or function's body. Dump address, if TDF_ADDRESS set.
+ (dump_flag): Define.
+ (dump_node_to_file): Remove.
+ (struct dump_file_info): New struct.
+ (dump_files): New array.
+ (dump_begin, dump_end, dump_enabled_p, dump_switch_p): Define.
+ * c-lang.c (finish_file): Adjust dumping.
+ * toplev.h (dump_base_name): Make extern.
+ * invoke.texi: Document new flags.
+
+2001-06-04 Mark Mitchell <mark@codesourcery.com>
+
+ * c-tree.h (lang_decl): Add pending_sizes fields.
+ * c-decl.c (store_parm_decls): Save pending_sizes away for nested
+ functions.
+ (c_expand_body): Expand them.
+ (lang_mark_tree): Mark lang_decl:pending_sizes.
+ * function.c (expand_pending_sizes): New function, broken out
+ from ...
+ (expand_function_start): ... here.
+ * tree.h (expand_pending_sizes): Declare it.
+
+2001-06-04 Loren J. Rittle <ljrittle@acm.org>
+
+ * doc/install.texi: Update FreeBSD information. Generalize
+ and update information for alpha-based platforms using ELF.
+
+2001-06-04 Richard Henderson <rth@redhat.com>
+
+ * sibcall.c (optimize_sibling_and_tail_recursive_call): Suppress
+ optimization if current_function_calls_setjmp.
+
+2001-06-04 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * c-tree.texi: Fix documentation of TREE_STRING_LENGTH for wide
+ strings.
+
+2001-06-04 John David Anglin <dave@hiauly1.hia.nrc.ca>
+
+ * c-decl.c (get_parm_info): Use INTEGRAL_TYPE_P.
+ (store_parm_decls): Likewise.
+ * c-typeck.c (convert_arguments): Likewise.
+
+2001-06-03 kaz Kojima <kkojima@rr.iij4u.or.jp>
+
+ * gcc/config/sh/sh.c (print_operand_address, print_operand): Call
+ mark_constant_pool_use before output_addr_const.
+ (struct pool_node): New field wend.
+ (add_constant): Note a sequence of constants that are referenced
+ by a given label.
+ (pool_window_label, pool_window_last): New variables.
+ (dump_table): Emit a unspec_volatile representing the end of a
+ sequence of constants.
+ (mark_constant_pool_use): New function.
+ * gcc/config/sh/sh.md (UNSPECV_WINDOW_END): New constant.
+ (consttable_2): Add the second operand which flags whether
+ this consttable entry was used or not.
+ (consttable_4, consttable_8, consttable_sf, consttable_df):
+ Likewise.
+ (consttable_window_end): New insn.
+
+2001-06-03 Alexandre Oliva <aoliva@redhat.com>
+
+ Warning removal.
+ * config/sh/sh.c (print_operand_address): Cast INTVAL to int.
+ (shl_and_kind): Cast wide constant.
+ (gen_far_branch): Define as static, as in declaration.
+ (barrier_align): Compute cache-line length as unsigned. Add
+ parentheses in initial credit computation.
+ (rounded_frame_size): Add parentheses.
+ (permanent_obstack): Remove declaration. Include ggc.h for
+ declaration of ggc_add_root_rtx().
+ (get_free_reg): Removed declaration of unused variable reg.
+ (legitimize_pic_address): Mark mode argument as unused.
+
+2001-06-03 Igor Shevlyakov <igor@windriver.com>
+
+ * config/sh/sh.c (output_branch): Support for insn with lenght
+ attr 12 & 16 which represents cond branches outside +-4096 range.
+
+2001-06-03 Alexandre Oliva <aoliva@redhat.com>
+
+ * config/sh/lib1funcs.asm (ic_invalidate): Align the
+ cache-mirroring sequence. Add nops.
+
+2001-06-03 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * install.texi: Remove more old installation documentation.
+ * doc/install.texi: Add relevant parts here.
+
+2001-06-03 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
+
+ * doc/install.texi2html: New script.
+
+2001-06-03 David Edelsohn <edelsohn@gnu.org>
+
+ * doc/install.texi: Update AIX information again.
+
+2001-06-02 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * gcc.texi, install.texi: Remove old system-specific installation
+ documentation.
+ * doc/install.texi: Move it to here.
+
+2001-06-02 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * doc/install.texi: Clean up Texinfo markup.
+
+2001-06-02 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * cpp.texi, cppinternals.texi, gcc.texi: Move contents to just
+ after title page.
+
+2001-06-02 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * install.texi: Remove documentation of some configuration
+ options.
+ * doc/install.texi: Add relevant parts of this documentation here.
+
+2001-06-02 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
+
+ * contrib.texi: Updated entries for Mark Mitchell, Joseph S. Myers,
+ Gerald Pfeifer, Bernd Schmidt, and Dean Wakerley.
+
+2001-06-02 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * install.texi: Remove libgcc1 documentation.
+ * gcc.texi: Remove link to Cross Runtime.
+
+2001-06-01 Jan van Male <jan.vanmale@fenk.wau.nl>
+
+ * invoke.texi: Remove references to papers about sequence points to
+ readings.html, refer to that page.
+
+2001-06-01 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
+
+ * README: Update references to installation instructions.
+
+2001-06-01 Laurent Guerby <guerby@acm.org>
+ Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
+
+ * doc/install.texi: Define srcdir when sources come from CVS.
+ Significantly improve markup. Wrap overly long lines.
+
+2001-05-31 Richard Henderson <rth@redhat.com>
+
+ * gcc.c (init_gcc_specs): When linking against libgcc_s.so,
+ also link against libgcc.a.
+
+Thu May 31 19:17:01 CEST 2001 Jan Hubicka <jh@suse.cz>
+
+ * i386.c (ix86_expand_int_movcc): Force one of operands to be register.
+
+2001-05-31 Rodney Brown <rbrown64@csc.com.au>
+
+ * install.texi (Configuration): Add html links for --with-gnu-as &
+ --with-gnu-ld and refer to them from hppa & SCO triplets.
+ (Specific): Link back to with-gnu-ld for all ELF platfoms.
+ (Specific): Reword AVR binutils recommendation.
+
+2001-05-31 Jan van Male <jan.vanmale@fenk.wau.nl>
+
+ * extend.texi: Fix formating of examples, eliminate some
+ 'overfull hboxes'.
+ * gcc.texi: Eliminate some 'overfull hboxes'.
+ * invoke.texi: Use two spaces between command options, eliminate
+ some 'overfull hboxes'.
+
+2001-05-30 Richard Henderson <rth@redhat.com>
+
+ * dwarf2out.c (dwarf2out_finish): Don't emit DW_AT_stmt_list at -g1.
+
+2001-05-30 Tom Tromey <tromey@redhat.com>
+
+ * gcc.c (do_spec_1): In `%O' case, if we computed saved_suffix,
+ use it in the new association.
+
+2001-05-30 Loren J. Rittle <ljrittle@acm.org>
+ David O'Brien <obrien@freebsd.org>
+
+ FreeBSD system configuration merged from mainline.
+
+ * config.gcc (the unlabeled system switch statement): Add
+ generic configuration section to handle *-*-freebsd*. Also,
+ to match the system compiler, default to threading support (it
+ may be disabled with the standard --disable-threads
+ configuration-time switch). Report bad configuration.
+ (i[34567]86-*-freebsd* in machine-specific section): Use it.
+ (alpha*-*-freebsd* in machine-specific section): Likewise.
+
+ * config/freebsd.h (LIB_SPEC): Key the exact setting to
+ configure-time options and target version of FreeBSD. Set-up
+ to match architectural change in threading support. Correctly
+ report when -pthread option is not supported by configure-time
+ options.
+ (FBSD_CPP_PREDEFINES): Move from architecture-specific files
+ and extend to encode target version number in run-time setting
+ of __FreeBSD__ macro to match the system compiler. Use #endif/#if pair
+ instead of #elif (which is OK for this case but not in general).
+ (CPP_PREDEFINES): Likewise.
+ (PREFERRED_DEBUGGING_TYPE): Change to DWARF2_DEBUG.
+
+ * config/alpha/freebsd.h (CPP_PREDEFINES): Moved to common freebsd.h.
+ * config/i386/freebsd.h (CPP_PREDEFINES): Likewise.
+
+ * config/freebsd3.h: New file to expose FBSD_MAJOR macro (3).
+ * config/freebsd4.h: New file to expose FBSD_MAJOR macro (4).
+ * config/freebsd5.h: New file to expose FBSD_MAJOR macro (5).
+ * config/freebsd6.h: New file to expose FBSD_MAJOR macro (6).
+ * config/freebsd-nthr.h: New file to expose FBSD_NO_THREADS macro.
+
+ * config/t-freebsd (TARGET_LIBGCC2_CFLAGS): Add -fPIC.
+ * config/t-freebsd-thread (TARGET_LIBGCC2_CFLAGS): Add
+ -pthread instead setting macro.
+
+2001-05-30 Loren J. Rittle <ljrittle@acm.org>
+ John David Anglin <dave@hiauly1.hia.nrc.ca>
+
+ * gthr-posix.h (__gthread_active_ptr): Cast function pointer
+ to target type to allow ISO C++ compiler to accept it.
+ * gthr-dce.h (__gthread_active_ptr): Likewise.
+ * gthr-solaris.h (__gthread_active_ptr): Likewise.
+
+2001-05-30 Neil Booth <neil@daikokuya.demon.co.uk>
+
+ * cpplex.c (_cpp_lex_token): Revert patch of 16 May 2001
+ so that we do accept comments in preprocessed input.
+
+2000-05-30 Kelley Cook <kelley.cook@home.com>
+
+ * config/i386/i386.h (TARGET_SWITCHES): Remove -mmmx and -msse options.
+
+2001-05-30 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * sparc/sol2.h (CPLUSPLUS_CPP_SPEC): Add all of CPP_SPEC instead
+ of just copying CPP_CPU_SPEC.
+
+2001-05-30 Gordon Sadler <gbsadler1@lcisp.com>
+
+ * invoke.texi (Option Summary): Remove -isystem-c++ from options.
+
+2001-05-30 Hans-Peter Nilsson <hp@axis.com>
+
+ * Makefile.in (s-mlib): Make backtick-commands always succeed.
+ (DRIVER_DEFINES): Ditto.
+
+2001-05-29 Stan Shebs <shebs@apple.com>
+
+ * gcc.texi: Add links for information about Objective-C.
+
+2001-05-29 Hartmut Schirmer <SchirmerH@Innovative-Systems.de>
+
+ * config/sh/sh.h (IDENT_ASM_OP): End with TAB, not LF.
+
+2001-05-29 Nathan Sidwell <nathan@codesourcery.com>
+
+ * configure.in (gcc_version): Remove unrequired \ on ". (Solaris
+ /bin/sed fails on [^\"]).
+ (configargs.h): Likewise.
+ * configure: Rebuilt.
+
+2001-05-28 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * c-tree.texi, contrib.texi, cpp.texi, extend.texi, gcc.texi,
+ gcov.texi, install.texi, md.texi, objc.texi, rtl.texi, tm.texi:
+ Remove trailing whitespace.
+
+2001-05-28 Gabriel Dos Reis <gdr@merlin.codesourcery.com>
+
+ * c-common.c (c_common_nodes_and_builtins): Change __builtin_fsqrt
+ to __builtin_sqrt.
+ * extend.texi (Other Builtins): Update documentation about
+ __builtin_sqrt.
+
+2001-05-28 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
+
+ * doc/install.texi (Specific): http://reality.sgi.com/ariel/freeware/
+ became http://freeware.sgi.com/.
+
+2001-05-27 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * fixinc/fixtests.c: Declare entries in ENV_TABLE.
+
+2001-05-27 Neil Booth <neil@daikokuya.demon.co.uk>
+
+ * cpplib.c (run_directive): Set pfile->directive.
+
+2001-05-27 Nathan Sidwell <nathan@codesourcery.com>
+
+ * lists.c (init_EXPR_INSN_LIST_cache): Only called once.
+ * toplev.c (rest_of_compilation): Don't call it here.
+ (compile_file): Call it here.
+
+2001-05-27 Lars Brinkhoff <lars@nocrew.org>
+
+ * combine.c (try_combine): Fix typo in comment.
+ * expr.c (expand_expr): Likewise.
+ * config/i370/i370.md (untyped_call): Likewise.
+
+2001-05-26 Bruce Korb <bkorb@gnu.org>
+
+ * fixinc/fixtests.c(stdc_0_in_system_headers_test): Must return "FIX"
+ when fixincl is operating in test mode
+ * fixinc/inclhack.def(AAB_dgux_int_varargs) : aesthetics
+ (AAB_ultrix_limits): remove redundant text
+ (AAB_ultrix_memory): ditto
+ (AAB_ultrix_string): ditto
+ (djgpp_wchar_h): fix the test text
+ (irix_stdio_va_list): add test text
+ (irix_limits_const): add a testing output file (limits.h is overwritten)
+ (strict_ansi_not_ctd): put limits.h second in list for same reason
+ (solaris27_mutex_init): test text needed selection text, too
+
+ * fixinc/fixtests.c(stdc_0_in_system_headers_test): Must return "FIX"
+ when fixincl is operating in test mode
+
+2001-05-25 Zack Weinberg <zackw@stanford.edu>
+
+ * toplev.c (debug_args, f_options, W_options): Mark
+ descriptions for translation.
+ (display_help): Translate descriptions on output.
+
+ * cp/lang-options.h, f/lang-options.h, java/lang-options.h,
+ objc/lang-options.h: Mark descriptions for translation.
+
+ * aclocal.m4: Quote final argument of patsubst. Use
+ 3-argument form of AC_DEFINE. Restore quotes to [] while
+ using AC_FD_CC.
+ * configure, config.in: Regenerate.
+
+2001-05-25 Herman A.J. ten Brugge <Haj.Ten.Brugge@net.HCC.nl>
+
+ * c4x.h (HARD_REGNO_CALLER_SAVE_MODE): Remove MODE argument.
+
+2001-05-25 Stacey Sheldon <ssheldon@Catena.com>
+
+ * config/arc/initfini.c (.init): Fix typo.
+
+2001-05-25 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * i386/i386.h (CC1_CPU_SPEC): Clarify -m486 etc deprecation messages.
+
+2001-05-25 Richard Henderson <rth@redhat.com>
+
+ * config.gcc (all gnu and linux): Use t-slibgcc-elf-ver with t-linux.
+ (i386-*-solaris2): Use t-slibgcc-elf-ver or t-slibgcc-sld.
+ (sparc*-*-solaris2): Likewise.
+ * config/t-linux: Remove shared libgcc macros.
+ * config/t-slibgcc-elf-ver: Move from sparc/t-slibgcc.
+ * config/t-slibgcc-sld: Move from sparc/t-slibgcc-sld.
+
+2001-05-25 Richard Henderson <rth@redhat.com>
+
+ * libgcc-std.ver: Export XFmode and TFmode versions of symbols.
+
+2001-05-25 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * fixinc/inclhack.def (strict_ansi_not, strict_ansi_not_ctd,
+ strict_ansi_only): Don't run if stdc_0_in_system_headers.
+ * fixinc/fixincl.x: Regenerate.
+ * fixinc/fixtests.c (stdc_0_in_system_headers_test): New function.
+ (FIX_TEST_TABLE): Declare it.
+ * fixinc/fixlib.h: Include config.h.
+
+2001-05-25 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * fixinc/inclhack.def (alpha___assert): Change char * args to
+ const char * on Tru64 UNIX to avoid excessive warnings from
+ assert.h.
+ * fixinc/fixincl.x: Regenerate.
+
+2001-05-25 David Edelsohn <edelsohn@gnu.org>
+
+ * xcoffout.h (DBX_OUTPUT_GCC_MARKER): Do not emit any marker.
+
+ * config/rs6000/aix.h (USER_LABEL_PREFIX): AIX symbols do not have
+ any prefix.
+
+2001-05-25 Jeff Knaggs <jknaggs@redhat.com>
+
+ * config/alpha/alpha.md (movtf_internal): Use reg_overlap_mentioned_p
+ instead of rtx_equal_p for early clobber test.
+
+2001-05-25 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * aclocal.m4: Fixed typo.
+ (gcc_AC_HEADER_STDBOOL): Define.
+ (gcc_AC_C__BOOL): Define.
+ * configure.in: Use them.
+ (AC_CHECK_HEADERS): Remove stdbool.h
+ * configure, config.in: Regenerate.
+
+2001-05-25 Richard Henderson <rth@redhat.com>
+
+ * config/i386/i386.md: Revert previous change. Do not apply
+ the peephole if the components do not die after the sequence.
+
+2001-05-25 Mark Mitchell <mark@codesourcery.com>
+
+ * config/i386/i386.md: Make sure cmpstr peepholes do not
+ affect liveness information.
+
+2001-05-24 Mark Mitchell <mark@codesourcery.com>
+
+ * c-typeck.c (digest_init): Issue error messages about
+ invalid constants, not warnings.
+
+ * invoke.texi (-fno-builtin): Document that this is always on
+ in C++.
+
+2001-05-24 Philip Blundell <philb@gnu.org>
+
+ * config/arm/arm.c (output_return_instruction): Correctly handle
+ interworking and interrupt functions.
+
+2001-05-24 Philip Blundell <philb@gnu.org>
+
+ * config/arm/arm.h (TARGET_SWITCHES): Correct misleading help for
+ -m{no-}sched-prolog. Fix typos and improve formatting.
+
+2001-05-24 Philip Blundell <philb@gnu.org>
+
+ * invoke.texi (ARM Options): Improve wording slightly. Add
+ documentation for more options, including those for Thumb mode.
+ Don't mention options that don't exist or are unimplemented.
+ (Thumb Options): Delete; merged into above section.
+
+2001-05-24 Geoff Keating <geoffk@redhat.com>
+
+ * config/rs6000/linux.h (SIGNAL_FRAMESIZE): Define.
+ (MD_FALLBACK_FRAME_STATE_FOR): Use it.
+
+2001-05-23 Richard Henderson <rth@redhat.com>
+
+ * doc/install.texi (alpha-linux): Require binutils 2.11.
+
+2001-05-23 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * extend.texi (Attribute Syntax): Clarify application of
+ attributes to parameters declared as functions or arrays.
+
+2001-05-23 Zack Weinberg <zackw@stanford.edu>
+
+ * diagnostic.c (vnotice): Kill.
+ (fnotice): Call vfprintf directly.
+ (diagnostic_for_decl, output_do_verbatim, output_verbatim,
+ verbatim, set_diagnostic_context): Rename string argument to
+ indicate that it is run through gettext.
+ (vbuild_message_string, build_message_string, output_do_printf):
+ Rename string argument to indicate that it is NOT run through
+ gettext.
+ (output_printf, diagnostic_for_decl, fatal_io_error, sorry,
+ output_do_verbatim, set_diagnostic_context, fnotice, _fatal_insn):
+ Run msgid argument through gettext.
+ (default_print_error_function): Run constant strings through
+ gettext when nothing else will.
+ (fatal_error, internal_error, error_recursion): Use fnotice.
+ Present complete sentences to gettext.
+
+2001-05-23 Mark Mitchell <mark@codesourcery.com>
+
+ * jump.c (mark_jump_label): Fix thinko in 2001-05-19 change.
+
+2001-05-22 Richard Henderson <rth@redhat.com>
+
+ * config/mips/iris6.h (EH_FRAME_SECTION_ASM_OP): Give the
+ section pointer alignment.
+
+ * doc/install.texi (alpha-linux): Require binutils >= 2.10.
+
+ * unwind-dw2-fde.c (__deregister_frame_info): Stringize use
+ of __USER_LABEL_PREFIX__.
+
+2001-05-22 Richard Henderson <rth@redhat.com>
+
+ * unwind-dw2-fde.c (__deregister_frame_info): Stubbify in favour of...
+ (__deregister_frame_info_bases): New.
+ * unwind-dw2-fde.h: Declare it.
+ * libgcc-std.ver: Export it.
+ * crtstuff.c (__do_global_dtors_aux): Call it if we would have
+ called __register_frame_info_bases.
+
+2001-05-22 Andrew MacLeod <amacleod@redhat.com>
+
+ * builtins.c (expand_builtin_longjmp): A longjmp can be a call too.
+ * config/ia64/ia64.md (nonlocal_goto): Reverse label and frame pointer
+ parameters to __ia64_nonlocal_goto. Flag as NO_RETURN.
+ * config/ia64/ia64.c (ia64_expand_epilogue): Make sure we are issuing
+ "r2" to the assembly file. Only issue allocs with non-zero parameters.
+
+2001-05-22 Richard Henderson <rth@redhat.com>
+
+ * libgcc2.c: Include hwint.h.
+
+2001-05-22 Richard Henderson <rth@redhat.com>
+
+ * crtstuff.c (__register_frame_info_bases): Declare.
+ (frame_dummy): Use it, if CRT_GET_RFIB_TEXT or CRT_GET_RFIB_DATA.
+ (__do_global_dtors_aux, __do_global_dtors): Streamline.
+
+ * config/i386/linux.h (ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX): New.
+ (CRT_GET_RFIB_DATA): New.
+ * config/i386/sysv4.h: Likewise.
+ * config/i386/sco5.h: Likewise.
+ (ASM_PREFERRED_EH_DATA_FORMAT): New.
+
+2001-05-22 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
+
+ * doc/install.texi (Specific): Remove a bogus and duplicate part
+ copied from the end of the document.
+
+2001-05-22 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
+
+ * install.texi: Remove obsolete information on SunOS as well as
+ i386-sun-sunos4, i860-intel-osf1, and powerpcle-*-solaris2*.
+ (Installing GNU CC on the Sun): Remove section.
+
+2001-05-22 Alexandre Oliva <aoliva@redhat.com>
+
+ * cppfiles.c (remove_component_p): Don't assume lstat/stat will
+ keep errno unchanged on success.
+
+2001-05-22 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * c-lex.c (lex_number): If pedantic and not C99, pedwarn exactly
+ once for hexadecimal floats, whether or not they contain a decimal
+ point. Don't let the setting of pedantic otherwise affect the
+ parsing of hexadecimal floats.
+
+2001-05-22 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
+
+ * README.ACORN: Remove obsolete file.
+
+2001-05-22 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ Merge objc.texi from mainline:
+ 2001-02-28 Ovidiu Predescu <ovidiu@cup.hp.com>
+ * objc-features.texi: Document the @compatibility_alias compiler
+ directive (description from Nicola Pero <n.pero@mi.flashnet.it>).
+
+2001-05-21 Mark Mitchell <mark@codesourcery.com>
+
+ * tree.h (type_num_arguments): Declare it.
+ * tree.c (type_num_arguments): New function.
+
+2001-05-21 Richard Henderson <rth@redhat.com>
+
+ * dwarf2out.c (current_funcdef_number): Move outside dwarf2
+ conditional ifdef.
+
+2001-05-21 Mark Mitchell <mark@codesourcery.com>
+
+ * c-decl.c (finish_decl): Don't set DECL_C_HARD_REGISTER for
+ non-register variables.
+ * extend.texi: Document that asm-specifications do not make sense
+ for non-static local variables.
+
+2001-05-17 Andrew Haley <aph@redhat.com>
+
+ * config/rs6000/linux.h (MD_FALLBACK_FRAME_STATE_FOR): New.
+
+2001-05-20 Mark Mitchell <mark@codesourcery.com>
+ Jim Wilson <wilson@redhat.com>
+
+ * libgcc2.h (TItype): Do not assume that the host has 64-bit ntegers.
+ (W_TYPE_SIZE): Likewise.
+
+2001-05-21 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * extend.texi: Clarify documentation of extensions included in ISO
+ C99. Prefer C99 terminology and syntax to old GNU terminology and
+ syntax. Add more index entries. Document mixed declarations and
+ code as an extension in C89 mode. Warn about future changes to
+ semantics of inline functions. Fixes PR other/930.
+
+2001-05-20 Richard Henderson <rth@redhat.com>
+
+ * sched-deps.c (sched_analyze_insn): Force volatile memory reads
+ to be output before a branch.
+
+ 2001-05-12 Neil Booth <neil@cat.daikokuya.demon.co.uk>
+ * sched-deps.c (sched_analyze_insn): Remove unused vars.
+
+ 2001-04-05 Bernd Schmidt <bernds@redhat.com>
+ * sched-deps.c (sched_analyze_insn): Revert more of the March 27
+ change.
+
+ 2001-04-04 Bernd Schmidt <bernds@redhat.com>
+ * sched-deps.c (sched_analyze_insn): Partially revert March 27
+ change.
+
+2001-05-20 Richard Henderson <rth@redhat.com>
+
+ * Makefile.in (dwarf2asm.o): Depend on $(TREE_H).
+
+2001-05-20 Richard Henderson <rth@redhat.com>
+
+ * config/i386/att.h (ASM_SHORT, ASM_LONG): Add trailing \t.
+ (ASM_DOUBLE): Remove.
+ * config/i386/bsd.h, config/i386/sco5.h: Likewise.
+ * config/i386/sun386.h: Likewise.
+
+ * config/i386/i386.h (UNALIGNED_SHORT_ASM_OP): New.
+ (UNALIGNED_INT_ASM_OP, INT_ASM_OP): New.
+
+ * config/i386/cygwin.h (INT_ASM_OP): Remove.
+ * config/i386/freebsd-aout.h, config/i386/i386-aout.h: Likewise.
+ * config/i386/i386-coff.h, config/i386/i386-interix.h: Likewise.
+ * config/i386/netbsd.h, config/i386/openbsd.h: Likewise.
+
+ * config/i386/cygwin.h: Adjust uses of ASM_LONG for trailing \t.
+ * config/i386/djgpp.h, config/i386/i386.h: Likewise.
+ * config/i386/i386elf.h, config/i386/ptx4-i.h: Likewise.
+ * config/i386/sco5.h, config/i386/svr3gas.h: Likewise.
+ * config/i386/sysv4.h, config/i386/vsta.h: Likewise.
+ * config/i386/win-nt.h, config/i386/win32.h: Likewise.
+
+2001-05-20 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * invoke.texi: Add more options to summary list.
+
+2001-05-19 Zack Weinberg <zackw@stanford.edu>
+
+ * extend.texi: Document #pragma GCC java_exceptions.
+
+2001-05-20 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * invoke.texi: Document meaning of -pedantic when -std=gnu* is
+ used. Fixes PR c/2291.
+ * gcc.1: Regenerate.
+
+2001-05-20 Stephane Carrez <Stephane.Carrez@worldnet.fr>
+
+ * config/m68hc11/m68hc11.c (m68hc11_override_options): Ignore
+ the -fpic and -fPIC options, clear flag_pic.
+
+2001-05-19 Brad Lucier <lucier@math.purdue.edu>, Alexandre Oliva <aoliva@redhat.com>
+
+ * Makefile.in (alloca.o): Depend on $(GCONFIG_H).
+ ($(HOST_PREFIX_1)alloca.o): Depend on $(HCONFIG_H). Arrange for
+ hconfig.h to be included.
+
+Sat May 19 18:23:04 2001 Richard Henderson <rth@redhat.com>
+
+ * except.c (dw2_build_landing_pads): Use word_mode, not Pmode,
+ as ncessary.
+ (expand_eh_return): Convert between word_mode and Pmode.
+ * unwind-dw2.c (extract_cie_info): Do not assume words and pointers
+ are the same size.
+ (execute_stack_op): Likewise.
+ (execute_cfa_program): Likewise.
+ (uw_frame_state_for): Likewise.
+ (uw_update_context_1): Likewise.
+ * unwind.inc (_Unwind_Reason_Code): Likewise.
+ * config/mips/mips.h (EH_RETURN_DATA_REGNO): Define.
+ (EH_RETURN_STACKADJ_RTX): Likewise.
+ * config/mips/mips.c (compute_frame_size): Make space for saving
+ EH return registers.
+ (mips_expand_epilogue): Handle EH stack adjustments.
+ * config/mips/mips.md (eh_return): New pattern.
+ (eh_set_lr_si): Likewise.
+ (eh_set_lr_di): Likewise.
+ Add splitter to perform EH return after reload.
+
+2001-05-19 Mark Mitchell <mark@codesourcery.com>
+
+ * jump.c (mark_jump_label): Tidy previous change.
+
+2001-05-17 Brendan Conoboy <blc@cygnus.com>
+ Bruce Korb <bkorb@gnu.org>
+
+ * fixinc/fixincl.sh(FIXINC): accept local directory if fixincl not
+ found in fixinc directory. Facilitates binary distributions.
+
+2001-05-19 Bruce Korb <bkorb@gnu.org>
+
+ * fixinc/fixincl.tpl: rewritten as an AutoGen version 5 template
+ * fixinc/genfixes: emit a warning if AutoGen is out of date
+ * fixinc/fixincl.x: regen
+ * fixinc/Makefile.in: open stdin for those building with a closed one.
+
+2001-05-19 Mark Mitchell <mark@codesourcery.com>
+
+ * jump.c (mark_jump_label): Tidy previous change.
+
+ * jump.c (jump_optimize_1): Tidy.
+ (mark_jump_label): When changing the label in a LABEL_REF, change
+ update any REG_EQUAL notes as well.
+
+ * defaults.h (TARGET_ALLOWS_PROFILING_WITHOUT_FRAME_POINTER): New
+ macro.
+ * tm.texi (TARGET_ALLOWS_PROFILING_WITHOUT_FRAME_POINTER):
+ Document it.
+ * toplev.c (main): If the target does not allow profiling without
+ a frame pointer, issue an error message.
+ * config/i386/linux.h (TARGET_ALLOWS_PROFILING_WITHOUT_FRAME_POINTER):
+ Define it to false.
+
+Sat May 19 09:40:45 2001 Denis Chertykov <denisc@overta.ru>
+
+ * regrename.c (regrename_optimize): frame pointer register can
+ use a few hardregs.
+
+2001-05-18 John David Anglin <dave@hiauly1.hia.nrc.ca>
+
+ * toplev.c (note_outlining_of_inline_function): Add ATTRIBUTE_UNUSED
+ to argument declaration.
+
+2001-05-18 Jason Merrill <jason_merrill@redhat.com>
+
+ * README.DWARF: Move into dwarfout.c.
+
+2001-05-18 Stan Shebs <shebs@apple.com>
+
+ * configure.in (gcc_cv_as_eh_frame): Cope with old assemblers.
+ * configure: Regenerate.
+
+2001-05-18 Geoff Keating <geoffk@redhat.com>
+
+ * config/rs6000/rs6000.c (rs6000_emit_prologue): Don't save
+ the link register if we're not going to use it.
+
+ * config/rs6000/rs6000.c (output_function_profiler): Fix a warning.
+
+2001-05-18 Per Bothner <per@bothner.com>
+
+ Changes needed for java/jvspec.c
+ * gcc.h (n_infiles, outfiles): Add declarations.
+ * gcc.c (n_infiles, outfiles): Mske no longer static.
+
+Fri May 18 10:12:19 2001 Jeffrey A Law (law@cygnus.com)
+
+ * config/pa/som.h (EXCEPTION_SECTION): Define.
+
+2001-05-18 Bernd Schmidt <bernds@redhat.com>
+
+ Revert
+ 2001-02-09 Nick Clifton <nickc@redhat.com>
+ * config/arm/arm.md: Change output constraint on post inc
+ load/store multiple patterns to be a read/write constraint.
+
+2001-05-18 Mark Mitchell <mark@codesourcery.com>
+
+ * function.c (expand_function_start): Avoid creating BLKmode
+ pseudos.
+
+2001-05-17 Mark Mitchell <mark@codesourcery.com>
+
+ * dwarf2out.c (output_comp_unit): Always output a compilation-unit
+ DIE, even if it has no children.
+ (dwarf2out_finish): Always output the line-number table, even if
+ it has no content.
+
+2000-05-18 David Edelsohn <edelsohn@gnu.org>
+
+ * rs6000.md (movsfcc,movdfcc): Remove NE case.
+
+2000-05-17 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
+
+ * config/rs6000/rs6000.c (rs6000_legitimate_address): Allow any stack
+ offsets if not REG_OK_STRICT.
+
+ * config/rs6000/rs6000.h (REG_OK_STRICT_FLAG): New macro.
+ (INT_REG_OK_FOR_INDEX_P): Likewise.
+ (INT_REG_OK_FOR_BASE_P): Likewise.
+ (REG_OK_FOR_INDEX_P): Use INT_REG_OK_FOR_INDEX_P.
+ (REG_OK_FOR_BASE_P): Use INT_REG_OK_FOR_BASE_P.
+ (LEGITIMATE_OFFSET_ADDRESS_P): Use INT_REG_OK_FOR_INDEX_P and
+ INT_REG_OK_FOR_BASE_P instead of REG_OK_FOR_INDEX_P and
+ REG_OK_FOR_BASE_P. Take an additional parameter.
+ (LEGITIMATE_INDEXED_ADDRESS_P): Likeewise.
+ (LEGITIMATE_INDIRECT_ADDRESS_P): Likewise.
+ (LEGITIMATE_LO_SUM_ADDRESS_P): Likewise.
+ (GO_IF_LEGITIMATE_ADDRESS): Move code into new function
+ rs6000_legitimate_address() and use it.
+ * config/rs6000/rs6000.c: Update all callers.
+ (rs6000_legitimate_address): New function.
+
+2001-05-17 Mark Kettenis <kettenis@wins.uva.nl>
+
+ * dwarf2out.c (modified_type_die): Equate qualified type to die.
+
+2001-05-17 Mark Mitchell <mark@codesourcery.com>
+
+ * doc/install.texi: Update Solaris information.
+
+ * except.h (protect_cleanup_actions): Remove it.
+ (lang_protect_cleanup_actions): Declare it.
+ * except.c (protect_cleanup_actions): Remove it.
+ (lang_protect_cleanup_actions): New variable.
+ (init_eh): Don't make protect_cleanup_actions a GC root.
+ (expand_eh_region_and_cleanup): Call
+ lang_protect_cleanup_actions.
+ (output_function_exception_table): Remove unused `align'
+ variable.
+ * varasm.c (assemble_external): Abort if we have not yet
+ opened the assembly output file.
+
+Thu May 17 11:53:49 2001 Jeffrey A Law (law@cygnus.com)
+
+ * pa.c (hppa_init_pic_save): No longer update last_parm_insn.
+
+ * except.c (sjlj_emit_function_enter): Call assemble_external_libcall
+ for eh_personality_libfunc.
+
+2001-05-17 Bernd Schmidt <bernds@redhat.com>
+
+ * reload1.c (delete_output_reload): Call eliminate_regs on substed.
+ (reload_as_needed): Call update_eliminable_offsets a bit later.
+
+ * expr.c (protect_from_queue): Protect against subsequent calls to
+ emit_queue.
+ (expand_expr, case ADDR_EXPR): Prevent protect_from_queue from being
+ too clever.
+
+2001-05-17 Jeffrey Oldham <oldham@codesourcery.com>
+
+ * dbxout.c (dbxout_symbol_location): For CONCAT, skip types not
+ COMPLEX_TYPE.
+
+2001-05-17 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
+
+ * gccbug.in (CATEGORIES): Add "bootstrap".
+
+2001-05-17 Bernd Schmidt <bernds@redhat.com>
+
+ * stmt.c (expand_asm_operands): For inout operands, make sure
+ the substitution of '=' for '+' makes it into the rtl.
+
+2001-05-17 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
+
+ * gcc.texi (gccbug): Refer to the web pages for detailed information
+ on GNATS.
+
+2001-05-16 Wolfgang Bangerth <wolfgang.bangerth@iwr.uni-heidelberg.de>
+ Bruce Korb <bkorb@gnu.org>
+
+ * fixinc/inclhack.def(solaris27_mutex_init): Fix broken mutex
+ initializer
+
+2001-05-16 Zack Weinberg <zackw@stanford.edu>
+
+ * assert.h: Removed.
+ * libgcc-std.ver, sys-protos.h: Remove __eprintf.
+ * libgcc2.c: Document that __eprintf exists for backward
+ compatibility only.
+ * configure.in: Correct commentary now assert.h does not exist.
+ * configure: Regenerate.
+
+ * Makefile.in: Delete INSTALL_ASSERT_H, assertdir, and all
+ references to either. Delete install-assert-h target. Do not
+ create $(assertdir) or $(gcc_tooldir) in mkinstalldirs target.
+ Move _eprintf from LIB2FUNCS to LIB2FUNCS_ST; pass
+ LIB2FUNCS_ST to mklibgcc.
+ * cross-make: Don't set assertdir.
+ * mklibgcc.in: Add support for LIB2FUNCS_ST.
+
+ * config/t-freebsd, config/t-linux, config/t-linux-aout,
+ config/t-netbsd, config/t-openbsd, config/t-rtems, config/x-linux,
+ config/alpha/t-interix, config/i386/t-beos, config/i386/t-interix,
+ config/mcore/t-mcore, config/mcore/t-mcore-pe:
+ No need to set INSTALL_ASSERT_H.
+
+ * fixinc/fixinc.dgux, fixinc/fixinc.interix, fixinc/fixinc.ptx,
+ fixinc/fixinc.svr4, fixinc/fixinc.winnnt, fixinc/fixinc.wrap,
+ fixinc/fixincl.sh: Don't install assert.h.
+
+2001-05-16 Zack Weinberg <zackw@stanford.edu>
+
+ * i386.md: Add two peepholes to clean up code generated by
+ cmpstr* expanders.
+
+2001-05-16 Richard Henderson <rth@redhat.com>
+
+ * dwarf2asm.c (eh_data_format_name): Add names for "pointer size"
+ variants of non-absolute encodings.
+
+ * config/i386/i386.h (ASM_PREFERRED_EH_DATA_FORMAT): New.
+
+ * libgcc-std.ver (_Unwind_Find_FDE, __register_frame_info_bases,
+ __register_frame_info_table_bases): Export.
+
+Wed May 16 13:38:21 2001 Jeffrey A Law (law@cygnus.com)
+
+ * pa32-regs.h (HARD_REGNO_MODE_OK): Allow TI/TFmode values in
+ GPRs.
+
+2001-05-16 Richard Henderson <rth@redhat.com>
+
+ * except.c (eh_data_format_name): Move to ...
+ * dwarf2asm.c: ... here. Use designated initializers if available.
+ (dw2_asm_output_encoded_addr_rtx): Accept varargs commentary.
+ * dwarf2asm.h: Update declarations.
+ * dwarf2out.c (output_cfi) [DW_CFA_set_loc]: If for_eh, mind
+ ASM_PREFERRED_EH_DATA_FORMAT.
+ (output_call_frame_info): Likewise. Use 'L' augmentation for
+ the LSDA encoding.
+
+ * unwind-dw2-fde.h (struct fde_vector): New.
+ (struct old_object): Rename from struct object.
+ (struct object): New.
+ (__register_frame_info_bases): Declare.
+ (__register_frame_info_table_bases): Declare.
+ (struct dwarf_fde): Remove explicit pc_begin/pc_range members.
+ * unwind-dw2-fde.c (objects): Remove.
+ (unseen_objects, seen_objects): New.
+ (__register_frame_info_bases): New.
+ (__register_frame_info): Use it.
+ (__register_frame_info_table_bases): New.
+ (__register_frame_info_table): Use it.
+ (__deregister_frame_info): Rewrite for changed object struct.
+ (base_from_object, get_cie_encoding, get_fde_encoding): New.
+ (fde_unencoded_compare): Rename from fde_compare; uninline.
+ (fde_single_encoding_compare, fde_mixed_encoding_compare): New.
+ (start_fde_sort): Adjust for new definition of fde_vector.
+ (fde_insert): Likewise.
+ (end_fde_sort): Likewise. Select comparison function based
+ on properties of the object.
+ (fde_split): Take object and fde_compare_t arguments.
+ (frame_heapsort, fde_merge): Likewise.
+ (classify_object_over_fdes): Rename from count_fdes. Handle
+ encoded pointers. Collect encoding, mixed_encoding, and pc_begin
+ for the object.
+ (add_fdes): Handle encoded pointers.
+ (init_object): Rename from frame_init. Update for new struct object.
+ (linear_search_fdes): Rename from search_fdes. Handle encoded
+ pointers.
+ (binary_search_unencoded_fdes): Broken out from _Unwind_Find_FDE.
+ (binary_search_single_encoding_fdes): New.
+ (binary_search_mixed_encoding_fdes): New.
+ (search_object): New.
+ (_Unwind_Find_FDE): Update for new struct object. Fill in
+ the dwarf_eh_bases.
+ * unwind-dw2.c: Include unwind-pe.h. Constify all pointers
+ iterating over EH data.
+ (_Unwind_FrameState): Remove saw_lsda, addr_encoding. Add
+ fde_encoding, lsda_encoding.
+ (read_uleb128, read_sleb128): Remove.
+ (read_encoded_pointer): Remove. All callers use read_encoded_value.
+ (extract_cie_info): Set lsda_encoding from 'L' augmentation.
+ (uw_frame_state_for): Don't set bases.func. Handle encoded fde
+ pointers.
+ * unwind-pe.h: Add "struct" to _Unwind_Context references.
+
+2001-05-16 Andreas Jaeger <aj@suse.de>
+
+ * Makefile.in (toplev.o): Add dependency on dwarf2asm.h.
+
+ * toplev.c: Include dwarf2asm.h for prototype of
+ dw2_output_indirect_constants.
+
+2001-05-16 Richard Henderson <rth@redhat.com>
+
+ 2001-03-08 Richard Henderson <rth@redhat.com>
+ * configure.in (HAVE_AS_LEB128): New assembler check.
+ * configure, config.in: Rebuilt.
+
+2001-05-16 David Edelsohn <edelsohn@gnu.org>
+
+ * doc/install.texi: Update AIX information.
+ * README.RS6000: Remove obsolete file.
+
+2001-05-16 John David Anglin <dave@hiauly1.hia.nrc.ca>
+
+ * pa-hpux10.h (THREAD_MODEL_SPEC): Define.
+
+2001-05-16 Jakub Jelinek <jakub@redhat.com>
+ Nathan Sidwell <nathan@codesourcery.com>
+
+ * gcc.c (give_switch): Don't write before start of string.
+ Always append suffix.
+
+2001-05-16 Nathan Sidwell <nathan@codesourcery.com>
+
+ * cpplex.c (_cpp_lex_token, '/' case): Comments can't appear
+ after stage3.
+
+2001-05-16 Dean Wakerley <dean@wakerley.com>
+
+ * doc/install.texi: New file. Converted to texinfo from the HTML
+ documentation in wwwdocs/htdocs/install.
+
+2001-05-16 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
+
+ * README.ALTOS: Remove obsolete file.
+
+Tue May 15 22:12:41 2001 Jeffrey A Law (law@cygnus.com)
+
+ * flow.c (life_analysis): After life analysis is complete, do
+ an optional scan over insns looking for REG_LABEL notes that
+ reference a deleted label.
+ (propagate_block_delete_insn): Verify INOTE is a CODE_LABEL
+ before peeking at LABEL_NUSES.
+
+2001-05-15 Richard Henderson <rth@redhat.com>
+
+ * unwind-sjlj.c (_Unwind_GetDataRelBase): New.
+ (_Unwind_GetTextRelBase): New.
+
+2001-05-15 Mark Mitchell <mark@codesourcery.com>
+
+ * config/sparc/sol2.h (CPLUSPLUS_CPP_SPEC): Define.
+
+2001-05-15 Loren J. Rittle <ljrittle@acm.org>
+
+ * gthr-posix.h: Make additional pthread-* functions weak.
+
+2001-05-14 Richard Henderson <rth@redhat.com>
+
+ * configure.in (gcc_cv_as_eh_frame): New test.
+ * config.in, configure: Rebuild.
+ * gcc.c (init_spec): Honor USE_AS_TRADITIONAL_FORMAT.
+
+2001-05-14 Andrew MacLeod <amacleod@redhat.com>
+
+ * config/ia64/ia64.c (rtx_needs_barrier): Call rtx_needs_barrier
+ for RETURNS as well.
+ * config/ia64/lib1funcs.asm (__divtf3): Fix incorrect bits in
+ extended precision divide.
+
+2001-05-14 Andrew Haley <aph@redhat.com>
+
+ * reload1.c (copy_eh_notes): New function.
+ (emit_input_reload_insns): Call it.
+ (emit_output_reload_insns): Call it.
+
+ * emit-rtl.c (try_split): Copy EH notes to sequence.
+
+2001-05-14 Richard Henderson <rth@redhat.com>
+
+ 2001-04-12 Richard Henderson <rth@redhat.com>
+ * Makefile.in (regmove.o): Depend on except.h.
+ * regmove.c: Include it.
+
+Mon May 14 08:57:23 2001 Jeffrey A Law (law@cygnus.com)
+
+ * config/pa/som.h (NM_FLAGS): Remove.
+ (ASM_OUTPUT_FUNCTION_PREFIX): No longer truncate subspace names.
+ (ASM_OUTPUT_SECTION_NAME): Remove.
+ (MAKE_DECL_ONE_ONLY, ASM_WEAKEN_LABEL): Likewise.
+
+2001-05-14 Mark Mitchell <mark@codesourcery.com>
+
+ * regrename.c (regrename_optimize): Do not rename registers to
+ leaf registers.
+
+2001-05-14 Alexandre Oliva <aoliva@redhat.com>
+
+ * rtl.texi (CALL_INSN_FUNCTION_USAGE): Note that (and when) it may
+ contain MEMs. Remove useless distinction about clobbering
+ registers.
+
+2001-05-13 Richard Henderson <rth@redhat.com>
+
+ 2001-03-28 Richard Henderson <rth@redhat.com>
+ * config/rs6000/rs6000.h (EPILOGUE_USES): Use TARGET_AIX,
+ not TARGET_TOC for special toc restore handling.
+ * config/rs6000/rs6000.md (eh_return): Likewise.
+
+2001-05-13 Alexandre Oliva <aoliva@redhat.com>
+
+ * tm.texi (THREAD_MODEL_SPEC): Document it.
+ * gcc.c (main): Use it.
+ * config/rs6000/aix43.h (THREAD_MODEL_SPEC): Define it.
+ * config/rs6000/aix51.h (THREAD_MODEL_SPEC): Likewise.
+
+2001-05-13 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
+
+ * rtl.h (SYMBOL_REF_WEAK): New macro.
+ * rtlanal.h (rtx_addr_can_trap): Use it, a weak SYMBOL_REF can trap.
+ * varasm.c (make_decl_rtl): Mark SYMBOL_REF weak if necessary.
+ * rtl.texi (SYMBOL_REF_WEAK): Document it.
+ * gcc.texi: Remove wrong description.
+
+2001-05-13 Mark Mitchell <mark@codesourcery.com>
+
+ * stringpool.c (xxx, yyy): Remove.
+ (get_identifier): Don't set them.
+
+ * Makefile.in (STAMP): New macro.
+ Replace all uses of `touch' with $(STAMP).
+ * fixinc/Makefile.in: Likewise.
+
+2001-05-13 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * i386.c (ix86_save_reg): Change `bool' parameter to `int'.
+
+2001-05-12 Richard Henderson <rth@redhat.com>
+
+ EH merge from mainline, continued.
+
+ 2001-05-12 Richard Henderson <rth@redhat.com>
+ * dwarf2asm.c (size_of_encoded_value): New function.
+ * dwarf2asm.h: Declare it.
+ * except.c (output_function_exception_table): Align the TType
+ array only as wide as the encoding.
+
+ 2001-05-11 Richard Henderson <rth@redhat.com>
+ * defaults.h (ASM_PREFERRED_EH_DATA_FORMAT): New.
+ * dwarf2asm.c (dw2_force_const_mem, dw2_output_indirect_constant_1,
+ dw2_output_indirect_constants, dw2_asm_output_encoded_addr_rtx): New.
+ * dwarf2asm.h (dw2_asm_output_encoded_addr_rtx): Prototype.
+ (dw2_output_indirect_constants): Prototype.
+ * dwarf2out.c (dwarf2out_begin_prologue): Generate
+ current_function_func_begin_label if we'll need it for EH. Exit
+ early for IA64_UNWIND_INFO.
+ * except.c: Get DW_EH_PE_* defines from dwarf2.h.
+ (eh_data_format_name): Update for indirect references.
+ (output_function_exception_table): Care for IA64_UNWIND_INFO.
+ Handle ASM_PREFERRED_EH_DATA_FORMAT.
+ * except.h (MUST_USE_SJLJ_EXCEPTIONS): IA64_UNWIND_INFO needn't
+ define HAVE_eh_return etc.
+ * final.c (final_start_function): Always call dwarf2out_begin_prologue.
+ (final_end_function): Don't call output_function_exception_table.
+ * toplev.c (compile_file): Call dw2_output_indirect_constants.
+ (rest_of_compilation): Invoke output_function_exception_table
+ for ia64 before assemble_end_function.
+ * tm.texi (ASM_PREFERRED_EH_DATA_FORMAT): Document.
+ (ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX): Document.
+
+ * unwind-dw2.c (_Unwind_GetTextRelBase, _Unwind_GetDataRelBase): New.
+ * unwind.h: Declare them.
+ * libgcc-std.ver: Export them.
+ * unwind-pe.h: New file.
+
+ * config/alpha/elf.h (ASM_PREFERRED_EH_DATA_FORMAT): New.
+
+ * config/ia64/fde-glibc.c: Use "struct unw_table_entry"
+ instead of "fde".
+ (find_fde_for_dso): Extract DT_PLTGOT.
+ (_Unwind_FindTableEntry): Rename from __ia64_find_fde; return
+ the segment and gp as well.
+ * config/ia64/frame-ia64.c: Remove file.
+ * config/ia64/frame-ia64.h: Remove file.
+ * config/ia64/unwind-ia64.c: New file.
+ * config/ia64/unwind-ia64.h: New file.
+ * config/ia64/ia64.h (ASM_OUTPUT_EH_CHAR): Remove.
+ (ASM_OUTPUT_EH_SHORT, ASM_OUTPUT_EH_INT): Remove.
+ (ASM_OUTPUT_EH_DOUBLE_INT): Remove.
+ (ASM_PREFERRED_EH_DATA_FORMAT): New.
+ (ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX): New.
+ (IA64_UNWIND_INFO): Re-enable.
+ (HANDLER_SECTION): Remove.
+ (EH_RETURN_DATA_REGNO): New.
+ * config/ia64/ia64.md (exception_receiver): Remove.
+ * config/ia64/t-glibc (LIB2ADDEH): Re-enable.
+ * config/ia64/t-ia64 (LIB2ADDEH): Re-enable.
+
+ Mon May 7 09:30:14 2001 Jeffrey A Law (law@cygnus.com)
+ * except.c (sjlj_mark_call_sites): Do not search for assignments to
+ non-argumment registers that are mentioned in CALL_INSN_FUNCTION_USAGE.
+
+ 2001-05-05 Richard Henderson <rth@redhat.com>
+ * except.c (remove_fixup_regions): Adjust REG_EH_REGION notes
+ to the parent of the fixup region.
+
+ 2001-04-28 Jason Merrill <jason_merrill@redhat.com>
+ * except.c (expand_eh_region_start): Don't start a new block.
+ (expand_eh_region_end): Don't end a block.
+ * stmt.c (expand_end_bindings): Don't end EH blocks.
+ (expand_decl_cleanup): Starting an EH region won't change the block.
+ (mark_block_as_eh_region, mark_block_as_not_eh_region): Lose.
+ (is_eh_region): Lose.
+ * tree.h: Adjust.
+
+ 2001-04-27 Jeffrey Oldham <oldham@codesourcery.com>
+ * except.c (expand_eh_region_end_cleanup): word_mode, not Pmode.
+
+ 2001-04-27 Jason Merrill <jason_merrill@redhat.com>
+ * except.c (get_exception_filter): word_mode, not Pmode.
+
+ 2001-04-26 Andrew Haley <aph@cambridge.redhat.com>
+ * except.c (expand_eh_region_end_cleanup): Force pending stack
+ adjust before emitting label that branches around cleanup code.
+
+ 2001-04-25 Richard Henderson <rth@redhat.com>
+ * config/i386/i386.c (ix86_expand_epilogue): Properly compute size
+ of registers to restore along non eh_return path.
+
+ 2001-04-24 Jason Merrill <jason_merrill@redhat.com>
+ * except.c (reachable_handlers): Step out one level from a RESX.
+
+ * except.c (struct eh_region): Rename 'last' to 'resume'.
+ (mark_eh_region, duplicate_eh_region_1): Adjust.
+ (expand_eh_region_end_cleanup): Remember the jump, not the barrier.
+ (build_post_landing_pads): Likewise.
+ (expand_end_catch, expand_eh_region_end_allowed): Don't set it.
+ (expand_eh_region_end_must_not_throw): Likewise.
+ (connect_post_landing_pads): Thread (only) regions with non-deleted
+ resume insns.
+
+ * except.c (expand_eh_region_end_cleanup): Save the EH return data
+ registers around the cleanup.
+ (get_exception_filter): New fn.
+ (finish_eh_generation): Use it.
+
+ 2001-04-03 Richard Henderson <rth@redhat.com>
+ * rtl.h (LCT_THROW): New.
+ * calls.c (emit_library_call_value_1): Handle it.
+ * except.c (connect_post_landing_pads): Use it.
+
+ 2001-03-28 Richard Henderson <rth@redhat.com>
+ * except.c: Rewrite entirely for IA-64 ABI exception handling.
+ * except.h: Likewise.
+
+ * Makefile.in (LIB2ADDEH): Mention unwind-dw2*.c
+ (LIB2ADDEHDEP): New.
+ (LIB2FUNCS_EH): Remove.
+ (LIB2ADD): Remove LIB2ADDEH.
+ (libgcc.mk): Pass LIB2ADDEHDEP, don't pass LIB2FUNCS_EH.
+ (LIBGCC_DEPS): Use LIB2ADDEHDEP.
+ (crt{begin,end}[S].o): Likewise.
+ (except.o): Update includes.
+ * mklibgcc.in: Remove LIB2FUNCS_EH, add LIB2ADDEH, LIB2ADDEHDEP.
+ (libgcc2_c_dep): Use LIB2ADDEHDEP.
+
+ * basic-block.h (struct basic_block_def): Remove eh_beg, eh_end.
+ * bb-reorder.c (reorder_basic_blocks): Don't disable for EH.
+ * builtins.def (BUILT_IN_EH_RETURN_DATA_REGNO): New.
+ * builtins.c (expand_builtin): Implement it.
+ [BUILT_IN_EH_RETURN]: Update for nr arguments change.
+ * c-common.c (c_common_nodes_and_builtins): Declare it.
+ * c-decl.c (init_decl_processing): Update __builtin_eh_return.
+ * calls.c (libfunc_nothrow): Remove.
+ (emit_library_call_value_1): Don't call it.
+ * crtstuff.c: Include unwind-dw2-fde.h instead of frame.h.
+ * dwarf2.h (dwarf_call_frame_info): Add dwarf2.1 elements.
+ (DW_EH_PE_*): New defines for pointer encoding in .eh_frame.
+ * dwarf2out.c (struct dw_fde_struct): Add uses_eh_lsda, funcdef_number.
+ (current_funcdef_number): Globalize.
+ (output_call_frame_info): Emit frame data if an lsda is needed.
+ Generate augmentation for personality routine. Don't play with
+ difference symbols.
+ (dwarf2out_begin_prologue): Record funcdef_number.
+ * dwarf2out.h (current_funcdef_number): Declare.
+ * expr.c (expand_expr): Update for except.h name changes.
+ Remove POPDCC_EXPR, POPDHC_EXPR. Add EXC_PTR_EXPR.
+ * expr.h (LTI_throw, LTI_rethrow): Remove.
+ (LTI_sjthrow, LTI_sjpopnthrow, LTI_terminate): Remove.
+ (LTI_eh_rtime_match): Remove.
+ (LTI_unwind_resume, LTI_eh_personality): Add.
+ (LTI_unwind_sjlj_register, LTI_unwind_sjlj_unregister): Add.
+ * final.c (final): Don't call check_exception_handler_labels,
+ init_insn_eh_region, or free_insn_eh_region.
+ (final_scan_insn): Always emit debug labels for
+ NOTE_INSN_EH_REGION notes.
+ * flow.c (entry_exit_blocks): Remove eh_beg, eh_end.
+ (record_active_eh_regions): Remove.
+ (count_basic_blocks): Check all instructions for REG_EH_REGION.
+ Use can_throw_internal.
+ (find_basic_blocks_1): Likewise.
+ (move_stray_eh_region_notes): Remove.
+ (find_label_refs): No eh_return_stub_label.
+ (make_edges): Likewise. No init/free_eh_nesting_info. Handle RESX.
+ (make_eh_edge): No eh_nest_info. Update for reachable_handlers
+ changes.
+ (delete_unreachable_blocks): Don't track deleted handlers.
+ (flow_delete_block): Use maybe_remove_eh_handler.
+ (delete_eh_regions): Remove.
+ (merge_blocks): Don't check for eh region match.
+ (mark_regs_live_at_end): Handle EH_RETURN_DATA_REGNO,
+ EH_RETURN_STACKADJ_RTX, EH_RETURN_HANDLER_RTX.
+ (init_propagate_block_info): Disable dead frame store optimization
+ when current_function_calls_eh_return.
+ (dump_bb): Don't print eh_beg, eh_end.
+ * function.c (fixup_var_refs): No catch_clauses.
+ (expand_function_end): Likewise. Call expand_eh_return before
+ the return register use. Call sjlj_emit_function_exit_after.
+ (expand_function_start): Force pseudo DECL_RESULT if sjlj exceptions.
+ * function.h (struct function): Add calls_eh_return, uses_eh_lsda.
+ * ifcvt.c (dead_or_predicable): Remove eh region check.
+ * integrate.c (function_cannot_inline_p): Disallow __builtin_eh_return.
+ Don't check for EH vs parameters.
+ (expand_inline_function_eh_labelmap, eif_eh_map): Remove.
+ (expand_inline_function): Call duplicate_eh_regions.
+ (copy_insn_list): Don't handle NOTE_INSN_EH_REGION_BEG/END.
+ (copy_insn_notes): Remap REG_EH_REGION notes.
+ (copy_rtx_and_substitute): Remove SYMBOL_REF_NEED_ADJUST check.
+ * jump.c (jump_optimize_1): Don't init/free_insn_eh_region, nor
+ check_exception_handler_labels, nor exception_optimize.
+ (find_cross_jump): No EH region check.
+ * optabs.c (init_optabs): Update for changed eh libfuncs.
+ * rtl.def (RESX): New.
+ * rtl.h (SYMBOL_REF_NEED_ADJUST): Remove.
+ * stmt.c (expand_decl_cleanup): Simplify using_eh_for_cleanups_p
+ checks. Update for except.h name changes.
+ (expand_cleanups): Likewise.
+ (expand_dcc_cleanup, expand_dhc_cleanup): Remove.
+ * toplev.c (dump_file_index, dump_file): Add .02.eh dump.
+ (compile_file): Call init_eh before init_optabs. Don't
+ output_exception_table here.
+ (rest_of_compilation): Call convert_from_eh_region_ranges,
+ convert_to_eh_region_ranges, output_function_exception_table.
+ Don't emit_eh_context.
+ * tree.def (POPDHC_EXPR, POPDCC_EXPR): Remove.
+ (EXC_PTR_EXPR): New.
+
+ * md.texi (eh_epilogue): Remove.
+ (eh_return): Document.
+ * tm.texi (EH_RETURN_DATA_REGNO): Document.
+ (EH_RETURN_STACKADJ_RTX, EH_RETURN_HANDLER_RTX): Document.
+
+ * eh-common.h: Remove file.
+ * frame-dwarf2.c, frame.c, frame.h: Remove files.
+ * libgcc2.c (L_eh): Remove.
+
+ * unwind-dw2-fde.c: New file, largely copied from frame.c.
+ * unwind-dw2-fde.h: New file.
+ * unwind-dw2.c: New file, largely cribbed from frame-dwarf2.c.
+ * unwind-sjlj.c, unwind.h, unwind.inc: New files.
+ * libgcc-std.ver: Update for eh symbols.
+
+ * config/alpha/alpha.c (alpha_sa_mask): Add EH_RETURN_DATA_REGNOs.
+ (alpha_mark_machine_status): No eh_epilogue_sp_ofs ...
+ (alpha_expand_epilogue): ... use EH_RETURN_STACKADJ_RTX instead.
+ * config/alpha/alpha.h (machine_function): Remove eh_epilogue_sp_ofs.
+ (EH_RETURN_DATA_REGNO): New.
+ (EH_RETURN_STACKADJ_RTX, EH_RETURN_HANDLER_RTX): New.
+ * config/alpha/alpha.md (eh_epilogue): Remove.
+ (exception_receiver): Use $26 for ldgp input.
+ * config/alpha/linux.h (MD_FALLBACK_FRAME_STATE_FOR): New.
+
+ * config/i386/i386.c (general_no_elim_operand): Disallow virtual regs.
+ (ix86_save_reg): If maybe_eh_return, true for EH_RETURN_DATA_REGNOs.
+ True for pic register if current_function_calls_eh_return.
+ (ix86_expand_epilogue): Change "emit_return" argument into "style".
+ Handle eh_return requirements.
+ * config/i386/i386.h (EH_RETURN_DATA_REGNO): New.
+ (EH_RETURN_STACKADJ_RTX): New.
+ * config/i386/i386.md (exception_receiver): Remove.
+ (eh_return, eh_return_1): New.
+ * config/i386/linux.h (MD_FALLBACK_FRAME_STATE_FOR): New.
+
+ * config/rs6000/rs6000.c (rs6000_stack_info): Allocate space
+ for eh_return data registers.
+ (rs6000_emit_prologue): Save eh_return data registers.
+ (rs6000_emit_epilogue): Force inline restores if eh_return.
+ Restore eh_return data registers. Mind EH_RETURN_STACKADJ_RTX.
+ * config/rs6000/rs6000.h (rs6000_stack_t): Add ehrd_offset.
+ (EH_RETURN_DATA_REGNO, EH_RETURN_STACKADJ_RTX): New.
+ (EPILOGUE_USES): True for TOC_REGISTER if calls_eh_return and
+ the target uses one.
+ * config/rs6000/rs6000.md (eh_epilogue, eh_reg_restore): Remove.
+ (return_eh_si, return_eh_di): Remove.
+ (eh_return): New, from corpse of eh_epilogue.
+ (eh_set_lr_si, eh_set_lr_di): New.
+
+ * config/sparc/sparc.c (eligible_for_epilogue_delay): False if
+ current_function_calls_eh_return.
+ (output_function_epilogue): Handle eh_return.
+ * config/sparc/sparc.h (DOESNT_NEED_UNWINDER): Remove.
+ (EH_RETURN_DATA_REGNO): New.
+ (EH_RETURN_STACKADJ_RTX): New.
+ (EH_RETURN_HANDLER_RTX): New.
+ * config/sparc/sparc.md (call/short branch peepholes): Check
+ can_throw_internal instead of in_same_eh_region.
+
+ 2001-03-17 Richard Henderson <rth@redhat.com>
+ * dwarf2out.c (queue_reg_save): New.
+ (flush_queued_reg_saves, clobbers_queued_reg_save): New.
+ (dwarf2out_frame_debug_expr): Call queue_reg_save instead of
+ dwarf2out_reg_save.
+ (dwarf2out_frame_debug): Call flush_queued_reg_saves when needed.
+ (cfa, cfa_store, cfa_temp): Make static.
+ * final.c (final_scan_insn): Always call dwarf2out_frame_debug.
+
+ 2001-03-16 Richard Henderson <rth@redhat.com>
+ * dwarf2asm.c (dw2_asm_output_data): Mask data to the output size.
+ (dw2_asm_output_data_uleb128): Use space not tab after .uleb128.
+ (dw2_asm_output_delta_uleb128): Likewise.
+ (dw2_asm_output_delta_sleb128): Similarly.
+ (dw2_asm_output_data_sleb128): Similarly. Print number in decimal.
+
+ 2001-03-15 Richard Henderson <rth@redhat.com>
+ * dwarf2asm.c (dw2_asm_output_offset): Use ASM_OUTPUT_DWARF_OFFSET
+ if provided by the target.
+ (dw2_asm_output_pcrel): Likewise with ASM_OUTPUT_DWARF_PCREL.
+ (dw2_asm_output_addr): New.
+ * dwarf2asm.h (dw2_asm_output_addr): Declare.
+ * dwarf2out.c (output_cfi): Use it for program addresses.
+ (output_call_frame_info, output_die): Likewise.
+ (output_aranges, output_line_info): Likewise.
+
+ 2001-03-06 Krister Walfridsson <cato@df.lth.se>
+ * dwarf2asm.c (dw2_asm_output_delta): Fix smallest_mode_for_size call.
+
+ 2001-03-02 Richard Henderson <rth@redhat.com>
+ * Makefile.in (OBJS): Add dwarf2asm.o.
+ * dwarf2asm.c, dwarf2asm.h: New files.
+ * dwarf2out.c (*): Use them.
+ (size_of_uleb128, size_of_sleb128): Remove.
+ (output_uleb128, output_sleb128): Remove.
+ (UNALIGNED_SHORT_ASM_OP, UNALIGNED_INT_ASM_OP): Remove.
+ (UNALIGNED_DOUBLE_INT_ASM_OP, ASM_BYTE_OP): Remove.
+ (UNALIGNED_OFFSET_ASM_OP, UNALIGNED_WORD_ASM_OP): Remove.
+ (FDE_LABEL, LINE_NUMBER_BEGIN_LABEL, LINE_NUMBER_END_LABEL): New.
+ (ASM_OUTPUT_DWARF_DATA1, ASM_OUTPUT_DWARF_DELTA1): Remove.
+ (ASM_OUTPUT_DWARF_DATA2, ASM_OUTPUT_DWARF_DELTA2): Remove.
+ (ASM_OUTPUT_DWARF_DATA4, ASM_OUTPUT_DWARF_DELTA4): Remove.
+ (ASM_OUTPUT_DWARF_DATA, ASM_OUTPUT_DWARF_DELTA): Remove.
+ (ASM_OUTPUT_DWARF_ADDR, ASM_OUTPUT_DWARF_ADDR_DATA): Remove.
+ (ASM_OUTPUT_DWARF_ADDR_DELTA, ASM_OUTPUT_DWARF_ADDR_CONST): Remove.
+ (ASM_OUTPUT_DWARF_OFFSET4, ASM_OUTPUT_DWARF_OFFSET): Remove.
+ (ASM_OUTPUT_DWARF_CONST_DOUBLE): Remove.
+ (ASM_OUTPUT_DWARF_NSTRING, ASM_OUTPUT_DWARF_STRING): Remove.
+ (dwarf2out_frame_debug): Remove unused variables.
+ (output_loc_operands): Don't abort on 8 byte constants if
+ host integers are wide enough.
+ (output_symbolic_ref): Remove.
+ (size_of_die): Don't assume 4 byte host integers.
+ (output_line_info): Use ASM_GENERATE_INTERNAL_LABEL for begin
+ and end labels.
+ (add_const_value_attribute) [CONST_INT]: Verify we're not doing
+ something stupid with HOST_WIDE_INT to long truncation.
+ [CONST_DOUBLE]: Likewise.
+
+ * config/arm/conix-elf.h (UNALIGNED_WORD_ASM_OP): Remove.
+ (ASM_OUTPUT_DWARF2_ADDR_CONST, ASM_OUTPUT_DWARF_ADDR_CONST): Remove.
+ * config/arm/unknown-elf.h: Likewise.
+ * config/rs6000/aix.h (UNALIGNED_SHORT_ASM_OP): New.
+ (UNALIGNED_INT_ASM_OP, UNALIGNED_DOUBLE_INT_ASM_OP): New.
+ (ASM_OUTPUT_DWARF_ADDR_VAR, ASM_OUTPUT_DWARF_DELTA_VAR): Remove.
+ (ASM_OUTPUT_DWARF_DELTA2, ASM_OUTPUT_DWARF_DELTA4): Remove.
+ (ASM_OUTPUT_DWARF_DELTA, ASM_OUTPUT_DWARF_ADDR_DELTA): Remove.
+ (ASM_OUTPUT_DWARF_ADDR, ASM_OUTPUT_DWARF_DATA4): Remove.
+ (ASM_OUTPUT_DWARF_DATA2, ASM_OUTPUT_DWARF_OFFSET4): Remove.
+ (ASM_OUTPUT_DWARF_OFFSET): Remove.
+ * config/rs6000/sysv4.h (ASM_OUTPUT_DWARF_ADDR): Remove.
+ * config/sparc/sp64-elf.h (UNALIGNED_DOUBLE_INT_ASM_OP): New.
+ (UNALIGNED_LONGLONG_ASM_OP, ASM_OUTPUT_DWARF_ADDR): Remove.
+ (ASM_OUTPUT_DWARF_ADDR_CONST, ASM_OUTPUT_DWARF_REF): Remove.
+
+ Sat Feb 24 03:32:50 CET 2001 Jan Hubicka <jh@suse.cz>
+ * i386.c (ix86_frame): New structure.
+ (ix86_compute_frame_size): Kill.
+ (ix86_compute_frame_layout): New.
+ (ix86_save_reg): New.
+ (ix86_can_use_return_insn_p): Use frame layout stuff.
+ (ix86_expand_prologue): Likewise.
+ (ix86_expand_epilogue): Likewise.
+ (ix86_initial_elimination_offset): Likewise.
+ (ix86_nsaved_regs): Use ix86_save_reg.
+ (ix86_emit_save_regs): Likewise.
+
+2001-05-12 Richard Henderson <rth@redhat.com>
+
+ EH merge from mainline, parts 5 - 16.
+ * regmove.c (perhaps_ends_bb_p): Use can_throw_internal to
+ reduce false positives.
+ (regmove_optimize): Disable if flag_non_call_exceptions.
+
+ * stmt.c (expand_return): Remove always true predicate.
+ (expand_decl_cleanup_no_eh): Remove dead code.
+
+ * sched-deps.c (sched_analyze_insn): Consolidate scheduling
+ barrier code. Add a scheduling barrier if a non-call insn
+ can throw internally.
+
+ * rtlanal.c (rtx_addr_can_trap_p): Virtual registers cannot trap.
+ Auto-inc addresses trap only if their base register does.
+
+ * except.c (can_throw_internal): Rename from can_throw.
+ * except.h, resource.c: Update references.
+
+ * integrate.c (copy_insn_list): Use returnjump_p.
+ (copy_insn_notes): Recurse for CALL_PLACEHOLDER.
+
+ * integrate.h (struct inline_remap): Add local_return_label.
+ * integrate.c (expand_inline_function): Initialize it and emit
+ it after copy_insn_notes.
+ (copy_insn_list): Don't store local_return_label here.
+ (copy_insn_notes): New function split out from copy_insn_list.
+
+ * function.h (struct function): Move all boolean valued fields
+ to single bit fields at the end of the struct.
+
+ * flow.c (cleanup_cfg): Take no argument.
+ * output.h, sibcall.c, toplev.c: Update all calls.
+
+ * flow.c (tidy_fallthru_edges): Don't combine complex edges.
+ (calculate_global_regs_live): Kill call-clobbered registers
+ across exception edges.
+ * reg-stack.c (convert_regs_1): Kill the entire target stack
+ across non-call exception edges.
+
+ * flags.h (flag_new_exceptions): Remove.
+ * toplev.c: Don't set it.
+ * final.c: Don't check it.
+ * except.c: Provide stub definition.
+
+ * combine.c (distribute_notes) [REG_EH_REGION]: If non-call
+ exceptions, put the note on the trapping instruction.
+
+ * Makefile.in (cs-tconfig.h): Copy USING_SJLJ_EXCEPTIONS
+ value to target configuration header.
+ * configure.in (CONFIG_SJLJ_EXCEPTIONS): New.
+ * config.in, configure: Rebuild.
+ * except.h (USING_SJLJ_EXCEPTIONS): New. Define based on
+ configuration and target defines.
+ (exceptions_via_longjmp): Remove.
+ * dwarf2out.c, except.c, final.c, toplev.c, config/ia64/ia64.c:
+ Use USING_SJLJ_EXCEPTIONS instead of exceptions_via_longjmp.
+
+2001-05-12 Richard Henderson <rth@redhat.com>
+
+ 2001-03-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+ * mkconfig.sh (DEFINES): Handle entries with '='.
+
+ 2001-03-22 Zack Weinberg <zackw@stanford.edu>
+ * mkconfig.sh: Use a subshell with redirected stdout,
+ instead of closing stdout and confusing commands that run
+ afterward. Throw away output of cmp.
+
+ 2001-03-22 Richard Henderson <rth@redhat.com>
+ * mkconfig.sh: Include insn-flags.h.
+ * Makefile.in (CONFIG_H): Include insn-flags.h.
+ (lots of objects): Remove insn-codes.h and insn-flags.h.
+
+ * alias.c, bb-reorder.c, calls.c, do-loop.c, flow.c, haifa-sched.c,
+ integrate.c, jump.c, loop.c, predict.c, profile.c, reg-stack.c,
+ regmove.c, reorg.c, a29k/a29k.c, alpha/alpha.c, arc/arc.c, arm/arm.c,
+ avr/avr.c, clipper/clipper.c, convex/convex.c, d30v/d30v.c,
+ dsp16xx/dsp16xx.c, fr30/fr30.c, h8300/h8300.c, i370/i370.c,
+ i386/i386.c, i860/i860.c, ia64/ia64.c, m32r/m32r.c, m68hc11/m68hc11.c,
+ m68k/m68k.c, m88k/m88k.c, mcore/mcore.c, mn10200/mn10200.c,
+ mn10300/mn10300.c, ns32k/ns32k.c, pa/pa.c, pdp11/pdp11.c,
+ pj/pj.c, romp/romp.c, rs6000/rs6000.c, sh/sh.c, sparc/sparc.c,
+ v850/v850.c, vax/vax.c:
+ Don't include insn-flags.h.
+
+ * diagnostic.c, expr.h, reload.c, toplev.c:
+ Don't include insn-codes.h.
+
+ * builtins.c, combine.c, except.c, explow.c, expmed.c, expr.c,
+ final.c, function.c, optabs.c, recog.c, reload1.c, stmt.c,
+ c4x/c4x.c, i960/i960.c, mips/mips.c:
+ Don't include insn-codes.h or insn-flags.h.
+
+ * genemit.c, genopinit.c, genoutput.c: Don't include insn-codes.h
+ or insn-flags.h in the generated code.
+ * genflags.c (gen_proto): Use "struct rtx_def *" instead of "rtx".
+ (main): Forward declare struct rtx_def.
+
+ 2001-03-09 Zack Weinberg <zackw@stanford.edu>:
+ * configure.in: Prune nonexistent files from build_xm_file,
+ xm_file, and host_xm_file lists. Warn unless they're
+ $cpu/xm-$cpu.h.
+ Don't generate *config.h here.
+ AC_SUBST all variables needed to generate *config.h.
+ * mkconfig.sh: New helper script, from code removed from
+ configure.in.
+ * Makefile.in: Substitute in variables needed to generate *config.h.
+ Stop lying about the dependencies contained in CONFIG_H and
+ GCONFIG_H.
+ (HCONFIG_H, TCONFIG_H, TM_P_H): New variables.
+ (config.h, hconfig.h, tconfig.h, tm_p.h, cs-config.h,
+ cs-hconfig.h, cs-tconfig.h, cs-tm_p.h): New rules.
+ (all .o): Add dependencies on $(HCONFIG_H), $(TCONFIG_H),
+ $(TM_P_H), etc. as appropriate.
+
+2001-05-12 Richard Henderson <rth@redhat.com>
+
+ EH merge from mainline, parts 1 - 4.
+ * gthr-single.h (UNUSED): New. Distinguish between how C
+ and C++ mark unused function arguments. Use throughout.
+
+ * bb-reorder.c, dwarf2out.c, except.c, except.h, flow.c,
+ jump.c, toplev.c:
+ Rename asynchronous_exceptions to flag_non_call_exceptions.
+ * except.h (flag_non_call_exceptions): Move ...
+ * flags.h: ... here.
+
+ * rtl.h (LCT_NORETURN): New.
+ * calls.c (emit_library_call_value_1): Handle it.
+
+ * function.c (expand_function_start): Set DECL_REGISTER on
+ a pseudo used for DECL_RESULT.
+
+2001-05-12 Neil Booth <neil@cat.daikokuya.demon.co.uk>
+
+ * cpplex.c (_cpp_lex_token): Ensure we warn at most once
+ about files not ending in newlines.
+
+2001-05-12 Alexandre Oliva <aoliva@redhat.com>
+
+ * defaults.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define.
+ * tm.texi (TARGET_PRTMEMFUNC_VBIT_LOCATION): Document.
+
+2001-05-11 Richard Henderson <rth@redhat.com>
+
+ * config/ia64/ia64.c (group_barrier_needed_p): Don't allow
+ calls and jumps to be bundled together.
+ (ia64_reorg): Emit a break after a noreturn call that ends
+ a function.
+ * config/ia64/ia64.md (break_f): New.
+
+2001-05-11 Jakub Jelinek <jakub@redhat.com>
+
+ * regmove.c (regmove_optimize): Suppress the optimization for
+ unchanging destination register. Add comment above function.
+
+2001-05-11 Mark Mitchell <mark@codesourcery.com>
+
+ * loop.h (struct movables): Remove `num'.
+ * loop.c (scan_loop): Don't set it. Use count_insns_in_loop.
+ Adjust call to strength_reduce.
+ (num_unmoved_movables): New function.
+ (move_movables): Don't set movables->num.
+ (strength_reduce): Compute the number of instructions in the loop
+ here, rather than in the caller.
+ (check_dbra_loop): Always clear reversible_mem_store if there
+ are any memory sets.
+ (loop_regs_scan): Don't count instructions here.
+ (count_insn_in_loop): New function.
+
+ * optabs.c (emit_libcall_block): Don't mark calls as CONST_CALL_P.
+
+2001-05-10 David Edelsohn <edelsohn@gnu.org>
+
+ * expr.c (emit_push_insn): Convert PUSH_ROUNDING argument to
+ bytes. Reported by Kazu Hirata <kazu@hxi.com>.
+
+Thu May 10 18:23:11 2001 Jeffrey A Law (law@cygnus.com)
+
+ * cse.c (cse_insn): Mostly remove first hunk of code which collapsed
+ a computed jump into an unconditional jump.
+ In second hunk of code for collapsing computed and conditional jumps
+ into unconditional jumps, reemit the jump in additional cases.
+
+2001-05-10 David Edelsohn <edelsohn@gnu.org>
+
+ * expr.c (emit_group_load): extract_bit_field requires a REG or
+ MEM as an argument.
+
+2001-05-10 Toon Moene <toon@moene.indiv.nluug.nl>
+
+ * dwarf2out.c (mem_loc_descriptor): Do not pass constant pool
+ contents for a SYMBOL_REF in case of floating point constants.
+
+2001-05-09 Zack Weinberg <zackw@stanford.edu>
+
+ * cppinit.c (cpp_post_options): Shut off macro expansion if
+ -fpreprocessed.
+ * cpplib.c (_cpp_handle_directive): If -fpreprocessed, accept
+ IN_I directives only if the # is in column 1 and the directive
+ name begins in column 2.
+ * cppmain.c (scan_buffer): Insert a space between # and an
+ identifier, when that identifier is a directive name.
+
+ * tradcpp.c (struct file_buf): Add a pointer to the next entry
+ in the header search path.
+ (enum node_type): Add T_INCLUDE_NEXT.
+ (directive_table): Add entry for include_next.
+ (do_include_next): New function.
+ (process_include): New routine, broken out of do_include.
+ (finclude): Insert 'nhd' argument, to be copied into
+ next_header_dir of the new buffer.
+ (main): Adjust to match.
+ * gsyslimits.h, limity.h: Un-indent #include_next.
+
+2001-05-09 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * objc.texi: Move from ../libobjc/objc-features.texi. Adjust for
+ inclusion as a chapter of the GCC manual.
+ * gcc.texi: Include objc.texi.
+ * fdl.texi: Use @unnumberedsec for the addendum.
+ * Makefile.in ($(srcdir)/gcc.info, gcc.dvi): Update dependencies.
+
+2001-05-07 John David Anglin <dave@hiauly1.hia.nrc.ca>
+
+ * pa.md (interspace_jump): Revise comment.
+ (builtin_longjmp): Block initial setup insns from delay slot of
+ interspace branch.
+ (builtin_setjmp_receiver): New expander to save and restore PIC
+ register.
+
+ * som.h (NM_FLAGS): Remove `-n' sort option. Revise comment.
+
+2001-05-07 Mark Mitchell <mark@codesourcery.com>
+
+ * gcc.texi: Remove references to CHILL.
+ * invoke.texi: Likewise.
+ * install.texi: Likewise.
+
+2001-05-06 Zack Weinberg <zackw@stanford.edu>
+
+ * Makefile.in (tradcpp0): Correct typo in dependency list.
+
+2001-05-06 Andreas Jaeger <aj@suse.de>
+
+ * invoke.texi (Option Summary): Add -momit-leaf-frame-pointer
+ (i386 Options): Document -momit-leaf-frame-pointer.
+
+Sun May 6 10:54:20 2001 Jim Wilson <wilson@redhat.com>
+
+ * dwarf2out.c (output_line_info): Fix typo.
+
+2001-05-05 Richard Henderson <rth@redhat.com>
+
+ * integrate.c (copy_insn_list): Substitute NOTE_EXPECTED_VALUE.
+
+2001-05-05 Stephane Carrez <Stephane.Carrez@worldnet.fr>
+
+ * config/m68hc11/m68hc11.c (m68hc11_gen_movhi): Optimize moves
+ between X and Y by using sequences of xgdx and xgdy.
+
+2001-05-05 Stephane Carrez <Stephane.Carrez@worldnet.fr>
+
+ * config/m68hc11/m68hc11.md ("*logicalsi3_silshr16"): Use '?' instead
+ of '!' for the 'D' alternative ('!' is too strong).
+ ("*logicalsi3_silshl16"): Likewise.
+ ("movstricthi"): Accept 'A' when 'd' constraint, remove spurious '+'.
+ ("movstrictsi"): Remove spurious '+'.
+ ("movstrictqi"): Don't accept 'A' and remove spurious '+'.
+ ("tstqi_1", "*lshrqi3_const1"): Put 'm' constraint before 'd'.
+ ("subqi3"): Disparage with '!' the 'x' and 'y' registers to avoid
+ a reload to them.
+
+2001-05-04 David Edelsohn <edelsohn@gnu.org>
+
+ * calls.c (store_one_arg): Don't divide align by BITS_PER_UNIT.
+
+2001-05-04 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
+
+ * config/rs6000/rs6000.md (ashldi3 splits): Guard with TARGET_POWERPC64.
+
+2001-05-04 Stephane Carrez <Stephane.Carrez@worldnet.fr>
+
+ * config/m68hc11/m68hc11.md (lshrhi3_const1): Fix shift of
+ soft register, use ror instead of rol.
+
+2001-05-04 Stephane Carrez <Stephane.Carrez@worldnet.fr>
+
+ * config/m68hc11/m68hc11.c (m68hc11_check_z_replacement): Take
+ into account pre/post increment decrement for 68HC12.
+ Fix other problems in replacement and fix call to reg_mentioned_p.
+
+2001-05-04 Stephane Carrez <Stephane.Carrez@worldnet.fr>
+
+ * config/m68hc11/larith.asm (L_regs_frame): New for _.frame.
+ Put the soft registers in bss for 68HC12.
+ (L_regs_d3_4): New for _.d3 and _.d4.
+ (L_regs_d5_6): Likewise.
+ (L_regs_d1_2): Likewise.
+ * config/m68hc11/t-m68hc11-gas (T_CPPFLAGS): Compile new parts.
+
+2001-05-04 Stephane Carrez <Stephane.Carrez@worldnet.fr>
+
+ * config/m68hc11/m68hc11.h (CPP_SPEC): Pass -D__HAVE_SHORT_DOUBLE__
+ to the pre-processor when -fshort-double is specified.
+ * config/m68hc11/m68hc11.2 (CPP_SPEC): Likewise.
+
+2001-05-04 Stephane Carrez <Stephane.Carrez@worldnet.fr>
+
+ * config/m68hc11/larith.asm (divmodhi4): Empty for 68HC12.
+ (__mulsi3): Rewrite for 68HC12.
+ * config/m68hc11/m68hc11.md (divmodhi4): Use idivs for 68HC12.
+ Mark 'x' constraint with earlyclobber to prevent a
+ RELOAD_FOR_OTHER_ADDRESS to go in it.
+ (mulhi3_m68hc12): New pattern.
+ (mulhi3_m68hc11): Rename of mulhi3.
+ (mulhi3): New expand for 68HC12 optimisation.
+ (umulhisi3, mulhisi3): New patterns for 68HC12.
+
+2001-05-04 Stephane Carrez <Stephane.Carrez@worldnet.fr>
+
+ * config/m68hc11/m68hc11.md (*tbne, *tbeq): New patterns for 68HC12.
+ (extendqisi2, extendqihi2, extendhisi2): Use sex for 68HC12.
+ (uminqi3, umaxqi3, uminhi3, umaxhi3): New pattern for 68HC12.
+
+2001-05-04 Stephane Carrez <Stephane.Carrez@worldnet.fr>
+
+ * config/m68hc11/m68hc11.h (CONST_COSTS): Make the cost of
+ constants cheap after reload.
+ * config/m68hc11/m68hc11.c (m68hc11_shift_cost): Shift by 16 and 32
+ are cheap.
+ (m68hc11_rtx_costs): Cost of multiplication by 65536 is expensive
+ so that gcc prefers a shift by 16.
+ (m6811_cost, m6812_cost): Make the shift cheap compared to an add.
+
+2001-05-04 Mark Elbrecht <snowball3@bigfoot.com>
+
+ * config/i386/djgpp.h (CPP_PREDEFINES): Define __GO32__.
+ (CPP_SPEC): Conditionally define MSDOS and GO32.
+ (SUBTARGET_SWITCHES): Ignore -mbnu210 and -mno-bnu210.
+ (SUBTARGET_OVERRIDE_OPTIONS): Warn that -mbnu210 and -mno-bnu210 are
+ ignored.
+ (SUPPORTS_WEAK, SUPPORTS_ONE_ONLY): Remove.
+
+2001-05-04 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * hash.c (hash_lookup): Likewise.
+
+ * hash.h (hash_lookup): Likewise.
+
+ * tlink.c (symbol_hash_lookup, demangled_hash_lookup): Likewise.
+
+2001-05-03 David O'Brien <obrien@FreeBSD.org>
+
+ * config/t-freebsd: Don't install "assert.h" in gcc. Compile
+ crtbeginS.o and crtendS.o with PIC.
+
+2001-05-03 Stephane Carrez <Stephane.Carrez@worldnet.fr>
+
+ * config/m68hc11/m68hc11.md ("bitcmpqi"): New pattern for bitb
+ instruction.
+ ("bitcmpqi2"): New pattern for bit-extract and test.
+ ("bitcmphi"): New pattern for bitb/bita instructions.
+
+2001-05-03 Stephane Carrez <Stephane.Carrez@worldnet.fr>
+
+ * config/m68hc11/m68hc11.h (STATIC_CHAIN_REGNUM): Use soft z register
+ instead of _.d1.
+ (INITIALIZE_TRAMPOLINE): Call it.
+ (TRAMPOLINE_SIZE): Define according to 68HC11/68HC12.
+ (TRAMPOLINE_TEMPLATE): Remove.
+ * config/m68hc11/m68hc11.c (m68hc11_initialize_trampoline): New.
+ * config/m68hc11/m68hc11-protos.h (m68hc11_initialize_trampoline):
+ Declare.
+
+2001-05-03 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * gccbug.in: Use a temporary directory when the mktemp command is
+ not available.
+
+2001-05-03 David Edelsohn <edelsohn@gnu.org>
+
+ * config/rs6000/aix51.h: Remove duplicate header file inclusion as
+ reported by David O'Brien <obrien@FreeBSD.org>.
+
+2001-05-03 Mark Mitchell <mark@codesourcery.com>
+
+ * integrate.h (struct inline_remap): Add leaf_reg_map table.
+ * integrate.c (expand_inline_function): Use xcalloc to allocate
+ memory.
+ (copy_rtx_and_substitute): Use the leaf_reg_map for leaf
+ registers.
+
+2001-05-02 Geoff Keating <geoffk@redhat.com>
+
+ * config/rs6000/rs6000.md (ctrsi_internal1, ctrsi_internal2,
+ ctrsi_internal3, ctrsi_internal4, ctrsi_internal5,
+ ctrsi_internal6, ctrdi_internal1, ctrdi_internal2,
+ ctrdi_internal3, ctrdi_internal4, ctrdi_internal5,
+ ctrdi_internal6): In the short-branch case, this insn is only 4
+ bytes long. Reported by Reza Yazdani <reza@apple.com>.
+
+ * config/rs6000/rs6000.c (rs6000_float_const): Remove warning.
+ (setup_incoming_varargs): Remove warning.
+
+ * config/rs6000/rs6000.c (validate_condition_mode): When
+ flag_fast_math, allow floating-point conditionals to be reversed.
+ (rs6000_generate_compare): When flag_fast_math, don't generate
+ cror operations for FP conditionals.
+
+2001-05-02 Dale Johannesen <dalej@apple.com>
+
+ * config/rs6000/rs6000.h (RS6000_ARG_SIZE): Remove unused NAMED
+ parameter.
+ (STRICT_ARGUMENT_NAMING): Define.
+ * config/rs6000/rs6000.c (function_arg_advance, function_arg,
+ function_arg_partial_nregs, setup_incoming_varargs): Remove
+ args logic which depends on "named" now that STRICT_ARGUMENT_NAMING
+ is defined.
+
+Wed May 2 13:09:36 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
+
+ * function.c (fixup_var_regs_1, case SUBREG): Use promoted mode
+ for replacement.
+
+ * expr.c (store_field): Do nothing except elaborate side-effects if
+ zero-bit field.
+
+2001-05-02 Nick Clifton <nickc@cambridge.redhat.com>
+
+ * dwarf2out.c (mem_loc_descriptor): If a SYMBOL_REF is in the
+ constant pool, use the pool's SYMBOL_REF instead.
+
+2001-05-01 Per Bothner <per@bothner.com>
+
+ * expr.c (expand_expr): When compiling LABELED_BLOCK_EXPR,
+ call do_pending_stack_adjust before emiting label.
+
+2001-05-01 Mark Mitchell <mark@codesourcery.com>
+
+ * extend.texi: Fix typo.
+
+2001-05-01 Stan Shebs <shebs@apple.com>
+
+ * objc/objc-act.c (build_module_descriptor): Clear DECL_CONTEXT
+ of UOBJC_MODULES_decl.
+ (generate_strings): Clear DECL_CONTEXT of new decl nodes.
+ (generate_descriptor_table): Ditto.
+ (generate_protocols): Ditto.
+ (generate_protocol_list): Ditto.
+ (generate_classref_translation_entry): Ditto.
+
+2001-05-01 Jeffrey Oldham <oldham@codesourcery.com>
+
+ * ChangeLog (2001-02-21): Remove erroneous entry.
+ * gcc.c (cc1_options): Add "-param".
+ (DEFAULT_WORD_SWITCH_TAKES_ARG): Likewise.
+ (option_map): Likewise.
+ (display_help): Add "--param" to 'other' options.
+ * invoke.texi (Optimize Options): Add documentation for `--param
+ max-delay-slot-insn-search' and `--param
+ max-delay-slot-live-search' and reorder --param section.
+ * params.def: Modify initial comment.
+ * params.h (param_info): Add `help' member.
+ * toplev.c (lang_independent_params): Include `help' description.
+ (display_help): Print --param parameters.
+ (independent_decode_option): Fix typographical error.
+
+2001-05-01 Nathan Sidwell <nathan@codesourcery.com>
+
+ * c-tree.texi (USING_STMT): Document.
+
+2001-04-30 Mark Mitchell <mark@codesourcery.com>
+ Richard Henderson <rth@redhat.com>
+
+ * extend.texi: Improve documentation of volatile asms.
+
+2001-04-30 Mark Mitchell <mark@codesourcery.com>
+
+ * c-tree.texi: Fix thinko.
+ * gcc.texi: Likewise.
+
+2001-04-30 Richard Henderson <rth@redhat.com>
+
+ * c-common.c (c_promoting_integer_type_p): New function, from the
+ corpse of old macro. Properly promote too-small enumerations and
+ booleans. Adjust all callers.
+ * c-common.h (C_PROMOTING_INTEGER_TYPE_P): Remove.
+ (c_promoting_integer_type_p): Declare.
+ * c-decl.c: Adjust C_PROMOTING_INTEGER_TYPE_P invocations.
+ * c-typeck.c: Likewise.
+ (default_conversion): Remove now redundant boolean check.
+
+2001-04-30 Jan Hubicka <jh@suse.cz>
+ Richard Henderson <rth@redhat.com>
+
+ * regmove.c (try_apply_stack_adjustment): Remove now redundant
+ sanity checks.
+ (combine_stack_adjustments_for_block): Don't combine stack
+ allocation followed by deallocations. Handle grow-up stacks.
+
+2001-04-30 Mark Mitchell <mark@codesourcery.com>
+
+ * fdl.texi: New file.
+ * c-tree.texi: Use the GFDL.
+ * gcc.texi: Likewise.
+
+2001-04-30 Stan Shebs <shebs@apple.com>
+
+ * invoke.texi: Add a section documenting Objective-C options.
+
+2001-04-30 Mark Mitchell <mark@codesourcery.com>
+
+ * regmove.c (record_stack_memrefs): Catch all references to the
+ stack pointer.
+
+2001-04-30 John David Anglin <dave@hiauly1.hia.nrc.ca>
+
+ * pa.c (hppa_init_pic_save): Update last_parm_insn after emitting
+ pic save insn.
+
+2001-04-30 Mark Mitchell <mark@codesourcery.com>
+
+ * extend.texi (extended asm): Fix typo.
+
+Sat Apr 28 10:32:26 2001 Jeffrey A Law (law@cygnus.com)
+
+ * flow.c (propagate_block_delete_insn): Handle deletion of ADDR_VEC
+ and ADDR_DIFF_VEC insns when the proceeding CODE_LABEL was put
+ into the constant pool.
+ * jump.c (jump_optimize_1): Remove barrier successors after all
+ the LABEL_NUSES counds have been computed.
+ (delete_barrier_successors): When deleting a tablejump insn, also
+ delete the jump table it uses.
+ * varasm.c (force_const_mem): Set LABEL_PRESERVE_P when forcing a
+ label into memory.
+
+2001-04-28 Andreas Jaeger <aj@suse.de>
+
+ * invoke.texi: Use XX-bit instead of XXbit or XX bit where
+ appropriate.
+ * extend.texi: Likewise.
+
+2001-04-28 Andreas Jaeger <aj@suse.de>
+
+ * md.texi: Use XX-bit instead of XXbit or XX bit where
+ appropriate.
+
+2001-04-28 Andreas Jaeger <aj@suse.de>
+ Richard Henderson <rth@redhat.com>
+
+ * md.texi (Machine Constraints): Fix description of "A" for
+ i386.
+
+2001-04-27 Jeffrey Oldham <oldham@codesourcery.com>
+
+ * collect2.c (main): Add `-L' case to remove duplicate entries.
+ (is_in_args): New function to check for a duplicate argument.
+ * defaults.h (LINK_ELIMINATE_DUPLICATE_LDIRECTORIES): New macro.
+ * tm.texi (LINK_ELIMINATE_DUPLICATE_LDIRECTORIES): New documentation.
+ * config/mips/iris6.h (LINK_ELIMINATE_DUPLICATE_LDIRECTORIES):
+ Define to be nonzero.
+
+Fri Apr 27 10:41:06 2001 Jeffrey A Law (law@cygnus.com)
+
+ * tm.texi (TARGET_MEM_FUNCTIONS): Update text.
+
+2001-04-26 Geoffrey Keating <geoffk@redhat.com>
+
+ * config/sparc/sparc.md (movsf_no_f_insn): Add more alternatives
+ common to other movsf patterns. Move up so that in future
+ people who change the other patterns will change it too.
+ (movsf_lo_sum): Allow even for soft-float; add appropriate
+ constraints.
+ (movsf_high): Likewise.
+ (movsf_high+1): Allow even for soft-float.
+
+2001-04-26 Mark Mitchell <mark@codesourcery.com>
+
+ * invoke.texi: Document more C++ command-line options.
+
+2001-04-26 H.J. Lu (hjl@gnu.org)
+
+ * config.gcc (mips*-*-linux*): Add elfos.h to tm_file.
+
+ * config/mips/ecoff.h (STARTFILE_SPEC): Undefine before
+ define.
+ * config/mips/elf64.h (MAX_OFILE_ALIGNMENT): Likewise.
+ (ASM_OUTPUT_SECTION_NAME): Likewise.
+ (ASM_WEAKEN_LABEL): Likewise.
+ (UNIQUE_SECTION): Likewise.
+ (ASM_OUTPUT_CONSTRUCTOR): Likewise.
+ (ASM_OUTPUT_DESTRUCTOR): Likewise.
+ * config/mips/elf.h (MAX_OFILE_ALIGNMENT): Likewise.
+ (ASM_OUTPUT_SECTION_NAME): Likewise.
+ (ASM_WEAKEN_LABEL): Likewise.
+ (UNIQUE_SECTION): Likewise.
+ (ASM_OUTPUT_CONSTRUCTOR): Likewise.
+ (ASM_OUTPUT_DESTRUCTOR): Likewise.
+ * config/mips/linux.h (HANDLE_SYSV_PRAGMA): Likewise.
+ * config/mips/mips.h (DBX_CONTIN_LENGTH): Likewise.
+ (ASM_FILE_START): Likewise.
+ (ASM_OUTPUT_SOURCE_LINE): Likewise.
+ (ASM_DECLARE_OBJECT_NAME): Likewise.
+ (ASM_FILE_END): Likewise.
+ (ASM_DECLARE_FUNCTION_NAME): Likewise.
+ (ASM_OUTPUT_INTERNAL_LABEL): Likewise.
+ (ASM_GENERATE_INTERNAL_LABEL): Likewise.
+ (ASM_OUTPUT_CASE_LABEL): Likewise.
+ (ASM_OUTPUT_SKIP): Likewise.
+ (ASM_OUTPUT_ASCII): Likewise.
+ (ASM_OUTPUT_IDENT): Likewise.
+ (READONLY_DATA_SECTION): Likewise.
+ (EXTRA_SECTIONS): Likewise.
+ (EXTRA_SECTION_FUNCTIONS): Likewise.
+ (SELECT_RTX_SECTION): Likewise.
+ (SELECT_SECTION): Likewise.
+
+ * config/mips/linux.h (INVOKE__main): Undefine.
+ (CTOR_LIST_BEGIN): Likewise.
+ (CTOR_LIST_END): Likewise.
+ (DTOR_LIST_BEGIN): Likewise.
+ (DTOR_LIST_END): Likewise.
+ (SET_ASM_OP): Defined it to ".dummy".
+ (ASM_OUTPUT_DEF): Defined.
+ (ASM_OUTPUT_DEFINE_LABEL_DIFFERENCE_SYMBOL): Defined.
+
+2001-04-26 Nathan Sidwell <nathan@codesourcery.com>
+
+ * c-lex.c (c_lex): Remove # from %o diagnostic formatting.
+
+2001-04-26 Jakub Jelinek <jakub@redhat.com>
+
+ * config/i386/i386.h (CC1_CPU_SPEC): Fix deprecation warnings for
+ -m386 and -m486.
+
+2001-04-26 Alexandre Oliva <aoliva@redhat.com>
+
+ * configure.in (configargs.h): Define thread_model.
+ * configure: Rebuilt.
+ * gcc.c (main): Print it with -v.
+
+2001-04-25 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * invoke.texi: Document -Wmissing-braces, -dumpspecs,
+ -dumpmachine, -dumpversion, -fmem-report and -ftime-report.
+ * gcc.1: Regenerate.
+
+2001-04-25 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * dwarfout.c (is_pseudo_reg, type_main_variant, is_tagged_type,
+ is_redundant_typedef): Use static inline instead of inline static.
+
+Wed Apr 25 18:21:01 2001 Christopher Faylor <cgf@cygnus.com>
+
+ * config/i386/cygwin.h: Move W32API search to LINK_SPEC to ensure that
+ this directory is always searched.
+
+2001-04-25 Jason Merrill <jason_merrill@redhat.com>
+
+ * loop.c (try_swap_copy_prop): Go back to checking insn.
+
+2001-04-25 Jakub Jelinek <jakub@redhat.com>
+
+ * config/i386/i386.c (ix86_expand_int_movcc): If overlap between
+ out and comparison sequence has been detected, put result into
+ proper temporary pseudo.
+
+2001-04-24 Mark Mitchell <mark@codesourcery.com>
+
+ * dwarf2out.c (dwarf2out_finish): Forcibly return to the data
+ section after emitting information.
+
+2001-04-24 Zack Weinberg <zackw@stanford.edu>
+
+ * Makefile.in (LIB2FUNCS): Remove _varargs and __dummy.
+ * libgcc-std.ver: Remove __builtin_saveregs, __dummy, and __empty.
+ * libgcc2.c: Remove __dummy and __empty functions, and all
+ code for __builtin_saveregs.
+ * libgcc2.h: Don't prototype __builtin_saveregs, __dummy, or __empty.
+ * config/i860/varargs.asm: New file - preserve i860 __builtin_saveregs
+ for future reference.
+
+2001-04-23 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * c-convert.c (convert): When converting to a BOOLEAN_TYPE, avoid
+ passing nested NOP_EXPRs to fold.
+
+2001-04-23 Mark Mitchell <mark@codesourcery.com>
+
+ * dwarf2out.c (rtl_for_decl_location): Add comments. Abort
+ if the decl is abstract.
+ (add_bound_info): Don't try to get the location of an abstract
+ declaration.
+
+2001-04-22 Mark Mitchell <mark@codesourcery.com>
+
+ * loop.c (loop_delete_insns): Add prototype.
+
+2001-04-21 Mark Mitchell <mark@codesourcery.com>
+
+ * flow.c (proagate_one_insn): Remove useless assignment.
+ * jump.c (delete_insn): Tidy.
+ * loop.c (try_copy_prop): When deleting an instruction with a
+ REG_RETVAL note, delete the entire libcall sequence.
+ (loop_delete_insns): New function.
+ * unroll.c (initial_reg_note_copy): Copy INSN_LIST notes, even if
+ we're not substituting into them yet.
+
+2001-04-21 Kazu Hirata <kazu@hxi.com>
+
+ * config/h8300/h8300.c (general_operand_src): Fix a comment typo.
+
+ * config/sparc/sparc.c (sparc_flat_eligible_for_epilogue_delay):
+ Fix a comment typo.
+ * config/i960/i960.c (signed_arith_operand): Likewise.
+
+ * calls.c (expand_call): Fix a comment typo.
+
+Fri Apr 20 12:22:15 2001 Jeffrey A Law (law@cygnus.com)
+
+ * config/pa/som.h (NM_FLAGS): Define.
+
+2001-04-20 Bernd Schmidt <bernds@redhat.com>
+
+ * ia64.c (ia64_flag_schedule_insns2): New variable.
+ (ia64_override_options): Initialize it. Clear
+ flag_schedule_insns_after_reload.
+ (ia64_reorg): Only do scheduling if ia64_flag_schedule_insns2.
+
+Thu Apr 19 19:12:57 2001 Jeffrey A Law (law@cygnus.com)
+
+ * config/pa/pa-linux.h (CPLUSPLUS_CPP_SPEC): Undefine.
+ * config/pa/pa.h (CPLUSPLuS_CPP_SPEC): Define.
+
+ * config/pa/som.h (ASM_OUTPUT_FUNCTION_PREFIX): Truncate subspace
+ name at 32 total characters.
+ (ASM_OUTPUT_SECTION_NAME): Similarly. Also, only support placing
+ functions in named sections -- data items can still go into unique
+ sections, but they have normal names (ie $LIT$ and $DATA$).
+
+ * config/pa/som.h (SUPPORTS_INIT_PRIORITY): SOM does not support
+ INIT_PRIORITY.
+
+2001-04-19 Mark Mitchell <mark@codesourcery.com>
+
+ * toplev.h (struct lang_hooks): Allow decode_option to indicate
+ that language-independent processing should not be done.
+ * toplev.c (main): Adjust accordingly.
+
+ * rtl.texi (jump_insn): Expand on JUMP_LABEL documentation.
+ * loop.c (load_mems): Handle a NULL JUMP_LABEL for a JUMP_INSN.
+
+ * mips.md (reload_outputdi): Require that operand0 be a
+ general_operand.
+
+2001-04-19 Jakub Jelinek <jakub@redhat.com>
+
+ * invoke.texi (-Wshadow): Clarify.
+
+2001-04-18 Mark Mitchell <mark@codesourcery.com>
+
+ * loop.c (load_mems): Examine all the instructions in the loop
+ before concluding that all jumps branch to the first instruction
+ after the loop.
+
+Wed Apr 18 20:32:03 2001 Christopher Faylor <cgf@cygnus.com>
+
+ * config/i386/xm-cygwin.h (CPP_SPEC): Fix typo.
+
+2001-04-18 Jakub Jelinek <jakub@redhat.com>
+
+ * cpp.texi (-Wwhite-space): Remove.
+ (-Wall): -Wall does not imply -Wwhite-space.
+
+2001-04-17 Zack Weinberg <zackw@stanford.edu>
+
+ * dbxout.c (dbxout_init): If DBX_OUTPUT_GCC_MARKER is defined,
+ use it instead of blindly generating a .stabs.
+ * xcoffout.h: Define DBX_OUTPUT_GCC_MARKER so we put the type
+ in the right place.
+ * xcoffout.c: Don't bother defining default for N_CATCH.
+ (UNKNOWN_STAB): Use internal_error.
+ (stab_to_sclass): Remove now-unnecessary aborts.
+ Remove #if 0'ed case N_BROWS. Add #ifdef N_OPT block.
+
+Tue Apr 17 21:39:12 2001 Jeffrey A Law (law@cygnus.com)
+
+ * jump.c (mark_all_labels): Canonicalize the tail recursion
+ label attached to CALL_PLACEHOLDER insns.
+
+2001-04-17 Loren J. Rittle <ljrittle@acm.org>
+
+ * dbxout.c (N_OPT): Define if not available from <stab.h>
+
+2001-04-17 John David Anglin <dave@hiauly1.hia.nrc.ca>
+
+ * vax.h (PROMOTE_PROTOTYPES): Define for compatibility with system
+ libraries and native K&R compilers.
+
+2001-04-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * c-typeck.c (convert_arguments): Don't check for width changes
+ with -Wtraditional.
+
+ * invoke.texi (-Wtraditional): Update documentation.
+
+2001-04-16 Zack Weinberg <zackw@stanford.edu>
+
+ * toplev.c (output_lang_identify): Delete.
+ (compile_file): Don't call ASM_IDENTIFY_GCC or ASM_IDENTIFY_LANGUAGE.
+ Don't generate gcc2_compiled. label. Don't emit a nop if profiling.
+ If IDENT_ASM_OP is defined, emit an .ident "GCC (GNU) <version>"
+ after calling ASM_FILE_END.
+
+ * dbxout.c (dbxout_init): Don't call ASM_IDENTIFY_GCC_AFTER_SOURCE.
+ Instead, unconditionally emit an N_OPT stab with string equal
+ to STABS_GCC_MARKER, which defaults to "gcc2_compiled."
+
+ * defaults.h: Don't provide default for ASM_IDENTIFY_LANGUAGE.
+
+ * config/dbxelf.h, config/freebsd.h, config/nextstep.h,
+ config/psos.h, config/ptx4.h, config/1750a/1750a.h,
+ config/alpha/alpha.h, config/alpha/elf.h, config/arc/arc.h,
+ config/arm/aof.h, config/arm/coff.h, config/arm/elf.h,
+ config/arm/linux-elf.h, config/avr/avr.h, config/d30v/d30v.h,
+ config/dsp16xx/dsp16xx.h, config/h8300/h8300.h,
+ config/i370/i370.h, config/i386/beos-elf.h,
+ config/i386/osf1elf.h, config/i386/osfrose.h,
+ config/ia64/sysv4.h, config/m68k/3b1.h, config/m68k/auxgas.h,
+ config/m68k/crds.h, config/m68k/hp320.h, config/m68k/m68kv4.h,
+ config/m68k/mot3300.h, config/m68k/news.h, config/m68k/sgs.h,
+ config/m68k/tower-as.h, config/mcore/mcore-elf.h,
+ config/mips/iris6.h, config/mips/osfrose.h,
+ config/mips/sni-svr4.h, config/pa/som.h, config/pdp11/pdp11.h,
+ config/sparc/sp64-elf.h:
+ Delete definitions of any or all of: ASM_IDENTIFY_GCC,
+ ASM_IDENTIFY_GCC_AFTER_SOURCE, and ASM_IDENTIFY_LANGUAGE.
+
+ * config/elfos.h, config/freebsd.h, config/linux.h,
+ config/alpha/elf.h, config/arm/linux-elf.h, config/i386/i386elf.h,
+ config/i386/ptx4-i.h, config/mips/gnu.h, config/mips/linux.h,
+ config/sparc/linux.h, config/sparc/linux64.h: Delete definitions
+ of ASM_FILE_START which merely emit a .version directive. Delete
+ definitions of ASM_FILE_END which merely emit an .ident directive.
+
+ * config/avr/avr.h, config/vax/vax.h: Delete definition of
+ ASM_IDENTIFY_GCC and move part of its logic into
+ ASM_FILE_START.
+
+ * config/i386/att.h, config/i386/gas.h, config/i386/linux.h,
+ config/sparc/linux-aout.h: Don't emit .version directive in
+ ASM_FILE_START.
+
+ * config/i386/dgux.c, config/m88k/m88k.c, config/sh/sh.c
+ (output_file_start): Correct comment.
+
+ * config/i386/osfrose.h: Don't emit trailing .ident directive.
+ * config/m68k/mot3300.h: Override STABS_GCC_MARKER to "gcc2_compiled%"
+ to match gdb.
+ * config/pa/lib2funcs.asm: Delete gcc_compiled. label.
+ * config/rs6000/aix.h: Correct comment.
+
+ * config/i386/i386afe.h: Delete.
+ * config.gcc: Remove references to i386afe.h.
+
+ * tm.texi: Delete documentation of ASM_IDENTIFY_GCC. The
+ other macros deleted by this patch were undocumented.
+
+Mon Apr 16 08:02:14 2001 Jeffrey A Law (law@cygnus.com)
+
+ * pa.md (reload_outdi): Operand 0 must be a non hard register.
+
+ * pa.c (secondary_reload_class): SAR<->FP copies require a
+ secondary register.
+
+ * install.texi (mips-mips-bsd): Update list of functions
+ required to include memmove.
+ * tm.texi (TARGET_MEM_FUNCTIONS): Update list of implicitly
+ used functions to include memmove.
+
+2001-04-15 Mark Mitchell <mark@codesourcery.com>
+
+ * c-dump.c (dequeue_and_dump): Don't look at DECL_ASSEMBLER_NAME
+ if it is not set.
+
+2001-04-15 Jim Wilson <wilson@redhat.com>
+
+ * function.c (expand_function_end): Handle PARALLEL real_decl_rtl.
+
+2001-04-13 Jim Wilson <wilson@redhat.com>
+
+ * config/ia64/ia64.c (ia64_expand_epilogue): Emit alloc if sibcall_p.
+ (first_instruction): New static variable.
+ (rtx_needs_barrier): Return 1 for alloc.
+ (init_insn_group_barriers): Set first_instruction.
+ (rws_sum): Delete duplicate definition.
+ (group_barrier_needed_p): Return 0 when first_instruction true.
+ (safe_group_barrier_needed_p): Save and restore first_instruction
+ around group_barrier_needed_p call.
+
+Fri Apr 13 21:33:59 2001 Loren J. Rittle <ljrittle@acm.org>
+
+ * expr.h (enum libfunc_index): Add LTI_memmove.
+ (memmove_libfunc): Define macro.
+ * optabs.c (init_optabs): Initialize memmove_libfunc.
+ * expr.c (expand_assignment): Use memmove_libfunc instead of
+ memcpy_libfunc.
+
+2001-04-13 Alan Modra <alan@linuxcare.com.au>
+
+ * pa.h (GO_IF_LEGITIMATE_ADDRESS): Disallow PIC LO_SUM
+ fp mode addresses.
+
+2001-04-13 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
+
+ * Makefile.in (CFLAGS, BOOT_CFLAGS): Partly revert 2000-10-27 patch.
+ (stage1_build): Instead pass down STAGE1_CFLAGS here. Pass down
+ MAKEINFO and MAKEINFOFLAGS too.
+ (stage4_build): Correctly order -B flags.
+
+2001-04-12 Jim Wilson <wilson@redhat.com>
+
+ * config/ia64/ia64.md (extendsfdf2, extendsftf2, extenddftf2): Simplify
+ to just emit an fnorm.
+
+2001-04-12 Mark Mitchell <mark@codesourcery.com>
+
+ * invoke.texi: Document --param max-gcse-memory.
+
+2001-04-12 kaz Kojima <kkojima@rr.iij4u.or.jp>
+
+ * sh.md (builtin_setjmp_receiver): New expander.
+
+2001-04-12 Kelley Cook <kelley.cook@home.com>
+
+ * config-lang.in (lang_dirs): Add in zlib.
+
+2001-04-11 Mark Mitchell <mark@codesourcery.com>
+
+ * dwarf2out.c (modified_type_die): Don't create new types here.
+ * tree.h (get_qualified_type): New function.
+ (build_qualified_type): Adjust comment.
+ * tree.c (get_qualified_type): New function.
+ (build_qualified_type): Use it.
+
+2001-04-11 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * cpp.texi (-Wtraditional): Update description.
+
+ * invoke.texi (-Wtraditional): Likewise.
+
+2001-04-11 Jim Wilson <wilson@redhat.com>
+
+ * config/ia64/ia64.h (FUNCTION_ARG_BOUNDARY): Return 128 if argument
+ requires more than 64 bits of alignment.
+
+2001-04-11 Neil Booth <neil@daikokuya.demon.co.uk>
+
+ * cpplib.c (do_line): Sanity check iff enable checking.
+
+2001-04-11 Mark Mitchell <mark@codesourcery.com>
+
+ * Makefile.in (gcse.o): Depend on params.h.
+ * gcse.c: Include params.h.
+ (gcse_main): Don't do GCSE if doing so will take inordinate
+ amounts of memory.
+ * params.def (PARAM_MAX_GCSE_MEMORY): New parameter.
+ * params.h (MAX_GCSE_MEMORY): New macro.
+
+2001-04-11 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * c-typeck.c (convert_arguments): -Wtraditional now activates
+ -Wconversion warnings, except for changes in signed-ness.
+ Detect complex<->int & int<->complex conversions as well.
+
+ * invoke.texi (-Wtraditional): Document it.
+
+Wed Apr 4 00:28:23 2001 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * sparc/sol2-sld-64.h (STARTFILE_SPEC): Added missing blank.
+
+2001-04-11 Jason Merrill <jason_merrill@redhat.com>
+
+ * collect2.c (is_ctor_dtor): Always use '_' in the file fn names,
+ not '.' or '$'.
+ * tree.c (FILE_FUNCTION_FORMAT): Likewise.
+ * varasm.c (CHKR_PREFIX): Likewise.
+
+2001-04-11 Jakub Jelinek <jakub@redhat.com>
+
+ * cpplex.c (_cpp_lex_token): Only warn if -Wcomment.
+
+2001-04-09 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
+
+ * Makefile.in (LIB2FUNCS_STATIC_EXTRA): New macro.
+ (LIB2ADD_ST): New macro, pass it to mklibgcc.
+ * mklibgcc.in (libgcc2_st_objs): New variable, set it from LIB2ADD_ST.
+ (libgcc_st_objs): New, set from libgcc2_st_objs. Use it for libgcc.a.
+ * config/rs6000/t-ppccomm (LIB2FUNCS_STATIC_EXTRA): New macro.
+
+2001-04-09 Neil Booth <neil@daikokuya.demon.co.uk>
+
+ * configure.in: Add check for lstat.
+ * configure, config.in: Regenerate.
+ * cppinit.c (append_include_chain): Make empty path ".".
+ * cpplib.c (do_line): Don't simplify #line paths.
+ * cppfiles.c (remove_component_p): New function.
+ (find_or_create_entry): Acknowledge stat () errors during
+ path simplification.
+ (handle_missing_header): Don't simplify paths.
+ (_cpp_simplify_pathname): Don't simplify VMS paths. Return
+ the empty path untouched. Don't leave a trailing '/'.
+
+Sun Apr 8 22:50:49 2001 Christopher Faylor <cgf@cygnus.com>
+
+ * config/i386/xm-cygwin.h (GET_ENV_PATH_LIST): Eliminate obsolete
+ function. Remove include of sys/cygwin.h.
+
+Sun Apr 8 22:20:27 2001 Christopher Faylor <cgf@cygnus.com>
+
+ * config/i386/cygwin.h (STARTFILE_SPEC): search */lib/w32api by default.
+ (CPP_SPEC): Always search */include/w32api for header files.
+ (ASM_OUTPUT_SECTION_NAME): Avoid testing NULL DECL.
+ (LINK_SPEC): Add "cyg" to the library search prefixes.
+
+2001-04-08 Philip Blundell <philb@gnu.org>
+
+ * config/arm/arm.h (ASM_OUTPUT_LABELREF): Use asm_fprintf.
+
+2001-04-08 Neil Booth <neil@daikokuya.demon.co.uk>
+
+ * cpperror.c (print_location): Don't special case <stdin>.
+ (_cpp_begin_message): Handle WARNING_SYSHDR the same as
+ WARNING, but we don't check if we're in system headers.
+ * cpphash.h (enum error_type): WARNING_SYSHDR: New.
+ * cpplib.c (do_warning): Warn in system headers.
+ (cpp_push_buffer): Give stdin buffers the name <stdin>.
+
+2001-04-07 Mumit Khan <khan@NanoTech.Wisc.EDU>
+
+ * mbchar.c: Include config.h first.
+
+2001-04-07 Herman A.J. ten Brugge <Haj.Ten.Brugge@net.HCC.nl>
+
+ * c4x.h (HARD_REGNO_NREGS): HCmode mode uses 2 regs not 4.
+
+2001-04-05 Benjamin Kosnik <bkoz@redhat.com>
+
+ * cppdefault.c (GPLUSPLUS_BACKWARD_INCLUDE_DIR): Add.
+ * Makefile.in (-DGPLUSPLUS_BACKWARD_INCLUDE_DIR): Add.
+
+2001-04-05 Bernd Schmidt <bernds@redhat.com>
+
+ * config/ia64/ia64.c (rtx_needs_barrier): PARALLELs can contain
+ ASM_OPERANDS.
+
+2001-04-05 Herman A.J. ten Brugge <Haj.Ten.Brugge@net.HCC.nl>
+
+ * emit-rtl.c (mark_label_nuses) Increment the label uses for
+ all labels present in rtx.
+ (try_split) Call new function for all split insns.
+
+2001-04-05 Neil Booth <neil@daikokuya.demon.co.uk>
+
+ * cppfiles.c (open_file): Fail directories silently, but
+ with an errno of NOENT set.
+ (read_include_file): Move the common exit code to the sole
+ caller. Return an int indicating success or failure. Let
+ open_file handle directories.
+ (stack_include_file): If read_include_file fails,
+ push a "null" buffer.
+
+2001-04-04 Diego Novillo <dnovillo@redhat.com>
+
+ * simplify-rtx.c (simplify_binary_operation): Check for overflow
+ when folding integer division and modulo operations.
+
+2001-04-04 Jakub Jelinek <jakub@redhat.com>
+
+ * gcse.c (delete_null_pointer_checks_1): Add delete_list argument,
+ push insns to delete to it instead of deleting them.
+ (delete_null_pointer_checks): Delete insns from delete_list after
+ all delete_null_pointer_checks_1 passes are done.
+
+2001-04-03 Alexandre Oliva <aoliva@redhat.com>
+
+ * configure.in (target_subdir): Use target_alias, not target.
+ * configure: Rebuilt.
+
+ * config/sh/crtn.asm (init, fini): Restore r15 from r14, not the
+ other way round.
+ * config/sh/crti.asm: Fix typos in comments.
+
+2001-04-03 Alan Modra <alan@linuxcare.com.au>
+
+ * dwarf2out.c (dwarf2out_frame_debug_expr): Move errant HIGH and
+ LO_SUM cases to where they belong.
+
+2001-04-02 Jakub Jelinek <jakub@redhat.com>
+
+ * ifcvt.c (noce_emit_move_insn): New.
+ (noce_try_store_flag, noce_try_store_flag_constants,
+ noce_try_store_flag_inc, noce_try_store_flag_mask,
+ noce_try_cmove, noce_try_cmove_arith): Use it.
+ (noce_process_if_block): Likewise.
+ For STRICT_LOW_PART, take mode from its SUBREG.
+
+2001-04-02 Jakub Jelinek <jakub@redhat.com>
+
+ * fold-const.c (fold): Before optimizing unsigned comparison with
+ 0x7fffffffU, make sure arg0 is integral type.
+
+2001-04-02 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * c-tree.texi: Document representation of wide strings.
+
+2001-03-31 Marek Michalkiewicz <marekm@linux.org.pl>
+
+ * config/avr/libgcc.S (__mulhi3): Correct tests to exit the loop
+ when multiplier or multiplicand is zero.
+
+2001-03-30 Bernd Schmidt <bernds@redhat.com>
+
+ * loop.c (load_mems): When generating a load from a pseudo, update
+ REGNO_LAST_UID.
+
+ * config/ia64/ia64.c (update_set_flags): New function, broken out of
+ rtx_needs_barrier.
+ (set_src_needs_barrier): Likewise.
+ (rtx_needs_barrier): For SET case, use these two functions. Rework
+ PARALLEL case to handle all inputs before all outputs.
+ (emit_insn_group_barriers): Call init_insn_group_barriers only if we
+ saw a label and no stop bit since then.
+ (maybe_rotate, process_epilogue): Add prototypes.
+
+2001-03-28 Jim Wilson <wilson@redhat.com>
+
+ * config/ia64/ia64.md (movtf): Change DImode to TFmode in calls to
+ operand_subword.
+
+2001-03-28 DJ Delorie <dj@redhat.com>
+
+ * Makefile.in (stage1_build): Revert CFLAGS patch.
+
+2001-03-28 John David Anglin <dave@hiauly1.hia.nrc.ca>
+
+ * reload1.c (eliminate_regs): Don't abort on MEM USEs.
+
+2001-03-27 Jim Wilson <wilson@redhat.com>
+
+ * final.c (final_scan_insn, case NOTE_INSN_BASIC_BLOCK): Call
+ IA64_UNWIND_EMIT.
+ * config/ia64/ia64.c (block_num, need_copy_state): New static vars.
+ (process_epilogue): New static function.
+ (process_set): Call process_epilogue instead of emitting .restore
+ directly.
+ (process_for_unwind_directive): Handle NOTE_INSN_BASIC_BLOCK.
+
+ * flow.c (struct reg_cond_life_info): New fields orig_condition
+ and stores.
+ (init_propagate_block_info): Set new fields.
+ (mark_regno_cond_dead): Set and use new fields.
+ (flush_reg_cond_reg_1): Likewise.
+ (and_reg_cond, case AND): Check for redundant AND conditions.
+ (mark_used_reg): Delete unnecessary clears before freeing splay trees.
+ Set new fields.
+
+2001-03-27 Neil Booth <neil@daikokuya.demon.co.uk>
+
+ * cppmacro.c (stringify_arg): Null terminate strings.
+
+2001-03-27 Neil Booth <neil@daikokuya.demon.co.uk>
+
+ * cppfiles.c: Update comments.
+ (struct include_file): Remove "defined" memeber.
+ (find_or_create_entry): Make a copy of the file name, and
+ simplify it.
+ (open_file): Update to ensure we use the simplified filename.
+ (stack_include_file): Don't set search_from.
+ (cpp_included): Don't simplify the path name here.
+ (find_include_file): New prototype. Call search_from to
+ get the start of the "" include chain. Don't simplify the
+ filenames here.
+ (_cpp_execute_include): New prototype. Move diagnostics to
+ do_include_common. Update.
+ (_cpp_pop_file_buffer): Don't set defined.
+ (search_from): New prototype. Use the preprocessor's cwd
+ for files included from the command line.
+ (read_name_map): Don't simplify the pathname here.
+
+ (stack_include_file): Only increase the include
+ count if we actually process the file properly, as opposed
+ to treating it as length zero. Only call read_include_file
+ if not DO_NOT_REREAD. Handle the -H include file output
+ here.
+ (read_include_file): Remove now redundant DO_NOT_REREAD check.
+ (cpp_included, find_include_file): Simplify pathnames after
+ remapping them. If remapping, don't use the remapped file
+ name's buffer as our scratch buffer.
+ (cpp_pop_file_buffer): Replace the multiple include macro
+ only if it isn't yet set.
+ (read_name_map): Simplify remapped names when reading in.
+ (remap_filename): Move code to code path that uses it.
+ (_cpp_simplify_pathname): Return the input pointer.
+
+ (NO_INCLUDE_PATH): New macro.
+ (find_include_file): Decide here which part of the include
+ chain to start the search. Complain about an empty include
+ chain in all cases apart from an abolsute file name.
+ (_cpp_execute_include): Don't choose the search chain here.
+ Don't call handle_missing_include in the case of an empty
+ include chain.
+ (_cpp_compare_file_date): Don't choose the search chain here.
+
+ (destroy_include_file_node): Rename destroy_node.
+ (find_or_create_entry): New function.
+ (open_file, _cpp_fake_include): Use it.
+ (handle_missing_header): New function, broken out of
+ _cpp_execute include. Don't segfault if there is no
+ system or quoted path.
+ (_cpp_execute_include): Use handle_missing_header.
+
+ (INCLUDE_LEN_FUDGE, ENOMEM): Delete.
+ (cpp_included, find_include_file): Update.
+ (search_from): Use lbasename.
+ (_cpp_execute_include): Don't make a null-terminated
+ copy of the filename. Don't use CPP_PREV_BUFFER. Don't call
+ strlen or strcpy; we already know the length.
+ (_cpp_compare_file_date): Similarly.
+
+ * cpphash.h: Update comments.
+ (enum include_type): New.
+ (struct buffer): Delete search from. New search_cached.
+ (_cpp_execute_include): Update prototype.
+ (struct cpp_reader): Delete done_initialising.
+ (_cpp_simplify_pathname): Update prototype.
+ (struct cpp_buffer): Delete actual_dir. New members
+ search_from and dir.
+ (struct cpp_reader): Remove actual_dirs.
+
+ (struct include_file): Update.
+ (stack_include_file): Use search_from.
+ (cpp_included, find_include_file): Update.
+ (cpp_execute_include): Update. ptr->name may not be
+ null terminated. Use the new search_from member variable
+ of cpp_buffer.
+ (_cpp_compare_file_date): Similarly.
+ (search_from): New function, similiar to actual_directory.
+ (actual_directory): Delete.
+ (remap_filename): Update. loc->name may not be null terminated.
+ (struct file_name_list): Rename search_path. Update.
+
+ * cppinit.c (do_includes): Use _cpp_execute_include.
+ (cpp_start_read): Don't set done_initialising.
+ (struct cpp_pending): Update for renamed objects.
+ (append_include_chain, remove_dup_dir, remove_dup_dirs,
+ merge_include_chains, cpp_destroy, cpp_start_read): Similarly.
+
+ * cpplib.c (do_include_common): New function.
+ (do_include, do_include_next, do_import): Use it.
+ (do_include_next): Move the in-main-file diagnostic
+ here from _cpp_execute_include. Behave like #include if
+ we're in the main file.
+ (_cpp_compare_file_date): Make else unconditional.
+ (CPP_PREV_BUFFER): Delete.
+ (glue_header_name): Null-terminate.
+ (do_line): Don't leak memory.
+
+ * cpplex.c (parse_string): Guarantee null-termination.
+ (_cpp_equiv_toklists): Remove.
+
+ * cpplib.h (BT_WEAK): Delete.
+ (struct cpp_options): Update.
+
+ * cppmain.c (cb_ident): Strings are now null-terminated.
+
+ * mkdeps.c (deps_add_default_target): Use lbasename.
+
+2001-03-27 Alan Modra <alan@linuxcare.com.au>
+
+ * c-typeck.c (digest_init): Fold init expression.
+
+ * except.c (eh_regs): Save results of build_pointer_type to a temp
+ as FUNCTION_VALUE macro may evaluate its args multiple times.
+
+2001-03-26 Mark Mitchell <mark@codesourcery.com>
+
+ * c-common.h (DECL_NUM_STMTS): New macro.
+ * c-decl.c (duplicate_decls): Copy DECL_NUM_STMTS, not
+ DECL_FRAME_SIZE.
+ (pushdecl): Likewise.
+ * c-semantics.c (add_stmt): Update DECL_NUM_STMTS.
+ * integrate.c (expand_inline_function): Don't check
+ DECL_FRAME_SIZE.
+ * print-tree.c (print_node): Don't print it.
+ * toplev.c (rest_of_compilation): Don't try to inline when
+ flag_no_inline is on.
+ * tree.h (DECL_FRAME_SIZE): Remove.
+ (tree_decl): Adjust accordingly.
+
+Mon Mar 26 15:59:57 CEST 2001 Jan Hubicka <jh@suse.cz>
+
+ * i386.md (truncdfsf2_3, trunctfsf2_2): Change predicate to memory_operand.
+
+2001-03-26 Jakub Jelinek <jakub@redhat.com>
+
+ * varasm.c (make_decl_rtl): Don't append var_labelno discriminator
+ to variable names where DECL_NAME is different from
+ DECL_ASSEMBLER_NAME.
+
+2001-03-26 Jakub Jelinek <jakub@redhat.com>
+
+ * reg-stack.c (stack_result): Re-add 2001-03-14 changes which were
+ lost during the 2001-03-14 lazy DECL_RTL commit.
+
+2001-03-21 Jason Merrill <jason@redhat.com>
+
+ * collect2.c (is_ctor_dtor): Always use '_' in the file fn names,
+ not '.' or '$'.
+ * tree.c (FILE_FUNCTION_FORMAT): Likewise.
+ * varasm.c (CHKR_PREFIX): Likewise.
+
+2001-03-25 Kazu Hirata <kazu@hxi.com>
+
+ * config/h8300/h8300.md (umodqi3): Output a tab instead of a
+ space.
+ (modqi3): Likewise.
+ (umodhi3): Likewise.
+ (modhi3): Likewise.
+
+2001-03-23 Richard Henderson <rth@redhat.com>
+
+ * config/mips/iris4.h (ASM_OUTPUT_ASCII): Rename local variables
+ to avoid shadowing arguments.
+
+2001-03-23 Jim Wilson <wilson@redhat.com>
+
+ * varasm.c (make_decl_rtl): Add TREE_PUBLIC check to abort test.
+ (assemble_alias): Call make_decl_rtl.
+
+2001-03-23 Bryce McKinlay <bryce@albatross.co.nz>
+
+ * extend.texi: Document the "java_interface" attribute.
+
+2001-03-22 Gordon Sadler <gbsadler1@lcisp.com>
+
+ * Makefile.in (stage1_build): Pass CFLAGS to stage1_build.
+
+2001-03-22 Zack Weinberg <zackw@stanford.edu>
+
+ * gcc.c, objc/lang-specs.h: Add zero initializer for cpp_spec field to
+ all array elements.
+
+2001-03-22 Brad Lucier <lucier@math.purdue.edu>
+
+ * Makefile.in: Have splay-tree.o depend on $(GCONFIG_H).
+
+2001-03-22 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * gcc.texi: Remove more obsolete documentation of bugs and
+ installation problems.
+
+2001-03-21 Kazu Hirata <kazu@hxi.com>
+
+ * config/h8300/h8300.md (movsi_h8300hs): Split the 2nd alternative
+ into two parts.
+
+Wed Mar 21 14:27:11 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
+
+ * cse.c (find_comparison_args): Remove previous change.
+ * ifcvt.c (noce_process_if_block): When moving an insn, remove any
+ REG_EQUAL notes.
+
+ * sdbout.c: #include ggc.h.
+ (sdbout_init): Move to end of file.
+ Call ggc_add_tree_root for anonymous_types.
+ (sdbout_symbol): Use DECL_NAME for local, not DECL_ASSEMBLER_NAME.
+ (sdbout_one_type): Use DECL_NAME for field name.
+ * Makefile.in (sdbout.o): Show includes ggc.h.
+
+2001-03-21 Jakub Jelinek <jakub@redhat.com>
+
+ * crtstuff.c (init_dummy): Use CRT_END_INIT_DUMMY if defined.
+ Remove ia32 linux PIC kludge and move it...
+ * config/i386/linux.h (CRT_END_INIT_DUMMY): ...here.
+
+2001-03-20 DJ Delorie <dj@redhat.com>
+
+ * Makefile.in (install-libgcc): Pass complete list of variables.
+ (install-multilib): Ditto.
+
+2001-03-20 Mark Mitchell <mark@codesourcery.com>
+
+ * tree.c (set_decl_assembler_name): Set DECL_ASSEMBLER_NAME for
+ variables that are TREE_PUBLIC, even if not TREE_STATIC.
+
+2001-03-19 Mark Mitchell <mark@codesourcery.com>
+
+ Compute DECL_ASSEMBLER_NAME lazily.
+ * tree.h (DECL_ASSEMBLER_NAME): Compute it lazily.
+ (DECL_ASSEMBLER_NAME_SET_P): New macro.
+ (SET_DECL_ASSEMBLER_NAME): Likewise.
+ (COPY_DECL_ASSEMBLER_NAME): Likewise.
+ (set_decl_assembler_name): Declare.
+ (lang_set_decl_assembler_name): Likewise.
+ * tree.c (lang_set_decl_assembler_name): New variab.e
+ (set_decl_assembler_name): New function.
+ (init_obstacks): Set lang_set_decl_assembler_name.
+ (build_decl): Don't set DECL_ASSEMBLER_NAME.
+ * c-decl.c (duplicate_decls): Use SET_DECL_ASSEMBLER_NAME,
+ COPY_DECL_ASSEMBLER_NAME, etc. Don't set DECL_ASSEMBLER_NAME
+ where it's not necessary.
+ (builtin_function): Likewise.
+ (finish_decl): Likewise.
+ * dbxout.c (dbxout_type_methods): Likewise.
+ * ggc-common.c (ggc_mark_trees): Likewise.
+ * profile.c (output_func_start_profiler): Likewise.
+ * varasm.c (make_decl_rtl): Likewise.
+
+ * cse.c (find_comparison_args): Update documentation. Fix
+ mishandling of COMPARE operations.
+
+ * tree.def (ABS_EXPR): Add documentation.
+ * fold-const.c (fold): Improve folding of ABS_EXPRs.
+
+2001-03-20 Tom Tromey <tromey@redhat.com>
+
+ * libgcc-std.ver: Added __fixunssfsi and __fixunsdfsi.
+
+2001-03-20 David Billinghurst <David.Billinghurst@riotinto.com>
+
+ * config/i386/cygwin.h: Declare ctor_section, dtor_section
+ drectve_section, switch_to_section.
+
+ * winnt.c: Declare functions associated_type, gen_stdcall_suffix,
+ i386_pe_dllexport_p, i386_pe_dllimport_p, i386_pe_mark_dllexport,
+ i386_pe_mark_dllimport.
+
+2001-03-20 David Billinghurst <David.Billinghurst@riotinto.com>
+
+ * config/i386/cygwin.h: Include <stdio.h> Declare and constify
+ functions i386_pe_*.
+
+ * config/i386/winnt.c: Include "tm_p.h" and "toplev.h" Constify
+ i386_pe_* functions with char * arguments.
+
+2001-03-20 Alexandre Oliva <aoliva@redhat.com>
+
+ * config/sh/sh.md (movsf_ie): Fix output patterns for fpul load
+ and store.
+ (movsi_ie): Introduce fpul store.
+
+2001-03-20 Alan Modra <alan@linuxcare.com.au>
+
+ * Makefile.in (OBJS): Remove hashtab.o.
+
+2001-03-19 Tom Tromey <tromey@redhat.com>
+
+ * gcc.c (init_gcc_specs): Fix comment.
+
+2001-03-19 Mark Mitchell <mark@codesourcery.com>
+
+ * cse.c (find_comparison_args): Update documentation. Fix
+ mishandling of COMPARE operations.
+
+ * tree.def (ABS_EXPR): Add documentation.
+ * fold-const.c (fold): Improve folding of ABS_EXPRs.
+
+2001-03-16 Andrew Haley <aph@cambridge.redhat.com>
+
+ * config/ia64/libgcc-ia64.ver: Add __ia64_backtrace.
+
+2001-03-19 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
+
+ * README.X11: Remove obsolete file.
+
+2001-03-18 Anthony Green <green@redhat.com>
+
+ * config/pj/pj.h: Remove some trailing commas.
+ (ASM_SPEC): Use -EB and -EL, not -mb and -ml.
+
+2001-03-17 Anthony Green <green@redhat.com>
+
+ * config/pj/lib1funcs.S: Fix broken comment.
+ * config/pj/pj.h (LOCAL_LABEL_PREFIX): Prefix internal
+ labels with '.'.
+
+2001-03-18 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * gcc.texi: Remove obsolete information relating to build and
+ installation problems with enquire or the Pyramid C compiler.
+
+2001-03-16 Philip Blundell <philb@gnu.org>
+
+ * config.gcc: Remove obsolete targets "arm*-*-linuxoldld" and
+ "armv2-*-linux".
+ * config/arm/linux-elf.h: Remove historical relics related to
+ above configurations.
+ * config/arm/linux-oldld.h: Delete.
+ * config/arm/linux-elf26.h: Delete.
+
+2001-03-17 Richard Henderson <rth@redhat.com>
+
+ * dwarf2out.c (lookup_filename): Emit .file if the assembler
+ is generating .debug_line.
+ (dwarf2out_init): Add main_input_filename to the file table first.
+ * configure.in (as_dwarf2_debug_line): Test with file number 1
+ instead of file number 0.
+
+ * dwarf2out.c: Revert most of 2000-11-25 and 2001-01-24 changes.
+ (LN_PROLOG_AS_LABEL, LN_PROLOG_END_LABEL): New.
+ (size_of_line_prolog): Remove.
+ (output_line_info): Compute prologue size via label difference.
+ (lookup_filename): Return "unspecified" for <internal> and <built-in>.
+ * configure.in (HAVE_AS_DWARF2_DEBUG_LINE): Require that the
+ assembler error when redefining file numbers.
+ * config.in, configure: Rebuild.
+
+2001-03-17 David Billinghurst <David.Billinghurst@riotinto.com>
+
+ * config/i386/xm-cygwin.h: Include <sys/cygwin.h. Remove unused
+ variable.
+
+2001-03-16 Jim Wilson <wilson@redhat.com>
+
+ * config/ia64/ia64.c (ia64_compute_frame_size): If reg_fp is zero,
+ then set it to LOC_REG (79) instead of aborting.
+
+2001-03-16 Laurynas Biveinis <lauras@softhome.net>
+
+ * fixinc/Makefile.in: Set SHELL.
+
+2001-03-16 Laurynas Biveinis <lauras@softhome.net>
+
+ * fixinc/fixincl.c (fix_with_system): Quote file names before
+ passing them to shell.
+
+2001-03-16 Laurynas Biveinis <lauras@softhome.net>
+
+ * Makefile.in: Use fix-header$(build_exeext) instead
+ of fix-header.
+
+Fri Mar 16 11:26:01 2001 Christopher Faylor <cgf@cygnus.com>
+
+ * config/i386/cygwin.h: Revert previously misapplied patch which
+ eliminated TARGET_SUBTARGET_DEFAULT.
+
+2001-03-16 Alexandre Oliva <aoliva@redhat.com>
+
+ * config/sh/sh.c (sh_expand_prologue): Insns that set up the PIC
+ register may be dead.
+
+2001-03-15 Mark Mitchell <mark@codesourcery.com>
+
+ * dwarf2out.c (rtl_for_decl_location): Use DECL_RTL_IF_SET.
+
+2001-03-16 Brad Lucier <lucier@math.purdue.edu>
+
+ * Makefile.in (hash.o): Depend on CONFIG_H.
+
+2001-03-16 Alexandre Oliva <aoliva@redhat.com>
+
+ * cppfiles.c (stack_include_file): Use MAX of sysp.
+
+2001-03-15 Steve Ellcey <sje@cup.hp.com>
+
+ * config.gcc (ia64*-*-hpux*): New case.
+ * config/ia64/hpux.h: New file for HP-UX support.
+ * config/ia64/t-hpux: New file for HP-UX support.
+
+2001-03-16 Bruce Korb <bkorb@gnu.org>, Alexandre Oliva <aoliva@redhat.com>
+
+ * fixinc/inclhack.def (irix_stdio_va_list): New.
+ * fixinc/fixincl.x: Rebuilt.
+
+2001-03-15 Bruce Korb <bkorb@gnu.org>
+
+ * gcc.c(main): make more rigorous
+ * collect2.c(main): guard against ignoring SIGCHLD
+ * protoize.c(main): ditto
+ * gcc/fixinc/fixincl.c(initialize): ditto
+
+2001-03-15 Mark Mitchell <mark@codesourcery.com>
+
+ * sdbout.c (sdbout_symbol): Use DECL_RTL_SET_P, SET_DECL_RTL.
+ (sdbout_parms): Likewise.
+
+Thu Mar 15 12:51:00 2001 Jeffrey A Law (law@cygnus.com)
+
+ * reload1.c (reload_cse_simplify_set): For LOAD_EXTEND_OP, do not
+ "widen" a destination that is already wider than a word. Also do
+ not widen if LOAD_EXTEND_OP is NIL for the given mode.
+
+2001-03-15 Zack Weinberg <zackw@stanford.edu>
+
+ * config/xm-lynx.h, config/xm-std32.h, config/a29k/xm-a29k.h,
+ config/a29k/xm-unix.h, config/alpha/xm-alpha.h,
+ config/arc/xm-arc.h, config/arm/xm-arm.h, config/c4x/xm-c4x.h,
+ config/clipper/xm-clix.h, config/convex/xm-convex.h,
+ config/d30v/xm-d30v.h, config/dsp16xx/xm-dsp16xx.h,
+ config/elxsi/xm-elxsi.h, config/fr30/xm-fr30.h,
+ config/h8300/xm-h8300.h, config/i370/xm-i370.h,
+ config/i370/xm-linux.h, config/i370/xm-mvs.h,
+ config/i370/xm-oe.h, config/i386/xm-aix.h,
+ config/i386/xm-i386.h, config/i386/xm-osf.h,
+ config/i860/xm-i860.h, config/i960/xm-i960.h,
+ config/ia64/xm-ia64.h, config/m32r/xm-m32r.h,
+ config/m68k/xm-m68k.h, config/m88k/xm-m88k.h,
+ config/mcore/xm-mcore.h, config/mips/xm-mips.h,
+ config/mn10200/xm-mn10200.h, config/mn10300/xm-mn10300.h,
+ config/ns32k/xm-ns32k.h, config/pa/xm-linux.h,
+ config/pa/xm-pa.h, config/pa/xm-pa64hpux.h,
+ config/pa/xm-pahpux.h, config/pa/xm-papro.h,
+ config/pj/xm-pj.h, config/romp/xm-romp.h,
+ config/rs6000/xm-beos.h, config/rs6000/xm-rs6000.h,
+ config/rs6000/xm-sysv4.h, config/sh/xm-sh.h,
+ config/sparc/xm-sparc.h, config/sparc/xm-sysv4.h,
+ config/v850/xm-v850.h, config/vax/xm-vax.h,
+ config/vax/xm-vms.h, config/we32k/xm-we32k.h:
+ Do not define TRUE or FALSE.
+
+ * config/i386/xm-aix.h, config/i386/xm-osf.h: Delete; made
+ empty by above change.
+ * config.gcc: Remove references to these files.
+
+ * configure.in: Detect stdbool.h.
+ * configure, config.in: Regenerate.
+ * system.h: Include stddef.h here if available. Set
+ HAVE__BOOL based on GCC_VERSION and __STDC_VERSION__. Then
+ set up a sensible boolean type at the very end.
+
+ * combine.c, cse.c, expr.c, fold-const.c, gensupport.c,
+ config/mcore/mcore.c: Rename variables named 'true'
+ and/or 'false'.
+
+ * hash.h: Delete 'boolean' typedef and related #undefs.
+
+ * function.c, ggc-common.c, hash.h, hash.c, tlink.c,
+ Replace all uses of 'boolean' with 'bool'.
+
+2001-03-15 Neil Booth <neil@daikokuya.demon.co.uk>
+ David Billinghurst <David.Billinghurst@riotinto.com>
+
+ * config/mips/iris5.h: Change WCHAR_TYPE to int.
+
+2001-03-15 Bernd Schmidt <bernds@redhat.com>
+
+ * simplify-rtx.c (hash_rtx): For REG and MEM, just use value of
+ expression without adding in rtx code and mode.
+
+ * alias.c (init_alias_analysis): Don't use any rtx whose value
+ varies as a known value.
+ Delete a superfluous test.
+
+2001-03-15 Mark Mitchell <mark@codesourcery.com>
+
+ * varasm.c (assemble_variable): Use DECL_RTL_SET_P.
+
+2001-03-14 Mark Mitchell <mark@codesourcery.com>
+
+ * varasm.c (assemble_alias): Use DECL_ASSEMBLER_NAME, not the
+ contents of the RTL, to determine the name of the object.
+
+2001-03-14 Laurynas Biveinis <lauras@softhome.net>
+
+ * configure.in: Use $gcc_cv_as instead of $as.
+ * configure: Regenerated.
+
+Wed Mar 14 13:17:44 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
+
+ * alias.c (handled_component_p, can_address_p): New functions.
+ (get_alias_set): Use them.
+
+2001-03-14 Mark Mitchell <mark@codesourcery.com>
+
+ * expr.c (expand_expr): Revove bogus conditional.
+
+2001-03-14 Mark Mitchell <mark@codesourcery.com>
+
+ * tree.h (DECL_RTL): Allocate RTL lazily.
+ (SET_DECL_RTL): New macro.
+ (DECL_RTL_SET_P): Likewise.
+ (COPY_DECL_RTL): Likewise.
+ (DECL_RTL_IF_SET): Likewise.
+ * varasm.c (make_decl_rtl): Add assertions about the kind of
+ declaration we are processing.
+ * c-decl.c (duplicate_decls): Use COPY_DECL_RTL, DECL_RTL_SET_P, etc.
+ (start_decl): Likewise.
+ (finish_decl): Likewise.
+ * c-semantics.c (emit_local_var): Likewise.
+ * calls.c (expand_call): Likewise.
+ * dbxout.c (dbxout_symbol): Likewise.
+ * emit-rtl.c (unshare_all_rtl): Likewise.
+ (unshare_all_decls): Likewise.
+ (reset_used_decls): Likewise.
+ * expr.c (store_constructor): Likewise.
+ (safe_from_p): Likewise.
+ (expand_expr): Likewise.
+ * function.c (put_var_into_stack): Likewise.
+ (instantiate_decls_1): Likewise.
+ (assign_parms): Likewise.
+ (expand_function_start): Likewise.
+ (expand_function_end): Likewise.
+ * ggc-common.c (gcc_mark_trees): Likewise.
+ * integrate.c (function_cannot_inline_p): Likewise.
+ (copy_decl_for_inlining): Likewise.
+ (expand_inline_function): Likewise.
+ (integrate_parm_decls): Likewise.
+ (integrate_decl_tree): Likewise.
+ * print-tree.c (print_node): Likewise.
+ * reg-stack.c (stack_result): Likewise.
+ * stmt.c (label_rtx): Likewise.
+ (expand_return): Likewise.
+ (expand_decl): Likewise.
+ (expand_decl_cleanup): Likewise.
+ (expand_anon_union_decl): Likewise.
+ * toplev.c (check_global_declarations): Likewise.
+ (rest_of_decl_compilation): Likewise.
+ * tree.c (simple_cst_equal): Likewise.
+ * objc/objc-act.c (generate_static_references): Likewise.
+
+2001-03-14 Jakub Jelinek <jakub@redhat.com>
+
+ * reg-stack.c (stack_result): Unconditionally use
+ FUNCTION_OUTGOING_VALUE resp. FUNCTION_VALUE.
+
+2001-03-13 Jim Wilson <wilson@redhat.com>
+
+ * config/ia64/ia64.c (find_gr_spill): Subtract frame_pointer_needed
+ from 80 in try_locals code.
+ (ia64_expand_prologue): Add comment pointing to find_gr_spill change.
+
+2001-03-13 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * cpp.texi (poison): Explain the macro expansion exception.
+
+2001-03-12 Neil Booth <neil@daikokuya.demon.co.uk>
+
+ * cppinternals.texi: Update for file handling.
+
+Mon Mar 12 14:05:32 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
+
+ * flow.c (insn_dead_p): Don't consider two memrefs equivalent
+ unless anti_dependence says they are.
+ * alias.c (objects_must_conflict): If neither has a type specified,
+ they must conflict.
+
+2001-03-12 Aldy Hernandez <aldyh@redhat.com>
+
+ * reload1.c (reload_cse_simplify): Call reload_cse_simplify_set
+ before reload_cse_noop_set_p.
+
+Sat Mar 10 23:21:34 2001 kaz Kojima <kkojima@rr.iij4u.or.jp>
+
+ * config/sh/sh.h (LEGITIMATE_PIC_OPERAND_P): Defined.
+
+Sat Mar 10 23:16:16 2001 Toshiyasu Morita <toshiyasu.morita@hsa.hitachi.com>
+
+ * config/sh/sh.md (umulhisi3_i, mulhisi3_i): Fix mnemonics.
+ * config/sh/lib1funcs.asm (mulsi3): Convert mulu to mulu.w.
+
+Sat Mar 10 23:03:25 2001 Alexandre Oliva <aoliva@redhat.com>
+
+ * tree.c (build_common_tree_nodes_2): Don't copy va_list_type_node
+ if it's a record type.
+
+Sat Mar 10 17:52:54 2001 Christopher Faylor <cgf@cygnus.com>
+
+ * config/i386/cygwin.h: Make ../w32api a system directory. Reorganize
+ mingw includes slightly.
+
+Fri Mar 9 18:33:50 2001 Jeffrey A Law (law@cygnus.com)
+
+ * pa.md (builtin_longjmp): Rework slightly to work for PA64 too.
+
+2001-03-09 Nicola Pero <n.pero@mi.flashnet.it>
+
+ * configure: Rebuilt.
+ * configure.in: Only use `lang_requires' for languages athat are
+ actually enabled.
+
+Thu Mar 8 23:34:42 2001 Jeffrey A Law (law@cygnus.com)
+
+ * config/pa/som.h (MAKE_DECL_ONE_ONLY, ASM_WEAKEN_LABEL): Disable.
+
+Thu Mar 8 23:22:26 2001 John Wehle (john@feith.com)
+
+ * rtlanal.c (rtx_varies_p): Check operand 0 of a
+ LO_SUM unless for_alias is set.
+
+2001-03-08 Bruce Korb <bkorb@gnu.org>
+
+ gcc.c(main): ensure SIGCHLD handling is set to SIG_DFL so that
+ wait4() can receive the signal.
+
+Thu Mar 8 21:09:10 2001 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * fixinc/inclhack.def (AAB_dgux_int_varargs): Don't use HTML
+ entities.
+ * fixinc/fixincl.x: Regenerate.
+
+Thu Mar 8 21:09:10 2001 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * fixinc/inclhack.def (AAA_standards): Undo <standards.h> breakage
+ on Tru64 UNIX.
+ * fixinc/fixincl.x: Regenerate.
+
+Thu Mar 8 19:42:08 CET 2001 Jan Hubicka <jh@suse.cz>
+
+ * reg-stack.c (move_for_stack_reg): Avoid non-popint fst for
+ TFmode too.
+
+Thu Mar 8 06:32:50 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
+
+ * config/i386/i386.md (clrstrsi): Call ix86_set_move_mem_attrs.
+
+2001-03-08 Alexandre Oliva <aoliva@redhat.com>
+
+ * configure.in (enable_shared): Support per-package shared-library
+ enabling.
+ * configure: Rebuilt.
+
+2001-03-07 David Edelsohn <edelsohn@gnu.org>
+
+ * rs6000.md (cr logic): Add original POWER mnemonic alternative
+ for crnot. Set operands[5] in splitter.
+
+2001-03-07 Tom Tromey <tromey@redhat.com>
+
+ * configure: Rebuilt.
+ * configure.in: Allow config-lang.in to set `lang_requires' to list
+ of other required languages.
+
+2001-03-07 Richard Henderson <rth@redhat.com>
+
+ * config/alpha/alpha.md (call_osf_1_noreturn): New pattern.
+
+2001-03-07 Laurynas Biveinis <lauras@softhome.net>
+
+ * fixinc/inclhack.def (djgpp_wchar_h): New test.
+ * fixinc/fixincl.x: Regenerated.
+
+2001-03-06 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
+
+ * Restore change that patch misapplied.
+ * config/i386/i386.c (ix86_set_move_mem_attrs): New function.
+ (ix86_set_move_mem_attrs_1): Likewise.
+ * config/i386/i386-protos.h (ix86_set_move_mem_attrs): New declaration.
+ * config/i386/i386.md (movstrsi): Call it.
+
+2001-03-06 Stephen L Moshier <moshier@mediaone.net>
+
+ * config/m68k/m68k.c (const_uint32_operand): Accept any
+ const_int on a 32-bit host.
+
+2001-03-06 Zack Weinberg <zackw@stanford.edu>
+
+ * c-parse.in (yylexname): New function, split out of _yylex.
+ (objc_rid_sans_at): New table.
+ (init_reswords): Initialize it.
+ (_yylex): Give labels clearer names. Handle CPP_ATSIGN by
+ retrieving the next token and checking it for significance as
+ an ObjC keyword or string constant.
+
+ * cpplex.c (_cpp_lex_token): Just return CPP_ATSIGN for '@'.
+ * cpplib.h (TTYPE_TABLE): Add CPP_ATSIGN, drop CPP_OSTRING.
+
+ * c-lex.c, c-parse.in, cppmacro.c, cpplex.c: Remove references
+ to CPP_OSTRING.
+
+2001-03-06 Nicola Pero <n.pero@mi.flashnet.it>
+
+ * objc/objc-act.c (init_objc): Set save_lang_status,
+ restore_lang_status, and mark_lang_status.
+
+2001-03-06 Neil Booth <neil@daikokuya.demon.co.uk>
+
+ * cppinternals.texi: Update.
+
+2001-03-05 Brad Lucier <lucier@math.purdue.edu>
+
+ * invoke.texi: Document __FAST_MATH__.
+
+2001-03-04 John David Anglin <dave@hiauly1.hia.nrc.ca>
+
+ * function.c (purge_addressof_1): Change type of function
+ purge_addressof_1 from boolean to int. Change local variable
+ `result' to int, and false and true to 0 and 1, respectively.
+
+2001-03-04 Stephane Carrez <Stephane.Carrez@worldnet.fr>
+
+ * config/m68hc11/larith.asm (__mulqi3): Fix multiplication of two
+ negative numbers.
+ (___subdi3, ___adddi3): Use x instead of y as index register.
+ (__init_bss_section, __map_data_section): Optimize for 68HC12.
+ (__memset, __memcpy): Likewise.
+ (regs): Put the soft registers in bss for 68HC12.
+ (abort): Use trap to abort for 68hc12.
+ (__mulhi3, __mulhi32): Use emul for 68hc12.
+ (__mulsi3): Avoid to use the tmp soft register for 68hc12.
+
+2001-03-04 Stephane Carrez <Stephane.Carrez@worldnet.fr>
+
+ * config/m68hc11/m68hc11.h (LIMIT_RELOAD_CLASS): Don't define.
+ * config/m68hc11/m68hc11-protos.h (limit_reload_class): Remove.
+ * config/m68hc11/m68hc11.c (limit_reload_class): Remove.
+ (m68hc11_override_options): Remove setting of flag_no_nonansi_builtin.
+ Set 68HC12 min offset to -65536.
+ (print_operand): Put parenthesis arround the operand if it refers
+ to a symbol having the same name as a register.
+ (m68hc11_z_replacement): When z register is replaced by its
+ equivalent soft register, force the insn to be re-recognized.
+ (m68hc11_check_z_replacement): Fix the test when destination is
+ the index register and z dies in the insn.
+ (m68hc11_reorg): Remove the REG_DEAD notes beforce recomputing them.
+
+2001-03-04 Stephane Carrez <Stephane.Carrez@worldnet.fr>
+
+ * config/m68hc11/m68hc11.c (m68hc11_override_options): Initialize
+ costs according to processor variant.
+ (m68hc11_shift_cost): New function to compute shift costs.
+ (m68hc11_rtx_costs): Define costs according to processor variant.
+ (m6811_cost): Costs for 68HC11.
+ (m6812_cost): Costs for 68HC12.
+ (COSTS_N_INSNS): Remove.
+
+ * config/m68hc11/m68hc11.h (RTX_COSTS): New.
+ (DEFAULT_RTX_COSTS): Remove.
+ (CONST_COSTS): Define costs according to OUTER_CODE.
+ (processor_costs): New struct to define costs.
+ (m68hc11_cost): Pointer to current costs.
+
+2001-03-04 Stephane Carrez <Stephane.Carrez@worldnet.fr>
+
+ * config/m68hc11/m68hc11.md (*addhi3_68hc12): Fix generation
+ and use m68hc11_notice_keep_cc when using leax/leay.
+ (addhi3 split): Reject split if the insn is handled by
+ leax/leay above.
+ * config/m68hc11/m68hc11.c (m68hc11_split_move): For 68HC12 the
+ push must be handled in a special way if the source operand uses
+ sp as index register.
+ (m68hc11_notice_keep_cc): New function.
+ (m68hc11_gen_movhi): Use it when an insn changes a register but
+ not the flags.
+ (m68hc11_gen_movqi): Fix move for 68HC12.
+ * config/m68hc11/m68hc11-protos.h (m68hc11_notice_keep_cc): Declare.
+
+2001-03-04 Stephane Carrez <Stephane.Carrez@worldnet.fr>
+
+ * config/m68hc11/m68hc11.c (m68hc11_emit_libcall): Use LCT_CONST
+ and don't pass operands[0] to emit_library_call_value.
+
+2001-03-04 Stephane Carrez <Stephane.Carrez@worldnet.fr>
+
+ * config/m68hc11/m68hc11.md (tsthi_1): Use cpd for 68HC12.
+ (zero_extendsi split): Simplify and use (zero_extendhi).
+ (*addhi3): Remove 'w' constraint since stack pointer is handled
+ by (addhi3_sp).
+ (*ashlhi3_2): Operand 2 is clobbered use '+' for its constraint.
+ (*ashlhi3, *ashrhi3, *lshrhi3): Likewise.
+ (*ashrhi3_const): Fix shift by 7.
+ (*lshrsi3_const16): Fix template.
+ (call, call_value): Fix constraint and predicate.
+
+2001-03-04 Stephane Carrez <Stephane.Carrez@worldnet.fr>
+
+ * config/m68hc11/m68hc11.md (X_REGNUM, D_REGNUM): New constant.
+ (Y_REGNUM, SP_REGNUM, PC_REGNUM, A_REGNUM, B_REGNUM): Likewise.
+ (CC_REGNUM): Likewise.
+ (*unnamed splits): Use above constants instead of hard coded numbers.
+ (*adcq, *subcq, *addsi_carry, *rotlqi3_with_carry): Likewise.
+ (*rotlhi3_with_carry, *rotrhi3_with_carry): Likewise.
+ (*return_16bit, *unnamed peepholes): Likewise.
+
+2001-03-03 Laurynas Biveinis <lauras@softhome.net>
+
+ * gcc.c (convert_filename): Append executable suffix
+ if NO_AUTO_EXE_SUFFIX is not defined.
+ * gcc.texi: Document NO_AUTO_EXE_SUFFIX.
+ * config/i386/djgpp.h: Define NO_AUTO_EXE_SUFFIX.
+
+
+2001-03-03 David O'Brien <obrien@FreeBSD.org>
+
+ from 2000-09-06 Zack Weinberg <zack@wolery.cumb.org>
+ * c-parse.gperf, c-gperf.h: Delete.
+ (c-gperf.h was accidently re-added to the CVS repo in the rev 1.16 commit
+ by tromey)
+
+2001-03-03 John David Anglin <dave@hiauly1.hia.nrc.ca>
+
+ * fixinc/fixlib.h (t_bool): Add identifier `t_bool' in typedef.
+ * fixinc/server.c (read_pipe_timeout): Use enum t_bool instead of
+ t_bool in declaration because pcc can't combine volatile with typedef
+ types.
+
+2001-03-03 Neil Booth <neil@daikokuya.demon.co.uk>
+
+ * longlong.h (umul_ppmm): Don't use a multiline string.
+
+2001-03-03 Neil Booth <neil@daikokuya.demon.co.uk>
+
+ * cpplex.c (_cpp_lex_token): Don't warn about directives in
+ macro arguments when looking for the '('.
+ * cppmacro.c (funlike_invocation_p): Set parsing_args to
+ 2 when really parsing arguments; 1 when looking for '('.
+ Always restore the lexer position.
+
+2001-03-03 Neil Booth <neil@daikokuya.demon.co.uk>
+
+ * cpplex.c (parse_string): Unconditionally pedwarn.
+
+2001-03-03 Neil Booth <neil@daikokuya.demon.co.uk>
+
+ * cpp.texi: Update.
+ * cppexp.c (parse_number): Update.
+ * cpplex.c (parse_string): Pedwarn if multiline string does not
+ result from a system header's macro.
+ * cpplib.h (sys_objmacro_p): Rename sys_macro_p.
+ * cppmacro.c (sys_objmacro_p): Rename sys_macro_p. Return true
+ for function-like macros too.
+
+2001-03-02 John David Anglin <dave@hiauly1.hia.nrc.ca>
+
+ * print-rtl.c (print_rtx): Cast enums to int for comparison.
+ * c-decl.c (grokdeclarator): Cast enums to int for comparison and
+ shifts.
+ * c-format.c (C_STD_VER): Cast to int for comparisons.
+ (check_function_format): Cast various enums to int for &.
+ (maybe_read_dollar_number): Likewise.
+ (check_format_info): Likewise.
+ (check_format_info_main): Likewise.
+ * expr.c (emit_move_insn_1): Cast enums to unsigned int for comparison.
+ (safe_from_p): Likewise.
+ * varasm.c (const_hash): Cast enum to int for %.
+ * emit-rtl.c (init_emit_once): Use int loop variable to work around
+ pcc enum problems with < and ++ operators.
+ * regclass.c (init_reg_sets_1): Cast enums for comparison.
+ (choose_hard_reg_mode): Use unsigned int to iterate over CCmodes.
+ (regclass_init): Change enum class to int to iterate over reg_classes.
+ * genrecog.c (merge_trees): Cast enums for comparison.
+ * rtl.h (GET_CODE): Cast to enum rtx_code.
+ (PUT_CODE): Cast to ENUM_BITFIELD(rtx_code).
+ (GET_MODE): Cast to enum machine_mode.
+ (PUT_MODE): Cast to ENUM_BITFIELD(machine_mode).
+ (GET_NOTE_INSN_NAME): Cast enum to int.
+ * tree.h (TREE_CODE): Cast to enum tree_code.
+ (TREE_SET_CODE): Cast VALUE to ENUM_BITFIELD(tree_code).
+ * simplify-rtx.c (hash_rtx): Cast enums to unsigned unt.
+ * timevar.c (timevar_print): Change loop variable id from enum to
+ unsigned int.
+ * fixinc/fixincl.c (VLEVEL): Cast enums in comparison to unsigned int.
+ * config/i386/i386.md: Use PUT_MODE for mode assignment.
+ * toplev.c (compile_file): Cast enum DFI to int.
+ (decode_d_option): Likewise.
+
+Fri Mar 2 12:18:13 2001 Christopher Faylor <cgf@cygnus.com>
+
+ * cppinit.c (append_include_chain): Mark "after" include file name list
+ as a system directory.
+ * cpp.texi: Document new behavior.
+
+2001-03-01 Zack Weinberg <zackw@stanford.edu>
+
+ * cpphash.h (struct cpp_reader): Add print_version field.
+ * cppinit.c (cpp_handle_option): For -v, -version, and --version,
+ just set print_version and other flags as appropriate.
+ (cpp_post_options): Print version here if print_version is set.
+
+ * toplev.c (exit_after_options): New flag.
+ (independent_decode_option): Don't exit here; just set
+ exit_after_options.
+ (main): Exit after calling lang_hooks.post_options if
+ exit_after_options is true.
+
+ * cppinit.c (append_include_chain): Drop never-used case QUOTE.
+ (merge_include_chains): Adjust comment to match code.
+
+2001-03-01 Zack Weinberg <zackw@stanford.edu>
+
+ * stringpool.c (set_identifier): New function.
+ * tree.h: Prototype it.
+
+ * c-parse.in: Kill D_YES. If compiled for objc, call
+ save_and_forget_protocol_qualifiers from init_reswords.
+ * objc/objc-act.c (remember_protocol_qualifiers,
+ forget_protocol_qualifiers): Don't diddle C_IS_RESERVED_WORD.
+ Swap out the non-keyword IDENTIFIER_NODEs for keyword ones, or
+ vice versa.
+ (save_and_forget_protocol_qualifiers): New function.
+ * c-lex.h: Prototype save_and_forget_protocol_qualifiers.
+
+2001-03-01 John David Anglin <dave@hiauly1.hia.nrc.ca>
+
+ * cpplib.c (_cpp_init_stacks): Cast enum for comparison.
+ * cppexp.c (lex): Cast enums for comparison.
+ * cppinit.c (parse_option): Cast enum for comparison.
+ * cpplex.c (cpp_spell_token): Cast enums to int for minus.
+ (cpp_output_token): Likewise.
+ (cpp_can_paste): Cast enums for comparsion and plus/minus.
+ (cpp_avoid_paste): Cast enums for minus and comparison.
+
+2001-02-23 Jeffrey Oldham <oldham@codesourcery.com>
+
+ * Makefile.in (resource.o): Add params.h dependence.
+ * params.def (MAX_DELAY_SLOT_LIVE_SEARCH): New parameter.
+ * params.h (MAX_DELAY_SLOT_LIVE_SEARCH): Likewise.
+ * resource.c: Add dependence on params.h.
+ (current_live_regs): Fix explanatory comment.
+ (find_basic_block): Add new parameter to permit limiting search
+ for a BARRIER.
+ (mark_target_live_regs): Add new argument to find_basic_block call.
+ (incr_ticks_for_insn): Likewise.
+
+2001-02-21 Jeffrey Oldham <oldham@codesourcery.com>
+
+ * Makefile.in (reorg.o): Add params.h dependence.
+ * params.def: Fix typographical error in comment.
+ (MAX_DELAY_SLOT_INSN_SEARCH): New parameter.
+ * params.h: Modify introductory comment.
+ (MAX_DELAY_SLOT_INSN_SEARCH): New parameter.
+ * reorg.c: Add dependence on params.h.
+ (redundant_insn): Add parameterized throttle for search.
+ (fill_simple_delay_slots): Add a comment explaining a variable.
+ Move conditional out of loop, simplifying code.
+ (fill_eager_delay_slots): Fix typographical error in comment.
+
+2001-02-14 Jeffrey Oldham <oldham@codesourcery.com>
+
+ * Makefile.in (OBJS): Add params.o.
+
+2001-02-14 Mark Mitchell <mark@codesourcery.com>
+
+ * Makefile.in (toplev.o): Depend on params.h.
+ (intergate.o): Likewise.
+ (params.o): New target.
+ * flags.h (inline_max_insns): Remove.
+ * integrate.c: Include params.h.
+ Use MAX_INLINE_INSNS instead of inline_max_insns.
+ * params.c: New file.
+ * params.h: Likewise.
+ * params.def: Likewise.
+ * toplev.c: Include params.h.
+ (lang_independent_params): New variable.
+ (decode_f_option): Use the param machinery instead of setting
+ max_inline_insns.
+ (independent_decode_option): Handle "--param name=value".
+ (main): Register language-independent parameters.
+
+Thu Mar 1 09:44:15 2001 Jeffrey A Law (law@cygnus.com)
+
+ * config/pa/som.h (ASM_IDENTIFY_GCC): Define.
+ (ASM_IDENTIFY_GCC_AFTER_SOURCE): Likewise.
+
+ * pa.c (emit_move_sequence): Verify operand0 is a hard register
+ before determining its register class.
+
+2001-03-01 Bernd Schmidt <bernds@redhat.com>
+
+ * config/ia64/ia64.c (ia64_hard_regno_rename_ok): Disallow renaming
+ from reg 4 if current_function_calls_setjmp.
+ (ia64_sched_reorder): Move code that rotates bundles up a bit.
+
+ * reload1.c (eliminate_regs_in_insn): Restrict the special case
+ code not to try to optimize adds with anything but a REG destination.
+
+ * sched-int.h (struct haifa_insn_data): Add new member priority_known.
+ (INSN_PRIORITY_KNOWN): New accessor macro.
+ * haifa-sched.c (priority): Use it instead of testing priority against
+ zero.
+
+2001-02-28 Neil Booth <neil@daikokuya.demon.co.uk>
+
+ * cppinit.c (builtin_array): Update.
+ (init_builtins): Flag builtins to warn if redefined or
+ undefined. Define __GXX_WEAK as a normal macro.
+ * cpplib.c (do_undef): Warn if flagged NODE_WARN.
+ * cpplib.h (NODE_WARN): New flag.
+ * cppmacro.c (builtin_macro): Remove handling of __GXX_WEAK__.
+ Handle __STDC__ as a builtin only on Solaris.
+ (warn_of_redefinition): Renamed from check_macro_definition.
+ Reverse sense of test. Always warn if NODE_WARN.
+ (_cpp_create_definition): Use warn_of_redefinition. Flag
+ any macro beginning with "__STDC_" to require a mandatory
+ warning if redefined or undefined.
+ * cppinit.c (set_lang): Move builtin handling to...
+ (init_builtins): ...here.
+ (_cpp_create_reader): Move call to set_lang.
+ * cppfiles.c (stack_include_file): Generate dependencies
+ here, and manage include_count here too.
+ (PRINT_THIS_DEP): Delete.
+ (_cpp_execute_include): Do not generate dependencies here,
+ apart from the case of a missing header. Do not manage
+ include_count.
+ (_cpp_read_file): Leave dependency generation to
+ stack_include_file.
+ * cppexp.c (parse_number): Similarly.
+ * cpplib.h (NODE_SYSHDR, cpp_sys_objmacro_p): New.
+ * cppmacro.c (struct cpp_macro): New member node.
+ (parse_args): Only warn about missing rest args if not
+ a system macro.
+ (funlike_invocation_p): Similarly for uninvoked funlike macros.
+ (cpp_sys_objmacro_p): New.
+ (_cpp_create_definition): Store the node with the macro defn.
+ Remember if the macro is defined in a system header.
+
+2001-02-28 Nathan Sidwell <nathan@codesourcery.com>
+
+ * extend.texi (Deprecated Features): Deprecate float and
+ complex template constant parms.
+
+Tue Feb 27 16:45:00 2001 Jeffrey A Law (law@cygnus.com)
+
+ * pa.c (override_options): Promote -fpic to -fPIC.
+ (legitimize_pic_address): Simplify due to removal of
+ small PIC as a code generation option.
+ (secondary_reload_class): Similarly.
+ * pa.h (GO_IF_LEGITIMATE_ADDRESS): Similarly.
+ (PRINT_OPERAND_ADDRESS): Similarly.
+ * pa.md (various patterns): Similarly.
+ (small pic lo_sum pattern): Remove.
+
+2001-02-27 Andreas Jaeger <aj@suse.de>
+
+ * configure.in: Document that --disable-checking is default.
+ * configure: Regenerated.
+
+2001-02-27 Mark Mitchell <mark@codesourcery.com>
+
+ * configure.in: Make --disable-checking the default.
+ * configure: Regenerated.
+
+2001-02-26 Mark Mitchell <mark@codesourcery.com>
+
+ Revert the two previous changes.
+
+Sun Feb 25 08:34:23 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
+
+ * config/i386/i386-protos.h (ix86_set_move_mem_attrs): Move decl.
+ * config/i386/i386.c (ix86_set_move_mem_attrs_1): Fix typo.
+ * config/i386/i386.md (movstrsi): Handle FAIL case.
+
+Sat Feb 24 20:25:29 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
+
+ * config/i386/i386.c (ix86_set_move_mem_attrs): New function.
+ (ix86_set_move_mem_attrs_1): Likewise.
+ * config/i386/i386-protos.h (ix86_set_move_mem_attrs): New declaration.
+ * config/i386/i386.md (movstrsi): Call it.
+
+2001-02-24 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
+
+ * loop.c (check_dbra_loop): A biv has uses besides counting if it is
+ used to set another biv.
+
+Sat Feb 24 06:45:21 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
+
+ * errors.c (internal_error, trim_filename): New functions.
+ (fancy_abort): Call internal_error.
+ * errors.h (internal_error, trim_filename): New declarations.
+
+2001-02-24 Alexandre Oliva <aoliva@redhat.com>
+
+ * config/mn10300/mn10300.h (DBX_REGISTER_NUMBER): Reverted
+ 2000-08-26's patch.
+ (EXTRA_CONSTRAINT): Formatting changes.
+
+2001-02-23 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * rtl.c (rtl_check_failed_code2): Fix typo in last change.
+
+2001-02-23 Per Bothner <per@bothner.com>
+
+ * gcc.c (record_temp_file, pfatal_with_name, error): Make non-static,
+ so they can be called from java/jvspec.c.
+ * gcc.h (record_temp_file, pfatal_with_name, error): Declare.
+
+Fri Feb 23 15:28:39 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
+
+ * diagnostic.c (trim_filename): No longer static.
+ * toplev.h (trim_filename): Declare.
+ * rtl.c (rtl_check_failed_bounds): Call internal_error.
+ (rtl_check_failed_type1, rtl_check_failed_type2): Likewise.
+ (rtl_check_failed_code1, rtl_check_failed_code2): Likewise.
+ (rtvec_check_failed_bounds): Likewise.
+ * tree.c (tree_check_failed, tree_class_check_failed): Likewise.
+
+ * convert.c (convert_to_integer): Don't do unsigned unless result or
+ both inputs are unsigned.
+
+ * fold-const.c (fold_convert): Don't call size_int_type_wide if
+ input overflows.
+
+ * c-decl.c (set_block): Set NAMES and BLOCKS from BLOCK.
+
+ * varasm.c (output_constant): Recompute CODE after lang-specific fn.
+
+2001-02-23 Jakub Jelinek <jakub@redhat.com>
+
+ * fold-const.c (extract_muldiv) [case PLUS_EXPR]: If not MULT_EXPR,
+ check if either operand is divisible by C.
+ (multiple_of_p): Handle LSHIFT_EXPR with small constant shift.
+ If type is signed, consider negative numbers as well.
+
+2001-02-22 Richard Henderson <rth@redhat.com>
+
+ * config/ia64/crtbegin.asm (.fini): Use pc-relative relocs to
+ reach .text instead of gp-relative relocs.
+ * config/ia64/crtend.asm (.init): Likewise.
+
+2001-02-22 Andreas Jaeger <aj@suse.de>
+
+ * extend.texi (C++ Attributes): Fix typo.
+
+2001-02-21 David Mosberger <davidm@hpl.hp.com>
+
+ * config/ia64/ia64.c (ia64_epilogue_uses): For syscall_linkage
+ functions, drop current_function_args_info.words test.
+ (ia64_compute_frame_size): Mark syscall_linkage functions as
+ using eight input registers.
+
+2001-02-21 Loren J. Rittle <ljrittle@acm.org>
+ Bruce Korb <bkorb@gnu.org>
+
+ * fixinc/inclhack.def (freebsd_gcc3_breakage): new fix
+ * fixinc/README: Document how to convert sed substitutions
+ to format style c_fix-es.
+ * fixinc/fixincl.x: regen
+
+2001-02-21 Bruce Korb <bkorb@gnu.org>
+ Rodney Brown <RodneyBrown@mynd.com>
+
+ * fixinc/mkfixinc.sh: Use C fixincludes for UnixWare 7.
+ * fixinc/inclhack.def: Add fixinc.svr4 patterns with matching
+ machine restrictions
+ * fixinc/fixincl.x: regen
+
+2001-02-21 Neil Booth <neil@daikokuya.demon.co.uk>
+
+ * cppfiles.c: Update comments.
+ (_cpp_read_file): Don't check for NULL filenames any more.
+ * cppinit.c (cpp_start_read): Don't do canonicalization of
+ in_fname and out_fname. Use the passed file name exclusively.
+ (_cpp_handle_options): Don't treat "-" as a command line option,
+ but as a normal filename.
+ (_cpp_post_options): Canonicalize in_fname and out_fname.
+ * cppmain.c (printer_init): Don't check out_fname for NULL.
+ * c-lex.c (orig_filename): Rename cpp_filename for clarity.
+ (init_c_lex): Update, and use "" to represent stdin to CPP.
+ (yyparse): Update.
+
+2001-02-21 Kazu Hirata <kazu@hxi.com>
+
+ * config/h8300/h8300.md (iorsi3): Do not output an extra newline
+ character.
+ (xorsi3): Likewise.
+
+Wed Feb 21 19:16:26 CET 2001 Jan Hubicka <jh@suse.cz>
+
+ * i386.md (mmx_lshrdi3, mmx_ashldi3): Guard by unspec.
+
+2001-02-21 Jason Merrill <jason@redhat.com>
+
+ * tree.h (DECL_UNINLINABLE): Move from C++ frontend.
+ (struct tree_decl): Add uninlinable bitfield.
+ * c-decl.c (duplicate_decls): Set it.
+ * integrate.c (function_cannot_inline_p): Check it.
+
+ * dwarf2out.c (add_name_and_src_coords_attributes): Don't add
+ DW_AT_MIPS_linkage_name to abstract methods.
+ (dwarf2out_abstract_function): Emit class context before calling
+ set_decl_abstract_flags. Don't clear DECL_ABSTRACT.
+ (gen_subprogram_die): Remove obsolete code.
+ (gen_member_die): Don't include clones in the member list.
+ (gen_decl_die): Emit abstract info for clone origin.
+ * dwarfout.c (output_type): Don't include clones in the member list.
+ * dbxout.c (dbxout_type_methods): Ignore abstract methods.
+ * toplev.c (note_deferral_of_defined_inline_function): Don't clear
+ DECL_ABSTRACT on a function that already has it set.
+
+ * dwarf2out.c (gen_formal_types_die): Also accept a FUNCTION_DECL.
+ (get_subprogram_die): Pass it in.
+
+2001-02-21 Richard Earnshaw <rearnsha@arm.com>
+
+ * flow.c (mark_set_1): Make not_dead unsigned long. For
+ non-pseudos, use it as a bitmask of the hard regs that
+ don't die.
+
+2001-02-20 Will Cohen <wcohen@redhat.com>
+
+ * config/pa/quadlib.c (_U_Qfcnvfxt_quad_to_usgl): New function.
+ * config/pa/long_double.h (FIXUNS_TRUNCTFSI2_LIBCALL): Added.
+ (INIT_TARGET_OPTABS): Use FIXUNS_TRUNCTFSI2_LIBCALL for
+ fixunstfsi_libfunc.
+
+2001-02-20 Mark Mitchell <mark@codesourcery.com>
+
+ * stmt.c (expand_return): If an attempt is made to return the
+ error_mar_node, treat the return like a return without a value.
+
+Mon Feb 19 20:24:50 2001 Jeffrey A Law (law@cygnus.com)
+
+ * pa.c (move_operand): Accept code to load the address of a
+ symbol out of the DLT as a valid move operand.
+ (print_operand, case 'A'): New to handle generating a DLT
+ reference for a LO_SUM expression.
+ * pa.h (EXTRA_CONSTRAINT): Handle 'A' for DLT LO_SUM references.
+ * pa.md (movsi, movdi patterns): Allow DLT LO_SUM references.
+
+2001-02-19 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * README, cpp.texi, gcc.texi: Update version number to 3.0.
+ * cpp.1, gcov.1, gcc.1: Regenerate.
+
+2001-02-19 Richard Henderson <rth@redhat.com>
+
+ * ifcvt.c (dead_or_predicable): Don't move code if eh regions
+ would be disrupted.
+
+Mon Feb 19 10:11:53 2001 Jeffrey A Law (law@cygnus.com)
+
+ * config.gcc (hppa*64*-*-hpux11*): Add MASK_GAS to
+ target_cpu_default. Remove dead assignment to
+ target_cpu_default.
+
+Mon Feb 19 16:46:56 CET 2001 Jan Hubicka <jh@suse.cz>
+
+ * regclass.c (contains_reg_of_mode): Make global.
+ (init_reg_sets): Remove contains_reg_of_mode; take into account
+ CLASS_MAX_NREGS when looking for the proper mode.
+ (dump_regclass): Dump only classes considered for the pseudo.
+ (regclass): Use contains_reg_of_mode.
+
+Mon Feb 19 16:40:45 CET 2001 Jan Hubicka <jh@suse.cz>
+
+ * gcc.c (do_spec_1): 'n' for printing notices.
+ * i386.h (CC1_CPU_SPEC): Notice deprecated options as deprecated.
+
+Mon Feb 19 16:20:04 CET 2001 Jan Hubicka <jh@suse.cz>
+
+ * reg-stack.c (next_flags_user): Use current_block->end
+ (swap_rtx_condition): Look for next user if flags don't die;
+ give up on CALL_INSNs; use current_block->end.
+
+2001-02-17 Mark Mitchell <mark@codesourcery.com>
+
+ * invoke.texi (-fsquangle): Remove documentation.
+ (-fname-mangling-version): Likewise.
+
+2001-02-18 Kazu Hirata <kazu@hxi.com>
+
+ * config/h8300/h8300.md: Update copyright.
+ (andsi3): Do not output an extra newline character.
+
+Sun Feb 18 17:03:06 2001 Jeffrey A Law (law@cygnus.com)
+
+ * Makefile.in (rtlanal.o): Depend on hard-reg-set.h.
+ ($HOST_PREFIX_1)rtlanal.o: Remove rules for building
+ (mostlyclean): Corresponding changes.
+ * rtlanal.c (hard-reg-set.h): Include.
+ (rtx_unstable_p): Do not treat the argument pointer specially
+ if it is not a fixed register.
+ (rtx_varies_p, rtx_addr_can_trap_p): Similarly.
+
+Sun Feb 18 15:45:17 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
+
+ * config/sparc/sparc.c (eligible_for_epilogue_delay): Don't put
+ assignments from FP constants sonce 'Y' output code can't handle it.
+ (eligible_for_sibcall_delay): Likewise.
+
+ * invoke.texi (-I): Add note avoiding use for system header files.
+
+ * final.c (output_operand_lossage): Use internal_error, not error.
+
+2001-02-18 Shane Nay <shane@agendacomputing.com>
+
+ * mips.c (mips_expand_prologue) Add REG_MAYBE_DEAD to
+ structure shift insns.
+
+2001-02-18 Richard Henderson <rth@redhat.com>
+
+ * config/alpha/alpha.md (movsi_fix): Fix typo in pattern name.
+
+ * reload1.c (reload_cse_simplify_set): Fix typo.
+
+Sun Feb 18 09:30:09 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
+
+ * diagnostic.c (_fatal_insn): Decrement errorcount.
+
+2001-02-18 Alan Modra <alan@linuxcare.com.au>
+
+ * pa.c (hppa_expand_prologue): Simplify code storing return
+ pointer. For large (>=8k) frames with a post_store, adjust stack
+ pointer by 8k-64 first rather than by 64. When testing with
+ VAL_14_BITS_P, always use the actual value rather than the value
+ negated. Add blockage to prevent scheduling of spills before
+ stack frame has been created.
+ (hppa_expand_epilogue): Simplify code loading return pointer.
+ Allow a slightly larger range for merge_sp_adjust_with_load case.
+ When testing with VAL_14_BITS_P, always use the actual value.
+
+ * pa.c (pa_adjust_insn_length): Check that block move
+ pattern is a set before looking at operands.
+
+2001-02-17 Mark Mitchell <mark@codesourcery.com>
+
+ * fold-const.c (fold_binary_op_with_conditional_arg): New
+ function, split out from ...
+ (fold): ... here.
+ * tree.def (COND_EXPR): Document the use of VOID_TYPE for
+ conditional arms that throw exceptions.
+
+ * print-tree.c (print_node): Do not use BLOCK_CHAIN when we're not
+ looking at a BLOCK.
+
+2001-02-18 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * aclocal.m4 (gcc_AC_CHECK_DECL): Before attempting the test,
+ define HAVE_DECL_* to 1 to mask potential backup declarations.
+ * configure: Regenerated.
+
+2001-02-17 Richard Henderson <rth@redhat.com>
+
+ * reload1.c (reload_cse_simplify_set): Respect LOAD_EXTEND_OP
+ when replacing a memory load with a register.
+
+2001-02-17 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * gcc.texi, invoke.texi: Link to GCC 3.0 version of
+ c99status.html.
+
+2001-02-16 Richard Henderson <rth@redhat.com>
+ DJ Delorie <dj@redhat.com>
+
+ * jump.c (jump_optimize_1): When we delete a conditional jump
+ preceeding a non-conditional jump to effectively the same place,
+ make sure that the combined jump skips any clobber insns between
+ the two labels.
+
+2001-02-16 Jason Merrill <jason@redhat.com>
+
+ * dwarf2out.c (add_bound_info): Don't crash if SAVE_EXPR_RTL is
+ NULL.
+ (gen_subprogram_die): Don't abort on seeing a second definition if
+ the previous one was abstract. Don't replace an abstract instance
+ in the lookup table.
+
+ * dwarf2out.c (dwarf2out_abstract_function): Rename from
+ gen_abstract_function.
+ * dwarf2out.h: Declare it.
+ * toplev.c (note_outlining_of_inline_function): New fn.
+ * toplev.h: Declare it.
+ * integrate.c (output_inline_function): Call it.
+ * c-decl.c (duplicate_decls): Call it when redefining an extern
+ inline. Don't inline the new defn.
+
+ * tree.h (BLOCK_CHAIN): Use BLOCK_CHECK.
+
+2001-02-16 Jakub Jelinek <jakub@redhat.com>
+
+ * objc/objc-act.c (start_class): Register implemented_classes with
+ GC.
+
+2001-02-16 Neil Booth <neil@daikokuya.demon.co.uk>
+
+ * cppfiles.c (_cpp_make_system_header): Generate a file
+ change callback.
+
+Thu Feb 15 21:30:26 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
+
+ * flow.c (tidy_fallthru_edge): Never end block on line number NOTE.
+
+ * function.c (assign_parms): Set RTX_UNCHANGING_P in pseudo when we
+ do in memory.
+
+2001-02-15 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
+
+ * version.c: Bump to "3.0 20010215 (prerelease)".
+
+Thu Feb 15 15:15:29 2001 Alexandre Oliva <aoliva@redhat.com>
+
+ * config/sh/sh.h (BOOL_TYPE_SIZE): Don't define.
+
+Thu Feb 15 00:20:31 CET 2001 Jan Hubicka <jh@suse.cz>
+
+ * i386.h (RETURN_IN_MEMORY): Fix formating; reject TFmodes
+
+ * invoke.texi (-mreg-alloc): Deprecate.
+
+2001-02-14 Richard Henderson <rth@redhat.com>
+
+ * toplev.c (f_options): Clarify -fschedule-insns2 documentation.
+
+Wed Feb 14 23:35:57 CET 2001 Jan Hubicka <jh@suse.cz>
+
+ * regclass.c (init_reg_sets_1): Reinstall the optimization
+ together with Matt Kraai's fix.
+
+2001-02-14 Jeffrey Oldham <oldham@codesourcery.com>
+
+ * gcc.c (do_spec_1): Fix off-by-one error for '%M' case.
+
+2001-02-14 Richard Henderson <rth@redhat.com>
+
+ * regclass.c (init_reg_sets_1): Revert last change.
+
+2001-02-14 Nathan Sidwell <nathan@codesourcery.com>
+
+ * extend.texi (Deprecated): Deprecate new initializer lists.
+
+2001-02-14 Nathan Sidwell <nathan@codesourcery.com>
+
+ * mkdeps.c (deps_add_default_target): Robustify. Add
+ basename component only.
+ * cpp.texi (-M): Describe how default target is generated.
+ * invoke.texi (-M): Likewise.
+
+2001-02-13 Zack Weinberg <zack@wolery.stanford.edu>
+
+ * ggc-common.c (ggc_mark_rtx_children): No need to mark 'S' or
+ 's' slots in RTXen.
+ * ggc-page.c, ggc-simple.c (ggc_mark_if_gcable): Delete function.
+ * ggc.h (ggc_mark_if_gcable): Delete prototype.
+
+Wed Feb 14 01:03:14 CET 2001 Jan Hubicka <jh@suse.cz>
+
+ * regclass.c (init_reg_sets_1): Optimize calculation of move_cost
+ arrays.
+
+Tue Feb 13 07:52:04 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
+
+ * config/sparc/sparc.c (function_value): Treat all non-record
+ aggregate types like used to treat UNION_TYPE.
+
+2001-02-13 Alexandre Oliva <aoliva@redhat.com>
+
+ * combine.c (UWIDE_SHIFT_LEFT_BY_BITS_PER_WORD): New macro.
+ (try_combine): Use it.
+
+2001-02-13 Richard Henderson <rth@redhat.com>
+
+ * sparc.md (cmp_cc_arith_op_set): Don't use match_dup on the
+ entire operator; replicate that and match_dup the operands.
+ (cmp_ccx_arith_op_set): Likewise.
+ (cmp_cc_arith_op_not_set): Likewise.
+ (cmp_ccx_arith_op_not_set): Likewise.
+
2001-02-12 Jakub Jelinek <jakub@redhat.com>
* c-common.c (constant_fits_type_p): New function.
@@ -74,8 +7186,8 @@ Fri Feb 9 15:05:27 2001 Christopher Faylor <cgf@cygnus.com>
2001-02-09 Neil Booth <neil@daikokuya.demon.co.uk>
- * gcc.c (cpp_options): Delete .d files on error. Don't delete
- .o files when using the -M options.
+ * gcc.c (cpp_options): Delete .d files on error. Don't delete
+ .o files when using the -M options.
2001-02-08 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
David Edelsohn <edelsohn@gnu.org>
@@ -106,7 +7218,7 @@ Fri Feb 9 15:05:27 2001 Christopher Faylor <cgf@cygnus.com>
* config/rs6000/aix.h (ASM_OUTPUT_SYMBOL_REF): ... to here.
* config/rs6000/aix51.h (CPLUSCPLUS_CPP_SPEC): Define it.
(__WCHAR_TYPE__): Correct macro name.
-
+
2001-02-08 Richard Henderson <rth@redhat.com>
* config/i386/i386.c (ix86_frame_pointer_required): New.
@@ -164,11 +7276,11 @@ Thu Feb 8 11:21:28 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* defaults.h (CPLUSPLUS_CPP_SPEC): New macro.
* gcc.c (struct compiler): Add cpp_spec field.
(input_file_compiler): New variable.
- (do_spec_1): Allow a particular compiler to handle `%C'
+ (do_spec_1): Allow a particular compiler to handle `%C'
specially.
(main): Store the current compiler in input_file_compiler.
* tm.texi (CPLUSPLUS_CPP_SPEC): Document.
-
+
2001-02-07 Zack Weinberg <zack@wolery.stanford.edu>
* cpphash.h (struct spec_nodes): Add n_true and n_false.
@@ -237,7 +7349,7 @@ Thu Feb 8 11:21:28 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* config/rs6000/rs6000.c (VTABLE_NAME_P): New macro.
(rs6000_output_symbol_ref): New function.
(output_toc): Use VTABLE_NAME_P.
-
+
Tue Feb 6 07:54:51 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* print-tree.c (print_node, case PARM_DECL):
@@ -303,7 +7415,7 @@ Mon Feb 5 21:56:16 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
2001-02-05 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
David Edelsohn <edelsohn@gnu.org>
- * config/rs6000/rs6000.c (rs6000_return_addr): Use PIC
+ * config/rs6000/rs6000.c (rs6000_return_addr): Use PIC
code for AIX, even without flag_pic.
2001-02-05 Jakub Jelinek <jakub@redhat.com>
@@ -335,7 +7447,7 @@ Mon Feb 5 11:23:16 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
(protoize.o): Likewise.
(unprotoize.o): Likewise.
* configure.in: Recognize --enable-multilib.
-
+
2001-02-04 Mark Mitchell <mark@codesourcery.com>
* Makefile.in (DRIVER_DEFINES): Fix quoting.
@@ -372,7 +7484,7 @@ Sun Feb 4 15:52:44 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* config/mips/mips.c (save_restore_insns): Likewise.
* except.c (duplicate_eh_handlers): Call abort instead of fatal.
- * flow.c (verify_flow_info): Likewise.
+ * flow.c (verify_flow_info): Likewise.
* config/arm/arm.c (thumb_load_double_from_address): Likewise.
* config/avr/avr.c (pttreg_to_str, unique_section): Likewise.
(avr_normalize_condition): Likewise.
@@ -393,9 +7505,9 @@ Sun Feb 4 15:52:44 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* graph.c (clean_graph_dump_file): Likewise.
* profile.c (init_branch_prob): Likewise.
* objc/objc-act.c (objc_init): Likewise.
-
+
* config/arm/arm.c (arm_override_options): Make errors non-fatal.
- * config/avr/avr.c (avr_override_options): Likewise.
+ * config/avr/avr.c (avr_override_options): Likewise.
* config/c4x/c4x.c (c4x_expand_prologue): Likewise.
* config/dsp16xx/dsp16xx.c (function_prologue): Likewise.
* config/h8300/h8300.c (h8300_init_once): Likewise.
@@ -443,12 +7555,12 @@ Sun Feb 4 15:52:44 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
2001-02-03 Neil Booth <neil@daikokuya.demon.co.uk>
* cpphash.h: Rename _ALIGN POOL_ALIGN.
- * cpplex.c (new_chunk, _cpp_pool_reserve): Update.
+ * cpplex.c (new_chunk, _cpp_pool_reserve): Update.
2001-02-03 Neil Booth <neil@daikokuya.demon.co.uk>
* cpphash.h: Rename ALIGN _ALIGN.
- * cpplex.c (new_chunk, _cpp_pool_reserve): Update.
+ * cpplex.c (new_chunk, _cpp_pool_reserve): Update.
Fri Feb 2 23:15:29 2001 Christopher Faylor <cgf@cygnus.com>
@@ -514,14 +7626,14 @@ Fri Feb 2 20:03:50 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
2001-02-02 Mark Mitchell <mark@codesourcery.com>
- * gcc.c (init_gcc_specs): New function. Make -shared-libgcc
+ * gcc.c (init_gcc_specs): New function. Make -shared-libgcc
the default when building a shared object.
(init_spec): Use it.
* testsuite/lib/g++.exp: Include the directory where libgcc
is located to the LD_LIBRARY_PATH list.
* invoke.texi (-shared-libgcc): Document the cases in which
GCC defaults to using the shared libgcc.
-
+
2001-02-02 Alexandre Oliva <aoliva@redhat.com>
* config/fp-bit.h (MAX_USI_INT, MAX_SI_INT): Don't assume
@@ -653,7 +7765,7 @@ Thu Feb 1 07:22:41 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* cpphash.h (struct cpp_reader): New saved_flags.
* cppmacro.c (cpp_get_token): Use saved_flags to remember
to avoid a paste after a pasted token.
-
+
2001-01-31 Alexandre Oliva <aoliva@redhat.com>
* libgcc2.h (Wtype_MAX, Wtype_MIN): Define.
@@ -795,7 +7907,7 @@ Mon Jan 29 20:38:19 2001 Christopher Faylor <cgf@cygnus.com>
* cpphash.c (_cpp_cleanup_hashtable, _cpp_lookup_with_hash)
: Don't set fe_value.
- * cpplib.h (AVOID_LPASTE): New flag.
+ * cpplib.h (AVOID_LPASTE): New flag.
(struct cpp_hashnode): Remove fe_value.
* cpplex.c (cpp_avoid_paste): Don't paste '.' with a number.
* cppmacro.c (builtin_macro): Don't set flags here.
@@ -951,7 +8063,7 @@ Fri Jan 26 11:37:26 2001 Jeffrey A Law (law@cygnus.com)
(move_movables): Replace emit_call_insn_before with
loop_call_insn_hoist.
* loop.h (loop_insn_emit_before): Add.
- * unroll.c (copy_loop_body): Replace emit_insn_before with
+ * unroll.c (copy_loop_body): Replace emit_insn_before with
loop_insn_emit_before.
2001-01-25 Neil Booth <neil@daikokuya.demon.co.uk>
@@ -1112,7 +8224,7 @@ Wed Jan 24 23:51:55 2001 J"orn Rennecke <amylaar@redhat.com>
* c4x.c (c4x_r11_set_p): Calculate rtx code correctly.
2001-01-23 Chris Demetriou <cgd@sibyte.com>
- Neil Booth <neil@daikokuya.demon.co.uk>
+ Neil Booth <neil@daikokuya.demon.co.uk>
* cpperror.c: Merge handlers of PEDWARN and WARNING.
Have -Werror make pedantic warnings errors, like the
diff --git a/gcc/ChangeLog.1 b/gcc/ChangeLog.1
index a117c6c299c..85cf1422a6d 100644
--- a/gcc/ChangeLog.1
+++ b/gcc/ChangeLog.1
@@ -13,12 +13,12 @@ Tue May 18 03:53:37 1999 Craig Burley <craig@jcb-sc.com>
Tue May 18 00:51:46 1999 Krister Walfridsson <cato@df.lth.se>
- * configure.in (arm*-*-netbsd*): Use collect2.
- (i[34567]86-*-netbsd*): Likewise.
- (m68k*-*-netbsd*): Likewise.
- (ns32k-*-netbsd*): Likewise.
- (sparc-*-netbsd*): Likewise.
- (vax-*-netbsd*): Likewise.
+ * configure.in (arm*-*-netbsd*): Use collect2.
+ (i[34567]86-*-netbsd*): Likewise.
+ (m68k*-*-netbsd*): Likewise.
+ (ns32k-*-netbsd*): Likewise.
+ (sparc-*-netbsd*): Likewise.
+ (vax-*-netbsd*): Likewise.
* configure: Rebuilt.
Tue May 18 00:21:34 1999 Zack Weinberg <zack@rabi.phys.columbia.edu>
@@ -57,9 +57,9 @@ Mon May 17 19:45:41 1999 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
Mon May 17 07:23:34 1999 Mark Mitchell <mark@codesourcery.com>
* tree.def (TYPE_NONCOPIED_PARTS): Revise documentation to match
- reality.
- * expr.c (init_noncopied_parts): Don't generate initializers for
- parts that don't need them.
+ reality.
+ * expr.c (init_noncopied_parts): Don't generate initializers for
+ parts that don't need them.
Mon May 17 02:56:35 PDT 1999 Jeff Law (law@cygnus.com)
@@ -118,7 +118,7 @@ Sat May 15 14:09:08 1999 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
Fri May 14 21:31:36 1999 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
* config/c4x/c4x.md (*umulqi3_highpart_clobber): Fix operand 2
- constraints order.
+ constraints order.
1999-05-14 Ulrich Drepper <drepper@cygnus.com>
@@ -159,10 +159,10 @@ Thu May 13 01:31:19 1999 Nick Burrett <nick.burrett@btinternet.com>
Wed May 12 18:08:48 1999 David Edelsohn <edelsohn@gnu.org>
Richard Henderson <rth@cygnus.com>
- * rs6000.c (print_operand) [w]: Calculate signed constant more clearly.
- (rs6000_allocate_stack_space): Print as hexadecimal value.
- * rs6000.h (CONST_OK_FOR_LETTER_P): 'L' checks for a signed,
- 16-bit shifted constant. Fix typo for 'P'.
+ * rs6000.c (print_operand) [w]: Calculate signed constant more clearly.
+ (rs6000_allocate_stack_space): Print as hexadecimal value.
+ * rs6000.h (CONST_OK_FOR_LETTER_P): 'L' checks for a signed,
+ 16-bit shifted constant. Fix typo for 'P'.
(EXTRA_CONSTARINT): 'T' checks for a 32-bit mask operand.
* rs6000.md (movsi, addsi3_internal1, movdi, adddi3_internal1):
Use 'L' for shifted constant.
@@ -338,8 +338,8 @@ Sat May 8 01:25:09 1999 Andreas Schwab <schwab@issan.cs.uni-dortmund.de>
Fri May 7 19:10:15 1999 Vladimir Makarov <vmakarov@tofu.to.cygnus.com>
* sparc.h (GO_IF_LEGITIMATE_ADDRESS): Prohibit REG+REG addressing
- for TFmode when there are no instructions which accept REG+REG
- instructions.
+ for TFmode when there are no instructions which accept REG+REG
+ instructions.
Fri May 7 12:38:54 1999 Jim Wilson <wilson@cygnus.com>
@@ -400,10 +400,10 @@ Wed May 5 23:44:15 1999 J"orn Rennecke <amylaar@cygnus.co.uk>
Wed May 5 16:26:13 1999 Vladimir Makarov <vmakarov@tofu.to.cygnus.com>
* function.c (purge_addressof_replacements): Rename into
- purge_bitfield_addressof_replacements.
+ purge_bitfield_addressof_replacements.
(purge_addressof_replacements): New variable.
(purge_addressof_1): Add code for changing addressof in notes for
- field values which are extracted by usage MEM with narrower mode.
+ field values which are extracted by usage MEM with narrower mode.
(purge_addressof): Initialize purge_bitfield_addressof_replacements.
Wed May 5 07:40:02 1999 Nick Clifton <nickc@cygnus.com>
@@ -620,12 +620,12 @@ Mon Apr 26 23:28:54 1999 Mumit Khan <khan@xraylith.wisc.edu>
(store_one_arg): Change ptr_mode to Pmode in
setup for chkr_set_right_libfunc.
- * c-parse.in (absdcl1): Allow attributes in explicit typespecs.
- (%expect): Update.
- * c-parse.y: Regenerate.
- * c-parse.c: Likewise.
- * objc/objc-parse.c: Likewise.
- * objc/objc-parse.y: Likewise.
+ * c-parse.in (absdcl1): Allow attributes in explicit typespecs.
+ (%expect): Update.
+ * c-parse.y: Regenerate.
+ * c-parse.c: Likewise.
+ * objc/objc-parse.c: Likewise.
+ * objc/objc-parse.y: Likewise.
Mon Apr 26 21:17:41 1999 Jason Merrill <jason@yorick.cygnus.com>
@@ -745,12 +745,12 @@ Mon Apr 26 00:58:54 1999 Jerry Quinn <jquinn@nortelnetworks.com>
Mon Apr 26 00:28:25 1999 Theodore Papadopoulo <Theodore.Papadopoulo@sophia.inria.fr>
- * flags.h (inline_max_insns): Declare.
- * integrate.c (inline_max_insns): New variable.
- (function_cannot_inline_p): Use it.
- * toplev.c (main): Add the flag -finline-limit-n.
- (display_help): Document -finline-limit-n.
- * invoke.texi: Document -finline-limit-n
+ * flags.h (inline_max_insns): Declare.
+ * integrate.c (inline_max_insns): New variable.
+ (function_cannot_inline_p): Use it.
+ * toplev.c (main): Add the flag -finline-limit-n.
+ (display_help): Document -finline-limit-n.
+ * invoke.texi: Document -finline-limit-n
Sun Apr 25 23:03:32 1999 Richard Henderson <rth@cygnus.com>
@@ -901,7 +901,7 @@ Tue Apr 20 16:38:11 1999 Richard Henderson <rth@cygnus.com>
Tue Apr 20 17:57:14 1999 Catherine Moore <clm@cygnus.com>
- * config/arm/arm.md (movhi): Add check for odd offset.
+ * config/arm/arm.md (movhi): Add check for odd offset.
Tue Apr 20 13:14:58 EDT 1999 John Wehle (john@feith.com)
@@ -986,13 +986,13 @@ Sat Apr 17 21:30:11 1999 Bernd Schmidt <crux@pool.informatik.rwth-aachen.de>
Sat Apr 17 21:10:10 1999 Jan Hubicka <hubicka@freesoft.cz>
- * i386.c (i386_preferred_stack_boundary_string): New global variable.
- (i386_preferred_stack_boundary): New global variable.
- (override_functions): Set it. Tidy option setting code.
- * i386.h (TARGET_OPTIONS): New command line option.
- (i386_preferred_stack_boundary_string): Declare it.
- (i386_preferred_stack_boundary): Likewise.
- (PREFERRED_STACK_BOUNDARY): Use i386_preferred_stack_boundary.
+ * i386.c (i386_preferred_stack_boundary_string): New global variable.
+ (i386_preferred_stack_boundary): New global variable.
+ (override_functions): Set it. Tidy option setting code.
+ * i386.h (TARGET_OPTIONS): New command line option.
+ (i386_preferred_stack_boundary_string): Declare it.
+ (i386_preferred_stack_boundary): Likewise.
+ (PREFERRED_STACK_BOUNDARY): Use i386_preferred_stack_boundary.
Sat Apr 17 19:22:38 1999 Jan Hubicka <hubicka@freesoft.cz>
@@ -1000,11 +1000,11 @@ Sat Apr 17 19:22:38 1999 Jan Hubicka <hubicka@freesoft.cz>
Sat Apr 17 19:13:22 1999 Donn Terry <donn@interix.com>
- * i386.h (PRINT_OPERAND_PUNCT_VALID_P): Allow _.
- * i386.c (print_operand): New %_ operator.
+ * i386.h (PRINT_OPERAND_PUNCT_VALID_P): Allow _.
+ * i386.c (print_operand): New %_ operator.
(load_pic_register): Proper number of leading _ in GOT literal.
- * i386.md (prologue_get_pc_and_set_got): Likewise.
- * i386/unix.h (ASM_OUTPUT_MI_THUNK): Likewise.
+ * i386.md (prologue_get_pc_and_set_got): Likewise.
+ * i386/unix.h (ASM_OUTPUT_MI_THUNK): Likewise.
Sat Apr 17 19:13:07 1999 Richard Henderson <rth@cygnus.com>
@@ -1097,12 +1097,12 @@ Thu Apr 15 23:13:35 1999 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
Thu Apr 15 02:45:19 1999 Mumit Khan <khan@xraylith.wisc.edu>
- * aclocal.m4 (GCC_FUNC_MKDIR_TAKES_ONE_ARG): Define.
- * configure.in: Use.
- * configure: Rebuilt.
- * acconfig.h (MKDIR_TAKES_ONE_ARG): Add.
- * config.in: Rebuilt.
- * system.h: Use.
+ * aclocal.m4 (GCC_FUNC_MKDIR_TAKES_ONE_ARG): Define.
+ * configure.in: Use.
+ * configure: Rebuilt.
+ * acconfig.h (MKDIR_TAKES_ONE_ARG): Add.
+ * config.in: Rebuilt.
+ * system.h: Use.
Thu Apr 15 01:03:21 1999 Jan Hubicka <hubicka@freesoft.cz>
Jeff Law <law@cygnus.com>
diff --git a/gcc/ChangeLog.3 b/gcc/ChangeLog.3
index feb39cdb4bc..03278d86b98 100644
--- a/gcc/ChangeLog.3
+++ b/gcc/ChangeLog.3
@@ -1403,7 +1403,7 @@ Tue Jun 6 19:25:32 2000 Philippe De Muyter <phdm@macqel.be>
2000-06-06 Nathan Sidwell <nathan@codesourcery.com>
- * eh-common.h (EH_ALLOC_SIZE, EH_ALLOC_ALIGN): New #defines.
+ * eh-common.h (EH_ALLOC_SIZE, EH_ALLOC_ALIGN): New #defines.
(eh_context): Add alloc_mask and alloc_buffer emergency fallback
space.
* libgcc2.c (__eh_alloc): Moved from cp/exception.cc. Fallback on
@@ -3302,33 +3302,33 @@ Wed May 17 18:06:12 2000 John David Anglin <dave@hiauly1.hia.nrc.ca>
Wed May 17 17:27:44 2000 Andrew Cagney <cagney@b1.cygnus.com>
* flags.h (warn_unused_function, warn_unused_label,
- warn_unused_parameter, warn_unused_variable, warn_unused_value):
- Replace ``warn_unused''.
+ warn_unused_parameter, warn_unused_variable, warn_unused_value):
+ Replace ``warn_unused''.
(set_Wunused): Add declaration.
* toplev.c (set_Wunused): New function.
(warn_unused_function, warn_unused_label, warn_unused_parameter,
- warn_unused_variable, warn_unused_value): New variables.
+ warn_unused_variable, warn_unused_value): New variables.
(W_options): Add -Wunused-function, -Wunused-function,
- -Wunused-label, -Wunused-parameter, -Wunused-variable and
- -Wunused-value. Delete -Wunused. Handled in decode_W_option.
+ -Wunused-label, -Wunused-parameter, -Wunused-variable and
+ -Wunused-value. Delete -Wunused. Handled in decode_W_option.
* toplev.c (decode_W_option): Update -Wunused flags by calling
- set_Wunused.
- * c-decl.c (c_decode_option): Ditto for -Wall.
+ set_Wunused.
+ * c-decl.c (c_decode_option): Ditto for -Wall.
* stmt.c (expand_expr_stmt, expand_expr_stmt,
- warn_about_unused_variables): Replace warn_unused with more
- explicit warn_unused_value et.al.
+ warn_about_unused_variables): Replace warn_unused with more
+ explicit warn_unused_value et.al.
* function.c (expand_function_end): Ditto.
* c-typeck.c (internal_build_compound_expr,
- internal_build_compound_expr): Ditto.
+ internal_build_compound_expr): Ditto.
* c-decl.c (poplevel, pop_label_level): Ditto.
* toplev.c (check_global_declarations): Replace warn_unused with
check for either warn_unused_function or warn_unused_variable.
* gcc.1, invoke.texi (Warning Options): Document
- -Wunused-function, -Wunused-function, -Wunused-label,
- -Wunused-parameter, -Wunused-variable and -Wunused-value options.
+ -Wunused-function, -Wunused-function, -Wunused-label,
+ -Wunused-parameter, -Wunused-variable and -Wunused-value options.
Wed May 17 10:28:12 2000 Philippe De Muyter <phdm@macqel.be>
@@ -3941,7 +3941,7 @@ Tue May 9 22:28:03 2000 Denis Chertykov <denisc@overta.ru>
Tue May 9 20:52:43 2000 Denis Chertykov <denisc@overta.ru>
- * config/avr/avr-protos.h (extra_constraint): change a type of
+ * config/avr/avr-protos.h (extra_constraint): change a type of
second argument from char to int to avoid warnings.
(asm_output_byte): Likewise.
@@ -4255,15 +4255,15 @@ Sun May 7 00:54:57 EDT 2000 John Wehle (john@feith.com)
2000-05-06 Zack Weinberg <zack@wolery.cumb.org>
- * cpphash.h: Remove conditional #define of __extension__.
- * rtl.h: Add __extension__ to RTL_CHECK1, RTL_CHECK2,
- RTL_CHECKC1, RTL_CHECKC2, and RTVEC_ELT macros
- (ENABLE_RTL_CHECKING only).
- * tree.h: Add __extension__ to TREE_CHECK, TREE_CLASS_CHECK,
- CST_OR_CONSTRUCTOR_CHECK, and EXPR_CHECK macros
- (ENABLE_TREE_CHECKING only).
- * varray.h: Add __extension__ to VARRAY_CHECK macro
- (ENABLE_CHECKING only).
+ * cpphash.h: Remove conditional #define of __extension__.
+ * rtl.h: Add __extension__ to RTL_CHECK1, RTL_CHECK2,
+ RTL_CHECKC1, RTL_CHECKC2, and RTVEC_ELT macros
+ (ENABLE_RTL_CHECKING only).
+ * tree.h: Add __extension__ to TREE_CHECK, TREE_CLASS_CHECK,
+ CST_OR_CONSTRUCTOR_CHECK, and EXPR_CHECK macros
+ (ENABLE_TREE_CHECKING only).
+ * varray.h: Add __extension__ to VARRAY_CHECK macro
+ (ENABLE_CHECKING only).
2000-05-06 Richard Earnshaw (reanrsha@arm.com)
@@ -5280,7 +5280,7 @@ Fri Apr 28 16:30:33 2000 Marc Espie <espie@cvs.openbsd.org>
2000-04-27 Ulrich Drepper <drepper@cygnus.com>
* i386.h (FUNCTION_BLOCK_PROFILER_EXIT): Generate mem reference
- for call instruction with mode QImode.
+ for call instruction with mode QImode.
2000-04-27 Alex Samuel <samuel@codesourcery.com>
@@ -5637,7 +5637,7 @@ Tue Apr 25 16:16:04 2000 Andrew MacLeod <amacleod@cygnus.com>
* config/ia64/ia64.c (ia64_compute_frame_size): Don't include pr_size
in fr_pad_size calculation.
(save_restore_insns): Move PR save area. Correct uses of
- RTX_FRAME_RELATED_P.
+ RTX_FRAME_RELATED_P.
(ia64_expand_prologue): Mark alloc with RTX_FRAME_RELATED_P.
(ia64_expand_epilogue): Add eh_epilogue support.
(ia64_function_prologue): Emit .prologue directive.
diff --git a/gcc/ChangeLog.4 b/gcc/ChangeLog.4
index 8e324a411e8..f450baa55ec 100644
--- a/gcc/ChangeLog.4
+++ b/gcc/ChangeLog.4
@@ -210,8 +210,8 @@
2000-12-27 Chandrakala Chavva <cchavva@redhat.com>
* calls.c (store_one_arg): If parm is passed both in stack and in
- register and offset is greater than reg_parm_stack_space, split
- the offset and call emit_push_insn().
+ register and offset is greater than reg_parm_stack_space, split
+ the offset and call emit_push_insn().
2000-12-27 Nick Clifton <nickc@redhat.com>
@@ -354,8 +354,8 @@
2000-12-22 Graham Stott <grahams@redhat.com>
* reload.c (update_auto_inc_notes): New, broken out from ...
- (find_reloads_address_1): ... use here, also correct possible
- use of uninitialised reloadnum.
+ (find_reloads_address_1): ... use here, also correct possible
+ use of uninitialised reloadnum.
2000-12-21 David O'Brien <obrien@FreeBSD.org>
@@ -636,24 +636,24 @@ Tue Dec 19 00:37:08 2000 J"orn Rennecke <amylaar@redhat.com>
2000-12-18 Neil Booth <neil@daikokuya.demon.co.uk>
- * cppmain.c: Update print.lineno with -P.
+ * cppmain.c: Update print.lineno with -P.
2000-12-18 Neil Booth <neil@daikokuya.demon.co.uk>
- * c-lex.c: s/change_file/file_change.
- * cpplib.h: Similarly.
- * cppmain.c: Similarly.
- * fix-header.c: Similarly.
- * cppfiles.c (stack_include_file): Pass the buffer location and
- size to cpp_push_buffer. Generate the file_change callback,
- so that sysp is already set.
- * cpphash.h: Add _cpp_do_file_change.
- * cpplib.c (do_line): Set buffer->sysp directly. Generate the
- file_change callback after setting sysp.
- (_cpp_do_file_change): Handle FC_ENTER and the FC_RENAME exception
- here.
- (cpp_push_buffer): Don't generate a callback. Clear sysp.
- (cpp_pop_buffer): Clean up logic.
+ * c-lex.c: s/change_file/file_change.
+ * cpplib.h: Similarly.
+ * cppmain.c: Similarly.
+ * fix-header.c: Similarly.
+ * cppfiles.c (stack_include_file): Pass the buffer location and
+ size to cpp_push_buffer. Generate the file_change callback,
+ so that sysp is already set.
+ * cpphash.h: Add _cpp_do_file_change.
+ * cpplib.c (do_line): Set buffer->sysp directly. Generate the
+ file_change callback after setting sysp.
+ (_cpp_do_file_change): Handle FC_ENTER and the FC_RENAME exception
+ here.
+ (cpp_push_buffer): Don't generate a callback. Clear sysp.
+ (cpp_pop_buffer): Clean up logic.
2000-12-18 Benjamin Kosnik <bkoz@redhat.com>
@@ -667,11 +667,11 @@ Tue Dec 19 00:37:08 2000 J"orn Rennecke <amylaar@redhat.com>
2000-12-18 Neil Booth <neil@daikokuya.demon.co.uk>
- * c-lex.c (lex_lineno): Remove.
- (init_c_lex, c_lex): Remove lex_lineno.
- (cb_change_file): Update lineno correctly, both before calling
- push_srcloc and before leaving the function.
- (cb_def_pragma): Set lineno before outputting diagnostics.
+ * c-lex.c (lex_lineno): Remove.
+ (init_c_lex, c_lex): Remove lex_lineno.
+ (cb_change_file): Update lineno correctly, both before calling
+ push_srcloc and before leaving the function.
+ (cb_def_pragma): Set lineno before outputting diagnostics.
Sun Dec 17 18:45:41 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
@@ -681,15 +681,15 @@ Sun Dec 17 18:45:41 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
2000-12-17 Neil Booth <neil@daikokuya.demon.co.uk>
- * cpplib.h (struct cpp_reader): Remove references to string_pool
- and temp_string_pool.
- * cppinit.c (cpp_create_reader, cpp_cleanup): Similarly; using
- ident_pool in place.
- * cpplex.c (parse_number, unescaped_terminator_p, parse_string,
- save_comment, cpp_token_as_text): Similarly.
- * cpplib.c (do_define, glue_header_name, parse_assertion): Similarly.
- * cppmacro.c (make_number_token, builtin_macro, lock_pools,
- unlock_pools, stringify_arg, paste_tokens): Similarly.
+ * cpplib.h (struct cpp_reader): Remove references to string_pool
+ and temp_string_pool.
+ * cppinit.c (cpp_create_reader, cpp_cleanup): Similarly; using
+ ident_pool in place.
+ * cpplex.c (parse_number, unescaped_terminator_p, parse_string,
+ save_comment, cpp_token_as_text): Similarly.
+ * cpplib.c (do_define, glue_header_name, parse_assertion): Similarly.
+ * cppmacro.c (make_number_token, builtin_macro, lock_pools,
+ unlock_pools, stringify_arg, paste_tokens): Similarly.
Sun Dec 17 12:41:48 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
@@ -704,10 +704,10 @@ Sun Dec 17 12:41:48 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
2000-12-17 Neil Booth <neil@daikokuya.demon.co.uk>
- * cppmain.c (check_multiline_token): New function.
- (scan_buffer): Use it.
- (cb_change_file): Restructure to avoid warning.
- * cpperror.c (print_location): Initialize col.
+ * cppmain.c (check_multiline_token): New function.
+ (scan_buffer): Use it.
+ (cb_change_file): Restructure to avoid warning.
+ * cpperror.c (print_location): Initialize col.
2000-12-14 Philipp Thomas <pthomas@suse.de>
@@ -739,21 +739,21 @@ Sun Dec 17 12:41:48 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
2000-12-17 Neil Booth <neil@daikokuya.demon.co.uk>
- * c-lex.c: Move main_input_filename handling to FC_ENTER. Clean up.
- * cpperror.c (print_containing_files): Get right line number.
- (print_location): Output column of 1 if 0.
- * cppfiles.c (stack_include_file): cpp_push_buffer handles
- the callback.
- * cpphash.h (_cpp_do_file_change): No longer external.
- * cpplib.c (do_file_change): Now local to cpplib.c.
- (do_line): Fake a buffer stack for preprocessed files.
- (cpp_push_buffer): Create a file_change callback. Handle faked
- buffers.
- (cpp_pop_buffer): Similarly.
- * cpplib.h: BUF_FAKE: New buffer type.
- * cppmain.c: Update to handle correct file renaming where a
- #line is the first line of the main file, and produce only
- the renamed file, not the original file, as output.
+ * c-lex.c: Move main_input_filename handling to FC_ENTER. Clean up.
+ * cpperror.c (print_containing_files): Get right line number.
+ (print_location): Output column of 1 if 0.
+ * cppfiles.c (stack_include_file): cpp_push_buffer handles
+ the callback.
+ * cpphash.h (_cpp_do_file_change): No longer external.
+ * cpplib.c (do_file_change): Now local to cpplib.c.
+ (do_line): Fake a buffer stack for preprocessed files.
+ (cpp_push_buffer): Create a file_change callback. Handle faked
+ buffers.
+ (cpp_pop_buffer): Similarly.
+ * cpplib.h: BUF_FAKE: New buffer type.
+ * cppmain.c: Update to handle correct file renaming where a
+ #line is the first line of the main file, and produce only
+ the renamed file, not the original file, as output.
2000-12-17 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
@@ -774,7 +774,7 @@ Sun Dec 17 12:41:48 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
Herman A.J. ten Brugge <Haj.Ten.Brugge@net.HCC.nl>
* config/c4x/c4x.h (MD_INIT_BUILTINS): Add void_list_node argument
- to c4x_init_builtins.
+ to c4x_init_builtins.
* config/c4x/c4x-protos.h (c4x_init_builtins): Add tree argument.
@@ -837,12 +837,12 @@ Sat Dec 16 10:41:11 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
2000-12-16 Neil Booth <neil@daikokuya.demon.co.uk>
- * tradcpp.c: T_WARNING: New.
- (do_warning): New function.
- (finclude): Skip past the newline and increase the line number
- before calling output_line_command.
- (do_line): Skip the new line after output_line_command. Don't
- pre-decrement the line number.
+ * tradcpp.c: T_WARNING: New.
+ (do_warning): New function.
+ (finclude): Skip past the newline and increase the line number
+ before calling output_line_command.
+ (do_line): Skip the new line after output_line_command. Don't
+ pre-decrement the line number.
2000-12-15 Diego Novillo <dnovillo@redhat.com>
@@ -926,16 +926,16 @@ Fri Dec 15 03:37:51 2000 J"orn Rennecke <amylaar@redhat.com>
2000-12-14 Neil Booth <neil@daikokuya.demon.co.uk>
- * gcc.c (cpp_options): Update to use '&'.
- (struct switchstr): Change type of validated to save space.
- New member 'ordering'.
- (handle_braces, validate_switches): Update to handle '&'.
+ * gcc.c (cpp_options): Update to use '&'.
+ (struct switchstr): Change type of validated to save space.
+ New member 'ordering'.
+ (handle_braces, validate_switches): Update to handle '&'.
2000-12-13 Laurynas Biveinis <lauras@softhome.net>
- * fixinc/inclhack.def: skip stdio_va_list fix if __DJ_va_list
- found in a header.
- * fixinc/fixincl.x: regenerated.
+ * fixinc/inclhack.def: skip stdio_va_list fix if __DJ_va_list
+ found in a header.
+ * fixinc/fixincl.x: regenerated.
2000-12-13 DJ Delorie <dj@redhat.com>
@@ -970,25 +970,25 @@ Fri Dec 15 03:37:51 2000 J"orn Rennecke <amylaar@redhat.com>
2000-12-13 Neil Booth <neil@daikokuya.demon.co.uk>
- * tradcpp.c (special_symbol): Improve test for definedness,
- though it is still not perfect.
- (do_define): Don't define illegal macro names.
+ * tradcpp.c (special_symbol): Improve test for definedness,
+ though it is still not perfect.
+ (do_define): Don't define illegal macro names.
2000-12-07 Aldy Hernandez <aldyh@redhat.com>
- * config/mips/elf.h (ASM_OUTPUT_SECTION_NAME): emit @nobits
- if changing into .bss section.
- * config/mips/elf64.h: same.
- * config/mips/iris6.h: same.
- * config/mips/netbsd.h: same.
- * config/mips/openbsd.h: same.
+ * config/mips/elf.h (ASM_OUTPUT_SECTION_NAME): emit @nobits
+ if changing into .bss section.
+ * config/mips/elf64.h: same.
+ * config/mips/iris6.h: same.
+ * config/mips/netbsd.h: same.
+ * config/mips/openbsd.h: same.
2000-12-13 Neil Booth <neil@daikokuya.demon.co.uk>
- * cppfiles.c (read_name_map): Return null if open () fails.
- (remap_filename): Simplify logic. Add ICE if it doesn't work
- as expected. Perform secondary lookup attempt on base filename
- only.
+ * cppfiles.c (read_name_map): Return null if open () fails.
+ (remap_filename): Simplify logic. Add ICE if it doesn't work
+ as expected. Perform secondary lookup attempt on base filename
+ only.
Wed Dec 13 19:48:04 MET 2000 Jan hubicka <jh@suse.cz>
@@ -1010,8 +1010,8 @@ Wed Dec 13 17:25:32 MET 2000 Jan Hubicka <jh@suse.cz>
2000-12-12 Brad Lucier <lucier@math.purdue.edu>
- * tradcpp.c (do_error): Cast difference of pointers to int
- for error message.
+ * tradcpp.c (do_error): Cast difference of pointers to int
+ for error message.
2000-12-12 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
@@ -1035,9 +1035,9 @@ Wed Dec 13 17:25:32 MET 2000 Jan Hubicka <jh@suse.cz>
2000-12-12 Neil Booth <neil@daikokuya.demon.co.uk>
- * tradcpp.c (enum node_type): Add T_ERROR.
- (do_error): New function.
- (directive_table): Add #error handler.
+ * tradcpp.c (enum node_type): Add T_ERROR.
+ (do_error): New function.
+ (directive_table): Add #error handler.
2000-12-12 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
@@ -4493,7 +4493,7 @@ Wed Nov 8 21:53:41 MET 2000 Jan Hubicka <jh@suse.cz>
2000-11-07 Neil Booth <neilb@earthling.net>
- * cp/lang-specs.h: Fix -save-temps specs under USE_CPPLIB.
+ * cp/lang-specs.h: Fix -save-temps specs under USE_CPPLIB.
2000-11-07 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
diff --git a/gcc/ChangeLog.lib b/gcc/ChangeLog.lib
index 7e03e765521..5eb4fa28112 100644
--- a/gcc/ChangeLog.lib
+++ b/gcc/ChangeLog.lib
@@ -1,6 +1,6 @@
Wed Jan 1 17:54:47 1998 J.J. van der Heijden <J.J.vanderHeijden@student.utwente.nl>
- * pexecute.c (pexecute, [_WIN32]): Yes, mask termstat for mingw32.
+ * pexecute.c (pexecute, [_WIN32]): Yes, mask termstat for mingw32.
Mon Dec 22 18:59:34 1997 Pascal Obry <pascal.obry@der.edfgdf.fr>
@@ -74,7 +74,7 @@ Tue Sep 9 18:23:57 1997 Doug Evans <dje@cygnus.com>
1997-08-08 Paul Eggert <eggert@twinsun.com>
* choose-temp.c, pexecute.c:
- Include "config.h" first, as per autoconf manual.
+ Include "config.h" first, as per autoconf manual.
1997-08-01 Richard Stallman <rms@psilocin.gnu.ai.mit.edu>
@@ -208,7 +208,7 @@ Wed Jan 15 22:36:59 1997 Jim Meyering <meyering@kropotkin.gnu.ai.mit.edu>
Tue Jan 7 14:29:37 1997 David J. MacKenzie <djm@geech.gnu.ai.mit.edu>
* config.guess: Add hppa1.1-hitachi-hiuxmpp support, passed along
- by rms.
+ by rms.
Sat Jan 4 22:43:21 1997 Miles Bader <miles@gnu.ai.mit.edu>
@@ -312,7 +312,7 @@ Fri Nov 8 11:34:58 1996 David J. MacKenzie <djm@geech.gnu.ai.mit.edu>
LynxOs is not a hardware supplier.
* config.guess: Contributions from bug-gnu-utils to add support for:
- OpenBSD like NetBSD.
+ OpenBSD like NetBSD.
Stratus systems.
More Pyramid systems.
i[n>4]86 Intel chips.
@@ -385,7 +385,7 @@ Fri Jun 28 13:29:05 1996 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
Tue Jun 25 22:43:48 1996 Doug Evans <dje@cygnus.com>
- * pexecute.c (PEXECUTE_VERBOSE): Define.
+ * pexecute.c (PEXECUTE_VERBOSE): Define.
(MPW pexecute): Check flags & PEXECUTE_VERBOSE instead of verbose_flag.
Mon Jun 24 14:32:22 1996 Jim Wilson <wilson@cygnus.com>
@@ -434,7 +434,7 @@ Wed May 22 17:20:59 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
Tue May 21 18:55:59 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* config.sub: Restore `hp9k2[0-9][0-9] | hp9k31[0-9])' case line
- apparently accidentally removed in the last change.
+ apparently accidentally removed in the last change.
Mon May 20 11:58:15 1996 Jeffrey A. Law <law@cygnus.com>
@@ -442,8 +442,8 @@ Mon May 20 11:58:15 1996 Jeffrey A. Law <law@cygnus.com>
Fri May 3 02:35:56 1996 Noah Friedman <friedman@prep.ai.mit.edu>
- * mkinstalldirs: Don't report an error if mkdir fails because
- a directory was created by another process.
+ * mkinstalldirs: Don't report an error if mkdir fails because
+ a directory was created by another process.
Sun Apr 21 09:50:09 1996 Stephen L Moshier (moshier@world.std.com)
@@ -452,9 +452,9 @@ Sun Apr 21 09:50:09 1996 Stephen L Moshier (moshier@world.std.com)
Tue Apr 9 14:37:31 1996 Ulrich Drepper <drepper@cygnus.com>
* obstack.h [__STDC__] (obstack_init, obstack_begin,
- obstack_specify_allocation, obstack_specify_allocation_with_arg,
- obstack_chunkfun, obstack_freefun): Duplicate definition with complete
- type cast.
+ obstack_specify_allocation, obstack_specify_allocation_with_arg,
+ obstack_chunkfun, obstack_freefun): Duplicate definition with complete
+ type cast.
Wed Apr 17 14:28:43 1996 Doug Evans <dje@cygnus.com>
@@ -544,7 +544,7 @@ Thu Feb 22 15:51:09 1996 Karl Heuer <kwzh@gnu.ai.mit.edu>
Tue Feb 13 13:20:32 1996 Miles Bader <miles@gnu.ai.mit.edu>
* getopt.c (_getopt_internal): Give FIRST_NONOPT & LAST_NONOPT
- rational values if OPTIND has been moved back by the user.
+ rational values if OPTIND has been moved back by the user.
Mon Feb 12 18:23:35 1996 Doug Evans <dje@cygnus.com>
@@ -714,7 +714,7 @@ Fri Aug 4 10:27:54 1995 Jim Meyering (meyering@comco.com)
Tue Aug 1 14:29:43 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
* getloadavg.c (getloadavg): Set FD_CLOEXEC flag on /dev/kmem file
- descriptor.
+ descriptor.
Wed Jul 26 00:26:34 1995 David J. MacKenzie <djm@geech.gnu.ai.mit.edu>
@@ -735,12 +735,12 @@ Thu Jun 22 18:36:42 1995 Uwe Seimet (seimet@iris1.chemie.uni-kl.de)
Tue Jun 20 02:41:41 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
* getloadavg.c [convex] (LOAD_AVE_TYPE, LDAV_CVT): Define to
- double, no conversion.
+ double, no conversion.
* obstack.c (OBSTACK_INTERFACE_VERSION): New macro. Rewrote
- conditionals to use that macro to ensure that the installed GNU
- libc supports the interface the obstack.h corresponding to this
- obstack.c needs, and only then elide the code in this file.
+ conditionals to use that macro to ensure that the installed GNU
+ libc supports the interface the obstack.h corresponding to this
+ obstack.c needs, and only then elide the code in this file.
Sun May 28 18:53:29 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
@@ -795,13 +795,13 @@ Thu Apr 27 13:11:11 1995 Jim Meyering (meyering@comco.com)
Thu Apr 27 09:22:33 1995 Peder Chr. Norgaard <pcn@tbit.dk>
- * config.guess (i[34]86:*:3.2:*) test for /usr/options/cb.name
+ * config.guess (i[34]86:*:3.2:*) test for /usr/options/cb.name
before calling uname.
Wed Apr 26 17:19:34 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
* signame.c [HAVE_UNISTD_H]: Include unistd.h so it can declare
- sys_siglist.
+ sys_siglist.
Wed Apr 26 14:00:00 1995 Michael Meissner (meissner@cygnus.com)
@@ -828,8 +828,8 @@ Thu Apr 6 19:55:54 1995 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Fri Mar 24 00:52:31 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
* getopt.c (_getopt_internal): When optind is zero, bump it to 1
- after initializing; we don't want to scan ARGV[0], which is the
- program name.
+ after initializing; we don't want to scan ARGV[0], which is the
+ program name.
Tue Mar 21 16:44:37 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
@@ -897,7 +897,7 @@ Wed Dec 21 15:51:08 1994 Warner Losh (imp@boulder.openware.com)
Tue Dec 6 02:29:42 1994 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
* config.guess (dummy.c) [sony]: Include <sys/param.h> and emit
- newsos4 #ifdef NEWSOS4.
+ newsos4 #ifdef NEWSOS4.
Tue Nov 29 17:01:29 1994 Mark Dapoz (md@bsc.no)
@@ -949,18 +949,18 @@ Tue Nov 1 14:24:39 1994 Per Bothner (bothner@spiff.gnu.ai.mit.edu)
Mon Oct 31 07:02:15 1994 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
* getopt.h: Change #if __STDC__ to #if defined (__STDC__) &&
- __STDC__.
+ __STDC__.
* getopt.c: Change #ifndef __STDC__ to #if !defined (__STDC__) ||
- !__STDC__.
+ !__STDC__.
* getopt1.c: Likewise.
* obstack.c: Change #ifdef __STDC__ to #if defined (__STDC__) &&
- __STDC__.
+ __STDC__.
* obstack.h: Likewise.
Wed Oct 26 20:34:59 1994 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
* getloadavg.c [alliant && i860] (FSCALE): Move defn before
- #ifndef FSCALE.
+ #ifndef FSCALE.
Tue Oct 25 19:10:41 1994 Paul Eggert <eggert@twinsun.com>
@@ -971,7 +971,7 @@ Tue Oct 25 19:10:41 1994 Paul Eggert <eggert@twinsun.com>
Tue Oct 25 11:22:30 1994 David J. MacKenzie <djm@duality.gnu.ai.mit.edu>
* xmalloc.c (xmalloc, xrealloc): If 0 bytes requested, pretend
- it's 1, for diff.
+ it's 1, for diff.
Thu Oct 20 18:47:53 1994 Per Bothner (bothner@wombat.gnu.ai.mit.edu)
@@ -1036,7 +1036,7 @@ Thu Sep 29 18:47:34 1994 Jerry Frain (jerry@sneffels.tivoli.com)
Wed Sep 28 17:00:12 1994 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
* getloadavg.c [alliant && i860] (LOAD_AVE_TYPE, FSCALE,
- NLIST_STRUCT): Define.
+ NLIST_STRUCT): Define.
Mon Sep 26 17:53:05 1994 David J. MacKenzie (djm@churchy.gnu.ai.mit.edu)
@@ -1204,7 +1204,7 @@ Mon Jun 6 04:59:28 1994 Richard Stallman (rms@mole.gnu.ai.mit.edu)
Sat Jun 4 01:24:59 1994 Roland McGrath (roland@geech.gnu.ai.mit.edu)
* getloadavg.c: Put #include of errno.h and decl of errno before
- #ifndef HAVE_GETLOADAVG.
+ #ifndef HAVE_GETLOADAVG.
Thu Jun 2 13:42:39 1994 Richard Stallman (rms@mole.gnu.ai.mit.edu)
@@ -1268,8 +1268,8 @@ Fri Apr 15 22:46:59 1994 Richard Stallman (rms@mole.gnu.ai.mit.edu)
Tue Apr 12 15:05:08 1994 Noah Friedman (friedman@prep.ai.mit.edu)
- * config.guess: Merge rms' new entry for i486-ncr-sysv4 with the
- previously existing one.
+ * config.guess: Merge rms' new entry for i486-ncr-sysv4 with the
+ previously existing one.
Mon Apr 11 00:54:33 1994 Richard Stallman (rms@mole.gnu.ai.mit.edu)
@@ -1302,13 +1302,13 @@ Tue Mar 1 21:53:03 1994 Karl Heuer (kwzh@hal.gnu.ai.mit.edu)
Thu Feb 24 14:54:23 1994 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu)
- * getopt.c: Remove #ifdef GETOPT_COMPAT and #if 0 code.
- (_getopt_initialize): New function, broken out of _getopt_internal.
- (_getopt_internal):
- If long_only and the ARGV-element has the form "-f", where f is
- a valid short option, don't consider it an abbreviated form of
- a long option that starts with f. Otherwise there would be no
- way to give the -f short option.
+ * getopt.c: Remove #ifdef GETOPT_COMPAT and #if 0 code.
+ (_getopt_initialize): New function, broken out of _getopt_internal.
+ (_getopt_internal):
+ If long_only and the ARGV-element has the form "-f", where f is
+ a valid short option, don't consider it an abbreviated form of
+ a long option that starts with f. Otherwise there would be no
+ way to give the -f short option.
Thu Feb 10 14:44:16 1994 Richard Stallman (rms@mole.gnu.ai.mit.edu)
@@ -1326,20 +1326,20 @@ Wed Feb 9 00:14:00 1994 Richard Stallman (rms@mole.gnu.ai.mit.edu)
Tue Feb 8 14:14:31 1994 David J. MacKenzie (djm at douglas.gnu.ai.mit.edu)
- Handle obstack_chunk_alloc returning NULL. This allows
- obstacks to be used by libraries, without forcing them
- to call exit or longjmp.
- * obstack.c (_obstack_begin, _obstack_begin_1, _obstack_newchunk):
- If CALL_CHUNKFUN returns NULL, set alloc_failed, else clear it.
- (_obstack_begin, _obstack_begin_1): Return 1 if successful, 0 if not.
- * obstack.h (struct obstack): Add alloc_failed flag.
- _obstack_begin, _obstack_begin_1): Declare to return int, not void.
- (obstack_finish): If alloc_failed, return NULL.
- (obstack_base, obstack_next_free, objstack_object_size):
- If alloc_failed, return 0.
- (obstack_grow, obstack_grow0, obstack_1grow, obstack_ptr_grow,
- obstack_int_grow, obstack_blank): If alloc_failed, do nothing that
- could corrupt the obstack.
+ Handle obstack_chunk_alloc returning NULL. This allows
+ obstacks to be used by libraries, without forcing them
+ to call exit or longjmp.
+ * obstack.c (_obstack_begin, _obstack_begin_1, _obstack_newchunk):
+ If CALL_CHUNKFUN returns NULL, set alloc_failed, else clear it.
+ (_obstack_begin, _obstack_begin_1): Return 1 if successful, 0 if not.
+ * obstack.h (struct obstack): Add alloc_failed flag.
+ _obstack_begin, _obstack_begin_1): Declare to return int, not void.
+ (obstack_finish): If alloc_failed, return NULL.
+ (obstack_base, obstack_next_free, objstack_object_size):
+ If alloc_failed, return 0.
+ (obstack_grow, obstack_grow0, obstack_1grow, obstack_ptr_grow,
+ obstack_int_grow, obstack_blank): If alloc_failed, do nothing that
+ could corrupt the obstack.
(obstack_chunkfun, obstack_freefun): New macros, used in GDB.
Sun Jan 30 17:58:06 1994 Ken Raeburn (raeburn@cujo.cygnus.com)
@@ -1368,7 +1368,7 @@ Sun Dec 26 03:58:32 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu)
Fri Dec 24 19:43:00 1993 Noah Friedman (friedman@nutrimat.gnu.ai.mit.edu)
- * getopt.c (_NO_PROTO): Define before config.h is included.
+ * getopt.c (_NO_PROTO): Define before config.h is included.
Wed Dec 22 17:01:19 1993 Jim Meyering (meyering@comco.com)
@@ -1383,7 +1383,7 @@ Tue Dec 07 14:52:39 1993 Jim Meyering (meyering@comco.com)
Sat Nov 20 17:47:50 1993 Noah Friedman (friedman@gnu.ai.mit.edu)
- * error.c (error): fflush stdout before writing to stderr.
+ * error.c (error): fflush stdout before writing to stderr.
Tue Nov 09 10:05:48 1993 Jim Meyering (meyering@comco.com)
@@ -1392,7 +1392,7 @@ Tue Nov 09 10:05:48 1993 Jim Meyering (meyering@comco.com)
Thu Nov 4 12:59:19 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com)
* config.guess: add support for {i386,m68k,sparc} LynxOS; Hitachi
- HPPA machines; Acorn Risc Machines; DG/UX; Motorola SVr3 on m88k
+ HPPA machines; Acorn Risc Machines; DG/UX; Motorola SVr3 on m88k
Wed Nov 3 08:06:08 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
@@ -1660,8 +1660,8 @@ Sun May 23 13:53:12 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu)
Sun May 23 05:47:31 1993 Noah Friedman (friedman@nutrimat.gnu.ai.mit.edu)
- * mkinstalldirs (errstatus): New variable.
- Use inner `for' loop instead of `while test' on $#.
+ * mkinstalldirs (errstatus): New variable.
+ Use inner `for' loop instead of `while test' on $#.
Sat May 22 20:14:23 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
@@ -2045,8 +2045,8 @@ Sat Nov 7 13:50:27 1992 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu)
Sat Nov 7 03:28:08 1992 Jim Blandy (jimb@apple-gunkies.gnu.ai.mit.edu)
- * getdate.y [emacs]: Include <config.h>; under Emacs, we get
- some additional configuration information from that.
+ * getdate.y [emacs]: Include <config.h>; under Emacs, we get
+ some additional configuration information from that.
Sat Nov 7 00:53:35 1992 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu)
@@ -2100,13 +2100,13 @@ Wed Sep 30 13:54:36 1992 Michael I Bushnell (mib@geech.gnu.ai.mit.edu)
Tue Sep 29 07:36:29 1992 Noah Friedman (friedman@nutrimat.gnu.ai.mit.edu)
- * getloadavg.c: if symbol `sony_news' is defined, define
- NLIST_STRUCT and declare LOAD_AVE_TYPE as long.
+ * getloadavg.c: if symbol `sony_news' is defined, define
+ NLIST_STRUCT and declare LOAD_AVE_TYPE as long.
Thu Sep 17 20:10:03 1992 Karl Berry (karl@geech.gnu.ai.mit.edu)
- * regex.[ch]: made links into ../regex/, per rms' suggestion.
- Please put further ChangeLog entries there.
+ * regex.[ch]: made links into ../regex/, per rms' suggestion.
+ Please put further ChangeLog entries there.
Tue Sep 15 20:13:30 1992 Michael I Bushnell (mib@geech.gnu.ai.mit.edu)
@@ -2131,7 +2131,7 @@ Fri Sep 11 10:42:24 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu)
Fri Sep 11 07:46:21 1992 Karl Berry (karl@hal.gnu.ai.mit.edu)
- * regex.h (_RE_ARGS) [!__STDC__]: expand to empty parens.
+ * regex.h (_RE_ARGS) [!__STDC__]: expand to empty parens.
Fri Sep 11 00:57:56 1992 Richard Stallman (rms@mole.gnu.ai.mit.edu)
@@ -2156,13 +2156,13 @@ Thu Sep 10 16:35:10 1992 Jim Blandy (jimb@wookumz.gnu.ai.mit.edu)
Wed Sep 9 21:49:20 1992 Karl Berry (karl@apple-gunkies.gnu.ai.mit.edu)
- * regex.[ch]: version 0.10, incorporating below changes and
- more. See /gd/gnu/lib/regex-*/ChangeLog.
+ * regex.[ch]: version 0.10, incorporating below changes and
+ more. See /gd/gnu/lib/regex-*/ChangeLog.
Wed Sep 9 03:09:55 1992 Noah Friedman (friedman@nutrimat.gnu.ai.mit.edu)
- * malloc.c: if USG, define macros for bcopy and bzero.
- Don't redefine USG for hpux if already defined.
+ * malloc.c: if USG, define macros for bcopy and bzero.
+ Don't redefine USG for hpux if already defined.
Tue Sep 1 16:46:47 1992 Jim Blandy (jimb@pogo.cs.oberlin.edu)
@@ -2233,8 +2233,8 @@ Sat Aug 1 00:11:25 1992 Fred Fish (fnf at fishpond)
Wed Jul 29 18:53:13 1992 Karl Berry (karl@hal)
- * regex.c: version 0.9; fixes bug wrt always finding the longest
- match. See /gd/gnu/lib/regex-*/ChangeLog.
+ * regex.c: version 0.9; fixes bug wrt always finding the longest
+ match. See /gd/gnu/lib/regex-*/ChangeLog.
Sun Jul 26 18:24:13 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
@@ -2302,8 +2302,8 @@ Sat Jul 11 13:24:12 1992 Richard Stallman (rms@mole.gnu.ai.mit.edu)
Fri Jul 10 15:01:25 1992 Karl Berry (karl@hal)
- * regex.[ch]: new version (0.8), incorporating the changes
- below. See /gd/gnu/regex/ChangeLog.
+ * regex.[ch]: new version (0.8), incorporating the changes
+ below. See /gd/gnu/regex/ChangeLog.
Fri Jul 10 03:46:24 1992 Richard Stallman (rms@mole.gnu.ai.mit.edu)
@@ -2341,7 +2341,7 @@ Wed Jul 8 12:38:37 1992 Jim Blandy (jimb@wookumz.gnu.ai.mit.edu)
Sat Jul 4 07:53:45 1992 Karl Berry (karl@hal)
- * regex.c (re_compile_fastmap): init succeed_n_p (to false).
+ * regex.c (re_compile_fastmap): init succeed_n_p (to false).
Fri Jul 3 14:45:29 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu)
@@ -2354,7 +2354,7 @@ Thu Jul 2 15:47:20 1992 David J. MacKenzie (djm@wookumz.gnu.ai.mit.edu)
Wed Jul 1 11:48:37 1992 Karl Berry (karl@hal)
- * regex.[ch]: new version (0.7). See /gd/gnu/regex/ChangeLog.
+ * regex.[ch]: new version (0.7). See /gd/gnu/regex/ChangeLog.
Sun Jun 28 06:05:39 1992 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
@@ -2394,7 +2394,7 @@ Mon Jun 8 18:03:28 1992 Jim Blandy (jimb@pogo.cs.oberlin.edu)
Wed Jun 3 16:59:49 1992 Karl Berry (karl@geech.gnu.ai.mit.edu)
- * regex.[ch]: new version (0.6). See ~karl/regex/ChangeLog.
+ * regex.[ch]: new version (0.6). See ~karl/regex/ChangeLog.
Sat May 23 22:28:54 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu)
@@ -2409,7 +2409,7 @@ Fri May 22 14:50:25 1992 Richard Stallman (rms@mole.gnu.ai.mit.edu)
Thu May 14 16:50:28 1992 Karl Berry (karl@kropotkin.gnu.ai.mit.edu)
- * regex.c, regex.h: new version (0.5). See ~karl/regex/ChangeLog.
+ * regex.c, regex.h: new version (0.5). See ~karl/regex/ChangeLog.
Tue May 12 03:27:19 1992 David J. MacKenzie (djm@churchy.gnu.ai.mit.edu)
@@ -2496,7 +2496,7 @@ Sun Mar 15 22:50:30 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu)
Thu Mar 12 14:26:48 1992 Karl Berry (karl@apple-gunkies.gnu.ai.mit.edu)
- * regex.[ch]: new version (0.4). See ~karl/regex/ChangeLog.
+ * regex.[ch]: new version (0.4). See ~karl/regex/ChangeLog.
Tue Mar 10 22:26:14 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu)
@@ -2515,8 +2515,8 @@ Tue Feb 25 21:23:50 1992 Roland McGrath (roland@wookumz.gnu.ai.mit.edu)
Thu Feb 20 13:04:57 1992 Karl Berry (karl@wombat.gnu.ai.mit.edu)
- * regex.[ch]: new version (0.3). See ~karl/regex/ChangeLog for all
- the details.
+ * regex.[ch]: new version (0.3). See ~karl/regex/ChangeLog for all
+ the details.
Wed Feb 19 23:04:05 1992 Charles Hannum (mycroft@gnu.ai.mit.edu)
@@ -2577,8 +2577,8 @@ Tue Jan 7 02:08:10 1992 Richard Stallman (rms at mole.gnu.ai.mit.edu)
Mon Jan 6 12:53:42 1992 Karl Berry (karl at apple-gunkies.gnu.ai.mit.edu)
- * regex.[ch]: new versions. See ~karl/regex/ChangeLog for all
- the details.
+ * regex.[ch]: new versions. See ~karl/regex/ChangeLog for all
+ the details.
Tue Dec 24 22:42:59 1991 Richard Stallman (rms at mole.gnu.ai.mit.edu)
@@ -2669,9 +2669,9 @@ Sat Sep 28 02:01:45 1991 David J. MacKenzie (djm at churchy.gnu.ai.mit.edu)
Wed Sep 4 17:32:51 1991 Kathryn A. Hargreaves (letters at apple-gunkies)
- * regex.[ch]: Put current version (0.1) here, after backing up old
- files. For ChangeLog details, please refer to the ChangeLog
- file in my regex directory.
+ * regex.[ch]: Put current version (0.1) here, after backing up old
+ files. For ChangeLog details, please refer to the ChangeLog
+ file in my regex directory.
Sat Aug 24 04:22:01 1991 David J. MacKenzie (djm at apple-gunkies)
@@ -3096,61 +3096,61 @@ Mon Mar 26 00:36:52 1990 David J. MacKenzie (djm at spike.ai.mit.edu)
Sun Mar 4 12:11:31 1990 Kathy Hargreaves (kathy at hayley)
* regex.h: Added syntax bit RE_NO_EMPTY_RANGES which is set if
- an ending range point has to collate higher or equal to the
- starting range point.
- Added syntax bit RE_NO_HYPHEN_RANGE_END which is set if a hyphen
- can't be an ending range point.
- Set to two above bits in RE_SYNTAX_POSIX_BASIC and
- RE_SYNTAX_POSIX_EXTENDED.
-
- regex.c: (re_compile_pattern): Don't allow empty ranges if the
- RE_NO_EMPTY_RANGES syntax bit is set.
- Don't let a hyphen be a range end if the RE_NO_HYPHEN_RANGE_END
+ an ending range point has to collate higher or equal to the
+ starting range point.
+ Added syntax bit RE_NO_HYPHEN_RANGE_END which is set if a hyphen
+ can't be an ending range point.
+ Set to two above bits in RE_SYNTAX_POSIX_BASIC and
+ RE_SYNTAX_POSIX_EXTENDED.
+
+ regex.c: (re_compile_pattern): Don't allow empty ranges if the
+ RE_NO_EMPTY_RANGES syntax bit is set.
+ Don't let a hyphen be a range end if the RE_NO_HYPHEN_RANGE_END
syntax bit is set.
(ESTACK_PUSH_2): renamed this PUSH_FAILURE_POINT and made it
- push all the used registers on the stack, as well as the number
- of the highest numbered register used, and (as before) the two
- failure points.
+ push all the used registers on the stack, as well as the number
+ of the highest numbered register used, and (as before) the two
+ failure points.
(re_match_2): Fixed up comments.
- Added arrays best_regstart[], best_regstart_seg1[], best_regend[],
- and best_regend_seg1[] to keep track of the best match so far
- whenever reach the end of the pattern but not the end of the
- string, and there are still failure points on the stack with
- which to backtrack; if so, do the saving and force a fail.
+ Added arrays best_regstart[], best_regstart_seg1[], best_regend[],
+ and best_regend_seg1[] to keep track of the best match so far
+ whenever reach the end of the pattern but not the end of the
+ string, and there are still failure points on the stack with
+ which to backtrack; if so, do the saving and force a fail.
If reach the end of the pattern but not the end of the string,
- but there are no more failure points to try, restore the best
- match so far, set the registers and return.
+ but there are no more failure points to try, restore the best
+ match so far, set the registers and return.
Compacted some code.
In stop_memory case, if the subexpression we've just left is in
- a loop, push onto the stack the loop's on_failure_jump failure
- point along with the current pointer into the string (d).
- In finalize_jump case, in addition to popping the failure
- points, pop the saved registers.
+ a loop, push onto the stack the loop's on_failure_jump failure
+ point along with the current pointer into the string (d).
+ In finalize_jump case, in addition to popping the failure
+ points, pop the saved registers.
In the fail case, restore the registers, as well as the failure
- points.
+ points.
Sun Feb 18 15:08:10 1990 Kathy Hargreaves (kathy at hayley)
* regex.c: (global): Defined a macro GET_BUFFER_SPACE which
makes sure you have a specified number of buffer bytes
- allocated.
- Redefined the macro BUFPUSH to use this.
- Added comments.
+ allocated.
+ Redefined the macro BUFPUSH to use this.
+ Added comments.
- (re_compile_pattern): Call GET_BUFFER_SPACE before storing or
- inserting any jumps.
+ (re_compile_pattern): Call GET_BUFFER_SPACE before storing or
+ inserting any jumps.
(re_match_2): Set d to string1 + pos and dend to end_match_1
- only if string1 isn't null.
+ only if string1 isn't null.
Force exit from a loop if it's around empty parentheses.
- In stop_memory case, if found some jumps, increment p2 before
- extracting address to which to jump. Also, don't need to know
- how many more times can jump_n.
+ In stop_memory case, if found some jumps, increment p2 before
+ extracting address to which to jump. Also, don't need to know
+ how many more times can jump_n.
In begline case, d must equal string1 or string2, in that order,
- only if they are not null.
- In maybe_finalize_jump case, skip over start_memorys' and
- stop_memorys' register numbers, too.
+ only if they are not null.
+ In maybe_finalize_jump case, skip over start_memorys' and
+ stop_memorys' register numbers, too.
Thu Feb 15 15:53:55 1990 Kathy Hargreaves (kathy at hayley)
@@ -3164,178 +3164,178 @@ Wed Jan 24 17:07:46 1990 Kathy Hargreaves (kathy at hayley)
Added to some comments.
regex.c: (re_compile_pattern): Tried to bulletproof some code,
- i.e., checked if backward references (e.g., p[-1]) were within
- the range of pattern.
+ i.e., checked if backward references (e.g., p[-1]) were within
+ the range of pattern.
- (re_compile_fastmap): Fixed a bug in succeed_n part where was
- getting the amount to jump instead of how many times to jump.
+ (re_compile_fastmap): Fixed a bug in succeed_n part where was
+ getting the amount to jump instead of how many times to jump.
- (re_search_2): Changed the name of the variable ``total'' to
- ``total_size.''
- Condensed some code.
+ (re_search_2): Changed the name of the variable ``total'' to
+ ``total_size.''
+ Condensed some code.
(re_match_2): Moved the comment about duplicate from above the
- start_memory case to above duplicate case.
+ start_memory case to above duplicate case.
- (global): Rewrote some comments.
- Added commandline arguments to testing.
+ (global): Rewrote some comments.
+ Added commandline arguments to testing.
Wed Jan 17 11:47:27 1990 Kathy Hargreaves (kathy at hayley)
* regex.c: (global): Defined a macro STORE_NUMBER which stores a
- number into two contiguous bytes. Also defined STORE_NUMBER_AND_INCR
+ number into two contiguous bytes. Also defined STORE_NUMBER_AND_INCR
which does the same thing and then increments the pointer to the
storage place to point after the number.
- Defined a macro EXTRACT_NUMBER which extracts a number from two
- continguous bytes. Also defined EXTRACT_NUMBER_AND_INCR which
- does the same thing and then increments the pointer to the
- source to point to after where the number was.
+ Defined a macro EXTRACT_NUMBER which extracts a number from two
+ continguous bytes. Also defined EXTRACT_NUMBER_AND_INCR which
+ does the same thing and then increments the pointer to the
+ source to point to after where the number was.
Tue Jan 16 12:09:19 1990 Kathy Hargreaves (kathy at hayley)
* regex.h: Incorporated rms' changes.
Defined RE_NO_BK_REFS syntax bit which is set when want to
- interpret back reference patterns as literals.
- Defined RE_NO_EMPTY_BRACKETS syntax bit which is set when want
- empty bracket expressions to be illegal.
- Defined RE_CONTEXTUAL_ILLEGAL_OPS syntax bit which is set when want
+ interpret back reference patterns as literals.
+ Defined RE_NO_EMPTY_BRACKETS syntax bit which is set when want
+ empty bracket expressions to be illegal.
+ Defined RE_CONTEXTUAL_ILLEGAL_OPS syntax bit which is set when want
it to be illegal for *, +, ? and { to be first in an re or come
- immediately after a | or a (, and for ^ not to appear in a
- nonleading position and $ in a nontrailing position (outside of
- bracket expressions, that is).
- Defined RE_LIMITED_OPS syntax bit which is set when want +, ?
- and | to always be literals instead of ops.
- Fixed up the Posix syntax.
- Changed the syntax bit comments from saying, e.g., ``0 means...''
- to ``If this bit is set, it means...''.
- Changed the syntax bit defines to use shifts instead of integers.
-
- * regex.c: (global): Incorporated rms' changes.
-
- (re_compile_pattern): Incorporated rms' changes
- Made it illegal for a $ to appear anywhere but inside a bracket
- expression or at the end of an re when RE_CONTEXTUAL_ILLEGAL_OPS
- is set. Made the same hold for $ except it has to be at the
- beginning of an re instead of the end.
+ immediately after a | or a (, and for ^ not to appear in a
+ nonleading position and $ in a nontrailing position (outside of
+ bracket expressions, that is).
+ Defined RE_LIMITED_OPS syntax bit which is set when want +, ?
+ and | to always be literals instead of ops.
+ Fixed up the Posix syntax.
+ Changed the syntax bit comments from saying, e.g., ``0 means...''
+ to ``If this bit is set, it means...''.
+ Changed the syntax bit defines to use shifts instead of integers.
+
+ * regex.c: (global): Incorporated rms' changes.
+
+ (re_compile_pattern): Incorporated rms' changes
+ Made it illegal for a $ to appear anywhere but inside a bracket
+ expression or at the end of an re when RE_CONTEXTUAL_ILLEGAL_OPS
+ is set. Made the same hold for $ except it has to be at the
+ beginning of an re instead of the end.
Made the re "[]" illegal if RE_NO_EMPTY_BRACKETS is set.
- Made it illegal for | to be first or last in an re, or immediately
- follow another | or a (.
- Added and embellished some comments.
+ Made it illegal for | to be first or last in an re, or immediately
+ follow another | or a (.
+ Added and embellished some comments.
Allowed \{ to be interpreted as a literal if RE_NO_BK_CURLY_BRACES
- is set.
- Made it illegal for *, +, ?, and { to appear first in an re, or
- immediately follow a | or a ( when RE_CONTEXTUAL_ILLEGAL_OPS is set.
+ is set.
+ Made it illegal for *, +, ?, and { to appear first in an re, or
+ immediately follow a | or a ( when RE_CONTEXTUAL_ILLEGAL_OPS is set.
Made back references interpreted as literals if RE_NO_BK_REFS is set.
- Made recursive intervals either illegal (if RE_NO_BK_CURLY_BRACES
- isn't set) or interpreted as literals (if is set), if RE_INTERVALS
- is set.
+ Made recursive intervals either illegal (if RE_NO_BK_CURLY_BRACES
+ isn't set) or interpreted as literals (if is set), if RE_INTERVALS
+ is set.
Made it treat +, ? and | as literals if RE_LIMITED_OPS is set.
- Cleaned up some code.
+ Cleaned up some code.
Thu Dec 21 15:31:32 1989 Kathy Hargreaves (kathy at hayley)
* regex.c: (global): Moved RE_DUP_MAX to regex.h and made it
equal 2^15 - 1 instead of 1000.
- Defined NULL to be zero.
- Moved the definition of BYTEWIDTH to regex.h.
- Made the global variable obscure_syntax nonstatic so the tests in
- another file could use it.
-
- (re_compile_pattern): Defined a maximum length (CHAR_CLASS_MAX_LENGTH)
- for character class strings (i.e., what's between the [: and the
- :]'s).
+ Defined NULL to be zero.
+ Moved the definition of BYTEWIDTH to regex.h.
+ Made the global variable obscure_syntax nonstatic so the tests in
+ another file could use it.
+
+ (re_compile_pattern): Defined a maximum length (CHAR_CLASS_MAX_LENGTH)
+ for character class strings (i.e., what's between the [: and the
+ :]'s).
Defined a macro SET_LIST_BIT(c) which sets the bit for C in a
- character set list.
- Took out comments that EXTEND_BUFFER clobbers C.
- Made the string "^" match itself, if not RE_CONTEXT_IND_OPS.
+ character set list.
+ Took out comments that EXTEND_BUFFER clobbers C.
+ Made the string "^" match itself, if not RE_CONTEXT_IND_OPS.
Added character classes to bracket expressions.
- Change the laststart pointer saved with the start of each
- subexpression to point to start_memory instead of after the
- following register number. This is because the subexpression
- might be in a loop.
- Added comments and compacted some code.
+ Change the laststart pointer saved with the start of each
+ subexpression to point to start_memory instead of after the
+ following register number. This is because the subexpression
+ might be in a loop.
+ Added comments and compacted some code.
Made intervals only work if preceded by an re matching a single
- character or a subexpression.
- Made back references to nonexistent subexpressions illegal if
- using POSIX syntax.
+ character or a subexpression.
+ Made back references to nonexistent subexpressions illegal if
+ using POSIX syntax.
Made intervals work on the last preceding character of a
- concatenation of characters, e.g., ab{0,} matches abbb, not abab.
+ concatenation of characters, e.g., ab{0,} matches abbb, not abab.
Moved macro PREFETCH to outside the routine.
(re_compile_fastmap): Added succeed_n to work analogously to
- on_failure_jump if n is zero and jump_n to work analogously to
- the other backward jumps.
+ on_failure_jump if n is zero and jump_n to work analogously to
+ the other backward jumps.
- (re_match_2): Defined macro SET_REGS_MATCHED to set which
- current subexpressions had matches within them.
- Changed some comments.
+ (re_match_2): Defined macro SET_REGS_MATCHED to set which
+ current subexpressions had matches within them.
+ Changed some comments.
Added reg_active and reg_matched_something arrays to keep track
- of in which subexpressions currently have matched something.
- Defined MATCHING_IN_FIRST_STRING and replaced ``dend == end_match_1''
- with it to make code easier to understand.
+ of in which subexpressions currently have matched something.
+ Defined MATCHING_IN_FIRST_STRING and replaced ``dend == end_match_1''
+ with it to make code easier to understand.
Fixed so can apply * and intervals to arbitrarily nested
- subexpressions. (Lots of previous bugs here.)
+ subexpressions. (Lots of previous bugs here.)
Changed so won't match a newline if syntax bit RE_DOT_NOT_NULL is set.
- Made the upcase array nonstatic so the testing file could use it also.
+ Made the upcase array nonstatic so the testing file could use it also.
- (main.c): Moved the tests out to another file.
+ (main.c): Moved the tests out to another file.
(tests.c): Moved all the testing stuff here.
Sat Nov 18 19:30:30 1989 Kathy Hargreaves (kathy at hayley)
- * regex.c: (re_compile_pattern): Defined RE_DUP_MAX, the maximum
- number of times an interval can match a pattern.
- Added macro GET_UNSIGNED_NUMBER (used to get below):
- Added variables lower_bound and upper_bound for upper and lower
- bounds of intervals.
- Added variable num_fetches so intervals could do backtracking.
+ * regex.c: (re_compile_pattern): Defined RE_DUP_MAX, the maximum
+ number of times an interval can match a pattern.
+ Added macro GET_UNSIGNED_NUMBER (used to get below):
+ Added variables lower_bound and upper_bound for upper and lower
+ bounds of intervals.
+ Added variable num_fetches so intervals could do backtracking.
Added code to handle '{' and "\{" and intervals.
Added to comments.
- (store_jump_n): (Added) Stores a jump with a number following the
- relative address (for intervals).
+ (store_jump_n): (Added) Stores a jump with a number following the
+ relative address (for intervals).
- (insert_jump_n): (Added) Inserts a jump_n.
+ (insert_jump_n): (Added) Inserts a jump_n.
- (re_match_2): Defined a macro ESTACK_PUSH_2 for the error stack;
- it checks for overflow and reallocates if necessary.
+ (re_match_2): Defined a macro ESTACK_PUSH_2 for the error stack;
+ it checks for overflow and reallocates if necessary.
* regex.h: Added bits (RE_INTERVALS and RE_NO_BK_CURLY_BRACES)
to obscure syntax to indicate whether or not
a syntax handles intervals and recognizes either \{ and
\} or { and } as operators. Also added two syntaxes
RE_SYNTAX_POSIX_BASIC and RE_POSIX_EXTENDED and two command codes
- to the enumeration regexpcode; they are succeed_n and jump_n.
+ to the enumeration regexpcode; they are succeed_n and jump_n.
Sat Nov 18 19:30:30 1989 Kathy Hargreaves (kathy at hayley)
* regex.c: (re_compile_pattern): Defined INIT_BUFF_SIZE to get rid
- of repeated constants in code. Tested with value 1.
+ of repeated constants in code. Tested with value 1.
Renamed PATPUSH as BUFPUSH, since it pushes things onto the
- buffer, not the pattern. Also made this macro extend the buffer
- if it's full (so could do the following):
- Took out code at top of loop that checks to see if buffer is going
- to be full after 10 additions (and reallocates if necessary).
+ buffer, not the pattern. Also made this macro extend the buffer
+ if it's full (so could do the following):
+ Took out code at top of loop that checks to see if buffer is going
+ to be full after 10 additions (and reallocates if necessary).
- (insert_jump): Rearranged declaration lines so comments would read
- better.
+ (insert_jump): Rearranged declaration lines so comments would read
+ better.
(re_match_2): Compacted exactn code and added more comments.
(main): Defined macros TEST_MATCH and MATCH_SELF to do
- testing; took out loop so could use these instead.
+ testing; took out loop so could use these instead.
Tue Oct 24 20:57:18 1989 Kathy Hargreaves (kathy at hayley)
* regex.c (re_set_syntax): Gave argument `syntax' a type.
- (store_jump, insert_jump): made them void functions.
+ (store_jump, insert_jump): made them void functions.
Tue Mar 6 23:29:26 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index 762689dd76d..074e01e9243 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -63,17 +63,20 @@ ALLOCA_FLAGS =
ALLOCA_FINISH = true
# Various ways of specifying flags for compilations:
-# CFLAGS is for the user to override to, e.g., do a bootstrap with -O2.
-# BOOT_CFLAGS is the value of CFLAGS to pass to the stage2 and stage3
-# compilations.
+# CFLAGS is for the user to override to, e.g., do a cross build with -O2.
+# For recursive bootstrap builds CFLAGS is used to pass in STAGE1_CFLAGS
+# or BOOT_CFLAGS
+# STAGE1_CFLAGS is set by configure on some targets or passed from toplevel
+# and sets the CFLAGS passed to stage1 of a bootstrap compilation.
+# BOOT_CFLAGS is the value of CFLAGS to pass to the stage2, stage3 and stage4
+# bootstrap compilations.
# XCFLAGS is used for most compilations but not when using the GCC just built.
# TCFLAGS is used for compilations with the GCC just built.
-# STAGE1_CFLAGS is set by configure on some targets.
XCFLAGS =
TCFLAGS =
-BOOT_CFLAGS = -g -O2
+CFLAGS = -g
STAGE1_CFLAGS = -g @stage1_cflags@
-CFLAGS = $(STAGE1_CFLAGS)
+BOOT_CFLAGS = -g -O2
# The warning flags are separate from BOOT_CFLAGS because people tend to
# override optimization flags and we'd like them to still have warnings
@@ -130,7 +133,7 @@ MAKEINFO = @MAKEINFO@
MAKEINFOFLAGS =
TEXI2DVI = texi2dvi
TEXI2POD = perl $(srcdir)/../contrib/texi2pod.pl
-POD2MAN = pod2man --center="GNU" --release="gcc-$(version)" --section=1
+POD2MAN = pod2man --center="GNU" --release="gcc-$(version)"
# For GNUmake: let us decide what gets passed to recursive makes.
MAKEOVERRIDES =
@SET_MAKE@
@@ -138,6 +141,11 @@ MAKEOVERRIDES =
# In stage2 and beyond, we force this to "-o $@" since we know we're using gcc.
OUTPUT_OPTION = @OUTPUT_OPTION@
+# Some versions of `touch' (such as the version on Solaris 2.8)
+# do not correctly set the timestamp due to buggy versions of `utime'
+# in the kernel. So, we use `echo' instead.
+STAMP = echo timestamp >
+
# This is where we get zlib from. zlibdir is -L../zlib and zlibinc is
# -I../zlib, unless we were configured with --with-system-zlib, in which
# case both are empty.
@@ -179,14 +187,10 @@ USER_H = $(srcdir)/ginclude/stdarg.h $(srcdir)/ginclude/stddef.h \
$(srcdir)/ginclude/stdbool.h $(srcdir)/ginclude/iso646.h \
$(EXTRA_HEADERS) $(LANG_EXTRA_HEADERS)
-# Target to use whe installing assert.h. Some systems may
-# want to set this empty.
-INSTALL_ASSERT_H = install-assert-h
-
# The GCC to use for compiling libgcc.a, enquire, and libgcc1-test.
# Usually the one we just built.
# Don't use this as a dependency--use $(GCC_PASSES) or $(GCC_PARTS).
-GCC_FOR_TARGET = ./xgcc -B./ -B$(build_tooldir)/bin/ -isystem $(build_tooldir)/include
+GCC_FOR_TARGET = ./xgcc -B./ -B$(build_tooldir)/bin/ -isystem $(build_tooldir)/include -isystem $(build_tooldir)/sys-include
# This is used instead of ALL_CFLAGS when compiling with GCC_FOR_TARGET.
# It omits XCFLAGS, and specifies -B./.
@@ -219,7 +223,7 @@ AR_FOR_TARGET = ` \
t='$(program_transform_cross_name)'; echo ar | sed -e $$t ; \
fi; \
fi`
-AR_FLAGS_FOR_TARGET =
+AR_FLAGS_FOR_TARGET =
AR_CREATE_FOR_TARGET = $(AR_FOR_TARGET) $(AR_FLAGS_FOR_TARGET) rc
AR_EXTRACT_FOR_TARGET = $(AR_FOR_TARGET) $(AR_FLAGS_FOR_TARGET) x
RANLIB_FOR_TARGET = ` \
@@ -237,8 +241,8 @@ RANLIB_TEST_FOR_TARGET = \
|| ( [ "$(host_canonical)" = "$(target)" ] \
&& [ -f /usr/bin/ranlib -o -f /bin/ranlib ] )
NM_FOR_TARGET = ` \
- if [ -f $(objdir)/../binutils/nm ] ; then \
- echo $(objdir)/../binutils/nm ; \
+ if [ -f $(objdir)/../binutils/nm-new ] ; then \
+ echo $(objdir)/../binutils/nm-new ; \
else \
if [ "$(host_canonical)" = "$(target)" ] ; then \
echo nm; \
@@ -256,7 +260,7 @@ OBSTACK_H = $(srcdir)/../include/obstack.h
SPLAY_TREE_H= $(srcdir)/../include/splay-tree.h
# Default cross SYSTEM_HEADER_DIR, to be overridden by targets.
-CROSS_SYSTEM_HEADER_DIR = $(tooldir)/sys-include
+CROSS_SYSTEM_HEADER_DIR = $(build_tooldir)/sys-include
# Control whether to run fixproto and fixincludes.
STMP_FIXPROTO = stmp-fixproto
@@ -272,12 +276,22 @@ tmake_file=@dep_tmake_file@
out_file=$(srcdir)/config/@out_file@
out_object_file=@out_object_file@
md_file=$(srcdir)/config/@md_file@
-tm_file=@tm_file_list@
-build_xm_file=@build_xm_file_list@
-host_xm_file=@host_xm_file_list@
+tm_file_list=@tm_file_list@
+tm_file=@tm_file@
+tm_p_file_list=@tm_p_file_list@
+tm_p_file=@tm_p_file@
+build_xm_file_list=@build_xm_file_list@
+build_xm_file=@build_xm_file@
+build_xm_defines=@build_xm_defines@
+host_xm_file_list=@host_xm_file_list@
+host_xm_file=@host_xm_file@
+host_xm_defines=@host_xm_defines@
+xm_file=@xm_file@
+xm_defines=@xm_defines@
lang_specs_files=@lang_specs_files@
lang_options_files=@lang_options_files@
lang_tree_files=@lang_tree_files@
+target_cpu_default=@target_cpu_default@
GCC_THREAD_FILE=@thread_file@
OBJC_BOEHM_GC=@objc_boehm_gc@
GTHREAD_FLAGS=@gthread_flags@
@@ -311,15 +325,13 @@ dollar = @dollar@
gcc_tooldir = @gcc_tooldir@
# Used to install the shared libgcc.
slibdir = @slibdir@
-# Since tooldir does not exist at build-time, use -B$(build_tooldir)/bin/
+# Since gcc_tooldir does not exist at build-time, use -B$(build_tooldir)/bin/
build_tooldir = $(exec_prefix)/$(target_alias)
# Directory in which the compiler finds target-independent g++ includes.
gcc_gxx_include_dir = @gcc_gxx_include_dir@
# Directory to search for site-specific includes.
-includedir = $(local_prefix)/include
-# assertdir is overridden in cross-make.
-# (But this currently agrees with what is in cross-make.)
-assertdir = $(gcc_tooldir)/include
+local_includedir = $(local_prefix)/include
+includedir = $(prefix)/include
# where the info files go
infodir = @infodir@
# Where cpp should go besides $prefix/bin if necessary
@@ -328,7 +340,8 @@ cpp_install_dir = @cpp_install_dir@
datadir = $(prefix)/@DATADIRNAME@
localedir = $(datadir)/locale
# Extension (if any) to put in installed man-page filename.
-manext = .1
+man1ext = .1
+man7ext = .7
objext = .o
exeext = @host_exeext@
build_exeext = @build_exeext@
@@ -336,6 +349,7 @@ build_exeext = @build_exeext@
# Directory in which to put man pages.
mandir = @mandir@
man1dir = $(mandir)/man1
+man7dir = $(mandir)/man7
# Dir for temp files.
tmpdir = /tmp
@@ -348,6 +362,9 @@ USE_NLS = @USE_NLS@
# Internationalization library.
INTLLIBS = @INTLLIBS@
+# Character encoding conversion library.
+LIBICONV = @LIBICONV@
+
# List of internationalization subdirectories.
POSUB = @POSUB@
INTL_SUBDIRS = intl $(POSUB)
@@ -399,8 +416,10 @@ LIBGCC2_INCLUDES =
# Additional target-dependent options for compiling libgcc2.a.
TARGET_LIBGCC2_CFLAGS =
-# Additional sources to handle exceptions; overridden by some targets.
-LIB2ADDEH = $(srcdir)/frame-dwarf2.c
+# Additional sources to handle exceptions; overridden on ia64.
+LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde.c \
+ $(srcdir)/unwind-sjlj.c
+LIB2ADDEHDEP = unwind.inc unwind-dw2-fde.h
# libgcc1-test target (must also be overridable for a target)
LIBGCC1_TEST = libgcc1-test
@@ -446,10 +465,14 @@ USE_COLLECT2 = collect2$(exeext)
# Assembler files should have names ending in `.asm'.
LIB1FUNCS_EXTRA =
-# List of extra C and assembler files to add to libgcc2.a.
+# List of extra C and assembler files to add to static and shared libgcc2.
# Assembler files should have names ending in `.asm'.
LIB2FUNCS_EXTRA =
+# List of extra C and assembler files to add to static libgcc2.
+# Assembler files should have names ending in `.asm'.
+LIB2FUNCS_STATIC_EXTRA =
+
# Handle cpp installation.
INSTALL_CPP=
UNINSTALL_CPP=
@@ -574,6 +597,35 @@ all: all.indirect
# This tells GNU Make version 3 not to put all variables in the environment.
.NOEXPORT:
+# GCONFIG_H lists the config files that the generator files depend on, while
+# CONFIG_H lists the the ones ordinary gcc files depend on, which includes
+# a file generated by gencodes.
+GCONFIG_H = config.h $(host_xm_file_list)
+HCONFIG_H = hconfig.h $(build_xm_file_list)
+CONFIG_H = $(GCONFIG_H) $(TM_H) insn-codes.h insn-flags.h
+TCONFIG_H = tconfig.h $(xm_file_list) insn-codes.h insn-flags.h
+TM_H = tm.h $(tm_file_list)
+TM_P_H = tm_p.h $(tm_p_file_list) insn-codes.h insn-flags.h
+
+MACHMODE_H = machmode.h machmode.def
+RTL_BASE_H = rtl.h rtl.def $(MACHMODE_H)
+RTL_H = $(RTL_BASE_H) genrtl.h
+PARAMS_H = params.h params.def
+TREE_H = tree.h real.h tree.def $(MACHMODE_H) tree-check.h version.h builtins.def
+BASIC_BLOCK_H = basic-block.h bitmap.h sbitmap.h varray.h
+DEMANGLE_H = $(srcdir)/../include/demangle.h
+RECOG_H = recog.h
+EXPR_H = expr.h
+REGS_H = regs.h varray.h $(MACHMODE_H)
+INTEGRATE_H = integrate.h varray.h
+LOOP_H = loop.h varray.h bitmap.h
+GCC_H = gcc.h version.h
+GGC_H = ggc.h varray.h
+TIMEVAR_H = timevar.h timevar.def
+INSN_ATTR_H = insn-attr.h $(srcdir)/insn-addr.h $(srcdir)/varray.h
+C_COMMON_H = c-common.h $(SPLAY_TREE_H)
+C_TREE_H = c-tree.h $(C_COMMON_H)
+
# sed inserts variable overrides after the following line.
####target overrides
@target_overrides@
@@ -699,7 +751,7 @@ ORDINARY_FLAGS_TO_PASS = \
"prefix=$(prefix)" \
"local_prefix=$(local_prefix)" \
"gxx_include_dir=$(gcc_gxx_include_dir)" \
- "tooldir=$(tooldir)" \
+ "build_tooldir=$(build_tooldir)" \
"gcc_tooldir=$(gcc_tooldir)" \
"bindir=$(bindir)" \
"libsubdir=$(libsubdir)" \
@@ -736,16 +788,16 @@ C_OBJS = c-parse.o c-lang.o $(C_AND_OBJC_OBJS)
OBJS = diagnostic.o version.o tree.o print-tree.o stor-layout.o fold-const.o \
function.o stmt.o except.o expr.o calls.o expmed.o explow.o optabs.o real.o \
builtins.o intl.o varasm.o rtl.o print-rtl.o rtlanal.o emit-rtl.o genrtl.o \
- dbxout.o sdbout.o dwarfout.o dwarf2out.o xcoffout.o bitmap.o alias.o gcse.o \
- integrate.o jump.o cse.o loop.o doloop.o unroll.o flow.o combine.o varray.o \
- regclass.o regmove.o local-alloc.o global.o reload.o reload1.o caller-save.o \
- insn-peep.o reorg.o haifa-sched.o final.o recog.o reg-stack.o regrename.o \
- insn-opinit.o insn-recog.o insn-extract.o insn-output.o insn-emit.o lcm.o \
- profile.o insn-attrtab.o $(out_object_file) $(EXTRA_OBJS) convert.o \
- mbchar.o splay-tree.o graph.o sbitmap.o resource.o hash.o predict.o \
- lists.o ggc-common.o $(GGC) stringpool.o simplify-rtx.o ssa.o bb-reorder.o \
- sibcall.o conflict.o timevar.o ifcvt.o dominance.o dependence.o dce.o \
- sched-vis.o sched-deps.o sched-rgn.o sched-ebb.o hashtab.o
+ dbxout.o sdbout.o dwarfout.o dwarf2asm.o dwarf2out.o xcoffout.o bitmap.o \
+ alias.o gcse.o integrate.o jump.o cse.o loop.o doloop.o unroll.o flow.o \
+ combine.o varray.o regclass.o regmove.o local-alloc.o global.o reload.o \
+ reload1.o caller-save.o insn-peep.o reorg.o haifa-sched.o final.o recog.o \
+ reg-stack.o regrename.o insn-opinit.o insn-recog.o insn-extract.o \
+ insn-output.o insn-emit.o lcm.o profile.o insn-attrtab.o $(out_object_file) \
+ $(EXTRA_OBJS) convert.o mbchar.o splay-tree.o graph.o sbitmap.o resource.o \
+ hash.o predict.o lists.o ggc-common.o $(GGC) stringpool.o simplify-rtx.o \
+ ssa.o bb-reorder.o sibcall.o conflict.o timevar.o ifcvt.o dominance.o \
+ dependence.o dce.o sched-vis.o sched-deps.o sched-rgn.o sched-ebb.o params.o
BACKEND = toplev.o libbackend.a
@@ -792,13 +844,13 @@ LIB2FUNCS = _muldi3 _divdi3 _moddi3 _udivdi3 _umoddi3 _negdi2 \
_fixunsdfsi _fixunssfsi _fixunsdfdi _fixdfdi _fixunssfdi _fixsfdi \
_fixxfdi _fixunsxfdi _floatdixf _fixunsxfsi \
_fixtfdi _fixunstfdi _floatditf \
- __gcc_bcmp _varargs __dummy _eprintf \
- _bb _clear_cache _trampoline __main _exit \
+ _clear_cache _trampoline __main _exit \
_absvsi2 _absvdi2 _addvsi3 _addvdi3 _subvsi3 _subvdi3 \
_mulvsi3 _mulvdi3 _negvsi2 _negvdi2 \
_ctors
-LIB2FUNCS_EH = _eh
+# Defined in libgcc2.c, included only in the static library.
+LIB2FUNCS_ST = _eprintf _bb __gcc_bcmp
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 \
@@ -810,36 +862,6 @@ DPBIT_FUNCS = _pack_df _unpack_df _addsub_df _mul_df _div_df \
_lt_df _le_df _unord_df _si_to_df _df_to_si _negate_df _make_df \
_df_to_sf _thenan_df _df_to_usi _usi_to_df
-# GCONFIG_H lists the config files that the generator files depend on, while
-# CONFIG_H lists the the ones ordinary gcc files depend on, which includes
-# a file generated by gencodes.
-# The files that "belong" in GCONFIG_H are deliberately omitted
-# because having them there would not be useful in actual practice.
-# All they would do is cause complete recompilation every time
-# one of the machine description files is edited.
-# That may or may not be what one wants to do.
-# If it is, rm *.o is an easy way to do it.
-# GCONFIG_H = $(host_xm_file) $(tm_file)
-GCONFIG_H =
-CONFIG_H = $(GCONFIG_H) insn-codes.h
-MACHMODE_H = machmode.h machmode.def
-RTL_BASE_H = rtl.h rtl.def $(MACHMODE_H)
-RTL_H = $(RTL_BASE_H) genrtl.h
-TREE_H = tree.h real.h tree.def $(MACHMODE_H) tree-check.h version.h builtins.def
-BASIC_BLOCK_H = basic-block.h bitmap.h sbitmap.h varray.h
-DEMANGLE_H = $(srcdir)/../include/demangle.h
-RECOG_H = recog.h
-EXPR_H = expr.h insn-codes.h
-REGS_H = regs.h varray.h $(MACHMODE_H)
-INTEGRATE_H = integrate.h varray.h
-LOOP_H = loop.h varray.h bitmap.h
-GCC_H = gcc.h version.h
-GGC_H = ggc.h varray.h
-TIMEVAR_H = timevar.h timevar.def
-INSN_ATTR_H = insn-attr.h $(srcdir)/insn-addr.h $(srcdir)/varray.h
-C_COMMON_H = c-common.h $(SPLAY_TREE_H)
-C_TREE_H = c-tree.h $(C_COMMON_H)
-
#
# Language makefile fragments.
@@ -878,14 +900,53 @@ Makefile: $(srcdir)/Makefile.in config.status $(srcdir)/version.c \
LANGUAGES="$(CONFIG_LANGUAGES)" $(SHELL) config.run
rm -f config.run
+config.h: cs-config.h ; @true
+hconfig.h: cs-hconfig.h ; @true
+tconfig.h: cs-tconfig.h ; @true
+tm.h: cs-tm.h ; @true
+tm_p.h: cs-tm_p.h ; @true
+
+cs-config.h: Makefile
+ HEADERS="$(host_xm_file)" DEFINES="$(host_xm_defines)" \
+ TARGET_CPU_DEFAULT="$(target_cpu_default)" \
+ $(SHELL) $(srcdir)/mkconfig.sh config.h
+
+cs-hconfig.h: Makefile
+ HEADERS="$(build_xm_file)" DEFINES="$(build_xm_defines)" \
+ TARGET_CPU_DEFAULT="$(target_cpu_default)" \
+ $(SHELL) $(srcdir)/mkconfig.sh hconfig.h
+
+cs-tconfig.h: Makefile $(CONFIG_H) except.h
+ HEADERS="$(xm_file)" DEFINES="$(xm_defines)" \
+ TARGET_CPU_DEFAULT="" \
+ $(SHELL) $(srcdir)/mkconfig.sh tconfig.h
+# ??? Need extra help to get this definition copied to where libgcc can
+# see it. It shouldn't matter which compiler we use to get there.
+ echo '#include "config.h"' > conftest.c
+ echo '#include "except.h"' >> conftest.c
+ echo 'xyzzy USING_SJLJ_EXCEPTIONS' >> conftest.c
+ $(HOST_CC) -E conftest.c $(ALL_CFLAGS) $(INCLUDES) > conftest.out
+ sed -e 's/xyzzy/#define USING_SJLJ_EXCEPTIONS/' -e '/#define/p' \
+ -e d conftest.out >> tconfig.h
+ rm conftest.*
+
+cs-tm.h: Makefile
+ HEADERS="$(tm_file)" DEFINES="" TARGET_CPU_DEFAULT="" \
+ TARGET_CPU_DEFAULT="$(target_cpu_default)" \
+ $(SHELL) $(srcdir)/mkconfig.sh tm.h
+
+cs-tm_p.h: Makefile
+ HEADERS="$(tm_p_file)" DEFINES="" TARGET_CPU_DEFAULT="" \
+ $(SHELL) $(srcdir)/mkconfig.sh tm_p.h
+
$(srcdir)/configure: $(srcdir)/configure.in
(cd $(srcdir) && autoconf)
gccbug: $(srcdir)/gccbug.in
- CONFIG_FILES=gccbug CONFIG_HEADERS= ./config.status
+ CONFIG_FILES=gccbug CONFIG_HEADERS= ./config.status
mklibgcc: $(srcdir)/mklibgcc.in
- CONFIG_FILES=mklibgcc CONFIG_HEADERS= ./config.status
+ CONFIG_FILES=mklibgcc CONFIG_HEADERS= ./config.status
# cstamp-h.in controls rebuilding of config.in.
# It is named cstamp-h.in and not stamp-h.in so the mostlyclean rule doesn't
@@ -1006,9 +1067,10 @@ xlimits.h: glimits.h limitx.h limity.h
#
# Build libgcc.a.
-LIB2ADD = $(LIB2ADDEH) $(LIB2FUNCS_EXTRA)
+LIB2ADD = $(LIB2FUNCS_EXTRA)
+LIB2ADD_ST = $(LIB2FUNCS_STATIC_EXTRA)
-libgcc.mk: config.status Makefile mklibgcc $(LIB2ADD) xgcc$(exeext)
+libgcc.mk: config.status Makefile mklibgcc $(LIB2ADD) $(LIB2ADD_ST) xgcc$(exeext)
objext='$(objext)' \
OLDCC='$(OLDCC)' \
LIBGCC1='$(LIBGCC1)' \
@@ -1016,8 +1078,11 @@ libgcc.mk: config.status Makefile mklibgcc $(LIB2ADD) xgcc$(exeext)
LIB1ASMFUNCS='$(LIB1ASMFUNCS)' \
LIB1FUNCS_EXTRA='$(LIB1FUNCS_EXTRA)' \
LIB2FUNCS='$(LIB2FUNCS)' \
- LIB2FUNCS_EH='$(LIB2FUNCS_EH)' \
+ LIB2FUNCS_ST='$(LIB2FUNCS_ST)' \
LIB2ADD='$(LIB2ADD)' \
+ LIB2ADDEH='$(LIB2ADDEH)' \
+ LIB2ADDEHDEP='$(LIB2ADDEHDEP)' \
+ LIB2ADD_ST='$(LIB2ADD_ST)' \
FPBIT='$(FPBIT)' \
FPBIT_FUNCS='$(FPBIT_FUNCS)' \
DPBIT='$(DPBIT)' \
@@ -1036,9 +1101,10 @@ libgcc.mk: config.status Makefile mklibgcc $(LIB2ADD) xgcc$(exeext)
# All the things that might cause us to want to recompile bits of libgcc.
LIBGCC_DEPS = $(GCC_PASSES) $(LANGUAGES) stmp-int-hdrs $(STMP_FIXPROTO) \
- libgcc.mk $(srcdir)/libgcc1.c $(srcdir)/libgcc2.c $(CONFIG_H) \
- $(MACHMODE_H) longlong.h frame.h gbl-ctors.h config.status \
- stmp-int-hdrs tsystem.h $(FPBIT) $(DPBIT) $(LIB2ADD) $(EXTRA_PARTS)
+ libgcc.mk $(srcdir)/libgcc1.c $(srcdir)/libgcc2.c $(TCONFIG_H) \
+ $(MACHMODE_H) longlong.h gbl-ctors.h config.status stmp-int-hdrs \
+ tsystem.h $(FPBIT) $(DPBIT) $(LIB2ADD) $(LIB2ADDEH) $(LIB2ADDEHDEP) \
+ $(LIB2ADD_ST) $(EXTRA_PARTS)
libgcc.a: $(LIBGCC_DEPS)
$(MAKE) GCC_FOR_TARGET="$(GCC_FOR_TARGET)" \
@@ -1053,7 +1119,7 @@ libgcc.a: $(LIBGCC_DEPS)
NM_FOR_TARGET="$(NM_FOR_TARGET)" AWK="$(AWK)" \
LIBGCC2_CFLAGS="$(LIBGCC2_CFLAGS)" \
INCLUDES="$(INCLUDES)" MAYBE_USE_COLLECT2="$(MAYBE_USE_COLLECT2)" \
- CONFIG_H="$(CONFIG_H)" MACHMODE_H="$(MACHMODE_H)" \
+ CONFIG_H="$(TCONFIG_H)" MACHMODE_H="$(MACHMODE_H)" \
LIB1ASMSRC='$(LIB1ASMSRC)' \
MAKEOVERRIDES= \
-f libgcc.mk all
@@ -1064,15 +1130,15 @@ libgcc.a: $(LIBGCC_DEPS)
multilib.h: s-mlib; @true
s-mlib: $(srcdir)/genmultilib Makefile
$(SHELL) $(srcdir)/genmultilib \
- "`test @enable_multilib@ = yes && echo $(MULTILIB_OPTIONS)`" \
- "`test @enable_multilib@ = yes && echo $(MULTILIB_DIRNAMES)`" \
- "`test @enable_multilib@ = yes && echo $(MULTILIB_MATCHES)`" \
- "`test @enable_multilib@ = yes && echo $(MULTILIB_EXCEPTIONS)`" \
- "`test @enable_multilib@ = yes && echo $(MULTILIB_EXTRA_OPTS)`" \
- "`test @enable_multilib@ = yes && echo $(MULTILIB_EXCLUSIONS)`" \
+ "`test @enable_multilib@ != yes || echo $(MULTILIB_OPTIONS)`" \
+ "`test @enable_multilib@ != yes || echo $(MULTILIB_DIRNAMES)`" \
+ "`test @enable_multilib@ != yes || echo $(MULTILIB_MATCHES)`" \
+ "`test @enable_multilib@ != yes || echo $(MULTILIB_EXCEPTIONS)`" \
+ "`test @enable_multilib@ != yes || echo $(MULTILIB_EXTRA_OPTS)`" \
+ "`test @enable_multilib@ != yes || echo $(MULTILIB_EXCLUSIONS)`" \
> tmp-mlib.h
$(SHELL) $(srcdir)/move-if-change tmp-mlib.h multilib.h
- touch s-mlib
+ $(STAMP) s-mlib
# Build multiple copies of libgcc.a, one for each target switch.
stmp-multilib: $(LIBGCC_DEPS)
@@ -1092,36 +1158,36 @@ stmp-multilib: $(LIBGCC_DEPS)
LIB1ASMSRC='$(LIB1ASMSRC)' \
MAKEOVERRIDES= \
-f libgcc.mk all
- touch stmp-multilib
+ $(STAMP) stmp-multilib
# Compile two additional files that are linked with every program
# linked using GCC on systems using COFF or ELF, for the sake of C++
# constructors.
-$(T)crtbegin.o: crtstuff.c $(GCC_PASSES) $(CONFIG_H) \
- frame.h gbl-ctors.h stmp-int-hdrs tsystem.h
+$(T)crtbegin.o: crtstuff.c $(GCC_PASSES) $(TCONFIG_H) \
+ gbl-ctors.h stmp-int-hdrs tsystem.h
$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -g0 \
-finhibit-size-directive -fno-inline-functions \
-fno-exceptions $(CRTSTUFF_T_CFLAGS) @inhibit_libc@ \
-c $(srcdir)/crtstuff.c -DCRT_BEGIN -o $(T)crtbegin$(objext)
-$(T)crtend.o: crtstuff.c $(GCC_PASSES) $(CONFIG_H) \
- frame.h gbl-ctors.h stmp-int-hdrs tsystem.h
+$(T)crtend.o: crtstuff.c $(GCC_PASSES) $(TCONFIG_H) \
+ gbl-ctors.h stmp-int-hdrs tsystem.h
$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -g0 \
-finhibit-size-directive -fno-inline-functions \
-fno-exceptions $(CRTSTUFF_T_CFLAGS) @inhibit_libc@ \
-c $(srcdir)/crtstuff.c -DCRT_END -o $(T)crtend$(objext)
# These are versions of crtbegin and crtend for shared libraries.
-$(T)crtbeginS.o: crtstuff.c $(GCC_PASSES) $(CONFIG_H) \
- frame.h gbl-ctors.h stmp-int-hdrs tsystem.h
+$(T)crtbeginS.o: crtstuff.c $(GCC_PASSES) $(TCONFIG_H) \
+ gbl-ctors.h stmp-int-hdrs tsystem.h
$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -g0 \
-finhibit-size-directive -fno-inline-functions \
-fno-exceptions $(CRTSTUFF_T_CFLAGS_S) @inhibit_libc@ \
-c $(srcdir)/crtstuff.c -DCRT_BEGIN -DCRTSTUFFS_O \
-o $(T)crtbeginS$(objext)
-$(T)crtendS.o: crtstuff.c $(GCC_PASSES) $(CONFIG_H) \
- frame.h gbl-ctors.h stmp-int-hdrs tsystem.h
+$(T)crtendS.o: crtstuff.c $(GCC_PASSES) $(TCONFIG_H) \
+ gbl-ctors.h stmp-int-hdrs tsystem.h
$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -g0 \
-finhibit-size-directive -fno-inline-functions \
-fno-exceptions $(CRTSTUFF_T_CFLAGS_S) @inhibit_libc@ \
@@ -1138,7 +1204,7 @@ s-crt0: $(CRT0_S) $(MCRT0_S) $(GCC_PASSES) $(CONFIG_H)
-o crt0.o -c $(CRT0_S)
$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(CRT0STUFF_T_CFLAGS) \
-o mcrt0.o -c $(MCRT0_S)
- touch s-crt0
+ $(STAMP) s-crt0
#
# Compiling object files from source files.
@@ -1148,7 +1214,7 @@ s-crt0: $(CRT0_S) $(MCRT0_S) $(GCC_PASSES) $(CONFIG_H)
# C language specific files.
c-errors.o: c-errors.c $(CONFIG_H) system.h $(TREE_H) $(C_TREE_H) flags.h \
- diagnostic.h
+ diagnostic.h $(TM_P_H)
c-parse.o : $(srcdir)/c-parse.c $(CONFIG_H) $(TREE_H) c-lex.h $(GGC_H) intl.h \
$(C_TREE_H) input.h flags.h system.h toplev.h output.h cpplib.h
$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c $(srcdir)/c-parse.c
@@ -1165,20 +1231,20 @@ $(srcdir)/c-parse.y: c-parse.in
c-decl.o : c-decl.c $(CONFIG_H) system.h $(TREE_H) $(RTL_H) $(C_TREE_H) \
$(GGC_H) c-lex.h flags.h function.h output.h $(EXPR_H) \
- toplev.h intl.h
+ toplev.h intl.h $(TM_P_H)
c-typeck.o : c-typeck.c $(CONFIG_H) system.h $(TREE_H) $(C_TREE_H) \
- flags.h intl.h output.h $(EXPR_H) $(RTL_H) toplev.h
+ flags.h intl.h output.h $(EXPR_H) $(RTL_H) toplev.h $(TM_P_H)
c-lang.o : c-lang.c $(CONFIG_H) system.h $(TREE_H) $(C_TREE_H) \
$(GGC_H) c-lex.h toplev.h diagnostic.h output.h function.h \
$(RTL_H) $(EXPR_H)
c-lex.o : c-lex.c $(CONFIG_H) system.h $(TREE_H) $(RTL_H) c-lex.h $(C_TREE_H) \
c-pragma.h input.h intl.h flags.h toplev.h output.h \
- mbchar.h cpplib.h $(EXPR_H)
+ mbchar.h cpplib.h $(EXPR_H) $(TM_P_H)
c-aux-info.o : c-aux-info.c $(CONFIG_H) system.h $(TREE_H) $(C_TREE_H) \
flags.h toplev.h
c-convert.o : c-convert.c $(CONFIG_H) system.h $(TREE_H) flags.h toplev.h
c-pragma.o: c-pragma.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) function.h \
- c-pragma.h toplev.h $(GGC_H)
+ c-pragma.h toplev.h $(GGC_H) $(TM_P_H)
mbchar.o: mbchar.c $(CONFIG_H) system.h mbchar.h
graph.o: graph.c $(CONFIG_H) system.h toplev.h flags.h output.h $(RTL_H) \
function.h hard-reg-set.h $(BASIC_BLOCK_H) graph.h
@@ -1198,7 +1264,7 @@ collect2.o : collect2.c $(CONFIG_H) system.h gstab.h intl.h \
-c $(srcdir)/collect2.c
tlink.o: tlink.c $(DEMANGLE_H) hash.h $(CONFIG_H) system.h collect2.h intl.h
-hash.o: hash.c hash.h system.h toplev.h
+hash.o: hash.c hash.h system.h toplev.h $(CONFIG_H)
$(CC) -c $(ALL_CFLAGS) -DGENERATOR_FILE $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
vfprintf.o: $(srcdir)/../libiberty/vfprintf.c $(GCONFIG_H) system.h
@@ -1217,7 +1283,7 @@ strstr.o: $(srcdir)/../libiberty/strstr.c $(GCONFIG_H) system.h
$(CC) -c $(ALL_CFLAGS) -DGENERATOR_FILE $(ALL_CPPFLAGS) $(INCLUDES) \
strstr.c $(OUTPUT_OPTION)
-splay-tree.o: $(srcdir)/../libiberty/splay-tree.c \
+splay-tree.o: $(srcdir)/../libiberty/splay-tree.c $(GCONFIG_H) \
$(srcdir)/../include/splay-tree.h $(srcdir)/../include/libiberty.h
rm -f splay-tree.c
$(LN_S) $(srcdir)/../libiberty/splay-tree.c splay-tree.c
@@ -1237,13 +1303,13 @@ s-under: $(GCC_PASSES)
fi
$(SHELL) $(srcdir)/move-if-change tmp-under.c underscore.c
-rm -f tmp-dum.c tmp-dum.s
- touch s-under
+ $(STAMP) s-under
# A file used by all variants of C.
c-common.o : c-common.c $(CONFIG_H) system.h $(TREE_H) $(OBSTACK_H) \
$(C_COMMON_H) flags.h toplev.h output.h c-pragma.h $(RTL_H) $(GGC_H) \
- $(EXPR_H)
+ $(EXPR_H) $(TM_P_H)
c-format.o : c-format.c $(CONFIG_H) system.h $(TREE_H) \
$(C_COMMON_H) flags.h toplev.h intl.h diagnostic.h
@@ -1265,8 +1331,8 @@ DRIVER_DEFINES = \
-DDEFAULT_TARGET_MACHINE=\"$(target_alias)\" \
-DSTANDARD_BINDIR_PREFIX=\"$(bindir)/\" \
-DTOOLDIR_BASE_PREFIX=\"$(unlibsubdir)/../\" \
- `test "$${SHLIB_LINK}" -a "@enable_shared@" = "yes" && echo "-DENABLE_SHARED_LIBGCC"` \
- `test "$${SHLIB_MULTILIB}" && echo "-DNO_SHARED_LIBGCC_MULTILIB"`
+ `test "X$${SHLIB_LINK}" = "X" || test "@enable_shared@" != "yes" || echo "-DENABLE_SHARED_LIBGCC"` \
+ `test "X$${SHLIB_MULTILIB}" = "X" || echo "-DNO_SHARED_LIBGCC_MULTILIB"`
gcc.o: gcc.c $(CONFIG_H) system.h intl.h multilib.h \
Makefile $(lang_specs_files) prefix.h $(GCC_H)
@@ -1277,20 +1343,26 @@ gcc.o: gcc.c $(CONFIG_H) system.h intl.h multilib.h \
-c $(srcdir)/gcc.c)
gccspec.o: gccspec.c $(CONFIG_H) system.h $(GCC_H)
+ (SHLIB_LINK='$(SHLIB_LINK)' \
+ SHLIB_MULTILIB='$(SHLIB_MULTILIB)'; \
+ $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
+ $(DRIVER_DEFINES) \
+ -c $(srcdir)/gccspec.c)
+
cppspec.o: cppspec.c $(CONFIG_H) system.h $(GCC_H)
tree-check.h: s-check ; @true
s-check : gencheck$(build_exeext) $(srcdir)/move-if-change
./gencheck$(build_exeext) > tmp-check.h
$(SHELL) $(srcdir)/move-if-change tmp-check.h tree-check.h
- touch s-check
+ $(STAMP) s-check
gencheck$(build_exeext) : gencheck.o $(HOST_LIBDEPS)
$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
gencheck.o $(HOST_LIBS)
-gencheck.o : gencheck.c gencheck.h tree.def $(CONFIG_H) hconfig.h system.h \
- $(lang_tree_files)
+gencheck.o : gencheck.c gencheck.h tree.def $(HCONFIG_H) hconfig.h system.h \
+ $(lang_tree_files)
$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) \
$(srcdir)/gencheck.c
@@ -1299,18 +1371,18 @@ dumpvers: dumpvers.c
version.o: version.c version.h
ggc-common.o: ggc-common.c $(CONFIG_H) $(RTL_H) $(TREE_H) \
- flags.h $(GGC_H) varray.h hash.h
+ flags.h $(GGC_H) varray.h hash.h $(TM_P_H)
ggc-simple.o: ggc-simple.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h \
- $(GGC_H) varray.h $(TIMEVAR_H)
+ $(GGC_H) varray.h $(TIMEVAR_H) $(TM_P_H)
ggc-page.o: ggc-page.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h toplev.h \
- $(GGC_H) varray.h $(TIMEVAR_H)
+ $(GGC_H) varray.h $(TIMEVAR_H) $(TM_P_H)
stringpool.o: stringpool.c $(CONFIG_H) system.h $(TREE_H) $(OBSTACK_H) \
flags.h toplev.h
-ggc-none.o: ggc-none.c $(GCONFIG_H) $(RTL_H) $(GGC_H)
+ggc-none.o: ggc-none.c $(GCONFIG_H) $(GGC_H)
$(CC) -c $(ALL_CFLAGS) -DGENERATOR_FILE $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
obstack.o: $(srcdir)/../libiberty/obstack.c $(GCONFIG_H)
@@ -1327,20 +1399,21 @@ prefix.o: prefix.c $(CONFIG_H) system.h Makefile prefix.h
convert.o: convert.c $(CONFIG_H) system.h $(TREE_H) flags.h convert.h toplev.h
tree.o : tree.c $(CONFIG_H) system.h $(TREE_H) flags.h function.h toplev.h \
- $(GGC_H) $(HASHTAB_H) output.h
+ $(GGC_H) $(HASHTAB_H) output.h $(TM_P_H)
print-tree.o : print-tree.c $(CONFIG_H) system.h $(TREE_H) $(GGC_H)
stor-layout.o : stor-layout.c $(CONFIG_H) system.h $(TREE_H) flags.h \
- function.h $(EXPR_H) $(RTL_H) toplev.h $(GGC_H)
+ function.h $(EXPR_H) $(RTL_H) toplev.h $(GGC_H) $(TM_P_H)
fold-const.o : fold-const.c $(CONFIG_H) system.h $(TREE_H) flags.h toplev.h \
- $(EXPR_H) $(RTL_H) $(GGC_H)
+ $(EXPR_H) $(RTL_H) $(GGC_H) $(TM_P_H)
diagnostic.o : diagnostic.c diagnostic.h \
- $(CONFIG_H) system.h $(TREE_H) $(RTL_H) tm_p.h flags.h \
- $(GGC_H) input.h $(INSN_ATTR_H) insn-codes.h insn-config.h toplev.h intl.h
+ $(CONFIG_H) system.h $(TREE_H) $(RTL_H) $(TM_P_H) flags.h \
+ $(GGC_H) input.h $(INSN_ATTR_H) insn-config.h toplev.h intl.h
toplev.o : toplev.c $(CONFIG_H) system.h $(TREE_H) $(RTL_H) function.h \
flags.h input.h $(INSN_ATTR_H) xcoffout.h output.h diagnostic.h \
- insn-codes.h insn-config.h intl.h $(RECOG_H) Makefile toplev.h dwarfout.h \
+ insn-config.h intl.h $(RECOG_H) Makefile toplev.h dwarfout.h \
dwarf2out.h sdbout.h dbxout.h $(EXPR_H) hard-reg-set.h $(BASIC_BLOCK_H) \
- graph.h $(LOOP_H) except.h $(REGS_H) $(TIMEVAR_H) $(lang_options_files) ssa.h
+ graph.h $(LOOP_H) except.h $(REGS_H) $(TIMEVAR_H) $(lang_options_files) \
+ ssa.h $(PARAMS_H) $(TM_P_H) dwarf2asm.h
$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(MAYBE_USE_COLLECT2) \
-DTARGET_NAME=\"$(target_alias)\" \
-c $(srcdir)/toplev.c
@@ -1351,82 +1424,89 @@ rtl.o : rtl.c $(GCONFIG_H) system.h $(RTL_H) bitmap.h $(GGC_H) toplev.h
print-rtl.o : print-rtl.c $(GCONFIG_H) system.h $(RTL_H) hard-reg-set.h \
$(BASIC_BLOCK_H)
$(CC) -c $(ALL_CFLAGS) -DGENERATOR_FILE $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
-rtlanal.o : rtlanal.c $(CONFIG_H) system.h toplev.h $(RTL_H)
+rtlanal.o : rtlanal.c $(CONFIG_H) system.h toplev.h $(RTL_H) hard-reg-set.h
errors.o : errors.c $(GCONFIG_H) system.h errors.h
$(CC) -c $(ALL_CFLAGS) -DGENERATOR_FILE $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
varasm.o : varasm.c $(CONFIG_H) system.h $(TREE_H) $(RTL_H) flags.h \
function.h $(EXPR_H) hard-reg-set.h $(REGS_H) \
- xcoffout.h output.h c-pragma.h toplev.h dbxout.h sdbout.h $(GGC_H)
+ xcoffout.h output.h c-pragma.h toplev.h dbxout.h sdbout.h $(GGC_H) $(TM_P_H)
function.o : function.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h \
- function.h insn-flags.h insn-codes.h $(EXPR_H) $(REGS_H) hard-reg-set.h \
- insn-config.h $(RECOG_H) output.h toplev.h except.h hash.h $(GGC_H)
+ function.h $(EXPR_H) $(REGS_H) hard-reg-set.h \
+ insn-config.h $(RECOG_H) output.h toplev.h except.h hash.h $(GGC_H) $(TM_P_H)
stmt.o : stmt.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h function.h \
- insn-flags.h insn-config.h insn-codes.h hard-reg-set.h $(EXPR_H) except.h \
- $(LOOP_H) $(RECOG_H) toplev.h output.h varray.h $(GGC_H)
+ insn-config.h hard-reg-set.h $(EXPR_H) except.h \
+ $(LOOP_H) $(RECOG_H) toplev.h output.h varray.h $(GGC_H) $(TM_P_H)
except.o : except.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h \
- function.h insn-flags.h $(EXPR_H) $(REGS_H) hard-reg-set.h \
- insn-config.h $(RECOG_H) output.h except.h toplev.h intl.h $(GGC_H)
+ except.h function.h $(EXPR_H) integrate.h \
+ insn-config.h hard-reg-set.h $(BASIC_BLOCK_H) output.h \
+ dwarf2asm.h dwarf2out.h toplev.h $(HASHTAB_H) intl.h $(GGC_H)
expr.o : expr.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h function.h \
- $(REGS_H) insn-flags.h insn-codes.h $(EXPR_H) insn-config.h $(RECOG_H) \
+ $(REGS_H) $(EXPR_H) insn-config.h $(RECOG_H) \
output.h typeclass.h hard-reg-set.h toplev.h hard-reg-set.h except.h \
- reload.h $(GGC_H) intl.h
+ reload.h $(GGC_H) intl.h $(TM_P_H)
builtins.o : builtins.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h \
- function.h $(REGS_H) insn-flags.h insn-codes.h $(EXPR_H) insn-config.h \
+ function.h $(REGS_H) $(EXPR_H) insn-config.h \
$(RECOG_H) output.h typeclass.h hard-reg-set.h toplev.h hard-reg-set.h \
- except.h
+ except.h $(TM_P_H)
calls.o : calls.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h $(EXPR_H) \
- insn-flags.h $(REGS_H) toplev.h output.h function.h $(TIMEVAR_H)
+ $(REGS_H) toplev.h output.h function.h $(TIMEVAR_H) $(TM_P_H)
expmed.o : expmed.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h \
- insn-flags.h insn-config.h insn-codes.h $(EXPR_H) $(RECOG_H) real.h toplev.h
+ insn-config.h $(EXPR_H) $(RECOG_H) real.h \
+ toplev.h $(TM_P_H)
explow.o : explow.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h \
- hard-reg-set.h insn-config.h $(EXPR_H) $(RECOG_H) insn-flags.h \
- insn-codes.h toplev.h function.h
+ hard-reg-set.h insn-config.h $(EXPR_H) $(RECOG_H) \
+ toplev.h function.h $(TM_P_H)
optabs.o : optabs.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h \
- insn-flags.h insn-config.h insn-codes.h $(EXPR_H) $(RECOG_H) reload.h \
- toplev.h $(GGC_H) real.h
+ insn-config.h $(EXPR_H) $(RECOG_H) reload.h \
+ toplev.h $(GGC_H) real.h $(TM_P_H)
dbxout.o : dbxout.c $(CONFIG_H) system.h $(TREE_H) $(RTL_H) flags.h $(REGS_H) \
- insn-config.h reload.h gstab.h xcoffout.h output.h dbxout.h toplev.h
+ insn-config.h reload.h gstab.h xcoffout.h output.h dbxout.h toplev.h \
+ $(TM_P_H)
sdbout.o : sdbout.c $(CONFIG_H) system.h $(TREE_H) $(RTL_H) flags.h except.h \
function.h $(EXPR_H) output.h hard-reg-set.h $(REGS_H) real.h \
- insn-config.h $(OBSTACK_H) xcoffout.h c-pragma.h \
- sdbout.h toplev.h
+ insn-config.h $(OBSTACK_H) xcoffout.h c-pragma.h ggc.h \
+ sdbout.h toplev.h $(TM_P_H)
dwarfout.o : dwarfout.c $(CONFIG_H) system.h $(TREE_H) $(RTL_H) dwarf.h \
- flags.h insn-config.h reload.h output.h toplev.h dwarfout.h
+ flags.h insn-config.h reload.h output.h toplev.h dwarfout.h $(TM_P_H)
dwarf2out.o : dwarf2out.c $(CONFIG_H) system.h $(TREE_H) $(RTL_H) dwarf2.h \
flags.h insn-config.h reload.h output.h \
hard-reg-set.h $(REGS_H) $(EXPR_H) toplev.h dwarf2out.h varray.h \
- $(GGC_H) except.h
+ $(GGC_H) except.h dwarf2asm.h $(TM_P_H)
+dwarf2asm.o : dwarf2asm.c $(CONFIG_H) $(SYSTEM_H) flags.h $(TREE_H) $(RTL_H) \
+ output.h dwarf2asm.h $(TM_P_H)
xcoffout.o : xcoffout.c $(CONFIG_H) system.h $(TREE_H) $(RTL_H) xcoffout.h \
- flags.h toplev.h output.h dbxout.h $(GGC_H)
+ flags.h toplev.h output.h dbxout.h $(GGC_H) $(TM_P_H)
emit-rtl.o : emit-rtl.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h \
function.h $(REGS_H) insn-config.h $(RECOG_H) real.h $(GGC_H) \
$(EXPR_H) $(srcdir)/../include/obstack.h hard-reg-set.h bitmap.h toplev.h \
- $(HASHTAB_H)
-real.o : real.c $(CONFIG_H) system.h $(TREE_H) toplev.h
+ $(HASHTAB_H) $(TM_P_H)
+real.o : real.c $(CONFIG_H) system.h $(TREE_H) toplev.h $(TM_P_H)
integrate.o : integrate.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h \
- $(INTEGRATE_H) insn-flags.h insn-config.h $(EXPR_H) real.h $(REGS_H) \
- intl.h function.h output.h $(RECOG_H) except.h toplev.h $(LOOP_H)
+ $(INTEGRATE_H) insn-config.h $(EXPR_H) real.h $(REGS_H) \
+ intl.h function.h output.h $(RECOG_H) except.h toplev.h $(LOOP_H) \
+ $(PARAMS_H) $(TM_P_H)
jump.o : jump.c $(CONFIG_H) system.h $(RTL_H) flags.h hard-reg-set.h $(REGS_H) \
- insn-config.h insn-flags.h $(RECOG_H) $(EXPR_H) real.h except.h function.h \
- toplev.h $(INSN_ATTR_H)
+ insn-config.h $(RECOG_H) $(EXPR_H) real.h except.h function.h \
+ toplev.h $(INSN_ATTR_H) $(TM_P_H)
simplify-rtx.o : simplify-rtx.c $(CONFIG_H) system.h $(RTL_H) $(REGS_H) \
hard-reg-set.h flags.h real.h insn-config.h $(RECOG_H) $(EXPR_H) toplev.h \
- output.h function.h cselib.h $(GGC_H) $(OBSTACK_H)
+ output.h function.h cselib.h $(GGC_H) $(OBSTACK_H) $(TM_P_H)
cse.o : cse.c $(CONFIG_H) system.h $(RTL_H) $(REGS_H) hard-reg-set.h flags.h \
real.h insn-config.h $(RECOG_H) $(EXPR_H) toplev.h output.h function.h \
- $(BASIC_BLOCK_H) $(GGC_H)
+ $(BASIC_BLOCK_H) $(GGC_H) $(TM_P_H)
gcse.o : gcse.c $(CONFIG_H) system.h $(RTL_H) $(REGS_H) hard-reg-set.h \
flags.h real.h insn-config.h $(RECOG_H) $(EXPR_H) $(BASIC_BLOCK_H) \
- function.h output.h toplev.h
+ function.h output.h toplev.h $(PARAMS_H) $(TM_P_H)
sibcall.o : sibcall.c $(CONFIG_H) system.h $(RTL_H) $(REGS_H) function.h \
hard-reg-set.h flags.h insn-config.h $(RECOG_H) $(BASIC_BLOCK_H)
resource.o : resource.c $(CONFIG_H) $(RTL_H) hard-reg-set.h system.h \
$(BASIC_BLOCK_H) $(REGS_H) flags.h output.h resource.h function.h toplev.h \
- $(INSN_ATTR_H) except.h
+ $(INSN_ATTR_H) except.h $(PARAMS_H) $(TM_P_H)
lcm.o : lcm.c $(CONFIG_H) system.h $(RTL_H) $(REGS_H) hard-reg-set.h flags.h \
- real.h insn-config.h $(INSN_ATTR_H) $(RECOG_H) $(EXPR_H) $(BASIC_BLOCK_H)
+ real.h insn-config.h $(INSN_ATTR_H) $(RECOG_H) $(EXPR_H) $(BASIC_BLOCK_H) \
+ $(TM_P_H)
ssa.o : ssa.c $(CONFIG_H) system.h $(REGS_H) varray.h \
hard-reg-set.h flags.h function.h real.h insn-config.h $(RECOG_H) \
$(BASIC_BLOCK_H) output.h ssa.h
@@ -1435,100 +1515,102 @@ dce.o : dce.c $(CONFIG_H) system.h $(RTL_H) hard-reg-set.h $(BASIC_BLOCK_H) \
conflict.o : conflict.c $(CONFIG_H) system.h $(OBSTACK_H) $(HASHTAB_H) \
$(RTL_H) hard-reg-set.h $(BASIC_BLOCK_H)
profile.o : profile.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h \
- insn-flags.h insn-config.h output.h $(REGS_H) $(EXPR_H) function.h \
+ insn-config.h output.h $(REGS_H) $(EXPR_H) function.h \
gcov-io.h toplev.h $(GGC_H) hard-reg-set.h $(BASIC_BLOCK_H)
loop.o : loop.c $(CONFIG_H) system.h $(RTL_H) flags.h $(LOOP_H) insn-config.h \
- insn-flags.h $(REGS_H) hard-reg-set.h $(RECOG_H) $(EXPR_H) real.h \
- $(BASIC_BLOCK_H) function.h toplev.h varray.h except.h cselib.h
+ $(REGS_H) hard-reg-set.h $(RECOG_H) $(EXPR_H) real.h \
+ $(BASIC_BLOCK_H) function.h toplev.h varray.h except.h cselib.h $(TM_P_H)
doloop.o : doloop.c $(CONFIG_H) system.h $(RTL_H) flags.h $(LOOP_H) \
- insn-flags.h $(EXPR_H) hard-reg-set.h $(BASIC_BLOCK_H)
+ $(EXPR_H) hard-reg-set.h $(BASIC_BLOCK_H) $(TM_P_H)
unroll.o : unroll.c $(CONFIG_H) system.h $(RTL_H) insn-config.h function.h \
$(INTEGRATE_H) $(REGS_H) $(RECOG_H) flags.h $(EXPR_H) $(LOOP_H) toplev.h \
- hard-reg-set.h varray.h $(BASIC_BLOCK_H)
+ hard-reg-set.h varray.h $(BASIC_BLOCK_H) $(TM_P_H)
flow.o : flow.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h insn-config.h \
$(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h output.h toplev.h $(RECOG_H) \
- insn-flags.h function.h except.h $(EXPR_H) ssa.h $(GGC_H)
+ function.h except.h $(EXPR_H) ssa.h $(GGC_H) $(TM_P_H)
dominance.o : dominance.c $(CONFIG_H) system.h $(RTL_H) hard-reg-set.h \
$(BASIC_BLOCK_H)
combine.o : combine.c $(CONFIG_H) system.h $(RTL_H) flags.h function.h \
- insn-config.h insn-flags.h insn-codes.h $(INSN_ATTR_H) $(REGS_H) $(EXPR_H) \
- $(BASIC_BLOCK_H) $(RECOG_H) real.h hard-reg-set.h toplev.h
+ insn-config.h $(INSN_ATTR_H) $(REGS_H) $(EXPR_H) \
+ $(BASIC_BLOCK_H) $(RECOG_H) real.h hard-reg-set.h toplev.h $(TM_P_H)
regclass.o : regclass.c $(CONFIG_H) system.h $(RTL_H) hard-reg-set.h flags.h \
$(BASIC_BLOCK_H) $(REGS_H) insn-config.h $(RECOG_H) reload.h real.h \
- toplev.h function.h output.h $(GGC_H)
+ toplev.h function.h output.h $(GGC_H) $(TM_P_H)
local-alloc.o : local-alloc.c $(CONFIG_H) system.h $(RTL_H) flags.h \
$(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h insn-config.h $(RECOG_H) \
- output.h function.h $(INSN_ATTR_H) toplev.h
+ output.h function.h $(INSN_ATTR_H) toplev.h $(TM_P_H)
bitmap.o : bitmap.c $(GCONFIG_H) system.h $(RTL_H) flags.h $(BASIC_BLOCK_H) \
$(REGS_H)
$(CC) -c $(ALL_CFLAGS) -DGENERATOR_FILE $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
global.o : global.c $(CONFIG_H) system.h $(RTL_H) flags.h reload.h function.h \
- $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h insn-config.h output.h toplev.h
+ $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h insn-config.h output.h toplev.h \
+ $(TM_P_H)
varray.o : varray.c $(CONFIG_H) system.h varray.h $(RTL_H) $(TREE_H) bitmap.h
reload.o : reload.c $(CONFIG_H) system.h $(RTL_H) flags.h output.h $(EXPR_H) \
- reload.h $(RECOG_H) hard-reg-set.h insn-config.h insn-codes.h $(REGS_H) \
- function.h real.h toplev.h
+ reload.h $(RECOG_H) hard-reg-set.h insn-config.h $(REGS_H) \
+ function.h real.h toplev.h $(TM_P_H)
reload1.o : reload1.c $(CONFIG_H) system.h $(RTL_H) real.h flags.h $(EXPR_H) \
- reload.h $(REGS_H) hard-reg-set.h insn-config.h insn-flags.h insn-codes.h \
- $(BASIC_BLOCK_H) $(RECOG_H) output.h function.h toplev.h cselib.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)
caller-save.o : caller-save.c $(CONFIG_H) system.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
+ $(RECOG_H) reload.h $(EXPR_H) toplev.h $(TM_P_H)
reorg.o : reorg.c $(CONFIG_H) system.h $(RTL_H) conditions.h hard-reg-set.h \
- $(BASIC_BLOCK_H) $(REGS_H) insn-config.h $(INSN_ATTR_H) insn-flags.h \
- $(RECOG_H) function.h flags.h output.h $(EXPR_H) toplev.h
+ $(BASIC_BLOCK_H) $(REGS_H) insn-config.h $(INSN_ATTR_H) \
+ $(RECOG_H) function.h flags.h output.h $(EXPR_H) toplev.h $(PARAMS_H) $(TM_P_H)
alias.o : alias.c $(CONFIG_H) system.h $(RTL_H) flags.h hard-reg-set.h \
- $(BASIC_BLOCK_H) $(REGS_H) toplev.h output.h $(EXPR_H) insn-flags.h \
- $(GGC_H) function.h cselib.h $(TREE_H)
+ $(BASIC_BLOCK_H) $(REGS_H) toplev.h output.h $(EXPR_H) \
+ $(GGC_H) function.h cselib.h $(TREE_H) $(TM_P_H)
regmove.o : regmove.c $(CONFIG_H) system.h $(RTL_H) insn-config.h \
$(RECOG_H) output.h $(REGS_H) hard-reg-set.h flags.h function.h \
- $(EXPR_H) insn-flags.h $(BASIC_BLOCK_H) toplev.h
+ $(EXPR_H) $(BASIC_BLOCK_H) toplev.h $(TM_P_H) except.h
haifa-sched.o : haifa-sched.c $(CONFIG_H) system.h $(RTL_H) sched-int.h \
$(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h flags.h insn-config.h function.h \
- $(INSN_ATTR_H) insn-flags.h toplev.h $(RECOG_H) except.h
+ $(INSN_ATTR_H) toplev.h $(RECOG_H) except.h $(TM_P_H)
sched-deps.o : sched-deps.c $(CONFIG_H) system.h $(RTL_H) sched-int.h \
$(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h flags.h insn-config.h function.h \
- $(INSN_ATTR_H) toplev.h $(RECOG_H) except.h
+ $(INSN_ATTR_H) toplev.h $(RECOG_H) except.h $(TM_P_H)
sched-rgn.o : sched-rgn.c $(CONFIG_H) system.h $(RTL_H) sched-int.h \
$(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h flags.h insn-config.h function.h \
- $(INSN_ATTR_H) toplev.h $(RECOG_H) except.h
+ $(INSN_ATTR_H) toplev.h $(RECOG_H) except.h $(TM_P_H)
sched-ebb.o : sched-ebb.c $(CONFIG_H) system.h $(RTL_H) sched-int.h \
$(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h flags.h insn-config.h function.h \
- $(INSN_ATTR_H) toplev.h $(RECOG_H) except.h
+ $(INSN_ATTR_H) toplev.h $(RECOG_H) except.h $(TM_P_H)
sched-vis.o : sched-vis.c $(CONFIG_H) system.h $(RTL_H) sched-int.h \
- hard-reg-set.h $(BASIC_BLOCK_H) $(INSN_ATTR_H) $(REGS_H)
+ hard-reg-set.h $(BASIC_BLOCK_H) $(INSN_ATTR_H) $(REGS_H) $(TM_P_H)
final.o : final.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h intl.h \
$(REGS_H) $(RECOG_H) conditions.h insn-config.h $(INSN_ATTR_H) function.h \
- real.h output.h hard-reg-set.h insn-flags.h insn-codes.h gstab.h except.h \
+ real.h output.h hard-reg-set.h gstab.h except.h \
xcoffout.h toplev.h reload.h dwarfout.h dwarf2out.h sdbout.h \
- dbxout.h $(BASIC_BLOCK_H)
+ dbxout.h $(BASIC_BLOCK_H) $(TM_P_H)
recog.o : recog.c $(CONFIG_H) system.h $(RTL_H) function.h $(BASIC_BLOCK_H) \
$(REGS_H) $(RECOG_H) hard-reg-set.h flags.h insn-config.h $(INSN_ATTR_H) \
- insn-flags.h insn-codes.h real.h toplev.h output.h reload.h
+ real.h toplev.h output.h reload.h $(TM_P_H)
reg-stack.o : reg-stack.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) $(RECOG_H) \
- $(REGS_H) hard-reg-set.h flags.h insn-config.h insn-flags.h toplev.h \
- varray.h function.h
+ $(REGS_H) hard-reg-set.h flags.h insn-config.h toplev.h \
+ varray.h function.h $(TM_P_H)
predict.o: predict.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h \
insn-config.h $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h output.h toplev.h \
- $(RECOG_H) insn-flags.h function.h except.h $(EXPR_H)
+ $(RECOG_H) function.h except.h $(EXPR_H) $(TM_P_H)
lists.o: lists.c $(CONFIG_H) system.h toplev.h $(RTL_H) $(GGC_H)
bb-reorder.o : bb-reorder.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h \
insn-config.h $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h output.h toplev.h \
- $(RECOG_H) insn-flags.h function.h except.h $(EXPR_H)
+ $(RECOG_H) function.h except.h $(EXPR_H) $(TM_P_H)
timevar.o : timevar.c $(CONFIG_H) system.h $(TIMEVAR_H) flags.h intl.h
regrename.o : regrename.c $(CONFIG_H) system.h $(RTL_H) insn-config.h \
$(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h output.h $(RECOG_H) function.h \
- resource.h $(OBSTACK_H) flags.h
+ resource.h $(OBSTACK_H) flags.h $(TM_P_H)
ifcvt.o : ifcvt.c $(CONFIG_H) system.h $(RTL_H) $(REGS_H) \
flags.h insn-config.h function.h $(RECOG_H) $(BASIC_BLOCK_H) $(EXPR_H) \
- output.h
+ output.h $(TM_P_H)
dependence.o : dependence.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) \
$(C_COMMON_H) flags.h varray.h $(EXPR_H)
+params.o : params.c $(CONFIG_H) system.h $(PARAMS_H) toplev.h
$(out_object_file): $(out_file) $(CONFIG_H) $(TREE_H) $(GGC_H) \
$(RTL_H) $(REGS_H) hard-reg-set.h real.h insn-config.h conditions.h \
- insn-flags.h output.h $(INSN_ATTR_H) insn-codes.h system.h toplev.h \
- function.h sched-int.h
+ output.h $(INSN_ATTR_H) system.h toplev.h \
+ function.h sched-int.h $(TM_P_H)
$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
$(out_file) $(OUTPUT_OPTION)
@@ -1547,9 +1629,8 @@ mips-tdump.o : mips-tdump.c $(CONFIG_H) $(RTL_H) system.h
halfpic.o: halfpic.c $(CONFIG_H) $(RTL_H) $(TREE_H) system.h
# Normally this target is not used; but it is used if you
-# define ALLOCA=alloca.o. In that case, you must get a suitable alloca.c
-# from the GNU Emacs distribution.
-alloca.o: $(srcdir)/../libiberty/alloca.c
+# define ALLOCA=alloca.o.
+alloca.o: $(srcdir)/../libiberty/alloca.c $(GCONFIG_H)
rm -f alloca.c
$(LN_S) $(srcdir)/../libiberty/alloca.c alloca.c
$(CC) $(ALL_CFLAGS) -DGENERATOR_FILE $(ALL_CPPFLAGS) $(INCLUDES) \
@@ -1586,42 +1667,43 @@ insn-config.h: s-config ; @true
s-config : $(md_file) genconfig$(build_exeext) $(srcdir)/move-if-change
./genconfig$(build_exeext) $(md_file) > tmp-config.h
$(SHELL) $(srcdir)/move-if-change tmp-config.h insn-config.h
- touch s-config
+ $(STAMP) s-config
insn-flags.h: s-flags ; @true
s-flags : $(md_file) genflags$(build_exeext) $(srcdir)/move-if-change
./genflags$(build_exeext) $(md_file) > tmp-flags.h
$(SHELL) $(srcdir)/move-if-change tmp-flags.h insn-flags.h
- touch s-flags
+ $(STAMP) s-flags
insn-codes.h: s-codes ; @true
s-codes : $(md_file) gencodes$(build_exeext) $(srcdir)/move-if-change
./gencodes$(build_exeext) $(md_file) > tmp-codes.h
$(SHELL) $(srcdir)/move-if-change tmp-codes.h insn-codes.h
- touch s-codes
+ $(STAMP) s-codes
insn-emit.o : insn-emit.c $(CONFIG_H) $(RTL_H) $(EXPR_H) real.h output.h \
- insn-config.h insn-flags.h insn-codes.h system.h reload.h $(RECOG_H) \
- function.h flags.h hard-reg-set.h resource.h
+ insn-config.h system.h reload.h $(RECOG_H) \
+ function.h flags.h hard-reg-set.h resource.h $(TM_P_H)
$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-emit.c
insn-emit.c: s-emit ; @true
s-emit : $(md_file) genemit$(build_exeext) $(srcdir)/move-if-change
./genemit$(build_exeext) $(md_file) > tmp-emit.c
$(SHELL) $(srcdir)/move-if-change tmp-emit.c insn-emit.c
- touch s-emit
+ $(STAMP) s-emit
insn-recog.o : insn-recog.c $(CONFIG_H) $(RTL_H) insn-config.h $(RECOG_H) \
- real.h output.h flags.h system.h function.h hard-reg-set.h resource.h
+ real.h output.h flags.h system.h function.h hard-reg-set.h resource.h \
+ $(TM_P_H)
$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-recog.c
insn-recog.c: s-recog ; @true
s-recog : $(md_file) genrecog$(build_exeext) $(srcdir)/move-if-change
./genrecog$(build_exeext) $(md_file) > tmp-recog.c
$(SHELL) $(srcdir)/move-if-change tmp-recog.c insn-recog.c
- touch s-recog
+ $(STAMP) s-recog
-insn-opinit.o : insn-opinit.c $(CONFIG_H) $(RTL_H) insn-codes.h insn-flags.h \
+insn-opinit.o : insn-opinit.c $(CONFIG_H) $(RTL_H) \
insn-config.h flags.h $(RECOG_H) $(EXPR_H) reload.h system.h
$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-opinit.c
@@ -1629,7 +1711,7 @@ insn-opinit.c: s-opinit ; @true
s-opinit : $(md_file) genopinit$(build_exeext) $(srcdir)/move-if-change
./genopinit$(build_exeext) $(md_file) > tmp-opinit.c
$(SHELL) $(srcdir)/move-if-change tmp-opinit.c insn-opinit.c
- touch s-opinit
+ $(STAMP) s-opinit
insn-extract.o : insn-extract.c $(CONFIG_H) $(RTL_H) system.h toplev.h \
insn-config.h $(RECOG_H)
@@ -1639,44 +1721,45 @@ insn-extract.c: s-extract ; @true
s-extract : $(md_file) genextract$(build_exeext) $(srcdir)/move-if-change
./genextract$(build_exeext) $(md_file) > tmp-extract.c
$(SHELL) $(srcdir)/move-if-change tmp-extract.c insn-extract.c
- touch s-extract
+ $(STAMP) s-extract
insn-peep.o : insn-peep.c $(CONFIG_H) $(RTL_H) $(REGS_H) output.h real.h \
- system.h insn-config.h $(RECOG_H) except.h function.h
+ system.h insn-config.h $(RECOG_H) except.h function.h $(TM_P_H)
$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-peep.c
insn-peep.c: s-peep ; @true
s-peep : $(md_file) genpeep$(build_exeext) $(srcdir)/move-if-change
./genpeep$(build_exeext) $(md_file) > tmp-peep.c
$(SHELL) $(srcdir)/move-if-change tmp-peep.c insn-peep.c
- touch s-peep
+ $(STAMP) s-peep
insn-attrtab.o : insn-attrtab.c $(CONFIG_H) $(RTL_H) $(REGS_H) real.h \
- output.h $(INSN_ATTR_H) insn-config.h system.h toplev.h $(RECOG_H)
+ output.h $(INSN_ATTR_H) insn-config.h system.h toplev.h $(RECOG_H) $(TM_P_H)
$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-attrtab.c
insn-attr.h: s-attr ; @true
s-attr : $(md_file) genattr$(build_exeext) $(srcdir)/move-if-change
./genattr$(build_exeext) $(md_file) > tmp-attr.h
$(SHELL) $(srcdir)/move-if-change tmp-attr.h insn-attr.h
- touch s-attr
+ $(STAMP) s-attr
insn-attrtab.c: s-attrtab ; @true
s-attrtab : $(md_file) genattrtab$(build_exeext) $(srcdir)/move-if-change
./genattrtab$(build_exeext) $(md_file) > tmp-attrtab.c
$(SHELL) $(srcdir)/move-if-change tmp-attrtab.c insn-attrtab.c
- touch s-attrtab
+ $(STAMP) s-attrtab
insn-output.o : insn-output.c $(CONFIG_H) $(RTL_H) $(GGC_H) $(REGS_H) real.h \
- conditions.h hard-reg-set.h insn-config.h insn-flags.h $(INSN_ATTR_H) \
- output.h $(RECOG_H) function.h insn-codes.h system.h toplev.h flags.h
+ conditions.h hard-reg-set.h insn-config.h $(INSN_ATTR_H) \
+ output.h $(RECOG_H) function.h system.h toplev.h flags.h \
+ $(TM_P_H)
$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-output.c
insn-output.c: s-output ; @true
s-output : $(md_file) genoutput$(build_exeext) $(srcdir)/move-if-change
./genoutput$(build_exeext) $(md_file) > tmp-output.c
$(SHELL) $(srcdir)/move-if-change tmp-output.c insn-output.c
- touch s-output
+ $(STAMP) s-output
genrtl.o : genrtl.c $(CONFIG_H) $(RTL_H) system.h $(GGC_H)
genrtl.c genrtl.h : s-genrtl
@@ -1687,7 +1770,7 @@ s-genrtl: gengenrtl$(build_exeext) $(srcdir)/move-if-change $(RTL_BASE_H)
$(SHELL) $(srcdir)/move-if-change tmp-genrtl.h genrtl.h
./gengenrtl$(build_exeext) >tmp-genrtl.c
$(SHELL) $(srcdir)/move-if-change tmp-genrtl.c genrtl.c
- touch s-genrtl
+ $(STAMP) s-genrtl
#
# Compile the programs that generate insn-* from the machine description.
# They are compiled with $(HOST_CC), and associated libraries,
@@ -1716,7 +1799,7 @@ genconfig$(build_exeext) : genconfig.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS)
$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
genconfig.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBS)
-genconfig.o : genconfig.c $(RTL_H) $(build_xm_file) \
+genconfig.o : genconfig.c $(RTL_H) $(HCONFIG_H) \
system.h errors.h gensupport.h
$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genconfig.c
@@ -1724,7 +1807,7 @@ genflags$(build_exeext) : genflags.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(
$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
genflags.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBS)
-genflags.o : genflags.c $(RTL_H) $(OBSTACK_H) $(build_xm_file) \
+genflags.o : genflags.c $(RTL_H) $(OBSTACK_H) $(HCONFIG_H) \
system.h errors.h gensupport.h
$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genflags.c
@@ -1732,7 +1815,7 @@ gencodes$(build_exeext) : gencodes.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(
$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
gencodes.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBS)
-gencodes.o : gencodes.c $(RTL_H) $(build_xm_file) \
+gencodes.o : gencodes.c $(RTL_H) $(HCONFIG_H) \
system.h errors.h gensupport.h
$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/gencodes.c
@@ -1740,14 +1823,14 @@ genemit$(build_exeext) : genemit.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HO
$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
genemit.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBS)
-genemit.o : genemit.c $(RTL_H) $(build_xm_file) system.h errors.h gensupport.h
+genemit.o : genemit.c $(RTL_H) $(HCONFIG_H) system.h errors.h gensupport.h
$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genemit.c
genopinit$(build_exeext) : genopinit.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS)
$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
genopinit.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBS)
-genopinit.o : genopinit.c $(RTL_H) $(build_xm_file) \
+genopinit.o : genopinit.c $(RTL_H) $(HCONFIG_H) \
system.h errors.h gensupport.h
$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genopinit.c
@@ -1755,15 +1838,15 @@ genrecog$(build_exeext) : genrecog.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(
$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
genrecog.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBS)
-genrecog.o : genrecog.c $(RTL_H) $(build_xm_file) \
+genrecog.o : genrecog.c $(RTL_H) $(HCONFIG_H) \
system.h errors.h gensupport.h
- $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genrecog.c
+ $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genrecog.c
genextract$(build_exeext) : genextract.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS)
$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
genextract.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBS)
-genextract.o : genextract.c $(RTL_H) $(build_xm_file) \
+genextract.o : genextract.c $(RTL_H) $(HCONFIG_H) \
system.h insn-config.h errors.h gensupport.h
$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genextract.c
@@ -1771,21 +1854,21 @@ genpeep$(build_exeext) : genpeep.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HO
$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
genpeep.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBS)
-genpeep.o : genpeep.c $(RTL_H) $(build_xm_file) system.h errors.h gensupport.h
+genpeep.o : genpeep.c $(RTL_H) $(HCONFIG_H) system.h errors.h gensupport.h
$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genpeep.c
genattr$(build_exeext) : genattr.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS)
$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
genattr.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBS)
-genattr.o : genattr.c $(RTL_H) $(build_xm_file) system.h errors.h gensupport.h
+genattr.o : genattr.c $(RTL_H) $(HCONFIG_H) system.h errors.h gensupport.h
$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genattr.c
genattrtab$(build_exeext) : genattrtab.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS)
$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
genattrtab.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBS)
-genattrtab.o : genattrtab.c $(RTL_H) $(OBSTACK_H) $(build_xm_file) \
+genattrtab.o : genattrtab.c $(RTL_H) $(OBSTACK_H) $(HCONFIG_H) \
system.h errors.h $(GGC_H) gensupport.h
$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genattrtab.c
@@ -1793,7 +1876,7 @@ genoutput$(build_exeext) : genoutput.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS)
$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
genoutput.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBS)
-genoutput.o : genoutput.c $(RTL_H) $(build_xm_file) \
+genoutput.o : genoutput.c $(RTL_H) $(HCONFIG_H) \
system.h errors.h gensupport.h
$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genoutput.c
@@ -1801,67 +1884,62 @@ gengenrtl$(build_exeext) : gengenrtl.o $(HOST_LIBDEPS)
$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
gengenrtl.o $(HOST_LIBS)
-gengenrtl.o : gengenrtl.c $(RTL_BASE_H) system.h real.h
+gengenrtl.o : gengenrtl.c $(RTL_BASE_H) $(HCONFIG_H) system.h real.h
$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/gengenrtl.c
#
# Compile the libraries to be used by gen*.
# If we are not cross-building, gen* use the same .o's that cc1 will use,
# and HOST_PREFIX_1 is `foobar', just to ensure these rules don't conflict
# with the rules for rtl.o, alloca.o, etc.
-$(HOST_PREFIX_1)rtl.o: $(srcdir)/rtl.c $(GCONFIG_H) system.h $(RTL_H) \
+$(HOST_PREFIX_1)rtl.o: $(srcdir)/rtl.c $(HCONFIG_H) system.h $(RTL_H) \
bitmap.h $(GGC_H) toplev.h $(HASHTAB_H)
rm -f $(HOST_PREFIX)rtl.c
sed -e 's/config[.]h/hconfig.h/' $(srcdir)/rtl.c > $(HOST_PREFIX)rtl.c
$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)rtl.c
-$(HOST_PREFIX_1)print-rtl.o: $(srcdir)/print-rtl.c $(CONFIG_H) \
+$(HOST_PREFIX_1)print-rtl.o: $(srcdir)/print-rtl.c $(HCONFIG_H) \
$(RTL_H) $(BASIC_BLOCK_H) system.h
rm -f $(HOST_PREFIX)print-rtl.c
sed -e 's/config[.]h/hconfig.h/' $(srcdir)/print-rtl.c > $(HOST_PREFIX)print-rtl.c
$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)print-rtl.c
-$(HOST_PREFIX_1)bitmap.o: $(srcdir)/bitmap.c $(CONFIG_H) system.h $(RTL_H) \
+$(HOST_PREFIX_1)bitmap.o: $(srcdir)/bitmap.c $(HCONFIG_H) system.h $(RTL_H) \
flags.h bitmap.h
rm -f $(HOST_PREFIX)bitmap.c
sed -e 's/config[.]h/hconfig.h/' $(srcdir)/bitmap.c > $(HOST_PREFIX)bitmap.c
$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)bitmap.c
-$(HOST_PREFIX_1)rtlanal.o: $(srcdir)/rtlanal.c $(CONFIG_H) system.h $(RTL_H)
- rm -f $(HOST_PREFIX)rtlanal.c
- sed -e 's/config[.]h/hconfig.h/' $(srcdir)/rtlanal.c > $(HOST_PREFIX)rtlanal.c
- $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)rtlanal.c
-
-$(HOST_PREFIX_1)alloca.o: $(srcdir)/../libiberty/alloca.c
+$(HOST_PREFIX_1)alloca.o: $(srcdir)/../libiberty/alloca.c $(HCONFIG_H)
rm -f $(HOST_PREFIX)alloca.c
- $(LN_S) $(srcdir)/../libiberty/alloca.c $(HOST_PREFIX)alloca.c
+ sed -e 's/config[.]h/hconfig.h/' $(srcdir)/../libiberty/alloca.c > $(HOST_PREFIX)alloca.c
$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)alloca.c
-$(HOST_PREFIX_1)obstack.o: $(srcdir)/../libiberty/obstack.c $(GCONFIG_H)
+$(HOST_PREFIX_1)obstack.o: $(srcdir)/../libiberty/obstack.c $(HCONFIG_H)
rm -f $(HOST_PREFIX)obstack.c
sed -e 's/config[.]h/hconfig.h/' $(srcdir)/../libiberty/obstack.c > $(HOST_PREFIX)obstack.c
$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)obstack.c
-$(HOST_PREFIX_1)vfprintf.o: $(srcdir)/../libiberty/vfprintf.c
+$(HOST_PREFIX_1)vfprintf.o: $(srcdir)/../libiberty/vfprintf.c $(HCONFIG_H)
rm -f $(HOST_PREFIX)vfprintf.c
sed -e 's/config[.]h/hconfig.h/' $(srcdir)/../libiberty/vfprintf.c > $(HOST_PREFIX)vfprintf.c
$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)vfprintf.c
-$(HOST_PREFIX_1)doprint.o: doprint.c
+$(HOST_PREFIX_1)doprint.o: doprint.c $(HCONFIG_H)
rm -f $(HOST_PREFIX)doprint.c
sed -e 's/config[.]h/hconfig.h/' $(srcdir)/doprint.c > $(HOST_PREFIX)doprint.c
$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)doprint.c
-$(HOST_PREFIX_1)strstr.o: $(srcdir)/../libiberty/strstr.c
+$(HOST_PREFIX_1)strstr.o: $(srcdir)/../libiberty/strstr.c $(HCONFIG_H)
rm -f $(HOST_PREFIX)strstr.c
sed -e 's/config[.]h/hconfig.h/' $(srcdir)/../libiberty/strstr.c > $(HOST_PREFIX)strstr.c
$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)strstr.c
-$(HOST_PREFIX_1)malloc.o: malloc.c
+$(HOST_PREFIX_1)malloc.o: malloc.c $(HCONFIG_H)
rm -f $(HOST_PREFIX)malloc.c
sed -e 's/config[.]h/hconfig.h/' $(srcdir)/malloc.c > $(HOST_PREFIX)malloc.c
$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)malloc.c
-$(HOST_PREFIX_1)errors.o: errors.c
+$(HOST_PREFIX_1)errors.o: errors.c $(HCONFIG_H)
rm -f $(HOST_PREFIX)errors.c
sed -e 's/config[.]h/hconfig.h/' $(srcdir)/errors.c > $(HOST_PREFIX)errors.c
$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)errors.c
@@ -1870,9 +1948,9 @@ $(HOST_PREFIX_1)errors.o: errors.c
# This satisfies the dependency that we get if you cross-compile a compiler
# that does not need to compile alloca, malloc or whatever.
$(HOST_PREFIX_1):
- touch $(HOST_PREFIX_1)
+ $(STAMP) $(HOST_PREFIX_1)
-$(HOST_PREFIX_1)ggc-none.o: ggc-none.c
+$(HOST_PREFIX_1)ggc-none.o: ggc-none.c $(HCONFIG_H)
rm -f $(HOST_PREFIX)ggc-none.c
sed -e 's/config[.]h/hconfig.h/' $(srcdir)/ggc-none.c > $(HOST_PREFIX)ggc-none.c
$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)ggc-none.c
@@ -1906,7 +1984,8 @@ PREPROCESSOR_DEFINES = \
-DGCC_INCLUDE_DIR=\"$(libsubdir)/include\" \
-DGPLUSPLUS_INCLUDE_DIR=\"$(gcc_gxx_include_dir)\" \
-DGPLUSPLUS_TOOL_INCLUDE_DIR=\"$(gcc_gxx_include_dir)/$(target_alias)\" \
- -DLOCAL_INCLUDE_DIR=\"$(includedir)\" \
+ -DGPLUSPLUS_BACKWARD_INCLUDE_DIR=\"$(gcc_gxx_include_dir)/backward\" \
+ -DLOCAL_INCLUDE_DIR=\"$(local_includedir)\" \
-DCROSS_INCLUDE_DIR=\"$(gcc_tooldir)/sys-include\" \
-DTOOL_INCLUDE_DIR=\"$(gcc_tooldir)/include\"
@@ -1949,7 +2028,7 @@ mkdeps.o: mkdeps.c $(CONFIG_H) system.h mkdeps.h
# The traditional mode preprocessor, a separate program for ease of
# maintenance. Some code is shared with the ISO-C cpp.
tradcpp0$(exeext): tradcpp.o tradcif.o cppdefault.o version.o intl.o \
- mkdeps.h $(LIBDEPS)
+ mkdeps.o $(LIBDEPS)
$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o tradcpp0$(exeext) \
tradcpp.o tradcif.o mkdeps.o cppdefault.o version.o intl.o $(LIBS)
@@ -2053,7 +2132,7 @@ stmp-int-hdrs: $(STMP_FIXINC) $(USER_H) xlimits.h
for file in .. $(USER_H); do \
if [ X$$file != X.. ]; then \
realfile=`echo $$file | sed -e 's|.*/\([^/]*\)$$|\1|'`; \
- touch include/$$realfile; \
+ $(STAMP) include/$$realfile; \
rm -f include/$$realfile; \
cp $$file include; \
chmod a+r include/$$realfile; \
@@ -2071,7 +2150,7 @@ stmp-int-hdrs: $(STMP_FIXINC) $(USER_H) xlimits.h
rm -f include/README
cp $(srcdir)/README-fixinc include/README
chmod a+r include/README
- touch $@
+ $(STAMP) $@
# fixinc.sh depends on this, not on specs directly.
# The idea is to make sure specs gets built, but not rerun fixinc.sh
@@ -2080,7 +2159,7 @@ specs.ready: specs
-if [ -f specs.ready ] ; then \
true; \
else \
- touch specs.ready; \
+ $(STAMP) specs.ready; \
fi
FIXINCSRCDIR=$(srcdir)/fixinc
@@ -2089,7 +2168,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="$(CC)"; CFLAGS="$(CFLAGS)"; LDFLAGS="$(LDFLAGS)"; \
+ CC="$(HOST_CC)"; CFLAGS="$(HOST_CFLAGS)"; LDFLAGS="$(HOST_LDFLAGS)"; \
WARN_CFLAGS="$(WARN_CFLAGS)"; \
export MAKE srcdir CC CFLAGS LDFLAGS WARN_CFLAGS; cd ./fixinc && \
$(SHELL) $${srcdir}/mkfixinc.sh $(build_canonical) $(target))
@@ -2099,8 +2178,8 @@ stmp-fixinc: fixinc.sh gsyslimits.h
rm -rf include; mkdir include
-chmod a+rx include
(TARGET_MACHINE=$(target); srcdir=`cd $(srcdir); pwd`; \
- INSTALL_ASSERT_H=$(INSTALL_ASSERT_H); SHELL=$(SHELL) ;\
- export TARGET_MACHINE srcdir INSTALL_ASSERT_H SHELL ; \
+ SHELL=$(SHELL) ;\
+ export TARGET_MACHINE srcdir SHELL ; \
$(SHELL) ./fixinc.sh `pwd`/include $(SYSTEM_HEADER_DIR) $(OTHER_FIXINCLUDES_DIRS); \
rm -f include/syslimits.h; \
if [ -f include/limits.h ]; then \
@@ -2109,21 +2188,21 @@ stmp-fixinc: fixinc.sh gsyslimits.h
cp $(srcdir)/gsyslimits.h include/syslimits.h; \
fi; \
chmod a+r include/syslimits.h)
-# If $(SYSTEM_HEADER_DIR) is $(tooldir)/sys-include, and
+# If $(SYSTEM_HEADER_DIR) is $(build_tooldir)/sys-include, and
# that directory exists, then make sure that $(libsubdir) exists.
-# This is because cpp is compiled to find $(tooldir)/include via
+# This is because cpp is compiled to find $(gcc_tooldir)/include via
# $(libsubdir)/$(unlibsubdir), which will only work if $(libsubdir)
# exists.
-# We deliberately use tooldir instead of gcc_tooldir here. gcc_tooldir
-# won't work because libsubdir doesn't exist yet.
- if [ "$(SYSTEM_HEADER_DIR)" = "$(tooldir)/sys-include" ] \
- && [ -d $(tooldir)/sys-include ]; then \
+# ??? Better would be to use -isystem $(build_tooldir)/sys-include,
+# but fixincludes does not take such arguments.
+ if [ "$(SYSTEM_HEADER_DIR)" = "$(build_tooldir)/sys-include" ] \
+ && [ -d $(build_tooldir)/sys-include ]; then \
if [ -d $(libdir) ] ; then true ; else mkdir $(libdir) ; fi; \
if [ -d $(libdir)/gcc-lib ] ; then true ; else mkdir $(libdir)/gcc-lib; fi; \
if [ -d $(libdir)/gcc-lib/$(target_alias) ] ; then true ; else mkdir $(libdir)/gcc-lib/$(target_alias) ; fi; \
if [ -d $(libdir)/gcc-lib/$(target_alias)/$(version) ] ; then true ; else mkdir $(libdir)/gcc-lib/$(target_alias)/$(version) ; fi; \
else true; fi
- touch stmp-fixinc
+ $(STAMP) stmp-fixinc
# Files related to the fixproto script.
# gen-protos and fix-header are compiled with HOST_CC, but they are only
@@ -2138,7 +2217,7 @@ deduced.h: $(GCC_PASSES) $(srcdir)/scan-types.sh stmp-int-hdrs
$(SHELL) $(srcdir)/scan-types.sh "$(srcdir)" >tmp-deduced.h; \
mv tmp-deduced.h deduced.h; \
else \
- touch deduced.h; \
+ $(STAMP) deduced.h; \
fi
GEN_PROTOS_OBJS = gen-protos.o scan.o
@@ -2146,10 +2225,10 @@ gen-protos$(build_exeext): $(GEN_PROTOS_OBJS)
${HOST_CC} $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
$(GEN_PROTOS_OBJS) ../libiberty/libiberty.a
-gen-protos.o: gen-protos.c scan.h $(build_xm_file) system.h
+gen-protos.o: gen-protos.c scan.h $(HCONFIG_H) system.h
$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/gen-protos.c
-scan.o: scan.c scan.h $(build_xm_file) system.h
+scan.o: scan.c scan.h $(HCONFIG_H) system.h
$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/scan.c
xsys-protos.h: $(GCC_PASSES) $(srcdir)/sys-protos.h deduced.h gen-protos$(build_exeext) Makefile
@@ -2164,27 +2243,27 @@ xsys-protos.h: $(GCC_PASSES) $(srcdir)/sys-protos.h deduced.h gen-protos$(build_
# This is nominally a 'build' program, but it's run only when host==build,
# so we can (indeed, must) use $(LIBDEPS) and $(LIBS).
-fix-header: fix-header.o scan-decls.o scan.o xsys-protos.h $(LIBDEPS) \
- libcpp.a
+fix-header$(build_exeext): fix-header.o scan-decls.o scan.o xsys-protos.h \
+ $(LIBDEPS) libcpp.a
$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ fix-header.o \
scan-decls.o scan.o libcpp.a $(LIBS)
fix-header.o: fix-header.c $(OBSTACK_H) scan.h \
- xsys-protos.h $(build_xm_file) system.h cpplib.h
+ xsys-protos.h $(HCONFIG_H) system.h cpplib.h
$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/fix-header.c
-scan-decls.o: scan-decls.c scan.h cpplib.h $(build_xm_file) system.h
+scan-decls.o: scan-decls.c scan.h cpplib.h $(HCONFIG_H) system.h
$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/scan-decls.c
# stmp-fixproto depends on this, not on fix-header directly.
# The idea is to make sure fix-header gets built,
# but not rerun fixproto after each stage
# just because fix-header's mtime has changed.
-fixhdr.ready: fix-header
+fixhdr.ready: fix-header$(build_exeext)
-if [ -f fixhdr.ready ] ; then \
true; \
else \
- touch fixhdr.ready; \
+ $(STAMP) fixhdr.ready; \
fi
# stmp-int-headers is to make sure fixincludes has already finished.
@@ -2201,72 +2280,101 @@ stmp-fixproto: fixhdr.ready fixproto stmp-int-hdrs
$(SHELL) ${srcdir}/fixproto include include $(SYSTEM_HEADER_DIR); \
if [ $$? -eq 0 ] ; then true ; else exit 1 ; fi ; \
else true; fi; \
- touch include/fixed; \
+ $(STAMP) include/fixed; \
fi
- touch stmp-fixproto
+ $(STAMP) stmp-fixproto
#
# Remake the info files.
-doc: $(BUILD_INFO) gccbug
-info: $(srcdir)/cpp.info $(srcdir)/gcc.info lang.info $(srcdir)/c-tree.info $(srcdir)/cppinternals.info
+docdir = $(srcdir)/doc
-$(srcdir)/cpp.info: $(srcdir)/cpp.texi
- cd $(srcdir) && $(MAKEINFO) $(MAKEINFOFLAGS) -o cpp.info cpp.texi
+doc: $(BUILD_INFO) gccbug
+info: $(docdir)/cpp.info $(docdir)/gcc.info lang.info $(docdir)/cppinternals.info
-$(srcdir)/gcc.info: $(srcdir)/gcc.texi $(srcdir)/extend.texi $(srcdir)/install.texi \
- $(srcdir)/invoke.texi $(srcdir)/md.texi $(srcdir)/rtl.texi \
- $(srcdir)/tm.texi $(srcdir)/gcov.texi $(srcdir)/contrib.texi
- cd $(srcdir) && $(MAKEINFO) $(MAKEINFOFLAGS) -o gcc.info gcc.texi
+$(docdir)/cpp.info: $(docdir)/cpp.texi $(docdir)/include/fdl.texi
+ cd $(srcdir) && $(MAKEINFO) $(MAKEINFOFLAGS) -I doc -I doc/include -o doc/cpp.info doc/cpp.texi
-$(srcdir)/c-tree.info: $(srcdir)/c-tree.texi
- cd $(srcdir) && $(MAKEINFO) $(MAKEINFOFLAGS) -o c-tree.info \
- c-tree.texi
+$(docdir)/gcc.info: $(docdir)/gcc.texi $(docdir)/extend.texi \
+ $(docdir)/install-old.texi $(docdir)/invoke.texi $(docdir)/md.texi \
+ $(docdir)/c-tree.texi $(docdir)/rtl.texi $(docdir)/tm.texi \
+ $(docdir)/gcov.texi $(docdir)/contrib.texi $(docdir)/objc.texi \
+ $(docdir)/include/fdl.texi $(docdir)/include/gpl.texi \
+ $(docdir)/include/funding.texi
+ cd $(srcdir) && $(MAKEINFO) $(MAKEINFOFLAGS) -I doc -I doc/include -o doc/gcc.info doc/gcc.texi
-$(srcdir)/cppinternals.info: $(srcdir)/cppinternals.texi
- cd $(srcdir) && $(MAKEINFO) $(MAKEINFOFLAGS) -o cppinternals.info \
- cppinternals.texi
+$(docdir)/cppinternals.info: $(docdir)/cppinternals.texi
+ cd $(srcdir) && $(MAKEINFO) $(MAKEINFOFLAGS) -I doc -I doc/include -o doc/cppinternals.info \
+ doc/cppinternals.texi
-dvi: gcc.dvi cpp.dvi lang.dvi
+dvi: gcc.dvi cpp.dvi lang.dvi cppinternals.dvi
# This works with GNU Make's default rule.
-gcc.dvi: $(srcdir)/gcc.texi $(srcdir)/extend.texi $(srcdir)/install.texi \
- $(srcdir)/invoke.texi $(srcdir)/md.texi $(srcdir)/rtl.texi \
- $(srcdir)/tm.texi $(srcdir)/gcov.texi
- TEXINPUTS=${texidir}:$(srcdir):$$TEXINPUTS tex gcc.texi
- texindex gcc.??
- TEXINPUTS=${texidir}:$(srcdir):$$TEXINPUTS tex gcc.texi
-
-cpp.dvi: $(srcdir)/cpp.texi
- TEXINPUTS=${texidir}:$(srcdir):$$TEXINPUTS tex cpp.texi
- texindex cpp.??
- TEXINPUTS=${texidir}:$(srcdir):$$TEXINPUTS tex cpp.texi
-
-generated-manpages: $(srcdir)/gcov.1 $(srcdir)/cpp.1 $(srcdir)/gcc.1
-
-$(srcdir)/gcov.1: $(srcdir)/gcov.texi
- touch $(srcdir)/gcov.1
- -$(TEXI2POD) < $(srcdir)/gcov.texi > gcov.pod
- -($(POD2MAN) gcov.pod > $(srcdir)/gcov.1.T$$$$ && \
- mv -f $(srcdir)/gcov.1.T$$$$ $(srcdir)/gcov.1) || \
- (rm -f $(srcdir)/gcov.1.T$$$$ && exit 1)
+cpp.dvi: $(docdir)/cpp.texi $(docdir)/include/fdl.texi
+ $(TEXI2DVI) -I $(docdir) -I $(docdir)/include $(docdir)/cpp.texi
+
+gcc.dvi: $(docdir)/gcc.texi $(docdir)/extend.texi $(docdir)/install-old.texi \
+ $(docdir)/invoke.texi $(docdir)/md.texi $(docdir)/c-tree.texi \
+ $(docdir)/rtl.texi $(docdir)/tm.texi $(docdir)/gcov.texi \
+ $(docdir)/contrib.texi $(docdir)/objc.texi \
+ $(docdir)/include/fdl.texi $(docdir)/include/gpl.texi \
+ $(docdir)/include/funding.texi
+ $(TEXI2DVI) -I $(docdir) -I $(docdir)/include $(docdir)/gcc.texi
+
+cppinternals.dvi: $(docdir)/cppinternals.texi
+ $(TEXI2DVI) -I $(docdir) -I $(docdir)/include $(docdir)/cppinternals.texi
+
+generated-manpages: $(docdir)/gcov.1 $(docdir)/cpp.1 $(docdir)/gcc.1 \
+ $(docdir)/gfdl.7 $(docdir)/gpl.7 $(docdir)/fsf-funding.7
+
+$(docdir)/gcov.1: $(docdir)/gcov.texi
+ $(STAMP) $(docdir)/gcov.1
+ -$(TEXI2POD) < $(docdir)/gcov.texi > gcov.pod
+ -($(POD2MAN) --section=1 gcov.pod > $(docdir)/gcov.1.T$$$$ && \
+ mv -f $(docdir)/gcov.1.T$$$$ $(docdir)/gcov.1) || \
+ (rm -f $(docdir)/gcov.1.T$$$$ && exit 1)
-rm -f gcov.pod
-$(srcdir)/cpp.1: $(srcdir)/cpp.texi
- touch $(srcdir)/cpp.1
- -$(TEXI2POD) < $(srcdir)/cpp.texi > cpp.pod
- -($(POD2MAN) cpp.pod > $(srcdir)/cpp.1.T$$$$ && \
- mv -f $(srcdir)/cpp.1.T$$$$ $(srcdir)/cpp.1) || \
- (rm -f $(srcdir)/cpp.1.T$$$$ && exit 1)
+$(docdir)/cpp.1: $(docdir)/cpp.texi
+ $(STAMP) $(docdir)/cpp.1
+ -$(TEXI2POD) < $(docdir)/cpp.texi > cpp.pod
+ -($(POD2MAN) --section=1 cpp.pod > $(docdir)/cpp.1.T$$$$ && \
+ mv -f $(docdir)/cpp.1.T$$$$ $(docdir)/cpp.1) || \
+ (rm -f $(docdir)/cpp.1.T$$$$ && exit 1)
-rm -f cpp.pod
-$(srcdir)/gcc.1: $(srcdir)/invoke.texi
- touch $(srcdir)/gcc.1
- -$(TEXI2POD) < $(srcdir)/invoke.texi > gcc.pod
- -($(POD2MAN) gcc.pod > $(srcdir)/gcc.1.T$$$$ && \
- mv -f $(srcdir)/gcc.1.T$$$$ $(srcdir)/gcc.1) || \
- (rm -f $(srcdir)/gcc.1.T$$$$ && exit 1)
+$(docdir)/gcc.1: $(docdir)/invoke.texi
+ $(STAMP) $(docdir)/gcc.1
+ -$(TEXI2POD) < $(docdir)/invoke.texi > gcc.pod
+ -($(POD2MAN) --section=1 gcc.pod > $(docdir)/gcc.1.T$$$$ && \
+ mv -f $(docdir)/gcc.1.T$$$$ $(docdir)/gcc.1) || \
+ (rm -f $(docdir)/gcc.1.T$$$$ && exit 1)
-rm -f gcc.pod
+$(docdir)/gfdl.7: $(docdir)/include/fdl.texi
+ $(STAMP) $(docdir)/gfdl.7
+ -$(TEXI2POD) < $(docdir)/include/fdl.texi > gfdl.pod
+ -($(POD2MAN) --section=7 gfdl.pod > $(docdir)/gfdl.7.T$$$$ && \
+ mv -f $(docdir)/gfdl.7.T$$$$ $(docdir)/gfdl.7) || \
+ (rm -f $(docdir)/gfdl.7.T$$$$ && exit 1)
+ -rm -f gfdl.pod
+
+$(docdir)/gpl.7: $(docdir)/include/gpl.texi
+ $(STAMP) $(docdir)/gpl.7
+ -$(TEXI2POD) < $(docdir)/include/gpl.texi > gpl.pod
+ -($(POD2MAN) --section=7 gpl.pod > $(docdir)/gpl.7.T$$$$ && \
+ mv -f $(docdir)/gpl.7.T$$$$ $(docdir)/gpl.7) || \
+ (rm -f $(docdir)/gpl.7.T$$$$ && exit 1)
+ -rm -f gpl.pod
+
+$(docdir)/fsf-funding.7: $(docdir)/include/funding.texi
+ $(STAMP) $(docdir)/fsf-funding.7
+ -$(TEXI2POD) < $(docdir)/include/funding.texi > fsf-funding.pod
+ -($(POD2MAN) --section=7 fsf-funding.pod \
+ > $(docdir)/fsf-funding.7.T$$$$ && \
+ mv -f $(docdir)/fsf-funding.7.T$$$$ $(docdir)/fsf-funding.7) || \
+ (rm -f $(docdir)/fsf-funding.7.T$$$$ && exit 1)
+ -rm -f fsf-funding.pod
+
#
# Deletion of files made during compilation.
# There are four levels of this:
@@ -2286,7 +2394,7 @@ mostlyclean: $(INTL_MOSTLYCLEAN) lang.mostlyclean
-rm -f $(STAGESTUFF)
-rm -rf libgcc
# Delete the temporary source copies for cross compilation.
- -rm -f $(HOST_PREFIX_1)rtl.c $(HOST_PREFIX_1)rtlanal.c
+ -rm -f $(HOST_PREFIX_1)rtl.c
-rm -f $(HOST_PREFIX_1)alloca.c $(HOST_PREFIX_1)malloc.c
-rm -f $(HOST_PREFIX_1)obstack.c
# Delete the temp files made in the course of building libgcc.a.
@@ -2303,7 +2411,7 @@ mostlyclean: $(INTL_MOSTLYCLEAN) lang.mostlyclean
-rm -f specs float.h-* enquire SYSCALLS.c.X SYSCALLS.c
-rm -f collect collect2 mips-tfile mips-tdump alloca.s
# Delete files generated for fixproto
- -rm -rf fix-header xsys-protos.h deduced.h tmp-deduced.h \
+ -rm -rf fix-header$(build_exeext) xsys-protos.h deduced.h tmp-deduced.h \
gen-protos$(build_exeext) fixproto.list fixtmp.* fixhdr.ready
# Delete files generated for fixincl
-rm -rf fixincl fixinc.sh specs.ready
@@ -2321,6 +2429,8 @@ mostlyclean: $(INTL_MOSTLYCLEAN) lang.mostlyclean
INTL_CLEAN = intl.clean
clean: mostlyclean $(INTL_CLEAN) lang.clean
-rm -f libgcc.a libgcc_s$(SHLIB_EXT)
+ -rm -f config.h tconfig.h hconfig.h tm_p.h
+ -rm -f cs-*
-rm -rf libgcc
-rm -f *.dvi
-rm -f */*.dvi
@@ -2343,7 +2453,7 @@ clean: mostlyclean $(INTL_CLEAN) lang.clean
# while building and installing GCC.
INTL_DISTCLEAN = intl.distclean
distclean: clean $(INTL_DISTCLEAN) lang.distclean
- -rm -f tm.h tm_p.h config.h auto-host.h auto-build.h tconfig.h hconfig.h
+ -rm -f auto-host.h auto-build.h
-rm -f cstamp-h
-rm -f config.status config.run config.cache config.bak
-rm -f Make-lang Make-hooks Make-host Make-target
@@ -2393,9 +2503,10 @@ maintainer-clean:
-rm -f c-parse.y c-parse.c c-parse.output TAGS
-rm -f cpp.??s cpp.*aux
-rm -f gcc.??s gcc.*aux
- -rm -f $(srcdir)/cpp.info* $(srcdir)/gcc.info* $(srcdir)/c-tree.info*
- -rm -f $(srcdir)/cppinternals.info*
- -rm -f $(srcdir)/gcov.1 $(srcdir)/cpp.1 $(srcdir)/gcc.1
+ -rm -f $(docdir)/cpp.info* $(docdir)/gcc.info*
+ -rm -f $(docdir)/cppinternals.info*
+ -rm -f $(docdir)/gcov.1 $(docdir)/cpp.1 $(docdir)/gcc.1
+ -rm -f $(docdir)/fsf-funding.7 $(docdir)/gfdl.7 $(docdir)/gpl.7
#
# Entry points `install' and `uninstall'.
# Also use `install-collect2' to install collect2 when the config files don't.
@@ -2475,8 +2586,6 @@ installdirs:
done
-if [ -d $(bindir) ] ; then true ; else mkdir $(bindir) ; chmod a+rx $(bindir) ; fi
-if [ -d $(includedir) ] ; then true ; else mkdir $(includedir) ; chmod a+rx $(includedir) ; fi
- -if [ -d $(gcc_tooldir) ] ; then true ; else mkdir $(gcc_tooldir) ; chmod a+rx $(gcc_tooldir) ; fi
- -if [ -d $(assertdir) ] ; then true ; else mkdir $(assertdir) ; chmod a+rx $(assertdir) ; fi
-if [ -d $(infodir) ] ; then true ; else mkdir $(infodir) ; chmod a+rx $(infodir) ; fi
-if [ -d $(slibdir) ] ; then true ; else mkdir $(slibdir) ; chmod a+rx $(slibdir) ; fi
# We don't use mkdir -p to create the parents of man1dir,
@@ -2485,6 +2594,7 @@ installdirs:
-parent=`echo $(man1dir)|sed -e 's@/[^/]*$$@@'`; \
if [ -d $$parent ] ; then true ; else mkdir $$parent ; chmod a+rx $$parent ; fi
-if [ -d $(man1dir) ] ; then true ; else mkdir $(man1dir) ; chmod a+rx $(man1dir) ; fi
+ -if [ -d $(man7dir) ] ; then true ; else mkdir $(man7dir) ; chmod a+rx $(man7dir) ; fi
# Install the compiler executables built during cross compilation.
install-common: native installdirs $(EXTRA_PARTS) lang.install-common
@@ -2567,43 +2677,52 @@ install-driver: xgcc$(exeext)
# to do the install.
install-info: doc installdirs lang.install-info
-rm -f $(infodir)/cpp.info* $(infodir)/gcc.info*
- -rm -f $(infodir)/c-tree.info* $(infodir)/cppinternals.info*
- if [ -f $(srcdir)/gcc.info ]; then \
- for f in $(srcdir)/cpp.info* $(srcdir)/gcc.info* \
- $(srcdir)/c-tree.info* $(srcdir)/cppinternals.info*; do \
+ -rm -f $(infodir)/cppinternals.info*
+ if [ -f $(docdir)/gcc.info ]; then \
+ for f in $(docdir)/cpp.info* $(docdir)/gcc.info* \
+ $(docdir)/cppinternals.info*; do \
realfile=`echo $$f | sed -e 's|.*/\([^/]*\)$$|\1|'`; \
$(INSTALL_DATA) $$f $(infodir)/$$realfile; \
done; \
else true; fi
-if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \
if [ -f $(infodir)/dir ] ; then \
- for f in cpp.info gcc.info c-tree.info cppinternals.info; do \
+ for f in cpp.info gcc.info cppinternals.info; do \
if [ -f $(infodir)/$$f ]; then \
install-info --dir-file=$(infodir)/dir $(infodir)/$$f; \
- else true; fi \
+ else true; fi; \
done; \
else true; fi; \
else true; fi;
-chmod a-x $(infodir)/cpp.info* $(infodir)/gcc.info*
- -chmod a-x $(infodir)/c-tree.info* $(infodir)/cppinternals.info*
+ -chmod a-x $(infodir)/cppinternals.info*
# Install the man pages.
install-man: installdirs $(GENERATED_MANPAGES) lang.install-man
-if [ -f gcc-cross$(exeext) ] ; then \
- rm -f $(man1dir)/$(GCC_CROSS_NAME)$(manext); \
- $(INSTALL_DATA) $(srcdir)/gcc.1 $(man1dir)/$(GCC_CROSS_NAME)$(manext); \
- chmod a-x $(man1dir)/$(GCC_CROSS_NAME)$(manext); \
+ rm -f $(man1dir)/$(GCC_CROSS_NAME)$(man1ext); \
+ $(INSTALL_DATA) $(docdir)/gcc.1 $(man1dir)/$(GCC_CROSS_NAME)$(man1ext); \
+ chmod a-x $(man1dir)/$(GCC_CROSS_NAME)$(man1ext); \
else \
- rm -f $(man1dir)/$(GCC_INSTALL_NAME)$(manext); \
- $(INSTALL_DATA) $(srcdir)/gcc.1 $(man1dir)/$(GCC_INSTALL_NAME)$(manext); \
- chmod a-x $(man1dir)/$(GCC_INSTALL_NAME)$(manext); \
+ rm -f $(man1dir)/$(GCC_INSTALL_NAME)$(man1ext); \
+ $(INSTALL_DATA) $(docdir)/gcc.1 $(man1dir)/$(GCC_INSTALL_NAME)$(man1ext); \
+ chmod a-x $(man1dir)/$(GCC_INSTALL_NAME)$(man1ext); \
fi
- -rm -f $(man1dir)/cpp$(manext)
- -$(INSTALL_DATA) $(srcdir)/cpp.1 $(man1dir)/cpp$(manext)
- -chmod a-x $(man1dir)/cpp$(manext)
- -rm -f $(man1dir)/gcov$(manext)
- -$(INSTALL_DATA) $(srcdir)/gcov.1 $(man1dir)/gcov$(manext)
- -chmod a-x $(man1dir)/gcov$(manext)
+ -rm -f $(man1dir)/cpp$(man1ext)
+ -$(INSTALL_DATA) $(docdir)/cpp.1 $(man1dir)/cpp$(man1ext)
+ -chmod a-x $(man1dir)/cpp$(man1ext)
+ -rm -f $(man1dir)/gcov$(man1ext)
+ -$(INSTALL_DATA) $(docdir)/gcov.1 $(man1dir)/gcov$(man1ext)
+ -chmod a-x $(man1dir)/gcov$(man1ext)
+ -rm -f $(man7dir)/fsf-funding$(man7ext)
+ -$(INSTALL_DATA) $(docdir)/fsf-funding.7 $(man7dir)/fsf-funding$(man7ext)
+ -chmod a-x $(man7dir)/fsf-funding$(man7ext)
+ -rm -f $(man7dir)/gfdl$(man7ext)
+ -$(INSTALL_DATA) $(docdir)/gfdl.7 $(man7dir)/gfdl$(man7ext)
+ -chmod a-x $(man7dir)/gfdl$(man7ext)
+ -rm -f $(man7dir)/gpl$(man7ext)
+ -$(INSTALL_DATA) $(docdir)/gpl.7 $(man7dir)/gpl$(man7ext)
+ -chmod a-x $(man7dir)/gpl$(man7ext)
# Install the library.
install-libgcc: libgcc.mk libgcc.a installdirs
@@ -2612,7 +2731,21 @@ install-libgcc: libgcc.mk libgcc.a installdirs
else \
r_f_t=: ; \
fi; \
- $(MAKE) INSTALL_DATA="$(INSTALL_DATA)" \
+ $(MAKE) GCC_FOR_TARGET="$(GCC_FOR_TARGET)" \
+ HOST_PREFIX="$(HOST_PREFIX)" HOST_PREFIX_1="$(HOST_PREFIX_1)" \
+ AR_FOR_TARGET="$(AR_FOR_TARGET)" \
+ AR_CREATE_FOR_TARGET="$(AR_CREATE_FOR_TARGET)" \
+ AR_FLAGS_FOR_TARGET="$(AR_FLAGS_FOR_TARGET)" \
+ OLDCC="$(OLDCC)" CCLIBFLAGS="$(CCLIBFLAGS)" \
+ CFLAGS="$(CFLAGS) $(WARN_CFLAGS)" \
+ RANLIB_TEST_FOR_TARGET="$(RANLIB_TEST_FOR_TARGET)" \
+ NM_FOR_TARGET="$(NM_FOR_TARGET)" AWK="$(AWK)" \
+ LIBGCC2_CFLAGS="$(LIBGCC2_CFLAGS)" \
+ INCLUDES="$(INCLUDES)" MAYBE_USE_COLLECT2="$(MAYBE_USE_COLLECT2)" \
+ CONFIG_H="$(TCONFIG_H)" MACHMODE_H="$(MACHMODE_H)" \
+ LIB1ASMSRC='$(LIB1ASMSRC)' \
+ MAKEOVERRIDES= \
+ INSTALL_DATA="$(INSTALL_DATA)" \
RANLIB_FOR_TARGET="$$r_f_t" \
libsubdir="$(libsubdir)" \
slibdir="$(slibdir)" \
@@ -2625,14 +2758,28 @@ install-multilib: stmp-multilib installdirs
else \
r_f_t=: ; \
fi; \
- $(MAKE) INSTALL_DATA="$(INSTALL_DATA)" \
+ $(MAKE) GCC_FOR_TARGET="$(GCC_FOR_TARGET)" \
+ HOST_PREFIX="$(HOST_PREFIX)" HOST_PREFIX_1="$(HOST_PREFIX_1)" \
+ AR_FOR_TARGET="$(AR_FOR_TARGET)" \
+ AR_CREATE_FOR_TARGET="$(AR_CREATE_FOR_TARGET)" \
+ AR_FLAGS_FOR_TARGET="$(AR_FLAGS_FOR_TARGET)" \
+ OLDCC="$(OLDCC)" CCLIBFLAGS="$(CCLIBFLAGS)" \
+ CFLAGS="$(CFLAGS) $(WARN_CFLAGS)" \
+ RANLIB_TEST_FOR_TARGET="$(RANLIB_TEST_FOR_TARGET)" \
+ NM_FOR_TARGET="$(NM_FOR_TARGET)" AWK="$(AWK)" \
+ LIBGCC2_CFLAGS="$(LIBGCC2_CFLAGS)" \
+ INCLUDES="$(INCLUDES)" MAYBE_USE_COLLECT2="$(MAYBE_USE_COLLECT2)" \
+ CONFIG_H="$(CONFIG_H)" MACHMODE_H="$(MACHMODE_H)" \
+ LIB1ASMSRC='$(LIB1ASMSRC)' \
+ MAKEOVERRIDES= \
+ INSTALL_DATA="$(INSTALL_DATA)" \
RANLIB_FOR_TARGET="$$r_f_t" \
libsubdir="$(libsubdir)" \
slibdir="$(slibdir)" \
-f libgcc.mk install
# Install all the header files built in the include subdirectory.
-install-headers: install-include-dir $(INSTALL_HEADERS_DIR) $(INSTALL_ASSERT_H)
+install-headers: install-include-dir $(INSTALL_HEADERS_DIR)
# Fix symlinks to absolute paths in the installed include directory to
# point to the installed directory, not the build directory.
# Don't need to use LN_S here since we really do need ln -s and no substitutes.
@@ -2672,29 +2819,6 @@ install-headers-cpio: stmp-int-hdrs $(STMP_FIXPROTO) install-include-dir
cd `pwd`/include ; \
find . -print | cpio -pdum $(libsubdir)/include
-# Put assert.h where it won't override GNU libc's assert.h.
-# It goes in a dir that is searched after GNU libc's headers;
-# thus, the following conditionals are no longer needed.
-# But it's not worth deleting them now.
-## Don't replace the assert.h already there if it is not from GCC.
-## This code would be simpler if it tested for -f ... && ! grep ...
-## but supposedly the ! operator is missing in sh on some systems.
-install-assert-h: assert.h installdirs
- if [ -f $(assertdir)/assert.h ]; \
- then \
- if grep "__eprintf" $(assertdir)/assert.h >/dev/null; \
- then \
- rm -f $(assertdir)/assert.h; \
- $(INSTALL_DATA) $(srcdir)/assert.h $(assertdir)/assert.h; \
- chmod a-x $(assertdir)/assert.h; \
- else true; \
- fi; \
- else \
- rm -f $(assertdir)/assert.h; \
- $(INSTALL_DATA) $(srcdir)/assert.h $(assertdir)/assert.h; \
- chmod a-x $(assertdir)/assert.h; \
- fi
-
# Use this target to install the program `collect2' under the name `collect2'.
install-collect2: collect2 installdirs
$(INSTALL_PROGRAM) collect2$(exeext) $(libsubdir)/collect2$(exeext)
@@ -2711,13 +2835,13 @@ uninstall: intl.uninstall lang.uninstall $(UNINSTALL_CPP)
-rm -rf $(bindir)/$(UNPROTOIZE_INSTALL_NAME)$(exeext)
-rm -rf $(bindir)/$(UNPROTOIZE_CROSS_NAME)$(exeext)
-rm -rf $(bindir)/$(GCOV_INSTALL_NAME)$(exeext)
- -rm -rf $(man1dir)/$(GCC_INSTALL_NAME)$(manext)
- -rm -rf $(man1dir)/$(GCC_CROSS_NAME)$(manext)
- -rm -rf $(man1dir)/cpp$(manext)
- -rm -rf $(man1dir)/protoize$(manext)
- -rm -rf $(man1dir)/unprotoize$(manext)
+ -rm -rf $(man1dir)/$(GCC_INSTALL_NAME)$(man1ext)
+ -rm -rf $(man1dir)/$(GCC_CROSS_NAME)$(man1ext)
+ -rm -rf $(man1dir)/cpp$(man1ext)
+ -rm -rf $(man1dir)/protoize$(man1ext)
+ -rm -rf $(man1dir)/unprotoize$(man1ext)
-rm -f $(infodir)/cpp.info* $(infodir)/gcc.info*
- -rm -f $(infodir)/c-tree.info* $(infodir)/cppinternals.info*
+ -rm -f $(infodir)/cppinternals.info*
#
# These targets are for the dejagnu testsuites. The file site.exp
# contains global variables that all the testsuites will use.
@@ -2728,7 +2852,7 @@ target_subdir = @target_subdir@
site.exp: ./config.status Makefile
@echo "Making a new config file..."
-@rm -f ./tmp?
- @touch site.exp
+ @$(STAMP) site.exp
-@mv site.exp site.bak
@echo "## these variables are automatically generated by make ##" > ./tmp0
@echo "# Do not edit here. If you wish to override these values" >> ./tmp0
@@ -2871,15 +2995,19 @@ STAGE2_FLAGS_TO_PASS = \
# Only build the C compiler for stage1, because that is the only one that
# we can guarantee will build with the native compiler, and also it is the
-# only thing useful for building stage2.
+# only thing useful for building stage2. STAGE1_CFLAGS (via CFLAGS),
+# MAKEINFO and MAKEINFOFLAGS are explicitly passed here to make them
+# overrideable (for a bootstrap build stage1 also builds gcc.info).
stage1_build:
- $(MAKE) CC="$(CC)" libdir=$(libdir) LANGUAGES="$(BOOT_LANGUAGES)"
- touch stage1_build
+ $(MAKE) CC="$(CC)" libdir=$(libdir) LANGUAGES="$(BOOT_LANGUAGES)" \
+ CFLAGS="$(STAGE1_CFLAGS)" MAKEINFO="$(MAKEINFO)" \
+ MAKEINFOFLAGS="$(MAKEINFOFLAGS)"
+ $(STAMP) stage1_build
echo stage1_build > stage_last
stage1_copy: stage1_build
$(MAKE) stage1
- touch stage1_copy
+ $(STAMP) stage1_copy
echo stage2_build > stage_last
# This used to define ALLOCA as empty, but that would lead to bad results
@@ -2891,42 +3019,42 @@ stage2_build: stage1_copy
$(MAKE) CC="stage1/xgcc$(exeext) -Bstage1/ -B$(build_tooldir)/bin/" \
STAGE_PREFIX=stage1/ \
$(STAGE2_FLAGS_TO_PASS)
- touch stage2_build
+ $(STAMP) stage2_build
echo stage2_build > stage_last
stage2_copy: stage2_build
$(MAKE) stage2
- touch stage2_copy
+ $(STAMP) stage2_copy
echo stage3_build > stage_last
stage3_build: stage2_copy
$(MAKE) CC="stage2/xgcc$(exeext) -Bstage2/ -B$(build_tooldir)/bin/" \
STAGE_PREFIX=stage2/ \
$(STAGE2_FLAGS_TO_PASS)
- touch stage3_build
+ $(STAMP) stage3_build
echo stage3_build > stage_last
# For bootstrap4:
stage3_copy: stage3_build
$(MAKE) stage3
- touch stage3_copy
+ $(STAMP) stage3_copy
echo stage4_build > stage_last
stage4_build: stage3_copy
- $(MAKE) CC="stage3/xgcc$(exeext) -B$(build_tooldir)/bin/ -Bstage3/" \
+ $(MAKE) CC="stage3/xgcc$(exeext) -Bstage3/ -B$(build_tooldir)/bin/" \
STAGE_PREFIX=stage3/ \
$(STAGE2_FLAGS_TO_PASS)
- touch stage4_build
+ $(STAMP) stage4_build
echo stage4_build > stage_last
# Additional steps for *-lean targets:
clean_s1: stage1_copy
-(cd stage1 && rm -f $(VOL_FILES))
- touch clean_s1
+ $(STAMP) clean_s1
clean_s2: stage2_copy
-rm -rf stage1
- touch clean_s2
+ $(STAMP) clean_s2
# The various entry points for bootstrapping.
@@ -2958,7 +3086,7 @@ unstage1 unstage2 unstage3 unstage4:
mv $$stage/$$i/* $$i/. 2>/dev/null; \
else \
mv $$stage/$$i .; \
- fi \
+ fi; \
done \
fi ; \
rm -f $${stage}_build $${stage}_copy ;\
diff --git a/gcc/NEWS b/gcc/NEWS
deleted file mode 100644
index 4a34a72e5a2..00000000000
--- a/gcc/NEWS
+++ /dev/null
@@ -1,1448 +0,0 @@
-This file contains information about GCC releases which has been
-generated automatically from the online release notes. This file
-covers releases of GCC (and the former EGCS project) since EGCS 1.0,
-on the line of development that led to GCC 3; for information on GCC
-2.8.1 and older releases of GCC 2, see ONEWS.
-
-======================================================================
-http://gcc.gnu.org/gcc-2.95/gcc-2.95.2.html
-
- GCC 2.95.2
-
- October 27, 1999
-
- The GNU project and the GCC developers are pleased to announce the
- release of GCC version 2.95.2. GCC used to stand for the GNU C
- Compiler, but since the compiler supports several other languages
- aside from C, it now stands for the GNU Compiler Collection.
-
- This is a minor release to address several bugs in the GCC version
- 2.95.1 release.
-
- The -fstrict-aliasing is not enabled by default for GCC 2.95.2. While
- the optimizations performed by -fstrict-aliasing are valid according
- to the C and C++ standards, the optimization have caused some
- problems, particularly with old non-conforming code.
-
- The GCC developers are experimenting with ways to warn users about
- code which violates the C/C++ standards, but those warnings are not
- ready for widespread use at this time. Rather than wait for those
- warnings the GCC developers have chosen to disable -fstrict-aliasing
- by default for the GCC 2.95.2 release.
-
- We strongly encourage developers to find and fix code which violates
- the C/C++ standards as -fstrict-aliasing may be enabled by default in
- future releases. Use the option -fstrict-aliasing to re-enable these
- optimizations.
-
- * Generic bugfixes and improvements
- + Fix incorrectly optimized memory reference in global common
- subexpression elimination (GCSE) optimization pass.
- + Fix code generation bug in regmove.c in which it could
- incorrectly change a "const" value.
- + Fix bug in optimization of conditionals involving volatile
- memory references.
- + Avoid over-allocation of stack space for some procedures.
- + Fixed bug in the compiler which caused incorrect optimization
- of an obscure series of bit manipulations, shifts and
- arithmetic.
- + Fixed register allocator bug which caused teTeX to be
- mis-compiled on Sparc targets.
- + Avoid incorrect optimization of degenerate case statements
- for certain targets such as the ARM.
- + Fix out of range memory reference in the jump optimizer.
- + Avoid dereferencing null pointer in fix-header.
- + Fix test for GCC specific features so that it is possible to
- bootstrap with gcc-2.6.2 and older versions of GCC.
- + Fix typo in scheduler which could potentially cause out of
- range memory accesses.
- + Avoid incorrect loop reversal which caused incorrect code for
- certain loops on PowerPC targets.
- + Avoid incorrect optimization of switch statements on certain
- targets (for example the ARM).
- * Platform specific bugfixes and improvements
- + Work around bug in Sun V5.0 compilers which caused bootstrap
- comparison failures on Sparc targets.
- + Fix Sparc backend bug which caused aborts in final.c.
- + Fix sparc-hal-solaris2* configuration fragments.
- + Fix bug in sparc block profiling.
- + Fix obscure code generation bug for the PARISC targets.
- + Define __STDC_EXT__ for HPUX configurations.
- + Various POWERPC64 code generation bugfixes.
- + Fix abort for PPC targets using ELF (ex GNU/Linux).
- + Fix collect2 problems for AIX targets.
- + Correct handling of .file directive for PPC targets.
- + Fix bug in fix_trunc x86 patterns.
- + Fix x86 port to correctly pop the FP stack for functions that
- return structures in memory.
- + Fix minor bug in strlen x86 pattern.
- + Use stabs debugging instead of dwarf1 for x86-solaris
- targets.
- + Fix template repository code to handle leading underscore in
- mangled names.
- + Fix weak/weak alias support for OpenBSD.
- + GNU/Linux for the ARM has C++ compatible include files.
- * Language & Runtime specific fixes.
- + Fix handling of constructor attribute in the C front-end
- which caused problems building the Chill runtime library on
- some targets.
- + Fix minor problem merging type qualifiers in the C front-end.
- + Fix aliasing bug for pointers and references (C/C++).
- + Fix incorrect "non-constant initializer bug" when
- -traditional or -fwritable-strings is enabled.
- + Fix build error for Chill front-end on SunOS.
- + Do not complain about duplicate instantiations when using
- -frepo (C++)
- + Fix array bounds handling in C++ front-end which caused
- problems with dwarf debugging information in some
- circumstances.
- + Fix minor namespace problem.
- + Fix problem linking java programs.
-
- The whole suite has been extensively [1]regression tested and
- [2]package tested. It should be reliable and suitable for widespread
- use.
-
- The GCC 2.95 release has several new optimizations, new targets, new
- languages and other new features as compared to EGCS 1.1 or GCC 2.8.
- See the [3]new features page for a more complete list of new features
- found in the GCC 2.95 releases.
-
- The sources include installation instructions in both HTML and
- plaintext forms in the install directory in the distribution. However,
- the most up to date [4]installation instructions and [5]build/test
- status are on the web pages. We will update those pages as new
- information becomes available.
-
- The GCC developers would like to thank the numerous people that have
- contributed new features, test results, bugfixes, etc to GCC. This
- [6]amazing group of volunteers is what makes GCC successful.
-
- And finally, we can't in good conscience fail to mention some
- [7]caveats to using GCC 2.95.2.
-
- Download GCC 2.95.2 from the [8]GNU FTP server (ftp://ftp.gnu.org)
- Download GCC 2.95.2 from the [9]GCC/EGCS FTP server
- (ftp://gcc.gnu.org)
- [10]Find a GNU mirror site
- [11]Find a GCC/EGCS mirror site
-
- For additional information about GCC please see the [12]GCC project
- web server or contact the [13]GCC development mailing list.
- _________________________________________________________________
-
-
- [14]The GCC team
- Last modified 2000-11-10
-
-References
-
- 1. http://gcc.gnu.org/gcc-2.95/regress.html
- 2. http://gcc.gnu.org/gcc-2.95/othertest.html
- 3. http://gcc.gnu.org/gcc-2.95/features.html
- 4. http://gcc.gnu.org/install/index.html
- 5. http://gcc.gnu.org/gcc-2.95/buildstat.html
- 6. http://gcc.gnu.org/thanks.html
- 7. http://gcc.gnu.org/gcc-2.95/caveats.html
- 8. ftp://ftp.gnu.org/pub/gnu/gcc/
- 9. ftp://gcc.gnu.org/pub/gcc/releases/index.html
- 10. http://www.gnu.org/order/ftp.html
- 11. http://gcc.gnu.org/mirrors.html
- 12. http://gcc.gnu.org/index.html
- 13. mailto:gcc@gcc.gnu.org
- 14. http://gcc.gnu.org/about.html
-======================================================================
-http://gcc.gnu.org/gcc-2.95/gcc-2.95.1.html
-
- GCC 2.95.1
-
- August 19, 1999
-
- The GNU project and the GCC/EGCS developers are pleased to announce
- the release of GCC version 2.95.1. GCC used to stand for the GNU C
- Compiler, but since the compiler supports several other languages
- aside from C, it now stands for the GNU Compiler Collection.
-
- This is a minor release to address several bugs in the GCC version
- 2.95 release.
-
- * Generic bugfixes and improvements
- + Various documentation fixes related to the GCC/EGCS merger.
- + Fix memory management bug which could lead to spurious
- aborts, core dumps or random parsing errors in the compiler.
- + Fix a couple bugs in the dwarf1 and dwarf2 debug record
- support.
- + Fix infinite loop in the CSE optimizer.
- + Avoid undefined behavior in compiler FP emulation code
- + Fix install problem when prefix is overridden on the make
- install command.
- + Fix problem with unwanted installation of assert.h on some
- systems.
- + Fix problem with finding the wrong assembler in a single tree
- build.
- + Avoid increasing the known alignment of a register that is
- already known to be a pointer.
- * Platform specific bugfixes and improvements
- + Codegen bugfix for prologue/epilogue for cpu32 target.
- + Fix long long code generation bug for the Coldfire target.
- + Fix various aborts in the SH compiler.
- + Fix bugs in libgcc support library for the SH.
- + Fix alpha ev6 code generation bug.
- + Fix problems with EXIT_SUCCESS/EXIT_FAILURE redefinitions on
- AIX platforms.
- + Fix -fpic code generation bug for rs6000/ppc svr4 targets.
- + Fix varargs/stdarg code generation bug for rs6000/ppc svr4
- targets.
- + Fix weak symbol handling for rs6000/ppc svr4 targets.
- + Fix various problems with 64bit code generation for the
- rs6000/ppc port.
- + Fix codegen bug which caused tetex to be mis-compiled on the
- x86
- + Fix compiler abort in new cfg code exposed by x86 port.
- + Fix out of range array reference in code convert flat
- registers to the x87 stacked FP register file.
- + Fix minor vxworks configuration bug
- + Fix return type of bsearch for SunOS 4.x.
- * Language & Runtime specific fixes.
- + The G++ signature extension has been deprecated. It will be
- removed in the next major release of G++. Use of signatures
- will result in a warning from the compiler.
- + Several bugs relating to templates and namespaces were fixed.
- + A bug that caused crashes when combining templates with -g on
- DWARF1 platforms was fixed.
- + Pointers-to-members, virtual functions, and multiple
- inheritance should now work together correctly.
- + Some code-generation bugs relating to function try blocks
- were fixed.
- + G++ is a little bit more lenient with certain archaic
- constructs than in GCC 2.95.
- + Fix to prevent shared library version #s from bring truncated
- to 1 digit
- + Fix missing std:: in the libstdc++ library.
- + Fix stream locking problems in libio.
- + Fix problem in java compiler driver.
-
- The whole suite has been extensively [1]regression tested and
- [2]package tested. It should be reliable and suitable for widespread
- use.
-
- The compiler has several new optimizations, new targets, new languages
- and other new features. See the [3]new features page for a more
- complete list of new features found in the GCC 2.95 releases.
-
- The sources include installation instructions in both HTML and
- plaintext forms in the install directory in the distribution. However,
- the most up to date [4]installation instructions and [5]build/test
- status are on the web pages. We will update those pages as new
- information becomes available.
-
- The GCC developers would like to thank the numerous people that have
- contributed new features, test results, bugfixes, etc to GCC. This
- [6]amazing group of volunteers is what makes GCC successful.
-
- And finally, we can't in good conscience fail to mention some
- [7]caveats to using GCC 2.95.1.
-
- Download GCC 2.95.1 from the [8]GNU FTP server (ftp://ftp.gnu.org)
- Download GCC 2.95.1 from the [9]GCC/EGCS FTP server
- (ftp://go.cygnus.com)
- [10]Find a GNU mirror site
- [11]Find a GCC/EGCS mirror site
-
- For additional information about GCC please see the [12]GCC project
- web server or contact the [13]GCC development mailing list.
- _________________________________________________________________
-
-
- [14]The GCC team
- Last modified 2000-11-10
-
-References
-
- 1. http://gcc.gnu.org/gcc-2.95/regress.html
- 2. http://gcc.gnu.org/gcc-2.95/othertest.html
- 3. http://gcc.gnu.org/gcc-2.95/features.html
- 4. http://gcc.gnu.org/install/index.html
- 5. http://gcc.gnu.org/gcc-2.95/buildstat.html
- 6. http://gcc.gnu.org/thanks.html
- 7. http://gcc.gnu.org/gcc-2.95/caveats.html
- 8. ftp://ftp.gnu.org/pub/gnu/gcc/
- 9. ftp://go.cygnus.com/pub/sourceware.cygnus.com/pub/egcs/releases/index.html
- 10. http://www.gnu.org/order/ftp.html
- 11. http://gcc.gnu.org/mirrors.html
- 12. http://gcc.gnu.org/index.html
- 13. mailto:gcc@gcc.gnu.org
- 14. http://gcc.gnu.org/about.html
-======================================================================
-http://gcc.gnu.org/gcc-2.95/gcc-2.95.html
-
- GCC 2.95
-
- July 31, 1999
-
- The GNU project and the GCC/EGCS developers are pleased to announce
- the release of GCC version 2.95. GCC used to stand for the GNU C
- Compiler, but since the compiler supports several other languages
- aside from C, it now stands for the GNU Compiler Collection.
-
- This is the first release of GCC since the April 1999 GCC/EGCS
- reunification and includes nearly a year's worth of new development
- and bugfixes.
-
- The whole suite has been extensively [1]regression tested and
- [2]package tested. It should be reliable and suitable for widespread
- use.
-
- The compiler has several new optimizations, new targets, new languages
- and other new features. See the [3]new features page for a more
- complete list of new features found in the GCC 2.95 releases.
-
- The sources include installation instructions in both HTML and
- plaintext forms in the install directory in the distribution. However,
- the most up to date [4]installation instructions and [5]build/test
- status are on the web pages. We will update those pages as new
- information becomes available.
-
- The GCC developers would like to thank the numerous people that have
- contributed new features, test results, bugfixes, etc to GCC. This
- [6]amazing group of volunteers is what makes GCC successful.
-
- And finally, we can't in good conscience fail to mention some
- [7]caveats to using GCC 2.95.
-
- Download GCC 2.95 from the [8]GNU FTP server (ftp://ftp.gnu.org)
- Download GCC 2.95 from the [9]GCC/EGCS FTP server
- (ftp://go.cygnus.com)
- [10]Find a GNU mirror site
- [11]Find a GCC/EGCS mirror site
-
- For additional information about GCC please see the [12]GCC project
- web server or contact the [13]GCC development mailing list.
- _________________________________________________________________
-
-
- [14]The GCC team
- Last modified 2000-11-10
-
-References
-
- 1. http://gcc.gnu.org/gcc-2.95/regress.html
- 2. http://gcc.gnu.org/gcc-2.95/othertest.html
- 3. http://gcc.gnu.org/gcc-2.95/features.html
- 4. http://gcc.gnu.org/install/index.html
- 5. http://gcc.gnu.org/gcc-2.95/buildstat.html
- 6. http://gcc.gnu.org/thanks.html
- 7. http://gcc.gnu.org/gcc-2.95/caveats.html
- 8. ftp://ftp.gnu.org/pub/gnu/gcc/
- 9. ftp://go.cygnus.com/pub/sourceware.cygnus.com/pub/egcs/releases/index.html
- 10. http://www.gnu.org/order/ftp.html
- 11. http://gcc.gnu.org/mirrors.html
- 12. http://gcc.gnu.org/index.html
- 13. mailto:gcc@gcc.gnu.org
- 14. http://gcc.gnu.org/about.html
-======================================================================
-http://gcc.gnu.org/gcc-2.95/features.html
-
- GCC 2.95 New Features
-
- * General Optimizer Improvements:
- + [1]Localized register spilling to improve speed and code
- density especially on small register class machines.
- + [2]Global CSE using lazy code motion algorithms.
- + [3]Improved global constant/copy propagation.
- + [4]Improved control flow graph analysis and manipulation.
- + [5]Local dead store elimination.
- + [6]Memory Load hoisting/store sinking in loops.
- + [7]Type based alias analysis is enabled by default. Note this
- feature will expose bugs in the Linux kernel. Please refer to
- the [8]FAQ for additional information on this issue.
- + Major revamp of GIV detection, combination and simplification
- to improve loop performance.
- + Major improvements to register allocation and reloading.
- * New Languages and Language specific improvements
- + [9]Many C++ improvements.
- + [10]Many Fortran improvements.
- + [11]Java front-end has been integrated. A [12]runtime library
- is available separately.
- + [13]ISO C99 support
- + [14]Chill front-end and runtime has been integrated.
- + Boehm garbage collector support in libobjc.
- + More support for various pragmas which appear in vendor
- include files
- * New Targets and Target Specific Improvements
- + [15]Sparc backend rewrite.
- + -mschedule=8000 will optimize code for PA8000 class
- processors; -mpa-risc-2-0 will generate code for PA2.0
- processors
- + Various micro-optimizations for the ia32 port. K6
- optimizations
- + Compiler will attempt to align doubles in the stack on the
- ia32 port
- + Alpha EV6 support
- + PowerPC 750
- + RS6000/PowerPC: -mcpu=401 was added as an alias for
- -mcpu=403. -mcpu=e603e was added to do -mcpu=603e and
- -msoft-float.
- + c3x, c4x
- + HyperSparc
- + SparcLite86x
- + sh4
- + Support for new systems (OpenBSD, FreeBSD, UWIN, Interix,
- arm-linux)
- + vxWorks targets include support for vxWorks threads
- + StrongARM 110 and ARM9 support added. ARM Scheduling
- parameters rewritten.
- + Various changes to the MIPS port to avoid assembler macros,
- which
- + Various performance improvements to the i960 port.
- + Major rewrite of ns32k port in turn improves performance
- * Other significant improvements
- + [16]Ability to dump cfg information and display it using vcg.
- + The new faster scheme for fixing vendor header files is
- enabled by default.
- + Experimental internationalization support.
- + multibyte character support
- + Some compile-time speedups for pathological problems
- + Better support for complex types
- * Plus the usual mountain of bugfixes
- * Core compiler is based on the gcc2 development tree from Sept 30,
- 1998, so we have all of the [17]features found in GCC 2.8.
- _________________________________________________________________
-
-
- [18]The GCC team
- Last modified 2000-12-04
-
-References
-
- 1. http://gcc.gnu.org/news/spill.html
- 2. http://gcc.gnu.org/news/lcm.html
- 3. http://gcc.gnu.org/news/cprop.html
- 4. http://gcc.gnu.org/news/cfg.html
- 5. http://gcc.gnu.org/news/dse.html
- 6. http://gcc.gnu.org/news/hoist.html
- 7. http://gcc.gnu.org/news/alias.html
- 8. http://gcc.gnu.org/fom_serv/cache/24.html
- 9. http://gcc.gnu.org/gcc-2.95/c++features.html
- 10. http://gcc.gnu.org/onlinedocs/g77_news.html
- 11. http://sources.redhat.com/java/gcj-announce.txt
- 12. http://gcc.gnu.org/javaannounce.html
- 13. http://gcc.gnu.org/c99status.html
- 14. http://gcc.gnu.org/news/chill.html
- 15. http://gcc.gnu.org/news/sparc.html
- 16. http://gcc.gnu.org/news/egcs-vcg.html
- 17. http://gcc.gnu.org/egcs-1.0/features-2.8.html
- 18. http://gcc.gnu.org/about.html
-======================================================================
-http://gcc.gnu.org/gcc-2.95/caveats.html
-
- GCC 2.95 Caveats
-
- * GCC 2.95 will issue an error for invalid asm statements that had
- been silently accepted by earlier versions of the compiler. This
- is particularly noticeable when compiling older versions of the
- Linux kernel (2.0.xx). Please refer to the [1]FAQ for more
- information on this issue.
- * GCC 2.95 implements type based alias analysis to disambiguate
- memory references. Some programs, particularly the Linux kernel
- violate ANSI/ISO aliasing rules and therefore may not operate
- correctly when compiled with GCC 2.95. Please refer to the [2]FAQ
- for more information on this issue.
- * GCC 2.95 has a known bug in its handling of complex variables for
- 64bit targets. Instead of silently generating incorrect code, GCC
- 2.95 will issue a fatal error for situations it can not handle.
- This primarily affects the Fortran community as Fortran makes more
- use of complex variables than C or C++.
- * GCC 2.95 has an integrated libstdc++, but does not have an
- integrated libg++. Furthermore old libg++ releases will not work
- with GCC 2.95. You can retrieve a recent copy of libg++ from the
- [3]GCC ftp server.
- Note most C++ programs only need libstdc++.
- * Exception handling may not work with shared libraries,
- particularly on alphas, hppas, rs6000/powerpc and mips based
- platforms. Exception handling is known to work on x86 GNU/Linux
- platforms with shared libraries.
- * In general, GCC 2.95 is more rigorous about rejecting invalid C++
- code or deprecated C++ constructs than G++ 2.7, G++ 2.8, EGCS 1.0,
- or EGCS 1.1. As a result it may be necessary to fix C++ code
- before it will compile with GCC 2.95.
- * G++ is also converting toward the ISO C++ standard; as a result
- code which was previously valid (and thus accepted by other
- compilers and older versions of g++) may no longer be accepted.
- The flag -fpermissive may allow some non-conforming code to
- compile with GCC 2.95.
- * GCC 2.95 compiled C++ code is not binary compatible with EGCS
- 1.1.x, EGCS 1.0.x or GCC 2.8.x.
- * GCC 2.95 does not have changes from the GCC 2.8 tree that were
- made between Sept 30, 1998 and April 30, 1999 (the official end of
- the GCC 2.8 project). Future GCC releases will include all the
- changes from the defunct GCC 2.8 sources.
- _________________________________________________________________
-
-
- [4]The GCC team
- Last modified 2000-11-10
-
-References
-
- 1. http://gcc.gnu.org/faq.html#asmclobber
- 2. http://gcc.gnu.org/fom_serv/cache/24.html
- 3. ftp://gcc.gnu.org/pub/gcc/infrastructure/libg++-2.8.1.3.tar.gz
- 4. http://gcc.gnu.org/about.html
-======================================================================
-http://gcc.gnu.org/egcs-1.1/egcs-1.1.2.html
-
- EGCS 1.1.2
-
- March 15, 1999
-
- We are pleased to announce the release of EGCS 1.1.2.
-
- EGCS is a collaborative effort involving several groups of hackers
- using an open development model to accelerate development and testing
- of GNU compilers and runtime libraries.
-
- EGCS 1.1.2 is a minor update to the EGCS 1.1.1 compiler to fix several
- serious problems in EGCS 1.1.1.
- * General improvements and fixes
- + Fix bug in loop optimizer which caused the SPARC (and
- potentially other) ports to segfault.
- + Fix infinite recursion in alias analysis and combiner code.
- + Fix bug in regclass preferencing.
- + Fix incorrect loop reversal which caused incorrect code to be
- generated for several targets.
- + Fix return value for builtin memcpy.
- + Reduce compile time for certain loops which exposed quadratic
- behavior in the loop optimizer.
- + Fix bug which caused volatile memory to be written multiple
- times when only one write was needed/desired.
- + Fix compiler abort in caller-save.c
- + Fix combiner bug which caused incorrect code generation for
- certain division by constant operations.
- + Fix incorrect code generation due to a bug in range check
- optimizations.
- + Fix incorrect code generation due to mis-handling of
- clobbered values in CSE.
- + Fix compiler abort/segfault due to incorrect register
- splitting when unrolling loops.
- + Fix code generation involving autoincremented addresses with
- ternary operators.
- + Work around bug in the scheduler which caused qt to be
- mis-compiled on some platforms.
- + Fix code generation problems with -fshort-enums.
- + Tighten security for temporary files.
- + Improve compile time for codes which make heavy use of
- overloaded functions.
- + Fix multiply defined constructor/destructor symbol problems.
- + Avoid setting bogus RPATH environemnt variable during
- bootstrap.
- + Avoid GNU-make dependencies in the texinfo subdir.
- + Install CPP wrapper script in $(prefix)/bin if --enable-cpp.
- --enable-cpp= can be used to specify an additional install
- directory for the cpp wrapper script.
- + Fix CSE bug which caused incorrect label-label refs to appear
- on some platforms.
- + Avoid linking in EH routines from libgcc if they are not
- needed.
- + Avoid obscure bug in aliasing code.
- + Fix bug in weak symbol handling.
- * Platform-specific improvements and fixes
- + Fix detection of PPro/PII on Unixware 7.
- + Fix compiler segfault when building spec99 and other programs
- for SPARC targets.
- + Fix code-generation bugs for integer and floating point
- conditional move instructions on the PPro/PII.
- + Use fixincludes to fix byteorder problems on i?86-*-sysv.
- + Fix build failure for the arc port.
- + Fix floating point format configuration for i?86-gnu port
- + Fix problems with hppa1.0-hp-hpux10.20 configuration when
- threads are enabled
- + Fix coldfire code generation bugs.
- + Fix "unrecognized insn" problems for Alpha and PPC ports.
- + Fix h8/300 code generation problem with floating point values
- in memory.
- + Fix unrecognized insn problems for the m68k port.
- + Fix namespace-pollution problem for the x86 port.
- + Fix problems with old assembler on x86 NeXT systems.
- + Fix PIC code-generation problems for the SPARC port.
- + Fix minor bug with LONG_CALLS in PowerPC SVR4 support.
- + Fix minor ISO namespace violation in Alpha varargs/stdarg
- support.
- + Fix incorrect "braf" instruction usage for the SH port.
- + Fix minor bug in va-sh which prevented its use with -ansi.
- + Fix problems recognizing and supporting FreeBSD.
- + Handle OpenBSD systems correctly.
- + Minor fixincludes fix for Digital UNIX 4.0B.
- + Fix problems with ctors/dtors in SCO shared libraries.
- + Abort instead of generating incorrect code for PPro/PII
- floating point conditional moves.
- + Avoid multiply defined symbols on Linux/GNU systems using
- libc-5.4.xx.
- + Fix abort in alpha compiler.
-
- Fortran-specific fixes
- * Fix the IDate intrinsic (VXT) (in libg2c) so the returned year is
- in the documented, non-Y2K-compliant range of 0-99, instead of
- being returned as 100 in the year 2000.
- * Fix the `Date_and_Time' intrinsic (in libg2c) to return the
- milliseconds value properly in Values(8).
- * Fix the `LStat' intrinsic (in libg2c) to return device-ID
- information properly in SArray(7).
-
- An important goal of EGCS is to allow wide scale testing of new
- features and optimizations which are still under development. However,
- EGCS has been carefully tested and should be comparable in quality to
- most gcc releases.
-
- EGCS 1.1.2 is based on the June 6, 1998 snapshot of the GCC 2.8
- development sources; it contains all of the new features found in GCC
- 2.8.1 as well as all new development from gcc2 up to June 6, 1998.
-
- See the [1]new features page for a more complete list of new features
- found in EGCS 1.1 releases.
-
- The EGCS 1.1.2 release includes installation instructions in both HTML
- and plaintext forms (see the INSTALL directory in the toplevel
- directory of the EGCS 1.1.2 distribution). However, we also keep the
- most up to date [2]installation instructions and [3]build/test status
- on our web page. We will update those pages as new information becomes
- available.
-
- The EGCS project would like to thank the numerous people that have
- contributed new features, test results, bugfixes, etc. This [4]amazing
- group of volunteers is what makes EGCS successful.
-
- And finally, we can't in good conscience fail to mention some
- [5]caveats to using EGCS 1.1.2. [6]Download EGCS 1.1.2 from
- egcs.cygnus.com (USA California) -->
-
- [7]Download EGCS 1.1.2 from go.cygnus.com (USA California - High speed
- link provided by Stanford)
-
- The EGCS 1.1.2 release is also available on many [8]mirror sites.
- _________________________________________________________________
-
- Last modified on July 28, 1999.
-
-References
-
- 1. http://gcc.gnu.org/egcs-1.1/features.html
- 2. http://gcc.gnu.org/install/index.html
- 3. http://gcc.gnu.org/egcs-1.1/buildstat.html
- 4. http://gcc.gnu.org/thanks.html
- 5. http://gcc.gnu.org/egcs-1.1/caveats.html
- 6. ftp://egcs.cygnus.com/pub/egcs/releases/index.html
- 7. ftp://go.cygnus.com/pub/sourceware.cygnus.com/pub/egcs/releases/index.html
- 8. http://gcc.gnu.org/mirrors.html
-======================================================================
-http://gcc.gnu.org/egcs-1.1/egcs-1.1.1.html
-
- EGCS 1.1.1
-
- December 1, 1998
-
- We are pleased to announce the release of EGCS 1.1.1.
-
- EGCS is a collaborative effort involving several groups of hackers
- using an open development model to accelerate development and testing
- of GNU compilers and runtime libraries.
-
- EGCS 1.1.1 is a minor update to the EGCS 1.1 compiler to fix several
- serious problems in EGCS 1.1.
- * General improvements and fixes
- + Avoid some stack overflows when compiling large functions.
- + Avoid incorrect loop invariant code motions.
- + Fix some core dumps on Linux kernel code.
- + Bring back the imake -Di386 and friends fix from EGCS 1.0.2.
- + Fix code generation problem in gcse.
- + Various documentation related fixes.
- * g++/libstdc++ improvements and fixes
- + MT safe EH fix for setjmp/longjmp based exception handling.
- + Fix a few bad interactions between optimization and exception
- handling.
- + Fixes for demangling of template names starting with "__".
- + Fix a bug that would fail to run destructors in some cases
- with -O2.
- + Fix 'new' of classes with virtual bases.
- + Fix crash building Qt on the Alpha.
- + Fix failure compiling WIFEXITED macro on GNU/Linux.
- + Fix some -frepo failures.
- * g77 and libf2c improvements and fixes
- + Various documentation fixes.
- + Avoid compiler crash on RAND intrinsic.
- + Fix minor bugs in makefiles exposed by BSD make programs.
- + Define _XOPEN_SOURCE for libI77 build to avoid potential
- problems on some 64-bit systems.
- + Fix problem with implicit endfile on rewind.
- + Fix spurious recursive I/O errors.
- * platform specific improvements and fixes
- + Match all versions of UnixWare7.
- + Do not assume x86 SVR4 or UnixWare targets can handle stabs
- + Fix PPC/RS6000 LEGITIMIZE_ADDRESS macro and bug in conversion
- from unsigned ints to double precision floats.
- + Fix ARM ABI issue with NetBSD.
- + Fix a few arm code generation bugs.
- + Fixincludes will fix additional broken SCO OpenServer header
- files.
- + Fix a m68k backend bug which caused invalid offsets in reg+d
- addresses.
- + Fix problems with 64bit AIX 4.3 support.
- + Fix handling of long longs for varargs/stdarg functions on
- the ppc.
- + Minor fixes to CPP predefines for Windows.
- + Fix code generation problems with gpr<->fpr copies for 64bit
- ppc
- + Fix a few coldfire code generation bugs.
- + Fix some more header file problems on SunOS 4.x
- + Fix assert.h handling for RTEMS.
- + Fix Windows handling of TREE_SYMBOL_REFERENCED.
- + Fix x86 compiler abort in reg-stack pass.
- + Fix cygwin/windows problem with section attributes.
- + Fix Alpha code generation problem exposed by SMP Linux
- kernels.
- + Fix typo in m68k 32->64bit integer conversion.
- + Make sure target libraries build with -fPIC for PPC & Alpha
- targets.
-
- An important goal of EGCS is to allow wide scale testing of new
- features and optimizations which are still under development. However,
- EGCS has been carefully tested and should be comparable in quality to
- most gcc releases.
-
- EGCS 1.1.1 is based on the June 6, 1998 snapshot of the GCC 2.8
- development sources; it contains all of the new features found in GCC
- 2.8.1 as well as all new development from gcc2 up to June 6, 1998.
-
- See the [1]new features page for a more complete list of new features
- found in EGCS 1.1 releases.
-
- The EGCS 1.1.1 release includes installation instructions in both HTML
- and plaintext forms (see the INSTALL directory in the toplevel
- directory of the EGCS 1.1.1 distribution). However, we also keep the
- most up to date [2]installation instructions and [3]build/test status
- on our web page. We will update those pages as new information becomes
- available.
-
- The EGCS project would like to thank the numerous people that have
- contributed new features, test results, bugfixes, etc. This [4]amazing
- group of volunteers is what makes EGCS successful.
-
- And finally, we can't in good conscience fail to mention some
- [5]caveats to using EGCS 1.1.1.
-
- [6]Download EGCS 1.1.1 from egcs.cygnus.com (USA California)
-
- The EGCS 1.1.1 release is also available on many mirror sites.
- [7]Goto mirror list to find a closer site
- _________________________________________________________________
-
- Last modified on July 28, 1999.
-
-References
-
- 1. http://gcc.gnu.org/egcs-1.1/features.html
- 2. http://gcc.gnu.org/install/index.html
- 3. http://gcc.gnu.org/egcs-1.1/buildstat.html
- 4. http://gcc.gnu.org/thanks.html
- 5. http://gcc.gnu.org/egcs-1.1/caveats.html
- 6. ftp://egcs.cygnus.com/pub/egcs/releases/index.html
- 7. http://gcc.gnu.org/mirrors.html
-======================================================================
-http://gcc.gnu.org/egcs-1.1/egcs-1.1.html
-
- EGCS 1.1
-
- September 3, 1998
-
- We are pleased to announce the release of EGCS 1.1.
-
- EGCS is a free software project to further the development of the GNU
- compilers using an open development environment.
-
- EGCS 1.1 is a major new release of the EGCS compiler system. It has
- been [1]extensively tested and is believed to be stable and suitable
- for widespread use.
-
- EGCS 1.1 is based on an June 6, 1998 snapshot of the GCC 2.8
- development sources; it contains all of the new features found in GCC
- 2.8.1 as well as all new development from GCC up to June 6, 1998.
-
- EGCS also contains many improvements and features not found in GCC or
- in older versions of EGCS.
- * Global common subexpression elimination and global constant/copy
- propagation (aka [2]gcse)
- * Ongoing improvements to the [3]alias analysis support to allow for
- better optimizations throughout the compiler.
- * Vastly improved [4]C++ compiler and integrated C++ runtime
- libraries.
- * Fixes for the /tmp symlink race security problems.
- * New targets including mips16, arm-thumb and 64 bit PowerPC.
- * Improvements to GNU Fortran (g77) compiler and runtime library
- made since [5]g77 version 0.5.23.
-
- See the [6]new features page for a more complete list of new features
- found in EGCS 1.1 releases.
-
- The EGCS 1.1 release includes installation instructions in both HTML
- and plaintext forms (see the INSTALL directory in the toplevel
- directory of the EGCS 1.1 distribution). However, we also keep the
- most up to date [7]installation instructions and [8]build/test status
- on our web page. We will update those pages as new information becomes
- available.
-
- The EGCS project would like to thank the numerous people that have
- contributed new features, test results, bugfixes, etc. This [9]amazing
- group of volunteers is what makes EGCS successful.
-
- And finally, we can't in good conscience fail to mention some
- [10]caveats to using EGCS 1.1.
-
- [11]Download EGCS 1.1 from egcs.cygnus.com (USA California)
-
- [12]Download EGCS 1.1 from go.cygnus.com (USA California -- High speed
- link provided by Stanford)
-
- The EGCS 1.1 release is also available on many mirror sites.
- [13]Goto mirror list to find a closer site
- _________________________________________________________________
-
- Last modified on September 4, 1999.
-
-References
-
- 1. http://gcc.gnu.org/egcs-1.1/egcs-1.1-test.html
- 2. http://gcc.gnu.org/news/gcse.html
- 3. http://gcc.gnu.org/news/alias.html
- 4. http://gcc.gnu.org/egcs-1.1/c++features.html
- 5. http://gcc.gnu.org/onlinedocs/g77_news.html
- 6. http://gcc.gnu.org/egcs-1.1/features.html
- 7. http://gcc.gnu.org/install/index.html
- 8. http://gcc.gnu.org/egcs-1.1/buildstat.html
- 9. http://gcc.gnu.org/thanks.html
- 10. http://gcc.gnu.org/egcs-1.1/caveats.html
- 11. ftp://egcs.cygnus.com/pub/egcs/releases/index.html
- 12. ftp://go.cygnus.com/pub/sourceware.cygnus.com/pub/egcs/releases/index.html
- 13. http://gcc.gnu.org/mirrors.html
-======================================================================
-http://gcc.gnu.org/egcs-1.1/features.html
-
- EGCS 1.1 new features
-
- * Integrated GNU Fortran (g77) compiler and runtime library with
- improvements, based on [1]g77 version 0.5.23.
- * Vast improvements in the C++ compiler; so many they have [2]page
- of their own!
- * Compiler implements [3]global common subexpression elimination and
- global copy/constant propagation.
- * More major improvements in the [4]alias analysis code.
- * More major improvements in the exception handling code to improve
- performance, lower static overhead and provide the infrastructure
- for future improvements.
- * The infamous /tmp symlink race security problems have been fixed.
- * The regmove optimization pass has been nearly completely rewritten
- to improve performance of generated code.
- * The compiler now recomputes register usage information before
- local register allocation. By providing more accurate information
- to the priority based allocator, we get better register
- allocation.
- * The register reloading phase of the compiler optimizes spill code
- much better than in previous releases.
- * Some bad interactions between the register allocator and
- instruction scheduler have been fixed, resulting in much better
- code for certain programs. Additionally, we have tuned the
- scheduler in various ways to improve performance of generated code
- for some architectures.
- * The compiler's branch shortening algorithms have been
- significantly improved to work better on targets which align jump
- targets.
- * The compiler now supports -Os to prefer optimizing for code space
- over optimizing for code speed.
- * The compiler will now totally eliminate library calls which
- compute constant values. This primarily helps targets with no
- integer div/mul support and targets without floating point
- support.
- * The compiler now supports an extensive "--help" option.
- * cpplib has been greatly improved and may be suitable for limited
- use.
- * Memory footprint for the compiler has been significantly reduced
- for some pathological cases.
- * The time to build EGCS has been improved for certain targets
- (particularly the alpha and mips platforms).
- * Many infrastructure improvements throughout the compiler, plus the
- usual mountain of bugfixes and minor improvements.
- * Target dependent improvements:
- + SPARC port now includes V8 plus and V9 support as well as
- performance tuning for Ultra class machines. The SPARC port
- now uses the Haifa scheduler.
- + Alpha port has been tuned for the EV6 processor and has an
- optimized expansion of memcpy/bzero. The Alpha port now uses
- the Haifa scheduler.
- + RS6000/PowerPC: EGCS 1.1 includes support for the Power64
- architecture and aix4.3 support. The RS6000/PowerPC port now
- uses the Haifa scheduler.
- + x86: Alignment of static store data and jump targets is per
- Intel recommendations now. Various improvements throughout
- the x86 port to improve performance on Pentium processors.
- Conditional move support has been fixed and enabled for PPro
- processors. The x86 port also better supports 64bit
- operations now.
- + MIPS has improved multiply/multiply-add support and now
- includes mips16 ISA support.
- + M68k has many micro-optimizations and Coldfire fixes.
- * Core compiler is based on the GCC development tree from June 9,
- 1998, so we have all of the [5]features found in GCC 2.8.
-
- [6]Return to the EGCS home page
-
- Last modified: September 4, 1999
-
-References
-
- 1. http://gcc.gnu.org/onlinedocs/g77_news.html
- 2. http://gcc.gnu.org/egcs-1.1/c++features.html
- 3. http://gcc.gnu.org/news/gcse.html
- 4. http://gcc.gnu.org/news/alias.html
- 5. http://gcc.gnu.org/egcs-1.0/features-2.8.html
- 6. http://gcc.gnu.org/index.html
-======================================================================
-http://gcc.gnu.org/egcs-1.1/caveats.html
-
- EGCS 1.1 Caveats
-
- * EGCS has an integrated libstdc++, but does not have an integrated
- libg++. Furthermore old libg++ releases will not work with EGCS;
- HJ Lu has made a [1]libg++ snapshot available which may work with
- EGCS.
- Note most C++ programs only need libstdc++.
- * Exception handling may not work with shared libraries,
- particularly on alphas, hppas, rs6000/powerpc and mips based
- platforms. Exception handling is known to work on x86-linux
- platforms with shared libraries.
- * Some versions of the Linux kernel have bugs which prevent them
- from being compiled or from running when compiled by EGCS. See
- [2]the FAQ for additional information.
- * In general, EGCS is more rigorous about rejecting invalid C++ code
- or deprecated C++ constructs than g++-2.7, g++-2.8 or EGCS 1.0. As
- a result it may be necessary to fix C++ code before it will
- compile with EGCS.
- * G++ is also converting toward the ISO C++ standard; as a result
- code which was previously valid (and thus accepted by other
- compilers and older versions of g++) may no longer be accepted.
- * EGCS 1.1 compiled C++ code is not binary compatible with EGCS
- 1.0.x or GCC 2.8.x due to changes necessary to support thread safe
- exception handling.
-
- [3]Return to the GCC home page
-
- Last modified: July 28, 1999
-
-References
-
- 1. ftp://ftp.yggdrasil.com/private/hjl/libg++-2.8.1.2.tar.gz
- 2. http://gcc.gnu.org/faq.html#linuxkernel
- 3. http://gcc.gnu.org/index.html
-======================================================================
-http://gcc.gnu.org/egcs-1.0/egcs-1.0.3.html
-
- EGCS 1.0.3
-
- May 15, 1998
-
- We are pleased to announce the release of EGCS 1.0.3.
-
- EGCS is a collaborative effort involving several groups of hackers
- using an open development model to accelerate development and testing
- of GNU compilers and runtime libraries.
-
- EGCS 1.0.3 is a minor update to the EGCS 1.0.2 compiler to fix a few
- problems reported by Red Hat for builds of Red Hat 5.1.
- * Generic bugfixes:
- + Fix a typo in the libio library which resulted in incorrect
- behavior of istream::get.
- + Fix the Fortran negative array index problem.
- + Fix a major problem with the ObjC runtime thread support
- exposed by glibc2.
- + Reduce memory consumption of the Haifa scheduler.
- * Target specific bugfixes:
- + Fix one x86 floating point code generation bug exposed by
- glibc2 builds.
- + Fix one x86 internal compiler error exposed by glibc2 builds.
- + Fix profiling bugs on the Alpha.
- + Fix ImageMagick & emacs 20.2 build problems on the Alpha.
- + Fix rs6000/ppc bug when converting values from integer types
- to floating point types.
-
- An important goal of EGCS is to allow wide scale testing of new
- features and optimizations which are still under development. However,
- EGCS has been carefully tested and should be comparable in quality to
- most GCC releases.
-
- EGCS 1.0.3 is based on an August 2, 1997 snapshot of the GCC 2.8
- development sources; it contains nearly all of the new features found
- in GCC 2.8.
-
- EGCS also contains many improvements and features not found in GCC 2.7
- or GCC 2.8.
- * Integrated C++ runtime libraries, including support for most major
- GNU/Linux systems!
- * The integrated libstdc++ library includes a verbatim copy of
- [1]SGI's STL release instead of a modified copy.
- * Integrated GNU Fortran compiler
- * New instruction scheduler
- * New alias analysis code
-
- See the [2]new features page for a more complete list of new features
- found in EGCS 1.0.x releases.
-
- The EGCS 1.0.3 release includes installation instructions in both HTML
- and plaintext forms (see the INSTALL directory in the toplevel
- directory of the EGCS 1.0.3 distribution). However, we also keep the
- most up to date [3]installation instructions and [4]build/test status
- on our web page. We will update those pages as new information becomes
- available.
-
- And, we can't in good conscience fail to mention some [5]caveats to
- using EGCS.
-
- Update: Big thanks to Stanford for providing a high speed link for
- downloading EGCS (go.cygnus.com)!
-
- [6]Download EGCS 1.0.3 from ftp.cygnus.com (USA California)
-
- [7]Download EGCS 1.0.3 from go.cygnus.com (USA California -- High
- speed link provided by Stanford)
-
- The EGCS 1.0.3 release is also available on many mirror sites.
- [8]Goto mirror list to find a closer site
-
- We'd like to thank the numerous people that have contributed new
- features, test results, bugfixes, etc. Unfortunately, they're far too
- numerous to mention by name.
- _________________________________________________________________
-
- Last modified on February 22, 1999.
-
-References
-
- 1. http://www.sgi.com/Technology/STL
- 2. http://gcc.gnu.org/egcs-1.0/features.html
- 3. http://gcc.gnu.org/install/index.html
- 4. http://gcc.gnu.org/egcs-1.0/buildstat.html
- 5. http://gcc.gnu.org/egcs-1.0/caveats.html
- 6. ftp://egcs.cygnus.com/pub/egcs/releases/index.html
- 7. ftp://go.cygnus.com/pub/sourceware.cygnus.com/pub/egcs/releases/index.html
- 8. http://gcc.gnu.org/mirrors.html
-======================================================================
-http://gcc.gnu.org/egcs-1.0/egcs-1.0.2.html
-
- EGCS 1.0.2
-
- March 16, 1998
-
- We are pleased to announce the release of EGCS 1.0.2.
-
- EGCS is a collaborative effort involving several groups of hackers
- using an open development model to accelerate development and testing
- of GNU compilers and runtime libraries.
-
- EGCS 1.0.2 is a minor update to the EGCS 1.0.1 compiler to fix several
- serious problems in EGCS 1.0.1.
- * General improvements and fixes
- + Memory consumption significantly reduced, especially for
- templates and inline functions.
- + Fix various problems with glibc2.1.
- + Fix loop optimization bug exposed by rs6000/ppc port.
- + Fix to avoid potential code generation problems in jump.c.
- + Fix some undefined symbol problems in dwarf1 debug support.
- * g++/libstdc++ improvements and fixes
- + libstdc++ in the EGCS release has been updated and should be
- link compatible with libstdc++-2.8.
- + Various fixes in libio/libstdc++ to work better on Linux
- systems.
- + Fix problems with duplicate symbols on systems that do not
- support weak symbols.
- + Memory corruption bug and undefined symbols in bastring have
- been fixed.
- + Various exception handling fixes.
- + Fix compiler abort for very long thunk names.
- * g77 improvements and fixes
- + Fix compiler crash for omitted bound in Fortran CASE
- statement.
- + Add missing entries to g77 lang-options.
- + Fix problem with -fpedantic in the g77 compiler.
- + Fix "backspace" problem with g77 on alphas.
- + Fix x86 backend problem with Fortran literals and -fpic.
- + Fix some of the problems with negative subscripts for g77 on
- alphas.
- + Fixes for Fortran builds on cygwin32/mingw32.
- * platform specific improvements and fixes
- + Fix long double problems on x86 (exposed by glibc)
- + x86 ports define i386 again to keep imake happy.
- + Fix exception handling support on NetBSD ports.
- + Several changes to collect2 to fix many problems with AIX.
- + Define __ELF__ for rs6000/linux.
- + Fix -mcall-linux problem on rs6000/linux.
- + Fix stdarg/vararg problem for rs6000/linux.
- + Allow autoconf to select a proper install problem on AIX 3.1.
- + m68k port support includes -mcpu32 option as well as cpu32
- multilibs.
- + Fix stdarg bug for irix6.
- + Allow EGCS to build on irix5 without the gnu assembler.
- + Fix problem with static linking on sco5.
- + Fix bootstrap on sco5 with native compiler.
- + Fix for abort building newlib on H8 target.
- + Fix fixincludes handling of math.h on SunOS.
- + Minor fix for motorola 3300 m68k systems.
-
- An important goal of EGCS is to allow wide scale testing of new
- features and optimizations which are still under development. However,
- EGCS has been carefully tested and should be comparable in quality to
- most GCC releases.
-
- EGCS 1.0.2 is based on an August 2, 1997 snapshot of the GCC 2.8
- development sources; it contains nearly all of the new features found
- in GCC 2.8.
-
- EGCS also contains many improvements and features not found in GCC 2.7
- or GCC 2.8.
- * Integrated C++ runtime libraries, including support for most major
- linux systems!
- * The integrated libstdc++ library includes a verbatim copy of
- [1]SGI's STL release.
- * Integrated GNU Fortran compiler
- * New instruction scheduler
- * New alias analysis code
-
- See the [2]new features page for a more complete list of new features
- found in EGCS 1.0.x releases.
-
- The EGCS 1.0.2 release includes installation instructions in both HTML
- and plaintext forms (see the INSTALL directory in the toplevel
- directory of the EGCS 1.0.2 distribution). However, we also keep the
- most up to date [3]installation instructions and [4]build/test status
- on our web page. We will update those pages as new information becomes
- available.
-
- And, we can't in good conscience fail to mention some [5]caveats to
- using EGCS.
-
- Update: Big thanks to Stanford for providing a high speed link for
- downloading EGCS (go.cygnus.com)!
-
- [6]Download EGCS 1.0.2 from ftp.cygnus.com (USA California)
-
- [7]Download EGCS 1.0.2 from go.cygnus.com (USA California -- High
- speed link provided by Stanford)
-
- The EGCS 1.0.2 release is also available on many mirror sites.
- [8]Goto mirror list to find a closer site
-
- We'd like to thank the numerous people that have contributed new
- features, test results, bugfixes, etc. Unfortunately, they're far too
- numerous to mention by name.
- _________________________________________________________________
-
- Last modified on July 28, 1999.
-
-References
-
- 1. http://www.sgi.com/Technology/STL/
- 2. http://gcc.gnu.org/egcs-1.0/features.html
- 3. http://gcc.gnu.org/install/index.html
- 4. http://gcc.gnu.org/egcs-1.0/buildstat.html
- 5. http://gcc.gnu.org/egcs-1.0/caveats.html
- 6. ftp://egcs.cygnus.com/pub/egcs/releases/index.html
- 7. ftp://go.cygnus.com/pub/sourceware.cygnus.com/pub/egcs/releases/index.html
- 8. http://gcc.gnu.org/mirrors.html
-======================================================================
-http://gcc.gnu.org/egcs-1.0/egcs-1.0.1.html
-
- EGCS 1.0.1
-
- January 6, 1998
-
- We are pleased to announce the release of EGCS 1.0.1.
-
- EGCS is a collaborative effort involving several groups of hackers
- using an open development model to accelerate development and testing
- of GNU compilers and runtime libraries.
-
- EGCS 1.0.1 is a minor update to the EGCS 1.0 compiler to fix a few
- critical bugs and add support for Red Hat 5.0 Linux. Changes since the
- EGCS 1.0 release:
- * Add support for Red Hat 5.0 Linux and better support for Linux
- systems using glibc2.
- Many programs failed to link when compiled with EGCS 1.0 on Red
- Hat 5.0 or on systems with newer versions of glibc2. EGCS 1.0.1
- should fix these problems.
- * Compatability with both EGCS 1.0 and GCC 2.8 libgcc exception
- handling interfaces.
- To avoid future compatibility problems, we strongly urge anyone
- who is planning on distributing shared libraries that contain C++
- code to upgrade to EGCS 1.0.1 first.
- Soon after EGCS 1.0 was released, the GCC developers made some
- incompatible changes in libgcc's exception handling interfaces.
- These changes were needed to solve problems on some platforms.
- This means that GCC 2.8.0, when released, will not be seamlessly
- compatible with shared libraries built by EGCS 1.0. The reason is
- that the libgcc.a in GCC 2.8.0 will not contain a function needed
- by the old interface.
- The result of this is that there may be compatibility problems
- with shared libraries built by EGCS 1.0 when used with GCC 2.8.0.
- With EGCS 1.0.1, generated code uses the new (GCC 2.8.0)
- interface, and libgcc.a has the support routines for both the old
- and the new interfaces (so EGCS 1.0.1 and EGCS 1.0 code can be
- freely mixed, and EGCS 1.0.1 and GCC 2.8.0 code can be freely
- mixed).
- The maintainers of GCC 2.x have decided against including seamless
- support for the old interface in 2.8.0, since it was never
- "official", so to avoid future compatibility problems we recommend
- against distributing any shared libraries built by EGCS 1.0 that
- contain C++ code (upgrade to 1.0.1 and use that).
- * Various bugfixes in the x86, hppa, mips, and rs6000/ppc backends.
- The x86 changes fix code generation errors exposed when building
- glibc2 and the Linux dynamic linker (ld.so).
- The hppa change fixes a compiler abort when configured for use
- with RTEMS.
- The MIPS changes fix problems with the definition of LONG_MAX on
- newer systems, allow for command line selection of the target ABI,
- and fix one code generation problem.
- The rs6000/ppc change fixes some problems with passing structures
- to varargs/stdarg functions.
- * A few machine independent bugfixes, mostly to fix code generation
- errors when building Linux kernels or glibc.
- * Fix a few critical exception handling and template bugs in the C++
- compiler.
- * Fix Fortran namelist bug on alphas.
- * Fix build problems on x86-solaris systems.
-
- An important goal of EGCS is to allow wide scale testing of new
- features and optimizations which are still under development. However,
- EGCS has been carefully tested and should be comparable in quality to
- most GCC releases.
-
- EGCS 1.0.1 is based on an August 2, 1997 snapshot of the GCC 2.8
- development sources; it contains nearly all of the new features found
- in GCC 2.8.
-
- EGCS also contains many improvements and features not found in GCC 2.7
- and even the soon to be released GCC 2.8 compilers.
- * Integrated C++ runtime libraries, including support for most major
- linux systems!
- * The integrated libstdc++ library includes a verbatim copy of
- [1]SGI's STL release.
- * Integrated GNU Fortran compiler
- * New instruction scheduler
- * New alias analysis code
-
- See the [2]new features page for a more complete list of new features
- found in EGCS 1.0.x releases.
-
- The EGCS 1.0.1 release includes installation instructions in both HTML
- and plaintext forms (see the INSTALL directory in the toplevel
- directory of the EGCS 1.0.1 distribution). However, we also keep the
- most up to date [3]installation instructions and [4]build/test status
- on our web page. We will update those pages as new information becomes
- available.
-
- And, we can't in good conscience fail to mention some [5]caveats to
- using EGCS.
-
- Update: Big thanks to Stanford for providing a high speed link for
- downloading EGCS (go.cygnus.com)!
-
- [6]Download EGCS 1.0.1 from ftp.cygnus.com (USA California)
-
- [7]Download EGCS 1.0.1 from go.cygnus.com (USA California -- High
- speed link provided by Stanford)
-
- The EGCS 1.0.1 release is also available on many mirror sites.
- [8]Goto mirror list to find a closer site
-
- We'd like to thank the numerous people that have contributed new
- features, test results, bugfixes, etc. Unfortunately, they're far too
- numerous to mention by name.
- _________________________________________________________________
-
- Last modified on July 28, 1999.
-
-References
-
- 1. http://www.sgi.com/Technology/STL/
- 2. http://gcc.gnu.org/egcs-1.0/features.html
- 3. http://gcc.gnu.org/install/index.html
- 4. http://gcc.gnu.org/egcs-1.0/buildstat.html
- 5. http://gcc.gnu.org/egcs-1.0/caveats.html
- 6. ftp://egcs.cygnus.com/pub/egcs/releases/index.html
- 7. ftp://go.cygnus.com/pub/sourceware.cygnus.com/pub/egcs/releases/index.html
- 8. http://gcc.gnu.org/mirrors.html
-======================================================================
-http://gcc.gnu.org/egcs-1.0/egcs-1.0.html
-
- EGCS 1.0
-
- December 3, 1997
-
- We are pleased to announce the release of EGCS 1.0.
-
- EGCS is a collaborative effort involving several groups of hackers
- using an open development model to accelerate development and testing
- of GNU compilers and runtime libraries.
-
- An important goal of EGCS is to allow wide scale testing of
- experimental features and optimizations; therefore, EGCS contains some
- features and optimizations which are still under development. However,
- EGCS has been carefully tested and should be comparable in quality to
- most GCC releases.
-
- EGCS 1.0 is based on an August 2, 1997 snapshot of the GCC 2.8
- development sources; it contains nearly all of the new features found
- in GCC 2.8.
-
- EGCS 1.0 also contains many improvements and features not found in GCC
- 2.7 and even the soon to be released GCC 2.8 compilers.
- * Integrated C++ runtime libraries, including support for most major
- linux systems!
- * The integrated libstdc++ library includes a verbatim copy of
- [1]SGI's STL release.
- * Integrated GNU Fortran compiler
- * New instruction scheduler
- * New alias analysis code
-
- See the [2]new features page for a more complete list of new features.
-
- The EGCS 1.0 release includes installation instructions in both HTML
- and plaintext forms (see the INSTALL directory in the toplevel
- directory of the EGCS 1.0 distribution). However, we also keep the
- most up to date [3]installation instructions and [4]build/test status
- on our web page. We will update those pages as new information becomes
- available.
-
- And, we can't in good conscience fail to mention some [5]caveats to
- using EGCS.
-
- Update: The T1 into our main California offices has been 100%
- saturated since shortly after the release. We've added an EGCS 1.0
- mirror at our Massachusetts office to help share the load. We also
- encourage folks to use the many mirrors available throughout the
- world.
-
- Update: Big thanks to Stanford for providing a high speed link for
- downloading EGCS! (go.cygnus.com)
-
- [6]Download EGCS 1.0 from ftp.cygnus.com (USA California)
-
- [7]Download EGCS 1.0 from go.cygnus.com (USA California -- High speed
- link provided by Stanford)
-
- The EGCS 1.0 release should be available on most mirror sites by now.
- [8]Goto mirror list to find a closer site
-
- We'd like to thank the numerous people that have contributed new
- features, test results, bugfixes, etc. Unfortunately, they're far too
- numerous to mention by name.
- _________________________________________________________________
-
- Last modified on July 28, 1999.
-
-References
-
- 1. http://www.sgi.com/Technology/STL
- 2. http://gcc.gnu.org/egcs-1.0/features.html
- 3. http://gcc.gnu.org/install/index.html
- 4. http://gcc.gnu.org/egcs-1.0/buildstat.html
- 5. http://gcc.gnu.org/egcs-1.0/caveats.html
- 6. ftp://egcs.cygnus.com/pub/egcs/releases/index.html
- 7. ftp://go.cygnus.com/pub/sourceware.cygnus.com/pub/egcs/releases/index.html
- 8. http://gcc.gnu.org/mirrors.html
-======================================================================
-http://gcc.gnu.org/egcs-1.0/features.html
-
- EGCS 1.0 features
-
- * Core compiler is based on the gcc2 development tree from Aug 2,
- 1997, so we have most of the [1]features found in GCC 2.8.
- * Integrated GNU Fortran compiler based on g77-0.5.22-19970929.
- * Vast improvements in the C++ compiler; so many they have [2]page
- of their own!
- * Integrated C++ runtime libraries, including support for most major
- linux systems!
- * New instruction scheduler from IBM Haifa which includes support
- for function wide instruction scheduling as well as superscalar
- scheduling.
- * Significantly improved alias analysis code.
- * Improved register allocation for two address machines.
- * Significant code generation improvements for Fortran code on
- Alphas
- * Various optimizations from the g77 project as well as improved
- loop optimizations.
- * Dwarf2 debug format support for some targets.
- * egcs libstdc++ includes the SGI STL implementation without
- changes.
- * As a result of these and other changes, egcs libstc++ is not
- binary compatible with previous releases of libstdc++.
- * Various new ports -- UltraSPARC, Irix6.2 & Irix6.3 support, The
- SCO Openserver 5 family (5.0.{0,2,4} and Internet FastStart 1.0
- and 1.1), Support for RTEMS on several embedded targets, Support
- for arm-linux, Mitsubishi M32R, Hitachi H8/S, Matsushita MN102 and
- MN103, NEC V850, Sparclet, Solaris & Linux on PowerPCs, etc.
- * Integrated testsuites for gcc, g++, g77, libstdc++ and libio.
- * RS6000/PowerPC ports generate code which can run on all
- RS6000/PowerPC variants by default.
- * -mcpu= and -march= switches for the x86 port to allow better
- control over how the x86 port generates code.
- * Includes the template repository patch (aka repo patch); note the
- new template code makes repo obsolete for ELF systems using gnu-ld
- such as Linux.
- * Plus the usual assortment of bugfixes and improvements.
-
- [3]Return to the egcs home page
-
- Last modified: July 28, 1999
-
-References
-
- 1. http://gcc.gnu.org/egcs-1.0/features-2.8.html
- 2. http://gcc.gnu.org/egcs-1.0/c++features.html
- 3. http://gcc.gnu.org/index.html
-======================================================================
-http://gcc.gnu.org/egcs-1.0/caveats.html
-
- EGCS 1.0 Caveats
-
- * EGCS has an integrated libstdc++, but does not have an integrated
- libg++. Furthermore old libg++ releases will not work with egc; HJ
- Lu has made a [1]libg++ snapshot available which may work with
- EGCS.
- Note most C++ programs only need libstdc++.
- * Note that using -pedantic or -Wreturn-type can cause an explosion
- in the amount of memory needed for template-heavy C++ code, such
- as code that uses STL. Also note that -Wall includes
- -Wreturn-type, so if you use -Wall you will need to specify
- -Wno-return-type to turn it off.
- * Exception handling may not work with shared libraries,
- particularly on alphas, hppas, and mips based platforms. Exception
- handling is known to work on x86-linux platforms with shared
- libraries.
- * Some versions of the Linux kernel have bugs which prevent them
- from being compiled or from running when compiled by EGCS. See
- [2]the FAQ for additional information.
- * In general, EGCS is more rigorous about rejecting invalid C++ code
- or deprecated C++ constructs than G++ 2.7. As a result it may be
- necessary to fix C++ code before it will compile with EGCS.
- * G++ is also aggressively tracking the C++ standard; as a result
- code which was previously valid (and thus accepted by other
- compilers and older versions of G++) may no longer be accepted.
- * EGCS 1.0 may not work with Red Hat Linux 5.0 on all targets. EGCS
- 1.0.x and later releases should work with Red Hat Linux 5.0.
-
- [3]Return to the GCC home page
-
- Last modified: August 27, 1998
-
-References
-
- 1. ftp://ftp.yggdrasil.com/private/hjl/libg++-2.8.1.2.tar.gz
- 2. http://gcc.gnu.org/faq.html#linuxkernel
- 3. http://gcc.gnu.org/index.html
-======================================================================
diff --git a/gcc/README b/gcc/README
deleted file mode 100644
index 85d5e364034..00000000000
--- a/gcc/README
+++ /dev/null
@@ -1,26 +0,0 @@
-This directory contains the GNU Compiler Collection (GCC) version 2.96.
-It includes all of the support for compiling C, C++, Objective C, Fortran,
-Java, and Chill.
-
-The GNU Compiler Collection is free software. See the file COPYING for copying
-permission.
-
-See the file gcc.texi (together with other files that it includes) for
-installation and porting information. The file INSTALL contains a
-copy of the installation information, as plain ASCII.
-
-Installing this package will create various files in subdirectories of
-/usr/local/lib, which are passes used by the compiler and a library
-named libgcc.a. It will also create /usr/local/bin/gcc, which is
-the user-level command to do a compilation.
-
-See the Bugs chapter of the GCC Manual for how to report bugs
-usefully. An online readable version of the manual is in the files
-gcc.info*.
-
-The files pself.c and pself1.c are not part of GCC.
-They are programs that print themselves on standard output.
-They were written by Dario Dariol and Giovanni Cozzi, and are
-included for your hacking pleasure. Likewise pself2.c
-(Who is the author of that?) and pself3.c (by Vlad Taeerov and Rashit
-Fakhreyev).
diff --git a/gcc/README.ACORN b/gcc/README.ACORN
deleted file mode 100644
index 769dba74a33..00000000000
--- a/gcc/README.ACORN
+++ /dev/null
@@ -1,18 +0,0 @@
-Specifying the -g flag to GCC on a RISC iX machine requires upgrading the
-standard assembler distributed with both RISC iX 1.1 and RISC iX 1.2 with a
-replacement that is available from Acorn. This version of the assembler is
-also an order of magnitude faster when assembling to an NFS mounted
-file-system.
-
-Users of RISC iX 1.2 and above can obtain a copy of the assembler from the
-following places:
-
-1) Via ftp from acorn.acorn.co.uk, directory pub/riscix.
-
-2) From Acorn Customer Services.
-
-3) From Granada Microcare.
-
-Users of versions of RISC iX prior 1.2 should contact Acorn Customer Services;
-the assembler available on the net will not work with these versions due to
-changes in the shared libraries and system call numbers.
diff --git a/gcc/README.ALTOS b/gcc/README.ALTOS
deleted file mode 100644
index c0a1a04145f..00000000000
--- a/gcc/README.ALTOS
+++ /dev/null
@@ -1,55 +0,0 @@
-Since COFF-encapsulation is obsolete, this may not be needed anymore.
-
-Return-Path: <jkp@sauna.hut.fi>
-Date: Mon, 10 Apr 89 10:13:45 +0300
-From: Jyrki Kuoppala <jkp@sauna.hut.fi>
-Sender: jkp@sauna.hut.fi
-To: info-gcc@prep.ai.mit.edu
-Subject: Kernel fix needed for Altos 3068 to get coff-encapsulation working right
-Organization: Helsinki University of Technology, Finland.
-
-Here's a description how to fix a kernel bug in Altos 3068 and get
-gcc-compiled programs working.
-
-Author: Jyrki Kuoppala (jkp@cs.hut.fi)
-Last modified: Mon Apr 10 09:28:40 1989
-
-There's a bug in the Altos 3068 kernel that causes gcc-compiled
-programs to fail in certain situations when the machine has a heavy
-load and also in some other situations. The bug exists at least in
-SVR 2.2 1.0gT1 and SVR 2.2 1.0e.
-
-If you have source code to your system, apply the following change to
-os/exec.c (function gethead):
-
-Change the lines containing
-
- u.u_exdata.ux_tstart = sizeof(struct naout) +
- sizeof(struct filhd) + (ep->ef.nscns * sizeof(struct scnhdr));
-
-to
-
- u.u_exdata.ux_tstart = u.u_exdata.ux_txtorg;
-
-If you only have binary, use sdb to find out the address of the
-previous lines (on our system it's gethead+0x140) and use your
-favourite binary editor to change the bytes '3036 0162 fffc 0002 0280
-0000' to '23f9 01fb f4ca 01fb f4c2 6016'. This may or may not work in
-your case, depending on the version of the operating system and the
-phase of the moon.
-
-Here's what is just before gethead+0x140 to ease finding out the right place:
-
-0x9224 (gethead+0x122): 23f9 01fb f4ca 01fb f4ce mov.l &0x1fbf4ca.L,&0
-x1fbf4ce.L []
-0x922e (gethead+0x12c): 23f9 01fb f4c6 01fb f4ca mov.l &0x1fbf4c6.L,&0
-x1fbf4ca.L []
-0x9238 (gethead+0x136): 23f9 01fb f4c2 01fb f4c6 mov.l &0x1fbf4c2.L,&0
-x1fbf4c6.L []
-
-Good luck !
-
-//Jyrki
-
-jkp@cs.hut.fi
-
diff --git a/gcc/README.C4X b/gcc/README.C4X
deleted file mode 100644
index 994e67d4cc9..00000000000
--- a/gcc/README.C4X
+++ /dev/null
@@ -1,48 +0,0 @@
-This file describes the implementation notes of the GNU C Compiler for
-the Texas Instruments Floating Point Digital Signal Processor
-families, TMS320C3x and TMS320C4x (including the C30, C31, C32, C40,
-and C44 chips).
-
-
-Currently, only two code variants are generated---those for the C3x
-and C4x architectures. Note that the new operand combinations for
-parallel instructions, included in newer silicon revisions, are not
-yet supported. These should be trivial to add for someone with the
-newer chips and the inclination.
-
-
-While the generated assembly code is fairly similar to that recognised
-by the TI assembler, there are a few differences (currently the machine
-option -mti, designed to enfore compatibility, is not fully
-implemented). The major difference is the use of the ^ operator to
-load the 16 MSBs of an address or constant for the C4x.
-
-
-The generated assembly code requires the GNU assembler (GAS). This is
-not currently included as part of the binutils package, due to the
-many hacks required to be compatible with TI's kludged COFF
-implementation, and the binutils not being designed for 32-bit bytes.
-Patches against binutils-2.7.2 can be obtained from
-http://www.elec.canterbury.ac.nz/c4x. This site also has patches for
-the GNU debugger (GDB), incoporating a cycle accurate simulator that
-can display profiles and histories of code execution, detailing
-pipeline conflicts etc.
-
-
-GCC can be configured as a cross compiler for both the C3x and C4x
-architectures on the same system. Use `configure --target=c4x' to
-configure GCC for both the C3x and C4x. Then use the -m30 option to
-generate code for the C30 or -m40 (the default) for the C40.
-
-
-Further installation notes and other optimization patches for the C4x
-target can also be obtained from http://www.elec.canterbury.ac.nz/c4x.
-
-
-A Majordomo mailing list, gcc_c40@atlantek.com.au, exists to discuss
-related issues and suggestions for further optimizations. To
-subscribe send a message with `subscribe gcc_c40' in the body to
-majordomo@atlantek.com.au.
-
-
-Michael Hayes, 26 Nov 98
diff --git a/gcc/README.DWARF b/gcc/README.DWARF
deleted file mode 100644
index 97459508b3c..00000000000
--- a/gcc/README.DWARF
+++ /dev/null
@@ -1,574 +0,0 @@
-Notes on the GNU Implementation of DWARF Debugging Information
---------------------------------------------------------------
-Last Updated: Sun Jul 17 08:17:42 PDT 1994 by rfg@segfault.us.com
-------------------------------------------------------------
-
-This file describes special and unique aspects of the GNU implementation
-of the DWARF debugging information language, as provided in the GNU version
-2.x compiler(s).
-
-For general information about the DWARF debugging information language,
-you should obtain the DWARF version 1 specification document (and perhaps
-also the DWARF version 2 draft specification document) developed by the
-UNIX International Programming Languages Special Interest Group. A copy
-of the DWARF version 1 specification (in PostScript form) may be
-obtained either from me <rfg@netcom.com> or from the main Data General
-FTP server. (See below.) The file you are looking at now only describes
-known deviations from the DWARF version 1 specification, together with
-those things which are allowed by the DWARF version 1 specification but
-which are known to cause interoperability problems (e.g. with SVR4 SDB).
-
-To obtain a copy of the DWARF Version 1 and/or DWARF Version 2 specification
-from Data General's FTP server, use the following procedure:
-
----------------------------------------------------------------------------
- ftp to machine: "dg-rtp.dg.com" (128.222.1.2).
-
- Log in as "ftp".
- cd to "plsig"
- get any of the following file you are interested in:
-
- dwarf.1.0.3.ps
- dwarf.2.0.0.index.ps
- dwarf.2.0.0.ps
----------------------------------------------------------------------------
-
-The generation of DWARF debugging information by the GNU version 2.x C
-compiler has now been tested rather extensively for m88k, i386, i860, and
-Sparc targets. The DWARF output of the GNU C compiler appears to inter-
-operate well with the standard SVR4 SDB debugger on these kinds of target
-systems (but of course, there are no guarantees).
-
-DWARF generation for the GNU g++ compiler is still not operable. This is
-due primarily to the many remaining cases where the g++ front end does not
-conform to the conventions used in the GNU C front end for representing
-various kinds of declarations in the TREE data structure. It is not clear
-at this time how these problems will be addressed.
-
-Future plans for the dwarfout.c module of the GNU compiler(s) includes the
-addition of full support for GNU FORTRAN. (This should, in theory, be a
-lot simpler to add than adding support for g++... but we'll see.)
-
-Many features of the DWARF version 2 specification have been adapted to
-(and used in) the GNU implementation of DWARF (version 1). In most of
-these cases, a DWARF version 2 approach is used in place of (or in addition
-to) DWARF version 1 stuff simply because it is apparent that DWARF version
-1 is not sufficiently expressive to provide the kinds of information which
-may be necessary to support really robust debugging. In all of these cases
-however, the use of DWARF version 2 features should not interfere in any
-way with the interoperability (of GNU compilers) with generally available
-"classic" (pre version 1) DWARF consumer tools (e.g. SVR4 SDB).
-
-The DWARF generation enhancement for the GNU compiler(s) was initially
-donated to the Free Software Foundation by Network Computing Devices.
-(Thanks NCD!) Additional development and maintenance of dwarfout.c has
-been largely supported (i.e. funded) by Intel Corporation. (Thanks Intel!)
-
-If you have questions or comments about the DWARF generation feature, please
-send mail to me <rfg@netcom.com>. I will be happy to investigate any bugs
-reported and I may even provide fixes (but of course, I can make no promises).
-
-The DWARF debugging information produced by GCC may deviate in a few minor
-(but perhaps significant) respects from the DWARF debugging information
-currently produced by other C compilers. A serious attempt has been made
-however to conform to the published specifications, to existing practice,
-and to generally accepted norms in the GNU implementation of DWARF.
-
- ** IMPORTANT NOTE ** ** IMPORTANT NOTE ** ** IMPORTANT NOTE **
-
-Under normal circumstances, the DWARF information generated by the GNU
-compilers (in an assembly language file) is essentially impossible for
-a human being to read. This fact can make it very difficult to debug
-certain DWARF-related problems. In order to overcome this difficulty,
-a feature has been added to dwarfout.c (enabled by the -fverbose-asm
-option) which causes additional comments to be placed into the assembly
-language output file, out to the right-hand side of most bits of DWARF
-material. The comments indicate (far more clearly that the obscure
-DWARF hex codes do) what is actually being encoded in DWARF. Thus, the
--fverbose-asm option can be highly useful for those who must study the
-DWARF output from the GNU compilers in detail.
-
----------
-
-(Footnote: Within this file, the term `Debugging Information Entry' will
-be abbreviated as `DIE'.)
-
-
-Release Notes (aka known bugs)
--------------------------------
-
-In one very obscure case involving dynamically sized arrays, the DWARF
-"location information" for such an array may make it appear that the
-array has been totally optimized out of existence, when in fact it
-*must* actually exist. (This only happens when you are using *both* -g
-*and* -O.) This is due to aggressive dead store elimination in the
-compiler, and to the fact that the DECL_RTL expressions associated with
-variables are not always updated to correctly reflect the effects of
-GCC's aggressive dead store elimination.
-
--------------------------------
-
-When attempting to set a breakpoint at the "start" of a function compiled
-with -g1, the debugger currently has no way of knowing exactly where the
-end of the prologue code for the function is. Thus, for most targets,
-all the debugger can do is to set the breakpoint at the AT_low_pc address
-for the function. But if you stop there and then try to look at one or
-more of the formal parameter values, they may not have been "homed" yet,
-so you may get inaccurate answers (or perhaps even addressing errors).
-
-Some people may consider this simply a non-feature, but I consider it a
-bug, and I hope to provide some GNU-specific attributes (on function
-DIEs) which will specify the address of the end of the prologue and the
-address of the beginning of the epilogue in a future release.
-
--------------------------------
-
-It is believed at this time that old bugs relating to the AT_bit_offset
-values for bit-fields have been fixed.
-
-There may still be some very obscure bugs relating to the DWARF description
-of type `long long' bit-fields for target machines (e.g. 80x86 machines)
-where the alignment of type `long long' data objects is different from
-(and less than) the size of a type `long long' data object.
-
-Please report any problems with the DWARF description of bit-fields as you
-would any other GCC bug. (Procedures for bug reporting are given in the
-GNU C compiler manual.)
-
---------------------------------
-
-At this time, GCC does not know how to handle the GNU C "nested functions"
-extension. (See the GCC manual for more info on this extension to ANSI C.)
-
---------------------------------
-
-The GNU compilers now represent inline functions (and inlined instances
-thereof) in exactly the manner described by the current DWARF version 2
-(draft) specification. The version 1 specification for handling inline
-functions (and inlined instances) was known to be brain-damaged (by the
-PLSIG) when the version 1 spec was finalized, but it was simply too late
-in the cycle to get it removed before the version 1 spec was formally
-released to the public (by UI).
-
---------------------------------
-
-At this time, GCC does not generate the kind of really precise information
-about the exact declared types of entities with signed integral types which
-is required by the current DWARF draft specification.
-
-Specifically, the current DWARF draft specification seems to require that
-the type of an non-unsigned integral bit-field member of a struct or union
-type be represented as either a "signed" type or as a "plain" type,
-depending upon the exact set of keywords that were used in the
-type specification for the given bit-field member. It was felt (by the
-UI/PLSIG) that this distinction between "plain" and "signed" integral types
-could have some significance (in the case of bit-fields) because ANSI C
-does not constrain the signedness of a plain bit-field, whereas it does
-constrain the signedness of an explicitly "signed" bit-field. For this
-reason, the current DWARF specification calls for compilers to produce
-type information (for *all* integral typed entities... not just bit-fields)
-which explicitly indicates the signedness of the relevant type to be
-"signed" or "plain" or "unsigned".
-
-Unfortunately, the GNU DWARF implementation is currently incapable of making
-such distinctions.
-
---------------------------------
-
-
-Known Interoperability Problems
--------------------------------
-
-Although the GNU implementation of DWARF conforms (for the most part) with
-the current UI/PLSIG DWARF version 1 specification (with many compatible
-version 2 features added in as "vendor specific extensions" just for good
-measure) there are a few known cases where GCC's DWARF output can cause
-some confusion for "classic" (pre version 1) DWARF consumers such as the
-System V Release 4 SDB debugger. These cases are described in this section.
-
---------------------------------
-
-The DWARF version 1 specification includes the fundamental type codes
-FT_ext_prec_float, FT_complex, FT_dbl_prec_complex, and FT_ext_prec_complex.
-Since GNU C is only a C compiler (and since C doesn't provide any "complex"
-data types) the only one of these fundamental type codes which GCC ever
-generates is FT_ext_prec_float. This fundamental type code is generated
-by GCC for the `long double' data type. Unfortunately, due to an apparent
-bug in the SVR4 SDB debugger, SDB can become very confused wherever any
-attempt is made to print a variable, parameter, or field whose type was
-given in terms of FT_ext_prec_float.
-
-(Actually, SVR4 SDB fails to understand *any* of the four fundamental type
-codes mentioned here. This will fact will cause additional problems when
-there is a GNU FORTRAN front-end.)
-
---------------------------------
-
-In general, it appears that SVR4 SDB is not able to effectively ignore
-fundamental type codes in the "implementation defined" range. This can
-cause problems when a program being debugged uses the `long long' data
-type (or the signed or unsigned varieties thereof) because these types
-are not defined by ANSI C, and thus, GCC must use its own private fundamental
-type codes (from the implementation-defined range) to represent these types.
-
---------------------------------
-
-
-General GNU DWARF extensions
-----------------------------
-
-In the current DWARF version 1 specification, no mechanism is specified by
-which accurate information about executable code from include files can be
-properly (and fully) described. (The DWARF version 2 specification *does*
-specify such a mechanism, but it is about 10 times more complicated than
-it needs to be so I'm not terribly anxious to try to implement it right
-away.)
-
-In the GNU implementation of DWARF version 1, a fully downward-compatible
-extension has been implemented which permits the GNU compilers to specify
-which executable lines come from which files. This extension places
-additional information (about source file names) in GNU-specific sections
-(which should be totally ignored by all non-GNU DWARF consumers) so that
-this extended information can be provided (to GNU DWARF consumers) in a way
-which is totally transparent (and invisible) to non-GNU DWARF consumers
-(e.g. the SVR4 SDB debugger). The additional information is placed *only*
-in specialized GNU-specific sections, where it should never even be seen
-by non-GNU DWARF consumers.
-
-To understand this GNU DWARF extension, imagine that the sequence of entries
-in the .lines section is broken up into several subsections. Each contiguous
-sequence of .line entries which relates to a sequence of lines (or statements)
-from one particular file (either a `base' file or an `include' file) could
-be called a `line entries chunk' (LEC).
-
-For each LEC there is one entry in the .debug_srcinfo section.
-
-Each normal entry in the .debug_srcinfo section consists of two 4-byte
-words of data as follows:
-
- (1) The starting address (relative to the entire .line section)
- of the first .line entry in the relevant LEC.
-
- (2) The starting address (relative to the entire .debug_sfnames
- section) of a NUL terminated string representing the
- relevant filename. (This filename name be either a
- relative or an absolute filename, depending upon how the
- given source file was located during compilation.)
-
-Obviously, each .debug_srcinfo entry allows you to find the relevant filename,
-and it also points you to the first .line entry that was generated as a result
-of having compiled a given source line from the given source file.
-
-Each subsequent .line entry should also be assumed to have been produced
-as a result of compiling yet more lines from the same file. The end of
-any given LEC is easily found by looking at the first 4-byte pointer in
-the *next* .debug_srcinfo entry. That next .debug_srcinfo entry points
-to a new and different LEC, so the preceding LEC (implicitly) must have
-ended with the last .line section entry which occurs at the 2 1/2 words
-just before the address given in the first pointer of the new .debug_srcinfo
-entry.
-
-The following picture may help to clarify this feature. Let's assume that
-`LE' stands for `.line entry'. Also, assume that `* 'stands for a pointer.
-
-
- .line section .debug_srcinfo section .debug_sfnames section
- ----------------------------------------------------------------
-
- LE <---------------------- *
- LE * -----------------> "foobar.c" <---
- LE |
- LE |
- LE <---------------------- * |
- LE * -----------------> "foobar.h" <| |
- LE | |
- LE | |
- LE <---------------------- * | |
- LE * -----------------> "inner.h" | |
- LE | |
- LE <---------------------- * | |
- LE * ------------------------------- |
- LE |
- LE |
- LE |
- LE |
- LE <---------------------- * |
- LE * -----------------------------------
- LE
- LE
- LE
-
-In effect, each entry in the .debug_srcinfo section points to *both* a
-filename (in the .debug_sfnames section) and to the start of a block of
-consecutive LEs (in the .line section).
-
-Note that just like in the .line section, there are specialized first and
-last entries in the .debug_srcinfo section for each object file. These
-special first and last entries for the .debug_srcinfo section are very
-different from the normal .debug_srcinfo section entries. They provide
-additional information which may be helpful to a debugger when it is
-interpreting the data in the .debug_srcinfo, .debug_sfnames, and .line
-sections.
-
-The first entry in the .debug_srcinfo section for each compilation unit
-consists of five 4-byte words of data. The contents of these five words
-should be interpreted (by debuggers) as follows:
-
- (1) The starting address (relative to the entire .line section)
- of the .line section for this compilation unit.
-
- (2) The starting address (relative to the entire .debug_sfnames
- section) of the .debug_sfnames section for this compilation
- unit.
-
- (3) The starting address (in the execution virtual address space)
- of the .text section for this compilation unit.
-
- (4) The ending address plus one (in the execution virtual address
- space) of the .text section for this compilation unit.
-
- (5) The date/time (in seconds since midnight 1/1/70) at which the
- compilation of this compilation unit occurred. This value
- should be interpreted as an unsigned quantity because gcc
- might be configured to generate a default value of 0xffffffff
- in this field (in cases where it is desired to have object
- files created at different times from identical source files
- be byte-for-byte identical). By default, these timestamps
- are *not* generated by dwarfout.c (so that object files
- compiled at different times will be byte-for-byte identical).
- If you wish to enable this "timestamp" feature however, you
- can simply place a #define for the symbol `DWARF_TIMESTAMPS'
- in your target configuration file and then rebuild the GNU
- compiler(s).
-
-Note that the first string placed into the .debug_sfnames section for each
-compilation unit is the name of the directory in which compilation occurred.
-This string ends with a `/' (to help indicate that it is the pathname of a
-directory). Thus, the second word of each specialized initial .debug_srcinfo
-entry for each compilation unit may be used as a pointer to the (string)
-name of the compilation directory, and that string may in turn be used to
-"absolutize" any relative pathnames which may appear later on in the
-.debug_sfnames section entries for the same compilation unit.
-
-The fifth and last word of each specialized starting entry for a compilation
-unit in the .debug_srcinfo section may (depending upon your configuration)
-indicate the date/time of compilation, and this may be used (by a debugger)
-to determine if any of the source files which contributed code to this
-compilation unit are newer than the object code for the compilation unit
-itself. If so, the debugger may wish to print an "out-of-date" warning
-about the compilation unit.
-
-The .debug_srcinfo section associated with each compilation will also have
-a specialized terminating entry. This terminating .debug_srcinfo section
-entry will consist of the following two 4-byte words of data:
-
- (1) The offset, measured from the start of the .line section to
- the beginning of the terminating entry for the .line section.
-
- (2) A word containing the value 0xffffffff.
-
---------------------------------
-
-In the current DWARF version 1 specification, no mechanism is specified by
-which information about macro definitions and un-definitions may be provided
-to the DWARF consumer.
-
-The DWARF version 2 (draft) specification does specify such a mechanism.
-That specification was based on the GNU ("vendor specific extension")
-which provided some support for macro definitions and un-definitions,
-but the "official" DWARF version 2 (draft) specification mechanism for
-handling macros and the GNU implementation have diverged somewhat. I
-plan to update the GNU implementation to conform to the "official"
-DWARF version 2 (draft) specification as soon as I get time to do that.
-
-Note that in the GNU implementation, additional information about macro
-definitions and un-definitions is *only* provided when the -g3 level of
-debug-info production is selected. (The default level is -g2 and the
-plain old -g option is considered to be identical to -g2.)
-
-GCC records information about macro definitions and undefinitions primarily
-in a section called the .debug_macinfo section. Normal entries in the
-.debug_macinfo section consist of the following three parts:
-
- (1) A special "type" byte.
-
- (2) A 3-byte line-number/filename-offset field.
-
- (3) A NUL terminated string.
-
-The interpretation of the second and third parts is dependent upon the
-value of the leading (type) byte.
-
-The type byte may have one of four values depending upon the type of the
-.debug_macinfo entry which follows. The 1-byte MACINFO type codes presently
-used, and their meanings are as follows:
-
- MACINFO_start A base file or an include file starts here.
- MACINFO_resume The current base or include file ends here.
- MACINFO_define A #define directive occurs here.
- MACINFO_undef A #undef directive occur here.
-
-(Note that the MACINFO_... codes mentioned here are simply symbolic names
-for constants which are defined in the GNU dwarf.h file.)
-
-For MACINFO_define and MACINFO_undef entries, the second (3-byte) field
-contains the number of the source line (relative to the start of the current
-base source file or the current include files) when the #define or #undef
-directive appears. For a MACINFO_define entry, the following string field
-contains the name of the macro which is defined, followed by its definition.
-Note that the definition is always separated from the name of the macro
-by at least one whitespace character. For a MACINFO_undef entry, the
-string which follows the 3-byte line number field contains just the name
-of the macro which is being undef'ed.
-
-For a MACINFO_start entry, the 3-byte field following the type byte contains
-the offset, relative to the start of the .debug_sfnames section for the
-current compilation unit, of a string which names the new source file which
-is beginning its inclusion at this point. Following that 3-byte field,
-each MACINFO_start entry always contains a zero length NUL terminated
-string.
-
-For a MACINFO_resume entry, the 3-byte field following the type byte contains
-the line number WITHIN THE INCLUDING FILE at which the inclusion of the
-current file (whose inclusion ends here) was initiated. Following that
-3-byte field, each MACINFO_resume entry always contains a zero length NUL
-terminated string.
-
-Each set of .debug_macinfo entries for each compilation unit is terminated
-by a special .debug_macinfo entry consisting of a 4-byte zero value followed
-by a single NUL byte.
-
---------------------------------
-
-In the current DWARF draft specification, no provision is made for providing
-a separate level of (limited) debugging information necessary to support
-tracebacks (only) through fully-debugged code (e.g. code in system libraries).
-
-A proposal to define such a level was submitted (by me) to the UI/PLSIG.
-This proposal was rejected by the UI/PLSIG for inclusion into the DWARF
-version 1 specification for two reasons. First, it was felt (by the PLSIG)
-that the issues involved in supporting a "traceback only" subset of DWARF
-were not well understood. Second, and perhaps more importantly, the PLSIG
-is already having enough trouble agreeing on what it means to be "conforming"
-to the DWARF specification, and it was felt that trying to specify multiple
-different *levels* of conformance would only complicate our discussions of
-this already divisive issue. Nonetheless, the GNU implementation of DWARF
-provides an abbreviated "traceback only" level of debug-info production for
-use with fully-debugged "system library" code. This level should only be
-used for fully debugged system library code, and even then, it should only
-be used where there is a very strong need to conserve disk space. This
-abbreviated level of debug-info production can be used by specifying the
--g1 option on the compilation command line.
-
---------------------------------
-
-As mentioned above, the GNU implementation of DWARF currently uses the DWARF
-version 2 (draft) approach for inline functions (and inlined instances
-thereof). This is used in preference to the version 1 approach because
-(quite simply) the version 1 approach is highly brain-damaged and probably
-unworkable.
-
---------------------------------
-
-
-GNU DWARF Representation of GNU C Extensions to ANSI C
-------------------------------------------------------
-
-The file dwarfout.c has been designed and implemented so as to provide
-some reasonable DWARF representation for each and every declarative
-construct which is accepted by the GNU C compiler. Since the GNU C
-compiler accepts a superset of ANSI C, this means that there are some
-cases in which the DWARF information produced by GCC must take some
-liberties in improvising DWARF representations for declarations which
-are only valid in (extended) GNU C.
-
-In particular, GNU C provides at least three significant extensions to
-ANSI C when it comes to declarations. These are (1) inline functions,
-and (2) dynamic arrays, and (3) incomplete enum types. (See the GCC
-manual for more information on these GNU extensions to ANSI C.) When
-used, these GNU C extensions are represented (in the generated DWARF
-output of GCC) in the most natural and intuitively obvious ways.
-
-In the case of inline functions, the DWARF representation is exactly as
-called for in the DWARF version 2 (draft) specification for an identical
-function written in C++; i.e. we "reuse" the representation of inline
-functions which has been defined for C++ to support this GNU C extension.
-
-In the case of dynamic arrays, we use the most obvious representational
-mechanism available; i.e. an array type in which the upper bound of
-some dimension (usually the first and only dimension) is a variable
-rather than a constant. (See the DWARF version 1 specification for more
-details.)
-
-In the case of incomplete enum types, such types are represented simply
-as TAG_enumeration_type DIEs which DO NOT contain either AT_byte_size
-attributes or AT_element_list attributes.
-
---------------------------------
-
-
-Future Directions
------------------
-
-The codes, formats, and other paraphernalia necessary to provide proper
-support for symbolic debugging for the C++ language are still being worked
-on by the UI/PLSIG. The vast majority of the additions to DWARF which will
-be needed to completely support C++ have already been hashed out and agreed
-upon, but a few small issues (e.g. anonymous unions, access declarations)
-are still being discussed. Also, we in the PLSIG are still discussing
-whether or not we need to do anything special for C++ templates. (At this
-time it is not yet clear whether we even need to do anything special for
-these.)
-
-Unfortunately, as mentioned above, there are quite a few problems in the
-g++ front end itself, and these are currently responsible for severely
-restricting the progress which can be made on adding DWARF support
-specifically for the g++ front-end. Furthermore, Richard Stallman has
-expressed the view that C++ friendships might not be important enough to
-describe (in DWARF). This view directly conflicts with both the DWARF
-version 1 and version 2 (draft) specifications, so until this small
-misunderstanding is cleared up, DWARF support for g++ is unlikely.
-
-With regard to FORTRAN, the UI/PLSIG has defined what is believed to be a
-complete and sufficient set of codes and rules for adequately representing
-all of FORTRAN 77, and most of Fortran 90 in DWARF. While some support for
-this has been implemented in dwarfout.c, further implementation and testing
-will have to await the arrival of the GNU Fortran front-end (which is
-currently in early alpha test as of this writing).
-
-GNU DWARF support for other languages (i.e. Pascal and Modula) is a moot
-issue until there are GNU front-ends for these other languages.
-
-GNU DWARF support for DWARF version 2 will probably not be attempted until
-such time as the version 2 specification is finalized. (More work needs
-to be done on the version 2 specification to make the new "abbreviations"
-feature of version 2 more easily implementable. Until then, it will be
-a royal pain the ass to implement version 2 "abbreviations".) For the
-time being, version 2 features will be added (in a version 1 compatible
-manner) when and where these features seem necessary or extremely desirable.
-
-As currently defined, DWARF only describes a (binary) language which can
-be used to communicate symbolic debugging information from a compiler
-through an assembler and a linker, to a debugger. There is no clear
-specification of what processing should be (or must be) done by the
-assembler and/or the linker. Fortunately, the role of the assembler
-is easily inferred (by anyone knowledgeable about assemblers) just by
-looking at examples of assembly-level DWARF code. Sadly though, the
-allowable (or required) processing steps performed by a linker are
-harder to infer and (perhaps) even harder to agree upon. There are
-several forms of very useful `post-processing' steps which intelligent
-linkers *could* (in theory) perform on object files containing DWARF,
-but any and all such link-time transformations are currently both disallowed
-and unspecified.
-
-In particular, possible link-time transformations of DWARF code which could
-provide significant benefits include (but are not limited to):
-
- Commonization of duplicate DIEs obtained from multiple input
- (object) files.
-
- Cross-compilation type checking based upon DWARF type information
- for objects and functions.
-
- Other possible `compacting' transformations designed to save disk
- space and to reduce linker & debugger I/O activity.
diff --git a/gcc/README.RS6000 b/gcc/README.RS6000
deleted file mode 100644
index 24cc8ba8e72..00000000000
--- a/gcc/README.RS6000
+++ /dev/null
@@ -1,148 +0,0 @@
- AIX 4.3 archive libraries
-
-AIX 4.3 utilizes a new "large format" archive to support both 32-bit and
-64-bit object modules. The routines provided in AIX 4.3.0 and AIX 4.3.1
-to parse archive libraries did not handle the new format correctly. These
-routines are used by GCC and result in error messages during linking such
-as "not a COFF file". The version of the routines shipped with AIX 4.3.1
-should work for a 32-bit environment. The "-g" option of the archive
-command may be used to create archives of 32-bit objects using the
-original "small format". A correct version of the routines is shipped
-with AIX 4.3.2.
-
-
- AIX 4.3.2 binder
-
-The AIX 4.3.2.1 linker (bos.rte.bind_cmds Level 4.3.2.1) will dump core
-with a segmentation fault when invoked by any version of GCC. A fix for
-APAR IX87327 will be available from IBM Customer Support.
-
-
- AIX 4.3.0 assembler
-
-The AIX 4.3.0.0 assembler generates incorrect object files if the ".bs"
-pseudo-op references symbols in certain sections. If GCC is invoked with
-the -g debugging option (including during bootstrapping), incorrect object
-files will be produced and the AIX linker will fail with a severe error.
-A fix for APAR IX74254 (64BIT DISASSEMBLED OUPUT FROM COMPILER FAILS TO
-ASSEMBLE/BIND) is available from IBM Customer Support and from its
-service.boulder.ibm.com website as PTF U453956.
-
-
- AIX 4.1 binder
-
-Some versions of the AIX binder (linker) can fail with a relocation
-overflow severe error when the -bbigtoc option is used to link
-GCC-produced object files into an executable that overflows the TOC.
-Linking f771, the GNU Fortran backend, will fail in this manner. A fix
-for APAR IX75823 (OVERFLOW DURING LINK WHEN USING GCC AND -BBIGTOC) is
-available from IBM Customer Support and from its website as PTF U455193.
-
-Due to changes in the way that GCC invokes the binder (linker) for AIX 4.1,
-the link step now may produce warnings of duplicate symbols which were not
-reported before. The assembly files generated by GCC for AIX always have
-included multiple symbol definitions for certain global variable and
-function declarations in the original program. The warnings should not
-prevent the linker from producing a correct library or runnable executable.
-
-
- AIX NLS problems
-
-AIX on the RS/6000 provides support (NLS) for environments outside of
-the United States. Compilers and assemblers use NLS to support
-locale-specific representations of various objects including
-floating-point numbers ("." vs "," for separating decimal fractions).
-There have been problems reported where the library linked with GCC does
-not produce the same floating-point formats that the assembler accepts.
-If you have this problem, set the LANG environment variable to "C" or
-"En_US".
-
-
- AIX 3.2.5 XLC-1.3 problems
-
-XLC version 1.3.0.0 distributed with AIX 3.2.5 will miscompile jump.c when
-building the stage1 compiler during the bootstrap process. This will cause
-GCC to crash and the bootstrap to fail later while compiling libgcc2.c. XLC
-version 1.3.0.1 or later fixes this problem. XLC-1.3.0.19 also cannot
-bootstrap GCC so please avoid that release as well. You can obtain
-XLC-1.3.0.24 by requesting PTF 432238 from IBM, or just ask for the latest
-release of XLC-1.3.
-
-There also have been reports of problems bootstrapping GCC with some older
-releases of xlc-1.2.1, including xlc-1.2.1.8. Newer releases of xlc-1.2.1
-do not exhibit this problem: xlc-1.2.1.28 is known to bootstrap properly.
-
-
- AIX 3.2 common-mode support
-
-AIX common-mode providing transparent support of both the POWER and PowerPC
-architectures is usable in AIX 3.2.3 and above but an export file and
-support for hidden export via libc.a will not exist until AIX 4.1. libgcc.a
-also must be compiled in common-mode. Note that executables generated for
-the POWER (RIOS1 and RSC) architecture will run directly on systems using
-the MPC601 chip. Common-mode only improves the performance of a single
-executable run on both POWER and PowerPC architecture platforms by not using
-POWER- or PowerPC-specific instructions and eliminating the need to trap to
-emulation (for POWER instructions run on PowerPC).
-
-To link a common-mode application prior to AIX 4.1 and run it on a system at
-AIX level 3.2.3 or above, use the text between the "<>" as an export file
-(e.g. milli.exp)
-
-<><><><><><><><><><><>
-#!
-__mulh 0x3100
-__mull 0x3180
-__divss 0x3200
-__divus 0x3280
-__quoss 0x3300
-__quous 0x3380
-<><><><><><><><><><><>
-
-and then link with -Wl,-bI:milli.exp.
-
-
- AIX 3.1 and 3.2 assembler problems
-
-Specifying the -g flag to GCC on the RS/6000 requires upgrading the
-standard AIX assembler distributed with AIX 3.1 and versions of AIX
-3.2 earlier than 3.2.4 with a replacement that is available from IBM.
-Note that Makefile.in specifies the -g when compiling libgcc2.c.
-
-You can test for the presence of a fixed assembler by entering the following:
- % as -u < /dev/null
-If the command exits normally, the assembler fix already is installed.
-If the assembler complains that "-u" is an unknown flag, you need to order
-the fix.
-
-If you are running AIX 3.1 (lslpp -h bos.obj output reports
-03.01.0005.XXXX where the 0005 can be any higher number and the XXXX
-can be any value), call IBM Support at 800-237-5511 and ask for
-shipment of AIX/6000 fix PTF U403044 for APAR IX22829 (.extern foo
-conflicts with defining foo).
-
-If you are running AIX 3.2 but not 3.2.4 or later (lslpp -h bos.obj
-output reports 03.02.0000.0000), a newer update to the assembler fix
-is available. Ask for shipment of AIX/6000 fix PTF U416277 for
-IX32992 (.global prevents detection of duplicate symbol).
-
-If you are running AIX 3.2.4 or later, you already have the new
-assembler.
-
-Any customer can order and get the replacement assembler, and install it on
-one or more machines. It is available on diskette from IBM Customer Support
-and from its website.
-
-If you contact IBM Customer Support, they may also ask you for your customer
-number. If you do not know it, you will still be able to get the fix, but
-you will have to be persistent. IBM has corresponding support organizations
-outside of North America. Call your IBM branch office and ask them to put
-you in touch with the department that handles fixes for AIX/6000. If that
-doesn't work, ask for the department that handles software defect support
-for AIX/6000 and ask for the APAR fix.
-
-If you use the GNU assembler instead of the system supplied assembler, you need
-an assembler modified after October 16th, 1995 in order to build the GNU C
-compiler. This is because the GNU C compiler wants to build a variant of its
-library, libgcc.a with the -mcpu=common switch to support building programs
-that can run on either the Power or PowerPC machines.
diff --git a/gcc/README.X11 b/gcc/README.X11
deleted file mode 100644
index aa68854b04d..00000000000
--- a/gcc/README.X11
+++ /dev/null
@@ -1,447 +0,0 @@
-[This file contains two alternative recipes for compiling X11 with GCC.
-The first alternative puts libgcc.a into the shared X library; the second
-does not. Neither alternative works on all kinds of systems.
-It may be that when using GCC 2.4, both alternatives work okay on
-relatively recent Sparc systems. The first alternative is likely
-not to work on a Sun 3 without hardware floating point.]
-
-How to compile X11R5 (patch level 11) with GCC version 2:
-
-The patches include support for building the shared libraries with GCC
-2 on the Sparc and 68k machines. This version includes the necessary
-parts of libgcc.a in the shared library for X, in case functions in
-that library need it. Thus the default behavior is now to build
-everything, including the libraries, with gcc.
-
-If you build the shared library this way, it may not work with
-executables made with older versions of GCC (2.3.3 and earlier).
-If that happens, relink those executables with the latest GCC.
-IF YOU THINK YOU MIGHT COMPILE X FOR SOLARIS 2, then you really don't
-need this patch: get /contrib/R5.SunOS5.patch.tar.Z from
-export.lcs.mit.edu instead. It has everything you need to do the
-build for Solaris 2, sets you up to everything with GCC, and is
-backward compatible with SunOS 4.*. Get the README
-(/contrib/R5.SunOS5.patch.README at export) for more info.
-
-If you see undefined symbols _dlopen, _dlsym, or _dlclose when linking
-with -lX11, compile and link against the file mit/util/misc/dlsym.c in
-the MIT X11R5 distribution. Alternatively, do dynamic linking
-by using a non-GNU ld.
-
-mit/config/Imake.tmpl -- Do not set -fstrength-reduce if we have GCC 2.
-If -fstrength-reduce (or any other -f option) is a major win, then it
-will most likely be turned on by -O2 optimization.
-
-mit/config/sunLib.rules -- If HasGcc and GccVersion > 1 are true, then
-use gcc -fpic to generate PIC code. Make sure that gcc does not use
-gas (the GNU assembler) when compiling PIC code; gas does not assemble
-it correctly.
-
-***If you have gas installed where gcc uses it by default, you might have
-to add -B/bin/ to the PositionIndependentCFlags.***
-
-mit/config/site.def -- Define GccVersion to be 2.
-
-mit/config/sun.cf -- When compiling with GCC 2, use -O2 optimization.
-
-mit/config/sunLib.rules -- When compiling with GCC 2, use -fpic for
-position independent code generation.
-
-mit/rgb/Imakefile -- No longer need to compile some modules with
-cc on the Sparc since GCC 2 produces proper -fpcc-struct-return code.
-
-mit/server/os/Imakefile -- Likewise.
-
-mit/server/ddx/sun/Imakefile -- When compiling with GCC 2, some modules
-should be compiled with -fvolatile.
-
-mit/clients/twm/Imakefile -- Fix bad decls of malloc, realloc in gram.c.
-
-mit/lib/X/Imakefile -- Make libgcc.a a required lib for libX11.so
-
-*** mit/clients/twm/Imakefile Mon May 17 22:05:22 1993
---- new/clients/twm/Imakefile Mon May 17 22:28:46 1993
-***************
-*** 32,41 ****
---- 32,48 ----
- ComplexProgramTarget(twm)
- InstallNonExecFile(system.twmrc,$(TWMDIR))
-
-+ #if HasGcc && GccVersion > 1 && defined (SunArchitecture)
- gram.h gram.c: gram.y
- yacc $(YFLAGS) gram.y
-+ sed -e 's/^extern char \*malloc(), \*realloc();//g' y.tab.c >gram.c
-+ $(MV) y.tab.h gram.h
-+ #else
-+ gram.h gram.c: gram.y
-+ yacc $(YFLAGS) gram.y
- $(MV) y.tab.c gram.c
- $(MV) y.tab.h gram.h
-+ #endif
-
- clean::
- $(RM) y.tab.h y.tab.c lex.yy.c gram.h gram.c lex.c deftwmrc.c
-*** mit/config/Imake.tmpl Mon May 17 22:02:57 1993
---- new/config/Imake.tmpl Mon May 17 22:15:06 1993
-***************
-*** 500,506 ****
---- 500,510 ----
- #endif
- #ifndef CcCmd
- #if HasGcc
-+ #if GccVersion > 1
-+ #define CcCmd gcc -fpcc-struct-return
-+ #else
- #define CcCmd gcc -fstrength-reduce -fpcc-struct-return
-+ #endif
- #else
- #define CcCmd cc
- #endif
-*** mit/config/site.def Mon May 17 22:02:44 1993
---- new/config/site.def Mon May 17 22:22:28 1993
-***************
-*** 25,31 ****
-
- #ifdef BeforeVendorCF
-
-! /* #define HasGcc YES */
-
- #endif /* BeforeVendorCF */
-
---- 25,33 ----
-
- #ifdef BeforeVendorCF
-
-! #define HasGcc YES
-! /* GccVersion > 1 implies building shared libraries with gcc */
-! #define GccVersion 2
-
- #endif /* BeforeVendorCF */
-
-*** mit/config/sun.cf Mon May 17 22:03:02 1993
---- new/config/sun.cf Mon May 17 22:24:55 1993
-***************
-*** 41,49 ****
---- 41,55 ----
-
- #if HasGcc
-
-+ #if GccVersion > 1
-+ #define OptimizedCDebugFlags -O2
-+ #else
-+ #define OptimizedCDebugFlags -O
- #define SharedLibraryCcCmd cc
- #define ExtraLoadFlags -B/usr/bin/
- #define AllocateLocalDefines /**/
-+ #endif
-+
-
- .c.o:
- $(CC) -c $(CFLAGS) $*.c
-*** mit/config/sunLib.rules Mon May 17 22:02:46 1993
---- new/config/sunLib.rules Mon May 17 22:19:06 1993
-***************
-*** 23,29 ****
---- 23,33 ----
- #define SharedLibraryLoadFlags -assert pure-text
- #endif
- #ifndef PositionIndependentCFlags
-+ #if defined(HasGcc) && GccVersion > 1
-+ #define PositionIndependentCFlags -fpic
-+ #else
- #define PositionIndependentCFlags -pic
-+ #endif
- #endif
-
- /*
-*** mit/lib/X/Imakefile Mon May 17 22:05:03 1993
---- new/lib/X/Imakefile Mon May 17 22:32:26 1993
-***************
-*** 9,14 ****
---- 9,31 ----
- #define MotifBC NO
- #endif
-
-+ #if defined(SunArchitecture)
-+ #if SystemV4
-+ #if HasGcc
-+ REQUIREDLIBS= -lgcc -lc
-+ #else
-+ REQUIREDLIBS= -lc
-+ #endif
-+ #else
-+ #if HasGcc && GccVersion > 1
-+ XCOMM Hack to fix gcc 2 ``-nostdlib'' deficiency on SunOS 4.x
-+ REQUIREDLIBS= `gcc -v 2>&1 | awk '{print $$4}' | sed -e 's/specs$$/libgcc.a/'`
-+ #else
-+ REQUIREDLIBS=
-+ #endif
-+ #endif
-+ #endif
-+
- #ifndef BuildXimp
- #define BuildXimp NO
- #endif
-*** mit/rgb/Imakefile Mon May 17 22:05:31 1993
---- new/rgb/Imakefile Mon May 17 22:25:30 1993
-***************
-*** 17,23 ****
- #if !(defined(SGIArchitecture) || SystemV4)
- DBMLIB = -ldbm
- #endif
-! #if defined(SparcArchitecture) && HasGcc
- CC = cc
- CCOPTIONS = /**/
- EXTRA_LOAD_FLAGS = /**/
---- 17,23 ----
- #if !(defined(SGIArchitecture) || SystemV4)
- DBMLIB = -ldbm
- #endif
-! #if defined(SparcArchitecture) && HasGcc && GccVersion <= 1
- CC = cc
- CCOPTIONS = /**/
- EXTRA_LOAD_FLAGS = /**/
-*** mit/server/ddx/sun/Imakefile Mon May 17 22:05:57 1993
---- new/server/ddx/sun/Imakefile Mon May 17 22:27:23 1993
-***************
-*** 43,48 ****
---- 43,53 ----
- LinkFile(sunGX.o,sunGX.o.dist)
- #endif
-
-+ #if HasGcc && GccVersion > 1
-+ SpecialObjectRule(sunCG2C.o,sunCG2C.c,-fvolatile)
-+ SpecialObjectRule(sunCG2M.o,sunCG2M.c,-fvolatile)
-+ #endif
-+
- sunInitExtMono.o: $(ICONFIGFILES)
- ObjectFromSpecialSource(sunInitExtMono,../mi/miinitext,-UPEXEXT)
- ObjectFromSpecialSource(sunInitMono,sunInit,-DMONO_ONLY)
-*** mit/server/os/Imakefile Mon May 17 22:05:46 1993
---- new/server/os/Imakefile Mon May 17 22:26:02 1993
-***************
-*** 132,138 ****
- SpecialObjectRule(osinit.o,$(ICONFIGFILES),$(ADM_DEFINES))
- SpecialObjectRule(WaitFor.o,$(ICONFIGFILES),$(EXT_DEFINES))
- SpecialObjectRule(fonttype.o,$(ICONFIGFILES),$(FONT_DEFINES))
-! #if defined(SparcArchitecture) && HasGcc
- oscolor.o: $(ICONFIGFILES)
- $(RM) $@
- cc -c $(DBM_DEFINES) $(CDEBUGFLAGS) $(ALLDEFINES) $*.c
---- 132,138 ----
- SpecialObjectRule(osinit.o,$(ICONFIGFILES),$(ADM_DEFINES))
- SpecialObjectRule(WaitFor.o,$(ICONFIGFILES),$(EXT_DEFINES))
- SpecialObjectRule(fonttype.o,$(ICONFIGFILES),$(FONT_DEFINES))
-! #if defined(SparcArchitecture) && HasGcc && GccVersion <= 1
- oscolor.o: $(ICONFIGFILES)
- $(RM) $@
- cc -c $(DBM_DEFINES) $(CDEBUGFLAGS) $(ALLDEFINES) $*.c
-
-
-[This is the older version]
-
-How to compile X11R5 (patch level 11) with GCC version 2:
-
-The patches include support for building the shared libraries with GCC 2 on
-the Sparc and 68k machines.
-
-NOTE: Such shared libraries built with GCC version 2.3 DID NOT WORK
-with executables previously linked using Sun CC! This is because
-neither those executables nor the gcc-compiled shared libraries contain
-libgcc.a. The shared libraries did work with executables linked using
-GCC (running the Sun linker, of course) because GCC tells the linker to
-link in libgcc.a. Because of these limitations the default behavior is
-to NOT build the shared libraries with gcc.
-
-Changes in GCC 2.4 seem to have eliminated the problem, and such a
-shared library now seems work with all executables. If you want the
-gcc-compiled shared libraries turn on "Gcc2BuildLibs" in site.def. If
-you try this, please tell bug-gcc@prep.ai.mit.edu whether it works.
-
-Sun forgot to include a static version of libdl.a with some versions
-of SunOS (4.1 mainly). If you see undefined symbols _dlopen, _dlsym,
-or _dlclose when linking with -lX11, compile and link against the file
-mit/util/misc/dlsym.c in the MIT X11R5 distribution.
-
-mit/config/Imake.tmpl -- Do not set -fstrength-reduce if we have GCC 2. If
--fstrength-reduce (or any other -f option) is a major win, then it will
-most likely be turned on by -O2 optimization.
-
-mit/config/sunLib.rules -- If HasGcc2 and Gcc2BuildLibs are defined, then
-use gcc -fpic to generate PIC code. Make sure that gcc does not use gas (the
-GNU assembler) when compiling PIC code; gas does not assemble it correctly.
-If you have gas installed where gcc uses it by default, you might have to add
--B/bin/ to the PositionIndependentCFlags.
-
-mit/config/site.def -- Define HasGcc2 to be YES.
-
-mit/config/sun.cf -- When compiling with GCC 2, use -O2 optimization.
-
-mit/rgb/Imakefile -- No longer need to compile some modules with
-cc on the Sparc since GCC 2 produces proper -fpcc-struct-return code.
-
-mit/server/os/Imakefile -- Likewise.
-
-mit/clients/twm/Imakefile -- fix bad decls of malloc, realloc in gram.c.
-
-*** mit/config/Imake.tmpl.ORIG Tue Dec 31 11:07:56 1991
---- mit/config/Imake.tmpl Tue Dec 31 12:30:47 1991
-***************
-*** 499,508 ****
---- 499,512 ----
- #define HasGcc NO
- #endif
- #ifndef CcCmd
-+ #if HasGcc2
-+ #define CcCmd gcc -fpcc-struct-return
-+ #else
- #if HasGcc
- #define CcCmd gcc -fstrength-reduce -fpcc-struct-return
- #else
- #define CcCmd cc
-+ #endif
- #endif
- #endif
- #if HasFortran
-*** mit/config/sunLib.rules.ORIG Tue Dec 31 11:11:24 1991
---- mit/config/sunLib.rules Tue May 5 12:26:12 1992
-***************
-*** 23,30 ****
---- 23,34 ----
- #define SharedLibraryLoadFlags -assert pure-text
- #endif
- #ifndef PositionIndependentCFlags
-+ #if defined(HasGcc2) && defined (Gcc2BuildLibs)
-+ #define PositionIndependentCFlags -fpic
-+ #else
- #define PositionIndependentCFlags -pic
- #endif
-+ #endif
-
- /*
- * InstallSharedLibrary - generate rules to install the shared library.
-*** mit/config/site.def.ORIG Tue Dec 31 11:13:49 1991
---- mit/config/site.def Tue Dec 31 12:02:59 1991
-***************
-*** 25,31 ****
-
- #ifdef BeforeVendorCF
-
-! /* #define HasGcc YES */
-
- #endif /* BeforeVendorCF */
-
---- 25,33 ----
-
- #ifdef BeforeVendorCF
-
-! #define HasGcc YES
-! #define HasGcc2 YES
-! /* #define Gcc2BuildLibs YES */
-
- #endif /* BeforeVendorCF */
-
-*** mit/config/sun.cf.ORIG Tue Dec 31 11:13:57 1991
---- mit/config/sun.cf Tue May 5 12:29:50 1992
-***************
-*** 34,42 ****
---- 41,61 ----
-
- #if HasGcc
-
-+ #if defined(HasGcc2)
-+ #define OptimizedCDebugFlags -O2
-+ /* Leave Alone XXX */
-+ #else
-+ #define OptimizedCDebugFlags -O
- #define SharedLibraryCcCmd cc
- #define ExtraLoadFlags -B/usr/bin/
- #define AllocateLocalDefines /**/
-+ #endif
-+
-+ #if !defined(Gcc2BuildLibs)
-+ #define SharedLibraryCcCmd cc
-+ #define ExtraLoadFlags -B/usr/bin/
-+ #define AllocateLocalDefines /**/
-+ #endif
-
- .c.o:
- $(CC) -c $(CFLAGS) $*.c
-*** mit/rgb/Imakefile.ORIG Wed Jan 15 16:43:18 1992
---- mit/rgb/Imakefile Thu Jan 2 13:34:09 1992
-***************
-*** 17,23 ****
- #if !(defined(SGIArchitecture) || SystemV4)
- DBMLIB = -ldbm
- #endif
-! #if defined(SparcArchitecture) && HasGcc
- CC = cc
- CCOPTIONS = /**/
- EXTRA_LOAD_FLAGS = /**/
---- 17,23 ----
- #if !(defined(SGIArchitecture) || SystemV4)
- DBMLIB = -ldbm
- #endif
-! #if defined(SparcArchitecture) && HasGcc && !defined(HasGcc2)
- CC = cc
- CCOPTIONS = /**/
- EXTRA_LOAD_FLAGS = /**/
-*** mit/server/os/Imakefile.ORIG Wed Jan 15 16:46:23 1992
---- mit/server/os/Imakefile Wed Jan 15 16:46:48 1992
-***************
-*** 132,138 ****
- SpecialObjectRule(osinit.o,$(ICONFIGFILES),$(ADM_DEFINES))
- SpecialObjectRule(WaitFor.o,$(ICONFIGFILES),$(EXT_DEFINES))
- SpecialObjectRule(fonttype.o,$(ICONFIGFILES),$(FONT_DEFINES))
-! #if defined(SparcArchitecture) && HasGcc
- oscolor.o: $(ICONFIGFILES)
- $(RM) $@
- cc -c $(DBM_DEFINES) $(CDEBUGFLAGS) $(ALLDEFINES) $*.c
---- 132,138 ----
- SpecialObjectRule(osinit.o,$(ICONFIGFILES),$(ADM_DEFINES))
- SpecialObjectRule(WaitFor.o,$(ICONFIGFILES),$(EXT_DEFINES))
- SpecialObjectRule(fonttype.o,$(ICONFIGFILES),$(FONT_DEFINES))
-! #if defined(SparcArchitecture) && HasGcc && !defined(HasGcc2)
- oscolor.o: $(ICONFIGFILES)
- $(RM) $@
- cc -c $(DBM_DEFINES) $(CDEBUGFLAGS) $(ALLDEFINES) $*.c
-*** 1.1 1992/09/08 19:52:07
---- mit/server/ddx/sun/Imakefile 1992/09/08 21:10:22
-***************
-*** 43,48 ****
---- 43,53 ----
- LinkFile(sunGX.o,sunGX.o.dist)
- #endif
-
-+ #if HasGcc2
-+ SpecialObjectRule(sunCG2C.o,sunCG2C.c,-fvolatile)
-+ SpecialObjectRule(sunCG2M.o,sunCG2M.c,-fvolatile)
-+ #endif
-+
- sunInitExtMono.o: $(ICONFIGFILES)
- ObjectFromSpecialSource(sunInitExtMono,../mi/miinitext,-UPEXEXT)
- ObjectFromSpecialSource(sunInitMono,sunInit,-DMONO_ONLY)
-
-*** /tmp/RCSAa24446 Tue Sep 15 12:23:32 1992
---- mit/clients/twm/Imakefile Thu Aug 13 18:18:07 1992
-***************
-*** 32,41 ****
---- 32,48 ----
- ComplexProgramTarget(twm)
- InstallNonExecFile(system.twmrc,$(TWMDIR))
-
-+ #if HasGcc2 && defined (SunArchitecture)
- gram.h gram.c: gram.y
- yacc $(YFLAGS) gram.y
-+ sed -e 's/^extern char \*malloc(), \*realloc();//g' y.tab.c >gram.c
-+ $(MV) y.tab.h gram.h
-+ #else
-+ gram.h gram.c: gram.y
-+ yacc $(YFLAGS) gram.y
- $(MV) y.tab.c gram.c
- $(MV) y.tab.h gram.h
-+ #endif
-
- clean::
- $(RM) y.tab.h y.tab.c lex.yy.c gram.h gram.c lex.c deftwmrc.c
-
diff --git a/gcc/acconfig.h b/gcc/acconfig.h
index dec619b84b0..17324b57611 100644
--- a/gcc/acconfig.h
+++ b/gcc/acconfig.h
@@ -26,6 +26,9 @@
/* Define to `int' if <sys/types.h> doesn't define. */
#undef ssize_t
+/* Define if cpp should also search $prefix/include. */
+#undef PREFIX_INCLUDE_DIR
+
@BOTTOM@
/* Bison unconditionally undefines `const' if neither `__STDC__' nor
diff --git a/gcc/aclocal.m4 b/gcc/aclocal.m4
index 8c8efd84b84..b9089423fa4 100644
--- a/gcc/aclocal.m4
+++ b/gcc/aclocal.m4
@@ -1,4 +1,17 @@
-Fdnl See whether we can include both string.h and strings.h.
+dnl See if stdbool.h properly defines bool and true/false.
+AC_DEFUN(gcc_AC_HEADER_STDBOOL,
+[AC_CACHE_CHECK([for working stdbool.h],
+ ac_cv_header_stdbool_h,
+[AC_TRY_COMPILE([#include <stdbool.h>],
+[bool foo = false;],
+ac_cv_header_stdbool_h=yes, ac_cv_header_stdbool_h=no)])
+if test $ac_cv_header_stdbool_h = yes; then
+ AC_DEFINE(HAVE_STDBOOL_H, 1,
+ [Define if you have a working <stdbool.h> header file.])
+fi
+])
+
+dnl See whether we can include both string.h and strings.h.
AC_DEFUN(gcc_AC_HEADER_STRING,
[AC_CACHE_CHECK([whether string.h and strings.h may both be included],
gcc_cv_header_string,
@@ -42,14 +55,23 @@ changequote([, ])dnl
gcc_AC_CHECK_DECL($ac_func,
[AC_DEFINE_UNQUOTED($ac_tr_decl, 1) $2],
[AC_DEFINE_UNQUOTED($ac_tr_decl, 0) $3],
+dnl It is possible that the include files passed in here are local headers
+dnl which supply a backup declaration for the relevant prototype based on
+dnl the definition of (or lack of) the HAVE_DECL_ macro. If so, this test
+dnl will always return success. E.g. see libiberty.h's handling of
+dnl `basename'. To avoid this, we define the relevant HAVE_DECL_ macro to
+dnl 1 so that any local headers used do not provide their own prototype
+dnl during this test.
+#undef $ac_tr_decl
+#define $ac_tr_decl 1
$4
)
done
dnl Automatically generate config.h entries via autoheader.
if test x = y ; then
patsubst(translit([$1], [a-z], [A-Z]), [\w+],
- AC_DEFINE([HAVE_DECL_\&], 1,
- [Define to 1 if we found this declaration otherwise define to 0.]))dnl
+ [AC_DEFINE([HAVE_DECL_\&], 1,
+ [Define to 1 if we found this declaration otherwise define to 0.])])dnl
fi
])
@@ -184,7 +206,20 @@ 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)
+ 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,
+[AC_TRY_COMPILE(,
+[_Bool foo;],
+gcc_cv_c__bool=yes, gcc_cv_c__bool=no)
+])
+if test $gcc_cv_c__bool = yes; then
+ AC_DEFINE(HAVE__BOOL, 1, [Define if the \`_Bool' type is built-in.])
fi
])
@@ -1102,7 +1137,9 @@ if test -n "[$]$1"; then
[changequote(<<,>>)dnl
ac_prog_version=`<<$>>$1 $3 2>&1 |
sed -n 's/^.*patsubst(<<$4>>,/,\/).*$/\1/p'`
+changequote([,])dnl
echo "configure:__oline__: version of $2 is $ac_prog_version" >&AC_FD_CC
+changequote(<<,>>)dnl
case $ac_prog_version in
'') gcc_cv_prog_$2_modern=no;;
<<$5>>)
@@ -1115,3 +1152,74 @@ else
gcc_cv_prog_$2_modern=no
fi
])
+
+#serial AM2
+
+dnl From Bruno Haible.
+
+AC_DEFUN([AM_ICONV],
+[
+ dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
+ dnl those with the standalone portable GNU libiconv installed).
+
+ am_cv_lib_iconv_ldpath=
+ AC_ARG_WITH([libiconv-prefix],
+[ --with-libiconv-prefix=DIR search for libiconv in DIR/include and DIR/lib], [
+ for dir in `echo "$withval" | tr : ' '`; do
+ if test -d $dir/include; then CPPFLAGS="$CPPFLAGS -I$dir/include"; fi
+ if test -d $dir/lib; then am_cv_lib_iconv_ldpath="-L$dir/lib"; fi
+ done
+ ])
+
+ AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
+ am_cv_func_iconv="no, consider installing GNU libiconv"
+ am_cv_lib_iconv=no
+ AC_TRY_LINK([#include <stdlib.h>
+#include <iconv.h>],
+ [iconv_t cd = iconv_open("","");
+ iconv(cd,NULL,NULL,NULL,NULL);
+ iconv_close(cd);],
+ am_cv_func_iconv=yes)
+ if test "$am_cv_func_iconv" != yes; then
+ am_save_LIBS="$LIBS"
+ LIBS="$LIBS $am_cv_libiconv_ldpath -liconv"
+ AC_TRY_LINK([#include <stdlib.h>
+#include <iconv.h>],
+ [iconv_t cd = iconv_open("","");
+ iconv(cd,NULL,NULL,NULL,NULL);
+ iconv_close(cd);],
+ am_cv_lib_iconv=yes
+ am_cv_func_iconv=yes)
+ LIBS="$am_save_LIBS"
+ fi
+ ])
+ if test "$am_cv_func_iconv" = yes; then
+ AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
+ AC_MSG_CHECKING([for iconv declaration])
+ AC_CACHE_VAL(am_cv_proto_iconv, [
+ AC_TRY_COMPILE([
+#include <stdlib.h>
+#include <iconv.h>
+extern
+#ifdef __cplusplus
+"C"
+#endif
+#if defined(__STDC__) || defined(__cplusplus)
+size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
+#else
+size_t iconv();
+#endif
+], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
+ am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"])
+ am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
+ AC_MSG_RESULT([$]{ac_t:-
+ }[$]am_cv_proto_iconv)
+ AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
+ [Define as const if the declaration of iconv() needs const.])
+ fi
+ LIBICONV=
+ if test "$am_cv_lib_iconv" = yes; then
+ LIBICONV="$am_cv_lib_iconv_ldpath -liconv"
+ fi
+ AC_SUBST(LIBICONV)
+])
diff --git a/gcc/alias.c b/gcc/alias.c
index 85bce38c70f..060d1a5e076 100644
--- a/gcc/alias.c
+++ b/gcc/alias.c
@@ -25,7 +25,6 @@ Boston, MA 02111-1307, USA. */
#include "tree.h"
#include "tm_p.h"
#include "function.h"
-#include "insn-flags.h"
#include "expr.h"
#include "regs.h"
#include "hard-reg-set.h"
@@ -95,6 +94,8 @@ static void record_set PARAMS ((rtx, rtx, void *));
static rtx find_base_term PARAMS ((rtx));
static int base_alias_check PARAMS ((rtx, rtx, enum machine_mode,
enum machine_mode));
+static int handled_component_p PARAMS ((tree));
+static int can_address_p PARAMS ((tree));
static rtx find_base_value PARAMS ((rtx));
static int mems_in_disjoint_alias_sets_p PARAMS ((rtx, rtx));
static int insert_subset_children PARAMS ((splay_tree_node, void*));
@@ -309,6 +310,12 @@ int
objects_must_conflict_p (t1, t2)
tree t1, t2;
{
+ /* If neither has a type specified, we don't know if they'll conflict
+ because we may be using them to store objects of various types, for
+ example the argument and local variables areas of inlined functions. */
+ if (t1 == 0 && t2 == 0)
+ return 0;
+
/* If one or the other has readonly fields or is readonly,
then they may not conflict. */
if ((t1 != 0 && readonly_fields_p (t1))
@@ -394,6 +401,58 @@ find_base_decl (t)
}
}
+/* Return 1 if T is an expression that get_inner_reference handles. */
+
+static int
+handled_component_p (t)
+ tree t;
+{
+ switch (TREE_CODE (t))
+ {
+ case BIT_FIELD_REF:
+ case COMPONENT_REF:
+ case ARRAY_REF:
+ case NON_LVALUE_EXPR:
+ return 1;
+
+ case NOP_EXPR:
+ case CONVERT_EXPR:
+ return (TYPE_MODE (TREE_TYPE (t))
+ == TYPE_MODE (TREE_TYPE (TREE_OPERAND (t, 0))));
+
+ default:
+ return 0;
+ }
+}
+
+/* Return 1 if all the nested component references handled by
+ get_inner_reference in T are such that we can address the object in T. */
+
+static int
+can_address_p (t)
+ tree t;
+{
+ /* If we're at the end, it is vacuously addressable. */
+ if (! handled_component_p (t))
+ return 1;
+
+ /* Bitfields are never addressable. */
+ else if (TREE_CODE (t) == BIT_FIELD_REF)
+ return 0;
+
+ else if (TREE_CODE (t) == COMPONENT_REF
+ && ! DECL_NONADDRESSABLE_P (TREE_OPERAND (t, 1))
+ && can_address_p (TREE_OPERAND (t, 0)))
+ return 1;
+
+ else if (TREE_CODE (t) == ARRAY_REF
+ && ! TYPE_NONALIASED_COMPONENT (TREE_TYPE (TREE_OPERAND (t, 0)))
+ && can_address_p (TREE_OPERAND (t, 0)))
+ return 1;
+
+ return 0;
+}
+
/* Return the alias set for T, which may be either a type or an
expression. Call language-specific routine for help, if needed. */
@@ -433,35 +492,9 @@ get_alias_set (t)
/* Now loop the same way as get_inner_reference and get the alias
set to use. Pick up the outermost object that we could have
a pointer to. */
- while (1)
- {
- /* Unnamed bitfields are not an addressable object. */
- if (TREE_CODE (t) == BIT_FIELD_REF)
- ;
- else if (TREE_CODE (t) == COMPONENT_REF)
- {
- if (! DECL_NONADDRESSABLE_P (TREE_OPERAND (t, 1)))
- /* Stop at an adressable decl. */
- break;
- }
- else if (TREE_CODE (t) == ARRAY_REF)
- {
- if (! TYPE_NONALIASED_COMPONENT
- (TREE_TYPE (TREE_OPERAND (t, 0))))
- /* Stop at an addresssable array element. */
- break;
- }
- else if (TREE_CODE (t) != NON_LVALUE_EXPR
- && ! ((TREE_CODE (t) == NOP_EXPR
- || TREE_CODE (t) == CONVERT_EXPR)
- && (TYPE_MODE (TREE_TYPE (t))
- == TYPE_MODE (TREE_TYPE (TREE_OPERAND (t, 0))))))
- /* Stop if not one of above and not mode-preserving conversion. */
- break;
+ while (handled_component_p (t) && ! can_address_p (t))
+ t = TREE_OPERAND (t, 0);
- t = TREE_OPERAND (t, 0);
- }
-
if (TREE_CODE (t) == INDIRECT_REF)
{
/* Check for accesses through restrict-qualified pointers. */
@@ -904,6 +937,21 @@ record_base_value (regno, val, invariant)
reg_base_value[regno] = find_base_value (val);
}
+/* Clear alias info for a register. This is used if an RTL transformation
+ changes the value of a register. This is used in flow by AUTO_INC_DEC
+ optimizations. We don't need to clear reg_base_value, since flow only
+ changes the offset. */
+
+void
+clear_reg_alias_info (reg)
+ rtx reg;
+{
+ unsigned int regno = REGNO (reg);
+
+ if (regno < reg_known_value_size && regno >= FIRST_PSEUDO_REGISTER)
+ reg_known_value[regno] = reg;
+}
+
/* Returns a canonical version of X, from the point of view alias
analysis. (For example, if X is a MEM whose address is a register,
and the register has a known value (say a SYMBOL_REF), then a MEM
@@ -993,6 +1041,9 @@ rtx_equal_for_memref_p (x, y)
/* Some RTL can be compared without a recursive examination. */
switch (code)
{
+ case VALUE:
+ return CSELIB_VAL_PTR (x) == CSELIB_VAL_PTR (y);
+
case REG:
return REGNO (x) == REGNO (y);
@@ -1062,6 +1113,12 @@ rtx_equal_for_memref_p (x, y)
return 0;
break;
+ /* This can happen for asm operands. */
+ case 's':
+ if (strcmp (XSTR (x, i), XSTR (y, i)))
+ return 0;
+ break;
+
/* This can happen for an asm which clobbers memory. */
case '0':
break;
@@ -2242,6 +2299,7 @@ init_alias_analysis ()
&& REG_N_SETS (regno) == 1)
|| (note = find_reg_note (insn, REG_EQUIV, NULL_RTX)) != 0)
&& GET_CODE (XEXP (note, 0)) != EXPR_LIST
+ && ! rtx_varies_p (XEXP (note, 0), 1)
&& ! reg_overlap_mentioned_p (SET_DEST (set), XEXP (note, 0)))
{
reg_known_value[regno] = XEXP (note, 0);
@@ -2255,8 +2313,7 @@ init_alias_analysis ()
&& GET_CODE (XEXP (src, 1)) == CONST_INT)
{
rtx op0 = XEXP (src, 0);
- if (reg_known_value[REGNO (op0)])
- op0 = reg_known_value[REGNO (op0)];
+ op0 = reg_known_value[REGNO (op0)];
reg_known_value[regno]
= plus_constant_for_output (op0,
INTVAL (XEXP (src, 1)));
diff --git a/gcc/assert.h b/gcc/assert.h
deleted file mode 100644
index ecc02ee9991..00000000000
--- a/gcc/assert.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/* Allow this file to be included multiple times
- with different settings of NDEBUG. */
-#undef assert
-#undef __assert
-
-#ifdef NDEBUG
-#define assert(ignore) ((void) 0)
-#else
-
-#ifndef __GNUC__
-
-#define assert(expression) \
- ((void) ((expression) ? 0 : __assert (expression, __FILE__, __LINE__)))
-
-#define __assert(expression, file, lineno) \
- (printf ("%s:%u: failed assertion\n", file, lineno), \
- abort (), 0)
-
-#else
-
-#if defined(__STDC__) || defined (__cplusplus)
-
-/* Defined in libgcc.a */
-#ifdef __cplusplus
-extern "C" {
-extern void __eprintf (const char *, const char *, unsigned, const char *)
- __attribute__ ((noreturn));
-}
-#else
-extern void __eprintf (const char *, const char *, unsigned, const char *)
- __attribute__ ((noreturn));
-#endif
-
-#define assert(expression) \
- ((void) ((expression) ? 0 : __assert (#expression, __FILE__, __LINE__)))
-
-#define __assert(expression, file, line) \
- (__eprintf ("%s:%u: failed assertion `%s'\n", \
- file, line, expression), 0)
-
-#else /* no __STDC__ and not C++; i.e. -traditional. */
-
-extern void __eprintf () __attribute__ ((noreturn)); /* Defined in libgcc.a */
-
-#define assert(expression) \
- ((void) ((expression) ? 0 : __assert (expression, __FILE__, __LINE__)))
-
-#define __assert(expression, file, lineno) \
- (__eprintf ("%s:%u: failed assertion `%s'\n", \
- file, lineno, "expression"), 0)
-
-#endif /* no __STDC__ and not C++; i.e. -traditional. */
-#endif /* no __GNU__; i.e., /bin/cc. */
-#endif
diff --git a/gcc/basic-block.h b/gcc/basic-block.h
index eae8e29ac98..58f6aa1fc94 100644
--- a/gcc/basic-block.h
+++ b/gcc/basic-block.h
@@ -174,14 +174,12 @@ typedef struct basic_block_def {
/* The index of this block. */
int index;
- /* The loop depth of this block plus one. */
- int loop_depth;
- /* The active eh region before head and after end. */
- int eh_beg, eh_end;
+ /* The loop depth of this block. */
+ int loop_depth;
- int count; /* Expected number of executions: calculated in
- profile.c */
+ /* Expected number of executions: calculated in profile.c. */
+ int count;
} *basic_block;
/* Number of basic blocks in the current function. */
diff --git a/gcc/bb-reorder.c b/gcc/bb-reorder.c
index 08d23264632..e13e5f14485 100644
--- a/gcc/bb-reorder.c
+++ b/gcc/bb-reorder.c
@@ -92,10 +92,8 @@
#include "flags.h"
#include "output.h"
#include "function.h"
-#include "except.h"
#include "toplev.h"
#include "recog.h"
-#include "insn-flags.h"
#include "expr.h"
#include "obstack.h"
@@ -396,8 +394,6 @@ make_reorder_chain_1 (bb, prev)
taken = probability > REG_BR_PROB_BASE / 2;
/* Find the normal taken edge and the normal fallthru edge.
- Note that there may in fact be other edges due to
- asynchronous_exceptions.
Note, conditional jumps with other side effects may not
be fully optimized. In this case it is possible for
@@ -1357,17 +1353,6 @@ reorder_basic_blocks ()
if (n_basic_blocks <= 1)
return;
- /* We do not currently handle correct re-placement of EH notes.
- But that does not matter unless we intend to use them. */
- if (flag_exceptions)
- for (i = 0; i < n_basic_blocks; i++)
- {
- edge e;
- for (e = BASIC_BLOCK (i)->succ; e ; e = e->succ_next)
- if (e->flags & EDGE_EH)
- return;
- }
-
for (i = 0; i < n_basic_blocks; i++)
BASIC_BLOCK (i)->aux = xcalloc (1, sizeof (struct reorder_block_def));
diff --git a/gcc/builtins.c b/gcc/builtins.c
index 3dedc5b336a..0eae8bfd6df 100644
--- a/gcc/builtins.c
+++ b/gcc/builtins.c
@@ -30,8 +30,6 @@ Boston, MA 02111-1307, USA. */
#include "hard-reg-set.h"
#include "except.h"
#include "function.h"
-#include "insn-flags.h"
-#include "insn-codes.h"
#include "insn-config.h"
#include "expr.h"
#include "recog.h"
@@ -700,7 +698,7 @@ expand_builtin_longjmp (buf_addr, value)
/* We have to pass a value to the nonlocal_goto pattern that will
get copied into the static_chain pointer, but it does not matter
what that value is, because builtin_setjmp does not use it. */
- emit_insn (gen_nonlocal_goto (value, fp, stack, lab));
+ emit_insn (gen_nonlocal_goto (value, lab, stack, fp));
else
#endif
{
@@ -720,12 +718,17 @@ expand_builtin_longjmp (buf_addr, value)
__builtin_setjmp target in the same function. However, we've
already cautioned the user that these functions are for
internal exception handling use only. */
- for (insn = get_last_insn ();
- GET_CODE (insn) != JUMP_INSN;
- insn = PREV_INSN (insn))
- continue;
- REG_NOTES (insn) = alloc_EXPR_LIST (REG_NON_LOCAL_GOTO, const0_rtx,
- REG_NOTES (insn));
+ for (insn = get_last_insn (); insn; insn = PREV_INSN (insn))
+ {
+ if (GET_CODE (insn) == JUMP_INSN)
+ {
+ REG_NOTES (insn) = alloc_EXPR_LIST (REG_NON_LOCAL_GOTO, const0_rtx,
+ REG_NOTES (insn));
+ break;
+ }
+ else if (GET_CODE (insn) == CALL_INSN)
+ break;
+ }
}
/* Get a MEM rtx for expression EXP which is the address of an operand
@@ -3606,9 +3609,12 @@ expand_builtin (exp, target, subtarget, mode, ignore)
return expand_builtin_extract_return_addr (TREE_VALUE (arglist));
case BUILT_IN_EH_RETURN:
expand_builtin_eh_return (TREE_VALUE (arglist),
- TREE_VALUE (TREE_CHAIN (arglist)),
- TREE_VALUE (TREE_CHAIN (TREE_CHAIN (arglist))));
+ TREE_VALUE (TREE_CHAIN (arglist)));
return const0_rtx;
+#ifdef EH_RETURN_DATA_REGNO
+ case BUILT_IN_EH_RETURN_DATA_REGNO:
+ return expand_builtin_eh_return_data_regno (arglist);
+#endif
case BUILT_IN_VARARGS_START:
return expand_builtin_va_start (0, arglist);
case BUILT_IN_STDARG_START:
@@ -3659,10 +3665,14 @@ fold_builtin_constant_p (arglist)
has side effects, show we don't know it to be a constant.
Likewise if it's a pointer or aggregate type since in those
case we only want literals, since those are only optimized
- when generating RTL, not later. */
+ when generating RTL, not later.
+ And finally, if we are compiling an initializer, not code, we
+ need to return a definite result now; there's not going to be any
+ more optimization done. */
if (TREE_SIDE_EFFECTS (arglist) || cse_not_expected
|| AGGREGATE_TYPE_P (TREE_TYPE (arglist))
- || POINTER_TYPE_P (TREE_TYPE (arglist)))
+ || POINTER_TYPE_P (TREE_TYPE (arglist))
+ || cfun == 0)
return integer_zero_node;
return 0;
diff --git a/gcc/builtins.def b/gcc/builtins.def
index cd715d9db96..1d59d78f824 100644
--- a/gcc/builtins.def
+++ b/gcc/builtins.def
@@ -97,6 +97,7 @@ DEF_BUILTIN(BUILT_IN_INIT_DWARF_REG_SIZES)
DEF_BUILTIN(BUILT_IN_FROB_RETURN_ADDR)
DEF_BUILTIN(BUILT_IN_EXTRACT_RETURN_ADDR)
DEF_BUILTIN(BUILT_IN_EH_RETURN)
+DEF_BUILTIN(BUILT_IN_EH_RETURN_DATA_REGNO)
DEF_BUILTIN(BUILT_IN_VARARGS_START)
DEF_BUILTIN(BUILT_IN_STDARG_START)
diff --git a/gcc/c-common.c b/gcc/c-common.c
index 5d3510c8834..a3e13942581 100644
--- a/gcc/c-common.c
+++ b/gcc/c-common.c
@@ -191,11 +191,6 @@ int flag_short_double;
int flag_short_wchar;
-/* If non-NULL, dump the tree structure for the entire translation
- unit to this file. */
-
-const char *flag_dump_translation_unit;
-
/* Nonzero means warn about possible violations of sequence point rules. */
int warn_sequence_point;
@@ -257,15 +252,20 @@ static int if_stack_space = 0;
static int if_stack_pointer = 0;
/* Record the start of an if-then, and record the start of it
- for ambiguous else detection. */
+ for ambiguous else detection.
+
+ COND is the condition for the if-then statement.
+
+ IF_STMT is the statement node that has already been created for
+ this if-then statement. It is created before parsing the
+ condition to keep line number information accurate. */
void
-c_expand_start_cond (cond, compstmt_count)
+c_expand_start_cond (cond, compstmt_count, if_stmt)
tree cond;
int compstmt_count;
+ tree if_stmt;
{
- tree if_stmt;
-
/* Make sure there is enough space on the stack. */
if (if_stack_space == 0)
{
@@ -278,7 +278,6 @@ c_expand_start_cond (cond, compstmt_count)
if_stack = (if_elt *)xrealloc (if_stack, if_stack_space * sizeof (if_elt));
}
- if_stmt = build_stmt (IF_STMT, NULL_TREE, NULL_TREE, NULL_TREE);
IF_COND (if_stmt) = cond;
add_stmt (if_stmt);
@@ -344,6 +343,46 @@ c_finish_else ()
RECHAIN_STMTS (if_stmt, ELSE_CLAUSE (if_stmt));
}
+/* Begin an if-statement. Returns a newly created IF_STMT if
+ appropriate.
+
+ Unlike the C++ front-end, we do not call add_stmt here; it is
+ probably safe to do so, but I am not very familiar with this
+ code so I am being extra careful not to change its behavior
+ beyond what is strictly necessary for correctness. */
+
+tree
+c_begin_if_stmt ()
+{
+ tree r;
+ r = build_stmt (IF_STMT, NULL_TREE, NULL_TREE, NULL_TREE);
+ return r;
+}
+
+/* Begin a while statement. Returns a newly created WHILE_STMT if
+ appropriate.
+
+ Unlike the C++ front-end, we do not call add_stmt here; it is
+ probably safe to do so, but I am not very familiar with this
+ code so I am being extra careful not to change its behavior
+ beyond what is strictly necessary for correctness. */
+
+tree
+c_begin_while_stmt ()
+{
+ tree r;
+ r = build_stmt (WHILE_STMT, NULL_TREE, NULL_TREE);
+ return r;
+}
+
+void
+c_finish_while_stmt_cond (cond, while_stmt)
+ tree while_stmt;
+ tree cond;
+{
+ WHILE_COND (while_stmt) = cond;
+}
+
/* Make bindings for __FUNCTION__, __PRETTY_FUNCTION__, and __func__. */
void
@@ -406,7 +445,11 @@ combine_strings (strings)
wide_flag = 1;
}
else
- length += (TREE_STRING_LENGTH (t) - 1);
+ {
+ length += (TREE_STRING_LENGTH (t) - 1);
+ if (C_ARTIFICIAL_STRING_P (t) && !in_system_header)
+ warning ("concatenation of string literals with __FUNCTION__ is deprecated. This feature will be removed in future");
+ }
}
/* If anything is wide, the non-wides will be converted,
@@ -1448,6 +1491,11 @@ verify_tree (x, pbefore_sp, pno_sp, writer)
enum tree_code code;
char class;
+ /* X may be NULL if it is the operand of an empty statement expression
+ ({ }). */
+ if (x == NULL)
+ return;
+
restart:
code = TREE_CODE (x);
class = TREE_CODE_CLASS (code);
@@ -3146,6 +3194,11 @@ c_common_nodes_and_builtins ()
builtin_function ("__builtin_frame_address", ptr_ftype_unsigned,
BUILT_IN_FRAME_ADDRESS, BUILT_IN_NORMAL, NULL_PTR);
+#ifdef EH_RETURN_DATA_REGNO
+ builtin_function ("__builtin_eh_return_data_regno", int_ftype_int,
+ BUILT_IN_EH_RETURN_DATA_REGNO, BUILT_IN_NORMAL, NULL_PTR);
+#endif
+
builtin_function ("__builtin_alloca", ptr_ftype_sizetype,
BUILT_IN_ALLOCA, BUILT_IN_NORMAL, "alloca");
builtin_function_2 ("__builtin_ffs", "ffs",
@@ -3352,7 +3405,7 @@ c_common_nodes_and_builtins ()
builtin_function_2 ("__builtin_sqrtf", "sqrtf",
float_ftype_float, float_ftype_float,
BUILT_IN_FSQRT, BUILT_IN_NORMAL, 1, 0, 0);
- builtin_function_2 ("__builtin_fsqrt", "sqrt",
+ builtin_function_2 ("__builtin_sqrt", "sqrt",
double_ftype_double, double_ftype_double,
BUILT_IN_FSQRT, BUILT_IN_NORMAL, 1, 0, 0);
builtin_function_2 ("__builtin_sqrtl", "sqrtl",
@@ -3535,6 +3588,37 @@ builtin_function_2 (builtin_name, name, builtin_type, type, function_code,
return (bdecl != 0 ? bdecl : decl);
}
+/* Nonzero if the type T promotes to int. This is (nearly) the
+ integral promotions defined in ISO C99 6.3.1.1/2. */
+
+bool
+c_promoting_integer_type_p (t)
+ tree t;
+{
+ switch (TREE_CODE (t))
+ {
+ case INTEGER_TYPE:
+ return (TYPE_MAIN_VARIANT (t) == char_type_node
+ || TYPE_MAIN_VARIANT (t) == signed_char_type_node
+ || TYPE_MAIN_VARIANT (t) == unsigned_char_type_node
+ || TYPE_MAIN_VARIANT (t) == short_integer_type_node
+ || TYPE_MAIN_VARIANT (t) == short_unsigned_type_node
+ || TYPE_PRECISION (t) < TYPE_PRECISION (integer_type_node));
+
+ case ENUMERAL_TYPE:
+ /* ??? Technically all enumerations not larger than an int
+ promote to an int. But this is used along code paths
+ that only want to notice a size change. */
+ return TYPE_PRECISION (t) < TYPE_PRECISION (integer_type_node);
+
+ case BOOLEAN_TYPE:
+ return 1;
+
+ default:
+ return 0;
+ }
+}
+
/* Given a type, apply default promotions wrt unnamed function arguments
and return the new type. Return NULL_TREE if no change. */
/* ??? There is a function of the same name in the C++ front end that
@@ -3549,7 +3633,7 @@ simple_type_promotes_to (type)
if (TYPE_MAIN_VARIANT (type) == float_type_node)
return double_type_node;
- if (C_PROMOTING_INTEGER_TYPE_P (type))
+ if (c_promoting_integer_type_p (type))
{
/* Traditionally, unsignedness is preserved in default promotions.
Also preserve unsignedness if not really getting any wider. */
@@ -3584,7 +3668,7 @@ self_promoting_args_p (parms)
if (TYPE_MAIN_VARIANT (type) == float_type_node)
return 0;
- if (C_PROMOTING_INTEGER_TYPE_P (type))
+ if (c_promoting_integer_type_p (type))
return 0;
}
return 1;
@@ -3741,6 +3825,7 @@ statement_code_p (code)
case GOTO_STMT:
case LABEL_STMT:
case ASM_STMT:
+ case FILE_STMT:
case CASE_LABEL:
return 1;
diff --git a/gcc/c-common.def b/gcc/c-common.def
index b262dd76385..47008683cd5 100644
--- a/gcc/c-common.def
+++ b/gcc/c-common.def
@@ -92,6 +92,10 @@ DEFTREECODE (ASM_STMT, "asm_stmt", 'e', 5)
variables declared in this scope. */
DEFTREECODE (SCOPE_STMT, "scope_stmt", 'e', 1)
+/* A FILE_STMT marks the spot where a function changes files. It has no
+ other semantics. FILE_STMT_FILENAME gives the name. */
+DEFTREECODE (FILE_STMT, "file_stmt", 'e', 1)
+
/* Used to represent a CASE_LABEL. The operands are CASE_LOW and
CASE_HIGH, respectively. If CASE_LOW is NULL_TREE, the label is a
'default' label. If CASE_HIGH is NULL_TREE, the label is a normal case
@@ -101,3 +105,9 @@ DEFTREECODE (CASE_LABEL, "case_label", 'e', 3)
/* A STMT_EXPR represents a statement-expression. The
STMT_EXPR_STMT is the statement given by the expression. */
DEFTREECODE (STMT_EXPR, "stmt_expr", 'e', 1)
+
+/*
+Local variables:
+mode:c
+End:
+*/
diff --git a/gcc/c-common.h b/gcc/c-common.h
index 22f743ba18a..86caa057efd 100644
--- a/gcc/c-common.h
+++ b/gcc/c-common.h
@@ -215,6 +215,10 @@ extern tree c_global_trees[CTI_MAX];
These may be shadowed, and may be referenced from nested functions. */
#define C_DECLARED_LABEL_FLAG(label) TREE_LANG_FLAG_1 (label)
+/* Flag strings given by __FUNCTION__ and __PRETTY_FUNCTION__ for a
+ warning if they undergo concatenation. */
+#define C_ARTIFICIAL_STRING_P(NODE) TREE_LANG_FLAG_0 (NODE)
+
typedef enum c_language_kind
{
clk_c, /* A dialect of C: K&R C, ANSI/ISO C89, C2000,
@@ -232,6 +236,8 @@ struct stmt_tree_s {
/* The type of the last expression statement. (This information is
needed to implement the statement-expression extension.) */
tree x_last_expr_type;
+ /* The last filename we recorded. */
+ const char *x_last_expr_filename;
/* In C++, Non-zero if we should treat statements as full
expressions. In particular, this variable is no-zero if at the
end of a statement we should destroy any temporaries created
@@ -274,6 +280,10 @@ struct language_function {
#define last_expr_type (current_stmt_tree ()->x_last_expr_type)
+/* The name of the last file we have seen. */
+
+#define last_expr_filename (current_stmt_tree ()->x_last_expr_filename)
+
/* LAST_TREE contains the last statement parsed. These are chained
together through the TREE_CHAIN field, but often need to be
re-organized since the parse is performed bottom-up. This macro
@@ -319,6 +329,9 @@ extern tree walk_stmt_tree PARAMS ((tree *,
extern void prep_stmt PARAMS ((tree));
extern void expand_stmt PARAMS ((tree));
extern void mark_stmt_tree PARAMS ((void *));
+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));
/* Extra information associated with a DECL. Other C dialects extend
this structure in various ways. The C front-end only uses this
@@ -337,6 +350,13 @@ struct c_lang_decl {
(((struct c_lang_decl *) DECL_LANG_SPECIFIC (FUNCTION_DECL_CHECK (NODE))) \
->saved_tree)
+/* In a FUNCTION_DECL for which DECL_BUILT_IN does not hold, this is
+ the approximate number of statements in this function. There is
+ no need for this number to be exact; it is only used in various
+ heuristics regarding optimization. */
+#define DECL_NUM_STMTS(NODE) \
+ (FUNCTION_DECL_CHECK (NODE)->decl.u1.i)
+
extern void c_mark_lang_decl PARAMS ((struct c_lang_decl *));
/* The variant of the C language being processed. Each C language
@@ -415,11 +435,6 @@ extern int flag_no_builtin;
extern int flag_no_nonansi_builtin;
-/* If non-NULL, dump the tree structure for the entire translation
- unit to this file. */
-
-extern const char *flag_dump_translation_unit;
-
/* Nonzero means warn about suggesting putting in ()'s. */
extern int warn_parentheses;
@@ -485,7 +500,7 @@ extern void c_apply_type_quals_to_decl PARAMS ((int, tree));
NOP_EXPR is used as a special case (see truthvalue_conversion). */
extern void binary_op_error PARAMS ((enum tree_code));
extern tree c_expand_expr_stmt PARAMS ((tree));
-extern void c_expand_start_cond PARAMS ((tree, int));
+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));
@@ -526,17 +541,7 @@ extern tree build_va_arg PARAMS ((tree, tree));
extern void c_common_lang_init PARAMS ((void));
-/* Nonzero if the type T promotes to itself.
- ANSI C states explicitly the list of types that promote;
- in particular, short promotes to int even if they have the same width. */
-#define C_PROMOTING_INTEGER_TYPE_P(t) \
- (TREE_CODE ((t)) == INTEGER_TYPE \
- && (TYPE_MAIN_VARIANT (t) == char_type_node \
- || TYPE_MAIN_VARIANT (t) == signed_char_type_node \
- || TYPE_MAIN_VARIANT (t) == unsigned_char_type_node \
- || TYPE_MAIN_VARIANT (t) == short_integer_type_node \
- || TYPE_MAIN_VARIANT (t) == short_unsigned_type_node))
-
+extern bool c_promoting_integer_type_p PARAMS ((tree));
extern int self_promoting_args_p PARAMS ((tree));
extern tree simple_type_promotes_to PARAMS ((tree));
extern tree strip_array_types PARAMS ((tree));
@@ -665,6 +670,12 @@ extern tree strip_array_types PARAMS ((tree));
#define ASM_VOLATILE_P(NODE) \
(ASM_CV_QUAL (ASM_STMT_CHECK (NODE)) != NULL_TREE)
+/* The filename we are changing to as of this FILE_STMT. */
+#define FILE_STMT_FILENAME_NODE(NODE) \
+ (TREE_OPERAND (FILE_STMT_CHECK (NODE), 0))
+#define FILE_STMT_FILENAME(NODE) \
+ (IDENTIFIER_POINTER (FILE_STMT_FILENAME_NODE (NODE)))
+
/* The line-number at which a statement began. But if
STMT_LINENO_FOR_FN_P does holds, then this macro gives the
line number for the end of the current function instead. */
@@ -805,6 +816,20 @@ extern int c_unsafe_for_reeval PARAMS ((tree));
/* In dump.c */
+/* Different tree dump places. */
+enum tree_dump_index
+{
+ TDI_all, /* dump the whole translation unit */
+ TDI_original, /* dump each function before optimizing it */
+ TDI_optimized, /* dump each function after optimizing it */
+ TDI_class, /* dump class heirarchy */
+ TDI_end
+};
+
+/* Bit masks to control tree dumping. */
+#define TDF_ADDRESS (1 << 0) /* dump node addresses */
+#define TDF_SLIM (1 << 1) /* don't go wild following links */
+
typedef struct dump_info *dump_info_p;
/* A callback function used dump language-specific parts of tree
@@ -815,7 +840,12 @@ typedef int (*dump_tree_fn) PARAMS ((dump_info_p, tree));
extern dump_tree_fn lang_dump_tree;
-extern void dump_node_to_file PARAMS ((tree, const char *));
+extern int dump_flag PARAMS ((dump_info_p, int, tree));
+extern int dump_enabled_p PARAMS ((enum tree_dump_index));
+extern FILE *dump_begin PARAMS ((enum tree_dump_index, int *));
+extern void dump_end PARAMS ((enum tree_dump_index, FILE *));
+extern void dump_node PARAMS ((tree, int, FILE *));
+extern int dump_switch_p PARAMS ((const char *));
/* Information recorded about each file examined during compilation. */
diff --git a/gcc/c-convert.c b/gcc/c-convert.c
index 7f57725b7c1..6585f3cb4f6 100644
--- a/gcc/c-convert.c
+++ b/gcc/c-convert.c
@@ -89,7 +89,15 @@ convert (type, expr)
if (code == INTEGER_TYPE || code == ENUMERAL_TYPE)
return fold (convert_to_integer (type, e));
if (code == BOOLEAN_TYPE)
- return fold (build1 (NOP_EXPR, type, truthvalue_conversion (expr)));
+ {
+ tree t = truthvalue_conversion (expr);
+ /* If truthvalue_conversion returns a NOP_EXPR, we must fold it here
+ to avoid infinite recursion between fold () and convert (). */
+ if (TREE_CODE (t) == NOP_EXPR)
+ return fold (build1 (NOP_EXPR, type, TREE_OPERAND (t, 0)));
+ else
+ return fold (build1 (NOP_EXPR, type, t));
+ }
if (code == POINTER_TYPE || code == REFERENCE_TYPE)
return fold (convert_to_pointer (type, e));
if (code == REAL_TYPE)
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index ef5bb38f191..3ee2a0df290 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -452,7 +452,6 @@ c_decode_option (argc, argv)
char **argv;
{
int strings_processed;
- const char *option_value = NULL;
char *p = argv[0];
strings_processed = cpp_handle_option (parse_in, argc, argv);
@@ -598,14 +597,8 @@ c_decode_option (argc, argv)
flag_no_builtin = 0;
else if (!strcmp (p, "-fno-builtin"))
flag_no_builtin = 1;
- else if ((option_value
- = skip_leading_substring (p, "-fdump-translation-unit-")))
- {
- if (p[22] == '\0')
- error ("no file specified with -fdump-translation-unit");
- else
- flag_dump_translation_unit = option_value;
- }
+ else if (dump_switch_p (p))
+ ;
else if (!strcmp (p, "-ansi"))
goto iso_1990;
else if (!strcmp (p, "-Werror-implicit-function-declaration"))
@@ -1260,6 +1253,10 @@ set_block (block)
register tree block;
{
current_binding_level->this_block = block;
+ current_binding_level->names = chainon (current_binding_level->names,
+ BLOCK_VARS (block));
+ current_binding_level->blocks = chainon (current_binding_level->blocks,
+ BLOCK_SUBBLOCKS (block));
}
void
@@ -1841,7 +1838,7 @@ duplicate_decls (newdecl, olddecl, different_binding_level)
}
/* Keep the old rtl since we can safely use it. */
- DECL_RTL (newdecl) = DECL_RTL (olddecl);
+ COPY_DECL_RTL (olddecl, newdecl);
/* Merge the type qualifiers. */
if (TREE_CODE (olddecl) == FUNCTION_DECL
@@ -1898,7 +1895,7 @@ duplicate_decls (newdecl, olddecl, different_binding_level)
/* Copy the assembler name.
Currently, it can only be defined in the prototype. */
- DECL_ASSEMBLER_NAME (newdecl) = DECL_ASSEMBLER_NAME (olddecl);
+ COPY_DECL_ASSEMBLER_NAME (olddecl, newdecl);
if (TREE_CODE (newdecl) == FUNCTION_DECL)
{
@@ -1961,12 +1958,27 @@ duplicate_decls (newdecl, olddecl, different_binding_level)
if (TREE_CODE (newdecl) == FUNCTION_DECL)
{
- /* If either decl says `inline', this fn is inline,
- unless its definition was passed already. */
- if (DECL_INLINE (newdecl) && DECL_INITIAL (olddecl) == 0)
- DECL_INLINE (olddecl) = 1;
+ /* If we're redefining a function previously defined as extern
+ inline, make sure we emit debug info for the inline before we
+ throw it away, in case it was inlined into a function that hasn't
+ been written out yet. */
+ if (new_is_definition && DECL_INITIAL (olddecl) && TREE_USED (olddecl))
+ {
+ note_outlining_of_inline_function (olddecl);
+
+ /* The new defn must not be inline. */
+ DECL_INLINE (newdecl) = 0;
+ DECL_UNINLINABLE (newdecl) = 1;
+ }
+ else
+ {
+ /* If either decl says `inline', this fn is inline,
+ unless its definition was passed already. */
+ if (DECL_INLINE (newdecl) && DECL_INITIAL (olddecl) == 0)
+ DECL_INLINE (olddecl) = 1;
- DECL_INLINE (newdecl) = DECL_INLINE (olddecl);
+ DECL_INLINE (newdecl) = DECL_INLINE (olddecl);
+ }
if (DECL_BUILT_IN (olddecl))
{
@@ -1990,7 +2002,7 @@ duplicate_decls (newdecl, olddecl, different_binding_level)
}
/* Also preserve various other info from the definition. */
else if (! new_is_definition)
- DECL_FRAME_SIZE (newdecl) = DECL_FRAME_SIZE (olddecl);
+ DECL_NUM_STMTS (newdecl) = DECL_NUM_STMTS (olddecl);
if (! new_is_definition)
{
DECL_RESULT (newdecl) = DECL_RESULT (olddecl);
@@ -2353,7 +2365,7 @@ pushdecl (x)
DECL_INITIAL (x) = (current_function_decl == oldglobal
? 0 : DECL_INITIAL (oldglobal));
DECL_SAVED_INSNS (x) = DECL_SAVED_INSNS (oldglobal);
- DECL_FRAME_SIZE (x) = DECL_FRAME_SIZE (oldglobal);
+ DECL_NUM_STMTS (x) = DECL_NUM_STMTS (oldglobal);
DECL_ARGUMENTS (x) = DECL_ARGUMENTS (oldglobal);
DECL_RESULT (x) = DECL_RESULT (oldglobal);
TREE_ASM_WRITTEN (x) = TREE_ASM_WRITTEN (oldglobal);
@@ -3065,12 +3077,11 @@ init_decl_processing ()
builtin_function
("__builtin_eh_return",
build_function_type (void_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
+ tree_cons (NULL_TREE,
+ type_for_mode (ptr_mode, 0),
tree_cons (NULL_TREE,
- type_for_mode (ptr_mode, 0),
- tree_cons (NULL_TREE,
- ptr_type_node,
- endlink)))),
+ ptr_type_node,
+ endlink))),
BUILT_IN_EH_RETURN, BUILT_IN_NORMAL, NULL_PTR);
pedantic_lvalues = pedantic;
@@ -3167,7 +3178,7 @@ builtin_function (name, type, function_code, class, library_name)
if (flag_traditional && name[0] != '_')
DECL_BUILT_IN_NONANSI (decl) = 1;
if (library_name)
- DECL_ASSEMBLER_NAME (decl) = get_identifier (library_name);
+ SET_DECL_ASSEMBLER_NAME (decl, get_identifier (library_name));
make_decl_rtl (decl, NULL_PTR);
pushdecl (decl);
DECL_BUILT_IN_CLASS (decl) = class;
@@ -3436,7 +3447,7 @@ start_decl (declarator, declspecs, initialized, attributes, prefix_attributes)
/* But not if this is a duplicate decl
and we preserved the rtl from the previous one
(which may or may not happen). */
- && DECL_RTL (tem) == 0
+ && !DECL_RTL_SET_P (tem)
&& !DECL_CONTEXT (tem))
{
if (TREE_TYPE (tem) != error_mark_node
@@ -3579,8 +3590,8 @@ finish_decl (decl, init, asmspec_tree)
if (TREE_CODE (decl) == FUNCTION_DECL && asmspec)
{
DECL_BUILT_IN_CLASS (decl) = NOT_BUILT_IN;
- DECL_RTL (decl) = 0;
- DECL_ASSEMBLER_NAME (decl) = get_identifier (asmspec);
+ SET_DECL_RTL (decl, NULL_RTX);
+ SET_DECL_ASSEMBLER_NAME (decl, get_identifier (asmspec));
}
/* Output the assembler code and/or RTL code for variables and functions,
@@ -3598,11 +3609,30 @@ finish_decl (decl, init, asmspec_tree)
|| TREE_ASM_WRITTEN (decl)), 0);
else
{
+ /* This is a local variable. If there is an ASMSPEC, the
+ user has requested that we handle it specially. */
if (asmspec)
{
- DECL_ASSEMBLER_NAME (decl) = get_identifier (asmspec);
- DECL_C_HARD_REGISTER (decl) = 1;
+ /* In conjunction with an ASMSPEC, the `register'
+ keyword indicates that we should place the variable
+ in a particular register. */
+ if (DECL_REGISTER (decl))
+ DECL_C_HARD_REGISTER (decl) = 1;
+
+ /* If this is not a static variable, issue a warning.
+ It doesn't make any sense to give an ASMSPEC for an
+ ordinary, non-register local variable. Historically,
+ GCC has accepted -- but ignored -- the ASMSPEC in
+ this case. */
+ if (TREE_CODE (decl) == VAR_DECL
+ && !DECL_REGISTER (decl)
+ && !TREE_STATIC (decl))
+ warning_with_decl (decl,
+ "ignoring asm-specifier for non-static local variable `%s'");
+ else
+ SET_DECL_ASSEMBLER_NAME (decl, get_identifier (asmspec));
}
+
add_decl_stmt (decl);
}
@@ -3902,9 +3932,9 @@ grokdeclarator (declarator, declspecs, decl_context, initialized)
if (TREE_CODE (id) == IDENTIFIER_NODE && C_IS_RESERVED_WORD (id))
{
enum rid i = C_RID_CODE (id);
- if (i <= RID_LAST_MODIFIER)
+ if ((int) i <= (int) RID_LAST_MODIFIER)
{
- if (i == RID_LONG && specbits & (1<<i))
+ if (i == RID_LONG && (specbits & (1 << (int) i)))
{
if (longlong)
error ("`long long long' is too long for GCC");
@@ -3916,9 +3946,9 @@ grokdeclarator (declarator, declspecs, decl_context, initialized)
longlong = 1;
}
}
- else if (specbits & (1 << i))
+ else if (specbits & (1 << (int) i))
pedwarn ("duplicate `%s'", IDENTIFIER_POINTER (id));
- specbits |= 1 << i;
+ specbits |= 1 << (int) i;
goto found;
}
}
@@ -4289,8 +4319,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized)
/* Strip NON_LVALUE_EXPRs since we aren't using as an lvalue. */
STRIP_TYPE_NOPS (size);
- if (TREE_CODE (TREE_TYPE (size)) != INTEGER_TYPE
- && TREE_CODE (TREE_TYPE (size)) != ENUMERAL_TYPE)
+ if (! INTEGRAL_TYPE_P (TREE_TYPE (size)))
{
error ("size of array `%s' has non-integer type", name);
size = integer_one_node;
@@ -4644,7 +4673,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized)
if (decl_context == PARM)
{
- tree type_as_written = type;
+ tree type_as_written;
tree promoted_type;
/* A parameter declared as an array of T is really a pointer to T.
@@ -4669,6 +4698,10 @@ grokdeclarator (declarator, declspecs, decl_context, initialized)
type = build_pointer_type (type);
type_quals = TYPE_UNQUALIFIED;
}
+ else if (type_quals)
+ type = c_build_qualified_type (type, type_quals);
+
+ type_as_written = type;
decl = build_decl (PARM_DECL, declarator, type);
if (size_varies)
@@ -4795,7 +4828,9 @@ grokdeclarator (declarator, declspecs, decl_context, initialized)
type_quals = TYPE_UNQUALIFIED;
#endif
}
-
+ else if (type_quals)
+ type = c_build_qualified_type (type, type_quals);
+
decl = build_decl (VAR_DECL, declarator, type);
if (size_varies)
C_DECL_VARIABLE_SIZE (decl) = 1;
@@ -5035,8 +5070,7 @@ get_parm_info (void_at_end)
tree type = TREE_TYPE (decl);
DECL_ARG_TYPE (decl) = type;
if (PROMOTE_PROTOTYPES
- && (TREE_CODE (type) == INTEGER_TYPE
- || TREE_CODE (type) == ENUMERAL_TYPE)
+ && INTEGRAL_TYPE_P (type)
&& TYPE_PRECISION (type) < TYPE_PRECISION (integer_type_node))
DECL_ARG_TYPE (decl) = integer_type_node;
@@ -5980,7 +6014,7 @@ start_function (declspecs, declarator, prefix_attributes, attributes)
restype = TREE_TYPE (TREE_TYPE (current_function_decl));
/* Promote the value to int before returning it. */
- if (C_PROMOTING_INTEGER_TYPE_P (restype))
+ if (c_promoting_integer_type_p (restype))
{
/* It retains unsignedness if traditional
or if not really getting wider. */
@@ -6046,6 +6080,9 @@ store_parm_decls ()
/* Nonzero if this definition is written with a prototype. */
int prototype = 0;
+ /* The function containing FNDECL, if any. */
+ tree context = decl_function_context (fndecl);
+
if (specparms != 0 && TREE_CODE (specparms) != TREE_LIST)
{
/* This case is when the function was defined with an ANSI prototype.
@@ -6306,9 +6343,11 @@ store_parm_decls ()
"prototype declaration");
break;
}
- /* Type for passing arg must be consistent
- with that declared for the arg. */
- if (! comptypes (DECL_ARG_TYPE (parm), TREE_VALUE (type)))
+ /* Type for passing arg must be consistent with that
+ declared for the arg. ISO C says we take the unqualified
+ type for parameters declared with qualified type. */
+ if (! comptypes (TYPE_MAIN_VARIANT (DECL_ARG_TYPE (parm)),
+ TYPE_MAIN_VARIANT (TREE_VALUE (type))))
{
if (TYPE_MAIN_VARIANT (TREE_TYPE (parm))
== TYPE_MAIN_VARIANT (TREE_VALUE (type)))
@@ -6321,8 +6360,7 @@ store_parm_decls ()
DECL_ARG_TYPE (parm) = TREE_TYPE (parm);
if (PROMOTE_PROTOTYPES
- && (TREE_CODE (TREE_TYPE (parm)) == INTEGER_TYPE
- || TREE_CODE (TREE_TYPE (parm)) == ENUMERAL_TYPE)
+ && INTEGRAL_TYPE_P (TREE_TYPE (parm))
&& TYPE_PRECISION (TREE_TYPE (parm))
< TYPE_PRECISION (integer_type_node))
DECL_ARG_TYPE (parm) = integer_type_node;
@@ -6414,14 +6452,28 @@ store_parm_decls ()
gen_aux_info_record (fndecl, 1, 0, prototype);
/* Initialize the RTL code for the function. */
-
init_function_start (fndecl, input_filename, lineno);
/* Begin the statement tree for this function. */
DECL_LANG_SPECIFIC (current_function_decl)
- =((struct lang_decl *) ggc_alloc (sizeof (struct lang_decl)));
+ =((struct lang_decl *) ggc_alloc_cleared (sizeof (struct lang_decl)));
begin_stmt_tree (&DECL_SAVED_TREE (current_function_decl));
+ /* If this is a nested function, save away the sizes of any
+ variable-size types so that we can expand them when generating
+ RTL. */
+ if (context)
+ {
+ tree t;
+
+ DECL_LANG_SPECIFIC (fndecl)->pending_sizes
+ = nreverse (get_pending_sizes ());
+ for (t = DECL_LANG_SPECIFIC (fndecl)->pending_sizes;
+ t;
+ t = TREE_CHAIN (t))
+ SAVE_EXPR_CONTEXT (TREE_VALUE (t)) = context;
+ }
+
/* This function is being processed in whole-function mode. */
cfun->x_whole_function_mode_p = 1;
@@ -6665,12 +6717,18 @@ c_expand_body (fndecl, nested_p)
if (flag_syntax_only)
return;
- /* Squirrel away our current state. */
if (nested_p)
- push_function_context ();
+ {
+ /* Make sure that we will evaluate variable-sized types involved
+ in our function's type. */
+ expand_pending_sizes (DECL_LANG_SPECIFIC (fndecl)->pending_sizes);
+ /* Squirrel away our current state. */
+ push_function_context ();
+ }
/* Initialize the RTL code for the function. */
current_function_decl = fndecl;
+ input_filename = DECL_SOURCE_FILE (fndecl);
init_function_start (fndecl, input_filename, DECL_SOURCE_LINE (fndecl));
/* This function is being processed in whole-function mode. */
@@ -6702,7 +6760,7 @@ c_expand_body (fndecl, nested_p)
/* Allow the body of the function to be garbage collected. */
DECL_SAVED_TREE (fndecl) = NULL_TREE;
- /* We hard-wired immediate_size_expand to zero in start_function.
+ /* We hard-wired immediate_size_expand to zero above.
expand_function_end will decrement this variable. So, we set the
variable to one here, so that after the decrement it will remain
zero. */
@@ -6795,19 +6853,8 @@ c_expand_body (fndecl, nested_p)
}
if (nested_p)
- {
- /* Return to the enclosing function. */
- pop_function_context ();
- /* If the nested function was inline, write it out if that is
- necessary. */
- if (!TREE_ASM_WRITTEN (fndecl) && TREE_ADDRESSABLE (fndecl))
- {
- push_function_context ();
- output_inline_function (fndecl);
- pop_function_context ();
- }
- }
-
+ /* Return to the enclosing function. */
+ pop_function_context ();
}
/* Check the declarations given in a for-loop for satisfying the C99
@@ -6997,6 +7044,7 @@ lang_mark_tree (t)
{
ggc_mark (DECL_LANG_SPECIFIC (t));
c_mark_lang_decl (&DECL_LANG_SPECIFIC (t)->base);
+ ggc_mark_tree (DECL_LANG_SPECIFIC (t)->pending_sizes);
}
}
diff --git a/gcc/c-dump.c b/gcc/c-dump.c
index 96a2548b571..46755f3c859 100644
--- a/gcc/c-dump.c
+++ b/gcc/c-dump.c
@@ -1,5 +1,5 @@
/* Tree-dumping functionality for intermediate representation.
- Copyright (C) 1999, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
Written by Mark Mitchell <mark@codesourcery.com>
This file is part of GNU CC.
@@ -40,7 +40,6 @@ static void dequeue_and_dump PARAMS ((dump_info_p));
static void dump_new_line PARAMS ((dump_info_p));
static void dump_maybe_newline PARAMS ((dump_info_p));
static void dump_string_field PARAMS ((dump_info_p, const char *, const char *));
-static void dump_node PARAMS ((tree, FILE *));
/* Add T to the end of the queue of nodes to dump. Returns the index
assigned to T. */
@@ -139,6 +138,11 @@ queue_and_dump_type (di, t)
queue_and_dump_index (di, "type", TREE_TYPE (t), DUMP_NONE);
}
+/* Dump column control */
+#define SOL_COLUMN 25 /* Start of line column. */
+#define EOL_COLUMN 55 /* End of line column. */
+#define COLUMN_ALIGNMENT 15 /* Alignment. */
+
/* Insert a new line in the dump output, and indent to an appropriate
place to start printing more fields. */
@@ -146,8 +150,8 @@ static void
dump_new_line (di)
dump_info_p di;
{
- fprintf (di->stream, "\n%25s", "");
- di->column = 25;
+ fprintf (di->stream, "\n%*s", SOL_COLUMN, "");
+ di->column = SOL_COLUMN;
}
/* If necessary, insert a new line. */
@@ -156,18 +160,33 @@ static void
dump_maybe_newline (di)
dump_info_p di;
{
+ int extra;
+
/* See if we need a new line. */
- if (di->column > 53)
+ if (di->column > EOL_COLUMN)
dump_new_line (di);
/* See if we need any padding. */
- else if ((di->column - 25) % 14 != 0)
+ else if ((extra = (di->column - SOL_COLUMN) % COLUMN_ALIGNMENT) != 0)
{
- fprintf (di->stream, "%*s", 14 - ((di->column - 25) % 14), "");
- di->column += 14 - (di->column - 25) % 14;
+ fprintf (di->stream, "%*s", COLUMN_ALIGNMENT - extra, "");
+ di->column += COLUMN_ALIGNMENT - extra;
}
}
-/* Dump I using FIELD to identity it. */
+/* Dump pointer PTR using FIELD to identify it. */
+
+void
+dump_pointer (di, field, ptr)
+ dump_info_p di;
+ const char *field;
+ void *ptr;
+{
+ dump_maybe_newline (di);
+ fprintf (di->stream, "%-4s: %-8lx ", field, (long) ptr);
+ di->column += 15;
+}
+
+/* Dump integer I using FIELD to identify it. */
void
dump_int (di, field, i)
@@ -325,7 +344,7 @@ dequeue_and_dump (di)
/* All declarations have names. */
if (DECL_NAME (t))
dump_child ("name", DECL_NAME (t));
- if (DECL_ASSEMBLER_NAME (t)
+ if (DECL_ASSEMBLER_NAME_SET_P (t)
&& DECL_ASSEMBLER_NAME (t) != DECL_NAME (t))
dump_child ("mngl", DECL_ASSEMBLER_NAME (t));
/* And types. */
@@ -349,7 +368,7 @@ dequeue_and_dump (di)
/* And any declaration can be compiler-generated. */
if (DECL_ARTIFICIAL (t))
dump_string (di, "artificial");
- if (TREE_CHAIN (t))
+ if (TREE_CHAIN (t) && !dump_flag (di, TDF_SLIM, NULL))
dump_child ("chan", TREE_CHAIN (t));
}
else if (code_class == 't')
@@ -504,7 +523,7 @@ dequeue_and_dump (di)
dump_string (di, "extern");
else
dump_string (di, "static");
- if (DECL_LANG_SPECIFIC (t))
+ if (DECL_LANG_SPECIFIC (t) && !dump_flag (di, TDF_SLIM, t))
dump_child ("body", DECL_SAVED_TREE (t));
break;
@@ -709,15 +728,30 @@ dequeue_and_dump (di)
}
done:
+ if (dump_flag (di, TDF_ADDRESS, NULL))
+ dump_pointer (di, "addr", (void *)t);
+
/* Terminate the line. */
fprintf (di->stream, "\n");
}
+/* Return non-zero if FLAG has been specified for the dump, and NODE
+ is not the root node of the dump. */
+
+int dump_flag (di, flag, node)
+ dump_info_p di;
+ int flag;
+ tree node;
+{
+ return (di->flags & flag) && (node != di->node);
+}
+
/* Dump T, and all its children, on STREAM. */
-static void
-dump_node (t, stream)
+void
+dump_node (t, flags, stream)
tree t;
+ int flags;
FILE *stream;
{
struct dump_info di;
@@ -731,6 +765,8 @@ dump_node (t, stream)
di.queue = 0;
di.queue_end = 0;
di.free_list = 0;
+ di.flags = flags;
+ di.node = t;
di.nodes = splay_tree_new (splay_tree_compare_pointers, 0,
(splay_tree_delete_value_fn) &free);
@@ -750,21 +786,92 @@ dump_node (t, stream)
splay_tree_delete (di.nodes);
}
-/* Dump T, and all its children, to FILE. */
+/* Define a tree dump switch. */
+struct dump_file_info
+{
+ const char *suffix; /* suffix to give output file. */
+ const char *swtch; /* command line switch */
+ int flags; /* user flags */
+ int state; /* state of play */
+};
+
+/* Table of tree dump switches. */
+static struct dump_file_info dump_files[TDI_end] =
+{
+ {".tu", "dump-translation-unit", 0, 0},
+ {".original", "dump-ast-original", 0, 0},
+ {".optimized", "dump-ast-optimized", 0, 0},
+ {".class", "dump-class-hierarchy", 0, 0},
+};
+
+/* Begin a tree dump for PHASE. Stores any user supplied flag in
+ *FLAG_PTR and returns a stream to write to. If the dump is not
+ enabled, returns NULL.
+ Multiple calls will reopen and append to the dump file. */
+
+FILE *
+dump_begin (phase, flag_ptr)
+ enum tree_dump_index phase;
+ int *flag_ptr;
+{
+ FILE *stream;
+ char *name;
+
+ if (!dump_files[phase].state)
+ return NULL;
+
+ name = concat (dump_base_name, dump_files[phase].suffix, NULL);
+ stream = fopen (name, dump_files[phase].state < 0 ? "w" : "a");
+ if (!stream)
+ error ("could not open dump file `%s'", name);
+ else
+ dump_files[phase].state = 1;
+ free (name);
+ if (flag_ptr)
+ *flag_ptr = dump_files[phase].flags;
+
+ return stream;
+}
-void
-dump_node_to_file (t, file)
- tree t;
- const char *file;
+/* Returns non-zero if tree dump PHASE is enabled. */
+
+int dump_enabled_p (phase)
+ enum tree_dump_index phase;
{
- FILE *f;
+ return dump_files[phase].state;
+}
- f = fopen (file, "w");
- if (!f)
- error ("could not open dump file `%s'", file);
- else
- {
- dump_node (t, f);
- fclose (f);
- }
+/* Finish a tree dump for PHASE. STREAM is the stream created by
+ dump_begin. */
+
+void dump_end (phase, stream)
+ enum tree_dump_index phase ATTRIBUTE_UNUSED;
+ FILE *stream;
+{
+ fclose (stream);
+}
+
+/* Parse ARG as a dump switch. Return non-zero if it is, and store the
+ relevant details in the dump_files array. */
+
+int dump_switch_p (arg)
+ const char *arg;
+{
+ unsigned ix;
+ const char *option_value;
+
+ for (ix = 0; ix != TDI_end; ix++)
+ if ((option_value = skip_leading_substring (arg, dump_files[ix].swtch)))
+ {
+ dump_files[ix].state = -1;
+ if (*option_value == '-')
+ dump_files[ix].flags
+ = read_integral_parameter (option_value + 1, arg, 0);
+ else if (*option_value)
+ warning ("ignoring `%s' at end of `-f%s'",
+ option_value, dump_files[ix].swtch);
+
+ return 1;
+ }
+ return 0;
}
diff --git a/gcc/c-dump.h b/gcc/c-dump.h
index bb246ceea47..6c75afe9555 100644
--- a/gcc/c-dump.h
+++ b/gcc/c-dump.h
@@ -50,6 +50,10 @@ struct dump_info
{
/* The stream on which to dump the information. */
FILE *stream;
+ /* The original node. */
+ tree node;
+ /* User flags. */
+ int flags;
/* The next unused node index. */
unsigned int index;
/* The next column. */
@@ -70,6 +74,8 @@ struct dump_info
#define dump_child(field, child) \
queue_and_dump_index (di, field, child, DUMP_NONE)
+extern void dump_pointer
+ PARAMS ((dump_info_p, const char *, void *));
extern void dump_int
PARAMS ((dump_info_p, const char *, int));
extern void dump_string
diff --git a/gcc/c-format.c b/gcc/c-format.c
index 5adb8e53abd..b6270e2ae27 100644
--- a/gcc/c-format.c
+++ b/gcc/c-format.c
@@ -476,11 +476,11 @@ enum format_std_version
or inheriting from, for the purpose of format features supported. */
#define CPLUSPLUS_STD_VER STD_C89
/* The C standard version we are checking formats against when pedantic. */
-#define C_STD_VER (c_language == clk_cplusplus \
+#define C_STD_VER ((int)(c_language == clk_cplusplus \
? CPLUSPLUS_STD_VER \
: (flag_isoc99 \
? STD_C99 \
- : (flag_isoc94 ? STD_C94 : STD_C89)))
+ : (flag_isoc94 ? STD_C94 : STD_C89))))
/* The name to give to the standard version we are warning about when
pedantic. FEATURE_VER is the version in which the feature warned out
appeared, which is higher than C_STD_VER. */
@@ -1105,7 +1105,8 @@ check_function_format (status, name, assembler_name, params)
/* Yup; check it. */
check_format_info (status, info, params);
if (warn_missing_format_attribute && info->first_arg_num == 0
- && (format_types[info->format_type].flags & FMT_FLAG_ARG_CONVERT))
+ && (format_types[info->format_type].flags
+ & (int) FMT_FLAG_ARG_CONVERT))
{
function_format_info *info2;
for (info2 = function_format_list; info2; info2 = info2->next)
@@ -1298,7 +1299,7 @@ maybe_read_dollar_number (status, format, dollar_needed, params, param_ptr,
nalloc - dollar_arguments_alloc);
dollar_arguments_alloc = nalloc;
}
- if (!(fki->flags & FMT_FLAG_DOLLAR_MULTIPLE)
+ if (!(fki->flags & (int) FMT_FLAG_DOLLAR_MULTIPLE)
&& dollar_arguments_used[argnum - 1] == 1)
{
dollar_arguments_used[argnum - 1] = 2;
@@ -1434,7 +1435,7 @@ check_format_info (status, info, params)
/* Functions taking a va_list normally pass a non-literal format
string. These functions typically are declared with
first_arg_num == 0, so avoid warning in those cases. */
- if (!(format_types[info->format_type].flags & FMT_FLAG_ARG_CONVERT))
+ if (!(format_types[info->format_type].flags & (int) FMT_FLAG_ARG_CONVERT))
{
/* For strftime-like formats, warn for not checking the format
string; but there are no arguments to check. */
@@ -1746,7 +1747,7 @@ check_format_info_main (status, res, info, format_chars, format_length,
}
flag_chars[0] = 0;
- if ((fki->flags & FMT_FLAG_USE_DOLLAR) && has_operand_number != 0)
+ if ((fki->flags & (int) FMT_FLAG_USE_DOLLAR) && has_operand_number != 0)
{
/* Possibly read a $ operand number at the start of the format.
If one was previously used, one is required here. If one
@@ -1867,7 +1868,7 @@ check_format_info_main (status, res, info, format_chars, format_length,
++format_chars;
}
if (found_width && !non_zero_width_char &&
- (fki->flags & FMT_FLAG_ZERO_WIDTH_BAD))
+ (fki->flags & (int) FMT_FLAG_ZERO_WIDTH_BAD))
status_warning (status, "zero width in %s format",
fki->name);
if (found_width)
@@ -1954,7 +1955,7 @@ check_format_info_main (status, res, info, format_chars, format_length,
}
else
{
- if (!(fki->flags & FMT_FLAG_EMPTY_PREC_OK)
+ if (!(fki->flags & (int) FMT_FLAG_EMPTY_PREC_OK)
&& !ISDIGIT (*format_chars))
status_warning (status, "empty precision in %s format",
fki->name);
@@ -2025,7 +2026,7 @@ check_format_info_main (status, res, info, format_chars, format_length,
}
/* Handle the scanf allocation kludge. */
- if (fki->flags & FMT_FLAG_SCANF_A_KLUDGE)
+ if (fki->flags & (int) FMT_FLAG_SCANF_A_KLUDGE)
{
if (*format_chars == 'a' && !flag_isoc99)
{
@@ -2043,7 +2044,8 @@ check_format_info_main (status, res, info, format_chars, format_length,
format_char = *format_chars;
if (format_char == 0
- || (!(fki->flags & FMT_FLAG_FANCY_PERCENT_OK) && format_char == '%'))
+ || (!(fki->flags & (int) FMT_FLAG_FANCY_PERCENT_OK)
+ && format_char == '%'))
{
status_warning (status, "conversion lacks type at end of format");
continue;
@@ -2109,7 +2111,7 @@ check_format_info_main (status, res, info, format_chars, format_length,
flag_chars[i - d] = 0;
}
- if ((fki->flags & FMT_FLAG_SCANF_A_KLUDGE)
+ if ((fki->flags & (int) FMT_FLAG_SCANF_A_KLUDGE)
&& strchr (flag_chars, 'a') != 0)
aflag = 1;
@@ -2190,7 +2192,7 @@ check_format_info_main (status, res, info, format_chars, format_length,
wanted_type = 0;
wanted_type_name = 0;
- if (fki->flags & FMT_FLAG_ARG_CONVERT)
+ if (fki->flags & (int) FMT_FLAG_ARG_CONVERT)
{
wanted_type = (fci->types[length_chars_val].type
? *fci->types[length_chars_val].type : 0);
diff --git a/gcc/c-gperf.h b/gcc/c-gperf.h
deleted file mode 100644
index 842b3a457ac..00000000000
--- a/gcc/c-gperf.h
+++ /dev/null
@@ -1,252 +0,0 @@
-/* C code produced by gperf version 2.7 */
-/* Command-line: gperf -L C -F , 0, 0 -p -j1 -i 1 -g -o -t -G -N is_reserved_word -k1,3,$ ../../egcs/gcc/c-parse.gperf */
-/* Command-line: gperf -L C -F ', 0, 0' -p -j1 -i 1 -g -o -t -N is_reserved_word -k1,3,$ c-parse.gperf */
-struct resword { const char *name; short token; enum rid rid; };
-#ifdef __GNUC__
-__inline
-#endif
-static unsigned int hash PARAMS ((const char *, unsigned int));
-#ifdef __GNUC__
-__inline
-#endif
-struct resword *is_reserved_word PARAMS ((const char *, unsigned int));
-
-#define TOTAL_KEYWORDS 92
-#define MIN_WORD_LENGTH 2
-#define MAX_WORD_LENGTH 20
-#define MIN_HASH_VALUE 17
-#define MAX_HASH_VALUE 301
-/* maximum key range = 285, duplicates = 0 */
-
-#ifdef __GNUC__
-__inline
-#endif
-static unsigned int
-hash (str, len)
- register const char *str;
- register unsigned int len;
-{
- static unsigned short asso_values[] =
- {
- 302, 302, 302, 302, 302, 302, 302, 302, 302, 302,
- 302, 302, 302, 302, 302, 302, 302, 302, 302, 302,
- 302, 302, 302, 302, 302, 302, 302, 302, 302, 302,
- 302, 302, 302, 302, 302, 302, 302, 302, 302, 302,
- 302, 302, 302, 302, 302, 302, 302, 302, 302, 302,
- 302, 302, 302, 302, 302, 302, 302, 302, 302, 302,
- 302, 302, 302, 302, 113, 302, 302, 302, 302, 302,
- 302, 302, 302, 302, 302, 302, 302, 302, 302, 302,
- 302, 302, 302, 302, 302, 302, 302, 302, 302, 302,
- 302, 302, 302, 302, 302, 1, 302, 78, 52, 111,
- 34, 9, 46, 59, 1, 20, 302, 1, 118, 17,
- 18, 39, 58, 302, 7, 6, 33, 70, 21, 2,
- 5, 1, 1, 302, 302, 302, 302, 302, 302, 302,
- 302, 302, 302, 302, 302, 302, 302, 302, 302, 302,
- 302, 302, 302, 302, 302, 302, 302, 302, 302, 302,
- 302, 302, 302, 302, 302, 302, 302, 302, 302, 302,
- 302, 302, 302, 302, 302, 302, 302, 302, 302, 302,
- 302, 302, 302, 302, 302, 302, 302, 302, 302, 302,
- 302, 302, 302, 302, 302, 302, 302, 302, 302, 302,
- 302, 302, 302, 302, 302, 302, 302, 302, 302, 302,
- 302, 302, 302, 302, 302, 302, 302, 302, 302, 302,
- 302, 302, 302, 302, 302, 302, 302, 302, 302, 302,
- 302, 302, 302, 302, 302, 302, 302, 302, 302, 302,
- 302, 302, 302, 302, 302, 302, 302, 302, 302, 302,
- 302, 302, 302, 302, 302, 302, 302, 302, 302, 302,
- 302, 302, 302, 302, 302, 302
- };
- register int hval = len;
-
- switch (hval)
- {
- default:
- case 3:
- hval += asso_values[(unsigned char)str[2]];
- case 2:
- case 1:
- hval += asso_values[(unsigned char)str[0]];
- break;
- }
- return hval + asso_values[(unsigned char)str[len - 1]];
-}
-
-static struct resword wordlist[] =
- {
- {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
- {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
- {"__real__", REALPART, NORID},
- {"__signed__", TYPESPEC, RID_SIGNED},
- {"", 0, 0}, {"", 0, 0},
- {"__restrict__", TYPE_QUAL, RID_RESTRICT},
- {"", 0, 0}, {"", 0, 0},
- {"__extension__", EXTENSION, NORID},
- {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
- {"else", ELSE, NORID},
- {"", 0, 0},
- {"__imag__", IMAGPART, NORID},
- {"", 0, 0},
- {"__inline__", SCSPEC, RID_INLINE},
- {"switch", SWITCH, NORID},
- {"", 0, 0},
- {"__volatile__", TYPE_QUAL, RID_VOLATILE},
- {"while", WHILE, NORID},
- {"", 0, 0},
- {"__inline", SCSPEC, RID_INLINE},
- {"", 0, 0},
- {"in", TYPE_QUAL, RID_IN},
- {"__volatile", TYPE_QUAL, RID_VOLATILE},
- {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
- {"__typeof__", TYPEOF, NORID},
- {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
- {"__signed", TYPESPEC, RID_SIGNED},
- {"", 0, 0},
- {"__restrict", TYPE_QUAL, RID_RESTRICT},
- {"struct", STRUCT, NORID},
- {"", 0, 0},
- {"restrict", TYPE_QUAL, RID_RESTRICT},
- {"oneway", TYPE_QUAL, RID_ONEWAY},
- {"id", OBJECTNAME, RID_ID},
- {"", 0, 0}, {"", 0, 0},
- {"sizeof", SIZEOF, NORID},
- {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
- {"for", FOR, NORID},
- {"return", RETURN, NORID},
- {"__bounded__", TYPE_QUAL, RID_BOUNDED},
- {"extern", SCSPEC, RID_EXTERN},
- {"break", BREAK, NORID},
- {"if", IF, NORID},
- {"", 0, 0}, {"", 0, 0},
- {"__ptrbase__", PTR_BASE, NORID},
- {"__ptrvalue__", PTR_VALUE, NORID},
- {"__ptrextent__", PTR_EXTENT, NORID},
- {"", 0, 0},
- {"do", DO, NORID},
- {"", 0, 0},
- {"__ptrbase", PTR_BASE, NORID},
- {"__ptrvalue", PTR_VALUE, NORID},
- {"void", TYPESPEC, RID_VOID},
- {"", 0, 0},
- {"register", SCSPEC, RID_REGISTER},
- {"", 0, 0},
- {"short", TYPESPEC, RID_SHORT},
- {"", 0, 0},
- {"__unbounded__", TYPE_QUAL, RID_UNBOUNDED},
- {"__imag", IMAGPART, NORID},
- {"__asm__", ASM_KEYWORD, NORID},
- {"__typeof", TYPEOF, NORID},
- {"int", TYPESPEC, RID_INT},
- {"", 0, 0},
- {"__alignof__", ALIGNOF, NORID},
- {"", 0, 0},
- {"__attribute__", ATTRIBUTE, NORID},
- {"", 0, 0}, {"", 0, 0},
- {"__bounded", TYPE_QUAL, RID_BOUNDED},
- {"inout", TYPE_QUAL, RID_INOUT},
- {"", 0, 0},
- {"__attribute", ATTRIBUTE, NORID},
- {"enum", ENUM, NORID},
- {"__asm", ASM_KEYWORD, NORID},
- {"", 0, 0},
- {"__ptrextent", PTR_EXTENT, NORID},
- {"", 0, 0},
- {"signed", TYPESPEC, RID_SIGNED},
- {"", 0, 0}, {"", 0, 0},
- {"out", TYPE_QUAL, RID_OUT},
- {"", 0, 0},
- {"byref", TYPE_QUAL, RID_BYREF},
- {"", 0, 0}, {"", 0, 0},
- {"union", UNION, NORID},
- {"", 0, 0},
- {"asm", ASM_KEYWORD, NORID},
- {"__unbounded", TYPE_QUAL, RID_UNBOUNDED},
- {"", 0, 0},
- {"unsigned", TYPESPEC, RID_UNSIGNED},
- {"double", TYPESPEC, RID_DOUBLE},
- {"default", DEFAULT, NORID},
- {"", 0, 0},
- {"__const__", TYPE_QUAL, RID_CONST},
- {"float", TYPESPEC, RID_FLOAT},
- {"__complex__", TYPESPEC, RID_COMPLEX},
- {"", 0, 0},
- {"__complex", TYPESPEC, RID_COMPLEX},
- {"", 0, 0},
- {"__builtin_va_arg", VA_ARG, NORID},
- {"__label__", LABEL, NORID},
- {"case", CASE, NORID},
- {"", 0, 0},
- {"__real", REALPART, NORID},
- {"@defs", DEFS, NORID},
- {"__alignof", ALIGNOF, NORID},
- {"goto", GOTO, NORID},
- {"", 0, 0},
- {"@private", PRIVATE, NORID},
- {"@selector", SELECTOR, NORID},
- {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
- {"typeof", TYPEOF, NORID},
- {"typedef", SCSPEC, RID_TYPEDEF},
- {"", 0, 0},
- {"continue", CONTINUE, NORID},
- {"@encode", ENCODE, NORID},
- {"", 0, 0}, {"", 0, 0},
- {"@interface", INTERFACE, NORID},
- {"", 0, 0},
- {"__const", TYPE_QUAL, RID_CONST},
- {"inline", SCSPEC, RID_INLINE},
- {"auto", SCSPEC, RID_AUTO},
- {"", 0, 0},
- {"volatile", TYPE_QUAL, RID_VOLATILE},
- {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
- {"@implementation", IMPLEMENTATION, NORID},
- {"@protected", PROTECTED, NORID},
- {"", 0, 0}, {"", 0, 0},
- {"const", TYPE_QUAL, RID_CONST},
- {"", 0, 0},
- {"@end", END, NORID},
- {"bycopy", TYPE_QUAL, RID_BYCOPY},
- {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
- {"@compatibility_alias", ALIAS, NORID},
- {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
- {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
- {"", 0, 0}, {"", 0, 0},
- {"long", TYPESPEC, RID_LONG},
- {"char", TYPESPEC, RID_CHAR},
- {"static", SCSPEC, RID_STATIC},
- {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
- {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
- {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
- {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
- {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
- {"@class", CLASS, NORID},
- {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
- {"@protocol", PROTOCOL, NORID},
- {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
- {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
- {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
- {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
- {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
- {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
- {"@public", PUBLIC, NORID}
- };
-
-#ifdef __GNUC__
-__inline
-#endif
-struct resword *
-is_reserved_word (str, len)
- register const char *str;
- register unsigned int len;
-{
- if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
- {
- register int key = hash (str, len);
-
- if (key <= MAX_HASH_VALUE && key >= 0)
- {
- register const char *s = wordlist[key].name;
-
- if (*str == *s && !strcmp (str + 1, s + 1))
- return &wordlist[key];
- }
- }
- return 0;
-}
diff --git a/gcc/c-lang.c b/gcc/c-lang.c
index 87c65fbacae..4637c1f549a 100644
--- a/gcc/c-lang.c
+++ b/gcc/c-lang.c
@@ -255,9 +255,17 @@ finish_file ()
if (back_end_hook)
(*back_end_hook) (getdecls ());
+
+ {
+ int flags;
+ FILE *stream = dump_begin (TDI_all, &flags);
- if (flag_dump_translation_unit)
- dump_node_to_file (getdecls (), flag_dump_translation_unit);
+ if (stream)
+ {
+ dump_node (getdecls (), flags & ~TDF_SLIM, stream);
+ dump_end (TDI_all, stream);
+ }
+ }
}
/* Called during diagnostic message formatting process to print a
diff --git a/gcc/c-lex.c b/gcc/c-lex.c
index 358e5d1532b..bdcecc3efee 100644
--- a/gcc/c-lex.c
+++ b/gcc/c-lex.c
@@ -53,8 +53,8 @@ Boston, MA 02111-1307, USA. */
#define GET_ENVIRONMENT(ENV_VALUE,ENV_NAME) ((ENV_VALUE) = getenv (ENV_NAME))
#endif
-/* The original file name, before changing "-" to "stdin". */
-static const char *orig_filename;
+/* The input filename as understood by CPP, where "" represents stdin. */
+static const char *cpp_filename;
/* We may keep statistics about how long which files took to compile. */
static int header_time, body_time;
@@ -102,8 +102,6 @@ init_c_lex (filename)
struct cpp_callbacks *cb;
struct c_fileinfo *toplevel;
- orig_filename = filename;
-
/* Set up filename timing. Must happen before cpp_start_read. */
file_info_tree = splay_tree_new ((splay_tree_compare_fn)strcmp,
0,
@@ -115,7 +113,7 @@ init_c_lex (filename)
body_time = get_run_time ();
toplevel->time = body_time;
}
-
+
#ifdef MULTIBYTE_CHARS
/* Change to the native locale for multibyte conversions. */
setlocale (LC_CTYPE, "");
@@ -136,8 +134,11 @@ init_c_lex (filename)
cb->undef = cb_undef;
}
+
if (filename == 0 || !strcmp (filename, "-"))
- filename = "stdin";
+ filename = "stdin", cpp_filename = "";
+ else
+ cpp_filename = filename;
/* Start it at 0. */
lineno = 0;
@@ -145,13 +146,13 @@ init_c_lex (filename)
return filename;
}
-/* 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. */
int
yyparse()
{
- if (! cpp_start_read (parse_in, orig_filename))
+ if (! cpp_start_read (parse_in, cpp_filename))
return 1; /* cpplib has emitted an error. */
return yyparse_1();
@@ -351,7 +352,7 @@ cb_undef (pfile, node)
/* Parse a '\uNNNN' or '\UNNNNNNNN' sequence.
- [lex.charset]: The character designated by the universal-character-name
+ [lex.charset]: The character designated by the universal-character-name
\UNNNNNNNN is that character whose character short name in ISO/IEC 10646
is NNNNNNNN; the character designated by the universal-character-name
\uNNNN is that character whose character short name in ISO/IEC 10646 is
@@ -549,7 +550,7 @@ readescape (p, limit, cptr)
warning ("the meaning of '\\%c' varies with -traditional", c);
return read_ucs (p, limit, cptr, c == 'u' ? 4 : 8);
-
+
case 'e': case 'E':
if (pedantic)
pedwarn ("non-ISO-standard escape sequence, '\\%c'", c);
@@ -600,7 +601,7 @@ is_extended_char (c)
error ("universal-character-name '\\U%08x' not valid in identifier", c);
return 1;
}
-
+
/* Latin */
if ((c >= 0x00c0 && c <= 0x00d6)
|| (c >= 0x00d8 && c <= 0x00f6)
@@ -914,7 +915,7 @@ struct pf_args
REAL_VALUE_TYPE value;
tree type;
};
-
+
static void
parse_float (data)
PTR data;
@@ -962,7 +963,7 @@ parse_float (data)
if (REAL_VALUE_ISINF (args->value) && pedantic)
warning ("floating point number exceeds range of '%s'", typename);
}
-
+
int
c_lex (value)
tree *value;
@@ -992,9 +993,9 @@ c_lex (value)
if (ISGRAPH (tok.val.c))
error ("stray '%c' in program", tok.val.c);
else
- error ("stray '\\%#o' in program", tok.val.c);
+ error ("stray '\\%o' in program", tok.val.c);
goto retry;
-
+
case CPP_NAME:
*value = get_identifier ((const char *)tok.val.node->name);
break;
@@ -1013,7 +1014,6 @@ c_lex (value)
case CPP_STRING:
case CPP_WSTRING:
- case CPP_OSTRING:
*value = lex_string ((const char *)tok.val.str.text,
tok.val.str.len, tok.type == CPP_WSTRING);
break;
@@ -1046,10 +1046,10 @@ lex_number (str, len)
tree value;
const char *p;
enum anon1 { NOT_FLOAT = 0, AFTER_POINT, AFTER_EXPON } floatflag = NOT_FLOAT;
-
+
/* We actually store only HOST_BITS_PER_CHAR bits in each part.
The code below which fills the parts array assumes that a host
- int is at least twice as wide as a host char, and that
+ int is at least twice as wide as a host char, and that
HOST_BITS_PER_WIDE_INT is an even multiple of HOST_BITS_PER_CHAR.
Two HOST_WIDE_INTs is the largest int literal we can store.
In order to detect overflow below, the number of parts (TOTAL_PARTS)
@@ -1057,7 +1057,7 @@ lex_number (str, len)
of two HOST_WIDE_INTs. */
#define TOTAL_PARTS ((HOST_BITS_PER_WIDE_INT / HOST_BITS_PER_CHAR) * 2)
unsigned int parts[TOTAL_PARTS];
-
+
/* Optimize for most frequent case. */
if (len == 1)
{
@@ -1093,9 +1093,7 @@ lex_number (str, len)
if (c == '.')
{
- if (base == 16 && pedantic && !flag_isoc99)
- pedwarn ("floating constant may not be in radix 16");
- else if (floatflag == AFTER_POINT)
+ if (floatflag == AFTER_POINT)
ERROR ("too many decimal points in floating constant");
else if (floatflag == AFTER_EXPON)
ERROR ("decimal point in exponent - impossible!");
@@ -1164,7 +1162,7 @@ lex_number (str, len)
}
/* If the highest-order part overflows (gets larger than
- a host char will hold) then the whole number has
+ a host char will hold) then the whole number has
overflowed. Record this and truncate the highest-order
part. */
if (parts[TOTAL_PARTS - 1] >> HOST_BITS_PER_CHAR)
@@ -1191,6 +1189,9 @@ lex_number (str, len)
struct pf_args args;
char *copy;
+ if (base == 16 && pedantic && !flag_isoc99)
+ pedwarn ("floating constant may not be in radix 16");
+
if (base == 16 && floatflag != AFTER_EXPON)
ERROR ("hexadecimal floating constant has no exponent");
@@ -1272,7 +1273,7 @@ lex_number (str, len)
/* Receive output from parse_float() */
conversion_errno = args.conversion_errno;
type = args.type;
-
+
#ifdef ERANGE
/* ERANGE is also reported for underflow,
so test the value to distinguish overflow from that. */
@@ -1394,9 +1395,9 @@ lex_number (str, len)
? long_unsigned_type_node
: long_integer_type_node);
else if (int_fits_type_p (value,
- spec_unsigned
+ spec_unsigned
? long_long_unsigned_type_node
- : long_long_integer_type_node))
+ : long_long_integer_type_node))
trad_type = (spec_unsigned
? long_long_unsigned_type_node
: long_long_integer_type_node);
@@ -1553,7 +1554,7 @@ lex_string (str, len, wide)
&& (unsigned) c >= ((unsigned)1 << width))
pedwarn ("escape sequence out of range for character");
}
-
+
/* Add this single character into the buffer either as a wchar_t
or as a single byte. */
if (wide)
@@ -1662,7 +1663,7 @@ lex_charconst (str, len, wide)
if (ISPRINT (c))
c = MAP_CHARACTER (c);
#endif
-
+
/* Merge character into result; ignore excess chars. */
num_chars += (width / TYPE_PRECISION (char_type_node));
if (num_chars < max_chars + 1)
diff --git a/gcc/c-lex.h b/gcc/c-lex.h
index bfdc2abfbe7..bd25a16662a 100644
--- a/gcc/c-lex.h
+++ b/gcc/c-lex.h
@@ -27,6 +27,7 @@ extern void position_after_white_space PARAMS ((void));
extern int c_lex PARAMS ((tree *));
extern const char *init_c_lex PARAMS ((const char *));
+extern void save_and_forget_protocol_qualifiers PARAMS ((void));
extern void forget_protocol_qualifiers PARAMS ((void));
extern void remember_protocol_qualifiers PARAMS ((void));
extern tree is_class_name PARAMS ((tree));
diff --git a/gcc/c-parse.in b/gcc/c-parse.in
index 4f1de58772c..04c0792f727 100644
--- a/gcc/c-parse.in
+++ b/gcc/c-parse.in
@@ -263,6 +263,7 @@ end ifobjc
static void yyprint PARAMS ((FILE *, int, YYSTYPE));
static void yyerror PARAMS ((const char *));
+static int yylexname PARAMS ((void));
static inline int _yylex PARAMS ((void));
static int yylex PARAMS ((void));
static void init_reswords PARAMS ((void));
@@ -1780,13 +1781,23 @@ simple_if:
;
if_prefix:
- IF '(' expr ')'
- { c_expand_start_cond (truthvalue_conversion ($3),
- compstmt_count);
+ /* We must build the IF_STMT node before parsing its
+ condition so that STMT_LINENO refers to the line
+ containing the "if", and not the line containing
+ the close-parenthesis.
+
+ c_begin_if_stmt returns the IF_STMT node, which
+ we later pass to c_expand_start_cond to fill
+ in the condition and other tidbits. */
+ IF
+ { $<ttype>$ = c_begin_if_stmt (); }
+ '(' expr ')'
+ { c_expand_start_cond (truthvalue_conversion ($4),
+ compstmt_count,$<ttype>2);
$<itype>$ = stmt_count;
if_stmt_file = $<filename>-2;
if_stmt_line = $<lineno>-1; }
- ;
+ ;
/* This is a subroutine of stmt.
It is used twice, once for valid DO statements
@@ -1881,12 +1892,22 @@ select_or_iter_stmt:
Otherwise a crash is likely. */
| simple_if ELSE error
{ c_expand_end_cond (); }
+ /* We must build the WHILE_STMT node before parsing its
+ condition so that STMT_LINENO refers to the line
+ containing the "while", and not the line containing
+ the close-parenthesis.
+
+ c_begin_while_stmt returns the WHILE_STMT node, which
+ we later pass to c_finish_while_stmt_cond to fill
+ in the condition and other tidbits. */
| WHILE
- { stmt_count++; }
+ { stmt_count++;
+ $<ttype>$ = c_begin_while_stmt (); }
'(' expr ')'
{ $4 = truthvalue_conversion ($4);
- $<ttype>$
- = add_stmt (build_stmt (WHILE_STMT, $4, NULL_TREE)); }
+ c_finish_while_stmt_cond (truthvalue_conversion ($4),
+ $<ttype>2);
+ $<ttype>$ = add_stmt ($<ttype>2); }
c99_block_lineno_labeled_stmt
{ RECHAIN_STMTS ($<ttype>6, WHILE_BODY ($<ttype>6)); }
| do_stmt_start
@@ -2878,7 +2899,6 @@ struct resword
#define D_EXT 0x04 /* GCC extension */
#define D_EXT89 0x08 /* GCC extension incorporated in C99 */
#define D_OBJC 0x10 /* Objective C only */
-#define D_YES 0x20 /* always starts disabled */
static const struct resword reswords[] =
{
@@ -2971,12 +2991,12 @@ ifobjc
{ "@public", RID_AT_PUBLIC, D_OBJC },
{ "@selector", RID_AT_SELECTOR, D_OBJC },
{ "id", RID_ID, D_OBJC },
- { "bycopy", RID_BYCOPY, D_OBJC|D_YES },
- { "byref", RID_BYREF, D_OBJC|D_YES },
- { "in", RID_IN, D_OBJC|D_YES },
- { "inout", RID_INOUT, D_OBJC|D_YES },
- { "oneway", RID_ONEWAY, D_OBJC|D_YES },
- { "out", RID_OUT, D_OBJC|D_YES },
+ { "bycopy", RID_BYCOPY, D_OBJC },
+ { "byref", RID_BYREF, D_OBJC },
+ { "in", RID_IN, D_OBJC },
+ { "inout", RID_INOUT, D_OBJC },
+ { "oneway", RID_ONEWAY, D_OBJC },
+ { "out", RID_OUT, D_OBJC },
end ifobjc
};
#define N_reswords (sizeof reswords / sizeof (struct resword))
@@ -3115,6 +3135,13 @@ static const short rid_to_yy[RID_MAX] =
/* RID_AT_IMPLEMENTATION */ IMPLEMENTATION
};
+ifobjc
+/* Lookup table for ObjC keywords beginning with '@'. Crude but
+ hopefully effective. */
+#define N_at_reswords ((int) RID_AT_IMPLEMENTATION - (int)RID_AT_ENCODE + 1)
+static tree objc_rid_sans_at[N_at_reswords];
+end ifobjc
+
static void
init_reswords ()
{
@@ -3138,14 +3165,22 @@ init_reswords ()
id = get_identifier (reswords[i].word);
C_RID_CODE (id) = reswords[i].rid;
+ C_IS_RESERVED_WORD (id) = 1;
ridpointers [(int) reswords[i].rid] = id;
- /* Objective C does tricky things with enabling and disabling
- keywords. So these we must not elide in the test above, but
- wait and not mark them reserved now. */
- if (! (reswords[i].disable & D_YES))
- C_IS_RESERVED_WORD (id) = 1;
+ifobjc
+ /* Enter ObjC @-prefixed keywords into the "sans" table
+ _without_ their leading at-sign. Again, all these
+ identifiers are reachable by the get_identifer table, so it's
+ not necessary to make objc_rid_sans_at a GC root. */
+ if (reswords[i].word[0] == '@')
+ objc_rid_sans_at[(int) reswords[i].rid - (int) RID_AT_ENCODE]
+ = get_identifier (reswords[i].word + 1);
+end ifobjc
}
+ifobjc
+ save_and_forget_protocol_qualifiers ();
+end ifobjc
}
const char *
@@ -3191,8 +3226,7 @@ yyerror (msgid)
error ("%s before %s'\\x%x'", string, ell, val);
}
else if (last_token == CPP_STRING
- || last_token == CPP_WSTRING
- || last_token == CPP_OSTRING)
+ || last_token == CPP_WSTRING)
error ("%s before string constant", string);
else if (last_token == CPP_NUMBER
|| last_token == CPP_INT
@@ -3204,12 +3238,68 @@ yyerror (msgid)
error ("%s before '%s' token", string, NAME(last_token));
}
+static int
+yylexname ()
+{
+ tree decl;
+
+ if (C_IS_RESERVED_WORD (yylval.ttype))
+ {
+ enum rid rid_code = C_RID_CODE (yylval.ttype);
+ /* Return the canonical spelling for this keyword. */
+ yylval.ttype = ridpointers[(int) rid_code];
+ return rid_to_yy[(int) rid_code];
+ }
+
+ decl = lookup_name (yylval.ttype);
+ if (decl)
+ {
+ if (TREE_CODE (decl) == TYPE_DECL)
+ return TYPENAME;
+ /* A user-invisible read-only initialized variable
+ should be replaced by its value.
+ We handle only strings since that's the only case used in C. */
+ else if (TREE_CODE (decl) == VAR_DECL
+ && DECL_IGNORED_P (decl)
+ && TREE_READONLY (decl)
+ && DECL_INITIAL (decl) != 0
+ && TREE_CODE (DECL_INITIAL (decl)) == STRING_CST)
+ {
+ tree stringval = DECL_INITIAL (decl), str;
+
+ /* Copy the string value so that we won't clobber anything
+ if we put something in the TREE_CHAIN of this one. */
+ str = build_string (TREE_STRING_LENGTH (stringval),
+ TREE_STRING_POINTER (stringval));
+ if (yylval.ttype != func_id_node)
+ C_ARTIFICIAL_STRING_P (str) = 1;
+ yylval.ttype = str;
+ return STRING;
+ }
+ }
+ else if (doing_objc_thang)
+ {
+ tree objc_interface_decl = is_class_name (yylval.ttype);
+
+ if (objc_interface_decl)
+ {
+ yylval.ttype = objc_interface_decl;
+ return CLASSNAME;
+ }
+ }
+
+ return IDENTIFIER;
+}
+
+
static inline int
_yylex ()
{
- retry:
+ get_next:
last_token = c_lex (&yylval.ttype);
-
+ifobjc
+ reconsider:
+end ifobjc
switch (last_token)
{
case CPP_EQ: return '=';
@@ -3266,63 +3356,10 @@ _yylex ()
case CPP_EOF:
if (cpp_pop_buffer (parse_in) == 0)
return 0;
- goto retry;
+ goto get_next;
case CPP_NAME:
- if (C_IS_RESERVED_WORD (yylval.ttype))
- {
- enum rid rid_code = C_RID_CODE (yylval.ttype);
- /* Return the canonical spelling for this keyword. */
- yylval.ttype = ridpointers[(int) rid_code];
- return rid_to_yy[(int) rid_code];
- }
-
- if (IDENTIFIER_POINTER (yylval.ttype)[0] == '@')
- {
- error ("invalid identifier `%s'", IDENTIFIER_POINTER (yylval.ttype));
- return IDENTIFIER;
- }
-
- {
- tree decl;
-
- decl = lookup_name (yylval.ttype);
-
- if (decl)
- {
- if (TREE_CODE (decl) == TYPE_DECL)
- return TYPENAME;
- /* A user-invisible read-only initialized variable
- should be replaced by its value.
- We handle only strings since that's the only case used in C. */
- else if (TREE_CODE (decl) == VAR_DECL
- && DECL_IGNORED_P (decl)
- && TREE_READONLY (decl)
- && DECL_INITIAL (decl) != 0
- && TREE_CODE (DECL_INITIAL (decl)) == STRING_CST)
- {
- tree stringval = DECL_INITIAL (decl);
-
- /* Copy the string value so that we won't clobber anything
- if we put something in the TREE_CHAIN of this one. */
- yylval.ttype = build_string (TREE_STRING_LENGTH (stringval),
- TREE_STRING_POINTER (stringval));
- return STRING;
- }
- }
- else if (doing_objc_thang)
- {
- tree objc_interface_decl = is_class_name (yylval.ttype);
-
- if (objc_interface_decl)
- {
- yylval.ttype = objc_interface_decl;
- return CLASSNAME;
- }
- }
-
- return IDENTIFIER;
- }
+ return yylexname ();
case CPP_INT:
case CPP_FLOAT:
@@ -3335,9 +3372,27 @@ _yylex ()
case CPP_WSTRING:
return STRING;
- case CPP_OSTRING:
- return OBJC_STRING;
-
+ /* This token is Objective-C specific. It gives the next
+ token special significance. */
+ case CPP_ATSIGN:
+ifobjc
+ last_token = c_lex (&yylval.ttype);
+ if (last_token == CPP_STRING)
+ return OBJC_STRING;
+ else if (last_token == CPP_NAME)
+ {
+ int i;
+ for (i = 0; i < N_at_reswords; i++)
+ if (objc_rid_sans_at[i] == yylval.ttype)
+ {
+ int rid_code = i + (int) RID_AT_ENCODE;
+ yylval.ttype = ridpointers[rid_code];
+ return rid_to_yy[rid_code];
+ }
+ }
+ error ("syntax error at '@' token");
+ goto reconsider;
+end ifobjc
/* These tokens are C++ specific (and will not be generated
in C mode, but let's be cautious). */
case CPP_SCOPE:
@@ -3350,13 +3405,12 @@ _yylex ()
/* These tokens should not survive translation phase 4. */
case CPP_HASH:
case CPP_PASTE:
- error ("syntax error before '%s' token", NAME(last_token));
- goto retry;
+ error ("syntax error at '%s' token", NAME(last_token));
+ goto get_next;
default:
abort ();
}
-
/* NOTREACHED */
}
diff --git a/gcc/c-pragma.c b/gcc/c-pragma.c
index 8be3a6b0654..f0c2b4012e3 100644
--- a/gcc/c-pragma.c
+++ b/gcc/c-pragma.c
@@ -2,22 +2,22 @@
Copyright (C) 1992, 1997, 1998, 1999, 2000, 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
-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.
+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,
-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.
+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
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
+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. */
#include "config.h"
#include "system.h"
@@ -30,10 +30,11 @@ Boston, MA 02111-1307, USA. */
#include "toplev.h"
#include "ggc.h"
#include "c-lex.h"
+#include "output.h"
#include "tm_p.h"
-#define BAD(msgid) do { warning (msgid); return; } while (0)
-#define BAD2(msgid, arg) do { warning (msgid, arg); return; } while (0)
+#define GCC_BAD(msgid) do { warning (msgid); return; } while (0)
+#define GCC_BAD2(msgid, arg) do { warning (msgid, arg); return; } while (0)
#ifdef HANDLE_PRAGMA_PACK
static void handle_pragma_pack PARAMS ((cpp_reader *));
@@ -53,7 +54,7 @@ static struct align_stack * alignment_stack = NULL;
#pragma pack(push,<n>) is encountered, this stores the value of
maximum_field_alignment in effect. When the final pop_alignment()
happens, we restore the value to this, not to a value of 0 for
- maximum_field_alignment. Value is in bits. */
+ maximum_field_alignment. Value is in bits. */
static int default_alignment;
#define SET_GLOBAL_ALIGNMENT(ALIGN) \
(default_alignment = maximum_field_alignment = (ALIGN))
@@ -84,7 +85,7 @@ push_alignment (alignment, id)
/* The current value of maximum_field_alignment is not necessarily
0 since there may be a #pragma pack(<n>) in effect; remember it
- so that we can restore it after the final #pragma pop(). */
+ so that we can restore it after the final #pragma pop(). */
if (alignment_stack == NULL)
default_alignment = maximum_field_alignment;
@@ -158,9 +159,9 @@ mark_align_stack (p)
#else /* not HANDLE_PRAGMA_PACK_PUSH_POP */
#define SET_GLOBAL_ALIGNMENT(ALIGN) (maximum_field_alignment = (ALIGN))
#define push_alignment(ID, N) \
- BAD("#pragma pack(push[, id], <n>) is not supported on this target")
+ GCC_BAD("#pragma pack(push[, id], <n>) is not supported on this target")
#define pop_alignment(ID) \
- BAD("#pragma pack(pop[, id], <n>) is not supported on this target")
+ GCC_BAD("#pragma pack(pop[, id], <n>) is not supported on this target")
#endif /* HANDLE_PRAGMA_PACK_PUSH_POP */
/* #pragma pack ()
@@ -180,7 +181,7 @@ handle_pragma_pack (dummy)
enum { set, push, pop } action;
if (c_lex (&x) != CPP_OPEN_PAREN)
- BAD ("missing '(' after '#pragma pack' - ignored");
+ GCC_BAD ("missing '(' after '#pragma pack' - ignored");
token = c_lex (&x);
if (token == CPP_CLOSE_PAREN)
@@ -193,14 +194,14 @@ handle_pragma_pack (dummy)
align = TREE_INT_CST_LOW (x);
action = set;
if (c_lex (&x) != CPP_CLOSE_PAREN)
- BAD ("malformed '#pragma pack' - ignored");
+ GCC_BAD ("malformed '#pragma pack' - ignored");
}
else if (token == CPP_NAME)
{
-#define BAD_ACTION do { if (action == push) \
- BAD ("malformed '#pragma pack(push[, id], <n>)' - ignored"); \
+#define GCC_BAD_ACTION do { if (action == push) \
+ GCC_BAD ("malformed '#pragma pack(push[, id], <n>)' - ignored"); \
else \
- BAD ("malformed '#pragma pack(pop[, id])' - ignored"); \
+ GCC_BAD ("malformed '#pragma pack(pop[, id])' - ignored"); \
} while (0)
const char *op = IDENTIFIER_POINTER (x);
@@ -209,11 +210,11 @@ handle_pragma_pack (dummy)
else if (!strcmp (op, "pop"))
action = pop;
else
- BAD2 ("unknown action '%s' for '#pragma pack' - ignored", op);
+ GCC_BAD2 ("unknown action '%s' for '#pragma pack' - ignored", op);
token = c_lex (&x);
if (token != CPP_COMMA && action == push)
- BAD_ACTION;
+ GCC_BAD_ACTION;
if (token == CPP_COMMA)
{
@@ -222,7 +223,7 @@ handle_pragma_pack (dummy)
{
id = x;
if (action == push && c_lex (&x) != CPP_COMMA)
- BAD_ACTION;
+ GCC_BAD_ACTION;
token = c_lex (&x);
}
@@ -234,16 +235,16 @@ handle_pragma_pack (dummy)
token = c_lex (&x);
}
else
- BAD_ACTION;
+ GCC_BAD_ACTION;
}
}
if (token != CPP_CLOSE_PAREN)
- BAD_ACTION;
-#undef BAD_ACTION
+ GCC_BAD_ACTION;
+#undef GCC_BAD_ACTION
}
else
- BAD ("malformed '#pragma pack' - ignored");
+ GCC_BAD ("malformed '#pragma pack' - ignored");
if (c_lex (&x) != CPP_EOF)
warning ("junk at end of '#pragma pack'");
@@ -260,7 +261,7 @@ handle_pragma_pack (dummy)
align *= BITS_PER_UNIT;
break;
default:
- BAD2 ("alignment must be a small power of two, not %d", align);
+ GCC_BAD2 ("alignment must be a small power of two, not %d", align);
}
switch (action)
@@ -286,12 +287,12 @@ handle_pragma_weak (dummy)
value = 0;
if (c_lex (&name) != CPP_NAME)
- BAD ("malformed #pragma weak, ignored");
+ GCC_BAD ("malformed #pragma weak, ignored");
t = c_lex (&x);
if (t == CPP_EQ)
{
if (c_lex (&value) != CPP_NAME)
- BAD ("malformed #pragma weak, ignored");
+ GCC_BAD ("malformed #pragma weak, ignored");
t = c_lex (&x);
}
if (t != CPP_EOF)
diff --git a/gcc/c-pragma.h b/gcc/c-pragma.h
index 5e867452315..a28262e2d5a 100644
--- a/gcc/c-pragma.h
+++ b/gcc/c-pragma.h
@@ -1,5 +1,5 @@
/* Pragma related interfaces.
- Copyright (C) 1995, 1998, 1999, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1995, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -22,9 +22,9 @@ Boston, MA 02111-1307, USA. */
#define _C_PRAGMA_H
#ifdef HANDLE_SYSV_PRAGMA
-/* Support #pragma weak iff ASM_WEAKEN_LABEL and ASM_OUTPUT_DEF are
+/* Support #pragma weak iff ASM_WEAKEN_LABEL and ASM_OUTPUT_WEAK_ALIAS are
defined. */
-#if defined (ASM_WEAKEN_LABEL) && defined (ASM_OUTPUT_DEF)
+#if defined (ASM_WEAKEN_LABEL) && defined (ASM_OUTPUT_WEAK_ALIAS)
#define HANDLE_PRAGMA_WEAK SUPPORTS_WEAK
#endif
diff --git a/gcc/c-semantics.c b/gcc/c-semantics.c
index d6477f6eb4f..26e1c3d70c5 100644
--- a/gcc/c-semantics.c
+++ b/gcc/c-semantics.c
@@ -61,6 +61,7 @@ begin_stmt_tree (t)
*t = build_nt (EXPR_STMT, void_zero_node);
last_tree = *t;
last_expr_type = NULL_TREE;
+ last_expr_filename = input_filename;
}
/* T is a statement. Add it to the statement-tree. */
@@ -69,12 +70,30 @@ tree
add_stmt (t)
tree t;
{
+ if (input_filename != last_expr_filename)
+ {
+ /* If the filename has changed, also add in a FILE_STMT. Do a string
+ compare first, though, as it might be an equivalent string. */
+ int add = (strcmp (input_filename, last_expr_filename) != 0);
+ last_expr_filename = input_filename;
+ if (add)
+ {
+ tree pos = build_nt (FILE_STMT, get_identifier (input_filename));
+ add_stmt (pos);
+ }
+ }
+
/* 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-expresions. We record that fact here. */
STMT_IS_FULL_EXPR_P (last_tree) = stmts_are_full_exprs_p ();
+
+ /* Keep track of the number of statements in this function. */
+ if (current_function_decl)
+ ++DECL_NUM_STMTS (current_function_decl);
+
return t;
}
@@ -313,7 +332,7 @@ emit_local_var (decl)
tree decl;
{
/* Create RTL for this variable. */
- if (!DECL_RTL (decl))
+ if (!DECL_RTL_SET_P (decl))
{
if (DECL_C_HARD_REGISTER (decl))
/* The user specified an assembler name for this variable.
@@ -468,7 +487,7 @@ genrtl_while_stmt (t)
cond = expand_cond (WHILE_COND (t));
emit_line_note (input_filename, lineno);
- expand_exit_loop_if_false (0, cond);
+ expand_exit_loop_top_cond (0, cond);
genrtl_do_pushlevel ();
expand_stmt (WHILE_BODY (t));
@@ -568,7 +587,7 @@ genrtl_for_stmt (t)
/* Expand the condition. */
emit_line_note (input_filename, lineno);
if (cond)
- expand_exit_loop_if_false (0, cond);
+ expand_exit_loop_top_cond (0, cond);
/* Expand the body. */
genrtl_do_pushlevel ();
@@ -626,11 +645,12 @@ void
genrtl_scope_stmt (t)
tree t;
{
+ tree block = SCOPE_STMT_BLOCK (t);
+
if (!SCOPE_NO_CLEANUPS_P (t))
{
if (SCOPE_BEGIN_P (t))
- expand_start_bindings_and_block (2 * SCOPE_NULLIFIED_P (t),
- SCOPE_STMT_BLOCK (t));
+ expand_start_bindings_and_block (2 * SCOPE_NULLIFIED_P (t), block);
else if (SCOPE_END_P (t))
expand_end_bindings (NULL_TREE, !SCOPE_NULLIFIED_P (t), 0);
}
@@ -640,7 +660,27 @@ genrtl_scope_stmt (t)
(SCOPE_BEGIN_P (t)
? NOTE_INSN_BLOCK_BEG
: NOTE_INSN_BLOCK_END));
- NOTE_BLOCK (note) = SCOPE_STMT_BLOCK (t);
+ NOTE_BLOCK (note) = block;
+ }
+
+ /* If we're at the end of a scope that contains inlined nested
+ functions, we have to decide whether or not to write them out. */
+ if (block && SCOPE_END_P (t))
+ {
+ tree fn;
+
+ for (fn = BLOCK_VARS (block); fn; fn = TREE_CHAIN (fn))
+ {
+ if (TREE_CODE (fn) == FUNCTION_DECL
+ && DECL_CONTEXT (fn) == current_function_decl
+ && !TREE_ASM_WRITTEN (fn)
+ && TREE_ADDRESSABLE (fn))
+ {
+ push_function_context ();
+ output_inline_function (fn);
+ pop_function_context ();
+ }
+ }
}
}
@@ -782,6 +822,10 @@ expand_stmt (t)
switch (TREE_CODE (t))
{
+ case FILE_STMT:
+ input_filename = FILE_STMT_FILENAME (t);
+ break;
+
case RETURN_STMT:
genrtl_return_stmt (t);
break;
diff --git a/gcc/c-tree.h b/gcc/c-tree.h
index 939ca3fafed..ce0e0bab000 100644
--- a/gcc/c-tree.h
+++ b/gcc/c-tree.h
@@ -42,12 +42,15 @@ struct lang_identifier
enum rid rid_code;
};
-/* Wrapping c_lang_decl in another struct is an unfortunate
- necessity. */
+/* Language-specific declaration information. */
struct lang_decl
{
struct c_lang_decl base;
+ /* The return types and parameter types may have variable size.
+ This is a list of any SAVE_EXPRs that need to be evaluated to
+ compute those sizes. */
+ tree pending_sizes;
};
/* Macros for access to language-specific slots in an identifier. */
diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c
index 1ff44d21369..68a6895dace 100644
--- a/gcc/c-typeck.c
+++ b/gcc/c-typeck.c
@@ -508,6 +508,8 @@ comptypes (type1, type2)
{
tree d1 = TYPE_DOMAIN (t1);
tree d2 = TYPE_DOMAIN (t2);
+ bool d1_variable, d2_variable;
+ bool d1_zero, d2_zero;
val = 1;
/* Target types must match incl. qualifiers. */
@@ -516,14 +518,25 @@ comptypes (type1, type2)
return 0;
/* Sizes must match unless one is missing or variable. */
- if (d1 == 0 || d2 == 0 || d1 == d2
- || TREE_CODE (TYPE_MIN_VALUE (d1)) != INTEGER_CST
- || TREE_CODE (TYPE_MIN_VALUE (d2)) != INTEGER_CST
- || TREE_CODE (TYPE_MAX_VALUE (d1)) != INTEGER_CST
- || TREE_CODE (TYPE_MAX_VALUE (d2)) != INTEGER_CST)
+ if (d1 == 0 || d2 == 0 || d1 == d2)
break;
- if (! tree_int_cst_equal (TYPE_MIN_VALUE (d1), TYPE_MIN_VALUE (d2))
+ d1_zero = ! TYPE_MAX_VALUE (d1);
+ d2_zero = ! TYPE_MAX_VALUE (d2);
+
+ d1_variable = (! d1_zero
+ && (TREE_CODE (TYPE_MIN_VALUE (d1)) != INTEGER_CST
+ || TREE_CODE (TYPE_MAX_VALUE (d1)) != INTEGER_CST));
+ d2_variable = (! d2_zero
+ && (TREE_CODE (TYPE_MIN_VALUE (d2)) != INTEGER_CST
+ || TREE_CODE (TYPE_MAX_VALUE (d2)) != INTEGER_CST));
+
+ if (d1_variable || d2_variable)
+ break;
+ if (d1_zero && d2_zero)
+ break;
+ if (d1_zero || d2_zero
+ || ! tree_int_cst_equal (TYPE_MIN_VALUE (d1), TYPE_MIN_VALUE (d2))
|| ! tree_int_cst_equal (TYPE_MAX_VALUE (d1), TYPE_MAX_VALUE (d2)))
val = 0;
@@ -651,7 +664,8 @@ type_lists_compatible_p (args1, args2)
if (simple_type_promotes_to (TREE_VALUE (args1)) != NULL_TREE)
return 0;
}
- else if (! (newval = comptypes (TREE_VALUE (args1), TREE_VALUE (args2))))
+ else if (! (newval = comptypes (TYPE_MAIN_VARIANT (TREE_VALUE (args1)),
+ TYPE_MAIN_VARIANT (TREE_VALUE (args2)))))
{
/* Allow wait (union {union wait *u; int *i} *)
and wait (union wait *) to be compatible. */
@@ -954,14 +968,14 @@ default_conversion (exp)
if (TREE_CODE (exp) == COMPONENT_REF
&& DECL_C_BIT_FIELD (TREE_OPERAND (exp, 1))
/* If it's thinner than an int, promote it like a
- C_PROMOTING_INTEGER_TYPE_P, otherwise leave it alone. */
+ c_promoting_integer_type_p, otherwise leave it alone. */
&& 0 > compare_tree_int (DECL_SIZE (TREE_OPERAND (exp, 1)),
TYPE_PRECISION (integer_type_node)))
return convert (flag_traditional && TREE_UNSIGNED (type)
? unsigned_type_node : integer_type_node,
exp);
- if (C_PROMOTING_INTEGER_TYPE_P (type))
+ if (c_promoting_integer_type_p (type))
{
/* Traditionally, unsignedness is preserved in default promotions.
Also preserve unsignedness if not really getting any wider. */
@@ -973,9 +987,6 @@ default_conversion (exp)
return convert (integer_type_node, exp);
}
- if (code == BOOLEAN_TYPE)
- return convert (integer_type_node, exp);
-
if (flag_traditional && !flag_allow_single_precision
&& TYPE_MAIN_VARIANT (type) == float_type_node)
return convert (double_type_node, exp);
@@ -1676,19 +1687,25 @@ convert_arguments (typelist, values, name, fundecl)
{
/* Optionally warn about conversions that
differ from the default conversions. */
- if (warn_conversion)
+ if (warn_conversion || warn_traditional)
{
int formal_prec = TYPE_PRECISION (type);
if (INTEGRAL_TYPE_P (type)
&& TREE_CODE (TREE_TYPE (val)) == REAL_TYPE)
warn_for_assignment ("%s as integer rather than floating due to prototype", (char *) 0, name, parmnum + 1);
+ if (INTEGRAL_TYPE_P (type)
+ && TREE_CODE (TREE_TYPE (val)) == COMPLEX_TYPE)
+ warn_for_assignment ("%s as integer rather than complex due to prototype", (char *) 0, name, parmnum + 1);
else if (TREE_CODE (type) == COMPLEX_TYPE
&& TREE_CODE (TREE_TYPE (val)) == REAL_TYPE)
warn_for_assignment ("%s as complex rather than floating due to prototype", (char *) 0, name, parmnum + 1);
else if (TREE_CODE (type) == REAL_TYPE
&& INTEGRAL_TYPE_P (TREE_TYPE (val)))
warn_for_assignment ("%s as floating rather than integer due to prototype", (char *) 0, name, parmnum + 1);
+ else if (TREE_CODE (type) == COMPLEX_TYPE
+ && INTEGRAL_TYPE_P (TREE_TYPE (val)))
+ warn_for_assignment ("%s as complex rather than integer due to prototype", (char *) 0, name, parmnum + 1);
else if (TREE_CODE (type) == REAL_TYPE
&& TREE_CODE (TREE_TYPE (val)) == COMPLEX_TYPE)
warn_for_assignment ("%s as floating rather than complex due to prototype", (char *) 0, name, parmnum + 1);
@@ -1703,8 +1720,10 @@ convert_arguments (typelist, values, name, fundecl)
if (formal_prec == TYPE_PRECISION (float_type_node))
warn_for_assignment ("%s as `float' rather than `double' due to prototype", (char *) 0, name, parmnum + 1);
}
- /* Detect integer changing in width or signedness. */
- else if (INTEGRAL_TYPE_P (type)
+ /* Detect integer changing in width or signedness.
+ These warnings are only activated with
+ -Wconversion, not with -Wtraditional. */
+ else if (warn_conversion && INTEGRAL_TYPE_P (type)
&& INTEGRAL_TYPE_P (TREE_TYPE (val)))
{
tree would_have_been = default_conversion (val);
@@ -1761,9 +1780,7 @@ convert_arguments (typelist, values, name, fundecl)
fundecl, name, parmnum + 1);
if (PROMOTE_PROTOTYPES
- && (TREE_CODE (type) == INTEGER_TYPE
- || TREE_CODE (type) == ENUMERAL_TYPE
- || TREE_CODE (type) == BOOLEAN_TYPE)
+ && INTEGRAL_TYPE_P (type)
&& (TYPE_PRECISION (type) < TYPE_PRECISION (integer_type_node)))
parmval = default_conversion (parmval);
}
@@ -4675,6 +4692,8 @@ digest_init (type, init, require_constant, constructor_constant)
if (TREE_CODE (init) == NON_LVALUE_EXPR)
inside_init = TREE_OPERAND (init, 0);
+ inside_init = fold (inside_init);
+
/* Initialization of an array of chars from a string constant
optionally enclosed in braces. */
@@ -4770,14 +4789,21 @@ digest_init (type, init, require_constant, constructor_constant)
if (flag_pedantic_errors)
inside_init = error_mark_node;
}
- else if (require_constant && ! TREE_CONSTANT (inside_init))
+ else if (require_constant
+ && (!TREE_CONSTANT (inside_init)
+ /* This test catches things like `7 / 0' which
+ result in an expression for which TREE_CONSTANT
+ is true, but which is not actually something
+ that is a legal constant. We really should not
+ be using this function, because it is a part of
+ the back-end. Instead, the expression should
+ already have been turned into ERROR_MARK_NODE. */
+ || !initializer_constant_valid_p (inside_init,
+ TREE_TYPE (inside_init))))
{
error_init ("initializer element is not constant");
inside_init = error_mark_node;
}
- else if (require_constant
- && initializer_constant_valid_p (inside_init, TREE_TYPE (inside_init)) == 0)
- pedwarn ("initializer element is not computable at load time");
return inside_init;
}
@@ -7023,8 +7049,7 @@ c_start_case (exp)
code = TREE_CODE (TREE_TYPE (exp));
type = TREE_TYPE (exp);
- if (code != INTEGER_TYPE
- && code != ENUMERAL_TYPE
+ if (! INTEGRAL_TYPE_P (type)
&& code != ERROR_MARK)
{
error ("switch quantity not an integer");
diff --git a/gcc/calls.c b/gcc/calls.c
index 9c77b879701..3c20fa3d6d8 100644
--- a/gcc/calls.c
+++ b/gcc/calls.c
@@ -27,26 +27,12 @@ Boston, MA 02111-1307, USA. */
#include "expr.h"
#include "function.h"
#include "regs.h"
-#include "insn-flags.h"
#include "toplev.h"
#include "output.h"
#include "tm_p.h"
#include "timevar.h"
#include "sbitmap.h"
-#ifndef ACCUMULATE_OUTGOING_ARGS
-#define ACCUMULATE_OUTGOING_ARGS 0
-#endif
-
-/* Supply a default definition for PUSH_ARGS. */
-#ifndef PUSH_ARGS
-#ifdef PUSH_ROUNDING
-#define PUSH_ARGS !ACCUMULATE_OUTGOING_ARGS
-#else
-#define PUSH_ARGS 0
-#endif
-#endif
-
#if !defined FUNCTION_OK_FOR_SIBCALL
#define FUNCTION_OK_FOR_SIBCALL(DECL) 1
#endif
@@ -218,7 +204,6 @@ static void compute_argument_addresses PARAMS ((struct arg_data *,
static rtx rtx_for_function_call PARAMS ((tree, tree));
static void load_register_parameters PARAMS ((struct arg_data *,
int, rtx *, int));
-static int libfunc_nothrow PARAMS ((rtx));
static rtx emit_library_call_value_1 PARAMS ((int, rtx, rtx,
enum libcall_type,
enum machine_mode,
@@ -2384,8 +2369,8 @@ expand_call (exp, target, ignore)
args = (struct arg_data *) alloca (num_actuals * sizeof (struct arg_data));
memset ((char *) args, 0, num_actuals * sizeof (struct arg_data));
- /* Build up entries inthe ARGS array, compute the size of the arguments
- into ARGS_SIZE, etc. */
+ /* Build up entries in the ARGS array, compute the size of the
+ arguments into ARGS_SIZE, etc. */
initialize_argument_information (num_actuals, args, &args_size,
n_named_args, actparms, fndecl,
&args_so_far, reg_parm_stack_space,
@@ -2526,8 +2511,9 @@ expand_call (exp, target, ignore)
{
tree var = build_decl (VAR_DECL, NULL_TREE,
TREE_TYPE (args[i].tree_value));
- DECL_RTL (var) = expand_expr (args[i].tree_value, NULL_RTX,
- VOIDmode, EXPAND_NORMAL);
+ SET_DECL_RTL (var,
+ expand_expr (args[i].tree_value, NULL_RTX,
+ VOIDmode, EXPAND_NORMAL));
args[i].tree_value = var;
}
break;
@@ -3457,25 +3443,9 @@ expand_call (exp, target, ignore)
return target;
}
-/* Returns nonzero if FUN is the symbol for a library function which can
- not throw. */
-
-static int
-libfunc_nothrow (fun)
- rtx fun;
-{
- if (fun == throw_libfunc
- || fun == rethrow_libfunc
- || fun == sjthrow_libfunc
- || fun == sjpopnthrow_libfunc)
- return 0;
-
- return 1;
-}
-
/* Output a library call to function FUN (a SYMBOL_REF rtx).
The RETVAL parameter specifies whether return value needs to be saved, other
- parameters are documented in the emit_library_call function bellow. */
+ 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;
@@ -3514,9 +3484,10 @@ emit_library_call_value_1 (retval, orgfun, value, fn_type, outmode, nargs, p)
rtx valreg;
int pcc_struct_value = 0;
int struct_value_size = 0;
- int flags = 0;
+ int flags;
int reg_parm_stack_space = 0;
int needed;
+ rtx before_call;
#ifdef REG_PARM_STACK_SPACE
/* Define the boundary of the register parm stack space that needs to be
@@ -3537,14 +3508,30 @@ emit_library_call_value_1 (retval, orgfun, value, fn_type, outmode, nargs, p)
#endif
#endif
- if (fn_type == LCT_CONST_MAKE_BLOCK)
- flags |= ECF_CONST;
- else if (fn_type == LCT_PURE_MAKE_BLOCK)
- flags |= ECF_PURE;
- fun = orgfun;
+ /* By default, library functions can not throw. */
+ flags = ECF_NOTHROW;
- if (libfunc_nothrow (fun))
- flags |= ECF_NOTHROW;
+ switch (fn_type)
+ {
+ case LCT_NORMAL:
+ case LCT_CONST:
+ case LCT_PURE:
+ /* Nothing to do here. */
+ break;
+ case LCT_CONST_MAKE_BLOCK:
+ flags |= ECF_CONST;
+ break;
+ case LCT_PURE_MAKE_BLOCK:
+ flags |= ECF_PURE;
+ break;
+ case LCT_NORETURN:
+ flags |= ECF_NORETURN;
+ break;
+ case LCT_THROW:
+ flags = ECF_NORETURN;
+ break;
+ }
+ fun = orgfun;
#ifdef PREFERRED_STACK_BOUNDARY
/* Ensure current function's preferred stack boundary is at least
@@ -4054,6 +4041,8 @@ emit_library_call_value_1 (retval, orgfun, value, fn_type, outmode, nargs, p)
abort ();
#endif
+ before_call = get_last_insn ();
+
/* We pass the old value of inhibit_defer_pop + 1 to emit_call_1, which
will set inhibit_defer_pop to that value. */
/* The return type is needed to decide how many bytes the function pops.
@@ -4071,6 +4060,34 @@ emit_library_call_value_1 (retval, orgfun, value, fn_type, outmode, nargs, p)
valreg,
old_inhibit_defer_pop + 1, call_fusage, flags);
+ /* For calls to `setjmp', etc., inform flow.c it should complain
+ if nonvolatile values are live. For functions that cannot return,
+ inform flow that control does not fall through. */
+
+ if (flags & (ECF_RETURNS_TWICE | ECF_NORETURN | ECF_LONGJMP))
+ {
+ /* The barrier or NOTE_INSN_SETJMP note must be emitted
+ immediately after the CALL_INSN. Some ports emit more than
+ just a CALL_INSN above, so we must search for it here. */
+
+ rtx last = get_last_insn ();
+ while (GET_CODE (last) != CALL_INSN)
+ {
+ last = PREV_INSN (last);
+ /* There was no CALL_INSN? */
+ if (last == before_call)
+ abort ();
+ }
+
+ if (flags & ECF_RETURNS_TWICE)
+ {
+ emit_note_after (NOTE_INSN_SETJMP, last);
+ current_function_calls_setjmp = 1;
+ }
+ else
+ emit_barrier_after (last);
+ }
+
/* Now restore inhibit_defer_pop to its actual original value. */
OK_DEFER_POP;
@@ -4593,10 +4610,10 @@ store_one_arg (arg, argblock, flags, variable_size, reg_parm_stack_space)
{
rtx size_rtx1 = GEN_INT (reg_parm_stack_space - arg->offset.constant);
emit_push_insn (arg->value, arg->mode, TREE_TYPE (pval), size_rtx1,
- TYPE_ALIGN (TREE_TYPE (pval)) / BITS_PER_UNIT,
- partial, reg, excess, argblock,
- ARGS_SIZE_RTX (arg->offset), reg_parm_stack_space,
- ARGS_SIZE_RTX (arg->alignment_pad));
+ TYPE_ALIGN (TREE_TYPE (pval)), partial, reg,
+ excess, argblock, ARGS_SIZE_RTX (arg->offset),
+ reg_parm_stack_space,
+ ARGS_SIZE_RTX (arg->alignment_pad));
size_rtx = GEN_INT (INTVAL(size_rtx) - reg_parm_stack_space);
}
diff --git a/gcc/ch/ChangeLog b/gcc/ch/ChangeLog
deleted file mode 100644
index 8356aa22a4a..00000000000
--- a/gcc/ch/ChangeLog
+++ /dev/null
@@ -1,12190 +0,0 @@
-Sun Feb 4 15:52:44 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * convert.c (convert): Call abort instead of fatal.
- * except.c (pop_handler, chill_check_no_handlers): Likewise.
- * expr.c (chill_expand_expr): Likewise.
- * parse.c (peek_token_, pushback_token, require): Likewise.
- * grant.c (write_grant_file): Call fatal_io_error instead of
- pfatal_with_name.
- * lex.c (init_parse, same_file, yywrap): Likewise.
- * lang.c (GNU_xref_begin, GNU_xref_end): Deleted.
- * lex.c (convert_bitstring): Delete check for alloca failure.
-
-2001-01-28 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * ch-tree.h (integer_minus_one_node): Moved to top level gcc
- directory.
-
- * decl.c (integer_minus_one_node): Likewise.
- (init_decl_processing): Don't set integer_minus_one_node.
-
-2001-01-27 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * Makefile.in: Remove all dependencies on defaults.h.
- * decl.c: Don't include defaults.h.
- * timing.c: Likewise.
-
-2000-12-08 Joseph S. Myers <jsm28@cam.ac.uk>
-
- * Make-lang.in (CHILL.info): Depend on info files in source
- directory.
- (ch/chill.info): Build info files in source directory.
- (CHILL.install-info): Install info files from source directory.
-
-2000-12-07 Zack Weinberg <zack@wolery.stanford.edu>
-
- * lex.c: Don't bother checking whether ISUPPER(c) before
- calling TOLOWER(c). Don't bother checking whether isascii(c)
- before testing ISSPACE(c); ISSPACE(c) includes '\n'.
-
-2000-12-06 Rodney Brown <RodneyBrown@mynd.com>
-
- * actions.h: Standarize copyright statement.
- * except.c inout.c lang.c lex.c lex.h loop.c nloop.c: Likewise.
- * parse.c tasking.c tasking.h timing.c xtypeck.c: Likewise.
-
-2000-11-07 Joseph S. Myers <jsm28@cam.ac.uk>
-
- * actions.c (check_missing_cases), typeck.c (build_chill_slice,
- build_chill_cast): Use memset () instead of bzero ().
-
-2000-11-05 Joseph S. Myers <jsm28@cam.ac.uk>
-
- * Make-lang.in (CHILL.distdir): Remove.
-
-2000-11-02 Geoffrey Keating <geoffk@cygnus.com>
-
- * Make-lang.in: Remove 'CYGNUS LOCAL' markers.
- * Makefile.in: Likewise.
- * configure: Likewise.
-
-2000-10-07 Joseph S. Myers <jsm28@cam.ac.uk>
-
- * Makefile.in ($(srcdir)/hash.h): Refer to GNU FTP site for
- updated gperf.
-
-2000-10-05 Richard Henderson <rth@cygnus.com>
-
- * decl.c (finish_chill_function): Don't init can_reach_end.
-
-2000-09-10 Zack Weinberg <zack@wolery.cumb.org>
-
- * decl.c, timing.c: Include defaults.h if not already included.
- Don't define the *_TYPE_SIZE macros.
- * Makefile.in: Update dependencies.
-
-2000-08-29 Zack Weinberg <zack@wolery.cumb.org>
-
- * inout.c (add_enum_to_list): Use DECL_NAME directly, don't get
- its IDENTIFIER_POINTER and immediately call get_identifier on it.
- * lex.c (yywrap): Constify a char *.
-
-2000-08-24 Mark Mitchell <mark@codesourcery.com>
-
- * Make-lang.in (cc1chill): Don't depend on c-iterate.o.
-
-2000-08-21 Nix <nix@esperi.demon.co.uk>
-
- * lang-specs.h: Do not process -o or run the assembler if
- -fsyntax-only.
-
-2000-08-07 Kazu Hirata <kazu@hxi.com>
-
- * decl.c: Fix a comment typo.
-
-2000-08-04 Zack Weinberg <zack@wolery.cumb.org>
-
- * Make-lang.in (cc1chill): Depend on $(BACKEND), not stamp-objlist.
- * Makefile.in (cc1chill): Link with $(BACKEND). Define BACKEND,
- eliminate C_OBJS (was commented out), OBJS, OBJDEPS.
-
-2000-07-31 Zack Weinberg <zack@wolery.cumb.org>
-
- * lang-specs.h: Rename cpp to cpp0 and/or tradcpp to tradcpp0.
-
-Mon Jul 31 07:58:31 2000 Casper Dik <Casper.Dik@holland.sun.com>
-
- * Makefile.in: Remove naked "^L".
-
-2000-07-13 Zack Weinberg <zack@wolery.cumb.org>
-
- * lang-specs.h: Use the new named specs. Remove unnecessary braces.
-
-2000-06-13 Jakub Jelinek <jakub@redhat.com>
-
- * decl.c (init_decl_processing): Set TYPE_USER_ALIGN.
- (layout_enum): Set DECL_USER_ALIGN resp. TYPE_USER_ALIGN.
- * typeck.c (layout_chill_range_type): Set TYPE_USER_ALIGN.
- (apply_chill_field_layout): Set DECL_USER_ALIGN.
- (layout_chill_struct_type): Set TYPE_USER_ALIGN.
-
-Tue Jun 13 15:30:46 2000 Maciej W. Rozycki <macro@ds2.pg.gda.pl>
-
- * Make-lang.in (CHILL.install-common): Use $(INSTALL_SCRIPT), not
- $(INSTALL_PROGRAM) for chill.install.
-
-2000-06-11 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * Makefile.in (EXPR_H): New dependency variable.
- (actions.o, expr.o): Use EXPR_H.
- (lang.o): Depend on RTL_H and EXPR_H.
-
- * lang.c: Include rtl.h and expr.h.
- (lang_get_alias_set): Mark parameter with ATTRIBUTE_UNUSED.
-
-2000-06-04 Philipp Thomas <pthomas@suse.de>
-
- * Makefile.in(INTLLIBS): New macro.
- (LIBS): Add INTLLIBS.
- (DEPLIBS): Likewise.
- * config-lang(outputs): Specify ch/Makefile.
-
-Sat Jun 3 15:31:07 2000 Jeffrey A Law (law@cygnus.com)
-
- * chill.texi (INFO-DIR-ENTRY): Fix chill entry.
-
-2000-06-02 Richard Henderson <rth@cygnus.com>
-
- * lang.c (lang_get_alias_set): New.
-
-Sat May 27 11:24:26 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * lang.c (deep_const_expr): Use first_rtl_op.
- * satisfy.c (satisfy): Use TREE_CODE_LENGTH.
-
-2000-05-18 Chris Demetriou <cgd@netbsd.org>
-
- * Makefile.in (hash.h): Delete a redundant use of gawk and sed.
-
-Wed May 17 17:27:44 2000 Andrew Cagney <cagney@b1.cygnus.com>
-
- * decl.c (c_decode_option): Update -Wall unused flags by
- calling set_Wunused.
- (poplevel): Replace warn_unused with warn_unused_label.
-
-2000-05-09 Zack Weinberg <zack@wolery.cumb.org>
-
- * ch-tree.h: Update prototypes. Remove prototypes for
- functions declared elsewhere.
- * decl.c (define_label): Constify filename parameter.
- * grant.c (globalize_decl, set_default_grant_file): Constify
- local char * variables. Don't declare
- first_global_object_name or asm_out_file.
- * lang.c (chill_real_input_filename): Constify.
- * lex.c (init_parse): Constify parameter and return value.
- * parse.c: Don't declare input_filename.
- (ch_expand_asm_operands): Constify filename parameter.
- (parse_multi_dimension_case_action): Constify local char *.
- * satisfy.c (safe_satisfy_decl): Constify local char *.
-
-2000-05-04 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * ch-tree.h (init_function_start): Constify.
-
-2000-04-18 Zack Weinberg <zack@wolery.cumb.org>
-
- * ch/lex.c: Remove references to cccp.c.
-
-2000-04-03 Zack Weinberg <zack@wolery.cumb.org>
-
- * lang-specs.h: Pass -fno-show-column to the preprocessor.
-
-Thu Mar 30 06:32:51 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * expr.c (chill_expand_expr): Pass bit alignment to emit_block_move.
-
-Sat Mar 25 09:12:10 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * actions.c (check_missing_cases): BYTES_NEEDED is HOST_WIDE_INT.
- * typeck.c (expand_constant_to_buffer): Use int_byte_position.
- (extract_constant_from_buffer): Likewise.
-
-Fri Mar 17 08:09:14 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * typeck.c (min_precision): New function.
- (build_chill_slice): Use host_integerp and tree_low_cst.
- (expand_constant_to_buffer): Likewise and also int_bit_position.
- LO is unsigned HOST_WIDE_INT
- (build_chill_array_ref_1): Make `i' be HOST_WIDE_INT; use tree_low_cst.
- (extract_constant_from_buffer): Sizes are now HOST_WIDE_INT.
- Use host_integerp and tree_low_cst.
- (build_chill_bin_type): Use host_integerp and tree_low_cst.
- (layout_chill_range_type): Use tree_int_cst_sgn, compare_tree_int,
- tree_low_cst, and min_precision.
- (apply_chill_array_layout): Cleanups for types of variables
- and use tree_int_cst_sgn, compare_tree_int, and tree_low_cst.
- (apply_chill_field_layout): Likewise.
-
-2000-03-07 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * grant.c (globalize_decl): Constify a char*.
-
-Mon Mar 6 17:52:48 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * actions.c (chill_convert_for_assignment): INDEX is unsigned
- HOST_WIDE_INT.
- * ch-tree.h (DECL_NESTING_LEVEL): Use TREE_INT_CST_HIGH since unsigned.
- * except.c (chill_handle_on_labels): ALTERNATIVE is unsigned.
- Use compare_tree_int.
- (expand_goto_except_cleanup): Likewise.
-
-2000-03-01 Martin von Loewis <loewis@informatik.hu-berlin.de>
-
- * decl.c (current_function_decl): Move to toplev.c.
-
-Mon Feb 28 08:12:26 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * ch-tree.h (DECL_ACTION_NESTING_LEVEL): Use new tree union name.
- * decl.c (finish_struct): Don't clear DECL_FIELD_SIZE.
- * typeck.c (make_chill_struct_type): Likewise.
- (apply_decl_field_layout): General cleanup.
- Set DECL_SIZE instead of DECL_FIELD_SIZE.
-
-Sun Feb 27 16:40:33 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * actions.c (chill_convert_for_assignment): Don't use size_binop
- for things that aren't sizes.
- (expand_varying_length_assignment): Likewise.
- * convert.c (digest_array_tuple, convert): Likewise.
- * typeck.c (build_chill_slice, smash_dummy_type): Likewise.
- (build_chill_slice_with_range): Likewise.
- (build_chill_slice_with_length): Likewise.
- (build_array_from_set): Adjust types for size_binop.
- * expr.c (build_concat_expr, build_chill_repetition_op): Likewise.
- (build_chill_sizeof): Use TYPE_SIZE_UNIT.
- * tree.c (build_string_type): Pass proper type to size_binop.
-
-Sat Feb 19 18:43:13 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
-
- * decl.c (layout_enum): Set DECL_SIZE_UNIT.
- * satisfy.c (safe_satisfy_decl): Likewise.
-
-2000-02-15 Jonathan Larmour <jlarmour@redhat.co.uk>
-
- * lang-specs.h: Add new __GNUC_PATCHLEVEL__ define to default spec.
-
-2000-02-15 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * grant.c: Don't declare `version_string'.
-
-2000-02-11 Nathan Sidwell <nathan@acm.org>
-
- * decl.c (init_decl_processing): Remove duplicate decl of
- set_alignment.
-
-2000-02-11 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
-
- * expr.c (compare_records): Delete maximum_field_alignment declaration.
- * inout.c (inout_init): Likewise.
- (build_chill_gettextaccess): Likewise.
- (build_enum_tables): Likewise.
- * lang.c: Likewise.
- * satisfy.c (satisfy): Likewise.
- * tasking.c (build_tasking_struct): Likewise.
- (build_tasking_message_type): Likewise.
- * typeck.c (build_init_struct): Likewise.
-
- * except.c (emit_setup_handler): Make save_maximum_field_alignment
- unsigned int to match maximum_field_alignment.
- * inout.c (inout_init): Likewise.
- (build_chill_gettextaccess): Likewise.
- (build_enum_tables): Likewise.
- * tasking.c (build_tasking_struct): Likewise.
- (build_tasking_message_type): Likewise.
- * typeck.c (build_init_struct): Likewise.
-
-2000-02-10 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
-
- * except.c (maximum_field_alignment): Remove duplicate declaration.
-
-2000-01-17 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * All files: PROTO -> PARAMS.
-
-2000-01-10 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * lex.c: Include tm_p.h.
-
-2000-01-04 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * actions.c (update_else_range_for_int_const): Initialize
- variables `lowval' and `highval'.
- (update_else_range_for_range): Likewise for `low_range_val' and
- `high_range_val'.
-
-1999-12-11 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * typeck.c (apply_chill_array_layout, apply_chill_field_layout):
- Avoid the use of ANSI string concatenation.
-
- * expr.c (chill_expand_case_expr): Likewise.
-
-1999-11-23 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * expr.c (build_chill_function_call): Don't call a variadic
- function with a non-literal format string.
-
- * grant.c (write_spec_module): Likewise.
-
- * parse.c (require, expect): Likewise.
-
- * tasking.c (get_struct_type_name, get_struct_debug_type_name,
- get_tasking_code_name, get_struct_variable_name,
- get_process_wrapper_name, build_start_process): Likewise.
-
- * typeck.c (valid_array_index_p): Likewise.
-
-Sun Oct 31 22:33:33 1999 Jeffrey A Law (law@cygnus.com)
-
- * Makefile.in (convert.o, typeck.o): Depend on output.h
- * convert.c: Include output.h.
- * typeck.c: Include output.h.
- (initializer_constant_valid_p): Delete fucntion.
- * ch-tree.h (initializer_constant_valid_p): Delete prototype.
-
-1999-10-26 Mark Mitchell <mark@codesourcery.com>
-
- * ch-tree.h (remember_end_note): Remove prototype.
- * decl.c (poplevel): Don't call remember_end_note.
-
-Fri Sep 24 10:48:10 1999 Bernd Schmidt <bernds@cygnus.co.uk>
-
- * ch-tree.h (builtin_function): Don't declare.
- * decl.c (builtin_function): New arg CLASS. Arg FUNCTION_CODE now of
- type int. All callers changed.
- Set the builtin's DECL_BUILT_IN_CLASS.
-
-1999-09-20 Nick Clifton <nickc@cygnus.com>
-
- * lang.c (lang_decode_option): Extend comment.
-
-1999-09-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * lex.c (maybe_downcase, getlc, handle_generic_pragma,
- check_newline): Use uppercase ctype macro from system.h.
-
-1999-09-15 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * actions.c (warn_unhandled): Use xstrdup, not xmalloc/strcpy.
-
-Fri Sep 10 10:32:32 1999 Bernd Schmidt <bernds@cygnus.co.uk>
-
- * ch-tree.h: Delete declarations for all tree nodes now moved to
- global_trees.
- * expr.c: Likewise.
- * typeck.c: Likewise.
- * decl.c: Delete their definitions.
- (init_decl_processing): Call build_common_tree_nodes and
- build_common_tree_nodes_2 instead of building their nodes here.
- Use set_sizetype instead of assigning sizetype.
-
-1999-09-08 Bruce Korb autogen@linuxbox.com
-
- * Makefile.in: Give the gperf user a hint about why "gperf -F" fails.
-
-Tue Sep 7 15:59:56 1999 Dave Brolley <brolley@cygnus.com>
-
- * parse.h: Undefine DELAY if it's defined.
- (PACK,NOPACK,POS): Remove erroneous comments regarding these tokens.
- Also, move them to their proper place alphabetically.
-
-1999-09-04 Mark Mitchell <mark@codesourcery.com>
-
- * Make-lang.in (cc1chill): Depend on ggc-callbacks.o.
- * Makefile.in (CHILL_OBJS): Add ggc-callbacks.o.
-
-1999-08-30 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * parse.c (language_string): Constify.
-
-1999-08-30 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * Makefile.in (LIBS, LIBDEPS): Link with & depend on libiberty.a.
- Remove hacks for stuff which now comes from libiberty.
-
-1999-08-29 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * lang.c (chill_print_error_function): Constify a char*.
-
-1999-08-29 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * Makefile.in (ch-version.c): Constify a char*.
-
- * actions.c (id_cmp, warn_unhandled, adjust_return_value,
- update_else_range_for_int_const, update_else_range_for_range,
- update_else_range_for_range_expr, update_else_range_for_type,
- compute_else_range, check_case_value,
- chill_handle_case_label_range,
- chill_handle_multi_case_label_range,
- chill_handle_multi_case_else_label, chill_handle_multi_case_label,
- chill_handle_multi_case_label_list print_missing_cases): Add
- static prototypes.
- (build_exception_variant): Cast the function argument of qsort.
- (build_rts_call, warn_unhandled, chill_convert_for_assignment,
- adjust_return_value, chill_expand_result,
- build_multi_case_selector_expression, print_missing_cases):
- Constify a char*.
- (print_missing_cases): Introduce an intermediary non-const ptr.
- Add brackets and indent.
-
- * ch-tree.h (maybe_building_objc_message_expr,
- maybe_objc_comptypes, comptypes_record_hook): Remove declarations.
- (push_handler, pop_handler): Add prototypes.
- (builtin_function, valid_array_index_p,
- build_chill_exception_decl, build_rts_call,
- chill_convert_for_assignment, display_int_cst,
- build_chill_addr_expr, check_have_mode, get_identifier3,
- build_chill_string, register_seize_path, get_unique_identifier,
- add_taskstuff_to_list, gnuchill_version): Constify a char*.
- (finish_chill_function): Add void prototype argument.
-
- * convert.c (convert_to_reference, convert_to_boolean,
- convert_to_char, base_type_size_in_bytes, remove_tree_element,
- check_ps_range, digest_powerset_tuple, digest_structure_tuple,
- digest_array_tuple, convert1): Add static prototypes.
- (base_type_size_in_bytes): Hide unused function.
- (display_int_cst, digest_array_tuple): Constify a char*.
-
- * decl.c (set_nesting_level, make_chill_variants, fix_identifier,
- proclaim_decl, maybe_acons, push_scope_decls, pop_scope_decls,
- build_implied_names, bind_sub_modules, layout_array_type,
- do_based_decl, handle_one_level, label_value_cmp,
- find_implied_types): Add static prototypes.
- (boolean_code_name, chill_tree_code_type, chill_tree_code_name):
- Constify a char*.
- (layout_chill_variants): Cast the function argument of qsort.
- (start_chill_function, fix_identifier, init_decl_processing):
- Constify a char*.
- (init_decl_processing): Prefer memcpy over bcopy to avoid casts.
- Use xcalloc instead of xmalloc/bzero.
- (builtin_function, build_chill_exception_decl,
- finish_outer_function): Constify a char*.
-
- * except.c (start_handler_array, finish_handler_array): Add static
- prototypes.
-
- * expr.c (chill_expand_expr, chill_expand_case_expr,
- check_arglist_length, internal_build_compound_expr,
- is_really_instance, invalid_operand, invalid_right_operand,
- build_chill_abstime, build_allocate_memory_call,
- build_allocate_global_memory_call, build_return_memory,
- build_chill_duration, build_chill_floatcall,
- build_allocate_getstack, build_chill_allocate,
- build_chill_getstack, build_chill_terminate, build_chill_inttime,
- build_chill_lower_or_upper, build_max_min,
- build_chill_pred_or_succ, expand_packed_set, fold_set_expr,
- build_compare_set_expr, scalar_to_string, build_concat_expr,
- build_compare_string_expr, compare_records, string_char_rep,
- build_boring_bitstring): Add static prototypes.
- (check_have_mode, chill_expand_expr, build_chill_floatcall,
- build_allocate_getstack, build_max_min, build_chill_function_call,
- expand_packed_set, build_compare_set_expr, build_chill_addr_expr,
- string_char_rep): Constify a char*.
-
- * gperf (hash, in_word_set): Add prototypes.
-
- * grant.c (newstring, strfree, append, prepend,
- grant_use_seizefile, decode_layout, grant_array_type,
- grant_array_type_selective, get_tag_value,
- get_tag_value_selective, print_enumeral, print_enumeral_selective,
- print_integer_type, find_enum_parent, print_integer_selective,
- print_struct, print_struct_selective, print_proc_exceptions,
- print_proc_tail, print_proc_tail_selective, find_in_decls,
- in_ridpointers, grant_seized_identifier, globalize_decl,
- grant_one_decl_selective, compare_memory_file, search_in_list,
- really_grant_this): Add static prototypes.
- (newstring, append, prepend, grant_use_seizefile,
- print_integer_type, decode_constant, grant_one_decl_selective,
- header_template): Constify a char *.
-
- * inout.c (add_enum_to_list, build_chill_io_list_type,
- build_io_types, declare_predefined_file, build_access_part,
- textlocation_mode, check_assoc, assoc_call, check_transfer,
- connect_process_optionals, connect_text, connect_access,
- check_access, check_text, get_final_type_and_range,
- process_io_list, check_format_string, get_max_size,
- check_exprlist): Add static prototypes.
- (declare_predefined_file, check_assoc, assoc_call, check_transfer,
- check_access, check_text, process_io_list): Constify a char*.
-
- * lang.c (deep_const_expr, chill_print_error_function): Add static
- prototypes.
-
- * lex.c (close_input_file, maybe_number, string_or_char): Constify
- a char*.
- (ch_lex_init, skip_directive, same_file, getlc, yywrap,
- yy_refill): Add static prototypes.
- (build_chill_string, same_file, register_seize_path): Constify a
- char*.
-
- * lex.h (finish_chill_seizes): Remove unused prototypes.
-
- * loop.c (build_temporary_variable, maybe_make_for_temp,
- get_unique_identifier): Constify a char*.
-
- * parse.c (ch_parse_init, check_end_label, end_function,
- build_prefix_clause, PEEK_TOKEN, peek_token_, pushback_token,
- forward_token_, require, check_token, expect, define__PROCNAME__):
- Add static prototypes.
- (build_prefix_clause, expect): Constify a char*.
- (parse_expression, parse_primval, parse_untyped_expr,
- parse_opt_untyped_expr, parse_opt_actions): Add void prototype
- argument.
- (parse_opt_name_string, parse_simple_name_string,
- parse_name_string, parse_defining_occurrence, parse_name,
- parse_optlabel, parse_opt_end_label_semi_colon, parse_modulion,
- parse_spec_module, parse_semi_colon,
- parse_defining_occurrence_list, parse_mode_definition,
- parse_mode_definition_statement, parse_synonym_definition,
- parse_synonym_definition_statement, parse_on_exception_list,
- parse_on_alternatives, parse_loc_declaration,
- parse_declaration_statement, parse_optforbid, parse_postfix,
- parse_postfix_list, parse_rename_clauses, parse_opt_prefix_clause,
- parse_grant_statement, parse_seize_statement,
- parse_param_name_list, parse_param_attr, parse_formpar,
- parse_formparlist, parse_opt_result_spec, parse_opt_except,
- parse_opt_recursive, parse_procedureattr, parse_proc_body,
- parse_procedure_definition, parse_processpar,
- parse_processparlist, parse_process_definition,
- parse_signal_definition, parse_signal_definition_statement,
- parse_then_clause, parse_opt_else_clause, parse_expr_list,
- parse_range_list_clause, pushback_paren_expr, parse_case_label,
- parse_case_label_list, parse_case_label_specification,
- parse_single_dimension_case_action,
- parse_multi_dimension_case_action, parse_case_action,
- parse_asm_operands, parse_asm_clobbers, ch_expand_asm_operands,
- parse_asm_action, parse_begin_end_block, parse_if_action,
- parse_iteration, parse_delay_case_event_list,
- parse_delay_case_action, parse_do_action, parse_receive_spec,
- parse_receive_case_action, parse_send_action, parse_start_action,
- parse_call, parse_tuple_fieldname_list, parse_tuple_element,
- parse_opt_element_list, parse_tuple, parse_operand6,
- parse_operand5, parse_operand4, parse_operand3, parse_operand2,
- parse_operand1, parse_operand0, parse_case_expression,
- parse_then_alternative, parse_else_alternative,
- parse_if_expression, parse_index_mode, parse_set_mode, parse_pos,
- parse_step, parse_opt_layout, parse_field_name_list,
- parse_fixed_field, parse_variant_field_list,
- parse_variant_alternative, parse_field, parse_structure_mode,
- parse_opt_queue_size, parse_procedure_mode, parse_program,
- parse_pass_1_2): Add static prototypes.
- (parse_process_definition): Remove extra argument in function call.
- (parse_range_list_clause): Likewise.
-
- * satisfy.c (satisfy, cycle_error_print, safe_satisfy_decl,
- satisfy_list, satisfy_list_values): Add static prototype.
- (safe_satisfy_decl): Cast DECL_TASKING_CODE_DECL() to (tree).
-
- * tasking.c (make_process_struct): Remove unused prototype.
- (validate_process_parameters, get_struct_variable_name,
- decl_tasking_code_variable, get_struct_debug_type_name,
- get_process_wrapper_name, build_tasking_enum,
- build_tasking_message_type, build_receive_signal_case_label,
- build_receive_buffer_case_label, build_receive_buffer_case_end,
- build_receive_signal_case_end): Add static prototypes.
- (struct_name, struct_debug_name, data_name, wrapper_name,
- get_struct_type_name, get_struct_debug_type_name,
- get_tasking_code_name, get_struct_variable_name,
- get_process_wrapper_name): Constify a char*.
- (validate_process_parameters, get_struct_variable_name,
- decl_tasking_code_variable): Hide unused functions.
- (build_start_process, add_taskstuff_to_list, build_queue_length):
- Constify a char*.
-
- * tree.c (make_powerset_type): Add static prototype.
- (get_identifier3, build_alias_decl, decl_check_rename): Constify a
- char*.
-
- * typeck.c (extract_constant_from_buffer,
- expand_constant_to_buffer, build_empty_string,
- make_chill_pointer_type, make_chill_range_type,
- apply_chill_array_layout, field_decl_cmp, make_chill_struct_type,
- apply_chill_field_layout): Add static prototype.
- (valid_array_index_p, extract_constant_from_buffer,
- chill_expand_tuple): Constify a char*.
- (layout_chill_struct_type): Cast the function argument of qsort.
-
-1999-08-09 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * actions.c (lang_identify): Constify a char*.
-
- * lang.c (chill_print_error_function): Likewise.
- (lang_init): Remove redundant prototype for `print_error_function'.
-
-1999-07-25 Richard Henderson <rth@cygnus.com>
-
- * decl.c (va_list_type_node): New.
-
-1999-06-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * Make-lang.in (CHILL.stage1): Depend on stage1-start.
- (CHILL.stage2): Likewise for stage2-start.
- (CHILL.stage3): Likewise for stage3-start.
- (CHILL.stage4): Likewise for stage4-start.
-
-Tue May 18 00:21:34 1999 Zack Weinberg <zack@rabi.phys.columbia.edu>
-
- * lang-specs.h: Define __GNUC__ and __GNUC_MINOR__ only if -no-gcc
- was not given.
-
-1999-05-10 18:21 -0400 Zack Weinberg <zack@rabi.phys.columbia.edu>
-
- * lang-specs.h: Pass -$ to the preprocessor.
-
-Tue May 4 14:52:53 1999 Dave Brolley <brolley@cygnus.com>
-
- * actions.c (chill_expand_assignment): Use powersetlen to calculate the
- length of an array of packed bits.
-
-Tue Apr 20 23:37:01 1999 Nathan Sidwell <nathan@acm.org>
-
- * Make-lang.in (ch/chill.info): Put MAKEINFO parameters in correct
- order.
-
-Wed Apr 14 21:07:30 1999 Mumit Khan <khan@xraylith.wisc.edu>
-
- * config-lang.in (compilers): Add exeext.
- (stagestuff): Likewise.
-
-Fri Apr 2 15:49:44 1999 Jeffrey A Law (law@cygnus.com)
-
- * Make-lang.in (CHILL_FLAGS_TO_PASS): Do not pass $(CC).
-
-Wed Mar 31 10:44:47 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * Makefile.in (hash.h): Generate using gperf language 'C', not
- 'KR-C', so gperf uses the `const' keyword on strings.
-
- * gperf (resword): Const-ify a char*.
-
-Sun Mar 28 00:30:36 1999 Jeffrey A Law (law@cygnus.com)
-
- * Make-lang.in (CHILL.dvi): New target.
- (CHILL.mostlyclean): Remove remnants of old runtime library structure.
-
-1999-02-20 Craig Burley <craig@jcb-sc.com>
-
- * Make-lang.in (CHILL.info): Depend on intermediate ch/chill.info
- target instead of the chill.texi file.
- (ch/chill.info): New target, depends on the chill.texi source file.
- Its command writes ch/chill.info instead of chill.info.
- (CHILL.install-info): Install from ch/chill.info instead of
- chill.info.
- If any ch/chill.info* files exist, delete *all* chill.info* files
- in $infodir first, not just the ones corresponding to the
- files to be installed (just in case the docs get smaller).
-
-Sun Jan 31 20:34:29 1999 Zack Weinberg <zack@rabi.columbia.edu>
-
- * decl2.c: Don't define flag_no_ident here. Don't process
- -f(no-)ident here.
- * ch-tree.h: Don't declare flag_no_ident here.
- * lang-specs.h: Map -Qn to -fno-ident.
-
-Tue Jan 19 23:24:36 1999 Jeffrey A Law (law@cygnus.com)
-
- * Makefile.in (typeck.o): Depend on insn-codes.h.
- * actions.c (chill_handle_multi_case_label): Initialize "expr".
- * decl.c (poplevel): Initialize "block_previously_created".
- * expr.c (chill_expand_expr): Initialize "size0" and "size1".
- (fold_set_expr): Initialize "buffer1".
- * inout.c (process_io_list): Initialize "to_assign".
- (check_exprlist): Initialize "result".
- * parse.c (expand_expr): Declare.
- (parse_multi_dimension_case_action): Initialize "end_case_label".
- * tasking.c (build_start_process): Initialize "struct_type_node".
- * typeck.c (apply_chill_field_layout): Initialize "word".
- (type_for_mode); Unconditionally cast RHS & LHS to ints to shut up
- signed/unsigned comparison warning.
-
-Mon Jan 18 11:55:06 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * ch-tree.h: Remove conflicting prototypes for pedwarn,
- warning_with_decl, and make_dcl_rtl.
-
-Sun Jan 17 21:53:23 1999 Jeffrey A Law (law@cygnus.com)
-
- * Makefile.in: Do not put ^Ls at the start of a line.
-
-Wed Jan 6 02:53:38 1999 Jeffrey A Law (law@cygnus.com)
-
- * Makefile.in: Add some missing $(exeext). Remove some obsolete
- runtime stuff.
- * Make-lang.in: Similarly.
-
-Tue Nov 24 09:57:34 1998 Jeffrey A Law (law@cygnus.com)
-
- * Makefile.in (lex.c): Do not depend on hash.h.
- (lex.o): Depend on hash.h.
-
-Mon Oct 19 12:13:47 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * Makefile.in (lex.o): Depend on dwarfout.h.
-
- * lang-specs.h: Add missing braces in initializer.
-
- * lex.c: Include dwarfout.h, if DWARF_DEBUGGING_INFO is defined.
-
-Thu Oct 15 09:25:21 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * expr.c (build_chill_card): Use &&, not &, when comparing truth
- values.
-
- * parse.c (parse_spec_module): Remove unused variable
- `module_name', but preserve function call from initialization.
- (parse_operand6): Mark variable `location' with ATTRIBUTE_UNUSED.
-
- * inout.c (init_text_location): Remove unused variable `textlength'.
-
-Wed Oct 14 22:19:48 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * typeck.c (build_chill_cast): Fix typo in assignment statement.
-
- * tasking.c (build_signal_descriptor): Use IDENTIFIER_POINTER()
- when printing a `tree'.
-
-Fri Oct 9 13:01:23 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * ch-tree.h (build_delay_case_end): Remove unused parameter.
- (build_receive_case_end): Likewise.
- (check_queue_size): Likewise.
-
- * parse.c: Callers changed.
-
- * satisfy.c: Likewise.
-
- * tasking.c (build_receive_buffer_case_end): Remove unused
- parameter `label_cnt'.
- (build_receive_signal_case_end): Likewise.
- (build_receive_case_end): Likewise.
- (build_delay_case_end): Likewise.
- (check_queue_size): Likewise for parameter `type'.
- All callers changed.
-
-Thu Oct 8 05:57:41 1998 Jeffrey A Law (law@cygnus.com)
-
- * typeck (type_for_mode): Only return TItype nodes when
- HOST_BITS_PER_WIDE_INT is >= 64 bits.
- (type_for_size): Similarly.
- * decl.c (intTI_type_node, unsigned_intTI_type_node): Only declare
- when HOST_BITS_PER_WIDE_INT is >= 64 bits.
- (init_decl_processing): Only create TItype nodes when
- HOST_BITS_PER_WIDE_INT is >= 64 bits.
-
-Wed Oct 7 12:19:21 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * Makefile.in (hash.h): Add -L KR-C -F ', 0, 0, 0' flags to gperf.
- (hash.h): Regenerate using gperf 2.7.1 (19981006 egcs).
-
-Thu Oct 1 10:43:45 1998 Nick Clifton <nickc@cygnus.com>
-
- * lex.c: Replace occurances of HANDLE_SYSV_PRAGMA with
- HANDLE_GENERIC_PRAGMAS.
- (handle_generic_pragma): New function: Parse generic pragmas.
-
-Wed Sep 30 20:22:34 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * parse.c (emit_label): Fix return-type of prototype.
-
-Wed Sep 30 19:41:36 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * actions.c (chill_handle_multi_case_label): Always return a value
- in function returning non-void.
-
- * except.c: Include OS headers before any local ones.
-
- * typeck.c (layout_chill_range_type): Change type of variable
- `negprecision' to int.
- (apply_chill_array_layout): Initialize variables `stepsize' and
- `start_bit'.
- (layout_chill_struct_type): Change type of variable `min_align' to
- unsigned int.
- (smash_dummy_type): Change name of variable `main' to `main_tree'.
-
-Wed Sep 30 19:24:41 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * actions.c (id_cmp): Do pointer arithmetic as `long' not `int' to
- ensure enough bits for calculation.
-
- * ch-tree.h (check_text_length): Remove unused parameter.
-
- * convert.c (display_int_cst): Cast a HOST_WIDE_INT argument to
- function sprintf into the appropriate type for printing.
-
- * decl.c (print_lang_decl): Use HOST_WIDE_INT_PRINT_DEC as the
- format specifier.
- (print_mode): Likewise.
- (init_decl_processing): Cast the arguments of bcopy/bzero to char *.
-
- * grant.c (grant_array_type): Use HOST_WIDE_INT_PRINT_DEC as
- the format specifier.
-
- * inout.c (check_text_length): Remove unused parameter `type'.
- (build_chill_associate): Initialize variables `arg1', `arg2',
- `arg3', `arg4' and `arg5'.
- (build_chill_modify): Likewise.
- (scanformcont): Change type of variable `curr' to `unsigned char'.
-
- * lex.c (maybe_downcase): Cast the argument of `tolower' to
- `unsigned char'.
-
- * satisfy.c (satisfy): Remove unused parameter in call to
- `check_text_length'.
-
- * tasking.c (generate_tasking_code_variable): Pass a HOST_WIDE_INT
- as a `long' in call to function `error'.
- (decl_tasking_code_variable): Likewise.
-
-Wed Sep 30 19:03:02 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * grant.c (decode_decl_selective): Cast switch's enum argument to
- an int.
- (really_grant_this): Add default case in switch.
-
- * typeck.c (chill_resulting_class): Add default cases in switch.
- Also add `break' statements after each case.
-
-Tue Sep 29 21:37:33 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * ch-tree.h (build_compare_expr): Change first argument's type
- from `enum chill_tree_code' to `enum tree_code'.
- (build_compare_discrete_expr): Likewise.
-
- * expr.c (build_compare_set_expr): Likewise.
- (build_compare_string_expr): Likewise.
- (build_compare_expr): Likewise.
- (build_compare_discrete_expr): Likewise. Also add default case in
- switch statement.
- (compare_int_csts): Add default case in switch statement.
-
-Sun Sep 20 11:02:55 1998 Robert Lipe <robertl@dgii.com>
-
- * except.c: Include system.h.
-
- * Makefile.in (except.o): Depend on system.h.
-
-Sun Sep 20 09:25:13 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * Makefile.in (actions.o, convert.o, decl.o, expr.o, lang.o,
- lex.o, loop.o, parse.o, satisfy.o, timing.o, tasking.o, tree.o,
- typeck.o): Depend on system.h and toplev.h.
- (except.o): Depend on toplev.h.
- (grant.o): Depend on system.h, toplev.h and output.h.
-
- * actions.c: Include system.h and toplev.h. Remove redundant
- prototypes.
- (build_cause_exception): Add default case in switch.
- (update_else_range_for_range): Add parentheses around && within ||.
- (chill_handle_multi_case_label_list): Remove unused variable
- `selector_value'.
- (print_missing_cases): Reconcile format specifiers vs arguments in
- calls to sprintf.
-
- * ch-tree.h: Don't include stdio.h. Wrap prototypes using FILE*
- with macro BUFSIZ. Add missing prototypes.
-
- * convert.c: Include system.h and toplev.h. Remove redundant
- prototypes.
- (convert): Remove unused variable `errstr'.
-
- * decl.c: Include system.h and toplev.h. Remove redundant
- prototypes.
- (builtin_scope): Add missing initializers.
- (clear_scope): Likewise.
- (allocate_lang_decl): Mark parameter `t' with ATTRIBUTE_UNUSED.
- (copy_lang_decl): Likewise for parameter `node'.
- (c_decode_option): Likewise for parameter `argc'.
- (push_extern_function): Likewise for parameter `granting'.
- (switch_to_pass_2): Hide declaration of errorcount/sorrycount.
- (pushdecl): Remove unused variable `t'.
- (lookup_name_current_level): Make static and hide.
- (lookup_name_for_seizing): Make static.
- (finish_decl): Remove unused variable `type'.
- (maybe_build_cleanup): Mark parameter `decl' with ATTRIBUTE_UNUSED.
- (complete_array_type): Mark parameters `type', `initial_value' and
- `do_default' with ATTRIBUTE_UNUSED.
- (start_struct): Mark parameter `name' with ATTRIBUTE_UNUSED.
- (start_enum): Likewise.
- (shadow_record_fields): Remove unused variables `type' and `parent'.
-
- * except.c: Include toplev.h. Remove redundant prototypes.
-
- * expr.c: Include system.h and toplev.h. Don't define NULL.
- Remove redundant prototypes.
- (internal_build_compound_expr): Mark parameter `first_p' with
- ATTRIBUTE_UNUSED.
- (build_allocate_getstack): Remove unused variable `init'.
- (build_chill_pred_or_succ): Likewise for variable `limit'.
- (varying_to_slice): Likewise for variable `doamin' [sic].
- (finish_chill_binary_op): Likewise for variables `code0' and
- `code1'. Remove unused label `finish'. Add explicit braces to
- avoid ambiguous `else'.
- (build_chill_addr_expr): Remove extra parameter in call to `error'.
- (build_chill_unary_op): Remove unused variables `class' and `type0'.
- (powersetlen): Remove unused variables `domain' and `temp'.
-
- * grant.c: Include system.h, toplev.h and output.h. Don't handle
- strchr/strrchr. Remove redundant prototypes.
- (decode_constant_selective): Remove unused variables `op' and `wrk'.
- (push_granted): Mark parameters `name' and `decl' with
- ATTRIBUTE_UNUSED.
-
- * inout.c: Include system.h and toplev.h. Remove redundant
- prototypes.
- (textlocation_mode): Use &&, not &, when comparing two truth
- values.
- (scanformcont): Remove unused label `do_the_action'.
-
- * lang.c: Include system.h and toplev.h. Remove redundant
- prototypes.
- (lookup_interface): Mark parameter `arg' with ATTRIBUTE_UNUSED.
- (maybe_objc_comptypes): Likewise for parameters `lhs' and `rhs'.
- (lang_print_xnode): Likewise for parameters `file', `node' and
- `indent'.
- (lang_decode_option): Explicitly declare `explicit_ignore_case'.
- (incomplete_type_error): Mark parameters `value' and `type' with
- ATTRIBUTE_UNUSED.
-
- * lex.c: Include system.h and toplev.h. Remove redundant
- prototypes. Don't handle strchr/strrchr. Use CAPITALIZED
- versions of ctype macros from system.h. Cast ctype arguments to
- unsigned char when necessary.
- (last_token, RETURN_TOKEN): Hide definition.
- (push_back): Remove unused function.
- (readstring): Change variable `i' to unsigned.
- (yywrap): Remove unused variable `node'.
-
- * loop.c: Include system.h and toplev.h. Remove redundant
- prototypes.
- (chill_unsigned_type): Hide prototype and definition.
- (begin_loop_scope): Remove unused variable `firstp'.
- (nonvalue_begin_loop_scope): Likewise.
-
- * parse.c: Include system.h and toplev.h. Remove redundant
- prototypes.
- (quasi_signal): Hide.
- (PEEK_TOKEN): Change return type to `enum terminal'.
- (parse_mode_definition_statement): Remove unused variable `names'.
- (parse_formpar): Remove unused parameter `in_spec_module'. All
- callers changed.
- (parse_formparlist): Likewise.
- (parse_processpar): Remove unused variable `parms'.
- (parse_definition): Add explicit braces to avoid ambiguous `else'.
- (parse_multi_dimension_case_action): Initialize variable
- `begin_test_label'. Remove unused variable `new_test'.
- (parse_case_action): Remove unused variable `caseaction_flag'.
- (parse_asm_clobbers): Remove unused variable `expr'.
- (parse_delay_case_action): Initialize variable `label_cnt'.
- (parse_action): Make function static.
- (parse_tuple_element): Remove unused variable `list'.
- (parse_primval): Add default case in switch.
- (parse_variant_alternative): Remove unused variables `x' and
- `variant_fields'.
-
- * satisfy.c: Include system.h and toplev.h. Remove redundant
- prototypes.
-
- * tasking.c Include system.h and toplev.h. Remove redundant
- prototypes.
- (data_name): Hide.
- (get_struct_variable_name): Likewise.
- (validate_process_parameters): Mark parameter `parms' with
- ATTRIBUTE_UNUSED.
- (build_start_process): Initialize variable `tuple'.
- (build_receive_buffer_case_end): Remove unused variable `buffer_ptr'.
-
- * timing.c: Include system.h and toplev.h.
- (build_after_timeout_start): Remove unused variable `goto_where'.
-
- * tree.c: Include system.h and toplev.h. Remove redundant
- prototypes.
-
- * typeck.c: Include system.h and toplev.h. Remove redundant
- prototypes.
- (extract_constant_from_buffer): Make function static. Add
- explicit braces to avoid ambiguous `else'.
- (expand_constant_to_buffer): Likewise.
- (build_chill_slice): remove unused variable `is_static'.
- (chill_compatible): Add explicit braces to avoid ambiguous `else'.
- (apply_chill_array_layout): Remove unused variable `offset'.
- (smash_dummy_type): Remove unused variable `save_lang_specific'.
- (initializer_constant_valid_p): Add default case in switch.
-
-Mon Sep 14 16:46:36 1998 Dave Brolley <brolley@cygnus.com>
-
- * typeck.c (build_chill_slice): Always use TYPE_DOMAIN to get the
- domain type of the array.
-
- * expr.c (build_chill_function_call): Remove redundant call to
- chill_convert_to_assignment
-
-Thu Sep 10 17:52:36 1998 Dave Brolley <brolley@cygnus.com>
-
- * actions.c (chill_convert_for_assignment): Make a copy of the result
- node before modifying it.
-
-Sat Sep 5 16:55:37 1998 John Carr <jfc@mit.edu>
-
- * Make-lang.in: Comment ^L characters. Sun make doesn't like them.
-
-Sat Sep 5 23:49:50 1998 Jeffrey A Law (law@cygnus.com)
-
- * Makefile.in (INCLUDES): Update after recent reorganization at the
- toplevel gcc directory.
-
-Sat Sep 5 22:25:51 1998 Richard Henderson <rth@cygnus.com>
-
- * Makefile.in: Update dependancies for top-level gcc files that moved.
-
-Sat Sep 5 02:21:08 1998 Jeffrey A Law (law@cygnus.com)
-
- * Makefile.in: Tweak to avoid building runtime. It's built
- elsewhere now.
-
-Thu Sep 3 15:32:03 1998 Dave Brolley <brolley@cygnus.com>
-
- * typeck.c (layout_chill_range_type): set TYPE_SIZE_UNIT.
-
-Wed Sep 02 09:25:29 1998 Nick Clifton <nickc@cygnus.com>
-
- * lex.c (check_newline): Change how HANDLE_PRAGMA is called.
- Generate warning messages if unknown pragmas are encountered.
- (pragma_getc): New function: retrieves characters from the
- input stream. Defined when HANDLE_PRAGMA is defined.
- (pragma_ungetc): New function: replaces characters back into the
- input stream. Defined when HANDLE_PRAGMA is defined.
-
-Mon Aug 31 15:35:16 1998 Dave Brolley <brolley@cygnus.com>
-
- * decl.c (layout_chill_variants): Calculate nlables properly.
-
-Mon Jul 27 17:21:01 1998 Dave Brolley <brolley@cygnus.com>
-
- * typeck.c (apply_chill_array_layout): Don't set TYPE_SIZE of the
- element type.
-
-Mon Jul 13 14:20:12 1998 Nick Clifton <nickc@cygnus.com>
-
- * lang-options.h: Format changed to match changes in gcc/toplev.c
- to implement a --help option.
-
-Wed Jul 8 02:58:35 1998 Jeffrey A Law (law@cygnus.com)
-
- * lang.c (lang_init_options): New function.
-
-Wed Jun 10 12:08:09 1998 Dave Brolley <brolley@cygnus.com>
-
- * lang-options.h: Remove -I.
- * ch-tree.h (c_decode_option): New argc/argv interface.
- * decl.c (c_decode_option): New argc/argv interface.
- * lang.c (lang_decode_option): New argc/argv interface.
-
-Wed May 27 10:33:41 1998 Dave Brolley <brolley@cygnus.com>
-
- * actions.c (chill_handle_multi_case_label): Arguments 1 and 2 to
- chill_handle_multi_case_label_range were reversed.
-
- * Make-lang.in (chill): Use the correct gcc in the driver script.
-
-Thu May 21 14:40:44 1998 Dave Brolley <brolley@cygnus.com>
-
- * convert.c (digest_array_tuple): Move conversion to
- chill_convert_for_assignment.
-
- * actions.c (chill_convert_for_assignment): Allow conversion of array
- constructor to bitstring constructor for assignment to array of packed bits.
-
-Thu May 14 13:57:51 1998 Dave Brolley <brolley@cygnus.com>
-
- * Make-lang.in (chill-runtime): Depend on stmp-headers to build float.h.
-
-Wed May 13 14:07:51 1998 Dave Brolley <brolley@cygnus.com>
-
- * typeck.c (build_chill_slice): Adjust slice index to account for the
- lower bound of the array.
-
- * actions.c (chill_expand_assignment): Convert function arguments to the
- correct types.
- (chill_expand_assignment): Ditto.
-
-Mon May 11 16:20:57 1998 Dave Brolley <brolley@cygnus.com>
-
- * typeck.c (build_chill_slice): Propogate the TYPE_PACKED setting
- of the array_type to the slice_type.
- (build_chill_slice): Use SLICE_EXPR to represent a slice of an array
- of bits.
-
- * loop.c (build_loop_iterator): Disallow location enumeration for
- bit-packed arrays.
-
- * convert.c (digest_array_tuple): Allow conversion of an array tuple
- to a bitstring for assignment to a packed array of bits.
-
-Mon May 4 16:28:58 1998 Dave Brolley <brolley@cygnus.com>
-
- * ch-tree.def (PACKED_ARRAY_REF): New tree code.
- * typeck.c (build_chill_array_ref_1): Build PACKED_ARRAY_REF if array is packed.
- (chill_location): Handle PACKED_ARRAY_REF.
- (apply_chill_array_layout): Allow PACK for arrays of single bits.
- * expr.c (chill_expand_expr): Expand PACKED_ARRAY_REF.
- (invalid_operand): Check PACKED_ARRAY_REF operands.
- * actions.c (chill_expand_assignment): Expand PACKED_ARRAY_REF.
-
-Thu Apr 23 15:33:20 1998 Dave Brolley <brolley@cygnus.com>
-
- * typeck.c (apply_chill_field_layout): Only integral fields can be packed
- to the bit level.
-
-Tue Apr 21 14:30:10 1998 Jeffrey A Law (law@cygnus.com)
-
- * decl.c (intTI_type_node, unsigned_intTI_type_node): Define.
- (init_decl_processing): Handle TI types.
- * typeck.c (intTI_type_node, unsigned_intTI_type_node): Declare.
- (type_for_size): Handle TI types.
- (type_for_mode): Handle TI types.
-
-Mon Apr 20 13:12:26 1998 Dave Brolley <brolley@cygnus.com>
-
- * typeck.c (layout_chill_struct_type): Don't promote bitfield types to
- int.
-
- * actions.c (chill_convert_for_assignment): Check that the rhs is not
- a type declaration.
-
-Tue Apr 14 13:17:44 1998 Dave Brolley <brolley@cygnus.com>
-
- * lex.c (init_parse): Now returns char* containing the filename.
-
- * typeck.c (get_type_precision): Declare.
- (apply_chill_field_layout): Use the minimum number of bits necessary to
- represent discrete types as the natural length of the field.
-
-Thu Apr 9 12:46:55 1998 Dave Brolley <brolley@cygnus.com>
-
- * lex.c (finput): Move definition here from toplev.c
- (init_parse): New function replaces init_lex.
- (init_parse): Add code to open source file.
- (finish_parse): New function.
- (close_input_file): File was being closed more than once.
-
- * lang.c (finput): Declare.
- * ch-tree.h (init_lex): Remove.
-
-
-Wed Apr 8 14:47:33 1998 Dave Brolley <brolley@cygnus.com>
-
- * actions.c (compute_else_range): Fix loop index error.
- (chill_handle_multi_case_label_range): Move error checking to
- chill_handle_multi_case_label.
- (chill_handle_multi_case_else_label): Convert ELSE range values to
- the type of the corrersponding CASE selector.
-
-Wed Apr 8 13:02:50 1998 Jeffrey A Law (law@cygnus.com)
-
- * actions.c (sizetype_tab): Do not declare.
- * lang.c (lang_print_xnode): New function.
-
-Mon Mar 23 14:43:06 1998 Dave Brolley <brolley@cygnus.com>
-
- * grant.c (decode_layout): New function.
- (grant_array_type): Call decode_layout to export layout information to
- the grant file.
- (decode_decl): Ditto
-
-Fri Mar 20 16:06:41 1998 Dave Brolley <brolley@cygnus.com>
-
- * parse.c (parse_tuple_element): Call had arguments in wrong order.
-
-Thu Mar 19 13:42:33 1998 Dave Brolley <brolley@cygnus.com>
-
- * typeck.c (apply_chill_array_layout): Use
- TYPE_PRECISION (chill_integer_type_node) in stead of BITS_PER_WORD for
- the word size.
-
-Wed Mar 18 16:25:48 1998 Dave Brolley <brolley@cygnus.com>
-
- * typeck.c (apply_chill_field_layout): Only set DECL_BIT_FIELD for discrete
- fields.
-
- * parse.c (parse_multi_dimension_case_action): Call emit_line_note at the
- proper places.
-
-Tue Mar 17 14:16:08 1998 Dave Brolley <brolley@cygnus.com>
-
- * parse.c (gen_label_rtx): Declare before use.
- (emit_jump): Declare before use.
- (emit_label): Declare before use.
- (parse_case_label_list): Pass in CASE selector so we can mark it as having
- an (ELSE) label if necessary.
- (parse_case_label_specification): Pass in the CASE selector list so that
- the CASE selectors can be passed to parse_case_label_list.
- (parse_multi_dimension_case_action): Modify to generate branching code in
- one pass.
- (parse_case_expression): Compute (ELSE) range before generating CASE expression.
- (parse_variant_alternative): Remove error for (ELSE) specified.
-
- * expr.c (check_case_selector_list): Preserve TREE_PURPOSE of selector list.
-
- * decl.c (layout_chill_variants): Add code to check compatibility of ranges
- and discrete mode names.
-
- * ch-tree.h (ELSE_LABEL_SPECIFIED): New Chill specific flag.
-
- * actions.h (build_multi_case_selector_expression): Make it extern.
- (chill_handle_multi_dimension_case_label): Remove.
- (compute_else_ranges): New function.
-
- * actions.c (update_else_range_for_int_const): New function.
- (update_else_range_for_range): New function.
- (update_else_range_for_range_expr): New function.
- (update_else_range_for_type): New function.
- (compute_else_range): New function.
- (compute_else_ranges): New function.
- (chill_handle_multi_case_else_label): New function
- (chill_handle_multi_case_label_range): Don't generate tests for conditions
- which are always true or false.
- (chill_handle_multi_case_label): Ditto.
- (chill_handle_multi_case_label): Implement (ELSE) label support.
- (chill_handle_multi_case_label): First argument is now the selector tree not
- its VALUE.
- (chill_handle_multi_dimension_case_label): Removed.
- (build_chill_multi_dimension_case_expr): List of CASE alternatives is no longer
- reversed on entry, so reverse it here.
-
-Tue Mar 10 15:02:26 1998 Dave Brolley <brolley@cygnus.com>
-
- * actions.c (chill_handle_multi_case_label_range): Add more error checking.
- (chill_handle_multi_case_label): Implement (*) for multi dimensional CASE.
- (chill_handle_multi_case_label): Improve Error handling.
-
-Mon Mar 9 12:39:00 1998 Dave Brolley <brolley@cygnus.com>
-
- * actions.c (chill_handle_multi_case_label_range): Added.
- (chill_handle_multi_case_label): Add support for discrete ranges and
- discrete modes.
-
- * typeck.c (apply_chill_array_layout): Added more error checking.
- (apply_chill_field_layout): Added more error checking.
-
-Wed Mar 4 16:08:26 1998 Dave Brolley <brolley@cygnus.com>
-
- * convert.c (convert): Call build_simple_array_type with new argument.
-
- * ch-tree.h(build_simple_array_type): Add argument for array layout.
-
- * typeck.c (build_chill_slice): Call build_simple_array_type with new argument.
- (build_simple_array_type): Attach array layout to TYPE_ATTRIBUTES.
- (apply_chill_array_layout): New function to implement array layout.
- (layout_chill_array_type): Call apply_chill_array_layout and reset
- TYPE_ATTRIBUTES to NULL_TREE.
- (build_chill_array_type): Extend to handle one array layout per index mode.
- (smash_dummy_type): Call build_simple_array_type with new argument.
-
- * satisfy.c (satisfy): Call SATISFY on array layout tree.
-
-Wed Feb 25 14:36:41 1998 Dave Brolley <brolley@cygnus.com>
-
- * typeck.c (next_struct_offset): Added.
- (apply_chill_field_layout): New function to check and apply PACK, NOPACK,
- or POS layout to a structure field.
- (layout_chill_struct_type): Add call to apply_chill_field_layout.
-
- * satisfy.c (satisfy): Call satisfy recursively to handle the expressions
- in the field layout tree.
-
- * parse.c (pack_warn_printed): Remove.
- (nopack_warn_printed): Remove.
- (step_warn_printed): Remove.
- (pos_warn_printed): Remove.
- (parse_opt_layout): Remove warnings about POS, STEP, PACK and NOPACK usage.
-
- * decl.c (grok_chill_fixedfields): Check for POS specified for a list of
- field declarations.
-
-Thu Feb 19 17:33:06 1998 Dave Brolley <brolley@cygnus.com>
-
- * parse.c (parse_opt_layout): Generate syntax errors in pass 1 only.
- (parse_opt_mode): Removed incorrect comment about association of array
- layouts with nested array elements.
- (parse_opt_mode): Allow for one layout per index mode specified.
-
-Wed Feb 18 23:48:57 1998 Richard Henderson <rth@cygnus.com>
-
- * Make-lang.in (cc1chill): Kill lingering bc-opcode.h dependancy.
-
-Wed Feb 18 17:35:05 1998 Dave Brolley <brolley@cygnus.com>
-
- * parse.c (parse_field): Get rid of warning for multiple case selectors.
-
- * decl.c (layout_chill_variants): Fix loop indexing error.
-
-Mon Feb 16 15:54:47 1998 Dave Brolley <brolley@cygnus.com>
-
- * parse.c (parse_case_expression): Remove code which checked for
- unimplemented (ELSE) label.
- (parse_case_expression): Add code to handle multi dimensional case
- expression.
-
- * expr.c (check_case_selector_list): Fixed to return a list of the
- selectors which were checked.
- (chill_expand_case_expr): Remove "sorry" message for multi dimension
- case.
- (chill_expand_case_expr): Reverse order of case alternatives.
- (chill_expand_case_expr): Add "error" message for multiple case
- selectors.
-
- * actions.h (build_chill_multi_dimension_case_expr): Added.
-
- * actions.c (build_multi_case_selector_expression): Renamed from
- build_multi_case_expression.
- (chill_handle_multi_dimension_case_label): Call above function by its
- new name.
- (build_chill_case_expr): Don't reverse the list elements here. It may
- not be necessary.
- (build_chill_multi_dimension_case_expr): New function implements multi
- dimensional case expression.
-
-Thu Feb 12 15:44:50 1998 Dave Brolley <brolley@cygnus.com>
-
- * parse.c (parse_case_action): Implement multi-dimension CASE action.
- (parse_multi_dimension_case_action): Added.
- (parse_single_dimension_case_action): Added based on code moved from
- parse_case_action.
-
- * expr.c (check_case_selector_list): Added.
-
- * ch-tree.h (check_case_selector_list): Added.
-
- * actions.h (chill_handle_single_dimension_case_label): Added.
- (chill_handle_multi_dimension_case_label): Added.
-
- * actions.c (chill_handle_single_dimension_case_label): Added.
- (chill_handle_multi_case_label): Added.
- (chill_handle_multi_case_label_list): Added.
- (build_multi_case_expression): Added.
- (chill_handle_multi_dimension_case_label): Added
-
-Fri Feb 6 16:43:41 1998 Dave Brolley <brolley@cygnus.com>
-
- * actions.c (sizetype_tab): Fix declaration to match gcc changes.
-
-Thu Feb 5 14:03:00 1998 Dave Brolley <brolley@cygnus.com>
-
- * decl.c (chill_tree_code_type): Change this to be an array of char like
- the tree_code_type in the rest of gcc.
-
- * ch-tree.def (chill_tree_code_type): See decl.c.
-
-Thu Jan 29 15:34:18 1998 Dave Brolley <brolley@cygnus.com>
-
- * tasking.c (error_with_decl): Correct prototype.
- (build_gen_ptype): Reverse arguments.
-
- * lang.c (chill_real_input_filename): Add definition.
- (chill_print_error_function): Correct second argument.
- (lang_init): Set chill_real_input_filename.
-
- * expr.c (NULL): Protect definition with #ifndef.
-
- * decl.c (init_decl_processing): Don't allocate chill_tree_code_...
- (init_decl_processing): Change last argument to 'sizeof(char)'.
-
-
-Tue Nov 25 10:44:19 1997 Nick Clifton <nickc@cygnus.com>
-
- * Make-lang.in (mostlyclean): Use && to separate commands, so that
- if the directory change fails, the rule will not loop.
-
-Mon Mar 3 12:08:19 1997 Fred Fish <fnf@cygnus.com>
-
- * Make-lang.in (CHILL_FLAGS_TO_PASS): Remove extraneous leading
- spaces and use single tab character on some lines.
- (cc1chill): Ditto.
-
-Tue Nov 26 05:12:40 1996 Wilfried Moser <moser@rtl.cygnus.com>
-
- * tasking.c (build_receive_buffer_case_label): Rework in a manner,
- that the buffer location gets evaluated only once, in
- build_receive_buffer_case_end.
-
- * typeck.c (build_chill_bin_type): Rework.
- (layout_chill_range_type): Process BIN mode.
- (build_chill_array_type): Remove checking of layout. This is done
- at the parse.
-
- * parse.c (parse_on_exception_list): Don't allow ON name:.
- (parse_opt_layout): Parse POS and STEP and return a tree instead
- of int.
-
- * lex.c (init_lex), lex.h: Define and initialise RID_BIN.
-
- * grant.c (print_integer_type): Take care of BIN.
-
- * expr.c (build_chill_descr): Make descr static if requested
- location is static.
- (build_chill_length): Process text mode name and text location as
- described in Z.200/1992.
- (build_compare_expr): Don't allow < <= > >= for composite modes.
-
- * decl.c (grok_chill_fixedfields): Remove checking of
- layout. This is done at the parser.
-
- * convert.c (digest_structure_tuple): Take care of wrong (probably
- array) tuple. Printing error may cause sigsegv.
-
- * ch-tree.h: Change prototypes of grok_chill_fixedfields and
- build_chill_array_type (layout is passed now as a tree instead of
- int).
-
-Fri Nov 15 15:17:44 1996 Per Bothner <bothner@deneb.cygnus.com>
-
- * convert.c (display_int_cst): Check that val is INTEGER_CST.
- (digest_array_tuple): Some extra error checks (i.e. that indexes
- are constant). If dynamic mode, result is not constant.
-
-Mon Oct 28 12:48:06 1996 Jeffrey A Law (law@cygnus.com)
-
- * typeck.c (signed_or_unsigned_type): If the given type already
- as the correct signedness, then just return it.
-
- * typeck.c ({un,}signed_type): If can't do anything, call
- signed_or_unsigned_type.
-
-Fri Sep 6 02:50:08 1996 Wilfried Moser <moser@rtl.cygnus.com>
-
- * typeck.c (build_chill_cast): In case of rangecheck, take care of
- constant expression (when defining a SYN).
-
-Thu Sep 5 04:30:32 1996 Wilfried Moser <moser@rtl.cygnus.com>
-
- * parse.c (define__PROCNAME__): New function to define a SYNONYM
- __PROCNAME__ (__procname__) which is a character string containing
- the name of the current procedure. This is quit the same as
- __FUNCTION__ in C.
- (parse_proc_body): Add call to define__PROCNAME__.
-
- * typeck.c (chill_equivalent): Take care of NEWMODE'd procedure
- modes on one side and procedures on the other side..
-
-Wed Jul 24 01:13:51 1996 Wilfried Moser <moser@rtl.cygnus.com>
-
- * typeck.c: Replace all local variables and arguments named `index'
- with `idx', `index' gets replaced by `strchr' which makes debugging
- somehow difficult.
- (valid_array_index_p): New argument to indicate that we are processing
- LENGTH (varying string) on the lefthand side of an assignment. The
- index check is different in this case.
- (build_chill_cast): In case of expression conversion do an OVERFLOW
- check with the limits of the target mode.
-
- * ch-tree.h: New prototype for valid_array_index_p.
-
- * actions.c (expand_varying_length_assignment): Add new argument to
- call to valid_array_index_p to indicate we are processing
- LENGTH on the lefthand side of an assignment.
-
- * loop.c: Rename loop_stack to loopstack to avoid clashes with
- global variable ../stmt.c:loop_stack.
-
-Tue Jun 18 23:04:06 1996 Per Bothner <bothner@deneb.cygnus.com>
-
- * expr.c (resolve_component_ref): Set TREE_SIDE_EFFECTS properly.
-
-Mon Jun 10 15:01:51 1996 Per Bothner <bothner@deneb.cygnus.com>
-
- * typeck.c (build_chill_reference_type): Copy novelty for reference.
- * satisfy.c (satisfy): If REFERENCE_TYPE, copy novelty.
-
-Thu May 30 04:55:27 1996 Wilfried Moser <moser@rtl.cygnus.com>
-
- * typeck.c (valid_array_index_p): For varying character strings
- we must check if the index is less then the actual length instead
- of less equal.
-
-Wed May 15 06:07:10 1996 Wilfried Moser <moser@rtl.cygnus.com>
-
- * ch-tree.h: Add prototype for test_range.
-
- * inout.c (process_io_list): Fix duplicate function call if
- writetext argument is a function returning a varying string.
-
-Tue May 14 21:08:47 1996 Per Bothner <bothner@deneb.cygnus.com>
-
- Re-do string comparisons. Old way could re-use temporary
- (SAVE_EXPR created for an argumnet is variable) prematurely.
- * ch-tree.def (STRING_EQ_EXPR, STRING_LT_EXPR): New codes.
- * decl.c (init_decl_processing): Remove __eqstring, __gestring,
- __gtstring, __lestring, __ltstring, __nestring declarations.
- * expr.c (build_char_array_expr): Rename to build_compare_string_expr.
- Create STRING_EQ_EXPR, STRING_LT_EXPR nodes, instead of CALL_EXPRs.
- (chill_expand_expr): Implement STRING_EQ_EXPR, STRING_LT_EXPR.
- (build_compare_expr): Use new build_char_array_expr name.
-
-Mon Apr 8 14:08:30 1996 Per Bothner <bothner@kalessin.cygnus.com>
-
- Cleanup of April 5 fix:
- * actions.c (test_range): New function.
- (check_range): Simplify to use test_range.
- * convert.c (digest_powerset_tuple): Move error message from here ...
- (check_ps_range): ... to here. Also, simplify to use test_range.
-
-Fri Apr 5 03:41:05 1996 Wilfried Moser <moser@rtl.cygnus.com>
-
- * convert.c (check_ps_range): New function to perform range check
- of powerset tuple elements. This is quite the same as check_range,
- however, the actions on rangefail are different.
- (digest_powerset_tuple): Call check_ps_range.
-
- * loop.c (build_loop_iterator): Chaeck if location enumeration
- is requested for BOOLS(n) and print an error message.
-
-Wed Mar 6 17:46:48 1996 Per Bothner <bothner@kalessin.cygnus.com>
-
- * parse.c (parse_primval): Emit error if !ignore (before: pass==2).
-
- Implement parameterised array and string modes (using LANG_TYPE).
- * parse.c (parse_opt_mode): Handle parameterized arrays and strings.
- * grant.c (decode_mode): Support extended use of LANG_TYPE.
- * satisfy.c (cycle_error_print): Ignore non-decls in chain.
- (safe_satisfy_decl): No error if non-decl (pointer type) in cycle.
- (satisfy): Return immediately if laid out non-pointer type.
- (satisfy case LANG_TYPE): Handle paramertised mode.
- (satisfy case POINTER_TYPE/REFERENCE_TYPE): Push type on chain;
- return immediately if already in chain.
- * typeck.c (smash_dummy_type): Handle parameterized modes and CHAR(N).
- Change return type (can now return error_mark_node).
- (build_readonly_type): Return return value from smash_dummy_type.
- * ch-tree.h: Change smash_dummy_type return type.
-
-Tue Mar 5 22:31:20 1996 Per Bothner <bothner@kalessin.cygnus.com>
-
- * typeck.c (build_chill_slice): Re-do index_type calculation.
- * typeck.c (layout_chill_range_type): Use compare_int_csts rather
- than tree_int_cst_lt to avoid signed/unsigned problems.
-
- * typeck.c (copy_novelty): Use copy_node rather than build_type_node.
- * typeck.c (smash_dummy_type): Use copy_novelty for NEWMODE of range.
-
- * decl.c (init_decl_processing): More portable sizetype initialization.
-
- * tree.c (build_string_type): Generalize to also create bitstrings.
- Return error_mark_node if an argument is an ERROR_MARK.
- (build_bitstring_type): Simplify - just call build_string_type.
-
-Tue Mar 5 03:48:32 1996 Wilfried Moser <moser@blues.cygnus.com>
-
- * actions.c (warn_unhandled): Add missing assignment.
-
- * loop.c (build_loop_iterator): In case of IN, check if
- expression has a mode, otherwise make an error.
-
-Mon Mar 4 23:12:03 1996 Per Bothner <bothner@kalessin.cygnus.com>
-
- * convert.c (digest_powerset_tuple): Check tuple elements
- for compatibility; if compatible, call convert.
-
-Thu Feb 29 23:39:54 1996 Per Bothner <bothner@kalessin.cygnus.com>
-
- Simplify NOVELTY representation.
- * ch-tree.h (CH_NOVELTY): Re-implement as plain TYPE_CONTEXT.
- (CH_NOVELTY_FLAG): Removed. (Just use CH_NOVELTY.)
- * decl.c (push_modedef): Make copy even for SYNMODE.
- but not for internal typedefs (indicated by make_newmode==-1).
- * tasking.c: Call push_modedef with make_newmode==-1.
- * typeck.c (chill_novelty): Remove.
- (smash_dummy_type): Removed unused event/buffer stuff. Update.
- * grant.c (decode_decl), inout.c (build_io_types),
- expr.c (build_concat_expr), typeck.c (build_chill_slice, copy_novelty),
- tasking.c (build_instance_type): Simplify using new CH_NOVELTY.
-
- Solidify READ mode handling.
- * decl.c (do_decl, push_syndecl, start_chill_function):
- Possibly set TREE_READONLY for a VAR_DECL, CONST_DECL, or PARM_DECL.
- * typeck.c (build_chill_slice): Set TREE_READONLY appropriately.
- (build_chill_array_ref_1, build_chill_bitref): Likewise.
- (build_chill_cast): Set TREE_READONLY depending on result type (only).
- * convert (convert_from_reference, convert): Likewise.
- * expr.c (resolve_component_ref): Set TREE_READONLY appropriately.
- (build_chill_function_call): Error if OUT/INOUT arg is TREE_READONLY.
- * actions.c (chill_expand_assignment): Also error if TREE_READONLY.
- Use convert_from_reference.
-
-Thu Feb 29 11:14:09 1996 Per Bothner <bothner@kalessin.cygnus.com>
-
- * parse.c (parse_do_action): DO WITH expressions are evaluated in
- outer scope. Also call save_if_needed.
- * decl.c (shadow_record_fields); Fix and simplify.
-
-Tue Feb 27 22:19:40 1996 Per Bothner <bothner@cygnus.com>
-
- * convert.c (display_int_cst): Gereralize to wider range of ints.
-
-Thu Feb 22 06:12:59 1996 Wilfried Moser <moser@rtl.cygnus.com>
-
- * convert.c (digest_array_tuple): Take care of type == error_mark_node.
-
- * decl.c (do_decl): In case of chill_varying_type_p, check if
- type of fixed part is error mark and do nothing in this case.
-
- * lex.c (convert_bitstring): Don't complain when length of
- bitstring is 0 (BOOLS(0) is a valid mode).
-
- * tree.c (layout_powerset_type): Add check for TYPE_MAX/MIN_VALUE
- (domain) is error mark.
-
- * typeck.c (layout_chill_range_type): If lowvalue or highvalue ==
- error_mark_node, just return.
-
-Tue Feb 20 00:01:10 1996 Wilfried Moser <moser@rtl.cygnus.com>
-
- * parse.c (parse_variant_alternative): When checking for ELSE take
- care of tagless variants.
-
-Mon Feb 19 05:54:45 1996 Wilfried Moser <moser@rtl.cygnus.com>
-
- * parse.c (parse_case_action): Check if ELSE was specified
- in a case label list (this is only valid for array tuples).
- (parse_case_expression): Deto.
- (parse_variant_alternative): Deto.
-
-Tue Feb 13 17:08:16 1996 Per Bothner <bothner@kalessin.cygnus.com>
-
- * typeck.c (chill_location): Cleanup. Neither SLICE_EXPR nor
- BIT_FIELD_REF are referable, even if their base strings are.
-
-Fri Feb 9 02:25:33 1996 Wilfried Moser <moser@rtl.cygnus.com>
-
- * actions.c (chill_expand_result): Do CH_FUNCTION_SETS_RESULT after
- checking the expression.
-
- * convert.c (convert): Set TREE_CONSTANT when taking the
- address of a function.
-
- * decl.c (start_chill_function): Check if the mode is really
- a mode to avoid subsequent segfaults.
-
- * typeck.c (string_assignment_condition): Add checking of
- bitstring length.
-
-Thu Feb 8 01:37:59 1996 Wilfried Moser <moser@rtl.cygnus.com>
-
- * actions.c (build_cause_exception): Print warning of unhandled
- exception only once for each exception.
-
-Mon Feb 5 22:17:13 1996 Per Bothner <bothner@kalessin.cygnus.com>
-
- * tree.c (discrete_count), ch-tree.h: New function.
- * expr.c (build_concate_expr, build_chill_repetition_op,
- chill_expand_expr): Use discrete_count; make sure arguments
- to size_binop are sizetype.
- (powersetlen): Trvialize using discrete_count.
-
- * inout.c (process_io_list): Use new assign_temp function.
- * inout.c (build_enum_tables): Avoid taking address of array_ref,
- which sometimes gets optimized to a constant.
-
- * expr.c (finish_chill_unary_op): Call convert_to_class on argument.
- Remove some obsolete TREE_UNSIGNED stuff.
- * lex.c (convert_integer): Removed more TREE_UNSIGNED stuff.
-
-Thu Feb 1 15:11:20 1996 Doug Evans <dje@charmed.cygnus.com>
-
- * lex.c (check_newline): Return result of HANDLE_PRAGMA.
-
-Wed Jan 31 17:13:25 1996 Per Bothner <bothner@kalessin.cygnus.com>
-
- * decl.c (char_array_type_node, wchar_array_type_node): Removed.
- (init_decl_processing): Remove array_domain_type; don't set
- char_array_type_node or wchar_array_type_node.
- * decl.c (init_decl_processing): Use fixup_unsigned_type to
- simplify code to create boolean_type_node and char_type_node.
-
-Mon Jan 29 14:20:10 1996 Doug Evans <dje@charmed.cygnus.com>
-
- * lex.c (check_newline): Pass character after `#pragma' to
- HANDLE_PRAGMA. Don't call get_directive_line if at end of line.
-
-Fri Jan 26 05:56:27 1996 Wilfried Moser <moser@rtl.cygnus.com>
-
- * expr.c (build_chill_function_call): Add check and error for
- actual argument is a TYPE_DECL.
-
- * parse.c (parse_set_mode): Print a warning if the set mode contains
- numbered and unnumbered set elements.
-
-Wed Jan 24 05:10:08 1996 Wilfried Moser <moser@rtl.cygnus.com>
-
- * Make-lang.in: Change GNUCHILL_VERSION to 1.5.2.
-
- * decl.c (layout_enum): Add check for negative values if
- enum is numbered and duplicate values in an enum.
-
-Mon Jan 15 06:21:52 1996 Wilfried Moser <moser@rtl.cygnus.com>
-
- * actions.c (chill_expand_assignment): Add check for lefthand side
- of an assignment is a location.
-
- * ch-tree.def: Name of SET_IN_EXPR is really "set_in_expr" and
- not "concat_expr".
-
- * expr.c (is_really_instance): New function to check if a datum
- is really an instance. CH_IS_INSTANCE_MODE seems to be to weak
- for this case.
- (build_chill_component_ref): call is_really_instance.
-
-Wed Jan 10 13:47:14 1996 Per Bothner <bothner@kalessin.cygnus.com>
-
- * ch-tree.h (TYPE_ARRAY_MAX_SIZE): Removed; now in ../tree.h.
-
-Mon Jan 8 15:29:20 1996 Per Bothner <bothner@kalessin.cygnus.com>
-
- * expr.c (build_char_array_expr): Add save_if_needed's if varying.
- Also, remove unused len0 and len1.
-
-Mon Dec 11 17:36:44 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * inout.c (build_chill_associate, assoc_call, build_chill_readrecord,
- build_chill_getassociation, build_chill_getusage,
- build_chill_gettextrecord, build_chill_gettextaccess: Simplify
- - modify TREE_TYPE of CALL_EXPR, instead of building a CONVERT_EXPR.
-
- * parse.c (parse_action): Minor simplification.
-
-Thu Dec 7 00:02:47 1995 Wilfried Moser <moser@rtl.cygnus.com>
-
- * parse.c (parse_action): In case of CALL, do a check if there
- is really a function call.
-
-Tue Dec 5 05:06:02 1995 Wilfried Moser <moser@rtl.cygnus.com>
-
- * convert.c (display_int_cst): Fix printing of control sequence.
-
-Thu Nov 30 21:07:57 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * grant.c (decode_constant, decode_constant_selective): Make work
- for REAL_IS_NOT_DOUBLE case.
-
- * decl.c (CHILL_INT_IS_SHORT): New macro.
- (init_decl_processing): Use CHILL_INT_IS_SHORT.
- Change name of integer_type_node from _cint to long.
-
-Mon Nov 27 17:07:05 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * loop.c (top_loop_end_check): Check while condition *after*
- getting next powerset element.
-
-Mon Nov 27 05:29:52 1995 Wilfried Moser <moser@rtl.cygnus.com>
-
- * parse.c (parse_receive_case_action): Fix typo in error message.
-
- * convert.c (display_int_cst): Format characters like strings in
- grant.c(decode_constant).
-
- * grant.c: Remove the old forbid stuff.
-
- * lex.c (readstring): Fix reading of '^^'.
-
- * parse.c (parse_procedure_mode): nreverse param_types.
-
-Thu Nov 23 05:39:57 1995 Wilfried Moser <moser@rtl.cygnus.com>
-
- * actions.c (chill_expand_assignment): Check for assigning to
- location with non-value mode.
-
- * ch-tree.h: New macro CH_TYPE_NONVALUE_P.
- Add new and change some prototypes.
-
- * decl.c (init_nonvalue_struct): New function to generate
- initialisation code for non-value structs.
- (init_nonvalue_array): New function to generate initialisation
- code for non-value array's.
- (do_decl): Call one of the above mentioned functions in case
- we have a mode with the non-value property.
- (start_chill_function): Print error message if a non-value mode
- gets returned without LOC and check for arguments of non-value
- modes only gets passed by LOC.
-
- * grant.c (print_proc_tail): Fix for procedure returning LOC.
-
- * inout.c (build_io_types): Set CH_TYPE__NONVALUE_P on
- association_type_node.
- (invalidate_access_recordmode): New function to set the
- record mode of an ACCESS to error_mark_node in case of
- record mode has the non-value property.
- (build_text_mode): Set CH_TYPE_NONNVALUE_P.
- (build_access_mode, build_chill_gettextaccess): Deto.
- (check_exprlist): Correct processing of repetition factor.
-
- * lex.c (readstring): Correct processing of control
- sequences of the form '^([H | D | O | B]'xx)'.
-
- * loop.c: Cleanup iterator handling (done by Per).
- (nonvalue_begin_loop_scope, nonvalue_end_loop_scope): New
- functions for starting and ending a loop scope in case
- of initialising an array with non-value property.
-
- * parse.c (check_end_label): Remove '\n' from error message.
- (parse_loc_declaration): Print error in case of loc-identity
- declaration without initialisation or with keyword INIT.
- (parse_do_action): Clean up iterator handling (done by Per).
-
- * satisfy.c (safe_satisfy_decl (case TYPE_DECL)): Print an error
- message in case of TYPE_DECL is a signal and the mode has the
- non-value property.
- (satisfy (case ARRAY_TYPE)): Set CH_TYPE_NONVALUE_P of the
- the array type if the array element mode has the non-value
- property.
- (satisfy case RECORD_TYPE)): Set CH_NONVALUE_P on the record
- type if one of the fields have the non-value property. If the
- record is a buffer mode and the element mode of the buffer has
- the non-value-p., invalidate it (see
- tasking.c (invalidate_buffer_element_mode). Same for access modes.
-
- * tasking.c (build_signal_descriptor): If the signal type have
- the non-value property, do nothing.
- (build_receive_signal_case_label): Don't do an assignment if the
- signal type have the non-value property.
- (build_receive_buffer_case_label): Add check for buffer element
- mode is ERROR_MARK.
- (expand_send_buffer): Deto.
- (build_buffer_type): Set CH_TYPE_NONVALUE_P on buffer mode.
- (invalidate_buffer_element_mode): New function to set type of
- buffer element mode to error_mark_node.
- (build_event_type): Set CH_TYPE_NONVALUE_P on event mode.
-
-Wed Nov 15 13:26:20 1995 Jeffrey A Law (law@cygnus.com)
-
- * inout.c (intsize_of_charsexpr): Move declaration to top
- of file to avoid error from solaris2.5 cc.
-
-Thu Nov 9 02:50:40 1995 Wilfried Moser <moser@rtl.cygnus.com>
-
- * satisfy.c (satisfy): For a RECORD_TYPE, which is an ACCESS or TEXT
- mode, temporarily reset maximum_field_alignment to 0 before
- layouting it to be compatible with the runtime library.
-
- * inout.c (build_chill_gettextaccess): Deto.
-
-Mon Nov 6 04:12:06 1995 Wilfried Moser <moser@rtl.cygnus.com>
-
- * decl.c (do_decl): If type is READonly, add check if an
- ASSOCIATION, ACCESS, TEXT, BUFFER, or EVENT will be declared
- and print an error if this is true. Variables of this modes
- may not be declared READonly.
- Add check for mode is one of the above and an init value was
- given. This is also not allowed.
- Add initialisation of variables of the above modes during
- runtime. This influence the mechanism for detecting to
- build a constructor.
- (push_modedef): NEW- or SYNMODES of ASSOCIATION, ACCESS, TEXT,
- BUFFER, and EVENT mode must not be READonly.
- (start_chill_function): Arguments of modes ASSOCIATION, ACCESS,
- TEXT, BUFFER, or EVENT may be passed only by LOC. Add this check.
- (declare_predefined_file): Move to inout.c.
- (init_decl_processing): Add definitions for new built-in's.
- (finish_outer_function): Build a constructor only if
- build_constructor is set.
-
- * except.c: On Linux native, setjmp is __setjmp.
-
- * expr.c (build_chill_component_ref): New function. It gets called
- from parse.c instead of build_component_ref. Functions checks if the
- user tries to access a field of an ACCESS, ASSOCIATION, BUFFER,
- EVENT, INSTANCE, or TEXT mode, which actually is not allowed.
- (build_chill_floatcall): New function to resolve CHILL's floating
- point builtin calls (SIN, COS, TAN, etc.).
- (build_allocate_getstack, build_chill_allocate, build_chill_getstack,
- build_chill_terminate): New functions to resolve CHILL's ALLOCATE,
- GETSTACK, and TERMINATE built-in's.
- (build_generalized_call): Process new built-in's.
-
- * grant.c (decode_mode): Add processing of ACCESS and TEXT modes.
- (decode_mode_selective): deto.
-
- * inout.c: Completely rewritten for implementing Chapter 7 of
- Z.200 (input and output).
-
- * lex.c (yylex): An '_' after a '.' doesn't mean, that we are
- parsing numbers.
-
- * lex.h (enum rid): Add RID_ASSOCIATION.
-
- * parse.c: New flag build_constructor to indicate if a constructor
- should be generated at the end of compilation or not. See
- decl.c(do_decl).
- (parse_begin_end_block): Don't emit a line note.
- (parse_primval): Call build_chill_component_ref instead of
- build_component_ref.
- (parse_opt_mode): Process ACCESS modes, ASSOCIATION modes, TEXT
- modes, USAGE modes, WHERE modes.
-
- * satisfy.c (safe_satisfy_decl): Check if a SYN is of mode ASSOCIATION,
- ACCESS, TEXT, BUFFER, or EVENT and print an error in this case.
- (satisfy (case RECORD_TYPE)): If exp is TEXT mode, check the text length.
-
- * typeck.c (extract_constant_from_buffer): Fix thinko in case
- of ! BYTES_BIG_ENDIAN.
- (build_chill_cast): Implement representation conversion between
- INT's and REAL's.
- (chill_similar): Add check of ACCESSes.
- (layout_chill_range_type): Check for real ranges and print
- sorry message.
-
- * Make-lang.in: Change compiler version.
- chill also depends on Makefile.
-
- * chill.in: Process command line option -Xlinker like -Tdata.
-
- * ch-tree.h: New macros CH_IS_ASSOCIATION_MODE, CH_IS_ACCESS_MODE,
- CH_IS_USAGE_MODE, CH_IS_WHERE_MODE, and CH_IS_TEXT_MODE.
- Add some prototypes.
- (enum chill_built_in_function): Add BUILT_IN_ARCCOS, BUILT_IN_ARCSIN,
- BUILT_IN_CH_DELETE, BUILT_IN_LOG, BUILT_IN_SQRT.
- Remove BUILT_IN_READLEN, BUILT_IN_ROUND, BUILT_IN_SKIPRECORD.
-
- * gperf, hash.h: Remove definition of WHERE.
-
-Thu Oct 5 06:22:19 1995 Wilfried Moser <moser@rtl.cygnus.com>
-
- * grant.c (decode_constant_selective): Add some newlines
- to generated SPEC MODULE.
-
-Wed Oct 4 18:16:44 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * decl.c (pop_chill_function_context): Remove some bogosity.
-
-Wed Oct 4 05:14:00 1995 Wilfried Moser <moser@rtl.cygnus.com>
-
- * grant.c (print_integer_selective): In case of a RANGE of
- a SET mode, try to find and grant the parent mode.
- (grant_seized_identifier): Dont write it out, if the identifier
- doesn't have a seize file (it may come from a SPEC MODULE
- defined in the compilation unit).
-
-Fri Sep 22 14:04:40 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * actions.c (check_non_null): Wrap expr in SAVE_EXPR if needed.
-
-Wed Sep 20 13:51:54 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * expr.c (force_addr_of): Optimize an INDIRECT_REF using
- convert_to_pointer rather than convert (which in case of
- a REFERENCE_TYPE would losingly call convert_from_reference).
-
-Wed Sep 20 04:03:58 1995 Wilfried Moser <moser@rtl.cygnus.com>
-
- * inout.c (build_chill_writetext): In case of character string:
- Add processing of a concatenation including varying character
- strings.
- (intsize_of_charsexpr, get_max_size): New functions to determine
- the maximum size of varying character strings.
-
- * grant.c (decode_constant, decode_constant_selective): Add
- processing of COMPONENT_REF.
-
- * satisfy.c (satisfy (case COMPONENT_REF)): Correct handling
- for SYNONYM's with STRUCT mode.
-
-Mon Sep 18 17:25:11 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * expr.c (force_addr_of): Optimize of value is INDIRECT_REF.
- * typeck.c (build_chill_slice): Call mark_addressable.
-
-Mon Sep 18 14:38:15 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * expr.c (chill_expand_expr): Make a copy before calling __psslice
- if the array is neither referable nor BLKmode.
- (build_set_expr): Renamed to ...
- (build_compare_set_expr): Allow one opperand to be boolean.
- (build_compare_expr): Check both operands for SET_EXPR,
- before checking for discrete types (for -fold-strings).
-
-Fri Sep 15 11:35:43 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * satisfy.c (safe_satisfy_decl): For a CONST_DECL, set TREE_TYPE
- to error_mark_node or error.
-
-Fri Sep 15 00:26:02 1995 Wilfried Moser <moser@rtl.cygnus.com>
-
- * grant.c (decode_constant_selective): Add processing of
- TREE_OPERAND (val, 0).
-
-Wed Sep 13 14:24:12 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * ch-tree.h (CH_IS_INSTANCE_MODE): Redefine to use CH_SIMILAR.
- * convert.c (convert): Use CH_IS_INSTANCE_MODE.
- * inout.c (build_chill_writetext): Likewise.
- * tasking.c (build_receive_case_start, build_delay_case_start): Ditto.
- * parse.c (parse_start_action): Remove redundant tests.
- * tasking.c (build_start_process): Also test that optset is instance.
- (build_copy_number, build_proc_type, expand_send_signal): Use
- CH_IS_INSTANCE_MODE, not CH_COMPATIBLE.
- * actions.c, convert.c (instance_type_node): Remove redundant
- extern declaration.
-
-Wed Sep 13 14:19:37 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * regression.awk2: Use \ line-continuation-markers
- to remove gratuitous gawk dependency.
-
-Mon Sep 11 17:26:53 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * typeck.c (build_chill_modify_expr): Use force_addr_of.
- (mark_addressable): Handle INDIRECT_REF of ADDR_EXPR.
-
- * typeck.c (check_case_value), ch-tree.h: Moved to ...
- * actions.c (check_case_value): ... here. Also check for
- compatibility with selector (which is passed as extra argument).
- (chill_handle_case_label_range): Take selector argument,
- and use it to call check_case_value.
- (chill_handle_case_label): Take extra selector argument.
- * ch-tree.h (chill_handle_case_labe): Add prototype.
- * except.c expr.c, parse.c: Remove chill_handle_case_label prototypes.
- * actions.c, except.c, expr.c, parse.c: Pass extra selector
- argument to function calls as needed.
-
-Mon Aug 28 02:47:54 1995 Wilfried Moser <moser@rtl.cygnus.com>
-
- * grant.c (decode_constant_selective): Fix a bug in writing items
- to grant file.
-
-Thu Aug 24 04:52:28 1995 Wilfried Moser <moser@rtl.cygnus.com>
-
- * parse.c (parse_case_expression): Print warning only in
- pass 1.
-
- * actions.c (print_missing_cases): Correct printing of
- character ranges.
-
-Wed Aug 23 15:26:12 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * parse.c (parse_case_label_list): Take extra parameter to
- indicate if we're parsing a tuple or a case-label-spec.
- If former, don't allow '(' EXPR ')' ',' but backup instead.
- (parse_case_label_specification, parse_tuple_element):
- Pass appropriate new argument to parse_case_label_list.
-
-Wed Aug 23 06:08:28 1995 Wilfried Moser <moser@rtl.cygnus.com>
-
- * inout.c (build_chill_readtext): Add processing of BOOL's and
- CHARS(n).
-
- * grant.c (decode_constant): Process nonprintable characters
- in a STRING_CST.
-
-Fri Aug 11 15:26:13 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * except.c (initialize_exceptions): Name setjmp "setjmp" and not
- "__builtin_setjmp" (which is not recognized by expand_call).
-
-Wed Aug 9 23:35:36 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * loop.c (end_loop_scope): Need to call kept_level_p,
- in argument to poplevel.
-
-Wed Aug 9 05:48:30 1995 Wilfried Moser <moser@rtl.cygnus.com>
-
- * Make-lang.in (CHILL.install-common): Don't install chill-cross (this
- file might be empty). Install chill.install instead.
-
-Tue Aug 8 21:46:30 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * loop.c (end_loop_scope): Do poplevel *after* expand_end_bindings.
-
-Tue Aug 8 00:51:09 1995 Wilfried Moser <moser@rtl.cygnus.com>
-
- * tasking.c (build_process_header): Also set DECL_ASSEMBLER_NAME
- of PARAM_DECL, since otherwise dbxout_symbol_name may barf.
-
- * decl.c (start_chill_function): Likewise ...
-
-Mon Aug 7 18:35:35 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * tasking.c (build_process_wrapper): Also set DECL_ASSEMBLER_NAME
- of PARM_DECL, since otherwise dbxout_symbol_name may barf.
-
-Mon Jul 31 14:32:33 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * loop.c: Re-written implementation of powerset iteration.
- (declare_temps): iter_var is now integer index into bitstring,
- and powerset_temp just uses save_expr (normally needs no temp).
- (top_loop_end_check): Pass index to start searching (from iter_var)
- to library function, instead of dependning on latter to clear old bits.
- (increment_temps): UNless DOWN, increment iter_var.
- * decl.c (init_decl_processing): Declare new types for
- __ffsetclrpowerset and __flsetclrpowerset (now misnamed...).
-
-Mon Jul 31 12:47:28 1995 Per Bothner <bothner@cygnus.com>
-
- * convert.c (digest_array_tuple): Set TREE_STATIC if possible.
-
-Fri Jul 28 05:11:56 1995 Wilfried Moser <moser@rtl.cygnus.com>
-
- * lex.c (readstring): Process integer literals starting with
- H', D', or B' within a control sequence.
-
-Thu Jul 27 23:08:51 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * parse.c (parse_do_action): Don't call push_action, but defer
- push_handler until begin_loop_scope.
- Call parse_opt_handler here, to move handler scope inside loop block.
- (parse_action): After do_action, nothing to do now.
- * loop.c (begin_loop_scope): Also call push_handler here.
- (declare_temps): Copy derived flag to user_var.
- (declare_temps): For POWERSET, always copy to temporary (even if
- constant), since the runtime clears bits from it.
-
- * expr.c (build_chill_sizeof): Use convert_to_class.
- * satisfy.c (safe_satisfy_decl): Cleanup handling of CONST_DECL -
- set proper value of CH_DECL_FLAG on both the decl and its value.
-
- * convert.c (digest_array_tuple); Slightly better errors.
-
-Wed Jul 26 22:13:39 1995 Per Bothner <bothner@cygnus.com>
-
- * expr.c (expand_packed_set): Also allocate the CONSTRUCTOR itself.
- (fold_set_expr): Simplify accordingly.
- (build_concat_expr): Constant fold bitstring CONCAT_EXPRs.
-
-Thu Jul 13 12:21:22 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * typeck.c (build_chill_slice): Use build1 instead of build.
- * typeck.c (xtract_constant_from_buffer): Pass correct precision
- to lshift_double.
-
- * typeck.c (expand_constant_to_buffer): Handle RANGE_EXPR index.
- * convert.c (digest_array_tuple): Generate RANGE_EXPR as index
- for tuples with ranges.
-
-Thu Jun 29 23:41:15 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * typeck.c (build_chill_slice): Re-implement to use casts
- instead of build_chill_array_ref_1 (which doesn't always work).
- * convert.c (convert): Remove old bugs code.
-
-Tue Jun 27 05:00:04 1995 Wilfried Moser <moser@rtl.cygnus.com>
-
- * parse.c (parse_if_action): Do PUSH_ACTION before parsing the
- expression so that a possible handler at the if action will
- be found.
- (parse_proc_body): New argument to indicate if the function
- raises exceptions or not. In case the function will raise
- exception: start a handler, parse the function and generate
- code for reraising the exceptions (call chill_reraise_exceptions).
-
- * except.c (chill_reraise_exceptions): New function to generate
- code for reraising exceptions are specified at the function
- definition.
-
- * ch-tree.h: Add prototype for chill_reraise_exceptions.
-
- * decl.c (build_chill_function_type): When the function (type)
- raise an exception, generate two new arguments (additional to the
- formal parameters), the filename and linenumber of the caller.
- (start_chill_function): likewise...
-
- * expr.c (build_chill_function_call): If the called function raises
- exceptions, give current filename and linnumber as aditional
- arguments.
-
- * actions.c (build_cause_exception): Handle case when function
- propagates the exception.
-
- * grant.c (print_proc_tail, print_proc_tail_selective): If the
- function(type) raises exceptions, don't process the last to
- parmeters of the formal argument list, they are compiler
- generated.
-
- * typeck.c (chill_similar): In case of FUNCTION_TYPE: check if
- the exception lists are equal.
-
-Thu Jun 22 19:27:47 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * loop.c (flag_local_loop_counter): Change default to 1.
- (end_loop_scope): Set 'keep' parameter in poplevel call.
- (declare)_temps): Don't set IDENTIFIER_LOCAL_VALUE, since that
- is handled (correctly!) by pushdecl.
- (begin_loop_scope): Call pushlevel here,
- * parse.c (parse_do_action): Move pushlevel so only called for WITH.
- * decl.c (struct scope): Remove n_incomplete field and its uses.
- (pushdecl): Re-write to use proclaim_decl. Remove old C-isms.
- (init_decl_processing): Re-name integer_type_node as "_cint" to
- remove complaint from pushdecl about chill_integer_type_node as "int".
-
-Tue Jun 20 18:15:58 1995 Doug Evans <dje@canuck.cygnus.com>
-
- * Make-lang.in (chill-runtime): Restore patch to disable building of
- runtime libraries for cross compilers. This patch should remain
- until a build of a freshly checked out devo "just works".
-
-Mon Jun 19 06:01:42 1995 Wilfried Moser <moser@rtl.cygnus.com>
-
- * Make-lang.in: Update GNUCHILL_VERSION to 1.4.4.
-
- * decl.c (init_decl_processing): Remove builtin function
- __cause_exception. New builtin functions __cause_ex1 and
- __unhandled_ex.
-
- * except.c (is_handled): Return 0 when no handler found,
- 1, if the handler is in local scope and 2, if function
- may propagate the exception.
-
- * actions.c (build_cause_exception): New argument to
- indicate if a warning should be printed when
- causing an unhandled exception. Call is_handled here.
-
- * ch-tree.h: Change prototype for build_cause_exception.
- New marco CH_ALREADY_GRANTED. Used in grant.c to determine if an
- identifier already has been written to grant file.
-
- * grant.c (write_spec_module): If not GRANT ALL specified,
- write only this identifiers to grant file which are
- neccessary to form a prober grant file. This will shorten
- grant files and speed up compilation.
- (decode_constant_selective, decode_mode_selective,
- get_type_selective, decode_decl_selective,
- grant_array_type_selective, get_tag_value_selective,
- print_enumeral_selective, print_integer_selective,
- print_struct_selective, print_proc_tail_selective,
- grant_one_decl_selective): New functions.
-
- * lex.c (yywrap): Remove writing of not yet written USE_SEIZE_FILE
- directives to grant file.
-
- * parse.c (parse_on_exception_list): Fis constructing of
- exceptions list.
-
-Wed Jun 14 15:21:54 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * typeck.c (valid_array_index_p): Check for syntax error, where
- index is a mode, rather than a value.
-
- * expr.c (build_chill_binary_op_1): Remove unused function.
-
-Sat Jun 10 11:36:52 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * except.c (is_handled): New function.
- Various fixes here and there to make it work.
-
- * parse.c (parse_param_name_list): Set DECL_ASSEMBLER_NAME.
- (Otherwise dbxout may crash.)
-
- * satisfy.c (satisfy case FUNCTION_TYPE): Check for non-type result.
- * decl.c (start_chill_function): If result type was error_mark,
- kludge type chill_os result_decl to avoid extra errors.
- * actions.c (chill_expand_result, chill_expand_return): If type of
- chill_result_decl is error_mark, do nothing.
-
- * typeck.c (chill_similar): Fix thinko in recent change.
-
- * config-lang.in (diff_exclude): Remove ch/lex.c - now it's a
- true source file, and is never longer generated with [f]lex.
-
- * regression.sh: Pass -s to make clean (to make it silent).
- Explicitly call gawk, instead of depending of '#!' to work.
- Add --objdir flags. Never send mail to bill.
-
-Thu Jun 8 15:08:35 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * typeck.c (chill_similar): Add extra parameter. Use to to prevent
- infinite recursion.
- (chill_equivalent, chill_l_equivalent): Also add new parameter.
- * ch-tree.h (CH_SIMILAR, CH_EQUIVALENT): Modify to match.
-
-Tue Jun 6 17:14:49 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * loop.c (declare_temps): If -flocal-loop-counter, make sure to
- pushdecl the new variable (created with decl_temp1).
- And fix the type of the local variable for powerset iteration.
-
-Tue Jun 6 15:07:19 1995 Per Bothner <bothner@cygnus.com>
-
- * typeck.c (mark_addressable): Handle ADDR_EXPR inside
- NOP_EXPR inside INDIRECT_EXPR. For TRUTH_ANDIF_EXPR,
- TRUTH_ORIF_EXPR, and COMPOUND_EXPR mark operand 1, not operand 0
- (which is used for range-checks and suchlike).
-
-Thu Jun 1 02:45:54 1995 Wilfried Moser <moser@rtl.cygnus.com>
-
- * expr.c (build_set_expr): Do some optimizations for LE_EXPR and
- GE_EXPR (don't do invert_truthvalue, just switch operands).
-
-Wed May 31 14:00:38 1995 Doug Evans <dje@canuck.cygnus.com>
-
- * lang-options.h: New file.
- * lang-specs.h: New file.
-
-Wed May 24 01:45:18 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * actions.c (assign_stack_temp): Remove unneeded declaration.
-
-Tue May 23 00:17:38 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * parse.c (parse_on_exception_list): Return list of exception
- names in pass 1, not in pass 2. (Return non-NULL dummy if pass 2.)
- (parse_on_alternatives): Call chill_handle_on_labels even if ignoring.
- (parse_opt_handler): Likewise for chill_start_default_handler.
- * except.c (push_handler): Clear on_alt_list only if pass 1.
- (chill_handle_on_labels): Build on_alt_list in pass 1,
- retrieve it in pass 2.
-
- Fix so that decl_temp1 does not expand_decl_init, which calls
- free_temp_slots, which loses in the middle on an expression.
- * decl.c (finish_decl): Don't call expand_decl_init.
- (do-decl): Do initialization assignment even if stack variable.
- * parse.c (parse_loc_declaration): Call free_temp_slots.
-
- * decl.c (finish_decl), ch-tree.h: Remove last two always-NULL
- parameters. Cleanup never-used code.
- * decl.c, except.c: Update calls to finish_decl.
-
- * decl.c (case_else_node): Define new variable.
- (init_decl_processing): Initialize it.
- (make_chill_variants): If variant label is case_else_node (i.e. it
- is (ELSE):), treat that as an ELSE variant.
- * ch-tree.h (case_else_node): Declare case_else_node.
- * parse.c (parse_case_label): Use case_else_node.
-
-Mon May 22 10:18:11 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * grant.c (print_proc_tail): Also call print_proc_exceptions.
- (decode_decl): Don't explicitly call print_proc_exceptions for
- FUNCTION_DECL.
- (Net effect is that now exceptions are printed for FUNCTION_TYPE too.)
-
- * actions.c (chill_convert_for_assignment): Use save_if_needed,
- instead of save_expr, in case value is a reference.
-
- * typeck.c (build_chill_slice): Fix old thinko (missing call to
- build_pointer_type).
-
- * actions.c (size_int): Remove unused and conflicting prototype.
-
-Wed May 17 16:23:20 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * actions.c (chill_convert_for_assignment): Call save_expr if
- range_checking (twice).
-
-Tue May 16 11:33:41 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * typeck.c (layout_chill_range_type): Re-organize error checking.
- Add extra parameter to indicate if non-constant bounds are allowed.
- If bounds are bad, set them to the min_value of the parent.
- * ch-tree.h (layout_chill_range_type): Update declaration.
- * satisfy.c (satisfy): Update call of layout_chill_range_type.
- * typeck.c (build_chill_range_type): Likewise.
- * tree.c (build_string_type): Likewise.
-
-Tue May 16 00:37:51 1995 Wilfried Moser <moser@rtl.cygnus.com>
-
- * expr.c (build_chill_sizeof): Fix bug in case of SIGNAL.
-
-Mon May 15 12:54:32 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * satisfy.c (satisfy): Supress error message for REF <error_mark>.
- * decl.c (push_modedef): Check for TREE_CODE != ERROR_MARK, instead
- of against error_mark_node. (smash_dummy_type can copy error marks.)
- (finish_decl): Simplify C-derived check for incomplete type,
- and suppress if it is an ERROR_MARK.
- Don't call rest_of_decl_compilation if type is an ERROR_MARK.
-
-Sun May 14 22:52:40 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * convert.c (convert): Handle array types with different modes.
-
-Thu May 11 15:52:12 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * loop.c (build_loop_iterator): Handle the case of a non-local
- loop counter having reference type.
-
-Thu May 11 07:04:29 1995 Wilfried Moser <moser@rtl.cygnus.com>
-
- * tasking.c (build_copy_number, build_gen_code, build_gen_inst,
- build_gen_ptype, build_proc_type): Set CH_DERIVED_FLAG on result
- to avoid erros when assigning to (comparing with) NEWMODEd INT's.
-
-Mon May 8 15:27:16 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * expr.c (build_chill_card): Do constant folding, if possible.
- (build_max_min): Do constant folding for MIN/MAX of powersets.
-
-Mon May 8 06:57:21 1995 Wilfried Moser <moser@rtl.cygnus.com>
-
- * expr.c (build_chill_sizeof): Add corect processing of a
- SIGNAL definition without data.
-
-Sat May 6 16:27:10 1995 Doug Evans <dje@canuck.cygnus.com>
-
- * Make-lang.in (maintainer-clean): Renamed from realclean.
-
-Tue May 2 06:16:23 1995 Wilfried Moser <moser@rtl.cygnus.com>
-
- * parse.c (parse_asm_action): Do PUSH_ACTION unconditionally,
- otherwise "handler stack" will get out of sync.
-
-Mon Apr 24 09:51:07 1995 Per Bothner <bothner@rtl.cygnus.com>
-
- Fixes to support module-level non-static temporary variables.
- * parse.c (parse_loc_declaration): If all_static_flag and not
- resursive, tell do_decls to make new decl static.
- * decl.c (do_decl): Don't use maybe_static function to force static.
- (do_decl): Don't let initialization count as "using" the variable.
- (maybe_static): Removed.
- (finish_decl): Call expand_decl and expand_decl_init if needed
- (as it will be for non-static temporaries).
-
-Fri Apr 21 21:02:30 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * convert.c, expr,c typeck.c (expand_decl): Remove usused declaration.
-
-Fri Apr 21 02:27:12 1995 Wilfried Moser <moser@rtl.cygnus.com>
-
- * expr.c (build_set_expr): Fix thinko: GE(x,y) is not eqivalent to
- LT(y,x) its rather equivalent to NOT (LT(x,y)). Same is true for
- GT(x,y), its not equiv. to LE(y,x), its equiv. to NOT (LE(x,y)).
-
-Thu Apr 20 15:29:05 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * parse.c (yytext, finput): Remove unused declarations.
-
- * parse.c (proc_action_level): New variable.
- (parse_proc_body): New function. Common code from
- parse_procedure_definition and parse_process_definition moved here.
- Save, set, and restore proc_action_level from action_nesting_level.
- (parse_action case RETURN): Pass proc_action_level to
- expand_goto_except_cleanup.
-
-Thu Apr 20 06:02:20 1995 Wilfried Moser <moser@rtl.cygnus.com>
-
- * grant.c (really_grant_this): Add processing of LABEL_DECL's
- (don't grant them).
-
-Tue Apr 18 18:16:28 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * lex.c ( convert_bitstring): Use BYTES_BIG_ENDIAN rather
- than BITS_BIG_ENDIAN to layout bits within bitstring.
- * typeck.c (expand_constant_to_buffer, extract_constant_from_buffer):
- Likewise.
-
-Sun Apr 16 19:55:51 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * decl.c (finish_chill_function): If currently global_function_decl,
- don't set outer_function to global_function_decl.
-
-Wed Apr 12 22:45:06 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * decl.c (start_chill_function): Normal functions are nested.
- (finish_chill_function): No longer takes a 'nested' parameter.
- Normal functions are nested.
- Never call permanent_allocation, since it does little good (all normal
- functions are nested), and trashes some things we need.
- (finish_outer_function): Update call to finish_chill_function.
- * grant.c (chill_finish_compile): Likewise.
- * tasking.c (build_process_wrapper): Likewise.
- * parse.c (end_function): Likewise.
- * ch-tree.h (finish_chill_function): Update declaration.
-
- * parse.c (parse_asm_clobbers): Re-enable.
- (expand_asm_operands): function.
- (parse_asm_action): Re-enable. Don't do anything in pass 1.
-
- * typeck.c (build_chill_slice): Do constant folding.
- Also, work around problem where expand_expr constant folds ARRAY_REF.
- (sort_constructor): Remove unused function.
-
- * expr.c (chill_expand_expr case CONCAT_EXPR): Make sure we
- emit_block_move if needed with correct size.
-
- * inout.c (build_chill_io_list_type): Simplify.
-
- * lex.c (check_newline): Uncomment some dwarf stuff,
- which needs get_directive_line, which we no longer have.
-
-Wed Apr 5 16:05:15 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * Makefile.in (C_OBJS, xcc1chill): Removed. We no longer
- link cc1chill with ../c-typeck.o ../c-aux-info.o ../c-common.o.
-
- * expr.c (build_chill_component_ref): Renamed to build_component_ref.
- (chill_truthvalue_conversion): Renamed to truthvalue_conversion.
- * decl.c, expr.c, inout.c, loop.c, parse.c, tasking.c, timing.c,
- typeck.c: Update accordingly.
- * typeck.c (valid_array_index_p): We only need to save_expr (index)
- if we're range-checking.
- * typeck.c (unsigned_type, signed_type, signed_or_unsigned_type,
- mark_addressable, initializer_constant_valid_p, check_case_value,
- type_for_size, type_for_mode): New functions, copied from
- ../c-common.c and ../c-typeck.c.
-
- * lang.c (incomplete_type_error): New. (Was in c-common.o.)
- * decl.c (constant_expression_warning): New. (Was in c-common.o.)
-
- * lang.c (string_index_type_dummy): Remove definition from here.
- * tree.c (string_index_type_dummy): Define here instead.
- * lang.c (lang_init): Move init of string_index_type_dummy
- (which is too late) from here ...
- * decl.c (init_decl_processing): ... to here.
-
- * decl.c (signed_boolean_type_node): New variable.
- (init_decl_processing): Initialize it.
-
- * parse.c: Comment out ASM action support, for now.
-
- * loop.c (maybe_skip_loop): Make return void, not int.
- Use build_compare_discrete_expr.
- (increment_temps): Use chill_expand_assignment.
-
-Thu Mar 30 23:28:28 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * decl.c (do_decl): If default-initializing variable-length
- string to "" (or []), make it lifetime_bound.
-
-Thu Mar 30 02:51:59 1995 Wilfried Moser <moser@rtl.cygnus.com>
-
- * parse.h, hash.h, gperf: New compiler directives
- EMPTY_ON and EMPTY_OFF.
-
- * lex.c: New variables empty_checking and runtime_checking_flag.
- (ch_lex_init): Initialize empty_checking and range_checking
- when switching from pass 1 to 2.
- (read_directive): Add processing of EMPTY_OFF/ON.
-
- * expr.c (build_chill_indirect_ref): New argument do_empty_check
- to indicate if null pointer checking should be done or not.
- It's not always necessary to do a null pointer check.
-
- * decl.c (lookup_name): Add argument to call to
- build_chill_indirect_ref.
- (shadow_record_fields): ...
- * parse.c (parse_primval): ...
- * tasking.c (build_process_wrapper): ...
- (build_receive_buffer_case_label): ...
-
- * ch-tree.h: Change prototype of build_chill_indirect_ref.
- Add declaration of runtime_checking_flag and empty_checking.
-
- * actions.c (check_non_null): Do null pointer checking only
- when enabled (empty_checking != 0).
-
-Wed Mar 29 15:18:23 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * actions.c (chill_expand_assignment): Add 'else' so we don't do
- regular assignment in addition to spacial assignment (e.g. for slices).
-
- * ch-tree.h (convert_to_discrete): Add declaration.
- * typeck.c (convert_to_discrete): New function.
- (valid_array_index_p): Use convert_to_discrete. Also simplify.
- (build_chill_slice): Say sorry if variable-length bitstring.
- (build_chill_slice_with_length): Re-do bounds check.
- * expr.c (check_case_selector): Re-write to use convert_to_discrete.
- (build_chill_num, build_chill_pred_or_succ): Use convert_to_discrete.
-
- * decl.c (do_decl): Don't do redundant chill_convert_for_assignment.
-
-Wed Mar 29 00:00:29 1995 Wilfried Moser <moser@rtl.cygnus.com>
-
- * expr.c (build_chill_num): need_unsigned have to be set for
- characyer strings of length 1 too. Happens when compiling
- with -fold-strings and do NUM(a(i)).
-
- * parse.c (parse_loc_declaration): Print error message only
- in pass 1.
- (parse_mode): Likewise ...
-
- * tasking.c (build_tasking_message_type): Temporarily reset
- maximum_field_alignment to get proper aligned temp. variables
- gets passed to runtime system.
-
-Tue Mar 28 00:08:06 1995 Per Bothner <bothner@cygnus.com>
-
- * typeck.c (my_build_array-ref): Merged into build_chill_array_ref_1.
- But don't convert index to integer_type_node. And we don't need to
- check the we're given an array.
- * typeck.c (valid_array_index_p): If flag_old_strings, convert
- chars(1) to char and bools(1) to bool before index checking.
-
-Sun Mar 26 22:42:39 1995 Per Bothner <bothner@cygnus.com>
-
- * ch-tree.h (struct module): Added next module field.
- * decl.c (first_mdoule, next_module): New global variables.
- (switch_to_pass_2): Re-initialize next_module.
- (push_module): In pass 2, reuse the same module objects from pass 1.
-
- * decl.c (declare_predefined_file): Set DECL_IN_SYSTEM_HEADER.
-
- * typeck.c (valid_array_index_p): Do range check on original index,
- before we convert to domain type.
-
-Fri Mar 24 11:43:39 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * parse.c (parse_fixed_field): New function.
- (parse_variant_field_list): New function replaces parse_simple_fields.
- (parse_variant_alternative, parse_field): Update to use new functions.
- (parse_field): Error message if neither CASE nor NAME.
-
- * actions.c (check_non_null): New function - checks for NULL pointers.
- * ch-tree.h (check_non_null): New declaration.
- * tasking.c (expand_send_signal): Call check_non_null.
- * expr.c (build_chill_indirect_ref, build_chill_function_call): Same.
- * lex.h (enum rid): Add RID_EMPTY.
- * lex.c (init_lex): Initialize ridpointers[RID_EMPTY].
-
- * lex.c (read_directive): Remove 2 calls of to_global_binding_level
-
-Wed Mar 22 16:36:46 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * tasking.c (tasking_list): Change to chain of TREE_VEcs, rather than
- chain of (nested) TREE_LIST nodes.
- (TASK_INFO_PDECL, TASK_INFO_ENTRY, TASK_INFO_CODE_DECL,
- TASK_INFO_STUFF_NUM, TASK_INFO_STUFF_TYPE): New macros.
- (tasking_setup, tasking_registry, add_taskstuff_to_list): Use them.
-
- * ch-tree.h (C_TYPE_FIELDS_READONLY): Rename to TYPE_FIELDS_READONLY.
- (TYPE_READONLY_PROPERTY): New macro, to match Z.200 concept.
- * typeck.c (build_chill_modify_expr): Don't check for read-only-ness,
- since it is redundant for chill_expand_assignment and breaks
- reach-bound initialization in do_decl.
- (my_build_array_ref): Simplify by using TYPE_READONLY_PROPERTY.
- (layout_chill_array_type): Set TYPE_FIELDS_READONLY if appropriate.
- * actions.c (chill_expand_assignment): Check TYPE_READONLY_PROPERTY
- instead of TREE_READONLY of the target's type.
- * expr.c (build_chill_function_call): Likewise.
- * inout.c (build_chill_readtext): Likewise.
- * decl.c (do_decl): Likewise, to check if init is required.
-
- * typeck.c (build_chill_bitref): Removed unused RANGE_EXPR hack.
-
-Wed Mar 22 07:52:52 1995 Wilfried Moser <moser@rtl.cygnus.com>
-
- * tasking.c (build_start_process): Get a unique identifier for
- the start arguments.
-
-Tue Mar 21 07:36:40 1995 Wilfried Moser <moser@rtl.cygnus.com>
-
- * expr.c (fold_set_expr): At label build_result: Add setting unused
- bits to 0. This is the same as the runtime library does.
-
- * parse.c (expect): Function returns now int, 0, if the expected
- token was not got, 1 when it was found.
- (parse_synonym_definition): In case of syntax error (missing =),
- set expr to NULL_TREE and mode to error_mark to avoid subsequent
- segfaults.
-
- * chill.texi: Add chapter about differences to Z.200/1988.
-
-Mon Mar 20 18:01:11 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * lang.c (chill_print_error_function): New function, to report
- module name if not inside a function.
- (lang_init): Set print_error_function to chill_print_error_function.
-
- * tasking.c (max_queue_size, buffer_element_mode): Cleanup
- to remove unreachable code.
-
- * grant.c (chill_finish_compile): Avoid doing a lookup_name
- to find init function (which got broken by recent nesting re-org).
-
- * decl.c (poplevel): Push and pop function context around
- call to output_inline_function (as done for C and C++).
-
-Thu Mar 16 17:56:07 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * parse.c (parse_pass_1_2): If unknown top-level token, skip pass 2.
-
-Wed Mar 8 13:54:33 1995 Doug Evans <dje@canuck.cygnus.com>
-
- * Make-lang.in (chill-runtime): Temporarily disable building of
- runtime libraries for cross compilers.
-
-Mon Mar 6 23:36:19 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * parse.c, decl.c: Remove use of FUNCTION_NEEDS_STATIC_CHAIN.
-
- * configure: Merge in tolerance for new flags (e.g. --x-libraries).
-
-Sat Mar 4 15:47:35 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * expr.c (build_chill_arrow_expr): Error if pass == 1.
-
-Thu Mar 2 19:28:07 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * decl.c (do_decl): Setting seen_action must be done in pass 1.
- (save_decl): Don't set DECL_CONTEXT to global_function_decl.
- (start_chill_function): Simplify due to above change.
-
- * parse.c (parse_case_label): Hack to distinguish (ELSE) from (*).
- * grant.c (decode_constant): Emit ELSE in case label.
-
- * parse.c (serious_errors): New global variable.
- * parse.c (to_global_binding_level): Set serious_errors.
- (parse_pass_1_2): Exit after pass 1 if serious_errors > 0.
- * lex.c (readstring): Recover from unterminstaed control sequence.
-
-Tue Feb 28 17:08:08 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- Re-write of module-level actions. No longer generate a module
- function for module-level actions. Instead, put them inside
- a new global dummy function. Nest everything logically inside it.
-
- * lex.h, grant.c (chill_module_name): Removed declaration.
- * grant.c (write_spec_module): Instead use current_module->name.
- * grant.c (chill_start_module_code, chill_finish_module_code):
- Removed.
- * grant.c (chill_finish_compile): Make rtl for global function.
-
- * actions,c (push_action): Don't call chill_start_module_code.
- * expr.c (build_chill_function_call, build_generalized_call):
- Likewise.
- * parse.c (INIT_ACTION): Likewise.
-
- * parse.c (seen_action): New variable.
- * parse.c (end_function): Always call pop_chill_function_context.
- (parse_procedure_definition): Always call push_chill_function_context.
- (parse_modulion): Parse optional handler.
- (parse_modulion, parse_spec_module): Do find_granted_decls.
- (parse_action): Set seen_action if global and a real action.
- ([arse_program): Call start_outer_function and finish_outer_function.
-
- * ch-tree.h: Appropriate updates.
-
- * tasking.c (generate_tasking_code_variable): Make it lifetime-bound.
- (build_process_header): Always push_chill_function_context;
- we are now always nested.
- (build_process_wrapper): Always pop_chill_function_context.
-
- * tasking.c (build_start_process): Only expand_start_bindings and
- expand_end_bindings if pass 2.
-
- * decl.c (global_function_decl): New variable.
- (do_decl): Implement reach-bound initialization of static variables.
- (start_chill_function): Set DECL_CONTEXT to NULL if
- it would be global_function_decl (so as to not confuse gcc backend).
- (start_chill_function, finish_chill_function): If compiling
- global_function_decl in pass 2 and !seen_action, suppress it.
- (set_module_name): New function.
- (global_bindings_p): Re-defined to check against global_function_decl.
- (start_outer_function, finish_outer_function): New functions.
-
-Tue Feb 28 16:00:03 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * typeck.c (build_chill_modify_expr): Inline logic from
- chill_expand_array_assignment,
- * actions.c (chill_expand_array_assignment): Removed.
- (chill_expand_assignment): Remove call to removed function.
-
- * lex.c (reinit_parse_for_function): Removed empty unused function.
- * decl.c (start_chill_function): Don't call removed function.
-
-Tue Feb 28 00:29:51 1995 Per Bothner <bothner@cygnus.com>
-
- * configure: Merge in code for calculating host, build, and
- target and canon_{host,build,target} from ../configure.
- Fix calculation of mainsrcdir. Host canon_* variables
- to merge in build-make (as in ../configure).
-
-Sun Feb 26 18:59:02 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * typeck.c (expand_constant_to_buffer): Use new function
- get_set_constructor_bytes.
-
-Tue Feb 21 01:41:56 1995 Wilfried Moser <moser@rtl.cygnus.com>
-
- * inout.c (build_chill_writetext): Add processing of
- conditional expressions in argument list.
-
- * parse.c (parse_opt_name_string): Print error message only
- in pass 1.
-
- * chill.texi: Add chapter about compiler directives.
-
-Tue Feb 14 16:45:19 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * decl.c (start_chill_function): Set FUNCTION_NEEDS_STATIC_CHAIN
- unless nested.
-
- * decl.c (decl_temp1): Make lifetime_bound iff static.
-
-Fri Feb 3 04:30:28 1995 Wilfried Moser <moser@rtl.cygnus.com>
-
- * grant.c (really_grant_this, search_in_list): New static
- functions to determine if a decl should be written to
- grant file.
- (write_spec_module): Add call to really_grant_this.
-
-Fri Jan 27 00:06:12 1995 Wilfried Moser <moser@rtl.cygnus.com>
-
- * actions.c (check_expression): Apply Per's patch.
- (chill_expand_result): New argument to indicate if we come
- from a RETURN or RESULT action. Change various error messages.
-
- * ch-tree.h: New macro CH_USE_SEIZEFILE_RESTRICTED.
- New argument for chill_expand_result.
-
- * chill.in: In case of -fgrant-only, clear library, libpath and
- startfile to avoid warnings from gcc.
-
- * gperf, hash.h: New compiler directive USE_SEIZE_FILE_RESTRICTED.
-
- * parse.h (enum terminal): Add USE_SEIZE_FILE_RESTRICTED.
-
- * grant.c (decode_decl): Don't write USE_SEIZE_FILE directive
- and subsequent SEIZEs to grant file, if the seize file is
- used restricted.
-
- * lex.c (read_directive): Process new compiler directive
- USE_SEIZE_FILE_RESTRICTED.
- (handle_use_seizefile_directive): Same as above.
- (yywrap): Don't write USE_SEIZE_FILE directive to grant file
- if this seize file is used restricted.
-
- * parse.c (parse_action, case RETURN): Change RETURN expr action
- to RESULT expr; RETURN. This enables range checking and
- exception delivery in case of rangefail.
-
-Tue Jan 17 07:38:27 1995 Wilfried Moser <moser@rtl.cygnus.com>
-
- * decl.c (init_decl_processing): Add definition of
- library function __inbitstring (see expr.c).
-
- * expr.c (chill_expand_expr case SET_IN_EXPR): Call function
- __inpowerset fir POWERSET's and function __inbitstring for
- BITSTRING's. In case of POWERSET's we must not do a rangecheck,
- in case of BITSTRING's we have to do one.
- (build_compare_expr): Fix typo CH_DERIVED_FLAG (tmp); (warning
- statement with no effect).
-
-Fri Jan 13 13:35:30 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * actions.c (check_expression): Simplify result.
-
- * ch-tree.h (SET_CH_NOVELTY_NONNIL): New macro.
- * expr.c, timing.c, typeck.c: Use SET_CH_NOVELTY_NONNIL.
-
- * typeck.c (valid_array_index_p), ch-tree.h: Change interface
- to return modified index expression. Call error if out-of-range.
- * actions.c, typeck.c: Modify
- for new valid_array_index_p interface.
-
- * actions.c (build_chill_slice): Copy novelty of index type.
-
-Fri Jan 13 13:04:41 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * convert.c (digest_array_tuple): Allow mode name in array
- tuple label. Print error message instead of aborting.
-
- * parse.c (parse_body): Error message only if pass 1.
-
- * decl.c (check_identifier), ch-tree.h: Remove. Unused.
-
-Wed Jan 11 14:03:47 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * parse.c (parse_modulion): Undo yesterday's change (to allow
- an ON-handler to follow) until we re-implement module.
-
-Tue Jan 10 17:23:55 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * loop.c (declare_temps): Remove bogus prohibition against
- iterating over BOOL arrays.
-
- * parse.c (parse_semi_colon): Make it a pedwarn (instead of an
- error) if a semi-colon is missing before an END.
- (parse_action): Likewise.
- * parse.c (parse_modulion): Allow an ON-handler to follow.
-
- * parse.c (parse_set_mode): Use parse_expression to get
- values for number set elements.
-
- * expr.c (build_compare_expr): Make sure result has
- CH_DERIVED_FLAG set, since it is supposed to be BOOL-derived.
- (finish_chill_binary_op): Likewise for IN_EXPR.
-
-Tue Jan 10 04:46:42 1995 Wilfried Moser <moser@rtl.cygnus.com>
-
- * actions.c (lookup_and_expand_goto, lookup_and_handle_exit): Add
- checking the argument.
- (chill_expand_assignment): Take care of a newmoded dst_offset
- when calling __pscpy and a newmoded from_pos when calling
- __setpowersetbits.
-
- * expr.c (chill_expand_expr): When calling __psslice take care
- of a newmoded min_value.
-
- * parse.c (parse_name_string): Print error message only in
- pass 1.
-
-Tue Jan 3 19:56:36 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * typeck.c (build_chill_array_ref_1): Use varying_to_slice
- instead of building a VRAY_ARRAY_REF node.
- * ch-tree.def (VARY_ARRAY_REF): Removed.
- * actions.c (chill_expand_assignment): Will never call
- expand_assignment_to_varying_array for a VARY_ARRAY_REF, so don't.
- (expand_assignment_to_varying_array): Removed.
- * convert.c (convert): Remove unneeded VARY_ARRAY_REF support.
- * expr.c (chill_expand_expr): Likewise.
-
-Tue Jan 3 19:50:18 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * parse.c (parse_iteration): Set step_value to NULL if missing.
- * loop.c (ITER_TYPE): Remove DO_RANGE.
- (build_loop_iterator): Implement old DO_RANGE in terms of DO_STEP.
- (begin_loop_scope): Don't return on error.
- (build_loop_iterator): Calculate loop variable type using
- resulting classes (as in Z200), rather than precision.
-
- * loop.c (initialzie_iter_var, bottom_loop_end_check): For DO_STEP,
- make iter_var one less to avoid overflow.
- * loop.c (build_loop_iterator): If !flag_local_loop_counter,
- declare a new variable if needed, as allowed by Z200 (1984).
-
- * ch-tree.h (ch_class): Add typedef.
-
- * typeck.c (chill_resulting_class): New function.
- (chill_root_resulting_class): Remove.
- * ch-tree.h (CH_RESULTING_CLASS): New macro.
- (CH_ROOT_RESULTING_CLASS): Re-implement using CH_RESULTING_CLASS.
-
-Tue Jan 3 19:36:27 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * actions.c (build_cause_exception, expand_cause_exception), ch-tree.h:
- Change interface to take IDENTIFIER tree node, rather char char*.
- (check_expression): Change (simplify) callers appropriately.
- * parse.c (parse_action), typeck.c (valid_array_index_p): Likewise.
- * lex.h (enum rid): Add RID_ASSERTFAIL.
- * lex.c (init_lex): Enter RID_ASSERTFAIL.
- * parse.c (parse_action case ASSERT): Fix thinko TRUTH_ANDIF_EXPR
- to TRUTH_ORIF_EXPR. Use RID_ASSERTFAIL.
-
- * typeck.c (discrete_type_p): Re-implement using INTEGRAL_TYPE_P.
-
-Tue Jan 3 19:20:35 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- Move checking for modeless tuples in invalid contexts from parser
- to semantic function check_have_mode (for better error recovery):
- * expr.c (check_have_mode), ch-tree.h: New function.
- * satisfy.c (safe_satisfy_decl): Use check_have_mode.
- * expr.c (build_compare_expr, finish_chill_binary_op,
- finish_chill_unary_op): Likewise.
- * parse.c (parse_primval): Don't complain about mode-less tuple here.
-
-Tue Jan 3 17:36:48 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * expr.c (varying_to_slice): Support varying arrays whose
- lower bound is non-zero.
-
- * parse.c (parse_body): Allow (with warning) definition to
- follow action.
-
- * expr.c (check_case_selector), ch-tree.h: New function.
- (chill_expand_case_expr): Use it.
- * parse.c (parse_case_action): Likewise.
-
-Fri Dec 23 00:47:54 1994 Wilfried Moser <moser@rtl.cygnus.com>
-
- * actions.c (chill_expand_return): Change error message.
-
- * ch-tree.h: Change prototypes of do_decl and do_decls.
-
- * convert.c (convert): Add missing initialisation of
- variable orig_e_constant.
-
- * decl.c: Change all calls to do_decl.
- (maybe_static): New function to process the ALL_STATIC_ON/OFF
- compiler directives.
- (do_decls): New argument.
- (do_decl): New argument and process reachbound and lifetime
- bound initialisation.
-
- * gperf, hash.h: Add compiler directives ALL_STATIC_ON and
- ALL_STATIC_OFF.
-
- * grant.c: Change all calls to do_decl.
-
- * lex.c (read_directive): Process ALL_STATIC_ON/OFF compiler
- directive.
-
- * parse.c (parse_loc_declaration): Pass lifetime_bound flag to
- do_decls.
-
- * parse.h (enum terminal): Add ALL_STATIC_ON and ALL_STATIC_OFF.
-
- * tasking.c: Change all calls to do_decl.
-
-Mon Dec 19 23:13:58 1994 Wilfried Moser <moser@rtl.cygnus.com>
-
- * parse.c (parse_procedure_definition): Save chill_at_module_level
- flag, set ot to 0 and restore it at the end of function.
- A sequence BEGIN x: PROC () RETURN; END x; END; at module level
- have produced an error.
-
- * expr.c (build_chill_repetition_op): Fix typo in error message.
-
-Tue Dec 13 12:26:38 1994 Per Bothner <bothner@kalessin.cygnus.com>
-
- * actions.c (expand_assignment_to_varying_array): Fix thinko:
- build_chill_array_ref -> build_chill_array_ref_1.
-
-Sun Dec 11 23:04:27 1994 Per Bothner <bothner@rtl.cygnus.com>
-
- * actions.c (chill_expand_assignment): Simplify the lhs if it is
- a COMPOUND_EXPR, so we can better handle SLICE_EXPR in lhs.
-
-Thu Dec 8 13:45:38 1994 Per Bothner <bothner@kalessin.cygnus.com>
-
- * loop.c, ch-tree.h (build_loop_iterator): Fix to return void.
- If start_exp is ERROR_MARK, return.
- * expr.c (build_generalized_call): More robust on syntax errors.
-
-Tue Dec 6 02:33:23 1994 Wilfried Moser <moser@rtl.cygnus.com>
-
- * inout.c (build_chill_readtext): In case of reading a SET mode
- pass ignore_case flag to runtime library.
-
-Tue Nov 29 14:41:38 1994 Per Bothner <bothner@kalessin.cygnus.com>
-
- * parse.c (parse_receive_case_action): Print error only if pass==1.
- * decl.c (push_scope_decls): Use error_with_file_and_line
- to get correct line number of SEIZE.
-
-Mon Nov 28 16:59:18 1994 Per Bothner <bothner@kalessin.cygnus.com>
-
- * expr.c (resolve_component_ref): Call fold on result.
-
- * expr.c (resolve_component_ref): Use check_expression.
- * actions.c (chill_convert_for_assignment): Likewise.
- * actions.c (cond_exception), ch-tree.h: Removed.
- * actions.c (check_expression): First part of COMPOUND_EXPR
- should be boolean_type_node; void_type_node loses in SAVE_EXPRs.
-
- * actions.c (chill_convert_for_assignment):
- Check string_assignment_condition for varying strings too.
-
- * typeck.c (build_chill_cast): If the types have different sizes,
- don't allow nondiscrete->discrete conversion, and only allow
- discrete->nondiscrete if input expression is constant.
-
- * typeck.c (chill_similar): Don't use losing array_type_nelts.
-
- * ch-tree.h (ELSE_VARIANT_NAME): New.
- * convert.c, decl.c, grant.c: Use ELSE_VARIANT_NAME.
- * decl.c (handle_one_level): Recurse on ELSE_VARIANT_NAME too.
-
- Reduce dependencies on ../c-typeck.c:
- * expr.c: Fix c_expand_start_case -> expand_start_case.
- Fix c_expand_expr_stmt -> expand_expr_stmt.
- (build_chill_indirect_ref): Call convert instead of build_c_cast.
- * loop.c (bottom_loop_end_check): Don't use build_modify_statement.
- * expr.c, except.c, typeck.c: Don't call default_conversion.
- * typeck.c (string_assignment_condition): Fix build_component_ref ->
- build_chill_component_ref.
- * decl.c: Fix build_indirect_ref -> build_chill_indirect_ref (twice).
- * decl.c: Don't set unused constructor_no_implicit (from c-typeck.c).
- * decl.c: Don't call declare_function_name.
-
- * parse.c: Don't always keep a valid token in terminal_buffer[0].
- The extra look-ahead may have made the parser faster, but caused
- some problems synchronizing with the lexer. Specifically:
- (PEEK_TOKEN): Now calls an optimized variant of peek_token_(0).
- (next_token_): Don't call peek_token_. Renamed to forward_token_.
- (NEXT_TOKEN): Renamed to FORWARD_TOKEN.
- (parse_program): Don't call yylex yet.
-
- * parse.c (parse_action): Re-do case ASSERT.
- Fix c_expand_expr_stmt -> expand_expr_stmt.
-
- * lex.l: Re-written to not use [f]lex, and renamed to ...
- * lex.c: ... new lexer.
- * Makefile.in, Make-lang.in: Remove [f]lex crud.
-
- * lex.h (enum rid), lex.c (init_lex): Added RID_ELSE.
-
-Tue Nov 22 15:19:03 1994 Wilfried Moser (moser@rtl.cygnus.com)
-
- * Make-lang.in: Let chill-runtime depend on $(GCC_PASSES).
-
-Fri Nov 18 14:27:32 1994 Per Bothner <bothner@kalessin.cygnus.com>
-
- * parse.c (parse_structure_node): Simpler, and more robust.
-
-Wed Nov 16 14:40:52 1994 Ian Lance Taylor (ian@cygnus.com)
-
- * lex.l (convert_bitstring): Check BITS_BIG_ENDIAN at run time,
- not at compile time.
- * typeck.c (expand_constant_to_buffer): Likewise.
- extract_constant_from_buffer): Likewise.
-
-Tue Nov 15 14:41:53 1994 Per Bothner <bothner@kalessin.cygnus.com>
-
- * convert.c (convert): Call build_chill_range_type rather than
- build_index_2_type (which has obstack and canonicalization problems).
- * expr.c (build_chill_pred_or_succ): Convert expr to root class
- before arithmetic.
- * loop.c (declare_temps): If location iterated over is not
- a location, make a temporary variable for it.
-
-Mon Nov 14 16:33:47 1994 Per Bothner <bothner@kalessin.cygnus.com>
-
- * typeck.c, ch-tree.h (chill_equivalent): Change to return
- a tree (a Boolean expression). Also, add some missing tests.
- * ch-tree.h (CH_EQUIVALENT): Modify accordingly.
-
- * expr.c (chill_expand_expr case CONCAT_EXPR): When the 2nd operand
- is an UNDEFINED_EXPR, handle mode-mismatch with whole expr.
- Also, replace MEM (which is not a mode) by Pmode.
-
- * ch-tree.h, typeck.c (chill_comptypes): Removed.
- * convert.c (convert): Remove calls to chill_comptypes.
-
-Fri Nov 11 13:06:29 1994 Wilfried Moser (moser@rtl.cygnus.com)
-
- * grant.c (write_grant_file): Call pfatal_with_name instead
- of abort when something goes wrong when opening or writing
- the grant file.
- unlink grant file if something goes wrong during writing
- (i.e. device full).
-
- * Make-lang.in (CHILL_SRCS): Add timing.c
-
- * ch-tree.h: Add prototype for chill_tasking_type_node.
- * lex.l (equal_number): Use chill_tasking_type_node instead of
- integer_type_node for converting the result.
- Print error messages in pass 2, in pass 1 no error will be
- detected.
- * tasking.c: New variable chill_tasking_type_node for all
- generated tasking related variables.
- Use chill_tasking_type_node instead of chill_unsigned_type_node.
-
- * expr.c (chill_expand_expr): Apply Per's change.
-
- * expr.c (build_chill_sizeof): In case of error just
- return error_makr_node.
- Set CH_DERIVED_FLAG at the result.
-
- * timing.c (build_after_timeout_start): Clear the the timeout
- level to know if we are in the action part of AFTER statement
- or in the TIMEOUT part.
-
- * typeck.c (build_chill_slice_with_length): Convert the class
- of the result to class of first value in expression.
-
- * inout.c (build_chill_writetext, build_chill_readtext): Use stack
- temporary variables for the iolist so that they can get reused in
- subsequent calls. Emit code immediately instead of building a
- compound expr.
-
-Fri Nov 4 12:00:54 1994 Per Bothner <bothner@kalessin.cygnus.com>
-
- * expr.c (build_chill_function_call): Don't set TREE_TYPE
- of assignment to void_type_node - it confuses save_expr.
- * decl.c (init_decl_processing): Removed unused code.
- * parse.c: Changes to avoid warnings.
-
- * grant.c (chill_finish_module_code): Minor simplification.
- * lex.l (readstring): Set *len to 1 on error.
-
-Thu Nov 3 01:05:17 1994 Wilfried Moser (moser@rtl.cygnus.com)
-
- * grant.c (decode_decl): Add granting of BASED declarations.
-
-Wed Nov 2 12:14:31 1994 Per Bothner <bothner@kalessin.cygnus.com>
-
- * expr.c (build_chill_lower_or_upper): Take more care to
- ensure result has the right class.
- (build_chill_pred_or_succ): Be more careful to get the right
- resulting class, and check bounds using *root* mode.
-
- * typeck.c (build_chill_slice_with_range): Check that array
- really is an array or string.
- (build_chill_slice_with_length): Likewise.
-
- * typeck.c (extract_constant_from_buffer): Fix calculation of
- SET_TYPE size. (Cannot depend on 1-byte TYPE_PRECISION field.)
-
-Wed Nov 2 05:33:03 1994 Wilfried Moser (moser@rtl.cygnus.com)
-
- * Make-lang.in: Change version of compiler.
-
- * ch-tree.h: Add new prototypes.
-
- * decl.c (init_decl_processing): Remove timing related
- initialisations. Add call to timing_init.
-
- * parse.c (parse_action): Process AFTER action.
-
- * tasking.c (build_receive_case_start,
- build_receive_signal_case_label, build_receive_buffer_case_label,
- build_delay_case_start, build_delay_action, expand_send_buffer):
- Add processing of timesupervision.
- (tasking_init): Change definitions of runtime functions.
-
- * timing.c (timing_init): New function for initialisation of
- timing related stuff.
- (build_cycle_start, build_cycle_end): Changed due to
- implementation of timesupervision.
- (build_after_start, build_after_timeout_start, build_after_end):
- Implement the AFTER action.
- (build_timeout_preface, build_timesupervised_call): New functions
- to handle timesupervision in case of blocking system calls (i.e.
- SEND buffer action, RECEIVE CASE action etc.).
-
-Thu Oct 27 12:50:24 1994 Per Bothner <bothner@kalessin.cygnus.com>
-
- * expr.c (build_chill_repetition_op): Fix repeating all-zero
- bitstring with orig_len!=1. Also, call build_boring_bitstring
- if original string was all ones, using one range. Also:
- Cannot use one-bit TYPE_PRECISION to get bitstring length.
-
-Tue Oct 25 14:11:07 1994 Per Bothner <bothner@kalessin.cygnus.com>
-
- * convert.c (convert): When converting BOOL constant to
- bit-string, bit_one_node and bit_zero_node were switched.
- * actions.c (chill_expand_assignment): Use force_addr_of,
- not build_chill_addr_expr - latter yields bogus error.
-
-Fri Oct 21 14:26:52 1994 Per Bothner <bothner@kalessin.cygnus.com>
-
- * expr.c (build_chill_indirect_ref): Check for POINTER_TYPE (only)
- after converting from REFERENCE_TYPE.
- * expr.c (build_compare_expr): Convert to common mode *after*
- we've checked compatibility.
-
-Fri Oct 21 02:29:15 1994 Wilfried Moser (moser@rtl.cygnus.com)
-
- * lex.l (check_newline): Use getc instead of getlc to read
- the filename in a # line name directive to avoid possibly
- downcaseing of a filename.
-
-Thu Oct 20 05:37:17 1994 Wilfried Moser (moser@rtl.cygnus.com)
-
- * expr.c (build_chill_indirect_ref): Add check for really
- dereferencing a pointer.
-
- * convert.c (convert): Take care of TREE_CONSTANT of a
- SYNONYM having mode ARRAY () VARYING something.
-
-Mon Oct 17 02:30:38 1994 Wilfried Moser (moser@rtl.cygnus.com)
-
- * decl.c (init_decl_processing): Set CH_DERIVED_FLAG for
- boolean_true_node and boolean_false_node. TRUE and FALSE have
- the BOOL derived class.
-
- * expr.c (build_chill_num): Set CH_DERIVED_FLAG at the result
- of NUM. NUM delivers the INT derived class.
-
- * grant.c (write_spec_module): Add writing of
- <> USE_SEIZE_FILE "x.grt" <>
- SEIZE ALL;
- to generated grant file.
-
-Thu Oct 13 14:45:12 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * convert.c (convert_from_reference): Make non-static.
- * ch-tree.h (convert_from_reference): Add prototype.
- * parse.c (parse_name): If the decl is a REFERENCE_TYPE, just
- call convert_from_reference - and not a full-scale convert.
-
- * convert.c (convert): Only call digest_array_tuple if ARRAY_TYPE.
- * typeck.c (chill_expand_tuple): Print error if type is
- neither array, struct, or powerset.
-
- * expr.c (chill_expand_expr cases CONCAT_EXPR, SET_*_EXPR,
- UNDEFINED_EXPR): Call preserve_temp_slots for temp targets.
- If target is not MEM, make temp (even if not REG) to simplify
- - and don't copy original target to temp target first. (Not needed.)
-
- * lang.c (maybe_objc_comptypes): Just return -1.
-
-Wed Oct 12 12:24:20 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * tasking.c (tasking_setup): Fix breakage from previous check-in.
-
-Tue Oct 11 16:00:37 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * actions.c, convert.c, except.c, expr.c, inout.c, loop.c, tasking.c,
- timing.c, typeck.c: Change build1 (ADDR_EXPR, ptr_type_node, XX)
- to force_addr_of (XX). Add call to mark_addressable where needed
- for other calls to build 1 (ADDR_EXPR, TYPE, XX).
-
-Thu Oct 6 06:36:28 1994 Wilfried Moser (moser@rtl.cygnus.com)
-
- * inout.c (build_chill_writetext): Remove processing
- of POWERSET's.
-
-Tue Oct 4 14:08:26 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * convert.c (convert): If flag_old_strings, support converting
- CHARS(1) and BOOLS(1) to INT.
-
-Fri Sep 30 01:44:51 1994 Wilfried Moser (moser@rtl.cygnus.com)
-
- * inout.c (build_chill_readtext): Add check for item is
- referable and not READonly. Add processing of BITSTRINGs.
-
-Mon Sep 26 16:19:36 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * expr.c (build_chill_descr): Add missing call to mark_addressable.
- * loop.c (toop_loop_end_check): Replace build1 (ADDR_EXPR ...)
- with call to force_addr_of (which calls mark_addressable).
- * expr.c (build_chill_descr, build_chill_inttime): Likewise.
- * inout.c (build_chill_writetext): Likewise.
-
-Mon Sep 26 05:19:21 1994 Wilfried Moser (moser@rtl.cygnus.com)
-
- * grant.c (print_struct): Move printing of VARYING from
- here ...
- * grant.c (grant_array_type): ... to here.
-
-Mon Sep 26 00:09:08 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * ch-tree.h (force_addr_of): New prototype.
- * expr.c (force_addr_of): Call mark_addressable. Make non-static.
- * inout.c (build_chill_writetext): Use force_addr_of.
-
-Sun Sep 25 23:41:59 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * except.c (push_handler), actions.h: Removed unused parameter.
- * actions.c (push_action): Remove unused paramater.
- * parse.c, actions.c: Remove no-longer-used parameter to
- calls to push_handler and push_action.
-
- * decl.c (push_extern_process): Only build types in pass 1.
- * tasking.c (build_process_header): Only build types in pass 1.
- * tasking.c (build_start_process): Do pushdecl/popdecl etc
- even after an error (to maintain consistency between passes).
-
- * convert.c (convert_to_boolean): Allow any integral input type.
-
-Sat Sep 24 22:47:54 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * typeck.c (extract_constant_from_buffer): Add (somewhat kludgey)
- support for UNION_TYPE. (Patch from Wilfried.)
- Also, reverse RECORD_TYPE constructor list.
-
-Fri Sep 23 19:06:39 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * expr.c (build_concat_expr): Fix calculation of result_size.
-
-Wed Sep 21 00:54:21 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- Give up on trying to use the cleanup mechanism in stmt.c to
- make sure the exception handler get unlinked on goto/exit/return.
- Instead, do it ourselves. (Much simpler.)
- * except.c, ch-tree.h (action_nesting_level): New global.
- * ch-tree.h (DECL_ACTION_NESTING_LEVEL): New macro.
- * decl.c (define_label): Set DECL_ACTION_NESTING_LEVEL.
- * except.c (expand_goto_except_cleanup): New function.
- (cleanup_chain): New variable.
- (push_handler, pop_handler): Adjust action_nesting_level.
- (emit_setup_handler): Push cleanup.
- (chill_finish_on): Pop cleanup.
- * actions.c (lookup_and_expand_goto, lookup_and_handle_exit):
- Call expand_goto_except_cleanup.
- * parse.c (parse_action): Before RETURN, call
- expand_goto_except_cleanup.
-
-Mon Sep 19 00:59:54 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * lex.l (equal_number): Make sure converted synonym
- is on permanent obstack.
- * typeck.c (extract_constant_from_buffer): Fix INTEGER_TYPE
- loop to traverse in big-endian order.
-
-Sat Sep 17 20:48:37 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * typeck.c (build_chill_cast): Call mark_addressable.
- * expr.c (build_chill_function_call): Call mark_addressable.
-
-Thu Sep 15 23:47:01 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * typeck.c (expand_constant_to_buffer): Fix an endian-ness
- problem for INTEGER_CST.
- (extract_constant_from_buffer): Likewise.
-
-Thu Sep 15 22:59:04 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * decl.c (pushlevel): Do different things depending on
- actual parameter.
- * decl.c, parse.c, tasking.c: Change argument to to pushlevel to 1.
- * actions.c (push_action): Take new parameter.
- * except.c (push_handler): Likewise.
- * parse.c: Change calls to push_action and push_handler.
- * loop.c (begin_loop_scope): Always call expand_start_bindings.
- * loop.c (end_loop_scope): Always call expand_end_bindings.
- * except.c (emit_setup_handler): Add a cleanup to
- unlink from exception stack if we return/exit/goto from here.
- * loop.c (begin_loop_scope): Move pushlevel from here ...
- * parse.c (parse_do_action): ... to here.
-
- Clean up do-decl interface (for decl_temp1).
- * parse.c (parse_loc_declaration): If global_bindings_p (),
- treat as static.
- * decl.c (do_decl): Don't test global_bindings_p ().
-
- * decl.c (keep_next_level_flag, keep_next_if_subblocks):
- Not used. Removed.
- (struct scope::keep, scope::keep_if_subblocks): Likewise.
- (keep_next_level): Likewise.
- (kept_level_p, pushlevel, poplevel): Simplify.
-
- * decl.c (init_decl_processing): Don't call init_iterators.
- * Makefile.in (C_OBJS): Don't get ../c-iterator.o - not needed.
-
-Thu Sep 15 05:54:11 1994 Wilfried Moser (moser@rtl.cygnus.com)
-
- * lex.l (readstring): Add processing of control sequence
- in character string literals. The granting mechanism writes
- this to grant files.
-
-Tue Sep 13 06:19:42 1994 Wilfried Moser (moser@rtl.cygnus.com)
-
- * expr.c (compare_records): In case of -fpack do always
- a memcmp instead of comparing each field of the
- structure. If the structure is a variant structure,
- issue a warning.
-
-Mon Sep 12 13:15:09 1994 Per Bothner (bothner@cygnus.com)
-
- * grant.c (write_spec_module): Add cast, to avoid PCC warning.
- * grant.c (header_template): Don't use ANSI-specific string
- literal concatenation.
-
-Fri Sep 9 01:53:30 1994 Wilfried Moser (moser@rtl.cygnus.com)
-
- * tasking.c (get_process_wrapper_name): New function.
- (add_taskstuff_to_list): Add a new argument, which is
- the entrypoint of a process.
- (build_process_header): Change PROCESS arguments to be
- like arguments of a function. There will be a wrapper
- which is the real entry point for a PROCESS. This wrapper
- is automatically build after a PROCESS definition and gets
- as argument a pointer to a structure looking like the
- arguments of the PROCESS. This wrapper will call the
- PROCESS (see build_process_wrapper).
- (build_process_wrapper): New function (see above).
- (build_start_process): Change processing of arguments.
- (tasking_setup): Add processing of a different entry point
- in case of PROCESSes.
-
- * parse.c (parse_process_definition): Add call to
- build_process_wrapper.
- * parse.c (end_function): Remove the poplevel() call.
- build_process_header no longer makes the corresponding
- pushlevel().
-
- * grant.c (print_proc_tail): Remove special processing
- of PROCESSes, they look now like normal functions.
-
- * decl.c (init_decl_processing): Add declaration of memcmp
- function.
-
- * ch-tree.h: Add new prototype for build_process_wrapper,
- change prototypes for add_taskstuff_to_list and
- build_process_header.
-
- * grant.c (write_spec_module): Write GNUCHILL and gcc
- version into grant file.
-
- * Make-lang.in (CHILL_FLAGS_TO_PASS): Add passing of CC and
- GNUCHILL_VERSION to ch/Makefile.
- * Make-lang.in (CHILL.mostlyclean): Add ch/ch-version.c.
-
- * Makefile.in (CHILL_OBJS): Add ch-version.o. ch-version.c
- will get generated every time a new Makefile will get
- generated.
- * Makefile.in (GNUCHILL_VERSION): Remove it, its defined in
- Make-lang.in.
-
- * chill.in: In case of -fgrant-only pass "-S -o /dev/null"
- to the compiler to avoid generation of an object file.
-
-Thu Sep 8 12:07:28 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * convert.c (display_int_cst), ch-tree.h: New function.
- * convert.c (digest_array_tuple): Use digest_int_cst to
- provide better error messages. Return error_mark_node on error.
- * grant.c (decode_const): Simplify by using digest_int_cst.
- * grant.c (format_character, find_assoc): Removed.
-
- * decl.c (do_decl): Add missing TREE_CHAIN.
-
- * decl.c (finish_incomplete_decl): Removed.
- (init_decl_processing): Don't set incomplete_decl_finalize_hook.
- (finish_decl): Remove old C-specific code to deduce size of
- array from initialization.
- (complete_array_type): Just make it abort.
-
- * except.c (finish_handler_array): Avoid calling C-specific kludge
- complete_array_type.
-
- * convert.c (digest_constructor): Rename, and re-write to:
- (digest_array_tuple, convert): No longer use the code in
- ../c-typeck.c; use a Chill-only implementation (sigh).
-
- * typeck.c (chill_expand_tuple): Remove unneeded call to
- complete_array_type.
-
- * expr.c (fold_set_expr), grant.c (decode_constant),
- typeck.c (expand_constant_to_buffer): Update name of called
- function unpack_set_constructor to get_set_constructor_bits.
- * expr.c (powersetlen ): Remove redundant call to convert.
-
- * ch-tree.h (unpack_set_constructor): Removed obsolete declaration.
-
- * inout.c (build_chill_writetext): Handle 64-bit integer literals
- by trying to convert them to a smaller type.
-
- * lex.l (convert_number): Always use long long type (possibly
- unsigned) to avoid problems with constant folding truncation.
-
-Mon Sep 5 08:08:22 1994 Wilfried Moser (moser@rtl.cygnus.com)
-
- * ch-tree.h (enum chill_built_in_function): Add BUILT_IN_QUEUE_LENGTH.
- Add new prototype (see tasking.c).
-
- * expr.c (build_generalized_call): Add processing of
- BUILT_IN_QUEUE_LENGTH.
-
- * tasking.c (build_queue_length): New function.
-
- * tasking.c (tasking_init): Add new external function definition.
-
-Thu Sep 1 15:38:00 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * lex.l (default_lex): New function. Progress towards
- getting rid of [f]lex.
-
- * lex.l (convert_number): Use mul_double and add_double.
- Set result type to a reasonable type in which the literal
- will fit. Give error message if literal is too big.
-
- * lex.l (equal_number): Switch (temporarily) to permanent obstack.
-
- * typeck.c (build_chill_slice_with_range): Check for empty
- slice *after* we have checked for upper/lower limit in range.
-
- * grant.c (decode_mode): Remove unused code. (BOOL and
- CHAR ranges are represented as INTEGER_TYPEs.)
-
- * tasking.c (build_process_header): Add missing call to
- expand_start_bindings.
- * parse.c (end_function): Add missing expand_end_bindings.
-
-Wed Aug 31 17:25:14 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * decl.c (init_decl_processing): Set set_alignment.
-
-Tue Aug 30 16:40:46 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * actions.c (print_missing_cases, check_missing_cases,
- BITARRAY_TEST, BITARRAY_SET): New functions and macros,
- to check for completeness of case actions and expressions.
- * decl.c (c_decode_option, init_decl_processing):
- Don't set warn_switch.
- * expr.c (chill_expand_case_expr): Call check_missing_cases
- instead of check_for_full_enumeration_handling.
- * parse.c (parse_case_actions): Call check_missing_cases.
-
- * expr.c (build_chill_binary_op): Remove some dead code.
- * expr.c (chill_truthvalue_conversion): Call build_chill_binary_op
- instead of build_binary_op.
- * ch-tree.h (binary_op_error, build_binary_op): Unused. Removed.
-
- * parse.c (end_function): Use kept_level_p in parameter to
- poplevel. This reverts a June 13 change.
-
-Fri Aug 26 11:50:19 1994 Ian Lance Taylor (ian@sanguine.cygnus.com)
-
- * configure: Ignore --without, as ../configure does.
-
-Wed Aug 24 01:17:28 1994 Wilfried Moser (moser@rtl.cygnus.com)
-
- * lex.l: Change rule for decimal numbers to allow identifiers
- to start with an underscore (_).
-
-Fri Aug 19 16:38:12 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * tasking.c (build_receive_signal_case_label): Remove backwards
- chill_convert_for_assignment (which converted whatever garbage
- was in the *target* to the type of the signal argument!).
-
-Fri Aug 19 07:10:43 1994 Wilfried Moser (moser@rtl.cygnus.com)
-
- * inout.c (build_chill_io_list_type, build_enum_tables),
- tasking.c (build_tasking_struct): Temporarily reset
- maximum_field_alignment to 0, so that the compiler-built
- data structures needed by the RTS can be independent of -fpack.
-
-Thu Aug 18 13:39:51 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * typeck.c (build_init_struct): Temporarily reset
- maximum_field_alignment to 0, so that the compiler-built
- data structures needed by the RTS can be independent of -fpack.
-
-Wed Aug 17 23:48:33 1994 Wilfried Moser (moser@rtl.cygnus.com)
-
- * parse.c (parse_primval, expect, parse_on_exception_list):
- Print error message only in pass 2.
-
-Wed Aug 17 13:47:50 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * decl.c (switch_to_pass_2): Revert June 13 change,
- (Don't exit after pass 1 if an error was found.)
-
- * ch-tree.def (SLICE_EXPR): New tree-code.
- * typeck.c (build_chill_slice): For building a slice of a
- bit-string, just generate a SLICE_EXPR.
- * decl.c (init_decl_processing): Declare __pscpy.
- * actions.c (chill_expand_assignment): Handle a SLICE_EXPR
- on the LHS of assignment, by calling __pscpy.
- * expr.c (chill_expand_expr): Handle SLICE_EXPR (as a RHS
- value) by using __psslice to copy slice to a temp.
-
-Wed Aug 17 05:52:44 1994 Wilfried Moser (moser@rtl.cygnus.com)
-
- * Make-lang.in: Change version of GNUCHILL compiler to 1.4.1.
- * expr.c (build_chill_length): Enable LENGTH built-in to process
- Buffers and Events too (Z.200/1992).
- * lex.l (yywrap): Always set yyin to finput and/or grt_in. On
- a linux system the previous version was not able to run.
- * tasking.c: Correct processing of infinite buffer- and event-length
- to avoid RANGEFAIL warning.
-
-Thu Aug 11 11:46:55 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * parse.c (parse_if_expression_body): Don't call the C-specific
- build_conditional_expr. Just do build_nt (COND_EXPR, ...).
- * convert.c (convert): Convert a COND_EXPR by converting
- each branch.
-
- * convert.c (convert): Don't call convert before
- convert_to_reference. It's apt to do weird and unneedful things.
- * convert.c (convert): If the expression is varying, just call
- varying_to_slice, which simplifies quite a bit.
-
- * ch-tree.h (varying_to_slice): Add prototype.
- * typeck.c (varying_to_slice): Remove prototype.
-
- * satisfy.c (satisfy): Move case PAREN_EXPR from type 'e'
- to type '1'.
-
- * except.c (emit_setup_handler): Temporarily reset the
- maximum_field_alignment to zero so the compiler's exception
- data structures can be compatible with the run-time system,
- even when we're compiling with -fpack.
-
- * expr.c (compare_records): Call saved_if_needed on operands.
-
- * expr.c (build_set_expr case NE_EXPR): Don't use __nepowerset
- which has been reimplemented to just call __eqpowerset and
- invert the result. Inline this new implementation by
- handling as EQ_EXPR, and inverting the result.
- * decl.c (init_decl_processing): Don't define unused __eqpowerset.
-
- * typeck.c (valid_array_index_p): The TRUTH_ANDIF_EXPR has
- type boolean_type_node, not void_type_node. (Fixing this
- avoids a crash in the back-end.)
-
- * grant.c (decode_constant): In a CALL_EXPR, if the argument
- list is not a TREE_LIST (as in string repetiation), don't
- emit parentheses.
-
-Wed Aug 10 13:13:55 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * decl.c (proclaim_decl): Use CH_DECL_ENUM to check that a
- CONST_DECL is from a SET definition. (This is safer than
- checking that the type is ENUMERAL_TYPE, because synonym
- definitions may have a NULL TREE_TYPE.)
- Also, if we have duplicate enums whose types are identical,
- this is an error.
- * decl.c (proclaim_decl, pushdecllist, push_scope_decls): Add
- an extra 'quiet' parameter, which is true if we're called from
- bind_sub_modules. (In that case an error message about duplicated
- decls would be repeated later, so suppress it.)
-
- * parse.c (stmt_count): Removed, not used.
- (INIT_ACTION): Call emit_line_note only if !ignoring.
- (parse_begin_end_block): Do INIT_ACTION even if ignoring.
-
-Fri Aug 5 12:39:11 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * parse.c (parse_untyped_expr): Add missing semi-colon.
-
-Thu Aug 4 17:40:38 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * parse.c (parse_untyped_expr): Fix various problem for the
- case that we see a '(': Add missing 'case' keyword.
- Only recurse if '(' is followed by 'if', 'case' or '[',
- and in that case emit a pedwarn (and do a missing NEXT_TOKEN).
-
- * parse.c (parse_send_action): Remove extra nreverse.
-
-Thu Jul 28 04:00:11 1994 Wilfried Moser (moser@rtl.cygnus.com)
-
- * expr.c (build_allocate_global_memory_call, build_allocate_memory_call):
- Add new checks.
-
-Tue Jul 26 22:48:15 1994 Michael Tiemann (tiemann@blues.cygnus.com)
-
- * parse.c (parse_untyped_expr): Added missing "case" before LPRN.
- Added a missing call to `require' as well.
-
-Tue Jul 19 10:30:12 1994 Ian Lance Taylor (ian@sanguine.cygnus.com)
-
- * lex.l (yywrap): Define as yywrap_chill to avoid conflicts with
- the extern declaration in the flex skeleton.
-
-Mon Jul 18 23:06:04 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * tasking.c (build_copy_number, build_proc_type, expand_send_signal):
- Check the type of the instance expr using CH_COMPATIBLE,
- and not just == instance_type_node. (This allows
- the expression to have mode READ INSTANCE).
- * tasking.c (build_instance_type): Give instance_type_node
- a non-null novelty (i.e. different from a struct).
- * tasking.c (build_receive_case_start, build_delay_case_start):
- Check that for a location using CH_LOCATION_P.
-
-Mon Jul 18 13:22:23 1994 Jim Wilson (wilson@sphagnum.cygnus.com)
-
- * expr.c (finish_chill_unary_op): Use TREE_SET_CODE not TREE_CODE
- to modify a tree code.
-
-Mon Jul 18 11:24:57 1994 Bill Cox (bill@rtl.cygnus.com)
-
- * convert.c (digest_structure_tuple): Fix thinko in TREE_CODE
- comparison.
-
-Mon Jul 18 05:40:15 1994 Doug Evans (dje@canuck.cygnus.com)
-
- * decl.c (warn_bad_function_cast): Define so cc1chill will link.
-
-Thu Jul 14 18:37:18 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * parse.c (parse_send_action): Do tree_cons *before* checking
- for end of loop.
-
-Mon Jul 11 15:33:52 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * convert.c (digest_structure_tuple): Don't use convert to
- coerce initial value, use chill_convert_for_assignment instead.
- (Thus we also get range_checking.)
-
- * expr.c (build_chill_card): Use force_addr_of instead of
- build_chill_addr_expr.
-
- * loop.c (build_temporary_variable): Stylistic tweak.
- * loop.c (maybe_make_for_temp): Initialize temp using
- explicitly, not using assignment. Avoids a problem if
- the expression is read-only.
- * typeck.c (smash_dummy_type): Always used the saved TYPE_NAME
- and CH_NOVELTY_FLAG.
-
-Wed Jul 6 20:12:13 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * expr.c, ch-tree.h (finish_chill_unary_op): New function,
- based on code ripped out of build_chill_unary_op.
- (build_chill_unary_op): Call finish_chill_unary_op unless pass==1.
- * satisfy.c (satisfy): Call finish_chill_unary_op when needed.
-
-Mon Jun 27 11:29:18 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * tree.c (save_if_needed), ch-tree.h: New function.
- * typeck.c (build_chill_slice_with_range,
- build_chill_slice_with_length): Call save_if_neeed on array arg.
- * expr.c (varying_to_slice): Re-write to use save_if_needed.
-
- * typeck.c (extract_constant_from_buffer): Handle BOOLEAN_TYPE.
-
-Mon Jun 27 01:11:10 1994 Wilfried Moser (moser@rtl.cygnus.com)
-
- * inout.c (build_chill_io_list_type): Change layout of __tmp_WIO_list
- that it is always the same, regardless if compiled with -fpack
- or not.
-
-Tue Jun 14 16:44:14 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * lex.l (yywrap): Kludge to work around mis-synchronization
- between lexer (which read ahead) and parser: Don't emit
- (left-over) uze_seizefile directives at the end of file.
-
- * typeck.c (build_chill_array_ref): Allow the derived
- array indexing syntax for arrays of bit strings.
- Add a comment explaining why.
-
- * typeck.c, ch-tree.h (string_assignment_condition): Change
- the interface. Return a boolean expression (which can be
- used in a conditional at run-time); never expand anything.
-
- * actions.c (chill_convert_for_assignment): Check
- string_assignment_condition here, rather than in callers.
- * actions.c (chill_expand_assignment): Don't need to check
- string_assignment_condition here.
- * expr.c (build_chill_function_call): Likewise.
- * satisfy.c (safe_satisfy_decl): Update accordingly.
- * decl.c (do_decl): Simplify testing and conversion by
- deferring everything to chill_convert_for_assignment.
-
- * parse.c: Combine the two variables 'ignore_exprs' and
- 'ignore_actions' into one variable called 'ignoring'.
- * ch-tree.h: Add 'extern int ignoring'.
- * actions.c, except.c, parse.c, tasking.c, timing.c, typeck.c:
- Rename ignore_actions and ignore_exprs to ignoring.
- Remove unneeded extern declarations.
- * expr.c (build_chill_indirect_ref, build_chill_component_ref,
- build_chill_arrow_expr, build_generalized_call, build_delay_action,
- build_buffer_type, build_event_type): I changed my mind. It is
- cleaner to check for 'ignoring' in the parser, rather than here.
- * parse.c (parse_action, parse_primval, parse_opt_mode):
- Therefore we must check for ignoring here.
- * parse.c (parse_loc_declaration): Set ignoring in pass 2
- when parsing the mode.
-
- * tasking.c (generate_tasking_code_variable): Do arithmetic
- on signal_code etc using unsigned rather than signed shorts.
-
- * grant.c (static char* current_grant_modename): Removed.
- * grant.c (decode_decl case CONST_DECL): Remove error message.
-
- * Make-lang.in (CHILL_SRCS): Add $(srcdir)/ch/parse.c.
- * Makefile.in: Fix dependencies for parse.o.
- Remove some duplicate dependencies for $(TREE_H).
-
-Mon Jun 13 14:25:50 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * typeck.c (build_chill_cast): Allow a value cast between
- non-discrete object of the same size, but with a pedwarn.
- * typeck.c (bit_string_assignment_condition,
- char_string_assignment_condition): Merge near-duplicate functions
- and place the code in string_assignment_condition.
-
- * decl.c (parm_flag, declare_parm_level, in_param_level_p):
- Removed. Not used.
- * decl.c (start_chill_function, finish_chill_function): Make
- parameter level have same nesting level as body, as required by Z200.
- * decl.c (switch_to_pass_2): Always exit if an error has been found.
- * decl.c (pop_module): Copy DECL_SEIZEFILE to a new ALIAS_DECL
- generated from GRANT ALL.
- * decl.c (lookup_name_for_seizing): Don't seize from
- the nesting level of builtins (predefined objects).
- * decl.c (lookup_name_for_seizing): Make more robust on error.
-
- * decl.c (start_chill_function): MAKE DECL_NAME (chill_result_decl)
- be 'RESULT' (or 'result'). This makes it more accessible from gdb.
- Also, use do_decl to declare it, so that debugging symbols are
- generated. And, re-arrange so that actions that need to
- be done both passes (such as push_levels) use the same code.
-
- * parse.c (get_type_of): If ignore_exprs, don't lookup name.
- * parse.c (end_function): Fix poplevel params.
- * parse.c (expect): Don't read forwards on an error.
- * parse.c (parse_field): Don't define two tag_list locals!
- * parse.c (parse_pass_1_2): Better error message.
-
- * parse.c (parse_mode, parse_opt_mode): Have parse_mode call
- parse_opt_mode, rather than vice versa. If parse_opt_mode
- returns NULL_EXPR, then parse_mode gives an error.
- Change parse_opt_mode (and any functions it calls) to only
- return NULL_TREE if there is no mode (even on ignore_exprs).
- (parse_set_mode, parse_structure_mode, parse_procedure_mode):
- Never return NULL_EXPR.
- * tasking.c (build_buffer_type, build_event_type): Return
- void_type_node instead of NULL_EXPR if ignore_exprs is true.
-
- * parse.c (parse_synonym_definition): Call parse_untyped_expr
- only if we have a mode.
- * parse.c (parse_send_action): Parse list of untyped_expr's,
- rather than a list of (typed) expressions.
- * parse.c (parse_primval): Emit error if '[' seen without
- preceding mode name. (If this is to be allowed, call
- parse_untyped_expr instead.)
-
- * parse.c (parse_array_index): Renamed to ...
- (parse_index_mode): ... to match Z200 terminology.
- Re-write to resolve some of the nastier ambiguities,
- and allow things like ' CHAR(10) : CHAR(20) '.
-
- * parse.c (parse_tuple_element): Change interface to return
- reversed list, so don't call nreverse.
- * parse.c (parse_tuple): No longer nreverse element list here.
- * parse.c (parse_opt_element_list): Do nreverse here instead.
- * parse.c (parse_case_label_list): Call nreverse at end.
-
-Fri Jun 10 15:36:22 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * typeck.c (chill_similar): Remove bogus "else".
-
-Wed Jun 8 00:01:40 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * ch-tree.h (TYPE_ARRAY_MAX_SIZE): New macro (and comment)
- to make it clearer that we are using TYPE_MAX_VALUE in a special way.
- * typeck.c (build_chill_slice): Use TYPE_ARRAY_MAX_SIZE.
- * expr.c (chill_expand_expr case CONCAT_EXPR): Likewise.
- * convert.c (convert): When converting a fixed string/array
- to varying, and we need padding, set the TYPE_ARRAY_MAX_SIZE
- of (the type of) the padding.
- * convert.c (convert): If the concatenation is non-constant, use
- the low-level 'build' to set the type of the result (which is usually
- a fixed-size array) rather than depend on build_chill_binary_op
- to figure it out (it's unable to simplify the size to a constant).
-
-Mon Jun 6 18:16:57 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * lang.c (lang_decode_option): Let -fspecial_UC imply
- -fno-ignore-case without requiring it explicitly.
- * lang.c (lang_decode_option): Support (experimentally)
- the -fpack and -fno-pack flags.
-
-Thu Jun 2 20:49:51 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
-
- * configure: Add support for --program-prefix and --program-suffix.
-
-Tue May 31 18:12:00 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * convert.c (digest_constructor): Check that initial value
- is compatible with element mode before calling convert.
- * typeck.c (chill_compatible): A string mode is not compatible
- with an untyped constructor.
- * decl.c (do_decl): Clean up error messages. Use error_with_decl.
-
- * ch-tree.h: Fix inconsistencies: bool_true_node ->
- boolean_true_node, and bool_false_node -> boolean_false_node.
- * typeck.c (valid_array_index_): Minor simplification.
-
-Tue May 31 04:33:28 1994 Wilfried Moser (moser@rtl.cygnus.com)
-
- * inout.c (build_chill_writetext): Add correct processing
- of POWERSET RANGE (setmode).
-
- * lex.l (same_file): Add searching for file(s) in
- seize_path_list.
-
-Fri May 27 14:22:42 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * Make-lang.c (CHILL.mostlyclean, CHILL.distdir): Don't list
- yacc/bison output files, since the grammer is no longer in yacc.
- * config-lang.in (diff_excludes): Likewise.
-
-Thu May 26 16:38:13 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * gperf, hash.h, lex.l, parse.h: Rename PROCESS_TYPE token
- (in some files spelled PROCESS_TYPE_ to avoid clashes
- with the PROCESS_TYPE tree_code) to PROCESS_TYPE_TOKEN.
-
-Thu May 26 02:18:28 1994 Wilfried Moser (moser@rtl.cygnus.com)
-
- * timing.c (build_cycle_start): Change call to __define_timeout.
- * decl.c (init_decl_processing): Change definitions of
- __define_timeout and __wait_timeout.
-
-Wed May 25 11:53:09 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- Replace yacc-based parser with a recursive-decent parser.
- (This may seem backwards, but Chill [like C++] is not a
- language that is remotely LALR(1). Using a R-D parser
- allows us to use look-ahead and to back-up to resolve the
- difficult ambiguities.)
- * parse.y: Removed.
- * parse.c, parse.h: New files, containing new r-d parser.
- * Makefile.in: Update accordingly.
- * actions.c (chill_convert_for_assignment): Don't return
- NULL_EXPR if ignore_exprs is true. It simplifies the parser
- if we consistently reserve NULL_EXPR for a missing expression.
- * expr.c (build_chill_function_call): Likewise.
-
- * lex.l: Tweaks for new parser.
- * lex.l (prepare_paren_colon, paren_paren_colon_level,
- paren_level): Ugly hack no longer needed.
-
- * expr.c (build_chill_function_call): Cleanup.
- Call chill_convert_for_assignment to convert IN/INOUT
- paramaters on both input and output. For LOC parameters,
- give error if actual is a non-referable location.
- * actions.c (convert_for_assignment): Add new parameter (a
- "place" string used in error messages).
- * actions.c (adjust_parm_or_field): Removed.
- * actions.c (chill_expand_assignment): Take just a single LHS,
- and move support for multiple assignments to ...
- (expand_assignment_action): ... here. Some cleaning up.
- * timing.c (build_cycle_start): Adjust accordingly.
- * actions.c (expand_assignment_to_varying_array): Likewise.
- * tasking.c (many places): Ditto.
- * ch-tree.h: Fix declarations appropriately.
-
- * parse.c (parse_defining_occurrence_list): Return a single
- IDENTIFIER_NODE (instead of a singleton list) in the common
- case. Minor complication to save a minor amount of space.
- * decl.c (do_based_decls): Move guts of code into ...
- (do_based_decl): ... this new function.
- * decl.c (do_decls): Handle either IDENTIFIER_NODE or a TREE_LIST.
- * decl.c (push_syndecl): Replace by ...
- (push_syndecl): ... (which only supports a single name).
- (push_modedef): Only handle a single name.
- * tasking.c (build_process_header, build_signal_struct_type):
- Adjust accordingly.
-
- * expr.c (build_generalized_call): Handle string repetition.
- * expr.c (build_chill_repetition_op): Change interface.
- * grant.c (decode_constant): Allow parameter list to be
- a non-TREE_LIST. (Used for string repetition.)
-
-Wed May 25 11:28:48 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * lex.l (make_identifier): Replaced by ...
- (read_identifier, handle_name): ... new functions.
- * lex.l: Parse an identifiers using read_identifier using
- read_identifier and handle_name, rather than having [f]lex
- do it. (One reason is that lex uses a fixed-size buffer.)
-
- * lex.l (read_directive, skip_directive): New functions.
- Use them to parse compiler-directives, instead of rather
- ugly and useless use of lexer start conditions.
-
-Tue May 24 22:36:51 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * decl.c (unnamed_module_number): Renamed to ...
- (module_number): .. and make non-static.
- (push_module): Always increment module_number.
- * lex.l (yywrap): Print warning if no modules seen.
-
- * decl.c (pop_module): Don't set DECL_SEIZEFILE of granted
- decl to current_seizefile_name (which is unreliable).
- * grant.c (chill_grant): Set it here instead.
-
- * expr.c (fold_set_expr): Use int_size_in_bytes instead of
- TYPE_PRECISION (which is not defined for a SET_TYPE).
-
-Fri May 20 15:21:26 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- Cleanup to remove need for variables in common storage.
- * decl.c: Remove unused use of current_obstack.
- * actions.c (maybe_chill_check_decl): Remove unused function.
- * actions.h, lang.c: Remove uses of doing_chill_thang.
- * ch-tree.h (void_list_node): Make extern (rather than common).
- * decl.c (void_list_node): Add definition.
-
-Thu May 19 06:54:56 1994 Wilfried Moser (moser@rtl.cygnus.com)
-
- * configure (build): Build canon_host and canon_target
- to pass it to all subsequently generated Makefiles (needed
- for testsuite/execute in case of cross build).
-
-Wed May 18 13:27:12 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * grant.c (decode_mode): Remove. It checks the TYPE_NAME of
- the input type, which loses with the no-longer-new 2-pass
- implementation, since the input "type" could be an IDENTIFIER_NODE.
- * grant.c (raw_decode_mode): Rename to decode_mode.
-
-Tue May 17 13:19:52 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * typeck.c (chill_location): Neither a STRING_CST nor a
- CONSTRUCTOR is a location.
- * typeck.c (chill_root_mode): Convert a function to a
- pointer-to-function.
- * expr.c (build_chill_indirect_ref, build_chill_component_ref,
- build_chill_arrow_expr): If ignore_exprs, return operand
- rather than NULL_EXPR. This makes it easier for the parser to
- distinguish missing expressions.
- * expr.c (build_max_min): Convert the lower bound of a
- set to a long before calling run-time routine.
- * expr.c (build_chill_pred_or_succ): Use discrete_type_p
- to check the argument type.
- * expr.c (build_chill_arrow_expr): If argument is not a location,
- do a predwarn if it is a STRING_CST or has function type.
-
-Tue May 17 06:05:13 1994 Wilfried Moser (moser@rtl.cygnus.com)
-
- * configure (build): Remove building of canon_host and canon_target.
- It doesn't work in any case.
-
-Mon May 16 02:10:35 1994 Wilfried Moser (moser@rtl.cygnus.com)
-
- * configure (build): Build canon_host and canon_target
- to pass it to all subsequently generated Makefiles (needed
- for testsuite/execute in case of cross build).
- * Make-lang.in (chill-runtime): Change chill to CHILL in the case
- statement to build chill-runtime automatically.
-
-Mon May 9 15:30:08 1994 Doug Evans (dje@canuck.cygnus.com)
-
- * Makefile.in (FLAGS_TO_PASS): Define.
- (OBJDEPS): Define.
- (../cc1chill): Depend on $(OBJDEPS) $(C_OBJS).
- * Make-lang.in (cc1chill): Delete dependency on $(OBJS) $(BC_OBJS).
- (CHILL.mostlyclean): Use `mostlyclean' as recursive target.
-
-Sun May 8 13:05:00 1994 Per Bothner (bothner@cygnus.com)
-
- * Make-lang.in (cc1chill): Should not depend on libgcc.a.
-
-Thu May 5 18:58:22 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * decl.c (copy_lang_decl): New (dummy) function.
-
-Mon May 2 14:33:44 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * parse.y (sendaction): Fix thinko (in sense of condition).
- * tasking.c (build_receive_case_label): Another thinko.
-
- * parse.y (optsigdest): Force ignore_exprs to 0 while parsing
- the (signal-)name.
-
- * decl.c (build_chill_function_type): Don't call layout_type
- (since that may prevent parameter or result types being
- properly satisfied).
- * satisfy.c (satisfy): Layout FUNCTION_TYPEs.
- * parse.y (procmode): Call build_chill_pointer_type, rather
- than build_pointer_type (which incorrectly sets TYPE_SIZE).
-
- * parse.y (get_type_of): Handle TYPE_DECL (again).
- * parse.y (optresultspec): Call build_chill_reference_type, rather
- than build_reference_type (which incorrectly sets TYPE_SIZE).
- * parse.y (range_or_mode): Rename to plain range, since it
- no longer matches modename.
- * actions.c (chill_handle_case_label_range): New function, with
- functionality moved out of chill_handle_case_label.
- * actions.c (chill_handle_case_label): Handle here the case that
- the label_value is a TYPE_DECL (modename). Also clean up some.
- * typeck.c (build_chill_slice_with_length): Convert max_index
- to the type of min_value. (Old code broke on varying strings.)
-
-Sun May 1 13:53:36 1994 Doug Evans (dje@canuck.cygnus.com)
-
- * Makefile.in (BC_OBJS): Delete all references
- (OBJS): Cat ../stamp-objlist to get language independent files.
- (../cc1chill): Delete dependency on $(OBJS).
- * Make-lang.in (cc1chill): Depend on stamp-objlist.
-
-Sat Apr 30 14:50:15 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * lex.h, lex.c: Remove lastiddecl.
- * lex.l (name_type_signal): Simplify. We no longer check for
- TYPENAME or SIGNALNAME (which was unreliable with two passes).
- Also rename to make_identifier.
- * parse.y: Cleaned up grammar to not need SIGNALNAME or TYPENAME.
- * Makefile.in (stamp-parse); One conflict fewer!
- * parse.y (rccase_label_flag): Moved to tasking.c.
- * parse.y (rccase_label): Move most of the logic to
- build_receive_case_label in tasking.c.
- * parse.y (sendaction): Re-write to not depend on SIGNALNAME.
-
- * parse.y (name): Do name lookup here (and not in location).
- * parse.y: Replace most uses of NAME by higher-level non-terminals:
- simple_name_string, name_string, defining_occurrence, or name.
-
- * tasking.c (build_receive_signal_case_label,
- build_receive_buffer_case_label): New functions, split out from
- build_receive_case_label.
- * tasking.c (build_receive_case_label): Change parameters
- and return type. Moved stuff here (from the parser).
- * tasking.c (struct rc_state_type): Removed had_errors.
- Return error_mark_node instead.
- * tasking.c (build_rccase_set_error), ch-tree.h: Removed.
-
- * expr.c (build_generalized_call): If func is a signal type,
- call build_signal_descriptor.
-
- * parse.y (arrayindex): Renamed to index_mode, to match Z.200.
- * parse.y (ioindexmode): Removed; use index_mode instead.
- * expr.c (build_generalized_call): If args is a RANGE_EXPR,
- we have either a slice or a range mode, depending on func.
- * parse.y (index_mode): If we got an 'expr', only allow a name,
- or a range mode.
- * parse.y (call): A slice with both end points can be a range
- mode, so defer handling to build_generalized_call (or index_mode).
-
- * typeck.c (build_chill_slice_with_length): Fix type-checking.
- * typeck.c (chill_novelty): Undo (part of) change of April 28:
- The novelty of a range mode is the novlety of the parent.
- * typeck.c (chill_root_mode): Don't return integer_type_node
- if argument has non-nil novelty.
-
- * decl.c (global_bindings_p): Return -1 as true, for the sake
- of variable_size (in ../stor-layout.c).
-
-Fri Apr 29 13:42:43 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * parse.y: Remove TYPENAME and modename. These are now plain
- NAMEs. Modify parsing actions appropriately.
- * expr.c (build_generalized_call): Handle the case that
- TREE_CODE (func) == TYPE_DECL (as in a cast).
- * lex.l (name_type_signal): Never return TYPENAME.
- * parse.y (get_type_of): If pass 1, just return the argument.
-
- * decl.c (do_decl): If an initializer has the wrong type,
- replace it by NULL_TREE, to avoid subsequent errors.
-
-Thu Apr 28 15:21:56 1994 Wilfried Moser (moser@rtl.cygnus.com)
-
- * Makefile.in: Add new file timing.c to rules.
- * timing.c: New file. Implements the timing actions AT,
- CYCLE and AFTER.
- * decl.c (init_decl_processing): Add new builtin function
- descriptions.
- * expr.c (build_chill_indirect_ref): Change error message and
- add check agains an IDENTIFIER_NODE.
- * gperf, hash.h: Change EVENT_CODE, BUFFER_CODE to IGNORED_DIRECTIVE.
- They are no longer needed.
- * grant.c (print_integer_type): Add processing of builtin types
- DURATION and TIME.
- * lex.l: Remove processing of directive EVENT_CODE & BUFFER_CODE.
- * parse.y (timingactions): split up to afteraction, ataction
- and cycleaction.
- * parse.y (afteraction): New rule.
- * parse.y (ataction): New rule and put actions in.
- * parse.y (cycleaction): New rule and put actions in.
- * parse.y (sendaction): Add code for SEND buffer.
- * parse.y (rccase_label): Change error processing.
- * tasking.c (build_gen_inst): More checks.
- * tasking.c (build_gen_code): Add checking for argument is a
- PROCESS or a SIGNAL.
- * tasking.c (struct rc_state_type): Add new fields for easier
- error processing.
- * tasking.c (build_receive_case_if_generated), ch-tree.h: New function.
- * tasking.c (build_rccase_set_error), ch-tree.h: New function.
- * tasking.c (build_receive_case_label): Add processing of BUFFER's.
- * tasking.c (build_receive_buffer_case_end, build_receive_signal_case_end):
- New functions to process the end of a RECEIVE CASE action in case
- of BUFFER's and SIGNAL's.
- * tasking.c (build_receive_case_end): Do only general processing and
- call one of the above mentioned functions.
- * tasking.c (build_delay_case_start, build_delay_case_label,
- build_delay_case_end): Rewritten due to new implementation of events.
- * tasking.c (build_delay_action): Rewritten due to new implementation
- of EVENT's.
- * tasking.c (expand_send_buffer), ch-tree.h: New function.
- * timing.c (build_at_action, build_cycle_start, build_cycle_end),
- ch-tree: New functions.
-
-Thu Apr 28 14:11:29 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * typeck.c (smash_dummy_type): Handle the special case of a
- NEWMODE of a range mode, as required by Z200, by creating a
- new parent mode with the new novelty (and casting the min
- and max of the range to teh new parent mode).
- * typeck.c (chill_novelty, chill_root_mode): Remove special
- kludges for of NEWMODE ranges.
- * expr.c (build_chill_lower_or_upper): New function, combining
- the "guts" of build_chill_lower and build_chill_upper.
- * expr.c (build_chill_lower_or_upper): Simplify; no longer
- need to kludge the novelties.
-
- * typeck.c (valid_array_index_p): A string index expression
- need not be Compatible with the index type; only similar.
-
- * decl.c (layout_chill_variants): If error seen, skip stuff
- (rather than aborting or crashing).
- * decl (push_modedef): If newdecl's type is an error mark,
- continue rather than aborting.
-
-Thu Apr 28 02:07:42 1994 Doug Evans (dje@cygnus.com)
-
- * Make-lang.in: Update of directory reorg from fsf.
- * config-lang.in: Ditto.
-
-Mon Apr 25 13:09:46 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * typeck.c (chill_similar): Check RECORD_TYPEs properly,
- * convert.c (convert): If all else fails, just call convert1.
- Thus we can now convert RECORD_TYPEs (assuming they are similar).
-
- * parse.y, lex.l: Remove BUFFERNAME (use location/expr instead).
- * parse.y: Re-do BUFFER handling (similar to previous EVENT change).
- * grant.c (raw_decode_mode): Re-do BUFFER mode handling.
- * ch-tree (lang_type_record): Removed max_queue_size field.
- * tasking.c (build_buffer_type): Re-write.
- * tasking.c (max_queue_size): Fix to support buffer modes.
- * tasking.c (buffer_element_mode), ch-tree.h: New function.
- * tasking.c ch-tree.h (expand_send_buffer): Now has 3 parameters.
- * parse.y (modename): No longer match SIGNALNAME. Instead, add it
- to name and simple_name_string. This removes a reduce/reduce conflict.
- * Makefile.in (stamp-parse): Expect fewer conlicts.
-
- * lex.l (yywrap): Move check for circularly seizeing current
- grant-file from here ...
- * lex.l (handle_use_seizefile_directive): ... to here.
- This is to avoid calling stat on a not-yet written grantfile,
- now that we're using same_file (which calls stat).
- * grant.c (set_use_this_gf): Removed.
- * grant.c (set_default_grant_file): Set grant_file_name here,
- because we need it earlier (due to above lexer change).
-
- * typeck.c (layout_chill_struct_type): Remove useless code to
- remove zero-width bitfield (which messes up CONST_DECLs).
-
-Sat Apr 23 13:16:39 1994 Bill Cox (bill@rtl.cygnus.com)
-
- * Makefile.in (check): Assure that 'ld' is available before checking.
-
-Thu Apr 21 13:23:54 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * grant.c (print_an_int): Removed.
- (raw_decode_mode): Generalized to use decode_constant
- instead of print_an_int.
- (decode_constant): Print directly, instead of calling print_an_int.
- * parse.y (event_list): Fix syntax.
- * parse.y (optqueuesize): Default is NULL_TREE, not zero.
- * tasking.c (check_queue_size): New function, for error checking.
- * ch-tree.h: Add declaration for check_queue_size.
- * satisfy.c (satisfy case RECORD_TYPE): Satisfy constant fields
- (used for queue size of EVENT and BUFFER), and call check_queue_size.
-
-Tue Apr 19 13:42:41 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- Re-implement EVENT modes to support general EVENT objects
- (and not just EVENT names), according to Z200. (Not finished!)
- * tasking.c, ch-tree.h (max_queue_size): New function.
- * parse.y (dcalternative, event_list, event_list_head): New
- implementation of DELAY CASE, avoiding parsing ambiguities.
- (call, locdec, delayaction): Remove old EVENTNAME kludges.
- * lex.l (name_type_signal): Remove EVENTNAME recognition.
- * tasking.c (build_event_type): Re-written.
- * typeck.c (chill_similar), decl.c (print_lang_type):
- Use new max_queue_size function.
- * typeck.c (layout_chill_struct_size): Ignore CONST_DECL.
- * tasking.c (build_delay_action): Preliminary changes - just to
- make it compile. FIXME!
- * grant.c (raw_decode_mode): Use new max_queue_size function.
- Move EVENT support from LANG_TYPE to RECORD_TYPE.
- * ch-tree.h (process_event_decls): Removed.
-
-Tue Apr 19 11:44:01 1994 Bill Cox (bill@rtl.cygnus.com)
-
- * regression.sh: Complete previous change - eliminate all
- references to objdir as a user parameter.
-
-Mon Apr 18 10:17:55 1994 Bill Cox (bill@cygnus.com)
-
- * Makefile.in (check): Simplified regression.sh call.
- * regression.sh: Change command-line parsing. Default
- srcdir to the script's path. Calculate objdir
- internally - don't pass it in.
-
-Thu Apr 14 13:30:19 1994 Wilfried Moser (moser@phishhead.cygnus.com)
-
- * expr.c (build_chill_duration): Add range checking.
-
- * lex.l (init_lex): Add predefined names DURATION and TIME.
- * lex.h (enum rid): Add RID_DURATION and RID_TIME.
- * ch-tree.h: Add prototypes and externals.
- * decl.c (init_decl_processing): Add builtin function
- descriptions.
- * expr.c (build_generalized_call): Add processing of some
- builtin's.
- * expr.c (build_chill_abstime): New function to process builtin
- ABSTIME.
- * expr.c (build_chill_inttime_type): New function to built type
- for the INTTIME builtin.
- * expr.c (build_chill_inttime): New function to process builtin
- INTTIME.
- * expr.c (build_chill_duration): New function to process builtin's
- MILLISECS, SECS, MINUTES, HOURS and DAYS.
-
-Tue Apr 12 11:55:45 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * lex.l (chill_same_grant_file): Rename to same_file. Change to
- take two files names rather than two DECLs. Also check that the
- filesystems (st_dev) are equal. Finally, make static.
- * lex.l (handle_use_seizefile_directive): Check for duplicate
- USE_SEIZE_FILE directives using same_file.
- * decl.c (pop_module): Remove dubious call to chill_same_grant_file.
-
-Sun Apr 10 17:19:56 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * decl.c, ch-tree.h (chill_result_decl): New variable. Used to
- store RESULT value. (Cannot use DECL_RESULT; see comment in decl.c.)
- * actions.c (chill_expand_result, chill_expand_return):
- Use chill_result_decl appropriately.
- * ch-tree.h, decl.c, actions.c (saved_result_rtx): Removed.
- Subsumed by chill_result_decl.
-
- * expr.c (chill_expand-expr case CONCAT_EXPR): Generate temporary
- using the mode of the result type, and don't assume it is BLKmode.
-
-Fri Apr 8 17:46:13 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * actions.c (chill_expand_assignment): Check for compatibility
- _after_ "expanding out" a binary operation. This fixes
- the case "STRING //:= CHAR".
-
- * lex.l (equal_number): Convert symbol to integer_type_node, to
- force the value to be INT-derived (and avoid novelty conflicts).
-
-Mon Apr 4 22:06:31 1994 Per Bothner (bothner@cygnus.com)
-
- * ch-tree.h (CH_FUNCTION_SETS_RESULT): New flag.
- * ch-actions.c (chill_expand_return), ch-tree.h: Extra
- parameter, indicates if implicit return at end of function.
- * ch-parse.y: Modify accordingly.
- * ch-actions.c (chill_expand_return): Various improvements.
-
- * decl.c, ch-tree.h (result_never_set): New variable.
- * actions.c (chill_expand_result, chill_expand_return): Clear it.
- * ch-parse.y (end_function): Warn if no RETURN or RESULT action.
-
- * decl.c, ch-tree.h (saved_result_rtx): New variable.
- * decl.c (start_chill_function): Use saved_result_rtx as return
- value if there is a RESULT in a REG that might get clobbered.
- * actions.c (chill_expand_result): Save result in saved_result_rtx
- or assign to DECL_RESULT as appropriate.
- * decl.c, ch-tree.h (current_function_returns_value,
- current_function_returns_null, current_extern_inline):
- Don't use. Only define first two to allow linking with ch-typeck.c.
-
- * typeck.c (chill_l_equivalent): Add forward declaration.
-
-Fri Apr 1 11:02:27 1994 Wilfried Moser (fs_moser at rcsw47)
-
- * lex.l (readstring): Handle control sequence in all cases (Z.200
- 5.2.4.4 page 54).
-
-Fri Apr 1 13:11:27 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * configure: Simplify and fix the logic for looping through
- sub-directories.
-
-Thu Mar 31 18:59:57 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * ch-tree.h (CH_L_EQUIVALENT): Moved from typeck.c.
- * typeck.c (chill_similar): Add support for checking
- FUNCTION_TYPEs for similarity. Also, treat
- pointer-to-function-type the same as function-type.
-
-Thu Mar 31 11:22:56 1994 Wilfried Moser (fs_moser at rcsw47)
-
- * ch-tree.h: Change prototype of function expand_send_signal.
- * parse.y: Change calls to expand_send_signal.
- * tasking.c (expand_send_signal): Change handling of optsetto
- argument. New argument signame to get a possible destination
- process for the signal.
-
-Wed Mar 30 14:54:48 1994 Wilfried Moser (fs_moser at rcsw1j)
-
- * tasking.c (make_process_struct): Change error message in case of
- a process argument has other attribute then IN or LOC.
- * tasking.c (build_start_process): Add check that the optset is
- referable in case it is specified (this makes
- noncompile/start_.ch working).
-
-Tue Mar 29 13:24:27 1994 Wilfried Moser (fs_moser at rcsw1h)
-
- * Makefile.in: Change version string to 1.2.1
- * ch-tree.h (enum chill_built_in_function): Delete no longer valid
- entries.
- * ch-tree.h: Change prototype for build_chill_readtext.
- * decl.c (init_decl_processing): Add builtin_function _readstring,
- _readunixstd and READTEXT.
- * expr.c (build_generalized_call): Add processing of READTEXT.
- Delete handling of no longer valid builtin_functions.
- * gperf: Remove keyword READTEXT.
- * parse.y: Remove token READTEXT.
- * inout.c (build_chill_io_list_type): Add building type for
- READTEXT.
- * inout.c (build_chill_readtext): Implement the function
- (partial).
- * inout.c (build_chill_writetext): Do some cleanups.
-
-Tue Mar 29 12:30:59 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * typeck.c (build_chill_cast): Re-arrange, to support casts
- of const integer to type of different size, if there is
- an integral type of the desired size: Go through the
- const conversion code.
-
- * actions.c (adjust_parm_or_field): Move support for LOC to ...
- * expr.c (build_chill_function_call): ... here.
- Fix a number of bugs in OUT/INOUT handling.
-
- * ch-tree.h, actions.c (adjust_parm_or_field), grant.c (print_struct),
- parse.y (location), typeck.c (chill_comptypes): Remove unused
- support for ENCAPSULATED_ARRAY_P.
- * typeck.c (build_chill_array_parm_type), ch-tree.h: Remove; unused.
-
- * ch-tree.h, decl.c (shadow_record_fields), decl.c
- (shadow_record_fields), expr.c (chill_expand_case_expr,
- build_chill_function_call), grant.c (chill_finish_compile),
- typeck.c (build_empty_string, build_init_struct): Rename magic
- identifiers of the form "<...>" to "__..." for better portability.
-
- * actions.c (adjust_parm_or_field): Remove extraneous
- call to build_chill_repetition_op.
- * expr.c (build_chill_function_call): Some simplifictions
- (since neither valtail nor typetail can be NULL).
- Clean up error message for OUT//INOUT not location to use only 1 line.
- Add error message for OUT/INOUT if type is READonly.
- * typeck.c (build_chill_modify_expr): Simplify.
-
-Sun Mar 27 19:30:25 1994 Bill Cox (bill@rtl.cygnus.com)
-
- * Makefile.in: Clean up generally. Assure that
- runtime is built before running regressions.
- Build correct parameters to regression.sh.
- Remove a lot of 'clean' cruft.
- * Make-lang.in, config-lang.in: New files for
- subdirectory architecture.
-
-Sat Mar 26 10:39:12 1994 Bill Cox (bill@rtl.cygnus.com)
-
- * Makefile.in (check): Build correct parameters for regression.sh.
-
-Fri Mar 25 10:13:06 1994 Bill Cox (bill@rtl.cygnus.com)
-
- * configure: Also mark regression.awk3 as executable.
- * regression.sh: Add comments about command-line options.
- Calculate srcdir correctly, defaulting to the script's path.
- Add OPT flag to pass to the Makefiles, to specify the
- compiler's optimization level, and -O and -O2 options.
- Delete GLOBAL flag and tests. Use a different make.log
- file for optimized and unoptimized test results. Add the
- compiler's host and target triples to the report header.
-
-Wed Mar 23 21:41:26 1994 Bill Cox (bill@rtl.cygnus.com)
-
- * expr.c (build_chill_function_call): Handle INOUT and OUT
- parameters better (for the rangefail test, at least).
-
-Wed Mar 23 14:13:45 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * regression.sh (srcdir, objdir): Fixed hard-wired paths.
- (grep args): Changed [XYZ-] to [-XYZ] for SCO.
-
-Wed Mar 23 13:34:18 1994 Bill Cox (bill@rtl.cygnus.com)
-
- * expr.c (build_generalized_call): Revert previous change.
- To do this correctly, we need a new parsing mechanism, and
- C++ initializer technology.
-
-Wed Mar 23 09:34:50 1994 Bill Cox (bill@rtl.cygnus.com)
-
- * expr.c (build_generalized_call): Be sure we're inside the
- module-level function before calling build_gen_inst, for
- example.
-
-Wed Mar 23 09:34:50 1994 Bill Cox (bill@rtl.cygnus.com)
-
- * regression.sh (dodirectory): Count the gcov and abort tests
- among the .dat files.
-
-Tue Mar 22 15:39:38 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * satisfy.c (safe_satisfy_decl): When checking that a SYN
- value fits in a specified discrete type, don't convert first,
- and use compare_int_csts instead of tree_int_cst_lt.
-
-Tue Mar 22 15:25:38 1994 Bill Cox (bill@rtl.cygnus.com)
-
- * configure: Generate better .gdbinit files.
-
-Tue Mar 22 11:59:38 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * actions.c (check_range): Don't emit dynamic checks
- if not current_function_decl.
-
- * parse.y (arrayindex): Allow expr (error is emitted
- at semantic level if not the NAME of a type).
- * typeck.c (build_chill_cast): Re-enable some casts.
- * satisfy.c (safe_satisfy_decl): Remove redundant CONST check.
-
-Tue Mar 22 11:46:28 1994 Bill Cox (bill@rtl.cygnus.com)
-
- * configure: Access the utils directory correctly.
- * expr.c (build_compare_expr): Reenable compatibility test.
-
-Tue Mar 22 11:24:45 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * typeck.c (valid_array_index_p): Call
- build_compare_discrete_expr instead of build_compare_expr.
- * typeck.c (build_chill_cast): Improve logic.
- * satisfy.c (safe_satisfy_decl): Simplify test.
-
-Tue Mar 22 10:17:58 1994 Bill Cox (bill@rtl.cygnus.com)
-
- * actions.c (chill_expand_assignment): Correct detection of
- string assignment case.
- * expr.c (chill_expand_expr): Now that we're using build_chill_function_call,
- the actual parameters need to be converted to the unsigned long
- type explicitly. Do that.
- * satisfy.c (safe_satisfy_decl): Correct range-checking code.
-
-Mon Mar 21 16:25:07 1994 Bill Cox (bill@rtl.cygnus.com)
-
- * Makefile.in: Correct prediction of grammar conflicts.
- * actions.c(check_range): Fix reference to NULL_TREE pointer.
- And allow compile-time errors even if range_checking is off.
- * parse.y: Clean up some comments.
- * satisfy.c (safe_satisfy_decl): Add range-check for a SYN's value.
-
-Mon Mar 21 13:29:23 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * typeck.c (layout_chill_range_type): Instead of tree_int_cst_lt
- use compare_int_csts (which is more robust when signedness differs).
- Also, convert the bounds *after* doing range checking.
-
- * ch-tree.def (SET_IN_EXPR): New.
- * expr.c (chill_expand_expr): Code to expand SET_IN_EXPR,
- moved from expand_expr in ../expr.c. Also add some extra
- conversions (because we're now using build_chill_function-call).
- * actions.c, decl.c, expr.c, grant.c, parse.y, typeck.c:
- Use SET_IN_EXPR in place of IN_EXPR.
-
- * expr.c (build_compare_discrete_expr), ch-tree.h: New function,
- with code moved from build_compare_expr.
- * expr.c (build_compare_expr): Re-enable compatibility test.
-
-Mon Mar 21 11:02:33 1994 Bill Cox (bill@rtl.cygnus.com)
-
- * Makefile.in: Rewrite byacc related rules.
- * actions.c (chill_convert_for_assignment): Use the
- referenced type only for generating range checks.
- * configure: Add 'utils' directory to SUBDIRS variable.
-
-Sun Mar 20 21:49:59 1994 Bill Cox (bill@rtl.cygnus.com)
-
- * actions.c (check_range): Call build_compare_expr rather than
- build_binary_op.
- (adjust_parm_or_field): Call convert_for_assignment rathern than
- convert, to get the range-checking.
- * expr.c (build_chill_pred_or_succ): Fix up rangefail code.
- Generate a compile-time message if possible.
- (build_compare_expr): Comment out compatibility test - should
- not be needed in here. Fix a couple of typos. Add some types
- to some build calls.
-
-Sun Mar 20 11:48:10 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * decl.c (init_decl_processing): Clean up parameter type
- list for __setbitpowerset,
-
- * typeck.c (chill_compatible_classes): Allow the M-reference
- to be compatible with the N-value class, with suitable M and N.
- * typeck.c (build_chill_slice): Don't smash a void TREE_TYPE.
- (We don't need to, and it causes confusion.)
-
- * expr.c (build_compare_expr): Fix thinko. Add save_exprs.
-
- * expr.c (build_compare_expr): Fix a transcription bug
- (for converting NULL INSTANCEs). Also #include convert.h.
-
- * expr.c (compare_int_csts): New. Compare INTEGER_CSTs.
- Works even if their types have different TREE_UNSIGNED.
- * expr.c (finish_chill_binary_op): Moved code dealing with
- the comparison operators from here ...
- * expr.c (build_compare_expr): ... to new function here.
- Also, for discrete types, tries to Do The Right Thing, even for
- differing values of TYPE_PRECISION and TREE_UNSIGNED.
- the code from lay
- * ch-tree.h: Declare new functions.
- * typeck.c (valid_array_index_p): Various cleanups,
- including using new build_parse_expr.
- * parse.y: Use new build_compare_expr.
-
- * inout.c (build_chill_writetext): Handle REFERENCE_TYPE args.
-
-Sun Mar 20 08:54:27 1994 Bill Cox (bill@rtl.cygnus.com)
-
- * actions.c (expand_assignment_to_varying_array):
- Call build_chill_array_ref to get index checking.
- (chill_convert_for_assignment): Delete unused errstr
- variable.
- (chill_expand_assignment): Call build_chill_array_ref
- to get runtime index checking.
- (expand_varying_length_assignment): Use new interface
- to varying_array_index_p.
- * ch-tree.h (varying_array_index_p): New proto.
- * convert.c (convert): Call build_chill_array_ref
- to get runtime index checking.
- * expr.c (build_chill_pred_or_succ): Fix cond tree
- to have consistent operand types.
- * typeck.c (valid_array_index_p): Change interface to pass
- validity conditions back on caller's TREE_LIST. We
- cannot link the conditions to anything which a
- layout_type routine will expand, since that will occur
- before the exception handler is set up.
- Change calls to valid_array_index_p also.
-
-Fri Mar 18 14:40:50 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * actions.c, except.c, loop.c, tasking.c: Call
- build_chill_function_call instead of the C-specific
- build_function_call.
- * except.c (initialize_exceptions): Fix parmtype of __builtin_setjmp.
- * loop.c (top_loop_end_check): Coerce library function arg.
- * convert.c, expr.c: Re-write to avoid calls to C-specific
- function build_unary_op (e.g. by calling build1 directly).
-
- * typeck.c (chill_equivalent): Change to force failure
- for non-matching integral types (even if not ranges).
-
- * typeck.c, ch-tree.h (build_chill_slice): Make non-static.
- * expr.c (varying_to_slice): Call build_chill_slice (and not
- build_chill_slice_with_length, which does bunches of range
- checking and does not allow the length to be zero).
- * convert.c (convert): Fix off-by-one error.
- * actions.c (chill_expand_array_assignment): Minor cleaning up.
-
-Fri Mar 18 00:12:48 1994 Per Bothner (bothner@deneb.cygnus.com)
-
- * decl.c (init_decl_processing): __lepowerset and __ltpowerset
- take *two* pointer parameters, not one.
- * satisfy.c (satisfy): Only call the appropriate layout routine
- if TYPE_SIZE is 0 (i.e. type hasn't already been laid out).
- * typeck.c (build_chill_slice_with_length): Fix Bill's previous fix.
-
-Thu Mar 17 17:29:43 1994 Bill Cox (bill@rtl.cygnus.com)
-
- * expr.c (build_chill_function_call): Give function call the correct
- type tree.
- * typeck.c (build_chill_slice_with_length): Restore dynamic range
- checking, so it doesn't obscure the CONSTANTness of the length.
-
-Wed Mar 16 17:23:31 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * typeck.c (build_chill_slice), expr.c (chill_expand_expr
- [case CONCAT_EXPR]): Remove kludge setting slice size upper bound
- in TYPE_LANG_SPECIFIC, and restore kludge setting it in MAX_VALUE.
- * typeck.c (build_chill_slice): Use TYPE_MAX_VALUE of
- array_type if needed for size upper bound of slice_type.
- * expr.c (build_concat_expr): Improve calculation of size upper bound.
-
- * typeck.c (valid_array_index_p): Check compatibility using
- correct types.
- * typeck.c (build_chill_slice_with_length); For now revert
- calling valid_array_index_p on length. (It makes it harder
- to realize when the slice is constant length.)
- * expr.c (build_chill_indirect_expr): Minor tweak. (This
- seems to work around a weird C compiler bug. ??)
-
- * expr.c (build_chill_function_call): Cleanup so it doesn't
- call build_function_call (in c-typeck.c).
- * typeck.c, expr.c: Use build_chill_function_call instead of
- build_function_call (in c-typeck.c).
-
- * parse.y (discrete_mode): Move some of the rules from
- non_array_mode into new non-terminal.
- (arrayindex): Use discrete_mode (with NAME and TYPENAME) to
- avoid some misparses.
- * ch-tree.h (SLICE_PTR, SLICE_LENGTH): Removed; unused.
- * convert.c (digest_structure_tuple): Add missing parameter.
- * decl.c (comptypes): Remove unused prototype.
- * decl.c (build_chill_function_type): Handle NULL return_type
- correctly (convert to void_type_node).
- * decl.c (init_decl_processing): layout boolean_type_node *after*
- we've set it's TYPE_MIN_VALUE and TYPE_MAX_VALUE.
-
-Wed Mar 16 16:08:22 1994 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-tree.h: Add prototype.
- * convert.c (convert): Correct calculation of padding length.
- * decl.c (grok_chill_fixedfields): Move ignore_exprs test to
- parse.y where it belongs. This permits the removal of a kludge
- in make_process_struct.
- * lex.l, parse.y: Call to_global_level for several errors. Add
- code to output error in only one pass.
- * tasking.c (make_process_struct): Delete kludge inserted on
- March 8.
- (build_receive_case_end): Add Wilfried's check for errors.
-
-Tue Mar 15 08:42:12 1994 Bill Cox (bill@rtl.cygnus.com)
-
- * actions.c: Fix comment.
- (build_rts_call): Ifdef it out - never used.
- (expand_varying_length_assignment): call valid_array_index_p.
- rather than validate_varying_array_ref.
- * ch-tree.h: Fix prototype for valid_array_index_p.
- * expr.c (chill_expand_expr): Call build_chill_array_ref to get
- index validation.
- (build_hill_lower, build_chill_upper): Return value now inherits
- the novelty of the input parameter.
- (varying_to_slice): Use CH_NOVELTY macro rather than calling
- chill_novelty directly.
- * grant.c (newstring): Make len unsigned and cast xmalloc parameter
- to unsigned.
- (print_integer_type): Pass string value as APPEND's second parameter.
- (decode_decl): Pass a boolean expression as print_proc_tail's
- first parameter.
- (chill_finish_module_code): Make xmalloc's parameter unsigned.
- * lex.l: Pass sizes to xmalloc as unsigned ints. Pass second
- parameter to in_word_set as unsigned.
- * loop.c (build_loop_start): Check top_loop_end_check return value.
- * parse.y: Add casts to int for third do_decls parameter, fifth
- build_loop_iterator parameter, etc.
- * tasking.c (build_receive_case_end): Chack cond_stack before popping.
- * typeck.c (validate_varying_array_ref, chill_max_vary_array_index,
- valid_array_index): Delete them. They're now unused.
- (valid_array_index_p): Add function, call it everywhere that an
- array index is checked.
- (build_chill_slice): Restore old functionality where varying_to_slice
- is called to handle slices of varying arrays, rather than handling
- handling them here.
- (build_chill_slice_with_range, build_chill_slice_with_length):
- Check range limits for TREE_CONST before calling tree_int_cst_lt.
- Delete now-obsolete checks of constant indices.
-
-Mon Mar 14 17:26:51 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * parse.y (modeless_expr): New rule to allow ([...]) and (if...)
- to count as untyped_exprs. (This is not really permitted by the
- Blue Book, but has been requested by customers.)
-
-Thu Mar 10 10:11:02 1994 Bill Cox (bill@rtl.cygnus.com)
-
- * chill.texi: Document new command-line options.
- * expr.c (build_chill_num): Set unsigned parameter for
- type_for_size call correctly (unsigned for enums).
- * lang.c (lang_decode_option): Add command-line options to
- enable/disable runtime range-checking.
- * lex.l: Eat more whitespace.
-
-Thu Mar 10 09:41:37 1994 Bill Cox (bill@rtl.cygnus.com)
-
- * Makefile.in: Have rules to make parse.h, y.tab.c and other
- derived files. This allows the gcc/configure list of CHILL
- files machinery to work.
- * ch-tree.h (permanent_allocation): Add a parameter flag.
- * decl.c (finish_chill_function, finish_decl): Provide the
- new permanent_allocation flag.
- (poplevel): Return early, avoid a seg fault.
- * lex.l (NORMAL): Replace this whole state with the predefined
- INITIAL state. Force compilation state to global level after
- compiler directive error - prevents endless loop on error.
- (handle_use_seizefile_directive): Rewrite for readability.
- (chill_same_grant_file): Reindent.
- Generally handle whitespace differently.
- * regression.prpt: Print ten PR numbers per line. The report's
- getting too long.
-
-Wed Mar 9 09:58:51 1994 Bill Cox (bill@rtl.cygnus.com)
-
- * decl.c (do_decl): Suppress the string-assignment-condition
- error - it was too often seen.
- * expr.c (expand_chill_expr): In CONCAT_EXPR, when argument has a
- runtime-changing length (as in a slice), get the parent array's
- allocation size from its type tree.
- * typeck.c (build_chill_slice): Support VARYING arrays. Pass
- parent array's static allocation size along in the slice type.
-
-Wed Mar 9 08:54:24 1994 Bill Cox (bill@rtl.cygnus.com)
-
- * lex.l (name_type_signal): Avoid dereferencing a NULL TRE_TYPE.
-
-Tue Mar 8 11:51:10 1994 Bill Cox (bill@rtl.cygnus.com)
-
- * expr.c (build_chill_sizeof): Fix typo in error msg, add
- some whitespace.
- * lex.l (name_type_signal): Add debug output.
- * parse.y (call): Allow EVENTNAME and BUFFERNAME parameters
- to a call, so that SIZE () works on them.
- * tasking.c (make_process_struct): Force ignore_exprs non-zero
- when processing a SEIZEd PROCESS declaration. This prevents
- grox-fixed_fields from returning a NULL, and indirectly protects
- the chill_integer_type_node tree from corruption.
-
-Mon Mar 7 19:14:05 1994 Bill Cox (bill@rtl.cygnus.com)
-
- * Makefile.in: Use the 'all' target to build the runtime
- library and chillrt0.o.
- * README: Explain rules for files in this directory.
- * addtest, addtest.man, build-release,
- chill.regress.cron: Move to utils subdirectory.
- * expr.c (build_chill_function_call): Mark the INOUT
- temporary so it doesn't get optimized into a
- register. Fixes the execute/inout.ch bug.
- * typeck.c (layout_chill_range_type): Restrict it
- from complaining about an empty string type's
- bounds (0:-1).
-
-Mon Mar 7 09:06:39 1994 Bill Cox (bill@rtl.cygnus.com)
-
- * Makefile.in (compiler): Restore this target.
- (OBJS, BC_OBJS): Delete unused variables.
- Add $(FLAGS_TO_PASS) to sub-make invocations.
- * ch_decomment.l, ch_makedepend, chill.patches, printf.c,
- tcov.awk, tcov.el, tcov.sh: Move to utils subdirectory.
-
-Sat Mar 5 18:37:50 1994 Jim Wilson (wilson@sphagnum.cygnus.com)
-
- * except.c (finish_handler_array): When computing address of
- the array ex_decl, don't call build_array_ref.
-
-Sat Mar 5 17:43:36 1994 Jim Wilson (wilson@sphagnum.cygnus.com)
-
- * loop.c (declare_temps): Force powerset temp to memory.
-
-Fri Mar 4 11:20:44 1994 Bill Cox (bill@rtl.cygnus.com)
-
- * typeck.c (layout_chill_range_type): Convert highval and
- lowval to a common type before range-checking them.
-
-Fri Mar 4 11:20:44 1994 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-tree.h: Add loop-related prototypes.
- * decl.c, grant.c: Fix -Wall violations.
- * parse.y: Fix format of %type directives.
-
-Fri Mar 4 10:04:18 1994 Wilfried Moser (fs_moser at rcsw1h)
-
- * Makefile.in: Update version number.
- * expr.c: Fix a comment.
- * inout.c (build_chill_writetext): Add handling of a REAL.
- * lex.l (INITIAL): Remove all code to discard 'header lines'.
- no longer needed.
- * parse.y (optheader): Remove - it's obsolete, as is the
- HEADEREL token definition.
-
-Fri Mar 4 09:41:18 1994 Bill Cox (bill@rtl.cygnus.com)
-
- * addtest: Fix suffix removal when suffix is .c186.
- * regression.sh: Allow for underscores on PR filenames.
- * typeck.c: Check in the rewrite mentioned earlier.
-
-Thu Mar 3 09:42:10 1994 Wilfried Moser (fs_moser at rcsw1h)
-
- * tasking.c (build_process_header): Build a debug structure
- for easier access to PROCESS parameters.
-
-Thu Mar 3 09:42:10 1994 Bill Cox (bill@rtl.cygnus.com)
-
- * typeck.c (*string_assignment_condition): Complete rewrite
- of a verbose first draft.
-
-Wed Mar 2 16:49:05 1994 Bill Cox (bill@rtl.cygnus.com)
-
- * actions.c (adjust_return_value): Simplify.
- Delete references to CH_RETURNS_LOC, extra parameters to
- push_extern_function and start_chill_functions.
- (convert_for_assignment): Check whether to generate runtime
- range-checking code. Handle reference_type in convert call.
- (chill_expand_assignment): Produce an INDIRECT_REF for a
- reference_type on the LHS. Delete conversions subsumed by
- convert_for_assignment.
- * ch-tree.h: Delete parameters from prototypes.
- * decl.c (print_lang_decl): Print out signal flag.
- (push_extern_function, start_chill_function): Delete
- extra parameters, references to CH_RETURNS_LOC.
- * grant.c (chill_finish_compile): Delete extra parameter.
- * parse.y: Delete references to CH_RETURNS_LOC, extra parameters to
- push_extern_function and start_chill_functions.
- * regression.sh (checkprms): Skip PRMS discrepancies if we
- can't access PRMS for some reason.
- * satisfy.c: Correct indentation.
- * tasking.c (build_process_header): Delete extra parameters
- passed to push_extern_function and start_chill_functions.
-
-Wed Mar 2 10:33:50 1994 Bill Cox (bill@rtl.cygnus.com)
-
- * addtest: Require a fill filename. Be more careful about
- adding the same test twice.
- * expr.c: Add FIXME to comment.
- * regression.sh: Add configure script call.
-
-Tue Mar 1 16:24:20 1994 Wilfried Moser (fs_moser at rcsw1h)
-
- * Makefile.in: Change version of chill to 1.1.2
- * inout.c: Add processing of SET and POWERSET types to WRITETEXT.
-
-Tue Mar 1 07:34:56 1994 Bill Cox (bill@rtl.cygnus.com)
-
- RETURN of LOC value is only half-baked. Stay tuned...
- * actions.c (adjust_parm_or_field): Add to comment.
- (adjust_return_value): New function for issuing errors about
- RETURN and RESULT expressions. Also converts them.
- (chill_expand_result, chill_expand_return): Call new
- adjust_return_value function.
- * ch-tree.h (CH_RETURNS_LOC): Add new flag for function types.
- New parameter for push_extern_function and start_chill_function.
- * decl.c (push_extern_function, start_chill_function): New parameter
- to say whether return value is a LOC.
- * expr.c (build_chill_indirect_ref): Further qualify the issuing
- of the error message.
- * grant.c (raw_decode_mode): Move test for instance mode under
- STRUCT handling.
- (start_chill_module_code, chill_finish_compile): Add new
- parameter to start_chill_function calls.
- * parse.y (get_type_of): Do lookup_name more often.
- (quasi_pdef, procedure, procmode, optresultspec): Set
- CH_RETURNS_LOC flag.
- (optresultattr): Code keywords as a bitmask.
- * tasking.c (build_process_header): Add new parameter to
- start_chill_function call.
-
-Sat Feb 26 12:49:05 1994 Bill Cox (bill@rtl.cygnus.com)
-
- * Makefile.in: Replace undefined $(RM) with rm -f.
- * configure: Make sure scripts are executable.
- * regression.sh: Make variables to invoke make
- and awk. Don't process a directory if it
- doesn't exist.
-
-Fri Feb 25 14:48:48 1994 Bill Cox (bill@rtl.cygnus.com)
-
- * Makefile.in (check): Force the building of ../gcov and
- ../xgcc before testing. Move the printf dependency here
- since we don't need it until we're testing.
- * addtest: Strip suffix from each input filename.
- * decl.c (do_decl): Correct error checking. Call
- string_assignment_condition for some of it.
- * tasking.c (build_gen_inst): Add ability to pass an integer
- for either the process ID or the copy number. If a number
- is passed, range-check it against the CHILL unsigned type
- limits.
- (build_buffer_descriptor): Add draft code to check the buffer
- name for correctness.
-
-Wed Feb 23 15:07:12 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- New cleaner solution to the following problem:
- Chill allows an action to be followed by an ON-handler.
- But we don't know if an action has a handler until we've parsed
- its end, yet we want to generate extra code to set up an
- exception handling contour only if needed. The old solution
- would generate code for the action into an rtl sequence, and then
- splice in the exception-setup code if we later found we needed it.
- This has a few problems (for example it confuses the management
- of stack temporaries), and is ugly. Now that the compiler is 2-pass
- we have a cleaner solution: In pass 1, we remember which actions
- were followed by ON-handlers. In pass 2, we use this information
- to generate appropriate code before an action.
- * except.c (push_handler, pop_handler): In pass 1, set up data
- structures (global_handler_list) to remember if an action has an
- ON-handler. In pass 2, digest this information, and setup
- handler if needed.
- * except.c, actions.h (pop_handler): Take an extra int arg.
- * except.c (emit_setup_handler): New function, with code (moved
- from chill_start_on) to emit code before an action that has a handler.
- * except.c (except_init_pass_2): New function.
- * parse.y (pass1_2): Call except_init_pass_2 before pass 2.
- * parse.y (POP_UNUSED_ON_CONTEXT): Don't call pop_sequence.
- * parse.y: Invoke POP_UNUSED_ON_CONTEXT and POP_USED_ON_CONTEXT
- in pass 1 as well as pass 2.
- * parse.y (BEGIN ... END): Re-arrange logic to avoid block_stack
- (local to ../stmt.c) getting out of sync.
- * actions.c (push_action): Don't need to emit a NOP,
- now that we're no longer moving sequences around.
- * actions.c (push_action): Call push_handler even in pass one.
-
-Wed Feb 23 11:06:14 1994 Bill Cox (bill@rtl.cygnus.com)
-
- * decl.c (do_decl): Check for possible overflow in initializing
- a declared variable.
- * expr.c (build-chill_indirect_ref): Add error message for
- a syntax error that C programmers converting to CHILL are
- quite likely to make.
- * satisfy.c (safe_satisfy_decl): Keep yesterday's change from
- seg-faulting.
-
-Tue Feb 22 17:54:43 1994 Bill Cox (bill@rtl.cygnus.com)
-
- * Makefile.in: Use $(CC) rather than FLAGS_TO_PASS, which isn't
- defined. Build chill script differently, and build an install script.
- Add an action to run the regression test.
- * actions.c (chill_expand_assignment): Change
- string_assignment_condition call.
- * ch-tree.h: Add prototype.
- * expr.c (build_chill_function_call): Change
- string_assignment_condition call.
- * satisfy.c (safe_satisfy_decl): Add check that string INIT value
- will fit in the declared mode.
- * typeck.c (string_assignment_condition): Add flag to disable
- runtime code generation. Add code to generate runtime test.
-
-Mon Feb 21 14:04:20 1994 Bill Cox (bill@rtl.cygnus.com)
-
- * Makefile.in (check): Add target to trigger a regression test.
-
-Mon Feb 21 13:54:20 1994 Bill Cox (bill@rtl.cygnus.com)
-
- * decl.c (do _based_decls): Add error check for
- decls BASED on a PROC or PROCESS name.
-
-Mon Feb 21 13:24:02 1994 Bill Cox (bill@rtl.cygnus.com)
-
- * grant.c (chill_finish_compile): Bypass handling
- module-level code if an earlier error has made
- is useless.
- * tasking.c (build_start_process): Generate error,
- return if process name unknown.
-
-Mon Feb 21 14:29:41 1994 Wilfried Moser (fs_moser at rcsw47)
-
- * expr.c (build_generalized_call): Use
- build_arrow_expr semantics for ADDR () builtin.
-
-Mon Feb 21 12:49:14 1994 Bill Cox (bill@rtl.cygnus.com)
-
- * tasking.c (build_gen_inst): Output correct
- constructor for GEN_INST.
-
-Mon Feb 21 08:14:59 1994 Wilfried Moser (fs_moser at rcsw47)
-
- * lex.l (yywrap): Fix punctuation error.
-
-Sun Feb 20 19:58:14 1994 Bill Cox (bill@rtl.cygnus.com)
-
- * regression.sh: Fix cvs update-related commands.
- Have cron job always perform the update, so it's
- always reporting on the current state of the
- sources.
- * typeck.c (string_assignment_condition): Allow a
- mis-match if the LHS is varying.
-
-Fri Feb 18 18:10:04 1994 Bill Cox (bill@rtl.cygnus.com)
-
- * actions.c (expand_chill_assignment): Add call to test the
- string assignment condition.
- * expr.c (build_chill_function_call): Add call to test the
- string assignment condition.
- * regression.awk2: Report WITHDRAWN PRs as well.
- * regression.sh: Delete extra commentary about FEEDBACK PRs.
- * typeck.c (string_assignment_condition): Add function to
- perform the check.
-
-Fri Feb 18 16:30:40 1994 Bill Cox (bill@rtl.cygnus.com)
-
- * regression.awk1, regression.awk3: Recognize 'withdrawn' PRs
- and exclude them from the regression test report. Mark them
- in the list of PRs as 'W' status.
-
-Thu Feb 17 09:13:42 1994 Wilfried Moser (fs_moser at rcsw47)
-
- * Makefile.in: Define a version number. Build chill script
- differently. Makefile depends upon ../configure, not configure.
- * chill.in: Define some new flags.
-
-Wed Feb 16 19:44:33 1994 Bill Cox (bill@rtl.cygnus.com)
-
- * grant.c (decode_constant): Restore a 'return result' statement
- that seems to have gotten lost.
-
-Wed Feb 16 12:37:44 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * ch-tree.h (various STRING-type macros): Use new TYPE_STRING_FLAG.
-
- * typeck.c (make_chill_array_type): Remove unused args.
- Simplify to build only one-dimensionsal arrays, so change
- index list to single index. Call layout_chill_array_type
- if pass!=1. And rename to: build_simple_array_type.
- * typeck.c (layout_chill_array_type): Only recurse
- if TREE_TYPE has not been laid out.
- * typeck.c (build_chill_array_type): Update accordingly.
- * typeck.c (build_chill_slice): Replace calls to build_array_type
- (which does hash-canonicalization, which breaks if we later set
- the TYPE_STRING_FLAG) by calls to build_simple_array_type.
- * convert.c (convert): The same.
-
- * grant.c (decode_constant): Clean up. Remove remnants of switch
- on TREE_TYPE of the value, and fold those cases into first switch.
-
-Wed Feb 16 09:12:21 1994 Bill Cox (bill@rtl.cygnus.com)
-
- * Makefile.in: Add printf as a dependency of ../cc1chill.
- * regression.sh: Make srcdir and objdir really work.
-
-Wed Feb 16 09:12:21 1994 Bill Cox (bill@rtl.cygnus.com)
-
- * expr.c (build_char_array_expr): Fix spelling
- error in error msg.
- * tree.c (build_string_type): Make check for overlarge
- string more robust.
-
-Wed Feb 16 02:37:43 1994 Mike Stump (mrs@cygnus.com)
-
- * grant.c (decode_constant): Remove useless tests
- for STRING_TYPE (which isn't used by anyone, including CHILL).
-
-Tue Feb 15 15:35:07 1994 Bill Cox (bill@cygnus.com)
-
- * build-release: Add refinements to checkout commands.
- * decl.c (init_decl_processing): Move initialization of
- chill_unsigned_type_node before 1st call to build_string_type.
- * tree.c (build_string_type): Add compile-time test of string
- allocated length.
- * typeck.c (layout_chill_range_type): Add compile-time range limit
- checking.
-
-Tue Feb 15 08:55:37 1994 Bill Cox (bill@cygnus.com)
-
- * Makefile.in: Add stamp-chill-objs as a dependency of ../cc1chill.
- * regression.sh: Rename test directory names.
-
-Mon Feb 14 09:24:16 1994 Bill Cox (bill@rtl.cygnus.com)
-
- * Makefile.in: Change interface with parent directory's
- Makefile, decoupling the lists of each others' files.
-
-Mon Feb 14 09:24:16 1994 Bill Cox (bill@rtl.cygnus.com)
-
- * lex.l: Delete obsolete comment.
- * tasking.c (expand_send_signal): Add a type to the OPTSENDTO
- instance constructor.
-
-Mon Feb 14 04:04:16 1994 Bill Cox (bill@rtl.cygnus.com)
-
- * lex.l (maybe_number): Add octal to numbers
- handled by Feb 1 change.
-
-Sat Feb 12 16:24:22 1994 Bill Cox (bill@rtl.cygnus.com)
-
- * actions.c, convert.c, decl.c, expr.c, lex.l,
- tasking.c, typeck.c: gcc -Wall cleanups.
- * ch-tree.h: Change loop-related prototypes.
- * loop.c, parse.y: Rewrite to set up correct loop scope.
- Fix error path where loop variable not declared.
-
-Fri Feb 11 11:12:29 1994 Bill Cox (bill@rtl.cygnus.com)
-
- * Makefile.in: Add rule to build printf. Make it a dependency
- of ../cc1chill.
- * printf.c: New tool for regression testing script.
- * regression.sh: Look for print in ${objdir}.
-
-Thu Feb 24 17:31:12 1994 Wilfried Moser (fs_moser at rcsw1j)
-
- * tasking.c (build_gen_inst): Allow integer expression as argument
- 1 to this function. This was a change request to get rid of
- unsupported value conversion from INSTANCE to ARRAY (0:1) UINT
- or STRUCT (t UINT, c UINT).
-
-Thu Feb 10 09:49:31 1994 Bill Cox (bill@rtl.cygnus.com)
-
- * regression.awk3: Recognize upper-case PRMS state names.
-
-Wed Feb 9 15:26:19 1994 Bill Cox (bill@cygnus.com)
-
- * parse.y (dowithaction): Allow EXIT from DO WITH.
-
-Tue Feb 8 13:13:54 1994 Bill Cox (bill@rtl.cygnus.com)
-
- * configure: Change to require grant.c for evidence that we've
- found the source directory.
- * decl.c (init_decl_processing): delete unused builtin_slice
- function declaration.
- * expr.c (chill_expand_expr): Calculate powerset's length
- correctly, calling powersetlen to do it.
- * regression.sh: Replace BASE references with objdir references.
- * typeck.c (build_chill_slice): Build the compound expression
- in the right order.
-
-Mon Feb 7 15:56:07 1994 Bill Cox (bill@rtl.cygnus.com)
-
- * expr.c (build_chill_lower, build_chill_upper): Handle
- LOC parameter types.
- * regression.sh: Correct path to executable sub-shell-scripts.
-
-Mon Feb 7 11:33:47 1994 Bill Cox (bill@rtl.cygnus.com)
-
- * regression.sh: Pervasive changes to allow for separate
- source and object directories.
-
-Wed Feb 2 17:5620 1994 Bill Cox (bill@rtl.cygnus.com)
-
- * decl.c (find_implied_typed): Delete obsolete reference to
- PROCESS_TYPE.
- * ch-tree.def (PROCESS_DECL, PROCESS_TYPE): Delete - they're
- obsolete.
-
-Wed Feb 2 13:37:56 1994 Bill Cox (bill@rtl.cygnus.com)
-
- * Makefile.in: Delete bogus runtime/Makefile lines.
- * configure: Build testsuite directory.
-
-Wed Feb 2 13:37:56 1994 Bill Cox (bill@rtl.cygnus.com)
-
- * configure: Correct srcdir for chill.examples directory.
-
-Wed Feb 2 11:24:57 1994 Wilfried Moser (fs_moser at rcsw47)
-
- * ch-parse.y (rule call): Add
- BUFFERNAME LPRN untyped_expr RPRN
- to enable generating a descriptor same as for SIGNALS.
- * ch-tasking.c (generate_tasking_code variable,
- decl_tasking_code_variable): Implement overflow check of
- taskingcode in case a tasking code is specified with the
- compiler directives SIGNAL_CODE, BUFFER_CODE, EVENT_CODE or
- PROCESS_TYPE.
-
-Wed Feb 2 09:31:37 1994 Bill Cox (bill@rtl.cygnus.com)
-
- * configure: Add ${srcdir} to Makefile.in's path.
- * loop.c: Delete unused whitespace.
-
-Tue Feb 1 17:09:41 1994 Bill Cox (bill@rtl.cygnus.com)
-
- * expr.c (string_char_rep): Process STRING_CST correctly.
-
-Tue Feb 1 15:29:28 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * expr.c (build_boring_bitstring): New function.
- * expr.c (build_chill_repetition_op): Fix a number of bugs in
- implementation of bitstring repetition.
- Also, implement repetition of Booleans.
-
-Tue Feb 1 15:28:21 1994 Bill Cox (bill@rtl.cygnus.com)
-
- * configure: Delete code to check for gas or ld. Add code to
- store a config.status file in each configured subdirectory.
- * expr.c (): Spell concatbitstring as concatps, which is the
- runtime routine name.
- * regression.sh: Force use of GNU make.
-
-Tue Feb 1 15:22:12 1994 Bill Cox (bill@rtl.cygnus.com)
-
- * tasking.c: Mark compiler-generated temps to prevent
- GRANTing them.
-
-Tue Feb 1 17:38:51 1994 Wilfried Moser (fs_moser at rcsw1j)
-
- * lex.l (equal_number): Improve check for number after = in a
- compiler directive.
- * tasking.c (build_tasking_struct): Make field TaskValue
- pointer to chill_unsigned_type_node.
- * tasking.c (generate_tasking_code_variable): Declare tasking
- code variable as chill_unsigned_type_node.
- * tasking.c (decl_tasking_code_variable): Declare tasking
- code variable as chill_unsigned_type_node.
-
-Mon Jan 31 14:01:58 1994 Bill Cox (bill@rtl.cygnus.com)
-
- * addtest (update_Makefile): No longer build actions - they're
- now in pattern rules.
- * ch_makedepend: Do the grep first, to avoid processing non
- USE_SEIZE_FILE lines.
- * configure: Pervasive rewrite to support configuring regression
- test directories.
-
-Mon Jan 31 04:35:53 1994 Michael Tiemann (tiemann@blues.cygnus.com)
-
- * typeck.c (build_chill_slice): Compute EXTENT correctly.
-
-Sun Jan 30 14:33:12 1994 Bill Cox (bill@rtl.cygnus.com)
-
- * tasking.c (build_gen_inst): Return a typed tuple with
- INSTANCE type.
-
-Sun Jan 30 12:01:07 1994 Bill Cox (bill@rtl.cygnus.com)
-
- * actions.c (chill_expand_assignment): Recognize LENGTH builtin
- in the left hand side, pass it to
- expand_varying_length_assignment.
- (expand_varying_length_assignment): Clean up bitrot.
- * convert.c (convert): Revert most recent change.
- * loop.c (maybe_skip_loop): New function, split out of
- begin_chill_loop. Add conditional to skip processing an empty
- VARYING array.
- * parse.y (assignaction): Delete code to recognize LENGTH
- on left-hand-side.
- * typeck.c (validate_varying_array_ref): Correct misleading comment.
-
-Sat Jan 29 10:54:06 1994 Michael Tiemann (tiemann@blues.cygnus.com)
-
- * typeck.c (build_chill_slice): Pass a valid identifier to
- `get_unique_identifier'.
-
- * convert.c (convert): Rename LENGTH variable to MAXIDX, and
- use correct value for VAR_LENGTH when initializing a varying array.
-
- * decl.c (do_decl): Set DECL_COMMON.
-
- * actions.c (check_range): Temporarily inhibit warnings so the
- compiler doesn't warn the user about useless range checks that it
- might create. It's far easier for the compiler to figure out that
- a range check need not be done than it is for us to try to figure
- it out for ourselves.
-
- * expr.c (build_concat_expr): Generalize to handle bitstrings.
- (scalar_to_string): New function.
- (chill_expand_expr): Handle SET_TYPEs in CONCAT_EXPR by using new
- library call (__concatbitstring).
-
-Sat Jan 29 08:43:54 1994 Bill Cox (bill@rtl.cygnus.com)
-
- * ch_makedepend: Fix the 'sed' command so that seize file
- name can be delimited by double quotes as well as apostrophes.
-
-Thu Jan 27 17:26:19 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * typeck.c (my_build_array_ref): Do constant folding.
-
-Thu Jan 27 16:24:24 1994 Bill Cox (bill@rtl.cygnus.com)
-
- * actions.c, actions.h, ch-tree.h, chill.texi, convert.c,
- decl.c, except.c, expr.c, grant.c, inout.c, lang.c,
- lex.h, lex.l, loop.c, parse.y, tasking.c, tasking.h,
- tree.c, typeck.c: New 'Copyright' line for 1994.
-
-Thu Jan 27 14:12:07 1994 Mike Stump (mrs@cygnus.com)
-
- * configure: Don't configure this directory with this configure,
- just subdirectories and cleanup.
- * Makefile.in (Makefile): Run config.status in parent directory,
- if we need rebuilding.
-
-Thu Jan 27 10:37:33 1994 Bill Cox (bill@rtl.cygnus.com)
-
- * decl.c (bind_sub_modules): Need a parameter on the recursive call.
- Thanks, Zoo!
-
-Thu Jan 27 10:37:33 1994 Bill Cox (bill@rtl.cygnus.com)
-
- * expr.c (build_concat_expr): Fix SunOS portability problem.
-
-Wed Jan 26 14:57:39 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * convert.c (digest_powerset_tuple): New function, used to set
- TREE_CONSTANT and TREE_STATIC properly.
- (digest_structure_tuple, convert (NULL to instance, non-varying
- to varying)): Set TREE_CONSTANT and TREE_STATIC when appropriate.
- * expr.c (varying_to_slice): Preserve novelty of slice type.
- * expr.c (build_concat_expr): Make sure class of result is
- correct (including correct novelty).
- * satisfy.c (safe_satisfy_decl): If value of CONST_DECL is
- not TREE_CONSTANT, emit an error.
- * typeck.c (build_chill_slice): Preserve novelty of result.
- * typeck.c (build_chill_slice): Simplify for varying argument
- (by using varying_to_slice).
- * typeck.c (expand_constant_to_buffer, extract_constant_from_buffer):
- New functions.
- * typeck.c (build_chill_cast): Use above new functions to convert
- constant expressions.
- * typeck.c (copy_novelty), ch-tree.h: New function.
- * chill.texi: Update for new constant conversion semantics.
-
-Tue Jan 25 14:00:02 1994 Wilfried Moser (fs_moser at rcsw1j)
-
- * ch-decl.c (init_decl_processing): Add new builtin function
- DESCR. Add call to build_chill_descr_type.
- * ch-expr.c: Add function build_chill_descr_type, which actually
- build the type the DESCR builtin returns.
- Add function build_chill_descr, which process the DESCR builtin.
- * ch-expr.c (build_chill_length): Add code to enable
- LENGTH (bitstring).
- * ch-expr.ch (build_generalized_call): Add processing of DESCR
- builtin.
- * ch-grant.c: Add code to avoid producing of unnecessary grant
- files.
- * ch-tree.h: Add enum for builtin function DESCR. Add prototype
- for build_chill_descr.
- * ch-inout.c (build_chill_io_list_type): Change generation of the
- type passed to runtime library according to the new definition.
- * ch-inout.c (build_chill_writetext): Change processing of format
- string that a character constant is allowed as format string if
- compiler gets called with -fold-strings option.
- * ch-inout.c (build_chill_writetext): Change processing of
- integers in case NEWMODE x = INT.
- * ch-inout.c (build_chill_writetext): Remove processing of ranges.
- * ch-inout.c (build_chill_writetext): Add processing of
- bitstrings.
-
-Tue Jan 25 09:07:10 1994 Mike Stump (mrs@cygnus.com)
-
- * Makefile.in (all, OBSTACK): Build interesting things be default,
- and make sure we include OBSTACK.
-
-Sun Jan 23 12:35:38 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * grant.c (decode_constant): Handle RANGE_EXPR.
- Simplify handling of CONSTRUCTOR.
-
- * typeck.c (build_chill_slice): Use build_chill_array_ref_1,
- not build_chill_array_ref.
-
-Sat Jan 22 16:23:30 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * parse.y: Generate a RANGE_EXPR (instead of a confusing
- TREE_LIST) to indicate a range in case and tuple lables.
- * actions.c (chill_handle_case_label), convert.c (digest_constructor):
- Update accordingly to handle these RANGE_EXPRs.
- * satisfy.c (satisfy): Don't call finish_chill_binary_op
- for a RANGE_EXPR.
-
-Fri Jan 21 15:39:36 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * expr.c (force_addr_of): New function, to encapsulate passing
- by reference a powerset or string to a library function.
- * expr.c (build_min_max, build_set_expr): Use force_addr_of.
- * expr.c (chill_expand_expr case CONCAT_EXPR): Fix passing of
- rtl modes. (Old code fails on 64-bit Alpha.)
- * expr.c (build_chill_function_call): Remove bogues check for
- READonly variable passed as parameter.
- * expr.c (build_set_expr): Merge common code.
- * parse.y (string repetition): Fix logic for 2-pass scheme.
- * expr.c (finish_chill_binary_op), grant.c (decode_constant),
- satisfy.c (satisfy): Handle REPLICATE_EXPR.
- * chill.texi: Fix typo.
-
-Mon Jan 17 13:55:48 1994 Jim Wilson (wilson@sphagnum.cygnus.com)
-
- * Makefile.in (INCLUDE): Add -I$(srcdir)/ch so that toplevel
- tree.c can find ch-tree.h.
-
-Sat Jan 15 15:34:11 1994 Mike Stump (mrs@rtl.cygnus.com)
-
- * configure: Fix problem so that building in a separate directory
- works.
-
-Sat Jan 15 09:51:02 1994 Bill Cox (bill@rtl.cygnus.com)
-
- * Makefile.in: Recurse down into runtime to
- create its Makefile, and to clean up.
- * configure: Recurse into runtime to make its Makefile.
-
-Sat Jan 15 09:15:22 1994 Bill Cox (bill@rtl.cygnus.com)
-
- << This set of CHILL frontend sources is now the
- maintainable and master set. Accept no substitutes! >>
- * Makefile.in, configure: Completely rewritten
- to be invoked by gcc/Makefile.in and
- gcc/configure.
- * addtest (update_ChangeLog): Fix insertion
- of the '*'.
- * regression.sh: Add global option to suppress results of
- proprietary tests.
- * cpy.sh: Add necessary edits to files as they
- are copied down.
- * actions.c, ch-tree.def, ch-tree.h, convert.c,
- decl.c, except.c, expr.c, grant.c, inout.c,
- lang.c, lex.h, lex.l, loop.c, parse.y,
- satisfy.c, tasking.c, typeck.c: Latest
- versions from the repository.
-
-Fri Jan 14 12:28:39 1994 Bill Cox (bill@rtl.cygnus.com)
-
- * addtest: Fix insertion of line into ChangeLog.
- * configure: Add a script.
- * Makefile.in: Hack from ../Makefile.in
- * actions.c, convert.c, decl.c, expr.c, grant.c, inout.c,
- * lex.l, loop.c, parse.y, satisfy.c, typeck.c: Latest sources.
-
-Mon Jan 10 11:38:07 1994 Bill Cox (bill@rtl.cygnus.com)
-
- * build-release: Rewrite for easier tailoring.
-
-Wed Jan 5 08:38:21 1994 Bill Cox (bill@cygnus.com)
-
- * actions.c, convert.c, decl.c, except.c, expr.c,
- inout.c, loop.c, parse.y, satisfy.c, typeck.c:
- Current versions from devo/gcc.
-
-Wed Dec 29 14:07:10 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * addtest: Don't add comment headers to source or .dat files
- if they're already present.
-
-Wed Dec 29 13:15:11 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * mktg_leads: New file.
- * regression.sh, regression.awk2: Updated status report scripts.
- * addtest: New script to add a test to a directory.
- * ch_makedepend: Add full path to ch_decomment.
- * actions.c, convert.c, decl.c, expr.c, grant.c, inout.c,
- lex.l, loop.c, parse.y, satisfy.c, tasking.c, typeck.c:
- Updated copies of actual sources.
- * chill.brochure, chill.texi: Update with current status.
- * cpy.sh: Script for updating copies of sources.
- * chill.patches: New script for creating a patch release.
- Pretty rough.
-
-Wed Dec 8 09:35:54 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * build-release: Delete lots of unused regression-testing cruft.
- * chill.brochure: Initial draft of marketing brochure.
- * chill.patches: Preliminary script for building patch sets
- for CHILL.
- * tcov.awk, tcov.el, tcov.sh: New files. Script, tools for
- building a tcov report on the CHILL compiler.
-
-Sun Nov 21 08:34:33 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * Makefile.in: Adjust gperf rule for names in this directory.
- * ch_decomment.l: New file. Ignores CHILL comments.
- Executable is used bu ch_makedepend.
- * ch_makedepend: New script. Makes CHILL dependencies for
- Makefiles.
- * gperf, hash.h: New files about lexer tokens.
- * regression.sh: Delete notes justifying non-summing
- report rows.
- * regression.awk2: Report PRMS status when there are
- missing test results.
- * regression.awk3: Add #! line, so this can be used separately.
- * Other files: latest versions copied from devo/gcc.
-
-Sat Oct 30 15:02:24 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * chill.texi: Add new node about conversions.
-
-Fri Oct 29 14:17:31 1993 Bill Cox (bill@cygnus.com)
-
- * chill.regress.cron: Change path to executable, enable PR report.
- * regression.awk2: Add terminating periods to messages.
- * regression.sh: Change path to testsuites. Add disclaimer at end
- of report. Print explicit lists of resolved/unresolved PRs.
-
-Thu Oct 28 09:22:20 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * regression.sh: More PR-related status is printed.
-
-Thu Oct 21 19:24:02 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * regression.sh: Simplify the paths, make the source
- and test files accessed separately from the executables.
-
-Wed Oct 20 16:35:30 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * regression.sh: Finally fix the file-delete problem.
- Thanks, Jeffrey!
- * build-release: Make more verbose, fix comment.
-
-Mon Oct 18 00:21:24 1993 Bill Cox (bill@cygnus.com)
-
- * regression.sh: Build linker if -U option. Put stderr
- into make.log files, too. Also report on Z.200 examples.
- * regression.awk3: New script to help build release note.
-
-Fri Oct 15 16:33:54 1993 Bill Cox (bill@cygnus.com)
-
- * regression.sh, regression.prpt: Output PR status only
- conditionally. Add command-line flag for CVS updates.
-
-Thu Oct 14 07:53:59 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * regression.sh: Count PRs accurately.
- * Makefile.in: New file.
-
-Sat Oct 9 19:46:58 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * regression.awk?: Add program fragments for
- report of PRMS/test exceptions.
- * regression.sh: Add options and PRMS reports.
-
-Fri Oct 8 06:44:41 1993 Bill Cox (bill@rtl.cygnus.com)
-
- Create chill frontend directory, populate it.
- Later, the chill-specific frontend files will be moved here.
-
- * chill: Moved here from gcc directory.
- * chill.regress.cron: Add crontab file for regression tests.
- * regression.sh: Add regression test control script.
-
-#
-# What follows is a copy of the former devo/gcc/ChangeLog.Chill file,
-#
-Sat Jan 15 14:54:07 1994 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-*.*: All of these files are now moved to the ch subdirectory.
- Further update changes should be recorded in the ch/ChangeLog file.
-
-Fri Jan 14 21:09:44 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * c-typeck.c, ch-actions.c, ch-convert.c, ch-decl.c, ch-except.c,
- ch-satisfy.c, ch-typeck.c: Undo all of initializer-related changes
- that Tiemann did earlier this month.
- * c-typeck.c (really_start_incremental_init): Save
- constructor_elements and (old value of) constructor_stack
- on constructor_stack, to allow for nested initializers.
- * ch-convert.c (digest_constructor): If we need a varying
- array, and have a constructor (for the array elements),
- make sure to use convert so that the constructor gets
- wrapped in an implicit record constructor.
- * ch-decl.c (do_decl): If there is no initializer for a
- varying array (or bitstring), create default constructor.
-
- * ch-expr.c (build_chill_lower): Fix thinko for ARRAY_TYPE.
- * ch-satisfy.c (safe_satisfy_decl): Make sure that we make
- original decl to check if we need to make an rtl.
-
- * ch-typeck.c (build_chill_array_ref_1), ch-tree.h: New function
- which does the actual work for build_chill_array_ref (which
- now just loops over an argument list).
- * ch-actions.c, ch-expr.c, ch-inout.c: Use build_chill_array_ref_1
- instead of build_chill_array_ref where appropriate.
- * ch-actions.c, ch-expr.c, ch-typeck.c: Make operand 1 of a
- VARY_ARRAY_REF is a single index, not an index list.
-
- * ch-grant.c (__init_list): Renamed to _ch_init_list, to
- avoid a conflict on the Alpha.
-
-Wed Jan 12 10:19:35 1994 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-lex.l (WS): Add BS, VT and CR to definition of
- whitespace.
- (convert_number): Allow for uppercase hex digits.
-
-Tue Jan 11 19:43:55 1994 Bill Cox (bill@cygnus.com)
-
- * ch-actions.c (lookup_and_handle_exit): Correct
- conditional so error messages are output.
- * ch-expr.c (build_chill_addr_expr): Add error message.
- * ch-grant.c (chill_finish_module_code): Avoid abort by
- giving the init_list constructor a type.
- (chill_finish_compile): Delete unused code.
- * ch-lex.l: Make most build_init_2 calls from the
- permanent obstack, so that enumeration values endure.
- * ch-loop.c (build_chill_iterator): Add several error
- messages.
-
-Tue Jan 11 12:31:55 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * ch-expr.c, ch-typeck.c: Rewrite some instances of
- 'struct ch_class class = chill_expr_class (expr);' to
- 'struct ch_class class; class = chill_expr_class (expr);'
- to work around a bug in /usr/ucb/cc on SunOS4.
-
-Mon Jan 10 18:29:36 1994 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-actions.c (chill_convert_for_assignment): Avoid seg fault.
- * ch-expr.c (expand_packed_set): Add new parameter to pass
- set's minimum ordinal value. Fix loop invariant problem.
- (fold_set_expr): Change to add new parameter to
- expand_packed_set call.
- * ch-grant.c: Move extern declaration to ch-tree.h.
- * ch-lex.l (convert_bitstring): Also output the bitstring
- if yydebug is set.
- * ch-tree.h: Add prototype.
-
-Mon Jan 10 11:29:41 1994 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-inout.c: Fix comment.
- * ch-tree.h: Add prototype.
-
-Sun Jan 9 18:22:22 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * ch-tree.h (chill_expr_class): New prototype.
- * ch-expr.c (build_chill_pred_or_succ, build_chill_unary_op):
- Convert result to correct class.
- * ch-expr.c (build_chill_repetition_op): Preserve CH_DERIVED_FLAG.
- Also, fix some bugs for bitstrings (with ranges).
-
- (Patches from Tiemann.)
- * ch-convert.c (convert1): New function to force TREE_TYPE.
- (convert): Use convert1 where appropriate.
- * ch-typeck.c: Formatting change.
- * ch-parse.y (build_chill_constructor): Fix thinko.
-
- * ch-expr.c (varying_to_slice): If array is not referable,
- call save_expr on it, rather than stabilize_reference.
- * ch-satisfy.c (safe_satify_decl, for CONST_DECL):
- Don't force value to value class if mode is not explicitly
- specified. Also, make sure convert etc is only done once.
-
-Sat Jan 8 16:37:10 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * ch-decl.c (build_chill_function_type): Don't call
- build_function_type, because it does hash canonicalization,
- which once in a while looses badly.
- * tree.c (build_function_type): Remove no-longer-needed test
- for doing_chill_thang.
-
- * ch-tree.h (CH_DERIVED_FLAG): New flag.
- * ch-tree.h (enum ch_expr_class): Renamed to ch_class_kind.
- (struct ch_class): New type, used to represent a Chill
- 'class' as a first-class value.
- (CH_ROOT_RESULTING_MODE): Replaced by CH_ROOT_RESULTING_CLASS.
- * ch-typeck.c (chill_expr_class): Change interface to return
- a struct ch_class.
- (chill_compatible, chill_compatible_classes): Update accordingly.
- (chill_root_resulting_mode): Replace by ....
- (chill_root_resulting_class): ... new function.
- * ch-convert.c (convert_to_class): New function.
- * ch-decl.c (layout_enum): Mark enum values with CH_DERIVED_FLAG.
- * ch-lex.l (string_or_int): Rename to string_or_char.
- * ch-lex.l (build_chill_string, string_or_char, convert_bitstring,
- convert_float, convert_number): Set CH_DERIVED_FLAG for literals.
- * ch-expr.c (finish_chill_binary_op): Use convert_to_class.
- * ch-satisfy.c (safe_satisfy_decl): For CONST_DECL, make sure
- DECL_INITIAL gets set to result of convert.
- Also, clear CH_DERIVED_FLAG for SYN value.
- * expr.c (store_constructor): If a [power]set is exactly one
- word long, use single-word move.
-
-Sat Jan 8 08:38:29 1994 Michael Tiemann (tiemann@blues.cygnus.com)
-
- * c-typeck.c (chill_initializer_constant_valid_p): Fix typo.
-
-Wed Jan 5 05:18:46 1994 Michael Tiemann (tiemann@blues.cygnus.com)
-
- * ch-typeck.c (build_chill_slice_with_length): Test that ARRAY is of
- ARRAY_TYPE before assuming so. Also, subtract 1 from LENGTH in
- computation of SLICE_END.
-
- * ch-typeck.c (chill_location): Treat CONSTRUCTORs like STRING_CSTs.
-
- * ch-expr.c (build_chill_indirect_ref): Handle MODE == NULL_TREE.
-
- * ch-expr.c (fold_set_expr): Handle OP1 == NULL_TREE (which happens
- for unary set operations).
-
- * ch-expr.c (build_chill_array_expr): Take new argument FORCE. All
- callers changed. All callers changed.
-
- * ch-convert.c (digest_structure_tuple): Handle SELECTED_VARIANT
- being NULL_TREE until we've started walking the list of values via
- the loop over VARIANTs.
-
- * ch-parse.y (build_chill_constructor): If we see an IDENTIFIER_NODE,
- treat it as an enum value (and hence constant). Also, only set
- TREE_STATIC if the constructor is indeed constant.
- * c-typeck.c (chill_initializer_constant_valid_p): If we see a
- VAR_DECL, test the TREE_CONSTANT field of the DECL_INITIAL, don't
- recurse on the DECL_INITIAL.
-
-Wed Jan 5 01:24:50 1994 Bill Cox (bill@cygnus.com)
-
- * Makefile.in: Add CHILL to LANGUAGES variable.
- * ch-actions.c (check_range): Call build_binary_op instead of
- fold, build to get the common types chosen.
- (cond_range_exception, cond_overflow_exception,
- cond_type_range_exception): Delete, obsolete.
- (chill_convert_for_assignment): Enable this, get particular
- about when to generate rangecheck code.
- * ch-expr.c (build_chill_function_call): Sketch in where to
- perform chill_convert_for_assignment on actual parameters.
- (build_chill_addr_expr): Correct compiler warning.
- * ch-loop.c (build_chill_iterator): Add runtime check for
- negative loop step expression.
- * ch-tree.h: Add prototype.
- * ch-typeck.c (chill_max_vary_array_ref): Correct misunderstanding.
- A varying array's length field counts the NUMBER of active array
- array entries, not the byte-length of them.
-
-Tue Jan 4 17:57:39 1994 Michael Tiemann (tiemann@blues.cygnus.com)
-
- * ch-decl.c (do_decl): Call `suspend_momenary' if the
- converted constructor must live on the permanent_obstack.
- * ch-convert.c (convert): When building a new SET_TYPE
- constructor, re-set the TREE_CONSTANT and TREE_STATIC bits.
- * c-typeck.c (chill_initializer_constant_valid_p): Handle VAR_DECLs.
-
- * ch-typeck.c (chill_location): CONSTRUCTORS that are static
- are locations.
- * ch-satisfy.c (safe_satisfy_decl): Convert DECL_INITIAL of CONST_DECL
- on permanent_obstack if necessary.
-
- * ch-convert.c (digest_structure_tuple): When building a new SET_TYPE
- constructor, re-set the TREE_CONSTANT and TREE_STATIC bits.
-
- * ch-decl.c (do_decl): Fix handling of REFERENCE_TYPEs which
- the patch below helped to mess up.
-
- * ch-expr.c (build_chill_arrow_expr): Call `mark_addressable'.
- (build_chill_addr_expr): Take new argument ERRORMSG.
- All callers changed. Also, call `build_chill_addr_expr' where
- we used to call `build1 (ADDR_EXPR, ptr_type_node, ...)' since
- that now calls `mark_addressable' automagically.
-
- * ch-decl.c (do_decl): Keep OPT_INIT in DECL_INITIAL if possible.
- This is needed because variables may appear in initialization
- statements, and their DECL_INITIALs are their values at
- initialization time.
- * ch-convert.c (digest_structure_tuple,digest_constructor): Changed
- to handle VAR_DECLs as initializers.
-
- * ch-convert.c (digest_structure_tuple): Copy elements of INITS so
- they aren't destroyed for later use.
-
-Tue Jan 4 15:25:30 1994 Bill Cox (bill@cygnus.com)
-
- * ch-expr.c (chill_expand_expr): Correct check-range lo_limit
- parameter for varying_array_ref calculations.
- (build_chill_indirect_ref): Prevent seg fault due to syntax error.
- * ch-typeck.c (build_chill_slice_with_range): Correct issuance
- of bogus error in votrics.
- (build_chill_slice_with_length): Change for debug tracability.
-
-Tue Jan 4 02:43:37 1994 Michael Tiemann (tiemann@blues.cygnus.com)
-
- * ch-convert.c (digest_structure_tuple): Fix phasing problem in
- handling variant record initializers.
- (various places): Change `pop_init_level' calls to match
- `push_init_level' wrt implicit variable.
-
- * ch-typeck.c (build_chill_slice): Convert the dynamic max index to
- `integer_type_node' before using it in comparisons. FIXME: should
- this be done in `chill_max_vary_array_index' by default?
-
-Tue Jan 4 00:24:14 1994 Bill Cox (bill@cygnus.com)
-
- * ch-actions.c: Fix comments.
- * ch-parse.y: Define caseaction_flag.
- (caseaction): Create new caseaction_flag node at the start,
- then free it at the end. Check it before the ELSE code.
- (expanded_case_label): Check the flag here. If set in either
- place, generate a jump to the end of the case.
- * ch-typeck.c (build_chill_slice_with_length,
- build_chill_slice_with_range): Add lots of compile-time
- parameter range checking.
-
-Mon Jan 3 21:49:04 1994 Michael Tiemann (tiemann@blues.cygnus.com)
-
- * ch-convert.c (digest_structure_tuple): Call `push_init_level' with
- implicit==0 everywhere, not 1.
- (digest_constructor): Ditto.
-
- * ch-actions.c (check_range): Permit limits to be NULL_TREE.
- Also, hack out some dead code.
- * ch-typeck.c (build_chill_slice): Check varying and non-varying
- slice constructs for range failures.
- (build_chill_slice_with_range): Reindented, but not changed.
-
- * ch-typeck.c (chill_max_vary_array_index): New function.
- * ch-expr.c (chill_expand_expr): Call it.
-
- * ch-decl.c (var_data_id, var_length_id): New variables.
- (init_decl_processing): Initialize them. All calls to
- get_identifier (VAR_LENGTH or VAR_DATA) are now replaced
- by references to these variables. This simplifies the code
- w/o obscuring anything.
-
-Mon Jan 3 21:24:44 1994 Bill Cox (bill@cygnus.com)
-
- * c-typeck.c: Fix comment.
- * ch-actions.c (chill_expand_assignment): Error assigning to
- READONLY location. (PR_3903) Pass filename, linenumber
- to setbitpowerset runtime routine.
- * ch-decl.c (init_decl_processing): Add filename, linenumber
- parameters to setbitpowerset prototype.
- * ch-expr.c (build_chill_function_call): Error when passing a
- READonly location as a LOC or INOUT parameter.
- * ch-parse.y (mode): Correct code marking type as readonly.
-
-Mon Jan 3 19:03:55 1994 Michael Tiemann (tiemann@blues.cygnus.com)
-
- * ch-actions.c (chill_expand_assignment): Disable code that defeats
- building varying array references.
- * ch-expr.c (chill_expand_expr): Add rangecheck code to
- VARY_ARRAY_REF case.
- * ch-typeck.c (build_chill_array_ref): Don't call an `expand_'
- function (in this case, `validate_varying_array_ref') when we're
- doing a `build_' operation.
-
- * ch-typeck.c (validate_varying_array_ref): Simplify interface
- since INDEX parameter can never meaningfully be an INDEXLIST.
- * ch-actions.c (expand_varying_length_assignment): Caller changed.
-
-Mon Jan 3 07:29:45 1994 Michael Tiemann (tiemann@blues.cygnus.com)
-
- * ch-typeck.c (build_chill_cast): Set TREE_CONSTANT on NOP_EXPRs.
- * ch-convert.c (digest_structure_tuple): Switch to permanent_obstack
- if we need to build a CONSTRUCTOR for a SET_TYPE initializer.
- (digest_structure_tuple): If TREE_VALUE (VALUE) == NULL_TREE, don't
- call CH_COMPATIBLE or try to convert it to TREE_TYPE (FIELD). This
- can happen when constructors are output incrementally.
- * c-typeck.c (initializer_constant_valid_p): Handle SET_TYPEs.
- * varasm.c (output_constant): Handle NOP_EXPRs in SET_TYPE
- CONSTRUCTORS.
-
-Sun Jan 2 08:17:09 1994 Michael Tiemann (tiemann@blues.cygnus.com)
-
- * ch-convert (digest_structure_tuple): Handle SET_TYPEs. Also, call
- `convert' so we can handle INSTANCE types (and other anomolies)
- correctly.
-
- * ch-convert.c (digest_structure_tuple): Fixed variant
- structure initialization. Also fixed a typo (TYPE_NAME
- was being used on a FIELD_DECL instead of DECL_NAME).
- * c-typeck.c (initializer_constant_valid_p): Pass missing
- ENDTYPE argument on recursive call.
- (set_init_field): New function, needed by ch-convert.c change above.
-
- * ch-decl.c (layout_chill_variants): Added a FIXME next to an
- almost certain typo.
-
- * ch-expr.c (build_chill_arrow_expr): Call `build1' and set
- TREE_CONSTANT for static references.
- * ch-except.c (chill_start_on): Change calls to
- `build_unary_op' (which is C-specific) to `build_chill_arrow_expr'
- which has CHILL semantics.
- * ch-convert.c (convert): Ditto (albeit in some disabled code).
-
-Sat Jan 1 21:26:43 1994 Michael Tiemann (tiemann@blues.cygnus.com)
-
- * ch-satisfy.c (safe_satisfy_decl): Reorder conditional test of
- TREE_CODE of DECL in case it's altered by actions in the switch.
-
- * ch-satisfy.c (satisfy): Undo abort added earlier on 1 Jan. CVS log
- mentions where to find code that triggers this case.
-
- * ch-actions.c (adjust_parm_or_field): Handle CONSTRUCTORS here as
- well.
-
- * ch-convert.c (digest_structure_tuple): Push to permanent_obstack if
- we're dealing with a CONSTRUCTOR that is TREE_PERMANENT.
- (digest_constructor): Ditto.
-
-Sat Jan 1 10:29:19 1994 Michael Tiemann (tiemann@blues.cygnus.com)
-
- * ch-parse.y (handleraction,resultaction,assignaction,call): Modified
- so that CONSTRUCTORS are properly handled before being used.
-
- * ch-convert.c (chill_start_init): New function. All callers to
- `start_init' changed to call this function instead.
- (digest_struct_tuple): Defend against initialization machinery
- mucking with CONSTRUCTOR_ELTS of CONSTRUCTORs by grokking both
- IDENTIFIER_NODEs and FIELD_DECLs in the TREE_PURPOSE slots. This is
- needed because CONSTRUCTORS stored in DECL_INITIALs of CONST_DECLs
- can be refered to throughout the compilation unit. Also remove an
- extraneous call to `process_init_element' erroneously added to the
- variant record sub-loop.
- (digest_constructor): Propagate TREE_CONSTANT and TREE_STATIC to
- CONSTRUCTORS of SET_TYPE.
- * ch-parse.y (build_chill_constructor): Refix typo. Also set
- TREE_STATIC if at top level.
-
- * ch-expr.c (build_chill_arrow_ref): Fix yet another case of
- TREE_CONSTANT not being set by calling `build1' when `build_unary_op'
- should have been called.
-
- * ch-convert.c (digest_struct_tuple): Restore code which tracks
- field initializations so that the compiler can deduce what variant
- initializations to assume.
-
- * ch-satisfy (safe_satisfy_decl): Turn on initialization machinery
- when we push into a scope that has a DECL with a CONSTRUCTOR as its
- DECL_INIT.
-
- * ch-parse.y (build_chill_constructor): Change the name of the
- parameter to something more meaningful. Fix typo. Also, handle case
- where element is an untyped CONSTRUCTOR.
-
- * ch-except.c (finish_handler_array): Set TREE_CONSTANT on
- constant ADDR_EXPRs.
- (chill_start_on): Call `build_unary_op' to set TREE_CONSTANT
- on JBUF_REF (instead of calling `build1' which does not).
-
- * ch-convert.c (convert): Test LENGTH instead of NEEDED_PADDING.
-
- * ch-typeck.c (chill_expand_tuple): Deleted.
- * ch-parse.y (primval rule): Don't call `chill_expand_tuple';
- instead, use initialization machinery for CONSTRUCTORS that
- come through here.
- * ch-except.c (finish_handler_array): Ditto for CONSTRUCTORS
- that are created here.
- * ch-satisfy (satisfy): Abort in case we would have called
- chill_expand_tuple. FIXME: some other code is needed here,
- but I don't know what yet.
-
- * ch-parse.y (build_chill_constructor): New function to
- propagate TREE_CONSTANT bits to CONSTRUCTORS.
- (untyped_expr rule): Use it.
- (primval rule): Use it.
-
- * ch-decl.c (do_decl): Call `finish_init'.
- * ch-convert.c (convert): If we spontaneously create a CONSTRUCTOR in
- this function, make sure the initialization machinery is set up.
-
- * ch-convert.c (digest_structure_tuple, digest_constructor): Add
- missing prototypes.
-
-Fri Dec 31 11:31:01 1993 Michael Tiemann (tiemann@blues.cygnus.com)
-
- * ch-grant.c (chill_finish_module_code): Mark ADDR_EXPR built by hand
- as being TREE_CONSTANT. Otherwise it gets bounded by the initializer
- code.
-
- * ch-decl.c (do_decl): Change in CONSTRUCTOR handling due to...
- * ch-convert.c (digest_structure_tuple,digest_constructor): Mostly
- rewritten to work with GCC's initialization code. The basic change
- was to keep the initializers in sync with the initialization
- machinery that `process_init_element' imposes. Both of these
- functions now return `void'.
- * ch-convert.c (convert): Changed calls to `digest_...' functions.
-
- FIXME: the code handling UNION_TYPE (and variant records) has not
- been tested yet.
-
-Fri Dec 31 15:32:56 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-lex.l (convert_number): Output the converted number if
- yydebug is enabled.
- * ch-parse.y (signaldef): Set ignore_exprs correctly for a
- SIGNAL declaration.
-
-Fri Dec 31 13:17:48 1993 Bill Cox (bill@cygnus.com)
-
- * ch-parse.y: Cleanup handling of RETURN actions, to distinguish
- a RETURN without a value (which cannot have an exception
- handler) from a RETURN with a value (which can). Eliminate
- some shift/reduce and reduce/reduce conflicts.
-
-Thu Dec 30 17:42:32 1993 Michael Tiemann (tiemann@blues.cygnus.com)
-
- * ch-inout.c (build_chill_writetext): Deal with 2 cases where
- types returned from `type_for_size' are not expected. FIXME.
- * ch-decl.c (init_decl_processing): Mark `char_type_node' unsigned.
- This is required when range checking is enabled.
-
-Thu Dec 30 14:28:25 1993 Bill Cox (bill@rtl.cygnus.com)
-
- DELAY CASE works now.
- * ch-decl.c (init_decl_processing): Move rest of tasking-related
- initialization into tasking_init().
- * ch-parse.y (delaycaseaction): Pervasive additions/corrections.
- (optsetprio): New non-terminal.
- * ch-tasking.c (get_task_name): Delete, obsolete.
- (build_instance_type): build pointer to instance type also.
- (build_receive_case_start): Cleanup per -Wall messages.
- (build_receive_case_label): Move between start and end functions.
- (build_delay_case_start): Pass SET name and priority also.
- Generally update to correct functioning.
- (build_delay_case_label): Move between start and end fucntions,
- correct its functioning.
- (build_delay_case_end): Correct the code.
- (tasking_init): Lots of tasking-related code moved here from
- init_decl_processing.
- * ch-tree.h: Update, add prototypes.
-
-Wed Dec 29 10:13:10 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-expr.c (build_chill_indirect_ref): Revert change which
- failed full regression testing.
- * ch-lex.l (name_type_signal): Add debug output.
- * ch-parse.y (structured_variable): Add a debug variable.
-
-Wed Dec 29 02:05:51 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-decl.c (get_next_decl): Revert change which failed full
- regression testing.
-
-Tue Dec 28 18:20:14 1993 Bill Cox (bill@rtl.cygnus.com)
-
- DELAY actions work now.
- * ch-decl.c: Correct spelling in comments.
- (get_next_decl): NULL out the decl's TREE_CHAIN before returning
- it, to prevent accidental access to the remembered_decls.
- (init_decl_processing): Add wait_event to runtime functions.
- * ch-expr.c (build_chill_indirect_ref): Prevent a syntax error from
- becoming a seg fault.
- * ch-grant.c: Correct a comment.
- * ch-loop.c: Delete/correct comments.
- * ch-parse.y (delaycaseaction): Add push/poplevel calls. Turn 'sorry'
- into rough draft of actual code.
- (delayaction): Don't make a new scope here, use get_unique_identifier
- instead.
- (locdec): process event decls here, too.
- (mode): Add code to forbid READonly EVENT and BUFFER decls. Delete
- code which required EVENTs and BUFFERs to be declared at global scope.
- (simple_name_string): Add an EVENTNAME.
- * ch-satisfy.c (safe_satisfy_decl): Prevent a syntax error from
- becoming a seg fault.
- * ch-tasking.c (tasking_setup): Add the event queue's max. length
- as the 'entry_point' parameter in the list.
- (build_receive_case_start, build_receive_case_label): Defer
- calling runtime routine until we know whether we have a signal
- or a buffer to wait for.
- (build_delay_case_start, build_delay_case_end,
- build_delay_case_label, build_delay_action,
- process_event_decls): Added functions.
- * ch-typeck.c (chill_similar): Allow all integers of differing
- precisions to be similar.
-
-Thu Dec 23 18:00:40 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * gcc.c (CHILL SPECS): Delete references to -M -MM -MD -MMD
- options. Delete C-specific defines. Disable piping from
- pre-processor to cc1chill (even if -pipe is specified), since cc1chill
- rewinds its input for its second pass. Piping still works
- from cc1chill to as.
-
-Thu Dec 23 12:31:55 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-tasking.c (decl_tasking_code_variable): Assure that the
- tasking_code variable is allocated on the permanent obstack.
- (tasking_setup): Lots of changes - handle EVENT/BUFFER max.
- queue length (passed as the entry_point parameter).
- Other changes to variable names to increase 'self-documentation'
- the only kind GNU CHILL will get, for a while..
-
-Wed Dec 22 10:46:31 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-decl.c (do_seize): Delete - it's unused. Fix comments.
- * ch-loop.c (build_chill_iterator): Convert BY expression
- so loop involving a SET works. Additional errors generated
- for numbered SET expression as start or end expression.
- * ch-tree.h: Prototypes for future DELAY functions.
- * ch-typeck.c: Standard indentation.
-
-Tue Dec 21 15:30:57 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * ch-actions.c (build_cause_exception): New function.
- (expand_cause_exception): Re-write to use build_cause_exception.
- (check_expression, check_range): New functions.
- (chill_convert_for_assignment): New function.
- * ch-expr.c (build_chill_pred_or_succ): New function.
- (build_chill_succ, build_chill_pred): Removed.
- (build_generalized_call): Use build_chill_pred_or_succ.
- * ch-lex.h, ch-lex.l (init_lex): Add RID_OVERFLOW and RID_RANGEFAIL.
- * ch-lex.l (init_lex): Use new macro to make more terse.
- * ch-typeck.c (chill_equivalent): New function.
- Also check that ranges have the same bounds.
- * ch-typeck.c (my_build_array_ref): Add optional range-checking.
- * ch-typeck.c (chill_location): Handle COMPOUND_EXPR properly.
- Return 2 if also a referable.
- * ch-typeck.c (chill_referable): Re-define to use chill_location.
- * ch-tree.h (CH_EQUIVALENT): Re-defined to use chill_equivalent.
-
- * dbxout.c (dbxout_type): Output the type attribute "@S;" to
- distinguish a string from a char array, and to distinguish a
- bitstring from regulat (power)set. (Needed for Chill.)
- * dbxout.c (dbxout_type): Only check for baseclasses in
- type.binfo is a vector. (It is used in Chill for tagged unions.)
-
-Fri Dec 17 09:56:07 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-actions.c, ch-convert.c, ch-decl.c, ch-expr.c,
- ch-grant.c, ch-inout.c, ch-loop.c, ch-parse.y,
- ch-satisfy.c, ch-tasking.c, ch-tree.h, ch-typeck.c:
- Fix -Wall problems.
- * ch-actions.c (chill_expand_assignment): Error if assigning
- a value to a BUFFER or EVENT variable.
- * ch-expr.c (invalid_left_operand): Delete, unused.
- * ch-grant.c (tasking_setup): Call build_enum_tables.
- * ch-inout.c (get_final_type_and_range, build_enum_tables,):
- New functions.
- (build_chill_writetext): Lots of changes to support other
- basic CHILL data types.
- * ch-loop.c (build_chill_iterator): Lots of new code to check
- the expressions in a STEP loop.
- * ch-tasking.c (rc_state): Add fields to flag SIGNAL and BUFFER
- names in receivecasealternative. Generate error messages
- if they're mixed in the same receive case.
- (process_buffer_decl): Renamed from build_buffer_decl.
- * ch-tree.h: Fix prototypes.
- * ch-typeck.c (smash_dummy_type): Handle all four kinds of LANG_TYPE
- correctly. Thanks Per!
-
-Wed Dec 15 15:05:56 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * ch-decl.c (push_scope_decls): Re-arrange some more, so
- that normal SEIZES (without ALL) are handled before SEIZE ALL.
-
-Wed Dec 15 13:01:22 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-loop.c (declare_temps): Calculate end-of-array pointer
- using correct type (NOT chill_integer_type).
- (begin_chill_loop): Build loop-bypass expression in the
- type of the start expression, not in the unsigned type.
-
-Tue Dec 14 15:41:32 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * ch-decl.c (push_scope_decls): Re-arrange so that normal
- (non-seize) declarations are proclaim_decl'd *before* we
- handle the ALIAS_DECLs for seizes. The advantage is
- that we can now test for (an approximation) to the
- 'seizeable' concept, thus avoiding duplicate definitions
- when a module has both GRANTs and SEIZE ALL.
-
- * ch-expr.c (build_chill_arrow_expr): No longer re-write
- addr-of-conversion to pointer-conversion-of-addr.
- * ch-expr.c (build_chill_addr_expr): Re-write to just use
- build_chill_arrow_expr.
-
-Mon Dec 13 16:44:43 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * ch-expr.c (build_chill_addr_expr, build_chill_addr_expr): Don't re-write
-
- * ch-tree.h (chill_root_resulting_mode): Fix typo (missing '_').
-
- * ch-expr.c (finish_chill_binary_op): Use CH_ROOT_RESULTING_MODE
- macro (which works on expressions), rather than CH_RESULTING_MODE
- (which works on modes, and isn't quite correct).
- * ch-tree.h (CH_IS_BOUND_REFERENCE_MODE): New macro.
- * ch-typeck.c (chill_read_compatible, chill_compatible):
- Use the new macro, which handles NEWMODEs of PTR correctly.
- * ch-typeck.c (chill_similar): Return 1 rather than 0 for
- dynamic-length array (and string) types (e.g. slices).
- * ch-typeck.c (chill_root_mode): If the mode has a Novelty,
- just return it as is. (This is still not 100% correct for
- NEWMODE of RANGEs, but is close enough.)
-
-Mon Dec 13 16:27:06 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-parse.y (locdec): Avoid passing IDENTIFIER_NODEs to
- build_buffer_decl, which then seg faults.
- * ch-tasking.c (build_buffer_descriptor): Move declaration
- of bufdecl closer to its use.
-
-Mon Dec 13 14:57:55 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-actions.c (chill_expand_result): Use expand_expr_stmt
- to avoid C-specific conversions.
- * ch-lex.l (name_type_signal): Rewrite to support BUFFERs and EVENTs.
- * ch-parse.y (sendaction): Delete unused statement, use the 'name'
- variable.
- * ch-tasking.c: Use expand_expr_stmt to avoid C-specific
- conversions.
- (build_buffer_decl): Save the tasking_code_variable's decl
- in the buffer decl tree.
- (build_buffer_descriptor): Real, working version.
-
-Mon Dec 13 03:13:36 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-decl.c (print_lang_identifier): Delete code
- to print buffer size - it's no longer kept here.
- * ch-parse.y (expand_send_buffer): Renamed from
- build_send_buffer.
- (locdec): Enable building of a buffer decl.
- (optresultspec, optresultattr): Add optional
- result attributes such as LOC. Semantics
- not enabled yet.
- * ch-tasking.c (expand_send_buffer): Renamed.
- * ch-tree.h (build_send_buffer): Renamed.
- * ch-typeck.c (chill_expr_class): Do more complete,
- job of classifying expressions. Thanks, Per.
-
-Mon Dec 13 00:59:30 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * ch-typeck.c (chill_expr_class): Return CH_DERIVED_CLASS
- for bitstring constants.
- * ch-typeck.c (chill_novelty): The novelty of an (unnamed)
- range mode is that of its parent mode; the novelty of READ M
- is that of M.
-
-Sat Dec 11 15:14:41 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * ch-expr.c (varying_to_slice): Call stabilize_reference
- rather than save_expr.
- * ch-typeck.c (build_chill_slice): Don't emit warning
- if array is a SAVE_EXPR (it is effectively referable).
- * ch-typeck.c (chill_root_resulting_mode): Handle
- correctly the case that one operand is DERIVED and one is VALUE.
-
-Fri Dec 10 10:00:42 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-grant.c (decode_decl): Restore code mistakenly deleted.
- Move instance-handling code to raw_decode_mode.
- * ch-parse.y (formpar): Allow READ modifier in SPEC MODULE.
- Add rough draft of DELAY statement handling.
- * ch-tasking.c (build_event_type): New function.
- * ch-tree.h (build_event_type): Add prototype.
- * ch-typeck.c (smash_dummy_type): Add buffer & event handling.
-
-Wed Dec 8 18:02:26 1993 Bill Cox (bill@rtl.cygnus.com)
-
- Parse and grant BUFFER modes.
- * ch-grant.c (raw_decode_mode): Format BUFFER, EVENT modes.
- Moved from decode_decl.
- * ch-parse.y: Fix several sorry() messages.
- * ch-tasking.c (build_buffer_type): Use a LANG_TYPE to pass the
- info.
-
-Wed Dec 8 12:59:54 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * ch-actions.c (chill_expand_assignment): In a multiple
- assignment, check that all the targets are equivalent.
-
- * ch-typeck.c (chill_l_equivalent, CH_L_EQUIVALENT): New function
- and macro to (partially) implement the relation l-equivalent.
- * ch-typeck.c (chill_read_compatible): Implement at least
- initial check of read-only-ness.
- * ch-typeck.c (build_readonly_type): Fix thinkos.
-
-Wed Dec 8 09:11:46 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-decl.c (pop_module): Only warn about duplicate grant
- statements if they inhabit different files, by examining
- inode numbers. Only report compatibility problems in pass 1.
- * ch-lex.l (chill_same_grant_file): New function to support the
- above test.
-
-Tue Dec 7 17:10:36 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * ch-decl.c (start_chill_function): Handle attributes in pass 1,
- rather than in pass 2. (It seems to make more sense that way.)
- * ch-parse.y (procedureattr): Build attribute list if pass != 2.
-
- * ch-parse.y (mode): Don't call build_readonly_type in pass 2.
-
-Mon Dec 6 14:35:31 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- This implements NOVELTY and READONLY checking.
- * ch-tree.def: Added comment about use of LANG_TYPE.
- * ch-typeck.c (build_readonly_type, smash_dummy_type): New functions.
- * ch-tree.h: New prototypes.
- * ch-decl.c (push_modedef): If newmode, lazily "copy" the given mode
- immediately (even if it's just a type name), using a LANG_TYPE.
- * ch-parse.y (mode): Call build_readonly_type to handle READ.
- * ch-decl.c (find_implied_types), ch-grant.c (raw_decode_mode),
- ch-satisfy.c (satisfy): Handle a LANG_TYPE.
- * ch-decl.c: Remove chill_modes_equiv and other unused junk.
- * ch-satisfy.c (safe_satisfy_decl/CONST_DECL): Better
- mode compatibility checking for SYN declarations.
-
- * ch-typeck.c (chill_similar): Be more general when checking set
- modes for similarity - specifically support calling chill_similar
- BEFORE the modes have been satisfied (needed by proclaim_decl).
- * ch-decl.c (proclaim_decl): Allow duplicate definitions
- of set elements of similar set modes.
-
- * ch-parse.y (caseaction): Call language-independent
- expand_start_case rather than c_expand_start_case (which
- doesn't allow chars or booleans).
-
-Sat Dec 4 22:16:19 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-actions.c (cond_range_exception,
- cond_type_range_exception): Check command-line flag before
- generating code. Fix comments.
- * ch-expr.c (build_chill_num): Add generation of OVERFLOW
- code, commented out.
- * ch-loop.c (build_chill_iterator): Comment out
- exception code generation.
- * ch-parse.y: Delete quasi_signal flag, use
- current_module->is_spec_module instead.
- * ch-tasking.c (build_buffer_decl, build_buffer_descriptor):
- Delete quasi_decl flag. Look at current_module
- instead.
- * ch-tree.h: Take quasi_decl flag out of buffer
- related prototypes.
- * ch-typeck.c (valid_array_index, chill_similar):
- Comment out runtime range checking for now.
- * expr.c (store_constructor): Fix word-size set problem.
- * varasm.c (emit_set_data): Fix word-size set problem.
-
-Wed Dec 1 19:08:12 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-actions.c: Delete unused prototype for build_compound_expr.
- * ch-loop.c (begin_chill_loop): Convert operands of the conditional
- expression to lp->iter_type before expanding it. Prevents an abort
- deep in expand_expr and friends.
-
-Wed Dec 1 17:00:44 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-actions.c (chill_expand_assignment): Comment out strange
- test and its error message.
- * ch-loop.c (begin_chill_loop): Correct call to generate conditional
- jump around the loop.
- * ch-typeck.c (build_chill_slice): Call correct temporary generator.
-
-Wed Dec 1 14:19:51 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-actions.c (cond_exception): Clarify that it generates
- an exception if the given expression is TRUE. Make it so, Number One.
- * ch-decl.c (DOLLARS_IN_IDENTIFIERS): Disable these.
- (print_lang_type): Print max queue size.
- Add casts to DECL_TASKING_CODE_DECL references. Fixes a
- portability problem.
- (init_decl_processing): Add filename and linenumber arameters
- to tasking and memory-allocate runtime prototypes.
- * ch-expr.c (finish_chill_binary_op): Check for division
- by a constant zero. Replace build_temporary_variable
- calls with decl_temp1 calls, to decouple from ch-loop.c.
- (build_chill_succ, build_chill_pred): Sketch code to generate
- exceptions. Add error check for numbered set.
- (build_generalized-call): Correct call for return_memory.
- Standardize whitespace before left parens.
- * ch-grant.c: Use new macro for checking for BUFFER mode.
- * ch-lex.l (name_type_signal): Add attempts to recognize BUFFER
- and EVENT names.
- * ch-loop.c (build_temporary_variable): Make static, unavailable
- to outsiders.
- (declare_temps): Make user's variable for him/her, in the
- true Z.200 case, where it hasn't previously been declared.
- (begin_chill_loop): simplify control flow a bit.
- * ch-parse.y (quasi_locdec): Set/reset quasi_flag.
- (rccase_label): Delete bogus error checks. Rough draft of
- BUFFER-related code.
- (assertaction): Remove logical negation - it's now in cond_exception.
- (locdec): Sketch of buffer-related code.
- (non_array_mode): Add EVENT and BUFFER modes here. Add setting of
- set-numbered flag for pred and succ functions.
- (optqueuesize): Default to integer_zero_node.
- (simple_name_string): Add BUFFERNAME.
- * ch-tasking.c: Add casts to DECL_TASKING_CODE_DECL references.
- (build_chill_start_process, expand_send_signal,
- build_receive_case_start, build_send_buffer): Add filename, linenumber parameters
- to tasking-related runtime calls. Sketches of BUFFER mode
- processing.
- * ch-tree.h: Remove left-hand-side cast in DECL_TASKING_CODE_DECL
- macro, for portability to non-gcc compilers. Add prototypes
- for buffer-related functions.
- * ch-typeck.c: Replace build_temporary_variable calls with
- decl_temp1 calls, to decouple from ch-loop.c.
- (chill_similar): Add tests for BUFFER and EVENT modes.
-
-Wed Dec 1 14:05:26 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * ch-actions.c (malloc prototype): Remove; can cause conflicts.
-
-Wed Dec 1 09:49:58 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-grant.c (raw_decode_mode): Process a REFERENCE_TYPE.
-
-Tue Nov 30 14:05:23 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-decl.c (init_decl_processing): Add filename, line number
- parameters to tasking-related runtime routines.
- * ch-grant.c (decode_decl): Check for BUFFER mode differently.
- * ch-parse.y (BUFFER_CODE, EVENT_CODE): Move token to
- lex-only list.
- (quasi_locdec): Set/reset quasi_decl flag.
- * ch-tasking.c (build_start_process, expand_send_signal,
- build_receive_case_start, build_send_buffer): Add filename. linenumber to
- (build_buffer_decl, build_buffer-type): New rough-draft functions.
- generated runtime routine call.
- * ch-tree.h (CH_IS_BUFFER_MODE, CH_IS_EVENT_MODE): New macros
- to mark a synchronization mode. Update the prototypes.
- * ch-typeck.c (chill_similar): Check EVENT or BUFFER modes for
- similarity.
-
-Tue Nov 30 09:51:47 1993 Doug Evans (dje@canuck.cygnus.com)
-
- * cccp.c (main): Add missing chill sanitization.
-
-Sun Nov 28 15:50:10 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-loop.c (initialize_iter_var): Build count expression
- more robustly.
- (bottom_loop_end_check): Call emit_line_note.
- (end_chill_loop): Delete emit_line_note call.
- * ch-parse.y (doaction): Move DO keyword
- after end_chill_loop call.
-
-Wed Nov 24 08:49:07 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * c-typeck.c (c_expand_start_case): Back out previous
- change.
-
-Tue Nov 23 12:33:50 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * c-typeck.c (c_expand_start_case): Allow any CHILL discrete
- type as a CASE label.
-
-Tue Nov 23 11:37:42 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * ch-decl.c (grok_chill_variantdefs): Use NULL as the name
- of variant fields (not __CASE or anything based on it).
- * ch-decl.c (handle_one_parent), ch-expr.c (compare_records):
- Don't check for field name __CASE.
-
-Tue Nov 23 09:37:54 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-decl.c (grok_chill_variantdefs): Use a unique dummy
- name for the FIELD_DECL.
- * ch-parse.y (optstartset): More error tests.
- * ch-tasking.c (make_process_struct): Only report error in pass 1.
- (build_start_process): Remove bogus restriction, allowing
- an INSTANCE expression as the optset parameter.
-
-Mon Nov 22 17:56:34 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * ch-tree.h (expand_function_end): Now is takes parameters, not 2.
- * ch-decl.c (finish_chill_function): Add 3rd parameter to
- call of expand_function_end.
-
- * ch-expr.c (chill_expand_expr): For set and strings ops,
- if target is in a register, use a stack temporary (since we must
- take its address). (Similar to Oct 29 change for store_constructor.)
- * ch-expr.c (resolve_component_ref): Fix variant field lookups.
-
-Mon Nov 22 14:23:13 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-expr.c (chill_expand_expr): Assure that emit_library_call
- parameter 1 and its mode are always in sync.
- (build_chill_pred, build_chill_succ): Allow pred/succ of a
- pointer.
- * ch-loop.c (chill_unsigned_type): New function, used instead of
- unsigned-type, since it understands the chill_integer_type.
- (decl_iteration_var): Delete, use build_temporary_variable
- instead.
- (declare_temps): Use lp->iter_type for the temp evaluations.
- (initialize_iter_var): More careful calculation, to handle
- MININT to MAXINT loops w/o overflow/underflow.
- (begin_chill_loop): Use the original start/end expressions
- for the loop bypass test.
-
-Mon Nov 22 14:02:06 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * ch-typeck.c (build_chill_slice): If the argument is
- is constant, use a read-only static variant, as the
- existing algorithm assumes addressability.
- * ch-typeck.c (chill_compatible): De-reference reference types.
- * ch-typeck.c (layout_chill_range_type): Set TREE_UNSIGNED.
-
-Sat Nov 20 20:17:15 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-decl.c (init_decl_processing): Add filename
- and linenumber to allocate, free memory calls.
- * ch-expr.c (build_allocate_memory_call,
- (build_allocate_global_memory_call): Add
- filename, linenumber to call.
- * ch-loop.c: Complete rewrite for maintainability.
-
-Sat Nov 20 17:30:05 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * ch-except.c: Make it so that (by default at least) the
- code to push/pop the __exceptionStack is done using library
- functions __ch_link_handler and __ch_unlink_handler. This
- provides better flexibility (for e.g. multi-threading).
-
- * ch-decl.c (layout_chill_variants): Allow (useless) selectors
- even for tag-less variants.
-
-Fri Nov 19 14:32:20 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-decl.c (init_decl_processing): Add memmove builtin
- function definition.
- * ch-actions.c (chill_expand_array_assignment): Use memmove
- call to copy an array or slice across the assignment.
-
-Wed Nov 17 18:23:15 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * ch-satisfy.c (satisfy): If a CONTRUCTOR already has a
- TREE_TYPE, temporarily clear it before calling chill_expand_tuple,
- to force expansion (processing of the elements).
- * ch-grant.c (decode_constant): If a tuple (CONTRUCTOR) has
- a mode, write it out.
- * ch-decl.c (init_decl_processing): Add some missing inits.
-
-Wed Nov 17 17:13:20 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-loop.c: Fix unterminated strings in design comments.
- Add enumeration to the iterator structure for type of loop.
- unused for now.
-
-Wed Nov 17 16:40:05 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-decl.c (init_decl_processing): Add long parameters to lots
- of powerset runtime routines.
- * ch-expr.c (chill_expand_expr): Change parameters to powerset
- runtimes so bitlengths are long unsigned ints.
- * ch-inout.c (build_chill_writetext): Add filename and linenumber
- as runtime parameters, for better error messages.
- * ch-loop.c: general pre-rewrite cleanup.
- * expr.c (store_constructor): Rewrite set interface to
- setpowersetbits for long bitnumbers, rather than shorts.
-
-Tue Nov 16 13:41:12 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-expr.c (build_chill_function_call): Stop generating empty
- copyback statements, which lead to a seg fault.
-
-Tue Nov 16 12:20:17 1993 Per Bothner (bothner@cygnus.com)
-
- * ch-satisfy.c (satisfy): If satisfying a type whose
- TYPE_MAIN_VARIANT is not itself, also satisfy the TYPE_MAIN_VARIANT.
- * ch-actions.c (build_exception_variant): Remove some crud.
- * ch-actions.c (build_exception_variant), ch-tree.h, ch-decl.c:
- Remove unused first argument.
- * ch-decl.c (start_chill_function): Call build_exception_variant
- in pass 1, not in pass 2.
-
-Tue Nov 16 11:10:03 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-decl.c (shadow_record_fields): Call new function
- build_chill_arrow_expr, which returns a ptr-to-a-type.
- * ch-expr.c (build_chill_arrow_expr): New function, works like
- build_chill_addr_expr used to do, returning a typed ptr.
- (build_chill_addr_expr): Now returns unbound ref - analogous
- to C 'void *'.
- * ch-parse.y (PREDEF_MODEDECL): Delete unused token.
- (operand6): Call build_chill_arrow_expr. Reindent a bit.
- * ch-tree.h (build_chill_arrow_expr): New prototype.
-
-Mon Nov 15 16:38:28 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * stor-layout.c (layout_type): If a SET_TYPE needs more than
- INT_TYPE_SIZE bits, use BLKmode (and never DImode).
-
- * ch-decl.c (start_chill_function): Set DECL_CONTEXT of params.
-
-Mon Nov 15 14:49:17 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-decl.c (init_decl_processing): Move tasking stuff (__whoami
- build_function_call, etc.) to tasking_init.
- * ch-gperf, ch-hash.h: Add ASM keyword.
- * ch-parse.y: Add ASM statement rules.
- (format_str, text_arg): Delete last rules for WRITETEXT, READTEXT.
- * ch-tasking.c: Move tasking stuff here.
-
-Sun Nov 14 15:50:34 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * ch-parse.y (mode2): Split into array_mode and non_array_mode
- to resolve layout ambiguity.
- * ch-parse.y (checked_name): Remove. Use name_string instead.
- * ch-parse.y (variantdef): Don't crash if no tag fields.
- * ch-typeck.c (build_chill_array_type): If varying_p,
- actually do build_varying_struct here (rather than in ch-parse.y).
-
-Fri Nov 12 15:37:45 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * ch-satisfy.c (safe_satisfy_decl): Don't mangle function-local
- static names. (Let make_decl_rtl generate a unique name.)
-
-Sun Nov 14 13:15:26 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-expr.c (build_chill_lower, cuild_chill_upper):
- Rewrite for modes, values, etc.
- * ch-inout.c (build_chill_writetext): Add ability
- to write out characters.
- * ch-satisfy.c (safe_satisfy_decl): Don't mangle function-local
- static names. (Let make_decl_rtl generate a unique name.)
- * varasm.c (unpack_set_constructor): Subtract
- lower domain value from a bit's index value,
- to match the runtime and allow powersets
- with negative lower bounds.
-
-Fri Nov 12 14:00:48 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-inout.c (build_chill_writetext): Save reserved words in
- uppercase if -fspecial_UC was specified.
-
-Fri Nov 12 13:27:12 1993 Per Bothner (bothner@rtl.cygnus.com)
-
- * ch-expr.c (chill_expand_expr, build_concat_expr): Simplify
- string concatenation by treating varying strings as slices.
- (varying_to_slice): New function.
- * ch-typeck.c (build_chill_slice): Changed to support the above.
-
-Fri Nov 12 12:07:28 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-convert.c (convert): Fall through & convert a VARY_ARRAY_REF.
- * ch-expr.c (build_generalized_call): Start module before a
- writetext action, so its variables are inside the module-level
- function.
- * ch-loop.c (init_loop_counter): Correct for_u_bound computation
- for enumeration loop on a varying array.
-
-Thu Nov 11 07:49:53 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * cccp.c (main): Disable trigraphs for CHILL.
- * ch-decl.c (grok_chill_fixedfields): Add special_UC
- to conditional to determine case of reserved words.
- Make PACK/UNPACK warning more specific.
- * ch-expr.c (build_generalized_call): Enable recognition
- of WRITETEXT call here.
- * ch-gperf, ch-hash.h: Remove WRITETEXT as a reserved
- word. It's only predefined.
- * ch-inout.c: Add special_UC to conditionals
- to determine case of reserved words.
- (build_chill_writetext): Change for call from
- build_generalized_call. Add code to format
- integers.
- * ch-lang.c (lang_decode_option): Add special_UC and
- special_LC flags and logic to interlock with
- ignore_case flag.
- * ch-lex.l: Add special_UC to conditionals
- to determine case of reserved words.
- * ch-parse.y: Delete WRITETEXT as reserved word.
- * ch-tasking.c: Add special_UC to conditionals
- to determine case of reserved words.
- (build_instance_type): Make components of INSTANCE
- unsigned 16-bit integers.
- * ch-tree.h (build_chill_writetext): Fix prototype.
- * ch-typeck.c (build_chill_array_type): Make PACK
- /UNPACK warning more specific.
- * toplev.c (lang_options): Add -fspecial_LC
- and -fspecial_UC flags.
-
-Wed Nov 10 02:29:53 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * Makefile.in: Move ch-hash.h from ch-lex.o
- rule to ch-lex.c rule, so flex is rerun.
- * ch-actions.c (chill_expand_assignment): Error if
- user tries to assign to a LHS function.
- * ch-decl.c (grok_chill_fixedfields): Use of PACK
- /UNPACK is only a warning.
- (init_decl_processing): Add ADDR as a builtin function.
- * ch-expr.c (build_generalized_call): Add ADDR
- as a builtin function.
- (build_chill_addr_expr): Sanity check parameters.
- * ch-gperf: Remove ADDR as a reserved word,
- make ASM into one.
- * ch-hash.h: gperf'd version of the above.
- * ch-inout.c (chill_stdio_p): Recognize upper/lower
- case file names.
- * ch-lex.l: Make ignore-case work. Downcase
- token before checking for reserved words.
- * ch-parse.y: Delete ADDR as a reserved word.
- (mode2, optlayout): Allow PACK/UNPACK specifier.
- (call): Use build_generalized_call for
- primval LPRN modename RPRN.
- (primval): Delete ADDR reference. It's now only
- predefined, not reserved.
- * ch-tree.h: Add BUILT_IN_ADDR as a predefined.
- * ch-typeck.c (build_chill_array_type): Just
- a warning for PACK/UNPACK usage.
- * toplev.c: Add -fignore-case and -fno-ignore-case.
-
-Tue Nov 9 15:07:02 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-actions.c: Reindent for readability.
- * ch-convert.c (convert): Turn a NULL keyword into [0, 0] for
- a conversion to INSTANCE.
- * ch-decl.c: Change special_UC to ignore_case everywhere.
- (init_decl_processing): Add builtin_function calls for lots of
- predefined functions.
- * ch-expr.c: Change builtin function handlers back to accepting
- args, not a treelist.
- (route_to_predefined_function): Delete it and its call.
- (build_generalized_call): Add lots of builtin functions.
- * ch-gperf (backwards, duration, inttime, null): Delete them.
- * ch-hash.h: New version.
- * ch-inout.c: Change special_UC to ignore_case everywhere.
- * ch-lang.c: Delete special_UC flag.
- * ch-lex.l: Change special_UC to ignore_case everywhere.
- * ch-loop.c (high_domain_value, low_domain_value): Change
- interfaces to build_chill_upper and built_chill_lower.
- * ch-parse.y: Delete lots of stuff which should only be predefined.
- * ch-tasking.c: Change special_UC to ignore_case everywhere.
- Change builtin function handlers back to accepting args,
- not a treelist.
- * ch-tree.h: Add lots of builtin functions to the enumerator.
-
-Mon Nov 8 18:08:27 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-tasking.c (tasking_init): Disable last-minute change for now.
-
-Mon Nov 8 17:30:22 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * Makefile.in: New commands to build ch-hash.h. Add ch-lex.h to
- dependencies where it's used.
- * ch-decl.c (init_decl_processing): Build predefined constants
- for TRUE, FALSE and NULL. Add declaration for abs builtin
- function.
- (lookup_name): Check for a CONST_DECL, don't ask about DECL_NESTING
- stuff for builtin constant like TRUE.
- * ch-expr.c (route_to_predefined_function): Add a bunch of
- predefined functions to the list.
- * ch-gperf: Define the list of reserved words, minus the predefined
- words, using the special_UC flag. Remove NULL, TRUE, FALSE -
- these are only predefined, not reserved.
- * ch-hash.h: Check this into repository, even though it's derived
- from ch-gperf, for those users who don't have gperf.
- * ch-inout.c (build_chill_io_list_type): Use the special_UC flag
- to refer to the IO types. Standardize the indentation.
- * ch-lex.h: Add enumerators for TRUE, FALSE, NULL.
- * ch-lex.l: Total rewrite of reserved-word recognition, using
- the ch-hash.h lookup routines.
- * ch-parse.y: Delete a bunch of unused rules for predefined
- procedures and their parameters.
- * ch-tasking.c (tasking_init): Build predefined functions
- for COPY_NUMBER, GEN_CODE, GEN_INST, and GEN_PTYPE. Not
- complete yet. Change interface to builtin handlers to accept
- just an expression list.
-
-Wed Nov 3 18:07:08 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * Makefile.in: Debug, activate rule to make CHILL hash table.
- * ch-actions.c: Compress parameter type lists per standard.
- * ch-decl.c: Correct spelling in comment, compress parameter lists.
- (init_decl_processing): Check special_UC flag to build builtin
- function declarations.
- * ch-expr.c (route_to_predefined_function): Check for upper OR
- lowercase function names.
- * ch-gperf: Update the list of keywords.
- * ch-inout.c (build_chill_io_list): Check for special_UC flag
- to build I/O list type. Compress parameter lists.
- (chill_stdio_p): Check for special_UC flag in recognizing
- file streams.
- * ch-lang.c (lang_decode_option): Add command-line options
- for upper-case keywords and user labels.
- * ch-lex.l (init_lex): Initialize ridpointers to uppercase
- if special_UC flag is set.
- (downcase, getlc, check_newline): Don't do this if ignore_case
- flag is set.
- * ch-parse.y (variantdef, case_expr): Report 'sorry' for use of
- multiple selector expressions.
-
-Sat Oct 30 01:06:19 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * ch-expr.c (compare_record, finish_chill_binary_op): Compare
- STRUCTs (and INSTANCEs) for equality.
- * ch-expr.c (invalid_operand): New functions, combines most of
- the functionality of invalid_left_operand and invalid_right_operand.
- * ch-convert.c (digest_constructor): Set TREE_CONSTANT if it is.
-
-Sat Oct 30 11:12:47 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * Makefile.in (chill): Add back in the commands to build chill
- (the script) from chill.in.
-
-Fri Oct 29 16:25:38 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * expr.c (store_constructor): If SET_TYPE target is in a register,
- use a stack temporary (since we must take its address).
-
- * ch-expr.c (build_allocate_global_memory_call,
- build_allocate_memory_call): Cast argument pointer to PTR,
- if needed (using location cast). Also, some other cleanups.
- * ch-parse.y (bracketed_action): Re-arrange things so that
- a handler following BEGIN END comes before the final poplevel.
- * ch-typeck.c (build_chill_cast): Just return if already correct type.
-
- Re-do DO WITH so that build_component_ref for is done lazily
- (at each reference) instead of eagerly (at the beginning
- of DO WITH). This is needed for tagged variants,
- * ch-tree.def (WITH_DECL): New declaration tree code.
- * ch-decl.c (lookup_name): Recognize WITH_DECLs.
- * ch-decl.c (handle_one_level): Variant parts are currently
- indicacted with '__CASE'. Recognize that.
- Generate a WITH_DECL (instead of ALIAS_DECL) for each field name.
-
-Thu Oct 28 22:17:41 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * ch-expr.c (build_chill_length), ch-typeck.c (build_chill_cast):
- Remove some old crud.
- * ch-typeck.c (build_chill_cast): Another attempt at a
- compromise between robustness and generality for casts.
- Location conversions are now less likely to confuse things.
- * ch-parse.y (optactions): Allow further optactions following
- an initial semicolon.
- * ch-parse.y: Add error messages on EVENT and BUFFER.
-
- * ch-decl.c, ch-expr.c, ch-parse.y, ch-typeck.c:
- Undo some of the Oct 27 changes.
-
- Convert (some) builtin functions previously using reserved
- names to be just predefined.
- * tree.h (enum builtin_in_function): Added END_BUILTINS at end.
- * ch-decl.c: Add predefines for allocate_memory,
- allocate_global_memory, return_memory, writetext.
- * ch-expr.c (check_arglist_length): New function.
- * ch-expr.c (build_generalized_call): If "function" is
- a builtin, build the appropriate tree.
- * ch-parse.y, ch-lex.l: No longer recognize many pre-defined
- functions at the lexer/parser level.
- * ch-tree.h (enum chill_built_in_function): New type.
-
-Thu Oct 28 16:43:36 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-expr.c (allocate_memory, allocate_global_memory):
- Check for invalid parameters, issue errors.
- * expr.c (store_constructor): Calculate bitlength, startrtx
- and endrtx of powerset correctly. Define targetx, use it
- and XEXP correctly.
-
-Wed Oct 27 08:25:56 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-expr.c (build_max_min): Error for passing empty tuple
- as the argument.
-
-Wed Oct 27 08:25:56 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-decl.c (init_decl_processing): Make allocate
- builtins have a pointer-to-pointer-to-void
- first parameter, rather than a reference parameter.
- * ch-expr.c (build_allocate_memory_call,
- build_allocate_global_memory_call): Do automatic
- ADDR () on the first parameter, for backward
- compatibility.
- * ch-grant.c (grant_one_decl): Don't grant if
- DECL_SOURCE_LINE is zero.
- (start_chill_module_code): Set DECL_SOURCE_LINE
- to zero so that module-level function isn't granted.
- * ch-parse.y (handleraction): Add return_memory action.
- * ch-typeck.c (chill_similar): Allow a void_type
- to be similar to anything. This makes allocate_memory
- and return_memory pointer parameters slide through.
-
-Tue Oct 26 00:12:19 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * ch-typeck.c (build_chill_array_ref): Check for and complain
- if there are more index expressions than the array rank.
-
- * ch-actions.c (chill_expand_assignment): Emit appropriate
- error message if RHS of multiple assignment is tuple/case/if.
- * ch-tree.def (CONCAT_EXPR): Change TREE_CODE_CLASS from
- 'e' to the more specific '2'. (Fixes a satisfy bug.)
-
-Thu Oct 21 17:25:33 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-parse.y: Revert experimental error-generating change
- that was checked in by mistake.
-
-Thu Oct 21 12:15:30 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-satisfy.c (safe_satisfy_decl): Satisfy the hidden tasking
- code variables associated with a process or signal.
- (Apparently I forgot to actually check these in last time.)
- * ch-tasking.c: Replace last calls to get_tasking_code with
- working references to DECL_TASKING_CODE_DECL.
-
-Thu Oct 21 10:27:42 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-satisfy.c (safe_satisfy_decl): Satisfy the hidden tasking
- code variables associated with a process or signal.
- * ch-tasking.c (build_gen_inst, build_gen_ptype): Use the decl's
- tasking_code_decl pointer, rather than trying to look it up
- in the hash table or linked scope list.
-
-Wed Oct 20 09:52:44 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-actions.c (lookup_and_handle_exit): Only output error message
- in pass 1.
- * ch-convert.c (convert): Correct conversion of VARYING array to/
- from non-VARYING one.
- * ch-decl.c (print_lang_decl): Add debug output for DECL_TASKING_CODE_DECL
- field in the node.
- (decl_tasking_code_var): Delete it. Its calls are replaced woth
- generate_tasking_code_variable calls, plus a little glue.
- (push_extern_process): generate tasking_code_variable as local
- static variable, point the process' function_decl at it for later
- reference by build_start_process.
- (print_mode): Use CHILL upper-case convention to print modes.
- * ch-lex.l: Must initialize tasking-related trees to NULL at start
- of each pass, or we lose the fact that the user did or did not
- specify a value for each of them.
- * ch-parse.y (check_end_label, action, exceptlist): Only output
- error message in pass 1.
- (sendaction): Add comments.
- (sigdef): Comment out special handling for external signals.
- Chain tasking_variable_decl onto signal structure decl, for
- easier non-symbol-table access later.
- * ch-tasking.c (generate_tasking_code_variable): Do work in both
- passes, using do_decl so we can pass the pass 2 value of the
- process_type or signal_code to it. Only update the process_type
- if the incoming pointer isn't null and pass == 2. Use a new
- parameter to know whether to include an init expression.
- (build_process_header): Attach tasking-code_variable to process
- function_decl for easy access later, not through the hash table.
- (build_start_process): Get tasking_code_variable out of the process'
- function decl.
- (build_signal_struct_type): Return the type decl, to be accessed by ...
- (build_signal_descriptor): .. this function.
- (build_receive_case_label): Get data buffer pointer not from hash
- table, but from Tiemann's current rc_state structure instead.
- * ch-tree.h: Change prototype, fix comment, add DECL_TASKING_CODE_DECL
- macro for tasking_code_variable storage.
-
-Tue Oct 19 17:39:40 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * ch-lex.l (equal_number): If the "number" is a CONST_DECL,
- return its DECL_INITIAL.
- * ch-satisfy.c (safe_satisfy_decl): Change logic for rtl
- generation for decls to not use DECL_ASSEMBLER_NAME.
- * ch-decl.c: Set DECL_ASSEMBLER_NAME to DECL_NAME.
- This matches C, and allows dbxout to emit proper user-level names.
- (It would be cleaner to fix dbxout to use DECL_NAME ...)
- * ch-decl.c (outer_decls): New global list of the decls granted
- into the outer scope.
- (pop_module): Change code that grants into outer scope accordingly.
- (lookup_name_for_seizing): Similarly update.
- (push_scope_decls): Handle SEIZE ALL from the global scope
- by searching outer_decls.
- * ch-grant.c (grant_array_type): Fix thinko.
- * ch-inout.c (build_chill_writetext): Remove excessive TREE_TYPE.
-
-Mon Oct 18 15:57:00 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * varasm.c (output_constructor): Add support for non-zero
- lower array bound.
- * c-typeck.c (output_init_element): Revert recent changes.
- * varasm.c (emit_set_data): Fix emitting set constant data.
- * ch-lex.l (yywrap): Reset line number to 0, not 1.
- It sets incremented to 1 by check_newline.
- * ch-tree.h: Restore old version.
- * ch-expr.c (finish_chill_binary_op): Convert TRUNC_DIV_EXPR
- to RDIV_EXPR if an operand is floating. (This functionality
- got dropped when hacking finish_chill_binary_op).
-
- * ch-actions.c (build_chill_case_expr): Set type to NULL_TREE.
- not error_mark_node.
- * ch-actions.c (chill_expand_assignment): Allow such borderline
- constructs as: LHS OR:= [X].
- * ch-convert.c (convert): Hande CASE_EXPR (and COND_EXPR)
- with unknown (NULL_EXPR) type, not just CONSTRUCTORS.
- * ch-decl.c (do_decl): Remove CONSTRUCTOR kludge.
- * ch-typeck.c (chill_compatible): Allow expr to have NULL mode
- if it's a CASE_EXPR or COND_EXPR (and not just CONSTRUCTOR).
-
-Mon Oct 18 13:20:53 1993 Ken Raeburn (raeburn@rover.cygnus.com)
-
- * c-typeck.c (output_init_element): Limit previous changes to
- ARRAY_TYPE and SET_TYPE initializers.
-
-Sun Oct 17 23:15:00 1993 Bill Cox (bill@cygnus.com)
-
- * c-typeck.c (output_init_element): Handle NULL domain case.
- * ch-decl.c (do_decl): Revert bogus initializer type change.
- * ch-grant.c (chill_finish_module_code): Put module's decl onto
- the module_init_list, for chill_finish_compile's possible use.
- (chill_finish_compile): Rename variables for clarity, add
- commented-out code as example for assignment of module address to its
- init_list entry.
-
-Sun Oct 17 15:16:54 1993 Bill Cox (bill@cygnus.com)
-
- * ch-convert.c: Move semicolon to separate line - easier to see.
- * ch-decl.c (do_decl): Handle untyped_expr initializers by
- simply using the variable's declared type - no compatibility
- check can be made if the expression has no type.
- * ch-expr.c (expand_packed_set): Fix endless loop - increment
- the loop variable.
- (fold_set_expr): Fix two other endless loops by passing
- correct parameters to unpack_set_constructor.
- * varasm.c: Standardize 'for' loop.
-
-Sun Oct 17 12:16:21 1993 Bill Cox (bill@cygnus.com)
-
- * c-typeck.c (output_init_element): Handle initializer for
- array with non-zero lower index bound.
-
-Sat Oct 16 16:48:48 1993 Per Bothner (bothner@cygnus.com)
-
- * ch-expr.c (finish_chill_binary_op): Use TREE_SET_CODE
- to change TREE_CODE.
-
-Sat Oct 16 08:07:17 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-expr.c (finish_chill_binary_op): Disable
- rough-draft code, not intended for release.
-
-Fri Oct 15 21:44:11 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com)
-
- * expr.c (store_constructor): use PROTO for pack_set_constructor
-
-Fri Oct 15 10:30:09 1993 Bill Cox (bill@cygnus.com)
-
- * ch-expr.c (finish_chill_binary_op): Activate some
- type-setup code.
- * expr.c (store_constructor): Subtract arrays minimum element.
- Makes orientexpress work.
-
-Fri Oct 15 09:26:24 1993 Bill Cox (bill@cygnus.com)
-
- * ch-convert.c, ch-expr.c: Add externs so it'll compile.
- * ch-tree.def: Add BASED_DECL definition.
-
-Thu Oct 14 13:20:02 1993 Bill Cox (bill@cygnus.com)
-
- * ch-actions.c (build_chill_cause_exception): Pass the
- *address* of the filename string to the runtime routine,
- rather than passing the string by value.
-
-Thu Oct 14 13:08:07 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * expr.c (store_constructor): Use a (usually) more efficient
- algorithm for setting SET types.
-
-Thu Oct 14 13:08:07 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- Changes to better support 1984 version of Chill, which doesn't
- really distinguish BOOL and BITS(1) or CHAR and CHARS(1).
- * ch-lang.c, toplev.c, ch-tree.h (flag_old_strings): New flag.
- * ch-typeck.c (chill_similar): Support flag_old_strings.
- * ch-convert.c (convert_to_boolean): Generalize code to
- convert singleton bitstring to Boolean.
- * ch-convert.c (convert): Use string_one_type_node.
- * ch-convert.c (convert): Add code to convert Boolean to BOOLS(1).
- * ch-convert.c (convert): In code that converts fixed string to
- varying use new 'e' variable, rather than original 'expr' variable.
- Allows cascaded conversions: CHAR -> CHARS(1) -> varying CHARS.
- * ch-decl.c (string_type_node, const_string_type_node,
- int_array_type_node), ch-tree.h: Removed.
- * ch-decl.c (string_one_type_node, bitstring_one_type_node,
- bit_zero_node, bit_one_node), ch-tree.h: New globals tree nodes.
- * ch-decl.c (init_decl_precessing): Remove some junk.
- * ch-expr.c (build_generalized_call): If flag_old_strings,
- treat string index as string slice. Also, better error checking.
-
- Added support for (some kinds of) BASED declarations.
- * ch-tree.def (BASED_DECL): New tree code.
- * ch-decl.c (lookup_name): Implement BASED_DECL using
- build_chill_indirect_ref.
- * ch-decl.c (do_based_decls): Make a BASED_DECL.
- * ch-parse.y: Call do_based_decls for DCL ... BASED(...).
- * ch-satisfy.c (safe_satisfy_decl): Handle BASED_DECL.
-
- Improve handling of set binary operations.
- * ch-expr.c (expand_packed_set): New function.
- (fold_set_expr): Re-write. Simpler, more general algorithm.
- (build_set_expr): Only used for comparsions now.
- (finish_chill_binary_op): Handle set ops better (more directly).
- (fold_set_and, fold_set_diff, fold_set_eq, fold_set_or,
- fold_set_ne, fold_set_xor): Removed. No longer needed.
-
- * ch-decl.c: Remove calls to allocate_lang_decl.
- * ch-tree.c (build_string_type): If const length, layout immediately.
-
-Mon Oct 11 17:23:02 1993 Bill Cox (bill@cygnus.com)
-
- * ch-decl.c (init_decl_processing): Define __whoami and
- __wait_buffer functions.
- * ch-lex.l (ch_lex_init): Reset tasking numbers to zero.
- * ch-parse.y (sigdef): Add new add_taskstuff_to_list
- parameter.
- * ch-tasking.c (get_tasking_code): Search tasking_list for
- tasking code name match. Can't use lookup_name.
- (get_task_name): New function.
- (generate_tasking_code_variable): Return if pass 1.
- Always update *tasking_code_ptr.
- (build_process_header): Add new add_taskstuff_to_list
- parameter.
- (tasking_setup): New code to unpack the tasking
- list entries no built by ..
- (add_taskstuff_to_list): Accept new parameter,
- add it to the list.
- * ch-tree.h (add_taskstuff_to_list): Add new
- parameter.
-
-Mon Oct 11 14:54:50 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * Makefile.in (cc1chill): Also link in $(BC_OBJS).
-
-Mon Oct 11 06:28:39 1993 Doug Evans (dje@canuck.cygnus.com)
-
- * ch-decl.c (flag_allow_single_precision): New global,
- from ss-931002 merge.
-
-Sun Oct 10 09:11:52 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * Makefile.in: Remove references to chill.in and
- ch-hash.h. Remove bogus cc1chil : chill
- dependency.
-
-Fri Oct 8 16:00:04 1993 Bill Cox (bill@cygnus.com)
-
- * ch-actions.c (adjust_parm_or_field): Add parameter to
- decl_temp1 call.
- *ch-decl.c (decl_tasking_code_var): Replace do_decl call with
- decl_temp1 call.
- (decl_temp1): Add parameter to signal 'make this external'.
- (shadow_record_fields): Add parameter to decl_temp1 call.
- * ch-expr.c (chill_expand_case_expr): Add parameter
- to decl_temp1 call.
- * ch-grant.c (chill_finish_compile): Add code to spoof
- get_file_function_name, so we don't get __tmp_s1_code,
- for example, as the module-level code's name.
- * ch-loop.c (build_temporary_variable, begin_for_range,
- init_loop_counter): Add parameter to decl_temp1 call.
- * ch-parse.y (quasi_signaldef): Clear quasi_signal flag here,
- for easier maintenance.
- (sendaction): Rewrite to receive SIGNALNAME token correctly
- from ch-lex.l (name_type_signal).
- (signaldef): Don't clear quasi_signal here.
- * ch-tasking.c (generate_tasking_code_variable): Tell decl_temp1
- to make the variable public (visible to linker).
- (build_start_process): Add parameter to decl_temp1 call.
- (tasking_setup): Comment out band-aid hack which calls
- generate_tasking_code_variable. Shouldn't be necessary.
- Use null_pointer_node rather than integer_zero_node in
- entry_point. More rewrites.
- (build_signal_descriptor): Name the non-signal in the error msg.
- Rewrite the building of the signal envelope - avoid seg fault.
- Add parameter to decl_temp1 call.
- (expand_send_signal, build_receive_case_start,
- build_receive_case_end, build_buffer_descriptor): Add parameter
- to decl_temp1 call.
- * ch-tree.h: Add parameter to decl_temp1 proto.
- * chill: Add new CHILL frontend directory
-
-Tue Oct 5 13:51:27 1993 Bill Cox (bill@cygnus.com)
-
- * ch-grant.c: Standardize indentation.
- * ch-parse.y (end_function): Unconditionally poplevel for processes.
- * ch-tasking.c (build_process_header): Unconditionally pushlevel.
- (generate_tasking_code_variable): Stop using pass number to
- force a one-time action.
- * ch-tree.h (build_chill_slice): Delete proto since function went static.
-
-Mon Oct 4 13:52:36 1993 Bill Cox (bill@cygnus.com)
-
- * ch-decl.c (decl_tasking_code_var): Use do_decl, since we're
- called here in both passes. Set DECL_ASSEMBLER_NAME.
- (lookup_name_for_seizing): Move NULL test forward to prevent
- seg fault.
- * ch-expr.c (finish_chill_binary_op): Mode access to TREE_CODE
- to prevent a seg fault in telebras/dynsto.ch. Make indentation
- changes.
- * ch-tasking.c (build_signal_struct): Rename to build_signal_struct_type.
- (build_send_signal): Rename to expand_send_signal.
- (generate_tasking_code_variable): Return the var's decl.
- (build_signal_struct_type): Move generate_tasking_code_variable
- and add_taskstuff_to_list calls to ..
- * ch-parse.y (sigdef): .. here. And make indentation changes.
- * ch-tree.h: Rename functions, add return values.
-
-Mon Oct 4 15:43:56 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * ch-convert.c (digest_constructor): Convert element to element_type.
- * ch-parse.y (end_function): Use DECL_ARGUMENTS to check
- for parameterless process.
-
-Fri Oct 1 13:57:30 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * ch-typeck.c (chill_location): New function.
- Based on lvalue_p, but also handle Chill-specific VARY_ARRAY_REF.
- * ch-typeck.c, ch-tree.h (CH_LOCATION_P), ch-convert.c: Use
- chill_location instead of lvalue_p.
-
-
-Fri Oct 1 11:28:42 1993 Bill Cox (bill@cygnus.com)
-
- * ch-convert.c (convert): Back out Michael's changes, unintentionally
- checked in.
- * ch-lex.l (handle_use_seizefile_directive): No longer downcase
- seize file names.
- * ch-parse.y (sendaction): Fix a couple of seg faults. Comment out
- SEND BUFFER processing for now.
- * ch-tree.h: Fix comment.
-
-Thu Sep 30 17:00:42 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * ch-tree.h (CH_CHARS_ONE_P, CH_BOOLS_ONE_P): New macros,
- for recognizing singleton strings.
- * ch-tree.h (MARK_AS_STRING_TYPE): New macro.
- * ch-tree.c (build_string_type, build_bitstring_type),
- ch-convert.c (convert): Use it.
- * ch-typeck.c (build_chill_slice): Take length rather than upper
- bound. This makes it easier to recognize that A(X UP LENGTH)
- really has fixed length. Also, if the argument is string,
- mark the slice as a string too. Also, handle varying strings.
-
- * ch-typeck.c (conflate_singleton_strings): New global.
- * ch-typeck.c (chill_similar): If conflate_singleton_strings is
- set (as it currently is), allow CHARS(1)/BOOLS(1) to be similar
- to CHAR/BOOL, as required by the 1984 version of Z.200.
- * ch-convert.c (convert_to_char): Convert CHARS(1) to CHAR.
- * ch-convert.c ( build_array_type_for_scalar): If input is string,
- so is output.
- * ch-convert (maybe_turn_scalar_into_arra), ch-tree.h: Removed.
- * ch-convert.c (convert): Convert CHAR to CHARS(1).
-
- This fixes 'X // := Y' and is also a general simplification.
- * ch-actions.c (chill_expand_assignment): Convert 'LHS OP := RHS'
- to 'LHS := LHS OP RHS' (using stabilize_reference on LHS).
- Also, call save_expr on RHS if a multiple assignment.
- * ch-parse.y (assignaction): Therefore, no longer need to call
- stabilize_reference on RHS.
- * ch-typeck.c (build_chill_modify_expr), ch-tree.h: Remove
- modifycode parameter. Make it the caller's responsibility to
- handle <assigning operator>.
- * ch-actions.c, ch-decl.c, ch-except.c, ch-expr.c, ch-grant.c,
- ch-loop.c: Fix calls to build_chill_modify_expr accordingly.
-
-Wed Sep 29 18:02:55 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * ch-lang.c (string_index_type_dummy), ch-tree.h: New variable.
- * ch-decl.c (integer_minus_one_node), ch-tree.h: New variable.
-
- * ch-parse.y (arrayindex: modename): Remove useless code.
- * ch-satisfy.c (satisfy): Don't gag on string_index_type_dummy,
- * ch-tree.c (build_string_type): Pass string_index_type_dummy as
- the parent type of the index range.
- * ch-typeck.c (layout_chill_range_type): Recognize and handle
- string_index_type_dummy - specifically allow an empty range.
-
-Wed Sep 29 13:36:23 1993 1993 Bill Cox (bill@cygnus.com)
-
- * ch-convert.c (convert_to_reference): Check for loc-identity
- mismatches correctly (and remove one of those chill_compatible
- calls).
- * ch-decl.c (decl_tasking_code_var): New function, called from
- push_extern_process and push_extern_signal.
- * ch-parse.y (end_function): Delete parameter. Check current_function_decl
- whether it's actually a process, and whether it has parameters.
- Make Michael's change simplifying the pass 2 test, preventing a seg
- fault.
- (procedure, process): Change calls to end_function, remove
- code saving value from build_process_header. Delete redundant chill_
- phrases from some function calls.
- * ch-tasking.c: Remove some redundant _chill phrases from function
- names.
- * ch-tree.h: Remove some redundant _chill phrases from function
- names. Add the CH_VARYING_ARRAY_TYPE macro, call it from
- all relevant places.
- * ch-typeck.c: Use the new macro. Cast TREE_CODEs to chill_tree_code.
-
-Wed Sep 29 13:07:43 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * ch-convert.c (convert_to_reference): Remove redundancies.
- * ch-convert.c (convert): Handle convert_to_reference
- with a recursive convert call.
- * ch-decl.c (do_decl): Add missing compatibility-checking
- of initializer (don't depend on convert).
-
-Tue Sep 28 00:02:25 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * ch-tree.h (CH_LOCATION_P): New macro.
- * ch-typeck.c (layout_chill_range_type): Fix call to
- type_for_size, when figuring out a defaulted parent type.
- * ch-expr.c (build_chill_lower, build_chill_sizeof): Check
- for TREE_CODE_CLASS != 't' rather than == 'd'.
- * ch-expr.c (build_chill_function_call): Use CH_LOCATION_P
- to check for location, rather than TYPE_CODE_CLASS == 'd'.
-
- * ch-tree.c (build_string_type): Make 2-pass safe. Also,
- change parameter to be length, not index type.
- * ch-parse.y (mode2), ch-expr.c (build_concat_expr), ch-lex.l
- (build_chill_string): Modify callers of build_string_type accordingly.
- * ch-lex.l (check_newline): Don't look for # directive inside a
- C-style comment.
- * ch-grant.c (grant_array_type): Make more robust for char-
- and bit-strings (allow non-constant sizes). Change parameters
- and return types. (raw_decode_mode): Use grant_array_type
- for bitstrings. (otherwise): Fix grant_array_type callers.
-
-Mon Sep 27 16:57:57 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- Remove changes of Sep 15.
- * ch-tree.h (CH_SINGLETON_DOMAIN): Removed.
- * ch-typeck.c (chill_similar): Don't allow a singleton
- powerset to be similar to its domain.
- * ch-convert.c (convert_to_boolean): Don't convert a singleton
- SET_TYPE constructor to a Boolean.
-
- * ch-actions.c (chill_expand_assignment): Handle IN_EXPR on
- LHS of assignment, which is what we're current (temporarily?) using.
-
-Mon Sep 27 06:01:57 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-actions.c, ch-convert.c, ch-decl.c, ch-expr.c,
- ch-grant.c, ch-inout.c, ch-parse.y, ch-satisfy.c,
- ch-tasking.c, ch-tree.c, ch-tree.h, ch-typeck.c:
- -Wall cleanup. Add prototypes where missing.
- Delete unused variables. Cast uses of tree_codes
- to chill_tree_code, which they are.
-
-Sun Sep 26 13:09:57 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-decl.c (do_decl): Save initializer in pass zero
- case also.
- * ch-lex.l: Fix comments, indentation.
- * ch-parse.y: Standardize error messages to use
- uppercase for CHILL keywords rather than quoting them.
- Suggestion from docs department.
- * ch-tasking.c: Pervasive changes to get processes to
- compile and START.
- * ch-tree.h: Delete prototypes for functions whic
- I made static inside ch-tasking.c.
-
-Sun Sep 26 02:40:02 1993 Michael Tiemann (tiemann@blues.cygnus.com)
-
- * ch-lex.l (yywrap): Call `check_newline' in case the file
- started with a line directive.
-
-Sat Sep 25 13:54:41 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * ch-decl.c: Expand pre-amble comment.
- * ch-decl.c (struct scope, push_module): Use new field
- tail_chain_module to build child-module list in order.
- (Just to make compiler debugging a little less confusing.)
-
- * ch-decl.c (struct scope): New field weak_decls.
- * ch-decl.c (find_implied_types): New interface. Now pre-pend
- new enum types to a given input list. This makes it easier to
- avoid duplicates, which should at least be more efficient.
- Also, handle FUNCTION_DECL.
- * ch-decl.c (bind_saved_names): Removed. Distribute its
- functionality over new functions (push_scope_decls, pop_scope_decls,
- build_implied_names, bind_sub_modules). The goal (which seems to
- have been more-or-less attained) was to fix weak name handling.
- * ch-decl.c (poplevel): Use new function pop_scope_decls.
-
- * ch-tasking.c (build_signal_struct, build_tasking_message_type):
- Use build_decl directly, rather than grok_chill_fixedfields
- (which depends on ignore_exprs and has more overhead).
- * ch-tasking.c (build_signal_struct): Construct the type
- only in pass 1.
- * ch-typeck.c (build_chill_slice): Use my_build_array_ref rather
- than build_array_ref (which does C-specific "optimizations").
- (Hence move my_build_array_ref up earlier in the file.)
-
-Sat Sep 25 03:47:28 1993 Michael Tiemann (tiemann@blues.cygnus.com)
-
- * ch-tasking.c: Declare static variable `void_ftype_void'.
- (chill_tasking_init): Initialize `void_ftype_void' here.
- (build_tasking_struct): Use, don't declare `void_ftype_void'.
- (generate_tasking_code_variable): Call `do_decl', not
- `decl_temp1' to declare TASKING_CODE_NAME.
- (tasking_setup): Drop into 1-pass mode so that all
- tasking-related declarations are installed in the global
- scope. Use correct CHILL types for initializers (since
- ptr_type_node doesn't have the right meaning for CHILL).
- Also, call `do_decl' instead of `decl_temp1' for
- `init_struct'.
- (add_taskstuff_to_list): Set TASKING_LIST in pass 1 to keep
- `chill_finish_compile' in sync between passes.
-
- * ch-decl.c (do_decl): Set DECL_ASSEMBLER_NAME for
- declarations on pass zero. Keep obstacks in sync, and always
- call `finish_decl' for pass zero declarations.
- (push_chill_extern_function): Keep obstacks in sync, and always
- call `finish_decl' for pass zero declarations.
- (build_enumerator): Ditto.
- (grok_chill_variantdefs): Change PASS test to exclude only
- pass one.
- (finish_struct): Ditto.
- * ch-expr.c (build_chill_component_ref): Ditto.
- (build_chill_binary_op): Ditto.
- * ch-tree.c (build_powerset_type): Ditto.
- (build_bitstring_type): Ditto.
- * ch-typeck.c (build_chill_range_type): Ditto.
- (build_chill_struct_type): Ditto.
-
- * ch-decl.c (build_chill_exception_decl): Clarify reasons for
- extra pushing and popping of obstacks.
-
- * ch-inout.c (build_chill_io_list_type): Call `satisfy_decl'
- on IO_DESCRIPTOR. This causes IO_DESCRIPTOR to be laid out.
-
- * ch-grant.c (chill_finish_compile): Clear out both
- MODULE_INIT_LIST and TASKING_LIST if either contains stuff
- from pass one.
-
- * ch-parse.y (rccase_label): Add NAME rules so that pass one
- works w/o knowing we're parsing a signal. Simplify SIGNALNAME
- rules since we only get SIGNALNAME tokens in pass two.
- (sendaction): Ditto.
- * ch-lex.l (name_type_signal): Enable returning SIGNALNAME and
- BUFFERNAME on pass two. The grammar now handles this.
- * ch-decl.c (lookup_remembered_decl): Deleted.
-
-Fri Sep 24 15:27:13 1993 Bill Cox (bill@cygnus.com)
-
- * ch-decl.c (lookup_remembered_names): Removed. It was being
- misused in ch-lex.l.
- * ch-lex.l (name_type_signal): Revert last change. Basically,
- we cannot use the C typedef/variable name trick in CHILL, due
- due to the language's 2-pass nature.
- * ch-parse.y (arrayindex): Rewrite for correctness, and to avoid
- a seg fault.
- * ch-tree.h (lookup_remembered_name): Comment out the prototype.
-
-Fri Sep 24 11:01:31 1993 Michael Tiemann (tiemann@blues.cygnus.com)
-
- * ch-decl.c (do_decl, push_chill_extern_function): Change pass
- checks so the pass == 0 case is handled for built-in types.
- (push_modedef): Add check for error_mark_node.
- (lookup_remembered_decl): New function.
- (pushlevel, poplevel) Change pass checks.
- (pushdecl): Check type as well for NULL.
- (build_enumerator): Handle pass == 0 case.
- * ch-lex.l: Use lookup_remembered_decl to get lastiddecl
- during pass 1.
- * ch-parse.y: Set pass to zero to indicate initial decl processing.
- Replace NAME references with SIGNALNAME references.
- (startaction): Only check copy number if not ignoring actions.
- Always call build_chill_start_process.
- (optstartset): Don't lookup the instance name.
- * ch-tasking.c (generate_tasking_code_variable): Replace
- do_decl call with decl_temp1 call.
- (build_chill_start_action): Check for ignore_actions here.
- (build_tasking_message_type): Layout the type.
- (rc_state_type): New structure to keep nested receive-case
- info in.
- (build_chill_receive_case_start, build_chill_receive_case_end):
- Use the new struct.
-
-
-Fri Sep 24 04:19:15 1993 Michael Tiemann (tiemann@blues.cygnus.com)
-
- * ch-tasking.c (build_chill_receive_case_start): `namedecl'
- should be a _DECL, not an IDENTIFIER_NODE.
-
-Thu Sep 23 18:18:24 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * ch-decl.c (find_implied_types): Handle VAR_DECLs.
-
- * ch-decl.c (print_lang_identifier): Print IDENTIFIER_OUTER_VALUE.
- * ch-actions.c (chill_expand_result): Allow value-less RETURN.
- * ch-expr.c (resolve_component_ref): Recognize error_mark.
-
- * ch-convert.c (digest_constructor): Handle a nested powerset tuple.
- * ch-satisfy.c (satisfy): Use return value of layout_chill_range_type.
- * ch-typeck.c (chill_similar): Repeatedly get parent modes
- of ranges, not just once.
- * ch-typeck.c (chill_root_resulting_mode), ch-tree.h: New function.
- * ch-typeck.c (layout_chill_rang_type): Re-do type-checking
- to follow Blue Book better (check for Compatibility).
-
- * ch-tree.h (CH_ROOT_RESULTING_MODE): New macro.
- * ch-lex.l (use_seizefile_name, current_seizefile_name), ch-tree.h:
- New variables. The latter replaces in_seizefile.
-
- Changes to store in the new DECL_SEIZEFILE field each seize
- ALIAS_DECL the name in the most recent use_seize_file directive.
- (This requires that use_seize_file directives written to the
- grant file be written before the SEIZEs that need it.)
- Allow clashing declarations granted into the global scope
- (produce a warning), but remember the seizefile case from
- (using the DECL_SEIZEFILE field of the grant ALIAS_DECL).
- The a SEIZE will select the granted decl that matches its
- DECL_SEIZEFILE (in other words: grants from the most recent
- use_seize_file will be preferred).
- * ch-tree.h (DECL_SEIZEFILE), ch-tree.def: New macro.
- * ch-tree.h (global_value, IDENTIFIER_GLOBAL_VALUE): Renamed
- to outer_value, IDENTIFIER_OUTER_VALUE.
- Changes to cause the use_seize_file directives to be written
- out in order as they're seen in source.
- * ch-lex.l (files_to_seize, next_file_to_seize, last_file_to_seize):
- Changed to have type TREE_LIST of pointer to IDENTIFIER_NODE.
- * ch-lex.l (handle_use_seizefile_directive): Modify appropriately.
- Don't call grant_use_seizefile.
- * ch-lex.l (mark_use_seizefile_written): New function.
- * ch-grant.c (decode_decl): Write out use_seize_file directive,
- if needed, before writing a seize declarations.
- * ch-decl.c (pop_module): Handle decls granted into the global
- module specially, setting IDENTIFIER_OUTER_VALUE.
- * ch-decl.c (lookup_name_for_seizing): Check IDENTIFIER_OUTER_VALUE.
-
-Thu Sep 23 19:05:37 1993 Bill Cox (bill@cygnus.com)
-
- * ch-decl.c (push_chill_extern_process): Delete unused variables,
- declare the process' tasking_code variable as external.
- * ch-parse.y (process): Force ignore_exprs to FALSE while parsing
- the process header.
- * ch-tasking.c (sigdef): Move resetting of quasi_signal from here
- to (signaldef).
- * ch-tree.h: Add prototype.
- * expr.c (store_constructor): Emergency first-aid. Rewrite later.
-
-Thu Sep 23 12:57:53 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * ch-expr.c (build_chill_function_call): Move possible call to
- chill_start_module_code until we know we're not calling a builtin.
- * ch-decl.c (save_expr_under_name): Use pushdecllist,
- not proclaim_decl (which provide for popping the decl).
- * ch-parse.y (optname): Also allow TYPENAME.
-
-Thu Sep 23 09:18:35 1993 Bill Cox (bill@cygnus.com)
-
- * ch-decl.c (print_lang_decl): Make weak name output more standard.
- (print_lang_identifier): Make signal-data flag output more standard.
- (push_chill_extern_process): Pass correct arg tree to
- push_chill_extern_function.
- (push_syn_decls, fixup_unknown_type, chill_modes_equiv):
- Standardize function header layouts (Makes the tcov script
- work better).
- * ch-except.c (chill_finish_on): Standardize function header.
- * ch-expr.c (fold_set_or): Standardize function header.
- * ch-grant.c (print_proc_tail, print_proc_exceptions): Standardize
- function headers.
- (decode_constant): Make sure that alpha operators are surrounded
- with whitespace.
- * ch-parse.y: Spell Z.200 correctly in comments.
-
-Wed Sep 22 10:42:31 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * ch-expr.c (build_chill_addr_expr), ch-tree.h: New function.
- * ch-parse.y, ch-decl.c (shadow_record_fields): Use it.
- * ch-lex.l (handle_use_seizefile_directive): Don't emit
- use_seize_file directive if in_seizefile.
-
- * ch-convert.c (digest_structure_tuple): Fix code that checks
- for excess init values.
- * ch-decl.c (layout_chill_variants): Move increment of nlabels
- inside the proper loop.
- * ch-grant.c (print_struct): Add missing loop for tag_list.
- (print_struct): Look for variant fields by checking for a
- UNION_TYPE, not a NULL name, since we must use a dummy name.
- * ch-parse.y (structured_variable): Various fixing.
- * ch-decl.c (shadow_record_fields): Rename arg decl -> struct_val.
-
- * ch-satisfy.c (safe_satisfy_decl): Disable copying of modes
- for NEWMODE (and hence novelty checking), until we figure out
- a better way.
-
- * ch-except.c (finish_handler_array): Use null_pointer_node,
- not integer_zero_node (which fails to type-check).
-
- * c-typeck.c (get_constructor_element_type): New function.
- * ch-tree.h (CH_NOVELTY_FLAG): Now also used in TYPE_DECLs.
- (CH_NOVELTY): Redefined to call new function chill_novelty.
- (CH_CLASS_IS_XXX, TYPE_NEWMODE, CH_CLASS_MODE): Removed.
- * ch-typeck.c (classify_chill_expr renamed to chill_expr_class):
- Take extra output parameter (for M, as in M-value class).
- * ch-typeck.c (chill_novelty): New function. (Also de-references.)
-
- * ch-expr.c (resolve_component_ref, build_chill_component_ref):
- New functions. Handle 2-pass and variant records.
- * ch-parse.y (primval DOT name): Use instead of build_component_ref.
- * ch-satisfy.c (satisfy, case COMPONENT_REF):
- New case, call resolve_component_ref.
-
- * ch-expr.c (build_generalized_call): Extract single arg from
- arg list before calling build_chill_cast.
-
- * ch-parse.y (defining_occurrence_list): New non-terminal.
- Use it to replace locnamelist, synnames, and modenames.
- * ch-parse.y: Re-write parsing of variant records.
-
- * ch-decl.c (grok_chill_variantdefs): Now return a FIELD_DECL
- rather than just its type.
- * ch-inout.c (build_chill_io_list_type), ch-parse.y:
- Change callers appropriately.
-
- * ch-tree.h (TYPE_TAG_VALUES): Add an extra level of TREE_LIST,
- to support multiple tag fields.
- * ch-grant.c (print_struct), ch-decl.c (layout_chill_variants):
- Support multiple tag fields.
-
- * ch-convert.c (remove_tree_element, digest_structure_tuple):
- New functions, to digest structure tuples, without calling the
- code in c-typeck.c. Handles variant tuples and tags (partially).
- * ch-convert.c (digest_constructor, convert): Call
- digest_structure_tuple when appropriate.
- * ch-convert.c (digest_constructor): Re-arrange a bit.
-
- * ch-decl.c (push_modedef): Defer copying of tree until ...
- * ch-satisfy (safe_satisfy_decl): ... here.
-
- * ch-decl.c (getdecls): Add kludge to help dbxout_init.
-
-Tue Sep 21 14:19:11 1993 Bill Cox (bill@cygnus.com)
-
- Partial tasking update - not done yet.
- * ch-actions.c: Comments, indentation.
- * ch-decl.c (push_chill_extern_process): No longer need to
- reformat the arg list for make_process_struct.
- (pop_module): Don't seg fault on null DECL_NAME.
- (handle_one_level): Error, not warning if tree not recognized.
- (shadow_record_fields): Rename formal param for readability.
- * ch-grant.c (decode_decl): Write proper header for a process.
- * ch-parse.y (quasi_pdef): process now uses processparlist,
- which doesn't change with the passes.
- (quasi_locdec): Call build_chill_reference_type to defer
- doing the type's layout.
- (processpar): Use paramnamelist, but reformat it into a
- list of identifiers in pass 2, so a processpar is the same
- structure in both passes.
- (locdec): Call build_chill_reference_type to defer doing the
- type's layout.
- * ch-tasking.c (generate_tasking_code_variable): Call do_decl to
- build the decl. Only update the variable's tree in pass 2.
- (make_process_struct): Call build_chill_reference_type to defer
- doing the type's layout.
- (build_process_header): New code to call make_process_struct.
- New pass-2 code to make a PARM_DECL for start_chill_function.
- Pass a void_type_node, not a NULL_TREE for an empty list.
- Get input for shadow_record_fields from current_function_decl.
- (build_buffer_decl): Call do_decl not decl_temp1.
- * ch-typeck.c: Reindent to standards.
- * gcc.c (SPECS): Add recognition for the '.chi' CHILL suffix.
-
-Mon Sep 20 12:00:24 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * ch-typeck.c (classify_chill_expr): An expression with a
- REFERENCE_TYPE still has VALUE class, even if an ADDR_EXPR.
- * ch-actions.c (adjust_parm_or_field):, ch-tree.h: Change last
- parameter, so we can reliably recognize LOC parameters.
- * ch-tasking.c, ch-expr.c: Change callers appropriately.
-
-Sun Sep 19 22:26:25 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * ch-tree.h (CH_READ_COMPATIBLE, CH_REFERABLE): New macros.
- * ch-typeck.c (chill_referable, chill_read_compatible): New functions.
- * ch-typeck.c (chill_compatible): Allow un-resolved CONSTRUCTOR
- (with NULL TREE_TYPE), when reasonable. (Simplifies callers.)
- Also, handle case of expr being of reference class.
- * ch-actions.c (adjust_parm_or_field): Major re-arrange
- to handle conversions and LOC args better.
- * ch-actions.c (chill_expand_assignment): Simplify conversions.
- * ch-expr.c (build_chill_function_call): If needed, call
- chill_start_module_code.
- * ch-decl.c (declare_predefined_file): New function, used
- to pre-define stdin, stdout, and stderr.
- * ch-inout.c (chill_stdio_p): Change names of predefined
- files from chill-stdin etc to plain stdin (and change their types).
- * ch-lex.l: Remove some obsolete stuff.
- * ch-convert.c (convert): Move conversion from reference to
- to beginning of convert() so other conversion can work better.
- Also, remove bogus direct setting of TREE_TYPE.
-
-Fri Sep 10 12:23:41 1993 Wilfried Moser (fs_moser@cygnus.com)
-
- * Makefile.in: Change installation of the chill script. gcc will
- be called always with the full path. That made problems when
- somebody was using chill but didn't have the installation
- directory in PATH.
- * ch-parse.y: Change parsing of WRITETEXT action.
- * ch-tree.h: Add some new prototypes according to the
- (partial) implementation of WRITETEXT.
- * ch-typeck.c: Add new function chill_varying_string_type_p. This
- functions checks a type for being CHAR(n) VARYING.
- * ch-decl.c (init_decl_processing): Add new built-in functions
- _writestring and _writeunixstd.
- Add call to build_chill_io_list_type in ch-inout.c.
- * ch-inout.c (build_chill_writetext): Add some code there.
- Add new function build_chill_io_list_type.
- Add new static function chill_stdio_p. This function checks
- the text argument for being chill_stdin, chill_stdout or
- chill_stderr.
-
-Fri Sep 17 22:02:04 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * ch-decl.c (push_modedef): Fix TYPE_MAIN_VARIANT thinko.
-
-Thu Sep 16 18:38:53 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * ch-decl.c (allocate_lang_decl): Do nothing.
- * ch-tree.h (struct lang_decl, DECL_GRANT_FILE, DECL_SEIZE_FILE):
- No longer used; remove.
-
- * ch-tree.h (TYPE_TAG_FIELD renamed to TYPE_TAGFIELDS), ch-grant.c
- (print_struct), ch-parse.y (opttagfield -> opttagfields), ch-decl.c
- (make_chill_variants, layout_chill_variants): Add (initial) part
- of support for multiple tags.
- * ch-decl.c (lookup_tag_fields): New function.
- * ch-parse.y (stmt_count): Not used; removed.
- * ch-parse.y (mode2): Clear current_fieldlist before
- parsing STRUCT fields; restore afterwards.
-
- * ch-parse.y (push_action): Moved to ch-actions.c.
-
-Wed Sep 15 18:19:37 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-convert.c (convert_to_boolean): Convert a SET_TYPE
- constructor to a boolean.
-
-Wed Sep 15 17:52:10 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-decl.c (push_modedef): Enable novelty-setting code.
- * ch-tree.h (CH_SINGLETON_DOMAIN): New macro.
- * ch-typeck.c (chill_similar): Add checking of singleton
- powerset against its base type.
-
-Tue Sep 14 17:11:52 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-actions.c (adjust_parm_or_field): Create a
- temporary for an non-referencable actual parameter
- passed to a LOC formal parameter.
- (chill_expand_assignment): Correct compatibility checking.
-
- * ch-decl.c (push_modedef): Set up a type's NOVELTY value.
- * ch-parse.y (opsigdest): Only check for process name
- in pass 2, when we know.
- * ch-tree.h (CH_NOVELTY_FLAG, CH_NOVELTY): Define.
- * ch-typeck.c: Fix comment.
-
-Mon Sep 13 17:33:11 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * ch-grant.c (lookup_decl_in_process, register_decl_as_output,
- decl_seen_p, processed_decls, allocated, nr_decls): Removed
- no-longer-useful functions and variables that used to guard
- against writing a decl multiple times. Since we now just
- go through the decl list linearly, that is no longer an issue.
- * ch-satisfy.c (safe_satisfy_decl): Handle missing current_module.
-
- * ch-decl.c (start_chill_function): Clear DECL_ASSEMBLER_NAME.
- Don't make TREE_PUBLIC. Don't generate rtl yet.
- * ch-decl.c (pop_module): If a decl is granted, set TREE_PUBLIC,
- and its DECL_ASSEMBLER_NAME.
- * ch-decl.c (fix_identifier): New function.
- * ch-grant.c (grant_one_decl): Don't set TREE_PUBLIC.
- * ch-tree.h (struct module): New field prefix_name.
- * ch-satisfy.c (safe_satisfy_decl): If assembler_name isn't
- set, prefix it by the module name(s).
- * ch-satisfy.c (safe_satisfy_decl, case FUNCTION_DECL):
- Call make_function_rtl if needed and !LOOKUP_ONLY.
- * ch-typeck.c (chill_similar): Flesh out substantially.
- * ch-typeck.c (chill_compatible): Re-structure.
-
- * ch-actions.c (adjust_parm_or_field): Use CH_COMPATIBLE
- instead of chill_comptypes to compare actual and formal.
-
-Sun Sep 12 21:10:10 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * ch-parse.y (labellist): Don't do anything if ignore_exprs.
-
- * c-typeck.c (output_pending_init_elements): Handle
- !constructor_incremental case of filling in empty positions.
- (Patch by Jim Wilson. CYGNUS LOCAL until we have approval.)
- * ch-decl.c (pop_module): Don't grant a seized name.
- * ch-grant.c (decode_constant): Support CALL_EXPR.
- * ch-tree.c (build_bitstring_type): Don't try to fold non-constant
- size if pass==1 (since it may be an unsatisfied name).
-
-
-Sun Sep 12 18:06:23 1993 Bill Cox (bill@rtl.cygnus.com)
-
- 2-pass fixes for processes. Partially done.
- * ch-actions.c (chill_expand_assignment): Add real
- novelty-checking sketch, $ifdef'd out for now.
- * ch-decl.c: Generally fix indentation. Move tasking
- init code from init_decl_processing to ch-tasking.c.
- Delete ObjC-related cruft. More accurate parameter name
- for shadow_record_fields. Move debug_scope before
- its first call.
- * ch-expr.c (build_chill_function_call): Return if not
- pass 2.
- * ch-grant.c (print_proc_tail): Avoid trying to format
- a VOID return type, or using a NULL pointer.
- (decode_decl): Minor changes for PROCESS arg access.
- * ch-lang.c (lang_decode_option): Use -itu flag to
- enable 'pedantic' mode.
- * ch-lex.l (init_lex): Initialize compiler-directive
- variable trees.
- (name_type-signal): Disable the returning of SIGNAL and BUFFER
- name tokens.
- * ch-parse.y (rccase_label_flag): Renamed from rccase_ifs.
- All uses renamed also.
- (end_function): Always poplevel, not just in pass 2.
- (quasi_pdef): Check for end-label matching.
- (quasi_formparlist): Write more clearly.
- (rcaltlist, optelsercvcase, optstartset): Add ignore_actions
- guards.
- (rccase_label, sendaction): Use NAME, not SIGNALNAME
- or BUFFERNAME.
- (process): Handle like procedure.
- (mode): Add SIGNAL as a generic signal parameter. This
- is a client-specific extension, so pedantic is checked.
- * ch-tasking.c: Pervasive rewrites for 2-pass. Still not done.
- * ch-tree.h (CH_NOVELTY): Make it an lvalue.
- * ch-typeck.c: Fix comment.
-
-Sun Sep 12 15:03:21 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * c-typeck.c (digest_init): Compare types using comptypes
- instead of comparing pointers. (Helps Chill front end.)
- * ch-expr.c (finish_chill_binary_op):
- * ch-typeck.c (build_chill_array_ref, build_chill_bitref),
- ch-expr.c (finish_chill_binary_op): For now, prefer IN_EXPR
- over BIT_FIELD_REF because of various problems with BIT_FIELD_REF
- (incomplete support for variable fields, and possible bug in
- optimize_bit_field_compare).
- * ch-expr.c (finish_chill_binary_op): Fix type-checking
- and appropriately coerce operands for IN_EXPR and comparsions.
- * expr.c (expand_expr, case ARRAY_REF): Coerce lower bound (if
- non-zero) to sizetype before subtraction.
- * expr.c (expand_expr): Remove Chills-specific calls to
- __inpowerset from case BIT_FIELD_REF to case IN_EXPR.
-
-Fri Sep 10 15:47:52 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * ch-tree.def (UNDEFINED_EXPR): New kind of expression.
- * ch-grant.c (decode_constant), ch-expr.c (chill_expand_expr),
- ch-convert.c (convert): Handle UNDEFINED_EXPR.
-
- * ch-expr.c (build_char_array_expr): Move CONCAT_EXPR support to ...
- * ch-expr.c (build_concat_expr): ... here.
- Now also folds concatenation of STRING_CST and UNDEFINED_EXPR.
- Also, make result varying only if one of the operands are.
-
- * ch-expr.c (build_chill_binary_op): Move stuff from here to ...
- * ch-expr.c (finish_chill_binary_op): ... here, as needed for
- proper 2-pass split. Also, clean up and simplify heavily.
-
- * ch-tree.h (enum ch_expr_class): The 5 kinds of expression classes.
- * ch-typeck.c (classify_chill_expr): New function: Determine
- class of expression.
- * ch-typeck.c (chill_compatible_classes): Re-structure; fix
- asymmetry bugs.
- * ch-tree.h (CH_CLASS_IS_XXX): Re-define to use classify_chill_expr.
-
- * ch-convert.c (maybe_turn_scalar_into_array): Complain
- unless scalar is a char constant (and we want a string).
- * ch-convert.c (convert): New code for converting to variable
- string/array. Avoid type errors by padding (with an UNDFIEND_EXPR).
- * ch-typeck.c (chill_expand_tuple): Don't do conversion to
- varying type here; that is handled by convert now.
- * ch-decl.c (digest_constructor): Moved to ...
- * ch-convert.c (digest_constructor): ... here.
- * ch-decl.c (do_decl): Simplify; just use convert for initializer.
- * ch-decl.c (chill_digest_init): Merged into convert, and removed.
- * ch-decl.c (init_decl_processing): Set constructor_no_implicit flag.
- * ch-except.c (finish_handler-array), ch-decl.c (finish_decl):
- Replace chill_digest_init by convert.
- * ch-actions.c (chill_expand_array_assignment): Simplify; use convert.
- * ch-lex.l (build_chill_string): Make string type be derived
- from integer, not sizetype, because upper bound can be -1.
-
-Thu Sep 9 18:21:46 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-typeck.c (my_build_array_ref): Delete pedantic
- C-specific error message.
-
-Thu Sep 9 17:44:20 1993 Jeffrey Wheat (cassidy@eclipse.cygnus.com)
-
- * gcc.c: pass {I*} spec to cc1chill. Fixes -Ifoo not working problem.
-
-Thu Sep 9 12:22:22 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * ch-typeck.c (build_chill_array_ref): Remove redundant and
- broken call to my_build_array_ref.
-
-Wed Sep 8 13:03:49 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * ch-except.c (finish_handler_array), ch-decl.c (finish_decl):
- Don't use store_init_value, since it calls digest_init instead
- of chill_digest_init.
- * ch-except.c (finish_handler_array): Use build1 (ADDR_EXPR, ...)
- instead build_unary_op to avoid C-specific optimizations.
- * ch-typeck.c (my_build_array_ref): Don't use default_conversion
- to convert array to pointer.
- * c-typeck.c (process_init_default): New function, to support
- default values for array tuples in Chill.
- * c-typeck.c (default_conversion): Don't convert array to pointer
- if compiling Chill.
- * ch-decl.c (digest_constructor): New function; used to be guts
- of chill_digest_init. Now recursive, to handle nested tuples.
-
- * ch-decl.c (chill_digest_init): Handle struct labels.
- * ch-grant.c (get_tag_value): Use decode_constant in general case.
- * ch-grant.c (decode_constant): Add support for lots of missing
- binary and unary operators.
-
-Wed Sep 8 10:11:04 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-lang.c: Look for '-I' option for seize file path.
- * ch-lex.l: Fix comment about above option.
-
-Wed Sep 8 00:37:32 1993 Per Bothner (bothner@rtl.cygnus.com)
-
- * ch-satisfy.c: Move code to set (and restore) file-and-line
- from satisfy_decl to safe_satisfy_decl, for the sake of satisfying
- alias decls that refer to real decls with errors.
- * ch-actions.c (lang_init): Move to ch-lang.c.
- * ch-decl.c (init_decl_processing): Move code to initialize
- file-and-line from here ...
- * ch-lang.c (lang_init): ... to here, to avoid clobbering.
-
- * ch-decl.c (chill_digest_init): Add support for SET_TYPE,
- and index values.
- * ch-typeck.c (chill_expand_typle): Just call chill_digest_init.
- * c-typeck.c: Fix various things that got broken
- in the latest merge.
-
-Tue Sep 7 15:45:58 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * ch-decl.c (build_enumerator): Handle a "unnamed set element"
- (obsolete feature) by generating a dummy name.
- * ch-decl.c (finish_decl): Call rest_of_decl_compilation with
- "correct" value of top-level (to get better debugging output).
- * ch-decl.c (bind_saved_names): Allow a null DECL_NAME.
-
-Tue Sep 7 15:48:35 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-actions.c (chill_expand_return): Correct breakage
- due to recent fsf merge.
-
-Tue Sep 7 11:16:10 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * .cvsignore: Add multilib.h.
- * ch-decl.c (chill_digest_init): New function. Calls were
- changed, since it has fewer parameters than old digest_init.
- * ch-parse.y (untyped_expr, primval, tupleelement): Calls to
- new init stuff.
- (elementlist): Delete unused code.
- * ch-satisfy.c (safe_satisfy_decl): Just return if decl == NULL.
- * ch-tasking.c (build_tasking_enum): Attempt to adapt to 2-pass.
- * ch-tree.h: Delete digest_init prototype.
- * ch-typeck.c (digest_init): Much new code.
-
-Tue Sep 7 12:06:28 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-decl.c, ch-parse.y, ch-tree.h, ch-typeck.c: Revert
- files to their pre-init-change state.
-
-Mon Sep 6 15:28:27 1993 Bill Cox (bill@rtl.cygnus.com)
-
- Preliminary adaptation to rms' new initializer code.
- * ch-decl.c (do_decl): Call chill_digest_init, not
- digest_init, which rms made static.
- * ch-expr.c (chill_truthvalue_conversion): Delete C-
- specific code.
- * ch-loop.c (init_loop_counter): Indent for readability.
- * ch-parse.y (untyped_expr, primval, tupleelement): Call new init code.
- * ch-tree.h: Prototype changes for new init code.
- * ch-typeck.c (chill_expand_tuple): Call new init code.
- * chill.texi: Add necessary '-f' prefix on options.
-
-Wed Sep 1 13:21:53 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * ch-convert.c (build_array_type_for_scalar),
- ch-tasking.c (build_chill_receive_case_end): Index type
- specification is now chain of types (not chain of TREE_LIST).
- * ch-satisfy.c (satisfy): Don't try to satisfy the
- abstract_origin of an ALIAS_DECL if DECL_POSTFIX_ALL.
- * ch-expr.c (build_chill_binary_op): If pass 1, do NOT
- call finish_chill_binary_op.
- * ch-parse.y (arrayindex): Simplify.
-
-Tue Aug 31 14:57:35 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-decl.c (print_lang_decl): Print weak-name status.
- (print_lang_identifier): Print signal_data as T or F.
- * ch-lex.l (convert_bitstring, convert_charliteral,
- convert_float, convert_number): Pass string directly to convert
- as a parameter. Return token code consistently, return 0
- for error.
- (equal_number): Parse differently, allowing hex, binary
- and octal constants.
- * ch-parse.y (dowithaction, structured_variable): Only
- push/pop scopes once per DO WITH.
- (structured_variable_list): Check ignore_actions flag here.
- * gcc.c: Delete 'traditional' from string, add 'itu'
- as the standard flag's name.
-
-Mon Aug 30 15:12:26 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * ch-typeck.c, ch-tree.h (build_chill_range_type): Take 3
- parameters instead of 2 (explicit low and high bounds).
- * ch-parse.y (arrayindex): Build range type from low:high.
- (rangesize, optrangesize): Removed.
- (where appropriate): Use new build_chill_range_type interface.
- * ch-grant.c: Clean up writing of range and array types.
- * ch-satisfy.c (satisfy): Don't ignore the return value of
- layout_chill_array_type. (It may be an error mark.)
- * ch-typeck.c (build_chill_array_type): Simplify.
- * ch-typeck.c (layout_chill_array_type): Clean up checks.
-
-Fri Aug 27 12:55:59 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * ch-decl.c (decl_temp1): Set DECL_ASSEMBLER_NAME.
- (push_chill_extern_function) Don't set current_function_decl.
- * ch-parse.y (tupleelement): Don't wrap index is a TREE_LIST
- (i.e. a range), don't wrap a PAREN_EXPR around it.
- * ch-grant.c (decode_constant): For tuple CONSTRUCTORs,
- add support for ranges in purpose.
-
-Wed Aug 25 16:58:13 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * .cvsignore: Add g++.sum
- * ch-actions.c (chill_expand_result): Stop building a temp.
- Assign the expression directly into function's DECL_RESULT.
- * ch-decl.c: Add formfeeds.
- (start_chill_function): Don't need to zero DECL_RESULT's pointer any more.
- (push_chill_function_context): Delete C pedwarn message.
- * ch-expr.c: Move builtin functions together.
- * ch-parse.y (end_function): Delete unused code.
- Reformat %union for readability. Delete _MAX and _MIN
- tokens.
-
-Wed Aug 25 13:24:06 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-actions.c (get_result_tmp_name): Delete unused function.
- (chill_expand_result, chill_expand_return): Rewrite for
- 2-pass.
- * ch-decl.c (start_chill_function): NULL out the RESULT_DECL's
- chain field, so we can make a temp, evaluate a RESULT action's
- expression into it, and hang it on here.
- * ch-parse.y (end_function): Look for RESULT temps to emit.
- (assertaction): Indentation.
-
-Wed Aug 25 08:34:36 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-lex.l, ch-parse.y: Delete CONTINUE_EVENT token.
- It wasn't used anyway.
-
-Tue Aug 24 17:51:18 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-actions.c (chill_expand_result, chill_expand_return):
- No need to make a temp for the value, just use DECL_RESULT.
-
-Tue Aug 24 16:38:24 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * ch-tree.c (layout_powerset_type): Remove redundant code.
- Generalize (in error message) to also handle bitstrings.
- * ch-tree.c (build_bitstring_type): Remove all layout-like
- stuff, and defer that to layout_powerset_type.
- * ch-expr.c (chill_expand_expr): For various SET_xxx_EXPRs,
- allocate stack temp for target using correct mode.
-
-Tue Aug 24 10:27:19 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-actions.c, ch-decl.c, ch-except.c,
- ch-grant.c, ch-lang.c, ch-loop.c, ch-tree.h,
- ch-typeck.c: Change build_modify_expr calls to
- build_CHILL_modify_expr calls.
- * ch-expr.c (build_chill_modify_expr): Adapted from
- build_modify_expr in c-typeck.c.
-
-Mon Aug 23 16:48:39 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-actions.c, ch-convert.c, ch-decl.c, ch-expr.c,
- ch-grant.c, ch-lang.c, ch-lex.l, ch-loop.c,
- ch-satisfy.c, ch-tasking.c, ch-tree.c, ch-typeck.c:
- Major re-allocation of functions to files.
-
-Mon Aug 23 12:15:11 1993 Bill Cox (bill@rtl.cygnus.com)
-
- Thanks for the tip, Jim.
- * Makefile.in: Add dependency lines for ch-except.o and
- ch-satisfy.o. Correct dependency lines for ch-convert.o,
- ch-expr.o, ch-inout.o, and ch-loop.o.
- (chill, install-common): Add clean-up commands.
-
-Sat Aug 21 17:11:26 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-decl.c (get_type_precision): New function.
- (layout_enum): Call it.
- * ch-tree.c (layout_powerset_type, build_bitstring_type):
- Call it.
-
-Sat Aug 21 13:59:40 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-decl.c (init_decl_processing): Define setbitpowerset
- runtime function.
- * ch-expr.c (chill_expand_assignment): Call setbitpowerset
- to set a bit.
- * ch-parse.y: Indentation.
-
-Fri Aug 20 17:29:56 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-parse.y: Delete unused %type declaration.
- * ch-tasking.c (build_signal_struct): Delete return, since
- function returns void.
- * ch-typeck.c: Indent to standard.
- * stor-layout.c: Fix comment.
- * toplev.c: Change -L option ti -I.
- * varasm.c (emit_set_data): Align set constant to word
- boundary.
-
-Fri Aug 20 08:20:07 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-actions.c: Fix indentation, comments.
- * ch-decl.c (push_chill_extern_signal): Use same interface
- as build_signal_struct.
- * ch-parse.y (quasi_signaldef): Move build_signal_decl
- here to sigdef. Add quasi_signal to distinguish contexts
- where sigdef gets used.
- * ch-tasking.c: Replace make_signal_struct and build_signal_decl
- with build_signal_decl, which doesn't loop through a
- TREE_LIST.
- * ch-tree.h: Fix protos.
-
-Wed Aug 18 17:36:53 1993 Bill Cox (bill@cygnus.com)
-
- * ch-actions.c: Fix comments.
- * ch-decl.c (push_modedefs): Return the new decl.
- (shadow_record_fields): Move pushlevel (0) calls into
- the grammar, so they'll get done in both passes.
- * ch-parse.y (dowithaction): Always compute & save # of
- 'with' variables seen (both passes), and always pop that
- number of levels.
- (structured_variable_list): Always chain variables into a list.
- (structured_variable): Put pushlevel here (from shadow_record_fields).
- * ch-tasking.c: Indentation fixes.
- * ch-tree.h: Change proto.
- * chill.texi: Add Blue Book section numbers to unimplemented
- features list.
-
-Wed Aug 18 15:48:43 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * ch-actions.c (build_generalized_call): New function.
- Classifies semantically (if pass 2) this that look like calls.
- * ch-parse.y (call): Invoke build_generalized_call.
- * ch-parse.y (sigdef): Use defining_occurrence instead of NAME.
- * ch-parse.y (opt_untyped_exprlist): New non-terminal.
- * ch-satisfy.c (satisfy): Handle CALL_EXPR.
-
-Tue Aug 17 16:36:15 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * ch-decl.c (find_implied_types): Handle INTEGER_TYPEs (ranges).
-
-Mon Aug 16 18:07:36 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * ch-tree.h (TUPLE_NAMED_FIELD): New macro.
- * ch-parse.y (labelled structure tupleelement):
- Set TUPLE_NAMED_FIELD flag.
- * ch-grant.c (decode_constant): Check for TUPLE_NAMED_FLAG.
- * ch-satisfy.c (satisfy): Check for TUPLE_NAMED_FLAG.
- Do satisfy the elements of a CONSTRUCTOR even if call
- chill_expand_tuple isn't correct.
- * ch-satisfy.c (satisfy): Satisfy TYPE_TAG_VALUES of a RECORD_TYPE.
- * ch-parse.y (label_spec): Defer any semantic checking until ...
- * ch-decl.c (layout_chill_variants): ... here.
- Also make sure to call layout_type on the union type.
- * ch-decl.c (bind_saved_names): For weak names, allocate an
- ALIAS_DECL, rather than a CONST_DECL.
-
- Add support for implied (weakly visible) names.
- * ch-tree.h (DECL_WEAK_NAME): New macro.
- * ch-satisfy.c (satisfy of IDENTIFIER_NODE): Don't complain
- if lookup_name fails if LOOKUP_ONLY - name might be weakly visible.
- * ch-decl.c (proclaim_name): Handle DECL_WEAK_NAME appropriately.
- * ch-decl.c (concat_lists, find_implied_types): New functions.
- * ch-decl.c (bind_saved_names): Search for implied names.
- * ch-tree.h (C_DECL_VARIABLE_SIZE): Removed.
- * ch-lang.c (layout_chill_struct_type): Don't use
- C_DECL_VARIABLE_SIZE.
-
-Mon Aug 16 16:10:43 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-actions.c: Delete extra space in error message.
- * ch-parse.y: Fix comment.
- * expr.c (store_constructor): Avoid passing NULL to convert,
- and getting back an error_mark_node and trying to process
- *that* node.
-
-Mon Aug 16 14:41:29 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * ch-decl.c: Add more overview comments.
- * ch-decl.c (proclaim_decl): New function.
- * ch-decl.c (temp_pushdecl, struct shadowing): Removed.
- * ch-decl.c (bind_saved_names): Remove blevel parameter;
- use current_scope global instead. Do some other cleanups.
- * ch-decl.c (save_expr_under_name): Create an ALIAS_DECL.
- * ch-decl.c (pushdecllist, save_expr_under_name): Use proclaim_decl.
- * ch-satisfy.c (satisfy, safe_satisfy_decl): Be more careful
- to not do inappropriate things (e.g. type layout) if LOOKUP_ONLY.
-
- * chill.texi: Start collecting Chill documentation here.
- * ch-parse.y (mode): Ignore READ specifier, for now.
-
-Mon Aug 16 11:13:07 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-actions.c (chill_comptypes): Correct handling reference
- of type 1.
- (build_chill_length, build_chill_num,
- build_chill_sizeof): Convert result to CHILL integer.
- (build_chill_function_call): Clean up INOUT and OUT
- parameter handling.
- * ch-decl.c (build_chill_function_type): Handle INOUT and
- OUT parameters.
- * ch-loop.c: Fix up comments.
- * ch-parse.y: Fix up comments.
-
-Sun Aug 15 15:06:01 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-actions.c (build_chill_lower, build_chill_upper):
- Re-write, mostly to delete bogus ENUMERAL_TYPE handling.
- * ch-decl.c (save_expr_under_name): New function to save
- addressing expressions for DO WITH and DO FOR handling.
- (handle_one_level): Call new function.
- * ch-loop.c (init_loop_counter): Call it here, too.
- Check lp->user_var before passing it to lookup_name.
- (high_domain_value, low_domain_value): Correct call
- to build_chill_upper and build_chill_lower.
- (begin_chill_loop, end_chill_loop): Move pushlevel,
- poplevel up into the grammar, so they're done in both
- passes.
- * ch-parse.y (doaction): Unconditionally make a scope
- for a loop, pop it later.
- (controlpart, iteration): Save return from
- build_chill_iterator.
- * expr.c: Readability changes.
-
-Sat Aug 14 19:42:32 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-expr.c (chill_expand_case_expr): Complete rewrite
- for 2-pass. About 1/2 the size, too.
- * ch-parse.y (actionlabel): Unconditionally do INIT_ACTION.
- This assures that a label preceding a module's first action
- is enclosed in the module-level function that's generated.
-
-Sat Aug 14 14:56:07 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- Re-implement how EXIT is done.
- 'LABEL: BEGIN ... EXIT LABEL; ... END' is converted to
- 'LABEL: BEGIN ... GOTO EXIT!LABEL; ... EXIT!LABEL: ; END'.
- Hence we no longer need any support for EXIT in stmt.c.
- * stmt.c (stamp_nesting_label, expand_exit_labelled): Removed.
- * ch-actions.c (lookup_and_handle_exit): Handle like 'GOTO EXIT!name'.
- * ch-tree.c, ch-tree.h (munge_exit_label): New function.
- * ch-parse.y: Re-write bracked actions to support EXIT new way.
- * ch-decl.c, ch-loop.c: Remove calls to stamp_nesting_level.
- * ch-parse.y: Replace SC by new token semi_colon, which
- resets the 'label' global. Also make sure that label gets
- reset whenever we might start a new action statement.
- * ch-parse.y (possibly_define_exit_label): New function.
-
- * ch-except.c (chill_start_on): Wrap an ADDR_EXPR round the jmpbuf.
- * ch-grant.c (chill_finish_compile): Make sure
- get_file_function_name is only called once.
- * ch-expr.c (chill_expand_array_assignment): Use store_expr,
- instead of incorrectly calling emit_block_move.
-
- * ch-parse.y (procedure): Call push_chill_function_context
- in *both* passes (if nested).
- * ch-parse.y (primval): Call get_type_of before chill_expand_type.
- * ch-parse.y (tupleelement): Only build PAREN_EXPR during pass 1.
-
-Fri Aug 13 16:36:36 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- Re-implement GRANT and SEIZE, to support prefixes and prefix
- rename. All of the Blue Book semantics for these should
- now work (except FORBID).
- * ch-tree.def, ch-tree.h (DECL_OLD_PREFIX, DECL_NEW_PREFIX,
- DECL_POSTFIX, DECL_POSTFIX_ALL): New ALIAS_DECL layout and macros.
- * ch-tree.c (get_identifier3, build_alias_decl, decl_old_name,
- decl_check_rename): New functions.
- * ch-lex.h, ch-lex.l, ch-grant, ... (grant_all_seen): Removed.
- * ch-satisfy.c (satisfy_decl): Handle SYN initialized with tuple.
- * ch-satisfy.c (satisfy_decl): Set DECL_ASSEMBLER_NAME here ...
- * ch-decl.c (pushdecllist): ... instead of here, which is too late.
- * ch-grant.c (decode_prefix_rename): New function.
- Use to print out GRANT and SEIZE statements.
- * ch-decl.c (ALL_POSTFIX): New global variable.
- * ch-decl.c (bind_saved_names, pop_module): Change to use new
- ALIAS_DECL layout, and support general prefix rename and ALL.
- * ch-decl.c (various places): Don't barf if DECL_ANME is NULL.
- * ch-parse.y (build_prefix_clause): New function (handle PREFIXED).
- * ch-parse.y (optprogendname, optname): Rename to opt_end_label.
- * ch-parse.y: Add support for compound name strings, but defer
- using all over teh place, due to parser ambiguities.
- Howver, do use defining_occurrence where appropriate.
- * ch-parse.y: Re-write syntax and semantics of GRANT and SEIZE
- statements to support Blue Book functionality. Neato!
-
-Fri Aug 13 17:10:52 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-actions.c: Redo decl_temp1 calls to save resulting decl.
- * ch-decl.c (decl_temp1): Rewrite to return generated decl.
- (decl_temp): Deleted.
- * ch-loop.c: Redo decl_temp1 calls to save resulting decl.
- * ch-satisfy.c (safe_satisfy_decl): Reorder switch for
- readability, add comment.
- * ch-tasking.c: Redo decl_temp1 calls to save resulting decl.
- * ch-tree.h: Delete decl_temp proto, change decl_temp1.
-
-Fri Aug 13 13:39:59 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-decl.c (decl_temp): Break the chain of decls. This
- prevents an infinite loop.
- * ch-lang.c (make_chill_pointer_type): Fix compiler warning.
- * ch-lex.l (equal_number): Check passes in looking up a
- symbolic value.
- * ch-parse.y: Fix comments.
- * ch-tasking.c (tasking_setup): Only act in pass 2.
- (make_signal_struct, build_signal_decl,
- build_chill_receive_case_label): Don't go indirect
- thru NULL decl pointer.
-
-Thu Aug 12 11:02:34 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-actions.c (route_to_predefined_function): New function called
- from build_chill_function_call, to call the proper predefined routine.
- (build_chill_card, build_chill_length, build_chill_lower,
- build_chill_max, build_chill_min, build_chill_num,
- build_chill_pred, build_chill_sizeof, build_chill_succ,
- build_chill_upper): Rewritten to run only in pass 2.
- * ch-decl.c (init_decl_processing): Build predefined functions for card,
- length, lower, max, min, num, pred, sizeof, succ and upper. Delete
- unused builtin_function calls.
- * ch-grant.c (chill_finish_module_code): Save current_function_decl
- before calling finish_chill_function, and use that to build the
- initializer structure.
- * ch-lex.l: Remove following tokens, since they're now just predefined,
- not reserved: card, length, lower, max, min, num, pred, sizeof, succ
- and upper.
- * ch-loop.c: Readability, indentation changes.
- * ch-parse.y: Delete tokens for card, length, lower, max, min, num, pred,
- sizeof, succ and upper. Delete special rules for calls to these.
- Delete mode_location and upper_lower_arg non-terminals.
- (pmodearg): Eliminate convolutions.
- (call): Add rule for typename parameter.
- * ch-tasking.c: Readability changes.
- * ch-tree.h: Add prototypes.
-
-Thu Aug 12 00:38:17 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * ch-decl.c (save_decl): Set DECL_CONTEXT (decl).
- * ch-grant.c (chill_finish_module_code): Call
- finish_chill_function with nested==0.
- * ch-tree.h, ch-decl.c, ch-tasking, ch-parse.y: Rename
- {push,pop}_c_function_context to {push,pop}_chill_function_context.
- * ch-parse.y (end_function): If nested, call
- pop_chill_function_context regardless of which pass we're in.
-
-Wed Aug 11 02:34:02 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * ch-actions.c (finish_chill_binary_op): Handle error marks.
- * ch-decl.c (do_decl): Laying out decl and generating rtl
- is too late to do here (if there are forward references), so ...
- * ch-satisfy.c (satify_decl): ... do it here instead.
- * ch-decl.c (finish_enum): Fixup types of enum decls now.
- * ch-satisfy.c (safe_satisfy_decl): New routine. Supports
- checking illegal cyclic definitions.
- All *satisfy* routines now take a 'chain' parameter (instead
- of 'lookup_only') used for checking cycles.
- * ch-satisfy.c (satisfy_decl): Return DECL_INITIAL if appropriate.
- * ch-satisfy.c (satisfy): Lots of little fixes.
-
- * ch-lex.l (init_lex): Make all the standard ridpointers be
- lowercase, so that lookup_name on lower-cased user input
- will find the standard types.
- * ch-lex.l: Remove all the standard types, in effect
- converting them from reservered anmes to predefined names.
- * ch-lex.l, ch-parse.y: Remove PREDEF_MODEDECL - no longer used.
- * ch-grant.c (gfile): Rename to grant_file_name.
- * ch-lex.l (yywrap): Don't try to seize current grant_file_name.
-
- * initname.c: Removed. get_file_function_name is now in tree.c
- * Makefile.in (CHILL_OBJS): Remove initname.o
-
- * ch-decl.c (do_decl): New function, based on loop body of do_decls,
- * ch-decl.c (do_decls): Just call do_decl.
- * ch-grant.c (chill_finish_module_code): Minor cleasnups.
- Use new do_decl routine. Clear init_entry_decl's source line.
- * ch-grant.c (print_proc_tail): Fix for new param list structure.
- * ch-parse.y (whatpdef): Removed. Cleaned up procedure
- and process, allowing proper end-label-checking.
- * ch-typeck.c (build_chill_cast): Remove decl->type conversion.
-
-Wed Aug 11 00:33:44 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * ch-decl.c (layout_enum): Don't call rest_of_type_compilation.
-
- * ch-lex.l (RETURN_PREDEF): Don't call lookup_name.
- * ch-expr.c (build_chill_indirect_ref): Call get_type_of.
- * ch-parse.y (call): Call get_type_of before build_chill_cast.
-
-Tue Aug 10 21:33:10 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * ch-actions.c (build_char_array_expr): If a concat operand is
- a constant char, convert it to a STRING_CST.
- * ch-decl.c (finish_decl): Call rest_of_decl_compilation
- with toplev=0.
- * ch-typeck.c (build_chill_cast): Allow type to be TYPE_DECL.
-
- * ch-parse.y (actionlabel): Call define_label in both passes.
- * ch-actions.c (lookup_and_expand_goto, lookup_and_handle_exit):
- New functions, using lookup_name to find LABEL_DECLs.
- * ch-parse.y (GOTO, EXIT): Use above new functions.
- * ch-tasking.c (struct rc_state_type *current_rc_state):
- Use to store state for the current receive case statement.
- (build_chill_receive_case_start, build_chill_receive_case_end):
- Don't generate temporary LABEL_DECL; just use gen_label_rtx.
- * ch-decl.c: Remove all stuff dealing with specific label scopes,
- including functions push_label_level, pop_label_level.
- * ch-decl.c (define_label): Re-write for 2-pass.
- * ch_tree.h (lang_identifier): Removed label_value.
- * ch-tree.h (IDENTIFIER_LABEL_VALUE): Removed.
-
- * ch-parse.y (modename): Changed to yield identifier, not type.
- This allows following changes, which work better for 2-pass:
- (location): primval ARROW optmodename -> primval ARROW optname.
- (primval): Tuple can now be prefixed by unsatisfied name.
-
- * ch-actions.c (chill_grant_only): Renamed to grant_only_flag.
- * ch-lex.l (yywrap): Don't read seizefiles if grant_only_flag.
- * ch-decl.c (switch_to_pass_2): Exit if grant_only_flag,
-
- * ch-satisfy.c (satisfy): Support CONSTRUCTOR, REFERENCE_TYPE.
- * ch-satisfy.c (satisfy_decl, satisfy): Kludge around
- to a TYPE_DECL can be simplified to its type.
- * ch-expr.c (build_chill_indirect_ref): New function.
- * ch-lex.l (prepare_paren_colon): Make kludge even uglier,
- since the left paran might already have been seen.
- * ch-lang.c (make_chill_pointer_type): Allow parameter
- to select pointer or reference type.
- (build_chill_reference_type): New function.
- Either function: Be more careful (in case arg is identifier).
- * ch-except.c (initialize_exceptions): Make
- exception_stack_decl be public.
- * ch-actions.c (build_char_array_expr): Can only
- constant fold if operands are STRING_CST.
- * ch-grant.c (raw_decode_mode): Allow TYPE_DECL.
- (chill_finish_compile: Set TREE_PUBLIC of init function to 1.
-
-Tue Aug 10 17:55:12 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-actions.c (build_char_array_expr): Set array sizes correctly.
- * ch-decl.c: Fix comment.
- * ch-parse.y (pmodearg): Build tree_list in all cases.
- * varasm.c (assemble_tasssking_entry): Delete unused code.
-
-Tue Aug 10 13:58:21 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-actions.c (build_char_array_expr): save/restore
- a tree's constant status.
- (build_chill_binary_op): Don't convert an expression
- if the type we're converting to is NULL.
- * ch-convert.c (maybe_turn_scalar_into_array): New functions.
- Call it from convert, and from ..
- * ch-expr.c (chill_expand_assignment): call new function.
- Move convert code earlier, too.
- * ch-decl.c (lookup_name): Delete bogus error message.
- * ch-tree.h (CH_NOVELTY, SCALAR_P): Handle NULL_TREE.
- Add protos.
- * ch-typeck.c (valid_array_index): Comment out some strange code
- which now seg faults.
- (chill_expand_tuple): Re-enable prepending of VARYING
- length to a tuple.
- (chill_similar): Return FALSE if either mode is NULL_TREE.
-
-Tue Aug 10 07:29:31 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-decl.c: Delete proto for unused function shadow_tag_warned.
- Add commented-out calls to pushtag, in case we decide later
- to fill in TYPE_STUB_DECL for dbxout.
- * ch-lang.c (build_chill_struct_type): Add commented-out
- calls to pushtag, in case we decide later to fill in
- TYPE_STUB_DECL for dbxout.
-
-Mon Aug 9 23:09:08 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * ch-decl.c (chill_seize): Don't get_next_next in pass 2.
- * ch-decl.c (get_next_decl): Skip ALIAS_DECLs.
- * ch-decl.c (bind_saved_names): Handle SEIZE ALL.
- * ch-lang.c (layout_chill_struct_type): Don't call
- rest_of_type_compilation - it crashes without a TYPE_STUB_DECL.
- * initname.c (get_file_function_name): Get new file and
- function for language-independent constructor name generation.
- * ch-grant.c (get_init_function_id): Removed.
- * ch-grant.c (chill_finish_compile): Call get_file_function_name
- instead of get_init_function_id.
-
-Mon Aug 9 18:33:36 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-decl.c: Formfeeds and comments.
- * ch-parse.y (quasi_formpar): Treat just like real formpar.
- Eliminate restriction on single name.
- (pmodearg, pmodearglist): Remove ignore_exprs stuff.
-
-Mon Aug 9 17:21:14 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * ch-lex.h (enum rid), ch-lex.l (init_lex): Added RID_ALL.
- * ch-lang.c (build_chill_pointer_type): Layout the pointer type,
- if the pointee is laid out, even if pass==1.
- * ch-parse.y: Set ignore_exprs=(pass=2) for entire spec module.
-
-Mon Aug 9 15:44:01 1993 Bill Cox (bill@rtl.cygnus.com)
-
- This version compiles the 5-line program. Thanks, Per!
- * ch-decl.c (print_lang_decl, print_lang_identifier):
- Add appropriate calls to indent_to(). Rename reverse_scopes
- to switch_to_pass_2, and wait to set pass = 2 until
- here.
- * ch-grant.c (chill_finish_module_code): Set module_init_list
- non-NULL in pass 1; in pass2, chain on the module_init
- structure's decl.
- (chill_finish_compile): Clear module_init_list to NULL.
- * ch-parse.y (quasi_formparlist): Rewrite to avoid seg fault.
- Rename reverse_scopes to switch_to_pass_2, delete setting
- of pass = 2.
- * ch-tree.h: Rename reverse_scopes proto.
-
-Mon Aug 9 13:21:34 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * ch-decl.c (build_enumerator): If name is NULL,
- don't call save_decl or get_next_decl.
- * ch-decl.c (layout_enum): Fix calculation of next value.
- * ch-grant.c (print_enumeral): Re-do for new 2-pass scheme.
- * ch-grant.c (decode_constant): Better CONSTRUCTOR support.
-
-Mon Aug 9 11:59:12 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-actions.c, ch-convert.c, ch-decl.c, ch-grant.c,
- ch-lang.c, ch-parse.y, ch-tree.h: gcc -Wall cleanup.
- Lots of new prototypes.
-
-Mon Aug 9 01:00:33 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * ch-lex.h: Remove unused RID_'s. Make sure RID_MAX is last.
- * ch-decl.c (init_decl_processing): Moved ridpointers
- initialization to init_lex(). Use them consistently.
- * ch-lex.l (RETURN_PREDEF): New macro. Uses ridpointers
- for all preferedined types.
- * ch-lex.l (init_lex): Upper case all RIDs, so grantfiles
- (and error messages?) will use uppercase.
- * ch-decl.c (build_chill_enumerator): Merged into build_enumerator.
- * ch-lang.c (finish_chill_enum): Merged into ...
- * ch-decl.c (finish_enum): .... this function.
- * ch-decl.c (layout_enum): New function. Does all the pass-2
- stuff for enumerations.
- * ch-decl.c (finish_enum, start_enum): Only trivial pass-1 stuff.
- * ch-satisfy.c (satisfy): Support ENUMERAL_TYPE. Improve ranges.
- * ch-parse.y: Check ignore_exprs instead of ignore_decls when
- parsing and building types.
-
-Sun Aug 8 16:26:40 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * ch-lex.h: Add some missing RID_'s.
- * ch-decl.c (init_decl_processing):
-
-Sun Aug 8 15:32:54 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-grant.c (module_has_actions): Delete this and all
- references. It was a botch.
- (chill_finish_module_code): Move finish_chill_function_call inside
- the test whether actions were found at module level.
- Use current_function_name in the initializer build,
- and init_entry_id in the module_list setup.
- (chill_finish_compile): Call lookup_name to get the
- decl from a module_init_list entry.
- * ch-parse.y: Revert module_has_actions additions.
- * ch-satisfy.c (satisfy): After satisfying the type referenced
- by a pointer_type, call layout type for the pointer.
- * ch-tasking.c (tasking_registry): Only active in pass 2.
- * ch-typeck.c: Call build_chill_pointer_type everywhere.
-
-Sun Aug 8 13:13:29 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * ch-tree.def (PAREN_EXPR): New unary op: '(' EXPR ')'.
- * ch-parse.y (primval): If pass 1, generate PAREN_EXRR.
- * ch-satisfy.c (satisfy): Reduce PAREN_EXPR to its operand.
- * ch-grant.c (decode_const): Handle PAREN_EXPR.
- * ch-decl.c (pop_module): Fix think. Inprove error message.
-
-Sun Aug 8 10:31:04 1993 Bill Cox (bill@rtl.cygnus.com)
-
- Generally, replace 'function' with 'procedure'
- and 'type' with 'mode' in error/warning messages.
- * ch-actions.c: See Generally. Fix up 'too many' and 'too few' error msgs.
- * ch-decl.c: See Generally.
- (init_decl_processing): Call build_tasking_enum from here.
- Now, it doesn't need a flag to do its work only once.
- Also, build the TaskingStruct decl here.
- * ch-grant.c: Remove references to `current_grant_file';
- there's now only one. See Generally. Do gcc -Wall cleanup.
- * ch-lex.l: Remove references to `current_grant_file'
- and delete USE_GRANT_FILE token.
- * ch-parse.y: Remove call to build_tasking_enum, and its extern.
- * ch-tasking.c (tasking_setup): Move TaskingStruct build
- to init_decl_procesing. Delete build_tasking_enum calls.
- * ch-tree.c: See Generally.
- * ch-tree.h: Add proto for build_tasking_struct.
-
-Sun Aug 8 08:59:23 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-decl.c: Make unnamed_module_number static, reset it to zero
- before pass 2, so same module names get generated in both passes.
- (push_module): Return user name or generated name.
- (init_decl_processing): Build __tmp_initializer_type.
- Code moved from chill_finish_module_code.
- * ch-grant.c: New flag module_has_actions. Set TRUE by push_actions,
- used, reset by chill_finish_module_code. Replaces test of
- module_function_name. Shuffled finish-up code to end of module.
- (chill_finish_module_code): Use global_bindings_p to determine
- 'nested' parameter for finish_chill_function. Use new
- module_has_actions flag to trigger generation of module_init list
- entry. We now can handle not only multiple modules per file,
- but modules nested inside functions (I think).
- * ch-lang.c (build_chill_pointer_type): Restore missing assignment.
- * ch-parse.y (push_actions): Set module_has_actions flag.
- (modulion, spec_module): Save possibly-generated module name
- returned by push_module.
- * ch-satisfy.c (satisfy): Put switch cases into alpha order, add
- case for POINTER_TYPE.
- * ch-tasking.c: Replace build_pointer_type calls with
- build_chill_pointer_type calls.
- * ch-tree.h: Fix, add prototypes.
-
-Sat Aug 7 17:32:22 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * ch-parse.y: Remove many useless tests for ignore_decls.
- * ch-parse.y: Remove obsolete support for _EXTERN and _INIT.
- * ch-parse.y: Reset ignore_exprs while parsing declarations,
- but handle initializers appropriately.
- * ch-grant.c (decode_constant): Update (for 2-pass) support
- for CONSTRUCTOR and SET_TYPE.
- * ch-grant.c (chill_initializer_name): Renamed to
- module_function_name.
- * ch-grant.c (function_generated): Removed;
- use module_function_name != NULL instead.
- * ch-tree.h, ch-parse.y: Removed unused current_locnamelist.
- * ch-decl.c (push_modedef): Simplify to take just one mode.
- * ch-tasking.c (make_process_struct, make_signal_struct):
- Change calls to push_modedef correspondingly.
- * ch-tree.c (build_powerset_type): Move the stuff that's
- suitable for pass 1 into new function make_powerset_type,
- and that for pass 2 into new function layout_powerset_type.
- * ch-lang.c: Move pass-1 stuff from build_chill_pointer_type
- into new function make_chill_pointer_type, and split
- build_chill_struct_type into make_chill_struct_type
- and layout_chill_struct_type.
- * ch-decl.c (grok_chill_variantdefs): Similarly split up
- into make_chill_variants and layout_chill_variants.
- * ch-satisfy.c (satisfy): Add support for SET_TYPE, and UNION_TYPE.
- Call layout_chill_struct_type for RECORD_TYPE.
-
-Sat Aug 7 09:59:55 1993 Bill Cox (bill@rtl.cygnus.com)
-
- Fixup previous check-in.
- * ch-decl.c: Restore unnamed_module_number, which *was*
- used after all.
- * ch-grant.c (get_init_function_id): Return type s.b. tree.
-
-Sat Aug 7 09:28:17 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-decl.c (print_lang_decl, print_lang_type): Add
- correct parameter list. Add print statements for
- nesting_level, signal_dest, buffer_size, and the
- signal_data flag.
- (decl_temp, decl_temp1): Delete unused code.
- (init_decl_processing): Call build_instance_type and
- build_tasking_type in both passes.
- Generally change current_scope comparisons against
- global_scope to global_biidings_p calls.
- * ch-except.c (push_handler): Add space before parameter paren.
- * ch-grant.c (chill_start_module, chill_finish_module,
- chill_finish_compile): Complete re-write for 2-pass and
- multiple modules per source file.
- * ch-parse.y (pass1_2): Call chill_finish_compile once each pass.
- * ch-tasking.c: Diffused small adaptations to 2-pass.
- * ch-tree.h (print_lang_decl, print_lang_type): Correct
- the prototypes.
- (chill_finish_module_code): Add module name parameter.
- * ch-typeck.c: Fix comments, add whitespace.
-
-Fri Aug 6 12:17:07 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * ch-decl.c (temp_pushdecl, bind_saved_names): The simple-minded
- way I allocated the shadow_list on an obstack was too fragile,
- so just use xmalloc/free instead.
-
-Fri Aug 6 08:31:49 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-satisfy.c (satisfy): Satisfy TYPE_MIN_VALUE and
- TYPE_MAX_VALUE for vanilla integer type. Only need
- to satisfy TREE_TYPE for integer range type.
-
-Fri Aug 6 00:53:11 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * ch-lang.c (build_chill_range_type): Split up into two new
- functions (make_chill_range_type, layout_chill_range_type);
- only former part is done in pass 1.
- * ch-lang.c (build_chill_array_type): Split up in the same
- way (yielding make_chill_array_type, layout_chill_array_type).
- * ch-satisfy.c (satisfy): Handle array and range types.
- * ch-tree.h (TYPE_RANGE_PARENT): Removed. Not used.
- * ch-parse.y (mode2): Handle optional rangesize.
-
-Thu Aug 5 15:13:42 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * ch-grant.c (print_an_int): Re-enable (but don't search for SYN).
- * ch-grant.c (raw_decode_mode): Support printing
- of an IDENTIFIER_NODE (unresolved type name).
- * ch-grant.c (decode_constant): Support printing of an unresolved
- IDENTIFIER_NODE, as well as some kinds of binary operations.
- * ch-grant.c (grant_one_decl): Don't call globalize_decl.
-
- * ch-grant.c (decode_decl): Add support for ALIAS_DECLs
- (from SEIZEs and GRANTs).
- * ch-grant.c: Remove support for multiple grantfiles.
- * ch-grant.c, ch-parse.y: Removed grant_count, for now at least.
- * ch-lex.h (in_seizefile): Moved to ch-tree.h.
- * ch-tree.h (CH_DECL_SEIZED), ch-tasking.c, ch-decl.c: Removed.
- * ch-tree.h (CH_DECL_GRANTED): Added.
- * ch-actions.c (build_chill_exception_decl): Use
- IDENTIFIER_LOCAL_VALUE, not obsolete IDENTIFIER_GLOBAL_VALUE.
- * ch-grant.c (write_grant_file -> write_spec_module): Rename.
- Change to accept list of remember_decls and granted_decls.
-
-Thu Aug 5 11:58:21 1993 Stan Shebs (shebs@rtl.cygnus.com)
-
- * expr.c: Remove no-longer-used PROCESS_DECL tree type.
-
-Thu Aug 5 10:03:27 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-decl.c (init_decl_processing): Only build types
- in pass 2, since dbxout machinery is only ready for
- output then.
- * ch-grant.c (chill_finish_module_code): Do most of the
- work in pass 2.
-
-Thu Aug 5 06:54:10 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-parse.y (receivecaseaction): Pass label-group
- numbers around.
- * ch-tasking.c (build_chill_receive_case_start):
- Generate unique labels for each case, pass back
- the label-group's number.
- (build_chill_receive_case_end): Accept label-group
- number from parser, use it to build labels
- * ch-tree.h: Change prototypes.
-
-Wed Aug 4 13:21:13 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * ch-decl.c (decl_temp1): Call finish_decl().
-
- * ch-grant.c (chill_start_module_code): Don't call
- push_c_function_context - not needed since we're not nested.
- * ch-grant.c (chill_finish_module_code): Call finish_chill_function
- with nested=0, not 1 (twice).
- * ch-grant.c (chill_finish_module_code): Clear function_generated.
-
-Tue Aug 3 20:06:22 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * ch-decl.c (push_chill_extern_function): Set TREE_PUBLIC.
-
-Tue Aug 3 19:08:51 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-actions.c (build_chill_function_call): Handle parameter
- attributes better - LOC still not handled.
- * ch-tree.def: Amplify comment.
-
-Tue Aug 3 18:07:36 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * ch-lex.l (handle_use_seizefile_directive): Update
- next_file_to_seize correctly.
- * ch-actions.c (build_chill_abs): Create an ABS_EXPR, not an rts_call.
-
-Tue Aug 3 14:03:50 1993 Bill Cox (bill@rtl.cygnus.com)
-
- First Aid, not real long-term fixes...
- * ch-decl.c (pop_module, lookup_name_for_seizing): Check
- current_module pointer for NULL before using it.
- (init_decl_processing): Set up wchar_type_node before using it.
- * ch-grant.c (chill_finish_module_code): Don't build
- initializer_type or initializer_decl until pass 2.
- * ch-lex.l: Readability - single statement per line.
- * ch-tasking.c (make_process_struct): Hide get_parm_info
- call inside #ifdef for now.
-
-Tue Aug 3 09:59:23 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-decl.c (pushdecllist): Add forward decl.
- * ch-parse.y (handler): Add rules which allo
- empty onalternativelist.
- * ch-tasking.c (get_tasking_code_name): Add
- cast of alloca() result.
-
-Tue Aug 3 00:11:40 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * ch-lex.l (handle_use_seizefile_directive): Make files_to_seize
- a queue. Check for duplicate use_seizefile-s immediately.
- * ch-lex.l (yywrap): Use this more portable mechanism,
- rather than the flex-specific <<EOF>>. Also, clear saw_eof.
- * ch-lex.l: Don't call push_module/pop_module automatically.
- * ch-decl.c (push_chill_extern_function: Modify for 2-pass.
-
-Mon Aug 2 14:24:59 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * ch-parse.y: Rename actionstatement -> nonempty_actionstatement.
- New actionstatement is now nonempty_actionstatement | SC. Use
- where appropriate. This is closer to Blue Book terminology.
-
- * ch-tree.def (ALIAS_DECL): New tree type.
- * ch-decl.c: Merged all the code we need (I hope) from c-decl.c,
- which is no longer used for cc1chill.
- * c-decl.c: Remove all Chill-related code.
- * Makefile.in (CHILL_OBJS): Don't use c-decl.o.
- * ch-decl.c: No longer use IDENTIFIER_GLOBAL_VALUE anywhere.
- Introduce a 'nesting_level' level concept instead.
- * ch-decl.c: Merged push_scope into pushlevel; pop_scope into
- poplevel; struct scope and struct binding_level.
- * ch-decl.c: Other major name lookup algorithm changes.
- * ch-tree.h (struct lang_identifier): Remove granted_value field.
- * ch-tree.h (IDENTIFIER_GRANTED_VALUE macro): Removed.
- * ch-tree.h (DECL_NESTING_LEVEL): New macro.
- * ch-satisfy.c (satisfy, satisfy_decl): New 'lookup_only' arg.
- * ch-tree.h (struct module): New fields nesting_level, granted_decls.
- * ch-grant.c (seize_implied_names, do_seize, chill_seize): Move ...
- * ch-decl.c: ... here.
- * ch-grant.c (start_chill_function2): Remove.
- * ch-grant.c (chill_start_module_code): Now called in both passes.
- * ch-actions.c (lang_init): Code moved to ...
- * ch-decl.c (init_decl_processing): ... here.
- * ch-actions.c (chill_expand_result, chill_expand_return):
- Handle being called during pass 1.
- * ch-lex.l (name_type_signal): Don't try lookup_name during pass 1.
- * ch-parse.y (PUSH_ACTION, push_action): Is now invoked during
- both passes, for the sake of chill_start_module_code. Change all
- actions rules to invoke PUSH_ACTION unconconditionally.
- * ch-parse.y, ch-decl.c (push_module): Module label is now optional.
-
-Mon Aug 2 15:02:32 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * expr.c (store_constructor): Convert library function
- parameters to proper integer precision before calling
- emit_library_call.
-
-Mon Aug 2 08:46:06 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-grant.c (seize_implied_names): Check POWERSET's
- base type for names to seize.
-
-Fri Jul 30 19:59:30 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-tree.h: Delete unused definition of JOINER
- macro. Expand comment about INSTANCE_TYPE.
-
-Thu Jul 29 14:57:11 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-convert.c (unreferenced_type_of): New function.
- (convert): Call new function.
-
-Thu Jul 29 07:34:57 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-lex.l: Allow C-style comments before the module
- header. Use #undef to assure that strchr isn't a
- macro (portability), and remove the extra paren-
- theses in its extern name.
- (check_newline): Call getlc less often, so that user
- labels aren't lowercased before their time. Add BEGIN
- INITIAL before starting pass 2, so the header is
- correctly ignored.
-
-Wed Jul 28 14:23:24 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-grant.c (chill_start_module_code): Cast alloca()
- return value.
-
-Wed Jul 28 12:39:51 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com)
-
- * ch-grant.c: remove extra parens around extern function
- declarations (they confuse the DECstation compiler)
-
-Wed Jul 28 12:28:56 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * Makefile.in: Stop deleting flex's #line lines.
-
-Wed Jul 28 07:05:25 1993 Bill Cox (bill@cygnus.com)
-
- Adjust after FSF merge:
- * calls.c (expand_call): Add comment.
- * ch-expr.c: Add newline.
- * expmed.c (store_split_bit_field): Add comment.
-
-Tue Jul 27 17:32:13 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-actions.c (build_chill_binary_op): Set code0 and
- code1 only in pass 2.
- (get_result_tmp_name): Cast alloca return for portability.
- * ch-decl.c (pop_module): Test current_module ptr before
- using it.
- * ch-lex.l: Set lineno and input_filename for pass 2
- error messages.
-
-Tue Jul 27 15:14:06 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-lex.l: Fix the syntax error at line 329. Will I
- *ever* quit fixing these in the ch-lex.c file? Stay tuned..
-
-Tue Jul 27 15:01:25 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-lex.l: Pervasive rewrite for queueing seize files,
- then parsing them at the end of pass 1. Still some
- problems.
-
-Tue Jul 27 07:40:39 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * chill.in: Check for .i suffices only, and use -xchill
- to bracket the argument.
-
-Thu Jul 22 19:17:23 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * c-decl.c (print_lang_identifier): Oops. Syntax error.
-
-Thu Jul 22 18:56:16 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * c-decl.c (pushdecllist): Standardize loop for readability.
- * ch-decl.c (decl_temp): Call pushdecllist to store decl
- into hash table, move after current_scope declaration.
- (decl_temp1): Move also.
- * ch-lex.l (getlc): New function. Force char to lower case.
- (check_newline): Call it, so comparisons work on uppercase
- keywords.
-
-Wed Jul 21 22:17:22 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-decl.c (do_decls): Add saving of decl tree
- address into ID node in pass 2, reindent.
- * ch-grant.c (start_chill_function2): New function.
- (chill_start_module_code, chill_finish_module_code): Call it.
- * ch-loop.c (build_temporary_variable, begin_for_range):
- Replace start_decl, finish_decl pairs with decl_temp1 calls.
- * ch-parse.y (parnamelist): Eliminate warning by eliminating
- the %type for now.
- * ch-actions.c, ch-tasking.c: Replace do_decls calls with
- decl_temp1 calls.
- * ch-tree.h: New prototypes.
- * stmt.c (stamp_nesting_label): Check parameters for NULL.
- * toplev.c (lang_options): Add '-L' option.
-
-Wed Jul 21 21:06:18 1993 Bill Cox (bill@rtl.cygnus.com)
-
- Portability fixes.
- * ch-decl.c (save_decl): Make definition match forward declaration.
- * ch-lex.l (RETURN_TOKEN): Don't use the 'do { .. return } while 0'
- in the macro - Sun's compiler throws warnings. Thanks, Brendan.
- * ch-satisfy.c (satisfy): Add forward declaration.
- (SATISFY): Add outer parens for greater safety.
-
-Wed Jul 21 12:59:20 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * c-decl.c (pushdecllist): New function. Add a list of decls
- to the current scope, checking for duplicates.
- * c-decl.c (start_function): Remove some Chill junk.
- (This function should no longer be used for Chill.)
- * ch-lex.l (ch_lex_init): New function, to re-init for 2nd pass.
- * ch-lex.l (<<EOF>>): Cleanup, and re-start for 2nd pass.
- * ch-tree.h (UNSATISFIED, UNSATISFIED_FLAG): New flags.
- * ch-tree.h (CH_CLASS_IS_VALUE, CH_CLASS_IS_REFERENCE):
- Implement. Add comments.
- * ch-tree.h (CH_COMPATIBLE_CLASSES, CH_ROOT_MODE, CH_RESULTING_MODE):
- Better Blue Book type checking.
- * ch-actions.c (finish_chill_binary_op): Handle folding
- and other stuff that couldn't be done in pass 1.
- * ch-actions.c (build_chill_binary_op): Bail out early if pass 1.
- Use new CH_ROOT_MODE macro to handle integer promotions etc.
- * ch-except.c (push_handler): Bail out if pass 1.
- * ch-tasking.c (make_process_struct): Defer making this work.
- * ch-parse.y (assignaction): Simplify, and move some code ...
- * ch-expr.c (chill_expand_assignment): ... here.
- * ch-typeck.c (chill_root_mode, chill_resulting_mode,
- chill_compatible_classes): New functions, implementing the
- correspondingly named Blue Book concepts.
- * ch-parse.y generally: Lots of little tweaks to support
- 2-pass compilation.
- * ch-parse.y (push_module, pop_module): Moved to ...
- * ch-decl.c (push_module, pop_module): ... here.
- * ch-parse.y (push_action): New function.
- * ch-parse.y (pdef): Move complicated action to ...
- * ch-parse.y (end_function): ... new function here.
- * ch-parse.y (procedure): Major re-write.
- * ch-parse.y (paramname, paramnamelist): New, to avoid conflict (?).
- * ch-decl.c (do_decls, push_syndecls, push_modedef,
- start_chill_function, finish_chill_function): Do different things
- on each pass. Hence, can use code in c-decl.c to lesser extent.
- * ch-decl.c (build_chill_function_type): First arg is now
- just the return type, rather than a singleton list.
- * ch-decl.c (massage_param_node): Remove not needed (we
- now encode parameter attributes directly in the TREE_PURPOSE).
- * ch-decl.c (chill_munge_params): New function, called by parser.
- * ch-decl.c (push_parms): Removed function.
- * ch-decl.c (push_cope, pop_scope, save_decl, get_next_decls):
- New functions, to coordinate decls between passes.
-
-Wed Jul 21 14:23:25 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-actions.c (lang_decode_option): Add option -Lpath
- to specify seize file path.
- (ch_singleton_set): Readability formatting.
- Add comment, move functions to easier found places.
- * ch-lex.l (setup_seizefile_read): Check for *no* slashes.
- (register_seize_path): Use memcpy so pathlen has an effect.
- * gcc.c (default_compilers): Add -L option to chill
- compiler SPECs.
-
-Wed Jul 21 12:59:20 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * ch-satisfy: New file. Used for name lookup.
- * Makefile.in (CHILL_OBJS): Add ch-satisfy.o.
-
-Wed Jul 21 12:16:51 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * toplev.c (main): Delete -L option handling - breaks
- non-chill compilers.
-
-Wed Jul 21 09:29:24 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-grant.c: #undef strchr and strrchr names in extern
- declarations, to prevent RS6000 compiler from reporting
- their misuse as macros.
- * ch-lex.l (setup_seizefile_read): Refer to list of paths
- for seizefiles specified by -L options on command line.
- (register_seize_path): Add a new path to the seize file list.
- * toplev.c (strip_off_ending): Recognize chill suffix.
- (main): Recognize -L option, specifying a seize file path.
-
-Tue Jul 20 12:41:52 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-lex.l (convert_float): Make it really portable,
- using the appropriate macros.
-
-Tue Jul 20 11:26:02 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-lex.l (convert_float): More casts for vxworks
- portability.
-
-Tue Jul 20 11:01:30 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-lex.l (convert_float): Give variable `d' correct
- type so build_real call is correct. Should remove
- vxworks portability problem.
- (convert_float): Re-indent to standards.
-
-Mon Jul 19 17:32:10 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-actions.c (build_char_array_expr): Add field decls to
- constructor. Now, it generates the library call.
- * ch-expr.c (chill_expand_array_assignment): Make sure that all
- error messages say 'mode' not 'type'.
-
-Mon Jul 19 14:44:46 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-actions.c, ch-convert.c, ch-decl.c, ch-grant.c, ch-lang.c,
- ch-loop.c, ch-parse.y, ch-tasking.c, ch-tree.c, ch-typeck.c:
- Make sure that all error messages say 'mode' not 'type'.
- * ch-decl.c (push_modedef): Add novelty computation,
- storage in each newmode.
- * ch-parse.y: Delete novelty counter - moved to ch-decl.c.
- Reformat slightly for readability. Fix comments.
- * ch-tree.h: Delete print_lang_type prototype.
-
-Mon Jul 19 06:43:51 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-actions.c (chill_expand_return): Disable
- error message which requires 2-pass analysis, for
- now.
- * ch-convert.c (convert): Build length-only constructor
- for empty string (PR 2930).
-
-Fri Jul 16 16:08:33 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-expr.c (chill_expand_array_assignment): Check
- non-varying string assignments for conformance to
- the "string assignment condition" (PR 2920).
-
-Thu Jul 15 13:25:33 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-actions.c (build_chill_array_expr): Check parameters.
- Call convert to build unitary array from scalar if
- needed. Rewrite CONCAT_EXPR handling.
- * ch-convert.c (build_array_type_for_scalar): New functions.
- (convert): Call new function, to convert scalar to unitary
- array. Only call chill_expand_tuple if expression hass
- NULL_TREE type.
- * ch-expr.c (chill_expand_expr): Allow a larger static
- varying array to be assigned to a smaller, with a runtime
- test (to be provided).
- * ch-parse.y (locdec): Comment out bogus error msg.
- (elementlist): Replace several lines with chainon call.
- * ch-tree.h (SCALAR_P): New macro. New prototype for
- build_array_type_for_scalar.
- * ch-typeck.c (build_chill_cast): Re-indent.
- (chill_expand_tuple): Comment out strange addition of
- varying string's length to front of constructor list.
-
-Thu Jul 15 05:58:46 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-except.c (start_handler_array): Use unique identifier for
- exception array, so we can have > 1 array per reach
- (PR 2931). The change was originally entered June 23, and
- subsequently lost.
-
-Mon Jul 12 16:07:53 1993 Bill Cox (bill@rtl.cygnus.com)
-
- Get executable test cases running again...
- * c-typeck.c (build_function_call): Bypass default
- parameter promotions, format param syntax check for
- CHILL; they've already been converted in
- build_chill_function_call.
- * ch-actions.c (chill_expand-return): Correct tests
- for function which returns no value.
- * ch-convert.c (base_type_size_in_bytes): Check for
- NULL type parameter, just return.
- (convert): Allow conversion of CHAR to varying array
- of CHAR.
- Change error msg to "conversion" from "assignment".
- Remove default from case, which short-circuited before
- REFERENCE_TYPEs got converted. Deleted second copy
- of REFERENCE_TYPE code.
- * ch-lang.c (build_chill_range_type): Simply exit if
- NULL input parameter.
- * ch-loop.c: Fix comment.
-
-Sun Jul 11 11:27:08 1993 Bill Cox (bill@cygnus.com)
-
- * ch-actions.c (chill_expand_result, chill_expand_return):
- Move here from ch-typeck.c. Add a temporary to remember the
- result value in. Change return handler to fetch that
- temporary value, if there is one.
- * ch-parse.y (pdef): Call chill_expand_return to fetch
- the temp's value.
- * ch-tree.h, ch-typeck.c: Move return, result functions to
- ch-actions.c. And their prototypes.
-
-Fri Jul 9 15:47:51 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-actions.c, ch-convert.c, ch-decl.c, ch-except.c,
- ch-expr.c, ch-grant.c, ch-inout.c, ch-lang.c,
- ch-lex.l, ch-loop.c, ch-parse.y, ch-tasking.c,
- ch-tree.c, ch-tree.h, ch-typeck.c: gcc -Wall cleanup.
-
-Fri Jul 9 09:41:05 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-grant.c (decode_decl): Grant BUFFER, INSTANCE variables.
- (print_integer): Delete old non-working INSTANCE code.
- * ch-lex.l (name_type_signal): Recognize BUFFER name, too.
- * ch-parse.y (rccase_label): Move all actions inside if.
- Use BUFFERNAME to recognize receice case buffer clause,
- eliminate one shift-reduce conflict.
- * ch-tasking.c (build_buffer_descriptor): Check for
- CH_DECL_BUFFER flag, remove unused code.
-
-Thu Jul 8 11:17:32 1993 Bill Cox (bill@rtl.cygnus.com)
-
- Declaring and sending buffers.. first draft
- * ch-actions.c (lang_init): Define the send_buffer runtime
- function.
- * ch-decl.c (do_decls): Standardize loop, so stepping
- isn't hidden.
- * ch-lex.l: Clean up prototypes for readability.
- * ch-parse.y (sendaction): Add send buffer action.
- (locdec): Add rule for buffer declaration.
- * ch-tasking.c (generate_tasking_code): standardize indentation.
- (make_signal_struct): Readability changes.
- (build_chill_send_buffer, build_buffer_decl,
- build_buffer_descriptor): New functions.
- * ch-tree.h (IDENTIFIER_BUFFER_SIZE): Add place to save
- buffer's maximum queue length in buffer decl.
- (CH_DECL_BUFFER): Add flag in decl. Clean up for
- readability. Add prototypes.
- * ch-typeck.c (build_chill_cast): Call convert rather
- than storing directly into TREE_TYPE field.
-
-Tue Jul 6 12:34:32 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-actions.c (lang_init): Set warn_switch so case labels
- get checked. Move build_chill_case_expr to ch-expr.c.
- * ch-expr.c (chill_expand_case_expr): Enable checking
- of expression case labels.
- * ch-grant.c: Move a comment.
-
-Mon Jul 5 10:02:27 1993 Wilfried Moser (fs_moser at rcsw1j)
-
- * ch-lex.l: Add compiler directive SUPPORT_CAUSING_ADDRESS.
- * ch-except.c (initialize_exceptions): Change the layout of the
- structure __ch_handler. The entry __jbuf is moved to the end
- of the structure and its size was changed to _JBLEN+10.
- * ch-decl.c (push_chill_extern_process): Add processing of
- processes with no arguments.
- * ch-grant.c (decode_decl, do_seize): Add processing of
- processes with no arguments.
- * ch-tasking.c (build_process_header, build_chill_start_process):
- Add processing of processes with no arguments.
- (make_process_struct): Add processing of IN attribute for
- process arguments.
- (tasking_setup): Add NUL-character to name of a tasking
- element. The name must be NUL terminated.
- (build_chill_send_signal): Default SEND_SIGNAL_PRIORITY
- to 0 with a warning if -Wall specified on command-line.
-
-Fri Jul 2 16:01:57 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-parse.y: Change 'empty' comments to new non-terminal
- so that exyacc doesn't discard them.
- * ch-lang.c (build_chill_range_type): New error messages.
-
-Fri Jul 2 12:43:25 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-parse.y (action): Catch and report actions which
- shouldn't have exception clauses, but do. Unfortunately,
- catching more than one of these per compilation will
- have to await the general addition of syntax error
- recovery to the parser.
-
-Fri Jul 2 10:45:35 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-parse.y (locdec): Issue error for initialization
- of bitstring with tuple, not for powerset init with
- tuple.
-
-Thu Jul 1 15:29:26 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-lang.c (build_chill_array_type): Check for indices
- that didn't fold into constants, issue error (PR 2924b).
- * ch-parse.y: Add novelty counter, alphabeticalize.
- * ch-tree.h: Define CH_NOVELTY for novelty checks later.
-
-Thu Jul 1 14:03:04 1993 Bill Cox (bill@rtl.cygnus.com)
-
- For Wilfried Moser.
- * chill.in: Add -ansi switch at compiler call to avoid
- translation of i.e. sun to 1 by cpp.
-
-Wed Jun 30 22:21:33 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-grant.c (raw_decode_mode): Add code for
- integer and enumeral ranges. Standardize indentation.
-
-Wed Jun 30 14:02:23 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-grant.c (print_an_int): New function to print a
- decimal integer string or the CONST_DECL (SYN) which
- best matches it.
- (print_integer): Call the above function. Replace
- calls to SAME_TYPE macro with TYPE_MAIN_VARIANT
- comparisons, as suggested by Jim Wilson.
- (decode_decl): Set current_grant_modename sooner,
- be sure to clear it when done.
-
-Wed Jun 30 10:10:57 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-actions.c (build_max_min): Change interface to accept
- just a max/min flag. Get min/max values from an
- enumeral constructor.
- (build_chill_max, build_chill_min): Change calls to
- build_max_min.
- * ch-lang.c (deep_const_expr): Check for NULL_TREE
- arguments, don't seg fault.
-
-Wed Jun 30 09:20:09 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * config/sparc/sparc.c (sparc_type_code): Add SET_TYPE
- to switch cases, preventing abort.
-
-Tue Jun 29 19:04:37 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-expr.c: Update comment.
- * ch-parse.y (range_or_mode): New non-terminal used in
- lexpr to implement mode as case label.
-
-Tue Jun 29 13:13:46 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-actions.c (build_chill_case_expr): Pass in the
- optional ELSE clause, error for multiple case-selector
- expressions, error for missing ELSE clause.
- * ch-expr.c (chill_expand_assignment): Error if multiple
- location assignment and locations not novelty
- equivalent.
- * ch-parse.y (caseaction): Add range_list_clause non-
- terminal, sorry message for it.
- (assignaction): error if operator used on multiple
- assignment.
- (case_expr): Pass optional ELSE tree to
- build_chill_case_expr for checking.
- * ch-tree.h (build_chill_case_expr): Change proto.
-
-Fri Jun 25 17:22:41 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-actions.c (chill_comptypes, build_chill_binary_op):
- Allow PROC mode variables.
- * ch-convert.c (convert): Turn a NULL literal into a zero
- valued pointer-to-function, given such a type. Also
- build the ADDR_EXPR of a function variable.
- * ch-grant.c: Pervasive -Wall -pedantic cleanup.
- (print_enumeral, print_integer, print_struct) Moved these
- large functions out of the switch in raw_decode_mode for
- readability, and to encourage future code-sharing.
- (print_proc_tail, print_proc_exceptions): Moved these out
- of decode_decl, to share them. They're used also to
- output PROC modes.
- * ch-parse.y (mode2): Enable PROC modes.
- (procmode): Represent PROC mode as a ptr-to-function type.
- (call): Recognize ptr-to-function as indirect call.
- Cleanup 'primval LPRN untyped_exprlist RPRN' action code.
-
-Thu Jun 24 15:59:20 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-grant.c: (raw_decode_mode): Add support for unnamed
- and user-numbered enumeration members.
-
-Thu Jun 24 13:52:10 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-actions.c (build_chill_array_expr, build_chill_length):
- Explicitly convert a varying array's length field to an
- integer_type_node, now that it's only a chill_integer_
- type_node.
- * ch-expr.c (chill_expand_expr,
- expand_assignment_to_varying_array,
- chill_expand_array_assignment,
- expand_varying_length_assignment): Explicitly
- convert a varying array's length field to an integer_type_node,
- now that it's only a chill_integer_type_node.
- * ch-loop.c (init_loop_counter, top_of_loop_test): Change
- to handle varying array location iterations.
- * ch-parse.y (mode2): Count number of named SET members,
- as opposed to '*' members. Issue error if there were none.
- (setelement): Count named set members. Generate a unique
- identifier for the '*' element.
- * ch-typeck.c (validate_varying_array_ref): Explicitly
- convert a varying array's length field to an integer_type_node,
- now that it's only a chill_integer_type_node.
-
-Wed Jun 23 19:18:28 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-lang.c (finish_chill_enum): Change test for too-
- large enumerations.
- * ch-parse.y (setelement, optsetvalue): Allow numbered,
- unnamed set elements.
-
-Wed Jun 23 16:25:06 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * c-typeck.c (process_init_constructor): Suppress
- errors about un-initialized array elements if the
- array is VARYING, as signaled by C_TYPE_VARIABLE_SIZE.
- * ch-actions.c (lang_init): Set flag_short_enums, so that CHILL
- enumerations *can* be only a byte in size.
- (adjust_parm_or_field): Convert untyped parameter before
- looking at its type to process it.
- * ch-convert.c (convert): Generate [ -1, -1 ] value for
- an INSTANCE type.
- * ch-decl.c (do_decls): Assure that a CONSTRUCTOR has a
- type, so that output_constant doesn't seg fault.
- * ch-except.c (start_handler_array): Use unique identifier for
- exception array, so we can have > 1 array per reach.
- * ch-lang.c (finish_chill_enum): Error if number of
- enumeration values exceeds 256.
- * ch-parse.y (check_end_label): Error, not warning if start
- and end labels don't match.
- (assignaction): Convert RHS. Allows untyped tuples to be
- passed to stabilize_reference.
- (exceptlist, onexceptprefix): Error if non-unique exception
- name is coded.
- * ch-tree.c: Added form feeds, comment reformatted.
- * ch-typeck.c (chill_expand_tuple): Compare tree value to
- NULL_TREE, not zero. Add a constructor element for a
- VARYING array's length to the constructor list.
- (build_varying_struct): Mark the type as VARYING for
- process_init_constructor.
- * toplev.c (lang_options): Add '-lang-chill' and
- '-fchill-grant-only' options to table.
-
-Tue Jun 22 13:13:41 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-actions.c (build_chill_function_call): Add check
- to prevent calling a PROCESS like a PROCEDURE.
- * ch-parse.y (rcalternative): Add check for an
- receive case alternative after a RECEIVE CASE
- statement.
- * ch-tree.h: Fix macro ENCAPSULATED_ARRAY_P.
- * ch-lang.c (lang_finish): Remove resetting errorcount
- and sorrycount for granting.
-
-Mon Jun 21 17:56:48 1993 Bill Cox (bill@rtl.cygnus.com)
-
- Receiving signals works.
- * ch-actions.c (lang_init): Add else_clause flag to
- __wait_signal parameter list.
- * ch-lex.l: Add SIGNALNAME token, return when appropriate.
- * ch-parse.y (SIGNALNAME): New token. Delete
- empty_untyped_exprlist token, no longer used. Add
- name_or_signal non-terminal. Standardize a few NULL
- tests. Add real RECEIVE CASE semantics. Add checks that
- SIGNALS, BUFFERs are only declared at global scope.
- (call): Add signal declarations with/without data fields.
- * ch-tasking.c (get_tasking_code_name, get_tasking_code,
- build_chill_receive_case_start, build_chill_receive_case_end,
- build_chill_receive_case_label): New functions.
- Replace build (CONSTRUCTOR, ... calls with build_nt
- (CONSTRUCTOR, calls.
- * ch-tree.h: New prototypes.
-
-Thu Jun 17 18:36:38 1993 Bill Cox (bill@rtl.cygnus.com)
-
- SIGNAL declaration compilation, seizing & granting,
- SENDing also.
- * ch-actions.c (lang_init): Move instance_type_node
- build to ch-tasking.c. Call build_tasking_message_type.
- Build a type for send_signal. Put builtin_function
- calls into alpha order.
- (adjust_proc_param): Rename to adjust_parm_or_field,
- add is_signal flag, so signal fields can use it. Rename
- calls to it, add flag to calls.
- * ch-decl.c (push_chill_extern_signal): Add function.
- * ch-grant.c (decode_decl): Correct signal decl output.
- (do_seize): Correct check for process seizure. Add
- code for seized signal decl.
- * ch-lex.l (yylex): Treat POS, ROW, STEP as reserved.
- * ch-loop.c (get_unique_identifier): Standardize loop
- temporary's name to assure that it's not granted.
- * ch-parse.y (SIG_NAME): Delete unused token.
- (spec_declist): Delete silly printf.
- (quasi_signaldef): Add non-terminal.
- (sendaction, optsendwith, optsendto, optpriority):
- Implement actual working semantics.
- (call, empty_untyped_exprlist): Allow empty signal
- fields between parens.
- * ch-tasking.c: Rename adjust_proc_param calls, add
- is_signal flag to calls. Make instance_type_node a
- type, not a TYPE_DECL, change references. Fix all
- CONSTRUCTOR builds. Add make_signal_struct function.
- Move build_instance_type here from lang_init.
- (build_tasking_message-type, build_signal_descriptor,
- build_chill_send_signal): New functions.
- * ch-tree.h: Add, update protos.
- * ch-typeck.c (build_chill_cast): Check for NULL expression
- type as well as error_mark.
-
-Thu Jun 17 12:28:03 1993 Jim Wilson (wilson@sphagnum.cygnus.com)
-
- * Makefile.in (STAGESTUFF): Add chill to list.
-
-Wed Jun 16 07:12:53 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * Makefile.in: Complete the renaming of ch-process.c
- to ch-tasking.c.
- * ch-decl.c (push_chill_extern_function): Drop is_process
- parameter, and marking process decl trees.
- (push_chill_extern_process): New function for
- SEIZEd processes. Lotsa form feeds added for print
- readability.
- * ch-grant.c (decode_decl): Handle GRANTing of SIGNAls.
- (do_seize): New parameter seize_all. Handle sseizing
- processes.
- (chill_seize): Pass seize_all parameter.
- (chill_grant): Check for __tmp_ prefix, to disable
- *either* seizing or granting.
- * ch-parse.y (quasi_pdef): Delete is_process parameter for
- push_chill_extern_functon, call push_chill_extern_process
- for processes.
- (specialinit): Comment these rules as needed only until
- 2-pass compiler is operational.
- (extprocedure): Delete is_process parameter.
- (simpledec): Delete `sorry' about SIGNAL decls.
- (optsigdest): Correct check for process name.
- * ch-tasking.c (build_signal_decl): Finish coding.
- * ch-tree.h: Add macro to save a SIGNAL's destination
- process name in an id node. Add/change prototype.
-
-Mon Jun 14 18:17:13 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-actions.c (lang_init): Build instance_type_node.
- Change `this' to a runtime function call.
- * ch-grant.c (do_seize): Generate tasking-code
- variable for seized process.
- * ch-lex.l (equal_number): Also accept synonym
- name for numeric value.
- * ch-parse.y (primval): Add process-related
- function calls.
- (signaldef, etc.): Rough draft of SIGNAL definition
- processing.
- (stopaction): Call runtime function.
- (pdef): Pop symbol level if ending a process
- and there were parameters.
- (primval): Call `whoami' runtime function for THIS.
- * ch-tasking.c (build_process_header): Be sure
- to define the tasking enum, if it hasn't already
- been done. Only call shadow_record_fields if there
- are parameters.
- (build_tasking_enum): Only call start_enum *after*
- checking the already_built flag.
- (build_copy_number, get_tasking_code,
- build_gen_code, build_gen_inst, build_get_ptype,
- build_proc_type): New functions for process-related
- builtins.
- (build_signal_decl): New function for SIGNAL
- declaration - rough draft.
- * ch-tree.def (INSTANCE_TYPE): new tree code.
- * ch-tree.h: New prototypes. Defines for instance
- type field access.
-
-Sat Jun 12 21:15:02 1993 Bill Cox (bill@rtl.cygnus.com)
-
- Get start-process action working:
- * ch-actions.c (adjust_proc_param): new function,
- extracted from build_chill_function_call and called
- from there.
- * ch-tree.h, ch-grant.c (do_seize): Add process_type
- parameter to add_taskstuff_to_list call, prototype.
- * ch-parse.y (start_parlist): New non-terminal for
- START action.
- (startaction): Reference start_parlist, check for
- integer-valued process copy-number.
- (optstartset): Check instance parameter - must be
- an INSTANCE_TYPE location.
- * ch-tasking.c (generate_tasking_code_variable): New
- function, extracted from tasking_setup and called
- from there. Also called from build_process_header.
- (build_process_header): Add process_type parameter
- to add_taskstuff_to_list call. Remove incrementing
- of process_type (moved into generate_tasking_code
- _variable).
- (build_chill_start_process): Complete rewrite.
- (add_tasking_stuff_to_list): Add stuffnumber parameter
- putit on the list.
-
-Sat Jun 12 06:08:09 1993 Bill Cox (bill@rtl.cygnus.com)
-
- Getting processes compiled, initialized and granted:
- * .cvsignore: Add chill file.
- * c-decl.c (shadow_record_fields): Allow PARM_DECL
- as well as VAR_DECL.
- * ch-actions.c (lang_init): Move build of
- initializer_type into ch-tasking.c. Change
- definition of THIS to function call.
- * ch-decl.c (massage_param_node): Add comments.
- (start_chill_function): Set nested flag in
- start_function call based upon current_function_decl,
- not as constant zero.
- * ch-grant.c (decode_decl): lotsa code by Wilfried to
- GRANT process decls.
- (finish_chill_module): Completely rewrote interface
- to runtime.
- * ch-lex.l (THIS): Just return the token code.
- * ch-parse: Add THIS token.
- (processpar, processparlist): New rules, to collect
- process parameters.
- (pdef): Add code to pop the process' WITH scope.
- (procedure): Set process WITH scope flag to zero.
- (process): Move most code into build_process_header.
- (primval): Output function call for THIS.
- * ch-tasking.c (add_taskstuff_to_list, build_tasking_enum,
- make_process_struct, build_process_header): New code
- to handle process translation and interface to runtime.
- * ch-tree.h: New prototypes.
-
-Thu Jun 10 13:32:51 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * Makefile.in: Change ch-process.c to ch-tasking.c.
- A delayed part of the last change..
-
-Thu Jun 10 11:14:59 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * .cvsignore: Add 'chill' file.
- * ch-actions.c (lang_init): Add new runtime function
- __register_process.
- * ch-decl.c (push_chill_extern_function): Add is_process
- input flag, use it.
- * ch-grant.c (decode_decl): Recognize a process for
- granting.
- (do_seize): Put seized processes onto the tasking_list.
- (chill_finish_module_code): Declare init_list entry,
- link it onto the init_list. Call tasking_setup and
- tasking_registry.
- * ch-lex.l: Make tasking-related variables global,
- delete their initialized flags.
- * ch-parse.y: Add is_process flag to push_chill_extern_function
- calls. Put processes onto the tasking_list.
- * ch-process.c: Renamed to ch-tasking.c.
- * ch-tasking.h: New file.
- * ch-tree.h: New, adjusted prototypes.
-
-Wed Jun 9 10:59:27 1993 Wilfried Moser (moser@deneb.cygnus.com)
-
- * chill: This file is replaced by chill.in and will be
- generated during 'make' and 'make install'. This script
- now finds the correct chillrt0.o and libchill.a during
- linking.
- * chill.in: New file that replaced chill.
- * Makefile.in: Add rules to make chill out of chill.in.
-
-Wed Jun 9 09:03:55 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * .cvsignore: Add gfloat.h and xlimits.h.
- * ch-actions.c (lang_init): Create new type for module-
- level initializer list entry.
- * ch-grant.c (chill_start_module_code): Rename actual
- module-level code to just the modulename, which is
- *not* public.
- (chill_finish_module_code): Allocate space for initializer
- list entry, build real initializer function, which puts
- the list entry on the runtime list. Name the init function
- as the module's constructor function.
- * ch-tree.h (build_init_struct): Add prototype.
- * ch-typeck.c (build_init_struct): Add function, called
- from lang_init.
- Note: these changes require a new devo/chillrt/chillrt0.c.
-
-Thu Jun 3 17:04:01 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * c-decl.c: Fix comment.
- * ch-actions.c, ch-grant.c: Standardize front end:
- #define first, etc. Add comments.
- (lang_init): Delete unused flag, code for inapplicable
- gen-decls option. (lang_decode_option): Delete
- gen-decls option, add grant-only option, flag.
- * ch-convert.c, ch-decl.c, ch-except.c, ch-tree.c,
- ch-typeck.c: Add form feed after front end.
- * ch-expr.c: Standardize testing for error_mark node.
- * ch-lang.c: Remove unused deep_fold function.
-
-Fri May 21 11:04:22 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * c-typeck.c (build_binary_op, build_unary_op):
- Recognize BOOLEAN_TYPE.
- * ch-actions.c (build_chill_unary_op): Remove
- some crufty work-arounds.
-
-Thu May 20 19:03:48 1993 Per Bothner (bothner@deneb.cygnus.com)
-
- * ch-grant.c (decode_constant): If the granted value is a
- cast, make sure to emit an appropriate expression conversion.
-
-Thu May 20 16:35:35 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-lang.c (build_chill_range_type): Initialize the
- precision variable. Double-negative ranges work now.
-
-Thu May 20 11:24:42 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-actions.c (build_unary_op): Compound a wretched
- hack which hides a BOOLEAN_TYPE from the underlying
- C code.
-
-Wed May 19 16:45:54 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-actions.c: (CH_SINGLETON_SET): Add function, call it
- from chill_comptypes. (build_chill_unary_op): Give
- better name to unsigned flag.
- * ch-expr.c (chill_expand_assignment): Correct calling
- sequence for setpowersetbits runtime routine.
- * ch-grant.c (raw_decode_mode): Give better name to
- unsigned flag. (decode_constant): Check for null
- 'val' ptr, avoid seg fault.
- * ch-lex.l (convert_number): Give better name to
- unsigned flag. (convert_bitstring): Move increment
- of bl counter to emphasize that it increments once
- per loop.
- * ch-tree.h: (NO_SOURCE_UNARY_MINUS): Define new flag.
- * ch-typeck.c (chill_expand_tuple): Build BOOLEAN
- constructor if given a singleton set constructor.
-
-Thu May 13 17:03:04 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * c-decl.c (pushdecl): Complete May 9 change.
- * ch-actions.c (build_chill_unary_op): Set the
- TREE_UNSIGNED flag FALSE for raw_decode_mode.
- * ch-grant.c (grant_array_type): Correct the May 12
- check for circularity.
- (raw_decode_mode): Use TREE_UNSIGNED flag to
- control range's printing.
- (chill_grant): Remove useless, bogus code.
- * ch-lex.l (convert_number): Set the TREE_UNSIGNED
- flag TRUE for raw_decode_mode.
-
-Wed May 12 18:04:01 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-decl.c (push_syndecls, push_modedef): Comment
- reminders to check for circular definitions. Later!
- * ch-grant.c (grant_array_type, decode_decl): Prevent
- circular definitions in the use of the array's
- type name.
-
-Wed May 12 16:06:13 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-grant.c (grant_array_type): If array_type has
- a name, just use it.
- * ch-lang.c (build_chill_range_type): Don't force
- unsigned ranges on output.
- * expr.c (store_constructor): Preclude seg fault.
-
-Wed May 12 07:49:00 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-actions.c (fold_set_*): Correct tests for
- range set-constructor list entries.
- (lang_init): Define setpowersetbits function.
- * expr.c (store_constructor): Handle non-constant
- set constructors.
-
-Tue May 11 18:25:40 1993 Per Bothner (bothner@cygnus.com)
-
- * ch-lang.c (build_chill_range_type): If the parent type
- is unknown, and the endpoints of the range are integer
- constants, use the smallest suitable integer type.
- * ch-lang.c (build_chill_range_type): Remove kludge
- for dealing with char ranges.
-
-Tue May 11 15:24:31 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-actions.c (build_chill_repetition_op): Build a
- range-type set constructor if there's only one value
- in the repeated constructor.
- (fold_set_*): Abort if range value seen, for now.
- * expr.c (store_constructor): Handle range-type by
- storing bytes rather than bits as much as possible.
-
-Mon May 10 18:45:18 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-actions.c (invalid{left right}_operand): Add
- handlers for REPLICATE_EXPR.
- (build_chill_repetition_op): Build constructor list
- for repetition of bitstring.
- * ch-parse.y (call): Recognize more trees as arrays,
- to avoid error msg.
- (operand5): Add count, string temporaries, use them.
-
-Mon May 10 16:49:08 1993 Per Bothner (bothner@cygnus.com)
-
- * ch-grant.c (seize_implied_names): Fix code that assumed
- a FUNCTION_DECL (or PROCESS_DECL) to work on types instead.
- * ch-grant.c (generate_set, grant_parent_of_enum,
- grant_parent_enum): Removed unused functions.
- * ch-grant.c (raw_decode_mode): Remove commented-out code.
-
-Mon May 10 10:54:57 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-grant.c (do_seize, seize_implied_types): Move
- result and parameter processing to proper place.
- (chill_seize): Mark unseized identifier with
- error_mark_node, to avoid excessive errors.
- * ch-parse.y (call): Check for ERROR_MARK before
- reporting an error.
-
-Sun May 9 17:21:24 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * c-decl.c (pushdecl): If a strongly-visible name is
- seen, in conflict with a weakly-visible name, take
- the strongly-visible one and don't complain.
- * ch-actions.c (chill_comptypes): Allow chain of ref-
- erence types > 1 in length.
- * ch-grant.c: Turn disguised for-loops into actual
- ones, so continue works. Delete redundant code in
- seize_implied_names. Reindent.
- * expmed.c (store_split_bit_field): Disable abort for
- CHILL.
-
-Sun May 9 17:11:33 1993 Per Bothner (bothner@cygnus.com)
-
- * ch-convert.c (convert): Move handling of SET_TYPE until
- after we've handled de-referencing and such like.
- * ch-grant.c (grant_array_type): Simplify; remove (now-)
- bogus call to generate_set.
- * ch-grant.c (get_type): Remove obsolete stuff.
-
-Fri May 7 10:30:34 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-actions.c (lang_init): Add definition of psslice
- runtime routine. (build_chill_binary_op_1,
- build_chill_binary_op): Have result type of
- TRUTH_ANDIF_EXPR be boolean, not integer. Some
- reindenting.
- * ch-convert.c (convert): Use consistent notation
- for expression.
- * ch-parse.y: Add front-end pass count. (locdec):
- Add syntax for other BASED declaration.
- * ch-tree.c: Fix comment.
- * ch-typeck.c (build_chill_slice): Implement a runtime
- call for bitstring slices. (build_chill_cast):
- Add code for BITS_BIG_ENDIAN bit loop.
- (chill_expand_tuple): Don't pass ref type to
- digest_init, only underlying type.
-
-Thu May 6 12:52:14 1993 Per Bothner (bothner@cygnus.com)
-
- * ch-typeck.c (build_chill_cast): type_for_size takes
- a size in bits, not bytes.
-
-Wed May 5 19:02:55 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-actions.c: Break out separate routines for set
- folding, handle ranges in set_fold_eq and set_fold_ne.
- Fix folding as req'd by TTC test.
- * ch-grant.c (raw_decode_more): Check for content match
- to decide output mode, not pointer identity.
- * ch-typeck.c: Add cross-reference comment.
- * varasm.c (emit_set_data): Clarify parameter name.
- Handle INTEGER_CST as set constructor.
- (output_constant): Handle CONSTRUCTOR node for sets.
- Apparently forgot to actually 'checkin' this one last
- time.
-
-Wed May 5 12:23:58 1993 Jim Wilson (wilson@sphagnum.cygnus.com)
-
- * ch-parse.y, ch-tree.h (get_current_declspecs): Obsolete; deleted.
-
-Tue May 4 15:47:44 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-actions.c (fold_set_expr): new function to fold
- set expressions. Calls inserted into
- build_chill_binary_op and build_chill_unary_op.
- (build_chill_repetition_op): New function, called
- from build_chill_function_call.
- * ch-expr.c (chill_expand_assignment): Call
- build_chill_repetition_op.
- * ch-grant.c (decode_constant): Comment out deep_fold
- call. The earlier fold_set_expr calls should make
- this one unnecessary. Prevent seg fault when name
- of structure field is NULL. Standardize for loop.
- * ch-parse.y: Fix comments.
- (operand5): build a REPLICATE_EXPR. Don't call
- build_repetition_op until we have a type.
- * ch-tree.def (REPLICATE_EXPR): Define tree-code.
- * ch-tree.h (build_chill_repetiton_op): Fix proto.
- * ch-typeck.c (chill_expand_result): Call
- build_chill_repetition_op if needed.
- * varasm.c (emit_set_data): Clarify parameter name.
- Handle INTEGER_CST as set constructor.
- (output_constant): Handle CONSTRUCTOR node for sets.
-
-Mon May 3 13:06:47 1993 Per Bothner (bothner@cygnus.com)
-
- * ch-typeck.c (build_chill_cast): Allow more liberality to
- casting: Any discrete type to any non-discrete type that is the
- same size as some other discrete type (and vice versa).
- * stor-layout.c (layout_type, case SET_TYPE): If the number
- of bits will fit in a char or short, only use that many bits.
-
-Mon May 3 08:22:45 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-grant.c (decode_constant): Revert interpretation
- of SET_TYPE as integer.
-
-Mon May 3 07:55:46 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * chparse.y (casealternative): Allow empty action list.
-
-Sat May 1 15:07:01 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * expr.c (expand_expr): Add parameter to __inpowerset
- runtime call, to match new runtime.
-
-Sat May 1 14:55:58 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-actions.c: Cleanup from -Wall. Reindent.
- Redefine __inpowerset to take a 'minval' parameter
- that matches the new runtime. Added comments.
- * ch-expr.c (chill_handle_case_label): Handle
- NULL or ERROR trees.
- * ch-grant.c (get_type): Survive bogus type params,
- return empty string.
- * ch-tree.c (build_powerset_type): Diagnose powerset
- of non-discrete type.
- * ch-typeck.c (discrete_type_p): Reindent.
-
-Fri Apr 30 16:08:54 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-grant.c (decode_constant): Interpret SET_TYPE
- with integer value, so we output the same stuff as
- the user gave us.
- * ch-parse.y: Fix indentation.
-
-Fri Apr 30 09:34:03 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-actions.c (chill_comptypes): Simplify, correct
- integer subrange analysis.
- * ch-grant.c (seize_implied_names): Add handling for
- PROCESS_DECL, PROCESS_TYPE.
- (do_seize): Call seize_implied_names for process,
- procedure parameters and return value.
- * ch-lang.c (finish_chill_enum): Canonicalize enum
- types.
- * ch-tree.def (PROCESS_TYPE): Add.
- * ch-typeck.c (valid_array_index): Call chill_comptypes
- rather than broken macro CH_COMPATIBLE. The logic
- in chill_comptypes will get moved to the macro later.
-
-Thu Apr 29 13:07:55 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-actions.c (build_chill_lower, build_chill_upper):
- Handle enumeration types.
- (build_chill_binary_op): Call chill_comptypes
- to error check IN arguments. Change error
- messages to say 'mode' rather than 'type'. Cast
- tree codes when build is called.
- * ch-expr.c (chill_expand_array_assignment): Call
- chill_comptypes to validate assignment args.
- * ch-lex.l: Add newline for readability.
-
-Wed Apr 28 15:22:18 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * Makefile.in (ch-hash.h): Add rule to build this
- from chill.gperf. Not yet used.
- * ch-actions.c (build_chill_binary_op): Allow enum
- subranges on RHS of IN operator.
- * ch-grant.c (decode_constant): Recognize
- error_mark_node as empty powerset initializer,
- re-indent a bit.
- * ch-lang.c (deep_fold): Return error_mark_node for
- NULL input pointer or incoming error_mark_node.
- * ch-lex.l: Ignore PACK and UNPACK keywords. Return
- POS, ROW, and STEP as user-defined names.
- (name_or_type): New function for above.
- * ch-parse.y: Move token defs for following, comment
- them separately: NOPACK, PACK, POS, ROW, STEP
- * varasm.c (output_constant): Check for VAR_DECLs in
- records & unions, like arrays. Don't abort.
-
-Tue Apr 27 17:42:29 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-actions.c (CH_PROMOTING_INTEGER_TYPE_P):
- rewrite for generality.
- * ch-decl.c (grok_chill_variantdefs): Use chill
- comptypes, so that subrange compatibility is ok.
- (start_chill_function): Use lookup_name(), not
- IDENTIFIER_GLOBAL_VALUE, for full generality.
- * ch-expr.c (chill_expand_assignment): Need to
- handle non-NOP modify codes here, since C code
- in build_modify_expr won't understand powersets,
- etc.
-
-Tue Apr 27 09:05:31 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-actions.c (build_max_min): Assign the set's
- base type to the function's return type.
- (build_chill_function_call): Before complaining
- about parameter mismatches, convert certain actual
- parameters.
- * ch-expr.c (chill_expand_assignment): Before
- complaining about LHS/RHS mismatches, convert
- certain RHS expressions.
- * ch-grant.c (decode_constant): Deep-fold incoming
- expression, so we can output it.
- * ch-lang.c (deep_const_expr): New function, called
- from const_expr, actually traverses the tree
- looking at its leaves for 'const'ness.
- (deep_fold): New function to fold already-built
- trees.
- * ch-parse.y (case_expr): Add whitespace.
- * ch-tree.h: Add prototype for deep_fold.
-
-Tue Apr 27 07:21:43 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-actions.c (chill_comptypes): Allow enumeration
- subranges as compatible with the parent enum.
- (build_chill_function_call): Before checking type
- compatibility, use convert on typeless expressions,
- like constructors.
- * ch-expr.c (chill_expand_assignment): Before
- checking type compatibility, use convert on
- typeless expressions, like constructors.
- * ch-lex.l: Add comment.
-
-Thu Apr 22 17:23:25 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * .cvsignore: Add genopinit, insn-opinit.c
- * c-common.c (binary_op_error): Prevent seg fault on
- unknown node code.
- * ch-typeck.c (build_chill_array_ref): Remove old
- lower-bound-of-array-index-nonzero code.
- * expr.c (expand-expr, get_inner_reference): Remove
- old lower-bound-of-array-index-nonzero code.
-
-Thu Apr 22 16:01:09 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * c-decl.c (shadow_record_fields): Add pushlevel for
- each PROCESS parameter, too.
- * ch-process.c (make_process_struct): First working
- version.
- * ch-tree.def: Add PROCESS_DECL definition.
- * ch-tree.h: Add CH_IS_EVENT_MODE macro, change proto
- for make_process_struct.
- * expr.c (expand_expr): Add references to
- PROCESS_DECL. Add #include of ch-tree.h.
- * tree.c (decl_function_context): Add check for a
- PROCESS_DECL, and #include for ch-tree.h.
-
-Thu Apr 22 09:25:08 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * expr.c (expand_expr): Add missing prototypes, and
- parameters to expand_expr call.
-
-Wed Apr 21 16:17:07 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * c-decl.c (shadow_record_fields): Add ability to
- handle pointers to records/unions. For PROCESS
- compilation.
-
-Thu Apr 22 09:25:08 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-expr.c (chill_expand_expr): Add missing
- parameters to expand_expr calls. Some trivial
- reformatting for readability.
-
-Wed Apr 21 16:17:07 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-lex.l: Make send_*_prio externally visible,
- default them to zero, eliminate the init flags.
- Same for process_type.
-
-Sat Apr 17 10:59:50 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-actions.c (build_chill_binary_op): Build a
- BIT_FIELD_REF tree for IN_EXPR operations.
- * ch-typeck.c (build_chill_array_ref): Build a
- BIT_FIELD_REF tree for access to packed array of
- bits.
-
-Fri Apr 16 12:33:34 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-parse.y (EXIT action): Improve error checking,
- messages.
- * ch-typeck.c (chill_expand_tuple): Remove code to
- pack sets (moved to varasm.c long ago).
- * varasm.c (unpack_set_constructor): Rename size to
- bit_size, since 'size' always means bytes.
- (pack_set_constructor): Rename size to wd_size,
- since 'size' always means bytes.
- (output_constant): Set size to zero, so that extra
- bytes of padding aren't output after set constants.
-
-Fri Apr 16 11:57:50 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * .cvsignore: Add .gdbinit.
- * ch-decl.c (start_chill_bindings): Add function name
- to binding contour's exit_label for EXIT stmt.
- * ch-parse.y (EXIT action): Call lookup_name to avoid
- inserting label for function name. Also check
- IDENTIFIER_LABEL_VALUE for label's decl.
- (caseaction, beginendblock, ifaction): Call
- stamp_nesting_label to put action's label into
- contour for EXIT to find.
-
-Thu Apr 15 17:17:05 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * expr.c (expand_expr): Unify, clean up handling of
- IN_EXPR, and handling of bit-string element ref.
- Now, all goes through IN_EXPR handler.
- * stmt.c (stamp_nesting_label, expand_exit_labelled):
- New functions, which allow either label or
- function decls.
-
-Thu Apr 15 17:17:05 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-actions.c ch-actions.h ch-convert.c ch-decl.c ch-except.c
- ch-expr.c ch-grant.c ch-inout.c ch-lang.c ch-lex.h ch-lex.l
- ch-loop.c ch-parse.y ch-process.c ch-tree.c ch-tree.def
- ch-tree.h ch-typeck.c: Add 1993 copyright, fix titles.
- * ch-actions.c (build_chill_binary_op): Move runtime function call
- to expr.c. Just build a tree here. Clean up error checking.
- * ch-convert.c (convert): Simply store a type into an expression if
- TREE_TYPE (expr) == NULL. Prevent error if an enum is to be
- converted to a set of such enums.
- * ch-loop.c (init_loop_counter): Restore error msg for undeclared
- variable if no local scope is to be created for the loop.
- * ch-typeck.c (build_chill_array_ref): Turn bit array ref into IN_EXPR,
- remove redundant code which wasn't ever called.
-
-Wed Apr 14 07:54:00 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * .cvsignore (y.tab.c) : Add to list.
- * ch-convert.c (convert): Check pointers better - avoid NULL reference.
- Remove redundant check for ERROR_MARK - already checked earlier.
- * ch-parse.y (get_type_of): Add parameter checks for NULL ptrs and
- error_mark_node.
-
-Tue Apr 13 16:00:37 1993 Per Bothner (bothner@cygnus.com)
-
- * c-decl.c (start_function): If there is a previous
- function declaration of the same name, steal its RTL.
- This is a kludge needed for forward declarations of
- nested functions.
- * ch-decl.c (push_chill_extern_function), ch-tree.h: New
- function, for external and seized function declarations.
- Make sure to use permanent obstack.
- * ch-parse.y (quasi_pdef, extprocedure): Use new function.
-
- * ch-grant.c (chill_finish_module_code): Since module
- function is no longer visible,, can't get it using
- lookup_name(). Use current_function_decl instead.
-
- * ch-decl.c (build_chill_function_type): Add void_type_node
- to end of parameter types list.
-
- * ch-grant.c (chill_start_module_code): Make sure module
- function isn't visible (and hence isn't granted).
-
-Tue Apr 13 15:48:25 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-loop.c (begin_chill_loop): Also stamp the user's loop name into
- current contour for DO FOR EVER loops.
-
-Tue Apr 13 14:37:39 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-parse.y (actionstatement): Add error rule. Delete
- POP_UNUSED_ON_CONTEXT. Add comments about label name usage.
- (nohandleraction): Better error check in EXIT processing.
- (optexprlist): Comment out make_function_rtl call.
- (seizestatement): Change error to warning.
-
-Tue Apr 13 08:29:31 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-grant.c (raw_decode_mode): Supply missing parameter in get_type
- call.
- * ch-loop.c (begin_chill_loop): Take loop label as parameter. Stamp
- its name into the current contour's exit_label, for EXIT to use.
- * ch-parse.y: (actionlabel): Save label tree in global variable.
- (actionstatement): Clear label to NULL when action is finished.
- (handlerstatement, nohandlerstatement): Split actions into
- categories which do/don't permit exception handlers.
- (exitaction): Move code into nohandleraction, make it work.
- (doaction): Pass (possibly NULL) label tree to begin_chill_loop.
- * ch-tree.h: Add parameter to begin_chill_tree prototype.
- * stmt.c (stamp_nesting_label, expand_exit_labelled): Add functions.
- Note: This implementation of EXIT only exits from loops, not yet
- from other bracketted statements.
-
-Mon Apr 12 13:41:55 1993 Per Bothner (bothner@rtl.cygnus.com)
-
- * ch-grant.c (chill_grant): Remove obsolete code.
-
- * ch-decl.c (push_synmode, push_newmode): Merged to yield ...
- * ch-decl.c (push_modedef): ... w/ slightly different interface.
- * ch-tree.h, ch-process.c (make_process_struct), ch-parse.y
- (modedefinition): Use new push_modedef function.
- * ch-parse.y (modedefinition): Don't depend on inherited
- attributes (- implemented incorrectly!): Use a global variable
- parsing_newmode to distinguish synmode and newmode.
-
-Mon Apr 12 08:10:34 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-loop.c: Diffuse cleanup after big functional changes.
- * ch-parse.y: Eliminate temporary variables, now unnecessary. Use
- parse-time stack instead.
- * ch-tree.h: Change build_chill_iterator prototype.
-
-Sun Apr 11 15:50:33 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-convert.c (convert): Replace an ERROR_MARK type - from a
- untyped_expr with the given type. Move chill_expand_case_expr
- call inside chill_expand_expr.
- * ch-expr.c, ch-tree.h, ch-typeck.c (chill_handle_case_default,
- chill_handle_case_label, chill_expand_case_expr): Move to ch-expr.c
- from ch-typeck.c.
- * ch-loop.c: Major reorganization to support multiple iterators in
- DO FOR loop, very little new code, just a re-org.
- * ch-parse.y (iterationlist): Add handling for multiple loop iterators.
-
-Sat Apr 10 14:40:12 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-actions.c (build_chill_lower, build_chill_upper): Clean up.
- * ch-grant.c (chill_grant): Avoid making strange SYNMODE for enum
- member.
- * ch-lex.l (equal_number): Add function to look in the input for '='
- followed by a decimal literal. Call it from directive scanning.
- (start state 'ccitt'): Deleted, unused. Moved unused, but reserved,
- tokens to NORMAL state.
- (compiler_directive): Replaced by equal_number. Now the only
- recursive call to yylex happens in check_newline at the beginning
- of a compilation.
-
-Sat Apr 10 09:55:50 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-actions.c (build_chill_case_expr): Added from ch-parse.y.
- * ch-lex.l (ENTRY, PERVASIVE, ROW, STEP): Add token recognition to
- 'reserve' them.
- * ch-parse.y (case_expr): Move code into ch-actions.c. There will
- need to be much more written.
- * ch-tree.def (VARY_ARRAY_REF): Add comment.
- * ch-tree.h (build_chill_case_expr): Add prototype.
- * ch-typeck.c (build_chill_cast): Allow untyped_expr - just assign the
- type to the expr. Check for CASE_EXPR, call expand_case_expr.
-
-Sat Apr 10 01:10:51 1993 Per Bothner (bothner@rtl.cygnus.com)
-
- * ch-parse,y (in_pseudo_module): New variable. Try if we're
- in a seizefile, but not in a module nested in the seizefile.
- Use for backwards compatibility with old grantfiles.
- * ch-decl.c (do_decls, push_syndecls, push_newmode, push_synmode):
- If in_pseudo_module, grant new declaration.
- * ch-decl.c (pushd_newmode): If there is a granted previous
- incomplete type, fix it up.
- * ch-grant.c (seize_implied_names): Do remaining types.
- Guard against recursion.
- * ch-tree.h (IDENTIFIER_ENUM_VALUE): Removed, not used.
- * ch-tree.h (CH_DECL_ENUM), ch-grant.c (chill_grant), ch-lang.c
- (finish_chill_enum): Enum constants are marked with
- CH_DECL_ENUM so they don't get written to the grantfile.
- * ch-tree.h (IDENTIFIER_GRANTED_VALUE): Allow fast seizing.
- * ch-lex.l: Re-write to use start states, to avoid calling
- yylex() recursively.
- * ch-lex.l (compiler_directive); This is now obsolste. FIXME.
- * ch-lex.l: Call push_module and pop_module when reading a
- seizefile. This creates a pseudo-module.
- * ch-parse.y: Clean up handling of empty declarations and
- action statements; semicolons are now optional a number of
- places.
- * ch-parse.y: Remove some bogus tests for "statement
- out of sequence" (they're both legal and work).
- * varasm.c (mak_function_rtl): Remove kludge that may
- not be necessary (and loses anyway).
-
-Fri Apr 9 09:37:38 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-expr.c (chill_expand_array_assignment): Remove false error about
- arrays that are too small.
- * ch-parse.y (callaction): Don't pass an error_mark_node to
- c_expand_expr_stmt.
-
-Fri Apr 9 00:26:54 1993 Per Bothner (bothner@rtl.cygnus.com)
-
- * ch_tree.h (DECL_HIDDEN_BY_MODULE, ENCAPSULATED_ARRAY_P):
- New macros.
- * ch-actions.c (build_chill_function_call): Use latter.
- * ch-typeck.c (chill_similar): Fix typo.
- * ch-grant.c (raw_decode_mode): Handle ENCAPSULATED_ARRAY_P
- parameter types.
- * ch-grant.c (seize_implied_names): Handle ranges of enums.
- * ch-grant.c (do_seize): Set DECL_SOURCE_FILE and _LINE of
- seized declaration to be the point of the seize itself.
- * ch-grant.c (chill_grant), ch-tree.h: Add a parameter
- which is the list (in order) of decls in the module.
- Don't reverse the getdecls() list; that is handled by caller.
- * ch-grant.c (chill_grant): Test that a declaration is
- visible before writing it.
- * ch-parse.y (push_module): Make sure to hide declarations
- from surrounding module.
- * ch-parse.y (pop_module): Restore those declarations.
- * ch-parse.y (pop_module): This function is now responsible
- for writing out for calling chill_grant() to the grant file.
- * ch-actions.c (lang_finish): Remove calls to chill_grant().
-
-Thu Apr 8 16:56:52 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-actions.c (build_char_array_expr): Add handling of varying
- arrays in relational expressions.
- * ch-decl.c: Add prototype for lookup_name_current_level.
- * ch-expr.c (chill_expand_expr): Make concat_expr's temp a BLKmode,
- so its length is used as the temp's size.
- (chill_expand_array_assignment): Correct for varying := varying
- assignment, clean up.
- * ch-typeck.c: Add prototype for require_complete_type.
-
-Wed Apr 7 16:41:29 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-loop.c (for_location, begin_chill_loop, end_chill_loop): Major
- diffuse changes to fix location loops.
- * ch-parse.y (location): Remove ref through NULL ptr.
-
-Wed Apr 7 13:42:06 1993 Per Bothner (bothner@rtl.cygnus.com)
-
- * ch-decl.c (massage_param_node): New function.
- It handles the LOC/IN/OUT/INOUT parameter distinction,
- as well as calling build_chill_array_parm_type if needed.
- * ch-tree.h (massage_param_node): New prototype.
- * ch-decl.c (push_parms): Use new massage_param_node().
- * ch-parse.y (pmodearg): Use new massage_param_node().
- * ch-parse.y (formpar): Don't call build_chill_array_parm_type;
- now handled by massage_param_node.
- * ch-typeck.c (my_build_array_ref): Handle non-zero array
- lower bounds.
- * ch-actions.c (build_chill_function_call): If the formal
- parameter is a pseudo record wrapped around an array, make
- sure we wrap the actual parameter in a record CONSTRUCTOR.
- * ch-typeck.c (build_chill_array_parm_type): Make sure
- the pseudo struct type is allocated on the permanent_obstack.
- * ch-parse.y (location): Remove thinko.
- * ch-actions.c (chill_comptypes): Comment out test for
- NEWMODEness - it gets broken by the forward declaration hacks.
-
-Tue Apr 6 18:05:40 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-actions.c: Move build_varying_struct to ch-typeck.c.
- * ch-parse.y (formpar): Turn ARRAY_TYPE parms into structure.
- * ch-parse.y (location): Do build_component_ref for an array wrapped
- in a structure.
- * ch-tree.h: Add prototype, #define for build_chill_array_parm_type.
- * ch-typeck.c (build_chill_array_parm_type): Add function, move
- build_varying_struct here from ch-actions.c.
-
-Mon Apr 5 19:56:56 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-actions.c, ch-decl.c: Use tree_int_cst_equal and integer_zerop
- rather than in-line code - tests LOW and HIGH values.
- * ch-lang.c: Use tree_int_cst_lt rather than inline code.
- * ch-typeck.c (my_build_array_ref): Handle case where array low bound
- isn't zero.
-
-Mon Apr 5 15:45:10 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-typeck.c (my_build_array_ref): Add some more code from
- build_array_ref. Change checks, error messages to mention
- 'discrete types'. I.E. types which don't kiss and tell..
-
-Sat Apr 3 09:27:03 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-except.c, ch-expr.c: Turn externs into prototypes.
- * ch-grant.c (chill_grant): Remove orphan #else.
- * ch-tree.h: Add prototype for build_chill_bin_type.
- * ch-typeck.c: Turn externs into prototypes, delete code which
- was commented out in chill_expand_return; it will never be used.
-
-Fri Apr 2 21:55:14 1993 Per Bothner (bothner@rtl.cygnus.com)
-
- Major re-write of New module/seize/grant stuff.
- Now, a grantfile is a spec module and contains all the
- top-level declarations of the granting module, not just
- those that are granted. It also contains explicit grant
- statments naming those declared names that are granted.
- It also has seize statements and use_seize_file directives
- to correctly handle transitive dependencies.
-
- * ch-parse.y: Change to allow multiple modules per source file.
- Allow spec modules (including quasi definitions) as well as
- regular modules.
- Allow spec modules inside normal modules; these behave as if
- they were outermost. This violates the Blue Book, but is
- needed by the new grantfile mechanism. (A grant file is a
- spec module that gets included by the use_seize_file directive.)
- * ch-parse.y (struct module *current_module, push_module,
- pop_module): Support module nesting (for spec modules only).
-
- * ch-tree.h (struct module): New.
- * ch-grant.c (granted_decls): New list of declarations
- that have been granted into the outermode pseudo-module.
- * ch-grant.c (decode_mode): If the decl has a name,
- always write the name, not just if the decl has already
- been written. Since we write out all decls, we can assume
- it will be written later, and depend on the forward
- declaration kludges to catch it.
- * ch-grant.c (decode_decl): Don't write out _EXTERN.
- Instead write out standard (Blue Book) quasi-definitions.
- * ch-grant.c (push_granted): New function.
- * ch-grant.c (seize_implied_names): New function. Re-write
- how set element names are seized when a set type is seized.
- * ch-grant.c (chill_seize): Work by seraching the
- granted_decls list and copying the declaration.
- * ch-grant.c (chill_grant): Write all declarations
- declared in this module. Write GRANT statements for
- those granted. seize statements for decls seized from
- other modules. Write extra syntax to make a complete
- spec module.
- * ch-grant.c (grant_use_seizefile): Copy use_seize_file
- directives into grant file.
- * ch-lex.l (setup_seizefile_read): Call grant_use_seizefile.
-
- * ch-lex.l (struct input_state, current_input_state,
- push_input_file, pop_input_file): New (type, variable,
- function*2). Used to save and restore state on an input file.
- * ch-lex.l: Clean up to handle nested input seizefiles
- (needed by new grant/seize mechanism.
- * ch-lex.l (skip_to_end_of_directive): New function.
- * ch-lex.l (compiler_directive: USE_SEIZE_FILE): Make sure
- we skip to the end of the directive *before* we switch
- input files.
- * ch-lex.l (setup_seizefile_read): Prevent reading the
- same seizefile twice (otherwise likely with new grant/seize).
- * ch-lex.l: Recognize SPEC. Misc cleanups.
-
- * ch-parse.y: Fixed foreward references of types.
- Removed the unknown_type_node crock.
- * ch-decl.c: Remove all uses of unknown_type_node.
- Check for TYPE_SIZE zero instead.
- * ch-decl.c (fixup_unknown_type): Make sure new mode
- gets copied into old mode. Merge their variant chains.
- * c-decl.c (lookup_name_current_level): Make non-static.
- * ch-decl.c (lookup_name_current_level): No longer needed.
-
- * ch-parse.y (call): Allow an implicitly defined function
- name following the CALL keyword.
- * ch-tree.h (struct lang_identifier): Add implicit_decl,
- and make sure order of fields matches c-tree.h.
-
- * ch-actions.c (lang_init, build_allocate_memory_call,
- build_allocate_globals_memory_call): Fix names (add initial '_')
- and prototypes of _allocate_[global_]memory (2nd param is ref).
- Use build_chill_function_call, not build_function_call,
- so the reference parameter gets handled.
- * ch-actions.c. (lang_init): Make sure boolean_{true,false}_node
- have boolean_type_node as their types.
- * ch-actions.c (build_chill_lower, build_chill_upper): Fix to
- work for arrays with BOOLEAN_TYPE ranges (and simplify some).
-
- * ch-except.c: Make sure an end_label is generated,
- and jump to it if there is no exception.
-
- * ch-convert.c (convert_to_reference): Strip off NOP_EXPR casts.
- * expr.c (expand_expr): Handle NOP_EXPR as Chill-style casts.
- (Need cleaning up and FSF installation!)
- * ch-parse.y: If taking the address of a cast, move the
- ADDR_EXPR inside the NOP_EXPR.
-
- * ch-typeck.c (my_build_array_ref): Simplified, more suitable
- versions of build_array_ref from c-decl.c. (E.g. don't barf
- if index type is char or bool.)
- * ch-typeck.c (build_chill_array_ref): Use my_build_array-ref.
-
- * ch-typech.c (build_chill_bin_type): New function.
- Support BIN(N) range type specification.
- * ch-parse.y (mode2), ch-lex.l: Recognize BIN(N).
-
- * ch-tree.h (CH_SIMILAR): Redefine in terms of chill_similar.
- * ch-typeck.c (chill_similar): New function. Recognize that
- that range types are similar to their parent types.
-
- * ch-tree.h: Declare flag_local_loop_counter.
- * ch-loop.c: Whether the loop variable is local to the loop
- in now controlled by flag_local_loop_counter, instead of
- #ifdef'd on CREATE_SCOPE.
- * ch-actions.c (lang_decode_option): Recognize flags
- "-f[no-]local-loop-counter".
- * toplev.c (lang_options): Add Chill flags -f[no-]local-loop-counter.
-
- * varasm.c (make_function_rtl): Due to problems with forward
- references, don't rename nested functions in Chill. (Kudge!)
-
-Sun Mar 28 10:12:45 1993 Ken Raeburn (raeburn@kr-pc.cygnus.com)
-
- * ch-lex.l (push_back, readstring): Fix prototypes.
-
-Fri Mar 26 18:32:15 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-parse.y: Put %type directives back into alpha order.
- (variant_alternative): Simplify error_mark test.
- (variantfields, varianthack): Add error_mark checks.
-
-Fri Mar 26 13:36:23 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-lex.l (convert_charliteral): Rewrite to avoid bogus error msg.
- * ch-parse.y (get_type_of): Add function to deal with possible fwd
- declared type name. Call it from lotsa places. Add lotsa checks
- for error_mark_node. Standardize indentations.
-
-Thu Mar 25 15:00:11 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-expr.c (chill_expand_assignment): Avoid seg fault while checking
- for array assignments.
- * ch-parse.y (action): Add recognition for allocate_memory and
- allocate_global_memory system calls.
- (mode2): Remove ill-conceived error check that broke REFs to
- as-yet-undeclared types. Check for IDENTIFIER_NODE, lookup its
- DECL if there, pass TREE_TYPE of decl to build_pointer_type.
- (variantfields, varianthack): Clean up.
- (variantfield): Check for IDENTIFIER_NODE, lookup its DECL if
- there, pass TREE_TYPE of decl to grok_fixedfields.
- (labellist): Explicitly assign error_mark_node to signal error.
- * ch-typeck.c (chill_compatible): Report FALSE for bad parameters,
- rather than seg faulting.
-
-Thu Mar 25 10:35:58 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-actions.c (lang_init): build_function_type for allocate_memory
- and allocate_global_memory runtime routines. Move discrete_type_p
- into ch-typeck.c.
- * ch-typeck.c (discrete_type_p): Move here, where it belongs, call it
- in build_chill_cast.
-
-Wed Mar 24 16:25:16 1993 Per Bothner (bothner@rtl.cygnus.com)
-
- * ch-grant.c: Don't grant previously seized names.
-
-Tue Mar 23 15:25:39 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * Makefile.in (ch-actions.o): Add dependencies (expr.h insn-codes.h)
- * dwarfout.c (fundamental_type_code): Add handling of BOOLEAN_TYPEs,
- avoid abort.
-
-Tue Mar 23 09:03:35 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-actions.c (build_char_array_expr): Just build a type for the
- result of a CONCAT_EXPR, and pass the tree back.
- chill_expand_array_assignment can do a better job of
- code-generation.
- * ch-expr.c (chill_expand_array_assignment): Generate the CONCAT_EXPR
- code.
-
-Mon Mar 22 12:42:58 1993 Per Bothner (bothner@rtl.cygnus.com)
-
- * ch-except.c (start_handler_array): Make sure the handler
- array and its type get on the permanent obstack.
- * ch-grant.c (write_grant_file): Don't write the _INIT=name
- specifier: It isn't needed, and loses (because of funny
- characters in the chill_initializer_name).
- * ch-decl.c (push_synmode): Set TYPE_NAME(mode) = syndecl.
- * ch-lang.c (finish_chill_enum): Don't allocate a dummy
- TYPE_DECL for the enum. I don't think it is needed (?),
- and removing it is needed for the change above.
-
- * ch-grant.c (grant_array_type, decode_mode): Remove unused
- 'decl' parameter.
- * ch-grant.ch (raw_decode_mode): New function, based on old
- decode_mode.
- * ch-grant.c (decode_mode); This is now just a wrapper around
- raw-decode_mode - but does not call raw_decode_mode if the
- type is named and has already been emitted.
-
-Fri Mar 19 11:55:35 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-actions.c: Add prototypes, remove unused variables. Attempt to
- continue generating grant file in presence of error (Wilfried's
- patch to lang_finish).
- * ch-expr.c: Change assign_stack_temp calls so temps get recovered
- after each statement. Move convert call into
- chill_expand_assignment from ch-parse.y.
- * ch-grant.c: Generally re-order, clean up. Include Per's decode_mode
- simplification. Include commented-out hack in decode_mode to return
- type's name if type SEIZEd or already GRANTed in this file.
- * ch-lex.l: Add prototypes.
- * ch-parse.y (assignaction): Move convert call into
- chill_expand_assignment.
-
-Thu Mar 18 16:04:45 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-convert.c (convert): Remove unused variable, fix int_size_in_bytes
- comparison.
- * ch-decl.c: Add prototypes, correct error message spelling, remove
- unused variables.
- * ch-lang.c (build_chill_range_type): Add error message. Add prototypes.
- Correct comment spelling.
- * ch-lex.l: Add prototypes, remove unused variable, put double parens aarround
- assignment in conditional.
- * ch-loop.c: Add prototypes, remove unused variable.
- * ch-parse.y (structured_variable): Return NULL_TREE is invalid WITH
- parameter is seen, don't count it in structured_variable_list. Pre-
- vents seg fault when only WITH operand is invalid.
- * ch-parse.y (label_spec): Correct assignment within IF expression which
- was intended to be equality test. Remove unused variables.
- * ch-tree.h: Add prototype. Remove unused EXCP_CODE enumeration, and
- prototyping editorial comments.
- * ch-typeck.c: Disable generation of code to validate array index for
- now. Should be done as a call-back from more generic array_ref code.
- Clean up parameter checking. Remove unused variables.
-
-Fri Mar 12 11:57:32 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-actions.c (chill_varying_type_p): Return FALSE if given NULL type.
- * ch-actions.c (build_chill_binary_op): Pass ALL arrays to
- build_char_array_expr.
- * ch-convert.c (convert): protect against seg fault, if type == NULL.
- * ch-expr.c (chill_expand_expr): Add FIXME comment.
-
-Fri Mar 12 11:04:02 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-expr.c (chill_expand_expr): Completely rethink set unary ops.
- Thanks very much to dje!
-
-Thu Mar 11 21:06:55 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-actions.c (build_char_array_expr, build_chill_binary_op):
- Move CONCAT_EXPR handling from binary_op to array_expr. Add
- handling for relationals between varying arrays to array_expr.
-
-Thu Mar 11 19:20:37 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-actions.c (build_set_expr, build_chill_binary_op): Calculate
- *BIT* length of powersets and arrays of BOOLs.
- (invalid_left_operand, invalid_right_operand): Disallow relationals
- with arrays of BOOL as operands.
- * ch-convert.c (convert): Test TREE_CODE for ERROR_MARK rather than
- comparing pointers.
- * ch-decl.c (push_newmode): Re-indent.
- * ch-expr.c (chill_expand_expr): Calculate *BIT* length of powersets
- and arrays of BOOLs.
- * ch-lang.c (build_chill_array_type): Add parameter error checking.
-
-Mon Mar 8 17:13:00 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * expr.c (store_constructor): Handle set construction.
- * varasm.c (output_constant): Prevent seg fault - terminate case
- alternative with a 'break'.
-
-Mon Mar 8 17:13:00 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-expr.c (): Move SET_TYPE constructor to expr.c.
- * ch-loop.c (end_chill_loop): Only do expand_end_loop if not POWERSET loop.
- * ch-typeck.c (build_chill_cast): Fix error msg spelling.
-
-Mon Mar 8 13:16:05 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * fold-const.c (fold_convert): Allow CHAR_TYPE CONVERT_EXPR to
- be folded.
-
-Mon Mar 8 10:13:57 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-grant.c (get_tag_value): Correctly output certain enumerations.
- Correct some non-standard indentations.
-
-Fri Mar 5 14:58:35 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-actions.c: Fix up comment.
-
-Thu Mar 4 18:05:43 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-actions.c: Define builtin '__nepowerset' and call it - avoid
- negating the result of calling __eqpowerset. New function
- discrete_type_p().
- * ch-grant.c (get_tag_value): Don't seg fault referring to an
- anonymous enumeration's name.
- * ch-lex.l: Turn EVEN token into an ignored compiler directive.
- * ch-loop.c (end_chill_loop): Output end-of-loop marker.
- * ch-parse.y (label_spec): redefine variant structure label_spec
- to agree with the Z.200 spec.
- (locdec): Error if set/bitstring initialized with a tuple.
- (case_label, arrayindex): Use new discrete_type_p
- function.
- * ch-process.c: Fix typo.
-
-Wed Mar 3 14:30:53 1993 Per Bothner (bothner@rtl.cygnus.com)
-
- * ch-lang.c, ch-tree.h: Rename build_range_type to
- build_chill_range_type. Call new build_range_type() in tree.c.
- * ch-parse.y: Call build_chill_range_type as approriate.
- * ch-typeck.c (build_chill_cast); Clean up.
-
-Wed Mar 3 09:36:56 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-parse.y: Define CONTINUE_EVENT token.
- * ch-parse.y (mode2): Give error message for SYN modea = modeb
- where modeb is undefined.
-
-Tue Mar 2 20:16:37 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-actions.c: Add builtin function descriptions for memset and
- bitsetpowerset. Allow build_chill_num expression to exceed 16 bits,
- but not 32.
- * ch-tree.h: Correct chill_handle_case_default prototype.
- * ch-actions.h, ch-lex.h: Add prototypes.
- * ch-lex.l, chill.gperf: Add CONTINUE_EVENT token.
-
-Thu Feb 25 17:35:46 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * c-decl.c (init_decl_processing): Disable creation of C-specific
- builtin functions. They pollute the CHILL name space.
- * stor-layout.c (variable_size): Allow variable-size objects at file
- scope, for CHILL.
-
-Fri Feb 26 07:14:34 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * c-decl.c (finsh_decl): Don't output non-constant storage size
- error for CHILL
- * ch-actions.c: Call build_temporary_variable, fix build_tree_list
- call in build_chill_cause_exception.
- * ch-convert.c, ch-expr.c: Use tree_cons to build list's last entry
- * ch-loop.c (build_temporary_variable): New function
- * ch-process.c: Call build_temporary_variable, spell start_process
- correctly.
- * ch-tree.h: Extern for build_temporary_variable
-
-Thu Feb 25 12:09:01 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * c-decl.c (init_decl_processing): Disable initial creation of C-specific
- builtins - they pollute the CHILL name space.
- * ch-typeck.c (valid_array_index): Correct upper-bound check.
- * expr.c (expand_expr): Use actual library name for __inpowerset
- builtin.
- * stor-layout.c (variable_size): Disable complaint about variable-
- size type or decl at file scope. Perhaps later this s.b. a warning.
- * varasm.c (emit_set_data): Add function.
- (output_constant): Call new emit_set_data function for VAR_DECLs,
- in addition to CONSTRUCTORs.
-
-Thu Feb 25 11:34:36 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-actions.c: Change all builtin functions names to their
- actual library names. Change references to boolean_type_node
- to references to the TREE_CODE == BOOLEAN_TYPE, to follow the
- convention.
- build_set_expr: Remove length parameter, call powersetlen() instead.
- remove handling of CHAR arrays - they're handled in build_char_array_expr.
- Call __eqpowerset to test for equality - we can't use a byte-length -
- need bitcount instead.
- build_chill_compound_expr, internal_build_compound_expr: Copy from C
- version that does stuff we don't want.
- build_binary_op: Check for in_size_in_bytes return < 0, indicating
- size is changeable at run time. Build two memcpy calls to implement
- string concatenation.
- powersetlen: Add function.
- build_chill_card: Call powersetlen.
- build_chill_max_min: Common code for powerset max/min.
- build_chill_length: Move VARYING array handling before regular char
- array handling.
- * ch-expr.c chill_expand_expr: Disable concatenate code - we need to
- the VARYING status of the target to do this correctly. Use powersetlen
- for the powerset operations, not a byte length.
- * ch-loop.c: Make CREATE_SCOPE #define to enable creation of a new scope
- for each CHILL loop, as Z.200 requires. Add powerset and error flags
- to loop structure. Evaluate user's powerset expression into a temp,
- scan it destructively with __ffsetclrpowerset or __flsetclrpowerset
- for powerset loop. Only do loop-end assignments if NOT a powerset
- loop, which has much less overhead now.
- * ch-tree.h: Add prototype for powersetlen.
-
-Fri Feb 19 08:40:24 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-lex.l (convert_number): Evaluate number and pass it as
- HOST_WIDE_INT.
-
-Fri Feb 19 08:56:44 1993 Michael Tiemann (fs_tie at rcsw18)
-
- * ch-typeck.c (build_chill_array_ref): Handle newmodes
- correctly.
-
- * ch-actions.c (chill_comptypes): Always initilize ERRSTR if
- we are going to return 0.
-
- * ch-convert.c (convert_to_reference): Don't use
- TYPE_MAIN_VARIANT, because REFTYPE's type may be a newmode
- (which must match the type of the expr).
-
- * ch-grant.c (chill_seize): Don't let a type be copied just
- because we are seizing it.
-
- * ch-lang.c (finish_chill_enum): Convert TYPE_MIN_VALUE and
- TYPE_MAX_VALUE to integer type.
-
- * ch-loop.c (begin_for_range): Set lp->iter_type based on the
- tree type of the bounds.
- (build_loop_top): type of GE_EXPR and LE_EXPR is
- boolean_type_node, not lp->iter_type.
- (for_location): Ditto.
-
- * ch-action.c (build_chill_lower,build_chill_upper): Handle
- ENUMERAL_TYPE. Also, handle different kinds of arguments more
- cleanly.
-
- * ch-parse.y (iteration): Convert start_exp and end_exp to
- match the type of modename.
-
- * ch-grant.c (chill_seize_aggr): Search also through anonymous
- types.
-
- * ch-grant.c (chill_seize): Check to see if SEIZEITEM has
- already been seized, and if so, do nothing.
-
- * c-typeck.c (process_init_constructor): If DEFAULT_VALUE
- comes out error_mark_node, set ERRONEOUS.
-
- * ch-actions.c (build_chill_binary_op_1): If EXP is NULL_TREE,
- don't use it.
-
- * ch-action.c (chill_comptypes): Test for structural
- equivalence of enums.
-
- * ch-typeck.c (build_chill_array_ref): Convert INDEX to
- TYPE_MIN_VALUE of DOMAIN if the types are compatible.
-
- * ch-grant.c (chill_seize): If DECLS is a TYPE_DECL for an
- ARRAY_TYPE, seize the domain type if its a set.
-
-Thu Feb 18 20:02:15 1993 Per Bothner (bothner@rtl.cygnus.com)
-
- * c-typeck.c (process_init_constructor): Emit error if some
- array elements are not initialized.
- * c-typeck.c (process_init_constructor): Call digest_init()
- recursively to expand default_value.
- * ch-expr.c (chill_expand_array_assignment): Simplify, and
- handle the case that the lhs has dynamic size (e.g. a slice).
- * ch-parse.y (elementlist): Handle the case that tupleelement
- generates more than one TREE_LIST node.
-
-Thu Feb 18 12:40:56 1993 Michael Tiemann (fs_tie@rcvie.co.at)
-
- * .cvsignore: add yacc sources, xgcc and stmp-* files. (Bill)
- * c-typeck.c (lookup_field): add function, calls.
- * ch-actions.c (build_chill_binary_op): figure return_type differently.
- * ch-convert.c (convert_to_reference): return error_mark_node,
- STRIP_NOPS. (convert): Braces for readability.
- * ch-decl.c (build_chill_function_type): accept typespec as parm.
- Handle exceptions.
- (grok_chill_variantdefs): call comptypes, not chill_comptypes.
- * ch-expr.c (chill_expand_assignment): handle references.
- * ch-grant.c (chill_seize_set, chill_seize_aggr): new functions
- * ch-parse.y (structured_variable): check for REFERENCE_TYPE,
- call convert. Generally handle reference types.
-
-
-Thu Feb 18 09:30:11 1993 Michael Tiemann (fs_tie@rcvie.co.at)
-
- * ch-actions.c (chill_comptypes): Figure out which newmode or
- synmode decls look most canonical.
- * ch-convert.c (convert): handle location conversions of records,
- unions and arrays.
- * ch-decl.c (fixup_unknown_type): changes for variant records
- * ch-parse.y (tupleelement): avoid confusing digest_init.
- * ch-typeck.c (build_chill_array_ref): give element ref the
- type of the ELEMENT, not the array (Bill Cox).
-
-Wed Feb 17 11:52:20 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-parse.y: change push_newmode and push_synmode interfaces.
- * ch-actions.c (build_chill_binary_op): convert operands.
-
-Wed Feb 17 10:54:24 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-actions.c (build_chill_binary_op, build_chill_unary_op):
- handle reference types.
- * ch-decl.c (push_newmode, push_synmode): rewritten
- * ch-process.c (make_process_struct): new push_newmode interface.
- * ch-typeck.c (build_chill_cast): change interface, error checks.
-
-Wed Feb 17 09:50:37 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-decl.c, ch-parse.y, ch-tree.h: delete old INOUT, OUT parameter
- code.
- * ch-typeck.c (valid_array_index): new function.
-
-Tue Feb 16 22:36:34 1993 Per Bothner (bothner@rtl.cygnus.com)
-
- * ch-convert.c (convert): Slightly more correct conversion
- for ARRAY_TYPEs (return as OK if CH_COMPATIBLE).
- * ch-expr.c (chill_expand_array_assignment): Invoke
- __builtin_memcpy using build_function_call, not directly at
- the rtx level (which doesn't work).
- * ch-typeck.c (build_chill_slice): First attempt at slices.
- * ch-tree.h, ch-typeck.c (build_chill_slice_with_range,
- build_chill_slice_with_length): New functions.
- * ch-parse.y: Use new slice-building functions.
- * expr.c (get_inner_reference): Subtract low bound of
- array when doing an ARRAY_REF.
-
-Tue Feb 16 14:17:55 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-actions.c (build_chill_function_call): better comments.
- * ch-decl.c (push_parms): encode OUT, INOUT parms in additional way.
- * ch-parse.y: indentation cleanup
-
-Tue Feb 16 12:03:53 1993 Michael Tiemann (tiemann@cygnus.com)
-
- * ch-decl.c (grok_chill_variantdefs): Really implement variant
- records for CHILL.
- * ch-grant.c (get_tag_value): New function.
- * ch-grant.c (decode_mode): Grant variant records.
-
- * ch-grant.c (chill_seize): If we seize a set, seize the set
- values.
-
- * ch-lex.l (RETURN_TOKEN): Make this safe to use in if/else
- constructs.
-
- * ch-parse.y (EMPTY): New pseudo-token to disambiguate
- variant_alternatives.
- (current_fieldlist): New variable to help processing tag
- declarations in variant records.
- (fields): Renamed from structdef.
- (field): Renamed from fields.
- (varianthack): New non-terminal to handle parsing ambiguity
- for variant records.
- (optlabellist): Changed to preserve CONST_DECLs when they are
- parsed.
-
- * ch-tree.h (TYPE_TAGFIELD): New macro.
- (TYPE_TAG_VALUES): Ditto.
-
-Mon Feb 15 00:49:34 1993 Per Bothner (bothner@rtl.cygnus.com)
-
- * ch-grant.c (decode_mode): Fix output for powerset modes.
- * ch-grant.c (decode_constant): Support grant output of
- powerset literals.
- * ch-actions.c (build_chill_binary_op): IN_EXPR fix.
- * expr.c (expand_expr): Add Chill-specific kludge for
- BIT_FIELD_REF if operand is SET_TYPE to call runtime function.
- * ch-expr.c (chill_expand_assignment): Remove no-longer-needed
- special-case support for a BIT_FIELD_REF in right-hand-side.
- * ch-lang.c (finish_chill_enum): Patch up enum elements to
- have the correct type (instead of integers, as in C).
-
- * ch-lex.l, ch-parse.y: Add disgusting hack (involving
- context-dependent look-ahead) so we can parse exception
- handlers correctly.
- * c-typeck.c (digest_init): Set output type for SET_TYPEs.
- * varasm.c (unpack_set_constructor): Add support for
- (power-)set ranges (i.e. low_element:high_element).
-
-Sun Feb 14 13:37:52 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-inout.c: delete unused #include
- * ch-typeck.c (build_chill_slice): turn abort call into error msg.
-
-Sat Feb 13 13:13:31 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * Makefile.in: Add cc1chill to STAGESTUFF per Eichin's suggestion.
-
-Sat Feb 13 12:17:41 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * Makefile.in: add lots of header files to the CHILL dependencies
-
-Fri Feb 12 15:48:27 1993 Per Bothner (bothner@rtl.cygnus.com)
-
- * ch-actions.c (build_chill_function_call): Don't return
- error_mark_node on empty parameter-list.
-
-Fri Feb 12 12:54:52 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-actions.c (build_chill_function_call): fix start_decl parms.
- * ch-parse.y (PUSH_ACTION): guarantee to generate an insn!
-
-Fri Feb 12 10:32:37 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-actions.c (build_chill_function_call): create temps, do
- assignments to handle INOUT and OUT parameters.
- * ch-decl.c (build_chill_function_type): better parameter name.
- * ch-parse.y (action): keep rules in alpha order.
- (pmodearg): turn INOUT, OUT parameter types into reference types.
- * ch-typeck.c (build_tree_slice): indentation change.
-
-Thu Feb 11 23:16:34 1993 Per Bothner (bothner@rtl.cygnus.com)
-
- * ch-lex.l (convert_bitstring), Changed SET_TYPE_CONSTRUCTOR to
- take a list of elements which are in the set. This corresponds
- better to the tuple input form in Chill (and Pascal).
- * varasm.c (unpack_set_constructor, pack_set_constructor):
- New functions, to expand SET_TYPE CONSTRUCTORs.
- * varasm.c (output_constructor): Use pack_set_constructor
- to assemble a SET_TYPE constant from a CONSTRUCTOR.
-
- * ch-grant.c (decode_constant): Better grant for strings,
- enumeral, and bitstring constants.
- * ch-grant.c: Fixes in seize to avoid duplicates, and emit
- things in the correct order.
- * c-typeck.c (chill_initializer_constant_valid_p): Kludge
- needed to export a static function.
- * ch-typeck.c (convert): Avoid needlessly (and lossingly) calling
- chill_expand_tuple to convert fix string to varying.
- * ch-actions.c (build_chill_binary_op): Promote short
- integer operands if needed (otherwise emit routines barf).
- * ch-tree.h (SET_WORD_SIZE): New macro.
- * ch-parse.y: Fix syntax for RECEIVE CASE.
- * ch-parse.y (location): If IDENTIFIER is a CONST_DECL
- return its value instead.
-
-Thu Feb 11 07:41:45 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-actions.c (build_chill_max, build_chill_min): clean up
- * ch-typeck.c (chill_expand_tuple): correct set initialization from
- an enumeration tuple. Add sort_constructor function.
-
-Thu Feb 11 07:41:45 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * config/sparc.c (sparc_type_code): handle CHAR_TYPE and
- BOOLEAN_TYPE w/out an abort.
-
-Wed Feb 10 14:59:53 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-actions.c: change most integer_type_node references to
- chill_integer_type_node. Rewrite _max and _min routines,
- redefine the signatures for those runtime routines. Move
- empty-set check into runtime.
- * ch-expr.c, ch-loop.c, ch-process.c, ch-tree.c, ch-typeck.c: change
- most integer_type_node references to chill_integer_type_node.
-
-Tue Feb 9 16:00:05 1993 Per Bothner (bothner@rtl.cygnus.com)
-
- * ch-except.c: New file. Stuff for exception handling.
- * ch-parse.y: Add working exception handling support.
- * ch-lex.l, ch-parse.y: Prefer standard type terminology
- (BOOLS, CHARS) even though non-standard (BITS, CHAR) is ok.
- * ch-grant.c: Fix various problems related to granting
- types such as bitsets.
- * ch-tree.c (build_bitstring_type): Set TYPE_MIN_VALUE
- to distinguish bitstrings from powersets (in the same way
- we distinguish char strings from char arrays).
- * ch-tree.h: New macro CH_BOOL_TYPE_P.
- * ch-tree.h, ch-actions.c (lang_init), ch-grant.c (decode_mode):
- Undo kludge where integer_type_node was hardwired to 16 bits.
- Make integer_type_node etc have the same size as in cc1.
- New types chill_integer_type_node and chill_unsigned_type_node
- that correspond to the Chill source types INT and UINT.
- For now, these match the C 'short' types, but that should
- become a configuration option later,
-
-Tue Feb 9 11:41:25 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-actions.c (build_chill_unary_op): allow NOT of a set.
-
-Tue Feb 9 08:27:18 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-actions.c (build_chill_function_call): add test for
- too many/few actual parameters (and avoid seg fault).
- * ch-decl.c (do_decls): code cleanup for readability.
- * ch-loop.c (begin_chill_loop, end_chill_loop): remove
- emit_nop() calls - they now (since exceptions) cause seg faults.
- Make derogation on poor CHILL compiler non-specific.
- * ch-parse.y (mode2): enable VARYING keyword in CHAR(expr).
- * ch-tree.h: remove prototypes added to c-tree.h.
- * ch-typeck.c (build_chill_array_ref): correct getting domain
- subtree for a PARM_DECL. Subscripting a SET_TYPE is turned into
- an IN_EXPR.
-
-Sun Feb 7 18:20:49 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-tree.def: add a new tree type - just for varying array
- references. We were using ARRAY_REF, but the underlying C
- code also generates that one.
- * ch-convert.c, ch-expr.c, ch-typeck.c: use the new tree type.
-
-Sun Feb 7 17:33:17 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-convert.c: test given type against type of expr before
- calling chill_expand_tuple. We were getting lots of spurious
- calls...
-
-Fri Feb 5 15:24:01 1993 Per Bothner (bothner@rtl.cygnus.com)
-
- * cccp.c: Merge in various Chill-specific changes.
- * gcc.c (default_compilers array): Pass -lang-chill
- to cpp, not -lang-ch.
-
-Fri Jan 29 17:18:22 1993 Per Bothner (bothner@rtl.cygnus.com)
-
- * Makefile.in (install-libchill, install-librmt): Removed.
- * ch-actions.c (build_chill_exception_decl): Change decl
- to initialized char array, rather than unitialized common.
- (Simplifies extracting string name of exception.)
- * ch-actions.c: Adjust interface to cause_exception accordingly.
- * ch-typeck.c (build_chill_array_ref): Cause rangefail if
- index > limit, not >= limit.
-
- * ch-actions.c (build_chill_function_call): Rename misleading
- formal parameter.
- * ch-decl.c (do_decls): Allow (again) general initializer exprs.
- * ch-parse.y (call): Test for function call needs to test for
- FUNCTION_TYPE, not FUNCTION_DECL.
- nreverse arg list to build_chill_array_ref.
- * ch-typeck.c (build_chill_array_ref): Do recursive call at end
- and only if multiple indexes.
- * ch-typeck.c: Cleanups.
-
-Fri Jan 29 11:05:58 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-decl.c (do_decls): handle set initializations better, more to do.
- * ch-loop.c (begin_for_range): correct interface to expand_start_cond
- and build_binary_op.
- * ch-tree.h: lots more prototypes
- * ch-typeck.c (build_array_from_set): added function.
- * ch-typeck.c (chill_expand_tuple): handle set initializations better.
-
-Thu Jan 28 17:41:58 1993 Per Bothner (bothner@rtl.cygnus.com)
-
- * ch-grant.c (set_default_grant_file): Change default.
- Normally, grant file should end up in cwd.
- * ch-lang.c (build_chill_struct_type): Call pushtag,
- for the sake of debugging.
- * ch-lex.l: Improve comment parsing.
- * ch-lex.l (readstring): Some improvements.
- Initial support for control sequences in string literals.a
-
-Thu Jan 28 16:16:00 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-convert.c (convert): correct fixed->varying conversion.
- * ch-parse.y (mode2): delete unesthetic newline.
-
-Thu Jan 28 10:32:55 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-actions.c: delete maybe_array_ref()
- * ch-expr.c (chill_expand_assignment): handle RHS array_ref, delay
- calling convert().
- * ch-lex.l, ch-parse.y, chill.gperf: add keywords, syntax for time
- supervision actions & builtins
- * ch-parse.y (call): eliminate optlocarrayidx, call build_chill_slice,
- smaller actions directly (maybe_array_ref() used to call them).
- * ch-tree.h: add build_chill_function_call, build_chill_slice
- * ch-typeck.c: add build_chill_slice()
-
-Thu Jan 28 08:44:28 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-tree.h: bring up to date with ch-actions.c changes.
-
-Wed Jan 27 23:45:20 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-expr.c (chill_expand_assignment): handle an RHS varying array
- reference.
-
-Wed Jan 27 22:28:36 1993 Per Bothner (bothner@rtl.cygnus.com)
-
- * ch-grant.c (decode_constant): Add REAL_TYPE support.
- * ch-actions.c (build_chill_exception_decl): New function.
- * ch-actions (build_chill_cause_exception, cond_exceptions):
- Convert to take a (char*) parameter (the exception name).
- * ch-actions.c, ch-expr.c, ch-typeck.c: Convert calls to
- cond_exception.
- * ch-parse.y (check_end_label): New function, to check if
- and end label matches start label.
- * ch-parse.y: Fix syntax to properly recognize and
- test optional end labels (using check_end_label).
- * ch-decl.c (finish_chill_function): Simplify, since
- we assume check_end_label has already been called.
- * ch-parse.y: Put in infrastructure for exception handling.
-
-Wed Jan 27 15:45:20 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-actions.c: delete convert_chill_parameter, replace call with
- call to convert().
- * ch-convert.c (convert): combine chill_give_type_to_expr in here.
- * ch-decl.c: call convert rather than chill_give_type_to_expr.
- * ch-expr.c: delete chill_expand_array_assignment, move code to convert.
- * ch-expr.c (chill_expand_assignment): just call convert.
- * ch-loop.c (end_chill_loop): expand the end of the loop for a
- do while.
- * ch-parse.y: call convert rather than chill_give_type_to_expr.
- * ch-process.c: checkpoint.
- * ch-typeck.c: delete chill_give_type_to_expr, call convert instead.
-
-Wed Jan 27 15:45:20 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-grant.c (grant_array_type): new function to allow handling of
- VARYING array types.
-
-Wed Jan 27 15:45:20 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-typeck.c (chill_give_type_to_expr): fix typo. Reorder to
- avoid checking types on CONSTRUCTORs. Correct typo.
- * ch-expr.c (expand_assignment_to_varying_array): use proper
- expansion function expand_expr_stmt.
- * ch-expr.c (expand_chill_assignment): only convert VARYING
- array refs or RHS.
-
-Wed Jan 27 15:32:21 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-actions.c (build_chill_length, build_chill_lower,
- build_chill_upper): accept parameters, too.
- * ch-expr.c (chill_expand_assignment): decipher ARRAY_REF on RHS.
- * ch-typeck.c (chill_give_type_to_expr, build_chill_array_ref):
- assign proper type to ARRAY_REF expression.
-
-Wed Jan 27 09:51:46 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-actions.c (build_chill_binary_op): delete unused variable,
- get set's base type from TYPE_DOMAIN rather than TREE_TYPE.
- * ch-actions.c (build_chill_repetition_op): handle differently-built
- declaration trees.
- * ch-loop.c (begin_for_set): adapt to new powerset declaration tree.
- * ch-typeck.c (chill_give_type_to_expr): give type to constructor
-
-Tue Jan 26 11:32:38 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-parse.y (ifaction): re-add lost call to expand_end_code().
- * ch-parse.y (siezelist, grantlist): use 'name' rather than
- 'checked_name'. It makes no sense to check sieze/grant names
- for WITH expansion.
- * ch-expr.c (chill_expand_expr): delete unnecessary (and
- seg-fault-causing) code.
- * ch-expr.c (chill_expand_assignment): make test for varying array
- on the LHS more specific.
- * ch-actions.c (invalid_left_operand, invalid_right_operand): error
- for use of MOD, REM operators.
- * ch-actions.c (build_chill_repetition_op): error for bit-field
- initializers (which will get handled in the lexer).
-
-Mon Jan 25 17:26:47 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-typeck.c (build_chill_array_ref),
- * ch-expr.c (chill_expand_expr, chill_expand_assignment):
- translate varying array ref into ARRAY_REF, defer processing
- until chill_expand_expr. Update array's length field in
- new function expand_assignment_to_varying_array.
-
-Mon Jan 25 14:57:24 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-parse.y (mode2): eliminate old method to mark varying arrays.
- * ch-expr.c (expand_varying_length_assignment): repair scaling of
- RHS expression.
-
-Mon Jan 25 11:44:21 1993 Per Bothner (bothner@cygnus.com)
-
- * ch-parse.y: Allow character and bitstring literals
- in string repetition operator.
-
-Sat Jan 23 14:18:11 1993 Per Bothner (bothner@cygnus.com)
-
- * ch-parse.y (primval): Re-recognize '(' expr ')'.
- * ch-parse.y (name): Remove call to check_identifier -
- this is not appropriate in certain contexts.
- * ch-parse.y (checked_name): Same as <name>, but *with* the
- call to check_identifier. Use where appropriate.
- * ch-parse.y (operand5): Only allow string repetition of
- string literals, because otherwise you get a conflict.
-
-Thu Jan 21 16:32:39 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-actions.c, ch-parse.y, ch-process.c, ch-tree.h: sync modules,
- continue start_process development.
-
-Thu Jan 21 13:51:06 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-decl.c (do_decl): fix handling of multi-char initializer.
-
-Thu Jan 21 13:14:00 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * .cvsignore: add CHILL files to be ignored
-
-Thu Jan 21 07:38:57 1993 Bill Cox (bill@cygnus.com)
-
- * ch-parse.y: rough draft of start_process handling.
-
-Wed Jan 20 17:11:05 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-inout.c: fix mismatch with readtext proto in ch-tree.h.
-
-Wed Jan 20 16:48:13 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-tree.h, ch-process.c, ch-inout.c, Makefile.in:
- create new modules for I/O and process-related stuff.
- * ch-actions.c: move routines to new modules.
- call xmalloc, not malloc.
- * ch-lang.c (build_chill_struct_type): add parameter checking.
- * ch-lex.l (init_lex): remove redundant cast.
-
-Tue Jan 19 16:33:56 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-parse.y (operand5): delete unnecessary argument to
- build_chill_unary_op. Add rule for string repetition.
- * ch-parse.y (primval): delete string repetition attempt.
- * ch-parse.y (start_process): rough draft of action.
- * ch-actions.c (build_repetition_op): add it
- * ch-actions.c (build_chill_binary_op): handle constant arguments
- of CONCAT_EXPR, combine into a single string if possible.
- * ch-actions.c (invalid_left_operand, invalid_right_operand):
- allow single character arguments to CONCAT_EXPR.
- * ch-tree.h: add prototype for build_repetition_op
-
-Tue Jan 19 15:03:29 1993 Fred Fish (fnf@cygnus.com)
-
- * dwarfout.c (output_type): Add hack that matches the one in the
- chill front end to distinquish between true string types and
- arrays of char, since it uses ARRAY_TYPE for both, rather than
- trying to use the existing support for STRING_TYPE.
-
-Tue Jan 19 13:54:27 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-tree.h: added prototypes for all non-static CHILL functions.
- * ch-actions.c (lang_init): declare builtin type for start_process
- * ch-actions.c (build_chill_binary_op): combine string literals when
- concatenated.
- * ch-actions.c (formpars2struct): added for later start_process
- implementation.
- * ch-actions.h: remove un-needed function declarations.
- * ch-decl.c: extern cleanup.
- * ch-expr.c (chill_expand_array_assignment): add missing first
- parameter to cond_exception call.
- * ch-lex.l: make build_chill_string non-static.
-
-Mon Jan 18 19:15:08 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-decl.c (do_decls): get varying array length initialized.
-
-Mon Jan 18 09:51:43 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-expr.c (chill_expand_array_assignment): fix the copy length
- in the memcpy call (it was just 4 bytes always). Simplify some
- code, also.
-
-Mon Jan 18 08:24:21 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-decl.c (do_decls): change CH_VARYING_TYPE_P to function.
-
-Mon Jan 18 08:00:11 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-lex.l, ch-parse.y: make BOOLS synonymous with BIT and
- CHARS synonymous with CHAR, in the lexer. Delete unnecessary
- 'bools' non-terminal.
- * ch-parse.y (assignaction): add lhs version of length() function
- * ch-actions.c: add builtin_concat function, lots of support for
- CONCAT_EXPR.
- * ch-actions.c, ch-tree.h: make a function out of former
- macro CH_VARYING_TYPE_P
- * ch-expr.c: add expand_varying_length_assignment ().
- * ch-expr.c (chill_expand_expr): add CONCAT_EXPR support.
- * ch-expr.c (chill_expand_array_assignment): call emit_library_call
- rather than build_rts_call, to eliminate a recursion problem.
- * ch-lang.c: eliminate 'sorry' about varying arrays.
- * ch-typeck.c (validate_varying_array_ref): re-enable constant
- index validation.
-
-Sun Jan 17 18:20:04 1993 Per Bothner (bothner@cygnus.com)
-
- * ch-grant.c, ch-lex.l: Major simplification of how
- seizes are done and how seizefiles are read.
- * ch-actions.h: Remove declaration of check_seize().
- * ch-decl.c (do_decls): Handle READONLY types.
- * ch-parse.y (mode2): Allow REF to be followed by any mode.
- * ch-parse.y (mode2): Allow literal expressions in string length.
- * ch-parse.y (tupleelement): Allow elemenst to be untyped_expr.
- * ch-parse.y (seizestatement, etc): Call chill_seize each
- time something is seized, rather than building a list first.
-
-Sat Jan 16 12:24:44 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * chill.gperf, ch-hash.h: add Wilfried's tokens
- * ch-lex.l: fold in Wilfried's changes. Some tokens
- weren't getting recognized, and INSTANCE wasn't correctly
- reported to ch-parse.y as a PREDEF_MODEDCL.
-
-Thu Jan 14 15:02:39 1993 Per Bothner (bothner@cygnus.com)
-
- * ch-tree.h (CH_CHARS_TYPE_P): New macro. Add comment
- explaining difference between char strings and char arrays.
- * ch-tree.h (CH_STRING_TYPE_P): Add FIXME re bitstrings.
- * ch-tree.c (build_string_type): Add comment.
-
-Wed Jan 13 15:19:15 1993 Per Bothner (bothner@cygnus.com)
-
- * calls.c, expr.c, function.c, stmt.c, varasm.c: Set
- MEM_IN_STRUCT_P for SET_TYPE where it is set for other aggregates
- * expmed.c (store_bit_field, extract_field_field): Undo
- yesterday's removal of MEM_IN_STRUCT_P "sanity test".
-
- * ch-decl.c (do_decls): Put back support for initializing.
- (Was accidentally removed in Jan 8 change.)
-
-Wed Jan 13 14:13:11 1993 Jim Wilson (wilson@sphagnum.cygnus.com)
-
- * ch-lex.l (convert_bitstring): Correct typo in cast.
-
-Tue Jan 12 20:29:08 1993 Per Bothner (bothner@cygnus.com)
-
- * ch-lex.l (convert_bitstring): Change to pack bits
- within words, not bytes, and to use machine bit-order
- (not always little-endian).
- * ch-parse.y: Allow BOOLS(n) as well as BITS(n).
- Use build_bitstring_type, not build_string_type.
- * expmed.c (store_bit_field, extract_field_field): Remove
- "sanity test" that prevents use with SET_TYPE.
- * tree.c (build_bitstring_type, build_powerset_type,
- build_string_type): Move (so far) Chill-specific functions to ...
- * ch-tree.c: ... new file.
- * ch-tree.c (build_powerset_type, build_bitstring_type): Re-write.
- * ch-typeck.c (build_chill_array_ref): Handle bit strings better.
- * ch-typeck.c (chill_expand_tuple): Kludge to handle SET_TYPE.
- * Makefile.in (CHILL_OBJS): Add ch-tree.o.
- * ch-decl.c (do_decls): Call expand_decl.
- * stor-layout.c (layout_type): Handle SET_TYPE.
- * expr.c (expand_expr): Add FIXMEs about IN_EXPR.
- * ch-actions.c (lang_init): Add type and decl for new
- function __builtin_setbitinstring.
- * ch-expr.c (chill_expand_assignmment): Special-case handling
- for BIT_FIELD_REF with non-constant bit position (which is
- not yet handled by expand_expr).
- * ch-convert.c (convert): Handle SET_TYPE.
-
-Tue Jan 12 12:49:13 1993 Fred Fish (fnf@cygnus.com)
-
- * chill: If -B arg is given, use to find gcc.
-
-Fri Jan 8 20:21:43 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-decl.c: revert to avoid seg fault
-
-Fri Jan 8 14:20:42 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-decl.c: fix storage into correct offset in varying array.
- * ch-actions.c: define sizetype for everyone, use it to build
- varying structure.
- * ch-parse.y: tiny cleanup.
-
-Wed Jan 6 13:25:33 1993 Bill Cox (bill@cygnus.com)
-
- * modules: use gdb rather than naked-gdb, to get opcodes
- in chill definition.
-
-Wed Jan 6 09:48:35 1993 Bill Cox (bill@cygnus.com)
-
- * ch-typeck.c: add code to handle references to elements of VARYING
- arrays. Simplify chill_give_type_to_expr. Add rough draft of run-
- time index checking for VARYING arrays (under #if 0).
- * ch-actions.c: new function cond_type_range_exception & calls.
- New function cond_range_exception, for more general range-checking.
- New function build_varying_struct, to do just that. Use the macros
- for the special varying field names.
- * ch-tree.h: define macros for varying field names.
- * ch-expr.c: use macros for varying struct names. Simplify
- chill_expand_array_assignment.
- * ch-parse.y: assure that build_varying_struct is called everywhere
- that it applies. Add a line-number note before the body of a DO
- loop.
- * ch-loop.c: #ifdef out creation of new scope for DO loop body.
-
-Tue Jan 5 17:26:14 1993 Bill Cox (bill@cygnus.com)
-
- * c-decl.c: correct order of declaration of start_decl params,
- for readability.
-
-Tue Jan 5 15:59:36 1993 Per Bothner (bothner@cygnus.com)
-
- * ch-grant.c (still_start_module_code), ch-parse.y (procedure):
- Move shared code into ...
- * ch-decl.c (start_chill_function): ... here.
- * ch-decl.c (start_chill_function): Add missing call to
- expand_start_bindings.
- * ch-decl.c (finish_chill_function): Add missing call to
- expand_end_bindings.
-
-Tue Jan 5 01:00:47 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
-
- * Makefile.in: took out the rest of the runtime support
-
-Mon Jan 4 18:02:06 1993 Bill Cox (bill@cygnus.com)
-
- * ch-expr.c: make chill_expand_array_assignment not static.
-
-Mon Jan 4 17:57:48 1993 Per Bothner (bothner@cygnus.com)
-
- * ch-grant.c, ch-parse.y: Remove all code for explicitly
- calling initializer functions. This is not needed, since we
- use the same mechanism used for C++ static constructors.
- * ch-grant.c (chill_start_module_code): Make sure the
- init_name starts with the magic string also used for C++
- initializers. Also, don't embed the file name in the name,
- just use the module name.
- * ch-grant.c (chill_finish_module_code): Now that the
- initializer name follows the standard 'collect' convention,
- don't need to call assembler_constructor_alias, but can
- use the standard assemble_constructor instead.
- * varasm.c (assemble_constructor_alias): Remove no-longer-
- needed function.
- * ch-parse.y: Move code that is common to the beginning of
- all functions to a new macro INIT_ACTION.
- Make sure INIT_ACTION is also done for callaction, fixing a bug.
- * ch-parse.y (INIT_ACTION): Do chill_start_module_code()
- before emit_line_note(), not after.
-
-Mon Jan 4 11:43:12 1993 Bill Cox (bill@cygnus.com)
-
- * ch-parse.y: restore requirement for :upper-bound in array decl.
- * ch-actions.c: enhance upper, lower, length functions for VARYING.
-
-Mon Jan 4 09:28:44 1993 Bill Cox (bill@cygnus.com)
-
- * ch-actions.c: fix NOT of boolean expr.
-
-Mon Jan 4 08:42:57 1993 Bill Cox (bill@cygnus.com)
-
- * ch-actions.c: provide range-checking function
- * ch-lex.l: better compiler-directive error messages,
- allow underscores in exponents
- * ch-loop.c: prevent passing NULL ptr to printf
-
-Sun Jan 3 11:57:13 1993 Bill Cox (bill@cygnus.com)
-
- * ch-typeck.c: correct & enable array index range-checking
-
-Sun Jan 3 11:36:39 1993 Bill Cox (bill@cygnus.com)
-
- * ch-parse.y: define IGNORED_DIRECTIVE
- * ch-typeck.c: subtract array's lower domain value, even if
- index expression is constant.
-
-Sat Jan 2 23:05:14 1993 Fred Fish (fnf@cygnus.com)
-
- * ch-lex.l (convert_float): Fix misspelling in error message.
-
-Sat Jan 2 16:02:16 1993 Per Bothner (bothner@rtl.cygnus.com)
-
- * Makefile.in: Took out chill-runtime support.
- Chill run times are now in ../chillrt, not ./chillrt.p
-
-Sat Jan 2 15:04:13 1993 Bill Cox (bill@cygnus.com)
-
- * ch-hash.h, chill.gperf: cleanup. fewer keywords seen by ch-parse.y.
-
-Sat Jan 2 13:27:49 1993 Per Bothner (bothner@rtl.cygnus.com)
-
- * ch-lex.l (check_newline): Use the orginal versions (derived
- from the C code, not the simplified, special-case version).
- Also, fix that version of check_newline to not call yylex()
- recursively.
- * ch-lex.l (yy_input): Call check_newline to handle
- newlines and check for # directives.
- * ch-lex.l (syntax): Don't recognize #-directives; these
- are now handled by check_newline.
- * ch-actions.c (lang_init): Call the modified version of
- check_newline(). Do this at the *after* we've initialized
- standard types, so this can be done while lineno is still 0.
-
-Sat Jan 2 10:57:20 1993 Bill Cox (bill@cygnus.com)
-
- * ch-hash.h, chill.gperf: add remaining reserved words.
-
-Sat Jan 2 09:59:55 1993 Bill Cox (bill@cygnus.com)
-
- * ch-tree.h, ch-parse.y, ch-lex.l: add remaining reserved words,
- names for exceptions
-
-Fri Jan 1 12:30:31 1993 Fred Fish (fnf@cygnus.com)
-
- * ch-tree.h (JOINER): Define joiner character the same way
- C++ defines it.
- * ch-grant.c (chill_start_module_code): Use JOINER character
- to implement name mangling for the initializer function name.
- Algorithm is designed to be simple, distinct from C++ mangled
- symbols, and easy to convert to demangled form.
-
-Thu Dec 31 10:30:51 1992 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-expr.c: make array assignments work with indirect refs.
- * ch-actions.c: prepare for array parameter handling.
- * ch-loop.c, ch-parse.y, ch-tree.def, ch-typeck.c: clean up.
-
-Thu Dec 31 15:29:20 1992 Per Bothner (bothner@rtl.cygnus.com)
-
- * ch-lex.l (yy_input): Re-write to return more than one
- character at a time (execpt when reading seize-files).
- Don't increment lineno until we start reading the next line.
- This fixes some off-by-one errors in lineno.
-
-Wed Dec 30 16:15:23 1992 Per Bothner (bothner@rtl.cygnus.com)
-
- * ch-convert.c: Assume use of new common.c.
- * ch-convert.c (convert_to_reference, convert_from_reference):
- New routines, to handle loc-identity declared variables and
- LOC parameters (both of which are implemented as references).
- * ch-lang.c (convert_to_boolean, convert_to_char): Move to
- ch-convert.c, where they would seem to belong.
- * ch-convert.c (convert): New function, since we no longer
- link in c-convert.c.
- * ch-expr.c (chill_expand_assignment): Handle by calling
- convert() instead of chill_comptypes().
- Also handle the LHS being a reference.
- * ch-parse.y: Add a procedure call as an action.
- * ch-parse.y (locdec, optlocinit): Move handling of
- loc-identity declarations from optlocinit to locdec
- - and add working semantics for it.
- * ch-parse.y (seizestatement, visibilty_stmt): Simplify.
- * ch-parse.y (grantstatement etc): Don't bother making list.
- * ch-lex.l: #include <sys/types.h> before <sys/stat.h>.
-
-Wed Dec 30 16:06:55 1992 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-parse.y, ch-expr.c: add support for declaring & assigning
- VARYING arrays.
- * ch-typeck.c: allow VARYING structures in assign_type_to_expr.
-
-Tue Dec 29 15:28:48 1992 Bill Cox (bill@cygnus.com)
-
- * ch-actions.c: implement expressions of arrays of char,
- ( concatenation, relationals ), correct type of code parameters
- * ch-expr.c: correct type of code parameters
-
-Tue Dec 29 11:16:19 1992 Bill Cox (bill@cygnus.com)
-
- * ch-decl.c: cleanup.
- * ch-parse.y: put emit_line_note() calls in lotsa places,
- per Fred's request; be sure that statements get counted also.
- * ch-lex.l: standardize function headers.
-
-Tue Dec 29 10:41:56 1992 Fred Fish (fnf@cygnus.com)
-
- * ch-decl.c (start_chill_function): Always return 1, rather
- than a random value.
- * ch-lex.l (check_newline): Add a version for chill that
- just snarfs the right value for main_input_filename out of
- the first line of the input file, without disturbing the
- lexer state or requiring it's assistance.
- * ch-actions.c (lang_init): Call check_newline, like the
- other language frontends, to get main_input_filename set
- from first line of input file.
-
-Mon Dec 28 18:49:01 1992 Bill Cox (bill@cygnus.com)
-
- * ch-parse.y: clean up conflicts. The remaining one is
- harmless.
-
-Mon Dec 28 17:28:40 1992 Bill Cox (bill@cygnus.com)
-
- * ch-parse.y, ch-lex.l, ch-actions.c: add stubs for I/O,
- clean up some parser conflicts.
-
-Mon Dec 28 15:00:20 1992 Bill Cox (bill@cygnus.com)
-
- * ch-parse.y, ch-lex.l: add keywords and parsing for most of
- CHILL I/O
-
-Sat Dec 26 20:48:23 1992 Fred Fish (fnf@cygnus.com)
-
- * chillrt/chillrt0.c: Oops, SVR4 doesn't need leading '_'
- on build_exceptions.
-
-Sat Dec 26 11:00:36 1992 Fred Fish (fnf@cygnus.com)
-
- * ch-grant.c (chill_finish_module_code): Call
- assemble_constructor_alias rather than assemble_constructor.
- * varasm.c (assemble_constructor_alias): New function,
- like assemble_constructor, but also handles the case where
- ASM_OUTPUT_CONSTRUCTOR is not defined and GNU ld is not
- being used. Emits a symbol table alias name with the correct
- prefix for collect to find and add to the __CTOR_LIST__.
- * chillrt/chillrt0.c: Build on previous hack that gets
- _build_exceptions into the __CTOR_LIST__, to make it work
- for both the non GNU-ld case and for the SVR4 case.
-
-Tue Dec 22 18:24:55 1992 Bill Cox (bill@cygnus.com)
-
- * ch-loop.c: clean up location enumeration - one more
- pass to do.
-
-Tue Dec 22 16:31:48 1992 Bill Cox (bill@cygnus.com)
-
- * ch-loop.c: Working version of location enumeration loop
-
-Tue Dec 22 14:42:14 1992 Bill Cox (bill@cygnus.com)
-
- * ch-lex.l: readability cleanup
-
-Mon Dec 21 14:58:39 1992 Bill Cox (bill@cygnus.com)
-
- * ch-parse.y, c-decl.c: Add Jukka's Pascal WITH code.
- ch-loop.c: rough draft of location enumeration
- ch-lex.l, ch-expr.c, ch-decl.c: minor cleanup
- ch-actions.c: finish making pred() and succ() work.
-
-Mon Dec 21 10:04:35 1992 Bill Cox (bill@cygnus.com)
-
- * ch-actions.c: allow pred(char) and succ(char).
-
-Sun Dec 20 16:04:28 1992 Bill Cox (bill@cygnus.com)
-
- * ch-expr.c, ch-actions.c, ch-parse.y, ch-loop.c,
- c-expr.c: make DO WITH work.
-
-Sun Dec 20 12:22:53 1992 Bill Cox (bill@cygnus.com)
-
- * ch-loop.c, ch-actions.c, ch-typeck.c: powerset loops
- now work
-
-Sat Dec 19 14:20:23 1992 Per Bothner (bothner@cygnus.com)
-
- * c-typeck.c (process_init_constructor): Add warning if
- there is a duplicate default initializer element.
- * ch-typeck.c (chill_give_type_to_expr): New function,
- to handle coercion of an expression to context-given type,
- Takes care of untyped tuples, and case expressions.
- * ch-decl.c (do_decls), ch-typeck.c (chill_expand_return,
- chill_expand_result), ch-parse.y <assignaction>:
- Use chill_give_type_to_expr().
- * ch-typeck.c (chill_handle_case_label): New parameter list,
- to handle the (new) conventions for <case_label>, including
- default elements and ranges.
- * ch-parse.y <expanded_case_label>, ch-typeck.c
- (expand_case_expr): Use new version of chill_handle_case_label.
- * ch-decl.c (push_syndecls): Change parameters: Instead of
- TREE_LIST representing a compete <synonym definition statement>,
- just pass the parts of a single <synonym definition> as 3
- different parameters. Also, use chill_give_type_to_expr(),
- to handle untyped tuples in the RHS.
- * ch-parse.y <syndeclist, syndef>: Don't bother trying to construct
- a tree - just call push_syndecls() on each <synonum_definition>
- as we see it.
- * ch-parse.y (exprlist_get_single): Remove; no longer needed.
- * ch-parse.y: Handle <tuple> without mode name diferently from
- <tuple> with mode name. The latter is a <primval> that can be
- in most contexts, but if the <mode name> is missing, the <tuple>
- is only allowed in certain contexts. Use the new non-terminal
- <untyped_expr> to indicate those contexts where untyped tuples
- (and case expressions) are valid because the expression gets a
- type from its context (such as the RHS of an assignment).
- Use chill_give_type_to_expr in those contexts.
-
-Sat Dec 19 14:01:26 1992 Bill Cox (bill@cygnus.com)
-
- * ch-actions.c, ch-loop.c, Makefile.in: looping stuff.
-
-Sat Dec 19 10:16:20 1992 Bill Cox (bill@cygnus.com)
-
- * ch-parse.y: clean up warning messages from byacc. bison
- still complains thrice.
-
-Fri Dec 18 12:33:29 1992 Michael Tiemann (tiemann@rtl.cygnus.com)
-
- * ch-actions.c (maybe_chill_comptypes): Delete unused
- function.
- (chill_comptypes): Add new parameter ERRSTR. All callers
- changed.
- (build_chill_binary_op): Fix indentation to match GNU coding
- style.
-
-Fri Dec 18 08:18:13 1992 Bill Cox (bill@rtl.cygnus.com)
-
- * ch-parse.y, ch-expr.c, ch-actions.c, expr.c: major
- cleanup of expression and assignment handling.
-
-Thu Dec 17 10:16:32 1992 Bill Cox (bill@cygnus.com)
-
- * ch-parse.y: standardize indentation after c-parse.y
-
-Wed Dec 16 15:22:12 1992 Per Bothner (bothner@cygnus.com)
-
- * c-typeck.c (process_init_constructor): Add support for
- a default initializer element.
- * ch-parse.y: Implement default elements for tuples
- (as in '(else):' and '(*):' ).
-
- * ch-parse.y: Previous change to dis-ambiguate case-labels
- seems to have allowed getting rid of all of the expr_or_list hair.
- * ch-decl.c (do_decls): Undo Tiemann's change to "Handle
- initialization of multiple variables by a tuple" - the
- idea is bogus.
-
-Wed Dec 16 11:17:53 1992 Bill Cox (bill@cygnus.com)
-
- * ch-parse.y: complete re-write of DO statement handling.
- now operational, except WITH is stubbed out. Improved
- syntax error message.
- * ch-actions.c: DO support: high_domain_value(), low_domain_value ().
- * ch-expr.c: fixes to IN_EXPR handling.
-
-Tue Dec 15 17:15:13 1992 Jim Wilson (wilson@sphagnum.cygnus.com)
-
- * ch-grant.c: Add casts to alloca return to avoid compiler warning.
- * ch-lex.c: Likewise.
-
- * Makefile.in (ch-lex.c): Delete incorrect free declaration added
- by flex to avoid compiler error.
-
-Tue Dec 15 08:41:08 1992 Michael Tiemann (tiemann@rtl.cygnus.com)
-
- * ch-decl.c (do_decls): Handle initialization of multiple
- variables by a tuple.
-
- * ch-decl.c (do_decls,start_chill_function): Make DECL public
- if we're doing a GRANT ALL at top level.
-
- * ch-lang.c (build_range_type): Deal with typecast to CHAR in
- range expression.
-
- * c-typeck.c (digest_init): SET_TYPE is not a scalar type.
- BOOLEAN_TYPE and CHAR_TYPE are scalar types.
-
-Mon Dec 14 14:58:32 1992 Michael Tiemann (tiemann@rtl.cygnus.com)
-
- * ch-lex.l (get_chill_{linenumber,filename}): New functions.
- (convert_number): Use LONG_TYPE_NODE instead of INTEGER_TYPE_NODE.
-
-Mon Dec 14 13:36:44 1992 Bill Cox (bill@cygnus.com)
-
- * expr.c: install and test newer Pascal IN_EXPR code,
- but don't activate it - it's very verbose.
-
-Mon Dec 14 00:22:49 1992 Fred Fish (fnf@cygnus.com)
-
- * Makefile.in (LANGUAGES): Add chill.
- * Makefile.in (CHILL_INSTALL_NAME, CHILL_CROSS_NAME):
- New macros for chill native and cross installation names.
- * Makefile.in (COMPILERS): Add cc1chill.
- * Makefile.in (CHILL_OBJS): New macro, chill objects.
- * Makefile.in (CHILL_TREE_H): New macro, chill headers.
- * Makefile.in (CHILL, chill, cc1chill, chill-runtime, libchill.a,
- sublibchill.a, ch-parse.o, ch-parse.c ch-*.o, install-libchill,
- install-librmt): New targets.
- * Makefile.in (install-native): Add install-libchill,
- install-librmt.
-
-Sun Dec 13 15:21:06 1992 Bill Cox (bill@cygnus.com)
-
- * ch-actions.c, ch-expr.c: Fix the pop-count in library calls.
-
-Sun Dec 13 14:07:32 1992 Bill Cox (bill@cygnus.com)
-
- * ch-actions.c: fix unary operations, modulus ops,
- (discovered after extending regression tests).
-
-Sun Dec 13 12:16:32 1992 Bill Cox (bill@cygnus.com)
-
- * resync with Michael and Wilfried
-
-Sun Dec 13 09:11:25 1992 Michael Tiemann (tiemann@rtl.cygnus.com)
-
- * ch-parse.y (output_constant): Fixed some whitespace
- problems.
- * ch-tree.h: Add declarations for new chill functions that
- have been implemented but not (yet) declared.
-
-Sat Dec 12 00:17:23 1992 Per Bothner (bothner@cygnus.com)
-
- * c-typeck.c (process_init_constructor): Warn about duplicate
- labels for labelled initializer elements.
- * ch-lex.l (various operator tokens, such as "+"): Don't
- set yylval.code to a TREE_CODE; this is better done in parser.
- * ch-parse.y: Some work with case labels and tuples.
- Get literal range as tuple (and case) labels working.
- Fix some problems introduced by recent grammar overhaul.
-
-Fri Dec 11 13:28:48 1992 Bill Cox (bill@cygnus.com)
-
- * ch-actions.c, ch-parse.y ch-tree.h ch-expr.c, ch-typeck.c:
- got long, real expressions working. We can also call a func-
- tion and use its return value.
-
-Thu Dec 10 14:45:17 1992 Per Bothner (bothner@cygnus.com)
-
- * ch-parse.y: Major change to remove or at least identify
- parser ambiguities. One result: We now allow actions that
- start with '(', as required by teh Blue Book. This does break
- some things; look for FIXME for things that need work.
- * ch-typeck.c (chill_expand_case_expr): We need an extra
- level of looping to (in the future) support <case label
- specification>s with more than one <case label list>.
-
-Thu Dec 10 09:21:41 1992 Bill Cox (bill@cygnus.com)
-
- * ch-actions.c, ch-expr.c: Implement string assignments
- and relationals.
-
-Thu Dec 10 07:17:35 1992 Bill Cox (bill@cygnus.com)
-
- * ch-decl.c, ch-typeck.c: rest of previous commit.
-
-Wed Dec 9 18:26:29 1992 Bill Cox (bill@cygnus.com)
-
- * ch-parse.y, ch-actions.c, ch-expr.c: redo type checking.
- regression test and fix bit arrays and set ops.
-
-Mon Dec 7 14:57:46 1992 Bill Cox (bill@cygnus.com)
-
- * ch-actions.c: implement crude relationals between
- non-exotic operands, such as integers.
-
-Mon Dec 7 10:42:35 1992 Bill Cox (bill@cygnus.com)
-
- * ch-actions.c: implement relational, logic operations
- on arrays of BOOLs.
-
-Mon Dec 7 08:55:20 1992 Michael Tiemann (tiemann@rtl.cygnus.com)
-
- * ch-actions.c (lang_init): Set LINENO to 1 at beginning to
- indicate we are done with initialization.
-
- * ch-decl.c (do_decls): Set TREE_PUBLIC if we are doing a
- `grant all'.
- (start_chill_function): Ditto.
-
- * ch-lex.c (convert_bitstring): Set TREE_CONSTANT.
- (compiler_directive): Don't confuse compiler directives with
- equality comparison operators.
-
- * ch-parse.y: Clear CURRENT_LOCNAMELIST after calling do_decls.
-
-Sun Dec 6 13:12:32 1992 Bill Cox (bill@cygnus.com)
-
- * ch-actions.c: repair set inequality code.
-
-Sun Dec 6 11:15:59 1992 Bill Cox (bill@cygnus.com)
-
- * ch-parse.y, ch-actions.c, ch-expr.c: Implement set-oriented
- relational expressions, including (<, <=, =, /=, >, >=, IN).
-
-Fri Dec 4 13:54:58 1992 Brendan Kehoe (brendan@lisa.cygnus.com)
-
- * tree.def: Move CARD_EXPR and SET_LE_EXPR back down with the other
- Pascal-required ones, since C++ no longer needs them. When
- Chill's public, a comment can be added to the effect that
- SET_LE_EXPR is also used by Chill.
-
-Fri Dec 4 12:05:01 1992 Bill Cox (bill@cygnus.com)
-
- * Restore CARD_EXPR and SET_LE_EXPR to tree.def.
-
-Fri Dec 4 10:23:10 1992 Bill Cox (bill@cygnus.com)
- * Get *.def and *.c in sync.
-
-Fri Dec 4 06:48:41 1992 Fred Fish (fnf@cygnus.com)
-
- * ch-actions.c (lang_init): Change types "long" and
- "ulong" from 16 bits to 32.
- * dwarfout.c (fundamental_type_code): Use FT_signed_char
- for type "byte" and FT_unsigned_char for type "ubyte".
-
-Thu Dec 3 15:13:24 1992 Bill Cox (bill@cygnus.com)
- * ch-actions.c, ch-tree.def, ch-parse.y: preparation
- for powerset expressions.
-
-Tue Dec 2 17:02:30 1992 Bill Cox (bill@cygnus.com)
- * ch-actions.c: sketch code for exceptions generated
- by builtin routines.
-
-Tue Dec 2 12:49:50 1992 Bill Cox (bill@cygnus.com)
- * ch-actions.c, ch-parse.y: add support for lower()
- upper() builtin functions.
-
-Wed Dec 2 12:03:30 1992 Fred Fish (fnf@cygnus.com)
-
- * Makefile.in (chillrt0.o, install-chillrt0): Remove.
- * chill (library): Remove chillrt0.o.
- * chillrt/Makefile: Remove maintenance of chillrt0.o as a
- separate file. Now gets put in libchill.a.
-
-Tue Dec 2 10:100:20 1992 Bill Cox (bill@cygnus.com)
-
- * ch-parse.y, ch-actions.c: add support for num()
- builtin function.
-
-Wed Dec 2 09:52:06 1992 Michael Tiemann (tiemann@rtl.cygnus.com)
-
- * ch-decl.c (fixup_unknown_type): New function.
- (push_newmode,push_synmode): Call `fixup_unknown_type' when we
- see a declaration that uses `unknown_type_node'. FIXME.
-
- * ch-grant.c (decode_constant): New function.
- (decode_decl): Call `decode_constant' for CONST_DECLs.
-
- * ch-lex.l (char action): Use ridpointers instead of
- lookup_name to get "char"'s declaration.
-
- * ch-parse.y: Call `build_lang_decl' instead of `build_decl'
- when we need to build a TYPE_DECL.
-
-Tue Dec 2 09:44:05 1992 Bill Cox (bill@cygnus.com)
-
- * ch-typeck.c: clean up a gcc warning with a forward
- declaration of build_string_type.
-
-Tue Dec 1 16:51:05 1992 Bill Cox (bill@cygnus.com)
-
- * ch-actions.c: completely remove those builtin calls
- that are duplicated in c-decl.c
-
-Tue Dec 1 16:38:51 1992 Fred Fish (fnf@cygnus.com)
-
- * ch-actions.c (lang_init): Ifdef out initializations for
- __builtin_abs and __builtin_fabs, since they are duplicates of
- initializations in c-decl.c, and trigger spurious warnings.
-
-Tue Dec 1 16:35:18 1992 Bill Cox (bill@cygnus.com)
-
- * ch-parse.y: make size() work with a typename argument.
-
-Tue Dec 1 16:15:56 1992 Bill Cox (bill@cygnus.com)
-
- * ch-parse.y, ch-lex.l, ch-actions.c: add builtin
- functions min, max, card.
-
-Tue Dec 1 12:35:56 1992 Bill Cox (bill@cygnus.com)
-
- * ch-lex.l: fix char-type
-
-Tue Dec 1 11:10:56 1992 Bill Cox (bill@cygnus.com)
-
- * ch-parse.y, ch-actions: added parsing and processing
- for upper, lower, and length built-ins.
-
-Tue Dec 1 09:40:49 1992 Fred Fish (fnf@cygnus.com)
-
- * dwarf.h (LANG_CHILL): Add as GNU extension.
- * dwarfout.c (output_compile_unit_die): Test language_string and
- set LANG_CHILL if appropriate.
- * ch-parse.y (language_string): New for chill.
- * chillrt: Renamed directory chill to chillrt.
- * chill: Renamed chillsh to chill.
- * Makefile.in: Adjust for renamings.
- * chillrt/Makefile: Adjust for directory renaming.
-
-Mon Nov 30 17:35:33 1992 Fred Fish (fnf@cygnus.com)
-
- * chillsh: New script frontend (ala g++), installed as "chill".
- Can't be called "chill.sh" because make tries to cat it into the
- "chill" directory. Can't be called just "chill" cause that's
- already there as a directory.
- * Makefile.in: Add rules to install chillsh as "chill".
- * chill/libchill.c: Temporarily ifdef out stuff that wants
- to conflict with i486/SVR4 runtime or wants to pull in librmt.a,
- which itself causes linkage to fail.
-
-Mon Nov 30 16:28:19 1992 Bill Cox (bill@cygnus.com)
-
- * ch-lex.l: added keywords for TRUNC, ROUND, FLOAT, LFLOAT
- conversion routines.
- * ch-parse.y: added %tokens for TRUNC, ROUND, FLOAT, LFLOAT.
- Added production for SIZE(expr).
- * ch-actions.c: Add semantic routine chill_sizeof ().
-
-Mon Nov 30 16:20:40 1992 Per Bothner (bothner@cygnus.com)
-
- * ch-lex.l, ch-parse.y: Translate token PFEIL into English ARROW.
- * ch-parse.y (op6): Remove handling of string repetition operator,
- until we can figure out a way to parse it correctly.
- * ch-parse.y (optmodename): New non-terminal.
- * ch-parse.y (tuple): Merge the two variants using optmodename.
- * ch-parse.y (location): Add semantic actions for
- dereferencing operator ->.
-
-Mon Nov 30 08:01:29 1992 Bill Cox (bill@cygnus.com)
-
- * ch-actions.c: removed compile warning, better code for abs.
-
- * ch-parse.y: add productions for builtin functions succ, pred,
- abs, and size. Add %tokens also. Sort %tokens alphabetically.
-
- * ch-lex.l: add parsing for builtin function names, such as abs,
- pred, succ, etc. Put flex -a option into Makefile.in, so we can
- clean up the lexer soon.
-
-Tue Nov 24 14:18:48 1992 Per Bothner (bothner@rtl.cygnus.com)
-
- * ch-typeck.c (chill_handle_case_label, chill_handle_case_default):
- New functions, for code common to CASE actions and expressions.
- * chill.y: Replace some code by calls to chill_handle_case_label
- and chill_handle_case_default.
- * ch-typeck.c (chill_expand_case_expr): Add semantics.
-
- * tree.c: Change doing_chill_thang from extern to common.
-
-Mon Nov 23 18:34:22 1992 Per Bothner (bothner@rtl.cygnus.com)
-
- * ch-tree.def: New CASE_EXPR type, for case expressions.
- * ch-expr.c (chill_expand_expr): Hook for CASE_EXPR.
- * ch-typeck.c (chill_expand_case_expr): New function.
- Placeholder to implement case expressions.
- * ch-typeck.c (chill_expand_result, chill_expand_return):
- Handle mode-unspecified tuples and case expressions in
- the context of RETURN and RESULT actions.
- * chill.y (assignaction): Handle case expressions in the
- context of the RHS of an assignment action.
- * chill.y (caseaction): Remove spurious duplicate OF in grammar.
- * chill.y: Handle labeled structure tuples.
- * chill.y: New rules to parse CASE expressions.
- * tree.c (build_function_types): Allow Chill functions
- to return arrays and functions.
-
-Wed Nov 18 13:50:28 1992 Per Bothner (bothner@rtl.cygnus.com)
-
- * ch-typeck.c (chill_expand_tuple): New function. Expand a
- tuple (constructor) given an expected (context) type.
- * chill.y: Implement 'LHS := TUPLE' using expand_chill_tuple,
- using the mode of the LHS and the expected type of the TUPLE.
- * chill.y: Implement initialization.
- * chill.y: Fix some syntax bugs (forbidlist must be surrounded
- by parentheses), and remove or note ambiguities.
- * chill.y: Started converting layout style to be like c-parse.in.
- * chill.y: Implement IF expressions.
- * chill.y: Added syntax rules for tuples. Labelled and unlabelled
- array tuples should now work (in some contexts).
- * ch-actions.c: Initialize doing_chill_thang to 1.
- * ch-decl.c (do_decls): Set DECL_INITIAL if there is an
- initializer, to make pushdecl and finish_decl work.
- * c-decl.c (convert_for_assignment): If Chill, don't convert
- function and arrays into pointers. (Maybe functions should
- still be converted?)
- * c-typeck.c (grokdeclarator): Allow functions in Chill
- to return arrays and functions.
-
-Mon Nov 16 15:40:47 1992 Per Bothner (bothner@rtl.cygnus.com)
-
- * chill.y (exprlist_get_single): New function, used when
- parsing tuples.
- * chill.y: Re-did parsing of tuples to remove ambiguities.
- This was a bitch.
-
-Tue Nov 10 16:30:55 1992 Per Bothner (bothner@rtl.cygnus.com)
-
- * ch-typeck.c (chill_expand_result); Set TREE_SIDE_EFEFCTS
- flags on assignment to result.
- * ch-typeck.c (build_chill_array_ref): Subtract lower
- bound of domain if non-zero. Preliminary hook for range checking.
- * ch-tree.h, chill.l: Combine variables range_check and
- range_check_disabled into global variable range_checking.
- * ch-tree.h: Better definitions of CH_CLASS_IS_VALUE
- CH_CLASS_IS_DERIVED.
-
diff --git a/gcc/ch/Make-lang.in b/gcc/ch/Make-lang.in
deleted file mode 100644
index 6c8154f003e..00000000000
--- a/gcc/ch/Make-lang.in
+++ /dev/null
@@ -1,186 +0,0 @@
-# Top level Makefile fragment for GNU CHILL.
-# Copyright (C) 1994, 1998, 2000 Free Software Foundation, Inc.
-
-#This file is part of GNU CC.
-
-#GNU CC is free software; you can redistribute it and/or modify
-#it under the terms of the GNU General Public License as published by
-#the Free Software Foundation; either version 2, or (at your option)
-#any later version.
-
-#GNU CC is distributed in the hope that it will be useful,
-#but WITHOUT ANY WARRANTY; without even the implied warranty of
-#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-#GNU General Public License for more details.
-
-#You should have received a copy of the GNU General Public License
-#along with GNU CC; see the file COPYING. If not, write to
-#the Free Software Foundation, 59 Temple Place - Suite 330,
-#Boston, MA 02111-1307, USA. */
-
-# This file provides the language dependent support in the main Makefile.
-# Each language makefile fragment must provide the following targets:
-#
-# foo.all.build, foo.all.cross, foo.start.encap, foo.rest.encap,
-# foo.info, foo.dvi,
-# foo.install-normal, foo.install-common, foo.install-info, foo.install-man,
-# foo.uninstall,
-# foo.mostlyclean, foo.clean, foo.distclean, foo.extraclean,
-# foo.maintainer-clean, foo.stage1, foo.stage2, foo.stage3, foo.stage4
-#
-# where `foo' is the name of the language.
-#
-# It should also provide rules for:
-#
-# - making any compiler driver (eg: g++)
-# - the compiler proper (eg: cc1plus)
-# - define the names for selecting the language in LANGUAGES.
-#
-# define version of GNUCHILL compiler. Note: maybe we have to change the
-# mechanism
-GNUCHILL_VERSION = 1.5.2
-
-# Actual names to use when installing a native compiler.
-# (Cygnus configure overrides these when using -program-transform-name).
-CHILL_INSTALL_NAME = chill
-
-# Actual names to use when installing a cross-compiler.
-# (Cygnus configure overrides these when using -program-transform-name).
-CHILL_CROSS_NAME = $(target_alias)-chill
-
-CHILL_SRCS = $(srcdir)/ch/actions.c $(srcdir)/ch/convert.c \
- $(srcdir)/ch/decl.c $(srcdir)/ch/except.c $(srcdir)/ch/expr.c \
- $(srcdir)/ch/grant.c $(srcdir)/ch/inout.c $(srcdir)/ch/lang.c \
- $(srcdir)/ch/lex.c $(srcdir)/ch/loop.c \
- $(srcdir)/ch/parse.c $(srcdir)/ch/satisfy.c \
- $(srcdir)/ch/tasking.c $(srcdir)/ch/timing.c $(srcdir)/ch/tree.c \
- $(srcdir)/ch/typeck.c
-
-# Extra flags to pass to recursive makes.
-CHILL_FLAGS_TO_PASS = \
- "CHILLFLAGS=$(CHILLFLAGS)" \
- "CHILL_FOR_TARGET=$(CHILL_FOR_TARGET)" \
- "CHILL_LIB=$(CHILL_LIB)" \
- "GNUCHILL_VERSION=$(GNUCHILL_VERSION)"
-#
-# Define the names for selecting languages in LANGUAGES.
-CHILL: chill cc1chill$(exeext)
-
-# handle startfile in chill script and build script to install
-chill: $(srcdir)/ch/chill.in Makefile
- thisdir=`pwd` ; \
- sed -e "s:startfile=chillrt0:startfile=$${thisdir}/ch/runtime/chillrt0.o:" \
- -e "s:libpath=chillrt:libpath=-L$${thisdir}/ch/runtime/:" \
- -e "s:whatgcc=gcc:whatgcc=\"$${thisdir}/xgcc$(exeext) -B$${thisdir}/\":" \
- -e "s:gnuchill_version=unknown:gnuchill_version=$(GNUCHILL_VERSION):" \
- -e "s:gnuchill_script_flags=:gnuchill_script_flags=\"$(GNUCHILL_SCRIPT_FLAGS)\":" $(srcdir)/ch/chill.in > chill ; \
- chmod a+x chill ; \
- if [ -f ../gcc-cross$(exeext) ]; then \
- whatgcc=$(GCC_CROSS_NAME) ; \
- else \
- whatgcc=$(GCC_INSTALL_NAME) ; \
- fi; \
- sed -e "s:startfile=chillrt0:startfile=$(libsubdir)/chillrt0.o:" \
- -e "s:whatgcc=gcc:whatgcc=$(bindir)/$${whatgcc}:" \
- -e "s:gnuchill_version=unknown:gnuchill_version=$(GNUCHILL_VERSION):" \
- -e "s:libpath=chillrt:libpath=:" \
- -e "s:gnuchill_script_flags=:gnuchill_script_flags=\"$(GNUCHILL_SCRIPT_FLAGS)\":" $(srcdir)/ch/chill.in > chill.install ; \
- chmod a+x chill.install
-
-# Don't depend on cc1chill$(exeext), because chill-cross is always built for cross,
-# and thus a cc1chill$(exeext) dependence would force cc1chill$(exeext) to always be built.
-# Note that gcc-cross and g++-cross do not have cc1 or cc1plus dependencies.
-chill-cross: $(srcdir)/ch/chill.in
- touch $@
-
-cc1chill$(exeext): $(P) $(CHILL_SRCS) $(LIBDEPS) $(BACKEND) \
- insn-config.h insn-flags.h insn-attr.h insn-codes.h \
- c-typeck.o c-aux-info.o c-common.o \
- ggc-callbacks.o
- cd ch; $(MAKE) $(LANG_FLAGS_TO_PASS) $(CHILL_FLAGS_TO_PASS) ../cc1chill$(exeext)
-
-#
-# Build hooks:
-
-CHILL.all.build: chill
-CHILL.all.cross: chill-cross
-CHILL.start.encap: chill
-CHILL.rest.encap:
-CHILL.dvi: chill.dvi
-
-CHILL.info: $(srcdir)/ch/chill.info
-
-$(srcdir)/ch/chill.info: $(srcdir)/ch/chill.texi
- cd $(srcdir)/ch && $(MAKEINFO) -o chill.info chill.texi
-
-chill.dvi: $(srcdir)/ch/chill.texi $(srcdir)/extend.texi $(srcdir)/invoke.texi $(srcdir)/md.texi $(srcdir)/rtl.texi $(srcdir)/tm.texi
- cd ch ; \
- TEXINPUTS=${texidir}:$(srcdir):$$TEXINPUTS tex chill.texi ; \
- texindex chill.?? ; \
- TEXINPUTS=${texidir}:$(srcdir):$$TEXINPUTS tex chill.texi
-# FIXME: Not sure languages should do this.
- cp ch/chill.dvi chill.dvi
-#
-# Install hooks:
-# cc1chill is installed elsewhere as part of $(COMPILERS).
-
-CHILL.install-normal:
-
-# Install the driver program
-CHILL.install-common:
- -if [ -f cc1chill$(exeext) ] ; then \
- if [ -f chill.install ] ; then \
- if [ -f gcc-cross$(exeext) ]; then \
- rm -f $(bindir)/$(CHILL_CROSS_NAME); \
- $(INSTALL_SCRIPT) chill.install $(bindir)/$(CHILL_CROSS_NAME); \
- chmod a+x $(bindir)/$(CHILL_CROSS_NAME); \
- else \
- rm -f $(bindir)/$(CHILL_INSTALL_NAME); \
- $(INSTALL_SCRIPT) chill.install $(bindir)/$(CHILL_INSTALL_NAME); \
- chmod a+x $(bindir)/$(CHILL_INSTALL_NAME); \
- fi ; \
- fi ; \
- fi
-
-# Don't delete $(infodir)/ch.info* unless there's actually new
-# docs to install (in case LANGUAGES didn't contain chill earlier).
-CHILL.install-info:
- -cd $(srcdir)/ch; for i in chill.info*; do \
- rm -f $(infodir)/chill.info*; \
- realfile=`echo $$i | sed -e 's|.*/\([^/]*\)$$|\1|'`; \
- $(INSTALL_DATA) $$i $(infodir)/$$realfile; \
- done
-
-CHILL.install-man:
-
-CHILL.uninstall:
- -rm -rf $(bindir)/$(CHILL_INSTALL_NAME)
- -rm -rf $(bindir)/$(CHILL_CROSS_NAME)
-#
-# Clean hooks:
-# A lot of the ancillary files are deleted by the main makefile.
-# We just have to delete files specific to us.
-
-CHILL.mostlyclean:
- -rm -f chill.install ch/*.o ch/ch-version.c
-CHILL.clean:
-CHILL.distclean:
- -rm -f ch/config.status ch/Makefile
-CHILL.extraclean:
-CHILL.maintainer-clean:
- -rm -f ch/TAGS
- -rm -f $(srcdir)/ch/chill.info* ch/chill.dvi ch/chill.??s ch/chill.*aux
-# Delete locally created file.
- -rm -f ch/hash.h
-#
-# Stage hooks:
-# The main makefile has already created stage?/ch.
-
-CHILL.stage1: stage1-start
- -mv ch/*.o stage1/ch
-CHILL.stage2: stage2-start
- -mv ch/*.o stage2/ch
-CHILL.stage3: stage3-start
- -mv ch/*.o stage3/ch
-CHILL.stage4: stage4-start
- -mv ch/*.o stage4/ch
diff --git a/gcc/ch/Makefile.in b/gcc/ch/Makefile.in
deleted file mode 100644
index a15c1ce7506..00000000000
--- a/gcc/ch/Makefile.in
+++ /dev/null
@@ -1,330 +0,0 @@
-# Makefile for GNU CHILL compiler.
-# Copyright (C) 1987, 1988, 1990, 1991, 1992, 1993, 1994, 1998,
-# 1999, 2000, 2001 Free Software Foundation, Inc.
-
-#This file is part of GNU CC.
-
-#GNU CC is free software; you can redistribute it and/or modify
-#it under the terms of the GNU General Public License as published by
-#the Free Software Foundation; either version 2, or (at your option)
-#any later version.
-
-#GNU CC is distributed in the hope that it will be useful,
-#but WITHOUT ANY WARRANTY; without even the implied warranty of
-#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-#GNU General Public License for more details.
-
-#You should have received a copy of the GNU General Public License
-#along with GNU CC; see the file COPYING. If not, write to
-#the Free Software Foundation, 59 Temple Place - Suite 330,
-#Boston, MA 02111-1307, USA. */
-
-# The makefile built from this file lives in the language subdirectory.
-# It's purpose is to provide support for:
-#
-# 1) recursion where necessary, and only then (building .o's), and
-# 2) building and debugging cc1 from the language subdirectory, and
-# 3) nothing else.
-#
-# The parent makefile handles all other chores, with help from the
-# language makefile fragment, of course.
-#
-# The targets for external use are:
-# all, TAGS, ???mostlyclean, ???clean.
-
-# Suppress smart makes who think they know how to automake Yacc files
-.y.c:
-
-
-# Variables that exist for you to override.
-# See below for how to change them for certain systems.
-
-# Various ways of specifying flags for compilations:
-# CFLAGS is for the user to override to, e.g., do a bootstrap with -O2.
-# BOOT_CFLAGS is the value of CFLAGS to pass
-# to the stage2 and stage3 compilations
-# XCFLAGS is used for most compilations but not when using the GCC just built.
-XCFLAGS =
-CFLAGS = -g
-BOOT_CFLAGS = -O $(CFLAGS)
-# These exists to be overridden by the x-* and t-* files, respectively.
-X_CFLAGS =
-T_CFLAGS =
-
-X_CPPFLAGS =
-T_CPPFLAGS =
-
-CC = @CC@
-AR = ar
-AR_FLAGS = rc
-SHELL = /bin/sh
-MAKEINFO = makeinfo
-TEXI2DVI = texi2dvi
-
-# Define this as & to perform parallel make on a Sequent.
-# Note that this has some bugs, and it seems currently necessary
-# to compile all the gen* files first by hand to avoid erroneous results.
-P =
-
-# This is used instead of ALL_CFLAGS when compiling with GCC_FOR_TARGET.
-# It omits XCFLAGS, and specifies -B./.
-# It also specifies -B$(tooldir)/ to find as and ld for a cross compiler.
-GCC_CFLAGS=$(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) $(CFLAGS)
-
-# Tools to use when building a cross-compiler.
-# These are used because `configure' appends `cross-make'
-# to the makefile when making a cross-compiler.
-
-# We don't use cross-make. Instead we use the tools
-# from the build tree, if they are available.
-# program_transform_name and objdir are set by configure.in.
-program_transform_name =
-objdir = .
-
-target=@target@
-xmake_file=@dep_host_xmake_file@
-tmake_file=@dep_tmake_file@
-#version=`sed -e 's/.*\"\([^ \"]*\)[ \"].*/\1/' < $(srcdir)/version.c`
-#mainversion=`sed -e 's/.*\"\([0-9]*\.[0-9]*\).*/\1/' < $(srcdir)/version.c`
-
-# Directory where sources are, from where we are.
-srcdir = @srcdir@
-VPATH = @srcdir@
-
-# Directory where texinfo.tex lives
-# texidir = $(srcdir)/../../texinfo
-
-# Top build directory, relative to here.
-top_builddir = ..
-
-# Internationalization library.
-INTLLIBS = @INTLLIBS@
-
-# Additional system libraries to link with.
-CLIB=
-
-# Choose the real default target.
-ALL=all
-
-# End of variables for you to override.
-
-# Definition of `all' is here so that new rules inserted by sed
-# do not specify the default target.
-all: all.indirect
-
-# This tells GNU Make version 3 not to put all variables in the environment.
-.NOEXPORT:
-
-# sed inserts variable overrides after the following line.
-####target overrides
-@target_overrides@
-####host overrides
-@host_overrides@
-####cross overrides
-@cross_defines@
-@cross_overrides@
-####build overrides
-@build_overrides@
-####site overrides
-# @site_overrides@
-#
-# Now figure out from those variables how to compile and link.
-
-all.indirect: Makefile ../chill ../cc1chill$(exeext)
-
-# IN_GCC tells obstack.h that we are using gcc's <stddef.h> file.
-INTERNAL_CFLAGS = $(CROSS) -DIN_GCC @extra_c_flags@
-
-# This is the variable actually used when we compile.
-ALL_CFLAGS = $(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) $(CFLAGS) $(XCFLAGS)
-
-# Likewise.
-ALL_CPPFLAGS = $(CPPFLAGS) $(X_CPPFLAGS) $(T_CPPFLAGS)
-
-# This is where we get libiberty.a from.
-LIBIBERTY = ../../libiberty/libiberty.a
-
-# How to link with both our special library facilities
-# and the system's installed libraries.
-LIBS = $(LIBIBERTY) $(CLIB) $(INTLLIBS)
-LIBDEPS = $(INTLLIBS) $(LIBIBERTY)
-
-# Specify the directories to be searched for header files.
-# Both . and srcdir are used, in that order,
-# so that tm.h and config.h will be found in the compilation
-# subdirectory rather than in the source directory.
-INCLUDES = -I. -I.. -I$(srcdir) -I$(srcdir)/.. -I$(srcdir)/../config -I$(srcdir)/../../include
-
-# Flags to pass to recursive makes.
-# ??? $(CC) may need some work to handle stage[123].
-# ??? The choices here will need some experimenting with.
-FLAGS_TO_PASS = \
- "AR_FLAGS=$(AR_FLAGS)" \
- "AR_FOR_TARGET=$(AR_FOR_TARGET)" \
- "BISON=$(BISON)" \
- "BISONFLAGS=$(BISONFLAGS)" \
- "CC=$(CC)" \
- "CFLAGS=$(CFLAGS)" \
- "GCC_FOR_TARGET=$(CC_FOR_TARGET)" \
- "LDFLAGS=$(LDFLAGS)" \
- "LEX=$(LEX)" \
- "LEXFLAGS=$(LEXFLAGS)" \
- "MAKEINFO=$(MAKEINFO)" \
- "MAKEINFOFLAGS=$(MAKEINFOFLAGS)" \
- "RANLIB_FOR_TARGET=$(RANLIB_FOR_TARGET)" \
- "RANLIB_TEST_FOR_TARGET=$(RANLIB_TEST_FOR_TARGET)" \
- "SHELL=$(SHELL)" \
- "exec_prefix=$(exec_prefix)" \
- "prefix=$(prefix)" \
- "tooldir=$(tooldir)" \
- "bindir=$(bindir)" \
- "libsubdir=$(libsubdir)"
-
-# Always use -I$(srcdir)/config when compiling.
-.c.o:
- $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $<
-
-# This tells GNU make version 3 not to export all the variables
-# defined in this file into the environment.
-.NOEXPORT:
-#
-# Lists of files for various purposes.
-
-# Language-specific object files for CHILL
-
-CHILL_OBJS = parse.o actions.o except.o grant.o lang.o \
- tree.o lex.o decl.o typeck.o convert.o expr.o loop.o \
- tasking.o timing.o inout.o satisfy.o ch-version.o \
- ../ggc-callbacks.o
-
-BACKEND = ../toplev.o ../libbackend.a
-
-../cc1chill$(exeext): $(P) $(CHILL_OBJS) $(BACKEND) $(LIBDEPS)
- $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(CHILL_OBJS) \
- $(BACKEND) $(LIBS)
-
-# This executable is used in the CHILL regression
-# test script
-utils/printf : $(srcdir)/utils/printf.c
- $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $<
-
-#
-# This is the top-level trigger for a CHILL regression test.
-# It also builds those tools needed for CHILL regression testing.
-#
-check: ../cc1chill$(exeext) utils/printf
- cd ..; $(MAKE) $(FLAGS_TO_PASS) xgcc gcov cpp cc1 ld
- $(srcdir)/regression.sh -d -p
-
-clean-tests:
- cd testsuite/execute; $(MAKE) clean
- cd testsuite/execute/oe; $(MAKE) clean
- cd testsuite/compile/elektra; $(MAKE) clean
- cd testsuite/compile/votrics; $(MAKE) clean
- cd testsuite/compile; $(MAKE) clean
- cd testsuite/noncompile; $(MAKE) clean
- cd testsuite/examples; $(MAKE) clean
-
-mostlyclean:
- test -d testsuite && $(MAKE) clean-tests
- rm -f *.o
-
-clean: mostlyclean
-
-#
-Makefile: $(srcdir)/Makefile.in $(srcdir)/../configure
- cd ..; $(SHELL) config.status
-
-native: config.status ../cc1chill$(exeext) ../chill
-#
-# Compiling object files from source files.
-
-# Note that dependencies on obstack.h are not written
-# because that file is not part of GCC.
-
-# CHILL language specific files.
-
-EXPR_H = $(srcdir)/../expr.h ../insn-codes.h
-RTL_H = $(srcdir)/../rtl.h $(srcdir)/../rtl.def \
- $(srcdir)/../machmode.h $(srcdir)/../machmode.def
-TREE_H = $(srcdir)/../tree.h $(srcdir)/../real.h $(srcdir)/../tree.def \
- $(srcdir)/../machmode.h $(srcdir)/../machmode.def
-CHILL_TREE_H = $(TREE_H) ch-tree.h ch-tree.def
-
-# hash.h really depends on $(srcdir)/gperf.
-# But this would screw things for people that don't have gperf,
-# if gperf got touched, say.
-# Thus you have to remove hash.h to force it to be re-made.
-# Note: CHILL requires two sets of keywords, one all uppercase and
-# one all lowercase. The hash table ends up with both sets in it.
-$(srcdir)/hash.h:
- sed -e '1,/^%%/d' < $(srcdir)/gperf | \
- sed '/^[^a-zA-Z]/d' | tr "[a-z]" "[A-Z]" > gperf.tmp2
- cat $(srcdir)/gperf gperf.tmp2 > gperf.tmp
- gperf -L C -F ', 0, 0, 0' -D -E -S1 -p -j1 -i 1 -g -o -t -k'*' \
- gperf.tmp > $(srcdir)/hash.h || ( \
- echo "Please update your 'gperf' from ftp://ftp.gnu.org/pub/gnu/gperf/" >&2 ; \
- exit 1 )
- $(RM) gperf.tmp gperf.tmp2
-
-actions.o : actions.c $(CONFIG_H) $(CHILL_TREE_H) actions.h $(RTL_H) \
- lex.h $(srcdir)/../flags.h $(srcdir)/../input.h \
- $(EXPR_H) $(srcdir)/../system.h $(srcdir)/../toplev.h
-convert.o : convert.c $(CONFIG_H) $(CHILL_TREE_H) $(srcdir)/../flags.h \
- $(srcdir)/../tree.h $(srcdir)/../system.h $(srcdir)/../toplev.h \
- $(srcdir)/../convert.h
-decl.o : decl.c $(CONFIG_H) $(CHILL_TREE_H) $(srcdir)/../flags.h lex.h \
- $(srcdir)/../system.h $(srcdir)/../toplev.h
-except.o : except.c $(CONFIG_H) $(srcdir)/../tree.h $(RTL_H) $(CHILL_TREE_H) \
- $(srcdir)/../system.h $(srcdir)/../toplev.h
-expr.o : expr.c $(CONFIG_H) $(RTL_H) $(CHILL_TREE_H) $(srcdir)/../flags.h \
- $(EXPR_H) $(srcdir)/../tree.h lex.h $(srcdir)/../system.h \
- $(srcdir)/../toplev.h
-grant.o: grant.c $(CONFIG_H) $(CHILL_TREE_H) $(RTL_H) $(srcdir)/../flags.h \
- $(srcdir)/../input.h lex.h actions.h $(srcdir)/../system.h \
- $(srcdir)/../toplev.h $(srcdir)/../output.h
-inout.o : inout.c $(CONFIG_H) $(CHILL_TREE_H) $(srcdir)/../flags.h \
- $(srcdir)/../input.h $(srcdir)/../system.h $(srcdir)/../toplev.h
-lang.o : lang.c $(CONFIG_H) $(CHILL_TREE_H) $(srcdir)/../input.h lex.h \
- $(srcdir)/../system.h $(srcdir)/../toplev.h $(EXPR_H) $(RTL_H)
-lex.o : lex.c $(CONFIG_H) $(CHILL_TREE_H) $(RTL_H) $(srcdir)/../flags.h \
- $(srcdir)/../input.h $(srcdir)/parse.h $(srcdir)/../system.h \
- $(srcdir)/../toplev.h lex.h $(srcdir)/../dwarfout.h hash.h
-loop.o : loop.c $(CONFIG_H) $(RTL_H) $(CHILL_TREE_H) lex.h \
- $(srcdir)/../flags.h $(srcdir)/../input.h \
- $(srcdir)/../tree.h $(srcdir)/../system.h $(srcdir)/../toplev.h
-parse.o : parse.c $(CONFIG_H) $(CHILL_TREE_H) parse.h \
- lex.h actions.h tasking.h $(srcdir)/../system.h $(srcdir)/../toplev.h
-satisfy.o : satisfy.c $(CONFIG_H) $(CHILL_TREE_H) $(srcdir)/../tree.h \
- $(srcdir)/../flags.h lex.h $(srcdir)/../system.h $(srcdir)/../toplev.h
-timing.o : timing.c $(CONFIG_H) $(CHILL_TREE_H) $(RTL_H) $(srcdir)/../flags.h \
- $(srcdir)/../input.h lex.h $(srcdir)/../system.h $(srcdir)/../toplev.h
-
-tasking.o : tasking.c $(CONFIG_H) $(CHILL_TREE_H) $(RTL_H) \
- $(srcdir)/../flags.h $(srcdir)/../input.h \
- lex.h $(srcdir)/../system.h $(srcdir)/../toplev.h
-tree.o : tree.c $(CONFIG_H) $(CHILL_TREE_H) $(srcdir)/../system.h \
- $(srcdir)/../toplev.h
-typeck.o : typeck.c $(CONFIG_H) $(CHILL_TREE_H) ../insn-codes.h \
- $(srcdir)/../expr.h ../insn-codes.h $(srcdir)/../flags.h lex.h \
- $(srcdir)/../system.h $(srcdir)/../toplev.h $(srcdir)/../output.h
-ch-version.o : ch-version.c
-ch-version.c : Makefile
- echo 'const char * const gnuchill_version = "$(GNUCHILL_VERSION)";' > $@
-
-## This is ugly, but I don't want GNU make to put these variables in
-## the environment. Older makes will see this as a set of targets
-## with no dependencies and no actions.
-unexport CHILLFLAGS CHILL_LIB CHILL_FOR_TARGET :
-
-#
-# These exist for maintenance purposes.
-
-# Update the tags table.
-TAGS: force
- cd $(srcdir); \
- etags *.y *.h *.c *.l ../*.h ../*.c; \
-
-.PHONY: TAGS
-
-force:
diff --git a/gcc/ch/README b/gcc/ch/README
deleted file mode 100644
index ef835446604..00000000000
--- a/gcc/ch/README
+++ /dev/null
@@ -1,43 +0,0 @@
-This directory contains the GNU front-end for the Chill language,
-contributed by Cygnus Solutions.
-
-Chill is the "CCITT High-Level Language", where CCITT is the old
-name for what is now ITU, the International Telecommunications Union.
-It is is language in the Modula2 family, and targets many of the
-same applications as Ada (especially large embedded systems).
-Chill was never used much in the United States, but is still
-being used in Europe, Brazil, Korea, and other places.
-
-Chill has been standardized by a series of reports/standards.
-The GNU implementation mostly follows the 1988 version of
-the language, with some backwards compatibility options for
-the 1984 version, and some other extensions. However, it
-does not implement all of the features of any standard.
-The most recent standard is Z.200 (11/93), available from
-http://www.itu.int/itudoc/itu-t/rec/z.html.
-
-The GNU Chill implementation is not being actively developed.
-Cygnus has one customer we are maintaining Chill for,
-but we are not planning on putting major work into Chill.
-This Net release is for educational purposes (as an example
-of a different Gcc front-end), and for those who find it useful.
-It is an unsupported hacker release. Bug reports without
-patches are likely to get ignored. Questions may get answered or
-ignored depending on our mood! If you want to try your luck,
-you can send a note to David Brolley <brolley@cygnus.com> or
-Per Bothner <bothner@cygnus.com>.
-
-One known problem is that we only support native builds of GNU Chill.
-If you need a cross-compiler, you will find various problems,
-including the directory structure, and the setjmp-based exception
-handling mechanism.
-
-The Chill run-time system is in the runtime sub-directory.
-Notice rts.c contains a poor main's implementation of Chill
-"processes" (threads). It is not added to libchill.a.
-We only use it for testing. (Our customer uses a different
-implementation for production work.)
-
-The GNU Chill implementation was primarily written by
-Per Bothner, along with Bill Cox, Wilfried Moser, Michael
-Tiemann, and David Brolley.
diff --git a/gcc/ch/actions.c b/gcc/ch/actions.c
deleted file mode 100644
index 09c8a5a23f7..00000000000
--- a/gcc/ch/actions.c
+++ /dev/null
@@ -1,1836 +0,0 @@
-/* Implement actions for CHILL.
- Copyright (C) 1992, 1993, 1994, 1998, 1999, 2000
- Free Software Foundation, Inc.
- Authors: Per Bothner, Bill Cox, Michael Tiemann, Michael North
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-#include "config.h"
-#include "system.h"
-#include "tree.h"
-#include "rtl.h"
-#include "expr.h"
-#include "ch-tree.h"
-#include "lex.h"
-#include "flags.h"
-#include "actions.h"
-#include "obstack.h"
-#include "assert.h"
-#include "toplev.h"
-
-static int id_cmp PARAMS ((tree *, tree *));
-static void warn_unhandled PARAMS ((const char *));
-static tree adjust_return_value PARAMS ((tree, const char *));
-static tree update_else_range_for_int_const PARAMS ((tree, tree));
-static tree update_else_range_for_range PARAMS ((tree, tree, tree));
-static tree update_else_range_for_range_expr PARAMS ((tree, tree));
-static tree update_else_range_for_type PARAMS ((tree, tree));
-static tree compute_else_range PARAMS ((tree, tree, int));
-static tree check_case_value PARAMS ((tree, tree));
-static void chill_handle_case_label_range PARAMS ((tree, tree, tree));
-static tree chill_handle_multi_case_label_range PARAMS ((tree, tree, tree));
-static tree chill_handle_multi_case_else_label PARAMS ((tree));
-static tree chill_handle_multi_case_label PARAMS ((tree, tree));
-static tree chill_handle_multi_case_label_list PARAMS ((tree, tree));
-static void print_missing_cases PARAMS ((tree, const unsigned char *, long));
-
-#define obstack_chunk_alloc xmalloc
-#define obstack_chunk_free free
-
-/* reserved tag definitions */
-
-#define TYPE_ID "id"
-#define TAG_OBJECT "chill_object"
-#define TAG_CLASS "chill_class"
-
-extern int flag_short_enums;
-extern int current_nesting_level;
-
-extern struct obstack *expression_obstack, permanent_obstack;
-extern struct obstack *current_obstack, *saveable_obstack;
-
-/* This flag is checked throughout the non-CHILL-specific
- in the front end. */
-tree chill_integer_type_node;
-tree chill_unsigned_type_node;
-
-/* Never used. Referenced from c-typeck.c, which we use. */
-int current_function_returns_value = 0;
-int current_function_returns_null = 0;
-
-/* data imported from toplev.c */
-
-extern char *dump_base_name;
-
-/* set from command line parameter, to exit after
- grant file written, generating no code. */
-int grant_only_flag = 0;
-
-const char *
-lang_identify ()
-{
- return "chill";
-}
-
-
-void
-init_chill ()
-{
-}
-
-void
-print_lang_statistics ()
-{
-}
-
-
-void
-lang_finish ()
-{
-#if 0
- extern int errorcount, sorrycount;
-
- /* this should be the last action in compiling a module.
- If there are other actions to be performed at lang_finish
- please insert before this */
-
- /* FIXME: in case of a syntax error, this leaves the grant file incomplete */
- /* for the moment we print a warning in case of errors and
- continue granting */
- if ((errorcount || sorrycount) && grant_count)
- {
- warning ("%d errors, %d sorries, do granting", errorcount, sorrycount);
- errorcount = sorrycount = 0;
- }
-#endif
-}
-
-void
-chill_check_decl (decl)
- tree decl;
-{
- tree type = TREE_TYPE (decl);
- static int alreadyWarned = 0;
-
- if (TREE_CODE (type) == RECORD_TYPE) /* && TREE_STATIC_TEMPLATE (type)) */
- {
- if (!alreadyWarned)
- {
- error ("GNU compiler does not support statically allocated objects");
- alreadyWarned = 1;
- }
- error_with_decl (decl, "`%s' cannot be statically allocated");
- }
-}
-
-/* Comparison function for sorting identifiers in RAISES lists.
- Note that because IDENTIFIER_NODEs are unique, we can sort
- them by address, saving an indirection. */
-static int
-id_cmp (p1, p2)
- tree *p1, *p2;
-{
- long diff = (long)TREE_VALUE (*p1) - (long)TREE_VALUE (*p2);
-
- return (diff < 0) ? -1 : (diff > 0);
-}
-
-/* Build the FUNCTION_TYPE or METHOD_TYPE which may raise exceptions
- listed in RAISES. */
-tree
-build_exception_variant (type, raises)
- tree type, raises;
-{
- int i;
- tree v = TYPE_MAIN_VARIANT (type);
- tree t, t2;
- int constp = TYPE_READONLY (type);
- int volatilep = TYPE_VOLATILE (type);
-
- if (!raises)
- return build_type_variant (v, constp, volatilep);
-
- if (TREE_CHAIN (raises))
- { /* Sort the list */
- tree *a = (tree *)alloca ((list_length (raises)+1) * sizeof (tree));
- for (i = 0, t = raises; t; t = TREE_CHAIN (t), i++)
- a[i] = t;
- /* NULL terminator for list. */
- a[i] = NULL_TREE;
- qsort (a, i, sizeof (tree),
- (int (*) PARAMS ((const void*, const void*))) id_cmp);
- while (i--)
- TREE_CHAIN (a[i]) = a[i+1];
- raises = a[0];
- }
-
- for (v = TYPE_NEXT_VARIANT (v); v; v = TYPE_NEXT_VARIANT (v))
- {
- if (TYPE_READONLY (v) != constp
- || TYPE_VOLATILE (v) != volatilep)
- continue;
-
- t = raises;
- t2 = TYPE_RAISES_EXCEPTIONS (v);
- while (t && t2)
- {
- if (TREE_TYPE (t) == TREE_TYPE (t2))
- {
- t = TREE_CHAIN (t);
- t2 = TREE_CHAIN (t2);
- }
- else break;
- }
- if (t || t2)
- continue;
- /* List of exceptions raised matches previously found list.
-
- @@ Nice to free up storage used in consing up the
- @@ list of exceptions raised. */
- return v;
- }
-
- /* Need to build a new variant. */
- if (TREE_PERMANENT (type))
- {
- push_obstacks_nochange ();
- end_temporary_allocation ();
- v = copy_node (type);
- pop_obstacks ();
- }
- else
- v = copy_node (type);
-
- TYPE_NEXT_VARIANT (v) = TYPE_NEXT_VARIANT (type);
- TYPE_NEXT_VARIANT (type) = v;
- if (raises && ! TREE_PERMANENT (raises))
- {
- push_obstacks_nochange ();
- end_temporary_allocation ();
- raises = copy_list (raises);
- pop_obstacks ();
- }
- TYPE_RAISES_EXCEPTIONS (v) = raises;
- return v;
-}
-#if 0
-
-tree
-build_rts_call (name, type, args)
- const char *name;
- tree type, args;
-{
- tree decl = lookup_name (get_identifier (name));
- tree converted_args = NULL_TREE;
- tree result, length = NULL_TREE;
-
- assert (decl != NULL_TREE);
- while (args)
- {
- tree arg = TREE_VALUE (args);
- if (TREE_CODE (TREE_TYPE (arg)) == SET_TYPE
- || TREE_CODE (TREE_TYPE (arg)) == ARRAY_TYPE)
- {
- length = size_in_bytes (TREE_TYPE (arg));
- arg = build_chill_addr_expr (arg, (char *)0);
- }
- converted_args = tree_cons (NULL_TREE, arg, converted_args);
- args = TREE_CHAIN (args);
- }
- if (length != NULL_TREE)
- converted_args = tree_cons (NULL_TREE, length, converted_args);
- converted_args = nreverse (converted_args);
- result = build_chill_function_call (decl, converted_args);
- if (TREE_CODE (type) == SET_TYPE || TREE_CODE (type) == ARRAY_TYPE)
- result = build1 (INDIRECT_REF, type, result);
- else
- result = convert (type, result);
- return result;
-}
-#endif
-
-/*
- * queue name of unhandled exception
- * to avoid multiple unhandled warnings
- * in one compilation module
- */
-
-struct already_type
-{
- struct already_type *next;
- char *name;
-};
-
-static struct already_type *already_warned = 0;
-
-static void
-warn_unhandled (ex)
- const char *ex;
-{
- struct already_type *p = already_warned;
-
- while (p)
- {
- if (!strcmp (p->name, ex))
- return;
- p = p->next;
- }
-
- /* not yet warned */
- p = (struct already_type *)xmalloc (sizeof (struct already_type));
- p->next = already_warned;
- p->name = xstrdup (ex);
- already_warned = p;
- pedwarn ("causing unhandled exception `%s' (this is flaged only once)", ex);
-}
-
-/*
- * build a call to the following function:
- * void __cause_ex1 (char* ex, const char *file,
- * const unsigned lineno);
- * if the exception is handled or
- * void __unhandled_ex (char *ex, char *file, unsigned lineno)
- * if the exception is not handled.
- */
-tree
-build_cause_exception (exp_name, warn_if_unhandled)
- tree exp_name;
- int warn_if_unhandled;
-{
- /* We don't use build_rts_call() here, because the string (array of char)
- would be followed by its length in the parameter list built by
- build_rts_call, and the runtime routine doesn't want a length parameter.*/
- tree exp_decl = build_chill_exception_decl (IDENTIFIER_POINTER (exp_name));
- tree function, fname, lineno, result;
- int handled = is_handled (exp_name);
-
- switch (handled)
- {
- case 0:
- /* no handler */
- if (warn_if_unhandled)
- warn_unhandled (IDENTIFIER_POINTER (exp_name));
- function = lookup_name (get_identifier ("__unhandled_ex"));
- fname = force_addr_of (get_chill_filename ());
- lineno = get_chill_linenumber ();
- break;
- case 1:
- /* local handler */
- function = lookup_name (get_identifier ("__cause_ex1"));
- fname = force_addr_of (get_chill_filename ());
- lineno = get_chill_linenumber ();
- break;
- case 2:
- /* function may propagate this exception */
- function = lookup_name (get_identifier ("__cause_ex1"));
- fname = lookup_name (get_identifier (CALLER_FILE));
- if (fname == NULL_TREE)
- fname = error_mark_node;
- lineno = lookup_name (get_identifier (CALLER_LINE));
- if (lineno == NULL_TREE)
- lineno = error_mark_node;
- break;
- default:
- abort();
- }
- result =
- build_chill_function_call (function,
- tree_cons (NULL_TREE, build_chill_addr_expr (exp_decl, (char *)0),
- tree_cons (NULL_TREE, fname,
- tree_cons (NULL_TREE, lineno, NULL_TREE))));
- return result;
-}
-
-void
-expand_cause_exception (exp_name)
- tree exp_name;
-{
- expand_expr_stmt (build_cause_exception (exp_name, 1));
-}
-
-/* If CONDITION is true, raise EXCEPTION (an IDENTIFIER_NODE);
- otherwise return EXPR. */
-
-tree
-check_expression (expr, condition, exception)
- tree expr, condition, exception;
-{
- if (integer_zerop (condition))
- return expr;
- else
- return build (COMPOUND_EXPR, TREE_TYPE (expr),
- fold (build (TRUTH_ANDIF_EXPR, boolean_type_node,
- condition, build_cause_exception (exception, 0))),
- expr);
-}
-
-/* Return an expression for VALUE < LO_LIMIT || VALUE > HI_LIMIT,
- somewhat optimized and with some warnings suppressed.
- If LO_LIMIT or HI_LIMIT is NULL_TREE, assume that (sub-)test passes. */
-
-tree
-test_range (value, lo_limit, hi_limit)
- tree value, lo_limit, hi_limit;
-{
- if (lo_limit || hi_limit)
- {
- int old_inhibit_warnings = inhibit_warnings;
- tree lo_check, hi_check, check;
-
- /* This is a hack so that `shorten_compare' doesn't warn the
- user about useless range checks that are too much work to
- optimize away here. */
- inhibit_warnings = 1;
-
- lo_check = lo_limit ?
- fold (build_compare_discrete_expr (LT_EXPR, value, lo_limit)) :
- boolean_false_node; /* fake passing the check */
-
- hi_check = hi_limit ?
- fold (build_compare_discrete_expr (GT_EXPR, value, hi_limit)) :
- boolean_false_node; /* fake passing the check */
-
- if (lo_check == boolean_false_node)
- check = hi_check;
- else if (hi_check == boolean_false_node)
- check = lo_check;
- else
- check = fold (build (TRUTH_ORIF_EXPR, boolean_type_node,
- lo_check, hi_check));
-
- inhibit_warnings = old_inhibit_warnings;
- return check;
- }
- else
- return boolean_false_node;
-}
-
-/* Return EXPR, except if range_checking is on, return an expression
- that also checks that value >= low_limit && value <= hi_limit.
- If LO_LIMIT or HI_LIMIT is NULL_TREE, assume that test passes. */
-
-tree
-check_range (expr, value, lo_limit, hi_limit)
- tree expr, value, lo_limit, hi_limit;
-{
- tree check = test_range (value, lo_limit, hi_limit);
- if (!integer_zerop (check))
- {
- if (current_function_decl == NULL_TREE)
- {
- if (TREE_CODE (check) == INTEGER_CST)
- error ("range failure (not inside function)");
- else
- warning ("possible range failure (not inside function)");
- }
- else
- {
- if (TREE_CODE (check) == INTEGER_CST)
- warning ("expression will always cause RANGEFAIL");
- if (range_checking)
- expr = check_expression (expr, check,
- ridpointers[(int) RID_RANGEFAIL]);
- }
- }
- return expr;
-}
-
-/* Same as EXPR, except raise EMPTY if EXPR is NULL. */
-
-tree
-check_non_null (expr)
- tree expr;
-{
- if (empty_checking)
- {
- expr = save_if_needed (expr);
- return check_expression (expr,
- build_compare_expr (EQ_EXPR,
- expr, null_pointer_node),
- ridpointers[(int) RID_EMPTY]);
- }
- return expr;
-}
-
-/* There are four conditions to generate a runtime check:
- 1) assigning a longer INT to a shorter (signs irrelevant)
- 2) assigning a signed to an unsigned
- 3) assigning an unsigned to a signed of the same size.
- 4) TYPE is a discrete subrange */
-
-tree
-chill_convert_for_assignment (type, expr, place)
- tree type, expr;
- const char *place; /* location description for error messages */
-{
- tree ttype = type;
- tree etype = TREE_TYPE (expr);
- tree result;
-
- if (type == NULL_TREE || TREE_CODE (type) == ERROR_MARK)
- return error_mark_node;
- if (expr == NULL_TREE || TREE_CODE (expr) == ERROR_MARK)
- return expr;
- if (TREE_CODE (expr) == TYPE_DECL)
- {
- error ("right hand side of assignment is a mode");
- return error_mark_node;
- }
-
- if (! CH_COMPATIBLE (expr, type))
- {
- error ("incompatible modes in %s", place);
- return error_mark_node;
- }
-
- if (TREE_CODE (type) == REFERENCE_TYPE)
- ttype = TREE_TYPE (ttype);
- if (etype && TREE_CODE (etype) == REFERENCE_TYPE)
- etype = TREE_TYPE (etype);
-
- if (etype
- && (CH_STRING_TYPE_P (ttype)
- || (chill_varying_type_p (ttype)
- && CH_STRING_TYPE_P (CH_VARYING_ARRAY_TYPE (ttype))))
- && (CH_STRING_TYPE_P (etype)
- || (chill_varying_type_p (etype)
- && CH_STRING_TYPE_P (CH_VARYING_ARRAY_TYPE (etype)))))
- {
- tree cond;
- if (range_checking)
- expr = save_if_needed (expr);
- cond = string_assignment_condition (ttype, expr);
- if (TREE_CODE (cond) == INTEGER_CST)
- {
- if (integer_zerop (cond))
- {
- error ("bad string length in %s", place);
- return error_mark_node;
- }
- /* Otherwise, the condition is always true, so no runtime test. */
- }
- else if (range_checking)
- expr = check_expression (expr,
- invert_truthvalue (cond),
- ridpointers[(int) RID_RANGEFAIL]);
- }
-
- if (range_checking
- && discrete_type_p (ttype)
- && etype != NULL_TREE
- && discrete_type_p (etype))
- {
- int cond1 = tree_int_cst_lt (TYPE_SIZE (ttype),
- TYPE_SIZE (etype));
- int cond2 = TREE_UNSIGNED (ttype)
- && (! TREE_UNSIGNED (etype));
- int cond3 = (! TREE_UNSIGNED (type))
- && TREE_UNSIGNED (etype)
- && tree_int_cst_equal (TYPE_SIZE (ttype),
- TYPE_SIZE (etype));
- int cond4 = TREE_TYPE (ttype)
- && discrete_type_p (TREE_TYPE (ttype));
-
- if (cond1 || cond2 || cond3 || cond4)
- {
- tree type_min = TYPE_MIN_VALUE (ttype);
- tree type_max = TYPE_MAX_VALUE (ttype);
-
- expr = save_if_needed (expr);
- if (expr && type_min && type_max)
- expr = check_range (expr, expr, type_min, type_max);
- }
- }
- result = convert (type, expr);
-
- /* If the type is a array of PACK bits and the expression is an array
- constructor, then build a CONSTRUCTOR for a bitstring. Bitstrings are
- zero based, so decrement the value of each CONSTRUCTOR element by the
- amount of the lower bound of the array. */
- if (TREE_CODE (type) == ARRAY_TYPE && TYPE_PACKED (type)
- && TREE_CODE (result) == CONSTRUCTOR)
- {
- tree domain_min = TYPE_MIN_VALUE (TYPE_DOMAIN (type));
- tree new_list = NULL_TREE;
- unsigned HOST_WIDE_INT index;
- tree element;
-
- for (element = TREE_OPERAND (result, 1);
- element != NULL_TREE;
- element = TREE_CHAIN (element))
- {
- if (!tree_int_cst_equal (TREE_VALUE (element), integer_zero_node))
- {
- tree purpose = TREE_PURPOSE (element);
- switch (TREE_CODE (purpose))
- {
- case INTEGER_CST:
- new_list
- = tree_cons (NULL_TREE,
- fold (build (MINUS_EXPR, TREE_TYPE (purpose),
- purpose, domain_min)),
- new_list);
- break;
- case RANGE_EXPR:
- for (index = TREE_INT_CST_LOW (TREE_OPERAND (purpose, 0));
- index <= TREE_INT_CST_LOW (TREE_OPERAND (purpose, 1));
- index++)
- new_list = tree_cons (NULL_TREE,
- fold (build (MINUS_EXPR,
- integer_type_node,
- build_int_2 (index, 0),
- domain_min)),
- new_list);
- break;
- default:
- abort ();
- }
- }
- }
- result = copy_node (result);
- TREE_OPERAND (result, 1) = nreverse (new_list);
- TREE_TYPE (result) = build_bitstring_type (TYPE_SIZE (type));
- }
-
- return result;
-}
-
-/* Check that EXPR has valid type for a RETURN or RESULT expression,
- converting to the right type. ACTION is "RESULT" or "RETURN". */
-
-static tree
-adjust_return_value (expr, action)
- tree expr;
- const char *action;
-{
- tree type = TREE_TYPE (TREE_TYPE (current_function_decl));
-
- if (TREE_CODE (type) == REFERENCE_TYPE)
- {
- if (CH_LOCATION_P (expr))
- {
- if (! CH_READ_COMPATIBLE (TREE_TYPE (type),
- TREE_TYPE (expr)))
- {
- error ("mode mismatch in %s expression", action);
- return error_mark_node;
- }
- return convert (type, expr);
- }
- else
- {
- error ("%s expression must be referable", action);
- return error_mark_node;
- }
- }
- else if (! CH_COMPATIBLE (expr, type))
- {
- error ("mode mismatch in %s expression", action);
- return error_mark_node;
- }
- return convert (type, expr);
-}
-
-void
-chill_expand_result (expr, result_or_return)
- tree expr;
- int result_or_return;
-{
- tree type;
- const char *action_name = result_or_return ? "RESULT" : "RETURN";
-
- if (pass == 1)
- return;
-
- if (expr == NULL_TREE || TREE_CODE (expr) == ERROR_MARK)
- return;
-
- CH_FUNCTION_SETS_RESULT (current_function_decl) = 1;
-
- if (chill_at_module_level || global_bindings_p ())
- error ("%s not allowed outside a PROC", action_name);
-
- result_never_set = 0;
-
- if (chill_result_decl == NULL_TREE)
- {
- error ("%s action in PROC with no declared RESULTS", action_name);
- return;
- }
- type = TREE_TYPE (chill_result_decl);
-
- if (TREE_CODE (type) == ERROR_MARK)
- return;
-
- expr = adjust_return_value (expr, action_name);
-
- expand_expr_stmt (build_chill_modify_expr (chill_result_decl, expr));
-}
-
-/*
- * error if EXPR not NULL and procedure doesn't
- * have a return type;
- * warning if EXPR NULL,
- * procedure *has* a return type, and a previous
- * RESULT actions hasn't saved a return value.
- */
-void
-chill_expand_return (expr, implicit)
- tree expr;
- int implicit; /* 1 if an implicit return at end of function. */
-{
- tree valtype;
-
- if (expr != NULL_TREE && TREE_CODE (expr) == ERROR_MARK)
- return;
- if (chill_at_module_level || global_bindings_p ())
- {
- error ("RETURN not allowed outside PROC");
- return;
- }
-
- if (pass == 1)
- return;
-
- result_never_set = 0;
-
- valtype = TREE_TYPE (TREE_TYPE (current_function_decl));
- if (TREE_CODE (valtype) == VOID_TYPE)
- {
- if (expr != NULL_TREE)
- error ("RETURN with a value, in PROC returning void");
- expand_null_return ();
- }
- else if (TREE_CODE (valtype) != ERROR_MARK)
- {
- if (expr == NULL_TREE)
- {
- if (!CH_FUNCTION_SETS_RESULT (current_function_decl)
- && !implicit)
- warning ("RETURN with no value and no RESULT action in procedure");
- expr = chill_result_decl;
- }
- else
- expr = adjust_return_value (expr, "RETURN");
- expr = build (MODIFY_EXPR, valtype,
- DECL_RESULT (current_function_decl),
- expr);
- TREE_SIDE_EFFECTS (expr) = 1;
- expand_return (expr);
- }
-}
-
-void
-lookup_and_expand_goto (name)
- tree name;
-{
- if (name == NULL_TREE || TREE_CODE (name) == ERROR_MARK)
- return;
- if (!ignoring)
- {
- tree decl = lookup_name (name);
- if (decl == NULL || TREE_CODE (decl) != LABEL_DECL)
- error ("no label named `%s'", IDENTIFIER_POINTER (name));
- else if (DECL_CONTEXT (decl) != current_function_decl)
- error ("cannot GOTO label `%s' outside current function",
- IDENTIFIER_POINTER (name));
- else
- {
- TREE_USED (decl) = 1;
- expand_goto_except_cleanup (DECL_ACTION_NESTING_LEVEL (decl));
- expand_goto (decl);
- }
- }
-}
-
-void
-lookup_and_handle_exit (name)
- tree name;
-{
- if (name == NULL_TREE || TREE_CODE (name) == ERROR_MARK)
- return;
- if (!ignoring)
- {
- tree label = munge_exit_label (name);
- tree decl = lookup_name (label);
- if (decl == NULL || TREE_CODE (decl) != LABEL_DECL)
- error ("no EXITable label named `%s'", IDENTIFIER_POINTER (name));
- else if (DECL_CONTEXT (decl) != current_function_decl)
- error ("cannot EXIT label `%s' outside current function",
- IDENTIFIER_POINTER (name));
- else
- {
- TREE_USED (decl) = 1;
- expand_goto_except_cleanup (DECL_ACTION_NESTING_LEVEL (decl));
- expand_goto (decl);
- }
- }
-}
-
-/* ELSE-range handling: The else-range is a chain of trees which collectively
- represent the ranges to be tested for the (ELSE) case label. Each element in
- the chain represents a range to be tested. The boundaries of the range are
- represented by INTEGER_CST trees in the PURPOSE and VALUE fields. */
-
-/* This function updates the else-range by removing the given integer constant. */
-static tree
-update_else_range_for_int_const (else_range, label)
- tree else_range, label;
-{
- int lowval = 0, highval = 0;
- int label_value = TREE_INT_CST_LOW (label);
- tree this_range, prev_range, new_range;
-
- /* First, find the range element containing the integer, if it exists. */
- prev_range = NULL_TREE;
- for (this_range = else_range ;
- this_range != NULL_TREE;
- this_range = TREE_CHAIN (this_range))
- {
- lowval = TREE_INT_CST_LOW (TREE_PURPOSE (this_range));
- highval = TREE_INT_CST_LOW (TREE_VALUE (this_range));
- if (label_value >= lowval && label_value <= highval)
- break;
- prev_range = this_range;
- }
-
- /* If a range element containing the integer was found, then update the range. */
- if (this_range != NULL_TREE)
- {
- tree next = TREE_CHAIN (this_range);
- if (label_value == lowval)
- {
- /* The integer is the lower bound of the range element. If it is also the
- upper bound, then remove this range element, otherwise update it. */
- if (label_value == highval)
- {
- if (prev_range == NULL_TREE)
- else_range = next;
- else
- TREE_CHAIN (prev_range) = next;
- }
- else
- TREE_PURPOSE (this_range) = build_int_2 (label_value + 1, 0);
- }
- else if (label_value == highval)
- {
- /* The integer is the upper bound of the range element, so ajust it. */
- TREE_VALUE (this_range) = build_int_2 (label_value - 1, 0);
- }
- else
- {
- /* The integer is in the middle of the range element, so split it. */
- new_range = tree_cons (
- build_int_2 (label_value + 1, 0), TREE_VALUE (this_range), next);
- TREE_VALUE (this_range) = build_int_2 (label_value - 1, 0);
- TREE_CHAIN (this_range) = new_range;
- }
- }
- return else_range;
-}
-
-/* Update the else-range to remove a range of values/ */
-static tree
-update_else_range_for_range (else_range, low_target, high_target)
- tree else_range, low_target, high_target;
-{
- tree this_range, prev_range, new_range, next_range;
- int low_range_val = 0, high_range_val = 0;
- int low_target_val = TREE_INT_CST_LOW (low_target);
- int high_target_val = TREE_INT_CST_LOW (high_target);
-
- /* find the first else-range element which overlaps the target range. */
- prev_range = NULL_TREE;
- for (this_range = else_range ;
- this_range != NULL_TREE;
- this_range = TREE_CHAIN (this_range))
- {
- low_range_val = TREE_INT_CST_LOW (TREE_PURPOSE (this_range));
- high_range_val = TREE_INT_CST_LOW (TREE_VALUE (this_range));
- if ((low_target_val >= low_range_val && low_target_val <= high_range_val)
- || (high_target_val >= low_range_val && high_target_val <= high_range_val))
- break;
- prev_range = this_range;
- }
- if (this_range == NULL_TREE)
- return else_range;
-
- /* This first else-range element might be truncated at the top or completely
- contain the target range. */
- if (low_range_val < low_target_val)
- {
- next_range = TREE_CHAIN (this_range);
- if (high_range_val > high_target_val)
- {
- new_range = tree_cons (
- build_int_2 (high_target_val + 1, 0), TREE_VALUE (this_range), next_range);
- TREE_VALUE (this_range) = build_int_2 (low_target_val - 1, 0);
- TREE_CHAIN (this_range) = new_range;
- return else_range;
- }
-
- TREE_VALUE (this_range) = build_int_2 (low_target_val - 1, 0);
- if (next_range == NULL_TREE)
- return else_range;
-
- prev_range = this_range;
- this_range = next_range;
- high_range_val = TREE_INT_CST_LOW (TREE_VALUE (this_range));
- }
-
- /* There may then follow zero or more else-range elements which are completely
- contained in the target range. */
- while (high_range_val <= high_target_val)
- {
- this_range = TREE_CHAIN (this_range);
- if (prev_range == NULL_TREE)
- else_range = this_range;
- else
- TREE_CHAIN (prev_range) = this_range;
-
- if (this_range == NULL_TREE)
- return else_range;
- high_range_val = TREE_INT_CST_LOW (TREE_VALUE (this_range));
- }
-
- /* Finally, there may be a else-range element which is truncated at the bottom. */
- low_range_val = TREE_INT_CST_LOW (TREE_PURPOSE (this_range));
- if (low_range_val <= high_target_val)
- TREE_PURPOSE (this_range) = build_int_2 (high_target_val + 1, 0);
-
- return else_range;
-}
-
-static tree
-update_else_range_for_range_expr (else_range, label)
- tree else_range, label;
-{
- if (TREE_OPERAND (label, 0) == NULL_TREE)
- {
- if (TREE_OPERAND (label, 1) == NULL_TREE)
- else_range = NULL_TREE; /* (*) -- matches everything */
- }
- else
- else_range = update_else_range_for_range (
- else_range, TREE_OPERAND (label, 0), TREE_OPERAND (label, 1));
-
- return else_range;
-}
-
-static tree
-update_else_range_for_type (else_range, label)
- tree else_range, label;
-{
- tree type = TREE_TYPE (label);
- else_range = update_else_range_for_range (
- else_range, TYPE_MIN_VALUE (type), TYPE_MAX_VALUE (type));
- return else_range;
-}
-
-static tree
-compute_else_range (selector, alternatives, selector_no)
- tree selector, alternatives;
- int selector_no;
-{
- /* Start with an else-range that spans the entire range of the selector type. */
- tree type = TREE_TYPE (TREE_VALUE (selector));
- tree range = tree_cons (TYPE_MIN_VALUE (type), TYPE_MAX_VALUE (type), NULL_TREE);
-
- /* Now remove the values represented by each case lebel specified for that
- selector. The remaining range is the else-range. */
- for ( ; alternatives != NULL_TREE; alternatives = TREE_CHAIN (alternatives))
- {
- tree label;
- tree label_list = TREE_PURPOSE (alternatives);
- int this_selector;
- for (this_selector = 0; this_selector < selector_no ; ++this_selector)
- label_list = TREE_CHAIN (label_list);
-
- for (label = TREE_VALUE (label_list);
- label != NULL_TREE;
- label = TREE_CHAIN (label))
- {
- tree label_value = TREE_VALUE (label);
- if (TREE_CODE (label_value) == INTEGER_CST)
- range = update_else_range_for_int_const (range, label_value);
- else if (TREE_CODE (label_value) == RANGE_EXPR)
- range = update_else_range_for_range_expr (range, label_value);
- else if (TREE_CODE (label_value) == TYPE_DECL)
- range = update_else_range_for_type (range, label_value);
-
- if (range == NULL_TREE)
- break;
- }
- }
-
- return range;
-}
-
-void
-compute_else_ranges (selectors, alternatives)
- tree selectors, alternatives;
-{
- tree selector;
- int selector_no = 0;
-
- for (selector = selectors; selector != NULL_TREE; selector = TREE_CHAIN (selector))
- {
- if (ELSE_LABEL_SPECIFIED (selector))
- TREE_PURPOSE (selector) =
- compute_else_range (selector, alternatives, selector_no);
- selector_no++;
- }
-}
-
-static tree
-check_case_value (label_value, selector)
- tree label_value, selector;
-{
- if (TREE_CODE (label_value) == ERROR_MARK)
- return label_value;
- if (TREE_CODE (selector) == ERROR_MARK)
- return selector;
-
- /* Z.200 (6.4 Case action) says: "The class of any discrete expression
- in the case selector list must be compatible with the corresponding
- (by position) class of the resulting list of classes of the case label
- list occurrences ...". We don't actually construct the resulting
- list of classes, but this test should be more-or-less equivalent.
- I think... */
- if (!CH_COMPATIBLE_CLASSES (selector, label_value))
- {
- error ("case selector not compatible with label");
- return error_mark_node;
- }
-
- /* Strip NON_LVALUE_EXPRs since we aren't using as an lvalue. */
- STRIP_TYPE_NOPS (label_value);
-
- if (TREE_CODE (label_value) != INTEGER_CST)
- {
- error ("case label does not reduce to an integer constant");
- return error_mark_node;
- }
-
- constant_expression_warning (label_value);
- return label_value;
-}
-
-void
-chill_handle_case_default ()
-{
- tree duplicate;
- register tree label = build_decl (LABEL_DECL, NULL_TREE,
- NULL_TREE);
- int success = pushcase (NULL_TREE, 0, label, &duplicate);
-
- if (success == 1)
- error ("ELSE label not within a CASE statement");
-#if 0
- else if (success == 2)
- {
- error ("multiple default labels found in a CASE statement");
- error_with_decl (duplicate, "this is the first ELSE label");
- }
-#endif
-}
-
-/* Handle cases label such as (I:J): or (modename): */
-
-static void
-chill_handle_case_label_range (min_value, max_value, selector)
- tree min_value, max_value, selector;
-{
- register tree label = build_decl (LABEL_DECL, NULL_TREE, NULL_TREE);
- min_value = check_case_value (min_value, selector);
- max_value = check_case_value (max_value, selector);
- if (TREE_CODE (min_value) != ERROR_MARK
- && TREE_CODE (max_value) != ERROR_MARK)
- {
- tree duplicate;
- int success = pushcase_range (min_value, max_value,
- convert, label, &duplicate);
- if (success == 1)
- error ("label found outside of CASE statement");
- else if (success == 2)
- {
- error ("duplicate CASE value");
- error_with_decl (duplicate, "this is the first entry for that value");
- }
- else if (success == 3)
- error ("CASE value out of range");
- else if (success == 4)
- error ("empty range");
- else if (success == 5)
- error ("label within scope of cleanup or variable array");
- }
-}
-
-void
-chill_handle_case_label (label_value, selector)
- tree label_value, selector;
-{
- if (label_value == NULL_TREE
- || TREE_CODE (label_value) == ERROR_MARK)
- return;
- if (TREE_CODE (label_value) == RANGE_EXPR)
- {
- if (TREE_OPERAND (label_value, 0) == NULL_TREE)
- chill_handle_case_default (); /* i.e. (ELSE): or (*): */
- else
- chill_handle_case_label_range (TREE_OPERAND (label_value, 0),
- TREE_OPERAND (label_value, 1),
- selector);
- }
- else if (TREE_CODE (label_value) == TYPE_DECL)
- {
- tree type = TREE_TYPE (label_value);
- if (! discrete_type_p (type))
- error ("mode in label is not discrete");
- else
- chill_handle_case_label_range (TYPE_MIN_VALUE (type),
- TYPE_MAX_VALUE (type),
- selector);
- }
- else
- {
- register tree label = build_decl (LABEL_DECL, NULL_TREE, NULL_TREE);
-
- label_value = check_case_value (label_value, selector);
-
- if (TREE_CODE (label_value) != ERROR_MARK)
- {
- tree duplicate;
- int success = pushcase (label_value, convert, label, &duplicate);
- if (success == 1)
- error ("label not within a CASE statement");
- else if (success == 2)
- {
- error ("duplicate case value");
- error_with_decl (duplicate,
- "this is the first entry for that value");
- }
- else if (success == 3)
- error ("CASE value out of range");
- else if (success == 4)
- error ("empty range");
- else if (success == 5)
- error ("label within scope of cleanup or variable array");
- }
- }
-}
-
-int
-chill_handle_single_dimension_case_label (
- selector, label_spec, expand_exit_needed, caseaction_flag
-)
- tree selector, label_spec;
- int *expand_exit_needed, *caseaction_flag;
-{
- tree labels, one_label;
- int no_completeness_check = 0;
-
- if (*expand_exit_needed || *caseaction_flag == 1)
- {
- expand_exit_something ();
- *expand_exit_needed = 0;
- }
-
- for (labels = label_spec; labels != NULL_TREE; labels = TREE_CHAIN (labels))
- for (one_label = TREE_VALUE (labels); one_label != NULL_TREE;
- one_label = TREE_CHAIN (one_label))
- {
- if (TREE_VALUE (one_label) == case_else_node)
- no_completeness_check = 1;
-
- chill_handle_case_label (TREE_VALUE (one_label), selector);
- }
-
- *caseaction_flag = 1;
-
- return no_completeness_check;
-}
-
-static tree
-chill_handle_multi_case_label_range (low, high, selector)
- tree low, high, selector;
-{
- tree low_expr, high_expr, and_expr;
- tree selector_type;
- int low_target_val, high_target_val;
- int low_type_val, high_type_val;
-
- /* we can eliminate some tests is the low and/or high value in the given range
- are outside the range of the selector type. */
- low_target_val = TREE_INT_CST_LOW (low);
- high_target_val = TREE_INT_CST_LOW (high);
- selector_type = TREE_TYPE (selector);
- low_type_val = TREE_INT_CST_LOW (TYPE_MIN_VALUE (selector_type));
- high_type_val = TREE_INT_CST_LOW (TYPE_MAX_VALUE (selector_type));
-
- if (low_target_val > high_type_val || high_target_val < low_type_val)
- return boolean_false_node; /* selector never in range */
-
- if (low_type_val >= low_target_val)
- {
- if (high_type_val <= high_target_val)
- return boolean_true_node; /* always in the range */
- return build_compare_expr (LE_EXPR, selector, high);
- }
-
- if (high_type_val <= high_target_val)
- return build_compare_expr (GE_EXPR, selector, low);
-
- /* The target range in completely within the range of the selector, but we
- might be able to save a test if the upper bound is the same as the lower
- bound. */
- if (low_target_val == high_target_val)
- return build_compare_expr (EQ_EXPR, selector, low);
-
- /* No optimizations possible. Just generate tests against the upper and lower
- bound of the target */
- low_expr = build_compare_expr (GE_EXPR, selector, low);
- high_expr = build_compare_expr (LE_EXPR, selector, high);
- and_expr = build_chill_binary_op (TRUTH_ANDIF_EXPR, low_expr, high_expr);
-
- return and_expr;
-}
-
-static tree
-chill_handle_multi_case_else_label (selector)
- tree selector;
-{
- tree else_range, selector_value, selector_type;
- tree low, high, larg;
-
- else_range = TREE_PURPOSE (selector);
- if (else_range == NULL_TREE)
- return boolean_false_node; /* no values in ELSE range */
-
- /* Test each of the ranges in the else-range chain */
- selector_value = TREE_VALUE (selector);
- selector_type = TREE_TYPE (selector_value);
- low = convert (selector_type, TREE_PURPOSE (else_range));
- high = convert (selector_type, TREE_VALUE (else_range));
- larg = chill_handle_multi_case_label_range (low, high, selector_value);
-
- for (else_range = TREE_CHAIN (else_range);
- else_range != NULL_TREE;
- else_range = TREE_CHAIN (else_range))
- {
- tree rarg;
- low = convert (selector_type, TREE_PURPOSE (else_range));
- high = convert (selector_type, TREE_VALUE (else_range));
- rarg = chill_handle_multi_case_label_range (low, high, selector_value);
- larg = build_chill_binary_op (TRUTH_ORIF_EXPR, larg, rarg);
- }
-
- return larg;
-}
-
-static tree
-chill_handle_multi_case_label (selector, label)
- tree selector, label;
-{
- tree expr = NULL_TREE;
-
- if (label == NULL_TREE || TREE_CODE (label) == ERROR_MARK)
- return NULL_TREE;
-
- if (TREE_CODE (label) == INTEGER_CST)
- {
- int target_val = TREE_INT_CST_LOW (label);
- tree selector_type = TREE_TYPE (TREE_VALUE (selector));
- int low_type_val = TREE_INT_CST_LOW (TYPE_MIN_VALUE (selector_type));
- int high_type_val = TREE_INT_CST_LOW (TYPE_MAX_VALUE (selector_type));
- if (target_val < low_type_val || target_val > high_type_val)
- expr = boolean_false_node;
- else
- expr = build_compare_expr (EQ_EXPR, TREE_VALUE (selector), label);
- }
- else if (TREE_CODE (label) == RANGE_EXPR)
- {
- if (TREE_OPERAND (label, 0) == NULL_TREE)
- {
- if (TREE_OPERAND (label, 1) == NULL_TREE)
- expr = boolean_true_node; /* (*) -- matches everything */
- else
- expr = chill_handle_multi_case_else_label (selector);
- }
- else
- {
- tree low = TREE_OPERAND (label, 0);
- tree high = TREE_OPERAND (label, 1);
- if (TREE_CODE (low) != INTEGER_CST)
- {
- error ("Lower bound of range must be a discrete literal expression");
- expr = error_mark_node;
- }
- if (TREE_CODE (high) != INTEGER_CST)
- {
- error ("Upper bound of range must be a discrete literal expression");
- expr = error_mark_node;
- }
- if (expr != error_mark_node)
- {
- expr = chill_handle_multi_case_label_range (
- low, high, TREE_VALUE (selector));
- }
- }
- }
- else if (TREE_CODE (label) == TYPE_DECL)
- {
- tree type = TREE_TYPE (label);
- if (! discrete_type_p (type))
- {
- error ("mode in label is not discrete");
- expr = error_mark_node;
- }
- else
- expr = chill_handle_multi_case_label_range (
- TYPE_MIN_VALUE (type), TYPE_MAX_VALUE (type), TREE_VALUE (selector));
- }
- else
- {
- error ("The CASE label is not valid");
- expr = error_mark_node;
- }
-
- return expr;
-}
-
-static tree
-chill_handle_multi_case_label_list (selector, labels)
- tree selector, labels;
-{
- tree one_label, larg, rarg;
-
- one_label = TREE_VALUE (labels);
- larg = chill_handle_multi_case_label (selector, TREE_VALUE (one_label));
-
- for (one_label = TREE_CHAIN (one_label);
- one_label != NULL_TREE;
- one_label = TREE_CHAIN (one_label))
- {
- rarg = chill_handle_multi_case_label (selector, TREE_VALUE (one_label));
- larg = build_chill_binary_op (TRUTH_ORIF_EXPR, larg, rarg);
- }
-
- return larg;
-}
-
-tree
-build_multi_case_selector_expression (selector_list, label_spec)
- tree selector_list, label_spec;
-{
- tree labels, selector, larg, rarg;
-
- labels = label_spec;
- selector = selector_list;
- larg = chill_handle_multi_case_label_list(selector, labels);
-
- for (labels = TREE_CHAIN (labels), selector = TREE_CHAIN (selector);
- labels != NULL_TREE && selector != NULL_TREE;
- labels = TREE_CHAIN (labels), selector = TREE_CHAIN (selector))
- {
- rarg = chill_handle_multi_case_label_list(selector, labels);
- larg = build_chill_binary_op (TRUTH_ANDIF_EXPR, larg, rarg);
- }
-
- if (labels != NULL_TREE || selector != NULL_TREE)
- error ("The number of CASE selectors does not match the number of CASE label lists");
-
- return larg;
-}
-
-#define BITARRAY_TEST(ARRAY, INDEX) \
- ((ARRAY)[(unsigned)(INDEX) / HOST_BITS_PER_CHAR]\
- & (1 << ((unsigned)(INDEX) % HOST_BITS_PER_CHAR)))
-#define BITARRAY_SET(ARRAY, INDEX) \
- ((ARRAY)[(unsigned)(INDEX) / HOST_BITS_PER_CHAR]\
- |= 1 << ((unsigned)(INDEX) % HOST_BITS_PER_CHAR))
-
-/* CASES_SEEN is a set (bitarray) of length COUNT.
- For each element that is zero, print an error message,
- assume the element have the given TYPE. */
-
-static void
-print_missing_cases (type, cases_seen, count)
- tree type;
- const unsigned char *cases_seen;
- long count;
-{
- long i;
- for (i = 0; i < count; i++)
- {
- if (BITARRAY_TEST(cases_seen, i) == 0)
- {
- char buf[20];
- long x = i;
- long j;
- tree t = type;
- const char *err_val_name = "???";
- if (TYPE_MIN_VALUE (t)
- && TREE_CODE (TYPE_MIN_VALUE (t)) == INTEGER_CST)
- x += TREE_INT_CST_LOW (TYPE_MIN_VALUE (t));
- while (TREE_TYPE (t) != NULL_TREE)
- t = TREE_TYPE (t);
- switch (TREE_CODE (t))
- {
- tree v;
- case BOOLEAN_TYPE:
- err_val_name = x ? "TRUE" : "FALSE";
- break;
- case CHAR_TYPE:
- {
- char *bufptr;
- if ((x >= ' ' && x < 127) && x != '\'' && x != '^')
- sprintf (buf, "'%c'", (char)x);
- else
- sprintf (buf, "'^(%ld)'", x);
- bufptr = buf;
- j = i;
- while (j < count && !BITARRAY_TEST(cases_seen, j))
- j++;
- if (j > i + 1)
- {
- long y = x+j-i-1;
- bufptr += strlen (bufptr);
- if ((y >= ' ' && y < 127) && y != '\'' && y != '^')
- sprintf (bufptr, "%s:'%c'", buf, (char)y);
- else
- sprintf (bufptr, "%s:'^(%ld)'", buf, y);
- i = j - 1;
- }
- err_val_name = bufptr;
- }
- break;
- case ENUMERAL_TYPE:
- for (v = TYPE_VALUES (t); v && x; v = TREE_CHAIN (v))
- x--;
- if (v)
- err_val_name = IDENTIFIER_POINTER (TREE_PURPOSE (v));
- break;
- default:
- j = i;
- while (j < count && !BITARRAY_TEST(cases_seen, j))
- j++;
- if (j == i + 1)
- sprintf (buf, "%ld", x);
- else
- sprintf (buf, "%ld:%ld", x, x+j-i-1);
- i = j - 1;
- err_val_name = buf;
- break;
- }
- error ("incomplete CASE - %s not handled", err_val_name);
- }
- }
-}
-
-void
-check_missing_cases (type)
- tree type;
-{
- int is_sparse;
- /* For each possible selector value. a one iff it has been matched
- by a case value alternative. */
- unsigned char *cases_seen;
- /* The number of possible selector values. */
- HOST_WIDE_INT size = all_cases_count (type, &is_sparse);
- HOST_WIDE_INT bytes_needed
- = (size + HOST_BITS_PER_CHAR) / HOST_BITS_PER_CHAR;
-
- if (size == -1)
- warning ("CASE selector with variable range");
- else if (size < 0 || size > 600000
- /* We deliberately use malloc here - not xmalloc. */
- || (cases_seen = (char*) malloc (bytes_needed)) == NULL)
- warning ("too many cases to do CASE completeness testing");
- else
- {
- memset (cases_seen, 0, bytes_needed);
- mark_seen_cases (type, cases_seen, size, is_sparse);
- print_missing_cases (type, cases_seen, size);
- free (cases_seen);
- }
-}
-
-/*
- * We build an expression tree here because, in many contexts,
- * we don't know the type of result that's desired. By the
- * time we get to expanding the tree, we do know.
- */
-tree
-build_chill_case_expr (exprlist, casealtlist_expr,
- optelsecase_expr)
- tree exprlist, casealtlist_expr, optelsecase_expr;
-{
- return build (CASE_EXPR, NULL_TREE, exprlist,
- optelsecase_expr ?
- tree_cons (NULL_TREE,
- optelsecase_expr,
- casealtlist_expr) :
- casealtlist_expr);
-}
-
-/* This function transforms the selector_list and alternatives into a COND_EXPR. */
-tree
-build_chill_multi_dimension_case_expr (selector_list, alternatives, else_expr)
- tree selector_list, alternatives, else_expr;
-{
- tree expr;
-
- selector_list = check_case_selector_list (selector_list);
-
- if (alternatives == NULL_TREE)
- return NULL_TREE;
-
- alternatives = nreverse (alternatives);
- /* alternatives represents the CASE label specifications and resulting values in
- the reverse order in which they appeared.
- If there is an ELSE expression, then use it. If there is no
- ELSE expression, make the last alternative (which is the first in the list)
- into the ELSE expression. This is safe because, if the CASE is complete
- (as required), then the last condition need not be checked anyway. */
- if (else_expr != NULL_TREE)
- expr = else_expr;
- else
- {
- expr = TREE_VALUE (alternatives);
- alternatives = TREE_CHAIN (alternatives);
- }
-
- for ( ; alternatives != NULL_TREE; alternatives = TREE_CHAIN (alternatives))
- {
- tree value = TREE_VALUE (alternatives);
- tree labels = TREE_PURPOSE (alternatives);
- tree cond = build_multi_case_selector_expression(selector_list, labels);
- expr = build_nt (COND_EXPR, cond, value, expr);
- }
-
- return expr;
-}
-
-
-/* This is called with the assumption that RHS has been stabilized.
- It has one purpose: to iterate through the CHILL list of LHS's */
-void
-expand_assignment_action (loclist, modifycode, rhs)
- tree loclist;
- enum chill_tree_code modifycode;
- tree rhs;
-{
- if (loclist == NULL_TREE || TREE_CODE (loclist) == ERROR_MARK
- || rhs == NULL_TREE || TREE_CODE (rhs) == ERROR_MARK)
- return;
-
- if (TREE_CHAIN (loclist) != NULL_TREE)
- { /* Multiple assignment */
- tree target;
- if (TREE_TYPE (rhs) != NULL_TREE)
- rhs = save_expr (rhs);
- else if (TREE_CODE (rhs) == CONSTRUCTOR)
- error ("type of tuple cannot be implicit in multiple assignent");
- else if (TREE_CODE (rhs) == CASE_EXPR || TREE_CODE (rhs) == COND_EXPR)
- error ("conditional expression cannot be used in multiple assignent");
- else
- error ("internal error - unknown type in multiple assignment");
-
- if (modifycode != NOP_EXPR)
- {
- error ("no operator allowed in multiple assignment,");
- modifycode = NOP_EXPR;
- }
-
- for (target = TREE_CHAIN (loclist); target; target = TREE_CHAIN (target))
- {
- if (!CH_EQUIVALENT (TREE_TYPE (TREE_VALUE (target)),
- TREE_TYPE (TREE_VALUE (loclist))))
- {
- error
- ("location modes in multiple assignment are not equivalent");
- break;
- }
- }
- }
- for ( ; loclist != NULL_TREE; loclist = TREE_CHAIN (loclist))
- chill_expand_assignment (TREE_VALUE (loclist), modifycode, rhs);
-}
-
-void
-chill_expand_assignment (lhs, modifycode, rhs)
- tree lhs;
- enum chill_tree_code modifycode;
- tree rhs;
-{
- tree loc;
-
- while (TREE_CODE (lhs) == COMPOUND_EXPR)
- {
- expand_expr (TREE_OPERAND (lhs, 0), const0_rtx, VOIDmode, 0);
- emit_queue ();
- lhs = TREE_OPERAND (lhs, 1);
- }
-
- if (TREE_CODE (lhs) == ERROR_MARK)
- return;
-
- /* errors for assignment to BUFFER, EVENT locations.
- what about SIGNALs? FIXME: Need similar test in
- build_chill_function_call. */
- if (TREE_CODE (lhs) == IDENTIFIER_NODE)
- {
- tree decl = lookup_name (lhs);
- if (decl)
- {
- tree type = TREE_TYPE (decl);
- if (CH_IS_BUFFER_MODE (type) || CH_IS_EVENT_MODE (type))
- {
- error ("You may not assign a value to a BUFFER or EVENT location");
- return;
- }
- }
- }
-
- if (TYPE_READONLY_PROPERTY (TREE_TYPE (lhs)) || TREE_READONLY (lhs))
- {
- error ("can't assign value to READonly location");
- return;
- }
- if (CH_TYPE_NONVALUE_P (TREE_TYPE (lhs)))
- {
- error ("cannot assign to location with non-value property");
- return;
- }
-
- if (TREE_CODE (TREE_TYPE (lhs)) == REFERENCE_TYPE)
- lhs = convert_from_reference (lhs);
-
- /* check for lhs is a location */
- loc = lhs;
- while (1)
- {
- if (TREE_CODE (loc) == SLICE_EXPR)
- loc = TREE_OPERAND (loc, 0);
- else if (TREE_CODE (loc) == SET_IN_EXPR)
- loc = TREE_OPERAND (loc, 1);
- else
- break;
- }
- if (! CH_LOCATION_P (loc))
- {
- error ("lefthand side of assignment is not a location");
- return;
- }
-
- /* If a binary op has been requested, combine the old LHS value with
- the RHS producing the value we should actually store into the LHS. */
-
- if (modifycode != NOP_EXPR)
- {
- lhs = stabilize_reference (lhs);
- /* This is to handle border-line cases such
- as: LHS OR := [I]. This seems to be permitted
- by the letter of Z.200, though it violates
- its spirit, since LHS:=LHS OR [I] is
- *not* legal. */
- if (TREE_TYPE (rhs) == NULL_TREE)
- rhs = convert (TREE_TYPE (lhs), rhs);
- rhs = build_chill_binary_op (modifycode, lhs, rhs);
- }
-
- rhs = chill_convert_for_assignment (TREE_TYPE (lhs), rhs, "assignment");
-
- /* handle the LENGTH (vary_array) := expr action */
- loc = lhs;
- if (TREE_CODE (loc) == NOP_EXPR)
- loc = TREE_OPERAND (loc, 0);
- if (TREE_CODE (loc) == COMPONENT_REF
- && chill_varying_type_p (TREE_TYPE (TREE_OPERAND (loc, 0)))
- && DECL_NAME (TREE_OPERAND (loc, 1)) == var_length_id)
- {
- expand_varying_length_assignment (TREE_OPERAND (loc, 0), rhs);
- }
- else if (TREE_CODE (lhs) == SLICE_EXPR)
- {
- tree func = lookup_name (get_identifier ("__pscpy"));
- tree dst = TREE_OPERAND (lhs, 0);
- tree dst_offset = TREE_OPERAND (lhs, 1);
- tree length = TREE_OPERAND (lhs, 2);
- tree src, src_offset;
- if (TREE_CODE (rhs) == SLICE_EXPR)
- {
- src = TREE_OPERAND (rhs, 0);
- /* Should check that the TREE_OPERAND (src, 0) is
- the same as length and powerserlen (src). FIXME */
- src_offset = TREE_OPERAND (rhs, 1);
- }
- else
- {
- src = rhs;
- src_offset = integer_zero_node;
- }
- expand_expr_stmt (build_chill_function_call (func,
- tree_cons (NULL_TREE, force_addr_of (dst),
- tree_cons (NULL_TREE, powersetlen (dst),
- tree_cons (NULL_TREE, convert (long_unsigned_type_node, dst_offset),
- tree_cons (NULL_TREE, force_addr_of (src),
- tree_cons (NULL_TREE, powersetlen (src),
- tree_cons (NULL_TREE, convert (long_unsigned_type_node, src_offset),
- tree_cons (NULL_TREE, convert (long_unsigned_type_node, length),
- NULL_TREE)))))))));
- }
-
- else if (TREE_CODE (lhs) == SET_IN_EXPR)
- {
- tree from_pos = save_expr (TREE_OPERAND (lhs, 0));
- tree set = TREE_OPERAND (lhs, 1);
- tree domain = TYPE_DOMAIN (TREE_TYPE (set));
- tree set_length
- = fold (build (PLUS_EXPR, integer_type_node,
- fold (build (MINUS_EXPR, integer_type_node,
- TYPE_MAX_VALUE (domain),
- TYPE_MIN_VALUE (domain))),
- integer_one_node));
- tree filename = force_addr_of (get_chill_filename());
-
- if (TREE_CODE (TREE_TYPE (lhs)) != BOOLEAN_TYPE)
- sorry("bitstring slice");
- expand_expr_stmt (
- build_chill_function_call (lookup_name (
- get_identifier ("__setbitpowerset")),
- tree_cons (NULL_TREE, build_chill_addr_expr (set, "powerset"),
- tree_cons (NULL_TREE, set_length,
- tree_cons (NULL_TREE, TYPE_MIN_VALUE (domain),
- tree_cons (NULL_TREE, convert (long_integer_type_node, from_pos),
- tree_cons (NULL_TREE, rhs,
- tree_cons (NULL_TREE, filename,
- tree_cons (NULL_TREE, get_chill_linenumber(),
- NULL_TREE)))))))));
- }
-
- /* Handle arrays of packed bitfields. Currently, this is limited to bitfields
- which are 1 bit wide, so use the powerset runtime function. */
- else if (TREE_CODE (lhs) == PACKED_ARRAY_REF)
- {
- tree from_pos = save_expr (TREE_OPERAND (lhs, 1));
- tree array = TREE_OPERAND (lhs, 0);
- tree domain = TYPE_DOMAIN (TREE_TYPE (array));
- tree array_length = powersetlen (array);
- tree filename = force_addr_of (get_chill_filename());
- expand_expr_stmt (
- build_chill_function_call (lookup_name (
- get_identifier ("__setbitpowerset")),
- tree_cons (NULL_TREE, build_chill_addr_expr (array, "packed bitfield array"),
- tree_cons (NULL_TREE, convert (long_unsigned_type_node, array_length),
- tree_cons (NULL_TREE, convert (long_integer_type_node,
- TYPE_MIN_VALUE (domain)),
- tree_cons (NULL_TREE, convert (long_integer_type_node, from_pos),
- tree_cons (NULL_TREE, build1 (CONVERT_EXPR, boolean_type_node, rhs),
- tree_cons (NULL_TREE, filename,
- tree_cons (NULL_TREE, get_chill_linenumber(),
- NULL_TREE)))))))));
- }
-
- /* The following is probably superceded by the
- above code for SET_IN_EXPR. FIXME! */
- else if (TREE_CODE (lhs) == BIT_FIELD_REF)
- {
- tree set = TREE_OPERAND (lhs, 0);
- tree numbits = TREE_OPERAND (lhs, 1);
- tree from_pos = save_expr (TREE_OPERAND (lhs, 2));
- tree domain = TYPE_DOMAIN (TREE_TYPE (set));
- tree set_length
- = fold (build (PLUS_EXPR, integer_type_node,
- fold (build (MINUS_EXPR, integer_type_node,
- TYPE_MAX_VALUE (domain),
- TYPE_MIN_VALUE (domain))),
- integer_one_node));
- tree filename = force_addr_of (get_chill_filename());
- tree to_pos;
-
- switch (TREE_CODE (TREE_TYPE (rhs)))
- {
- case SET_TYPE:
- to_pos = fold (build (MINUS_EXPR, integer_type_node,
- fold (build (PLUS_EXPR, integer_type_node,
- from_pos, numbits)),
- integer_one_node));
- break;
- case BOOLEAN_TYPE:
- to_pos = from_pos;
- break;
- default:
- abort ();
- }
-
- if (TREE_CODE (TREE_TYPE (lhs)) != BOOLEAN_TYPE)
- sorry("bitstring slice");
- expand_expr_stmt (
- build_chill_function_call( lookup_name (
- get_identifier ("__setbitpowerset")),
- tree_cons (NULL_TREE, build_chill_addr_expr (set, "powerset"),
- tree_cons (NULL_TREE, set_length,
- tree_cons (NULL_TREE, TYPE_MIN_VALUE (domain),
- tree_cons (NULL_TREE, from_pos,
- tree_cons (NULL_TREE, rhs,
- tree_cons (NULL_TREE, filename,
- tree_cons (NULL_TREE, get_chill_linenumber(),
- NULL_TREE)))))))));
- }
-
- else
- expand_expr_stmt (build_chill_modify_expr (lhs, rhs));
-}
-
-/* Also assumes that rhs has been stabilized */
-void
-expand_varying_length_assignment (lhs, rhs)
- tree lhs, rhs;
-{
- tree base_array, min_domain_val;
-
- pedwarn ("LENGTH on left-hand-side is non-portable");
-
- if (! CH_LOCATION_P (lhs))
- {
- error ("Can only set LENGTH of array location");
- return;
- }
-
- /* cause a RANGE exception if rhs would cause a 'hole' in the array. */
- rhs = valid_array_index_p (lhs, rhs, "new array length too large", 1);
-
- base_array = CH_VARYING_ARRAY_TYPE (TREE_TYPE (lhs));
- min_domain_val = TYPE_MIN_VALUE (TYPE_DOMAIN (base_array));
-
- lhs = build_component_ref (lhs, var_length_id);
- rhs = fold (build (MINUS_EXPR, TREE_TYPE (rhs), rhs, min_domain_val));
-
- expand_expr_stmt (build_chill_modify_expr (lhs, rhs));
-}
-
-void
-push_action ()
-{
- push_handler ();
- if (ignoring)
- return;
- emit_line_note (input_filename, lineno);
-}
diff --git a/gcc/ch/ch-tree.def b/gcc/ch/ch-tree.def
deleted file mode 100644
index a47e014744c..00000000000
--- a/gcc/ch/ch-tree.def
+++ /dev/null
@@ -1,114 +0,0 @@
-/* This file contains the definitions and documentation for the
- additional tree codes used in the CHILL front end (see tree.def
- for the standard codes).
- Copyright (C) 1992, 1993 Free Software Foundation, Inc.
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-
-/*
- * CHILL types.
- */
-DEFTREECODE (GRANT_TYPE, "grant_type", 't', 0)
-DEFTREECODE (SEIZE_TYPE, "seize_type", 't', 0)
-/*
- * CHILL decls.
- */
-DEFTREECODE (KEYWORD_DECL, "keyword_decl", 'd', 0)
-DEFTREECODE (INSTANCE_METHOD_DECL, "instance_method_decl", 'd', 0)
-DEFTREECODE (CLASS_METHOD_DECL, "class_method_decl", 'd', 0)
-
-/* A 'SEIZE (OLD->NEW)!POSTFIX' or 'GRANT (OLD->NEW)!POSTFIX' is
- represented as an ALIAS_DECL where DECL_OLD_PREFIX, DECL_NEW_PREFIX,
- and DECL_POSTFIX points to OLD, NEW, and POSTFIX, repectively.
- These are IDENTIFIER_NODEs, or NULL if empty.
- DECL_NAME is NEW!POSTFIX. After binding, DECL_ABSTRACT_ORIGIN
- (if not an error_mark) points to a decl whose DECL_NAME is OLD!POSTFIX.
- and which this name is linked to.
- For SEIZE, DECL_SEIZEFILE names the most recent use_seize_file directive.
- For GRANT, DECL_SEIZEFILE names the seizefile doing the granting. */
-DEFTREECODE (ALIAS_DECL, "alias_decl", 'd', 0)
-
-/* A variable, which is BASED on a pointer variable in DECL_ABSTRACT_ORIGIN. */
-DEFTREECODE (BASED_DECL, "based_decl", 'd', 0)
-
-/* A pseudo-variable declared by a DO WITH. */
-DEFTREECODE (WITH_DECL, "with_decl", 'd', 0)
-
-/*
- * CHILL exprs.
- */
-DEFTREECODE (CONCAT_EXPR, "concat_expr", '2', 2)
-
-/* A slice (sub-array or sub-string) of operand 0, where
- operand 1 is the start of the slice, and operand 2 is its length.
- Currently, only used for bitstring sclices. */
-DEFTREECODE (SLICE_EXPR, "slice_expr", 'e', 3)
-
-/* Later, SET_IN_EXPR might be replaced by BIT_FIELD_REF or IN_EXPR. */
-DEFTREECODE (SET_IN_EXPR, "set_in_expr", '2', 2)
-
-/* A CASE_EXPR EX implements Chill CASE expression.
- TREE_OPERAND (EX, 0) is a TREE_LIST representing the <case selector list>,
- with one node for each expression. (Only one is supported by the
- current implementation.)
- TREE_OPERAND (EX, 1) is also a TREE_LIST, with one node for each
- <value case alternative>. The TREE_VALUE of these node is the
- <sub expression> (case element body); the TREE_PURPOSE contains
- the <case label specification>. (The TREE_PURPOSE for the
- optional ELSE (default) branch is NULL_TREE.) Each <case label
- specification> is also represented as a list with one TREE_LIST
- node for each <case label list> (though only length==1 is currently
- supported). And finally: each <case label list> is again a list
- with one TREE_LIST node for each <case label>. */
-DEFTREECODE (CASE_EXPR, "case_expr", 'e', 2)
-
-/* Powerset and static bit array operations.
- Operands have same mode as result. */
-DEFTREECODE (SET_NOT_EXPR, "set_not_expr", '1', 1)
-DEFTREECODE (SET_IOR_EXPR, "set_ior_expr", '2', 2)
-DEFTREECODE (SET_XOR_EXPR, "set_xor_expr", '2', 2)
-DEFTREECODE (SET_AND_EXPR, "set_and_expr", '2', 2)
-DEFTREECODE (SET_DIFF_EXPR, "set_diff_expr", '2', 2)
-DEFTREECODE (PAREN_EXPR, "paren_expr", '1', 1)
-
-DEFTREECODE (STRING_EQ_EXPR, "string_eq_expr", '2', 2)
-DEFTREECODE (STRING_LT_EXPR, "string_lt_expr", '2', 2)
-
-/* Used to represent a string repetition expression, until
- we have a type for it; a SET_TYPE replicator needs a
- TYPE_DOMAIN even if it represents the empty set */
-DEFTREECODE (REPLICATE_EXPR, "replicate_expr", 'e', 2)
-
-/* An undefined value. Used for the Chill operator '*',
- and sometimes for padding. */
-DEFTREECODE (UNDEFINED_EXPR, "undefined_expr", 'e', 0)
-
-/* Used to represent a process instance */
-DEFTREECODE (INSTANCE_TYPE, "instance_type", 't', 0)
-
-/* Used to represent a reference to an array of bitfields. Currently restricted
- to fields which are 1 bit wide. */
-DEFTREECODE (PACKED_ARRAY_REF, "packed_array_ref", 'r', 2)
-
-/* ALSO NOTE: LANG_TYPE is used for two things during pass 1;
- such a node is converted to some other type node during satisfy.
- If CH_NOVELTY_FLAG is set, then this node is a logical copy of
- its TREE_TYPE, but with a different novelty.
- If TYPE_READONLY is set, then the node stands for 'READ M'
- where M is the TREE_TYPE. */
diff --git a/gcc/ch/ch-tree.h b/gcc/ch/ch-tree.h
deleted file mode 100644
index 4d652b1eb2b..00000000000
--- a/gcc/ch/ch-tree.h
+++ /dev/null
@@ -1,1157 +0,0 @@
-/* Definitions for CHILL parsing and type checking.
- Copyright (C) 1992, 1993, 1994, 1998,
- 1999, 2000 Free Software Foundation, Inc.
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-#ifndef _CH_TREE_H
-#define _CH_TREE_H
-
-/* Usage of TREE_LANG_FLAG_?:
- 1: TUPLE_NAMED_FIELD
- " TYPE_FIELDS_READONLY (in ARRAY_TYPE, RECORD_TYPE or UNION_TYPE)
- " C_DECLARED_LABEL_FLAG
- " C_TYPE_VARIABLE_SIZE
- 2: C_TYPE_FIELDS_VOLATILE (in RECORD_TYPE or UNION_TYPE)
- " ELSE_LABEL_SPECIFIED (in CASE selector expression)
- 3: UNSATISFIED_FLAG
- 4: CH_USE_SEIZEFILE_RESTRICTED
- " CH_ALREADY_GRANTED
- 5: CH_DERIVED_FLAG (in EXPR or DECL)
-*/
-
-/* Usage of TYPE_LANG_FLAG_?:
- 0: CH_TYPE_NONVALUE_P
- 1: C_TYPE_VARIABLE_SIZE
- 2: CH_IS_ACCESS_MODE
- 3: CH_IS_BUFFER_MODE
- 4: CH_IS_EVENT_MODE
- 5: CH_ENUM_IS_NUMBERED
- 6: CH_IS_TEXT_MODE
-*/
-
-/* Language-dependent contents of an identifier. */
-
-struct lang_identifier
-{
- /* These match the fields in c-tree.h. */
- struct tree_identifier ignore;
- tree outer_value, local_value, implicit_decl;
- tree error_locus, limbo_value;
-
- /* These are Chill-specific. */
- tree forbid;
- tree signal_dest;
- int signal_data;
-};
-
-/* Macros for access to language-specific slots in an identifier. */
-
-/* The outer_value is a chain of decls (normally a single decl),
- that have been granted into the scope surrounding all modules. */
-#define IDENTIFIER_OUTER_VALUE(NODE) \
- (((struct lang_identifier *)(NODE))->outer_value)
-#define IDENTIFIER_LOCAL_VALUE(NODE) \
- (((struct lang_identifier *)(NODE))->local_value)
-#define IDENTIFIER_IMPLICIT_DECL(NODE) \
- (((struct lang_identifier *)(NODE))->implicit_decl)
-#define IDENTIFIER_ERROR_LOCUS(NODE) \
- (((struct lang_identifier *)(NODE))->error_locus)
-#define IDENTIFIER_FORBID(NODE) \
- (((struct lang_identifier *)(NODE))->forbid)
-
-/* The nesting level increates by one for every nested 'group'.
- Predefined declarations have level -1; the global scope is level 0.
- */
-#define DECL_NESTING_LEVEL(DECL) \
- ((DECL)->decl.vindex ? TREE_INT_CST_HIGH((DECL)->decl.vindex) : -1)
-
-/* Nesting of things that can have an ON-unit attached. */
-extern int action_nesting_level;
-
-/* The DECL_NAME of a FIELD_DECL that represents the ELSE part of a variant. */
-#define ELSE_VARIANT_NAME ridpointers[(int) RID_ELSE]
-
-/* For a LABEL_DECL: action_nesting_level of its target. */
-#define DECL_ACTION_NESTING_LEVEL(NODE) ((NODE)->decl.u2.i)
-
-#define DECL_OLD_PREFIX(DECL) ((DECL)->decl.initial)
-#define DECL_NEW_PREFIX(DECL) ((DECL)->decl.result)
-#define DECL_POSTFIX(DECL) ((DECL)->decl.arguments)
-extern tree ALL_POSTFIX;
-#define DECL_SEIZEFILE(DECL) ((DECL)->decl.size)
-#define DECL_POSTFIX_ALL(DECL) (DECL_POSTFIX(DECL) == ALL_POSTFIX)
-#define DECL_OLD_NAME(DECL) decl_old_name(DECL)
-/* For a siezefile name this means restricted usage of this file.
- In this case, the USE_SEIZE_FILE directive will not be copied
- into the grant file */
-#define CH_USE_SEIZEFILE_RESTRICTED(NODE) TREE_LANG_FLAG_4(NODE)
-extern tree decl_old_name PARAMS ((tree));
-
-/* for selective granting, mark as already granted */
-#define CH_ALREADY_GRANTED(NODE) TREE_LANG_FLAG_4(NODE)
-
-/* to store the receiving process of that signal
- at definition time */
-#define IDENTIFIER_SIGNAL_DEST(NODE) \
- (((struct lang_identifier *)(NODE))->signal_dest)
-
-/* indicates a signal with no data */
-#define IDENTIFIER_SIGNAL_DATA(NODE) \
- (((struct lang_identifier *)(NODE))->signal_data)
-
-/* In identifiers, C uses the following fields in a special way:
- TREE_PUBLIC to record that there was a previous local extern decl.
- TREE_USED to record that such a decl was used.
- TREE_ADDRESSABLE to record that the address of such a decl was used. */
-
-/* Nonzero means reject anything that Z.200 Recommendation forbids. */
-extern int pedantic;
-
-/* the prototypical CHILL INSTANCE type */
-extern tree instance_type_node;
-
-/* Non-zero if type or expr depends on non-resolved identifier. */
-#define UNSATISFIED(expr) \
- (UNSATISFIED_FLAG (expr) || TREE_CODE (expr) == IDENTIFIER_NODE)
-#define UNSATISFIED_FLAG(expr) TREE_LANG_FLAG_3 (expr)
-
-/* Non-zero in a TREE_LIST if part of a labelled structure tuple. */
-#define TUPLE_NAMED_FIELD(LIST) TREE_LANG_FLAG_1(LIST)
-
-/* In an ARRAY_TYPE, RECORD_TYPE or UNION_TYPE, nonzero if any component
- is read-only. */
-#define TYPE_FIELDS_READONLY(type) TREE_LANG_FLAG_1 (type)
-
-/* True if TYPE has the "read-only property." */
-#define TYPE_READONLY_PROPERTY(TYPE) \
- (TYPE_READONLY (TYPE) || TYPE_FIELDS_READONLY (TYPE))
-
-/* In a RECORD_TYPE or UNION_TYPE, nonzero if any component is volatile. */
-#define C_TYPE_FIELDS_VOLATILE(type) TREE_LANG_FLAG_2 (type)
-
-/* In a CASE selector expression, nonzero if any alternative specifies (ELSE) for
- that selector. */
-#define ELSE_LABEL_SPECIFIED(expr) TREE_LANG_FLAG_2 (expr)
-
-/* CH_CHARS_TYPE_P(TYPE) is true iff TYPE is a character string type.
-
- There is no essential difference between a string and a (one-dimensional)
- character array, at least for non-varying types. I don't know where
- the Chill designers got the idea that it was useful to make a distinction.
- (I suspect packing might be involved, but on a byte-adressable machine
- we don't care.) Since we want the same code to be generated for
- char arrays as for char strings, we use the same representation for
- both. But we still need to distinguish them for the sake a Chill
- type checking. We do that using TYPE_STRING_FLAG. */
-
-#define MARK_AS_STRING_TYPE(TYPE) (TYPE_STRING_FLAG (TYPE) = 1)
-
-#define CH_CHARS_TYPE_P(type) \
- (TREE_CODE (type) == ARRAY_TYPE && TREE_CODE(TREE_TYPE(type)) == CHAR_TYPE \
- && TYPE_STRING_FLAG (type))
-
-/* True if TYPE is CHARS(1). */
-#define CH_CHARS_ONE_P(TYPE) (CH_CHARS_TYPE_P(TYPE) \
- && integer_zerop (TYPE_MAX_VALUE (TYPE_DOMAIN (TYPE))))
-
-/* True if TYPE is a bitstring (BOOLS or BIT) type.
- The TYPE_STRING_FLAG is used to distinguish a bitstring from a powerset. */
-
-#define CH_BOOLS_TYPE_P(type) \
- (TREE_CODE (type) == SET_TYPE && TYPE_STRING_FLAG (type))
-
-/* True if TYPE is BOOLS(1). */
-#define CH_BOOLS_ONE_P(TYPE) (CH_BOOLS_TYPE_P(TYPE) \
- && integer_zerop (TYPE_MAX_VALUE (TYPE_DOMAIN (TYPE))))
-
-/* Value is nonzero if TYPE is a CHILL string type.
- See CH_CHARS_TYPE_P and CH_BOOLS_TYPE_P above. */
-
-#define CH_STRING_TYPE_P(type) \
- ((TREE_CODE (type) == ARRAY_TYPE || TREE_CODE (type) == SET_TYPE) \
- && TYPE_STRING_FLAG (type))
-
-/* In a RECORD_TYPE, a sorted array of the fields of the type. */
-struct lang_type_record
-{
- int len;
- tree tasking_code_decl;
- tree elts[1];
-};
-
-struct lang_type
-{
- union
- {
- struct lang_type_record rec;
- } foo;
-};
-
-struct lang_decl
-{
- union
- {
- tree stuff;
- } foo;
-};
-/* A tasking type's corresponding tasking_code_variable has its
- decl pointer in here. */
-#define DECL_TASKING_CODE_DECL(DECL) (DECL_LANG_SPECIFIC(DECL))
-
-/* A pointer to an as-yet undefined type. */
-extern tree unknown_type_node;
-
-/* The CHILL type INT (either integer_type_node or
- short_integer_type_node). */
-extern tree chill_integer_type_node;
-extern tree chill_unsigned_type_node;
-
-/* Nonzero for FIELD_DECL node means that this FIELD_DECL is
- a member of a union construct. */
-#define TREE_UNION_ELEM(NODE) ((NODE)->decl.regdecl_flag) /* overloaded! */
-
-/* Mark which labels are explicitly declared.
- These may be shadowed, and may be referenced from nested functions. */
-#define C_DECLARED_LABEL_FLAG(label) TREE_LANG_FLAG_1 (label)
-
-/* Record whether a type was written with nonconstant size.
- Note that TYPE_SIZE may have simplified to a constant. */
-#define C_TYPE_VARIABLE_SIZE(type) TYPE_LANG_FLAG_1 (type)
-
-#define DECL_WEAK_NAME(DECL) DECL_LANG_FLAG_0(DECL)
-
-/* These are for FUNCTION_DECLs. */
-#define CH_DECL_GENERAL(DECL) DECL_LANG_FLAG_1(DECL)
-#define CH_DECL_SIMPLE(DECL) DECL_LANG_FLAG_2(DECL)
-#define CH_DECL_RECURSIVE(DECL) DECL_LANG_FLAG_3(DECL)
-#define CH_FUNCTION_SETS_RESULT(DECL) DECL_LANG_FLAG_6(DECL)
-
-/* For a CONST_DECL, indicates that it was implicitly declared
- in a SET mode declaration, and it should not be explicitly granted. */
-#define CH_DECL_ENUM(DECL) DECL_LANG_FLAG_3(DECL)
-
-/* in a FIELD_DECL use DECL_LANG_FLAG_4 to mark FORBID in a grant-statement */
-#define CH_DECL_FORBID(DECL) DECL_LANG_FLAG_4(DECL)
-
-/* in an ALIAS_DECL use DECL_LANG_FLAG_4 to mark decl was granted */
-#define CH_DECL_GRANTED(DECL) DECL_LANG_FLAG_4(DECL)
-
-/* (in a non-FIELD_DECL) note that this decl was hidden by push_module(). */
-#define DECL_HIDDEN_BY_MODULE(decl) DECL_LANG_FLAG_4 (decl)
-
-/* Record in each node resulting from a binary operator
- what operator was specified for it. */
-#define C_EXP_ORIGINAL_CODE(exp) ((enum tree_code) TREE_COMPLEXITY (exp))
-
-/* Store a value in that field. */
-#define C_SET_EXP_ORIGINAL_CODE(exp, code) \
- (TREE_COMPLEXITY (exp) = (int)(code))
-
-/* Record whether a typedef for type `int' was actually `signed int'. */
-#define C_TYPEDEF_EXPLICITLY_SIGNED(exp) DECL_LANG_FLAG_1 ((exp))
-
-/* For FUNCTION_TYPE, a hidden list of types of arguments. The same as
- TYPE_ARG_TYPES for functions with prototypes, but created for functions
- without prototypes. */
-#define TYPE_ACTUAL_ARG_TYPES(NODE) TYPE_NONCOPIED_PARTS (NODE)
-
-/* For FUNCTION_TYPE or METHOD_TYPE, a list of the
- (names of) exceptions that this type can raise. */
-#define TYPE_RAISES_EXCEPTIONS(NODE) ((NODE)->type.minval)
-
-/* For UNION_TYPE, the list of tag fields that distinguishes the members. */
-#define TYPE_TAGFIELDS(NODE) ((NODE)->type.minval)
-
-/* For RECORD_TYPE, the tag values that select it. */
-#define TYPE_TAG_VALUES(NODE) TYPE_BINFO(NODE)
-
-/* For VAR_DECL, TYPE_DECL, FUNCTION_DECL, indicates that
- the DECL was read from a seizefile but not seized */
-#define CH_DECL_NOTDECLARED(DECL) DECL_LANG_FLAG_5(DECL)
-
-/* For FUNCTION_DECL's, mark as PROCESSEs. */
-#define CH_DECL_PROCESS(DECL) DECL_LANG_FLAG_7(DECL)
-
-/* For TYPE_DECL's, mark as SIGNALs. */
-#define CH_DECL_SIGNAL(DECL) DECL_LANG_FLAG_7(DECL)
-
-/* Macros using terminology of the CHILL Blue Book. */
-
-/* A class is either Null, All, M-value, M-derived, or M-reference,
- where M is some mode (type). */
-
-enum ch_class_kind {
- CH_ALL_CLASS, CH_NULL_CLASS,
- CH_VALUE_CLASS, CH_DERIVED_CLASS, CH_REFERENCE_CLASS
-};
-
-typedef struct ch_class {
- enum ch_class_kind kind;
- tree mode; /* The 'M' in M-value, M-derived, or M-reference. */
-} ch_class;
-
-struct mode_chain; /* Forward reference */
-
-#define CH_IS_REFERENCE_MODE(MODE) (TREE_CODE (MODE) == POINTER_TYPE)
-#define CH_IS_BOUND_REFERENCE_MODE(MODE) \
- (TREE_CODE (MODE) == POINTER_TYPE && TREE_TYPE(MODE) != void_type_node)
-#define CH_IS_PROCEDURE_MODE(MODE) (TREE_CODE (MODE) == FUNCTION_TYPE)
-#define CH_IS_INSTANCE_MODE(MODE) (CH_SIMILAR (MODE, instance_type_node))
-#define CH_IS_BUFFER_MODE(MODE) (TYPE_LANG_FLAG_3(MODE))
-#define CH_IS_EVENT_MODE(MODE) (TYPE_LANG_FLAG_4(MODE))
-/* This is TRUE if the set is numbered, which makes pred/succ
- unusable */
-#define CH_ENUM_IS_NUMBERED(MODE) (TYPE_LANG_FLAG_5(MODE))
-
-/* for ACCESS, and TEXT mode */
-#define CH_IS_ACCESS_MODE(MODE) (TYPE_LANG_FLAG_2(MODE))
-#define CH_IS_TEXT_MODE(MODE) (TYPE_LANG_FLAG_6(MODE))
-#define CH_IS_ASSOCIATION_MODE(MODE) (CH_SIMILAR (MODE, association_type_node))
-#define CH_IS_USAGE_MODE(MODE) (CH_SIMILAR (MODE, usage_type_node))
-#define CH_IS_WHERE_MODE(MODE) (CH_SIMILAR (MODE, where_type_node))
-
-/* for RECORD or ARRAY type */
-#define CH_TYPE_NONVALUE_P(MODE) (TYPE_LANG_FLAG_0(MODE))
-
-/* CH_NOVELTY is the novelty of a mode: NULL_TREE means the novelty is nil;
- otherwise a TYPE_DECL matching the defining occurrence of a newmode. */
-#define CH_NOVELTY(MODE) TYPE_CONTEXT(MODE)
-
-/* Set the novelty of MODE to NOVELTY (which is assumed to be non-nil). */
-#define SET_CH_NOVELTY(MODE, NOVELTY) (CH_NOVELTY (MODE) = (NOVELTY))
-#define SET_CH_NOVELTY_NONNIL(MODE, NOVELTY) (CH_NOVELTY (MODE) = (NOVELTY))
-
-/* CH_DERIVED_FLAG is true the class of EXPR is X-derived for some X. */
-#define CH_DERIVED_FLAG(EXPR) TREE_LANG_FLAG_5(EXPR)
-
-#define CH_HAS_REFERENCING_PROPERTY(MODE) \
- (TREE_CODE (MODE) == POINTER_TYPE) /* incomplete FIXME! */
-
-/* CH_COMPATIBLE(EXPR, MODE) is true if the class of EXPR is
- "compatible" with the type MODE. */
-#define CH_COMPATIBLE(EXPR, MODE) chill_compatible(EXPR, MODE)
-#define CH_COMPATIBLE_CLASSES(EXPR1, EXPR2) chill_compatible_classes(EXPR1, EXPR2)
-#define CH_STATIC_MODE(MODE) 1 /* for now */
-#define CH_SIMILAR(MODE1, MODE2) chill_similar(MODE1, MODE2, 0)
-#define CH_ROOT_MODE(MODE) chill_root_mode(MODE)
-#define CH_RESULTING_CLASS(C1, C2) chill_resulting_class(C1, C2)
-#define CH_ROOT_RESULTING_CLASS(E1, E2) \
- CH_RESULTING_CLASS (chill_expr_class(E1), chill_expr_class(E2))
-#define CH_RESULTING_MODE(MODE1, MODE2) chill_resulting_mode(MODE1, MODE2)
-#define CH_V_EQUIVALENT(MODE1, MODE2) (CH_SIMILAR(MODE1, MODE2) \
- && CH_NOVELTY(MODE1) == CH_NOVELTY(MODE2))
-#define CH_EQUIVALENT(MODE1, MODE2) \
- (!integer_zerop (chill_equivalent (MODE1, MODE2, 0)))
-#define CH_RESTRICTABLE_TO(MODE1, MODE2) \
- CH_EQUIVALENT(MODE1, MODE2) /* && some more stuff FIXME! */
-
-/* pass an OFFSET_TYPE or REFERENCE_TYPE's underlying type to SCALAR_P */
-#define CH_READ_COMPATIBLE(modeM, modeN) chill_read_compatible(modeM, modeN)
-
-#define SCALAR_P(TYPE) (TYPE != NULL_TREE \
- && (TREE_CODE (TYPE) == INTEGER_TYPE \
- || TREE_CODE (TYPE) == REAL_TYPE \
- || TREE_CODE (TYPE) == ENUMERAL_TYPE \
- || TREE_CODE (TYPE) == BOOLEAN_TYPE \
- || TREE_CODE (TYPE) == CHAR_TYPE \
- || TREE_CODE (TYPE) == POINTER_TYPE \
- || TREE_CODE (TYPE) == INSTANCE_TYPE))
-#define CH_REFERABLE(EXPR) chill_referable(EXPR)
-#define CH_LOCATION_P(EXPR) chill_location (EXPR)
-
-/* Standard named or nameless data types of the C compiler. */
-
-/* Nonzero means `$' can be in an identifier. */
-
-extern int dollars_in_ident;
-
-/* Nonzero means allow type mismatches in conditional expressions;
- just make their values `void'. */
-
-extern int flag_cond_mismatch;
-
-/* Nonzero means don't recognize the keyword `asm'. */
-
-extern int flag_no_asm;
-
-/* Nonzero means warn about implicit declarations. */
-
-extern int warn_implicit;
-
-/* Nonzero means give string constants the type `const char *'
- to get extra warnings from them. These warnings will be too numerous
- to be useful, except in thoroughly ANSIfied programs. */
-
-extern int warn_write_strings;
-
-/* Nonzero means warn about sizeof (function) or addition/subtraction
- of function pointers. */
-
-extern int warn_pointer_arith;
-
-/* Nonzero means warn for all old-style non-prototype function decls. */
-
-extern int warn_strict_prototypes;
-
-/* Nonzero means warn about multiple (redundant) decls for the same single
- variable or function. */
-
-extern int warn_redundant_decls;
-
-/* Nonzero means warn about extern declarations of objects not at
- file-scope level and about *all* declarations of functions (whether
- extern or static) not at file-scope level. Note that we exclude
- implicit function declarations. To get warnings about those, use
- -Wimplicit. */
-
-extern int warn_nested_externs;
-
-/* Nonzero means warn about pointer casts that can drop a type qualifier
- from the pointer target type. */
-
-extern int warn_cast_qual;
-
-/* Warn about traditional constructs whose meanings changed in ANSI C. */
-
-extern int warn_traditional;
-
-/* Warn about *printf or *scanf format/argument anomalies. */
-
-extern int warn_format;
-
-/* Warn about a subscript that has type char. */
-
-extern int warn_char_subscripts;
-
-/* Warn if a type conversion is done that might have confusing results. */
-
-extern int warn_conversion;
-
-/* Warn if switch labels aren't complete, or are duplicated */
-
-extern int warn_switch;
-
-/* Nonzero means do some things the same way PCC does. */
-
-extern int flag_traditional;
-
-/* Nonzero means warn about suggesting putting in ()'s. */
-
-extern int warn_parentheses;
-
-/* Nonzero means we are reading code that came from a system header file. */
-extern int system_header_p;
-
-/* One means range checking is on; <= 0 off; -1 permanently off. */
-extern int range_checking;
-
-/* 0 means empty checking is off, else it is on */
-extern int empty_checking;
-
-/* 1 means -fruntime-checking specified (default), o means -fno-runtime-checking */
-extern int runtime_checking_flag;
-
-/* Type node for boolean types. */
-
-extern tree boolean_type_node;
-extern tree signed_boolean_type_node;
-
-extern tree string_one_type_node;
-extern tree bitstring_one_type_node, bit_zero_node, bit_one_node;
-
-/* a VOID_TYPE node, packaged in a TREE_LIST. */
-
-extern tree void_list_node;
-
-/* Chill language-specific tree codes. */
-#define DEFTREECODE(SYM, NAME, TYPE, LENGTH) SYM,
-enum chill_tree_code {
- __DUMMY = LAST_AND_UNUSED_TREE_CODE,
-#include "ch-tree.def"
- LAST_CHILL_TREE_CODE
-};
-#undef DEFTREECODE
-
-enum chill_built_in_function
-{
- DUMMY_FIRST_CHILL_BUILT_IN = END_BUILTINS,
-
- BUILT_IN_CH_ABS,
- BUILT_IN_ABSTIME,
- BUILT_IN_ADDR,
- BUILT_IN_ALLOCATE,
- BUILT_IN_ALLOCATE_GLOBAL_MEMORY,
- BUILT_IN_ALLOCATE_MEMORY,
- BUILT_IN_ARCCOS,
- BUILT_IN_ARCSIN,
- BUILT_IN_ARCTAN,
- BUILT_IN_ASSOCIATE,
- BUILT_IN_CARD,
- BUILT_IN_CONNECT,
- BUILT_IN_COPY_NUMBER,
- BUILT_IN_CH_COS,
- BUILT_IN_CREATE,
- BUILT_IN_DAYS,
- BUILT_IN_CH_DELETE,
- BUILT_IN_DESCR,
- BUILT_IN_DISCONNECT,
- BUILT_IN_DISSOCIATE,
- BUILT_IN_EOLN,
- BUILT_IN_EXP,
- BUILT_IN_EXPIRED,
- BUILT_IN_EXISTING,
- BUILT_IN_GEN_CODE,
- BUILT_IN_GEN_INST,
- BUILT_IN_GEN_PTYPE,
- BUILT_IN_GETASSOCIATION,
- BUILT_IN_GETSTACK,
- BUILT_IN_GETTEXTACCESS,
- BUILT_IN_GETTEXTINDEX,
- BUILT_IN_GETTEXTRECORD,
- BUILT_IN_GETUSAGE,
- BUILT_IN_HOURS,
- BUILT_IN_INDEXABLE,
- BUILT_IN_INTTIME,
- BUILT_IN_ISASSOCIATED,
- BUILT_IN_LENGTH,
- BUILT_IN_LOG,
- BUILT_IN_LOWER,
- BUILT_IN_LN,
- BUILT_IN_MAX,
- BUILT_IN_MILLISECS,
- BUILT_IN_MIN,
- BUILT_IN_MINUTES,
- BUILT_IN_MODIFY,
- BUILT_IN_NUM,
- BUILT_IN_OUTOFFILE,
- BUILT_IN_PRED,
- BUILT_IN_PROC_TYPE,
- BUILT_IN_QUEUE_LENGTH,
- BUILT_IN_READABLE,
- BUILT_IN_READRECORD,
- BUILT_IN_READTEXT,
- BUILT_IN_RETURN_MEMORY,
- BUILT_IN_SECS,
- BUILT_IN_SETTEXTACCESS,
- BUILT_IN_SETTEXTINDEX,
- BUILT_IN_SETTEXTRECORD,
- BUILT_IN_SEQUENCIBLE,
- BUILT_IN_SIZE,
- BUILT_IN_SQRT,
- BUILT_IN_SUCC,
- BUILT_IN_CH_SIN,
- BUILT_IN_TAN,
- BUILT_IN_TRUNC,
- BUILT_IN_TERMINATE,
- BUILT_IN_UPPER,
- BUILT_IN_VARIABLE,
- BUILT_IN_WAIT,
- BUILT_IN_WRITEABLE,
- BUILT_IN_WRITERECORD,
- BUILT_IN_WRITETEXT,
-};
-
-/* name of additional (compiler generated) arguments for
- functions which may propagate exceptions. */
-#define CALLER_FILE "__CALLER_FILE__"
-#define CALLER_LINE "__CALLER_LINE__"
-
-/* field-name strings for the fields of the structure which
- represents a CHILL VARYING array. The angle brackets assure
- that no user-defined structure can match this one.
- This field holds, at runtime, the current length of the
- array, in UNITS, not including the length itself. It's an
- integer_type_node */
-#define VAR_LENGTH "__var_length"
-
-/* This field is statically allocated to the user-defined
- size, but contains valid array entries starting from the
- first allocated space, proceeding for VAR_LENGTH bytes.
- There are no holes in the data; the user isn't allowed
- to store beyond the first available entry. */
-
-#define VAR_DATA "__var_data"
-
-/* This field is the name of the array, encapsulated in the CHILL
- structure used to represent an array type parameter. */
-/*#define ARRAY_DATA "__array_data"*/
-
-/* The CHILL INSTANCE type is composed of two CHILL integer
- fields, the process_type (set by the user with the
- process_type compiler directive, and the proc_copy field,
- which is set by the start_process call's first parameter. */
-#define INS_PTYPE "__proc_type"
-#define INS_COPY "__proc_copy"
-
-/* This is the actual array type inside the VARYING struct */
-#define CH_VARYING_ARRAY_TYPE(TYPE) TREE_TYPE (TREE_CHAIN (TYPE_FIELDS (TYPE)))
-
-/* Identifiers which hold the VAR_LENGTH and VAR_DATA strings. */
-extern tree var_length_id;
-extern tree var_data_id;
-
-/* A RANGE_EXPR representing an ELSE in a case label. */
-extern tree case_else_node;
-
-#if 0 /* changed to function */
-/* return non-zero if type is a compiler-generated VARYING array record */
-#define CH_VARYING_TYPE_P(type) (TREE_CODE (type) == RECORD_TYPE && \
- DECL_NAME (TYPE_FIELDS (type)) == \
- get_identifier (VAR_LENGTH) && \
- DECL_NAME (TREE_CHAIN (TYPE_FIELDS (type))) == \
- get_identifier (VAR_DATA) && \
- TREE_CHAIN (CH_VARYING_ARRAY_TYPE (type)) == NULL_TREE)
-
-#endif
-
-/* in c-aux-info.c */
-extern void gen_aux_info_record PARAMS ((tree, int, int, int));
-
-/* in c-common.c */
-extern tree combine_strings PARAMS ((tree));
-extern void constant_expression_warning PARAMS ((tree));
-extern void decl_attributes PARAMS ((tree, tree));
-extern void declare_function_name PARAMS ((void));
-#ifdef BUFSIZ
-extern char *get_directive_line PARAMS ((FILE *));
-#endif
-extern tree shorten_compare PARAMS ((tree *, tree *, tree *, enum tree_code *));
-
-/* in c-decl.c */
-extern tree wchar_type_node, signed_wchar_type_node, unsigned_wchar_type_node;
-extern tree default_function_type;
-extern tree double_ftype_double, double_ftype_double_double;
-extern tree int_ftype_int, long_ftype_long;
-extern tree void_ftype_ptr_ptr_int, int_ftype_ptr_ptr_int;
-extern tree void_ftype_ptr_int_int, string_ftype_ptr_ptr;
-extern tree int_ftype_string_string, int_ftype_cptr_cptr_sizet;
-/* Nodes for boolean constants TRUE and FALSE */
-extern tree boolean_true_node, boolean_false_node;
-
-extern tree global_function_decl;
-
-/* in except.c */
-extern void except_init_pass_2 PARAMS ((void));
-extern void push_handler PARAMS ((void));
-extern void pop_handler PARAMS ((int));
-
-/* in ch-loop.c */
-extern int flag_local_loop_counter;
-extern void push_loop_block PARAMS ((void));
-extern void pop_loop_block PARAMS ((void));
-extern void build_loop_start PARAMS ((tree));
-extern void top_loop_end_check PARAMS ((tree));
-extern void build_loop_end PARAMS ((void));
-extern void build_loop_iterator PARAMS ((tree, tree, tree, tree, int, int, int));
-extern void begin_loop_scope PARAMS ((void));
-extern void end_loop_scope PARAMS ((tree));
-extern void nonvalue_begin_loop_scope PARAMS ((void));
-extern void nonvalue_end_loop_scope PARAMS ((void));
-
-extern tree build_enumerator PARAMS ((tree, tree));
-extern tree c_build_type_variant PARAMS ((tree, int, int));
-extern int c_decode_option PARAMS ((int, char **));
-extern void c_mark_varargs PARAMS ((void));
-extern void clear_parm_order PARAMS ((void));
-extern tree combine_parm_decls PARAMS ((tree, tree, int));
-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 delete_block PARAMS ((tree));
-extern void finish_decl PARAMS ((tree));
-extern tree finish_enum PARAMS ((tree, tree));
-extern void finish_function PARAMS ((int));
-extern tree finish_struct PARAMS ((tree, tree));
-extern tree get_parm_decls PARAMS ((void));
-extern tree get_parm_info PARAMS ((int));
-extern tree getdecls PARAMS ((void));
-extern tree gettags PARAMS ((void));
-extern int global_bindings_p PARAMS ((void));
-extern tree grokfield PARAMS ((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 void init_decl_processing PARAMS ((void));
-extern void insert_block PARAMS ((tree));
-extern void keep_next_level PARAMS ((void));
-extern int kept_level_p PARAMS ((void));
-extern tree lookup_label PARAMS ((tree));
-extern tree lookup_name PARAMS ((tree));
-extern tree maybe_build_cleanup PARAMS ((tree));
-extern void parmlist_tags_warning PARAMS ((void));
-extern void pending_xref_error PARAMS ((void));
-extern void pop_chill_function_context PARAMS ((void));
-extern tree poplevel PARAMS ((int, int, int));
-#ifdef BUFSIZ
-extern void print_lang_decl PARAMS ((FILE *,tree, int));
-extern void print_lang_identifier PARAMS ((FILE *,tree, int));
-extern void print_lang_type PARAMS ((FILE *,tree, int));
-#endif
-extern void push_chill_function_context PARAMS ((void));
-extern void push_parm_decl PARAMS ((tree));
-extern tree pushdecl PARAMS ((tree));
-extern tree pushdecl_top_level PARAMS ((tree));
-extern void pushlevel PARAMS ((int));
-extern void set_block PARAMS ((tree));
-extern tree shadow_label PARAMS ((tree));
-extern void shadow_record_fields 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, int));
-extern tree start_decl PARAMS ((tree, tree, int));
-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));
-
-/* in c-typeck.c */
-extern tree build_array_ref PARAMS ((tree, tree));
-extern tree build_c_cast PARAMS ((tree, tree));
-extern tree build_chill_modify_expr PARAMS ((tree, tree));
-extern tree build_chill_component_ref PARAMS ((tree, tree));
-extern tree build_component_ref PARAMS ((tree, tree));
-extern tree build_compound_expr PARAMS ((tree));
-extern tree build_conditional_expr PARAMS ((tree, tree, tree));
-extern tree build_function_call PARAMS ((tree, tree));
-extern tree build_indirect_ref PARAMS ((tree, char *));
-extern tree build_modify_expr PARAMS ((tree, enum tree_code, tree));
-extern tree build_unary_op PARAMS ((enum tree_code, tree, int));
-extern tree c_alignof PARAMS ((tree));
-extern tree c_alignof_expr PARAMS ((tree));
-extern void c_expand_asm_operands PARAMS ((tree, tree, tree, tree, int, char *, int));
-extern tree c_sizeof PARAMS ((tree));
-extern void c_expand_return PARAMS ((tree));
-extern tree c_expand_start_case PARAMS ((tree));
-extern tree common_type PARAMS ((tree, tree));
-extern tree copy_novelty PARAMS ((tree, tree));
-extern tree default_conversion PARAMS ((tree));
-extern void finish_init PARAMS ((void));
-extern tree parser_build_binary_op PARAMS ((enum tree_code, tree, tree));
-extern tree pop_init_level PARAMS ((int));
-extern void process_init_default PARAMS ((tree));
-extern void process_init_element PARAMS ((tree));
-extern void push_init_level PARAMS ((int));
-extern void really_start_incremental_init PARAMS ((tree));
-extern void set_init_index PARAMS ((tree, tree));
-extern void set_init_label PARAMS ((tree));
-extern void start_init PARAMS ((tree, tree, int));
-extern void store_init_value PARAMS ((tree, tree));
-extern tree valid_array_index_p PARAMS ((tree, tree, const char *, int));
-
-/* in ch/actions.c */
-extern int grant_only_flag;
-extern void allocate_lang_decl PARAMS ((tree));
-extern tree build_chill_abs PARAMS ((tree));
-extern tree build_chill_array_ref_1 PARAMS ((tree, tree));
-extern tree build_chill_array_ref PARAMS ((tree, tree));
-extern tree build_chill_bin_type PARAMS ((tree));
-extern tree build_chill_binary_op PARAMS ((enum chill_tree_code, tree, tree));
-extern tree build_chill_card PARAMS ((tree));
-extern tree build_chill_case_expr PARAMS ((tree, tree, tree));
-extern tree build_cause_exception PARAMS ((tree, int));
-extern tree build_chill_exception_decl PARAMS ((const char *));
-extern tree build_chill_function_call PARAMS ((tree, tree));
-extern tree build_chill_length PARAMS ((tree));
-extern tree build_chill_indirect_ref PARAMS ((tree, tree, int));
-extern tree build_chill_lower PARAMS ((tree));
-extern tree build_chill_max PARAMS ((tree));
-extern tree build_chill_min PARAMS ((tree));
-extern tree build_chill_num PARAMS ((tree));
-extern tree build_chill_repetition_op PARAMS ((tree, tree));
-extern tree build_chill_sizeof PARAMS ((tree));
-extern tree build_chill_slice PARAMS ((tree, tree, tree));
-extern tree build_chill_slice_with_range PARAMS ((tree, tree, tree));
-extern tree build_chill_slice_with_length PARAMS ((tree, tree, tree));
-extern tree build_chill_struct_type PARAMS ((tree));
-extern tree build_chill_unary_op PARAMS ((enum chill_tree_code, tree));
-extern tree build_chill_upper PARAMS ((tree));
-extern tree build_exception_variant PARAMS ((tree, tree));
-extern tree build_generalized_call PARAMS ((tree, tree));
-extern tree build_lang_decl PARAMS ((enum chill_tree_code, tree, tree));
-extern tree build_rts_call PARAMS ((const char *, tree, tree));
-extern tree build_varying_struct PARAMS ((tree));
-extern void chill_check_decl PARAMS ((tree));
-extern tree chill_convert_for_assignment PARAMS ((tree, tree, const char *));
-extern void chill_expand_return PARAMS ((tree, int));
-extern void chill_expand_result PARAMS ((tree, int));
-extern void chill_handle_case_default PARAMS ((void));
-extern void chill_handle_case_label PARAMS ((tree, tree));
-extern int chill_varying_string_type_p PARAMS ((tree));
-extern int chill_varying_type_p PARAMS ((tree));
-extern int ch_singleton_set PARAMS ((tree));
-extern tree check_expression PARAMS ((tree, tree, tree));
-extern void check_missing_cases PARAMS ((tree));
-extern tree check_non_null PARAMS ((tree));
-extern tree check_range PARAMS ((tree, tree, tree,tree));
-extern void cond_type_range_exception PARAMS ((tree));
-extern void expand_cause_exception PARAMS ((tree));
-extern tree finish_chill_binary_op PARAMS ((tree));
-extern tree finish_chill_unary_op PARAMS ((tree));
-extern tree high_domain_value PARAMS ((tree));
-extern tree low_domain_value PARAMS ((tree));
-extern tree maybe_array_ref PARAMS ((tree, tree));
-extern void maybe_chill_check_decl PARAMS ((tree));
-extern tree powersetlen PARAMS ((tree));
-extern tree test_range PARAMS ((tree, tree, tree));
-/* in ch/convert.c */
-extern tree build_array_type_for_scalar PARAMS ((tree));
-extern tree convert PARAMS ((tree, tree));
-extern tree convert_from_reference PARAMS ((tree));
-extern tree convert_to_class PARAMS ((ch_class, tree));
-extern const char *display_int_cst PARAMS ((tree));
-
-/* in ch/decl.c */
-extern tree build_enumerator PARAMS ((tree, tree));
-extern tree chill_munge_params PARAMS ((tree, tree, tree));
-extern tree build_chill_function_type PARAMS ((tree, tree, tree, tree));
-extern tree decl_temp1 PARAMS ((tree, tree, int, tree, int, int));
-extern void do_based_decls PARAMS ((tree, tree, tree));
-extern void do_chill_outparms PARAMS ((void));
-extern tree do_decl PARAMS ((tree, tree, int, int, tree, int));
-extern void do_decls PARAMS ((tree, tree, int, int, tree, int));
-extern void expand_chill_outparms PARAMS ((void));
-extern void find_granted_decls PARAMS ((void));
-extern void finish_chill_function PARAMS ((void));
-extern tree finish_enum PARAMS ((tree, tree));
-extern void fixup_chill_parms PARAMS ((tree));
-extern void finish_outer_function PARAMS ((void));
-extern unsigned get_type_precision PARAMS ((tree, tree));
-extern tree grok_chill_fixedfields PARAMS ((tree, tree, tree));
-extern tree grok_chill_variantdefs PARAMS ((tree, tree, tree));
-extern void layout_enum PARAMS ((tree));
-/* extern tree lookup_remembered_decl PARAMS ((HOST_WIDE_INT, tree)); */
-extern void lookup_and_expand_goto PARAMS ((tree));
-extern tree lookup_tag_fields PARAMS ((tree, tree));
-extern void lookup_and_handle_exit PARAMS ((tree));
-extern tree massage_param_node PARAMS ((tree, tree));
-extern void pop_module PARAMS ((void));
-extern void print_mode PARAMS ((tree));
-extern tree push_extern_function PARAMS ((tree, tree, tree, tree, int));
-extern void push_extern_process PARAMS ((tree, tree, tree, int));
-extern void push_extern_signal PARAMS ((tree, tree, tree));
-extern void push_granted PARAMS ((tree, tree));
-extern tree push_modedef PARAMS ((tree, tree, int));
-extern tree push_module PARAMS ((tree, int));
-extern void push_parms PARAMS ((tree, tree, tree));
-extern void push_syndecl PARAMS ((tree, tree, tree));
-extern int result_never_set;
-extern void save_expr_under_name PARAMS ((tree, tree));
-extern tree set_module_name PARAMS ((tree));
-extern int start_chill_function PARAMS ((tree, tree, tree, tree, tree));
-extern void start_outer_function PARAMS ((void));
-extern void switch_to_pass_2 PARAMS ((void));
-
-/* in ch/except.c */
-extern void chill_check_no_handlers PARAMS ((void));
-extern void chill_finish_on PARAMS ((void));
-extern void chill_handle_on_labels PARAMS ((tree));
-extern void chill_reraise_exceptions PARAMS ((tree));
-extern void chill_start_default_handler PARAMS ((void));
-extern void chill_start_on PARAMS ((void));
-extern void expand_goto_except_cleanup PARAMS ((int));
-extern int is_handled PARAMS ((tree));
-
-/* in ch/expr.c */
-extern tree build_chill_addr_expr PARAMS ((tree, const char *));
-extern tree build_chill_arrow_expr PARAMS ((tree, int));
-extern tree build_component_ref PARAMS ((tree, tree));
-extern tree build_chill_compound_expr PARAMS ((tree));
-extern tree build_chill_descr PARAMS ((tree));
-extern void build_chill_descr_type PARAMS ((void));
-extern void build_chill_inttime_type PARAMS ((void));
-extern tree build_compare_expr PARAMS ((enum tree_code,
- tree, tree));
-extern tree build_compare_discrete_expr PARAMS ((enum tree_code,
- tree, tree));
-extern tree check_case_selector PARAMS ((tree));
-extern tree check_case_selector_list PARAMS ((tree));
-extern tree check_have_mode PARAMS ((tree, const char *));
-extern void init_chill_expand PARAMS ((void));
-extern void chill_expand_assignment PARAMS ((tree, enum chill_tree_code, tree));
-extern void expand_assignment_action PARAMS ((tree, enum chill_tree_code, tree));
-extern int compare_int_csts PARAMS ((enum chill_tree_code,
- tree, tree));
-extern void expand_varying_length_assignment PARAMS ((tree, tree));
-extern tree force_addr_of PARAMS ((tree));
-extern tree resolve_component_ref PARAMS ((tree));
-extern tree truthvalue_conversion PARAMS ((tree));
-extern tree varying_to_slice PARAMS ((tree));
-
-/* in ch/grant.c */
-extern void chill_finish_compile PARAMS ((void));
-extern void chill_seize PARAMS ((tree, tree, tree));
-extern void start_outer_function PARAMS ((void));
-extern void finish_chill_seize PARAMS ((tree));
-extern void chill_grant PARAMS ((tree,tree, tree, tree));
-extern void set_default_grant_file PARAMS ((void));
-extern void set_identifier_size PARAMS ((int));
-extern void write_grant_file PARAMS ((void));
-extern void write_spec_module PARAMS ((tree, tree));
-
-/* in ch/lang.c */
-extern tree string_index_type_dummy;
-extern int flag_old_strings;
-extern void GNU_xref_begin PARAMS ((void));
-extern void GNU_xref_end PARAMS ((void));
-extern tree build_chill_array_type PARAMS ((tree, tree, int, tree));
-extern tree build_chill_struct_type PARAMS ((tree));
-extern tree build_chill_pointer_type PARAMS ((tree));
-extern tree build_chill_range_type PARAMS ((tree, tree, tree));
-extern tree build_chill_reference_type PARAMS ((tree));
-extern tree build_simple_array_type PARAMS ((tree, tree, tree));
-extern tree const_expr PARAMS ((tree));
-extern tree get_identifier3 PARAMS ((const char *, const char *, const char *));
-extern tree layout_chill_array_type PARAMS ((tree));
-extern tree layout_chill_range_type PARAMS ((tree, int));
-extern tree layout_chill_pointer_type PARAMS ((tree));
-extern tree layout_chill_struct_type PARAMS ((tree));
-extern tree layout_chill_variants PARAMS ((tree));
-extern tree layout_powerset_type PARAMS ((tree));
-extern tree lookup_interface PARAMS ((tree));
-extern tree maybe_building_objc_message_expr PARAMS ((void));
-extern void maybe_objc_check_decl PARAMS ((tree));
-extern int maybe_objc_comptypes PARAMS ((tree, tree));
-extern int recognize_objc_keyword PARAMS ((void));
-
-/* in ch/lex.l */
-extern tree use_seizefile_name;
-extern tree current_seizefile_name;
-extern tree build_chill_string PARAMS ((int, const char *));
-extern int check_newline PARAMS ((void));
-extern tree get_chill_filename PARAMS ((void));
-extern tree get_chill_linenumber PARAMS ((void));
-extern void register_seize_path PARAMS ((const char *));
-extern void reinit_parse_for_function PARAMS ((void));
-extern void mark_use_seizefile_written PARAMS ((tree));
-
-/* in ch/loop.c */
-extern void begin_chill_loop PARAMS ((tree, tree));
-extern tree build_chill_iterator PARAMS ((tree, tree, tree, int, int, int));
-extern void end_chill_loop PARAMS ((void));
-extern tree get_unique_identifier PARAMS ((const char *));
-
-/* in ch/inout.c */
-extern tree access_recordmode PARAMS ((tree));
-extern void invalidate_access_recordmode PARAMS ((tree));
-extern tree access_indexmode PARAMS ((tree));
-extern tree access_dynamic PARAMS ((tree));
-extern tree association_init_value;
-extern tree association_type_node;
-extern tree build_access_mode PARAMS ((tree, tree, int));
-extern tree build_chill_associate PARAMS ((tree, tree, tree));
-extern tree build_chill_connect PARAMS ((tree, tree, tree, tree));
-extern tree build_chill_create PARAMS ((tree));
-extern tree build_chill_delete PARAMS ((tree));
-extern tree build_chill_disconnect PARAMS ((tree));
-extern tree build_chill_dissociate PARAMS ((tree));
-extern tree build_chill_eoln PARAMS ((tree));
-extern tree build_chill_existing PARAMS ((tree));
-extern tree build_chill_gettextaccess PARAMS ((tree));
-extern tree build_chill_getassociation PARAMS ((tree));
-extern tree build_chill_gettextindex PARAMS ((tree));
-extern tree build_chill_gettextrecord PARAMS ((tree));
-extern tree build_chill_getusage PARAMS ((tree));
-extern tree build_chill_indexable PARAMS ((tree));
-extern tree build_chill_isassociated PARAMS ((tree));
-extern tree build_chill_modify PARAMS ((tree, tree));
-extern tree build_chill_outoffile PARAMS ((tree));
-extern tree build_chill_readable PARAMS ((tree));
-extern tree build_chill_readrecord PARAMS ((tree, tree));
-extern tree build_chill_readtext PARAMS ((tree, tree));
-extern tree build_chill_sequencible PARAMS ((tree));
-extern tree build_chill_settextaccess PARAMS ((tree, tree));
-extern tree build_chill_settextindex PARAMS ((tree, tree));
-extern tree build_chill_settextrecord PARAMS ((tree, tree));
-extern tree build_chill_variable PARAMS ((tree));
-extern tree build_chill_writeable PARAMS ((tree));
-extern tree build_chill_writerecord PARAMS ((tree, tree));
-extern tree build_chill_writetext PARAMS ((tree, tree));
-extern void build_enum_tables PARAMS ((void));
-extern tree build_text_mode PARAMS ((tree, tree, int));
-extern tree check_text_length PARAMS ((tree));
-extern void init_access_location PARAMS ((tree, tree));
-extern void init_text_location PARAMS ((tree, tree));
-extern void inout_init PARAMS ((void));
-extern tree text_dynamic PARAMS ((tree));
-extern tree text_indexmode PARAMS ((tree));
-extern tree text_length PARAMS ((tree));
-extern tree usage_type_node;
-extern tree where_type_node;
-
-/* in ch/parse.c */
-extern tree get_type_of PARAMS ((tree));
-extern void set_yydebug PARAMS ((int));
-extern void yyerror PARAMS ((char *));
-extern int pass;
-extern int ignoring;
-extern int seen_action;
-extern int build_constructor;
-extern void possibly_define_exit_label PARAMS ((tree));
-extern void to_global_binding_level PARAMS ((void));
-
-/* in ch/satisfy.c */
-extern tree satisfy_decl PARAMS ((tree, int));
-
-/* in ch/tasking.c */
-extern void add_taskstuff_to_list PARAMS ((tree, const char *, tree, tree, tree));
-extern void process_buffer_decls PARAMS ((tree, tree, int));
-extern tree buffer_element_mode PARAMS ((tree));
-extern void invalidate_buffer_element_mode PARAMS ((tree));
-extern tree build_buffer_descriptor PARAMS ((tree, tree, tree));
-extern tree build_buffer_type PARAMS ((tree, tree));
-extern void build_delay_action PARAMS ((tree, tree));
-extern tree build_delay_case_start PARAMS ((tree, tree));
-extern void build_delay_case_end PARAMS ((tree));
-extern void build_delay_case_label PARAMS ((tree, int));
-extern tree build_event_type PARAMS ((tree));
-extern void build_receive_case_end PARAMS ((tree, tree));
-extern int build_receive_case_if_generated PARAMS ((void));
-extern tree build_receive_case_label PARAMS ((tree, tree));
-extern tree build_receive_case_start PARAMS ((tree));
-extern void expand_continue_event PARAMS ((tree));
-extern void expand_send_buffer PARAMS ((tree, tree, tree, tree, tree));
-extern void expand_send_signal PARAMS ((tree, tree, tree, tree, tree));
-extern void build_start_process PARAMS ((tree, tree, tree, tree));
-extern tree build_copy_number PARAMS ((tree));
-extern tree build_gen_code PARAMS ((tree));
-extern tree build_gen_inst PARAMS ((tree, tree));
-extern tree build_gen_ptype PARAMS ((tree));
-extern void build_instance_type PARAMS ((void));
-extern tree build_process_header PARAMS ((tree, tree));
-extern void build_process_wrapper PARAMS ((tree, tree));
-extern tree build_proc_type PARAMS ((tree));
-extern tree build_queue_length PARAMS ((tree));
-extern tree build_signal_descriptor PARAMS ((tree, tree));
-extern tree build_signal_struct_type PARAMS ((tree, tree, tree));
-extern tree build_tasking_struct PARAMS ((void));
-extern tree chill_taskingcode_type_node;
-extern tree check_queue_size PARAMS ((tree));
-extern tree generate_tasking_code_variable PARAMS ((tree, tree *, int));
-extern tree get_signal_type_name PARAMS ((tree));
-extern tree get_struct_type_name PARAMS ((tree));
-extern tree get_tasking_code_name PARAMS ((tree));
-extern tree make_process_struct PARAMS ((tree, tree));
-extern tree make_signal_struct PARAMS ((tree));
-extern tree max_queue_size PARAMS ((tree));
-extern void tasking_init PARAMS ((void));
-extern void tasking_registry PARAMS ((void));
-extern void tasking_setup PARAMS ((void));
-
-/* in ch/timing.c */
-extern tree abs_timing_type_node;
-extern tree after_stack;
-extern void build_after_end PARAMS ((void));
-extern void build_after_start PARAMS ((tree, int));
-extern void build_after_timeout_start PARAMS ((void));
-extern void build_at_action PARAMS ((tree));
-extern void build_cycle_end PARAMS ((tree));
-extern tree build_cycle_start PARAMS ((tree));
-extern tree build_timeout_preface PARAMS ((void));
-extern void build_timesupervised_call PARAMS ((tree, tree));
-extern tree duration_timing_type_node;
-extern void timing_init PARAMS ((void));
-
-/* in ch/tree.c */
-extern tree build_alias_decl PARAMS ((tree, tree, tree));
-extern tree build_bitstring_type PARAMS ((tree));
-extern tree build_powerset_type PARAMS ((tree));
-extern tree build_string_type PARAMS ((tree, tree));
-extern tree decl_check_rename PARAMS ((tree, tree));
-extern tree discrete_count PARAMS ((tree));
-extern int list_length PARAMS ((tree));
-extern tree munge_exit_label PARAMS ((tree));
-extern tree save_if_needed PARAMS ((tree));
-
-/* in ch/typeck.c */
-extern tree build_array_from_set PARAMS ((tree));
-extern tree build_chill_array_ref PARAMS ((tree, tree));
-extern tree build_chill_bitref PARAMS ((tree, tree));
-extern tree build_chill_cast PARAMS ((tree, tree));
-extern tree chill_equivalent PARAMS ((tree, tree, struct mode_chain*));
-extern tree build_init_struct PARAMS ((void));
-extern tree build_readonly_type PARAMS ((tree));
-extern int chill_compatible PARAMS ((tree, tree));
-extern int chill_compatible_classes PARAMS ((tree, tree));
-extern ch_class chill_expr_class PARAMS ((tree));
-extern tree chill_give_type_to_expr PARAMS ((tree, tree));
-extern tree chill_expand_tuple PARAMS ((tree, tree));
-extern ch_class chill_expr_class PARAMS ((tree));
-extern int chill_location PARAMS ((tree));
-extern tree chill_max_vary_array_index PARAMS ((tree));
-extern int chill_read_compatible PARAMS ((tree, tree));
-extern int chill_referable PARAMS ((tree));
-extern tree chill_root_mode PARAMS ((tree));
-extern ch_class chill_resulting_class PARAMS ((ch_class, ch_class));
-extern tree chill_resulting_mode PARAMS ((tree, tree));
-extern int chill_similar PARAMS ((tree, tree, struct mode_chain*));
-extern int discrete_type_p PARAMS ((tree));
-extern tree convert_to_discrete PARAMS ((tree));
-extern tree smash_dummy_type PARAMS ((tree));
-extern tree string_assignment_condition PARAMS ((tree, tree));
-extern tree type_for_mode PARAMS ((enum machine_mode, int));
-extern tree type_for_size PARAMS ((unsigned, int));
-extern int valid_array_index PARAMS ((tree, tree));
-extern void validate_varying_array_ref PARAMS ((tree, tree));
-
-/* in toplev.c */
-extern void announce_function PARAMS ((tree));
-extern int floor_log2_wide PARAMS ((unsigned HOST_WIDE_INT));
-extern void rest_of_compilation PARAMS ((tree));
-
-/* in varasm.c */
-extern void make_function_rtl PARAMS ((tree));
-
-/* in ???? */
-extern void init_iterators PARAMS ((void));
-extern int mark_addressable PARAMS ((tree));
-extern tree chill_result_decl;
-
-#ifndef SET_WORD_SIZE
-#define SET_WORD_SIZE BITS_PER_WORD
-#endif
-
-struct module
-{
- struct module *next_module; /* Next module, in order of their beginning. */
- struct module *prev_module; /* The surrounding module, if any. */
- tree name;
- tree prefix_name; /* Usually same as name, expect for nested modules.
- Used to generate DECL_ASSEMBLER_NAMEs. */
- /* procedure_seen indicates a procedure or process was declared.
- After this, no SEIZE, DCL, SYN, NEWMODE, SYNMODE statement is allowed */
- int procedure_seen;
- int is_spec_module;
-
- /* The value of current_nesting_level inside the module. */
- int nesting_level;
-
- /* A chain contain one ALIAS_DECL for each 'GRANT foo->bar'.
- The DECL_NAME is get_identifier("bar"), and the DECL_INITIAL
- is get_identifier("bar"). Only used in pass 1. */
- tree granted_decls;
-};
-
-extern struct module *current_module;
-
-/* fold a tree to constant as much as possible */
-extern tree deep_fold PARAMS ((tree));
-
-extern const char * const gnuchill_version;
-
-#endif
diff --git a/gcc/ch/chill.brochure b/gcc/ch/chill.brochure
deleted file mode 100644
index 44301edff92..00000000000
--- a/gcc/ch/chill.brochure
+++ /dev/null
@@ -1,252 +0,0 @@
- GNU CHILL: A Complete CHILL Implementation
-
-CHILL (the CCITT High Level Language) is a strongly-typed, block
-structured language designed primarily for the implementation of large
-and complex embedded systems. Tens of millions of lines of CHILL code
-exist, and about 15,000 programmers world-wide use CHILL. Many
-central-office telephone switching systems use CHILL for their control
-software.
-
-CHILL was designed to
-
- - enhance reliability and run time efficiency by means of extensive
- compile time checking;
- - provide sufficient flexibility and power to encompass the required
- range of applications and to exploit a variety of hardware;
- _ provide facilities that encourage piecewise and modular development
- of large systems;
- - cater to real-time implementations by providing built-in concurrency
- and time supervision primitives;
- - permit the generation of highly efficient object code;
- - facilitate ease of use and a short learning curve.
-
-CHILL is specified in the "Blue Book":
- CCITT High Level Language (CHILL) Recommendation Z.200
- ISO/IEC 9496, Geneva 1989 ISBN 92-61-03801-8
-
-Cygnus Support has completed the first level implementation of the
-GNU CHILL compiler. Our compiler now supports the core features of
-the CHILL language. Our goal is a fully retargetable, complete
-implementation of the Z.200 specification. The next phase of
-implementation will include:
-
- . a minimal real-time kernel for demonstration use
- . more rigorous type checking
- . retargetable input/output
- . interprocess communications
- . fully compliant exception handling.
-
-The State of the Implementation
-
-The GNU CHILL compiler is in early beta state, performing correct
-compilation and execution of correctly coded programs. Like most
-CHILL compilers, the GNU compiler implements a large subset of the
-language (as described below).
-
-Since it uses the same compiler back-ends as the GNU C and C++
-compilers, GNU CHILL is almost instantly available on all
-platforms supported by GNU C, including the following:
-
- m680xx, i960, i80x86, AMD29K, R3000, R4000, SPARClite,
- Hitachi H8 and SH families, Z8001/2
-
-It has been specifically tested under SunOS on SPARCs and under
-SCO Unix on 80386s.
-
-All of the GCC optimizations apply to CHILL as well, including
-function inlining, dead code elimination, jump-to-jump elimination,
-cross-jumping (tail-merging), constant propagation, common
-subexpression elimination, loop-invariant code motion, strength
-reduction, loop unrolling, induction variable elimination, flow
-analysis (copy propagation, dead store elimination and elimination
-of unreachable code), dataflow-driven instruction scheduling, and
-many others.
-
-I/O statements are parsed. The anticipated timeframe for I/O code
-generation is Q1 1994.
-
-What's Next
-
-The multi-tasking functions require a small real time kernel.
-A free implementation of such a kernel is not yet available.
-We plan to offer a productized P-threads interface in Q2 1994.
-Other runtime functions involving strings and powersets are
-working.
-
-GDB, the GNU Debugger, has been modified to provide simple CHILL
-support. Some CHILL expressions are not yet recognized.
-
-For those who aren't familiar with CHILL, here's a small but
-useful example program:
-
---
--- Convert binary integers to decimal-coded ASCII string
---
-vary1: MODULE
-
- -- include declarations so we can output the test results
- <> USE_SEIZE_FILE 'chprintf.grt' <>
- SEIZE chprintf;
-
- -- create a new name for the CHAR array mode
- SYNMODE dec_string = CHAR (6) VARYING;
-
- int_to_dec_char: PROC (decimal_num INT IN)
- RETURNS (dec_string);
-
- DCL neg_num BOOL := FALSE; -- save sign of parameter
- DCL out_string dec_string;
-
- IF decimal_num < 0 THEN -- positive numbers are easier
- decimal_num := -decimal_num;
- neg_num := TRUE;
- FI
-
- IF decimal_num = 0 THEN
- out_string := '0'; /* handle zero */
- ELSE
- out_string := '';
- DO WHILE decimal_num /= 0; -- loop until number is zero
- -- concatenate a new digit in front of the output string
- out_string := CHAR (ABS (decimal_num REM D'10) + H'30)
- // out_string;
- decimal_num := decimal_num / D'10;
- OD;
- IF neg_num THEN
- -- prepend a hyphen for numbers < zero
- out_string := '-' // out_string; -- restore sign
- FI;
- FI;
- RESULT out_string; -- remember result
-
- decimal_num := 0; -- reset for next call
- neg_num := FALSE;
- out_string := ' ';
-
- END int_to_dec_char;
-
- /* Try some test cases */
- chprintf (int_to_dec_char (123456), 0);
- chprintf ("^J", 0);
-
- chprintf (int_to_dec_char (-654321), 0);
- chprintf ("^J", 0);
-
- chprintf (int_to_dec_char (0), 0);
- chprintf ("^J", 0);
-
-END vary1;
-
-Completeness
-
-GNU CHILL currently supports the following features. This outline
-generally follows the structure of the Blue Book specification:
-
- CCITT High Level Language (CHILL) Recommendation Z.200
- ISO/IEC 9496, Geneva 1989 ISBN 92-61-03801-8
-
-
- Modes (types)
- no DYNAMIC modes yet
- discrete modes
- integer, boolean, character, real
- multiple integer/real precisions (an extension)
- set modes, range modes
- powersets
- references
- (no ROW modes)
- procedure modes
- instance modes
- event modes
- buffer modes
- (no input/output modes yet)
- (no timing modes yet)
- composite modes
- strings
- arrays
- structures
- VARYING string/array modes
- (type-checking is not fully rigorous yet)
- forward references
-
- Expressions
- literals
- tuples
- slices, ranges
- the standard operators
-
- Actions (statements)
- assignments
- if .. then .. else .. fi
- cases
- do action
- do .. with
- exits
- calls
- results/returns
- gotos
- assertions
- cause exception
- start/stop/continue process
-
- Input/Output
- (not yet)
-
- Exception handling
- fully compiled, but exceptions aren't
- generated in all of the required situations
-
- Time Supervision
- (syntax only)
-
- Inter-process communications
- delay/delay case actions
- send signal/receive case actions
- send buffer/receive case actions
-
- Multi-module programming
- Seize/grant processing
- multiple modules per source file
-
-
-Bibliography
-
-This list is included as an invitation. We'd appreciate hearing
-of CHILL-related documents (with ISBN if possible) which aren't
-described here. We're particularly interested in getting copies
-of other conference Proceedings.
-
- CCITT High Level Language (CHILL) Recommendation Z.200
- ISO/IEC 9496, Geneva 1989 ISBN 92-61-03801-8
- (The "blue book". The formal language definition; mostly a
- language-lawyer's document, but more readable than most.)
-
- Study Group X - Report R 34
- This is the May 1992 revision of Z.200.
-
- An Analytic Description of CHILL, the CCITT high-level
- language, Branquart, Louis & Wodon, Springer-Verlag 1981
- ISBN 3-540-11196-4
-
- CHILL User's Manual
- CCITT, Geneva 1986 ISBN 92-61-02601-X
- (Most readable, but doesn't cover the whole language).
-
- Introduction to CHILL
- CCITT, Geneva 1983 ISBN 92-61-017771-1
-
- CHILL CCITT High Level Language
- Proceedings of the 5th CHILL Conference
- North-Holland, 1991 ISBN 0 444 88904 3
-
- Introduction to the CHILL programming Language
- TELEBRAS, Campinas, Brazil 1990
-
- CHILL: A Self-Instruction Manual
- Telecommunication Institute - PITTC
- Available from KVATRO A/S, N-7005 Trondheim, Norway
- Phone: +47 7 52 00 90
- (Great discussion of novelty.)
-
-Some of these documents are available from Global Engineering
-Documents, in Irvine, CA, USA. +1 714 261 1455.
diff --git a/gcc/ch/chill.in b/gcc/ch/chill.in
deleted file mode 100644
index 62b73d5f961..00000000000
--- a/gcc/ch/chill.in
+++ /dev/null
@@ -1,130 +0,0 @@
-#!/bin/sh
-# Compile GNU Chill programs.
-: || exec /bin/sh -f $0 $argv:q
-
-# The compiler name might be different when doing cross-compilation
-# (this should be configured)
-gcc_name=gcc
-whatgcc=gcc
-speclang=-xnone
-startfile=chillrt0
-gnuchill_script_flags=
-gnuchill_version=unknown
-extraflags=
-
-# replace the command name by the name of the new command
-progname=`basename $0`
-case "$0" in
- */*)
- gcc=`echo $0 | sed -e "s;/[^/]*$;;"`/$gcc_name
- ;;
- *)
- gcc=$gcc_name
- ;;
-esac
-
-# $first is yes for first arg, no afterwards.
-first=yes
-# If next arg is the argument of an option, $quote is non-empty.
-# More precisely, it is the option that wants an argument.
-quote=
-# $library is made empty to disable use of libchill.
-library="-lchill"
-libpath=chillrt
-numargs=$#
-
-for arg
-do
- if [ $first = yes ]
- then
- # Need some 1st arg to `set' which does not begin with `-'.
- # We get rid of it after the loop ends.
- set gcc
- first=no
- fi
- # If you have to ask what this does, you should not edit this file. :-)
- # The ``S'' at the start is so that echo -nostdinc does not eat the
- # -nostdinc.
- arg=`echo "S$arg" | sed "s/^S//; s/'/'\\\\\\\\''/g"`
- if [ x$quote != x ]
- then
- quote=
- else
- quote=
- case $arg in
- -nostdlib)
- # Inhibit linking with -lchill.
- library=
- libpath=
- startfile=
- ;;
- -B*)
- gcc=`echo $arg | sed -e "s/^-B//"`$gcc_name
- ;;
- -[bBVDUoeTuIYmLiA] | -Tdata | -Xlinker)
- # these switches take following word as argument,
- # so don't treat it as a file name.
- quote=$arg
- ;;
- -[cSEM] | -MM)
- # Don't specify libraries if we won't link,
- # since that would cause a warning.
- library=
- libpath=
- startfile=
- ;;
- -x*)
- speclang=$arg
- ;;
- -v)
- # catch `chill -v'
- if [ $numargs = 1 ] ; then
- library=
- libpath=
- startfile=
- fi
- echo "GNUCHILL version $gnuchill_version"
- ;;
- -fgrant-only | -fchill-grant-only)
- #inhibit production of an object file
- extraflags="-S -o /dev/null"
- library=
- libpath=
- startfile=
- ;;
- -*)
- # Pass other options through; they don't need -x and aren't inputs.
- ;;
- *)
- # If file ends in .i, put options around it.
- # But not if a specified -x option is currently active.
- case "$speclang $arg" in -xnone\ *.[i])
- set "$@" -xchill "'$arg'" -xnone
- continue
- esac
- ;;
- esac
- fi
- set "$@" "'$arg'"
-done
-
-# Get rid of that initial 1st arg
-if [ $first = no ]; then
- shift
-else
- echo "$0: No input files specified."
- exit 1
-fi
-
-if [ x$quote != x ]
-then
- echo "$0: argument to \`$quote' missing"
- exit 1
-fi
-
-# The '-ansi' flag prevents cpp from changing this:
-# NEWMODE x = SET (sun, mon, thu, wed, thu, fri, sat);
-#to this:
-# NEWMODE x = SET (1, mon, thu, wed, thu, fri, sat);
-#which is a CHILL syntax error.
-eval $whatgcc -ansi $gnuchill_script_flags $startfile "$@" $libpath $library $extraflags
diff --git a/gcc/ch/chill.texi b/gcc/ch/chill.texi
deleted file mode 100644
index 9dab1f02af4..00000000000
--- a/gcc/ch/chill.texi
+++ /dev/null
@@ -1,1231 +0,0 @@
-@\input texinfo @c -*-texinfo-*-
-@setfilename chill.info
-@settitle Guide to GNU Chill
-
-
-@ifinfo
-@format
-START-INFO-DIR-ENTRY
-* Chill: (chill). Chill compiler
-END-INFO-DIR-ENTRY
-@end format
-@end ifinfo
-
-@titlepage
-@title GNU Chill
-@author William Cox, Per Bothner, Wilfried Moser
-@end titlepage
-
-@ifinfo
-@node Top
-@top
-
-@menu
-* Options:: Compiler options
-* Missing:: Unimplemented parts of the Chill language
-* Enhancements:: GNU-specific enhancements to the Chill language
-* Conversions:: Value and location conversions
-* Separate compilation:: Separate compilation
-* Differences:: Differences between GNUCHILL and Z.200/1988
-* Directives:: Implemented Compiler Directives
-* References:: Language definition references
-@end menu
-
-@end ifinfo
-
-@node Options
-@chapter Compiler options
-
-Invoking the compiler:
-
-The @sc{gnu} CHILL compiler supports several new command line options, and
-brings a new use to another:
-
-@table @code
-@item -lang-chill
-This option instructs gcc that the following file is a CHILL source file,
-even though its extension is not the default `.ch'.
-
-@item -flocal-loop-counter
-The CHILL compiler makes a separate reach, or scope,
-for each DO FOR loop. If @code{-flocal-loop-counter} is
-specified, the loop counter of value enumeration and location
-enumeration is automatically declared inside that reach.
-This is the default behavior, required by Z.200.
-
-@item -fno-local-loop-counter
-When this option is specified, the above automatic declaration
-is not performed, and the user must declare all loop counters
-explicitly.
-
-@item -fignore-case
-When this option is specified, the compiler ignores case. All
-identifiers are converted to lower case. This enables the usage
-of C runtime libraries.
-
-@item -fno-ignore-case
-Ignoring the case of identifiers is turned off.
-
-@item -fruntime-checking
-The CHILL compiler normally generates code to check
-the validity of expressions assigned to variables or
-expressions passed as parameters to procedures and processes,
-if those expressions cannot be checked at compile time.
-This is the default behavior, required by Z.200.
-This option allows you to re-enable the default behavior
-after disabling it with the @code{-fno-runtime-checking}
-option.
-
-@item -fno-runtime-checking
-The CHILL compiler normally generates code to check
-the validity of expressions assigned to variables, or
-expressions passed as parameters to procedures and processes.
-This option allows you to disable that code generation.
-This might be done to reduce the size of a program's
-generated code, or to increase its speed of execution.
-Compile time range-checking is still performed.
-
-@item -fgrant-only
-@itemx -fchill-grant-only
-This option causes the compiler to stop successfully
-after creating the grant file specified by the source
-file (see modular programming in CHILL). No code is
-generated, and many categories of errors are not reported.
-
-@item -fold-string
-Implement the semantics of Chill 1984 with respect to strings:
-String indexing yields a slice of length one; CHAR is similar
-to CHAR(1) (or CHARS(1)); and BOOL is similar to BIT(1) (or BOOLS(1)).
-
-@item -fno-old-string
-Don't implement 1984 Chill string semantics. This is the default.
-
-@item -I@var{seize_path}
-This directive adds the specified seize path to the compiler's
-list of paths to search for seize files. When processing a
-USE_SEIZE_FILE directive, the compiler normally searches for
-the specified seize file only in the current directory. When
-one or more seize paths are specified, the compiler also
-searches in those directories, in the order of their
-specification on the command line, for the seize file.
-
-@item -c
-This C-related switch, which normally prevents gcc from
-attempting to link, is *not* yet implemented by the @code{chill} command,
-but you can use the @code{gcc} command with this flag.
-@end table
-
-@node Missing
-@chapter Implemented and missing parts of the Chill language
-
-The numbers in parentheses are Z.200(1988) section numbers.
-
-@itemize @bullet
-@item The FORBID keyword in a GRANT statement is currently ignored.
-
-@item A CASE action or expression allows only a single expression
-in a case selector list (5.3.2, 6.4).
-
-@item ROW modes are not implemented (3.6.3, 3.13.4).
-
-@item Due to the absence of ROW modes, DYNAMIC has no meaning in
-connection with access and text modes.
-
-@item Array and structure layout (PACK, POS, NOPACK,
-STEP keywords) is ignored (3.12.6).
-
-@item Bit-string slices are not implemented.
-
-@item The support for synchronization modes and concurrent execution
-is slightly non-standard.
-
-@item Exception handling is implemented, but exceptions are not
-generated in all of the required situations.
-
-@item Dynamic modes are not implemented (though string slices should work).
-
-@item Reach-bound initializations are not implemented (4.1.2).
-
-@end itemize
-
-@node Enhancements
-@chapter GNU-specific enhancements to the Chill language
-
-@itemize @bullet
-@item Grantfiles. See @xref{Separate compilation}.
-@item Precisions. Multiple integer and real precisions are supported,
-as well as signed and unsigned variants of the integer modes.
-@item DESCR built-in. The new built-in function
-DESCR ( <descriptor argument> ) returns a pointer to
-STRUCT( addr PTR, length ULONG ) where <descriptor argument> can be
-anything the compiler can handle but at least a location of any mode
-(except synchronizing modes) and any character string or powerset value.
-(A temporary location within the current stack frame may be allocated
-if an expression is used.)
-
-CHILL does not permit the writing of procedures with parameters of
-any type. Yet some interfaces---in particular those to system
-calls---require
-the handling of a wide range of modes, e.g. any string mode, any structure
-mode, or any powerset mode. This could be handled by specifying two
-parameters (PTR, INT for the length) but this is error-prone (no guarantee
-the same location is used after in ADDR and LENGTH), and it will not be
-possible for expressions.
-
-Caveats: This feature permits the programmer to obtain the address of
-a literal (if the compiler takes this shortcut---see 1st example below).
-If hardware features protect constant parts of the program, erronous
-abuse will be detected.
-
- Examples:
- OFFER_HANDLER( descr("dbs"), ->dbs);
-
- SYNMODE m_els = SET( ela, elb, elc );
- SYNMODE m_elsel = POWERSET m_els;
- DCL user_buf STRUCT( a mx, b my, c mz);
- DCL select POWERSET m_elsel;
-
- select := m_elsel[LOWER(m_els) : UPPER(m_els)];
-
- GET_RECORD( relation, recno, descr(user_buf), descr(select) );
-
- PUT_RECORD( relation, recno, descr(user_buf.b), descr(m_elsel[elb]) );
-
-@item LENGTH built-in on left-hand-side. The LENGTH built-in may be
-used on the left-hand-side of an assignment, where its argument is a VARYING
-character string.
-@end itemize
-
-@node Conversions
-@chapter Value and location conversions
-
-Value and location conversions are highly dependent on the target machine.
-They are also very loosely specified in the 1988 standard.
-(The 1992 standard seems an improvement.)
-
-The GNU Chill compiler interprets @code{@var{mode}(@var{exp})} as follows:
-
-@itemize @bullet
-@item
-If @var{exp} is a referable location,
-and the size of (the mode of) @var{exp} is the same as the size of @var{mode},
-a location conversion is used.
-It is implemented exactly as: @code{(@var{refmode}(-> @var{exp}))->},
-where @var{refmode} is a synmode for @code{REF @var{mode}}.
-
-The programmer is responsible for making sure that alignment
-restrictions on machine addresses are not violated.
-
-If both @var{mode} and the mode of @var{exp} are discrete modes,
-alignment should not be a problem, and we get the same conversion
-as a standard value conversion.
-
-@item
-If @var{exp} is a constant,
-and the size of (the mode of) @var{exp} is the same as the size of @var{mode},
-then a value conversion is performed. This conversion is done
-at compile time, and it has not been implemented for all types.
-Specifically, converting to or from a floating-point type is not implemented.
-
-@item
-If both @var{mode} and the mode of @var{exp} are discrete modes,
-then a value conversion is performed, as described in Z.200.
-
-@item
-If both @var{mode} and the mode of @var{exp} are reference modes,
-then a value conversion is allowed.
-The same is true is one mode is a reference mode, and the other
-is an integral mode of the same size.
-
-@end itemize
-
-@node Separate compilation
-@chapter Separate compilation
-
-The GNU CHILL compiler supports modular programming. It
-allows the user to control the visibility of variables
-and modes, outside of a MODULE, by the use of GRANT
-and SEIZE directives. Any location or mode may be made
-visible to another MODULE by GRANTing it in the MODULE
-where it is defined, and SEIZEing it in another MODULE
-which needs to refer to it.
-
-When variables are GRANTed in one or more modules of a
-CHILL source file, the compiler outputs a grant file,
-with the original source file name as the base name,
-and the extension `.grt'. All of the variables and modes
-defined in the source file are written to the grant file,
-together with any use_seize_file directives, and the
-GRANT directives. A grant file is created for every such
-source file, except if an identical grant file already
-exists. This prevents unnecessary makefile activity.
-
-The referencing source file must:
-
-@enumerate
-@item specify the grant file in a use_seize_file directive, and
-@item SEIZE each variable or mode definition that it needs.
-@end enumerate
-
-An attempt to SEIZE a variable or mode which is not
-GRANTed in some seize file is an error.
-
-An attempt to refer to a variable which is defined in
-some seize file, but not explicitly granted, is an
-error.
-
-An attempt to GRANT a variable or mode which is not
-defined in the current MODULE is an error.
-
-Note that the GNU CHILL compiler will *not* write out a
-grant file if:
-
-@itemize @bullet
-@item there are no GRANT directives in the source file, or
-@item the entire grant file already exists, and is
- identical to the file which the compiler has just built.
-(This latter ``feature'' may be removed at some point.)
-@end itemize
-
-Otherwise, a grant file is an automatic, unsuppressable
-result of a successful CHILL compilation.
-
-A future release will also support using remote spec modules
-in a similar (but more Blue Book-conforming) manner.
-
-@node Differences
-@chapter Differences to Z.200/1988
-
-This chapter lists the differences and extensions between GNUCHILL
-and the CCITT recommendation Z.200 in its 1988 version (reffered to
-as Z.200/1988).
-
-@itemize @bullet
-
-@item 2.2 Vocabulary@*
-The definition of @i{<simple name string>} is changed to:
-
-@example
-@i{<simple name string> ::=}
-@example
-@i{@{<letter> | _ @} @{ <letter> | <digit | _ @}}
-@end example
-@end example
-
-@item 2.6 Compiler Directives@*
-Only one directive is allowed between the compiler directive delimiters
-`<>' and `<>' or the end-of-line, i.e.
-@example
-<> USE_SEIZE_FILE "foo.grt" <>
-<> ALL_STATIC_OFF
-@end example
-
-@item 3.3 Modes and Classes@*
-The syntax of @i{<mode>} is changed to:
-
-@example
-@i{<mode> ::=}
-@example
- [@b{READ}] @i{<non-composite-mode>}
-| [@b{READ}] @i{composite-mode>}
-@end example
-
-@i{<non-composite-mode> ::=}
-@example
- @i{<discrete mode>}
-| @i{<real modes>}
-| @i{<powerset modes>}
-| @i{<reference mode>}
-| @i{<procedure mode>}
-| @i{<instance mode>}
-| @i{<synchronization mode>}
-| @i{<timing mode>}
-@end example
-@end example
-
-@item 3.4 Discrete Modes@*
-The list of discrete modes is enhanced by the following modes:
-
-@example
-BYTE 8-bit signed integer
-UBYTE 8-bit unsigned integer
-UINT 16-bit unsigned integer
-LONG 32-bit signed integer
-ULONG 32-bit unsigned integer
-@end example
-
-@strong{Please note} that INT is implemented as 16-bit signed integer.
-
-@item 3.4.6 Range Modes@*
-The mode BIN(n) is not implemented. Using INT(0 : 2 ** n - 1) instead of
-BIN(n) makes this mode unneccessary.
-
-@item 3.X Real Modes@*
-Note: This is an extension to Z.200/1988, however, it is defined in
-Z.200/1992.
-
-@b{syntax:}
-
-@example
-@i{<real mode> ::=}
-@example
-@i{<floating point mode>}
-@end example
-@end example
-
-@b{semantics:}
-
-@example
-A real mode specifies a set of numerical values which approximate a
-contiguous range of real numbers.
-@end example
-
-@item 3.X.1 Floating point modes@*
-
-@b{syntax:}
-
-@example
-@i{<floating point mode> ::=}
-@example
-@i{<floating point mode name}
-@end example
-@end example
-
-@b{predefined names:}
-
-The names @i{REAL} and @i{LONG_REAL} are predefined as @b{floating
-point mode} names.
-
-@b{semantics:}
-
-A floating point mode defines a set of numeric approximations to a
-range of real values, together with their minimum relative accuracy,
-between implementation defined bounds, over which the usual ordering
-and arithmetic operations are defined. This set contains only the
-values which can be represented by the implementation.
-
-@b{examples:}
-
-@example
-@i{REAL}
-@i{LONG_REAL}
-@end example
-
-@item 3.6 Reference Modes@*
-Row modes are not implemeted at all.
-
-@item 3.7 Procedure Mode@*
-The syntax for procedure modes is changed to:
-
-@example
-@i{<procedure mode> ::=}
-@example
- @b{PROC} @i{([<parameter list>]) [ <result spec> ]}
- @i{[}@b{EXCEPTIONS}@i{(<exception list>)] [}@b{RECURSIVE}@i{]}
-| @i{<procedure mode name>}
-@end example
-
-@i{<parameter list> ::=}
-@example
-@i{<parameter spec> @{, <parameter spec> @} *}
-@end example
-
-@i{<parameter spec> ::=}
-@example
-@i{<mode> [ <parameter attribute> ]}
-@end example
-
-@i{<parameter attribute> ::=}
-@example
-@b{IN} | @b{OUT} | @b{INOUT} | @b{LOC}
-@end example
-
-@i{<result spec> ::=}
-@example
-@b{RETURNS} @i{( <mode> [}@b{LOC}@i{])}
-@end example
-
-@i{<exception list> ::=}
-@example
-@i{<exception name> @{, <exception name> @} *}
-@end example
-@end example
-
-
-@item 3.10 Input-Output Modes@*
-Due to the absence of row modes, DYNAMIC has no meaning in an access
-or text mode definition.
-
-
-@item 3.12.2 String Modes@*
-As @i{<string modes>} were defined differently in Z.200/1984, the syntax
-of @i{<string mode>} is changed to:
-
-@example
-@i{<string mode> ::=}
-@example
- @i{<string type> ( <string length> ) [} @b{VARYING} @i{]}
-| @i{<parametrized string mode>}
-| @i{<string mode name>}
-@end example
-
-@i{<parameterized string mode> ::=}
-@example
- @i{<origin string mode name> ( <string length> )}
-| @i{<parameterized string mode name>}
-@end example
-
-@i{<origin string mode name> ::=}
-@example
-@i{<string mode name>}
-@end example
-
-@i{string type}
-@example
- @b{BOOLS}
-| @b{BIT}
-| @b{CHARS}
-| @b{CHAR}
-@end example
-
-@i{<string length> ::=}
-@example
-@i{<integer literal expression>}
-@end example
-@end example
-
-@b{VARYING} is not implemented for @i{<string type>} @b{BIT}
-and @b{BOOL}.
-
-@item 3.11.1 Duration Modes@*
-The predefined mode @i{DURATION} is implemented as a NEWMODE ULONG and
-holds the duration value in miliseconds. This gives a maximum duration
-of
-
-@example
-MILLISECS (UPPER (ULONG)),
-SECS (4294967),
-MINUTES (71582),
-HOURS (1193), and
-DAYS (49).
-@end example
-
-@item 3.11.2 Absolute Time Modes@*
-The predefined mode @i{TIME} is implemented as a NEWMODE ULONG and
-holds the absolute time in seconds since Jan. 1st, 1970. This is
-equivalent to the mode `time_t' defined on different systems.
-
-@item 3.12.4 Structure Modes@*
-Variant fields are allowed, but the CASE-construct may define only one
-tag field (one dimensional CASE). OF course, several variant fields may
-be specified in one STRUCT mode. The tag field will (both at compile-
-and runtime) not be interpreted in any way, however, it must be
-interpreted by a debugger. As a consequence, there are no parameterized
-STRUCT modes.
-
-@item 3.12.5 Layout description for array and structure modes@*
-STEP and POS is not implemeted at all, therefore the syntax of
-@i{<element layout} and @i{field layout} is changed to:
-
-@example
-@i{<element layout> ::=}
-@example
-@b{PACK} | @b{NOPACK}
-@end example
-
-@i{<field layout> ::=}
-@example
-@b{PACK} | @b{NOPACK}
-@end example
-@end example
-
-@item 3.13.4 Dynamic parameterised structure modes@*
-Dynamic parameterised structure modes are not implemented.
-
-@item 4.1.2 Location declaration@*
-The keyword STATIC is allowed, but has no effect at module level, because
-all locations declared there are assumed to be `static' by default. Each
-granted location will become `public'. A `static' declaration inside a
-block, procedure, etc. places the variable in the data section instead of
-the stack section.
-
-@item 4.1.4 Based decleration@*
-The based declaration was taken from Z.200/1984 and has the following
-syntax:
-
-@b{syntax:}
-
-@example
-@i{<based declaration> ::=}
-@example
-@i{<defining occerrence list> <mode>} @b{BASED}
-@i{( <free reference location name> )}
-@end example
-@end example
-
-@b{semantics:}
-
-A based declaration with @i{<free reference location name>} specifies
-as many access names as are defining occerrences in the @i{defining
-occurrence list}. Names declared in a base declaration serve as an
-alternative way accessing a location by dereferencing a reference
-value. This reference value is contained in the location specified by
-the @i{free reference location name}. This dereferencing operation is
-made each time and only when an access is made via a declared @b{based}
-name.
-
-@b{static properties:}
-
-A defining occurrence in a @i{based declaration} with @i{free reference
-location name} defines a @b{based} name. The mode attached to a
-@b{based} name is the @i{mode} specified in the @i{based declaration}. A
-@b{based} name is @b{referable}.
-
-@item 4.2.2 Access names@*
-The syntax of access names is changed to:
-
-@example
-@i{<access name> ::=}
-@example
- @i{<location name>}
-| @i{<loc-identity name>}
-| @i{<based name>}
-| @i{<location enumeration name>}
-| @i{<location do-with name>}
-@end example
-@end example
-
-The semantics, static properties and dynamic conditions remain
-unchanged except that they are enhanced by @i{base name}.
-
-@item 5.2.4.1 Literals General@*
-The syntax of @i{<literal>} is change to:
-
-@example
-@i{<literal> ::=}
-@example
- @i{<integer literal>}
-| @i{<boolean literal>}
-| @i{<charater literal>}
-| @i{<set literal>}
-| @i{<emptiness literal>}
-| @i{<character string literal>}
-| @i{<bit string literal>}
-| @i{<floating point literal>}
-@end example
-@end example
-
-Note: The @i{<floating point literal>} is an extension to Z.200/1988 and
-will be described later on.
-
-@item 5.2.4.2 Integer literals@*
-The @i{<decimal integer literal>} is changed to:
-
-@example
-@i{<decimal integer literal> ::=}
-@example
- @i{@{ D | d @} ' @{ <digit> | _ @} +}
-| @i{<digit> @{ <digit> | _ @} *}
-@end example
-@end example
-
-@item 5.2.4.4 Character literals@*
-A character literal, e.g. 'M', may serve as a charater string literal of
-length 1.
-
-@item 5.2.4.7 Character string literals@*
-The syntax of a character string literal is:
-
-@example
-@i{<character string literal> ::=}
-@example
- @i{'@{ <non-reserved character> | <single quote> |}
- @i{<control sequence> @} * '}
-| @i{'@{ <non-reserved character> | <double quote> |}
- @i{<control sequence> @} * '}
-@end example
-
-@i{<single quote> ::=}
-@example
-@i{''}
-@end example
-
-@i{<double quote> ::=}
-@example
-@i{""}
-@end example
-@end example
-
-A character string litaral of length 1, enclosed in apostrophes
-(e.g. 'M') may also serve as a charater literal.
-
-@item 5.2.4.9 Floating point literal@*
-Note: This is an extension to Z.200/1988 ans was taken from Z.200/1992.
-
-@b{syntax:}
-
-@example
-@i{<floating point literal> ::=}
-@example
- @i{<unsigned floating point literal>}
-| @i{<signed floating point literal>}
-@end example
-
-@i{<unsigned floating point literal> ::=}
-@example
- @i{<digit sequence> . [ <digit sequence> ] [ <exponent> ]}
-| @i{[ <digit sequence> ] . <digit sequence> [ <exponent> ]}
-@end example
-
-@i{<signed floating point literal> ::=}
-@example
-@i{- <unsigned floating point literal>}
-@end example
-
-@i{<digit sequence> ::=}
-@example
-@i{<digit> @{ <digit> | _ @} *}
-@end example
-
-@i{<exponent> ::=}
-@example
- @i{[ E | D | e | d ] <digit sequence>}
-| @i{[ E | D | e | d ] - <digit sequence>}
-@end example
-@end example
-
-@item 5.2.14 Start Expression@*
-The START expression is not implemented.
-
-@item 5.3 Values and Expressions@*
-The undefined value, denoted by `*', is not implemented.
-
-@item 5.3.8 Operand-5@*
-The @i{<string repetition operator>} is defined as:
-
-@example
-@i{<string repetition operator> ::=}
-@example
-@i{(<integer expression>)}
-@end example
-@end example
-
-@item 6.4 Case Action@*
-There may be only one case selector specified. The optional range list
-must not be specified.
-
-@item 6.5 Do Action@*
-A Do-Action without control part is not implemented. Grouping of
-statements can be achieved via BEGIN and END. A location enumeration is not
-allowed for BIT strings, only for (varying) CHAR strings and ARRAYs.
-
-The expression list in a DO WITH must consist of locations only.
-
-@item 6.13 Start Action@*
-The syntax of the START action is changed to:
-
-@example
-@i{<start action> ::=}
-@example
-@b{START} @i{<process name> (<copy number> [, <actual parameter list>])}
-@i{[} @b{SET} @i{<instance location> ]}
-@end example
-
-@i{<copy number> ::=}
-@example
-@i{<integer expression>}
-@end example
-@end example
-
-@item 6.16 Delay Action@*
-The optional PRIORITY specification need not be a constant.
-
-@item 6.17 Delay Case Action@*
-The optional SET branch and the, also optional, PRIORITY branch must be
-separated by `;'.
-
-@item 6.18 Send Action@*
-The send action must define a destination instance (via the TO branch),
-since undirected signals are not supported. The optional PRIORITY
-specification need not be a constant. Additional to the data
-transported by the signal, there will be a user defined argument.
-
-The syntax of the @i{<send signal action>} is therefore:
-
-@example
-@i{<send signal action> ::=}
-@example
-@b{SEND} @i{<signal name> [ ( <value> @{, <value> @} * ) ]}
-@i{[} @b{WITH} @i{<expression> ]}
-@b{TO} @i{<instance primitive value> [ <priority> ]}
-@end example
-@end example
-
-The default priority can be specified by the compiler directive
-SEND_SIGNAL_DEFAULT_PRIORITY. If this also is omitted, the default
-priority is 0.
-
-@item 6.20.3 CHILL value built-in calls@*
-The CHILL value buit-in calls are enhanced by some calls, and other calls
-will have different arguments as described in Z.200/1988. Any call not
-mentioned here is the same as described in Z.200/1988.
-
-@b{syntax:}
-
-@example
-@i{CHILL value built-in routine call> ::=}
-@example
- @i{ADDR (<location>)}
-| @i{PRED (<pred succ argument>)}
-| @i{SUCC (<pred succ argument>)}
-| @i{ABS (<numeric expression>)}
-| @i{LENGTH (<length argument>)}
-| @i{SIN (<floating point expression>)}
-| @i{COS (<floating point expression>)}
-| @i{TAN (<floating point expression>)}
-| @i{ARCSIN (<floating point expression>)}
-| @i{ARCCOS (<floating point expression>)}
-| @i{ARCTAN (<floating point expression>)}
-| @i{EXP (<floating point expression>)}
-| @i{LN (<floating point expression>)}
-| @i{LOG (<floating point expression>)}
-| @i{SQRT (<floating point expression>)}
-| @i{QUEUE_LENGTH (<buffer location> | <event location>)}
-| @i{GEN_INST (<integer expression> | <process name> ,}
- @i{<integer expression>)}
-| @i{COPY_NUMBER (<instance expression>)}
-| @i{GEN_PTYE (<process name>)}
-| @i{PROC_TYPE (<instance expression>)}
-| @i{GEN_CODE (<process name> | <signal name>)}
-| @i{DESCR (<location>)}
-@end example
-
-@i{<pred succ argument> ::=}
-@example
- @i{<discrete expression>}
-| @i{<bound reference expression>}
-@end example
-
-@i{<numeric expression> ::=}
-@example
- @i{<integer expression>}
-| @i{floating point expression>}
-@end example
-
-@i{<length argument> ::=}
-@example
- @i{<string location>}
-| @i{<string expression>}
-| @i{<string mode name>}
-| @i{<event location>}
-| @i{<event mode name>}
-| @i{<buffer location>}
-| @i{<buffer mode name>}
-| @i{<text location>}
-| @i{<text mode name>}
-@end example
-@end example
-
-@b{semantics:}
-
-@i{ADDR} is derived syntax for -> @i{<location>}.
-
-@i{PRED} and @i{SUCC} delivers respectively, in case of a @i{discrete
-expression}, the next lower or higher discrete value of their argument,
-in case of @i{bound reference expression} these built-in calls deliver a
-pointer to the previous or next element.
-
-@i{ABS} is defined on numeric values, i.e. integer values and floating
-point values, delivering the corresponding absolute value.
-
-@i{LENGTH} is defined on
-
-@itemize @bullet
-
-@item string and text locations and string expressions, delivering the
-length of them;
-
-@item event locations, delivering the @b{event length} of the mode of the
-location;
-
-@item buffer locations, delivering the @b{buffer length} of the mode of
-the location;
-
-@item string mode names, delivering the @b{string length} of the mode;
-
-@item text mode names, delivering the @b{text length} of the mode;
-
-@item buffer mode names, delivering the @b{buffer length} of the mode;
-
-@item event mode names, delivering the @b{event length} of the mode;
-
-@item Additionally, @i{LENGTH} also may be used on the left hand
-side of an assignment to set a new length of a @i{varying character
-string location}. However, to avoid undefined elements in the varying
-string, the new length may only be less or equal to the current length.
-Otherwise a @b{RANGEFAIL} exception will be generated.
-@end itemize
-
-@i{SIN} delivers the sine of its argument (interpreted in radians).
-
-@i{COS} delivers the cosine of its argument (interpreted in radians).
-
-@i{TAN} delivers the tangent of its argument (interpreted in radians).
-
-@i{ARCSIN} delivers the sin -1 function of its argument.
-
-@i{ARCCOS} delivers the cos -1 function of its argument.
-
-@i{ARCTAN} delivers the tan -1 function of its argument.
-
-@i{EXP} delivers the exponential function, where x is the argument.
-
-@i{LN} delivers the natural logarithm of its argument.
-
-@i{LOG} delivers the base 10 logarithm of its argument.
-
-@i{SQRT} delivers the sqare root of its argument.
-
-@i{QUEUE_LENGTH} delivers either the number of sending delayed processes
-plus the number of messages in a buffer queue (if the argument is a
-@i{buffer location}), or the number of delayed processes (if the
-argument specifies an @i{event location}) as @i{integer expression}.
-
-@i{GEN_INST} delivers an @i{instance expression} constructed from the
-arguments. Both arguments must have the @i{&INT}-derived class.
-
-@i{COPY_NUMBER} delivers as @i{&INT}-derived class the copy number of an
-@i{instance location}.
-
-@i{GEN_PTYPE} delivers as @i{&INT}-derived class the associated number
-of the @i{process name}.
-
-@i{PROC_TYPE} delivers as @i{&INT}-derived class the process type of an
-@i{instance expression}.
-
-@i{GEN_CODE} delivers as @i{&INT}-derived class the associated number of
-the @i{process name} or @i{signal name}.
-
-@i{DESCR} delivers a @i{free reference expression} pointing to a
-structure with the following layout describing the @i{location} argument.
-
-@example
-SYNMODE __tmp_descr = STRUCT (p PTR, l ULONG);
-@end example
-
-
-@item 7.4.2 Associating an outside world object@*
-The syntax of the associate built-in routine call is defined as:
-
-@example
-@i{<associate built-in routine call> ::=}
-@example
-@i{ASSOCIATE ( <association location>, <string expression>,} [@i{, <string expression>} ] @i{)}
-@end example
-@end example
-
-The ASSOCIATE call has two parameters besides the association location:
-a pathname and an optional mode string.
-
-The value of the first string expression must be a pathname according to
-the rules of the underlying operating system. (Note that a relative pathname
-implies a name relative to the working directory of the process.)
-
-The mode string may contain the value "VARIABLE", which requests
-an external representation of records consisting of an UINT record
-length followed by as many bytes of data as indicated by the length field.
-Such a file with variable records is not indexable.
-
-A file with variable records can be written using any record mode. If the
-record mode is CHARS(n) VARYING, the record length is equal to the actual
-length of the value written. (Different record may have differing lengths.)
-With all other record modes, all records written using the same access mode
-will have the same length, but will still be prefixed with the length field.
-(Note that by re-connecting with different access modes, the external
-representation may ultimately contain records with differing lengths.)
-
-A file with variable records can only be read by using a record mode of
-CHARS(n) VARYING.
-
-
-@item 7.4.2 Accessing association attributes@*
-The value of the READABLE and WRITEABLE attributes is determined using
-the file status call provided by the operating system. The result will
-depend on the device being accessed, or on the file mode.
-
-The INDEXABLE attribute has the value false for files with variable records,
-and for files associated with devices not supporting random positioning
-(character devices, FIFO special files, etc.).
-
-The variable attribute is true for files associated with the mode sting
-"VARIABLE", and false otherwise.
-
-
-@item 7.4.5 Modifying association attributes@*
-The syntax of the MODIFY built-in routine call is defined as:
-
-@example
-@i{<modify built-in call> ::=}
-@example
-@i{MODIFY ( <association location>, <string expression> )}
-@end example
-@end example
-
-At present, MODIFY accepts a character string containing a pathname
-in addition to the association location, which will cause a renaming
-of the associated file.
-
-
-@item 7.4.9 Data transfer operations@*
-READRECORD will fail (causing READFAIL) if the number of bytes from the
-current position in the file to the end of the file is greater than zero
-but less than the size of the record mode, and no data will be transferred.
-(If the number of bytes is zero, no error occurs and OUTOFFILE will
-return TRUE.)
-
-The number of bytes transferred by READRECORD and WRITERECORD is equal to
-the size of the record mode of the access location. Note that the
-internal representation of this mode may vary depending on the
-record mode being packed or not.
-
-
-@item 7.5 Text Input Output@*
-Sequential text files will be represented so as to be compatible
-with the standard representation of texts on the underlying operating
-system, where control characters are used to delimit text records on files
-as well as to control the movement of a cursor or printing head on a device.
-
-For indexed text files, records of a uniform length (i.e. the size of the
-text record, including the length field) are written. All i/o codes cause
-an i/o transfer without any carriage control characters being added to the
-record, which will be expanded with spaces.
-
-An indexed text file is therefore not compatible with the standard
-text representation of the underlying operating system.
-
-
-
-@item 7.5.3 Text transfer operations@*
-The syntax of @i{<text argument>} is changed to:
-
-@example
-@i{<text argument> ::=}
-@example
- @i{<text location>}
-| @i{<predefined text location>}
-| @i{<varying string location>}
-@end example
-
-@i{<predefined text location> ::=}
-@example
- STDIN
-| STDOUT
-| STDERR
-@end example
-@end example
-
-NOTE: The identifiers STDIN, STDOUT, and STDERR are predefined.
-Association and connection with files or devices is done according to
-operating system rules.
-
-The effect of using READTEXT or WRITETEXT with a character string location
-as a text argument (i.e. the first parameter) where the same location also
-appears in the i/o list is undefined.
-
-The current implementation of formatting assumes run-to-completion semantics
-of CHILL tasks within an image.
-
-
-
-@item 7.5.5 Conversion@*
-Due to the implementation of @i{<floating point modes>} the syntax
-is changed to:
-
-@example
-@i{<conversion clause> ::=}
-@example
-@i{<conversion code> @{ <conversion qualifier @} *}
-@i{[ <clause width> ]}
-@end example
-
-@i{<conversion code> ::=}
-@example
-@i{B} | @i{O} | @i{H} | @i{C} | @i{F}
-@end example
-
-@i{<conversion qualifier> ::=}
-@example
-@i{L} | @i{E} | @i{P<character>}
-@end example
-
-@i{<clause width> ::=}
-@example
- @i{@{ <digit> @} +} | @i{V}
-| @i{<real clause width>}
-@end example
-
-@i{<real clause width> ::=}
-@example
-@i{@{ @{ <digit> + | V @} : @{ @{ <digit> @} + | V @}}
-@end example
-@end example
-
-Note: The @i{<real clause width>} is only valid for @i{<conversion
-code>} `C' or `F'.
-
-
-@item 7.5.7 I/O control@*
-To achieve compatibility of text files written with CHILL i/o with
-the standard representation of text on the underlying operating system
-the interpretation of the i/o control clause of the format
-deviates from Z.200. The following table shows the i/o codes together
-with the control characters written before and after the text record,
-to achieve the indicated function:
-@table @samp
-@item /
-Write next record (record, line feed)
-
-@item +
-Write record on next page (form feed, record, line feed)
-
-@item -
-Write record on current line (record, carriage return)
-
-@item ?
-Write record as a prompt (carriage return, record)
-
-@item !
-Emit record (record).
-
-@item =
-Force new page for the next line: The control character written before
-the next record will be form feed, irrespective of the i/o control used for
-transferring the record.
-@end table
-
-When reading a text file containing control characters other than line feed,
-these characters have to be reckoned with by the format used to read the
-text records.
-
-
-
-
-@item 11.2.2 Regionality@*
-Regionality is not implemented at all, so there is no difference in the
-generated code when REGION is substituted by MODULE in a GNUCHILL
-compilation unit.
-
-@item 11.5 Signal definition statement@*
-The @i{<signal definition statement>} may only occur at module level.
-
-@item 12.3 Case Selection@*
-The syntax of @i{<case label specification>} is changed to:
-
-@example
-@i{<case label specification> ::=}
-@example
-@i{( <case label> @{, <case label> @} * )}
-@end example
-
-@i{<case label> ::=}
-@example
- @i{<discrete literal expression>}
-| @i{<literal range>}
-| @i{<discrete mode name>}
-| @b{ELSE}
-@end example
-@end example
-
-@end itemize
-
-@node Directives
-@chapter Compiler Directives
-
-@itemize @bullet
-
-@item ALL_STATIC_ON, ALL_STATIC_OFF@*
-These directives control where procedure local variables are
-allocated. ALL_STATIC_ON turns allocation of procedure local variables
-in the data space ON, regardless of the keyword STATIC being used or not.
-ALL_STATIC_OFF places procedure local variables in the stack space.
-The default is ALL_STATIC_OFF.
-
-@item RANGE_ON, RANGE_OFF@*
-Turns generation of rangecheck code ON and OFF.
-
-@item USE_SEIZE_FILE <character string literal>@*
-Specify the filename (as a character string literal) where
-subsequent SEIZE statements are related to. This directive
-and the subsequent SEIZEs are written
-to a possibly generated grant file for this module.
-
-@example
-<> USE_SEIZE_FILE "foo.grt" <>
-SEIZE bar;
-@end example
-
-@item USE_SEIZE_FILE_RESTRICTED "filename"@*
-Same as USE_SEIZE_FILE. The difference is that this directive
-and subsequent SEIZEs are *not* written to a possibly generated
-grant file.
-
-@item PROCESS_TYPE = <integer expression>@*
-Set start value for all PROCESS delclarations. This value automatically
-gets incremented after each PROCESS declaration and may be changed with
-a new PROCESS_TYPE compiler directive.
-
-@item SIGNAL_CODE = <integer expression>@*
-Set start value for all SIGNAL definitions. This value automatically
-gets incremented after each SIGNAL definition and may be changed with a
-new SIGNAL_CODE compiler directive.
-
-@item SEND_SIGNAL_DEFAULT_PRIORITY = <integer expression>@*
-Set default priority for send signal action.
-
-@item SEND_BUFFER_DEFAULT_PRIORITY = <integer expression>@*
-Set default priority for send buffer action.
-
-Note: Every <integer expression> in the above mentioned compiler
-directives may also be specified by a SYNONYM of an integer type.
-
-@example
-SYN first_signal_code = 10;
-<> SIGNAL_CODE = first_signal_code <>
-SIGNAL s1;
-@end example
-
-@end itemize
-
-@node References
-@chapter Language Definition References
-
-@itemize @bullet
-@item CCITT High Level Language (CHILL) Recommendation Z.200
- ISO/IEC 9496, Geneva 1989 ISBN 92-61-03801-8
-
-@item An Analytic Description of CHILL, the CCITT high-level
- language, Branquart, Louis & Wodon, Springer-Verlag 1981
- ISBN 3-540-11196-4
-
-@item CHILL User's Manual
- CCITT, Geneva 1986 ISBN 92-61-02601-X
-
-@item Introduction to CHILL
- CCITT, Geneva 1983 ISBN 92-61-017771-1
-
-@item CHILL CCITT High Level Language
- Proceedings of the 5th CHILL Conference
- North-Holland, 1991 ISBN 0 444 88904 3
-
-@item Introduction to the CHILL programming Language
- TELEBRAS, Campinas, Brazil 1990
-
-@end itemize
-
-Z.200 is mostly a language-lawyer's document, but more readable
-than most. The User's Guide is more readable by far, but doesn't
-cover the whole language. Our copies of these documents came through
-Global Engineering Documents, in Irvine, CA, USA. (714)261-1455.
-
-@contents
-@bye
diff --git a/gcc/ch/config-lang.in b/gcc/ch/config-lang.in
deleted file mode 100644
index b0bd9293e29..00000000000
--- a/gcc/ch/config-lang.in
+++ /dev/null
@@ -1,41 +0,0 @@
-# Top level configure fragment for GNU CHILL.
-# Copyright (C) 1994, 2000 Free Software Foundation, Inc.
-
-#This file is part of GNU CC.
-
-#GNU CC is free software; you can redistribute it and/or modify
-#it under the terms of the GNU General Public License as published by
-#the Free Software Foundation; either version 2, or (at your option)
-#any later version.
-
-#GNU CC is distributed in the hope that it will be useful,
-#but WITHOUT ANY WARRANTY; without even the implied warranty of
-#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-#GNU General Public License for more details.
-
-#You should have received a copy of the GNU General Public License
-#along with GNU CC; see the file COPYING. If not, write to
-#the Free Software Foundation, 59 Temple Place - Suite 330,
-#Boston, MA 02111-1307, USA. */
-
-# Configure looks for the existence of this file to auto-config each language.
-# We define several parameters used by configure:
-#
-# language - name of language as it would appear in $(LANGUAGES)
-# compilers - value to add to $(COMPILERS)
-# stagestuff - files to add to $(STAGESTUFF)
-# diff_excludes - files to ignore when building diffs between two versions.
-
-language="CHILL"
-
-compilers="cc1chill\$(exeext)"
-
-stagestuff="chill chill-cross\$(exeext) cc1chill\$(exeext)"
-
-diff_excludes="-x -x ch/chill.info*"
-
-outputs=ch/Makefile
-
-target_libs=target-libchill
-
-build_by_default=no
diff --git a/gcc/ch/configure b/gcc/ch/configure
deleted file mode 100755
index fd1b50ddbdf..00000000000
--- a/gcc/ch/configure
+++ /dev/null
@@ -1,635 +0,0 @@
-#!/bin/sh
-# Configuration script for GNU CHILL
-# Copyright (C) 1994 Free Software Foundation, Inc.
-
-#This file is part of GNU CC.
-
-#GNU CC is free software; you can redistribute it and/or modify
-#it under the terms of the GNU General Public License as published by
-#the Free Software Foundation; either version 2, or (at your option)
-#any later version.
-
-#GNU CC is distributed in the hope that it will be useful,
-#but WITHOUT ANY WARRANTY; without even the implied warranty of
-#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-#GNU General Public License for more details.
-
-#You should have received a copy of the GNU General Public License
-#along with GNU CC; see the file COPYING. If not, write to
-#the Free Software Foundation, 59 Temple Place - Suite 330,
-#Boston, MA 02111-1307, USA. */
-
-#
-# Shell script to create proper links to machine-dependent files in
-# preparation for compiling gcc.
-#
-# Options: --srcdir=DIR specifies directory where sources are.
-# --host=HOST specifies host configuration.
-# --target=TARGET specifies target configuration.
-# --build=TARGET specifies configuration of machine you are
-# using to compile GCC.
-# --prefix=DIR specifies directory to install in.
-# --local-prefix=DIR specifies directory to put local ./include in.
-# --exec-prefix=DIR specifies directory to install executables in.
-# --with-gnu-ld arrange to work with GNU ld.
-# --with-gnu-as arrange to work with GAS.
-# --with-stabs arrange to use stabs instead of host debug format.
-# --with-elf arrange to use elf instead of host debug format.
-# --nfp assume system has no FPU.
-#
-# If configure succeeds, it leaves its status in config.status.
-# If configure fails after disturbing the status quo,
-# config.status is removed.
-#
-
-progname=$0
-# Configure the runtime and regression-test directories
-SUBDIRS="runtime utils"
-SUBDIRS="$SUBDIRS testsuite/compile"
-SUBDIRS="$SUBDIRS testsuite/execute"
-SUBDIRS="$SUBDIRS testsuite/execute/telebras"
-SUBDIRS="$SUBDIRS testsuite/noncompile"
-SUBDIRS="$SUBDIRS testsuite/examples"
-SUBDIRS="$SUBDIRS testsuite/execute/oe"
-SUBDIRS="$SUBDIRS testsuite/compile/elektra"
-SUBDIRS="$SUBDIRS testsuite/compile/votrics"
-
-# Default --srcdir to the directory where the script is found,
-# if a directory was specified.
-# The second sed call is to convert `.//configure' to `./configure'.
-srcdir=`echo $0 | sed 's|//|/|' | sed 's|/[^/]*$||'`
-if [ x$srcdir = x$0 ]
-then
-srcdir=
-fi
-
-host=
-
-# Default prefix to /usr/local.
-prefix=/usr/local
-
-# local_prefix specifies where to find the directory /usr/local/include
-# We don't use $(prefix) for this
-# because we always want GCC to search /usr/local/include
-# even if GCC is installed somewhere other than /usr/local.
-# Think THREE TIMES before specifying any other value for this!
-# DO NOT make this use $prefix!
-local_prefix=/usr/local
-# For our purposes, this must be prefix. This is apparently
-# only done for the benefit of glibc, and we don't use glibc.
-local_prefix='$(prefix)'
-# Default is to let the Makefile set exec_prefix from $(prefix)
-exec_prefix='$(prefix)'
-
-program_transform_name=
-program_transform_set=
-site=
-
-remove=rm
-hard_link=ln
-symbolic_link='ln -s'
-copy=cp
-
-# Record all the arguments, to write them in config.status.
-arguments=$*
-
-#for Test
-#remove="echo rm"
-#hard_link="echo ln"
-#symbolic_link="echo ln -s"
-
-target=
-host=
-build=
-
-for arg in $*;
-do
- case $next_arg in
- --srcdir)
- srcdir=$arg
- next_arg=
- ;;
- --host)
- host=$arg
- next_arg=
- ;;
- --target)
- target=$arg
- next_arg=
- ;;
- --build)
- build=$arg
- next_arg=
- ;;
- --prefix)
- prefix=$arg
- next_arg=
- ;;
- --local-prefix)
- local_prefix=$arg
- next_arg=
- ;;
- --exec-prefix)
- exec_prefix=$arg
- next_arg=
- ;;
- --program-transform-name)
- # Double any backslashes or dollar signs in the argument.
- if [ -n "${arg}" ] ; then
- program_transform_name="${program_transform_name} -e `echo ${arg} | sed -e 's/\\\\/\\\\\\\\/g' -e 's/\\\$/$$/g'`"
- fi
- program_transform_set=yes
- next_arg=
- ;;
- --program-prefix)
- if [ -n "${arg}" ]; then
- program_transform_name="${program_transform_name} -e s,^,`echo ${arg} | sed -e 's/\\\\/\\\\\\\\/g' -e 's/\\\$/$$/g'`,"
- fi
- program_transform_set=yes
- next_arg=
- ;;
- --program-suffix)
- if [ -n "${arg}" ]; then
- program_transform_name="${program_transform_name} -e s,\$\$,`echo ${arg} | sed -e 's/\\\\/\\\\\\\\/g' -e 's/\\\$/$$/g'`,"
- fi
- program_transform_set=yes
- next_arg=
- ;;
- --site)
- site=${arg}
- next_arg=
- ;;
- --x-*)
- next_arg=
- ;;
- *)
- case $arg in
- -srcdir | --srcdir | --srcdi | --srcd | --src | --sr | --s)
- next_arg=--srcdir
- ;;
- -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=* | --s=*)
- srcdir=`echo $arg | sed 's/-*s[a-z]*=//'`
- ;;
- -host | --host | --hos | --ho | --h)
- next_arg=--host
- ;;
- -host=* | --host=* | --hos=* | --ho=* | --h=*)
- host=`echo $arg | sed 's/-*h[a-z]*=//'`
- ;;
- -target | --target | --targe | --targ | --tar | --ta | --t)
- next_arg=--target
- ;;
- -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
- target=`echo $arg | sed 's/-*t[a-z]*=//'`
- ;;
- -build | --build | --buil | --bui | --bu | --b)
- next_arg=--build
- ;;
- -build=* | --build=* | --buil=* | --bui=* | --bu=* | --b=*)
- build=`echo $arg | sed 's/-*b[a-z]*=//'`
- ;;
- -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
- next_arg=--prefix
- ;;
- -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
- prefix=`echo $arg | sed 's/-*p[a-z]*=//'`
- ;;
- -local-prefix | --local-prefix | --local-prefi | --local-pref | --local-pre \
- | --local-pr | --local-p | --local- | --local | --loc | --lo | --l)
- next_arg=--local-prefix
- ;;
- -local-prefix=* | --local-prefix=* | --local-prefi=* | --local-pref=* \
- | --local-pre=* | --local-pr=* | --local-p=* | --local-=* | --local=* \
- | --loc=* | --lo=* | --l=*)
- local_prefix=`echo $arg | sed 's/-*l[-a-z]*=//'`
- ;;
- -exec-prefix | --exec-prefix | --exec-prefi | --exec-pref | --exec-pre \
- | --exec-pr | --exec-p | --exec- | --exec | --exe | --ex | --e)
- next_arg=--exec-prefix
- ;;
- -exec-prefix=* | --exec-prefix=* | --exec-prefi=* | --exec-pref=* \
- | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* | --exec=* \
- | --exe=* | --ex=* | --e=*)
- exec_prefix=`echo $arg | sed 's/-*e[-a-z]*=//'`
- ;;
- -program-transform-name | --program-transform-name \
- | --program-transform-nam | --program-transform-na \
- | --program-transform-n | --program-transform- | --program-transform \
- | --program-transfor | --program-transfo | --program-transf \
- | --program-trans | --program-tran | --program-tra \
- | --program-tr | --program-t)
- next_arg=--program-transform-name
- ;;
- -program-transform-name=* | --program-transform-name=* \
- | --program-transform-nam=* | --program-transform-na=* \
- | --program-transform-n=* | --program-transform-=* \
- | --program-transform=* | --program-transfor=* | --program-transfo=* \
- | --program-transf=* | --program-trans=* | --program-tran=* \
- | --program-tra=* | --program-tr=* | --program-t=*)
- arg=`echo ${arg} | sed -e 's/^[-a-z_]*=//'`
- # Double any \ or $ in the argument.
- if [ -n "${arg}" ] ; then
- program_transform_name="${program_transform_name} -e `echo ${arg} | sed -e 's/\\\\/\\\\\\\\/g' -e 's/\\\$/$$/g'`"
- fi
- program_transform_set=yes
- ;;
- -program-prefix | --program-prefix | --program-prefi \
- | --program-pref | --program-pre | --program-pr \
- | --program-p)
- next_arg=--program-prefix
- ;;
- -program-prefix=* | --program-prefix=* | --program-prefi=* \
- | --program-pref=* | --program-pre=* | --program-pr=* \
- | --program-p=*)
- arg=`echo ${arg} | sed -e 's/^[-a-z_]*=//'`
- if [ -n "${arg}" ]; then
- program_transform_name="${program_transform_name} -e s,^,`echo ${arg} | sed -e 's/\\\\/\\\\\\\\/g' -e 's/\\\$/$$/g'`,"
- fi
- program_transform_set=yes
- ;;
- -program-suffix | --program-suffix | --program-suffi \
- | --program-suff | --program-suf | --program-su \
- | --program-s)
- next_arg=--program-suffix
- ;;
- -program-suffix=* | --program-suffix=* | --program-suffi=* \
- | --program-suff=* | --program-suf=* | --program-su=* \
- | --program-s=*)
- arg=`echo ${arg} | sed -e 's/^[-a-z_]*=//'`
- if [ -n "${arg}" ]; then
- program_transform_name="${program_transform_name} -e s,\$\$,`echo ${arg} | sed -e 's/\\\\/\\\\\\\\/g' -e 's/\\\$/$$/g'`,"
- fi
- program_transform_set=yes
- ;;
- -site | --site | --sit)
- next_arg=--site
- ;;
- -site=* | --site=* | --sit=* | --si=*)
- site=`echo ${arg} | sed 's/^[-a-z]*=//'`
- ;;
- -with-gnu-ld | --with-gnu-ld | --with-gnu-l)
- gnu_ld=yes
- ;;
- -gas | --gas | --ga | --g | -with-gnu-as | --with-gnu-as | -with-gnu-a)
- gas=yes
- ;;
- -nfp | --nfp | --nf | --n)
- nfp=yes
- ;;
- -with-stabs | -with-stab | -with-sta | -with-st | -with-s \
- | --with-stabs | --with-stab | --with-sta | --with-st | --with-s \
- | -stabs | -stab | -sta | -st \
- | --stabs | --stab | --sta | --st)
- stabs=yes
- ;;
- -with-elf | -with-el | -with-se \
- | --with-elf | --with-el | --with-e \
- | -elf | -el | -e \
- |--elf | --el | --e)
- elf=yes
- ;;
- -with-* | --with-*) ;; #ignored
- -without-* | --without-*) ;; #ignored
- -enable-* | --enable-*) ;; #ignored
- -x | --x) ;; # ignored
- -x-*=* | --x-*=*) ;; # ignored
- -x-* | --x-*)
- next_arg=--x-ignored # ignored
- ;;
- --he*) ;; # ignored for now (--help)
- --vers*) ;; # ignored for now (--version)
- -v | -verb* | --verb*) ;; # ignored for now (--verbose)
- --program-*) ;; #ignored (--program-prefix, --program-suffix)
- --c*) ;; #ignored (--cache-file)
- --q*) ;; #ignored (--quiet)
- --si*) ;; #ignored (--silent)
- -*)
- echo "Invalid option \`$arg'" 1>&2
- exit 1
- ;;
- *)
-# Allow configure HOST TARGET
- if [ x$host = x ]
- then
- host=$target
- fi
- target=$arg
- ;;
- esac
- esac
-done
-
-# Find the source files, if location was not specified.
-if [ x$srcdir = x ]
-then
- srcdirdefaulted=1
- srcdir=.
- if [ ! -r tree.c ]
- then
- srcdir=..
- fi
-fi
-
-if [ ! -r ${srcdir}/grant.c ]
-then
- if [ x$srcdirdefaulted = x ]
- then
- echo "$progname: Can't find CHILL frontend sources in \`${srcdir}'" 1>&2
- else
- echo "$progname: Can't find CHILL frontend sources in \`.' or \`..'" 1>&2
- fi
- exit 1
-fi
-
-# Make sure that scripts are executable
-[ -w ${srcdir} -a -f ${srcdir}/regression.sh ] && \
- chmod +x ${srcdir}/regression.sh
-[ -w ${srcdir} -a -f ${srcdir}/regression.prpt ] && \
- chmod +x ${srcdir}/regression.prpt
-[ -w ${srcdir} -a -f ${srcdir}/regression.awk3 ] && \
- chmod +x ${srcdir}/regression.awk3
-
-if [ -r ${srcdir}/config.status ] && [ x$srcdir != x. ]
-then
- echo "$progname: \`configure' has been run in \`${srcdir}'" 1>&2
- exit 1
-fi
-
-host_xmake_file=
-host_truncate_target=
-
-# Complain if an arg is missing
-if [ x$build = x ]
-then
- # If host was specified, always use it for build also to avoid
- # confusion. If someone wants a cross compiler where build != host,
- # then they must specify build explicitly. Since this case is
- # extremely rare, it does not matter that it is slightly inconvenient.
- if [ x$host != x ]
- then
- build=$host
-
- # This way of testing the result of a command substitution is
- # defined by Posix.2 (section 3.9.1) as well as traditional shells.
- elif build=`${srcdir}/../config.guess`
- then
- echo "This appears to be a ${build} system." 1>&2
-
- elif [ x$target != x ]
- then
- echo 'Config.guess failed to determine the host type. Defaulting to target.'
- build=$target
- else
- echo 'Config.guess failed to determine the host type. You need to specify one.' 1>&2
- echo "\
-Usage: `basename $progname` [--host=HOST] [--build=BUILD]
- [--prefix=DIR] [--gxx-include-dir=DIR] [--local-pref=DIR] [--exec-pref=DIR]
- [--with-gnu-as] [--with-gnu-ld] [--with-stabs] [--with-elf] [--nfp] TARGET" 1>&2
- echo "Where HOST, TARGET and BUILD are three-part configuration names " 1>&2
- if [ -r config.status ]
- then
- tail +2 config.status 1>&2
- fi
- exit 1
- fi
-fi
-
-# If $host was not specified, use $build.
-if [ x$host = x ]
-then
- host=$build
-fi
-
-# If $target was not specified, use $host.
-if [ x$target = x ]
-then
- target=$host
-fi
-
-# Validate the specs, and canonicalize them.
-canon_build=`/bin/sh $srcdir/../config.sub $build` || exit 1
-canon_host=`/bin/sh $srcdir/../config.sub $host` || exit 1
-canon_target=`/bin/sh $srcdir/../config.sub $target` || exit 1
-
-rm -f config.bak
-if [ -f config.status ]; then mv -f config.status config.bak; fi
-
-#
-# For the current directory and all of the designated SUBDIRS,
-# do the rest of the script...
-#
-if [ ! -d testsuite ] ; then mkdir testsuite; fi
-_SUBDIRS=
-for d in $SUBDIRS; do
- [ -d $srcdir/$d ] && _SUBDIRS="$_SUBDIRS $d"
-done
-
-savesrcdir=$srcdir
-STARTDIR=`pwd`
-
-for subdir in $_SUBDIRS
-do
- tmake_file=
- host_xmake_file=
- oldsrcdir=$savesrcdir
-
- # ${invsubdir} is inverse of ${subdir), *with* trailing /, if needed.
- invsubdir=`echo ${subdir}/ | sed -e 's|\./||g' -e 's|[^/]*/|../|g'`
-
- # Re-adjust the path
- # Also create a .gdbinit file which runs the one in srcdir
- # and tells GDB to look there for source files.
-
- case $oldsrcdir in
- ".") srcdir=. ;;
- /*) # absolute path
- srcdir=${oldsrcdir}/${subdir} ;;
- *) # otherwise relative
- srcdir=${invsubdir}${oldsrcdir}/${subdir} ;;
- esac
-
- if [ -r ${oldsrcdir}/${subdir}/.gdbinit -a ${oldsrcdir} != "." ] ; then
- cat > ${subdir}/.gdbinit <<EOF
-dir .
-dir ${srcdir}
-source ${srcdir}/.gdbinit
-EOF
- fi
-
- case $oldsrcdir in
- /*) ;;
- *) oldsrcdir=${invsubdir}${oldsrcdir} ;;
- esac
- mainsrcdir=${oldsrcdir}/..
- test -d $subdir || mkdir $subdir
- cd $subdir
- #
- # Create Makefile.tem from Makefile.in.
- # Make it set VPATH if necessary so that the sources are found.
- # Also change its value of srcdir.
- rm -f Makefile.tem
- echo "VPATH = ${srcdir}" \
- | cat - ${srcdir}/Makefile.in \
- | sed "s@^srcdir = \.@srcdir = ${srcdir}@" > Makefile.tem
-
- # Conditionalize the makefile for this host machine.
- if [ -f ${mainsrcdir}/config/${host_xmake_file} ]
- then
- rm -f Makefile.xx
- sed -e "/####host/ r ${mainsrcdir}/config/${host_xmake_file}" Makefile.tem > Makefile.xx
- echo "Merged ${host_xmake_file}."
- rm -f Makefile.tem
- mv Makefile.xx Makefile.tem
- else
- # Say in the makefile that there is no host_xmake_file,
- # by using a name which (when interpreted relative to $srcdir/config)
- # will duplicate another dependency: $srcdir/Makefile.in.
- host_xmake_file=../Makefile.in
- fi
-
- # Define variables host_canonical, build_canonical, and target_canonical
- # because some Cygnus local changes in the Makefile depend on them.
- echo host_canonical = ${canon_host} > Makefile.xx
- echo target_canonical = ${canon_target} >> Makefile.xx
- echo build_canonical = ${canon_build} >> Makefile.xx
- cat Makefile.tem >> Makefile.xx
- mv Makefile.xx Makefile.tem
-
- # Conditionalize the makefile for this target machine.
- if [ -f ${mainsrcdir}/config/${tmake_file} ]
- then
- rm -f Makefile.xx
- sed -e "/####target/ r ${mainsrcdir}/config/${tmake_file}" Makefile.tem > Makefile.xx
- echo "Merged ${tmake_file}."
- rm -f Makefile.tem
- mv Makefile.xx Makefile.tem
- else
- # Say in the makefile that there is no tmake_file,
- # by using a name which (when interpreted relative to $srcdir/config)
- # will duplicate another dependency: $srcdir/Makefile.in.
- tmake_file=../Makefile.in
- fi
-
- # Conditionalize the makefile for this site.
- if [ -f ${mainsrcdir}/config/ms-${site} ]
- then
- rm -f Makefile.xx
- sed -e "/####site/ r ${mainsrcdir}/config/ms-${site}" Makefile.tem > Makefile.xx
- echo "Merged ms-${site}."
- rm -f Makefile.tem
- mv Makefile.xx Makefile.tem
- fi
-
- # If this is a cross compilation, and we have newlib in the build
- # tree, then define inhibit_libc in LIBGCC2_CFLAGS. This will cause
- # __eprintf to be left out of libgcc.a, but that's OK because newlib
- # has its own version of assert.h.
- if [ x$host != x$target ]; then
- sed -e 's/^\(LIBGCC2_CFLAGS[ ]*=[ ]*\)/\1-Dinhibit_libc /' Makefile.tem > Makefile.tem2
- rm -f Makefile.tem
- mv Makefile.tem2 Makefile.tem
- fi
-
- # Remove all formfeeds, since some Makes get confused by them.
- # Also arrange to give the variables `target', `host_xmake_file',
- # `tmake_file', `prefix', `local_prefix', `exec_prefix', `FIXINCLUDES'
- # and `INSTALL_HEADERS_DIR' values in the Makefile from the values
- # they have in this script.
- rm -f Makefile.xx
- sed -e "s/ //" -e "s/^target=.*$/target=${target}/" \
- -e "s|^xmake_file=.*$|xmake_file=${host_xmake_file}|" \
- -e "s|^tmake_file=.*$|tmake_file=${tmake_file}|" \
- -e "s|^version=.*$|version=${version}|" \
- -e "s|^prefix[ ]*=.*|prefix = $prefix|" \
- -e "s|^local_prefix[ ]*=.*|local_prefix = $local_prefix|" \
- -e "s|^exec_prefix[ ]*=.*|exec_prefix = $exec_prefix|" \
- -e "s|^objdir[ ]*=.*|objdir=`pwd`|" \
- Makefile.tem > Makefile.xx
- rm -f Makefile.tem
- mv Makefile.xx Makefile.tem
-
- # Install Makefile for real, after making final changes.
- # Define macro CROSS_COMPILE in compilation if this is a cross-compiler.
- # Also use all.cross instead of all.internal, and add cross-make to Makefile.
- if [ x$canon_host = x$canon_target ]
- then
- rm -f Makefile
- if [ x$canon_host = x$canon_build ]
- then
- mv Makefile.tem Makefile
- else
- # When building gcc with a cross-compiler, we need to fix a
- # few things.
- echo "build= $build" > Makefile
- sed -e "/####build/ r ${mainsrcdir}/build-make" Makefile.tem >> Makefile
- rm -f Makefile.tem Makefile.xx
- fi
- else
- rm -f Makefile
- echo "CROSS=-DCROSS_COMPILE" > Makefile
- sed -e "/####cross/ r ${mainsrcdir}/cross-make" Makefile.tem >> Makefile
- rm -f Makefile.tem Makefile.xx
- fi
-
- echo "Created \`$subdir/Makefile'."
-
- if [ xx${vint} != xx ]
- then
- vintmsg=" (vint)"
- fi
-
- # Describe the chosen configuration in config.status.
- # Make that file a shellscript which will reestablish the same configuration.
-
- rm -f config.bak
- if [ -f config.status ]; then mv -f config.status config.bak; fi
-
- echo "#!/bin/sh
- # This directory was configured as follows:
-cd $invsubdir; ${progname}" $arguments > config.new
- echo echo host=$canon_host target=$canon_target build=$canon_build >> config.new
- chmod a+x config.new
-
- # If we aren't executing the configure script in .
- if [ x$subdir != x. ]
- then
- if [ -f $srcdir/configure ]
- then
- echo "Running \`${CONFIG_SHELL-sh} $srcdir/configure $arguments\'"
- ${CONFIG_SHELL-sh} $srcdir/configure $arguments
- echo "${srcdir}/configure" $arguments >> config.new
- echo echo host=$canon_host target=$canon_target build=$canon_build >> config.new
- fi
- fi
-
- if [ -f config.bak ] && cmp config.bak config.new >/dev/null 2>/dev/null;
- then
- mv -f config.bak config.status
- rm -f config.new
- else
- mv -f config.new config.status
- rm -f config.bak
- fi
-
- cd $STARTDIR
-done # end of current-dir SUBDIRS loop
-
-srcdir=$savesrcdir
-
-# Describe the chosen configuration in config.status.
-# Make that file a shellscript which will reestablish the same configuration.
-echo "#!/bin/sh
-# This directory was configured as follows:
-${progname}" $arguments > config.new
-echo echo host=$canon_host target=$canon_target build=$canon_build >> config.new
-chmod a+x config.new
-if [ -f config.bak ] && cmp config.bak config.new >/dev/null 2>/dev/null;
-then
- mv -f config.bak config.status
- rm -f config.new
-else
- mv -f config.new config.status
- rm -f config.bak
-fi
-
-exit 0
diff --git a/gcc/ch/convert.c b/gcc/ch/convert.c
deleted file mode 100644
index e7c93109bd0..00000000000
--- a/gcc/ch/convert.c
+++ /dev/null
@@ -1,1249 +0,0 @@
-/* Language-level data type conversion for GNU CHILL.
- Copyright (C) 1992, 1993, 1994, 1998, 1999, 2000, 2001
- Free Software Foundation, Inc.
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-
-/* This file contains the functions for converting CHILL expressions
- to different data types. The only entry point is `convert'.
- Every language front end must have a `convert' function
- but what kind of conversions it does will depend on the language. */
-
-#include "config.h"
-#include "system.h"
-#include "tree.h"
-#include "ch-tree.h"
-#include "flags.h"
-#include "convert.h"
-#include "lex.h"
-#include "toplev.h"
-#include "output.h"
-
-extern tree bit_one_node, bit_zero_node;
-extern tree string_one_type_node;
-extern tree bitstring_one_type_node;
-
-static tree convert_to_reference PARAMS ((tree, tree));
-static tree convert_to_boolean PARAMS ((tree, tree));
-static tree convert_to_char PARAMS ((tree, tree));
-#if 0
-static tree base_type_size_in_bytes PARAMS ((tree));
-#endif
-static tree remove_tree_element PARAMS ((tree, tree *));
-static tree check_ps_range PARAMS ((tree, tree, tree));
-static tree digest_powerset_tuple PARAMS ((tree, tree));
-static tree digest_structure_tuple PARAMS ((tree, tree));
-static tree digest_array_tuple PARAMS ((tree, tree, int));
-static tree convert1 PARAMS ((tree, tree));
-
-static tree
-convert_to_reference (reftype, expr)
- tree reftype, expr;
-{
- while (TREE_CODE (expr) == NOP_EXPR) /* RETYPE_EXPR */
- expr = TREE_OPERAND (expr, 0);
-
- if (! CH_LOCATION_P (expr))
- error("internal error: trying to make loc-identity with non-location");
- else
- {
- mark_addressable (expr);
- return fold (build1 (ADDR_EXPR, reftype, expr));
- }
-
- return error_mark_node;
-}
-
-tree
-convert_from_reference (expr)
- tree expr;
-{
- tree e = build1 (INDIRECT_REF, TREE_TYPE (TREE_TYPE (expr)), expr);
- TREE_READONLY (e) = TREE_READONLY (expr);
- return e;
-}
-
-/* Convert EXPR to a boolean type. */
-
-static tree
-convert_to_boolean (type, expr)
- tree type, expr;
-{
- register tree intype = TREE_TYPE (expr);
-
- if (integer_zerop (expr))
- return boolean_false_node;
- if (integer_onep (expr))
- return boolean_true_node;
-
- /* Convert a singleton bitstring to a Boolean.
- Needed if flag_old_strings. */
- if (CH_BOOLS_ONE_P (intype))
- {
- if (TREE_CODE (expr) == CONSTRUCTOR)
- {
- tree valuelist = TREE_OPERAND (expr, 1);
- if (valuelist == NULL_TREE)
- return boolean_false_node;
- if (TREE_CHAIN (valuelist) == NULL_TREE
- && TREE_PURPOSE (valuelist) == NULL_TREE
- && integer_zerop (TREE_VALUE (valuelist)))
- return boolean_true_node;
- }
- return build_chill_bitref (expr,
- build_tree_list (NULL_TREE,
- integer_zero_node));
- }
-
- if (INTEGRAL_TYPE_P (intype))
- return build1 (CONVERT_EXPR, type, expr);
-
- error ("cannot convert to a boolean mode");
- return boolean_false_node;
-}
-
-/* Convert EXPR to a char type. */
-
-static tree
-convert_to_char (type, expr)
- tree type, expr;
-{
- register tree intype = TREE_TYPE (expr);
- register enum chill_tree_code form = TREE_CODE (intype);
-
- if (form == CHAR_TYPE)
- return build1 (NOP_EXPR, type, expr);
-
- /* Convert a singleton string to a char.
- Needed if flag_old_strings. */
- if (CH_CHARS_ONE_P (intype))
- {
- if (TREE_CODE (expr) == STRING_CST)
- {
- expr = build_int_2 ((unsigned char)TREE_STRING_POINTER(expr)[0], 0);
- TREE_TYPE (expr) = char_type_node;
- return expr;
- }
- else
- return build (ARRAY_REF, char_type_node, expr, integer_zero_node);
-
- }
-
- /* For now, assume it will always fit */
- if (form == INTEGER_TYPE)
- return build1 (CONVERT_EXPR, type, expr);
-
- error ("cannot convert to a char mode");
-
- {
- register tree tem = build_int_2 (0, 0);
- TREE_TYPE (tem) = type;
- return tem;
- }
-}
-
-#if 0
-static tree
-base_type_size_in_bytes (type)
- tree type;
-{
- if (type == NULL_TREE
- || TREE_CODE (type) == ERROR_MARK
- || TREE_CODE (type) != ARRAY_TYPE)
- return error_mark_node;
- return size_in_bytes (TREE_TYPE (type));
-}
-#endif
-
-/*
- * build a singleton array type, of TYPE objects.
- */
-tree
-build_array_type_for_scalar (type)
- tree type;
-{
- /* KLUDGE */
- if (type == char_type_node)
- return build_string_type (type, integer_one_node);
-
- if (type == NULL_TREE || TREE_CODE (type) == ERROR_MARK)
- return error_mark_node;
-
- return build_chill_array_type
- (type,
- tree_cons (NULL_TREE,
- build_chill_range_type (NULL_TREE,
- integer_zero_node, integer_zero_node),
- NULL_TREE),
- 0, NULL_TREE);
-
-}
-
-#if 0
-static tree
-unreferenced_type_of (type)
- tree type;
-{
- if (type == NULL_TREE || TREE_CODE (type) == ERROR_MARK)
- return error_mark_node;
- while (TREE_CODE (type) == REFERENCE_TYPE)
- type = TREE_TYPE (type);
- return type;
-}
-#endif
-
-
-/* Remove from *LISTP the first TREE_LIST node whose TREE_PURPOSE == KEY.
- Return the TREE_LIST node, or NULL_TREE on failure. */
-
-static tree
-remove_tree_element (key, listp)
- tree *listp;
- tree key;
-{
- tree node = *listp;
- for ( ; node; listp = &TREE_CHAIN (node), node = *listp)
- {
- if (TREE_PURPOSE (node) == key)
- {
- *listp = TREE_CHAIN (node);
- TREE_CHAIN (node) = NULL_TREE;
- return node;
- }
- }
- return NULL_TREE;
-}
-
-/* This is quite the same as check_range in actions.c, but with
- different error message. */
-
-static tree
-check_ps_range (value, lo_limit, hi_limit)
- tree value;
- tree lo_limit;
- tree hi_limit;
-{
- tree check = test_range (value, lo_limit, hi_limit);
-
- if (!integer_zerop (check))
- {
- if (TREE_CODE (check) == INTEGER_CST)
- {
- error ("powerset tuple element out of range");
- return error_mark_node;
- }
- else
- value = check_expression (value, check,
- ridpointers[(int) RID_RANGEFAIL]);
- }
- return value;
-}
-
-static tree
-digest_powerset_tuple (type, inits)
- tree type;
- tree inits;
-{
- tree list;
- tree result;
- tree domain = TYPE_DOMAIN (type);
- int i = 0;
- int is_erroneous = 0, is_constant = 1, is_simple = 1;
- if (domain == NULL_TREE || TREE_CODE (domain) == ERROR_MARK)
- return error_mark_node;
- for (list = TREE_OPERAND (inits, 1); list; list = TREE_CHAIN (list), i++)
- {
- tree val = TREE_VALUE (list);
- if (TREE_CODE (val) == ERROR_MARK)
- {
- is_erroneous = 1;
- continue;
- }
- if (!TREE_CONSTANT (val))
- is_constant = 0;
- else if (!initializer_constant_valid_p (val, TREE_TYPE (val)))
- is_simple = 0;
- if (! CH_COMPATIBLE (val, domain))
- {
- error ("incompatible member of powerset tuple (at position #%d)", i);
- is_erroneous = 1;
- continue;
- }
- /* check range of value */
- val = check_ps_range (val, TYPE_MIN_VALUE (domain),
- TYPE_MAX_VALUE (domain));
- if (TREE_CODE (val) == ERROR_MARK)
- {
- is_erroneous = 1;
- continue;
- }
-
- /* Updating the list in place is in principle questionable,
- but I can't think how it could hurt. */
- TREE_VALUE (list) = convert (domain, val);
-
- val = TREE_PURPOSE (list);
- if (val == NULL_TREE)
- continue;
-
- if (TREE_CODE (val) == ERROR_MARK)
- {
- is_erroneous = 1;
- continue;
- }
- if (! CH_COMPATIBLE (val, domain))
- {
- error ("incompatible member of powerset tuple (at position #%d)", i);
- is_erroneous = 1;
- continue;
- }
- val = check_ps_range (val, TYPE_MIN_VALUE (domain),
- TYPE_MAX_VALUE (domain));
- if (TREE_CODE (val) == ERROR_MARK)
- {
- is_erroneous = 1;
- continue;
- }
- TREE_PURPOSE (list) = convert (domain, val);
- if (!TREE_CONSTANT (val))
- is_constant = 0;
- else if (!initializer_constant_valid_p (val, TREE_TYPE (val)))
- is_simple = 0;
- }
- result = build (CONSTRUCTOR, type, NULL_TREE, TREE_OPERAND (inits, 1));
- if (is_erroneous)
- return error_mark_node;
- if (is_constant)
- TREE_CONSTANT (result) = 1;
- if (is_constant && is_simple)
- TREE_STATIC (result) = 1;
- return result;
-}
-
-static tree
-digest_structure_tuple (type, inits)
- tree type;
- tree inits;
-{
- tree elements = CONSTRUCTOR_ELTS (inits);
- tree values = NULL_TREE;
- int is_constant = 1;
- int is_simple = 1;
- int is_erroneous = 0;
- tree field;
- int labelled_elements = 0;
- int unlabelled_elements = 0;
- for (field = TYPE_FIELDS (type); field; field = TREE_CHAIN (field))
- {
- if (TREE_CODE (TREE_TYPE (field)) != UNION_TYPE)
- { /* Regular fixed field. */
- tree value = remove_tree_element (DECL_NAME (field), &elements);
-
- if (value)
- labelled_elements++;
- else if (elements && TREE_PURPOSE (elements) == NULL_TREE)
- {
- value = elements;
- elements = TREE_CHAIN (elements);
- unlabelled_elements++;
- }
-
- if (value)
- {
- tree val;
- char msg[120];
- sprintf (msg, "initializer for field `%.80s'",
- IDENTIFIER_POINTER (DECL_NAME (field)));
- val = chill_convert_for_assignment (TREE_TYPE (field),
- TREE_VALUE (value), msg);
- if (TREE_CODE (val) == ERROR_MARK)
- is_erroneous = 1;
- else
- {
- TREE_VALUE (value) = val;
- TREE_CHAIN (value) = values;
- TREE_PURPOSE (value) = field;
- values = value;
- if (TREE_CODE (val) == ERROR_MARK)
- is_erroneous = 1;
- else if (!TREE_CONSTANT (val))
- is_constant = 0;
- else if (!initializer_constant_valid_p (val,
- TREE_TYPE (val)))
- is_simple = 0;
- }
- }
- else
- {
- pedwarn ("no initializer value for fixed field `%s'",
- IDENTIFIER_POINTER (DECL_NAME (field)));
- }
- }
- else
- {
- tree variant;
- tree selected_variant = NULL_TREE;
- tree variant_values = NULL_TREE;
-
- /* In a tagged variant structure mode, try to figure out
- (from the fixed fields), which is the selected variant. */
- if (TYPE_TAGFIELDS (TREE_TYPE (field)))
- {
- for (variant = TYPE_FIELDS (TREE_TYPE (field));
- variant; variant = TREE_CHAIN (variant))
- {
- tree tag_labels = TYPE_TAG_VALUES (TREE_TYPE (variant));
- tree tag_fields = TYPE_TAGFIELDS (TREE_TYPE (field));
- if (DECL_NAME (variant) == ELSE_VARIANT_NAME)
- {
- selected_variant = variant;
- break;
- }
- for (; tag_labels && tag_fields;
- tag_labels = TREE_CHAIN (tag_labels),
- tag_fields = TREE_CHAIN (tag_fields))
- {
- tree tag_value = values;
- int found = 0;
- tree tag_decl = TREE_VALUE (tag_fields);
- tree tag_value_set = TREE_VALUE (tag_labels);
- for ( ; tag_value; tag_value = TREE_CHAIN (tag_value))
- {
- if (TREE_PURPOSE (tag_value) == tag_decl)
- {
- tag_value = TREE_VALUE (tag_value);
- break;
- }
- }
- if (!tag_value || TREE_CODE (tag_value) != INTEGER_CST)
- {
- pedwarn ("non-constant value for tag field `%s'",
- IDENTIFIER_POINTER (DECL_NAME (tag_decl)));
- goto get_values;
- }
-
- /* Check if the value of the tag (as given in a
- previous field) matches the case label list. */
- for (; tag_value_set;
- tag_value_set = TREE_CHAIN (tag_value_set))
- {
- if (tree_int_cst_equal (TREE_VALUE (tag_value_set),
- tag_value))
- {
- found = 1;
- break;
- }
- }
- if (!found)
- break;
- }
- if (!tag_fields)
- {
- selected_variant = variant;
- break;
- }
- }
- }
- get_values:
- for (variant = TYPE_FIELDS (TREE_TYPE (field));
- variant; variant = TREE_CHAIN (variant))
- {
- tree vfield0 = TYPE_FIELDS (TREE_TYPE (variant));
- tree vfield;
- for (vfield = vfield0; vfield; vfield = TREE_CHAIN (vfield))
- {
- tree value = remove_tree_element (DECL_NAME (vfield),
- &elements);
-
- if (value)
- labelled_elements++;
- else if (variant == selected_variant
- && elements && TREE_PURPOSE (elements) == NULL_TREE)
- {
- value = elements;
- elements = TREE_CHAIN (elements);
- unlabelled_elements++;
- }
-
- if (value)
- {
- if (selected_variant && selected_variant != variant)
- {
- error ("field `%s' in wrong variant",
- IDENTIFIER_POINTER (DECL_NAME (vfield)));
- is_erroneous = 1;
- }
- else
- {
- if (!selected_variant && vfield != vfield0)
- pedwarn ("missing variant fields (at least `%s')",
- IDENTIFIER_POINTER (DECL_NAME (vfield0)));
- selected_variant = variant;
- if (CH_COMPATIBLE (TREE_VALUE (value),
- TREE_TYPE (vfield)))
- {
- tree val = convert (TREE_TYPE (vfield),
- TREE_VALUE (value));
- TREE_PURPOSE (value) = vfield;
- TREE_VALUE (value) = val;
- TREE_CHAIN (value) = variant_values;
- variant_values = value;
- if (TREE_CODE (val) == ERROR_MARK)
- is_erroneous = 1;
- else if (!TREE_CONSTANT (val))
- is_constant = 0;
- else if (!initializer_constant_valid_p
- (val, TREE_TYPE (val)))
- is_simple = 0;
- }
- else
- {
- is_erroneous = 1;
- error ("bad initializer for field `%s'",
- IDENTIFIER_POINTER (DECL_NAME (vfield)));
- }
- }
- }
- else if (variant == selected_variant)
- {
- pedwarn ("no initializer value for variant field `%s'",
- IDENTIFIER_POINTER (DECL_NAME (field)));
- }
- }
- }
- if (selected_variant == NULL_TREE)
- pedwarn ("no selected variant");
- else
- {
- variant_values = build (CONSTRUCTOR,
- TREE_TYPE (selected_variant),
- NULL_TREE, nreverse (variant_values));
- variant_values
- = build (CONSTRUCTOR, TREE_TYPE (field), NULL_TREE,
- build_tree_list (selected_variant, variant_values));
- values = tree_cons (field, variant_values, values);
- }
- }
- }
-
- if (labelled_elements && unlabelled_elements)
- pedwarn ("mixture of labelled and unlabelled tuple elements");
-
- /* Check for unused initializer elements. */
- unlabelled_elements = 0;
- for ( ; elements != NULL_TREE; elements = TREE_CHAIN (elements))
- {
- if (TREE_PURPOSE (elements) == NULL_TREE)
- unlabelled_elements++;
- else
- {
- if (IDENTIFIER_POINTER (TREE_PURPOSE (elements)) == 0)
- error ("probably not a structure tuple");
- else
- error ("excess initializer for field `%s'",
- IDENTIFIER_POINTER (TREE_PURPOSE (elements)));
- is_erroneous = 1;
- }
- }
- if (unlabelled_elements)
- {
- error ("excess unnamed initializers");
- is_erroneous = 1;
- }
-
- CONSTRUCTOR_ELTS (inits) = nreverse (values);
- TREE_TYPE (inits) = type;
- if (is_erroneous)
- return error_mark_node;
- if (is_constant)
- TREE_CONSTANT (inits) = 1;
- if (is_constant && is_simple)
- TREE_STATIC (inits) = 1;
- return inits;
-}
-
-/* Return a Chill representation of the INTEGER_CST VAL.
- The result may be in a static buffer, */
-
-const char *
-display_int_cst (val)
- tree val;
-{
- static char buffer[50];
- HOST_WIDE_INT x;
- tree fields;
- if (TREE_CODE (val) != INTEGER_CST)
- return "<not a constant>";
-
- x = TREE_INT_CST_LOW (val);
-
- switch (TREE_CODE (TREE_TYPE (val)))
- {
- case BOOLEAN_TYPE:
- if (x == 0)
- return "FALSE";
- if (x == 1)
- return "TRUE";
- goto int_case;
- case CHAR_TYPE:
- if (x == '^')
- strcpy (buffer, "'^^'");
- else if (x == '\n')
- strcpy (buffer, "'^J'");
- else if (x < ' ' || x > '~')
- sprintf (buffer, "'^(%u)'", (unsigned int) x);
- else
- sprintf (buffer, "'%c'", (char) x);
- return buffer;
- case ENUMERAL_TYPE:
- for (fields = TYPE_VALUES (TREE_TYPE (val)); fields != NULL_TREE;
- fields = TREE_CHAIN (fields))
- {
- if (tree_int_cst_equal (TREE_VALUE (fields), val))
- return IDENTIFIER_POINTER (TREE_PURPOSE (fields));
- }
- goto int_case;
- case POINTER_TYPE:
- if (x == 0)
- return "NULL";
- goto int_case;
- int_case:
- default:
- /* This code is derived from print-tree.c:print_code_brief. */
- if (TREE_INT_CST_HIGH (val) == 0)
- sprintf (buffer,
-#if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_INT
- "%1u",
-#else
- "%1lu",
-#endif
- x);
- else if (TREE_INT_CST_HIGH (val) == -1 && TREE_INT_CST_LOW (val) != 0)
- sprintf (buffer,
-#if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_INT
- "-%1u",
-#else
- "-%1lu",
-#endif
- -x);
- else
- sprintf (buffer,
-#if HOST_BITS_PER_WIDE_INT == 64
-#if HOST_BITS_PER_WIDE_INT != HOST_BITS_PER_INT
- "H'%lx%016lx",
-#else
- "H'%x%016x",
-#endif
-#else
-#if HOST_BITS_PER_WIDE_INT != HOST_BITS_PER_INT
- "H'%lx%08lx",
-#else
- "H'%x%08x",
-#endif
-#endif
- TREE_INT_CST_HIGH (val), TREE_INT_CST_LOW (val));
- return buffer;
- }
-}
-
-static tree
-digest_array_tuple (type, init, allow_missing_elements)
- tree type;
- tree init;
- int allow_missing_elements;
-{
- tree element = CONSTRUCTOR_ELTS (init);
- int is_constant = 1;
- int is_simple = 1;
- tree element_type = TREE_TYPE (type);
- tree default_value = NULL_TREE;
- tree element_list = NULL_TREE;
- tree domain_min;
- tree domain_max;
- tree *ptr = &element_list;
- int errors = 0;
- int labelled_elements = 0;
- int unlabelled_elements = 0;
- tree first, last = NULL_TREE;
-
- if (type == NULL_TREE || TREE_CODE (type) == ERROR_MARK)
- return error_mark_node;
-
- domain_min = TYPE_MIN_VALUE (TYPE_DOMAIN (type));
- domain_max = TYPE_MAX_VALUE (TYPE_DOMAIN (type));
-
- if (domain_min == NULL || TREE_CODE (domain_min) != INTEGER_CST)
- {
- error ("non-constant start index for tuple");
- return error_mark_node;
- }
- if (TREE_CODE (domain_max) != INTEGER_CST)
- is_constant = 0;
-
- if (TREE_CODE (type) != ARRAY_TYPE)
- abort ();
-
- for ( ; element != NULL_TREE; element = TREE_CHAIN (element))
- {
- tree purpose = TREE_PURPOSE (element);
- tree value = TREE_VALUE (element);
-
- if (purpose == NULL_TREE)
- {
- if (last == NULL_TREE)
- first = domain_min;
- else
- {
- HOST_WIDE_INT new_lo, new_hi;
- add_double (TREE_INT_CST_LOW (last), TREE_INT_CST_HIGH (last),
- 1, 0,
- &new_lo, &new_hi);
- first = build_int_2 (new_lo, new_hi);
- TREE_TYPE (first) = TYPE_DOMAIN (type);
- }
- last = first;
- unlabelled_elements++;
- }
- else
- {
- labelled_elements++;
- if (TREE_CODE (purpose) == INTEGER_CST)
- first = last = purpose;
- else if (TREE_CODE (purpose) == TYPE_DECL
- && discrete_type_p (TREE_TYPE (purpose)))
- {
- first = TYPE_MIN_VALUE (TREE_TYPE (purpose));
- last = TYPE_MAX_VALUE (TREE_TYPE (purpose));
- }
- else if (TREE_CODE (purpose) != RANGE_EXPR)
- {
- error ("invalid array tuple label");
- errors++;
- continue;
- }
- else if (TREE_OPERAND (purpose, 0) == NULL_TREE)
- first = last = NULL_TREE; /* Default value. */
- else
- {
- first = TREE_OPERAND (purpose, 0);
- last = TREE_OPERAND (purpose, 1);
- }
- if ((first != NULL && TREE_CODE (first) != INTEGER_CST)
- || (last != NULL && TREE_CODE (last) != INTEGER_CST))
- {
- error ("non-constant array tuple index range");
- errors++;
- }
- }
-
- if (! CH_COMPATIBLE (value, element_type))
- {
- const char *err_val_name =
- first ? display_int_cst (first) : "(default)";
- error ("incompatible array tuple element %s", err_val_name);
- value = error_mark_node;
- }
- else
- value = convert (element_type, value);
- if (TREE_CODE (value) == ERROR_MARK)
- errors++;
- else if (!TREE_CONSTANT (value))
- is_constant = 0;
- else if (!initializer_constant_valid_p (value, TREE_TYPE (value)))
- is_simple = 0;
-
- if (first == NULL_TREE)
- {
- if (default_value != NULL)
- {
- error ("multiple (*) or (ELSE) array tuple labels");
- errors++;
- }
- default_value = value;
- continue;
- }
-
- if (first != last && tree_int_cst_lt (last, first))
- {
- error ("empty range in array tuple");
- errors++;
- continue;
- }
-
- ptr = &element_list;
-
-#define MAYBE_RANGE_OP(PURPOSE, OPNO) \
- (TREE_CODE (PURPOSE) == RANGE_EXPR ? TREE_OPERAND (PURPOSE, OPNO): PURPOSE)
-#define CONSTRUCTOR_ELT_LO(ELT) MAYBE_RANGE_OP (TREE_PURPOSE (ELT), 0)
-#define CONSTRUCTOR_ELT_HI(ELT) MAYBE_RANGE_OP (TREE_PURPOSE (ELT), 1)
- while (*ptr && tree_int_cst_lt (last,
- CONSTRUCTOR_ELT_LO (*ptr)))
- ptr = &TREE_CHAIN (*ptr);
- if (*ptr && ! tree_int_cst_lt (CONSTRUCTOR_ELT_HI (*ptr), first))
- {
- const char *err_val_name = display_int_cst (first);
- error ("array tuple has duplicate index %s", err_val_name);
- errors++;
- continue;
- }
- if ((ptr == &element_list && tree_int_cst_lt (domain_max, last))
- || (*ptr == NULL_TREE && tree_int_cst_lt (first, domain_min)))
- {
- if (purpose)
- error ("array tuple index out of range");
- else if (errors == 0)
- error ("too many array tuple values");
- errors++;
- continue;
- }
- if (! tree_int_cst_lt (first, last))
- purpose = first;
- else if (purpose == NULL_TREE || TREE_CODE (purpose) != RANGE_EXPR)
- purpose = build_nt (RANGE_EXPR, first, last);
- *ptr = tree_cons (purpose, value, *ptr);
- }
-
- element_list = nreverse (element_list);
-
- /* For each missing element, set it to the default value,
- if there is one. Otherwise, emit an error. */
-
- if (errors == 0
- && (!allow_missing_elements || default_value != NULL_TREE))
- {
- /* Iterate over each *gap* between specified elements/ranges. */
- tree prev_elt;
- if (element_list &&
- tree_int_cst_equal (CONSTRUCTOR_ELT_LO (element_list), domain_min))
- {
- ptr = &TREE_CHAIN (element_list);
- prev_elt = element_list;
- }
- else
- {
- prev_elt = NULL_TREE;
- ptr = &element_list;
- }
- for (;;)
- {
- tree first, last;
- /* Calculate the first element of the gap. */
- if (prev_elt == NULL_TREE)
- first = domain_min;
- else
- {
- first = CONSTRUCTOR_ELT_HI (prev_elt);
- if (tree_int_cst_equal (first, domain_max))
- break; /* We're done. Avoid overflow below. */
- first = copy_node (first);
- add_double (TREE_INT_CST_LOW (first), TREE_INT_CST_HIGH (first),
- 1, 0,
- &TREE_INT_CST_LOW (first),
- &TREE_INT_CST_HIGH (first));
- }
- /* Calculate the last element of the gap. */
- if (*ptr)
- last = fold (build (MINUS_EXPR, integer_type_node,
- CONSTRUCTOR_ELT_LO (*ptr),
- integer_one_node));
- else
- last = domain_max;
-
- if (TREE_CODE (last) == INTEGER_CST && tree_int_cst_lt (last, first))
- ; /* Empty "gap" - no missing elements. */
- else if (default_value)
- {
- tree purpose;
- if (tree_int_cst_equal (first, last))
- purpose = first;
- else
- purpose = build_nt (RANGE_EXPR, first, last);
- *ptr = tree_cons (purpose, default_value, *ptr);
- }
- else
- {
- const char *err_val_name = display_int_cst (first);
- if (TREE_CODE (last) != INTEGER_CST)
- error ("dynamic array tuple without (*) or (ELSE)");
- else if (tree_int_cst_equal (first, last))
- error ("missing array tuple element %s", err_val_name);
- else
- {
- char *first_name = (char *)
- xmalloc (strlen (err_val_name) + 1);
- strcpy (first_name, err_val_name);
- err_val_name = display_int_cst (last);
- error ("missing array tuple elements %s : %s",
- first_name, err_val_name);
- free (first_name);
- }
- errors++;
- }
- if (*ptr == NULL_TREE)
- break;
- prev_elt = *ptr;
- ptr = &TREE_CHAIN (*ptr);
- }
- }
- if (errors)
- return error_mark_node;
-
- element = build (CONSTRUCTOR, type, NULL_TREE, element_list);
- TREE_CONSTANT (element) = is_constant;
- if (is_constant && is_simple)
- TREE_STATIC (element) = 1;
- if (labelled_elements && unlabelled_elements)
- pedwarn ("mixture of labelled and unlabelled tuple elements");
- return element;
-}
-
-/* This function is needed because no-op CHILL conversions are not fully
- understood by the initialization machinery. This function should only
- be called when a conversion truly is a no-op. */
-
-static tree
-convert1 (type, expr)
- tree type, expr;
-{
- int was_constant = TREE_CONSTANT (expr);
- STRIP_NOPS (expr);
- was_constant |= TREE_CONSTANT (expr);
- expr = copy_node (expr);
- TREE_TYPE (expr) = type;
- if (TREE_CONSTANT (expr) != was_constant) abort ();
- TREE_CONSTANT (expr) = was_constant;
- return expr;
-}
-
-/* Create an expression whose value is that of EXPR,
- converted to type TYPE. The TREE_TYPE of the value
- is always TYPE. This function implements all reasonable
- conversions; callers should filter out those that are
- not permitted by the language being compiled.
-
- In CHILL, we assume that the type is Compatible with the
- Class of expr, and generally complain otherwise.
- However, convert is more general (e.g. allows enum<->int
- conversion), so there should probably be at least two routines.
- Maybe add something like convert_for_assignment. FIXME. */
-
-tree
-convert (type, expr)
- tree type, expr;
-{
- register tree e = expr;
- register enum chill_tree_code code;
- int type_varying;
-
- if (e == NULL_TREE || TREE_CODE (e) == ERROR_MARK)
- return error_mark_node;
-
- if (type == NULL_TREE || TREE_CODE (type) == ERROR_MARK)
- return error_mark_node;
-
- code = TREE_CODE (type);
-
- if (type == TREE_TYPE (e))
- return e;
-
- if (TREE_TYPE (e) != NULL_TREE
- && TREE_CODE (TREE_TYPE (e)) == REFERENCE_TYPE)
- e = convert_from_reference (e);
-
- /* Support for converting *to* a reference type is limited;
- it is only here as a convenience for loc-identity declarations,
- and loc parameters. */
- if (code == REFERENCE_TYPE)
- return convert_to_reference (type, e);
-
- /* if expression was untyped because of its context (an if_expr or case_expr
- in a tuple, perhaps) just apply the type */
- if (TREE_TYPE (e) && TREE_CODE (TREE_TYPE (e)) == ERROR_MARK)
- {
- TREE_TYPE (e) = type;
- return e;
- }
-
- /* Turn a NULL keyword into [0, 0] for an instance */
- if (CH_IS_INSTANCE_MODE (type) && expr == null_pointer_node)
- {
- tree field0 = TYPE_FIELDS (type);
- tree field1 = TREE_CHAIN (field0);
- e = build (CONSTRUCTOR, type, NULL_TREE,
- tree_cons (field0, integer_zero_node,
- tree_cons (field1, integer_zero_node,
- NULL_TREE)));
- TREE_CONSTANT (e) = 1;
- TREE_STATIC (e) = 1;
- return e;
- }
-
- /* Turn a pointer into a function pointer for a procmode */
- if (TREE_CODE (type) == POINTER_TYPE
- && TREE_CODE (TREE_TYPE (type)) == FUNCTION_TYPE
- && expr == null_pointer_node)
- return convert1 (type, expr);
-
- /* turn function_decl expression into a pointer to
- that function */
- if (TREE_CODE (expr) == FUNCTION_DECL
- && TREE_CODE (type) == POINTER_TYPE
- && TREE_CODE (TREE_TYPE (type)) == FUNCTION_TYPE)
- {
- e = build1 (ADDR_EXPR, type, expr);
- TREE_CONSTANT (e) = 1;
- return e;
- }
-
- if (TREE_TYPE (e) && TREE_CODE (TREE_TYPE (e)) == RECORD_TYPE)
- e = varying_to_slice (e);
- type_varying = chill_varying_type_p (type);
-
- /* Convert a char to a singleton string.
- Needed for compatibility with 1984 version of Z.200. */
- if (TREE_TYPE (e) && TREE_CODE (TREE_TYPE (e)) == CHAR_TYPE
- && (CH_CHARS_ONE_P (type) || type_varying))
- {
- if (TREE_CODE (e) == INTEGER_CST)
- {
- char ch = TREE_INT_CST_LOW (e);
- e = build_chill_string (1, &ch);
- }
- else
- e = build (CONSTRUCTOR, string_one_type_node, NULL_TREE,
- tree_cons (NULL_TREE, e, NULL_TREE));
- }
-
- /* Convert a Boolean to a singleton bitstring.
- Needed for compatibility with 1984 version of Z.200. */
- if (TREE_TYPE (e) && TREE_CODE (TREE_TYPE (e)) == BOOLEAN_TYPE
- && (CH_BOOLS_ONE_P (type) || type_varying))
- {
- if (TREE_CODE (e) == INTEGER_CST)
- e = integer_zerop (e) ? bit_zero_node : bit_one_node;
- else
- e = build (COND_EXPR, bitstring_one_type_node,
- e, bit_one_node, bit_zero_node);
- }
-
- if (type_varying)
- {
- tree nentries;
- tree field0 = TYPE_FIELDS (type);
- tree field1 = TREE_CHAIN (field0);
- tree orig_e = e;
- tree target_array_type = TREE_TYPE (field1);
- tree needed_padding;
- tree padding_max_size = 0;
- int orig_e_constant = TREE_CONSTANT (orig_e);
- if (TREE_TYPE (e) != NULL_TREE
- && TREE_CODE (TREE_TYPE (e)) == ARRAY_TYPE)
- {
- /* Note that array_type_nelts returns 1 less than the size. */
- nentries = array_type_nelts (TREE_TYPE (e));
- needed_padding = fold (build (MINUS_EXPR, integer_type_node,
- array_type_nelts (target_array_type),
- nentries));
- if (TREE_CODE (needed_padding) != INTEGER_CST)
- {
- padding_max_size = size_in_bytes (TREE_TYPE (e));
- if (TREE_CODE (padding_max_size) != INTEGER_CST)
- padding_max_size = TYPE_ARRAY_MAX_SIZE (TREE_TYPE (e));
- }
- nentries = fold (build (PLUS_EXPR, integer_type_node,
- nentries, integer_one_node));
- }
- else if (TREE_CODE (e) == CONSTRUCTOR)
- {
- HOST_WIDE_INT init_cnt = 0;
- tree chaser = CONSTRUCTOR_ELTS (e);
- for ( ; chaser; chaser = TREE_CHAIN (chaser))
- init_cnt++; /* count initializer elements */
- nentries = build_int_2 (init_cnt, 0);
- needed_padding = integer_zero_node;
- if (TREE_TYPE (e) == NULL_TREE)
- e = digest_array_tuple (TREE_TYPE (field1), e, 1);
- orig_e_constant = TREE_CONSTANT (e);
- }
- else
- {
- error ("initializer is not an array or string mode");
- return error_mark_node;
- }
-#if 0
- FIXME check that nentries will fit in type;
-#endif
- if (!integer_zerop (needed_padding))
- {
- tree padding, padding_type, padding_range;
- if (TREE_CODE (needed_padding) == INTEGER_CST
- && (long)TREE_INT_CST_LOW (needed_padding) < 0)
- {
- error ("destination is too small");
- return error_mark_node;
- }
- padding_range = build_chill_range_type (NULL_TREE, integer_one_node,
- needed_padding);
- padding_type
- = build_simple_array_type (TREE_TYPE (target_array_type),
- padding_range, NULL_TREE);
- TYPE_ARRAY_MAX_SIZE (padding_type) = padding_max_size;
- if (CH_CHARS_TYPE_P (target_array_type))
- MARK_AS_STRING_TYPE (padding_type);
- padding = build (UNDEFINED_EXPR, padding_type);
- if (TREE_CONSTANT (e))
- e = build_chill_binary_op (CONCAT_EXPR, e, padding);
- else
- e = build (CONCAT_EXPR, target_array_type, e, padding);
- }
- e = convert (TREE_TYPE (field1), e);
- /* We build this constructor by hand (rather than going through
- digest_structure_tuple), to avoid some type-checking problem.
- E.g. type may have non-null novelty, but its field1 will
- have non-novelty. */
- e = build (CONSTRUCTOR, type, NULL_TREE,
- tree_cons (field0, nentries,
- build_tree_list (field1, e)));
- /* following was wrong, cause orig_e never will be TREE_CONSTANT. e
- may become constant after digest_array_tuple. */
- if (TREE_CONSTANT (nentries) && orig_e_constant) /* TREE_CONSTANT (orig_e)) */
- {
- TREE_CONSTANT (e) = 1;
- if (TREE_STATIC (nentries) && TREE_STATIC (orig_e))
- TREE_STATIC (e) = 1;
- }
- }
- if (TREE_TYPE (e) == NULL_TREE)
- {
- if (TREE_CODE (e) == CONSTRUCTOR)
- {
- if (TREE_CODE (type) == SET_TYPE)
- return digest_powerset_tuple (type, e);
- else if (TREE_CODE (type) == RECORD_TYPE)
- return digest_structure_tuple (type, e);
- else if (TREE_CODE (type) == ARRAY_TYPE)
- return digest_array_tuple (type, e, 0);
- else
- abort ();
- }
- else if (TREE_CODE (e) == COND_EXPR)
- e = build (COND_EXPR, type,
- TREE_OPERAND (e, 0),
- convert (type, TREE_OPERAND (e, 1)),
- convert (type, TREE_OPERAND (e, 2)));
- else if (TREE_CODE (e) == CASE_EXPR)
- TREE_TYPE (e) = type;
- else
- {
- error ("internal error: unknown type of expression");
- return error_mark_node;
- }
- }
-
- if (TYPE_MAIN_VARIANT (type) == TYPE_MAIN_VARIANT (TREE_TYPE (e))
- || (CH_NOVELTY (type) != NULL_TREE
- && CH_NOVELTY (type) == CH_NOVELTY (TREE_TYPE (e))))
- return convert1 (type, e);
-
- if (TREE_CODE (TREE_TYPE (e)) == VOID_TYPE)
- {
- error ("void value not ignored as it ought to be");
- return error_mark_node;
- }
- if (code == VOID_TYPE)
- return build1 (CONVERT_EXPR, type, e);
-
- if (code == SET_TYPE)
- return convert1 (type, e);
-
- if (code == INTEGER_TYPE || code == ENUMERAL_TYPE)
- {
- if (flag_old_strings)
- {
- if (CH_CHARS_ONE_P (TREE_TYPE (e)))
- e = convert_to_char (char_type_node, e);
- else if (CH_BOOLS_ONE_P (TREE_TYPE (e)))
- e = convert_to_boolean (boolean_type_node, e);
- }
- return fold (convert_to_integer (type, e));
- }
- if (code == POINTER_TYPE)
- return fold (convert_to_pointer (type, e));
- if (code == REAL_TYPE)
- return fold (convert_to_real (type, e));
- if (code == BOOLEAN_TYPE)
- return fold (convert_to_boolean (type, e));
- if (code == CHAR_TYPE)
- return fold (convert_to_char (type, e));
-
- if (code == ARRAY_TYPE && TYPE_MODE (type) != TYPE_MODE (TREE_TYPE (e)))
- {
- /* The mode of the expression is different from that of the type.
- Earlier checks should have tested against different lengths.
- But even if the lengths are the same, it is possible that one
- type is a static type (and hence could be say SImode), while the
- other type is dynamic type (and hence is BLKmode).
- This causes problems when emitting instructions. */
- tree ee = build1 (INDIRECT_REF, type,
- build1 (NOP_EXPR, build_pointer_type (type),
- build1 (ADDR_EXPR,
- build_pointer_type (TREE_TYPE (e)),
- e)));
- TREE_READONLY (ee) = TYPE_READONLY (type);
- return ee;
- }
-
- /* The default! */
- return convert1 (type, e);
-}
-
-/* Return an expression whose value is EXPR, but whose class is CLASS. */
-
-tree
-convert_to_class (class, expr)
- struct ch_class class;
- tree expr;
-{
- switch (class.kind)
- {
- case CH_NULL_CLASS:
- case CH_ALL_CLASS:
- return expr;
- case CH_DERIVED_CLASS:
- if (TREE_TYPE (expr) != class.mode)
- expr = convert (class.mode, expr);
- if (!CH_DERIVED_FLAG (expr))
- {
- expr = copy_node (expr);
- CH_DERIVED_FLAG (expr) = 1;
- }
- return expr;
- case CH_VALUE_CLASS:
- case CH_REFERENCE_CLASS:
- if (TREE_TYPE (expr) != class.mode)
- expr = convert (class.mode, expr);
- if (CH_DERIVED_FLAG (expr))
- {
- expr = copy_node (expr);
- CH_DERIVED_FLAG (expr) = 0;
- }
- return expr;
- }
- return expr;
-}
diff --git a/gcc/ch/decl.c b/gcc/ch/decl.c
deleted file mode 100644
index 11a05e00218..00000000000
--- a/gcc/ch/decl.c
+++ /dev/null
@@ -1,4967 +0,0 @@
-/* Process declarations and variables for GNU CHILL compiler.
- Copyright (C) 1992, 1993, 1994, 1998, 1999, 2000, 2001
- Free Software Foundation, Inc.
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-
-/* Process declarations and symbol lookup for CHILL front end.
- Also constructs types; the standard scalar types at initialization,
- and structure, union, array and enum types when they are declared. */
-
-/* NOTES on Chill name resolution
-
- Chill allows one to refer to an identifier that is declared later in
- the same Group. Hence, a single pass over the code (as in C) is
- insufficient.
-
- This implementation uses two complete passes over the source code,
- plus some extra passes over internal data structures.
-
- Loosely, during pass 1, a 'scope' object is created for each Chill
- reach. Each scope object contains a list of 'decl' objects,
- one for each 'defining occurrence' in the reach. (This list
- is in the 'remembered_decls' field of each scope.)
- The scopes and their decls are replayed in pass 2: As each reach
- is entered, the decls saved from pass 1 are made visible.
-
- There are some exceptions. Declarations that cannot be referenced
- before their declaration (i.e. whose defining occurrence precede
- their reach), can be deferred to pass 2. These include formal
- parameter declarations, and names defined in a DO action.
-
- During pass 2, as each scope is entered, we must make visible all
- the declarations defined in the scope, before we generate any code.
- We must also simplify the declarations from pass 1: For example
- a VAR_DECL may have a array type whose bounds are expressions;
- these need to be folded. But of course the expressions may contain
- identifiers that may be defined later in the scope - or even in
- a different module.
-
- The "satisfy" process has two main phases:
-
- 1: Binding. Each identifier *referenced* in a declaration (i.e. in
- a mode or the RHS of a synonum declaration) must be bound to its
- defining occurrence. This may need to be linking via
- grants and/or seizes (which are represented by ALIAS_DECLs).
- A further complication is handling implied name strings.
-
- 2: Layout. Each CONST_DECL or TYPE_DECL *referenced* in a declaration
- must than be replaced by its value (or type). Constants must be
- folded. Types and declarstions must be laid out. DECL_RTL must be set.
- While doing this, we must watch out for circular dependencies.
-
- If a scope contains nested modulions, then the Binding phase must be
- done for each nested module (recursively) before the Layout phase
- can start for that scope. As an example of why this is needed, consider:
-
- M1: MODULE
- DCL a ARRAY [1:y] int; -- This should have 7 elements.
- SYN x = 5;
- SEIZE y;
- END M1;
- M2: MODULE
- SYN x = 2;
- SYN y = x + 5;
- GRANT y;
- END M2;
-
- Here, the 'x' in "x + 5" must be Bound to the 'x' in module M2.
- This must be done before we can Layout a.
- The reason this is an issue is that we do *not* have a lookup
- (or hash) table per scope (or module). Instead we have a single
- global table we keep adding and removing bindings from.
- (This is both for speed, and because of gcc history.)
-
- Note that a SEIZE generates a declaration in the current scope,
- linked to something in the surrounding scope. Determining (binding)
- the link must be done in pass 2. On the other hand, a GRANT
- generates a declaration in the surrounding scope, linked to
- something in the current scope. This linkage is Bound in pass 1.
-
- The sequence for the above example is:
- - Enter the declarations of M1 (i.e. {a, x, y}) into the hash table.
- - For each of {a, x, y}, examine dependent expression (the
- rhs of x, the bounds of a), and Bind any identifiers to
- the current declarations (as found in the hash table). Specifically,
- the 'y' in the array bounds of 'a' is bound to the 'y' declared by
- the SEIZE declaration. Also, 'y' is Bound to the implicit
- declaration in the global scope (generated from the GRANT in M2).
- - Remove the bindings for M1 (i.e. {a, x, y}) from the hash table.
- - Enter the declarations of M2 (i.e. {x, y}) into the hash table.
- - For each of {x, y} examine the dependent expressions (the rhs of
- x and y), and Bind any identifiers to their current declarartions
- (in this case the 'x' in "x + 5" is bound to the 'x' that is 2.
- - Remove the bindings for M2 (i.e. {x, y}) from the hash table.
- - Perform Layout for M1: This requires the size of a, which
- requires the value of y. The 'y' is Bound to the implicit
- declaration in the global scope, which is Bound to the declaration
- of y in M2. We now require the value of this 'y', which is "x + 5"
- where x is bound to the x in M2 (thanks to our previous Binding
- phase). So we get that the value of y is 7.
- - Perform layout of M2. This implies calculating (constant folding)
- the value of y - but we already did that, so we're done.
-
- An example illustating the problem with implied names:
-
- M1: MODULE
- SEIZE y;
- use(e); -- e is implied by y.
- END M1;
- M2: MODULE
- GRANT y;
- SYNMODE y = x;
- SEIZE x;
- END M2;
- M3: MODULE
- GRANT x;
- SYNMODE x = SET (e);
- END M3;
-
- This implies that determining the implied name e in M1
- must be done after Binding of y to x in M2.
-
- Yet another nasty:
- M1: MODULE
- SEIZE v;
- DCL a ARRAY(v:v) int;
- END M1;
- M2: MODULE
- GRANT v;
- SEIZE x;
- SYN v x = e;
- END M2;
- M3: MODULE
- GRANT x;
- SYNMODE x = SET(e);
- END M3;
-
- This one implies that determining the implied name e in M2,
- must be done before Layout of a in M1.
-
- These two examples togother indicate the determining implieed
- names requries yet another phase.
- - Bind strong names in M1.
- - Bind strong names in M2.
- - Bind strong names in M3.
- - Determine weak names implied by SEIZEs in M1.
- - Bind the weak names in M1.
- - Determine weak names implied by SEIZEs in M2.
- - Bind the weak names in M2.
- - Determine weak names implied by SEIZEs in M3.
- - Bind the weak names in M3.
- - Layout M1.
- - Layout M2.
- - Layout M3.
-
- We must bind the strong names in every module before we can determine
- weak names in any module (because of seized/granted synmode/newmodes).
- We must bind the weak names in every module before we can do Layout
- in any module.
-
- Sigh.
-
- */
-
-/* ??? not all decl nodes are given the most useful possible
- line numbers. For example, the CONST_DECLs for enum values. */
-
-#include "config.h"
-#include "system.h"
-#include "tree.h"
-#include "flags.h"
-#include "ch-tree.h"
-#include "lex.h"
-#include "obstack.h"
-#include "input.h"
-#include "rtl.h"
-#include "toplev.h"
-
-#define IS_UNKNOWN_TYPE(type) (TYPE_SIZE(type)==0)
-#define BUILTIN_NESTING_LEVEL (-1)
-
-/* For backward compatibility, we define Chill INT to be the same
- as SHORT (i.e. 16 bits), at least if C INT is the same as LONG.
- This is a lose. */
-#define CHILL_INT_IS_SHORT (INT_TYPE_SIZE==LONG_TYPE_SIZE)
-
-extern int ignore_case;
-extern tree process_type;
-extern struct obstack *saveable_obstack;
-extern tree signal_code;
-extern int special_UC;
-
-static tree get_next_decl PARAMS ((void));
-static tree lookup_name_for_seizing PARAMS ((tree));
-#if 0
-static tree lookup_name_current_level PARAMS ((tree));
-#endif
-static void save_decl PARAMS ((tree));
-
-extern struct obstack permanent_obstack;
-extern int in_pseudo_module;
-
-struct module *current_module = NULL;
-struct module *first_module = NULL;
-struct module **next_module = &first_module;
-
-extern int in_pseudo_module;
-
-int module_number = 0;
-
-/* This is only used internally (by signed_type). */
-
-tree signed_boolean_type_node;
-
-tree global_function_decl = NULL_TREE;
-
-/* This is a temportary used by RESULT to store its value.
- Note we cannot directly use DECL_RESULT for two reasons:
- a) If DECL_RESULT is a register, it may get clobbered by a
- subsequent function call; and
- b) if the function returns a struct, we might (visibly) modify the
- destination before we're supposed to. */
-tree chill_result_decl;
-
-int result_never_set;
-
-/* forward declarations */
-static void pushdecllist PARAMS ((tree, int));
-static int init_nonvalue_struct PARAMS ((tree));
-static int init_nonvalue_array PARAMS ((tree));
-static void set_nesting_level PARAMS ((tree, int));
-static tree make_chill_variants PARAMS ((tree, tree, tree));
-static tree fix_identifier PARAMS ((tree));
-static void proclaim_decl PARAMS ((tree, int));
-static tree maybe_acons PARAMS ((tree, tree));
-static void push_scope_decls PARAMS ((int));
-static void pop_scope_decls PARAMS ((tree, tree));
-static tree build_implied_names PARAMS ((tree));
-static void bind_sub_modules PARAMS ((int));
-static void layout_array_type PARAMS ((tree));
-static void do_based_decl PARAMS ((tree, tree, tree));
-static void handle_one_level PARAMS ((tree, tree));
-
-int current_nesting_level = BUILTIN_NESTING_LEVEL;
-int current_module_nesting_level = 0;
-
-/* Lots of declarations copied from c-decl.c. */
-/* ??? not all decl nodes are given the most useful possible
- line numbers. For example, the CONST_DECLs for enum values. */
-
-
-/* We let tm.h override the types used here, to handle trivial differences
- such as the choice of unsigned int or long unsigned int for size_t.
- When machines start needing nontrivial differences in the size type,
- it would be best to do something here to figure out automatically
- from other information what type to use. */
-
-#ifndef PTRDIFF_TYPE
-#define PTRDIFF_TYPE "long int"
-#endif
-
-#ifndef WCHAR_TYPE
-#define WCHAR_TYPE "int"
-#endif
-
-tree wchar_type_node;
-tree signed_wchar_type_node;
-tree unsigned_wchar_type_node;
-
-tree void_list_node;
-
-/* type of initializer structure, which points to
- a module's module-level code, and to the next
- such structure. */
-tree initializer_type;
-
-/* type of a CHILL predefined value builtin routine */
-tree chill_predefined_function_type;
-
-/* type `int ()' -- used for implicit declaration of functions. */
-
-tree default_function_type;
-
-const char **boolean_code_name;
-
-/* Nodes for boolean constants TRUE and FALSE. */
-tree boolean_true_node, boolean_false_node;
-
-tree string_one_type_node; /* The type of CHARS(1). */
-tree bitstring_one_type_node; /* The type of BOOLS(1). */
-tree bit_zero_node; /* B'0' */
-tree bit_one_node; /* B'1' */
-
-/* Nonzero if we have seen an invalid cross reference
- to a struct, union, or enum, but not yet printed the message. */
-
-tree pending_invalid_xref;
-/* File and line to appear in the eventual error message. */
-char *pending_invalid_xref_file;
-int pending_invalid_xref_line;
-
-/* After parsing the declarator that starts a function definition,
- `start_function' puts here the list of parameter names or chain of decls.
- `store_parm_decls' finds it here. */
-
-static tree current_function_parms;
-
-/* Nonzero when store_parm_decls is called indicates a varargs function.
- Value not meaningful after store_parm_decls. */
-
-static int c_function_varargs;
-
-/* These are irrelevant for Chill, but are referenced from from c-typeck.c. */
-int warn_format;
-int warn_traditional;
-int warn_bad_function_cast;
-
-/* Identifiers that hold VAR_LENGTH and VAR_DATA. */
-tree var_length_id, var_data_id;
-
-tree case_else_node;
-
-/* For each binding contour we allocate a scope structure
- * which records the names defined in that contour.
- * Contours include:
- * 0) the global one
- * 1) one for each function definition,
- * where internal declarations of the parameters appear.
- * 2) one for each compound statement,
- * to record its declarations.
- *
- * The current meaning of a name can be found by searching the levels from
- * the current one out to the global one.
- */
-
-/* To communicate between pass 1 and 2, we maintain a list of "scopes".
- Each scope corrresponds to a nested source scope/block that contain
- that can contain declarations. The TREE_VALUE of the scope points
- to the list of declarations declared in that scope.
- The TREE_PURPOSE of the scope points to the surrounding scope.
- (We may need to handle nested modules later. FIXME)
- The TREE_CHAIN field contains a list of scope as they are seen
- in chronological order. (Reverse order during first pass,
- but it is reverse before pass 2.) */
-
-struct scope
-{
- /* The enclosing scope. */
- struct scope *enclosing;
-
- /* The next scope, in chronlogical order. */
- struct scope *next;
-
- /* A chain of DECLs constructed using save_decl during pass 1. */
- tree remembered_decls;
-
- /* A chain of _DECL nodes for all variables, constants, functions,
- and typedef types belong to this scope. */
- tree decls;
-
- /* List of declarations that have been granted into this scope. */
- tree granted_decls;
-
- /* List of implied (weak) names. */
- tree weak_decls;
-
- /* For each level, a list of shadowed outer-level local definitions
- to be restored when this level is popped.
- Each link is a TREE_LIST whose TREE_PURPOSE is an identifier and
- whose TREE_VALUE is its old definition (a kind of ..._DECL node). */
- tree shadowed;
-
- /* For each level (except not the global one),
- a chain of BLOCK nodes for all the levels
- that were entered and exited one level down. */
- tree blocks;
-
- /* The BLOCK node for this level, if one has been preallocated.
- If 0, the BLOCK is allocated (if needed) when the level is popped. */
- tree this_block;
-
- /* The binding level which this one is contained in (inherits from). */
- struct scope *level_chain;
-
- /* Nonzero for a level that corresponds to a module. */
- char module_flag;
-
- /* Zero means called from backend code. */
- char two_pass;
-
- /* The modules that are directly enclosed by this scope
- are chained together. */
- struct scope* first_child_module;
- struct scope** tail_child_module;
- struct scope* next_sibling_module;
-};
-
-/* The outermost binding level, for pre-defined (builtin) names. */
-
-static struct scope builtin_scope = {
- NULL, NULL, NULL_TREE, NULL_TREE, NULL_TREE, NULL_TREE, NULL_TREE,
- NULL_TREE, NULL_TREE, NULL, 0, 0, NULL, NULL, NULL};
-
-struct scope *global_scope;
-
-/* The binding level currently in effect. */
-
-static struct scope *current_scope = &builtin_scope;
-
-/* The most recently seen scope. */
-struct scope *last_scope = &builtin_scope;
-
-/* Binding level structures are initialized by copying this one. */
-
-static struct scope clear_scope = {
- NULL, NULL, NULL_TREE, NULL_TREE, NULL_TREE, NULL_TREE, NULL_TREE,
- NULL_TREE, NULL_TREE, NULL, 0, 0, NULL, NULL, NULL};
-
-/* Chain of decls accessible through IDENTIFIER_OUTER_VALUE.
- Decls with the same DECL_NAME are adjacent in the chain. */
-
-static tree outer_decls = NULL_TREE;
-
-/* C-specific option variables. */
-
-/* Nonzero means allow type mismatches in conditional expressions;
- just make their values `void'. */
-
-int flag_cond_mismatch;
-
-/* Nonzero means give `double' the same size as `float'. */
-
-int flag_short_double;
-
-/* Nonzero means don't recognize the keyword `asm'. */
-
-int flag_no_asm;
-
-/* Nonzero means don't recognize any builtin functions. */
-
-int flag_no_builtin;
-
-/* Nonzero means don't recognize the non-ANSI builtin functions.
- -ansi sets this. */
-
-int flag_no_nonansi_builtin;
-
-/* Nonzero means do some things the same way PCC does. */
-
-int flag_traditional;
-
-/* Nonzero means to allow single precision math even if we're generally
- being traditional. */
-int flag_allow_single_precision = 0;
-
-/* Nonzero means to treat bitfields as signed unless they say `unsigned'. */
-
-int flag_signed_bitfields = 1;
-int explicit_flag_signed_bitfields = 0;
-
-/* Nonzero means warn about implicit declarations. */
-
-int warn_implicit;
-
-/* Nonzero means give string constants the type `const char *'
- to get extra warnings from them. These warnings will be too numerous
- to be useful, except in thoroughly ANSIfied programs. */
-
-int warn_write_strings;
-
-/* Nonzero means warn about pointer casts that can drop a type qualifier
- from the pointer target type. */
-
-int warn_cast_qual;
-
-/* Nonzero means warn about sizeof(function) or addition/subtraction
- of function pointers. */
-
-int warn_pointer_arith;
-
-/* Nonzero means warn for non-prototype function decls
- or non-prototyped defs without previous prototype. */
-
-int warn_strict_prototypes;
-
-/* Nonzero means warn for any global function def
- without separate previous prototype decl. */
-
-int warn_missing_prototypes;
-
-/* Nonzero means warn about multiple (redundant) decls for the same single
- variable or function. */
-
-int warn_redundant_decls = 0;
-
-/* Nonzero means warn about extern declarations of objects not at
- file-scope level and about *all* declarations of functions (whether
- extern or static) not at file-scope level. Note that we exclude
- implicit function declarations. To get warnings about those, use
- -Wimplicit. */
-
-int warn_nested_externs = 0;
-
-/* Warn about a subscript that has type char. */
-
-int warn_char_subscripts = 0;
-
-/* Warn if a type conversion is done that might have confusing results. */
-
-int warn_conversion;
-
-/* Warn if adding () is suggested. */
-
-int warn_parentheses;
-
-/* Warn if initializer is not completely bracketed. */
-
-int warn_missing_braces;
-
-/* Define the special tree codes that we use. */
-
-/* Table indexed by tree code giving a string containing a character
- classifying the tree code. Possibilities are
- t, d, s, c, r, <, 1 and 2. See ch-tree.def for details. */
-
-#define DEFTREECODE(SYM, NAME, TYPE, LENGTH) TYPE,
-
- const char chill_tree_code_type[] = {
- 'x',
-#include "ch-tree.def"
- };
-#undef DEFTREECODE
-
-/* Table indexed by tree code giving number of expression
- operands beyond the fixed part of the node structure.
- Not used for types or decls. */
-
-#define DEFTREECODE(SYM, NAME, TYPE, LENGTH) LENGTH,
-
-int chill_tree_code_length[] = {
- 0,
-#include "ch-tree.def"
- };
-#undef DEFTREECODE
-
-
-/* Names of tree components.
- Used for printing out the tree and error messages. */
-#define DEFTREECODE(SYM, NAME, TYPE, LEN) NAME,
-
-const char *chill_tree_code_name[] = {
- "@@dummy",
-#include "ch-tree.def"
- };
-#undef DEFTREECODE
-
-/* Nonzero means `$' can be in an identifier. */
-#ifndef DOLLARS_IN_IDENTIFIERS
-#define DOLLARS_IN_IDENTIFIERS 0
-#endif
-int dollars_in_ident = DOLLARS_IN_IDENTIFIERS > 1;
-
-/* An identifier that is used internally to indicate
- an "ALL" prefix for granting or seizing.
- We use "*" rather than the external name "ALL", partly for convenience,
- and partly to avoid case senstivity problems. */
-
-tree ALL_POSTFIX;
-
-void
-allocate_lang_decl (t)
- tree t ATTRIBUTE_UNUSED;
-{
- /* Nothing needed */
-}
-
-void
-copy_lang_decl (node)
- tree node ATTRIBUTE_UNUSED;
-{
- /* Nothing needed */
-}
-
-tree
-build_lang_decl (code, name, type)
- enum chill_tree_code code;
- tree name;
- tree type;
-{
- return build_decl (code, name, type);
-}
-
-/* Decode the string P as a language-specific option for C.
- Return the number of strings consumed for a valid option.
- Return 0 for an invalid option. */
-
-int
-c_decode_option (argc, argv)
- int argc ATTRIBUTE_UNUSED;
- char **argv;
-{
- char *p = argv[0];
- if (!strcmp (p, "-ftraditional") || !strcmp (p, "-traditional"))
- {
- flag_traditional = 1;
- flag_writable_strings = 1;
-#if DOLLARS_IN_IDENTIFIERS > 0
- dollars_in_ident = 1;
-#endif
- }
- else if (!strcmp (p, "-fnotraditional") || !strcmp (p, "-fno-traditional"))
- {
- flag_traditional = 0;
- flag_writable_strings = 0;
- dollars_in_ident = DOLLARS_IN_IDENTIFIERS > 1;
- }
- else if (!strcmp (p, "-fsigned-char"))
- flag_signed_char = 1;
- else if (!strcmp (p, "-funsigned-char"))
- flag_signed_char = 0;
- else if (!strcmp (p, "-fno-signed-char"))
- flag_signed_char = 0;
- else if (!strcmp (p, "-fno-unsigned-char"))
- flag_signed_char = 1;
- else if (!strcmp (p, "-fsigned-bitfields")
- || !strcmp (p, "-fno-unsigned-bitfields"))
- {
- flag_signed_bitfields = 1;
- explicit_flag_signed_bitfields = 1;
- }
- else if (!strcmp (p, "-funsigned-bitfields")
- || !strcmp (p, "-fno-signed-bitfields"))
- {
- flag_signed_bitfields = 0;
- explicit_flag_signed_bitfields = 1;
- }
- else if (!strcmp (p, "-fshort-enums"))
- flag_short_enums = 1;
- else if (!strcmp (p, "-fno-short-enums"))
- flag_short_enums = 0;
- else if (!strcmp (p, "-fcond-mismatch"))
- flag_cond_mismatch = 1;
- else if (!strcmp (p, "-fno-cond-mismatch"))
- flag_cond_mismatch = 0;
- else if (!strcmp (p, "-fshort-double"))
- flag_short_double = 1;
- else if (!strcmp (p, "-fno-short-double"))
- flag_short_double = 0;
- else if (!strcmp (p, "-fasm"))
- flag_no_asm = 0;
- else if (!strcmp (p, "-fno-asm"))
- flag_no_asm = 1;
- else if (!strcmp (p, "-fbuiltin"))
- flag_no_builtin = 0;
- else if (!strcmp (p, "-fno-builtin"))
- flag_no_builtin = 1;
- else if (!strcmp (p, "-ansi"))
- flag_no_asm = 1, flag_no_nonansi_builtin = 1, dollars_in_ident = 0;
- else if (!strcmp (p, "-Wimplicit"))
- warn_implicit = 1;
- else if (!strcmp (p, "-Wno-implicit"))
- warn_implicit = 0;
- else if (!strcmp (p, "-Wwrite-strings"))
- warn_write_strings = 1;
- else if (!strcmp (p, "-Wno-write-strings"))
- warn_write_strings = 0;
- else if (!strcmp (p, "-Wcast-qual"))
- warn_cast_qual = 1;
- else if (!strcmp (p, "-Wno-cast-qual"))
- warn_cast_qual = 0;
- else if (!strcmp (p, "-Wpointer-arith"))
- warn_pointer_arith = 1;
- else if (!strcmp (p, "-Wno-pointer-arith"))
- warn_pointer_arith = 0;
- else if (!strcmp (p, "-Wstrict-prototypes"))
- warn_strict_prototypes = 1;
- else if (!strcmp (p, "-Wno-strict-prototypes"))
- warn_strict_prototypes = 0;
- else if (!strcmp (p, "-Wmissing-prototypes"))
- warn_missing_prototypes = 1;
- else if (!strcmp (p, "-Wno-missing-prototypes"))
- warn_missing_prototypes = 0;
- else if (!strcmp (p, "-Wredundant-decls"))
- warn_redundant_decls = 1;
- else if (!strcmp (p, "-Wno-redundant-decls"))
- warn_redundant_decls = 0;
- else if (!strcmp (p, "-Wnested-externs"))
- warn_nested_externs = 1;
- else if (!strcmp (p, "-Wno-nested-externs"))
- warn_nested_externs = 0;
- else if (!strcmp (p, "-Wchar-subscripts"))
- warn_char_subscripts = 1;
- else if (!strcmp (p, "-Wno-char-subscripts"))
- warn_char_subscripts = 0;
- else if (!strcmp (p, "-Wconversion"))
- warn_conversion = 1;
- else if (!strcmp (p, "-Wno-conversion"))
- warn_conversion = 0;
- else if (!strcmp (p, "-Wparentheses"))
- warn_parentheses = 1;
- else if (!strcmp (p, "-Wno-parentheses"))
- warn_parentheses = 0;
- else if (!strcmp (p, "-Wreturn-type"))
- warn_return_type = 1;
- else if (!strcmp (p, "-Wno-return-type"))
- warn_return_type = 0;
- else if (!strcmp (p, "-Wcomment"))
- ; /* cpp handles this one. */
- else if (!strcmp (p, "-Wno-comment"))
- ; /* cpp handles this one. */
- else if (!strcmp (p, "-Wcomments"))
- ; /* cpp handles this one. */
- else if (!strcmp (p, "-Wno-comments"))
- ; /* cpp handles this one. */
- else if (!strcmp (p, "-Wtrigraphs"))
- ; /* cpp handles this one. */
- else if (!strcmp (p, "-Wno-trigraphs"))
- ; /* cpp handles this one. */
- else if (!strcmp (p, "-Wimport"))
- ; /* cpp handles this one. */
- else if (!strcmp (p, "-Wno-import"))
- ; /* cpp handles this one. */
- else if (!strcmp (p, "-Wmissing-braces"))
- warn_missing_braces = 1;
- else if (!strcmp (p, "-Wno-missing-braces"))
- warn_missing_braces = 0;
- else if (!strcmp (p, "-Wall"))
- {
- extra_warnings = 1;
- /* 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 = 2;
- warn_implicit = 1;
- warn_return_type = 1;
- set_Wunused (1);
- warn_char_subscripts = 1;
- warn_parentheses = 1;
- warn_missing_braces = 1;
- }
- else
- return 0;
-
- return 1;
-}
-
-/* Hooks for print_node. */
-
-void
-print_lang_decl (file, node, indent)
- FILE *file;
- tree node;
- int indent;
-{
- indent_to (file, indent + 3);
- fputs ("nesting_level ", file);
- fprintf (file, HOST_WIDE_INT_PRINT_DEC, DECL_NESTING_LEVEL (node));
- fputs (" ", file);
- if (DECL_WEAK_NAME (node))
- fprintf (file, "weak_name ");
- if (CH_DECL_SIGNAL (node))
- fprintf (file, "decl_signal ");
- print_node (file, "tasking_code",
- (tree)DECL_TASKING_CODE_DECL (node), indent + 4);
-}
-
-
-void
-print_lang_type (file, node, indent)
- FILE *file;
- tree node;
- int indent;
-{
- tree temp;
-
- indent_to (file, indent + 3);
- if (CH_IS_BUFFER_MODE (node))
- fprintf (file, "buffer_mode ");
- if (CH_IS_EVENT_MODE (node))
- fprintf (file, "event_mode ");
-
- if (CH_IS_EVENT_MODE (node) || CH_IS_BUFFER_MODE (node))
- {
- temp = max_queue_size (node);
- if (temp)
- print_node_brief (file, "qsize", temp, indent + 4);
- }
-}
-
-void
-print_lang_identifier (file, node, indent)
- FILE *file;
- tree node;
- int indent;
-{
- print_node (file, "local", IDENTIFIER_LOCAL_VALUE (node), indent + 4);
- print_node (file, "outer", IDENTIFIER_OUTER_VALUE (node), indent + 4);
- print_node (file, "implicit", IDENTIFIER_IMPLICIT_DECL (node), indent + 4);
- print_node (file, "error locus", IDENTIFIER_ERROR_LOCUS (node), indent + 4);
- print_node (file, "signal_dest", IDENTIFIER_SIGNAL_DEST (node), indent + 4);
- indent_to (file, indent + 3);
- if (IDENTIFIER_SIGNAL_DATA(node))
- fprintf (file, "signal_data ");
-}
-
-/* initialise non-value struct */
-
-static int
-init_nonvalue_struct (expr)
- tree expr;
-{
- tree type = TREE_TYPE (expr);
- tree field;
- int res = 0;
-
- if (CH_IS_BUFFER_MODE (type))
- {
- expand_expr_stmt (
- build_chill_modify_expr (
- build_component_ref (expr, get_identifier ("__buffer_data")),
- null_pointer_node));
- return 1;
- }
- else if (CH_IS_EVENT_MODE (type))
- {
- expand_expr_stmt (
- build_chill_modify_expr (
- build_component_ref (expr, get_identifier ("__event_data")),
- null_pointer_node));
- return 1;
- }
- else if (CH_IS_ASSOCIATION_MODE (type))
- {
- expand_expr_stmt (
- build_chill_modify_expr (expr,
- chill_convert_for_assignment (type, association_init_value,
- "association")));
- return 1;
- }
- else if (CH_IS_ACCESS_MODE (type))
- {
- init_access_location (expr, type);
- return 1;
- }
- else if (CH_IS_TEXT_MODE (type))
- {
- init_text_location (expr, type);
- return 1;
- }
-
- for (field = TYPE_FIELDS (type); field != NULL_TREE; field = TREE_CHAIN (field))
- {
- type = TREE_TYPE (field);
- if (CH_TYPE_NONVALUE_P (type))
- {
- tree exp = build_component_ref (expr, DECL_NAME (field));
- if (TREE_CODE (type) == RECORD_TYPE)
- res |= init_nonvalue_struct (exp);
- else if (TREE_CODE (type) == ARRAY_TYPE)
- res |= init_nonvalue_array (exp);
- }
- }
- return res;
-}
-
-/* initialize non-value array */
-/* do it with DO FOR unique-id IN expr; ... OD; */
-static int
-init_nonvalue_array (expr)
- tree expr;
-{
- tree tmpvar = get_unique_identifier ("NONVALINIT");
- tree type;
- int res = 0;
-
- push_loop_block ();
- build_loop_iterator (tmpvar, expr, NULL_TREE, NULL_TREE, 0, 1, 0);
- nonvalue_begin_loop_scope ();
- build_loop_start (NULL_TREE);
- tmpvar = lookup_name (tmpvar);
- type = TREE_TYPE (tmpvar);
- if (CH_TYPE_NONVALUE_P (type))
- {
- if (TREE_CODE (type) == RECORD_TYPE)
- res |= init_nonvalue_struct (tmpvar);
- else if (TREE_CODE (type) == ARRAY_TYPE)
- res |= init_nonvalue_array (tmpvar);
- }
- build_loop_end ();
- nonvalue_end_loop_scope ();
- pop_loop_block ();
- return res;
-}
-
-/* This excessive piece of code sets DECL_NESTING_LEVEL (DECL) to LEVEL. */
-
-static void
-set_nesting_level (decl, level)
- tree decl;
- int level;
-{
- static tree *small_ints = NULL;
- static int max_small_ints = 0;
-
- if (level < 0)
- decl->decl.vindex = NULL_TREE;
- else
- {
- if (level >= max_small_ints)
- {
- int new_max = level + 20;
- if (small_ints == NULL)
- small_ints = (tree*)xmalloc (new_max * sizeof(tree));
- else
- small_ints = (tree*)xrealloc (small_ints, new_max * sizeof(tree));
- while (max_small_ints < new_max)
- small_ints[max_small_ints++] = NULL_TREE;
- }
- if (small_ints[level] == NULL_TREE)
- {
- push_obstacks (&permanent_obstack, &permanent_obstack);
- small_ints[level] = build_int_2 (level, 0);
- pop_obstacks ();
- }
- /* set DECL_NESTING_LEVEL */
- decl->decl.vindex = small_ints[level];
- }
-}
-
-/* OPT_EXTERNAL is non-zero when the declaration is at module level.
- * OPT_EXTERNAL == 2 means implicitly grant it.
- */
-void
-do_decls (names, type, opt_static, lifetime_bound, opt_init, opt_external)
- tree names;
- tree type;
- int opt_static;
- int lifetime_bound;
- tree opt_init;
- int opt_external;
-{
- if (names == NULL_TREE || TREE_CODE (names) == TREE_LIST)
- {
- for (; names != NULL_TREE; names = TREE_CHAIN (names))
- do_decl (TREE_VALUE (names), type, opt_static, lifetime_bound,
- opt_init, opt_external);
- }
- else if (TREE_CODE (names) != ERROR_MARK)
- do_decl (names, type, opt_static, lifetime_bound, opt_init, opt_external);
-}
-
-tree
-do_decl (name, type, is_static, lifetime_bound, opt_init, opt_external)
- tree name, type;
- int is_static;
- int lifetime_bound;
- tree opt_init;
- int opt_external;
-{
- tree decl;
-
- if (current_function_decl == global_function_decl
- && ! lifetime_bound /*&& opt_init != NULL_TREE*/)
- seen_action = 1;
-
- if (pass < 2)
- {
- push_obstacks (&permanent_obstack, &permanent_obstack);
- decl = make_node (VAR_DECL);
- DECL_NAME (decl) = name;
- TREE_TYPE (decl) = type;
- DECL_ASSEMBLER_NAME (decl) = name;
-
- /* Try to put things in common when possible.
- Tasking variables must go into common. */
- DECL_COMMON (decl) = 1;
- DECL_EXTERNAL (decl) = opt_external > 0;
- TREE_PUBLIC (decl) = opt_external > 0;
- TREE_STATIC (decl) = is_static;
-
- if (pass == 0)
- {
- /* We have to set this here, since we build the decl w/o
- calling `build_decl'. */
- DECL_INITIAL (decl) = opt_init;
- pushdecl (decl);
- finish_decl (decl);
- }
- else
- {
- save_decl (decl);
- pop_obstacks ();
- }
- DECL_INITIAL (decl) = opt_init;
- if (opt_external > 1 || in_pseudo_module)
- push_granted (DECL_NAME (decl), decl);
- }
- else /* pass == 2 */
- {
- tree temp = NULL_TREE;
- int init_it = 0;
-
- decl = get_next_decl ();
-
- if (name != DECL_NAME (decl))
- abort ();
-
- type = TREE_TYPE (decl);
-
- push_obstacks_nochange ();
- if (TYPE_READONLY_PROPERTY (type))
- {
- if (CH_TYPE_NONVALUE_P (type))
- {
- error_with_decl (decl, "`%s' must not be declared readonly");
- opt_init = NULL_TREE; /* prevent subsequent errors */
- }
- else if (opt_init == NULL_TREE && !opt_external)
- error("declaration of readonly variable without initialization");
- }
- TREE_READONLY (decl) = TYPE_READONLY (type);
-
- if (!opt_init && chill_varying_type_p (type))
- {
- tree fixed_part_type = TREE_TYPE (TREE_CHAIN (TYPE_FIELDS (type)));
- if (fixed_part_type != NULL_TREE && TREE_CODE (fixed_part_type) != ERROR_MARK)
- {
- if (CH_CHARS_TYPE_P (fixed_part_type))
- opt_init = build_chill_string (0, "");
- else
- opt_init = build_nt (CONSTRUCTOR, NULL_TREE, NULL_TREE);
- lifetime_bound = 1;
- }
- }
-
- if (opt_init)
- {
- if (CH_TYPE_NONVALUE_P (type))
- {
- error_with_decl (decl,
- "no initialisation allowed for `%s'");
- temp = NULL_TREE;
- }
- else if (TREE_CODE (type) == REFERENCE_TYPE)
- { /* A loc-identity declaration */
- if (! CH_LOCATION_P (opt_init))
- {
- error_with_decl (decl,
- "value for loc-identity `%s' is not a location");
- temp = NULL_TREE;
- }
- else if (! CH_READ_COMPATIBLE (TREE_TYPE (type),
- TREE_TYPE (opt_init)))
- {
- error_with_decl (decl,
- "location for `%s' not read-compatible");
- temp = NULL_TREE;
- }
- else
- temp = convert (type, opt_init);
- }
- else
- { /* Normal location declaration */
- char place[80];
- sprintf (place, "`%.60s' initializer",
- IDENTIFIER_POINTER (DECL_NAME (decl)));
- temp = chill_convert_for_assignment (type, opt_init, place);
- }
- }
- else if (CH_TYPE_NONVALUE_P (type))
- {
- temp = NULL_TREE;
- init_it = 1;
- }
- DECL_INITIAL (decl) = NULL_TREE;
-
- if (temp != NULL_TREE && TREE_CODE (temp) != ERROR_MARK)
- {
- /* The same for stack variables (assuming no nested modules). */
- if (lifetime_bound || !is_static)
- {
- if (is_static && ! TREE_CONSTANT (temp))
- error_with_decl (decl, "nonconstant initializer for `%s'");
- else
- DECL_INITIAL (decl) = temp;
- }
- }
- finish_decl (decl);
- /* Initialize the variable unless initialized statically. */
- if ((!is_static || ! lifetime_bound) &&
- temp != NULL_TREE && TREE_CODE (temp) != ERROR_MARK)
- {
- int was_used = TREE_USED (decl);
- emit_line_note (input_filename, lineno);
- expand_expr_stmt (build_chill_modify_expr (decl, temp));
- /* Don't let the initialization count as "using" the variable. */
- TREE_USED (decl) = was_used;
- if (current_function_decl == global_function_decl)
- build_constructor = 1;
- }
- else if (init_it && TREE_CODE (type) != ERROR_MARK)
- {
- /* Initialize variables with non-value type */
- int was_used = TREE_USED (decl);
- int something_initialised = 0;
-
- emit_line_note (input_filename, lineno);
- if (TREE_CODE (type) == RECORD_TYPE)
- something_initialised = init_nonvalue_struct (decl);
- else if (TREE_CODE (type) == ARRAY_TYPE)
- something_initialised = init_nonvalue_array (decl);
- if (! something_initialised)
- {
- error ("do_decl: internal error: don't know what to initialize");
- abort ();
- }
- /* Don't let the initialization count as "using" the variable. */
- TREE_USED (decl) = was_used;
- if (current_function_decl == global_function_decl)
- build_constructor = 1;
- }
- }
- return decl;
-}
-
-/*
- * ARGTYPES is a tree_list of formal argument types. TREE_VALUE
- * is the type tree for each argument, while the attribute is in
- * TREE_PURPOSE.
- */
-tree
-build_chill_function_type (return_type, argtypes, exceptions, recurse_p)
- tree return_type, argtypes, exceptions, recurse_p;
-{
- tree ftype, arg;
-
- if (exceptions != NULL_TREE)
- {
- /* if we have exceptions we add 2 arguments, callers filename
- and linenumber. These arguments will be added automatically
- when calling a function which may raise exceptions. */
- argtypes = chainon (argtypes,
- build_tree_list (NULL_TREE, ridpointers[(int) RID_PTR]));
- argtypes = chainon (argtypes,
- build_tree_list (NULL_TREE, ridpointers[(int) RID_LONG]));
-}
-
- /* Indicate the argument list is complete. */
- argtypes = chainon (argtypes,
- build_tree_list (NULL_TREE, void_type_node));
-
- /* INOUT and OUT parameters must be a REFERENCE_TYPE since
- we'll be passing a temporary's address at call time. */
- for (arg = argtypes; arg; arg = TREE_CHAIN (arg))
- if (TREE_PURPOSE (arg) == ridpointers[(int) RID_LOC]
- || TREE_PURPOSE (arg) == ridpointers[(int) RID_OUT]
- || TREE_PURPOSE (arg) == ridpointers[(int) RID_INOUT]
- )
- TREE_VALUE (arg) =
- build_chill_reference_type (TREE_VALUE (arg));
-
- /* Cannot use build_function_type, because if does hash-canonlicalization. */
- ftype = make_node (FUNCTION_TYPE);
- TREE_TYPE (ftype) = return_type ? return_type : void_type_node ;
- TYPE_ARG_TYPES (ftype) = argtypes;
-
- if (exceptions)
- ftype = build_exception_variant (ftype, exceptions);
-
- if (recurse_p)
- sorry ("RECURSIVE PROCs");
-
- return ftype;
-}
-
-/*
- * ARGTYPES is a tree_list of formal argument types.
- */
-tree
-push_extern_function (name, typespec, argtypes, exceptions, granting)
- tree name, typespec, argtypes, exceptions;
- int granting ATTRIBUTE_UNUSED;/*If 0 do pushdecl(); if 1 do push_granted()*/
-{
- tree ftype, fndecl;
-
- push_obstacks_nochange ();
- end_temporary_allocation ();
-
- if (pass < 2)
- {
- ftype = build_chill_function_type (typespec, argtypes,
- exceptions, NULL_TREE);
-
- fndecl = build_decl (FUNCTION_DECL, name, ftype);
-
- DECL_EXTERNAL(fndecl) = 1;
- TREE_STATIC (fndecl) = 1;
- TREE_PUBLIC (fndecl) = 1;
- if (pass == 0)
- {
- pushdecl (fndecl);
- finish_decl (fndecl);
- }
- else
- {
- save_decl (fndecl);
- pop_obstacks ();
- }
- make_function_rtl (fndecl);
- }
- else
- {
- fndecl = get_next_decl ();
- finish_decl (fndecl);
- }
-#if 0
-
- if (granting)
- push_granted (name, decl);
- else
- pushdecl(decl);
-#endif
- return fndecl;
-}
-
-
-
-void
-push_extern_process (name, argtypes, exceptions, granting)
- tree name, argtypes, exceptions;
- int granting;
-{
- tree decl, func, arglist;
-
- push_obstacks_nochange ();
- end_temporary_allocation ();
-
- if (pass < 2)
- {
- tree proc_struct = make_process_struct (name, argtypes);
- arglist = (argtypes == NULL_TREE) ? NULL_TREE :
- tree_cons (NULL_TREE,
- build_chill_pointer_type (proc_struct), NULL_TREE);
- }
- else
- arglist = NULL_TREE;
-
- func = push_extern_function (name, NULL_TREE, arglist,
- exceptions, granting);
-
- /* declare the code variable */
- decl = generate_tasking_code_variable (name, &process_type, 1);
- CH_DECL_PROCESS (func) = 1;
- /* remember the code variable in the function decl */
- DECL_TASKING_CODE_DECL (func) = (struct lang_decl *)decl;
-
- add_taskstuff_to_list (decl, "_TT_Process", NULL_TREE, func, NULL_TREE);
-}
-
-void
-push_extern_signal (signame, sigmodelist, optsigdest)
- tree signame, sigmodelist, optsigdest;
-{
- tree decl, sigtype;
-
- push_obstacks_nochange ();
- end_temporary_allocation ();
-
- sigtype =
- build_signal_struct_type (signame, sigmodelist, optsigdest);
-
- /* declare the code variable outside the process */
- decl = generate_tasking_code_variable (signame, &signal_code, 1);
- add_taskstuff_to_list (decl, "_TT_Signal", NULL_TREE, sigtype, NULL_TREE);
-}
-
-void
-print_mode (mode)
- tree mode;
-{
- while (mode != NULL_TREE)
- {
- switch (TREE_CODE (mode))
- {
- case POINTER_TYPE:
- printf (" REF ");
- mode = TREE_TYPE (mode);
- break;
- case INTEGER_TYPE:
- case REAL_TYPE:
- printf (" %s ", IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (mode))));
- mode = NULL_TREE;
- break;
- case ARRAY_TYPE:
- {
- tree itype = TYPE_DOMAIN (mode);
- if (CH_STRING_TYPE_P (mode))
- {
- fputs (" STRING (", stdout);
- printf (HOST_WIDE_INT_PRINT_DEC,
- TREE_INT_CST_LOW (TYPE_MAX_VALUE (itype)));
- fputs (") OF ", stdout);
- }
- else
- {
- fputs (" ARRAY (", stdout);
- printf (HOST_WIDE_INT_PRINT_DEC,
- TREE_INT_CST_LOW (TYPE_MIN_VALUE (itype)));
- fputs (":", stdout);
- printf (HOST_WIDE_INT_PRINT_DEC,
- TREE_INT_CST_LOW (TYPE_MAX_VALUE (itype)));
- fputs (") OF ", stdout);
- }
- mode = TREE_TYPE (mode);
- break;
- }
- case RECORD_TYPE:
- {
- tree fields = TYPE_FIELDS (mode);
- printf (" RECORD (");
- while (fields != NULL_TREE)
- {
- printf (" %s:", IDENTIFIER_POINTER (DECL_NAME (fields)));
- print_mode (TREE_TYPE (fields));
- if (TREE_CHAIN (fields))
- printf (",");
- fields = TREE_CHAIN (fields);
- }
- printf (")");
- mode = NULL_TREE;
- break;
- }
- default:
- abort ();
- }
- }
-}
-
-tree
-chill_munge_params (nodes, type, attr)
- tree nodes, type, attr;
-{
- tree node;
- if (pass == 1)
- {
- /* Convert the list of identifiers to a list of types. */
- for (node = nodes; node != NULL_TREE; node = TREE_CHAIN (node))
- {
- TREE_VALUE (node) = type; /* this was the identifier node */
- TREE_PURPOSE (node) = attr;
- }
- }
- return nodes;
-}
-
-/* Push the declarations described by SYN_DEFS into the current scope. */
-void
-push_syndecl (name, mode, value)
- tree name, mode, value;
-{
- if (pass == 1)
- {
- tree decl = make_node (CONST_DECL);
- DECL_NAME (decl) = name;
- DECL_ASSEMBLER_NAME (decl) = name;
- TREE_TYPE (decl) = mode;
- DECL_INITIAL (decl) = value;
- TREE_READONLY (decl) = 1;
- save_decl (decl);
- if (in_pseudo_module)
- push_granted (DECL_NAME (decl), decl);
- }
- else /* pass == 2 */
- get_next_decl ();
-}
-
-
-
-/* Push the declarations described by (MODENAME,MODE) into the current scope.
- MAKE_NEWMODE is 1 for NEWMODE, 0 for SYNMODE, and
- -1 for internal use (in which case the mode does not need to be copied). */
-
-tree
-push_modedef (modename, mode, make_newmode)
- tree modename;
- tree mode; /* ignored if pass==2. */
- int make_newmode;
-{
- tree newdecl, newmode;
-
- if (pass == 1)
- {
- /* FIXME: need to check here for SYNMODE fred fred; */
- push_obstacks (&permanent_obstack, &permanent_obstack);
-
- newdecl = build_lang_decl (TYPE_DECL, modename, mode);
-
- if (make_newmode >= 0)
- {
- newmode = make_node (LANG_TYPE);
- TREE_TYPE (newmode) = mode;
- TREE_TYPE (newdecl) = newmode;
- TYPE_NAME (newmode) = newdecl;
- if (make_newmode > 0)
- CH_NOVELTY (newmode) = newdecl;
- }
-
- save_decl (newdecl);
- pop_obstacks ();
-
- }
- else /* pass == 2 */
- {
- /* FIXME: need to check here for SYNMODE fred fred; */
- newdecl = get_next_decl ();
- if (DECL_NAME (newdecl) != modename)
- abort ();
- if (TREE_CODE (TREE_TYPE (newdecl)) != ERROR_MARK)
- {
- /* ASSOCIATION, ACCESS, TEXT, BUFFER, and EVENT must not be READOnly */
- if (TREE_READONLY (TREE_TYPE (newdecl)) &&
- (CH_IS_ASSOCIATION_MODE (TREE_TYPE (newdecl)) ||
- CH_IS_ACCESS_MODE (TREE_TYPE (newdecl)) ||
- CH_IS_TEXT_MODE (TREE_TYPE (newdecl)) ||
- CH_IS_BUFFER_MODE (TREE_TYPE (newdecl)) ||
- CH_IS_EVENT_MODE (TREE_TYPE (newdecl))))
- error_with_decl (newdecl, "`%s' must not be READonly");
- rest_of_decl_compilation (newdecl, NULL_PTR,
- global_bindings_p (), 0);
- }
- }
- return newdecl;
-}
-
-/* Return a chain of FIELD_DECLs for the names in NAMELIST. All of
- of type TYPE. When NAMELIST is passed in from the parser, it is
- in reverse order.
- LAYOUT is (NULL_TREE, integer_one_node, integer_zero_node, tree_list),
- meaning (default, pack, nopack, POS (...) ). */
-
-tree
-grok_chill_fixedfields (namelist, type, layout)
- tree namelist, type;
- tree layout;
-{
- tree decls = NULL_TREE;
-
- if (layout != NULL_TREE && TREE_CHAIN (namelist) != NULL_TREE)
- {
- if (layout != integer_one_node && layout != integer_zero_node)
- {
- layout = NULL_TREE;
- error ("POS may not be specified for a list of field declarations");
- }
- }
-
- /* we build the chain of FIELD_DECLs backwards, effectively
- unreversing the reversed names in NAMELIST. */
- for (; namelist; namelist = TREE_CHAIN (namelist))
- {
- tree decl = build_decl (FIELD_DECL,
- TREE_VALUE (namelist), type);
- DECL_INITIAL (decl) = layout;
- TREE_CHAIN (decl) = decls;
- decls = decl;
- }
-
- return decls;
-}
-
-struct tree_pair
-{
- tree value;
- tree decl;
-};
-
-static int label_value_cmp PARAMS ((struct tree_pair *,
- struct tree_pair *));
-
-/* Function to help qsort sort variant labels by value order. */
-static int
-label_value_cmp (x, y)
- struct tree_pair *x, *y;
-{
- return TREE_INT_CST_LOW (x->value) - TREE_INT_CST_LOW (y->value);
-}
-
-static tree
-make_chill_variants (tagfields, body, variantelse)
- tree tagfields;
- tree body;
- tree variantelse;
-{
- tree utype;
- tree first = NULL_TREE;
- for (; body; body = TREE_CHAIN (body))
- {
- tree decls = TREE_VALUE (body);
- tree labellist = TREE_PURPOSE (body);
-
- if (labellist != NULL_TREE
- && TREE_CODE (TREE_VALUE (labellist)) == TREE_LIST
- && TREE_VALUE (TREE_VALUE (labellist)) == case_else_node
- && TREE_CHAIN (labellist) == NULL_TREE)
- {
- if (variantelse)
- error ("(ELSE) case label as well as ELSE variant");
- variantelse = decls;
- }
- else
- {
- tree rtype = start_struct (RECORD_TYPE, NULL_TREE);
- rtype = finish_struct (rtype, decls);
-
- first = chainon (first, build_decl (FIELD_DECL, NULL_TREE, rtype));
-
- TYPE_TAG_VALUES (rtype) = labellist;
- }
- }
-
- if (variantelse != NULL_TREE)
- {
- tree rtype = start_struct (RECORD_TYPE, NULL_TREE);
- rtype = finish_struct (rtype, variantelse);
- first = chainon (first,
- build_decl (FIELD_DECL,
- ELSE_VARIANT_NAME, rtype));
- }
-
- utype = start_struct (UNION_TYPE, NULL_TREE);
- utype = finish_struct (utype, first);
- TYPE_TAGFIELDS (utype) = tagfields;
- return utype;
-}
-
-tree
-layout_chill_variants (utype)
- tree utype;
-{
- tree first = TYPE_FIELDS (utype);
- int nlabels, label_index = 0;
- struct tree_pair *label_value_array;
- tree decl;
- extern int errorcount;
-
- if (TYPE_SIZE (utype))
- return utype;
-
- for (decl = first; decl; decl = TREE_CHAIN (decl))
- {
- tree tagfields = TYPE_TAGFIELDS (utype);
- tree t = TREE_TYPE (decl);
- tree taglist = TYPE_TAG_VALUES (t);
- if (DECL_NAME (decl) == ELSE_VARIANT_NAME)
- continue;
- if (tagfields == NULL_TREE)
- continue;
- for ( ; tagfields != NULL_TREE && taglist != NULL_TREE;
- tagfields = TREE_CHAIN (tagfields), taglist = TREE_CHAIN (taglist))
- {
- tree labellist = TREE_VALUE (taglist);
- for (; labellist; labellist = TREE_CHAIN (labellist))
- {
- int compat_error = 0;
- tree label_value = TREE_VALUE (labellist);
- if (TREE_CODE (label_value) == RANGE_EXPR)
- {
- if (TREE_OPERAND (label_value, 0) != NULL_TREE)
- {
- if (!CH_COMPATIBLE (TREE_OPERAND (label_value, 0),
- TREE_TYPE (TREE_VALUE (tagfields)))
- || !CH_COMPATIBLE (TREE_OPERAND (label_value, 1),
- TREE_TYPE (TREE_VALUE (tagfields))))
- compat_error = 1;
- }
- }
- else if (TREE_CODE (label_value) == TYPE_DECL)
- {
- if (!CH_COMPATIBLE (label_value,
- TREE_TYPE (TREE_VALUE (tagfields))))
- compat_error = 1;
- }
- else if (TREE_CODE (label_value) == INTEGER_CST)
- {
- if (!CH_COMPATIBLE (label_value,
- TREE_TYPE (TREE_VALUE (tagfields))))
- compat_error = 1;
- }
- if (compat_error)
- {
- if (TYPE_FIELDS (t) == NULL_TREE)
- error ("inconsistent modes between labels and tag field");
- else
- error_with_decl (TYPE_FIELDS (t),
- "inconsistent modes between labels and tag field");
- }
- }
- }
- if (tagfields != NULL_TREE)
- error ("too few tag labels");
- if (taglist != NULL_TREE)
- error ("too many tag labels");
- }
-
- /* Compute the number of labels to be checked for duplicates. */
- nlabels = 0;
- for (decl = first; decl; decl = TREE_CHAIN (decl))
- {
- tree t = TREE_TYPE (decl);
- /* Only one tag (first case_label_list) supported, for now. */
- tree labellist = TYPE_TAG_VALUES (t);
- if (labellist)
- labellist = TREE_VALUE (labellist);
-
- for (; labellist != NULL_TREE; labellist = TREE_CHAIN (labellist))
- if (TREE_CODE (TREE_VALUE (labellist)) == INTEGER_CST)
- nlabels++;
- }
-
- /* Check for duplicate label values. */
- label_value_array = (struct tree_pair *)alloca (nlabels * sizeof (struct tree_pair));
- for (decl = first; decl; decl = TREE_CHAIN (decl))
- {
- tree t = TREE_TYPE (decl);
- /* Only one tag (first case_label_list) supported, for now. */
- tree labellist = TYPE_TAG_VALUES (t);
- if (labellist)
- labellist = TREE_VALUE (labellist);
-
- for (; labellist != NULL_TREE; labellist = TREE_CHAIN (labellist))
- {
- struct tree_pair p;
-
- tree x = TREE_VALUE (labellist);
- if (TREE_CODE (x) == RANGE_EXPR)
- {
- if (TREE_OPERAND (x, 0) != NULL_TREE)
- {
- if (TREE_CODE (TREE_OPERAND (x, 0)) != INTEGER_CST)
- error ("case label lower limit is not a discrete constant expression");
- if (TREE_CODE (TREE_OPERAND (x, 1)) != INTEGER_CST)
- error ("case label upper limit is not a discrete constant expression");
- }
- continue;
- }
- else if (TREE_CODE (x) == TYPE_DECL)
- continue;
- else if (TREE_CODE (x) == ERROR_MARK)
- continue;
- else if (TREE_CODE (x) != INTEGER_CST) /* <-- FIXME: what about CONST_DECLs? */
- {
- error ("case label must be a discrete constant expression");
- continue;
- }
-
- if (TREE_CODE (x) == CONST_DECL)
- x = DECL_INITIAL (x);
- if (TREE_CODE (x) != INTEGER_CST) abort ();
- p.value = x;
- p.decl = decl;
- if (p.decl == NULL_TREE)
- p.decl = TREE_VALUE (labellist);
- label_value_array[label_index++] = p;
- }
- }
- if (errorcount == 0)
- {
- int limit;
- qsort (label_value_array,
- label_index, sizeof (struct tree_pair),
- (int (*) PARAMS ((const void *, const void *))) label_value_cmp);
- limit = label_index - 1;
- for (label_index = 0; label_index < limit; label_index++)
- {
- if (tree_int_cst_equal (label_value_array[label_index].value,
- label_value_array[label_index+1].value))
- {
- error_with_decl (label_value_array[label_index].decl,
- "variant label declared here...");
- error_with_decl (label_value_array[label_index+1].decl,
- "...is duplicated here");
- }
- }
- }
- layout_type (utype);
- return utype;
-}
-
-/* Convert a TREE_LIST of tag field names into a list of
- field decls, found from FIXED_FIELDS, re-using the input list. */
-
-tree
-lookup_tag_fields (tag_field_names, fixed_fields)
- tree tag_field_names;
- tree fixed_fields;
-{
- tree list;
- for (list = tag_field_names; list != NULL_TREE; list = TREE_CHAIN (list))
- {
- tree decl = fixed_fields;
- for ( ; decl != NULL_TREE; decl = TREE_CHAIN (decl))
- {
- if (DECL_NAME (decl) == TREE_VALUE (list))
- {
- TREE_VALUE (list) = decl;
- break;
- }
- }
- if (decl == NULL_TREE)
- {
- error ("no field (yet) for tag %s",
- IDENTIFIER_POINTER (TREE_VALUE (list)));
- TREE_VALUE (list) = error_mark_node;
- }
- }
- return tag_field_names;
-}
-
-/* If non-NULL, TAGFIELDS is the tag fields for this variant record.
- BODY is a TREE_LIST of (optlabels, fixed fields).
- If non-null, VARIANTELSE is a fixed field for the else part of the
- variant record. */
-
-tree
-grok_chill_variantdefs (tagfields, body, variantelse)
- tree tagfields, body, variantelse;
-{
- tree t;
-
- t = make_chill_variants (tagfields, body, variantelse);
- if (pass != 1)
- t = layout_chill_variants (t);
- return build_decl (FIELD_DECL, NULL_TREE, t);
-}
-
-/*
- In pass 1, PARMS is a list of types (with attributes).
- In pass 2, PARMS is a chain of PARM_DECLs.
- */
-
-int
-start_chill_function (label, rtype, parms, exceptlist, attrs)
- tree label, rtype, parms, exceptlist, attrs;
-{
- tree decl, fndecl, type, result_type, func_type;
- int nested = current_function_decl != 0;
- if (pass == 1)
- {
- func_type
- = build_chill_function_type (rtype, parms, exceptlist, 0);
- fndecl = build_decl (FUNCTION_DECL, label, func_type);
-
- save_decl (fndecl);
-
- /* Make the init_value nonzero so pushdecl knows this is not tentative.
- error_mark_node is replaced below (in poplevel) with the BLOCK. */
- DECL_INITIAL (fndecl) = error_mark_node;
-
- DECL_EXTERNAL (fndecl) = 0;
-
- /* This function exists in static storage.
- (This does not mean `static' in the C sense!) */
- TREE_STATIC (fndecl) = 1;
-
- for (; attrs != NULL_TREE; attrs = TREE_CHAIN (attrs))
- {
- if (TREE_VALUE (attrs) == ridpointers[RID_GENERAL])
- CH_DECL_GENERAL (fndecl) = 1;
- else if (TREE_VALUE (attrs) == ridpointers[RID_SIMPLE])
- CH_DECL_SIMPLE (fndecl) = 1;
- else if (TREE_VALUE (attrs) == ridpointers[RID_RECURSIVE])
- CH_DECL_RECURSIVE (fndecl) = 1;
- else if (TREE_VALUE (attrs) == ridpointers[RID_INLINE])
- DECL_INLINE (fndecl) = 1;
- else
- abort ();
- }
- }
- else /* pass == 2 */
- {
- fndecl = get_next_decl ();
- if (DECL_NAME (fndecl) != label)
- abort (); /* outta sync - got wrong decl */
- func_type = TREE_TYPE (fndecl);
- if (TYPE_RAISES_EXCEPTIONS (func_type) != NULL_TREE)
- {
- /* In this case we have to add 2 parameters.
- See build_chill_function_type (pass == 1). */
- tree arg;
-
- arg = make_node (PARM_DECL);
- DECL_ASSEMBLER_NAME (arg) = DECL_NAME (arg) = get_identifier (CALLER_FILE);
- DECL_IGNORED_P (arg) = 1;
- parms = chainon (parms, arg);
-
- arg = make_node (PARM_DECL);
- DECL_ASSEMBLER_NAME (arg) = DECL_NAME (arg) = get_identifier (CALLER_LINE);
- DECL_IGNORED_P (arg) = 1;
- parms = chainon (parms, arg);
- }
- }
-
- current_function_decl = fndecl;
- result_type = TREE_TYPE (func_type);
- if (CH_TYPE_NONVALUE_P (result_type))
- error ("non-value mode may only returned by LOC");
-
- pushlevel (1); /* Push parameters. */
-
- if (pass == 2)
- {
- DECL_ARGUMENTS (fndecl) = parms;
- for (decl = DECL_ARGUMENTS (fndecl), type = TYPE_ARG_TYPES (func_type);
- decl != NULL_TREE;
- decl = TREE_CHAIN (decl), type = TREE_CHAIN (type))
- {
- /* check here that modes with the non-value property (like
- BUFFER's, EVENT's, ASSOCIATION's, ACCESS's, or TEXT's) only
- gets passed by LOC */
- tree argtype = TREE_VALUE (type);
- tree argattr = TREE_PURPOSE (type);
-
- if (TREE_CODE (argtype) == REFERENCE_TYPE)
- argtype = TREE_TYPE (argtype);
-
- if (TREE_CODE (argtype) != ERROR_MARK &&
- TREE_CODE_CLASS (TREE_CODE (argtype)) != 't')
- {
- error_with_decl (decl, "mode of `%s' is not a mode");
- TREE_VALUE (type) = error_mark_node;
- }
-
- if (CH_TYPE_NONVALUE_P (argtype) &&
- argattr != ridpointers[(int) RID_LOC])
- error_with_decl (decl, "`%s' may only be passed by LOC");
- TREE_TYPE (decl) = TREE_VALUE (type);
- DECL_ARG_TYPE (decl) = TREE_TYPE (decl);
- DECL_CONTEXT (decl) = fndecl;
- TREE_READONLY (decl) = TYPE_READONLY (argtype);
- layout_decl (decl, 0);
- }
-
- pushdecllist (DECL_ARGUMENTS (fndecl), 0);
-
- DECL_RESULT (current_function_decl)
- = build_decl (RESULT_DECL, NULL_TREE, result_type);
-
-#if 0
- /* Write a record describing this function definition to the prototypes
- file (if requested). */
- gen_aux_info_record (fndecl, 1, 0, prototype);
-#endif
-
- if (fndecl != global_function_decl || seen_action)
- {
- /* Initialize the RTL code for the function. */
- init_function_start (fndecl, input_filename, lineno);
-
- /* Set up parameters and prepare for return, for the function. */
- expand_function_start (fndecl, 0);
- }
-
- if (!nested)
- /* Allocate further tree nodes temporarily during compilation
- of this function only. */
- temporary_allocation ();
-
- /* If this fcn was already referenced via a block-scope `extern' decl (or
- an implicit decl), propagate certain information about the usage. */
- if (TREE_ADDRESSABLE (DECL_ASSEMBLER_NAME (current_function_decl)))
- TREE_ADDRESSABLE (current_function_decl) = 1;
- }
-
- /* Z.200 requires that formal parameter names be defined in
- the same block as the procedure body.
- We could do this by keeping boths sets of DECLs in the same
- scope, but we would have to be careful to not merge the
- two chains (e.g. DECL_ARGUEMENTS musr not contains locals).
- Instead, we just make sure they have the same nesting_level. */
- current_nesting_level--;
- pushlevel (1); /* Push local variables. */
-
- if (pass == 2 && (fndecl != global_function_decl || seen_action))
- {
- /* generate label for possible 'exit' */
- expand_start_bindings (1);
-
- result_never_set = 1;
- }
-
- if (TREE_CODE (result_type) == VOID_TYPE)
- chill_result_decl = NULL_TREE;
- else
- {
- /* We use the same name as the keyword.
- This makes it easy to print and change the RESULT from gdb. */
- const char *result_str =
- (ignore_case || ! special_UC) ? "result" : "RESULT";
- if (pass == 2 && TREE_CODE (result_type) == ERROR_MARK)
- TREE_TYPE (current_scope->remembered_decls) = result_type;
- chill_result_decl = do_decl (get_identifier (result_str),
- result_type, 0, 0, 0, 0);
- DECL_CONTEXT (chill_result_decl) = fndecl;
- }
-
- return 1;
-}
-
-/* For checking purpose added pname as new argument
- MW Wed Oct 14 14:22:10 1992 */
-void
-finish_chill_function ()
-{
- register tree fndecl = current_function_decl;
- tree outer_function = decl_function_context (fndecl);
- int nested;
- if (outer_function == NULL_TREE && fndecl != global_function_decl)
- outer_function = global_function_decl;
- nested = current_function_decl != global_function_decl;
- if (pass == 2 && (fndecl != global_function_decl || seen_action))
- expand_end_bindings (getdecls (), 1, 0);
-
- /* pop out of function */
- poplevel (1, 1, 0);
- current_nesting_level++;
- /* pop out of its parameters */
- poplevel (1, 0, 1);
-
- if (pass == 2)
- {
- /* TREE_READONLY (fndecl) = 1;
- This caused &foo to be of type ptr-to-const-function which
- then got a warning when stored in a ptr-to-function variable. */
-
- BLOCK_SUPERCONTEXT (DECL_INITIAL (fndecl)) = fndecl;
-
- /* Must mark the RESULT_DECL as being in this function. */
-
- DECL_CONTEXT (DECL_RESULT (fndecl)) = fndecl;
-
- if (fndecl != global_function_decl || seen_action)
- {
- /* Generate rtl for function exit. */
- expand_function_end (input_filename, lineno, 0);
-
- /* Run the optimizers and output assembler code for this function. */
- rest_of_compilation (fndecl);
- }
-
- if (DECL_SAVED_INSNS (fndecl) == 0 && ! nested)
- {
- /* Stop pointing to the local nodes about to be freed. */
- /* But DECL_INITIAL must remain nonzero so we know this
- was an actual function definition. */
- /* For a nested function, this is done in pop_chill_function_context. */
- DECL_INITIAL (fndecl) = error_mark_node;
- DECL_ARGUMENTS (fndecl) = 0;
- }
- }
- current_function_decl = outer_function;
-}
-
-/* process SEIZE */
-
-/* Points to the head of the _DECLs read from seize files. */
-#if 0
-static tree seized_decls;
-
-static tree processed_seize_files = 0;
-#endif
-
-void
-chill_seize (old_prefix, new_prefix, postfix)
- tree old_prefix, new_prefix, postfix;
-{
- if (pass == 1)
- {
- tree decl = build_alias_decl (old_prefix, new_prefix, postfix);
- DECL_SEIZEFILE(decl) = use_seizefile_name;
- save_decl (decl);
- }
- else /* pass == 2 */
- {
- /* Do nothing - get_next_decl automatically ignores ALIAS_DECLs */
- }
-}
-#if 0
-
-/*
- * output a debug dump of a scope structure
- */
-void
-debug_scope (sp)
- struct scope *sp;
-{
- if (sp == (struct scope *)NULL)
- {
- fprintf (stderr, "null scope ptr\n");
- return;
- }
- fprintf (stderr, "enclosing 0x%x ", sp->enclosing);
- fprintf (stderr, "next 0x%x ", sp->next);
- fprintf (stderr, "remembered_decls 0x%x ", sp->remembered_decls);
- fprintf (stderr, "decls 0x%x\n", sp->decls);
- fprintf (stderr, "shadowed 0x%x ", sp->shadowed);
- fprintf (stderr, "blocks 0x%x ", sp->blocks);
- fprintf (stderr, "this_block 0x%x ", sp->this_block);
- fprintf (stderr, "level_chain 0x%x\n", sp->level_chain);
- fprintf (stderr, "module_flag %c ", sp->module_flag ? 'T' : 'F');
- fprintf (stderr, "first_child_module 0x%x ", sp->first_child_module);
- fprintf (stderr, "next_sibling_module 0x%x\n", sp->next_sibling_module);
- if (sp->remembered_decls != NULL_TREE)
- {
- tree temp;
- fprintf (stderr, "remembered_decl chain:\n");
- for (temp = sp->remembered_decls; temp; temp = TREE_CHAIN (temp))
- debug_tree (temp);
- }
-}
-#endif
-
-static void
-save_decl (decl)
- tree decl;
-{
- if (current_function_decl != global_function_decl)
- DECL_CONTEXT (decl) = current_function_decl;
-
- TREE_CHAIN (decl) = current_scope->remembered_decls;
- current_scope->remembered_decls = decl;
-#if 0
- fprintf (stderr, "\n\nsave_decl 0x%x\n", decl);
- debug_scope (current_scope); /* ************* */
-#endif
- set_nesting_level (decl, current_nesting_level);
-}
-
-static tree
-get_next_decl ()
-{
- tree decl;
- do
- {
- decl = current_scope->remembered_decls;
- current_scope->remembered_decls = TREE_CHAIN (decl);
- /* We ignore ALIAS_DECLs, because push_scope_decls
- can convert a single ALIAS_DECL representing 'SEIZE ALL'
- into one ALIAS_DECL for each seizeable name.
- This means we lose the nice one-to-one mapping
- between pass 1 decls and pass 2 decls.
- (Perhaps ALIAS_DECLs should not be on the remembered_decls list.) */
- } while (decl && TREE_CODE (decl) == ALIAS_DECL);
- return decl;
-}
-
-/* At the end of pass 1, we reverse the chronological chain of scopes. */
-
-void
-switch_to_pass_2 ()
-{
-#if 0
- extern int errorcount, sorrycount;
-#endif
- if (current_scope != &builtin_scope)
- abort ();
- last_scope = &builtin_scope;
- builtin_scope.remembered_decls = nreverse (builtin_scope.remembered_decls);
- write_grant_file ();
-
-#if 0
- if (errorcount || sorrycount)
- exit (FATAL_EXIT_CODE);
- else
-#endif
- if (grant_only_flag)
- exit (SUCCESS_EXIT_CODE);
-
- pass = 2;
- module_number = 0;
- next_module = &first_module;
-}
-
-/*
- * Called during pass 2, when we're processing actions, to
- * generate a temporary variable. These don't need satisfying
- * because they're compiler-generated and always declared
- * before they're used.
- */
-tree
-decl_temp1 (name, type, opt_static, opt_init,
- opt_external, opt_public)
- tree name, type;
- int opt_static;
- tree opt_init;
- int opt_external, opt_public;
-{
- int orig_pass = pass; /* be cautious */
- tree mydecl;
-
- pass = 1;
- mydecl = do_decl (name, type, opt_static, opt_static,
- opt_init, opt_external);
-
- if (opt_public)
- TREE_PUBLIC (mydecl) = 1;
- pass = 2;
- do_decl (name, type, opt_static, opt_static, opt_init, opt_external);
-
- pass = orig_pass;
- return mydecl;
-}
-
-/* True if we're reading a seizefile, but we haven't seen a SPEC MODULE yet.
- For backwards compatibility, we treat declarations in such a context
- as implicity granted. */
-
-tree
-set_module_name (name)
- tree name;
-{
- module_number++;
- if (name == NULL_TREE)
- {
- /* NOTE: build_prefix_clause assumes a generated
- module starts with a '_'. */
- char buf[20];
- sprintf (buf, "_MODULE_%d", module_number);
- name = get_identifier (buf);
- }
- return name;
-}
-
-tree
-push_module (name, is_spec_module)
- tree name;
- int is_spec_module;
-{
- struct module *new_module;
- if (pass == 1)
- {
- new_module = (struct module*) permalloc (sizeof (struct module));
- new_module->prev_module = current_module;
-
- *next_module = new_module;
- }
- else
- {
- new_module = *next_module;
- }
- next_module = &new_module->next_module;
-
- new_module->procedure_seen = 0;
- new_module->is_spec_module = is_spec_module;
- new_module->name = name;
- if (current_module)
- new_module->prefix_name
- = get_identifier3 (IDENTIFIER_POINTER (current_module->prefix_name),
- "__", IDENTIFIER_POINTER (name));
- else
- new_module->prefix_name = name;
-
- new_module->granted_decls = NULL_TREE;
- new_module->nesting_level = current_nesting_level + 1;
-
- current_module = new_module;
- current_module_nesting_level = new_module->nesting_level;
- in_pseudo_module = name ? 0 : 1;
-
- pushlevel (1);
-
- current_scope->module_flag = 1;
-
- *current_scope->enclosing->tail_child_module = current_scope;
- current_scope->enclosing->tail_child_module
- = &current_scope->next_sibling_module;
-
- /* Rename the global function to have the same name as
- the first named non-spec module. */
- if (!is_spec_module
- && IDENTIFIER_POINTER (name)[0] != '_'
- && IDENTIFIER_POINTER (DECL_NAME (global_function_decl))[0] == '_')
- {
- tree fname = get_identifier3 ("", IDENTIFIER_POINTER (name), "_");
- DECL_NAME (global_function_decl) = fname;
- DECL_ASSEMBLER_NAME (global_function_decl) = fname;
- }
-
- return name; /* may have generated a name */
-}
-/* Make a copy of the identifier NAME, replacing each '!' by '__'. */
-static tree
-fix_identifier (name)
- tree name;
-{
- char *buf = (char*)alloca (2 * IDENTIFIER_LENGTH (name) + 1);
- int fixed = 0;
- register char *dptr = buf;
- register const char *sptr = IDENTIFIER_POINTER (name);
- for (; *sptr; sptr++)
- {
- if (*sptr == '!')
- {
- *dptr++ = '_';
- *dptr++ = '_';
- fixed++;
- }
- else
- *dptr++ = *sptr;
- }
- *dptr = '\0';
- return fixed ? get_identifier (buf) : name;
-}
-
-void
-find_granted_decls ()
-{
- if (pass == 1)
- {
- /* Match each granted name to a granted decl. */
-
- tree alias = current_module->granted_decls;
- tree next_alias, decl;
- /* This is an O(M*N) algorithm. FIXME! */
- for (; alias; alias = next_alias)
- {
- int found = 0;
- next_alias = TREE_CHAIN (alias);
- for (decl = current_scope->remembered_decls;
- decl; decl = TREE_CHAIN (decl))
- {
- tree new_name = (! DECL_NAME (decl)) ? NULL_TREE :
- decl_check_rename (alias,
- DECL_NAME (decl));
-
- if (!new_name)
- continue;
- /* A Seized declaration is not grantable. */
- if (TREE_CODE (decl) == ALIAS_DECL && !CH_DECL_GRANTED (decl))
- continue;
- found = 1;
- if (global_bindings_p ())
- TREE_PUBLIC (decl) = 1;
- if (DECL_ASSEMBLER_NAME (decl) == NULL_TREE)
- DECL_ASSEMBLER_NAME (decl) = fix_identifier (new_name);
- if (DECL_POSTFIX_ALL (alias))
- {
- tree new_alias
- = build_alias_decl (NULL_TREE, NULL_TREE, new_name);
- TREE_CHAIN (new_alias) = TREE_CHAIN (alias);
- TREE_CHAIN (alias) = new_alias;
- DECL_ABSTRACT_ORIGIN (new_alias) = decl;
- DECL_SOURCE_LINE (new_alias) = 0;
- DECL_SEIZEFILE (new_alias) = DECL_SEIZEFILE (alias);
- }
- else
- {
- DECL_ABSTRACT_ORIGIN (alias) = decl;
- break;
- }
- }
- if (!found)
- {
- error_with_decl (alias, "Nothing named `%s' to grant.");
- DECL_ABSTRACT_ORIGIN (alias) = error_mark_node;
- }
- }
- }
-}
-
-void
-pop_module ()
-{
- tree decl;
- struct scope *module_scope = current_scope;
-
- poplevel (0, 0, 0);
-
- if (pass == 1)
- {
- /* Write out the grant file. */
- if (!current_module->is_spec_module)
- {
- /* After reversal, TREE_CHAIN (last_old_decl) is the oldest
- decl of the current module. */
- write_spec_module (module_scope->remembered_decls,
- current_module->granted_decls);
- }
-
- /* Move the granted decls into the enclosing scope. */
- if (current_scope == global_scope)
- {
- tree next_decl;
- for (decl = current_module->granted_decls; decl; decl = next_decl)
- {
- tree name = DECL_NAME (decl);
- next_decl = TREE_CHAIN (decl);
- if (name != NULL_TREE)
- {
- tree old_decl = IDENTIFIER_OUTER_VALUE (name);
- set_nesting_level (decl, current_nesting_level);
- if (old_decl != NULL_TREE)
- {
- pedwarn_with_decl (decl, "duplicate grant for `%s'");
- pedwarn_with_decl (old_decl, "previous grant for `%s'");
- TREE_CHAIN (decl) = TREE_CHAIN (old_decl);
- TREE_CHAIN (old_decl) = decl;
- }
- else
- {
- TREE_CHAIN (decl) = outer_decls;
- outer_decls = decl;
- IDENTIFIER_OUTER_VALUE (name) = decl;
- }
- }
- }
- }
- else
- current_scope->granted_decls = chainon (current_module->granted_decls,
- current_scope->granted_decls);
- }
-
- chill_check_no_handlers (); /* Sanity test */
- current_module = current_module->prev_module;
- current_module_nesting_level = current_module ?
- current_module->nesting_level : 0;
- in_pseudo_module = 0;
-}
-
-/* Nonzero if we are currently in the global binding level. */
-
-int
-global_bindings_p ()
-{
- /* We return -1 here for the sake of variable_size() in ../stor-layout.c. */
- return (current_function_decl == NULL_TREE
- || current_function_decl == global_function_decl) ? -1 : 0;
-}
-
-/* Nonzero if the current level needs to have a BLOCK made. */
-
-int
-kept_level_p ()
-{
- return current_scope->decls != 0;
-}
-
-/* Make DECL visible.
- Save any existing definition.
- Check redefinitions at the same level.
- Suppress error messages if QUIET is true. */
-
-static void
-proclaim_decl (decl, quiet)
- tree decl;
- int quiet;
-{
- tree name = DECL_NAME (decl);
- if (name)
- {
- tree old_decl = IDENTIFIER_LOCAL_VALUE (name);
- if (old_decl == NULL) ; /* No duplication */
- else if (DECL_NESTING_LEVEL (old_decl) != current_nesting_level)
- {
- /* Record for restoration when this binding level ends. */
- current_scope->shadowed
- = tree_cons (name, old_decl, current_scope->shadowed);
- }
- else if (DECL_WEAK_NAME (decl))
- return;
- else if (!DECL_WEAK_NAME (old_decl))
- {
- tree base_decl = decl, base_old_decl = old_decl;
- while (TREE_CODE (base_decl) == ALIAS_DECL)
- base_decl = DECL_ABSTRACT_ORIGIN (base_decl);
- while (TREE_CODE (base_old_decl) == ALIAS_DECL)
- base_old_decl = DECL_ABSTRACT_ORIGIN (base_old_decl);
- /* Note that duplicate definitions are allowed for set elements
- of similar set modes. See Z200 (1988) 12.2.2.
- However, if the types are identical, we are defining the
- same name multiple times in the same SET, which is naughty. */
- if (!quiet && base_decl != base_old_decl)
- {
- if (TREE_CODE (base_decl) != CONST_DECL
- || TREE_CODE (base_old_decl) != CONST_DECL
- || !CH_DECL_ENUM (base_decl)
- || !CH_DECL_ENUM (base_old_decl)
- || TREE_TYPE (base_decl) == TREE_TYPE (base_old_decl)
- || !CH_SIMILAR (TREE_TYPE (base_decl),
- TREE_TYPE(base_old_decl)))
- {
- error_with_decl (decl, "duplicate definition `%s'");
- error_with_decl (old_decl, "previous definition of `%s'");
- }
- }
- }
- IDENTIFIER_LOCAL_VALUE (name) = decl;
- }
- /* Should be redundant most of the time ... */
- set_nesting_level (decl, current_nesting_level);
-}
-
-/* Return tree_cons (NULL_TREE, ELEMENT, LIST) unless ELEMENT
- is already in LIST, in which case return LIST. */
-
-static tree
-maybe_acons (element, list)
- tree element, list;
-{
- tree pair;
- for (pair = list; pair; pair = TREE_CHAIN (pair))
- if (element == TREE_VALUE (pair))
- return list;
- return tree_cons (NULL_TREE, element, list);
-}
-
-struct path
-{
- struct path *prev;
- tree node;
-};
-
-static tree find_implied_types PARAMS ((tree, struct path *, tree));
-
-/* Look for implied types (enumeral types) implied by TYPE (a decl or type).
- Add these to list.
- Use old_path to guard against cycles. */
-
-static tree
-find_implied_types (type, old_path, list)
- tree type;
- struct path *old_path;
- tree list;
-{
- struct path path[1], *link;
- if (type == NULL_TREE)
- return list;
- path[0].prev = old_path;
- path[0].node = type;
-
- /* Check for a cycle. Something more clever might be appropriate. FIXME? */
- for (link = old_path; link; link = link->prev)
- if (link->node == type)
- return list;
-
- switch (TREE_CODE (type))
- {
- case ENUMERAL_TYPE:
- return maybe_acons (type, list);
- case LANG_TYPE:
- case POINTER_TYPE:
- case REFERENCE_TYPE:
- case INTEGER_TYPE:
- return find_implied_types (TREE_TYPE (type), path, list);
- case SET_TYPE:
- return find_implied_types (TYPE_DOMAIN (type), path, list);
- case FUNCTION_TYPE:
-#if 0
- case PROCESS_TYPE:
-#endif
- { tree t;
- list = find_implied_types (TREE_TYPE (type), path, list);
- for (t = TYPE_ARG_TYPES (type); t != NULL_TREE; t = TREE_CHAIN (t))
- list = find_implied_types (TREE_VALUE (t), path, list);
- return list;
- }
- case ARRAY_TYPE:
- list = find_implied_types (TYPE_DOMAIN (type), path, list);
- return find_implied_types (TREE_TYPE (type), path, list);
- case RECORD_TYPE:
- case UNION_TYPE:
- { tree fields;
- for (fields = TYPE_FIELDS (type); fields != NULL_TREE;
- fields = TREE_CHAIN (fields))
- list = find_implied_types (TREE_TYPE (fields), path, list);
- return list;
- }
-
- case IDENTIFIER_NODE:
- return find_implied_types (lookup_name (type), path, list);
- break;
- case ALIAS_DECL:
- return find_implied_types (DECL_ABSTRACT_ORIGIN (type), path, list);
- case VAR_DECL:
- case FUNCTION_DECL:
- case TYPE_DECL:
- return find_implied_types (TREE_TYPE (type), path, list);
- default:
- return list;
- }
-}
-
-/* Make declarations in current scope visible.
- Also, expand SEIZEs, and make correspondong ALIAS_DECLs visible. */
-
-static void
-push_scope_decls (quiet)
- int quiet; /* If 1, we're pre-scanning, so suppress errors. */
-{
- tree decl;
-
- /* First make everything except 'SEIZE ALL' names visible, before
- handling 'SEIZE ALL'. (This makes it easier to check 'seizable'). */
- for (decl = current_scope->remembered_decls; decl; decl = TREE_CHAIN (decl))
- {
- if (TREE_CODE (decl) == ALIAS_DECL)
- {
- if (DECL_POSTFIX_ALL (decl))
- continue;
- if (DECL_ABSTRACT_ORIGIN (decl) == NULL_TREE)
- {
- tree val = lookup_name_for_seizing (decl);
- if (val == NULL_TREE)
- {
- error_with_file_and_line
- (DECL_SOURCE_FILE (decl), DECL_SOURCE_LINE (decl),
- "cannot SEIZE `%s'",
- IDENTIFIER_POINTER (DECL_OLD_NAME (decl)));
- val = error_mark_node;
- }
- DECL_ABSTRACT_ORIGIN (decl) = val;
- }
- }
- proclaim_decl (decl, quiet);
- }
-
- pushdecllist (current_scope->granted_decls, quiet);
-
- /* Now handle SEIZE ALLs. */
- for (decl = current_scope->remembered_decls; decl; )
- {
- tree next_decl = TREE_CHAIN (decl);
- if (TREE_CODE (decl) == ALIAS_DECL
- && DECL_ABSTRACT_ORIGIN (decl) == NULL_TREE
- && DECL_POSTFIX_ALL (decl))
- {
- /* We saw a "SEIZE ALL". Replace it be a SEIZE for each
- declaration visible in the surrounding scope.
- Note that this complicates get_next_decl(). */
- tree candidate;
- tree last_new_alias = decl;
- DECL_ABSTRACT_ORIGIN (decl) = error_mark_node;
- if (current_scope->enclosing == global_scope)
- candidate = outer_decls;
- else
- candidate = current_scope->enclosing->decls;
- for ( ; candidate; candidate = TREE_CHAIN (candidate))
- {
- tree seizename = DECL_NAME (candidate);
- tree new_name;
- tree new_alias;
- if (!seizename)
- continue;
- new_name = decl_check_rename (decl, seizename);
- if (!new_name)
- continue;
-
- /* Check if candidate is seizable. */
- if (lookup_name (new_name) != NULL_TREE)
- continue;
-
- new_alias = build_alias_decl (NULL_TREE,NULL_TREE, new_name);
- TREE_CHAIN (new_alias) = TREE_CHAIN (last_new_alias);
- TREE_CHAIN (last_new_alias) = new_alias;
- last_new_alias = new_alias;
- DECL_ABSTRACT_ORIGIN (new_alias) = candidate;
- DECL_SOURCE_LINE (new_alias) = 0;
-
- proclaim_decl (new_alias, quiet);
- }
- }
- decl = next_decl;
- }
-
- /* Link current_scope->remembered_decls at the head of the
- current_scope->decls list (just like pushdecllist, but
- without calling proclaim_decl, since we've already done that). */
- if ((decl = current_scope->remembered_decls) != NULL_TREE)
- {
- while (TREE_CHAIN (decl) != NULL_TREE)
- decl = TREE_CHAIN (decl);
- TREE_CHAIN (decl) = current_scope->decls;
- current_scope->decls = current_scope->remembered_decls;
- }
-}
-
-static void
-pop_scope_decls (decls_limit, shadowed_limit)
- tree decls_limit, shadowed_limit;
-{
- /* Remove the temporary bindings we made. */
- tree link = current_scope->shadowed;
- tree decl = current_scope->decls;
- if (decl != decls_limit)
- {
- while (decl != decls_limit)
- {
- tree next = TREE_CHAIN (decl);
- if (DECL_NAME (decl))
- {
- /* If the ident. was used or addressed via a local extern decl,
- don't forget that fact. */
- if (DECL_EXTERNAL (decl))
- {
- if (TREE_USED (decl))
- TREE_USED (DECL_NAME (decl)) = 1;
- if (TREE_ADDRESSABLE (decl))
- TREE_ADDRESSABLE (DECL_ASSEMBLER_NAME (decl)) = 1;
- }
- IDENTIFIER_LOCAL_VALUE (DECL_NAME (decl)) = 0;
- }
- if (next == decls_limit)
- {
- TREE_CHAIN (decl) = NULL_TREE;
- break;
- }
- decl = next;
- }
- current_scope->decls = decls_limit;
- }
-
- /* Restore all name-meanings of the outer levels
- that were shadowed by this level. */
- for ( ; link != shadowed_limit; link = TREE_CHAIN (link))
- IDENTIFIER_LOCAL_VALUE (TREE_PURPOSE (link)) = TREE_VALUE (link);
- current_scope->shadowed = shadowed_limit;
-}
-
-/* Return list of weak names (as ALIAS_DECLs) implied by IMPLIED_TYPES. */
-
-static tree
-build_implied_names (implied_types)
- tree implied_types;
-{
- tree aliases = NULL_TREE;
-
- for ( ; implied_types; implied_types = TREE_CHAIN (implied_types))
- {
- tree enum_type = TREE_VALUE (implied_types);
- tree link = TYPE_VALUES (enum_type);
- if (TREE_CODE (enum_type) != ENUMERAL_TYPE)
- abort ();
-
- for ( ; link; link = TREE_CHAIN (link))
- {
- /* We don't handle renaming/prefixes (Blue Book p 163) FIXME */
- /* Note that before enum_type is laid out, TREE_VALUE (link)
- is a CONST_DECL, while after it is laid out,
- TREE_VALUE (link) is an INTEGER_CST. Either works. */
- tree alias
- = build_alias_decl (NULL_TREE, NULL_TREE, TREE_PURPOSE (link));
- DECL_ABSTRACT_ORIGIN (alias) = TREE_VALUE (link);
- DECL_WEAK_NAME (alias) = 1;
- TREE_CHAIN (alias) = aliases;
- aliases = alias;
- /* Strictlt speaking, we should have a pointer from the alias
- to the decl, so we can make sure that the alias is only
- visible when the decl is. FIXME */
- }
- }
- return aliases;
-}
-
-static void
-bind_sub_modules (do_weak)
- int do_weak;
-{
- tree decl;
- int save_module_nesting_level = current_module_nesting_level;
- struct scope *saved_scope = current_scope;
- struct scope *nested_module = current_scope->first_child_module;
-
- while (nested_module != NULL)
- {
- tree saved_shadowed = nested_module->shadowed;
- tree saved_decls = nested_module->decls;
- current_nesting_level++;
- current_scope = nested_module;
- current_module_nesting_level = current_nesting_level;
- if (do_weak == 0)
- push_scope_decls (1);
- else
- {
- tree implied_types = NULL_TREE;
- /* Push weak names implied by decls in current_scope. */
- for (decl = current_scope->remembered_decls;
- decl; decl = TREE_CHAIN (decl))
- if (TREE_CODE (decl) == ALIAS_DECL)
- implied_types = find_implied_types (decl, NULL, implied_types);
- for (decl = current_scope->granted_decls;
- decl; decl = TREE_CHAIN (decl))
- implied_types = find_implied_types (decl, NULL, implied_types);
- current_scope->weak_decls = build_implied_names (implied_types);
- pushdecllist (current_scope->weak_decls, 1);
- }
-
- bind_sub_modules (do_weak);
- for (decl = current_scope->remembered_decls;
- decl; decl = TREE_CHAIN (decl))
- satisfy_decl (decl, 1);
- pop_scope_decls (saved_decls, saved_shadowed);
- current_nesting_level--;
- nested_module = nested_module->next_sibling_module;
- }
-
- current_scope = saved_scope;
- current_module_nesting_level = save_module_nesting_level;
-}
-
-/* Enter a new binding level.
- If two_pass==0, assume we are called from non-Chill-specific parts
- of the compiler. These parts assume a single pass.
- If two_pass==1, we're called from Chill parts of the compiler.
-*/
-
-void
-pushlevel (two_pass)
- int two_pass;
-{
- register struct scope *newlevel;
-
- current_nesting_level++;
- if (!two_pass)
- {
- newlevel = (struct scope *)xmalloc (sizeof(struct scope));
- *newlevel = clear_scope;
- newlevel->enclosing = current_scope;
- current_scope = newlevel;
- }
- else if (pass < 2)
- {
- newlevel = (struct scope *)permalloc (sizeof(struct scope));
- *newlevel = clear_scope;
- newlevel->tail_child_module = &newlevel->first_child_module;
- newlevel->enclosing = current_scope;
- current_scope = newlevel;
- last_scope->next = newlevel;
- last_scope = newlevel;
- }
- else /* pass == 2 */
- {
- tree decl;
- newlevel = current_scope = last_scope = last_scope->next;
-
- push_scope_decls (0);
- pushdecllist (current_scope->weak_decls, 0);
-
- /* If this is not a module scope, scan ahead for locally nested
- modules. (If this is a module, that's already done.) */
- if (!current_scope->module_flag)
- {
- bind_sub_modules (0);
- bind_sub_modules (1);
- }
-
- for (decl = current_scope->remembered_decls;
- decl; decl = TREE_CHAIN (decl))
- satisfy_decl (decl, 0);
- }
-
- /* Add this level to the front of the chain (stack) of levels that
- are active. */
-
- newlevel->level_chain = current_scope;
- current_scope = newlevel;
-
- newlevel->two_pass = two_pass;
-}
-
-/* Exit a binding level.
- Pop the level off, and restore the state of the identifier-decl mappings
- that were in effect when this level was entered.
-
- If KEEP is nonzero, this level had explicit declarations, so
- and create a "block" (a BLOCK node) for the level
- to record its declarations and subblocks for symbol table output.
-
- If FUNCTIONBODY is nonzero, this level is the body of a function,
- so create a block as if KEEP were set and also clear out all
- label names.
-
- If REVERSE is nonzero, reverse the order of decls before putting
- them into the BLOCK. */
-
-tree
-poplevel (keep, reverse, functionbody)
- int keep;
- int reverse;
- int functionbody;
-{
- register tree link;
- /* The chain of decls was accumulated in reverse order.
- Put it into forward order, just for cleanliness. */
- tree decls;
- tree subblocks;
- tree block = 0;
- tree decl;
- int block_previously_created = 0;
-
- if (current_scope == NULL)
- return error_mark_node;
-
- subblocks = current_scope->blocks;
-
- /* Get the decls in the order they were written.
- Usually current_scope->decls is in reverse order.
- But parameter decls were previously put in forward order. */
-
- if (reverse)
- current_scope->decls
- = decls = nreverse (current_scope->decls);
- else
- decls = current_scope->decls;
-
- if (pass == 2)
- {
- /* Output any nested inline functions within this block
- if they weren't already output. */
-
- for (decl = decls; decl; decl = TREE_CHAIN (decl))
- if (TREE_CODE (decl) == FUNCTION_DECL
- && ! TREE_ASM_WRITTEN (decl)
- && DECL_INITIAL (decl) != 0
- && TREE_ADDRESSABLE (decl))
- {
- /* If this decl was copied from a file-scope decl
- on account of a block-scope extern decl,
- propagate TREE_ADDRESSABLE to the file-scope decl. */
- if (DECL_ABSTRACT_ORIGIN (decl) != 0)
- TREE_ADDRESSABLE (DECL_ABSTRACT_ORIGIN (decl)) = 1;
- else
- {
- push_function_context ();
- output_inline_function (decl);
- pop_function_context ();
- }
- }
-
- /* Clear out the meanings of the local variables of this level. */
- pop_scope_decls (NULL_TREE, NULL_TREE);
-
- /* If there were any declarations or structure tags in that level,
- or if this level is a function body,
- create a BLOCK to record them for the life of this function. */
-
- block = 0;
- block_previously_created = (current_scope->this_block != 0);
- if (block_previously_created)
- block = current_scope->this_block;
- else if (keep || functionbody)
- block = make_node (BLOCK);
- if (block != 0)
- {
- tree *ptr;
- BLOCK_VARS (block) = decls;
-
- /* Splice out ALIAS_DECL and LABEL_DECLs,
- since instantiate_decls can't handle them. */
- for (ptr = &BLOCK_VARS (block); *ptr; )
- {
- decl = *ptr;
- if (TREE_CODE (decl) == ALIAS_DECL
- || TREE_CODE (decl) == LABEL_DECL)
- *ptr = TREE_CHAIN (decl);
- else
- ptr = &TREE_CHAIN(*ptr);
- }
-
- BLOCK_SUBBLOCKS (block) = subblocks;
- }
-
- /* In each subblock, record that this is its superior. */
-
- for (link = subblocks; link; link = TREE_CHAIN (link))
- BLOCK_SUPERCONTEXT (link) = block;
-
- }
-
- /* If the level being exited is the top level of a function,
- check over all the labels, and clear out the current
- (function local) meanings of their names. */
-
- if (pass == 2 && functionbody)
- {
- /* If this is the top level block of a function,
- the vars are the function's parameters.
- Don't leave them in the BLOCK because they are
- found in the FUNCTION_DECL instead. */
-
- BLOCK_VARS (block) = 0;
-
-#if 0
- /* Clear out the definitions of all label names,
- since their scopes end here,
- and add them to BLOCK_VARS. */
-
- for (link = named_labels; link; link = TREE_CHAIN (link))
- {
- register tree label = TREE_VALUE (link);
-
- if (DECL_INITIAL (label) == 0)
- {
- error_with_decl (label, "label `%s' used but not defined");
- /* Avoid crashing later. */
- define_label (input_filename, lineno,
- DECL_NAME (label));
- }
- else if (warn_unused_label && !TREE_USED (label))
- warning_with_decl (label, "label `%s' defined but not used");
- IDENTIFIER_LABEL_VALUE (DECL_NAME (label)) = 0;
-
- /* Put the labels into the "variables" of the
- top-level block, so debugger can see them. */
- TREE_CHAIN (label) = BLOCK_VARS (block);
- BLOCK_VARS (block) = label;
- }
-#endif
- }
-
- if (pass < 2)
- {
- current_scope->remembered_decls
- = nreverse (current_scope->remembered_decls);
- current_scope->granted_decls = nreverse (current_scope->granted_decls);
- }
-
- current_scope = current_scope->enclosing;
- current_nesting_level--;
-
- if (pass < 2)
- {
- return NULL_TREE;
- }
-
- /* Dispose of the block that we just made inside some higher level. */
- if (functionbody)
- DECL_INITIAL (current_function_decl) = block;
- else if (block)
- {
- if (!block_previously_created)
- current_scope->blocks
- = chainon (current_scope->blocks, block);
- }
- /* If we did not make a block for the level just exited,
- any blocks made for inner levels
- (since they cannot be recorded as subblocks in that level)
- must be carried forward so they will later become subblocks
- of something else. */
- else if (subblocks)
- current_scope->blocks
- = chainon (current_scope->blocks, subblocks);
-
- if (block)
- TREE_USED (block) = 1;
- return block;
-}
-
-/* Delete the node BLOCK from the current binding level.
- This is used for the block inside a stmt expr ({...})
- so that the block can be reinserted where appropriate. */
-
-void
-delete_block (block)
- tree block;
-{
- tree t;
- if (current_scope->blocks == block)
- current_scope->blocks = TREE_CHAIN (block);
- for (t = current_scope->blocks; t;)
- {
- if (TREE_CHAIN (t) == block)
- TREE_CHAIN (t) = TREE_CHAIN (block);
- else
- t = TREE_CHAIN (t);
- }
- TREE_CHAIN (block) = NULL;
- /* Clear TREE_USED which is always set by poplevel.
- The flag is set again if insert_block is called. */
- TREE_USED (block) = 0;
-}
-
-/* Insert BLOCK at the end of the list of subblocks of the
- current binding level. This is used when a BIND_EXPR is expanded,
- to handle the BLOCK node inside teh BIND_EXPR. */
-
-void
-insert_block (block)
- tree block;
-{
- TREE_USED (block) = 1;
- current_scope->blocks
- = chainon (current_scope->blocks, block);
-}
-
-/* Set the BLOCK node for the innermost scope
- (the one we are currently in). */
-
-void
-set_block (block)
- register tree block;
-{
- current_scope->this_block = block;
-}
-
-/* Record a decl-node X as belonging to the current lexical scope.
- Check for errors (such as an incompatible declaration for the same
- name already seen in the same scope).
-
- Returns either X or an old decl for the same name.
- If an old decl is returned, it may have been smashed
- to agree with what X says. */
-
-tree
-pushdecl (x)
- tree x;
-{
- register tree name = DECL_NAME (x);
- register struct scope *b = current_scope;
-
- DECL_CONTEXT (x) = current_function_decl;
- /* A local extern declaration for a function doesn't constitute nesting.
- A local auto declaration does, since it's a forward decl
- for a nested function coming later. */
- if (TREE_CODE (x) == FUNCTION_DECL && DECL_INITIAL (x) == 0
- && DECL_EXTERNAL (x))
- DECL_CONTEXT (x) = 0;
-
- if (name)
- proclaim_decl (x, 0);
-
- if (TREE_CODE (x) == TYPE_DECL && DECL_SOURCE_LINE (x) == 0
- && TYPE_NAME (TREE_TYPE (x)) == 0)
- TYPE_NAME (TREE_TYPE (x)) = x;
-
- /* Put decls on list in reverse order.
- We will reverse them later if necessary. */
- TREE_CHAIN (x) = b->decls;
- b->decls = x;
-
- return x;
-}
-
-/* Make DECLS (a chain of decls) visible in the current_scope. */
-
-static void
-pushdecllist (decls, quiet)
- tree decls;
- int quiet;
-{
- tree last = NULL_TREE, decl;
-
- for (decl = decls; decl != NULL_TREE;
- last = decl, decl = TREE_CHAIN (decl))
- {
- proclaim_decl (decl, quiet);
- }
-
- if (last)
- {
- TREE_CHAIN (last) = current_scope->decls;
- current_scope->decls = decls;
- }
-}
-
-/* Like pushdecl, only it places X in GLOBAL_SCOPE, if appropriate. */
-
-tree
-pushdecl_top_level (x)
- tree x;
-{
- register tree t;
- register struct scope *b = current_scope;
-
- current_scope = global_scope;
- t = pushdecl (x);
- current_scope = b;
- return t;
-}
-
-/* Define a label, specifying the location in the source file.
- Return the LABEL_DECL node for the label, if the definition is valid.
- Otherwise return 0. */
-
-tree
-define_label (filename, line, name)
- const char *filename;
- int line;
- tree name;
-{
- tree decl;
-
- if (pass == 1)
- {
- decl = build_decl (LABEL_DECL, name, void_type_node);
-
- /* A label not explicitly declared must be local to where it's ref'd. */
- DECL_CONTEXT (decl) = current_function_decl;
-
- DECL_MODE (decl) = VOIDmode;
-
- /* Say where one reference is to the label,
- for the sake of the error if it is not defined. */
- DECL_SOURCE_LINE (decl) = line;
- DECL_SOURCE_FILE (decl) = filename;
-
- /* Mark label as having been defined. */
- DECL_INITIAL (decl) = error_mark_node;
-
- DECL_ACTION_NESTING_LEVEL (decl) = action_nesting_level;
-
- save_decl (decl);
- }
- else
- {
- decl = get_next_decl ();
- /* Make sure every label has an rtx. */
-
- label_rtx (decl);
- expand_label (decl);
- }
- return decl;
-}
-
-/* Return the list of declarations of the current level.
- Note that this list is in reverse order unless/until
- you nreverse it; and when you do nreverse it, you must
- store the result back using `storedecls' or you will lose. */
-
-tree
-getdecls ()
-{
- /* This is a kludge, so that dbxout_init can get the predefined types,
- which are in the builtin_scope, though when it is called,
- the current_scope is the global_scope.. */
- if (current_scope == global_scope)
- return builtin_scope.decls;
- return current_scope->decls;
-}
-
-#if 0
-/* Store the list of declarations of the current level.
- This is done for the parameter declarations of a function being defined,
- after they are modified in the light of any missing parameters. */
-
-static void
-storedecls (decls)
- tree decls;
-{
- current_scope->decls = decls;
-}
-#endif
-
-/* Look up NAME in the current binding level and its superiors
- in the namespace of variables, functions and typedefs.
- Return a ..._DECL node of some kind representing its definition,
- or return 0 if it is undefined. */
-
-tree
-lookup_name (name)
- tree name;
-{
- register tree val = IDENTIFIER_LOCAL_VALUE (name);
-
- if (val == NULL_TREE)
- return NULL_TREE;
- if (TREE_CODE_CLASS (TREE_CODE (val)) == 'c')
- return val;
- if (DECL_NESTING_LEVEL (val) > BUILTIN_NESTING_LEVEL
- && DECL_NESTING_LEVEL (val) < current_module_nesting_level)
- {
- return NULL_TREE;
- }
- while (TREE_CODE (val) == ALIAS_DECL)
- {
- val = DECL_ABSTRACT_ORIGIN (val);
- if (TREE_CODE (val) == ERROR_MARK)
- return NULL_TREE;
- }
- if (TREE_CODE (val) == BASED_DECL)
- {
- return build_chill_indirect_ref (DECL_ABSTRACT_ORIGIN (val),
- TREE_TYPE (val), 1);
- }
- if (TREE_CODE (val) == WITH_DECL)
- return build_component_ref (DECL_ABSTRACT_ORIGIN (val), DECL_NAME (val));
- return val;
-}
-
-#if 0
-/* Similar to `lookup_name' but look only at current binding level. */
-
-static tree
-lookup_name_current_level (name)
- tree name;
-{
- register tree val = IDENTIFIER_LOCAL_VALUE (name);
- if (val && DECL_NESTING_LEVEL (val) == current_nesting_level)
- return val;
- return NULL_TREE;
-}
-#endif
-
-static tree
-lookup_name_for_seizing (seize_decl)
- tree seize_decl;
-{
- tree name = DECL_OLD_NAME (seize_decl);
- register tree val;
- val = IDENTIFIER_LOCAL_VALUE (name);
- if (val == NULL_TREE || DECL_NESTING_LEVEL (val) == BUILTIN_NESTING_LEVEL)
- {
- val = IDENTIFIER_OUTER_VALUE (name);
- if (val == NULL_TREE)
- return NULL_TREE;
- if (TREE_CHAIN (val) && DECL_NAME (TREE_CHAIN (val)) == name)
- { /* More than one decl with the same name has been granted
- into the same global scope. Pick the one (we hope) that
- came from a seizefile the matches the most recent
- seizefile (as given by DECL_SEIZEFILE (seize_decl).) */
- tree d, best = NULL_TREE;
- for (d = val; d != NULL_TREE && DECL_NAME (d) == name;
- d = TREE_CHAIN (d))
- if (DECL_SEIZEFILE (d) == DECL_SEIZEFILE (seize_decl))
- {
- if (best)
- {
- error_with_decl (seize_decl,
- "ambiguous choice for seize `%s' -");
- error_with_decl (best, " - can seize this `%s' -");
- error_with_decl (d, " - or this granted decl `%s'");
- return NULL_TREE;
- }
- best = d;
- }
- if (best == NULL_TREE)
- {
- error_with_decl (seize_decl,
- "ambiguous choice for seize `%s' -");
- error_with_decl (val, " - can seize this `%s' -");
- error_with_decl (TREE_CHAIN (val),
- " - or this granted decl `%s'");
- return NULL_TREE;
- }
- val = best;
- }
- }
-#if 0
- /* We don't need to handle this, as long as we
- resolve the seize targets before pushing them. */
- if (DECL_NESTING_LEVEL (val) >= current_module_nesting_level)
- {
- /* VAL was declared inside current module. We need something
- from the scope *enclosing* the current module, so search
- through the shadowed declarations. */
- /* TODO - FIXME */
- }
-#endif
- if (current_module && current_module->prev_module
- && DECL_NESTING_LEVEL (val)
- < current_module->prev_module->nesting_level)
- {
-
- /* It's declared in a scope enclosing the module enclosing
- the current module. Hence it's not visible. */
- return NULL_TREE;
- }
- while (TREE_CODE (val) == ALIAS_DECL)
- {
- val = DECL_ABSTRACT_ORIGIN (val);
- if (TREE_CODE (val) == ERROR_MARK)
- return NULL_TREE;
- }
- return val;
-}
-
-/* Create the predefined scalar types of C,
- and some nodes representing standard constants (0, 1, (void *)0).
- Initialize the global binding level.
- Make definitions for built-in primitive functions. */
-
-void
-init_decl_processing ()
-{
- int wchar_type_size;
- tree bool_ftype_int_ptr_int;
- tree bool_ftype_int_ptr_int_int;
- tree bool_ftype_luns_ptr_luns_long;
- tree bool_ftype_luns_ptr_luns_long_ptr_int;
- tree bool_ftype_ptr_int_ptr_int;
- tree bool_ftype_ptr_int_ptr_int_int;
- tree find_bit_ftype;
- tree bool_ftype_ptr_ptr_int;
- tree bool_ftype_ptr_ptr_luns;
- tree bool_ftype_ptr_ptr_ptr_luns;
- tree endlink;
- tree int_ftype_int;
- tree int_ftype_int_int;
- tree int_ftype_int_ptr_int;
- tree int_ftype_ptr;
- tree int_ftype_ptr_int;
- tree int_ftype_ptr_int_int_ptr_int;
- tree int_ftype_ptr_luns_long_ptr_int;
- tree int_ftype_ptr_ptr_int;
- tree int_ftype_ptr_ptr_luns;
- tree long_ftype_ptr_luns;
- tree memcpy_ftype;
- tree memcmp_ftype;
- tree ptr_ftype_ptr_int_int;
- tree ptr_ftype_ptr_ptr_int;
- tree ptr_ftype_ptr_ptr_int_ptr_int;
- tree real_ftype_real;
- tree temp;
- tree void_ftype_cptr_cptr_int;
- tree void_ftype_long_int_ptr_int_ptr_int;
- tree void_ftype_ptr;
- tree void_ftype_ptr_int_int_int_int;
- tree void_ftype_ptr_int_ptr_int_int_int;
- tree void_ftype_ptr_int_ptr_int_ptr_int;
- tree void_ftype_ptr_luns_long_long_bool_ptr_int;
- tree void_ftype_ptr_luns_ptr_luns_luns_luns;
- tree void_ftype_ptr_ptr_ptr_int;
- tree void_ftype_ptr_ptr_ptr_luns;
- tree void_ftype_refptr_int_ptr_int;
- tree void_ftype_void;
- tree void_ftype_ptr_ptr_int;
- tree void_ftype_ptr_luns_luns_cptr_luns_luns_luns;
- tree ptr_ftype_luns_ptr_int;
- tree double_ftype_double;
-
- /* allow 0-255 enums to occupy only a byte */
- flag_short_enums = 1;
-
- current_function_decl = NULL;
-
- set_alignment = BITS_PER_UNIT;
-
- ALL_POSTFIX = get_identifier ("*");
- string_index_type_dummy = get_identifier("%string-index%");
-
- var_length_id = get_identifier (VAR_LENGTH);
- var_data_id = get_identifier (VAR_DATA);
-
- build_common_tree_nodes (1);
-
- if (CHILL_INT_IS_SHORT)
- long_integer_type_node = integer_type_node;
- else
- long_integer_type_node = make_signed_type (LONG_TYPE_SIZE);
-
- /* `unsigned long' is the standard type for sizeof.
- Note that stddef.h uses `unsigned long',
- and this must agree, even of long and int are the same size. */
-#ifndef SIZE_TYPE
- set_sizetype (long_unsigned_type_node);
-#else
- {
- const char *size_type_c_name = SIZE_TYPE;
- if (strncmp (size_type_c_name, "long long ", 10) == 0)
- set_sizetype (long_long_unsigned_type_node);
- else if (strncmp (size_type_c_name, "long ", 5) == 0)
- set_sizetype (long_unsigned_type_node);
- else
- set_sizetype (unsigned_type_node);
- }
-#endif
-
- pushdecl (build_decl (TYPE_DECL, ridpointers[(int) RID_FLOAT],
- float_type_node));
- pushdecl (build_decl (TYPE_DECL, ridpointers[(int) RID_DOUBLE],
- double_type_node));
-
- build_common_tree_nodes_2 (flag_short_double);
-
- pushdecl (build_decl (TYPE_DECL,
- ridpointers[(int) RID_VOID], void_type_node));
- /* We are not going to have real types in C with less than byte alignment,
- so we might as well not have any types that claim to have it. */
- TYPE_ALIGN (void_type_node) = BITS_PER_UNIT;
- TYPE_USER_ALIGN (void_type_node) = 0;
-
- /* This is for wide string constants. */
- wchar_type_node = short_unsigned_type_node;
- wchar_type_size = TYPE_PRECISION (wchar_type_node);
- signed_wchar_type_node = type_for_size (wchar_type_size, 0);
- unsigned_wchar_type_node = type_for_size (wchar_type_size, 1);
-
- default_function_type
- = build_function_type (integer_type_node, NULL_TREE);
-
- ptr_type_node = build_pointer_type (void_type_node);
- const_ptr_type_node
- = build_pointer_type (build_type_variant (void_type_node, 1, 0));
-
- void_list_node = build_tree_list (NULL_TREE, void_type_node);
-
- boolean_type_node = make_node (BOOLEAN_TYPE);
- TYPE_PRECISION (boolean_type_node) = 1;
- fixup_unsigned_type (boolean_type_node);
- boolean_false_node = TYPE_MIN_VALUE (boolean_type_node);
- boolean_true_node = TYPE_MAX_VALUE (boolean_type_node);
- pushdecl (build_decl (TYPE_DECL, ridpointers[(int)RID_BOOL],
- boolean_type_node));
-
- /* TRUE and FALSE have the BOOL derived class */
- CH_DERIVED_FLAG (boolean_true_node) = 1;
- CH_DERIVED_FLAG (boolean_false_node) = 1;
-
- signed_boolean_type_node = make_node (BOOLEAN_TYPE);
- temp = build_int_2 (-1, -1);
- TREE_TYPE (temp) = signed_boolean_type_node;
- TYPE_MIN_VALUE (signed_boolean_type_node) = temp;
- temp = build_int_2 (0, 0);
- TREE_TYPE (temp) = signed_boolean_type_node;
- TYPE_MAX_VALUE (signed_boolean_type_node) = temp;
- layout_type (signed_boolean_type_node);
-
-
- bitstring_one_type_node = build_bitstring_type (integer_one_node);
- bit_zero_node = build (CONSTRUCTOR, bitstring_one_type_node, NULL_TREE,
- NULL_TREE);
- bit_one_node = build (CONSTRUCTOR, bitstring_one_type_node, NULL_TREE,
- build_tree_list (NULL_TREE, integer_zero_node));
-
- pushdecl (build_decl (TYPE_DECL, ridpointers[(int)RID_CHAR],
- char_type_node));
-
- if (CHILL_INT_IS_SHORT)
- {
- chill_integer_type_node = short_integer_type_node;
- chill_unsigned_type_node = short_unsigned_type_node;
- }
- else
- {
- chill_integer_type_node = integer_type_node;
- chill_unsigned_type_node = unsigned_type_node;
- }
-
- string_one_type_node = build_string_type (char_type_node, integer_one_node);
-
- pushdecl (build_decl (TYPE_DECL, ridpointers[(int)RID_BYTE],
- signed_char_type_node));
- pushdecl (build_decl (TYPE_DECL, ridpointers[(int)RID_UBYTE],
- unsigned_char_type_node));
-
- pushdecl (build_decl (TYPE_DECL, ridpointers[(int)RID_INT],
- chill_integer_type_node));
-
- pushdecl (build_decl (TYPE_DECL, ridpointers[(int)RID_UINT],
- chill_unsigned_type_node));
-
- pushdecl (build_decl (TYPE_DECL, ridpointers[(int)RID_LONG],
- long_integer_type_node));
-
- set_sizetype (long_integer_type_node);
-#if 0
- ptrdiff_type_node
- = TREE_TYPE (IDENTIFIER_LOCAL_VALUE (get_identifier (PTRDIFF_TYPE)));
-#endif
- pushdecl (build_decl (TYPE_DECL, ridpointers[(int)RID_ULONG],
- long_unsigned_type_node));
- pushdecl (build_decl (TYPE_DECL, ridpointers[(int)RID_REAL],
- float_type_node));
- pushdecl (build_decl (TYPE_DECL, ridpointers[(int)RID_LONG_REAL],
- double_type_node));
- pushdecl (build_decl (TYPE_DECL, ridpointers[(int)RID_PTR],
- ptr_type_node));
-
- IDENTIFIER_LOCAL_VALUE (ridpointers[(int)RID_TRUE]) =
- boolean_true_node;
- IDENTIFIER_LOCAL_VALUE (ridpointers[(int)RID_FALSE]) =
- boolean_false_node;
- IDENTIFIER_LOCAL_VALUE (ridpointers[(int)RID_NULL]) =
- null_pointer_node;
-
- /* The second operand is set to non-NULL to distinguish
- (ELSE) from (*). Used when writing grant files. */
- case_else_node = build (RANGE_EXPR,
- NULL_TREE, NULL_TREE, boolean_false_node);
-
- pushdecl (temp = build_decl (TYPE_DECL,
- get_identifier ("__tmp_initializer"),
- build_init_struct ()));
- DECL_SOURCE_LINE (temp) = 0;
- initializer_type = TREE_TYPE (temp);
-
- memcpy (tree_code_type + (int) LAST_AND_UNUSED_TREE_CODE,
- chill_tree_code_type,
- (((int) LAST_CHILL_TREE_CODE - (int) LAST_AND_UNUSED_TREE_CODE)
- * sizeof (char)));
- memcpy (tree_code_length + (int) LAST_AND_UNUSED_TREE_CODE,
- chill_tree_code_length,
- (((int) LAST_CHILL_TREE_CODE - (int) LAST_AND_UNUSED_TREE_CODE)
- * sizeof (int)));
- memcpy (tree_code_name + (int) LAST_AND_UNUSED_TREE_CODE,
- chill_tree_code_name,
- (((int) LAST_CHILL_TREE_CODE - (int) LAST_AND_UNUSED_TREE_CODE)
- * sizeof (char *)));
- boolean_code_name = (const char **) xcalloc (sizeof (char *),
- (int) LAST_CHILL_TREE_CODE);
-
- boolean_code_name[EQ_EXPR] = "=";
- boolean_code_name[NE_EXPR] = "/=";
- boolean_code_name[LT_EXPR] = "<";
- boolean_code_name[GT_EXPR] = ">";
- boolean_code_name[LE_EXPR] = "<=";
- boolean_code_name[GE_EXPR] = ">=";
- boolean_code_name[SET_IN_EXPR] = "in";
- boolean_code_name[TRUTH_ANDIF_EXPR] = "andif";
- boolean_code_name[TRUTH_ORIF_EXPR] = "orif";
- boolean_code_name[TRUTH_AND_EXPR] = "and";
- boolean_code_name[TRUTH_OR_EXPR] = "or";
- boolean_code_name[BIT_AND_EXPR] = "and";
- boolean_code_name[BIT_IOR_EXPR] = "or";
- boolean_code_name[BIT_XOR_EXPR] = "xor";
-
- endlink = void_list_node;
-
- chill_predefined_function_type
- = build_function_type (integer_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- endlink));
-
- bool_ftype_int_ptr_int
- = build_function_type (boolean_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- endlink))));
- bool_ftype_int_ptr_int
- = build_function_type (boolean_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- endlink)))));
- bool_ftype_int_ptr_int_int
- = build_function_type (boolean_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- endlink)))));
- bool_ftype_luns_ptr_luns_long
- = build_function_type (boolean_type_node,
- tree_cons (NULL_TREE, long_unsigned_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, long_unsigned_type_node,
- tree_cons (NULL_TREE, long_integer_type_node,
- endlink)))));
- bool_ftype_luns_ptr_luns_long_ptr_int
- = build_function_type (boolean_type_node,
- tree_cons (NULL_TREE, long_unsigned_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, long_unsigned_type_node,
- tree_cons (NULL_TREE, long_integer_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- endlink)))))));
- bool_ftype_ptr_ptr_int
- = build_function_type (boolean_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- endlink))));
- bool_ftype_ptr_ptr_luns
- = build_function_type (boolean_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, long_unsigned_type_node,
- endlink))));
- bool_ftype_ptr_ptr_ptr_luns
- = build_function_type (boolean_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, long_unsigned_type_node,
- endlink)))));
- bool_ftype_ptr_int_ptr_int
- = build_function_type (boolean_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- endlink)))));
- bool_ftype_ptr_int_ptr_int_int
- = build_function_type (boolean_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- endlink))))));
- find_bit_ftype
- = build_function_type (integer_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, long_unsigned_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- endlink))));
- int_ftype_int
- = build_function_type (integer_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- endlink));
- int_ftype_int_int
- = build_function_type (integer_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- endlink)));
- int_ftype_int_ptr_int
- = build_function_type (integer_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- endlink))));
- int_ftype_ptr
- = build_function_type (integer_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- endlink));
- int_ftype_ptr_int
- = build_function_type (integer_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- endlink)));
-
- long_ftype_ptr_luns
- = build_function_type (long_integer_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, long_unsigned_type_node,
- endlink)));
-
- int_ftype_ptr_int_int_ptr_int
- = build_function_type (integer_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- endlink))))));
-
- int_ftype_ptr_luns_long_ptr_int
- = build_function_type (integer_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, long_unsigned_type_node,
- tree_cons (NULL_TREE, long_integer_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- endlink))))));
-
- int_ftype_ptr_ptr_int
- = build_function_type (integer_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- endlink))));
- int_ftype_ptr_ptr_luns
- = build_function_type (integer_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, long_unsigned_type_node,
- endlink))));
- memcpy_ftype /* memcpy/memmove prototype */
- = build_function_type (ptr_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, const_ptr_type_node,
- tree_cons (NULL_TREE, sizetype,
- endlink))));
- memcmp_ftype /* memcmp prototype */
- = build_function_type (integer_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, sizetype,
- endlink))));
-
- ptr_ftype_ptr_int_int
- = build_function_type (ptr_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- endlink))));
- ptr_ftype_ptr_ptr_int
- = build_function_type (ptr_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- endlink))));
- ptr_ftype_ptr_ptr_int_ptr_int
- = build_function_type (void_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- endlink))))));
- real_ftype_real
- = build_function_type (float_type_node,
- tree_cons (NULL_TREE, float_type_node,
- endlink));
-
- void_ftype_ptr
- = build_function_type (void_type_node,
- tree_cons (NULL_TREE, ptr_type_node, endlink));
-
- void_ftype_cptr_cptr_int
- = build_function_type (void_type_node,
- tree_cons (NULL_TREE, const_ptr_type_node,
- tree_cons (NULL_TREE, const_ptr_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- endlink))));
-
- void_ftype_refptr_int_ptr_int
- = build_function_type (void_type_node,
- tree_cons (NULL_TREE, build_reference_type(ptr_type_node),
- tree_cons (NULL_TREE, integer_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- endlink)))));
-
- void_ftype_ptr_ptr_ptr_int
- = build_function_type (void_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- endlink)))));
- void_ftype_ptr_ptr_ptr_luns
- = build_function_type (void_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, long_unsigned_type_node,
- endlink)))));
- void_ftype_ptr_int_int_int_int
- = build_function_type (void_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- endlink))))));
- void_ftype_ptr_luns_long_long_bool_ptr_int
- = build_function_type (void_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, long_unsigned_type_node,
- tree_cons (NULL_TREE, long_integer_type_node,
- tree_cons (NULL_TREE, long_integer_type_node,
- tree_cons (NULL_TREE, boolean_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- endlink))))))));
- void_ftype_ptr_int_ptr_int_int_int
- = build_function_type (void_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- endlink)))))));
- void_ftype_ptr_luns_ptr_luns_luns_luns
- = build_function_type (void_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, long_unsigned_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, long_unsigned_type_node,
- tree_cons (NULL_TREE, long_unsigned_type_node,
- tree_cons (NULL_TREE, long_unsigned_type_node,
- endlink)))))));
- void_ftype_ptr_int_ptr_int_ptr_int
- = build_function_type (void_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- endlink)))))));
- void_ftype_long_int_ptr_int_ptr_int
- = build_function_type (void_type_node,
- tree_cons (NULL_TREE, long_integer_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- endlink)))))));
- void_ftype_void
- = build_function_type (void_type_node,
- tree_cons (NULL_TREE, void_type_node,
- endlink));
-
- void_ftype_ptr_ptr_int
- = build_function_type (void_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- endlink))));
-
- void_ftype_ptr_luns_luns_cptr_luns_luns_luns
- = build_function_type (void_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, long_unsigned_type_node,
- tree_cons (NULL_TREE, long_unsigned_type_node,
- tree_cons (NULL_TREE, const_ptr_type_node,
- tree_cons (NULL_TREE, long_unsigned_type_node,
- tree_cons (NULL_TREE, long_unsigned_type_node,
- tree_cons (NULL_TREE, long_unsigned_type_node,
- endlink))))))));
-
- ptr_ftype_luns_ptr_int
- = build_function_type (ptr_type_node,
- tree_cons (NULL_TREE, long_unsigned_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- endlink))));
-
- double_ftype_double
- = build_function_type (double_type_node,
- tree_cons (NULL_TREE, double_type_node,
- endlink));
-
-/* These are compiler-internal function calls, not intended
- to be directly called by user code */
- builtin_function ("__allocate", ptr_ftype_luns_ptr_int,
- 0, NOT_BUILT_IN, NULL_PTR);
- builtin_function ("_allocate_global_memory", void_ftype_refptr_int_ptr_int,
- 0, NOT_BUILT_IN, NULL_PTR);
- builtin_function ("_allocate_memory", void_ftype_refptr_int_ptr_int,
- 0, NOT_BUILT_IN, NULL_PTR);
- builtin_function ("__andpowerset", bool_ftype_ptr_ptr_ptr_luns,
- 0, NOT_BUILT_IN, NULL_PTR);
- builtin_function ("__bitsetpowerset", void_ftype_ptr_int_int_int_int,
- 0, NOT_BUILT_IN, NULL_PTR);
- builtin_function ("__cardpowerset", long_ftype_ptr_luns,
- 0, NOT_BUILT_IN, NULL_PTR);
- builtin_function ("__cause_ex1", void_ftype_cptr_cptr_int,
- 0, NOT_BUILT_IN, NULL_PTR);
- builtin_function ("__concatstring", ptr_ftype_ptr_ptr_int_ptr_int,
- 0, NOT_BUILT_IN, NULL_PTR);
- builtin_function ("__continue", void_ftype_ptr_ptr_int,
- 0, NOT_BUILT_IN, NULL_PTR);
- builtin_function ("__diffpowerset", void_ftype_ptr_ptr_ptr_luns,
- 0, NOT_BUILT_IN, NULL_PTR);
- builtin_function ("__eqpowerset", bool_ftype_ptr_ptr_luns,
- 0, NOT_BUILT_IN, NULL_PTR);
- builtin_function ("__ffsetclrpowerset", find_bit_ftype,
- 0, NOT_BUILT_IN, NULL_PTR);
- builtin_function ("__flsetclrpowerset", find_bit_ftype,
- 0, NOT_BUILT_IN, NULL_PTR);
- builtin_function ("__flsetpowerset", int_ftype_ptr_luns_long_ptr_int,
- 0, NOT_BUILT_IN, NULL_PTR);
- builtin_function ("__ffsetpowerset", int_ftype_ptr_luns_long_ptr_int,
- 0, NOT_BUILT_IN, NULL_PTR);
- builtin_function ("__inbitstring", bool_ftype_luns_ptr_luns_long_ptr_int,
- 0, NOT_BUILT_IN, NULL_PTR);
- builtin_function ("__inpowerset", bool_ftype_luns_ptr_luns_long,
- 0, NOT_BUILT_IN, NULL_PTR);
- builtin_function ("__lepowerset", bool_ftype_ptr_ptr_luns,
- 0, NOT_BUILT_IN, NULL_PTR);
- builtin_function ("__ltpowerset", bool_ftype_ptr_ptr_luns,
- 0, NOT_BUILT_IN, NULL_PTR);
- /* Currently under experimentation. */
- builtin_function ("memmove", memcpy_ftype,
- 0, NOT_BUILT_IN, NULL_PTR);
- builtin_function ("memcmp", memcmp_ftype,
- 0, NOT_BUILT_IN, NULL_PTR);
-
- /* this comes from c-decl.c (init_decl_processing) */
- builtin_function ("__builtin_alloca",
- build_function_type (ptr_type_node,
- tree_cons (NULL_TREE,
- sizetype,
- endlink)),
- BUILT_IN_ALLOCA, BUILT_IN_NORMAL, "alloca");
-
- builtin_function ("memset", ptr_ftype_ptr_int_int,
- 0, NOT_BUILT_IN, NULL_PTR);
- builtin_function ("__notpowerset", bool_ftype_ptr_ptr_luns,
- 0, NOT_BUILT_IN, NULL_PTR);
- builtin_function ("__orpowerset", bool_ftype_ptr_ptr_ptr_luns,
- 0, NOT_BUILT_IN, NULL_PTR);
- builtin_function ("__psslice", void_ftype_ptr_int_ptr_int_int_int,
- 0, NOT_BUILT_IN, NULL_PTR);
- builtin_function ("__pscpy", void_ftype_ptr_luns_luns_cptr_luns_luns_luns,
- 0, NOT_BUILT_IN, NULL_PTR);
- builtin_function ("_return_memory", void_ftype_ptr_ptr_int,
- 0, NOT_BUILT_IN, NULL_PTR);
- builtin_function ("__setbitpowerset", void_ftype_ptr_luns_long_long_bool_ptr_int,
- 0, NOT_BUILT_IN, NULL_PTR);
- builtin_function ("__terminate", void_ftype_ptr_ptr_int,
- 0, NOT_BUILT_IN, NULL_PTR);
- builtin_function ("__unhandled_ex", void_ftype_cptr_cptr_int,
- 0, NOT_BUILT_IN, NULL_PTR);
- builtin_function ("__xorpowerset", bool_ftype_ptr_ptr_ptr_luns,
- 0, NOT_BUILT_IN, NULL_PTR);
-
- /* declare floating point functions */
- builtin_function ("__sin", double_ftype_double, 0, NOT_BUILT_IN, "sin");
- builtin_function ("__cos", double_ftype_double, 0, NOT_BUILT_IN, "cos");
- builtin_function ("__tan", double_ftype_double, 0, NOT_BUILT_IN, "tan");
- builtin_function ("__asin", double_ftype_double, 0, NOT_BUILT_IN, "asin");
- builtin_function ("__acos", double_ftype_double, 0, NOT_BUILT_IN, "acos");
- builtin_function ("__atan", double_ftype_double, 0, NOT_BUILT_IN, "atan");
- builtin_function ("__exp", double_ftype_double, 0, NOT_BUILT_IN, "exp");
- builtin_function ("__log", double_ftype_double, 0, NOT_BUILT_IN, "log");
- builtin_function ("__log10", double_ftype_double, 0, NOT_BUILT_IN, "log10");
- builtin_function ("__sqrt", double_ftype_double, 0, NOT_BUILT_IN, "sqrt");
-
- tasking_init ();
- timing_init ();
- inout_init ();
-
- /* These are predefined value builtin routine calls, built
- by the compiler, but over-ridable by user procedures of
- the same names. Note the lack of a leading underscore. */
- builtin_function ((ignore_case || ! special_UC) ? "abs" : "ABS",
- chill_predefined_function_type,
- BUILT_IN_CH_ABS, BUILT_IN_NORMAL, NULL_PTR);
- builtin_function ((ignore_case || ! special_UC) ? "abstime" : "ABSTIME",
- chill_predefined_function_type,
- BUILT_IN_ABSTIME, BUILT_IN_NORMAL, NULL_PTR);
- builtin_function ((ignore_case || ! special_UC) ? "allocate" : "ALLOCATE",
- chill_predefined_function_type,
- BUILT_IN_ALLOCATE, BUILT_IN_NORMAL, NULL_PTR);
- builtin_function ((ignore_case || ! special_UC) ? "allocate_memory" : "ALLOCATE_MEMORY",
- chill_predefined_function_type,
- BUILT_IN_ALLOCATE_MEMORY, BUILT_IN_NORMAL, NULL_PTR);
- builtin_function ((ignore_case || ! special_UC) ? "addr" : "ADDR",
- chill_predefined_function_type,
- BUILT_IN_ADDR, BUILT_IN_NORMAL, NULL_PTR);
- builtin_function ((ignore_case || ! special_UC) ? "allocate_global_memory" : "ALLOCATE_GLOBAL_MEMORY",
- chill_predefined_function_type,
- BUILT_IN_ALLOCATE_GLOBAL_MEMORY, BUILT_IN_NORMAL, NULL_PTR);
- builtin_function ((ignore_case || ! special_UC) ? "arccos" : "ARCCOS",
- chill_predefined_function_type,
- BUILT_IN_ARCCOS, BUILT_IN_NORMAL, NULL_PTR);
- builtin_function ((ignore_case || ! special_UC) ? "arcsin" : "ARCSIN",
- chill_predefined_function_type,
- BUILT_IN_ARCSIN, BUILT_IN_NORMAL, NULL_PTR);
- builtin_function ((ignore_case || ! special_UC) ? "arctan" : "ARCTAN",
- chill_predefined_function_type,
- BUILT_IN_ARCTAN, BUILT_IN_NORMAL, NULL_PTR);
- builtin_function ((ignore_case || ! special_UC) ? "card" : "CARD",
- chill_predefined_function_type,
- BUILT_IN_CARD, BUILT_IN_NORMAL, NULL_PTR);
- builtin_function ((ignore_case || ! special_UC) ? "cos" : "COS",
- chill_predefined_function_type,
- BUILT_IN_CH_COS, BUILT_IN_NORMAL, NULL_PTR);
- builtin_function ((ignore_case || ! special_UC) ? "days" : "DAYS",
- chill_predefined_function_type,
- BUILT_IN_DAYS, BUILT_IN_NORMAL, NULL_PTR);
- builtin_function ((ignore_case || ! special_UC) ? "descr" : "DESCR",
- chill_predefined_function_type,
- BUILT_IN_DESCR, BUILT_IN_NORMAL, NULL_PTR);
- builtin_function ((ignore_case || ! special_UC) ? "getstack" : "GETSTACK",
- chill_predefined_function_type,
- BUILT_IN_GETSTACK, BUILT_IN_NORMAL, NULL_PTR);
- builtin_function ((ignore_case || ! special_UC) ? "exp" : "EXP",
- chill_predefined_function_type,
- BUILT_IN_EXP, BUILT_IN_NORMAL, NULL_PTR);
- builtin_function ((ignore_case || ! special_UC) ? "hours" : "HOURS",
- chill_predefined_function_type,
- BUILT_IN_HOURS, BUILT_IN_NORMAL, NULL_PTR);
- builtin_function ((ignore_case || ! special_UC) ? "inttime" : "INTTIME",
- chill_predefined_function_type,
- BUILT_IN_INTTIME, BUILT_IN_NORMAL, NULL_PTR);
- builtin_function ((ignore_case || ! special_UC) ? "length" : "LENGTH",
- chill_predefined_function_type,
- BUILT_IN_LENGTH, BUILT_IN_NORMAL, NULL_PTR);
- builtin_function ((ignore_case || ! special_UC) ? "log" : "LOG",
- chill_predefined_function_type,
- BUILT_IN_LOG, BUILT_IN_NORMAL, NULL_PTR);
- builtin_function ((ignore_case || ! special_UC) ? "lower" : "LOWER",
- chill_predefined_function_type,
- BUILT_IN_LOWER, BUILT_IN_NORMAL, NULL_PTR);
- builtin_function ((ignore_case || ! special_UC) ? "ln" : "LN",
- chill_predefined_function_type,
- BUILT_IN_LN, BUILT_IN_NORMAL, NULL_PTR);
- /* Note: these are *not* the C integer MAX and MIN. They're
- for powerset arguments. */
- builtin_function ((ignore_case || ! special_UC) ? "max" : "MAX",
- chill_predefined_function_type,
- BUILT_IN_MAX, BUILT_IN_NORMAL, NULL_PTR);
- builtin_function ((ignore_case || ! special_UC) ? "millisecs" : "MILLISECS",
- chill_predefined_function_type,
- BUILT_IN_MILLISECS, BUILT_IN_NORMAL, NULL_PTR);
- builtin_function ((ignore_case || ! special_UC) ? "min" : "MIN",
- chill_predefined_function_type,
- BUILT_IN_MIN, BUILT_IN_NORMAL, NULL_PTR);
- builtin_function ((ignore_case || ! special_UC) ? "minutes" : "MINUTES",
- chill_predefined_function_type,
- BUILT_IN_MINUTES, BUILT_IN_NORMAL, NULL_PTR);
- builtin_function ((ignore_case || ! special_UC) ? "num" : "NUM",
- chill_predefined_function_type,
- BUILT_IN_NUM, BUILT_IN_NORMAL, NULL_PTR);
- builtin_function ((ignore_case || ! special_UC) ? "pred" : "PRED",
- chill_predefined_function_type,
- BUILT_IN_PRED, BUILT_IN_NORMAL, NULL_PTR);
- builtin_function ((ignore_case || ! special_UC) ? "return_memory" : "RETURN_MEMORY",
- chill_predefined_function_type,
- BUILT_IN_RETURN_MEMORY, BUILT_IN_NORMAL, NULL_PTR);
- builtin_function ((ignore_case || ! special_UC) ? "secs" : "SECS",
- chill_predefined_function_type,
- BUILT_IN_SECS, BUILT_IN_NORMAL, NULL_PTR);
- builtin_function ((ignore_case || ! special_UC) ? "sin" : "SIN",
- chill_predefined_function_type,
- BUILT_IN_CH_SIN, BUILT_IN_NORMAL, NULL_PTR);
- builtin_function ((ignore_case || ! special_UC) ? "size" : "SIZE",
- chill_predefined_function_type,
- BUILT_IN_SIZE, BUILT_IN_NORMAL, NULL_PTR);
- builtin_function ((ignore_case || ! special_UC) ? "sqrt" : "SQRT",
- chill_predefined_function_type,
- BUILT_IN_SQRT, BUILT_IN_NORMAL, NULL_PTR);
- builtin_function ((ignore_case || ! special_UC) ? "succ" : "SUCC",
- chill_predefined_function_type,
- BUILT_IN_SUCC, BUILT_IN_NORMAL, NULL_PTR);
- builtin_function ((ignore_case || ! special_UC) ? "tan" : "TAN",
- chill_predefined_function_type,
- BUILT_IN_TAN, BUILT_IN_NORMAL, NULL_PTR);
- builtin_function ((ignore_case || ! special_UC) ? "terminate" : "TERMINATE",
- chill_predefined_function_type,
- BUILT_IN_TERMINATE, BUILT_IN_NORMAL, NULL_PTR);
- builtin_function ((ignore_case || ! special_UC) ? "upper" : "UPPER",
- chill_predefined_function_type,
- BUILT_IN_UPPER, BUILT_IN_NORMAL, NULL_PTR);
-
- build_chill_descr_type ();
- build_chill_inttime_type ();
-
- endlink = tree_cons (NULL_TREE, void_type_node, NULL_TREE);
-
- start_identifier_warnings ();
-
- pass = 1;
-}
-
-/* Return a definition for a builtin function named NAME and whose data type
- is TYPE. TYPE should be a function type with argument types.
- FUNCTION_CODE tells later passes how to compile calls to this function.
- See tree.h for its possible values.
-
- If LIBRARY_NAME is nonzero, use that for DECL_ASSEMBLER_NAME,
- the name to be called if we can't opencode the function. */
-
-tree
-builtin_function (name, type, function_code, class, library_name)
- const char *name;
- tree type;
- int function_code;
- enum built_in_class class;
- const char *library_name;
-{
- tree decl = build_decl (FUNCTION_DECL, get_identifier (name), type);
- DECL_EXTERNAL (decl) = 1;
- TREE_PUBLIC (decl) = 1;
- /* If -traditional, permit redefining a builtin function any way you like.
- (Though really, if the program redefines these functions,
- it probably won't work right unless compiled with -fno-builtin.) */
- if (flag_traditional && name[0] != '_')
- DECL_BUILT_IN_NONANSI (decl) = 1;
- if (library_name)
- DECL_ASSEMBLER_NAME (decl) = get_identifier (library_name);
- make_decl_rtl (decl, NULL_PTR, 1);
- pushdecl (decl);
- DECL_BUILT_IN_CLASS (decl) = class;
- DECL_FUNCTION_CODE (decl) = function_code;
-
- return decl;
-}
-
-/* Print a warning if a constant expression had overflow in folding.
- Invoke this function on every expression that the language
- requires to be a constant expression. */
-
-void
-constant_expression_warning (value)
- tree value;
-{
- if ((TREE_CODE (value) == INTEGER_CST || TREE_CODE (value) == REAL_CST
- || TREE_CODE (value) == COMPLEX_CST)
- && TREE_CONSTANT_OVERFLOW (value) && pedantic)
- pedwarn ("overflow in constant expression");
-}
-
-
-/* Finish processing of a declaration;
- If the length of an array type is not known before,
- it must be determined now, from the initial value, or it is an error. */
-
-void
-finish_decl (decl)
- tree decl;
-{
- int was_incomplete = (DECL_SIZE (decl) == 0);
- int temporary = allocation_temporary_p ();
-
- /* Pop back to the obstack that is current for this binding level.
- This is because MAXINDEX, rtl, etc. to be made below
- must go in the permanent obstack. But don't discard the
- temporary data yet. */
- pop_obstacks ();
-#if 0 /* pop_obstacks was near the end; this is what was here. */
- if (current_scope == global_scope && temporary)
- end_temporary_allocation ();
-#endif
-
- if (TREE_CODE (decl) == VAR_DECL)
- {
- if (DECL_SIZE (decl) == 0
- && TYPE_SIZE (TREE_TYPE (decl)) != 0)
- layout_decl (decl, 0);
-
- if (DECL_SIZE (decl) == 0 && TREE_CODE (TREE_TYPE (decl)) != ERROR_MARK)
- {
- error_with_decl (decl, "storage size of `%s' isn't known");
- TREE_TYPE (decl) = error_mark_node;
- }
-
- if ((DECL_EXTERNAL (decl) || TREE_STATIC (decl))
- && DECL_SIZE (decl) != 0)
- {
- if (TREE_CODE (DECL_SIZE (decl)) == INTEGER_CST)
- constant_expression_warning (DECL_SIZE (decl));
- }
- }
-
- /* 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)
- {
- /* The last argument (at_end) is set to 1 as a kludge to force
- assemble_variable to be called. */
- if (TREE_CODE (TREE_TYPE (decl)) != ERROR_MARK)
- rest_of_decl_compilation (decl, (char*) 0, global_bindings_p (), 1);
-
- /* Compute the RTL of a decl if not yet set.
- (For normal user variables, satisfy_decl sets it.) */
- if (! TREE_STATIC (decl) && ! DECL_EXTERNAL (decl))
- {
- if (was_incomplete)
- {
- /* If we used it already as memory, it must stay in memory. */
- TREE_ADDRESSABLE (decl) = TREE_USED (decl);
- /* If it's still incomplete now, no init will save it. */
- if (DECL_SIZE (decl) == 0)
- DECL_INITIAL (decl) = 0;
- expand_decl (decl);
- }
- }
- }
-
- if (TREE_CODE (decl) == TYPE_DECL)
- {
- rest_of_decl_compilation (decl, NULL_PTR,
- global_bindings_p (), 0);
- }
-
- /* ??? After 2.3, test (init != 0) instead of TREE_CODE. */
- if (!(TREE_CODE (decl) == FUNCTION_DECL && DECL_INLINE (decl))
- && temporary && TREE_PERMANENT (decl))
- {
- /* We need to remember that this array HAD an initialization,
- but discard the actual temporary nodes,
- since we can't have a permanent node keep pointing to them. */
- /* We make an exception for inline functions, since it's
- normal for a local extern redeclaration of an inline function
- to have a copy of the top-level decl's DECL_INLINE. */
- if (DECL_INITIAL (decl) != 0)
- DECL_INITIAL (decl) = error_mark_node;
- }
-
-#if 0
- /* Resume permanent allocation, if not within a function. */
- /* The corresponding push_obstacks_nochange is in start_decl,
- and in push_parm_decl and in grokfield. */
- pop_obstacks ();
-#endif
-
- /* If we have gone back from temporary to permanent allocation,
- actually free the temporary space that we no longer need. */
- if (temporary && !allocation_temporary_p ())
- permanent_allocation (0);
-
- /* At the end of a declaration, throw away any variable type sizes
- of types defined inside that declaration. There is no use
- computing them in the following function definition. */
- if (current_scope == global_scope)
- get_pending_sizes ();
-}
-
-/* If DECL has a cleanup, build and return that cleanup here.
- This is a callback called by expand_expr. */
-
-tree
-maybe_build_cleanup (decl)
- tree decl ATTRIBUTE_UNUSED;
-{
- /* There are no cleanups in C. */
- return NULL_TREE;
-}
-
-/* Make TYPE a complete type based on INITIAL_VALUE.
- Return 0 if successful, 1 if INITIAL_VALUE can't be deciphered,
- 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 ATTRIBUTE_UNUSED, initial_value ATTRIBUTE_UNUSED;
- int do_default ATTRIBUTE_UNUSED;
-{
- /* Only needed so we can link with ../c-typeck.c. */
- abort ();
-}
-
-/* Make sure that the tag NAME is defined *in the current binding level*
- at least as a forward reference.
- CODE says which kind of tag NAME ought to be.
-
- We also do a push_obstacks_nochange
- whose matching pop is in finish_struct. */
-
-tree
-start_struct (code, name)
- enum chill_tree_code code;
- tree name ATTRIBUTE_UNUSED;
-{
- /* If there is already a tag defined at this binding level
- (as a forward reference), just return it. */
-
- register tree ref = 0;
-
- push_obstacks_nochange ();
- if (current_scope == global_scope)
- end_temporary_allocation ();
-
- /* Otherwise create a forward-reference just so the tag is in scope. */
-
- ref = make_node (code);
-/* pushtag (name, ref); */
- return ref;
-}
-
-#if 0
-/* Function to help qsort sort FIELD_DECLs by name order. */
-
-static int
-field_decl_cmp (x, y)
- tree *x, *y;
-{
- return (long)DECL_NAME (*x) - (long)DECL_NAME (*y);
-}
-#endif
-/* Fill in the fields of a RECORD_TYPE or UNION_TYPE node, T.
- FIELDLIST is a chain of FIELD_DECL nodes for the fields.
-
- We also do a pop_obstacks to match the push in start_struct. */
-
-tree
-finish_struct (t, fieldlist)
- register tree t, fieldlist;
-{
- register tree x;
-
- /* Install struct as DECL_CONTEXT of each field decl. */
- for (x = fieldlist; x; x = TREE_CHAIN (x))
- DECL_CONTEXT (x) = t;
-
- TYPE_FIELDS (t) = fieldlist;
-
- if (pass != 1)
- t = layout_chill_struct_type (t);
-
- /* The matching push is in start_struct. */
- pop_obstacks ();
-
- return t;
-}
-
-/* Lay out the type T, and its element type, and so on. */
-
-static void
-layout_array_type (t)
- tree t;
-{
- if (TYPE_SIZE (t) != 0)
- return;
- if (TREE_CODE (TREE_TYPE (t)) == ARRAY_TYPE)
- layout_array_type (TREE_TYPE (t));
- layout_type (t);
-}
-
-/* Begin compiling the definition of an enumeration type.
- NAME is its name (or null if anonymous).
- Returns the type object, as yet incomplete.
- Also records info about it so that build_enumerator
- may be used to declare the individual values as they are read. */
-
-tree
-start_enum (name)
- tree name ATTRIBUTE_UNUSED;
-{
- register tree enumtype;
-
- /* If this is the real definition for a previous forward reference,
- fill in the contents in the same object that used to be the
- forward reference. */
-
-#if 0
- /* The corresponding pop_obstacks is in finish_enum. */
- push_obstacks_nochange ();
- /* If these symbols and types are global, make them permanent. */
- if (current_scope == global_scope)
- end_temporary_allocation ();
-#endif
-
- enumtype = make_node (ENUMERAL_TYPE);
-/* pushtag (name, enumtype); */
- return enumtype;
-}
-
-/* Determine the precision this type needs. */
-unsigned
-get_type_precision (minnode, maxnode)
- tree minnode, maxnode;
-{
- unsigned precision = 0;
-
- if (TREE_INT_CST_HIGH (minnode) >= 0
- ? tree_int_cst_lt (TYPE_MAX_VALUE (unsigned_type_node), maxnode)
- : (tree_int_cst_lt (minnode, TYPE_MIN_VALUE (integer_type_node))
- || tree_int_cst_lt (TYPE_MAX_VALUE (integer_type_node), maxnode)))
- precision = TYPE_PRECISION (long_long_integer_type_node);
- else
- {
- HOST_WIDE_INT maxvalue = TREE_INT_CST_LOW (maxnode);
- HOST_WIDE_INT minvalue = TREE_INT_CST_LOW (minnode);
-
- if (maxvalue > 0)
- precision = floor_log2 (maxvalue) + 1;
- if (minvalue < 0)
- {
- /* Compute number of bits to represent magnitude of a negative value.
- Add one to MINVALUE since range of negative numbers
- includes the power of two. */
- unsigned negprecision = floor_log2 (-minvalue - 1) + 1;
- if (negprecision > precision)
- precision = negprecision;
- precision += 1; /* room for sign bit */
- }
-
- if (!precision)
- precision = 1;
- }
- return precision;
-}
-
-void
-layout_enum (enumtype)
- tree enumtype;
-{
- register tree pair, tem;
- tree minnode = 0, maxnode = 0;
- unsigned precision = 0;
-
- /* Do arithmetic using double integers, but don't use fold/build. */
- union tree_node enum_next_node;
- /* This is 1 plus the last enumerator constant value. */
- tree enum_next_value = &enum_next_node;
-
- /* Nonzero means that there was overflow computing enum_next_value. */
- int enum_overflow = 0;
-
- tree values = TYPE_VALUES (enumtype);
-
- if (TYPE_SIZE (enumtype) != NULL_TREE)
- return;
-
- /* Initialize enum_next_value to zero. */
- TREE_TYPE (enum_next_value) = integer_type_node;
- TREE_INT_CST_LOW (enum_next_value) = TREE_INT_CST_LOW (integer_zero_node);
- TREE_INT_CST_HIGH (enum_next_value) = TREE_INT_CST_HIGH (integer_zero_node);
-
- /* After processing and defining all the values of an enumeration type,
- install their decls in the enumeration type and finish it off.
-
- TYPE_VALUES currently contains a list of (purpose: NAME, value: DECL).
- This gets converted to a list of (purpose: NAME, value: VALUE). */
-
-
- /* For each enumerator, calculate values, if defaulted.
- Convert to correct type (the enumtype).
- Also, calculate the minimum and maximum values. */
-
- for (pair = values; pair; pair = TREE_CHAIN (pair))
- {
- tree decl = TREE_VALUE (pair);
- tree value = DECL_INITIAL (decl);
-
- /* Remove no-op casts from the value. */
- if (value != NULL_TREE)
- STRIP_TYPE_NOPS (value);
-
- if (value != NULL_TREE)
- {
- if (TREE_CODE (value) == INTEGER_CST)
- {
- constant_expression_warning (value);
- if (tree_int_cst_lt (value, integer_zero_node))
- {
- error ("enumerator value for `%s' is less then 0",
- IDENTIFIER_POINTER (DECL_NAME (decl)));
- value = error_mark_node;
- }
- }
- else
- {
- error ("enumerator value for `%s' not integer constant",
- IDENTIFIER_POINTER (DECL_NAME (decl)));
- value = error_mark_node;
- }
- }
-
- if (value != error_mark_node)
- {
- if (value == NULL_TREE) /* Default based on previous value. */
- {
- value = enum_next_value;
- if (enum_overflow)
- error ("overflow in enumeration values");
- }
- value = build_int_2 (TREE_INT_CST_LOW (value),
- TREE_INT_CST_HIGH (value));
- TREE_TYPE (value) = enumtype;
- DECL_INITIAL (decl) = value;
- CH_DERIVED_FLAG (value) = 1;
-
- if (pair == values)
- minnode = maxnode = value;
- else
- {
- if (tree_int_cst_lt (maxnode, value))
- maxnode = value;
- if (tree_int_cst_lt (value, minnode))
- minnode = value;
- }
-
- /* Set basis for default for next value. */
- add_double (TREE_INT_CST_LOW (value), TREE_INT_CST_HIGH (value), 1, 0,
- &TREE_INT_CST_LOW (enum_next_value),
- &TREE_INT_CST_HIGH (enum_next_value));
- enum_overflow = tree_int_cst_lt (enum_next_value, value);
- }
- else
- DECL_INITIAL (decl) = value; /* error_mark_node */
- }
-
- /* Fix all error_mark_nodes in enum. Increment maxnode and assign value.
- This is neccessary to make a duplicate value check in the enum */
- for (pair = values; pair; pair = TREE_CHAIN (pair))
- {
- tree decl = TREE_VALUE (pair);
- if (DECL_INITIAL (decl) == error_mark_node)
- {
- tree value;
- add_double (TREE_INT_CST_LOW (maxnode), TREE_INT_CST_HIGH (maxnode), 1, 0,
- &TREE_INT_CST_LOW (enum_next_value),
- &TREE_INT_CST_HIGH (enum_next_value));
- value = build_int_2 (TREE_INT_CST_LOW (enum_next_value),
- TREE_INT_CST_HIGH (enum_next_value));
- TREE_TYPE (value) = enumtype;
- CH_DERIVED_FLAG (value) = 1;
- DECL_INITIAL (decl) = value;
-
- maxnode = value;
- }
- }
-
- /* Now check if we have duplicate values within the enum */
- for (pair = values; pair; pair = TREE_CHAIN (pair))
- {
- tree succ;
- tree decl1 = TREE_VALUE (pair);
- tree val1 = DECL_INITIAL (decl1);
-
- for (succ = TREE_CHAIN (pair); succ; succ = TREE_CHAIN (succ))
- {
- if (pair != succ)
- {
- tree decl2 = TREE_VALUE (succ);
- tree val2 = DECL_INITIAL (decl2);
- if (tree_int_cst_equal (val1, val2))
- error ("enumerators `%s' and `%s' have equal values",
- IDENTIFIER_POINTER (DECL_NAME (decl1)),
- IDENTIFIER_POINTER (DECL_NAME (decl2)));
- }
- }
- }
-
- TYPE_MIN_VALUE (enumtype) = minnode;
- TYPE_MAX_VALUE (enumtype) = maxnode;
-
- precision = get_type_precision (minnode, maxnode);
-
- if (flag_short_enums || precision > TYPE_PRECISION (integer_type_node))
- /* Use the width of the narrowest normal C type which is wide enough. */
- TYPE_PRECISION (enumtype) = TYPE_PRECISION (type_for_size (precision, 1));
- else
- TYPE_PRECISION (enumtype) = TYPE_PRECISION (integer_type_node);
-
- layout_type (enumtype);
-
-#if 0
- /* An enum can have some negative values; then it is signed. */
- TREE_UNSIGNED (enumtype) = ! tree_int_cst_lt (minnode, integer_zero_node);
-#else
- /* Z200/1988 page 19 says:
- For each pair of integer literal expression e1, e2 in the set list NUM (e1)
- and NUM (e2) must deliver different non-negative results */
- TREE_UNSIGNED (enumtype) = 1;
-#endif
-
- for (pair = values; pair; pair = TREE_CHAIN (pair))
- {
- tree decl = TREE_VALUE (pair);
-
- DECL_SIZE (decl) = TYPE_SIZE (enumtype);
- DECL_SIZE_UNIT (decl) = TYPE_SIZE_UNIT (enumtype);
- DECL_ALIGN (decl) = TYPE_ALIGN (enumtype);
- DECL_USER_ALIGN (decl) = TYPE_USER_ALIGN (enumtype);
-
- /* Set the TREE_VALUE to the name, rather than the decl,
- since that is what the rest of the compiler expects. */
- TREE_VALUE (pair) = DECL_INITIAL (decl);
- }
-
- /* Fix up all variant types of this enum type. */
- for (tem = TYPE_MAIN_VARIANT (enumtype); tem; tem = TYPE_NEXT_VARIANT (tem))
- {
- TYPE_VALUES (tem) = TYPE_VALUES (enumtype);
- TYPE_MIN_VALUE (tem) = TYPE_MIN_VALUE (enumtype);
- TYPE_MAX_VALUE (tem) = TYPE_MAX_VALUE (enumtype);
- TYPE_SIZE (tem) = TYPE_SIZE (enumtype);
- TYPE_MODE (tem) = TYPE_MODE (enumtype);
- TYPE_PRECISION (tem) = TYPE_PRECISION (enumtype);
- TYPE_ALIGN (tem) = TYPE_ALIGN (enumtype);
- TYPE_USER_ALIGN (tem) = TYPE_USER_ALIGN (enumtype);
- TREE_UNSIGNED (tem) = TREE_UNSIGNED (enumtype);
- }
-
-#if 0
- /* This matches a push in start_enum. */
- pop_obstacks ();
-#endif
-}
-
-tree
-finish_enum (enumtype, values)
- register tree enumtype, values;
-{
- TYPE_VALUES (enumtype) = values = nreverse (values);
-
- /* If satisfy_decl is called on one of the enum CONST_DECLs,
- this will make sure that the enumtype gets laid out then. */
- for ( ; values; values = TREE_CHAIN (values))
- TREE_TYPE (TREE_VALUE (values)) = enumtype;
-
- return enumtype;
-}
-
-
-/* Build and install a CONST_DECL for one value of the
- current enumeration type (one that was begun with start_enum).
- Return a tree-list containing the CONST_DECL and its value.
- Assignment of sequential values by default is handled here. */
-
-tree
-build_enumerator (name, value)
- tree name, value;
-{
- register tree decl;
- int named = name != NULL_TREE;
-
- if (pass == 2)
- {
- if (name)
- (void) get_next_decl ();
- return NULL_TREE;
- }
-
- if (name == NULL_TREE)
- {
- static int unnamed_value_warned = 0;
- static int next_dummy_enum_value = 0;
- char buf[20];
- if (!unnamed_value_warned)
- {
- unnamed_value_warned = 1;
- warning ("undefined value in SET mode is obsolete and deprecated.");
- }
- sprintf (buf, "__star_%d", next_dummy_enum_value++);
- name = get_identifier (buf);
- }
-
- decl = build_decl (CONST_DECL, name, integer_type_node);
- CH_DECL_ENUM (decl) = 1;
- DECL_INITIAL (decl) = value;
- if (named)
- {
- if (pass == 0)
- {
- push_obstacks_nochange ();
- pushdecl (decl);
- finish_decl (decl);
- }
- else
- save_decl (decl);
- }
- return build_tree_list (name, decl);
-
-#if 0
- tree old_value = lookup_name_current_level (name);
-
- if (old_value != NULL_TREE
- && TREE_CODE (old_value)=!= CONST_DECL
- && (value == NULL_TREE || operand_equal_p (value, old_value, 1)))
- {
- if (value == NULL_TREE)
- {
- if (TREE_CODE (old_value) == CONST_DECL)
- value = DECL_INITIAL (old_value);
- else
- abort ();
- }
- return saveable_tree_cons (old_value, value, NULL_TREE);
- }
-#endif
-}
-
-/* Record that this function is going to be a varargs function.
- This is called before store_parm_decls, which is too early
- to call mark_varargs directly. */
-
-void
-c_mark_varargs ()
-{
- c_function_varargs = 1;
-}
-
-/* Function needed for CHILL interface. */
-tree
-get_parm_decls ()
-{
- return current_function_parms;
-}
-
-/* Save and restore the variables in this file and elsewhere
- that keep track of the progress of compilation of the current function.
- Used for nested functions. */
-
-struct c_function
-{
- struct c_function *next;
- struct scope *scope;
- tree chill_result_decl;
- int result_never_set;
-};
-
-struct c_function *c_function_chain;
-
-/* Save and reinitialize the variables
- used during compilation of a C function. */
-
-void
-push_chill_function_context ()
-{
- struct c_function *p
- = (struct c_function *) xmalloc (sizeof (struct c_function));
-
- push_function_context ();
-
- p->next = c_function_chain;
- c_function_chain = p;
-
- p->scope = current_scope;
- p->chill_result_decl = chill_result_decl;
- p->result_never_set = result_never_set;
-}
-
-/* Restore the variables used during compilation of a C function. */
-
-void
-pop_chill_function_context ()
-{
- struct c_function *p = c_function_chain;
-#if 0
- tree link;
- /* Bring back all the labels that were shadowed. */
- for (link = shadowed_labels; link; link = TREE_CHAIN (link))
- if (DECL_NAME (TREE_VALUE (link)) != 0)
- IDENTIFIER_LABEL_VALUE (DECL_NAME (TREE_VALUE (link)))
- = TREE_VALUE (link);
-#endif
-
- pop_function_context ();
-
- c_function_chain = p->next;
-
- current_scope = p->scope;
- chill_result_decl = p->chill_result_decl;
- result_never_set = p->result_never_set;
-
- free (p);
-}
-
-/* Following from Jukka Virtanen's GNU Pascal */
-/* To implement WITH statement:
-
- 1) Call shadow_record_fields for each record_type element in the WITH
- element list. Each call creates a new binding level.
-
- 2) construct a component_ref for EACH field in the record,
- and store it to the IDENTIFIER_LOCAL_VALUE after adding
- the old value to the shadow list
-
- 3) let lookup_name do the rest
-
- 4) pop all of the binding levels after the WITH statement ends.
- (restoring old local values) You have to keep track of the number
- of times you called it.
-*/
-
-/*
- * Save an arbitrary tree-expression as the IDENTIFIER_LOCAL_VALUE
- * of a name. Save the name's previous value. Check for name
- * collisions with another value under the same name at the same
- * nesting level. This is used to implement the DO WITH construct
- * and the temporary for the location iteration loop.
- */
-void
-save_expr_under_name (name, expr)
- tree name, expr;
-{
- tree alias = build_alias_decl (NULL_TREE, NULL_TREE, name);
-
- DECL_ABSTRACT_ORIGIN (alias) = expr;
- TREE_CHAIN (alias) = NULL_TREE;
- pushdecllist (alias, 0);
-}
-
-static void
-do_based_decl (name, mode, base_var)
- tree name, mode, base_var;
-{
- tree decl;
- if (pass == 1)
- {
- push_obstacks (&permanent_obstack, &permanent_obstack);
- decl = make_node (BASED_DECL);
- DECL_NAME (decl) = name;
- TREE_TYPE (decl) = mode;
- DECL_ABSTRACT_ORIGIN (decl) = base_var;
- save_decl (decl);
- pop_obstacks ();
- }
- else
- {
- tree base_decl;
- decl = get_next_decl ();
- if (name != DECL_NAME (decl))
- abort();
- /* FIXME: This isn't a complete test */
- base_decl = lookup_name (base_var);
- if (base_decl == NULL_TREE)
- error ("BASE variable never declared");
- else if (TREE_CODE (base_decl) == FUNCTION_DECL)
- error ("cannot BASE a variable on a PROC/PROCESS name");
- }
-}
-
-void
-do_based_decls (names, mode, base_var)
- tree names, mode, base_var;
-{
- if (names == NULL_TREE || TREE_CODE (names) == TREE_LIST)
- {
- for (; names != NULL_TREE; names = TREE_CHAIN (names))
- do_based_decl (names, mode, base_var);
- }
- else if (TREE_CODE (names) != ERROR_MARK)
- do_based_decl (names, mode, base_var);
-}
-
-/*
- * Declare the fields so that lookup_name() will find them as
- * component refs for Pascal WITH or CHILL DO WITH.
- *
- * Proceeds to the inner layers of Pascal/CHILL variant record
- *
- * Internal routine of shadow_record_fields ()
- */
-static void
-handle_one_level (parent, fields)
- tree parent, fields;
-{
- tree field, name;
-
- switch (TREE_CODE (TREE_TYPE (parent)))
- {
- case RECORD_TYPE:
- case UNION_TYPE:
- for (field = fields; field; field = TREE_CHAIN (field)) {
- name = DECL_NAME (field);
- if (name == NULL_TREE || name == ELSE_VARIANT_NAME)
- /* proceed through variant part */
- handle_one_level (parent, TYPE_FIELDS (TREE_TYPE (field)));
- else
- {
- tree field_alias = make_node (WITH_DECL);
- DECL_NAME (field_alias) = name;
- TREE_TYPE (field_alias) = TREE_TYPE (field);
- DECL_ABSTRACT_ORIGIN (field_alias) = parent;
- TREE_CHAIN (field_alias) = NULL_TREE;
- pushdecllist (field_alias, 0);
- }
- }
- break;
- default:
- error ("INTERNAL ERROR: handle_one_level is broken");
- }
-}
-
-/*
- * For each FIELD_DECL node in a RECORD_TYPE, we have to declare
- * a name so that lookup_name will find a COMPONENT_REF node
- * when the name is referenced. This happens in Pascal WITH statement.
- */
-void
-shadow_record_fields (struct_val)
- tree struct_val;
-{
- if (pass == 1 || struct_val == NULL_TREE)
- return;
-
- handle_one_level (struct_val, TYPE_FIELDS (TREE_TYPE (struct_val)));
-}
-
-static char exception_prefix [] = "__Ex_";
-
-tree
-build_chill_exception_decl (name)
- const char *name;
-{
- tree decl, ex_name, ex_init, ex_type;
- int name_len = strlen (name);
- char *ex_string = (char *)
- alloca (strlen (exception_prefix) + name_len + 1);
-
- sprintf(ex_string, "%s%s", exception_prefix, name);
- ex_name = get_identifier (ex_string);
- decl = IDENTIFIER_LOCAL_VALUE (ex_name);
- if (decl)
- return decl;
-
- /* finish_decl is too eager about switching back to the
- ambient context. This decl's rtl must live in the permanent_obstack. */
- push_obstacks (&permanent_obstack, &permanent_obstack);
- push_obstacks_nochange ();
- ex_type = build_array_type (char_type_node,
- build_index_2_type (integer_zero_node,
- build_int_2 (name_len, 0)));
- decl = build_lang_decl (VAR_DECL, ex_name, ex_type);
- ex_init = build_string (name_len, name);
- TREE_TYPE (ex_init) = ex_type;
- DECL_INITIAL (decl) = ex_init;
- TREE_READONLY (decl) = 1;
- TREE_STATIC (decl) = 1;
- pushdecl_top_level (decl);
- finish_decl (decl);
- pop_obstacks (); /* Return to the ambient context. */
- return decl;
-}
-
-extern tree module_init_list;
-
-/*
- * This function is called from the parser to preface the entire
- * compilation. It contains module-level actions and reach-bound
- * initialization.
- */
-void
-start_outer_function ()
-{
- start_chill_function (pass < 2 ? get_identifier ("_GLOBAL_")
- : DECL_NAME (global_function_decl),
- void_type_node, NULL_TREE, NULL_TREE, NULL_TREE);
- global_function_decl = current_function_decl;
- global_scope = current_scope;
- chill_at_module_level = 1;
-}
-
-/* This function finishes the global_function_decl, and if it is non-empty
- * (as indiacted by seen_action), adds it to module_init_list.
- */
-void
-finish_outer_function ()
-{
- /* If there was module-level code in this module (not just function
- declarations), we allocate space for this module's init list entry,
- and fill in the module's function's address. */
-
- extern tree initializer_type;
- const char *fname_str = IDENTIFIER_POINTER (DECL_NAME (current_function_decl));
- char *init_entry_name = (char *)xmalloc ((unsigned)(strlen (fname_str) + 20));
- tree init_entry_id;
- tree init_entry_decl;
- tree initializer;
-
- finish_chill_function ();
-
- chill_at_module_level = 0;
-
-
- if (!seen_action)
- return;
-
- sprintf (init_entry_name, "__tmp_%s_init_entry", fname_str);
- init_entry_id = get_identifier (init_entry_name);
-
- init_entry_decl = build1 (ADDR_EXPR,
- TREE_TYPE (TYPE_FIELDS (initializer_type)),
- global_function_decl);
- TREE_CONSTANT (init_entry_decl) = 1;
- initializer = build (CONSTRUCTOR, initializer_type, NULL_TREE,
- tree_cons (NULL_TREE, init_entry_decl,
- build_tree_list (NULL_TREE,
- null_pointer_node)));
- TREE_CONSTANT (initializer) = 1;
- init_entry_decl
- = do_decl (init_entry_id, initializer_type, 1, 1, initializer, 0);
- DECL_SOURCE_LINE (init_entry_decl) = 0;
- if (pass == 1)
- /* tell chill_finish_compile that there's
- module-level code to be processed. */
- module_init_list = integer_one_node;
- else if (build_constructor)
- module_init_list = tree_cons (global_function_decl,
- init_entry_decl,
- module_init_list);
-
- make_decl_rtl (global_function_decl, NULL, 0);
-}
diff --git a/gcc/ch/except.c b/gcc/ch/except.c
deleted file mode 100644
index b32dba60636..00000000000
--- a/gcc/ch/except.c
+++ /dev/null
@@ -1,707 +0,0 @@
-/* Exception support for GNU CHILL.
- WARNING: Only works for native (needs setjmp.h)! FIXME!
- Copyright (C) 1992, 1993, 1994, 1998, 1999, 2000, 2001
- Free Software Foundation, Inc.
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-#include "config.h"
-#include "system.h"
-
-/* On Suns this can get you to the right definition if you
- set the right value for TARGET. */
-#include <setjmp.h>
-#ifdef sequent
-/* Can you believe they forgot this? */
-#ifndef _JBLEN
-#define _JBLEN 11
-#endif
-#endif
-
-#ifndef _JBLEN
-#define _JBLEN (sizeof(jmp_buf)/sizeof(int))
-#define _JBLEN_2 _JBLEN+20
-#else
-/* if we use i.e. posix threads, this buffer must be longer */
-#define _JBLEN_2 _JBLEN+20
-#endif
-
-/* On Linux setjmp is __setjmp FIXME: what is for CROSS */
-#ifndef SETJMP_LIBRARY_NAME
-#ifdef __linux__
-#define SETJMP_LIBRARY_NAME "__setjmp"
-#else
-#define SETJMP_LIBRARY_NAME "setjmp"
-#endif
-#endif
-
-#include "tree.h"
-#include "ch-tree.h"
-#include "rtl.h"
-#include "toplev.h"
-
-extern int expand_exit_needed;
-
-static tree link_handler_decl;
-static tree handler_link_pointer_type;
-static tree unlink_handler_decl;
-static int exceptions_initialized = 0;
-static void emit_setup_handler PARAMS ((void));
-static void initialize_exceptions PARAMS ((void));
-static tree start_handler_array PARAMS ((void));
-static void finish_handler_array PARAMS ((void));
-static tree char_pointer_type_for_handler;
-
-/* If this is 1, operations to push and pop on the __exceptionStack
- are inline. The default is is to use a function call, to
- allow for a per-thread exception stack. */
-static int inline_exception_stack_ops = 0;
-
-struct handler_state
-{
- struct handler_state *next;
-
- /* Starts at 0, then incremented for every <on-alternative>. */
- int prev_on_alternative;
-
- /* If > 0: handler number for ELSE handler. */
- int else_handler;
-
- int action_number;
-
- char do_pushlevel;
-
- tree on_alt_list;
- tree setjmp_expr;
-
- /* A decl for the static handler array (used to map exception name to int).*/
- tree handler_array_decl;
-
- rtx end_label;
-
- /* Used to pass a tree from emit_setup_handler to chill_start_on. */
- tree handler_ref;
-
- tree unlink_cleanup;
-
- tree function;
-
- /* flag to indicate that we are currently compiling this handler.
- is_handled will need this to determine an unhandled exception */
- int compiling;
-};
-
-/* This is incremented by one each time we start an action which
- might have an ON-handler. It is reset between passes. */
-static int action_number = 0;
-
-int action_nesting_level = 0;
-
-/* The global_handler_list is constructed in pass 1. It is not sorted.
- It contains one element for each action that actually had an ON-handler.
- An element's ACTION_NUMBER matches the action_number
- of that action. The global_handler_list is eaten up during pass 2. */
-#define ACTION_NUMBER(HANDLER) ((HANDLER)->action_number)
-struct handler_state *global_handler_list = NULL;
-
-/* This is a stack of handlers, one for each nested ON-handler. */
-static struct handler_state *current_handler = NULL;
-
-static struct handler_state *free_handlers = NULL; /* freelist */
-
-static tree handler_element_type;
-static tree handler_link_type;
-static tree BISJ;
-static tree jbuf_ident, prev_ident, handlers_ident;
-static tree exception_stack_decl = 0;
-
-/* Chain of cleanups assocated with exception handlers.
- The TREE_PURPOSE is an INTEGER_CST whose value is the
- DECL_ACTION_NESTING_LEVEL (when the handled actions was entered).
- The TREE_VALUE is an expression to expand when we exit that action. */
-
-static tree cleanup_chain = NULL_TREE;
-
-#if 0
-/* Merge the current sequence onto the tail of the previous one. */
-
-void
-pop_sequence ()
-{
- rtx sequence_first = get_insns ();
-
- end_sequence ();
- emit_insns (sequence_first);
-
-}
-#endif
-
-/* Things we need to do at the beginning of pass 2. */
-
-void
-except_init_pass_2 ()
-{
- /* First sort the global_handler_list on ACTION_NUMBER.
- This will already be in close to reverse order (the exception being
- nested ON-handlers), so insertion sort should essentially linear. */
-
- register struct handler_state *old_list = global_handler_list;
-
- /* First add a dummy final element. */
- if (free_handlers)
- global_handler_list = free_handlers;
- else
- global_handler_list
- = (struct handler_state*) permalloc (sizeof (struct handler_state));
- /* Make the final dummy "larger" than any other element. */
- ACTION_NUMBER (global_handler_list) = action_number + 1;
- /* Now move all the elements in old_list over to global_handler_list. */
- while (old_list != NULL)
- {
- register struct handler_state **ptr = &global_handler_list;
- /* Unlink from old_list. */
- register struct handler_state *current = old_list;
- old_list = old_list->next;
-
- while (ACTION_NUMBER (current) > ACTION_NUMBER (*ptr))
- ptr = &(*ptr)->next;
- /* Link into proper place in global_handler_list (new list). */
- current->next = *ptr;
- *ptr = current;
- }
-
- /* Don't forget to reset action_number. */
- action_number = 0;
-}
-
-/* This function is called at the beginning of an action that might be
- followed by an ON-handler. Chill syntax doesn't let us know if
- we actually have an ON-handler until we see the ON, so we save
- away during pass 1 that information for use during pass 2. */
-
-void
-push_handler ()
-{
- register struct handler_state *hstate;
-
- action_number++;
- action_nesting_level++;
-
- if (pass == 1)
- {
- if (free_handlers)
- {
- hstate = free_handlers;
- free_handlers = hstate->next;
- }
- else
- {
- hstate =
- (struct handler_state*) permalloc (sizeof (struct handler_state));
- }
-
- hstate->next = current_handler;
- current_handler = hstate;
- hstate->prev_on_alternative = 0;
- hstate->else_handler = 0;
- hstate->on_alt_list = NULL_TREE;
- hstate->compiling = 0;
-
- ACTION_NUMBER (hstate) = action_number;
- return;
- }
-
- if (ACTION_NUMBER (global_handler_list) != action_number)
- return;
-
- /* OK. This action actually has an ON-handler.
- Pop it from global_handler_list, and use it. */
-
- hstate = global_handler_list;
- global_handler_list = hstate->next;
-
- /* Since this is pass 2, let's generate prologue code for that. */
-
- hstate->next = current_handler;
- current_handler = hstate;
-
- hstate->prev_on_alternative = 0;
- hstate->function = current_function_decl;
-
- emit_setup_handler ();
-}
-
-static tree
-start_handler_array ()
-{
- tree handler_array_type, decl;
-
- push_obstacks_nochange ();
- end_temporary_allocation ();
- handler_array_type = build_array_type (handler_element_type, NULL_TREE);
- decl = build_lang_decl (VAR_DECL,
- get_unique_identifier ("handler_table"),
- handler_array_type);
-
-/* TREE_TYPE (decl) = handler_array_type;*/
- TREE_READONLY (decl) = 1;
- TREE_STATIC (decl) = 1;
- DECL_INITIAL (decl) = error_mark_node;
-
- pushdecl (decl);
- make_decl_rtl (decl, NULL_PTR, 0);
- current_handler->handler_array_decl = decl;
- return decl;
-}
-
-static void
-finish_handler_array ()
-{
- tree decl = current_handler->handler_array_decl;
- tree t;
- tree handler_array_init = NULL_TREE;
- int handlers_count = 1;
- int nelts;
-
- /* Build the table mapping exceptions to handler(-number)s.
- This is done in reverse order. */
-
- /* First push the end of the list. This is either the ELSE
- handler (current_handler->else_handler>0) or NULL handler to indicate
- the end of the list (if current_handler->else-handler == 0).
- The following works either way. */
- handler_array_init = build_tree_list
- (NULL_TREE, chill_expand_tuple
- (handler_element_type,
- build_nt (CONSTRUCTOR, NULL_TREE,
- tree_cons (NULL_TREE,
- null_pointer_node,
- build_tree_list (NULL_TREE,
- build_int_2 (current_handler->else_handler,
- 0))))));
-
- for (t = current_handler->on_alt_list; t != NULL_TREE; t = TREE_CHAIN (t))
- { tree handler_number = TREE_PURPOSE(t);
- tree elist = TREE_VALUE (t);
- for ( ; elist != NULL_TREE; elist = TREE_CHAIN (elist))
- {
- tree ex_decl =
- build_chill_exception_decl (IDENTIFIER_POINTER(TREE_VALUE(elist)));
- tree ex_addr = build1 (ADDR_EXPR,
- char_pointer_type_for_handler,
- ex_decl);
- tree el = build_nt (CONSTRUCTOR, NULL_TREE,
- tree_cons (NULL_TREE,
- ex_addr,
- build_tree_list (NULL_TREE,
- handler_number)));
- mark_addressable (ex_decl);
- TREE_CONSTANT (ex_addr) = 1;
- handler_array_init =
- tree_cons (NULL_TREE,
- chill_expand_tuple (handler_element_type, el),
- handler_array_init);
- handlers_count++;
- }
- }
-
-#if 1
- nelts = list_length (handler_array_init);
- TYPE_DOMAIN (TREE_TYPE (decl))
- = build_index_type (build_int_2 (nelts - 1, - (nelts == 0)));
- layout_type (TREE_TYPE (decl));
- DECL_INITIAL (decl)
- = convert (TREE_TYPE (decl),
- build_nt (CONSTRUCTOR, NULL_TREE, handler_array_init));
-
- /* Pop back to the obstack that is current for this binding level.
- This is because MAXINDEX, rtl, etc. to be made below
- must go in the permanent obstack. But don't discard the
- temporary data yet. */
- pop_obstacks ();
- layout_decl (decl, 0);
- /* To prevent make_decl_rtl (called indiectly by rest_of_decl_compilation)
- throwing the existing RTL (which has already been used). */
- PUT_MODE (DECL_RTL (decl), DECL_MODE (decl));
- rest_of_decl_compilation (decl, (char*)0, 0, 0);
- expand_decl_init (decl);
-#else
- /* To prevent make_decl_rtl (called indirectly by finish_decl)
- altering the existing RTL. */
- GET_MODE (DECL_RTL (current_handler->handler_array_decl)) =
- DECL_MODE (current_handler->handler_array_decl);
-
- finish_decl (current_handler->handler_array_decl,
- build_nt (CONSTRUCTOR, NULL_TREE, handler_array_init),
- NULL_TREE);
-#endif
-}
-
-
-void
-pop_handler (used)
- int used;
-{
- action_nesting_level--;
- if (pass == 1)
- {
- struct handler_state *old = current_handler;
-
- if (old == NULL)
- abort ();
- current_handler = old->next;
-
- if (used)
- { /* Push unto global_handler_list. */
- old->next = global_handler_list;
- global_handler_list = old;
- }
- else
- {
- /* Push onto free_handlers free list. */
- old->next = free_handlers;
- free_handlers = old;
- }
- }
- else if (used)
- {
- current_handler = current_handler->next;
- }
-}
-
-/* Emit code before an action that has an ON-handler. */
-
-static void
-emit_setup_handler ()
-{
- tree handler_decl, handler_addr, t;
-
- /* Field references. */
- tree jbuf_ref, handlers_ref,prev_ref;
- if (!exceptions_initialized)
- {
- /* We temporarily reset the maximum_field_alignment to zero so the
- compiler's exception data structures can be compatible with the
- run-time system, even when we're compiling with -fpack. */
- unsigned int save_maximum_field_alignment = maximum_field_alignment;
- maximum_field_alignment = 0;
- push_obstacks_nochange ();
- end_temporary_allocation ();
- initialize_exceptions ();
- pop_obstacks ();
- maximum_field_alignment = save_maximum_field_alignment;
- }
-
- push_momentary ();
-
- handler_decl = build_lang_decl (VAR_DECL,
- get_unique_identifier ("handler"),
- handler_link_type);
- push_obstacks_nochange ();
- pushdecl(handler_decl);
- expand_decl (handler_decl);
- finish_decl (handler_decl);
-
- jbuf_ref = build_component_ref (handler_decl, jbuf_ident);
- jbuf_ref = build_chill_arrow_expr (jbuf_ref, 1);
- handlers_ref = build_component_ref (handler_decl, handlers_ident);
- prev_ref = build_component_ref (handler_decl, prev_ident);
-
- /* Emit code to link in handler in __exceptionStack chain. */
- mark_addressable (handler_decl);
- handler_addr = build1 (ADDR_EXPR, handler_link_pointer_type, handler_decl);
- if (inline_exception_stack_ops)
- {
- expand_expr_stmt (build_chill_modify_expr (prev_ref,
- exception_stack_decl));
- expand_expr_stmt (build_chill_modify_expr (exception_stack_decl,
- handler_addr));
- current_handler->handler_ref = prev_ref;
- }
- else
- {
- expand_expr_stmt (build_chill_function_call (link_handler_decl,
- build_tree_list (NULL_TREE,
- handler_addr)));
- current_handler->handler_ref = handler_addr;
- }
-
- /* Expand: handler->__handlers = { <<array mapping names to ints } */
- t = build1 (NOP_EXPR, build_pointer_type (handler_element_type),
- build_chill_arrow_expr (start_handler_array (), 1));
- expand_expr_stmt (build_chill_modify_expr (handlers_ref, t));
-
- /* Emit code to unlink handler. */
- if (inline_exception_stack_ops)
- current_handler->unlink_cleanup
- = build_chill_modify_expr (exception_stack_decl,
- current_handler->handler_ref);
- else
- current_handler->unlink_cleanup
- = build_chill_function_call (unlink_handler_decl,
- build_tree_list(NULL_TREE,
- current_handler->handler_ref));
- cleanup_chain = tree_cons (build_int_2 (action_nesting_level, 0),
- current_handler->unlink_cleanup,
- cleanup_chain);
-
- /* Emit code for setjmp. */
-
- current_handler->setjmp_expr =
- build_chill_function_call (BISJ, build_tree_list (NULL_TREE, jbuf_ref));
- expand_start_case (1, current_handler->setjmp_expr,
- integer_type_node, "on handler");
-
- chill_handle_case_label (integer_zero_node, current_handler->setjmp_expr);
-}
-
-/* Start emitting code for: <actions> ON <handlers> END.
- Assume we've parsed <actions>, and the setup needed for it. */
-
-void
-chill_start_on ()
-{
- expand_expr_stmt (current_handler->unlink_cleanup);
-
- /* Emit code to jump past the handlers. */
- current_handler->end_label = gen_label_rtx ();
- current_handler->compiling = 1;
- emit_jump (current_handler->end_label);
-}
-
-void
-chill_finish_on ()
-{
- expand_end_case (current_handler->setjmp_expr);
-
- finish_handler_array ();
-
- emit_label (current_handler->end_label);
-
- pop_momentary ();
-
- cleanup_chain = TREE_CHAIN (cleanup_chain);
-}
-
-void
-chill_handle_on_labels (labels)
- tree labels;
-{
- unsigned int alternative = ++current_handler->prev_on_alternative;
- if (pass == 1)
- {
- tree handler_number = build_int_2 (alternative, 0);
- current_handler->on_alt_list =
- tree_cons (handler_number, labels, current_handler->on_alt_list);
- }
- else
- {
- /* Find handler_number saved in pass 1. */
- tree tmp;
-
- for (tmp = current_handler->on_alt_list;
- compare_tree_int (TREE_PURPOSE (tmp), alternative) != 0;
- tmp = TREE_CHAIN (tmp))
- ;
-
- if (expand_exit_needed)
- expand_exit_something (), expand_exit_needed = 0;
- chill_handle_case_label (TREE_PURPOSE (tmp),
- current_handler->setjmp_expr);
- }
-}
-
-void
-chill_start_default_handler ()
-{
- current_handler->else_handler = ++current_handler->prev_on_alternative;
- if (!ignoring)
- {
- chill_handle_case_default ();
- }
-}
-
-void
-chill_check_no_handlers ()
-{
- if (current_handler != NULL)
- abort ();
-}
-
-static void
-initialize_exceptions ()
-{
- tree jmp_buf_type = build_array_type (integer_type_node,
- build_index_type (build_int_2 (_JBLEN_2-1, 0)));
- tree setjmp_fndecl, link_ftype;
- tree parmtypes
- = tree_cons (NULL_TREE, build_pointer_type (jmp_buf_type), void_list_node);
-
- setjmp_fndecl = builtin_function ("setjmp",
- build_function_type (integer_type_node,
- parmtypes),
- 0, NOT_BUILT_IN,
- SETJMP_LIBRARY_NAME);
- BISJ = build1 (ADDR_EXPR, build_pointer_type (TREE_TYPE (setjmp_fndecl)),
- setjmp_fndecl);
-
- char_pointer_type_for_handler
- = build_pointer_type (build_type_variant (char_type_node, 1, 0));
- handler_element_type =
- build_chill_struct_type (chainon
- (build_decl (FIELD_DECL,
- get_identifier("__exceptid"),
- char_pointer_type_for_handler),
- build_decl (FIELD_DECL,
- get_identifier("__handlerno"),
- integer_type_node)));
-
- jbuf_ident = get_identifier("__jbuf");
- prev_ident = get_identifier("__prev");
- handlers_ident = get_identifier("__handlers");
-
- handler_link_type =
- build_chill_struct_type
- (chainon
- (build_decl (FIELD_DECL, prev_ident, ptr_type_node),
- chainon
- (build_decl (FIELD_DECL, handlers_ident,
- build_pointer_type (handler_element_type)),
- build_decl (FIELD_DECL, jbuf_ident, jmp_buf_type))));
-
- handler_link_pointer_type = build_pointer_type (handler_link_type);
-
- if (inline_exception_stack_ops)
- {
- exception_stack_decl =
- build_lang_decl (VAR_DECL,
- get_identifier("__exceptionStack"),
- handler_link_pointer_type);
- TREE_STATIC (exception_stack_decl) = 1;
- TREE_PUBLIC (exception_stack_decl) = 1;
- DECL_EXTERNAL (exception_stack_decl) = 1;
- push_obstacks_nochange ();
- pushdecl(exception_stack_decl);
- make_decl_rtl (exception_stack_decl, NULL_PTR, 1);
- finish_decl (exception_stack_decl);
- }
-
- link_ftype = build_function_type (void_type_node,
- tree_cons (NULL_TREE,
- handler_link_pointer_type,
- void_list_node));
- link_handler_decl = builtin_function ("__ch_link_handler", link_ftype,
- 0, NOT_BUILT_IN, NULL_PTR);
- unlink_handler_decl = builtin_function ("__ch_unlink_handler", link_ftype,
- 0, NOT_BUILT_IN, NULL_PTR);
-
- exceptions_initialized = 1;
-}
-
-/* Do the cleanup(s) needed for a GOTO label.
- We only need to do the last of the cleanups. */
-
-void
-expand_goto_except_cleanup (label_level)
- int label_level;
-{
- tree list = cleanup_chain;
- tree last = NULL_TREE;
- for ( ; list != NULL_TREE; list = TREE_CHAIN (list))
- {
- if (compare_tree_int (TREE_PURPOSE (list), label_level) > 0)
- last = list;
- else
- break;
- }
- if (last)
- expand_expr_stmt (TREE_VALUE (last));
-}
-
-/* Returns true if there is a valid handler for EXCEPT_NAME
- in the current static scope.
- 0 ... no handler found
- 1 ... local handler available
- 2 ... function may propagate this exception
-*/
-
-int
-is_handled (except_name)
- tree except_name;
-{
- tree t;
- struct handler_state *h = current_handler;
-
- /* if we are are currently compiling this handler
- we have to start at the next level */
- if (h && h->compiling)
- h = h->next;
- while (h != NULL)
- {
- if (h->function != current_function_decl)
- break;
- if (h->else_handler > 0)
- return 1;
- for (t = h->on_alt_list; t != NULL_TREE; t = TREE_CHAIN (t))
- {
- if (value_member (except_name, TREE_VALUE (t)))
- return 1;
- }
- h = h->next;
- }
-
- t = TYPE_RAISES_EXCEPTIONS (TREE_TYPE (current_function_decl));
-
- if (value_member (except_name, t))
- return 2;
- return 0;
-}
-
-/* function generates code to reraise exceptions
- for PROC's propagating exceptions. */
-
-void
-chill_reraise_exceptions (exceptions)
- tree exceptions;
-{
- tree wrk;
-
- if (exceptions == NULL_TREE)
- return; /* just in case */
-
- if (pass == 1)
- {
- for (wrk = exceptions; wrk != NULL_TREE; wrk = TREE_CHAIN (wrk))
- chill_handle_on_labels (build_tree_list (NULL_TREE, TREE_VALUE (wrk)));
- }
- else /* pass == 2 */
- {
- chill_start_on ();
- expand_exit_needed = 0;
-
- for (wrk = exceptions; wrk != NULL_TREE; wrk = TREE_CHAIN (wrk))
- {
- chill_handle_on_labels (TREE_VALUE (wrk));
- /* do a CAUSE exception */
- expand_expr_stmt (build_cause_exception (TREE_VALUE (wrk), 0));
- expand_exit_needed = 1;
- }
- chill_finish_on ();
- }
- pop_handler (1);
-}
diff --git a/gcc/ch/expr.c b/gcc/ch/expr.c
deleted file mode 100644
index 59371e820db..00000000000
--- a/gcc/ch/expr.c
+++ /dev/null
@@ -1,4512 +0,0 @@
-/* Convert language-specific tree expression to rtl instructions,
- for GNU CHILL compiler.
- Copyright (C) 1992, 1993, 1994, 1998, 1999, 2000, 2001
- Free Software Foundation, Inc.
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-
-#include "config.h"
-#include "system.h"
-#include "rtl.h"
-#include "tree.h"
-#include "flags.h"
-#include "expr.h"
-#include "ch-tree.h"
-#include "assert.h"
-#include "lex.h"
-#include "convert.h"
-#include "toplev.h"
-
-extern char **boolean_code_name;
-extern int flag_old_strings;
-extern int ignore_case;
-extern int special_UC;
-
-/* definitions for duration built-ins */
-#define MILLISECS_MULTIPLIER 1
-#define SECS_MULTIPLIER MILLISECS_MULTIPLIER * 1000
-#define MINUTES_MULTIPLIER SECS_MULTIPLIER * 60
-#define HOURS_MULTIPLIER MINUTES_MULTIPLIER * 60
-#define DAYS_MULTIPLIER HOURS_MULTIPLIER * 24
-
-/* the maximum value for each of the calls */
-#define MILLISECS_MAX 0xffffffff
-#define SECS_MAX 4294967
-#define MINUTES_MAX 71582
-#define HOURS_MAX 1193
-#define DAYS_MAX 49
-
-/* forward declarations */
-static rtx chill_expand_expr PARAMS ((tree, rtx, enum machine_mode,
- enum expand_modifier));
-static tree chill_expand_case_expr PARAMS ((tree));
-static int check_arglist_length PARAMS ((tree, int, int, tree));
-static tree internal_build_compound_expr PARAMS ((tree, int));
-static int is_really_instance PARAMS ((tree));
-static int invalid_operand PARAMS ((enum chill_tree_code,
- tree, int));
-static int invalid_right_operand PARAMS ((enum chill_tree_code, tree));
-static tree build_chill_abstime PARAMS ((tree));
-static tree build_allocate_memory_call PARAMS ((tree, tree));
-static tree build_allocate_global_memory_call PARAMS ((tree, tree));
-static tree build_return_memory PARAMS ((tree));
-static tree build_chill_duration PARAMS ((tree, unsigned long,
- tree, unsigned long));
-static tree build_chill_floatcall PARAMS ((tree, const char *,
- const char *));
-static tree build_allocate_getstack PARAMS ((tree, tree, const char *,
- const char *, tree, tree));
-static tree build_chill_allocate PARAMS ((tree, tree));
-static tree build_chill_getstack PARAMS ((tree, tree));
-static tree build_chill_terminate PARAMS ((tree));
-static tree build_chill_inttime PARAMS ((tree, tree));
-static tree build_chill_lower_or_upper PARAMS ((tree, int));
-static tree build_max_min PARAMS ((tree, int));
-static tree build_chill_pred_or_succ PARAMS ((tree, enum tree_code));
-static tree expand_packed_set PARAMS ((const char *, int, tree));
-static tree fold_set_expr PARAMS ((enum chill_tree_code,
- tree, tree));
-static tree build_compare_set_expr PARAMS ((enum tree_code, tree, tree));
-static tree scalar_to_string PARAMS ((tree));
-static tree build_concat_expr PARAMS ((tree, tree));
-static tree build_compare_string_expr PARAMS ((enum tree_code, tree, tree));
-static tree compare_records PARAMS ((tree, tree));
-static tree string_char_rep PARAMS ((int, tree));
-static tree build_boring_bitstring PARAMS ((long, int));
-
-/* variable to hold the type the DESCR built-in returns */
-static tree descr_type = NULL_TREE;
-
-
-/* called from ch-lex.l */
-void
-init_chill_expand ()
-{
- lang_expand_expr = chill_expand_expr;
-}
-
-/* Take the address of something that needs to be passed by reference. */
-tree
-force_addr_of (value)
- tree value;
-{
- /* FIXME. Move to memory, if needed. */
- if (TREE_CODE (value) == INDIRECT_REF)
- return convert_to_pointer (ptr_type_node, TREE_OPERAND (value, 0));
- mark_addressable (value);
- return build1 (ADDR_EXPR, ptr_type_node, value);
-}
-
-/* Check that EXP has a known type. */
-
-tree
-check_have_mode (exp, context)
- tree exp;
- const char *context;
-{
- if (TREE_CODE (exp) != ERROR_MARK && TREE_TYPE (exp) == NULL_TREE)
- {
- if (TREE_CODE (exp) == CONSTRUCTOR)
- error ("tuple without specified mode not allowed in %s", context);
- else if (TREE_CODE (exp) == COND_EXPR || TREE_CODE (exp) == CASE_EXPR)
- error ("conditional expression not allowed in %s", context);
- else
- error ("internal error: unknown expression mode in %s", context);
-
- return error_mark_node;
- }
- return exp;
-}
-
-/* Check that EXP is discrete. Handle conversion if flag_old_strings. */
-
-tree
-check_case_selector (exp)
- tree exp;
-{
- if (exp != NULL_TREE && TREE_TYPE (exp) != NULL_TREE)
- exp = convert_to_discrete (exp);
- if (exp)
- return exp;
- error ("CASE selector is not a discrete expression");
- return error_mark_node;
-}
-
-tree
-check_case_selector_list (list)
- tree list;
-{
- tree selector, exp, return_list = NULL_TREE;
-
- for (selector = list; selector != NULL_TREE; selector = TREE_CHAIN (selector))
- {
- exp = check_case_selector (TREE_VALUE (selector));
- if (exp == error_mark_node)
- {
- return_list = error_mark_node;
- break;
- }
- return_list = tree_cons (TREE_PURPOSE (selector), exp, return_list);
- }
-
- return nreverse(return_list);
-}
-
-static tree
-chill_expand_case_expr (expr)
- tree expr;
-{
- tree selector_list = TREE_OPERAND (expr, 0), selector;
- tree alternatives = TREE_OPERAND (expr, 1);
- tree type = TREE_TYPE (expr);
- int else_seen = 0;
- tree result;
-
- if (TREE_CODE (selector_list) != TREE_LIST
- || TREE_CODE (alternatives) != TREE_LIST)
- abort();
- if (TREE_CHAIN (selector_list) != NULL_TREE)
- abort ();
-
- /* make a temp for the case result */
- result = decl_temp1 (get_unique_identifier ("CASE_EXPR"),
- type, 0, NULL_TREE, 0, 0);
-
- selector = check_case_selector (TREE_VALUE (selector_list));
-
- expand_start_case (1, selector, TREE_TYPE (selector), "CASE expression");
-
- alternatives = nreverse (alternatives);
- for ( ; alternatives != NULL_TREE; alternatives = TREE_CHAIN (alternatives))
- {
- tree labels = TREE_PURPOSE (alternatives), t;
-
- if (labels == NULL_TREE)
- {
- chill_handle_case_default ();
- else_seen++;
- }
- else
- {
- tree label;
- if (labels != NULL_TREE)
- {
- for (label = TREE_VALUE (labels);
- label != NULL_TREE; label = TREE_CHAIN (label))
- chill_handle_case_label (TREE_VALUE (label), selector);
- labels = TREE_CHAIN (labels);
- if (labels != NULL_TREE)
- error ("The number of CASE selectors does not match the number of CASE label lists");
-
- }
- }
-
- t = build (MODIFY_EXPR, type, result,
- convert (type, TREE_VALUE (alternatives)));
- TREE_SIDE_EFFECTS (t) = 1;
- expand_expr_stmt (t);
- expand_exit_something ();
- }
-
- if (!else_seen)
- {
- chill_handle_case_default ();
- expand_exit_something ();
-#if 0
- expand_raise ();
-#endif
-
- check_missing_cases (TREE_TYPE (selector));
- }
-
- expand_end_case (selector);
- return result;
-}
-
-/* Hook used by expand_expr to expand CHILL-specific tree codes. */
-
-static rtx
-chill_expand_expr (exp, target, tmode, modifier)
- tree exp;
- rtx target;
- enum machine_mode tmode;
- enum expand_modifier modifier;
-{
- tree type = TREE_TYPE (exp);
- register enum machine_mode mode = TYPE_MODE (type);
- register enum tree_code code = TREE_CODE (exp);
- rtx original_target = target;
- rtx op0, op1;
- int ignore = target == const0_rtx;
- const char *lib_func; /* name of library routine */
-
- if (ignore)
- target = 0, original_target = 0;
-
- /* No sense saving up arithmetic to be done
- if it's all in the wrong mode to form part of an address.
- And force_operand won't know whether to sign-extend or zero-extend. */
-
- if (mode != Pmode && modifier == EXPAND_SUM)
- modifier = EXPAND_NORMAL;
-
- switch (code)
- {
- case STRING_EQ_EXPR:
- case STRING_LT_EXPR:
- {
- rtx func = gen_rtx (SYMBOL_REF, Pmode,
- code == STRING_EQ_EXPR ? "__eqstring"
- : "__ltstring");
- tree exp0 = TREE_OPERAND (exp, 0);
- tree exp1 = TREE_OPERAND (exp, 1);
- tree size0, size1;
- rtx op0, op1, siz0, siz1;
- if (chill_varying_type_p (TREE_TYPE (exp0)))
- {
- exp0 = save_if_needed (exp0);
- size0 = convert (integer_type_node,
- build_component_ref (exp0, var_length_id));
- exp0 = build_component_ref (exp0, var_data_id);
- }
- else
- size0 = size_in_bytes (TREE_TYPE (exp0));
- if (chill_varying_type_p (TREE_TYPE (exp1)))
- {
- exp1 = save_if_needed (exp1);
- size1 = convert (integer_type_node,
- build_component_ref (exp1, var_length_id));
- exp1 = build_component_ref (exp1, var_data_id);
- }
- else
- size1 = size_in_bytes (TREE_TYPE (exp1));
-
- op0 = expand_expr (force_addr_of (exp0),
- NULL_RTX, MEM, EXPAND_CONST_ADDRESS);
- op1 = expand_expr (force_addr_of (exp1),
- NULL_RTX, MEM, EXPAND_CONST_ADDRESS);
- siz0 = expand_expr (size0, NULL_RTX, VOIDmode, 0);
- siz1 = expand_expr (size1, NULL_RTX, VOIDmode, 0);
- return emit_library_call_value (func, target,
- 0, QImode, 4,
- op0, GET_MODE (op0),
- siz0, TYPE_MODE (sizetype),
- op1, GET_MODE (op1),
- siz1, TYPE_MODE (sizetype));
- }
-
- case CASE_EXPR:
- return expand_expr (chill_expand_case_expr (exp),
- NULL_RTX, VOIDmode, 0);
- break;
-
- case SLICE_EXPR:
- {
- tree func_call;
- tree array = TREE_OPERAND (exp, 0);
- tree min_value = TREE_OPERAND (exp, 1);
- tree length = TREE_OPERAND (exp, 2);
- tree new_type = TREE_TYPE (exp);
- tree temp = decl_temp1 (get_unique_identifier ("BITSTRING"),
- new_type, 0, NULL_TREE, 0, 0);
- if (! CH_REFERABLE (array) && TYPE_MODE (TREE_TYPE (array)) != BLKmode)
- array = decl_temp1 (get_unique_identifier ("BSTRINGVAL"),
- TREE_TYPE (array), 0, array, 0, 0);
- func_call = build_chill_function_call (
- lookup_name (get_identifier ("__psslice")),
- tree_cons (NULL_TREE,
- build_chill_addr_expr (temp, (char *)0),
- tree_cons (NULL_TREE, length,
- tree_cons (NULL_TREE,
- force_addr_of (array),
- tree_cons (NULL_TREE, powersetlen (array),
- tree_cons (NULL_TREE, convert (integer_type_node, min_value),
- tree_cons (NULL_TREE, length, NULL_TREE)))))));
- expand_expr (func_call, const0_rtx, VOIDmode, 0);
- emit_queue ();
- return expand_expr (temp, ignore ? const0_rtx : target,
- VOIDmode, 0);
- }
-
- /* void __concatstring (char *out, char *left, unsigned left_len,
- char *right, unsigned right_len) */
- case CONCAT_EXPR:
- {
- tree exp0 = TREE_OPERAND (exp, 0);
- tree exp1 = TREE_OPERAND (exp, 1);
- rtx size0 = NULL_RTX, size1 = NULL_RTX;
- rtx targetx;
-
- if (TREE_CODE (exp1) == UNDEFINED_EXPR)
- {
- if (TYPE_MODE (TREE_TYPE (exp0)) == BLKmode
- && TYPE_MODE (TREE_TYPE (exp)) == BLKmode)
- {
- rtx temp = expand_expr (exp0, target, tmode, modifier);
- if (temp == target || target == NULL_RTX)
- return temp;
- emit_block_move (target, temp, expr_size (exp0),
- TYPE_ALIGN (TREE_TYPE(exp0)));
- return target;
- }
- else
- {
- exp0 = force_addr_of (exp0);
- exp0 = convert (build_pointer_type (TREE_TYPE (exp)), exp0);
- exp0 = build1 (INDIRECT_REF, TREE_TYPE (exp), exp0);
- return expand_expr (exp0,
- NULL_RTX, Pmode, EXPAND_CONST_ADDRESS);
- }
- }
-
- if (TREE_CODE (type) == ARRAY_TYPE)
- {
- /* No need to handle scalars or varying strings here, since that
- was done in convert or build_concat_expr. */
- size0 = expand_expr (size_in_bytes (TREE_TYPE (exp0)),
- NULL_RTX, Pmode, EXPAND_CONST_ADDRESS);
-
- size1 = expand_expr (size_in_bytes (TREE_TYPE (exp1)),
- NULL_RTX, Pmode, EXPAND_CONST_ADDRESS);
-
- /* build a temp for the result, target is its address */
- if (target == NULL_RTX)
- {
- tree type0 = TREE_TYPE (exp0);
- tree type1 = TREE_TYPE (exp1);
- HOST_WIDE_INT len0 = int_size_in_bytes (type0);
- HOST_WIDE_INT len1 = int_size_in_bytes (type1);
-
- if (len0 < 0 && TYPE_ARRAY_MAX_SIZE (type0)
- && host_integerp (TYPE_ARRAY_MAX_SIZE (type0), 1))
- len0 = tree_low_cst (TYPE_ARRAY_MAX_SIZE (type0), 1);
-
- if (len1 < 0 && TYPE_ARRAY_MAX_SIZE (type1)
- && host_integerp (TYPE_ARRAY_MAX_SIZE (type1), 1))
- len1 = tree_low_cst (TYPE_ARRAY_MAX_SIZE (type1), 1);
-
- if (len0 < 0 || len1 < 0)
- abort ();
-
- target = assign_stack_temp (mode, len0 + len1, 0);
- preserve_temp_slots (target);
- }
- }
- else if (TREE_CODE (type) == SET_TYPE)
- {
- if (target == NULL_RTX)
- {
- target = assign_stack_temp (mode, int_size_in_bytes (type), 0);
- preserve_temp_slots (target);
- }
- }
- else
- abort ();
-
- if (GET_CODE (target) == MEM)
- targetx = target;
- else
- targetx = assign_stack_temp (mode, GET_MODE_SIZE (mode), 0);
-
- /* expand 1st operand to a pointer to the array */
- op0 = expand_expr (force_addr_of (exp0),
- NULL_RTX, MEM, EXPAND_CONST_ADDRESS);
-
- /* expand 2nd operand to a pointer to the array */
- op1 = expand_expr (force_addr_of (exp1),
- NULL_RTX, MEM, EXPAND_CONST_ADDRESS);
-
- if (TREE_CODE (type) == SET_TYPE)
- {
- size0 = expand_expr (powersetlen (exp0),
- NULL_RTX, VOIDmode, 0);
- size1 = expand_expr (powersetlen (exp1),
- NULL_RTX, VOIDmode, 0);
-
- emit_library_call (gen_rtx(SYMBOL_REF, Pmode, "__concatps"),
- 0, Pmode, 5, XEXP (targetx, 0), Pmode,
- op0, GET_MODE (op0),
- convert_to_mode (TYPE_MODE (sizetype),
- size0, TREE_UNSIGNED (sizetype)),
- TYPE_MODE (sizetype),
- op1, GET_MODE (op1),
- convert_to_mode (TYPE_MODE (sizetype),
- size1, TREE_UNSIGNED (sizetype)),
- TYPE_MODE (sizetype));
- }
- else
- {
- /* copy left, then right array to target */
- emit_library_call (gen_rtx(SYMBOL_REF, Pmode, "__concatstring"),
- 0, Pmode, 5, XEXP (targetx, 0), Pmode,
- op0, GET_MODE (op0),
- convert_to_mode (TYPE_MODE (sizetype),
- size0, TREE_UNSIGNED (sizetype)),
- TYPE_MODE (sizetype),
- op1, GET_MODE (op1),
- convert_to_mode (TYPE_MODE (sizetype),
- size1, TREE_UNSIGNED (sizetype)),
- TYPE_MODE (sizetype));
- }
- if (targetx != target)
- emit_move_insn (target, targetx);
- return target;
- }
-
- /* FIXME: the set_length computed below is a compile-time constant;
- you'll need to re-write that part for VARYING bit arrays, and
- possibly the set pointer will need to be adjusted to point past
- the word containing its dynamic length. */
-
- /* void __notpowerset (char *out, char *src,
- unsigned long bitlength) */
- case SET_NOT_EXPR:
- {
-
- tree expr = TREE_OPERAND (exp, 0);
- tree tsize = powersetlen (expr);
- rtx targetx;
-
- if (TREE_CODE (TREE_TYPE (expr)) != SET_TYPE)
- tsize = fold (build (MULT_EXPR, sizetype, tsize,
- size_int (BITS_PER_UNIT)));
-
- /* expand 1st operand to a pointer to the set */
- op0 = expand_expr (force_addr_of (expr),
- NULL_RTX, MEM, EXPAND_CONST_ADDRESS);
-
- /* build a temp for the result, target is its address */
- if (target == NULL_RTX)
- {
- target = assign_stack_temp (TYPE_MODE (TREE_TYPE (exp)),
- int_size_in_bytes (TREE_TYPE (exp)),
- 0);
- preserve_temp_slots (target);
- }
- if (GET_CODE (target) == MEM)
- targetx = target;
- else
- targetx = assign_stack_temp (GET_MODE (target),
- GET_MODE_SIZE (GET_MODE (target)),
- 0);
- emit_library_call (gen_rtx(SYMBOL_REF, Pmode, "__notpowerset"),
- 0, VOIDmode, 3, XEXP (targetx, 0), Pmode,
- op0, GET_MODE (op0),
- expand_expr (tsize, NULL_RTX, MEM,
- EXPAND_CONST_ADDRESS),
- TYPE_MODE (long_unsigned_type_node));
- if (targetx != target)
- emit_move_insn (target, targetx);
- return target;
- }
-
- case SET_DIFF_EXPR:
- lib_func = "__diffpowerset";
- goto format_2;
-
- case SET_IOR_EXPR:
- lib_func = "__orpowerset";
- goto format_2;
-
- case SET_XOR_EXPR:
- lib_func = "__xorpowerset";
- goto format_2;
-
- /* void __diffpowerset (char *out, char *left, char *right,
- unsigned bitlength) */
- case SET_AND_EXPR:
- lib_func = "__andpowerset";
- format_2:
- {
- tree expr = TREE_OPERAND (exp, 0);
- tree tsize = powersetlen (expr);
- rtx targetx;
-
- if (TREE_CODE (TREE_TYPE (expr)) != SET_TYPE)
- tsize = fold (build (MULT_EXPR, long_unsigned_type_node,
- tsize,
- size_int (BITS_PER_UNIT)));
-
- /* expand 1st operand to a pointer to the set */
- op0 = expand_expr (force_addr_of (expr),
- NULL_RTX, MEM, EXPAND_CONST_ADDRESS);
-
- /* expand 2nd operand to a pointer to the set */
- op1 = expand_expr (force_addr_of (TREE_OPERAND (exp, 1)),
- NULL_RTX, MEM,
- EXPAND_CONST_ADDRESS);
-
-/* FIXME: re-examine this code - the unary operator code above has recently
- (93/03/12) been changed a lot. Should this code also change? */
- /* build a temp for the result, target is its address */
- if (target == NULL_RTX)
- {
- target = assign_stack_temp (TYPE_MODE (TREE_TYPE (exp)),
- int_size_in_bytes (TREE_TYPE (exp)),
- 0);
- preserve_temp_slots (target);
- }
- if (GET_CODE (target) == MEM)
- targetx = target;
- else
- targetx = assign_stack_temp (GET_MODE (target),
- GET_MODE_SIZE (GET_MODE (target)), 0);
- emit_library_call (gen_rtx(SYMBOL_REF, Pmode, lib_func),
- 0, VOIDmode, 4, XEXP (targetx, 0), Pmode,
- op0, GET_MODE (op0), op1, GET_MODE (op1),
- expand_expr (tsize, NULL_RTX, MEM,
- EXPAND_CONST_ADDRESS),
- TYPE_MODE (long_unsigned_type_node));
- if (target != targetx)
- emit_move_insn (target, targetx);
- return target;
- }
-
- case SET_IN_EXPR:
- {
- tree set = TREE_OPERAND (exp, 1);
- tree pos = convert (long_unsigned_type_node, TREE_OPERAND (exp, 0));
- tree set_type = TREE_TYPE (set);
- tree set_length = discrete_count (TYPE_DOMAIN (set_type));
- tree min_val = convert (long_integer_type_node,
- TYPE_MIN_VALUE (TYPE_DOMAIN (set_type)));
- tree fcall;
-
- /* FIXME: Function-call not needed if pos and width are constant! */
- if (! mark_addressable (set))
- {
- error ("powerset is not addressable");
- return const0_rtx;
- }
- /* we use different functions for bitstrings and powersets */
- if (CH_BOOLS_TYPE_P (set_type))
- fcall =
- build_chill_function_call (
- lookup_name (get_identifier ("__inbitstring")),
- tree_cons (NULL_TREE,
- convert (long_unsigned_type_node, pos),
- tree_cons (NULL_TREE,
- build1 (ADDR_EXPR, build_pointer_type (set_type), set),
- tree_cons (NULL_TREE,
- convert (long_unsigned_type_node, set_length),
- tree_cons (NULL_TREE, min_val,
- tree_cons (NULL_TREE, force_addr_of (get_chill_filename ()),
- build_tree_list (NULL_TREE, get_chill_linenumber ())))))));
- else
- fcall =
- build_chill_function_call (
- lookup_name (get_identifier ("__inpowerset")),
- tree_cons (NULL_TREE,
- convert (long_unsigned_type_node, pos),
- tree_cons (NULL_TREE,
- build1 (ADDR_EXPR, build_pointer_type (set_type), set),
- tree_cons (NULL_TREE,
- convert (long_unsigned_type_node, set_length),
- build_tree_list (NULL_TREE, min_val)))));
- return expand_expr (fcall, NULL_RTX, VOIDmode, 0);
- }
-
- case PACKED_ARRAY_REF:
- {
- tree array = TREE_OPERAND (exp, 0);
- tree pos = save_expr (TREE_OPERAND (exp, 1));
- tree array_type = TREE_TYPE (array);
- tree array_length = discrete_count (TYPE_DOMAIN (array_type));
- tree min_val = convert (long_integer_type_node,
- TYPE_MIN_VALUE (TYPE_DOMAIN (array_type)));
- tree fcall;
-
- /* FIXME: Function-call not needed if pos and width are constant! */
- /* TODO: make sure this makes sense. */
- if (! mark_addressable (array))
- {
- error ("array is not addressable");
- return const0_rtx;
- }
- fcall =
- build_chill_function_call (
- lookup_name (get_identifier ("__inpowerset")),
- tree_cons (NULL_TREE,
- convert (long_unsigned_type_node, pos),
- tree_cons (NULL_TREE,
- build1 (ADDR_EXPR, build_pointer_type (array_type), array),
- tree_cons (NULL_TREE,
- convert (long_unsigned_type_node, array_length),
- build_tree_list (NULL_TREE, min_val)))));
- return expand_expr (fcall, NULL_RTX, VOIDmode, 0);
- }
-
- case UNDEFINED_EXPR:
- if (target == 0)
- {
- target = assign_stack_temp (TYPE_MODE (TREE_TYPE (exp)),
- int_size_in_bytes (TREE_TYPE (exp)), 0);
- preserve_temp_slots (target);
- }
- /* We don't actually need to *do* anything ... */
- return target;
-
- default:
- break;
- }
-
- /* NOTREACHED */
- return NULL;
-}
-
-/* Check that the argument list has a length in [min_length .. max_length].
- (max_length == -1 means "infinite".)
- If so return the actual length.
- Otherwise, return an error message and return -1. */
-
-static int
-check_arglist_length (args, min_length, max_length, name)
- tree args;
- int min_length;
- int max_length;
- tree name;
-{
- int length = list_length (args);
- if (length < min_length)
- error ("Too few arguments in call to `%s'", IDENTIFIER_POINTER (name));
- else if (max_length != -1 && length > max_length)
- error ("Too many arguments in call to `%s'", IDENTIFIER_POINTER (name));
- else
- return length;
- return -1;
-}
-
-/*
- * This is the code from c-typeck.c, with the C-specific cruft
- * removed (possibly I just didn't understand it, but it was
- * apparently simply discarding part of my LIST).
- */
-static tree
-internal_build_compound_expr (list, first_p)
- tree list;
- int first_p ATTRIBUTE_UNUSED;
-{
- register tree rest;
-
- if (TREE_CHAIN (list) == 0)
- return TREE_VALUE (list);
-
- rest = internal_build_compound_expr (TREE_CHAIN (list), FALSE);
-
- if (! TREE_SIDE_EFFECTS (TREE_VALUE (list)))
- return rest;
-
- return build (COMPOUND_EXPR, TREE_TYPE (rest), TREE_VALUE (list), rest);
-}
-
-
-/* Given a list of expressions, return a compound expression
- that performs them all and returns the value of the last of them. */
-/* FIXME: this should be merged with the C version */
-tree
-build_chill_compound_expr (list)
- tree list;
-{
- return internal_build_compound_expr (list, TRUE);
-}
-
-/* Given an expression PTR for a pointer, return an expression
- for the value pointed to.
- do_empty_check is 0, don't perform a NULL pointer check,
- else do it. */
-
-tree
-build_chill_indirect_ref (ptr, mode, do_empty_check)
- tree ptr;
- tree mode;
- int do_empty_check;
-{
- register tree type;
-
- if (ptr == NULL_TREE || TREE_CODE (ptr) == ERROR_MARK)
- return ptr;
- if (mode != NULL_TREE && TREE_CODE (mode) == ERROR_MARK)
- return error_mark_node;
-
- type = TREE_TYPE (ptr);
-
- if (TREE_CODE (type) == REFERENCE_TYPE)
- {
- type = TREE_TYPE (type);
- ptr = convert (type, ptr);
- }
-
- /* check for ptr is really a POINTER */
- if (TREE_CODE (type) != POINTER_TYPE)
- {
- error ("cannot dereference, not a pointer.");
- return error_mark_node;
- }
-
- if (mode && TREE_CODE (mode) == IDENTIFIER_NODE)
- {
- tree decl = lookup_name (mode);
- if (decl == NULL_TREE || TREE_CODE (decl) != TYPE_DECL)
- {
- if (pass == 2)
- error ("missing '.' operator or undefined mode name `%s'.",
- IDENTIFIER_POINTER (mode));
-#if 0
- error ("You have forgotten the '.' operator which must");
- error (" precede a STRUCT field reference, or `%s' is an undefined mode",
- IDENTIFIER_POINTER (mode));
-#endif
- return error_mark_node;
- }
- }
-
- if (mode)
- {
- mode = get_type_of (mode);
- ptr = convert (build_pointer_type (mode), ptr);
- }
- else if (type == ptr_type_node)
- {
- error ("Can't dereference PTR value using unary `->'.");
- return error_mark_node;
- }
-
- if (do_empty_check)
- ptr = check_non_null (ptr);
-
- type = TREE_TYPE (ptr);
-
- if (TREE_CODE (type) == POINTER_TYPE)
- {
- if (TREE_CODE (ptr) == ADDR_EXPR
- && !flag_volatile
- && (TREE_TYPE (TREE_OPERAND (ptr, 0))
- == TREE_TYPE (type)))
- return TREE_OPERAND (ptr, 0);
- else
- {
- tree t = TREE_TYPE (type);
- register tree ref = build1 (INDIRECT_REF,
- TYPE_MAIN_VARIANT (t), ptr);
-
- if (TYPE_SIZE (t) == 0 && TREE_CODE (t) != ARRAY_TYPE)
- {
- error ("dereferencing pointer to incomplete type");
- return error_mark_node;
- }
- if (TREE_CODE (t) == VOID_TYPE)
- warning ("dereferencing `void *' pointer");
-
- /* We *must* set TREE_READONLY when dereferencing a pointer to const,
- so that we get the proper error message if the result is used
- to assign to. Also, &* is supposed to be a no-op.
- And ANSI C seems to specify that the type of the result
- should be the const type. */
- /* A de-reference of a pointer to const is not a const. It is valid
- to change it via some other pointer. */
- TREE_READONLY (ref) = TYPE_READONLY (t);
- TREE_SIDE_EFFECTS (ref)
- = TYPE_VOLATILE (t) || TREE_SIDE_EFFECTS (ptr) || flag_volatile;
- TREE_THIS_VOLATILE (ref) = TYPE_VOLATILE (t) || flag_volatile;
- return ref;
- }
- }
- else if (TREE_CODE (ptr) != ERROR_MARK)
- error ("invalid type argument of `->'");
- return error_mark_node;
-}
-
-/* NODE is a COMPONENT_REF whose mode is an IDENTIFIER,
- which is replaced by the proper FIELD_DECL.
- Also do the right thing for variant records. */
-
-tree
-resolve_component_ref (node)
- tree node;
-{
- tree datum = TREE_OPERAND (node, 0);
- tree field_name = TREE_OPERAND (node, 1);
- tree type = TREE_TYPE (datum);
- tree field;
- if (TREE_CODE (datum) == ERROR_MARK)
- return error_mark_node;
- if (TREE_CODE (type) == REFERENCE_TYPE)
- {
- type = TREE_TYPE (type);
- TREE_OPERAND (node, 0) = datum = convert (type, datum);
- }
- if (TREE_CODE (type) != RECORD_TYPE)
- {
- error ("operand of '.' is not a STRUCT");
- return error_mark_node;
- }
-
- TREE_READONLY (node) = TREE_READONLY (datum);
- TREE_SIDE_EFFECTS (node) = TREE_SIDE_EFFECTS (datum);
-
- for (field = TYPE_FIELDS (type); field; field = TREE_CHAIN (field))
- {
- if (TREE_CODE (TREE_TYPE (field)) == UNION_TYPE)
- {
- tree variant;
- for (variant = TYPE_FIELDS (TREE_TYPE (field));
- variant; variant = TREE_CHAIN (variant))
- {
- tree vfield;
- for (vfield = TYPE_FIELDS (TREE_TYPE (variant));
- vfield; vfield = TREE_CHAIN (vfield))
- {
- if (DECL_NAME (vfield) == field_name)
- { /* Found a variant field */
- datum = build (COMPONENT_REF, TREE_TYPE (field),
- datum, field);
- datum = build (COMPONENT_REF, TREE_TYPE (variant),
- datum, variant);
- TREE_OPERAND (node, 0) = datum;
- TREE_OPERAND (node, 1) = vfield;
- TREE_TYPE (node) = TREE_TYPE (vfield);
- TREE_READONLY (node) |= TYPE_READONLY (TREE_TYPE (node));
-#if 0
- if (flag_testing_tags)
- {
- tree tagtest = NOT IMPLEMENTED;
- tree tagf = ridpointers[(int) RID_RANGEFAIL];
- node = check_expression (node, tagtest,
- tagf);
- }
-#endif
- return node;
- }
- }
- }
- }
-
- if (DECL_NAME (field) == field_name)
- { /* Found a fixed field */
- TREE_OPERAND (node, 1) = field;
- TREE_TYPE (node) = TREE_TYPE (field);
- TREE_READONLY (node) |= TYPE_READONLY (TREE_TYPE (node));
- return fold (node);
- }
- }
-
- error ("No field named `%s'", IDENTIFIER_POINTER (field_name));
- return error_mark_node;
-}
-
-tree
-build_component_ref (datum, field_name)
- tree datum, field_name;
-{
- tree node = build_nt (COMPONENT_REF, datum, field_name);
- if (pass != 1)
- node = resolve_component_ref (node);
- return node;
-}
-
-/*
- function checks (for build_chill_component_ref) if a given
- type is really an instance type. CH_IS_INSTANCE_MODE is not
- strict enough in this case, i.e. SYNMODE foo = STRUCT (a, b UINT)
- is compatible to INSTANCE. */
-
-static int
-is_really_instance (type)
- tree type;
-{
- tree decl = TYPE_NAME (type);
-
- if (decl == NULL_TREE)
- /* this is not an instance */
- return 0;
-
- if (DECL_NAME (decl) == ridpointers[(int)RID_INSTANCE])
- /* this is an instance */
- return 1;
-
- if (TYPE_FIELDS (type) == TYPE_FIELDS (instance_type_node))
- /* we have a NEWMODE'd instance */
- return 1;
-
- return 0;
-}
-
-/* This function is called by the parse.
- Here we check if the user tries to access a field in a type which is
- layouted as a structure but isn't like INSTANCE, BUFFER, EVENT, ASSOCIATION,
- ACCESS, TEXT, or VARYING array or character string.
- We don't do this in build_component_ref cause this function gets
- called from the compiler to access fields in one of the above mentioned
- modes. */
-tree
-build_chill_component_ref (datum, field_name)
- tree datum, field_name;
-{
- tree type = TREE_TYPE (datum);
- if ((type != NULL_TREE && TREE_CODE (type) == RECORD_TYPE) &&
- ((CH_IS_INSTANCE_MODE (type) && is_really_instance (type)) ||
- CH_IS_BUFFER_MODE (type) ||
- CH_IS_EVENT_MODE (type) || CH_IS_ASSOCIATION_MODE (type) ||
- CH_IS_ACCESS_MODE (type) || CH_IS_TEXT_MODE (type) ||
- chill_varying_type_p (type)))
- {
- error ("operand of '.' is not a STRUCT");
- return error_mark_node;
- }
- return build_component_ref (datum, field_name);
-}
-
-/*
- * Check for invalid binary operands & unary operands
- * RIGHT is 1 if checking right operand or unary operand;
- * it is 0 if checking left operand.
- *
- * return 1 if the given operand is NOT compatible as the
- * operand of the given operator
- *
- * return 0 if they might be compatible
- */
-static int
-invalid_operand (code, type, right)
- enum chill_tree_code code;
- tree type;
- int right; /* 1 if right operand */
-{
- switch ((int)code)
- {
- case ADDR_EXPR:
- break;
- case BIT_AND_EXPR:
- case BIT_IOR_EXPR:
- case BIT_NOT_EXPR:
- case BIT_XOR_EXPR:
- goto relationals;
- case CASE_EXPR:
- break;
- case CEIL_MOD_EXPR:
- goto numerics;
- case CONCAT_EXPR: /* must be static or varying char array */
- if (TREE_CODE (type) == CHAR_TYPE)
- return 0;
- if (TREE_CODE (type) == ARRAY_TYPE
- && TREE_CODE (TREE_TYPE (type)) == CHAR_TYPE)
- return 0;
- if (!chill_varying_type_p (type))
- return 1;
- if (TREE_CODE (TREE_TYPE (CH_VARYING_ARRAY_TYPE (type)))
- == CHAR_TYPE)
- return 0;
- else
- return 1;
- /* note: CHILL conditional expressions (COND_EXPR) won't come
- * through here; they're routed straight to C-specific code */
- case EQ_EXPR:
- return 0; /* ANYTHING can be compared equal */
- case FLOOR_MOD_EXPR:
- if (TREE_CODE (type) == REAL_TYPE)
- return 1;
- goto numerics;
- case GE_EXPR:
- case GT_EXPR:
- goto relatables;
- case SET_IN_EXPR:
- if (TREE_CODE (type) == SET_TYPE)
- return 0;
- else
- return 1;
- case PACKED_ARRAY_REF:
- if (TREE_CODE (type) == ARRAY_TYPE)
- return 0;
- else
- return 1;
- case LE_EXPR:
- case LT_EXPR:
- relatables:
- switch ((int)TREE_CODE(type)) /* right operand must be set/bitarray type */
- {
- case ARRAY_TYPE:
- if (TREE_CODE (TREE_TYPE (type)) == CHAR_TYPE)
- return 0;
- else
- return 1;
- case BOOLEAN_TYPE:
- case CHAR_TYPE:
- case COMPLEX_TYPE:
- case ENUMERAL_TYPE:
- case INTEGER_TYPE:
- case OFFSET_TYPE:
- case POINTER_TYPE:
- case REAL_TYPE:
- case SET_TYPE:
- return 0;
- case FILE_TYPE:
- case FUNCTION_TYPE:
- case GRANT_TYPE:
- case LANG_TYPE:
- case METHOD_TYPE:
- return 1;
- case RECORD_TYPE:
- if (chill_varying_type_p (type)
- && TREE_CODE (TREE_TYPE (CH_VARYING_ARRAY_TYPE (type))) == CHAR_TYPE)
- return 0;
- else
- return 1;
- case REFERENCE_TYPE:
- case SEIZE_TYPE:
- case UNION_TYPE:
- case VOID_TYPE:
- return 1;
- }
- break;
- case MINUS_EXPR:
- case MULT_EXPR:
- goto numerics;
- case NEGATE_EXPR:
- if (TREE_CODE (type) == BOOLEAN_TYPE)
- return 0;
- else
- goto numerics;
- case NE_EXPR:
- return 0; /* ANYTHING can be compared unequal */
- case NOP_EXPR:
- return 0; /* ANYTHING can be converted */
- case PLUS_EXPR:
- numerics:
- switch ((int)TREE_CODE(type)) /* left operand must be discrete type */
- {
- case ARRAY_TYPE:
- if (right || TREE_CODE (TREE_TYPE (type)) != BOOLEAN_TYPE)
- return 1;
- else
- return 0;
- case CHAR_TYPE:
- return right;
- case BOOLEAN_TYPE:
- case COMPLEX_TYPE:
- case FILE_TYPE:
- case FUNCTION_TYPE:
- case GRANT_TYPE:
- case LANG_TYPE:
- case METHOD_TYPE:
- case RECORD_TYPE:
- case REFERENCE_TYPE:
- case SEIZE_TYPE:
- case UNION_TYPE:
- case VOID_TYPE:
- return 1;
- case ENUMERAL_TYPE:
- case INTEGER_TYPE:
- case OFFSET_TYPE:
- case POINTER_TYPE:
- case REAL_TYPE:
- case SET_TYPE:
- return 0;
- }
- break;
- case RANGE_EXPR:
- break;
-
- case REPLICATE_EXPR:
- switch ((int)TREE_CODE(type)) /* right operand must be set/bitarray type */
- {
- case COMPLEX_TYPE:
- case FILE_TYPE:
- case FUNCTION_TYPE:
- case GRANT_TYPE:
- case LANG_TYPE:
- case METHOD_TYPE:
- case OFFSET_TYPE:
- case POINTER_TYPE:
- case RECORD_TYPE:
- case REAL_TYPE:
- case SEIZE_TYPE:
- case UNION_TYPE:
- case VOID_TYPE:
- return 1;
- case ARRAY_TYPE:
- case BOOLEAN_TYPE:
- case CHAR_TYPE:
- case ENUMERAL_TYPE:
- case INTEGER_TYPE:
- case REFERENCE_TYPE:
- case SET_TYPE:
- return 0;
- }
-
- case TRUNC_DIV_EXPR:
- goto numerics;
- case TRUNC_MOD_EXPR:
- if (TREE_CODE (type) == REAL_TYPE)
- return 1;
- goto numerics;
- case TRUTH_ANDIF_EXPR:
- case TRUTH_AND_EXPR:
- case TRUTH_NOT_EXPR:
- case TRUTH_ORIF_EXPR:
- case TRUTH_OR_EXPR:
- relationals:
- switch ((int)TREE_CODE(type)) /* left operand must be discrete type */
- {
- case ARRAY_TYPE:
- case CHAR_TYPE:
- case COMPLEX_TYPE:
- case ENUMERAL_TYPE:
- case FILE_TYPE:
- case FUNCTION_TYPE:
- case GRANT_TYPE:
- case INTEGER_TYPE:
- case LANG_TYPE:
- case METHOD_TYPE:
- case OFFSET_TYPE:
- case POINTER_TYPE:
- case REAL_TYPE:
- case RECORD_TYPE:
- case REFERENCE_TYPE:
- case SEIZE_TYPE:
- case UNION_TYPE:
- case VOID_TYPE:
- return 1;
- case BOOLEAN_TYPE:
- case SET_TYPE:
- return 0;
- }
- break;
-
- default:
- return 1; /* perhaps you forgot to add a new DEFTREECODE? */
- }
- return 1;
-}
-
-
-static int
-invalid_right_operand (code, type)
- enum chill_tree_code code;
- tree type;
-{
- return invalid_operand (code, type, 1);
-}
-
-tree
-build_chill_abs (expr)
- tree expr;
-{
- tree temp;
-
- if (TREE_CODE (TREE_TYPE (expr)) == REAL_TYPE
- || discrete_type_p (TREE_TYPE (expr)))
- temp = fold (build1 (ABS_EXPR, TREE_TYPE (expr), expr));
- else
- {
- error("ABS argument must be discrete or real mode");
- return error_mark_node;
- }
- /* FIXME: should call
- * cond_type_range_exception (temp);
- */
- return temp;
-}
-
-static tree
-build_chill_abstime (exprlist)
- tree exprlist;
-{
- int mask = 0, i, numargs;
- tree args = NULL_TREE;
- tree filename, lineno;
- int had_errors = 0;
- tree tmp;
-
- if (exprlist != NULL_TREE && TREE_CODE (exprlist) == ERROR_MARK)
- return error_mark_node;
-
- /* check for integer expressions */
- i = 1;
- tmp = exprlist;
- while (tmp != NULL_TREE)
- {
- tree exp = TREE_VALUE (tmp);
-
- if (exp == NULL_TREE || TREE_CODE (exp) == ERROR_MARK)
- had_errors = 1;
- else if (TREE_CODE (TREE_TYPE (exp)) != INTEGER_TYPE)
- {
- error ("argument %d to ABSTIME must be of integer type.", i);
- had_errors = 1;
- }
- tmp = TREE_CHAIN (tmp);
- i++;
- }
- if (had_errors)
- return error_mark_node;
-
- numargs = list_length (exprlist);
- for (i = 0; i < numargs; i++)
- mask |= (1 << i);
-
- /* make it all arguments */
- for (i = numargs; i < 6; i++)
- exprlist = tree_cons (NULL_TREE, integer_zero_node, exprlist);
-
- args = tree_cons (NULL_TREE, build_int_2 (mask, 0), exprlist);
-
- filename = force_addr_of (get_chill_filename ());
- lineno = get_chill_linenumber ();
- args = chainon (args, tree_cons (NULL_TREE, filename,
- tree_cons (NULL_TREE, lineno, NULL_TREE)));
-
- return build_chill_function_call (
- lookup_name (get_identifier ("_abstime")), args);
-}
-
-
-static tree
-build_allocate_memory_call (ptr, size)
- tree ptr, size;
-{
- int err = 0;
-
- /* check for ptr is referable */
- if (! CH_REFERABLE (ptr))
- {
- error ("parameter 1 must be referable.");
- err++;
- }
- /* check for pointer */
- else if (TREE_CODE (TREE_TYPE (ptr)) != POINTER_TYPE)
- {
- error ("mode mismatch in parameter 1.");
- err++;
- }
-
- /* check for size > 0 if it is a constant */
- if (TREE_CODE (size) == INTEGER_CST && TREE_INT_CST_LOW (size) <= 0)
- {
- error ("parameter 2 must be a positive integer.");
- err++;
- }
- if (err)
- return error_mark_node;
-
- if (TREE_TYPE (ptr) != ptr_type_node)
- ptr = build_chill_cast (ptr_type_node, ptr);
-
- return build_chill_function_call (
- lookup_name (get_identifier ("_allocate_memory")),
- tree_cons (NULL_TREE, ptr,
- tree_cons (NULL_TREE, size,
- tree_cons (NULL_TREE, force_addr_of (get_chill_filename ()),
- tree_cons (NULL_TREE, get_chill_linenumber (),
- NULL_TREE)))));
-}
-
-
-static tree
-build_allocate_global_memory_call (ptr, size)
- tree ptr, size;
-{
- int err = 0;
-
- /* check for ptr is referable */
- if (! CH_REFERABLE (ptr))
- {
- error ("parameter 1 must be referable.");
- err++;
- }
- /* check for pointer */
- else if (TREE_CODE (TREE_TYPE (ptr)) != POINTER_TYPE)
- {
- error ("mode mismatch in parameter 1.");
- err++;
- }
-
- /* check for size > 0 if it is a constant */
- if (TREE_CODE (size) == INTEGER_CST && TREE_INT_CST_LOW (size) <= 0)
- {
- error ("parameter 2 must be a positive integer.");
- err++;
- }
- if (err)
- return error_mark_node;
-
- if (TREE_TYPE (ptr) != ptr_type_node)
- ptr = build_chill_cast (ptr_type_node, ptr);
-
- return build_chill_function_call (
- lookup_name (get_identifier ("_allocate_global_memory")),
- tree_cons (NULL_TREE, ptr,
- tree_cons (NULL_TREE, size,
- tree_cons (NULL_TREE, force_addr_of (get_chill_filename ()),
- tree_cons (NULL_TREE, get_chill_linenumber (),
- NULL_TREE)))));
-}
-
-
-static tree
-build_return_memory (ptr)
- tree ptr;
-{
- /* check input */
- if (ptr == NULL_TREE || TREE_CODE (ptr) == ERROR_MARK)
- return error_mark_node;
-
- /* check for pointer */
- if (TREE_CODE (TREE_TYPE (ptr)) != POINTER_TYPE)
- {
- error ("mode mismatch in parameter 1.");
- return error_mark_node;
- }
-
- if (TREE_TYPE (ptr) != ptr_type_node)
- ptr = build_chill_cast (ptr_type_node, ptr);
-
- return build_chill_function_call (
- lookup_name (get_identifier ("_return_memory")),
- tree_cons (NULL_TREE, ptr,
- tree_cons (NULL_TREE, force_addr_of (get_chill_filename ()),
- tree_cons (NULL_TREE, get_chill_linenumber (),
- NULL_TREE))));
-}
-
-
-/* Compute the number of runtime members of the
- * given powerset.
- */
-tree
-build_chill_card (powerset)
- tree powerset;
-{
- if (pass == 2)
- {
- tree temp;
- tree card_func = lookup_name (get_identifier ("__cardpowerset"));
-
- if (powerset == NULL_TREE || TREE_CODE (powerset) == ERROR_MARK)
- return error_mark_node;
-
- if (TREE_CODE (powerset) == IDENTIFIER_NODE)
- powerset = lookup_name (powerset);
-
- if (TREE_CODE (TREE_TYPE(powerset)) == SET_TYPE)
- { int size;
-
- /* Do constant folding, if possible. */
- if (TREE_CODE (powerset) == CONSTRUCTOR
- && TREE_CONSTANT (powerset)
- && (size = int_size_in_bytes (TREE_TYPE (powerset))) >= 0)
- {
- int bit_size = size * BITS_PER_UNIT;
- char* buffer = (char*) alloca (bit_size);
- temp = get_set_constructor_bits (powerset, buffer, bit_size);
- if (!temp)
- { int i;
- int count = 0;
- for (i = 0; i < bit_size; i++)
- if (buffer[i])
- count++;
- temp = build_int_2 (count, 0);
- TREE_TYPE (temp) = TREE_TYPE (TREE_TYPE (card_func));
- return temp;
- }
- }
- temp = build_chill_function_call (card_func,
- tree_cons (NULL_TREE, force_addr_of (powerset),
- tree_cons (NULL_TREE, powersetlen (powerset), NULL_TREE)));
- /* FIXME: should call
- * cond_type_range_exception (op0);
- */
- return temp;
- }
- error("CARD argument must be powerset mode");
- return error_mark_node;
- }
- return NULL_TREE;
-}
-
-/* function to build the type needed for the DESCR-built-in
- */
-
-void build_chill_descr_type ()
-{
- tree decl1, decl2;
-
- if (descr_type != NULL_TREE)
- /* already done */
- return;
-
- decl1 = build_decl (FIELD_DECL, get_identifier ("datap"), ptr_type_node);
- decl2 = build_decl (FIELD_DECL, get_identifier ("len"),
- TREE_TYPE (lookup_name (
- get_identifier ((ignore_case || ! special_UC) ? "ulong" : "ULONG"))));
- TREE_CHAIN (decl1) = decl2;
- TREE_CHAIN (decl2) = NULL_TREE;
- decl2 = build_chill_struct_type (decl1);
- descr_type = build_decl (TYPE_DECL, get_identifier ("__tmp_DESCR_type"), decl2);
- pushdecl (descr_type);
- DECL_SOURCE_LINE (descr_type) = 0;
- satisfy_decl (descr_type, 0);
-}
-
-/* build a pointer to a descriptor.
- * descriptor = STRUCT (datap PTR,
- * len ULONG);
- * This descriptor is build in variable descr_type.
- */
-
-tree
-build_chill_descr (expr)
- tree expr;
-{
- if (pass == 2)
- {
- tree tuple, decl, descr_var, datap, len, tmp;
- int is_static;
-
- if (expr == NULL_TREE || TREE_CODE (expr) == ERROR_MARK)
- return error_mark_node;
-
- /* check for expression is referable */
- if (! CH_REFERABLE (expr))
- {
- error ("expression for DESCR-builtin must be referable.");
- return error_mark_node;
- }
-
- mark_addressable (expr);
-#if 0
- datap = build1 (ADDR_EXPR, build_chill_pointer_type (descr_type), expr);
-#else
- datap = build_chill_arrow_expr (expr, 1);
-#endif
- len = size_in_bytes (TREE_TYPE (expr));
-
- descr_var = get_unique_identifier ("DESCR");
- tuple = build_nt (CONSTRUCTOR, NULL_TREE,
- tree_cons (NULL_TREE, datap,
- tree_cons (NULL_TREE, len, NULL_TREE)));
-
- is_static = (current_function_decl == global_function_decl) && TREE_STATIC (expr);
- decl = decl_temp1 (descr_var, TREE_TYPE (descr_type), is_static,
- tuple, 0, 0);
-#if 0
- tmp = force_addr_of (decl);
-#else
- tmp = build_chill_arrow_expr (decl, 1);
-#endif
- return tmp;
- }
- return NULL_TREE;
-}
-
-/* this function process the builtin's
- MILLISECS, SECS, MINUTES, HOURS and DAYS.
- The built duration value is in milliseconds. */
-
-static tree
-build_chill_duration (expr, multiplier, fnname, maxvalue)
- tree expr;
- unsigned long multiplier;
- tree fnname;
- unsigned long maxvalue;
-{
- tree temp;
-
- if (expr == NULL_TREE || TREE_CODE (expr) == ERROR_MARK)
- return error_mark_node;
-
- if (TREE_CODE (TREE_TYPE (expr)) != INTEGER_TYPE)
- {
- error ("argument to `%s' must be of integer type.", IDENTIFIER_POINTER (fnname));
- return error_mark_node;
- }
-
- temp = convert (duration_timing_type_node, expr);
- temp = fold (build (MULT_EXPR, duration_timing_type_node,
- temp, build_int_2 (multiplier, 0)));
-
- if (range_checking)
- temp = check_range (temp, expr, integer_zero_node, build_int_2 (maxvalue, 0));
-
- return temp;
-}
-
-/* build function call to one of the floating point functions */
-static tree
-build_chill_floatcall (expr, chillname, funcname)
- tree expr;
- const char *chillname;
- const char *funcname;
-{
- tree result;
- tree type;
-
- if (expr == NULL_TREE || TREE_CODE (expr) == ERROR_MARK)
- return error_mark_node;
-
- /* look if expr is a REAL_TYPE */
- type = TREE_TYPE (expr);
- if (type == NULL_TREE || TREE_CODE (type) == ERROR_MARK)
- return error_mark_node;
- if (TREE_CODE (type) != REAL_TYPE)
- {
- error ("argument 1 to `%s' must be of floating point mode", chillname);
- return error_mark_node;
- }
- result = build_chill_function_call (
- lookup_name (get_identifier (funcname)),
- tree_cons (NULL_TREE, expr, NULL_TREE));
- return result;
-}
-
-/* common function for ALLOCATE and GETSTACK */
-static tree
-build_allocate_getstack (mode, value, chill_name, fnname, filename, linenumber)
- tree mode;
- tree value;
- const char *chill_name;
- const char *fnname;
- tree filename;
- tree linenumber;
-{
- tree type, result;
- tree expr = NULL_TREE;
- tree args, tmpvar, fncall, ptr, outlist = NULL_TREE;
-
- if (mode == NULL_TREE || TREE_CODE (mode) == ERROR_MARK)
- return error_mark_node;
-
- if (TREE_CODE (mode) == TYPE_DECL)
- type = TREE_TYPE (mode);
- else
- type = mode;
-
- /* check if we have a mode */
- if (TREE_CODE_CLASS (TREE_CODE (type)) != 't')
- {
- error ("First argument to `%s' must be a mode", chill_name);
- return error_mark_node;
- }
-
- /* check if we have a value if type is READonly */
- if (TYPE_READONLY_PROPERTY (type) && value == NULL_TREE)
- {
- error ("READonly modes for %s must have a value", chill_name);
- return error_mark_node;
- }
-
- if (value != NULL_TREE)
- {
- if (TREE_CODE (value) == ERROR_MARK)
- return error_mark_node;
- expr = chill_convert_for_assignment (type, value, "assignment");
- }
-
- /* build function arguments */
- if (filename == NULL_TREE)
- args = tree_cons (NULL_TREE, size_in_bytes (type), NULL_TREE);
- else
- args = tree_cons (NULL_TREE, size_in_bytes (type),
- tree_cons (NULL_TREE, force_addr_of (filename),
- tree_cons (NULL_TREE, linenumber, NULL_TREE)));
-
- ptr = build_chill_pointer_type (type);
- tmpvar = decl_temp1 (get_unique_identifier (chill_name),
- ptr, 0, NULL_TREE, 0, 0);
- fncall = build_chill_function_call (
- lookup_name (get_identifier (fnname)), args);
- outlist = tree_cons (NULL_TREE,
- build_chill_modify_expr (tmpvar, fncall), outlist);
- if (expr == NULL_TREE)
- {
- /* set allocated memory to 0 */
- fncall = build_chill_function_call (
- lookup_name (get_identifier ("memset")),
- tree_cons (NULL_TREE, convert (ptr_type_node, tmpvar),
- tree_cons (NULL_TREE, integer_zero_node,
- tree_cons (NULL_TREE, size_in_bytes (type), NULL_TREE))));
- outlist = tree_cons (NULL_TREE, fncall, outlist);
- }
- else
- {
- /* write the init value to allocated memory */
- outlist = tree_cons (NULL_TREE,
- build_chill_modify_expr (build_chill_indirect_ref (tmpvar, NULL_TREE, 0),
- expr),
- outlist);
- }
- outlist = tree_cons (NULL_TREE, tmpvar, outlist);
- result = build_chill_compound_expr (nreverse (outlist));
- return result;
-}
-
-/* process the ALLOCATE built-in */
-static tree
-build_chill_allocate (mode, value)
- tree mode;
- tree value;
-{
- return build_allocate_getstack (mode, value, "ALLOCATE", "__allocate",
- get_chill_filename (), get_chill_linenumber ());
-}
-
-/* process the GETSTACK built-in */
-static tree
-build_chill_getstack (mode, value)
- tree mode;
- tree value;
-{
- return build_allocate_getstack (mode, value, "GETSTACK", "__builtin_alloca",
- NULL_TREE, NULL_TREE);
-}
-
-/* process the TERMINATE built-in */
-static tree
-build_chill_terminate (ptr)
- tree ptr;
-{
- tree result;
- tree type;
-
- if (ptr == NULL_TREE || TREE_CODE (ptr) == ERROR_MARK)
- return error_mark_node;
-
- type = TREE_TYPE (ptr);
- if (type == NULL_TREE || TREE_CODE (type) != POINTER_TYPE)
- {
- error ("argument to TERMINATE must be a reference primitive value");
- return error_mark_node;
- }
- result = build_chill_function_call (
- lookup_name (get_identifier ("__terminate")),
- tree_cons (NULL_TREE, convert (ptr_type_node, ptr),
- tree_cons (NULL_TREE, force_addr_of (get_chill_filename ()),
- tree_cons (NULL_TREE, get_chill_linenumber (), NULL_TREE))));
- return result;
-}
-
-/* build the type passed to _inttime function */
-void
-build_chill_inttime_type ()
-{
- tree idxlist;
- tree arrtype;
- tree decl;
-
- idxlist = build_tree_list (NULL_TREE,
- build_chill_range_type (NULL_TREE,
- integer_zero_node,
- build_int_2 (5, 0)));
- arrtype = build_chill_array_type (ptr_type_node, idxlist, 0, NULL_TREE);
-
- decl = build_decl (TYPE_DECL, get_identifier ("__tmp_INTTIME_type"), arrtype);
- pushdecl (decl);
- DECL_SOURCE_LINE (decl) = 0;
- satisfy_decl (decl, 0);
-}
-
-static tree
-build_chill_inttime (t, loclist)
- tree t, loclist;
-{
- int had_errors = 0, cnt;
- tree tmp;
- tree init = NULL_TREE;
- int numargs;
- tree tuple, var;
-
- if (t == NULL_TREE || TREE_CODE (t) == ERROR_MARK)
- return error_mark_node;
- if (loclist == NULL_TREE || TREE_CODE (loclist) == ERROR_MARK)
- return error_mark_node;
-
- /* check first argument to be NEWMODE TIME */
- if (TREE_TYPE (t) != abs_timing_type_node)
- {
- error ("argument 1 to INTTIME must be of mode TIME.");
- had_errors = 1;
- }
-
- cnt = 2;
- tmp = loclist;
- while (tmp != NULL_TREE)
- {
- tree loc = TREE_VALUE (tmp);
- char errmsg[200];
- char *p, *p1;
- int write_error = 0;
-
- sprintf (errmsg, "argument %d to INTTIME must be ", cnt);
- p = errmsg + strlen (errmsg);
- p1 = p;
-
- if (loc == NULL_TREE || TREE_CODE (loc) == ERROR_MARK)
- had_errors = 1;
- else
- {
- if (! CH_REFERABLE (loc))
- {
- strcpy (p, "referable");
- p += strlen (p);
- write_error = 1;
- had_errors = 1;
- }
- if (TREE_CODE (TREE_TYPE (loc)) != INTEGER_TYPE)
- {
- if (p != p1)
- {
- strcpy (p, " and ");
- p += strlen (p);
- }
- strcpy (p, "of integer type");
- write_error = 1;
- had_errors = 1;
- }
- /* FIXME: what's about ranges can't hold the result ?? */
- if (write_error)
- error ("%s.", errmsg);
- }
- /* next location */
- tmp = TREE_CHAIN (tmp);
- cnt++;
- }
-
- if (had_errors)
- return error_mark_node;
-
- /* make it always 6 arguments */
- numargs = list_length (loclist);
- for (cnt = numargs; cnt < 6; cnt++)
- init = tree_cons (NULL_TREE, null_pointer_node, init);
-
- /* append the given one's */
- tmp = loclist;
- while (tmp != NULL_TREE)
- {
- init = chainon (init,
- build_tree_list (NULL_TREE,
- build_chill_descr (TREE_VALUE (tmp))));
- tmp = TREE_CHAIN (tmp);
- }
-
- tuple = build_nt (CONSTRUCTOR, NULL_TREE, init);
- var = decl_temp1 (get_unique_identifier ("INTTIME"),
- TREE_TYPE (lookup_name (get_identifier ("__tmp_INTTIME_type"))),
- 0, tuple, 0, 0);
-
- return build_chill_function_call (
- lookup_name (get_identifier ("_inttime")),
- tree_cons (NULL_TREE, t,
- tree_cons (NULL_TREE, force_addr_of (var),
- NULL_TREE)));
-}
-
-
-/* Compute the runtime length of the given string variable
- * or expression.
- */
-tree
-build_chill_length (expr)
- tree expr;
-{
- if (pass == 2)
- {
- tree type;
-
- if (expr == NULL_TREE || TREE_CODE (expr) == ERROR_MARK)
- return error_mark_node;
-
- if (TREE_CODE (expr) == IDENTIFIER_NODE)
- expr = lookup_name (expr);
-
- type = TREE_TYPE (expr);
-
- if (TREE_CODE(type) == ERROR_MARK)
- return type;
- if (chill_varying_type_p (type))
- {
- tree temp = convert (integer_type_node,
- build_component_ref (expr, var_length_id));
- /* FIXME: should call
- * cond_type_range_exception (temp);
- */
- return temp;
- }
-
- if ((TREE_CODE (type) == ARRAY_TYPE ||
- /* should work for a bitstring too */
- (TREE_CODE (type) == SET_TYPE && TREE_CODE (TREE_TYPE (type)) == BOOLEAN_TYPE)) &&
- integer_zerop (TYPE_MIN_VALUE (TYPE_DOMAIN (type))))
- {
- tree temp = fold (build (PLUS_EXPR, chill_integer_type_node,
- integer_one_node,
- TYPE_MAX_VALUE (TYPE_DOMAIN (type))));
- return convert (chill_integer_type_node, temp);
- }
-
- if (CH_IS_BUFFER_MODE (type) || CH_IS_EVENT_MODE (type))
- {
- tree len = max_queue_size (type);
-
- if (len == NULL_TREE)
- len = integer_minus_one_node;
- return len;
- }
-
- if (CH_IS_TEXT_MODE (type))
- {
- if (TREE_CODE (expr) == TYPE_DECL)
- {
- /* text mode name */
- return text_length (type);
- }
- else
- {
- /* text location */
- tree temp = build_component_ref (
- build_component_ref (expr, get_identifier ("tloc")),
- var_length_id);
- return convert (integer_type_node, temp);
- }
- }
-
- error("LENGTH argument must be string, buffer, event mode, text location or mode");
- return error_mark_node;
- }
- return NULL_TREE;
-}
-
-/* Compute the declared minimum/maximum value of the variable,
- * expression or declared type
- */
-static tree
-build_chill_lower_or_upper (what, is_upper)
- tree what;
- int is_upper; /* o -> LOWER; 1 -> UPPER */
-{
- if (pass == 2)
- {
- tree type;
- struct ch_class class;
-
- if (what == NULL_TREE || TREE_CODE (what) == ERROR_MARK)
- return error_mark_node;
-
- if (TREE_CODE_CLASS (TREE_CODE (what)) == 't')
- type = what;
- else
- type = TREE_TYPE (what);
- if (type == NULL_TREE)
- {
- if (is_upper)
- error ("UPPER argument must have a mode, or be a mode");
- else
- error ("LOWER argument must have a mode, or be a mode");
- return error_mark_node;
- }
- while (TREE_CODE (type) == REFERENCE_TYPE)
- type = TREE_TYPE (type);
- if (chill_varying_type_p (type))
- type = CH_VARYING_ARRAY_TYPE (type);
-
- if (discrete_type_p (type))
- {
- tree val = is_upper ? TYPE_MAX_VALUE (type) : TYPE_MIN_VALUE (type);
- class.kind = CH_VALUE_CLASS;
- class.mode = type;
- return convert_to_class (class, val);
- }
- else if (TREE_CODE (type) == ARRAY_TYPE || TREE_CODE (type) == SET_TYPE)
- {
- if (TYPE_STRING_FLAG (type))
- {
- class.kind = CH_DERIVED_CLASS;
- class.mode = integer_type_node;
- }
- else
- {
- class.kind = CH_VALUE_CLASS;
- class.mode = TYPE_DOMAIN (type);
- }
- type = TYPE_DOMAIN (type);
- return convert_to_class (class,
- is_upper
- ? TYPE_MAX_VALUE (type)
- : TYPE_MIN_VALUE (type));
- }
- if (is_upper)
- error("UPPER argument must be string, array, mode or integer");
- else
- error("LOWER argument must be string, array, mode or integer");
- return error_mark_node;
- }
- return NULL_TREE;
-}
-
-tree
-build_chill_lower (what)
- tree what;
-{
- return build_chill_lower_or_upper (what, 0);
-}
-
-static tree
-build_max_min (expr, max_min)
- tree expr;
- int max_min; /* 0: calculate MIN; 1: calculate MAX */
-{
- if (pass == 2)
- {
- tree type, temp, setminval;
- tree set_base_type;
- int size_in_bytes;
-
- if (expr == NULL_TREE || TREE_CODE (expr) == ERROR_MARK)
- return error_mark_node;
-
- if (TREE_CODE (expr) == IDENTIFIER_NODE)
- expr = lookup_name (expr);
-
- type = TREE_TYPE (expr);
- set_base_type = TYPE_DOMAIN (type);
- setminval = TYPE_MIN_VALUE (set_base_type);
-
- if (TREE_CODE (type) != SET_TYPE)
- {
- error("%s argument must be POWERSET mode",
- max_min ? "MAX" : "MIN");
- return error_mark_node;
- }
-
- /* find max/min of constant powerset at compile time */
- if (TREE_CODE (expr) == CONSTRUCTOR && TREE_CONSTANT (expr)
- && (size_in_bytes = int_size_in_bytes (type)) >= 0)
- {
- HOST_WIDE_INT min_val = -1, max_val = -1;
- HOST_WIDE_INT i, i_hi = 0;
- HOST_WIDE_INT size_in_bits = size_in_bytes * BITS_PER_UNIT;
- char *buffer = (char*) alloca (size_in_bits);
- if (buffer == NULL
- || get_set_constructor_bits (expr, buffer, size_in_bits))
- abort ();
- for (i = 0; i < size_in_bits; i++)
- {
- if (buffer[i])
- {
- if (min_val < 0)
- min_val = i;
- max_val = i;
- }
- }
- if (min_val < 0)
- error ("%s called for empty POWERSET", max_min ? "MAX" : "MIN");
- i = max_min ? max_val : min_val;
- temp = TYPE_MIN_VALUE (TYPE_DOMAIN (TREE_TYPE (expr)));
- add_double (i, i_hi,
- TREE_INT_CST_LOW (temp), TREE_INT_CST_HIGH (temp),
- &i, &i_hi);
- temp = build_int_2 (i, i_hi);
- TREE_TYPE (temp) = set_base_type;
- return temp;
- }
- else
- {
- tree parmlist, filename, lineno;
- const char *funcname;
-
- /* set up to call appropriate runtime function */
- if (max_min)
- funcname = "__flsetpowerset";
- else
- funcname = "__ffsetpowerset";
-
- setminval = convert (long_integer_type_node, setminval);
- filename = force_addr_of (get_chill_filename());
- lineno = get_chill_linenumber();
- parmlist = tree_cons (NULL_TREE, force_addr_of (expr),
- tree_cons (NULL_TREE, powersetlen (expr),
- tree_cons (NULL_TREE, setminval,
- tree_cons (NULL_TREE, filename,
- build_tree_list (NULL_TREE, lineno)))));
- temp = lookup_name (get_identifier (funcname));
- temp = build_chill_function_call (temp, parmlist);
- TREE_TYPE (temp) = set_base_type;
- return temp;
- }
- }
- return NULL_TREE;
-}
-
-
-/* Compute the current runtime maximum value of the powerset
- */
-tree
-build_chill_max (expr)
- tree expr;
-{
- return build_max_min (expr, 1);
-}
-
-
-/* Compute the current runtime minimum value of the powerset
- */
-tree
-build_chill_min (expr)
- tree expr;
-{
- return build_max_min (expr, 0);
-}
-
-
-/* Build a conversion from the given expression to an INT,
- * but only when the expression's type is the same size as
- * an INT.
- */
-tree
-build_chill_num (expr)
- tree expr;
-{
- if (pass == 2)
- {
- tree temp;
- int need_unsigned;
-
- if (expr == NULL_TREE || TREE_CODE(expr) == ERROR_MARK)
- return error_mark_node;
-
- if (TREE_CODE (expr) == IDENTIFIER_NODE)
- expr = lookup_name (expr);
-
- expr = convert_to_discrete (expr);
- if (expr == NULL_TREE)
- {
- error ("argument to NUM is not discrete");
- return error_mark_node;
- }
-
- /* enumeral types and string slices of length 1 must be kept unsigned */
- need_unsigned = (TREE_CODE (TREE_TYPE (expr)) == ENUMERAL_TYPE)
- || TREE_UNSIGNED (TREE_TYPE (expr));
-
- temp = type_for_size (TYPE_PRECISION (TREE_TYPE (expr)),
- need_unsigned);
- if (temp == NULL_TREE)
- {
- error ("No integer mode which matches expression's mode");
- return integer_zero_node;
- }
- temp = convert (temp, expr);
-
- if (TREE_CONSTANT (temp))
- {
- if (tree_int_cst_lt (temp,
- TYPE_MIN_VALUE (TREE_TYPE (temp))))
- error ("NUM's parameter is below its mode range");
- if (tree_int_cst_lt (TYPE_MAX_VALUE (TREE_TYPE (temp)),
- temp))
- error ("NUM's parameter is above its mode range");
- }
-#if 0
- else
- {
- if (range_checking)
- cond_overflow_exception (temp,
- TYPE_MIN_VALUE (TREE_TYPE (temp)),
- TYPE_MAX_VALUE (TREE_TYPE (temp)));
- }
-#endif
-
- /* NUM delivers the INT derived class */
- CH_DERIVED_FLAG (temp) = 1;
-
- return temp;
- }
- return NULL_TREE;
-}
-
-
-static tree
-build_chill_pred_or_succ (expr, op)
- tree expr;
- enum tree_code op; /* PLUS_EXPR for SUCC; MINUS_EXPR for PRED. */
-{
- struct ch_class class;
- tree etype, cond;
-
- if (pass == 1)
- return NULL_TREE;
-
- if (expr == NULL_TREE || TREE_CODE (expr) == ERROR_MARK)
- return error_mark_node;
-
- /* disallow numbered SETs */
- if (TREE_CODE (TREE_TYPE (expr)) == ENUMERAL_TYPE
- && CH_ENUM_IS_NUMBERED (TREE_TYPE (expr)))
- {
- error ("Cannot take SUCC or PRED of a numbered SET");
- return error_mark_node;
- }
-
- if (TREE_CODE (TREE_TYPE (expr)) == POINTER_TYPE)
- {
- if (TREE_TYPE (TREE_TYPE (expr)) == void_type_node)
- {
- error ("SUCC or PRED must not be done on a PTR.");
- return error_mark_node;
- }
- pedwarn ("SUCC or PRED for a reference type is not standard.");
- return fold (build (op, TREE_TYPE (expr),
- expr,
- size_in_bytes (TREE_TYPE (TREE_TYPE (expr)))));
- }
-
- expr = convert_to_discrete (expr);
-
- if (expr == NULL_TREE)
- {
- error ("SUCC or PRED argument must be a discrete mode");
- return error_mark_node;
- }
-
- class = chill_expr_class (expr);
- if (class.mode)
- class.mode = CH_ROOT_MODE (class.mode);
- etype = class.mode;
- expr = convert (etype, expr);
-
- /* Exception if expression is already at the
- min (PRED)/max(SUCC) valid value for its type. */
- cond = fold (build (op == PLUS_EXPR ? GE_EXPR : LE_EXPR,
- boolean_type_node,
- expr,
- convert (etype,
- op == PLUS_EXPR ? TYPE_MAX_VALUE (etype)
- : TYPE_MIN_VALUE (etype))));
- if (TREE_CODE (cond) == INTEGER_CST
- && tree_int_cst_equal (cond, integer_one_node))
- {
- error ("Taking the %s of a value already at its %s value",
- op == PLUS_EXPR ? "SUCC" : "PRED",
- op == PLUS_EXPR ? "maximum" : "minimum");
- return error_mark_node;
- }
-
- if (range_checking)
- expr = check_expression (expr, cond,
- ridpointers[(int) RID_OVERFLOW]);
-
- expr = fold (build (op, etype, expr,
- convert (etype, integer_one_node)));
- return convert_to_class (class, expr);
-}
-
-/* Compute the value of the CHILL `size' operator just
- * like the C 'sizeof' operator (code stolen from c-typeck.c)
- * TYPE may be a location or mode tree. In pass 1, we build
- * a function-call syntax tree; in pass 2, we evaluate it.
- */
-tree
-build_chill_sizeof (type)
- tree type;
-{
- if (pass == 2)
- {
- tree temp;
- struct ch_class class;
- enum tree_code code;
- tree signame = NULL_TREE;
-
- if (type == NULL_TREE || TREE_CODE (type) == ERROR_MARK)
- return error_mark_node;
-
- if (TREE_CODE (type) == IDENTIFIER_NODE)
- type = lookup_name (type);
-
- code = TREE_CODE (type);
- if (code == ERROR_MARK)
- return error_mark_node;
-
- if (TREE_CODE_CLASS (TREE_CODE (type)) != 't')
- {
- if (TREE_CODE (type) == TYPE_DECL && CH_DECL_SIGNAL (type))
- signame = DECL_NAME (type);
- type = TREE_TYPE (type);
- }
-
- if (code == FUNCTION_TYPE)
- {
- if (pedantic || warn_pointer_arith)
- pedwarn ("size applied to a function mode");
- return error_mark_node;
- }
- if (code == VOID_TYPE)
- {
- if (pedantic || warn_pointer_arith)
- pedwarn ("sizeof applied to a void mode");
- return error_mark_node;
- }
- if (TYPE_SIZE (type) == 0)
- {
- error ("sizeof applied to an incomplete mode");
- return error_mark_node;
- }
-
- temp = size_binop (CEIL_DIV_EXPR, TYPE_SIZE_UNIT (type),
- size_int (TYPE_PRECISION (char_type_node)
- / BITS_PER_UNIT));
- if (signame != NULL_TREE)
- {
- /* we have a signal definition. This signal may have no
- data items specified. The definition however says that
- there are data, cause we cannot build a structure without
- fields. In this case return 0. */
- if (IDENTIFIER_SIGNAL_DATA (signame) == 0)
- temp = integer_zero_node;
- }
-
- /* FIXME: should call
- * cond_type_range_exception (temp);
- */
- class.kind = CH_DERIVED_CLASS;
- class.mode = integer_type_node;
- return convert_to_class (class, temp);
- }
- return NULL_TREE;
-}
-
-/* Compute the declared maximum value of the variable,
- * expression or declared type
- */
-tree
-build_chill_upper (what)
- tree what;
-{
- return build_chill_lower_or_upper (what, 1);
-}
-
-/*
- * Here at the site of a function/procedure call.. We need to build
- * temps for the INOUT and OUT parameters, and copy the actual parameters
- * into the temps. After the call, we 'copy back' the values from the
- * temps to the actual parameter variables. This somewhat verbose pol-
- * icy meets the requirement that the actual parameters are undisturbed
- * if the function/procedure causes an exception. They are updated only
- * upon a normal return from the function.
- *
- * Note: the expr_list, which collects all of the above assignments, etc,
- * is built in REVERSE execution order. The list is corrected by nreverse
- * inside the build_chill_compound_expr call.
- */
-tree
-build_chill_function_call (function, expr)
- tree function, expr;
-{
- register tree typetail, valtail, typelist;
- register tree temp, actual_args = NULL_TREE;
- tree name = NULL_TREE;
- tree function_call;
- tree fntype;
- int parmno = 1; /* parameter number for error message */
- int callee_raise_exception = 0;
-
- /* list of assignments to run after the actual call,
- copying from the temps back to the user's variables. */
- tree copy_back = NULL_TREE;
-
- /* list of expressions to run before the call, copying from
- the user's variable to the temps that are passed to the function */
- tree expr_list = NULL_TREE;
-
- if (function == NULL_TREE || TREE_CODE (function) == ERROR_MARK)
- return error_mark_node;
-
- if (expr != NULL_TREE && TREE_CODE (expr) == ERROR_MARK)
- return error_mark_node;
-
- if (pass < 2)
- return error_mark_node;
-
- fntype = TREE_TYPE (function);
- if (TREE_CODE (function) == FUNCTION_DECL)
- {
- callee_raise_exception = TYPE_RAISES_EXCEPTIONS (fntype) != NULL_TREE;
-
- /* Differs from default_conversion by not setting TREE_ADDRESSABLE
- (because calling an inline function does not mean the function
- needs to be separately compiled). */
- fntype = build_type_variant (fntype,
- TREE_READONLY (function),
- TREE_THIS_VOLATILE (function));
- name = DECL_NAME (function);
-
- /* check that function is not a PROCESS */
- if (CH_DECL_PROCESS (function))
- {
- error ("cannot call a PROCESS, you START a PROCESS");
- return error_mark_node;
- }
-
- function = build1 (ADDR_EXPR, build_pointer_type (fntype), function);
- }
- else if (TREE_CODE (fntype) == POINTER_TYPE)
- {
- fntype = TREE_TYPE (fntype);
- callee_raise_exception = TYPE_RAISES_EXCEPTIONS (fntype) != NULL_TREE;
-
- /* Z.200 6.7 Call Action:
- "A procedure call causes the EMPTY exception if the
- procedure primitive value delivers NULL. */
- if (TREE_CODE (function) != ADDR_EXPR
- || TREE_CODE (TREE_OPERAND (function, 0)) != FUNCTION_DECL)
- function = check_non_null (function);
- }
-
- typelist = TYPE_ARG_TYPES (fntype);
- if (callee_raise_exception)
- {
- /* remove last two arguments from list for subsequent checking.
- They will get added automatically after checking */
- int len = list_length (typelist);
- int i;
- tree newtypelist = NULL_TREE;
- tree wrk = typelist;
-
- for (i = 0; i < len - 3; i++)
- {
- newtypelist = tree_cons (TREE_PURPOSE (wrk), TREE_VALUE (wrk), newtypelist);
- wrk = TREE_CHAIN (wrk);
- }
- /* add the void_type_node */
- newtypelist = tree_cons (NULL_TREE, void_type_node, newtypelist);
- typelist = nreverse (newtypelist);
- }
-
- /* Scan the given expressions and types, producing individual
- converted arguments and pushing them on ACTUAL_ARGS in
- reverse order. */
- for (valtail = expr, typetail = typelist;
- valtail != NULL_TREE && typetail != NULL_TREE; parmno++,
- valtail = TREE_CHAIN (valtail), typetail = TREE_CHAIN (typetail))
- {
- register tree actual = TREE_VALUE (valtail);
- register tree attr = TREE_PURPOSE (typetail)
- ? TREE_PURPOSE (typetail) : ridpointers[(int) RID_IN];
- register tree type = TREE_VALUE (typetail);
- char place[30];
- sprintf (place, "parameter %d", parmno);
-
- /* if we have reached void_type_node in typelist we are at the
- end of formal parameters and then we have too many actual
- parameters */
- if (type == void_type_node)
- break;
-
- /* check if actual is a TYPE_DECL. FIXME: what else ? */
- if (TREE_CODE (actual) == TYPE_DECL)
- {
- error ("invalid %s", place);
- actual = error_mark_node;
- }
- /* INOUT or OUT param to handle? */
- else if (attr == ridpointers[(int) RID_OUT]
- || attr == ridpointers[(int)RID_INOUT])
- {
- char temp_name[20];
- tree parmtmp;
- tree in_actual = NULL_TREE, out_actual;
-
- /* actual parameter must be a location so we can
- build a reference to it */
- if (!CH_LOCATION_P (actual))
- {
- error ("%s parameter %d must be a location",
- (attr == ridpointers[(int) RID_OUT]) ?
- "OUT" : "INOUT", parmno);
- continue;
- }
- if (TYPE_READONLY_PROPERTY (TREE_TYPE (actual))
- || TREE_READONLY (actual))
- {
- error ("%s parameter %d is READ-only",
- (attr == ridpointers[(int) RID_OUT]) ?
- "OUT" : "INOUT", parmno);
- continue;
- }
-
- sprintf (temp_name, "PARM_%d_%s", parmno,
- (attr == ridpointers[(int)RID_OUT]) ?
- "OUT" : "INOUT");
- parmtmp = decl_temp1 (get_unique_identifier (temp_name),
- TREE_TYPE (type), 0, NULL_TREE, 0, 0);
- /* this temp *must not* be optimized into a register */
- mark_addressable (parmtmp);
-
- if (attr == ridpointers[(int)RID_INOUT])
- {
- tree in_actual = chill_convert_for_assignment (TREE_TYPE (type),
- actual, place);
- tree tmp = build_chill_modify_expr (parmtmp, in_actual);
- expr_list = tree_cons (NULL_TREE, tmp, expr_list);
- }
- if (in_actual != error_mark_node)
- {
- /* list of copy back assignments to perform, from the temp
- back to the actual parameter */
- out_actual = chill_convert_for_assignment (TREE_TYPE (actual),
- parmtmp, place);
- copy_back = tree_cons (NULL_TREE,
- build_chill_modify_expr (actual,
- out_actual),
- copy_back);
- }
- /* we can do this because build_chill_function_type
- turned these parameters into REFERENCE_TYPEs. */
- actual = build1 (ADDR_EXPR, type, parmtmp);
- }
- else if (attr == ridpointers[(int) RID_LOC])
- {
- int is_location = chill_location (actual);
- if (is_location)
- {
- if (is_location == 1)
- {
- error ("LOC actual parameter %d is a non-referable location",
- parmno);
- actual = error_mark_node;
- }
- else if (! CH_READ_COMPATIBLE (type, TREE_TYPE (actual)))
- {
- error ("mode mismatch in parameter %d", parmno);
- actual = error_mark_node;
- }
- else
- actual = convert (type, actual);
- }
- else
- {
- sprintf (place, "parameter_%d", parmno);
- actual = decl_temp1 (get_identifier (place),
- TREE_TYPE (type), 0, actual, 0, 0);
- actual = convert (type, actual);
- }
- mark_addressable (actual);
- }
- else
- actual = chill_convert_for_assignment (type, actual, place);
-
- actual_args = tree_cons (NULL_TREE, actual, actual_args);
- }
-
- if (valtail != 0 && TREE_VALUE (valtail) != void_type_node)
- {
- if (name)
- error ("too many arguments to procedure `%s'",
- IDENTIFIER_POINTER (name));
- else
- error ("too many arguments to procedure");
- return error_mark_node;
- }
- else if (typetail != 0 && TREE_VALUE (typetail) != void_type_node)
- {
- if (name)
- error ("too few arguments to procedure `%s'",
- IDENTIFIER_POINTER (name));
- else
- error ("too few arguments to procedure");
- return error_mark_node;
- }
-
- if (callee_raise_exception)
- {
- /* add linenumber and filename of the caller as arguments */
- actual_args = tree_cons (NULL_TREE, force_addr_of (get_chill_filename ()),
- actual_args);
- actual_args = tree_cons (NULL_TREE, get_chill_linenumber (), actual_args);
- }
-
- function_call = build (CALL_EXPR, TREE_TYPE (fntype),
- function, nreverse (actual_args), NULL_TREE);
- TREE_SIDE_EFFECTS (function_call) = 1;
-
- if (copy_back == NULL_TREE && expr_list == NULL_TREE)
- return function_call; /* no copying to do, either way */
- else
- {
- tree result_type = TREE_TYPE (fntype);
- tree result_tmp = NULL_TREE;
-
- /* no result wanted from procedure call */
- if (result_type == NULL_TREE || result_type == void_type_node)
- expr_list = tree_cons (NULL_TREE, function_call, expr_list);
- else
- {
- /* create a temp for the function's result. this is so that we can
- evaluate this temp as the last expression in the list, which will
- make the function's return value the value of the whole list of
- expressions (by the C rules for compound expressions) */
- result_tmp = decl_temp1 (get_unique_identifier ("FUNC_RESULT"),
- result_type, 0, NULL_TREE, 0, 0);
- expr_list = tree_cons (NULL_TREE,
- build_chill_modify_expr (result_tmp, function_call),
- expr_list);
- }
-
- expr_list = chainon (copy_back, expr_list);
-
- /* last, but not least, the function's result */
- if (result_tmp != NULL_TREE)
- expr_list = tree_cons (NULL_TREE, result_tmp, expr_list);
- temp = build_chill_compound_expr (nreverse (expr_list));
- return temp;
- }
-}
-
-/* We saw something that looks like a function call,
- but if it's pass 1, we're not sure. */
-
-tree
-build_generalized_call (func, args)
- tree func, args;
-{
- tree type = TREE_TYPE (func);
-
- if (pass == 1)
- return build (CALL_EXPR, NULL_TREE, func, args, NULL_TREE);
-
- /* Handle string repetition */
- if (TREE_CODE (func) == INTEGER_CST)
- {
- if (args == NULL_TREE || TREE_CHAIN (args) != NULL_TREE)
- {
- error ("syntax error (integer used as function)");
- return error_mark_node;
- }
- if (TREE_CODE (args) == TREE_LIST)
- args = TREE_VALUE (args);
- return build_chill_repetition_op (func, args);
- }
-
- if (args != NULL_TREE)
- {
- if (TREE_CODE (args) == RANGE_EXPR)
- {
- tree lo = TREE_OPERAND (args, 0), hi = TREE_OPERAND (args, 1);
- if (TREE_CODE_CLASS (TREE_CODE (func)) == 't')
- return build_chill_range_type (func, lo, hi);
- else
- return build_chill_slice_with_range (func, lo, hi);
- }
- else if (TREE_CODE (args) != TREE_LIST)
- {
- error ("syntax error - missing operator, comma, or '('?");
- return error_mark_node;
- }
- }
-
- if (TREE_CODE (func) == TYPE_DECL)
- {
- if (CH_DECL_SIGNAL (func))
- return build_signal_descriptor (func, args);
- func = TREE_TYPE (func);
- }
-
- if (TREE_CODE_CLASS (TREE_CODE (func)) == 't'
- && args != NULL_TREE && TREE_CHAIN (args) == NULL_TREE)
- return build_chill_cast (func, TREE_VALUE (args));
-
- if (TREE_CODE (type) == FUNCTION_TYPE
- || (TREE_CODE (type) == POINTER_TYPE
- && TREE_TYPE (type) != NULL_TREE
- && TREE_CODE (TREE_TYPE (type)) == FUNCTION_TYPE))
- {
- /* Check for a built-in Chill function. */
- if (TREE_CODE (func) == FUNCTION_DECL
- && DECL_BUILT_IN (func)
- && DECL_FUNCTION_CODE (func) > END_BUILTINS)
- {
- tree fnname = DECL_NAME (func);
- switch ((enum chill_built_in_function)DECL_FUNCTION_CODE (func))
- {
- case BUILT_IN_CH_ABS:
- if (check_arglist_length (args, 1, 1, fnname) < 0)
- return error_mark_node;
- return build_chill_abs (TREE_VALUE (args));
- case BUILT_IN_ABSTIME:
- if (check_arglist_length (args, 0, 6, fnname) < 0)
- return error_mark_node;
- return build_chill_abstime (args);
- case BUILT_IN_ADDR:
- if (check_arglist_length (args, 1, 1, fnname) < 0)
- return error_mark_node;
-#if 0
- return build_chill_addr_expr (TREE_VALUE (args), (char *)0);
-#else
- return build_chill_arrow_expr (TREE_VALUE (args), 0);
-#endif
- case BUILT_IN_ALLOCATE_GLOBAL_MEMORY:
- if (check_arglist_length (args, 2, 2, fnname) < 0)
- return error_mark_node;
- return build_allocate_global_memory_call
- (TREE_VALUE (args),
- TREE_VALUE (TREE_CHAIN (args)));
- case BUILT_IN_ALLOCATE:
- if (check_arglist_length (args, 1, 2, fnname) < 0)
- return error_mark_node;
- return build_chill_allocate (TREE_VALUE (args),
- TREE_CHAIN (args) == NULL_TREE ? NULL_TREE : TREE_VALUE (TREE_CHAIN (args)));
- case BUILT_IN_ALLOCATE_MEMORY:
- if (check_arglist_length (args, 2, 2, fnname) < 0)
- return error_mark_node;
- return build_allocate_memory_call
- (TREE_VALUE (args),
- TREE_VALUE (TREE_CHAIN (args)));
- case BUILT_IN_ASSOCIATE:
- if (check_arglist_length (args, 2, 3, fnname) < 0)
- return error_mark_node;
- return build_chill_associate
- (TREE_VALUE (args),
- TREE_VALUE (TREE_CHAIN (args)),
- TREE_CHAIN (TREE_CHAIN (args)));
- case BUILT_IN_ARCCOS:
- if (check_arglist_length (args, 1, 1, fnname) < 0)
- return error_mark_node;
- return build_chill_floatcall (TREE_VALUE (args),
- IDENTIFIER_POINTER (fnname),
- "__acos");
- case BUILT_IN_ARCSIN:
- if (check_arglist_length (args, 1, 1, fnname) < 0)
- return error_mark_node;
- return build_chill_floatcall (TREE_VALUE (args),
- IDENTIFIER_POINTER (fnname),
- "__asin");
- case BUILT_IN_ARCTAN:
- if (check_arglist_length (args, 1, 1, fnname) < 0)
- return error_mark_node;
- return build_chill_floatcall (TREE_VALUE (args),
- IDENTIFIER_POINTER (fnname),
- "__atan");
- case BUILT_IN_CARD:
- if (check_arglist_length (args, 1, 1, fnname) < 0)
- return error_mark_node;
- return build_chill_card (TREE_VALUE (args));
- case BUILT_IN_CONNECT:
- if (check_arglist_length (args, 3, 5, fnname) < 0)
- return error_mark_node;
- return build_chill_connect
- (TREE_VALUE (args),
- TREE_VALUE (TREE_CHAIN (args)),
- TREE_VALUE (TREE_CHAIN (TREE_CHAIN (args))),
- TREE_CHAIN (TREE_CHAIN (TREE_CHAIN (args))));
- case BUILT_IN_COPY_NUMBER:
- if (check_arglist_length (args, 1, 1, fnname) < 0)
- return error_mark_node;
- return build_copy_number (TREE_VALUE (args));
- case BUILT_IN_CH_COS:
- if (check_arglist_length (args, 1, 1, fnname) < 0)
- return error_mark_node;
- return build_chill_floatcall (TREE_VALUE (args),
- IDENTIFIER_POINTER (fnname),
- "__cos");
- case BUILT_IN_CREATE:
- if (check_arglist_length (args, 1, 1, fnname) < 0)
- return error_mark_node;
- return build_chill_create (TREE_VALUE (args));
- case BUILT_IN_DAYS:
- if (check_arglist_length (args, 1, 1, fnname) < 0)
- return error_mark_node;
- return build_chill_duration (TREE_VALUE (args), DAYS_MULTIPLIER,
- fnname, DAYS_MAX);
- case BUILT_IN_CH_DELETE:
- if (check_arglist_length (args, 1, 1, fnname) < 0)
- return error_mark_node;
- return build_chill_delete (TREE_VALUE (args));
- case BUILT_IN_DESCR:
- if (check_arglist_length (args, 1, 1, fnname) < 0)
- return error_mark_node;
- return build_chill_descr (TREE_VALUE (args));
- case BUILT_IN_DISCONNECT:
- if (check_arglist_length (args, 1, 1, fnname) < 0)
- return error_mark_node;
- return build_chill_disconnect (TREE_VALUE (args));
- case BUILT_IN_DISSOCIATE:
- if (check_arglist_length (args, 1, 1, fnname) < 0)
- return error_mark_node;
- return build_chill_dissociate (TREE_VALUE (args));
- case BUILT_IN_EOLN:
- if (check_arglist_length (args, 1, 1, fnname) < 0)
- return error_mark_node;
- return build_chill_eoln (TREE_VALUE (args));
- case BUILT_IN_EXISTING:
- if (check_arglist_length (args, 1, 1, fnname) < 0)
- return error_mark_node;
- return build_chill_existing (TREE_VALUE (args));
- case BUILT_IN_EXP:
- if (check_arglist_length (args, 1, 1, fnname) < 0)
- return error_mark_node;
- return build_chill_floatcall (TREE_VALUE (args),
- IDENTIFIER_POINTER (fnname),
- "__exp");
- case BUILT_IN_GEN_CODE:
- if (check_arglist_length (args, 1, 1, fnname) < 0)
- return error_mark_node;
- return build_gen_code (TREE_VALUE (args));
- case BUILT_IN_GEN_INST:
- if (check_arglist_length (args, 2, 2, fnname) < 0)
- return error_mark_node;
- return build_gen_inst (TREE_VALUE (args),
- TREE_VALUE (TREE_CHAIN (args)));
- case BUILT_IN_GEN_PTYPE:
- if (check_arglist_length (args, 1, 1, fnname) < 0)
- return error_mark_node;
- return build_gen_ptype (TREE_VALUE (args));
- case BUILT_IN_GETASSOCIATION:
- if (check_arglist_length (args, 1, 1, fnname) < 0)
- return error_mark_node;
- return build_chill_getassociation (TREE_VALUE (args));
- case BUILT_IN_GETSTACK:
- if (check_arglist_length (args, 1, 2, fnname) < 0)
- return error_mark_node;
- return build_chill_getstack (TREE_VALUE (args),
- TREE_CHAIN (args) == NULL_TREE ? NULL_TREE : TREE_VALUE (TREE_CHAIN (args)));
- case BUILT_IN_GETTEXTACCESS:
- if (check_arglist_length (args, 1, 1, fnname) < 0)
- return error_mark_node;
- return build_chill_gettextaccess (TREE_VALUE (args));
- case BUILT_IN_GETTEXTINDEX:
- if (check_arglist_length (args, 1, 1, fnname) < 0)
- return error_mark_node;
- return build_chill_gettextindex (TREE_VALUE (args));
- case BUILT_IN_GETTEXTRECORD:
- if (check_arglist_length (args, 1, 1, fnname) < 0)
- return error_mark_node;
- return build_chill_gettextrecord (TREE_VALUE (args));
- case BUILT_IN_GETUSAGE:
- if (check_arglist_length (args, 1, 1, fnname) < 0)
- return error_mark_node;
- return build_chill_getusage (TREE_VALUE (args));
- case BUILT_IN_HOURS:
- if (check_arglist_length (args, 1, 1, fnname) < 0)
- return error_mark_node;
- return build_chill_duration (TREE_VALUE (args), HOURS_MULTIPLIER,
- fnname, HOURS_MAX);
- case BUILT_IN_INDEXABLE:
- if (check_arglist_length (args, 1, 1, fnname) < 0)
- return error_mark_node;
- return build_chill_indexable (TREE_VALUE (args));
- case BUILT_IN_INTTIME:
- if (check_arglist_length (args, 2, 7, fnname) < 0)
- return error_mark_node;
- return build_chill_inttime (TREE_VALUE (args),
- TREE_CHAIN (args));
- case BUILT_IN_ISASSOCIATED:
- if (check_arglist_length (args, 1, 1, fnname) < 0)
- return error_mark_node;
- return build_chill_isassociated (TREE_VALUE (args));
- case BUILT_IN_LENGTH:
- if (check_arglist_length (args, 1, 1, fnname) < 0)
- return error_mark_node;
- return build_chill_length (TREE_VALUE (args));
- case BUILT_IN_LN:
- if (check_arglist_length (args, 1, 1, fnname) < 0)
- return error_mark_node;
- return build_chill_floatcall (TREE_VALUE (args),
- IDENTIFIER_POINTER (fnname),
- "__log");
- case BUILT_IN_LOG:
- if (check_arglist_length (args, 1, 1, fnname) < 0)
- return error_mark_node;
- return build_chill_floatcall (TREE_VALUE (args),
- IDENTIFIER_POINTER (fnname),
- "__log10");
- case BUILT_IN_LOWER:
- if (check_arglist_length (args, 1, 1, fnname) < 0)
- return error_mark_node;
- return build_chill_lower (TREE_VALUE (args));
- case BUILT_IN_MAX:
- if (check_arglist_length (args, 1, 1, fnname) < 0)
- return error_mark_node;
- return build_chill_max (TREE_VALUE (args));
- case BUILT_IN_MILLISECS:
- if (check_arglist_length (args, 1, 1, fnname) < 0)
- return error_mark_node;
- return build_chill_duration (TREE_VALUE (args), MILLISECS_MULTIPLIER,
- fnname, MILLISECS_MAX);
- case BUILT_IN_MIN:
- if (check_arglist_length (args, 1, 1, fnname) < 0)
- return error_mark_node;
- return build_chill_min (TREE_VALUE (args));
- case BUILT_IN_MINUTES:
- if (check_arglist_length (args, 1, 1, fnname) < 0)
- return error_mark_node;
- return build_chill_duration (TREE_VALUE (args), MINUTES_MULTIPLIER,
- fnname, MINUTES_MAX);
- case BUILT_IN_MODIFY:
- if (check_arglist_length (args, 1, -1, fnname) < 0)
- return error_mark_node;
- return build_chill_modify (TREE_VALUE (args), TREE_CHAIN (args));
- case BUILT_IN_NUM:
- if (check_arglist_length (args, 1, 1, fnname) < 0)
- return error_mark_node;
- return build_chill_num (TREE_VALUE (args));
- case BUILT_IN_OUTOFFILE:
- if (check_arglist_length (args, 1, 1, fnname) < 0)
- return error_mark_node;
- return build_chill_outoffile (TREE_VALUE (args));
- case BUILT_IN_PRED:
- if (check_arglist_length (args, 1, 1, fnname) < 0)
- return error_mark_node;
- return build_chill_pred_or_succ (TREE_VALUE (args), MINUS_EXPR);
- case BUILT_IN_PROC_TYPE:
- if (check_arglist_length (args, 1, 1, fnname) < 0)
- return error_mark_node;
- return build_proc_type (TREE_VALUE (args));
- case BUILT_IN_QUEUE_LENGTH:
- if (check_arglist_length (args, 1, 1, fnname) < 0)
- return error_mark_node;
- return build_queue_length (TREE_VALUE (args));
- case BUILT_IN_READABLE:
- if (check_arglist_length (args, 1, 1, fnname) < 0)
- return error_mark_node;
- return build_chill_readable (TREE_VALUE (args));
- case BUILT_IN_READRECORD:
- if (check_arglist_length (args, 1, 3, fnname) < 0)
- return error_mark_node;
- return build_chill_readrecord (TREE_VALUE (args), TREE_CHAIN (args));
- case BUILT_IN_READTEXT:
- if (check_arglist_length (args, 2, -1, fnname) < 0)
- return error_mark_node;
- return build_chill_readtext (TREE_VALUE (args),
- TREE_CHAIN (args));
- case BUILT_IN_RETURN_MEMORY:
- if (check_arglist_length (args, 1, 1, fnname) < 0)
- return error_mark_node;
- return build_return_memory (TREE_VALUE (args));
- case BUILT_IN_SECS:
- if (check_arglist_length (args, 1, 1, fnname) < 0)
- return error_mark_node;
- return build_chill_duration (TREE_VALUE (args), SECS_MULTIPLIER,
- fnname, SECS_MAX);
- case BUILT_IN_SEQUENCIBLE:
- if (check_arglist_length (args, 1, 1, fnname) < 0)
- return error_mark_node;
- return build_chill_sequencible (TREE_VALUE (args));
- case BUILT_IN_SETTEXTACCESS:
- if (check_arglist_length (args, 2, 2, fnname) < 0)
- return error_mark_node;
- return build_chill_settextaccess (TREE_VALUE (args),
- TREE_VALUE (TREE_CHAIN (args)));
- case BUILT_IN_SETTEXTINDEX:
- if (check_arglist_length (args, 2, 2, fnname) < 0)
- return error_mark_node;
- return build_chill_settextindex (TREE_VALUE (args),
- TREE_VALUE (TREE_CHAIN (args)));
- case BUILT_IN_SETTEXTRECORD:
- if (check_arglist_length (args, 2, 2, fnname) < 0)
- return error_mark_node;
- return build_chill_settextrecord (TREE_VALUE (args),
- TREE_VALUE (TREE_CHAIN (args)));
- case BUILT_IN_CH_SIN:
- if (check_arglist_length (args, 1, 1, fnname) < 0)
- return error_mark_node;
- return build_chill_floatcall (TREE_VALUE (args),
- IDENTIFIER_POINTER (fnname),
- "__sin");
- case BUILT_IN_SIZE:
- if (check_arglist_length (args, 1, 1, fnname) < 0)
- return error_mark_node;
- return build_chill_sizeof (TREE_VALUE (args));
- case BUILT_IN_SQRT:
- if (check_arglist_length (args, 1, 1, fnname) < 0)
- return error_mark_node;
- return build_chill_floatcall (TREE_VALUE (args),
- IDENTIFIER_POINTER (fnname),
- "__sqrt");
- case BUILT_IN_SUCC:
- if (check_arglist_length (args, 1, 1, fnname) < 0)
- return error_mark_node;
- return build_chill_pred_or_succ (TREE_VALUE (args), PLUS_EXPR);
- case BUILT_IN_TAN:
- if (check_arglist_length (args, 1, 1, fnname) < 0)
- return error_mark_node;
- return build_chill_floatcall (TREE_VALUE (args),
- IDENTIFIER_POINTER (fnname),
- "__tan");
- case BUILT_IN_TERMINATE:
- if (check_arglist_length (args, 1, 1, fnname) < 0)
- return error_mark_node;
- return build_chill_terminate (TREE_VALUE (args));
- case BUILT_IN_UPPER:
- if (check_arglist_length (args, 1, 1, fnname) < 0)
- return error_mark_node;
- return build_chill_upper (TREE_VALUE (args));
- case BUILT_IN_VARIABLE:
- if (check_arglist_length (args, 1, 1, fnname) < 0)
- return error_mark_node;
- return build_chill_variable (TREE_VALUE (args));
- case BUILT_IN_WRITEABLE:
- if (check_arglist_length (args, 1, 1, fnname) < 0)
- return error_mark_node;
- return build_chill_writeable (TREE_VALUE (args));
- case BUILT_IN_WRITERECORD:
- if (check_arglist_length (args, 2, 3, fnname) < 0)
- return error_mark_node;
- return build_chill_writerecord (TREE_VALUE (args), TREE_CHAIN (args));
- case BUILT_IN_WRITETEXT:
- if (check_arglist_length (args, 2, -1, fnname) < 0)
- return error_mark_node;
- return build_chill_writetext (TREE_VALUE (args),
- TREE_CHAIN (args));
-
- case BUILT_IN_EXPIRED:
- case BUILT_IN_WAIT:
- sorry ("unimplemented builtin function `%s'",
- IDENTIFIER_POINTER (fnname));
- break;
- default:
- error ("internal error - bad builtin function `%s'",
- IDENTIFIER_POINTER (fnname));
- }
- }
- return build_chill_function_call (func, args);
- }
-
- if (chill_varying_type_p (TREE_TYPE (func)))
- type = TREE_TYPE (TREE_CHAIN (TYPE_FIELDS (type)));
-
- if (CH_STRING_TYPE_P (type))
- {
- if (args == NULL_TREE)
- {
- error ("empty expression in string index");
- return error_mark_node;
- }
- if (TREE_CHAIN (args) != NULL)
- {
- error ("only one expression allowed in string index");
- return error_mark_node;
- }
- if (flag_old_strings)
- return build_chill_slice_with_length (func,
- TREE_VALUE (args),
- integer_one_node);
- else if (CH_BOOLS_TYPE_P (type))
- return build_chill_bitref (func, args);
- else
- return build_chill_array_ref (func, args);
- }
-
- else if (TREE_CODE (type) == ARRAY_TYPE)
- return build_chill_array_ref (func, args);
-
- if (TREE_CODE (func) != ERROR_MARK)
- error ("invalid: primval ( untyped_exprlist )");
- return error_mark_node;
-}
-
-/* Given a set stored as one bit per char (in BUFFER[0 .. BIT_SIZE-1]),
- return a CONTRUCTOR, of type TYPE (a SET_TYPE). */
-static tree
-expand_packed_set (buffer, bit_size, type)
- const char *buffer;
- int bit_size;
- tree type;
-{
- /* The ordinal number corresponding to the first stored bit. */
- HOST_WIDE_INT first_bit_no =
- TREE_INT_CST_LOW (TYPE_MIN_VALUE (TYPE_DOMAIN (type)));
- tree list = NULL_TREE;
- int i;
-
- for (i = 0; i < bit_size; i++)
- if (buffer[i])
- {
- int next_0;
- for (next_0 = i + 1;
- next_0 < bit_size && buffer[next_0]; next_0++)
- ;
- if (next_0 == i + 1)
- list = tree_cons (NULL_TREE,
- build_int_2 (i + first_bit_no, 0), list);
- else
- {
- list = tree_cons (build_int_2 (i + first_bit_no, 0),
- build_int_2 (next_0 - 1 + first_bit_no, 0), list);
- /* advance i past the range of 1-bits */
- i = next_0;
- }
- }
- list = build (CONSTRUCTOR, type, NULL_TREE, nreverse (list));
- TREE_CONSTANT (list) = 1;
- return list;
-}
-
-/*
- * fold a set represented as a CONSTRUCTOR list.
- * An empty set has a NULL_TREE in its TREE_OPERAND (set, 1) slot.
- */
-static tree
-fold_set_expr (code, op0, op1)
- enum chill_tree_code code;
- tree op0, op1;
-{
- tree temp;
- char *buffer0, *buffer1 = NULL, *bufferr;
- int i, size0, size1, first_unused_bit;
-
- if (! TREE_CONSTANT (op0) || TREE_CODE (op0) != CONSTRUCTOR)
- return NULL_TREE;
-
- if (op1
- && (! TREE_CONSTANT (op1) || TREE_CODE (op1) != CONSTRUCTOR))
- return NULL_TREE;
-
- size0 = int_size_in_bytes (TREE_TYPE (op0)) * BITS_PER_UNIT;
- if (size0 < 0)
- {
- error ("operand is variable-size bitstring/power-set");
- return error_mark_node;
- }
- buffer0 = (char*) alloca (size0);
-
- temp = get_set_constructor_bits (op0, buffer0, size0);
- if (temp)
- return NULL_TREE;
-
- if (op0 && op1)
- {
- size1 = int_size_in_bytes (TREE_TYPE (op1)) * BITS_PER_UNIT;
- if (size1 < 0)
- {
- error ("operand is variable-size bitstring/power-set");
- return error_mark_node;
- }
- if (size0 != size1)
- return NULL_TREE;
- buffer1 = (char*) alloca (size1);
- temp = get_set_constructor_bits (op1, buffer1, size1);
- if (temp)
- return NULL_TREE;
- }
-
- bufferr = (char*) alloca (size0); /* result buffer */
-
- switch ((int)code)
- {
- case SET_NOT_EXPR:
- case BIT_NOT_EXPR:
- for (i = 0; i < size0; i++)
- bufferr[i] = 1 & ~buffer0[i];
- goto build_result;
- case SET_AND_EXPR:
- case BIT_AND_EXPR:
- for (i = 0; i < size0; i++)
- bufferr[i] = buffer0[i] & buffer1[i];
- goto build_result;
- case SET_IOR_EXPR:
- case BIT_IOR_EXPR:
- for (i = 0; i < size0; i++)
- bufferr[i] = buffer0[i] | buffer1[i];
- goto build_result;
- case SET_XOR_EXPR:
- case BIT_XOR_EXPR:
- for (i = 0; i < size0; i++)
- bufferr[i] = (buffer0[i] ^ buffer1[i]) & 1;
- goto build_result;
- case SET_DIFF_EXPR:
- case MINUS_EXPR:
- for (i = 0; i < size0; i++)
- bufferr[i] = buffer0[i] & ~buffer1[i];
- goto build_result;
- build_result:
- /* mask out unused bits. Same as runtime library does. */
- first_unused_bit = TREE_INT_CST_LOW (TYPE_MAX_VALUE (TYPE_DOMAIN (TREE_TYPE (op0))))
- - TREE_INT_CST_LOW (TYPE_MIN_VALUE (TYPE_DOMAIN (TREE_TYPE (op0)))) + 1;
- for (i = first_unused_bit; i < size0 ; i++)
- bufferr[i] = 0;
- return expand_packed_set (bufferr, size0, TREE_TYPE (op0));
- case EQ_EXPR:
- for (i = 0; i < size0; i++)
- if (buffer0[i] != buffer1[i])
- return boolean_false_node;
- return boolean_true_node;
-
- case NE_EXPR:
- for (i = 0; i < size0; i++)
- if (buffer0[i] != buffer1[i])
- return boolean_true_node;
- return boolean_false_node;
-
- default:
- return NULL_TREE;
- }
-}
-
-/*
- * build a set or bit-array expression. Type-checking is
- * done elsewhere.
- */
-static tree
-build_compare_set_expr (code, op0, op1)
- enum tree_code code;
- tree op0, op1;
-{
- tree result_type = NULL_TREE;
- const char *fnname;
- tree x;
-
- /* These conversions are needed if -fold-strings. */
- if (TREE_CODE (TREE_TYPE (op0)) == BOOLEAN_TYPE)
- {
- if (CH_BOOLS_ONE_P (TREE_TYPE (op1)))
- return build_compare_discrete_expr (code,
- op0,
- convert (boolean_type_node, op1));
- else
- op0 = convert (bitstring_one_type_node, op0);
- }
- if (TREE_CODE (TREE_TYPE (op1)) == BOOLEAN_TYPE)
- {
- if (CH_BOOLS_ONE_P (TREE_TYPE (op0)))
- return build_compare_discrete_expr (code,
- convert (boolean_type_node, op0),
- op1);
- else
- op1 = convert (bitstring_one_type_node, op1);
- }
-
- switch ((int)code)
- {
- case EQ_EXPR:
- {
- tree temp = fold_set_expr (EQ_EXPR, op0, op1);
- if (temp)
- return temp;
- fnname = "__eqpowerset";
- goto compare_powerset;
- }
- break;
-
- case GE_EXPR:
- /* switch operands and fall thru */
- x = op0;
- op0 = op1;
- op1 = x;
-
- case LE_EXPR:
- fnname = "__lepowerset";
- goto compare_powerset;
-
- case GT_EXPR:
- /* switch operands and fall thru */
- x = op0;
- op0 = op1;
- op1 = x;
-
- case LT_EXPR:
- fnname = "__ltpowerset";
- goto compare_powerset;
-
- case NE_EXPR:
- return invert_truthvalue (build_compare_set_expr (EQ_EXPR, op0, op1));
-
- compare_powerset:
- {
- tree tsize = powersetlen (op0);
-
- if (TREE_CODE (TREE_TYPE (op0)) != SET_TYPE)
- tsize = fold (build (MULT_EXPR, sizetype, tsize,
- size_int (BITS_PER_UNIT)));
-
- return build_chill_function_call (lookup_name (get_identifier (fnname)),
- tree_cons (NULL_TREE, force_addr_of (op0),
- tree_cons (NULL_TREE, force_addr_of (op1),
- tree_cons (NULL_TREE, tsize, NULL_TREE))));
- }
- break;
-
- default:
- if ((int) code >= (int)LAST_AND_UNUSED_TREE_CODE)
- {
- error ("tree code `%s' unhandled in build_compare_set_expr",
- tree_code_name[(int)code]);
- return error_mark_node;
- }
- break;
- }
-
- return build ((enum tree_code)code, result_type,
- op0, op1);
-}
-
-/* Convert a varying string (or array) to dynamic non-varying string:
- EXP becomes EXP.var_data(0 UP EXP.var_length). */
-
-tree
-varying_to_slice (exp)
- tree exp;
-{
- if (!chill_varying_type_p (TREE_TYPE (exp)))
- return exp;
- else
- { tree size, data, data_domain, min;
- tree novelty = CH_NOVELTY (TREE_TYPE (exp));
- exp = save_if_needed (exp);
- size = build_component_ref (exp, var_length_id);
- data = build_component_ref (exp, var_data_id);
- TREE_TYPE (data) = copy_novelty (novelty, TREE_TYPE (data));
- data_domain = TYPE_DOMAIN (TREE_TYPE (data));
- if (data_domain != NULL_TREE
- && TYPE_MIN_VALUE (data_domain) != NULL_TREE)
- min = TYPE_MIN_VALUE (data_domain);
- else
- min = integer_zero_node;
- return build_chill_slice (data, min, size);
- }
-}
-
-/* Convert a scalar argument to a string or array type. This is a subroutine
- of `build_concat_expr'. */
-
-static tree
-scalar_to_string (exp)
- tree exp;
-{
- tree type = TREE_TYPE (exp);
-
- if (SCALAR_P (type))
- {
- int was_const = TREE_CONSTANT (exp);
- if (TREE_TYPE (exp) == char_type_node)
- exp = convert (string_one_type_node, exp);
- else if (TREE_TYPE (exp) == boolean_type_node)
- exp = convert (bitstring_one_type_node, exp);
- else
- exp = convert (build_array_type_for_scalar (type), exp);
- TREE_CONSTANT (exp) = was_const;
- return exp;
- }
- return varying_to_slice (exp);
-}
-
-/* FIXME: Generalize this to general arrays (not just strings),
- at least for the compiler-generated case of padding fixed-length arrays. */
-
-static tree
-build_concat_expr (op0, op1)
- tree op0, op1;
-{
- tree orig_op0 = op0, orig_op1 = op1;
- tree type0, type1, size0, size1, res;
-
- op0 = scalar_to_string (op0);
- type0 = TREE_TYPE (op0);
- op1 = scalar_to_string (op1);
- type1 = TREE_TYPE (op1);
- size1 = size_in_bytes (type1);
-
- /* try to fold constant string literals */
- if (TREE_CODE (op0) == STRING_CST
- && (TREE_CODE (op1) == STRING_CST
- || TREE_CODE (op1) == UNDEFINED_EXPR)
- && TREE_CODE (size1) == INTEGER_CST)
- {
- int len0 = TREE_STRING_LENGTH (op0);
- int len1 = TREE_INT_CST_LOW (size1);
- char *result = xmalloc (len0 + len1 + 1);
- memcpy (result, TREE_STRING_POINTER (op0), len0);
- if (TREE_CODE (op1) == UNDEFINED_EXPR)
- memset (&result[len0], '\0', len1);
- else
- memcpy (&result[len0], TREE_STRING_POINTER (op1), len1);
- return build_chill_string (len0 + len1, result);
- }
- else if (TREE_CODE (type0) == TREE_CODE (type1))
- {
- tree result_size;
- struct ch_class result_class;
- struct ch_class class0;
- struct ch_class class1;
-
- class0 = chill_expr_class (orig_op0);
- class1 = chill_expr_class (orig_op1);
-
- if (TREE_CODE (type0) == SET_TYPE)
- {
- result_size = fold (build (PLUS_EXPR, integer_type_node,
- discrete_count (TYPE_DOMAIN (type0)),
- discrete_count (TYPE_DOMAIN (type1))));
- result_class.mode = build_bitstring_type (result_size);
- }
- else
- {
- tree max0 = TYPE_MAX_VALUE (type0);
- tree max1 = TYPE_MAX_VALUE (type1);
-
- /* new array's dynamic size (in bytes). */
- size0 = size_in_bytes (type0);
- /* size1 was computed above. */
-
- result_size = size_binop (PLUS_EXPR, size0, size1);
- /* new array's type. */
- result_class.mode = build_string_type (char_type_node, result_size);
-
- if (max0 || max1)
- {
- max0 = max0 == 0 ? size0 : convert (sizetype, max0);
- max1 = max1 == 0 ? size1 : convert (sizetype, max1);
- TYPE_MAX_VALUE (result_class.mode)
- = size_binop (PLUS_EXPR, max0, max1);
- }
- }
-
- if (class0.kind == CH_VALUE_CLASS || class1.kind == CH_VALUE_CLASS)
- {
- tree novelty0 = CH_NOVELTY (TREE_TYPE (orig_op0));
- result_class.kind = CH_VALUE_CLASS;
- if (class0.kind == CH_VALUE_CLASS && novelty0 != NULL_TREE)
- SET_CH_NOVELTY_NONNIL (result_class.mode, novelty0);
- else if (class1.kind == CH_VALUE_CLASS)
- SET_CH_NOVELTY (result_class.mode,
- CH_NOVELTY (TREE_TYPE (orig_op1)));
- }
- else
- result_class.kind = CH_DERIVED_CLASS;
-
- if (TREE_CODE (result_class.mode) == SET_TYPE
- && TREE_CONSTANT (op0) && TREE_CONSTANT (op1)
- && TREE_CODE (op0) == CONSTRUCTOR && TREE_CODE (op1) == CONSTRUCTOR)
- {
- HOST_WIDE_INT size0, size1; char *buffer;
- size0 = TREE_INT_CST_LOW (TYPE_MAX_VALUE (TYPE_DOMAIN (type0))) + 1;
- size1 = TREE_INT_CST_LOW (TYPE_MAX_VALUE (TYPE_DOMAIN (type1))) + 1;
- buffer = (char*) alloca (size0 + size1);
- if (size0 < 0 || size1 < 0
- || get_set_constructor_bits (op0, buffer, size0)
- || get_set_constructor_bits (op1, buffer + size0, size1))
- abort ();
- res = expand_packed_set (buffer, size0 + size1, result_class.mode);
- }
- else
- res = build (CONCAT_EXPR, result_class.mode, op0, op1);
- return convert_to_class (result_class, res);
- }
- else
- {
- error ("incompatible modes in concat expression");
- return error_mark_node;
- }
-}
-
-/*
- * handle varying and fixed array compare operations
- */
-static tree
-build_compare_string_expr (code, op0, op1)
- enum tree_code code;
- tree op0, op1;
-{
- if (op0 == NULL_TREE || TREE_CODE (op0) == ERROR_MARK)
- return error_mark_node;
- if (op1 == NULL_TREE || TREE_CODE (op1) == ERROR_MARK)
- return error_mark_node;
-
- if (tree_int_cst_equal (TYPE_SIZE (TREE_TYPE (op0)),
- TYPE_SIZE (TREE_TYPE (op1)))
- && ! chill_varying_type_p (TREE_TYPE (op0))
- && ! chill_varying_type_p (TREE_TYPE (op1)))
- {
- tree size = size_in_bytes (TREE_TYPE (op0));
- tree temp = lookup_name (get_identifier ("memcmp"));
- temp = build_chill_function_call (temp,
- tree_cons (NULL_TREE, force_addr_of (op0),
- tree_cons (NULL_TREE, force_addr_of (op1),
- tree_cons (NULL_TREE, size, NULL_TREE))));
- return build_compare_discrete_expr (code, temp, integer_zero_node);
- }
-
- switch ((int)code)
- {
- case EQ_EXPR:
- code = STRING_EQ_EXPR;
- break;
- case GE_EXPR:
- return invert_truthvalue (build_compare_string_expr (LT_EXPR, op0, op1));
- case LE_EXPR:
- return invert_truthvalue (build_compare_string_expr (LT_EXPR, op1, op0));
- case GT_EXPR:
- return build_compare_string_expr (LT_EXPR, op1, op0);
- case LT_EXPR:
- code = STRING_LT_EXPR;
- break;
- case NE_EXPR:
- return invert_truthvalue (build_compare_string_expr (EQ_EXPR, op0, op1));
- default:
- error ("Invalid operation on array of chars");
- return error_mark_node;
- }
-
- return build (code, boolean_type_node, op0, op1);
-}
-
-static tree
-compare_records (exp0, exp1)
- tree exp0, exp1;
-{
- tree type = TREE_TYPE (exp0);
- tree field;
- int have_variants = 0;
-
- tree result = boolean_true_node;
-
- if (TREE_CODE (type) != RECORD_TYPE)
- abort ();
-
- exp0 = save_if_needed (exp0);
- exp1 = save_if_needed (exp1);
-
- for (field = TYPE_FIELDS (type); field; field = TREE_CHAIN (field))
- {
- if (DECL_NAME (field) == NULL_TREE)
- {
- have_variants = 1;
- break;
- }
- }
-
- /* in case of -fpack we always do a memcmp */
- if (maximum_field_alignment != 0)
- {
- tree memcmp_func = lookup_name (get_identifier ("memcmp"));
- tree arg1 = force_addr_of (exp0);
- tree arg2 = force_addr_of (exp1);
- tree arg3 = size_in_bytes (type);
- tree fcall = build_chill_function_call (memcmp_func,
- tree_cons (NULL_TREE, arg1,
- tree_cons (NULL_TREE, arg2,
- tree_cons (NULL_TREE, arg3, NULL_TREE))));
-
- if (have_variants)
- warning ("comparison of variant structures is unsafe");
- result = build_chill_binary_op (EQ_EXPR, fcall, integer_zero_node);
- return result;
- }
-
- if (have_variants)
- {
- sorry ("compare with variant records");
- return error_mark_node;
- }
-
- for (field = TYPE_FIELDS (type); field; field = TREE_CHAIN (field))
- {
- tree exp0fld = build_component_ref (exp0, DECL_NAME (field));
- tree exp1fld = build_component_ref (exp1, DECL_NAME (field));
- tree eq_flds = build_chill_binary_op (EQ_EXPR, exp0fld, exp1fld);
- result = build_chill_binary_op (TRUTH_AND_EXPR, result, eq_flds);
- }
- return result;
-}
-
-int
-compare_int_csts (op, val1, val2)
- enum tree_code op;
- tree val1, val2;
-{
- int result;
- tree tmp;
- tree type1 = TREE_TYPE (val1);
- tree type2 = TREE_TYPE (val2);
- switch (op)
- {
- case GT_EXPR:
- case GE_EXPR:
- tmp = val1; val1 = val2; val2 = tmp;
- tmp = type1; type1 = type2; type2 = tmp;
- op = (op == GT_EXPR) ? LT_EXPR : LE_EXPR;
- /* ... fall through ... */
- case LT_EXPR:
- case LE_EXPR:
- if (!TREE_UNSIGNED (type1))
- {
- if (!TREE_UNSIGNED (type2))
- result = INT_CST_LT (val1, val2);
- else if (TREE_INT_CST_HIGH (val1) < 0)
- result = 1;
- else
- result = INT_CST_LT_UNSIGNED (val1, val2);
- }
- else
- {
- if (!TREE_UNSIGNED (type2) && TREE_INT_CST_HIGH (val2) < 0)
- result = 0;
- else
- result = INT_CST_LT_UNSIGNED (val1, val2);
- }
- if (op == LT_EXPR || result == 1)
- break;
- /* else fall through ... */
- case NE_EXPR:
- case EQ_EXPR:
- if (TREE_INT_CST_LOW (val1) == TREE_INT_CST_LOW (val2)
- && TREE_INT_CST_HIGH (val1) == TREE_INT_CST_HIGH (val2)
- /* They're bitwise equal.
- Check for one being negative and the other unsigned. */
- && (TREE_INT_CST_HIGH (val2) >= 0
- || TREE_UNSIGNED (TREE_TYPE (val1))
- == TREE_UNSIGNED (TREE_TYPE (val2))))
- result = 1;
- else
- result = 0;
- if (op == NE_EXPR)
- result = !result;
- break;
- default:
- abort();
- }
- return result;
-}
-
-/* Build an expression to compare discrete values VAL1 and VAL2.
- This does not check that they are discrete, nor that they are
- compatible; if you need such checks use build_compare_expr. */
-
-tree
-build_compare_discrete_expr (op, val1, val2)
- enum tree_code op;
- tree val1, val2;
-{
- tree type1 = TREE_TYPE (val1);
- tree type2 = TREE_TYPE (val2);
- tree tmp;
-
- if (TREE_CODE (val1) == INTEGER_CST && TREE_CODE (val2) == INTEGER_CST)
- {
- if (compare_int_csts (op, val1, val2))
- return boolean_true_node;
- else
- return boolean_false_node;
- }
-
- if (TREE_UNSIGNED (type1) != TREE_UNSIGNED (type2))
- {
- switch (op)
- {
- case GT_EXPR:
- case GE_EXPR:
- tmp = val1; val1 = val2; val2 = tmp;
- tmp = type1; type1 = type2; type2 = tmp;
- op = (op == GT_EXPR) ? LT_EXPR : LE_EXPR;
- /* ... fall through ... */
- case LT_EXPR:
- case LE_EXPR:
- if (TREE_UNSIGNED (type2))
- {
- tmp = build_int_2_wide (0, 0);
- TREE_TYPE (tmp) = type1;
- val1 = save_expr (val1);
- tmp = fold (build (LT_EXPR, boolean_type_node, val1, tmp));
- if (TYPE_PRECISION (type2) < TYPE_PRECISION (type1))
- {
- type2 = unsigned_type (type1);
- val2 = convert_to_integer (type2, val2);
- }
- val1 = convert_to_integer (type2, val1);
- return fold (build (TRUTH_OR_EXPR, boolean_type_node,
- tmp,
- fold (build (op, boolean_type_node,
- val1, val2))));
- }
- unsigned_vs_signed: /* val1 is unsigned, val2 is signed */
- tmp = build_int_2_wide (0, 0);
- TREE_TYPE (tmp) = type2;
- val2 = save_expr (val2);
- tmp = fold (build (GE_EXPR, boolean_type_node, val2, tmp));
- if (TYPE_PRECISION (type1) < TYPE_PRECISION (type2))
- {
- type1 = unsigned_type (type2);
- val1 = convert_to_integer (type1, val1);
- }
- val2 = convert_to_integer (type1, val2);
- return fold (build (TRUTH_AND_EXPR, boolean_type_node, tmp,
- fold (build (op, boolean_type_node,
- val1, val2))));
- case EQ_EXPR:
- if (TREE_UNSIGNED (val2))
- {
- tmp = val1; val1 = val2; val2 = tmp;
- tmp = type1; type1 = type2; type2 = tmp;
- }
- goto unsigned_vs_signed;
- case NE_EXPR:
- tmp = build_compare_expr (EQ_EXPR, val1, val2);
- return build_chill_unary_op (TRUTH_NOT_EXPR, tmp);
- default:
- abort();
- }
- }
- if (TYPE_PRECISION (type1) > TYPE_PRECISION (type2))
- val2 = convert (type1, val2);
- else if (TYPE_PRECISION (type1) < TYPE_PRECISION (type2))
- val1 = convert (type2, val1);
- return fold (build (op, boolean_type_node, val1, val2));
-}
-
-tree
-build_compare_expr (op, val1, val2)
- enum tree_code op;
- tree val1, val2;
-{
- tree tmp;
- tree type1, type2;
- val1 = check_have_mode (val1, "relational expression");
- val2 = check_have_mode (val2, "relational expression");
- if (val1 == NULL_TREE || TREE_CODE (val1) == ERROR_MARK)
- return error_mark_node;
- if (val2 == NULL_TREE || TREE_CODE (val2) == ERROR_MARK)
- return error_mark_node;
-
- if (pass == 1)
- return build (op, NULL_TREE, val1, val2);
-
- if (!CH_COMPATIBLE_CLASSES (val1, val2))
- {
- error ("incompatible operands to %s", boolean_code_name [op]);
- return error_mark_node;
- }
-
- tmp = CH_ROOT_MODE (TREE_TYPE (val1));
- if (tmp != TREE_TYPE (val1))
- val1 = convert (tmp, val1);
- tmp = CH_ROOT_MODE (TREE_TYPE (val2));
- if (tmp != TREE_TYPE (val2))
- val2 = convert (tmp, val2);
-
- type1 = TREE_TYPE (val1);
- type2 = TREE_TYPE (val2);
-
- if (TREE_CODE (type1) == SET_TYPE)
- tmp = build_compare_set_expr (op, val1, val2);
-
- else if (discrete_type_p (type1))
- tmp = build_compare_discrete_expr (op, val1, val2);
-
- else if (chill_varying_type_p (type1) || chill_varying_type_p (type2)
- || (TREE_CODE (type1) == ARRAY_TYPE
- && TREE_CODE (TREE_TYPE (type1)) == CHAR_TYPE)
- || (TREE_CODE (type2) == ARRAY_TYPE
- && TREE_CODE (TREE_TYPE (type2)) == CHAR_TYPE) )
- tmp = build_compare_string_expr (op, val1, val2);
-
- else if ((TREE_CODE (type1) == RECORD_TYPE
- || TREE_CODE (type2) == RECORD_TYPE)
- && (op == EQ_EXPR || op == NE_EXPR))
- {
- /* This is for handling INSTANCEs being compared against NULL. */
- if (val1 == null_pointer_node)
- val1 = convert (type2, val1);
- if (val2 == null_pointer_node)
- val2 = convert (type1, val2);
-
- tmp = compare_records (val1, val2);
- if (op == NE_EXPR)
- tmp = build_chill_unary_op (TRUTH_NOT_EXPR, tmp);
- }
-
- else if (TREE_CODE (type1) == REAL_TYPE || TREE_CODE (type2) == REAL_TYPE
- || (op == EQ_EXPR || op == NE_EXPR))
- {
- tmp = build (op, boolean_type_node, val1, val2);
- CH_DERIVED_FLAG (tmp) = 1; /* Optimization to avoid copy_node. */
- tmp = fold (tmp);
- }
-
- else
- {
- error ("relational operator not allowed for this mode");
- return error_mark_node;
- }
-
- if (!CH_DERIVED_FLAG (tmp))
- {
- tmp = copy_node (tmp);
- CH_DERIVED_FLAG (tmp) = 1;
- }
- return tmp;
-}
-
-tree
-finish_chill_binary_op (node)
- tree node;
-{
- tree op0 = check_have_mode (TREE_OPERAND (node, 0), "binary expression");
- tree op1 = check_have_mode (TREE_OPERAND (node, 1), "binary expression");
- tree type0 = TREE_TYPE (op0);
- tree type1 = TREE_TYPE (op1);
- tree folded;
-
- if (TREE_CODE (op0) == ERROR_MARK || TREE_CODE (op1) == ERROR_MARK)
- return error_mark_node;
-
- if (UNSATISFIED (op0) || UNSATISFIED (op1))
- {
- UNSATISFIED_FLAG (node) = 1;
- return node;
- }
-#if 0
- /* assure that both operands have a type */
- if (! type0 && type1)
- {
- op0 = convert (type1, op0);
- type0 = TREE_TYPE (op0);
- }
- if (! type1 && type0)
- {
- op1 = convert (type0, op1);
- type1 = TREE_TYPE (op1);
- }
-#endif
- UNSATISFIED_FLAG (node) = 0;
-#if 0
-
- { int op0f = TREE_CODE (op0) == FUNCTION_DECL;
- int op1f = TREE_CODE (op1) == FUNCTION_DECL;
- if (op0f)
- op0 = convert (build_pointer_type (TREE_TYPE (op0)), op0);
- if (op1f)
- op1 = convert (build_pointer_type (TREE_TYPE (op1)), op1);
- if ((op0f || op1f)
- && code != EQ_EXPR && code != NE_EXPR)
- error ("Cannot use %s operator on PROC mode variable",
- tree_code_name[(int)code]);
- }
-
- if (invalid_left_operand (type0, code))
- {
- error ("invalid left operand of %s", tree_code_name[(int)code]);
- return error_mark_node;
- }
- if (invalid_right_operand (code, type1))
- {
- error ("invalid right operand of %s", tree_code_name[(int)code]);
- return error_mark_node;
- }
-#endif
-
- switch (TREE_CODE (node))
- {
- case CONCAT_EXPR:
- return build_concat_expr (op0, op1);
-
- case REPLICATE_EXPR:
- op0 = fold (op0);
- if (!TREE_CONSTANT (op0) || !TREE_CONSTANT (op1))
- {
- error ("repetition expression must be constant");
- return error_mark_node;
- }
- else
- return build_chill_repetition_op (op0, op1);
-
- case FLOOR_MOD_EXPR:
- case TRUNC_MOD_EXPR:
- if (TREE_CODE (type0) != INTEGER_TYPE)
- {
- error ("left argument to MOD/REM operator must be integral");
- return error_mark_node;
- }
- if (TREE_CODE (type1) != INTEGER_TYPE)
- {
- error ("right argument to MOD/REM operator must be integral");
- return error_mark_node;
- }
- break;
-
- case MINUS_EXPR:
- if (TREE_CODE (type1) == SET_TYPE)
- {
- tree temp = fold_set_expr (MINUS_EXPR, op0, op1);
-
- if (temp)
- return temp;
- if (TYPE_MODE (type1) == BLKmode)
- TREE_SET_CODE (node, SET_DIFF_EXPR);
- else
- {
- op1 = build_chill_unary_op (BIT_NOT_EXPR, op1);
- TREE_OPERAND (node, 1) = op1;
- TREE_SET_CODE (node, BIT_AND_EXPR);
- }
- }
- break;
-
- case TRUNC_DIV_EXPR:
- if (TREE_CODE (type0) == REAL_TYPE || TREE_CODE (type1) == REAL_TYPE)
- TREE_SET_CODE (node, RDIV_EXPR);
- break;
-
- case BIT_AND_EXPR:
- if (TYPE_MODE (type1) == BLKmode)
- TREE_SET_CODE (node, SET_AND_EXPR);
- goto fold_set_binop;
- case BIT_IOR_EXPR:
- if (TYPE_MODE (type1) == BLKmode)
- TREE_SET_CODE (node, SET_IOR_EXPR);
- goto fold_set_binop;
- case BIT_XOR_EXPR:
- if (TYPE_MODE (type1) == BLKmode)
- TREE_SET_CODE (node, SET_XOR_EXPR);
- goto fold_set_binop;
- case SET_AND_EXPR:
- case SET_IOR_EXPR:
- case SET_XOR_EXPR:
- case SET_DIFF_EXPR:
- fold_set_binop:
- if (TREE_CODE (type0) == SET_TYPE)
- {
- tree temp = fold_set_expr (TREE_CODE (node), op0, op1);
-
- if (temp)
- return temp;
- }
- break;
-
- case SET_IN_EXPR:
- if (TREE_CODE (type1) != SET_TYPE || CH_BOOLS_TYPE_P (type1))
- {
- error ("right operand of IN is not a powerset");
- return error_mark_node;
- }
- if (!CH_COMPATIBLE (op0, TYPE_DOMAIN (type1)))
- {
- error ("left operand of IN incompatible with right operand");
- return error_mark_node;
- }
- type0 = CH_ROOT_MODE (type0);
- if (type0 != TREE_TYPE (op0))
- TREE_OPERAND (node, 0) = op0 = convert (type0, op0);
- TREE_TYPE (node) = boolean_type_node;
- CH_DERIVED_FLAG (node) = 1;
- node = fold (node);
- if (!CH_DERIVED_FLAG (node))
- {
- node = copy_node (node);
- CH_DERIVED_FLAG (node) = 1;
- }
- return node;
- case NE_EXPR:
- case EQ_EXPR:
- case GE_EXPR:
- case GT_EXPR:
- case LE_EXPR:
- case LT_EXPR:
- return build_compare_expr (TREE_CODE (node), op0, op1);
- default:
- ;
- }
-
- if (!CH_COMPATIBLE_CLASSES (op0, op1))
- {
- error ("incompatible operands to %s", tree_code_name[(int) TREE_CODE (node)]);
- return error_mark_node;
- }
-
- if (TREE_TYPE (node) == NULL_TREE)
- {
- struct ch_class class;
- class = CH_ROOT_RESULTING_CLASS (op0, op1);
- TREE_OPERAND (node, 0) = op0 = convert_to_class (class, op0);
- type0 = TREE_TYPE (op0);
- TREE_OPERAND (node, 1) = op1 = convert_to_class (class, op1);
- type1 = TREE_TYPE (op1);
- TREE_TYPE (node) = class.mode;
- folded = convert_to_class (class, fold (node));
- }
- else
- folded = fold (node);
-#if 0
- if (folded == node)
- TREE_CONSTANT (folded) = TREE_CONSTANT (op0) & TREE_CONSTANT (op1);
-#endif
- if (TREE_CODE (node) == TRUNC_DIV_EXPR)
- {
- if (TREE_CONSTANT (op1))
- {
- if (tree_int_cst_equal (op1, integer_zero_node))
- {
- error ("division by zero");
- return integer_zero_node;
- }
- }
- else if (range_checking)
- {
-#if 0
- tree test =
- build (EQ_EXPR, boolean_type_node, op1, integer_zero_node);
- /* Should this be overflow? */
- folded = check_expression (folded, test,
- ridpointers[(int) RID_RANGEFAIL]);
-#endif
- }
- }
- return folded;
-}
-
-/*
- * This implements the '->' operator, which, like the '&' in C,
- * returns a pointer to an object, which has the type of
- * pointer-to-that-object.
- *
- * FORCE is 0 when we're evaluating a user-level syntactic construct,
- * and 1 when we're calling from inside the compiler.
- */
-tree
-build_chill_arrow_expr (ref, force)
- tree ref;
- int force;
-{
- tree addr_type;
- tree result;
-
- if (pass == 1)
- {
- error ("-> operator not allow in constant expression");
- return error_mark_node;
- }
-
- if (ref == NULL_TREE || TREE_CODE (ref) == ERROR_MARK)
- return ref;
-
- while (TREE_CODE (TREE_TYPE (ref)) == REFERENCE_TYPE)
- ref = convert (TREE_TYPE (TREE_TYPE (ref)), ref);
-
- if (!force && ! CH_LOCATION_P (ref))
- {
- if (TREE_CODE (ref) == STRING_CST)
- pedwarn ("taking the address of a string literal is non-standard");
- else if (TREE_CODE (TREE_TYPE (ref)) == FUNCTION_TYPE)
- pedwarn ("taking the address of a function is non-standard");
- else
- {
- error ("ADDR requires a LOCATION argument");
- return error_mark_node;
- }
- /* FIXME: Should we be sure that ref isn't a
- function if we're being pedantic? */
- }
-
- addr_type = build_pointer_type (TREE_TYPE (ref));
-
-#if 0
- /* This transformation makes chill_expr_class return CH_VALUE_CLASS
- when it should return CH_REFERENCE_CLASS. That could be fixed,
- but we probably don't want this transformation anyway. */
- if (TREE_CODE (ref) == NOP_EXPR) /* RETYPE_EXPR */
- {
- tree addr;
- while (TREE_CODE (ref) == NOP_EXPR) /* RETYPE_EXPR */
- ref = TREE_OPERAND (ref, 0);
- mark_addressable (ref);
- addr = build1 (ADDR_EXPR,
- build_pointer_type (TREE_TYPE (ref)), ref);
- return build1 (NOP_EXPR, /* RETYPE_EXPR */
- addr_type,
- addr);
- }
- else
-#endif
- {
- if (! mark_addressable (ref))
- {
- error ("-> expression is not addressable");
- return error_mark_node;
- }
- result = build1 (ADDR_EXPR, addr_type, ref);
- if (staticp (ref)
- && ! (TREE_CODE (ref) == FUNCTION_DECL
- && DECL_CONTEXT (ref) != 0))
- TREE_CONSTANT (result) = 1;
- return result;
- }
-}
-
-/*
- * This implements the ADDR builtin function, which returns a
- * free reference, analogous to the C 'void *'.
- */
-tree
-build_chill_addr_expr (ref, errormsg)
- tree ref;
- const char *errormsg;
-{
- if (ref == error_mark_node)
- return ref;
-
- if (! CH_LOCATION_P (ref)
- && TREE_CODE (TREE_TYPE (ref)) != FUNCTION_TYPE)
- {
- error ("ADDR parameter must be a LOCATION");
- return error_mark_node;
- }
- ref = build_chill_arrow_expr (ref, 1);
-
- if (ref != NULL_TREE && TREE_CODE (ref) != ERROR_MARK)
- TREE_TYPE (ref) = ptr_type_node;
- else if (errormsg == NULL)
- {
- error ("possible internal error in build_chill_arrow_expr");
- return error_mark_node;
- }
- else
- {
- error ("%s is not addressable", errormsg);
- return error_mark_node;
- }
- return ref;
-}
-
-tree
-build_chill_binary_op (code, op0, op1)
- enum chill_tree_code code;
- tree op0, op1;
-{
- register tree result;
-
- if (op0 == NULL_TREE || TREE_CODE (op0) == ERROR_MARK)
- return error_mark_node;
- if (op1 == NULL_TREE || TREE_CODE (op1) == ERROR_MARK)
- return error_mark_node;
-
- result = build (code, NULL_TREE, op0, op1);
-
- if (pass != 1)
- result = finish_chill_binary_op (result);
- return result;
-}
-
-/*
- * process a string repetition phrase '(' COUNT ')' STRING
- */
-static tree
-string_char_rep (count, string)
- int count;
- tree string;
-{
- int slen, charindx, repcnt;
- char ch;
- char *temp;
- const char *inp;
- char *outp;
- tree type;
-
- if (string == NULL_TREE || TREE_CODE (string) == ERROR_MARK)
- return error_mark_node;
-
- type = TREE_TYPE (string);
- slen = int_size_in_bytes (type);
- temp = xmalloc (slen * count);
- inp = &ch;
- outp = temp;
- if (TREE_CODE (string) == STRING_CST)
- inp = TREE_STRING_POINTER (string);
- else /* single character */
- ch = (char)TREE_INT_CST_LOW (string);
-
- /* copy the string/char COUNT times into the output buffer */
- for (outp = temp, repcnt = 0; repcnt < count; repcnt++)
- for (charindx = 0; charindx < slen; charindx++)
- *outp++ = inp[charindx];
- return build_chill_string (slen * count, temp);
-}
-
-/* Build a bit-string constant containing with the given LENGTH
- containing all ones (if VALUE is true), or all zeros (if VALUE is false). */
-
-static tree
-build_boring_bitstring (length, value)
- long length;
- int value;
-{
- tree result;
- tree list; /* Value of CONSTRUCTOR_ELTS in the result. */
- if (value && length > 0)
- list = tree_cons (integer_zero_node, size_int (length - 1), NULL_TREE);
- else
- list = NULL_TREE;
-
- result = build (CONSTRUCTOR,
- build_bitstring_type (size_int (length)),
- NULL_TREE,
- list);
- TREE_CONSTANT (result) = 1;
- CH_DERIVED_FLAG (result) = 1;
- return result;
-}
-
-/*
- * handle a string repetition, with the syntax:
- * ( COUNT ) 'STRING'
- * COUNT is required to be constant, positive and folded.
- */
-tree
-build_chill_repetition_op (count_op, string)
- tree count_op;
- tree string;
-{
- int count;
- tree type = TREE_TYPE (string);
-
- if (TREE_CODE (count_op) != INTEGER_CST)
- {
- error ("repetition count is not an integer constant");
- return error_mark_node;
- }
-
- count = TREE_INT_CST_LOW (count_op);
-
- if (count < 0)
- {
- error ("repetition count < 0");
- return error_mark_node;
- }
- if (! TREE_CONSTANT (string))
- {
- error ("repetition value not constant");
- return error_mark_node;
- }
-
- if (TREE_CODE (string) == STRING_CST)
- return string_char_rep (count, string);
-
- switch ((int)TREE_CODE (type))
- {
- case BOOLEAN_TYPE:
- if (TREE_CODE (string) == INTEGER_CST)
- return build_boring_bitstring (count, TREE_INT_CST_LOW (string));
- error ("bitstring repetition of non-constant boolean");
- return error_mark_node;
-
- case CHAR_TYPE:
- return string_char_rep (count, string);
-
- case SET_TYPE:
- { int i, tree_const = 1;
- tree new_list = NULL_TREE;
- tree vallist;
- tree result;
- tree domain = TYPE_DOMAIN (type);
- tree orig_length;
- HOST_WIDE_INT orig_len;
-
- if (!CH_BOOLS_TYPE_P (type)) /* cannot replicate a powerset */
- break;
-
- orig_length = discrete_count (domain);
-
- if (TREE_CODE (string) != CONSTRUCTOR || !TREE_CONSTANT (string)
- || TREE_CODE (orig_length) != INTEGER_CST)
- {
- error ("string repetition operand is non-constant bitstring");
- return error_mark_node;
- }
-
-
- orig_len = TREE_INT_CST_LOW (orig_length);
-
- /* if the set is empty, this is NULL */
- vallist = TREE_OPERAND (string, 1);
-
- if (vallist == NULL_TREE) /* No bits are set. */
- return build_boring_bitstring (count * orig_len, 0);
- else if (TREE_CHAIN (vallist) == NULL_TREE
- && (TREE_PURPOSE (vallist) == NULL_TREE
- ? (orig_len == 1
- && tree_int_cst_equal (TYPE_MIN_VALUE (domain),
- TREE_VALUE (vallist)))
- : (tree_int_cst_equal (TYPE_MIN_VALUE (domain),
- TREE_PURPOSE (vallist))
- && tree_int_cst_equal (TYPE_MAX_VALUE (domain),
- TREE_VALUE (vallist)))))
- return build_boring_bitstring (count * orig_len, 1);
-
- for (i = 0; i < count; i++)
- {
- tree origin = build_int_2 (i * orig_len, 0);
- tree temp;
-
- /* scan down the given value list, building
- new bit-positions */
- for (temp = vallist; temp; temp = TREE_CHAIN (temp))
- {
- tree new_value
- = fold (build (PLUS_EXPR, TREE_TYPE (origin),
- TREE_VALUE (temp)));
- tree new_purpose = NULL_TREE;
-
- if (! TREE_CONSTANT (TREE_VALUE (temp)))
- tree_const = 0;
- if (TREE_PURPOSE (temp))
- {
- new_purpose = fold (build (PLUS_EXPR, TREE_TYPE (origin),
- origin, TREE_PURPOSE (temp)));
- if (! TREE_CONSTANT (TREE_PURPOSE (temp)))
- tree_const = 0;
- }
-
- new_list = tree_cons (new_purpose,
- new_value, new_list);
- }
- }
- result = build (CONSTRUCTOR,
- build_bitstring_type (size_int (count * orig_len)),
- NULL_TREE, nreverse (new_list));
- TREE_CONSTANT (result) = tree_const;
- CH_DERIVED_FLAG (result) = CH_DERIVED_FLAG (string);
- return result;
- }
-
- default:
- error ("non-char, non-bit string repetition");
- return error_mark_node;
- }
- return error_mark_node;
-}
-
-tree
-finish_chill_unary_op (node)
- tree node;
-{
- enum chill_tree_code code = TREE_CODE (node);
- tree op0 = check_have_mode (TREE_OPERAND (node, 0), "unary expression");
- tree type0 = TREE_TYPE (op0);
- struct ch_class class;
-
- if (TREE_CODE (op0) == ERROR_MARK)
- return error_mark_node;
- /* The expression codes of the data types of the arguments tell us
- whether the arguments are integers, floating, pointers, etc. */
-
- if (TREE_CODE (type0) == REFERENCE_TYPE)
- {
- op0 = convert (TREE_TYPE (type0), op0);
- type0 = TREE_TYPE (op0);
- }
-
- if (invalid_right_operand (code, type0))
- {
- error ("invalid operand of %s",
- tree_code_name[(int)code]);
- return error_mark_node;
- }
- switch ((int)TREE_CODE (type0))
- {
- case ARRAY_TYPE:
- if (TREE_CODE ( TREE_TYPE (type0)) == BOOLEAN_TYPE)
- code = SET_NOT_EXPR;
- else
- {
- error ("right operand of %s is not array of boolean",
- tree_code_name[(int)code]);
- return error_mark_node;
- }
- break;
- case BOOLEAN_TYPE:
- switch ((int)code)
- {
- case BIT_NOT_EXPR:
- case TRUTH_NOT_EXPR:
- return invert_truthvalue (truthvalue_conversion (op0));
-
- default:
- error ("%s operator applied to boolean variable",
- tree_code_name[(int)code]);
- return error_mark_node;
- }
- break;
-
- case SET_TYPE:
- switch ((int)code)
- {
- case BIT_NOT_EXPR:
- case NEGATE_EXPR:
- {
- tree temp = fold_set_expr (BIT_NOT_EXPR, op0, NULL_TREE);
-
- if (temp)
- return temp;
-
- code = SET_NOT_EXPR;
- }
- break;
-
- default:
- error ("invalid right operand of %s", tree_code_name[(int)code]);
- return error_mark_node;
- }
-
- }
-
- class = chill_expr_class (op0);
- if (class.mode)
- class.mode = CH_ROOT_MODE (class.mode);
- TREE_SET_CODE (node, code);
- TREE_OPERAND (node, 0) = op0 = convert_to_class (class, op0);
- TREE_TYPE (node) = TREE_TYPE (op0);
-
- node = convert_to_class (class, fold (node));
-
- /* FIXME: should call
- * cond_type_range_exception (op0);
- */
- return node;
-}
-
-/* op is TRUTH_NOT_EXPR, BIT_NOT_EXPR, or NEGATE_EXPR */
-
-tree
-build_chill_unary_op (code, op0)
- enum chill_tree_code code;
- tree op0;
-{
- register tree result = NULL_TREE;
-
- if (op0 == NULL_TREE || TREE_CODE (op0) == ERROR_MARK)
- return error_mark_node;
-
- result = build1 (code, NULL_TREE, op0);
-
- if (pass != 1)
- result = finish_chill_unary_op (result);
- return result;
-}
-
-tree
-truthvalue_conversion (expr)
- tree expr;
-{
- if (expr == NULL_TREE || TREE_CODE (expr) == ERROR_MARK)
- return error_mark_node;
-
-#if 0 /* what about a LE_EXPR (integer_type, integer_type ) */
- if (TREE_CODE (TREE_TYPE (expr)) != BOOLEAN_TYPE)
- error ("non-boolean mode in conditional expression");
-#endif
-
- switch ((int)TREE_CODE (expr))
- {
- /* It is simpler and generates better code to have only TRUTH_*_EXPR
- or comparison expressions as truth values at this level. */
-#if 0
- case COMPONENT_REF:
- /* A one-bit unsigned bit-field is already acceptable. */
- if (1 == TREE_INT_CST_LOW (DECL_SIZE (TREE_OPERAND (expr, 1)))
- && TREE_UNSIGNED (TREE_OPERAND (expr, 1)))
- return expr;
- break;
-#endif
-
- case EQ_EXPR:
- /* It is simpler and generates better code to have only TRUTH_*_EXPR
- or comparison expressions as truth values at this level. */
- case NE_EXPR: case LE_EXPR: case GE_EXPR: case LT_EXPR: case GT_EXPR:
- case TRUTH_ANDIF_EXPR:
- case TRUTH_ORIF_EXPR:
- case TRUTH_AND_EXPR:
- case TRUTH_OR_EXPR:
- case ERROR_MARK:
- return expr;
-
- case INTEGER_CST:
- return integer_zerop (expr) ? boolean_false_node : boolean_true_node;
-
- case REAL_CST:
- return real_zerop (expr) ? boolean_false_node : boolean_true_node;
-
- case ADDR_EXPR:
- if (TREE_SIDE_EFFECTS (TREE_OPERAND (expr, 0)))
- return build (COMPOUND_EXPR, boolean_type_node,
- TREE_OPERAND (expr, 0), boolean_true_node);
- else
- return boolean_true_node;
-
- case NEGATE_EXPR:
- case ABS_EXPR:
- case FLOAT_EXPR:
- case FFS_EXPR:
- /* These don't change whether an object is non-zero or zero. */
- return truthvalue_conversion (TREE_OPERAND (expr, 0));
-
- case LROTATE_EXPR:
- case RROTATE_EXPR:
- /* These don't change whether an object is zero or non-zero, but
- we can't ignore them if their second arg has side-effects. */
- if (TREE_SIDE_EFFECTS (TREE_OPERAND (expr, 1)))
- return build (COMPOUND_EXPR, boolean_type_node, TREE_OPERAND (expr, 1),
- truthvalue_conversion (TREE_OPERAND (expr, 0)));
- else
- return truthvalue_conversion (TREE_OPERAND (expr, 0));
-
- case COND_EXPR:
- /* Distribute the conversion into the arms of a COND_EXPR. */
- return fold (build (COND_EXPR, boolean_type_node, TREE_OPERAND (expr, 0),
- truthvalue_conversion (TREE_OPERAND (expr, 1)),
- truthvalue_conversion (TREE_OPERAND (expr, 2))));
-
- case CONVERT_EXPR:
- /* Don't cancel the effect of a CONVERT_EXPR from a REFERENCE_TYPE,
- since that affects how `default_conversion' will behave. */
- if (TREE_CODE (TREE_TYPE (expr)) == REFERENCE_TYPE
- || TREE_CODE (TREE_TYPE (TREE_OPERAND (expr, 0))) == REFERENCE_TYPE)
- break;
- /* fall through... */
- case NOP_EXPR:
- /* If this is widening the argument, we can ignore it. */
- if (TYPE_PRECISION (TREE_TYPE (expr))
- >= TYPE_PRECISION (TREE_TYPE (TREE_OPERAND (expr, 0))))
- return truthvalue_conversion (TREE_OPERAND (expr, 0));
- break;
-
- case BIT_XOR_EXPR:
- case MINUS_EXPR:
- /* These can be changed into a comparison of the two objects. */
- if (TREE_TYPE (TREE_OPERAND (expr, 0))
- == TREE_TYPE (TREE_OPERAND (expr, 1)))
- return build_chill_binary_op (NE_EXPR, TREE_OPERAND (expr, 0),
- TREE_OPERAND (expr, 1));
- return build_chill_binary_op (NE_EXPR, TREE_OPERAND (expr, 0),
- fold (build1 (NOP_EXPR,
- TREE_TYPE (TREE_OPERAND (expr, 0)),
- TREE_OPERAND (expr, 1))));
- }
-
- return build_chill_binary_op (NE_EXPR, expr, boolean_false_node);
-}
-
-
-/*
- * return a folded tree for the powerset's length in bits. If a
- * non-set is passed, we assume it's an array or boolean bytes.
- */
-tree
-powersetlen (powerset)
- tree powerset;
-{
- if (powerset == NULL_TREE || TREE_CODE (powerset) == ERROR_MARK)
- return error_mark_node;
-
- return discrete_count (TYPE_DOMAIN (TREE_TYPE (powerset)));
-}
diff --git a/gcc/ch/gperf b/gcc/ch/gperf
deleted file mode 100644
index c6edb6803b0..00000000000
--- a/gcc/ch/gperf
+++ /dev/null
@@ -1,166 +0,0 @@
-struct resword {
- const char *name;
- short token;
- enum rid rid;
- enum toktype { RESERVED, DIRECTIVE, PREDEF } flags;
-};
-extern tree ridpointers [];
-#ifdef __GNUC__
-__inline
-#endif
-static unsigned int hash PARAMS ((const char *, unsigned int));
-#ifdef __GNUC__
-__inline
-#endif
-struct resword *in_word_set PARAMS ((const char *, unsigned int));
-%%
-access, ACCESS, NORID, RESERVED
-after, AFTER, NORID, RESERVED
-all, ALL, NORID, RESERVED
-all_static_off, ALL_STATIC_OFF, NORID, DIRECTIVE
-all_static_on, ALL_STATIC_ON, NORID, DIRECTIVE
-and, AND, NORID, RESERVED
-andif, ANDIF, NORID, RESERVED
-array, ARRAY, NORID, RESERVED
-asm, ASM_KEYWORD, NORID, RESERVED
-assert, ASSERT, NORID, RESERVED
-at, AT, NORID, RESERVED
-based, BASED, NORID, RESERVED
-begin, BEGINTOKEN, NORID, RESERVED
-bin, BIN, NORID, RESERVED
-bit, BOOLS, RID_BOOLS, PREDEF
-body, BODY, NORID, RESERVED
-bools, BOOLS, RID_BOOLS, RESERVED
-buffer, BUFFER, NORID, RESERVED
-buffer_code, IGNORED_DIRECTIVE, NORID, DIRECTIVE
-by, BY, NORID, RESERVED
-call, CALL, NORID, RESERVED
-case, CASE, NORID, RESERVED
-cause, CAUSE, NORID, RESERVED
-ccitt_os, IGNORED_DIRECTIVE, NORID, DIRECTIVE
-chars, CHARS, NORID, RESERVED
-context, CONTEXT, NORID, RESERVED
-continue, CONTINUE, NORID, RESERVED
-cycle, CYCLE, NORID, RESERVED
-dcl, DCL, NORID, RESERVED
-debug_lines, IGNORED_DIRECTIVE, NORID, DIRECTIVE
-debug_symbols, IGNORED_DIRECTIVE, NORID, DIRECTIVE
-debug_types, IGNORED_DIRECTIVE, NORID, DIRECTIVE
-delay, DELAY, NORID, RESERVED
-do, DO, NORID, RESERVED
-down, DOWN, NORID, RESERVED
-dynamic, DYNAMIC, RID_DYNAMIC, RESERVED
-else, ELSE, NORID, RESERVED
-elsif, ELSIF, NORID, RESERVED
-empty_off, EMPTY_OFF, NORID, DIRECTIVE
-empty_on, EMPTY_ON, NORID, DIRECTIVE
-end, END, NORID, RESERVED
-esac, ESAC, NORID, RESERVED
-even, IGNORED_DIRECTIVE, NORID, DIRECTIVE
-event, EVENT, NORID, RESERVED
-event_code, IGNORED_DIRECTIVE, NORID, DIRECTIVE
-ever, EVER, NORID, RESERVED
-exceptions, EXCEPTIONS, NORID, RESERVED
-exit, EXIT, NORID, RESERVED
-extra_const_seg, IGNORED_DIRECTIVE, NORID, DIRECTIVE
-far, IGNORED_DIRECTIVE, NORID, DIRECTIVE
-fi, FI, NORID, RESERVED
-for, FOR, NORID, RESERVED
-forbid, FORBID, NORID, RESERVED
-general, GENERAL, NORID, RESERVED
-generate_all_set_names, IGNORED_DIRECTIVE, NORID, DIRECTIVE
-generate_set_names, IGNORED_DIRECTIVE, NORID, DIRECTIVE
-goto, GOTO, NORID, RESERVED
-grant, GRANT, NORID, RESERVED
-grant_file_size, IGNORED_DIRECTIVE, NORID, DIRECTIVE
-if, IF, NORID, RESERVED
-in, IN, RID_IN, RESERVED
-init, INIT, NORID, RESERVED
-inline, INLINE, RID_INLINE, RESERVED
-inout, PARAMATTR, RID_INOUT, RESERVED
-large, IGNORED_DIRECTIVE, NORID, DIRECTIVE
-list, IGNORED_DIRECTIVE, NORID, DIRECTIVE
-loc, LOC, NORID, RESERVED
-make_publics_for_discrete_syns, IGNORED_DIRECTIVE, NORID, DIRECTIVE
-medium, IGNORED_DIRECTIVE, NORID, DIRECTIVE
-mod, MOD, NORID, RESERVED
-module, MODULE, NORID, RESERVED
-multiple_const_segs, IGNORED_DIRECTIVE, NORID, DIRECTIVE
-multiple_data_segs, IGNORED_DIRECTIVE, NORID, DIRECTIVE
-newmode, NEWMODE, NORID, RESERVED
-nolist, IGNORED_DIRECTIVE, NORID, DIRECTIVE
-no_overlap_check, IGNORED_DIRECTIVE, NORID, DIRECTIVE
-nonref, NONREF, NORID, RESERVED
-nopack, NOPACK, NORID, RESERVED
-not, NOT, NORID, RESERVED
-od, OD, NORID, RESERVED
-of, OF, NORID, RESERVED
-on, ON, NORID, RESERVED
-only_for_simulation, IGNORED_DIRECTIVE, NORID, DIRECTIVE
-only_for_target, IGNORED_DIRECTIVE, NORID, DIRECTIVE
-optimize, IGNORED_DIRECTIVE, NORID, DIRECTIVE
-optimize_runtime, IGNORED_DIRECTIVE, NORID, DIRECTIVE
-optimization_window, IGNORED_DIRECTIVE, NORID, DIRECTIVE
-or, OR, NORID, RESERVED
-orif, ORIF, NORID, RESERVED
-out, PARAMATTR, RID_OUT, RESERVED
-pack, PACK, NORID, RESERVED
-page, IGNORED_DIRECTIVE, NORID, DIRECTIVE
-pos, POS, NORID, RESERVED
-powerset, POWERSET, NORID, RESERVED
-prefixed, PREFIXED, NORID, RESERVED
-print_o_code, IGNORED_DIRECTIVE, NORID, DIRECTIVE
-print_symbol_table, IGNORED_DIRECTIVE, NORID, DIRECTIVE
-priority, PRIORITY, NORID, RESERVED
-proc, PROC, NORID, RESERVED
-process, PROCESS, NORID, RESERVED
-process_type, PROCESS_TYPE_TOKEN, NORID, DIRECTIVE
-range, RANGE, NORID, RESERVED
-range_off, RANGE_OFF, NORID, DIRECTIVE
-range_on, RANGE_ON, NORID, DIRECTIVE
-read, READ, RID_READ, RESERVED
-receive, RECEIVE, NORID, RESERVED
-recursive, RECURSIVE, NORID, RESERVED
-reentrant, IGNORED_DIRECTIVE, NORID, DIRECTIVE
-reentrant_all, IGNORED_DIRECTIVE, NORID, DIRECTIVE
-ref, REF, NORID, RESERVED
-region, REGION, NORID, RESERVED
-rem, REM, NORID, RESERVED
-remote, REMOTE, NORID, RESERVED
-result, RESULT, NORID, RESERVED
-return, RETURN, NORID, RESERVED
-returns, RETURNS, NORID, RESERVED
-row, ROW, NORID, RESERVED
-seize, SEIZE, NORID, RESERVED
-send, SEND, NORID, RESERVED
-send_buffer_default_priority, SEND_BUFFER_DEFAULT_PRIORITY, NORID, DIRECTIVE
-send_signal_default_priority, SEND_SIGNAL_DEFAULT_PRIORITY, NORID, DIRECTIVE
-set, SET, NORID, RESERVED
-short_pred_succ, IGNORED_DIRECTIVE, NORID, DIRECTIVE
-signal, SIGNAL, NORID, RESERVED
-signal_code, SIGNAL_CODE, NORID, DIRECTIVE
-signal_max_length, IGNORED_DIRECTIVE, NORID, DIRECTIVE
-simple, SIMPLE, NORID, RESERVED
-small, IGNORED_DIRECTIVE, NORID, DIRECTIVE
-spec, SPEC, NORID, RESERVED
-start, START, NORID, RESERVED
-state_routine, IGNORED_DIRECTIVE, NORID, DIRECTIVE
-static, STATIC, NORID, RESERVED
-step, STEP, NORID, RESERVED
-stop, STOP, NORID, RESERVED
-struct, STRUCT, NORID, RESERVED
-support_causing_address, IGNORED_DIRECTIVE, NORID, DIRECTIVE
-syn, SYN, NORID, RESERVED
-synmode, SYNMODE, NORID, RESERVED
-text, TEXT, NORID, RESERVED
-then, THEN, NORID, RESERVED
-this, THIS, NORID, RESERVED
-timeout, TIMEOUT, NORID, RESERVED
-to, TO, NORID, RESERVED
-up, UP, NORID, RESERVED
-use_seize_file, USE_SEIZE_FILE, NORID, DIRECTIVE
-use_seize_file_restricted, USE_SEIZE_FILE_RESTRICTED, NORID, DIRECTIVE
-varying, VARYING, NORID, RESERVED
-while, WHILE, NORID, RESERVED
-with, WITH, NORID, RESERVED
-xor, XOR, NORID, RESERVED
diff --git a/gcc/ch/grant.c b/gcc/ch/grant.c
deleted file mode 100644
index 29e7ddc1bb5..00000000000
--- a/gcc/ch/grant.c
+++ /dev/null
@@ -1,3061 +0,0 @@
-/* Implement grant-file output & seize-file input for CHILL.
- Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
- Free Software Foundation, Inc.
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-#include "config.h"
-#include "system.h"
-#include "tree.h"
-#include "ch-tree.h"
-#include "lex.h"
-#include "flags.h"
-#include "actions.h"
-#include "input.h"
-#include "rtl.h"
-#include "tasking.h"
-#include "toplev.h"
-#include "output.h"
-
-#define APPEND(X,Y) X = append (X, Y)
-#define PREPEND(X,Y) X = prepend (X, Y);
-#define FREE(x) strfree (x)
-#define ALLOCAMOUNT 10000
-/* may be we can handle this in a more exciting way,
- but this also should work for the moment */
-#define MAYBE_NEWLINE(X) \
-do \
-{ \
- if (X->len && X->str[X->len - 1] != '\n') \
- APPEND (X, ";\n"); \
-} while (0)
-
-extern tree process_type;
-extern char *asm_file_name;
-extern char *dump_base_name;
-
-/* forward declarations */
-
-/* variable indicates compilation at module level */
-int chill_at_module_level = 0;
-
-
-/* mark that a SPEC MODULE was generated */
-static int spec_module_generated = 0;
-
-/* define a faster string handling */
-typedef struct
-{
- char *str;
- int len;
- int allocated;
-} MYSTRING;
-
-/* structure used for handling multiple grant files */
-char *grant_file_name;
-MYSTRING *gstring = NULL;
-MYSTRING *selective_gstring = NULL;
-
-static MYSTRING *decode_decl PARAMS ((tree));
-static MYSTRING *decode_constant PARAMS ((tree));
-static void grant_one_decl PARAMS ((tree));
-static MYSTRING *get_type PARAMS ((tree));
-static MYSTRING *decode_mode PARAMS ((tree));
-static MYSTRING *decode_prefix_rename PARAMS ((tree));
-static MYSTRING *decode_constant_selective PARAMS ((tree, tree));
-static MYSTRING *decode_mode_selective PARAMS ((tree, tree));
-static MYSTRING *get_type_selective PARAMS ((tree, tree));
-static MYSTRING *decode_decl_selective PARAMS ((tree, tree));
-static MYSTRING *newstring PARAMS ((const char *));
-static void strfree PARAMS ((MYSTRING *));
-static MYSTRING *append PARAMS ((MYSTRING *, const char *));
-static MYSTRING *prepend PARAMS ((MYSTRING *, const char *));
-static void grant_use_seizefile PARAMS ((const char *));
-static MYSTRING *decode_layout PARAMS ((tree));
-static MYSTRING *grant_array_type PARAMS ((tree));
-static MYSTRING *grant_array_type_selective PARAMS ((tree, tree));
-static MYSTRING *get_tag_value PARAMS ((tree));
-static MYSTRING *get_tag_value_selective PARAMS ((tree, tree));
-static MYSTRING *print_enumeral PARAMS ((tree));
-static MYSTRING *print_enumeral_selective PARAMS ((tree, tree));
-static MYSTRING *print_integer_type PARAMS ((tree));
-static tree find_enum_parent PARAMS ((tree, tree));
-static MYSTRING *print_integer_selective PARAMS ((tree, tree));
-static MYSTRING *print_struct PARAMS ((tree));
-static MYSTRING *print_struct_selective PARAMS ((tree, tree));
-static MYSTRING *print_proc_exceptions PARAMS ((tree));
-static MYSTRING *print_proc_tail PARAMS ((tree, tree, int));
-static MYSTRING *print_proc_tail_selective PARAMS ((tree, tree, tree));
-static tree find_in_decls PARAMS ((tree, tree));
-static int in_ridpointers PARAMS ((tree));
-static void grant_seized_identifier PARAMS ((tree));
-static void globalize_decl PARAMS ((tree));
-static void grant_one_decl_selective PARAMS ((tree, tree));
-static int compare_memory_file PARAMS ((const char *, const char *));
-static int search_in_list PARAMS ((tree, tree));
-static int really_grant_this PARAMS ((tree, tree));
-
-/* list of the VAR_DECLs of the module initializer entries */
-tree module_init_list = NULL_TREE;
-
-/* handle different USE_SEIZE_FILE's in case of selective granting */
-typedef struct SEIZEFILELIST
-{
- struct SEIZEFILELIST *next;
- tree filename;
- MYSTRING *seizes;
-} seizefile_list;
-
-static seizefile_list *selective_seizes = 0;
-
-
-static MYSTRING *
-newstring (str)
- const char *str;
-{
- MYSTRING *tmp = (MYSTRING *) xmalloc (sizeof (MYSTRING));
- unsigned len = strlen (str);
-
- tmp->allocated = len + ALLOCAMOUNT;
- tmp->str = xmalloc ((unsigned)tmp->allocated);
- strcpy (tmp->str, str);
- tmp->len = len;
- return (tmp);
-}
-
-static void
-strfree (str)
- MYSTRING *str;
-{
- free (str->str);
- free (str);
-}
-
-static MYSTRING *
-append (inout, in)
- MYSTRING *inout;
- const char *in;
-{
- int inlen = strlen (in);
- int amount = ALLOCAMOUNT;
-
- if (inlen >= amount)
- amount += inlen;
- if ((inout->len + inlen) >= inout->allocated)
- inout->str = xrealloc (inout->str, inout->allocated += amount);
- strcpy (inout->str + inout->len, in);
- inout->len += inlen;
- return (inout);
-}
-
-static MYSTRING *
-prepend (inout, in)
- MYSTRING *inout;
- const char *in;
-{
- MYSTRING *res = inout;
- if (strlen (in))
- {
- res = newstring (in);
- res = APPEND (res, inout->str);
- FREE (inout);
- }
- return res;
-}
-
-static void
-grant_use_seizefile (seize_filename)
- const char *seize_filename;
-{
- APPEND (gstring, "<> USE_SEIZE_FILE \"");
- APPEND (gstring, seize_filename);
- APPEND (gstring, "\" <>\n");
-}
-
-static MYSTRING *
-decode_layout (layout)
- tree layout;
-{
- tree temp;
- tree stepsize = NULL_TREE;
- int was_step = 0;
- MYSTRING *result = newstring ("");
- MYSTRING *work;
-
- if (layout == integer_zero_node) /* NOPACK */
- {
- APPEND (result, " NOPACK");
- return result;
- }
-
- if (layout == integer_one_node) /* PACK */
- {
- APPEND (result, " PACK");
- return result;
- }
-
- APPEND (result, " ");
- temp = layout;
- if (TREE_PURPOSE (temp) == NULL_TREE)
- {
- APPEND (result, "STEP(");
- was_step = 1;
- temp = TREE_VALUE (temp);
- stepsize = TREE_VALUE (temp);
- }
- APPEND (result, "POS(");
-
- /* Get the starting word */
- temp = TREE_PURPOSE (temp);
- work = decode_constant (TREE_PURPOSE (temp));
- APPEND (result, work->str);
- FREE (work);
-
- temp = TREE_VALUE (temp);
- if (temp != NULL_TREE)
- {
- /* Get the starting bit */
- APPEND (result, ", ");
- work = decode_constant (TREE_PURPOSE (temp));
- APPEND (result, work->str);
- FREE (work);
-
- temp = TREE_VALUE (temp);
- if (temp != NULL_TREE)
- {
- /* Get the length or the ending bit */
- tree what = TREE_PURPOSE (temp);
- if (what == integer_zero_node) /* length */
- {
- APPEND (result, ", ");
- }
- else
- {
- APPEND (result, ":");
- }
- work = decode_constant (TREE_VALUE (temp));
- APPEND (result, work->str);
- FREE (work);
- }
- }
- APPEND (result, ")");
-
- if (was_step)
- {
- if (stepsize != NULL_TREE)
- {
- APPEND (result, ", ");
- work = decode_constant (stepsize);
- APPEND (result, work->str);
- FREE (work);
- }
- APPEND (result, ")");
- }
-
- return result;
-}
-
-static MYSTRING *
-grant_array_type (type)
- tree type;
-{
- MYSTRING *result = newstring ("");
- MYSTRING *mode_string;
- tree layout;
- int varying = 0;
-
- if (chill_varying_type_p (type))
- {
- varying = 1;
- type = CH_VARYING_ARRAY_TYPE (type);
- }
- if (CH_STRING_TYPE_P (type))
- {
- tree fields = TYPE_DOMAIN (type);
- tree maxval = TYPE_MAX_VALUE (fields);
-
- if (TREE_CODE (TREE_TYPE (type)) == CHAR_TYPE)
- APPEND (result, "CHARS (");
- else
- APPEND (result, "BOOLS (");
- if (TREE_CODE (maxval) == INTEGER_CST)
- {
- char wrk[20];
- sprintf (wrk, HOST_WIDE_INT_PRINT_DEC,
- TREE_INT_CST_LOW (maxval) + 1);
- APPEND (result, wrk);
- }
- else if (TREE_CODE (maxval) == MINUS_EXPR
- && TREE_OPERAND (maxval, 1) == integer_one_node)
- {
- mode_string = decode_constant (TREE_OPERAND (maxval, 0));
- APPEND (result, mode_string->str);
- FREE (mode_string);
- }
- else
- {
- mode_string = decode_constant (maxval);
- APPEND (result, mode_string->str);
- FREE (mode_string);
- APPEND (result, "+1");
- }
- APPEND (result, ")");
- if (varying)
- APPEND (result, " VARYING");
- return result;
- }
-
- APPEND (result, "ARRAY (");
- if (TREE_CODE (TYPE_DOMAIN (type)) == INTEGER_TYPE
- && TREE_TYPE (TYPE_DOMAIN (type)) == ridpointers[(int) RID_RANGE])
- {
- mode_string = decode_constant (TYPE_MIN_VALUE (TYPE_DOMAIN (type)));
- APPEND (result, mode_string->str);
- FREE (mode_string);
-
- APPEND (result, ":");
- mode_string = decode_constant (TYPE_MAX_VALUE (TYPE_DOMAIN (type)));
- APPEND (result, mode_string->str);
- FREE (mode_string);
- }
- else
- {
- mode_string = decode_mode (TYPE_DOMAIN (type));
- APPEND (result, mode_string->str);
- FREE (mode_string);
- }
- APPEND (result, ") ");
- if (varying)
- APPEND (result, "VARYING ");
-
- mode_string = get_type (TREE_TYPE (type));
- APPEND (result, mode_string->str);
- FREE (mode_string);
-
- layout = TYPE_ATTRIBUTES (type);
- if (layout != NULL_TREE)
- {
- mode_string = decode_layout (layout);
- APPEND (result, mode_string->str);
- FREE (mode_string);
- }
-
- return result;
-}
-
-static MYSTRING *
-grant_array_type_selective (type, all_decls)
- tree type;
- tree all_decls;
-{
- MYSTRING *result = newstring ("");
- MYSTRING *mode_string;
- int varying = 0;
-
- if (chill_varying_type_p (type))
- {
- varying = 1;
- type = CH_VARYING_ARRAY_TYPE (type);
- }
- if (CH_STRING_TYPE_P (type))
- {
- tree fields = TYPE_DOMAIN (type);
- tree maxval = TYPE_MAX_VALUE (fields);
-
- if (TREE_CODE (maxval) != INTEGER_CST)
- {
- if (TREE_CODE (maxval) == MINUS_EXPR
- && TREE_OPERAND (maxval, 1) == integer_one_node)
- {
- mode_string = decode_constant_selective (TREE_OPERAND (maxval, 0), all_decls);
- if (mode_string->len)
- APPEND (result, mode_string->str);
- FREE (mode_string);
- }
- else
- {
- mode_string = decode_constant_selective (maxval, all_decls);
- if (mode_string->len)
- APPEND (result, mode_string->str);
- FREE (mode_string);
- }
- }
- return result;
- }
-
- if (TREE_CODE (TYPE_DOMAIN (type)) == INTEGER_TYPE
- && TREE_TYPE (TYPE_DOMAIN (type)) == ridpointers[(int) RID_RANGE])
- {
- mode_string = decode_constant_selective (TYPE_MIN_VALUE (TYPE_DOMAIN (type)), all_decls);
- if (mode_string->len)
- APPEND (result, mode_string->str);
- FREE (mode_string);
-
- mode_string = decode_constant_selective (TYPE_MAX_VALUE (TYPE_DOMAIN (type)), all_decls);
- if (mode_string->len)
- {
- MAYBE_NEWLINE (result);
- APPEND (result, mode_string->str);
- }
- FREE (mode_string);
- }
- else
- {
- mode_string = decode_mode_selective (TYPE_DOMAIN (type), all_decls);
- if (mode_string->len)
- APPEND (result, mode_string->str);
- FREE (mode_string);
- }
-
- mode_string = get_type_selective (TREE_TYPE (type), all_decls);
- if (mode_string->len)
- {
- MAYBE_NEWLINE (result);
- APPEND (result, mode_string->str);
- }
- FREE (mode_string);
-
- return result;
-}
-
-static MYSTRING *
-get_tag_value (val)
- tree val;
-{
- MYSTRING *result;
-
- if (TREE_CODE (val) == CONST_DECL && DECL_NAME (val))
- {
- result = newstring (IDENTIFIER_POINTER (DECL_NAME (val)));
- }
- else if (TREE_CODE (val) == CONST_DECL)
- {
- /* it's a synonym -- get the value */
- result = decode_constant (DECL_INITIAL (val));
- }
- else
- {
- result = decode_constant (val);
- }
- return (result);
-}
-
-static MYSTRING *
-get_tag_value_selective (val, all_decls)
- tree val;
- tree all_decls;
-{
- MYSTRING *result;
-
- if (TREE_CODE (val) == CONST_DECL && DECL_NAME (val))
- result = newstring ("");
- else if (TREE_CODE (val) == CONST_DECL)
- {
- /* it's a synonym -- get the value */
- result = decode_constant_selective (DECL_INITIAL (val), all_decls);
- }
- else
- {
- result = decode_constant_selective (val, all_decls);
- }
- return (result);
-}
-
-static MYSTRING *
-print_enumeral (type)
- tree type;
-{
- MYSTRING *result = newstring ("");
- tree fields;
-
-#if 0
- if (TYPE_LANG_SPECIFIC (type) == NULL)
-#endif
- {
-
- APPEND (result, "SET (");
- for (fields = TYPE_VALUES (type);
- fields != NULL_TREE;
- fields = TREE_CHAIN (fields))
- {
- if (TREE_PURPOSE (fields) == NULL_TREE)
- APPEND (result, "*");
- else
- {
- tree decl = TREE_VALUE (fields);
- APPEND (result, IDENTIFIER_POINTER (TREE_PURPOSE (fields)));
- if (TREE_CODE (decl) == CONST_DECL && DECL_INITIAL (decl))
- {
- MYSTRING *val_string = decode_constant (DECL_INITIAL (decl));
- APPEND (result, " = ");
- APPEND (result, val_string->str);
- FREE (val_string);
- }
- }
- if (TREE_CHAIN (fields) != NULL_TREE)
- APPEND (result, ",\n ");
- }
- APPEND (result, ")");
- }
- return result;
-}
-
-static MYSTRING *
-print_enumeral_selective (type, all_decls)
- tree type;
- tree all_decls;
-{
- MYSTRING *result = newstring ("");
- tree fields;
-
- for (fields = TYPE_VALUES (type);
- fields != NULL_TREE;
- fields = TREE_CHAIN (fields))
- {
- if (TREE_PURPOSE (fields) != NULL_TREE)
- {
- tree decl = TREE_VALUE (fields);
- if (TREE_CODE (decl) == CONST_DECL && DECL_INITIAL (decl))
- {
- MYSTRING *val_string = decode_constant_selective (DECL_INITIAL (decl), all_decls);
- if (val_string->len)
- APPEND (result, val_string->str);
- FREE (val_string);
- }
- }
- }
- return result;
-}
-
-static MYSTRING *
-print_integer_type (type)
- tree type;
-{
- MYSTRING *result = newstring ("");
- MYSTRING *mode_string;
- const char *name_ptr;
- tree base_type;
-
- if (TREE_TYPE (type))
- {
- mode_string = decode_mode (TREE_TYPE (type));
- APPEND (result, mode_string->str);
- FREE (mode_string);
-
- APPEND (result, "(");
- mode_string = decode_constant (TYPE_MIN_VALUE (type));
- APPEND (result, mode_string->str);
- FREE (mode_string);
-
- if (TREE_TYPE (type) != ridpointers[(int) RID_BIN])
- {
- APPEND (result, ":");
- mode_string = decode_constant (TYPE_MAX_VALUE (type));
- APPEND (result, mode_string->str);
- FREE (mode_string);
- }
-
- APPEND (result, ")");
- return result;
- }
- /* We test TYPE_MAIN_VARIANT because pushdecl often builds
- a copy of a built-in type node, which is logically id-
- entical but has a different address, and the same
- TYPE_MAIN_VARIANT. */
- /* FIXME this should not be needed! */
-
- base_type = TREE_TYPE (type) ? TREE_TYPE (type) : type;
-
- if (TREE_UNSIGNED (base_type))
- {
- if (base_type == chill_unsigned_type_node
- || TYPE_MAIN_VARIANT(base_type) ==
- TYPE_MAIN_VARIANT (chill_unsigned_type_node))
- name_ptr = "UINT";
- else if (base_type == long_integer_type_node
- || TYPE_MAIN_VARIANT(base_type) ==
- TYPE_MAIN_VARIANT (long_unsigned_type_node))
- name_ptr = "ULONG";
- else if (type == unsigned_char_type_node
- || TYPE_MAIN_VARIANT(base_type) ==
- TYPE_MAIN_VARIANT (unsigned_char_type_node))
- name_ptr = "UBYTE";
- else if (type == duration_timing_type_node
- || TYPE_MAIN_VARIANT (base_type) ==
- TYPE_MAIN_VARIANT (duration_timing_type_node))
- name_ptr = "DURATION";
- else if (type == abs_timing_type_node
- || TYPE_MAIN_VARIANT (base_type) ==
- TYPE_MAIN_VARIANT (abs_timing_type_node))
- name_ptr = "TIME";
- else
- name_ptr = "UINT";
- }
- else
- {
- if (base_type == chill_integer_type_node
- || TYPE_MAIN_VARIANT (base_type) ==
- TYPE_MAIN_VARIANT (chill_integer_type_node))
- name_ptr = "INT";
- else if (base_type == long_integer_type_node
- || TYPE_MAIN_VARIANT (base_type) ==
- TYPE_MAIN_VARIANT (long_integer_type_node))
- name_ptr = "LONG";
- else if (type == signed_char_type_node
- || TYPE_MAIN_VARIANT (base_type) ==
- TYPE_MAIN_VARIANT (signed_char_type_node))
- name_ptr = "BYTE";
- else
- name_ptr = "INT";
- }
-
- APPEND (result, name_ptr);
-
- /* see if we have a range */
- if (TREE_TYPE (type) != NULL)
- {
- mode_string = decode_constant (TYPE_MIN_VALUE (type));
- APPEND (result, mode_string->str);
- FREE (mode_string);
- APPEND (result, ":");
- mode_string = decode_constant (TYPE_MAX_VALUE (type));
- APPEND (result, mode_string->str);
- FREE (mode_string);
- }
-
- return result;
-}
-
-static tree
-find_enum_parent (enumname, all_decls)
- tree enumname;
- tree all_decls;
-{
- tree wrk;
-
- for (wrk = all_decls; wrk != NULL_TREE; wrk = TREE_CHAIN (wrk))
- {
- if (TREE_TYPE (wrk) != NULL_TREE && TREE_CODE (wrk) != CONST_DECL &&
- TREE_CODE (TREE_TYPE (wrk)) == ENUMERAL_TYPE)
- {
- tree list;
- for (list = TYPE_VALUES (TREE_TYPE (wrk)); list != NULL_TREE; list = TREE_CHAIN (list))
- {
- if (DECL_NAME (TREE_VALUE (list)) == enumname)
- return wrk;
- }
- }
- }
- return NULL_TREE;
-}
-
-static MYSTRING *
-print_integer_selective (type, all_decls)
- tree type;
- tree all_decls;
-{
- MYSTRING *result = newstring ("");
- MYSTRING *mode_string;
-
- if (TREE_TYPE (type))
- {
- mode_string = decode_mode_selective (TREE_TYPE (type), all_decls);
- if (mode_string->len)
- APPEND (result, mode_string->str);
- FREE (mode_string);
-
- if (TREE_TYPE (type) == ridpointers[(int)RID_RANGE] &&
- TREE_CODE (TYPE_MIN_VALUE (type)) == IDENTIFIER_NODE &&
- TREE_CODE (TYPE_MAX_VALUE (type)) == IDENTIFIER_NODE)
- {
- /* we have a range of a set. Find parant mode and write it
- to SPEC MODULE. This will loose if the parent mode was SEIZED from
- another file.*/
- tree minparent = find_enum_parent (TYPE_MIN_VALUE (type), all_decls);
- tree maxparent = find_enum_parent (TYPE_MAX_VALUE (type), all_decls);
-
- if (minparent != NULL_TREE)
- {
- if (! CH_ALREADY_GRANTED (minparent))
- {
- mode_string = decode_decl (minparent);
- if (mode_string->len)
- APPEND (result, mode_string->str);
- FREE (mode_string);
- CH_ALREADY_GRANTED (minparent) = 1;
- }
- }
- if (minparent != maxparent && maxparent != NULL_TREE)
- {
- if (!CH_ALREADY_GRANTED (maxparent))
- {
- mode_string = decode_decl (maxparent);
- if (mode_string->len)
- {
- MAYBE_NEWLINE (result);
- APPEND (result, mode_string->str);
- }
- FREE (mode_string);
- CH_ALREADY_GRANTED (maxparent) = 1;
- }
- }
- }
- else
- {
- mode_string = decode_constant_selective (TYPE_MIN_VALUE (type), all_decls);
- if (mode_string->len)
- {
- MAYBE_NEWLINE (result);
- APPEND (result, mode_string->str);
- }
- FREE (mode_string);
-
- mode_string = decode_constant_selective (TYPE_MAX_VALUE (type), all_decls);
- if (mode_string->len)
- {
- MAYBE_NEWLINE (result);
- APPEND (result, mode_string->str);
- }
- FREE (mode_string);
- }
- return result;
- }
-
- /* see if we have a range */
- if (TREE_TYPE (type) != NULL)
- {
- mode_string = decode_constant_selective (TYPE_MIN_VALUE (type), all_decls);
- if (mode_string->len)
- APPEND (result, mode_string->str);
- FREE (mode_string);
-
- mode_string = decode_constant_selective (TYPE_MAX_VALUE (type), all_decls);
- if (mode_string->len)
- {
- MAYBE_NEWLINE (result);
- APPEND (result, mode_string->str);
- }
- FREE (mode_string);
- }
-
- return result;
-}
-
-static MYSTRING *
-print_struct (type)
- tree type;
-{
- MYSTRING *result = newstring ("");
- MYSTRING *mode_string;
- tree fields;
-
- if (chill_varying_type_p (type))
- {
- mode_string = grant_array_type (type);
- APPEND (result, mode_string->str);
- FREE (mode_string);
- }
- else
- {
- fields = TYPE_FIELDS (type);
-
- APPEND (result, "STRUCT (");
- while (fields != NULL_TREE)
- {
- if (TREE_CODE (TREE_TYPE (fields)) == UNION_TYPE)
- {
- tree variants;
- /* Format a tagged variant record type. */
- APPEND (result, " CASE ");
- if (TYPE_TAGFIELDS (TREE_TYPE (fields)) != NULL_TREE)
- {
- tree tag_list = TYPE_TAGFIELDS (TREE_TYPE (fields));
- for (;;)
- {
- tree tag_name = DECL_NAME (TREE_VALUE (tag_list));
- APPEND (result, IDENTIFIER_POINTER (tag_name));
- tag_list = TREE_CHAIN (tag_list);
- if (tag_list == NULL_TREE)
- break;
- APPEND (result, ", ");
- }
- }
- APPEND (result, " OF\n");
- variants = TYPE_FIELDS (TREE_TYPE (fields));
-
- /* Each variant is a FIELD_DECL whose type is an anonymous
- struct within the anonymous union. */
- while (variants != NULL_TREE)
- {
- tree tag_list = TYPE_TAG_VALUES (TREE_TYPE (variants));
- tree struct_elts = TYPE_FIELDS (TREE_TYPE (variants));
-
- while (tag_list != NULL_TREE)
- {
- tree tag_values = TREE_VALUE (tag_list);
- APPEND (result, " (");
- while (tag_values != NULL_TREE)
- {
- mode_string = get_tag_value (TREE_VALUE (tag_values));
- APPEND (result, mode_string->str);
- FREE (mode_string);
- if (TREE_CHAIN (tag_values) != NULL_TREE)
- {
- APPEND (result, ",\n ");
- tag_values = TREE_CHAIN (tag_values);
- }
- else break;
- }
- APPEND (result, ")");
- tag_list = TREE_CHAIN (tag_list);
- if (tag_list)
- APPEND (result, ",");
- else
- break;
- }
- APPEND (result, " : ");
-
- while (struct_elts != NULL_TREE)
- {
- mode_string = decode_decl (struct_elts);
- APPEND (result, mode_string->str);
- FREE (mode_string);
-
- if (TREE_CHAIN (struct_elts) != NULL_TREE)
- APPEND (result, ",\n ");
- struct_elts = TREE_CHAIN (struct_elts);
- }
-
- variants = TREE_CHAIN (variants);
- if (variants != NULL_TREE
- && TREE_CHAIN (variants) == NULL_TREE
- && DECL_NAME (variants) == ELSE_VARIANT_NAME)
- {
- tree else_elts = TYPE_FIELDS (TREE_TYPE (variants));
- APPEND (result, "\n ELSE ");
- while (else_elts != NULL_TREE)
- {
- mode_string = decode_decl (else_elts);
- APPEND (result, mode_string->str);
- FREE (mode_string);
- if (TREE_CHAIN (else_elts) != NULL_TREE)
- APPEND (result, ",\n ");
- else_elts = TREE_CHAIN (else_elts);
- }
- break;
- }
- if (variants != NULL_TREE)
- APPEND (result, ",\n");
- }
-
- APPEND (result, "\n ESAC");
- }
- else
- {
- mode_string = decode_decl (fields);
- APPEND (result, mode_string->str);
- FREE (mode_string);
- }
-
- fields = TREE_CHAIN (fields);
- if (fields != NULL_TREE)
- APPEND (result, ",\n ");
- }
- APPEND (result, ")");
- }
- return result;
-}
-
-static MYSTRING *
-print_struct_selective (type, all_decls)
- tree type;
- tree all_decls;
-{
- MYSTRING *result = newstring ("");
- MYSTRING *mode_string;
- tree fields;
-
- if (chill_varying_type_p (type))
- {
- mode_string = grant_array_type_selective (type, all_decls);
- if (mode_string->len)
- APPEND (result, mode_string->str);
- FREE (mode_string);
- }
- else
- {
- fields = TYPE_FIELDS (type);
-
- while (fields != NULL_TREE)
- {
- if (TREE_CODE (TREE_TYPE (fields)) == UNION_TYPE)
- {
- tree variants;
- /* Format a tagged variant record type. */
-
- variants = TYPE_FIELDS (TREE_TYPE (fields));
-
- /* Each variant is a FIELD_DECL whose type is an anonymous
- struct within the anonymous union. */
- while (variants != NULL_TREE)
- {
- tree tag_list = TYPE_TAG_VALUES (TREE_TYPE (variants));
- tree struct_elts = TYPE_FIELDS (TREE_TYPE (variants));
-
- while (tag_list != NULL_TREE)
- {
- tree tag_values = TREE_VALUE (tag_list);
- while (tag_values != NULL_TREE)
- {
- mode_string = get_tag_value_selective (TREE_VALUE (tag_values),
- all_decls);
- if (mode_string->len)
- {
- MAYBE_NEWLINE (result);
- APPEND (result, mode_string->str);
- }
- FREE (mode_string);
- if (TREE_CHAIN (tag_values) != NULL_TREE)
- tag_values = TREE_CHAIN (tag_values);
- else break;
- }
- tag_list = TREE_CHAIN (tag_list);
- if (!tag_list)
- break;
- }
-
- while (struct_elts != NULL_TREE)
- {
- mode_string = decode_decl_selective (struct_elts, all_decls);
- if (mode_string->len)
- {
- MAYBE_NEWLINE (result);
- APPEND (result, mode_string->str);
- }
- FREE (mode_string);
-
- struct_elts = TREE_CHAIN (struct_elts);
- }
-
- variants = TREE_CHAIN (variants);
- if (variants != NULL_TREE
- && TREE_CHAIN (variants) == NULL_TREE
- && DECL_NAME (variants) == ELSE_VARIANT_NAME)
- {
- tree else_elts = TYPE_FIELDS (TREE_TYPE (variants));
- while (else_elts != NULL_TREE)
- {
- mode_string = decode_decl_selective (else_elts, all_decls);
- if (mode_string->len)
- {
- MAYBE_NEWLINE (result);
- APPEND (result, mode_string->str);
- }
- FREE (mode_string);
- else_elts = TREE_CHAIN (else_elts);
- }
- break;
- }
- }
- }
- else
- {
- mode_string = decode_decl_selective (fields, all_decls);
- APPEND (result, mode_string->str);
- FREE (mode_string);
- }
-
- fields = TREE_CHAIN (fields);
- }
- }
- return result;
-}
-
-static MYSTRING *
-print_proc_exceptions (ex)
- tree ex;
-{
- MYSTRING *result = newstring ("");
-
- if (ex != NULL_TREE)
- {
- APPEND (result, "\n EXCEPTIONS (");
- for ( ; ex != NULL_TREE; ex = TREE_CHAIN (ex))
- {
- APPEND (result, IDENTIFIER_POINTER (TREE_VALUE (ex)));
- if (TREE_CHAIN (ex) != NULL_TREE)
- APPEND (result, ",\n ");
- }
- APPEND (result, ")");
- }
- return result;
-}
-
-static MYSTRING *
-print_proc_tail (type, args, print_argnames)
- tree type;
- tree args;
- int print_argnames;
-{
- MYSTRING *result = newstring ("");
- MYSTRING *mode_string;
- int count = 0;
- int stopat = list_length (args) - 3;
-
- /* do the argument modes */
- for ( ; args != NULL_TREE;
- args = TREE_CHAIN (args), count++)
- {
- char buf[20];
- tree argmode = TREE_VALUE (args);
- tree attribute = TREE_PURPOSE (args);
-
- if (argmode == void_type_node)
- continue;
-
- /* if we have exceptions don't print last 2 arguments */
- if (TYPE_RAISES_EXCEPTIONS (type) && count == stopat)
- break;
-
- if (count)
- APPEND (result, ",\n ");
- if (print_argnames)
- {
- sprintf(buf, "arg%d ", count);
- APPEND (result, buf);
- }
-
- if (attribute == ridpointers[(int) RID_LOC])
- argmode = TREE_TYPE (argmode);
- mode_string = get_type (argmode);
- APPEND (result, mode_string->str);
- FREE (mode_string);
-
- if (attribute != NULL_TREE)
- {
- sprintf (buf, " %s", IDENTIFIER_POINTER (attribute));
- APPEND (result, buf);
- }
- }
- APPEND (result, ")");
-
- /* return type */
- {
- tree retn_type = TREE_TYPE (type);
-
- if (retn_type != NULL_TREE
- && TREE_CODE (retn_type) != VOID_TYPE)
- {
- mode_string = get_type (retn_type);
- APPEND (result, "\n RETURNS (");
- APPEND (result, mode_string->str);
- FREE (mode_string);
- if (TREE_CODE (retn_type) == REFERENCE_TYPE)
- APPEND (result, " LOC");
- APPEND (result, ")");
- }
- }
-
- mode_string = print_proc_exceptions (TYPE_RAISES_EXCEPTIONS (type));
- APPEND (result, mode_string->str);
- FREE (mode_string);
-
- return result;
-}
-
-static MYSTRING *
-print_proc_tail_selective (type, args, all_decls)
- tree type;
- tree args;
- tree all_decls;
-{
- MYSTRING *result = newstring ("");
- MYSTRING *mode_string;
- int count = 0;
- int stopat = list_length (args) - 3;
-
- /* do the argument modes */
- for ( ; args != NULL_TREE;
- args = TREE_CHAIN (args), count++)
- {
- tree argmode = TREE_VALUE (args);
- tree attribute = TREE_PURPOSE (args);
-
- if (argmode == void_type_node)
- continue;
-
- /* if we have exceptions don't process last 2 arguments */
- if (TYPE_RAISES_EXCEPTIONS (type) && count == stopat)
- break;
-
- if (attribute == ridpointers[(int) RID_LOC])
- argmode = TREE_TYPE (argmode);
- mode_string = get_type_selective (argmode, all_decls);
- if (mode_string->len)
- {
- MAYBE_NEWLINE (result);
- APPEND (result, mode_string->str);
- }
- FREE (mode_string);
- }
-
- /* return type */
- {
- tree retn_type = TREE_TYPE (type);
-
- if (retn_type != NULL_TREE
- && TREE_CODE (retn_type) != VOID_TYPE)
- {
- mode_string = get_type_selective (retn_type, all_decls);
- if (mode_string->len)
- {
- MAYBE_NEWLINE (result);
- APPEND (result, mode_string->str);
- }
- FREE (mode_string);
- }
- }
-
- return result;
-}
-
-/* output a mode (or type). */
-
-static MYSTRING *
-decode_mode (type)
- tree type;
-{
- MYSTRING *result = newstring ("");
- MYSTRING *mode_string;
-
- switch ((enum chill_tree_code)TREE_CODE (type))
- {
- case TYPE_DECL:
- if (DECL_NAME (type))
- {
- APPEND (result, IDENTIFIER_POINTER (DECL_NAME (type)));
- return result;
- }
- type = TREE_TYPE (type);
- break;
-
- case IDENTIFIER_NODE:
- APPEND (result, IDENTIFIER_POINTER (type));
- return result;
-
- case LANG_TYPE:
- /* LANG_TYPE are only used until satisfy is done,
- as place-holders for 'READ T', NEWMODE/SYNMODE modes,
- parameterised modes, and old-fashioned CHAR(N). */
- if (TYPE_READONLY (type))
- APPEND (result, "READ ");
-
- mode_string = get_type (TREE_TYPE (type));
- APPEND (result, mode_string->str);
- if (TYPE_DOMAIN (type) != NULL_TREE)
- {
- /* Parameterized mode,
- or old-fashioned CHAR(N) string declaration.. */
- APPEND (result, "(");
- mode_string = decode_constant (TYPE_DOMAIN (type));
- APPEND (result, mode_string->str);
- APPEND (result, ")");
- }
- FREE (mode_string);
- break;
-
- case ARRAY_TYPE:
- mode_string = grant_array_type (type);
- APPEND (result, mode_string->str);
- FREE (mode_string);
- break;
-
- case BOOLEAN_TYPE:
- APPEND (result, "BOOL");
- break;
-
- case CHAR_TYPE:
- APPEND (result, "CHAR");
- break;
-
- case ENUMERAL_TYPE:
- mode_string = print_enumeral (type);
- APPEND (result, mode_string->str);
- FREE (mode_string);
- break;
-
- case FUNCTION_TYPE:
- {
- tree args = TYPE_ARG_TYPES (type);
-
- APPEND (result, "PROC (");
-
- mode_string = print_proc_tail (type, args, 0);
- APPEND (result, mode_string->str);
- FREE (mode_string);
- }
- break;
-
- case INTEGER_TYPE:
- mode_string = print_integer_type (type);
- APPEND (result, mode_string->str);
- FREE (mode_string);
- break;
-
- case RECORD_TYPE:
- if (CH_IS_INSTANCE_MODE (type))
- {
- APPEND (result, "INSTANCE");
- return result;
- }
- else if (CH_IS_BUFFER_MODE (type) || CH_IS_EVENT_MODE (type))
- { tree bufsize = max_queue_size (type);
- APPEND (result, CH_IS_BUFFER_MODE (type) ? "BUFFER " : "EVENT ");
- if (bufsize != NULL_TREE)
- {
- APPEND (result, "(");
- mode_string = decode_constant (bufsize);
- APPEND (result, mode_string->str);
- APPEND (result, ") ");
- FREE (mode_string);
- }
- if (CH_IS_BUFFER_MODE (type))
- {
- mode_string = decode_mode (buffer_element_mode (type));
- APPEND (result, mode_string->str);
- FREE (mode_string);
- }
- break;
- }
- else if (CH_IS_ACCESS_MODE (type))
- {
- tree indexmode, recordmode, dynamic;
-
- APPEND (result, "ACCESS");
- recordmode = access_recordmode (type);
- indexmode = access_indexmode (type);
- dynamic = access_dynamic (type);
-
- if (indexmode != void_type_node)
- {
- mode_string = decode_mode (indexmode);
- APPEND (result, " (");
- APPEND (result, mode_string->str);
- APPEND (result, ")");
- FREE (mode_string);
- }
- if (recordmode != void_type_node)
- {
- mode_string = decode_mode (recordmode);
- APPEND (result, " ");
- APPEND (result, mode_string->str);
- FREE (mode_string);
- }
- if (dynamic != integer_zero_node)
- APPEND (result, " DYNAMIC");
- break;
- }
- else if (CH_IS_TEXT_MODE (type))
- {
- tree indexmode, dynamic, length;
-
- APPEND (result, "TEXT (");
- length = text_length (type);
- indexmode = text_indexmode (type);
- dynamic = text_dynamic (type);
-
- mode_string = decode_constant (length);
- APPEND (result, mode_string->str);
- FREE (mode_string);
- APPEND (result, ")");
- if (indexmode != void_type_node)
- {
- APPEND (result, " ");
- mode_string = decode_mode (indexmode);
- APPEND (result, mode_string->str);
- FREE (mode_string);
- }
- if (dynamic != integer_zero_node)
- APPEND (result, " DYNAMIC");
- return result;
- }
- mode_string = print_struct (type);
- APPEND (result, mode_string->str);
- FREE (mode_string);
- break;
-
- case POINTER_TYPE:
- if (TREE_CODE (TREE_TYPE (type)) == VOID_TYPE)
- APPEND (result, "PTR");
- else
- {
- if (TREE_CODE (TREE_TYPE (type)) == FUNCTION_TYPE)
- {
- mode_string = get_type (TREE_TYPE (type));
- APPEND (result, mode_string->str);
- FREE (mode_string);
- }
- else
- {
- APPEND (result, "REF ");
- mode_string = get_type (TREE_TYPE (type));
- APPEND (result, mode_string->str);
- FREE (mode_string);
- }
- }
- break;
-
- case REAL_TYPE:
- if (TREE_INT_CST_LOW (TYPE_SIZE (type)) == 32)
- APPEND (result, "REAL");
- else
- APPEND (result, "LONG_REAL");
- break;
-
- case SET_TYPE:
- if (CH_BOOLS_TYPE_P (type))
- mode_string = grant_array_type (type);
- else
- {
- APPEND (result, "POWERSET ");
- mode_string = get_type (TYPE_DOMAIN (type));
- }
- APPEND (result, mode_string->str);
- FREE (mode_string);
- break;
-
- case REFERENCE_TYPE:
- mode_string = get_type (TREE_TYPE (type));
- APPEND (result, mode_string->str);
- FREE (mode_string);
- break;
-
- default:
- APPEND (result, "/* ---- not implemented ---- */");
- break;
- }
-
- return (result);
-}
-
-static tree
-find_in_decls (id, all_decls)
- tree id;
- tree all_decls;
-{
- tree wrk;
-
- for (wrk = all_decls; wrk != NULL_TREE; wrk = TREE_CHAIN (wrk))
- {
- if (DECL_NAME (wrk) == id || DECL_POSTFIX (wrk) == id)
- return wrk;
- }
- return NULL_TREE;
-}
-
-static int
-in_ridpointers (id)
- tree id;
-{
- int i;
- for (i = RID_UNUSED; i < RID_MAX; i++)
- {
- if (id == ridpointers[i])
- return 1;
- }
- return 0;
-}
-
-static void
-grant_seized_identifier (decl)
- tree decl;
-{
- seizefile_list *wrk = selective_seizes;
- MYSTRING *mode_string;
-
- CH_ALREADY_GRANTED (decl) = 1;
-
- /* comes from a SPEC MODULE in the module */
- if (DECL_SEIZEFILE (decl) == NULL_TREE)
- return;
-
- /* search file already in process */
- while (wrk != 0)
- {
- if (wrk->filename == DECL_SEIZEFILE (decl))
- break;
- wrk = wrk->next;
- }
- if (!wrk)
- {
- wrk = (seizefile_list *)xmalloc (sizeof (seizefile_list));
- wrk->next = selective_seizes;
- selective_seizes = wrk;
- wrk->filename = DECL_SEIZEFILE (decl);
- wrk->seizes = newstring ("<> USE_SEIZE_FILE \"");
- APPEND (wrk->seizes, IDENTIFIER_POINTER (DECL_SEIZEFILE (decl)));
- APPEND (wrk->seizes, "\" <>\n");
- }
- APPEND (wrk->seizes, "SEIZE ");
- mode_string = decode_prefix_rename (decl);
- APPEND (wrk->seizes, mode_string->str);
- FREE (mode_string);
- APPEND (wrk->seizes, ";\n");
-}
-
-static MYSTRING *
-decode_mode_selective (type, all_decls)
- tree type;
- tree all_decls;
-{
- MYSTRING *result = newstring ("");
- MYSTRING *mode_string;
- tree decl;
-
- switch ((enum chill_tree_code)TREE_CODE (type))
- {
- case TYPE_DECL:
- /* FIXME: could this ever happen ?? */
- if (DECL_NAME (type))
- {
- FREE (result);
- result = decode_mode_selective (DECL_NAME (type), all_decls);
- return result;
- }
- break;
-
- case IDENTIFIER_NODE:
- if (in_ridpointers (type))
- /* it's a predefined, we must not search the whole list */
- return result;
-
- decl = find_in_decls (type, all_decls);
- if (decl != NULL_TREE)
- {
- if (CH_ALREADY_GRANTED (decl))
- /* already processed */
- return result;
-
- if (TREE_CODE (decl) == ALIAS_DECL && DECL_POSTFIX (decl) != NULL_TREE)
- {
- /* If CH_DECL_GRANTED, decl was granted into this scope, and
- so wasn't in the source code. */
- if (!CH_DECL_GRANTED (decl))
- {
- grant_seized_identifier (decl);
- }
- }
- else
- {
- result = decode_decl (decl);
- mode_string = decode_decl_selective (decl, all_decls);
- if (mode_string->len)
- {
- PREPEND (result, mode_string->str);
- }
- FREE (mode_string);
- }
- }
- return result;
-
- case LANG_TYPE:
- mode_string = get_type_selective (TREE_TYPE (type), all_decls);
- APPEND (result, mode_string->str);
- FREE (mode_string);
- break;
-
- case ARRAY_TYPE:
- mode_string = grant_array_type_selective (type, all_decls);
- APPEND (result, mode_string->str);
- FREE (mode_string);
- break;
-
- case BOOLEAN_TYPE:
- return result;
- break;
-
- case CHAR_TYPE:
- return result;
- break;
-
- case ENUMERAL_TYPE:
- mode_string = print_enumeral_selective (type, all_decls);
- if (mode_string->len)
- APPEND (result, mode_string->str);
- FREE (mode_string);
- break;
-
- case FUNCTION_TYPE:
- {
- tree args = TYPE_ARG_TYPES (type);
-
- mode_string = print_proc_tail_selective (type, args, all_decls);
- if (mode_string->len)
- APPEND (result, mode_string->str);
- FREE (mode_string);
- }
- break;
-
- case INTEGER_TYPE:
- mode_string = print_integer_selective (type, all_decls);
- if (mode_string->len)
- APPEND (result, mode_string->str);
- FREE (mode_string);
- break;
-
- case RECORD_TYPE:
- if (CH_IS_INSTANCE_MODE (type))
- {
- return result;
- }
- else if (CH_IS_BUFFER_MODE (type) || CH_IS_EVENT_MODE (type))
- {
- tree bufsize = max_queue_size (type);
- if (bufsize != NULL_TREE)
- {
- mode_string = decode_constant_selective (bufsize, all_decls);
- if (mode_string->len)
- APPEND (result, mode_string->str);
- FREE (mode_string);
- }
- if (CH_IS_BUFFER_MODE (type))
- {
- mode_string = decode_mode_selective (buffer_element_mode (type), all_decls);
- if (mode_string->len)
- {
- MAYBE_NEWLINE (result);
- APPEND (result, mode_string->str);
- }
- FREE (mode_string);
- }
- break;
- }
- else if (CH_IS_ACCESS_MODE (type))
- {
- tree indexmode = access_indexmode (type);
- tree recordmode = access_recordmode (type);
-
- if (indexmode != void_type_node)
- {
- mode_string = decode_mode_selective (indexmode, all_decls);
- if (mode_string->len)
- {
- if (result->len && result->str[result->len - 1] != '\n')
- APPEND (result, ";\n");
- APPEND (result, mode_string->str);
- }
- FREE (mode_string);
- }
- if (recordmode != void_type_node)
- {
- mode_string = decode_mode_selective (recordmode, all_decls);
- if (mode_string->len)
- {
- if (result->len && result->str[result->len - 1] != '\n')
- APPEND (result, ";\n");
- APPEND (result, mode_string->str);
- }
- FREE (mode_string);
- }
- break;
- }
- else if (CH_IS_TEXT_MODE (type))
- {
- tree indexmode = text_indexmode (type);
- tree length = text_length (type);
-
- mode_string = decode_constant_selective (length, all_decls);
- if (mode_string->len)
- APPEND (result, mode_string->str);
- FREE (mode_string);
- if (indexmode != void_type_node)
- {
- mode_string = decode_mode_selective (indexmode, all_decls);
- if (mode_string->len)
- {
- if (result->len && result->str[result->len - 1] != '\n')
- APPEND (result, ";\n");
- APPEND (result, mode_string->str);
- }
- FREE (mode_string);
- }
- break;
- }
- mode_string = print_struct_selective (type, all_decls);
- if (mode_string->len)
- {
- MAYBE_NEWLINE (result);
- APPEND (result, mode_string->str);
- }
- FREE (mode_string);
- break;
-
- case POINTER_TYPE:
- if (TREE_CODE (TREE_TYPE (type)) == VOID_TYPE)
- break;
- else
- {
- if (TREE_CODE (TREE_TYPE (type)) == FUNCTION_TYPE)
- {
- mode_string = get_type_selective (TREE_TYPE (type), all_decls);
- if (mode_string->len)
- APPEND (result, mode_string->str);
- FREE (mode_string);
- }
- else
- {
- mode_string = get_type_selective (TREE_TYPE (type), all_decls);
- if (mode_string->len)
- APPEND (result, mode_string->str);
- FREE (mode_string);
- }
- }
- break;
-
- case REAL_TYPE:
- return result;
- break;
-
- case SET_TYPE:
- if (CH_BOOLS_TYPE_P (type))
- mode_string = grant_array_type_selective (type, all_decls);
- else
- mode_string = get_type_selective (TYPE_DOMAIN (type), all_decls);
- if (mode_string->len)
- APPEND (result, mode_string->str);
- FREE (mode_string);
- break;
-
- case REFERENCE_TYPE:
- mode_string = get_type_selective (TREE_TYPE (type), all_decls);
- if (mode_string->len)
- APPEND (result, mode_string->str);
- FREE (mode_string);
- break;
-
- default:
- APPEND (result, "/* ---- not implemented ---- */");
- break;
- }
-
- return (result);
-}
-
-static MYSTRING *
-get_type (type)
- tree type;
-{
- if (type == NULL_TREE || TREE_CODE (type) == ERROR_MARK)
- return newstring ("");
-
- return (decode_mode (type));
-}
-
-static MYSTRING *
-get_type_selective (type, all_decls)
- tree type;
- tree all_decls;
-{
- if (type == NULL_TREE || TREE_CODE (type) == ERROR_MARK)
- return newstring ("");
-
- return (decode_mode_selective (type, all_decls));
-}
-
-#if 0
-static int
-is_forbidden (str, forbid)
- tree str;
- tree forbid;
-{
- if (forbid == NULL_TREE)
- return (0);
-
- if (TREE_CODE (forbid) == INTEGER_CST)
- return (1);
-
- while (forbid != NULL_TREE)
- {
- if (TREE_VALUE (forbid) == str)
- return (1);
- forbid = TREE_CHAIN (forbid);
- }
- /* nothing found */
- return (0);
-}
-#endif
-
-static MYSTRING *
-decode_constant (init)
- tree init;
-{
- MYSTRING *result = newstring ("");
- MYSTRING *tmp_string;
- tree type = TREE_TYPE (init);
- tree val = init;
- const char *op;
- char wrk[256];
- MYSTRING *mode_string;
-
- switch ((enum chill_tree_code)TREE_CODE (val))
- {
- case CALL_EXPR:
- tmp_string = decode_constant (TREE_OPERAND (val, 0));
- APPEND (result, tmp_string->str);
- FREE (tmp_string);
- val = TREE_OPERAND (val, 1); /* argument list */
- if (val != NULL_TREE && TREE_CODE (val) != TREE_LIST)
- {
- APPEND (result, " ");
- tmp_string = decode_constant (val);
- APPEND (result, tmp_string->str);
- FREE (tmp_string);
- }
- else
- {
- APPEND (result, " (");
- if (val != NULL_TREE)
- {
- for (;;)
- {
- tmp_string = decode_constant (TREE_VALUE (val));
- APPEND (result, tmp_string->str);
- FREE (tmp_string);
- val = TREE_CHAIN (val);
- if (val == NULL_TREE)
- break;
- APPEND (result, ", ");
- }
- }
- APPEND (result, ")");
- }
- return result;
-
- case NOP_EXPR:
- /* Generate an "expression conversion" expression (a cast). */
- tmp_string = decode_mode (type);
-
- APPEND (result, tmp_string->str);
- FREE (tmp_string);
- APPEND (result, "(");
- val = TREE_OPERAND (val, 0);
- type = TREE_TYPE (val);
-
- /* If the coercee is a tuple, make sure it is prefixed by its mode. */
- if (TREE_CODE (val) == CONSTRUCTOR
- && !CH_BOOLS_TYPE_P (type) && !chill_varying_type_p (type))
- {
- tmp_string = decode_mode (type);
- APPEND (result, tmp_string->str);
- FREE (tmp_string);
- APPEND (result, " ");
- }
-
- tmp_string = decode_constant (val);
- APPEND (result, tmp_string->str);
- FREE (tmp_string);
- APPEND (result, ")");
- return result;
-
- case IDENTIFIER_NODE:
- APPEND (result, IDENTIFIER_POINTER (val));
- return result;
-
- case PAREN_EXPR:
- APPEND (result, "(");
- tmp_string = decode_constant (TREE_OPERAND (val, 0));
- APPEND (result, tmp_string->str);
- FREE (tmp_string);
- APPEND (result, ")");
- return result;
-
- case UNDEFINED_EXPR:
- APPEND (result, "*");
- return result;
-
- case PLUS_EXPR: op = "+"; goto binary;
- case MINUS_EXPR: op = "-"; goto binary;
- case MULT_EXPR: op = "*"; goto binary;
- case TRUNC_DIV_EXPR: op = "/"; goto binary;
- case FLOOR_MOD_EXPR: op = " MOD "; goto binary;
- case TRUNC_MOD_EXPR: op = " REM "; goto binary;
- case CONCAT_EXPR: op = "//"; goto binary;
- case BIT_IOR_EXPR: op = " OR "; goto binary;
- case BIT_XOR_EXPR: op = " XOR "; goto binary;
- case TRUTH_ORIF_EXPR: op = " ORIF "; goto binary;
- case BIT_AND_EXPR: op = " AND "; goto binary;
- case TRUTH_ANDIF_EXPR: op = " ANDIF "; goto binary;
- case GT_EXPR: op = ">"; goto binary;
- case GE_EXPR: op = ">="; goto binary;
- case SET_IN_EXPR: op = " IN "; goto binary;
- case LT_EXPR: op = "<"; goto binary;
- case LE_EXPR: op = "<="; goto binary;
- case EQ_EXPR: op = "="; goto binary;
- case NE_EXPR: op = "/="; goto binary;
- case RANGE_EXPR:
- if (TREE_OPERAND (val, 0) == NULL_TREE)
- {
- APPEND (result, TREE_OPERAND (val, 1) == NULL_TREE ? "*" : "ELSE");
- return result;
- }
- op = ":"; goto binary;
- binary:
- tmp_string = decode_constant (TREE_OPERAND (val, 0));
- APPEND (result, tmp_string->str);
- FREE (tmp_string);
- APPEND (result, op);
- tmp_string = decode_constant (TREE_OPERAND (val, 1));
- APPEND (result, tmp_string->str);
- FREE (tmp_string);
- return result;
-
- case REPLICATE_EXPR:
- APPEND (result, "(");
- tmp_string = decode_constant (TREE_OPERAND (val, 0));
- APPEND (result, tmp_string->str);
- FREE (tmp_string);
- APPEND (result, ")");
- tmp_string = decode_constant (TREE_OPERAND (val, 1));
- APPEND (result, tmp_string->str);
- FREE (tmp_string);
- return result;
-
- case NEGATE_EXPR: op = "-"; goto unary;
- case BIT_NOT_EXPR: op = " NOT "; goto unary;
- case ADDR_EXPR: op = "->"; goto unary;
- unary:
- APPEND (result, op);
- tmp_string = decode_constant (TREE_OPERAND (val, 0));
- APPEND (result, tmp_string->str);
- FREE (tmp_string);
- return result;
-
- case INTEGER_CST:
- APPEND (result, display_int_cst (val));
- return result;
-
- case REAL_CST:
-#ifndef REAL_IS_NOT_DOUBLE
- sprintf (wrk, "%.20g", TREE_REAL_CST (val));
-#else
- REAL_VALUE_TO_DECIMAL (TREE_REAL_CST (val), "%.20g", wrk);
-#endif
- APPEND (result, wrk);
- return result;
-
- case STRING_CST:
- {
- const char *ptr = TREE_STRING_POINTER (val);
- int i = TREE_STRING_LENGTH (val);
- APPEND (result, "\"");
- while (--i >= 0)
- {
- char buf[10];
- unsigned char c = *ptr++;
- if (c == '^')
- APPEND (result, "^^");
- else if (c == '"')
- APPEND (result, "\"\"");
- else if (c == '\n')
- APPEND (result, "^J");
- else if (c < ' ' || c > '~')
- {
- sprintf (buf, "^(%u)", c);
- APPEND (result, buf);
- }
- else
- {
- buf[0] = c;
- buf[1] = 0;
- APPEND (result, buf);
- }
- }
- APPEND (result, "\"");
- return result;
- }
-
- case CONSTRUCTOR:
- val = TREE_OPERAND (val, 1);
- if (type != NULL && TREE_CODE (type) == SET_TYPE
- && CH_BOOLS_TYPE_P (type))
- {
- /* It's a bitstring. */
- tree domain = TYPE_DOMAIN (type);
- tree domain_max = TYPE_MAX_VALUE (domain);
- char *buf;
- register char *ptr;
- int len;
- if (TREE_CODE (domain_max) != INTEGER_CST
- || (val && TREE_CODE (val) != TREE_LIST))
- goto fail;
-
- len = TREE_INT_CST_LOW (domain_max) + 1;
- if (TREE_CODE (init) != CONSTRUCTOR)
- goto fail;
- buf = (char *) alloca (len + 10);
- ptr = buf;
- *ptr++ = ' ';
- *ptr++ = 'B';
- *ptr++ = '\'';
- if (get_set_constructor_bits (init, ptr, len))
- goto fail;
- for (; --len >= 0; ptr++)
- *ptr += '0';
- *ptr++ = '\'';
- *ptr = '\0';
- APPEND (result, buf);
- return result;
- }
- else
- { /* It's some kind of tuple */
- if (type != NULL_TREE)
- {
- mode_string = get_type (type);
- APPEND (result, mode_string->str);
- FREE (mode_string);
- APPEND (result, " ");
- }
- if (val == NULL_TREE
- || TREE_CODE (val) == ERROR_MARK)
- APPEND (result, "[ ]");
- else if (TREE_CODE (val) != TREE_LIST)
- goto fail;
- else
- {
- APPEND (result, "[");
- for ( ; ; )
- {
- tree lo_val = TREE_PURPOSE (val);
- tree hi_val = TREE_VALUE (val);
- MYSTRING *val_string;
- if (TUPLE_NAMED_FIELD (val))
- APPEND(result, ".");
- if (lo_val != NULL_TREE)
- {
- val_string = decode_constant (lo_val);
- APPEND (result, val_string->str);
- FREE (val_string);
- APPEND (result, ":");
- }
- val_string = decode_constant (hi_val);
- APPEND (result, val_string->str);
- FREE (val_string);
- val = TREE_CHAIN (val);
- if (val == NULL_TREE)
- break;
- APPEND (result, ", ");
- }
- APPEND (result, "]");
- }
- }
- return result;
- case COMPONENT_REF:
- {
- tree op1;
-
- mode_string = decode_constant (TREE_OPERAND (init, 0));
- APPEND (result, mode_string->str);
- FREE (mode_string);
- op1 = TREE_OPERAND (init, 1);
- if (TREE_CODE (op1) != IDENTIFIER_NODE)
- {
- error ("decode_constant: invalid component_ref");
- break;
- }
- APPEND (result, ".");
- APPEND (result, IDENTIFIER_POINTER (op1));
- return result;
- }
- fail:
- error ("decode_constant: mode and value mismatch");
- break;
- default:
- error ("decode_constant: cannot decode this mode");
- break;
- }
- return result;
-}
-
-static MYSTRING *
-decode_constant_selective (init, all_decls)
- tree init;
- tree all_decls;
-{
- MYSTRING *result = newstring ("");
- MYSTRING *tmp_string;
- tree type = TREE_TYPE (init);
- tree val = init;
- MYSTRING *mode_string;
-
- switch ((enum chill_tree_code)TREE_CODE (val))
- {
- case CALL_EXPR:
- tmp_string = decode_constant_selective (TREE_OPERAND (val, 0), all_decls);
- if (tmp_string->len)
- APPEND (result, tmp_string->str);
- FREE (tmp_string);
- val = TREE_OPERAND (val, 1); /* argument list */
- if (val != NULL_TREE && TREE_CODE (val) != TREE_LIST)
- {
- tmp_string = decode_constant_selective (val, all_decls);
- if (tmp_string->len)
- {
- MAYBE_NEWLINE (result);
- APPEND (result, tmp_string->str);
- }
- FREE (tmp_string);
- }
- else
- {
- if (val != NULL_TREE)
- {
- for (;;)
- {
- tmp_string = decode_constant_selective (TREE_VALUE (val), all_decls);
- if (tmp_string->len)
- {
- MAYBE_NEWLINE (result);
- APPEND (result, tmp_string->str);
- }
- FREE (tmp_string);
- val = TREE_CHAIN (val);
- if (val == NULL_TREE)
- break;
- }
- }
- }
- return result;
-
- case NOP_EXPR:
- /* Generate an "expression conversion" expression (a cast). */
- tmp_string = decode_mode_selective (type, all_decls);
- if (tmp_string->len)
- APPEND (result, tmp_string->str);
- FREE (tmp_string);
- val = TREE_OPERAND (val, 0);
- type = TREE_TYPE (val);
-
- /* If the coercee is a tuple, make sure it is prefixed by its mode. */
- if (TREE_CODE (val) == CONSTRUCTOR
- && !CH_BOOLS_TYPE_P (type) && !chill_varying_type_p (type))
- {
- tmp_string = decode_mode_selective (type, all_decls);
- if (tmp_string->len)
- APPEND (result, tmp_string->str);
- FREE (tmp_string);
- }
-
- tmp_string = decode_constant_selective (val, all_decls);
- if (tmp_string->len)
- APPEND (result, tmp_string->str);
- FREE (tmp_string);
- return result;
-
- case IDENTIFIER_NODE:
- tmp_string = decode_mode_selective (val, all_decls);
- if (tmp_string->len)
- APPEND (result, tmp_string->str);
- FREE (tmp_string);
- return result;
-
- case PAREN_EXPR:
- tmp_string = decode_constant_selective (TREE_OPERAND (val, 0), all_decls);
- if (tmp_string->len)
- APPEND (result, tmp_string->str);
- FREE (tmp_string);
- return result;
-
- case UNDEFINED_EXPR:
- return result;
-
- case PLUS_EXPR:
- case MINUS_EXPR:
- case MULT_EXPR:
- case TRUNC_DIV_EXPR:
- case FLOOR_MOD_EXPR:
- case TRUNC_MOD_EXPR:
- case CONCAT_EXPR:
- case BIT_IOR_EXPR:
- case BIT_XOR_EXPR:
- case TRUTH_ORIF_EXPR:
- case BIT_AND_EXPR:
- case TRUTH_ANDIF_EXPR:
- case GT_EXPR:
- case GE_EXPR:
- case SET_IN_EXPR:
- case LT_EXPR:
- case LE_EXPR:
- case EQ_EXPR:
- case NE_EXPR:
- goto binary;
- case RANGE_EXPR:
- if (TREE_OPERAND (val, 0) == NULL_TREE)
- return result;
-
- binary:
- tmp_string = decode_constant_selective (TREE_OPERAND (val, 0), all_decls);
- if (tmp_string->len)
- APPEND (result, tmp_string->str);
- FREE (tmp_string);
- tmp_string = decode_constant_selective (TREE_OPERAND (val, 1), all_decls);
- if (tmp_string->len)
- {
- MAYBE_NEWLINE (result);
- APPEND (result, tmp_string->str);
- }
- FREE (tmp_string);
- return result;
-
- case REPLICATE_EXPR:
- tmp_string = decode_constant_selective (TREE_OPERAND (val, 0), all_decls);
- if (tmp_string->len)
- APPEND (result, tmp_string->str);
- FREE (tmp_string);
- tmp_string = decode_constant_selective (TREE_OPERAND (val, 1), all_decls);
- if (tmp_string->len)
- {
- MAYBE_NEWLINE (result);
- APPEND (result, tmp_string->str);
- }
- FREE (tmp_string);
- return result;
-
- case NEGATE_EXPR:
- case BIT_NOT_EXPR:
- case ADDR_EXPR:
- tmp_string = decode_constant_selective (TREE_OPERAND (val, 0), all_decls);
- if (tmp_string->len)
- APPEND (result, tmp_string->str);
- FREE (tmp_string);
- return result;
-
- case INTEGER_CST:
- return result;
-
- case REAL_CST:
- return result;
-
- case STRING_CST:
- return result;
-
- case CONSTRUCTOR:
- val = TREE_OPERAND (val, 1);
- if (type != NULL && TREE_CODE (type) == SET_TYPE
- && CH_BOOLS_TYPE_P (type))
- /* It's a bitstring. */
- return result;
- else
- { /* It's some kind of tuple */
- if (type != NULL_TREE)
- {
- mode_string = get_type_selective (type, all_decls);
- if (mode_string->len)
- APPEND (result, mode_string->str);
- FREE (mode_string);
- }
- if (val == NULL_TREE
- || TREE_CODE (val) == ERROR_MARK)
- return result;
- else if (TREE_CODE (val) != TREE_LIST)
- goto fail;
- else
- {
- for ( ; ; )
- {
- tree lo_val = TREE_PURPOSE (val);
- tree hi_val = TREE_VALUE (val);
- MYSTRING *val_string;
- if (lo_val != NULL_TREE)
- {
- val_string = decode_constant_selective (lo_val, all_decls);
- if (val_string->len)
- APPEND (result, val_string->str);
- FREE (val_string);
- }
- val_string = decode_constant_selective (hi_val, all_decls);
- if (val_string->len)
- {
- MAYBE_NEWLINE (result);
- APPEND (result, val_string->str);
- }
- FREE (val_string);
- val = TREE_CHAIN (val);
- if (val == NULL_TREE)
- break;
- }
- }
- }
- return result;
- case COMPONENT_REF:
- {
- mode_string = decode_constant_selective (TREE_OPERAND (init, 0), all_decls);
- if (mode_string->len)
- APPEND (result, mode_string->str);
- FREE (mode_string);
- return result;
- }
- fail:
- error ("decode_constant_selective: mode and value mismatch");
- break;
- default:
- error ("decode_constant_selective: cannot decode this mode");
- break;
- }
- return result;
-}
-
-/* Assuming DECL is an ALIAS_DECL, return its prefix rename clause. */
-
-static MYSTRING *
-decode_prefix_rename (decl)
- tree decl;
-{
- MYSTRING *result = newstring ("");
- if (DECL_OLD_PREFIX (decl) || DECL_NEW_PREFIX (decl))
- {
- APPEND (result, "(");
- if (DECL_OLD_PREFIX (decl))
- APPEND (result, IDENTIFIER_POINTER (DECL_OLD_PREFIX (decl)));
- APPEND (result, "->");
- if (DECL_NEW_PREFIX (decl))
- APPEND (result, IDENTIFIER_POINTER (DECL_NEW_PREFIX (decl)));
- APPEND (result, ")!");
- }
- if (DECL_POSTFIX_ALL (decl))
- APPEND (result, "ALL");
- else
- APPEND (result, IDENTIFIER_POINTER (DECL_POSTFIX (decl)));
- return result;
-}
-
-static MYSTRING *
-decode_decl (decl)
- tree decl;
-{
- MYSTRING *result = newstring ("");
- MYSTRING *mode_string;
- tree type;
-
- switch ((enum chill_tree_code)TREE_CODE (decl))
- {
- case VAR_DECL:
- case BASED_DECL:
- APPEND (result, "DCL ");
- APPEND (result, IDENTIFIER_POINTER (DECL_NAME (decl)));
- APPEND (result, " ");
- mode_string = get_type (TREE_TYPE (decl));
- APPEND (result, mode_string->str);
- FREE (mode_string);
- if ((enum chill_tree_code)TREE_CODE (decl) == BASED_DECL)
- {
- APPEND (result, " BASED (");
- APPEND (result, IDENTIFIER_POINTER (DECL_ABSTRACT_ORIGIN (decl)));
- APPEND (result, ")");
- }
- break;
-
- case TYPE_DECL:
- if (CH_DECL_SIGNAL (decl))
- {
- /* this is really a signal */
- tree fields = TYPE_FIELDS (TREE_TYPE (decl));
- tree signame = DECL_NAME (decl);
- tree sigdest;
-
- APPEND (result, "SIGNAL ");
- APPEND (result, IDENTIFIER_POINTER (signame));
- if (IDENTIFIER_SIGNAL_DATA (signame))
- {
- APPEND (result, " = (");
- for ( ; fields != NULL_TREE;
- fields = TREE_CHAIN (fields))
- {
- MYSTRING *mode_string;
-
- mode_string = get_type (TREE_TYPE (fields));
- APPEND (result, mode_string->str);
- FREE (mode_string);
- if (TREE_CHAIN (fields) != NULL_TREE)
- APPEND (result, ", ");
- }
- APPEND (result, ")");
- }
- sigdest = IDENTIFIER_SIGNAL_DEST (signame);
- if (sigdest != NULL_TREE)
- {
- APPEND (result, " TO ");
- APPEND (result, IDENTIFIER_POINTER (DECL_NAME (sigdest)));
- }
- }
- else
- {
- /* avoid defining a mode as itself */
- if (CH_NOVELTY (TREE_TYPE (decl)) == decl)
- APPEND (result, "NEWMODE ");
- else
- APPEND (result, "SYNMODE ");
- APPEND (result, IDENTIFIER_POINTER (DECL_NAME (decl)));
- APPEND (result, " = ");
- mode_string = decode_mode (TREE_TYPE (decl));
- APPEND (result, mode_string->str);
- FREE (mode_string);
- }
- break;
-
- case FUNCTION_DECL:
- {
- tree args;
-
- type = TREE_TYPE (decl);
- args = TYPE_ARG_TYPES (type);
-
- APPEND (result, IDENTIFIER_POINTER (DECL_NAME (decl)));
-
- if (CH_DECL_PROCESS (decl))
- APPEND (result, ": PROCESS (");
- else
- APPEND (result, ": PROC (");
-
- args = TYPE_ARG_TYPES (type);
-
- mode_string = print_proc_tail (type, args, 1);
- APPEND (result, mode_string->str);
- FREE (mode_string);
-
- /* generality */
- if (CH_DECL_GENERAL (decl))
- APPEND (result, " GENERAL");
- if (CH_DECL_SIMPLE (decl))
- APPEND (result, " SIMPLE");
- if (DECL_INLINE (decl))
- APPEND (result, " INLINE");
- if (CH_DECL_RECURSIVE (decl))
- APPEND (result, " RECURSIVE");
- APPEND (result, " END");
- }
- break;
-
- case FIELD_DECL:
- APPEND (result, IDENTIFIER_POINTER (DECL_NAME (decl)));
- APPEND (result, " ");
- mode_string = get_type (TREE_TYPE (decl));
- APPEND (result, mode_string->str);
- FREE (mode_string);
- if (DECL_INITIAL (decl) != NULL_TREE)
- {
- mode_string = decode_layout (DECL_INITIAL (decl));
- APPEND (result, mode_string->str);
- FREE (mode_string);
- }
-#if 0
- if (is_forbidden (DECL_NAME (decl), forbid))
- APPEND (result, " FORBID");
-#endif
- break;
-
- case CONST_DECL:
- if (DECL_INITIAL (decl) == NULL_TREE
- || TREE_CODE (DECL_INITIAL (decl)) == ERROR_MARK)
- break;
- APPEND (result, "SYN ");
- APPEND (result, IDENTIFIER_POINTER (DECL_NAME (decl)));
- APPEND (result, " ");
- mode_string = get_type (TREE_TYPE (decl));
- APPEND (result, mode_string->str);
- FREE (mode_string);
- APPEND (result, " = ");
- mode_string = decode_constant (DECL_INITIAL (decl));
- APPEND (result, mode_string->str);
- FREE (mode_string);
- break;
-
- case ALIAS_DECL:
- /* If CH_DECL_GRANTED, decl was granted into this scope, and
- so wasn't in the source code. */
- if (!CH_DECL_GRANTED (decl))
- {
- static int restricted = 0;
-
- if (DECL_SEIZEFILE (decl) != use_seizefile_name
- && DECL_SEIZEFILE (decl))
- {
- use_seizefile_name = DECL_SEIZEFILE (decl);
- restricted = use_seizefile_name == NULL_TREE ? 0 : CH_USE_SEIZEFILE_RESTRICTED (use_seizefile_name);
- if (! restricted)
- grant_use_seizefile (IDENTIFIER_POINTER (use_seizefile_name));
- mark_use_seizefile_written (use_seizefile_name);
- }
- if (! restricted)
- {
- APPEND (result, "SEIZE ");
- mode_string = decode_prefix_rename (decl);
- APPEND (result, mode_string->str);
- FREE (mode_string);
- }
- }
- break;
-
- default:
- APPEND (result, "----- not implemented ------");
- break;
- }
- return (result);
-}
-
-static MYSTRING *
-decode_decl_selective (decl, all_decls)
- tree decl;
- tree all_decls;
-{
- MYSTRING *result = newstring ("");
- MYSTRING *mode_string;
- tree type;
-
- if (CH_ALREADY_GRANTED (decl))
- /* do nothing */
- return result;
-
- CH_ALREADY_GRANTED (decl) = 1;
-
- switch ((int)TREE_CODE (decl))
- {
- case VAR_DECL:
- case BASED_DECL:
- mode_string = get_type_selective (TREE_TYPE (decl), all_decls);
- if (mode_string->len)
- APPEND (result, mode_string->str);
- FREE (mode_string);
- if ((enum chill_tree_code)TREE_CODE (decl) == BASED_DECL)
- {
- mode_string = decode_mode_selective (DECL_ABSTRACT_ORIGIN (decl), all_decls);
- if (mode_string->len)
- PREPEND (result, mode_string->str);
- FREE (mode_string);
- }
- break;
-
- case TYPE_DECL:
- if (CH_DECL_SIGNAL (decl))
- {
- /* this is really a signal */
- tree fields = TYPE_FIELDS (TREE_TYPE (decl));
- tree signame = DECL_NAME (decl);
- tree sigdest;
-
- if (IDENTIFIER_SIGNAL_DATA (signame))
- {
- for ( ; fields != NULL_TREE;
- fields = TREE_CHAIN (fields))
- {
- MYSTRING *mode_string;
-
- mode_string = get_type_selective (TREE_TYPE (fields),
- all_decls);
- if (mode_string->len)
- APPEND (result, mode_string->str);
- FREE (mode_string);
- }
- }
- sigdest = IDENTIFIER_SIGNAL_DEST (signame);
- if (sigdest != NULL_TREE)
- {
- mode_string = decode_mode_selective (DECL_NAME (sigdest), all_decls);
- if (mode_string->len)
- {
- MAYBE_NEWLINE (result);
- APPEND (result, mode_string->str);
- }
- FREE (mode_string);
- }
- }
- else
- {
- /* avoid defining a mode as itself */
- mode_string = decode_mode_selective (TREE_TYPE (decl), all_decls);
- APPEND (result, mode_string->str);
- FREE (mode_string);
- }
- break;
-
- case FUNCTION_DECL:
- {
- tree args;
-
- type = TREE_TYPE (decl);
- args = TYPE_ARG_TYPES (type);
-
- args = TYPE_ARG_TYPES (type);
-
- mode_string = print_proc_tail_selective (type, args, all_decls);
- if (mode_string->len)
- APPEND (result, mode_string->str);
- FREE (mode_string);
- }
- break;
-
- case FIELD_DECL:
- mode_string = get_type_selective (TREE_TYPE (decl), all_decls);
- if (mode_string->len)
- APPEND (result, mode_string->str);
- FREE (mode_string);
- break;
-
- case CONST_DECL:
- if (DECL_INITIAL (decl) == NULL_TREE
- || TREE_CODE (DECL_INITIAL (decl)) == ERROR_MARK)
- break;
- mode_string = get_type_selective (TREE_TYPE (decl), all_decls);
- if (mode_string->len)
- APPEND (result, mode_string->str);
- FREE (mode_string);
- mode_string = decode_constant_selective (DECL_INITIAL (decl), all_decls);
- if (mode_string->len)
- {
- MAYBE_NEWLINE (result);
- APPEND (result, mode_string->str);
- }
- FREE (mode_string);
- break;
-
- }
- MAYBE_NEWLINE (result);
- return (result);
-}
-
-static void
-globalize_decl (decl)
- tree decl;
-{
- if (!TREE_PUBLIC (decl) && DECL_NAME (decl) &&
- (TREE_CODE (decl) == VAR_DECL || TREE_CODE (decl) == FUNCTION_DECL))
- {
- const char *name = XSTR (XEXP (DECL_RTL (decl), 0), 0);
-
- if (!first_global_object_name)
- first_global_object_name = name + (name[0] == '*');
- ASM_GLOBALIZE_LABEL (asm_out_file, name);
- }
-}
-
-
-static void
-grant_one_decl (decl)
- tree decl;
-{
- MYSTRING *result;
-
- if (DECL_SOURCE_LINE (decl) == 0)
- return;
- result = decode_decl (decl);
- if (result->len)
- {
- APPEND (result, ";\n");
- APPEND (gstring, result->str);
- }
- FREE (result);
-}
-
-static void
-grant_one_decl_selective (decl, all_decls)
- tree decl;
- tree all_decls;
-{
- MYSTRING *result;
- MYSTRING *fixups;
-
- tree d = DECL_ABSTRACT_ORIGIN (decl);
-
- if (CH_ALREADY_GRANTED (d))
- /* already done */
- return;
-
- result = decode_decl (d);
- if (!result->len)
- {
- /* nothing to do */
- FREE (result);
- return;
- }
-
- APPEND (result, ";\n");
-
- /* now process all undefined items in the decl */
- fixups = decode_decl_selective (d, all_decls);
- if (fixups->len)
- {
- PREPEND (result, fixups->str);
- }
- FREE (fixups);
-
- /* we have finished a decl */
- APPEND (selective_gstring, result->str);
- FREE (result);
-}
-
-static int
-compare_memory_file (fname, buf)
- const char *fname;
- const char *buf;
-{
- FILE *fb;
- int c;
-
- /* check if we have something to write */
- if (!buf || !strlen (buf))
- return (0);
-
- if ((fb = fopen (fname, "r")) == NULL)
- return (1);
-
- while ((c = getc (fb)) != EOF)
- {
- if (c != *buf++)
- {
- fclose (fb);
- return (1);
- }
- }
- fclose (fb);
- return (*buf ? 1 : 0);
-}
-
-void
-write_grant_file ()
-{
- FILE *fb;
-
- /* We only write out the grant file if it has changed,
- to avoid changing its time-stamp and triggering an
- unnecessary 'make' action. Return if no change. */
- if (gstring == NULL || !spec_module_generated ||
- !compare_memory_file (grant_file_name, gstring->str))
- return;
-
- fb = fopen (grant_file_name, "w");
- if (fb == NULL)
- fatal_io_error ("can't open %s", grant_file_name);
-
- /* write file. Due to problems with record sizes on VAX/VMS
- write string to '\n' */
-#ifdef VMS
- /* do it this way for VMS, cause of problems with
- record sizes */
- p = gstring->str;
- while (*p)
- {
- p1 = strchr (p, '\n');
- c = *++p1;
- *p1 = '\0';
- fprintf (fb, "%s", p);
- *p1 = c;
- p = p1;
- }
-#else
- /* faster way to write */
- if (write (fileno (fb), gstring->str, gstring->len) < 0)
- {
- int save_errno = errno;
-
- unlink (grant_file_name);
- errno = save_errno;
- fatal_io_error ("can't write to %s", grant_file_name);
- }
-#endif
- fclose (fb);
-}
-
-
-/* handle grant statement */
-
-void
-set_default_grant_file ()
-{
- char *p, *tmp;
- const char *fname;
-
- if (dump_base_name)
- fname = dump_base_name; /* Probably invoked via gcc */
- else
- { /* Probably invoked directly (not via gcc) */
- fname = asm_file_name;
- if (!fname)
- fname = main_input_filename ? main_input_filename : input_filename;
- if (!fname)
- return;
- }
-
- p = strrchr (fname, '.');
- if (!p)
- {
- tmp = (char *) alloca (strlen (fname) + 10);
- strcpy (tmp, fname);
- }
- else
- {
- int i = p - fname;
-
- tmp = (char *) alloca (i + 10);
- strncpy (tmp, fname, i);
- tmp[i] = '\0';
- }
- strcat (tmp, ".grt");
- default_grant_file = build_string (strlen (tmp), tmp);
-
- grant_file_name = TREE_STRING_POINTER (default_grant_file);
-
- if (gstring == NULL)
- gstring = newstring ("");
- if (selective_gstring == NULL)
- selective_gstring = newstring ("");
-}
-
-/* Make DECL visible under the name NAME in the (fake) outermost scope. */
-
-void
-push_granted (name, decl)
- tree name ATTRIBUTE_UNUSED, decl ATTRIBUTE_UNUSED;
-{
-#if 0
- IDENTIFIER_GRANTED_VALUE (name) = decl;
- granted_decls = tree_cons (name, decl, granted_decls);
-#endif
-}
-
-void
-chill_grant (old_prefix, new_prefix, postfix, forbid)
- tree old_prefix;
- tree new_prefix;
- tree postfix;
- tree forbid;
-{
- if (pass == 1)
- {
-#if 0
- tree old_name = old_prefix == NULL_TREE ? postfix
- : get_identifier3 (IDENTIFIER_POINTER (old_prefix),
- "!", IDENTIFIER_POINTER (postfix));
- tree new_name = new_prefix == NULL_TREE ? postfix
- : get_identifier3 (IDENTIFIER_POINTER (new_prefix),
- "!", IDENTIFIER_POINTER (postfix));
-#endif
- tree alias = build_alias_decl (old_prefix, new_prefix, postfix);
- CH_DECL_GRANTED (alias) = 1;
- DECL_SEIZEFILE (alias) = current_seizefile_name;
- TREE_CHAIN (alias) = current_module->granted_decls;
- current_module->granted_decls = alias;
-
- if (forbid)
- warning ("FORBID is not yet implemented"); /* FIXME */
- }
-}
-
-/* flag GRANT ALL only once. Avoids search in case of GRANT ALL. */
-static int grant_all_seen = 0;
-
-/* check if a decl is in the list of granted decls. */
-static int
-search_in_list (name, granted_decls)
- tree name;
- tree granted_decls;
-{
- tree vars;
-
- for (vars = granted_decls; vars != NULL_TREE; vars = TREE_CHAIN (vars))
- if (DECL_SOURCE_LINE (vars))
- {
- if (DECL_POSTFIX_ALL (vars))
- {
- grant_all_seen = 1;
- return 1;
- }
- else if (name == DECL_NAME (vars))
- return 1;
- }
- /* not found */
- return 0;
-}
-
-static int
-really_grant_this (decl, granted_decls)
- tree decl;
- tree granted_decls;
-{
- /* we never grant labels at module level */
- if ((enum chill_tree_code)TREE_CODE (decl) == LABEL_DECL)
- return 0;
-
- if (grant_all_seen)
- return 1;
-
- switch ((enum chill_tree_code)TREE_CODE (decl))
- {
- case VAR_DECL:
- case BASED_DECL:
- case FUNCTION_DECL:
- return search_in_list (DECL_NAME (decl), granted_decls);
- case ALIAS_DECL:
- case CONST_DECL:
- return 1;
- case TYPE_DECL:
- if (CH_DECL_SIGNAL (decl))
- return search_in_list (DECL_NAME (decl), granted_decls);
- else
- return 1;
- default:
- break;
- }
-
- /* this nerver should happen */
- error_with_decl (decl, "function \"really_grant_this\" called for `%s'.");
- return 1;
-}
-
-/* Write a SPEC MODULE using the declarations in the list DECLS. */
-static int header_written = 0;
-#define HEADER_TEMPLATE "--\n-- WARNING: this file was generated by\n\
--- GNUCHILL version %s\n-- based on gcc version %s\n--\n"
-
-void
-write_spec_module (decls, granted_decls)
- tree decls;
- tree granted_decls;
-{
- tree vars;
- char *hdr;
-
- if (granted_decls == NULL_TREE)
- return;
-
- use_seizefile_name = NULL_TREE;
-
- if (!header_written)
- {
- hdr = (char*) alloca (strlen (gnuchill_version)
- + strlen (version_string)
- + sizeof (HEADER_TEMPLATE) /* includes \0 */);
- sprintf (hdr, HEADER_TEMPLATE, gnuchill_version, version_string);
- APPEND (gstring, hdr);
- header_written = 1;
- }
- APPEND (gstring, IDENTIFIER_POINTER (current_module->name));
- APPEND (gstring, ": SPEC MODULE\n");
-
- /* first of all we look for GRANT ALL specified */
- search_in_list (NULL_TREE, granted_decls);
-
- if (grant_all_seen != 0)
- {
- /* write all identifiers to grant file */
- for (vars = decls; vars != NULL_TREE; vars = TREE_CHAIN (vars))
- {
- if (DECL_SOURCE_LINE (vars))
- {
- if (DECL_NAME (vars))
- {
- if ((TREE_CODE (vars) != CONST_DECL || !CH_DECL_ENUM (vars)) &&
- really_grant_this (vars, granted_decls))
- grant_one_decl (vars);
- }
- else if (DECL_POSTFIX_ALL (vars))
- {
- static int restricted = 0;
-
- if (DECL_SEIZEFILE (vars) != use_seizefile_name
- && DECL_SEIZEFILE (vars))
- {
- use_seizefile_name = DECL_SEIZEFILE (vars);
- restricted = use_seizefile_name == NULL_TREE ? 0 : CH_USE_SEIZEFILE_RESTRICTED (use_seizefile_name);
- if (! restricted)
- grant_use_seizefile (IDENTIFIER_POINTER (use_seizefile_name));
- mark_use_seizefile_written (use_seizefile_name);
- }
- if (! restricted)
- {
- APPEND (gstring, "SEIZE ALL;\n");
- }
- }
- }
- }
- }
- else
- {
- seizefile_list *wrk, *x;
-
- /* do a selective write to the grantfile. This will reduce the
- size of a grantfile and speed up compilation of
- modules depending on this grant file */
-
- if (selective_gstring == 0)
- selective_gstring = newstring ("");
-
- /* first of all process all SEIZE ALL's */
- for (vars = decls; vars != NULL_TREE; vars = TREE_CHAIN (vars))
- {
- if (DECL_SOURCE_LINE (vars)
- && DECL_POSTFIX_ALL (vars))
- grant_seized_identifier (vars);
- }
-
- /* now walk through granted decls */
- granted_decls = nreverse (granted_decls);
- for (vars = granted_decls; vars != NULL_TREE; vars = TREE_CHAIN (vars))
- {
- grant_one_decl_selective (vars, decls);
- }
- granted_decls = nreverse (granted_decls);
-
- /* append all SEIZES */
- wrk = selective_seizes;
- while (wrk != 0)
- {
- x = wrk->next;
- APPEND (gstring, wrk->seizes->str);
- FREE (wrk->seizes);
- free (wrk);
- wrk = x;
- }
- selective_seizes = 0;
-
- /* append generated string to grant file */
- APPEND (gstring, selective_gstring->str);
- FREE (selective_gstring);
- selective_gstring = NULL;
- }
-
- for (vars = granted_decls; vars != NULL_TREE; vars = TREE_CHAIN (vars))
- if (DECL_SOURCE_LINE (vars))
- {
- MYSTRING *mode_string = decode_prefix_rename (vars);
- APPEND (gstring, "GRANT ");
- APPEND (gstring, mode_string->str);
- FREE (mode_string);
- APPEND (gstring, ";\n");
- }
-
- APPEND (gstring, "END;\n");
- spec_module_generated = 1;
-
- /* initialize this for next spec module */
- grant_all_seen = 0;
-}
-
-/*
- * after the dark comes, after all of the modules are at rest,
- * we tuck the compilation unit to bed... A story in pass 1
- * and a hug-and-a-kiss goodnight in pass 2.
- */
-void
-chill_finish_compile ()
-{
- tree global_list;
- tree chill_init_function;
-
- tasking_setup ();
- build_enum_tables ();
-
- /* We only need an initializer function for the source file if
- a) there's module-level code to be called, or
- b) tasking-related stuff to be initialized. */
- if (module_init_list != NULL_TREE || tasking_list != NULL_TREE)
- {
- extern tree initializer_type;
- static tree chill_init_name;
-
- /* declare the global initializer list */
- global_list = do_decl (get_identifier ("_ch_init_list"),
- build_chill_pointer_type (initializer_type), 1, 0,
- NULL_TREE, 1);
-
- /* Now, we're building the function which is the *real*
- constructor - if there's any module-level code in this
- source file, the compiler puts the file's initializer entry
- onto the global initializer list, so each module's body code
- will eventually get called, after all of the processes have
- been started up. */
-
- /* This is better done in pass 2 (when first_global_object_name
- may have been set), but that is too late.
- Perhaps rewrite this so nothing is done in pass 1. */
- if (pass == 1)
- {
- /* If we don't do this spoof, we get the name of the first
- tasking_code variable, and not the file name. */
- char *q;
- const char *tmp = first_global_object_name;
- first_global_object_name = NULL;
- chill_init_name = get_file_function_name ('I');
- first_global_object_name = tmp;
-
- /* strip off the file's extension, if any. */
- q = strrchr (IDENTIFIER_POINTER (chill_init_name), '.');
- if (q)
- *q = '\0';
- }
-
- start_chill_function (chill_init_name, void_type_node, NULL_TREE,
- NULL_TREE, NULL_TREE);
- TREE_PUBLIC (current_function_decl) = 1;
- chill_init_function = current_function_decl;
-
- /* For each module that we've compiled, that had module-level
- code to be called, add its entry to the global initializer
- list. */
-
- if (pass == 2)
- {
- tree module_init;
-
- for (module_init = module_init_list;
- module_init != NULL_TREE;
- module_init = TREE_CHAIN (module_init))
- {
- tree init_entry = TREE_VALUE (module_init);
-
- /* assign module_entry.next := _ch_init_list; */
- expand_expr_stmt (
- build_chill_modify_expr (
- build_component_ref (init_entry,
- get_identifier ("__INIT_NEXT")),
- global_list));
-
- /* assign _ch_init_list := &module_entry; */
- expand_expr_stmt (
- build_chill_modify_expr (global_list,
- build1 (ADDR_EXPR, ptr_type_node, init_entry)));
- }
- }
-
- tasking_registry ();
-
- make_decl_rtl (current_function_decl, NULL, 1);
-
- finish_chill_function ();
-
- if (pass == 2)
- {
- assemble_constructor (IDENTIFIER_POINTER (chill_init_name));
- globalize_decl (chill_init_function);
- }
-
- /* ready now to link decls onto this list in pass 2. */
- module_init_list = NULL_TREE;
- tasking_list = NULL_TREE;
- }
-}
-
-
diff --git a/gcc/ch/hash.h b/gcc/ch/hash.h
deleted file mode 100644
index 4d7c02ab7b0..00000000000
--- a/gcc/ch/hash.h
+++ /dev/null
@@ -1,1370 +0,0 @@
-/* C code produced by gperf version 2.7.1 (19981006 egcs) */
-/* Command-line: gperf -L C -F , 0, 0, 0 -D -E -S1 -p -j1 -i 1 -g -o -t -k* gperf.tmp */
-struct resword {
- const char *name;
- short token;
- enum rid rid;
- enum toktype { RESERVED, DIRECTIVE, PREDEF } flags;
-};
-extern tree ridpointers [];
-#ifdef __GNUC__
-__inline
-#endif
-static unsigned int hash PARAMS ((const char *, unsigned int));
-#ifdef __GNUC__
-__inline
-#endif
-struct resword *in_word_set PARAMS ((const char *, unsigned int));
-/* maximum key range = 2815, duplicates = 6 */
-
-#ifdef __GNUC__
-__inline
-#endif
-static unsigned int
-hash (str, len)
- register const char *str;
- register unsigned int len;
-{
- static unsigned short asso_values[] =
- {
- 2822, 2822, 2822, 2822, 2822, 2822, 2822, 2822, 2822, 2822,
- 2822, 2822, 2822, 2822, 2822, 2822, 2822, 2822, 2822, 2822,
- 2822, 2822, 2822, 2822, 2822, 2822, 2822, 2822, 2822, 2822,
- 2822, 2822, 2822, 2822, 2822, 2822, 2822, 2822, 2822, 2822,
- 2822, 2822, 2822, 2822, 2822, 2822, 2822, 2822, 2822, 2822,
- 2822, 2822, 2822, 2822, 2822, 2822, 2822, 2822, 2822, 2822,
- 2822, 2822, 2822, 2822, 2822, 4, 61, 80, 12, 350,
- 91, 39, 3, 2, 2822, 4, 129, 155, 64, 46,
- 65, 2822, 96, 13, 1, 135, 7, 2, 8, 124,
- 7, 2822, 2822, 2822, 2822, 1, 2822, 94, 40, 127,
- 21, 1, 81, 1, 1, 7, 2822, 3, 23, 74,
- 255, 203, 70, 2822, 218, 1, 88, 124, 1, 6,
- 10, 56, 40, 2822, 2822, 2822, 2822, 2822, 2822, 2822,
- 2822, 2822, 2822, 2822, 2822, 2822, 2822, 2822, 2822, 2822,
- 2822, 2822, 2822, 2822, 2822, 2822, 2822, 2822, 2822, 2822,
- 2822, 2822, 2822, 2822, 2822, 2822, 2822, 2822, 2822, 2822,
- 2822, 2822, 2822, 2822, 2822, 2822, 2822, 2822, 2822, 2822,
- 2822, 2822, 2822, 2822, 2822, 2822, 2822, 2822, 2822, 2822,
- 2822, 2822, 2822, 2822, 2822, 2822, 2822, 2822, 2822, 2822,
- 2822, 2822, 2822, 2822, 2822, 2822, 2822, 2822, 2822, 2822,
- 2822, 2822, 2822, 2822, 2822, 2822, 2822, 2822, 2822, 2822,
- 2822, 2822, 2822, 2822, 2822, 2822, 2822, 2822, 2822, 2822,
- 2822, 2822, 2822, 2822, 2822, 2822, 2822, 2822, 2822, 2822,
- 2822, 2822, 2822, 2822, 2822, 2822, 2822, 2822, 2822, 2822,
- 2822, 2822, 2822, 2822, 2822, 2822, 2822, 2822, 2822, 2822,
- 2822, 2822, 2822, 2822, 2822, 2822
- };
- register int hval = len;
-
- switch (hval)
- {
- default:
- case 30:
- hval += asso_values[(unsigned char)str[29]];
- case 29:
- hval += asso_values[(unsigned char)str[28]];
- case 28:
- hval += asso_values[(unsigned char)str[27]];
- case 27:
- hval += asso_values[(unsigned char)str[26]];
- case 26:
- hval += asso_values[(unsigned char)str[25]];
- case 25:
- hval += asso_values[(unsigned char)str[24]];
- case 24:
- hval += asso_values[(unsigned char)str[23]];
- case 23:
- hval += asso_values[(unsigned char)str[22]];
- case 22:
- hval += asso_values[(unsigned char)str[21]];
- case 21:
- hval += asso_values[(unsigned char)str[20]];
- case 20:
- hval += asso_values[(unsigned char)str[19]];
- case 19:
- hval += asso_values[(unsigned char)str[18]];
- case 18:
- hval += asso_values[(unsigned char)str[17]];
- case 17:
- hval += asso_values[(unsigned char)str[16]];
- case 16:
- hval += asso_values[(unsigned char)str[15]];
- case 15:
- hval += asso_values[(unsigned char)str[14]];
- case 14:
- hval += asso_values[(unsigned char)str[13]];
- case 13:
- hval += asso_values[(unsigned char)str[12]];
- case 12:
- hval += asso_values[(unsigned char)str[11]];
- case 11:
- hval += asso_values[(unsigned char)str[10]];
- case 10:
- hval += asso_values[(unsigned char)str[9]];
- case 9:
- hval += asso_values[(unsigned char)str[8]];
- case 8:
- hval += asso_values[(unsigned char)str[7]];
- case 7:
- hval += asso_values[(unsigned char)str[6]];
- case 6:
- hval += asso_values[(unsigned char)str[5]];
- case 5:
- hval += asso_values[(unsigned char)str[4]];
- case 4:
- hval += asso_values[(unsigned char)str[3]];
- case 3:
- hval += asso_values[(unsigned char)str[2]];
- case 2:
- hval += asso_values[(unsigned char)str[1]];
- case 1:
- hval += asso_values[(unsigned char)str[0]];
- break;
- }
- return hval;
-}
-
-#ifdef __GNUC__
-__inline
-#endif
-struct resword *
-in_word_set (str, len)
- register const char *str;
- register unsigned int len;
-{
- enum
- {
- TOTAL_KEYWORDS = 300,
- MIN_WORD_LENGTH = 2,
- MAX_WORD_LENGTH = 30,
- MIN_HASH_VALUE = 7,
- MAX_HASH_VALUE = 2821
- };
-
- static struct resword wordlist[] =
- {
- {"AT", AT, NORID, RESERVED},
- {"WITH", WITH, NORID, RESERVED},
- {"THIS", THIS, NORID, RESERVED},
- {"else", ELSE, NORID, RESERVED},
- {"while", WHILE, NORID, RESERVED},
- {"TO", TO, NORID, RESERVED},
- {"seize", SEIZE, NORID, RESERVED},
- {"DO", DO, NORID, RESERVED},
- {"OD", OD, NORID, RESERVED},
- {"BIT", BOOLS, RID_BOOLS, PREDEF},
- {"IN", IN, RID_IN, RESERVED},
- {"INIT", INIT, NORID, RESERVED},
- {"AND", AND, NORID, RESERVED},
- {"fi", FI, NORID, RESERVED},
- {"if", IF, NORID, RESERVED},
- {"set", SET, NORID, RESERVED},
- {"FI", FI, NORID, RESERVED},
- {"IF", IF, NORID, RESERVED},
- {"by", BY, NORID, RESERVED},
- {"this", THIS, NORID, RESERVED},
- {"with", WITH, NORID, RESERVED},
- {"STATIC", STATIC, NORID, RESERVED},
- {"exit", EXIT, NORID, RESERVED},
- {"ON", ON, NORID, RESERVED},
- {"NOT", NOT, NORID, RESERVED},
- {"elsif", ELSIF, NORID, RESERVED},
- {"START", START, NORID, RESERVED},
- {"list", IGNORED_DIRECTIVE, NORID, DIRECTIVE},
- {"POS", POS, NORID, RESERVED},
- {"DOWN", DOWN, NORID, RESERVED},
- {"STOP", STOP, NORID, RESERVED},
- {"BIN", BIN, NORID, RESERVED},
- {"GOTO", GOTO, NORID, RESERVED},
- {"bit", BOOLS, RID_BOOLS, PREDEF},
- {"OF", OF, NORID, RESERVED},
- {"all", ALL, NORID, RESERVED},
- {"OR", OR, NORID, RESERVED},
- {"ROW", ROW, NORID, RESERVED},
- {"LIST", IGNORED_DIRECTIVE, NORID, DIRECTIVE},
- {"XOR", XOR, NORID, RESERVED},
- {"PACK", PACK, NORID, RESERVED},
- {"based", BASED, NORID, RESERVED},
- {"step", STEP, NORID, RESERVED},
- {"page", IGNORED_DIRECTIVE, NORID, DIRECTIVE},
- {"asm", ASM_KEYWORD, NORID, RESERVED},
- {"dcl", DCL, NORID, RESERVED},
- {"ASM", ASM_KEYWORD, NORID, RESERVED},
- {"ANDIF", ANDIF, NORID, RESERVED},
- {"simple", SIMPLE, NORID, RESERVED},
- {"at", AT, NORID, RESERVED},
- {"OUT", PARAMATTR, RID_OUT, RESERVED},
- {"BY", BY, NORID, RESERVED},
- {"text", TEXT, NORID, RESERVED},
- {"FAR", IGNORED_DIRECTIVE, NORID, DIRECTIVE},
- {"up", UP, NORID, RESERVED},
- {"delay", DELAY, NORID, RESERVED},
- {"CHARS", CHARS, NORID, RESERVED},
- {"UP", UP, NORID, RESERVED},
- {"spec", SPEC, NORID, RESERVED},
- {"SYN", SYN, NORID, RESERVED},
- {"GRANT", GRANT, NORID, RESERVED},
- {"MOD", MOD, NORID, RESERVED},
- {"small", IGNORED_DIRECTIVE, NORID, DIRECTIVE},
- {"DCL", DCL, NORID, RESERVED},
- {"ever", EVER, NORID, RESERVED},
- {"do", DO, NORID, RESERVED},
- {"od", OD, NORID, RESERVED},
- {"case", CASE, NORID, RESERVED},
- {"esac", ESAC, NORID, RESERVED},
- {"CCITT_OS", IGNORED_DIRECTIVE, NORID, DIRECTIVE},
- {"FOR", FOR, NORID, RESERVED},
- {"ORIF", ORIF, NORID, RESERVED},
- {"BODY", BODY, NORID, RESERVED},
- {"INOUT", PARAMATTR, RID_INOUT, RESERVED},
- {"SIGNAL", SIGNAL, NORID, RESERVED},
- {"LOC", LOC, NORID, RESERVED},
- {"NOLIST", IGNORED_DIRECTIVE, NORID, DIRECTIVE},
- {"even", IGNORED_DIRECTIVE, NORID, DIRECTIVE},
- {"in", IN, RID_IN, RESERVED},
- {"ALL", ALL, NORID, RESERVED},
- {"NOPACK", NOPACK, NORID, RESERVED},
- {"call", CALL, NORID, RESERVED},
- {"pos", POS, NORID, RESERVED},
- {"end", END, NORID, RESERVED},
- {"send", SEND, NORID, RESERVED},
- {"of", OF, NORID, RESERVED},
- {"PROC", PROC, NORID, RESERVED},
- {"to", TO, NORID, RESERVED},
- {"rem", REM, NORID, RESERVED},
- {"pack", PACK, NORID, RESERVED},
- {"BOOLS", BOOLS, RID_BOOLS, RESERVED},
- {"mod", MOD, NORID, RESERVED},
- {"ref", REF, NORID, RESERVED},
- {"use_seize_file", USE_SEIZE_FILE, NORID, DIRECTIVE},
- {"bin", BIN, NORID, RESERVED},
- {"medium", IGNORED_DIRECTIVE, NORID, DIRECTIVE},
- {"begin", BEGINTOKEN, NORID, RESERVED},
- {"FORBID", FORBID, NORID, RESERVED},
- {"syn", SYN, NORID, RESERVED},
- {"body", BODY, NORID, RESERVED},
- {"ARRAY", ARRAY, NORID, RESERVED},
- {"STRUCT", STRUCT, NORID, RESERVED},
- {"read", READ, RID_READ, RESERVED},
- {"cycle", CYCLE, NORID, RESERVED},
- {"large", IGNORED_DIRECTIVE, NORID, DIRECTIVE},
- {"VARYING", VARYING, NORID, RESERVED},
- {"CALL", CALL, NORID, RESERVED},
- {"then", THEN, NORID, RESERVED},
- {"event", EVENT, NORID, RESERVED},
- {"cause", CAUSE, NORID, RESERVED},
- {"loc", LOC, NORID, RESERVED},
- {"access", ACCESS, NORID, RESERVED},
- {"init", INIT, NORID, RESERVED},
- {"receive", RECEIVE, NORID, RESERVED},
- {"TEXT", TEXT, NORID, RESERVED},
- {"EXIT", EXIT, NORID, RESERVED},
- {"stop", STOP, NORID, RESERVED},
- {"SET", SET, NORID, RESERVED},
- {"and", AND, NORID, RESERVED},
- {"signal", SIGNAL, NORID, RESERVED},
- {"far", IGNORED_DIRECTIVE, NORID, DIRECTIVE},
- {"assert", ASSERT, NORID, RESERVED},
- {"static", STATIC, NORID, RESERVED},
- {"debug_types", IGNORED_DIRECTIVE, NORID, DIRECTIVE},
- {"prefixed", PREFIXED, NORID, RESERVED},
- {"out", PARAMATTR, RID_OUT, RESERVED},
- {"THEN", THEN, NORID, RESERVED},
- {"or", OR, NORID, RESERVED},
- {"END", END, NORID, RESERVED},
- {"row", ROW, NORID, RESERVED},
- {"STEP", STEP, NORID, RESERVED},
- {"xor", XOR, NORID, RESERVED},
- {"SMALL", IGNORED_DIRECTIVE, NORID, DIRECTIVE},
- {"PRIORITY", PRIORITY, NORID, RESERVED},
- {"SEND", SEND, NORID, RESERVED},
- {"BASED", BASED, NORID, RESERVED},
- {"chars", CHARS, NORID, RESERVED},
- {"DYNAMIC", DYNAMIC, RID_DYNAMIC, RESERVED},
- {"CASE", CASE, NORID, RESERVED},
- {"ESAC", ESAC, NORID, RESERVED},
- {"module", MODULE, NORID, RESERVED},
- {"on", ON, NORID, RESERVED},
- {"result", RESULT, NORID, RESERVED},
- {"PAGE", IGNORED_DIRECTIVE, NORID, DIRECTIVE},
- {"andif", ANDIF, NORID, RESERVED},
- {"READ", READ, RID_READ, RESERVED},
- {"bools", BOOLS, RID_BOOLS, RESERVED},
- {"ASSERT", ASSERT, NORID, RESERVED},
- {"debug_lines", IGNORED_DIRECTIVE, NORID, DIRECTIVE},
- {"after", AFTER, NORID, RESERVED},
- {"ALL_STATIC_ON", ALL_STATIC_ON, NORID, DIRECTIVE},
- {"down", DOWN, NORID, RESERVED},
- {"WHILE", WHILE, NORID, RESERVED},
- {"start", START, NORID, RESERVED},
- {"optimize", IGNORED_DIRECTIVE, NORID, DIRECTIVE},
- {"goto", GOTO, NORID, RESERVED},
- {"for", FOR, NORID, RESERVED},
- {"SPEC", SPEC, NORID, RESERVED},
- {"orif", ORIF, NORID, RESERVED},
- {"BEGIN", BEGINTOKEN, NORID, RESERVED},
- {"REF", REF, NORID, RESERVED},
- {"OPTIMIZATION_WINDOW", IGNORED_DIRECTIVE, NORID, DIRECTIVE},
- {"ACCESS", ACCESS, NORID, RESERVED},
- {"AFTER", AFTER, NORID, RESERVED},
- {"not", NOT, NORID, RESERVED},
- {"buffer", BUFFER, NORID, RESERVED},
- {"inline", INLINE, RID_INLINE, RESERVED},
- {"CONTEXT", CONTEXT, NORID, RESERVED},
- {"RANGE", RANGE, NORID, RESERVED},
- {"newmode", NEWMODE, NORID, RESERVED},
- {"range", RANGE, NORID, RESERVED},
- {"forbid", FORBID, NORID, RESERVED},
- {"nolist", IGNORED_DIRECTIVE, NORID, DIRECTIVE},
- {"CAUSE", CAUSE, NORID, RESERVED},
- {"ELSIF", ELSIF, NORID, RESERVED},
- {"remote", REMOTE, NORID, RESERVED},
- {"timeout", TIMEOUT, NORID, RESERVED},
- {"powerset", POWERSET, NORID, RESERVED},
- {"debug_symbols", IGNORED_DIRECTIVE, NORID, DIRECTIVE},
- {"general", GENERAL, NORID, RESERVED},
- {"REGION", REGION, NORID, RESERVED},
- {"REM", REM, NORID, RESERVED},
- {"ALL_STATIC_OFF", ALL_STATIC_OFF, NORID, DIRECTIVE},
- {"INLINE", INLINE, RID_INLINE, RESERVED},
- {"synmode", SYNMODE, NORID, RESERVED},
- {"proc", PROC, NORID, RESERVED},
- {"LARGE", IGNORED_DIRECTIVE, NORID, DIRECTIVE},
- {"DELAY", DELAY, NORID, RESERVED},
- {"process", PROCESS, NORID, RESERVED},
- {"OPTIMIZE", IGNORED_DIRECTIVE, NORID, DIRECTIVE},
- {"varying", VARYING, NORID, RESERVED},
- {"dynamic", DYNAMIC, RID_DYNAMIC, RESERVED},
- {"ccitt_os", IGNORED_DIRECTIVE, NORID, DIRECTIVE},
- {"struct", STRUCT, NORID, RESERVED},
- {"grant", GRANT, NORID, RESERVED},
- {"empty_off", EMPTY_OFF, NORID, DIRECTIVE},
- {"PROCESS", PROCESS, NORID, RESERVED},
- {"RANGE_ON", RANGE_ON, NORID, DIRECTIVE},
- {"inout", PARAMATTR, RID_INOUT, RESERVED},
- {"array", ARRAY, NORID, RESERVED},
- {"region", REGION, NORID, RESERVED},
- {"TIMEOUT", TIMEOUT, NORID, RESERVED},
- {"recursive", RECURSIVE, NORID, RESERVED},
- {"event_code", IGNORED_DIRECTIVE, NORID, DIRECTIVE},
- {"NONREF", NONREF, NORID, RESERVED},
- {"SIMPLE", SIMPLE, NORID, RESERVED},
- {"SEIZE", SEIZE, NORID, RESERVED},
- {"RESULT", RESULT, NORID, RESERVED},
- {"multiple_data_segs", IGNORED_DIRECTIVE, NORID, DIRECTIVE},
- {"signal_code", SIGNAL_CODE, NORID, DIRECTIVE},
- {"RETURN", RETURN, NORID, RESERVED},
- {"CONTINUE", CONTINUE, NORID, RESERVED},
- {"SIGNAL_CODE", SIGNAL_CODE, NORID, DIRECTIVE},
- {"empty_on", EMPTY_ON, NORID, DIRECTIVE},
- {"nopack", NOPACK, NORID, RESERVED},
- {"RETURNS", RETURNS, NORID, RESERVED},
- {"CYCLE", CYCLE, NORID, RESERVED},
- {"SYNMODE", SYNMODE, NORID, RESERVED},
- {"exceptions", EXCEPTIONS, NORID, RESERVED},
- {"EVEN", IGNORED_DIRECTIVE, NORID, DIRECTIVE},
- {"PRINT_O_CODE", IGNORED_DIRECTIVE, NORID, DIRECTIVE},
- {"EVENT", EVENT, NORID, RESERVED},
- {"context", CONTEXT, NORID, RESERVED},
- {"RANGE_OFF", RANGE_OFF, NORID, DIRECTIVE},
- {"EVER", EVER, NORID, RESERVED},
- {"EMPTY_ON", EMPTY_ON, NORID, DIRECTIVE},
- {"MEDIUM", IGNORED_DIRECTIVE, NORID, DIRECTIVE},
- {"BUFFER", BUFFER, NORID, RESERVED},
- {"MODULE", MODULE, NORID, RESERVED},
- {"grant_file_size", IGNORED_DIRECTIVE, NORID, DIRECTIVE},
- {"ELSE", ELSE, NORID, RESERVED},
- {"process_type", PROCESS_TYPE_TOKEN, NORID, DIRECTIVE},
- {"priority", PRIORITY, NORID, RESERVED},
- {"buffer_code", IGNORED_DIRECTIVE, NORID, DIRECTIVE},
- {"return", RETURN, NORID, RESERVED},
- {"returns", RETURNS, NORID, RESERVED},
- {"all_static_off", ALL_STATIC_OFF, NORID, DIRECTIVE},
- {"POWERSET", POWERSET, NORID, RESERVED},
- {"EMPTY_OFF", EMPTY_OFF, NORID, DIRECTIVE},
- {"range_off", RANGE_OFF, NORID, DIRECTIVE},
- {"signal_max_length", IGNORED_DIRECTIVE, NORID, DIRECTIVE},
- {"PREFIXED", PREFIXED, NORID, RESERVED},
- {"NEWMODE", NEWMODE, NORID, RESERVED},
- {"EXCEPTIONS", EXCEPTIONS, NORID, RESERVED},
- {"REMOTE", REMOTE, NORID, RESERVED},
- {"SHORT_PRED_SUCC", IGNORED_DIRECTIVE, NORID, DIRECTIVE},
- {"all_static_on", ALL_STATIC_ON, NORID, DIRECTIVE},
- {"nonref", NONREF, NORID, RESERVED},
- {"SIGNAL_MAX_LENGTH", IGNORED_DIRECTIVE, NORID, DIRECTIVE},
- {"REENTRANT", IGNORED_DIRECTIVE, NORID, DIRECTIVE},
- {"range_on", RANGE_ON, NORID, DIRECTIVE},
- {"GENERAL", GENERAL, NORID, RESERVED},
- {"continue", CONTINUE, NORID, RESERVED},
- {"STATE_ROUTINE", IGNORED_DIRECTIVE, NORID, DIRECTIVE},
- {"EXTRA_CONST_SEG", IGNORED_DIRECTIVE, NORID, DIRECTIVE},
- {"use_seize_file_restricted", USE_SEIZE_FILE_RESTRICTED, NORID, DIRECTIVE},
- {"ONLY_FOR_TARGET", IGNORED_DIRECTIVE, NORID, DIRECTIVE},
- {"extra_const_seg", IGNORED_DIRECTIVE, NORID, DIRECTIVE},
- {"multiple_const_segs", IGNORED_DIRECTIVE, NORID, DIRECTIVE},
- {"RECURSIVE", RECURSIVE, NORID, RESERVED},
- {"DEBUG_SYMBOLS", IGNORED_DIRECTIVE, NORID, DIRECTIVE},
- {"DEBUG_TYPES", IGNORED_DIRECTIVE, NORID, DIRECTIVE},
- {"GRANT_FILE_SIZE", IGNORED_DIRECTIVE, NORID, DIRECTIVE},
- {"DEBUG_LINES", IGNORED_DIRECTIVE, NORID, DIRECTIVE},
- {"ONLY_FOR_SIMULATION", IGNORED_DIRECTIVE, NORID, DIRECTIVE},
- {"state_routine", IGNORED_DIRECTIVE, NORID, DIRECTIVE},
- {"generate_set_names", IGNORED_DIRECTIVE, NORID, DIRECTIVE},
- {"print_o_code", IGNORED_DIRECTIVE, NORID, DIRECTIVE},
- {"PROCESS_TYPE", PROCESS_TYPE_TOKEN, NORID, DIRECTIVE},
- {"short_pred_succ", IGNORED_DIRECTIVE, NORID, DIRECTIVE},
- {"reentrant", IGNORED_DIRECTIVE, NORID, DIRECTIVE},
- {"RECEIVE", RECEIVE, NORID, RESERVED},
- {"EVENT_CODE", IGNORED_DIRECTIVE, NORID, DIRECTIVE},
- {"optimize_runtime", IGNORED_DIRECTIVE, NORID, DIRECTIVE},
- {"SUPPORT_CAUSING_ADDRESS", IGNORED_DIRECTIVE, NORID, DIRECTIVE},
- {"print_symbol_table", IGNORED_DIRECTIVE, NORID, DIRECTIVE},
- {"REENTRANT_ALL", IGNORED_DIRECTIVE, NORID, DIRECTIVE},
- {"PRINT_SYMBOL_TABLE", IGNORED_DIRECTIVE, NORID, DIRECTIVE},
- {"BUFFER_CODE", IGNORED_DIRECTIVE, NORID, DIRECTIVE},
- {"generate_all_set_names", IGNORED_DIRECTIVE, NORID, DIRECTIVE},
- {"NO_OVERLAP_CHECK", IGNORED_DIRECTIVE, NORID, DIRECTIVE},
- {"no_overlap_check", IGNORED_DIRECTIVE, NORID, DIRECTIVE},
- {"reentrant_all", IGNORED_DIRECTIVE, NORID, DIRECTIVE},
- {"MULTIPLE_DATA_SEGS", IGNORED_DIRECTIVE, NORID, DIRECTIVE},
- {"OPTIMIZE_RUNTIME", IGNORED_DIRECTIVE, NORID, DIRECTIVE},
- {"only_for_target", IGNORED_DIRECTIVE, NORID, DIRECTIVE},
- {"MULTIPLE_CONST_SEGS", IGNORED_DIRECTIVE, NORID, DIRECTIVE},
- {"optimization_window", IGNORED_DIRECTIVE, NORID, DIRECTIVE},
- {"support_causing_address", IGNORED_DIRECTIVE, NORID, DIRECTIVE},
- {"USE_SEIZE_FILE", USE_SEIZE_FILE, NORID, DIRECTIVE},
- {"SEND_SIGNAL_DEFAULT_PRIORITY", SEND_SIGNAL_DEFAULT_PRIORITY, NORID, DIRECTIVE},
- {"make_publics_for_discrete_syns", IGNORED_DIRECTIVE, NORID, DIRECTIVE},
- {"only_for_simulation", IGNORED_DIRECTIVE, NORID, DIRECTIVE},
- {"send_signal_default_priority", SEND_SIGNAL_DEFAULT_PRIORITY, NORID, DIRECTIVE},
- {"send_buffer_default_priority", SEND_BUFFER_DEFAULT_PRIORITY, NORID, DIRECTIVE},
- {"GENERATE_SET_NAMES", IGNORED_DIRECTIVE, NORID, DIRECTIVE},
- {"MAKE_PUBLICS_FOR_DISCRETE_SYNS", IGNORED_DIRECTIVE, NORID, DIRECTIVE},
- {"SEND_BUFFER_DEFAULT_PRIORITY", SEND_BUFFER_DEFAULT_PRIORITY, NORID, DIRECTIVE},
- {"GENERATE_ALL_SET_NAMES", IGNORED_DIRECTIVE, NORID, DIRECTIVE},
- {"USE_SEIZE_FILE_RESTRICTED", USE_SEIZE_FILE_RESTRICTED, NORID, DIRECTIVE}
- };
-
- if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
- {
- register int key = hash (str, len);
-
- if (key <= MAX_HASH_VALUE && key >= MIN_HASH_VALUE)
- {
- register struct resword *wordptr;
- register struct resword *wordendptr;
- register struct resword *resword;
-
- switch (key - 7)
- {
- case 0:
- resword = &wordlist[0];
- goto compare;
- case 5:
- resword = &wordlist[1];
- goto compare;
- case 16:
- resword = &wordlist[2];
- goto compare;
- case 23:
- resword = &wordlist[3];
- goto compare;
- case 36:
- resword = &wordlist[4];
- goto compare;
- case 42:
- resword = &wordlist[5];
- goto compare;
- case 48:
- resword = &wordlist[6];
- goto compare;
- case 53:
- wordptr = &wordlist[7];
- wordendptr = wordptr + 2;
- goto multicompare;
- case 60:
- resword = &wordlist[9];
- goto compare;
- case 61:
- resword = &wordlist[10];
- goto compare;
- case 66:
- resword = &wordlist[11];
- goto compare;
- case 76:
- resword = &wordlist[12];
- goto compare;
- case 83:
- wordptr = &wordlist[13];
- wordendptr = wordptr + 2;
- goto multicompare;
- case 86:
- resword = &wordlist[15];
- goto compare;
- case 88:
- wordptr = &wordlist[16];
- wordendptr = wordptr + 2;
- goto multicompare;
- case 91:
- resword = &wordlist[18];
- goto compare;
- case 94:
- resword = &wordlist[19];
- goto compare;
- case 99:
- resword = &wordlist[20];
- goto compare;
- case 100:
- resword = &wordlist[21];
- goto compare;
- case 103:
- resword = &wordlist[22];
- goto compare;
- case 105:
- resword = &wordlist[23];
- goto compare;
- case 107:
- resword = &wordlist[24];
- goto compare;
- case 111:
- resword = &wordlist[25];
- goto compare;
- case 113:
- resword = &wordlist[26];
- goto compare;
- case 116:
- resword = &wordlist[27];
- goto compare;
- case 120:
- resword = &wordlist[28];
- goto compare;
- case 121:
- resword = &wordlist[29];
- goto compare;
- case 122:
- resword = &wordlist[30];
- goto compare;
- case 123:
- resword = &wordlist[31];
- goto compare;
- case 129:
- resword = &wordlist[32];
- goto compare;
- case 131:
- resword = &wordlist[33];
- goto compare;
- case 132:
- resword = &wordlist[34];
- goto compare;
- case 136:
- resword = &wordlist[35];
- goto compare;
- case 137:
- resword = &wordlist[36];
- goto compare;
- case 140:
- resword = &wordlist[37];
- goto compare;
- case 142:
- resword = &wordlist[38];
- goto compare;
- case 146:
- resword = &wordlist[39];
- goto compare;
- case 150:
- resword = &wordlist[40];
- goto compare;
- case 155:
- resword = &wordlist[41];
- goto compare;
- case 157:
- resword = &wordlist[42];
- goto compare;
- case 163:
- resword = &wordlist[43];
- goto compare;
- case 165:
- resword = &wordlist[44];
- goto compare;
- case 167:
- resword = &wordlist[45];
- goto compare;
- case 168:
- resword = &wordlist[46];
- goto compare;
- case 171:
- resword = &wordlist[47];
- goto compare;
- case 175:
- resword = &wordlist[48];
- goto compare;
- case 177:
- resword = &wordlist[49];
- goto compare;
- case 178:
- resword = &wordlist[50];
- goto compare;
- case 180:
- resword = &wordlist[51];
- goto compare;
- case 184:
- resword = &wordlist[52];
- goto compare;
- case 187:
- resword = &wordlist[53];
- goto compare;
- case 189:
- resword = &wordlist[54];
- goto compare;
- case 193:
- resword = &wordlist[55];
- goto compare;
- case 194:
- resword = &wordlist[56];
- goto compare;
- case 195:
- resword = &wordlist[57];
- goto compare;
- case 196:
- resword = &wordlist[58];
- goto compare;
- case 197:
- resword = &wordlist[59];
- goto compare;
- case 202:
- resword = &wordlist[60];
- goto compare;
- case 209:
- resword = &wordlist[61];
- goto compare;
- case 213:
- resword = &wordlist[62];
- goto compare;
- case 217:
- resword = &wordlist[63];
- goto compare;
- case 218:
- resword = &wordlist[64];
- goto compare;
- case 219:
- wordptr = &wordlist[65];
- wordendptr = wordptr + 2;
- goto multicompare;
- case 220:
- wordptr = &wordlist[67];
- wordendptr = wordptr + 2;
- goto multicompare;
- case 225:
- resword = &wordlist[69];
- goto compare;
- case 229:
- resword = &wordlist[70];
- goto compare;
- case 232:
- resword = &wordlist[71];
- goto compare;
- case 240:
- resword = &wordlist[72];
- goto compare;
- case 246:
- resword = &wordlist[73];
- goto compare;
- case 250:
- resword = &wordlist[74];
- goto compare;
- case 251:
- resword = &wordlist[75];
- goto compare;
- case 254:
- resword = &wordlist[76];
- goto compare;
- case 255:
- resword = &wordlist[77];
- goto compare;
- case 257:
- resword = &wordlist[78];
- goto compare;
- case 258:
- resword = &wordlist[79];
- goto compare;
- case 262:
- resword = &wordlist[80];
- goto compare;
- case 264:
- resword = &wordlist[81];
- goto compare;
- case 270:
- resword = &wordlist[82];
- goto compare;
- case 273:
- resword = &wordlist[83];
- goto compare;
- case 275:
- resword = &wordlist[84];
- goto compare;
- case 279:
- resword = &wordlist[85];
- goto compare;
- case 284:
- resword = &wordlist[86];
- goto compare;
- case 286:
- resword = &wordlist[87];
- goto compare;
- case 289:
- resword = &wordlist[88];
- goto compare;
- case 291:
- resword = &wordlist[89];
- goto compare;
- case 293:
- resword = &wordlist[90];
- goto compare;
- case 294:
- resword = &wordlist[91];
- goto compare;
- case 296:
- resword = &wordlist[92];
- goto compare;
- case 297:
- resword = &wordlist[93];
- goto compare;
- case 298:
- resword = &wordlist[94];
- goto compare;
- case 300:
- resword = &wordlist[95];
- goto compare;
- case 302:
- resword = &wordlist[96];
- goto compare;
- case 307:
- resword = &wordlist[97];
- goto compare;
- case 308:
- resword = &wordlist[98];
- goto compare;
- case 317:
- resword = &wordlist[99];
- goto compare;
- case 322:
- resword = &wordlist[100];
- goto compare;
- case 325:
- resword = &wordlist[101];
- goto compare;
- case 331:
- resword = &wordlist[102];
- goto compare;
- case 332:
- resword = &wordlist[103];
- goto compare;
- case 335:
- resword = &wordlist[104];
- goto compare;
- case 336:
- resword = &wordlist[105];
- goto compare;
- case 339:
- resword = &wordlist[106];
- goto compare;
- case 342:
- resword = &wordlist[107];
- goto compare;
- case 344:
- resword = &wordlist[108];
- goto compare;
- case 345:
- resword = &wordlist[109];
- goto compare;
- case 349:
- resword = &wordlist[110];
- goto compare;
- case 350:
- resword = &wordlist[111];
- goto compare;
- case 354:
- resword = &wordlist[112];
- goto compare;
- case 356:
- resword = &wordlist[113];
- goto compare;
- case 357:
- resword = &wordlist[114];
- goto compare;
- case 358:
- resword = &wordlist[115];
- goto compare;
- case 359:
- resword = &wordlist[116];
- goto compare;
- case 360:
- resword = &wordlist[117];
- goto compare;
- case 366:
- resword = &wordlist[118];
- goto compare;
- case 380:
- resword = &wordlist[119];
- goto compare;
- case 389:
- resword = &wordlist[120];
- goto compare;
- case 402:
- resword = &wordlist[121];
- goto compare;
- case 404:
- resword = &wordlist[122];
- goto compare;
- case 408:
- resword = &wordlist[123];
- goto compare;
- case 410:
- resword = &wordlist[124];
- goto compare;
- case 411:
- resword = &wordlist[125];
- goto compare;
- case 415:
- resword = &wordlist[126];
- goto compare;
- case 416:
- resword = &wordlist[127];
- goto compare;
- case 422:
- resword = &wordlist[128];
- goto compare;
- case 423:
- resword = &wordlist[129];
- goto compare;
- case 426:
- resword = &wordlist[130];
- goto compare;
- case 427:
- resword = &wordlist[131];
- goto compare;
- case 428:
- resword = &wordlist[132];
- goto compare;
- case 433:
- resword = &wordlist[133];
- goto compare;
- case 436:
- resword = &wordlist[134];
- goto compare;
- case 438:
- resword = &wordlist[135];
- goto compare;
- case 439:
- resword = &wordlist[136];
- goto compare;
- case 441:
- resword = &wordlist[137];
- goto compare;
- case 444:
- wordptr = &wordlist[138];
- wordendptr = wordptr + 2;
- goto multicompare;
- case 445:
- resword = &wordlist[140];
- goto compare;
- case 453:
- resword = &wordlist[141];
- goto compare;
- case 454:
- resword = &wordlist[142];
- goto compare;
- case 455:
- resword = &wordlist[143];
- goto compare;
- case 456:
- resword = &wordlist[144];
- goto compare;
- case 459:
- resword = &wordlist[145];
- goto compare;
- case 468:
- resword = &wordlist[146];
- goto compare;
- case 476:
- resword = &wordlist[147];
- goto compare;
- case 479:
- resword = &wordlist[148];
- goto compare;
- case 480:
- resword = &wordlist[149];
- goto compare;
- case 481:
- resword = &wordlist[150];
- goto compare;
- case 482:
- resword = &wordlist[151];
- goto compare;
- case 484:
- resword = &wordlist[152];
- goto compare;
- case 487:
- resword = &wordlist[153];
- goto compare;
- case 491:
- resword = &wordlist[154];
- goto compare;
- case 492:
- resword = &wordlist[155];
- goto compare;
- case 498:
- resword = &wordlist[156];
- goto compare;
- case 505:
- resword = &wordlist[157];
- goto compare;
- case 506:
- resword = &wordlist[158];
- goto compare;
- case 514:
- resword = &wordlist[159];
- goto compare;
- case 533:
- resword = &wordlist[160];
- goto compare;
- case 536:
- resword = &wordlist[161];
- goto compare;
- case 539:
- resword = &wordlist[162];
- goto compare;
- case 540:
- resword = &wordlist[163];
- goto compare;
- case 542:
- resword = &wordlist[164];
- goto compare;
- case 544:
- resword = &wordlist[165];
- goto compare;
- case 547:
- resword = &wordlist[166];
- goto compare;
- case 550:
- resword = &wordlist[167];
- goto compare;
- case 551:
- resword = &wordlist[168];
- goto compare;
- case 561:
- resword = &wordlist[169];
- goto compare;
- case 567:
- resword = &wordlist[170];
- goto compare;
- case 569:
- resword = &wordlist[171];
- goto compare;
- case 576:
- resword = &wordlist[172];
- goto compare;
- case 580:
- resword = &wordlist[173];
- goto compare;
- case 583:
- resword = &wordlist[174];
- goto compare;
- case 584:
- resword = &wordlist[175];
- goto compare;
- case 585:
- resword = &wordlist[176];
- goto compare;
- case 589:
- resword = &wordlist[177];
- goto compare;
- case 592:
- resword = &wordlist[178];
- goto compare;
- case 593:
- resword = &wordlist[179];
- goto compare;
- case 596:
- resword = &wordlist[180];
- goto compare;
- case 597:
- resword = &wordlist[181];
- goto compare;
- case 600:
- resword = &wordlist[182];
- goto compare;
- case 610:
- resword = &wordlist[183];
- goto compare;
- case 611:
- resword = &wordlist[184];
- goto compare;
- case 615:
- resword = &wordlist[185];
- goto compare;
- case 616:
- resword = &wordlist[186];
- goto compare;
- case 617:
- resword = &wordlist[187];
- goto compare;
- case 621:
- resword = &wordlist[188];
- goto compare;
- case 629:
- resword = &wordlist[189];
- goto compare;
- case 632:
- resword = &wordlist[190];
- goto compare;
- case 634:
- resword = &wordlist[191];
- goto compare;
- case 643:
- resword = &wordlist[192];
- goto compare;
- case 645:
- resword = &wordlist[193];
- goto compare;
- case 654:
- resword = &wordlist[194];
- goto compare;
- case 657:
- resword = &wordlist[195];
- goto compare;
- case 663:
- resword = &wordlist[196];
- goto compare;
- case 665:
- resword = &wordlist[197];
- goto compare;
- case 675:
- resword = &wordlist[198];
- goto compare;
- case 678:
- resword = &wordlist[199];
- goto compare;
- case 684:
- resword = &wordlist[200];
- goto compare;
- case 690:
- resword = &wordlist[201];
- goto compare;
- case 700:
- resword = &wordlist[202];
- goto compare;
- case 702:
- resword = &wordlist[203];
- goto compare;
- case 710:
- resword = &wordlist[204];
- goto compare;
- case 713:
- resword = &wordlist[205];
- goto compare;
- case 720:
- resword = &wordlist[206];
- goto compare;
- case 723:
- resword = &wordlist[207];
- goto compare;
- case 724:
- resword = &wordlist[208];
- goto compare;
- case 738:
- resword = &wordlist[209];
- goto compare;
- case 741:
- resword = &wordlist[210];
- goto compare;
- case 743:
- resword = &wordlist[211];
- goto compare;
- case 744:
- resword = &wordlist[212];
- goto compare;
- case 749:
- resword = &wordlist[213];
- goto compare;
- case 751:
- resword = &wordlist[214];
- goto compare;
- case 755:
- resword = &wordlist[215];
- goto compare;
- case 761:
- resword = &wordlist[216];
- goto compare;
- case 764:
- resword = &wordlist[217];
- goto compare;
- case 766:
- resword = &wordlist[218];
- goto compare;
- case 768:
- resword = &wordlist[219];
- goto compare;
- case 769:
- resword = &wordlist[220];
- goto compare;
- case 770:
- resword = &wordlist[221];
- goto compare;
- case 772:
- resword = &wordlist[222];
- goto compare;
- case 784:
- resword = &wordlist[223];
- goto compare;
- case 800:
- resword = &wordlist[224];
- goto compare;
- case 807:
- resword = &wordlist[225];
- goto compare;
- case 808:
- resword = &wordlist[226];
- goto compare;
- case 823:
- resword = &wordlist[227];
- goto compare;
- case 826:
- resword = &wordlist[228];
- goto compare;
- case 827:
- resword = &wordlist[229];
- goto compare;
- case 839:
- resword = &wordlist[230];
- goto compare;
- case 842:
- resword = &wordlist[231];
- goto compare;
- case 868:
- resword = &wordlist[232];
- goto compare;
- case 902:
- resword = &wordlist[233];
- goto compare;
- case 903:
- resword = &wordlist[234];
- goto compare;
- case 905:
- resword = &wordlist[235];
- goto compare;
- case 919:
- resword = &wordlist[236];
- goto compare;
- case 924:
- resword = &wordlist[237];
- goto compare;
- case 926:
- resword = &wordlist[238];
- goto compare;
- case 937:
- resword = &wordlist[239];
- goto compare;
- case 940:
- resword = &wordlist[240];
- goto compare;
- case 975:
- resword = &wordlist[241];
- goto compare;
- case 979:
- resword = &wordlist[242];
- goto compare;
- case 982:
- resword = &wordlist[243];
- goto compare;
- case 997:
- resword = &wordlist[244];
- goto compare;
- case 1000:
- resword = &wordlist[245];
- goto compare;
- case 1011:
- resword = &wordlist[246];
- goto compare;
- case 1012:
- resword = &wordlist[247];
- goto compare;
- case 1016:
- resword = &wordlist[248];
- goto compare;
- case 1028:
- resword = &wordlist[249];
- goto compare;
- case 1029:
- resword = &wordlist[250];
- goto compare;
- case 1032:
- resword = &wordlist[251];
- goto compare;
- case 1061:
- resword = &wordlist[252];
- goto compare;
- case 1070:
- resword = &wordlist[253];
- goto compare;
- case 1075:
- resword = &wordlist[254];
- goto compare;
- case 1079:
- resword = &wordlist[255];
- goto compare;
- case 1097:
- resword = &wordlist[256];
- goto compare;
- case 1098:
- resword = &wordlist[257];
- goto compare;
- case 1102:
- resword = &wordlist[258];
- goto compare;
- case 1131:
- resword = &wordlist[259];
- goto compare;
- case 1145:
- resword = &wordlist[260];
- goto compare;
- case 1155:
- resword = &wordlist[261];
- goto compare;
- case 1158:
- resword = &wordlist[262];
- goto compare;
- case 1160:
- resword = &wordlist[263];
- goto compare;
- case 1161:
- resword = &wordlist[264];
- goto compare;
- case 1175:
- resword = &wordlist[265];
- goto compare;
- case 1187:
- resword = &wordlist[266];
- goto compare;
- case 1200:
- resword = &wordlist[267];
- goto compare;
- case 1209:
- resword = &wordlist[268];
- goto compare;
- case 1210:
- resword = &wordlist[269];
- goto compare;
- case 1220:
- resword = &wordlist[270];
- goto compare;
- case 1235:
- resword = &wordlist[271];
- goto compare;
- case 1264:
- resword = &wordlist[272];
- goto compare;
- case 1267:
- resword = &wordlist[273];
- goto compare;
- case 1276:
- resword = &wordlist[274];
- goto compare;
- case 1294:
- resword = &wordlist[275];
- goto compare;
- case 1295:
- resword = &wordlist[276];
- goto compare;
- case 1314:
- resword = &wordlist[277];
- goto compare;
- case 1317:
- resword = &wordlist[278];
- goto compare;
- case 1332:
- resword = &wordlist[279];
- goto compare;
- case 1335:
- resword = &wordlist[280];
- goto compare;
- case 1338:
- resword = &wordlist[281];
- goto compare;
- case 1365:
- resword = &wordlist[282];
- goto compare;
- case 1415:
- resword = &wordlist[283];
- goto compare;
- case 1441:
- resword = &wordlist[284];
- goto compare;
- case 1539:
- resword = &wordlist[285];
- goto compare;
- case 1599:
- resword = &wordlist[286];
- goto compare;
- case 1647:
- resword = &wordlist[287];
- goto compare;
- case 1758:
- resword = &wordlist[288];
- goto compare;
- case 1801:
- resword = &wordlist[289];
- goto compare;
- case 1868:
- resword = &wordlist[290];
- goto compare;
- case 1870:
- resword = &wordlist[291];
- goto compare;
- case 1929:
- resword = &wordlist[292];
- goto compare;
- case 1982:
- resword = &wordlist[293];
- goto compare;
- case 2146:
- resword = &wordlist[294];
- goto compare;
- case 2217:
- resword = &wordlist[295];
- goto compare;
- case 2376:
- resword = &wordlist[296];
- goto compare;
- case 2441:
- resword = &wordlist[297];
- goto compare;
- case 2484:
- resword = &wordlist[298];
- goto compare;
- case 2814:
- resword = &wordlist[299];
- goto compare;
- }
- return 0;
- multicompare:
- while (wordptr < wordendptr)
- {
- register const char *s = wordptr->name;
-
- if (*str == *s && !strcmp (str + 1, s + 1))
- return wordptr;
- wordptr++;
- }
- return 0;
- compare:
- {
- register const char *s = resword->name;
-
- if (*str == *s && !strcmp (str + 1, s + 1))
- return resword;
- }
- }
- }
- return 0;
-}
diff --git a/gcc/ch/inout.c b/gcc/ch/inout.c
deleted file mode 100644
index c4593471eaf..00000000000
--- a/gcc/ch/inout.c
+++ /dev/null
@@ -1,4691 +0,0 @@
-/* Implement I/O-related actions for CHILL.
- Copyright (C) 1992, 1993, 1994, 1998, 1999, 2000
- Free Software Foundation, Inc.
-
- This file is part of GNU CC.
-
- GNU CC is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- GNU CC is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with GNU CC; see the file COPYING. If not, write to
- the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-#include "config.h"
-#include "system.h"
-#include "tree.h"
-#include "ch-tree.h"
-#include "rtl.h"
-#include "lex.h"
-#include "flags.h"
-#include "input.h"
-#include "assert.h"
-#include "toplev.h"
-
-/* set non-zero if input text is forced to lowercase */
-extern int ignore_case;
-
-/* set non-zero if special words are to be entered in uppercase */
-extern int special_UC;
-
-static int intsize_of_charsexpr PARAMS ((tree));
-static tree add_enum_to_list PARAMS ((tree, tree));
-static void build_chill_io_list_type PARAMS ((void));
-static void build_io_types PARAMS ((void));
-static void declare_predefined_file PARAMS ((const char *, const char *));
-static tree build_access_part PARAMS ((void));
-static tree textlocation_mode PARAMS ((tree));
-static int check_assoc PARAMS ((tree, int, const char *));
-static tree assoc_call PARAMS ((tree, tree, const char *));
-static int check_transfer PARAMS ((tree, int, const char *));
-static int connect_process_optionals PARAMS ((tree, tree *, tree *, tree));
-static tree connect_text PARAMS ((tree, tree, tree, tree));
-static tree connect_access PARAMS ((tree, tree, tree, tree));
-static int check_access PARAMS ((tree, int, const char *));
-static int check_text PARAMS ((tree, int, const char *));
-static tree get_final_type_and_range PARAMS ((tree, tree *, tree *));
-static void process_io_list PARAMS ((tree, tree *, tree *, rtx *,
- int, int));
-static void check_format_string PARAMS ((tree, tree, int));
-static int get_max_size PARAMS ((tree));
-
-/* association mode */
-tree association_type_node;
-/* initialzier for association mode */
-tree association_init_value;
-
-/* NOTE: should be same as in runtime/chillrt0.c */
-#define STDIO_TEXT_LENGTH 1024
-/* mode of stdout, stdin, stderr*/
-static tree stdio_type_node;
-
-/* usage- and where modes */
-tree usage_type_node;
-tree where_type_node;
-
-/* we have to distinguish between io-list-type for WRITETEXT
- and for READTEXT. WRITETEXT does not process ranges and
- READTEXT must get pointers to the variables.
- */
-/* variable to hold the type of the io_list */
-static tree chill_io_list_type = NULL_TREE;
-
-/* the type for the enum tables */
-static tree enum_table_type = NULL_TREE;
-
-/* structure to save enums for later use in compilation */
-typedef struct save_enum_names
-{
- struct save_enum_names *forward;
- tree name;
- tree decl;
-} SAVE_ENUM_NAMES;
-
-static SAVE_ENUM_NAMES *used_enum_names = (SAVE_ENUM_NAMES *)0;
-
-typedef struct save_enum_values
-{
- long val;
- struct save_enum_names *name;
-} SAVE_ENUM_VALUES;
-
-typedef struct save_enums
-{
- struct save_enums *forward;
- tree context;
- tree type;
- tree ptrdecl;
- long num_vals;
- struct save_enum_values *vals;
-} SAVE_ENUMS;
-
-static SAVE_ENUMS *used_enums = (SAVE_ENUMS *)0;
-
-
-/* Function collects all enums are necessary to collect, makes a copy of
- the value and returns a VAR_DECL external to current function describing
- the pointer to a name table, which will be generated at the end of
- compilation
- */
-
-static tree add_enum_to_list (type, context)
- tree type;
- tree context;
-{
- tree tmp;
- SAVE_ENUMS *wrk = used_enums;
- SAVE_ENUM_VALUES *vals;
- SAVE_ENUM_NAMES *names;
-
- while (wrk != (SAVE_ENUMS *)0)
- {
- /* search for this enum already in use */
- if (wrk->context == context && wrk->type == type)
- {
- /* yes, found. look if the ptrdecl is valid in this scope */
- tree var = DECL_NAME (wrk->ptrdecl);
- tree decl = lookup_name (var);
-
- if (decl == NULL_TREE)
- {
- /* no, not valid in this context, declare it */
- decl = decl_temp1 (var, build_pointer_type (TREE_TYPE (enum_table_type)),
- 0, NULL_TREE, 1, 0);
- }
- return decl;
- }
-
- /* next one */
- wrk = wrk->forward;
- }
-
- /* not yet found -- generate an entry */
- wrk = (SAVE_ENUMS *)xmalloc (sizeof (SAVE_ENUMS));
- wrk->forward = used_enums;
- used_enums = wrk;
-
- /* generate the pointer decl */
- wrk->ptrdecl = get_unique_identifier ("ENUMTABPTR");
- wrk->ptrdecl = decl_temp1 (wrk->ptrdecl, build_pointer_type (TREE_TYPE (enum_table_type)),
- 0, NULL_TREE, 1, 0);
-
- /* save information for later use */
- wrk->context = context;
- wrk->type = type;
-
- /* insert the names and values */
- tmp = TYPE_FIELDS (type);
- wrk->num_vals = list_length (tmp);
- vals = (SAVE_ENUM_VALUES *)xmalloc (sizeof (SAVE_ENUM_VALUES) * wrk->num_vals);
- wrk->vals = vals;
-
- while (tmp != NULL_TREE)
- {
- /* search if name is already in use */
- names = used_enum_names;
- while (names != (SAVE_ENUM_NAMES *)0)
- {
- if (names->name == TREE_PURPOSE (tmp))
- break;
- names = names->forward;
- }
- if (names == (SAVE_ENUM_NAMES *)0)
- {
- /* we have to insert one */
- names = (SAVE_ENUM_NAMES *)xmalloc (sizeof (SAVE_ENUM_NAMES));
- names->forward = used_enum_names;
- used_enum_names = names;
- names->decl = NULL_TREE;
- names->name = TREE_PURPOSE (tmp);
- }
- vals->name = names;
- vals->val = TREE_INT_CST_LOW (TREE_VALUE (tmp));
-
- /* next entry in enum */
- vals++;
- tmp = TREE_CHAIN (tmp);
- }
-
- /* return the generated decl */
- return wrk->ptrdecl;
-}
-
-
-static void
-build_chill_io_list_type ()
-{
- tree list = NULL_TREE;
- tree result, enum1, listbase;
- tree io_descriptor;
- tree decl1, decl2;
- tree forcharstring, forset_W, forset_R, forboolrange;
-
- tree forintrange, intunion, forsetrange, forcharrange;
- tree long_type, ulong_type, union_type;
-
- long_type = long_integer_type_node;
- ulong_type = long_unsigned_type_node;
-
- if (chill_io_list_type != NULL_TREE)
- /* already done */
- return;
-
- /* first build the enum for the desriptor */
- enum1 = start_enum (NULL_TREE);
- result = build_enumerator (get_identifier ("__IO_UNUSED"),
- NULL_TREE);
- list = chainon (result, list);
-
- result = build_enumerator (get_identifier ("__IO_ByteVal"),
- NULL_TREE);
- list = chainon (result, list);
-
- result = build_enumerator (get_identifier ("__IO_UByteVal"),
- NULL_TREE);
- list = chainon (result, list);
-
- result = build_enumerator (get_identifier ("__IO_IntVal"),
- NULL_TREE);
- list = chainon (result, list);
-
- result = build_enumerator (get_identifier ("__IO_UIntVal"),
- NULL_TREE);
- list = chainon (result, list);
-
- result = build_enumerator (get_identifier ("__IO_LongVal"),
- NULL_TREE);
- list = chainon (result, list);
-
- result = build_enumerator (get_identifier ("__IO_ULongVal"),
- NULL_TREE);
- list = chainon (result, list);
-
- result = build_enumerator (get_identifier ("__IO_ByteLoc"),
- NULL_TREE);
- list = chainon (result, list);
-
- result = build_enumerator (get_identifier ("__IO_UByteLoc"),
- NULL_TREE);
- list = chainon (result, list);
-
- result = build_enumerator (get_identifier ("__IO_IntLoc"),
- NULL_TREE);
- list = chainon (result, list);
-
- result = build_enumerator (get_identifier ("__IO_UIntLoc"),
- NULL_TREE);
- list = chainon (result, list);
-
- result = build_enumerator (get_identifier ("__IO_LongLoc"),
- NULL_TREE);
- list = chainon (result, list);
-
- result = build_enumerator (get_identifier ("__IO_ULongLoc"),
- NULL_TREE);
- list = chainon (result, list);
-
- result = build_enumerator (get_identifier ("__IO_ByteRangeLoc"),
- NULL_TREE);
- list = chainon (result, list);
-
- result = build_enumerator (get_identifier ("__IO_UByteRangeLoc"),
- NULL_TREE);
- list = chainon (result, list);
-
- result = build_enumerator (get_identifier ("__IO_IntRangeLoc"),
- NULL_TREE);
- list = chainon (result, list);
-
- result = build_enumerator (get_identifier ("__IO_UIntRangeLoc"),
- NULL_TREE);
- list = chainon (result, list);
-
- result = build_enumerator (get_identifier ("__IO_LongRangeLoc"),
- NULL_TREE);
- list = chainon (result, list);
-
- result = build_enumerator (get_identifier ("__IO_ULongRangeLoc"),
- NULL_TREE);
- list = chainon (result, list);
-
- result = build_enumerator (get_identifier ("__IO_BoolVal"),
- NULL_TREE);
- list = chainon (result, list);
-
- result = build_enumerator (get_identifier ("__IO_BoolLoc"),
- NULL_TREE);
- list = chainon (result, list);
-
- result = build_enumerator (get_identifier ("__IO_BoolRangeLoc"),
- NULL_TREE);
- list = chainon (result, list);
-
- result = build_enumerator (get_identifier ("__IO_SetVal"),
- NULL_TREE);
- list = chainon (result, list);
-
- result = build_enumerator (get_identifier ("__IO_SetLoc"),
- NULL_TREE);
- list = chainon (result, list);
-
- result = build_enumerator (get_identifier ("__IO_SetRangeLoc"),
- NULL_TREE);
- list = chainon (result, list);
-
- result = build_enumerator (get_identifier ("__IO_CharVal"),
- NULL_TREE);
- list = chainon (result, list);
-
- result = build_enumerator (get_identifier ("__IO_CharLoc"),
- NULL_TREE);
- list = chainon (result, list);
-
- result = build_enumerator (get_identifier ("__IO_CharRangeLoc"),
- NULL_TREE);
- list = chainon (result, list);
-
- result = build_enumerator (get_identifier ("__IO_CharStrLoc"),
- NULL_TREE);
- list = chainon (result, list);
-
- result = build_enumerator (get_identifier ("__IO_CharVaryingLoc"),
- NULL_TREE);
- list = chainon (result, list);
-
- result = build_enumerator (get_identifier ("__IO_BitStrLoc"),
- NULL_TREE);
- list = chainon (result, list);
-
- result = build_enumerator (get_identifier ("__IO_RealVal"),
- NULL_TREE);
- list = chainon (result, list);
-
- result = build_enumerator (get_identifier ("__IO_RealLoc"),
- NULL_TREE);
- list = chainon (result, list);
-
- result = build_enumerator (get_identifier ("__IO_LongRealVal"),
- NULL_TREE);
- list = chainon (result, list);
-
- result = build_enumerator (get_identifier ("__IO_LongRealLoc"),
- NULL_TREE);
- list = chainon (result, list);
-#if 0
- result = build_enumerator (get_identifier ("_IO_Pointer"),
- NULL_TREE);
- list = chainon (result, list);
-#endif
-
- result = finish_enum (enum1, list);
- pushdecl (io_descriptor = build_decl (TYPE_DECL,
- get_identifier ("__tmp_IO_enum"),
- result));
- /* prevent seizing/granting of the decl */
- DECL_SOURCE_LINE (io_descriptor) = 0;
- satisfy_decl (io_descriptor, 0);
-
- /* build type for enum_tables */
- decl1 = build_decl (FIELD_DECL, get_identifier ("value"),
- long_type);
- DECL_INITIAL (decl1) = NULL_TREE;
- decl2 = build_decl (FIELD_DECL, get_identifier ("name"),
- build_pointer_type (char_type_node));
- DECL_INITIAL (decl2) = NULL_TREE;
- TREE_CHAIN (decl1) = decl2;
- TREE_CHAIN (decl2) = NULL_TREE;
- result = build_chill_struct_type (decl1);
- pushdecl (enum_table_type = build_decl (TYPE_DECL,
- get_identifier ("__tmp_IO_enum_table_type"),
- result));
- DECL_SOURCE_LINE (enum_table_type) = 0;
- satisfy_decl (enum_table_type, 0);
-
- /* build type for writing a set mode */
- decl1 = build_decl (FIELD_DECL, get_identifier ("value"),
- long_type);
- DECL_INITIAL (decl1) = NULL_TREE;
- listbase = decl1;
-
- decl2 = build_decl (FIELD_DECL, get_identifier ("name_table"),
- build_pointer_type (TREE_TYPE (enum_table_type)));
- DECL_INITIAL (decl2) = NULL_TREE;
- TREE_CHAIN (decl1) = decl2;
- decl1 = decl2;
- TREE_CHAIN (decl2) = NULL_TREE;
-
- result = build_chill_struct_type (listbase);
- pushdecl (forset_W = build_decl (TYPE_DECL,
- get_identifier ("__tmp_WIO_set"),
- result));
- DECL_SOURCE_LINE (forset_W) = 0;
- satisfy_decl (forset_W, 0);
-
- /* build type for charrange */
- decl1 = build_decl (FIELD_DECL, get_identifier ("ptr"),
- build_pointer_type (char_type_node));
- DECL_INITIAL (decl1) = NULL_TREE;
- listbase = decl1;
-
- decl2 = build_decl (FIELD_DECL, get_identifier ("lower"),
- long_type);
- DECL_INITIAL (decl2) = NULL_TREE;
- TREE_CHAIN (decl1) = decl2;
- decl1 = decl2;
-
- decl2 = build_decl (FIELD_DECL, get_identifier ("upper"),
- long_type);
- DECL_INITIAL (decl2) = NULL_TREE;
- TREE_CHAIN (decl1) = decl2;
- TREE_CHAIN (decl2) = NULL_TREE;
-
- result = build_chill_struct_type (listbase);
- pushdecl (forcharrange = build_decl (TYPE_DECL,
- get_identifier ("__tmp_IO_charrange"),
- result));
- DECL_SOURCE_LINE (forcharrange) = 0;
- satisfy_decl (forcharrange, 0);
-
- /* type for integer range */
- decl1 = build_tree_list (NULL_TREE,
- build_decl (FIELD_DECL,
- get_identifier ("_slong"),
- long_type));
- listbase = decl1;
-
- decl2 = build_tree_list (NULL_TREE,
- build_decl (FIELD_DECL,
- get_identifier ("_ulong"),
- ulong_type));
- TREE_CHAIN (decl1) = decl2;
- TREE_CHAIN (decl2) = NULL_TREE;
-
- decl1 = grok_chill_variantdefs (NULL_TREE, listbase, NULL_TREE);
- TREE_CHAIN (decl1) = NULL_TREE;
- result = build_chill_struct_type (decl1);
- pushdecl (intunion = build_decl (TYPE_DECL,
- get_identifier ("__tmp_IO_long"),
- result));
- DECL_SOURCE_LINE (intunion) = 0;
- satisfy_decl (intunion, 0);
-
- decl1 = build_decl (FIELD_DECL,
- get_identifier ("ptr"),
- ptr_type_node);
- listbase = decl1;
-
- decl2 = build_decl (FIELD_DECL,
- get_identifier ("lower"),
- TREE_TYPE (intunion));
- TREE_CHAIN (decl1) = decl2;
- decl1 = decl2;
-
- decl2 = build_decl (FIELD_DECL,
- get_identifier ("upper"),
- TREE_TYPE (intunion));
- TREE_CHAIN (decl1) = decl2;
- TREE_CHAIN (decl2) = NULL_TREE;
-
- result = build_chill_struct_type (listbase);
- pushdecl (forintrange = build_decl (TYPE_DECL,
- get_identifier ("__tmp_IO_intrange"),
- result));
- DECL_SOURCE_LINE (forintrange) = 0;
- satisfy_decl (forintrange, 0);
-
- /* build structure for bool range */
- decl1 = build_decl (FIELD_DECL,
- get_identifier ("ptr"),
- ptr_type_node);
- DECL_INITIAL (decl1) = NULL_TREE;
- listbase = decl1;
-
- decl2 = build_decl (FIELD_DECL,
- get_identifier ("lower"),
- ulong_type);
- DECL_INITIAL (decl2) = NULL_TREE;
- TREE_CHAIN (decl1) = decl2;
- decl1 = decl2;
-
- decl2 = build_decl (FIELD_DECL,
- get_identifier ("upper"),
- ulong_type);
- DECL_INITIAL (decl2) = NULL_TREE;
- TREE_CHAIN (decl1) = decl2;
- TREE_CHAIN (decl2) = NULL_TREE;
-
- result = build_chill_struct_type (listbase);
- pushdecl (forboolrange = build_decl (TYPE_DECL,
- get_identifier ("__tmp_RIO_boolrange"),
- result));
- DECL_SOURCE_LINE (forboolrange) = 0;
- satisfy_decl (forboolrange, 0);
-
- /* build type for reading a set */
- decl1 = build_decl (FIELD_DECL, get_identifier ("ptr"),
- ptr_type_node);
- DECL_INITIAL (decl1) = NULL_TREE;
- listbase = decl1;
-
- decl2 = build_decl (FIELD_DECL, get_identifier ("length"),
- long_type);
- DECL_INITIAL (decl2) = NULL_TREE;
- TREE_CHAIN (decl1) = decl2;
- decl1 = decl2;
-
- decl2 = build_decl (FIELD_DECL, get_identifier ("name_table"),
- build_pointer_type (TREE_TYPE (enum_table_type)));
- DECL_INITIAL (decl2) = NULL_TREE;
- TREE_CHAIN (decl1) = decl2;
- TREE_CHAIN (decl2) = NULL_TREE;
-
- result = build_chill_struct_type (listbase);
- pushdecl (forset_R = build_decl (TYPE_DECL,
- get_identifier ("__tmp_RIO_set"),
- result));
- DECL_SOURCE_LINE (forset_R) = 0;
- satisfy_decl (forset_R, 0);
-
- /* build type for setrange */
- decl1 = build_decl (FIELD_DECL, get_identifier ("ptr"),
- ptr_type_node);
- DECL_INITIAL (decl1) = NULL_TREE;
- listbase = decl1;
-
- decl2 = build_decl (FIELD_DECL, get_identifier ("length"),
- long_type);
- DECL_INITIAL (decl2) = NULL_TREE;
- TREE_CHAIN (decl1) = decl2;
- decl1 = decl2;
-
- decl2 = build_decl (FIELD_DECL, get_identifier ("name_table"),
- build_pointer_type (TREE_TYPE (enum_table_type)));
- DECL_INITIAL (decl2) = NULL_TREE;
- TREE_CHAIN (decl1) = decl2;
- decl1 = decl2;
-
- decl2 = build_decl (FIELD_DECL, get_identifier ("lower"),
- long_type);
- DECL_INITIAL (decl2) = NULL_TREE;
- TREE_CHAIN (decl1) = decl2;
- decl1 = decl2;
-
- decl2 = build_decl (FIELD_DECL, get_identifier ("upper"),
- long_type);
- DECL_INITIAL (decl2) = NULL_TREE;
- TREE_CHAIN (decl1) = decl2;
- TREE_CHAIN (decl2) = NULL_TREE;
-
- result = build_chill_struct_type (listbase);
- pushdecl (forsetrange = build_decl (TYPE_DECL,
- get_identifier ("__tmp_RIO_setrange"),
- result));
- DECL_SOURCE_LINE (forsetrange) = 0;
- satisfy_decl (forsetrange, 0);
-
- /* build structure for character string */
- decl1 = build_decl (FIELD_DECL,
- get_identifier ("string"),
- build_pointer_type (char_type_node));
- DECL_INITIAL (decl1) = NULL_TREE;
- listbase = decl1;
-
- decl2 = build_decl (FIELD_DECL,
- get_identifier ("string_length"),
- ulong_type);
- DECL_INITIAL (decl2) = NULL_TREE;
- TREE_CHAIN (decl1) = decl2;
- decl1 = decl2;
- TREE_CHAIN (decl2) = NULL_TREE;
-
- result = build_chill_struct_type (listbase);
- pushdecl (forcharstring = build_decl (TYPE_DECL,
- get_identifier ("__tmp_IO_forcharstring"), result));
- DECL_SOURCE_LINE (forcharstring) = 0;
- satisfy_decl (forcharstring, 0);
-
- /* build the union */
- decl1 = build_tree_list (NULL_TREE,
- build_decl (FIELD_DECL,
- get_identifier ("__valbyte"),
- signed_char_type_node));
- listbase = decl1;
-
- decl2 = build_tree_list (NULL_TREE,
- build_decl (FIELD_DECL,
- get_identifier ("__valubyte"),
- unsigned_char_type_node));
- TREE_CHAIN (decl1) = decl2;
- decl1 = decl2;
-
- decl2 = build_tree_list (NULL_TREE,
- build_decl (FIELD_DECL,
- get_identifier ("__valint"),
- chill_integer_type_node));
- TREE_CHAIN (decl1) = decl2;
- decl1 = decl2;
-
- decl2 = build_tree_list (NULL_TREE,
- build_decl (FIELD_DECL,
- get_identifier ("__valuint"),
- chill_unsigned_type_node));
- TREE_CHAIN (decl1) = decl2;
- decl1 = decl2;
-
- decl2 = build_tree_list (NULL_TREE,
- build_decl (FIELD_DECL,
- get_identifier ("__vallong"),
- long_type));
- TREE_CHAIN (decl1) = decl2;
- decl1 = decl2;
-
- decl2 = build_tree_list (NULL_TREE,
- build_decl (FIELD_DECL,
- get_identifier ("__valulong"),
- ulong_type));
- TREE_CHAIN (decl1) = decl2;
- decl1 = decl2;
-
- decl2 = build_tree_list (NULL_TREE,
- build_decl (FIELD_DECL,
- get_identifier ("__locint"),
- ptr_type_node));
- TREE_CHAIN (decl1) = decl2;
- decl1 = decl2;
-
- decl2 = build_tree_list (NULL_TREE,
- build_decl (FIELD_DECL,
- get_identifier ("__locintrange"),
- TREE_TYPE (forintrange)));
- TREE_CHAIN (decl1) = decl2;
- decl1 = decl2;
-
- decl2 = build_tree_list (NULL_TREE,
- build_decl (FIELD_DECL,
- get_identifier ("__valbool"),
- boolean_type_node));
- TREE_CHAIN (decl1) = decl2;
- decl1 = decl2;
-
- decl2 = build_tree_list (NULL_TREE,
- build_decl (FIELD_DECL,
- get_identifier ("__locbool"),
- build_pointer_type (boolean_type_node)));
- TREE_CHAIN (decl1) = decl2;
- decl1 = decl2;
-
- decl2 = build_tree_list (NULL_TREE,
- build_decl (FIELD_DECL,
- get_identifier ("__locboolrange"),
- TREE_TYPE (forboolrange)));
- TREE_CHAIN (decl1) = decl2;
- decl1 = decl2;
-
- decl2 = build_tree_list (NULL_TREE,
- build_decl (FIELD_DECL,
- get_identifier ("__valset"),
- TREE_TYPE (forset_W)));
- TREE_CHAIN (decl1) = decl2;
- decl1 = decl2;
-
- decl2 = build_tree_list (NULL_TREE,
- build_decl (FIELD_DECL,
- get_identifier ("__locset"),
- TREE_TYPE (forset_R)));
- TREE_CHAIN (decl1) = decl2;
- decl1 = decl2;
-
- decl2 = build_tree_list (NULL_TREE,
- build_decl (FIELD_DECL,
- get_identifier ("__locsetrange"),
- TREE_TYPE (forsetrange)));
- TREE_CHAIN (decl1) = decl2;
- decl1 = decl2;
-
- decl2 = build_tree_list (NULL_TREE,
- build_decl (FIELD_DECL,
- get_identifier ("__valchar"),
- char_type_node));
- TREE_CHAIN (decl1) = decl2;
- decl1 = decl2;
-
- decl2 = build_tree_list (NULL_TREE,
- build_decl (FIELD_DECL,
- get_identifier ("__locchar"),
- build_pointer_type (char_type_node)));
- TREE_CHAIN (decl1) = decl2;
- decl1 = decl2;
-
- decl2 = build_tree_list (NULL_TREE,
- build_decl (FIELD_DECL,
- get_identifier ("__loccharrange"),
- TREE_TYPE (forcharrange)));
- TREE_CHAIN (decl1) = decl2;
- decl1 = decl2;
-
- decl2 = build_tree_list (NULL_TREE,
- build_decl (FIELD_DECL,
- get_identifier ("__loccharstring"),
- TREE_TYPE (forcharstring)));
- TREE_CHAIN (decl1) = decl2;
- decl1 = decl2;
-
- decl2 = build_tree_list (NULL_TREE,
- build_decl (FIELD_DECL,
- get_identifier ("__valreal"),
- float_type_node));
- TREE_CHAIN (decl1) = decl2;
- decl1 = decl2;
-
- decl2 = build_tree_list (NULL_TREE,
- build_decl (FIELD_DECL,
- get_identifier ("__locreal"),
- build_pointer_type (float_type_node)));
- TREE_CHAIN (decl1) = decl2;
- decl1 = decl2;
-
- decl2 = build_tree_list (NULL_TREE,
- build_decl (FIELD_DECL,
- get_identifier ("__vallongreal"),
- double_type_node));
- TREE_CHAIN (decl1) = decl2;
- decl1 = decl2;
-
- decl2 = build_tree_list (NULL_TREE,
- build_decl (FIELD_DECL,
- get_identifier ("__loclongreal"),
- build_pointer_type (double_type_node)));
- TREE_CHAIN (decl1) = decl2;
- decl1 = decl2;
-
-#if 0
- decl2 = build_tree_list (NULL_TREE,
- build_decl (FIELD_DECL,
- get_identifier ("__forpointer"),
- ptr_type_node));
- TREE_CHAIN (decl1) = decl2;
- decl1 = decl2;
-#endif
-
- TREE_CHAIN (decl2) = NULL_TREE;
-
- decl1 = grok_chill_variantdefs (NULL_TREE, listbase, NULL_TREE);
- TREE_CHAIN (decl1) = NULL_TREE;
- result = build_chill_struct_type (decl1);
- pushdecl (union_type = build_decl (TYPE_DECL,
- get_identifier ("__tmp_WIO_union"),
- result));
- DECL_SOURCE_LINE (union_type) = 0;
- satisfy_decl (union_type, 0);
-
- /* now build the final structure */
- decl1 = build_decl (FIELD_DECL, get_identifier ("__t"),
- TREE_TYPE (union_type));
- DECL_INITIAL (decl1) = NULL_TREE;
- listbase = decl1;
-
- decl2 = build_decl (FIELD_DECL, get_identifier ("__descr"),
- long_type);
-
- TREE_CHAIN (decl1) = decl2;
- TREE_CHAIN (decl2) = NULL_TREE;
-
- result = build_chill_struct_type (listbase);
- pushdecl (chill_io_list_type = build_decl (TYPE_DECL,
- get_identifier ("__tmp_IO_list"),
- result));
- DECL_SOURCE_LINE (chill_io_list_type) = 0;
- satisfy_decl (chill_io_list_type, 0);
-}
-
-/* build the ASSOCIATION, ACCESS and TEXT mode types */
-static void
-build_io_types ()
-{
- tree listbase, decl1, decl2, result, association;
- tree acc, txt, tloc;
- tree enum1, tmp;
-
- /* the association mode */
- listbase = build_decl (FIELD_DECL,
- get_identifier ("flags"),
- long_unsigned_type_node);
- DECL_INITIAL (listbase) = NULL_TREE;
- decl1 = listbase;
-
- decl2 = build_decl (FIELD_DECL,
- get_identifier ("pathname"),
- ptr_type_node);
- DECL_INITIAL (decl2) = NULL_TREE;
- TREE_CHAIN (decl1) = decl2;
- decl1 = decl2;
-
- decl2 = build_decl (FIELD_DECL,
- get_identifier ("access"),
- ptr_type_node);
- DECL_INITIAL (decl2) = NULL_TREE;
- TREE_CHAIN (decl1) = decl2;
- decl1 = decl2;
-
- decl2 = build_decl (FIELD_DECL,
- get_identifier ("handle"),
- integer_type_node);
- DECL_INITIAL (decl2) = NULL_TREE;
- TREE_CHAIN (decl1) = decl2;
- decl1 = decl2;
-
- decl2 = build_decl (FIELD_DECL,
- get_identifier ("bufptr"),
- ptr_type_node);
- DECL_INITIAL (decl2) = NULL_TREE;
- TREE_CHAIN (decl1) = decl2;
- decl1 = decl2;
-
- decl2 = build_decl (FIELD_DECL,
- get_identifier ("syserrno"),
- long_integer_type_node);
- DECL_INITIAL (decl2) = NULL_TREE;
- TREE_CHAIN (decl1) = decl2;
- decl1 = decl2;
-
- decl2 = build_decl (FIELD_DECL,
- get_identifier ("usage"),
- char_type_node);
- DECL_INITIAL (decl2) = NULL_TREE;
- TREE_CHAIN (decl1) = decl2;
- decl1 = decl2;
-
- decl2 = build_decl (FIELD_DECL,
- get_identifier ("ctl_pre"),
- char_type_node);
- DECL_INITIAL (decl2) = NULL_TREE;
- TREE_CHAIN (decl1) = decl2;
- decl1 = decl2;
-
- decl2 = build_decl (FIELD_DECL,
- get_identifier ("ctl_post"),
- char_type_node);
- DECL_INITIAL (decl2) = NULL_TREE;
- TREE_CHAIN (decl1) = decl2;
- TREE_CHAIN (decl2) = NULL_TREE;
-
- result = build_chill_struct_type (listbase);
- pushdecl (association = build_decl (TYPE_DECL,
- ridpointers[(int)RID_ASSOCIATION],
- result));
- DECL_SOURCE_LINE (association) = 0;
- satisfy_decl (association, 0);
- association_type_node = TREE_TYPE (association);
- TYPE_NAME (association_type_node) = association;
- CH_NOVELTY (association_type_node) = association;
- CH_TYPE_NONVALUE_P(association_type_node) = 1;
- CH_TYPE_NONVALUE_P(association) = 1;
-
- /* initialiser for association type */
- tmp = convert (char_type_node, integer_zero_node);
- association_init_value =
- build_nt (CONSTRUCTOR, NULL_TREE,
- tree_cons (NULL_TREE, integer_zero_node, /* flags */
- tree_cons (NULL_TREE, null_pointer_node, /* pathname */
- tree_cons (NULL_TREE, null_pointer_node, /* access */
- tree_cons (NULL_TREE, integer_minus_one_node, /* handle */
- tree_cons (NULL_TREE, null_pointer_node, /* bufptr */
- tree_cons (NULL_TREE, integer_zero_node, /* syserrno */
- tree_cons (NULL_TREE, tmp, /* usage */
- tree_cons (NULL_TREE, tmp, /* ctl_pre */
- tree_cons (NULL_TREE, tmp, /* ctl_post */
- NULL_TREE))))))))));
-
- /* the type for stdin, stdout, stderr */
- /* text part */
- decl1 = build_decl (FIELD_DECL,
- get_identifier ("flags"),
- long_unsigned_type_node);
- DECL_INITIAL (decl1) = NULL_TREE;
- listbase = decl1;
-
- decl2 = build_decl (FIELD_DECL,
- get_identifier ("text_record"),
- ptr_type_node);
- DECL_INITIAL (decl2) = NULL_TREE;
- TREE_CHAIN (decl1) = decl2;
- decl1 = decl2;
-
- decl2 = build_decl (FIELD_DECL,
- get_identifier ("access_sub"),
- ptr_type_node);
- DECL_INITIAL (decl2) = NULL_TREE;
- TREE_CHAIN (decl1) = decl2;
- decl1 = decl2;
-
- decl2 = build_decl (FIELD_DECL,
- get_identifier ("actual_index"),
- long_unsigned_type_node);
- DECL_INITIAL (decl2) = NULL_TREE;
- TREE_CHAIN (decl1) = decl2;
- TREE_CHAIN (decl2) = NULL_TREE;
- txt = build_chill_struct_type (listbase);
-
- /* access part */
- decl1 = build_decl (FIELD_DECL,
- get_identifier ("flags"),
- long_unsigned_type_node);
- DECL_INITIAL (decl1) = NULL_TREE;
- listbase = decl1;
-
- decl2 = build_decl (FIELD_DECL,
- get_identifier ("reclength"),
- long_unsigned_type_node);
- DECL_INITIAL (decl2) = NULL_TREE;
- TREE_CHAIN (decl1) = decl2;
- decl1 = decl2;
-
- decl2 = build_decl (FIELD_DECL,
- get_identifier ("lowindex"),
- long_integer_type_node);
- DECL_INITIAL (decl2) = NULL_TREE;
- TREE_CHAIN (decl1) = decl2;
- decl1 = decl2;
-
- decl2 = build_decl (FIELD_DECL,
- get_identifier ("highindex"),
- long_integer_type_node);
- DECL_INITIAL (decl2) = NULL_TREE;
- TREE_CHAIN (decl1) = decl2;
- decl2 = decl1;
-
- decl2 = build_decl (FIELD_DECL,
- get_identifier ("association"),
- ptr_type_node);
- DECL_INITIAL (decl2) = NULL_TREE;
- TREE_CHAIN (decl1) = decl2;
- decl1 = decl2;
-
- decl2 = build_decl (FIELD_DECL,
- get_identifier ("base"),
- long_unsigned_type_node);
- DECL_INITIAL (decl2) = NULL_TREE;
- TREE_CHAIN (decl1) = decl2;
- decl1 = decl2;
-
- decl2 = build_decl (FIELD_DECL,
- get_identifier ("storelocptr"),
- ptr_type_node);
- DECL_INITIAL (decl2) = NULL_TREE;
- TREE_CHAIN (decl1) = decl2;
- decl1 = decl2;
-
- decl2 = build_decl (FIELD_DECL,
- get_identifier ("rectype"),
- long_integer_type_node);
- DECL_INITIAL (decl2) = NULL_TREE;
- TREE_CHAIN (decl1) = decl2;
- TREE_CHAIN (decl2) = NULL_TREE;
- acc = build_chill_struct_type (listbase);
-
- /* the location */
- tmp = build_string_type (char_type_node, build_int_2 (STDIO_TEXT_LENGTH, 0));
- tloc = build_varying_struct (tmp);
-
- /* now the final mode */
- decl1 = build_decl (FIELD_DECL, get_identifier ("txt"), txt);
- listbase = decl1;
-
- decl2 = build_decl (FIELD_DECL, get_identifier ("acc"), acc);
- TREE_CHAIN (decl1) = decl2;
- decl1 = decl2;
-
- decl2 = build_decl (FIELD_DECL, get_identifier ("tloc"), tloc);
- TREE_CHAIN (decl1) = decl2;
- decl1 = decl2;
-
- decl2 = build_lang_decl (TYPE_DECL, get_identifier ("__indexmode"),
- void_type_node);
- TREE_CHAIN (decl1) = decl2;
- decl1 = decl2;
-
- decl2 = build_decl (CONST_DECL, get_identifier ("__textlength"),
- integer_type_node);
- DECL_INITIAL (decl2) = build_int_2 (STDIO_TEXT_LENGTH, 0);
- TREE_CHAIN (decl1) = decl2;
- decl1 = decl2;
-
- decl2 = build_decl (CONST_DECL, get_identifier ("__dynamic"),
- integer_type_node);
- DECL_INITIAL (decl2) = integer_zero_node;
- TREE_CHAIN (decl1) = decl2;
- TREE_CHAIN (decl2) = NULL_TREE;
-
- result = build_chill_struct_type (listbase);
- pushdecl (tmp = build_decl (TYPE_DECL,
- get_identifier ("__stdio_text"),
- result));
- DECL_SOURCE_LINE (tmp) = 0;
- satisfy_decl (tmp, 0);
- stdio_type_node = TREE_TYPE (tmp);
- CH_IS_TEXT_MODE (stdio_type_node) = 1;
-
- /* predefined usage mode */
- enum1 = start_enum (NULL_TREE);
- listbase = NULL_TREE;
- result = build_enumerator (
- get_identifier ((ignore_case || ! special_UC) ? "readonly" : "READONLY"),
- NULL_TREE);
- listbase = chainon (result, listbase);
- result = build_enumerator (
- get_identifier ((ignore_case || ! special_UC) ? "writeonly" : "WRITEONLY"),
- NULL_TREE);
- listbase = chainon (result, listbase);
- result = build_enumerator (
- get_identifier ((ignore_case || ! special_UC) ? "readwrite" : "READWRITE"),
- NULL_TREE);
- listbase = chainon (result, listbase);
- result = finish_enum (enum1, listbase);
- pushdecl (tmp = build_decl (TYPE_DECL,
- get_identifier ((ignore_case || ! special_UC) ? "usage" : "USAGE"),
- result));
- DECL_SOURCE_LINE (tmp) = 0;
- satisfy_decl (tmp, 0);
- usage_type_node = TREE_TYPE (tmp);
- TYPE_NAME (usage_type_node) = tmp;
- CH_NOVELTY (usage_type_node) = tmp;
-
- /* predefined where mode */
- enum1 = start_enum (NULL_TREE);
- listbase = NULL_TREE;
- result = build_enumerator (
- get_identifier ((ignore_case || ! special_UC) ? "first" : "FIRST"),
- NULL_TREE);
- listbase = chainon (result, listbase);
- result = build_enumerator (
- get_identifier ((ignore_case || ! special_UC) ? "same" : "SAME"),
- NULL_TREE);
- listbase = chainon (result, listbase);
- result = build_enumerator (
- get_identifier ((ignore_case || ! special_UC) ? "last" : "LAST"),
- NULL_TREE);
- listbase = chainon (result, listbase);
- result = finish_enum (enum1, listbase);
- pushdecl (tmp = build_decl (TYPE_DECL,
- get_identifier ((ignore_case || ! special_UC) ? "where" : "WHERE"),
- result));
- DECL_SOURCE_LINE (tmp) = 0;
- satisfy_decl (tmp, 0);
- where_type_node = TREE_TYPE (tmp);
- TYPE_NAME (where_type_node) = tmp;
- CH_NOVELTY (where_type_node) = tmp;
-}
-
-static void
-declare_predefined_file (name, assembler_name)
- const char *name;
- const char *assembler_name;
-{
- tree decl = build_lang_decl (VAR_DECL, get_identifier (name),
- stdio_type_node);
- DECL_ASSEMBLER_NAME (decl) = get_identifier(assembler_name);
- TREE_STATIC (decl) = 1;
- TREE_PUBLIC (decl) = 1;
- DECL_EXTERNAL (decl) = 1;
- DECL_IN_SYSTEM_HEADER (decl) = 1;
- make_decl_rtl (decl, 0, 1);
- pushdecl (decl);
-}
-
-
-/* initialisation of all IO/related functions, types, etc. */
-void
-inout_init ()
-{
- /* We temporarily reset the maximum_field_alignment to zero so the
- compiler's init data structures can be compatible with the
- run-time system, even when we're compiling with -fpack. */
- unsigned int save_maximum_field_alignment = maximum_field_alignment;
-
- extern tree chill_predefined_function_type;
- tree endlink = void_list_node;
- tree bool_ftype_ptr_ptr_int;
- tree ptr_ftype_ptr_ptr_int;
- tree luns_ftype_ptr_ptr_int;
- tree int_ftype_ptr_ptr_int;
- tree ptr_ftype_ptr_ptr_int_ptr_int_ptr_int;
- tree void_ftype_ptr_ptr_int_ptr_int_ptr_int;
- tree void_ftype_ptr_ptr_int;
- tree void_ftype_ptr_ptr_int_int_int_long_ptr_int;
- tree ptr_ftype_ptr_int_ptr_ptr_int;
- tree void_ftype_ptr_int_ptr_luns_ptr_int;
- tree void_ftype_ptr_ptr_ptr_int;
- tree void_ftype_ptr_int_ptr_int;
- tree void_ftype_ptr_int_ptr_int_ptr_int_ptr_int;
-
- maximum_field_alignment = 0;
-
- builtin_function ((ignore_case || ! special_UC) ? "associate" : "ASSOCIATE",
- chill_predefined_function_type,
- BUILT_IN_ASSOCIATE, BUILT_IN_NORMAL, NULL_PTR);
- builtin_function ((ignore_case || ! special_UC) ? "connect" : "CONNECT",
- chill_predefined_function_type,
- BUILT_IN_CONNECT, BUILT_IN_NORMAL, NULL_PTR);
- builtin_function ((ignore_case || ! special_UC) ? "create" : "CREATE",
- chill_predefined_function_type,
- BUILT_IN_CREATE, BUILT_IN_NORMAL, NULL_PTR);
- builtin_function ((ignore_case || ! special_UC) ? "delete" : "DELETE",
- chill_predefined_function_type,
- BUILT_IN_CH_DELETE, BUILT_IN_NORMAL, NULL_PTR);
- builtin_function ((ignore_case || ! special_UC) ? "disconnect" : "DISCONNECT",
- chill_predefined_function_type,
- BUILT_IN_DISCONNECT, BUILT_IN_NORMAL, NULL_PTR);
- builtin_function ((ignore_case || ! special_UC) ? "dissociate" : "DISSOCIATE",
- chill_predefined_function_type,
- BUILT_IN_DISSOCIATE, BUILT_IN_NORMAL, NULL_PTR);
- builtin_function ((ignore_case || ! special_UC) ? "eoln" : "EOLN",
- chill_predefined_function_type,
- BUILT_IN_EOLN, BUILT_IN_NORMAL, NULL_PTR);
- builtin_function ((ignore_case || ! special_UC) ? "existing" : "EXISTING",
- chill_predefined_function_type,
- BUILT_IN_EXISTING, BUILT_IN_NORMAL, NULL_PTR);
- builtin_function ((ignore_case || ! special_UC) ? "getassociation" : "GETASSOCIATION",
- chill_predefined_function_type,
- BUILT_IN_GETASSOCIATION, BUILT_IN_NORMAL, NULL_PTR);
- builtin_function ((ignore_case || ! special_UC) ? "gettextaccess" : "GETTEXTASSCESS",
- chill_predefined_function_type,
- BUILT_IN_GETTEXTACCESS, BUILT_IN_NORMAL, NULL_PTR);
- builtin_function ((ignore_case || ! special_UC) ? "gettextindex" : "GETTEXTINDEX",
- chill_predefined_function_type,
- BUILT_IN_GETTEXTINDEX, BUILT_IN_NORMAL, NULL_PTR);
- builtin_function ((ignore_case || ! special_UC) ? "gettextrecord" : "GETTEXTRECORD",
- chill_predefined_function_type,
- BUILT_IN_GETTEXTRECORD, BUILT_IN_NORMAL, NULL_PTR);
- builtin_function ((ignore_case || ! special_UC) ? "getusage" : "GETUSAGE",
- chill_predefined_function_type,
- BUILT_IN_GETUSAGE, BUILT_IN_NORMAL, NULL_PTR);
- builtin_function ((ignore_case || ! special_UC) ? "indexable" : "INDEXABLE",
- chill_predefined_function_type,
- BUILT_IN_INDEXABLE, BUILT_IN_NORMAL, NULL_PTR);
- builtin_function ((ignore_case || ! special_UC) ? "isassociated" : "ISASSOCIATED",
- chill_predefined_function_type,
- BUILT_IN_ISASSOCIATED, BUILT_IN_NORMAL, NULL_PTR);
- builtin_function ((ignore_case || ! special_UC) ? "modify" : "MODIFY",
- chill_predefined_function_type,
- BUILT_IN_MODIFY, BUILT_IN_NORMAL, NULL_PTR);
- builtin_function ((ignore_case || ! special_UC) ? "outoffile" : "OUTOFFILE",
- chill_predefined_function_type,
- BUILT_IN_OUTOFFILE, BUILT_IN_NORMAL, NULL_PTR);
- builtin_function ((ignore_case || ! special_UC) ? "readable" : "READABLE",
- chill_predefined_function_type,
- BUILT_IN_READABLE, BUILT_IN_NORMAL, NULL_PTR);
- builtin_function ((ignore_case || ! special_UC) ? "readrecord" : "READRECORD",
- chill_predefined_function_type,
- BUILT_IN_READRECORD, BUILT_IN_NORMAL, NULL_PTR);
- builtin_function ((ignore_case || ! special_UC) ? "readtext" : "READTEXT",
- chill_predefined_function_type,
- BUILT_IN_READTEXT, BUILT_IN_NORMAL, NULL_PTR);
- builtin_function ((ignore_case || ! special_UC) ? "sequencible" : "SEQUENCIBLE",
- chill_predefined_function_type,
- BUILT_IN_SEQUENCIBLE, BUILT_IN_NORMAL, NULL_PTR);
- builtin_function ((ignore_case || ! special_UC) ? "settextaccess" : "SETTEXTACCESS",
- chill_predefined_function_type,
- BUILT_IN_SETTEXTACCESS, BUILT_IN_NORMAL, NULL_PTR);
- builtin_function ((ignore_case || ! special_UC) ? "settextindex" : "SETTEXTINDEX",
- chill_predefined_function_type,
- BUILT_IN_SETTEXTINDEX, BUILT_IN_NORMAL, NULL_PTR);
- builtin_function ((ignore_case || ! special_UC) ? "settextrecord" : "SETTEXTRECORD",
- chill_predefined_function_type,
- BUILT_IN_SETTEXTRECORD, BUILT_IN_NORMAL, NULL_PTR);
- builtin_function ((ignore_case || ! special_UC) ? "variable" : "VARIABLE",
- chill_predefined_function_type,
- BUILT_IN_VARIABLE, BUILT_IN_NORMAL, NULL_PTR);
- builtin_function ((ignore_case || ! special_UC) ? "writeable" : "WRITEABLE",
- chill_predefined_function_type,
- BUILT_IN_WRITEABLE, BUILT_IN_NORMAL, NULL_PTR);
- builtin_function ((ignore_case || ! special_UC) ? "writerecord" : "WRITERECORD",
- chill_predefined_function_type,
- BUILT_IN_WRITERECORD, BUILT_IN_NORMAL, NULL_PTR);
- builtin_function ((ignore_case || ! special_UC) ? "writetext" : "WRITETEXT",
- chill_predefined_function_type,
- BUILT_IN_WRITETEXT, BUILT_IN_NORMAL, NULL_PTR);
-
- /* build function prototypes */
- bool_ftype_ptr_ptr_int =
- build_function_type (boolean_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- endlink))));
- ptr_ftype_ptr_ptr_int_ptr_int_ptr_int =
- build_function_type (ptr_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- endlink))))))));
- void_ftype_ptr_ptr_int =
- build_function_type (void_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- endlink))));
- void_ftype_ptr_ptr_int_ptr_int_ptr_int =
- build_function_type (void_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- endlink))))))));
- void_ftype_ptr_ptr_int_int_int_long_ptr_int =
- build_function_type (void_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- tree_cons (NULL_TREE, long_integer_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- endlink)))))))));
- ptr_ftype_ptr_ptr_int =
- build_function_type (ptr_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- endlink))));
- int_ftype_ptr_ptr_int =
- build_function_type (integer_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- endlink))));
- ptr_ftype_ptr_int_ptr_ptr_int =
- build_function_type (ptr_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- endlink))))));
- void_ftype_ptr_int_ptr_luns_ptr_int =
- build_function_type (void_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, long_unsigned_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- endlink)))))));
- luns_ftype_ptr_ptr_int =
- build_function_type (long_unsigned_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- endlink))));
- void_ftype_ptr_ptr_ptr_int =
- build_function_type (void_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- endlink)))));
- void_ftype_ptr_int_ptr_int =
- build_function_type (void_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- endlink)))));
- void_ftype_ptr_int_ptr_int_ptr_int_ptr_int =
- build_function_type (void_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- endlink)))))))));
-
- builtin_function ("__associate", ptr_ftype_ptr_ptr_int_ptr_int_ptr_int,
- 0, NOT_BUILT_IN, NULL_PTR);
- builtin_function ("__connect", void_ftype_ptr_ptr_int_int_int_long_ptr_int,
- 0, NOT_BUILT_IN, NULL_PTR);
- builtin_function ("__create", void_ftype_ptr_ptr_int,
- 0, NOT_BUILT_IN, NULL_PTR);
- builtin_function ("__delete", void_ftype_ptr_ptr_int,
- 0, NOT_BUILT_IN, NULL_PTR);
- builtin_function ("__disconnect", void_ftype_ptr_ptr_int,
- 0, NOT_BUILT_IN, NULL_PTR);
- builtin_function ("__dissociate", void_ftype_ptr_ptr_int,
- 0, NOT_BUILT_IN, NULL_PTR);
- builtin_function ("__eoln", bool_ftype_ptr_ptr_int,
- 0, NOT_BUILT_IN, NULL_PTR);
- builtin_function ("__existing", bool_ftype_ptr_ptr_int,
- 0, NOT_BUILT_IN, NULL_PTR);
- builtin_function ("__getassociation", ptr_ftype_ptr_ptr_int,
- 0, NOT_BUILT_IN, NULL_PTR);
- builtin_function ("__gettextaccess", ptr_ftype_ptr_ptr_int,
- 0, NOT_BUILT_IN, NULL_PTR);
- builtin_function ("__gettextindex", luns_ftype_ptr_ptr_int,
- 0, NOT_BUILT_IN, NULL_PTR);
- builtin_function ("__gettextrecord", ptr_ftype_ptr_ptr_int,
- 0, NOT_BUILT_IN, NULL_PTR);
- builtin_function ("__getusage", int_ftype_ptr_ptr_int,
- 0, NOT_BUILT_IN, NULL_PTR);
- builtin_function ("__indexable", bool_ftype_ptr_ptr_int,
- 0, NOT_BUILT_IN, NULL_PTR);
- builtin_function ("__isassociated", bool_ftype_ptr_ptr_int,
- 0, NOT_BUILT_IN, NULL_PTR);
- builtin_function ("__modify", void_ftype_ptr_ptr_int_ptr_int_ptr_int,
- 0, NOT_BUILT_IN, NULL_PTR);
- builtin_function ("__outoffile", bool_ftype_ptr_ptr_int,
- 0, NOT_BUILT_IN, NULL_PTR);
- builtin_function ("__readable", bool_ftype_ptr_ptr_int,
- 0, NOT_BUILT_IN, NULL_PTR);
- builtin_function ("__readrecord", ptr_ftype_ptr_int_ptr_ptr_int,
- 0, NOT_BUILT_IN, NULL_PTR);
- builtin_function ("__readtext_f", void_ftype_ptr_int_ptr_int_ptr_int_ptr_int,
- 0, NOT_BUILT_IN, NULL_PTR);
- builtin_function ("__readtext_s", void_ftype_ptr_int_ptr_int_ptr_int_ptr_int,
- 0, NOT_BUILT_IN, NULL_PTR);
- builtin_function ("__sequencible", bool_ftype_ptr_ptr_int,
- 0, NOT_BUILT_IN, NULL_PTR);
- builtin_function ("__settextaccess", void_ftype_ptr_ptr_ptr_int,
- 0, NOT_BUILT_IN, NULL_PTR);
- builtin_function ("__settextindex", void_ftype_ptr_int_ptr_int,
- 0, NOT_BUILT_IN, NULL_PTR);
- builtin_function ("__settextrecord", void_ftype_ptr_ptr_ptr_int,
- 0, NOT_BUILT_IN, NULL_PTR);
- builtin_function ("__variable", bool_ftype_ptr_ptr_int,
- 0, NOT_BUILT_IN, NULL_PTR);
- builtin_function ("__writeable", bool_ftype_ptr_ptr_int,
- 0, NOT_BUILT_IN, NULL_PTR);
- builtin_function ("__writerecord", void_ftype_ptr_int_ptr_luns_ptr_int,
- 0, NOT_BUILT_IN, NULL_PTR);
- builtin_function ("__writetext_f", void_ftype_ptr_int_ptr_int_ptr_int_ptr_int,
- 0, NOT_BUILT_IN, NULL_PTR);
- builtin_function ("__writetext_s", void_ftype_ptr_int_ptr_int_ptr_int_ptr_int,
- 0, NOT_BUILT_IN, NULL_PTR);
-
- /* declare ASSOCIATION, ACCESS, and TEXT modes */
- build_io_types ();
-
- /* declare the predefined text locations */
- declare_predefined_file ((ignore_case || ! special_UC) ? "stdin" : "STDIN",
- "chill_stdin");
- declare_predefined_file ((ignore_case || ! special_UC) ? "stdout" : "STDOUT",
- "chill_stdout");
- declare_predefined_file ((ignore_case || ! special_UC) ? "stderr" : "STDERR",
- "chill_stderr");
-
- /* last, but not least, build the chill IO-list type */
- build_chill_io_list_type ();
-
- maximum_field_alignment = save_maximum_field_alignment;
-}
-
-/* function returns the recordmode of an ACCESS */
-tree
-access_recordmode (access)
- tree access;
-{
- tree field;
-
- if (access == NULL_TREE || TREE_CODE (access) == ERROR_MARK)
- return NULL_TREE;
- if (! CH_IS_ACCESS_MODE (access))
- return NULL_TREE;
-
- field = TYPE_FIELDS (access);
- for ( ; field != NULL_TREE; field = TREE_CHAIN (field))
- {
- if (TREE_CODE (field) == TYPE_DECL &&
- DECL_NAME (field) == get_identifier ("__recordmode"))
- return TREE_TYPE (field);
- }
- return void_type_node;
-}
-
-/* function invalidates the recordmode of an ACCESS */
-void
-invalidate_access_recordmode (access)
- tree access;
-{
- tree field;
-
- if (access == NULL_TREE || TREE_CODE (access) == ERROR_MARK)
- return;
- if (! CH_IS_ACCESS_MODE (access))
- return;
-
- field = TYPE_FIELDS (access);
- for ( ; field != NULL_TREE; field = TREE_CHAIN (field))
- {
- if (TREE_CODE (field) == TYPE_DECL &&
- DECL_NAME (field) == get_identifier ("__recordmode"))
- {
- TREE_TYPE (field) = error_mark_node;
- return;
- }
- }
-}
-
-/* function returns the index mode of an ACCESS if there is one,
- otherwise NULL_TREE */
-tree
-access_indexmode (access)
- tree access;
-{
- tree field;
-
- if (access == NULL_TREE || TREE_CODE (access) == ERROR_MARK)
- return NULL_TREE;
- if (! CH_IS_ACCESS_MODE (access))
- return NULL_TREE;
-
- field = TYPE_FIELDS (access);
- for ( ; field != NULL_TREE; field = TREE_CHAIN (field))
- {
- if (TREE_CODE (field) == TYPE_DECL &&
- DECL_NAME (field) == get_identifier ("__indexmode"))
- return TREE_TYPE (field);
- }
- return void_type_node;
-}
-
-/* function returns one if an ACCESS was specified DYNAMIC, otherwise zero */
-tree
-access_dynamic (access)
- tree access;
-{
- tree field;
-
- if (access == NULL_TREE || TREE_CODE (access) == ERROR_MARK)
- return NULL_TREE;
- if (! CH_IS_ACCESS_MODE (access))
- return NULL_TREE;
-
- field = TYPE_FIELDS (access);
- for ( ; field != NULL_TREE; field = TREE_CHAIN (field))
- {
- if (TREE_CODE (field) == CONST_DECL)
- return DECL_INITIAL (field);
- }
- return integer_zero_node;
-}
-
-#if 0
- returns a structure like
- STRUCT (data STRUCT (flags ULONG,
- reclength ULONG,
- lowindex LONG,
- highindex LONG,
- association PTR,
- base ULONG,
- store_loc PTR,
- rectype LONG),
- this is followed by a
- TYPE_DECL __recordmode recordmode ? recordmode : void_type_node
- TYPE_DECL __indexmode indexmode ? indexmode : void_type_node
- CONST_DECL __dynamic dynamic ? integer_one_node : integer_zero_node
-#endif
-
-static tree
-build_access_part ()
-{
- tree listbase, decl;
-
- listbase = build_decl (FIELD_DECL, get_identifier ("flags"),
- long_unsigned_type_node);
- decl = build_decl (FIELD_DECL, get_identifier ("reclength"),
- long_unsigned_type_node);
- listbase = chainon (listbase, decl);
- decl = build_decl (FIELD_DECL, get_identifier ("lowindex"),
- long_unsigned_type_node);
- listbase = chainon (listbase, decl);
- decl = build_decl (FIELD_DECL, get_identifier ("highindex"),
- long_integer_type_node);
- listbase = chainon (listbase, decl);
- decl = build_decl (FIELD_DECL, get_identifier ("association"),
- ptr_type_node);
- listbase = chainon (listbase, decl);
- decl = build_decl (FIELD_DECL, get_identifier ("base"),
- long_unsigned_type_node);
- listbase = chainon (listbase, decl);
- decl = build_decl (FIELD_DECL, get_identifier ("storelocptr"),
- ptr_type_node);
- listbase = chainon (listbase, decl);
- decl = build_decl (FIELD_DECL, get_identifier ("rectype"),
- long_integer_type_node);
- listbase = chainon (listbase, decl);
- return build_chill_struct_type (listbase);
-}
-
-tree
-build_access_mode (indexmode, recordmode, dynamic)
- tree indexmode;
- tree recordmode;
- int dynamic;
-{
- tree type, listbase, decl, datamode;
-
- if (indexmode != NULL_TREE && TREE_CODE (indexmode) == ERROR_MARK)
- return error_mark_node;
- if (recordmode != NULL_TREE && TREE_CODE (recordmode) == ERROR_MARK)
- return error_mark_node;
-
- datamode = build_access_part ();
-
- type = make_node (RECORD_TYPE);
- listbase = build_decl (FIELD_DECL, get_identifier ("data"),
- datamode);
- TYPE_FIELDS (type) = listbase;
- decl = build_lang_decl (TYPE_DECL, get_identifier ("__recordmode"),
- recordmode == NULL_TREE ? void_type_node : recordmode);
- chainon (listbase, decl);
- decl = build_lang_decl (TYPE_DECL, get_identifier ("__indexmode"),
- indexmode == NULL_TREE ? void_type_node : indexmode);
- chainon (listbase, decl);
- decl = build_decl (CONST_DECL, get_identifier ("__dynamic"),
- integer_type_node);
- DECL_INITIAL (decl) = dynamic ? integer_one_node : integer_zero_node;
- chainon (listbase, decl);
- CH_IS_ACCESS_MODE (type) = 1;
- CH_TYPE_NONVALUE_P (type) = 1;
- return type;
-}
-
-#if 0
- returns a structure like:
- STRUCT (txt STRUCT (flags ULONG,
- text_record PTR,
- access_sub PTR,
- actual_index LONG),
- acc STRUCT (flags ULONG,
- reclength ULONG,
- lowindex LONG,
- highindex LONG,
- association PTR,
- base ULONG,
- store_loc PTR,
- rectype LONG),
- tloc CHARS(textlength) VARYING;
- )
- followed by
- TYPE_DECL __indexmode indexmode ? indexmode : void_type_node
- CONST_DECL __text_length
- CONST_DECL __dynamic dynamic ? integer_one_node : integer_zero_node
-#endif
-tree
-build_text_mode (textlength, indexmode, dynamic)
- tree textlength;
- tree indexmode;
- int dynamic;
-{
- tree txt, acc, listbase, decl, type, tltype;
- tree savedlength = textlength;
-
- if (indexmode != NULL_TREE && TREE_CODE (indexmode) == ERROR_MARK)
- return error_mark_node;
- if (textlength == NULL_TREE || TREE_CODE (textlength) == ERROR_MARK)
- return error_mark_node;
-
- /* build the structure */
- listbase = build_decl (FIELD_DECL, get_identifier ("flags"),
- long_unsigned_type_node);
- decl = build_decl (FIELD_DECL, get_identifier ("text_record"),
- ptr_type_node);
- listbase = chainon (listbase, decl);
- decl = build_decl (FIELD_DECL, get_identifier ("access_sub"),
- ptr_type_node);
- listbase = chainon (listbase, decl);
- decl = build_decl (FIELD_DECL, get_identifier ("actual_index"),
- long_integer_type_node);
- listbase = chainon (listbase, decl);
- txt = build_chill_struct_type (listbase);
-
- acc = build_access_part ();
-
- type = make_node (RECORD_TYPE);
- listbase = build_decl (FIELD_DECL, get_identifier ("txt"), txt);
- TYPE_FIELDS (type) = listbase;
- decl = build_decl (FIELD_DECL, get_identifier ("acc"), acc);
- chainon (listbase, decl);
- /* the text location */
- tltype = build_string_type (char_type_node, textlength);
- tltype = build_varying_struct (tltype);
- decl = build_decl (FIELD_DECL, get_identifier ("tloc"),
- tltype);
- chainon (listbase, decl);
- /* the index mode */
- decl = build_lang_decl (TYPE_DECL, get_identifier ("__indexmode"),
- indexmode == NULL_TREE ? void_type_node : indexmode);
- chainon (listbase, decl);
- /* save dynamic */
- decl = build_decl (CONST_DECL, get_identifier ("__textlength"),
- integer_type_node);
- if (TREE_CODE (textlength) == COMPONENT_REF)
- /* FIXME: we cannot use one and the same COMPONENT_REF twice, so build
- another one */
- savedlength = build_component_ref (TREE_OPERAND (textlength, 0),
- TREE_OPERAND (textlength, 1));
- DECL_INITIAL (decl) = savedlength;
- chainon (listbase, decl);
- /* save dynamic */
- decl = build_decl (CONST_DECL, get_identifier ("__dynamic"),
- integer_type_node);
- DECL_INITIAL (decl) = dynamic ? integer_one_node : integer_zero_node;
- chainon (listbase, decl);
- CH_IS_TEXT_MODE (type) = 1;
- CH_TYPE_NONVALUE_P (type) = 1;
- return type;
-}
-
-tree
-check_text_length (length)
- tree length;
-{
- if (length == NULL_TREE || TREE_CODE (length) == ERROR_MARK)
- return length;
- if (TREE_TYPE (length) == NULL_TREE
- || !CH_SIMILAR (TREE_TYPE (length), integer_type_node))
- {
- error ("non-integral text length");
- return integer_one_node;
- }
- if (TREE_CODE (length) != INTEGER_CST)
- {
- error ("non-constant text length");
- return integer_one_node;
- }
- if (compare_int_csts (LE_EXPR, length, integer_zero_node))
- {
- error ("text length must be greater then 0");
- return integer_one_node;
- }
- return length;
-}
-
-tree
-text_indexmode (text)
- tree text;
-{
- tree field;
-
- if (text == NULL_TREE || TREE_CODE (text) == ERROR_MARK)
- return NULL_TREE;
- if (! CH_IS_TEXT_MODE (text))
- return NULL_TREE;
-
- field = TYPE_FIELDS (text);
- for ( ; field != NULL_TREE; field = TREE_CHAIN (field))
- {
- if (TREE_CODE (field) == TYPE_DECL)
- return TREE_TYPE (field);
- }
- return void_type_node;
-}
-
-tree
-text_dynamic (text)
- tree text;
-{
- tree field;
-
- if (text == NULL_TREE || TREE_CODE (text) == ERROR_MARK)
- return NULL_TREE;
- if (! CH_IS_TEXT_MODE (text))
- return NULL_TREE;
-
- field = TYPE_FIELDS (text);
- for ( ; field != NULL_TREE; field = TREE_CHAIN (field))
- {
- if (TREE_CODE (field) == CONST_DECL &&
- DECL_NAME (field) == get_identifier ("__dynamic"))
- return DECL_INITIAL (field);
- }
- return integer_zero_node;
-}
-
-tree
-text_length (text)
- tree text;
-{
- tree field;
-
- if (text == NULL_TREE || TREE_CODE (text) == ERROR_MARK)
- return NULL_TREE;
- if (! CH_IS_TEXT_MODE (text))
- return NULL_TREE;
-
- field = TYPE_FIELDS (text);
- for ( ; field != NULL_TREE; field = TREE_CHAIN (field))
- {
- if (TREE_CODE (field) == CONST_DECL &&
- DECL_NAME (field) == get_identifier ("__textlength"))
- return DECL_INITIAL (field);
- }
- return integer_zero_node;
-}
-
-static tree
-textlocation_mode (text)
- tree text;
-{
- tree field;
-
- if (text == NULL_TREE || TREE_CODE (text) == ERROR_MARK)
- return NULL_TREE;
- if (! CH_IS_TEXT_MODE (text))
- return NULL_TREE;
-
- field = TYPE_FIELDS (text);
- for ( ; field != NULL_TREE; field = TREE_CHAIN (field))
- {
- if (TREE_CODE (field) == FIELD_DECL &&
- DECL_NAME (field) == get_identifier ("tloc"))
- return TREE_TYPE (field);
- }
- return NULL_TREE;
-}
-
-static int
-check_assoc (assoc, argnum, errmsg)
- tree assoc;
- int argnum;
- const char *errmsg;
-{
- if (assoc == NULL_TREE || TREE_CODE (assoc) == ERROR_MARK)
- return 0;
-
- if (! CH_IS_ASSOCIATION_MODE (TREE_TYPE (assoc)))
- {
- error ("argument %d of %s must be of mode ASSOCIATION", argnum, errmsg);
- return 0;
- }
- if (! CH_LOCATION_P (assoc))
- {
- error ("argument %d of %s must be a location", argnum, errmsg);
- return 0;
- }
- return 1;
-}
-
-tree
-build_chill_associate (assoc, fname, attr)
- tree assoc;
- tree fname;
- tree attr;
-{
- tree arg1 = NULL_TREE, arg2 = NULL_TREE, arg3 = NULL_TREE, arg4 = NULL_TREE,
- arg5 = NULL_TREE, arg6, arg7;
- int had_errors = 0;
- tree result;
-
- /* make some checks */
- if (fname == NULL_TREE || TREE_CODE (fname) == ERROR_MARK)
- return error_mark_node;
-
- /* check the association */
- if (! check_assoc (assoc, 1, "ASSOCIATION"))
- had_errors = 1;
- else
- /* build a pointer to the association */
- arg1 = force_addr_of (assoc);
-
- /* check the filename, must be a string */
- if (CH_CHARS_TYPE_P (TREE_TYPE (fname)) ||
- (flag_old_strings && TREE_CODE (fname) == INTEGER_CST &&
- TREE_CODE (TREE_TYPE (fname)) == CHAR_TYPE))
- {
- if (int_size_in_bytes (TREE_TYPE (fname)) == 0)
- {
- error ("argument 2 of ASSOCIATE must not be an empty string");
- had_errors = 1;
- }
- else
- {
- arg2 = force_addr_of (fname);
- arg3 = size_in_bytes (TREE_TYPE (fname));
- }
- }
- else if (chill_varying_string_type_p (TREE_TYPE (fname)))
- {
- arg2 = force_addr_of (build_component_ref (fname, var_data_id));
- arg3 = build_component_ref (fname, var_length_id);
- }
- else
- {
- error ("argument 2 to ASSOCIATE must be a string");
- had_errors = 1;
- }
-
- /* check attr argument, must be a string too */
- if (attr == NULL_TREE)
- {
- arg4 = null_pointer_node;
- arg5 = integer_zero_node;
- }
- else
- {
- attr = TREE_VALUE (attr);
- if (attr == NULL_TREE || TREE_CODE (attr) == ERROR_MARK)
- had_errors = 1;
- else
- {
- if (CH_CHARS_TYPE_P (TREE_TYPE (attr)) ||
- (flag_old_strings && TREE_CODE (attr) == INTEGER_CST &&
- TREE_CODE (TREE_TYPE (attr)) == CHAR_TYPE))
- {
- if (int_size_in_bytes (TREE_TYPE (attr)) == 0)
- {
- arg4 = null_pointer_node;
- arg5 = integer_zero_node;
- }
- else
- {
- arg4 = force_addr_of (attr);
- arg5 = size_in_bytes (TREE_TYPE (attr));
- }
- }
- else if (chill_varying_string_type_p (TREE_TYPE (attr)))
- {
- arg4 = force_addr_of (build_component_ref (attr, var_data_id));
- arg5 = build_component_ref (attr, var_length_id);
- }
- else
- {
- error ("argument 3 to ASSOCIATE must be a string");
- had_errors = 1;
- }
- }
- }
-
- if (had_errors)
- return error_mark_node;
-
- /* other arguments */
- arg6 = force_addr_of (get_chill_filename ());
- arg7 = get_chill_linenumber ();
-
- result = build_chill_function_call (
- lookup_name (get_identifier ("__associate")),
- tree_cons (NULL_TREE, arg1,
- tree_cons (NULL_TREE, arg2,
- tree_cons (NULL_TREE, arg3,
- tree_cons (NULL_TREE, arg4,
- tree_cons (NULL_TREE, arg5,
- tree_cons (NULL_TREE, arg6,
- tree_cons (NULL_TREE, arg7, NULL_TREE))))))));
-
- TREE_TYPE (result) = build_chill_pointer_type (TREE_TYPE (assoc));
- return result;
-}
-
-static tree
-assoc_call (assoc, func, name)
- tree assoc;
- tree func;
- const char *name;
-{
- tree arg1, arg2, arg3;
- tree result;
-
- if (! check_assoc (assoc, 1, name))
- return error_mark_node;
-
- arg1 = force_addr_of (assoc);
- arg2 = force_addr_of (get_chill_filename ());
- arg3 = get_chill_linenumber ();
-
- result = build_chill_function_call (func,
- tree_cons (NULL_TREE, arg1,
- tree_cons (NULL_TREE, arg2,
- tree_cons (NULL_TREE, arg3, NULL_TREE))));
- return result;
-}
-
-tree
-build_chill_isassociated (assoc)
- tree assoc;
-{
- tree result = assoc_call (assoc,
- lookup_name (get_identifier ("__isassociated")),
- "ISASSOCIATED");
- return result;
-}
-
-tree
-build_chill_existing (assoc)
- tree assoc;
-{
- tree result = assoc_call (assoc,
- lookup_name (get_identifier ("__existing")),
- "EXISTING");
- return result;
-}
-
-tree
-build_chill_readable (assoc)
- tree assoc;
-{
- tree result = assoc_call (assoc,
- lookup_name (get_identifier ("__readable")),
- "READABLE");
- return result;
-}
-
-tree
-build_chill_writeable (assoc)
- tree assoc;
-{
- tree result = assoc_call (assoc,
- lookup_name (get_identifier ("__writeable")),
- "WRITEABLE");
- return result;
-}
-
-tree
-build_chill_sequencible (assoc)
- tree assoc;
-{
- tree result = assoc_call (assoc,
- lookup_name (get_identifier ("__sequencible")),
- "SEQUENCIBLE");
- return result;
-}
-
-tree
-build_chill_variable (assoc)
- tree assoc;
-{
- tree result = assoc_call (assoc,
- lookup_name (get_identifier ("__variable")),
- "VARIABLE");
- return result;
-}
-
-tree
-build_chill_indexable (assoc)
- tree assoc;
-{
- tree result = assoc_call (assoc,
- lookup_name (get_identifier ("__indexable")),
- "INDEXABLE");
- return result;
-}
-
-tree
-build_chill_dissociate (assoc)
- tree assoc;
-{
- tree result = assoc_call (assoc,
- lookup_name (get_identifier ("__dissociate")),
- "DISSOCIATE");
- return result;
-}
-
-tree
-build_chill_create (assoc)
- tree assoc;
-{
- tree result = assoc_call (assoc,
- lookup_name (get_identifier ("__create")),
- "CREATE");
- return result;
-}
-
-tree
-build_chill_delete (assoc)
- tree assoc;
-{
- tree result = assoc_call (assoc,
- lookup_name (get_identifier ("__delete")),
- "DELETE");
- return result;
-}
-
-tree
-build_chill_modify (assoc, list)
- tree assoc;
- tree list;
-{
- tree arg1 = NULL_TREE, arg2 = NULL_TREE, arg3 = NULL_TREE, arg4 = NULL_TREE,
- arg5 = NULL_TREE, arg6, arg7;
- int had_errors = 0, numargs;
- tree fname = NULL_TREE, attr = NULL_TREE;
- tree result;
-
- /* check the association */
- if (! check_assoc (assoc, 1, "MODIFY"))
- had_errors = 1;
- else
- arg1 = force_addr_of (assoc);
-
- /* look how much arguments we have got */
- numargs = list_length (list);
- switch (numargs)
- {
- case 0:
- break;
- case 1:
- fname = TREE_VALUE (list);
- break;
- case 2:
- fname = TREE_VALUE (list);
- attr = TREE_VALUE (TREE_CHAIN (list));
- break;
- default:
- error ("Too many arguments in call to MODIFY");
- had_errors = 1;
- break;
- }
-
- if (fname != NULL_TREE && fname != null_pointer_node)
- {
- if (CH_CHARS_TYPE_P (TREE_TYPE (fname)) ||
- (flag_old_strings && TREE_CODE (fname) == INTEGER_CST &&
- TREE_CODE (TREE_TYPE (fname)) == CHAR_TYPE))
- {
- if (int_size_in_bytes (TREE_TYPE (fname)) == 0)
- {
- error ("argument 2 of MODIFY must not be an empty string");
- had_errors = 1;
- }
- else
- {
- arg2 = force_addr_of (fname);
- arg3 = size_in_bytes (TREE_TYPE (fname));
- }
- }
- else if (chill_varying_string_type_p (TREE_TYPE (fname)))
- {
- arg2 = force_addr_of (build_component_ref (fname, var_data_id));
- arg3 = build_component_ref (fname, var_length_id);
- }
- else
- {
- error ("argument 2 to MODIFY must be a string");
- had_errors = 1;
- }
- }
- else
- {
- arg2 = null_pointer_node;
- arg3 = integer_zero_node;
- }
-
- if (attr != NULL_TREE && attr != null_pointer_node)
- {
- if (CH_CHARS_TYPE_P (TREE_TYPE (attr)) ||
- (flag_old_strings && TREE_CODE (attr) == INTEGER_CST &&
- TREE_CODE (TREE_TYPE (attr)) == CHAR_TYPE))
- {
- if (int_size_in_bytes (TREE_TYPE (attr)) == 0)
- {
- arg4 = null_pointer_node;
- arg5 = integer_zero_node;
- }
- else
- {
- arg4 = force_addr_of (attr);
- arg5 = size_in_bytes (TREE_TYPE (attr));
- }
- }
- else if (chill_varying_string_type_p (TREE_TYPE (attr)))
- {
- arg4 = force_addr_of (build_component_ref (attr, var_data_id));
- arg5 = build_component_ref (attr, var_length_id);
- }
- else
- {
- error ("argument 3 to MODIFY must be a string");
- had_errors = 1;
- }
- }
- else
- {
- arg4 = null_pointer_node;
- arg5 = integer_zero_node;
- }
-
- if (had_errors)
- return error_mark_node;
-
- /* other arguments */
- arg6 = force_addr_of (get_chill_filename ());
- arg7 = get_chill_linenumber ();
-
- result = build_chill_function_call (
- lookup_name (get_identifier ("__modify")),
- tree_cons (NULL_TREE, arg1,
- tree_cons (NULL_TREE, arg2,
- tree_cons (NULL_TREE, arg3,
- tree_cons (NULL_TREE, arg4,
- tree_cons (NULL_TREE, arg5,
- tree_cons (NULL_TREE, arg6,
- tree_cons (NULL_TREE, arg7, NULL_TREE))))))));
-
- return result;
-}
-
-static int
-check_transfer (transfer, argnum, errmsg)
- tree transfer;
- int argnum;
- const char *errmsg;
-{
- int result = 0;
-
- if (transfer == NULL_TREE || TREE_CODE (transfer) == ERROR_MARK)
- return 0;
-
- if (CH_IS_ACCESS_MODE (TREE_TYPE (transfer)))
- result = 1;
- else if (CH_IS_TEXT_MODE (TREE_TYPE (transfer)))
- result = 2;
- else
- {
- error ("argument %d of %s must be an ACCESS or TEXT mode", argnum, errmsg);
- return 0;
- }
- if (! CH_LOCATION_P (transfer))
- {
- error ("argument %d of %s must be a location", argnum, errmsg);
- return 0;
- }
- return result;
-}
-
-/* define bits in an access/text flag word.
- NOTE: this must be consistent with runtime/iomodes.h */
-#define IO_TEXTLOCATION 0x80000000
-#define IO_INDEXED 0x00000001
-#define IO_TEXTIO 0x00000002
-#define IO_OUTOFFILE 0x00010000
-
-/* generated initialisation code for ACCESS and TEXT.
- functions gets called from do_decl. */
-void init_access_location (decl, type)
- tree decl;
- tree type;
-{
- tree recordmode = access_recordmode (type);
- tree indexmode = access_indexmode (type);
- int flags_init = 0;
- tree data = build_component_ref (decl, get_identifier ("data"));
- tree lowindex = integer_zero_node;
- tree highindex = integer_zero_node;
- tree rectype, reclen;
-
- /* flag word */
- if (indexmode != NULL_TREE && indexmode != void_type_node)
- {
- flags_init |= IO_INDEXED;
- lowindex = convert (integer_type_node, TYPE_MIN_VALUE (indexmode));
- highindex = convert (integer_type_node, TYPE_MAX_VALUE (indexmode));
- }
-
- expand_expr_stmt (
- build_chill_modify_expr (
- build_component_ref (data, get_identifier ("flags")),
- build_int_2 (flags_init, 0)));
-
- /* record length */
- if (recordmode == NULL_TREE || recordmode == void_type_node)
- {
- reclen = integer_zero_node;
- rectype = integer_zero_node;
- }
- else if (chill_varying_string_type_p (recordmode))
- {
- tree fields = TYPE_FIELDS (recordmode);
- tree len1, len2;
-
- /* don't count any padding bytes at end of varying */
- len1 = size_in_bytes (TREE_TYPE (fields));
- fields = TREE_CHAIN (fields);
- len2 = size_in_bytes (TREE_TYPE (fields));
- reclen = fold (build (PLUS_EXPR, long_integer_type_node, len1, len2));
- rectype = build_int_2 (2, 0);
- }
- else
- {
- reclen = size_in_bytes (recordmode);
- rectype = integer_one_node;
- }
- expand_expr_stmt (
- build_chill_modify_expr (
- build_component_ref (data, get_identifier ("reclength")), reclen));
-
- /* record type */
- expand_expr_stmt (
- build_chill_modify_expr (
- build_component_ref (data, get_identifier ("rectype")), rectype));
-
- /* the index */
- expand_expr_stmt (
- build_chill_modify_expr (
- build_component_ref (data, get_identifier ("lowindex")), lowindex));
- expand_expr_stmt (
- build_chill_modify_expr (
- build_component_ref (data, get_identifier ("highindex")), highindex));
-
- /* association */
- expand_expr_stmt (
- build_chill_modify_expr (
- build_chill_component_ref (data, get_identifier ("association")),
- null_pointer_node));
-
- /* storelocptr */
- expand_expr_stmt (
- build_chill_modify_expr (
- build_component_ref (data, get_identifier ("storelocptr")), null_pointer_node));
-}
-
-void init_text_location (decl, type)
- tree decl;
- tree type;
-{
- tree indexmode = text_indexmode (type);
- unsigned long accessflags = 0;
- unsigned long textflags = IO_TEXTLOCATION;
- tree lowindex = integer_zero_node;
- tree highindex = integer_zero_node;
- tree data, tloc, tlocfields, len1, len2, reclen;
-
- if (indexmode != NULL_TREE && indexmode != void_type_node)
- {
- accessflags |= IO_INDEXED;
- lowindex = convert (integer_type_node, TYPE_MIN_VALUE (indexmode));
- highindex = convert (integer_type_node, TYPE_MAX_VALUE (indexmode));
- }
-
- tloc = build_component_ref (decl, get_identifier ("tloc"));
- /* fill access part of text location */
- data = build_component_ref (decl, get_identifier ("acc"));
- /* flag word */
- expand_expr_stmt (
- build_chill_modify_expr (
- build_component_ref (data, get_identifier ("flags")),
- build_int_2 (accessflags, 0)));
-
- /* record length, don't count any padding bytes at end of varying */
- tlocfields = TYPE_FIELDS (TREE_TYPE (tloc));
- len1 = size_in_bytes (TREE_TYPE (tlocfields));
- tlocfields = TREE_CHAIN (tlocfields);
- len2 = size_in_bytes (TREE_TYPE (tlocfields));
- reclen = fold (build (PLUS_EXPR, long_integer_type_node, len1, len2));
- expand_expr_stmt (
- build_chill_modify_expr (
- build_component_ref (data, get_identifier ("reclength")),
- reclen));
-
- /* the index */
- expand_expr_stmt (
- build_chill_modify_expr (
- build_component_ref (data, get_identifier ("lowindex")), lowindex));
- expand_expr_stmt (
- build_chill_modify_expr (
- build_component_ref (data, get_identifier ("highindex")), highindex));
-
- /* association */
- expand_expr_stmt (
- build_chill_modify_expr (
- build_chill_component_ref (data, get_identifier ("association")),
- null_pointer_node));
-
- /* storelocptr */
- expand_expr_stmt (
- build_chill_modify_expr (
- build_component_ref (data, get_identifier ("storelocptr")),
- null_pointer_node));
-
- /* record type */
- expand_expr_stmt (
- build_chill_modify_expr (
- build_component_ref (data, get_identifier ("rectype")),
- build_int_2 (2, 0))); /* VaryingChars */
-
- /* fill text part */
- data = build_component_ref (decl, get_identifier ("txt"));
- /* flag word */
- expand_expr_stmt (
- build_chill_modify_expr (
- build_component_ref (data, get_identifier ("flags")),
- build_int_2 (textflags, 0)));
-
- /* pointer to text record */
- expand_expr_stmt (
- build_chill_modify_expr (
- build_component_ref (data, get_identifier ("text_record")),
- force_addr_of (tloc)));
-
- /* pointer to the access */
- expand_expr_stmt (
- build_chill_modify_expr (
- build_component_ref (data, get_identifier ("access_sub")),
- force_addr_of (build_component_ref (decl, get_identifier ("acc")))));
-
- /* actual length */
- expand_expr_stmt (
- build_chill_modify_expr (
- build_component_ref (data, get_identifier ("actual_index")),
- integer_zero_node));
-
- /* length of text record */
- expand_expr_stmt (
- build_chill_modify_expr (
- build_component_ref (tloc, get_identifier (VAR_LENGTH)),
- integer_zero_node));
-}
-
-static int
-connect_process_optionals (optionals, whereptr, indexptr, indexmode)
- tree optionals;
- tree *whereptr;
- tree *indexptr;
- tree indexmode;
-{
- tree where = NULL_TREE, theindex = NULL_TREE;
- int had_errors = 0;
-
- if (optionals != NULL_TREE)
- {
- /* get the where expression */
- where = TREE_VALUE (optionals);
- if (where == NULL_TREE || TREE_CODE (where) == ERROR_MARK)
- had_errors = 1;
- else
- {
- if (! CH_IS_WHERE_MODE (TREE_TYPE (where)))
- {
- error ("argument 4 of CONNECT must be of mode WHERE");
- had_errors = 1;
- }
- where = convert (integer_type_node, where);
- }
- optionals = TREE_CHAIN (optionals);
- }
- if (optionals != NULL_TREE)
- {
- theindex = TREE_VALUE (optionals);
- if (theindex == NULL_TREE || TREE_CODE (theindex) == ERROR_MARK)
- had_errors = 1;
- else
- {
- if (indexmode == void_type_node)
- {
- error ("index expression for ACCESS without index");
- had_errors = 1;
- }
- else if (! CH_COMPATIBLE (theindex, indexmode))
- {
- error ("incompatible index mode");
- had_errors = 1;
- }
- }
- }
- if (had_errors)
- return 0;
-
- *whereptr = where;
- *indexptr = theindex;
- return 1;
-}
-
-static tree
-connect_text (assoc, text, usage, optionals)
- tree assoc;
- tree text;
- tree usage;
- tree optionals;
-{
- tree where = NULL_TREE, theindex = NULL_TREE;
- tree indexmode = text_indexmode (TREE_TYPE (text));
- tree result, what_where, have_index, what_index;
-
- /* process optionals */
- if (!connect_process_optionals (optionals, &where, &theindex, indexmode))
- return error_mark_node;
-
- what_where = where == NULL_TREE ? integer_zero_node : where;
- have_index = theindex == NULL_TREE ? integer_zero_node
- : integer_one_node;
- what_index = theindex == NULL_TREE ? integer_zero_node
- : convert (integer_type_node, theindex);
- result = build_chill_function_call (
- lookup_name (get_identifier ("__connect")),
- tree_cons (NULL_TREE, force_addr_of (text),
- tree_cons (NULL_TREE, force_addr_of (assoc),
- tree_cons (NULL_TREE, convert (integer_type_node, usage),
- tree_cons (NULL_TREE, what_where,
- tree_cons (NULL_TREE, have_index,
- tree_cons (NULL_TREE, what_index,
- tree_cons (NULL_TREE, force_addr_of (get_chill_filename ()),
- tree_cons (NULL_TREE, get_chill_linenumber (),
- NULL_TREE)))))))));
- return result;
-}
-
-static tree
-connect_access (assoc, transfer, usage, optionals)
- tree assoc;
- tree transfer;
- tree usage;
- tree optionals;
-{
- tree where = NULL_TREE, theindex = NULL_TREE;
- tree indexmode = access_indexmode (TREE_TYPE (transfer));
- tree result, what_where, have_index, what_index;
-
- /* process the optionals */
- if (! connect_process_optionals (optionals, &where, &theindex, indexmode))
- return error_mark_node;
-
- /* now the call */
- what_where = where == NULL_TREE ? integer_zero_node : where;
- have_index = theindex == NULL_TREE ? integer_zero_node : integer_one_node;
- what_index = theindex == NULL_TREE ? integer_zero_node : convert (integer_type_node, theindex);
- result = build_chill_function_call (
- lookup_name (get_identifier ("__connect")),
- tree_cons (NULL_TREE, force_addr_of (transfer),
- tree_cons (NULL_TREE, force_addr_of (assoc),
- tree_cons (NULL_TREE, convert (integer_type_node, usage),
- tree_cons (NULL_TREE, what_where,
- tree_cons (NULL_TREE, have_index,
- tree_cons (NULL_TREE, what_index,
- tree_cons (NULL_TREE, force_addr_of (get_chill_filename ()),
- tree_cons (NULL_TREE, get_chill_linenumber (),
- NULL_TREE)))))))));
- return result;
-}
-
-tree
-build_chill_connect (transfer, assoc, usage, optionals)
- tree transfer;
- tree assoc;
- tree usage;
- tree optionals;
-{
- int had_errors = 0;
- int what = 0;
- tree result = error_mark_node;
-
- if (! check_assoc (assoc, 2, "CONNECT"))
- had_errors = 1;
-
- /* check usage */
- if (usage == NULL_TREE || TREE_CODE (usage) == ERROR_MARK)
- return error_mark_node;
-
- if (! CH_IS_USAGE_MODE (TREE_TYPE (usage)))
- {
- error ("argument 3 to CONNECT must be of mode USAGE");
- had_errors = 1;
- }
- if (had_errors)
- return error_mark_node;
-
- /* look what we have got */
- what = check_transfer (transfer, 1, "CONNECT");
- switch (what)
- {
- case 1:
- /* we have an ACCESS */
- result = connect_access (assoc, transfer, usage, optionals);
- break;
- case 2:
- /* we have a TEXT */
- result = connect_text (assoc, transfer, usage, optionals);
- break;
- default:
- result = error_mark_node;
- }
- return result;
-}
-
-static int
-check_access (access, argnum, errmsg)
- tree access;
- int argnum;
- const char *errmsg;
-{
- if (access == NULL_TREE || TREE_CODE (access) == ERROR_MARK)
- return 1;
-
- if (! CH_IS_ACCESS_MODE (TREE_TYPE (access)))
- {
- error ("argument %d of %s must be of mode ACCESS", argnum, errmsg);
- return 0;
- }
- if (! CH_LOCATION_P (access))
- {
- error ("argument %d of %s must be a location", argnum, errmsg);
- return 0;
- }
- return 1;
-}
-
-tree
-build_chill_readrecord (access, optionals)
- tree access;
- tree optionals;
-{
- int len;
- tree recordmode, indexmode, dynamic, result;
- tree index = NULL_TREE, location = NULL_TREE;
-
- if (! check_access (access, 1, "READRECORD"))
- return error_mark_node;
-
- recordmode = access_recordmode (TREE_TYPE (access));
- indexmode = access_indexmode (TREE_TYPE (access));
- dynamic = access_dynamic (TREE_TYPE (access));
-
- /* process the optionals */
- len = list_length (optionals);
- if (indexmode != void_type_node)
- {
- /* we must have an index */
- if (!len)
- {
- error ("Too few arguments in call to `readrecord'");
- return error_mark_node;
- }
- index = TREE_VALUE (optionals);
- if (index == NULL_TREE || TREE_CODE (index) == ERROR_MARK)
- return error_mark_node;
- optionals = TREE_CHAIN (optionals);
- if (! CH_COMPATIBLE (index, indexmode))
- {
- error ("incompatible index mode");
- return error_mark_node;
- }
- }
-
- /* check the record mode, if one */
- if (optionals != NULL_TREE)
- {
- location = TREE_VALUE (optionals);
- if (location == NULL_TREE || TREE_CODE (location) == ERROR_MARK)
- return error_mark_node;
- if (recordmode != void_type_node &&
- ! CH_COMPATIBLE (location, recordmode))
- {
-
- error ("incompatible record mode");
- return error_mark_node;
- }
- if (TYPE_READONLY_PROPERTY (TREE_TYPE (location)))
- {
- error ("store location must not be READonly");
- return error_mark_node;
- }
- location = force_addr_of (location);
- }
- else
- location = null_pointer_node;
-
- index = index == NULL_TREE ? integer_zero_node : convert (integer_type_node, index);
- result = build_chill_function_call (
- lookup_name (get_identifier ("__readrecord")),
- tree_cons (NULL_TREE, force_addr_of (access),
- tree_cons (NULL_TREE, index,
- tree_cons (NULL_TREE, location,
- tree_cons (NULL_TREE, force_addr_of (get_chill_filename ()),
- tree_cons (NULL_TREE, get_chill_linenumber (), NULL_TREE))))));
-
- TREE_TYPE (result) = build_chill_pointer_type (recordmode);
- return result;
-}
-
-tree
-build_chill_writerecord (access, optionals)
- tree access;
- tree optionals;
-{
- int had_errors = 0, len;
- tree recordmode, indexmode, dynamic;
- tree index = NULL_TREE, location = NULL_TREE;
- tree result;
-
- if (! check_access (access, 1, "WRITERECORD"))
- return error_mark_node;
-
- recordmode = access_recordmode (TREE_TYPE (access));
- indexmode = access_indexmode (TREE_TYPE (access));
- dynamic = access_dynamic (TREE_TYPE (access));
-
- /* process the optionals */
- len = list_length (optionals);
- if (indexmode != void_type_node && len != 2)
- {
- error ("Too few arguments in call to `writerecord'");
- return error_mark_node;
- }
- if (indexmode != void_type_node)
- {
- index = TREE_VALUE (optionals);
- if (index == NULL_TREE || TREE_CODE (index) == ERROR_MARK)
- return error_mark_node;
- location = TREE_VALUE (TREE_CHAIN (optionals));
- if (location == NULL_TREE || TREE_CODE (location) == ERROR_MARK)
- return error_mark_node;
- }
- else
- location = TREE_VALUE (optionals);
-
- /* check the index */
- if (indexmode != void_type_node)
- {
- if (! CH_COMPATIBLE (index, indexmode))
- {
- error ("incompatible index mode");
- had_errors = 1;
- }
- }
- /* check the record mode */
- if (recordmode == void_type_node)
- {
- error ("transfer to ACCESS without record mode");
- had_errors = 1;
- }
- else if (! CH_COMPATIBLE (location, recordmode))
- {
- error ("incompatible record mode");
- had_errors = 1;
- }
- if (had_errors)
- return error_mark_node;
-
- index = index == NULL_TREE ? integer_zero_node : convert (integer_type_node, index);
-
- result = build_chill_function_call (
- lookup_name (get_identifier ("__writerecord")),
- tree_cons (NULL_TREE, force_addr_of (access),
- tree_cons (NULL_TREE, index,
- tree_cons (NULL_TREE, force_addr_of (location),
- tree_cons (NULL_TREE, size_in_bytes (TREE_TYPE (location)),
- tree_cons (NULL_TREE, force_addr_of (get_chill_filename ()),
- tree_cons (NULL_TREE, get_chill_linenumber (), NULL_TREE)))))));
- return result;
-}
-
-tree
-build_chill_disconnect (transfer)
- tree transfer;
-{
- tree result;
-
- if (! check_transfer (transfer, 1, "DISCONNECT"))
- return error_mark_node;
- result = build_chill_function_call (
- lookup_name (get_identifier ("__disconnect")),
- tree_cons (NULL_TREE, force_addr_of (transfer),
- tree_cons (NULL_TREE, force_addr_of (get_chill_filename ()),
- tree_cons (NULL_TREE, get_chill_linenumber (), NULL_TREE))));
- return result;
-}
-
-tree
-build_chill_getassociation (transfer)
- tree transfer;
-{
- tree result;
-
- if (! check_transfer (transfer, 1, "GETASSOCIATION"))
- return error_mark_node;
-
- result = build_chill_function_call (
- lookup_name (get_identifier ("__getassociation")),
- tree_cons (NULL_TREE, force_addr_of (transfer),
- tree_cons (NULL_TREE, force_addr_of (get_chill_filename ()),
- tree_cons (NULL_TREE, get_chill_linenumber (), NULL_TREE))));
- TREE_TYPE (result) = build_chill_pointer_type (association_type_node);
- return result;
-}
-
-tree
-build_chill_getusage (transfer)
- tree transfer;
-{
- tree result;
-
- if (! check_transfer (transfer, 1, "GETUSAGE"))
- return error_mark_node;
-
- result = build_chill_function_call (
- lookup_name (get_identifier ("__getusage")),
- tree_cons (NULL_TREE, force_addr_of (transfer),
- tree_cons (NULL_TREE, force_addr_of (get_chill_filename ()),
- tree_cons (NULL_TREE, get_chill_linenumber (), NULL_TREE))));
- TREE_TYPE (result) = usage_type_node;
- return result;
-}
-
-tree
-build_chill_outoffile (transfer)
- tree transfer;
-{
- tree result;
-
- if (! check_transfer (transfer, 1, "OUTOFFILE"))
- return error_mark_node;
-
- result = build_chill_function_call (
- lookup_name (get_identifier ("__outoffile")),
- tree_cons (NULL_TREE, force_addr_of (transfer),
- tree_cons (NULL_TREE, force_addr_of (get_chill_filename ()),
- tree_cons (NULL_TREE, get_chill_linenumber (), NULL_TREE))));
- return result;
-}
-
-static int
-check_text (text, argnum, errmsg)
- tree text;
- int argnum;
- const char *errmsg;
-{
- if (text == NULL_TREE || TREE_CODE (text) == ERROR_MARK)
- return 0;
- if (! CH_IS_TEXT_MODE (TREE_TYPE (text)))
- {
- error ("argument %d of %s must be of mode TEXT", argnum, errmsg);
- return 0;
- }
- if (! CH_LOCATION_P (text))
- {
- error ("argument %d of %s must be a location", argnum, errmsg);
- return 0;
- }
- return 1;
-}
-
-tree
-build_chill_eoln (text)
- tree text;
-{
- tree result;
-
- if (! check_text (text, 1, "EOLN"))
- return error_mark_node;
-
- result = build_chill_function_call (
- lookup_name (get_identifier ("__eoln")),
- tree_cons (NULL_TREE, force_addr_of (text),
- tree_cons (NULL_TREE, force_addr_of (get_chill_filename ()),
- tree_cons (NULL_TREE, get_chill_linenumber (), NULL_TREE))));
- return result;
-}
-
-tree
-build_chill_gettextindex (text)
- tree text;
-{
- tree result;
-
- if (! check_text (text, 1, "GETTEXTINDEX"))
- return error_mark_node;
-
- result = build_chill_function_call (
- lookup_name (get_identifier ("__gettextindex")),
- tree_cons (NULL_TREE, force_addr_of (text),
- tree_cons (NULL_TREE, force_addr_of (get_chill_filename ()),
- tree_cons (NULL_TREE, get_chill_linenumber (), NULL_TREE))));
- return result;
-}
-
-tree
-build_chill_gettextrecord (text)
- tree text;
-{
- tree textmode, result;
-
- if (! check_text (text, 1, "GETTEXTRECORD"))
- return error_mark_node;
-
- textmode = textlocation_mode (TREE_TYPE (text));
- if (textmode == NULL_TREE)
- {
- error ("TEXT doesn't have a location"); /* FIXME */
- return error_mark_node;
- }
- result = build_chill_function_call (
- lookup_name (get_identifier ("__gettextrecord")),
- tree_cons (NULL_TREE, force_addr_of (text),
- tree_cons (NULL_TREE, force_addr_of (get_chill_filename ()),
- tree_cons (NULL_TREE, get_chill_linenumber (), NULL_TREE))));
- TREE_TYPE (result) = build_chill_pointer_type (textmode);
- CH_DERIVED_FLAG (result) = 1;
- return result;
-}
-
-tree
-build_chill_gettextaccess (text)
- tree text;
-{
- tree access, refaccess, acc, decl, listbase;
- tree tlocmode, indexmode, dynamic;
- tree result;
- unsigned int save_maximum_field_alignment = maximum_field_alignment;
-
- if (! check_text (text, 1, "GETTEXTACCESS"))
- return error_mark_node;
-
- tlocmode = textlocation_mode (TREE_TYPE (text));
- indexmode = text_indexmode (TREE_TYPE (text));
- dynamic = text_dynamic (TREE_TYPE (text));
-
- /* we have to build a type for the access */
- acc = build_access_part ();
- access = make_node (RECORD_TYPE);
- listbase = build_decl (FIELD_DECL, get_identifier ("data"), acc);
- TYPE_FIELDS (access) = listbase;
- decl = build_lang_decl (TYPE_DECL, get_identifier ("__recordmode"),
- tlocmode);
- chainon (listbase, decl);
- decl = build_lang_decl (TYPE_DECL, get_identifier ("__indexmode"),
- indexmode);
- chainon (listbase, decl);
- decl = build_decl (CONST_DECL, get_identifier ("__dynamic"),
- integer_type_node);
- DECL_INITIAL (decl) = dynamic;
- chainon (listbase, decl);
- maximum_field_alignment = 0;
- layout_chill_struct_type (access);
- maximum_field_alignment = save_maximum_field_alignment;
- CH_IS_ACCESS_MODE (access) = 1;
- CH_TYPE_NONVALUE_P (access) = 1;
-
- refaccess = build_chill_pointer_type (access);
-
- result = build_chill_function_call (
- lookup_name (get_identifier ("__gettextaccess")),
- tree_cons (NULL_TREE, force_addr_of (text),
- tree_cons (NULL_TREE, force_addr_of (get_chill_filename ()),
- tree_cons (NULL_TREE, get_chill_linenumber (), NULL_TREE))));
- TREE_TYPE (result) = refaccess;
- CH_DERIVED_FLAG (result) = 1;
- return result;
-}
-
-tree
-build_chill_settextindex (text, expr)
- tree text;
- tree expr;
-{
- tree result;
-
- if (! check_text (text, 1, "SETTEXTINDEX"))
- return error_mark_node;
- if (expr == NULL_TREE || TREE_CODE (expr) == ERROR_MARK)
- return error_mark_node;
- result = build_chill_function_call (
- lookup_name (get_identifier ("__settextindex")),
- tree_cons (NULL_TREE, force_addr_of (text),
- tree_cons (NULL_TREE, expr,
- tree_cons (NULL_TREE, force_addr_of (get_chill_filename ()),
- tree_cons (NULL_TREE, get_chill_linenumber (), NULL_TREE)))));
- return result;
-}
-
-tree
-build_chill_settextaccess (text, access)
- tree text;
- tree access;
-{
- tree result;
- tree textindexmode, accessindexmode;
- tree textrecordmode, accessrecordmode;
-
- if (! check_text (text, 1, "SETTEXTACCESS"))
- return error_mark_node;
- if (! check_access (access, 2, "SETTEXTACCESS"))
- return error_mark_node;
-
- textindexmode = text_indexmode (TREE_TYPE (text));
- accessindexmode = access_indexmode (TREE_TYPE (access));
- if (textindexmode != accessindexmode)
- {
- if (! chill_read_compatible (textindexmode, accessindexmode))
- {
- error ("incompatible index mode for SETETEXTACCESS");
- return error_mark_node;
- }
- }
- textrecordmode = textlocation_mode (TREE_TYPE (text));
- accessrecordmode = access_recordmode (TREE_TYPE (access));
- if (textrecordmode != accessrecordmode)
- {
- if (! chill_read_compatible (textrecordmode, accessrecordmode))
- {
- error ("incompatible record mode for SETTEXTACCESS");
- return error_mark_node;
- }
- }
- result = build_chill_function_call (
- lookup_name (get_identifier ("__settextaccess")),
- tree_cons (NULL_TREE, force_addr_of (text),
- tree_cons (NULL_TREE, force_addr_of (access),
- tree_cons (NULL_TREE, force_addr_of (get_chill_filename ()),
- tree_cons (NULL_TREE, get_chill_linenumber (), NULL_TREE)))));
- return result;
-}
-
-tree
-build_chill_settextrecord (text, charloc)
- tree text;
- tree charloc;
-{
- tree result;
- int had_errors = 0;
- tree tlocmode;
-
- if (! check_text (text, 1, "SETTEXTRECORD"))
- return error_mark_node;
- if (charloc == NULL_TREE || TREE_CODE (charloc) == ERROR_MARK)
- return error_mark_node;
-
- /* check the location */
- if (! CH_LOCATION_P (charloc))
- {
- error ("parameter 2 must be a location");
- return error_mark_node;
- }
- tlocmode = textlocation_mode (TREE_TYPE (text));
- if (! chill_varying_string_type_p (TREE_TYPE (charloc)))
- had_errors = 1;
- else if (int_size_in_bytes (tlocmode) != int_size_in_bytes (TREE_TYPE (charloc)))
- had_errors = 1;
- if (had_errors)
- {
- error ("incompatible modes in parameter 2");
- return error_mark_node;
- }
- result = build_chill_function_call (
- lookup_name (get_identifier ("__settextrecord")),
- tree_cons (NULL_TREE, force_addr_of (text),
- tree_cons (NULL_TREE, force_addr_of (charloc),
- tree_cons (NULL_TREE, force_addr_of (get_chill_filename ()),
- tree_cons (NULL_TREE, get_chill_linenumber (), NULL_TREE)))));
- return result;
-}
-
-/* process iolist for READ- and WRITETEXT */
-
-/* function walks through types as long as they are ranges,
- returns the type and min- and max-value form starting type.
- */
-
-static tree
-get_final_type_and_range (item, low, high)
- tree item;
- tree *low;
- tree *high;
-{
- tree wrk = item;
-
- *low = TYPE_MIN_VALUE (wrk);
- *high = TYPE_MAX_VALUE (wrk);
- while (TREE_CODE (wrk) == INTEGER_TYPE &&
- TREE_TYPE (wrk) != NULL_TREE &&
- TREE_CODE (TREE_TYPE (wrk)) == INTEGER_TYPE &&
- TREE_TYPE (TREE_TYPE (wrk)) != NULL_TREE)
- wrk = TREE_TYPE (wrk);
-
- return (TREE_TYPE (wrk));
-}
-
-static void
-process_io_list (exprlist, iolist_addr, iolist_length, iolist_rtx, do_read,
- argoffset)
- tree exprlist;
- tree *iolist_addr;
- tree *iolist_length;
- rtx *iolist_rtx;
- int do_read;
- int argoffset;
-{
- tree idxlist;
- int idxcnt;
- int iolen;
- tree iolisttype, iolist;
-
- if (exprlist == NULL_TREE)
- return;
-
- iolen = list_length (exprlist);
-
- /* build indexlist for the io list */
- idxlist = build_tree_list (NULL_TREE,
- build_chill_range_type (NULL_TREE,
- integer_one_node,
- build_int_2 (iolen, 0)));
-
- /* build the io-list type */
- iolisttype = build_chill_array_type (TREE_TYPE (chill_io_list_type),
- idxlist, 0, NULL_TREE);
-
- /* declare the iolist */
- iolist = build_decl (VAR_DECL, get_unique_identifier (do_read ? "RDTEXT" : "WRTEXT"),
- iolisttype);
-
- /* we want to get a variable which gets marked unused after
- the function call, This is a little bit tricky cause the
- address of this variable will be taken and therefor the variable
- gets moved out one level. However, we REALLY don't need this
- variable again. Solution: push 2 levels and do pop and free
- twice at the end. */
- push_temp_slots ();
- push_temp_slots ();
- *iolist_rtx = assign_temp (TREE_TYPE (iolist), 0, 1, 0);
- DECL_RTL (iolist) = *iolist_rtx;
-
- /* process the exprlist */
- idxcnt = 1;
- while (exprlist != NULL_TREE)
- {
- tree item = TREE_VALUE (exprlist);
- tree idx = build_int_2 (idxcnt++, 0);
- const char *fieldname = 0;
- const char *enumname = 0;
- tree array_ref = build_chill_array_ref_1 (iolist, idx);
- tree item_type;
- tree range_low = NULL_TREE, range_high = NULL_TREE;
- int have_range = 0;
- tree item_addr = null_pointer_node;
- int referable = 0;
- int readonly = 0;
-
- /* next value in exprlist */
- exprlist = TREE_CHAIN (exprlist);
- if (item == NULL_TREE || TREE_CODE (item) == ERROR_MARK)
- continue;
-
- item_type = TREE_TYPE (item);
- if (item_type == NULL_TREE)
- {
- if (TREE_CODE (item) == COND_EXPR || TREE_CODE (item) == CASE_EXPR)
- error ("conditional expression not allowed in this context");
- else
- error ("untyped expression as argument %d", idxcnt + 1 + argoffset);
- continue;
- }
- else if (TREE_CODE (item_type) == ERROR_MARK)
- continue;
-
- if (TREE_CODE (item_type) == REFERENCE_TYPE)
- {
- item_type = TREE_TYPE (item_type);
- item = convert (item_type, item);
- }
-
- /* check for a range */
- if (TREE_CODE (item_type) == INTEGER_TYPE &&
- TREE_TYPE (item_type) != NULL_TREE)
- {
- /* we have a range. NOTE, however, on writetext we don't process ranges */
- item_type = get_final_type_and_range (item_type,
- &range_low, &range_high);
- have_range = 1;
- }
-
- readonly = TYPE_READONLY_PROPERTY (item_type);
- referable = CH_REFERABLE (item);
- if (referable)
- item_addr = force_addr_of (item);
- /* if we are in read and have readonly we can't do this */
- if (readonly && do_read)
- {
- item_addr = null_pointer_node;
- referable = 0;
- }
-
- /* process different types */
- if (TREE_CODE (item_type) == INTEGER_TYPE)
- {
- int type_size = TREE_INT_CST_LOW (TYPE_SIZE (item_type));
- tree to_assign = NULL_TREE;
-
- if (do_read && referable)
- {
- /* process an integer in case of READTEXT and expression is
- referable and not READONLY */
- to_assign = item_addr;
- if (have_range)
- {
- /* do it for a range */
- tree t, __forxx, __ptr, __low, __high;
- tree what_upper, what_lower;
-
- /* determine the name in the union of lower and upper */
- if (TREE_UNSIGNED (item_type))
- fieldname = "_ulong";
- else
- fieldname = "_slong";
-
- switch (type_size)
- {
- case 8:
- if (TREE_UNSIGNED (item_type))
- enumname = "__IO_UByteRangeLoc";
- else
- enumname = "__IO_ByteRangeLoc";
- break;
- case 16:
- if (TREE_UNSIGNED (item_type))
- enumname = "__IO_UIntRangeLoc";
- else
- enumname = "__IO_IntRangeLoc";
- break;
- case 32:
- if (TREE_UNSIGNED (item_type))
- enumname = "__IO_ULongRangeLoc";
- else
- enumname = "__IO_LongRangeLoc";
- break;
- default:
- error ("Cannot process %d bits integer for READTEXT argument %d.",
- type_size, idxcnt + 1 + argoffset);
- continue;
- }
-
- /* set up access to structure */
- t = build_component_ref (array_ref,
- get_identifier ("__t"));
- __forxx = build_component_ref (t, get_identifier ("__locintrange"));
- __ptr = build_component_ref (__forxx, get_identifier ("ptr"));
- __low = build_component_ref (__forxx, get_identifier ("lower"));
- what_lower = build_component_ref (__low, get_identifier (fieldname));
- __high = build_component_ref (__forxx, get_identifier ("upper"));
- what_upper = build_component_ref (__high, get_identifier (fieldname));
-
- /* do the assignments */
- expand_assignment (__ptr, item_addr, 0, 0);
- expand_assignment (what_lower, range_low, 0, 0);
- expand_assignment (what_upper, range_high, 0, 0);
- fieldname = 0;
- }
- else
- {
- /* no range */
- fieldname = "__locint";
- switch (type_size)
- {
- case 8:
- if (TREE_UNSIGNED (item_type))
- enumname = "__IO_UByteLoc";
- else
- enumname = "__IO_ByteLoc";
- break;
- case 16:
- if (TREE_UNSIGNED (item_type))
- enumname = "__IO_UIntLoc";
- else
- enumname = "__IO_IntLoc";
- break;
- case 32:
- if (TREE_UNSIGNED (item_type))
- enumname = "__IO_ULongLoc";
- else
- enumname = "__IO_LongLoc";
- break;
- default:
- error ("Cannot process %d bits integer for READTEXT argument %d.",
- type_size, idxcnt + 1 + argoffset);
- continue;
- }
- }
- }
- else
- {
- /* process an integer in case of WRITETEXT */
- to_assign = item;
- switch (type_size)
- {
- case 8:
- if (TREE_UNSIGNED (item_type))
- {
- enumname = "__IO_UByteVal";
- fieldname = "__valubyte";
- }
- else
- {
- enumname = "__IO_ByteVal";
- fieldname = "__valbyte";
- }
- break;
- case 16:
- if (TREE_UNSIGNED (item_type))
- {
- enumname = "__IO_UIntVal";
- fieldname = "__valuint";
- }
- else
- {
- enumname = "__IO_IntVal";
- fieldname = "__valint";
- }
- break;
- case 32:
- try_long:
- if (TREE_UNSIGNED (item_type))
- {
- enumname = "__IO_ULongVal";
- fieldname = "__valulong";
- }
- else
- {
- enumname = "__IO_LongVal";
- fieldname = "__vallong";
- }
- break;
- case 64:
- /* convert it back to {unsigned}long. */
- if (TREE_UNSIGNED (item_type))
- item_type = long_unsigned_type_node;
- else
- item_type = long_integer_type_node;
- item = convert (item_type, item);
- goto try_long;
- default:
- /* This kludge is because the lexer gives literals
- the type long_long_{integer,unsigned}_type_node. */
- if (TREE_CODE (item) == INTEGER_CST)
- {
- if (int_fits_type_p (item, long_integer_type_node))
- {
- item_type = long_integer_type_node;
- item = convert (item_type, item);
- goto try_long;
- }
- if (int_fits_type_p (item, long_unsigned_type_node))
- {
- item_type = long_unsigned_type_node;
- item = convert (item_type, item);
- goto try_long;
- }
- }
- error ("Cannot process %d bits integer WRITETEXT argument %d.",
- type_size, idxcnt + 1 + argoffset);
- continue;
- }
- }
- if (fieldname)
- {
- tree t, __forxx;
-
- t = build_component_ref (array_ref,
- get_identifier ("__t"));
- __forxx = build_component_ref (t, get_identifier (fieldname));
- expand_assignment (__forxx, to_assign, 0, 0);
- }
- }
- else if (TREE_CODE (item_type) == CHAR_TYPE)
- {
- tree to_assign = NULL_TREE;
-
- if (do_read && readonly)
- {
- error ("argument %d is READonly", idxcnt + 1 + argoffset);
- continue;
- }
- if (do_read)
- {
- if (! referable)
- {
- error ("argument %d must be referable", idxcnt + 1 + argoffset);
- continue;
- }
- if (have_range)
- {
- tree t, forxx, ptr, lower, upper;
-
- t = build_component_ref (array_ref, get_identifier ("__t"));
- forxx = build_component_ref (t, get_identifier ("__loccharrange"));
- ptr = build_component_ref (forxx, get_identifier ("ptr"));
- lower = build_component_ref (forxx, get_identifier ("lower"));
- upper = build_component_ref (forxx, get_identifier ("upper"));
- expand_assignment (ptr, item_addr, 0, 0);
- expand_assignment (lower, range_low, 0, 0);
- expand_assignment (upper, range_high, 0, 0);
-
- fieldname = 0;
- enumname = "__IO_CharRangeLoc";
- }
- else
- {
- to_assign = item_addr;
- fieldname = "__locchar";
- enumname = "__IO_CharLoc";
- }
- }
- else
- {
- to_assign = item;
- enumname = "__IO_CharVal";
- fieldname = "__valchar";
- }
-
- if (fieldname)
- {
- tree t, forxx;
-
- t = build_component_ref (array_ref, get_identifier ("__t"));
- forxx = build_component_ref (t, get_identifier (fieldname));
- expand_assignment (forxx, to_assign, 0, 0);
- }
- }
- else if (TREE_CODE (item_type) == BOOLEAN_TYPE)
- {
- tree to_assign = NULL_TREE;
-
- if (do_read && readonly)
- {
- error ("argument %d is READonly", idxcnt + 1 + argoffset);
- continue;
- }
- if (do_read)
- {
- if (! referable)
- {
- error ("argument %d must be referable", idxcnt + 1 + argoffset);
- continue;
- }
- if (have_range)
- {
- tree t, forxx, ptr, lower, upper;
-
- t = build_component_ref (array_ref, get_identifier ("__t"));
- forxx = build_component_ref (t, get_identifier ("__locboolrange"));
- ptr = build_component_ref (forxx, get_identifier ("ptr"));
- lower = build_component_ref (forxx, get_identifier ("lower"));
- upper = build_component_ref (forxx, get_identifier ("upper"));
- expand_assignment (ptr, item_addr, 0, 0);
- expand_assignment (lower, range_low, 0, 0);
- expand_assignment (upper, range_high, 0, 0);
-
- fieldname = 0;
- enumname = "__IO_BoolRangeLoc";
- }
- else
- {
- to_assign = item_addr;
- fieldname = "__locbool";
- enumname = "__IO_BoolLoc";
- }
- }
- else
- {
- to_assign = item;
- enumname = "__IO_BoolVal";
- fieldname = "__valbool";
- }
- if (fieldname)
- {
- tree t, forxx;
-
- t = build_component_ref (array_ref, get_identifier ("__t"));
- forxx = build_component_ref (t, get_identifier (fieldname));
- expand_assignment (forxx, to_assign, 0, 0);
- }
- }
- else if (TREE_CODE (item_type) == ENUMERAL_TYPE)
- {
- /* process an enum */
- tree table_name;
- tree context_of_type;
- tree t;
-
- /* determine the context of the type.
- if TYPE_NAME (item_type) == NULL_TREE
- if TREE_CODE (item) == INTEGER_CST
- context = NULL_TREE -- this is wrong but should work for now
- else
- context = DECL_CONTEXT (item)
- else
- context = DECL_CONTEXT (TYPE_NAME (item_type)) */
-
- if (TYPE_NAME (item_type) == NULL_TREE)
- {
- if (TREE_CODE (item) == INTEGER_CST)
- context_of_type = NULL_TREE;
- else
- context_of_type = DECL_CONTEXT (item);
- }
- else
- context_of_type = DECL_CONTEXT (TYPE_NAME (item_type));
-
- table_name = add_enum_to_list (item_type, context_of_type);
- t = build_component_ref (array_ref, get_identifier ("__t"));
-
- if (do_read && readonly)
- {
- error ("argument %d is READonly", idxcnt + 1 + argoffset);
- continue;
- }
- if (do_read)
- {
- if (! referable)
- {
- error ("argument %d must be referable", idxcnt + 1 + argoffset);
- continue;
- }
- if (have_range)
- {
- tree forxx, ptr, len, nametable, lower, upper;
-
- forxx = build_component_ref (t, get_identifier ("__locsetrange"));
- ptr = build_component_ref (forxx, get_identifier ("ptr"));
- len = build_component_ref (forxx, get_identifier ("length"));
- nametable = build_component_ref (forxx, get_identifier ("name_table"));
- lower = build_component_ref (forxx, get_identifier ("lower"));
- upper = build_component_ref (forxx, get_identifier ("upper"));
- expand_assignment (ptr, item_addr, 0, 0);
- expand_assignment (len, size_in_bytes (item_type), 0, 0);
- expand_assignment (nametable, table_name, 0, 0);
- expand_assignment (lower, range_low, 0, 0);
- expand_assignment (upper, range_high, 0, 0);
-
- enumname = "__IO_SetRangeLoc";
- }
- else
- {
- tree forxx, ptr, len, nametable;
-
- forxx = build_component_ref (t, get_identifier ("__locset"));
- ptr = build_component_ref (forxx, get_identifier ("ptr"));
- len = build_component_ref (forxx, get_identifier ("length"));
- nametable = build_component_ref (forxx, get_identifier ("name_table"));
- expand_assignment (ptr, item_addr, 0, 0);
- expand_assignment (len, size_in_bytes (item_type), 0, 0);
- expand_assignment (nametable, table_name, 0, 0);
-
- enumname = "__IO_SetLoc";
- }
- }
- else
- {
- tree forxx, value, nametable;
-
- forxx = build_component_ref (t, get_identifier ("__valset"));
- value = build_component_ref (forxx, get_identifier ("value"));
- nametable = build_component_ref (forxx, get_identifier ("name_table"));
- expand_assignment (value, item, 0, 0);
- expand_assignment (nametable, table_name, 0, 0);
-
- enumname = "__IO_SetVal";
- }
- }
- else if (chill_varying_string_type_p (item_type))
- {
- /* varying char string */
- tree t = build_component_ref (array_ref, get_identifier ("__t"));
- tree forxx = build_component_ref (t, get_identifier ("__loccharstring"));
- tree string = build_component_ref (forxx, get_identifier ("string"));
- tree length = build_component_ref (forxx, get_identifier ("string_length"));
-
- if (do_read && readonly)
- {
- error ("argument %d is READonly", idxcnt + 1 + argoffset);
- continue;
- }
- if (do_read)
- {
- /* in this read case the argument must be referable */
- if (! referable)
- {
- error ("argument %d must be referable", idxcnt + 1 + argoffset);
- continue;
- }
- }
- else if (! referable)
- {
- /* in the write case we create a temporary if not referable */
- rtx t;
- tree loc = build_decl (VAR_DECL,
- get_unique_identifier ("WRTEXTVS"),
- item_type);
- t = assign_temp (item_type, 0, 1, 0);
- DECL_RTL (loc) = t;
- expand_assignment (loc, item, 0, 0);
- item_addr = force_addr_of (loc);
- item = loc;
- }
-
- expand_assignment (string, item_addr, 0, 0);
- if (do_read)
- /* we must pass the maximum length of the varying */
- expand_assignment (length,
- size_in_bytes (TREE_TYPE (TREE_CHAIN (TYPE_FIELDS (item_type)))),
- 0, 0);
- else
- /* we pass the actual length of the string */
- expand_assignment (length,
- build_component_ref (item, var_length_id),
- 0, 0);
-
- enumname = "__IO_CharVaryingLoc";
- }
- else if (CH_CHARS_TYPE_P (item_type))
- {
- /* fixed character string */
- tree the_size;
- tree t = build_component_ref (array_ref, get_identifier ("__t"));
- tree forxx = build_component_ref (t, get_identifier ("__loccharstring"));
- tree string = build_component_ref (forxx, get_identifier ("string"));
- tree length = build_component_ref (forxx, get_identifier ("string_length"));
-
- if (do_read && readonly)
- {
- error ("argument %d is READonly", idxcnt + 1 + argoffset);
- continue;
- }
- if (do_read)
- {
- /* in this read case the argument must be referable */
- if (! CH_REFERABLE (item))
- {
- error ("argument %d must be referable", idxcnt + 1 + argoffset);
- continue;
- }
- else
- item_addr = force_addr_of (item);
- the_size = size_in_bytes (item_type);
- enumname = "__IO_CharStrLoc";
- }
- else
- {
- if (! CH_REFERABLE (item))
- {
- /* in the write case we create a temporary if not referable */
- rtx t;
- int howmuchbytes;
-
- howmuchbytes = int_size_in_bytes (item_type);
- if (howmuchbytes != -1)
- {
- /* fixed size */
- tree loc = build_decl (VAR_DECL,
- get_unique_identifier ("WRTEXTVS"),
- item_type);
- t = assign_temp (item_type, 0, 1, 0);
- DECL_RTL (loc) = t;
- expand_assignment (loc, item, 0, 0);
- item_addr = force_addr_of (loc);
- the_size = size_in_bytes (item_type);
- enumname = "__IO_CharStrLoc";
- }
- else
- {
- tree type, string, exp, loc;
-
- if ((howmuchbytes = intsize_of_charsexpr (item)) == -1)
- {
- error ("cannot process argument %d of WRITETEXT, unknown size",
- idxcnt + 1 + argoffset);
- continue;
- }
- string = build_string_type (char_type_node,
- build_int_2 (howmuchbytes, 0));
- type = build_varying_struct (string);
- loc = build_decl (VAR_DECL,
- get_unique_identifier ("WRTEXTCS"),
- type);
- t = assign_temp (type, 0, 1, 0);
- DECL_RTL (loc) = t;
- exp = chill_convert_for_assignment (type, item, 0);
- expand_assignment (loc, exp, 0, 0);
- item_addr = force_addr_of (loc);
- the_size = integer_zero_node;
- enumname = "__IO_CharVaryingLoc";
- }
- }
- else
- {
- item_addr = force_addr_of (item);
- the_size = size_in_bytes (item_type);
- enumname = "__IO_CharStrLoc";
- }
- }
-
- expand_assignment (string, item_addr, 0, 0);
- expand_assignment (length, size_in_bytes (item_type), 0, 0);
-
- }
- else if (CH_BOOLS_TYPE_P (item_type))
- {
- /* we have a bitstring */
- tree t = build_component_ref (array_ref, get_identifier ("__t"));
- tree forxx = build_component_ref (t, get_identifier ("__loccharstring"));
- tree string = build_component_ref (forxx, get_identifier ("string"));
- tree length = build_component_ref (forxx, get_identifier ("string_length"));
-
- if (do_read && readonly)
- {
- error ("argument %d is READonly", idxcnt + 1 + argoffset);
- continue;
- }
- if (do_read)
- {
- /* in this read case the argument must be referable */
- if (! referable)
- {
- error ("argument %d must be referable", idxcnt + 1 + argoffset);
- continue;
- }
- }
- else if (! referable)
- {
- /* in the write case we create a temporary if not referable */
- tree loc = build_decl (VAR_DECL,
- get_unique_identifier ("WRTEXTVS"),
- item_type);
- DECL_RTL (loc) = assign_temp (item_type, 0, 1, 0);
- expand_assignment (loc, item, 0, 0);
- item_addr = force_addr_of (loc);
- }
-
- expand_assignment (string, item_addr, 0, 0);
- expand_assignment (length, build_chill_length (item), 0, 0);
-
- enumname = "__IO_BitStrLoc";
- }
- else if (TREE_CODE (item_type) == REAL_TYPE)
- {
- /* process a (long_)real */
- tree t, forxx, to_assign;
-
- if (do_read && readonly)
- {
- error ("argument %d is READonly", idxcnt + 1 + argoffset);
- continue;
- }
- if (do_read && ! referable)
- {
- error ("argument %d must be referable", idxcnt + 1 + argoffset);
- continue;
- }
-
- if (lookup_name (ridpointers[RID_FLOAT]) == TYPE_NAME (item_type))
- {
- /* we have a real */
- if (do_read)
- {
- enumname = "__IO_RealLoc";
- fieldname = "__locreal";
- to_assign = item_addr;
- }
- else
- {
- enumname = "__IO_RealVal";
- fieldname = "__valreal";
- to_assign = item;
- }
- }
- else
- {
- /* we have a long_real */
- if (do_read)
- {
- enumname = "__IO_LongRealLoc";
- fieldname = "__loclongreal";
- to_assign = item_addr;
- }
- else
- {
- enumname = "__IO_LongRealVal";
- fieldname = "__vallongreal";
- to_assign = item;
- }
- }
- t = build_component_ref (array_ref, get_identifier ("__t"));
- forxx = build_component_ref (t, get_identifier (fieldname));
- expand_assignment (forxx, to_assign, 0, 0);
- }
-#if 0
- /* don't process them for now */
- else if (TREE_CODE (item_type) == POINTER_TYPE)
- {
- /* we have a pointer */
- tree __t, __forxx;
-
- __t = build_component_ref (array_ref, get_identifier ("__t"));
- __forxx = build_component_ref (__t, get_identifier ("__forpointer"));
- expand_assignment (__forxx, item, 0, 0);
- enumname = "_IO_Pointer";
- }
- else if (item_type == instance_type_node)
- {
- /* we have an INSTANCE */
- tree __t, __forxx;
-
- __t = build_component_ref (array_ref, get_identifier ("__t"));
- __forxx = build_component_ref (__t, get_identifier ("__forinstance"));
- expand_assignment (__forxx, item, 0, 0);
- enumname = "_IO_Instance";
- }
-#endif
- else
- {
- /* datatype is not yet implemented, issue a warning */
- error ("cannot process mode of argument %d for %sTEXT.", idxcnt + 1 + argoffset,
- do_read ? "READ" : "WRITE");
- enumname = "__IO_UNUSED";
- }
-
- /* do assignment of the enum */
- if (enumname)
- {
- tree descr = build_component_ref (array_ref,
- get_identifier ("__descr"));
- expand_assignment (descr,
- lookup_name (get_identifier (enumname)), 0, 0);
- }
- }
-
- /* set up address and length of iolist */
- *iolist_addr = build_chill_addr_expr (iolist, (char *)0);
- *iolist_length = build_int_2 (iolen, 0);
-}
-
-/* check the format string */
-#define LET 0x0001
-#define BIN 0x0002
-#define DEC 0x0004
-#define OCT 0x0008
-#define HEX 0x0010
-#define USC 0x0020
-#define BIL 0x0040
-#define SPC 0x0080
-#define SCS 0x0100
-#define IOC 0x0200
-#define EDC 0x0400
-#define CVC 0x0800
-
-#define isDEC(c) ( chartab[(c)] & DEC )
-#define isCVC(c) ( chartab[(c)] & CVC )
-#define isEDC(c) ( chartab[(c)] & EDC )
-#define isIOC(c) ( chartab[(c)] & IOC )
-#define isUSC(c)
-#define isXXX(c,XXX) ( chartab[(c)] & XXX )
-
-static
-short int chartab[256] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, SPC, SPC, SPC, SPC, SPC, 0, 0,
-
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-
- SPC, IOC, 0, 0, 0, 0, 0, 0,
- SCS, SCS, SCS, SCS+IOC, SCS, SCS+IOC, SCS, SCS+IOC,
- BIN+OCT+DEC+HEX, BIN+OCT+DEC+HEX, OCT+DEC+HEX, OCT+DEC+HEX, OCT+DEC+HEX,
- OCT+DEC+HEX, OCT+DEC+HEX, OCT+DEC+HEX,
- DEC+HEX, DEC+HEX, SCS, SCS, SCS+EDC, SCS+IOC, SCS+EDC, IOC,
-
- 0, LET+HEX+BIL, LET+HEX+BIL+CVC, LET+HEX+BIL+CVC, LET+HEX+BIL, LET+HEX,
- LET+HEX+CVC, LET,
- LET+BIL+CVC, LET, LET, LET, LET, LET, LET, LET+CVC,
-
- LET, LET, LET, LET, LET+EDC, LET, LET, LET,
- LET+EDC, LET, LET, SCS, 0, SCS, 0, USC,
-
- 0, LET+HEX, LET+HEX, LET+HEX, LET+HEX, LET+HEX, LET+HEX, LET,
- LET, LET, LET, LET, LET, LET, LET, LET,
-
- LET, LET, LET, LET, LET, LET, LET, LET,
- LET, LET, LET, 0, 0, 0, 0, 0
-};
-
-typedef enum
-{
- FormatText, FirstPercent, RepFact, ConvClause, EditClause, ClauseEnd,
- AfterWidth, FractWidth, FractWidthCont, ExpoWidth, ExpoWidthCont,
- ClauseWidth, CatchPadding, LastPercent
-} fcsstate_t;
-
-#define CONVERSIONCODES "CHOBF"
-typedef enum
-{
- DefaultConv, HexConv, OctalConv, BinaryConv, ScientConv
-} convcode_t;
-static convcode_t convcode;
-
-static tree check_exprlist PARAMS ((convcode_t, tree, int,
- unsigned long));
-
-typedef enum
-{
- False, True,
-} Boolean;
-
-static unsigned long fractionwidth;
-
-#define IOCODES "/+-?!="
-typedef enum {
- NextRecord, NextPage, CurrentLine, Prompt, Emit, EndPage
-} iocode_t;
-static iocode_t iocode;
-
-#define EDITCODES "X<>T"
-typedef enum {
- SpaceSkip, SkipLeft, SkipRight, Tabulation
-} editcode_t;
-static editcode_t editcode;
-
-static unsigned long clausewidth;
-static Boolean leftadjust;
-static Boolean overflowev;
-static Boolean dynamicwid;
-static Boolean paddingdef;
-static char paddingchar;
-static Boolean fractiondef;
-static Boolean exponentdef;
-static unsigned long exponentwidth;
-static unsigned long repetition;
-
-typedef enum {
- NormalEnd, EndAtParen, TextFailEnd
-} formatexit_t;
-
-static formatexit_t scanformcont PARAMS ((char *, int, char **, int *,
- tree, tree *, int, int *));
-
-/* NOTE: varibale have to be set to False before calling check_format_string */
-static Boolean empty_printed;
-
-static int formstroffset;
-
-static tree
-check_exprlist (code, exprlist, argnum, repetition)
- convcode_t code;
- tree exprlist;
- int argnum;
- unsigned long repetition;
-{
- tree expr, type, result = NULL_TREE;
-
- while (repetition--)
- {
- if (exprlist == NULL_TREE)
- {
- if (empty_printed == False)
- {
- warning ("too few arguments for this format string");
- empty_printed = True;
- }
- return NULL_TREE;
- }
- expr = TREE_VALUE (exprlist);
- result = exprlist = TREE_CHAIN (exprlist);
- if (expr == NULL_TREE || TREE_CODE (expr) == ERROR_MARK)
- return result;
- type = TREE_TYPE (expr);
- if (type == NULL_TREE || TREE_CODE (type) == ERROR_MARK)
- return result;
- if (TREE_CODE (type) == REFERENCE_TYPE)
- type = TREE_TYPE (type);
- if (type == NULL_TREE || TREE_CODE (type) == ERROR_MARK)
- return result;
-
- switch (code)
- {
- case DefaultConv:
- /* %C, everything is allowed. Not know types are flaged later. */
- break;
- case ScientConv:
- /* %F, must be a REAL */
- if (TREE_CODE (type) != REAL_TYPE)
- warning ("type of argument %d invalid for conversion code at offset %d",
- argnum, formstroffset);
- break;
- case HexConv:
- case OctalConv:
- case BinaryConv:
- case -1:
- /* %H, %O, %B, and V as clause width */
- if (TREE_CODE (type) != INTEGER_TYPE)
- warning ("type of argument %d invalid for conversion code at offset %d",
- argnum, formstroffset);
- break;
- default:
- /* there is an invalid conversion code */
- break;
- }
- }
- return result;
-}
-
-static formatexit_t
-scanformcont (fcs, len, fcsptr, lenptr, exprlist, exprptr,
- firstargnum, nextargnum)
- char *fcs;
- int len;
- char **fcsptr;
- int *lenptr;
- tree exprlist;
- tree *exprptr;
- int firstargnum;
- int *nextargnum;
-{
- fcsstate_t state = FormatText;
- unsigned char curr;
- int dig;
-
- while (len--)
- {
- curr = *fcs++;
- formstroffset++;
- switch (state)
- {
- case FormatText:
- if (curr == '%')
- state = FirstPercent;
- break;
-
- after_first_percent: ;
- case FirstPercent:
- if (curr == '%')
- {
- state = FormatText;
- break;
- }
- if (curr == ')')
- {
- *lenptr = len;
- *fcsptr = fcs;
- *exprptr = exprlist;
- *nextargnum = firstargnum;
- return EndAtParen;
- }
- if (isDEC (curr))
- {
- state = RepFact;
- repetition = curr - '0';
- break;
- }
-
- repetition = 1;
-
- test_for_control_codes: ;
- if (isCVC (curr))
- {
- state = ConvClause;
- convcode = strchr (CONVERSIONCODES, curr) - CONVERSIONCODES;
- leftadjust = False;
- overflowev = False;
- dynamicwid = False;
- paddingdef = False;
- paddingchar = ' ';
- fractiondef = False;
- /* fractionwidth = 0; default depends on mode ! */
- exponentdef = False;
- exponentwidth = 3;
- clausewidth = 0;
- /* check the argument */
- exprlist = check_exprlist (convcode, exprlist, firstargnum, repetition);
- firstargnum++;
- break;
- }
- if (isEDC (curr))
- {
- state = EditClause;
- editcode = strchr (EDITCODES, curr) - EDITCODES;
- dynamicwid = False;
- clausewidth = editcode == Tabulation ? 0 : 1;
- break;
- }
- if (isIOC (curr))
- {
- state = ClauseEnd;
- iocode = strchr (IOCODES, curr) - IOCODES;
- break;
- }
- if (curr == '(')
- {
- unsigned long times = repetition;
- int cntlen;
- char* cntfcs;
- tree cntexprlist;
- int nextarg;
-
- while (times--)
- {
- if (scanformcont (fcs, len, &cntfcs, &cntlen,
- exprlist, &cntexprlist,
- firstargnum, &nextarg) != EndAtParen )
- {
- warning ("unmatched open paren");
- break;
- }
- exprlist = cntexprlist;
- }
- fcs = cntfcs;
- len = cntlen;
- if (len < 0)
- len = 0;
- exprlist = cntexprlist;
- firstargnum = nextarg;
- state = FormatText;
- break;
- }
- warning ("bad format specification character (offset %d)", formstroffset);
- state = FormatText;
- /* skip one argument */
- if (exprlist != NULL_TREE)
- exprlist = TREE_CHAIN (exprlist);
- break;
-
- case RepFact:
- if (isDEC (curr))
- {
- dig = curr - '0';
- if (repetition > (ULONG_MAX - dig)/10)
- {
- warning ("repetition factor overflow (offset %d)", formstroffset);
- return TextFailEnd;
- }
- repetition = repetition*10 + dig;
- break;
- }
- goto test_for_control_codes;
-
- case ConvClause:
- if (isDEC (curr))
- {
- state = ClauseWidth;
- clausewidth = curr - '0';
- break;
- }
- if (curr == 'L')
- {
- if (leftadjust)
- warning ("duplicate qualifier (offset %d)", formstroffset);
- leftadjust = True;
- break;
- }
- if (curr == 'E')
- {
- if (overflowev)
- warning ("duplicate qualifier (offset %d)", formstroffset);
- overflowev = True;
- break;
- }
- if (curr == 'P')
- {
- if (paddingdef)
- warning ("duplicate qualifier (offset %d)", formstroffset);
- paddingdef = True;
- state = CatchPadding;
- break;
- }
-
- test_for_variable_width: ;
- if (curr == 'V')
- {
- dynamicwid = True;
- state = AfterWidth;
- exprlist = check_exprlist (-1, exprlist, firstargnum, 1);
- firstargnum++;
- break;
- }
- goto test_for_fraction_width;
-
- case ClauseWidth:
- if (isDEC (curr))
- {
- dig = curr - '0';
- if (clausewidth > (ULONG_MAX - dig)/10)
- warning ("clause width overflow (offset %d)", formstroffset);
- else
- clausewidth = clausewidth*10 + dig;
- break;
- }
- /* fall through */
-
- test_for_fraction_width: ;
- case AfterWidth:
- if (curr == '.')
- {
- if (convcode != DefaultConv && convcode != ScientConv)
- {
- warning ("no fraction (offset %d)", formstroffset);
- state = FormatText;
- break;
- }
- fractiondef = True;
- state = FractWidth;
- break;
- }
- goto test_for_exponent_width;
-
- case FractWidth:
- if (isDEC (curr))
- {
- state = FractWidthCont;
- fractionwidth = curr - '0';
- break;
- }
- else
- warning ("no fraction width (offset %d)", formstroffset);
-
- case FractWidthCont:
- if (isDEC (curr))
- {
- dig = curr - '0';
- if (fractionwidth > (ULONG_MAX - dig)/10)
- warning ("fraction width overflow (offset %d)", formstroffset);
- else
- fractionwidth = fractionwidth*10 + dig;
- break;
- }
-
- test_for_exponent_width: ;
- if (curr == ':')
- {
- if (convcode != ScientConv)
- {
- warning ("no exponent (offset %d)", formstroffset);
- state = FormatText;
- break;
- }
- exponentdef = True;
- state = ExpoWidth;
- break;
- }
- goto test_for_final_percent;
-
- case ExpoWidth:
- if (isDEC (curr))
- {
- state = ExpoWidthCont;
- exponentwidth = curr - '0';
- break;
- }
- else
- warning ("no exponent width (offset %d)", formstroffset);
-
- case ExpoWidthCont:
- if (isDEC (curr))
- {
- dig = curr - '0';
- if (exponentwidth > (ULONG_MAX - dig)/10)
- warning ("exponent width overflow (offset %d)", formstroffset);
- else
- exponentwidth = exponentwidth*10 + dig;
- break;
- }
- /* fall through */
-
- test_for_final_percent: ;
- case ClauseEnd:
- if (curr == '%')
- {
- state = LastPercent;
- break;
- }
-
- state = FormatText;
- break;
-
- case CatchPadding:
- paddingchar = curr;
- state = ConvClause;
- break;
-
- case EditClause:
- if (isDEC (curr))
- {
- state = ClauseWidth;
- clausewidth = curr - '0';
- break;
- }
- goto test_for_variable_width;
-
- case LastPercent:
- if (curr == '.')
- {
- state = FormatText;
- break;
- }
- goto after_first_percent;
-
- default:
- error ("internal error in check_format_string");
- }
- }
-
- switch (state)
- {
- case FormatText:
- break;
- case FirstPercent:
- case LastPercent:
- case RepFact:
- case FractWidth:
- case ExpoWidth:
- warning ("bad format specification character (offset %d)", formstroffset);
- break;
- case CatchPadding:
- warning ("no padding character (offset %d)", formstroffset);
- break;
- default:
- break;
- }
- *fcsptr = fcs;
- *lenptr = len;
- *exprptr = exprlist;
- *nextargnum = firstargnum;
- return NormalEnd;
-}
-static void
-check_format_string (format_str, exprlist, firstargnum)
- tree format_str;
- tree exprlist;
- int firstargnum;
-{
- char *x;
- int y, yy;
- tree z = NULL_TREE;
-
- if (TREE_CODE (format_str) != STRING_CST)
- /* do nothing if we don't have a string constant */
- return;
-
- formstroffset = -1;
- scanformcont (TREE_STRING_POINTER (format_str),
- TREE_STRING_LENGTH (format_str), &x, &y,
- exprlist, &z,
- firstargnum, &yy);
- if (z != NULL_TREE)
- /* too may arguments for format string */
- warning ("too many arguments for this format string");
-}
-
-static int
-get_max_size (expr)
- tree expr;
-{
- if (TREE_CODE (expr) == INDIRECT_REF)
- {
- tree x = TREE_OPERAND (expr, 0);
- tree y = TREE_OPERAND (x, 0);
- return int_size_in_bytes (TREE_TYPE (y));
- }
- else if (TREE_CODE (expr) == CONCAT_EXPR)
- return intsize_of_charsexpr (expr);
- else
- return int_size_in_bytes (TREE_TYPE (expr));
-}
-
-static int
-intsize_of_charsexpr (expr)
- tree expr;
-{
- int op0size, op1size;
-
- if (TREE_CODE (expr) != CONCAT_EXPR)
- return -1;
-
- /* find maximum length of CONCAT_EXPR, this is the worst case */
- op0size = get_max_size (TREE_OPERAND (expr, 0));
- op1size = get_max_size (TREE_OPERAND (expr, 1));
- if (op0size == -1 || op1size == -1)
- return -1;
- return op0size + op1size;
-}
-
-tree
-build_chill_writetext (text_arg, exprlist)
- tree text_arg, exprlist;
-{
- tree iolist_addr = null_pointer_node;
- tree iolist_length = integer_zero_node;
- tree fstr_addr;
- tree fstr_length;
- tree outstr_addr;
- tree outstr_length;
- tree fstrtype;
- tree outfunction;
- tree filename, linenumber;
- tree format_str = NULL_TREE, indexexpr = NULL_TREE;
- rtx iolist_rtx = NULL_RTX;
- int argoffset = 0;
-
- /* make some checks */
- if (text_arg == NULL_TREE || TREE_CODE (text_arg) == ERROR_MARK)
- return error_mark_node;
-
- if (exprlist != NULL_TREE)
- {
- if (TREE_CODE (exprlist) != TREE_LIST)
- return error_mark_node;
- }
-
- /* check the text argument */
- if (chill_varying_string_type_p (TREE_TYPE (text_arg)))
- {
- /* build outstr-addr and outstr-length assuming that this is a CHAR (n) VARYING */
- outstr_addr = force_addr_of (text_arg);
- outstr_length = size_in_bytes (CH_VARYING_ARRAY_TYPE (TREE_TYPE (text_arg)));
- outfunction = lookup_name (get_identifier ("__writetext_s"));
- format_str = TREE_VALUE (exprlist);
- exprlist = TREE_CHAIN (exprlist);
- }
- else if (CH_IS_TEXT_MODE (TREE_TYPE (text_arg)))
- {
- /* we have a text mode */
- tree indexmode;
-
- if (! check_text (text_arg, 1, "WRITETEXT"))
- return error_mark_node;
- indexmode = text_indexmode (TREE_TYPE (text_arg));
- if (indexmode == void_type_node)
- {
- /* no index */
- format_str = TREE_VALUE (exprlist);
- exprlist = TREE_CHAIN (exprlist);
- }
- else
- {
- /* we have an index. there must be an index argument before format string */
- indexexpr = TREE_VALUE (exprlist);
- exprlist = TREE_CHAIN (exprlist);
- if (! CH_COMPATIBLE (indexexpr, indexmode))
- {
- if (chill_varying_string_type_p (TREE_TYPE (indexexpr)) ||
- (CH_CHARS_TYPE_P (TREE_TYPE (indexexpr)) ||
- (flag_old_strings && TREE_CODE (indexexpr) == INTEGER_CST &&
- TREE_CODE (TREE_TYPE (indexexpr)) == CHAR_TYPE)))
- error ("missing index expression");
- else
- error ("incompatible index mode");
- return error_mark_node;
- }
- if (exprlist == NULL_TREE)
- {
- error ("Too few arguments in call to `writetext'");
- return error_mark_node;
- }
- format_str = TREE_VALUE (exprlist);
- exprlist = TREE_CHAIN (exprlist);
- argoffset = 1;
- }
- outstr_addr = force_addr_of (text_arg);
- outstr_length = convert (integer_type_node, indexexpr);
- outfunction = lookup_name (get_identifier ("__writetext_f"));
- }
- else
- {
- error ("argument 1 for WRITETEXT must be a TEXT or CHARS(n) VARYING location");
- return error_mark_node;
- }
-
- /* check the format string */
- fstrtype = TREE_TYPE (format_str);
- if (CH_CHARS_TYPE_P (fstrtype) ||
- (flag_old_strings && TREE_CODE (format_str) == INTEGER_CST &&
- TREE_CODE (fstrtype) == CHAR_TYPE))
- {
- /* we have a character string */
- fstr_addr = force_addr_of (format_str);
- fstr_length = size_in_bytes (fstrtype);
- }
- else if (chill_varying_string_type_p (TREE_TYPE (format_str)))
- {
- /* we have a varying char string */
- fstr_addr
- = force_addr_of (build_component_ref (format_str, var_data_id));
- fstr_length = build_component_ref (format_str, var_length_id);
- }
- else
- {
- error ("`format string' for WRITETEXT must be a CHARACTER string");
- return error_mark_node;
- }
-
- empty_printed = False;
- check_format_string (format_str, exprlist, argoffset + 3);
- process_io_list (exprlist, &iolist_addr, &iolist_length, &iolist_rtx, 0, argoffset);
-
- /* tree to call the function */
-
- filename = force_addr_of (get_chill_filename ());
- linenumber = get_chill_linenumber ();
-
- expand_expr_stmt (
- build_chill_function_call (outfunction,
- tree_cons (NULL_TREE, outstr_addr,
- tree_cons (NULL_TREE, outstr_length,
- tree_cons (NULL_TREE, fstr_addr,
- tree_cons (NULL_TREE, fstr_length,
- tree_cons (NULL_TREE, iolist_addr,
- tree_cons (NULL_TREE, iolist_length,
- tree_cons (NULL_TREE, filename,
- tree_cons (NULL_TREE, linenumber,
- NULL_TREE))))))))));
-
- /* get rid of the iolist variable, if we have one */
- if (iolist_rtx != NULL_RTX)
- {
- free_temp_slots ();
- pop_temp_slots ();
- free_temp_slots ();
- pop_temp_slots ();
- }
-
- /* return something the rest of the machinery can work with,
- i.e. (void)0 */
- return build1 (CONVERT_EXPR, void_type_node, integer_zero_node);
-}
-
-tree
-build_chill_readtext (text_arg, exprlist)
- tree text_arg, exprlist;
-{
- tree instr_addr, instr_length, infunction;
- tree fstr_addr, fstr_length, fstrtype;
- tree iolist_addr = null_pointer_node;
- tree iolist_length = integer_zero_node;
- tree filename, linenumber;
- tree format_str = NULL_TREE, indexexpr = NULL_TREE;
- rtx iolist_rtx = NULL_RTX;
- int argoffset = 0;
-
- /* make some checks */
- if (text_arg == NULL_TREE || TREE_CODE (text_arg) == ERROR_MARK)
- return error_mark_node;
-
- if (exprlist != NULL_TREE)
- {
- if (TREE_CODE (exprlist) != TREE_LIST)
- return error_mark_node;
- }
-
- /* check the text argument */
- if (CH_CHARS_TYPE_P (TREE_TYPE (text_arg)))
- {
- instr_addr = force_addr_of (text_arg);
- instr_length = size_in_bytes (TREE_TYPE (text_arg));
- infunction = lookup_name (get_identifier ("__readtext_s"));
- format_str = TREE_VALUE (exprlist);
- exprlist = TREE_CHAIN (exprlist);
- }
- else if (chill_varying_string_type_p (TREE_TYPE (text_arg)))
- {
- instr_addr
- = force_addr_of (build_component_ref (text_arg, var_data_id));
- instr_length = build_component_ref (text_arg, var_length_id);
- infunction = lookup_name (get_identifier ("__readtext_s"));
- format_str = TREE_VALUE (exprlist);
- exprlist = TREE_CHAIN (exprlist);
- }
- else if (CH_IS_TEXT_MODE (TREE_TYPE (text_arg)))
- {
- /* we have a text mode */
- tree indexmode;
-
- if (! check_text (text_arg, 1, "READTEXT"))
- return error_mark_node;
- indexmode = text_indexmode (TREE_TYPE (text_arg));
- if (indexmode == void_type_node)
- {
- /* no index */
- format_str = TREE_VALUE (exprlist);
- exprlist = TREE_CHAIN (exprlist);
- }
- else
- {
- /* we have an index. there must be an index argument before format string */
- indexexpr = TREE_VALUE (exprlist);
- exprlist = TREE_CHAIN (exprlist);
- if (! CH_COMPATIBLE (indexexpr, indexmode))
- {
- if (chill_varying_string_type_p (TREE_TYPE (indexexpr)) ||
- (CH_CHARS_TYPE_P (TREE_TYPE (indexexpr)) ||
- (flag_old_strings && TREE_CODE (indexexpr) == INTEGER_CST &&
- TREE_CODE (TREE_TYPE (indexexpr)) == CHAR_TYPE)))
- error ("missing index expression");
- else
- error ("incompatible index mode");
- return error_mark_node;
- }
- if (exprlist == NULL_TREE)
- {
- error ("Too few arguments in call to `readtext'");
- return error_mark_node;
- }
- format_str = TREE_VALUE (exprlist);
- exprlist = TREE_CHAIN (exprlist);
- argoffset = 1;
- }
- instr_addr = force_addr_of (text_arg);
- instr_length = convert (integer_type_node, indexexpr);
- infunction = lookup_name (get_identifier ("__readtext_f"));
- }
- else
- {
- error ("argument 1 for READTEXT must be a TEXT location or CHARS(n) [ VARYING ] expression");
- return error_mark_node;
- }
-
- /* check the format string */
- fstrtype = TREE_TYPE (format_str);
- if (CH_CHARS_TYPE_P (fstrtype))
- {
- /* we have a character string */
- fstr_addr = force_addr_of (format_str);
- fstr_length = size_in_bytes (fstrtype);
- }
- else if (chill_varying_string_type_p (fstrtype))
- {
- /* we have a CHARS(n) VARYING */
- fstr_addr
- = force_addr_of (build_component_ref (format_str, var_data_id));
- fstr_length = build_component_ref (format_str, var_length_id);
- }
- else
- {
- error ("`format string' for READTEXT must be a CHARACTER string");
- return error_mark_node;
- }
-
- empty_printed = False;
- check_format_string (format_str, exprlist, argoffset + 3);
- process_io_list (exprlist, &iolist_addr, &iolist_length, &iolist_rtx, 1, argoffset);
-
- /* build the function call */
- filename = force_addr_of (get_chill_filename ());
- linenumber = get_chill_linenumber ();
- expand_expr_stmt (
- build_chill_function_call (infunction,
- tree_cons (NULL_TREE, instr_addr,
- tree_cons (NULL_TREE, instr_length,
- tree_cons (NULL_TREE, fstr_addr,
- tree_cons (NULL_TREE, fstr_length,
- tree_cons (NULL_TREE, iolist_addr,
- tree_cons (NULL_TREE, iolist_length,
- tree_cons (NULL_TREE, filename,
- tree_cons (NULL_TREE, linenumber,
- NULL_TREE))))))))));
-
- /* get rid of the iolist variable, if we have one */
- if (iolist_rtx != NULL_RTX)
- {
- free_temp_slots ();
- pop_temp_slots ();
- free_temp_slots ();
- pop_temp_slots ();
- }
-
- /* return something the rest of the machinery can work with,
- i.e. (void)0 */
- return build1 (CONVERT_EXPR, void_type_node, integer_zero_node);
-}
-
-/* this function build all neccesary enum-tables used for
- WRITETEXT or READTEXT of an enum */
-
-void build_enum_tables ()
-{
- SAVE_ENUM_NAMES *names;
- SAVE_ENUMS *wrk;
- void *saveptr;
- /* We temporarily reset the maximum_field_alignment to zero so the
- compiler's init data structures can be compatible with the
- run-time system, even when we're compiling with -fpack. */
- unsigned int save_maximum_field_alignment;
-
- if (pass == 1)
- return;
-
- save_maximum_field_alignment = maximum_field_alignment;
- maximum_field_alignment = 0;
-
- /* output all names */
- names = used_enum_names;
-
- while (names != (SAVE_ENUM_NAMES *)0)
- {
- tree var = get_unique_identifier ("ENUMNAME");
- tree type;
-
- type = build_string_type (char_type_node,
- build_int_2 (IDENTIFIER_LENGTH (names->name) + 1, 0));
- names->decl = decl_temp1 (var, type, 1,
- build_chill_string (IDENTIFIER_LENGTH (names->name) + 1,
- IDENTIFIER_POINTER (names->name)),
- 0, 0);
- names = names->forward;
- }
-
- /* output the tables and pointers to tables */
- wrk = used_enums;
- while (wrk != (SAVE_ENUMS *)0)
- {
- tree varptr = wrk->ptrdecl;
- tree table_addr = null_pointer_node;
- tree init = NULL_TREE, one_entry;
- tree table, idxlist, tabletype, addr;
- SAVE_ENUM_VALUES *vals;
- int i;
-
- vals = wrk->vals;
- for (i = 0; i < wrk->num_vals; i++)
- {
- tree decl = vals->name->decl;
- addr = build1 (ADDR_EXPR,
- build_pointer_type (char_type_node),
- decl);
- TREE_CONSTANT (addr) = 1;
- one_entry = tree_cons (NULL_TREE, build_int_2 (vals->val, 0),
- tree_cons (NULL_TREE, addr, NULL_TREE));
- one_entry = build_nt (CONSTRUCTOR, NULL_TREE, one_entry);
- init = tree_cons (NULL_TREE, one_entry, init);
- vals++;
- }
-
- /* add the terminator (name = null_pointer_node) to constructor */
- one_entry = tree_cons (NULL_TREE, integer_zero_node,
- tree_cons (NULL_TREE, null_pointer_node, NULL_TREE));
- one_entry = build_nt (CONSTRUCTOR, NULL_TREE, one_entry);
- init = tree_cons (NULL_TREE, one_entry, init);
- init = nreverse (init);
- init = build_nt (CONSTRUCTOR, NULL_TREE, init);
- TREE_CONSTANT (init) = 1;
-
- /* generate table */
- idxlist = build_tree_list (NULL_TREE,
- build_chill_range_type (NULL_TREE,
- integer_zero_node,
- build_int_2 (wrk->num_vals, 0)));
- tabletype = build_chill_array_type (TREE_TYPE (enum_table_type),
- idxlist, 0, NULL_TREE);
- table = decl_temp1 (get_unique_identifier ("ENUMTAB"), tabletype,
- 1, init, 0, 0);
- table_addr = build1 (ADDR_EXPR,
- build_pointer_type (TREE_TYPE (enum_table_type)),
- table);
- TREE_CONSTANT (table_addr) = 1;
-
- /* generate pointer to table */
- decl_temp1 (DECL_NAME (varptr), TREE_TYPE (table_addr),
- 1, table_addr, 0, 0);
-
- /* free that stuff */
- saveptr = wrk->forward;
-
- free (wrk->vals);
- free (wrk);
-
- /* next enum */
- wrk = saveptr;
- }
-
- /* free all the names */
- names = used_enum_names;
- while (names != (SAVE_ENUM_NAMES *)0)
- {
- saveptr = names->forward;
- free (names);
- names = saveptr;
- }
-
- used_enums = (SAVE_ENUMS *)0;
- used_enum_names = (SAVE_ENUM_NAMES *)0;
- maximum_field_alignment = save_maximum_field_alignment;
-}
diff --git a/gcc/ch/lang-options.h b/gcc/ch/lang-options.h
deleted file mode 100644
index 69797cbd491..00000000000
--- a/gcc/ch/lang-options.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/* Definitions for switches for GNU CHILL.
- Copyright (C) 1995, 1998 Free Software Foundation, Inc.
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* This is the contribution to the `documented_lang_options' array in
- toplev.c for CHILL. */
-
-DEFINE_LANG_NAME ("Chill")
-
- { "-lang-chill", "" },
- { "-flocal-loop-counter", "" },
- { "-fno-local-loop-counter", "Do not make separate scopes for every 'for' loop"},
- { "-fgrant-only", "Stop after successfully generating a grant file" },
- { "-fchill-grant-only", "" },
- { "-fold-strings", "Implement the 1984 Chill string semantics" },
- { "-fno-old-strings", "" },
- { "-fignore-case", "convert all idenitifers to lower case" },
- { "-fno-ignore-case", "" },
- { "-fpack", "Pack structures into available space"},
- { "-fno-pack", "" },
- { "-fspecial_UC", "Make special words be in uppercase" },
- { "-fspecial_LC", "" },
- { "-fruntime-checking", "" },
- { "-fno-runtime-checking", "Disable runtime checking of parameters" },
diff --git a/gcc/ch/lang.c b/gcc/ch/lang.c
deleted file mode 100644
index 0c493b70bfe..00000000000
--- a/gcc/ch/lang.c
+++ /dev/null
@@ -1,305 +0,0 @@
-/* Language-specific hook definitions for CHILL front end.
- Copyright (C) 1992, 1993, 1994, 1998, 1999, 2000, 2001
- Free Software Foundation, Inc.
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-
-#include "config.h"
-#include "system.h"
-#include "tree.h"
-#include "ch-tree.h"
-#include "lex.h"
-#include "input.h"
-#include "toplev.h"
-#include "rtl.h"
-#include "expr.h"
-
-/* Type node for boolean types. */
-
-tree boolean_type_node;
-
-/* True if STRING(INDEX) yields a CHARS(1) (or BOOLS(1)) rather than
- a CHAR (or BOOL). Also, makes CHARS(1) similar for CHAR,
- and BOOLS(1) similar to BOOL. This is for compatibility
- for the 1984 version of Z.200.*/
-int flag_old_strings = 0;
-
-/* This is set non-zero to force user input tokens to lower case.
- This is non-standard. See Z.200, page 8. */
-int ignore_case = 1;
-
-/* True if reserved and predefined words ('special' words in the Z.200
- terminology) are in uppercase. Obviously, this had better not be
- true if we're ignoring input case. */
-int special_UC = 0;
-
-/* The actual name of the input file, regardless of any #line directives */
-const char* chill_real_input_filename;
-extern FILE* finput;
-
-static int deep_const_expr PARAMS ((tree));
-static void chill_print_error_function PARAMS ((const char *));
-
-/* Return 1 if the expression tree given has all
- constant nodes as its leaves,otherwise. */
-
-static int
-deep_const_expr (exp)
- tree exp;
-{
- enum chill_tree_code code;
- int length;
- int i;
-
- if (exp == NULL_TREE)
- return 0;
-
- code = TREE_CODE (exp);
- length = first_rtl_op (TREE_CODE (exp));
-
- /* constant leaf? return TRUE */
- if (TREE_CODE_CLASS (code) == 'c')
- return 1;
-
- /* Recursively check next level down. */
- for (i = 0; i < length; i++)
- if (! deep_const_expr (TREE_OPERAND (exp, i)))
- return 0;
- return 1;
-}
-
-
-tree
-const_expr (exp)
- tree exp;
-{
- if (TREE_CODE (exp) == INTEGER_CST)
- return exp;
- if (TREE_CODE (exp) == CONST_DECL)
- return const_expr (DECL_INITIAL (exp));
- if (TREE_CODE_CLASS (TREE_CODE (exp)) == 'd'
- && DECL_INITIAL (exp) != NULL_TREE
- && TREE_READONLY (exp))
- return DECL_INITIAL (exp);
- if (deep_const_expr (exp))
- return exp;
- if (TREE_CODE (exp) != ERROR_MARK)
- error ("non-constant expression");
- return error_mark_node;
-}
-
-/* Each of the functions defined here
- is an alternative to a function in objc-actions.c. */
-
-/* Used by c-lex.c, but only for objc. */
-tree
-lookup_interface (arg)
- tree arg ATTRIBUTE_UNUSED;
-{
- return 0;
-}
-
-int
-maybe_objc_comptypes (lhs, rhs)
- tree lhs ATTRIBUTE_UNUSED, rhs ATTRIBUTE_UNUSED;
-{
- return -1;
-}
-
-tree
-maybe_building_objc_message_expr ()
-{
- return 0;
-}
-
-int
-recognize_objc_keyword ()
-{
- return 0;
-}
-
-void
-lang_init_options ()
-{
-}
-
-/* used by print-tree.c */
-
-void
-lang_print_xnode (file, node, indent)
- FILE *file ATTRIBUTE_UNUSED;
- tree node ATTRIBUTE_UNUSED;
- int indent ATTRIBUTE_UNUSED;
-{
-}
-
-/*
- * process chill-specific compiler command-line options
- * do not complain if the option is not recognised
- */
-int
-lang_decode_option (argc, argv)
- int argc;
- char **argv;
-{
- char *p = argv[0];
- static int explicit_ignore_case = 0;
- if (!strcmp(p, "-lang-chill"))
- ; /* do nothing */
- else if (!strcmp (p, "-fruntime-checking"))
- {
- range_checking = 1;
- empty_checking = 1;
- }
- else if (!strcmp (p, "-fno-runtime-checking"))
- {
- range_checking = 0;
- empty_checking = 0;
- runtime_checking_flag = 0;
- }
- else if (!strcmp (p, "-flocal-loop-counter"))
- flag_local_loop_counter = 1;
- else if (!strcmp (p, "-fno-local-loop-counter"))
- flag_local_loop_counter = 0;
- else if (!strcmp (p, "-fold-strings"))
- flag_old_strings = 1;
- else if (!strcmp (p, "-fno-old-strings"))
- flag_old_strings = 0;
- else if (!strcmp (p, "-fignore-case"))
- {
- explicit_ignore_case = 1;
- if (special_UC)
- {
- error ("Ignoring case upon input and");
- error ("making special words uppercase wouldn't work.");
- }
- else
- ignore_case = 1;
- }
- else if (!strcmp (p, "-fno-ignore-case"))
- ignore_case = 0;
- else if (!strcmp (p, "-fspecial_UC"))
- {
- if (explicit_ignore_case)
- {
- error ("Making special words uppercase and");
- error (" ignoring case upon input wouldn't work.");
- }
- else
- special_UC = 1, ignore_case = 0;
- }
- else if (!strcmp (p, "-fspecial_LC"))
- special_UC = 0;
- else if (!strcmp (p, "-fpack"))
- maximum_field_alignment = BITS_PER_UNIT;
- else if (!strcmp (p, "-fno-pack"))
- maximum_field_alignment = 0;
- else if (!strcmp (p, "-fchill-grant-only"))
- grant_only_flag = 1;
- else if (!strcmp (p, "-fgrant-only"))
- grant_only_flag = 1;
- /* user has specified a seize-file path */
- else if (p[0] == '-' && p[1] == 'I')
- register_seize_path (&p[2]);
- if (!strcmp(p, "-itu")) /* Force Z.200 semantics */
- {
- pedantic = 1; /* FIXME: new flag name? */
- flag_local_loop_counter = 1;
- }
- else
- return c_decode_option (argc, argv);
-
- return 1;
-}
-
-static void
-chill_print_error_function (file)
- const char *file;
-{
- static tree last_error_function = NULL_TREE;
- static struct module *last_error_module = NULL;
-
- if (last_error_function == current_function_decl
- && last_error_module == current_module)
- return;
-
- last_error_function = current_function_decl;
- last_error_module = current_module;
-
- if (file)
- fprintf (stderr, "%s: ", file);
-
- if (current_function_decl == global_function_decl
- || current_function_decl == NULL_TREE)
- {
- if (current_module == NULL)
- fprintf (stderr, "At top level:\n");
- else
- fprintf (stderr, "In module %s:\n",
- IDENTIFIER_POINTER (current_module->name));
- }
- else
- {
- const char *kind = "function";
- const char *name = (*decl_printable_name) (current_function_decl, 2);
- fprintf (stderr, "In %s `%s':\n", kind, name);
- }
-}
-
-/* Print an error message for invalid use of an incomplete type.
- VALUE is the expression that was used (or 0 if that isn't known)
- and TYPE is the type that was invalid. */
-
-void
-incomplete_type_error (value, type)
- tree value ATTRIBUTE_UNUSED;
- tree type ATTRIBUTE_UNUSED;
-{
- error ("internal error - use of undefined type");
-}
-
-/* Return the typed-based alias set for T, which may be an expression
- or a type. Return -1 if we don't do anything special. */
-
-HOST_WIDE_INT
-lang_get_alias_set (t)
- tree t ATTRIBUTE_UNUSED;
-{
- /* ??? Need to figure out what the rules are. Certainly we'd need
- to handle union-like things, and probably variant records.
- Until then, turn off type-based aliasing completely. */
- return 0;
-}
-
-void
-lang_init ()
-{
- chill_real_input_filename = input_filename;
-
- /* the beginning of the file is a new line; check for # */
- /* With luck, we discover the real source file's name from that
- and put it in input_filename. */
-
- ungetc (check_newline (), finput);
-
- /* set default grant file */
- set_default_grant_file ();
-
- print_error_function = chill_print_error_function;
-}
diff --git a/gcc/ch/lex.c b/gcc/ch/lex.c
deleted file mode 100644
index 1a87025baae..00000000000
--- a/gcc/ch/lex.c
+++ /dev/null
@@ -1,2234 +0,0 @@
-/* Lexical analyzer for GNU CHILL. -*- C -*-
- Copyright (C) 1992, 1993, 1994, 1998, 1999, 2000, 2001
- Free Software Foundation, Inc.
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-#include "config.h"
-#include "system.h"
-#include <setjmp.h>
-#include <sys/stat.h>
-
-#include "tree.h"
-#include "input.h"
-
-#include "lex.h"
-#include "ch-tree.h"
-#include "flags.h"
-#include "parse.h"
-#include "obstack.h"
-#include "toplev.h"
-#include "tm_p.h"
-
-#ifdef DWARF_DEBUGGING_INFO
-#include "dwarfout.h"
-#endif
-
-#ifdef MULTIBYTE_CHARS
-#include <locale.h>
-#endif
-
-/* include the keyword recognizers */
-#include "hash.h"
-
-FILE* finput;
-
-#if 0
-static int last_token = 0;
-/* Sun's C compiler warns about the safer sequence
- do { .. } while 0
- when there's a 'return' inside the braces, so don't use it */
-#define RETURN_TOKEN(X) { last_token = X; return (X); }
-#endif
-
-/* This is set non-zero to force incoming tokens to lowercase. */
-extern int ignore_case;
-
-extern int module_number;
-extern int serious_errors;
-
-/* This is non-zero to recognize only uppercase special words. */
-extern int special_UC;
-
-extern struct obstack permanent_obstack;
-extern struct obstack temporary_obstack;
-
-/* forward declarations */
-static void close_input_file PARAMS ((const char *));
-static tree convert_bitstring PARAMS ((char *));
-static tree convert_integer PARAMS ((char *));
-static void maybe_downcase PARAMS ((char *));
-static int maybe_number PARAMS ((const char *));
-static tree equal_number PARAMS ((void));
-static void handle_use_seizefile_directive PARAMS ((int));
-static int handle_name PARAMS ((tree));
-static char *readstring PARAMS ((int, int *));
-static void read_directive PARAMS ((void));
-static tree read_identifier PARAMS ((int));
-static tree read_number PARAMS ((int));
-static void skip_c_comment PARAMS ((void));
-static void skip_line_comment PARAMS ((void));
-static int skip_whitespace PARAMS ((void));
-static tree string_or_char PARAMS ((int, const char *));
-static void ch_lex_init PARAMS ((void));
-static void skip_directive PARAMS ((void));
-static int same_file PARAMS ((const char *, const char *));
-static int getlc PARAMS ((FILE *));
-
-/* next variables are public, because ch-actions uses them */
-
-/* the default grantfile name, set by lang_init */
-tree default_grant_file = 0;
-
-/* These tasking-related variables are NULL at the start of each
- compiler pass, and are set to an expression tree if and when
- a compiler directive is parsed containing an expression.
- The NULL state is significant; it means 'no user-specified
- signal_code (or whatever) has been parsed'. */
-
-/* process type, set by <> PROCESS_TYPE = number <> */
-tree process_type = NULL_TREE;
-
-/* send buffer default priority,
- set by <> SEND_BUFFER_DEFAULT_PRIORITY = number <> */
-tree send_buffer_prio = NULL_TREE;
-
-/* send signal default priority,
- set by <> SEND_SIGNAL_DEFAULT_PRIORITY = number <> */
-tree send_signal_prio = NULL_TREE;
-
-/* signal code, set by <> SIGNAL_CODE = number <> */
-tree signal_code = NULL_TREE;
-
-/* flag for range checking */
-int range_checking = 1;
-
-/* flag for NULL pointer checking */
-int empty_checking = 1;
-
-/* flag to indicate making all procedure local variables
- to be STATIC */
-int all_static_flag = 0;
-
-/* flag to indicate -fruntime-checking command line option.
- Needed for initializing range_checking and empty_checking
- before pass 2 */
-int runtime_checking_flag = 1;
-
-/* The elements of `ridpointers' are identifier nodes
- for the reserved type names and storage classes.
- It is indexed by a RID_... value. */
-tree ridpointers[(int) RID_MAX];
-
-/* Nonzero tells yylex to ignore \ in string constants. */
-static int ignore_escape_flag = 0;
-
-static int maxtoken; /* Current nominal length of token buffer. */
-char *token_buffer; /* Pointer to token buffer.
- Actual allocated length is maxtoken + 2.
- This is not static because objc-parse.y uses it. */
-
-/* implement yylineno handling for flex */
-#define yylineno lineno
-
-static int inside_c_comment = 0;
-
-static int saw_eol = 0; /* 1 if we've just seen a '\n' */
-static int saw_eof = 0; /* 1 if we've just seen an EOF */
-
-typedef struct string_list
- {
- struct string_list *next;
- char *str;
- } STRING_LIST;
-
-/* list of paths specified on the compiler command line by -L options. */
-static STRING_LIST *seize_path_list = (STRING_LIST *)0;
-
-/* List of seize file names. Each TREE_VALUE is an identifier
- (file name) from a <>USE_SEIZE_FILE<> directive.
- The TREE_PURPOSE is non-NULL if a USE_SEIZE_FILE directive has been
- written to the grant file. */
-static tree files_to_seize = NULL_TREE;
-/* Last node on files_to_seize list. */
-static tree last_file_to_seize = NULL_TREE;
-/* Pointer into files_to_seize list: Next unparsed file to read. */
-static tree next_file_to_seize = NULL_TREE;
-
-/* The most recent use_seize_file directive. */
-tree use_seizefile_name = NULL_TREE;
-
-/* If non-NULL, the name of the seizefile we're currently processing. */
-tree current_seizefile_name = NULL_TREE;
-
-/* called to reset for pass 2 */
-static void
-ch_lex_init ()
-{
- current_seizefile_name = NULL_TREE;
-
- lineno = 0;
-
- saw_eol = 0;
- saw_eof = 0;
- /* Initialize these compiler-directive variables. */
- process_type = NULL_TREE;
- send_buffer_prio = NULL_TREE;
- send_signal_prio = NULL_TREE;
- signal_code = NULL_TREE;
- all_static_flag = 0;
- /* reinitialize rnage checking and empty checking */
- range_checking = runtime_checking_flag;
- empty_checking = runtime_checking_flag;
-}
-
-
-const char *
-init_parse (filename)
- const char *filename;
-{
- int lowercase_standard_names = ignore_case || ! special_UC;
-
- /* Open input file. */
- if (filename == 0 || !strcmp (filename, "-"))
- {
- finput = stdin;
- filename = "stdin";
- }
- else
- finput = fopen (filename, "r");
-
- if (finput == 0)
- fatal_io_error ("can't open %s", filename);
-
-#ifdef IO_BUFFER_SIZE
- setvbuf (finput, (char *) xmalloc (IO_BUFFER_SIZE), _IOFBF, IO_BUFFER_SIZE);
-#endif
-
- /* Make identifier nodes long enough for the language-specific slots. */
- set_identifier_size (sizeof (struct lang_identifier));
-
- /* Start it at 0, because check_newline is called at the very beginning
- and will increment it to 1. */
- lineno = 0;
-
- /* Initialize these compiler-directive variables. */
- process_type = NULL_TREE;
- send_buffer_prio = NULL_TREE;
- send_signal_prio = NULL_TREE;
- signal_code = NULL_TREE;
-
- maxtoken = 40;
- token_buffer = xmalloc ((unsigned)(maxtoken + 2));
-
- init_chill_expand ();
-
-#define ENTER_STANDARD_NAME(RID, LOWER, UPPER) \
- ridpointers[(int) RID] = \
- get_identifier (lowercase_standard_names ? LOWER : UPPER)
-
- ENTER_STANDARD_NAME (RID_ALL, "all", "ALL");
- ENTER_STANDARD_NAME (RID_ASSERTFAIL, "assertfail", "ASSERTFAIL");
- ENTER_STANDARD_NAME (RID_ASSOCIATION, "association", "ASSOCIATION");
- ENTER_STANDARD_NAME (RID_BIN, "bin", "BIN");
- ENTER_STANDARD_NAME (RID_BOOL, "bool", "BOOL");
- ENTER_STANDARD_NAME (RID_BOOLS, "bools", "BOOLS");
- ENTER_STANDARD_NAME (RID_BYTE, "byte", "BYTE");
- ENTER_STANDARD_NAME (RID_CHAR, "char", "CHAR");
- ENTER_STANDARD_NAME (RID_DOUBLE, "double", "DOUBLE");
- ENTER_STANDARD_NAME (RID_DURATION, "duration", "DURATION");
- ENTER_STANDARD_NAME (RID_DYNAMIC, "dynamic", "DYNAMIC");
- ENTER_STANDARD_NAME (RID_ELSE, "else", "ELSE");
- ENTER_STANDARD_NAME (RID_EMPTY, "empty", "EMPTY");
- ENTER_STANDARD_NAME (RID_FALSE, "false", "FALSE");
- ENTER_STANDARD_NAME (RID_FLOAT, "float", "FLOAT");
- ENTER_STANDARD_NAME (RID_GENERAL, "general", "GENERAL");
- ENTER_STANDARD_NAME (RID_IN, "in", "IN");
- ENTER_STANDARD_NAME (RID_INLINE, "inline", "INLINE");
- ENTER_STANDARD_NAME (RID_INOUT, "inout", "INOUT");
- ENTER_STANDARD_NAME (RID_INSTANCE, "instance", "INSTANCE");
- ENTER_STANDARD_NAME (RID_INT, "int", "INT");
- ENTER_STANDARD_NAME (RID_LOC, "loc", "LOC");
- ENTER_STANDARD_NAME (RID_LONG, "long", "LONG");
- ENTER_STANDARD_NAME (RID_LONG_REAL, "long_real", "LONG_REAL");
- ENTER_STANDARD_NAME (RID_NULL, "null", "NULL");
- ENTER_STANDARD_NAME (RID_OUT, "out", "OUT");
- ENTER_STANDARD_NAME (RID_OVERFLOW, "overflow", "OVERFLOW");
- ENTER_STANDARD_NAME (RID_PTR, "ptr", "PTR");
- ENTER_STANDARD_NAME (RID_READ, "read", "READ");
- ENTER_STANDARD_NAME (RID_REAL, "real", "REAL");
- ENTER_STANDARD_NAME (RID_RANGE, "range", "RANGE");
- ENTER_STANDARD_NAME (RID_RANGEFAIL, "rangefail", "RANGEFAIL");
- ENTER_STANDARD_NAME (RID_RECURSIVE, "recursive", "RECURSIVE");
- ENTER_STANDARD_NAME (RID_SHORT, "short", "SHORT");
- ENTER_STANDARD_NAME (RID_SIMPLE, "simple", "SIMPLE");
- ENTER_STANDARD_NAME (RID_TIME, "time", "TIME");
- ENTER_STANDARD_NAME (RID_TRUE, "true", "TRUE");
- ENTER_STANDARD_NAME (RID_UBYTE, "ubyte", "UBYTE");
- ENTER_STANDARD_NAME (RID_UINT, "uint", "UINT");
- ENTER_STANDARD_NAME (RID_ULONG, "ulong", "ULONG");
- ENTER_STANDARD_NAME (RID_UNSIGNED, "unsigned", "UNSIGNED");
- ENTER_STANDARD_NAME (RID_USHORT, "ushort", "USHORT");
- ENTER_STANDARD_NAME (RID_VOID, "void", "VOID");
-
- return filename;
-}
-
-void
-finish_parse ()
-{
- if (finput != NULL)
- fclose (finput);
-}
-
-static int yywrap PARAMS ((void));
-static int yy_refill PARAMS ((void));
-
-#define YY_PUTBACK_SIZE 5
-#define YY_BUF_SIZE 1000
-
-static char yy_buffer[YY_PUTBACK_SIZE + YY_BUF_SIZE];
-static char *yy_cur = yy_buffer + YY_PUTBACK_SIZE;
-static char *yy_lim = yy_buffer + YY_PUTBACK_SIZE;
-
-static int
-yy_refill ()
-{
- char *buf = yy_buffer + YY_PUTBACK_SIZE;
- int c, result;
- bcopy (yy_cur - YY_PUTBACK_SIZE, yy_buffer, YY_PUTBACK_SIZE);
- yy_cur = buf;
-
- retry:
- if (saw_eof)
- {
- if (yywrap ())
- return EOF;
- saw_eof = 0;
- goto retry;
- }
-
- result = 0;
- while (saw_eol)
- {
- c = check_newline ();
- if (c == EOF)
- {
- saw_eof = 1;
- goto retry;
- }
- else if (c != '\n')
- {
- saw_eol = 0;
- buf[result++] = c;
- }
- }
-
- while (result < YY_BUF_SIZE)
- {
- c = getc(finput);
- if (c == EOF)
- {
- saw_eof = 1;
- break;
- }
- buf[result++] = c;
-
- /* Because we might switch input files on a compiler directive
- (that end with '>', don't read past a '>', just in case. */
- if (c == '>')
- break;
-
- if (c == '\n')
- {
-#ifdef YYDEBUG
- extern int yydebug;
- if (yydebug)
- fprintf (stderr, "-------------------------- finished Line %d\n",
- yylineno);
-#endif
- saw_eol = 1;
- break;
- }
- }
-
- yy_lim = yy_cur + result;
-
- return yy_lim > yy_cur ? *yy_cur++ : EOF;
-}
-
-#define input() (yy_cur < yy_lim ? *yy_cur++ : yy_refill ())
-
-#define unput(c) (*--yy_cur = (c))
-
-
-int starting_pass_2 = 0;
-
-int
-yylex ()
-{
- int nextc;
- int len;
- char* tmp;
- int base;
- int ch;
- retry:
- ch = input ();
- if (starting_pass_2)
- {
- starting_pass_2 = 0;
- unput (ch);
- return END_PASS_1;
- }
- switch (ch)
- {
- case ' ': case '\t': case '\n': case '\f': case '\b': case '\v': case '\r':
- goto retry;
- case '[':
- return LPC;
- case ']':
- return RPC;
- case '{':
- return LC;
- case '}':
- return RC;
- case '(':
- nextc = input ();
- if (nextc == ':')
- return LPC;
- unput (nextc);
- return LPRN;
- case ')':
- return RPRN;
- case ':':
- nextc = input ();
- if (nextc == ')')
- return RPC;
- else if (nextc == '=')
- return ASGN;
- unput (nextc);
- return COLON;
- case ',':
- return COMMA;
- case ';':
- return SC;
- case '+':
- return PLUS;
- case '-':
- nextc = input ();
- if (nextc == '>')
- return ARROW;
- if (nextc == '-')
- {
- skip_line_comment ();
- goto retry;
- }
- unput (nextc);
- return SUB;
- case '*':
- return MUL;
- case '=':
- return EQL;
- case '/':
- nextc = input ();
- if (nextc == '/')
- return CONCAT;
- else if (nextc == '=')
- return NE;
- else if (nextc == '*')
- {
- skip_c_comment ();
- goto retry;
- }
- unput (nextc);
- return DIV;
- case '<':
- nextc = input ();
- if (nextc == '=')
- return LTE;
- if (nextc == '>')
- {
- read_directive ();
- goto retry;
- }
- unput (nextc);
- return LT;
- case '>':
- nextc = input ();
- if (nextc == '=')
- return GTE;
- unput (nextc);
- return GT;
-
- case 'D': case 'd':
- base = 10;
- goto maybe_digits;
- case 'B': case 'b':
- base = 2;
- goto maybe_digits;
- case 'H': case 'h':
- base = 16;
- goto maybe_digits;
- case 'O': case 'o':
- base = 8;
- goto maybe_digits;
- case 'C': case 'c':
- nextc = input ();
- if (nextc == '\'')
- {
- int byte_val = 0;
- char *start;
- int len = 0; /* Number of hex digits seen. */
- for (;;)
- {
- ch = input ();
- if (ch == '\'')
- break;
- if (ch == '_')
- continue;
- if (!ISXDIGIT (ch)) /* error on non-hex digit */
- {
- if (pass == 1)
- error ("invalid C'xx' ");
- break;
- }
- if (ch >= 'a')
- ch -= ' ';
- ch -= '0';
- if (ch > 9)
- ch -= 7;
- byte_val *= 16;
- byte_val += (int)ch;
-
- if (len & 1) /* collected two digits, save byte */
- obstack_1grow (&temporary_obstack, (char) byte_val);
- len++;
- }
- start = obstack_finish (&temporary_obstack);
- yylval.ttype = string_or_char (len >> 1, start);
- obstack_free (&temporary_obstack, start);
- return len == 2 ? SINGLECHAR : STRING;
- }
- unput (nextc);
- goto letter;
-
- maybe_digits:
- nextc = input ();
- if (nextc == '\'')
- {
- char *start;
- obstack_1grow (&temporary_obstack, ch);
- obstack_1grow (&temporary_obstack, nextc);
- for (;;)
- {
- ch = input ();
- if (ISALNUM (ch))
- obstack_1grow (&temporary_obstack, ch);
- else if (ch != '_')
- break;
- }
- obstack_1grow (&temporary_obstack, '\0');
- start = obstack_finish (&temporary_obstack);
- if (ch != '\'')
- {
- unput (ch);
- yylval.ttype = convert_integer (start); /* Pass base? */
- return NUMBER;
- }
- else
- {
- yylval.ttype = convert_bitstring (start);
- return BITSTRING;
- }
- }
- unput (nextc);
- goto letter;
-
- case 'A': case 'E':
- case 'F': case 'G': case 'I': case 'J':
- case 'K': case 'L': case 'M': case 'N':
- case 'P': case 'Q': case 'R': case 'S': case 'T':
- case 'U': case 'V': case 'W': case 'X': case 'Y':
- case 'Z':
- case 'a': case 'e':
- case 'f': case 'g': case 'i': case 'j':
- case 'k': case 'l': case 'm': case 'n':
- case 'p': case 'q': case 'r': case 's': case 't':
- case 'u': case 'v': case 'w': case 'x': case 'y':
- case 'z':
- case '_':
- letter:
- return handle_name (read_identifier (ch));
- case '\'':
- tmp = readstring ('\'', &len);
- yylval.ttype = string_or_char (len, tmp);
- free (tmp);
- return len == 1 ? SINGLECHAR : STRING;
- case '\"':
- tmp = readstring ('\"', &len);
- yylval.ttype = build_chill_string (len, tmp);
- free (tmp);
- return STRING;
- case '.':
- nextc = input ();
- unput (nextc);
- if (ISDIGIT (nextc)) /* || nextc == '_') we don't start numbers with '_' */
- goto number;
- return DOT;
- case '0': case '1': case '2': case '3': case '4':
- case '5': case '6': case '7': case '8': case '9':
- number:
- yylval.ttype = read_number (ch);
- return TREE_CODE (yylval.ttype) == REAL_CST ? FLOATING : NUMBER;
- default:
- return ch;
- }
-}
-
-static void
-close_input_file (fn)
- const char *fn;
-{
- if (finput == NULL)
- abort ();
-
- if (finput != stdin && fclose (finput) == EOF)
- {
- error ("can't close %s", fn);
- abort ();
- }
- finput = NULL;
-}
-
-/* Return an identifier, starting with FIRST and then reading
- more characters using input(). Return an IDENTIFIER_NODE. */
-
-static tree
-read_identifier (first)
- int first; /* First letter of identifier */
-{
- tree id;
- char *start;
- for (;;)
- {
- obstack_1grow (&temporary_obstack, first);
- first = input ();
- if (first == EOF)
- break;
- if (! ISALNUM (first) && first != '_')
- {
- unput (first);
- break;
- }
- }
- obstack_1grow (&temporary_obstack, '\0');
- start = obstack_finish (&temporary_obstack);
- maybe_downcase (start);
- id = get_identifier (start);
- obstack_free (&temporary_obstack, start);
- return id;
-}
-
-/* Given an identifier ID, check to see if it is a reserved name,
- and return the appropriate token type. */
-
-static int
-handle_name (id)
- tree id;
-{
- struct resword *tp;
- tp = in_word_set (IDENTIFIER_POINTER (id), IDENTIFIER_LENGTH (id));
- if (tp != NULL
- && special_UC == ISUPPER ((unsigned char) tp->name[0])
- && (tp->flags == RESERVED || tp->flags == PREDEF))
- {
- if (tp->rid != NORID)
- yylval.ttype = ridpointers[tp->rid];
- else if (tp->token == THIS)
- yylval.ttype = lookup_name (get_identifier ("__whoami"));
- return tp->token;
- }
- yylval.ttype = id;
- return NAME;
-}
-
-static tree
-read_number (ch)
- int ch; /* Initial character */
-{
- tree num;
- char *start;
- int is_float = 0;
- for (;;)
- {
- if (ch != '_')
- obstack_1grow (&temporary_obstack, ch);
- ch = input ();
- if (! ISDIGIT (ch) && ch != '_')
- break;
- }
- if (ch == '.')
- {
- do
- {
- if (ch != '_')
- obstack_1grow (&temporary_obstack, ch);
- ch = input ();
- } while (ISDIGIT (ch) || ch == '_');
- is_float++;
- }
- if (ch == 'd' || ch == 'D' || ch == 'e' || ch == 'E')
- {
- /* Convert exponent indication [eEdD] to 'e'. */
- obstack_1grow (&temporary_obstack, 'e');
- ch = input ();
- if (ch == '+' || ch == '-')
- {
- obstack_1grow (&temporary_obstack, ch);
- ch = input ();
- }
- if (ISDIGIT (ch) || ch == '_')
- {
- do
- {
- if (ch != '_')
- obstack_1grow (&temporary_obstack, ch);
- ch = input ();
- } while (ISDIGIT (ch) || ch == '_');
- }
- else
- {
- error ("malformed exponent part of floating-point literal");
- }
- is_float++;
- }
- if (ch != EOF)
- unput (ch);
- obstack_1grow (&temporary_obstack, '\0');
- start = obstack_finish (&temporary_obstack);
- if (is_float)
- {
- REAL_VALUE_TYPE value;
- tree type = double_type_node;
- errno = 0;
- value = REAL_VALUE_ATOF (start, TYPE_MODE (type));
- obstack_free (&temporary_obstack, start);
- if (TARGET_FLOAT_FORMAT != IEEE_FLOAT_FORMAT
- && REAL_VALUE_ISINF (value) && pedantic)
- pedwarn ("real number exceeds range of REAL");
- num = build_real (type, value);
- }
- else
- num = convert_integer (start);
- CH_DERIVED_FLAG (num) = 1;
- return num;
-}
-
-/* Skip to the end of a compiler directive. */
-
-static void
-skip_directive ()
-{
- int ch = input ();
- for (;;)
- {
- if (ch == EOF)
- {
- error ("end-of-file in '<>' directive");
- break;
- }
- if (ch == '\n')
- break;
- if (ch == '<')
- {
- ch = input ();
- if (ch == '>')
- break;
- }
- ch = input ();
- }
- starting_pass_2 = 0;
-}
-
-/* Read a compiler directive. ("<>{WS}" have already been read. ) */
-static void
-read_directive ()
-{
- struct resword *tp;
- tree id;
- int ch = skip_whitespace();
- if (ISALPHA (ch) || ch == '_')
- id = read_identifier (ch);
- else if (ch == EOF)
- {
- error ("end-of-file in '<>' directive");
- to_global_binding_level ();
- return;
- }
- else
- {
- warning ("unrecognized compiler directive");
- skip_directive ();
- return;
- }
- tp = in_word_set (IDENTIFIER_POINTER (id), IDENTIFIER_LENGTH (id));
- if (tp == NULL || special_UC != ISUPPER ((unsigned char) tp->name[0]))
- {
- if (pass == 1)
- warning ("unrecognized compiler directive `%s'",
- IDENTIFIER_POINTER (id));
- }
- else
- switch (tp->token)
- {
- case ALL_STATIC_OFF:
- all_static_flag = 0;
- break;
- case ALL_STATIC_ON:
- all_static_flag = 1;
- break;
- case EMPTY_OFF:
- empty_checking = 0;
- break;
- case EMPTY_ON:
- empty_checking = 1;
- break;
- case IGNORED_DIRECTIVE:
- break;
- case PROCESS_TYPE_TOKEN:
- process_type = equal_number ();
- break;
- case RANGE_OFF:
- range_checking = 0;
- break;
- case RANGE_ON:
- range_checking = 1;
- break;
- case SEND_SIGNAL_DEFAULT_PRIORITY:
- send_signal_prio = equal_number ();
- break;
- case SEND_BUFFER_DEFAULT_PRIORITY:
- send_buffer_prio = equal_number ();
- break;
- case SIGNAL_CODE:
- signal_code = equal_number ();
- break;
- case USE_SEIZE_FILE:
- handle_use_seizefile_directive (0);
- break;
- case USE_SEIZE_FILE_RESTRICTED:
- handle_use_seizefile_directive (1);
- break;
- default:
- if (pass == 1)
- warning ("unrecognized compiler directive `%s'",
- IDENTIFIER_POINTER (id));
- break;
- }
- skip_directive ();
-}
-
-
-tree
-build_chill_string (len, str)
- int len;
- const char *str;
-{
- tree t;
-
- push_obstacks (&permanent_obstack, &permanent_obstack);
- t = build_string (len, str);
- TREE_TYPE (t) = build_string_type (char_type_node,
- build_int_2 (len, 0));
- CH_DERIVED_FLAG (t) = 1;
- pop_obstacks ();
- return t;
-}
-
-
-static tree
-string_or_char (len, str)
- int len;
- const char *str;
-{
- tree result;
-
- push_obstacks (&permanent_obstack, &permanent_obstack);
- if (len == 1)
- {
- result = build_int_2 ((unsigned char)str[0], 0);
- CH_DERIVED_FLAG (result) = 1;
- TREE_TYPE (result) = char_type_node;
- }
- else
- result = build_chill_string (len, str);
- pop_obstacks ();
- return result;
-}
-
-
-static void
-maybe_downcase (str)
- char *str;
-{
- if (! ignore_case)
- return;
- while (*str)
- {
- *str = TOLOWER (*str);
- str++;
- }
-}
-
-
-static int
-maybe_number (s)
- const char *s;
-{
- char fc;
-
- /* check for decimal number */
- if (*s >= '0' && *s <= '9')
- {
- while (*s)
- {
- if (*s >= '0' && *s <= '9')
- s++;
- else
- return 0;
- }
- return 1;
- }
-
- fc = *s;
- if (s[1] != '\'')
- return 0;
- s += 2;
- while (*s)
- {
- switch (fc)
- {
- case 'd':
- case 'D':
- if (*s < '0' || *s > '9')
- return 0;
- break;
- case 'h':
- case 'H':
- if (!ISXDIGIT ((unsigned char) *s))
- return 0;
- break;
- case 'b':
- case 'B':
- if (*s < '0' || *s > '1')
- return 0;
- break;
- case 'o':
- case 'O':
- if (*s < '0' || *s > '7')
- return 0;
- break;
- default:
- return 0;
- }
- s++;
- }
- return 1;
-}
-
-static char *
-readstring (terminator, len)
- char terminator;
- int *len;
-{
- int c;
- unsigned allocated = 1024;
- char *tmp = xmalloc (allocated);
- unsigned i = 0;
-
- for (;;)
- {
- c = input ();
- if (c == terminator)
- {
- if ((c = input ()) != terminator)
- {
- unput (c);
- break;
- }
- else
- c = terminator;
- }
- if (c == '\n' || c == EOF)
- goto unterminated;
- if (c == '^')
- {
- c = input();
- if (c == EOF || c == '\n')
- goto unterminated;
- if (c == '^')
- goto storeit;
- if (c == '(')
- {
- int cc, count = 0;
- int base = 10;
- int next_apos = 0;
- int check_base = 1;
- c = 0;
- while (1)
- {
- cc = input ();
- if (cc == terminator)
- {
- if (!(terminator == '\'' && next_apos))
- {
- error ("unterminated control sequence");
- serious_errors++;
- goto done;
- }
- }
- if (cc == EOF || cc == '\n')
- {
- c = cc;
- goto unterminated;
- }
- if (next_apos)
- {
- next_apos = 0;
- if (cc != '\'')
- {
- error ("invalid integer literal in control sequence");
- serious_errors++;
- goto done;
- }
- continue;
- }
- if (cc == ' ' || cc == '\t')
- continue;
- if (cc == ')')
- {
- if ((c < 0 || c > 255) && (pass == 1))
- error ("control sequence overflow");
- if (! count && pass == 1)
- error ("invalid control sequence");
- break;
- }
- else if (cc == ',')
- {
- if ((c < 0 || c > 255) && (pass == 1))
- error ("control sequence overflow");
- if (! count && pass == 1)
- error ("invalid control sequence");
- tmp[i++] = c;
- if (i == allocated)
- {
- allocated += 1024;
- tmp = xrealloc (tmp, allocated);
- }
- c = count = 0;
- base = 10;
- check_base = 1;
- continue;
- }
- else if (cc == '_')
- {
- if (! count && pass == 1)
- error ("invalid integer literal in control sequence");
- continue;
- }
- if (check_base)
- {
- if (cc == 'D' || cc == 'd')
- {
- base = 10;
- next_apos = 1;
- }
- else if (cc == 'H' || cc == 'h')
- {
- base = 16;
- next_apos = 1;
- }
- else if (cc == 'O' || cc == 'o')
- {
- base = 8;
- next_apos = 1;
- }
- else if (cc == 'B' || cc == 'b')
- {
- base = 2;
- next_apos = 1;
- }
- check_base = 0;
- if (next_apos)
- continue;
- }
- if (base == 2)
- {
- if (cc < '0' || cc > '1')
- cc = -1;
- else
- cc -= '0';
- }
- else if (base == 8)
- {
- if (cc < '0' || cc > '8')
- cc = -1;
- else
- cc -= '0';
- }
- else if (base == 10)
- {
- if (! ISDIGIT (cc))
- cc = -1;
- else
- cc -= '0';
- }
- else if (base == 16)
- {
- if (!ISXDIGIT (cc))
- cc = -1;
- else
- {
- if (cc >= 'a')
- cc -= ' ';
- cc -= '0';
- if (cc > 9)
- cc -= 7;
- }
- }
- else
- {
- error ("invalid base in read control sequence");
- abort ();
- }
- if (cc == -1)
- {
- /* error in control sequence */
- if (pass == 1)
- error ("invalid digit in control sequence");
- cc = 0;
- }
- c = (c * base) + cc;
- count++;
- }
- }
- else
- c ^= 64;
- }
- storeit:
- tmp[i++] = c;
- if (i == allocated)
- {
- allocated += 1024;
- tmp = xrealloc (tmp, allocated);
- }
- }
- done:
- tmp [*len = i] = '\0';
- return tmp;
-
-unterminated:
- if (c == '\n')
- unput ('\n');
- *len = 1;
- if (pass == 1)
- error ("unterminated string literal");
- to_global_binding_level ();
- tmp[0] = '\0';
- return tmp;
-}
-
-/* Convert an integer INTCHARS into an INTEGER_CST.
- INTCHARS is on the temporary_obstack, and is popped by this function. */
-
-static tree
-convert_integer (intchars)
- char *intchars;
-{
-#ifdef YYDEBUG
- extern int yydebug;
-#endif
- char *p = intchars;
- char *oldp = p;
- int base = 10, tmp;
- int valid_chars = 0;
- int overflow = 0;
- tree type;
- HOST_WIDE_INT val_lo = 0, val_hi = 0;
- tree val;
-
- /* determine the base */
- switch (*p)
- {
- case 'd':
- case 'D':
- p += 2;
- break;
- case 'o':
- case 'O':
- p += 2;
- base = 8;
- break;
- case 'h':
- case 'H':
- p += 2;
- base = 16;
- break;
- case 'b':
- case 'B':
- p += 2;
- base = 2;
- break;
- default:
- if (!ISDIGIT (*p)) /* this test is for equal_number () */
- {
- obstack_free (&temporary_obstack, intchars);
- return 0;
- }
- break;
- }
-
- while (*p)
- {
- tmp = *p++;
- if ((tmp == '\'') || (tmp == '_'))
- continue;
- if (tmp < '0')
- goto bad_char;
- if (tmp >= 'a') /* uppercase the char */
- tmp -= ' ';
- switch (base) /* validate the characters */
- {
- case 2:
- if (tmp > '1')
- goto bad_char;
- break;
- case 8:
- if (tmp > '7')
- goto bad_char;
- break;
- case 10:
- if (tmp > '9')
- goto bad_char;
- break;
- case 16:
- if (tmp > 'F')
- goto bad_char;
- if (tmp > '9' && tmp < 'A')
- goto bad_char;
- break;
- default:
- abort ();
- }
- tmp -= '0';
- if (tmp > 9)
- tmp -= 7;
- if (mul_double (val_lo, val_hi, base, 0, &val_lo, &val_hi))
- overflow++;
- add_double (val_lo, val_hi, tmp, 0, &val_lo, &val_hi);
- if (val_hi < 0)
- overflow++;
- valid_chars++;
- }
- bad_char:
- obstack_free (&temporary_obstack, intchars);
- if (!valid_chars)
- {
- if (pass == 2)
- error ("invalid number format `%s'", oldp);
- return 0;
- }
- val = build_int_2 (val_lo, val_hi);
- /* We set the type to long long (or long long unsigned) so that
- constant fold of literals is less likely to overflow. */
- if (int_fits_type_p (val, long_long_integer_type_node))
- type = long_long_integer_type_node;
- else
- {
- if (! int_fits_type_p (val, long_long_unsigned_type_node))
- overflow++;
- type = long_long_unsigned_type_node;
- }
- TREE_TYPE (val) = type;
- CH_DERIVED_FLAG (val) = 1;
-
- if (overflow)
- error ("integer literal too big");
-
- return val;
-}
-
-/* Convert a bitstring literal on the temporary_obstack to
- a bitstring CONSTRUCTOR. Free the literal from the obstack. */
-
-static tree
-convert_bitstring (p)
- char *p;
-{
-#ifdef YYDEBUG
- extern int yydebug;
-#endif
- int bl = 0, valid_chars = 0, bits_per_char = 0, c, k;
- tree initlist = NULL_TREE;
- tree val;
-
- /* Move p to stack so we can re-use temporary_obstack for result. */
- char *oldp = (char*) alloca (strlen (p) + 1);
- strcpy (oldp, p);
- obstack_free (&temporary_obstack, p);
- p = oldp;
-
- switch (*p)
- {
- case 'h':
- case 'H':
- bits_per_char = 4;
- break;
- case 'o':
- case 'O':
- bits_per_char = 3;
- break;
- case 'b':
- case 'B':
- bits_per_char = 1;
- break;
- }
- p += 2;
-
- while (*p)
- {
- c = *p++;
- if (c == '_' || c == '\'')
- continue;
- if (c >= 'a')
- c -= ' ';
- c -= '0';
- if (c > 9)
- c -= 7;
- valid_chars++;
-
- for (k = BYTES_BIG_ENDIAN ? bits_per_char - 1 : 0;
- BYTES_BIG_ENDIAN ? k >= 0 : k < bits_per_char;
- bl++, BYTES_BIG_ENDIAN ? k-- : k++)
- {
- if (c & (1 << k))
- initlist = tree_cons (NULL_TREE, build_int_2 (bl, 0), initlist);
- }
- }
-#if 0
- /* as long as BOOLS(0) is valid it must tbe possible to
- specify an empty bitstring */
- if (!valid_chars)
- {
- if (pass == 2)
- error ("invalid number format `%s'", oldp);
- return 0;
- }
-#endif
- val = build (CONSTRUCTOR,
- build_bitstring_type (size_int (bl)),
- NULL_TREE, nreverse (initlist));
- TREE_CONSTANT (val) = 1;
- CH_DERIVED_FLAG (val) = 1;
- return val;
-}
-
-/* Check if two filenames name the same file.
- This is done by stat'ing both files and comparing their inodes.
-
- Note: we have to take care of seize_path_list. Therefore do it the same
- way as in yywrap. FIXME: This probably can be done better. */
-
-static int
-same_file (filename1, filename2)
- const char *filename1;
- const char *filename2;
-{
- struct stat s[2];
- const char *fn_input[2];
- int i, stat_status;
-
- if (grant_only_flag)
- /* do nothing in this case */
- return 0;
-
- /* if filenames are equal -- return 1, cause there is no need
- to search in the include list in this case */
- if (strcmp (filename1, filename2) == 0)
- return 1;
-
- fn_input[0] = filename1;
- fn_input[1] = filename2;
-
- for (i = 0; i < 2; i++)
- {
- stat_status = stat (fn_input[i], &s[i]);
- if (stat_status < 0
- && strchr (fn_input[i], '/') == 0)
- {
- STRING_LIST *plp;
- char *path;
-
- for (plp = seize_path_list; plp != 0; plp = plp->next)
- {
- path = (char *) xmalloc (strlen (fn_input[i])
- + strlen (plp->str) + 2);
- sprintf (path, "%s/%s", plp->str, fn_input[i]);
- stat_status = stat (path, &s[i]);
- free (path);
- if (stat_status >= 0)
- break;
- }
- }
-
- if (stat_status < 0)
- fatal_io_error ("can't find %s", fn_input[i]);
- }
- return s[0].st_ino == s[1].st_ino && s[0].st_dev == s[1].st_dev;
-}
-
-/*
- * Note that simply appending included file names to a list in this
- * way completely eliminates the need for nested files, and the
- * associated book-keeping, since the EOF processing in the lexer
- * will simply process the files one at a time, in the order that the
- * USE_SEIZE_FILE directives were scanned.
- */
-static void
-handle_use_seizefile_directive (restricted)
- int restricted;
-{
- tree seen;
- int len;
- int c = skip_whitespace ();
- char *use_seizefile_str = readstring (c, &len);
-
- if (pass > 1)
- return;
-
- if (c != '\'' && c != '\"')
- {
- error ("USE_SEIZE_FILE directive must be followed by string");
- return;
- }
-
- use_seizefile_name = get_identifier (use_seizefile_str);
- CH_USE_SEIZEFILE_RESTRICTED (use_seizefile_name) = restricted;
-
- if (!grant_only_flag)
- {
- /* If file foo.ch contains a <> use_seize_file "bar.grt" <>,
- and file bar.ch contains a <> use_seize_file "foo.grt" <>,
- then if we're compiling foo.ch, we will indirectly be
- asked to seize foo.grt. Don't. */
- extern char *grant_file_name;
- if (strcmp (use_seizefile_str, grant_file_name) == 0)
- return;
-
- /* Check if the file is already on the list. */
- for (seen = files_to_seize; seen != NULL_TREE; seen = TREE_CHAIN (seen))
- if (same_file (IDENTIFIER_POINTER (TREE_VALUE (seen)),
- use_seizefile_str))
- return; /* Previously seen; nothing to do. */
- }
-
- /* Haven't been asked to seize this file yet, so add
- its name to the list. */
- {
- tree pl = perm_tree_cons (0, use_seizefile_name, NULL_TREE);
- if (files_to_seize == NULL_TREE)
- files_to_seize = pl;
- else
- TREE_CHAIN (last_file_to_seize) = pl;
- if (next_file_to_seize == NULL_TREE)
- next_file_to_seize = pl;
- last_file_to_seize = pl;
- }
-}
-
-
-/*
- * get input, convert to lower case for comparison
- */
-static int
-getlc (file)
- FILE *file;
-{
- register int c;
-
- c = getc (file);
- if (ignore_case)
- c = TOLOWER (c);
- return c;
-}
-
-#if defined HANDLE_PRAGMA
-/* Local versions of these macros, that can be passed as function pointers. */
-static int
-pragma_getc ()
-{
- return getc (finput);
-}
-
-static void
-pragma_ungetc (arg)
- int arg;
-{
- ungetc (arg, finput);
-}
-#endif /* HANDLE_PRAGMA */
-
-#ifdef HANDLE_GENERIC_PRAGMAS
-/* Handle a generic #pragma directive.
- BUFFER contains the text we read after `#pragma'. Processes the entire input
- line and return non-zero iff the pragma was successfully processed. */
-
-static int
-handle_generic_pragma (buffer)
- char * buffer;
-{
- register int c;
-
- for (;;)
- {
- char * buff;
-
- handle_pragma_token (buffer, NULL);
-
- c = getc (finput);
-
- while (c == ' ' || c == '\t')
- c = getc (finput);
- ungetc (c, finput);
-
- if (c == '\n' || c == EOF)
- return handle_pragma_token (NULL, NULL);
-
- /* Read the next word of the pragma into the buffer. */
- buff = buffer;
- do
- {
- * buff ++ = c;
- c = getc (finput);
- }
- while (c != EOF && ! ISSPACE (c) && buff < buffer + 128);
- /* XXX shared knowledge about size of buffer. */
-
- ungetc (c, finput);
-
- * -- buff = 0;
- }
-}
-#endif /* HANDLE_GENERIC_PRAGMAS */
-
-/* At the beginning of a line, increment the line number and process
- any #-directive on this line. If the line is a #-directive, read
- the entire line and return a newline. Otherwise, return the line's
- first non-whitespace character.
-
- (Each language front end has a check_newline() function that is called
- from lang_init() for that language. One of the things this function
- must do is read the first line of the input file, and if it is a #line
- directive, extract the filename from it and use it to initialize
- main_input_filename. Proper generation of debugging information in
- the normal "front end calls cpp then calls cc1XXXX environment" depends
- upon this being done.) */
-
-int
-check_newline ()
-{
- register int c;
-
- lineno++;
-
- /* Read first nonwhite char on the line. */
-
- c = getc (finput);
-
- while (c == ' ' || c == '\t')
- c = getc (finput);
-
- if (c != '#' || inside_c_comment)
- {
- /* If not #, return it so caller will use it. */
- return c;
- }
-
- /* Read first nonwhite char after the `#'. */
-
- c = getc (finput);
- while (c == ' ' || c == '\t')
- c = getc (finput);
-
- /* If a letter follows, then if the word here is `line', skip
- it and ignore it; otherwise, ignore the line, with an error
- if the word isn't `pragma', `ident', `define', or `undef'. */
-
- if (ignore_case)
- c = TOLOWER (c);
-
- if (c >= 'a' && c <= 'z')
- {
- if (c == 'p')
- {
- if (getlc (finput) == 'r'
- && getlc (finput) == 'a'
- && getlc (finput) == 'g'
- && getlc (finput) == 'm'
- && getlc (finput) == 'a'
- && (c = getlc (finput), ISSPACE (c)))
- {
-#ifdef HANDLE_PRAGMA
- static char buffer [128];
- char * buff = buffer;
-
- /* Read the pragma name into a buffer. */
- while (c = getlc (finput), ISSPACE (c))
- continue;
-
- do
- {
- * buff ++ = c;
- c = getlc (finput);
- }
- while (c != EOF && ! ISSPACE (c) && c != '\n'
- && buff < buffer + 128);
-
- pragma_ungetc (c);
-
- * -- buff = 0;
-
- if (HANDLE_PRAGMA (pragma_getc, pragma_ungetc, buffer))
- goto skipline;
-#endif /* HANDLE_PRAGMA */
-
-#ifdef HANDLE_GENERIC_PRAGMAS
- if (handle_generic_pragma (buffer))
- goto skipline;
-#endif /* HANDLE_GENERIC_PRAGMAS */
-
- goto skipline;
- }
- }
-
- else if (c == 'd')
- {
- if (getlc (finput) == 'e'
- && getlc (finput) == 'f'
- && getlc (finput) == 'i'
- && getlc (finput) == 'n'
- && getlc (finput) == 'e'
- && (c = getlc (finput), ISSPACE (c)))
- {
-#if 0 /*def DWARF_DEBUGGING_INFO*/
- if (c != '\n'
- && (debug_info_level == DINFO_LEVEL_VERBOSE)
- && (write_symbols == DWARF_DEBUG))
- dwarfout_define (lineno, get_directive_line (finput));
-#endif /* DWARF_DEBUGGING_INFO */
- goto skipline;
- }
- }
- else if (c == 'u')
- {
- if (getlc (finput) == 'n'
- && getlc (finput) == 'd'
- && getlc (finput) == 'e'
- && getlc (finput) == 'f'
- && (c = getlc (finput), ISSPACE (c)))
- {
-#if 0 /*def DWARF_DEBUGGING_INFO*/
- if (c != '\n'
- && (debug_info_level == DINFO_LEVEL_VERBOSE)
- && (write_symbols == DWARF_DEBUG))
- dwarfout_undef (lineno, get_directive_line (finput));
-#endif /* DWARF_DEBUGGING_INFO */
- goto skipline;
- }
- }
- else if (c == 'l')
- {
- if (getlc (finput) == 'i'
- && getlc (finput) == 'n'
- && getlc (finput) == 'e'
- && ((c = getlc (finput)) == ' ' || c == '\t'))
- goto linenum;
- }
-#if 0
- else if (c == 'i')
- {
- if (getlc (finput) == 'd'
- && getlc (finput) == 'e'
- && getlc (finput) == 'n'
- && getlc (finput) == 't'
- && ((c = getlc (finput)) == ' ' || c == '\t'))
- {
- /* #ident. The pedantic warning is now in cpp. */
-
- /* Here we have just seen `#ident '.
- A string constant should follow. */
-
- while (c == ' ' || c == '\t')
- c = getlc (finput);
-
- /* If no argument, ignore the line. */
- if (c == '\n')
- return c;
-
- ungetc (c, finput);
- token = yylex ();
- if (token != STRING
- || TREE_CODE (yylval.ttype) != STRING_CST)
- {
- error ("invalid #ident");
- goto skipline;
- }
-
- if (!flag_no_ident)
- {
-#ifdef ASM_OUTPUT_IDENT
- extern FILE *asm_out_file;
- ASM_OUTPUT_IDENT (asm_out_file, TREE_STRING_POINTER (yylval.ttype));
-#endif
- }
-
- /* Skip the rest of this line. */
- goto skipline;
- }
- }
-#endif
-
- error ("undefined or invalid # directive");
- goto skipline;
- }
-
-linenum:
- /* Here we have either `#line' or `# <nonletter>'.
- In either case, it should be a line number; a digit should follow. */
-
- while (c == ' ' || c == '\t')
- c = getlc (finput);
-
- /* If the # is the only nonwhite char on the line,
- just ignore it. Check the new newline. */
- if (c == '\n')
- return c;
-
- /* Something follows the #; read a token. */
-
- if (ISDIGIT(c))
- {
- int old_lineno = lineno;
- int used_up = 0;
- int l = 0;
- extern struct obstack permanent_obstack;
-
- do
- {
- l = l * 10 + (c - '0'); /* FIXME Not portable */
- c = getlc(finput);
- } while (ISDIGIT(c));
- /* subtract one, because it is the following line that
- gets the specified number */
-
- l--;
-
- /* Is this the last nonwhite stuff on the line? */
- c = getlc (finput);
- while (c == ' ' || c == '\t')
- c = getlc (finput);
- if (c == '\n')
- {
- /* No more: store the line number and check following line. */
- lineno = l;
- return c;
- }
-
- /* More follows: it must be a string constant (filename). */
-
- /* Read the string constant, but don't treat \ as special. */
- ignore_escape_flag = 1;
- ignore_escape_flag = 0;
-
- if (c != '\"')
- {
- error ("invalid #line");
- goto skipline;
- }
-
- for (;;)
- {
- c = getc (finput);
- if (c == EOF || c == '\n')
- {
- error ("invalid #line");
- return c;
- }
- if (c == '\"')
- {
- obstack_1grow(&permanent_obstack, 0);
- input_filename = obstack_finish (&permanent_obstack);
- break;
- }
- obstack_1grow(&permanent_obstack, c);
- }
-
- lineno = l;
-
- /* Each change of file name
- reinitializes whether we are now in a system header. */
- in_system_header = 0;
-
- if (main_input_filename == 0)
- main_input_filename = input_filename;
-
- /* Is this the last nonwhite stuff on the line? */
- c = getlc (finput);
- while (c == ' ' || c == '\t')
- c = getlc (finput);
- if (c == '\n')
- return c;
-
- used_up = 0;
-
- /* `1' after file name means entering new file.
- `2' after file name means just left a file. */
-
- if (ISDIGIT (c))
- {
- if (c == '1')
- {
- /* Pushing to a new file. */
- struct file_stack *p
- = (struct file_stack *) xmalloc (sizeof (struct file_stack));
- input_file_stack->line = old_lineno;
- p->next = input_file_stack;
- p->name = input_filename;
- input_file_stack = p;
- input_file_stack_tick++;
-#ifdef DWARF_DEBUGGING_INFO
- if (debug_info_level == DINFO_LEVEL_VERBOSE
- && write_symbols == DWARF_DEBUG)
- dwarfout_start_new_source_file (input_filename);
-#endif /* DWARF_DEBUGGING_INFO */
-
- used_up = 1;
- }
- else if (c == '2')
- {
- /* Popping out of a file. */
- if (input_file_stack->next)
- {
- struct file_stack *p = input_file_stack;
- input_file_stack = p->next;
- free (p);
- input_file_stack_tick++;
-#ifdef DWARF_DEBUGGING_INFO
- if (debug_info_level == DINFO_LEVEL_VERBOSE
- && write_symbols == DWARF_DEBUG)
- dwarfout_resume_previous_source_file (input_file_stack->line);
-#endif /* DWARF_DEBUGGING_INFO */
- }
- else
- error ("#-lines for entering and leaving files don't match");
-
- used_up = 1;
- }
- }
-
- /* If we have handled a `1' or a `2',
- see if there is another number to read. */
- if (used_up)
- {
- /* Is this the last nonwhite stuff on the line? */
- c = getlc (finput);
- while (c == ' ' || c == '\t')
- c = getlc (finput);
- if (c == '\n')
- return c;
- used_up = 0;
- }
-
- /* `3' after file name means this is a system header file. */
-
- if (c == '3')
- in_system_header = 1;
- }
- else
- error ("invalid #-line");
-
- /* skip the rest of this line. */
- skipline:
- while (c != '\n' && c != EOF)
- c = getc (finput);
- return c;
-}
-
-
-tree
-get_chill_filename ()
-{
- return (build_chill_string (
- strlen (input_filename) + 1, /* +1 to get a zero terminated string */
- input_filename));
-}
-
-tree
-get_chill_linenumber ()
-{
- return build_int_2 ((HOST_WIDE_INT)lineno, 0);
-}
-
-
-/* Assuming '/' and '*' have been read, skip until we've
- read the terminating '*' and '/'. */
-
-static void
-skip_c_comment ()
-{
- int c = input();
- int start_line = lineno;
-
- inside_c_comment++;
- for (;;)
- if (c == EOF)
- {
- error_with_file_and_line (input_filename, start_line,
- "unterminated comment");
- break;
- }
- else if (c != '*')
- c = input();
- else if ((c = input ()) == '/')
- break;
- inside_c_comment--;
-}
-
-
-/* Assuming "--" has been read, skip until '\n'. */
-
-static void
-skip_line_comment ()
-{
- for (;;)
- {
- int c = input ();
-
- if (c == EOF)
- return;
- if (c == '\n')
- break;
- }
- unput ('\n');
-}
-
-
-static int
-skip_whitespace ()
-{
- for (;;)
- {
- int c = input ();
-
- if (c == EOF)
- return c;
- if (c == ' ' || c == '\t' || c == '\r' || c == '\n' || c == '\v')
- continue;
- if (c == '/')
- {
- c = input ();
- if (c == '*')
- {
- skip_c_comment ();
- continue;
- }
- else
- {
- unput (c);
- return '/';
- }
- }
- if (c == '-')
- {
- c = input ();
- if (c == '-')
- {
- skip_line_comment ();
- continue;
- }
- else
- {
- unput (c);
- return '-';
- }
- }
- return c;
- }
-}
-
-/*
- * avoid recursive calls to yylex to parse the ' = digits' or
- * ' = SYNvalue' which are supposed to follow certain compiler
- * directives. Read the input stream, and return the value parsed.
- */
- /* FIXME: overflow check in here */
- /* FIXME: check for EOF around here */
-static tree
-equal_number ()
-{
- int c, result;
- char *tokenbuf;
- char *cursor;
- tree retval = integer_zero_node;
-
- c = skip_whitespace();
- if ((char)c != '=')
- {
- if (pass == 2)
- error ("missing `=' in compiler directive");
- return integer_zero_node;
- }
- c = skip_whitespace();
-
- /* collect token into tokenbuf for later analysis */
- while (TRUE)
- {
- if (ISSPACE (c) || c == '<')
- break;
- obstack_1grow (&temporary_obstack, c);
- c = input ();
- }
- unput (c); /* put uninteresting char back */
- obstack_1grow (&temporary_obstack, '\0'); /* terminate token */
- tokenbuf = obstack_finish (&temporary_obstack);
- maybe_downcase (tokenbuf);
-
- if (*tokenbuf == '-')
- /* will fail in the next test */
- result = BITSTRING;
- else if (maybe_number (tokenbuf))
- {
- if (pass == 1)
- return integer_zero_node;
- push_obstacks_nochange ();
- end_temporary_allocation ();
- yylval.ttype = convert_integer (tokenbuf);
- tokenbuf = 0; /* Was freed by convert_integer. */
- result = yylval.ttype ? NUMBER : 0;
- pop_obstacks ();
- }
- else
- result = 0;
-
- if (result == NUMBER)
- {
- retval = yylval.ttype;
- }
- else if (result == BITSTRING)
- {
- if (pass == 1)
- error ("invalid value follows `=' in compiler directive");
- goto finish;
- }
- else /* not a number */
- {
- cursor = tokenbuf;
- c = *cursor;
- if (!ISALPHA (c) && c != '_')
- {
- if (pass == 1)
- error ("invalid value follows `=' in compiler directive");
- goto finish;
- }
-
- for (cursor = &tokenbuf[1]; *cursor != '\0'; cursor++)
- if (ISALPHA ((unsigned char) *cursor) || *cursor == '_' ||
- ISDIGIT (*cursor))
- continue;
- else
- {
- if (pass == 1)
- error ("invalid `%c' character in name", *cursor);
- goto finish;
- }
- if (pass == 1)
- goto finish;
- else
- {
- tree value = lookup_name (get_identifier (tokenbuf));
- if (value == NULL_TREE
- || TREE_CODE (value) != CONST_DECL
- || TREE_CODE (DECL_INITIAL (value)) != INTEGER_CST)
- {
- if (pass == 2)
- error ("`%s' not integer constant synonym ",
- tokenbuf);
- goto finish;
- }
- obstack_free (&temporary_obstack, tokenbuf);
- tokenbuf = 0;
- push_obstacks_nochange ();
- end_temporary_allocation ();
- retval = convert (chill_taskingcode_type_node, DECL_INITIAL (value));
- pop_obstacks ();
- }
- }
-
- /* check the value */
- if (TREE_CODE (retval) != INTEGER_CST)
- {
- if (pass == 2)
- error ("invalid value follows `=' in compiler directive");
- }
- else if (TREE_INT_CST_HIGH (retval) != 0 ||
- TREE_INT_CST_LOW (retval) > TREE_INT_CST_LOW (TYPE_MAX_VALUE (chill_unsigned_type_node)))
- {
- if (pass == 2)
- error ("value out of range in compiler directive");
- }
- finish:
- if (tokenbuf)
- obstack_free (&temporary_obstack, tokenbuf);
- return retval;
-}
-
-/*
- * add a possible grant-file path to the list
- */
-void
-register_seize_path (path)
- const char *path;
-{
- int pathlen = strlen (path);
- char *new_path = (char *)xmalloc (pathlen + 1);
- STRING_LIST *pl = (STRING_LIST *)xmalloc (sizeof (STRING_LIST));
-
- /* strip off trailing slash if any */
- if (path[pathlen - 1] == '/')
- pathlen--;
-
- memcpy (new_path, path, pathlen);
- pl->str = new_path;
- pl->next = seize_path_list;
- seize_path_list = pl;
-}
-
-
-/* Used by decode_decl to indicate that a <> use_seize_file NAME <>
- directive has been written to the grantfile. */
-
-void
-mark_use_seizefile_written (name)
- tree name;
-{
- tree node;
-
- for (node = files_to_seize; node != NULL_TREE; node = TREE_CHAIN (node))
- if (TREE_VALUE (node) == name)
- {
- TREE_PURPOSE (node) = integer_one_node;
- break;
- }
-}
-
-
-static int
-yywrap ()
-{
- extern char *chill_real_input_filename;
-
- close_input_file (input_filename);
-
- use_seizefile_name = NULL_TREE;
-
- if (next_file_to_seize && !grant_only_flag)
- {
- FILE *grt_in = NULL;
- const char *seizefile_name_chars
- = IDENTIFIER_POINTER (TREE_VALUE (next_file_to_seize));
-
- /* find a seize file, open it. If it's not at the path the
- * user gave us, and that path contains no slashes, look on
- * the seize_file paths, specified by the '-I' options.
- */
- grt_in = fopen (seizefile_name_chars, "r");
- if (grt_in == NULL
- && strchr (seizefile_name_chars, '/') == NULL)
- {
- STRING_LIST *plp;
- char *path;
-
- for (plp = seize_path_list; plp != NULL; plp = plp->next)
- {
- path = (char *)xmalloc (strlen (seizefile_name_chars)
- + strlen (plp->str) + 2);
-
- sprintf (path, "%s/%s", plp->str, seizefile_name_chars);
- grt_in = fopen (path, "r");
- if (grt_in == NULL)
- free (path);
- else
- {
- seizefile_name_chars = path;
- break;
- }
- }
- }
-
- if (grt_in == NULL)
- fatal_io_error ("can't open %s", seizefile_name_chars);
-
- finput = grt_in;
- input_filename = seizefile_name_chars;
-
- lineno = 0;
- current_seizefile_name = TREE_VALUE (next_file_to_seize);
-
- next_file_to_seize = TREE_CHAIN (next_file_to_seize);
-
- saw_eof = 0;
- return 0;
- }
-
- if (pass == 1)
- {
- next_file_to_seize = files_to_seize;
- current_seizefile_name = NULL_TREE;
-
- if (strcmp (main_input_filename, "stdin"))
- finput = fopen (chill_real_input_filename, "r");
- else
- finput = stdin;
- if (finput == NULL)
- {
- error ("can't reopen %s", chill_real_input_filename);
- return 1;
- }
- input_filename = main_input_filename;
- ch_lex_init ();
- lineno = 0;
- /* Read a line directive if there is one. */
- ungetc (check_newline (), finput);
- starting_pass_2 = 1;
- saw_eof = 0;
- if (module_number == 0)
- warning ("no modules seen");
- return 0;
- }
- return 1;
-}
diff --git a/gcc/ch/lex.h b/gcc/ch/lex.h
deleted file mode 100644
index 4bf748c7da6..00000000000
--- a/gcc/ch/lex.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/* Define constants for communication with the CHILL parser.
- Copyright (C) 1992, 1993, 1994, 1995, 1996, 1999, 2000
- Free Software Foundation, Inc.
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-
-
-enum rid
-{
- RID_UNUSED, /* keep this one first, please */
- RID_ALL,
- RID_ASSERTFAIL,
- RID_ASSOCIATION,
- RID_BIN,
- RID_BIT,
- RID_BOOL,
- RID_BOOLS,
- RID_BYTE,
- RID_CHAR,
- RID_CHARS,
- RID_DOUBLE,
- RID_DURATION,
- RID_DYNAMIC,
- RID_ELSE,
- RID_EMPTY,
- RID_FALSE,
- RID_FLOAT,
- RID_GENERAL,
- RID_IN,
- RID_INLINE,
- RID_INOUT,
- RID_INSTANCE,
- RID_INT,
- RID_LOC,
- RID_LONG,
- RID_LONG_REAL,
- RID_NULL,
- RID_OUT,
- RID_OVERFLOW,
- RID_PTR,
- RID_RANGE,
- RID_RANGEFAIL,
- RID_READ,
- RID_REAL,
- RID_RECURSIVE,
- RID_SHORT,
- RID_SIMPLE,
- RID_TIME,
- RID_TRUE,
- RID_UBYTE,
- RID_UINT,
- RID_ULONG,
- RID_UNSIGNED,
- RID_USHORT,
- RID_VOID,
- RID_MAX /* Last element */
-};
-
-#define NORID RID_UNUSED
-
-#define RID_FIRST_MODIFIER RID_UNSIGNED
-
-/* The elements of `ridpointers' are identifier nodes
- for the reserved type names and storage classes.
- It is indexed by a RID_... value. */
-extern tree ridpointers[(int) RID_MAX];
-
-extern char *token_buffer; /* Pointer to token buffer. */
-
-extern tree make_pointer_declarator PARAMS ((tree, tree));
-extern void reinit_parse_for_function PARAMS ((void));
-extern int yylex PARAMS ((void));
-
-extern tree default_grant_file;
-extern tree current_grant_file;
-
-extern tree current_seize_file;
-
-extern int chill_at_module_level;
-extern tree chill_initializer_name;
-
-extern void prepare_paren_colon PARAMS ((void));
diff --git a/gcc/ch/loop.c b/gcc/ch/loop.c
deleted file mode 100644
index d42c65f8077..00000000000
--- a/gcc/ch/loop.c
+++ /dev/null
@@ -1,1234 +0,0 @@
-/* Implement looping actions for CHILL.
- Copyright (C) 1992, 1993, 1994, 1998, 1999, 2000
- Free Software Foundation, Inc.
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-#include "config.h"
-#include "system.h"
-#include "tree.h"
-#include "ch-tree.h"
-#include "lex.h"
-#include "flags.h"
-#include "actions.h"
-#include "input.h"
-#include "obstack.h"
-#include "assert.h"
-#include "rtl.h"
-#include "toplev.h"
-
-/* if the user codes '-flocal-loop-counter' on the command line,
- ch-actions.c (lang_decode_option) will set this flag. */
-int flag_local_loop_counter = 1;
-
-/* forward declarations */
-static int declare_temps PARAMS ((void));
-static int initialize_iter_var PARAMS ((void));
-static void maybe_skip_loop PARAMS ((void));
-static int bottom_loop_end_check PARAMS ((void));
-static int increment_temps PARAMS ((void));
-static tree build_temporary_variable PARAMS ((const char *, tree));
-static tree maybe_make_for_temp PARAMS ((tree, const char *, tree));
-#if 0
-static tree chill_unsigned_type PARAMS ((tree));
-#endif
-
-/* In terms of the parameters passed to build_loop_iterator,
- * there are several types of loops. They are encoded by
- * the ITER_TYPE enumeration.
- *
- * 1) DO FOR EVER; ... OD
- * indicated by a NULL_TREE start_exp, step_exp and end_exp,
- * condition == NULL, in_flag = 0, and ever_flag == 1 in the
- * first ITERATOR.
- *
- * 2) DO WHILE cond; ... OD
- * indicated by NULL_TREE start_exp, step_exp and end_exp,
- * in_flag = 0, and condition != NULL.
- *
- * 3) DO; ... OD
- * indicated by NULL_TREEs in start_exp, step_exp and end_exp,
- * condition != NULL, in_flag == 0 and ever_flag == 0. This
- * is not really a loop, but a compound statement.
- *
- * 4) DO FOR user_var := start_exp
- * [DOWN] TO end_exp BY step_exp; ... DO
- * indicated by non-NULL_TREE start_exp, step_exp and end_exp.
- *
- * 5) DO FOR user_var [DOWN] IN discrete_mode; ... OD
- * indicated by in_flag == 1. start_exp is a non-NULL_TREE
- * discrete mode, with an optional down_flag.
- *
- * 6) DO FOR user_var [DOWN] IN powerset_expr; ... OD
- * indicated by in_flag == 1. start_exp is a non-NULL_TREE
- * powerset mode, with an optional down_flag.
- *
- * 7) DO FOR user_var [DOWN] IN location; ... OD
- * indicated by in_flag == 1. start_exp is a non-NULL_TREE
- * location mode, with an optional down_flag.
- */
-typedef enum
-{
- DO_FOREVER,
- DO_OD,
- DO_STEP,
- DO_POWERSET,
- DO_LOC,
- DO_LOC_VARYING
-} ITER_TYPE;
-
-
-typedef struct iterator
-{
-/* These variables only have meaning in the first ITERATOR structure. */
- ITER_TYPE itype; /* type of this iterator */
- int error_flag; /* TRUE if no loop was started due to
- user error */
- int down_flag; /* TRUE if DOWN was coded */
-
-/* These variables have meaning in every ITERATOR structure. */
- tree user_var; /* user's explicit iteration variable */
- tree start_exp; /* user's start expression
- or IN expression of a FOR .. IN*/
- tree step_exp; /* user's step expression */
- tree end_exp; /* user's end expression */
- tree start_temp; /* temp holding evaluated start_exp */
- tree end_temp; /* temp holding evaluated end_exp */
- tree step_temp; /* temp holding evaluated step_exp */
- tree powerset_temp; /* temp holding user's initial powerset expression */
- tree loc_ptr_temp; /* temp holding count for LOC enumeration ptr */
- tree iter_var; /* hidden variable for the loop */
- tree iter_type; /* hidden variable's type */
- tree stepin_type; /* saved type for a DO FOR IN loop */
- tree base_type; /* LOC enumeration base type */
- struct iterator *next; /* ptr to next iterator for this loop */
-} ITERATOR;
-
-/*
- * There's an entry like this for each nested DO loop.
- * The list is maintained by push_loop_block
- * and pop_loop_block.
- */
-typedef struct loop {
- struct loop *nxt_level; /* pointer to enclosing loop */
- ITERATOR *iter_list; /* iterators for the current loop */
-} LOOP;
-
-static LOOP *loopstack = (LOOP *)0;
-
-#if 0
-
-Here is a CHILL DO FOR statement:
-
-DO FOR user_var := start_exp BY step_exp [DOWN] TO end_exp
- WHILE condition;
-
-For this loop to be 'safe', like a Pascal FOR loop, the start,
-end, and increment expressions are computed once, before the
-assignment to the iteration variable and saved in temporaries,
-before the first assignment of the iteration variable, so the
-following works:
-
- FOR i := (i+1) TO (i+10) DO
-
-To prevent changes to the start/end/step expressions from
-effecting the loop''s termination, and to make the loop end-check
-as simple as possible, we evaluate the step expression into
-a temporary and compute a hidden iteration count before entering
-the loop''s body. User code cannot effect the counter, and the
-end-loop check simply decrements the counter and checks for zero.
-
-The whole phrase FOR iter := ... TO end_exp can be repeated
-multiple times, with different user-iteration variables. This
-is discussed later.
-
-The loop counter calculations need careful design since a loop
-from MININT TO MAXINT must work, in the precision of integers.
-
-Here''s how it works, in C:
-
- 0) The DO ... OD loop is simply a block with
- its own scope.
-
- 1) The DO FOR EVER is simply implemented:
-
- loop_top:
- .
- . body of loop
- .
- goto loop_top
- end_loop:
-
- 2) The DO WHILE is also simple:
-
-
- loop_top:
- if (!condition) goto end_loop
- .
- . body of loop
- .
- goto loop_top
- end_loop:
-
-
- 3) The DO FOR [while condition] loop (no DOWN)
-
- push a new scope,
- decl iter_var
-
- step_temp = step_exp
- start_temp = start_exp
- end_temp = end_exp
- if (end_exp < start_exp) goto end_loop
- /* following line is all unsigned arithmetic */
- iter_var = (end_exp - start_exp) / step_exp
- user_var = start_temp
- loop_top:
- if (!condition) goto end_loop
- .
- . body of loop
- .
- if (iter_var == 0) goto end_loop
- iter_var--
- user_var += step_temp
- goto loop_top
- end_loop:
- pop scope
-
- 4) The for [while condition] loop (with DOWN)
-
- push a new scope,
- decl iter
- step_temp = step_exp
- start_temp = start_exp
- end_temp = end_exp
- if (end_exp > start_exp) goto end_loop
- /* following line is all unsigned arithmetic */
- iter_var = (start_exp - end_exp) / step_exp
- user_var = start_temp
- loop_top:
- if (!condition) goto end_loop
- .
- . body of loop
- .
- if (iter_var == 0) goto end_loop
- iter_var--
- user_var -= step_temp
- goto loop_top
- end_loop:
- pop scope
-
-
- 5) The range loop, which iterates over a mode''s possible
- values, works just like the above step loops, but with
- the start and end values taken from the mode''s lower
- and upper domain values.
-
-
- 6) The FOR IN loop, where a location enumeration is
- specified (see spec on page 81 of Z.200, bottom
- of page 186):
-
- push a new scope,
- decl iter_var as an unsigned integer
- loc_ptr_temp as pointer to a composite base type
-
- if array is varying
- iter_var = array''s length field
- else
- iter_var = sizeof array / sizeof base_type
- loc_ptr_temp = &of highest or lowest indexable entry
- loop_top:
- if (!condition) goto end_loop
- .
- . body of loop
- .
- iter_var--
- if (iter_var == 0) goto end_loop
- loc_ptr_temp +/-= sizeof array base_type
- goto loop_top
- end_loop:
- pop scope
-
- 7) The DO FOR (DOWN) IN powerset_exp
-
- push a new scope,
- decl iterator as basetype of powerset
-
- powerset_temp := save_expr (start_exp)
- iter_var := DOWN ? length : 0
- loop_top:
- if (DOWN)
- iter_var := __ffsetclrpowerset (powerset_temp, length,
- iter_var);
- else
- iter_var := __ffsetclrpowerset (powrset_temp, iter_var, 0);
- if (iter_var < 0) goto end_loop;
- user_var = iter_var + min_value;
- if (!condition) goto end_loop
- if (!DOWN) iter_var +:= 1;
- .
- . body of loop
- .
- goto loop_top
- end_loop:
- pop scope
-
-
-So, here''s the general DO FOR schema, as implemented here:
-
- expand_start_loop -- start the loop''s control scope
- -- start scope for synthesized loop variables
- declare_temps -- create, initialize temporary variables
- maybe_skip_loop -- skip loop if end conditions unsatisfiable
- initialize_iter_var -- initialize the iteration counter
- -- initialize user''s loop variable
- expand_start_loop -- generate top-of-loop label
- top_loop_end_check -- generate while code and/or
- powerset find-a-bit function call
- .
- .
- . user''s loop body code
- .
- .
- bottom_loop_end_check -- exit if counter has become zero
- increment_temps -- update temps for next iteration
- expand_end_loop -- generate jump back to top of loop
- expand_end_cond -- generate label for end of conditional
- -- end of scope for synthesized loop variables
- free_iterators -- free up iterator space
-
-When there are two or more iterator phrases, each of the
-above loop steps must act upon all iterators. For example,
-the 'increment_temps' step must increment all temporaries
-(associated with all iterators).
-
- NOTE: Z.200, section 10.1 says that a block is ...
- "the actions statement list in a do action, including any
- loop counter and while control". This means that an exp-
- ression in a WHILE control can include references to the
- loop counters created for the loop''s exclusive use.
- Example:
-
- DCL a (1:10) INT;
- DCL j INT;
- DO FOR j IN a WHILE j > 0;
- ...
- OD;
- The 'j' referenced in the while is the loc-identity 'j'
- created inside the loop''s scope, and NOT the 'j' declared
- before the loop.
-#endif
-
-/*
- * The following routines are called directly by the
- * CHILL parser.
- */
-void
-push_loop_block ()
-{
- LOOP *temp = (LOOP *)xmalloc (sizeof (LOOP));
-
- /* push a new loop onto the stack */
- temp->nxt_level = loopstack;
- temp->iter_list = (ITERATOR *)0;
- loopstack = temp;
-}
-
-void
-pop_loop_block ()
-{
- LOOP *do_temp = loopstack;
- ITERATOR *ip;
-
- /* pop loop block off the list */
- loopstack = do_temp->nxt_level;
-
- /* free the loop's iterator blocks */
- ip = do_temp->iter_list;
- while (ip != NULL)
- {
- ITERATOR *temp = ip->next;
- free (ip);
- ip = temp;
- }
- free (do_temp);
-}
-
-void
-begin_loop_scope ()
-{
- pushlevel (1);
-
- if (pass >= 2)
- {
- declare_temps ();
-
- clear_last_expr ();
- push_momentary ();
- expand_start_bindings (0);
- }
-
- push_handler ();
-
-}
-
-
-void
-end_loop_scope (opt_label)
- tree opt_label;
-{
- if (opt_label)
- possibly_define_exit_label (opt_label);
-
- if (pass == 2)
- {
- expand_end_bindings (getdecls (), kept_level_p (), 0);
- pop_momentary ();
- }
- poplevel (kept_level_p (), 1, 0);
-}
-
-
-/* we need the above 2 functions somehow modified for initialising
- of non-value arrays */
-
-void
-nonvalue_begin_loop_scope ()
-{
- pushlevel (0); /* this happens only in pass 2 */
-
- declare_temps ();
-
- clear_last_expr ();
- push_momentary ();
- expand_start_bindings (0);
-}
-
-void
-nonvalue_end_loop_scope ()
-{
- expand_end_bindings (getdecls (), kept_level_p (), 0);
- pop_momentary ();
- poplevel (kept_level_p (), 1, 0);
-}
-
-/* The iterator structure records all aspects of a
- * 'FOR i := start [DOWN] TO end' clause or
- * 'FOR i IN modename' or 'FOR i IN powerset' clause.
- * It's saved on the iter_list of the current LOOP.
- */
-void
-build_loop_iterator (user_var, start_exp, step_exp, end_exp,
- down_flag, in_flag, ever_flag)
- tree user_var, start_exp, step_exp, end_exp;
- int down_flag, in_flag, ever_flag;
-{
- ITERATOR *ip = (ITERATOR *)xmalloc (sizeof (ITERATOR));
-
- /* chain this iterator onto the current loop */
- if (loopstack->iter_list == NULL)
- loopstack->iter_list = ip;
- else
- {
- ITERATOR *temp = loopstack->iter_list;
- while (temp->next != NULL)
- temp = temp->next;
- temp->next = ip;
- }
-
- ip->user_var = user_var;
- ip->start_exp = start_exp;
- ip->step_exp = step_exp;
- ip->end_exp = end_exp;
- ip->start_temp = NULL_TREE;
- ip->end_temp = NULL_TREE;
- ip->step_temp = NULL_TREE;
- ip->down_flag = down_flag;
- ip->powerset_temp = NULL_TREE;
- ip->iter_var = NULL_TREE;
- ip->iter_type = NULL_TREE;
- ip->stepin_type = NULL_TREE;
- ip->loc_ptr_temp = NULL_TREE;
- ip->error_flag = 1; /* assume error will be found */
- ip->next = (ITERATOR *)0;
-
- if (ever_flag)
- ip->itype = DO_FOREVER;
- else if (in_flag && start_exp != NULL_TREE)
- {
- if (TREE_CODE (start_exp) == ERROR_MARK)
- return;
- if (TREE_TYPE (start_exp) == NULL_TREE)
- {
- if (TREE_CODE (start_exp) == CONSTRUCTOR)
- error ("modeless tuple not allowed in this context");
- else
- error ("IN expression does not have a mode");
- return;
- }
- if (TREE_CODE (TREE_TYPE (start_exp)) == SET_TYPE)
- {
- if (CH_BOOLS_TYPE_P (TREE_TYPE (start_exp)))
- {
- sorry ("location enumeration for BOOLS");
- return;
- }
- ip->itype = DO_POWERSET;
- }
- else if (discrete_type_p (TREE_TYPE (ip->start_exp)))
- {
- /* range enumeration */
- tree type = TREE_TYPE (ip->start_exp);
- /* save the original type for later use in determine to do a
- rangecheck or not */
- ip->stepin_type = type;
- ip->itype = DO_STEP;
- if (ip->down_flag)
- {
- ip->start_exp = build_chill_upper (type);
- ip->end_exp = build_chill_lower (type);
- }
- else
- {
- ip->start_exp = build_chill_lower (type);
- ip->end_exp = build_chill_upper (type);
- }
- }
- else if (TREE_CODE (TREE_TYPE (ip->start_exp)) == ARRAY_TYPE)
- {
- if (TYPE_PACKED (TREE_TYPE (ip->start_exp)))
- {
- sorry ("location enumeration for bit-packed arrays");
- return;
- }
- ip->itype = DO_LOC;
- }
- else if (chill_varying_type_p (TREE_TYPE (ip->start_exp)))
- ip->itype = DO_LOC_VARYING;
- else
- {
- error ("Loop's IN expression is not a composite object");
- return;
- }
- }
- else
- ip->itype = DO_STEP;
- if (ip->itype == DO_STEP)
- {
- struct ch_class class;
-
- if (ip->step_exp == NULL_TREE)
- ip->step_exp = integer_one_node;
-
- if (! discrete_type_p (TREE_TYPE (ip->start_exp)))
- {
- error ("start expr must have discrete mode");
- return;
- }
- if (TREE_CODE (TREE_TYPE (ip->start_exp)) == ENUMERAL_TYPE
- && CH_ENUM_IS_NUMBERED (TREE_TYPE (ip->start_exp)))
- {
- error ("DO FOR start expression is a numbered SET");
- return;
- }
- if (TREE_CODE (ip->end_exp) == ERROR_MARK)
- return;
- if (TREE_CODE (TREE_TYPE (ip->end_exp)) == ENUMERAL_TYPE
- && CH_ENUM_IS_NUMBERED (TREE_TYPE (ip->end_exp)))
- {
- error ("TO expression is a numbered SET");
- return;
- }
- if (! discrete_type_p (TREE_TYPE (ip->end_exp)))
- {
- error ("TO expr must have discrete mode");
- return;
- }
- if (! CH_COMPATIBLE_CLASSES (ip->start_exp, ip->end_exp))
- {
- error ("start expr and TO expr must be compatible");
- return;
- }
- if (step_exp != NULL_TREE)
- {
- if (TREE_CODE (step_exp) == ERROR_MARK)
- return;
- if (! discrete_type_p (TREE_TYPE (step_exp)))
- {
- error ("BY expr must have discrete mode");
- return;
- }
- if (! CH_COMPATIBLE_CLASSES (ip->start_exp, step_exp))
- {
- error ("start expr and BY expr must be compatible");
- return;
- }
- }
-
- if (! flag_local_loop_counter)
- {
- /* In this case, it's a previously-declared VAR_DECL node. */
- tree id_node = ip->user_var;
- if (TREE_CODE (ip->user_var) == IDENTIFIER_NODE)
- ip->user_var = lookup_name (ip->user_var);
-
- /* Chill 1984 allows the name to be a defining occurrence,
- but does not require it. */
- if (ip->user_var == NULL_TREE)
- {
- warning ("loop identifier undeclared");
- ip->user_var = id_node;
- /* We declare a local name below. */
- }
- else
- {
- if (TREE_CODE (TREE_TYPE (ip->user_var)) == REFERENCE_TYPE)
- ip->user_var = convert_from_reference (ip->user_var);
-
- if (! CH_COMPATIBLE_CLASSES (ip->start_exp, ip->user_var))
- {
- error ("loop variable incompatible with start expression");
- return;
- }
- class = chill_expr_class (ip->user_var);
- }
- }
- /* Otherwise, declare a new name. */
- if (TREE_CODE (ip->user_var) == IDENTIFIER_NODE)
- {
- class = CH_RESULTING_CLASS (chill_expr_class (ip->start_exp),
- chill_expr_class (ip->end_exp));
- if (step_exp)
- class = CH_RESULTING_CLASS (class, chill_expr_class (step_exp));
-
- /* Integer literals noramally have type 'long long'
- (see convert_integer in lex.c). That is usually overkill. */
- if (class.kind == CH_DERIVED_CLASS
- && class.mode == long_long_integer_type_node
- && int_fits_type_p (ip->start_exp, integer_type_node)
- && int_fits_type_p (ip->end_exp, integer_type_node))
- class.mode = integer_type_node;
- }
-
- if (TREE_CODE (ip->start_exp) == INTEGER_CST
- && TREE_CODE (ip->end_exp) == INTEGER_CST
- && compare_int_csts (ip->down_flag ? LT_EXPR : GT_EXPR,
- ip->start_exp, ip->end_exp))
- warning ("body of DO FOR will never execute");
-
- ip->start_exp = convert_to_class (class, ip->start_exp);
- ip->end_exp = convert_to_class (class, ip->end_exp);
- ip->step_exp = convert_to_class (class, ip->step_exp);
-
- if (TREE_CODE (ip->step_exp) != INTEGER_CST)
- {
- /* generate runtime check for negative BY expr */
- ip->step_exp =
- check_range (ip->step_exp, ip->step_exp,
- integer_zero_node, NULL_TREE);
- }
- else if (compare_int_csts (LE_EXPR, ip->step_exp, integer_zero_node))
- {
- error ("BY expression is negative or zero");
- return;
- }
- }
-
- ip->error_flag = 0; /* no errors! */
-}
-
-void
-build_loop_start (start_label)
- tree start_label;
-{
- ITERATOR *firstp = loopstack->iter_list;
-
- if (firstp->error_flag)
- return;
-
- maybe_skip_loop ();
-
- if (initialize_iter_var ())
- return;
-
- /* use the label as an 'exit' label,
- 'goto' needs another sort of label */
- expand_start_loop (start_label != NULL_TREE);
-}
-
-/*
- * Called after the last action of the loop body
- * has been parsed.
- */
-void
-build_loop_end ()
-{
- ITERATOR *ip = loopstack->iter_list;
-
- emit_line_note (input_filename, lineno);
-
- if (ip->error_flag)
- return;
-
- if (bottom_loop_end_check ())
- return;
-
- if (increment_temps ())
- return;
-
- expand_end_loop ();
-
- for (; ip != NULL; ip = ip->next)
- {
- switch (ip->itype)
- {
- case DO_LOC_VARYING:
- case DO_STEP:
- expand_end_cond ();
- break;
- default:
- break;
- }
- }
-}
-
-/*
- * Reserve space for any loop-control temporaries, initialize them
- */
-static int
-declare_temps ()
-{
- ITERATOR *firstp = loopstack->iter_list, *ip;
- tree start_ptr;
-
- for (ip = firstp; ip != NULL; ip = ip->next)
- {
- switch (ip->itype)
- {
- case DO_FOREVER:
- break;
- case DO_STEP:
- ip->iter_type
- = type_for_size (TYPE_PRECISION (TREE_TYPE (ip->start_exp)), 1);
-
- /* create, initialize temporaries if expressions aren't constant */
- ip->start_temp = maybe_make_for_temp (ip->start_exp, "for_start",
- TREE_TYPE (ip->start_exp));
- ip->end_temp = maybe_make_for_temp (ip->end_exp, "for_end",
- TREE_TYPE (ip->end_exp));
- /* this is just the step-expression */
- ip->step_temp = maybe_make_for_temp (ip->step_exp, "for_step",
- TREE_TYPE (ip->step_exp));
- if (TREE_CODE (ip->user_var) == IDENTIFIER_NODE)
- {
- /* (re-)declare the user's iteration variable in the
- loop's scope. */
- tree id_node = ip->user_var;
- ip->user_var =
- decl_temp1 (id_node, TREE_TYPE (ip->start_exp), 0, NULL_TREE,
- 0, 0);
- CH_DERIVED_FLAG (ip->user_var) = CH_DERIVED_FLAG (ip->start_exp);
- pushdecl (ip->user_var);
- }
- ip->iter_var =
- decl_temp1 (get_unique_identifier ("iter_var"),
- ip->iter_type, 0, NULL_TREE, 0, 0);
- break;
-
- case DO_POWERSET:
- /* the user's powerset-expression */
- ip->powerset_temp = save_expr (ip->start_exp);
- mark_addressable (ip->powerset_temp);
-
- ip->iter_type = integer_type_node;
- ip->iter_var = decl_temp1 (get_unique_identifier ("iter_var"),
- ip->iter_type, 0,
- !ip->down_flag ? integer_zero_node
- : powersetlen (ip->powerset_temp),
- 0, 0);
-
- if (flag_local_loop_counter)
- {
- /* declare the user's iteration variable in the loop's scope. */
- /* in this case, it's just an IDENTIFIER_NODE */
- ip->user_var =
- decl_temp1 (ip->user_var,
- TYPE_DOMAIN (TREE_TYPE (ip->start_exp)),
- 0, NULL_TREE, 0, 0);
- pushdecl (ip->user_var);
- }
- else
- {
- /* in this case, it's a previously-declared VAR_DECL node */
- ip->user_var = lookup_name (ip->user_var);
- }
- break;
-
- case DO_LOC:
- case DO_LOC_VARYING:
- ip->iter_type = chill_unsigned_type_node;
- /* create the counter temp */
- ip->iter_var =
- build_temporary_variable ("iter_var", ip->iter_type);
-
- if (!CH_LOCATION_P (ip->start_exp))
- ip->start_exp
- = decl_temp1 (get_unique_identifier ("iter_loc"),
- TREE_TYPE (ip->start_exp), 0,
- ip->start_exp, 0, 0);
-
- if (ip->itype == DO_LOC)
- {
- tree array_type = TREE_TYPE (ip->start_exp);
- tree ptr_type;
- tree temp;
-
- /* FIXME: check for array type in ip->start_exp */
-
- /* create pointer temporary */
- ip->base_type = TREE_TYPE (array_type);
- ptr_type = build_pointer_type (ip->base_type);
- ip->loc_ptr_temp =
- build_temporary_variable ("loc_ptr_tmp", ptr_type);
-
- /* declare the user's iteration variable in
- the loop's scope, as an expression, to be
- passed to build_component_ref later */
- save_expr_under_name (ip->user_var,
- build1 (INDIRECT_REF, ip->base_type,
- ip->loc_ptr_temp));
-
- /* FIXME: see stor_layout */
- ip->step_temp = size_in_bytes (ip->base_type);
-
- temp = TYPE_DOMAIN (array_type);
-
- /* pointer to first array entry to look at */
- start_ptr = build1 (ADDR_EXPR, ptr_type, ip->start_exp);
- mark_addressable (ip->start_exp);
- ip->start_temp = ip->down_flag ?
- fold (build (PLUS_EXPR, ptr_type,
- start_ptr,
- fold (build (MULT_EXPR, integer_type_node, ip->step_temp,
- fold (build (MINUS_EXPR, integer_type_node,
- TYPE_MAX_VALUE (temp),
- TYPE_MIN_VALUE (temp)))))))
- : start_ptr;
- }
- else
- {
- tree array_length =
- convert (integer_type_node,
- build_component_ref (ip->start_exp, var_length_id));
- tree array_type = TREE_TYPE (TREE_CHAIN (
- TYPE_FIELDS (TREE_TYPE (ip->start_exp))));
- tree array_data_ptr =
- build_component_ref (ip->start_exp, var_data_id);
- tree ptr_type;
-
- if (TREE_CODE (TREE_TYPE (array_type)) == BOOLEAN_TYPE)
- {
- error ("Can't iterate through array of BOOL");
- firstp->error_flag = 1;
- return firstp->error_flag;
- }
-
- /* create pointer temporary */
- ip->base_type = TREE_TYPE (array_type);
- ptr_type = build_pointer_type (ip->base_type);
- ip->loc_ptr_temp =
- build_temporary_variable ("loc_ptr_temp", ptr_type);
-
-
- /* declare the user's iteration variable in
- the loop's scope, as an expression, to be
- passed to build_component_ref later */
- save_expr_under_name (ip->user_var,
- build1 (INDIRECT_REF, ip->base_type,
- ip->loc_ptr_temp));
-
- /* FIXME: see stor_layout */
- ip->step_temp = size_in_bytes (ip->base_type);
-
- /* pointer to first array entry to look at */
- start_ptr = build1 (ADDR_EXPR, ptr_type, array_data_ptr);
- mark_addressable (array_data_ptr);
- ip->start_temp = ip->down_flag ?
- fold (build (PLUS_EXPR, ptr_type,
- start_ptr,
- fold (build (MULT_EXPR, integer_type_node, ip->step_temp,
- fold (build (MINUS_EXPR, integer_type_node,
- array_length,
- integer_one_node))))))
- : start_ptr;
- }
- default:
- ;
- }
- }
- return firstp->error_flag;
-}
-
-/*
- * Initialize the hidden iteration-control variables,
- * and the user's explicit loop variable.
- */
-static int
-initialize_iter_var ()
-{
- ITERATOR *firstp = loopstack->iter_list, *ip;
-
- for (ip = firstp; ip != NULL; ip = ip->next)
- {
- switch (ip->itype)
- {
- tree array_type, array_length;
- case DO_FOREVER:
- break;
- case DO_STEP:
- {
- tree count;
- count = build (MINUS_EXPR, ip->iter_type,
- convert (ip->iter_type,
- ip->down_flag ? ip->start_temp : ip->end_temp),
- convert (ip->iter_type,
- ip->down_flag ? ip->end_temp : ip->start_temp));
- count = fold (build (TRUNC_DIV_EXPR, ip->iter_type,
- fold (count),
- ip->step_temp));
- /* The count in this case is actually one less than the
- number of iterations, to avoid overflow problems
- if we iterate *all* the values of iter_type. */
- /* initialize the loop's hidden counter variable */
- expand_expr_stmt (
- build_chill_modify_expr (ip->iter_var, count));
-
- /* initialize user's variable */
- expand_expr_stmt (
- build_chill_modify_expr (ip->user_var, ip->start_temp));
- }
- break;
- case DO_POWERSET:
- break;
- case DO_LOC:
- array_type = TREE_TYPE (ip->start_exp);
- array_length = fold (build (TRUNC_DIV_EXPR, integer_type_node,
- size_in_bytes (array_type),
- size_in_bytes (TREE_TYPE (array_type))));
- goto do_loc_common;
-
- case DO_LOC_VARYING:
- array_length
- = convert (integer_type_node,
- build_component_ref (ip->start_exp, var_length_id));
-
- do_loc_common:
- expand_expr_stmt (build_chill_modify_expr (ip->iter_var,
- array_length));
- expand_expr_stmt (
- build_chill_modify_expr (ip->loc_ptr_temp,
- ip->start_temp));
- break;
-
- default:
- ;
- }
- }
- return firstp->error_flag;
-}
-
-/* Generate code to skip the whole loop, if start expression not
- * <= end expression (or >= for DOWN loops). This comparison must
- * *NOT* be done in unsigned mode, or it will fail.
- * Also, skip processing an empty VARYING array.
- */
-static void
-maybe_skip_loop ()
-{
- ITERATOR *firstp = loopstack->iter_list, *ip;
-
- for (ip = firstp; ip != NULL; ip = ip->next)
- {
- switch (ip->itype)
- {
- case DO_STEP:
- expand_start_cond (
- build_compare_discrete_expr (ip->down_flag ? GE_EXPR : LE_EXPR,
- ip->start_temp, ip->end_temp), 0);
- break;
-
- case DO_LOC_VARYING:
- { tree array_length =
- convert (integer_type_node,
- build_component_ref (ip->start_exp, var_length_id));
- expand_start_cond (
- build (NE_EXPR, TREE_TYPE (array_length),
- array_length, integer_zero_node), 0);
- break;
- }
- default:
- break;
- }
- }
-}
-
-/*
- * Check at the top of the loop for a termination
- */
-void
-top_loop_end_check (condition)
- tree condition;
-{
- ITERATOR *ip;
-
- for (ip = loopstack->iter_list; ip != NULL; ip = ip->next)
- {
- switch (ip->itype)
- {
- case DO_FOREVER:
- case DO_STEP:
- break;
- case DO_POWERSET:
- {
- tree temp1;
- const char *func_name;
- tree user_type = TREE_TYPE (ip->user_var);
-
- if (ip->down_flag)
- func_name = "__flsetclrpowerset";
- else
- func_name = "__ffsetclrpowerset";
-
- temp1 = lookup_name (get_identifier (func_name));
- if (ip->down_flag)
- temp1 = build_chill_function_call (temp1,
- tree_cons (NULL_TREE, force_addr_of (ip->powerset_temp),
- tree_cons (NULL_TREE, ip->iter_var,
- tree_cons (NULL_TREE, integer_zero_node, NULL_TREE))));
- else
- temp1 = build_chill_function_call (temp1,
- tree_cons (NULL_TREE, force_addr_of (ip->powerset_temp),
- tree_cons (NULL_TREE, powersetlen (ip->powerset_temp),
- tree_cons (NULL_TREE, ip->iter_var, NULL_TREE))));
- expand_assignment (ip->iter_var, temp1, 0, 0);
- expand_exit_loop_if_false (0, build (GE_EXPR, boolean_type_node,
- ip->iter_var,
- integer_zero_node));
- temp1 = TYPE_MIN_VALUE
- (TYPE_DOMAIN (TREE_TYPE (ip->powerset_temp)));
- expand_assignment (ip->user_var,
- build (PLUS_EXPR, user_type,
- convert (user_type, ip->iter_var),
- convert (user_type, temp1)),
- 0, 0);
- }
- break;
- case DO_LOC:
- case DO_LOC_VARYING:
- break;
- default:
- ;
- }
- }
- emit_line_note (input_filename, lineno);
-
- /* now, exit the loop if the condition isn't TRUE. */
- if (condition)
- expand_exit_loop_if_false (0, truthvalue_conversion (condition));
-}
-
-/*
- * Check generated temporaries for loop's end
- */
-static int
-bottom_loop_end_check ()
-{
- ITERATOR *firstp = loopstack->iter_list, *ip;
-
- emit_line_note (input_filename, lineno);
-
- /* now, generate code to check each loop counter for termination */
- for (ip = firstp; ip != NULL; ip = ip->next)
- {
- switch (ip->itype)
- {
- case DO_FOREVER:
- break;
- case DO_STEP:
- /* exit if it's zero */
- expand_exit_loop_if_false (0,
- build (NE_EXPR, boolean_type_node,
- ip->iter_var,
- integer_zero_node));
- /* decrement iteration counter by one */
- chill_expand_assignment (ip->iter_var, MINUS_EXPR, integer_one_node);
- break;
- case DO_LOC:
- case DO_LOC_VARYING:
- /* decrement iteration counter by one */
- chill_expand_assignment (ip->iter_var, MINUS_EXPR, integer_one_node);
- /* exit if it's zero */
- expand_exit_loop_if_false (0,
- build (NE_EXPR, boolean_type_node,
- ip->iter_var,
- integer_zero_node));
- break;
- case DO_POWERSET:
- break;
- default:
- ;
- }
- }
-
- return firstp->error_flag;
-}
-
-/*
- * increment the loop-control variables.
- */
-static int
-increment_temps ()
-{
- ITERATOR *firstp = loopstack->iter_list, *ip;
-
- for (ip = firstp; ip != NULL; ip = ip->next)
- {
- switch (ip->itype)
- {
- case DO_FOREVER:
- break;
- case DO_STEP:
- {
- tree delta =
- fold (build (ip->down_flag ? MINUS_EXPR : PLUS_EXPR,
- TREE_TYPE (ip->user_var), ip->user_var,
- ip->step_temp));
- expand_expr_stmt (
- build_chill_modify_expr (ip->user_var, delta));
- }
- break;
- case DO_LOC:
- case DO_LOC_VARYING:
- /* This statement uses the C semantics, so that
- the pointer is actually incremented by the
- length of the object pointed to. */
- {
- enum tree_code op = ip->down_flag ? MINUS_EXPR : PLUS_EXPR;
- tree el_type = TREE_TYPE (TREE_TYPE (ip->loc_ptr_temp));
- chill_expand_assignment (ip->loc_ptr_temp, NOP_EXPR,
- build (op,
- TREE_TYPE (ip->loc_ptr_temp),
- ip->loc_ptr_temp,
- size_in_bytes (el_type)));
- }
- break;
- case DO_POWERSET:
- if (!ip->down_flag)
- expand_assignment (ip->iter_var,
- build (PLUS_EXPR, ip->iter_type,
- ip->iter_var,
- integer_one_node),
- 0, 0);
- break;
- default:
- ;
- }
- }
- return firstp->error_flag;
-}
-
-/*
- * Generate a (temporary) unique identifier_node of
- * the form "__tmp_%s_%d"
- */
-tree
-get_unique_identifier (lead)
- const char *lead;
-{
- char idbuf [256];
- static int idcount = 0;
-
- sprintf (idbuf, "__tmp_%s_%d", lead ? lead : "", idcount++);
- return get_identifier (idbuf);
-}
-
-/*
- * build a temporary variable, given its NAME and TYPE.
- * The name will have a number appended to assure uniqueness.
- * return its DECL node.
- */
-static tree
-build_temporary_variable (name, type)
- const char *name;
- tree type;
-{
- return decl_temp1 (get_unique_identifier (name), type, 0, NULL_TREE, 0, 0);
-}
-
-
-/*
- * If the given expression isn't a constant, build a temp for it
- * and evaluate the expression into the temp. Return the tree
- * representing either the original constant expression or the
- * temp which now contains the expression's value.
- */
-static tree
-maybe_make_for_temp (exp, temp_name, exp_type)
- tree exp;
- const char *temp_name;
- tree exp_type;
-{
- tree result = exp;
-
- if (exp != NULL_TREE)
- {
- /* if exp isn't constant, create a temporary for its value */
- if (TREE_CONSTANT (exp))
- {
- /* FIXME: assure that TREE_TYPE (result) == ip->exp_type */
- result = convert (exp_type, exp);
- }
- else {
- /* build temp, assign the value */
- result = decl_temp1 (get_unique_identifier (temp_name), exp_type, 0,
- exp, 0, 0);
- }
- }
- return result;
-}
-
-#if 0
-/*
- * Adapt the C unsigned_type function to CHILL - we need to
- * account for any CHILL-specific integer types here. So far,
- * the 16-bit integer type is the only one.
- */
-static tree
-chill_unsigned_type (type)
- tree type;
-{
- extern tree chill_unsigned_type_node;
- tree type1 = TYPE_MAIN_VARIANT (type);
-
- if (type1 == chill_integer_type_node)
- return chill_unsigned_type_node;
- else
- return unsigned_type (type);
-}
-#endif
diff --git a/gcc/ch/nloop.c b/gcc/ch/nloop.c
deleted file mode 100644
index 51ffbaba3fb..00000000000
--- a/gcc/ch/nloop.c
+++ /dev/null
@@ -1,1246 +0,0 @@
-/* Implement looping actions for CHILL.
- Copyright (C) 1992, 1993, 1994, 2000
- Free Software Foundation, Inc.
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-#include <stdio.h>
-#include <limits.h>
-#include "config.h"
-#include "tree.h"
-#include "ch-tree.h"
-#include "lex.h"
-#include "flags.h"
-#include "actions.h"
-#include "input.h"
-#include "obstack.h"
-#include "assert.h"
-#include "rtl.h"
-
-/* if the user codes '-flocal-loop-counter' on the command line,
- ch-actions.c (lang_decode_option) will set this flag. */
-int flag_local_loop_counter = 0;
-
-extern tree chill_truthvalue_conversion PARAMS ((tree));
-extern rtx emit_line_note PARAMS ((char *, int));
-extern void error PARAMS ((char *, ...));
-extern rtx expand_assignment PARAMS ((tree, tree, int, int));
-extern void save_expr_under_name PARAMS ((tree, tree));
-extern void stamp_nesting_label PARAMS ((tree));
-extern int int_fits_type_p PARAMS ((tree, tree));
-extern void warning PARAMS ((char *, ...));
-
-/* forward declarations */
-static int classify_loop PARAMS ((void));
-static int declare_temps PARAMS ((void));
-static int initialize_iter_var PARAMS ((void));
-static int maybe_skip_loop PARAMS ((void));
-static int top_loop_end_check PARAMS ((void));
-static int bottom_loop_end_check PARAMS ((void));
-static int increment_temps PARAMS ((void));
-static tree build_temporary_variable PARAMS ((char *, tree));
-static tree maybe_make_for_temp PARAMS ((tree, char *, tree));
-static tree chill_unsigned_type PARAMS ((tree));
-
-/* In terms of the parameters passed to build_loop_iterator,
- * there are several types of loops. They are encoded by
- * the ITER_TYPE enumeration.
- *
- * 1) DO FOR EVER; ... OD
- * indicated by a NULL_TREE start_exp, step_exp and end_exp,
- * condition == NULL, in_flag = 0, and ever_flag == 1 in the
- * first ITERATOR.
- *
- * 2) DO WHILE cond; ... OD
- * indicated by NULL_TREE start_exp, step_exp and end_exp,
- * in_flag = 0, and condition != NULL.
- *
- * 3) DO; ... OD
- * indicated by NULL_TREEs in start_exp, step_exp and end_exp,
- * condition != NULL, in_flag == 0 and ever_flag == 0. This
- * is not really a loop, but a compound statement.
- *
- * 4) DO FOR user_var := start_exp
- * [DOWN] TO end_exp BY step_exp; ... DO
- * indicated by non-NULL_TREE start_exp, step_exp and end_exp.
- *
- * 5) DO FOR user_var [DOWN] IN discrete_mode; ... OD
- * indicated by in_flag == 1. start_exp is a non-NULL_TREE
- * discrete mode, with an optional down_flag.
- *
- * 6) DO FOR user_var [DOWN] IN powerset_expr; ... OD
- * indicated by in_flag == 1. start_exp is a non-NULL_TREE
- * powerset mode, with an optional down_flag.
- *
- * 7) DO FOR user_var [DOWN] IN location; ... OD
- * indicated by in_flag == 1. start_exp is a non-NULL_TREE
- * location mode, with an optional down_flag.
- */
-typedef enum
-{
- DO_UNUSED,
- DO_FOREVER,
- DO_WHILE,
- DO_OD,
- DO_STEP,
- DO_RANGE,
- DO_POWERSET,
- DO_LOC,
- DO_LOC_VARYING
-} ITER_TYPE;
-
-
-typedef struct iterator
-{
-/* These variables only have meaning in the first ITERATOR structure. */
- ITER_TYPE itype; /* type of this iterator */
- int error_flag; /* TRUE if no loop was started due to
- user error */
- tree condition; /* WHILE condition expression */
- int down_flag; /* TRUE if DOWN was coded */
-
-/* These variables have meaning in every ITERATOR structure. */
- tree user_var; /* user's explicit iteration variable */
- tree start_exp; /* user's start expression
- or IN expression of a FOR .. IN*/
- tree step_exp; /* user's step expression */
- tree end_exp; /* user's end expression */
- tree start_temp; /* temp holding evaluated start_exp */
- tree end_temp; /* temp holding evaluated end_exp */
- tree step_temp; /* temp holding evaluated step_exp */
- tree powerset_temp; /* temp holding user's initial powerset expression */
- tree loc_ptr_temp; /* temp holding count for LOC enumeration ptr */
- tree iter_var; /* hidden variable for the loop */
- tree iter_type; /* hidden variable's type */
- tree base_type; /* LOC enumeration base type */
- struct iterator *next; /* ptr to next iterator for this loop */
-} ITERATOR;
-
-/*
- * There's an entry like this for each nested DO loop.
- * The list is maintained by push_loop_block
- * and pop_loop_block.
- */
-typedef struct loop {
- struct loop *nxt_level; /* pointer to enclosing loop */
- ITERATOR *iter_list; /* iterators for the current loop */
-} LOOP;
-
-static LOOP *loop_stack = (LOOP *)0;
-
-#if 0
-
-Here is a CHILL DO FOR statement:
-
-DO FOR user_var := start_exp BY step_exp [DOWN] TO end_exp
- WHILE condition;
-
-For this loop to be 'safe', like a Pascal FOR loop, the start,
-end, and increment expressions are computed once, before the
-assignment to the iteration variable and saved in temporaries,
-before the first assignment of the iteration variable, so the
-following works:
-
- FOR i := (i+1) TO (i+10) DO
-
-To prevent changes to the start/end/step expressions from
-effecting the loop''s termination, and to make the loop end-check
-as simple as possible, we evaluate the step expression into
-a temporary and compute a hidden iteration count before entering
-the loop''s body. User code cannot effect the counter, and the
-end-loop check simply decrements the counter and checks for zero.
-
-The whole phrase FOR iter := ... TO end_exp can be repeated
-multiple times, with different user-iteration variables. This
-is discussed later.
-
-The loop counter calculations need careful design since a loop
-from MININT TO MAXINT must work, in the precision of integers.
-
-Here''s how it works, in C:
-
- 0) The DO ... OD loop is simply a block with
- its own scope.
-
- 1) The DO FOR EVER is simply implemented:
-
- loop_top:
- .
- . body of loop
- .
- goto loop_top
- end_loop:
-
- 2) The DO WHILE is also simple:
-
-
- loop_top:
- if (!condition) goto end_loop
- .
- . body of loop
- .
- goto loop_top
- end_loop:
-
-
- 3) The DO FOR [while condition] loop (no DOWN)
-
- push a new scope,
- decl iter_var
-
- step_temp = step_exp
- start_temp = start_exp
- end_temp = end_exp
- if (end_exp < start_exp) goto end_loop
- /* following line is all unsigned arithmetic */
- iter_var = (end_exp - start_exp + step_exp) / step_exp
- user_var = start_temp
- loop_top:
- if (!condition) goto end_loop
- .
- . body of loop
- .
- iter_var--
- if (iter_var == 0) goto end_loop
- user_var += step_temp
- goto loop_top
- end_loop:
- pop scope
-
- 4) The proposed CHILL for [while condition] loop (with DOWN)
-
- push a new scope,
- decl iter
- step_temp = step_exp
- start_temp = start_exp
- end_temp = end_exp
- if (end_exp > start_exp) goto end_loop
- /* following line is all unsigned arithmetic */
- iter_var = (start_exp - end_exp + step_exp) / step_exp
- user_var = start_temp
- loop_top:
- if (!condition) goto end_loop
- .
- . body of loop
- .
- iter_var--
- if (iter_var == 0) goto end_loop
- user_var -= step_temp
- goto loop_top
- end_loop:
- pop scope
-
-
- 5) The range loop, which iterates over a mode''s possible
- values, works just like the above step loops, but with
- the start and end values taken from the mode''s lower
- and upper domain values.
-
-
- 6) The FOR IN loop, where a location enumeration is
- specified (see spec on page 81 of Z.200, bottom
- of page 186):
-
- push a new scope,
- decl iter_var as an unsigned integer
- loc_ptr_temp as pointer to a composite base type
-
- if array is varying
- iter_var = array''s length field
- else
- iter_var = sizeof array / sizeof base_type
- loc_ptr_temp = &of highest or lowest indexable entry
- loop_top:
- if (!condition) goto end_loop
- .
- . body of loop
- .
- iter_var--
- if (iter_var == 0) goto end_loop
- loc_ptr_temp +/-= sizeof array base_type
- goto loop_top
- end_loop:
- pop scope
-
- 7) The DO FOR (DOWN) IN powerset_exp
-
- push a new scope,
- decl powerset_temp
- decl iterator as basetype of powerset
-
- powerset_temp := start_exp
- loop_top:
- /* if DOWN */
- if (__flsetclrpowerset () == 0) goto end_loop;
- /* not DOWN */
- if (__ffsetclrpowerset () == 0) goto end_loop;
- if (!condition) goto end_loop
- .
- . body of loop
- .
- goto loop_top
- end_loop:
- pop scope
-
-
-So, here''s the general DO FOR schema, as implemented here:
-
- classify_loop -- what type of loop have we?
- -- build_iterator does some of this, also
- expand_start_loop -- start the loop''s control scope
- -- start scope for synthesized loop variables
- declare_temps -- create, initialize temporary variables
- maybe_skip_loop -- skip loop if end conditions unsatisfiable
- initialize_iter_var -- initialize the iteration counter
- -- initialize user''s loop variable
- expand_start_loop -- generate top-of-loop label
- top_loop_end_check -- generate while code and/or
- powerset find-a-bit function call
- .
- .
- . user''s loop body code
- .
- .
- bottom_loop_end_check -- exit if counter has become zero
- increment_temps -- update temps for next iteration
- expand_end_loop -- generate jump back to top of loop
- expand_end_cond -- generate label for end of conditional
- -- end of scope for synthesized loop variables
- free_iterators -- free up iterator space
-
-When there are two or more iterator phrases, each of the
-above loop steps must act upon all iterators. For example,
-the 'increment_temps' step must increment all temporaries
-(associated with all iterators).
-
- NOTE: Z.200, section 10.1 says that a block is ...
- "the actions statement list in a do action, including any
- loop counter and while control". This means that an exp-
- ression in a WHILE control can include references to the
- loop counters created for the loop''s exclusive use.
- Example:
-
- DCL a (1:10) INT;
- DCL j INT;
- DO FOR j IN a WHILE j > 0;
- ...
- OD;
- The 'j' referenced in the while is the loc-identity 'j'
- created inside the loop''s scope, and NOT the 'j' declared
- before the loop.
-#endif
-
-/*
- * The following routines are called directly by the
- * CHILL parser.
- */
-void
-push_loop_block ()
-{
- LOOP *temp = (LOOP *)xmalloc (sizeof (LOOP));
-
- /* push a new loop onto the stack */
- temp->nxt_level = loop_stack;
- temp->iter_list = (ITERATOR *)0;
- loop_stack = temp;
-}
-
-void
-pop_loop_block ()
-{
- LOOP *do_temp = loop_stack;
- ITERATOR *ip;
-
- /* pop loop block off the list */
- loop_stack = do_temp->nxt_level;
-
- /* free the loop's iterator blocks */
- ip = do_temp->iter_list;
- while (ip != NULL)
- {
- ITERATOR *temp = ip->next;
- free (ip);
- ip = temp;
- }
- free (do_temp);
-}
-
-void
-begin_loop_scope ()
-{
- ITERATOR *firstp = loop_stack->iter_list;
-
- if (pass < 2)
- return;
-
- /*
- * We need to classify the loop and declare its temporaries
- * here, so as to define them before the WHILE condition
- * (if any) is parsed. The WHILE expression may refer to
- * a temporary.
- */
- if (classify_loop ())
- return;
-
- if (firstp->itype != DO_OD)
- declare_temps ();
-
- clear_last_expr ();
- push_momentary ();
- expand_start_bindings (0);
-}
-
-
-void
-end_loop_scope (opt_label)
- tree opt_label;
-{
- if (opt_label)
- possibly_define_exit_label (opt_label);
- poplevel (0, 0, 0);
-
- if (pass < 2)
- return;
-
- expand_end_bindings (getdecls (), kept_level_p (), 0);
- pop_momentary ();
-}
-
-/* The iterator structure records all aspects of a
- * 'FOR i := start [DOWN] TO end' clause or
- * 'FOR i IN modename' or 'FOR i IN powerset' clause.
- * It's saved on the iter_list of the current LOOP.
- */
-void
-build_loop_iterator (user_var, start_exp, step_exp, end_exp,
- down_flag, in_flag, ever_flag)
- tree user_var, start_exp, step_exp, end_exp;
- int down_flag, in_flag, ever_flag;
-{
- ITERATOR *ip = (ITERATOR *)xmalloc (sizeof (ITERATOR));
-
- /* chain this iterator onto the current loop */
- if (loop_stack->iter_list == NULL)
- loop_stack->iter_list = ip;
- else
- {
- ITERATOR *temp = loop_stack->iter_list;
- while (temp->next != NULL)
- temp = temp->next;
- temp->next = ip;
- }
-
- ip->itype = DO_UNUSED;
- ip->user_var = user_var;
- ip->start_exp = start_exp;
- ip->step_exp = step_exp;
- ip->end_exp = end_exp;
- ip->condition = NULL_TREE;
- ip->start_temp = NULL_TREE;
- ip->end_temp = NULL_TREE;
- ip->step_temp = NULL_TREE;
- ip->down_flag = down_flag;
- ip->powerset_temp = NULL_TREE;
- ip->iter_var = NULL_TREE;
- ip->iter_type = NULL_TREE;
- ip->loc_ptr_temp = NULL_TREE;
- ip->error_flag = 1; /* assume error will be found */
- ip->next = (ITERATOR *)0;
-
- if (ever_flag)
- ip->itype = DO_FOREVER;
- else if (in_flag && start_exp != NULL_TREE)
- {
- if (TREE_CODE (start_exp) == ERROR_MARK)
- return;
- if (TREE_CODE (TREE_TYPE (start_exp)) == SET_TYPE)
- ip->itype = DO_POWERSET;
- else if (discrete_type_p (TREE_TYPE (ip->start_exp)))
- ip->itype = DO_RANGE;
- else if (TREE_CODE (TREE_TYPE (ip->start_exp)) == ARRAY_TYPE)
- ip->itype = DO_LOC;
- else if (chill_varying_type_p (TREE_TYPE (ip->start_exp)))
- ip->itype = DO_LOC_VARYING;
- else
- {
- error ("Loop's IN expression is not a composite object");
- return;
- }
- }
- else if (start_exp == NULL_TREE && end_exp == NULL_TREE
- && step_exp == NULL_TREE && !down_flag)
- ip->itype = DO_OD;
- else
- {
- /* FIXME: Move this to the lexer? */
-#define CST_FITS_INT(NODE) (TREE_CODE(NODE) == INTEGER_CST &&\
- int_fits_type_p (NODE, integer_type_node))
-
- tree max_prec_type = integer_type_node;
-
- if (! discrete_type_p (TREE_TYPE (ip->start_exp)))
- {
- error ("start expr must have discrete mode");
- return;
- }
- if (TREE_CODE (TREE_TYPE (ip->start_exp)) == ENUMERAL_TYPE
- && CH_ENUM_IS_NUMBERED (TREE_TYPE (ip->start_exp)))
- {
- error ("DO FOR start expression is a numbered SET");
- return;
- }
- if (TREE_CODE (TREE_TYPE (ip->end_exp)) == ENUMERAL_TYPE
- && CH_ENUM_IS_NUMBERED (TREE_TYPE (ip->end_exp)))
- {
- error ("TO expression is a numbered SET");
- return;
- }
- /* Convert all three expressions to a common precision,
- which is the largest precision they exhibit, but
- INTEGER_CST nodes are built in the lexer as
- long_integer_type nodes. We'll treat convert them to
- integer_type_nodes if possible, for faster loop times. */
-
- if (TYPE_PRECISION (max_prec_type) <
- TYPE_PRECISION (TREE_TYPE (ip->start_exp))
- && !CST_FITS_INT (ip->start_exp))
- max_prec_type = TREE_TYPE (ip->start_exp);
- if (! discrete_type_p (TREE_TYPE (ip->end_exp)))
- {
- error ("TO expr must have discrete mode");
- return;
- }
- if (! CH_COMPATIBLE (ip->start_exp,
- TREE_TYPE (ip->end_exp)))
- {
- error ("start expr and TO expr must be compatible");
- return;
- }
- if (TYPE_PRECISION (max_prec_type) <
- TYPE_PRECISION (TREE_TYPE (ip->end_exp))
- && !CST_FITS_INT (ip->end_exp))
- max_prec_type = TREE_TYPE (ip->end_exp);
- if (ip->step_exp != NULL_TREE)
- {
- /* assure that default 'BY 1' gets a useful type */
- if (ip->step_exp == integer_one_node)
- ip->step_exp = convert (TREE_TYPE (ip->start_exp),
- ip->step_exp);
- if (! discrete_type_p (TREE_TYPE (ip->step_exp)))
- {
- error ("BY expr must have discrete mode");
- return;
- }
- if (! CH_COMPATIBLE (ip->start_exp,
- TREE_TYPE (ip->step_exp)))
- {
- error ("start expr and BY expr must be compatible");
- return;
- }
- if (TYPE_PRECISION (max_prec_type) <
- TYPE_PRECISION (TREE_TYPE (ip->step_exp))
- && !CST_FITS_INT (ip->step_exp))
- max_prec_type = TREE_TYPE (ip->step_exp);
- }
- if (TREE_CODE (ip->start_exp) == INTEGER_CST
- && TREE_CODE (ip->end_exp) == INTEGER_CST
- && compare_int_csts (ip->down_flag ? LT_EXPR : GT_EXPR,
- ip->start_exp, ip->end_exp))
- warning ("body of DO FOR will never execute");
-
- ip->start_exp =
- convert (max_prec_type, ip->start_exp);
- ip->end_exp =
- convert (max_prec_type, ip->end_exp);
-
- if (ip->step_exp != NULL_TREE)
- {
- ip->step_exp =
- convert (max_prec_type, ip->step_exp);
-
- if (TREE_CODE (ip->step_exp) != INTEGER_CST)
- {
- /* generate runtime check for negative BY expr */
- ip->step_exp =
- check_range (ip->step_exp, ip->step_exp,
- integer_zero_node, NULL_TREE);
- }
- else if (compare_int_csts (LE_EXPR, ip->step_exp, integer_zero_node))
- {
- error ("BY expression is negative or zero");
- return;
- }
- }
- ip->itype = DO_STEP;
- }
-
- ip->error_flag = 0; /* no errors! */
-}
-
-void
-build_loop_start (while_control, start_label)
- tree while_control, start_label;
-{
- ITERATOR *firstp = loop_stack->iter_list;
-
- firstp->condition = while_control;
-
- if (firstp->error_flag)
- return;
-
- /* We didn't know at begin_loop_scope time about the condition;
- adjust iterator type now. */
- if (firstp->itype == DO_OD && firstp->condition)
- firstp->itype = DO_WHILE;
-
- if (initialize_iter_var ())
- return;
-
- if (maybe_skip_loop ())
- return;
-
- /* use the label as an 'exit' label,
- 'goto' needs another sort of label */
- expand_start_loop (start_label != NULL_TREE);
-
- if (top_loop_end_check ())
- return;
- emit_line_note (input_filename, lineno);
-}
-
-/*
- * Called after the last action of the loop body
- * has been parsed.
- */
-void
-build_loop_end ()
-{
- ITERATOR *ip = loop_stack->iter_list;
-
- emit_line_note (input_filename, lineno);
-
- if (ip->error_flag)
- return;
-
- if (bottom_loop_end_check ())
- return;
-
- if (increment_temps ())
- return;
-
- if (ip->itype != DO_OD)
- {
- expand_end_loop ();
-
- for (; ip != NULL; ip = ip->next)
- {
- switch (ip->itype)
- {
- case DO_LOC_VARYING:
- case DO_STEP:
- expand_end_cond ();
- break;
- default:
- break;
- }
- }
- }
-}
-
-/*
- * The rest of the routines in this file are called from
- * the above three routines.
- */
-static int
-classify_loop ()
-{
- ITERATOR *firstp = loop_stack->iter_list, *ip;
-
- firstp->error_flag = 0;
- if (firstp->itype == DO_UNUSED || firstp->itype == DO_OD)
- {
- /* if we have just DO .. OD, do nothing - this is just a
- BEGIN .. END without creating a new scope, and no looping */
- if (firstp->condition != NULL_TREE)
- firstp->itype = DO_WHILE;
- else
- firstp->itype = DO_OD;
- }
-
- /* Issue a warning if the any loop counter is mentioned more
- than once in the iterator list. */
- for (ip = firstp; ip != NULL; ip = ip->next)
- {
- switch (ip->itype)
- {
- case DO_FOREVER:
- case DO_WHILE:
- break;
- case DO_STEP:
- case DO_RANGE:
- case DO_POWERSET:
- case DO_LOC:
- case DO_LOC_VARYING:
- /* FIXME: check for name uniqueness */
- break;
- default:
- ;
- }
- }
- return firstp->error_flag;
-}
-
-/*
- * Reserve space for any loop-control temporaries, initialize them
- */
-static int
-declare_temps ()
-{
- ITERATOR *firstp = loop_stack->iter_list, *ip;
- tree start_ptr;
-
- for (ip = firstp; ip != NULL; ip = ip->next)
- {
- switch (ip->itype)
- {
- case DO_FOREVER:
- case DO_WHILE:
- break;
- case DO_STEP:
- ip->iter_type = chill_unsigned_type (TREE_TYPE (ip->start_exp));
-
- /* create, initialize temporaries if expressions aren't constant */
- ip->start_temp = maybe_make_for_temp (ip->start_exp, "for_start",
- ip->iter_type);
- ip->end_temp = maybe_make_for_temp (ip->end_exp, "for_end",
- ip->iter_type);
- /* this is just the step-expression */
- ip->step_temp = maybe_make_for_temp (ip->step_exp, "for_step",
- ip->iter_type);
- goto do_step_range;
-
- case DO_RANGE:
- ip->iter_type = chill_unsigned_type_node;
-
- ip->start_temp =
- (ip->down_flag ? build_chill_upper : build_chill_lower)(TREE_TYPE (ip->start_exp));
- ip->end_temp =
- (ip->down_flag ? build_chill_lower : build_chill_upper)(TREE_TYPE (ip->start_exp));
-
- ip->step_temp = integer_one_node;
-
- do_step_range:
- if (flag_local_loop_counter)
- {
- /* (re-)declare the user's iteration variable in the
- loop's scope. */
- tree id_node = ip->user_var;
- IDENTIFIER_LOCAL_VALUE (id_node) = ip->user_var =
- decl_temp1 (id_node, ip->iter_type, 0, NULL_TREE,
- 0, 0);
- }
- else
- {
- /* in this case, it's a previously-declared
- VAR_DECL node, checked in build_loop_iterator. */
- if (TREE_CODE (ip->user_var) == IDENTIFIER_NODE)
- ip->user_var = lookup_name (ip->user_var);
- if (ip->user_var == NULL_TREE)
- {
- error ("loop identifier undeclared");
- ip->error_flag = 1;
- return 1;
- }
- }
- ip->iter_var =
- decl_temp1 (get_unique_identifier ("iter_var"),
- ip->iter_type, 0, NULL_TREE, 0, 0);
- break;
-
- case DO_POWERSET:
- ip->iter_type = chill_unsigned_type (
- TYPE_DOMAIN (TREE_TYPE (ip->start_exp)));
- if (flag_local_loop_counter)
- {
- /* declare the user's iteration variable in the loop's scope. */
- /* in this case, it's just an IDENTIFIER_NODE */
- ip->user_var =
- decl_temp1 (ip->user_var, ip->iter_type, 0, NULL_TREE, 0, 0);
- }
- else
- {
- /* in this case, it's a previously-declared VAR_DECL node */
- ip->user_var = lookup_name (ip->user_var);
- }
- /* the user's powerset-expression, evaluated and saved in a temp */
- ip->powerset_temp = maybe_make_for_temp (ip->start_exp, "for_set",
- TREE_TYPE (ip->start_exp));
- mark_addressable (ip->powerset_temp);
- break;
-
- case DO_LOC:
- case DO_LOC_VARYING:
- ip->iter_type = chill_unsigned_type_node;
- /* create the counter temp */
- ip->iter_var =
- build_temporary_variable ("iter_var", ip->iter_type);
-
- if (!CH_LOCATION_P (ip->start_exp))
- ip->start_exp
- = decl_temp1 (get_unique_identifier ("iter_loc"),
- TREE_TYPE (ip->start_exp), 0,
- ip->start_exp, 0, 0);
-
- if (ip->itype == DO_LOC)
- {
- tree array_type = TREE_TYPE (ip->start_exp);
- tree ptr_type;
- tree temp;
-
- if (TREE_CODE (TREE_TYPE (array_type)) == BOOLEAN_TYPE)
- {
- error ("Can't iterate through array of BOOL");
- ip->error_flag = 1;
- return ip->error_flag;
- }
-
- /* FIXME: check for array type in ip->start_exp */
-
- /* create pointer temporary */
- ip->base_type = TREE_TYPE (array_type);
- ptr_type = build_pointer_type (ip->base_type);
- ip->loc_ptr_temp =
- build_temporary_variable ("loc_ptr_tmp", ptr_type);
-
- /* declare the user's iteration variable in
- the loop's scope, as an expression, to be
- passed to build_component_ref later */
- save_expr_under_name (ip->user_var,
- build1 (INDIRECT_REF, ip->base_type,
- ip->loc_ptr_temp));
-
- /* FIXME: see stor_layout */
- ip->step_temp = size_in_bytes (ip->base_type);
-
- temp = TYPE_DOMAIN (array_type);
-
- /* pointer to first array entry to look at */
- start_ptr = build1 (ADDR_EXPR, ptr_type, ip->start_exp);
- mark_addressable (ip->start_exp);
- ip->start_temp = ip->down_flag ?
- fold (build (PLUS_EXPR, ptr_type,
- start_ptr,
- fold (build (MULT_EXPR, integer_type_node, ip->step_temp,
- fold (build (MINUS_EXPR, integer_type_node,
- TYPE_MAX_VALUE (temp),
- TYPE_MIN_VALUE (temp)))))))
- : start_ptr;
- }
- else
- {
- tree array_length =
- convert (integer_type_node,
- build_component_ref (ip->start_exp, var_length_id));
- tree array_type = TREE_TYPE (TREE_CHAIN (
- TYPE_FIELDS (TREE_TYPE (ip->start_exp))));
- tree array_data_ptr =
- build_component_ref (ip->start_exp, var_data_id);
- tree ptr_type;
-
- if (TREE_CODE (TREE_TYPE (array_type)) == BOOLEAN_TYPE)
- {
- error ("Can't iterate through array of BOOL");
- firstp->error_flag = 1;
- return firstp->error_flag;
- }
-
- /* create pointer temporary */
- ip->base_type = TREE_TYPE (array_type);
- ptr_type = build_pointer_type (ip->base_type);
- ip->loc_ptr_temp =
- build_temporary_variable ("loc_ptr_temp", ptr_type);
-
-
- /* declare the user's iteration variable in
- the loop's scope, as an expression, to be
- passed to build_component_ref later */
- save_expr_under_name (ip->user_var,
- build1 (INDIRECT_REF, ip->base_type,
- ip->loc_ptr_temp));
-
- /* FIXME: see stor_layout */
- ip->step_temp = size_in_bytes (ip->base_type);
-
- /* pointer to first array entry to look at */
- start_ptr = build1 (ADDR_EXPR, ptr_type, array_data_ptr);
- mark_addressable (array_data_ptr);
- ip->start_temp = ip->down_flag ?
- fold (build (PLUS_EXPR, ptr_type,
- start_ptr,
- fold (build (MULT_EXPR, integer_type_node, ip->step_temp,
- fold (build (MINUS_EXPR, integer_type_node,
- array_length,
- integer_one_node))))))
- : start_ptr;
- }
- default:
- ;
- }
- }
- return firstp->error_flag;
-}
-
-/*
- * Initialize the hidden iteration-control variables,
- * and the user's explicit loop variable.
- */
-static int
-initialize_iter_var ()
-{
- ITERATOR *firstp = loop_stack->iter_list, *ip;
-
- for (ip = firstp; ip != NULL; ip = ip->next)
- {
- switch (ip->itype)
- {
- case DO_FOREVER:
- case DO_WHILE:
- break;
- case DO_STEP:
- case DO_RANGE:
- {
- tree count =
- fold (build (PLUS_EXPR, ip->iter_type, integer_one_node,
- fold (build (TRUNC_DIV_EXPR, ip->iter_type,
- convert (ip->iter_type,
- fold (build (MINUS_EXPR, ip->iter_type,
- ip->down_flag ? ip->start_temp : ip->end_temp,
- ip->down_flag ? ip->end_temp : ip->start_temp))),
- ip->step_temp))));
- /* initialize the loop's hidden counter variable */
- expand_expr_stmt (
- build_chill_modify_expr (ip->iter_var, count));
-
- /* initialize user's variable */
- expand_expr_stmt (
- build_chill_modify_expr (ip->user_var, ip->start_temp));
- }
- break;
- case DO_POWERSET:
- break;
- case DO_LOC:
- {
- tree array_type = TREE_TYPE (ip->start_exp);
- tree array_length =
- fold (build (TRUNC_DIV_EXPR, integer_type_node,
- size_in_bytes (array_type),
- size_in_bytes (TREE_TYPE (array_type))));
-
- expand_expr_stmt (
- build_chill_modify_expr (ip->iter_var, array_length));
- goto do_loc_common;
- }
-
- case DO_LOC_VARYING:
- expand_expr_stmt (
- build_chill_modify_expr (ip->iter_var,
- convert (integer_type_node,
- build_component_ref (ip->start_exp, var_length_id))));
-
- do_loc_common:
- expand_expr_stmt (
- build_chill_modify_expr (ip->loc_ptr_temp,
- ip->start_temp));
- break;
-
- default:
- ;
- }
- }
- return firstp->error_flag;
-}
-
-/* Generate code to skip the whole loop, if start expression not
- * <= end expression (or >= for DOWN loops). This comparison must
- * *NOT* be done in unsigned mode, or it will fail.
- * Also, skip processing an empty VARYING array.
- */
-static int
-maybe_skip_loop ()
-{
- ITERATOR *firstp = loop_stack->iter_list, *ip;
-
- for (ip = firstp; ip != NULL; ip = ip->next)
- {
- switch (ip->itype)
- {
- case DO_STEP:
- expand_start_cond (
- build (ip->down_flag ? GE_EXPR : LE_EXPR,
- TREE_TYPE (ip->start_exp),
- ip->start_exp, ip->end_exp), 0);
- break;
-
- case DO_LOC_VARYING:
- { tree array_length =
- convert (integer_type_node,
- build_component_ref (ip->start_exp, var_length_id));
- expand_start_cond (
- build (NE_EXPR, TREE_TYPE (array_length),
- array_length, integer_zero_node), 0);
- break;
- }
- default:
- break;
- }
- }
- return 0;
-}
-
-/*
- * Check at the top of the loop for a termination
- */
-static int
-top_loop_end_check ()
-{
- ITERATOR *firstp = loop_stack->iter_list, *ip;
-
- /* now, exit the loop if the condition isn't TRUE. */
- if (firstp->condition)
- {
- expand_exit_loop_if_false (0,
- chill_truthvalue_conversion (firstp->condition));
- }
-
- for (ip = firstp; ip != NULL; ip = ip->next)
- {
- switch (ip->itype)
- {
- case DO_FOREVER:
- case DO_WHILE:
- case DO_STEP:
- case DO_RANGE:
- break;
- case DO_POWERSET:
- {
- tree temp1;
- char *func_name;
-
- if (ip->down_flag)
- func_name = "__flsetclrpowerset";
- else
- func_name = "__ffsetclrpowerset";
-
- temp1 = TYPE_MIN_VALUE
- (TYPE_DOMAIN (TREE_TYPE (ip->powerset_temp)));
- expand_exit_loop_if_false (0,
- build_chill_function_call (lookup_name (get_identifier (func_name)),
- tree_cons (NULL_TREE, force_addr_of (ip->powerset_temp),
- tree_cons (NULL_TREE, powersetlen (ip->powerset_temp),
- tree_cons (NULL_TREE, force_addr_of (ip->user_var),
- tree_cons (NULL_TREE, size_in_bytes (TREE_TYPE (ip->user_var)),
- tree_cons (NULL_TREE,
- convert (long_integer_type_node, temp1),
- NULL_TREE)))))));
- }
- break;
- case DO_LOC:
- case DO_LOC_VARYING:
- break;
- default:
- ;
- }
- }
- return firstp->error_flag;
-}
-
-/*
- * Check generated temporaries for loop's end
- */
-static int
-bottom_loop_end_check ()
-{
- ITERATOR *firstp = loop_stack->iter_list, *ip;
-
- emit_line_note (input_filename, lineno);
-
- /* now, generate code to check each loop counter for termination */
- for (ip = firstp; ip != NULL; ip = ip->next)
- {
- switch (ip->itype)
- {
- case DO_FOREVER:
- case DO_WHILE:
- break;
- case DO_STEP:
- case DO_RANGE:
- case DO_LOC:
- case DO_LOC_VARYING:
- /* decrement iteration counter by one */
- chill_expand_assignment (ip->iter_var, MINUS_EXPR, integer_one_node);
- /* exit if it's zero */
- expand_exit_loop_if_false (0,
- build (NE_EXPR, boolean_type_node,
- ip->iter_var,
- integer_zero_node));
- break;
- case DO_POWERSET:
- break;
- default:
- ;
- }
- }
-
- return firstp->error_flag;
-}
-
-/*
- * increment the loop-control variables.
- */
-static int
-increment_temps ()
-{
- ITERATOR *firstp = loop_stack->iter_list, *ip;
-
- for (ip = firstp; ip != NULL; ip = ip->next)
- {
- switch (ip->itype)
- {
- case DO_FOREVER:
- case DO_WHILE:
- break;
- case DO_STEP:
- case DO_RANGE:
- {
- tree delta =
- fold (build (ip->down_flag ? MINUS_EXPR : PLUS_EXPR,
- TREE_TYPE (ip->user_var), ip->user_var,
- ip->step_temp));
- expand_expr_stmt (
- build_chill_modify_expr (ip->user_var, delta));
- }
- break;
- case DO_LOC:
- case DO_LOC_VARYING:
- /* This statement uses the C semantics, so that
- the pointer is actually incremented by the
- length of the object pointed to. */
-#if 1
- expand_expr_stmt (
- build_modify_expr (ip->loc_ptr_temp,
- ip->down_flag ? MINUS_EXPR : PLUS_EXPR,
- integer_one_node));
-#else
- {
- enum tree_code op = ip->down_flag ? MINUS_EXPR : PLUS_EXPR;
- tree el_type = TREE_TYPE (TREE_TYPE (ip->loc_ptr_temp));
- chill_expand_assignment (ip->loc_ptr_temp, NOP_EXPR,
- build (op,
- TREE_TYPE (ip->loc_ptr_temp),
- ip->loc_ptr_temp,
- size_in_bytes (el_type)));
- }
-#endif
- break;
- case DO_POWERSET:
- break;
- default:
- ;
- }
- }
- return firstp->error_flag;
-}
-
-/*
- * Generate a (temporary) unique identifier_node of
- * the form "__tmp_%s_%d"
- */
-tree
-get_unique_identifier (lead)
- char *lead;
-{
- char idbuf [256];
- static int idcount = 0;
-
- sprintf (idbuf, "__tmp_%s_%d", lead ? lead : "", idcount++);
- return get_identifier (idbuf);
-}
-
-/*
- * build a temporary variable, given its NAME and TYPE.
- * The name will have a number appended to assure uniqueness.
- * return its DECL node.
- */
-static tree
-build_temporary_variable (name, type)
- char *name;
- tree type;
-{
- return decl_temp1 (get_unique_identifier (name), type, 0, NULL_TREE, 0, 0);
-}
-
-
-/*
- * If the given expression isn't a constant, build a temp for it
- * and evaluate the expression into the temp. Return the tree
- * representing either the original constant expression or the
- * temp which now contains the expression's value.
- */
-static tree
-maybe_make_for_temp (exp, temp_name, exp_type)
- tree exp;
- char *temp_name;
- tree exp_type;
-{
- tree result = exp;
-
- if (exp != NULL_TREE)
- {
- /* if exp isn't constant, create a temporary for its value */
- if (TREE_CONSTANT (exp))
- {
- /* FIXME: assure that TREE_TYPE (result) == ip->exp_type */
- result = convert (exp_type, exp);
- }
- else {
- /* build temp, assign the value */
- result = decl_temp1 (get_unique_identifier (temp_name), exp_type, 0,
- exp, 0, 0);
- }
- }
- return result;
-}
-
-
-/*
- * Adapt the C unsigned_type function to CHILL - we need to
- * account for any CHILL-specific integer types here. So far,
- * the 16-bit integer type is the only one.
- */
-static tree
-chill_unsigned_type (type)
- tree type;
-{
- extern tree chill_unsigned_type_node;
- tree type1 = TYPE_MAIN_VARIANT (type);
-
- if (type1 == chill_integer_type_node)
- return chill_unsigned_type_node;
- else
- return unsigned_type (type);
-}
diff --git a/gcc/ch/parse.c b/gcc/ch/parse.c
deleted file mode 100644
index afcf1427fd8..00000000000
--- a/gcc/ch/parse.c
+++ /dev/null
@@ -1,4332 +0,0 @@
-/* Parser for GNU CHILL (CCITT High-Level Language) -*- C -*-
- Copyright (C) 1992, 1993, 1998, 1999, 2000, 2001
- Free Software Foundation, Inc.
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/*
- * This is a two-pass parser. In pass 1, we collect declarations,
- * ignoring actions and most expressions. We store only the
- * declarations and close, open and re-lex the input file to save
- * main memory. We anticipate that the compiler will be processing
- * *very* large single programs which are mechanically generated,
- * and so we want to store a minimum of information between passes.
- *
- * yylex detects the end of the main input file and returns the
- * END_PASS_1 token. We then re-initialize each CHILL compiler
- * module's global variables and re-process the input file. The
- * grant file is output. If the user has requested it, GNU CHILL
- * exits at this time - its only purpose was to generate the grant
- * file. Optionally, the compiler may exit if errors were detected
- * in pass 1.
- *
- * As each symbol scope is entered, we install its declarations into
- * the symbol table. Undeclared types and variables are announced
- * now.
- *
- * Then code is generated.
- */
-
-#include "config.h"
-#include "system.h"
-#include "tree.h"
-#include "ch-tree.h"
-#include "lex.h"
-#include "actions.h"
-#include "tasking.h"
-#include "parse.h"
-#include "toplev.h"
-
-/* Since parsers are distinct for each language, put the
- language string definition here. (fnf) */
-const char * const language_string = "GNU CHILL";
-
-/* Common code to be done before expanding any action. */
-#define INIT_ACTION { \
- if (! ignoring) emit_line_note (input_filename, lineno); }
-
-/* Pop a scope for an ON handler. */
-#define POP_USED_ON_CONTEXT pop_handler(1)
-
-/* Pop a scope for an ON handler that wasn't there. */
-#define POP_UNUSED_ON_CONTEXT pop_handler(0)
-
-#define PUSH_ACTION push_action()
-
-/* Cause the `yydebug' variable to be defined. */
-#define YYDEBUG 1
-
-extern struct rtx_def* gen_label_rtx PARAMS ((void));
-extern void emit_jump PARAMS ((struct rtx_def *));
-extern struct rtx_def* emit_label PARAMS ((struct rtx_def *));
-
-/* This is a hell of a lot easier than getting expr.h included in
- by parse.c. */
-extern struct rtx_def *expand_expr PARAMS ((tree, struct rtx_def *,
- enum machine_mode, int));
-
-static int parse_action PARAMS ((void));
-static void ch_parse_init PARAMS ((void));
-static void check_end_label PARAMS ((tree, tree));
-static void end_function PARAMS ((void));
-static tree build_prefix_clause PARAMS ((tree));
-static enum terminal PEEK_TOKEN PARAMS ((void));
-static int peek_token_ PARAMS ((int));
-static void pushback_token PARAMS ((int, tree));
-static void forward_token_ PARAMS ((void));
-static void require PARAMS ((enum terminal));
-static int check_token PARAMS ((enum terminal));
-static int expect PARAMS ((enum terminal, const char *));
-static void define__PROCNAME__ PARAMS ((void));
-
-extern int lineno;
-extern tree generic_signal_type_node;
-extern tree signal_code;
-extern int all_static_flag;
-extern int ignore_case;
-
-#if 0
-static int quasi_signal = 0; /* 1 if processing a quasi signal decl */
-#endif
-
-int parsing_newmode; /* 0 while parsing SYNMODE;
- 1 while parsing NEWMODE. */
-int expand_exit_needed = 0;
-
-/* Gets incremented if we see errors such that we don't want to run pass 2. */
-
-int serious_errors = 0;
-
-static tree current_fieldlist;
-
-/* We don't care about expressions during pass 1, except while we're
- parsing the RHS of a SYN definition, or while parsing a mode that
- we need. NOTE: This also causes mode expressions to be ignored. */
-int ignoring = 1; /* 1 to ignore expressions */
-
-/* True if we have seen an action not in a (user) function. */
-int seen_action = 0;
-int build_constructor = 0;
-
-/* The action_nesting_level of the current procedure body. */
-int proc_action_level = 0;
-
-/* This is the identifier of the label that prefixes the current action,
- or NULL if there was none. It is cleared at the end of an action,
- or when starting a nested action list, so get it while you can! */
-static tree label = NULL_TREE; /* for statement labels */
-
-#if 0
-static tree current_block;
-#endif
-
-int in_pseudo_module = 0;
-int pass = 0; /* 0 for init_decl_processing,
- 1 for pass 1, 2 for pass 2 */
-
-/* re-initialize global variables for pass 2 */
-static void
-ch_parse_init ()
-{
- expand_exit_needed = 0;
- label = NULL_TREE; /* for statement labels */
- current_module = NULL;
- in_pseudo_module = 0;
-}
-
-static void
-check_end_label (start, end)
- tree start, end;
-{
- if (end != NULL_TREE)
- {
- if (start == NULL_TREE && pass == 1)
- error ("there was no start label to match the end label '%s'",
- IDENTIFIER_POINTER(end));
- else if (start != end && pass == 1)
- error ("start label '%s' does not match end label '%s'",
- IDENTIFIER_POINTER(start),
- IDENTIFIER_POINTER(end));
- }
-}
-
-
-/*
- * given a tree which is an id, a type or a decl,
- * return the associated type, or issue an error and
- * return error_mark_node.
- */
-tree
-get_type_of (id_or_decl)
- tree id_or_decl;
-{
- tree type = id_or_decl;
-
- if (id_or_decl == NULL_TREE
- || TREE_CODE (id_or_decl) == ERROR_MARK)
- return error_mark_node;
-
- if (pass == 1 || ignoring == 1)
- return id_or_decl;
-
- if (TREE_CODE (type) == IDENTIFIER_NODE)
- {
- type = lookup_name (id_or_decl);
- if (type == NULL_TREE)
- {
- error ("`%s' not declared", IDENTIFIER_POINTER (id_or_decl));
- type = error_mark_node;
- }
- }
- if (TREE_CODE (type) == TYPE_DECL)
- type = TREE_TYPE (type);
- return type; /* was a type all along */
-}
-
-
-static void
-end_function ()
-{
- if (CH_DECL_PROCESS (current_function_decl))
- {
- /* finishing a process */
- if (! ignoring)
- {
- tree result =
- build_chill_function_call
- (lookup_name (get_identifier ("__stop_process")),
- NULL_TREE);
- expand_expr_stmt (result);
- emit_line_note (input_filename, lineno);
- }
- }
- else
- {
- /* finishing a procedure.. */
- if (! ignoring)
- {
- if (result_never_set
- && TREE_CODE (TREE_TYPE (TREE_TYPE (current_function_decl)))
- != VOID_TYPE)
- warning ("No RETURN or RESULT in procedure");
- chill_expand_return (NULL_TREE, 1);
- }
- }
- finish_chill_function ();
- pop_chill_function_context ();
-}
-
-static tree
-build_prefix_clause (id)
- tree id;
-{
- if (!id)
- {
- if (current_module && current_module->name)
- { const char *module_name = IDENTIFIER_POINTER (current_module->name);
- if (module_name[0] && module_name[0] != '_')
- return current_module->name;
- }
- error ("PREFIXED clause with no prelix in unlabeled module");
- }
- return id;
-}
-
-void
-possibly_define_exit_label (label)
- tree label;
-{
- if (label)
- define_label (input_filename, lineno, munge_exit_label (label));
-}
-
-#define MAX_LOOK_AHEAD 2
-static enum terminal terminal_buffer[MAX_LOOK_AHEAD+1];
-YYSTYPE yylval;
-static YYSTYPE val_buffer[MAX_LOOK_AHEAD+1];
-
-/*enum terminal current_token, lookahead_token;*/
-
-#define TOKEN_NOT_READ dummy_last_terminal
-
-#ifdef __GNUC__
-__inline__
-#endif
-static enum terminal
-PEEK_TOKEN()
-{
- if (terminal_buffer[0] == TOKEN_NOT_READ)
- {
- terminal_buffer[0] = yylex();
- val_buffer[0] = yylval;
- }
- return terminal_buffer[0];
-}
-#define PEEK_TREE() val_buffer[0].ttype
-#define PEEK_TOKEN1() peek_token_ (1)
-#define PEEK_TOKEN2() peek_token_ (2)
-
-static int
-peek_token_ (i)
- int i;
-{
- if (i > MAX_LOOK_AHEAD)
- abort ();
- if (terminal_buffer[i] == TOKEN_NOT_READ)
- {
- terminal_buffer[i] = yylex();
- val_buffer[i] = yylval;
- }
- return terminal_buffer[i];
-}
-
-static void
-pushback_token (code, node)
- int code;
- tree node;
-{
- int i;
- if (terminal_buffer[MAX_LOOK_AHEAD] != TOKEN_NOT_READ)
- abort ();
- for (i = MAX_LOOK_AHEAD; i > 0; i--)
- {
- terminal_buffer[i] = terminal_buffer[i - 1];
- val_buffer[i] = val_buffer[i - 1];
- }
- terminal_buffer[0] = code;
- val_buffer[0].ttype = node;
-}
-
-static void
-forward_token_()
-{
- int i;
- for (i = 0; i < MAX_LOOK_AHEAD; i++)
- {
- terminal_buffer[i] = terminal_buffer[i+1];
- val_buffer[i] = val_buffer[i+1];
- }
- terminal_buffer[MAX_LOOK_AHEAD] = TOKEN_NOT_READ;
-}
-#define FORWARD_TOKEN() forward_token_ ()
-
-/* Skip the next token.
- if it isn't TOKEN, the parser is broken. */
-
-static void
-require (token)
- enum terminal token;
-{
- if (PEEK_TOKEN() != token)
- internal_error ("internal parser error - expected token %d", (int) token);
- FORWARD_TOKEN();
-}
-
-static int
-check_token (token)
- enum terminal token;
-{
- if (PEEK_TOKEN() != token)
- return 0;
- FORWARD_TOKEN ();
- return 1;
-}
-
-/* return 0 if expected token was not found,
- else return 1.
-*/
-static int
-expect(token, message)
- enum terminal token;
- const char *message;
-{
- if (PEEK_TOKEN() != token)
- {
- if (pass == 1)
- error("%s", message ? message : "syntax error");
- return 0;
- }
- else
- FORWARD_TOKEN();
- return 1;
-}
-
-/* define a SYNONYM __PROCNAME__ (__procname__) which holds
- the name of the current procedure.
- This should be quit the same as __FUNCTION__ in C */
-static void
-define__PROCNAME__ ()
-{
- const char *fname;
- tree string;
- tree procname;
-
- if (current_function_decl == NULL_TREE)
- fname = "toplevel";
- else
- fname = IDENTIFIER_POINTER (DECL_NAME (current_function_decl));
-
- string = build_chill_string (strlen (fname), fname);
- procname = get_identifier (ignore_case ? "__procname__" : "__PROCNAME__");
- push_syndecl (procname, NULL_TREE, string);
-}
-
-/* Forward declarations. */
-static tree parse_expression PARAMS ((void));
-static tree parse_primval PARAMS ((void));
-static tree parse_mode PARAMS ((void));
-static tree parse_opt_mode PARAMS ((void));
-static tree parse_untyped_expr PARAMS ((void));
-static tree parse_opt_untyped_expr PARAMS ((void));
-static int parse_definition PARAMS ((int));
-static void parse_opt_actions PARAMS ((void));
-static void parse_body PARAMS ((void));
-static tree parse_if_expression_body PARAMS ((void));
-static tree parse_opt_handler PARAMS ((void));
-static tree parse_opt_name_string PARAMS ((int));
-static tree parse_simple_name_string PARAMS ((void));
-static tree parse_name_string PARAMS ((void));
-static tree parse_defining_occurrence PARAMS ((void));
-static tree parse_name PARAMS ((void));
-static tree parse_optlabel PARAMS ((void));
-static void parse_opt_end_label_semi_colon PARAMS ((tree));
-static void parse_modulion PARAMS ((tree));
-static void parse_spec_module PARAMS ((tree));
-static void parse_semi_colon PARAMS ((void));
-static tree parse_defining_occurrence_list PARAMS ((void));
-static void parse_mode_definition PARAMS ((int));
-static void parse_mode_definition_statement PARAMS ((int));
-static void parse_synonym_definition PARAMS ((void));
-static void parse_synonym_definition_statement PARAMS ((void));
-static tree parse_on_exception_list PARAMS ((void));
-static void parse_on_alternatives PARAMS ((void));
-static void parse_loc_declaration PARAMS ((int));
-static void parse_declaration_statement PARAMS ((int));
-static tree parse_optforbid PARAMS ((void));
-static tree parse_postfix PARAMS ((enum terminal));
-static tree parse_postfix_list PARAMS ((enum terminal));
-static void parse_rename_clauses PARAMS ((enum terminal));
-static tree parse_opt_prefix_clause PARAMS ((void));
-static void parse_grant_statement PARAMS ((void));
-static void parse_seize_statement PARAMS ((void));
-static tree parse_param_name_list PARAMS ((void));
-static tree parse_param_attr PARAMS ((void));
-static tree parse_formpar PARAMS ((void));
-static tree parse_formparlist PARAMS ((void));
-static tree parse_opt_result_spec PARAMS ((void));
-static tree parse_opt_except PARAMS ((void));
-static tree parse_opt_recursive PARAMS ((void));
-static tree parse_procedureattr PARAMS ((void));
-static void parse_proc_body PARAMS ((tree, tree));
-static void parse_procedure_definition PARAMS ((int));
-static tree parse_processpar PARAMS ((void));
-static tree parse_processparlist PARAMS ((void));
-static void parse_process_definition PARAMS ((int));
-static void parse_signal_definition PARAMS ((void));
-static void parse_signal_definition_statement PARAMS ((void));
-static void parse_then_clause PARAMS ((void));
-static void parse_opt_else_clause PARAMS ((void));
-static tree parse_expr_list PARAMS ((void));
-static tree parse_range_list_clause PARAMS ((void));
-static void pushback_paren_expr PARAMS ((tree));
-static tree parse_case_label PARAMS ((void));
-static tree parse_case_label_list PARAMS ((tree, int));
-static tree parse_case_label_specification PARAMS ((tree));
-static void parse_single_dimension_case_action PARAMS ((tree));
-static void parse_multi_dimension_case_action PARAMS ((tree));
-static void parse_case_action PARAMS ((tree));
-static tree parse_asm_operands PARAMS ((void));
-static tree parse_asm_clobbers PARAMS ((void));
-static void ch_expand_asm_operands PARAMS ((tree, tree, tree, tree,
- int, const char *, int));
-static void parse_asm_action PARAMS ((void));
-static void parse_begin_end_block PARAMS ((tree));
-static void parse_if_action PARAMS ((tree));
-static void parse_iteration PARAMS ((void));
-static tree parse_delay_case_event_list PARAMS ((void));
-static void parse_delay_case_action PARAMS ((tree));
-static void parse_do_action PARAMS ((tree));
-static tree parse_receive_spec PARAMS ((void));
-static void parse_receive_case_action PARAMS ((tree));
-static void parse_send_action PARAMS ((void));
-static void parse_start_action PARAMS ((void));
-static tree parse_call PARAMS ((tree));
-static tree parse_tuple_fieldname_list PARAMS ((void));
-static tree parse_tuple_element PARAMS ((void));
-static tree parse_opt_element_list PARAMS ((void));
-static tree parse_tuple PARAMS ((tree));
-static tree parse_operand6 PARAMS ((void));
-static tree parse_operand5 PARAMS ((void));
-static tree parse_operand4 PARAMS ((void));
-static tree parse_operand3 PARAMS ((void));
-static tree parse_operand2 PARAMS ((void));
-static tree parse_operand1 PARAMS ((void));
-static tree parse_operand0 PARAMS ((void));
-static tree parse_case_expression PARAMS ((void));
-static tree parse_then_alternative PARAMS ((void));
-static tree parse_else_alternative PARAMS ((void));
-static tree parse_if_expression PARAMS ((void));
-static tree parse_index_mode PARAMS ((void));
-static tree parse_set_mode PARAMS ((void));
-static tree parse_pos PARAMS ((void));
-static tree parse_step PARAMS ((void));
-static tree parse_opt_layout PARAMS ((int));
-static tree parse_field_name_list PARAMS ((void));
-static tree parse_fixed_field PARAMS ((void));
-static tree parse_variant_field_list PARAMS ((void));
-static tree parse_variant_alternative PARAMS ((void));
-static tree parse_field PARAMS ((void));
-static tree parse_structure_mode PARAMS ((void));
-static tree parse_opt_queue_size PARAMS ((void));
-static tree parse_procedure_mode PARAMS ((void));
-static void parse_program PARAMS ((void));
-static void parse_pass_1_2 PARAMS ((void));
-
-static tree
-parse_opt_name_string (allow_all)
- int allow_all; /* 1 if ALL is allowed as a postfix */
-{
- enum terminal token = PEEK_TOKEN();
- tree name;
- if (token != NAME)
- {
- if (token == ALL && allow_all)
- {
- FORWARD_TOKEN ();
- return ALL_POSTFIX;
- }
- return NULL_TREE;
- }
- name = PEEK_TREE();
- for (;;)
- {
- FORWARD_TOKEN ();
- token = PEEK_TOKEN();
- if (token != '!')
- return name;
- FORWARD_TOKEN();
- token = PEEK_TOKEN();
- if (token == ALL && allow_all)
- return get_identifier3(IDENTIFIER_POINTER (name), "!", "*");
- if (token != NAME)
- {
- if (pass == 1)
- error ("'%s!' is not followed by an identifier",
- IDENTIFIER_POINTER (name));
- return name;
- }
- name = get_identifier3(IDENTIFIER_POINTER(name),
- "!", IDENTIFIER_POINTER(PEEK_TREE()));
- }
-}
-
-static tree
-parse_simple_name_string ()
-{
- enum terminal token = PEEK_TOKEN();
- tree name;
- if (token != NAME)
- {
- error ("expected a name here");
- return error_mark_node;
- }
- name = PEEK_TREE ();
- FORWARD_TOKEN ();
- return name;
-}
-
-static tree
-parse_name_string ()
-{
- tree name = parse_opt_name_string (0);
- if (name)
- return name;
- if (pass == 1)
- error ("expected a name string here");
- return error_mark_node;
-}
-
-static tree
-parse_defining_occurrence ()
-{
- if (PEEK_TOKEN () == NAME)
- {
- tree id = PEEK_TREE();
- FORWARD_TOKEN ();
- return id;
- }
- return NULL;
-}
-
-/* Matches: <name_string>
- Returns if pass 1: the identifier.
- Returns if pass 2: a decl or value for identifier. */
-
-static tree
-parse_name ()
-{
- tree name = parse_name_string ();
- if (pass == 1 || ignoring)
- return name;
- else
- {
- tree decl = lookup_name (name);
- if (decl == NULL_TREE)
- {
- error ("`%s' undeclared", IDENTIFIER_POINTER (name));
- return error_mark_node;
- }
- else if (TREE_CODE (TREE_TYPE (decl)) == ERROR_MARK)
- return error_mark_node;
- else if (TREE_CODE (decl) == CONST_DECL)
- return DECL_INITIAL (decl);
- else if (TREE_CODE (TREE_TYPE (decl)) == REFERENCE_TYPE)
- return convert_from_reference (decl);
- else
- return decl;
- }
-}
-
-static tree
-parse_optlabel()
-{
- tree label = parse_defining_occurrence();
- if (label != NULL)
- expect(COLON, "expected a ':' here");
- return label;
-}
-
-static void
-parse_semi_colon ()
-{
- enum terminal token = PEEK_TOKEN ();
- if (token == SC)
- FORWARD_TOKEN ();
- else if (pass == 1)
- (token == END ? pedwarn : error) ("expected ';' here");
- label = NULL_TREE;
-}
-
-static void
-parse_opt_end_label_semi_colon (start_label)
- tree start_label;
-{
- if (PEEK_TOKEN() == NAME)
- {
- tree end_label = parse_name_string ();
- check_end_label (start_label, end_label);
- }
- parse_semi_colon ();
-}
-
-static void
-parse_modulion (label)
- tree label;
-{
- tree module_name;
-
- label = set_module_name (label);
- module_name = push_module (label, 0);
- FORWARD_TOKEN();
-
- push_action ();
- parse_body();
- expect(END, "expected END here");
- parse_opt_handler ();
- parse_opt_end_label_semi_colon (label);
- find_granted_decls ();
- pop_module ();
-}
-
-static void
-parse_spec_module (label)
- tree label;
-{
- int save_ignoring = ignoring;
-
- push_module (set_module_name (label), 1);
- ignoring = pass == 2;
- FORWARD_TOKEN(); /* SKIP SPEC */
- expect (MODULE, "expected 'MODULE' here");
-
- while (parse_definition (1)) { }
- if (parse_action ())
- error ("action not allowed in SPEC MODULE");
- expect(END, "expected END here");
- parse_opt_end_label_semi_colon (label);
- find_granted_decls ();
- pop_module ();
- ignoring = save_ignoring;
-}
-
-/* Matches: <name_string> ( "," <name_string> )*
- Returns either a single IDENTIFIER_NODE,
- or a chain (TREE_LIST) of IDENTIFIER_NODES.
- (Since a single identifier is the common case, we avoid wasting space
- (twice, once for each pass) with extra TREE_LIST nodes in that case.)
- (Will not return NULL_TREE even if ignoring is true.) */
-
-static tree
-parse_defining_occurrence_list ()
-{
- tree chain = NULL_TREE;
- tree name = parse_defining_occurrence ();
- if (name == NULL_TREE)
- {
- error("missing defining occurrence");
- return NULL_TREE;
- }
- if (! check_token (COMMA))
- return name;
- chain = build_tree_list (NULL_TREE, name);
- for (;;)
- {
- name = parse_defining_occurrence ();
- if (name == NULL)
- {
- error ("bad defining occurrence following ','");
- break;
- }
- chain = tree_cons (NULL_TREE, name, chain);
- if (! check_token (COMMA))
- break;
- }
- return nreverse (chain);
-}
-
-static void
-parse_mode_definition (is_newmode)
- int is_newmode;
-{
- tree mode, names;
- int save_ignoring = ignoring;
- ignoring = pass == 2;
- names = parse_defining_occurrence_list ();
- expect (EQL, "missing '=' in mode definition");
- mode = parse_mode ();
- if (names == NULL_TREE || TREE_CODE (names) == TREE_LIST)
- {
- for ( ; names != NULL_TREE; names = TREE_CHAIN (names))
- push_modedef (names, mode, is_newmode);
- }
- else
- push_modedef (names, mode, is_newmode);
- ignoring = save_ignoring;
-}
-
-static void
-parse_mode_definition_statement (is_newmode)
- int is_newmode;
-{
- FORWARD_TOKEN (); /* skip SYNMODE or NEWMODE */
- parse_mode_definition (is_newmode);
- while (PEEK_TOKEN () == COMMA)
- {
- FORWARD_TOKEN ();
- parse_mode_definition (is_newmode);
- }
- parse_semi_colon ();
-}
-
-static void
-parse_synonym_definition ()
-{ tree expr = NULL_TREE;
- tree names = parse_defining_occurrence_list ();
- tree mode = parse_opt_mode ();
- if (! expect (EQL, "missing '=' in synonym definition"))
- mode = error_mark_node;
- else
- {
- if (mode)
- expr = parse_untyped_expr ();
- else
- expr = parse_expression ();
- }
- if (names == NULL_TREE || TREE_CODE (names) == TREE_LIST)
- {
- for ( ; names != NULL_TREE; names = TREE_CHAIN (names))
- push_syndecl (names, mode, expr);
- }
- else
- push_syndecl (names, mode, expr);
-}
-
-static void
-parse_synonym_definition_statement()
-{
- int save_ignoring= ignoring;
- ignoring = pass == 2;
- require (SYN);
- parse_synonym_definition ();
- while (PEEK_TOKEN () == COMMA)
- {
- FORWARD_TOKEN ();
- parse_synonym_definition ();
- }
- ignoring = save_ignoring;
- parse_semi_colon ();
-}
-
-/* Attempts to match: "(" <exception list> ")" ":".
- Return NULL_TREE on failure, and non-NULL on success.
- On success, if pass 1, return a TREE_LIST of IDENTIFIER_NODEs. */
-
-static tree
-parse_on_exception_list ()
-{
- tree name;
- tree list = NULL_TREE;
- int tok1 = PEEK_TOKEN ();
- int tok2 = PEEK_TOKEN1 ();
-
- /* This requires a lot of look-ahead, because we cannot
- easily a priori distinguish an exception-list from an expression. */
- if (tok1 != LPRN || tok2 != NAME)
- {
- if (tok1 == NAME && tok2 == COLON && pass == 1)
- error ("missing '(' in exception list");
- return 0;
- }
- require (LPRN);
- name = parse_name_string ();
- if (PEEK_TOKEN () == RPRN && PEEK_TOKEN1 () == COLON)
- {
- /* Matched: '(' <name_string> ')' ':' */
- FORWARD_TOKEN (); FORWARD_TOKEN ();
- return pass == 1 ? build_tree_list (NULL_TREE, name) : name;
- }
- if (PEEK_TOKEN() == COMMA)
- {
- if (pass == 1)
- list = build_tree_list (NULL_TREE, name);
- while (check_token (COMMA))
- {
- tree old_names = list;
- name = parse_name_string ();
- if (pass == 1)
- {
- for ( ; old_names != NULL_TREE; old_names = TREE_CHAIN (old_names))
- {
- if (TREE_VALUE (old_names) == name)
- {
- error ("ON exception names must be unique");
- goto continue_parsing;
- }
- }
- list = tree_cons (NULL_TREE, name, list);
- continue_parsing:
- ;
- }
- }
- if (! check_token (RPRN) || ! check_token(COLON))
- error ("syntax error in exception list");
- return pass == 1 ? nreverse (list) : name;
- }
- /* Matched: '(' name_string
- but it doesn't match the syntax of an exception list.
- It could be the beginning of an expression, so back up. */
- pushback_token (NAME, name);
- pushback_token (LPRN, 0);
- return NULL_TREE;
-}
-
-static void
-parse_on_alternatives ()
-{
- for (;;)
- {
- tree except_list = parse_on_exception_list ();
- if (except_list != NULL)
- chill_handle_on_labels (except_list);
- else if (parse_action ())
- expand_exit_needed = 1;
- else
- break;
- }
-}
-
-static tree
-parse_opt_handler ()
-{
- if (! check_token (ON))
- {
- POP_UNUSED_ON_CONTEXT;
- return NULL_TREE;
- }
- if (check_token (END))
- {
- pedwarn ("empty ON-condition");
- POP_UNUSED_ON_CONTEXT;
- return NULL_TREE;
- }
- if (! ignoring)
- {
- chill_start_on ();
- expand_exit_needed = 0;
- }
- if (PEEK_TOKEN () != ELSE)
- {
- parse_on_alternatives ();
- if (! ignoring && expand_exit_needed)
- expand_exit_something ();
- }
- if (check_token (ELSE))
- {
- chill_start_default_handler ();
- label = NULL_TREE;
- parse_opt_actions ();
- if (! ignoring)
- {
- emit_line_note (input_filename, lineno);
- expand_exit_something ();
- }
- }
- expect (END, "missing 'END' after");
- if (! ignoring)
- chill_finish_on ();
- POP_USED_ON_CONTEXT;
- return integer_zero_node;
-}
-
-static void
-parse_loc_declaration (in_spec_module)
- int in_spec_module;
-{
- tree names = parse_defining_occurrence_list ();
- int save_ignoring = ignoring;
- int is_static, lifetime_bound;
- tree mode, init_value = NULL_TREE;
- int loc_decl = 0;
-
- ignoring = pass == 2;
- mode = parse_mode ();
- ignoring = save_ignoring;
- is_static = check_token (STATIC);
- if (check_token (BASED))
- {
- expect(LPRN, "BASED must be followed by (NAME)");
- do_based_decls (names, mode, parse_name_string ());
- expect(RPRN, "BASED must be followed by (NAME)");
- return;
- }
- if (check_token (LOC))
- {
- /* loc-identity declaration */
- if (pass == 1)
- mode = build_chill_reference_type (mode);
- loc_decl = 1;
- }
- lifetime_bound = check_token (INIT);
- if (lifetime_bound && loc_decl)
- {
- if (pass == 1)
- error ("INIT not allowed at loc-identity declaration");
- lifetime_bound = 0;
- }
- if (PEEK_TOKEN () == ASGN || PEEK_TOKEN() == EQL)
- {
- save_ignoring = ignoring;
- ignoring = pass == 1;
- if (PEEK_TOKEN() == EQL)
- {
- if (pass == 1)
- error ("'=' used where ':=' is required");
- }
- FORWARD_TOKEN();
- if (! lifetime_bound)
- push_handler ();
- init_value = parse_untyped_expr ();
- if (in_spec_module)
- {
- error ("initialization is not allowed in spec module");
- init_value = NULL_TREE;
- }
- if (! lifetime_bound)
- parse_opt_handler ();
- ignoring = save_ignoring;
- }
- if (init_value == NULL_TREE && loc_decl && pass == 1)
- error ("loc-identity declaration without initialisation");
- do_decls (names, mode,
- is_static || global_bindings_p ()
- /* the variable becomes STATIC if all_static_flag is set and
- current functions doesn't have the RECURSIVE attribute */
- || (all_static_flag && !CH_DECL_RECURSIVE (current_function_decl)),
- lifetime_bound, init_value, in_spec_module);
-
- /* Free any temporaries we made while initializing the decl. */
- free_temp_slots ();
-}
-
-static void
-parse_declaration_statement (in_spec_module)
- int in_spec_module;
-{
- int save_ignoring = ignoring;
- ignoring = pass == 2;
- require (DCL);
- parse_loc_declaration (in_spec_module);
- while (PEEK_TOKEN () == COMMA)
- {
- FORWARD_TOKEN ();
- parse_loc_declaration (in_spec_module);
- }
- ignoring = save_ignoring;
- parse_semi_colon ();
-}
-
-static tree
-parse_optforbid ()
-{
- if (check_token (FORBID) == 0)
- return NULL_TREE;
- if (check_token (ALL))
- return ignoring ? NULL_TREE : build_int_2 (-1, -1);
-#if 0
- if (check_token (LPRN))
- {
- tree list = parse_forbidlist ();
- expect (RPRN, "missing ')' after FORBID list");
- return list;
- }
-#endif
- error ("bad syntax following FORBID");
- return NULL_TREE;
-}
-
-/* Matches: <grant postfix> or <seize postfix>
- Returns: A (singleton) TREE_LIST. */
-
-static tree
-parse_postfix (grant_or_seize)
- enum terminal grant_or_seize;
-{
- tree name = parse_opt_name_string (1);
- tree forbid = NULL_TREE;
- if (name == NULL_TREE)
- {
- error ("expected a postfix name here");
- name = error_mark_node;
- }
- if (grant_or_seize == GRANT)
- forbid = parse_optforbid ();
- return build_tree_list (forbid, name);
-}
-
-static tree
-parse_postfix_list (grant_or_seize)
- enum terminal grant_or_seize;
-{
- tree list = parse_postfix (grant_or_seize);
- while (check_token (COMMA))
- list = chainon (list, parse_postfix (grant_or_seize));
- return list;
-}
-
-static void
-parse_rename_clauses (grant_or_seize)
- enum terminal grant_or_seize;
-{
- for (;;)
- {
- tree rename_old_prefix, rename_new_prefix, postfix;
- require (LPRN);
- rename_old_prefix = parse_opt_name_string (0);
- expect (ARROW, "missing '->' in rename clause");
- rename_new_prefix = parse_opt_name_string (0);
- expect (RPRN, "missing ')' in rename clause");
- expect ('!', "missing '!' in rename clause");
- postfix = parse_postfix (grant_or_seize);
-
- if (grant_or_seize == GRANT)
- chill_grant (rename_old_prefix, rename_new_prefix,
- TREE_VALUE (postfix), TREE_PURPOSE (postfix));
- else
- chill_seize (rename_old_prefix, rename_new_prefix,
- TREE_VALUE (postfix));
-
- if (PEEK_TOKEN () != COMMA)
- break;
- FORWARD_TOKEN ();
- if (PEEK_TOKEN () != LPRN)
- {
- error ("expected another rename clause");
- break;
- }
- }
-}
-
-static tree
-parse_opt_prefix_clause ()
-{
- if (check_token (PREFIXED) == 0)
- return NULL_TREE;
- return build_prefix_clause (parse_opt_name_string (0));
-}
-
-static void
-parse_grant_statement ()
-{
- require (GRANT);
- if (PEEK_TOKEN () == LPRN)
- parse_rename_clauses (GRANT);
- else
- {
- tree window = parse_postfix_list (GRANT);
- tree new_prefix = parse_opt_prefix_clause ();
- tree t;
- for (t = window; t; t = TREE_CHAIN (t))
- chill_grant (NULL_TREE, new_prefix, TREE_VALUE (t), TREE_PURPOSE (t));
- }
-}
-
-static void
-parse_seize_statement ()
-{
- require (SEIZE);
- if (PEEK_TOKEN () == LPRN)
- parse_rename_clauses (SEIZE);
- else
- {
- tree seize_window = parse_postfix_list (SEIZE);
- tree old_prefix = parse_opt_prefix_clause ();
- tree t;
- for (t = seize_window; t; t = TREE_CHAIN (t))
- chill_seize (old_prefix, NULL_TREE, TREE_VALUE (t));
- }
-}
-
-/* In pass 1, this returns a TREE_LIST, one node for each parameter.
- In pass 2, we get a list of PARM_DECLs chained together.
- In either case, the list is in reverse order. */
-
-static tree
-parse_param_name_list ()
-{
- tree list = NULL_TREE;
- do
- {
- tree new_link;
- tree name = parse_defining_occurrence ();
- if (name == NULL_TREE)
- {
- error ("syntax error in parameter name list");
- return list;
- }
- if (pass == 1)
- new_link = build_tree_list (NULL_TREE, name);
- /* else if (current_module->is_spec_module) ; nothing */
- else /* pass == 2 */
- {
- new_link = make_node (PARM_DECL);
- DECL_NAME (new_link) = name;
- DECL_ASSEMBLER_NAME (new_link) = name;
- }
-
- TREE_CHAIN (new_link) = list;
- list = new_link;
- } while (check_token (COMMA));
- return list;
-}
-
-static tree
-parse_param_attr ()
-{
- tree attr;
- switch (PEEK_TOKEN ())
- {
- case PARAMATTR: /* INOUT is returned here */
- attr = PEEK_TREE ();
- FORWARD_TOKEN ();
- return attr;
- case IN:
- FORWARD_TOKEN ();
- return ridpointers[(int) RID_IN];
- case LOC:
- FORWARD_TOKEN ();
- return ridpointers[(int) RID_LOC];
-#if 0
- case DYNAMIC:
- FORWARD_TOKEN ();
- return ridpointers[(int) RID_DYNAMIC];
-#endif
- default:
- return NULL_TREE;
- }
-}
-
-/* We wrap CHILL array parameters in a STRUCT. The original parameter
- name is unpacked from the struct at get_identifier time */
-
-/* In pass 1, returns list of types; in pass 2: chain of PARM_DECLs. */
-
-static tree
-parse_formpar ()
-{
- tree names = parse_param_name_list ();
- tree mode = parse_mode ();
- tree paramattr = parse_param_attr ();
- return chill_munge_params (nreverse (names), mode, paramattr);
-}
-
-/*
- * Note: build_process_header depends upon the *exact*
- * representation of STRUCT fields and of formal parameter
- * lists. If either is changed, build_process_header will
- * also need change. Push_extern_process is affected as well.
- */
-static tree
-parse_formparlist ()
-{
- tree list = NULL_TREE;
- if (PEEK_TOKEN() == RPRN)
- return NULL_TREE;
- for (;;)
- {
- list = chainon (list, parse_formpar ());
- if (! check_token (COMMA))
- break;
- }
- return list;
-}
-
-static tree
-parse_opt_result_spec ()
-{
- tree mode;
- int is_nonref, is_loc, is_dynamic;
- if (!check_token (RETURNS))
- return void_type_node;
- expect (LPRN, "expected '(' after RETURNS");
- mode = parse_mode ();
- is_nonref = check_token (NONREF);
- is_loc = check_token (LOC);
- is_dynamic = check_token (DYNAMIC);
- if (is_nonref && !is_loc)
- error ("NONREF specific without LOC in result attribute");
- if (is_dynamic && !is_loc)
- error ("DYNAMIC specific without LOC in result attribute");
- mode = get_type_of (mode);
- if (is_loc && ! ignoring)
- mode = build_chill_reference_type (mode);
- expect (RPRN, "expected ')' after RETURNS");
- return mode;
-}
-
-static tree
-parse_opt_except ()
-{
- tree list = NULL_TREE;
- if (!check_token (EXCEPTIONS))
- return NULL_TREE;
- expect (LPRN, "expected '(' after EXCEPTIONS");
- do
- {
- tree except_name = parse_name_string ();
- tree name;
- for (name = list; name != NULL_TREE; name = TREE_CHAIN (name))
- if (TREE_VALUE (name) == except_name && pass == 1)
- {
- error ("exception names must be unique");
- break;
- }
- if (name == NULL_TREE && !ignoring)
- list = tree_cons (NULL_TREE, except_name, list);
- } while (check_token (COMMA));
- expect (RPRN, "expected ')' after EXCEPTIONS");
- return list;
-}
-
-static tree
-parse_opt_recursive ()
-{
- if (check_token (RECURSIVE))
- return ridpointers[RID_RECURSIVE];
- else
- return NULL_TREE;
-}
-
-static tree
-parse_procedureattr ()
-{
- tree generality;
- tree optrecursive;
- switch (PEEK_TOKEN ())
- {
- case GENERAL:
- FORWARD_TOKEN ();
- generality = ridpointers[RID_GENERAL];
- break;
- case SIMPLE:
- FORWARD_TOKEN ();
- generality = ridpointers[RID_SIMPLE];
- break;
- case INLINE:
- FORWARD_TOKEN ();
- generality = ridpointers[RID_INLINE];
- break;
- default:
- generality = NULL_TREE;
- }
- optrecursive = parse_opt_recursive ();
- if (pass != 1)
- return NULL_TREE;
- if (generality)
- generality = build_tree_list (NULL_TREE, generality);
- if (optrecursive)
- generality = tree_cons (NULL_TREE, optrecursive, generality);
- return generality;
-}
-
-/* Parse the body and last part of a procedure or process definition. */
-
-static void
-parse_proc_body (name, exceptions)
- tree name;
- tree exceptions;
-{
- int save_proc_action_level = proc_action_level;
- proc_action_level = action_nesting_level;
- if (exceptions != NULL_TREE)
- /* set up a handler for reraising exceptions */
- push_handler ();
- push_action ();
- define__PROCNAME__ ();
- parse_body ();
- proc_action_level = save_proc_action_level;
- expect (END, "'END' was expected here");
- parse_opt_handler ();
- if (exceptions != NULL_TREE)
- chill_reraise_exceptions (exceptions);
- parse_opt_end_label_semi_colon (name);
- end_function ();
-}
-
-static void
-parse_procedure_definition (in_spec_module)
- int in_spec_module;
-{
- int save_ignoring = ignoring;
- tree name = parse_defining_occurrence ();
- tree params, result, exceptlist, attributes;
- int save_chill_at_module_level = chill_at_module_level;
- chill_at_module_level = 0;
- if (!in_spec_module)
- ignoring = pass == 2;
- require (COLON); require (PROC);
- expect (LPRN, "missing '(' after PROC");
- params = parse_formparlist ();
- expect (RPRN, "missing ')' in PROC");
- result = parse_opt_result_spec ();
- exceptlist = parse_opt_except ();
- attributes = parse_procedureattr ();
- ignoring = save_ignoring;
- if (in_spec_module)
- {
- expect (END, "missing 'END'");
- parse_opt_end_label_semi_colon (name);
- push_extern_function (name, result, params, exceptlist, 0);
- return;
- }
- push_chill_function_context ();
- start_chill_function (name, result, params, exceptlist, attributes);
- current_module->procedure_seen = 1;
- parse_proc_body (name, TYPE_RAISES_EXCEPTIONS (TREE_TYPE (current_function_decl)));
- chill_at_module_level = save_chill_at_module_level;
-}
-
-static tree
-parse_processpar ()
-{
- tree names = parse_defining_occurrence_list ();
- tree mode = parse_mode ();
- tree paramattr = parse_param_attr ();
-
- if (names && TREE_CODE (names) == IDENTIFIER_NODE)
- names = build_tree_list (NULL_TREE, names);
- return tree_cons (tree_cons (paramattr, mode, NULL_TREE), names, NULL_TREE);
-}
-
-static tree
-parse_processparlist ()
-{
- tree list = NULL_TREE;
- if (PEEK_TOKEN() == RPRN)
- return NULL_TREE;
- for (;;)
- {
- list = chainon (list, parse_processpar ());
- if (! check_token (COMMA))
- break;
- }
- return list;
-}
-
-static void
-parse_process_definition (in_spec_module)
- int in_spec_module;
-{
- int save_ignoring = ignoring;
- tree name = parse_defining_occurrence ();
- tree params;
- tree tmp;
- if (!in_spec_module)
- ignoring = 0;
- require (COLON); require (PROCESS);
- expect (LPRN, "missing '(' after PROCESS");
- params = parse_processparlist ();
- expect (RPRN, "missing ')' in PROCESS");
- ignoring = save_ignoring;
- if (in_spec_module)
- {
- expect (END, "missing 'END'");
- parse_opt_end_label_semi_colon (name);
- push_extern_process (name, params, NULL_TREE, 0);
- return;
- }
- tmp = build_process_header (name, params);
- parse_proc_body (name, NULL_TREE);
- build_process_wrapper (name, tmp);
-}
-
-static void
-parse_signal_definition ()
-{
- tree signame = parse_defining_occurrence ();
- tree modes = NULL_TREE;
- tree dest = NULL_TREE;
-
- if (check_token (EQL))
- {
- expect (LPRN, "missing '(' after 'SIGNAL <name> ='");
- for (;;)
- {
- tree mode = parse_mode ();
- modes = tree_cons (NULL_TREE, mode, modes);
- if (! check_token (COMMA))
- break;
- }
- expect (RPRN, "missing ')'");
- modes = nreverse (modes);
- }
-
- if (check_token (TO))
- {
- tree decl;
- int save_ignoring = ignoring;
- ignoring = 0;
- decl = parse_name ();
- ignoring = save_ignoring;
- if (pass > 1)
- {
- if (decl == NULL_TREE
- || TREE_CODE (decl) == ERROR_MARK
- || TREE_CODE (decl) != FUNCTION_DECL
- || !CH_DECL_PROCESS (decl))
- error ("must specify a PROCESS name");
- else
- dest = decl;
- }
- }
-
- if (! global_bindings_p ())
- error ("SIGNAL must be in global reach");
- else
- {
- tree struc = build_signal_struct_type (signame, modes, dest);
- tree decl =
- generate_tasking_code_variable (signame,
- &signal_code,
- current_module->is_spec_module);
- /* remember the code variable in the struct type */
- DECL_TASKING_CODE_DECL (struc) = (struct lang_decl *)decl;
- CH_DECL_SIGNAL (struc) = 1;
- add_taskstuff_to_list (decl, "_TT_Signal",
- current_module->is_spec_module ?
- NULL_TREE : signal_code, struc, NULL_TREE);
- }
-
-}
-
-static void
-parse_signal_definition_statement ()
-{
- int save_ignoring = ignoring;
- ignoring = pass == 2;
- require (SIGNAL);
- for (;;)
- {
- parse_signal_definition ();
- if (! check_token (COMMA))
- break;
- if (PEEK_TOKEN () == SC)
- {
- error ("syntax error while parsing signal definition statement");
- break;
- }
- }
- parse_semi_colon ();
- ignoring = save_ignoring;
-}
-
-static int
-parse_definition (in_spec_module)
- int in_spec_module;
-{
- switch (PEEK_TOKEN ())
- {
- case NAME:
- if (PEEK_TOKEN1() == COLON)
- {
- if (PEEK_TOKEN2() == PROC)
- {
- parse_procedure_definition (in_spec_module);
- return 1;
- }
- else if (PEEK_TOKEN2() == PROCESS)
- {
- parse_process_definition (in_spec_module);
- return 1;
- }
- }
- return 0;
- case DCL:
- parse_declaration_statement(in_spec_module);
- break;
- case GRANT:
- parse_grant_statement ();
- break;
- case NEWMODE:
- parse_mode_definition_statement(1);
- break;
- case SC:
- label = NULL_TREE;
- FORWARD_TOKEN();
- return 1;
- case SEIZE:
- parse_seize_statement ();
- break;
- case SIGNAL:
- parse_signal_definition_statement ();
- break;
- case SYN:
- parse_synonym_definition_statement();
- break;
- case SYNMODE:
- parse_mode_definition_statement(0);
- break;
- default:
- return 0;
- }
- return 1;
-}
-
-static void
-parse_then_clause ()
-{
- expect (THEN, "expected 'THEN' after 'IF'");
- if (! ignoring)
- emit_line_note (input_filename, lineno);
- parse_opt_actions ();
-}
-
-static void
-parse_opt_else_clause ()
-{
- while (check_token (ELSIF))
- {
- tree cond = parse_expression ();
- if (! ignoring)
- expand_start_elseif (truthvalue_conversion (cond));
- parse_then_clause ();
- }
- if (check_token (ELSE))
- {
- if (! ignoring)
- { emit_line_note (input_filename, lineno);
- expand_start_else ();
- }
- parse_opt_actions ();
- }
-}
-
-static tree parse_expr_list ()
-{
- tree expr = parse_expression ();
- tree list = ignoring ? NULL_TREE : build_tree_list (NULL_TREE, expr);
- while (check_token (COMMA))
- {
- expr = parse_expression ();
- if (! ignoring)
- list = tree_cons (NULL_TREE, expr, list);
- }
- return list;
-}
-
-static tree
-parse_range_list_clause ()
-{
- tree name = parse_opt_name_string (0);
- if (name == NULL_TREE)
- return NULL_TREE;
- while (check_token (COMMA))
- {
- name = parse_name_string ();
- }
- if (check_token (SC))
- {
- sorry ("case range list");
- return error_mark_node;
- }
- pushback_token (NAME, name);
- return NULL_TREE;
-}
-
-static void
-pushback_paren_expr (expr)
- tree expr;
-{
- if (pass == 1 && !ignoring)
- expr = build1 (PAREN_EXPR, NULL_TREE, expr);
- pushback_token (EXPR, expr);
-}
-
-/* Matches: <case label> */
-
-static tree
-parse_case_label ()
-{
- tree expr;
- if (check_token (ELSE))
- return case_else_node;
- /* Does this also handle the case of a mode name? FIXME */
- expr = parse_expression ();
- if (check_token (COLON))
- {
- tree max_expr = parse_expression ();
- if (! ignoring)
- expr = build (RANGE_EXPR, NULL_TREE, expr, max_expr);
- }
- return expr;
-}
-
-/* Parses: <case_label_list>
- Fails if not followed by COMMA or COLON.
- If it fails, it backs up if needed, and returns NULL_TREE.
- IN_TUPLE is true if we are parsing a tuple element,
- and 0 if we are parsing a case label specification. */
-
-static tree
-parse_case_label_list (selector, in_tuple)
- tree selector;
- int in_tuple;
-{
- tree expr, list;
- if (! check_token (LPRN))
- return NULL_TREE;
- if (check_token (MUL))
- {
- expect (RPRN, "missing ')' after '*' case label list");
- if (ignoring)
- return integer_zero_node;
- expr = build (RANGE_EXPR, NULL_TREE, NULL_TREE, NULL_TREE);
- expr = build_tree_list (NULL_TREE, expr);
- return expr;
- }
- expr = parse_case_label ();
- if (check_token (RPRN))
- {
- if ((in_tuple || PEEK_TOKEN () != COMMA) && PEEK_TOKEN () != COLON)
- {
- /* Ooops! It looks like it was the start of an action or
- unlabelled tuple element, and not a case label, so back up. */
- if (expr != NULL_TREE && TREE_CODE (expr) == RANGE_EXPR)
- {
- error ("misplaced colon in case label");
- expr = error_mark_node;
- }
- pushback_paren_expr (expr);
- return NULL_TREE;
- }
- list = build_tree_list (NULL_TREE, expr);
- if (expr == case_else_node && selector != NULL_TREE)
- ELSE_LABEL_SPECIFIED (selector) = 1;
- return list;
- }
- list = build_tree_list (NULL_TREE, expr);
- if (expr == case_else_node && selector != NULL_TREE)
- ELSE_LABEL_SPECIFIED (selector) = 1;
-
- while (check_token (COMMA))
- {
- expr = parse_case_label ();
- list = tree_cons (NULL_TREE, expr, list);
- if (expr == case_else_node && selector != NULL_TREE)
- ELSE_LABEL_SPECIFIED (selector) = 1;
- }
- expect (RPRN, "missing ')' at end of case label list");
- return nreverse (list);
-}
-
-/* Parses: <case_label_specification>
- Must be followed by a COLON.
- If it fails, it backs up if needed, and returns NULL_TREE. */
-
-static tree
-parse_case_label_specification (selectors)
- tree selectors;
-{
- tree list_list = NULL_TREE;
- tree list;
- list = parse_case_label_list (selectors, 0);
- if (list == NULL_TREE)
- return NULL_TREE;
- list_list = build_tree_list (NULL_TREE, list);
- while (check_token (COMMA))
- {
- if (selectors != NULL_TREE)
- selectors = TREE_CHAIN (selectors);
- list = parse_case_label_list (selectors, 0);
- if (list == NULL_TREE)
- {
- error ("unrecognized case label list after ','");
- return list_list;
- }
- list_list = tree_cons (NULL_TREE, list, list_list);
- }
- return nreverse (list_list);
-}
-
-static void
-parse_single_dimension_case_action (selector)
- tree selector;
-{
- int no_completeness_check = 0;
-
-/* The case label/action toggle. It is 0 initially, and when an action
- was last seen. It is 1 integer_zero_node when a label was last seen. */
- int caseaction_flag = 0;
-
- if (! ignoring)
- {
- expand_exit_needed = 0;
- selector = check_case_selector (selector);
- expand_start_case (1, selector, TREE_TYPE (selector), "CASE statement");
- push_momentary ();
- }
-
- for (;;)
- {
- tree label_spec = parse_case_label_specification (selector);
- if (label_spec != NULL_TREE)
- {
- expect (COLON, "missing ':' in case alternative");
- if (! ignoring)
- {
- no_completeness_check |= chill_handle_single_dimension_case_label (
- selector, label_spec, &expand_exit_needed, &caseaction_flag);
- }
- }
- else if (parse_action ())
- {
- expand_exit_needed = 1;
- caseaction_flag = 0;
- }
- else
- break;
- }
-
- if (! ignoring)
- {
- if (expand_exit_needed || caseaction_flag == 1)
- expand_exit_something ();
- }
- if (check_token (ELSE))
- {
- if (! ignoring)
- chill_handle_case_default ();
- parse_opt_actions ();
- if (! ignoring)
- {
- emit_line_note (input_filename, lineno);
- expand_exit_something ();
- }
- }
- else if (! ignoring && TREE_CODE (selector) != ERROR_MARK &&
- ! no_completeness_check)
- check_missing_cases (TREE_TYPE (selector));
-
- expect (ESAC, "missing 'ESAC' after 'CASE'");
- if (! ignoring)
- {
- expand_end_case (selector);
- pop_momentary ();
- }
-}
-
-static void
-parse_multi_dimension_case_action (selector)
- tree selector;
-{
- struct rtx_def *begin_test_label = 0, *end_case_label = 0, *new_label;
- tree action_labels = NULL_TREE;
- tree tests = NULL_TREE;
- int save_lineno = lineno;
- const char *save_filename = input_filename;
-
- /* We can't compute the range of an (ELSE) label until all of the CASE
- label specifications have been seen, however, the code for the actions
- between them is generated on the fly. We can still generate everything in
- one pass is we use the following form:
-
- Compile a CASE of the form
-
- case S1,...,Sn of
- (X11),...,(X1n): A1;
- ...
- (Xm1),...,(Xmn): Am;
- else Ae;
- esac;
-
- into:
-
- goto L0;
- L1: A1; goto L99;
- ...
- Lm: Am; goto L99;
- Le: Ae; goto L99;
- L0:
- T1 := s1; ...; Tn := Sn;
- if (T1 = X11 and ... and Tn = X1n) GOTO L1;
- ...
- if (T1 = Xm1 and ... and Tn = Xmn) GOTO Lm;
- GOTO Le;
- L99;
- */
-
- if (! ignoring)
- {
- selector = check_case_selector_list (selector);
- begin_test_label = gen_label_rtx ();
- end_case_label = gen_label_rtx ();
- emit_jump (begin_test_label);
- }
-
- for (;;)
- {
- tree label_spec = parse_case_label_specification (selector);
- if (label_spec != NULL_TREE)
- {
- expect (COLON, "missing ':' in case alternative");
- if (! ignoring)
- {
- tests = tree_cons (label_spec, NULL_TREE, tests);
-
- if (action_labels != NULL_TREE)
- emit_jump (end_case_label);
-
- new_label = gen_label_rtx ();
- emit_label (new_label);
- emit_line_note (input_filename, lineno);
- action_labels = tree_cons (NULL_TREE, NULL_TREE, action_labels);
- TREE_CST_RTL (action_labels) = new_label;
- }
- }
- else if (! parse_action ())
- {
- if (action_labels != NULL_TREE)
- emit_jump (end_case_label);
- break;
- }
- }
-
- if (check_token (ELSE))
- {
- if (! ignoring)
- {
- new_label = gen_label_rtx ();
- emit_label (new_label);
- emit_line_note (input_filename, lineno);
- action_labels = tree_cons (NULL_TREE, NULL_TREE, action_labels);
- TREE_CST_RTL (action_labels) = new_label;
- }
- parse_opt_actions ();
- if (! ignoring)
- emit_jump (end_case_label);
- }
-
- expect (ESAC, "missing 'ESAC' after 'CASE'");
-
- if (! ignoring)
- {
- emit_label (begin_test_label);
- emit_line_note (save_filename, save_lineno);
- if (tests != NULL_TREE)
- {
- tree cond;
- tests = nreverse (tests);
- action_labels = nreverse (action_labels);
- compute_else_ranges (selector, tests);
-
- cond = build_multi_case_selector_expression (selector, TREE_PURPOSE (tests));
- expand_start_cond (truthvalue_conversion (cond), label ? 1 : 0);
- emit_jump (TREE_CST_RTL (action_labels));
-
- for (tests = TREE_CHAIN (tests), action_labels = TREE_CHAIN (action_labels);
- tests != NULL_TREE && action_labels != NULL_TREE;
- tests = TREE_CHAIN (tests), action_labels = TREE_CHAIN (action_labels))
- {
- cond =
- build_multi_case_selector_expression (selector, TREE_PURPOSE (tests));
- expand_start_elseif (truthvalue_conversion (cond));
- emit_jump (TREE_CST_RTL (action_labels));
- }
- if (action_labels != NULL_TREE)
- {
- expand_start_else ();
- emit_jump (TREE_CST_RTL (action_labels));
- }
- expand_end_cond ();
- }
- emit_label (end_case_label);
- }
-}
-
-static void
-parse_case_action (label)
- tree label;
-{
- tree selector;
- int multi_dimension_case = 0;
-
- require (CASE);
- selector = parse_expr_list ();
- selector = nreverse (selector);
- expect (OF, "missing 'OF' after 'CASE'");
- parse_range_list_clause ();
-
- PUSH_ACTION;
- if (label)
- pushlevel (1);
-
- if (! ignoring)
- {
- expand_exit_needed = 0;
- if (TREE_CODE (selector) == TREE_LIST)
- {
- if (TREE_CHAIN (selector) != NULL_TREE)
- multi_dimension_case = 1;
- else
- selector = TREE_VALUE (selector);
- }
- }
-
- /* We want to use the regular CASE support for the single dimension case. The
- multi dimension case requires different handling. Note that when "ignoring"
- is true we parse using the single dimension code. This is OK since it will
- still parse correctly. */
- if (multi_dimension_case)
- parse_multi_dimension_case_action (selector);
- else
- parse_single_dimension_case_action (selector);
-
- if (label)
- {
- possibly_define_exit_label (label);
- poplevel (0, 0, 0);
- }
-}
-
-/* Matches: [ <asm_operand> { "," <asm_operand> }* ],
- where <asm_operand> = STRING '(' <expression> ')'
- These are the operands other than the first string and colon
- in asm ("addextend %2,%1": "=dm" (x), "0" (y), "g" (*x)) */
-
-static tree
-parse_asm_operands ()
-{
- tree list = NULL_TREE;
- if (PEEK_TOKEN () != STRING)
- return NULL_TREE;
- for (;;)
- {
- tree string, expr;
- if (PEEK_TOKEN () != STRING)
- {
- error ("bad ASM operand");
- return list;
- }
- string = PEEK_TREE();
- FORWARD_TOKEN ();
- expect (LPRN, "missing '(' in ASM operand");
- expr = parse_expression ();
- expect (RPRN, "missing ')' in ASM operand");
- list = tree_cons (string, expr, list);
- if (! check_token (COMMA))
- break;
- }
- return nreverse (list);
-}
-
-/* Matches: STRING { ',' STRING }* */
-
-static tree
-parse_asm_clobbers ()
-{
- tree list = NULL_TREE;
- for (;;)
- {
- tree string;
- if (PEEK_TOKEN () != STRING)
- {
- error ("bad ASM operand");
- return list;
- }
- string = PEEK_TREE();
- FORWARD_TOKEN ();
- list = tree_cons (NULL_TREE, string, list);
- if (! check_token (COMMA))
- break;
- }
- return list;
-}
-
-static void
-ch_expand_asm_operands (string, outputs, inputs, clobbers, vol, filename, line)
- tree string, outputs, inputs, clobbers;
- int vol;
- const char *filename;
- int line;
-{
- int noutputs = list_length (outputs);
- register int i;
- /* o[I] is the place that output number I should be written. */
- register tree *o = (tree *) alloca (noutputs * sizeof (tree));
- register tree tail;
-
- if (TREE_CODE (string) == ADDR_EXPR)
- string = TREE_OPERAND (string, 0);
- if (TREE_CODE (string) != STRING_CST)
- {
- error ("asm template is not a string constant");
- return;
- }
-
- /* Record the contents of OUTPUTS before it is modified. */
- for (i = 0, tail = outputs; tail; tail = TREE_CHAIN (tail), i++)
- o[i] = TREE_VALUE (tail);
-
-#if 0
- /* Perform default conversions on array and function inputs. */
- /* Don't do this for other types--
- it would screw up operands expected to be in memory. */
- for (i = 0, tail = inputs; tail; tail = TREE_CHAIN (tail), i++)
- if (TREE_CODE (TREE_TYPE (TREE_VALUE (tail))) == ARRAY_TYPE
- || TREE_CODE (TREE_TYPE (TREE_VALUE (tail))) == FUNCTION_TYPE)
- TREE_VALUE (tail) = default_conversion (TREE_VALUE (tail));
-#endif
-
- /* Generate the ASM_OPERANDS insn;
- store into the TREE_VALUEs of OUTPUTS some trees for
- where the values were actually stored. */
- expand_asm_operands (string, outputs, inputs, clobbers, vol, filename, line);
-
- /* Copy all the intermediate outputs into the specified outputs. */
- for (i = 0, tail = outputs; tail; tail = TREE_CHAIN (tail), i++)
- {
- if (o[i] != TREE_VALUE (tail))
- {
- expand_expr (build_chill_modify_expr (o[i], TREE_VALUE (tail)),
- 0, VOIDmode, 0);
- free_temp_slots ();
- }
- /* Detect modification of read-only values.
- (Otherwise done by build_modify_expr.) */
- else
- {
- tree type = TREE_TYPE (o[i]);
- if (TYPE_READONLY (type)
- || ((TREE_CODE (type) == RECORD_TYPE
- || TREE_CODE (type) == UNION_TYPE)
- && TYPE_FIELDS_READONLY (type)))
- warning ("readonly location modified by 'asm'");
- }
- }
-
- /* Those MODIFY_EXPRs could do autoincrements. */
- emit_queue ();
-}
-
-static void
-parse_asm_action ()
-{
- tree insn;
- require (ASM_KEYWORD);
- expect (LPRN, "missing '('");
- PUSH_ACTION;
- if (!ignoring)
- emit_line_note (input_filename, lineno);
- insn = parse_expression ();
- if (check_token (COLON))
- {
- tree output_operand, input_operand, clobbered_regs;
- output_operand = parse_asm_operands ();
- if (check_token (COLON))
- input_operand = parse_asm_operands ();
- else
- input_operand = NULL_TREE;
- if (check_token (COLON))
- clobbered_regs = parse_asm_clobbers ();
- else
- clobbered_regs = NULL_TREE;
- expect (RPRN, "missing ')'");
- if (!ignoring)
- ch_expand_asm_operands (insn, output_operand, input_operand,
- clobbered_regs, FALSE,
- input_filename, lineno);
- }
- else
- {
- expect (RPRN, "missing ')'");
- STRIP_NOPS (insn);
- if (ignoring) { }
- else if ((TREE_CODE (insn) == ADDR_EXPR
- && TREE_CODE (TREE_OPERAND (insn, 0)) == STRING_CST)
- || TREE_CODE (insn) == STRING_CST)
- expand_asm (insn);
- else
- error ("argument of `asm' is not a constant string");
- }
-}
-
-static void
-parse_begin_end_block (label)
- tree label;
-{
- require (BEGINTOKEN);
-#if 0
- /* don't make a linenote at BEGIN */
- INIT_ACTION;
-#endif
- pushlevel (1);
- if (! ignoring)
- {
- clear_last_expr ();
- push_momentary ();
- expand_start_bindings (label ? 1 : 0);
- }
- push_handler ();
- parse_body ();
- expect (END, "missing 'END'");
- /* Note that the opthandler comes before the poplevel
- - hence a handler is in the scope of the block. */
- parse_opt_handler ();
- possibly_define_exit_label (label);
- if (! ignoring)
- {
- emit_line_note (input_filename, lineno);
- expand_end_bindings (getdecls (), kept_level_p (), 0);
- }
- poplevel (kept_level_p (), 0, 0);
- if (! ignoring)
- pop_momentary ();
- parse_opt_end_label_semi_colon (label);
-}
-
-static void
-parse_if_action (label)
- tree label;
-{
- tree cond;
- require (IF);
- PUSH_ACTION;
- cond = parse_expression ();
- if (label)
- pushlevel (1);
- if (! ignoring)
- {
- expand_start_cond (truthvalue_conversion (cond),
- label ? 1 : 0);
- }
- parse_then_clause ();
- parse_opt_else_clause ();
- expect (FI, "expected 'FI' after 'IF'");
- if (! ignoring)
- {
- emit_line_note (input_filename, lineno);
- expand_end_cond ();
- }
- if (label)
- {
- possibly_define_exit_label (label);
- poplevel (0, 0, 0);
- }
-}
-
-/* Matches: <iteration> (as in a <for control>). */
-
-static void
-parse_iteration ()
-{
- tree loop_counter = parse_defining_occurrence ();
- if (check_token (ASGN))
- {
- tree start_value = parse_expression ();
- tree step_value
- = check_token (BY) ? parse_expression () : NULL_TREE;
- int going_down = check_token (DOWN);
- tree end_value;
- if (check_token (TO))
- end_value = parse_expression ();
- else
- {
- error ("expected 'TO' in step enumeration");
- end_value = error_mark_node;
- }
- if (!ignoring)
- build_loop_iterator (loop_counter, start_value, step_value,
- end_value, going_down, 0, 0);
- }
- else
- {
- int going_down = check_token (DOWN);
- tree expr;
- if (check_token (IN))
- expr = parse_expression ();
- else
- {
- error ("expected 'IN' in FOR control here");
- expr = error_mark_node;
- }
- if (!ignoring)
- {
- tree low_bound, high_bound;
- if (expr && TREE_CODE (expr) == TYPE_DECL)
- {
- expr = TREE_TYPE (expr);
- /* FIXME: expr must be an array or powerset */
- low_bound = convert (expr, TYPE_MIN_VALUE (expr));
- high_bound = convert (expr, TYPE_MAX_VALUE (expr));
- }
- else
- {
- low_bound = expr;
- high_bound = NULL_TREE;
- }
- build_loop_iterator (loop_counter, low_bound,
- NULL_TREE, high_bound,
- going_down, 1, 0);
- }
- }
-}
-
-/* Matches: '(' <event list> ')' ':'.
- Or; returns NULL_EXPR. */
-
-static tree
-parse_delay_case_event_list ()
-{
- tree event_list = NULL_TREE;
- tree event;
- if (! check_token (LPRN))
- return NULL_TREE;
- event = parse_expression ();
- if (PEEK_TOKEN () == ')' && PEEK_TOKEN1 () != ':')
- {
- /* Oops. */
- require (RPRN);
- pushback_paren_expr (event);
- return NULL_TREE;
- }
- for (;;)
- {
- if (! ignoring)
- event_list = tree_cons (NULL_TREE, event, event_list);
- if (! check_token (COMMA))
- break;
- event = parse_expression ();
- }
- expect (RPRN, "missing ')'");
- expect (COLON, "missing ':'");
- return ignoring ? error_mark_node : event_list;
-}
-
-static void
-parse_delay_case_action (label)
- tree label;
-{
- tree label_cnt = NULL_TREE, set_location, priority;
- tree combined_event_list = NULL_TREE;
- require (DELAY);
- require (CASE);
- PUSH_ACTION;
- pushlevel (1);
- expand_exit_needed = 0;
- if (check_token (SET))
- {
- set_location = parse_expression ();
- parse_semi_colon ();
- }
- else
- set_location = NULL_TREE;
- if (check_token (PRIORITY))
- {
- priority = parse_expression ();
- parse_semi_colon ();
- }
- else
- priority = NULL_TREE;
- if (! ignoring)
- label_cnt = build_delay_case_start (set_location, priority);
- for (;;)
- {
- tree event_list = parse_delay_case_event_list ();
- if (event_list)
- {
- if (! ignoring )
- {
- int if_or_elseif = combined_event_list == NULL_TREE;
- build_delay_case_label (event_list, if_or_elseif);
- combined_event_list = chainon (combined_event_list, event_list);
- }
- }
- else if (parse_action ())
- {
- if (! ignoring)
- {
- expand_exit_needed = 1;
- if (combined_event_list == NULL_TREE)
- error ("missing DELAY CASE alternative");
- }
- }
- else
- break;
- }
- expect (ESAC, "missing 'ESAC' in DELAY CASE'");
- if (! ignoring)
- build_delay_case_end (combined_event_list);
- possibly_define_exit_label (label);
- poplevel (0, 0, 0);
-}
-
-static void
-parse_do_action (label)
- tree label;
-{
- tree condition;
- int token;
- require (DO);
- if (check_token (WITH))
- {
- tree list = NULL_TREE;
- for (;;)
- {
- tree name = parse_primval ();
- if (! ignoring && TREE_CODE (name) != ERROR_MARK)
- {
- if (TREE_CODE (TREE_TYPE (name)) == REFERENCE_TYPE)
- name = convert (TREE_TYPE (TREE_TYPE (name)), name);
- else
- {
- int is_loc = chill_location (name);
- if (is_loc == 1) /* This is probably not possible */
- warning ("non-referable location in DO WITH");
-
- if (is_loc > 1)
- name = build_chill_arrow_expr (name, 1);
- name = decl_temp1 (get_identifier ("__with_element"),
- TREE_TYPE (name),
- 0, name, 0, 0);
- if (is_loc > 1)
- name = build_chill_indirect_ref (name, NULL_TREE, 0);
-
- }
- if (TREE_CODE (TREE_TYPE (name)) != RECORD_TYPE)
- error ("WITH element must be of STRUCT mode");
- else
- list = tree_cons (NULL_TREE, name, list);
- }
- if (! check_token (COMMA))
- break;
- }
- pushlevel (1);
- push_action ();
- for (list = nreverse (list); list != NULL_TREE; list = TREE_CHAIN (list))
- shadow_record_fields (TREE_VALUE (list));
-
- parse_semi_colon ();
- parse_opt_actions ();
- expect (OD, "missing 'OD' in 'DO WITH'");
- if (! ignoring)
- emit_line_note (input_filename, lineno);
- possibly_define_exit_label (label);
- parse_opt_handler ();
- parse_opt_end_label_semi_colon (label);
- poplevel (0, 0, 0);
- return;
- }
- token = PEEK_TOKEN();
- if (token != FOR && token != WHILE)
- {
- push_handler ();
- parse_opt_actions ();
- expect (OD, "Missing 'OD' after 'DO'");
- parse_opt_handler ();
- parse_opt_end_label_semi_colon (label);
- return;
- }
- if (! ignoring)
- emit_line_note (input_filename, lineno);
- push_loop_block ();
- if (check_token (FOR))
- {
- if (check_token (EVER))
- {
- if (!ignoring)
- build_loop_iterator (NULL_TREE, NULL_TREE,
- NULL_TREE, NULL_TREE,
- 0, 0, 1);
- }
- else
- {
- parse_iteration ();
- while (check_token (COMMA))
- parse_iteration ();
- }
- }
- else if (!ignoring)
- build_loop_iterator (NULL_TREE, NULL_TREE,
- NULL_TREE, NULL_TREE,
- 0, 0, 1);
-
- begin_loop_scope ();
- if (! ignoring)
- build_loop_start (label);
- condition = check_token (WHILE) ? parse_expression () : NULL_TREE;
- if (! ignoring)
- top_loop_end_check (condition);
- parse_semi_colon ();
- parse_opt_actions ();
- if (! ignoring)
- build_loop_end ();
- expect (OD, "Missing 'OD' after 'DO'");
- /* Note that the handler is inside the reach of the DO. */
- parse_opt_handler ();
- end_loop_scope (label);
- pop_loop_block ();
- parse_opt_end_label_semi_colon (label);
-}
-
-/* Matches: '(' <signal name> [ 'IN' <defining occurrence list> ']' ')' ':'
- or: '(' <buffer location> IN (defining occurrence> ')' ':'
- or: returns NULL_TREE. */
-
-static tree
-parse_receive_spec ()
-{
- tree val;
- tree name_list = NULL_TREE;
- if (!check_token (LPRN))
- return NULL_TREE;
- val = parse_primval ();
- if (check_token (IN))
- {
-#if 0
- if (flag_local_loop_counter)
- name_list = parse_defining_occurrence_list ();
- else
-#endif
- {
- for (;;)
- {
- tree loc = parse_primval ();
- if (! ignoring)
- name_list = tree_cons (NULL_TREE, loc, name_list);
- if (! check_token (COMMA))
- break;
- }
- }
- }
- if (! check_token (RPRN))
- {
- error ("missing ')' in signal/buffer receive alternative");
- return NULL_TREE;
- }
- if (check_token (COLON))
- {
- if (ignoring || val == NULL_TREE || TREE_CODE (val) == ERROR_MARK)
- return error_mark_node;
- else
- return build_receive_case_label (val, name_list);
- }
-
- /* We saw: '(' <primitive value> ')' not followed by ':'.
- Presumably the start of an action. Backup and fail. */
- if (name_list != NULL_TREE)
- error ("misplaced 'IN' in signal/buffer receive alternative");
- pushback_paren_expr (val);
- return NULL_TREE;
-}
-
-/* To understand the code generation for this, see ch-tasking.c,
- and the 2-page comments preceding the
- build_chill_receive_case_start () definition. */
-
-static void
-parse_receive_case_action (label)
- tree label;
-{
- tree instance_location;
- tree have_else_actions;
- int spec_seen = 0;
- tree alt_list = NULL_TREE;
- require (RECEIVE);
- require (CASE);
- push_action ();
- pushlevel (1);
- if (! ignoring)
- {
- expand_exit_needed = 0;
- }
-
- if (check_token (SET))
- {
- instance_location = parse_expression ();
- parse_semi_colon ();
- }
- else
- instance_location = NULL_TREE;
- if (! ignoring)
- instance_location = build_receive_case_start (instance_location);
-
- for (;;)
- {
- tree receive_spec = parse_receive_spec ();
- if (receive_spec)
- {
- if (! ignoring)
- alt_list = tree_cons (NULL_TREE, receive_spec, alt_list);
- spec_seen++;
- }
- else if (parse_action ())
- {
- if (! spec_seen && pass == 1)
- error ("missing RECEIVE alternative");
- if (! ignoring)
- expand_exit_needed = 1;
- spec_seen = 1;
- }
- else
- break;
- }
- if (check_token (ELSE))
- {
- if (! ignoring)
- {
- emit_line_note (input_filename, lineno);
- if (build_receive_case_if_generated ())
- expand_start_else ();
- }
- parse_opt_actions ();
- have_else_actions = integer_one_node;
- }
- else
- have_else_actions = integer_zero_node;
- expect (ESAC, "missing 'ESAC' matching 'RECEIVE CASE'");
- if (! ignoring)
- {
- build_receive_case_end (nreverse (alt_list), have_else_actions);
- }
- possibly_define_exit_label (label);
- poplevel (0, 0, 0);
-}
-
-static void
-parse_send_action ()
-{
- tree signal = NULL_TREE;
- tree buffer = NULL_TREE;
- tree value_list;
- tree with_expr, to_expr, priority;
- require (SEND);
- /* The tricky part is distinguishing between a SEND buffer action,
- and a SEND signal action. */
- if (pass != 2 || PEEK_TOKEN () != NAME)
- {
- /* If this is pass 2, it's a SEND buffer action.
- If it's pass 1, we don't care. */
- buffer = parse_primval ();
- }
- else
- {
- /* We have to specifically check for signalname followed by
- a '(', since we allow a signalname to be used (syntactically)
- as a "function". */
- tree name = parse_name ();
- if (TREE_CODE (name) == TYPE_DECL && CH_DECL_SIGNAL (name))
- signal = name; /* It's a SEND signal action! */
- else
- {
- /* It's not a legal SEND signal action.
- Back up and try as a SEND buffer action. */
- pushback_token (EXPR, name);
- buffer = parse_primval ();
- }
- }
- if (check_token (LPRN))
- {
- value_list = NULL_TREE;
- for (;;)
- {
- tree expr = parse_untyped_expr ();
- if (! ignoring)
- value_list = tree_cons (NULL_TREE, expr, value_list);
- if (! check_token (COMMA))
- break;
- }
- value_list = nreverse (value_list);
- expect (RPRN, "missing ')'");
- }
- else
- value_list = NULL_TREE;
- if (check_token (WITH))
- with_expr = parse_expression ();
- else
- with_expr = NULL_TREE;
- if (check_token (TO))
- to_expr = parse_expression ();
- else
- to_expr = NULL_TREE;
- if (check_token (PRIORITY))
- priority = parse_expression ();
- else
- priority = NULL_TREE;
- PUSH_ACTION;
- if (ignoring)
- return;
-
- if (signal)
- { /* It's a <send signal action>! */
- tree sigdesc = build_signal_descriptor (signal, value_list);
- if (sigdesc != NULL_TREE && TREE_CODE (sigdesc) != ERROR_MARK)
- {
- tree sendto = to_expr ? to_expr : IDENTIFIER_SIGNAL_DEST (signal);
- expand_send_signal (sigdesc, with_expr,
- sendto, priority, DECL_NAME (signal));
- }
- }
- else
- {
- /* all checks are done in expand_send_buffer */
- expand_send_buffer (buffer, value_list, priority, with_expr, to_expr);
- }
-}
-
-static void
-parse_start_action ()
-{
- tree name, copy_number, param_list, startset;
- require (START);
- name = parse_name_string ();
- expect (LPRN, "missing '(' in START action");
- PUSH_ACTION;
- /* copy number is a required parameter */
- copy_number = parse_expression ();
- if (!ignoring
- && (copy_number == NULL_TREE
- || TREE_CODE (copy_number) == ERROR_MARK
- || TREE_CODE (TREE_TYPE (copy_number)) != INTEGER_TYPE))
- {
- error ("PROCESS copy number must be integer");
- copy_number = integer_zero_node;
- }
- if (check_token (COMMA))
- param_list = parse_expr_list (); /* user parameters */
- else
- param_list = NULL_TREE;
- expect (RPRN, "missing ')'");
- startset = check_token (SET) ? parse_primval () : NULL;
- build_start_process (name, copy_number, param_list, startset);
-}
-
-static void
-parse_opt_actions ()
-{
- while (parse_action ()) ;
-}
-
-static int
-parse_action ()
-{
- tree label = NULL_TREE;
- tree expr, rhs, loclist;
- enum tree_code op;
-
- if (current_function_decl == global_function_decl
- && PEEK_TOKEN () != SC
- && PEEK_TOKEN () != END)
- seen_action = 1, build_constructor = 1;
-
- if (PEEK_TOKEN () == NAME && PEEK_TOKEN1 () == COLON)
- {
- label = parse_defining_occurrence ();
- require (COLON);
- INIT_ACTION;
- define_label (input_filename, lineno, label);
- }
-
- switch (PEEK_TOKEN ())
- {
- case AFTER:
- {
- int delay;
- require (AFTER);
- expr = parse_primval ();
- delay = check_token (DELAY);
- expect (IN, "missing 'IN'");
- push_action ();
- pushlevel (1);
- build_after_start (expr, delay);
- parse_opt_actions ();
- expect (TIMEOUT, "missing 'TIMEOUT'");
- build_after_timeout_start ();
- parse_opt_actions ();
- expect (END, "missing 'END'");
- build_after_end ();
- possibly_define_exit_label (label);
- poplevel (0, 0, 0);
- }
- goto bracketed_action;
- case ASM_KEYWORD:
- parse_asm_action ();
- goto no_handler_action;
- case ASSERT:
- require (ASSERT);
- PUSH_ACTION;
- expr = parse_expression ();
- if (! ignoring)
- { tree assertfail = ridpointers[(int) RID_ASSERTFAIL];
- expr = build (TRUTH_ORIF_EXPR, void_type_node, expr,
- build_cause_exception (assertfail, 0));
- expand_expr_stmt (fold (expr));
- }
- goto handler_action;
- case AT:
- require (AT);
- PUSH_ACTION;
- expr = parse_primval ();
- expect (IN, "missing 'IN'");
- pushlevel (1);
- if (! ignoring)
- build_at_action (expr);
- parse_opt_actions ();
- expect (TIMEOUT, "missing 'TIMEOUT'");
- if (! ignoring)
- expand_start_else ();
- parse_opt_actions ();
- expect (END, "missing 'END'");
- if (! ignoring)
- expand_end_cond ();
- possibly_define_exit_label (label);
- poplevel (0, 0, 0);
- goto bracketed_action;
- case BEGINTOKEN:
- parse_begin_end_block (label);
- return 1;
- case CASE:
- parse_case_action (label);
- goto bracketed_action;
- case CAUSE:
- require (CAUSE);
- expr = parse_name_string ();
- PUSH_ACTION;
- if (! ignoring && TREE_CODE (expr) != ERROR_MARK)
- expand_cause_exception (expr);
- goto no_handler_action;
- case CONTINUE:
- require (CONTINUE);
- expr = parse_expression ();
- PUSH_ACTION;
- if (! ignoring)
- expand_continue_event (expr);
- goto handler_action;
- case CYCLE:
- require (CYCLE);
- PUSH_ACTION;
- expr = parse_primval ();
- expect (IN, "missing 'IN' after 'CYCLE'");
- pushlevel (1);
- /* We a tree list where TREE_VALUE is the label
- and TREE_PURPOSE is the variable denotes the timeout id. */
- expr = build_cycle_start (expr);
- parse_opt_actions ();
- expect (END, "missing 'END'");
- if (! ignoring)
- build_cycle_end (expr);
- possibly_define_exit_label (label);
- poplevel (0, 0, 0);
- goto bracketed_action;
- case DELAY:
- if (PEEK_TOKEN1 () == CASE)
- {
- parse_delay_case_action (label);
- goto bracketed_action;
- }
- require (DELAY);
- PUSH_ACTION;
- expr = parse_primval ();
- rhs = check_token (PRIORITY) ? parse_expression () : NULL_TREE;
- if (! ignoring)
- build_delay_action (expr, rhs);
- goto handler_action;
- case DO:
- parse_do_action (label);
- return 1;
- case EXIT:
- require (EXIT);
- expr = parse_name_string ();
- PUSH_ACTION;
- lookup_and_handle_exit (expr);
- goto no_handler_action;
- case GOTO:
- require (GOTO);
- expr = parse_name_string ();
- PUSH_ACTION;
- lookup_and_expand_goto (expr);
- goto no_handler_action;
- case IF:
- parse_if_action (label);
- goto bracketed_action;
- case RECEIVE:
- if (PEEK_TOKEN1 () != CASE)
- return 0;
- parse_receive_case_action (label);
- goto bracketed_action;
- case RESULT:
- require (RESULT);
- PUSH_ACTION;
- expr = parse_untyped_expr ();
- if (! ignoring)
- chill_expand_result (expr, 1);
- goto handler_action;
- case RETURN:
- require (RETURN);
- PUSH_ACTION;
- expr = parse_opt_untyped_expr ();
- if (! ignoring)
- {
- /* Do this as RESULT expr and RETURN to get exceptions */
- chill_expand_result (expr, 0);
- expand_goto_except_cleanup (proc_action_level);
- chill_expand_return (NULL_TREE, 0);
- }
- if (expr)
- goto handler_action;
- else
- goto no_handler_action;
- case SC:
- require (SC);
- return 1;
- case SEND:
- parse_send_action ();
- goto handler_action;
- case START:
- parse_start_action ();
- goto handler_action;
- case STOP:
- require (STOP);
- PUSH_ACTION;
- if (! ignoring)
- { tree func = lookup_name (get_identifier ("__stop_process"));
- tree result = build_chill_function_call (func, NULL_TREE);
- expand_expr_stmt (result);
- }
- goto no_handler_action;
- case CALL:
- require (CALL);
- /* Fall through to here ... */
- case EXPR:
- case LPRN:
- case NAME:
- /* This handles calls and assignments. */
- PUSH_ACTION;
- expr = parse_primval ();
- switch (PEEK_TOKEN ())
- {
- case END:
- parse_semi_colon (); /* Emits error message. */
- case ON:
- case SC:
- if (!ignoring && TREE_CODE (expr) != ERROR_MARK)
- {
- if (TREE_CODE (expr) != CALL_EXPR
- && TREE_TYPE (expr) != void_type_node
- && ! TREE_SIDE_EFFECTS (expr))
- {
- if (TREE_CODE (expr) == FUNCTION_DECL)
- error ("missing parenthesis for procedure call");
- else
- error ("expression is not an action");
- expr = error_mark_node;
- }
- else
- expand_expr_stmt (expr);
- }
- goto handler_action;
- default:
- loclist
- = ignoring ? NULL_TREE : build_tree_list (NULL_TREE, expr);
- while (PEEK_TOKEN () == COMMA)
- {
- FORWARD_TOKEN ();
- expr = parse_primval ();
- if (!ignoring && TREE_CODE (expr) != ERROR_MARK)
- loclist = tree_cons (NULL_TREE, expr, loclist);
- }
- }
- switch (PEEK_TOKEN ())
- {
- case OR: op = BIT_IOR_EXPR; break;
- case XOR: op = BIT_XOR_EXPR; break;
- case ORIF: op = TRUTH_ORIF_EXPR; break;
- case AND: op = BIT_AND_EXPR; break;
- case ANDIF: op = TRUTH_ANDIF_EXPR; break;
- case PLUS: op = PLUS_EXPR; break;
- case SUB: op = MINUS_EXPR; break;
- case CONCAT: op = CONCAT_EXPR; break;
- case MUL: op = MULT_EXPR; break;
- case DIV: op = TRUNC_DIV_EXPR; break;
- case MOD: op = FLOOR_MOD_EXPR; break;
- case REM: op = TRUNC_MOD_EXPR; break;
-
- default:
- error ("syntax error in action");
- case SC: case ON:
- case ASGN: op = NOP_EXPR; break;
- ;
- }
-
- /* Looks like it was an assignment action. */
- FORWARD_TOKEN ();
- if (op != NOP_EXPR)
- expect (ASGN, "expected ':=' here");
- rhs = parse_untyped_expr ();
- if (!ignoring)
- expand_assignment_action (loclist, op, rhs);
- goto handler_action;
-
- default:
- return 0;
- }
-
- bracketed_action:
- /* We've parsed a bracketed action. */
- parse_opt_handler ();
- parse_opt_end_label_semi_colon (label);
- return 1;
-
- no_handler_action:
- if (parse_opt_handler () != NULL_TREE && pass == 1)
- error ("no handler is permitted on this action.");
- parse_semi_colon ();
- return 1;
-
- handler_action:
- parse_opt_handler ();
- parse_semi_colon ();
- return 1;
-}
-
-static void
-parse_body ()
-{
- again:
- while (parse_definition (0)) ;
-
- while (parse_action ()) ;
-
- if (parse_definition (0))
- {
- if (pass == 1)
- pedwarn ("definition follows action");
- goto again;
- }
-}
-
-static tree
-parse_opt_untyped_expr ()
-{
- switch (PEEK_TOKEN ())
- {
- case ON:
- case END:
- case SC:
- case COMMA:
- case COLON:
- case RPRN:
- return NULL_TREE;
- default:
- return parse_untyped_expr ();
- }
-}
-
-static tree
-parse_call (function)
- tree function;
-{
- tree arg1, arg2, arg_list = NULL_TREE;
- enum terminal tok;
- require (LPRN);
- arg1 = parse_opt_untyped_expr ();
- if (arg1 != NULL_TREE)
- {
- tok = PEEK_TOKEN ();
- if (tok == UP || tok == COLON)
- {
- FORWARD_TOKEN ();
-#if 0
- /* check that arg1 isn't untyped (or mode);*/
-#endif
- arg2 = parse_expression ();
- expect (RPRN, "expected ')' to terminate slice");
- if (ignoring)
- return integer_zero_node;
- else if (tok == UP)
- return build_chill_slice_with_length (function, arg1, arg2);
- else
- return build_chill_slice_with_range (function, arg1, arg2);
- }
- if (!ignoring)
- arg_list = build_tree_list (NULL_TREE, arg1);
- while (check_token (COMMA))
- {
- arg2 = parse_untyped_expr ();
- if (!ignoring)
- arg_list = tree_cons (NULL_TREE, arg2, arg_list);
- }
- }
-
- expect (RPRN, "expected ')' here");
- return ignoring ? function
- : build_generalized_call (function, nreverse (arg_list));
-}
-
-/* Matches: <field name list>
- Returns: A list of IDENTIFIER_NODEs (or NULL_TREE if ignoring),
- in reverse order. */
-
-static tree
-parse_tuple_fieldname_list ()
-{
- tree list = NULL_TREE;
- do
- {
- tree name;
- if (!check_token (DOT))
- {
- error ("bad tuple field name list");
- return NULL_TREE;
- }
- name = parse_simple_name_string ();
- list = ignoring ? NULL_TREE : tree_cons (NULL_TREE, name, list);
- } while (check_token (COMMA));
- return list;
-}
-
-/* Returns one or nore TREE_LIST nodes, in reverse order. */
-
-static tree
-parse_tuple_element ()
-{
- /* The tupleelement chain is built in reverse order,
- and put in forward order when the list is used. */
- tree value, label;
- if (PEEK_TOKEN () == DOT)
- {
- /* Parse a labelled structure tuple. */
- tree list = parse_tuple_fieldname_list (), field;
- expect (COLON, "missing ':' in tuple");
- value = parse_untyped_expr ();
- if (ignoring)
- return NULL_TREE;
- /* FIXME: Should use save_expr(value), but that
- confuses nested calls to digest_init! */
- /* Re-use the list of field names as a list of name-value pairs. */
- for (field = list; field != NULL_TREE; field = TREE_CHAIN (field))
- { tree field_name = TREE_VALUE (field);
- TREE_PURPOSE (field) = field_name;
- TREE_VALUE (field) = value;
- TUPLE_NAMED_FIELD (field) = 1;
- }
- return list;
- }
-
- label = parse_case_label_list (NULL_TREE, 1);
- if (label)
- {
- expect (COLON, "missing ':' in tuple");
- value = parse_untyped_expr ();
- if (ignoring || label == NULL_TREE)
- return NULL_TREE;
- if (TREE_CODE (label) != TREE_LIST)
- {
- error ("invalid syntax for label in tuple");
- return NULL_TREE;
- }
- else
- {
- /* FIXME: Should use save_expr(value), but that
- confuses nested calls to digest_init! */
- tree link = label;
- for (; link != NULL_TREE; link = TREE_CHAIN (link))
- { tree index = TREE_VALUE (link);
- if (pass == 1 && TREE_CODE (index) != TREE_LIST)
- index = build1 (PAREN_EXPR, NULL_TREE, index);
- TREE_VALUE (link) = value;
- TREE_PURPOSE (link) = index;
- }
- return nreverse (label);
- }
- }
-
- value = parse_untyped_expr ();
- if (check_token (COLON))
- {
- /* A powerset range [or possibly a labeled Array?] */
- tree value2 = parse_untyped_expr ();
- return ignoring ? NULL_TREE : build_tree_list (value, value2);
- }
- return ignoring ? NULL_TREE : build_tree_list (NULL_TREE, value);
-}
-
-/* Matches: a COMMA-separated list of tuple elements.
- Returns a list (of TREE_LIST nodes). */
-static tree
-parse_opt_element_list ()
-{
- tree list = NULL_TREE;
- if (PEEK_TOKEN () == RPC)
- return NULL_TREE;
- for (;;)
- {
- tree element = parse_tuple_element ();
- list = chainon (element, list); /* Built in reverse order */
- if (PEEK_TOKEN () == RPC)
- break;
- if (!check_token (COMMA))
- {
- error ("bad syntax in tuple");
- return NULL_TREE;
- }
- }
- return nreverse (list);
-}
-
-/* Parses: '[' elements ']'
- If modename is non-NULL it prefixed the tuple. */
-
-static tree
-parse_tuple (modename)
- tree modename;
-{
- tree list;
- require (LPC);
- list = parse_opt_element_list ();
- expect (RPC, "missing ']' after tuple");
- if (ignoring)
- return integer_zero_node;
- list = build_nt (CONSTRUCTOR, NULL_TREE, list);
- if (modename == NULL_TREE)
- return list;
- else if (pass == 1)
- TREE_TYPE (list) = modename;
- else if (TREE_CODE (modename) != TYPE_DECL)
- {
- error ("non-mode name before tuple");
- return error_mark_node;
- }
- else
- list = chill_expand_tuple (TREE_TYPE (modename), list);
- return list;
-}
-
-static tree
-parse_primval ()
-{
- tree val;
- switch (PEEK_TOKEN ())
- {
- case NUMBER:
- case FLOATING:
- case STRING:
- case SINGLECHAR:
- case BITSTRING:
- case CONST:
- case EXPR:
- val = PEEK_TREE();
- FORWARD_TOKEN ();
- break;
- case THIS:
- val = build_chill_function_call (PEEK_TREE (), NULL_TREE);
- FORWARD_TOKEN ();
- break;
- case LPRN:
- FORWARD_TOKEN ();
- val = parse_expression ();
- expect (RPRN, "missing right parenthesis");
- if (pass == 1 && ! ignoring)
- val = build1 (PAREN_EXPR, NULL_TREE, val);
- break;
- case LPC:
- val = parse_tuple (NULL_TREE);
- break;
- case NAME:
- val = parse_name ();
- if (PEEK_TOKEN() == LPC)
- val = parse_tuple (val); /* Matched: <mode_name> <tuple> */
- break;
- default:
- if (!ignoring)
- error ("invalid expression/location syntax");
- val = error_mark_node;
- }
- for (;;)
- {
- tree name, args;
- switch (PEEK_TOKEN ())
- {
- case DOT:
- FORWARD_TOKEN ();
- name = parse_simple_name_string ();
- val = ignoring ? val : build_chill_component_ref (val, name);
- continue;
- case ARROW:
- FORWARD_TOKEN ();
- name = parse_opt_name_string (0);
- val = ignoring ? val : build_chill_indirect_ref (val, name, 1);
- continue;
- case LPRN:
- /* The SEND buffer action syntax is ambiguous, at least when
- parsed left-to-right. In the example 'SEND foo(v) ...' the
- phrase 'foo(v)' could be a buffer location procedure call
- (which then must be followed by the value to send).
- On the other hand, if 'foo' is a buffer, stop parsing
- after 'foo', and let parse_send_action pick up '(v) as
- the value ot send.
-
- We handle the ambiguity for SEND signal action differently,
- since we allow (as an extension) a signal to be used as
- a "function" (see build_generalized_call). */
- if (TREE_TYPE (val) != NULL_TREE
- && CH_IS_BUFFER_MODE (TREE_TYPE (val)))
- return val;
- val = parse_call (val);
- continue;
- case STRING:
- case BITSTRING:
- case SINGLECHAR:
- case NAME:
- /* Handle string repetition. (See comment in parse_operand5.) */
- args = parse_primval ();
- val = ignoring ? val : build_generalized_call (val, args);
- continue;
- default:
- break;
- }
- break;
- }
- return val;
-}
-
-static tree
-parse_operand6 ()
-{
- if (check_token (RECEIVE))
- {
- tree location ATTRIBUTE_UNUSED = parse_primval ();
- sorry ("RECEIVE expression");
- return integer_one_node;
- }
- else if (check_token (ARROW))
- {
- tree location = parse_primval ();
- return ignoring ? location : build_chill_arrow_expr (location, 0);
- }
- else
- return parse_primval();
-}
-
-static tree
-parse_operand5()
-{
- enum tree_code op;
- /* We are supposed to be looking for a <string repetition operator>,
- but in general we can't distinguish that from a parenthesized
- expression. This is especially difficult if we allow the
- string operand to be a constant expression (as requested by
- some users), and not just a string literal.
- Consider: LPRN expr RPRN LPRN expr RPRN
- Is that a function call or string repetition?
- Instead, we handle string repetition in parse_primval,
- and build_generalized_call. */
- tree rarg;
- switch (PEEK_TOKEN())
- {
- case NOT: op = BIT_NOT_EXPR; break;
- case SUB: op = NEGATE_EXPR; break;
- default:
- op = NOP_EXPR;
- }
- if (op != NOP_EXPR)
- FORWARD_TOKEN();
- rarg = parse_operand6();
- return (op == NOP_EXPR || ignoring) ? rarg
- : build_chill_unary_op (op, rarg);
-}
-
-static tree
-parse_operand4 ()
-{
- tree larg = parse_operand5(), rarg;
- enum tree_code op;
- for (;;)
- {
- switch (PEEK_TOKEN())
- {
- case MUL: op = MULT_EXPR; break;
- case DIV: op = TRUNC_DIV_EXPR; break;
- case MOD: op = FLOOR_MOD_EXPR; break;
- case REM: op = TRUNC_MOD_EXPR; break;
- default:
- return larg;
- }
- FORWARD_TOKEN();
- rarg = parse_operand5();
- if (!ignoring)
- larg = build_chill_binary_op (op, larg, rarg);
- }
-}
-
-static tree
-parse_operand3 ()
-{
- tree larg = parse_operand4 (), rarg;
- enum tree_code op;
- for (;;)
- {
- switch (PEEK_TOKEN())
- {
- case PLUS: op = PLUS_EXPR; break;
- case SUB: op = MINUS_EXPR; break;
- case CONCAT: op = CONCAT_EXPR; break;
- default:
- return larg;
- }
- FORWARD_TOKEN();
- rarg = parse_operand4();
- if (!ignoring)
- larg = build_chill_binary_op (op, larg, rarg);
- }
-}
-
-static tree
-parse_operand2 ()
-{
- tree larg = parse_operand3 (), rarg;
- enum tree_code op;
- for (;;)
- {
- if (check_token (IN))
- {
- rarg = parse_operand3();
- if (! ignoring)
- larg = build_chill_binary_op (SET_IN_EXPR, larg, rarg);
- }
- else
- {
- switch (PEEK_TOKEN())
- {
- case GT: op = GT_EXPR; break;
- case GTE: op = GE_EXPR; break;
- case LT: op = LT_EXPR; break;
- case LTE: op = LE_EXPR; break;
- case EQL: op = EQ_EXPR; break;
- case NE: op = NE_EXPR; break;
- default:
- return larg;
- }
- FORWARD_TOKEN();
- rarg = parse_operand3();
- if (!ignoring)
- larg = build_compare_expr (op, larg, rarg);
- }
- }
-}
-
-static tree
-parse_operand1 ()
-{
- tree larg = parse_operand2 (), rarg;
- enum tree_code op;
- for (;;)
- {
- switch (PEEK_TOKEN())
- {
- case AND: op = BIT_AND_EXPR; break;
- case ANDIF: op = TRUTH_ANDIF_EXPR; break;
- default:
- return larg;
- }
- FORWARD_TOKEN();
- rarg = parse_operand2();
- if (!ignoring)
- larg = build_chill_binary_op (op, larg, rarg);
- }
-}
-
-static tree
-parse_operand0 ()
-{
- tree larg = parse_operand1(), rarg;
- enum tree_code op;
- for (;;)
- {
- switch (PEEK_TOKEN())
- {
- case OR: op = BIT_IOR_EXPR; break;
- case XOR: op = BIT_XOR_EXPR; break;
- case ORIF: op = TRUTH_ORIF_EXPR; break;
- default:
- return larg;
- }
- FORWARD_TOKEN();
- rarg = parse_operand1();
- if (!ignoring)
- larg = build_chill_binary_op (op, larg, rarg);
- }
-}
-
-static tree
-parse_expression ()
-{
- return parse_operand0 ();
-}
-
-static tree
-parse_case_expression ()
-{
- tree selector_list;
- tree else_expr;
- tree case_expr;
- tree case_alt_list = NULL_TREE;
-
- require (CASE);
- selector_list = parse_expr_list ();
- selector_list = nreverse (selector_list);
-
- expect (OF, "missing 'OF'");
- while (PEEK_TOKEN () == LPRN)
- {
- tree label_spec = parse_case_label_specification (selector_list);
- tree sub_expr;
- expect (COLON, "missing ':' in value case alternative");
- sub_expr = parse_expression ();
- expect (SC, "missing ';'");
- if (! ignoring)
- case_alt_list = tree_cons (label_spec, sub_expr, case_alt_list);
- }
- if (check_token (ELSE))
- {
- else_expr = parse_expression ();
- if (check_token (SC) && pass == 1)
- warning("there should not be a ';' here");
- }
- else
- else_expr = NULL_TREE;
- expect (ESAC, "missing 'ESAC' in 'CASE' expression");
-
- if (ignoring)
- return integer_zero_node;
-
- /* If this is a multi dimension case, then transform it into an COND_EXPR
- here. This must be done before store_expr is called since it has some
- special handling for COND_EXPR expressions. */
- if (TREE_CHAIN (selector_list) != NULL_TREE)
- {
- case_alt_list = nreverse (case_alt_list);
- compute_else_ranges (selector_list, case_alt_list);
- case_expr =
- build_chill_multi_dimension_case_expr (selector_list, case_alt_list, else_expr);
- }
- else
- case_expr = build_chill_case_expr (selector_list, case_alt_list, else_expr);
-
- return case_expr;
-}
-
-static tree
-parse_then_alternative ()
-{
- expect (THEN, "missing 'THEN' in 'IF' expression");
- return parse_expression ();
-}
-
-static tree
-parse_else_alternative ()
-{
- if (check_token (ELSIF))
- return parse_if_expression_body ();
- else if (check_token (ELSE))
- return parse_expression ();
- error ("missing ELSE/ELSIF in IF expression");
- return error_mark_node;
-}
-
-/* Matches: <boolean expression> <then alternative> <else alternative> */
-
-static tree
-parse_if_expression_body ()
-{
- tree bool_expr, then_expr, else_expr;
- bool_expr = parse_expression ();
- then_expr = parse_then_alternative ();
- else_expr = parse_else_alternative ();
- if (ignoring)
- return integer_zero_node;
- else
- return build_nt (COND_EXPR, bool_expr, then_expr, else_expr);
-}
-
-static tree
-parse_if_expression ()
-{
- tree expr;
- require (IF);
- expr = parse_if_expression_body ();
- expect (FI, "missing 'FI' at end of conditional expression");
- return expr;
-}
-
-/* An <untyped_expr> is a superset of <expr>. It also includes
- <conditional expressions> and untyped <tuples>, whose types
- are not given by their constituents. Hence, these are only
- allowed in certain contexts that expect a certain type.
- You should call convert() to fix up the <untyped_expr>. */
-
-static tree
-parse_untyped_expr ()
-{
- tree val;
- switch (PEEK_TOKEN())
- {
- case IF:
- return parse_if_expression ();
- case CASE:
- return parse_case_expression ();
- case LPRN:
- switch (PEEK_TOKEN1())
- {
- case IF:
- case CASE:
- if (pass == 1)
- pedwarn ("conditional expression not allowed inside parentheses");
- goto skip_lprn;
- case LPC:
- if (pass == 1)
- pedwarn ("mode-less tuple not allowed inside parentheses");
- skip_lprn:
- FORWARD_TOKEN ();
- val = parse_untyped_expr ();
- expect (RPRN, "missing ')'");
- return val;
- default: ;
- /* fall through */
- }
- default:
- return parse_operand0 ();
- }
-}
-
-/* Matches: <index mode> */
-
-static tree
-parse_index_mode ()
-{
- /* This is another one that is nasty to parse!
- Let's feel our way ahead ... */
- tree lower, upper;
- if (PEEK_TOKEN () == NAME)
- {
- tree name = parse_name ();
- switch (PEEK_TOKEN ())
- {
- case COMMA:
- case RPRN:
- case SC: /* An error */
- /* This can only (legally) be a discrete mode name. */
- return name;
- case LPRN:
- /* This could be named discrete range,
- a cast, or some other expression (maybe). */
- require (LPRN);
- lower = parse_expression ();
- if (check_token (COLON))
- {
- upper = parse_expression ();
- expect (RPRN, "missing ')'");
- /* Matched: <mode_name> '(' <expr> ':' <expr> ')' */
- if (ignoring)
- return NULL_TREE;
- else
- return build_chill_range_type (name, lower, upper);
- }
- /* Looks like a cast or procedure call or something.
- Backup, and try again. */
- pushback_token (EXPR, lower);
- pushback_token (LPRN, NULL_TREE);
- lower = parse_call (name);
- goto parse_literal_range_colon;
- default:
- /* This has to be the start of an expression. */
- pushback_token (EXPR, name);
- goto parse_literal_range;
- }
- }
- /* It's not a name. But it could still be a discrete mode. */
- lower = parse_opt_mode ();
- if (lower)
- return lower;
- parse_literal_range:
- /* Nope, it's a discrete literal range. */
- lower = parse_expression ();
- parse_literal_range_colon:
- expect (COLON, "expected ':' here");
-
- upper = parse_expression ();
- return ignoring ? NULL_TREE
- : build_chill_range_type (NULL_TREE, lower, upper);
-}
-
-static tree
-parse_set_mode ()
-{
- int set_name_cnt = 0; /* count of named set elements */
- int set_is_numbered = 0; /* TRUE if set elements have explicit values */
- int set_is_not_numbered = 0;
- tree list = NULL_TREE;
- tree mode = ignoring ? void_type_node : start_enum (NULL_TREE);
- require (SET);
- expect (LPRN, "missing left parenthesis after SET");
- for (;;)
- {
- tree name, value = NULL_TREE;
- if (check_token (MUL))
- name = NULL_TREE;
- else
- {
- name = parse_defining_occurrence ();
- if (check_token (EQL))
- {
- value = parse_expression ();
- set_is_numbered = 1;
- }
- else
- set_is_not_numbered = 1;
- set_name_cnt++;
- }
- name = build_enumerator (name, value);
- if (pass == 1)
- list = chainon (name, list);
- if (! check_token (COMMA))
- break;
- }
- expect (RPRN, "missing right parenthesis after SET");
- if (!ignoring)
- {
- if (set_is_numbered && set_is_not_numbered)
- /* Z.200 doesn't allow mixed numbered and unnumbered set elements,
- but we can do it. Print a warning */
- pedwarn ("mixed numbered and unnumbered set elements is not standard");
- mode = finish_enum (mode, list);
- if (set_name_cnt == 0)
- error ("SET mode must define at least one named value");
- CH_ENUM_IS_NUMBERED(mode) = set_is_numbered ? 1 : 0;
- }
- return mode;
-}
-
-/* parse layout POS:
- returns a tree with following layout
-
- treelist
- pupose=treelist value=NULL_TREE (to indicate POS)
- pupose=word value=treelist | NULL_TREE
- pupose=startbit value=treelist | NULL_TREE
- purpose= value=
- integer_zero | integer_one length | endbit
-*/
-static tree
-parse_pos ()
-{
- tree word;
- tree startbit = NULL_TREE, endbit = NULL_TREE;
- tree what = NULL_TREE;
-
- require (LPRN);
- word = parse_untyped_expr ();
- if (check_token (COMMA))
- {
- startbit = parse_untyped_expr ();
- if (check_token (COMMA))
- {
- what = integer_zero_node;
- endbit = parse_untyped_expr ();
- }
- else if (check_token (COLON))
- {
- what = integer_one_node;
- endbit = parse_untyped_expr ();
- }
- }
- require (RPRN);
-
- /* build the tree as described above */
- if (what != NULL_TREE)
- what = tree_cons (what, endbit, NULL_TREE);
- if (startbit != NULL_TREE)
- startbit = tree_cons (startbit, what, NULL_TREE);
- endbit = tree_cons (word, startbit, NULL_TREE);
- return tree_cons (endbit, NULL_TREE, NULL_TREE);
-}
-
-/* parse layout STEP
- returns a tree with the following layout
-
- treelist
- pupose=NULL_TREE value=treelist (to indicate STEP)
- pupose=POS(see baove) value=stepsize | NULL_TREE
-*/
-static tree
-parse_step ()
-{
- tree pos;
- tree stepsize = NULL_TREE;
-
- require (LPRN);
- require (POS);
- pos = parse_pos ();
- if (check_token (COMMA))
- stepsize = parse_untyped_expr ();
- require (RPRN);
- TREE_VALUE (pos) = stepsize;
- return tree_cons (NULL_TREE, pos, NULL_TREE);
-}
-
-/* returns layout for fields or array elements.
- NULL_TREE no layout specified
- integer_one_node PACK specified
- integer_zero_node NOPACK specified
- tree_list PURPOSE POS
- tree_list VALUE STEP
-*/
-static tree
-parse_opt_layout (in)
- int in; /* 0 ... parse structure, 1 ... parse array */
-{
- tree val = NULL_TREE;
-
- if (check_token (PACK))
- {
- return integer_one_node;
- }
- else if (check_token (NOPACK))
- {
- return integer_zero_node;
- }
- else if (check_token (POS))
- {
- val = parse_pos ();
- if (in == 1 && pass == 1)
- {
- error ("POS not allowed for ARRAY");
- val = NULL_TREE;
- }
- return val;
- }
- else if (check_token (STEP))
- {
- val = parse_step ();
- if (in == 0 && pass == 1)
- {
- error ("STEP not allowed in field definition");
- val = NULL_TREE;
- }
- return val;
- }
- else
- return NULL_TREE;
-}
-
-static tree
-parse_field_name_list ()
-{
- tree chain = NULL_TREE;
- tree name = parse_defining_occurrence ();
- if (name == NULL_TREE)
- {
- error("missing field name");
- return NULL_TREE;
- }
- chain = build_tree_list (NULL_TREE, name);
- while (check_token (COMMA))
- {
- name = parse_defining_occurrence ();
- if (name == NULL)
- {
- error ("bad field name following ','");
- break;
- }
- if (! ignoring)
- chain = tree_cons (NULL_TREE, name, chain);
- }
- return chain;
-}
-
-/* Matches: <fixed field> or <variant field>, i.e.:
- <field name defining occurrence list> <mode> [ <field layout> ].
- Returns: A chain of FIELD_DECLs.
- NULL_TREE is returned if ignoring is true or an error is seen. */
-
-static tree
-parse_fixed_field ()
-{
- tree field_names = parse_field_name_list ();
- tree mode = parse_mode ();
- tree layout = parse_opt_layout (0);
- return ignoring ? NULL_TREE
- : grok_chill_fixedfields (field_names, mode, layout);
-}
-
-
-/* Matches: [ <variant field> { "," <variant field> }* ]
- Returns: A chain of FIELD_DECLs.
- NULL_TREE is returned if ignoring is true or an error is seen. */
-
-static tree
-parse_variant_field_list ()
-{
- tree fields = NULL_TREE;
- if (PEEK_TOKEN () != NAME)
- return NULL_TREE;
- for (;;)
- {
- fields = chainon (fields, parse_fixed_field ());
- if (PEEK_TOKEN () != COMMA || PEEK_TOKEN1 () != NAME)
- break;
- require (COMMA);
- }
- return fields;
-}
-
-/* Matches: <variant alternative>
- Returns a TREE_LIST node, whose TREE_PURPOSE (if non-NULL) is the label,
- and whose TREE_VALUE is the list of FIELD_DECLs. */
-
-static tree
-parse_variant_alternative ()
-{
- tree labels;
-
- if (PEEK_TOKEN () == LPRN)
- labels = parse_case_label_specification (NULL_TREE);
- else
- labels = NULL_TREE;
- if (! check_token (COLON))
- {
- error ("expected ':' in structure variant alternative");
- return NULL_TREE;
- }
-
- /* We now read a list a variant fields, until we come to the end
- of the variant alternative. But since both variant fields
- *and* variant alternatives are separated by COMMAs,
- we will have to look ahead to distinguish the start of a variant
- field from the start of a new variant alternative.
- We use the fact that a variant alternative must start with
- either a LPRN or a COLON, while a variant field must start with a NAME.
- This look-ahead is handled by parse_simple_fields. */
- return build_tree_list (labels, parse_variant_field_list ());
-}
-
-/* Parse <field> (which is <fixed field> or <alternative field>).
- Returns: A chain of FIELD_DECLs (or NULL_TREE on error or if ignoring). */
-
-static tree
-parse_field ()
-{
- if (check_token (CASE))
- {
- tree tag_list = NULL_TREE, variants, opt_variant_else;
- if (PEEK_TOKEN () == NAME)
- {
- tag_list = nreverse (parse_field_name_list ());
- if (pass == 1)
- tag_list = lookup_tag_fields (tag_list, current_fieldlist);
- }
- expect (OF, "missing 'OF' in alternative structure field");
-
- variants = parse_variant_alternative ();
- while (check_token (COMMA))
- variants = chainon (parse_variant_alternative (), variants);
- variants = nreverse (variants);
-
- if (check_token (ELSE))
- opt_variant_else = parse_variant_field_list ();
- else
- opt_variant_else = NULL_TREE;
- expect (ESAC, "missing 'ESAC' following alternative structure field");
- if (ignoring)
- return NULL_TREE;
- return grok_chill_variantdefs (tag_list, variants, opt_variant_else);
- }
- else if (PEEK_TOKEN () == NAME)
- return parse_fixed_field ();
- else
- {
- if (pass == 1)
- error ("missing field");
- return NULL_TREE;
- }
-}
-
-static tree
-parse_structure_mode ()
-{
- tree save_fieldlist = current_fieldlist;
- tree fields;
- require (STRUCT);
- expect (LPRN, "expected '(' after STRUCT");
- current_fieldlist = fields = parse_field ();
- while (check_token (COMMA))
- fields = chainon (fields, parse_field ());
- expect (RPRN, "expected ')' after STRUCT");
- current_fieldlist = save_fieldlist;
- return ignoring ? void_type_node : build_chill_struct_type (fields);
-}
-
-static tree
-parse_opt_queue_size ()
-{
- if (check_token (LPRN))
- {
- tree size = parse_expression ();
- expect (RPRN, "missing ')'");
- return size;
- }
- else
- return NULL_TREE;
-}
-
-static tree
-parse_procedure_mode ()
-{
- tree param_types = NULL_TREE, result_spec, except_list, recursive;
- require (PROC);
- expect (LPRN, "missing '(' after PROC");
- if (! check_token (RPRN))
- {
- for (;;)
- {
- tree pmode = parse_mode ();
- tree paramattr = parse_param_attr ();
- if (! ignoring)
- {
- pmode = get_type_of (pmode);
- param_types = tree_cons (paramattr, pmode, param_types);
- }
- if (! check_token (COMMA))
- break;
- }
- expect (RPRN, "missing ')' after PROC");
- }
- result_spec = parse_opt_result_spec ();
- except_list = parse_opt_except ();
- recursive = parse_opt_recursive ();
- if (ignoring)
- return void_type_node;
- return build_chill_pointer_type (build_chill_function_type
- (result_spec, nreverse (param_types),
- except_list, recursive));
-}
-
-/* Matches: <mode>
- A NAME will be assumed to be a <mode name>, and thus a <mode>.
- Returns NULL_TREE if no mode is seen.
- (If ignoring is true, the return value may be an arbitrary tree node,
- but will be non-NULL if something that could be a mode is seen.) */
-
-static tree
-parse_opt_mode ()
-{
- switch (PEEK_TOKEN ())
- {
- case ACCESS:
- {
- tree index_mode, record_mode;
- int dynamic = 0;
- require (ACCESS);
- if (check_token (LPRN))
- {
- index_mode = parse_index_mode ();
- expect (RPRN, "mssing ')'");
- }
- else
- index_mode = NULL_TREE;
- record_mode = parse_opt_mode ();
- if (record_mode)
- dynamic = check_token (DYNAMIC);
- return ignoring ? void_type_node
- : build_access_mode (index_mode, record_mode, dynamic);
- }
- case ARRAY:
- {
- tree index_list = NULL_TREE, base_mode;
- int varying;
- int num_index_modes = 0;
- int i;
- tree layouts = NULL_TREE;
- FORWARD_TOKEN ();
- expect (LPRN, "missing '(' after ARRAY");
- for (;;)
- {
- tree index = parse_index_mode ();
- num_index_modes++;
- if (!ignoring)
- index_list = tree_cons (NULL_TREE, index, index_list);
- if (! check_token (COMMA))
- break;
- }
- expect (RPRN, "missing ')' after ARRAY");
- varying = check_token (VARYING);
- base_mode = parse_mode ();
- /* Allow a layout specification for each index mode */
- for (i = 0; i < num_index_modes; ++i)
- {
- tree new_layout = parse_opt_layout (1);
- if (new_layout == NULL_TREE)
- break;
- if (!ignoring)
- layouts = tree_cons (NULL_TREE, new_layout, layouts);
- }
- if (ignoring)
- return base_mode;
- return build_chill_array_type (get_type_of (base_mode),
- index_list, varying, layouts);
- }
- case ASSOCIATION:
- require (ASSOCIATION);
- return association_type_node;
- case BIN:
- { tree length;
- FORWARD_TOKEN();
- expect (LPRN, "missing left parenthesis after BIN");
- length = parse_expression ();
- expect (RPRN, "missing right parenthesis after BIN");
- return ignoring ? void_type_node : build_chill_bin_type (length);
- }
- case BOOLS:
- {
- tree length;
- FORWARD_TOKEN ();
- expect (LPRN, "missing '(' after BOOLS");
- length = parse_expression ();
- expect (RPRN, "missing ')' after BOOLS");
- if (check_token (VARYING))
- error ("VARYING bit-strings not implemented");
- return ignoring ? void_type_node : build_bitstring_type (length);
- }
- case BUFFER:
- {
- tree qsize, element_mode;
- require (BUFFER);
- qsize = parse_opt_queue_size ();
- element_mode = parse_mode ();
- return ignoring ? element_mode
- : build_buffer_type (element_mode, qsize);
- }
- case CHARS:
- {
- tree length;
- int varying;
- tree type;
- FORWARD_TOKEN ();
- expect (LPRN, "missing '(' after CHARS");
- length = parse_expression ();
- expect (RPRN, "missing ')' after CHARS");
- varying = check_token (VARYING);
- if (ignoring)
- return void_type_node;
- type = build_string_type (char_type_node, length);
- if (varying)
- type = build_varying_struct (type);
- return type;
- }
- case EVENT:
- {
- tree qsize;
- require (EVENT);
- qsize = parse_opt_queue_size ();
- return ignoring ? void_type_node : build_event_type (qsize);
- }
- case NAME:
- {
- tree mode = get_type_of (parse_name ());
- if (check_token (LPRN))
- {
- tree min_value = parse_expression ();
- if (check_token (COLON))
- {
- tree max_value = parse_expression ();
- expect (RPRN, "syntax error - expected ')'");
- /* Matched: <mode_name> '(' <expr> ':' <expr> ')' */
- if (ignoring)
- return mode;
- else
- return build_chill_range_type (mode, min_value, max_value);
- }
- if (check_token (RPRN))
- {
- int varying = check_token (VARYING);
- if (! ignoring)
- {
- if (mode == char_type_node || varying)
- {
- if (mode != char_type_node
- && mode != ridpointers[(int) RID_CHAR])
- error ("strings must be composed of chars");
- mode = build_string_type (char_type_node, min_value);
- if (varying)
- mode = build_varying_struct (mode);
- }
- else
- {
- /* Parameterized mode,
- or old-fashioned CHAR(N) string declaration.. */
- tree pmode = make_node (LANG_TYPE);
- TREE_TYPE (pmode) = mode;
- TYPE_DOMAIN (pmode) = min_value;
- mode = pmode;
- }
- }
- }
- }
- return mode;
- }
- case POWERSET:
- { tree mode;
- FORWARD_TOKEN ();
- mode = parse_mode ();
- if (ignoring || TREE_CODE (mode) == ERROR_MARK)
- return mode;
- return build_powerset_type (get_type_of (mode));
- }
- case PROC:
- return parse_procedure_mode ();
- case RANGE:
- { tree low, high;
- FORWARD_TOKEN();
- expect (LPRN, "missing left parenthesis after RANGE");
- low = parse_expression ();
- expect (COLON, "missing colon");
- high = parse_expression ();
- expect (RPRN, "missing right parenthesis after RANGE");
- return ignoring ? void_type_node
- : build_chill_range_type (NULL_TREE, low, high);
- }
- case READ:
- FORWARD_TOKEN ();
- {
- tree mode2 = get_type_of (parse_mode ());
- if (ignoring || TREE_CODE (mode2) == ERROR_MARK)
- return mode2;
- if (mode2
- && TREE_CODE_CLASS (TREE_CODE (mode2)) == 'd'
- && CH_IS_BUFFER_MODE (mode2))
- {
- error ("BUFFER modes may not be readonly");
- return mode2;
- }
- if (mode2
- && TREE_CODE_CLASS (TREE_CODE (mode2)) == 'd'
- && CH_IS_EVENT_MODE (mode2))
- {
- error ("EVENT modes may not be readonly");
- return mode2;
- }
- return build_readonly_type (mode2);
-
- }
- case REF:
- { tree mode;
- FORWARD_TOKEN ();
- mode = parse_mode ();
- if (ignoring)
- return mode;
- mode = get_type_of (mode);
- return (TREE_CODE (mode) == ERROR_MARK) ? mode
- : build_chill_pointer_type (mode);
- }
- case SET:
- return parse_set_mode ();
- case SIGNAL:
- if (pedantic)
- error ("SIGNAL is not a valid mode");
- return generic_signal_type_node;
- case STRUCT:
- return parse_structure_mode ();
- case TEXT:
- {
- tree length, index_mode;
- int dynamic;
- require (TEXT);
- expect (LPRN, "missing '('");
- length = parse_expression ();
- expect (RPRN, "missing ')'");
- /* FIXME: This should actually look for an optional index_mode,
- but that is tricky to do. */
- index_mode = parse_opt_mode ();
- dynamic = check_token (DYNAMIC);
- return ignoring ? void_type_node
- : build_text_mode (length, index_mode, dynamic);
- }
- case USAGE:
- require (USAGE);
- return usage_type_node;
- case WHERE:
- require (WHERE);
- return where_type_node;
- default:
- return NULL_TREE;
- }
-}
-
-static tree
-parse_mode ()
-{
- tree mode = parse_opt_mode ();
- if (mode == NULL_TREE)
- {
- if (pass == 1)
- error ("syntax error - missing mode");
- mode = error_mark_node;
- }
- return mode;
-}
-
-static void
-parse_program()
-{
- /* Initialize global variables for current pass. */
- int i;
- expand_exit_needed = 0;
- label = NULL_TREE; /* for statement labels */
- current_module = NULL;
- current_function_decl = NULL_TREE;
- in_pseudo_module = 0;
-
- for (i = 0; i <= MAX_LOOK_AHEAD; i++)
- terminal_buffer[i] = TOKEN_NOT_READ;
-
-#if 0
- /* skip some junk */
- while (PEEK_TOKEN() == HEADEREL)
- FORWARD_TOKEN();
-#endif
-
- start_outer_function ();
-
- for (;;)
- {
- tree label = parse_optlabel ();
- if (PEEK_TOKEN() == MODULE || PEEK_TOKEN() == REGION)
- parse_modulion (label);
- else if (PEEK_TOKEN() == SPEC)
- parse_spec_module (label);
- else break;
- }
-
- finish_outer_function ();
-}
-
-static void
-parse_pass_1_2()
-{
- parse_program();
- if (PEEK_TOKEN() != END_PASS_1)
- {
- error ("syntax error - expected a module or end of file");
- serious_errors++;
- }
- chill_finish_compile ();
- if (serious_errors)
- exit (FATAL_EXIT_CODE);
- switch_to_pass_2 ();
- ch_parse_init ();
- except_init_pass_2 ();
- ignoring = 0;
- parse_program();
- chill_finish_compile ();
-}
-
-int yyparse ()
-{
- parse_pass_1_2 ();
- return 0;
-}
-
-/*
- * We've had an error. Move the compiler's state back to
- * the global binding level. This prevents the loop in
- * compile_file in toplev.c from looping forever, since the
- * CHILL poplevel() has *no* effect on the value returned by
- * global_bindings_p().
- */
-void
-to_global_binding_level ()
-{
- while (! global_bindings_p ())
- current_function_decl = DECL_CONTEXT (current_function_decl);
- serious_errors++;
-}
-
-#if 1
-int yydebug;
-/* Sets the value of the 'yydebug' variable to VALUE.
- This is a function so we don't have to have YYDEBUG defined
- in order to build the compiler. */
-void
-set_yydebug (value)
- int value;
-{
-#if YYDEBUG != 0
- yydebug = value;
-#else
- warning ("YYDEBUG not defined.");
-#endif
-}
-#endif
diff --git a/gcc/ch/parse.h b/gcc/ch/parse.h
deleted file mode 100644
index 142b33b3be6..00000000000
--- a/gcc/ch/parse.h
+++ /dev/null
@@ -1,70 +0,0 @@
-typedef union {
- long itype;
- tree ttype;
- enum tree_code code;
- char *filename;
- int lineno;
-} YYSTYPE;
-extern YYSTYPE yylval;
-
-/* DELAY is defined in the standard headers on some platforms like
- SunOS 4.1.4. */
-#ifdef DELAY
-#undef DELAY
-#endif
-
-enum terminal
-{
- /*EOF = 0,*/
- last_char_nonterminal = 256,
- /* Please keep these in alphabetic order, for easier reference and updating.
- */
- ABSOLUTE, ACCESS, AFTER, ALL, ALLOCATE, AND, ANDIF, ARRAY,
- ARROW, ASGN, ASM_KEYWORD, ASSERT, ASSOCIATION, AT,
- BASED, BEGINTOKEN, BIN, BIT, BITSTRING, BODY, BOOLS, BUFFER,
- BUFFERNAME, BUFFER_CODE, BY,
- CALL, CASE, CAUSE, CDDEL, CHAR, CHARS, COLON, COMMA, CONCAT, CONST,
- CONTINUE, CYCLE,
- DCL, DELAY, DIV, DO, DOT, DOWN, DYNAMIC,
- ELSE, ELSIF, END, ENTRY, EQL, ESAC, EVENT, EVENT_CODE, EVER,
- EXCEPTIONS, EXIT,
- EXPR, /* an expression that has been pushed back */
- FI, FLOATING, FOR, FORBID,
- GENERAL, GOTO, GRANT, GT, GTE,
- HEADEREL,
- IF, IGNORED_DIRECTIVE, IN, INIT, INOUT, INLINE,
- LC, LOC, LPC, LPRN, LT, LTE,
- MOD, MODULE, MUL,
- NAME, NE, NEW, NEWMODE, NONREF, NOPACK, NOT, NUMBER,
- OD, OF, ON, OR, ORIF,
- PACK, PARAMATTR, PERVASIVE, PLUS, POS, POWERSET,
- PREFIXED, PRIORITY, PROC, PROCESS,
- RANGE, RC, READ, READTEXT, RECEIVE, RECURSIVE, REF, REGION, REM,
- RESULT, RETURN, RETURNS, ROUND, ROW, RPC, RPRN, RPRN_COLON,
- SAME, SC, SEIZE, SEND, SET, SHARED, SIGNAL, SIGNALNAME, SIMPLE,
- SINGLECHAR, SPEC, START, STATIC, STEP, STOP, STREAM, STRING,
- STRUCT, SUB, SYN, SYNMODE,
- TERMINATE, TEXT, THEN, THIS, TIMEOUT, TO, TRUNC, TYPENAME,
- UP, USAGE,
- VARYING,
- WHERE, WHILE, WITH,
- XOR,
-
-/* These tokens only used within ch-lex.l to process compiler directives */
- ALL_STATIC_OFF, ALL_STATIC_ON, EMPTY_OFF, EMPTY_ON,
- GRANT_FILE_SIZE, PROCESS_TYPE_TOKEN, RANGE_OFF, RANGE_ON,
- SEND_BUFFER_DEFAULT_PRIORITY, SEND_SIGNAL_DEFAULT_PRIORITY,
- SIGNAL_CODE, SIGNAL_MAX_LENGTH, USE_SEIZE_FILE, USE_SEIZE_FILE_RESTRICTED,
- USE_GRANT_FILE,
-
- /* These tokens are recognized, and reported as errors, by the lexer. */
- CONTEXT, REMOTE,
-
-/* This token is passed back to the parser when an the main
- input file (not a seize file) has reached end-of-file. */
- END_PASS_1,
-
- EMPTY, UMINUS,
-
- dummy_last_terminal
-};
diff --git a/gcc/ch/satisfy.c b/gcc/ch/satisfy.c
deleted file mode 100644
index a15d9e20a31..00000000000
--- a/gcc/ch/satisfy.c
+++ /dev/null
@@ -1,629 +0,0 @@
-/* Name-satisfaction for GNU Chill compiler.
- Copyright (C) 1993, 1998, 1999, 2000 Free Software Foundation, Inc.
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-#include "config.h"
-#include "system.h"
-#include "tree.h"
-#include "flags.h"
-#include "ch-tree.h"
-#include "lex.h"
-#include "toplev.h"
-
-#define SATISFY(ARG) ((ARG) = satisfy(ARG, chain))
-
-struct decl_chain
-{
- struct decl_chain *prev;
- /* DECL can be a decl, or a POINTER_TYPE or a REFERENCE_TYPE. */
- tree decl;
-};
-
-/* forward declarations */
-static tree satisfy PARAMS ((tree, struct decl_chain *));
-static void cycle_error_print PARAMS ((struct decl_chain *, tree));
-static tree safe_satisfy_decl PARAMS ((tree, struct decl_chain *));
-static void satisfy_list PARAMS ((tree, struct decl_chain *));
-static void satisfy_list_values PARAMS ((tree, struct decl_chain *));
-
-static struct decl_chain dummy_chain;
-#define LOOKUP_ONLY (chain==&dummy_chain)
-
-/* Recursive helper routine to logically reverse the chain. */
-static void
-cycle_error_print (chain, decl)
- struct decl_chain *chain;
- tree decl;
-{
- if (chain->decl != decl)
- {
- cycle_error_print (chain->prev, decl);
- if (TREE_CODE_CLASS (TREE_CODE (chain->decl)) == 'd')
- error_with_decl (chain->decl, " `%s', which depends on ...");
- }
-}
-
-static tree
-safe_satisfy_decl (decl, prev_chain)
- tree decl;
- struct decl_chain *prev_chain;
-{
- struct decl_chain new_link;
- struct decl_chain *link;
- struct decl_chain *chain = prev_chain;
- const char *save_filename = input_filename;
- int save_lineno = lineno;
- tree result = decl;
-
- if (decl == NULL_TREE)
- return decl;
-
- if (!LOOKUP_ONLY)
- {
- int pointer_type_breaks_cycle = 0;
- /* Look for a cycle.
- We could do this test more efficiently by setting a flag. FIXME */
- for (link = prev_chain; link != NULL; link = link->prev)
- {
- if (TREE_CODE_CLASS (TREE_CODE (link->decl)) != 'd')
- pointer_type_breaks_cycle = 1;
- if (link->decl == decl)
- {
- if (!pointer_type_breaks_cycle)
- {
- error_with_decl (decl, "Cycle: `%s' depends on ...");
- cycle_error_print (prev_chain, decl);
- error_with_decl (decl, " `%s'");
- return error_mark_node;
- }
- /* There is a cycle, but it includes a pointer type,
- so we're OK. However, we still have to continue
- the satisfy (for example in case this is a TYPE_DECL
- that points to a LANG_DECL). The cycle-check for
- POINTER_TYPE/REFERENCE_TYPE should stop the recursion. */
- break;
- }
- }
-
- new_link.decl = decl;
- new_link.prev = prev_chain;
- chain = &new_link;
- }
-
- input_filename = DECL_SOURCE_FILE (decl);
- lineno = DECL_SOURCE_LINE (decl);
-
- switch ((enum chill_tree_code)TREE_CODE (decl))
- {
- case ALIAS_DECL:
- if (!LOOKUP_ONLY && !DECL_POSTFIX_ALL(decl))
- result = safe_satisfy_decl (DECL_ABSTRACT_ORIGIN (decl), chain);
- break;
- case BASED_DECL:
- SATISFY (TREE_TYPE (decl));
- SATISFY (DECL_ABSTRACT_ORIGIN (decl));
- break;
- case CONST_DECL:
- SATISFY (TREE_TYPE (decl));
- SATISFY (DECL_INITIAL (decl));
- if (!LOOKUP_ONLY)
- {
- if (DECL_SIZE (decl) == 0)
- {
- tree init_expr = DECL_INITIAL (decl);
- tree init_type;
- tree specified_mode = TREE_TYPE (decl);
-
- if (init_expr == NULL_TREE
- || TREE_CODE (init_expr) == ERROR_MARK)
- goto bad_const;
- init_type = TREE_TYPE (init_expr);
- if (specified_mode == NULL_TREE)
- {
- if (init_type == NULL_TREE)
- {
- check_have_mode (init_expr, "SYN without mode");
- goto bad_const;
- }
- TREE_TYPE (decl) = init_type;
- CH_DERIVED_FLAG (decl) = CH_DERIVED_FLAG (init_expr);
- }
- else if (CH_IS_ASSOCIATION_MODE (specified_mode) ||
- CH_IS_ACCESS_MODE (specified_mode) || CH_IS_TEXT_MODE (specified_mode) ||
- CH_IS_BUFFER_MODE (specified_mode) || CH_IS_EVENT_MODE (specified_mode))
- {
- error ("SYN of this mode not allowed");
- goto bad_const;
- }
- else if (!CH_COMPATIBLE (init_expr, specified_mode))
- {
- error ("mode of SYN incompatible with value");
- goto bad_const;
- }
- else if (discrete_type_p (specified_mode)
- && TREE_CODE (init_expr) == INTEGER_CST
- && (compare_int_csts (LT_EXPR, init_expr,
- TYPE_MIN_VALUE (specified_mode))
- || compare_int_csts (GT_EXPR, init_expr,
- TYPE_MAX_VALUE(specified_mode))
- ))
- {
- error ("SYN value outside range of its mode");
- /* set an always-valid initial value to prevent
- other errors. */
- DECL_INITIAL (decl) = TYPE_MIN_VALUE (specified_mode);
- }
- else if (CH_STRING_TYPE_P (specified_mode)
- && (init_type && CH_STRING_TYPE_P (init_type))
- && integer_zerop (string_assignment_condition (specified_mode, init_expr)))
- {
- error ("INIT string too large for mode");
- DECL_INITIAL (decl) = error_mark_node;
- }
- else
- {
- struct ch_class class;
- class.mode = TREE_TYPE (decl);
- class.kind = CH_VALUE_CLASS;
- DECL_INITIAL (decl)
- = convert_to_class (class, DECL_INITIAL (decl));
- }
- /* DECL_SIZE is set to prevent re-doing this stuff. */
- DECL_SIZE (decl) = TYPE_SIZE (TREE_TYPE (decl));
- DECL_SIZE_UNIT (decl) = TYPE_SIZE_UNIT (TREE_TYPE (decl));
-
- if (! TREE_CONSTANT (DECL_INITIAL (decl))
- && TREE_CODE (DECL_INITIAL (decl)) != ERROR_MARK)
- {
- error_with_decl (decl,
- "value of %s is not a valid constant");
- DECL_INITIAL (decl) = error_mark_node;
- }
- }
- result = DECL_INITIAL (decl);
- }
- break;
- bad_const:
- DECL_INITIAL (decl) = error_mark_node;
- TREE_TYPE (decl) = error_mark_node;
- return error_mark_node;
- case FUNCTION_DECL:
- SATISFY (TREE_TYPE (decl));
- if (CH_DECL_PROCESS (decl))
- safe_satisfy_decl ((tree) DECL_TASKING_CODE_DECL (decl), prev_chain);
- break;
- case PARM_DECL:
- SATISFY (TREE_TYPE (decl));
- break;
- /* RESULT_DECL doesn't need to be satisfied;
- it's only built internally in pass 2 */
- case TYPE_DECL:
- SATISFY (TREE_TYPE (decl));
- if (CH_DECL_SIGNAL (decl))
- safe_satisfy_decl ((tree) DECL_TASKING_CODE_DECL (decl), prev_chain);
- if (!LOOKUP_ONLY)
- {
- if (TYPE_NAME (TREE_TYPE (decl)) == NULL_TREE)
- TYPE_NAME (TREE_TYPE (decl)) = decl;
- layout_decl (decl, 0);
- if (CH_DECL_SIGNAL (decl) && CH_TYPE_NONVALUE_P (TREE_TYPE (decl)))
- error ("mode with non-value property in signal definition");
- result = TREE_TYPE (decl);
- }
- break;
- case VAR_DECL:
- SATISFY (TREE_TYPE (decl));
- if (!LOOKUP_ONLY)
- {
- layout_decl (decl, 0);
- if (TREE_READONLY (TREE_TYPE (decl)))
- TREE_READONLY (decl) = 1;
- }
- break;
- default:
- ;
- }
-
- /* Now set the DECL_RTL, if needed. */
- if (!LOOKUP_ONLY && DECL_RTL (decl) == 0
- && (TREE_CODE (decl) == VAR_DECL || TREE_CODE (decl) == FUNCTION_DECL
- || TREE_CODE (decl) == CONST_DECL))
- {
- if (TREE_CODE (decl) == FUNCTION_DECL && decl_function_context (decl))
- make_function_rtl (decl);
- else if (!TREE_STATIC (decl) && !DECL_EXTERNAL (decl))
- expand_decl (decl);
- else
- { char * asm_name;
- if (current_module == 0 || TREE_PUBLIC (decl)
- || current_function_decl)
- asm_name = NULL;
- else
- {
- asm_name = (char*)
- alloca (IDENTIFIER_LENGTH (current_module->prefix_name)
- + IDENTIFIER_LENGTH (DECL_NAME (decl)) + 3);
- sprintf (asm_name, "%s__%s",
- IDENTIFIER_POINTER (current_module->prefix_name),
- IDENTIFIER_POINTER (DECL_NAME (decl)));
- }
- make_decl_rtl (decl, asm_name, TREE_PUBLIC (decl));
- }
- }
-
- input_filename = save_filename;
- lineno = save_lineno;
-
- return result;
-}
-
-tree
-satisfy_decl (decl, lookup_only)
- tree decl;
- int lookup_only;
-{
- return safe_satisfy_decl (decl, lookup_only ? &dummy_chain : NULL);
-}
-
-static void
-satisfy_list (exp, chain)
- register tree exp;
- struct decl_chain *chain;
-{
- for (; exp != NULL_TREE; exp = TREE_CHAIN (exp))
- {
- SATISFY (TREE_VALUE (exp));
- SATISFY (TREE_PURPOSE (exp));
- }
-}
-
-static void
-satisfy_list_values (exp, chain)
- register tree exp;
- struct decl_chain *chain;
-{
- for (; exp != NULL_TREE; exp = TREE_CHAIN (exp))
- {
- SATISFY (TREE_VALUE (exp));
- }
-}
-
-static tree
-satisfy (exp, chain)
- tree exp;
- struct decl_chain *chain;
-{
- int arg_length;
- int i;
- tree decl;
-
- if (exp == NULL_TREE)
- return NULL_TREE;
-
-#if 0
- if (!UNSATISFIED (exp))
- return exp;
-#endif
-
- switch (TREE_CODE_CLASS (TREE_CODE (exp)))
- {
- case 'd':
- if (!LOOKUP_ONLY)
- return safe_satisfy_decl (exp, chain);
- break;
- case 'r':
- case 's':
- case '<':
- case 'e':
- switch ((enum chill_tree_code)TREE_CODE (exp))
- {
- case REPLICATE_EXPR:
- goto binary_op;
- case TRUTH_NOT_EXPR:
- goto unary_op;
- case COMPONENT_REF:
- SATISFY (TREE_OPERAND (exp, 0));
- if (!LOOKUP_ONLY && TREE_TYPE (exp) == NULL_TREE)
- return resolve_component_ref (exp);
- return exp;
- case CALL_EXPR:
- SATISFY (TREE_OPERAND (exp, 0));
- SATISFY (TREE_OPERAND (exp, 1));
- if (!LOOKUP_ONLY && TREE_TYPE (exp) == NULL_TREE)
- return build_generalized_call (TREE_OPERAND (exp, 0),
- TREE_OPERAND (exp, 1));
- return exp;
- case CONSTRUCTOR:
- { tree link = TREE_OPERAND (exp, 1);
- int expand_needed = TREE_TYPE (exp)
- && TREE_CODE_CLASS (TREE_CODE (TREE_TYPE (exp))) != 't';
- for (; link != NULL_TREE; link = TREE_CHAIN (link))
- {
- SATISFY (TREE_VALUE (link));
- if (!TUPLE_NAMED_FIELD (link))
- SATISFY (TREE_PURPOSE (link));
- }
- SATISFY (TREE_TYPE (exp));
- if (expand_needed && !LOOKUP_ONLY)
- {
- tree type = TREE_TYPE (exp);
- TREE_TYPE (exp) = NULL_TREE; /* To force expansion. */
- return chill_expand_tuple (type, exp);
- }
- return exp;
- }
- default:
- ;
- }
-
- arg_length = TREE_CODE_LENGTH (TREE_CODE (exp));
- for (i = 0; i < arg_length; i++)
- SATISFY (TREE_OPERAND (exp, i));
- return exp;
- case '1':
- unary_op:
- SATISFY (TREE_OPERAND (exp, 0));
- if ((enum chill_tree_code)TREE_CODE (exp) == PAREN_EXPR)
- return TREE_OPERAND (exp, 0);
- if (!LOOKUP_ONLY)
- return finish_chill_unary_op (exp);
- break;
- case '2':
- binary_op:
- SATISFY (TREE_OPERAND (exp, 0));
- SATISFY (TREE_OPERAND (exp, 1));
- if (!LOOKUP_ONLY && TREE_CODE (exp) != RANGE_EXPR)
- return finish_chill_binary_op (exp);
- break;
- case 'x':
- switch ((enum chill_tree_code)TREE_CODE (exp))
- {
- case IDENTIFIER_NODE:
- decl = lookup_name (exp);
- if (decl == NULL)
- {
- if (LOOKUP_ONLY)
- return exp;
- error ("undeclared identifier `%s'", IDENTIFIER_POINTER (exp));
- return error_mark_node;
- }
- if (LOOKUP_ONLY)
- return decl;
- return safe_satisfy_decl (decl, chain);
- case TREE_LIST:
- satisfy_list (exp, chain);
- break;
- default:
- ;
- }
- break;
- case 't':
- /* If TYPE_SIZE is non-NULL, exp and its subfields has already been
- satified and laid out. The exception is pointer and reference types,
- which we layout before we lay out their TREE_TYPE. */
- if (TYPE_SIZE (exp) && TREE_CODE (exp) != POINTER_TYPE
- && TREE_CODE (exp) != REFERENCE_TYPE)
- return exp;
- if (TYPE_MAIN_VARIANT (exp) != exp)
- SATISFY (TYPE_MAIN_VARIANT (exp));
- switch ((enum chill_tree_code)TREE_CODE (exp))
- {
- case LANG_TYPE:
- {
- tree d = TYPE_DOMAIN (exp);
- tree t = satisfy (TREE_TYPE (exp), chain);
- SATISFY (d);
- /* It is possible that one of the above satisfy calls recursively
- caused exp to be satisfied, in which case we're done. */
- if (TREE_CODE (exp) != LANG_TYPE)
- return exp;
- TREE_TYPE (exp) = t;
- TYPE_DOMAIN (exp) = d;
- if (!LOOKUP_ONLY)
- exp = smash_dummy_type (exp);
- }
- break;
- case ARRAY_TYPE:
- SATISFY (TREE_TYPE (exp));
- SATISFY (TYPE_DOMAIN (exp));
- SATISFY (TYPE_ATTRIBUTES (exp));
- if (!LOOKUP_ONLY)
- CH_TYPE_NONVALUE_P (exp) = CH_TYPE_NONVALUE_P (TREE_TYPE (exp));
- if (!TYPE_SIZE (exp) && !LOOKUP_ONLY)
- exp = layout_chill_array_type (exp);
- break;
- case FUNCTION_TYPE:
- SATISFY (TREE_TYPE (exp));
- if (TREE_CODE_CLASS (TREE_CODE (TREE_TYPE (exp))) != 't'
- && !LOOKUP_ONLY && TREE_CODE (TREE_TYPE (exp)) != ERROR_MARK)
- {
- error ("RETURNS spec with invalid mode");
- TREE_TYPE (exp) = error_mark_node;
- }
- satisfy_list_values (TYPE_ARG_TYPES (exp), chain);
- if (!TYPE_SIZE (exp) && !LOOKUP_ONLY)
- layout_type (exp);
- break;
- case ENUMERAL_TYPE:
- if (TYPE_SIZE (exp) == NULL_TREE && !LOOKUP_ONLY)
- { tree pair;
- /* FIXME: Should this use satisfy_decl? */
- for (pair = TYPE_VALUES (exp); pair; pair = TREE_CHAIN (pair))
- SATISFY (DECL_INITIAL (TREE_VALUE (pair)));
- layout_enum (exp);
- }
- break;
- case INTEGER_TYPE:
- SATISFY (TYPE_MIN_VALUE (exp));
- SATISFY (TYPE_MAX_VALUE (exp));
- if (TREE_TYPE (exp) != NULL_TREE)
- { /* A range type */
- if (TREE_TYPE (exp) != ridpointers[(int) RID_RANGE]
- && TREE_TYPE (exp) != ridpointers[(int) RID_BIN]
- && TREE_TYPE (exp) != string_index_type_dummy)
- SATISFY (TREE_TYPE (exp));
- if (!TYPE_SIZE (exp) && !LOOKUP_ONLY)
- exp = layout_chill_range_type (exp, 1);
- }
- break;
- case POINTER_TYPE:
- case REFERENCE_TYPE:
- if (LOOKUP_ONLY)
- SATISFY (TREE_TYPE (exp));
- else
- {
- struct decl_chain *link;
- int already_seen = 0;
- for (link = chain; ; link = link->prev)
- {
- if (link == NULL)
- {
- struct decl_chain new_link;
- new_link.decl = exp;
- new_link.prev = chain;
- TREE_TYPE (exp) = satisfy (TREE_TYPE (exp), &new_link);
- break;
- }
- else if (link->decl == exp)
- {
- already_seen = 1;
- break;
- }
- }
- if (!TYPE_SIZE (exp))
- {
- layout_type (exp);
- if (TREE_CODE (exp) == REFERENCE_TYPE)
- CH_NOVELTY (exp) = CH_NOVELTY (TREE_TYPE (exp));
- if (! already_seen)
- {
- tree valtype = TREE_TYPE (exp);
- if (TREE_CODE_CLASS (TREE_CODE (valtype)) != 't')
- {
- if (TREE_CODE (valtype) != ERROR_MARK)
- error ("operand to REF is not a mode");
- TREE_TYPE (exp) = error_mark_node;
- return error_mark_node;
- }
- else if (TREE_CODE (exp) == POINTER_TYPE
- && TYPE_POINTER_TO (valtype) == NULL)
- TYPE_POINTER_TO (valtype) = exp;
- }
- }
- }
- break;
- case RECORD_TYPE:
- {
- /* FIXME: detected errors in here will be printed as
- often as this sequence runs. Find another way or
- place to print the errors. */
- /* if we have an ACCESS or TEXT mode we have to set
- maximum_field_alignment to 0 to fit with runtime
- system, even when we compile with -fpack. */
- unsigned int save_maximum_field_alignment = maximum_field_alignment;
-
- if (CH_IS_ACCESS_MODE (exp) || CH_IS_TEXT_MODE (exp))
- maximum_field_alignment = 0;
-
- for (decl = TYPE_FIELDS (exp); decl; decl = TREE_CHAIN (decl))
- {
- SATISFY (TREE_TYPE (decl));
- if (!LOOKUP_ONLY)
- {
- /* if we have a UNION_TYPE here (variant structure), check for
- non-value mode in it. This is not allowed (Z.200/pg. 33) */
- if (TREE_CODE (TREE_TYPE (decl)) == UNION_TYPE &&
- CH_TYPE_NONVALUE_P (TREE_TYPE (decl)))
- {
- error ("field with non-value mode in variant structure not allowed");
- TREE_TYPE (decl) = error_mark_node;
- }
- /* RECORD_TYPE gets the non-value property if one of the
- fields has the non-value property */
- CH_TYPE_NONVALUE_P (exp) |= CH_TYPE_NONVALUE_P (TREE_TYPE (decl));
- }
- if (TREE_CODE (decl) == CONST_DECL)
- {
- SATISFY (DECL_INITIAL (decl));
- if (!LOOKUP_ONLY)
- {
- if (CH_IS_BUFFER_MODE (exp) || CH_IS_EVENT_MODE (exp))
- DECL_INITIAL (decl)
- = check_queue_size (DECL_INITIAL (decl));
- else if (CH_IS_TEXT_MODE (exp) &&
- DECL_NAME (decl) == get_identifier ("__textlength"))
- DECL_INITIAL (decl)
- = check_text_length (DECL_INITIAL (decl));
- }
- }
- else if (TREE_CODE (decl) == FIELD_DECL)
- {
- SATISFY (DECL_INITIAL (decl));
- }
- }
- satisfy_list (TYPE_TAG_VALUES (exp), chain);
- if (!TYPE_SIZE (exp) && !LOOKUP_ONLY)
- exp = layout_chill_struct_type (exp);
- maximum_field_alignment = save_maximum_field_alignment;
-
- /* perform some checks on nonvalue modes, they are record_mode's */
- if (!LOOKUP_ONLY)
- {
- if (CH_IS_BUFFER_MODE (exp))
- {
- tree elemmode = buffer_element_mode (exp);
- if (elemmode != NULL_TREE && CH_TYPE_NONVALUE_P (elemmode))
- {
- error ("buffer element mode must not have non-value property");
- invalidate_buffer_element_mode (exp);
- }
- }
- else if (CH_IS_ACCESS_MODE (exp))
- {
- tree recordmode = access_recordmode (exp);
- if (recordmode != NULL_TREE && CH_TYPE_NONVALUE_P (recordmode))
- {
- error ("recordmode must not have the non-value property");
- invalidate_access_recordmode (exp);
- }
- }
- }
- }
- break;
- case SET_TYPE:
- SATISFY (TYPE_DOMAIN (exp));
- if (!TYPE_SIZE (exp) && !LOOKUP_ONLY)
- exp = layout_powerset_type (exp);
- break;
- case UNION_TYPE:
- for (decl = TYPE_FIELDS (exp); decl; decl = TREE_CHAIN (decl))
- {
- SATISFY (TREE_TYPE (decl));
- if (!LOOKUP_ONLY)
- CH_TYPE_NONVALUE_P (exp) |= CH_TYPE_NONVALUE_P (TREE_TYPE (decl));
- }
- if (!TYPE_SIZE (exp) && !LOOKUP_ONLY)
- exp = layout_chill_variants (exp);
- break;
- default:
- ;
- }
- }
- return exp;
-}
diff --git a/gcc/ch/tasking.c b/gcc/ch/tasking.c
deleted file mode 100644
index 310ccb5c211..00000000000
--- a/gcc/ch/tasking.c
+++ /dev/null
@@ -1,3432 +0,0 @@
-/* Implement tasking-related actions for CHILL.
- Copyright (C) 1992, 1993, 1994, 1998, 1999, 2000
- Free Software Foundation, Inc.
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-#include "config.h"
-#include "system.h"
-#include "tree.h"
-#include "rtl.h"
-#include "ch-tree.h"
-#include "flags.h"
-#include "input.h"
-#include "obstack.h"
-#include "assert.h"
-#include "tasking.h"
-#include "lex.h"
-#include "toplev.h"
-
-/* from ch-lex.l, from compiler directives */
-extern tree process_type;
-extern tree send_signal_prio;
-extern tree send_buffer_prio;
-
-tree tasking_message_type;
-tree instance_type_node;
-tree generic_signal_type_node;
-
-/* the type a tasking code variable has */
-tree chill_taskingcode_type_node;
-
-/* forward declarations */
-#if 0
-static void validate_process_parameters PARAMS ((tree));
-static tree get_struct_variable_name PARAMS ((tree));
-static tree decl_tasking_code_variable PARAMS ((tree, tree *, int));
-#endif
-static tree get_struct_debug_type_name PARAMS ((tree));
-static tree get_process_wrapper_name PARAMS ((tree));
-static tree build_tasking_enum PARAMS ((void));
-static void build_tasking_message_type PARAMS ((void));
-static tree build_receive_signal_case_label PARAMS ((tree, tree));
-static tree build_receive_buffer_case_label PARAMS ((tree, tree));
-static void build_receive_buffer_case_end PARAMS ((tree, tree));
-static void build_receive_signal_case_end PARAMS ((tree, tree));
-
-/* list of this module's process, buffer, etc. decls.
- This is a list of TREE_VECs, chain by their TREE_CHAINs. */
-tree tasking_list = NULL_TREE;
-/* The parts of a tasking_list element. */
-#define TASK_INFO_PDECL(NODE) TREE_VEC_ELT(NODE,0)
-#define TASK_INFO_ENTRY(NODE) TREE_VEC_ELT(NODE,1)
-#define TASK_INFO_CODE_DECL(NODE) TREE_VEC_ELT(NODE,2)
-#define TASK_INFO_STUFF_NUM(NODE) TREE_VEC_ELT(NODE,3)
-#define TASK_INFO_STUFF_TYPE(NODE) TREE_VEC_ELT(NODE,4)
-
-/* name template for process argument type */
-#define STRUCT_NAME "__tmp_%s_arg_type"
-
-/* name template for process arguments for debugging type */
-#define STRUCT_DEBUG_NAME "__tmp_%s_debug_type"
-
-/* name template for process argument variable */
-#define DATA_NAME "__tmp_%s_arg_variable"
-
-/* name template for process wrapper */
-#define WRAPPER_NAME "__tmp_%s_wrapper"
-
-/* name template for process code */
-#define SKELNAME "__tmp_%s_code"
-
-extern int ignoring;
-static tree void_ftype_void;
-static tree pointer_to_instance;
-static tree infinite_buffer_event_length_node;
-
-tree
-get_struct_type_name (name)
- tree name;
-{
- const char *idp = IDENTIFIER_POINTER (name); /* process name */
- char *tmpname = xmalloc (strlen (idp) + sizeof (STRUCT_NAME));
-
- sprintf (tmpname, STRUCT_NAME, idp);
- return get_identifier (tmpname);
-}
-
-static tree
-get_struct_debug_type_name (name)
- tree name;
-{
- const char *idp = IDENTIFIER_POINTER (name); /* process name */
- char *tmpname = xmalloc (strlen (idp) + sizeof (STRUCT_DEBUG_NAME));
-
- sprintf (tmpname, STRUCT_DEBUG_NAME, idp);
- return get_identifier (tmpname);
-}
-
-
-tree
-get_tasking_code_name (name)
- tree name;
-{
- const char *name_str = IDENTIFIER_POINTER (name);
- char *tmpname = (char *) alloca (IDENTIFIER_LENGTH (name) +
- sizeof (SKELNAME));
-
- sprintf (tmpname, SKELNAME, name_str);
- return get_identifier (tmpname);
-}
-
-#if 0
-static tree
-get_struct_variable_name (name)
- tree name;
-{
- const char *idp = IDENTIFIER_POINTER (name); /* process name */
- char *tmpname = xmalloc (strlen (idp) + sizeof (DATA_NAME));
-
- sprintf (tmpname, DATA_NAME, idp);
- return get_identifier (tmpname);
-}
-#endif
-
-static tree
-get_process_wrapper_name (name)
- tree name;
-{
- const char *idp = IDENTIFIER_POINTER (name);
- char *tmpname = xmalloc (strlen (idp) + sizeof (WRAPPER_NAME));
-
- sprintf (tmpname, WRAPPER_NAME, idp);
- return get_identifier (tmpname);
-}
-
-/*
- * If this is a quasi declaration - parsed within a SPEC MODULE,
- * QUASI_FLAG is TRUE, to indicate that the variable should not
- * be initialized. The other module will do that.
- */
-tree
-generate_tasking_code_variable (name, tasking_code_ptr, quasi_flag)
- tree name, *tasking_code_ptr;
- int quasi_flag;
-{
-
- tree decl;
- tree tasking_code_name = get_tasking_code_name (name);
-
- if (pass == 2 && ! quasi_flag && *tasking_code_ptr != NULL_TREE)
- {
- /* check for value should be assigned is out of range */
- if (TREE_INT_CST_LOW (*tasking_code_ptr) >
- TREE_INT_CST_LOW (TYPE_MAX_VALUE (chill_taskingcode_type_node)))
- error ("Tasking code %ld out of range for `%s'.",
- (long) TREE_INT_CST_LOW (*tasking_code_ptr),
- IDENTIFIER_POINTER (name));
- }
-
- decl = do_decl (tasking_code_name,
- chill_taskingcode_type_node, 1, 1,
- quasi_flag ? NULL_TREE : *tasking_code_ptr,
- 0);
-
- /* prevent granting of this type */
- DECL_SOURCE_LINE (decl) = 0;
-
- if (pass == 2 && ! quasi_flag && *tasking_code_ptr != NULL_TREE)
- *tasking_code_ptr = fold (build (PLUS_EXPR, chill_taskingcode_type_node,
- integer_one_node,
- *tasking_code_ptr));
- return decl;
-}
-
-
-/*
- * If this is a quasi declaration - parsed within a SPEC MODULE,
- * QUASI_FLAG is TRUE, to indicate that the variable should not
- * be initialized. The other module will do that. This is just
- * for BUFFERs and EVENTs.
- */
-#if 0
-static tree
-decl_tasking_code_variable (name, tasking_code_ptr, quasi_flag)
- tree name, *tasking_code_ptr;
- int quasi_flag;
-{
- extern struct obstack permanent_obstack;
- tree tasking_code_name = get_tasking_code_name (name);
- tree decl;
-
- /* guarantee that RTL for the code_variable resides in
- the permanent obstack. The BUFFER or EVENT may be
- declared in a PROC, not at global scope... */
- push_obstacks (&permanent_obstack, &permanent_obstack);
- push_obstacks_nochange ();
-
- if (pass == 2 && ! quasi_flag && *tasking_code_ptr != NULL_TREE)
- {
- /* check for value should be assigned is out of range */
- if (TREE_INT_CST_LOW (*tasking_code_ptr) >
- TREE_INT_CST_LOW (TYPE_MAX_VALUE (chill_taskingcode_type_node)))
- error ("Tasking code %ld out of range for `%s'.",
- (long) TREE_INT_CST_LOW (*tasking_code_ptr),
- IDENTIFIER_POINTER (name));
- }
-
- decl = decl_temp1 (tasking_code_name,
- chill_taskingcode_type_node, 1,
- quasi_flag ? NULL_TREE : *tasking_code_ptr,
- 0, 0);
- /* prevent granting of this type */
- DECL_SOURCE_LINE (decl) = 0;
-
- /* Return to the ambient context. */
- pop_obstacks ();
-
- if (pass == 2 && ! quasi_flag && *tasking_code_ptr != NULL_TREE)
- *tasking_code_ptr = fold (build (PLUS_EXPR, chill_taskingcode_type_node,
- integer_one_node,
- *tasking_code_ptr));
- return decl;
-}
-#endif
-
-/*
- * Transmute a process parameter list into an argument structure
- * TYPE_DECL for the start_process call to reference. Create a
- * proc_type variable for later. Returns the new struct type.
- */
-tree
-make_process_struct (name, processparlist)
- tree name, processparlist;
-{
- tree temp;
- tree a_parm;
- tree field_decls = NULL_TREE;
-
- if (name == NULL_TREE || TREE_CODE (name) == ERROR_MARK)
- return error_mark_node;
-
- if (processparlist == NULL_TREE)
- return tree_cons (NULL_TREE, NULL_TREE, void_list_node);
-
- if (TREE_CODE (processparlist) == ERROR_MARK)
- return error_mark_node;
-
- /* build list of field decls for build_chill_struct_type */
- for (a_parm = processparlist; a_parm != NULL_TREE;
- a_parm = TREE_CHAIN (a_parm))
- {
- tree parnamelist = TREE_VALUE (a_parm);
- tree purpose = TREE_PURPOSE (a_parm);
- tree mode = TREE_VALUE (purpose);
- tree parm_attr = TREE_PURPOSE (purpose);
- tree field;
-
- /* build a FIELD_DECL node */
- if (parm_attr != NULL_TREE)
- {
- if (parm_attr == ridpointers[(int)RID_LOC])
- mode = build_chill_reference_type (mode);
- else if (parm_attr == ridpointers[(int)RID_IN])
- ;
- else if (pass == 1)
- {
- for (field = parnamelist; field != NULL_TREE;
- field = TREE_CHAIN (field))
- error ("invalid attribute for argument `%s' (only IN or LOC allowed).",
- IDENTIFIER_POINTER (TREE_VALUE (field)));
- }
- }
-
- field = grok_chill_fixedfields (parnamelist, mode, NULL_TREE);
-
- /* chain the fields in reverse */
- if (field_decls == NULL_TREE)
- field_decls = field;
- else
- chainon (field_decls, field);
- }
-
- temp = build_chill_struct_type (field_decls);
- return temp;
-}
-
-/* Build a function for a PROCESS and define some
- types for the process arguments.
- After the PROCESS a wrapper function will be
- generated which gets the PROCESS arguments via a pointer
- to a structure having the same layout as the arguments.
- This wrapper function then will call the PROCESS.
- The advantage in doing it this way is, that PROCESS
- arguments may be displayed by gdb without any change
- to gdb.
-*/
-tree
-build_process_header (plabel, paramlist)
- tree plabel, paramlist;
-{
- tree struct_ptr_type = NULL_TREE;
- tree new_param_list = NULL_TREE;
- tree struct_decl = NULL_TREE;
- tree process_struct = NULL_TREE;
- tree struct_debug_type = NULL_TREE;
- tree code_decl;
-
- if (! global_bindings_p ())
- {
- error ("PROCESS may only be declared at module level");
- return error_mark_node;
- }
-
- if (paramlist)
- {
- /* must make the structure OUTSIDE the parameter scope */
- if (pass == 1)
- {
- process_struct = make_process_struct (plabel, paramlist);
- struct_ptr_type = build_chill_pointer_type (process_struct);
- }
- else
- {
- process_struct = NULL_TREE;
- struct_ptr_type = NULL_TREE;
- }
-
- struct_decl = push_modedef (get_struct_type_name (plabel),
- struct_ptr_type, -1);
- DECL_SOURCE_LINE (struct_decl) = 0;
- struct_debug_type = push_modedef (get_struct_debug_type_name (plabel),
- process_struct, -1);
- DECL_SOURCE_LINE (struct_debug_type) = 0;
-
- if (pass == 2)
- {
- /* build a list of PARM_DECL's */
- tree wrk = paramlist;
- tree tmp, list = NULL_TREE;
-
- while (wrk != NULL_TREE)
- {
- tree wrk1 = TREE_VALUE (wrk);
-
- while (wrk1 != NULL_TREE)
- {
- tmp = make_node (PARM_DECL);
- DECL_ASSEMBLER_NAME (tmp) = DECL_NAME (tmp) = TREE_VALUE (wrk1);
- if (list == NULL_TREE)
- new_param_list = list = tmp;
- else
- {
- TREE_CHAIN (list) = tmp;
- list = tmp;
- }
- wrk1 = TREE_CHAIN (wrk1);
- }
- wrk = TREE_CHAIN (wrk);
- }
- }
- else
- {
- /* build a list of modes */
- tree wrk = paramlist;
-
- while (wrk != NULL_TREE)
- {
- tree wrk1 = TREE_VALUE (wrk);
-
- while (wrk1 != NULL_TREE)
- {
- new_param_list = tree_cons (TREE_PURPOSE (TREE_PURPOSE (wrk)),
- TREE_VALUE (TREE_PURPOSE (wrk)),
- new_param_list);
- wrk1 = TREE_CHAIN (wrk1);
- }
- wrk = TREE_CHAIN (wrk);
- }
- new_param_list = nreverse (new_param_list);
- }
- }
-
- /* declare the code variable outside the process */
- code_decl = generate_tasking_code_variable (plabel,
- &process_type, 0);
-
- /* start the parameter scope */
- push_chill_function_context ();
-
- if (! start_chill_function (plabel, void_type_node,
- new_param_list, NULL_TREE, NULL_TREE))
- return error_mark_node;
-
- current_module->procedure_seen = 1;
- CH_DECL_PROCESS (current_function_decl) = 1;
- /* remember the code variable in the function decl */
- DECL_TASKING_CODE_DECL (current_function_decl) =
- (struct lang_decl *)code_decl;
- if (paramlist == NULL_TREE)
- /* do it here, cause we don't have a wrapper */
- add_taskstuff_to_list (code_decl, "_TT_Process", process_type,
- current_function_decl, NULL_TREE);
-
- return perm_tree_cons (code_decl, struct_decl, NULL_TREE);
-}
-
-/* Generate a function which gets a pointer
- to an argument block and call the corresponding
- PROCESS
-*/
-void
-build_process_wrapper (plabel, processdata)
- tree plabel;
- tree processdata;
-{
- tree args = NULL_TREE;
- tree wrapper = NULL_TREE;
- tree parammode = TREE_VALUE (processdata);
- tree code_decl = TREE_PURPOSE (processdata);
- tree func = lookup_name (plabel);
-
- /* check the mode. If it is an ERROR_MARK there was an error
- in build_process_header, if it is a NULL_TREE the process
- don't have parameters, so we must not generate a wrapper */
- if (parammode == NULL_TREE ||
- TREE_CODE (parammode) == ERROR_MARK)
- return;
-
- /* get the function name */
- wrapper = get_process_wrapper_name (plabel);
-
- /* build the argument */
- if (pass == 2)
- {
- /* build a PARM_DECL */
- args = make_node (PARM_DECL);
- DECL_ASSEMBLER_NAME (args) = DECL_NAME (args) = get_identifier ("x");
- }
- else
- {
- /* build a tree list with the mode */
- args = tree_cons (NULL_TREE,
- TREE_TYPE (parammode),
- NULL_TREE);
- }
-
- /* start the function */
- push_chill_function_context ();
-
- if (! start_chill_function (wrapper, void_type_node,
- args, NULL_TREE, NULL_TREE))
- return;
-
- /* to avoid granting */
- DECL_SOURCE_LINE (current_function_decl) = 0;
-
- if (! ignoring)
- {
- /* make the call to the PROCESS */
- tree wrk;
- tree x = lookup_name (get_identifier ("x"));
- /* no need to check this pointer to be NULL */
- tree indref = build_chill_indirect_ref (x, NULL_TREE, 0);
-
- args = NULL_TREE;
- wrk = TYPE_FIELDS (TREE_TYPE (TREE_TYPE (x)));
- while (wrk != NULL_TREE)
- {
- args = tree_cons (NULL_TREE,
- build_component_ref (indref, DECL_NAME (wrk)),
- args);
- wrk = TREE_CHAIN (wrk);
- }
- CH_DECL_PROCESS (func) = 0;
- expand_expr_stmt (
- build_chill_function_call (func, nreverse (args)));
- CH_DECL_PROCESS (func) = 1;
- }
-
- add_taskstuff_to_list (code_decl, "_TT_Process", process_type,
- func, current_function_decl);
-
- /* finish the function */
- finish_chill_function ();
- pop_chill_function_context ();
-}
-
-/* Generate errors for INOUT, OUT parameters.
-
- "Only if LOC is specified may the mode have the non-value
- property"
- */
-
-#if 0
-static void
-validate_process_parameters (parms)
- tree parms ATTRIBUTE_UNUSED;
-{
-}
-#endif
-
-/*
- * build the tree for a start process action. Loop through the
- * actual parameters, making a constructor list, which we use to
- * initialize the argument structure. NAME is the process' name.
- * COPYNUM is its copy number, whatever that is. EXPRLIST is the
- * list of actual parameters passed by the start call. They must
- * match. EXPRLIST must still be in reverse order; we'll reverse it here.
- *
- * Note: the OPTSET name is not now used - it's here for
- * possible future support for the optional 'SET instance-var'
- * clause.
- */
-void
-build_start_process (process_name, copynum,
- exprlist, optset)
- tree process_name, copynum, exprlist, optset;
-{
- tree process_decl = NULL_TREE, struct_type_node = NULL_TREE;
- tree result;
- tree valtail, typetail;
- tree tuple = NULL_TREE, actuallist = NULL_TREE;
- tree typelist;
- int parmno = 2;
- tree args;
- tree filename, linenumber;
-
- if (exprlist != NULL_TREE && TREE_CODE (exprlist) == ERROR_MARK)
- process_decl = NULL_TREE;
- else if (! ignoring)
- {
- process_decl = lookup_name (process_name);
- if (process_decl == NULL_TREE)
- error ("process name %s never declared",
- IDENTIFIER_POINTER (process_name));
- else if (TREE_CODE (process_decl) != FUNCTION_DECL
- || ! CH_DECL_PROCESS (process_decl))
- {
- error ("You may only START a process, not a proc");
- process_decl = NULL_TREE;
- }
- else if (DECL_EXTERNAL (process_decl))
- {
- args = TYPE_ARG_TYPES (TREE_TYPE (process_decl));
- if (TREE_VALUE (args) != void_type_node)
- struct_type_node = TREE_TYPE (TREE_VALUE (args));
- else
- struct_type_node = NULL_TREE;
- }
- else
- {
- tree debug_type = lookup_name (
- get_struct_debug_type_name (DECL_NAME (process_decl)));
-
- if (debug_type == NULL_TREE)
- /* no debug type, no arguments */
- struct_type_node = NULL_TREE;
- else
- struct_type_node = TREE_TYPE (debug_type);
- }
- }
-
- /* begin a new name scope */
- pushlevel (1);
- clear_last_expr ();
- push_momentary ();
- if (pass == 2)
- expand_start_bindings (0);
-
- if (! ignoring && process_decl != NULL_TREE)
- {
- if (optset == NULL_TREE) ;
- else if (!CH_REFERABLE (optset))
- {
- error ("SET expression not a location.");
- optset = NULL_TREE;
- }
- else if (!CH_IS_INSTANCE_MODE (TREE_TYPE (optset)))
- {
- error ("SET location must be INSTANCE mode");
- optset = NULL_TREE;
- }
- if (optset)
- optset = force_addr_of (optset);
- else
- optset = convert (ptr_type_node, integer_zero_node);
-
- if (struct_type_node != NULL_TREE)
- {
- typelist = TYPE_FIELDS (struct_type_node);
-
- for (valtail = nreverse (exprlist), typetail = typelist;
- valtail != NULL_TREE && typetail != NULL_TREE; parmno++,
- valtail = TREE_CHAIN (valtail), typetail = TREE_CHAIN (typetail))
- {
- register tree actual = valtail ? TREE_VALUE (valtail) : 0;
- register tree type = typetail ? TREE_TYPE (typetail) : 0;
- char place[30];
- sprintf (place, "signal field %d", parmno);
- actual = chill_convert_for_assignment (type, actual, place);
- actuallist = tree_cons (NULL_TREE, actual,
- actuallist);
- }
-
- tuple = build_nt (CONSTRUCTOR, NULL_TREE,
- nreverse (actuallist));
- }
- else
- {
- valtail = NULL_TREE;
- typetail = NULL_TREE;
- }
-
- if (valtail != 0 && TREE_VALUE (valtail) != void_type_node)
- {
- if (process_name)
- error ("too many arguments to process `%s'",
- IDENTIFIER_POINTER (process_name));
- else
- error ("too many arguments to process");
- }
- else if (typetail != 0 && TREE_VALUE (typetail) != void_type_node)
- {
- if (process_name)
- error ("too few arguments to process `%s'",
- IDENTIFIER_POINTER (process_name));
- else
- error ("too few arguments to process");
- }
- else
- {
- tree process_decl = lookup_name (process_name);
- tree process_type = (tree)DECL_TASKING_CODE_DECL (process_decl);
- tree struct_size, struct_pointer;
-
- if (struct_type_node != NULL_TREE)
- {
- result =
- decl_temp1 (get_unique_identifier ("START_ARG"),
- struct_type_node, 0, tuple, 0, 0);
- /* prevent granting of this type */
- DECL_SOURCE_LINE (result) = 0;
-
- mark_addressable (result);
- struct_pointer
- = build1 (ADDR_EXPR,
- build_chill_pointer_type (struct_type_node),
- result);
- struct_size = size_in_bytes (struct_type_node);
- }
- else
- {
- struct_size = integer_zero_node;
- struct_pointer = null_pointer_node;
- }
-
- filename = force_addr_of (get_chill_filename ());
- linenumber = get_chill_linenumber ();
-
- expand_expr_stmt (
- build_chill_function_call (lookup_name (get_identifier ("__start_process")),
- tree_cons (NULL_TREE, process_type,
- tree_cons (NULL_TREE, convert (integer_type_node, copynum),
- tree_cons (NULL_TREE, struct_size,
- tree_cons (NULL_TREE, struct_pointer,
- tree_cons (NULL_TREE, optset,
- tree_cons (NULL_TREE, filename,
- build_tree_list (NULL_TREE, linenumber)))))))));
- }
- }
- /* end of scope */
-
- if (pass == 2)
- expand_end_bindings (getdecls (), kept_level_p (), 0);
- poplevel (kept_level_p (), 0, 0);
- pop_momentary ();
-}
-
-/*
- * A CHILL SET which represents all of the possible tasking
- * elements.
- */
-static tree
-build_tasking_enum ()
-{
- tree result, decl1;
- tree enum1;
- tree list = NULL_TREE;
- tree value = integer_zero_node;
-
- enum1 = start_enum (NULL_TREE);
- result = build_enumerator (get_identifier ("_TT_UNUSED"),
- value);
- list = chainon (result, list);
- value = fold (build (PLUS_EXPR, integer_type_node,
- value, integer_one_node));
-
- result = build_enumerator (get_identifier ("_TT_Process"),
- value);
- list = chainon (result, list);
- value = fold (build (PLUS_EXPR, integer_type_node,
- value, integer_one_node));
-
- result = build_enumerator (get_identifier ("_TT_Signal"),
- value);
- list = chainon (result, list);
- value = fold (build (PLUS_EXPR, integer_type_node,
- value, integer_one_node));
-
- result = build_enumerator (get_identifier ("_TT_Buffer"),
- value);
- list = chainon (result, list);
- value = fold (build (PLUS_EXPR, integer_type_node,
- value, integer_one_node));
-
- result = build_enumerator (get_identifier ("_TT_Event"),
- value);
- list = chainon (result, list);
- value = fold (build (PLUS_EXPR, integer_type_node,
- value, integer_one_node));
-
- result = build_enumerator (get_identifier ("_TT_Synonym"),
- value);
- list = chainon (result, list);
- value = fold (build (PLUS_EXPR, integer_type_node,
- value, integer_one_node));
-
- result = build_enumerator (get_identifier ("_TT_Exception"),
- value);
- list = chainon (result, list);
- value = fold (build (PLUS_EXPR, integer_type_node,
- value, integer_one_node));
-
- result = finish_enum (enum1, list);
-
- decl1 = build_decl (TYPE_DECL,
- get_identifier ("__tmp_TaskingEnum"),
- result);
- pushdecl (decl1);
- satisfy_decl (decl1, 0);
- return decl1;
-}
-
-tree
-build_tasking_struct ()
-{
- tree listbase, decl1, decl2, result;
- tree enum_type = TREE_TYPE (build_tasking_enum ());
- /* We temporarily reset the maximum_field_alignment to zero so the
- compiler's init data structures can be compatible with the
- run-time system, even when we're compiling with -fpack. */
- unsigned int save_maximum_field_alignment = maximum_field_alignment;
- maximum_field_alignment = 0;
-
- decl1 = build_decl (FIELD_DECL, get_identifier ("TaskName"),
- build_chill_pointer_type (char_type_node));
- DECL_INITIAL (decl1) = NULL_TREE;
- listbase = decl1;
-
- decl2 = build_decl (FIELD_DECL, get_identifier ("TaskValue"),
- build_chill_pointer_type (chill_taskingcode_type_node));
- TREE_CHAIN (decl1) = decl2;
- DECL_INITIAL (decl2) = NULL_TREE;
- decl1 = decl2;
-
- decl2 = build_decl (FIELD_DECL, get_identifier ("TaskValueDefined"),
- integer_type_node);
- TREE_CHAIN (decl1) = decl2;
- DECL_INITIAL (decl2) = NULL_TREE;
- decl1 = decl2;
-
- decl2 = build_decl (FIELD_DECL, get_identifier ("TaskEntry"),
- build_chill_pointer_type (void_ftype_void));
- TREE_CHAIN (decl1) = decl2;
- DECL_INITIAL (decl2) = NULL_TREE;
- decl1 = decl2;
-
- decl2 = build_decl (FIELD_DECL, get_identifier ("TaskType"),
- enum_type);
- TREE_CHAIN (decl1) = decl2;
- DECL_INITIAL (decl2) = NULL_TREE;
- decl1 = decl2;
-
- TREE_CHAIN (decl2) = NULL_TREE;
- result = build_chill_struct_type (listbase);
- satisfy_decl (result, 0);
- maximum_field_alignment = save_maximum_field_alignment;
- return result;
-}
-
-/*
- * build data structures describing each task/signal, etc.
- * in current module.
- */
-void
-tasking_setup ()
-{
- tree tasknode;
- tree struct_type;
-
- if (pass == 1)
- return;
-
- struct_type = TREE_TYPE (lookup_name (
- get_identifier ("__tmp_TaskingStruct")));
-
- for (tasknode = tasking_list; tasknode != NULL_TREE;
- tasknode = TREE_CHAIN (tasknode))
- {
- /* This is the tasking_code_variable's decl */
- tree stuffnumber = TASK_INFO_STUFF_NUM (tasknode);
- tree code_decl = TASK_INFO_CODE_DECL (tasknode);
- tree proc_decl = TASK_INFO_PDECL (tasknode);
- tree entry = TASK_INFO_ENTRY (tasknode);
- tree name = DECL_NAME (proc_decl);
- char *init_struct = (char *) alloca (IDENTIFIER_LENGTH(name) + 20);
- /* take care of zero termination */
- tree task_name;
- /* these are the fields of the struct, in declaration order */
- tree init_flag = (stuffnumber == NULL_TREE) ?
- integer_zero_node : integer_one_node;
- tree type = DECL_INITIAL (TASK_INFO_STUFF_TYPE (tasknode));
- tree int_addr;
- tree entry_point;
- tree name_ptr;
- tree decl;
- tree struct_id;
- tree initializer;
-
- if (TREE_CODE (proc_decl) == FUNCTION_DECL
- && CH_DECL_PROCESS (proc_decl)
- && ! DECL_EXTERNAL (proc_decl))
- {
- if (entry == NULL_TREE)
- entry = proc_decl;
- mark_addressable (entry);
- entry_point = build1 (ADDR_EXPR,
- build_chill_pointer_type (void_ftype_void),
- entry);
- }
- else
- entry_point = build1 (NOP_EXPR,
- build_chill_pointer_type (void_ftype_void),
- null_pointer_node);
-
- /* take care of zero termination */
- task_name =
- build_chill_string (IDENTIFIER_LENGTH (name) + 1,
- IDENTIFIER_POINTER (name));
-
- mark_addressable (code_decl);
- int_addr = build1 (ADDR_EXPR,
- build_chill_pointer_type (chill_integer_type_node),
- code_decl);
-
- mark_addressable (task_name);
- name_ptr = build1 (ADDR_EXPR,
- build_chill_pointer_type (char_type_node),
- task_name);
-
- sprintf (init_struct, "__tmp_%s_struct",
- IDENTIFIER_POINTER (name));
-
- struct_id = get_identifier (init_struct);
- initializer = build (CONSTRUCTOR, struct_type, NULL_TREE,
- tree_cons (NULL_TREE, name_ptr,
- tree_cons (NULL_TREE, int_addr,
- tree_cons (NULL_TREE, init_flag,
- tree_cons (NULL_TREE, entry_point,
- tree_cons (NULL_TREE, type, NULL_TREE))))));
- TREE_CONSTANT (initializer) = 1;
- decl = decl_temp1 (struct_id, struct_type, 1, initializer, 0, 0);
- /* prevent granting of this type */
- DECL_SOURCE_LINE (decl) = 0;
-
- /* pass the decl to tasking_registry() in the symbol table */
- IDENTIFIER_LOCAL_VALUE (struct_id) = decl;
- }
-}
-
-
-/*
- * Generate code to register the tasking-related stuff
- * with the runtime. Only in pass 2.
- */
-void
-tasking_registry ()
-{
- tree tasknode, fn_decl;
-
- if (pass == 1)
- return;
-
- fn_decl = lookup_name (get_identifier ("__register_tasking"));
-
- for (tasknode = tasking_list; tasknode != NULL_TREE;
- tasknode = TREE_CHAIN (tasknode))
- {
- tree proc_decl = TASK_INFO_PDECL (tasknode);
- tree name = DECL_NAME (proc_decl);
- tree arg_decl;
- char *init_struct = (char *) alloca (IDENTIFIER_LENGTH (name) + 20);
-
- sprintf (init_struct, "__tmp_%s_struct",
- IDENTIFIER_POINTER (name));
- arg_decl = lookup_name (get_identifier (init_struct));
-
- expand_expr_stmt (
- build_chill_function_call (fn_decl,
- build_tree_list (NULL_TREE, force_addr_of (arg_decl))));
- }
-}
-
-/*
- * Put a tasking entity (a PROCESS, or SIGNAL) onto
- * the list for tasking_setup (). CODE_DECL is the integer code
- * variable's DECL, which describes the shadow integer which
- * accompanies each tasking entity. STUFFTYPE is a string
- * representing the sort of tasking entity we have here (i.e.
- * process, signal, etc.). STUFFNUMBER is an enumeration
- * value saying the same thing. PROC_DECL is the declaration of
- * the entity. It's a FUNCTION_DECL if the entity is a PROCESS, it's
- * a TYPE_DECL if the entity is a SIGNAL.
- */
-void
-add_taskstuff_to_list (code_decl, stufftype, stuffnumber,
- proc_decl, entry)
- tree code_decl;
- const char *stufftype;
- tree stuffnumber, proc_decl, entry;
-{
- if (pass == 1)
- /* tell chill_finish_compile that there's
- task-level code to be processed. */
- tasking_list = integer_one_node;
-
- /* do only in pass 2 so we know in chill_finish_compile whether
- to generate a constructor function, and to avoid double the
- correct number of entries. */
- else /* pass == 2 */
- {
- tree task_node = make_tree_vec (5);
- TASK_INFO_PDECL (task_node) = proc_decl;
- TASK_INFO_ENTRY (task_node) = entry;
- TASK_INFO_CODE_DECL (task_node) = code_decl;
- TASK_INFO_STUFF_NUM (task_node) = stuffnumber;
- TASK_INFO_STUFF_TYPE (task_node)
- = lookup_name (get_identifier (stufftype));
- TREE_CHAIN (task_node) = tasking_list;
- tasking_list = task_node;
- }
-}
-
-/*
- * These next routines are called out of build_generalized_call
- */
-tree
-build_copy_number (instance_expr)
- tree instance_expr;
-{
- tree result;
-
- if (instance_expr == NULL_TREE
- || TREE_CODE (instance_expr) == ERROR_MARK)
- return error_mark_node;
- if (! CH_IS_INSTANCE_MODE (TREE_TYPE (instance_expr)))
- {
- error ("COPY_NUMBER argument must be INSTANCE expression");
- return error_mark_node;
- }
- result = build_component_ref (instance_expr,
- get_identifier (INS_COPY));
- CH_DERIVED_FLAG (result) = 1;
- return result;
-}
-
-
-tree
-build_gen_code (decl)
- tree decl;
-{
- tree result;
-
- if (decl == NULL_TREE || TREE_CODE (decl) == ERROR_MARK)
- return error_mark_node;
-
- if ((TREE_CODE (decl) == FUNCTION_DECL && CH_DECL_PROCESS (decl))
- || (TREE_CODE (decl) == TYPE_DECL && CH_DECL_SIGNAL (decl)))
- result = (tree)(DECL_TASKING_CODE_DECL (decl));
- else
- {
- error ("GEN_CODE argument must be a process or signal name.");
- return error_mark_node;
- }
- CH_DERIVED_FLAG (result) = 1;
- return (result);
-}
-
-
-tree
-build_gen_inst (process, copyn)
- tree process, copyn;
-{
- tree ptype;
- tree result;
-
- if (copyn == NULL_TREE || TREE_CODE (copyn) == ERROR_MARK)
- return error_mark_node;
- if (process == NULL_TREE || TREE_CODE (process) == ERROR_MARK)
- return error_mark_node;
-
- if (TREE_CODE (TREE_TYPE (copyn)) != INTEGER_TYPE)
- {
- error ("GEN_INST parameter 2 must be an integer mode");
- copyn = integer_zero_node;
- }
-
- copyn = check_range (copyn, copyn,
- TYPE_MIN_VALUE (chill_taskingcode_type_node),
- TYPE_MAX_VALUE (chill_taskingcode_type_node));
-
- if (TREE_CODE (process) == FUNCTION_DECL
- && CH_DECL_PROCESS (process))
- ptype = (tree)DECL_TASKING_CODE_DECL (process);
- else if (TREE_TYPE (process) != NULL_TREE
- && TREE_CODE (TREE_TYPE (process)) == INTEGER_TYPE)
- {
- process = check_range (process, process,
- TYPE_MIN_VALUE (chill_taskingcode_type_node),
- TYPE_MAX_VALUE (chill_taskingcode_type_node));
- ptype = convert (chill_taskingcode_type_node, process);
- }
- else
- {
- error ("GEN_INST parameter 1 must be a PROCESS or an integer expression");
- return (error_mark_node);
- }
-
- result = convert (instance_type_node,
- build_nt (CONSTRUCTOR, NULL_TREE,
- tree_cons (NULL_TREE, ptype,
- tree_cons (NULL_TREE,
- convert (chill_taskingcode_type_node, copyn), NULL_TREE))));
- CH_DERIVED_FLAG (result) = 1;
- return result;
-}
-
-
-tree
-build_gen_ptype (process_decl)
- tree process_decl;
-{
- tree result;
-
- if (process_decl == NULL_TREE || TREE_CODE (process_decl) == ERROR_MARK)
- return error_mark_node;
-
- if (TREE_CODE (process_decl) != FUNCTION_DECL
- || ! CH_DECL_PROCESS (process_decl))
- {
- error_with_decl (process_decl, "%s is not a declared process");
- return error_mark_node;
- }
-
- result = (tree)DECL_TASKING_CODE_DECL (process_decl);
- CH_DERIVED_FLAG (result) = 1;
- return result;
-}
-
-
-tree
-build_proc_type (instance_expr)
- tree instance_expr;
-{
- tree result;
-
- if (instance_expr == NULL_TREE || TREE_CODE (instance_expr) == ERROR_MARK)
- return error_mark_node;
-
- if (! CH_IS_INSTANCE_MODE (TREE_TYPE (instance_expr)))
- {
- error ("PROC_TYPE argument must be INSTANCE expression");
- return error_mark_node;
- }
- result = build_component_ref (instance_expr,
- get_identifier (INS_PTYPE));
- CH_DERIVED_FLAG (result) = 1;
- return result;
-}
-
-tree
-build_queue_length (buf_ev)
- tree buf_ev;
-{
- if (buf_ev == NULL_TREE || TREE_CODE (buf_ev) == ERROR_MARK)
- return error_mark_node;
- if (TREE_TYPE (buf_ev) == NULL_TREE ||
- TREE_CODE (TREE_TYPE (buf_ev)) == ERROR_MARK)
- return error_mark_node;
-
- if (CH_IS_BUFFER_MODE (TREE_TYPE (buf_ev)) ||
- CH_IS_EVENT_MODE (TREE_TYPE (buf_ev)))
- {
- const char *field_name;
- tree arg1, arg2;
-
- if (CH_IS_EVENT_MODE (TREE_TYPE (buf_ev)))
- {
- field_name = "__event_data";
- arg2 = integer_one_node;
- }
- else
- {
- field_name = "__buffer_data";
- arg2 = integer_zero_node;
- }
- arg1 = build_component_ref (buf_ev, get_identifier (field_name));
- return build_chill_function_call (
- lookup_name (get_identifier ("__queue_length")),
- tree_cons (NULL_TREE, arg1,
- tree_cons (NULL_TREE, arg2, NULL_TREE)));
- }
-
- error ("QUEUE_LENGTH argument must be a BUFFER/EVENT location.");
- return error_mark_node;
-}
-
-tree
-build_signal_struct_type (signame, sigmodelist, optsigdest)
- tree signame, sigmodelist, optsigdest;
-{
- tree decl, temp;
-
- if (pass == 1)
- {
- int fldcnt = 0;
- tree mode, field_decls = NULL_TREE;
-
- for (mode = sigmodelist; mode != NULL_TREE; mode = TREE_CHAIN (mode))
- {
- tree field;
- char fldname[20];
-
- if (TREE_VALUE (mode) == NULL_TREE)
- continue;
- sprintf (fldname, "fld%03d", fldcnt++);
- field = build_decl (FIELD_DECL,
- get_identifier (fldname),
- TREE_VALUE (mode));
- if (field_decls == NULL_TREE)
- field_decls = field;
- else
- chainon (field_decls, field);
- }
- if (field_decls == NULL_TREE)
- field_decls = build_decl (FIELD_DECL,
- get_identifier ("__tmp_empty"),
- boolean_type_node);
- temp = build_chill_struct_type (field_decls);
-
- /* save the destination process name of the signal */
- IDENTIFIER_SIGNAL_DEST (signame) = optsigdest;
- IDENTIFIER_SIGNAL_DATA (signame) = fldcnt;
- }
- else
- {
- /* optsigset is only valid in pass 2, so we have to save it now */
- IDENTIFIER_SIGNAL_DEST (signame) = optsigdest;
- temp = NULL_TREE; /* Actually, don't care. */
- }
-
- decl = push_modedef (signame, temp, -1);
- if (decl != NULL_TREE)
- CH_DECL_SIGNAL (decl) = 1;
- return decl;
-}
-
-/*
- * An instance type is a unique process identifier in the CHILL
- * tasking arena. It consists of a process type and a copy number.
- */
-void
-build_instance_type ()
-{
- tree decl1, decl2, tdecl;
-
- decl1 = build_decl (FIELD_DECL, get_identifier (INS_PTYPE),
- chill_taskingcode_type_node);
-
- TREE_CHAIN (decl1) = decl2 =
- build_decl (FIELD_DECL, get_identifier (INS_COPY),
- chill_taskingcode_type_node);
- TREE_CHAIN (decl2) = NULL_TREE;
-
- instance_type_node = build_chill_struct_type (decl1);
- tdecl = build_decl (TYPE_DECL, ridpointers[(int) RID_INSTANCE],
- instance_type_node);
- TYPE_NAME (instance_type_node) = tdecl;
- CH_NOVELTY (instance_type_node) = tdecl;
- DECL_SOURCE_LINE (tdecl) = 0;
- pushdecl (tdecl);
-
- pointer_to_instance = build_chill_pointer_type (instance_type_node);
-}
-
-#if 0
- *
- * The tasking message descriptor looks like this C structure:
- *
- * typedef struct
- * {
- * short *sc; /* ptr to code integer */
- * int data_len; /* length of signal/buffer data msg */
- * void *data; /* ptr to signal/buffer data */
- * } SignalDescr;
- *
- *
-#endif
-
-static void
-build_tasking_message_type ()
-{
- tree type_name;
- tree temp;
- /* We temporarily reset maximum_field_alignment to deal with
- the runtime system. */
- unsigned int save_maximum_field_alignment = maximum_field_alignment;
- tree field1, field2, field3;
-
- maximum_field_alignment = 0;
- field1 = build_decl (FIELD_DECL,
- get_identifier ("_SD_code_ptr"),
- build_pointer_type (chill_integer_type_node));
- field2 = build_decl (FIELD_DECL,
- get_identifier ("_SD_data_len"),
- integer_type_node);
- field3 = build_decl (FIELD_DECL,
- get_identifier ("_SD_data_ptr"),
- ptr_type_node);
- TREE_CHAIN (field1) = field2;
- TREE_CHAIN (field2) = field3;
- temp = build_chill_struct_type (field1);
-
- type_name = get_identifier ("__tmp_SD_struct");
- tasking_message_type = build_decl (TYPE_DECL, type_name, temp);
-
- /* This won't get seen in pass 2, so lay it out now. */
- layout_chill_struct_type (temp);
- pushdecl (tasking_message_type);
- maximum_field_alignment = save_maximum_field_alignment;
-}
-
-tree
-build_signal_descriptor (sigdef, exprlist)
- tree sigdef, exprlist;
-{
- tree fieldlist, typetail, valtail;
- tree actuallist = NULL_TREE;
- tree signame = DECL_NAME (sigdef);
- tree dataptr, datalen;
- int parmno = 1;
-
- if (sigdef == NULL_TREE
- || TREE_CODE (sigdef) == ERROR_MARK)
- return error_mark_node;
-
- if (exprlist != NULL_TREE
- && TREE_CODE (exprlist) == ERROR_MARK)
- return error_mark_node;
-
- if (TREE_CODE (sigdef) != TYPE_DECL
- || ! CH_DECL_SIGNAL (sigdef))
- {
- error ("SEND requires a SIGNAL; %s is not a SIGNAL name",
- IDENTIFIER_POINTER (signame));
- return error_mark_node;
- }
- if (CH_TYPE_NONVALUE_P (TREE_TYPE (sigdef)))
- return error_mark_node;
-
- fieldlist = TYPE_FIELDS (TREE_TYPE (sigdef));
- if (IDENTIFIER_SIGNAL_DATA (signame) == 0)
- fieldlist = TREE_CHAIN (fieldlist);
-
- for (valtail = exprlist, typetail = fieldlist;
- valtail != NULL_TREE && typetail != NULL_TREE;
- parmno++, valtail = TREE_CHAIN (valtail),
- typetail = TREE_CHAIN (typetail))
- {
- register tree actual = valtail ? TREE_VALUE (valtail) : 0;
- register tree type = typetail ? TREE_TYPE (typetail) : 0;
- char place[30];
- sprintf (place, "signal field %d", parmno);
- actual = chill_convert_for_assignment (type, actual, place);
- actuallist = tree_cons (NULL_TREE, actual, actuallist);
- }
- if (valtail != 0 && TREE_VALUE (valtail) != void_type_node)
- {
- error ("too many values for SIGNAL `%s'",
- IDENTIFIER_POINTER (signame));
- return error_mark_node;
- }
- else if (typetail != 0 && TREE_VALUE (typetail) != void_type_node)
- {
- error ("too few values for SIGNAL `%s'",
- IDENTIFIER_POINTER (signame));
- return error_mark_node;
- }
-
- {
- /* build signal data structure */
- tree sigdataname = get_unique_identifier (
- IDENTIFIER_POINTER (signame));
- if (exprlist == NULL_TREE)
- {
- dataptr = null_pointer_node;
- datalen = integer_zero_node;
- }
- else
- {
- tree tuple = build_nt (CONSTRUCTOR,
- NULL_TREE, nreverse (actuallist));
- tree decl = decl_temp1 (sigdataname, TREE_TYPE (sigdef),
- 0, tuple, 0, 0);
- /* prevent granting of this type */
- DECL_SOURCE_LINE (decl) = 0;
-
- dataptr = force_addr_of (decl);
- datalen = size_in_bytes (TREE_TYPE (decl));
- }
-
- /* build descriptor pointing to signal data */
- {
- tree decl, tuple;
- tree tasking_message_var = get_unique_identifier (
- IDENTIFIER_POINTER (signame));
-
- tree tasking_code =
- (tree)DECL_TASKING_CODE_DECL (lookup_name (signame));
-
- mark_addressable (tasking_code);
- tuple = build_nt (CONSTRUCTOR, NULL_TREE,
- tree_cons (NULL_TREE,
- build1 (ADDR_EXPR,
- build_chill_pointer_type (chill_integer_type_node),
- tasking_code),
- tree_cons (NULL_TREE, datalen,
- tree_cons (NULL_TREE, dataptr, NULL_TREE))));
-
- decl = decl_temp1 (tasking_message_var,
- TREE_TYPE (tasking_message_type), 0,
- tuple, 0, 0);
- /* prevent granting of this type */
- DECL_SOURCE_LINE (decl) = 0;
-
- tuple = force_addr_of (decl);
- return tuple;
- }
- }
-}
-
-void
-expand_send_signal (sigmsgbuffer, optroutinginfo, optsendto,
- optpriority, signame)
- tree sigmsgbuffer;
- tree optroutinginfo;
- tree optsendto;
- tree optpriority;
- tree signame;
-{
- tree routing_size, routing_addr;
- tree filename, linenumber;
- tree sigdest = IDENTIFIER_SIGNAL_DEST (signame);
-
- /* check the presence of priority */
- if (optpriority == NULL_TREE)
- {
- if (send_signal_prio == NULL_TREE)
- {
- /* issue a warning in case of -Wall */
- if (extra_warnings)
- {
- warning ("Signal sent without priority");
- warning (" and no default priority was set.");
- warning (" PRIORITY defaulted to 0");
- }
- optpriority = integer_zero_node;
- }
- else
- optpriority = send_signal_prio;
- }
-
- /* check the presence of a destination.
- optdest either may be an instance location
- or a process declaration */
- if (optsendto == NULL_TREE)
- {
- if (sigdest == NULL_TREE)
- {
- error ("SEND without a destination instance");
- error (" and no destination process specified");
- error (" for the signal");
- optsendto = convert (instance_type_node,
- null_pointer_node);
- }
- else
- {
- /* build an instance [sigdest; -1] */
- tree process_name = DECL_NAME (sigdest);
- tree copy_number = fold (build (MINUS_EXPR, integer_type_node,
- integer_zero_node,
- integer_one_node));
- tree tasking_code = (tree)DECL_TASKING_CODE_DECL (
- lookup_name (process_name));
-
- optsendto = build (CONSTRUCTOR, instance_type_node, NULL_TREE,
- tree_cons (NULL_TREE, tasking_code,
- tree_cons (NULL_TREE, copy_number, NULL_TREE)));
- /* as our system doesn't allow that and Z.200 specifies it,
- we issue a warning */
- warning ("SEND to ANY copy of process `%s'.", IDENTIFIER_POINTER (process_name));
- }
- }
- else if (! CH_IS_INSTANCE_MODE (TREE_TYPE (optsendto)))
- {
- error ("SEND TO must be an INSTANCE mode");
- optsendto = convert (instance_type_node, null_pointer_node);
- }
- else
- optsendto = check_non_null (convert (instance_type_node, optsendto));
-
- /* check the routing stuff */
- if (optroutinginfo != NULL_TREE)
- {
- tree routing_name;
- tree decl;
-
- if (TREE_TYPE (optroutinginfo) == NULL_TREE)
- {
- error ("SEND WITH must have a mode");
- optroutinginfo = integer_zero_node;
- }
- routing_name = get_unique_identifier ("RI");
- decl = decl_temp1 (routing_name,
- TREE_TYPE (optroutinginfo), 0,
- optroutinginfo, 0, 0);
- /* prevent granting of this type */
- DECL_SOURCE_LINE (decl) = 0;
-
- routing_addr = force_addr_of (decl);
- routing_size = size_in_bytes (TREE_TYPE (decl));
- }
- else
- {
- routing_size = integer_zero_node;
- routing_addr = null_pointer_node;
- }
- /* get filename and linenumber */
- filename = force_addr_of (get_chill_filename ());
- linenumber = get_chill_linenumber ();
-
- /* Now (at last!) we can call the runtime */
- expand_expr_stmt (
- build_chill_function_call (lookup_name (get_identifier ("__send_signal")),
- tree_cons (NULL_TREE, sigmsgbuffer,
- tree_cons (NULL_TREE, optsendto,
- tree_cons (NULL_TREE, optpriority,
- tree_cons (NULL_TREE, routing_size,
- tree_cons (NULL_TREE, routing_addr,
- tree_cons (NULL_TREE, filename,
- tree_cons (NULL_TREE, linenumber, NULL_TREE)))))))));
-}
-
-#if 0
- * The following code builds a RECEIVE CASE action, which actually
- * has 2 different functionalities:
- *
- * 1) RECEIVE signal CASE action
- * which looks like this:
- *
- * SIGNAL advance;
- * SIGNAL terminate = (CHAR);
- * SIGNAL sig1 = (CHAR);
- *
- * DCL user, system INSTANCE;
- * DCL count INT, char_code CHAR;
- * DCL instance_loc INSTANCE;
- *
- * workloop:
- * RECEIVE CASE SET instance_loc;
- * (advance):
- * count + := 1;
- * (terminate IN char_code):
- * SEND sig1(char_code) TO system;
- * EXIT workloop;
- * ELSE
- * STOP;
- * ESAC;
- *
- * Because we don''t know until we get to the ESAC how
- * many signals need processing, we generate the following
- * C-equivalent code:
- *
- * /* define the codes for the signals */
- * static short __tmp_advance_code;
- * static short __tmp_terminate_code;
- * static short __tmp_sig1_code;
- *
- * /* define the types of the signals */
- * typedef struct
- * {
- * char fld0;
- * } __tmp_terminate_struct;
- *
- * typedef struct
- * {
- * char fld0;
- * } __tmp_sig1_struct;
- *
- * static INSTANCE user, system, instance_loc;
- * static short count;
- * static char char_code;
- *
- * { /* start a new symbol context */
- * int number_of_sigs;
- * short *sig_code [];
- * void *sigdatabuf;
- * int sigdatalen;
- * short sigcode;
- *
- * goto __rcsetup;
- *
- * __rcdoit: ;
- * int timedout = __wait_signal (&sigcode
- * number_of_sigs,
- * sig_code,
- * sigdatabuf,
- * sigdatalen,
- * &instance_loc);
- * if (sigcode == __tmp_advance_code)
- * {
- * /* code for advance alternative's action_statement_list */
- * count++;
- * }
- * else if (sigcode == __tmp_terminate_code)
- * {
- * /* copy signal's data to where they belong,
- * with range-check, if enabled */
- * char_code = ((__tmp_terminate_struct *)sigdatabuf)->fld0;
- *
- * /* code for terminate alternative's action_statement_list */
- * __send_signal (sig1 ..... );
- * goto __workloop_end;
- * }
- * else
- * {
- * /* code here for the ELSE action_statement_list */
- * __stop_process ();
- * }
- * goto __rc_done;
- *
- * __rcsetup:
- * union { __tmp_terminate_struct terminate;
- * __tmp_sig1_struct } databuf;
- * short *sig_code_ptr [2] = { &__tmp_advance_code,
- * &__tmp_terminate_code };
- * sigdatabuf = &databuf;
- * sigdatalen = sizeof (databuf);
- * sig_code = &sig_code_ptr[0];
- * number_of_sigs = 2;
- * goto __rcdoit;
- *
- * __rc_done: ;
- * } /* end the new symbol context */
- * __workloop_end: ;
- *
- *
- * 2) RECEIVE buffer CASE action:
- * which looks like this:
- *
- * NEWMODE m_s = STRUCT (mini INT, maxi INT);
- * DCL b1 BUFFER INT;
- * DCL b2 BUFFER (30) s;
- *
- * DCL i INT, s m_s, ins INSTANCE;
- * DCL count INT;
- *
- * workloop:
- * RECEIVE CASE SET ins;
- * (b1 IN i):
- * count +:= i;
- * (b2 in s):
- * IF count < s.mini OR count > s.maxi THEN
- * EXIT workloop;
- * FI;
- * ELSE
- * STOP;
- * ESAC;
- *
- * Because we don''t know until we get to the ESAC how
- * many buffers need processing, we generate the following
- * C-equivalent code:
- *
- * typedef struct
- * {
- * short mini;
- * short maxi;
- * } m_s;
- *
- * static void *b1;
- * static void *b2;
- * static short i;
- * static m_s s;
- * static INSTANCE ins;
- * static short count;
- *
- * workloop:
- * { /* start a new symbol context */
- * int number_of_sigs;
- * void *sig_code [];
- * void *sigdatabuf;
- * int sigdatalen;
- * void *buflocation;
- * int timedout;
- *
- * goto __rcsetup;
- *
- * __rcdoit:
- * timedout = __wait_buffer (&buflocation,
- * number_of_sigs,
- * sig_code,
- * sigdatabuf,
- * sigdatalen,
- * &ins, ...);
- * if (buflocation == &b1)
- * {
- * i = ((short *)sigdatabuf)->fld0;
- * count += i;
- * }
- * else if (buflocation == &b2)
- * {
- * s = ((m_s)*sigdatabuf)->fld1;
- * if (count < s.mini || count > s.maxi)
- * goto __workloop_end;
- * }
- * else
- * __stop_process ();
- * goto __rc_done;
- *
- * __rcsetup:
- * typedef struct
- * {
- * void *p;
- * unsigned maxqueuesize;
- * } Buffer_Descr;
- * union { short b1,
- * m_s b2 } databuf;
- * Buffer_Descr bufptr [2] =
- * {
- * { &b1, -1 },
- * { &b2, 30 },
- * };
- * void * bufarray[2] = { &bufptr[0],
- * &bufptr[1] };
- * sigdatabuf = &databuf;
- * sigdatalen = sizeof (databuf);
- * sig_code = &bufarray[0];
- * number_of_sigs = 2;
- * goto __rcdoit;
- *
- * __rc_done;
- * } /* end of symbol context */
- * __workloop_end:
- *
-#endif
-
-struct rc_state_type
-{
- struct rc_state_type *enclosing;
- rtx rcdoit;
- rtx rcsetup;
- tree n_sigs;
- tree sig_code;
- tree databufp;
- tree datalen;
- tree else_clause;
- tree received_signal;
- tree received_buffer;
- tree to_loc;
- int sigseen;
- int bufseen;
- tree actuallist;
- int call_generated;
- int if_generated;
- int bufcnt;
-};
-
-struct rc_state_type *current_rc_state = NULL;
-
-/*
- * this function tells if there is an if to terminate
- * or not
- */
-int
-build_receive_case_if_generated()
-{
- if (!current_rc_state)
- {
- error ("internal error: RECEIVE CASE stack invalid.");
- abort ();
- }
- return current_rc_state->if_generated;
-}
-
-/* build_receive_case_start returns an INTEGER_CST node
- containing the case-label number to be used by
- build_receive_case_end to generate correct labels */
-tree
-build_receive_case_start (optset)
- tree optset;
-{
- /* counter to generate unique receive_case labels */
- static int rc_lbl_count = 0;
- tree current_label_value =
- build_int_2 ((HOST_WIDE_INT)rc_lbl_count, 0);
- tree sigcodename, filename, linenumber;
-
- struct rc_state_type *rc_state
- = (struct rc_state_type*) xmalloc (sizeof (struct rc_state_type));
- rc_state->rcdoit = gen_label_rtx ();
- rc_state->rcsetup = gen_label_rtx ();
- rc_state->enclosing = current_rc_state;
- current_rc_state = rc_state;
- rc_state->sigseen = 0;
- rc_state->bufseen = 0;
- rc_state->call_generated = 0;
- rc_state->if_generated = 0;
- rc_state->bufcnt = 0;
-
- rc_lbl_count++;
- if (optset == NULL_TREE || TREE_CODE (optset) == ERROR_MARK)
- optset = null_pointer_node;
- else
- {
- if (CH_IS_INSTANCE_MODE (TREE_TYPE (optset)) && CH_LOCATION_P (optset))
- optset = force_addr_of (optset);
- else
- {
- error ("SET requires INSTANCE location");
- optset = null_pointer_node;
- }
- }
-
- rc_state->to_loc = build_timeout_preface ();
-
- rc_state->n_sigs =
- decl_temp1 (get_identifier ("number_of_sigs"),
- integer_type_node, 0, integer_zero_node, 0, 0);
-
- rc_state->sig_code =
- decl_temp1 (get_identifier ("sig_codep"),
- ptr_type_node, 0, null_pointer_node, 0, 0);
-
- rc_state->databufp =
- decl_temp1 (get_identifier ("databufp"),
- ptr_type_node, 0, null_pointer_node, 0, 0);
-
- rc_state->datalen =
- decl_temp1 (get_identifier ("datalen"),
- integer_type_node, 0, integer_zero_node, 0, 0);
-
- rc_state->else_clause =
- decl_temp1 (get_identifier ("else_clause"),
- integer_type_node, 0, integer_zero_node, 0, 0);
-
- /* wait_signal will store the signal number in here */
- sigcodename = get_identifier ("received_signal");
- rc_state->received_signal =
- decl_temp1 (sigcodename, chill_integer_type_node, 0,
- NULL_TREE, 0, 0);
-
- /* wait_buffer will store the buffer address in here */
- sigcodename = get_unique_identifier ("received_buffer");
- rc_state->received_buffer =
- decl_temp1 (sigcodename, ptr_type_node, 0,
- NULL_TREE, 0, 0);
-
- /* now jump to the end of RECEIVE CASE actions, to
- set up variables for them. */
- emit_jump (rc_state->rcsetup);
-
- /* define the __rcdoit label. We come here after
- initialization of all variables, to execute the
- actions. */
- emit_label (rc_state->rcdoit);
-
- filename = force_addr_of (get_chill_filename ());
- linenumber = get_chill_linenumber ();
-
- /* Argument list for calling the runtime routine. We'll call it
- the first time we call build_receive_case_label, when we know
- whether to call wait_signal or wait_buffer. NOTE: at this time
- the first argument will be set. */
- rc_state->actuallist =
- tree_cons (NULL_TREE, NULL_TREE,
- tree_cons (NULL_TREE, rc_state->n_sigs,
- tree_cons (NULL_TREE, rc_state->sig_code,
- tree_cons (NULL_TREE, rc_state->databufp,
- tree_cons (NULL_TREE, rc_state->datalen,
- tree_cons (NULL_TREE, optset,
- tree_cons (NULL_TREE, rc_state->else_clause,
- tree_cons (NULL_TREE, rc_state->to_loc,
- tree_cons (NULL_TREE, filename,
- tree_cons (NULL_TREE, linenumber, NULL_TREE))))))))));
- return current_label_value;
-}
-
-static tree
-build_receive_signal_case_label (sigdecl, loclist)
- tree sigdecl, loclist;
-{
- struct rc_state_type *rc_state = current_rc_state;
- tree signame = DECL_NAME (sigdecl);
- tree expr;
-
- if (rc_state->bufseen != 0)
- {
- error ("SIGNAL in RECEIVE CASE alternative follows");
- error (" a BUFFER name on line %d", rc_state->bufseen);
- return error_mark_node;
- }
- rc_state->sigseen = lineno;
- rc_state->bufseen = 0;
-
- if (!IDENTIFIER_SIGNAL_DATA (signame) && loclist != NULL_TREE)
- {
- error ("SIGNAL `%s' has no data fields", IDENTIFIER_POINTER (signame));
- return error_mark_node;
- }
- if (IDENTIFIER_SIGNAL_DATA (signame) && loclist == NULL_TREE)
- {
- error ("SIGNAL `%s' requires data fields", IDENTIFIER_POINTER (signame));
- return error_mark_node;
- }
-
- if (!rc_state->call_generated)
- {
- tree wait_call;
-
- TREE_VALUE (rc_state->actuallist) = force_addr_of (rc_state->received_signal);
- wait_call = build_chill_function_call (lookup_name
- (get_identifier ("__wait_signal_timed")),
- rc_state->actuallist);
-#if 0
- chill_expand_assignment (rc_state->received_signal,
- NOP_EXPR, wait_call);
-#endif
- build_timesupervised_call (wait_call, rc_state->to_loc);
-
- rc_state->call_generated = 1;
- }
-
- /* build the conditional expression */
- expr = build (EQ_EXPR, boolean_type_node,
- rc_state->received_signal,
- (tree)DECL_TASKING_CODE_DECL (sigdecl));
-
- if (!rc_state->if_generated)
- {
- expand_start_cond (expr, 0);
- rc_state->if_generated = 1;
- }
- else
- expand_start_elseif (expr);
-
- if (IDENTIFIER_SIGNAL_DATA (signame))
- {
- /* copy data from signal buffer to user's variables */
- tree typelist = TYPE_FIELDS (TREE_TYPE (sigdecl));
- tree valtail, typetail;
- int parmno = 1;
- tree pointer_type = build_chill_pointer_type (TREE_TYPE (sigdecl));
- tree pointer = convert (pointer_type, rc_state->databufp);
-
- for (valtail = nreverse (loclist), typetail = typelist;
- valtail != NULL_TREE && typetail != NULL_TREE;
- parmno++, valtail = TREE_CHAIN (valtail),
- typetail = TREE_CHAIN (typetail))
- {
- register tree actual = valtail ? TREE_VALUE (valtail) : 0;
- register tree type = typetail ? TREE_TYPE (typetail) : 0;
- register tree assgn;
- char place[30];
- sprintf (place, "signal field %d", parmno);
-
- assgn = build_component_ref (build1 (INDIRECT_REF,
- TREE_TYPE (sigdecl),
- pointer),
- DECL_NAME (typetail));
- if (!CH_TYPE_NONVALUE_P (type))
- /* don't assign to non-value type. Error printed at signal definition */
- chill_expand_assignment (actual, NOP_EXPR, assgn);
- }
-
- if (valtail == NULL_TREE && typetail != NULL_TREE)
- error ("too few data fields provided for `%s'",
- IDENTIFIER_POINTER (signame));
- if (valtail != NULL_TREE && typetail == NULL_TREE)
- error ("too many data fields provided for `%s'",
- IDENTIFIER_POINTER (signame));
- }
-
- /* last action here */
- emit_line_note (input_filename, lineno);
-
- return build_tree_list (loclist, signame);
-}
-
-static tree
-build_receive_buffer_case_label (buffer, loclist)
- tree buffer, loclist;
-{
- struct rc_state_type *rc_state = current_rc_state;
- tree buftype = buffer_element_mode (TREE_TYPE (buffer));
- tree expr, var;
- tree pointer_type, pointer, assgn;
- int had_errors = 0;
- tree x, y, z, bufaddr;
-
- if (rc_state->sigseen != 0)
- {
- error ("BUFFER in RECEIVE CASE alternative follows");
- error (" a SIGNAL name on line %d", rc_state->sigseen);
- return error_mark_node;
- }
- rc_state->bufseen = lineno;
- rc_state->sigseen = 0;
-
- if (! CH_REFERABLE (buffer))
- {
- error ("BUFFER in RECEIVE CASE alternative must be a location.");
- return error_mark_node;
- }
-
- if (TREE_CHAIN (loclist) != NULL_TREE)
- {
- error ("buffer receive alternative requires only 1 defining occurence.");
- return error_mark_node;
- }
-
- if (!rc_state->call_generated)
- {
- tree wait_call;
-
- /* here we change the mode of rc_state->sig_code to
- REF ARRAY (0:65535) REF __tmp_DESCR_type.
- This is neccesary, cause we cannot evaluate the buffer twice
- (once here where we compare against the address of the buffer
- and second in build_receive_buffer_case_end, where we use the
- address build the descriptor, which gets passed to __wait_buffer).
- So we change the comparison from
- if (rc_state->received_buffer == &buffer)
- to
- if (rc_state->received_buffer ==
- rc_state->sig_codep->[rc_state->bufcnt]->datap).
-
- This will evaluate the buffer location only once
- (in build_receive_buffer_case_end) and therefore doesn't confuse
- our machinery. */
-
- tree reftmpdescr = build_chill_pointer_type (
- TREE_TYPE (lookup_name (
- get_identifier ("__tmp_DESCR_type"))));
- tree idxtype = build_chill_range_type (NULL_TREE,
- integer_zero_node,
- build_int_2 (65535, 0)); /* should be enough, probably use ULONG */
- tree arrtype = build_chill_array_type (reftmpdescr,
- tree_cons (NULL_TREE, idxtype, NULL_TREE),
- 0, NULL_TREE);
- tree refarrtype = build_chill_pointer_type (arrtype);
-
- TREE_VALUE (rc_state->actuallist) = force_addr_of (rc_state->received_buffer);
- wait_call = build_chill_function_call (
- lookup_name (get_identifier ("__wait_buffer")),
- rc_state->actuallist);
-#if 0
- chill_expand_assignment (rc_state->received_buffer,
- NOP_EXPR, wait_call);
-#endif
- build_timesupervised_call (wait_call, rc_state->to_loc);
-
- /* do this after the call, otherwise there will be a mode mismatch */
- TREE_TYPE (rc_state->sig_code) = refarrtype;
-
- /* now we are ready to generate the call */
- rc_state->call_generated = 1;
- }
-
- x = build_chill_indirect_ref (rc_state->sig_code, NULL_TREE, 0);
- y = build_chill_array_ref (x,
- tree_cons (NULL_TREE, build_int_2 (rc_state->bufcnt, 0), NULL_TREE));
- z = build_chill_indirect_ref (y, NULL_TREE, 0);
- bufaddr = build_chill_component_ref (z, get_identifier ("datap"));
-
- /* build the conditional expression */
- expr = build (EQ_EXPR, boolean_type_node,
- rc_state->received_buffer,
- bufaddr);
-
- /* next buffer in list */
- rc_state->bufcnt++;
-
- if (!rc_state->if_generated)
- {
- expand_start_cond (expr, 0);
- rc_state->if_generated = 1;
- }
- else
- expand_start_elseif (expr);
-
- /* copy buffer's data to destination */
- var = TREE_VALUE (loclist);
-
- if (buftype != NULL_TREE && TREE_CODE (buftype) == ERROR_MARK)
- had_errors = 1;
- else if (! CH_COMPATIBLE (var, buftype))
- {
- error ("incompatible modes in receive buffer alternative.");
- had_errors = 1;
- }
-
- if (! CH_LOCATION_P (var))
- {
- error ("defining occurence in receive buffer alternative must be a location.");
- had_errors = 1;
- }
-
- if (! had_errors)
- {
- pointer_type = build_chill_pointer_type (TREE_TYPE (var));
- pointer = convert (pointer_type,
- rc_state->databufp);
- /* no need to check this pointer being NULL */
- assgn = build_chill_indirect_ref (pointer, NULL_TREE, 0);
-
- chill_expand_assignment (var, NOP_EXPR, assgn);
- }
-
- /* last action here */
- emit_line_note (input_filename, lineno);
-
- return build_tree_list (loclist, buffer);
-}
-/*
- * SIGNAME is the signal name or buffer location,
- * LOCLIST is a list of possible locations to store data in
- */
-tree
-build_receive_case_label (signame, loclist)
- tree signame, loclist;
-{
- /* now see what we have got and do some checks */
- if (TREE_CODE (signame) == TYPE_DECL && CH_DECL_SIGNAL (signame))
- return build_receive_signal_case_label (signame, loclist);
-
- if (TREE_TYPE (signame) != NULL_TREE
- && CH_IS_BUFFER_MODE (TREE_TYPE (signame)))
- {
- if (loclist == NULL_TREE)
- {
- error ("buffer receive alternative without `IN location'.");
- return error_mark_node;
- }
- return build_receive_buffer_case_label (signame, loclist);
- }
-
- error ("RECEIVE CASE alternative must specify a SIGNAL name or BUFFER location.");
- return error_mark_node;
-}
-
-/*
- * LABEL_CNT is the case-label counter passed from build_receive_case_start.
- * ELSE_CLAUSE defines if the RECEIVE CASE action had an ELSE(1) or not(0).
- * BUF_LIST is a tree-list of tree-lists, where TREE_VALUE defines the
- * BUFFER location and TREE_PURPOSE defines the defining occurence.
- */
-static void
-build_receive_buffer_case_end (buf_list, else_clause)
- tree buf_list, else_clause;
-{
- struct rc_state_type *rc_state = current_rc_state;
- tree alist;
- tree field_decls = NULL_TREE; /* list of all buffer types, for the union */
- int buffer_cnt = 0;
- tree descr_type = lookup_name (get_identifier ("__tmp_DESCR_type"));
- tree tuple = NULL_TREE; /* constructors for array of ptrs */
- tree union_type_node = NULL_TREE;
-
- /* walk thru all the buffers */
- for (alist = buf_list; alist != NULL_TREE;
- buffer_cnt++, alist = TREE_CHAIN (alist))
- {
- tree value = TREE_VALUE (alist);
- tree buffer = TREE_VALUE (value); /* this is the buffer */
- tree data = TREE_VALUE (TREE_PURPOSE (value)); /* the location to receive in */
- tree buffer_descr;
- tree buffer_descr_init;
- tree buffer_length;
- tree field;
- char fldname[20];
-
- /* build descriptor for buffer */
- buffer_length = max_queue_size (TREE_TYPE (buffer));
- if (buffer_length == NULL_TREE)
- buffer_length = infinite_buffer_event_length_node;
- buffer_descr_init = build_nt (CONSTRUCTOR, NULL_TREE,
- tree_cons (NULL_TREE, force_addr_of (buffer),
- tree_cons (NULL_TREE, buffer_length, NULL_TREE)));
- buffer_descr = decl_temp1 (get_unique_identifier ("RCbuffer"),
- TREE_TYPE (descr_type), 0,
- buffer_descr_init, 0, 0);
- tuple = tree_cons (NULL_TREE,
- force_addr_of (buffer_descr),
- tuple);
-
- /* make a field for the union */
- sprintf (fldname, "fld%03d", buffer_cnt);
- field = grok_chill_fixedfields (
- tree_cons (NULL_TREE, get_identifier (fldname), NULL_TREE),
- TREE_TYPE (data), NULL_TREE);
- if (field_decls == NULL_TREE)
- field_decls = field;
- else
- chainon (field_decls, field);
- }
-
- /* generate the union */
- if (field_decls != NULL_TREE)
- {
- tree data_id = get_identifier ("databuffer");
- tree data_decl;
-
- union_type_node = finish_struct (
- start_struct (UNION_TYPE, NULL_TREE),
- field_decls);
- data_decl = decl_temp1 (data_id, union_type_node, 0, NULL_TREE, 0, 0);
-
- chill_expand_assignment (rc_state->databufp, NOP_EXPR,
- force_addr_of (data_decl));
-
- chill_expand_assignment (rc_state->datalen, NOP_EXPR,
- size_in_bytes (TREE_TYPE (data_decl)));
- }
-
- /* tell runtime system if we had an else or not */
- chill_expand_assignment (rc_state->else_clause, NOP_EXPR, else_clause);
-
- /* generate the array of pointers to all buffers */
- {
- tree array_id = get_identifier ("buf_ptr_array");
- tree array_type_node =
- build_chill_array_type (ptr_type_node,
- tree_cons (NULL_TREE,
- build_chill_range_type (NULL_TREE,
- integer_one_node,
- build_int_2 (buffer_cnt, 0)),
- NULL_TREE),
- 0, NULL_TREE);
- tree constr = build_nt (CONSTRUCTOR, NULL_TREE, nreverse (tuple));
- tree array_decl = decl_temp1 (array_id, array_type_node, 0,
- constr, 0, 0);
-
- chill_expand_assignment (build_chill_cast (ptr_type_node, rc_state->sig_code),
- NOP_EXPR,
- force_addr_of (array_decl));
- chill_expand_assignment (rc_state->n_sigs, NOP_EXPR,
- build_int_2 (buffer_cnt, 0));
- }
-}
-
-/*
- * SIG_LIST is a tree list. The TREE_VALUEs are VAR_DECLs of
- * __tmp_%s_code variables, and the TREE_PURPOSEs are the
- * TYPE_DECLs of the __tmp_%s_struct types. LABEL_CNT is the
- * case-label counter passed from build_receive_case_start.
- */
-static void
-build_receive_signal_case_end (sig_list, else_clause)
- tree sig_list, else_clause;
-{
- struct rc_state_type *rc_state = current_rc_state;
- tree alist, temp1;
- tree union_type_node = NULL_TREE;
- tree field_decls = NULL_TREE; /* list of signal
- structure, for the union */
- tree tuple = NULL_TREE; /* constructor for array of ptrs */
- int signal_cnt = 0;
- int fldcnt = 0;
-
- /* for each list of locations, validate it against the
- corresponding signal's list of fields. */
- {
- for (alist = sig_list; alist != NULL_TREE;
- signal_cnt++, alist = TREE_CHAIN (alist))
- {
- tree value = TREE_VALUE (alist);
- tree signame = TREE_VALUE (value); /* signal's ID node */
- tree sigdecl = lookup_name (signame);
- tree sigtype = TREE_TYPE (sigdecl);
- tree field;
- char fldname[20];
-
- if (IDENTIFIER_SIGNAL_DATA (signame))
- {
- sprintf (fldname, "fld%03d", fldcnt++);
- field = grok_chill_fixedfields (
- tree_cons (NULL_TREE,
- get_identifier (fldname),
- NULL_TREE),
- sigtype, NULL_TREE);
- if (field_decls == NULL_TREE)
- field_decls = field;
- else
- chainon (field_decls, field);
-
- }
-
- temp1 = (tree)DECL_TASKING_CODE_DECL (sigdecl);
- mark_addressable (temp1);
- tuple = tree_cons (NULL_TREE,
- build1 (ADDR_EXPR,
- build_chill_pointer_type (chill_integer_type_node),
- temp1),
- tuple);
- }
- }
-
- /* generate the union of all of the signal data types */
- if (field_decls != NULL_TREE)
- {
- tree data_id = get_identifier ("databuffer");
- tree data_decl;
- union_type_node = finish_struct (start_struct (UNION_TYPE,
- NULL_TREE),
- field_decls);
- data_decl =
- decl_temp1 (data_id, union_type_node, 0, NULL_TREE, 0, 0);
-
- chill_expand_assignment (rc_state->databufp, NOP_EXPR,
- force_addr_of (data_decl));
-
- chill_expand_assignment (rc_state->datalen, NOP_EXPR,
- size_in_bytes (TREE_TYPE (data_decl)));
- }
-
- /* tell runtime system if we had an else or not */
- chill_expand_assignment (rc_state->else_clause, NOP_EXPR, else_clause);
-
- /* generate the array of all signal codes */
- {
- tree array_id = get_identifier ("sig_code_array");
- tree array_type_node
- = build_chill_array_type (
- build_chill_pointer_type (chill_integer_type_node),
- tree_cons (NULL_TREE,
- build_chill_range_type (NULL_TREE,
- integer_one_node,
- build_int_2 (signal_cnt, 0)),
- NULL_TREE),
- 0, NULL_TREE);
- tree constr = build_nt (CONSTRUCTOR, NULL_TREE,
- nreverse (tuple));
- tree array_decl =
- decl_temp1 (array_id, array_type_node, 0, constr, 0, 0);
-
- chill_expand_assignment (rc_state->sig_code, NOP_EXPR,
- force_addr_of (array_decl));
-
- /* give number of signals to runtime system */
- chill_expand_assignment (rc_state->n_sigs, NOP_EXPR,
- build_int_2 (signal_cnt, 0));
- }
-}
-
-/* General function for the end of a RECEIVE CASE action */
-
-void
-build_receive_case_end (alist, else_clause)
- tree alist, else_clause;
-{
- rtx rcdone = gen_label_rtx ();
- struct rc_state_type *rc_state = current_rc_state;
- tree tmp;
- int had_errors = 0;
-
- /* finish the if's, if generated */
- if (rc_state->if_generated)
- expand_end_cond ();
-
- /* check alist for errors */
- for (tmp = alist; tmp != NULL_TREE; tmp = TREE_CHAIN (tmp))
- {
- if (TREE_CODE (TREE_VALUE (tmp)) == ERROR_MARK)
- had_errors++;
- }
-
- /* jump to the end of RECEIVE CASE processing */
- emit_jump (rcdone);
-
- /* define the __rcsetup label. We come here to initialize
- all variables */
- emit_label (rc_state->rcsetup);
-
- if (alist == NULL_TREE && !had_errors)
- {
- error ("RECEIVE CASE without alternatives");
- goto gen_rcdoit;
- }
-
- if (TREE_CODE (alist) == ERROR_MARK || had_errors)
- goto gen_rcdoit;
-
- /* now call the actual end function */
- if (rc_state->bufseen)
- build_receive_buffer_case_end (alist, else_clause);
- else
- build_receive_signal_case_end (alist, else_clause);
-
- /* now jump to the beginning of RECEIVE CASE processing */
-gen_rcdoit: ;
- emit_jump (rc_state->rcdoit);
-
- /* define the __rcdone label. We come here when the whole
- receive case is done. */
- emit_label (rcdone);
-
- current_rc_state = rc_state->enclosing;
- free(rc_state);
-}
-
-/* build a CONTINUE action */
-
-void expand_continue_event (evloc)
- tree evloc;
-{
- tree filename, linenumber, evaddr;
-
- /* do some checks */
- if (evloc == NULL_TREE || TREE_CODE (evloc) == ERROR_MARK)
- return;
-
- if (! CH_REFERABLE (evloc) || ! CH_IS_EVENT_MODE (TREE_TYPE (evloc)))
- {
- error ("CONTINUE requires an event location.");
- return;
- }
-
- evaddr = force_addr_of (evloc);
- filename = force_addr_of (get_chill_filename ());
- linenumber = get_chill_linenumber ();
-
- expand_expr_stmt (
- build_chill_function_call (lookup_name (get_identifier ("__continue")),
- tree_cons (NULL_TREE, evaddr,
- tree_cons (NULL_TREE, filename,
- tree_cons (NULL_TREE, linenumber, NULL_TREE)))));
-}
-
-#if 0
- * The following code builds a DELAY CASE statement,
- * which looks like this in CHILL:
- *
- * DCL ev1, ev2 EVENT, ins INSTANCE;
- * DCL ev3 EVENT (10);
- * DCL count1 INT := 0, count2 INT := 0;
- *
- * DELAY CASE SET ins;
- * (ev1): count1 +:= 1;
- * (ev2, ev3): count2 +:= 1;
- * ESAC;
- *
- * Because we don''t know until we get to the ESAC how
- * many events need processing, we generate the following
- * C-equivalent code:
- *
- *
- * { /* start a new symbol context */
- * typedef struct
- * {
- * void *p;
- * unsigned long len;
- * } Descr;
- * int number_of_events;
- * Descr *event_codes;
- *
- * goto __dlsetup;
- *
- * __dldoit:
- * void *whatevent = __delay_event (number_of_events,
- * event_codes,
- * priority,
- * &instance_loc,
- * filename,
- * linenumber);
- * if (whatevent == &ev1)
- * {
- * /* code for ev1 alternative's action_statement_list */
- * count1 += 1;
- * }
- * else if (whatevent == &ev2 || whatevent == &ev3)
- * {
- * /* code for ev2 and ev3 alternative's action_statement_list */
- * count2 += 1;
- * }
- * goto __dl_done;
- *
- * __dlsetup:
- * Descr event_code_ptr [3] = {
- * { &ev1, -1 },
- * { &ev2, -1 },
- * { &ev3, 10 } };
- * event_codes = &event_code_ptr[0];
- * number_of_events = 3;
- * goto __dldoit;
- *
- * __dl_done:
- * ;
- * } /* end the new symbol context */
- *
-#endif
-
-struct dl_state_type
-{
- struct dl_state_type *enclosing;
- rtx dldoit;
- rtx dlsetup;
- tree n_events;
- tree event_codes;
- tree received_event;
-};
-
-struct dl_state_type *current_dl_state = NULL;
-
-/* build_receive_case_start returns an INTEGER_CST node
- containing the case-label number to be used by
- build_receive_case_end to generate correct labels */
-tree
-build_delay_case_start (optset, optpriority)
- tree optset, optpriority;
-{
- /* counter to generate unique delay case labels */
- static int dl_lbl_count = 0;
- tree current_label_value =
- build_int_2 ((HOST_WIDE_INT)dl_lbl_count, 0);
- tree wait_call;
- tree actuallist = NULL_TREE;
- tree filename, linenumber;
- tree to_loc;
-
- struct dl_state_type *dl_state
- = (struct dl_state_type*) xmalloc (sizeof (struct dl_state_type));
- dl_state->enclosing = current_dl_state;
- current_dl_state = dl_state;
- dl_state->dldoit = gen_label_rtx ();
- dl_state->dlsetup = gen_label_rtx ();
-
- dl_lbl_count++;
-
- /* check the optional SET location */
- if (optset == NULL_TREE
- || TREE_CODE (optset) == ERROR_MARK)
- optset = null_pointer_node;
- else if (CH_IS_INSTANCE_MODE (TREE_TYPE (optset)) && CH_LOCATION_P (optset))
- optset = force_addr_of (optset);
- else
- {
- error ("SET requires INSTANCE location");
- optset = null_pointer_node;
- }
-
- /* check the presence of the PRIORITY expression */
- if (optpriority == NULL_TREE)
- optpriority = integer_zero_node;
- else if (TREE_CODE (optpriority) == ERROR_MARK)
- optpriority = integer_zero_node;
- else if (TREE_CODE (TREE_TYPE (optpriority)) != INTEGER_TYPE)
- {
- error ("PRIORITY must be of integer type.");
- optpriority = integer_zero_node;
- }
-
- /* check for time supervised */
- to_loc = build_timeout_preface ();
-
- dl_state->n_events =
- decl_temp1 (get_identifier ("number_of_events"),
- integer_type_node, 0, integer_zero_node, 0, 0);
-
- dl_state->event_codes =
- decl_temp1 (get_identifier ("event_codes"),
- ptr_type_node, 0, null_pointer_node, 0, 0);
-
- /* wait_event will store the signal number in here */
- dl_state->received_event =
- decl_temp1 (get_identifier ("received_event"),
- ptr_type_node, 0, NULL_TREE, 0, 0);
-
- /* now jump to the end of RECEIVE CASE actions, to
- set up variables for them. */
- emit_jump (dl_state->dlsetup);
-
- /* define the __rcdoit label. We come here after
- initialization of all variables, to execute the
- actions. */
- emit_label (dl_state->dldoit);
-
- filename = force_addr_of (get_chill_filename ());
- linenumber = get_chill_linenumber ();
-
- /* here we go, call the runtime routine */
- actuallist = tree_cons (NULL_TREE, force_addr_of (dl_state->received_event),
- tree_cons (NULL_TREE, dl_state->n_events,
- tree_cons (NULL_TREE, dl_state->event_codes,
- tree_cons (NULL_TREE, optpriority,
- tree_cons (NULL_TREE, to_loc,
- tree_cons (NULL_TREE, optset,
- tree_cons (NULL_TREE, filename,
- tree_cons (NULL_TREE, linenumber, NULL_TREE))))))));
-
- wait_call = build_chill_function_call (
- lookup_name (get_identifier ("__delay_event")),
- actuallist);
-
-#if 0
- chill_expand_assignment (dl_state->received_event, NOP_EXPR, wait_call);
-#endif
- build_timesupervised_call (wait_call, to_loc);
- return current_label_value;
-}
-
-/*
- EVENTLIST is the list of this alternative's events
- and IF_OR_ELSEIF indicates what action (1 for if and
- 0 for else if) should be generated.
-*/
-void
-build_delay_case_label (eventlist, if_or_elseif)
- tree eventlist;
- int if_or_elseif;
-{
- tree eventp, expr = NULL_TREE;
-
- if (eventlist == NULL_TREE || TREE_CODE (eventlist) == ERROR_MARK)
- return;
-
- for (eventp = eventlist; eventp != NULL_TREE;
- eventp = TREE_CHAIN (eventp))
- {
- tree event = TREE_VALUE (eventp);
- tree temp1;
-
- if (event == NULL_TREE || TREE_CODE (event) == ERROR_MARK)
- temp1 = null_pointer_node;
- else if (! CH_IS_EVENT_MODE (TREE_TYPE (event)) || ! CH_REFERABLE (event))
- {
- error ("delay alternative must be an EVENT location.");
- temp1 = null_pointer_node;
- }
- else
- temp1 = force_addr_of (event);
-
- /* build the conditional expression */
- if (expr == NULL_TREE)
- expr = build (EQ_EXPR, boolean_type_node,
- current_dl_state->received_event, temp1);
- else
- expr =
- build (TRUTH_ORIF_EXPR, boolean_type_node, expr,
- build (EQ_EXPR, boolean_type_node,
- current_dl_state->received_event, temp1));
- }
- if (if_or_elseif)
- expand_start_cond (expr, 0);
- else
- expand_start_elseif (expr);
-
- /* last action here */
- emit_line_note (input_filename, lineno);
-}
-
-/*
- * EVENT_LIST is a tree list. The TREE_VALUEs are VAR_DECLs of
- * EVENT variables. LABEL_CNT is the case-label counter
- * passed from build_delay_case_start.
- */
-void
-build_delay_case_end (event_list)
- tree event_list;
-{
- struct dl_state_type *dl_state = current_dl_state;
- rtx dldone = gen_label_rtx ();
- tree tuple = NULL_TREE; /* constructor for array of descrs */
- tree acode;
- int event_cnt = 0;
-
- /* if we have an empty event_list, there was no alternatives and we
- havn't started an if therefor don't run expand_end_cond */
- if (event_list != NULL_TREE)
- /* finish the if's */
- expand_end_cond ();
-
- /* jump to the end of RECEIVE CASE processing */
- emit_jump (dldone);
-
- /* define the __dlsetup label. We come here to initialize
- all variables */
- emit_label (dl_state->dlsetup);
-
- if (event_list == NULL_TREE)
- {
- error ("DELAY CASE without alternatives");
- goto gen_dldoit;
- }
-
- if (event_list == NULL_TREE
- || TREE_CODE (event_list) == ERROR_MARK)
- goto gen_dldoit;
-
- /* make a list of pointers (in reverse order)
- to the event code variables */
- for (acode = event_list; acode != NULL_TREE;
- acode = TREE_CHAIN (acode))
- {
- tree event = TREE_VALUE (acode);
- tree event_length;
- tree descr_init;
-
- if (event == NULL_TREE || TREE_CODE (event) == ERROR_MARK)
- {
- descr_init =
- tree_cons (NULL_TREE, null_pointer_node,
- tree_cons (NULL_TREE, integer_zero_node, NULL_TREE));
- }
- else
- {
- event_length = max_queue_size (TREE_TYPE (event));
- if (event_length == NULL_TREE)
- event_length = infinite_buffer_event_length_node;
- descr_init =
- tree_cons (NULL_TREE, force_addr_of (event),
- tree_cons (NULL_TREE, event_length, NULL_TREE));
- }
- tuple = tree_cons (NULL_TREE,
- build_nt (CONSTRUCTOR, NULL_TREE, descr_init),
- tuple);
- event_cnt++;
- }
-
- /* generate the array of all event code pointers */
- {
- tree descr_type = TREE_TYPE (lookup_name (get_identifier ("__tmp_DESCR_type")));
- tree array_id = get_identifier ("event_code_array");
- tree array_type_node
- = build_chill_array_type (descr_type,
- tree_cons (NULL_TREE,
- build_chill_range_type (NULL_TREE,
- integer_one_node,
- build_int_2 (event_cnt, 0)),
- NULL_TREE),
- 0, NULL_TREE);
- tree constr = build_nt (CONSTRUCTOR, NULL_TREE,
- nreverse (tuple));
- tree array_decl =
- decl_temp1 (array_id, array_type_node, 0, constr, 0, 0);
-
- chill_expand_assignment (dl_state->event_codes, NOP_EXPR,
- force_addr_of (array_decl));
-
- /* give number of signals to runtime system */
- chill_expand_assignment (dl_state->n_events, NOP_EXPR,
- build_int_2 (event_cnt, 0));
- }
-
- /* now jump to the beginning of DELAY CASE processing */
-gen_dldoit:
- emit_jump (dl_state->dldoit);
-
- /* define the __dldone label. We come here when the whole
- DELAY CASE is done. */
- emit_label (dldone);
-
- current_dl_state = dl_state->enclosing;
- free(dl_state);
-}
-
-#if 0
- * The following code builds a simple delay statement,
- * which looks like this in CHILL:
- *
- * DCL ev1 EVENT(5), ins INSTANCE;
- *
- * DELAY ev1 PRIORITY 7;
- *
- * This statement unconditionally delays the current
- * PROCESS, until some other process CONTINUEs it.
- *
- * Here is the generated C code:
- *
- * typedef struct
- * {
- * void *p;
- * unsigned long len;
- * } Descr;
- *
- * static short __tmp_ev1_code;
- *
- * { /* start a new symbol context */
- *
- * Descr __delay_array[1] = { { ev1, 5 } };
- *
- * __delay_event (1, &__delay_array, 7, NULL,
- * filename, linenumber);
- *
- * } /* end of symbol scope */
- */
-#endif
-void
-build_delay_action (event, optpriority)
- tree event, optpriority;
-{
- int had_errors = 0;
- tree to_loc = NULL_TREE;
- /* we discard the return value of __delay_event, cause in
- a normal DELAY action no selections have to be made */
- tree ev_got = null_pointer_node;
-
- /* check the event */
- if (event == NULL_TREE || TREE_CODE (event) == ERROR_MARK)
- had_errors = 1;
- else if (! CH_IS_EVENT_MODE (TREE_TYPE (event)) || ! CH_REFERABLE (event))
- {
- error ("DELAY action requires an event location.");
- had_errors = 1;
- }
-
- /* check the presence of priority */
- if (optpriority != NULL_TREE)
- {
- if (TREE_CODE (optpriority) == ERROR_MARK)
- return;
- if (TREE_CODE (TREE_TYPE (optpriority)) != INTEGER_TYPE)
- {
- error ("PRIORITY in DELAY action must be of integer type.");
- return;
- }
- }
- else
- {
- /* issue a warning in case of -Wall */
- if (extra_warnings)
- {
- warning ("DELAY action without priority.");
- warning (" PRIORITY defaulted to 0.");
- }
- optpriority = integer_zero_node;
- }
- if (had_errors)
- return;
-
- {
- tree descr_type;
- tree array_type_node;
- tree array_decl;
- tree descr_init;
- tree array_init;
- tree event_length = max_queue_size (TREE_TYPE (event));
- tree event_codes;
- tree filename = force_addr_of (get_chill_filename ());
- tree linenumber = get_chill_linenumber ();
- tree actuallist;
-
- to_loc = build_timeout_preface ();
-
- descr_type = TREE_TYPE (lookup_name (get_identifier ("__tmp_DESCR_type")));
-
- array_type_node =
- build_chill_array_type (descr_type,
- tree_cons (NULL_TREE,
- build_chill_range_type (NULL_TREE, integer_one_node,
- integer_one_node),
- NULL_TREE),
- 0, NULL_TREE);
- if (event_length == NULL_TREE)
- event_length = infinite_buffer_event_length_node;
-
- descr_init =
- tree_cons (NULL_TREE, force_addr_of (event),
- tree_cons (NULL_TREE, event_length, NULL_TREE));
- array_init =
- tree_cons (NULL_TREE,
- build_nt (CONSTRUCTOR, NULL_TREE, descr_init),
- NULL_TREE);
- array_decl =
- decl_temp1 (get_unique_identifier ("event_codes_array"),
- array_type_node, 0,
- build_nt (CONSTRUCTOR, NULL_TREE, array_init),
- 0, 0);
-
- event_codes =
- decl_temp1 (get_unique_identifier ("event_ptr"),
- ptr_type_node, 0,
- force_addr_of (array_decl),
- 0, 0);
-
- actuallist =
- tree_cons (NULL_TREE, ev_got,
- tree_cons (NULL_TREE, integer_one_node,
- tree_cons (NULL_TREE, event_codes,
- tree_cons (NULL_TREE, optpriority,
- tree_cons (NULL_TREE, to_loc,
- tree_cons (NULL_TREE, null_pointer_node,
- tree_cons (NULL_TREE, filename,
- tree_cons (NULL_TREE, linenumber, NULL_TREE))))))));
-
-
- build_timesupervised_call (
- build_chill_function_call (
- lookup_name (get_identifier ("__delay_event")),
- actuallist), to_loc);
- }
-}
-
-void
-expand_send_buffer (buffer, value, optpriority, optwith, optto)
- tree buffer, value, optpriority, optwith, optto;
-{
- tree filename, linenumber;
- tree buffer_mode_decl = NULL_TREE;
- tree buffer_ptr, value_ptr;
- int had_errors = 0;
- tree timeout_value, fcall;
-
- /* check buffer location */
- if (buffer == NULL_TREE || TREE_CODE (buffer) == ERROR_MARK)
- {
- buffer = NULL_TREE;
- had_errors = 1;
- }
- if (buffer != NULL_TREE)
- {
- if (! CH_IS_BUFFER_MODE (TREE_TYPE (buffer)) || ! CH_REFERABLE (buffer))
- {
- error ("send buffer action requires a BUFFER location.");
- had_errors = 1;
- }
- else
- buffer_mode_decl = TREE_CHAIN (TYPE_FIELDS (TREE_TYPE (buffer)));
- }
-
- /* check value and type */
- if (value == NULL_TREE || TREE_CODE (value) == ERROR_MARK)
- {
- had_errors = 1;
- value = NULL_TREE;
- }
- if (value != NULL_TREE)
- {
- if (TREE_CHAIN (value) != NULL_TREE)
- {
- error ("there must be only 1 value for send buffer action.");
- had_errors = 1;
- }
- else
- {
- value = TREE_VALUE (value);
- if (value == NULL_TREE || TREE_CODE (value) == ERROR_MARK)
- {
- had_errors = 1;
- value = NULL_TREE;
- }
- if (value != NULL_TREE && buffer_mode_decl != NULL_TREE)
- {
- if (TREE_TYPE (buffer_mode_decl) != NULL_TREE &&
- TREE_CODE (TREE_TYPE (buffer_mode_decl)) == ERROR_MARK)
- had_errors = 1;
- else if (CH_COMPATIBLE (value, TREE_TYPE (buffer_mode_decl)))
- {
- value = convert (TREE_TYPE (buffer_mode_decl), value);
- if (value == NULL_TREE || TREE_CODE (value) == ERROR_MARK)
- {
- error ("convert failed for send buffer action.");
- had_errors = 1;
- }
- }
- else
- {
- error ("incompatible modes in send buffer action.");
- had_errors = 1;
- }
- }
- }
- }
-
- /* check the presence of priority */
- if (optpriority == NULL_TREE)
- {
- if (send_buffer_prio == NULL_TREE)
- {
- /* issue a warning in case of -Wall */
- if (extra_warnings)
- {
- warning ("Buffer sent without priority");
- warning (" and no default priority was set.");
- warning (" PRIORITY defaulted to 0.");
- }
- optpriority = integer_zero_node;
- }
- else
- optpriority = send_buffer_prio;
- }
- else if (TREE_CODE (optpriority) == ERROR_MARK)
- had_errors = 1;
- else if (TREE_CODE (TREE_TYPE (optpriority)) != INTEGER_TYPE)
- {
- error ("PRIORITY must be of integer type.");
- had_errors = 1;
- }
-
- if (optwith != NULL_TREE)
- {
- error ("WITH not allowed for send buffer action.");
- had_errors = 1;
- }
- if (optto != NULL_TREE)
- {
- error ("TO not allowed for send buffer action.");
- had_errors = 1;
- }
- if (had_errors)
- return;
-
- {
- tree descr_type;
- tree buffer_descr, buffer_init, buffer_length;
- tree val;
-
- /* process timeout */
- timeout_value = build_timeout_preface ();
-
- descr_type = lookup_name (get_identifier ("__tmp_DESCR_type"));
-
- /* build descr for buffer */
- buffer_length = max_queue_size (TREE_TYPE (buffer));
- if (buffer_length == NULL_TREE)
- buffer_length = infinite_buffer_event_length_node;
- buffer_init = build_nt (CONSTRUCTOR, NULL_TREE,
- tree_cons (NULL_TREE, force_addr_of (buffer),
- tree_cons (NULL_TREE, buffer_length, NULL_TREE)));
- buffer_descr = decl_temp1 (get_unique_identifier ("buffer_descr"),
- TREE_TYPE (descr_type), 0, buffer_init,
- 0, 0);
- buffer_ptr = decl_temp1 (get_unique_identifier ("buffer_ptr"),
- ptr_type_node, 0,
- force_addr_of (buffer_descr),
- 0, 0);
-
- /* build descr for value */
- if (! CH_REFERABLE (value))
- val = decl_temp1 (get_identifier ("buffer_value"),
- TREE_TYPE (value), 0,
- value, 0, 0);
- else
- val = value;
-
- value_ptr = build_chill_descr (val);
-
- }
-
- /* get filename and linenumber */
- filename = force_addr_of (get_chill_filename ());
- linenumber = get_chill_linenumber ();
-
- /* Now, we can call the runtime */
- fcall = build_chill_function_call (
- lookup_name (get_identifier ("__send_buffer")),
- tree_cons (NULL_TREE, buffer_ptr,
- tree_cons (NULL_TREE, value_ptr,
- tree_cons (NULL_TREE, optpriority,
- tree_cons (NULL_TREE, timeout_value,
- tree_cons (NULL_TREE, filename,
- tree_cons (NULL_TREE, linenumber, NULL_TREE)))))));
- build_timesupervised_call (fcall, timeout_value);
-}
-# if 0
-
-void
-process_buffer_decls (namelist, mode, optstatic)
- tree namelist, mode;
- int optstatic;
-{
- tree names;
- int quasi_flag = current_module->is_spec_module;
-
- if (pass < 2)
- return;
-
- for (names = namelist; names != NULL_TREE; names = TREE_CHAIN (names))
- {
- tree name = TREE_VALUE (names);
- tree bufdecl = lookup_name (name);
- tree code_decl =
- decl_tasking_code_variable (name, &buffer_code, quasi_flag);
-
- /* remember the code variable in the buffer decl */
- DECL_TASKING_CODE_DECL (bufdecl) = (struct lang_decl *)code_decl;
-
- add_taskstuff_to_list (code_decl, "_TT_Buffer",
- quasi_flag ? NULL_TREE : buffer_code,
- bufdecl);
- }
-}
-#endif
-
-/*
- * if no queue size was specified, QUEUESIZE is integer_zero_node.
- */
-tree
-build_buffer_type (element_type, queuesize)
- tree element_type, queuesize;
-{
- tree type, field;
- if (element_type == NULL_TREE || TREE_CODE (element_type) == ERROR_MARK)
- return error_mark_node;
- if (queuesize != NULL_TREE && TREE_CODE (queuesize) == ERROR_MARK)
- return error_mark_node;
-
- type = make_node (RECORD_TYPE);
- field = build_decl (FIELD_DECL, get_identifier("__buffer_data"),
- ptr_type_node);
- TYPE_FIELDS (type) = field;
- TREE_CHAIN (field)
- = build_lang_decl (TYPE_DECL, get_identifier ("__element_mode"),
- element_type);
- field = TREE_CHAIN (field);
- if (queuesize)
- {
- tree size_field = build_decl (CONST_DECL, get_identifier("__queue_max"),
- integer_type_node);
- DECL_INITIAL (size_field) = queuesize;
- TREE_CHAIN (field) = size_field;
- }
- CH_IS_BUFFER_MODE (type) = 1;
- CH_TYPE_NONVALUE_P (type) = 1;
- if (pass == 2)
- type = layout_chill_struct_type (type);
- return type;
-}
-
-#if 0
-tree
-build_buffer_descriptor (bufname, expr, optpriority)
- tree bufname, expr, optpriority;
-{
- tree bufdecl;
-
- if (bufname == NULL_TREE
- || TREE_CODE (bufname) == ERROR_MARK)
- return error_mark_node;
-
- if (expr != NULL_TREE
- && TREE_CODE (expr) == ERROR_MARK)
- return error_mark_node;
-#if 0
-/* FIXME: is this what we really want to test? */
- bufdecl = lookup_name (bufname);
- if (TREE_CODE (bufdecl) != TYPE_DECL
- || ! CH_IS_BUFFER_MODE (TREE_TYPE (bufdecl)))
- {
- error ("SEND requires a BUFFER; `%s' is not a BUFFER name",
- bufname);
- return error_mark_node;
- }
-#endif
- {
- /* build buffer/signal data structure */
- tree bufdataname = get_unique_identifier (IDENTIFIER_POINTER (bufname));
- tree dataptr;
-
- if (expr == NULL_TREE)
- dataptr = null_pointer_node;
- else
- {
- tree decl =
- decl_temp1 (bufdataname, TREE_TYPE (bufdecl), 0,
- expr, 0, 0);
- /* prevent granting of this variable */
- DECL_SOURCE_LINE (decl) = 0;
-
- dataptr = force_addr_of (decl);
- }
-
- /* build descriptor pointing to buffer data */
- {
- tree tasking_message_var = get_unique_identifier (IDENTIFIER_POINTER (bufname));
- tree data_len = (expr == NULL_TREE) ? integer_zero_node :
- size_in_bytes (TREE_TYPE (bufdecl));
- tree tasking_code = (tree)DECL_TASKING_CODE_DECL (bufdecl);
- tree tuple = build_nt (CONSTRUCTOR, NULL_TREE,
- tree_cons (NULL_TREE,
- build1 (ADDR_EXPR,
- build_chill_pointer_type (chill_integer_type_node),
- tasking_code),
- tree_cons (NULL_TREE, data_len,
- tree_cons (NULL_TREE, dataptr, NULL_TREE))));
-
- tree decl = decl_temp1 (tasking_message_var,
- TREE_TYPE (tasking_message_type), 0,
- tuple, 0, 0);
- mark_addressable (tasking_code);
- /* prevent granting of this variable */
- DECL_SOURCE_LINE (decl) = 0;
-
- tuple = force_addr_of (decl);
- return tuple;
- }
- }
-}
-#endif
-
-#if 0
-void
-process_event_decls (namelist, mode, optstatic)
- tree namelist, mode;
- int optstatic;
-{
- tree names;
- int quasi_flag = current_module->is_spec_module;
-
- if (pass < 2)
- return;
-
- for (names = namelist; names != NULL_TREE; names = TREE_CHAIN (names))
- {
- tree name = TREE_VALUE (names);
- tree eventdecl = lookup_name (name);
- tree code_decl =
- decl_tasking_code_variable (name, &event_code, quasi_flag);
-
- /* remember the code variable in the event decl */
- DECL_TASKING_CODE_DECL (eventdecl) = (struct lang_decl *)code_decl;
-
- add_taskstuff_to_list (code_decl, "_TT_Event",
- quasi_flag ? NULL_TREE : event_code,
- eventdecl);
- }
-}
-#endif
-
-/* Return the buffer or event length of a buffer or event mode.
- (NULL_TREE means unlimited.) */
-
-tree
-max_queue_size (mode)
- tree mode;
-{
- tree field = TYPE_FIELDS (mode);
- for ( ; field != NULL_TREE ; field = TREE_CHAIN (field))
- {
- if (TREE_CODE (field) == CONST_DECL)
- return DECL_INITIAL (field);
- }
- return NULL_TREE;
-}
-
-/* Return the buffer element mode of a buffer mode. */
-
-tree
-buffer_element_mode (bufmode)
- tree bufmode;
-{
- tree field = TYPE_FIELDS (bufmode);
- for ( ; field != NULL_TREE; field = TREE_CHAIN (field))
- {
- if (TREE_CODE (field) == TYPE_DECL)
- return TREE_TYPE (field);
- }
- return NULL_TREE;
-}
-
-/* invalidate buffer element mode in case we detect, that the
- elelment mode has the non-value property */
-
-void
-invalidate_buffer_element_mode (bufmode)
- tree bufmode;
-{
- tree field = TYPE_FIELDS (bufmode);
- for ( ; field != NULL_TREE; field = TREE_CHAIN (field))
- {
- if (TREE_CODE (field) == TYPE_DECL)
- {
- TREE_TYPE (field) = error_mark_node;
- return;
- }
- }
-}
-
-/* For an EVENT or BUFFER mode TYPE, with a give maximum queue size QSIZE,
- perform various error checks. Return a new queue size. */
-
-tree
-check_queue_size (qsize)
- tree qsize;
-{
- if (qsize == NULL_TREE || TREE_CODE (qsize) == ERROR_MARK)
- return qsize;
- if (TREE_TYPE (qsize) == NULL_TREE
- || !CH_SIMILAR (TREE_TYPE (qsize), integer_type_node))
- {
- error ("non-integral max queue size for EVENT/BUFFER mode");
- return integer_one_node;
- }
- if (TREE_CODE (qsize) != INTEGER_CST)
- {
- error ("non-constant max queue size for EVENT/BUFFER mode");
- return integer_one_node;
- }
- if (compare_int_csts (pedantic ? LE_EXPR : LT_EXPR,
- qsize,
- integer_zero_node))
- {
- error ("max queue_size for EVENT/BUFFER is not positive");
- return integer_one_node;
- }
- return qsize;
-}
-
-/*
- * An EVENT type is modelled as a boolean type, which should
- * allocate the minimum amount of space.
- */
-tree
-build_event_type (queuesize)
- tree queuesize;
-{
- tree type = make_node (RECORD_TYPE);
- tree field = build_decl (FIELD_DECL, get_identifier("__event_data"),
- ptr_type_node);
- TYPE_FIELDS (type) = field;
- if (queuesize)
- {
- tree size_field = build_decl (CONST_DECL, get_identifier("__queue_max"),
- integer_type_node);
- DECL_INITIAL (size_field) = queuesize;
- TREE_CHAIN (field) = size_field;
- }
- CH_IS_EVENT_MODE (type) = 1;
- CH_TYPE_NONVALUE_P (type) = 1;
- if (pass == 2)
- type = layout_chill_struct_type (type);
- return type;
-}
-
-/*
- * Initialize the various types of tasking data.
- */
-void
-tasking_init ()
-{
- extern int ignore_case;
- extern int special_UC;
- extern tree chill_predefined_function_type;
- tree temp, ins_ftype_void;
- tree endlink = void_list_node;
- tree int_ftype_ptr_int_ptr_ptr_int_ptr_int_ptr_ptr_int;
- tree void_ftype_ptr;
- tree void_ftype_ptr_ins_int_int_ptr_ptr_int;
- tree int_ftype_ptr_ptr_int_ptr_ptr_int;
- tree void_ftype_int_int_int_ptr_ptr_ptr_int;
- tree int_ftype_ptr_int_ptr_int_ptr_ptr_ptr_int;
- tree int_ftype_ptr_int;
-
- /* type of tasking code variables */
- chill_taskingcode_type_node = short_unsigned_type_node;
-
- void_ftype_void =
- build_function_type (void_type_node,
- tree_cons (NULL_TREE, void_type_node, NULL_TREE));
-
- build_instance_type ();
- ins_ftype_void
- = build_function_type (instance_type_node,
- tree_cons (NULL_TREE, void_type_node,
- build_tree_list (NULL_TREE, void_type_node)));
-
- builtin_function ("__whoami", ins_ftype_void,
- 0, NOT_BUILT_IN, NULL_PTR);
-
- build_tasking_message_type ();
-
- temp = build_decl (TYPE_DECL,
- get_identifier ("__tmp_TaskingStruct"),
- build_tasking_struct ());
- pushdecl (temp);
- DECL_SOURCE_LINE (temp) = 0;
-
- /* any SIGNAL will be compatible with this one */
- generic_signal_type_node = copy_node (boolean_type_node);
-
- builtin_function ((ignore_case || ! special_UC) ? "copy_number" : "COPY_NUMBER",
- chill_predefined_function_type,
- BUILT_IN_COPY_NUMBER, BUILT_IN_NORMAL, NULL_PTR);
- builtin_function ((ignore_case || ! special_UC) ? "gen_code" : "GEN_CODE",
- chill_predefined_function_type,
- BUILT_IN_GEN_CODE, BUILT_IN_NORMAL, NULL_PTR);
- builtin_function ((ignore_case || ! special_UC) ? "gen_inst" : "GEN_INST",
- chill_predefined_function_type,
- BUILT_IN_GEN_INST, BUILT_IN_NORMAL, NULL_PTR);
- builtin_function ((ignore_case || ! special_UC) ? "gen_ptype" : "GEN_PTYPE",
- chill_predefined_function_type,
- BUILT_IN_GEN_PTYPE, BUILT_IN_NORMAL, NULL_PTR);
- builtin_function ((ignore_case || ! special_UC) ? "proc_type" : "PROC_TYPE",
- chill_predefined_function_type,
- BUILT_IN_PROC_TYPE, BUILT_IN_NORMAL, NULL_PTR);
- builtin_function ((ignore_case || ! special_UC) ? "queue_length" : "QUEUE_LENGTH",
- chill_predefined_function_type,
- BUILT_IN_QUEUE_LENGTH, BUILT_IN_NORMAL, NULL_PTR);
-
- int_ftype_ptr_int_ptr_ptr_int_ptr_int_ptr_ptr_int
- = build_function_type (integer_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- endlink)))))))))));
- void_ftype_ptr
- = build_function_type (void_type_node,
- tree_cons (NULL_TREE, ptr_type_node, endlink));
-
- int_ftype_ptr_int_ptr_int_ptr_ptr_ptr_int
- = build_function_type (integer_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- endlink)))))))));
-
- void_ftype_ptr_ins_int_int_ptr_ptr_int
- = build_function_type (void_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, instance_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- endlink))))))));
- int_ftype_ptr_ptr_int_ptr_ptr_int
- = build_function_type (integer_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- endlink)))))));
-
- void_ftype_int_int_int_ptr_ptr_ptr_int
- = build_function_type (void_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- endlink))))))));
-
- int_ftype_ptr_int
- = build_function_type (integer_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- endlink)));
-
- builtin_function ("__delay_event", int_ftype_ptr_int_ptr_int_ptr_ptr_ptr_int,
- 0, NOT_BUILT_IN, NULL_PTR);
- builtin_function ("__queue_length", int_ftype_ptr_int,
- 0, NOT_BUILT_IN, NULL_PTR);
- builtin_function ("__register_tasking", void_ftype_ptr,
- 0, NOT_BUILT_IN, NULL_PTR);
- builtin_function ("__send_signal", void_ftype_ptr_ins_int_int_ptr_ptr_int,
- 0, NOT_BUILT_IN, NULL_PTR);
- builtin_function ("__send_buffer", int_ftype_ptr_ptr_int_ptr_ptr_int,
- 0, NOT_BUILT_IN, NULL_PTR);
- builtin_function ("__start_process", void_ftype_int_int_int_ptr_ptr_ptr_int,
- 0, NOT_BUILT_IN, NULL_PTR);
- builtin_function ("__stop_process", void_ftype_void, 0, NOT_BUILT_IN,
- NULL_PTR);
- builtin_function ("__wait_buffer", int_ftype_ptr_int_ptr_ptr_int_ptr_int_ptr_ptr_int,
- 0, NOT_BUILT_IN, NULL_PTR);
- builtin_function ("__wait_signal_timed", int_ftype_ptr_int_ptr_ptr_int_ptr_int_ptr_ptr_int,
- 0, NOT_BUILT_IN, NULL_PTR);
-
- infinite_buffer_event_length_node = build_int_2 (-1, 0);
- TREE_TYPE (infinite_buffer_event_length_node) = long_integer_type_node;
- TREE_UNSIGNED (infinite_buffer_event_length_node) = 1;
-}
diff --git a/gcc/ch/timing.c b/gcc/ch/timing.c
deleted file mode 100644
index b7479071120..00000000000
--- a/gcc/ch/timing.c
+++ /dev/null
@@ -1,491 +0,0 @@
-/* Implement timing-related actions for CHILL.
- Copyright (C) 1992, 1993, 1994, 1998, 2000, 2001
- Free Software Foundation, Inc.
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-#include "config.h"
-#include "system.h"
-#include "tree.h"
-#include "rtl.h"
-#include "ch-tree.h"
-#include "flags.h"
-#include "input.h"
-#include "obstack.h"
-#include "lex.h"
-#include "toplev.h"
-
-/* set non-zero if input text is forced to lowercase */
-extern int ignore_case;
-
-/* set non-zero if special words are to be entered in uppercase */
-extern int special_UC;
-
-/* timing modes */
-tree abs_timing_type_node;
-tree duration_timing_type_node;
-
-/* rts time type */
-static tree rtstime_type_node = NULL_TREE;
-
-/* the stack for AFTER primval [ DELAY ] IN
- and has following layout
-
- TREE_VALUE (TREE_VALUE (after_stack)) = current time or NULL_TREE (if DELAY specified)
- TREE_PURPOSE (TREE_VALUE (after_stack)) = the duration location
- TREE_VALUE (TREE_PURPOSE (after_stack)) = label at TIMEOUT
- TREE_PURPOSE (TREE_PURPOSE (after_stack)) = label at the end of AFTER action
-*/
-tree after_stack = NULL_TREE;
-
-/* in pass 1 we need a separate list for the labels */
-static tree after_stack_pass_1 = NULL_TREE;
-static tree after_help;
-
-void
-timing_init ()
-{
- tree ptr_ftype_durt_ptr_int;
- tree int_ftype_abst_ptr_int;
- tree void_ftype_ptr;
- tree long_ftype_int_int_int_int_int_int_int_ptr_int;
- tree void_ftype_abstime_ptr;
- tree int_ftype_ptr_durt_ptr;
- tree void_ftype_durt_ptr;
- tree void_ftype_ptr_durt_ptr_int;
- tree temp;
- tree endlink;
- tree ulong_type;
-
- ulong_type = TREE_TYPE (lookup_name (
- get_identifier ((ignore_case || ! special_UC ) ?
- "ulong" : "ULONG")));
-
- /* build modes for TIME and DURATION */
- duration_timing_type_node = make_unsigned_type (LONG_TYPE_SIZE);
- temp = pushdecl (build_decl (TYPE_DECL, ridpointers[(int)RID_DURATION],
- duration_timing_type_node));
- SET_CH_NOVELTY_NONNIL (duration_timing_type_node, temp);
- abs_timing_type_node = make_unsigned_type (LONG_TYPE_SIZE);
- temp = pushdecl (build_decl (TYPE_DECL, ridpointers[(int)RID_TIME],
- abs_timing_type_node));
- SET_CH_NOVELTY_NONNIL (abs_timing_type_node, temp);
-
- /* the mode of time the runtimesystem returns */
- if (rtstime_type_node == NULL_TREE)
- {
- tree decl1, decl2, result;
-
- decl1 = build_decl (FIELD_DECL,
- get_identifier ("secs"),
- ulong_type);
- DECL_INITIAL (decl1) = NULL_TREE;
- decl2 = build_decl (FIELD_DECL,
- get_identifier ("nsecs"),
- ulong_type);
- DECL_INITIAL (decl2) = NULL_TREE;
- TREE_CHAIN (decl2) = NULL_TREE;
- TREE_CHAIN (decl1) = decl2;
-
- result = build_chill_struct_type (decl1);
- pushdecl (temp = build_decl (TYPE_DECL,
- get_identifier ("__tmp_rtstime"), result));
- DECL_SOURCE_LINE (temp) = 0;
- satisfy_decl (temp, 0);
- rtstime_type_node = TREE_TYPE (temp);
- }
-
- endlink = void_list_node;
-
- ptr_ftype_durt_ptr_int
- = build_function_type (ptr_type_node,
- tree_cons (NULL_TREE, duration_timing_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- endlink))));
-
- int_ftype_abst_ptr_int
- = build_function_type (integer_type_node,
- tree_cons (NULL_TREE, abs_timing_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- endlink))));
-
- void_ftype_ptr
- = build_function_type (void_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- endlink));
-
- long_ftype_int_int_int_int_int_int_int_ptr_int
- = build_function_type (abs_timing_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- endlink))))))))));
-
- void_ftype_abstime_ptr
- = build_function_type (void_type_node,
- tree_cons (NULL_TREE, abs_timing_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- endlink)));
-
- int_ftype_ptr_durt_ptr
- = build_function_type (integer_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, duration_timing_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- endlink))));
-
- void_ftype_durt_ptr
- = build_function_type (void_type_node,
- tree_cons (NULL_TREE, duration_timing_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- endlink)));
-
- void_ftype_ptr_durt_ptr_int
- = build_function_type (void_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, duration_timing_type_node,
- tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, integer_type_node,
- endlink)))));
-
- builtin_function ("_abstime", long_ftype_int_int_int_int_int_int_int_ptr_int,
- 0, NOT_BUILT_IN, NULL_PTR);
- builtin_function ("__check_cycle", void_ftype_ptr_durt_ptr_int,
- 0, NOT_BUILT_IN, NULL_PTR);
- builtin_function ("__convert_duration_rtstime", void_ftype_durt_ptr,
- 0, NOT_BUILT_IN, NULL_PTR);
- builtin_function ("__define_timeout", ptr_ftype_durt_ptr_int,
- 0, NOT_BUILT_IN, NULL_PTR);
- builtin_function ("_inttime", void_ftype_abstime_ptr,
- 0, NOT_BUILT_IN, NULL_PTR);
- builtin_function ("__remaintime", int_ftype_ptr_durt_ptr,
- 0, NOT_BUILT_IN, NULL_PTR);
- builtin_function ("__rtstime", void_ftype_ptr,
- 0, NOT_BUILT_IN, NULL_PTR);
- builtin_function ("__wait_until", int_ftype_abst_ptr_int,
- 0, NOT_BUILT_IN, NULL_PTR);
-}
-
-#if 0
- *
- * build AT action
- *
- * AT primval IN
- * ok-actionlist
- * TIMEOUT
- * to-actionlist
- * END;
- *
- * gets translated to
- *
- * if (__wait_until (primval) == 0)
- * ok-actionlist
- * else
- * to-action-list
- *
-#endif
-
-void
-build_at_action (t)
- tree t;
-{
- tree abstime, expr, filename, fcall;
-
- if (t == NULL_TREE || TREE_CODE (t) == ERROR_MARK)
- abstime = convert (abs_timing_type_node, build_int_2 (0, 0));
- else
- abstime = t;
-
- if (TREE_TYPE (abstime) != abs_timing_type_node)
- {
- error ("absolute time value must be of mode TIME.");
- abstime = convert (abs_timing_type_node, build_int_2 (0, 0));
- }
- filename = force_addr_of (get_chill_filename ());
- fcall = build_chill_function_call (
- lookup_name (get_identifier ("__wait_until")),
- tree_cons (NULL_TREE, abstime,
- tree_cons (NULL_TREE, filename,
- tree_cons (NULL_TREE, get_chill_linenumber (), NULL_TREE))));
- expr = build (EQ_EXPR, integer_type_node, fcall, integer_zero_node);
- expand_start_cond (expr, 0);
- emit_line_note (input_filename, lineno);
-}
-
-#if 0
- *
- * build CYCLE action
- *
- * CYCLE primval IN
- * actionlist
- * END;
- *
- * gets translated to
- *
- * {
- * RtsTime now;
- * label:
- * __rtstime (&now);
- * actionlist
- * __check_cycle (&now, primval, filename, lineno);
- * goto label;
- * }
- *
-#endif
-
-tree
-build_cycle_start (t)
- tree t;
-{
- tree purpose = build_tree_list (NULL_TREE, NULL_TREE);
- tree toid = build_tree_list (purpose, NULL_TREE);
-
- /* define the label. Note: define_label needs to be called in
- pass 1 and pass 2. */
- TREE_VALUE (toid) = define_label (input_filename, lineno,
- get_unique_identifier ("CYCLE_label"));
- if (! ignoring)
- {
- tree duration_value, now_location;
-
- if (t == NULL_TREE || TREE_CODE (t) == ERROR_MARK)
- duration_value = convert (duration_timing_type_node, build_int_2 (0,0));
- else
- duration_value = t;
-
- if (TREE_TYPE (duration_value) != duration_timing_type_node)
- {
- error ("duration primitive value must be of mode DURATION.");
- duration_value = convert (duration_timing_type_node, build_int_2 (0,0));
- }
- TREE_PURPOSE (TREE_PURPOSE (toid)) = duration_value;
- /* define the variable */
- now_location = decl_temp1 (get_unique_identifier ("CYCLE_var"),
- rtstime_type_node, 0,
- NULL_TREE, 0, 0);
- TREE_VALUE (TREE_PURPOSE (toid)) = force_addr_of (now_location);
-
- /* build the call to __rtstime */
- expand_expr_stmt (
- build_chill_function_call (lookup_name (get_identifier ("__rtstime")),
- build_tree_list (NULL_TREE, TREE_VALUE (TREE_PURPOSE (toid)))));
- }
-
- return toid;
-}
-
-void
-build_cycle_end (toid)
- tree toid;
-{
- tree filename, linenumber;
-
- /* here we call __check_cycle and then jump to beginning of this
- action */
- filename = force_addr_of (get_chill_filename ());
- linenumber = get_chill_linenumber ();
- expand_expr_stmt (
- build_chill_function_call (
- lookup_name (get_identifier ("__check_cycle")),
- tree_cons (NULL_TREE, TREE_VALUE (TREE_PURPOSE (toid)),
- tree_cons (NULL_TREE, TREE_PURPOSE (TREE_PURPOSE (toid)),
- tree_cons (NULL_TREE, filename,
- tree_cons (NULL_TREE, linenumber, NULL_TREE))))));
- expand_goto (TREE_VALUE (toid));
-}
-
-#if 0
- *
- * build AFTER ACTION
- *
- * AFTER primval [ DELAY ] IN
- * action-list
- * TIMEOUT
- * to-action-list
- * END
- *
- * gets translated to
- *
- * {
- * struct chill_time __now;
- * duration dur = primval;
- * if (! delay_spceified)
- * __rts_time (&__now);
- * .
- * .
- * goto end-label;
- * to-label:
- * .
- * .
- * end-label:
- * }
- *
-#endif
-
-void
-build_after_start (duration, delay_flag)
- tree duration;
- int delay_flag;
-{
- tree value, purpose;
-
- if (! ignoring)
- {
- value = tree_cons (NULL_TREE, NULL_TREE, NULL_TREE);
- purpose = after_stack_pass_1;
- after_stack_pass_1 = TREE_CHAIN (after_stack_pass_1);
- after_stack = tree_cons (purpose, value, after_stack);
-
- if (TREE_TYPE (duration) != duration_timing_type_node)
- {
- error ("duration primitive value must be of mode DURATION.");
- duration = convert (duration_timing_type_node, build_int_2 (0,0));
- }
- TREE_PURPOSE (value) = decl_temp1 (get_identifier ("AFTER_duration"),
- duration_timing_type_node, 0,
- duration, 0, 0);
-
- if (! delay_flag)
- {
- /* in this case we have to get the current time */
- TREE_VALUE (value) = decl_temp1 (get_unique_identifier ("AFTER_now"),
- rtstime_type_node, 0,
- NULL_TREE, 0, 0);
- /* build the function call to initialize the variable */
- expand_expr_stmt (
- build_chill_function_call (lookup_name (get_identifier ("__rtstime")),
- build_tree_list (NULL_TREE, force_addr_of (TREE_VALUE (value)))));
- }
- }
- else
- {
- /* in pass 1 we just save the labels */
- after_help = tree_cons (NULL_TREE, NULL_TREE, after_help);
- after_stack_pass_1 = chainon (after_stack_pass_1, after_help);
- }
-}
-
-void
-build_after_timeout_start ()
-{
- tree label_name;
-
- if (! ignoring)
- {
- /* jump to the end of AFTER action */
- lookup_and_expand_goto (TREE_PURPOSE (TREE_PURPOSE (after_stack)));
- label_name = TREE_VALUE (TREE_PURPOSE (after_stack));
- /* mark we are in TIMEOUT part of AFTER action */
- TREE_VALUE (TREE_PURPOSE (after_stack)) = NULL_TREE;
- }
- else
- {
- label_name = get_unique_identifier ("AFTER_tolabel");
- TREE_VALUE (after_help) = label_name;
- }
- define_label (input_filename, lineno, label_name);
-}
-
-void
-build_after_end ()
-{
- tree label_name;
-
- /* define the end label */
- if (! ignoring)
- {
- label_name = TREE_PURPOSE (TREE_PURPOSE (after_stack));
- after_stack = TREE_CHAIN (after_stack);
- }
- else
- {
- label_name = get_unique_identifier ("AFTER_endlabel");
- TREE_PURPOSE (after_help) = label_name;
- after_help = TREE_CHAIN (after_help);
- }
- define_label (input_filename, lineno, label_name);
-}
-
-tree
-build_timeout_preface ()
-{
- tree timeout_value = null_pointer_node;
-
- if (after_stack != NULL_TREE &&
- TREE_VALUE (TREE_PURPOSE (after_stack)) != NULL_TREE)
- {
- tree to_loc;
-
- to_loc = decl_temp1 (get_unique_identifier ("TOloc"),
- rtstime_type_node, 0, NULL_TREE, 0, 0);
- timeout_value = force_addr_of (to_loc);
-
- if (TREE_VALUE (TREE_VALUE (after_stack)) == NULL_TREE)
- {
- /* DELAY specified -- just call __convert_duration_rtstime for
- given duration value */
- expand_expr_stmt (
- build_chill_function_call (
- lookup_name (get_identifier ("__convert_duration_rtstime")),
- tree_cons (NULL_TREE, TREE_PURPOSE (TREE_VALUE (after_stack)),
- tree_cons (NULL_TREE, timeout_value, NULL_TREE))));
- }
- else
- {
- /* delay not specified -- call __remaintime which returns the
- remaining time of duration in rtstime format and check the
- result */
- tree fcall =
- build_chill_function_call (
- lookup_name (get_identifier ("__remaintime")),
- tree_cons (NULL_TREE, force_addr_of (TREE_VALUE (TREE_VALUE (after_stack))),
- tree_cons (NULL_TREE, TREE_PURPOSE (TREE_VALUE (after_stack)),
- tree_cons (NULL_TREE, timeout_value, NULL_TREE))));
- tree expr = build (NE_EXPR, integer_type_node,
- fcall, integer_zero_node);
- expand_start_cond (expr, 0);
- lookup_and_expand_goto (TREE_VALUE (TREE_PURPOSE (after_stack)));
- expand_end_cond ();
- }
- }
- return timeout_value;
-}
-
-void
-build_timesupervised_call (fcall, to_loc)
- tree fcall;
- tree to_loc;
-{
- if (to_loc == null_pointer_node)
- expand_expr_stmt (fcall);
- else
- {
- tree expr = build (NE_EXPR, integer_type_node, fcall, integer_zero_node);
- expand_start_cond (expr, 0);
- lookup_and_expand_goto (TREE_VALUE (TREE_PURPOSE (after_stack)));
- expand_end_cond ();
- }
-}
diff --git a/gcc/ch/tree.c b/gcc/ch/tree.c
deleted file mode 100644
index 53485dbc2eb..00000000000
--- a/gcc/ch/tree.c
+++ /dev/null
@@ -1,298 +0,0 @@
-/* Language-dependent node constructors for parse phase of GNU compiler.
- Copyright (C) 1992, 1993, 1994, 1998, 1999, 2000
- Free Software Foundation, Inc.
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-#include "config.h"
-#include "system.h"
-#include "obstack.h"
-#include "tree.h"
-#include "ch-tree.h"
-#include "toplev.h"
-
-/* Here is how primitive or already-canonicalized types'
- hash codes are made. */
-#define TYPE_HASH(TYPE) ((HOST_WIDE_INT) (TYPE) & 0777777)
-
-extern struct obstack permanent_obstack;
-/* This is special sentinel used to communicate from build_string_type
- to layout_chill_range_type for the index range of a string. */
-tree string_index_type_dummy;
-
-static tree make_powerset_type PARAMS ((tree));
-
-/* Build a chill string type.
- For a character string, ELT_TYPE==char_type_node;
- for a bit-string, ELT_TYPE==boolean_type_node. */
-
-tree
-build_string_type (elt_type, length)
- tree elt_type;
- tree length;
-{
- register tree t;
-
- if (TREE_CODE (elt_type) == ERROR_MARK || TREE_CODE (length) == ERROR_MARK)
- return error_mark_node;
-
- /* Allocate the array after the pointer type,
- in case we free it in type_hash_canon. */
-
- if (pass > 0 && TREE_CODE (length) == INTEGER_CST
- && ! tree_int_cst_equal (length, integer_zero_node)
- && compare_int_csts (LT_EXPR, TYPE_MAX_VALUE (chill_unsigned_type_node),
- length))
- {
- error ("string length > UPPER (UINT)");
- length = integer_one_node;
- }
-
- /* Subtract 1 from length to get max index value.
- Note we cannot use size_binop for pass 1 expressions. */
- if (TREE_CODE (length) == INTEGER_CST || pass != 1)
- length = size_binop (MINUS_EXPR, length, size_one_node);
- else
- length = build (MINUS_EXPR, sizetype, length, size_one_node);
-
- t = make_node (elt_type == boolean_type_node ? SET_TYPE : ARRAY_TYPE);
- TREE_TYPE (t) = elt_type;
-
- MARK_AS_STRING_TYPE (t);
-
- TYPE_DOMAIN (t) = build_chill_range_type (string_index_type_dummy,
- integer_zero_node, length);
- if (pass == 1 && TREE_CODE (length) == INTEGER_CST)
- TYPE_DOMAIN (t) = layout_chill_range_type (TYPE_DOMAIN (t), 0);
-
- if (pass != 1
- || (TREE_CODE (length) == INTEGER_CST && TYPE_SIZE (elt_type)))
- {
- if (TREE_CODE (t) == SET_TYPE)
- t = layout_powerset_type (t);
- else
- t = layout_chill_array_type (t);
- }
- return t;
-}
-
-static tree
-make_powerset_type (domain)
- tree domain;
-{
- tree t = make_node (SET_TYPE);
-
- TREE_TYPE (t) = boolean_type_node;
- TYPE_DOMAIN (t) = domain;
-
- return t;
-}
-
-/* Used to layout both bitstring and powerset types. */
-
-tree
-layout_powerset_type (type)
- tree type;
-{
- tree domain = TYPE_DOMAIN (type);
-
- if (! discrete_type_p (domain))
- {
- error ("Can only build a powerset from a discrete mode");
- return error_mark_node;
- }
-
- if (TREE_CODE (TYPE_MAX_VALUE (domain)) == ERROR_MARK ||
- TREE_CODE (TYPE_MIN_VALUE (domain)) == ERROR_MARK)
- return error_mark_node;
-
- if (TREE_CODE (TYPE_MAX_VALUE (domain)) != INTEGER_CST
- || TREE_CODE (TYPE_MIN_VALUE (domain)) != INTEGER_CST)
- {
- if (CH_BOOLS_TYPE_P (type))
- error ("non-constant bitstring size invalid");
- else
- error ("non-constant powerset size invalid");
- return error_mark_node;
- }
-
- if (TYPE_SIZE (type) == 0)
- layout_type (type);
- return type;
-}
-
-/* Build a SET_TYPE node whose elements are from the set of values
- in TYPE. TYPE must be a discrete mode; we check for that here. */
-tree
-build_powerset_type (type)
- tree type;
-{
- tree t = make_powerset_type (type);
- if (pass != 1)
- t = layout_powerset_type (t);
- return t;
-}
-
-tree
-build_bitstring_type (size_in_bits)
- tree size_in_bits;
-{
- return build_string_type (boolean_type_node, size_in_bits);
-}
-
-/* Return get_identifier (the concatenations of part1, part2, and part3). */
-
-tree
-get_identifier3 (part1, part2, part3)
- const char *part1, *part2, *part3;
-{
- char *buf = (char*)
- alloca (strlen(part1) + strlen(part2) + strlen(part3) + 1);
- sprintf (buf, "%s%s%s", part1, part2, part3);
- return get_identifier (buf);
-}
-
-/* Build an ALIAS_DECL for the prefix renamed clause:
- (OLD_PREFIX -> NEW_PREFIX) ! POSTFIX. */
-
-tree
-build_alias_decl (old_prefix, new_prefix, postfix)
- tree old_prefix, new_prefix, postfix;
-{
- tree decl = make_node (ALIAS_DECL);
-
- const char *postfix_pointer = IDENTIFIER_POINTER (postfix);
- int postfix_length = IDENTIFIER_LENGTH (postfix);
- int old_length = old_prefix ? IDENTIFIER_LENGTH(old_prefix) : 0;
- int new_length = new_prefix ? IDENTIFIER_LENGTH(new_prefix) : 0;
-
- char *buf = (char*) alloca (old_length + new_length + postfix_length + 3);
-
- /* Convert (OP->NP)!P!ALL to (OP!P->NP!P)!ALL */
- if (postfix_length > 1 && postfix_pointer[postfix_length-1] == '*')
- {
- int chopped_length = postfix_length - 2; /* Without final "!*" */
- if (old_prefix)
- sprintf (buf, "%s!%.*s", IDENTIFIER_POINTER (old_prefix),
- chopped_length, postfix_pointer);
- else
- sprintf (buf, "%.*s", chopped_length, postfix_pointer);
- old_prefix = get_identifier (buf);
- if (new_prefix)
- sprintf (buf, "%s!%.*s", IDENTIFIER_POINTER (new_prefix),
- chopped_length, postfix_pointer);
- else
- sprintf (buf, "%.*s", chopped_length, postfix_pointer);
- new_prefix = get_identifier (buf);
- postfix = ALL_POSTFIX;
- }
-
- DECL_OLD_PREFIX (decl) = old_prefix;
- DECL_NEW_PREFIX (decl) = new_prefix;
- DECL_POSTFIX (decl) = postfix;
-
- if (DECL_POSTFIX_ALL (decl))
- DECL_NAME (decl) = NULL_TREE;
- else if (new_prefix == NULL_TREE)
- DECL_NAME (decl) = postfix;
- else
- DECL_NAME (decl) = get_identifier3 (IDENTIFIER_POINTER (new_prefix),
- "!", IDENTIFIER_POINTER (postfix));
-
- return decl;
-}
-
-/* Return the "old name string" of an ALIAS_DECL. */
-
-tree
-decl_old_name (decl)
- tree decl;
-{
-
- if (DECL_OLD_PREFIX (decl) == NULL_TREE)
- return DECL_POSTFIX (decl);
- return get_identifier3 (IDENTIFIER_POINTER (DECL_OLD_PREFIX (decl)),
- "!", IDENTIFIER_POINTER (DECL_POSTFIX (decl)));
-}
-
-/* See if OLD_NAME (an identifier) matches the OLD_PREFIX!POSTFIX
- of ALIAS. If so, return the corresponding NEW_NEW!POSTFIX. */
-
-tree
-decl_check_rename (alias, old_name)
- tree alias, old_name;
-{
- const char *old_pointer = IDENTIFIER_POINTER (old_name);
- int old_len = IDENTIFIER_LENGTH (old_name);
- if (DECL_OLD_PREFIX (alias))
- {
- int old_prefix_len = IDENTIFIER_LENGTH (DECL_OLD_PREFIX (alias));
- if (old_prefix_len >= old_len
- || old_pointer[old_prefix_len] != '!'
- || strncmp (old_pointer, IDENTIFIER_POINTER (DECL_OLD_PREFIX (alias)), old_prefix_len) != 0)
- return NULL_TREE;
-
- /* Skip the old prefix. */
- old_pointer += old_prefix_len + 1; /* Also skip the '!', */
- }
- if (DECL_POSTFIX_ALL (alias)
- || strcmp (IDENTIFIER_POINTER (DECL_POSTFIX (alias)), old_pointer) == 0)
- {
- if (DECL_NEW_PREFIX (alias))
- return get_identifier3 (IDENTIFIER_POINTER (DECL_NEW_PREFIX (alias)),
- "!", old_pointer);
- else if (old_pointer == IDENTIFIER_POINTER (old_name))
- return old_name;
- else
- return get_identifier (old_pointer);
- }
- else
- return NULL_TREE;
-}
-
-/* 'EXIT foo' is treated like 'GOTO EXIT!foo'.
- This function converts LABEL into a labal name for EXIT. */
-
-tree
-munge_exit_label (label)
- tree label;
-{
- return get_identifier3 ("EXIT", "!", IDENTIFIER_POINTER (label));
-}
-
-/* Make SAVE_EXPRs as needed, but don't turn a location into a non-location. */
-
-tree
-save_if_needed (exp)
-tree exp;
-{
- return CH_REFERABLE (exp) ? stabilize_reference (exp) : save_expr (exp);
-}
-
-/* Return the number of elements in T, which must be a discrete type. */
-tree
-discrete_count (t)
- tree t;
-{
- tree hi = convert (sizetype, TYPE_MAX_VALUE (t));
-
- if (TYPE_MIN_VALUE (t))
- hi = size_binop (MINUS_EXPR, hi, convert (sizetype, TYPE_MIN_VALUE (t)));
-
- return size_binop (PLUS_EXPR, hi, integer_one_node);
-}
diff --git a/gcc/ch/typeck.c b/gcc/ch/typeck.c
deleted file mode 100644
index ef4a2e3bae6..00000000000
--- a/gcc/ch/typeck.c
+++ /dev/null
@@ -1,3825 +0,0 @@
-/* Build expressions with type checking for CHILL compiler.
- Copyright (C) 1992, 1993, 1994, 1998, 1999, 2000
- Free Software Foundation, Inc.
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-
-/* This file is part of the CHILL front end.
- It contains routines to build C expressions given their operands,
- including computing the modes of the result, C-specific error checks,
- and some optimization.
-
- There are also routines to build RETURN_STMT nodes and CASE_STMT nodes,
- and to process initializations in declarations (since they work
- like a strange sort of assignment). */
-
-#include "config.h"
-#include "system.h"
-#include "tree.h"
-#include "ch-tree.h"
-#include "flags.h"
-#include "rtl.h"
-#include "expr.h"
-#include "lex.h"
-#include "toplev.h"
-#include "output.h"
-
-/* forward declarations */
-static int chill_l_equivalent PARAMS ((tree, tree, struct mode_chain*));
-static tree extract_constant_from_buffer PARAMS ((tree, const unsigned char *, int));
-static int expand_constant_to_buffer PARAMS ((tree, unsigned char *, int));
-static tree build_empty_string PARAMS ((tree));
-static tree make_chill_pointer_type PARAMS ((tree, enum tree_code));
-static unsigned int min_precision PARAMS ((tree, int));
-static tree make_chill_range_type PARAMS ((tree, tree, tree));
-static void apply_chill_array_layout PARAMS ((tree));
-static int field_decl_cmp PARAMS ((tree *, tree*));
-static tree make_chill_struct_type PARAMS ((tree));
-static int apply_chill_field_layout PARAMS ((tree, int *));
-
-/*
- * This function checks an array access.
- * It calls error (ERROR_MESSAGE) if the condition (index <= domain max value
- * index >= domain min value)
- * is not met at compile time,
- * If a runtime test is required and permitted,
- * check_expression is used to do so.
- * the global RANGE_CHECKING flags controls the
- * generation of runtime checking code.
- */
-tree
-valid_array_index_p (array, idx, error_message, is_varying_lhs)
- tree array, idx;
- const char *error_message;
- int is_varying_lhs;
-{
- tree cond, low_limit, high_cond, atype, domain;
- tree orig_index = idx;
- enum chill_tree_code condition;
-
- if (array == NULL_TREE || TREE_CODE (array) == ERROR_MARK
- || idx == NULL_TREE || TREE_CODE (idx) == ERROR_MARK)
- return error_mark_node;
-
- if (TREE_CODE (idx) == TYPE_DECL
- || TREE_CODE_CLASS (TREE_CODE (idx)) == 't')
- {
- error ("array or string index is a mode (instead of a value)");
- return error_mark_node;
- }
-
- atype = TREE_TYPE (array);
-
- if (chill_varying_type_p (atype))
- {
- domain = TYPE_DOMAIN (CH_VARYING_ARRAY_TYPE (atype));
- high_cond = build_component_ref (array, var_length_id);
- if (chill_varying_string_type_p (atype))
- {
- if (is_varying_lhs)
- condition = GT_EXPR;
- else
- condition = GE_EXPR;
- }
- else
- condition = GT_EXPR;
- }
- else
- {
- domain = TYPE_DOMAIN (atype);
- high_cond = TYPE_MAX_VALUE (domain);
- condition = GT_EXPR;
- }
-
- if (CH_STRING_TYPE_P (atype))
- {
- if (! CH_SIMILAR (TREE_TYPE (orig_index), integer_type_node))
- {
- error ("index is not an integer expression");
- return error_mark_node;
- }
- }
- else
- {
- if (! CH_COMPATIBLE (orig_index, domain))
- {
- error ("index not compatible with index mode");
- return error_mark_node;
- }
- }
-
- /* Convert BOOLS(1) to BOOL and CHARS(1) to CHAR. */
- if (flag_old_strings)
- {
- idx = convert_to_discrete (idx);
- if (idx == NULL) /* should never happen */
- error ("index is not discrete");
- }
-
- /* we know we'll refer to this value twice */
- if (range_checking)
- idx = save_expr (idx);
-
- low_limit = TYPE_MIN_VALUE (domain);
- high_cond = build_compare_discrete_expr (condition, idx, high_cond);
-
- /* an invalid index expression meets this condition */
- cond = fold (build (TRUTH_ORIF_EXPR, boolean_type_node,
- build_compare_discrete_expr (LT_EXPR, idx, low_limit),
- high_cond));
-
- /* strip a redundant NOP_EXPR */
- if (TREE_CODE (cond) == NOP_EXPR
- && TREE_TYPE (cond) == boolean_type_node
- && TREE_CODE (TREE_OPERAND (cond, 0)) == INTEGER_CST)
- cond = TREE_OPERAND (cond, 0);
-
- idx = convert (CH_STRING_TYPE_P (atype) ? integer_type_node : domain,
- idx);
-
- if (TREE_CODE (cond) == INTEGER_CST)
- {
- if (tree_int_cst_equal (cond, boolean_false_node))
- return idx; /* condition met at compile time */
- error ("%s", error_message); /* condition failed at compile time */
- return error_mark_node;
- }
- else if (range_checking)
- {
- /* FIXME: often, several of these conditions will
- be generated for the same source file and line number.
- A great optimization would be to share the
- cause_exception function call among them rather
- than generating a cause_exception call for each. */
- return check_expression (idx, cond,
- ridpointers[(int) RID_RANGEFAIL]);
- }
- else
- return idx; /* don't know at compile time */
-}
-
-/*
- * Extract a slice from an array, which could look like a
- * SET_TYPE if it's a bitstring. The array could also be VARYING
- * if the element type is CHAR. The min_value and length values
- * must have already been checked with valid_array_index_p. No
- * checking is done here.
- */
-tree
-build_chill_slice (array, min_value, length)
- tree array, min_value, length;
-{
- tree result;
- tree array_type = TREE_TYPE (array);
-
- if (!CH_REFERABLE (array) && TREE_CODE (array) != SAVE_EXPR
- && (TREE_CODE (array) != COMPONENT_REF
- || TREE_CODE (TREE_OPERAND (array, 0)) != SAVE_EXPR))
- {
- if (!TREE_CONSTANT (array))
- warning ("possible internal error - slice argument is neither referable nor constant");
- else
- {
- /* Force to storage.
- NOTE: This could mean multiple identical copies of
- the same constant. FIXME. */
- tree mydecl = decl_temp1 (get_unique_identifier("SLICEE"),
- array_type, 1, array, 0, 0);
- TREE_READONLY (mydecl) = 1;
- /* mark_addressable (mydecl); FIXME: necessary? */
- array = mydecl;
- }
- }
-
- /*
- The code-generation which uses a slice tree needs not only to
- know the dynamic upper and lower limits of that slice, but the
- original static allocation, to use to build temps where one or both
- of the dynamic limits must be calculated at runtime.. We pass the
- dynamic size by building a new array_type whose limits are the
- min_value and min_value + length values passed to us.
-
- The static allocation info is passed by using the parent array's
- limits to compute a temp_size, which is passed in the lang_specific
- field of the slice_type. */
-
- if (TREE_CODE (array_type) == ARRAY_TYPE)
- {
- tree domain_type = TYPE_DOMAIN (array_type);
- tree domain_min = TYPE_MIN_VALUE (domain_type);
- tree domain_max
- = fold (build (PLUS_EXPR, domain_type,
- domain_min,
- fold (build (MINUS_EXPR, integer_type_node,
- length, integer_one_node))));
- tree index_type = build_chill_range_type (TYPE_DOMAIN (array_type),
- domain_min,
- domain_max);
-
- tree element_type = TREE_TYPE (array_type);
- tree slice_type = build_simple_array_type (element_type, index_type, NULL_TREE);
- tree slice_pointer_type;
- tree max_size;
-
- if (CH_CHARS_TYPE_P (array_type))
- MARK_AS_STRING_TYPE (slice_type);
- else
- TYPE_PACKED (slice_type) = TYPE_PACKED (array_type);
-
- SET_CH_NOVELTY (slice_type, CH_NOVELTY (array_type));
-
- if (TREE_CONSTANT (array) && host_integerp (min_value, 0)
- && host_integerp (length, 0))
- {
- unsigned HOST_WIDE_INT type_size = int_size_in_bytes (array_type);
- unsigned char *buffer = (unsigned char *) alloca (type_size);
- int delta = (int_size_in_bytes (element_type)
- * (tree_low_cst (min_value, 0)
- - tree_low_cst (domain_min, 0)));
-
- memset (buffer, 0, type_size);
- if (expand_constant_to_buffer (array, buffer, type_size))
- {
- result = extract_constant_from_buffer (slice_type,
- buffer + delta,
- type_size - delta);
- if (result)
- return result;
- }
- }
-
- /* Kludge used by case CONCAT_EXPR in chill_expand_expr.
- Set TYPE_ARRAY_MAX_SIZE to a constant upper bound on the
- bytes needed. */
- max_size = size_in_bytes (slice_type);
- if (TREE_CODE (max_size) != INTEGER_CST)
- {
- max_size = TYPE_ARRAY_MAX_SIZE (array_type);
- if (max_size == NULL_TREE)
- max_size = size_in_bytes (array_type);
- }
- TYPE_ARRAY_MAX_SIZE (slice_type) = max_size;
-
- mark_addressable (array);
- /* Contruct a SLICE_EXPR to represent a slice of a packed array of bits. */
- if (TYPE_PACKED (array_type))
- {
- if (pass == 2 && TREE_CODE (length) != INTEGER_CST)
- {
- sorry ("bit array slice with non-constant length");
- return error_mark_node;
- }
- if (domain_min && ! integer_zerop (domain_min))
- min_value = size_binop (MINUS_EXPR, min_value,
- convert (sizetype, domain_min));
- result = build (SLICE_EXPR, slice_type, array, min_value, length);
- TREE_READONLY (result)
- = TREE_READONLY (array) | TYPE_READONLY (TREE_TYPE (array_type));
- return result;
- }
-
- slice_pointer_type = build_chill_pointer_type (slice_type);
- if (TREE_CODE (min_value) == INTEGER_CST
- && domain_min && TREE_CODE (domain_min) == INTEGER_CST
- && compare_int_csts (EQ_EXPR, min_value, domain_min))
- result = fold (build1 (ADDR_EXPR, slice_pointer_type, array));
- else
- {
- min_value = convert (sizetype, min_value);
- if (domain_min && ! integer_zerop (domain_min))
- min_value = size_binop (MINUS_EXPR, min_value,
- convert (sizetype, domain_min));
- min_value = size_binop (MULT_EXPR, min_value,
- size_in_bytes (element_type));
- result = fold (build (PLUS_EXPR, slice_pointer_type,
- build1 (ADDR_EXPR, slice_pointer_type,
- array),
- convert (slice_pointer_type, min_value)));
- }
- /* Return the final array value. */
- result = fold (build1 (INDIRECT_REF, slice_type, result));
- TREE_READONLY (result)
- = TREE_READONLY (array) | TYPE_READONLY (element_type);
- return result;
- }
- else if (TREE_CODE (array_type) == SET_TYPE) /* actually a bitstring */
- {
- if (pass == 2 && TREE_CODE (length) != INTEGER_CST)
- {
- sorry ("bitstring slice with non-constant length");
- return error_mark_node;
- }
- result = build (SLICE_EXPR, build_bitstring_type (length),
- array, min_value, length);
- TREE_READONLY (result)
- = TREE_READONLY (array) | TYPE_READONLY (TREE_TYPE (array_type));
- return result;
- }
- else if (chill_varying_type_p (array_type))
- return build_chill_slice (varying_to_slice (array), min_value, length);
- else
- {
- error ("slice operation on non-array, non-bitstring value not supported");
- return error_mark_node;
- }
-}
-
-static tree
-build_empty_string (type)
- tree type;
-{
- int orig_pass = pass;
- tree range, result;
-
- range = build_chill_range_type (type, integer_zero_node,
- integer_minus_one_node);
- result = build_chill_array_type (type,
- tree_cons (NULL_TREE, range, NULL_TREE), 0, NULL_TREE);
- pass = 2;
- range = build_chill_range_type (type, integer_zero_node,
- integer_minus_one_node);
- result = build_chill_array_type (type,
- tree_cons (NULL_TREE, range, NULL_TREE), 0, NULL_TREE);
- pass = orig_pass;
-
- return decl_temp1 (get_unique_identifier ("EMPTY_STRING"),
- result, 0, NULL_TREE, 0, 0);
-}
-
-/* We build the runtime range-checking as a separate list
- * rather than making a compound_expr with min_value
- * (for example), to control when that comparison gets
- * generated. We cannot allow it in a TYPE_MAX_VALUE or
- * TYPE_MIN_VALUE expression, for instance, because that code
- * will get generated when the slice is laid out, which would
- * put it outside the scope of an exception handler for the
- * statement we're generating. I.e. we would be generating
- * cause_exception calls which might execute before the
- * necessary ch_link_handler call.
- */
-tree
-build_chill_slice_with_range (array, min_value, max_value)
- tree array, min_value, max_value;
-{
- if (array == NULL_TREE || TREE_CODE (array) == ERROR_MARK
- || min_value == NULL_TREE || TREE_CODE(min_value) == ERROR_MARK
- || max_value == NULL_TREE || TREE_CODE(max_value) == ERROR_MARK)
- return error_mark_node;
-
- if (TREE_TYPE (array) == NULL_TREE
- || (TREE_CODE (TREE_TYPE (array)) != ARRAY_TYPE
- && TREE_CODE (TREE_TYPE (array)) != SET_TYPE
- && !chill_varying_type_p (TREE_TYPE (array))))
- {
- error ("can only take slice of array or string");
- return error_mark_node;
- }
-
- array = save_if_needed (array);
-
- /* FIXME: test here for max_value >= min_value, except
- for max_value == -1, min_value == 0 (empty string) */
- min_value = valid_array_index_p (array, min_value,
- "slice lower limit out-of-range", 0);
- if (TREE_CODE (min_value) == ERROR_MARK)
- return min_value;
-
- /* FIXME: suppress this test if max_value is the LENGTH of a
- varying array, which has presumably already been checked. */
- max_value = valid_array_index_p (array, max_value,
- "slice upper limit out-of-range", 0);
- if (TREE_CODE (max_value) == ERROR_MARK)
- return error_mark_node;
-
- if (TREE_CODE (min_value) == INTEGER_CST
- && TREE_CODE (max_value) == INTEGER_CST
- && tree_int_cst_lt (max_value, min_value))
- return build_empty_string (TREE_TYPE (TREE_TYPE (array)));
-
- return
- build_chill_slice
- (array, min_value,
- save_expr (fold (build (PLUS_EXPR, integer_type_node,
- fold (build (MINUS_EXPR, integer_type_node,
- max_value, min_value)),
- integer_one_node))));
-}
-
-tree
-build_chill_slice_with_length (array, min_value, length)
- tree array, min_value, length;
-{
- tree max_index;
- tree cond, high_cond, atype;
-
- if (array == NULL_TREE || TREE_CODE (array) == ERROR_MARK
- || min_value == NULL_TREE || TREE_CODE(min_value) == ERROR_MARK
- || length == NULL_TREE || TREE_CODE(length) == ERROR_MARK)
- return error_mark_node;
-
- if (TREE_TYPE (array) == NULL_TREE
- || (TREE_CODE (TREE_TYPE (array)) != ARRAY_TYPE
- && TREE_CODE (TREE_TYPE (array)) != SET_TYPE
- && !chill_varying_type_p (TREE_TYPE (array))))
- {
- error ("can only take slice of array or string");
- return error_mark_node;
- }
-
- if (TREE_CONSTANT (length)
- && tree_int_cst_lt (length, integer_zero_node))
- return build_empty_string (TREE_TYPE (TREE_TYPE (array)));
-
- array = save_if_needed (array);
- min_value = save_expr (min_value);
- length = save_expr (length);
-
- if (! CH_SIMILAR (TREE_TYPE (length), integer_type_node))
- {
- error ("slice length is not an integer");
- length = integer_one_node;
- }
-
- max_index = fold (build (MINUS_EXPR, integer_type_node,
- fold (build (PLUS_EXPR, integer_type_node,
- length, min_value)),
- integer_one_node));
- max_index = convert_to_class (chill_expr_class (min_value), max_index);
-
- min_value = valid_array_index_p (array, min_value,
- "slice start index out-of-range", 0);
- if (TREE_CODE (min_value) == ERROR_MARK)
- return error_mark_node;
-
- atype = TREE_TYPE (array);
-
- if (chill_varying_type_p (atype))
- high_cond = build_component_ref (array, var_length_id);
- else
- high_cond = TYPE_MAX_VALUE (TYPE_DOMAIN (atype));
-
- /* an invalid index expression meets this condition */
- cond = fold (build (TRUTH_ORIF_EXPR, boolean_type_node,
- build_compare_discrete_expr (LT_EXPR,
- length, integer_zero_node),
- build_compare_discrete_expr (GT_EXPR,
- max_index, high_cond)));
-
- if (TREE_CODE (cond) == INTEGER_CST)
- {
- if (! tree_int_cst_equal (cond, boolean_false_node))
- {
- error ("slice length out-of-range");
- return error_mark_node;
- }
-
- }
- else if (range_checking)
- {
- min_value = check_expression (min_value, cond,
- ridpointers[(int) RID_RANGEFAIL]);
- }
-
- return build_chill_slice (array, min_value, length);
-}
-
-tree
-build_chill_array_ref (array, indexlist)
- tree array, indexlist;
-{
- tree idx;
-
- if (array == NULL_TREE || TREE_CODE (array) == ERROR_MARK)
- return error_mark_node;
- if (indexlist == NULL_TREE || TREE_CODE (indexlist) == ERROR_MARK)
- return error_mark_node;
-
- idx = TREE_VALUE (indexlist); /* handle first index */
-
- idx = valid_array_index_p (array, idx,
- "array index out-of-range", 0);
- if (TREE_CODE (idx) == ERROR_MARK)
- return error_mark_node;
-
- array = build_chill_array_ref_1 (array, idx);
-
- if (array && TREE_CODE (array) != ERROR_MARK
- && TREE_CHAIN (indexlist))
- {
- /* Z.200 (1988) section 4.2.8 says that:
- <array> '(' <expression {',' <expression> }* ')'
- is derived syntax (i.e. syntactic sugar) for:
- <array> '(' <expression ')' { '(' <expression> ')' }*
- The intent is clear if <array> has mode: ARRAY (...) ARRAY (...) XXX.
- But what if <array> has mode: ARRAY (...) CHARS (N)
- or: ARRAY (...) BOOLS (N).
- Z.200 doesn't explicitly prohibit it, but the intent is unclear.
- We'll allow it, since it seems reasonable and useful.
- However, we won't allow it if <array> is:
- ARRAY (...) PROC (...).
- (The latter would make sense if we allowed general
- Currying, which Chill doesn't.) */
- if (TREE_CODE (TREE_TYPE (array)) == ARRAY_TYPE
- || chill_varying_type_p (TREE_TYPE (array))
- || CH_BOOLS_TYPE_P (TREE_TYPE (array)))
- array = build_generalized_call (array, TREE_CHAIN (indexlist));
- else
- error ("too many index expressions");
- }
- return array;
-}
-
-/*
- * Don't error check the index in here. It's supposed to be
- * checked by the caller.
- */
-tree
-build_chill_array_ref_1 (array, idx)
- tree array, idx;
-{
- tree type;
- tree domain;
- tree rval;
-
- if (array == NULL_TREE || TREE_CODE (array) == ERROR_MARK
- || idx == NULL_TREE || TREE_CODE (idx) == ERROR_MARK)
- return error_mark_node;
-
- if (chill_varying_type_p (TREE_TYPE (array)))
- array = varying_to_slice (array);
-
- domain = TYPE_DOMAIN (TREE_TYPE (array));
-
-#if 0
- if (! integer_zerop (TYPE_MIN_VALUE (domain)))
- {
- /* The C part of the compiler doesn't understand how to do
- arithmetic with dissimilar enum types. So we check compatability
- here, and perform the math in INTEGER_TYPE. */
- if (TREE_CODE (TREE_TYPE (idx)) == ENUMERAL_TYPE
- && chill_comptypes (TREE_TYPE (idx), domain, 0))
- idx = convert (TREE_TYPE (TYPE_MIN_VALUE (domain)), idx);
- idx = build_binary_op (MINUS_EXPR, idx, TYPE_MIN_VALUE (domain), 0);
- }
-#endif
-
- if (CH_STRING_TYPE_P (TREE_TYPE (array)))
- {
- /* Could be bitstring or char string. */
- if (TREE_TYPE (TREE_TYPE (array)) == boolean_type_node)
- {
- rval = build (SET_IN_EXPR, boolean_type_node, idx, array);
- TREE_READONLY (rval) = TREE_READONLY (array);
- return rval;
- }
- }
-
- if (!discrete_type_p (TREE_TYPE (idx)))
- {
- error ("array index is not discrete");
- return error_mark_node;
- }
-
- /* An array that is indexed by a non-constant
- cannot be stored in a register; we must be able to do
- address arithmetic on its address.
- Likewise an array of elements of variable size. */
- if (TREE_CODE (idx) != INTEGER_CST
- || (TYPE_SIZE (TREE_TYPE (TREE_TYPE (array))) != 0
- && TREE_CODE (TYPE_SIZE (TREE_TYPE (TREE_TYPE (array)))) != INTEGER_CST))
- {
- if (mark_addressable (array) == 0)
- return error_mark_node;
- }
-
- type = TREE_TYPE (TREE_TYPE (array));
-
- /* Do constant folding */
- if (TREE_CODE (idx) == INTEGER_CST && TREE_CONSTANT (array))
- {
- struct ch_class class;
- class.kind = CH_VALUE_CLASS;
- class.mode = type;
-
- if (TREE_CODE (array) == CONSTRUCTOR)
- {
- tree list = CONSTRUCTOR_ELTS (array);
- for ( ; list != NULL_TREE; list = TREE_CHAIN (list))
- {
- if (tree_int_cst_equal (TREE_PURPOSE (list), idx))
- return convert_to_class (class, TREE_VALUE (list));
- }
- }
- else if (TREE_CODE (array) == STRING_CST
- && CH_CHARS_TYPE_P (TREE_TYPE (array)))
- {
- HOST_WIDE_INT i = tree_low_cst (idx, 0);
-
- if (i >= 0 && i < TREE_STRING_LENGTH (array))
- return
- convert_to_class
- (class,
- build_int_2
- ((unsigned char) TREE_STRING_POINTER (array) [i], 0));
- }
- }
-
- if (TYPE_PACKED (TREE_TYPE (array)))
- rval = build (PACKED_ARRAY_REF, type, array, idx);
- else
- rval = build (ARRAY_REF, type, array, idx);
-
- /* Array ref is const/volatile if the array elements are
- or if the array is. */
- TREE_READONLY (rval) = TREE_READONLY (array) | TYPE_READONLY (type);
- TREE_SIDE_EFFECTS (rval)
- |= (TYPE_VOLATILE (TREE_TYPE (TREE_TYPE (array)))
- | TREE_SIDE_EFFECTS (array));
- 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]
- in an inline function.
- Hope it doesn't break something else. */
- | TREE_THIS_VOLATILE (array));
- return fold (rval);
-}
-
-tree
-build_chill_bitref (bitstring, indexlist)
- tree bitstring, indexlist;
-{
- if (TREE_CODE (bitstring) == ERROR_MARK)
- return bitstring;
- if (TREE_CODE (indexlist) == ERROR_MARK)
- return indexlist;
-
- if (TREE_CHAIN (indexlist) != NULL_TREE)
- {
- error ("invalid compound index for bitstring mode");
- return error_mark_node;
- }
-
- if (TREE_CODE (indexlist) == TREE_LIST)
- {
- tree result = build (SET_IN_EXPR, boolean_type_node,
- TREE_VALUE (indexlist), bitstring);
- TREE_READONLY (result) = TREE_READONLY (bitstring);
- return result;
- }
- else abort ();
-}
-
-
-int
-discrete_type_p (type)
- tree type;
-{
- return INTEGRAL_TYPE_P (type);
-}
-
-/* Checks that EXP has discrete type, or can be converted to discrete.
- Otherwise, returns NULL_TREE.
- Normally returns the (possibly-converted) EXP. */
-
-tree
-convert_to_discrete (exp)
- tree exp;
-{
- if (! discrete_type_p (TREE_TYPE (exp)))
- {
- if (flag_old_strings)
- {
- if (CH_CHARS_ONE_P (TREE_TYPE (exp)))
- return convert (char_type_node, exp);
- if (CH_BOOLS_ONE_P (TREE_TYPE (exp)))
- return convert (boolean_type_node, exp);
- }
- return NULL_TREE;
- }
- return exp;
-}
-
-/* Write into BUFFER the target-machine representation of VALUE.
- Returns 1 on success, or 0 on failure. (Either the VALUE was
- not constant, or we don't know how to do the conversion.) */
-
-static int
-expand_constant_to_buffer (value, buffer, buf_size)
- tree value;
- unsigned char *buffer;
- int buf_size;
-{
- tree type = TREE_TYPE (value);
- int size = int_size_in_bytes (type);
- int i;
- if (size < 0 || size > buf_size)
- return 0;
- switch (TREE_CODE (value))
- {
- case INTEGER_CST:
- {
- unsigned HOST_WIDE_INT lo = TREE_INT_CST_LOW (value);
- HOST_WIDE_INT hi = TREE_INT_CST_HIGH (value);
- for (i = 0; i < size; i++)
- {
- /* Doesn't work if host and target BITS_PER_UNIT differ. */
- unsigned char byte = lo & ((1 << BITS_PER_UNIT) - 1);
-
- if (BYTES_BIG_ENDIAN)
- buffer[size - i - 1] = byte;
- else
- buffer[i] = byte;
-
- rshift_double (lo, hi, BITS_PER_UNIT, BITS_PER_UNIT * size,
- &lo, &hi, 0);
- }
- }
- break;
- case STRING_CST:
- {
- size = TREE_STRING_LENGTH (value);
- if (size > buf_size)
- return 0;
- bcopy (TREE_STRING_POINTER (value), buffer, size);
- break;
- }
- case CONSTRUCTOR:
- if (TREE_CODE (type) == ARRAY_TYPE)
- {
- tree element_type = TREE_TYPE (type);
- int element_size = int_size_in_bytes (element_type);
- tree list = CONSTRUCTOR_ELTS (value);
- HOST_WIDE_INT next_index;
- HOST_WIDE_INT min_index = 0;
- if (element_size < 0)
- return 0;
-
- if (TYPE_DOMAIN (type) != 0)
- {
- tree min_val = TYPE_MIN_VALUE (TYPE_DOMAIN (type));
- if (min_val)
- {
- if (! host_integerp (min_val, 0))
- return 0;
- else
- min_index = tree_low_cst (min_val, 0);
- }
- }
-
- next_index = min_index;
-
- for (; list != NULL_TREE; list = TREE_CHAIN (list))
- {
- HOST_WIDE_INT offset;
- HOST_WIDE_INT last_index;
- tree purpose = TREE_PURPOSE (list);
-
- if (purpose)
- {
- if (host_integerp (purpose, 0))
- last_index = next_index = tree_low_cst (purpose, 0);
- else if (TREE_CODE (purpose) == RANGE_EXPR)
- {
- next_index = tree_low_cst (TREE_OPERAND (purpose, 0), 0);
- last_index = tree_low_cst (TREE_OPERAND (purpose, 1), 0);
- }
- else
- return 0;
- }
- else
- last_index = next_index;
- for ( ; next_index <= last_index; next_index++)
- {
- offset = (next_index - min_index) * element_size;
- if (!expand_constant_to_buffer (TREE_VALUE (list),
- buffer + offset,
- buf_size - offset))
- return 0;
- }
- }
- break;
- }
- else if (TREE_CODE (type) == RECORD_TYPE)
- {
- tree list = CONSTRUCTOR_ELTS (value);
- for (; list != NULL_TREE; list = TREE_CHAIN (list))
- {
- tree field = TREE_PURPOSE (list);
- HOST_WIDE_INT offset;
-
- if (field == NULL_TREE || TREE_CODE (field) != FIELD_DECL)
- return 0;
-
- if (DECL_BIT_FIELD (field))
- return 0;
-
- offset = int_byte_position (field);
- if (!expand_constant_to_buffer (TREE_VALUE (list),
- buffer + offset,
- buf_size - offset))
- return 0;
- }
- break;
- }
- else if (TREE_CODE (type) == SET_TYPE)
- {
- if (get_set_constructor_bytes (value, buffer, buf_size)
- != NULL_TREE)
- return 0;
- }
- break;
- default:
- return 0;
- }
- return 1;
-}
-
-/* Given that BUFFER contains a target-machine representation of
- a value of type TYPE, return that value as a tree.
- Returns NULL_TREE on failure. (E.g. the TYPE might be variable size,
- or perhaps we don't know how to do the conversion.) */
-
-static tree
-extract_constant_from_buffer (type, buffer, buf_size)
- tree type;
- const unsigned char *buffer;
- int buf_size;
-{
- tree value;
- HOST_WIDE_INT size = int_size_in_bytes (type);
- HOST_WIDE_INT i;
-
- if (size < 0 || size > buf_size)
- return 0;
-
- switch (TREE_CODE (type))
- {
- case INTEGER_TYPE:
- case CHAR_TYPE:
- case BOOLEAN_TYPE:
- case ENUMERAL_TYPE:
- case POINTER_TYPE:
- {
- HOST_WIDE_INT lo = 0, hi = 0;
- /* Accumulate (into (lo,hi) the bytes (from buffer). */
- for (i = size; --i >= 0; )
- {
- unsigned char byte;
- /* Get next byte (in big-endian order). */
- if (BYTES_BIG_ENDIAN)
- byte = buffer[size - i - 1];
- else
- byte = buffer[i];
- lshift_double (lo, hi, BITS_PER_UNIT, TYPE_PRECISION (type),
- &lo, &hi, 0);
- add_double (lo, hi, byte, 0, &lo, &hi);
- }
- value = build_int_2 (lo, hi);
- TREE_TYPE (value) = type;
- return value;
- }
- case ARRAY_TYPE:
- {
- tree element_type = TREE_TYPE (type);
- int element_size = int_size_in_bytes (element_type);
- tree list = NULL_TREE;
- HOST_WIDE_INT min_index = 0, max_index, cur_index;
- if (element_size == 1 && CH_CHARS_TYPE_P (type))
- {
- value = build_string (size, buffer);
- CH_DERIVED_FLAG (value) = 1;
- TREE_TYPE (value) = type;
- return value;
- }
- if (TYPE_DOMAIN (type) == 0)
- return 0;
- value = TYPE_MIN_VALUE (TYPE_DOMAIN (type));
- if (value)
- {
- if (! host_integerp (value, 0))
- return 0;
- else
- min_index = tree_low_cst (value, 0);
- }
-
- value = TYPE_MAX_VALUE (TYPE_DOMAIN (type));
- if (value == NULL_TREE || ! host_integerp (value, 0))
- return 0;
- else
- max_index = tree_low_cst (value, 0);
-
- for (cur_index = max_index; cur_index >= min_index; cur_index--)
- {
- HOST_WIDE_INT offset = (cur_index - min_index) * element_size;
- value = extract_constant_from_buffer (element_type,
- buffer + offset,
- buf_size - offset);
- if (value == NULL_TREE)
- return NULL_TREE;
- list = tree_cons (build_int_2 (cur_index, 0), value, list);
- }
- value = build (CONSTRUCTOR, type, NULL_TREE, list);
- TREE_CONSTANT (value) = 1;
- TREE_STATIC (value) = 1;
- return value;
- }
- case RECORD_TYPE:
- {
- tree list = NULL_TREE;
- tree field = TYPE_FIELDS (type);
- for (; field != NULL_TREE; field = TREE_CHAIN (field))
- {
- HOST_WIDE_INT offset = int_byte_position (field);
-
- if (DECL_BIT_FIELD (field))
- return 0;
- value = extract_constant_from_buffer (TREE_TYPE (field),
- buffer + offset,
- buf_size - offset);
- if (value == NULL_TREE)
- return NULL_TREE;
- list = tree_cons (field, value, list);
- }
- value = build (CONSTRUCTOR, type, NULL_TREE, nreverse (list));
- TREE_CONSTANT (value) = 1;
- TREE_STATIC (value) = 1;
- return value;
- }
-
- case UNION_TYPE:
- {
- tree longest_variant = NULL_TREE;
- unsigned HOST_WIDE_INT longest_size = 0;
- tree field = TYPE_FIELDS (type);
-
- /* This is a kludge. We assume that converting the data to te
- longest variant will provide valid data for the "correct"
- variant. This is usually the case, but is not guaranteed.
- For example, the longest variant may include holes.
- Also incorrect interpreting the given value as the longest
- variant may confuse the compiler if that should happen
- to yield invalid values. ??? */
-
- for (; field != NULL_TREE; field = TREE_CHAIN (field))
- {
- unsigned HOST_WIDE_INT size
- = int_size_in_bytes (TREE_TYPE (field));
-
- if (size > longest_size)
- {
- longest_size = size;
- longest_variant = field;
- }
- }
-
- if (longest_variant == NULL_TREE)
- return NULL_TREE;
-
- return
- extract_constant_from_buffer (TREE_TYPE (longest_variant),
- buffer, buf_size);
- }
-
- case SET_TYPE:
- {
- tree list = NULL_TREE;
- int i;
- HOST_WIDE_INT min_index, max_index;
-
- if (TYPE_DOMAIN (type) == 0)
- return 0;
-
- value = TYPE_MIN_VALUE (TYPE_DOMAIN (type));
- if (value == NULL_TREE)
- min_index = 0;
-
- else if (! host_integerp (value, 0))
- return 0;
- else
- min_index = tree_low_cst (value, 0);
-
- value = TYPE_MAX_VALUE (TYPE_DOMAIN (type));
- if (value == NULL_TREE)
- max_index = 0;
- else if (! host_integerp (value, 0))
- return 0;
- else
- max_index = tree_low_cst (value, 0);
-
- for (i = max_index + 1 - min_index; --i >= 0; )
- {
- unsigned char byte = (unsigned char) buffer[i / BITS_PER_UNIT];
- unsigned bit_pos = (unsigned) i % (unsigned) BITS_PER_UNIT;
-
- if (BYTES_BIG_ENDIAN
- ? (byte & (1 << (BITS_PER_UNIT - 1 - bit_pos)))
- : (byte & (1 << bit_pos)))
- list = tree_cons (NULL_TREE,
- build_int_2 (i + min_index, 0), list);
- }
- value = build (CONSTRUCTOR, type, NULL_TREE, list);
- TREE_CONSTANT (value) = 1;
- TREE_STATIC (value) = 1;
- return value;
- }
-
- default:
- return NULL_TREE;
- }
-}
-
-tree
-build_chill_cast (type, expr)
- tree type, expr;
-{
- tree expr_type;
- int expr_type_size;
- int type_size;
- int type_is_discrete;
- int expr_type_is_discrete;
-
- if (type == NULL_TREE || TREE_CODE (type) == ERROR_MARK)
- return error_mark_node;
- if (expr == NULL_TREE || TREE_CODE (expr) == ERROR_MARK)
- return error_mark_node;
-
- /* if expression was untyped because of its context (an
- if_expr or case_expr in a tuple, perhaps) just apply
- the type */
- expr_type = TREE_TYPE (expr);
- if (expr_type == NULL_TREE
- || TREE_CODE (expr_type) == ERROR_MARK)
- return convert (type, expr);
-
- if (expr_type == type)
- return expr;
-
- expr_type_size = int_size_in_bytes (expr_type);
- type_size = int_size_in_bytes (type);
-
- if (expr_type_size == -1)
- {
- error ("conversions from variable_size value");
- return error_mark_node;
- }
- if (type_size == -1)
- {
- error ("conversions to variable_size mode");
- return error_mark_node;
- }
-
- /* FIXME: process REAL ==> INT && INT ==> REAL && REAL ==> REAL. I hope this is correct. */
- if ((TREE_CODE (expr_type) == INTEGER_TYPE && TREE_CODE (type) == REAL_TYPE) ||
- (TREE_CODE (expr_type) == REAL_TYPE && TREE_CODE (type) == INTEGER_TYPE) ||
- (TREE_CODE (expr_type) == REAL_TYPE && TREE_CODE (type) == REAL_TYPE))
- return convert (type, expr);
-
- /* FIXME: Don't know if this is correct */
- /* Don't allow conversions to or from REAL with others then integer */
- if (TREE_CODE (type) == REAL_TYPE)
- {
- error ("cannot convert to float");
- return error_mark_node;
- }
- else if (TREE_CODE (expr_type) == REAL_TYPE)
- {
- error ("cannot convert float to this mode");
- return error_mark_node;
- }
-
- if (expr_type_size == type_size && CH_REFERABLE (expr))
- goto do_location_conversion;
-
- type_is_discrete
- = discrete_type_p (type) || TREE_CODE (type) == POINTER_TYPE;
- expr_type_is_discrete
- = discrete_type_p (expr_type) || TREE_CODE (expr_type) == POINTER_TYPE;
- if (expr_type_is_discrete && type_is_discrete)
- {
- /* do an overflow check
- FIXME: is this always neccessary ??? */
- /* FIXME: don't do range chacking when target type is PTR.
- PTR doesn't have MIN and MAXVALUE. result is sigsegv. */
- if (range_checking && type != ptr_type_node)
- {
- tree tmp = expr;
-
- STRIP_NOPS (tmp);
- if (TREE_CONSTANT (tmp) && TREE_CODE (tmp) != ADDR_EXPR)
- {
- if (compare_int_csts (LT_EXPR, tmp, TYPE_MIN_VALUE (type)) ||
- compare_int_csts (GT_EXPR, tmp, TYPE_MAX_VALUE (type)))
- {
- error ("OVERFLOW in expression conversion");
- return error_mark_node;
- }
- }
- else
- {
- int cond1 = tree_int_cst_lt (TYPE_SIZE (type),
- TYPE_SIZE (expr_type));
- int cond2 = TREE_UNSIGNED (type) && (! TREE_UNSIGNED (expr_type));
- int cond3 = (! TREE_UNSIGNED (type))
- && TREE_UNSIGNED (expr_type)
- && tree_int_cst_equal (TYPE_SIZE (type),
- TYPE_SIZE (expr_type));
- int cond4 = TREE_TYPE (type) && type_is_discrete;
-
- if (cond1 || cond2 || cond3 || cond4)
- {
- tree type_min = TYPE_MIN_VALUE (type);
- tree type_max = TYPE_MAX_VALUE (type);
-
- expr = save_if_needed (expr);
- if (expr && type_min && type_max)
- {
- tree check = test_range (expr, type_min, type_max);
- if (!integer_zerop (check))
- {
- if (current_function_decl == NULL_TREE)
- {
- if (TREE_CODE (check) == INTEGER_CST)
- error ("overflow (not inside function)");
- else
- warning ("possible overflow (not inside function)");
- }
- else
- {
- if (TREE_CODE (check) == INTEGER_CST)
- warning ("expression will always cause OVERFLOW");
- expr = check_expression (expr, check,
- ridpointers[(int) RID_OVERFLOW]);
- }
- }
- }
- }
- }
- }
- return convert (type, expr);
- }
-
- if (TREE_CODE (expr) == INTEGER_CST && expr_type_size != type_size)
- {
- /* There should probably be a pedwarn here ... */
- tree itype = type_for_size (type_size * BITS_PER_UNIT, 1);
- if (itype)
- {
- expr = convert (itype, expr);
- expr_type = TREE_TYPE (expr);
- expr_type_size= type_size;
- }
- }
-
- /* If expr is a constant of the right size, use it to to
- initialize a static variable. */
- if (expr_type_size == type_size && TREE_CONSTANT (expr) && !pedantic)
- {
- unsigned char *buffer = (unsigned char*) alloca (type_size);
- tree value;
- memset (buffer, 0, type_size);
- if (!expand_constant_to_buffer (expr, buffer, type_size))
- {
- error ("not implemented: constant conversion from that kind of expression");
- return error_mark_node;
- }
- value = extract_constant_from_buffer (type, buffer, type_size);
- if (value == NULL_TREE)
- {
- error ("not implemented: constant conversion to that kind of mode");
- return error_mark_node;
- }
- return value;
- }
-
- if (!CH_REFERABLE (expr) && expr_type_size == type_size)
- {
- tree temp = decl_temp1 (get_unique_identifier ("CAST"),
- TREE_TYPE (expr), 0, 0, 0, 0);
- tree convert1 = build_chill_modify_expr (temp, expr);
- pedwarn ("non-standard, non-portable value conversion");
- return build (COMPOUND_EXPR, type, convert1,
- build_chill_cast (type, temp));
- }
-
- if (CH_REFERABLE (expr) && expr_type_size != type_size)
- error ("location conversion between differently-sized modes");
- else
- error ("unsupported value conversion");
- return error_mark_node;
-
- do_location_conversion:
- /* To avoid confusing other parts of gcc,
- represent this as the C expression: *(TYPE*)EXPR. */
- mark_addressable (expr);
- expr = build1 (INDIRECT_REF, type,
- build1 (NOP_EXPR, build_pointer_type (type),
- build1 (ADDR_EXPR, build_pointer_type (expr_type),
- expr)));
- TREE_READONLY (expr) = TYPE_READONLY (type);
- return expr;
-}
-
-/* Given a set_type, build an integer array from it that C will grok. */
-
-tree
-build_array_from_set (type)
- tree type;
-{
- tree bytespint, bit_array_size, int_array_count;
-
- if (type == NULL_TREE || type == error_mark_node
- || TREE_CODE (type) != SET_TYPE)
- return error_mark_node;
-
- /* ??? Should this really be *HOST*?? */
- bytespint = size_int (HOST_BITS_PER_INT / HOST_BITS_PER_CHAR);
- bit_array_size = size_in_bytes (type);
- int_array_count = size_binop (TRUNC_DIV_EXPR, bit_array_size, bytespint);
- if (integer_zerop (int_array_count))
- int_array_count = size_one_node;
- type = build_array_type (integer_type_node,
- build_index_type (int_array_count));
- return type;
-}
-
-
-tree
-build_chill_bin_type (size)
- tree size;
-{
-#if 0
- HOST_WIDE_INT isize;
-
- if (! host_integerp (size, 1))
- {
- error ("operand to bin must be a non-negative integer literal");
- return error_mark_node;
- }
-
- isize = tree_low_cst (size, 1);
-
- if (isize <= TYPE_PRECISION (unsigned_char_type_node))
- return unsigned_char_type_node;
- if (isize <= TYPE_PRECISION (short_unsigned_type_node))
- return short_unsigned_type_node;
- if (isize <= TYPE_PRECISION (unsigned_type_node))
- return unsigned_type_node;
- if (isize <= TYPE_PRECISION (long_unsigned_type_node))
- return long_unsigned_type_node;
- if (isize <= TYPE_PRECISION (long_long_unsigned_type_node))
- return long_long_unsigned_type_node;
- error ("size %d of BIN too big - no such integer mode", isize);
- return error_mark_node;
-#endif
- tree bintype;
-
- if (pass == 1)
- {
- bintype = make_node (INTEGER_TYPE);
- TREE_TYPE (bintype) = ridpointers[(int) RID_BIN];
- TYPE_MIN_VALUE (bintype) = size;
- TYPE_MAX_VALUE (bintype) = size;
- }
- else
- {
- error ("BIN in pass 2");
- return error_mark_node;
- }
- return bintype;
-}
-
-tree
-chill_expand_tuple (type, constructor)
- tree type, constructor;
-{
- const char *name;
- tree nonreft = type;
-
- if (TYPE_NAME (type) != NULL_TREE)
- {
- if (TREE_CODE (TYPE_NAME (type)) == IDENTIFIER_NODE)
- name = IDENTIFIER_POINTER (TYPE_NAME (type));
- else
- name = IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (type)));
- }
- else
- name = "";
-
- /* get to actual underlying type for digest_init */
- while (nonreft && TREE_CODE (nonreft) == REFERENCE_TYPE)
- nonreft = TREE_TYPE (nonreft);
-
- if (TREE_CODE (nonreft) == ARRAY_TYPE
- || TREE_CODE (nonreft) == RECORD_TYPE
- || TREE_CODE (nonreft) == SET_TYPE)
- return convert (nonreft, constructor);
- else
- {
- error ("mode of tuple is neither ARRAY, STRUCT, nor POWERSET");
- return error_mark_node;
- }
-}
-
-/* This function classifies an expr into the Null class,
- the All class, the M-Value, the M-derived, or the M-reference class.
- It probably has some inaccuracies. */
-
-struct ch_class
-chill_expr_class (expr)
- tree expr;
-{
- struct ch_class class;
- /* The Null class contains the NULL pointer constant (only). */
- if (expr == null_pointer_node)
- {
- class.kind = CH_NULL_CLASS;
- class.mode = NULL_TREE;
- return class;
- }
-
- /* The All class contains the <undefined value> "*". */
- if (TREE_CODE (expr) == UNDEFINED_EXPR)
- {
- class.kind = CH_ALL_CLASS;
- class.mode = NULL_TREE;
- return class;
- }
-
- if (CH_DERIVED_FLAG (expr))
- {
- class.kind = CH_DERIVED_CLASS;
- class.mode = TREE_TYPE (expr);
- return class;
- }
-
- /* The M-Reference contains <references location> (address-of) expressions.
- Note that something that's been converted to a reference doesn't count. */
- if (TREE_CODE (expr) == ADDR_EXPR
- && TREE_CODE (TREE_TYPE (expr)) != REFERENCE_TYPE)
- {
- class.kind = CH_REFERENCE_CLASS;
- class.mode = TREE_TYPE (TREE_TYPE (expr));
- return class;
- }
-
- /* The M-Value class contains expressions with a known, specific mode M. */
- class.kind = CH_VALUE_CLASS;
- class.mode = TREE_TYPE (expr);
- return class;
-}
-
-/* Returns >= 1 iff REF is a location. Return 2 if it is referable. */
-
-int chill_location (ref)
- tree ref;
-{
- register enum tree_code code = TREE_CODE (ref);
-
- switch (code)
- {
- case REALPART_EXPR:
- case IMAGPART_EXPR:
- case ARRAY_REF:
- case PACKED_ARRAY_REF:
- case COMPONENT_REF:
- case NOP_EXPR: /* RETYPE_EXPR */
- return chill_location (TREE_OPERAND (ref, 0));
- case COMPOUND_EXPR:
- return chill_location (TREE_OPERAND (ref, 1));
-
- case BIT_FIELD_REF:
- case SLICE_EXPR:
- /* A bit-string slice is nor referable. */
- return chill_location (TREE_OPERAND (ref, 0)) == 0 ? 0 : 1;
-
- case CONSTRUCTOR:
- case STRING_CST:
- return 0;
-
- case INDIRECT_REF:
- case VAR_DECL:
- case PARM_DECL:
- case RESULT_DECL:
- case ERROR_MARK:
- if (TREE_CODE (TREE_TYPE (ref)) != FUNCTION_TYPE
- && TREE_CODE (TREE_TYPE (ref)) != METHOD_TYPE)
- return 2;
- break;
-
- default:
- break;
- }
- return 0;
-}
-
-int
-chill_referable (val)
- tree val;
-{
- return chill_location (val) > 1;
-}
-
-/* Make a copy of MODE, but with the given NOVELTY. */
-
-tree
-copy_novelty (novelty, mode)
- tree novelty, mode;
-{
- if (CH_NOVELTY (mode) != novelty)
- {
- mode = copy_node (mode);
- TYPE_MAIN_VARIANT (mode) = mode;
- TYPE_NEXT_VARIANT (mode) = 0;
- TYPE_POINTER_TO (mode) = 0;
- TYPE_REFERENCE_TO (mode) = 0;
- SET_CH_NOVELTY (mode, novelty);
- }
- return mode;
-}
-
-
-struct mode_chain
-{
- struct mode_chain *prev;
- tree mode1, mode2;
-};
-
-/* Tests if MODE1 and MODE2 are SIMILAR.
- This is more or less as defined in the Blue Book, though
- see FIXME for parts that are unfinished.
- CHAIN is used to catch infinite recursion: It is a list of pairs
- of mode arguments to calls to chill_similar "outer" to this call. */
-
-int
-chill_similar (mode1, mode2, chain)
- tree mode1, mode2;
- struct mode_chain *chain;
-{
- int varying1, varying2;
- tree t1, t2;
- struct mode_chain *link, node;
- if (mode1 == NULL_TREE || mode2 == NULL_TREE)
- return 0;
-
- while (TREE_CODE (mode1) == REFERENCE_TYPE)
- mode1 = TREE_TYPE (mode1);
- while (TREE_CODE (mode2) == REFERENCE_TYPE)
- mode2 = TREE_TYPE (mode2);
-
- /* Range modes are similar to their parent types. */
- while (TREE_CODE (mode1) == INTEGER_TYPE && TREE_TYPE (mode1) != NULL_TREE)
- mode1 = TREE_TYPE (mode1);
- while (TREE_CODE (mode2) == INTEGER_TYPE && TREE_TYPE (mode2) != NULL_TREE)
- mode2 = TREE_TYPE (mode2);
-
-
- /* see Z.200 sections 12.1.2.2 and 13.2 - all integer precisions
- are similar to INT and to each other */
- if (mode1 == mode2 ||
- (TREE_CODE (mode1) == INTEGER_TYPE && TREE_CODE (mode2) == INTEGER_TYPE))
- return 1;
-
- /* This guards against certain kinds of recursion.
- For example:
- SYNMODE a = STRUCT ( next REF a );
- SYNMODE b = STRUCT ( next REF b );
- These moes are similar, but will get an infite recursion trying
- to prove that. So, if we are recursing, assume the moes are similar.
- If they are not, we'll find some other discrepancy. */
- for (link = chain; link != NULL; link = link->prev)
- {
- if (link->mode1 == mode1 && link->mode2 == mode2)
- return 1;
- }
-
- node.mode1 = mode1;
- node.mode2 = mode2;
- node.prev = chain;
-
- varying1 = chill_varying_type_p (mode1);
- varying2 = chill_varying_type_p (mode2);
- /* FIXME: This isn't quite strict enough. */
- if ((varying1 && varying2)
- || (varying1 && TREE_CODE (mode2) == ARRAY_TYPE)
- || (varying2 && TREE_CODE (mode1) == ARRAY_TYPE))
- return 1;
-
- if (TREE_CODE(mode1) != TREE_CODE(mode2))
- {
- if (flag_old_strings)
- {
- /* The recursion is to handle varying strings. */
- if ((TREE_CODE (mode1) == CHAR_TYPE
- && CH_SIMILAR (mode2, string_one_type_node))
- || (TREE_CODE (mode2) == CHAR_TYPE
- && CH_SIMILAR (mode1, string_one_type_node)))
- return 1;
- if ((TREE_CODE (mode1) == BOOLEAN_TYPE
- && CH_SIMILAR (mode2, bitstring_one_type_node))
- || (TREE_CODE (mode2) == BOOLEAN_TYPE
- && CH_SIMILAR (mode1, bitstring_one_type_node)))
- return 1;
- }
- if (TREE_CODE (mode1) == FUNCTION_TYPE
- && TREE_CODE (mode2) == POINTER_TYPE
- && TREE_CODE (TREE_TYPE (mode2)) == FUNCTION_TYPE)
- mode2 = TREE_TYPE (mode2);
- else if (TREE_CODE (mode2) == FUNCTION_TYPE
- && TREE_CODE (mode1) == POINTER_TYPE
- && TREE_CODE (TREE_TYPE (mode1)) == FUNCTION_TYPE)
- mode1 = TREE_TYPE (mode1);
- else
- return 0;
- }
-
- if (CH_IS_BUFFER_MODE (mode1) && CH_IS_BUFFER_MODE (mode2))
- {
- tree len1 = max_queue_size (mode1);
- tree len2 = max_queue_size (mode2);
- return tree_int_cst_equal (len1, len2);
- }
- else if (CH_IS_EVENT_MODE (mode1) && CH_IS_EVENT_MODE (mode2))
- {
- tree len1 = max_queue_size (mode1);
- tree len2 = max_queue_size (mode2);
- return tree_int_cst_equal (len1, len2);
- }
- else if (CH_IS_ACCESS_MODE (mode1) && CH_IS_ACCESS_MODE (mode2))
- {
- tree index1 = access_indexmode (mode1);
- tree index2 = access_indexmode (mode2);
- tree record1 = access_recordmode (mode1);
- tree record2 = access_recordmode (mode2);
- if (! chill_read_compatible (index1, index2))
- return 0;
- return chill_read_compatible (record1, record2);
- }
- switch ((enum chill_tree_code)TREE_CODE (mode1))
- {
- case INTEGER_TYPE:
- case BOOLEAN_TYPE:
- case CHAR_TYPE:
- return 1;
- case ENUMERAL_TYPE:
- if (TYPE_VALUES (mode1) == TYPE_VALUES (mode2))
- return 1;
- else
- {
- /* FIXME: This is more strict than z.200, which seems to
- allow the elements to be reordered, as long as they
- have the same values. */
-
- tree field1 = TYPE_VALUES (mode1);
- tree field2 = TYPE_VALUES (mode2);
-
- while (field1 != NULL_TREE && field2 != NULL_TREE)
- {
- tree value1, value2;
- /* Check that the names are equal. */
- if (TREE_PURPOSE (field1) != TREE_PURPOSE (field2))
- break;
-
- value1 = TREE_VALUE (field1);
- value2 = TREE_VALUE (field2);
- /* This isn't quite sufficient in general, but will do ... */
- /* Note that proclaim_decl can cause the SET modes to be
- compared BEFORE they are satisfied, but otherwise
- chill_similar is mostly called after satisfaction. */
- if (TREE_CODE (value1) == CONST_DECL)
- value1 = DECL_INITIAL (value1);
- if (TREE_CODE (value2) == CONST_DECL)
- value2 = DECL_INITIAL (value2);
- /* Check that the values are equal or both NULL. */
- if (!(value1 == NULL_TREE && value2 == NULL_TREE)
- && (value1 == NULL_TREE || value2 == NULL_TREE
- || ! tree_int_cst_equal (value1, value2)))
- break;
- field1 = TREE_CHAIN (field1);
- field2 = TREE_CHAIN (field2);
- }
- return field1 == NULL_TREE && field2 == NULL_TREE;
- }
- case SET_TYPE:
- /* check for bit strings */
- if (CH_BOOLS_TYPE_P (mode1))
- return CH_BOOLS_TYPE_P (mode2);
- if (CH_BOOLS_TYPE_P (mode2))
- return CH_BOOLS_TYPE_P (mode1);
- /* both are powerset modes */
- return CH_EQUIVALENT (TYPE_DOMAIN (mode1), TYPE_DOMAIN (mode2));
-
- case POINTER_TYPE:
- /* Are the referenced modes equivalent? */
- return !integer_zerop (chill_equivalent (TREE_TYPE (mode1),
- TREE_TYPE (mode2),
- &node));
-
- case ARRAY_TYPE:
- /* char for char strings */
- if (CH_CHARS_TYPE_P (mode1))
- return CH_CHARS_TYPE_P (mode2);
- if (CH_CHARS_TYPE_P (mode2))
- return CH_CHARS_TYPE_P (mode1);
- /* array modes */
- if (CH_V_EQUIVALENT (TYPE_DOMAIN (mode1), TYPE_DOMAIN (mode2))
- /* Are the elements modes equivalent? */
- && !integer_zerop (chill_equivalent (TREE_TYPE (mode1),
- TREE_TYPE (mode2),
- &node)))
- {
- /* FIXME: Check that element layouts are equivalent */
-
- tree count1 = fold (build (MINUS_EXPR, sizetype,
- TYPE_MAX_VALUE (TYPE_DOMAIN (mode1)),
- TYPE_MIN_VALUE (TYPE_DOMAIN (mode1))));
- tree count2 = fold (build (MINUS_EXPR, sizetype,
- TYPE_MAX_VALUE (TYPE_DOMAIN (mode2)),
- TYPE_MIN_VALUE (TYPE_DOMAIN (mode2))));
- tree cond = build_compare_discrete_expr (EQ_EXPR, count1, count2);
- if (TREE_CODE (cond) == INTEGER_CST)
- return !integer_zerop (cond);
- else
- {
-#if 0
- extern int ignoring;
- if (!ignoring
- && range_checking
- && current_function_decl)
- return cond;
-#endif
- return 1;
- }
- }
- return 0;
-
- case RECORD_TYPE:
- case UNION_TYPE:
- for (t1 = TYPE_FIELDS (mode1), t2 = TYPE_FIELDS (mode2);
- t1 && t2; t1 = TREE_CHAIN (t1), t2 = TREE_CHAIN (t2))
- {
- if (TREE_CODE (t1) != TREE_CODE (t2))
- return 0;
- /* Are the field modes equivalent? */
- if (integer_zerop (chill_equivalent (TREE_TYPE (t1),
- TREE_TYPE (t2),
- &node)))
- return 0;
- }
- return t1 == t2;
-
- case FUNCTION_TYPE:
- if (!chill_l_equivalent (TREE_TYPE (mode1), TREE_TYPE (mode2), &node))
- return 0;
- for (t1 = TYPE_ARG_TYPES (mode1), t2 = TYPE_ARG_TYPES (mode2);
- t1 != NULL_TREE && t2 != NULL_TREE;
- t1 = TREE_CHAIN (t1), t2 = TREE_CHAIN (t2))
- {
- tree attr1 = TREE_PURPOSE (t1)
- ? TREE_PURPOSE (t1) : ridpointers[(int) RID_IN];
- tree attr2 = TREE_PURPOSE (t2)
- ? TREE_PURPOSE (t2) : ridpointers[(int) RID_IN];
- if (attr1 != attr2)
- return 0;
- if (!chill_l_equivalent (TREE_VALUE (t1), TREE_VALUE (t2), &node))
- return 0;
- }
- if (t1 != t2) /* Both NULL_TREE */
- return 0;
- /* check list of exception names */
- t1 = TYPE_RAISES_EXCEPTIONS (mode1);
- t2 = TYPE_RAISES_EXCEPTIONS (mode2);
- if (t1 == NULL_TREE && t2 != NULL_TREE)
- return 0;
- if (t1 != NULL_TREE && t2 == NULL_TREE)
- return 0;
- if (list_length (t1) != list_length (t2))
- return 0;
- while (t1 != NULL_TREE)
- {
- if (value_member (TREE_VALUE (t1), t2) == NULL_TREE)
- return 0;
- t1 = TREE_CHAIN (t1);
- }
- /* FIXME: Should also check they have the same RECURSIVITY */
- return 1;
-
- default:
- ;
-#if 0
- /* Need to handle row modes, instance modes,
- association modes, access modes, text modes,
- duration modes, absolute time modes, structure modes,
- parameterized structure modes */
-#endif
- }
- return 1;
-}
-
-/* Return a node that is true iff MODE1 and MODE2 are equivalent.
- This is normally boolean_true_node or boolean_false_node,
- but can be dynamic for dynamic types.
- CHAIN is as for chill_similar. */
-
-tree
-chill_equivalent (mode1, mode2, chain)
- tree mode1, mode2;
- struct mode_chain *chain;
-{
- int varying1, varying2;
- int is_string1, is_string2;
- tree base_mode1, base_mode2;
-
- /* Are the modes v-equivalent? */
-#if 0
- if (!chill_similar (mode1, mode2, chain)
- || CH_NOVELTY(mode1) != CH_NOVELTY(mode2))
- return boolean_false_node;
-#endif
- if (!chill_similar (mode1, mode2, chain))
- return boolean_false_node;
- else if (TREE_CODE (mode2) == FUNCTION_TYPE
- && TREE_CODE (mode1) == POINTER_TYPE
- && TREE_CODE (TREE_TYPE (mode1)) == FUNCTION_TYPE)
- /* don't check novelty in this case to avoid error in case of
- NEWMODE'd proceduremode gets assigned a function */
- return boolean_true_node;
- else if (CH_NOVELTY(mode1) != CH_NOVELTY(mode2))
- return boolean_false_node;
-
- varying1 = chill_varying_type_p (mode1);
- varying2 = chill_varying_type_p (mode2);
-
- if (varying1 != varying2)
- return boolean_false_node;
- base_mode1 = varying1 ? CH_VARYING_ARRAY_TYPE (mode1) : mode1;
- base_mode2 = varying2 ? CH_VARYING_ARRAY_TYPE (mode2) : mode2;
- is_string1 = CH_STRING_TYPE_P (base_mode1);
- is_string2 = CH_STRING_TYPE_P (base_mode2);
- if (is_string1 || is_string2)
- {
- if (is_string1 != is_string2)
- return boolean_false_node;
- return fold (build (EQ_EXPR, boolean_type_node,
- TYPE_SIZE (base_mode1),
- TYPE_SIZE (base_mode2)));
- }
-
- /* && some more stuff FIXME! */
- if (TREE_CODE(mode1) == INTEGER_TYPE || TREE_CODE(mode2) == INTEGER_TYPE)
- {
- if (TREE_CODE(mode1) != INTEGER_TYPE || TREE_CODE(mode2) != INTEGER_TYPE)
- return boolean_false_node;
- /* If one is a range, the other has to be a range. */
- if ((TREE_TYPE (mode1) != NULL_TREE) != (TREE_TYPE (mode2) != NULL_TREE))
- return boolean_false_node;
- if (TYPE_PRECISION (mode1) != TYPE_PRECISION (mode2))
- return boolean_false_node;
- if (!tree_int_cst_equal (TYPE_MIN_VALUE (mode1), TYPE_MIN_VALUE (mode2)))
- return boolean_false_node;
- if (!tree_int_cst_equal (TYPE_MAX_VALUE (mode1), TYPE_MAX_VALUE (mode2)))
- return boolean_false_node;
- }
- return boolean_true_node;
-}
-
-static int
-chill_l_equivalent (mode1, mode2, chain)
- tree mode1, mode2;
- struct mode_chain *chain;
-{
- /* Are the modes equivalent? */
- if (integer_zerop (chill_equivalent (mode1, mode2, chain)))
- return 0;
- if (TYPE_READONLY (mode1) != TYPE_READONLY (mode2))
- return 0;
-#if 0
- ... other conditions ...;
-#endif
- return 1;
-}
-
-/* See Z200 12.1.2.12 */
-
-int
-chill_read_compatible (modeM, modeN)
- tree modeM, modeN;
-{
- while (TREE_CODE (modeM) == REFERENCE_TYPE)
- modeM = TREE_TYPE (modeM);
- while (TREE_CODE (modeN) == REFERENCE_TYPE)
- modeN = TREE_TYPE (modeN);
-
- if (!CH_EQUIVALENT (modeM, modeN))
- return 0;
- if (TYPE_READONLY (modeN))
- {
- if (!TYPE_READONLY (modeM))
- return 0;
- if (CH_IS_BOUND_REFERENCE_MODE (modeM)
- && CH_IS_BOUND_REFERENCE_MODE (modeN))
- {
- return chill_l_equivalent (TREE_TYPE (modeM), TREE_TYPE (modeN), 0);
- }
-#if 0
- ...;
-#endif
- }
- return 1;
-}
-
-/* Tests if MODE is compatible with the class of EXPR.
- Cfr. Chill Blue Book 12.1.2.15. */
-
-int
-chill_compatible (expr, mode)
- tree expr, mode;
-{
- struct ch_class class;
-
- if (expr == NULL_TREE || TREE_CODE (expr) == ERROR_MARK)
- return 0;
- if (mode == NULL_TREE || TREE_CODE (mode) == ERROR_MARK)
- return 0;
-
- while (TREE_CODE (mode) == REFERENCE_TYPE)
- mode = TREE_TYPE (mode);
-
- if (TREE_TYPE (expr) == NULL_TREE)
- {
- if (TREE_CODE (expr) == CONSTRUCTOR)
- return TREE_CODE (mode) == RECORD_TYPE
- || ((TREE_CODE (mode) == SET_TYPE || TREE_CODE (mode) == ARRAY_TYPE)
- && ! TYPE_STRING_FLAG (mode));
- else
- return TREE_CODE (expr) == CASE_EXPR || TREE_CODE (expr) == COND_EXPR;
- }
-
- class = chill_expr_class (expr);
- switch (class.kind)
- {
- case CH_ALL_CLASS:
- return 1;
- case CH_NULL_CLASS:
- return CH_IS_REFERENCE_MODE (mode) || CH_IS_PROCEDURE_MODE (mode)
- || CH_IS_INSTANCE_MODE (mode);
- case CH_VALUE_CLASS:
- if (CH_HAS_REFERENCING_PROPERTY (mode))
- return CH_RESTRICTABLE_TO(mode, class.mode);
- else
- return CH_V_EQUIVALENT(mode, class.mode);
- case CH_DERIVED_CLASS:
- return CH_SIMILAR (class.mode, mode);
- case CH_REFERENCE_CLASS:
- if (!CH_IS_REFERENCE_MODE (mode))
- return 0;
-#if 0
- /* FIXME! */
- if (class.mode is a row mode)
- ...;
- else if (class.mode is not a static mode)
- return 0; /* is this possible? FIXME */
-#endif
- return !CH_IS_BOUND_REFERENCE_MODE(mode)
- || CH_READ_COMPATIBLE (TREE_TYPE (mode), class.mode);
- }
- return 0; /* ERROR! */
-}
-
-/* Tests if the class of of EXPR1 and EXPR2 are compatible.
- Cfr. Chill Blue Book 12.1.2.16. */
-
-int
-chill_compatible_classes (expr1, expr2)
- tree expr1, expr2;
-{
- struct ch_class temp;
- struct ch_class class1, class2;
- class1 = chill_expr_class (expr1);
- class2 = chill_expr_class (expr2);
-
- switch (class1.kind)
- {
- case CH_ALL_CLASS:
- return 1;
- case CH_NULL_CLASS:
- switch (class2.kind)
- {
- case CH_ALL_CLASS:
- case CH_NULL_CLASS:
- case CH_REFERENCE_CLASS:
- return 1;
- case CH_VALUE_CLASS:
- case CH_DERIVED_CLASS:
- goto rule4;
- }
- case CH_REFERENCE_CLASS:
- switch (class2.kind)
- {
- case CH_ALL_CLASS:
- case CH_NULL_CLASS:
- return 1;
- case CH_REFERENCE_CLASS:
- return CH_EQUIVALENT (class1.mode, class2.mode);
- case CH_VALUE_CLASS:
- goto rule6;
- case CH_DERIVED_CLASS:
- return 0;
- }
- case CH_DERIVED_CLASS:
- switch (class2.kind)
- {
- case CH_ALL_CLASS:
- return 1;
- case CH_VALUE_CLASS:
- case CH_DERIVED_CLASS:
- return CH_SIMILAR (class1.mode, class2.mode);
- case CH_NULL_CLASS:
- class2 = class1;
- goto rule4;
- case CH_REFERENCE_CLASS:
- return 0;
- }
- case CH_VALUE_CLASS:
- switch (class2.kind)
- {
- case CH_ALL_CLASS:
- return 1;
- case CH_DERIVED_CLASS:
- return CH_SIMILAR (class1.mode, class2.mode);
- case CH_VALUE_CLASS:
- return CH_V_EQUIVALENT (class1.mode, class2.mode);
- case CH_NULL_CLASS:
- class2 = class1;
- goto rule4;
- case CH_REFERENCE_CLASS:
- temp = class1; class1 = class2; class2 = temp;
- goto rule6;
- }
- }
- rule4:
- /* The Null class is Compatible with the M-derived class or M-value class
- if and only if M is a reference mdoe, procedure mode or instance mode.*/
- return CH_IS_REFERENCE_MODE (class2.mode)
- || CH_IS_PROCEDURE_MODE (class2.mode)
- || CH_IS_INSTANCE_MODE (class2.mode);
-
- rule6:
- /* The M-reference class is compatible with the N-value class if and
- only if N is a reference mode and ... */
- if (!CH_IS_REFERENCE_MODE (class2.mode))
- return 0;
- if (1) /* If M is a static mode - FIXME */
- {
- if (!CH_IS_BOUND_REFERENCE_MODE (class2.mode))
- return 1;
- if (CH_EQUIVALENT (TREE_TYPE (class2.mode), class1.mode))
- return 1;
- }
- /* If N is a row mode whose .... FIXME */
- return 0;
-}
-
-/* Cfr. Blue Book 12.1.1.6, with some "extensions." */
-
-tree
-chill_root_mode (mode)
- tree mode;
-{
- /* Reference types are not user-visible types.
- This seems like a good place to get rid of them. */
- if (TREE_CODE (mode) == REFERENCE_TYPE)
- mode = TREE_TYPE (mode);
-
- while (TREE_CODE (mode) == INTEGER_TYPE && TREE_TYPE (mode) != NULL_TREE)
- mode = TREE_TYPE (mode); /* a sub-range */
-
- /* This extension in not in the Blue Book - which only has a
- single Integer type.
- We should probably use chill_integer_type_node rather
- than integer_type_node, but that is likely to bomb.
- At some point, these will become the same, I hope. FIXME */
- if (TREE_CODE (mode) == INTEGER_TYPE
- && TYPE_PRECISION (mode) < TYPE_PRECISION (integer_type_node)
- && CH_NOVELTY (mode) == NULL_TREE)
- mode = integer_type_node;
-
- if (TREE_CODE (mode) == FUNCTION_TYPE)
- return build_pointer_type (mode);
-
- return mode;
-}
-
-/* Cfr. Blue Book 12.1.1.7. */
-
-tree
-chill_resulting_mode (mode1, mode2)
- tree mode1, mode2;
-{
- mode1 = CH_ROOT_MODE (mode1);
- mode2 = CH_ROOT_MODE (mode2);
- if (chill_varying_type_p (mode1))
- return mode1;
- if (chill_varying_type_p (mode2))
- return mode2;
- return mode1;
-}
-
-/* Cfr. Blue Book (z200, 1988) 12.1.1.7 Resulting class. */
-
-struct ch_class
-chill_resulting_class (class1, class2)
- struct ch_class class1, class2;
-{
- struct ch_class class;
- switch (class1.kind)
- {
- case CH_VALUE_CLASS:
- switch (class2.kind)
- {
- case CH_DERIVED_CLASS:
- case CH_ALL_CLASS:
- class.kind = CH_VALUE_CLASS;
- class.mode = CH_ROOT_MODE (class1.mode);
- return class;
- case CH_VALUE_CLASS:
- class.kind = CH_VALUE_CLASS;
- class.mode
- = CH_ROOT_MODE (CH_RESULTING_MODE (class1.mode, class2.mode));
- return class;
- default:
- break;
- }
- break;
- case CH_DERIVED_CLASS:
- switch (class2.kind)
- {
- case CH_VALUE_CLASS:
- class.kind = CH_VALUE_CLASS;
- class.mode = CH_ROOT_MODE (class2.mode);
- return class;
- case CH_DERIVED_CLASS:
- class.kind = CH_DERIVED_CLASS;
- class.mode = CH_RESULTING_MODE (class1.mode, class2.mode);
- return class;
- case CH_ALL_CLASS:
- class.kind = CH_DERIVED_CLASS;
- class.mode = CH_ROOT_MODE (class1.mode);
- return class;
- default:
- break;
- }
- break;
- case CH_ALL_CLASS:
- switch (class2.kind)
- {
- case CH_VALUE_CLASS:
- class.kind = CH_VALUE_CLASS;
- class.mode = CH_ROOT_MODE (class2.mode);
- return class;
- case CH_ALL_CLASS:
- class.kind = CH_ALL_CLASS;
- class.mode = NULL_TREE;
- return class;
- case CH_DERIVED_CLASS:
- class.kind = CH_DERIVED_CLASS;
- class.mode = CH_ROOT_MODE (class2.mode);
- return class;
- default:
- break;
- }
- break;
- default:
- break;
- }
- error ("internal error in chill_root_resulting_mode");
- class.kind = CH_VALUE_CLASS;
- class.mode = CH_ROOT_MODE (class1.mode);
- return class;
-}
-
-
-/*
- * See Z.200, section 6.3, static conditions. This function
- * returns bool_false_node if the condition is not met at compile time,
- * bool_true_node if the condition is detectably met at compile time
- * an expression if a runtime check would be required or was generated.
- * It should only be called with string modes and values.
- */
-tree
-string_assignment_condition (lhs_mode, rhs_value)
- tree lhs_mode, rhs_value;
-{
- tree lhs_size, rhs_size, cond;
- tree rhs_mode = TREE_TYPE (rhs_value);
- int lhs_varying = chill_varying_type_p (lhs_mode);
-
- if (lhs_varying)
- lhs_size = size_in_bytes (CH_VARYING_ARRAY_TYPE (lhs_mode));
- else if (CH_BOOLS_TYPE_P (lhs_mode))
- lhs_size = TYPE_MAX_VALUE (TYPE_DOMAIN (lhs_mode));
- else
- lhs_size = size_in_bytes (lhs_mode);
- lhs_size = convert (chill_unsigned_type_node, lhs_size);
-
- if (rhs_mode && TREE_CODE (rhs_mode) == REFERENCE_TYPE)
- rhs_mode = TREE_TYPE (rhs_mode);
- if (rhs_mode == NULL_TREE)
- {
- /* actually, count constructor's length */
- abort ();
- }
- else if (chill_varying_type_p (rhs_mode))
- rhs_size = build_component_ref (rhs_value, var_length_id);
- else if (CH_BOOLS_TYPE_P (rhs_mode))
- rhs_size = TYPE_MAX_VALUE (TYPE_DOMAIN (rhs_mode));
- else
- rhs_size = size_in_bytes (rhs_mode);
- rhs_size = convert (chill_unsigned_type_node, rhs_size);
-
- /* validity condition */
- cond = fold (build (lhs_varying ? GE_EXPR : EQ_EXPR,
- boolean_type_node, lhs_size, rhs_size));
- return cond;
-}
-
-/*
- * take a basic CHILL type and wrap it in a VARYING structure.
- * Be sure the length field is initialized. Return the wrapper.
- */
-tree
-build_varying_struct (type)
- tree type;
-{
- tree decl1, decl2, result;
-
- if (type == NULL_TREE || TREE_CODE (type) == ERROR_MARK)
- return error_mark_node;
-
- decl1 = build_decl (FIELD_DECL, var_length_id, chill_integer_type_node);
- decl2 = build_decl (FIELD_DECL, var_data_id, type);
- TREE_CHAIN (decl1) = decl2;
- TREE_CHAIN (decl2) = NULL_TREE;
- result = build_chill_struct_type (decl1);
-
- /* mark this so we don't complain about missing initializers.
- It's fine for a VARYING array to be partially initialized.. */
- C_TYPE_VARIABLE_SIZE(type) = 1;
- return result;
-}
-
-
-/*
- * This is the struct type that forms the runtime initializer
- * list. There's at least one of these generated per module.
- * It's attached to the global initializer list by the module's
- * 'constructor' code. Should only be called in pass 2.
- */
-tree
-build_init_struct ()
-{
- tree decl1, decl2, result;
- /* We temporarily reset the maximum_field_alignment to zero so the
- compiler's init data structures can be compatible with the
- run-time system, even when we're compiling with -fpack. */
- unsigned int save_maximum_field_alignment = maximum_field_alignment;
- maximum_field_alignment = 0;
-
- decl1 = build_decl (FIELD_DECL, get_identifier ("__INIT_ENTRY"),
- build_chill_pointer_type (
- build_function_type (void_type_node, NULL_TREE)));
-
- decl2 = build_decl (FIELD_DECL, get_identifier ("__INIT_NEXT"),
- build_chill_pointer_type (void_type_node));
-
- TREE_CHAIN (decl1) = decl2;
- TREE_CHAIN (decl2) = NULL_TREE;
- result = build_chill_struct_type (decl1);
- maximum_field_alignment = save_maximum_field_alignment;
- return result;
-}
-
-
-/*
- * Return 1 if the given type is a single-bit boolean set,
- * in which the domain's min and max values
- * are both zero,
- * 0 if not. This can become a macro later..
- */
-int
-ch_singleton_set (type)
- tree type;
-{
- if (type == NULL_TREE || TREE_CODE (type) == ERROR_MARK)
- return 0;
- if (TREE_CODE (type) != SET_TYPE)
- return 0;
- if (TREE_TYPE (type) == NULL_TREE
- || TREE_CODE (TREE_TYPE (type)) != BOOLEAN_TYPE)
- return 0;
- if (TYPE_DOMAIN (type) == NULL_TREE)
- return 0;
- if (! tree_int_cst_equal (TYPE_MIN_VALUE (TYPE_DOMAIN (type)),
- integer_zero_node))
- return 0;
- if (! tree_int_cst_equal (TYPE_MAX_VALUE (TYPE_DOMAIN (type)),
- integer_zero_node))
- return 0;
- return 1;
-}
-
-/* return non-zero if TYPE is a compiler-generated VARYING
- array of some base type */
-int
-chill_varying_type_p (type)
- tree type;
-{
- if (type == NULL_TREE)
- return 0;
- if (TREE_CODE (type) != RECORD_TYPE)
- return 0;
- if (TYPE_FIELDS (type) == NULL_TREE
- || TREE_CHAIN (TYPE_FIELDS (type)) == NULL_TREE)
- return 0;
- if (DECL_NAME (TYPE_FIELDS (type)) != var_length_id)
- return 0;
- if (DECL_NAME (TREE_CHAIN (TYPE_FIELDS (type))) != var_data_id)
- return 0;
- if (TREE_CHAIN (TREE_CHAIN (TYPE_FIELDS (type))) != NULL_TREE)
- return 0;
- return 1;
-}
-
-/* return non-zero if TYPE is a compiler-generated VARYING
- string record */
-int
-chill_varying_string_type_p (type)
- tree type;
-{
- tree var_data_type;
-
- if (!chill_varying_type_p (type))
- return 0;
-
- var_data_type = CH_VARYING_ARRAY_TYPE (type);
- return CH_CHARS_TYPE_P (var_data_type);
-}
-
-/* swiped from c-typeck.c */
-/* Build an assignment expression of lvalue LHS from value RHS. */
-
-tree
-build_chill_modify_expr (lhs, rhs)
- tree lhs, rhs;
-{
- register tree result;
-
-
- tree lhstype = TREE_TYPE (lhs);
-
- /* Avoid duplicate error messages from operands that had errors. */
- if (lhs == NULL_TREE || TREE_CODE (lhs) == ERROR_MARK || rhs == NULL_TREE || TREE_CODE (rhs) == ERROR_MARK)
- return error_mark_node;
-
- /* Strip NON_LVALUE_EXPRs since we aren't using as an lvalue. */
- /* Do not use STRIP_NOPS here. We do not want an enumerator
- whose value is 0 to count as a null pointer constant. */
- if (TREE_CODE (rhs) == NON_LVALUE_EXPR)
- rhs = TREE_OPERAND (rhs, 0);
-
-#if 0
- /* Handle a cast used as an "lvalue".
- We have already performed any binary operator using the value as cast.
- Now convert the result to the cast type of the lhs,
- and then true type of the lhs and store it there;
- then convert result back to the cast type to be the value
- of the assignment. */
-
- switch (TREE_CODE (lhs))
- {
- case NOP_EXPR:
- case CONVERT_EXPR:
- case FLOAT_EXPR:
- case FIX_TRUNC_EXPR:
- case FIX_FLOOR_EXPR:
- case FIX_ROUND_EXPR:
- case FIX_CEIL_EXPR:
- {
- tree inner_lhs = TREE_OPERAND (lhs, 0);
- tree result;
- result = build_chill_modify_expr (inner_lhs,
- convert (TREE_TYPE (inner_lhs),
- convert (lhstype, rhs)));
- pedantic_lvalue_warning (CONVERT_EXPR);
- return convert (TREE_TYPE (lhs), result);
- }
- }
-
- /* Now we have handled acceptable kinds of LHS that are not truly lvalues.
- Reject anything strange now. */
-
- if (!lvalue_or_else (lhs, "assignment"))
- return error_mark_node;
-#endif
- /* FIXME: need to generate a RANGEFAIL if the RHS won't
- fit into the LHS. */
-
- if (TREE_CODE (lhs) != VAR_DECL
- && ((TREE_CODE (TREE_TYPE (lhs)) == ARRAY_TYPE &&
- (TREE_TYPE (rhs) && TREE_CODE (TREE_TYPE (rhs)) == ARRAY_TYPE)) ||
- chill_varying_type_p (TREE_TYPE (lhs)) ||
- chill_varying_type_p (TREE_TYPE (rhs))))
- {
- int lhs_varying = chill_varying_type_p (TREE_TYPE (lhs));
- int rhs_varying = chill_varying_type_p (TREE_TYPE (rhs));
-
- /* point at actual RHS data's type */
- tree rhs_data_type = rhs_varying ?
- CH_VARYING_ARRAY_TYPE (TREE_TYPE (rhs)) :
- TREE_TYPE (rhs);
- {
- /* point at actual LHS data's type */
- tree lhs_data_type = lhs_varying ?
- CH_VARYING_ARRAY_TYPE (TREE_TYPE (lhs)) :
- TREE_TYPE (lhs);
-
- int lhs_bytes = int_size_in_bytes (lhs_data_type);
- int rhs_bytes = int_size_in_bytes (rhs_data_type);
-
- /* if both sides not varying, and sizes not dynamically
- computed, sizes must *match* */
- if (! lhs_varying && ! rhs_varying && lhs_bytes != rhs_bytes
- && lhs_bytes > 0 && rhs_bytes > 0)
- {
- error ("string lengths not equal");
- return error_mark_node;
- }
- /* Must have enough space on LHS for static size of RHS */
-
- if (lhs_bytes > 0 && rhs_bytes > 0
- && lhs_bytes < rhs_bytes)
- {
- if (rhs_varying)
- {
- /* FIXME: generate runtime test for room */
- ;
- }
- else
- {
- error ("can't do ARRAY assignment - too large");
- return error_mark_node;
- }
- }
- }
-
- /* now we know the RHS will fit in LHS, build trees for the
- emit_block_move parameters */
-
- if (lhs_varying)
- rhs = convert (TREE_TYPE (lhs), rhs);
- else
- {
- if (rhs_varying)
- rhs = build_component_ref (rhs, var_data_id);
-
- if (! mark_addressable (rhs))
- {
- error ("rhs of array assignment is not addressable");
- return error_mark_node;
- }
-
- lhs = force_addr_of (lhs);
- rhs = build1 (ADDR_EXPR, const_ptr_type_node, rhs);
- return
- build_chill_function_call (lookup_name (get_identifier ("memmove")),
- tree_cons (NULL_TREE, lhs,
- tree_cons (NULL_TREE, rhs,
- tree_cons (NULL_TREE, size_in_bytes (rhs_data_type),
- NULL_TREE))));
- }
- }
-
- result = build (MODIFY_EXPR, lhstype, lhs, rhs);
- TREE_SIDE_EFFECTS (result) = 1;
-
- return result;
-}
-
-/* Constructors for pointer, array and function types.
- (RECORD_TYPE, UNION_TYPE and ENUMERAL_TYPE nodes are
- constructed by language-dependent code, not here.) */
-
-/* Construct, lay out and return the type of pointers to TO_TYPE.
- If such a type has already been constructed, reuse it. */
-
-static tree
-make_chill_pointer_type (to_type, code)
- tree to_type;
- enum tree_code code; /* POINTER_TYPE or REFERENCE_TYPE */
-{
- extern struct obstack *current_obstack;
- extern struct obstack *saveable_obstack;
- extern struct obstack permanent_obstack;
- tree t;
- register struct obstack *ambient_obstack = current_obstack;
- register struct obstack *ambient_saveable_obstack = saveable_obstack;
-
- /* If TO_TYPE is permanent, make this permanent too. */
- if (TREE_PERMANENT (to_type))
- {
- current_obstack = &permanent_obstack;
- saveable_obstack = &permanent_obstack;
- }
-
- t = make_node (code);
- TREE_TYPE (t) = to_type;
-
- current_obstack = ambient_obstack;
- saveable_obstack = ambient_saveable_obstack;
- return t;
-}
-
-
-tree
-build_chill_pointer_type (to_type)
- tree to_type;
-{
- int is_type_node = TREE_CODE_CLASS (TREE_CODE (to_type)) == 't';
- register tree t = is_type_node ? TYPE_POINTER_TO (to_type) : NULL_TREE;
-
- /* First, if we already have a type for pointers to TO_TYPE, use it. */
-
- if (t)
- return t;
-
- /* We need a new one. */
- t = make_chill_pointer_type (to_type, POINTER_TYPE);
-
- /* Lay out the type. This function has many callers that are concerned
- with expression-construction, and this simplifies them all.
- Also, it guarantees the TYPE_SIZE is permanent if the type is. */
- if ((is_type_node && (TYPE_SIZE (to_type) != NULL_TREE))
- || pass == 2)
- {
- /* Record this type as the pointer to TO_TYPE. */
- TYPE_POINTER_TO (to_type) = t;
- layout_type (t);
- }
-
- return t;
-}
-
-tree
-build_chill_reference_type (to_type)
- tree to_type;
-{
- int is_type_node = TREE_CODE_CLASS (TREE_CODE (to_type)) == 't';
- register tree t = is_type_node ? TYPE_REFERENCE_TO (to_type) : NULL_TREE;
-
- /* First, if we already have a type for references to TO_TYPE, use it. */
-
- if (t)
- return t;
-
- /* We need a new one. */
- t = make_chill_pointer_type (to_type, REFERENCE_TYPE);
-
- /* Lay out the type. This function has many callers that are concerned
- with expression-construction, and this simplifies them all.
- Also, it guarantees the TYPE_SIZE is permanent if the type is. */
- if ((is_type_node && (TYPE_SIZE (to_type) != NULL_TREE))
- || pass == 2)
- {
- /* Record this type as the reference to TO_TYPE. */
- TYPE_REFERENCE_TO (to_type) = t;
- layout_type (t);
- CH_NOVELTY (t) = CH_NOVELTY (to_type);
- }
-
- return t;
-}
-
-static tree
-make_chill_range_type (type, lowval, highval)
- tree type, lowval, highval;
-{
- register tree itype = make_node (INTEGER_TYPE);
- TREE_TYPE (itype) = type;
- TYPE_MIN_VALUE (itype) = lowval;
- TYPE_MAX_VALUE (itype) = highval;
- return itype;
-}
-
-
-/* Return the minimum number of bits needed to represent VALUE in a
- signed or unsigned type, UNSIGNEDP says which. */
-
-static unsigned int
-min_precision (value, unsignedp)
- tree value;
- int unsignedp;
-{
- int log;
-
- /* If the value is negative, compute its negative minus 1. The latter
- adjustment is because the absolute value of the largest negative value
- is one larger than the largest positive value. This is equivalent to
- a bit-wise negation, so use that operation instead. */
-
- if (tree_int_cst_sgn (value) < 0)
- value = fold (build1 (BIT_NOT_EXPR, TREE_TYPE (value), value));
-
- /* Return the number of bits needed, taking into account the fact
- that we need one more bit for a signed than unsigned type. */
-
- if (integer_zerop (value))
- log = 0;
- else
- log = tree_floor_log2 (value);
-
- return log + 1 + ! unsignedp;
-}
-
-tree
-layout_chill_range_type (rangetype, must_be_const)
- tree rangetype;
- int must_be_const;
-{
- tree type = TREE_TYPE (rangetype);
- tree lowval = TYPE_MIN_VALUE (rangetype);
- tree highval = TYPE_MAX_VALUE (rangetype);
- int bad_limits = 0;
-
- if (TYPE_SIZE (rangetype) != NULL_TREE)
- return rangetype;
-
- /* process BIN */
- if (type == ridpointers[(int) RID_BIN])
- {
- int binsize;
-
- /* Make a range out of it */
- if (TREE_CODE (highval) != INTEGER_CST)
- {
- error ("non-constant expression for BIN");
- return error_mark_node;
- }
- else if (tree_int_cst_sgn (highval) < 0)
- {
- error ("expression for BIN must not be negative");
- return error_mark_node;
- }
- else if (compare_tree_int (highval, 32) > 0)
- {
- error ("cannot process BIN (>32)");
- return error_mark_node;
- }
-
- binsize = tree_low_cst (highval, 1);
- type = ridpointers [(int) RID_RANGE];
- lowval = integer_zero_node;
- highval = build_int_2 ((1 << binsize) - 1, 0);
- }
-
- if (TREE_CODE (lowval) == ERROR_MARK
- || TREE_CODE (highval) == ERROR_MARK)
- return error_mark_node;
-
- if (!CH_COMPATIBLE_CLASSES (lowval, highval))
- {
- error ("bounds of range are not compatible");
- return error_mark_node;
- }
-
- if (type == string_index_type_dummy)
- {
- if (TREE_CODE (highval) == INTEGER_CST
- && compare_int_csts (LT_EXPR, highval, integer_minus_one_node))
- {
- error ("negative string length");
- highval = integer_minus_one_node;
- }
- if (compare_int_csts (EQ_EXPR, highval, integer_minus_one_node))
- type = integer_type_node;
- else
- type = sizetype;
- TREE_TYPE (rangetype) = type;
- }
- else if (type == ridpointers[(int) RID_RANGE])
- {
- /* This isn't 100% right, since the Blue Book definition
- uses Resulting Class, rather than Resulting Mode,
- but it's close enough. */
- type = CH_ROOT_RESULTING_CLASS (lowval, highval).mode;
-
- /* The default TYPE is the type of the constants -
- except if the constants are integers, we choose an
- integer type that fits. */
- if (TREE_CODE (type) == INTEGER_TYPE
- && TREE_CODE (lowval) == INTEGER_CST
- && TREE_CODE (highval) == INTEGER_CST)
- {
- int unsignedp = tree_int_cst_sgn (lowval) >= 0;
- unsigned int precision = MAX (min_precision (highval, unsignedp),
- min_precision (lowval, unsignedp));
-
- type = type_for_size (precision, unsignedp);
-
- }
-
- TREE_TYPE (rangetype) = type;
- }
- else
- {
- if (!CH_COMPATIBLE (lowval, type))
- {
- error ("range's lower bound and parent mode don't match");
- return integer_type_node; /* an innocuous fake */
- }
- if (!CH_COMPATIBLE (highval, type))
- {
- error ("range's upper bound and parent mode don't match");
- return integer_type_node; /* an innocuous fake */
- }
- }
-
- if (TREE_CODE (type) == ERROR_MARK)
- return type;
- else if (TREE_CODE_CLASS (TREE_CODE (type)) != 't')
- {
- error ("making range from non-mode");
- return error_mark_node;
- }
-
- if (TREE_CODE (lowval) == REAL_CST || TREE_CODE (highval) == REAL_CST)
- {
- sorry ("floating point ranges");
- return integer_type_node; /* another fake */
- }
-
- if (TREE_CODE (lowval) != INTEGER_CST || TREE_CODE (highval) != INTEGER_CST)
- {
- if (must_be_const)
- {
- error ("range mode has non-constant limits");
- bad_limits = 1;
- }
- }
- else if (tree_int_cst_equal (lowval, integer_zero_node)
- && tree_int_cst_equal (highval, integer_minus_one_node))
- ; /* do nothing - this is the index type for an empty string */
- else if (compare_int_csts (LT_EXPR, highval, TYPE_MIN_VALUE (type)))
- {
- error ("range's high bound < mode's low bound");
- bad_limits = 1;
- }
- else if (compare_int_csts (GT_EXPR, highval, TYPE_MAX_VALUE (type)))
- {
- error ("range's high bound > mode's high bound");
- bad_limits = 1;
- }
- else if (compare_int_csts (LT_EXPR, highval, lowval))
- {
- error ("range mode high bound < range mode low bound");
- bad_limits = 1;
- }
- else if (compare_int_csts (LT_EXPR, lowval, TYPE_MIN_VALUE (type)))
- {
- error ("range's low bound < mode's low bound");
- bad_limits = 1;
- }
- else if (compare_int_csts (GT_EXPR, lowval, TYPE_MAX_VALUE (type)))
- {
- error ("range's low bound > mode's high bound");
- bad_limits = 1;
- }
-
- if (bad_limits)
- {
- lowval = TYPE_MIN_VALUE (type);
- highval = lowval;
- }
-
- highval = convert (type, highval);
- lowval = convert (type, lowval);
- TYPE_MIN_VALUE (rangetype) = lowval;
- TYPE_MAX_VALUE (rangetype) = highval;
- TYPE_PRECISION (rangetype) = TYPE_PRECISION (type);
- TYPE_MODE (rangetype) = TYPE_MODE (type);
- TYPE_SIZE (rangetype) = TYPE_SIZE (type);
- TYPE_SIZE_UNIT (rangetype) = TYPE_SIZE_UNIT (type);
- TYPE_ALIGN (rangetype) = TYPE_ALIGN (type);
- TYPE_USER_ALIGN (rangetype) = TYPE_USER_ALIGN (type);
- TREE_UNSIGNED (rangetype) = TREE_UNSIGNED (type);
- CH_NOVELTY (rangetype) = CH_NOVELTY (type);
- return rangetype;
-}
-
-/* Build a _TYPE node that has range bounds associated with its values.
- TYPE is the base type for the range type. */
-tree
-build_chill_range_type (type, lowval, highval)
- tree type, lowval, highval;
-{
- tree rangetype;
-
- if (type == NULL_TREE)
- type = ridpointers[(int) RID_RANGE];
- else if (TREE_CODE (type) == ERROR_MARK)
- return error_mark_node;
-
- rangetype = make_chill_range_type (type, lowval, highval);
- if (pass != 1)
- rangetype = layout_chill_range_type (rangetype, 0);
-
- return rangetype;
-}
-
-/* Build a CHILL array type, but with minimal checking etc. */
-
-tree
-build_simple_array_type (type, idx, layout)
- tree type, idx, layout;
-{
- tree array_type = make_node (ARRAY_TYPE);
- TREE_TYPE (array_type) = type;
- TYPE_DOMAIN (array_type) = idx;
- TYPE_ATTRIBUTES (array_type) = layout;
- if (pass != 1)
- array_type = layout_chill_array_type (array_type);
- return array_type;
-}
-
-static void
-apply_chill_array_layout (array_type)
- tree array_type;
-{
- tree layout, temp, what, element_type;
- HOST_WIDE_INT stepsize = 0;
- HOST_WIDE_INT word, start_bit = 0, length;
- HOST_WIDE_INT natural_length;
- int stepsize_specified;
- int start_bit_error = 0;
- int length_error = 0;
-
- layout = TYPE_ATTRIBUTES (array_type);
- if (layout == NULL_TREE)
- return;
-
- if (layout == integer_zero_node) /* NOPACK */
- {
- TYPE_PACKED (array_type) = 0;
- return;
- }
-
- /* Allow for the packing of 1 bit discrete modes at the bit level. */
- element_type = TREE_TYPE (array_type);
- if (discrete_type_p (element_type)
- && get_type_precision (TYPE_MIN_VALUE (element_type),
- TYPE_MAX_VALUE (element_type)) == 1)
- natural_length = 1;
- else if (host_integerp (TYPE_SIZE (element_type), 1))
- natural_length = tree_low_cst (TYPE_SIZE (element_type), 1);
- else
- natural_length = -1;
-
- if (layout == integer_one_node) /* PACK */
- {
- if (natural_length == 1)
- TYPE_PACKED (array_type) = 1;
- return;
- }
-
- /* The layout is a STEP (...).
- The current implementation restricts STEP specifications to be of the form
- STEP(POS(0,0,n),n) where n is the natural size of the element mode. */
- stepsize_specified = 0;
- temp = TREE_VALUE (layout);
- if (TREE_VALUE (temp) != NULL_TREE)
- {
- if (! host_integerp (TREE_VALUE (temp), 0))
- error ("Stepsize in STEP must be an integer constant");
- else
- {
- if (tree_int_cst_sgn (TREE_VALUE (temp)) <= 0)
- error ("Stepsize in STEP must be > 0");
- else
- stepsize_specified = 1;
-
- stepsize = tree_low_cst (TREE_VALUE (temp), 1);
- if (stepsize != natural_length)
- sorry ("Stepsize in STEP must be the natural width of the array element mode");
- }
- }
-
- temp = TREE_PURPOSE (temp);
- if (! host_integerp (TREE_PURPOSE (temp), 0))
- error ("Starting word in POS must be an integer constant");
- else
- {
- if (tree_int_cst_sgn (TREE_PURPOSE (temp)) < 0)
- error ("Starting word in POS must be >= 0");
- if (! integer_zerop (TREE_PURPOSE (temp)))
- sorry ("Starting word in POS within STEP must be 0");
-
- word = tree_low_cst (TREE_PURPOSE (temp), 0);
- }
-
- length = natural_length;
- temp = TREE_VALUE (temp);
- if (temp != NULL_TREE)
- {
- int wordsize = TYPE_PRECISION (chill_integer_type_node);
- if (! host_integerp (TREE_PURPOSE (temp), 0))
- {
- error ("Starting bit in POS must be an integer constant");
- start_bit_error = 1;
- }
- else
- {
- if (! integer_zerop (TREE_PURPOSE (temp)))
- sorry ("Starting bit in POS within STEP must be 0");
-
- if (tree_int_cst_sgn (TREE_PURPOSE (temp)) < 0)
- {
- error ("Starting bit in POS must be >= 0");
- start_bit = 0;
- start_bit_error = 1;
- }
-
- start_bit = tree_low_cst (TREE_PURPOSE (temp), 0);
- if (start_bit >= wordsize)
- {
- error ("Starting bit in POS must be < the width of a word");
- start_bit = 0;
- start_bit_error = 1;
- }
- }
-
- temp = TREE_VALUE (temp);
- if (temp != NULL_TREE)
- {
- what = TREE_PURPOSE (temp);
- if (what == integer_zero_node)
- {
- if (! host_integerp (TREE_VALUE (temp), 0))
- {
- error ("Length in POS must be an integer constant");
- length_error = 1;
- }
- else
- {
- length = tree_low_cst (TREE_VALUE (temp), 0);
- if (length <= 0)
- error ("Length in POS must be > 0");
- }
- }
- else
- {
- if (! host_integerp (TREE_VALUE (temp), 0))
- {
- error ("End bit in POS must be an integer constant");
- length_error = 1;
- }
- else
- {
- HOST_WIDE_INT end_bit = tree_low_cst (TREE_VALUE (temp), 0);
-
- if (end_bit < start_bit)
- {
- error ("End bit in POS must be >= the start bit");
- end_bit = wordsize - 1;
- length_error = 1;
- }
- else if (end_bit >= wordsize)
- {
- error ("End bit in POS must be < the width of a word");
- end_bit = wordsize - 1;
- length_error = 1;
- }
- else if (start_bit_error)
- length_error = 1;
- else
- length = end_bit - start_bit + 1;
- }
- }
-
- if (! length_error && length != natural_length)
- sorry ("The length specified on POS within STEP must be the natural length of the array element type");
- }
- }
-
- if (! length_error && stepsize_specified && stepsize < length)
- error ("Step size in STEP must be >= the length in POS");
-
- if (length == 1)
- TYPE_PACKED (array_type) = 1;
-}
-
-tree
-layout_chill_array_type (array_type)
- tree array_type;
-{
- tree itype;
- tree element_type = TREE_TYPE (array_type);
-
- if (TREE_CODE (element_type) == ARRAY_TYPE
- && TYPE_SIZE (element_type) == 0)
- layout_chill_array_type (element_type);
-
- itype = TYPE_DOMAIN (array_type);
-
- if (TREE_CODE (itype) == ERROR_MARK
- || TREE_CODE (element_type) == ERROR_MARK)
- return error_mark_node;
-
- /* do a lower/upper bound check. */
- if (TREE_CODE (itype) == INTEGER_CST)
- {
- error ("array index must be a range, not a single integer");
- return error_mark_node;
- }
- if (TREE_CODE_CLASS (TREE_CODE (itype)) != 't'
- || !discrete_type_p (itype))
- {
- error ("array index is not a discrete mode");
- return error_mark_node;
- }
-
- /* apply the array layout, if specified. */
- apply_chill_array_layout (array_type);
- TYPE_ATTRIBUTES (array_type) = NULL_TREE;
-
- /* Make sure TYPE_POINTER_TO (element_type) is filled in. */
- build_pointer_type (element_type);
-
- if (TYPE_SIZE (array_type) == 0)
- layout_type (array_type);
-
- if (TYPE_READONLY_PROPERTY (element_type))
- TYPE_FIELDS_READONLY (array_type) = 1;
-
- TYPE_ARRAY_MAX_SIZE (array_type) = size_in_bytes (array_type);
- return array_type;
-}
-
-/* Build a CHILL array type.
-
- TYPE is the element type of the array.
- IDXLIST is the list of dimensions of the array.
- VARYING_P is non-zero if the array is a varying array.
- LAYOUT is (NULL_TREE, integer_one_node, integer_zero_node, tree_list),
- meaning (default, pack, nopack, STEP (...) ). */
-tree
-build_chill_array_type (type, idxlist, varying_p, layouts)
- tree type, idxlist;
- int varying_p;
- tree layouts;
-{
- tree array_type = type;
-
- if (type == NULL_TREE || TREE_CODE (type) == ERROR_MARK)
- return error_mark_node;
- if (idxlist == NULL_TREE || TREE_CODE (idxlist) == ERROR_MARK)
- return error_mark_node;
-
- /* We have to walk down the list of index decls, building inner
- array types as we go. We need to reverse the list of layouts so that the
- first layout applies to the last index etc. */
- layouts = nreverse (layouts);
- for ( ; idxlist; idxlist = TREE_CHAIN (idxlist))
- {
- if (layouts != NULL_TREE)
- {
- type = build_simple_array_type (
- type, TREE_VALUE (idxlist), TREE_VALUE (layouts));
- layouts = TREE_CHAIN (layouts);
- }
- else
- type = build_simple_array_type (type, TREE_VALUE (idxlist), NULL_TREE);
- }
- array_type = type;
- if (varying_p)
- array_type = build_varying_struct (array_type);
- return array_type;
-}
-
-/* Function to help qsort sort FIELD_DECLs by name order. */
-
-static int
-field_decl_cmp (x, y)
- tree *x, *y;
-{
- return (long)DECL_NAME (*x) - (long)DECL_NAME (*y);
-}
-
-static tree
-make_chill_struct_type (fieldlist)
- tree fieldlist;
-{
- tree t, x;
-
- t = make_node (TREE_UNION_ELEM (fieldlist) ? UNION_TYPE : RECORD_TYPE);
-
- /* Install struct as DECL_CONTEXT of each field decl. */
- for (x = fieldlist; x; x = TREE_CHAIN (x))
- DECL_CONTEXT (x) = t;
-
- /* Delete all duplicate fields from the fieldlist */
- for (x = fieldlist; x && TREE_CHAIN (x);)
- /* Anonymous fields aren't duplicates. */
- if (DECL_NAME (TREE_CHAIN (x)) == 0)
- x = TREE_CHAIN (x);
- else
- {
- register tree y = fieldlist;
-
- while (1)
- {
- if (DECL_NAME (y) == DECL_NAME (TREE_CHAIN (x)))
- break;
- if (y == x)
- break;
- y = TREE_CHAIN (y);
- }
- if (DECL_NAME (y) == DECL_NAME (TREE_CHAIN (x)))
- {
- error_with_decl (TREE_CHAIN (x), "duplicate member `%s'");
- TREE_CHAIN (x) = TREE_CHAIN (TREE_CHAIN (x));
- }
- else x = TREE_CHAIN (x);
- }
-
- TYPE_FIELDS (t) = fieldlist;
-
- return t;
-}
-
-/* DECL is a FIELD_DECL.
- DECL_INIT (decl) is
- (NULL_TREE, integer_one_node, integer_zero_node, tree_list)
- meaning
- (default, pack, nopack, POS (...) ).
-
- The return value is a boolean: 1 if POS specified, 0 if not */
-
-static int
-apply_chill_field_layout (decl, next_struct_offset)
- tree decl;
- int *next_struct_offset;
-{
- tree layout = DECL_INITIAL (decl);
- tree type = TREE_TYPE (decl);
- tree temp, what;
- HOST_WIDE_INT word = 0;
- HOST_WIDE_INT wordsize, start_bit, offset, length, natural_length;
- int pos_error = 0;
- int is_discrete = discrete_type_p (type);
-
- if (is_discrete)
- natural_length
- = get_type_precision (TYPE_MIN_VALUE (type), TYPE_MAX_VALUE (type));
- else if (host_integerp (TYPE_SIZE (type), 1))
- natural_length = tree_low_cst (TYPE_SIZE (type), 1);
- else
- natural_length = -1;
-
- if (layout == integer_zero_node) /* NOPACK */
- {
- *next_struct_offset += natural_length;
- return 0; /* not POS */
- }
-
- if (layout == integer_one_node) /* PACK */
- {
- if (is_discrete)
- {
- DECL_BIT_FIELD (decl) = 1;
- DECL_SIZE (decl) = bitsize_int (natural_length);
- }
- else
- {
- DECL_ALIGN (decl) = BITS_PER_UNIT;
- DECL_USER_ALIGN (decl) = 0;
- }
-
- DECL_PACKED (decl) = 1;
- *next_struct_offset += natural_length;
- return 0; /* not POS */
- }
-
- /* The layout is a POS (...). The current implementation restricts the use
- of POS to monotonically increasing fields whose width must be the
- natural width of the underlying type. */
- temp = TREE_PURPOSE (layout);
-
- if (! host_integerp (TREE_PURPOSE (temp), 0))
- {
- error ("Starting word in POS must be an integer constant");
- pos_error = 1;
- }
- else
- {
- if (tree_int_cst_sgn (TREE_PURPOSE (temp)) < 0)
- {
- error ("Starting word in POS must be >= 0");
- word = 0;
- pos_error = 1;
- }
- else
- word = tree_low_cst (TREE_PURPOSE (temp), 0);
- }
-
- wordsize = TYPE_PRECISION (chill_integer_type_node);
- offset = word * wordsize;
- length = natural_length;
-
- temp = TREE_VALUE (temp);
- if (temp != NULL_TREE)
- {
- if (! host_integerp (TREE_PURPOSE (temp), 0))
- {
- error ("Starting bit in POS must be an integer constant");
- start_bit = *next_struct_offset - offset;
- pos_error = 1;
- }
- else
- {
- if (tree_int_cst_sgn (TREE_PURPOSE (temp)) < 0)
- {
- error ("Starting bit in POS must be >= 0");
- start_bit = *next_struct_offset - offset;
- pos_error = 1;
- }
-
- start_bit = tree_low_cst (TREE_PURPOSE (temp), 0);
- if (start_bit >= wordsize)
- {
- error ("Starting bit in POS must be < the width of a word");
- start_bit = *next_struct_offset - offset;
- pos_error = 1;
- }
- }
-
- temp = TREE_VALUE (temp);
- if (temp != NULL_TREE)
- {
- what = TREE_PURPOSE (temp);
- if (what == integer_zero_node)
- {
- if (! host_integerp (TREE_VALUE (temp), 0))
- {
- error ("Length in POS must be an integer constant");
- pos_error = 1;
- }
- else
- {
- if (tree_int_cst_sgn (TREE_VALUE (temp)) < 0)
- {
- error ("Length in POS must be > 0");
- length = natural_length;
- pos_error = 1;
- }
- else
- length = tree_low_cst (TREE_VALUE (temp), 0);
-
- }
- }
- else
- {
- if (! host_integerp (TREE_VALUE (temp), 0))
- {
- error ("End bit in POS must be an integer constant");
- pos_error = 1;
- }
- else
- {
- HOST_WIDE_INT end_bit = tree_low_cst (TREE_VALUE (temp), 0);
-
- if (end_bit < start_bit)
- {
- error ("End bit in POS must be >= the start bit");
- pos_error = 1;
- }
- else if (end_bit >= wordsize)
- {
- error ("End bit in POS must be < the width of a word");
- pos_error = 1;
- }
- else
- length = end_bit - start_bit + 1;
- }
- }
-
- if (length != natural_length && ! pos_error)
- {
- sorry ("The length specified on POS must be the natural length of the field type");
- length = natural_length;
- }
- }
-
- offset += start_bit;
- }
-
- if (offset != *next_struct_offset && ! pos_error)
- sorry ("STRUCT fields must be layed out in monotonically increasing order");
-
- DECL_PACKED (decl) = 1;
- DECL_BIT_FIELD (decl) = is_discrete;
-
- if (is_discrete)
- DECL_SIZE (decl) = bitsize_int (length);
-
- *next_struct_offset += natural_length;
-
- return 1; /* was POS */
-}
-
-tree
-layout_chill_struct_type (t)
- tree t;
-{
- tree fieldlist = TYPE_FIELDS (t);
- tree x;
- int old_momentary;
- int was_pos;
- int pos_seen = 0;
- int pos_error = 0;
- int next_struct_offset;
-
- old_momentary = suspend_momentary ();
-
- /* Process specified field sizes. */
- next_struct_offset = 0;
- for (x = fieldlist; x; x = TREE_CHAIN (x))
- {
- /* An EVENT or BUFFER mode is implemented as a RECORD_TYPE
- which may contain a CONST_DECL for the maximum queue size. */
- if (TREE_CODE (x) == CONST_DECL)
- continue;
-
- /* If any field is const, the structure type is pseudo-const. */
- /* A field that is pseudo-const makes the structure likewise. */
- if (TREE_READONLY (x) || TYPE_READONLY_PROPERTY (TREE_TYPE (x)))
- TYPE_FIELDS_READONLY (t) = 1;
-
- /* Any field that is volatile means variables of this type must be
- treated in some ways as volatile. */
- if (TREE_THIS_VOLATILE (x))
- C_TYPE_FIELDS_VOLATILE (t) = 1;
-
- if (DECL_INITIAL (x) != NULL_TREE)
- {
- was_pos = apply_chill_field_layout (x, &next_struct_offset);
- DECL_INITIAL (x) = NULL_TREE;
- }
- else
- {
- unsigned int min_align = TYPE_ALIGN (TREE_TYPE (x));
- DECL_ALIGN (x) = MAX (DECL_ALIGN (x), min_align);
- was_pos = 0;
- }
- if ((! was_pos && pos_seen) || (was_pos && ! pos_seen && x != fieldlist))
- pos_error = 1;
- pos_seen |= was_pos;
- }
-
- if (pos_error)
- error ("If one field has a POS layout, then all fields must have a POS layout");
-
- /* Now DECL_INITIAL is null on all fields. */
-
- layout_type (t);
-
- /* Now we have the truly final field list.
- Store it in this type and in the variants. */
-
- TYPE_FIELDS (t) = fieldlist;
-
- /* If there are lots of fields, sort so we can look through them fast.
- We arbitrarily consider 16 or more elts to be "a lot". */
- {
- int len = 0;
-
- for (x = fieldlist; x; x = TREE_CHAIN (x))
- {
- if (len > 15)
- break;
- len += 1;
- }
- if (len > 15)
- {
- tree *field_array;
- char *space;
-
- len += list_length (x);
- /* Use the same allocation policy here that make_node uses, to
- ensure that this lives as long as the rest of the struct decl.
- All decls in an inline function need to be saved. */
- if (allocation_temporary_p ())
- space = savealloc (sizeof (struct lang_type) + len * sizeof (tree));
- else
- space = oballoc (sizeof (struct lang_type) + len * sizeof (tree));
-
- TYPE_LANG_SPECIFIC (t) = (struct lang_type *) space;
- TYPE_LANG_SPECIFIC (t)->foo.rec.len = len;
-
- field_array = &TYPE_LANG_SPECIFIC (t)->foo.rec.elts[0];
- len = 0;
- for (x = fieldlist; x; x = TREE_CHAIN (x))
- field_array[len++] = x;
-
- qsort (field_array, len, sizeof (tree),
- (int (*) PARAMS ((const void *, const void *))) field_decl_cmp);
- }
- }
-
- for (x = TYPE_MAIN_VARIANT (t); x; x = TYPE_NEXT_VARIANT (x))
- {
- TYPE_FIELDS (x) = TYPE_FIELDS (t);
- TYPE_LANG_SPECIFIC (x) = TYPE_LANG_SPECIFIC (t);
- TYPE_ALIGN (x) = TYPE_ALIGN (t);
- TYPE_USER_ALIGN (x) = TYPE_USER_ALIGN (t);
- }
-
- resume_momentary (old_momentary);
-
- return t;
-}
-
-/* Given a list of fields, FIELDLIST, return a structure
- type that contains these fields. The returned type is
- always a new type. */
-tree
-build_chill_struct_type (fieldlist)
- tree fieldlist;
-{
- register tree t;
-
- if (fieldlist == NULL_TREE || TREE_CODE (fieldlist) == ERROR_MARK)
- return error_mark_node;
-
- t = make_chill_struct_type (fieldlist);
- if (pass != 1)
- t = layout_chill_struct_type (t);
-
-/* pushtag (NULL_TREE, t); */
-
- return t;
-}
-
-/* Fix a LANG_TYPE. These are used for three different uses:
- - representing a 'READ M' (in which case TYPE_READONLY is set);
- - for a NEWMODE or SYNMODE (CH_NOVELTY is set for a NEWMODE); and
- - for a parameterised type (TREE_TYPE points to base type,
- while TYPE_DOMAIN is the parameter or parameter list).
- Called from satisfy. */
-tree
-smash_dummy_type (type)
- tree type;
-{
- /* Save fields that we don't want to copy from ORIGIN. */
- tree origin = TREE_TYPE (type);
- tree main_tree = TYPE_MAIN_VARIANT (origin);
- int save_uid = TYPE_UID (type);
- struct obstack *save_obstack = TYPE_OBSTACK (type);
- tree save_name = TYPE_NAME (type);
- int save_permanent = TREE_PERMANENT (type);
- int save_readonly = TYPE_READONLY (type);
- tree save_novelty = CH_NOVELTY (type);
- tree save_domain = TYPE_DOMAIN (type);
-
- if (origin == NULL_TREE)
- abort ();
-
- if (save_domain)
- {
- if (TREE_CODE (save_domain) == ERROR_MARK)
- return error_mark_node;
- if (origin == char_type_node)
- { /* Old-fashioned CHAR(N) declaration. */
- origin = build_string_type (origin, save_domain);
- }
- else
- { /* Handle parameterised modes. */
- int is_varying = chill_varying_type_p (origin);
- tree new_max = save_domain;
- tree origin_novelty = CH_NOVELTY (origin);
- if (is_varying)
- origin = CH_VARYING_ARRAY_TYPE (origin);
- if (CH_STRING_TYPE_P (origin))
- {
- tree oldindex = TYPE_DOMAIN (origin);
- new_max = check_range (new_max, new_max, NULL_TREE,
- fold (build (PLUS_EXPR, integer_type_node,
- TYPE_MAX_VALUE (oldindex),
- integer_one_node)));
- origin = build_string_type (TREE_TYPE (origin), new_max);
- }
- else if (TREE_CODE (origin) == ARRAY_TYPE)
- {
- tree oldindex = TYPE_DOMAIN (origin);
- tree upper = check_range (new_max, new_max, NULL_TREE,
- TYPE_MAX_VALUE (oldindex));
- tree newindex
- = build_chill_range_type (TREE_TYPE (oldindex),
- TYPE_MIN_VALUE (oldindex), upper);
- origin = build_simple_array_type (TREE_TYPE (origin), newindex, NULL_TREE);
- }
- else if (TREE_CODE (origin) == RECORD_TYPE)
- {
- error ("parameterised structures not implemented");
- return error_mark_node;
- }
- else
- {
- error ("invalid parameterised type");
- return error_mark_node;
- }
-
- SET_CH_NOVELTY (origin, origin_novelty);
- if (is_varying)
- {
- origin = build_varying_struct (origin);
- SET_CH_NOVELTY (origin, origin_novelty);
- }
- }
- save_domain = NULL_TREE;
- }
-
- if (TREE_CODE (origin) == ERROR_MARK)
- return error_mark_node;
-
- *(struct tree_type*)type = *(struct tree_type*)origin;
- /* The following is so that the debug code for
- the copy is different from the original type.
- The two statements usually duplicate each other
- (because they clear fields of the same union),
- but the optimizer should catch that. */
- TYPE_SYMTAB_POINTER (type) = 0;
- TYPE_SYMTAB_ADDRESS (type) = 0;
-
- /* Restore fields that we didn't want copied from ORIGIN. */
- TYPE_UID (type) = save_uid;
- TYPE_OBSTACK (type) = save_obstack;
- TREE_PERMANENT (type) = save_permanent;
- TYPE_NAME (type) = save_name;
-
- TREE_CHAIN (type) = NULL_TREE;
- TYPE_VOLATILE (type) = 0;
- TYPE_POINTER_TO (type) = 0;
- TYPE_REFERENCE_TO (type) = 0;
-
- if (save_readonly)
- { /* TYPE is READ ORIGIN.
- Add this type to the chain of variants of TYPE. */
- TYPE_NEXT_VARIANT (type) = TYPE_NEXT_VARIANT (main_tree);
- TYPE_NEXT_VARIANT (main_tree) = type;
- TYPE_READONLY (type) = save_readonly;
- }
- else
- {
- /* TYPE is the copy of the RHS in a NEWMODE or SYNMODE.
- We also get here after old-fashioned CHAR(N) declaration (see above). */
- TYPE_MAIN_VARIANT (type) = type;
- TYPE_NEXT_VARIANT (type) = NULL_TREE;
- if (save_name)
- DECL_ORIGINAL_TYPE (save_name) = origin;
-
- if (save_novelty != NULL_TREE) /* A NEWMODE declaration. */
- {
- CH_NOVELTY (type) = save_novelty;
-
- /* Z.200: "If the DEFINING mode of the NEWMODE name is a range mode,
- then the virtual mode &name is introduced as the PARENT mode
- of the NEWMODE name. The DEFINING mode of &name is the PARENT
- mode of the range mode, and the NOVELTY of &name is that of
- the NEWMODE name." */
-
- if (TREE_CODE (type) == INTEGER_TYPE && TREE_TYPE (type))
- {
- tree parent;
- /* PARENT is the virtual mode &name mentioned above. */
- push_obstacks_nochange ();
- end_temporary_allocation ();
- parent = copy_novelty (save_novelty,TREE_TYPE (type));
- pop_obstacks ();
-
- TREE_TYPE (type) = parent;
- TYPE_MIN_VALUE (type) = convert (parent, TYPE_MIN_VALUE (type));
- TYPE_MAX_VALUE (type) = convert (parent, TYPE_MAX_VALUE (type));
- }
- }
- }
- return type;
-}
-
-/* This generates a LANG_TYPE node that represents 'READ TYPE'. */
-
-tree
-build_readonly_type (type)
- tree type;
-{
- tree node = make_node (LANG_TYPE);
- TREE_TYPE (node) = type;
- TYPE_READONLY (node) = 1;
- if (pass != 1)
- node = smash_dummy_type (node);
- return node;
-}
-
-
-/* Return an unsigned type the same as TYPE in other respects. */
-
-tree
-unsigned_type (type)
- tree type;
-{
- tree type1 = TYPE_MAIN_VARIANT (type);
- if (type1 == signed_char_type_node || type1 == char_type_node)
- return unsigned_char_type_node;
- if (type1 == integer_type_node)
- return unsigned_type_node;
- if (type1 == short_integer_type_node)
- return short_unsigned_type_node;
- if (type1 == long_integer_type_node)
- return long_unsigned_type_node;
- if (type1 == long_long_integer_type_node)
- return long_long_unsigned_type_node;
-
- return signed_or_unsigned_type (1, type);
-}
-
-/* Return a signed type the same as TYPE in other respects. */
-
-tree
-signed_type (type)
- tree type;
-{
- tree type1 = TYPE_MAIN_VARIANT (type);
- while (TREE_CODE (type1) == INTEGER_TYPE && TREE_TYPE (type1) != NULL_TREE)
- type1 = TREE_TYPE (type1);
- if (type1 == unsigned_char_type_node || type1 == char_type_node)
- return signed_char_type_node;
- if (type1 == unsigned_type_node)
- return integer_type_node;
- if (type1 == short_unsigned_type_node)
- return short_integer_type_node;
- if (type1 == long_unsigned_type_node)
- return long_integer_type_node;
- if (type1 == long_long_unsigned_type_node)
- return long_long_integer_type_node;
- if (TYPE_PRECISION (type1) == 1)
- return signed_boolean_type_node;
-
- return signed_or_unsigned_type (0, type);
-}
-
-/* Return a type the same as TYPE except unsigned or
- signed according to UNSIGNEDP. */
-
-tree
-signed_or_unsigned_type (unsignedp, type)
- int unsignedp;
- tree type;
-{
- if (! INTEGRAL_TYPE_P (type)
- || TREE_UNSIGNED (type) == unsignedp)
- return type;
-
- if (TYPE_PRECISION (type) == TYPE_PRECISION (signed_char_type_node))
- return unsignedp ? unsigned_char_type_node : signed_char_type_node;
- if (TYPE_PRECISION (type) == TYPE_PRECISION (integer_type_node))
- return unsignedp ? unsigned_type_node : integer_type_node;
- if (TYPE_PRECISION (type) == TYPE_PRECISION (short_integer_type_node))
- return unsignedp ? short_unsigned_type_node : short_integer_type_node;
- if (TYPE_PRECISION (type) == TYPE_PRECISION (long_integer_type_node))
- return unsignedp ? long_unsigned_type_node : long_integer_type_node;
- if (TYPE_PRECISION (type) == TYPE_PRECISION (long_long_integer_type_node))
- return (unsignedp ? long_long_unsigned_type_node
- : long_long_integer_type_node);
- return type;
-}
-
-/* Mark EXP saying that we need to be able to take the
- address of it; it should not be allocated in a register.
- Value is 1 if successful. */
-
-int
-mark_addressable (exp)
- tree exp;
-{
- register tree x = exp;
- while (1)
- switch (TREE_CODE (x))
- {
- case ADDR_EXPR:
- case COMPONENT_REF:
- case ARRAY_REF:
- case REALPART_EXPR:
- case IMAGPART_EXPR:
- x = TREE_OPERAND (x, 0);
- break;
-
- case TRUTH_ANDIF_EXPR:
- case TRUTH_ORIF_EXPR:
- case COMPOUND_EXPR:
- x = TREE_OPERAND (x, 1);
- break;
-
- case COND_EXPR:
- return mark_addressable (TREE_OPERAND (x, 1))
- & mark_addressable (TREE_OPERAND (x, 2));
-
- case CONSTRUCTOR:
- TREE_ADDRESSABLE (x) = 1;
- return 1;
-
- case INDIRECT_REF:
- /* We sometimes add a cast *(TYPE*)&FOO to handle type and mode
- incompatibility problems. Handle this case by marking FOO. */
- if (TREE_CODE (TREE_OPERAND (x, 0)) == NOP_EXPR
- && TREE_CODE (TREE_OPERAND (TREE_OPERAND (x, 0), 0)) == ADDR_EXPR)
- {
- x = TREE_OPERAND (TREE_OPERAND (x, 0), 0);
- break;
- }
- if (TREE_CODE (TREE_OPERAND (x, 0)) == ADDR_EXPR)
- {
- x = TREE_OPERAND (x, 0);
- break;
- }
- return 1;
-
- case VAR_DECL:
- case CONST_DECL:
- case PARM_DECL:
- case RESULT_DECL:
- if (DECL_REGISTER (x) && !TREE_ADDRESSABLE (x)
- && DECL_NONLOCAL (x))
- {
- if (TREE_PUBLIC (x))
- {
- error ("global register variable `%s' used in nested function",
- IDENTIFIER_POINTER (DECL_NAME (x)));
- return 0;
- }
- pedwarn ("register variable `%s' used in nested function",
- IDENTIFIER_POINTER (DECL_NAME (x)));
- }
- else if (DECL_REGISTER (x) && !TREE_ADDRESSABLE (x))
- {
- if (TREE_PUBLIC (x))
- {
- error ("address of global register variable `%s' requested",
- IDENTIFIER_POINTER (DECL_NAME (x)));
- return 0;
- }
-
- /* If we are making this addressable due to its having
- volatile components, give a different error message. Also
- handle the case of an unnamed parameter by not trying
- to give the name. */
-
- else if (C_TYPE_FIELDS_VOLATILE (TREE_TYPE (x)))
- {
- error ("cannot put object with volatile field into register");
- return 0;
- }
-
- pedwarn ("address of register variable `%s' requested",
- IDENTIFIER_POINTER (DECL_NAME (x)));
- }
- put_var_into_stack (x);
-
- /* drops through */
- case FUNCTION_DECL:
- TREE_ADDRESSABLE (x) = 1;
-#if 0 /* poplevel deals with this now. */
- if (DECL_CONTEXT (x) == 0)
- TREE_ADDRESSABLE (DECL_ASSEMBLER_NAME (x)) = 1;
-#endif
- /* drops through */
- default:
- return 1;
- }
-}
-
-/* Return an integer type with BITS bits of precision,
- that is unsigned if UNSIGNEDP is nonzero, otherwise signed. */
-
-tree
-type_for_size (bits, unsignedp)
- unsigned bits;
- int unsignedp;
-{
- if (bits == TYPE_PRECISION (integer_type_node))
- return unsignedp ? unsigned_type_node : integer_type_node;
-
- if (bits == TYPE_PRECISION (signed_char_type_node))
- return unsignedp ? unsigned_char_type_node : signed_char_type_node;
-
- if (bits == TYPE_PRECISION (short_integer_type_node))
- return unsignedp ? short_unsigned_type_node : short_integer_type_node;
-
- if (bits == TYPE_PRECISION (long_integer_type_node))
- return unsignedp ? long_unsigned_type_node : long_integer_type_node;
-
- if (bits == TYPE_PRECISION (long_long_integer_type_node))
- return (unsignedp ? long_long_unsigned_type_node
- : long_long_integer_type_node);
-
- if (bits <= TYPE_PRECISION (intQI_type_node))
- return unsignedp ? unsigned_intQI_type_node : intQI_type_node;
-
- if (bits <= TYPE_PRECISION (intHI_type_node))
- return unsignedp ? unsigned_intHI_type_node : intHI_type_node;
-
- if (bits <= TYPE_PRECISION (intSI_type_node))
- return unsignedp ? unsigned_intSI_type_node : intSI_type_node;
-
- if (bits <= TYPE_PRECISION (intDI_type_node))
- return unsignedp ? unsigned_intDI_type_node : intDI_type_node;
-
-#if HOST_BITS_PER_WIDE_INT >= 64
- if (bits <= TYPE_PRECISION (intTI_type_node))
- return unsignedp ? unsigned_intTI_type_node : intTI_type_node;
-#endif
-
- return 0;
-}
-
-/* Return a data type that has machine mode MODE.
- If the mode is an integer,
- then UNSIGNEDP selects between signed and unsigned types. */
-
-tree
-type_for_mode (mode, unsignedp)
- enum machine_mode mode;
- int unsignedp;
-{
- if ((int)mode == (int)TYPE_MODE (integer_type_node))
- return unsignedp ? unsigned_type_node : integer_type_node;
-
- if ((int)mode == (int)TYPE_MODE (signed_char_type_node))
- return unsignedp ? unsigned_char_type_node : signed_char_type_node;
-
- if ((int)mode == (int)TYPE_MODE (short_integer_type_node))
- return unsignedp ? short_unsigned_type_node : short_integer_type_node;
-
- if ((int)mode == (int)TYPE_MODE (long_integer_type_node))
- return unsignedp ? long_unsigned_type_node : long_integer_type_node;
-
- if ((int)mode == (int)TYPE_MODE (long_long_integer_type_node))
- return unsignedp ? long_long_unsigned_type_node : long_long_integer_type_node;
-
- if ((int)mode == (int)TYPE_MODE (intQI_type_node))
- return unsignedp ? unsigned_intQI_type_node : intQI_type_node;
-
- if ((int)mode == (int)TYPE_MODE (intHI_type_node))
- return unsignedp ? unsigned_intHI_type_node : intHI_type_node;
-
- if ((int)mode == (int)TYPE_MODE (intSI_type_node))
- return unsignedp ? unsigned_intSI_type_node : intSI_type_node;
-
- if ((int)mode == (int)TYPE_MODE (intDI_type_node))
- return unsignedp ? unsigned_intDI_type_node : intDI_type_node;
-
-#if HOST_BITS_PER_WIDE_INT >= 64
- if ((int)mode == (int)TYPE_MODE (intTI_type_node))
- return unsignedp ? unsigned_intTI_type_node : intTI_type_node;
-#endif
-
- if ((int)mode == (int)TYPE_MODE (float_type_node))
- return float_type_node;
-
- if ((int)mode == (int)TYPE_MODE (double_type_node))
- return double_type_node;
-
- if ((int)mode == (int)TYPE_MODE (long_double_type_node))
- return long_double_type_node;
-
- if ((int)mode == (int)TYPE_MODE (build_pointer_type (char_type_node)))
- return build_pointer_type (char_type_node);
-
- if ((int)mode == (int)TYPE_MODE (build_pointer_type (integer_type_node)))
- return build_pointer_type (integer_type_node);
-
- return 0;
-}
diff --git a/gcc/ch/xtypeck.c b/gcc/ch/xtypeck.c
deleted file mode 100644
index 2b9b7b867f4..00000000000
--- a/gcc/ch/xtypeck.c
+++ /dev/null
@@ -1,283 +0,0 @@
-/* Copyright (C) 1992, 1993, 1994, 1998 Free Software Foundation, Inc.
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-
-#if 0
-tree
-build_component_ref (datum, field_name)
- tree datum, field_name;
-{
- return build_chill_component_ref (datum, field_name);
-}
-
-/* Mark EXP saying that we need to be able to take the
- address of it; it should not be allocated in a register.
- Value is 1 if successful. */
-
-int
-mark_addressable (exp)
- tree exp;
-{
- register tree x = exp;
- while (1)
- switch (TREE_CODE (x))
- {
- case ADDR_EXPR:
- case COMPONENT_REF:
- case ARRAY_REF:
- case REALPART_EXPR:
- case IMAGPART_EXPR:
-/* start-sanitize-chill */
- case TRUTH_ANDIF_EXPR:
- case TRUTH_ORIF_EXPR:
- case COMPOUND_EXPR:
-/* end-sanitize-chill */
- x = TREE_OPERAND (x, 0);
- break;
-/* start-sanitize-chill */
-
- case COND_EXPR:
- return mark_addressable (TREE_OPERAND (x, 1))
- & mark_addressable (TREE_OPERAND (x, 2));
-/* end-sanitize-chill */
-
- case CONSTRUCTOR:
- TREE_ADDRESSABLE (x) = 1;
- return 1;
-
- case VAR_DECL:
- case CONST_DECL:
- case PARM_DECL:
- case RESULT_DECL:
- if (DECL_REGISTER (x) && !TREE_ADDRESSABLE (x)
- && DECL_NONLOCAL (x))
- {
- if (TREE_PUBLIC (x))
- {
- error ("global register variable `%s' used in nested function",
- IDENTIFIER_POINTER (DECL_NAME (x)));
- return 0;
- }
- pedwarn ("register variable `%s' used in nested function",
- IDENTIFIER_POINTER (DECL_NAME (x)));
- }
- else if (DECL_REGISTER (x) && !TREE_ADDRESSABLE (x))
- {
- if (TREE_PUBLIC (x))
- {
- error ("address of global register variable `%s' requested",
- IDENTIFIER_POINTER (DECL_NAME (x)));
- return 0;
- }
-
- /* If we are making this addressable due to its having
- volatile components, give a different error message. Also
- handle the case of an unnamed parameter by not trying
- to give the name. */
-
- else if (C_TYPE_FIELDS_VOLATILE (TREE_TYPE (x)))
- {
- error ("cannot put object with volatile field into register");
- return 0;
- }
-
- pedwarn ("address of register variable `%s' requested",
- IDENTIFIER_POINTER (DECL_NAME (x)));
- }
- put_var_into_stack (x);
-
- /* drops in */
- case FUNCTION_DECL:
- TREE_ADDRESSABLE (x) = 1;
-#if 0 /* poplevel deals with this now. */
- if (DECL_CONTEXT (x) == 0)
- TREE_ADDRESSABLE (DECL_ASSEMBLER_NAME (x)) = 1;
-#endif
-
- default:
- return 1;
- }
-}
-
-/* Return an unsigned type the same as TYPE in other respects. */
-
-tree
-unsigned_type (type)
- tree type;
-{
- tree type1 = TYPE_MAIN_VARIANT (type);
- if (type1 == signed_char_type_node || type1 == char_type_node)
- return unsigned_char_type_node;
- if (type1 == integer_type_node)
- return unsigned_type_node;
- if (type1 == short_integer_type_node)
- return short_unsigned_type_node;
- if (type1 == long_integer_type_node)
- return long_unsigned_type_node;
- if (type1 == long_long_integer_type_node)
- return long_long_unsigned_type_node;
- return type;
-}
-
-/* Return a signed type the same as TYPE in other respects. */
-
-tree
-signed_type (type)
- tree type;
-{
- tree type1 = TYPE_MAIN_VARIANT (type);
- if (type1 == unsigned_char_type_node || type1 == char_type_node)
- return signed_char_type_node;
- if (type1 == unsigned_type_node)
- return integer_type_node;
- if (type1 == short_unsigned_type_node)
- return short_integer_type_node;
- if (type1 == long_unsigned_type_node)
- return long_integer_type_node;
- if (type1 == long_long_unsigned_type_node)
- return long_long_integer_type_node;
- return type;
-}
-
-/* Return a type the same as TYPE except unsigned or
- signed according to UNSIGNEDP. */
-
-tree
-signed_or_unsigned_type (unsignedp, type)
- int unsignedp;
- tree type;
-{
- if (! INTEGRAL_TYPE_P (type))
- return type;
- if (TYPE_PRECISION (type) == TYPE_PRECISION (signed_char_type_node))
- return unsignedp ? unsigned_char_type_node : signed_char_type_node;
- if (TYPE_PRECISION (type) == TYPE_PRECISION (integer_type_node))
- return unsignedp ? unsigned_type_node : integer_type_node;
- if (TYPE_PRECISION (type) == TYPE_PRECISION (short_integer_type_node))
- return unsignedp ? short_unsigned_type_node : short_integer_type_node;
- if (TYPE_PRECISION (type) == TYPE_PRECISION (long_integer_type_node))
- return unsignedp ? long_unsigned_type_node : long_integer_type_node;
- if (TYPE_PRECISION (type) == TYPE_PRECISION (long_long_integer_type_node))
- return (unsignedp ? long_long_unsigned_type_node
- : long_long_integer_type_node);
- return type;
-}
-
-extern tree intHI_type_node;
-extern tree intSI_type_node;
-extern tree intDI_type_node;
-
-extern tree unsigned_intHI_type_node;
-extern tree unsigned_intSI_type_node;
-extern tree unsigned_intDI_type_node;
-
-/* Return an integer type with BITS bits of precision,
- that is unsigned if UNSIGNEDP is nonzero, otherwise signed. */
-
-tree
-type_for_size (bits, unsignedp)
- unsigned bits;
- int unsignedp;
-{
- if (bits == TYPE_PRECISION (signed_char_type_node))
- return unsignedp ? unsigned_char_type_node : signed_char_type_node;
-
- if (bits == TYPE_PRECISION (short_integer_type_node))
- return unsignedp ? short_unsigned_type_node : short_integer_type_node;
-
- if (bits == TYPE_PRECISION (integer_type_node))
- return unsignedp ? unsigned_type_node : integer_type_node;
-
- if (bits == TYPE_PRECISION (long_integer_type_node))
- return unsignedp ? long_unsigned_type_node : long_integer_type_node;
-
- if (bits == TYPE_PRECISION (long_long_integer_type_node))
- return (unsignedp ? long_long_unsigned_type_node
- : long_long_integer_type_node);
-
- if (bits <= TYPE_PRECISION (intHI_type_node))
- return unsignedp ? unsigned_intHI_type_node : intHI_type_node;
-
- if (bits <= TYPE_PRECISION (intSI_type_node))
- return unsignedp ? unsigned_intSI_type_node : intSI_type_node;
-
- if (bits <= TYPE_PRECISION (intDI_type_node))
- return unsignedp ? unsigned_intDI_type_node : intDI_type_node;
-
- return 0;
-}
-
-/* Return a data type that has machine mode MODE.
- If the mode is an integer,
- then UNSIGNEDP selects between signed and unsigned types. */
-
-tree
-type_for_mode (mode, unsignedp)
- enum machine_mode mode;
- int unsignedp;
-{
- if (mode == TYPE_MODE (signed_char_type_node))
- return unsignedp ? unsigned_char_type_node : signed_char_type_node;
-
- if (mode == TYPE_MODE (short_integer_type_node))
- return unsignedp ? short_unsigned_type_node : short_integer_type_node;
-
- if (mode == TYPE_MODE (integer_type_node))
- return unsignedp ? unsigned_type_node : integer_type_node;
-
- if (mode == TYPE_MODE (long_integer_type_node))
- return unsignedp ? long_unsigned_type_node : long_integer_type_node;
-
- if (mode == TYPE_MODE (long_long_integer_type_node))
- return unsignedp ? long_long_unsigned_type_node : long_long_integer_type_node;
-
- if (mode == TYPE_MODE (intHI_type_node))
- return unsignedp ? unsigned_intHI_type_node : intHI_type_node;
-
- if (mode == TYPE_MODE (intSI_type_node))
- return unsignedp ? unsigned_intSI_type_node : intSI_type_node;
-
- if (mode == TYPE_MODE (intDI_type_node))
- return unsignedp ? unsigned_intDI_type_node : intDI_type_node;
-
- if (mode == TYPE_MODE (float_type_node))
- return float_type_node;
-
- if (mode == TYPE_MODE (double_type_node))
- return double_type_node;
-
- if (mode == TYPE_MODE (long_double_type_node))
- return long_double_type_node;
-
- if (mode == TYPE_MODE (build_pointer_type (char_type_node)))
- return build_pointer_type (char_type_node);
-
- if (mode == TYPE_MODE (build_pointer_type (integer_type_node)))
- return build_pointer_type (integer_type_node);
-
- return 0;
-}
-
-tree
-truthvalue_conversion (expr)
- tree expr;
-{
- return chill_truthvalue_conversion (expr);
-}
-#endif
diff --git a/gcc/collect2.c b/gcc/collect2.c
index 1541f7cbf22..f7b13ab30ec 100644
--- a/gcc/collect2.c
+++ b/gcc/collect2.c
@@ -29,6 +29,9 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
#include <signal.h>
+#if ! defined( SIGCHLD ) && defined( SIGCLD )
+# define SIGCHLD SIGCLD
+#endif
#ifdef vfork /* Autoconf may define this to fork for us. */
# define VFORK_STRING "fork"
@@ -289,6 +292,9 @@ static void scan_prog_file PARAMS ((const char *, enum pass));
#ifdef SCAN_LIBRARIES
static void scan_libraries PARAMS ((const char *));
#endif
+#if LINK_ELIMINATE_DUPLICATE_LDIRECTORIES
+static int is_in_args PARAMS ((const char *, const char **, const char **));
+#endif
#ifdef COLLECT_EXPORT_LIST
static int is_in_list PARAMS ((const char *, struct id *));
static void write_aix_file PARAMS ((FILE *, struct id *));
@@ -586,21 +592,9 @@ is_ctor_dtor (s)
register const char *orig_s = s;
static struct names special[] = {
-#ifdef NO_DOLLAR_IN_LABEL
-#ifdef NO_DOT_IN_LABEL
{ "GLOBAL__I_", sizeof ("GLOBAL__I_")-1, 1, 0 },
{ "GLOBAL__D_", sizeof ("GLOBAL__D_")-1, 2, 0 },
{ "GLOBAL__F_", sizeof ("GLOBAL__F_")-1, 5, 0 },
-#else
- { "GLOBAL_.I.", sizeof ("GLOBAL_.I.")-1, 1, 0 },
- { "GLOBAL_.D.", sizeof ("GLOBAL_.D.")-1, 2, 0 },
- { "GLOBAL_.F.", sizeof ("GLOBAL_.F.")-1, 5, 0 },
-#endif
-#else
- { "GLOBAL_$I$", sizeof ("GLOBAL_$I$")-1, 1, 0 },
- { "GLOBAL_$D$", sizeof ("GLOBAL_$D$")-1, 2, 0 },
- { "GLOBAL_$F$", sizeof ("GLOBAL_$F$")-1, 5, 0 },
-#endif
{ "GLOBAL__FI_", sizeof ("GLOBAL__FI_")-1, 3, 0 },
{ "GLOBAL__FD_", sizeof ("GLOBAL__FD_")-1, 4, 0 },
#ifdef CFRONT_LOSSAGE /* Do not collect cfront initialization functions.
@@ -869,6 +863,12 @@ main (argc, argv)
COLLECT2_HOST_INITIALIZATION;
#endif
+#ifdef SIGCHLD
+ /* We *MUST* set SIGCHLD to SIG_DFL so that the wait4() call will
+ receive the signal. A different setting is inheritable */
+ signal (SIGCHLD, SIG_DFL);
+#endif
+
/* LC_CTYPE determines the character set used by the terminal so it has be set
to output messages correctly. */
@@ -1180,6 +1180,13 @@ main (argc, argv)
case 'L':
add_prefix (&cmdline_lib_dirs, arg+2);
break;
+#else
+#if LINK_ELIMINATE_DUPLICATE_LDIRECTORIES
+ case 'L':
+ if (is_in_args (arg, (const char **) ld1_argv, ld1-1))
+ --ld1;
+ break;
+#endif /* LINK_ELIMINATE_DUPLICATE_LDIRECTORIES */
#endif
case 'o':
@@ -1771,6 +1778,24 @@ write_list (stream, prefix, list)
}
}
+#if LINK_ELIMINATE_DUPLICATE_LDIRECTORIES
+/* Given a STRING, return nonzero if it occurs in the list in range
+ [ARGS_BEGIN,ARGS_END). */
+
+static int
+is_in_args (string, args_begin, args_end)
+ const char *string;
+ const char **args_begin;
+ const char **args_end;
+{
+ const char **args_pointer;
+ for (args_pointer = args_begin; args_pointer != args_end; ++args_pointer)
+ if (strcmp (string, *args_pointer) == 0)
+ return 1;
+ return 0;
+}
+#endif /* LINK_ELIMINATE_DUPLICATE_LDIRECTORIES */
+
#ifdef COLLECT_EXPORT_LIST
/* This function is really used only on AIX, but may be useful. */
static int
diff --git a/gcc/combine.c b/gcc/combine.c
index 662f05f2240..0e58832ecf8 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -86,26 +86,11 @@ Boston, MA 02111-1307, USA. */
#include "function.h"
/* Include expr.h after insn-config.h so we get HAVE_conditional_move. */
#include "expr.h"
-#include "insn-flags.h"
-#include "insn-codes.h"
#include "insn-attr.h"
#include "recog.h"
#include "real.h"
#include "toplev.h"
-#ifndef ACCUMULATE_OUTGOING_ARGS
-#define ACCUMULATE_OUTGOING_ARGS 0
-#endif
-
-/* Supply a default definition for PUSH_ARGS. */
-#ifndef PUSH_ARGS
-#ifdef PUSH_ROUNDING
-#define PUSH_ARGS !ACCUMULATE_OUTGOING_ARGS
-#else
-#define PUSH_ARGS 0
-#endif
-#endif
-
/* It is not safe to use ordinary gen_lowpart in combine.
Use gen_lowpart_for_combine instead. See comments there. */
#define gen_lowpart dont_use_gen_lowpart_you_dummy
@@ -146,6 +131,12 @@ static int max_uid_cuid;
#define INSN_CUID(INSN) \
(INSN_UID (INSN) > max_uid_cuid ? insn_cuid (INSN) : uid_cuid[INSN_UID (INSN)])
+/* In case BITS_PER_WORD == HOST_BITS_PER_WIDE_INT, shifting by
+ BITS_PER_WORD would invoke undefined behavior. Work around it. */
+
+#define UWIDE_SHIFT_LEFT_BY_BITS_PER_WORD(val) \
+ (((unsigned HOST_WIDE_INT)(val) << (BITS_PER_WORD - 1)) << 1)
+
/* Maximum register number, which is the size of the tables below. */
static unsigned int combine_max_regno;
@@ -1477,7 +1468,7 @@ cant_combine_insn_p (insn)
Here I1 and I2 appear earlier than I3.
I1 can be zero; then we combine just I2 into I3.
- It we are combining three insns and the resulting insn is not recognized,
+ If we are combining three insns and the resulting insn is not recognized,
try splitting it into two insns. If that happens, I2 and I3 are retained
and I1 is pseudo-deleted by turning it into a NOTE. Otherwise, I1 and I2
are pseudo-deleted.
@@ -1667,7 +1658,7 @@ try_combine (i3, i2, i1, new_direct_jump_p)
if (HOST_BITS_PER_WIDE_INT < BITS_PER_WORD)
abort ();
- lo &= ~(((unsigned HOST_WIDE_INT)1 << BITS_PER_WORD) - 1);
+ lo &= ~(UWIDE_SHIFT_LEFT_BY_BITS_PER_WORD (1) - 1);
lo |= INTVAL (SET_SRC (PATTERN (i3)));
}
else if (HOST_BITS_PER_WIDE_INT == BITS_PER_WORD)
@@ -1677,9 +1668,10 @@ try_combine (i3, i2, i1, new_direct_jump_p)
int sign = -(int) ((unsigned HOST_WIDE_INT) lo
>> (HOST_BITS_PER_WIDE_INT - 1));
- lo &= ~((((unsigned HOST_WIDE_INT)1 << BITS_PER_WORD) - 1)
- << BITS_PER_WORD);
- lo |= INTVAL (SET_SRC (PATTERN (i3))) << BITS_PER_WORD;
+ lo &= ~ (UWIDE_SHIFT_LEFT_BY_BITS_PER_WORD
+ (UWIDE_SHIFT_LEFT_BY_BITS_PER_WORD (1) - 1));
+ lo |= (UWIDE_SHIFT_LEFT_BY_BITS_PER_WORD
+ (INTVAL (SET_SRC (PATTERN (i3)))));
if (hi == sign)
hi = lo < 0 ? -1 : 0;
}
@@ -2246,6 +2238,7 @@ try_combine (i3, i2, i1, new_direct_jump_p)
appeared to be a memory address. This is a kludge. */
if (split_code == MULT
&& GET_CODE (XEXP (*split, 1)) == CONST_INT
+ && INTVAL (XEXP (*split, 1)) > 0
&& (i = exact_log2 (INTVAL (XEXP (*split, 1)))) >= 0)
{
SUBST (*split, gen_rtx_combine (ASHIFT, split_mode,
@@ -3602,15 +3595,15 @@ combine_simplify_rtx (x, op0_mode, last, in_dest)
&& (GET_RTX_CLASS (GET_CODE (SUBREG_REG (XEXP (x, 0))))
== 'o'))))))
{
- rtx cond, true, false;
+ rtx cond, true_rtx, false_rtx;
- cond = if_then_else_cond (x, &true, &false);
+ cond = if_then_else_cond (x, &true_rtx, &false_rtx);
if (cond != 0
/* If everything is a comparison, what we have is highly unlikely
to be simpler, so don't use it. */
&& ! (GET_RTX_CLASS (code) == '<'
- && (GET_RTX_CLASS (GET_CODE (true)) == '<'
- || GET_RTX_CLASS (GET_CODE (false)) == '<')))
+ && (GET_RTX_CLASS (GET_CODE (true_rtx)) == '<'
+ || GET_RTX_CLASS (GET_CODE (false_rtx)) == '<')))
{
rtx cop1 = const0_rtx;
enum rtx_code cond_code = simplify_comparison (NE, &cond, &cop1);
@@ -3620,35 +3613,35 @@ combine_simplify_rtx (x, op0_mode, last, in_dest)
/* Simplify the alternative arms; this may collapse the true and
false arms to store-flag values. */
- true = subst (true, pc_rtx, pc_rtx, 0, 0);
- false = subst (false, pc_rtx, pc_rtx, 0, 0);
+ true_rtx = subst (true_rtx, pc_rtx, pc_rtx, 0, 0);
+ false_rtx = subst (false_rtx, pc_rtx, pc_rtx, 0, 0);
- /* If true and false are not general_operands, an if_then_else
+ /* If true_rtx and false_rtx are not general_operands, an if_then_else
is unlikely to be simpler. */
- if (general_operand (true, VOIDmode)
- && general_operand (false, VOIDmode))
+ if (general_operand (true_rtx, VOIDmode)
+ && general_operand (false_rtx, VOIDmode))
{
/* Restarting if we generate a store-flag expression will cause
us to loop. Just drop through in this case. */
/* If the result values are STORE_FLAG_VALUE and zero, we can
just make the comparison operation. */
- if (true == const_true_rtx && false == const0_rtx)
+ if (true_rtx == const_true_rtx && false_rtx == const0_rtx)
x = gen_binary (cond_code, mode, cond, cop1);
- else if (true == const0_rtx && false == const_true_rtx)
+ else if (true_rtx == const0_rtx && false_rtx == const_true_rtx)
x = gen_binary (reverse_condition (cond_code),
mode, cond, cop1);
/* Likewise, we can make the negate of a comparison operation
if the result values are - STORE_FLAG_VALUE and zero. */
- else if (GET_CODE (true) == CONST_INT
- && INTVAL (true) == - STORE_FLAG_VALUE
- && false == const0_rtx)
+ else if (GET_CODE (true_rtx) == CONST_INT
+ && INTVAL (true_rtx) == - STORE_FLAG_VALUE
+ && false_rtx == const0_rtx)
x = gen_unary (NEG, mode, mode,
gen_binary (cond_code, mode, cond, cop1));
- else if (GET_CODE (false) == CONST_INT
- && INTVAL (false) == - STORE_FLAG_VALUE
- && true == const0_rtx)
+ else if (GET_CODE (false_rtx) == CONST_INT
+ && INTVAL (false_rtx) == - STORE_FLAG_VALUE
+ && true_rtx == const0_rtx)
x = gen_unary (NEG, mode, mode,
gen_binary (reverse_condition (cond_code),
mode, cond, cop1));
@@ -3656,7 +3649,7 @@ combine_simplify_rtx (x, op0_mode, last, in_dest)
return gen_rtx_IF_THEN_ELSE (mode,
gen_binary (cond_code, VOIDmode,
cond, cop1),
- true, false);
+ true_rtx, false_rtx);
code = GET_CODE (x);
op0_mode = VOIDmode;
@@ -4642,8 +4635,8 @@ simplify_if_then_else (x)
{
enum machine_mode mode = GET_MODE (x);
rtx cond = XEXP (x, 0);
- rtx true = XEXP (x, 1);
- rtx false = XEXP (x, 2);
+ rtx true_rtx = XEXP (x, 1);
+ rtx false_rtx = XEXP (x, 2);
enum rtx_code true_code = GET_CODE (cond);
int comparison_p = GET_RTX_CLASS (true_code) == '<';
rtx temp;
@@ -4652,12 +4645,12 @@ simplify_if_then_else (x)
rtx reversed;
/* Simplify storing of the truth value. */
- if (comparison_p && true == const_true_rtx && false == const0_rtx)
+ if (comparison_p && true_rtx == const_true_rtx && false_rtx == const0_rtx)
return gen_binary (true_code, mode, XEXP (cond, 0), XEXP (cond, 1));
/* Also when the truth value has to be reversed. */
if (comparison_p
- && true == const0_rtx && false == const_true_rtx
+ && true_rtx == const0_rtx && false_rtx == const_true_rtx
&& (reversed = reversed_comparison (cond, mode, XEXP (cond, 0),
XEXP (cond, 1))))
return reversed;
@@ -4682,7 +4675,7 @@ simplify_if_then_else (x)
if (false_code == EQ)
{
swapped = 1, true_code = EQ, false_code = NE;
- temp = true, true = false, false = temp;
+ temp = true_rtx, true_rtx = false_rtx, false_rtx = temp;
}
/* If we are comparing against zero and the expression being tested has
@@ -4701,18 +4694,21 @@ simplify_if_then_else (x)
branch and it is used in the arm. Be careful due to the potential
of locally-shared RTL. */
- if (reg_mentioned_p (from, true))
- true = subst (known_cond (copy_rtx (true), true_code, from, true_val),
+ if (reg_mentioned_p (from, true_rtx))
+ true_rtx = subst (known_cond (copy_rtx (true_rtx), true_code,
+ from, true_val),
pc_rtx, pc_rtx, 0, 0);
- if (reg_mentioned_p (from, false))
- false = subst (known_cond (copy_rtx (false), false_code,
+ if (reg_mentioned_p (from, false_rtx))
+ false_rtx = subst (known_cond (copy_rtx (false_rtx), false_code,
from, false_val),
pc_rtx, pc_rtx, 0, 0);
- SUBST (XEXP (x, 1), swapped ? false : true);
- SUBST (XEXP (x, 2), swapped ? true : false);
+ SUBST (XEXP (x, 1), swapped ? false_rtx : true_rtx);
+ SUBST (XEXP (x, 2), swapped ? true_rtx : false_rtx);
- true = XEXP (x, 1), false = XEXP (x, 2), true_code = GET_CODE (cond);
+ true_rtx = XEXP (x, 1);
+ false_rtx = XEXP (x, 2);
+ true_code = GET_CODE (cond);
}
/* If we have (if_then_else FOO (pc) (label_ref BAR)) and FOO can be
@@ -4723,27 +4719,28 @@ simplify_if_then_else (x)
if (comparison_p
&& combine_reversed_comparison_code (cond) != UNKNOWN
- && (true == pc_rtx
- || (CONSTANT_P (true)
- && GET_CODE (false) != CONST_INT && false != pc_rtx)
- || true == const0_rtx
- || (GET_RTX_CLASS (GET_CODE (true)) == 'o'
- && GET_RTX_CLASS (GET_CODE (false)) != 'o')
- || (GET_CODE (true) == SUBREG
- && GET_RTX_CLASS (GET_CODE (SUBREG_REG (true))) == 'o'
- && GET_RTX_CLASS (GET_CODE (false)) != 'o')
- || reg_mentioned_p (true, false)
- || rtx_equal_p (false, XEXP (cond, 0))))
+ && (true_rtx == pc_rtx
+ || (CONSTANT_P (true_rtx)
+ && GET_CODE (false_rtx) != CONST_INT && false_rtx != pc_rtx)
+ || true_rtx == const0_rtx
+ || (GET_RTX_CLASS (GET_CODE (true_rtx)) == 'o'
+ && GET_RTX_CLASS (GET_CODE (false_rtx)) != 'o')
+ || (GET_CODE (true_rtx) == SUBREG
+ && GET_RTX_CLASS (GET_CODE (SUBREG_REG (true_rtx))) == 'o'
+ && GET_RTX_CLASS (GET_CODE (false_rtx)) != 'o')
+ || reg_mentioned_p (true_rtx, false_rtx)
+ || rtx_equal_p (false_rtx, XEXP (cond, 0))))
{
true_code = reversed_comparison_code (cond, NULL);
SUBST (XEXP (x, 0),
reversed_comparison (cond, GET_MODE (cond), XEXP (cond, 0),
XEXP (cond, 1)));
- SUBST (XEXP (x, 1), false);
- SUBST (XEXP (x, 2), true);
+ SUBST (XEXP (x, 1), false_rtx);
+ SUBST (XEXP (x, 2), true_rtx);
- temp = true, true = false, false = temp, cond = XEXP (x, 0);
+ temp = true_rtx, true_rtx = false_rtx, false_rtx = temp;
+ cond = XEXP (x, 0);
/* It is possible that the conditional has been simplified out. */
true_code = GET_CODE (cond);
@@ -4752,37 +4749,38 @@ simplify_if_then_else (x)
/* If the two arms are identical, we don't need the comparison. */
- if (rtx_equal_p (true, false) && ! side_effects_p (cond))
- return true;
+ if (rtx_equal_p (true_rtx, false_rtx) && ! side_effects_p (cond))
+ return true_rtx;
/* Convert a == b ? b : a to "a". */
if (true_code == EQ && ! side_effects_p (cond)
&& (! FLOAT_MODE_P (mode) || flag_fast_math)
- && rtx_equal_p (XEXP (cond, 0), false)
- && rtx_equal_p (XEXP (cond, 1), true))
- return false;
+ && rtx_equal_p (XEXP (cond, 0), false_rtx)
+ && rtx_equal_p (XEXP (cond, 1), true_rtx))
+ return false_rtx;
else if (true_code == NE && ! side_effects_p (cond)
&& (! FLOAT_MODE_P (mode) || flag_fast_math)
- && rtx_equal_p (XEXP (cond, 0), true)
- && rtx_equal_p (XEXP (cond, 1), false))
- return true;
+ && rtx_equal_p (XEXP (cond, 0), true_rtx)
+ && rtx_equal_p (XEXP (cond, 1), false_rtx))
+ return true_rtx;
/* Look for cases where we have (abs x) or (neg (abs X)). */
if (GET_MODE_CLASS (mode) == MODE_INT
- && GET_CODE (false) == NEG
- && rtx_equal_p (true, XEXP (false, 0))
+ && GET_CODE (false_rtx) == NEG
+ && rtx_equal_p (true_rtx, XEXP (false_rtx, 0))
&& comparison_p
- && rtx_equal_p (true, XEXP (cond, 0))
- && ! side_effects_p (true))
+ && rtx_equal_p (true_rtx, XEXP (cond, 0))
+ && ! side_effects_p (true_rtx))
switch (true_code)
{
case GT:
case GE:
- return gen_unary (ABS, mode, mode, true);
+ return gen_unary (ABS, mode, mode, true_rtx);
case LT:
case LE:
- return gen_unary (NEG, mode, mode, gen_unary (ABS, mode, mode, true));
+ return gen_unary (NEG, mode, mode,
+ gen_unary (ABS, mode, mode, true_rtx));
default:
break;
}
@@ -4791,23 +4789,23 @@ simplify_if_then_else (x)
if ((! FLOAT_MODE_P (mode) || flag_fast_math)
&& comparison_p
- && rtx_equal_p (XEXP (cond, 0), true)
- && rtx_equal_p (XEXP (cond, 1), false)
+ && rtx_equal_p (XEXP (cond, 0), true_rtx)
+ && rtx_equal_p (XEXP (cond, 1), false_rtx)
&& ! side_effects_p (cond))
switch (true_code)
{
case GE:
case GT:
- return gen_binary (SMAX, mode, true, false);
+ return gen_binary (SMAX, mode, true_rtx, false_rtx);
case LE:
case LT:
- return gen_binary (SMIN, mode, true, false);
+ return gen_binary (SMIN, mode, true_rtx, false_rtx);
case GEU:
case GTU:
- return gen_binary (UMAX, mode, true, false);
+ return gen_binary (UMAX, mode, true_rtx, false_rtx);
case LEU:
case LTU:
- return gen_binary (UMIN, mode, true, false);
+ return gen_binary (UMIN, mode, true_rtx, false_rtx);
default:
break;
}
@@ -4822,8 +4820,8 @@ simplify_if_then_else (x)
if ((STORE_FLAG_VALUE == 1 || STORE_FLAG_VALUE == -1)
&& comparison_p && mode != VOIDmode && ! side_effects_p (x))
{
- rtx t = make_compound_operation (true, SET);
- rtx f = make_compound_operation (false, SET);
+ rtx t = make_compound_operation (true_rtx, SET);
+ rtx f = make_compound_operation (false_rtx, SET);
rtx cond_op0 = XEXP (cond, 0);
rtx cond_op1 = XEXP (cond, 1);
enum rtx_code op = NIL, extend_op = NIL;
@@ -4936,12 +4934,12 @@ simplify_if_then_else (x)
can actually do this more generally, but it doesn't seem worth it. */
if (true_code == NE && XEXP (cond, 1) == const0_rtx
- && false == const0_rtx && GET_CODE (true) == CONST_INT
+ && false_rtx == const0_rtx && GET_CODE (true_rtx) == CONST_INT
&& ((1 == nonzero_bits (XEXP (cond, 0), mode)
- && (i = exact_log2 (INTVAL (true))) >= 0)
+ && (i = exact_log2 (INTVAL (true_rtx))) >= 0)
|| ((num_sign_bit_copies (XEXP (cond, 0), mode)
== GET_MODE_BITSIZE (mode))
- && (i = exact_log2 (-INTVAL (true))) >= 0)))
+ && (i = exact_log2 (-INTVAL (true_rtx))) >= 0)))
return
simplify_shift_const (NULL_RTX, ASHIFT, mode,
gen_lowpart_for_combine (mode, XEXP (cond, 0)), i);
@@ -5190,29 +5188,31 @@ simplify_set (x)
== GET_MODE_BITSIZE (GET_MODE (XEXP (XEXP (src, 0), 0))))
&& ! side_effects_p (src))
{
- rtx true = (GET_CODE (XEXP (src, 0)) == NE
+ rtx true_rtx = (GET_CODE (XEXP (src, 0)) == NE
? XEXP (src, 1) : XEXP (src, 2));
- rtx false = (GET_CODE (XEXP (src, 0)) == NE
+ rtx false_rtx = (GET_CODE (XEXP (src, 0)) == NE
? XEXP (src, 2) : XEXP (src, 1));
rtx term1 = const0_rtx, term2, term3;
- if (GET_CODE (true) == IOR && rtx_equal_p (XEXP (true, 0), false))
- term1 = false, true = XEXP (true, 1), false = const0_rtx;
- else if (GET_CODE (true) == IOR
- && rtx_equal_p (XEXP (true, 1), false))
- term1 = false, true = XEXP (true, 0), false = const0_rtx;
- else if (GET_CODE (false) == IOR
- && rtx_equal_p (XEXP (false, 0), true))
- term1 = true, false = XEXP (false, 1), true = const0_rtx;
- else if (GET_CODE (false) == IOR
- && rtx_equal_p (XEXP (false, 1), true))
- term1 = true, false = XEXP (false, 0), true = const0_rtx;
-
- term2 = gen_binary (AND, GET_MODE (src), XEXP (XEXP (src, 0), 0), true);
+ if (GET_CODE (true_rtx) == IOR
+ && rtx_equal_p (XEXP (true_rtx, 0), false_rtx))
+ term1 = false_rtx, true_rtx = XEXP(true_rtx, 1), false_rtx = const0_rtx;
+ else if (GET_CODE (true_rtx) == IOR
+ && rtx_equal_p (XEXP (true_rtx, 1), false_rtx))
+ term1 = false_rtx, true_rtx = XEXP(true_rtx, 0), false_rtx = const0_rtx;
+ else if (GET_CODE (false_rtx) == IOR
+ && rtx_equal_p (XEXP (false_rtx, 0), true_rtx))
+ term1 = true_rtx, false_rtx = XEXP(false_rtx, 1), true_rtx = const0_rtx;
+ else if (GET_CODE (false_rtx) == IOR
+ && rtx_equal_p (XEXP (false_rtx, 1), true_rtx))
+ term1 = true_rtx, false_rtx = XEXP(false_rtx, 0), true_rtx = const0_rtx;
+
+ term2 = gen_binary (AND, GET_MODE (src),
+ XEXP (XEXP (src, 0), 0), true_rtx);
term3 = gen_binary (AND, GET_MODE (src),
gen_unary (NOT, GET_MODE (src), GET_MODE (src),
XEXP (XEXP (src, 0), 0)),
- false);
+ false_rtx);
SUBST (SET_SRC (x),
gen_binary (IOR, GET_MODE (src),
@@ -6559,8 +6559,8 @@ make_compound_operation (x, in_code)
case LSHIFTRT:
/* If the sign bit is known to be zero, replace this with an
arithmetic shift. */
- if (ashr_optab->handlers[(int) mode].insn_code == CODE_FOR_nothing
- && lshr_optab->handlers[(int) mode].insn_code != CODE_FOR_nothing
+ if (ashr_optab->handlers[(int) mode].insn_code != CODE_FOR_nothing
+ && lshr_optab->handlers[(int) mode].insn_code == CODE_FOR_nothing
&& mode_width <= HOST_BITS_PER_WIDE_INT
&& (nonzero_bits (XEXP (x, 0), mode) & (1 << (mode_width - 1))) == 0)
{
@@ -11140,7 +11140,7 @@ simplify_comparison (code, pop0, pop1)
/* If OP0 is an AND and we don't have an AND in MODE either,
make a new AND in the proper mode. */
if (GET_CODE (op0) == AND
- && (add_optab->handlers[(int) mode].insn_code
+ && (and_optab->handlers[(int) mode].insn_code
== CODE_FOR_nothing))
op0 = gen_binary (AND, tmode,
gen_lowpart_for_combine (tmode,
@@ -12212,6 +12212,25 @@ distribute_notes (notes, from_insn, i3, i2, elim_i2, elim_i1)
break;
case REG_EH_REGION:
+ /* These notes must remain with the call or trapping instruction. */
+ if (GET_CODE (i3) == CALL_INSN)
+ place = i3;
+ else if (i2 && GET_CODE (i2) == CALL_INSN)
+ place = i2;
+ else if (flag_non_call_exceptions)
+ {
+ if (may_trap_p (i3))
+ place = i3;
+ else if (i2 && may_trap_p (i2))
+ place = i2;
+ /* ??? Otherwise assume we've combined things such that we
+ can now prove that the instructions can't trap. Drop the
+ note in this case. */
+ }
+ else
+ abort ();
+ break;
+
case REG_EH_RETHROW:
case REG_NORETURN:
/* These notes must remain with the call. It should not be
diff --git a/gcc/config.gcc b/gcc/config.gcc
index 049d5d4c598..0733dce5bee 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -1,5 +1,5 @@
# GCC build-, host- and target-specific configuration file.
-# Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+# Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
#This file is part of GNU CC.
@@ -255,7 +255,7 @@ case $machine in
;;
esac
-# Common parts for GNU/Linux, GNU/Hurd and OpenBSD systems.
+# Common parts for GNU/Linux, GNU/Hurd, OpenBSD and FreeBSD systems.
case $machine in
*-*-linux*)
xm_defines="POSIX"
@@ -275,7 +275,7 @@ case $machine in
# These details are the same as for Linux.
xmake_file=x-linux
# But here we need a little extra magic.
- tmake_file="t-linux t-gnu"
+ tmake_file="t-slibgcc-elf-ver t-linux t-gnu"
case $machine in
i[34567]86-*-*)
tm_file="${cpu_type}/${cpu_type}.h i386/att.h linux.h i386/linux.h gnu.h ${tm_file}"
@@ -287,7 +287,7 @@ case $machine in
;;
*-*-openbsd*)
tm_file=${cpu_type}/openbsd.h
- tmake_file="t-libc-ok t-openbsd"
+ tmake_file="t-libc-ok t-openbsd t-libgcc-pic"
# avoid surprises, always provide an xm-openbsd file
xm_file=${cpu_type}/xm-openbsd.h
# don't depend on processor x-fragments as well
@@ -297,6 +297,62 @@ case $machine in
tmake_file="${tmake_file} t-openbsd-thread"
fi
;;
+*-*-freebsd[12] | *-*-freebsd[12].* | *-*-freebsd*aout*)
+ # This is the place-holder for the generic a.out configuration
+ # of FreeBSD. No actual configuration resides here since
+ # there was only ever a bare-bones ix86 configuration for
+ # a.out and it exists solely in the machine-specific section.
+ # This place-holder must exist to avoid dropping into
+ # the generic ELF configuration of FreeBSD (i.e. it must be
+ # ordered before that section).
+ ;;
+*-*-freebsd*)
+ # This is the generic ELF configuration of FreeBSD. Later
+ # machine-specific sections may refine and add to this
+ # configuration.
+ #
+ # Due to tm_file entry ordering issues that vary between cpu
+ # architectures, we only define fbsd_tm_file to allow the
+ # machine-specific section to dictate the final order of all
+ # entries of tm_file with the minor exception that components
+ # of the tm_file set here will always be of the form:
+ #
+ # freebsd<version_number>.h [freebsd-<conf_option>.h ...] freebsd.h
+ #
+ # The machine-specific section should not tamper with this
+ # ordering but may order all other entries of tm_file as it
+ # pleases around the provided core setting.
+ gas=yes
+ gnu_ld=yes
+ extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o"
+ case $machine in
+ *-*-freebsd3 | *-*-freebsd[3].*) fbsd_tm_file="freebsd3.h";;
+ *-*-freebsd4 | *-*-freebsd[4].*) fbsd_tm_file="freebsd4.h";;
+ *-*-freebsd5 | *-*-freebsd[5].*) fbsd_tm_file="freebsd5.h";;
+ *-*-freebsd6 | *-*-freebsd[6].*) fbsd_tm_file="freebsd6.h";;
+ *) echo 'Please update *-*-freebsd* in gcc/config.gcc'; exit 1;;
+ esac
+ tmake_file=t-freebsd
+ xm_defines=POSIX
+ case x${enable_threads} in
+ xno) fbsd_tm_file="${fbsd_tm_file} freebsd-nthr.h";;
+ x | xyes | xpthreads | xposix)
+ thread_file='posix'
+ tmake_file="${tmake_file} t-freebsd-thread"
+ ;;
+ *) echo 'Unknown thread configuration for FreeBSD'; exit 1;;
+ esac
+ fbsd_tm_file="${fbsd_tm_file} freebsd.h"
+ if test x${thread_file} = xposix; then
+ if test x${enable_libgcj} = xyes; then
+ echo 'FreeBSD does not currently handle --enable-threads (now'
+ echo 'the default to match system compiler) and --enable-libgcj.'
+ echo 'Please explicitly configure with --disable-threads or'
+ echo '--disable-libgcj'
+ exit 1
+ fi
+ fi
+ ;;
esac
case $machine in
@@ -375,7 +431,7 @@ alpha*-*-linux*ecoff*)
alpha*-*-linux*libc1*)
tm_file="${tm_file} alpha/elf.h alpha/linux.h alpha/linux-elf.h"
target_cpu_default="MASK_GAS"
- tmake_file="t-linux t-linux-gnulibc1 alpha/t-alpha alpha/t-crtbe alpha/t-ieee"
+ tmake_file="t-slibgcc-elf-ver t-linux t-linux-gnulibc1 alpha/t-alpha alpha/t-crtbe alpha/t-ieee"
extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o"
xmake_file=none
gas=yes gnu_ld=yes
@@ -386,7 +442,7 @@ alpha*-*-linux*libc1*)
alpha*-*-linux*)
tm_file="${tm_file} alpha/elf.h alpha/linux.h alpha/linux-elf.h"
target_cpu_default="MASK_GAS"
- tmake_file="t-linux alpha/t-crtbe alpha/t-alpha alpha/t-ieee"
+ tmake_file="t-slibgcc-elf-ver t-linux alpha/t-crtbe alpha/t-alpha alpha/t-ieee"
extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o"
xmake_file=none
gas=yes gnu_ld=yes
@@ -395,19 +451,10 @@ alpha*-*-linux*)
fi
;;
alpha*-*-freebsd*)
- tm_file="${tm_file} freebsd.h alpha/elf.h alpha/freebsd.h"
+ tm_file="${tm_file} ${fbsd_tm_file} alpha/elf.h alpha/freebsd.h"
target_cpu_default="MASK_GAS"
- tmake_file="t-freebsd alpha/t-crtbe alpha/t-alpha alpha/t-ieee"
- extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o"
xmake_file=none
- gas=yes gnu_ld=yes
- stabs=yes
- case x${enable_threads} in
- xyes | xpthreads | xposix)
- thread_file='posix'
- tmake_file="${tmake_file} t-freebsd-thread"
- ;;
- esac
+ tmake_file="${tmake_file} alpha/t-crtbe alpha/t-alpha alpha/t-ieee"
;;
alpha*-*-netbsd*)
tm_file="${tm_file} alpha/elf.h alpha/netbsd.h alpha/netbsd-elf.h"
@@ -492,14 +539,6 @@ alpha*-dec-vms*)
xm_file="${xm_file} alpha/xm-vms.h"
tmake_file="alpha/t-alpha alpha/t-vms alpha/t-ieee"
;;
-arm*-*-rtems*)
- tm_file=arm/rtems-elf.h
- tmake_file="arm/t-arm-elf t-rtems"
- if test x$enable_threads = xyes; then
- thread_file='rtems'
- fi
- extra_parts="crtinit.o crtfini.o"
- ;;
arc-*-elf*)
extra_parts="crtinit.o crtfini.o"
;;
@@ -540,34 +579,11 @@ arm*-*-netbsd*)
tmake_file="t-netbsd arm/t-netbsd"
use_collect2=yes
;;
-arm*-*-linux*oldld*) # ARM GNU/Linux with old ELF linker
- xm_file=arm/xm-linux.h
- xmake_file=x-linux
- tm_file="arm/linux-oldld.h arm/linux-elf.h"
- case $machine in
- armv2*-*-*)
- tm_file="arm/linux-elf26.h $tm_file"
- ;;
- esac
- tmake_file="t-linux arm/t-linux"
- extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
- gnu_ld=yes
- case x${enable_threads} in
- x | xyes | xpthreads | xposix)
- thread_file='posix'
- ;;
- esac
- ;;
-arm*-*-linux*) # ARM GNU/Linux with ELF
+arm*-*-linux*) # ARM GNU/Linux with ELF
xm_file=arm/xm-linux.h
xmake_file=x-linux
tm_file="arm/linux-elf.h"
- case $machine in
- armv2*-*-*)
- tm_file="arm/linux-elf26.h $tm_file"
- ;;
- esac
- tmake_file="t-linux arm/t-linux"
+ tmake_file="t-slibgcc-elf-ver t-linux arm/t-linux"
extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
gnu_ld=yes
case x${enable_threads} in
@@ -588,6 +604,13 @@ arm*-*-ecos-elf)
tm_file=arm/ecos-elf.h
tmake_file=arm/t-arm-elf
;;
+arm*-*-rtems*)
+ tm_file="arm/rtems-elf.h rtems.h"
+ tmake_file="arm/t-arm-elf t-rtems"
+ if test x$enable_threads = xyes; then
+ thread_file='rtems'
+ fi
+ ;;
arm*-*-elf)
tm_file=arm/unknown-elf.h
tmake_file=arm/t-arm-elf
@@ -644,7 +667,6 @@ clipper-intergraph-clix*)
tm_file="${tm_file} svr3.h clipper/clix.h"
xm_file=clipper/xm-clix.h
xmake_file=clipper/x-clix
- extra_headers=va-clipper.h
extra_parts="crtbegin.o crtend.o"
install_headers_dir=install-headers-cpio
;;
@@ -675,7 +697,7 @@ h8300-*-*)
hppa*-*-linux*)
target_cpu_default="(MASK_PA_11 | MASK_GAS | MASK_JUMP_IN_DELAY)"
tm_file="${tm_file} pa/elf.h linux.h pa/pa-linux.h"
- tmake_file="t-linux pa/t-linux"
+ tmake_file="t-slibgcc-elf-ver t-linux pa/t-linux"
extra_parts="crtbegin.o crtend.o"
xmake_file=none
gas=yes gnu_ld=yes
@@ -830,14 +852,13 @@ hppa1.0-*-hpux10*)
use_collect2=yes
;;
hppa*64*-*-hpux11*)
- target_cpu_default="MASK_PA_11"
xm_file=pa/xm-pa64hpux.h
xmake_file=pa/x-pa-hpux
tmake_file=pa/t-pa
tm_file="pa/pa64-start.h ${tm_file} pa/pa64-regs.h pa/long_double.h pa/elf.h pa/pa-hpux.h pa/pa-hpux11.h pa/pa-64.h"
float_format=i128
tmake_file=pa/t-pa64
- target_cpu_default="(MASK_PA_11|MASK_PA_20)"
+ target_cpu_default="(MASK_PA_11|MASK_PA_20|MASK_GAS)"
if [ x$gas = xyes ]
then
@@ -967,7 +988,7 @@ i370-*-linux*)
xm_file="xm-linux.h i370/xm-linux.h"
xmake_file=x-linux
tm_file="i370/linux.h ${tm_file}"
- tmake_file="t-linux i370/t-linux"
+ tmake_file="t-slibgcc-elf-ver t-linux i370/t-linux"
# broken_install=yes
extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
# extra_parts="crtbegin.o crtend.o"
@@ -980,7 +1001,7 @@ i370-*-linux*)
;;
i[34567]86-*-chorusos*)
xm_file="${xm_file} xm-svr4.h i386/xm-sysv4.h"
- tm_file="i386/i386.h i386/att.h elfos.h i386/i386afe.h i386/i386elf.h i386/chorus.h"
+ tm_file="i386/i386.h i386/att.h elfos.h i386/i386elf.h i386/chorus.h"
tmake_file=i386/t-i386elf
xmake_file=x-svr4
case x${enable_threads} in
@@ -991,7 +1012,7 @@ i[34567]86-*-chorusos*)
;;
i[34567]86-*-elf*)
xm_file="${xm_file} xm-svr4.h i386/xm-sysv4.h"
- tm_file="i386/i386.h i386/att.h elfos.h i386/i386afe.h i386/i386elf.h"
+ tm_file="i386/i386.h i386/att.h elfos.h i386/i386elf.h"
tmake_file=i386/t-i386elf
xmake_file=x-svr4
;;
@@ -1005,7 +1026,7 @@ i[34567]86-ibm-aix*) # IBM PS/2 running AIX
tm_file=i386/aix386ng.h
use_collect2=yes
fi
- xm_file="xm-alloca.h i386/xm-aix.h ${xm_file}"
+ xm_file="xm-alloca.h ${xm_file}"
xm_defines=USG
xmake_file=i386/x-aix
;;
@@ -1064,13 +1085,13 @@ i[34567]86-sequent-ptx2* | i[34567]86-sequent-sysv3*)
;;
i[34567]86-sequent-ptx4* | i[34567]86-sequent-sysv4*)
xm_file="xm-alloca.h ${xm_file}"
+ tm_file=i386/ptx4-i.h
if test x$gas = xyes
then
- tm_file="${tm_file} usegas.h"
+ tm_file="usegas.h ${tm_file}"
fi
xm_defines="USG POSIX SMALL_ARG_MAX"
xmake_file=x-svr4
- tm_file=i386/ptx4-i.h
tmake_file=t-svr4
extra_parts="crtbegin.o crtend.o"
install_headers_dir=install-headers-cpio
@@ -1111,18 +1132,14 @@ i[34567]86-*-freebsd[12] | i[34567]86-*-freebsd[12].* | i[34567]86-*-freebsd*aou
tmake_file=t-freebsd
;;
i[34567]86-*-freebsd*)
- tm_file="i386/i386.h i386/att.h svr4.h freebsd.h i386/i386afe.h i386/freebsd.h i386/perform.h"
- extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
- tmake_file=t-freebsd
- gas=yes
+ tm_file="${tm_file} i386/att.h svr4.h ${fbsd_tm_file} i386/freebsd.h i386/perform.h"
+ ;;
+i[34567]86-*-netbsdelf*)
+ xm_defines=POSIX
+ tm_file="${tm_file} i386/att.h svr4.h i386/netbsd-elf.h"
+ tmake_file=t-netbsd
gnu_ld=yes
- stabs=yes
- case x${enable_threads} in
- xyes | xpthreads | xposix)
- thread_file='posix'
- tmake_file="${tmake_file} t-freebsd-thread"
- ;;
- esac
+ float_format=i386
;;
i[34567]86-*-netbsd*)
tm_file=i386/netbsd.h
@@ -1130,6 +1147,8 @@ i[34567]86-*-netbsd*)
use_collect2=yes
;;
i[34567]86-*-openbsd*)
+ # needed to unconfuse gdb
+ tmake_file="t-libc-ok t-openbsd i386/t-openbsd"
# we need collect2 until our bug is fixed...
use_collect2=yes
;;
@@ -1182,8 +1201,8 @@ i[34567]86-*-linux*libc1) # Intel 80386's running GNU/Linux
# with ELF format using the
# GNU/Linux C library 5
xmake_file=x-linux
- tm_file="i386/i386.h i386/att.h linux.h i386/i386afe.h i386/linux.h"
- tmake_file="t-linux t-linux-gnulibc1 i386/t-crtstuff"
+ tm_file="i386/i386.h i386/att.h linux.h i386/linux.h"
+ tmake_file="t-slibgcc-elf-ver t-linux t-linux-gnulibc1 i386/t-crtstuff"
extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
gnu_ld=yes
float_format=i386
@@ -1195,8 +1214,8 @@ i[34567]86-*-linux*) # Intel 80386's running GNU/Linux
# with ELF format using glibc 2
# aka GNU/Linux C library 6
xmake_file=x-linux
- tm_file="i386/i386.h i386/att.h linux.h i386/i386afe.h i386/linux.h"
- tmake_file="t-linux i386/t-crtstuff"
+ tm_file="i386/i386.h i386/att.h linux.h i386/linux.h"
+ tmake_file="t-slibgcc-elf-ver t-linux i386/t-crtstuff"
extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
gnu_ld=yes
float_format=i386
@@ -1226,7 +1245,7 @@ i[34567]86-pc-msdosdjgpp*)
esac
;;
i[34567]86-moss-msdos* | i[34567]86-*-moss*)
- tm_file="i386/i386.h i386/att.h linux.h i386/i386afe.h i386/linux.h i386/moss.h"
+ tm_file="i386/i386.h i386/att.h linux.h i386/linux.h i386/moss.h"
tmake_file=t-libc-ok
gnu_ld=yes
gas=yes
@@ -1256,7 +1275,6 @@ i[34567]86-*-osfrose*) # 386 using OSF/rose
tm_file=i386/osfrose.h
use_collect2=yes
fi
- xm_file="i386/xm-osf.h ${xm_file}"
xmake_file=i386/x-osfrose
tmake_file=i386/t-osf
extra_objs=halfpic.o
@@ -1279,10 +1297,10 @@ i[34567]86-*-rtemscoff*)
fi
;;
i[34567]86-*-rtems*|i[34567]86-*-rtemself*)
- cpu_type=i386
- tm_file=i386/rtemself.h
- extra_parts="crtbegin.o crtend.o crti.o crtn.o"
- tmake_file="i386/t-rtems-i386 i386/t-crtstuff t-rtems"
+ xm_file="${xm_file} xm-svr4.h i386/xm-sysv4.h"
+ tm_file="i386/i386.h i386/att.h elfos.h i386/i386elf.h i386/rtemself.h"
+ xmake_file=x-svr4
+ tmake_file="i386/t-rtems-i386 t-rtems"
if test x$enable_threads = xyes; then
thread_file='rtems'
fi
@@ -1350,6 +1368,11 @@ i[34567]86-*-solaris2*)
tm_file="i386/sol2gas.h ${tm_file}"
fi
tmake_file="i386/t-i386bare i386/t-sol2"
+ if test x$gnu_ld = xyes; then
+ tmake_file="$tmake_file t-slibgcc-elf-ver"
+ else
+ tmake_file="$tmake_file t-slibgcc-sld"
+ fi
extra_parts="crt1.o crti.o crtn.o gcrt1.o gmon.o crtbegin.o crtend.o"
xmake_file=x-svr4
if test x${enable_threads} = x; then
@@ -1480,11 +1503,11 @@ i[34567]86-*-mingw32*)
fi
exeext=.exe
case $machine in
- *mingw32msv*)
- ;;
- *minwg32crt* | *mingw32*)
+ *mingw32crt*)
tm_file="${tm_file} i386/crtdll.h"
;;
+ *minwg32msv* | *mingw32*)
+ ;;
esac
;;
i[34567]86-*-uwin*)
@@ -1594,12 +1617,10 @@ i960-wrs-vxworks*)
i960-*-coff*)
tm_file="${tm_file} dbxcoff.h i960/i960-coff.h libgloss.h"
tmake_file=i960/t-960bare
- use_collect2=yes
;;
i960-*-rtems)
tmake_file="i960/t-960bare t-rtems"
tm_file="${tm_file} dbxcoff.h i960/rtems.h"
- use_collect2=yes
if test x$enable_threads = xyes; then
thread_file='rtems'
fi
@@ -1608,7 +1629,7 @@ i960-*-*) # Default i960 environment.
use_collect2=yes
;;
ia64*-*-elf*)
- tm_file=ia64/elf.h
+ tm_file="${tm_file} elfos.h ia64/sysv4.h ia64/elf.h"
tmake_file="ia64/t-ia64"
target_cpu_default="0"
if test x$gas = xyes
@@ -1621,15 +1642,31 @@ ia64*-*-elf*)
fi
float_format=i386
;;
+ia64*-*-freebsd*)
+ tm_file="${tm_file} ${fbsd_tm_file} elfos.h ia64/sysv4.h ia64/freebsd.h"
+ target_cpu_default="MASK_GNU_AS|MASK_GNU_LD"
+ tmake_file="${tmake_file} ia64/t-ia64"
+ xmake_file=none
+ float_format=i386
+ ;;
ia64*-*-linux*)
- tm_file=ia64/linux.h
- tmake_file="t-linux ia64/t-ia64 ia64/t-glibc"
+ tm_file="${tm_file} linux.h ia64/sysv4.h ia64/linux.h"
+ tmake_file="t-slibgcc-elf-ver t-linux ia64/t-ia64 ia64/t-glibc"
target_cpu_default="MASK_GNU_AS|MASK_GNU_LD"
if test x$enable_threads = xyes; then
thread_file='posix'
fi
float_format=i386
;;
+ia64*-*-hpux*)
+ tm_file="ia64/ia64.h svr4.h ia64/sysv4.h ia64/hpux.h"
+ tmake_file="ia64/t-ia64 ia64/t-hpux"
+ target_cpu_default="MASK_GNU_AS"
+ if test x$enable_threads = xyes; then
+ thread_file='posix'
+ fi
+ float_format=i386
+ ;;
m32r-*-elf*)
extra_parts="crtinit.o crtfini.o"
;;
@@ -1993,6 +2030,7 @@ m68020-*-elf* | m68k-*-elf*)
xm_file=m68k/xm-m68kv.h
tmake_file=m68k/t-m68kelf
header_files=math-68881.h
+ extra_parts="crtbegin.o crtend.o"
;;
m68k-*-lynxos*)
if test x$gas = xyes
@@ -2014,6 +2052,8 @@ m68k*-*-netbsd*)
use_collect2=yes
;;
m68k*-*-openbsd*)
+ # needed to unconfuse gdb
+ tmake_file="t-libc-ok t-openbsd m68k/t-openbsd"
float_format=m68k
# we need collect2 until our bug is fixed...
use_collect2=yes
@@ -2049,7 +2089,7 @@ m68k-*-linux*libc1) # Motorola m68k's running GNU/Linux
# GNU/Linux C library 5
xmake_file=x-linux
tm_file=m68k/linux.h
- tmake_file="t-linux t-linux-gnulibc1 m68k/t-linux"
+ tmake_file="t-slibgcc-elf-ver t-linux t-linux-gnulibc1 m68k/t-linux"
extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
extra_headers=math-68881.h
float_format=m68k
@@ -2060,7 +2100,7 @@ m68k-*-linux*) # Motorola m68k's running GNU/Linux
# aka the GNU/Linux C library 6.
xmake_file=x-linux
tm_file=m68k/linux.h
- tmake_file="t-linux m68k/t-linux"
+ tmake_file="t-slibgcc-elf-ver t-linux m68k/t-linux"
extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
extra_headers=math-68881.h
float_format=m68k
@@ -2089,6 +2129,7 @@ m68k-*-rtemself*|m68k-*-rtems*)
tm_file=m68k/rtemself.h
extra_headers=math-68881.h
float_format=m68k
+ extra_parts="crtbegin.o crtend.o"
if test x$enable_threads = xyes; then
thread_file='rtems'
fi
@@ -2360,10 +2401,10 @@ mipsel-*-netbsd* | mips-dec-netbsd*) # Decstation running NetBSD
mips*-*-linux*) # Linux MIPS, either endian.
xmake_file=x-linux
case $machine in
- mips*el-*) tm_file="mips/elfl.h mips/linux.h" ;;
- *) tm_file="mips/elf.h mips/linux.h" ;;
+ mips*el-*) tm_file="elfos.h mips/elfl.h mips/linux.h" ;;
+ *) tm_file="elfos.h mips/elf.h mips/linux.h" ;;
esac
- tmake_file=t-linux
+ tmake_file="t-slibgcc-elf-ver t-linux"
extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
gnu_ld=yes
gas=yes
@@ -2761,6 +2802,14 @@ powerpc-*-sysv*)
tmake_file="rs6000/t-ppcos rs6000/t-ppccomm"
xmake_file=rs6000/x-sysv4
;;
+powerpc-*-netbsd*)
+ tm_file="${tm_file} svr4.h rs6000/sysv4.h rs6000/netbsd.h"
+ xm_file=rs6000/xm-sysv4.h
+ xm_defines=POSIX
+ extra_headers=ppc-asm.h
+ tmake_file="rs6000/t-ppcos rs6000/t-ppccomm"
+ xmake_file=none
+ ;;
powerpc-*-chorusos*)
tm_file="${tm_file} svr4.h rs6000/sysv4.h rs6000/chorus.h"
tmake_file="rs6000/t-ppcos rs6000/t-ppccomm"
@@ -2803,7 +2852,7 @@ powerpc-*-linux*libc1)
tm_file="${tm_file} svr4.h rs6000/sysv4.h rs6000/linux.h"
xm_file=rs6000/xm-sysv4.h
out_file=rs6000/rs6000.c
- tmake_file="rs6000/t-ppcos t-linux t-linux-gnulibc1 rs6000/t-ppccomm"
+ tmake_file="rs6000/t-ppcos t-slibgcc-elf-ver t-linux t-linux-gnulibc1 rs6000/t-ppccomm"
xmake_file=x-linux
extra_headers=ppc-asm.h
if test x$enable_threads = xyes; then
@@ -2815,7 +2864,7 @@ powerpc-*-linux*)
xm_file="rs6000/xm-sysv4.h"
xm_defines="USG ${xm_defines}"
out_file=rs6000/rs6000.c
- tmake_file="rs6000/t-ppcos t-linux rs6000/t-ppccomm"
+ tmake_file="rs6000/t-ppcos t-slibgcc-elf-ver t-linux rs6000/t-ppccomm"
xmake_file=x-linux
extra_headers=ppc-asm.h
if test x$enable_threads = xyes; then
@@ -2945,6 +2994,28 @@ rs6000-*-lynxos*)
xmake_file=rs6000/x-lynx
use_collect2=yes
;;
+s390-*-linux*)
+ tm_file="s390/s390.h linux.h s390/linux.h"
+ tmake_file="t-slibgcc-elf-ver t-linux s390/t-linux"
+ xmake_file=x-linux
+ extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o"
+ if test x$enable_threads = xyes; then
+ thread_file='posix'
+ fi
+ ;;
+s390x-*-linux*)
+ tm_file="s390/s390.h linux.h s390/linux.h s390/linux64.h"
+ tm_p_file=s390/s390-protos.h
+ xm_file=s390/xm-s390x.h
+ md_file=s390/s390.md
+ out_file=s390/s390.c
+ tmake_file="t-slibgcc-elf-ver t-linux s390/t-linux"
+ xmake_file=x-linux
+ extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o"
+ if test x$enable_threads = xyes; then
+ thread_file='posix'
+ fi
+ ;;
sh-*-elf*)
tmake_file="sh/t-sh sh/t-elf"
tm_file="sh/sh.h sh/elf.h"
@@ -3005,6 +3076,8 @@ sparc-*-netbsd*)
use_collect2=yes
;;
sparc-*-openbsd*)
+ # needed to unconfuse gdb
+ tmake_file="t-libc-ok t-openbsd sparc/t-openbsd"
# we need collect2 until our bug is fixed...
use_collect2=yes
;;
@@ -3039,7 +3112,7 @@ sparc-*-linux*libc1*) # Sparc's running GNU/Linux, libc5
xm_file="${xm_file} sparc/xm-linux.h"
xmake_file=x-linux
tm_file=sparc/linux.h
- tmake_file="t-linux t-linux-gnulibc1"
+ tmake_file="t-slibgcc-elf-ver t-linux t-linux-gnulibc1"
extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
gnu_ld=yes
float_format=sparc
@@ -3048,7 +3121,7 @@ sparc-*-linux*) # Sparc's running GNU/Linux, libc6
xm_file="${xm_file} sparc/xm-linux.h"
xmake_file=x-linux
tm_file=sparc/linux.h
- tmake_file="t-linux"
+ tmake_file="t-slibgcc-elf-ver t-linux"
extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
gnu_ld=yes
if test x$enable_threads = xyes; then
@@ -3095,9 +3168,9 @@ sparcv9-*-solaris2*)
xm_defines="USG POSIX"
tmake_file="sparc/t-sol2 sparc/t-sol2-64"
if test x$gnu_ld = xyes; then
- tmake_file="$tmake_file sparc/t-slibgcc"
+ tmake_file="$tmake_file t-slibgcc-elf-ver"
else
- tmake_file="$tmake_file sparc/t-slibgcc-sld"
+ tmake_file="$tmake_file t-slibgcc-sld"
fi
xmake_file=sparc/x-sysv4
extra_parts="crt1.o crti.o crtn.o gcrt1.o crtbegin.o crtend.o"
@@ -3122,9 +3195,9 @@ sparc-hal-solaris2*)
tm_file="sparc/sol2.h sparc/hal.h"
tmake_file="sparc/t-halos sparc/t-sol2"
if test x$gnu_ld = xyes; then
- tmake_file="$tmake_file sparc/t-slibgcc"
+ tmake_file="$tmake_file t-slibgcc-elf-ver"
else
- tmake_file="$tmake_file sparc/t-slibgcc-sld"
+ tmake_file="$tmake_file t-slibgcc-sld"
fi
xmake_file=sparc/x-sysv4
extra_parts="crt1.o crti.o crtn.o gmon.o crtbegin.o crtend.o"
@@ -3149,9 +3222,9 @@ sparc-*-solaris2*)
xm_defines="USG POSIX"
tmake_file=sparc/t-sol2
if test x$gnu_ld = xyes; then
- tmake_file="$tmake_file sparc/t-slibgcc"
+ tmake_file="$tmake_file t-slibgcc-elf-ver"
else
- tmake_file="$tmake_file sparc/t-slibgcc-sld"
+ tmake_file="$tmake_file t-slibgcc-sld"
fi
xmake_file=sparc/x-sysv4
extra_parts="crt1.o crti.o crtn.o gcrt1.o gmon.o crtbegin.o crtend.o"
@@ -3258,7 +3331,7 @@ sparc64-*-elf*)
extra_parts="crtbegin.o crtend.o"
;;
sparc64-*-linux*) # 64-bit Sparc's running GNU/Linux
- tmake_file="t-linux sparc/t-linux64"
+ tmake_file="t-slibgcc-elf-ver t-linux sparc/t-linux64"
xm_file="sparc/xm-sp64.h sparc/xm-linux.h"
tm_file=sparc/linux64.h
xmake_file=x-linux
@@ -3376,6 +3449,22 @@ xscale-*-coff)
xm_file=arm/xm-arm.h
md_file=arm/arm.md
;;
+xtensa-*-elf*)
+ tm_file="svr4.h xtensa/elf.h ${tm_file}"
+ with_newlib=yes
+ tmake_file=xtensa/t-xtensa
+ extra_parts="crtbegin.o crtend.o"
+ fixincludes=Makefile.in # newlib headers should be OK
+ ;;
+xtensa-*-linux*)
+ tm_file="linux.h xtensa/linux.h ${tm_file}"
+ tmake_file="t-slibgcc-elf-ver t-linux xtensa/t-xtensa"
+ extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
+ gas=yes gnu_ld=yes
+ if test x$enable_threads = xyes; then
+ thread_file='posix'
+ fi
+ ;;
*)
echo "Configuration $machine not supported" 1>&2
exit 1
@@ -3501,7 +3590,7 @@ powerpc*-*-* | rs6000-*-*)
| x601 | x602 | x603 | x603e | x604 | x604e | x620 \
| xec603e | x740 | x750 | x401 \
| x403 | x505 | x801 | x821 | x823 | x860)
- target_cpu_default2="\"$with_cpu\""
+ target_cpu_default2="\\\"$with_cpu\\\""
;;
xyes | xno)
diff --git a/gcc/config.in b/gcc/config.in
index 82e534752da..6033b4f626f 100644
--- a/gcc/config.in
+++ b/gcc/config.in
@@ -1,4 +1,4 @@
-/* config.in. Generated automatically from configure.in by autoheader. */
+/* config.in. Generated automatically from configure.in by autoheader 2.13. */
/* Define if using alloca.c. */
#undef C_ALLOCA
@@ -26,9 +26,6 @@
/* Define if you don't have vprintf but do have _doprnt. */
#undef HAVE_DOPRNT
-/* Define if the `long double' type works. */
-#undef HAVE_LONG_DOUBLE
-
/* Define if you have the ANSI # stringizing operator in cpp. */
#undef HAVE_STRINGIZE
@@ -105,6 +102,9 @@
/* Define to `int' if <sys/types.h> doesn't define. */
#undef ssize_t
+/* Define if cpp should also search $prefix/include. */
+#undef PREFIX_INCLUDE_DIR
+
/* Define if you have the __argz_count function. */
#undef HAVE___ARGZ_COUNT
@@ -150,15 +150,15 @@
/* Define if you have the gettimeofday function. */
#undef HAVE_GETTIMEOFDAY
-/* Define if you have the iconv function. */
-#undef HAVE_ICONV
-
/* Define if you have the isascii function. */
#undef HAVE_ISASCII
/* Define if you have the kill function. */
#undef HAVE_KILL
+/* Define if you have the lstat function. */
+#undef HAVE_LSTAT
+
/* Define if you have the munmap function. */
#undef HAVE_MUNMAP
@@ -219,9 +219,6 @@
/* Define if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H
-/* Define if you have the <iconv.h> header file. */
-#undef HAVE_ICONV_H
-
/* Define if you have the <langinfo.h> header file. */
#undef HAVE_LANGINFO_H
@@ -312,12 +309,21 @@
character sets for source code. */
#undef MULTIBYTE_CHARS
+/* Define if your compiler supports the `long double' type. */
+#undef HAVE_LONG_DOUBLE
+
+/* Define if the `_Bool' type is built-in. */
+#undef HAVE__BOOL
+
/* Always define this when using the GNU C Library */
#undef _GNU_SOURCE
/* Define if your compiler understands volatile. */
#undef HAVE_VOLATILE
+/* Define if you have a working <stdbool.h> header file. */
+#undef HAVE_STDBOOL_H
+
/* Define if you can safely include both <string.h> and <strings.h>. */
#undef STRING_WITH_STRINGS
@@ -339,6 +345,12 @@
/* Define if read-only mmap of a plain file works. */
#undef HAVE_MMAP_FILE
+/* Define if you have the iconv() function. */
+#undef HAVE_ICONV
+
+/* Define as const if the declaration of iconv() needs const. */
+#undef ICONV_CONST
+
/* Define to 1 if we found this declaration otherwise define to 0. */
#undef HAVE_DECL_BCOPY
@@ -431,6 +443,12 @@
/* Define if your assembler supports .hidden. */
#undef HAVE_GAS_HIDDEN
+/* Define if your assembler supports .uleb128. */
+#undef HAVE_AS_LEB128
+
+/* Define if your assembler mis-optimizes .eh_frame data. */
+#undef USE_AS_TRADITIONAL_FORMAT
+
/* Define if your assembler supports .register. */
#undef HAVE_AS_REGISTER_PSEUDO_OP
@@ -449,6 +467,9 @@
/* Define to 1 if you want to enable namespaces (-fhonor-std) by default. */
#undef ENABLE_STD_NAMESPACE
+/* Define 0/1 to force the choice for exception handling model. */
+#undef CONFIG_SJLJ_EXCEPTIONS
+
/* Bison unconditionally undefines `const' if neither `__STDC__' nor
__cplusplus are defined. That's a problem since we use `const' in
diff --git a/gcc/config/1750a/1750a.h b/gcc/config/1750a/1750a.h
index 94f4262ef0f..ea2e8bb5eee 100644
--- a/gcc/config/1750a/1750a.h
+++ b/gcc/config/1750a/1750a.h
@@ -1048,8 +1048,6 @@ enum reg_class { NO_REGS, R2, R0_1, INDEX_REGS, BASE_REGS, ALL_REGS, LIM_REG_CLA
/****************** Assembler output formatting **********************/
-#define ASM_IDENTIFY_GCC(FILE) fputs ("; gcc2_compiled:\n", FILE)
-
#define ASM_COMMENT_START ";"
#define ASM_OUTPUT_FUNNAM(FILE,NAME) \
diff --git a/gcc/config/a29k/a29k.c b/gcc/config/a29k/a29k.c
index 5a87e940e06..5621e0c726e 100644
--- a/gcc/config/a29k/a29k.c
+++ b/gcc/config/a29k/a29k.c
@@ -29,7 +29,6 @@ Boston, MA 02111-1307, USA. */
#include "real.h"
#include "insn-config.h"
#include "conditions.h"
-#include "insn-flags.h"
#include "output.h"
#include "insn-attr.h"
#include "flags.h"
diff --git a/gcc/config/a29k/rtems.h b/gcc/config/a29k/rtems.h
index e2adcc8fd5e..1cfeff218fd 100644
--- a/gcc/config/a29k/rtems.h
+++ b/gcc/config/a29k/rtems.h
@@ -1,5 +1,5 @@
/* Definitions for rtems targeting a AMD A29K using COFF.
- Copyright (C) 1997, 1998, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1998, 2000, 2002 Free Software Foundation, Inc.
Contributed by Joel Sherrill (joel@OARcorp.com).
This file is part of GNU CC.
@@ -24,7 +24,7 @@ Boston, MA 02111-1307, USA. */
/* Specify predefined symbols in preprocessor. */
#undef CPP_PREDEFINES
-#define CPP_PREDEFINES "-D_AM29K -D_AM29000 -D_EPI -Drtems -D__rtems__ \
+#define CPP_PREDEFINES "-D_AM29K -D_AM29000 -D_EPI -D__rtems__ \
-Asystem(rtems) -Acpu(a29k) -Amachine(a29k)"
/* Generate calls to memcpy, memcmp and memset. */
diff --git a/gcc/config/a29k/xm-a29k.h b/gcc/config/a29k/xm-a29k.h
index 774e34b38a8..fbf6c2f7ca9 100644
--- a/gcc/config/a29k/xm-a29k.h
+++ b/gcc/config/a29k/xm-a29k.h
@@ -18,11 +18,6 @@ along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-
-/* #defines that need visibility everywhere. */
-#define FALSE 0
-#define TRUE 1
-
/* This describes the machine the compiler is hosted on. */
#define HOST_BITS_PER_CHAR 8
#define HOST_BITS_PER_SHORT 16
diff --git a/gcc/config/a29k/xm-unix.h b/gcc/config/a29k/xm-unix.h
index 206d8fdc41d..b8a19421a41 100644
--- a/gcc/config/a29k/xm-unix.h
+++ b/gcc/config/a29k/xm-unix.h
@@ -18,10 +18,6 @@ along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-/* #defines that need visibility everywhere. */
-#define FALSE 0
-#define TRUE 1
-
/* This describes the machine the compiler is hosted on. */
#define HOST_BITS_PER_CHAR 8
#define HOST_BITS_PER_SHORT 16
diff --git a/gcc/config/alpha/alpha-protos.h b/gcc/config/alpha/alpha-protos.h
index c12b92d9c79..06ecfa3848b 100644
--- a/gcc/config/alpha/alpha-protos.h
+++ b/gcc/config/alpha/alpha-protos.h
@@ -100,6 +100,7 @@ extern int alpha_expand_block_move PARAMS ((rtx []));
extern int alpha_expand_block_clear PARAMS ((rtx []));
extern int alpha_adjust_cost PARAMS ((rtx, rtx, rtx, int));
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));
diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c
index 25d7d3b503f..6a791c735d6 100644
--- a/gcc/config/alpha/alpha.c
+++ b/gcc/config/alpha/alpha.c
@@ -1,6 +1,6 @@
/* Subroutines used for code generation on the DEC Alpha.
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000 Free Software Foundation, Inc.
+ 2000, 2001 Free Software Foundation, Inc.
Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
This file is part of GNU CC.
@@ -29,7 +29,6 @@ Boston, MA 02111-1307, USA. */
#include "real.h"
#include "insn-config.h"
#include "conditions.h"
-#include "insn-flags.h"
#include "output.h"
#include "insn-attr.h"
#include "flags.h"
@@ -343,6 +342,19 @@ override_options ()
if (!g_switch_set)
g_switch_value = 8;
+ /* Align labels and loops for optimal branching. */
+ /* ??? Kludge these by not doing anything if we don't optimize and also if
+ we are writing ECOFF symbols to work around a bug in DEC's assembler. */
+ if (optimize > 0 && write_symbols != SDB_DEBUG)
+ {
+ if (align_loops <= 0)
+ align_loops = 16;
+ if (align_jumps <= 0)
+ align_jumps = 16;
+ }
+ if (align_functions <= 0)
+ align_functions = 16;
+
/* Acquire a unique set number for our register saves and restores. */
alpha_sr_alias_set = new_alias_set ();
@@ -2324,10 +2336,10 @@ alpha_emit_xfloating_compare (code, op0, op1)
operands[1] = op1;
out = gen_reg_rtx (DImode);
- /* ??? Strange equiv cause what's actually returned is -1,0,1, not a
- proper boolean value. */
- alpha_emit_xfloating_libcall (func, out, operands, 2,
- gen_rtx_COMPARE (TFmode, op0, op1));
+ /* ??? Strange mode for equiv because what's actually returned
+ is -1,0,1, not a proper boolean value. */
+ alpha_emit_xfloating_libcall (func, out, operands, 2,
+ gen_rtx_fmt_ee (code, CCmode, op0, op1));
return out;
}
@@ -3665,8 +3677,8 @@ alpha_mark_machine_status (p)
if (machine)
{
- ggc_mark_rtx (machine->eh_epilogue_sp_ofs);
ggc_mark_rtx (machine->ra_rtx);
+ ggc_mark_rtx (machine->gp_save_rtx);
}
}
@@ -3708,6 +3720,29 @@ alpha_return_addr (count, frame)
return reg;
}
+/* Return or create a pseudo containing the gp value for the current
+ function. Needed only if TARGET_LD_BUGGY_LDGP. */
+
+rtx
+alpha_gp_save_rtx ()
+{
+ rtx init, reg;
+
+ reg = cfun->machine->gp_save_rtx;
+ if (reg == NULL)
+ {
+ reg = gen_reg_rtx (DImode);
+ cfun->machine->gp_save_rtx = reg;
+ init = gen_rtx_SET (VOIDmode, reg, gen_rtx_REG (DImode, 29));
+
+ push_topmost_sequence ();
+ emit_insn_after (init, get_insns ());
+ pop_topmost_sequence ();
+ }
+
+ return reg;
+}
+
static int
alpha_ra_ever_killed ()
{
@@ -4317,6 +4352,7 @@ alpha_va_arg (valist, type)
tree t;
tree offset_field, base_field, addr_tree, addend;
tree wide_type, wide_ofs;
+ int indirect = 0;
if (TARGET_OPEN_VMS)
return std_expand_builtin_va_arg (valist, type);
@@ -4335,7 +4371,13 @@ alpha_va_arg (valist, type)
wide_ofs = save_expr (build1 (CONVERT_EXPR, wide_type, offset_field));
addend = wide_ofs;
- if (FLOAT_TYPE_P (type))
+
+ if (TYPE_MODE (type) == TFmode || TYPE_MODE (type) == TCmode)
+ {
+ indirect = 1;
+ tsize = UNITS_PER_WORD;
+ }
+ else if (FLOAT_TYPE_P (type))
{
tree fpaddend, cond;
@@ -4361,6 +4403,12 @@ alpha_va_arg (valist, type)
TREE_SIDE_EFFECTS (t) = 1;
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
+ if (indirect)
+ {
+ addr = force_reg (Pmode, addr);
+ addr = gen_rtx_MEM (Pmode, addr);
+ }
+
return addr;
}
@@ -4417,6 +4465,18 @@ alpha_sa_mask (imaskP, fmaskP)
fmask |= (1L << (i - 32));
}
+ /* We need to restore these for the handler. */
+ if (current_function_calls_eh_return)
+ {
+ for (i = 0; ; ++i)
+ {
+ unsigned regno = EH_RETURN_DATA_REGNO (i);
+ if (regno == INVALID_REGNUM)
+ break;
+ imask |= 1L << regno;
+ }
+ }
+
if (imask || fmask || alpha_ra_ever_killed ())
imask |= (1L << REG_RA);
}
@@ -5113,7 +5173,11 @@ alpha_expand_epilogue ()
fp_offset = 0;
sa_reg = stack_pointer_rtx;
- eh_ofs = cfun->machine->eh_epilogue_sp_ofs;
+ if (current_function_calls_eh_return)
+ eh_ofs = EH_RETURN_STACKADJ_RTX;
+ else
+ eh_ofs = NULL_RTX;
+
if (sa_size)
{
/* If we have a frame pointer, restore SP from it. */
@@ -5141,12 +5205,11 @@ alpha_expand_epilogue ()
/* Restore registers in order, excepting a true frame pointer. */
+ mem = gen_rtx_MEM (DImode, plus_constant (sa_reg, reg_offset));
if (! eh_ofs)
- {
- mem = gen_rtx_MEM (DImode, plus_constant(sa_reg, reg_offset));
- MEM_ALIAS_SET (mem) = alpha_sr_alias_set;
- FRP (emit_move_insn (gen_rtx_REG (DImode, REG_RA), mem));
- }
+ MEM_ALIAS_SET (mem) = alpha_sr_alias_set;
+ FRP (emit_move_insn (gen_rtx_REG (DImode, REG_RA), mem));
+
reg_offset += 8;
imask &= ~(1L << REG_RA);
@@ -5469,7 +5532,7 @@ summarize_insn (x, sum, set)
case CONST_INT: case CONST_DOUBLE:
case SYMBOL_REF: case LABEL_REF: case CONST:
- case SCRATCH:
+ case SCRATCH: case ASM_INPUT:
break;
/* Handle common unary and binary ops for efficiency. */
diff --git a/gcc/config/alpha/alpha.h b/gcc/config/alpha/alpha.h
index dc2a1ec4439..ce644f1747c 100644
--- a/gcc/config/alpha/alpha.h
+++ b/gcc/config/alpha/alpha.h
@@ -186,6 +186,9 @@ extern enum alpha_fp_trap_mode alpha_fptm;
#ifndef TARGET_PROFILING_NEEDS_GP
#define TARGET_PROFILING_NEEDS_GP 0
#endif
+#ifndef TARGET_LD_BUGGY_LDGP
+#define TARGET_LD_BUGGY_LDGP 0
+#endif
/* Macro to define tables used to set the flags.
This is a list in braces of pairs in braces,
@@ -494,7 +497,7 @@ extern const char *alpha_mlat_string; /* For -mmemory-latency= */
#define STACK_BOUNDARY 64
/* Allocation boundary (in *bits*) for the code of a function. */
-#define FUNCTION_BOUNDARY 128
+#define FUNCTION_BOUNDARY 32
/* Alignment of field after `int : 0' in a structure. */
#define EMPTY_FIELD_BOUNDARY 64
@@ -505,22 +508,6 @@ extern const char *alpha_mlat_string; /* For -mmemory-latency= */
/* A bitfield declared as `int' forces `int' alignment for the struct. */
#define PCC_BITFIELD_TYPE_MATTERS 1
-/* Align loop starts for optimal branching.
-
- ??? Kludge this and the next macro for the moment by not doing anything if
- we don't optimize and also if we are writing ECOFF symbols to work around
- a bug in DEC's assembler. */
-
-#define LOOP_ALIGN(LABEL) \
- (optimize > 0 && write_symbols != SDB_DEBUG ? 4 : 0)
-
-/* This is how to align an instruction for optimal branching. On
- Alpha we'll get better performance by aligning on an octaword
- boundary. */
-
-#define LABEL_ALIGN_AFTER_BARRIER(FILE) \
- (optimize > 0 && write_symbols != SDB_DEBUG ? 4 : 0)
-
/* No data type wants to be aligned rounder than this. */
#define BIGGEST_ALIGNMENT 128
@@ -1213,11 +1200,11 @@ extern struct alpha_compare alpha_compare;
struct machine_function
{
- /* An offset to apply to the stack pointer when unwinding from EH. */
- struct rtx_def *eh_epilogue_sp_ofs;
-
/* If non-null, this rtx holds the return address for the function. */
struct rtx_def *ra_rtx;
+
+ /* If non-null, this rtx holds a saved copy of the GP for the function. */
+ struct rtx_def *gp_save_rtx;
};
/* Make (or fake) .linkage entry for function call.
@@ -1342,6 +1329,13 @@ do { \
/* Before the prologue, RA lives in $26. */
#define INCOMING_RETURN_ADDR_RTX gen_rtx_REG (Pmode, 26)
#define DWARF_FRAME_RETURN_COLUMN DWARF_FRAME_REGNUM (26)
+
+/* Describe how we implement __builtin_eh_return. */
+#define EH_RETURN_DATA_REGNO(N) ((N) < 4 ? (N) + 16 : INVALID_REGNUM)
+#define EH_RETURN_STACKADJ_RTX gen_rtx_REG (Pmode, 28)
+#define EH_RETURN_HANDLER_RTX \
+ gen_rtx_MEM (Pmode, plus_constant (stack_pointer_rtx, \
+ current_function_outgoing_args_size))
/* Addressing modes, and classification of registers for them. */
@@ -1926,15 +1920,6 @@ do { \
/* Control the assembler format that we output. */
-/* We don't emit these labels, so as to avoid getting linker errors about
- missing exception handling info. If we emit a gcc_compiled. label into
- text, and the file has no code, then the DEC assembler gives us a zero
- sized text section with no associated exception handling info. The
- DEC linker sees this text section, and gives a warning saying that
- the exception handling info is missing. */
-#define ASM_IDENTIFY_GCC(x)
-#define ASM_IDENTIFY_LANGUAGE(x)
-
/* Output to assembler file text saying following lines
may contain character constants, extra white space, comments, etc. */
diff --git a/gcc/config/alpha/alpha.md b/gcc/config/alpha/alpha.md
index 9961617a3dc..cafee4453e7 100644
--- a/gcc/config/alpha/alpha.md
+++ b/gcc/config/alpha/alpha.md
@@ -4276,6 +4276,20 @@
}
}")
+(define_insn "*call_osf_1_noreturn"
+ [(call (mem:DI (match_operand:DI 0 "call_operand" "c,R,i"))
+ (match_operand 1 "" ""))
+ (clobber (reg:DI 27))
+ (clobber (reg:DI 26))]
+ "! TARGET_WINDOWS_NT && ! TARGET_OPEN_VMS
+ && find_reg_note (insn, REG_NORETURN, NULL_RTX)"
+ "@
+ jsr $26,($27),0
+ bsr $26,$%0..ng
+ jsr $26,%0"
+ [(set_attr "type" "jsr")
+ (set_attr "length" "*,*,8")])
+
(define_insn "*call_osf_1"
[(call (mem:DI (match_operand:DI 0 "call_operand" "c,R,i"))
(match_operand 1 "" ""))
@@ -4659,7 +4673,7 @@
"
{
alpha_split_tfmode_pair (operands);
- if (rtx_equal_p (operands[0], operands[3]))
+ if (reg_overlap_mentioned_p (operands[0], operands[3]))
{
rtx tmp;
tmp = operands[0], operands[0] = operands[1], operands[1] = tmp;
@@ -4717,7 +4731,7 @@
st%, %R1,%0"
[(set_attr "type" "ilog,iadd,iadd,ild,ist,fcpys,fld,fst")])
-(define_insn "*movsf_fix"
+(define_insn "*movsi_fix"
[(set (match_operand:SI 0 "nonimmediate_operand" "=r,r,r,r,m,*f,*f,m,r,*f")
(match_operand:SI 1 "input_operand" "rJ,K,L,m,rJ,*fJ,m,*f,*f,r"))]
"! TARGET_WINDOWS_NT && ! TARGET_OPEN_VMS && TARGET_FIX
@@ -5886,22 +5900,6 @@
DONE;
}")
-(define_expand "eh_epilogue"
- [(use (match_operand:DI 0 "register_operand" "r"))
- (use (match_operand:DI 1 "register_operand" "r"))
- (use (match_operand:DI 2 "register_operand" "r"))]
- "! TARGET_OPEN_VMS"
- "
-{
- cfun->machine->eh_epilogue_sp_ofs = operands[1];
- if (GET_CODE (operands[2]) != REG || REGNO (operands[2]) != 26)
- {
- rtx ra = gen_rtx_REG (Pmode, 26);
- emit_move_insn (ra, operands[2]);
- operands[2] = ra;
- }
-}")
-
;; In creating a large stack frame, NT _must_ use ldah+lda to load
;; the frame size into a register. We use this pattern to ensure
;; we get lda instead of addq.
@@ -5961,13 +5959,36 @@
[(set_attr "length" "12")
(set_attr "type" "multi")])
-(define_insn "exception_receiver"
- [(unspec_volatile [(const_int 0)] 7)]
+(define_expand "exception_receiver"
+ [(unspec_volatile [(match_dup 0)] 7)]
"! TARGET_OPEN_VMS && ! TARGET_WINDOWS_NT"
- "br $29,$LSJ%=\\n$LSJ%=:\;ldgp $29,0($29)"
- [(set_attr "length" "12")
+ "
+{
+ if (TARGET_LD_BUGGY_LDGP)
+ operands[0] = alpha_gp_save_rtx ();
+ else
+ operands[0] = const0_rtx;
+}")
+
+(define_insn "*exception_receiver_1"
+ [(unspec_volatile [(const_int 0)] 7)]
+ "! TARGET_LD_BUGGY_LDGP"
+ "ldgp $29,0($26)"
+ [(set_attr "length" "8")
(set_attr "type" "multi")])
+;; ??? We don't represent the usage of $29 properly in address loads
+;; and function calls. This leads to the following move being deleted
+;; as dead code unless it is represented as a volatile unspec.
+
+(define_insn "*exception_receiver_2"
+ [(unspec_volatile [(match_operand:DI 0 "nonimmediate_operand" "r,m")] 7)]
+ "TARGET_LD_BUGGY_LDGP"
+ "@
+ mov %0,$29
+ ldq $29,%0"
+ [(set_attr "type" "ilog,ild")])
+
(define_expand "nonlocal_goto_receiver"
[(unspec_volatile [(const_int 0)] 1)
(set (reg:DI 27) (mem:DI (reg:DI 29)))
diff --git a/gcc/config/alpha/elf.h b/gcc/config/alpha/elf.h
index 9224a393d47..a77a64328d9 100644
--- a/gcc/config/alpha/elf.h
+++ b/gcc/config/alpha/elf.h
@@ -66,31 +66,9 @@ do { \
} \
} while (0)
-/* Attach a special .ident directive to the end of the file to identify
- the version of GCC which compiled this code. The format of the
- .ident string is patterned after the ones produced by native svr4
- C compilers. */
-
#undef IDENT_ASM_OP
#define IDENT_ASM_OP "\t.ident\t"
-#ifdef IDENTIFY_WITH_IDENT
-#undef ASM_IDENTIFY_GCC
-#define ASM_IDENTIFY_GCC(FILE) /* nothing */
-#undef ASM_IDENTIFY_LANGUAGE
-#define ASM_IDENTIFY_LANGUAGE(FILE) \
- fprintf(FILE, "%s\"GCC (%s) %s\"\n", IDENT_ASM_OP, \
- lang_identify(), version_string)
-#else
-#undef ASM_FILE_END
-#define ASM_FILE_END(FILE) \
-do { \
- if (!flag_no_ident) \
- fprintf ((FILE), "%s\"GCC: (GNU) %s\"\n", \
- IDENT_ASM_OP, version_string); \
- } while (0)
-#endif
-
/* Allow #sccs in preprocessor. */
#define SCCS_DIRECTIVE
@@ -480,6 +458,8 @@ void FN () \
} \
while (0)
+#define MAKE_DECL_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 1)
+
#define UNIQUE_SECTION_P(DECL) (DECL_ONE_ONLY (DECL))
#undef UNIQUE_SECTION
@@ -707,3 +687,14 @@ void FN () \
#undef UNALIGNED_SHORT_ASM_OP
#undef UNALIGNED_INT_ASM_OP
#undef UNALIGNED_DOUBLE_INT_ASM_OP
+
+/* Select a format to encode pointers in exception handling data. CODE
+ is 0 for data, 1 for code labels, 2 for function pointers. GLOBAL is
+ true if the symbol may be affected by dynamic relocations.
+
+ Since application size is already constrained to <2GB by the form of
+ the ldgp relocation, we can use a 32-bit pc-relative relocation to
+ static data. Dynamic data is accessed indirectly to allow for read
+ only EH sections. */
+#define ASM_PREFERRED_EH_DATA_FORMAT(CODE,GLOBAL) \
+ (((GLOBAL) ? DW_EH_PE_indirect : 0) | DW_EH_PE_pcrel | DW_EH_PE_sdata4)
diff --git a/gcc/config/alpha/freebsd.h b/gcc/config/alpha/freebsd.h
index f7c76b2a876..494fdab7a98 100644
--- a/gcc/config/alpha/freebsd.h
+++ b/gcc/config/alpha/freebsd.h
@@ -19,10 +19,6 @@ along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
-#undef CPP_PREDEFINES
-#define CPP_PREDEFINES \
- "-D__ELF__ -Dunix -D__FreeBSD__ -Asystem(unix) -Asystem(bsd) -Asystem(FreeBSD)"
-
/* Provide a CPP_SPEC appropriate for FreeBSD/alpha. Besides the dealing with
the GCC option `-posix', and PIC issues as on all FreeBSD platforms, we must
deal with the Alpha's FP issues. */
diff --git a/gcc/config/alpha/linux.h b/gcc/config/alpha/linux.h
index c8f649a7582..e2a6e6004d7 100644
--- a/gcc/config/alpha/linux.h
+++ b/gcc/config/alpha/linux.h
@@ -28,8 +28,15 @@ Boston, MA 02111-1307, USA. */
"-Dlinux -Dunix -Asystem=linux -D_LONGLONG -D__alpha__ " \
SUB_CPP_PREDEFINES
+/* The GNU C++ standard library requires that these macros be defined. */
+#undef CPLUSPLUS_CPP_SPEC
+#define CPLUSPLUS_CPP_SPEC "-D_GNU_SOURCE %(cpp)"
+
#undef LIB_SPEC
-#define LIB_SPEC "%{pg:-lgmon} %{pg:-lc_p} %{!pg:-lc}"
+#define LIB_SPEC \
+ "%{shared: -lc} \
+ %{!shared: %{pthread:-lpthread} \
+ %{profile:-lc_p} %{!profile: -lc}}"
/* Show that we need a GP when profiling. */
#undef TARGET_PROFILING_NEEDS_GP
@@ -44,3 +51,54 @@ SUB_CPP_PREDEFINES
/* Define this so that all GNU/Linux targets handle the same pragmas. */
#define HANDLE_PRAGMA_PACK_PUSH_POP
+
+/* Do code reading to identify a signal frame, and set the frame
+ state data appropriately. See unwind-dw2.c for the structs. */
+
+#ifdef IN_LIBGCC2
+#include <signal.h>
+#include <sys/ucontext.h>
+#endif
+
+#define MD_FALLBACK_FRAME_STATE_FOR(CONTEXT, FS, SUCCESS) \
+ do { \
+ unsigned int *pc_ = (CONTEXT)->ra; \
+ struct sigcontext *sc_; \
+ long new_cfa_, i_; \
+ \
+ if (pc_[0] != 0x47fe0410 /* mov $30,$16 */ \
+ || pc_[2] != 0x00000083 /* callsys */) \
+ break; \
+ if (pc_[1] == 0x201f0067) /* lda $0,NR_sigreturn */ \
+ sc_ = (CONTEXT)->cfa; \
+ else if (pc_[1] == 0x201f015f) /* lda $0,NR_rt_sigreturn */ \
+ { \
+ struct rt_sigframe { \
+ struct siginfo info; \
+ struct ucontext uc; \
+ } *rt_ = (CONTEXT)->cfa; \
+ sc_ = &rt_->uc.uc_mcontext; \
+ } \
+ else \
+ break; \
+ new_cfa_ = sc_->sc_regs[30]; \
+ (FS)->cfa_how = CFA_REG_OFFSET; \
+ (FS)->cfa_reg = 30; \
+ (FS)->cfa_offset = new_cfa_ - (long) (CONTEXT)->cfa; \
+ for (i_ = 0; i_ < 30; ++i_) \
+ { \
+ (FS)->regs.reg[i_].how = REG_SAVED_OFFSET; \
+ (FS)->regs.reg[i_].loc.offset \
+ = (long)&sc_->sc_regs[i_] - new_cfa_; \
+ } \
+ for (i_ = 0; i_ < 31; ++i_) \
+ { \
+ (FS)->regs.reg[i_+32].how = REG_SAVED_OFFSET; \
+ (FS)->regs.reg[i_+32].loc.offset \
+ = (long)&sc_->sc_fpregs[i_] - new_cfa_; \
+ } \
+ (FS)->regs.reg[31].how = REG_SAVED_OFFSET; \
+ (FS)->regs.reg[31].loc.offset = (long)&sc_->sc_pc - new_cfa_; \
+ (FS)->retaddr_column = 31; \
+ goto SUCCESS; \
+ } while (0)
diff --git a/gcc/config/alpha/osf.h b/gcc/config/alpha/osf.h
index 1d1109b3c2f..6552edbbf13 100644
--- a/gcc/config/alpha/osf.h
+++ b/gcc/config/alpha/osf.h
@@ -36,13 +36,18 @@ Boston, MA 02111-1307, USA. */
-Dunix -D__osf__ -D_LONGLONG -DSYSTYPE_BSD \
-D_SYSTYPE_BSD -Asystem=unix -Asystem=xpg4"
+/* Tru64 UNIX V5 requires additional definitions for 16 byte long double
+ support. Empty by default. */
+
+#define CPP_XFLOAT_SPEC ""
+
/* Accept DEC C flags for multithreaded programs. We use _PTHREAD_USE_D4
instead of PTHREAD_USE_D4 since both have the same effect and the former
doesn't invade the users' namespace. */
#undef CPP_SUBTARGET_SPEC
#define CPP_SUBTARGET_SPEC \
-"%{pthread|threads:-D_REENTRANT} %{threads:-D_PTHREAD_USE_D4}"
+"%{pthread|threads:-D_REENTRANT} %{threads:-D_PTHREAD_USE_D4} %(cpp_xfloat)"
/* Under OSF4, -p and -pg require -lprof1, and -lprof1 requires -lpdf. */
@@ -52,11 +57,13 @@ Boston, MA 02111-1307, USA. */
/* Pass "-G 8" to ld because Alpha's CC does. Pass -O3 if we are
optimizing, -O1 if we are not. Pass -shared, -non_shared or
- -call_shared as appropriate. Also pass -pg. */
+ -call_shared as appropriate. Pass -hidden_symbol so that our
+ constructor and call-frame data structures are not accidentally
+ overridden. */
#define LINK_SPEC \
"-G 8 %{O*:-O3} %{!O*:-O1} %{static:-non_shared} \
- %{!static:%{shared:-shared} %{!shared:-call_shared}} %{pg} %{taso} \
- %{rpath*}"
+ %{!static:%{shared:-shared -hidden_symbol _GLOBAL_*} \
+ %{!shared:-call_shared}} %{pg} %{taso} %{rpath*}"
#define STARTFILE_SPEC \
"%{!shared:%{pg:gcrt0.o%s}%{!pg:%{p:mcrt0.o%s}%{!p:crt0.o%s}}}"
@@ -79,10 +86,14 @@ Boston, MA 02111-1307, USA. */
ASM_OUTPUT_SOURCE_FILENAME (FILE, main_input_filename); \
}
+/* Tru64 UNIX V5.1 requires a special as flag. Empty by default. */
+
+#define ASM_OLDAS_SPEC ""
+
/* No point in running CPP on our assembler output. */
#if ((TARGET_DEFAULT | TARGET_CPU_DEFAULT) & MASK_GAS) != 0
/* Don't pass -g to GNU as, because some versions don't accept this option. */
-#define ASM_SPEC "%{malpha-as:-g} -nocpp %{pg}"
+#define ASM_SPEC "%{malpha-as:-g %(asm_oldas)} -nocpp %{pg}"
#else
/* In OSF/1 v3.2c, the assembler by default does not output file names which
causes mips-tfile to fail. Passing -g to the assembler fixes this problem.
@@ -91,7 +102,7 @@ Boston, MA 02111-1307, USA. */
if the user does not specify -g. If we don't pass -g, then mips-tfile
will need to be fixed to work in this case. Pass -O0 since some
optimization are broken and don't help us anyway. */
-#define ASM_SPEC "%{!mgas:-g} -nocpp %{pg} -O0"
+#define ASM_SPEC "%{!mgas:-g %(asm_oldas)} -nocpp %{pg} -O0"
#endif
/* Specify to run a post-processor, mips-tfile after the assembler
@@ -120,6 +131,11 @@ Boston, MA 02111-1307, USA. */
#endif
+#undef SUBTARGET_EXTRA_SPECS
+#define SUBTARGET_EXTRA_SPECS \
+ { "cpp_xfloat", CPP_XFLOAT_SPEC }, \
+ { "asm_oldas", ASM_OLDAS_SPEC }
+
/* Indicate that we have a stamp.h to use. */
#ifndef CROSS_COMPILE
#define HAVE_STAMP_H 1
@@ -153,3 +169,40 @@ __enable_execute_stack (addr) \
#define HAS_INIT_SECTION
#define LD_INIT_SWITCH "-init"
#define LD_FINI_SWITCH "-fini"
+
+/* Select a format to encode pointers in exception handling data. CODE
+ is 0 for data, 1 for code labels, 2 for function pointers. GLOBAL is
+ true if the symbol may be affected by dynamic relocations.
+
+ We really ought to be using the SREL32 relocations that ECOFF has,
+ but no version of the native assembler supports creating such things,
+ and Compaq has no plans to rectify this. Worse, the dynamic loader
+ cannot handle unaligned relocations, so we have to make sure that
+ things get padded appropriately. */
+#define ASM_PREFERRED_EH_DATA_FORMAT(CODE,GLOBAL) \
+ (TARGET_GAS \
+ ? (((GLOBAL) ? DW_EH_PE_indirect : 0) | DW_EH_PE_pcrel | DW_EH_PE_sdata4) \
+ : DW_EH_PE_aligned)
+
+/* This is how we tell the assembler that a symbol is weak. */
+
+#define ASM_OUTPUT_WEAK_ALIAS(FILE, NAME, VALUE) \
+ do \
+ { \
+ ASM_GLOBALIZE_LABEL (FILE, NAME); \
+ fputs ("\t.weakext\t", FILE); \
+ assemble_name (FILE, NAME); \
+ if (VALUE) \
+ { \
+ fputc (' ', FILE); \
+ assemble_name (FILE, VALUE); \
+ } \
+ fputc ('\n', FILE); \
+ } \
+ while (0)
+
+#define ASM_WEAKEN_LABEL(FILE, NAME) ASM_OUTPUT_WEAK_ALIAS(FILE, NAME, 0)
+
+/* Handle #pragma weak and #pragma pack. */
+#undef HANDLE_SYSV_PRAGMA
+#define HANDLE_SYSV_PRAGMA 1
diff --git a/gcc/config/alpha/osf5.h b/gcc/config/alpha/osf5.h
index 1c336bd0670..c832c574188 100644
--- a/gcc/config/alpha/osf5.h
+++ b/gcc/config/alpha/osf5.h
@@ -1,5 +1,5 @@
/* Definitions of target machine for GNU compiler, for DEC Alpha on Tru64 5.
- Copyright (C) 2000 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2001 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -20,3 +20,35 @@
#undef LONG_DOUBLE_TYPE_SIZE
#define LONG_DOUBLE_TYPE_SIZE 128
+
+/* Tru64 UNIX V5 has a 16 byte long double type and requires __X_FLOAT to be
+ defined to get the appropriate prototypes for the long double functions
+ in <math.h>. */
+
+#undef CPP_XFLOAT_SPEC
+#define CPP_XFLOAT_SPEC "-D__X_FLOAT"
+
+/* In Tru64 UNIX V5.1, Compaq introduced a new assembler
+ (/usr/lib/cmplrs/cc/adu) which currently (versions between 3.04.29 and
+ 3.04.32) breaks mips-tfile. Passing the undocumented -oldas flag reverts
+ to using the old assembler (/usr/lib/cmplrs/cc/as[01]).
+
+ The V5.0 and V5.0A assemblers silently ignore -oldas, so it can be
+ specified here.
+
+ It is clearly not desirable to depend on this undocumented flag, and
+ Compaq wants -oldas to go away soon, but until they have released a
+ new adu that works with mips-tfile, this is the only option.
+
+ In some versions of the DTK, the assembler driver invokes ld after
+ assembly. This has been fixed in current versions, but adding -c
+ works as expected for all versions. */
+
+#undef ASM_OLDAS_SPEC
+#define ASM_OLDAS_SPEC "-oldas -c"
+
+/* The linker appears to perform invalid code optimizations that result
+ in the ldgp emitted for the exception_receiver pattern being incorrectly
+ linked. */
+#undef TARGET_LD_BUGGY_LDGP
+#define TARGET_LD_BUGGY_LDGP 1
diff --git a/gcc/config/alpha/t-interix b/gcc/config/alpha/t-interix
index d6d80e9c085..85474359320 100644
--- a/gcc/config/alpha/t-interix
+++ b/gcc/config/alpha/t-interix
@@ -4,11 +4,6 @@
# Even LANG_EXTRA_HEADERS may be temporary.
USER_H=$(LANG_EXTRA_HEADERS)
-# We don't want this one either.
-INSTALL_ASSERT_H=
-
-
-
CROSS_LIBGCC1 = libgcc1-asm.a
LIBGCC1 = libgcc1-asm.a
diff --git a/gcc/config/alpha/t-osf4 b/gcc/config/alpha/t-osf4
index 5c7bd8afe65..af1a67dfcbb 100644
--- a/gcc/config/alpha/t-osf4
+++ b/gcc/config/alpha/t-osf4
@@ -7,12 +7,12 @@ TARGET_LIBGCC2_CFLAGS = -fPIC
# Build a shared libgcc library.
SHLIB_EXT = .so
SHLIB_LINK = $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -shared -nodefaultlibs \
- -Wl,-msym -Wl,-set_version,gcc.0 -Wl,-soname,@shlib_base_name@.so.0 \
+ -Wl,-msym -Wl,-set_version,gcc.1 -Wl,-soname,@shlib_base_name@.so.1 \
-o @shlib_base_name@.so @multilib_flags@ @shlib_objs@ -lc && \
- rm -f @shlib_base_name@.so.0 && \
- $(LN_S) @shlib_base_name@.so @shlib_base_name@.so.0
+ rm -f @shlib_base_name@.so.1 && \
+ $(LN_S) @shlib_base_name@.so @shlib_base_name@.so.1
# $(slibdir) double quoted to protect it from expansion while building
# libgcc.mk. We want this delayed until actual install time.
-SHLIB_INSTALL = $(INSTALL_DATA) @shlib_base_name@.so $$(slibdir)/@shlib_base_name@.so.0; \
+SHLIB_INSTALL = $(INSTALL_DATA) @shlib_base_name@.so $$(slibdir)/@shlib_base_name@.so.1; \
rm -f $$(slibdir)/@shlib_base_name@.so; \
- $(LN_S) @shlib_base_name@.so.0 $$(slibdir)/@shlib_base_name@.so
+ $(LN_S) @shlib_base_name@.so.1 $$(slibdir)/@shlib_base_name@.so
diff --git a/gcc/config/alpha/xm-alpha.h b/gcc/config/alpha/xm-alpha.h
index 57ebeb11469..036975c98ef 100644
--- a/gcc/config/alpha/xm-alpha.h
+++ b/gcc/config/alpha/xm-alpha.h
@@ -20,11 +20,6 @@ along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-
-/* #defines that need visibility everywhere. */
-#define FALSE 0
-#define TRUE 1
-
/* This describes the machine the compiler is hosted on. */
#define HOST_BITS_PER_CHAR 8
#define HOST_BITS_PER_SHORT 16
diff --git a/gcc/config/arc/arc.c b/gcc/config/arc/arc.c
index e0ad002a4ff..5c9acc603ca 100644
--- a/gcc/config/arc/arc.c
+++ b/gcc/config/arc/arc.c
@@ -30,7 +30,6 @@ Boston, MA 02111-1307, USA. */
#include "real.h"
#include "insn-config.h"
#include "conditions.h"
-#include "insn-flags.h"
#include "output.h"
#include "insn-attr.h"
#include "flags.h"
diff --git a/gcc/config/arc/arc.h b/gcc/config/arc/arc.h
index 520266b6d88..04121fdc707 100644
--- a/gcc/config/arc/arc.h
+++ b/gcc/config/arc/arc.h
@@ -1260,15 +1260,6 @@ do { \
#undef ASM_FILE_START
#define ASM_FILE_START(FILE) arc_asm_file_start (FILE)
-/* A C statement to output assembler commands which will identify the
- object file as having been compiled with GNU CC (or another GNU
- compiler). */
-#undef ASM_IDENTIFY_GCC
-#define ASM_IDENTIFY_GCC(FILE) /* nothing */
-
-/* Needed because we define ASM_IDENTIFY_GCC. */
-#define ASM_IDENTIFY_LANGUAGE(FILE) output_lang_identify (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/arc/initfini.c b/gcc/config/arc/initfini.c
index 9d4952b8721..dd52be98ffd 100644
--- a/gcc/config/arc/initfini.c
+++ b/gcc/config/arc/initfini.c
@@ -141,7 +141,7 @@ __do_global_ctors ()
asm ("\n\
.section .init\n\
- bl.nd __do_global_ctors\
+ bl.nd __do_global_ctors\n\
ld blink,[fp,4]\n\
j.d blink\n\
ld.a fp,[sp,16]\n\
diff --git a/gcc/config/arc/xm-arc.h b/gcc/config/arc/xm-arc.h
index ba011e94be6..3c059d3a59d 100644
--- a/gcc/config/arc/xm-arc.h
+++ b/gcc/config/arc/xm-arc.h
@@ -18,10 +18,6 @@ along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-/* #defines that need visibility everywhere. */
-#define FALSE 0
-#define TRUE 1
-
/* This describes the machine the compiler is hosted on. */
#define HOST_BITS_PER_CHAR 8
#define HOST_BITS_PER_SHORT 16
diff --git a/gcc/config/arm/aof.h b/gcc/config/arm/aof.h
index 60d736a79dd..f10b7c45cb2 100644
--- a/gcc/config/arm/aof.h
+++ b/gcc/config/arm/aof.h
@@ -220,8 +220,6 @@ do \
fputs ("\tEND\n", (STREAM)); \
} while (0);
-#define ASM_IDENTIFY_GCC(STREAM) fputs ("|gcc2_compiled.|\n", (STREAM))
-
#define ASM_COMMENT_START ";"
#define ASM_APP_ON ""
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index d906b14c514..b67ff3905e6 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -32,7 +32,6 @@ Boston, MA 02111-1307, USA. */
#include "real.h"
#include "insn-config.h"
#include "conditions.h"
-#include "insn-flags.h"
#include "output.h"
#include "insn-attr.h"
#include "flags.h"
@@ -4823,7 +4822,13 @@ arm_reload_in_hi (operands)
}
}
- scratch = gen_rtx_REG (SImode, REGNO (operands[2]));
+ /* If the scratch overlaps the output, use the top half of the DImode
+ register we allocated. */
+ if (REGNO (operands[2]) == REGNO (operands[0]))
+ scratch = gen_rtx_REG (SImode, REGNO (operands[2]) + 1);
+ else
+ scratch = gen_rtx_REG (SImode, REGNO (operands[2]));
+
emit_insn (gen_zero_extendqisi2 (scratch,
gen_rtx_MEM (QImode,
plus_constant (base,
@@ -5455,7 +5460,11 @@ add_minipool_backward_ref (fix)
than the one we are trying to add. */
Mnode * min_mp = NULL;
/* This can be negative, since it is only a constraint. */
- HOST_WIDE_INT min_address = fix->address - fix->backwards;
+ /* If the object to be inserted into the pool is larger than
+ a single word, we need to take into account that all words
+ must be reachable. */
+ HOST_WIDE_INT min_address = fix->address - fix->backwards
+ + (fix->fix_size - 4);
Mnode * mp;
/* If we can't reach the current pool from this insn, or if we can't
@@ -7046,6 +7055,8 @@ output_return_instruction (operand, really_return, reverse)
load a single register. On other architectures, the cost is the same.
In 26 bit mode we have to use LDM in order to be able to restore the CPSR. */
if ((live_regs_mask == (1 << LR_REGNUM))
+ && ! TARGET_INTERWORK
+ && ! IS_INTERRUPT (func_type)
&& (! really_return || TARGET_APCS_32))
{
if (! really_return)
diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h
index 3332c220a67..f08ade5185d 100644
--- a/gcc/config/arm/arm.h
+++ b/gcc/config/arm/arm.h
@@ -425,9 +425,9 @@ Unrecognized value in TARGET_CPU_DEFAULT.
{"no-poke-function-name", -ARM_FLAG_POKE, "" }, \
{"fpe", ARM_FLAG_FPE, "" }, \
{"apcs-32", ARM_FLAG_APCS_32, \
- N_("Use the 32bit version of the APCS") }, \
+ N_("Use the 32-bit version of the APCS") }, \
{"apcs-26", -ARM_FLAG_APCS_32, \
- N_("Use the 26bit version of the APCS") }, \
+ N_("Use the 26-bit version of the APCS") }, \
{"apcs-stack-check", ARM_FLAG_APCS_STACK, "" }, \
{"no-apcs-stack-check", -ARM_FLAG_APCS_STACK, "" }, \
{"apcs-float", ARM_FLAG_APCS_FLOAT, \
@@ -454,14 +454,14 @@ Unrecognized value in TARGET_CPU_DEFAULT.
{"words-little-endian", ARM_FLAG_LITTLE_WORDS, \
N_("Assume big endian bytes, little endian words") }, \
{"thumb-interwork", ARM_FLAG_INTERWORK, \
- N_("Support calls between THUMB and ARM instructions sets") }, \
+ N_("Support calls between Thumb and ARM instruction sets") }, \
{"no-thumb-interwork", -ARM_FLAG_INTERWORK, "" }, \
{"abort-on-noreturn", ARM_FLAG_ABORT_NORETURN, \
N_("Generate a call to abort if a noreturn function returns")}, \
{"no-abort-on-noreturn", -ARM_FLAG_ABORT_NORETURN, "" }, \
- {"sched-prolog", -ARM_FLAG_NO_SCHED_PRO, \
+ {"no-sched-prolog", ARM_FLAG_NO_SCHED_PRO, \
N_("Do not move instructions into a function's prologue") }, \
- {"no-sched-prolog", ARM_FLAG_NO_SCHED_PRO, "" }, \
+ {"sched-prolog", -ARM_FLAG_NO_SCHED_PRO, "" }, \
{"single-pic-base", ARM_FLAG_SINGLE_PIC_BASE, \
N_("Do not load the PIC register in function prologues") }, \
{"no-single-pic-base", -ARM_FLAG_SINGLE_PIC_BASE, "" }, \
@@ -896,8 +896,19 @@ extern const char * structure_size_string;
/* Return the regiser number of the N'th (integer) argument. */
#define ARG_REGISTER(N) (N - 1)
+#if 0 /* FIXME: The ARM backend has special code to handle structure
+ returns, and will reserve its own hidden first argument. So
+ if this macro is enabled a *second* hidden argument will be
+ reserved, which will break binary compatability with old
+ toolchains and also thunk handling. One day this should be
+ fixed. */
/* RTX for structure returns. NULL means use a hidden first argument. */
#define STRUCT_VALUE 0
+#else
+/* Register in which address to store a structure value
+ is passed to a function. */
+#define STRUCT_VALUE_REGNUM ARG_REGISTER (1)
+#endif
/* Specify the registers used for certain standard purposes.
The values of these macros are register numbers. */
@@ -1929,7 +1940,7 @@ typedef struct
`assemble_name' uses this. */
#undef ASM_OUTPUT_LABELREF
#define ASM_OUTPUT_LABELREF(FILE, NAME) \
- fprintf (FILE, "%s%s", USER_LABEL_PREFIX, arm_strip_name_encoding (NAME))
+ asm_fprintf (FILE, "%U%s", arm_strip_name_encoding (NAME))
/* If we are referencing a function that is weak then encode a long call
flag in the function name, otherwise if the function is static or
diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md
index f69e0fee170..17c40b0b9dd 100644
--- a/gcc/config/arm/arm.md
+++ b/gcc/config/arm/arm.md
@@ -5239,7 +5239,7 @@
(define_insn "*ldmsi_postinc4"
[(match_parallel 0 "load_multiple_operation"
- [(set (match_operand:SI 1 "s_register_operand" "+r")
+ [(set (match_operand:SI 1 "s_register_operand" "=r")
(plus:SI (match_operand:SI 2 "s_register_operand" "1")
(const_int 16)))
(set (match_operand:SI 3 "arm_hard_register_operand" "")
@@ -5258,7 +5258,7 @@
(define_insn "*ldmsi_postinc3"
[(match_parallel 0 "load_multiple_operation"
- [(set (match_operand:SI 1 "s_register_operand" "+r")
+ [(set (match_operand:SI 1 "s_register_operand" "=r")
(plus:SI (match_operand:SI 2 "s_register_operand" "1")
(const_int 12)))
(set (match_operand:SI 3 "arm_hard_register_operand" "")
@@ -5275,7 +5275,7 @@
(define_insn "*ldmsi_postinc2"
[(match_parallel 0 "load_multiple_operation"
- [(set (match_operand:SI 1 "s_register_operand" "+r")
+ [(set (match_operand:SI 1 "s_register_operand" "=r")
(plus:SI (match_operand:SI 2 "s_register_operand" "1")
(const_int 8)))
(set (match_operand:SI 3 "arm_hard_register_operand" "")
@@ -5361,7 +5361,7 @@
(define_insn "*stmsi_postinc4"
[(match_parallel 0 "store_multiple_operation"
- [(set (match_operand:SI 1 "s_register_operand" "+r")
+ [(set (match_operand:SI 1 "s_register_operand" "=r")
(plus:SI (match_operand:SI 2 "s_register_operand" "1")
(const_int 16)))
(set (mem:SI (match_dup 2))
@@ -5380,7 +5380,7 @@
(define_insn "*stmsi_postinc3"
[(match_parallel 0 "store_multiple_operation"
- [(set (match_operand:SI 1 "s_register_operand" "+r")
+ [(set (match_operand:SI 1 "s_register_operand" "=r")
(plus:SI (match_operand:SI 2 "s_register_operand" "1")
(const_int 12)))
(set (mem:SI (match_dup 2))
@@ -5397,7 +5397,7 @@
(define_insn "*stmsi_postinc2"
[(match_parallel 0 "store_multiple_operation"
- [(set (match_operand:SI 1 "s_register_operand" "+r")
+ [(set (match_operand:SI 1 "s_register_operand" "=r")
(plus:SI (match_operand:SI 2 "s_register_operand" "1")
(const_int 8)))
(set (mem:SI (match_dup 2))
diff --git a/gcc/config/arm/coff.h b/gcc/config/arm/coff.h
index 94999d4b4aa..6265691e352 100644
--- a/gcc/config/arm/coff.h
+++ b/gcc/config/arm/coff.h
@@ -57,13 +57,6 @@ Boston, MA 02111-1307, USA. */
/* A C statement to output assembler commands which will identify the
object file as having been compiled with GNU CC (or another GNU
compiler). */
-/* Define this to NULL so we don't get anything.
- We have ASM_IDENTIFY_LANGUAGE.
- Also, when using stabs, gcc2_compiled must be a stabs entry, not an
- ordinary symbol, or gdb won't see it. The stabs entry must be
- before the N_SO in order for gdb to find it. */
-#define ASM_IDENTIFY_GCC(STREAM) \
- fprintf (STREAM, "%sgcc2_compiled.:\n", LOCAL_LABEL_PREFIX )
/* This outputs a lot of .req's to define alias for various registers.
Let's try to avoid this. */
diff --git a/gcc/config/arm/conix-elf.h b/gcc/config/arm/conix-elf.h
index 2d447a5f602..a626af88fd8 100644
--- a/gcc/config/arm/conix-elf.h
+++ b/gcc/config/arm/conix-elf.h
@@ -99,23 +99,6 @@ func_ptr __DTOR_END__[1] = { (func_ptr) 0 };
} \
while (0)
-/* Don't know how to order these. UNALIGNED_WORD_ASM_OP is in
- dwarf2.out. */
-#define UNALIGNED_WORD_ASM_OP "\t.4byte\t"
-
-#define ASM_OUTPUT_DWARF2_ADDR_CONST(FILE,ADDR) \
- fprintf ((FILE), "%s%s", UNALIGNED_WORD_ASM_OP, ADDR)
-
-#define ASM_OUTPUT_DWARF_ADDR_CONST(FILE,RTX) \
- do \
- { \
- fprintf ((FILE), "%s", UNALIGNED_WORD_ASM_OP); \
- output_addr_const ((FILE), (RTX)); \
- fputc ('\n', (FILE)); \
- } \
- while (0)
-
-
/* The ARM development system defines __main. */
#define NAME__MAIN "__gccmain"
#define SYMBOL__MAIN __gccmain
diff --git a/gcc/config/arm/elf.h b/gcc/config/arm/elf.h
index 32770443494..bb7be334c1a 100644
--- a/gcc/config/arm/elf.h
+++ b/gcc/config/arm/elf.h
@@ -198,19 +198,6 @@ Boston, MA 02111-1307, USA. */
arm_valid_machine_decl_attribute (DECL, IDENTIFIER, ARGS)
-/* A C statement to output assembler commands which will identify the
- object file as having been compiled with GNU CC (or another GNU
- compiler). */
-/* Define this to NULL so we don't get anything.
- We have ASM_IDENTIFY_LANGUAGE.
- Also, when using stabs, gcc2_compiled must be a stabs entry, not an
- ordinary symbol, or gdb won't see it. The stabs entry must be
- before the N_SO in order for gdb to find it. */
-#ifndef ASM_IDENTIFY_GCC
-#define ASM_IDENTIFY_GCC(STREAM) \
- fprintf (STREAM, "%sgcc2_compiled.:\n", LOCAL_LABEL_PREFIX )
-#endif
-
/* This outputs a lot of .req's to define alias for various registers.
Let's try to avoid this. */
#ifndef ASM_FILE_START
diff --git a/gcc/config/arm/lib1funcs.asm b/gcc/config/arm/lib1funcs.asm
index 4e762b49cff..fffa3fa13e8 100644
--- a/gcc/config/arm/lib1funcs.asm
+++ b/gcc/config/arm/lib1funcs.asm
@@ -630,10 +630,12 @@ Lover12:
#ifdef L_dvmd_lnx
@ GNU/Linux division-by zero handler. Used in place of L_dvmd_tls
-#include <asm/unistd.h>
-
-#define SIGFPE 8 @ cant use <asm/signal.h> as it
- @ contains too much C rubbish
+/* Constants taken from <asm/unistd.h> and <asm/signal.h> */
+#define SIGFPE 8
+#define __NR_SYSCALL_BASE 0x900000
+#define __NR_getpid (__NR_SYSCALL_BASE+ 20)
+#define __NR_kill (__NR_SYSCALL_BASE+ 37)
+
FUNC_START div0
stmfd sp!, {r1, lr}
diff --git a/gcc/config/arm/linux-elf.h b/gcc/config/arm/linux-elf.h
index cd1befed8b5..d5951d87c7f 100644
--- a/gcc/config/arm/linux-elf.h
+++ b/gcc/config/arm/linux-elf.h
@@ -1,5 +1,6 @@
/* Definitions for ARM running Linux-based GNU systems using ELF
- Copyright (C) 1993, 1994, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1993, 1994, 1997, 1998, 1999, 2000, 2001
+ Free Software Foundation, Inc.
Contributed by Philip Blundell <philb@gnu.org>
This file is part of GNU CC.
@@ -25,35 +26,12 @@ Boston, MA 02111-1307, USA. */
/* Do not assume anything about header files. */
#define NO_IMPLICIT_EXTERN_C
-#ifndef SUBTARGET_DEFAULT_APCS26
/* Default is to use APCS-32 mode. */
-# define TARGET_DEFAULT (ARM_FLAG_APCS_32 | ARM_FLAG_MMU_TRAPS)
-# ifdef SUBTARGET_OLD_LINKER
-# define SUBTARGET_EXTRA_LINK_SPEC \
- " %{mapcs-26:-m elf32arm26} %{!mapcs-26:-m elf32arm}"
-# else /* new linker */
-# define SUBTARGET_EXTRA_LINK_SPEC \
- " %{mapcs-26:-m armelf_linux26} %{!mapcs-26:-m armelf_linux} -p"
-# endif
-# define SUBTARGET_EXTRA_ASM_SPEC \
- " %{mapcs-26:-mapcs-26} %{!mapcs-26:-mapcs-32}"
-# define MULTILIB_DEFAULTS \
+#define TARGET_DEFAULT (ARM_FLAG_APCS_32 | ARM_FLAG_MMU_TRAPS)
+#define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux -p"
+#define MULTILIB_DEFAULTS \
{ "marm", "mlittle-endian", "mhard-float", "mapcs-32", "mno-thumb-interwork" }
-# define CPP_APCS_PC_DEFAULT_SPEC "-D__APCS_32__"
-#else /* default is APCS-26 */
-# define TARGET_DEFAULT (ARM_FLAG_MMU_TRAPS)
-# ifdef SUBTARGET_OLD_LINKER
-# define SUBTARGET_EXTRA_LINK_SPEC \
- " %{mapcs-32:-m elf32arm} %{!mapcs-32:-m elf32arm26}"
-# else /* new linker */
-# define SUBTARGET_EXTRA_LINK_SPEC \
- " %{mapcs-32:-m armelf_linux} %{!mapcs-32:-m armelf_linux26} -p"
-# endif
-# define SUBTARGET_EXTRA_ASM_SPEC \
- " %{mapcs-32:-mapcs-32} %{!mapcs-32:-mapcs-26}"
-# define MULTILIB_DEFAULTS \
- { "marm", "mlittle-endian", "mhard-float", "mapcs-26", "mno-thumb-interwork" }
-#endif
+#define CPP_APCS_PC_DEFAULT_SPEC "-D__APCS_32__"
/* This was defined in linux.h. Define it here also. */
#undef DEFAULT_VTABLE_THUNKS
@@ -114,27 +92,11 @@ Boston, MA 02111-1307, USA. */
#define USER_LABEL_PREFIX "" /* For ELF the default is no underscores */
#define LOCAL_LABEL_PREFIX "."
-/* Attach a special .ident directive to the end of the file to identify
- the version of GCC which compiled this code. */
#define IDENT_ASM_OP "\t.ident\t"
/* Output #ident as a .ident. */
#define ASM_OUTPUT_IDENT(FILE, NAME) \
fprintf (FILE, "%s\"%s\"\n", IDENT_ASM_OP, NAME);
-
-#ifdef IDENTIFY_WITH_IDENT
-#define ASM_IDENTIFY_GCC(FILE) /* nothing */
-#define ASM_IDENTIFY_LANGUAGE(FILE) \
- fprintf (FILE, "%s\"GCC (%s) %s\"\n", IDENT_ASM_OP, \
- lang_identify (), version_string)
-#else
-#define ASM_FILE_END(FILE) \
-do { \
- if (!flag_no_ident) \
- fprintf ((FILE), "%s\"GCC: (GNU) %s\"\n", \
- IDENT_ASM_OP, version_string); \
- } while (0)
-#endif
/* Support const sections and the ctors and dtors sections for g++.
Note that there appears to be two different ways to support const
@@ -303,3 +265,7 @@ const_section () \
#undef CC1_SPEC
#define CC1_SPEC "%{profile:-p}"
+
+/* The GNU C++ standard library requires that these macros be defined. */
+#undef CPLUSPLUS_CPP_SPEC
+#define CPLUSPLUS_CPP_SPEC "-D_GNU_SOURCE %(cpp)"
diff --git a/gcc/config/arm/rtems-elf.h b/gcc/config/arm/rtems-elf.h
index 23a1a3201db..54a49b2028e 100644
--- a/gcc/config/arm/rtems-elf.h
+++ b/gcc/config/arm/rtems-elf.h
@@ -1,5 +1,5 @@
/* Definitions for RTEMS based ARM systems using ELF
- Copyright (C) 2000 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2002 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -26,12 +26,8 @@ Boston, MA 02111-1307, USA. */
#include "unknown-elf.h"
#undef CPP_PREDEFINES
-#define CPP_PREDEFINES "-Darm -Darm_elf -Drtems -D__rtems__ -D__ELF__ \
+#define CPP_PREDEFINES "-D__rtems__ -D__ELF__ \
-Asystem(rtems) -Acpu(arm) -Amachine(arm)"
-/*#undef INVOKE_main*/
-
-/* Get machine-independent configuration parameters for RTEMS. */
-#include <rtems.h>
-
+#undef INVOKE_main
diff --git a/gcc/config/arm/unknown-elf.h b/gcc/config/arm/unknown-elf.h
index 315baff6920..fab8155f1ef 100644
--- a/gcc/config/arm/unknown-elf.h
+++ b/gcc/config/arm/unknown-elf.h
@@ -103,23 +103,6 @@ rdata_section () \
} \
while (0)
-/* Don't know how to order these. UNALIGNED_WORD_ASM_OP is in
- dwarf2.out. */
-#define UNALIGNED_WORD_ASM_OP "\t.4byte\t"
-
-#define ASM_OUTPUT_DWARF2_ADDR_CONST(FILE,ADDR) \
- fprintf ((FILE), "%s%s", UNALIGNED_WORD_ASM_OP, ADDR)
-
-#define ASM_OUTPUT_DWARF_ADDR_CONST(FILE,RTX) \
- do \
- { \
- fprintf ((FILE), "%s", UNALIGNED_WORD_ASM_OP); \
- output_addr_const ((FILE), (RTX)); \
- fputc ('\n', (FILE)); \
- } \
- while (0)
-
-
/* The ARM development system defines __main. */
#define NAME__MAIN "__gccmain"
#define SYMBOL__MAIN __gccmain
diff --git a/gcc/config/arm/xm-arm.h b/gcc/config/arm/xm-arm.h
index 0899e9f74e5..3996bafd366 100644
--- a/gcc/config/arm/xm-arm.h
+++ b/gcc/config/arm/xm-arm.h
@@ -21,10 +21,6 @@ along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-/* #defines that need visibility everywhere. */
-#define FALSE 0
-#define TRUE 1
-
/* This describes the machine the compiler is hosted on. */
#define HOST_BITS_PER_CHAR 8
#define HOST_BITS_PER_SHORT 16
@@ -65,5 +61,3 @@ Boston, MA 02111-1307, USA. */
#endif
/* EOF xm-arm.h */
-
-
diff --git a/gcc/config/avr/avr.c b/gcc/config/avr/avr.c
index b01f9519859..b1e44bf8071 100644
--- a/gcc/config/avr/avr.c
+++ b/gcc/config/avr/avr.c
@@ -27,7 +27,6 @@
#include "real.h"
#include "insn-config.h"
#include "conditions.h"
-#include "insn-flags.h"
#include "output.h"
#include "insn-attr.h"
#include "flags.h"
@@ -803,7 +802,8 @@ legitimate_address_p (mode, x, strict)
rtx x;
int strict;
{
- int r = 0;
+ enum reg_class r = NO_REGS;
+
if (TARGET_ALL_DEBUG)
{
fprintf (stderr, "mode: (%s) %s %s %s %s:",
@@ -825,9 +825,9 @@ legitimate_address_p (mode, x, strict)
}
if (REG_P (x) && (strict ? REG_OK_FOR_BASE_STRICT_P (x)
: REG_OK_FOR_BASE_NOSTRICT_P (x)))
- r = 'R';
+ r = POINTER_REGS;
else if (CONSTANT_ADDRESS_P (x))
- r = 'S';
+ r = ALL_REGS;
else if (GET_CODE (x) == PLUS
&& REG_P (XEXP (x, 0))
&& GET_CODE (XEXP (x, 1)) == CONST_INT
@@ -839,26 +839,26 @@ legitimate_address_p (mode, x, strict)
if (! strict
|| REGNO (XEXP (x,0)) == REG_Y
|| REGNO (XEXP (x,0)) == REG_Z)
- r = 'Q';
+ r = BASE_POINTER_REGS;
if (XEXP (x,0) == frame_pointer_rtx
|| XEXP (x,0) == arg_pointer_rtx)
- r = 'Q';
+ r = BASE_POINTER_REGS;
}
else if (frame_pointer_needed && XEXP (x,0) == frame_pointer_rtx)
- r = 'U';
+ r = POINTER_Y_REGS;
}
else if ((GET_CODE (x) == PRE_DEC || GET_CODE (x) == POST_INC)
&& REG_P (XEXP (x, 0))
&& (strict ? REG_OK_FOR_BASE_STRICT_P (XEXP (x, 0))
: REG_OK_FOR_BASE_NOSTRICT_P (XEXP (x, 0))))
{
- r = 'T';
+ r = POINTER_REGS;
}
if (TARGET_ALL_DEBUG)
{
fprintf (stderr, " ret = %c\n", r);
}
- return r;
+ return r == NO_REGS ? 0 : (int)r;
}
/* Attempts to replace X with a valid
diff --git a/gcc/config/avr/avr.h b/gcc/config/avr/avr.h
index 34566b62e50..96f2872669e 100644
--- a/gcc/config/avr/avr.h
+++ b/gcc/config/avr/avr.h
@@ -3256,12 +3256,3 @@ extern struct rtx_def *ldi_reg_rtx;
/* Get the standard ELF stabs definitions. */
#include "dbxelf.h"
-
-#undef ASM_IDENTIFY_GCC
-#define ASM_IDENTIFY_GCC(FILE) \
-do \
- { \
- if (write_symbols != DBX_DEBUG) \
- fputs ("gcc2_compiled.:\n", FILE); \
- } \
-while (0)
diff --git a/gcc/config/avr/avr.md b/gcc/config/avr/avr.md
index cd72f1014dc..de7b6100657 100644
--- a/gcc/config/avr/avr.md
+++ b/gcc/config/avr/avr.md
@@ -475,11 +475,10 @@
(set_attr "cc" "clobber,clobber")])
(define_expand "strlenhi"
- [(parallel
- [(set (match_dup 4)
- (unspec:HI [(match_operand:BLK 1 "memory_operand" "")
- (match_operand:QI 2 "const_int_operand" "")
- (match_operand:HI 3 "immediate_operand" "")] 0))])
+ [(set (match_dup 4)
+ (unspec:HI [(match_operand:BLK 1 "memory_operand" "")
+ (match_operand:QI 2 "const_int_operand" "")
+ (match_operand:HI 3 "immediate_operand" "")] 0))
(set (match_dup 4) (plus:HI (match_dup 4)
(const_int -1)))
(set (match_operand:HI 0 "register_operand" "")
diff --git a/gcc/config/avr/libgcc.S b/gcc/config/avr/libgcc.S
index cdf2c3f4ee1..d324a2166a6 100644
--- a/gcc/config/avr/libgcc.S
+++ b/gcc/config/avr/libgcc.S
@@ -137,12 +137,13 @@ __mulhi3_skip1:
add r_arg2L,r_arg2L ; shift multiplicand
adc r_arg2H,r_arg2H
- cpc r_arg2L,__zero_reg__
+ cp r_arg2L,__zero_reg__
+ cpc r_arg2H,__zero_reg__
breq __mulhi3_exit ; while multiplicand != 0
lsr r_arg1H ; gets LSB of multiplier
ror r_arg1L
- cpc r_arg1H,__zero_reg__
+ sbiw r_arg1L,0
brne __mulhi3_loop ; exit if multiplier = 0
__mulhi3_exit:
mov r_arg1H,r_resH ; result to return register
diff --git a/gcc/config/c4x/c4x.c b/gcc/config/c4x/c4x.c
index 48f4451ad69..e468babc2a0 100644
--- a/gcc/config/c4x/c4x.c
+++ b/gcc/config/c4x/c4x.c
@@ -33,9 +33,7 @@ Boston, MA 02111-1307, USA. */
#include "real.h"
#include "insn-config.h"
#include "insn-attr.h"
-#include "insn-codes.h"
#include "conditions.h"
-#include "insn-flags.h"
#include "output.h"
#include "tree.h"
#include "function.h"
diff --git a/gcc/config/c4x/c4x.h b/gcc/config/c4x/c4x.h
index 72ffb37c0ae..e6fee5dafa9 100644
--- a/gcc/config/c4x/c4x.h
+++ b/gcc/config/c4x/c4x.h
@@ -370,7 +370,8 @@ extern const char *c4x_rpts_cycles_string, *c4x_cpu_version_string;
/* If a structure has a floating point field then force structure
to have BLKMODE. */
-#define STRUCT_FORCE_BLK(FIELD) (TREE_CODE (TREE_TYPE (FIELD)) == REAL_TYPE)
+#define MEMBER_TYPE_FORCES_BLK(FIELD) \
+ (TREE_CODE (TREE_TYPE (FIELD)) == REAL_TYPE)
/* Number of bits in the high and low parts of a two stage
load of an immediate constant. */
@@ -629,12 +630,16 @@ extern const char *c4x_rpts_cycles_string, *c4x_cpu_version_string;
#define CLASS_LIKELY_SPILLED_P(CLASS) ((CLASS) == INDEX_REGS)
-/* CCmode is wrongly defined in machmode.def It should have a size
- of UNITS_PER_WORD. */
+/* CCmode is wrongly defined in machmode.def. It should have a size
+ of UNITS_PER_WORD. HFmode is 40-bits and thus fits within a single
+ extended precision register. Similarly, HCmode fits within two
+ extended precision registers. */
#define HARD_REGNO_NREGS(REGNO, MODE) \
-(((MODE) == CCmode || (MODE) == CC_NOOVmode) ? 1 : ((MODE) == HFmode) ? 1 : \
-((GET_MODE_SIZE(MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD))
+(((MODE) == CCmode || (MODE) == CC_NOOVmode) ? 1 : \
+ ((MODE) == HFmode) ? 1 : \
+ ((MODE) == HCmode) ? 2 : \
+ ((GET_MODE_SIZE(MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD))
/* A C expression that is nonzero if the hard register REGNO is preserved
@@ -2162,6 +2167,10 @@ dtors_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) \
{ \
@@ -2184,18 +2193,9 @@ dtors_section () \
} \
else \
output_quoted_string (FILE, main_input_filename); \
- fprintf (FILE, "\n"); \
+ fputs ("\n\t.data\ndata_sec:\n", 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_IDENTIFY_GCC(FILE) \
- if (! TARGET_TI) fputs ("gcc2_compiled.:\n", FILE); \
- fputs ("\t.data\ndata_sec:\n", FILE);
-
#define ASM_COMMENT_START ";"
#define ASM_APP_ON ""
diff --git a/gcc/config/c4x/rtems.h b/gcc/config/c4x/rtems.h
index 97fa417cf6a..e53e8c6aaf5 100644
--- a/gcc/config/c4x/rtems.h
+++ b/gcc/config/c4x/rtems.h
@@ -1,5 +1,5 @@
/* Definitions of RTEMS executing on an TMS320C[34]x using coff
- Copyright (C) 1996, 1997, 1999 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1997, 1999, 2002 Free Software Foundation, Inc.
Contributed by Joel Sherrill (joel@OARcorp.com).
This file is part of GNU CC.
@@ -24,7 +24,7 @@ Boston, MA 02111-1307, USA. */
/* Specify predefined symbols in preprocessor. */
#undef CPP_PREDEFINES
-#define CPP_PREDEFINES "-D__rtems__ -Asystem=rtems"
+#define CPP_PREDEFINES "-D__rtems__ -Asystem=rtems -D__USE_INIT_FINI__"
/* Generate calls to memcpy, memcmp and memset. */
#ifndef TARGET_MEM_FUNCTIONS
diff --git a/gcc/config/c4x/xm-c4x.h b/gcc/config/c4x/xm-c4x.h
index dc329ebc9ba..491032477d1 100644
--- a/gcc/config/c4x/xm-c4x.h
+++ b/gcc/config/c4x/xm-c4x.h
@@ -1,7 +1,3 @@
-/* #defines that need visibility everywhere. */
-#define FALSE 0
-#define TRUE 1
-
/* This describes the machine the compiler is hosted on. */
#define HOST_BITS_PER_CHAR 32
#define HOST_BITS_PER_SHORT 32
@@ -18,4 +14,3 @@
/* Arguments to use with `exit'. */
#define SUCCESS_EXIT_CODE 0
#define FATAL_EXIT_CODE 33
-
diff --git a/gcc/config/clipper/clipper.c b/gcc/config/clipper/clipper.c
index 9e743eb0294..0c3f379569c 100644
--- a/gcc/config/clipper/clipper.c
+++ b/gcc/config/clipper/clipper.c
@@ -28,7 +28,6 @@ Boston, MA 02111-1307, USA. */
#include "real.h"
#include "insn-config.h"
#include "conditions.h"
-#include "insn-flags.h"
#include "output.h"
#include "insn-attr.h"
#include "tree.h"
diff --git a/gcc/config/clipper/xm-clix.h b/gcc/config/clipper/xm-clix.h
index 726660df46a..7e671f6d27e 100644
--- a/gcc/config/clipper/xm-clix.h
+++ b/gcc/config/clipper/xm-clix.h
@@ -1,10 +1,6 @@
/* Config file for Clipper running Clix, system V. 3.2 clone */
-/* #defines that need visibility everywhere. */
-#define FALSE 0
-#define TRUE 1
-
/* target machine dependencies.
tm.h is a symbolic link to the actual target specific file. */
diff --git a/gcc/config/convex/convex.c b/gcc/config/convex/convex.c
index 1b41db35dc7..947a715fccd 100644
--- a/gcc/config/convex/convex.c
+++ b/gcc/config/convex/convex.c
@@ -28,7 +28,6 @@ Boston, MA 02111-1307, USA. */
#include "real.h"
#include "insn-config.h"
#include "conditions.h"
-#include "insn-flags.h"
#include "insn-attr.h"
#include "output.h"
#include "function.h"
diff --git a/gcc/config/convex/xm-convex.h b/gcc/config/convex/xm-convex.h
index aaaa3b1464c..aab0b90946e 100644
--- a/gcc/config/convex/xm-convex.h
+++ b/gcc/config/convex/xm-convex.h
@@ -18,10 +18,6 @@ along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-/* #defines that need visibility everywhere. */
-#define FALSE 0
-#define TRUE 1
-
/* target machine dependencies.
tm.h is a symbolic link to the actual target specific file. */
#include "tm.h"
diff --git a/gcc/config/d30v/d30v.c b/gcc/config/d30v/d30v.c
index c103e81b36b..a4f5e8d8473 100644
--- a/gcc/config/d30v/d30v.c
+++ b/gcc/config/d30v/d30v.c
@@ -28,7 +28,6 @@
#include "real.h"
#include "insn-config.h"
#include "conditions.h"
-#include "insn-flags.h"
#include "output.h"
#include "insn-attr.h"
#include "flags.h"
diff --git a/gcc/config/d30v/d30v.h b/gcc/config/d30v/d30v.h
index 890639a0376..48322136340 100644
--- a/gcc/config/d30v/d30v.h
+++ b/gcc/config/d30v/d30v.h
@@ -4077,28 +4077,6 @@ extern const char *d30v_branch_cost_string;
Defined in svr4.h. */
/* #define ASM_FILE_END(STREAM) */
-/* A C statement to output assembler commands which will identify the object
- file as having been compiled with GNU CC (or another GNU compiler).
-
- If you don't define this macro, the string `gcc_compiled.:' is output. This
- string is calculated to define a symbol which, on BSD systems, will never be
- defined for any other reason. GDB checks for the presence of this symbol
- when reading the symbol table of an executable.
-
- On non-BSD systems, you must arrange communication with GDB in some other
- fashion. If GDB is not used on your system, you can define this macro with
- an empty body.
-
- Defined in svr4.h. */
-/* #define ASM_IDENTIFY_GCC(FILE) */
-
-/* Like ASM_IDENTIFY_GCC, but used when dbx debugging is selected to emit
- a stab the debugger uses to identify gcc as the compiler that is emitted
- after the stabs for the filename, which makes it easier for GDB to parse.
-
- Defined in svr4.h. */
-/* #define ASM_IDENTIFY_GCC_AFTER_SOURCE(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/d30v/xm-d30v.h b/gcc/config/d30v/xm-d30v.h
index 4d3396ec584..024032a9422 100644
--- a/gcc/config/d30v/xm-d30v.h
+++ b/gcc/config/d30v/xm-d30v.h
@@ -19,10 +19,6 @@
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-/* #defines that need visibility everywhere. */
-#define FALSE 0
-#define TRUE 1
-
/* Define this macro if the host system is System V. */
/* #define USG */
diff --git a/gcc/config/dbxelf.h b/gcc/config/dbxelf.h
index 57d97a6af43..8a2c266a82f 100644
--- a/gcc/config/dbxelf.h
+++ b/gcc/config/dbxelf.h
@@ -54,28 +54,6 @@ Boston, MA 02111-1307, USA. */
#define DBX_CONTIN_LENGTH 0
#endif
-/* When using stabs, gcc2_compiled must be a stabs entry, not an
- ordinary symbol, or gdb won't see it. Furthermore, since gdb reads
- the input piecemeal, starting with each N_SO, it's a lot easier if
- the gcc2 flag symbol is *after* the N_SO rather than before it. So
- we emit an N_OPT stab there. */
-
-#define ASM_IDENTIFY_GCC(FILE) \
-do \
- { \
- if (write_symbols != DBX_DEBUG) \
- fputs ("gcc2_compiled.:\n", FILE); \
- } \
-while (0)
-
-#define ASM_IDENTIFY_GCC_AFTER_SOURCE(FILE) \
-do \
- { \
- if (write_symbols == DBX_DEBUG) \
- fputs ("\t.stabs\t\"gcc2_compiled.\", 0x3c, 0, 0, 0\n", FILE); \
- } \
-while (0)
-
/* Like block addresses, stabs line numbers are relative to the
current function. */
diff --git a/gcc/config/dsp16xx/dsp16xx.c b/gcc/config/dsp16xx/dsp16xx.c
index c74ac388411..fbc28c0d505 100644
--- a/gcc/config/dsp16xx/dsp16xx.c
+++ b/gcc/config/dsp16xx/dsp16xx.c
@@ -28,7 +28,6 @@ Boston, MA 02111-1307, USA. */
#include "real.h"
#include "insn-config.h"
#include "conditions.h"
-#include "insn-flags.h"
#include "output.h"
#include "insn-attr.h"
#include "tree.h"
diff --git a/gcc/config/dsp16xx/dsp16xx.h b/gcc/config/dsp16xx/dsp16xx.h
index 86ff76f6312..8aa0556800b 100644
--- a/gcc/config/dsp16xx/dsp16xx.h
+++ b/gcc/config/dsp16xx/dsp16xx.h
@@ -1599,9 +1599,6 @@ const_section () \
/* Output at beginning of assembler file. */
#define ASM_FILE_START(FILE) dsp16xx_file_start ()
-/* Prevent output of .gcc_compiled */
-#define ASM_IDENTIFY_GCC(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/dsp16xx/xm-dsp16xx.h b/gcc/config/dsp16xx/xm-dsp16xx.h
index 11e1fe912d7..752eb82264d 100644
--- a/gcc/config/dsp16xx/xm-dsp16xx.h
+++ b/gcc/config/dsp16xx/xm-dsp16xx.h
@@ -19,10 +19,6 @@ along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-/* #defines that need visibility everywhere. */
-#define FALSE 0
-#define TRUE 1
-
/* This describes the machine the compiler is hosted on. */
#define HOST_BITS_PER_CHAR 8
#define HOST_BITS_PER_SHORT 16
diff --git a/gcc/config/elfos.h b/gcc/config/elfos.h
index 7d9ac7640a5..a955199493b 100644
--- a/gcc/config/elfos.h
+++ b/gcc/config/elfos.h
@@ -21,6 +21,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. */
+
+/* Define a symbol indicating that we are using elfos.h. */
+#define USING_ELFOS_H
+
/* The prefix to add to user-visible assembler symbols.
For ELF systems the convention is *not* to prepend a leading
@@ -94,23 +98,8 @@ Boston, MA 02111-1307, USA. */
#define ASM_OUTPUT_IDENT(FILE, NAME) \
fprintf (FILE, "%s\"%s\"\n", IDENT_ASM_OP, NAME);
-/* Attach a special .ident directive to the end of the file to identify
- the version of GCC which compiled this code. The format of the
- .ident string is patterned after the ones produced by native svr4
- C compilers. */
-
#define IDENT_ASM_OP "\t.ident\t"
-#undef ASM_FILE_END
-#define ASM_FILE_END(FILE) \
- do \
- { \
- if (!flag_no_ident) \
- fprintf ((FILE), "%s\"GCC: (GNU) %s\"\n", \
- IDENT_ASM_OP, version_string); \
- } \
- while (0)
-
#undef ASM_BYTE_OP
#define ASM_BYTE_OP "\t.byte\t"
diff --git a/gcc/config/elxsi/xm-elxsi.h b/gcc/config/elxsi/xm-elxsi.h
index 8264becd898..84f02cb4aa1 100644
--- a/gcc/config/elxsi/xm-elxsi.h
+++ b/gcc/config/elxsi/xm-elxsi.h
@@ -18,10 +18,6 @@ along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-/* #defines that need visibility everywhere. */
-#define FALSE 0
-#define TRUE 1
-
/* target machine dependencies.
tm.h is a symbolic link to the actual target specific file. */
#include "tm.h"
@@ -35,4 +31,3 @@ Boston, MA 02111-1307, USA. */
/* Arguments to use with `exit'. */
#define SUCCESS_EXIT_CODE 0
#define FATAL_EXIT_CODE 33
-
diff --git a/gcc/config/float-i128.h b/gcc/config/float-i128.h
index f7ce3b34894..c61c82f18ac 100644
--- a/gcc/config/float-i128.h
+++ b/gcc/config/float-i128.h
@@ -93,7 +93,7 @@
#undef LDBL_MAX_10_EXP
#define LDBL_MAX_10_EXP 4932
-#if __STDC_VERSION__ >= 199901L
+#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
/* The floating-point expression evaluation method.
-1 indeterminate
0 evaluate all operations and constants just to the range and
diff --git a/gcc/config/float-i32.h b/gcc/config/float-i32.h
index 27e3394a5fb..3e633d8f38d 100644
--- a/gcc/config/float-i32.h
+++ b/gcc/config/float-i32.h
@@ -93,7 +93,7 @@
#undef LDBL_MAX_10_EXP
#define LDBL_MAX_10_EXP 38
-#if __STDC_VERSION__ >= 199901L
+#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
/* The floating-point expression evaluation method.
-1 indeterminate
0 evaluate all operations and constants just to the range and
diff --git a/gcc/config/float-i386.h b/gcc/config/float-i386.h
index 075f2eed736..6abb4f2b7b2 100644
--- a/gcc/config/float-i386.h
+++ b/gcc/config/float-i386.h
@@ -94,7 +94,7 @@
#undef LDBL_MAX_10_EXP
#define LDBL_MAX_10_EXP 4932
-#if __STDC_VERSION__ >= 199901L
+#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
/* The floating-point expression evaluation method.
-1 indeterminate
0 evaluate all operations and constants just to the range and
diff --git a/gcc/config/float-i64.h b/gcc/config/float-i64.h
index b045fb35eef..735f7423635 100644
--- a/gcc/config/float-i64.h
+++ b/gcc/config/float-i64.h
@@ -93,7 +93,7 @@
#undef LDBL_MAX_10_EXP
#define LDBL_MAX_10_EXP 308
-#if __STDC_VERSION__ >= 199901L
+#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
/* The floating-point expression evaluation method.
-1 indeterminate
0 evaluate all operations and constants just to the range and
diff --git a/gcc/config/float-m68k.h b/gcc/config/float-m68k.h
index 8294b66f3d0..837126b7de5 100644
--- a/gcc/config/float-m68k.h
+++ b/gcc/config/float-m68k.h
@@ -94,7 +94,34 @@
#undef LDBL_MAX_10_EXP
#define LDBL_MAX_10_EXP 4932
+#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+ /* The floating-point expression evaluation method.
+ -1 indeterminate
+ 0 evaluate all operations and constants just to the range and
+ precision of the type
+ 1 evaluate operations and constants of type float and double
+ to the range and precision of the double type, evaluate
+ long double operations and constants to the range and
+ precision of the long double type
+ 2 evaluate all operations and constants to the range and
+ precision of the long double type
+ */
+
/* ??? FLT_EVAL_METHOD depends on TARGET_68040_ONLY. We do not currently
have a preprocessor token that we can use to tell that this is on. */
+# undef FLT_EVAL_METHOD
+# define FLT_EVAL_METHOD -1
+
+ /* Number of decimal digits to enable rounding to the given number of
+ decimal digits without loss of precision.
+ if FLT_RADIX == 10^n: #mantissa * log10 (FLT_RADIX)
+ else : ceil (1 + #mantissa * log10 (FLT_RADIX))
+ where #mantissa is the number of bits in the mantissa of the widest
+ supported floating-point type.
+ */
+# undef DECIMAL_DIG
+# define DECIMAL_DIG 21
+
+#endif /* C99 */
#endif /* _FLOAT_H_ */
diff --git a/gcc/config/float-sh.h b/gcc/config/float-sh.h
index 0ff8d3b3cce..598994b5376 100644
--- a/gcc/config/float-sh.h
+++ b/gcc/config/float-sh.h
@@ -130,7 +130,7 @@
#undef LDBL_MAX_10_EXP
#define LDBL_MAX_10_EXP 308
-#if __STDC_VERSION__ >= 199901L
+#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
/* The floating-point expression evaluation method.
-1 indeterminate
0 evaluate all operations and constants just to the range and
diff --git a/gcc/config/float-sparc.h b/gcc/config/float-sparc.h
index 307528e07b3..f3c258388b1 100644
--- a/gcc/config/float-sparc.h
+++ b/gcc/config/float-sparc.h
@@ -119,7 +119,7 @@
#endif /* sparc32 */
-#if __STDC_VERSION__ >= 199901L
+#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
/* The floating-point expression evaluation method.
-1 indeterminate
0 evaluate all operations and constants just to the range and
diff --git a/gcc/config/fp-bit.h b/gcc/config/fp-bit.h
index f4471f9067a..24f701e742b 100644
--- a/gcc/config/fp-bit.h
+++ b/gcc/config/fp-bit.h
@@ -163,6 +163,7 @@ typedef unsigned int UDItype __attribute__ ((mode (DI)));
# define multiply fpmul
# define divide fpdiv
# define compare fpcmp
+# define usi_to_float __floatunsisf
# define si_to_float sitofp
# define float_to_si fptosi
# define float_to_usi fptoui
@@ -175,6 +176,7 @@ typedef unsigned int UDItype __attribute__ ((mode (DI)));
# define multiply dpmul
# define divide dpdiv
# define compare dpcmp
+# define usi_to_float __floatunsidf
# define si_to_float litodp
# define float_to_si dptoli
# define float_to_usi dptoul
diff --git a/gcc/config/fr30/fr30.c b/gcc/config/fr30/fr30.c
index c2ee0055b82..f1f63e1c324 100644
--- a/gcc/config/fr30/fr30.c
+++ b/gcc/config/fr30/fr30.c
@@ -32,7 +32,6 @@ Boston, MA 02111-1307, USA. */
#include "real.h"
#include "insn-config.h"
#include "conditions.h"
-#include "insn-flags.h"
#include "output.h"
#include "insn-attr.h"
#include "flags.h"
diff --git a/gcc/config/fr30/xm-fr30.h b/gcc/config/fr30/xm-fr30.h
index a43a3324c37..04abdf8b77d 100644
--- a/gcc/config/fr30/xm-fr30.h
+++ b/gcc/config/fr30/xm-fr30.h
@@ -19,10 +19,6 @@ along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-/* #defines that need visibility everywhere. */
-#define FALSE 0
-#define TRUE 1
-
/* A C expression for the status code to be returned when the compiler exits
after serious errors. */
#define FATAL_EXIT_CODE 33
diff --git a/gcc/ch/tasking.h b/gcc/config/freebsd-nthr.h
index 7650c2f8cc9..2f1d65f4b24 100644
--- a/gcc/ch/tasking.h
+++ b/gcc/config/freebsd-nthr.h
@@ -1,5 +1,6 @@
-/* Implement process-related declarations for CHILL.
- Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
+/* FreeBSD configuration setting for FreeBSD systems.
+ Copyright (C) 2001 Free Software Foundation, Inc.
+ Contributed by Loren J. Rittle <ljrittle@acm.org>
This file is part of GNU CC.
@@ -18,10 +19,4 @@ along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#ifndef _CH_TASKING_H
-#define _CH_TASKING_H
-
-/* list of this module's process, buffer, etc. decls */
-extern tree tasking_list;
-
-#endif
+#define FBSD_NO_THREADS
diff --git a/gcc/config/freebsd.h b/gcc/config/freebsd.h
index 98a5c9e41b2..02c1182c65c 100644
--- a/gcc/config/freebsd.h
+++ b/gcc/config/freebsd.h
@@ -1,5 +1,5 @@
/* Base configuration file for all FreeBSD targets.
- Copyright (C) 1999, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -22,9 +22,14 @@ Boston, MA 02111-1307, USA. */
All FreeBSD architectures should include this file, which will specify
their commonalities.
Adapted from gcc/config/i386/freebsd-elf.h by
- David O'Brien <obrien@FreeBSD.org>. */
+ David O'Brien <obrien@FreeBSD.org>.
+ Further work by David O'Brien <obrien@FreeBSD.org> and
+ Loren J. Rittle <ljrittle@acm.org>. */
+/* To help with rs6000/sysv4.h carnal knowledge problem. */
+#define _USING_CONFIG_FREEBSD 1
+
/* This defines which switch letters take arguments. On FreeBSD, most of
the normal cases (defined in gcc.c) apply, and we also have -h* and
-z* options (for the linker) (coming from SVR4).
@@ -36,32 +41,115 @@ Boston, MA 02111-1307, USA. */
|| (CHAR) == 'z' /* ignored by ld */ \
|| (CHAR) == 'R')
-#undef SWITCH_TAKES_ARG
+#undef SWITCH_TAKES_ARG
#define SWITCH_TAKES_ARG(CHAR) (FBSD_SWITCH_TAKES_ARG(CHAR))
+/* This defines which multi-letter switches take arguments. */
+
#define FBSD_WORD_SWITCH_TAKES_ARG(STR) \
(DEFAULT_WORD_SWITCH_TAKES_ARG (STR) \
|| !strcmp ((STR), "rpath") || !strcmp ((STR), "rpath-link") \
|| !strcmp ((STR), "soname") || !strcmp ((STR), "defsym") \
|| !strcmp ((STR), "assert") || !strcmp ((STR), "dynamic-linker"))
-#undef WORD_SWITCH_TAKES_ARG
+#undef WORD_SWITCH_TAKES_ARG
#define WORD_SWITCH_TAKES_ARG(STR) (FBSD_WORD_SWITCH_TAKES_ARG(STR))
+#if FBSD_MAJOR == 6
+#define FBSD_CPP_PREDEFINES \
+ "-D__FreeBSD__=6 -Dunix -D__ELF__ -D__KPRINTF_ATTRIBUTE__ -Asystem=unix -Asystem=bsd -Asystem=FreeBSD"
+#endif
+
+#if FBSD_MAJOR == 5
+#define FBSD_CPP_PREDEFINES \
+ "-D__FreeBSD__=5 -Dunix -D__ELF__ -D__KPRINTF_ATTRIBUTE__ -Asystem=unix -Asystem=bsd -Asystem=FreeBSD"
+#endif
+
+#if FBSD_MAJOR == 4
+#define FBSD_CPP_PREDEFINES \
+ "-D__FreeBSD__=4 -Dunix -D__ELF__ -D__KPRINTF_ATTRIBUTE__ -Asystem=unix -Asystem=bsd -Asystem=FreeBSD"
+#endif
+
+#if FBSD_MAJOR == 3
+#define FBSD_CPP_PREDEFINES \
+ "-D__FreeBSD__=3 -Dunix -D__ELF__ -D__KPRINTF_ATTRIBUTE__ -Asystem=unix -Asystem=bsd -Asystem=FreeBSD"
+#endif
+
+#ifndef FBSD_CPP_PREDEFINES
+#define FBSD_CPP_PREDEFINES \
+ "-D__FreeBSD__ -Dunix -D__ELF__ -D__KPRINTF_ATTRIBUTE__ -Asystem=unix -Asystem=bsd -Asystem=FreeBSD"
+#endif
+
+#undef CPP_PREDEFINES
+#define CPP_PREDEFINES FBSD_CPP_PREDEFINES
+
/* Provide a CPP_SPEC appropriate for FreeBSD. We just deal with the GCC
option `-posix', and PIC issues. */
-#undef CPP_SPEC
-#define CPP_SPEC "%(cpp_cpu) \
+#define FBSD_CPP_SPEC " \
+ %(cpp_cpu) \
%{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} \
%{posix:-D_POSIX_SOURCE}"
+#undef CPP_SPEC
+#define CPP_SPEC FBSD_CPP_SPEC
+
+/* Provide a STARTFILE_SPEC appropriate for FreeBSD. Here we add
+ the magical crtbegin.o file (see crtstuff.c) which provides part
+ of the support for getting C++ file-scope static object constructed
+ before entering `main'. */
+
+#define FBSD_STARTFILE_SPEC \
+ "%{!shared: \
+ %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \
+ %{!p:%{profile:gcrt1.o%s} \
+ %{!profile:crt1.o%s}}}} \
+ crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
+
+/* Provide a ENDFILE_SPEC appropriate for FreeBSD. Here we tack on
+ the magical crtend.o file (see crtstuff.c) which provides part of
+ the support for getting C++ file-scope static object constructed
+ before entering `main', followed by a normal "finalizer" file,
+ `crtn.o'. */
+
+#define FBSD_ENDFILE_SPEC \
+ "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
+
+/* Provide a LIB_SPEC appropriate for FreeBSD as configured and as
+ required by the user-land thread model. Before __FreeBSD_version
+ 500016, select the appropriate libc, depending on whether we're
+ doing profiling or need threads support. At __FreeBSD_version
+ 500016 and later, when threads support is requested include both
+ -lc and -lc_r instead of only -lc_r. To make matters interesting,
+ we can't actually use __FreeBSD_version provided by <osreldate.h>
+ directly since it breaks cross-compiling. As a final twist, make
+ it a hard error if -pthread is provided on the command line and gcc
+ was configured with --disable-threads (this will help avoid bug
+ reports from users complaining about threading when they
+ misconfigured the gcc bootstrap but are later consulting FreeBSD
+ manual pages that refer to the mythical -pthread option). */
+
/* Provide a LIB_SPEC appropriate for FreeBSD. Just select the appropriate
libc, depending on whether we're doing profiling or need threads support.
(simular to the default, except no -lg, and no -p). */
-#undef LIB_SPEC
-#define LIB_SPEC " \
+#ifdef FBSD_NO_THREADS
+#define FBSD_LIB_SPEC " \
+ %{pthread: %eThe -pthread option is only supported on FreeBSD when gcc \
+is built with the --enable-threads configure-time option.} \
+ %{!shared: \
+ %{!pg: -lc} \
+ %{pg: -lc_p} \
+ }"
+#else
+#if FBSD_MAJOR >= 5
+#define FBSD_LIB_SPEC " \
+ %{!shared: \
+ %{!pg: %{pthread:-lc_r} -lc} \
+ %{pg: %{pthread:-lc_r_p} -lc_p} \
+ }"
+#else
+#define FBSD_LIB_SPEC " \
%{!shared: \
%{!pg: \
%{!pthread:-lc} \
@@ -70,70 +158,81 @@ Boston, MA 02111-1307, USA. */
%{!pthread:-lc_p} \
%{pthread:-lc_r_p}} \
}"
+#endif
+#endif
+
+#undef LIB_SPEC
+#define LIB_SPEC FBSD_LIB_SPEC
-/* Code generation parameters. */
+/************************[ Target stuff ]***********************************/
-/* Make gcc agree with <machine/ansi.h>. */
+/* Don't assume anything about the header files. */
+#undef NO_IMPLICIT_EXTERN_C
+#define NO_IMPLICIT_EXTERN_C
-#undef WCHAR_TYPE
+/* Allow #sccs in preprocessor. */
+#undef SCCS_DIRECTIVE
+#define SCCS_DIRECTIVE
+
+/* Make gcc agree with FreeBSD's standard headers (<machine/ansi.h>, etc...) */
+
+#undef WCHAR_TYPE
#define WCHAR_TYPE "int"
-#undef WCHAR_UNSIGNED
-#define WCHAR_UNSIGNED 0
+/* Code generation parameters. */
/* Don't default to pcc-struct-return, because gcc is the only compiler, and
we want to retain compatibility with older gcc versions
(even though the SVR4 ABI for the i386 says that records and unions are
returned in memory). */
-#undef DEFAULT_PCC_STRUCT_RETURN
+#undef DEFAULT_PCC_STRUCT_RETURN
#define DEFAULT_PCC_STRUCT_RETURN 0
-/* Ensure we the configuration knows our system correctly so we can link with
- libraries compiled with the native cc. */
+/* Use periods rather than dollar signs in special g++ assembler names.
+ This ensures the configuration knows our system correctly so we can link
+ with libraries compiled with the native cc. */
#undef NO_DOLLAR_IN_LABEL
+/* The prefix to add to user-visible assembler symbols.
+ For System V Release 4 & ELF the convention is *not* to prepend a leading
+ underscore onto user-level symbol names. Some CPU files such as
+ config/sparc/sparc.h set this wrong for ELF. */
+
+#undef USER_LABEL_PREFIX
+#define USER_LABEL_PREFIX ""
+
+/* Handle #pragma weak and #pragma pack. */
+#undef HANDLE_SYSV_PRAGMA
+#define HANDLE_SYSV_PRAGMA
+
/* Use more efficient ``thunks'' to implement C++ vtables. */
#undef DEFAULT_VTABLE_THUNKS
#define DEFAULT_VTABLE_THUNKS 1
-/* This is BSD, so use stabs instead of DWARF debug format. */
-#undef PREFERRED_DEBUGGING_TYPE
-#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
+/************************[ Assembler stuff ]********************************/
-/* Attach a special .ident directive to the end of the file to identify
- the version of GCC which compiled this code. The format of the .ident
- string is patterned after the ones produced by native SVR4 C compilers. */
-#undef IDENT_ASM_OP
+#undef IDENT_ASM_OP
#define IDENT_ASM_OP "\t.ident\t"
/* Output #ident as a .ident. */
-#undef ASM_OUTPUT_IDENT
+
+#undef ASM_OUTPUT_IDENT
#define ASM_OUTPUT_IDENT(FILE, NAME) \
fprintf ((FILE), "%s\"%s\"\n", IDENT_ASM_OP, (NAME));
-#undef ASM_IDENTIFY_LANGUAGE
-#define ASM_IDENTIFY_LANGUAGE(FILE) \
- fprintf ((FILE), "%s\"GCC (%s) %s\"\n", IDENT_ASM_OP, \
- lang_identify (), version_string)
+/************************[ Debugger stuff ]*********************************/
-#undef ASM_FILE_END
-#define ASM_FILE_END(FILE) \
-do { \
- if (!flag_no_ident) \
- fprintf ((FILE), "%s\"GCC: (GNU) %s\"\n", \
- IDENT_ASM_OP, version_string); \
- } while (0)
+/* All ELF targets can support DWARF-2. */
+#undef DWARF2_DEBUGGING_INFO
+#define DWARF2_DEBUGGING_INFO
+/* This is BSD, so we want the DBX format. */
+#undef DBX_DEBUGGING_INFO
+#define DBX_DEBUGGING_INFO
-/* Miscellaneous parameters. */
-
-/* Don't assume anything about the header files. */
-#undef NO_IMPLICIT_EXTERN_C
-#define NO_IMPLICIT_EXTERN_C
-
-/* Allow #sccs in preprocessor. */
-#define SCCS_DIRECTIVE
-
-/* Handle #pragma weak and #pragma pack. */
-#define HANDLE_SYSV_PRAGMA
+/* Even though this is BSD, ELF and the GNU tools operates better with dwarf2
+ than stabs. Since we don't have any native tools to be compatible with,
+ defaulting to dwarf2 is OK. */
+#undef PREFERRED_DEBUGGING_TYPE
+#define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
diff --git a/gcc/config/arm/linux-elf26.h b/gcc/config/freebsd3.h
index ce26f1fef9d..7b5426f9336 100644
--- a/gcc/config/arm/linux-elf26.h
+++ b/gcc/config/freebsd3.h
@@ -1,7 +1,6 @@
-/* Definitions for ARM running Linux-based GNU systems
- using ELF and 26-bit APCS.
- Copyright (C) 1999 Free Software Foundation, Inc.
- Contributed by Philip Blundell <Philip.Blundell@pobox.com>
+/* FreeBSD version number setting for FreeBSD 3.x systems.
+ Copyright (C) 2001 Free Software Foundation, Inc.
+ Contributed by David E. O'Brien <obrien@FreeBSD.org> and BSDi.
This file is part of GNU CC.
@@ -16,9 +15,8 @@ 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 program; see the file COPYING. If not, write to
+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. */
-/* Tell linux-elf.h to default to 26-bit mode. */
-#define SUBTARGET_DEFAULT_APCS26
+#define FBSD_MAJOR 3
diff --git a/gcc/ch/lang-specs.h b/gcc/config/freebsd4.h
index 1ed4bac14cb..ec2ae4752bb 100644
--- a/gcc/ch/lang-specs.h
+++ b/gcc/config/freebsd4.h
@@ -1,5 +1,6 @@
-/* Definitions for specs for GNU CHILL.
- Copyright (C) 1995, 1998, 1999 Free Software Foundation, Inc..
+/* FreeBSD version number setting for FreeBSD 4.x systems.
+ Copyright (C) 2001 Free Software Foundation, Inc.
+ Contributed by David E. O'Brien <obrien@FreeBSD.org> and BSDi.
This file is part of GNU CC.
@@ -18,13 +19,4 @@ 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. */
-/* This is the contribution to the `default_compilers' array in gcc.c for
- CHILL. */
-
- {".ch", "@chill"},
- {".chi", "@chill"},
- {"@chill",
- "tradcpp0 -lang-chill %{!no-gcc:-D__GNUCHILL__=%v1} %(cpp_options)\
- %{!M:%{!MM:%{!E:%{!pipe:%g.i} |\n\
- cc1chill %{!pipe:%g.i} %(cc1_options)\
- %{!fsyntax-only:%(invoke_as)}}}}\n"},
+#define FBSD_MAJOR 4
diff --git a/gcc/config/arm/linux-oldld.h b/gcc/config/freebsd5.h
index 8b2af015efe..3c276d50d7a 100644
--- a/gcc/config/arm/linux-oldld.h
+++ b/gcc/config/freebsd5.h
@@ -1,7 +1,6 @@
-/* Definitions for ARM running Linux-based GNU systems
- using ELF with old binutils.
- Copyright (C) 1999 Free Software Foundation, Inc.
- Contributed by Philip Blundell <Philip.Blundell@pobox.com>
+/* FreeBSD version number setting for FreeBSD 5.x systems.
+ Copyright (C) 2001 Free Software Foundation, Inc.
+ Contributed by David E. O'Brien <obrien@FreeBSD.org> and BSDi.
This file is part of GNU CC.
@@ -16,12 +15,8 @@ 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 program; see the file COPYING. If not, write to
+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. */
-/* Unfortunately, owing to various historical accidents, version 2.9.4
- and newer of GNU binutils are not quite compatible with the old
- (2.9.1-based) toolset. This tells linux-elf.h to generate specs
- appropriate for the older versions. */
-#define SUBTARGET_OLD_LINKER
+#define FBSD_MAJOR 5
diff --git a/gcc/config/freebsd6.h b/gcc/config/freebsd6.h
new file mode 100644
index 00000000000..38bc0cdbb23
--- /dev/null
+++ b/gcc/config/freebsd6.h
@@ -0,0 +1,22 @@
+/* FreeBSD version number setting for FreeBSD 6.x systems.
+ Copyright (C) 2001 Free Software Foundation, Inc.
+ Contributed by David E. O'Brien <obrien@FreeBSD.org> and BSDi.
+
+This file is part of GNU CC.
+
+GNU CC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU CC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU CC; see the file COPYING. If not, write to
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA. */
+
+#define FBSD_MAJOR 6
diff --git a/gcc/config/h8300/fixunssfsi.c b/gcc/config/h8300/fixunssfsi.c
new file mode 100644
index 00000000000..ed37803ed91
--- /dev/null
+++ b/gcc/config/h8300/fixunssfsi.c
@@ -0,0 +1,43 @@
+/* More subroutines needed by GCC output code on some machines. */
+/* Compile this one with gcc. */
+/* Copyright (C) 1989, 1992, 2001 Free Software Foundation, Inc.
+
+This file is part of GNU CC.
+
+GNU CC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+In addition to the permissions in the GNU General Public License, the
+Free Software Foundation gives you unlimited permission to link the
+compiled version of this file into combinations with other programs,
+and to distribute those combinations without any restriction coming
+from the use of this file. (The General Public License restrictions
+do apply in other respects; for example, they cover modification of
+the file, and distribution when not linked into a combine
+executable.)
+
+GNU CC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU CC; see the file COPYING. If not, write to
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA. */
+
+/* The libgcc2.c implementation gets confused by our type setup and creates
+ a directly recursive call, so we do our own implementation. For the h8300,
+ that's in lib1funcs.asm, for h8300h / h8s, it's here. */
+
+#ifndef __H8300__
+long
+__fixunssfsi (float a)
+{
+ if (a >= (float) 32768L)
+ return (long) (a -32768L) +32768L;
+ return (long) a;
+}
+#endif
diff --git a/gcc/config/h8300/h8300.c b/gcc/config/h8300/h8300.c
index a52120c9dca..f46cbb302a2 100644
--- a/gcc/config/h8300/h8300.c
+++ b/gcc/config/h8300/h8300.c
@@ -30,7 +30,6 @@ Boston, MA 02111-1307, USA. */
#include "real.h"
#include "insn-config.h"
#include "conditions.h"
-#include "insn-flags.h"
#include "output.h"
#include "insn-attr.h"
#include "flags.h"
@@ -168,8 +167,9 @@ dosize (file, op, size)
subs since this shouldn't happen often. */
if ((TARGET_H8300 && size <= 4)
|| ((TARGET_H8300H || TARGET_H8300S) && size <= 8)
+ || (TARGET_H8300 && interrupt_handler)
|| (TARGET_H8300 && current_function_needs_context
- && strcmp (op, "sub")))
+ && ! strcmp (op, "sub")))
{
unsigned HOST_WIDE_INT amount;
@@ -509,7 +509,7 @@ ok_for_bclr (value)
return small_power_of_two ((~value) & 0xff);
}
-/* Return true is OP is a valid source operand for an integer move
+/* Return true if OP is a valid source operand for an integer move
instruction. */
int
@@ -2239,7 +2239,7 @@ get_shift_alg (shift_type, shift_mode, count, info)
{
if (count == 15 && shift_type == SHIFT_ASHIFTRT)
{
- info->special = "shll\t%t0,%t0\n\tsubx\t%t0,%t0\n\tmov.b\t%t0,%s0";
+ info->special = "shll\t%t0\n\tsubx\t%t0,%t0\n\tmov.b\t%t0,%s0";
info->cc_valid_p = 0;
return SHIFT_SPECIAL;
}
@@ -3073,13 +3073,13 @@ h8300_encode_label (decl)
{
const char *str = XSTR (XEXP (DECL_RTL (decl), 0), 0);
int len = strlen (str);
- char *newstr;
+ char *newstr = alloca (len + 2);
- newstr = ggc_alloc_string (NULL, len + 1);
+ newstr[0] = '&';
+ strcpy (&newstr[1], str);
- strcpy (newstr + 1, str);
- *newstr = '&';
- XSTR (XEXP (DECL_RTL (decl), 0), 0) = newstr;
+ XSTR (XEXP (DECL_RTL (decl), 0), 0) =
+ ggc_alloc_string (newstr, len + 1);
}
const char *
diff --git a/gcc/config/h8300/h8300.h b/gcc/config/h8300/h8300.h
index a0862c5ec8a..4ba86fabce0 100644
--- a/gcc/config/h8300/h8300.h
+++ b/gcc/config/h8300/h8300.h
@@ -495,6 +495,15 @@ enum reg_class {
#define STARTING_FRAME_OFFSET 0
+/* We do not know if the caller has a frame pointer, so we cannot go
+ beyond level 0. */
+
+#define RETURN_ADDR_RTX(COUNT, FRAME) \
+ ((COUNT) == 0 \
+ ? gen_rtx_MEM (Pmode, \
+ plus_constant (arg_pointer_rtx, -GET_MODE_SIZE (Pmode))) \
+ : 0)
+
/* If we generate an insn to push BYTES bytes,
this says how many the stack pointer really advances by.
@@ -846,12 +855,6 @@ struct cum_arg
/* Extra constraints. */
-/* 'T' if valid for dec.[wl] on H8/300H and H8/S. Note that, for
- inc.[wl], we can use 'K', which has already been defined. */
-#define OK_FOR_T(OP) \
- (GET_CODE (OP) == CONST_INT \
- && (INTVAL (OP) == -1 || INTVAL (OP) == -2))
-
/* Nonzero if X is a constant address suitable as an 8-bit absolute on
the H8/300H, which is a special case of the 'R' operand. */
@@ -881,8 +884,7 @@ struct cum_arg
&& GET_CODE (XEXP (OP, 0)) == CONST_INT))
#define EXTRA_CONSTRAINT(OP, C) \
- ((C) == 'T' ? OK_FOR_T (OP) : \
- (C) == 'U' ? OK_FOR_U (OP) : \
+ ((C) == 'U' ? OK_FOR_U (OP) : \
0)
/* GO_IF_LEGITIMATE_ADDRESS recognizes an RTL expression
@@ -1068,8 +1070,6 @@ h8300_valid_machine_decl_attribute (DECL, ATTRIBUTES, IDENTIFIER, ARGS)
/* Control the assembler format that we output. */
-#define ASM_IDENTIFY_GCC(FILE) /* nothing */
-
/* Output at beginning/end of assembler file. */
#define ASM_FILE_START(FILE) asm_file_start(FILE)
diff --git a/gcc/config/h8300/h8300.md b/gcc/config/h8300/h8300.md
index 661f5a8aaa5..643341832a2 100644
--- a/gcc/config/h8300/h8300.md
+++ b/gcc/config/h8300/h8300.md
@@ -1,6 +1,6 @@
;; GCC machine description for Hitachi H8/300
-;; Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000
-;; Free Software Foundation, Inc.
+;; Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
+;; 2001 Free Software Foundation, Inc.
;; Contributed by Steve Chamberlain (sac@cygnus.com),
;; Jim Wilson (wilson@cygnus.com), and Doug Evans (dje@cygnus.com).
@@ -187,8 +187,13 @@
(define_insn ""
[(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"))]
- "register_operand (operands[0],HImode)
- || register_operand (operands[1], HImode)"
+ "(register_operand (operands[0],HImode)
+ || register_operand (operands[1], HImode))
+ && !(GET_CODE (operands[0]) == MEM
+ && GET_CODE (XEXP (operands[0], 0)) == PRE_DEC
+ && GET_CODE (XEXP (XEXP (operands[0], 0), 0)) == REG
+ && GET_CODE (operands[1]) == REG
+ && REGNO (XEXP (XEXP (operands[0], 0), 0)) == REGNO (operands[1]))"
"@
sub.w %T0,%T0
mov.w %T1,%T0
@@ -399,22 +404,27 @@
(set_attr "cc" "clobber")])
(define_insn "movsi_h8300hs"
- [(set (match_operand:SI 0 "general_operand_dst" "=r,r,r,m,<,r,*a,*a,r")
- (match_operand:SI 1 "general_operand_src" "I,r,im,r,r,>,I,r,*a"))]
+ [(set (match_operand:SI 0 "general_operand_dst" "=r,r,r,r,m,<,r,*a,*a,r")
+ (match_operand:SI 1 "general_operand_src" "I,r,i,m,r,r,>,I,r,*a"))]
"(TARGET_H8300S || TARGET_H8300H)
&& (register_operand (operands[0], SImode)
- || register_operand (operands[1], SImode))"
+ || register_operand (operands[1], SImode))
+ && !(GET_CODE (operands[0]) == MEM
+ && GET_CODE (XEXP (operands[0], 0)) == PRE_DEC
+ && GET_CODE (XEXP (XEXP (operands[0], 0), 0)) == REG
+ && GET_CODE (operands[1]) == REG
+ && REGNO (XEXP (XEXP (operands[0], 0), 0)) == REGNO (operands[1]))"
"*
{
switch (which_alternative)
{
case 0:
return \"sub.l %S0,%S0\";
- case 6:
- return \"clrmac\";
case 7:
- return \"clrmac\;ldmac %1,macl\";
+ return \"clrmac\";
case 8:
+ return \"clrmac\;ldmac %1,macl\";
+ case 9:
return \"stmac macl,%0\";
default:
if (GET_CODE (operands[1]) == CONST_INT)
@@ -446,8 +456,8 @@
}
return \"mov.l %S1,%S0\";
}"
- [(set_attr "length" "2,2,10,10,4,4,2,6,4")
- (set_attr "cc" "set_zn,set_znv,set_znv,set_znv,set_znv,set_znv,none_0hit,none_0hit,set_znv")])
+ [(set_attr "length" "2,2,10,10,10,4,4,2,6,4")
+ (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"
[(set (match_operand:SF 0 "general_operand_dst" "=r,r,r,m,<,r")
@@ -470,31 +480,31 @@
;; ----------------------------------------------------------------------
(define_insn ""
- [(set (cc0) (zero_extract:QI (match_operand:QI 0 "bit_memory_operand" "rU")
+ [(set (cc0) (zero_extract:QI (match_operand:QI 0 "bit_memory_operand" "r,U")
(const_int 1)
- (match_operand:QI 1 "const_int_operand" "n")))]
+ (match_operand:QI 1 "const_int_operand" "n,n")))]
""
"btst %Z1,%R0"
- [(set_attr "length" "2")
- (set_attr "cc" "set_zn")])
+ [(set_attr "length" "2,8")
+ (set_attr "cc" "set_zn,set_zn")])
(define_insn ""
- [(set (cc0) (zero_extract:HI (match_operand:QI 0 "bit_memory_operand" "rU")
+ [(set (cc0) (zero_extract:HI (match_operand:QI 0 "bit_memory_operand" "r,U")
(const_int 1)
- (match_operand:QI 1 "const_int_operand" "n")))]
+ (match_operand:QI 1 "const_int_operand" "n,n")))]
""
"btst %Z1,%Y0"
- [(set_attr "length" "2")
- (set_attr "cc" "set_zn")])
+ [(set_attr "length" "2,8")
+ (set_attr "cc" "set_zn,set_zn")])
(define_insn ""
- [(set (cc0) (zero_extract:SI (match_operand:QI 0 "bit_memory_operand" "rU")
+ [(set (cc0) (zero_extract:SI (match_operand:QI 0 "bit_memory_operand" "r,U")
(const_int 1)
- (match_operand:QI 1 "const_int_operand" "n")))]
+ (match_operand:QI 1 "const_int_operand" "n,n")))]
""
"btst %Z1,%Y0"
- [(set_attr "length" "2")
- (set_attr "cc" "set_zn")])
+ [(set_attr "length" "2,8")
+ (set_attr "cc" "set_zn,set_zn")])
(define_insn ""
[(set (cc0) (zero_extract:QI (match_operand:HI 0 "register_operand" "r")
@@ -628,19 +638,17 @@
(set_attr "cc" "none_0hit,none_0hit,clobber,set_zn,set_zn")])
(define_insn ""
- [(set (match_operand:HI 0 "register_operand" "=r,r,r,r,r,r")
- (plus:HI (match_operand:HI 1 "register_operand" "%0,0,0,0,0,0")
- (match_operand:HI 2 "nonmemory_operand" "K,T,L,N,n,r")))]
+ [(set (match_operand:HI 0 "register_operand" "=r,r,r,r")
+ (plus:HI (match_operand:HI 1 "register_operand" "%0,0,0,0")
+ (match_operand:HI 2 "nonmemory_operand" "L,N,n,r")))]
"TARGET_H8300H || TARGET_H8300S"
"@
- inc.w %2,%T0
- dec.w %G2,%T0
adds %2,%A0
subs %G2,%A0
add.w %T2,%T0
add.w %T2,%T0"
- [(set_attr "length" "2,2,2,2,4,2")
- (set_attr "cc" "set_znv,set_znv,none_0hit,none_0hit,set_zn,set_zn")])
+ [(set_attr "length" "2,2,4,2")
+ (set_attr "cc" "none_0hit,none_0hit,set_zn,set_zn")])
(define_split
[(set (match_operand:HI 0 "register_operand" "")
@@ -670,19 +678,17 @@
(set_attr "cc" "clobber")])
(define_insn "addsi_h8300h"
- [(set (match_operand:SI 0 "register_operand" "=r,r,r,r,r,r")
- (plus:SI (match_operand:SI 1 "register_operand" "%0,0,0,0,0,0")
- (match_operand:SI 2 "nonmemory_operand" "K,T,L,N,i,r")))]
+ [(set (match_operand:SI 0 "register_operand" "=r,r,r,r")
+ (plus:SI (match_operand:SI 1 "register_operand" "%0,0,0,0")
+ (match_operand:SI 2 "nonmemory_operand" "L,N,i,r")))]
"TARGET_H8300H || TARGET_H8300S"
"@
- inc.l %2,%S0
- dec.l %G2,%S0
adds %2,%A0
subs %G2,%A0
add.l %S2,%S0
add.l %S2,%S0"
- [(set_attr "length" "2,2,2,2,6,2")
- (set_attr "cc" "set_znv,set_znv,none_0hit,none_0hit,set_zn,set_zn")])
+ [(set_attr "length" "2,2,6,2")
+ (set_attr "cc" "none_0hit,none_0hit,set_zn,set_zn")])
(define_split
[(set (match_operand:SI 0 "register_operand" "")
@@ -898,7 +904,7 @@
(match_operand:HI 1 "general_operand" "0")
(zero_extend:HI (match_operand:QI 2 "register_operand" "r")))))]
""
- "divxu %X2,%T0\;mov %t0,%s0"
+ "divxu %X2,%T0\;mov %t0,%s0"
[(set_attr "length" "4")
(set_attr "cc" "clobber")])
@@ -909,7 +915,7 @@
(match_operand:HI 1 "general_operand" "0")
(sign_extend:HI (match_operand:QI 2 "register_operand" "r")))))]
"TARGET_H8300H || TARGET_H8300S"
- "divxs.b %X2,%T0\;mov %t0,%s0"
+ "divxs.b %X2,%T0\;mov %t0,%s0"
[(set_attr "length" "6")
(set_attr "cc" "clobber")])
@@ -920,7 +926,7 @@
(match_operand:SI 1 "general_operand" "0")
(zero_extend:SI (match_operand:HI 2 "register_operand" "r")))))]
"TARGET_H8300H || TARGET_H8300S"
- "divxu.w %T2,%S0\;mov %e0,%f0"
+ "divxu.w %T2,%S0\;mov %e0,%f0"
[(set_attr "length" "4")
(set_attr "cc" "clobber")])
@@ -931,7 +937,7 @@
(match_operand:SI 1 "general_operand" "0")
(sign_extend:SI (match_operand:HI 2 "register_operand" "r")))))]
"TARGET_H8300H || TARGET_H8300S"
- "divxs.w %T2,%S0\;mov %e0,%f0"
+ "divxs.w %T2,%S0\;mov %e0,%f0"
[(set_attr "length" "6")
(set_attr "cc" "clobber")])
@@ -947,7 +953,7 @@
"@
and %X2,%X0
bclr %W2,%R0"
- [(set_attr "length" "2,4")
+ [(set_attr "length" "2,8")
(set_attr "adjust_length" "no")
(set_attr "cc" "set_znv,none_0hit")])
@@ -1034,7 +1040,7 @@
}
if (TARGET_H8300H || TARGET_H8300S)
return \"and.l %S2,%S0\";
- return \"and %w2,%w0\;and %x2,%x0\;and %y2,%y0\;and %z2,%z0\;\";
+ return \"and %w2,%w0\;and %x2,%x0\;and %y2,%y0\;and %z2,%z0\";
}"
[(set_attr "length" "8")
(set_attr "cc" "clobber")])
@@ -1052,7 +1058,7 @@
"@
or %X2,%X0
bset %V2,%R0"
- [(set_attr "length" "2,4")
+ [(set_attr "length" "2,8")
(set_attr "adjust_length" "no")
(set_attr "cc" "set_znv,none_0hit")])
@@ -1122,7 +1128,7 @@
}
if (TARGET_H8300H || TARGET_H8300S)
return \"or.l %S2,%S0\";
- return \"or %w2,%w0\;or %x2,%x0\;or %y2,%y0\;or %z2,%z0\;\";
+ return \"or %w2,%w0\;or %x2,%x0\;or %y2,%y0\;or %z2,%z0\";
}"
[(set_attr "length" "2,8")
(set_attr "cc" "clobber,clobber")])
@@ -1139,7 +1145,7 @@
"@
xor %X2,%X0
bnot %V2,%R0"
- [(set_attr "length" "2,4")
+ [(set_attr "length" "2,8")
(set_attr "adjust_length" "no")
(set_attr "cc" "set_znv,none_0hit")])
@@ -1209,7 +1215,7 @@
}
if (TARGET_H8300H || TARGET_H8300S)
return \"xor.l %S2,%S0\";
- return \"xor %w2,%w0\;xor %x2,%x0\;xor %y2,%y0\;xor %z2,%z0\;\";
+ return \"xor %w2,%w0\;xor %x2,%x0\;xor %y2,%y0\;xor %z2,%z0\";
}"
[(set_attr "length" "2,8")
(set_attr "cc" "clobber,clobber")])
@@ -1615,7 +1621,7 @@
"@
mov.b #0,%t0
mov.b %R1,%s0\;mov.b #0,%t0"
- [(set_attr "length" "2,4")
+ [(set_attr "length" "2,10")
(set_attr "cc" "clobber,clobber")])
;; The compiler can synthesize a 300H variant of this which is
diff --git a/gcc/config/h8300/lib1funcs.asm b/gcc/config/h8300/lib1funcs.asm
index 41cb3bc9f55..35e8999121e 100644
--- a/gcc/config/h8300/lib1funcs.asm
+++ b/gcc/config/h8300/lib1funcs.asm
@@ -1,7 +1,7 @@
;; libgcc1 routines for the Hitachi H8/300 CPU.
;; Contributed by Steve Chamberlain <sac@cygnus.com>
-/* Copyright (C) 1994, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1994, 2000, 2001 Free Software Foundation, Inc.
This file is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
@@ -251,7 +251,7 @@ ___umodhi3:
; q low 8 bits of quot
; P preserve
-; The h8 only has a 16/8 bit divide, so we look at the incoming and
+; The H8/300 only has a 16/8 bit divide, so we look at the incoming and
; see how to partition up the expression.
.global ___udivhi3
@@ -502,10 +502,10 @@ reti:
POPP S2P
rts
- ; takes A0/A1 numerator (A0P for 300h)
- ; A2/A3 denominator (A1P for 300h)
- ; returns A0/A1 quotient (A0P for 300h)
- ; S0/S1 remainder (S0P for 300h)
+ ; takes A0/A1 numerator (A0P for 300H)
+ ; A2/A3 denominator (A1P for 300H)
+ ; returns A0/A1 quotient (A0P for 300H)
+ ; S0/S1 remainder (S0P for 300H)
; trashes S2
#ifdef __H8300__
@@ -634,7 +634,7 @@ setone:
#ifdef L_mulhi3
;; HImode multiply.
-; The h8 only has an 8*8->16 multiply.
+; The H8/300 only has an 8*8->16 multiply.
; The answer is the same as:
;
; product = (srca.l * srcb.l) + ((srca.h * srcb.l) + (srcb.h * srca.l)) * 256
@@ -764,3 +764,31 @@ _done:
#endif
#endif /* L_mulsi3 */
+#ifdef L_fixunssfsi_asm
+/* For the h8300 we use asm to save some bytes, to
+ allow more programs to fit into the tiny address
+ space. For h8300h / h8s, the C version is good enough. */
+#ifdef __H8300__
+/* We still treat NANs different than libgcc2.c, but then, the
+ behaviour is undefined anyways. */
+ .global ___fixunssfsi
+___fixunssfsi:
+ cmp.b #0x47,r0h
+ bge Large_num
+ jmp @___fixsfsi
+Large_num:
+ bhi L_huge_num
+ xor.b #0x80,A0L
+ bmi L_shift8
+L_huge_num:
+ mov.w #65535,A0
+ mov.w A0,A1
+ rts
+L_shift8:
+ mov.b A0L,A0H
+ mov.b A1H,A0L
+ mov.b A1L,A1H
+ mov.b #0,A1L
+ rts
+#endif
+#endif /* L_fixunssfsi_asm */
diff --git a/gcc/config/h8300/rtems.h b/gcc/config/h8300/rtems.h
index 1ac2de92856..34766429b96 100644
--- a/gcc/config/h8300/rtems.h
+++ b/gcc/config/h8300/rtems.h
@@ -1,5 +1,5 @@
/* Definitions for rtems targeting a H8
- Copyright (C) 1996, 1997, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1997, 2000, 2002 Free Software Foundation, Inc.
Contributed by Joel Sherrill (joel@OARcorp.com).
This file is part of GNU CC.
@@ -26,7 +26,7 @@ Boston, MA 02111-1307, USA. */
#undef CPP_PREDEFINES
#define CPP_PREDEFINES "-Dh8300 \
-D__LONG_MAX__=2147483647L -D__LONG_LONG_MAX__=2147483647L \
- -Drtems -D__rtems__ -Asystem(rtems) -Acpu(h8300) -Amachine(h8300)"
+ -D__rtems__ -Asystem(rtems) -Acpu(h8300) -Amachine(h8300)"
/* Generate calls to memcpy, memcmp and memset. */
#ifndef TARGET_MEM_FUNCTIONS
diff --git a/gcc/config/h8300/t-h8300 b/gcc/config/h8300/t-h8300
index fbc4d731440..aa9627e2598 100644
--- a/gcc/config/h8300/t-h8300
+++ b/gcc/config/h8300/t-h8300
@@ -1,6 +1,12 @@
+# The three first floating point functions listed in LIB1ASMFUNCS (_fixsfdi,
+# _floatdisf, and _fixunssfdi) are used to disable the inclusion of those
+# from libgcc2.c. They do not actually exist in lib1funcs.asm.
CROSS_LIBGCC1 = libgcc1-asm.a
LIB1ASMSRC = h8300/lib1funcs.asm
-LIB1ASMFUNCS = _cmpsi2 _ucmpsi2 _divhi3 _divsi3 _mulhi3 _mulsi3
+LIB1ASMFUNCS = _cmpsi2 _ucmpsi2 _divhi3 _divsi3 _mulhi3 _mulsi3 \
+ _floatdisf _fixsfdi _fixunssfdi _fixunssfsi_asm
+
+LIB2FUNCS_EXTRA = $(srcdir)/config/h8300/fixunssfsi.c
# We do not have DF or DI types, so fake out the libgcc2 compilation.
TARGET_LIBGCC2_CFLAGS = -DDF=SF -DDI=SI
diff --git a/gcc/config/h8300/xm-h8300.h b/gcc/config/h8300/xm-h8300.h
index 7fde9e6cd87..8b5b3f3d797 100644
--- a/gcc/config/h8300/xm-h8300.h
+++ b/gcc/config/h8300/xm-h8300.h
@@ -18,10 +18,6 @@ along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-/* #defines that need visibility everywhere. */
-#define FALSE 0
-#define TRUE 1
-
/* This describes the machine the compiler is hosted on. */
#define HOST_BITS_PER_CHAR 8
#define HOST_BITS_PER_SHORT 16
@@ -43,4 +39,3 @@ Boston, MA 02111-1307, USA. */
/* target machine dependencies.
tm.h is a symbolic link to the actual target specific file. */
#include "tm.h"
-
diff --git a/gcc/config/i370/i370.c b/gcc/config/i370/i370.c
index 2db1a01b9fc..778930e5808 100644
--- a/gcc/config/i370/i370.c
+++ b/gcc/config/i370/i370.c
@@ -31,7 +31,6 @@ Boston, MA 02111-1307, USA. */
#include "real.h"
#include "insn-config.h"
#include "conditions.h"
-#include "insn-flags.h"
#include "output.h"
#include "insn-attr.h"
#include "function.h"
diff --git a/gcc/config/i370/i370.h b/gcc/config/i370/i370.h
index 8967d0b6de6..6bb638b95a5 100644
--- a/gcc/config/i370/i370.h
+++ b/gcc/config/i370/i370.h
@@ -1091,7 +1091,6 @@ enum reg_class
fputs ("\tCSECT\n", FILE); }
#define ASM_FILE_END(FILE) fputs ("\tEND\n", FILE);
-#define ASM_IDENTIFY_GCC(FILE)
#define ASM_COMMENT_START "*"
#define ASM_APP_OFF ""
#define ASM_APP_ON ""
diff --git a/gcc/config/i370/i370.md b/gcc/config/i370/i370.md
index 614e3d6fb6b..4ee3e14f835 100644
--- a/gcc/config/i370/i370.md
+++ b/gcc/config/i370/i370.md
@@ -4702,8 +4702,8 @@ check_label_emit ();
;; Call subroutine returning any type.
;; This instruction pattern appears to be used only by the
;; expand_builtin_apply definition for __builtin_apply. It is needed
-;; since call_value might return an in in r15 or a float in fpr0 (r16)
-;; and the builtin code calla abort since the reg is ambiguous. Well,
+;; since call_value might return an int in r15 or a float in fpr0 (r16)
+;; and the builtin code calls abort since the reg is ambiguous. Well,
;; the below is probably broken anyway, we just want to go for now.
;;
(define_expand "untyped_call"
diff --git a/gcc/config/i370/xm-i370.h b/gcc/config/i370/xm-i370.h
index b80efb9917d..8e5161fd326 100644
--- a/gcc/config/i370/xm-i370.h
+++ b/gcc/config/i370/xm-i370.h
@@ -20,11 +20,6 @@ along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-/* #defines that need visibility everywhere. */
-
-#define FALSE 0
-#define TRUE 1
-
/* This describes the machine the compiler is hosted on. */
#define HOST_BITS_PER_CHAR 8
diff --git a/gcc/config/i370/xm-linux.h b/gcc/config/i370/xm-linux.h
index e0ab373c54d..69298b71dcd 100644
--- a/gcc/config/i370/xm-linux.h
+++ b/gcc/config/i370/xm-linux.h
@@ -23,9 +23,6 @@ Boston, MA 02111-1307, USA. */
/* #defines that need visibility everywhere. */
-#define FALSE 0
-#define TRUE 1
-
#define USE_STDARGS 1
#define USE_PROTOTYPES 1
@@ -59,7 +56,6 @@ extern char *alloca ();
#include "tm.h"
/* Arguments to use with `exit'. */
-
#define SUCCESS_EXIT_CODE 0
#define FATAL_EXIT_CODE 12
diff --git a/gcc/config/i370/xm-mvs.h b/gcc/config/i370/xm-mvs.h
index f43a8408ce2..e10bdae7cc0 100644
--- a/gcc/config/i370/xm-mvs.h
+++ b/gcc/config/i370/xm-mvs.h
@@ -20,11 +20,6 @@ along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-/* #defines that need visibility everywhere. */
-
-#define FALSE 0
-#define TRUE 1
-
/* This describes the machine the compiler is hosted on. */
#define HOST_BITS_PER_CHAR 8
diff --git a/gcc/config/i370/xm-oe.h b/gcc/config/i370/xm-oe.h
index a930a2bae61..19a46f6428b 100644
--- a/gcc/config/i370/xm-oe.h
+++ b/gcc/config/i370/xm-oe.h
@@ -22,9 +22,6 @@ Boston, MA 02111-1307, USA. */
/* #defines that need visibility everywhere. */
-#define FALSE 0
-#define TRUE 1
-
#define USE_STDARGS 1
#define USE_PROTOTYPES 1
diff --git a/gcc/config/i386/att.h b/gcc/config/i386/att.h
index e04b035b473..b41218e387f 100644
--- a/gcc/config/i386/att.h
+++ b/gcc/config/i386/att.h
@@ -30,10 +30,8 @@ Boston, MA 02111-1307, USA. */
/* Assembler pseudos to introduce constants of various size. */
-/* #define ASM_BYTE_OP "\t.byte" Now in svr3.h or svr4.h. */
-#define ASM_SHORT "\t.value"
-#define ASM_LONG "\t.long"
-#define ASM_DOUBLE "\t.double"
+#define ASM_SHORT "\t.value\t"
+#define ASM_LONG "\t.long\t"
/* How to output an ASCII string constant. */
@@ -56,7 +54,6 @@ do \
output_file_directive (FILE, main_input_filename); \
if (target_flags & MASK_INTEL_SYNTAX) \
fputs ("\t.intel_syntax\n", FILE); \
- fprintf (FILE, "\t.version\t\"01.01\"\n"); \
} while (0)
/* Do use .optim by default on this machine. */
diff --git a/gcc/config/i386/beos-elf.h b/gcc/config/i386/beos-elf.h
index 0ac148b2458..bbd809617a8 100644
--- a/gcc/config/i386/beos-elf.h
+++ b/gcc/config/i386/beos-elf.h
@@ -264,15 +264,3 @@ Boston, MA 02111-1307, USA. */
without user intervention. For instance, under Microsoft Windows
symbols must be explicitly imported from shared libraries (DLLs). */
#define MULTIPLE_SYMBOL_SPACES
-
-/* A C statement to output assembler commands which will identify the object
- file as having been compiled with GNU CC. This isn't needed for BeOS
- because we use DWARF and DWARF has an DW_AT_producer tag that does the
- same thing. BeOS debuggers, like bdb, that don't know about this hack
- can get confused when they find two symbols with the same address, and
- print the wrong one (gcc2_compiled) in things like backtraces. The most
- likely ill effect of disabling this is that a BeOS port of gdb would not
- be able to tell that an executable was compiled with gcc if there was no
- DWARF info. */
-#undef ASM_IDENTIFY_GCC
-#define ASM_IDENTIFY_GCC(FILE)
diff --git a/gcc/config/i386/bsd.h b/gcc/config/i386/bsd.h
index 1666696cbfc..82b141130f9 100644
--- a/gcc/config/i386/bsd.h
+++ b/gcc/config/i386/bsd.h
@@ -41,9 +41,8 @@ Boston, MA 02111-1307, USA. */
/* Assembler pseudos to introduce constants of various size. */
#define ASM_BYTE_OP "\t.byte\t"
-#define ASM_SHORT "\t.word"
-#define ASM_LONG "\t.long"
-#define ASM_DOUBLE "\t.double"
+#define ASM_SHORT "\t.word\t"
+#define ASM_LONG "\t.long\t"
/* Output at beginning of assembler file.
??? I am skeptical of this -- RMS. */
diff --git a/gcc/config/i386/cygwin.h b/gcc/config/i386/cygwin.h
index 46b93aea113..a5234ada9c3 100644
--- a/gcc/config/i386/cygwin.h
+++ b/gcc/config/i386/cygwin.h
@@ -1,8 +1,6 @@
/* Operating system specific defines to be used when targeting GCC for
- hosting on Windows NT 3.x, using a Unix style C library and tools,
- as distinct from winnt.h, which is used to build GCC for use with a
- windows style library and tool set and uses the Microsoft tools.
- Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000
+ hosting on Windows32, using a Unix style C library and tools.
+ Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001
Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -28,6 +26,7 @@ Boston, MA 02111-1307, USA. */
#define SDB_DEBUGGING_INFO
#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
+#include <stdio.h> /* Required for FILE use below */
#include "i386/gas.h"
#include "dbxcoff.h"
@@ -61,44 +60,42 @@ Boston, MA 02111-1307, USA. */
{ "no-nop-fun-dllimport", -MASK_NOP_FUN_DLLIMPORT, "" }, \
{ "threads", 0, N_("Use Mingw-specific thread support") },
-
-/* Support the __declspec keyword by turning them into attributes.
- We currently only support: dllimport and dllexport.
- Note that the current way we do this may result in a collision with
- predefined attributes later on. This can be solved by using one attribute,
- say __declspec__, and passing args to it. The problem with that approach
- is that args are not accumulated: each new appearance would clobber any
- existing args. */
-
#undef CPP_PREDEFINES
#define CPP_PREDEFINES "-D_X86_=1 -Asystem=winnt"
-/* Normally, -lgcc is not needed since everything in it is in the DLL, but we
- want to allow things to be added to it when installing new versions of
- GCC without making a new CYGWIN.DLL, so we leave it. Profiling is handled
- by calling the init function from the prologue. */
-
-#undef LIBGCC_SPEC
-#define LIBGCC_SPEC "%{mno-cygwin: %{mthreads:-lmingwthrd} -lmingw32} -lgcc %{mno-cygwin:-lmoldname -lmsvcrt}"
-
#ifdef CROSS_COMPILE
-#define CYGWIN_INCLUDES "-idirafter " CYGWIN_CROSS_DIR "/include"
-#define CYGWIN_W32API "-I" CYGWIN_CROSS_DIR "/include/w32api"
+#define CYGWIN_INCLUDES "%{!nostdinc:-idirafter " CYGWIN_CROSS_DIR "/include}"
+#define W32API_INC "%{!nostdinc:-idirafter " CYGWIN_CROSS_DIR "/include/w32api}"
+#define W32API_LIB "-L" CYGWIN_CROSS_DIR "/lib/w32api/"
#define CYGWIN_LIB CYGWIN_CROSS_DIR "/lib"
#define MINGW_LIBS "-L" CYGWIN_CROSS_DIR "/lib/mingw"
-#define MINGW_INCLUDES "-I" CYGWIN_CROSS_DIR "/include/mingw"
+#define MINGW_INCLUDES "%{!nostdinc:-isystem " CYGWIN_CROSS_DIR "/include/mingw/g++-3 "\
+ "-isystem " CYGWIN_CROSS_DIR "/include/mingw/g++ "\
+ "-idirafter " CYGWIN_CROSS_DIR "/include/mingw}"
#else
-#define CYGWIN_INCLUDES "-isystem /usr/local/include -idirafter /usr/include"
-#define CYGWIN_W32API "-I/usr/include/w32api"
+#define CYGWIN_INCLUDES "%{!nostdinc:-isystem /usr/local/include "\
+ "-idirafter " CYGWIN_CROSS_DIR "/include "\
+ "-idirafter /usr/include}"
+#define W32API_INC "%{!nostdinc:"\
+ "-idirafter " CYGWIN_CROSS_DIR "/include/w32api "\
+ "-idirafter /usr/include/w32api}"
+#define W32API_LIB "-L" CYGWIN_CROSS_DIR "/lib/w32api/ -L/usr/lib/w32api/"
#define CYGWIN_LIB "/usr/lib"
#define MINGW_LIBS "-L/usr/local/lib/mingw -L/usr/lib/mingw"
-#define MINGW_INCLUDES "-isystem /usr/local/include/mingw -idirafter /usr/include/mingw"
+#define MINGW_INCLUDES "%{!nostdinc:-isystem /usr/include/mingw/g++-3 "\
+ "-isystem /usr/include/mingw/g++ "\
+ "-isystem /usr/local/include/mingw "\
+ "-idirafter " CYGWIN_CROSS_DIR "/include/mingw "\
+ "-idirafter /usr/include/mingw}"
#endif
-#undef STARTFILE_SPEC
-#define STARTFILE_SPEC "%{shared|mdll: %{mno-cygwin:dllcrt2%O%s}} \
- %{!shared: %{!mdll: %{!mno-cygwin:crt0%O%s} %{mno-cygwin:" MINGW_LIBS " mingw/crt2%O%s} \
- %{pg:gcrt0%O%s}}}"
+/* Support the __declspec keyword by turning them into attributes.
+ We currently only support: dllimport and dllexport.
+ Note that the current way we do this may result in a collision with
+ predefined attributes later on. This can be solved by using one attribute,
+ say __declspec__, and passing args to it. The problem with that approach
+ is that args are not accumulated: each new appearance would clobber any
+ existing args. */
#undef CPP_SPEC
#define CPP_SPEC "%(cpp_cpu) %{posix:-D_POSIX_SOURCE} \
@@ -108,16 +105,29 @@ Boston, MA 02111-1307, USA. */
-D_cdecl=__attribute__((__cdecl__))} \
-D__declspec(x)=__attribute__((x)) \
-D__i386__ -D__i386 \
- %{!mno-cygwin:-D__CYGWIN32__ -D__CYGWIN__ -Dunix -D__unix__ -D__unix \
- " CYGWIN_INCLUDES "} \
- %{mno-win32: %{mno-cygwin: %emno-cygwin and mno-win32 are not compatible}} \
- %{mno-cygwin:-DWIN32 -D_WIN32 -D__WIN32 -D__WIN32__ -DWINNT -D__MSVCRT__ \
- -D__MINGW32__=0.3 %{mthreads:-D_MT} " MINGW_INCLUDES CYGWIN_W32API "\
- -iwithprefixbefore ../../../../mingw/include/g++-3 \
- -iwithprefixbefore ../../../../mingw/include \
- -iwithprefixbefore ../../../../mingw32/include/g++-3 \
- -iwithprefixbefore ../../../../mingw32/include } \
- %{!mno-win32:-DWIN32 -D_WIN32 -D__WIN32 -D__WIN32__ -DWINNT " CYGWIN_W32API "}"
+ %{mno-win32:%{mno-cygwin: %emno-cygwin and mno-win32 are not compatible}} \
+ %{mno-cygwin:-D__MSVCRT__ -D__MINGW32__ %{mthreads:-D_MT} "\
+ MINGW_INCLUDES "} \
+ %{!mno-cygwin:-D__CYGWIN32__ -D__CYGWIN__ -Dunix -D__unix__ -D__unix "\
+ CYGWIN_INCLUDES "}\
+ %{mwin32|mno-cygwin:-DWIN32 -D_WIN32 -D__WIN32 -D__WIN32__ -DWINNT}\
+ %{!mno-win32:" W32API_INC "}\
+"
+
+#undef STARTFILE_SPEC
+#define STARTFILE_SPEC "\
+ %{shared|mdll: %{mno-cygwin:" MINGW_LIBS " dllcrt2%O%s}}\
+ %{!shared: %{!mdll: %{!mno-cygwin:crt0%O%s} %{mno-cygwin:" MINGW_LIBS " crt2%O%s}\
+ %{pg:gcrt0%O%s}}}\
+"
+
+/* Normally, -lgcc is not needed since everything in it is in the DLL, but we
+ want to allow things to be added to it when installing new versions of
+ GCC without making a new CYGWIN.DLL, so we leave it. Profiling is handled
+ by calling the init function from the prologue. */
+
+#undef LIBGCC_SPEC
+#define LIBGCC_SPEC "%{mno-cygwin: %{mthreads:-lmingwthrd} -lmingw32} -lgcc %{mno-cygwin:-lmoldname -lmsvcrt}"
/* This macro defines names of additional specifications to put in the specs
that can be used in various specifications like CC1_SPEC. Its definition
@@ -140,20 +150,23 @@ Boston, MA 02111-1307, USA. */
ld, but that doesn't work just yet. */
#undef LIB_SPEC
-#define LIB_SPEC "%{pg:-lgmon} \
+#define LIB_SPEC "\
+ %{pg:-lgmon} \
%{!mno-cygwin:-lcygwin} \
%{mno-cygwin:%{mthreads:-lmingwthrd} -lmingw32} \
%{mwindows:-lgdi32 -lcomdlg32} \
-luser32 -lkernel32 -ladvapi32 -lshell32"
-#define LINK_SPEC "%{mwindows:--subsystem windows} \
+#define LINK_SPEC W32API_LIB "\
+ %{mwindows:--subsystem windows} \
%{mconsole:--subsystem console} \
%{shared: %{mdll: %eshared and mdll are not compatible}} \
%{shared: --shared} %{mdll:--dll} \
%{static:-Bstatic} %{!static:-Bdynamic} \
%{shared|mdll: -e \
%{mno-cygwin:_DllMainCRTStartup@12} \
- %{!mno-cygwin:__cygwin_dll_entry@12}}"
+ %{!mno-cygwin:__cygwin_dll_entry@12}}\
+ --dll-search-prefix=cyg"
#undef MATH_LIBRARY
#define MATH_LIBRARY ""
@@ -227,6 +240,7 @@ ctor_section () \
in_section = in_ctor; \
} \
}
+void ctor_section PARAMS ((void));
#define DTOR_SECTION_FUNCTION \
void \
@@ -238,6 +252,7 @@ dtor_section () \
in_section = in_dtor; \
} \
}
+void dtor_section PARAMS ((void));
#define DRECTVE_SECTION_FUNCTION \
void \
@@ -249,6 +264,7 @@ drectve_section () \
in_section = in_drectve; \
} \
}
+void drectve_section PARAMS ((void));
/* Switch to SECTION (an `enum in_section').
@@ -257,6 +273,7 @@ drectve_section () \
ASM_DECLARE_OBJECT_NAME and then switch back to the original section
afterwards. */
#define SWITCH_TO_SECTION_FUNCTION \
+void switch_to_section PARAMS ((enum in_section, tree)); \
void \
switch_to_section (section, decl) \
enum in_section section; \
@@ -277,7 +294,7 @@ switch_to_section (section, decl) \
#define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME) \
do { \
ctor_section (); \
- fprintf (FILE, "%s\t", ASM_LONG); \
+ fputs (ASM_LONG, FILE); \
assemble_name (FILE, NAME); \
fprintf (FILE, "\n"); \
} while (0)
@@ -285,7 +302,7 @@ switch_to_section (section, decl) \
#define ASM_OUTPUT_DESTRUCTOR(FILE,NAME) \
do { \
dtor_section (); \
- fprintf (FILE, "%s\t", ASM_LONG); \
+ fputs (ASM_LONG, FILE); \
assemble_name (FILE, NAME); \
fprintf (FILE, "\n"); \
} while (0)
@@ -359,7 +376,7 @@ do { \
#undef ASM_OUTPUT_LABELREF
#define ASM_OUTPUT_LABELREF(STREAM, NAME) \
fprintf (STREAM, "%s%s", USER_LABEL_PREFIX, \
- I386_PE_STRIP_ENCODING (NAME)) \
+ I386_PE_STRIP_ENCODING (NAME)) \
/* Output a common block. */
#undef ASM_OUTPUT_COMMON
@@ -446,11 +463,11 @@ do { \
else \
{ \
type = SECT_RW; \
- if (TREE_CODE (DECL) == VAR_DECL \
- && lookup_attribute ("shared", DECL_MACHINE_ATTRIBUTES (DECL))) \
- mode = "ws"; \
+ if (DECL && TREE_CODE (DECL) == VAR_DECL \
+ && lookup_attribute ("shared", DECL_MACHINE_ATTRIBUTES (DECL))) \
+ mode = "ws"; \
else \
- mode = "w"; \
+ mode = "w"; \
} \
\
if (s == 0) \
@@ -463,12 +480,12 @@ do { \
sections = s; \
fprintf (STREAM, ".section\t%s,\"%s\"\n", NAME, mode); \
/* Functions may have been compiled at various levels of \
- optimization so we can't use `same_size' here. Instead, \
- have the linker pick one. */ \
+ optimization so we can't use `same_size' here. Instead, \
+ have the linker pick one. */ \
if ((DECL) && DECL_ONE_ONLY (DECL)) \
- fprintf (STREAM, "\t.linkonce %s\n", \
- TREE_CODE (DECL) == FUNCTION_DECL \
- ? "discard" : "same_size"); \
+ fprintf (STREAM, "\t.linkonce %s\n", \
+ TREE_CODE (DECL) == FUNCTION_DECL \
+ ? "discard" : "same_size"); \
} \
else \
{ \
@@ -529,25 +546,19 @@ do { \
&& MAIN_NAME_P (DECL_NAME (current_function_decl))) \
{ \
emit_call_insn (gen_rtx (CALL, VOIDmode, \
- gen_rtx_MEM (FUNCTION_MODE, \
+ gen_rtx_MEM (FUNCTION_MODE, \
gen_rtx_SYMBOL_REF (Pmode, "_monstartup")), \
const0_rtx)); \
}
/* External function declarations. */
-#ifndef PARAMS
-#if defined (USE_PROTOTYPES) ? USE_PROTOTYPES : defined (__STDC__)
-#define PARAMS(ARGS) ARGS
-#else
-#define PARAMS(ARGS) ()
-#endif
-#endif
-
-extern void i386_pe_record_external_function PARAMS ((char *));
-/* extern void i386_pe_declare_function_type PARAMS ((FILE *, char *, int)); */
-extern void i386_pe_record_exported_symbol PARAMS ((char *, int));
-/* extern void i386_pe_asm_file_end PARAMS ((FILE *)); */
+extern void i386_pe_record_external_function PARAMS ((const char *));
+extern void i386_pe_declare_function_type PARAMS ((FILE *, const char *, int));
+extern void i386_pe_record_exported_symbol PARAMS ((const char *, int));
+extern void i386_pe_asm_file_end PARAMS ((FILE *));
+extern int i386_pe_dllexport_name_p PARAMS ((const char *));
+extern int i386_pe_dllimport_name_p PARAMS ((const char *));
/* For Win32 ABI compatibility */
#undef DEFAULT_PCC_STRUCT_RETURN
@@ -557,6 +568,10 @@ extern void i386_pe_record_exported_symbol PARAMS ((char *, int));
#undef BIGGEST_ALIGNMENT
#define BIGGEST_ALIGNMENT 128
+/* Native complier aligns internal doubles in structures on dword boundaries. */
+#undef BIGGEST_FIELD_ALIGNMENT
+#define BIGGEST_FIELD_ALIGNMENT 64
+
/* A bitfield declared as `int' forces `int' alignment for the struct. */
#undef PCC_BITFIELDS_TYPE_MATTERS
#define PCC_BITFIELDS_TYPE_MATTERS 1
@@ -568,10 +583,9 @@ extern void i386_pe_record_exported_symbol PARAMS ((char *, int));
#define SET_ASM_OP "\t.set\t"
#endif
-#ifndef INT_ASM_OP
-#define INT_ASM_OP "\t.long\t"
-#endif
-
+/* Override GCC's relative pathname lookup unless otherwise told
+ by other subtargets. */
+#ifndef WIN32_NO_ABSOLUTE_INST_DIRS
#undef MD_STARTFILE_PREFIX
#define MD_STARTFILE_PREFIX "/usr/lib/"
@@ -584,7 +598,8 @@ extern void i386_pe_record_exported_symbol PARAMS ((char *, int));
#undef SYSTEM_INCLUDE_DIR
#undef STANDARD_INCLUDE_DIR
#define STANDARD_INCLUDE_DIR 0
-#endif
+#endif /* not CROSS_COMPILE */
+#endif /* not WIN32_NO_ABSOLUTE_INST_DIRS */
#undef TREE
diff --git a/gcc/config/i386/dgux.c b/gcc/config/i386/dgux.c
index 60e36b44dd6..e9d2b51c3b7 100644
--- a/gcc/config/i386/dgux.c
+++ b/gcc/config/i386/dgux.c
@@ -120,8 +120,8 @@ output_file_start (file, f_options, f_len, W_options, W_len)
output_file_directive (file, main_input_filename);
fprintf (file, "\t.version\t\"01.01\"\n"); \
- /* Switch to the data section so that the coffsem symbol and the
- gcc2_compiled. symbol aren't in the text section. */
+ /* Switch to the data section so that the coffsem symbol
+ isn't in the text section. */
data_section ();
pos = fprintf (file, "\n// cc1 (%s) arguments:", VERSION_STRING);
diff --git a/gcc/config/i386/djgpp.h b/gcc/config/i386/djgpp.h
index 91940b570ef..e116a8b94f5 100644
--- a/gcc/config/i386/djgpp.h
+++ b/gcc/config/i386/djgpp.h
@@ -112,11 +112,12 @@ Boston, MA 02111-1307, USA. */
(((NAME)[0] >= 'A') && ((NAME)[0] <= 'z') && ((NAME)[1] == ':')))
#undef CPP_PREDEFINES
-#define CPP_PREDEFINES "-D__MSDOS__ -Asystem=msdos"
+#define CPP_PREDEFINES "-D__MSDOS__ -D__GO32__ -Asystem=msdos"
/* Include <sys/version.h> so __DJGPP__ and __DJGPP_MINOR__ are defined. */
#undef CPP_SPEC
#define CPP_SPEC "-remap %(cpp_cpu) %{posix:-D_POSIX_SOURCE} \
+ %{!ansi:%{!std=c*:%{!std=i*:-DMSDOS}}} %{!ansi:%{!std=c*:%{!std=i*:-DGO32}}} \
-imacros %s../include/sys/version.h"
/* We need to override link_command_spec in gcc.c so support -Tdjgpp.djl.
@@ -150,6 +151,11 @@ Boston, MA 02111-1307, USA. */
unless user explicitly requests it. */
#undef LOCAL_INCLUDE_DIR
+/* Do not make only .exe if no executable file suffix was specified. */
+/* Let the linker handle that. */
+#undef NO_AUTO_EXE_SUFFIX
+#define NO_AUTO_EXE_SUFFIX
+
#undef EXTRA_SECTIONS
#define EXTRA_SECTIONS in_ctor, in_dtor
@@ -183,7 +189,7 @@ dtor_section () \
#define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME) \
do { \
ctor_section (); \
- fprintf (FILE, "%s\t", ASM_LONG); \
+ fputs (ASM_LONG, FILE); \
assemble_name (FILE, NAME); \
fprintf (FILE, "\n"); \
} while (0)
@@ -200,7 +206,7 @@ dtor_section () \
#define ASM_OUTPUT_DESTRUCTOR(FILE,NAME) \
do { \
dtor_section (); \
- fprintf (FILE, "%s\t", ASM_LONG); \
+ fputs (ASM_LONG, FILE); \
assemble_name (FILE, NAME); \
fprintf (FILE, "\n"); \
} while (0)
@@ -260,22 +266,27 @@ dtor_section () \
/* Used to be defined in xm-djgpp.h, but moved here for cross-compilers. */
#define LIBSTDCXX "-lstdcxx"
-/* Add command line option -mbnu210 to indicate we can use binutil 2.10's features. */
+/* -mbnu210 is now ignored and obsolete. It was used to enable support for
+ weak symbols, and .gnu.linkonce support. */
#undef MASK_BNU210
#define MASK_BNU210 (0x40000000)
#undef SUBTARGET_SWITCHES
-#define SUBTARGET_SWITCHES \
- { "bnu210", -MASK_BNU210, "Enable weak symbol and enhanced C++ template support. Binutils 2.10 or higher required." }, \
- { "no-bnu210", MASK_BNU210, "Disable weak symbol and enhanced C++ template support." },
-
-/* Weak symbols and .gnu.linkonce are only in Binutils-2.10 and later.
- Default to using Binutils 2.10 features. */
-#undef SUPPORTS_WEAK
-#define SUPPORTS_WEAK ((target_flags & MASK_BNU210) == 0)
-
-#undef SUPPORTS_ONE_ONLY
-#define SUPPORTS_ONE_ONLY ((target_flags & MASK_BNU210) == 0)
+#define SUBTARGET_SWITCHES \
+ { "no-bnu210", -MASK_BNU210, "Ignored (obsolete)." }, \
+ { "bnu210", MASK_BNU210, "Ignored (obsolete)." },
+
+/* Warn that -mbnu210 is now obsolete. */
+#undef SUBTARGET_OVERRIDE_OPTIONS
+#define SUBTARGET_OVERRIDE_OPTIONS \
+do \
+ { \
+ if (target_flags & MASK_BNU210) \
+ { \
+ warning ("-mbnu210 is ignored (option is obsolete)."); \
+ } \
+ } \
+while (0)
/* Support for C++ templates. */
#undef MAKE_DECL_ONE_ONLY
diff --git a/gcc/config/i386/freebsd-aout.h b/gcc/config/i386/freebsd-aout.h
index ef63b1c9b2d..fdd37133fa4 100644
--- a/gcc/config/i386/freebsd-aout.h
+++ b/gcc/config/i386/freebsd-aout.h
@@ -34,6 +34,13 @@ Boston, MA 02111-1307, USA. */
#define TARGET_DEFAULT \
(MASK_80387 | MASK_IEEE_FP | MASK_FLOAT_RETURNS | MASK_NO_FANCY_MATH_387)
+/* The macro defined in i386.h doesn't work with the old gas of
+ FreeBSD 2.x. The definition in sco.h and sol2.h appears to work,
+ but it turns out that, even though the assembler doesn't complain,
+ we get incorrect results. Fortunately, the definition in
+ defaults.h works. */
+#undef ASM_PREFERRED_EH_DATA_FORMAT
+
#undef CPP_PREDEFINES
#define CPP_PREDEFINES "-Dunix -D__FreeBSD__\
-Asystem=unix -Asystem=bsd -Asystem=FreeBSD"
@@ -245,8 +252,3 @@ do { \
/* Define this so we can compile MS code for use with WINE. */
#define HANDLE_PRAGMA_PACK_PUSH_POP
-
-/* This is the pseudo-op used to generate a 32-bit word of data with a
- specific value in some section. */
-
-#define INT_ASM_OP "\t.long\t"
diff --git a/gcc/config/i386/freebsd.h b/gcc/config/i386/freebsd.h
index ebd337a5911..68af02bf28d 100644
--- a/gcc/config/i386/freebsd.h
+++ b/gcc/config/i386/freebsd.h
@@ -77,10 +77,6 @@ Boston, MA 02111-1307, USA. */
#undef WCHAR_TYPE_SIZE
#define WCHAR_TYPE_SIZE BITS_PER_WORD
-#undef CPP_PREDEFINES
-#define CPP_PREDEFINES "-Dunix -D__ELF__ -D__FreeBSD__\
- -Asystem=unix -Asystem=bsd -Asystem=FreeBSD"
-
/* Provide a STARTFILE_SPEC appropriate for FreeBSD. Here we add
the magical crtbegin.o file (see crtstuff.c) which provides part
of the support for getting C++ file-scope static object constructed
diff --git a/gcc/config/i386/gas.h b/gcc/config/i386/gas.h
index cef43857b07..6c28bf9a0ee 100644
--- a/gcc/config/i386/gas.h
+++ b/gcc/config/i386/gas.h
@@ -169,5 +169,4 @@ Boston, MA 02111-1307, USA. */
if (target_flags & MASK_INTEL_SYNTAX) \
fputs ("\t.intel_syntax\n", FILE); \
output_file_directive (FILE, main_input_filename); \
- fputs ("\t.version\t\"01.01\"\n", FILE); \
} while (0)
diff --git a/gcc/config/i386/gnu.h b/gcc/config/i386/gnu.h
index 1c776096484..205d5767991 100644
--- a/gcc/config/i386/gnu.h
+++ b/gcc/config/i386/gnu.h
@@ -30,3 +30,6 @@
%{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} %{!p:crt1.o%s}}} \
%{static:crt0.o%s}} \
crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
+
+/* FIXME: Is a Hurd-specific fallback mechanism necessary? */
+#undef MD_FALLBACK_FRAME_STATE_FOR
diff --git a/gcc/config/i386/i386-aout.h b/gcc/config/i386/i386-aout.h
index 68393c77ac9..7385bec6d7c 100644
--- a/gcc/config/i386/i386-aout.h
+++ b/gcc/config/i386/i386-aout.h
@@ -31,6 +31,4 @@ Boston, MA 02111-1307, USA. */
#undef CPP_PREDEFINES
#define CPP_PREDEFINES ""
-#define INT_ASM_OP "\t.long\t"
-
/* end of i386-aout.h */
diff --git a/gcc/config/i386/i386-coff.h b/gcc/config/i386/i386-coff.h
index e2e5ed700ef..69839e17276 100644
--- a/gcc/config/i386/i386-coff.h
+++ b/gcc/config/i386/i386-coff.h
@@ -77,8 +77,6 @@ dtors_section () \
} \
}
-#define INT_ASM_OP "\t.long\t"
-
/* A C statement (sans semicolon) to output an element in the table of
global constructors. */
#define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME) \
diff --git a/gcc/config/i386/i386-interix.h b/gcc/config/i386/i386-interix.h
index f5e9ea58ec2..d2debcbef5d 100644
--- a/gcc/config/i386/i386-interix.h
+++ b/gcc/config/i386/i386-interix.h
@@ -361,8 +361,6 @@ dtors_section () \
(DECL) && TREE_READONLY (DECL) ? "a" : "aw")
#endif
-#define INT_ASM_OP "\t.long\t"
-
/* The MS compilers take alignment as a number of bytes, so we do as well */
#undef ASM_OUTPUT_ALIGN
#define ASM_OUTPUT_ALIGN(FILE,LOG) \
diff --git a/gcc/config/i386/i386-protos.h b/gcc/config/i386/i386-protos.h
index 03fa84f3795..fbf8ca2832f 100644
--- a/gcc/config/i386/i386-protos.h
+++ b/gcc/config/i386/i386-protos.h
@@ -1,6 +1,6 @@
/* Definitions of target machine for GNU compiler for IA-32.
- Copyright (C) 1988, 1992, 1994, 1995, 1996, 1996, 1997, 1998, 1999, 2000
- Free Software Foundation, Inc.
+ Copyright (C) 1988, 1992, 1994, 1995, 1996, 1996, 1997, 1998, 1999,
+ 2000, 2001 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -140,6 +140,8 @@ extern void function_arg_advance PARAMS ((CUMULATIVE_ARGS *, enum machine_mode,
extern void ix86_init_builtins PARAMS ((void));
extern rtx ix86_expand_builtin PARAMS ((tree, rtx, rtx, enum machine_mode, int));
#endif
+extern void ix86_set_move_mem_attrs PARAMS ((rtx, rtx, rtx, rtx, rtx));
+
#endif
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 2737b6bccd4..6742d1979af 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -30,7 +30,6 @@ Boston, MA 02111-1307, USA. */
#include "real.h"
#include "insn-config.h"
#include "conditions.h"
-#include "insn-flags.h"
#include "output.h"
#include "insn-attr.h"
#include "flags.h"
@@ -196,7 +195,8 @@ const int x86_cmove = m_PPRO | m_ATHLON;
const int x86_deep_branch = m_PPRO | m_K6 | m_ATHLON;
const int x86_use_sahf = m_PPRO | m_K6;
const int x86_partial_reg_stall = m_PPRO;
-const int x86_use_loop = m_K6;
+const int x86_use_loop = 0; /* Should be set to K6 and i386, but is broken
+ and temporarily disabled for 3.0.x. */
const int x86_use_fiop = ~(m_PPRO | m_ATHLON | m_PENT);
const int x86_use_mov0 = m_K6;
const int x86_use_cltd = ~(m_PENT | m_K6);
@@ -336,6 +336,40 @@ struct machine_function
#define ix86_stack_locals (cfun->machine->stack_locals)
+/* Structure describing stack frame layout.
+ Stack grows downward:
+
+ [arguments]
+ <- ARG_POINTER
+ saved pc
+
+ saved frame pointer if frame_pointer_needed
+ <- HARD_FRAME_POINTER
+ [saved regs]
+
+ [padding1] \
+ )
+ [va_arg registers] (
+ > to_allocate <- FRAME_POINTER
+ [frame] (
+ )
+ [padding2] /
+ */
+struct ix86_frame
+{
+ int nregs;
+ int padding1;
+ HOST_WIDE_INT frame;
+ int padding2;
+ int outgoing_arguments_size;
+
+ HOST_WIDE_INT to_allocate;
+ /* The offsets relative to ARG_POINTER. */
+ HOST_WIDE_INT frame_pointer_offset;
+ HOST_WIDE_INT hard_frame_pointer_offset;
+ HOST_WIDE_INT stack_pointer_offset;
+};
+
/* which cpu are we scheduling for */
enum processor_type ix86_cpu;
@@ -383,7 +417,12 @@ int ix86_align_loops;
/* Power of two alignment for non-loop jumps. */
int ix86_align_jumps;
+
+/* Prefix built by ASM_GENERATE_INTERNAL_LABEL. */
+static char internal_label_prefix[16];
+static int internal_label_prefix_len;
+static int local_symbolic_operand PARAMS ((rtx, enum machine_mode));
static void output_pic_addr_const PARAMS ((FILE *, rtx, int));
static void put_condition_code PARAMS ((enum rtx_code, enum machine_mode,
int, int, FILE *));
@@ -407,12 +446,11 @@ static void ix86_mark_machine_status PARAMS ((struct function *));
static void ix86_free_machine_status PARAMS ((struct function *));
static int ix86_split_to_parts PARAMS ((rtx, rtx *, enum machine_mode));
static int ix86_safe_length_prefix PARAMS ((rtx));
-static HOST_WIDE_INT ix86_compute_frame_size PARAMS((HOST_WIDE_INT,
- int *, int *, int *));
static int ix86_nsaved_regs PARAMS((void));
static void ix86_emit_save_regs PARAMS((void));
-static void ix86_emit_restore_regs_using_mov PARAMS ((rtx, int));
+static void ix86_emit_restore_regs_using_mov PARAMS ((rtx, int, int));
static void ix86_emit_epilogue_esp_adjustment PARAMS((int));
+static void ix86_set_move_mem_attrs_1 PARAMS ((rtx, rtx, rtx, rtx, rtx));
static void ix86_sched_reorder_pentium PARAMS((rtx *, rtx *));
static void ix86_sched_reorder_ppro PARAMS((rtx *, rtx *));
static HOST_WIDE_INT ix86_GOT_alias_set PARAMS ((void));
@@ -446,6 +484,8 @@ static int ix86_fp_comparison_arithmetics_cost PARAMS ((enum rtx_code code));
static int ix86_fp_comparison_fcomi_cost PARAMS ((enum rtx_code code));
static int ix86_fp_comparison_sahf_cost PARAMS ((enum rtx_code code));
static int ix86_fp_comparison_cost PARAMS ((enum rtx_code code));
+static int ix86_save_reg PARAMS ((int, int));
+static void ix86_compute_frame_layout PARAMS ((struct ix86_frame *));
/* Sometimes certain combinations of command options do not make
sense on a particular target machine. You can define a macro
@@ -658,6 +698,15 @@ override_options ()
on by -msse. */
if (TARGET_SSE)
target_flags |= MASK_MMX;
+
+ /* Figure out what ASM_GENERATE_INTERNAL_LABEL builds as a prefix. */
+ {
+ char *p;
+ ASM_GENERATE_INTERNAL_LABEL (internal_label_prefix, "LX", 0);
+ p = strchr (internal_label_prefix, 'X');
+ internal_label_prefix_len = p - internal_label_prefix;
+ *p = '\0';
+ }
}
/* A C statement (sans semicolon) to choose the order in which to
@@ -1093,6 +1142,40 @@ pic_symbolic_operand (op, mode)
return 0;
}
+/* Return true if OP is a symbolic operand that resolves locally. */
+
+static int
+local_symbolic_operand (op, mode)
+ rtx op;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
+{
+ if (GET_CODE (op) == LABEL_REF)
+ return 1;
+
+ if (GET_CODE (op) == CONST
+ && GET_CODE (XEXP (op, 0)) == PLUS
+ && GET_CODE (XEXP (XEXP (op, 0), 1)) == CONST_INT)
+ op = XEXP (XEXP (op, 0), 0);
+
+ if (GET_CODE (op) != SYMBOL_REF)
+ return 0;
+
+ /* These we've been told are local by varasm and encode_section_info
+ respectively. */
+ if (CONSTANT_POOL_ADDRESS_P (op) || SYMBOL_REF_FLAG (op))
+ return 1;
+
+ /* There is, however, a not insubstantial body of code in the rest of
+ the compiler that assumes it can just stick the results of
+ ASM_GENERATE_INTERNAL_LABEL in a symbol_ref and have done. */
+
+ if (strncmp (XSTR (op, 0), internal_label_prefix,
+ internal_label_prefix_len) == 0)
+ return 1;
+
+ return 0;
+}
+
/* Test for a valid operand for a call instruction. Don't allow the
arg pointer register or virtual regs since they may decay into
reg + const, which the patterns can't handle. */
@@ -1234,6 +1317,10 @@ general_no_elim_operand (op, mode)
|| t == virtual_incoming_args_rtx || t == virtual_stack_vars_rtx
|| t == virtual_stack_dynamic_rtx)
return 0;
+ if (REG_P (t)
+ && REGNO (t) >= FIRST_VIRTUAL_REGISTER
+ && REGNO (t) <= LAST_VIRTUAL_REGISTER)
+ return 0;
return general_operand (op, mode);
}
@@ -1677,8 +1764,7 @@ symbolic_reference_mentioned_p (op)
int
ix86_can_use_return_insn_p ()
{
- HOST_WIDE_INT tsize;
- int nregs;
+ struct ix86_frame frame;
#ifdef NON_SAVING_SETJMP
if (NON_SAVING_SETJMP && current_function_calls_setjmp)
@@ -1698,8 +1784,8 @@ ix86_can_use_return_insn_p ()
&& current_function_args_size >= 32768)
return 0;
- tsize = ix86_compute_frame_size (get_frame_size (), &nregs, NULL, NULL);
- return tsize == 0 && nregs == 0;
+ ix86_compute_frame_layout (&frame);
+ return frame.to_allocate == 0 && frame.nregs == 0;
}
/* Value should be nonzero if functions must have frame pointers.
@@ -1827,24 +1913,49 @@ gen_push (arg)
arg);
}
+/* Return 1 if we need to save REGNO. */
+static int
+ix86_save_reg (regno, maybe_eh_return)
+ int regno;
+ int maybe_eh_return;
+{
+ if (flag_pic
+ && regno == PIC_OFFSET_TABLE_REGNUM
+ && (current_function_uses_pic_offset_table
+ || current_function_uses_const_pool
+ || current_function_calls_eh_return))
+ return 1;
+
+ if (current_function_calls_eh_return && maybe_eh_return)
+ {
+ unsigned i;
+ for (i = 0; ; i++)
+ {
+ unsigned test = EH_RETURN_DATA_REGNO(i);
+ if (test == INVALID_REGNUM)
+ break;
+ if (test == (unsigned) regno)
+ return 1;
+ }
+ }
+
+ return (regs_ever_live[regno]
+ && !call_used_regs[regno]
+ && !fixed_regs[regno]
+ && (regno != HARD_FRAME_POINTER_REGNUM || !frame_pointer_needed));
+}
+
/* Return number of registers to be saved on the stack. */
static int
ix86_nsaved_regs ()
{
int nregs = 0;
- int pic_reg_used = flag_pic && (current_function_uses_pic_offset_table
- || current_function_uses_const_pool);
- int limit = (frame_pointer_needed
- ? HARD_FRAME_POINTER_REGNUM : STACK_POINTER_REGNUM);
int regno;
- for (regno = limit - 1; regno >= 0; regno--)
- if ((regs_ever_live[regno] && ! call_used_regs[regno])
- || (regno == PIC_OFFSET_TABLE_REGNUM && pic_reg_used))
- {
- nregs ++;
- }
+ for (regno = FIRST_PSEUDO_REGISTER - 1; regno >= 0; regno--)
+ if (ix86_save_reg (regno, true))
+ nregs++;
return nregs;
}
@@ -1856,82 +1967,46 @@ ix86_initial_elimination_offset (from, to)
int from;
int to;
{
- int padding1;
- int nregs;
-
- /* Stack grows downward:
-
- [arguments]
- <- ARG_POINTER
- saved pc
-
- saved frame pointer if frame_pointer_needed
- <- HARD_FRAME_POINTER
- [saved regs]
-
- [padding1] \
- | <- FRAME_POINTER
- [frame] > tsize
- |
- [padding2] /
- */
+ struct ix86_frame frame;
+ ix86_compute_frame_layout (&frame);
if (from == ARG_POINTER_REGNUM && to == HARD_FRAME_POINTER_REGNUM)
- /* Skip saved PC and previous frame pointer.
- Executed only when frame_pointer_needed. */
- return 8;
+ return frame.hard_frame_pointer_offset;
else if (from == FRAME_POINTER_REGNUM
&& to == HARD_FRAME_POINTER_REGNUM)
- {
- ix86_compute_frame_size (get_frame_size (), &nregs, &padding1, (int *) 0);
- padding1 += nregs * UNITS_PER_WORD;
- return -padding1;
- }
+ return frame.hard_frame_pointer_offset - frame.frame_pointer_offset;
else
{
- /* ARG_POINTER or FRAME_POINTER to STACK_POINTER elimination. */
- int frame_size = frame_pointer_needed ? 8 : 4;
- HOST_WIDE_INT tsize = ix86_compute_frame_size (get_frame_size (),
- &nregs, &padding1, (int *) 0);
-
if (to != STACK_POINTER_REGNUM)
abort ();
else if (from == ARG_POINTER_REGNUM)
- return tsize + nregs * UNITS_PER_WORD + frame_size;
+ return frame.stack_pointer_offset;
else if (from != FRAME_POINTER_REGNUM)
abort ();
else
- return tsize - padding1;
+ return frame.stack_pointer_offset - frame.frame_pointer_offset;
}
}
-/* Compute the size of local storage taking into consideration the
- desired stack alignment which is to be maintained. Also determine
- the number of registers saved below the local storage.
-
- PADDING1 returns padding before stack frame and PADDING2 returns
- padding after stack frame;
- */
+/* Fill structure ix86_frame about frame of currently computed function. */
-static HOST_WIDE_INT
-ix86_compute_frame_size (size, nregs_on_stack, rpadding1, rpadding2)
- HOST_WIDE_INT size;
- int *nregs_on_stack;
- int *rpadding1;
- int *rpadding2;
+static void
+ix86_compute_frame_layout (frame)
+ struct ix86_frame *frame;
{
- int nregs;
- int padding1 = 0;
- int padding2 = 0;
HOST_WIDE_INT total_size;
int stack_alignment_needed = cfun->stack_alignment_needed / BITS_PER_UNIT;
int offset;
int preferred_alignment = cfun->preferred_stack_boundary / BITS_PER_UNIT;
+ HOST_WIDE_INT size = get_frame_size ();
- nregs = ix86_nsaved_regs ();
+ frame->nregs = ix86_nsaved_regs ();
total_size = size;
- offset = frame_pointer_needed ? 8 : 4;
+ /* Skip return value and save base pointer. */
+ offset = frame_pointer_needed ? UNITS_PER_WORD * 2 : UNITS_PER_WORD;
+
+ frame->hard_frame_pointer_offset = offset;
/* Do some sanity checking of stack_alignment_needed and
preferred_alignment, since i386 port is the only using those features
@@ -1946,36 +2021,58 @@ ix86_compute_frame_size (size, nregs_on_stack, rpadding1, rpadding2)
if (stack_alignment_needed > PREFERRED_STACK_BOUNDARY / BITS_PER_UNIT)
abort ();
- if (stack_alignment_needed < 4)
- stack_alignment_needed = 4;
+ if (stack_alignment_needed < STACK_BOUNDARY / BITS_PER_UNIT)
+ stack_alignment_needed = STACK_BOUNDARY / BITS_PER_UNIT;
- offset += nregs * UNITS_PER_WORD;
+ /* Register save area */
+ offset += frame->nregs * UNITS_PER_WORD;
- if (ACCUMULATE_OUTGOING_ARGS)
- total_size += current_function_outgoing_args_size;
+ /* Align start of frame for local function. */
+ frame->padding1 = ((offset + stack_alignment_needed - 1)
+ & -stack_alignment_needed) - offset;
- total_size += offset;
+ offset += frame->padding1;
- /* Align start of frame for local function. */
- padding1 = ((offset + stack_alignment_needed - 1)
- & -stack_alignment_needed) - offset;
- total_size += padding1;
+ /* Frame pointer points here. */
+ frame->frame_pointer_offset = offset;
- /* Align stack boundary. */
- padding2 = ((total_size + preferred_alignment - 1)
- & -preferred_alignment) - total_size;
+ offset += size;
+ /* Add outgoing arguments area. */
if (ACCUMULATE_OUTGOING_ARGS)
- padding2 += current_function_outgoing_args_size;
-
- if (nregs_on_stack)
- *nregs_on_stack = nregs;
- if (rpadding1)
- *rpadding1 = padding1;
- if (rpadding2)
- *rpadding2 = padding2;
+ {
+ offset += current_function_outgoing_args_size;
+ frame->outgoing_arguments_size = current_function_outgoing_args_size;
+ }
+ else
+ frame->outgoing_arguments_size = 0;
- return size + padding1 + padding2;
+ /* Align stack boundary. */
+ frame->padding2 = ((offset + preferred_alignment - 1)
+ & -preferred_alignment) - offset;
+
+ offset += frame->padding2;
+
+ /* We've reached end of stack frame. */
+ frame->stack_pointer_offset = offset;
+
+ /* Size prologue needs to allocate. */
+ frame->to_allocate =
+ (size + frame->padding1 + frame->padding2
+ + frame->outgoing_arguments_size);
+
+#if 0
+ fprintf (stderr, "nregs: %i\n", frame->nregs);
+ fprintf (stderr, "size: %i\n", size);
+ fprintf (stderr, "alignment1: %i\n", stack_alignment_needed);
+ fprintf (stderr, "padding1: %i\n", frame->padding1);
+ fprintf (stderr, "padding2: %i\n", frame->padding2);
+ fprintf (stderr, "to_allocate: %i\n", frame->to_allocate);
+ fprintf (stderr, "frame_pointer_offset: %i\n", frame->frame_pointer_offset);
+ fprintf (stderr, "hard_frame_pointer_offset: %i\n",
+ frame->hard_frame_pointer_offset);
+ fprintf (stderr, "stack_pointer_offset: %i\n", frame->stack_pointer_offset);
+#endif
}
/* Emit code to save registers in the prologue. */
@@ -1984,16 +2081,10 @@ static void
ix86_emit_save_regs ()
{
register int regno;
- int limit;
rtx insn;
- int pic_reg_used = flag_pic && (current_function_uses_pic_offset_table
- || current_function_uses_const_pool);
- limit = (frame_pointer_needed
- ? HARD_FRAME_POINTER_REGNUM : STACK_POINTER_REGNUM);
- for (regno = limit - 1; regno >= 0; regno--)
- if ((regs_ever_live[regno] && !call_used_regs[regno])
- || (regno == PIC_OFFSET_TABLE_REGNUM && pic_reg_used))
+ for (regno = FIRST_PSEUDO_REGISTER - 1; regno >= 0; regno--)
+ if (ix86_save_reg (regno, true))
{
insn = emit_insn (gen_push (gen_rtx_REG (SImode, regno)));
RTX_FRAME_RELATED_P (insn) = 1;
@@ -2005,11 +2096,12 @@ ix86_emit_save_regs ()
void
ix86_expand_prologue ()
{
- HOST_WIDE_INT tsize = ix86_compute_frame_size (get_frame_size (), (int *) 0,
- (int *) 0, (int *) 0);
rtx insn;
int pic_reg_used = flag_pic && (current_function_uses_pic_offset_table
|| current_function_uses_const_pool);
+ struct ix86_frame frame;
+
+ ix86_compute_frame_layout (&frame);
/* Note: AT&T enter does NOT have reversed args. Enter is probably
slower on all targets. Also sdb doesn't like it. */
@@ -2025,17 +2117,13 @@ ix86_expand_prologue ()
ix86_emit_save_regs ();
- if (tsize == 0)
+ if (frame.to_allocate == 0)
;
- else if (! TARGET_STACK_PROBE || tsize < CHECK_STACK_LIMIT)
+ else if (! TARGET_STACK_PROBE || frame.to_allocate < CHECK_STACK_LIMIT)
{
- if (frame_pointer_needed)
- insn = emit_insn (gen_pro_epilogue_adjust_stack
- (stack_pointer_rtx, stack_pointer_rtx,
- GEN_INT (-tsize), hard_frame_pointer_rtx));
- else
- insn = emit_insn (gen_addsi3 (stack_pointer_rtx, stack_pointer_rtx,
- GEN_INT (-tsize)));
+ insn = emit_insn (gen_pro_epilogue_adjust_stack
+ (stack_pointer_rtx, stack_pointer_rtx,
+ GEN_INT (-frame.to_allocate)));
RTX_FRAME_RELATED_P (insn) = 1;
}
else
@@ -2045,7 +2133,7 @@ ix86_expand_prologue ()
rtx arg0, sym;
arg0 = gen_rtx_REG (SImode, 0);
- emit_move_insn (arg0, GEN_INT (tsize));
+ emit_move_insn (arg0, GEN_INT (frame.to_allocate));
sym = gen_rtx_MEM (FUNCTION_MODE,
gen_rtx_SYMBOL_REF (Pmode, "_alloca"));
@@ -2077,34 +2165,23 @@ static void
ix86_emit_epilogue_esp_adjustment (tsize)
int tsize;
{
- /* If a frame pointer is present, we must be sure to tie the sp
- to the fp so that we don't mis-schedule. */
- if (frame_pointer_needed)
- emit_insn (gen_pro_epilogue_adjust_stack (stack_pointer_rtx,
- stack_pointer_rtx,
- GEN_INT (tsize),
- hard_frame_pointer_rtx));
- else
- emit_insn (gen_addsi3 (stack_pointer_rtx, stack_pointer_rtx,
- GEN_INT (tsize)));
+ emit_insn (gen_pro_epilogue_adjust_stack (stack_pointer_rtx,
+ stack_pointer_rtx,
+ GEN_INT (tsize)));
}
/* Emit code to restore saved registers using MOV insns. First register
is restored from POINTER + OFFSET. */
static void
-ix86_emit_restore_regs_using_mov (pointer, offset)
- rtx pointer;
- int offset;
+ix86_emit_restore_regs_using_mov (pointer, offset, maybe_eh_return)
+ rtx pointer;
+ int offset;
+ int maybe_eh_return;
{
int regno;
- int pic_reg_used = flag_pic && (current_function_uses_pic_offset_table
- || current_function_uses_const_pool);
- int limit = (frame_pointer_needed
- ? HARD_FRAME_POINTER_REGNUM : STACK_POINTER_REGNUM);
- for (regno = 0; regno < limit; regno++)
- if ((regs_ever_live[regno] && !call_used_regs[regno])
- || (regno == PIC_OFFSET_TABLE_REGNUM && pic_reg_used))
+ for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++)
+ if (ix86_save_reg (regno, maybe_eh_return))
{
emit_move_insn (gen_rtx_REG (SImode, regno),
adj_offsettable_operand (gen_rtx_MEM (SImode,
@@ -2117,21 +2194,24 @@ ix86_emit_restore_regs_using_mov (pointer, offset)
/* Restore function stack, frame, and registers. */
void
-ix86_expand_epilogue (emit_return)
- int emit_return;
+ix86_expand_epilogue (style)
+ int style;
{
- int nregs;
int regno;
-
- int pic_reg_used = flag_pic && (current_function_uses_pic_offset_table
- || current_function_uses_const_pool);
int sp_valid = !frame_pointer_needed || current_function_sp_is_unchanging;
+ struct ix86_frame frame;
HOST_WIDE_INT offset;
- HOST_WIDE_INT tsize = ix86_compute_frame_size (get_frame_size (), &nregs,
- (int *) 0, (int *) 0);
- /* Calculate start of saved registers relative to ebp. */
- offset = -nregs * UNITS_PER_WORD;
+ ix86_compute_frame_layout (&frame);
+
+ /* Calculate start of saved registers relative to ebp. Special care
+ must be taken for the normal return case of a function using
+ eh_return: the eax and edx registers are marked as saved, but not
+ restored along this path. */
+ offset = frame.nregs;
+ if (current_function_calls_eh_return && style != 2)
+ offset -= 2;
+ offset *= -UNITS_PER_WORD;
#ifdef FUNCTION_BLOCK_PROFILER_EXIT
if (profile_block_flag == 2)
@@ -2150,10 +2230,11 @@ ix86_expand_epilogue (emit_return)
are no registers to restore. We also use this code when TARGET_USE_LEAVE
and there is exactly one register to pop. This heruistic may need some
tuning in future. */
- if ((!sp_valid && nregs <= 1)
- || (frame_pointer_needed && !nregs && tsize)
+ if ((!sp_valid && frame.nregs <= 1)
+ || (frame_pointer_needed && !frame.nregs && frame.to_allocate)
|| (frame_pointer_needed && TARGET_USE_LEAVE && !optimize_size
- && nregs == 1))
+ && frame.nregs == 1)
+ || style == 2)
{
/* Restore registers. We can use ebp or esp to address the memory
locations. If both are available, default to ebp, since offsets
@@ -2161,13 +2242,41 @@ ix86_expand_epilogue (emit_return)
end of block of saved registers, where we may simplify addressing
mode. */
- if (!frame_pointer_needed || (sp_valid && !tsize))
- ix86_emit_restore_regs_using_mov (stack_pointer_rtx, tsize);
+ if (!frame_pointer_needed || (sp_valid && !frame.to_allocate))
+ ix86_emit_restore_regs_using_mov (stack_pointer_rtx,
+ frame.to_allocate, style == 2);
else
- ix86_emit_restore_regs_using_mov (hard_frame_pointer_rtx, offset);
+ ix86_emit_restore_regs_using_mov (hard_frame_pointer_rtx,
+ offset, style == 2);
+
+ /* eh_return epilogues need %ecx added to the stack pointer. */
+ if (style == 2)
+ {
+ rtx tmp, sa = EH_RETURN_STACKADJ_RTX;
- if (!frame_pointer_needed)
- ix86_emit_epilogue_esp_adjustment (tsize + nregs * UNITS_PER_WORD);
+ if (frame_pointer_needed)
+ {
+ tmp = gen_rtx_PLUS (Pmode, hard_frame_pointer_rtx, sa);
+ tmp = plus_constant (tmp, UNITS_PER_WORD);
+ emit_insn (gen_rtx_SET (VOIDmode, sa, tmp));
+
+ tmp = gen_rtx_MEM (Pmode, hard_frame_pointer_rtx);
+ emit_move_insn (hard_frame_pointer_rtx, tmp);
+
+ emit_insn (gen_pro_epilogue_adjust_stack
+ (stack_pointer_rtx, sa, const0_rtx));
+ }
+ else
+ {
+ tmp = gen_rtx_PLUS (Pmode, stack_pointer_rtx, sa);
+ tmp = plus_constant (tmp, (frame.to_allocate
+ + frame.nregs * UNITS_PER_WORD));
+ emit_insn (gen_rtx_SET (VOIDmode, stack_pointer_rtx, tmp));
+ }
+ }
+ else if (!frame_pointer_needed)
+ ix86_emit_epilogue_esp_adjustment (frame.to_allocate
+ + frame.nregs * UNITS_PER_WORD);
/* If not an i386, mov & pop is faster than "leave". */
else if (TARGET_USE_LEAVE || optimize_size)
emit_insn (gen_leave ());
@@ -2175,8 +2284,7 @@ ix86_expand_epilogue (emit_return)
{
emit_insn (gen_pro_epilogue_adjust_stack (stack_pointer_rtx,
hard_frame_pointer_rtx,
- const0_rtx,
- hard_frame_pointer_rtx));
+ const0_rtx));
emit_insn (gen_popsi1 (hard_frame_pointer_rtx));
}
}
@@ -2190,20 +2298,20 @@ ix86_expand_epilogue (emit_return)
abort ();
emit_insn (gen_pro_epilogue_adjust_stack (stack_pointer_rtx,
hard_frame_pointer_rtx,
- GEN_INT (offset),
- hard_frame_pointer_rtx));
+ GEN_INT (offset)));
}
- else if (tsize)
- ix86_emit_epilogue_esp_adjustment (tsize);
+ else if (frame.to_allocate)
+ ix86_emit_epilogue_esp_adjustment (frame.to_allocate);
- for (regno = 0; regno < STACK_POINTER_REGNUM; regno++)
- if ((regs_ever_live[regno] && !call_used_regs[regno])
- || (regno == PIC_OFFSET_TABLE_REGNUM && pic_reg_used))
+ for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++)
+ if (ix86_save_reg (regno, false))
emit_insn (gen_popsi1 (gen_rtx_REG (SImode, regno)));
+ if (frame_pointer_needed)
+ emit_insn (gen_popsi1 (hard_frame_pointer_rtx));
}
/* Sibcall epilogues don't want a return instruction. */
- if (! emit_return)
+ if (style == 0)
return;
if (current_function_pops_args && current_function_args_size)
@@ -2470,15 +2578,16 @@ legitimate_pic_address_disp_p (disp)
return 0;
/* Must be @GOT or @GOTOFF. */
- if (XINT (disp, 1) != 6
- && XINT (disp, 1) != 7)
- return 0;
-
- if (GET_CODE (XVECEXP (disp, 0, 0)) != SYMBOL_REF
- && GET_CODE (XVECEXP (disp, 0, 0)) != LABEL_REF)
- return 0;
+ switch (XINT (disp, 1))
+ {
+ case 6: /* @GOT */
+ return GET_CODE (XVECEXP (disp, 0, 0)) == SYMBOL_REF;
- return 1;
+ case 7: /* @GOTOFF */
+ return local_symbolic_operand (XVECEXP (disp, 0, 0), Pmode);
+ }
+
+ return 0;
}
/* GO_IF_LEGITIMATE_ADDRESS recognizes an RTL expression that is a valid
@@ -2707,10 +2816,7 @@ legitimize_pic_address (orig, reg)
rtx new = orig;
rtx base;
- if (GET_CODE (addr) == LABEL_REF
- || (GET_CODE (addr) == SYMBOL_REF
- && (CONSTANT_POOL_ADDRESS_P (addr)
- || SYMBOL_REF_FLAG (addr))))
+ if (local_symbolic_operand (addr, Pmode))
{
/* This symbol may be referenced via a displacement from the PIC
base address (@GOTOFF). */
@@ -2762,10 +2868,7 @@ legitimize_pic_address (orig, reg)
/* Check first to see if this is a constant offset from a @GOTOFF
symbol reference. */
- if ((GET_CODE (op0) == LABEL_REF
- || (GET_CODE (op0) == SYMBOL_REF
- && (CONSTANT_POOL_ADDRESS_P (op0)
- || SYMBOL_REF_FLAG (op0))))
+ if (local_symbolic_operand (op0, Pmode)
&& GET_CODE (op1) == CONST_INT)
{
current_function_uses_pic_offset_table = 1;
@@ -3463,6 +3566,13 @@ print_operand (file, x, code)
/* Like above, but reverse condition */
case 'c':
+ /* Check to see if argument to %c is really a constant
+ and not a condition code which needs to be reversed. */
+ if (GET_RTX_CLASS (GET_CODE (x)) != '<')
+ {
+ output_operand_lossage ("operand is neither a constant nor a condition code, invalid operand code 'c'");
+ return;
+ }
put_condition_code (GET_CODE (x), GET_MODE (XEXP (x, 0)), 1, 0, file);
return;
case 'f':
@@ -5478,9 +5588,12 @@ ix86_expand_setcc (code, dest)
emit subreg setcc, zero extend.
2 -- destination is in QImode:
emit setcc only.
- */
- type = 0;
+ We don't use mode 0 early in compilation because it confuses CSE.
+ There are peepholes to turn mode 1 into mode 0 if things work out
+ nicely after reload. */
+
+ type = cse_not_expected ? 0 : 1;
if (GET_MODE (dest) == QImode)
type = 2;
@@ -5628,7 +5741,7 @@ ix86_expand_int_movcc (operands)
* Size 5 - 8.
*/
if (ct)
- emit_insn (gen_addsi3 (out, out, GEN_INT (ct)));
+ emit_insn (gen_addsi3 (tmp, tmp, GEN_INT (ct)));
}
else if (cf == -1)
{
@@ -5639,7 +5752,7 @@ ix86_expand_int_movcc (operands)
*
* Size 8.
*/
- emit_insn (gen_iorsi3 (out, out, GEN_INT (ct)));
+ emit_insn (gen_iorsi3 (tmp, tmp, GEN_INT (ct)));
}
else if (diff == -1 && ct)
{
@@ -5653,7 +5766,7 @@ ix86_expand_int_movcc (operands)
*/
emit_insn (gen_one_cmplsi2 (tmp, tmp));
if (cf)
- emit_insn (gen_addsi3 (out, out, GEN_INT (cf)));
+ emit_insn (gen_addsi3 (tmp, tmp, GEN_INT (cf)));
}
else
{
@@ -5665,9 +5778,9 @@ ix86_expand_int_movcc (operands)
*
* Size 8 - 11.
*/
- emit_insn (gen_andsi3 (out, out, GEN_INT (cf - ct)));
+ emit_insn (gen_andsi3 (tmp, tmp, GEN_INT (cf - ct)));
if (ct)
- emit_insn (gen_addsi3 (out, out, GEN_INT (ct)));
+ emit_insn (gen_addsi3 (tmp, tmp, GEN_INT (ct)));
}
if (tmp != out)
@@ -5895,6 +6008,9 @@ ix86_expand_int_movcc (operands)
emit_move_insn (tmp, operands[2]);
operands[2] = tmp;
}
+ if (! register_operand (operands[2], VOIDmode)
+ && ! register_operand (operands[3], VOIDmode))
+ operands[2] = force_reg (GET_MODE (operands[0]), operands[2]);
emit_insn (compare_seq);
emit_insn (gen_rtx_SET (VOIDmode, operands[0],
@@ -7327,6 +7443,52 @@ ix86_variable_issue (dump, sched_verbose, insn, can_issue_more)
}
}
+/* Walk through INSNS and look for MEM references whose address is DSTREG or
+ SRCREG and set the memory attribute to those of DSTREF and SRCREF, as
+ appropriate. */
+
+void
+ix86_set_move_mem_attrs (insns, dstref, srcref, dstreg, srcreg)
+ rtx insns;
+ rtx dstref, srcref, dstreg, srcreg;
+{
+ rtx insn;
+
+ for (insn = insns; insn != 0 ; insn = NEXT_INSN (insn))
+ if (INSN_P (insn))
+ ix86_set_move_mem_attrs_1 (PATTERN (insn), dstref, srcref,
+ dstreg, srcreg);
+}
+
+/* Subroutine of above to actually do the updating by recursively walking
+ the rtx. */
+
+static void
+ix86_set_move_mem_attrs_1 (x, dstref, srcref, dstreg, srcreg)
+ rtx x;
+ rtx dstref, srcref, dstreg, srcreg;
+{
+ enum rtx_code code = GET_CODE (x);
+ const char *format_ptr = GET_RTX_FORMAT (code);
+ int i, j;
+
+ if (code == MEM && XEXP (x, 0) == dstreg)
+ MEM_COPY_ATTRIBUTES (x, dstref);
+ else if (code == MEM && XEXP (x, 0) == srcreg)
+ MEM_COPY_ATTRIBUTES (x, srcref);
+
+ for (i = 0; i < GET_RTX_LENGTH (code); i++, format_ptr++)
+ {
+ if (*format_ptr == 'e')
+ ix86_set_move_mem_attrs_1 (XEXP (x, i), dstref, srcref,
+ dstreg, srcreg);
+ else if (*format_ptr == 'E')
+ for (j = XVECLEN (x, i) - 1; j >= 0; j--)
+ ix86_set_move_mem_attrs_1 (XVECEXP (x, i, j), dstref, srcref,
+ dstreg, srcreg);
+ }
+}
+
/* Compute the alignment given to a constant that is being placed in memory.
EXP is the constant and ALIGN is the alignment that the object would
ordinarily have.
diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h
index 48008724198..7471560fd09 100644
--- a/gcc/config/i386/i386.h
+++ b/gcc/config/i386/i386.h
@@ -294,13 +294,6 @@ extern const int x86_partial_reg_dependency, x86_memory_mismatch_stall;
N_("Use push instructions to save outgoing arguments") }, \
{ "no-accumulate-outgoing-args",-MASK_ACCUMULATE_OUTGOING_ARGS, \
N_("Do not use push instructions to save outgoing arguments") }, \
- { "mmx", MASK_MMX, N_("Support MMX builtins") }, \
- { "no-mmx", -MASK_MMX, \
- N_("Do not support MMX builtins") }, \
- { "sse", MASK_SSE, \
- N_("Support MMX and SSE builtins") }, \
- { "no-sse", -MASK_SSE, \
- N_("Do not support MMX and SSE builtins") }, \
{ "128bit-long-double", MASK_128BIT_LONG_DOUBLE, \
N_("sizeof(long double) is 16.") }, \
{ "96bit-long-double", -MASK_128BIT_LONG_DOUBLE, \
@@ -381,10 +374,14 @@ extern int ix86_arch;
#ifndef CC1_CPU_SPEC
#define CC1_CPU_SPEC "\
%{!mcpu*: \
-%{m386:-mcpu=i386} \
-%{m486:-mcpu=i486} \
-%{mpentium:-mcpu=pentium} \
-%{mpentiumpro:-mcpu=pentiumpro}}"
+%{m386:-mcpu=i386 \
+%n`-m386' is deprecated. Use `-march=i386' or `-mcpu=i386' instead.\n} \
+%{m486:-mcpu=i486 \
+%n`-m486' is deprecated. Use `-march=i486' or `-mcpu=i486' instead.\n} \
+%{mpentium:-mcpu=pentium \
+%n`-mpentium' is deprecated. Use `-march=pentium' or `-mcpu=pentium' instead.\n} \
+%{mpentiumpro:-mcpu=pentiumpro \
+%n`-mpentiumpro' is deprecated. Use `-march=pentiumpro' or `-mcpu=pentiumpro' instead.\n}}"
#endif
#ifndef CPP_CPU_DEFAULT_SPEC
@@ -514,6 +511,13 @@ extern int ix86_arch;
aligned; the compiler cannot rely on having this alignment. */
#define PREFERRED_STACK_BOUNDARY ix86_preferred_stack_boundary
+/* As of July 2001, many runtimes to not align the stack properly when
+ entering main. This causes expand_main_function to forcably align
+ the stack, which results in aligned frames for functions called from
+ main, though it does nothing for the alignment of main itself. */
+#define FORCE_PREFERRED_STACK_BOUNDARY_IN_MAIN \
+ (ix86_preferred_stack_boundary > STACK_BOUNDARY)
+
/* Allocation boundary for the code of a function. */
#define FUNCTION_BOUNDARY \
(1 << ((ix86_align_funcs >= 0 ? ix86_align_funcs : -ix86_align_funcs) + 3))
@@ -899,11 +903,11 @@ extern int ix86_arch;
should always be returned in memory. You should instead use
`DEFAULT_PCC_STRUCT_RETURN' to indicate this. */
-#define RETURN_IN_MEMORY(TYPE) \
- ((TYPE_MODE (TYPE) == BLKmode) \
- || (VECTOR_MODE_P (TYPE_MODE (TYPE)) && int_size_in_bytes (TYPE) == 8) \
- || (int_size_in_bytes (TYPE) > 12 && TYPE_MODE (TYPE) != TImode \
- && ! VECTOR_MODE_P (TYPE_MODE (TYPE))))
+#define RETURN_IN_MEMORY(TYPE) \
+ ((TYPE_MODE (TYPE) == BLKmode) \
+ || (VECTOR_MODE_P (TYPE_MODE (TYPE)) && int_size_in_bytes (TYPE) == 8)\
+ || (int_size_in_bytes (TYPE) > 12 && TYPE_MODE (TYPE) != TImode \
+ && TYPE_MODE (TYPE) != TFmode && ! VECTOR_MODE_P (TYPE_MODE (TYPE))))
/* Define the classes of registers for register constraints in the
@@ -2633,6 +2637,22 @@ extern int const svr4_dbx_register_map[FIRST_PSEUDO_REGISTER];
/* Before the prologue, the top of the frame is at 4(%esp). */
#define INCOMING_FRAME_SP_OFFSET 4
+/* Describe how we implement __builtin_eh_return. */
+#define EH_RETURN_DATA_REGNO(N) ((N) < 2 ? (N) : INVALID_REGNUM)
+#define EH_RETURN_STACKADJ_RTX gen_rtx_REG (Pmode, 2)
+
+/* Select a format to encode pointers in exception handling data. CODE
+ is 0 for data, 1 for code labels, 2 for function pointers. GLOBAL is
+ true if the symbol may be affected by dynamic relocations.
+
+ ??? All x86 object file formats are capable of representing this.
+ After all, the relocation needed is the same as for the call insn.
+ Whether or not a particular assembler allows us to enter such, I
+ guess we'll have to see. */
+#define ASM_PREFERRED_EH_DATA_FORMAT(CODE,GLOBAL) \
+ (flag_pic ? (GLOBAL ? DW_EH_PE_indirect : 0) | DW_EH_PE_pcrel \
+ : DW_EH_PE_absptr)
+
/* This is how to output the definition of a user-level label named NAME,
such as the label on a static function or variable NAME. */
@@ -2644,7 +2664,7 @@ extern int const svr4_dbx_register_map[FIRST_PSEUDO_REGISTER];
#define ASM_OUTPUT_DOUBLE(FILE,VALUE) \
do { long l[2]; \
REAL_VALUE_TO_TARGET_DOUBLE (VALUE, l); \
- fprintf (FILE, "%s\t0x%lx,0x%lx\n", ASM_LONG, l[0], l[1]); \
+ fprintf (FILE, "%s0x%lx,0x%lx\n", ASM_LONG, l[0], l[1]); \
} while (0)
/* This is how to output a `long double' extended real constant. */
@@ -2654,9 +2674,9 @@ do { long l[2]; \
do { long l[4]; \
REAL_VALUE_TO_TARGET_LONG_DOUBLE (VALUE, l); \
if (TARGET_128BIT_LONG_DOUBLE) \
- fprintf (FILE, "%s\t0x%lx,0x%lx,0x%lx,0x0\n", ASM_LONG, l[0], l[1], l[2]); \
+ fprintf (FILE, "%s0x%lx,0x%lx,0x%lx,0x0\n", ASM_LONG, l[0], l[1], l[2]); \
else \
- fprintf (FILE, "%s\t0x%lx,0x%lx,0x%lx\n", ASM_LONG, l[0], l[1], l[2]); \
+ fprintf (FILE, "%s0x%lx,0x%lx,0x%lx\n", ASM_LONG, l[0], l[1], l[2]); \
} while (0)
/* This is how to output an assembler line defining a `float' constant. */
@@ -2664,7 +2684,7 @@ do { long l[4]; \
#define ASM_OUTPUT_FLOAT(FILE,VALUE) \
do { long l; \
REAL_VALUE_TO_TARGET_SINGLE (VALUE, l); \
- fprintf ((FILE), "%s\t0x%lx\n", ASM_LONG, l); \
+ fprintf ((FILE), "%s0x%lx\n", ASM_LONG, l); \
} while (0)
/* Store in OUTPUT a string (made with alloca) containing
@@ -2678,23 +2698,30 @@ do { long l; \
/* This is how to output an assembler line defining an `int' constant. */
#define ASM_OUTPUT_INT(FILE,VALUE) \
-( fprintf (FILE, "%s\t", ASM_LONG), \
+( fputs (ASM_LONG, FILE), \
output_addr_const (FILE,(VALUE)), \
putc('\n',FILE))
/* Likewise for `char' and `short' constants. */
-/* is this supposed to do align too?? */
#define ASM_OUTPUT_SHORT(FILE,VALUE) \
-( fprintf (FILE, "%s\t", ASM_SHORT), \
+( fputs (ASM_SHORT, FILE), \
output_addr_const (FILE,(VALUE)), \
putc('\n',FILE))
#define ASM_OUTPUT_CHAR(FILE,VALUE) \
-( fprintf (FILE, "%s", ASM_BYTE_OP), \
+( fputs (ASM_BYTE_OP, FILE), \
output_addr_const (FILE, (VALUE)), \
putc ('\n', FILE))
+/* Given that x86 natively supports unaligned data, it's reasonable to
+ assume that all x86 assemblers don't auto-align data. Thus the
+ unaligned output macros required by dwarf2 frame unwind information
+ degenerate to the macros used above. */
+#define UNALIGNED_SHORT_ASM_OP ASM_SHORT
+#define UNALIGNED_INT_ASM_OP ASM_LONG
+#define INT_ASM_OP ASM_LONG
+
/* This is how to output an assembler line for a numeric constant byte. */
#define ASM_OUTPUT_BYTE(FILE,VALUE) \
@@ -2716,7 +2743,7 @@ do { long l; \
*/
#define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \
- fprintf (FILE, "%s %s%d\n", ASM_LONG, LPREFIX, VALUE)
+ fprintf (FILE, "%s%s%d\n", ASM_LONG, LPREFIX, VALUE)
/* This is how to output an element of a case-vector that is relative.
We don't use these on the 386 yet, because the ATT assembler can't do
@@ -2724,7 +2751,7 @@ do { long l; \
*/
#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \
- fprintf (FILE, "\t%s\t%s%d-%s%d\n",ASM_LONG, LPREFIX, VALUE, LPREFIX, REL)
+ fprintf (FILE, "%s%s%d-%s%d\n",ASM_LONG, LPREFIX, VALUE, LPREFIX, REL)
/* A C statement that outputs an address constant appropriate to
for DWARF debugging. */
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index df16d5b608d..0816fa87c47 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -1,5 +1,5 @@
;; GCC machine description for IA-32.
-;; Copyright (C) 1988, 1994, 1995, 1996, 1997, 1998, 1999, 2000
+;; Copyright (C) 1988, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
;; Free Software Foundation, Inc.
;; Mostly by William Schelter.
;;
@@ -72,6 +72,7 @@
;; 10 This is a `sahf' operation.
;; 11 This is a `fstcw' operation
;; 12 This is behaviour of add when setting carry flag.
+;; 13 This is a `eh_return' placeholder.
;; For SSE/MMX support:
;; 30 This is `fix', guaranteed to be truncating.
@@ -1553,7 +1554,7 @@
(define_insn "*pushsi2_prologue"
[(set (match_operand:SI 0 "push_operand" "=<")
(match_operand:SI 1 "general_no_elim_operand" "ri*m"))
- (set (reg:SI 6) (reg:SI 6))]
+ (clobber (mem:BLK (scratch)))]
""
"push{l}\\t%1"
[(set_attr "type" "push")
@@ -1564,7 +1565,7 @@
(mem:SI (reg:SI 7)))
(set (reg:SI 7)
(plus:SI (reg:SI 7) (const_int 4)))
- (set (reg:SI 6) (reg:SI 6))]
+ (clobber (mem:BLK (scratch)))]
""
"pop{l}\\t%0"
[(set_attr "type" "pop")
@@ -1580,7 +1581,7 @@
[(set_attr "type" "pop")
(set_attr "mode" "SI")])
-(define_insn "*movsi_xor"
+(define_insn "movsi_xor"
[(set (match_operand:SI 0 "register_operand" "=r")
(match_operand:SI 1 "const0_operand" "i"))
(clobber (reg:CC 17))]
@@ -3671,7 +3672,7 @@
(set_attr "mode" "SF")])
(define_insn "*truncxfsf2_2"
- [(set (match_operand:SF 0 "nonimmediate_operand" "=m")
+ [(set (match_operand:SF 0 "memory_operand" "=m")
(float_truncate:SF
(match_operand:TF 1 "register_operand" "f")))]
"TARGET_80387"
@@ -9593,6 +9594,30 @@
(match_dup 0)
(pc)))]
"")
+
+;; Convert setcc + movzbl to xor + setcc if operands don't overlap.
+
+(define_peephole2
+ [(set (reg 17) (match_operand 0 "" ""))
+ (set (match_operand:QI 1 "register_operand" "")
+ (match_operator:QI 2 "ix86_comparison_operator"
+ [(reg 17) (const_int 0)]))
+ (set (match_operand 3 "q_regs_operand" "")
+ (zero_extend (match_dup 1)))]
+ "peep2_reg_dead_p (3, operands[1])
+ && ! reg_overlap_mentioned_p (operands[3], operands[0])"
+ [(set (match_dup 4) (match_dup 0))
+ (set (strict_low_part (match_dup 5))
+ (match_dup 2))]
+ "
+{
+ operands[4] = gen_rtx_REG (GET_MODE (operands[0]), 17);
+ operands[5] = gen_rtx_REG (QImode, REGNO (operands[3]));
+ if (HAVE_movsi_xor)
+ emit_insn (gen_movsi_xor (operands[3], const0_rtx));
+ else
+ emit_insn (gen_movsi (operands[3], const0_rtx));
+}")
;; Call instructions.
@@ -9914,9 +9939,39 @@
""
"ix86_expand_epilogue (0); DONE;")
+(define_expand "eh_return"
+ [(use (match_operand 0 "register_operand" ""))
+ (use (match_operand 1 "register_operand" ""))]
+ ""
+ "
+{
+ rtx tmp, sa = operands[0], ra = operands[1];
+
+ /* Tricky bit: we write the address of the handler to which we will
+ be returning into someone else's stack frame, one word below the
+ stack address we wish to restore. */
+ tmp = gen_rtx_PLUS (Pmode, arg_pointer_rtx, sa);
+ tmp = plus_constant (tmp, -UNITS_PER_WORD);
+ tmp = gen_rtx_MEM (Pmode, tmp);
+ emit_move_insn (tmp, ra);
+
+ emit_insn (gen_eh_return_1 (sa));
+ emit_barrier ();
+ DONE;
+}")
+
+(define_insn_and_split "eh_return_1"
+ [(unspec_volatile [(match_operand 0 "register_operand" "c")] 13)]
+ ""
+ "#"
+ "reload_completed"
+ [(const_int 1)]
+ "ix86_expand_epilogue (2); DONE;")
+
(define_insn "leave"
[(set (reg:SI 7) (reg:SI 6))
- (set (reg:SI 6) (mem:SI (pre_dec:SI (reg:SI 7))))]
+ (set (reg:SI 6) (mem:SI (pre_dec:SI (reg:SI 7))))
+ (clobber (mem:BLK (scratch)))]
""
"leave"
[(set_attr "length_immediate" "0")
@@ -10703,6 +10758,9 @@
rtx srcreg, destreg, countreg;
int align = 0;
int count = -1;
+ rtx insns;
+
+ start_sequence ();
if (GET_CODE (operands[3]) == CONST_INT)
align = INTVAL (operands[3]);
@@ -10717,7 +10775,7 @@
destreg = copy_to_mode_reg (Pmode, XEXP (operands[0], 0));
srcreg = copy_to_mode_reg (Pmode, XEXP (operands[1], 0));
- emit_insn (gen_cld());
+ emit_insn (gen_cld ());
/* When optimizing for size emit simple rep ; movsb instruction for
counts not divisible by 4. */
@@ -10766,10 +10824,13 @@
library version, since it is usually equally fast and result in
shorter code. */
if (!TARGET_INLINE_ALL_STRINGOPS && align < 4)
- FAIL;
+ {
+ end_sequence ();
+ FAIL;
+ }
if (TARGET_SINGLE_STRINGOP)
- emit_insn (gen_cld());
+ emit_insn (gen_cld ());
countreg2 = gen_reg_rtx (SImode);
countreg = copy_to_mode_reg (SImode, operands[2]);
@@ -10856,7 +10917,7 @@
LABEL_NUSES (label) = 1;
}
if (align > 1 && count > 0 && (count & 1))
- emit_insn (gen_strmovsi (destreg, srcreg));
+ emit_insn (gen_strmovqi (destreg, srcreg));
if (align <= 1 || count < 0)
{
rtx label = gen_label_rtx ();
@@ -10869,6 +10930,12 @@
LABEL_NUSES (label) = 1;
}
}
+
+ insns = get_insns ();
+ end_sequence ();
+
+ ix86_set_move_mem_attrs (insns, operands[0], operands[1], destreg, srcreg);
+ emit_insns (insns);
DONE;
}")
@@ -11039,6 +11106,9 @@
rtx destreg, zeroreg, countreg;
int align = 0;
int count = -1;
+ rtx insns;
+
+ start_sequence ();
if (GET_CODE (operands[2]) == CONST_INT)
align = INTVAL (operands[2]);
@@ -11052,7 +11122,7 @@
destreg = copy_to_mode_reg (Pmode, XEXP (operands[0], 0));
- emit_insn (gen_cld());
+ emit_insn (gen_cld ());
/* When optimizing for size emit simple rep ; movsb instruction for
counts not divisible by 4. */
@@ -11095,10 +11165,13 @@
library version, since it is usually equally fast and result in
shorter code. */
if (!TARGET_INLINE_ALL_STRINGOPS && align < 4)
- FAIL;
+ {
+ end_sequence ();
+ FAIL;
+ }
if (TARGET_SINGLE_STRINGOP)
- emit_insn (gen_cld());
+ emit_insn (gen_cld ());
countreg2 = gen_reg_rtx (SImode);
countreg = copy_to_mode_reg (SImode, operands[1]);
@@ -11192,6 +11265,13 @@
LABEL_NUSES (label) = 1;
}
}
+
+ insns = get_insns ();
+ end_sequence ();
+
+ ix86_set_move_mem_attrs (insns, operands[0], operands[0], destreg, destreg);
+ emit_insns (insns);
+
DONE;
}")
@@ -11504,6 +11584,91 @@
[(set_attr "type" "str")
(set_attr "mode" "QI")
(set_attr "prefix_rep" "1")])
+
+;; Peephole optimizations to clean up after cmpstr*. This should be
+;; handled in combine, but it is not currently up to the task.
+;; When used for their truth value, the cmpstr* expanders generate
+;; code like this:
+;;
+;; repz cmpsb
+;; seta %al
+;; setb %dl
+;; cmpb %al, %dl
+;; jcc label
+;;
+;; The intermediate three instructions are unnecessary.
+
+;; This one handles cmpstr*_nz_1...
+(define_peephole2
+ [(parallel[
+ (set (reg:CC 17)
+ (compare:CC (mem:BLK (match_operand 4 "register_operand" ""))
+ (mem:BLK (match_operand 5 "register_operand" ""))))
+ (use (match_operand 6 "register_operand" ""))
+ (use (match_operand:SI 3 "immediate_operand" ""))
+ (use (reg:SI 19))
+ (clobber (match_operand 0 "register_operand" ""))
+ (clobber (match_operand 1 "register_operand" ""))
+ (clobber (match_operand 2 "register_operand" ""))])
+ (set (match_operand:QI 7 "register_operand" "")
+ (gtu:QI (reg:CC 17) (const_int 0)))
+ (set (match_operand:QI 8 "register_operand" "")
+ (ltu:QI (reg:CC 17) (const_int 0)))
+ (set (reg 17)
+ (compare (match_dup 7) (match_dup 8)))
+ ]
+ "peep2_reg_dead_p (4, operands[7]) && peep2_reg_dead_p (4, operands[8])"
+ [(parallel[
+ (set (reg:CC 17)
+ (compare:CC (mem:BLK (match_dup 4))
+ (mem:BLK (match_dup 5))))
+ (use (match_dup 6))
+ (use (match_dup 3))
+ (use (reg:SI 19))
+ (clobber (match_dup 0))
+ (clobber (match_dup 1))
+ (clobber (match_dup 2))])]
+ "")
+
+;; ...and this one handles cmpstr*_1.
+(define_peephole2
+ [(parallel[
+ (set (reg:CC 17)
+ (if_then_else:CC (ne (match_operand 6 "register_operand" "")
+ (const_int 0))
+ (compare:CC (mem:BLK (match_operand 4 "register_operand" ""))
+ (mem:BLK (match_operand 5 "register_operand" "")))
+ (const_int 0)))
+ (use (match_operand:SI 3 "immediate_operand" ""))
+ (use (reg:CC 17))
+ (use (reg:SI 19))
+ (clobber (match_operand 0 "register_operand" ""))
+ (clobber (match_operand 1 "register_operand" ""))
+ (clobber (match_operand 2 "register_operand" ""))])
+ (set (match_operand:QI 7 "register_operand" "")
+ (gtu:QI (reg:CC 17) (const_int 0)))
+ (set (match_operand:QI 8 "register_operand" "")
+ (ltu:QI (reg:CC 17) (const_int 0)))
+ (set (reg 17)
+ (compare (match_dup 7) (match_dup 8)))
+ ]
+ "peep2_reg_dead_p (4, operands[7]) && peep2_reg_dead_p (4, operands[8])"
+ [(parallel[
+ (set (reg:CC 17)
+ (if_then_else:CC (ne (match_dup 6)
+ (const_int 0))
+ (compare:CC (mem:BLK (match_dup 4))
+ (mem:BLK (match_dup 5)))
+ (const_int 0)))
+ (use (match_dup 3))
+ (use (reg:CC 17))
+ (use (reg:SI 19))
+ (clobber (match_dup 0))
+ (clobber (match_dup 1))
+ (clobber (match_dup 2))])]
+ "")
+
+
;; Conditional move instructions.
@@ -11671,9 +11836,8 @@
[(set (match_operand:SI 0 "register_operand" "=r,r")
(plus:SI (match_operand:SI 1 "register_operand" "0,r")
(match_operand:SI 2 "immediate_operand" "i,i")))
- (set (match_operand:SI 3 "register_operand" "+r,r")
- (match_dup 3))
- (clobber (reg:CC 17))]
+ (clobber (reg:CC 17))
+ (clobber (mem:BLK (scratch)))]
""
"*
{
@@ -11745,15 +11909,6 @@
DONE;
}")
-(define_expand "exception_receiver"
- [(const_int 0)]
- "flag_pic"
- "
-{
- load_pic_register ();
- DONE;
-}")
-
(define_expand "builtin_setjmp_receiver"
[(label_ref (match_operand 0 "" ""))]
"flag_pic"
@@ -11784,7 +11939,7 @@
operands[1] = gen_lowpart (SImode, operands[1]);
if (GET_CODE (operands[3]) != ASHIFT)
operands[2] = gen_lowpart (SImode, operands[2]);
- GET_MODE (operands[3]) = SImode;")
+ PUT_MODE (operands[3], SImode);")
(define_split
[(set (reg 17)
@@ -12272,23 +12427,23 @@
(define_peephole2
[(match_scratch:SI 0 "r")
(parallel [(set (reg:SI 7) (plus:SI (reg:SI 7) (const_int -4)))
- (set (reg:SI 6) (reg:SI 6))
- (clobber (reg:CC 17))])]
+ (clobber (reg:CC 17))
+ (clobber (mem:BLK (scratch)))])]
"optimize_size || !TARGET_SUB_ESP_4"
[(clobber (match_dup 0))
(parallel [(set (mem:SI (pre_dec:SI (reg:SI 7))) (match_dup 0))
- (set (reg:SI 6) (reg:SI 6))])])
+ (clobber (mem:BLK (scratch)))])])
(define_peephole2
[(match_scratch:SI 0 "r")
(parallel [(set (reg:SI 7) (plus:SI (reg:SI 7) (const_int -8)))
- (set (reg:SI 6) (reg:SI 6))
- (clobber (reg:CC 17))])]
+ (clobber (reg:CC 17))
+ (clobber (mem:BLK (scratch)))])]
"optimize_size || !TARGET_SUB_ESP_8"
[(clobber (match_dup 0))
(set (mem:SI (pre_dec:SI (reg:SI 7))) (match_dup 0))
(parallel [(set (mem:SI (pre_dec:SI (reg:SI 7))) (match_dup 0))
- (set (reg:SI 6) (reg:SI 6))])])
+ (clobber (mem:BLK (scratch)))])])
;; Convert esp substractions to push.
(define_peephole2
@@ -12312,12 +12467,12 @@
(define_peephole2
[(match_scratch:SI 0 "r")
(parallel [(set (reg:SI 7) (plus:SI (reg:SI 7) (const_int 4)))
- (set (reg:SI 6) (reg:SI 6))
- (clobber (reg:CC 17))])]
+ (clobber (reg:CC 17))
+ (clobber (mem:BLK (scratch)))])]
"optimize_size || !TARGET_ADD_ESP_4"
[(parallel [(set (match_dup 0) (mem:SI (reg:SI 7)))
(set (reg:SI 7) (plus:SI (reg:SI 7) (const_int 4)))
- (set (reg:SI 6) (reg:SI 6))])]
+ (clobber (mem:BLK (scratch)))])]
"")
;; Two pops case is tricky, since pop causes dependency on destination register.
@@ -12326,12 +12481,12 @@
[(match_scratch:SI 0 "r")
(match_scratch:SI 1 "r")
(parallel [(set (reg:SI 7) (plus:SI (reg:SI 7) (const_int 8)))
- (set (reg:SI 6) (reg:SI 6))
- (clobber (reg:CC 17))])]
+ (clobber (reg:CC 17))
+ (clobber (mem:BLK (scratch)))])]
"optimize_size || !TARGET_ADD_ESP_8"
[(parallel [(set (match_dup 0) (mem:SI (reg:SI 7)))
(set (reg:SI 7) (plus:SI (reg:SI 7) (const_int 4)))
- (set (reg:SI 6) (reg:SI 6))])
+ (clobber (mem:BLK (scratch)))])
(parallel [(set (match_dup 1) (mem:SI (reg:SI 7)))
(set (reg:SI 7) (plus:SI (reg:SI 7) (const_int 4)))])]
"")
@@ -12339,12 +12494,12 @@
(define_peephole2
[(match_scratch:SI 0 "r")
(parallel [(set (reg:SI 7) (plus:SI (reg:SI 7) (const_int 8)))
- (set (reg:SI 6) (reg:SI 6))
- (clobber (reg:CC 17))])]
+ (clobber (reg:CC 17))
+ (clobber (mem:BLK (scratch)))])]
"optimize_size"
[(parallel [(set (match_dup 0) (mem:SI (reg:SI 7)))
(set (reg:SI 7) (plus:SI (reg:SI 7) (const_int 4)))
- (set (reg:SI 6) (reg:SI 6))])
+ (clobber (mem:BLK (scratch)))])
(parallel [(set (match_dup 0) (mem:SI (reg:SI 7)))
(set (reg:SI 7) (plus:SI (reg:SI 7) (const_int 4)))])]
"")
@@ -12446,6 +12601,25 @@
(const_int 128)))
(clobber (match_dup 0))])]
"")
+
+;; Convert setcc + movzbl to xor + setcc if operands don't overlap.
+
+(define_peephole2
+ [(set (reg 17) (match_operand 0 "" ""))
+ (set (match_operand:QI 1 "register_operand" "")
+ (match_operator:QI 2 "ix86_comparison_operator"
+ [(reg 17) (const_int 0)]))
+ (set (match_operand 3 "q_regs_operand" "")
+ (zero_extend (match_dup 1)))]
+ "peep2_reg_dead_p (3, operands[1])
+ && ! reg_overlap_mentioned_p (operands[3], operands[0])"
+ [(parallel [(set (match_dup 3) (const_int 0))
+ (clobber (reg:CC 17))])
+ (set (match_dup 4) (match_dup 0))
+ (set (strict_low_part (match_dup 5))
+ (match_dup 2))]
+ "operands[4] = gen_rtx_REG (GET_MODE (operands[0]), 17);
+ operands[5] = gen_rtx_REG (QImode, REGNO (operands[3]));")
;; Call-value patterns last so that the wildcard operand does not
;; disrupt insn-recog's switch tables.
@@ -13892,8 +14066,9 @@
;; See logical MMX insns.
(define_insn "mmx_lshrdi3"
[(set (match_operand:DI 0 "register_operand" "=y")
- (lshiftrt:DI (match_operand:DI 1 "register_operand" "0")
- (match_operand:DI 2 "nonmemory_operand" "yi")))]
+ (unspec:DI
+ [(lshiftrt:DI (match_operand:DI 1 "register_operand" "0")
+ (match_operand:DI 2 "nonmemory_operand" "yi"))] 45))]
"TARGET_MMX"
"psrlq\\t{%2, %0|%0, %2}"
[(set_attr "type" "mmx")])
@@ -13917,8 +14092,9 @@
;; See logical MMX insns.
(define_insn "mmx_ashldi3"
[(set (match_operand:DI 0 "register_operand" "=y")
- (ashift:DI (match_operand:DI 1 "register_operand" "0")
- (match_operand:DI 2 "nonmemory_operand" "yi")))]
+ (unspec:DI
+ [(ashift:DI (match_operand:DI 1 "register_operand" "0")
+ (match_operand:DI 2 "nonmemory_operand" "yi"))] 45))]
"TARGET_MMX"
"psllq\\t{%2, %0|%0, %2}"
[(set_attr "type" "mmx")])
diff --git a/gcc/config/i386/i386afe.h b/gcc/config/i386/i386afe.h
deleted file mode 100644
index b40be840af6..00000000000
--- a/gcc/config/i386/i386afe.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/* Copyright (C) 2001 Free Software Foundation, Inc.
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* Irritatingly, config/elfos.h defines its own version of ASM_FILE_END,
- conflicting with a definition which we wish to have in i386/i386.h.
- We _really_ need to clean up the hodge-podge of random macro placement
- in the configury... */
-
-/* This macro is invoked at the end of compilation. It is used here to
- output code for -fpic that will load the return address into %ebx. */
-
-#undef ASM_FILE_END
-#define ASM_FILE_END(FILE) \
- do \
- { \
- ix86_asm_file_end (FILE); \
- if (!flag_no_ident) \
- fprintf ((FILE), "%s\"GCC: (GNU) %s\"\n", \
- IDENT_ASM_OP, version_string); \
- } \
- while (0)
diff --git a/gcc/config/i386/i386elf.h b/gcc/config/i386/i386elf.h
index d333551f2b8..64c1bae9f3f 100644
--- a/gcc/config/i386/i386elf.h
+++ b/gcc/config/i386/i386elf.h
@@ -56,9 +56,9 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
do { long value; \
REAL_VALUE_TO_TARGET_SINGLE ((VALUE), value); \
if (sizeof (int) == sizeof (long)) \
- fprintf((FILE), "%s\t0x%x\n", ASM_LONG, value); \
+ fprintf((FILE), "%s0x%x\n", ASM_LONG, value); \
else \
- fprintf((FILE), "%s\t0x%lx\n", ASM_LONG, value); \
+ fprintf((FILE), "%s0x%lx\n", ASM_LONG, value); \
} while (0)
/* This is how to output assembly code to define a `double' constant.
@@ -72,13 +72,13 @@ do { long value[2]; \
REAL_VALUE_TO_TARGET_DOUBLE ((VALUE), value); \
if (sizeof (int) == sizeof (long)) \
{ \
- fprintf((FILE), "%s\t0x%x\n", ASM_LONG, value[0]); \
- fprintf((FILE), "%s\t0x%x\n", ASM_LONG, value[1]); \
+ fprintf((FILE), "%s0x%x\n", ASM_LONG, value[0]); \
+ fprintf((FILE), "%s0x%x\n", ASM_LONG, value[1]); \
} \
else \
{ \
- fprintf((FILE), "%s\t0x%lx\n", ASM_LONG, value[0]); \
- fprintf((FILE), "%s\t0x%lx\n", ASM_LONG, value[1]); \
+ fprintf((FILE), "%s0x%lx\n", ASM_LONG, value[0]); \
+ fprintf((FILE), "%s0x%lx\n", ASM_LONG, value[1]); \
} \
} while (0)
@@ -89,28 +89,18 @@ do { long value[3]; \
REAL_VALUE_TO_TARGET_LONG_DOUBLE ((VALUE), value); \
if (sizeof (int) == sizeof (long)) \
{ \
- fprintf((FILE), "%s\t0x%x\n", ASM_LONG, value[0]); \
- fprintf((FILE), "%s\t0x%x\n", ASM_LONG, value[1]); \
- fprintf((FILE), "%s\t0x%x\n", ASM_LONG, value[2]); \
+ fprintf((FILE), "%s0x%x\n", ASM_LONG, value[0]); \
+ fprintf((FILE), "%s0x%x\n", ASM_LONG, value[1]); \
+ fprintf((FILE), "%s0x%x\n", ASM_LONG, value[2]); \
} \
else \
{ \
- fprintf((FILE), "%s\t0x%lx\n", ASM_LONG, value[0]); \
- fprintf((FILE), "%s\t0x%lx\n", ASM_LONG, value[1]); \
- fprintf((FILE), "%s\t0x%lx\n", ASM_LONG, value[2]); \
+ fprintf((FILE), "%s0x%lx\n", ASM_LONG, value[0]); \
+ fprintf((FILE), "%s0x%lx\n", ASM_LONG, value[1]); \
+ fprintf((FILE), "%s0x%lx\n", ASM_LONG, value[2]); \
} \
} 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); \
- fprintf (FILE, "\t.version\t\"01.01\"\n"); \
- } while (0)
-
#undef DBX_REGISTER_NUMBER
#define DBX_REGISTER_NUMBER(n) svr4_dbx_register_map[n]
diff --git a/gcc/config/i386/linux.h b/gcc/config/i386/linux.h
index 0ad1c3ac0cb..aacf7eb718d 100644
--- a/gcc/config/i386/linux.h
+++ b/gcc/config/i386/linux.h
@@ -30,7 +30,6 @@ Boston, MA 02111-1307, USA. */
output_file_directive (FILE, main_input_filename); \
if (target_flags & MASK_INTEL_SYNTAX) \
fputs ("\t.intel_syntax\n", FILE); \
- fprintf (FILE, "\t.version\t\"01.01\"\n"); \
} while (0)
#undef TARGET_VERSION
@@ -73,6 +72,15 @@ Boston, MA 02111-1307, USA. */
fprintf (FILE, "\tcall\tmcount\n"); \
}
+/* True if it is possible to profile code that does not have a frame
+ pointer.
+
+ The GLIBC version of mcount for the x86 assumes that there is a
+ frame, so we cannot allow profiling without a frame pointer. */
+
+#undef TARGET_ALLOWS_PROFILING_WITHOUT_FRAME_POINTER
+#define TARGET_ALLOWS_PROFILING_WITHOUT_FRAME_POINTER false
+
#undef SIZE_TYPE
#define SIZE_TYPE "unsigned int"
@@ -169,3 +177,116 @@ Boston, MA 02111-1307, USA. */
} \
} while (0)
#endif
+
+#if defined(__PIC__) && defined (USE_GNULIBC_1)
+/* This is a kludge. The i386 GNU/Linux dynamic linker needs ___brk_addr,
+ __environ and atexit (). We have to make sure they are in the .dynsym
+ section. We accomplish it by making a dummy call here. This
+ code is never reached. */
+
+#define CRT_END_INIT_DUMMY \
+ do \
+ { \
+ extern void *___brk_addr; \
+ extern char **__environ; \
+ \
+ ___brk_addr = __environ; \
+ atexit (0); \
+ } \
+ while (0)
+#endif
+
+/* Handle special EH pointer encodings. Absolute, pc-relative, and
+ indirect are handled automatically. */
+#define ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX(FILE, ENCODING, SIZE, ADDR, DONE) \
+ do { \
+ if ((SIZE) == 4 && ((ENCODING) & 0x70) == DW_EH_PE_datarel) \
+ { \
+ fputs (UNALIGNED_INT_ASM_OP, FILE); \
+ assemble_name (FILE, XSTR (ADDR, 0)); \
+ fputs (((ENCODING) & DW_EH_PE_indirect ? "@GOT" : "@GOTOFF"), FILE); \
+ goto DONE; \
+ } \
+ } while (0)
+
+/* Used by crtstuff.c to initialize the base of data-relative relocations.
+ These are GOT relative on x86, so return the pic register. */
+#ifdef __PIC__
+#define CRT_GET_RFIB_DATA(BASE) \
+ { \
+ register void *ebx_ __asm__("ebx"); \
+ BASE = ebx_; \
+ }
+#else
+#define CRT_GET_RFIB_DATA(BASE) \
+ __asm__ ("call\t.LPR%=\n" \
+ ".LPR%=:\n\t" \
+ "popl\t%0\n\t" \
+ /* Due to a GAS bug, this cannot use EAX. That encodes \
+ smaller than the traditional EBX, which results in the \
+ offset being off by one. */ \
+ "addl\t$_GLOBAL_OFFSET_TABLE_+[.-.LPR%=],%0" \
+ : "=d"(BASE))
+#endif
+
+/* Do code reading to identify a signal frame, and set the frame
+ state data appropriately. See unwind-dw2.c for the structs. */
+
+#ifdef IN_LIBGCC2
+#include <signal.h>
+#include <sys/ucontext.h>
+#endif
+
+#define MD_FALLBACK_FRAME_STATE_FOR(CONTEXT, FS, SUCCESS) \
+ do { \
+ unsigned char *pc_ = (CONTEXT)->ra; \
+ struct sigcontext *sc_; \
+ long new_cfa_; \
+ \
+ /* popl %eax ; movl $__NR_sigreturn,%eax ; int $0x80 */ \
+ if (*(unsigned short *)(pc_+0) == 0xb858 \
+ && *(unsigned int *)(pc_+2) == 119 \
+ && *(unsigned short *)(pc_+6) == 0x80cd) \
+ sc_ = (CONTEXT)->cfa + 4; \
+ /* movl $__NR_rt_sigreturn,%eax ; int $0x80 */ \
+ else if (*(unsigned char *)(pc_+0) == 0xb8 \
+ && *(unsigned int *)(pc_+1) == 173 \
+ && *(unsigned short *)(pc_+5) == 0x80cd) \
+ { \
+ struct rt_sigframe { \
+ int sig; \
+ struct siginfo *pinfo; \
+ void *puc; \
+ struct siginfo info; \
+ struct ucontext uc; \
+ } *rt_ = (CONTEXT)->cfa; \
+ sc_ = (struct sigcontext *) &rt_->uc.uc_mcontext; \
+ } \
+ else \
+ break; \
+ \
+ new_cfa_ = sc_->esp; \
+ (FS)->cfa_how = CFA_REG_OFFSET; \
+ (FS)->cfa_reg = 4; \
+ (FS)->cfa_offset = new_cfa_ - (long) (CONTEXT)->cfa; \
+ \
+ /* The SVR4 register numbering macros aren't usable in libgcc. */ \
+ (FS)->regs.reg[0].how = REG_SAVED_OFFSET; \
+ (FS)->regs.reg[0].loc.offset = (long)&sc_->eax - new_cfa_; \
+ (FS)->regs.reg[3].how = REG_SAVED_OFFSET; \
+ (FS)->regs.reg[3].loc.offset = (long)&sc_->ebx - new_cfa_; \
+ (FS)->regs.reg[1].how = REG_SAVED_OFFSET; \
+ (FS)->regs.reg[1].loc.offset = (long)&sc_->ecx - new_cfa_; \
+ (FS)->regs.reg[2].how = REG_SAVED_OFFSET; \
+ (FS)->regs.reg[2].loc.offset = (long)&sc_->edx - new_cfa_; \
+ (FS)->regs.reg[6].how = REG_SAVED_OFFSET; \
+ (FS)->regs.reg[6].loc.offset = (long)&sc_->esi - new_cfa_; \
+ (FS)->regs.reg[7].how = REG_SAVED_OFFSET; \
+ (FS)->regs.reg[7].loc.offset = (long)&sc_->edi - new_cfa_; \
+ (FS)->regs.reg[5].how = REG_SAVED_OFFSET; \
+ (FS)->regs.reg[5].loc.offset = (long)&sc_->ebp - new_cfa_; \
+ (FS)->regs.reg[8].how = REG_SAVED_OFFSET; \
+ (FS)->regs.reg[8].loc.offset = (long)&sc_->eip - new_cfa_; \
+ (FS)->retaddr_column = 8; \
+ goto SUCCESS; \
+ } while (0)
diff --git a/gcc/config/i386/mingw32.h b/gcc/config/i386/mingw32.h
index 56d8fbd44df..f1bb525c2da 100644
--- a/gcc/config/i386/mingw32.h
+++ b/gcc/config/i386/mingw32.h
@@ -24,21 +24,27 @@ Boston, MA 02111-1307, USA. */
/* Most of this is the same as for cygwin, except for changing some
specs. */
+/* Mingw GCC, unlike Cygwin's, must be relocatable. This macro must
+ be defined before any other files are included. */
+#ifndef WIN32_NO_ABSOLUTE_INST_DIRS
+#define WIN32_NO_ABSOLUTE_INST_DIRS 1
+#endif
+
#include "i386/cygwin.h"
/* Please keep changes to CPP_PREDEFINES in sync with i386/crtdll. The
only difference between the two should be __MSVCRT__ needed to
distinguish MSVC from CRTDLL runtime in mingw headers. */
#undef CPP_PREDEFINES
-#define CPP_PREDEFINES "-D_WIN32 -DWIN32 \
- -D__MINGW32__=0.2 -D__MSVCRT__ -DWINNT -D_X86_=1 \
+#define CPP_PREDEFINES "-D_WIN32 -D__WIN32 -D__WIN32__ -DWIN32 \
+ -D__MINGW32__ -D__MSVCRT__ -DWINNT -D_X86_=1 \
-Asystem=winnt"
/* Specific a different directory for the standard include files. */
#undef STANDARD_INCLUDE_DIR
-#define STANDARD_INCLUDE_DIR "/usr/local/i386-mingw32/include"
-
-#define STANDARD_INCLUDE_COMPONENT "MINGW32"
+#define STANDARD_INCLUDE_DIR "/usr/local/mingw32/include"
+#undef STANDARD_INCLUDE_COMPONENT
+#define STANDARD_INCLUDE_COMPONENT "MINGW"
#undef CPP_SPEC
#define CPP_SPEC \
@@ -75,10 +81,12 @@ Boston, MA 02111-1307, USA. */
%{!shared:%{!mdll:crt2%O%s}} %{pg:gcrt2%O%s}"
/* MS runtime does not need a separate math library. */
+#undef MATH_LIBRARY
#define MATH_LIBRARY ""
-/* Output STRING, a string representing a filename, to FILE. We canonicalize
- it to be in MS-DOS format. */
+/* Output STRING, a string representing a filename, to FILE.
+ We canonicalize it to be in MS-DOS format. */
+#undef OUTPUT_QUOTED_STRING
#define OUTPUT_QUOTED_STRING(FILE, STRING) \
do { \
char c; \
diff --git a/gcc/config/i386/netbsd-elf.h b/gcc/config/i386/netbsd-elf.h
new file mode 100644
index 00000000000..48d8129163f
--- /dev/null
+++ b/gcc/config/i386/netbsd-elf.h
@@ -0,0 +1,192 @@
+/* Definitions of target machine for GNU compiler,
+ for i386/ELF NetBSD systems.
+ Copyright (C) 2001 Free Software Foundation, Inc.
+ Contributed by matthew green <mrg@eterna.com.au>
+
+This file is part of GNU CC.
+
+GNU CC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU CC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU CC; see the file COPYING. If not, write to
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA. */
+
+/* Provide a LIB_SPEC appropriate for NetBSD. Just select the appropriate
+ libc, depending on whether we're doing profiling; if `-posix' is specified,
+ link against the appropriate libposix first. */
+
+#undef LIB_SPEC
+#define LIB_SPEC \
+ "%{posix:%{!p:%{!pg:-lposix}}%{p:-lposix_p}%{pg:-lposix_p}} \
+ %{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p}"
+
+/* Provide a STARTFILE_SPEC appropriate for NetBSD ELF targets. Here we
+ provide support for the special GCC option -static. On ELF targets,
+ we also add the crtbegin.o file which provides part of the support
+ for getting C++ file-scope static objects constructed before entering
+ `main'. We use the NetBSD crt0. */
+
+#undef STARTFILE_SPEC
+#define STARTFILE_SPEC \
+ "%{!shared: \
+ %{pg:gcrt0%O%s} \
+ %{!pg: \
+ %{p:gcrt0%O%s} \
+ %{!p:crt0%O%s}}} \
+ %{!shared:crtbegin%O%s} %{shared:crtbeginS%O%s}"
+
+/* Provide an ENDFILE_SPEC approrpiate for NetBSD ELF targets. Here we
+ add crtend.o, which provides part of the support for getting C++
+ file-scope static objects deconstructed after exiting `main'. */
+
+#undef ENDFILE_SPEC
+#define ENDFILE_SPEC \
+ "%{!shared:crtend%O%s} %{shared:crtendS%O%s}"
+
+/* Provide a LINK_SPEC appropriate for a NetBSD/i386 ELF target. Only
+ the linker emulation is i386-specific. The rest are
+ common to all ELF targets, except for the name of the start function. */
+
+#undef LINK_SPEC
+#define LINK_SPEC \
+ "-m elf_i386 \
+ %{assert*} %{R*} \
+ %{shared:-shared} \
+ %{!shared: \
+ -dp \
+ %{!nostdlib:%{!r*:%{!e*:-e __start}}} \
+ %{!static: \
+ -dy %{rdynamic:-export-dynamic} \
+ %{!dynamic-linker:-dynamic-linker /usr/libexec/ld.elf_so}} \
+ %{static:-static}}"
+
+/* Provide a CPP_SPEC appropriate for NetBSD. Current we just deal with
+ the GCC option `-posix'. */
+
+#undef CPP_SPEC
+#define CPP_SPEC "%{posix:-D_POSIX_SOURCE}"
+
+/* Provide an ASM_SPEC appropriate for NetBSD. Currently we only deal
+ with the options for generating PIC code. */
+
+#undef ASM_SPEC
+#define ASM_SPEC " %| %{fpic:-k} %{fPIC:-k -K}"
+
+/* Provide a LIB_SPEC appropriate for NetBSD. Just select the appropriate
+ libc, depending on whether we're doing profiling. */
+
+#undef LIB_SPEC
+#define LIB_SPEC "%{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p}"
+
+/* This defines which switch letters take arguments. */
+#undef SWITCH_TAKES_ARG
+#define SWITCH_TAKES_ARG(CHAR) \
+ (DEFAULT_SWITCH_TAKES_ARG(CHAR) \
+ || (CHAR) == 'R')
+
+/* Implicit library calls should use memcpy, not bcopy, etc. */
+
+#define TARGET_MEM_FUNCTIONS
+
+/* Names to predefine in the preprocessor for this target machine. */
+
+#define CPP_PREDEFINES "\
+-Di386 -D__NetBSD__ -D__ELF__ -Asystem(unix) -Asystem(NetBSD)"
+
+/* Make gcc agree with <machine/ansi.h> */
+
+#undef SIZE_TYPE
+#define SIZE_TYPE "unsigned int"
+
+#undef PTRDIFF_TYPE
+#define PTRDIFF_TYPE "int"
+
+#undef WCHAR_TYPE
+#define WCHAR_TYPE "int"
+
+#undef WCHAR_UNSIGNED
+#define WCHAR_UNSIGNED 0
+
+#undef WCHAR_TYPE_SIZE
+#define WCHAR_TYPE_SIZE 32
+
+#undef WINT_TYPE
+#define WINT_TYPE "int"
+
+/* Output assembler code to FILE to increment profiler label # LABELNO
+ for profiling a function entry. Under NetBSD/i386, the assembler does
+ nothing special with -pg. */
+
+#undef ASM_APP_ON
+#define ASM_APP_ON "#APP\n"
+
+#undef ASM_APP_OFF
+#define ASM_APP_OFF "#NO_APP\n"
+
+#undef ASM_FINAL_SPEC
+#define ASM_FINAL_SPEC "%{pipe:-}"
+
+#undef DBX_REGISTER_NUMBER
+#define DBX_REGISTER_NUMBER(n) svr4_dbx_register_map[n]
+
+#undef NO_PROFILE_COUNTERS
+#define NO_PROFILE_COUNTERS
+
+#undef HAS_INIT_SECTION
+
+#undef DEFAULT_VTABLE_THUNKS
+#define DEFAULT_VTABLE_THUNKS 1
+
+/* This is how we tell the assembler that two symbols have the same value. */
+
+#define ASM_OUTPUT_DEF(FILE,NAME1,NAME2) \
+ do { assemble_name(FILE, NAME1); \
+ fputs(" = ", FILE); \
+ assemble_name(FILE, NAME2); \
+ fputc('\n', FILE); } while (0)
+
+/* A C statement to output to the stdio stream FILE an assembler
+ command to advance the location counter to a multiple of 1<<LOG
+ bytes if it is within MAX_SKIP bytes.
+
+ This is used to align code labels according to Intel recommendations. */
+
+#ifdef HAVE_GAS_MAX_SKIP_P2ALIGN
+#define ASM_OUTPUT_MAX_SKIP_ALIGN(FILE, LOG, MAX_SKIP) \
+ if ((LOG) != 0) { \
+ if ((MAX_SKIP) == 0) fprintf ((FILE), "\t.p2align %d\n", (LOG)); \
+ else fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP)); \
+ }
+#endif
+
+/* This is how to output an element of a case-vector that is relative.
+ This is only used for PIC code. */
+#undef ASM_OUTPUT_ADDR_DIFF_ELT
+#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \
+ fprintf ((FILE), "\t.long _GLOBAL_OFFSET_TABLE_+[.-%s%d]\n", LPREFIX, VALUE)
+
+/* Indicate that jump tables go in the text section. This is
+ necessary when compiling PIC code. */
+#define JUMP_TABLES_IN_TEXT_SECTION (flag_pic)
+
+/*
+ * We always use gas here, so we don't worry about ECOFF assembler problems.
+ */
+#undef TARGET_GAS
+#define TARGET_GAS 1
+
+/* Default to pcc-struct-return, because this is the ELF abi and
+ we don't care about compatibility with older gcc versions. */
+#define DEFAULT_PCC_STRUCT_RETURN 1
+
+#undef TARGET_VERSION
+#define TARGET_VERSION fprintf (stderr, " (NetBSD/i386 ELF target)");
diff --git a/gcc/config/i386/netbsd.h b/gcc/config/i386/netbsd.h
index 51f65611956..25c9549e204 100644
--- a/gcc/config/i386/netbsd.h
+++ b/gcc/config/i386/netbsd.h
@@ -85,8 +85,3 @@
/* Until they use ELF or something that handles dwarf2 unwinds
and initialization stuff better. */
#define DWARF2_UNWIND_INFO 0
-
-/* This is the pseudo-op used to generate a 32-bit word of data with a
- specific value in some section. */
-
-#define INT_ASM_OP "\t.long\t"
diff --git a/gcc/config/i386/openbsd.h b/gcc/config/i386/openbsd.h
index c8d0a65e29d..9359fb99822 100644
--- a/gcc/config/i386/openbsd.h
+++ b/gcc/config/i386/openbsd.h
@@ -114,6 +114,8 @@ Boston, MA 02111-1307, USA. */
configuration files... */
#define DWARF2_UNWIND_INFO 0
+#undef ASM_PREFERRED_EH_DATA_FORMAT
+
/* Assembler format: alignment output. */
/* A C statement to output to the stdio stream FILE an assembler
@@ -134,7 +136,6 @@ Boston, MA 02111-1307, USA. */
/* Note that we pick up ASM_OUTPUT_MI_THUNK from unix.h. */
-/* This is the pseudo-op used to generate a 32-bit word of data with a
- specific value in some section. */
+#undef ASM_COMMENT_START
+#define ASM_COMMENT_START ";#"
-#define INT_ASM_OP "\t.long\t"
diff --git a/gcc/config/i386/osf1elf.h b/gcc/config/i386/osf1elf.h
index 8282953dc0a..5aee6fa1926 100644
--- a/gcc/config/i386/osf1elf.h
+++ b/gcc/config/i386/osf1elf.h
@@ -85,21 +85,6 @@
#undef LIBGCC_SPEC
#define LIBGCC_SPEC "%{!shared:%{!symbolic:libgcc.a%s}}"
-/* A C statement to output assembler commands which will identify the object
- file as having been compile with GNU CC. We don't need or want this for
- OSF1. */
-#undef ASM_IDENTIFY_GCC
-#define ASM_IDENTIFY_GCC(FILE)
-
-/* Identify the front-end which produced this file. To keep symbol
- space down, and not confuse kdb, only do this if the language is
- not C. */
-#define ASM_IDENTIFY_LANGUAGE(STREAM) \
-{ \
- if (strcmp (lang_identify (), "c") != 0) \
- output_lang_identify (STREAM); \
-}
-
/* Specify size_t, ptrdiff_t, and wchar_t types. */
#undef SIZE_TYPE
#undef PTRDIFF_TYPE
diff --git a/gcc/config/i386/osfrose.h b/gcc/config/i386/osfrose.h
index 1f86883599b..138ef67688b 100644
--- a/gcc/config/i386/osfrose.h
+++ b/gcc/config/i386/osfrose.h
@@ -740,11 +740,6 @@ do \
} \
while (0)
-/* Attach a special .ident directive to the end of the file to identify
- the version of GCC which compiled this code. The format of the
- .ident string is patterned after the ones produced by native svr4
- C compilers. */
-
#define IDENT_ASM_OP "\t.ident\t"
/* Allow #sccs in preprocessor. */
@@ -759,98 +754,6 @@ do \
if (HALF_PIC_P ()) \
HALF_PIC_FINISH (STREAM); \
ix86_asm_file_end (STREAM); \
- if (!flag_no_ident) \
- { \
- char *fstart = main_input_filename; \
- char *fname; \
- \
- if (!fstart) \
- fstart = "<no file>"; \
- \
- fname = fstart + strlen (fstart) - 1; \
- while (fname > fstart && *fname != '/') \
- fname--; \
- \
- if (*fname == '/') \
- fname++; \
- \
- fprintf ((STREAM), "%s\"GCC: (GNU) %s %s -O%d", \
- IDENT_ASM_OP, version_string, fname, optimize); \
- \
- if (write_symbols == PREFERRED_DEBUGGING_TYPE) \
- fprintf ((STREAM), " -g%d", (int)debug_info_level); \
- \
- else if (write_symbols == DBX_DEBUG) \
- fprintf ((STREAM), " -gstabs%d", (int)debug_info_level); \
- \
- else if (write_symbols == DWARF_DEBUG) \
- fprintf ((STREAM), " -gdwarf%d", (int)debug_info_level); \
- \
- else if (write_symbols != NO_DEBUG) \
- fprintf ((STREAM), " -g??%d", (int)debug_info_level); \
- \
- if (flag_omit_frame_pointer) \
- fprintf ((STREAM), " -fomit-frame-pointer"); \
- \
- if (flag_strength_reduce) \
- fprintf ((STREAM), " -fstrength-reduce"); \
- \
- if (flag_unroll_loops) \
- fprintf ((STREAM), " -funroll-loops"); \
- \
- if (flag_schedule_insns) \
- fprintf ((STREAM), " -fschedule-insns"); \
- \
- if (flag_schedule_insns_after_reload) \
- fprintf ((STREAM), " -fschedule-insns2"); \
- \
- if (flag_force_mem) \
- fprintf ((STREAM), " -fforce-mem"); \
- \
- if (flag_force_addr) \
- fprintf ((STREAM), " -fforce-addr"); \
- \
- if (flag_inline_functions) \
- fprintf ((STREAM), " -finline-functions"); \
- \
- if (flag_caller_saves) \
- fprintf ((STREAM), " -fcaller-saves"); \
- \
- if (flag_pic) \
- fprintf ((STREAM), (flag_pic > 1) ? " -fPIC" : " -fpic"); \
- \
- if (flag_inhibit_size_directive) \
- fprintf ((STREAM), " -finhibit-size-directive"); \
- \
- if (flag_gnu_linker) \
- fprintf ((STREAM), " -fgnu-linker"); \
- \
- if (profile_flag) \
- fprintf ((STREAM), " -p"); \
- \
- if (profile_block_flag) \
- fprintf ((STREAM), " -a"); \
- \
- if (TARGET_IEEE_FP) \
- fprintf ((STREAM), " -mieee-fp"); \
- \
- if (TARGET_HALF_PIC) \
- fprintf ((STREAM), " -mhalf-pic"); \
- \
- if (!TARGET_MOVE) \
- fprintf ((STREAM), " -mno-move"); \
- \
- if (TARGET_386) \
- fprintf ((STREAM), " -m386"); \
- \
- else if (TARGET_486) \
- fprintf ((STREAM), " -m486"); \
- \
- else \
- fprintf ((STREAM), " -munknown-machine"); \
- \
- fprintf ((STREAM), (TARGET_ELF) ? " -melf\"\n" : " -mrose\"\n"); \
- } \
} \
while (0)
@@ -866,21 +769,6 @@ while (0)
to do the search */
#define LINK_LIBGCC_SPECIAL
-/* A C statement to output assembler commands which will identify the object
- file as having been compile with GNU CC. We don't need or want this for
- OSF1. GDB doesn't need it and kdb doesn't like it */
-#define ASM_IDENTIFY_GCC(FILE)
-
-/* Identify the front-end which produced this file. To keep symbol
- space down, and not confuse kdb, only do this if the language is
- not C. */
-
-#define ASM_IDENTIFY_LANGUAGE(STREAM) \
-{ \
- if (strcmp (lang_identify (), "c") != 0) \
- output_lang_identify (STREAM); \
-}
-
/* Generate calls to memcpy, etc., not bcopy, etc. */
#define TARGET_MEM_FUNCTIONS
diff --git a/gcc/config/i386/ptx4-i.h b/gcc/config/i386/ptx4-i.h
index 0d4b33edf61..735408ebf8f 100644
--- a/gcc/config/i386/ptx4-i.h
+++ b/gcc/config/i386/ptx4-i.h
@@ -53,9 +53,9 @@ Boston, MA 02111-1307, USA. */
do { long value; \
REAL_VALUE_TO_TARGET_SINGLE ((VALUE), value); \
if (sizeof (int) == sizeof (long)) \
- fprintf((FILE), "%s\t0x%x\n", ASM_LONG, value); \
+ fprintf((FILE), "%s0x%x\n", ASM_LONG, value); \
else \
- fprintf((FILE), "%s\t0x%lx\n", ASM_LONG, value); \
+ fprintf((FILE), "%s0x%lx\n", ASM_LONG, value); \
} while (0)
/* This is how to output assembly code to define a `double' constant.
@@ -69,13 +69,13 @@ do { long value[2]; \
REAL_VALUE_TO_TARGET_DOUBLE ((VALUE), value); \
if (sizeof (int) == sizeof (long)) \
{ \
- fprintf((FILE), "%s\t0x%x\n", ASM_LONG, value[0]); \
- fprintf((FILE), "%s\t0x%x\n", ASM_LONG, value[1]); \
+ fprintf((FILE), "%s0x%x\n", ASM_LONG, value[0]); \
+ fprintf((FILE), "%s0x%x\n", ASM_LONG, value[1]); \
} \
else \
{ \
- fprintf((FILE), "%s\t0x%lx\n", ASM_LONG, value[0]); \
- fprintf((FILE), "%s\t0x%lx\n", ASM_LONG, value[1]); \
+ fprintf((FILE), "%s0x%lx\n", ASM_LONG, value[0]); \
+ fprintf((FILE), "%s0x%lx\n", ASM_LONG, value[1]); \
} \
} while (0)
@@ -86,28 +86,18 @@ do { long value[3]; \
REAL_VALUE_TO_TARGET_LONG_DOUBLE ((VALUE), value); \
if (sizeof (int) == sizeof (long)) \
{ \
- fprintf((FILE), "%s\t0x%x\n", ASM_LONG, value[0]); \
- fprintf((FILE), "%s\t0x%x\n", ASM_LONG, value[1]); \
- fprintf((FILE), "%s\t0x%x\n", ASM_LONG, value[2]); \
+ fprintf((FILE), "%s0x%x\n", ASM_LONG, value[0]); \
+ fprintf((FILE), "%s0x%x\n", ASM_LONG, value[1]); \
+ fprintf((FILE), "%s0x%x\n", ASM_LONG, value[2]); \
} \
else \
{ \
- fprintf((FILE), "%s\t0x%lx\n", ASM_LONG, value[0]); \
- fprintf((FILE), "%s\t0x%lx\n", ASM_LONG, value[1]); \
- fprintf((FILE), "%s\t0x%lx\n", ASM_LONG, value[2]); \
+ fprintf((FILE), "%s0x%lx\n", ASM_LONG, value[0]); \
+ fprintf((FILE), "%s0x%lx\n", ASM_LONG, value[1]); \
+ fprintf((FILE), "%s0x%lx\n", ASM_LONG, value[2]); \
} \
} 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); \
- fprintf (FILE, "\t.version\t\"01.01\"\n"); \
- } while (0)
-
#undef DBX_REGISTER_NUMBER
#define DBX_REGISTER_NUMBER(n) svr4_dbx_register_map[n]
diff --git a/gcc/config/i386/rtems.h b/gcc/config/i386/rtems.h
index 9101332bb03..0875f612216 100644
--- a/gcc/config/i386/rtems.h
+++ b/gcc/config/i386/rtems.h
@@ -1,5 +1,5 @@
/* Definitions for rtems targeting an Intel i386 using coff.
- Copyright (C) 1996, 1997, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1997, 2000, 2002 Free Software Foundation, Inc.
Contributed by Joel Sherrill (joel@OARcorp.com).
This file is part of GNU CC.
@@ -24,7 +24,7 @@ Boston, MA 02111-1307, USA. */
/* Specify predefined symbols in preprocessor. */
#undef CPP_PREDEFINES
-#define CPP_PREDEFINES "-Drtems -D__rtems__ -Asystem=rtems"
+#define CPP_PREDEFINES "-D__rtems__ -Asystem=rtems"
/* Generate calls to memcpy, memcmp and memset. */
#ifndef TARGET_MEM_FUNCTIONS
diff --git a/gcc/config/i386/rtemself.h b/gcc/config/i386/rtemself.h
index 7844007ebab..bcedb4536bd 100644
--- a/gcc/config/i386/rtemself.h
+++ b/gcc/config/i386/rtemself.h
@@ -1,8 +1,6 @@
-/* Definitions for Intel 386 running Linux-based GNU systems with ELF format.
- Copyright (C) 1994, 1995, 1996, 1997, 1998, 2000
- Free Software Foundation, Inc.
- Contributed by Eric Youngdale.
- Modified for stabs-in-ELF by H.J. Lu.
+/* Definitions for rtems targeting a ix86 using ELF.
+ Copyright (C) 1996, 1997, 2000, 2001, 2002 Free Software Foundation, Inc.
+ Contributed by Joel Sherrill (joel@OARcorp.com).
This file is part of GNU CC.
@@ -21,81 +19,14 @@ along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#define LINUX_DEFAULT_ELF
+/* Specify predefined symbols in preprocessor. */
-/* A lie, I guess, but the general idea behind linux/ELF is that we are
- supposed to be outputting something that will assemble under SVr4.
- This gets us pretty close. */
-#include <i386/i386.h> /* Base i386 target machine definitions */
-#include <i386/att.h> /* Use the i386 AT&T assembler syntax */
-#include <linux.h> /* some common stuff */
-
-#undef TARGET_VERSION
-#define TARGET_VERSION fprintf (stderr, " (i386 RTEMS with ELF)");
-
-/* The svr4 ABI for the i386 says that records and unions are returned
- in memory. */
-#undef DEFAULT_PCC_STRUCT_RETURN
-#define DEFAULT_PCC_STRUCT_RETURN 1
-
-/* This is how to output an element of a case-vector that is relative.
- This is only used for PIC code. See comments by the `casesi' insn in
- i386.md for an explanation of the expression this outputs. */
-#undef ASM_OUTPUT_ADDR_DIFF_ELT
-#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \
- fprintf (FILE, "\t.long _GLOBAL_OFFSET_TABLE_+[.-%s%d]\n", LPREFIX, VALUE)
-
-/* Indicate that jump tables go in the text section. This is
- necessary when compiling PIC code. */
-#define JUMP_TABLES_IN_TEXT_SECTION (flag_pic)
-
-#undef DBX_REGISTER_NUMBER
-#define DBX_REGISTER_NUMBER(n) svr4_dbx_register_map[n]
-
-/* Output assembler code to FILE to increment profiler label # LABELNO
- for profiling a function entry. */
-
-#undef FUNCTION_PROFILER
-#define FUNCTION_PROFILER(FILE, LABELNO) \
-{ \
- if (flag_pic) \
- { \
- fprintf (FILE, "\tleal %sP%d@GOTOFF(%%ebx),%%edx\n", \
- LPREFIX, (LABELNO)); \
- fprintf (FILE, "\tcall *mcount@GOT(%%ebx)\n"); \
- } \
- else \
- { \
- fprintf (FILE, "\tmovl $%sP%d,%%edx\n", LPREFIX, (LABELNO)); \
- fprintf (FILE, "\tcall mcount\n"); \
- } \
-}
-
-#undef SIZE_TYPE
-#define SIZE_TYPE "unsigned int"
-
-#undef PTRDIFF_TYPE
-#define PTRDIFF_TYPE "int"
-
-#undef WCHAR_TYPE
-#define WCHAR_TYPE "long int"
-
-#undef WCHAR_TYPE_SIZE
-#define WCHAR_TYPE_SIZE BITS_PER_WORD
-
#undef CPP_PREDEFINES
-#define CPP_PREDEFINES "-Drtems -D__rtems__ -Asystem=rtems"
-
-/* Get perform_* macros to build libgcc.a. */
-#include "i386/perform.h"
+#define CPP_PREDEFINES "-D__rtems__ -Asystem=rtems \
+ -D__ELF__ -D__i386__ -D__USE_INIT_FINI__"
-/* 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. */
-
-#define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
- asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN)
+#undef CPP_SPEC
+#define CPP_SPEC "%(cpp_cpu) %{msoft-float:-D_SOFT_FLOAT}"
#undef STARTFILE_SPEC
#define STARTFILE_SPEC "crt0.o%s crti.o%s crtbegin.o%s"
@@ -103,7 +34,11 @@ Boston, MA 02111-1307, USA. */
#undef ENDFILE_SPEC
#define ENDFILE_SPEC "crtend.o%s crtn.o%s"
+/* Generate calls to memcpy, memcmp and memset. */
+#ifndef TARGET_MEM_FUNCTIONS
+#define TARGET_MEM_FUNCTIONS
+#endif
+
/* Get machine-independent configuration parameters for RTEMS. */
#include <rtems.h>
-/* end of i386/rtemself.h */
diff --git a/gcc/config/i386/sco5.h b/gcc/config/i386/sco5.h
index ae832b91f5f..49031cf0c5d 100644
--- a/gcc/config/i386/sco5.h
+++ b/gcc/config/i386/sco5.h
@@ -54,13 +54,10 @@ Boston, MA 02111-1307, USA. */
#define INT_ASM_OP "\t.long\t"
#undef ASM_SHORT
-#define ASM_SHORT "\t.value"
+#define ASM_SHORT "\t.value\t"
#undef ASM_LONG
-#define ASM_LONG "\t.long"
-
-#undef ASM_DOUBLE
-#define ASM_DOUBLE "\t.double"
+#define ASM_LONG "\t.long\t"
#undef TYPE_ASM_OP
#define TYPE_ASM_OP "\t.type\t"
@@ -210,15 +207,6 @@ do { \
fprintf ((FILE), "\t.version\t\"01.01\"\n"); \
} while (0)
-#undef ASM_FILE_END
-#define ASM_FILE_END(FILE) \
-do { \
- ix86_asm_file_end (FILE); \
- if (!flag_no_ident) \
- fprintf ((FILE), "%s\"GCC: (GNU) %s\"\n", \
- IDENT_ASM_OP, version_string); \
-} while (0)
-
#undef ASM_FINISH_DECLARE_OBJECT
#define ASM_FINISH_DECLARE_OBJECT(FILE, DECL, TOP_LEVEL, AT_END) \
do { \
@@ -250,9 +238,9 @@ do { \
#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \
do { \
if (TARGET_ELF) \
- fprintf (FILE, "%s _GLOBAL_OFFSET_TABLE_+[.-%s%d]\n", ASM_LONG, LPREFIX, VALUE); \
+ fprintf (FILE, "%s_GLOBAL_OFFSET_TABLE_+[.-%s%d]\n", ASM_LONG, LPREFIX, VALUE); \
else \
- fprintf (FILE, "\t.word %s%d-%s%d\n", LPREFIX,VALUE,LPREFIX,REL); \
+ fprintf (FILE, "%s%s%d-%s%d\n", ASM_LONG, LPREFIX,VALUE,LPREFIX,REL); \
} while (0)
#undef ASM_OUTPUT_ALIGNED_COMMON
@@ -428,7 +416,7 @@ do { \
fprintf (FILE, "\n"); \
} else { \
fini_section (); \
- fprintf (FILE, "%s\t ", ASM_LONG); \
+ fprintf (FILE, "%s", INT_ASM_OP); \
assemble_name (FILE, NAME); \
fprintf (FILE, "\n"); } \
} while (0)
@@ -548,11 +536,13 @@ do { \
#define DBX_REGISTER_NUMBER(n) \
((TARGET_ELF) ? svr4_dbx_register_map[n] : dbx_register_map[n])
+#undef DWARF2_DEBUGGING_INFO
#undef DWARF_DEBUGGING_INFO
#undef SDB_DEBUGGING_INFO
#undef DBX_DEBUGGING_INFO
#undef PREFERRED_DEBUGGING_TYPE
+#define DWARF2_DEBUGGING_INFO 1
#define DWARF_DEBUGGING_INFO 1
#define SDB_DEBUGGING_INFO 1
#define DBX_DEBUGGING_INFO 1
@@ -963,3 +953,44 @@ do { \
} while (0)
# endif /* ! _SCO_ELF */
#endif /* CRT_BEGIN !! CRT_END */
+
+/* Handle special EH pointer encodings. Absolute, pc-relative, and
+ indirect are handled automatically. */
+#define ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX(FILE, ENCODING, SIZE, ADDR, DONE) \
+ do { \
+ if ((SIZE) == 4 && ((ENCODING) & 0x70) == DW_EH_PE_datarel) \
+ { \
+ fputs (UNALIGNED_INT_ASM_OP, FILE); \
+ assemble_name (FILE, XSTR (ADDR, 0)); \
+ fputs (((ENCODING) & DW_EH_PE_indirect ? "@GOT" : "@GOTOFF"), FILE); \
+ goto DONE; \
+ } \
+ } while (0)
+
+/* Used by crtstuff.c to initialize the base of data-relative relocations.
+ These are GOT relative on x86, so return the pic register. */
+#ifdef __PIC__
+#define CRT_GET_RFIB_DATA(BASE) \
+ { \
+ register void *ebx_ __asm__("ebx"); \
+ BASE = ebx_; \
+ }
+#else
+#define CRT_GET_RFIB_DATA(BASE) \
+ __asm__ ("call\t.LPR%=\n" \
+ ".LPR%=:\n\t" \
+ "popl\t%0\n\t" \
+ /* Due to a GAS bug, this cannot use EAX. That encodes \
+ smaller than the traditional EBX, which results in the \
+ offset being off by one. */ \
+ "addl\t$_GLOBAL_OFFSET_TABLE_+[.-.LPR%=],%0" \
+ : "=d"(BASE))
+#endif
+
+/* Select a format to encode pointers in exception handling data. CODE
+ is 0 for data, 1 for code labels, 2 for function pointers. GLOBAL is
+ true if the symbol may be affected by dynamic relocations. */
+#undef ASM_PREFERRED_EH_DATA_FORMAT
+#define ASM_PREFERRED_EH_DATA_FORMAT(CODE,GLOBAL) \
+ (flag_pic ? (GLOBAL ? DW_EH_PE_indirect : 0) | DW_EH_PE_datarel \
+ : DW_EH_PE_absptr)
diff --git a/gcc/config/i386/sol2.h b/gcc/config/i386/sol2.h
index bd61ee99700..e9654e1881f 100644
--- a/gcc/config/i386/sol2.h
+++ b/gcc/config/i386/sol2.h
@@ -1,5 +1,5 @@
/* Target definitions for GNU compiler for Intel 80386 running Solaris 2
- Copyright (C) 1993, 1995, 1996, 1997, 1998, 1999
+ Copyright (C) 1993, 1995, 1996, 1997, 1998, 1999, 2000, 2001
Free Software Foundation, Inc.
Contributed by Fred Fish (fnf@cygnus.com).
@@ -61,16 +61,42 @@ Boston, MA 02111-1307, USA. */
#define FORCE_INIT_SECTION_ALIGN asm (ALIGN_ASM_OP ## "16")
#define FORCE_FINI_SECTION_ALIGN FORCE_INIT_SECTION_ALIGN
+/* Select a format to encode pointers in exception handling data. CODE
+ is 0 for data, 1 for code labels, 2 for function pointers. GLOBAL is
+ true if the symbol may be affected by dynamic relocations. */
+#undef ASM_PREFERRED_EH_DATA_FORMAT
+#define ASM_PREFERRED_EH_DATA_FORMAT(CODE,GLOBAL) \
+ (flag_pic ? (GLOBAL ? DW_EH_PE_indirect : 0) | DW_EH_PE_datarel \
+ : DW_EH_PE_absptr)
+
+/* Solaris 2/Intel uses a wint_t different from the default, as on SPARC. */
+#undef WINT_TYPE
+#define WINT_TYPE "long int"
+
+#undef WINT_TYPE_SIZE
+#define WINT_TYPE_SIZE BITS_PER_WORD
+
/* Add "sun" to the list of symbols defined for SVR4. */
#undef CPP_PREDEFINES
#define CPP_PREDEFINES \
"-Dunix -D__svr4__ -D__SVR4 -Dsun -Asystem=svr4"
+/* Solaris 2/Intel as chokes on #line directives. */
#undef CPP_SPEC
-#define CPP_SPEC "%(cpp_cpu) \
- %{pthreads:-D_REENTRANT -D_PTHREADS} \
- %{!pthreads:%{threads:-D_REENTRANT -D_SOLARIS_THREADS}} \
- %{compat-bsd:-iwithprefixbefore ucbinclude -I/usr/ucbinclude}"
+#define CPP_SPEC \
+ "%{.S:-P} \
+ %(cpp_cpu) \
+ %{pthreads:-D_REENTRANT -D_PTHREADS} \
+ %{!pthreads:%{threads:-D_REENTRANT -D_SOLARIS_THREADS}} \
+ %{compat-bsd:-iwithprefixbefore ucbinclude -I/usr/ucbinclude}"
+
+/* For C++ we need to add some additional macro definitions required
+ by the C++ standard library. */
+#define CPLUSPLUS_CPP_SPEC "\
+-D_XOPEN_SOURCE=500 -D_LARGEFILE_SOURCE=1 -D_LARGEFILE64_SOURCE=1 \
+-D__EXTENSIONS__ \
+%(cpp) \
+"
#undef LIB_SPEC
#define LIB_SPEC \
diff --git a/gcc/config/i386/sun386.h b/gcc/config/i386/sun386.h
index 67349e19ac1..b28f20fd01a 100644
--- a/gcc/config/i386/sun386.h
+++ b/gcc/config/i386/sun386.h
@@ -34,9 +34,8 @@ Boston, MA 02111-1307, USA. */
/* Assembler pseudos to introduce constants of various size. */
#define ASM_BYTE_OP "\t.byte\t"
-#define ASM_SHORT "\t.value"
-#define ASM_LONG "\t.long"
-#define ASM_DOUBLE "\t.double"
+#define ASM_SHORT "\t.value\t"
+#define ASM_LONG "\t.long\t"
/* How to output an ASCII string constant. */
diff --git a/gcc/config/i386/svr3gas.h b/gcc/config/i386/svr3gas.h
index e5bf3db5b4b..db4be5da68f 100644
--- a/gcc/config/i386/svr3gas.h
+++ b/gcc/config/i386/svr3gas.h
@@ -220,8 +220,8 @@ dtors_section () \
global destructors. */
#define ASM_OUTPUT_DESTRUCTOR(FILE,NAME) \
do { \
- fini_section (); \
- fprintf (FILE, "%s\t ", ASM_LONG); \
+ fini_section (); \
+ fputs (ASM_LONG, FILE); \
assemble_name (FILE, NAME); \
fprintf (FILE, "\n"); \
} while (0)
diff --git a/gcc/config/i386/sysv4.h b/gcc/config/i386/sysv4.h
index eb6c32c25b6..16f0037b7a4 100644
--- a/gcc/config/i386/sysv4.h
+++ b/gcc/config/i386/sysv4.h
@@ -51,9 +51,9 @@ Boston, MA 02111-1307, USA. */
do { long value; \
REAL_VALUE_TO_TARGET_SINGLE ((VALUE), value); \
if (sizeof (int) == sizeof (long)) \
- fprintf((FILE), "%s\t0x%x\n", ASM_LONG, value); \
+ fprintf((FILE), "%s0x%x\n", ASM_LONG, value); \
else \
- fprintf((FILE), "%s\t0x%lx\n", ASM_LONG, value); \
+ fprintf((FILE), "%s0x%lx\n", ASM_LONG, value); \
} while (0)
/* This is how to output assembly code to define a `double' constant.
@@ -67,13 +67,13 @@ do { long value[2]; \
REAL_VALUE_TO_TARGET_DOUBLE ((VALUE), value); \
if (sizeof (int) == sizeof (long)) \
{ \
- fprintf((FILE), "%s\t0x%x\n", ASM_LONG, value[0]); \
- fprintf((FILE), "%s\t0x%x\n", ASM_LONG, value[1]); \
+ fprintf((FILE), "%s0x%x\n", ASM_LONG, value[0]); \
+ fprintf((FILE), "%s0x%x\n", ASM_LONG, value[1]); \
} \
else \
{ \
- fprintf((FILE), "%s\t0x%lx\n", ASM_LONG, value[0]); \
- fprintf((FILE), "%s\t0x%lx\n", ASM_LONG, value[1]); \
+ fprintf((FILE), "%s0x%lx\n", ASM_LONG, value[0]); \
+ fprintf((FILE), "%s0x%lx\n", ASM_LONG, value[1]); \
} \
} while (0)
@@ -84,15 +84,15 @@ do { long value[3]; \
REAL_VALUE_TO_TARGET_LONG_DOUBLE ((VALUE), value); \
if (sizeof (int) == sizeof (long)) \
{ \
- fprintf((FILE), "%s\t0x%x\n", ASM_LONG, value[0]); \
- fprintf((FILE), "%s\t0x%x\n", ASM_LONG, value[1]); \
- fprintf((FILE), "%s\t0x%x\n", ASM_LONG, value[2]); \
+ fprintf((FILE), "%s0x%x\n", ASM_LONG, value[0]); \
+ fprintf((FILE), "%s0x%x\n", ASM_LONG, value[1]); \
+ fprintf((FILE), "%s0x%x\n", ASM_LONG, value[2]); \
} \
else \
{ \
- fprintf((FILE), "%s\t0x%lx\n", ASM_LONG, value[0]); \
- fprintf((FILE), "%s\t0x%lx\n", ASM_LONG, value[1]); \
- fprintf((FILE), "%s\t0x%lx\n", ASM_LONG, value[2]); \
+ fprintf((FILE), "%s0x%lx\n", ASM_LONG, value[0]); \
+ fprintf((FILE), "%s0x%lx\n", ASM_LONG, value[1]); \
+ fprintf((FILE), "%s0x%lx\n", ASM_LONG, value[2]); \
} \
} while (0)
@@ -179,3 +179,39 @@ do { long value[3]; \
#define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN)
+
+/* Handle special EH pointer encodings. Absolute, pc-relative, and
+ indirect are handled automatically. */
+#define ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX(FILE, ENCODING, SIZE, ADDR, DONE) \
+ do { \
+ if ((SIZE) == 4 && ((ENCODING) & 0x70) == DW_EH_PE_datarel) \
+ { \
+ fputs (UNALIGNED_INT_ASM_OP, FILE); \
+ assemble_name (FILE, XSTR (ADDR, 0)); \
+ fputs (((ENCODING) & DW_EH_PE_indirect ? "@GOT" : "@GOTOFF"), FILE); \
+ goto DONE; \
+ } \
+ } while (0)
+
+/* Used by crtstuff.c to initialize the base of data-relative relocations.
+ These are GOT relative on x86, so return the pic register. */
+#ifdef __PIC__
+#define CRT_GET_RFIB_DATA(BASE) \
+ { \
+ register void *ebx_ __asm__("ebx"); \
+ BASE = ebx_; \
+ }
+#else
+#define CRT_GET_RFIB_DATA(BASE) \
+ __asm__ ("call\t.LPR%=\n" \
+ ".LPR%=:\n\t" \
+ "popl\t%0\n\t" \
+ /* Due to a GAS bug, this cannot use EAX. That encodes \
+ smaller than the traditional EBX, which results in the \
+ offset being off by one. */ \
+ "addl\t$_GLOBAL_OFFSET_TABLE_+[.-.LPR%=],%0" \
+ : "=d"(BASE))
+#endif
+
+#undef CPP_SPEC
+#define CPP_SPEC "%(cpp_cpu)"
diff --git a/gcc/config/i386/t-beos b/gcc/config/i386/t-beos
index e8e8e50682f..f63e2d4e1b5 100644
--- a/gcc/config/i386/t-beos
+++ b/gcc/config/i386/t-beos
@@ -6,6 +6,3 @@ CROSS_LIBGCC1 =
# we are most likely to want to apply any fixes to.
SYSTEM_HEADER_DIR = /boot/develop/headers/posix
CROSS_SYSTEM_HEADER_DIR = $(tooldir)/sys-include/posix
-
-# Use the system assert.h
-INSTALL_ASSERT_H =
diff --git a/gcc/config/i386/t-cygwin b/gcc/config/i386/t-cygwin
index 1909f154308..fc009b85437 100644
--- a/gcc/config/i386/t-cygwin
+++ b/gcc/config/i386/t-cygwin
@@ -16,5 +16,5 @@ LIBGCC2_INCLUDES = -I$(srcdir)/../winsup/include \
-I$(srcdir)/../winsup/cygwin/include \
-I$(srcdir)/../winsup/w32api/include
-winnt.o: $(srcdir)/config/i386/winnt.c $(RTL_H) $(TREE_H)
+winnt.o: $(srcdir)/config/i386/winnt.c $(RTL_H) $(TREE_H) $(CONFIG_H)
$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/config/i386/winnt.c
diff --git a/gcc/config/i386/t-interix b/gcc/config/i386/t-interix
index 4c6d84f1b39..c5fe1720bae 100644
--- a/gcc/config/i386/t-interix
+++ b/gcc/config/i386/t-interix
@@ -11,6 +11,3 @@ interix.o: $(srcdir)/config/i386/interix.c
# System headers will track gcc's needs.
# Even LANG_EXTRA_HEADERS may be temporary.
USER_H=$(LANG_EXTRA_HEADERS)
-
-# We don't want this one either.
-INSTALL_ASSERT_H=
diff --git a/gcc/config/i386/t-openbsd b/gcc/config/i386/t-openbsd
new file mode 100644
index 00000000000..18304634000
--- /dev/null
+++ b/gcc/config/i386/t-openbsd
@@ -0,0 +1,6 @@
+# gdb gets confused if pic code is linked with non pic
+# We cope by building variants of libgcc.
+MULTILIB_OPTIONS = fpic
+MULTILIB_MATCHES=fpic=fPIC
+LIBGCC = stmp-multilib
+INSTALL_LIBGCC = install-multilib
diff --git a/gcc/config/i386/t-rtems-i386 b/gcc/config/i386/t-rtems-i386
index d112e2e7e2d..b57f4fd82df 100644
--- a/gcc/config/i386/t-rtems-i386
+++ b/gcc/config/i386/t-rtems-i386
@@ -5,9 +5,6 @@
# version of these files.
#
-LIBGCC1 =
-CROSS_LIBGCC1 =
-
crti.o: $(srcdir)/config/i386/sol2-ci.asm $(GCC_PASSES)
sed -e '/^!/d' <$(srcdir)/config/i386/sol2-ci.asm >crti.s
$(GCC_FOR_TARGET) -c -o crti.o crti.s
@@ -15,3 +12,43 @@ crtn.o: $(srcdir)/config/i386/sol2-cn.asm $(GCC_PASSES)
sed -e '/^!/d' <$(srcdir)/config/i386/sol2-cn.asm >crtn.s
$(GCC_FOR_TARGET) -c -o crtn.o crtn.s
+# We want fine grained libraries, so use the new code to build the
+# floating point emulation libraries.
+FPBIT = fp-bit.c
+DPBIT = dp-bit.c
+
+LIB2FUNCS_EXTRA = xp-bit.c
+
+dp-bit.c: $(srcdir)/config/fp-bit.c
+ echo '#ifdef __LITTLE_ENDIAN__' > dp-bit.c
+ echo '#define FLOAT_BIT_ORDER_MISMATCH' >>dp-bit.c
+ echo '#endif' >> dp-bit.c
+ cat $(srcdir)/config/fp-bit.c >> dp-bit.c
+
+fp-bit.c: $(srcdir)/config/fp-bit.c
+ echo '#define FLOAT' > fp-bit.c
+ echo '#ifdef __LITTLE_ENDIAN__' >> fp-bit.c
+ echo '#define FLOAT_BIT_ORDER_MISMATCH' >>fp-bit.c
+ echo '#endif' >> fp-bit.c
+ cat $(srcdir)/config/fp-bit.c >> fp-bit.c
+
+xp-bit.c: $(srcdir)/config/fp-bit.c
+ echo '#define EXTENDED_FLOAT_STUBS' > xp-bit.c
+ cat $(srcdir)/config/fp-bit.c >> xp-bit.c
+
+MULTILIB_OPTIONS = mcpu=i486/mcpu=pentium/mcpu=pentiumpro/mcpu=k6/mcpu=athlon \
+msoft-float mno-fp-ret-in-387
+MULTILIB_DIRNAMES= m486 mpentium mpentiumpro k6 athlon soft-float nofp
+MULTILIB_MATCHES = msoft-float=mno-m80387
+MULTILIB_EXCEPTIONS = \
+mno-fp-ret-in-387 \
+mcpu=i486/*mno-fp-ret-in-387* \
+mcpu=pentium/*msoft-float* mcpu=pentium/*mno-fp-ret-in-387* \
+mcpu=pentiumpro/*msoft-float* mcpu=pentiumpro/*mno-fp-ret-in-387* \
+mcpu=k6/*msoft-float* mcpu=k6/*mno-fp-ret-in-387* \
+mcpu=athlon/*msoft-float* mcpu=athlon/*mno-fp-ret-in-387*
+
+EXTRA_MULTILIB_PARTS = crtbegin.o crtend.o
+
+LIBGCC = stmp-multilib
+INSTALL_LIBGCC = install-multilib
diff --git a/gcc/config/i386/t-sco5gas b/gcc/config/i386/t-sco5gas
index 2bca87be7a8..4ed88ced269 100644
--- a/gcc/config/i386/t-sco5gas
+++ b/gcc/config/i386/t-sco5gas
@@ -1,6 +1,6 @@
# The pushl in CTOR initialization interferes with frame pointer elimination.
CRTSTUFF_T_CFLAGS = -fPIC -fno-omit-frame-pointer
-CRTSTUFF_T_CFLAGS_S = -mcoff -fno-omit-frame-pointer
+CRTSTUFF_T_CFLAGS_S = -fno-omit-frame-pointer
#
# I am still a little unsure of the multilib architecture. The following
diff --git a/gcc/config/i386/unix.h b/gcc/config/i386/unix.h
index 939b7167da8..61a9bc5fdaa 100644
--- a/gcc/config/i386/unix.h
+++ b/gcc/config/i386/unix.h
@@ -87,7 +87,7 @@ Boston, MA 02111-1307, USA. */
#define ASM_OUTPUT_MI_THUNK(FILE, THUNK_FNDECL, DELTA, FUNCTION) \
do { \
tree parm; \
- rtx xops[2]; \
+ rtx xops[3]; \
\
if (ix86_regparm > 0) \
parm = TYPE_ARG_TYPES (TREE_TYPE (function)); \
@@ -110,6 +110,7 @@ do { \
{ \
xops[0] = pic_offset_table_rtx; \
xops[1] = gen_label_rtx (); \
+ xops[2] = gen_rtx_SYMBOL_REF (Pmode, "_GLOBAL_OFFSET_TABLE_"); \
\
if (ix86_regparm > 2) \
abort (); \
@@ -117,7 +118,7 @@ do { \
output_asm_insn ("call\t%P1", xops); \
ASM_OUTPUT_INTERNAL_LABEL (FILE, "L", CODE_LABEL_NUMBER (xops[1])); \
output_asm_insn ("pop{l}\t%0", xops); \
- output_asm_insn ("add{l}\t{$_GLOBAL_OFFSET_TABLE_+[.-%P1], %0|%0, OFFSET FLAT: _GLOBAL_OFFSET_TABLE_+[.-%P1]}", xops); \
+ output_asm_insn ("add{l}\t{%2+[.-%P1], %0|%0, OFFSET FLAT: %2+[.-%P1]}", xops); \
xops[0] = gen_rtx_MEM (SImode, XEXP (DECL_RTL (FUNCTION), 0)); \
output_asm_insn ("mov{l}\t{%0@GOT(%%ebx), %%ecx|%%ecx, %0@GOT[%%ebx]}",\
xops); \
diff --git a/gcc/config/i386/vsta.h b/gcc/config/i386/vsta.h
index 6a41b4e1cf8..e9479ef103a 100644
--- a/gcc/config/i386/vsta.h
+++ b/gcc/config/i386/vsta.h
@@ -61,7 +61,7 @@ dtor_section () \
#define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME) \
do { \
ctor_section (); \
- fprintf (FILE, "%s\t", ASM_LONG); \
+ fputs (ASM_LONG, FILE); \
assemble_name (FILE, NAME); \
fprintf (FILE, "\n"); \
} while (0)
@@ -69,7 +69,7 @@ dtor_section () \
#define ASM_OUTPUT_DESTRUCTOR(FILE,NAME) \
do { \
dtor_section (); \
- fprintf (FILE, "%s\t", ASM_LONG); \
+ fputs (ASM_LONG, FILE); \
assemble_name (FILE, NAME); \
fprintf (FILE, "\n"); \
} while (0)
diff --git a/gcc/config/i386/win-nt.h b/gcc/config/i386/win-nt.h
index ce1e5bfb2be..aff89290f35 100644
--- a/gcc/config/i386/win-nt.h
+++ b/gcc/config/i386/win-nt.h
@@ -75,7 +75,7 @@ dtor_section () \
#define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME) \
do { \
ctor_section (); \
- fprintf (FILE, "%s\t", ASM_LONG); \
+ fputs (ASM_LONG, FILE); \
assemble_name (FILE, NAME); \
fprintf (FILE, "\n"); \
} while (0)
@@ -83,7 +83,7 @@ dtor_section () \
#define ASM_OUTPUT_DESTRUCTOR(FILE,NAME) \
do { \
dtor_section (); \
- fprintf (FILE, "%s\t", ASM_LONG); \
+ fputs (ASM_LONG, FILE); \
assemble_name (FILE, NAME); \
fprintf (FILE, "\n"); \
} while (0)
diff --git a/gcc/config/i386/win32.h b/gcc/config/i386/win32.h
index 519a1380cf7..2427bbd9d71 100644
--- a/gcc/config/i386/win32.h
+++ b/gcc/config/i386/win32.h
@@ -136,7 +136,7 @@ dtor_section () \
#define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME) \
do { \
ctor_section (); \
- fprintf (FILE, "%s\t", ASM_LONG); \
+ fputs (ASM_LONG, FILE); \
assemble_name (FILE, NAME); \
fprintf (FILE, "\n"); \
} while (0)
@@ -144,7 +144,7 @@ dtor_section () \
#define ASM_OUTPUT_DESTRUCTOR(FILE,NAME) \
do { \
dtor_section (); \
- fprintf (FILE, "%s\t", ASM_LONG); \
+ fputs (ASM_LONG, FILE); \
assemble_name (FILE, NAME); \
fprintf (FILE, "\n"); \
} while (0)
diff --git a/gcc/config/i386/winnt.c b/gcc/config/i386/winnt.c
index ae6b6253a8b..39074cc1c6c 100644
--- a/gcc/config/i386/winnt.c
+++ b/gcc/config/i386/winnt.c
@@ -27,6 +27,8 @@ Boston, MA 02111-1307, USA. */
#include "output.h"
#include "tree.h"
#include "flags.h"
+#include "tm_p.h"
+#include "toplev.h"
/* i386/PE specific attribute support.
@@ -39,6 +41,13 @@ Boston, MA 02111-1307, USA. */
multiple times.
*/
+static tree associated_type PARAMS ((tree));
+const char * gen_stdcall_suffix PARAMS ((tree));
+int i386_pe_dllexport_p PARAMS ((tree));
+int i386_pe_dllimport_p PARAMS ((tree));
+void i386_pe_mark_dllexport PARAMS ((tree));
+void i386_pe_mark_dllimport PARAMS ((tree));
+
/* Return nonzero if ATTR is a valid attribute for DECL.
ATTRIBUTES are any existing attributes and ARGS are the arguments
supplied with ATTR. */
@@ -226,7 +235,7 @@ i386_pe_dllimport_p (decl)
int
i386_pe_dllexport_name_p (symbol)
- char *symbol;
+ const char *symbol;
{
return symbol[0] == '@' && symbol[1] == 'e' && symbol[2] == '.';
}
@@ -235,7 +244,7 @@ i386_pe_dllexport_name_p (symbol)
int
i386_pe_dllimport_name_p (symbol)
- char *symbol;
+ const char *symbol;
{
return symbol[0] == '@' && symbol[1] == 'i' && symbol[2] == '.';
}
@@ -247,7 +256,8 @@ void
i386_pe_mark_dllexport (decl)
tree decl;
{
- char *oldname, *newname;
+ const char *oldname;
+ char *newname;
rtx rtlname;
tree idp;
@@ -283,7 +293,8 @@ void
i386_pe_mark_dllimport (decl)
tree decl;
{
- char *oldname, *newname;
+ const char *oldname;
+ char *newname;
tree idp;
rtx rtlname, newrtl;
@@ -370,14 +381,14 @@ i386_pe_mark_dllimport (decl)
suffix consisting of an atsign (@) followed by the number of bytes of
arguments */
-char *
+const char *
gen_stdcall_suffix (decl)
tree decl;
{
int total = 0;
/* ??? This probably should use XSTR (XEXP (DECL_RTL (decl), 0), 0) instead
of DECL_ASSEMBLER_NAME. */
- char *asmname = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
+ const char *asmname = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
char *newsym;
if (TYPE_ARG_TYPES (TREE_TYPE (decl)))
@@ -444,7 +455,7 @@ i386_pe_encode_section_info (decl)
&& GET_CODE (XEXP (XEXP (DECL_RTL (decl), 0), 0)) == SYMBOL_REF
&& i386_pe_dllimport_name_p (XSTR (XEXP (XEXP (DECL_RTL (decl), 0), 0), 0)))
{
- char *oldname = XSTR (XEXP (XEXP (DECL_RTL (decl), 0), 0), 0);
+ const char *oldname = XSTR (XEXP (XEXP (DECL_RTL (decl), 0), 0), 0);
tree idp = get_identifier (oldname + 9);
rtx newrtl = gen_rtx (SYMBOL_REF, Pmode, IDENTIFIER_POINTER (idp));
@@ -465,8 +476,8 @@ i386_pe_unique_section (decl, reloc)
int reloc;
{
int len;
- const char *name;
- char *string,*prefix;
+ const char *name, *prefix;
+ char *string;
name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
/* Strip off any encoding in fnname. */
@@ -513,7 +524,7 @@ i386_pe_unique_section (decl, reloc)
void
i386_pe_declare_function_type (file, name, public)
FILE *file;
- char *name;
+ const char *name;
int public;
{
fprintf (file, "\t.def\t");
@@ -528,7 +539,7 @@ i386_pe_declare_function_type (file, name, public)
struct extern_list
{
struct extern_list *next;
- char *name;
+ const char *name;
};
static struct extern_list *extern_head;
@@ -541,7 +552,7 @@ static struct extern_list *extern_head;
void
i386_pe_record_external_function (name)
- char *name;
+ const char *name;
{
struct extern_list *p;
@@ -556,7 +567,7 @@ i386_pe_record_external_function (name)
struct export_list
{
struct export_list *next;
- char *name;
+ const char *name;
int is_data; /* used to type tag exported symbols. */
};
@@ -570,7 +581,7 @@ static struct export_list *export_head;
void
i386_pe_record_exported_symbol (name, is_data)
- char *name;
+ const char *name;
int is_data;
{
struct export_list *p;
diff --git a/gcc/config/i386/xm-aix.h b/gcc/config/i386/xm-aix.h
index 4cbd36ef518..e69de29bb2d 100644
--- a/gcc/config/i386/xm-aix.h
+++ b/gcc/config/i386/xm-aix.h
@@ -1,2 +0,0 @@
-#undef TRUE
-#undef FALSE
diff --git a/gcc/config/i386/xm-cygwin.h b/gcc/config/i386/xm-cygwin.h
index e7755bb54a4..7dd1f187598 100644
--- a/gcc/config/i386/xm-cygwin.h
+++ b/gcc/config/i386/xm-cygwin.h
@@ -1,6 +1,6 @@
/* Configuration for GNU C-compiler for hosting on Windows NT.
using a unix style C library.
- Copyright (C) 1995, 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+ Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -31,30 +31,9 @@ Boston, MA 02111-1307, USA. */
backslashes as escape characters. Many Win32 programs use forward
slashes so using a forward slash shouldn't be problematic from the
perspective of wanting gcc to produce native Win32 paths. */
-#define DIR_SEPARATOR '/'
+#undef DIR_SEPARATOR_2
#define DIR_SEPARATOR_2 '\\'
-/* Convert win32 style path lists to POSIX style for consistency. */
-#undef GET_ENV_PATH_LIST
-#define GET_ENV_PATH_LIST(VAR,NAME) \
-do { \
- char *_epath; \
- char *_posixepath; \
- _epath = _posixepath = getenv (NAME); \
- /* if we have a posix path list, convert to posix path list */ \
- if (_epath != NULL && *_epath != 0 \
- && ! cygwin_posix_path_list_p (_epath)) \
- { \
- char *p; \
- _posixepath = (char *) xmalloc \
- (cygwin_win32_to_posix_path_list_buf_size (_epath)); \
- cygwin_win32_to_posix_path_list (_epath, _posixepath); \
- } \
- (VAR) = _posixepath; \
-} while (0)
-
-#define PATH_SEPARATOR ':'
-
/* This is needed so that protoize will compile. */
#ifndef POSIX
#define POSIX
diff --git a/gcc/config/i386/xm-i386.h b/gcc/config/i386/xm-i386.h
index d115e6eff0d..81e13f0b24e 100644
--- a/gcc/config/i386/xm-i386.h
+++ b/gcc/config/i386/xm-i386.h
@@ -22,10 +22,6 @@ Boston, MA 02111-1307, USA. */
#define __i386__ 1
#endif
-/* #defines that need visibility everywhere. */
-#define FALSE 0
-#define TRUE 1
-
/* This describes the machine the compiler is hosted on. */
#define HOST_BITS_PER_CHAR 8
#define HOST_BITS_PER_SHORT 16
diff --git a/gcc/config/i386/xm-osf.h b/gcc/config/i386/xm-osf.h
index 4cbd36ef518..e69de29bb2d 100644
--- a/gcc/config/i386/xm-osf.h
+++ b/gcc/config/i386/xm-osf.h
@@ -1,2 +0,0 @@
-#undef TRUE
-#undef FALSE
diff --git a/gcc/config/i860/i860.c b/gcc/config/i860/i860.c
index 912e4e62e4f..7cc9d51e22e 100644
--- a/gcc/config/i860/i860.c
+++ b/gcc/config/i860/i860.c
@@ -36,7 +36,6 @@ Boston, MA 02111-1307, USA. */
#include "real.h"
#include "insn-config.h"
#include "conditions.h"
-#include "insn-flags.h"
#include "output.h"
#include "recog.h"
#include "insn-attr.h"
diff --git a/gcc/config/i860/varargs.asm b/gcc/config/i860/varargs.asm
new file mode 100644
index 00000000000..8f870063c41
--- /dev/null
+++ b/gcc/config/i860/varargs.asm
@@ -0,0 +1,201 @@
+/* Special varargs support for i860.
+ Copyright (C) 2001 Free Software Foundation, Inc.
+
+This file is part of GNU CC.
+
+GNU CC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+In addition to the permissions in the GNU General Public License, the
+Free Software Foundation gives you unlimited permission to link the
+compiled version of this file into combinations with other programs,
+and to distribute those combinations without any restriction coming
+from the use of this file. (The General Public License restrictions
+do apply in other respects; for example, they cover modification of
+the file, and distribution when not linked into a combine
+executable.)
+
+GNU CC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU CC; see the file COPYING. If not, write to
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA. */
+
+#if defined(__svr4__) || defined(__alliant__)
+ .text
+ .align 4
+
+/* The Alliant needs the added underscore. */
+ .globl __builtin_saveregs
+__builtin_saveregs:
+ .globl ___builtin_saveregs
+___builtin_saveregs:
+
+ andnot 0x0f,%sp,%sp /* round down to 16-byte boundary */
+ adds -96,%sp,%sp /* allocate stack space for reg save
+ area and also for a new va_list
+ structure */
+ /* Save all argument registers in the arg reg save area. The
+ arg reg save area must have the following layout (according
+ to the svr4 ABI):
+
+ struct {
+ union {
+ float freg[8];
+ double dreg[4];
+ } float_regs;
+ long ireg[12];
+ };
+ */
+
+ fst.q %f8, 0(%sp) /* save floating regs (f8-f15) */
+ fst.q %f12,16(%sp)
+
+ st.l %r16,32(%sp) /* save integer regs (r16-r27) */
+ st.l %r17,36(%sp)
+ st.l %r18,40(%sp)
+ st.l %r19,44(%sp)
+ st.l %r20,48(%sp)
+ st.l %r21,52(%sp)
+ st.l %r22,56(%sp)
+ st.l %r23,60(%sp)
+ st.l %r24,64(%sp)
+ st.l %r25,68(%sp)
+ st.l %r26,72(%sp)
+ st.l %r27,76(%sp)
+
+ adds 80,%sp,%r16 /* compute the address of the new
+ va_list structure. Put in into
+ r16 so that it will be returned
+ to the caller. */
+
+ /* Initialize all fields of the new va_list structure. This
+ structure looks like:
+
+ typedef struct {
+ unsigned long ireg_used;
+ unsigned long freg_used;
+ long *reg_base;
+ long *mem_ptr;
+ } va_list;
+ */
+
+ st.l %r0, 0(%r16) /* nfixed */
+ st.l %r0, 4(%r16) /* nfloating */
+ st.l %sp, 8(%r16) /* __va_ctl points to __va_struct. */
+ bri %r1 /* delayed return */
+ st.l %r28,12(%r16) /* pointer to overflow args */
+
+#else /* not __svr4__ */
+#if defined(__PARAGON__)
+ /*
+ * we'll use SVR4-ish varargs but need SVR3.2 assembler syntax,
+ * and we stand a better chance of hooking into libraries
+ * compiled by PGI. [andyp@ssd.intel.com]
+ */
+ .text
+ .align 4
+ .globl __builtin_saveregs
+__builtin_saveregs:
+ .globl ___builtin_saveregs
+___builtin_saveregs:
+
+ andnot 0x0f,sp,sp /* round down to 16-byte boundary */
+ adds -96,sp,sp /* allocate stack space for reg save
+ area and also for a new va_list
+ structure */
+ /* Save all argument registers in the arg reg save area. The
+ arg reg save area must have the following layout (according
+ to the svr4 ABI):
+
+ struct {
+ union {
+ float freg[8];
+ double dreg[4];
+ } float_regs;
+ long ireg[12];
+ };
+ */
+
+ fst.q f8, 0(sp)
+ fst.q f12,16(sp)
+ st.l r16,32(sp)
+ st.l r17,36(sp)
+ st.l r18,40(sp)
+ st.l r19,44(sp)
+ st.l r20,48(sp)
+ st.l r21,52(sp)
+ st.l r22,56(sp)
+ st.l r23,60(sp)
+ st.l r24,64(sp)
+ st.l r25,68(sp)
+ st.l r26,72(sp)
+ st.l r27,76(sp)
+
+ adds 80,sp,r16 /* compute the address of the new
+ va_list structure. Put in into
+ r16 so that it will be returned
+ to the caller. */
+
+ /* Initialize all fields of the new va_list structure. This
+ structure looks like:
+
+ typedef struct {
+ unsigned long ireg_used;
+ unsigned long freg_used;
+ long *reg_base;
+ long *mem_ptr;
+ } va_list;
+ */
+
+ st.l r0, 0(r16) /* nfixed */
+ st.l r0, 4(r16) /* nfloating */
+ st.l sp, 8(r16) /* __va_ctl points to __va_struct. */
+ bri r1 /* delayed return */
+ st.l r28,12(r16) /* pointer to overflow args */
+#else /* not __PARAGON__ */
+ .text
+ .align 4
+
+ .globl ___builtin_saveregs
+___builtin_saveregs:
+ mov sp,r30
+ andnot 0x0f,sp,sp
+ adds -96,sp,sp /* allocate sufficient space on the stack */
+
+/* Fill in the __va_struct. */
+ st.l r16, 0(sp) /* save integer regs (r16-r27) */
+ st.l r17, 4(sp) /* int fixed[12] */
+ st.l r18, 8(sp)
+ st.l r19,12(sp)
+ st.l r20,16(sp)
+ st.l r21,20(sp)
+ st.l r22,24(sp)
+ st.l r23,28(sp)
+ st.l r24,32(sp)
+ st.l r25,36(sp)
+ st.l r26,40(sp)
+ st.l r27,44(sp)
+
+ fst.q f8, 48(sp) /* save floating regs (f8-f15) */
+ fst.q f12,64(sp) /* int floating[8] */
+
+/* Fill in the __va_ctl. */
+ st.l sp, 80(sp) /* __va_ctl points to __va_struct. */
+ st.l r28,84(sp) /* pointer to more args */
+ st.l r0, 88(sp) /* nfixed */
+ st.l r0, 92(sp) /* nfloating */
+
+ adds 80,sp,r16 /* return address of the __va_ctl. */
+ bri r1
+ mov r30,sp
+ /* recover stack and pass address to start
+ of data. */
+#endif /* not __PARAGON__ */
+#endif /* not __svr4__ */
diff --git a/gcc/config/i860/xm-i860.h b/gcc/config/i860/xm-i860.h
index 4e8488f1f10..b833c47c7a3 100644
--- a/gcc/config/i860/xm-i860.h
+++ b/gcc/config/i860/xm-i860.h
@@ -22,10 +22,6 @@ Boston, MA 02111-1307, USA. */
#define i860
#endif
-/* #defines that need visibility everywhere. */
-#define FALSE 0
-#define TRUE 1
-
/* This describes the machine the compiler is hosted on. */
#define HOST_BITS_PER_CHAR 8
#define HOST_BITS_PER_SHORT 16
diff --git a/gcc/config/i960/i960.c b/gcc/config/i960/i960.c
index 21753a207b2..47b2b1de026 100644
--- a/gcc/config/i960/i960.c
+++ b/gcc/config/i960/i960.c
@@ -31,12 +31,10 @@ Boston, MA 02111-1307, USA. */
#include "real.h"
#include "insn-config.h"
#include "conditions.h"
-#include "insn-flags.h"
#include "output.h"
#include "insn-attr.h"
#include "flags.h"
#include "tree.h"
-#include "insn-codes.h"
#include "expr.h"
#include "except.h"
#include "function.h"
@@ -291,7 +289,7 @@ fp_arith_operand (op, mode)
return (register_operand (op, mode) || fp_literal (op, mode));
}
-/* Return true is OP is a register or a valid signed integer literal. */
+/* Return true if OP is a register or a valid signed integer literal. */
int
signed_arith_operand (op, mode)
diff --git a/gcc/config/i960/i960.h b/gcc/config/i960/i960.h
index 510793b307f..484bb81d6bd 100644
--- a/gcc/config/i960/i960.h
+++ b/gcc/config/i960/i960.h
@@ -39,6 +39,7 @@ Boston, MA 02111-1307, USA. */
%{mmc:-D__i960MC}\
%{mca:-D__i960CA}%{mcc:-D__i960CC}\
%{mcf:-D__i960CF}}\
+ %{msoft-float:-D_SOFT_FLOAT}\
%{mka:-D__i960KA__ -D__i960_KA__}\
%{mkb:-D__i960KB__ -D__i960_KB__}\
%{msa:-D__i960SA__ -D__i960_SA__}\
diff --git a/gcc/config/i960/rtems.h b/gcc/config/i960/rtems.h
index 7486a8bac98..0f2dcdbe6b3 100644
--- a/gcc/config/i960/rtems.h
+++ b/gcc/config/i960/rtems.h
@@ -1,5 +1,5 @@
/* Definitions for rtems targeting an Intel i960.
- Copyright (C) 1996, 1997, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1997, 2000, 2002 Free Software Foundation, Inc.
Contributed by Joel Sherrill (joel@OARcorp.com).
This file is part of GNU CC.
@@ -24,7 +24,7 @@ Boston, MA 02111-1307, USA. */
/* Specify predefined symbols in preprocessor. */
#undef CPP_PREDEFINES
-#define CPP_PREDEFINES "-Di960 -Di80960 -DI960 -DI80960 -Drtems -D__rtems__ \
+#define CPP_PREDEFINES "-Di960 -Di80960 -DI960 -DI80960 -D__rtems__ \
-Asystem=rtems -Acpu=i960 -Amachine=i960"
/* Generate calls to memcpy, memcmp and memset. */
diff --git a/gcc/config/i960/xm-i960.h b/gcc/config/i960/xm-i960.h
index 09dcadff460..693661d6af0 100644
--- a/gcc/config/i960/xm-i960.h
+++ b/gcc/config/i960/xm-i960.h
@@ -18,10 +18,6 @@ along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-/* #defines that need visibility everywhere. */
-#define FALSE 0
-#define TRUE 1
-
/* This describes the machine the compiler is hosted on. */
#define HOST_BITS_PER_CHAR 8
#define HOST_BITS_PER_SHORT 16
diff --git a/gcc/config/ia64/crtbegin.asm b/gcc/config/ia64/crtbegin.asm
index 1b57a99316c..ac2f86bcc87 100644
--- a/gcc/config/ia64/crtbegin.asm
+++ b/gcc/config/ia64/crtbegin.asm
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2001 Free Software Foundation, Inc.
Contributed by Jes Sorensen, <Jes.Sorensen@cern.ch>
The GNU C Library is free software; you can redistribute it and/or
@@ -32,14 +32,6 @@ __DTOR_LIST__:
dtor_ptr:
data8 __DTOR_LIST__# + 8
-#ifndef SHARED
- .type __ia64_app_header#,@object
- .size __ia64_app_header#,8
- .global __ia64_app_header
-__ia64_app_header:
- data8 @segrel(.Lsegrel_ref#)
-#endif
-
/* A handle for __cxa_finalize to manage c++ local destructors. */
.global __dso_handle#
.type __dso_handle#,@object
@@ -71,42 +63,19 @@ __dso_handle:
*/
.section .fini,"ax","progbits"
{ .mlx
- movl r2 = @gprel(__do_global_dtors_aux#)
- ;;
+ movl r2 = @pcrel(__do_global_dtors_aux# - 16)
}
{ .mii
- nop.m 0
- add r2 = r2, gp
- ;;
- mov b6 = r2
- }
- { .bbb
- br.call.sptk.many b0 = b6
+ mov r3 = ip
;;
- }
-
-#ifndef SHARED
-/*
- * Fragment of the ELF _init routine that sets up __ia64_app_header
- */
-
-.section .init,"ax","progbits"
-.Lsegrel_ref:
- { .mmi
- addl r2 = @gprel(__ia64_app_header), gp
- mov r16 = ip
+ add r2 = r2, r3
;;
}
- { .mmi
- ld8 r3 = [r2]
- ;;
- sub r16 = r16, r3
+ { .mib
+ mov b6 = r2
+ br.call.sptk.many b0 = b6
;;
}
- { .mfb
- st8 [r2] = r16
- }
-#endif
.section .text
.align 16
diff --git a/gcc/config/ia64/crtend.asm b/gcc/config/ia64/crtend.asm
index 81f90198fb6..3a097d7622f 100644
--- a/gcc/config/ia64/crtend.asm
+++ b/gcc/config/ia64/crtend.asm
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2001 Free Software Foundation, Inc.
Contributed by Jes Sorensen, <Jes.Sorensen@cern.ch>
The GNU C Library is free software; you can redistribute it and/or
@@ -41,16 +41,16 @@ __DTOR_END__:
*/
.section .init,"ax","progbits"
{ .mlx
- movl r2 = @gprel(__do_global_ctors_aux#)
- ;;
+ movl r2 = @pcrel(__do_global_ctors_aux# - 16)
}
{ .mii
- nop.m 0
- add r2 = r2, gp
+ mov r3 = ip
+ ;;
+ add r2 = r2, r3
;;
- mov b6 = r2
}
- { .bbb
+ { .mib
+ mov b6 = r2
br.call.sptk.many b0 = b6
;;
}
diff --git a/gcc/config/ia64/elf.h b/gcc/config/ia64/elf.h
index b6c4198bfc8..af8c7a6b4e8 100644
--- a/gcc/config/ia64/elf.h
+++ b/gcc/config/ia64/elf.h
@@ -1,8 +1,44 @@
/* Definitions for embedded ia64-elf target. */
-#include "ia64/ia64.h"
-#include "elfos.h"
-#include "sysv4.h"
+/* This macro is a C statement to print on `stderr' a string describing the
+ particular machine description choice. */
+
+#define TARGET_VERSION fprintf (stderr, " (IA-64) ELF");
+
+/* Define this to be a string constant containing `-D' options to define the
+ predefined macros that identify this machine and system. These macros will
+ be predefined unless the `-ansi' option is specified. */
+/* ??? This is undefed in svr4.h. */
+#define CPP_PREDEFINES "-Dia64 -Amachine=ia64"
+
+/* A C string constant that tells the GNU CC driver program options to pass to
+ the assembler. It can also specify how to translate options you give to GNU
+ CC into options for GNU CC to pass to the assembler. */
+
+#if ((TARGET_CPU_DEFAULT | TARGET_DEFAULT) & MASK_GNU_AS) != 0
+/* GNU AS. */
+#define ASM_SPEC \
+ "%{mno-gnu-as:-N so} %{!mno-gnu-as:-x} %{mconstant-gp} %{mauto-pic}"
+#else
+/* Intel ias. */
+#define ASM_SPEC \
+ "%{!mgnu-as:-N so} %{mgnu-as:-x} %{mconstant-gp:-M const_gp}\
+ %{mauto-pic:-M no_plabel}"
+#endif
+
+/* A C string constant that tells the GNU CC driver program options to pass to
+ the linker. It can also specify how to translate options you give to GNU CC
+ into options for GNU CC to pass to the linker. */
+
+/* The Intel linker does not support dynamic linking, so we need -dn.
+ The Intel linker gives annoying messages unless -N so is used. */
+#if ((TARGET_CPU_DEFAULT | TARGET_DEFAULT) & MASK_GNU_LD) != 0
+/* GNU LD. */
+#define LINK_SPEC "%{mno-gnu-ld:-dn -N so}"
+#else
+/* Intel ild. */
+#define LINK_SPEC "%{!mgnu-ld:-dn -N so}"
+#endif
/* svr4.h links with crti.o/crtn.o, but elfos.h does not. We override elfos.h
so that we can use the standard ELF Unix method. */
diff --git a/gcc/config/ia64/fde-glibc.c b/gcc/config/ia64/fde-glibc.c
index 8000be2f0a5..c663f584458 100644
--- a/gcc/config/ia64/fde-glibc.c
+++ b/gcc/config/ia64/fde-glibc.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2001 Free Software Foundation, Inc.
Contributed by Richard Henderson <rth@cygnus.com>.
This file is part of GNU CC.
@@ -28,125 +28,135 @@
/* Locate the FDE entry for a given address, using glibc ld.so routines
to avoid register/deregister calls at DSO load/unload. */
+#ifndef _GNU_SOURCE
+#define _GNU_SOURCE
+#endif
+#include "config.h"
+#include <stddef.h>
#include <stdlib.h>
#include <link.h>
-#include <bits/libc-lock.h>
-#include "frame-ia64.h"
+#include "unwind-ia64.h"
+#if __GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 2) \
+ || (__GLIBC__ == 2 && __GLIBC_MINOR__ == 2 && !defined(DT_CONFIG))
+# error You need GLIBC 2.2.4 or later on IA-64 Linux
+#endif
-/* Initialized by crtbegin from the main application. */
-extern Elf64_Ehdr *__ia64_app_header;
-
-/* ??? A redeclaration of the lock in ld.so. Perhaps this should
- appear in <link.h> in a new glibc version. */
-__libc_lock_define (extern, _dl_load_lock)
-
-/* ??? _dl_load_lock is not exported from glibc 2.1, but it is
- from glibc 2.2. Remove this when folks have migrated. */
-#pragma weak _dl_load_lock
-
-/* This always exists, even in a static application. */
-extern struct link_map *_dl_loaded;
-
-static fde *
-find_fde_for_dso (Elf64_Addr pc, Elf64_Ehdr *ehdr)
+struct unw_ia64_callback_data
+{
+ Elf64_Addr pc;
+ unsigned long *segment_base;
+ unsigned long *gp;
+ struct unw_table_entry *ret;
+};
+
+static int
+_Unwind_IteratePhdrCallback (struct dl_phdr_info *info, size_t size, void *ptr)
{
- Elf64_Phdr *phdr, *p_unwind;
+ struct unw_ia64_callback_data *data = (struct unw_ia64_callback_data *) ptr;
+ const Elf64_Phdr *phdr, *p_unwind, *p_dynamic;
long n, match;
Elf64_Addr load_base, seg_base;
- fde *f_base;
+ struct unw_table_entry *f_base, *f;
size_t lo, hi;
- /* Verify that we are looking at an ELF header. */
- if (ehdr->e_ident[0] != 0x7f
- || ehdr->e_ident[1] != 'E'
- || ehdr->e_ident[2] != 'L'
- || ehdr->e_ident[3] != 'F'
- || ehdr->e_ident[EI_CLASS] != ELFCLASS64
- || ehdr->e_ident[EI_DATA] != ELFDATA2LSB
- || ehdr->e_machine != EM_IA_64)
- abort ();
+ /* Make sure struct dl_phdr_info is at least as big as we need. */
+ if (size < offsetof (struct dl_phdr_info, dlpi_phnum)
+ + sizeof (info->dlpi_phnum))
+ return -1;
match = 0;
- phdr = (Elf64_Phdr *)((char *)ehdr + ehdr->e_phoff);
- load_base = (ehdr->e_type == ET_DYN ? (Elf64_Addr)ehdr : 0);
+ phdr = info->dlpi_phdr;
+ load_base = info->dlpi_addr;
p_unwind = NULL;
+ p_dynamic = NULL;
+ seg_base = ~(Elf64_Addr) 0;
/* See if PC falls into one of the loaded segments. Find the unwind
segment at the same time. */
- for (n = ehdr->e_phnum; --n >= 0; phdr++)
+ for (n = info->dlpi_phnum; --n >= 0; phdr++)
{
if (phdr->p_type == PT_LOAD)
{
Elf64_Addr vaddr = phdr->p_vaddr + load_base;
- if (pc >= vaddr && pc < vaddr + phdr->p_memsz)
+ if (data->pc >= vaddr && data->pc < vaddr + phdr->p_memsz)
match = 1;
+ if (vaddr < seg_base)
+ seg_base = vaddr;
}
else if (phdr->p_type == PT_IA_64_UNWIND)
p_unwind = phdr;
+ else if (phdr->p_type == PT_DYNAMIC)
+ p_dynamic = phdr;
}
if (!match || !p_unwind)
- return NULL;
+ return 0;
/* Search for the FDE within the unwind segment. */
- f_base = (fde *) (p_unwind->p_vaddr + load_base);
- seg_base = (Elf64_Addr) ehdr;
+ f_base = (struct unw_table_entry *) (p_unwind->p_vaddr + load_base);
lo = 0;
- hi = p_unwind->p_memsz / sizeof (fde);
+ hi = p_unwind->p_memsz / sizeof (struct unw_table_entry);
while (lo < hi)
{
size_t mid = (lo + hi) / 2;
- fde *f = f_base + mid;
- if (pc < f->start_offset + seg_base)
+ f = f_base + mid;
+ if (data->pc < f->start_offset + seg_base)
hi = mid;
- else if (pc >= f->end_offset + seg_base)
+ else if (data->pc >= f->end_offset + seg_base)
lo = mid + 1;
else
- return f;
+ goto found;
}
+ return 0;
- return NULL;
-}
-
-/* Return a pointer to the FDE for the function containing PC. */
-fde *
-__ia64_find_fde (void *pc, void **pc_base)
-{
- fde *ret;
- struct link_map *map;
+ found:
+ *data->segment_base = seg_base;
+ *data->gp = 0;
+ data->ret = f;
- /* Check the main application first, hoping that most of the user's
- code is there instead of in some library. */
- ret = find_fde_for_dso ((Elf64_Addr)pc, __ia64_app_header);
- if (ret)
+ if (p_dynamic)
{
- *pc_base = __ia64_app_header;
- return ret;
+ /* For dynamicly linked executables and shared libraries,
+ DT_PLTGOT is the gp value for that object. */
+ Elf64_Dyn *dyn = (Elf64_Dyn *)(p_dynamic->p_vaddr + load_base);
+ for (; dyn->d_tag != DT_NULL ; dyn++)
+ if (dyn->d_tag == DT_PLTGOT)
+ {
+ /* On IA-64, _DYNAMIC is writable and GLIBC has relocated it. */
+ *data->gp = dyn->d_un.d_ptr;
+ break;
+ }
+ }
+ else
+ {
+ /* Otherwise this is a static executable with no _DYNAMIC.
+ The gp is constant program-wide. */
+ register unsigned long gp __asm__("gp");
+ *data->gp = gp;
}
- /* Glibc is probably unique in that we can (with certain restrictions)
- dynamicly load libraries into staticly linked applications. Thus
- we _always_ check _dl_loaded. */
+ return 1;
+}
- if (&_dl_load_lock)
- __libc_lock_lock (_dl_load_lock);
+/* Return a pointer to the unwind table entry for the function
+ containing PC. */
- for (map = _dl_loaded; map ; map = map->l_next)
- {
- /* Skip the main application's entry. */
- if (map->l_name[0] == 0)
- continue;
- ret = find_fde_for_dso ((Elf64_Addr)pc, (Elf64_Ehdr *)map->l_addr);
- if (ret)
- break;
- }
+struct unw_table_entry *
+_Unwind_FindTableEntry (void *pc, unsigned long *segment_base,
+ unsigned long *gp)
+{
+ struct unw_ia64_callback_data data;
- if (&_dl_load_lock)
- __libc_lock_unlock (_dl_load_lock);
+ data.pc = (Elf64_Addr) pc;
+ data.segment_base = segment_base;
+ data.gp = gp;
+ data.ret = NULL;
+
+ if (dl_iterate_phdr (_Unwind_IteratePhdrCallback, &data) < 0)
+ return NULL;
- *pc_base = (void *)(map ? map->l_addr : 0);
- return ret;
+ return data.ret;
}
diff --git a/gcc/config/ia64/frame-ia64.c b/gcc/config/ia64/frame-ia64.c
deleted file mode 100644
index 4834a8b3cdf..00000000000
--- a/gcc/config/ia64/frame-ia64.c
+++ /dev/null
@@ -1,1272 +0,0 @@
-/* Subroutines needed for unwinding IA-64 standard format stack frame
- info for exception handling. */
-/* Compile this one with gcc. */
-/* Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
- Contributed by Andrew MacLeod <amacleod@cygnus.com>
- Andrew Haley <aph@cygnus.com>
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with other files,
- some of which are compiled with GCC, to produce an executable,
- this library 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. */
-
-/* It is incorrect to include config.h here, because this file is being
- compiled for the target, and hence definitions concerning only the host
- do not apply. */
-
-#include "tconfig.h"
-
-/* We disable this when inhibit_libc, so that gcc can still be built without
- needing header files first. */
-/* ??? This is not a good solution, since prototypes may be required in
- some cases for correct code. See also libgcc2.c/crtstuff.c. */
-#ifndef inhibit_libc
-#include <stdlib.h>
-#include <unistd.h>
-#else
-#include <stddef.h>
-#endif
-
-#include "frame-ia64.h"
-#include "eh-common.h"
-
-/* Some types used by the DWARF 2 spec. */
-
-typedef int sword __attribute__ ((mode (SI)));
-typedef unsigned int uword __attribute__ ((mode (SI)));
-typedef unsigned int uaddr __attribute__ ((mode (pointer)));
-typedef int saddr __attribute__ ((mode (pointer)));
-typedef unsigned char ubyte;
-
-#include "frame.h"
-
-/* Decode the unsigned LEB128 constant at BUF and return it. The value at
- MEM is updated to reflect the next position in the buffer. */
-
-static unsigned long
-read_uleb128 (unsigned char **mem)
-{
- unsigned shift = 0;
- unsigned long result = 0;
- unsigned char *buf = *mem;
-
- while (1)
- {
- unsigned long byte = *buf++;
- result |= (byte & 0x7f) << shift;
- if ((byte & 0x80) == 0)
- break;
- shift += 7;
- }
- *mem = buf;
- return result;
-}
-
-
-static unsigned char *
-read_R_record (unwind_record *data, unsigned char val, unsigned char *ptr)
-{
- if ((val & 0x40) == 0)
- {
- /* R1 format. */
- if (val & 0x20)
- data->type = body;
- else
- data->type = prologue;
- data->record.r.rlen = (val & 0x1f);
- return ptr;
- }
-
- if ((val & 0xF8) == UNW_R2)
- {
- /* R2 format. */
- unsigned char mask = (val & 0x07) << 1;
- if (*ptr & 0x80)
- mask = mask | 1;
- data->type = prologue_gr;
- data->record.r.mask = mask;
- data->record.r.grsave = (*ptr++ & 0x7f);
- data->record.r.rlen = read_uleb128 (&ptr);
- return ptr;
- }
-
- if ((val & 0xFC) == UNW_R3)
- {
- /* R3 format. */
- val = (val & 0x03);
- if (val == 0)
- data->type = prologue;
- else
- if (val == 1)
- data->type = body;
- else
- abort ();
- data->record.r.rlen = read_uleb128 (&ptr);
- return ptr;
- }
- abort ();
-}
-
-static void
-process_a_b_reg_code(unwind_record *data, unsigned char val)
-{
- int code = (val & 0x60) >> 5;
- int reg = (val & 0x1f);
- switch (code)
- {
- case 0:
- data->record.x.reg = GR_REG (reg);
- break;
- case 1:
- data->record.x.reg = FR_REG (reg);
- break;
- case 2:
- data->record.x.reg = BR_REG (reg);
- break;
- case 3:
- /* TODO. We need to encode the specialty regs here. The table is
- on page B-9 of the runtime manual (under the X1 description.) */
- break;
- }
-}
-
-static unsigned char *
-read_X_record (unwind_record *data, unsigned char val, unsigned char *ptr)
-{
- unsigned long tmp;
- int byte1, byte2;
- switch (val)
- {
- case UNW_X1:
- byte1 = *ptr++;
- data->record.x.t = read_uleb128 (&ptr);
- tmp = read_uleb128 (&ptr);
- if ((byte1 & 0x80) == 0)
- {
- data->type = spill_psprel;
- data->record.x.pspoff = tmp;
- }
- else
- {
- data->type = spill_sprel;
- data->record.x.spoff = tmp;
- }
- process_a_b_reg_code (data, byte1);
- return ptr;
- case UNW_X4:
- byte1 = *ptr++;
- data->record.x.qp = PR_REG (byte1 & 0x3f);
- data->type = spill_reg_p;
- case UNW_X2:
- {
- int xy;
- int treg;
- /* Only set type if we didn't fall through the UNW_X4 case. */
- if (val == UNW_X2)
- data->type = spill_reg;
- byte1 = *ptr++;
- byte2 = *ptr++;
- process_a_b_reg_code (data, byte1);
- xy = (((byte1 >> 7) << 1 ) | (byte2 >> 7));
- treg = (byte2 & 0x7f);
- switch (xy)
- {
- case 0:
- data->record.x.treg = GR_REG (treg);
- break;
- case 1:
- data->record.x.treg = FR_REG (treg);
- break;
- case 2:
- data->record.x.treg = BR_REG (treg);
- break;
- case 3:
- abort ();
- }
- data->record.x.t = read_uleb128 (&ptr);
- }
- return ptr;
- case UNW_X3:
- byte1 = *ptr++;
- byte2 = *ptr++;
- data->record.x.qp = PR_REG (byte1 & 0x3f);
- process_a_b_reg_code (data, byte2);
- data->record.x.t = read_uleb128 (&ptr);
- tmp = read_uleb128 (&ptr);
- if ((byte1 & 0x80) == 0)
- {
- data->type = spill_psprel_p;
- data->record.x.pspoff = tmp;
- }
- else
- {
- data->type = spill_sprel_p;
- data->record.x.spoff = tmp;
- }
- return ptr;
- default:
- abort ();
- }
- return NULL;
-}
-
-static unsigned char *
-read_B_record (unwind_record *data, unsigned char val, unsigned char *ptr)
-{
- if ((val & 0xc0) == 0x80)
- {
- /* B1 format. */
- if ((val & 0x20) == 0)
- data->type = label_state;
- else
- data->type = copy_state;
- data->record.b.label = (val & 0x1f);
- return ptr;
- }
-
- if ((val & 0xe0) == 0xc0)
- {
- /* B2 format. */
- data->type = epilogue;
- data->record.b.ecount = (val & 0x1f);
- data->record.b.t = read_uleb128 (&ptr);
- return ptr;
- }
-
- if (val == UNW_B3)
- {
- /* B3 format. */
- data->type = epilogue;
- data->record.b.t = read_uleb128 (&ptr);
- data->record.b.ecount = read_uleb128 (&ptr);
- return ptr;
- }
-
- if (val == UNW_B4)
- {
- /* B4 format, with r == 0. */
- data->type = label_state;
- data->record.b.label = read_uleb128 (&ptr);
- return ptr;
- }
-
- if (val == (UNW_B4 | 0x08))
- {
- /* B4 format, with r == 1. */
- data->type = copy_state;
- data->record.b.label = read_uleb128 (&ptr);
- return ptr;
- }
- abort ();
-}
-
-/* This array is used to set the TYPE field for format P3. */
-static unw_record_type const P3_record_types[] = {
- psp_gr, rp_gr, pfs_gr, preds_gr, unat_gr, lc_gr, rp_br, rnat_gr,
- bsp_gr, bspstore_gr, fpsr_gr, priunat_gr
-};
-
-/* This array is used to set the TYPE field for format P7. */
-static unw_record_type const P7_record_types[] = {
- mem_stack_f, mem_stack_v, spill_base, psp_sprel, rp_when, rp_psprel,
- pfs_when, pfs_psprel, preds_when, preds_psprel, lc_when, lc_psprel,
- unat_when, unat_psprel, fpsr_when, fpsr_psprel
-};
-
-/* These values and the array are used to determine which additional ULEB128
- fields are required for the P7 format. */
-#define P7_T_SIZE 0
-#define P7_T 1
-#define P7_PSPOFF 2
-#define P7_SPOFF 3
-static unsigned char const P7_additional_fields [] = {
- P7_T_SIZE, P7_T, P7_PSPOFF, P7_SPOFF, P7_T, P7_PSPOFF,
- P7_T, P7_PSPOFF, P7_T, P7_PSPOFF, P7_T, P7_PSPOFF, P7_T, P7_PSPOFF
-};
-
-/* This array is used to set the TYPE field for format P8.
- Note that entry 0 is not used in this array, so it is filled with
- rp_spel for completely arbitrary reasons. */
-static unw_record_type const P8_record_types[] = {
- rp_sprel, rp_sprel, pfs_sprel, preds_sprel, lc_sprel, unat_sprel, fpsr_sprel,
- bsp_when, bsp_psprel, bsp_sprel, bspstore_when, bspstore_psprel,
- bspstore_sprel, rnat_when, rnat_psprel, rnat_sprel, priunat_when_gr,
- priunat_psprel, priunat_sprel, priunat_when_mem
-};
-
-/* These values and the array are used to determine which additional ULEB128
- fields are required for the P8 format. */
-#define P8_T 0
-#define P8_PSPOFF 1
-#define P8_SPOFF 2
-static unsigned char const P8_additional_fields [] = {
- P8_SPOFF, P8_SPOFF, P8_SPOFF, P8_SPOFF, P8_SPOFF, P8_SPOFF,
- P8_T, P8_PSPOFF, P8_SPOFF, P8_T, P8_PSPOFF, P8_SPOFF,
- P8_T, P8_PSPOFF, P8_SPOFF, P8_T, P8_PSPOFF, P8_SPOFF, P8_T
-};
-
-
-static unsigned char *
-read_P_record (unwind_record *data, unsigned char val, unsigned char *ptr,
- unwind_record *header)
-{
- if ((val & 0xe0) == 0x80)
- {
- /* P1 format. */
- data->type = br_mem;
- data->record.p.brmask = (val & 0x1f);
- return ptr;
- }
-
- if ((val & 0xf0) == 0xa0)
- {
- /* P2 format. */
- int byte1;
- data->type = br_gr;
- byte1 = *ptr++;
- data->record.p.brmask = ((val & 0x0f) << 1) + (byte1 >> 7);
- data->record.p.gr = GR_REG (byte1 & 0x7f);
- return ptr;
- }
-
- if ((val & 0xf8) == 0xB0)
- {
- /* P3 format. */
- int byte1 = *ptr++;
- int r = ((val & 0x07) << 1) + (byte1 >> 7);
- data->type = P3_record_types[r];
- if (r == 6)
- data->record.p.br = BR_REG (byte1 & 0x7f);
- else
- data->record.p.gr = GR_REG (byte1 & 0x7f);
- if (r > 11)
- abort ();
- return ptr;
- }
-
- if (val == UNW_P4)
- {
- /* P4 format. */
- int size = (header->record.r.rlen * 2 + 7) / 8;
-
- data->type = spill_mask;
- data->record.p.imask = ptr;
- return ptr+size;
- }
-
- if (val == UNW_P5)
- {
- /* P5 format. */
- int byte1 = *ptr++;
- int byte2 = *ptr++;
- int byte3 = *ptr++;
- data->type = frgr_mem;
- data->record.p.grmask = (byte1 >> 4);
- data->record.p.frmask = ((byte1 & 0x0f) << 16) | (byte2 << 8) | byte3;
- return ptr;
- }
-
- if ((val & 0xe0) == UNW_P6)
- {
- /* P6 format. */
- if ((val & 0x10) == 0)
- data->type = fr_mem;
- else
- data->type = gr_mem;
- data->record.p.rmask = (val & 0x0f);
- return ptr;
- }
-
- if ((val & 0xf0) == UNW_P7)
- {
- /* P7 format. */
- int r = (val & 0x0f);
- data->type = P7_record_types[r];
- switch (P7_additional_fields[r])
- {
- case P7_T_SIZE:
- data->record.p.t = read_uleb128 (&ptr);
- data->record.p.size = read_uleb128 (&ptr) << 4;
- break;
- case P7_T:
- data->record.p.t = read_uleb128 (&ptr);
- break;
- case P7_PSPOFF:
- data->record.p.pspoff = read_uleb128 (&ptr);
- break;
- case P7_SPOFF:
- data->record.p.spoff = read_uleb128 (&ptr);
- break;
- }
- return ptr;
- }
-
- if (val == UNW_P8)
- {
- /* P8 format. */
- int r = *ptr++;
- data->type = P8_record_types[r];
- switch (P8_additional_fields[r])
- {
- case P8_T:
- data->record.p.t = read_uleb128 (&ptr);
- break;
- case P8_PSPOFF:
- data->record.p.pspoff = read_uleb128 (&ptr);
- break;
- case P8_SPOFF:
- data->record.p.spoff = read_uleb128 (&ptr);
- break;
- }
- return ptr;
- }
-
- if (val == UNW_P9)
- {
- /* P9 format. */
- int byte1 = *ptr++;
- int byte2 = *ptr++;
- data->type = gr_gr;
- data->record.p.grmask = (byte1 & 0x0f);
- data->record.p.gr = GR_REG (byte2 & 0x7f);
- return ptr;
- }
-
- if (val == UNW_P10)
- {
-#if 0
- /* P10 format. */
- int abi = ptr[0];
- int context = ptr[1];
- /* TODO. something about abi entries. */
-#endif
- return ptr + 2;
- }
-
- return ptr;
-}
-
-/* This routine will determine what type of record the memory pointer
- is refering to, and fill in the appropriate fields for that record type.
- HEADER is a pointer to the last region header unwind record.
- DATA is a pointer to an unwind record which will be filled in.
- PTR is a pointer to the current location in the unwind table where we
- will read the next record from.
- The return value is the start of the next record. */
-
-static unsigned char *
-get_unwind_record (unwind_record *header, unwind_record *data,
- unsigned char *ptr)
-{
- unsigned char val = *ptr++;
-
- if ((val & 0x80) == 0)
- return read_R_record (data, val, ptr);
-
- if (val == UNW_X1 || val == UNW_X2 || val == UNW_X3 || val == UNW_X4)
- return read_X_record (data, val, ptr);
-
- if (header->type != body)
- return read_P_record (data, val, ptr, header);
- else
- return read_B_record (data, val, ptr);
-}
-
-/* Frame processing routines. */
-
-/* Initialize a single register structure. */
-static inline void
-init_ia64_reg_loc (ia64_reg_loc *reg, short size)
-{
- reg->when = -1;
- reg->loc_type = IA64_UNW_LOC_TYPE_NONE;
- reg->l.mem = (void *)0;
- reg->reg_size = size;
-}
-
-/* Iniitialize an entire frame to the default of nothing. */
-static void
-init_ia64_unwind_frame (ia64_frame_state *frame)
-{
- int x;
-
- for (x = 0; x < 4; x++)
- init_ia64_reg_loc (&frame->gr[x], 8);
- for (x = 0; x < 20; x++)
- init_ia64_reg_loc (&frame->fr[x], 16);
- for (x = 0; x < 5; x++)
- init_ia64_reg_loc (&frame->br[x], 8);
-
- init_ia64_reg_loc (&frame->rp, 8);
- init_ia64_reg_loc (&frame->fpsr, 8);
- init_ia64_reg_loc (&frame->bsp, 8);
- init_ia64_reg_loc (&frame->bspstore, 8);
- init_ia64_reg_loc (&frame->rnat, 8);
- init_ia64_reg_loc (&frame->pfs, 8);
- init_ia64_reg_loc (&frame->unat, 8);
- init_ia64_reg_loc (&frame->lc, 8);
- init_ia64_reg_loc (&frame->pr, 8);
- init_ia64_reg_loc (&frame->priunat, 8);
- init_ia64_reg_loc (&frame->sp, 8);
- init_ia64_reg_loc (&frame->psp, 8);
- init_ia64_reg_loc (&frame->spill_base, 8);
-}
-
-/* This fuction will process a single descriptor.
- addr is a pointer to the descriptor record to read,
- frame is the current frame state structure, which will be
- modified to reflect this descriptor.
- len is the length of a prologue region, or -1 if it wasn't one.
- the return value is a pointer to the start of the next descriptor. */
-
-static void *
-execute_one_ia64_descriptor (void *addr, ia64_frame_state *frame, long *len)
-{
- /* The last region_header. Needed to distinguish between prologue and body
- descriptors. Also needed for length of P4 format. */
- static unwind_record region_header;
-
- unwind_record r;
- ia64_reg_loc *loc_ptr = NULL;
- int grmask = 0, frmask = 0;
-
- *len = -1;
- addr = get_unwind_record (&region_header, &r, addr);
-
- /* Process it in 2 phases, the first phase will either do the work,
- or set up a pointer to the records we care about
- (ie a special purpose ar perhaps, and the second will actually
- fill in the record. */
- switch (r.type)
- {
- case prologue:
- case body:
- *len = r.record.r.rlen;
- region_header = r;
- break;
- case prologue_gr:
- {
- int val, reg;
-
- *len = r.record.r.rlen;
- val = r.record.r.mask;
- reg = r.record.r.grsave;
- if (val & 0x08)
- {
- frame->rp.when = 0;
- frame->rp.loc_type = IA64_UNW_LOC_TYPE_GR;
- frame->rp.l.regno = reg++;
- }
- if (val & 0x04)
- {
- frame->pfs.when = 0;
- frame->pfs.loc_type = IA64_UNW_LOC_TYPE_GR;
- frame->pfs.l.regno = reg++;
- }
- if (val & 0x02)
- {
- frame->psp.when = 0;
- frame->psp.loc_type = IA64_UNW_LOC_TYPE_GR;
- frame->psp.l.regno = reg++;
- }
- if (val & 0x01)
- {
- frame->pr.when = 0;
- frame->pr.loc_type = IA64_UNW_LOC_TYPE_GR;
- frame->pr.l.regno = reg++;
- }
- region_header = r;
- break;
- }
- case mem_stack_f:
- frame->sp.l.offset = r.record.p.size;
- frame->sp.loc_type = IA64_UNW_LOC_TYPE_OFFSET;
- frame->sp.when = r.record.p.t;
- break;
- case mem_stack_v:
- frame->psp.when = r.record.p.t;
- break;
- case psp_gr:
- case psp_sprel:
- loc_ptr = &frame->psp;
- break;
- case rp_br:
- case rp_gr:
- case rp_when:
- case rp_psprel:
- case rp_sprel:
- loc_ptr = &frame->rp;
- break;
- case pfs_gr:
- case pfs_when:
- case pfs_psprel:
- case pfs_sprel:
- loc_ptr = &frame->pfs;
- break;
- case preds_gr:
- case preds_when:
- case preds_psprel:
- case preds_sprel:
- loc_ptr = &frame->pr;
- break;
- case unat_gr:
- case unat_when:
- case unat_psprel:
- case unat_sprel:
- loc_ptr = &frame->unat;
- break;
- case lc_gr:
- case lc_when:
- case lc_psprel:
- case lc_sprel:
- loc_ptr = &frame->lc;
- break;
- case fpsr_gr:
- case fpsr_when:
- case fpsr_psprel:
- case fpsr_sprel:
- loc_ptr = &frame->fpsr;
- break;
- case priunat_gr:
- case priunat_sprel:
- case priunat_when_gr:
- case priunat_when_mem:
- case priunat_psprel:
- loc_ptr = &frame->priunat;
- break;
- case bsp_gr:
- case bsp_sprel:
- case bsp_when:
- case bsp_psprel:
- loc_ptr = &frame->bsp;
- break;
- case bspstore_gr:
- case bspstore_sprel:
- case bspstore_when:
- case bspstore_psprel:
- loc_ptr = &frame->bspstore;
- break;
- case rnat_gr:
- case rnat_sprel:
- case rnat_when:
- case rnat_psprel:
- loc_ptr = &frame->rnat;
- break;
- case spill_base:
- loc_ptr = &frame->spill_base;
- break;
- case fr_mem:
- frmask = r.record.p.rmask;
- break;
- case gr_mem:
- grmask = r.record.p.rmask;
- break;
- case frgr_mem:
- frmask = r.record.p.frmask;
- grmask = r.record.p.grmask;
- break;
- case br_mem:
- {
- int x, mask = 0x01;
- int saved = r.record.p.brmask;
- for (x = 0; x < 5; x++)
- {
- if (saved & mask)
- frame->br[x].loc_type = IA64_UNW_LOC_TYPE_SPILLBASE;
- mask = mask << 1;
- }
- break;
- }
- case br_gr:
- {
- int x, mask = 0x01;
- int reg = r.record.p.gr;
- int saved = r.record.p.brmask;
- for (x = 0; x < 5; x++)
- {
- if (saved & mask)
- {
- frame->br[x].loc_type = IA64_UNW_LOC_TYPE_GR;
- frame->br[x].l.regno = reg++;
- }
- mask = mask << 1;
- }
- break;
- }
- case gr_gr:
- {
- int x, mask = 0x01;
- int reg = r.record.p.gr;
- int saved = r.record.p.grmask;
- for (x = 0; x < 4; x++)
- {
- if (saved & mask)
- {
- frame->br[x].loc_type = IA64_UNW_LOC_TYPE_GR;
- frame->br[x].l.regno = reg++;
- }
- mask = mask << 1;
- }
- break;
- }
- case spill_mask:
- /* TODO. */
- break;
- case epilogue:
- /* TODO. */
- break;
- case label_state:
- /* TODO. */
- break;
- case copy_state:
- /* TODO. */
- break;
- case spill_psprel:
- case spill_sprel:
- case spill_reg:
- case spill_psprel_p:
- case spill_sprel_p:
- case spill_reg_p:
- /* TODO. */
- break;
- default:
- abort ();
- break;
- }
-
- if (frmask)
- {
- int x, mask = 0x01;
- for (x = 0; x < 20; x++)
- {
- if (frmask & mask)
- frame->fr[x].loc_type = IA64_UNW_LOC_TYPE_SPILLBASE;
- mask = mask << 1;
- }
- }
-
- if (grmask)
- {
- int x, mask = 0x01;
- for (x = 0; x < 4; x++)
- {
- if (grmask & mask)
- frame->gr[x].loc_type = IA64_UNW_LOC_TYPE_SPILLBASE;
- mask = mask << 1;
- }
- }
-
- /* If there is more to do: */
- if (loc_ptr != NULL)
- switch (r.type)
- {
- case psp_gr:
- case rp_gr:
- case pfs_gr:
- case preds_gr:
- case unat_gr:
- case lc_gr:
- case fpsr_gr:
- case priunat_gr:
- case bsp_gr:
- case bspstore_gr:
- case rnat_gr:
- loc_ptr->loc_type = IA64_UNW_LOC_TYPE_GR;
- loc_ptr->l.regno = r.record.p.gr;
- break;
- case rp_br:
- loc_ptr->loc_type = IA64_UNW_LOC_TYPE_BR;
- loc_ptr->l.regno = r.record.p.br;
- break;
- case rp_when:
- case pfs_when:
- case preds_when:
- case unat_when:
- case lc_when:
- case fpsr_when:
- case priunat_when_gr:
- case priunat_when_mem:
- case bsp_when:
- case bspstore_when:
- case rnat_when:
- loc_ptr->when = r.record.p.t;
- break;
- case rp_psprel:
- case pfs_psprel:
- case preds_psprel:
- case unat_psprel:
- case lc_psprel:
- case fpsr_psprel:
- case priunat_psprel:
- case bsp_psprel:
- case bspstore_psprel:
- case rnat_psprel:
- case spill_base:
- loc_ptr->loc_type = IA64_UNW_LOC_TYPE_PSPOFF;
- loc_ptr->l.offset = r.record.p.pspoff;
- break;
- case psp_sprel:
- case rp_sprel:
- case pfs_sprel:
- case preds_sprel:
- case unat_sprel:
- case lc_sprel:
- case fpsr_sprel:
- case priunat_sprel:
- case bsp_sprel:
- case bspstore_sprel:
- case rnat_sprel:
- loc_ptr->loc_type = IA64_UNW_LOC_TYPE_SPOFF;
- loc_ptr->l.offset = r.record.p.spoff;
- break;
- default:
- abort ();
- break;
- }
- return addr;
-}
-
-
-#define IS_NaT_COLLECTION_ADDR(addr) ((((long)(addr) >> 3) & 0x3f) == 0x3f)
-
-/* Returns the address of the slot that's NSLOTS slots away from
- the address ADDR. NSLOTS may be positive or negative. */
-static void *
-rse_address_add(unsigned char *addr, int nslots)
-{
- unsigned char *new_addr;
- int mandatory_nat_slots = nslots / 63;
- int direction = nslots < 0 ? -1 : 1;
-
- new_addr = addr + 8 * (nslots + mandatory_nat_slots);
-
- if (((long)new_addr >> 9)
- != ((long)(addr + 8 * 64 * mandatory_nat_slots) >> 9))
- new_addr += 8 * direction;
-
- if (IS_NaT_COLLECTION_ADDR(new_addr))
- new_addr += 8 * direction;
-
- return new_addr;
-}
-
-
-/* Normalize a record to originate in either a register or memory
- location. */
-static void
-normalize_reg_loc (ia64_frame_state *frame, ia64_reg_loc *reg)
-{
- unsigned char *tmp;
- switch (reg->loc_type)
- {
- case IA64_UNW_LOC_TYPE_MEM:
- /* Already done. */
- break;
- case IA64_UNW_LOC_TYPE_GR:
- /* If the register its saved in is a LOCAL register, we know
- its actually in memory, so we'll pick it up from there. */
- if (reg->l.regno >= 32 && frame->my_bsp != 0)
- {
- /* Get from backing store. */
- tmp = rse_address_add(frame->my_bsp, reg->l.regno - 32);
- reg->l.mem = tmp;
- reg->loc_type = IA64_UNW_LOC_TYPE_MEM;
- }
- break;
- case IA64_UNW_LOC_TYPE_FR:
- /* If the register its saved in is a LOCAL register, we know
- its actually in memory, so we'll pick it up from there. */
- if (reg->l.regno >= 32)
- {
- /* TODO. get from backing store. */
- }
- break;
- case IA64_UNW_LOC_TYPE_BR:
- break;
- case IA64_UNW_LOC_TYPE_SPOFF:
- /* Offset from the stack pointer, calculate the memory address
- now. */
- tmp = (unsigned char *)frame->my_sp + reg->l.offset * 4;
- reg->l.mem = tmp;
- reg->loc_type = IA64_UNW_LOC_TYPE_MEM;
- break;
- case IA64_UNW_LOC_TYPE_PSPOFF:
- /* Actualy go get the value of the PSP add the offset, and thats
- the mem location we can find this value at. */
- tmp = (unsigned char *)frame->my_psp + 16 - reg->l.offset * 4;
- reg->l.mem = tmp;
- reg->loc_type = IA64_UNW_LOC_TYPE_MEM;
- break;
- case IA64_UNW_LOC_TYPE_SPILLBASE:
- /* located at the current spill base memory location, and we
- have to bump it as well. */
- reg->l.mem = frame->spill_base.l.mem;
- reg->loc_type = IA64_UNW_LOC_TYPE_MEM;
- frame->spill_base.l.mem += 8;
- break;
- }
-
-}
-
-/* This function looks at a reg_loc and determines if its going
- to be an executed record or not between time start and end.
- It is executed if it is exectued at START time. It is NOT
- executed if it happens at END time. */
-static void
-maybe_normalize_reg_loc (ia64_frame_state *frame, ia64_reg_loc *reg,
- long start, long end)
-{
- if (reg->loc_type != IA64_UNW_LOC_TYPE_NONE
- && reg->when >= start && reg->when < end)
- normalize_reg_loc (frame, reg);
-}
-
-
-/* Only works for 8 byte or less registers. */
-void *
-__get_real_reg_value (ia64_reg_loc *reg)
-{
- if (reg->loc_type == IA64_UNW_LOC_TYPE_MEM)
- return *((void **)(reg->l.mem));
-
- /* All registers should be in memory if we've saved them. Local
- registers will be in backing store. */
- abort ();
-}
-
-void
-__set_real_reg_value (ia64_reg_loc *reg, void *val)
-{
- if (reg->loc_type == IA64_UNW_LOC_TYPE_MEM)
- {
- void **ptr = reg->l.mem;
- *ptr = val;
- return;
- }
- abort ();
-}
-
-static void
-copy_reg_value (ia64_reg_loc *src, ia64_reg_loc *dest)
-{
- void **p = dest->l.mem;
- if (src->loc_type == IA64_UNW_LOC_TYPE_NONE)
- return;
-
- if (src->reg_size != dest->reg_size)
- abort ();
- if (src->reg_size <= 8)
- *p = __get_real_reg_value (src);
- else
- {
- void **d;
- if (src->reg_size > 16)
- abort ();
- if (dest->loc_type != IA64_UNW_LOC_TYPE_MEM)
- abort ();
- d = (void **)(dest->l.mem);
- *p++ = *d++;
- *p = *d;
- }
- return;
-}
-
-/* Copy the values of any relevant saved registers in one frame
- to another for unwinding. */
-void
-__copy_saved_reg_state (ia64_frame_state *dest, ia64_frame_state *src)
-{
- int x;
- for (x = 0; x < 4 ; x++)
- copy_reg_value (&src->gr[x], &dest->gr[x]);
- for (x = 0; x < 20 ; x++)
- copy_reg_value (&src->fr[x], &dest->fr[x]);
- for (x = 0; x < 5 ; x++)
- copy_reg_value (&src->br[x], &dest->br[x]);
-
- copy_reg_value (&src->fpsr, &dest->fpsr);
- copy_reg_value (&src->rnat, &dest->rnat);
- copy_reg_value (&src->unat, &dest->unat);
- copy_reg_value (&src->lc, &dest->lc);
- copy_reg_value (&src->pr, &dest->pr);
- copy_reg_value (&src->priunat, &dest->priunat);
- copy_reg_value (&src->pfs, &dest->pfs);
-}
-
-
-static void
-process_state_between (ia64_frame_state *frame, long start, long end)
-{
- int x;
- /* PSP, RP, SP, and PFS are handled seperately from here. */
-
- /* GR's, FR's and BR's are saved at an arbitrary point, so we
- should handle them at the very beginning. */
- /* ??? Err, no they aren't. There's the spill_mask record that
- tells us when each is processed. */
- if (start == 0)
- {
- for (x = 0; x < 4 ; x++)
- normalize_reg_loc (frame, &frame->gr[x]);
- for (x = 0; x < 20 ; x++)
- normalize_reg_loc (frame, &frame->fr[x]);
- for (x = 0; x < 5 ; x++)
- normalize_reg_loc (frame, &frame->br[x]);
- }
-
- maybe_normalize_reg_loc (frame, &frame->fpsr, start, end);
- maybe_normalize_reg_loc (frame, &frame->bsp, start, end);
- maybe_normalize_reg_loc (frame, &frame->bspstore, start, end);
- maybe_normalize_reg_loc (frame, &frame->rnat, start, end);
- maybe_normalize_reg_loc (frame, &frame->unat, start, end);
- maybe_normalize_reg_loc (frame, &frame->lc, start, end);
- maybe_normalize_reg_loc (frame, &frame->pr, start, end);
- maybe_normalize_reg_loc (frame, &frame->priunat, start, end);
-}
-
-/* This function will take a frame state, and translate all the location
- records into actual memory address, or register numbers, based on
- what the ia64_reg_loc fields require to actually go get the values.
- (ie, this translates SPOFF and PSPOFF, etc into MEM types.
- frame is the frame to be changed.
- unwind_time is the insn slot number we are unwinding to. Anything
- that has a WHEN record beyond this time is cleared since it
- isn't relevant. */
-static void
-frame_translate (ia64_frame_state *frame, long unwind_time)
-{
- /* ??? Is this supposed to mark the end of the stack? */
- if (frame->rp.loc_type == IA64_UNW_LOC_TYPE_NONE)
- return;
-
- /* At function entry, SP == PSP. */
- frame->my_psp = frame->my_sp;
- if (frame->psp.loc_type != IA64_UNW_LOC_TYPE_NONE)
- {
- /* We've saved a frame pointer somewhere. This will be the
- canonical PSP for the function. */
- normalize_reg_loc (frame, &frame->psp);
- if (frame->psp.when < unwind_time)
- frame->my_psp = __get_real_reg_value (&frame->psp);
- }
- else if (frame->sp.loc_type == IA64_UNW_LOC_TYPE_OFFSET)
- {
- /* We've a fixed sized stack frame. The PSP is at a known offset. */
-
- if (frame->sp.when < unwind_time)
- frame->my_psp = frame->my_sp + frame->sp.l.offset;
- }
- /* Otherwise the stack frame size was zero and no adjustment needed. */
-
- /* Find PFS, RP and the spill base. All of which might have
- addresses based off the PSP computed above. */
- normalize_reg_loc (frame, &frame->pfs);
- normalize_reg_loc (frame, &frame->rp);
-
- if (frame->spill_base.loc_type != IA64_UNW_LOC_TYPE_NONE)
- normalize_reg_loc (frame, &frame->spill_base);
- else
- {
- /* Otherwise we're supposed to infer it from the size of the
- saved GR/BR/FR registers, putting the top at psp+16. */
- long size = 0, i;
- for (i = 0; i < 4; ++i)
- if (frame->gr[i].when >= 0)
- size += 8;
- for (i = 0; i < 5; ++i)
- if (frame->br[i].when >= 0)
- size += 8;
- for (i = 0; i < 20; ++i)
- if (frame->fr[i].when >= 0)
- size += 16;
- frame->spill_base.l.mem = frame->my_psp + 16 - size;
- }
-
- /* If the SP is adjusted, process records up to where it
- is adjusted, then adjust it, then process the rest. */
- if (frame->sp.when >= 0)
- {
- process_state_between (frame, 0, frame->sp.when);
- if (frame->sp.loc_type != IA64_UNW_LOC_TYPE_OFFSET)
- abort ();
- frame->my_sp = frame->my_psp - frame->sp.l.offset;
- process_state_between (frame, frame->sp.when, unwind_time);
- }
- else
- process_state_between (frame, 0, unwind_time);
-}
-
-/* This function will set a frame_state with all the required fields
- from a functions unwind descriptors.
- pc is the location we need info up until (ie, the unwind point)
- frame is the frame_state structure to be set up.
- Returns a pointer to the unwind info pointer for the frame. */
-unwind_info_ptr *
-__build_ia64_frame_state (unsigned char *pc, ia64_frame_state *frame,
- void *bsp, void *sp, void **pc_base_ptr)
-{
- long len;
- int region_offset = 0;
- int last_region_size = 0;
- void *addr, *end;
- unwind_table_entry *entry;
- unsigned char *start_pc;
- void *pc_base;
- int pc_offset;
- struct unwind_info_ptr *unw_info_ptr;
-
- entry = __ia64_find_fde (pc, &pc_base);
- if (!entry)
- return 0;
-
- start_pc = pc_base + entry->start_offset;
- unw_info_ptr = ((struct unwind_info_ptr *)(pc_base + entry->unwind_offset));
- addr = unw_info_ptr->unwind_descriptors;
- end = addr + IA64_UNW_HDR_LENGTH (unw_info_ptr->header) * 8;
- pc_offset = (pc - start_pc) / 16 * 3;
-
- init_ia64_unwind_frame (frame);
- frame->my_bsp = bsp;
- frame->my_sp = sp;
-
- /* Stop when we get to the end of the descriptor list, or if we
- encounter a region whose initial offset is already past the
- PC we are unwinding too. */
-
- while (addr < end && pc_offset > region_offset)
- {
- /* First one must be a record header. */
- addr = execute_one_ia64_descriptor (addr, frame, &len);
- if (len > 0)
- {
- region_offset += last_region_size;
- last_region_size = len;
- }
- }
-
- /* Now we go get the actual values. */
- frame_translate (frame, pc_offset);
- if (pc_base_ptr)
- *pc_base_ptr = pc_base;
- return unw_info_ptr;
-}
-
-/* Given an unwind info pointer, return the personality routine. */
-void *
-__get_personality (unwind_info_ptr *ptr)
-{
- void **p;
-
- /* There is a personality routine only if one of the EHANDLER or UHANDLER
- bits is set. */
- if (! (IA64_UNW_HDR_FLAGS (ptr->header)
- & (IA64_UNW_EHANDLER|IA64_UNW_UHANDLER)))
- return 0;
-
- p = (void **) (ptr->unwind_descriptors
- + IA64_UNW_HDR_LENGTH (ptr->header) * 8);
- return *p;
-}
-
-/* Given an unwind info pointer, return the exception table. */
-void *
-__get_except_table (unwind_info_ptr *ptr)
-{
- void *table;
-
- /* If there is no personality, there is no handler data.
- There is a personality routine only if one of the EHANDLER or UHANDLER
- bits is set. */
- if (! (IA64_UNW_HDR_FLAGS (ptr->header)
- & (IA64_UNW_EHANDLER|IA64_UNW_UHANDLER)))
- return 0;
-
- table = (void *) (ptr->unwind_descriptors
- + IA64_UNW_HDR_LENGTH (ptr->header) * 8 + 8);
- return table;
-}
-
-/* Given a PFS value, and the current BSp, calculate the BSp of the caller. */
-void *
-__calc_caller_bsp (long pfs, unsigned char *bsp)
-{
- int size_of_locals;
-
- /* The PFS looks like : xxxx SOL:7 SOF:7. The SOF is bits 0-7 and SOL
- is bits 8-15. We only care about SOL. */
-
- size_of_locals = (pfs >> 7) & 0x7f;
- return rse_address_add (bsp, -size_of_locals);
-}
-
-static int
-ia64_backtrace_helper (void **array, ia64_frame_state *throw_frame,
- ia64_frame_state *frame, void *bsp, void *sp, int size)
-{
- void *throw_pc = __builtin_return_address (0);
- void *pc = NULL;
- int frame_count = 0;
- unwind_info_ptr *info;
-
- __builtin_ia64_flushrs (); /* Make the local register stacks available. */
-
- /* Start at our stack frame, get our state. */
- info = __build_ia64_frame_state (throw_pc, throw_frame, bsp, sp, NULL);
-
- *frame = *throw_frame;
-
- while (info && frame_count < size)
- {
- pc = array[frame_count++] = __get_real_reg_value (&frame->rp);
- --pc;
- bsp = __calc_caller_bsp
- ((long)__get_real_reg_value (&frame->pfs), frame->my_bsp);
- info = __build_ia64_frame_state (pc, frame, bsp, frame->my_psp, NULL);
- if (frame->rp.loc_type == IA64_UNW_LOC_TYPE_NONE) /* We've finished. */
- break;
- }
-
- return frame_count;
-}
-
-/* This is equivalent to glibc's backtrace(). */
-
-extern int __ia64_backtrace (void **array, int size);
-
-int
-__ia64_backtrace (void **array, int size)
-{
- register void *stack_pointer __asm__("r12");
- ia64_frame_state my_frame;
- ia64_frame_state originator; /* For the context handler is in. */
- void *bsp;
-
- /* Do any necessary initialization to access arbitrary stack frames.
- This forces gcc to save memory in our stack frame for saved
- registers. */
- __builtin_unwind_init ();
-
- bsp = __builtin_ia64_bsp ();
-
- return ia64_backtrace_helper (array, &my_frame, &originator, bsp,
- stack_pointer, size);
-}
diff --git a/gcc/config/ia64/freebsd.h b/gcc/config/ia64/freebsd.h
new file mode 100644
index 00000000000..534f95df382
--- /dev/null
+++ b/gcc/config/ia64/freebsd.h
@@ -0,0 +1,89 @@
+/* Definitions for Intel IA-64 running FreeBSD using the ELF format
+ Copyright (C) 2001 Free Software Foundation, Inc.
+ Contributed by David E. O'Brien <obrien@FreeBSD.org> and BSDi.
+
+This file is part of GNU CC.
+
+GNU CC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU CC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU CC; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+
+#undef LINK_SPEC
+#define LINK_SPEC \
+ "%{p:%e`-p' not supported; use `-pg' and gprof(1)} \
+ %{Wl,*:%*} \
+ %{assert*} %{R*} %{rpath*} %{defsym*} \
+ %{shared:-Bshareable %{h*} %{soname*}} \
+ %{symbolic:-Bsymbolic} \
+ %{!shared: \
+ %{!static: \
+ %{rdynamic:-export-dynamic} \
+ %{!dynamic-linker:-dynamic-linker /usr/libexec/ld-elf.so.1}} \
+ %{static:-Bstatic}}"
+
+#undef ASM_SPEC
+#define ASM_SPEC "-x %{mconstant-gp} %{mauto-pic}"
+
+
+/************************[ Target stuff ]***********************************/
+
+/* Define the actual types of some ANSI-mandated types.
+ Needs to agree with <machine/ansi.h>. GCC defaults come from c-decl.c,
+ c-common.c, and config/<arch>/<arch>.h. */
+
+/* Earlier headers may get this wrong for FreeBSD.
+ We use the GCC defaults instead. */
+#undef WCHAR_TYPE
+
+#undef WCHAR_UNSIGNED
+#define WCHAR_UNSIGNED 0
+
+#undef WCHAR_TYPE_SIZE
+#define WCHAR_TYPE_SIZE 32
+
+#undef TARGET_VERSION
+#define TARGET_VERSION fprintf (stderr, " (FreeBSD/IA-64 ELF)");
+
+#define TARGET_ELF 1
+
+#define DONT_USE_BUILTIN_SETJMP
+#define JMP_BUF_SIZE 76
+
+/* Output any profiling code before the prologue. */
+
+#undef PROFILE_BEFORE_PROLOGUE
+#define PROFILE_BEFORE_PROLOGUE 1
+
+/* A C statement or compound statement to output to FILE some assembler code to
+ call the profiling subroutine `mcount'. */
+
+#undef FUNCTION_PROFILER
+#define FUNCTION_PROFILER(FILE, LABELNO) \
+do { \
+ char buf[20]; \
+ ASM_GENERATE_INTERNAL_LABEL (buf, "LP", LABELNO); \
+ fputs ("\talloc out0 = ar.pfs, 8, 0, 4, 0\n", FILE); \
+ if (TARGET_AUTO_PIC) \
+ fputs ("\tmovl out3 = @gprel(", FILE); \
+ else \
+ fputs ("\taddl out3 = @ltoff(", FILE); \
+ assemble_name (FILE, buf); \
+ if (TARGET_AUTO_PIC) \
+ fputs (");;\n", FILE); \
+ else \
+ fputs ("), r1;;\n", FILE); \
+ fputs ("\tmov out1 = r1\n", FILE); \
+ fputs ("\tmov out2 = b0\n", FILE); \
+ fputs ("\tbr.call.sptk.many b0 = _mcount;;\n", FILE); \
+} while (0)
diff --git a/gcc/config/ia64/hpux.h b/gcc/config/ia64/hpux.h
new file mode 100644
index 00000000000..5d3ce676fae
--- /dev/null
+++ b/gcc/config/ia64/hpux.h
@@ -0,0 +1,97 @@
+/* Definitions of target machine GNU compiler. IA-64 version.
+ Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
+ Contributed by Steve Ellcey <sje@cup.hp.com> and
+ Reva Cuthbertson <reva@cup.hp.com>
+
+This file is part of GNU CC.
+
+GNU CC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU CC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU CC; see the file COPYING. If not, write to
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA. */
+
+/* This macro is a C statement to print on `stderr' a string describing the
+ particular machine description choice. */
+
+#define TARGET_VERSION fprintf (stderr, " (IA-64) HP-UX");
+
+#undef CPP_PREDEFINES
+#define CPP_PREDEFINES "\
+ -D__IA64__ -D__ia64 -D__ia64__ -D__hpux -D__hpux__ -Dhpux -Dunix \
+ -D__BIG_ENDIAN__ -D_LONGLONG -D__ELF__ \
+ -Asystem=hpux -Asystem=posix -Asystem=unix -Acpu=ia64 -Amachine=ia64 \
+ -D_UINT128_T"
+
+/* -D__fpreg=long double is needed to compensate for the lack of __fpreg
+ which is a primitive type in HP C but does not exist in GNU C. Same
+ for __float80 and __float128. These types appear in HP-UX header
+ files and so must have some definition. */
+
+#undef CPP_SPEC
+#define CPP_SPEC "\
+ %{mcpu=itanium:-D__itanium__} \
+ -D__LP64__ -D__LONG_MAX__=9223372036854775807L \
+ %{!ansi:%{!std=c*:%{!std=i*: -D_HPUX_SOURCE -D__STDC_EXT__}}} \
+ -D__fpreg=long\\ double \
+ -D__float80=long\\ double \
+ -D__float128=long\\ double"
+
+#undef ASM_SPEC
+#define ASM_SPEC "-x %{mconstant-gp} %{mauto-pic}"
+
+#undef ENDFILE_SPEC
+
+#undef STARTFILE_SPEC
+#ifdef CROSS_COMPILE
+#define STARTFILE_SPEC "%{!shared:crt0%O%s}"
+#else
+#define STARTFILE_SPEC "/usr/ccs/lib/hpux64/crt0%O"
+#endif
+
+#undef LINK_SPEC
+#define LINK_SPEC "\
+ +Accept TypeMismatch \
+ %{shared:-b} \
+ %{!shared: \
+ -u main \
+ %{!static: \
+ %{rdynamic:-export-dynamic}} \
+ %{static:-static}}"
+
+#undef LIB_SPEC
+#define LIB_SPEC "%{!shared:%{!symbolic:-lc}}"
+
+#define DONT_USE_BUILTIN_SETJMP
+#define JMP_BUF_SIZE (8 * 76)
+
+#undef CONST_SECTION_ASM_OP
+#define CONST_SECTION_ASM_OP "\t.section\t.rodata,\t\"a\",\t\"progbits\""
+
+#undef BITS_BIG_ENDIAN
+#define BITS_BIG_ENDIAN 1
+
+#undef TARGET_DEFAULT
+#define TARGET_DEFAULT (MASK_DWARF2_ASM | MASK_BIG_ENDIAN)
+
+/* We need this macro to output DWARF2 information correctly. The macro
+ is defined in dwarf2out.c, but it will not do section relative offsets
+ which messes up our ability to debug using gdb. */
+
+#undef ASM_OUTPUT_DWARF_OFFSET
+#define ASM_OUTPUT_DWARF_OFFSET(FILE,LABEL) \
+ do { \
+ fprintf ((FILE), "\t%s\t", UNALIGNED_OFFSET_ASM_OP); \
+ fprintf ((FILE), "@secrel("); \
+ assemble_name (FILE, LABEL); \
+ fprintf ((FILE), ")"); \
+ } while (0)
diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c
index 2eaafc7ca06..8430ec4beba 100644
--- a/gcc/config/ia64/ia64.c
+++ b/gcc/config/ia64/ia64.c
@@ -30,7 +30,6 @@ Boston, MA 02111-1307, USA. */
#include "real.h"
#include "insn-config.h"
#include "conditions.h"
-#include "insn-flags.h"
#include "output.h"
#include "insn-attr.h"
#include "flags.h"
@@ -92,6 +91,10 @@ static const char * const ia64_output_reg_names[8] =
/* String used with the -mfixed-range= option. */
const char *ia64_fixed_range_string;
+/* Determines whether we run our final scheduling pass or not. We always
+ avoid the normal second scheduling pass. */
+static int ia64_flag_schedule_insns2;
+
/* Variables which are this size or smaller are put in the sdata/sbss
sections. */
@@ -119,6 +122,7 @@ static void ia64_free_machine_status PARAMS ((struct function *));
static void emit_insn_group_barriers PARAMS ((FILE *, rtx));
static void emit_all_insn_group_barriers PARAMS ((FILE *, rtx));
static void emit_predicate_relation_info PARAMS ((void));
+static void process_epilogue PARAMS ((void));
static int process_set PARAMS ((FILE *, rtx));
static rtx ia64_expand_fetch_and_op PARAMS ((optab, enum machine_mode,
@@ -1214,7 +1218,10 @@ find_gr_spill (try_locals)
if (try_locals)
{
regno = current_frame_info.n_local_regs;
- if (regno < 80)
+ /* If there is a frame pointer, then we can't use loc79, because
+ that is HARD_FRAME_POINTER_REGNUM. In particular, see the
+ reg_name switching code in ia64_expand_prologue. */
+ if (regno < (80 - frame_pointer_needed))
{
current_frame_info.n_local_regs = regno + 1;
return LOC_REG (0) + regno;
@@ -1317,7 +1324,13 @@ ia64_compute_frame_size (size)
break;
current_frame_info.n_local_regs = regno - LOC_REG (0) + 1;
- if (cfun->machine->n_varargs > 0)
+ /* For functions marked with the syscall_linkage attribute, we must mark
+ all eight input registers as in use, so that locals aren't visible to
+ the caller. */
+
+ if (cfun->machine->n_varargs > 0
+ || lookup_attribute ("syscall_linkage",
+ TYPE_ATTRIBUTES (TREE_TYPE (current_function_decl))))
current_frame_info.n_input_regs = 8;
else
{
@@ -1381,10 +1394,15 @@ ia64_compute_frame_size (size)
if (frame_pointer_needed)
{
current_frame_info.reg_fp = find_gr_spill (1);
- /* We should have gotten at least LOC79, since that's what
- HARD_FRAME_POINTER_REGNUM is. */
+ /* If we did not get a register, then we take LOC79. This is guaranteed
+ to be free, even if regs_ever_live is already set, because this is
+ HARD_FRAME_POINTER_REGNUM. This requires incrementing n_local_regs,
+ as we don't count loc79 above. */
if (current_frame_info.reg_fp == 0)
- abort ();
+ {
+ current_frame_info.reg_fp = LOC_REG (79);
+ current_frame_info.n_local_regs++;
+ }
}
if (! current_function_is_leaf)
@@ -1868,6 +1886,10 @@ ia64_expand_prologue ()
/* Set the frame pointer register name. The regnum is logically loc79,
but of course we'll not have allocated that many locals. Rather than
worrying about renumbering the existing rtxs, we adjust the name. */
+ /* ??? This code means that we can never use one local register when
+ there is a frame pointer. loc79 gets wasted in this case, as it is
+ renamed to a register that will never be used. See also the try_locals
+ code in find_gr_spill. */
if (current_frame_info.reg_fp)
{
const char *tmp = reg_names[HARD_FRAME_POINTER_REGNUM];
@@ -2377,6 +2399,30 @@ ia64_expand_epilogue (sibcall_p)
if (! sibcall_p)
emit_jump_insn (gen_return_internal (gen_rtx_REG (DImode, BR_REG (0))));
+ else
+ {
+ int fp = GR_REG (2);
+ /* We need a throw away register here, r0 and r1 are reserved, so r2 is the
+ first available call clobbered register. If there was a frame_pointer
+ register, we may have swapped the names of r2 and HARD_FRAME_POINTER_REGNUM,
+ so we have to make sure we're using the string "r2" when emitting
+ the register name for the assmbler. */
+ if (current_frame_info.reg_fp && current_frame_info.reg_fp == GR_REG (2))
+ fp = HARD_FRAME_POINTER_REGNUM;
+
+ /* We must emit an alloc to force the input registers to become output
+ registers. Otherwise, if the callee tries to pass its parameters
+ through to another call without an intervening alloc, then these
+ values get lost. */
+ /* ??? We don't need to preserve all input registers. We only need to
+ preserve those input registers used as arguments to the sibling call.
+ It is unclear how to compute that number here. */
+ if (current_frame_info.n_input_regs != 0)
+ emit_insn (gen_alloc (gen_rtx_REG (DImode, fp),
+ GEN_INT (0), GEN_INT (0),
+ GEN_INT (current_frame_info.n_input_regs),
+ GEN_INT (0)));
+ }
}
/* Return 1 if br.ret can do all the work required to return from a
@@ -2430,6 +2476,10 @@ ia64_hard_regno_rename_ok (from, to)
if (PR_REGNO_P (from) && PR_REGNO_P (to))
return (from & 1) == (to & 1);
+ /* Reg 4 contains the saved gp; we can't reliably rename this. */
+ if (from == GR_REG (4) && current_function_calls_setjmp)
+ return 0;
+
return 1;
}
@@ -2449,7 +2499,7 @@ ia64_function_prologue (file, size)
current_frame_info.n_output_regs,
current_frame_info.n_rotate_regs);
- if (!flag_unwind_tables && (!flag_exceptions || exceptions_via_longjmp))
+ if (!flag_unwind_tables && (!flag_exceptions || USING_SJLJ_EXCEPTIONS))
return;
/* Emit the .prologue directive. */
@@ -2508,7 +2558,7 @@ void
ia64_output_end_prologue (file)
FILE *file;
{
- if (!flag_unwind_tables && (!flag_exceptions || exceptions_via_longjmp))
+ if (!flag_unwind_tables && (!flag_exceptions || USING_SJLJ_EXCEPTIONS))
return;
fputs ("\t.body\n", file);
@@ -2815,13 +2865,17 @@ ia64_function_arg (cum, mode, type, named, incoming)
adjusted/little endian. */
else if (byte_size - offset == 4)
gr_mode = SImode;
+ /* Complex floats need to have float mode. */
+ if (GET_MODE_CLASS (mode) == MODE_COMPLEX_FLOAT)
+ gr_mode = hfa_mode;
loc[i] = gen_rtx_EXPR_LIST (VOIDmode,
gen_rtx_REG (gr_mode, (basereg
+ int_regs)),
GEN_INT (offset));
offset += GET_MODE_SIZE (gr_mode);
- int_regs++;
+ int_regs += GET_MODE_SIZE (gr_mode) <= UNITS_PER_WORD
+ ? 1 : GET_MODE_SIZE (gr_mode) / UNITS_PER_WORD;
}
/* If we ended up using just one location, just return that one loc. */
@@ -3051,11 +3105,16 @@ ia64_return_in_memory (valtype)
{
enum machine_mode mode;
enum machine_mode hfa_mode;
- int byte_size;
+ HOST_WIDE_INT byte_size;
mode = TYPE_MODE (valtype);
- byte_size = ((mode == BLKmode)
- ? int_size_in_bytes (valtype) : GET_MODE_SIZE (mode));
+ byte_size = GET_MODE_SIZE (mode);
+ if (mode == BLKmode)
+ {
+ byte_size = int_size_in_bytes (valtype);
+ if (byte_size < 0)
+ return 1;
+ }
/* Hfa's with up to 8 elements are returned in the FP argument registers. */
@@ -3069,7 +3128,6 @@ ia64_return_in_memory (valtype)
else
return 0;
}
-
else if (byte_size > UNITS_PER_WORD * MAX_INT_RETURN_SLOTS)
return 1;
else
@@ -3693,6 +3751,9 @@ ia64_override_options ()
if (ia64_fixed_range_string)
fix_range (ia64_fixed_range_string);
+ ia64_flag_schedule_insns2 = flag_schedule_insns_after_reload;
+ flag_schedule_insns_after_reload = 0;
+
ia64_section_threshold = g_switch_set ? g_switch_value : IA64_DEFAULT_GVALUE;
init_machine_status = ia64_init_machine_status;
@@ -3789,6 +3850,11 @@ struct reg_write_state rws_sum[NUM_REGS];
stop bit is emitted. */
struct reg_write_state rws_insn[NUM_REGS];
+/* Indicates whether this is the first instruction after a stop bit,
+ in which case we don't need another stop bit. Without this, we hit
+ the abort in ia64_variable_issue when scheduling an alloc. */
+static int first_instruction;
+
/* Misc flags needed to compute RAW/WAW dependencies while we are traversing
RTL for one instruction. */
struct reg_flags
@@ -3805,6 +3871,8 @@ static void rws_update PARAMS ((struct reg_write_state *, int,
struct reg_flags, int));
static int rws_access_regno PARAMS ((int, struct reg_flags, int));
static int rws_access_reg PARAMS ((rtx, struct reg_flags, int));
+static void update_set_flags PARAMS ((rtx, struct reg_flags *, int *, rtx *));
+static int set_src_needs_barrier PARAMS ((rtx, struct reg_flags, int, rtx));
static int rtx_needs_barrier PARAMS ((rtx, struct reg_flags, int));
static void init_insn_group_barriers PARAMS ((void));
static int group_barrier_needed_p PARAMS ((rtx));
@@ -3973,6 +4041,132 @@ rws_access_reg (reg, flags, pred)
}
}
+/* Examine X, which is a SET rtx, and update the flags, the predicate, and
+ the condition, stored in *PFLAGS, *PPRED and *PCOND. */
+
+static void
+update_set_flags (x, pflags, ppred, pcond)
+ rtx x;
+ struct reg_flags *pflags;
+ int *ppred;
+ rtx *pcond;
+{
+ rtx src = SET_SRC (x);
+
+ *pcond = 0;
+
+ switch (GET_CODE (src))
+ {
+ case CALL:
+ return;
+
+ case IF_THEN_ELSE:
+ if (SET_DEST (x) == pc_rtx)
+ /* X is a conditional branch. */
+ return;
+ else
+ {
+ int is_complemented = 0;
+
+ /* X is a conditional move. */
+ rtx cond = XEXP (src, 0);
+ if (GET_CODE (cond) == EQ)
+ is_complemented = 1;
+ cond = XEXP (cond, 0);
+ if (GET_CODE (cond) != REG
+ && REGNO_REG_CLASS (REGNO (cond)) != PR_REGS)
+ abort ();
+ *pcond = cond;
+ if (XEXP (src, 1) == SET_DEST (x)
+ || XEXP (src, 2) == SET_DEST (x))
+ {
+ /* X is a conditional move that conditionally writes the
+ destination. */
+
+ /* We need another complement in this case. */
+ if (XEXP (src, 1) == SET_DEST (x))
+ is_complemented = ! is_complemented;
+
+ *ppred = REGNO (cond);
+ if (is_complemented)
+ ++*ppred;
+ }
+
+ /* ??? If this is a conditional write to the dest, then this
+ instruction does not actually read one source. This probably
+ doesn't matter, because that source is also the dest. */
+ /* ??? Multiple writes to predicate registers are allowed
+ if they are all AND type compares, or if they are all OR
+ type compares. We do not generate such instructions
+ currently. */
+ }
+ /* ... fall through ... */
+
+ default:
+ if (GET_RTX_CLASS (GET_CODE (src)) == '<'
+ && GET_MODE_CLASS (GET_MODE (XEXP (src, 0))) == MODE_FLOAT)
+ /* Set pflags->is_fp to 1 so that we know we're dealing
+ with a floating point comparison when processing the
+ destination of the SET. */
+ pflags->is_fp = 1;
+
+ /* Discover if this is a parallel comparison. We only handle
+ and.orcm and or.andcm at present, since we must retain a
+ strict inverse on the predicate pair. */
+ else if (GET_CODE (src) == AND)
+ pflags->is_and = 1;
+ else if (GET_CODE (src) == IOR)
+ pflags->is_or = 1;
+
+ break;
+ }
+}
+
+/* Subroutine of rtx_needs_barrier; this function determines whether the
+ source of a given SET rtx found in X needs a barrier. FLAGS and PRED
+ are as in rtx_needs_barrier. COND is an rtx that holds the condition
+ for this insn. */
+
+static int
+set_src_needs_barrier (x, flags, pred, cond)
+ rtx x;
+ struct reg_flags flags;
+ int pred;
+ rtx cond;
+{
+ int need_barrier = 0;
+ rtx dst;
+ rtx src = SET_SRC (x);
+
+ if (GET_CODE (src) == CALL)
+ /* We don't need to worry about the result registers that
+ get written by subroutine call. */
+ return rtx_needs_barrier (src, flags, pred);
+ else if (SET_DEST (x) == pc_rtx)
+ {
+ /* X is a conditional branch. */
+ /* ??? This seems redundant, as the caller sets this bit for
+ all JUMP_INSNs. */
+ flags.is_branch = 1;
+ return rtx_needs_barrier (src, flags, pred);
+ }
+
+ need_barrier = rtx_needs_barrier (src, flags, pred);
+
+ /* This instruction unconditionally uses a predicate register. */
+ if (cond)
+ need_barrier |= rws_access_reg (cond, flags, 0);
+
+ dst = SET_DEST (x);
+ if (GET_CODE (dst) == ZERO_EXTRACT)
+ {
+ need_barrier |= rtx_needs_barrier (XEXP (dst, 1), flags, pred);
+ need_barrier |= rtx_needs_barrier (XEXP (dst, 2), flags, pred);
+ dst = XEXP (dst, 0);
+ }
+ return need_barrier;
+}
+
/* Handle an access to rtx X of type FLAGS using predicate register PRED.
Return 1 is this access creates a dependency with an earlier instruction
in the same group. */
@@ -3988,7 +4182,6 @@ rtx_needs_barrier (x, flags, pred)
int need_barrier = 0;
const char *format_ptr;
struct reg_flags new_flags;
- rtx src, dst;
rtx cond = 0;
if (! x)
@@ -3998,95 +4191,14 @@ rtx_needs_barrier (x, flags, pred)
switch (GET_CODE (x))
{
- case SET:
- src = SET_SRC (x);
- switch (GET_CODE (src))
+ case SET:
+ update_set_flags (x, &new_flags, &pred, &cond);
+ need_barrier = set_src_needs_barrier (x, new_flags, pred, cond);
+ if (GET_CODE (SET_SRC (x)) != CALL)
{
- case CALL:
- /* We don't need to worry about the result registers that
- get written by subroutine call. */
- need_barrier = rtx_needs_barrier (src, flags, pred);
- return need_barrier;
-
- case IF_THEN_ELSE:
- if (SET_DEST (x) == pc_rtx)
- {
- /* X is a conditional branch. */
- /* ??? This seems redundant, as the caller sets this bit for
- all JUMP_INSNs. */
- new_flags.is_branch = 1;
- need_barrier = rtx_needs_barrier (src, new_flags, pred);
- return need_barrier;
- }
- else
- {
- /* X is a conditional move. */
- cond = XEXP (src, 0);
- if (GET_CODE (cond) == EQ)
- is_complemented = 1;
- cond = XEXP (cond, 0);
- if (GET_CODE (cond) != REG
- && REGNO_REG_CLASS (REGNO (cond)) != PR_REGS)
- abort ();
-
- if (XEXP (src, 1) == SET_DEST (x)
- || XEXP (src, 2) == SET_DEST (x))
- {
- /* X is a conditional move that conditionally writes the
- destination. */
-
- /* We need another complement in this case. */
- if (XEXP (src, 1) == SET_DEST (x))
- is_complemented = ! is_complemented;
-
- pred = REGNO (cond);
- if (is_complemented)
- ++pred;
- }
-
- /* ??? If this is a conditional write to the dest, then this
- instruction does not actually read one source. This probably
- doesn't matter, because that source is also the dest. */
- /* ??? Multiple writes to predicate registers are allowed
- if they are all AND type compares, or if they are all OR
- type compares. We do not generate such instructions
- currently. */
- }
- /* ... fall through ... */
-
- default:
- if (GET_RTX_CLASS (GET_CODE (src)) == '<'
- && GET_MODE_CLASS (GET_MODE (XEXP (src, 0))) == MODE_FLOAT)
- /* Set new_flags.is_fp to 1 so that we know we're dealing
- with a floating point comparison when processing the
- destination of the SET. */
- new_flags.is_fp = 1;
-
- /* Discover if this is a parallel comparison. We only handle
- and.orcm and or.andcm at present, since we must retain a
- strict inverse on the predicate pair. */
- else if (GET_CODE (src) == AND)
- new_flags.is_and = flags.is_and = 1;
- else if (GET_CODE (src) == IOR)
- new_flags.is_or = flags.is_or = 1;
-
- break;
- }
- need_barrier = rtx_needs_barrier (src, flags, pred);
-
- /* This instruction unconditionally uses a predicate register. */
- if (cond)
- need_barrier |= rws_access_reg (cond, flags, 0);
-
- dst = SET_DEST (x);
- if (GET_CODE (dst) == ZERO_EXTRACT)
- {
- need_barrier |= rtx_needs_barrier (XEXP (dst, 1), flags, pred);
- need_barrier |= rtx_needs_barrier (XEXP (dst, 2), flags, pred);
- dst = XEXP (dst, 0);
+ new_flags.is_write = 1;
+ need_barrier |= rtx_needs_barrier (SET_DEST (x), new_flags, pred);
}
- new_flags.is_write = 1;
- need_barrier |= rtx_needs_barrier (dst, new_flags, pred);
break;
case CALL:
@@ -4159,8 +4271,35 @@ rtx_needs_barrier (x, flags, pred)
case PARALLEL:
for (i = XVECLEN (x, 0) - 1; i >= 0; --i)
- if (rtx_needs_barrier (XVECEXP (x, 0, i), flags, pred))
- need_barrier = 1;
+ {
+ rtx pat = XVECEXP (x, 0, i);
+ if (GET_CODE (pat) == SET)
+ {
+ update_set_flags (pat, &new_flags, &pred, &cond);
+ need_barrier |= set_src_needs_barrier (pat, new_flags, pred, cond);
+ }
+ else if (GET_CODE (pat) == USE
+ || GET_CODE (pat) == CALL
+ || GET_CODE (pat) == ASM_OPERANDS)
+ need_barrier |= rtx_needs_barrier (pat, flags, pred);
+ else if (GET_CODE (pat) != CLOBBER && GET_CODE (pat) != RETURN)
+ abort ();
+ }
+ for (i = XVECLEN (x, 0) - 1; i >= 0; --i)
+ {
+ rtx pat = XVECEXP (x, 0, i);
+ if (GET_CODE (pat) == SET)
+ {
+ if (GET_CODE (SET_SRC (pat)) != CALL)
+ {
+ new_flags.is_write = 1;
+ need_barrier |= rtx_needs_barrier (SET_DEST (pat), new_flags,
+ pred);
+ }
+ }
+ else if (GET_CODE (pat) == CLOBBER || GET_CODE (pat) == RETURN)
+ need_barrier |= rtx_needs_barrier (pat, flags, pred);
+ }
break;
case SUBREG:
@@ -4277,14 +4416,18 @@ rtx_needs_barrier (x, flags, pred)
switch (XINT (x, 1))
{
case 0: /* alloc */
- /* Alloc must always be the first instruction. Currently, we
- only emit it at the function start, so we don't need to worry
- about emitting a stop bit before it. */
- need_barrier = rws_access_regno (AR_PFS_REGNUM, flags, pred);
+ /* Alloc must always be the first instruction of a group.
+ We force this by always returning true. */
+ /* ??? We might get better scheduling if we explicitly check for
+ input/local/output register dependencies, and modify the
+ scheduler so that alloc is always reordered to the start of
+ the current group. We could then eliminate all of the
+ first_instruction code. */
+ rws_access_regno (AR_PFS_REGNUM, flags, pred);
new_flags.is_write = 1;
- need_barrier |= rws_access_regno (REG_AR_CFM, new_flags, pred);
- return need_barrier;
+ rws_access_regno (REG_AR_CFM, new_flags, pred);
+ return 1;
case 1: /* blockage */
case 2: /* insn group barrier */
@@ -4353,11 +4496,9 @@ static void
init_insn_group_barriers ()
{
memset (rws_sum, 0, sizeof (rws_sum));
+ first_instruction = 1;
}
-/* Cumulative info for the current instruction group. */
-struct reg_write_state rws_sum[NUM_REGS];
-
/* Given the current state, recorded by previous calls to this function,
determine whether a group barrier (a stop bit) is necessary before INSN.
Return nonzero if so. */
@@ -4388,11 +4529,28 @@ group_barrier_needed_p (insn)
flags.is_branch = 1;
flags.is_sibcall = SIBLING_CALL_P (insn);
memset (rws_insn, 0, sizeof (rws_insn));
+
+ /* Don't bundle a call following another call. */
+ if ((pat = prev_active_insn (insn))
+ && GET_CODE (pat) == CALL_INSN)
+ {
+ need_barrier = 1;
+ break;
+ }
+
need_barrier = rtx_needs_barrier (PATTERN (insn), flags, 0);
break;
case JUMP_INSN:
flags.is_branch = 1;
+
+ /* Don't bundle a jump following a call. */
+ if ((pat = prev_active_insn (insn))
+ && GET_CODE (pat) == CALL_INSN)
+ {
+ need_barrier = 1;
+ break;
+ }
/* FALLTHRU */
case INSN:
@@ -4435,12 +4593,18 @@ group_barrier_needed_p (insn)
asm. */
if (! need_barrier)
need_barrier = rws_access_regno (REG_VOLATILE, flags, 0);
-
break;
default:
abort ();
}
+
+ if (first_instruction)
+ {
+ need_barrier = 0;
+ first_instruction = 0;
+ }
+
return need_barrier;
}
@@ -4451,10 +4615,17 @@ safe_group_barrier_needed_p (insn)
rtx insn;
{
struct reg_write_state rws_saved[NUM_REGS];
+ int saved_first_instruction;
int t;
+
memcpy (rws_saved, rws_sum, NUM_REGS * sizeof *rws_saved);
+ saved_first_instruction = first_instruction;
+
t = group_barrier_needed_p (insn);
+
memcpy (rws_sum, rws_saved, NUM_REGS * sizeof *rws_saved);
+ first_instruction = saved_first_instruction;
+
return t;
}
@@ -4511,9 +4682,10 @@ emit_insn_group_barriers (dump, insns)
INSN_UID (last_label));
emit_insn_before (gen_insn_group_barrier (GEN_INT (3)), last_label);
insn = last_label;
+
+ init_insn_group_barriers ();
+ last_label = 0;
}
- init_insn_group_barriers ();
- last_label = 0;
}
}
}
@@ -4752,9 +4924,7 @@ static int itanium_split_issue PARAMS ((const struct ia64_packet *, int));
static rtx ia64_single_set PARAMS ((rtx));
static int insn_matches_slot PARAMS ((const struct ia64_packet *, enum attr_type, int, rtx));
static void ia64_emit_insn_before PARAMS ((rtx, rtx));
-#if 0
-static rtx gen_nop_type PARAMS ((enum attr_type));
-#endif
+static void maybe_rotate PARAMS ((FILE *));
static void finish_last_head PARAMS ((FILE *, int));
static void rotate_one_bundle PARAMS ((FILE *));
static void rotate_two_bundles PARAMS ((FILE *));
@@ -5643,6 +5813,15 @@ ia64_sched_reorder (dump, sched_verbose, ready, pn_ready, reorder_type)
dump_current_packet (dump);
}
+ if (reorder_type == 0)
+ {
+ if (sched_data.cur == 6)
+ rotate_two_bundles (sched_verbose ? dump : NULL);
+ else if (sched_data.cur >= 3)
+ rotate_one_bundle (sched_verbose ? dump : NULL);
+ sched_data.first_slot = sched_data.cur;
+ }
+
/* First, move all USEs, CLOBBERs and other crud out of the way. */
highest = ready[n_ready - 1];
for (insnp = ready; insnp < e_ready; insnp++)
@@ -5716,15 +5895,6 @@ ia64_sched_reorder (dump, sched_verbose, ready, pn_ready, reorder_type)
}
}
- if (reorder_type == 0)
- {
- if (sched_data.cur == 6)
- rotate_two_bundles (sched_verbose ? dump : NULL);
- else if (sched_data.cur >= 3)
- rotate_one_bundle (sched_verbose ? dump : NULL);
- sched_data.first_slot = sched_data.cur;
- }
-
return itanium_reorder (sched_verbose ? dump : NULL,
ready, e_ready, reorder_type == 1);
}
@@ -5993,7 +6163,7 @@ ia64_reorg (insns)
find_basic_blocks (insns, max_reg_num (), NULL);
life_analysis (insns, NULL, PROP_DEATH_NOTES);
- if (optimize)
+ if (ia64_flag_schedule_insns2)
{
ia64_final_schedule = 1;
schedule_ebbs (rtl_dump_file);
@@ -6006,6 +6176,33 @@ ia64_reorg (insns)
else
emit_all_insn_group_barriers (rtl_dump_file, insns);
+ /* A call must not be the last instruction in a function, so that the
+ return address is still within the function, so that unwinding works
+ properly. Note that IA-64 differs from dwarf2 on this point. */
+ if (flag_unwind_tables || (flag_exceptions && !USING_SJLJ_EXCEPTIONS))
+ {
+ rtx insn;
+ int saw_stop = 0;
+
+ insn = get_last_insn ();
+ if (! INSN_P (insn))
+ insn = prev_active_insn (insn);
+ if (GET_CODE (insn) == INSN
+ && GET_CODE (PATTERN (insn)) == UNSPEC_VOLATILE
+ && XINT (PATTERN (insn), 1) == 2)
+ {
+ saw_stop = 1;
+ insn = prev_active_insn (insn);
+ }
+ if (GET_CODE (insn) == CALL_INSN)
+ {
+ if (! saw_stop)
+ emit_insn (gen_insn_group_barrier (GEN_INT (3)));
+ emit_insn (gen_break_f ());
+ emit_insn (gen_insn_group_barrier (GEN_INT (3)));
+ }
+ }
+
fixup_errata ();
emit_predicate_relation_info ();
}
@@ -6030,10 +6227,10 @@ ia64_epilogue_uses (regno)
registers are marked as live at all function exits. This prevents the
register allocator from using the input registers, which in turn makes it
possible to restart a system call after an interrupt without having to
- save/restore the input registers. */
+ save/restore the input registers. This also prevents kernel data from
+ leaking to application code. */
if (IN_REGNO_P (regno)
- && (regno < IN_REG (current_function_args_info.words))
&& lookup_attribute ("syscall_linkage",
TYPE_ATTRIBUTES (TREE_TYPE (current_function_decl))))
return 1;
@@ -6187,7 +6384,32 @@ ia64_encode_section_info (decl)
}
}
-/* Output assmebly directives for prologue regions. */
+/* Output assembly directives for prologue regions. */
+
+/* The current basic block number. */
+
+static int block_num;
+
+/* True if we need a copy_state command at the start of the next block. */
+
+static int need_copy_state;
+
+/* The function emits unwind directives for the start of an epilogue. */
+
+static void
+process_epilogue ()
+{
+ /* If this isn't the last block of the function, then we need to label the
+ current state, and copy it back in at the start of the next block. */
+
+ if (block_num != n_basic_blocks - 1)
+ {
+ fprintf (asm_out_file, "\t.label_state 1\n");
+ need_copy_state = 1;
+ }
+
+ fprintf (asm_out_file, "\t.restore sp\n");
+}
/* This function processes a SET pattern looking for specific patterns
which result in emitting an assembly directive required for unwinding. */
@@ -6235,14 +6457,14 @@ process_set (asm_out_file, pat)
fputc ('\n', asm_out_file);
}
else
- fprintf (asm_out_file, "\t.restore sp\n");
+ process_epilogue ();
}
else
abort ();
}
else if (GET_CODE (src) == REG
&& REGNO (src) == HARD_FRAME_POINTER_REGNUM)
- fprintf (asm_out_file, "\t.restore sp\n");
+ process_epilogue ();
else
abort ();
@@ -6413,12 +6635,28 @@ process_for_unwind_directive (asm_out_file, insn)
FILE *asm_out_file;
rtx insn;
{
- if ((flag_unwind_tables
- || (flag_exceptions && !exceptions_via_longjmp))
- && RTX_FRAME_RELATED_P (insn))
+ if (flag_unwind_tables
+ || (flag_exceptions && !USING_SJLJ_EXCEPTIONS))
{
rtx pat;
+ if (GET_CODE (insn) == NOTE
+ && NOTE_LINE_NUMBER (insn) == NOTE_INSN_BASIC_BLOCK)
+ {
+ block_num = NOTE_BASIC_BLOCK (insn)->index;
+
+ /* Restore unwind state from immediately before the epilogue. */
+ if (need_copy_state)
+ {
+ fprintf (asm_out_file, "\t.body\n");
+ fprintf (asm_out_file, "\t.copy_state 1\n");
+ need_copy_state = 0;
+ }
+ }
+
+ if (! RTX_FRAME_RELATED_P (insn))
+ return;
+
pat = find_reg_note (insn, REG_FRAME_RELATED_EXPR, NULL_RTX);
if (pat)
pat = XEXP (pat, 0);
diff --git a/gcc/config/ia64/ia64.h b/gcc/config/ia64/ia64.h
index f0cd62e1a96..3fccdf1f5df 100644
--- a/gcc/config/ia64/ia64.h
+++ b/gcc/config/ia64/ia64.h
@@ -31,11 +31,11 @@ Boston, MA 02111-1307, USA. */
/* Run-time target specifications */
-/* Define this to be a string constant containing `-D' options to define the
- predefined macros that identify this machine and system. These macros will
- be predefined unless the `-ansi' option is specified. */
-/* ??? This is undefed in svr4.h. */
-#define CPP_PREDEFINES "-Dia64 -Amachine=ia64"
+#define CPP_CPU_SPEC "\
+ -Acpu=ia64 -Amachine=ia64 \
+ %{!ansi:%{!std=c*:%{!std=i*:-Dia64}}} -D__ia64 -D__ia64__"
+
+#define CC1_SPEC "%(cc1_cpu) "
/* This declaration should be present. */
extern int target_flags;
@@ -169,11 +169,6 @@ extern const char *ia64_fixed_range_string;
N_("Specify range of registers to make fixed.")}, \
}
-/* This macro is a C statement to print on `stderr' a string describing the
- particular machine description choice. */
-
-#define TARGET_VERSION fprintf (stderr, " (IA-64)");
-
/* 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
@@ -201,6 +196,7 @@ extern const char *ia64_fixed_range_string;
defines in other tm.h files. */
#define CPP_SPEC \
"%{mcpu=itanium:-D__itanium__} %{mbig-endian:-D__BIG_ENDIAN__} \
+ %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} \
-D__LONG_MAX__=9223372036854775807L"
/* If this macro is defined, the preprocessor will not define the builtin macro
@@ -227,43 +223,14 @@ extern const char *ia64_fixed_range_string;
`cc1'. It can also specify how to translate options you give to GNU CC into
options for GNU CC to pass to the `cc1'. */
-/* #define CC1_SPEC "" */
+#undef CC1_SPEC
+#define CC1_SPEC "%{G*}"
/* A C string constant that tells the GNU CC driver program options to pass to
`cc1plus'. It can also specify how to translate options you give to GNU CC
into options for GNU CC to pass to the `cc1plus'. */
/* #define CC1PLUS_SPEC "" */
-
-/* A C string constant that tells the GNU CC driver program options to pass to
- the assembler. It can also specify how to translate options you give to GNU
- CC into options for GNU CC to pass to the assembler. */
-
-#if ((TARGET_CPU_DEFAULT | TARGET_DEFAULT) & MASK_GNU_AS) != 0
-/* GNU AS. */
-#define ASM_SPEC \
- "%{mno-gnu-as:-N so} %{!mno-gnu-as:-x} %{mconstant-gp} %{mauto-pic}"
-#else
-/* Intel ias. */
-#define ASM_SPEC \
- "%{!mgnu-as:-N so} %{mgnu-as:-x} %{mconstant-gp:-M const_gp}\
- %{mauto-pic:-M no_plabel}"
-#endif
-
-/* A C string constant that tells the GNU CC driver program options to pass to
- the linker. It can also specify how to translate options you give to GNU CC
- into options for GNU CC to pass to the linker. */
-
-/* The Intel linker does not support dynamic linking, so we need -dn.
- The Intel linker gives annoying messages unless -N so is used. */
-#if ((TARGET_CPU_DEFAULT | TARGET_DEFAULT) & MASK_GNU_LD) != 0
-/* GNU LD. */
-#define LINK_SPEC "%{mno-gnu-ld:-dn -N so}"
-#else
-/* Intel ild. */
-#define LINK_SPEC "%{!mgnu-ld:-dn -N so}"
-#endif
-
/* Storage Layout */
@@ -421,6 +388,13 @@ while (0)
If you do not define this macro, the default for `-fvtable-thunk' is 0. */
#define DEFAULT_VTABLE_THUNKS 1
+/* By default, the C++ compiler will use function addresses in the
+ vtable entries. Setting this non-zero tells the compiler to use
+ function descriptors instead. The value of this macro says how
+ many words wide the descriptor is (normally 2). It is assumed
+ that the address of a function descriptor may be treated as a
+ pointer to a function. */
+#define TARGET_VTABLE_USES_DESCRIPTORS 2
/* Layout of Source Language Data Types */
@@ -1382,11 +1356,15 @@ do { \
/* If defined, a C expression that gives the alignment boundary, in bits, of an
argument with the specified mode and type. */
-/* Arguments larger than 64 bits require 128 bit alignment. */
+/* Arguments with alignment larger than 8 bytes start at the next even
+ boundary. See ia64_function_arg. */
#define FUNCTION_ARG_BOUNDARY(MODE, TYPE) \
- (((((MODE) == BLKmode ? int_size_in_bytes (TYPE) : GET_MODE_SIZE (MODE)) \
- + UNITS_PER_WORD - 1) / UNITS_PER_WORD) > 1 ? 128 : PARM_BOUNDARY)
+ (((TYPE) ? (TYPE_ALIGN (TYPE) > 8 * BITS_PER_UNIT) \
+ : (((((MODE) == BLKmode \
+ ? int_size_in_bytes (TYPE) : GET_MODE_SIZE (MODE)) \
+ + UNITS_PER_WORD - 1) / UNITS_PER_WORD) > 1)) \
+ ? 128 : PARM_BOUNDARY)
/* 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
@@ -1518,6 +1496,17 @@ do { \
fprintf (FILE, "\n"); \
} while (0)
+/* 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) \
+do { \
+ if ((PART) == 0) \
+ { \
+ fputs ("\tdata16.ua @iplt(", FILE); \
+ assemble_name (FILE, XSTR (XEXP (DECL_RTL (DECL), 0), 0)); \
+ fputs (")\n", FILE); \
+ } \
+} while (0)
/* Generating Code for Profiling. */
@@ -1966,7 +1955,9 @@ do { \
that encode section info. */
#define STRIP_NAME_ENCODING(VAR, SYMBOL_NAME) \
- (VAR) = (SYMBOL_NAME) + ((SYMBOL_NAME)[0] == SDATA_NAME_FLAG_CHAR)
+ (VAR) = ((SYMBOL_NAME) \
+ + (*(SYMBOL_NAME) == '*' || *(SYMBOL_NAME) == SDATA_NAME_FLAG_CHAR))
+
/* Position Independent Code. */
@@ -2144,19 +2135,6 @@ do { \
} while (0)
-/* Output EH data to the unwind segment. */
-#define ASM_OUTPUT_EH_CHAR(FILE, VALUE) \
- ASM_OUTPUT_XDATA_CHAR(FILE, ".IA_64.unwind_info", VALUE)
-
-#define ASM_OUTPUT_EH_SHORT(FILE, VALUE) \
- ASM_OUTPUT_XDATA_SHORT(FILE, ".IA_64.unwind_info", VALUE)
-
-#define ASM_OUTPUT_EH_INT(FILE, VALUE) \
- ASM_OUTPUT_XDATA_INT(FILE, ".IA_64.unwind_info", VALUE)
-
-#define ASM_OUTPUT_EH_DOUBLE_INT(FILE, VALUE) \
- ASM_OUTPUT_XDATA_DOUBLE_INT(FILE, ".IA_64.unwind_info", VALUE)
-
/* A C statement to output to the stdio stream STREAM an assembler instruction
to assemble a single byte containing the number VALUE. */
@@ -2468,70 +2446,33 @@ do { \
/* Assembler Commands for Exception Regions. */
-/* ??? This entire section of ia64.h needs to be implemented and then cleaned
- up. */
-
-/* A C expression to output text to mark the start of an exception region.
-
- This macro need not be defined on most platforms. */
-/* #define ASM_OUTPUT_EH_REGION_BEG() */
-
-/* A C expression to output text to mark the end of an exception region.
-
- This macro need not be defined on most platforms. */
-/* #define ASM_OUTPUT_EH_REGION_END() */
-
-/* A C expression to switch to the section in which the main exception table is
- to be placed. The default is a section named `.gcc_except_table' on machines
- that support named sections via `ASM_OUTPUT_SECTION_NAME', otherwise if `-fpic'
- or `-fPIC' is in effect, the `data_section', otherwise the
- `readonly_data_section'. */
-/* #define EXCEPTION_SECTION() */
-
-/* If defined, a C string constant for the assembler operation to switch to the
- section for exception handling frame unwind information. If not defined,
- GNU CC will provide a default definition if the target supports named
- sections. `crtstuff.c' uses this macro to switch to the appropriate
- section.
-
- You should define this symbol if your target supports DWARF 2 frame unwind
- information and the default definition does not work. */
-#define EH_FRAME_SECTION_ASM_OP "\t.section\t.IA_64.unwind,\"aw\""
-
-/* A C expression that is nonzero if the normal exception table output should
- be omitted.
-
- This macro need not be defined on most platforms. */
-/* #define OMIT_EH_TABLE() */
-
-/* Alternate runtime support for looking up an exception at runtime and finding
- the associated handler, if the default method won't work.
-
- This macro need not be defined on most platforms. */
-/* #define EH_TABLE_LOOKUP() */
-
-/* A C expression that decides whether or not the current function needs to
- have a function unwinder generated for it. See the file `except.c' for
- details on when to define this, and how. */
-/* #define DOESNT_NEED_UNWINDER */
-
-/* An rtx used to mask the return address found via RETURN_ADDR_RTX, so that it
- does not contain any extraneous set bits in it. */
-/* #define MASK_RETURN_ADDR */
-
-/* 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
- `INCOMING_RETURN_ADDR_RTX' and either `UNALIGNED_INT_ASM_OP' or
- `OBJECT_FORMAT_ELF'), GCC will provide a default definition of 1.
-
- If this macro is defined to 1, the DWARF 2 unwinder will be the default
- exception handling mechanism; otherwise, setjmp/longjmp will be used by
- default.
-
- If this macro is defined to anything, the DWARF 2 unwinder will be used
- instead of inline unwinders and __unwind_function in the non-setjmp case. */
-/* #define DWARF2_UNWIND_INFO */
+/* Select a format to encode pointers in exception handling data. CODE
+ is 0 for data, 1 for code labels, 2 for function pointers. GLOBAL is
+ true if the symbol may be affected by dynamic relocations. */
+#define ASM_PREFERRED_EH_DATA_FORMAT(CODE,GLOBAL) \
+ (((CODE) == 1 ? DW_EH_PE_textrel : DW_EH_PE_datarel) \
+ | ((GLOBAL) ? DW_EH_PE_indirect : 0) | DW_EH_PE_udata8)
+
+/* Handle special EH pointer encodings. Absolute, pc-relative, and
+ indirect are handled automatically. */
+#define ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX(FILE, ENCODING, SIZE, ADDR, DONE) \
+ do { \
+ const char *reltag = NULL; \
+ if (((ENCODING) & 0xF0) == DW_EH_PE_textrel) \
+ reltag = "@segrel("; \
+ else if (((ENCODING) & 0xF0) == DW_EH_PE_datarel) \
+ reltag = "@gprel("; \
+ if (reltag) \
+ { \
+ fputs (((SIZE) == 4 ? UNALIGNED_INT_ASM_OP \
+ : (SIZE) == 8 ? UNALIGNED_DOUBLE_INT_ASM_OP \
+ : (abort (), "")), FILE); \
+ fputs (reltag, FILE); \
+ assemble_name (FILE, XSTR (ADDR, 0)); \
+ fputc (')', FILE); \
+ goto DONE; \
+ } \
+ } while (0)
/* Assembler Commands for Alignment. */
@@ -2838,9 +2779,10 @@ do { \
extern int ia64_final_schedule;
#define IA64_UNWIND_INFO 1
-#define HANDLER_SECTION fprintf (asm_out_file, "\t.personality\t__ia64_personality_v1\n\t.handlerdata\n");
#define IA64_UNWIND_EMIT(f,i) process_for_unwind_directive (f,i)
+#define EH_RETURN_DATA_REGNO(N) ((N) < 4 ? (N) + 15 : INVALID_REGNUM)
+
/* This function contains machine specific function data. */
struct machine_function
{
diff --git a/gcc/config/ia64/ia64.md b/gcc/config/ia64/ia64.md
index 7de8677ac21..c6ff9dd8d2f 100644
--- a/gcc/config/ia64/ia64.md
+++ b/gcc/config/ia64/ia64.md
@@ -71,6 +71,7 @@
;; 0 alloc
;; 1 blockage
;; 2 insn_group_barrier
+;; 3 break
;; 5 set_bsp
;; 8 pred.safe_across_calls all
;; 9 pred.safe_across_calls normal
@@ -707,9 +708,9 @@
if (GET_CODE (operands[1]) == CONST_DOUBLE)
{
emit_move_insn (gen_rtx_REG (DImode, REGNO (operands[0])),
- operand_subword (operands[1], 0, 0, DImode));
+ operand_subword (operands[1], 0, 0, TFmode));
emit_move_insn (gen_rtx_REG (DImode, REGNO (operands[0]) + 1),
- operand_subword (operands[1], 1, 0, DImode));
+ operand_subword (operands[1], 1, 0, TFmode));
DONE;
}
@@ -821,80 +822,40 @@
;; Convert between floating point types of different sizes.
+;; At first glance, it would appear that emitting fnorm for an extending
+;; conversion is unnecessary. However, the stf and getf instructions work
+;; correctly only if the input is properly rounded for its type. In
+;; particular, we get the wrong result for getf.d/stfd if the input is a
+;; denorm single. Since we don't know what the next instruction will be, we
+;; have to emit an fnorm.
+
;; ??? Optimization opportunity here. Get rid of the insn altogether
;; when we can. Should probably use a scheme like has been proposed
;; for ia32 in dealing with operands that match unary operators. This
-;; would let combine merge the thing into adjacent insns.
+;; would let combine merge the thing into adjacent insns. See also how the
+;; mips port handles SIGN_EXTEND as operands to integer arithmetic insns via
+;; se_register_operand.
-(define_insn_and_split "extendsfdf2"
- [(set (match_operand:DF 0 "grfr_nonimmediate_operand" "=f,f,f,f,m,*r")
- (float_extend:DF
- (match_operand:SF 1 "grfr_nonimmediate_operand" "0,f,m,*r,f,f")))]
+(define_insn "extendsfdf2"
+ [(set (match_operand:DF 0 "fr_register_operand" "=f")
+ (float_extend:DF (match_operand:SF 1 "fr_register_operand" "f")))]
""
- "@
- mov %0 = %1
- mov %0 = %1
- ldfs %0 = %1%P1
- setf.s %0 = %1
- stfd %0 = %1%P0
- getf.d %0 = %1"
- "reload_completed"
- [(set (match_dup 0) (float_extend:DF (match_dup 1)))]
- "
-{
- if (true_regnum (operands[0]) == true_regnum (operands[1]))
- {
- emit_insn (gen_movdi (pic_offset_table_rtx, pic_offset_table_rtx));
- DONE;
- }
-}"
- [(set_attr "itanium_class" "unknown,fmisc,fld,tofr,stf,frfr")])
+ "fnorm.d %0 = %1"
+ [(set_attr "itanium_class" "fmac")])
-(define_insn_and_split "extendsftf2"
- [(set (match_operand:TF 0 "fr_nonimmediate_operand" "=f,f,f,f,Q")
- (float_extend:TF
- (match_operand:SF 1 "grfr_nonimmediate_operand" "0,f,Q,*r,f")))]
+(define_insn "extendsftf2"
+ [(set (match_operand:TF 0 "fr_register_operand" "=f")
+ (float_extend:TF (match_operand:SF 1 "fr_register_operand" "f")))]
""
- "@
- mov %0 = %1
- mov %0 = %1
- ldfs %0 = %1%P1
- setf.s %0 = %1
- stfe %0 = %1%P0"
- "reload_completed"
- [(set (match_dup 0) (float_extend:TF (match_dup 1)))]
- "
-{
- if (true_regnum (operands[0]) == true_regnum (operands[1]))
- {
- emit_insn (gen_movdi (pic_offset_table_rtx, pic_offset_table_rtx));
- DONE;
- }
-}"
- [(set_attr "itanium_class" "unknown,fmisc,fld,frfr,stf")])
+ "fnorm %0 = %1"
+ [(set_attr "itanium_class" "fmac")])
-(define_insn_and_split "extenddftf2"
- [(set (match_operand:TF 0 "fr_nonimmediate_operand" "=f,f,f,f,Q")
- (float_extend:TF
- (match_operand:DF 1 "grfr_nonimmediate_operand" "0,f,Q,*r,f")))]
+(define_insn "extenddftf2"
+ [(set (match_operand:TF 0 "fr_register_operand" "=f")
+ (float_extend:TF (match_operand:DF 1 "fr_register_operand" "f")))]
""
- "@
- mov %0 = %1
- mov %0 = %1
- ldfd %0 = %1%P1
- setf.d %0 = %1
- stfe %0 = %1%P0"
- "reload_completed"
- [(set (match_dup 0) (float_extend:TF (match_dup 1)))]
- "
-{
- if (true_regnum (operands[0]) == true_regnum (operands[1]))
- {
- emit_insn (gen_movdi (pic_offset_table_rtx, pic_offset_table_rtx));
- DONE;
- }
-}"
- [(set_attr "itanium_class" "unknown,fmisc,fld,frfr,stf")])
+ "fnorm %0 = %1"
+ [(set_attr "itanium_class" "fmac")])
(define_insn "truncdfsf2"
[(set (match_operand:SF 0 "fr_register_operand" "=f")
@@ -1233,11 +1194,11 @@
""
"@
#
- tbit.z.and.orcm %0, %I0 = %2, 0
+ tbit.z.and.orcm %0, %I0 = %1, 0
andcm %0 = %2, %1"
"reload_completed
&& GET_CODE (operands[0]) == REG && PR_REGNO_P (REGNO (operands[0]))
- && GET_CODE (operands[2]) == REG && PR_REGNO_P (REGNO (operands[2]))"
+ && GET_CODE (operands[1]) == REG && PR_REGNO_P (REGNO (operands[1]))"
[(cond_exec (ne (match_dup 1) (const_int 0))
(set (match_dup 0) (and:BI (ne:BI (const_int 0) (const_int 0))
(match_dup 0))))]
@@ -1269,10 +1230,10 @@
""
"@
#
- tbit.z.or.andcm %0, %I0 = %2, 0"
+ tbit.z.or.andcm %0, %I0 = %1, 0"
"reload_completed
&& GET_CODE (operands[0]) == REG && PR_REGNO_P (REGNO (operands[0]))
- && GET_CODE (operands[2]) == REG && PR_REGNO_P (REGNO (operands[2]))"
+ && GET_CODE (operands[1]) == REG && PR_REGNO_P (REGNO (operands[1]))"
[(cond_exec (eq (match_dup 1) (const_int 0))
(set (match_dup 0) (ior:BI (eq:BI (const_int 0) (const_int 0))
(match_dup 0))))]
@@ -1297,7 +1258,6 @@
(clobber (match_scratch:BI 2 ""))]
"reload_completed
&& GET_CODE (operands[0]) == REG && PR_REGNO_P (REGNO (operands[0]))
- && GET_CODE (operands[1]) == REG && PR_REGNO_P (REGNO (operands[1]))
&& rtx_equal_p (operands[0], operands[1])"
[(set (match_dup 4) (match_dup 3))
(set (match_dup 0) (const_int 1))
@@ -4980,6 +4940,11 @@
[(set_attr "itanium_class" "stop_bit")
(set_attr "predicable" "no")])
+(define_insn "break_f"
+ [(unspec_volatile [(const_int 0)] 3)]
+ ""
+ "break.f 0"
+ [(set_attr "itanium_class" "nop_f")])
;; Non-local goto support.
@@ -5005,7 +4970,7 @@
"
{
emit_library_call (gen_rtx_SYMBOL_REF (Pmode, \"__ia64_nonlocal_goto\"),
- 0, VOIDmode, 3,
+ LCT_NORETURN, VOIDmode, 3,
operands[1], Pmode,
copy_to_reg (XEXP (operands[2], 0)), Pmode,
operands[3], Pmode);
@@ -5013,13 +4978,6 @@
DONE;
}")
-;; Restore the GP after the exception/longjmp. The preceeding call will
-;; have tucked it away.
-(define_expand "exception_receiver"
- [(set (reg:DI 1) (match_dup 0))]
- ""
- "operands[0] = ia64_gp_save_reg (0);")
-
;; The rest of the setjmp processing happens with the nonlocal_goto expander.
;; ??? This is not tested.
(define_expand "builtin_setjmp_setup"
diff --git a/gcc/config/ia64/lib1funcs.asm b/gcc/config/ia64/lib1funcs.asm
index 67f0a89ce61..75e79b0a0f7 100644
--- a/gcc/config/ia64/lib1funcs.asm
+++ b/gcc/config/ia64/lib1funcs.asm
@@ -17,27 +17,26 @@ __divtf3:
(p6) cmp.ne p7, p0 = r0, r0
.pred.rel.mutex p6, p7
(p6) fnma.s1 f11 = farg1, f10, f1
-(p6) fmpy.s1 f12 = farg0, f10
+(p6) fma.s1 f12 = farg0, f10, f0
;;
-(p6) fmpy.s1 f13 = f11, f11
+(p6) fma.s1 f13 = f11, f11, f0
(p6) fma.s1 f14 = f11, f11, f11
;;
(p6) fma.s1 f11 = f13, f13, f11
(p6) fma.s1 f13 = f14, f10, f10
;;
(p6) fma.s1 f10 = f13, f11, f10
-(p6) fnma.s1 f12 = farg1, f12, farg0
+(p6) fnma.s1 f11 = farg1, f12, farg0
;;
(p6) fma.s1 f11 = f11, f10, f12
-(p6) fnma.s1 f13 = farg1, f10, f1
+(p6) fnma.s1 f12 = farg1, f10, f1
;;
(p6) fma.s1 f10 = f12, f10, f10
(p6) fnma.s1 f12 = farg1, f11, farg0
;;
-(p6) fma fret0 = f12, f10, f11
+(p6) fma.s0 fret0 = f12, f10, f11
(p7) mov fret0 = f10
br.ret.sptk rp
- ;;
.endp __divtf3
#endif
diff --git a/gcc/config/ia64/libgcc-ia64.ver b/gcc/config/ia64/libgcc-ia64.ver
index a03799f0d09..2ffb6936864 100644
--- a/gcc/config/ia64/libgcc-ia64.ver
+++ b/gcc/config/ia64/libgcc-ia64.ver
@@ -5,4 +5,5 @@ GCC_3.0 {
__ia64_restore_stack_nonlocal
__ia64_save_stack_nonlocal
__ia64_trampoline
+ __ia64_backtrace
}
diff --git a/gcc/config/ia64/linux.h b/gcc/config/ia64/linux.h
index 35934e9ebee..0ddba0ca3f4 100644
--- a/gcc/config/ia64/linux.h
+++ b/gcc/config/ia64/linux.h
@@ -1,7 +1,13 @@
/* Definitions for ia64-linux target. */
-#include "ia64/ia64.h"
-#include <linux.h>
-#include "sysv4.h"
+
+/* This macro is a C statement to print on `stderr' a string describing the
+ particular machine description choice. */
+
+#define TARGET_VERSION fprintf (stderr, " (IA-64) Linux");
+
+/* This is for -profile to use -lc_p instead of -lc. */
+#undef CC1_SPEC
+#define CC1_SPEC "%{profile:-p} %{G*}"
/* ??? Maybe this should be in sysv4.h? */
#define CPP_PREDEFINES "\
diff --git a/gcc/config/ia64/sysv4.h b/gcc/config/ia64/sysv4.h
index f4e40754fb6..99f561cb7ab 100644
--- a/gcc/config/ia64/sysv4.h
+++ b/gcc/config/ia64/sysv4.h
@@ -133,13 +133,6 @@ while (0)
#undef WCHAR_TYPE_SIZE
#define WCHAR_TYPE_SIZE 32
-/* We don't want any symbol at the beginning of the file. This is defined in
- dbxelf.h which is included from elfos.h, so we need to undef/define it
- here. */
-
-#undef ASM_IDENTIFY_GCC
-#define ASM_IDENTIFY_GCC(FILE)
-
/* We redefine this to use the ia64 .proc pseudo-op. */
#undef ASM_DECLARE_FUNCTION_NAME
diff --git a/gcc/config/ia64/t-hpux b/gcc/config/ia64/t-hpux
new file mode 100644
index 00000000000..4aa43876eaf
--- /dev/null
+++ b/gcc/config/ia64/t-hpux
@@ -0,0 +1,6 @@
+# HP-UX gets an undefined main when building LIBGCC1_TEST because the
+# linkspec has "-u main" and we want that for linking but it makes
+# LIBGCC1_TEST fail because it uses -nostdlib -nostartup and main is
+# not defined in the test program.
+
+LIBGCC1_TEST =
diff --git a/gcc/config/ia64/t-ia64 b/gcc/config/ia64/t-ia64
index f27c72957d0..274f9a44826 100644
--- a/gcc/config/ia64/t-ia64
+++ b/gcc/config/ia64/t-ia64
@@ -41,5 +41,4 @@ crtendS.o: $(srcdir)/config/ia64/crtend.asm $(GCC_PASSES)
$(GCC_FOR_TARGET) -DSHARED -c -o crtendS.o -x assembler-with-cpp $(srcdir)/config/ia64/crtend.asm
EXTRA_HEADERS = $(srcdir)/config/ia64/ia64intrin.h
-LIB2ADDEH = $(srcdir)/config/ia64/frame-ia64.c
-
+LIB2ADDEH = $(srcdir)/config/ia64/unwind-ia64.c $(srcdir)/unwind-sjlj.c
diff --git a/gcc/config/ia64/unwind-ia64.c b/gcc/config/ia64/unwind-ia64.c
new file mode 100644
index 00000000000..15d668303e1
--- /dev/null
+++ b/gcc/config/ia64/unwind-ia64.c
@@ -0,0 +1,2015 @@
+/* Subroutines needed for unwinding IA-64 standard format stack frame
+ info for exception handling.
+ Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+ Contributed by Andrew MacLeod <amacleod@cygnus.com>
+ Andrew Haley <aph@cygnus.com>
+ David Mosberger-Tang <davidm@hpl.hp.com>
+
+ This file is part of GNU CC.
+
+ GNU CC is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ GNU CC is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GNU CC; see the file COPYING. If not, write to
+ the Free Software Foundation, 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+/* As a special exception, if you link this library with other files,
+ some of which are compiled with GCC, to produce an executable,
+ this library 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. */
+
+
+#include "tconfig.h"
+#include "tsystem.h"
+#include "unwind.h"
+#include "unwind-ia64.h"
+
+#if !USING_SJLJ_EXCEPTIONS
+
+#define inline
+
+#define UNW_VER(x) ((x) >> 48)
+#define UNW_FLAG_MASK 0x0000ffff00000000
+#define UNW_FLAG_OSMASK 0x0000f00000000000
+#define UNW_FLAG_EHANDLER(x) ((x) & 0x0000000100000000L)
+#define UNW_FLAG_UHANDLER(x) ((x) & 0x0000000200000000L)
+#define UNW_LENGTH(x) ((x) & 0x00000000ffffffffL)
+
+enum unw_application_register
+{
+ UNW_AR_BSP,
+ UNW_AR_BSPSTORE,
+ UNW_AR_PFS,
+ UNW_AR_RNAT,
+ UNW_AR_UNAT,
+ UNW_AR_LC,
+ UNW_AR_EC,
+ UNW_AR_FPSR,
+ UNW_AR_RSC,
+ UNW_AR_CCV
+};
+
+enum unw_register_index
+{
+ /* Primary UNAT. */
+ UNW_REG_PRI_UNAT_GR,
+ UNW_REG_PRI_UNAT_MEM,
+
+ /* Memory Stack. */
+ UNW_REG_PSP, /* previous memory stack pointer */
+
+ /* Register Stack. */
+ UNW_REG_BSP, /* register stack pointer */
+ UNW_REG_BSPSTORE,
+ UNW_REG_PFS, /* previous function state */
+ UNW_REG_RNAT,
+ /* Return Pointer. */
+ UNW_REG_RP,
+
+ /* Special preserved registers. */
+ UNW_REG_UNAT, UNW_REG_PR, UNW_REG_LC, UNW_REG_FPSR,
+
+ /* Non-stacked general registers. */
+ UNW_REG_R2,
+ UNW_REG_R4 = UNW_REG_R2 + 2,
+ UNW_REG_R7 = UNW_REG_R2 + 5,
+ UNW_REG_R31 = UNW_REG_R2 + 29,
+
+ /* Non-stacked floating point registers. */
+ UNW_REG_F2,
+ UNW_REG_F5 = UNW_REG_F2 + 3,
+ UNW_REG_F16 = UNW_REG_F2 + 14,
+ UNW_REG_F31 = UNW_REG_F2 + 29,
+
+ /* Branch registers. */
+ UNW_REG_B1,
+ UNW_REG_B5 = UNW_REG_B1 + 4,
+
+ UNW_NUM_REGS
+};
+
+enum unw_where
+{
+ UNW_WHERE_NONE, /* register isn't saved at all */
+ UNW_WHERE_GR, /* register is saved in a general register */
+ UNW_WHERE_FR, /* register is saved in a floating-point register */
+ UNW_WHERE_BR, /* register is saved in a branch register */
+ UNW_WHERE_SPREL, /* register is saved on memstack (sp-relative) */
+ UNW_WHERE_PSPREL, /* register is saved on memstack (psp-relative) */
+
+ /* At the end of each prologue these locations get resolved to
+ UNW_WHERE_PSPREL and UNW_WHERE_GR, respectively. */
+ UNW_WHERE_SPILL_HOME, /* register is saved in its spill home */
+ UNW_WHERE_GR_SAVE /* register is saved in next general register */
+};
+
+#define UNW_WHEN_NEVER 0x7fffffff
+
+struct unw_reg_info
+{
+ unsigned long val; /* save location: register number or offset */
+ enum unw_where where; /* where the register gets saved */
+ int when; /* when the register gets saved */
+};
+
+typedef struct unw_state_record
+{
+ unsigned int first_region : 1; /* is this the first region? */
+ unsigned int done : 1; /* are we done scanning descriptors? */
+ unsigned int any_spills : 1; /* got any register spills? */
+ unsigned int in_body : 1; /* are we inside a body? */
+
+ unsigned char *imask; /* imask of of spill_mask record or NULL */
+ unsigned long pr_val; /* predicate values */
+ unsigned long pr_mask; /* predicate mask */
+ long spill_offset; /* psp-relative offset for spill base */
+ int region_start;
+ int region_len;
+ int epilogue_start;
+ int epilogue_count;
+ int when_target;
+
+ unsigned char gr_save_loc; /* next general register to use for saving */
+ unsigned char return_link_reg; /* branch register for return link */
+
+ struct unw_reg_state {
+ struct unw_reg_state *next;
+ unsigned long label; /* label of this state record */
+ struct unw_reg_info reg[UNW_NUM_REGS];
+ } curr, *stack, *reg_state_list;
+
+ _Unwind_Personality_Fn personality;
+
+} _Unwind_FrameState;
+
+enum unw_nat_type
+{
+ UNW_NAT_NONE, /* NaT not represented */
+ UNW_NAT_VAL, /* NaT represented by NaT value (fp reg) */
+ UNW_NAT_MEMSTK, /* NaT value is in unat word at offset OFF */
+ UNW_NAT_REGSTK /* NaT is in rnat */
+};
+
+struct unw_stack
+{
+ unsigned long limit;
+ unsigned long top;
+};
+
+struct _Unwind_Context
+{
+ /* Initial frame info. */
+ unsigned long rnat; /* rse nat collection */
+ unsigned long regstk_top; /* bsp for first frame */
+
+ /* Current frame info. */
+ unsigned long bsp; /* backing store pointer value */
+ unsigned long sp; /* stack pointer value */
+ unsigned long psp; /* previous sp value */
+ unsigned long rp; /* return pointer */
+ unsigned long pr; /* predicate collection */
+
+ unsigned long region_start; /* start of unwind region */
+ unsigned long gp; /* global pointer value */
+ void *lsda; /* language specific data area */
+
+ /* Preserved state. */
+ unsigned long *bsp_loc; /* previous bsp save location */
+ unsigned long *bspstore_loc;
+ unsigned long *pfs_loc;
+ unsigned long *pri_unat_loc;
+ unsigned long *unat_loc;
+ unsigned long *lc_loc;
+ unsigned long *fpsr_loc;
+
+ unsigned long eh_data[4];
+
+ struct unw_ireg
+ {
+ unsigned long *loc;
+ struct unw_ireg_nat
+ {
+ enum unw_nat_type type : 3;
+ signed long off : 61; /* NaT word is at loc+nat.off */
+ } nat;
+ } ireg[32 - 2];
+
+ unsigned long *br_loc[6 - 1];
+ void *fr_loc[32 - 2];
+};
+
+typedef unsigned long unw_word;
+
+/* Implicit register save order. See section 11.4.2.3 Rules for Using
+ Unwind Descriptors, rule 3. */
+
+static unsigned char const save_order[] =
+{
+ UNW_REG_RP, UNW_REG_PFS, UNW_REG_PSP, UNW_REG_PR,
+ UNW_REG_UNAT, UNW_REG_LC, UNW_REG_FPSR, UNW_REG_PRI_UNAT_GR
+};
+
+
+#define MIN(X, Y) ((X) < (Y) ? (X) : (Y))
+
+/* Unwind decoder routines */
+
+static void
+push (struct unw_state_record *sr)
+{
+ struct unw_reg_state *rs;
+
+ rs = malloc (sizeof (struct unw_reg_state));
+ memcpy (rs, &sr->curr, sizeof (*rs));
+ rs->next = sr->stack;
+ sr->stack = rs;
+}
+
+static void
+pop (struct unw_state_record *sr)
+{
+ struct unw_reg_state *rs;
+
+ rs = sr->stack;
+ sr->stack = rs->next;
+ free (rs);
+}
+
+static enum unw_register_index __attribute__((const))
+decode_abreg (unsigned char abreg, int memory)
+{
+ switch (abreg)
+ {
+ case 0x04 ... 0x07: return UNW_REG_R4 + (abreg - 0x04);
+ case 0x22 ... 0x25: return UNW_REG_F2 + (abreg - 0x22);
+ case 0x30 ... 0x3f: return UNW_REG_F16 + (abreg - 0x30);
+ case 0x41 ... 0x45: return UNW_REG_B1 + (abreg - 0x41);
+ case 0x60: return UNW_REG_PR;
+ case 0x61: return UNW_REG_PSP;
+ case 0x62: return memory ? UNW_REG_PRI_UNAT_MEM : UNW_REG_PRI_UNAT_GR;
+ case 0x63: return UNW_REG_RP;
+ case 0x64: return UNW_REG_BSP;
+ case 0x65: return UNW_REG_BSPSTORE;
+ case 0x66: return UNW_REG_RNAT;
+ case 0x67: return UNW_REG_UNAT;
+ case 0x68: return UNW_REG_FPSR;
+ case 0x69: return UNW_REG_PFS;
+ case 0x6a: return UNW_REG_LC;
+ default:
+ abort ();
+ }
+}
+
+static void
+set_reg (struct unw_reg_info *reg, enum unw_where where,
+ int when, unsigned long val)
+{
+ reg->val = val;
+ reg->where = where;
+ if (reg->when == UNW_WHEN_NEVER)
+ reg->when = when;
+}
+
+static void
+alloc_spill_area (unsigned long *offp, unsigned long regsize,
+ struct unw_reg_info *lo, struct unw_reg_info *hi)
+{
+ struct unw_reg_info *reg;
+
+ for (reg = hi; reg >= lo; --reg)
+ {
+ if (reg->where == UNW_WHERE_SPILL_HOME)
+ {
+ reg->where = UNW_WHERE_PSPREL;
+ reg->val = 0x10 - *offp;
+ *offp += regsize;
+ }
+ }
+}
+
+static inline void
+spill_next_when (struct unw_reg_info **regp, struct unw_reg_info *lim,
+ unw_word t)
+{
+ struct unw_reg_info *reg;
+
+ for (reg = *regp; reg <= lim; ++reg)
+ {
+ if (reg->where == UNW_WHERE_SPILL_HOME)
+ {
+ reg->when = t;
+ *regp = reg + 1;
+ return;
+ }
+ }
+ /* Excess spill. */
+ abort ();
+}
+
+static void
+finish_prologue (struct unw_state_record *sr)
+{
+ struct unw_reg_info *reg;
+ unsigned long off;
+ int i;
+
+ /* First, resolve implicit register save locations
+ (see Section "11.4.2.3 Rules for Using Unwind Descriptors", rule 3). */
+
+ for (i = 0; i < (int) sizeof(save_order); ++i)
+ {
+ reg = sr->curr.reg + save_order[i];
+ if (reg->where == UNW_WHERE_GR_SAVE)
+ {
+ reg->where = UNW_WHERE_GR;
+ reg->val = sr->gr_save_loc++;
+ }
+ }
+
+ /* Next, compute when the fp, general, and branch registers get saved.
+ This must come before alloc_spill_area() because we need to know
+ which registers are spilled to their home locations. */
+ if (sr->imask)
+ {
+ static unsigned char const limit[3] = {
+ UNW_REG_F31, UNW_REG_R7, UNW_REG_B5
+ };
+
+ unsigned char kind, mask = 0, *cp = sr->imask;
+ int t;
+ struct unw_reg_info *(regs[3]);
+
+ regs[0] = sr->curr.reg + UNW_REG_F2;
+ regs[1] = sr->curr.reg + UNW_REG_R4;
+ regs[2] = sr->curr.reg + UNW_REG_B1;
+
+ for (t = 0; t < sr->region_len; ++t)
+ {
+ if ((t & 3) == 0)
+ mask = *cp++;
+ kind = (mask >> 2*(3-(t & 3))) & 3;
+ if (kind > 0)
+ spill_next_when(&regs[kind - 1], sr->curr.reg + limit[kind - 1],
+ sr->region_start + t);
+ }
+ }
+
+ /* Next, lay out the memory stack spill area. */
+ if (sr->any_spills)
+ {
+ off = sr->spill_offset;
+ alloc_spill_area(&off, 16, sr->curr.reg + UNW_REG_F2,
+ sr->curr.reg + UNW_REG_F31);
+ alloc_spill_area(&off, 8, sr->curr.reg + UNW_REG_B1,
+ sr->curr.reg + UNW_REG_B5);
+ alloc_spill_area(&off, 8, sr->curr.reg + UNW_REG_R4,
+ sr->curr.reg + UNW_REG_R7);
+ }
+}
+
+/*
+ * Region header descriptors.
+ */
+
+static void
+desc_prologue (int body, unw_word rlen, unsigned char mask,
+ unsigned char grsave, struct unw_state_record *sr)
+{
+ int i;
+
+ if (!(sr->in_body || sr->first_region))
+ finish_prologue(sr);
+ sr->first_region = 0;
+
+ /* Check if we're done. */
+ if (body && sr->when_target < sr->region_start + sr->region_len)
+ {
+ sr->done = 1;
+ return;
+ }
+
+ for (i = 0; i < sr->epilogue_count; ++i)
+ pop(sr);
+ sr->epilogue_count = 0;
+ sr->epilogue_start = UNW_WHEN_NEVER;
+
+ if (!body)
+ push(sr);
+
+ sr->region_start += sr->region_len;
+ sr->region_len = rlen;
+ sr->in_body = body;
+
+ if (!body)
+ {
+ for (i = 0; i < 4; ++i)
+ {
+ if (mask & 0x8)
+ set_reg (sr->curr.reg + save_order[i], UNW_WHERE_GR,
+ sr->region_start + sr->region_len - 1, grsave++);
+ mask <<= 1;
+ }
+ sr->gr_save_loc = grsave;
+ sr->any_spills = 0;
+ sr->imask = 0;
+ sr->spill_offset = 0x10; /* default to psp+16 */
+ }
+}
+
+/*
+ * Prologue descriptors.
+ */
+
+static inline void
+desc_abi (unsigned char abi __attribute__((unused)),
+ unsigned char context __attribute__((unused)),
+ struct unw_state_record *sr __attribute__((unused)))
+{
+ /* Anything to do? */
+}
+
+static inline void
+desc_br_gr (unsigned char brmask, unsigned char gr,
+ struct unw_state_record *sr)
+{
+ int i;
+
+ for (i = 0; i < 5; ++i)
+ {
+ if (brmask & 1)
+ set_reg (sr->curr.reg + UNW_REG_B1 + i, UNW_WHERE_GR,
+ sr->region_start + sr->region_len - 1, gr++);
+ brmask >>= 1;
+ }
+}
+
+static inline void
+desc_br_mem (unsigned char brmask, struct unw_state_record *sr)
+{
+ int i;
+
+ for (i = 0; i < 5; ++i)
+ {
+ if (brmask & 1)
+ {
+ set_reg (sr->curr.reg + UNW_REG_B1 + i, UNW_WHERE_SPILL_HOME,
+ sr->region_start + sr->region_len - 1, 0);
+ sr->any_spills = 1;
+ }
+ brmask >>= 1;
+ }
+}
+
+static inline void
+desc_frgr_mem (unsigned char grmask, unw_word frmask,
+ struct unw_state_record *sr)
+{
+ int i;
+
+ for (i = 0; i < 4; ++i)
+ {
+ if ((grmask & 1) != 0)
+ {
+ set_reg (sr->curr.reg + UNW_REG_R4 + i, UNW_WHERE_SPILL_HOME,
+ sr->region_start + sr->region_len - 1, 0);
+ sr->any_spills = 1;
+ }
+ grmask >>= 1;
+ }
+ for (i = 0; i < 20; ++i)
+ {
+ if ((frmask & 1) != 0)
+ {
+ set_reg (sr->curr.reg + UNW_REG_F2 + i, UNW_WHERE_SPILL_HOME,
+ sr->region_start + sr->region_len - 1, 0);
+ sr->any_spills = 1;
+ }
+ frmask >>= 1;
+ }
+}
+
+static inline void
+desc_fr_mem (unsigned char frmask, struct unw_state_record *sr)
+{
+ int i;
+
+ for (i = 0; i < 4; ++i)
+ {
+ if ((frmask & 1) != 0)
+ {
+ set_reg (sr->curr.reg + UNW_REG_F2 + i, UNW_WHERE_SPILL_HOME,
+ sr->region_start + sr->region_len - 1, 0);
+ sr->any_spills = 1;
+ }
+ frmask >>= 1;
+ }
+}
+
+static inline void
+desc_gr_gr (unsigned char grmask, unsigned char gr,
+ struct unw_state_record *sr)
+{
+ int i;
+
+ for (i = 0; i < 4; ++i)
+ {
+ if ((grmask & 1) != 0)
+ set_reg (sr->curr.reg + UNW_REG_R4 + i, UNW_WHERE_GR,
+ sr->region_start + sr->region_len - 1, gr++);
+ grmask >>= 1;
+ }
+}
+
+static inline void
+desc_gr_mem (unsigned char grmask, struct unw_state_record *sr)
+{
+ int i;
+
+ for (i = 0; i < 4; ++i)
+ {
+ if ((grmask & 1) != 0)
+ {
+ set_reg (sr->curr.reg + UNW_REG_R4 + i, UNW_WHERE_SPILL_HOME,
+ sr->region_start + sr->region_len - 1, 0);
+ sr->any_spills = 1;
+ }
+ grmask >>= 1;
+ }
+}
+
+static inline void
+desc_mem_stack_f (unw_word t, unw_word size, struct unw_state_record *sr)
+{
+ set_reg (sr->curr.reg + UNW_REG_PSP, UNW_WHERE_NONE,
+ sr->region_start + MIN ((int)t, sr->region_len - 1), 16*size);
+}
+
+static inline void
+desc_mem_stack_v (unw_word t, struct unw_state_record *sr)
+{
+ sr->curr.reg[UNW_REG_PSP].when
+ = sr->region_start + MIN ((int)t, sr->region_len - 1);
+}
+
+static inline void
+desc_reg_gr (unsigned char reg, unsigned char dst, struct unw_state_record *sr)
+{
+ set_reg (sr->curr.reg + reg, UNW_WHERE_GR,
+ sr->region_start + sr->region_len - 1, dst);
+}
+
+static inline void
+desc_reg_psprel (unsigned char reg, unw_word pspoff,
+ struct unw_state_record *sr)
+{
+ set_reg (sr->curr.reg + reg, UNW_WHERE_PSPREL,
+ sr->region_start + sr->region_len - 1,
+ 0x10 - 4*pspoff);
+}
+
+static inline void
+desc_reg_sprel (unsigned char reg, unw_word spoff, struct unw_state_record *sr)
+{
+ set_reg (sr->curr.reg + reg, UNW_WHERE_SPREL,
+ sr->region_start + sr->region_len - 1,
+ 4*spoff);
+}
+
+static inline void
+desc_rp_br (unsigned char dst, struct unw_state_record *sr)
+{
+ sr->return_link_reg = dst;
+}
+
+static inline void
+desc_reg_when (unsigned char regnum, unw_word t, struct unw_state_record *sr)
+{
+ struct unw_reg_info *reg = sr->curr.reg + regnum;
+
+ if (reg->where == UNW_WHERE_NONE)
+ reg->where = UNW_WHERE_GR_SAVE;
+ reg->when = sr->region_start + MIN ((int)t, sr->region_len - 1);
+}
+
+static inline void
+desc_spill_base (unw_word pspoff, struct unw_state_record *sr)
+{
+ sr->spill_offset = 0x10 - 4*pspoff;
+}
+
+static inline unsigned char *
+desc_spill_mask (unsigned char *imaskp, struct unw_state_record *sr)
+{
+ sr->imask = imaskp;
+ return imaskp + (2*sr->region_len + 7)/8;
+}
+
+/*
+ * Body descriptors.
+ */
+static inline void
+desc_epilogue (unw_word t, unw_word ecount, struct unw_state_record *sr)
+{
+ sr->epilogue_start = sr->region_start + sr->region_len - 1 - t;
+ sr->epilogue_count = ecount + 1;
+}
+
+static inline void
+desc_copy_state (unw_word label, struct unw_state_record *sr)
+{
+ struct unw_reg_state *rs;
+
+ for (rs = sr->reg_state_list; rs; rs = rs->next)
+ {
+ if (rs->label == label)
+ {
+ memcpy (&sr->curr, rs, sizeof(sr->curr));
+ return;
+ }
+ }
+ abort ();
+}
+
+static inline void
+desc_label_state (unw_word label, struct unw_state_record *sr)
+{
+ struct unw_reg_state *rs;
+
+ rs = malloc (sizeof (struct unw_reg_state));
+ memcpy (rs, &sr->curr, sizeof (*rs));
+ rs->label = label;
+ rs->next = sr->reg_state_list;
+ sr->reg_state_list = rs;
+}
+
+/*
+ * General descriptors.
+ */
+
+static inline int
+desc_is_active (unsigned char qp, unw_word t, struct unw_state_record *sr)
+{
+ if (sr->when_target <= sr->region_start + MIN ((int)t, sr->region_len - 1))
+ return 0;
+ if (qp > 0)
+ {
+ if ((sr->pr_val & (1UL << qp)) == 0)
+ return 0;
+ sr->pr_mask |= (1UL << qp);
+ }
+ return 1;
+}
+
+static inline void
+desc_restore_p (unsigned char qp, unw_word t, unsigned char abreg,
+ struct unw_state_record *sr)
+{
+ struct unw_reg_info *r;
+
+ if (! desc_is_active (qp, t, sr))
+ return;
+
+ r = sr->curr.reg + decode_abreg (abreg, 0);
+ r->where = UNW_WHERE_NONE;
+ r->when = sr->region_start + MIN ((int)t, sr->region_len - 1);
+ r->val = 0;
+}
+
+static inline void
+desc_spill_reg_p (unsigned char qp, unw_word t, unsigned char abreg,
+ unsigned char x, unsigned char ytreg,
+ struct unw_state_record *sr)
+{
+ enum unw_where where = UNW_WHERE_GR;
+ struct unw_reg_info *r;
+
+ if (! desc_is_active (qp, t, sr))
+ return;
+
+ if (x)
+ where = UNW_WHERE_BR;
+ else if (ytreg & 0x80)
+ where = UNW_WHERE_FR;
+
+ r = sr->curr.reg + decode_abreg (abreg, 0);
+ r->where = where;
+ r->when = sr->region_start + MIN ((int)t, sr->region_len - 1);
+ r->val = ytreg & 0x7f;
+}
+
+static inline void
+desc_spill_psprel_p (unsigned char qp, unw_word t, unsigned char abreg,
+ unw_word pspoff, struct unw_state_record *sr)
+{
+ struct unw_reg_info *r;
+
+ if (! desc_is_active (qp, t, sr))
+ return;
+
+ r = sr->curr.reg + decode_abreg (abreg, 1);
+ r->where = UNW_WHERE_PSPREL;
+ r->when = sr->region_start + MIN((int)t, sr->region_len - 1);
+ r->val = 0x10 - 4*pspoff;
+}
+
+static inline void
+desc_spill_sprel_p (unsigned char qp, unw_word t, unsigned char abreg,
+ unw_word spoff, struct unw_state_record *sr)
+{
+ struct unw_reg_info *r;
+
+ if (! desc_is_active (qp, t, sr))
+ return;
+
+ r = sr->curr.reg + decode_abreg (abreg, 1);
+ r->where = UNW_WHERE_SPREL;
+ r->when = sr->region_start + MIN ((int)t, sr->region_len - 1);
+ r->val = 4*spoff;
+}
+
+
+#define UNW_DEC_BAD_CODE(code) abort ();
+
+/* Region headers. */
+#define UNW_DEC_PROLOGUE_GR(fmt,r,m,gr,arg) desc_prologue(0,r,m,gr,arg)
+#define UNW_DEC_PROLOGUE(fmt,b,r,arg) desc_prologue(b,r,0,32,arg)
+
+/* Prologue descriptors. */
+#define UNW_DEC_ABI(fmt,a,c,arg) desc_abi(a,c,arg)
+#define UNW_DEC_BR_GR(fmt,b,g,arg) desc_br_gr(b,g,arg)
+#define UNW_DEC_BR_MEM(fmt,b,arg) desc_br_mem(b,arg)
+#define UNW_DEC_FRGR_MEM(fmt,g,f,arg) desc_frgr_mem(g,f,arg)
+#define UNW_DEC_FR_MEM(fmt,f,arg) desc_fr_mem(f,arg)
+#define UNW_DEC_GR_GR(fmt,m,g,arg) desc_gr_gr(m,g,arg)
+#define UNW_DEC_GR_MEM(fmt,m,arg) desc_gr_mem(m,arg)
+#define UNW_DEC_MEM_STACK_F(fmt,t,s,arg) desc_mem_stack_f(t,s,arg)
+#define UNW_DEC_MEM_STACK_V(fmt,t,arg) desc_mem_stack_v(t,arg)
+#define UNW_DEC_REG_GR(fmt,r,d,arg) desc_reg_gr(r,d,arg)
+#define UNW_DEC_REG_PSPREL(fmt,r,o,arg) desc_reg_psprel(r,o,arg)
+#define UNW_DEC_REG_SPREL(fmt,r,o,arg) desc_reg_sprel(r,o,arg)
+#define UNW_DEC_REG_WHEN(fmt,r,t,arg) desc_reg_when(r,t,arg)
+#define UNW_DEC_PRIUNAT_WHEN_GR(fmt,t,arg) desc_reg_when(UNW_REG_PRI_UNAT_GR,t,arg)
+#define UNW_DEC_PRIUNAT_WHEN_MEM(fmt,t,arg) desc_reg_when(UNW_REG_PRI_UNAT_MEM,t,arg)
+#define UNW_DEC_PRIUNAT_GR(fmt,r,arg) desc_reg_gr(UNW_REG_PRI_UNAT_GR,r,arg)
+#define UNW_DEC_PRIUNAT_PSPREL(fmt,o,arg) desc_reg_psprel(UNW_REG_PRI_UNAT_MEM,o,arg)
+#define UNW_DEC_PRIUNAT_SPREL(fmt,o,arg) desc_reg_sprel(UNW_REG_PRI_UNAT_MEM,o,arg)
+#define UNW_DEC_RP_BR(fmt,d,arg) desc_rp_br(d,arg)
+#define UNW_DEC_SPILL_BASE(fmt,o,arg) desc_spill_base(o,arg)
+#define UNW_DEC_SPILL_MASK(fmt,m,arg) (m = desc_spill_mask(m,arg))
+
+/* Body descriptors. */
+#define UNW_DEC_EPILOGUE(fmt,t,c,arg) desc_epilogue(t,c,arg)
+#define UNW_DEC_COPY_STATE(fmt,l,arg) desc_copy_state(l,arg)
+#define UNW_DEC_LABEL_STATE(fmt,l,arg) desc_label_state(l,arg)
+
+/* General unwind descriptors. */
+#define UNW_DEC_SPILL_REG_P(f,p,t,a,x,y,arg) desc_spill_reg_p(p,t,a,x,y,arg)
+#define UNW_DEC_SPILL_REG(f,t,a,x,y,arg) desc_spill_reg_p(0,t,a,x,y,arg)
+#define UNW_DEC_SPILL_PSPREL_P(f,p,t,a,o,arg) desc_spill_psprel_p(p,t,a,o,arg)
+#define UNW_DEC_SPILL_PSPREL(f,t,a,o,arg) desc_spill_psprel_p(0,t,a,o,arg)
+#define UNW_DEC_SPILL_SPREL_P(f,p,t,a,o,arg) desc_spill_sprel_p(p,t,a,o,arg)
+#define UNW_DEC_SPILL_SPREL(f,t,a,o,arg) desc_spill_sprel_p(0,t,a,o,arg)
+#define UNW_DEC_RESTORE_P(f,p,t,a,arg) desc_restore_p(p,t,a,arg)
+#define UNW_DEC_RESTORE(f,t,a,arg) desc_restore_p(0,t,a,arg)
+
+
+/*
+ * Generic IA-64 unwind info decoder.
+ *
+ * This file is used both by the Linux kernel and objdump. Please keep
+ * the copies of this file in sync.
+ *
+ * You need to customize the decoder by defining the following
+ * macros/constants before including this file:
+ *
+ * Types:
+ * unw_word Unsigned integer type with at least 64 bits
+ *
+ * Register names:
+ * UNW_REG_BSP
+ * UNW_REG_BSPSTORE
+ * UNW_REG_FPSR
+ * UNW_REG_LC
+ * UNW_REG_PFS
+ * UNW_REG_PR
+ * UNW_REG_RNAT
+ * UNW_REG_PSP
+ * UNW_REG_RP
+ * UNW_REG_UNAT
+ *
+ * Decoder action macros:
+ * UNW_DEC_BAD_CODE(code)
+ * UNW_DEC_ABI(fmt,abi,context,arg)
+ * UNW_DEC_BR_GR(fmt,brmask,gr,arg)
+ * UNW_DEC_BR_MEM(fmt,brmask,arg)
+ * UNW_DEC_COPY_STATE(fmt,label,arg)
+ * UNW_DEC_EPILOGUE(fmt,t,ecount,arg)
+ * UNW_DEC_FRGR_MEM(fmt,grmask,frmask,arg)
+ * UNW_DEC_FR_MEM(fmt,frmask,arg)
+ * UNW_DEC_GR_GR(fmt,grmask,gr,arg)
+ * UNW_DEC_GR_MEM(fmt,grmask,arg)
+ * UNW_DEC_LABEL_STATE(fmt,label,arg)
+ * UNW_DEC_MEM_STACK_F(fmt,t,size,arg)
+ * UNW_DEC_MEM_STACK_V(fmt,t,arg)
+ * UNW_DEC_PRIUNAT_GR(fmt,r,arg)
+ * UNW_DEC_PRIUNAT_WHEN_GR(fmt,t,arg)
+ * UNW_DEC_PRIUNAT_WHEN_MEM(fmt,t,arg)
+ * UNW_DEC_PRIUNAT_WHEN_PSPREL(fmt,pspoff,arg)
+ * UNW_DEC_PRIUNAT_WHEN_SPREL(fmt,spoff,arg)
+ * UNW_DEC_PROLOGUE(fmt,body,rlen,arg)
+ * UNW_DEC_PROLOGUE_GR(fmt,rlen,mask,grsave,arg)
+ * UNW_DEC_REG_PSPREL(fmt,reg,pspoff,arg)
+ * UNW_DEC_REG_REG(fmt,src,dst,arg)
+ * UNW_DEC_REG_SPREL(fmt,reg,spoff,arg)
+ * UNW_DEC_REG_WHEN(fmt,reg,t,arg)
+ * UNW_DEC_RESTORE(fmt,t,abreg,arg)
+ * UNW_DEC_RESTORE_P(fmt,qp,t,abreg,arg)
+ * UNW_DEC_SPILL_BASE(fmt,pspoff,arg)
+ * UNW_DEC_SPILL_MASK(fmt,imaskp,arg)
+ * UNW_DEC_SPILL_PSPREL(fmt,t,abreg,pspoff,arg)
+ * UNW_DEC_SPILL_PSPREL_P(fmt,qp,t,abreg,pspoff,arg)
+ * UNW_DEC_SPILL_REG(fmt,t,abreg,x,ytreg,arg)
+ * UNW_DEC_SPILL_REG_P(fmt,qp,t,abreg,x,ytreg,arg)
+ * UNW_DEC_SPILL_SPREL(fmt,t,abreg,spoff,arg)
+ * UNW_DEC_SPILL_SPREL_P(fmt,qp,t,abreg,pspoff,arg)
+ */
+
+static unw_word
+unw_decode_uleb128 (unsigned char **dpp)
+{
+ unsigned shift = 0;
+ unw_word byte, result = 0;
+ unsigned char *bp = *dpp;
+
+ while (1)
+ {
+ byte = *bp++;
+ result |= (byte & 0x7f) << shift;
+ if ((byte & 0x80) == 0)
+ break;
+ shift += 7;
+ }
+ *dpp = bp;
+ return result;
+}
+
+static unsigned char *
+unw_decode_x1 (unsigned char *dp,
+ unsigned char code __attribute__((unused)),
+ void *arg)
+{
+ unsigned char byte1, abreg;
+ unw_word t, off;
+
+ byte1 = *dp++;
+ t = unw_decode_uleb128 (&dp);
+ off = unw_decode_uleb128 (&dp);
+ abreg = (byte1 & 0x7f);
+ if (byte1 & 0x80)
+ UNW_DEC_SPILL_SPREL(X1, t, abreg, off, arg);
+ else
+ UNW_DEC_SPILL_PSPREL(X1, t, abreg, off, arg);
+ return dp;
+}
+
+static unsigned char *
+unw_decode_x2 (unsigned char *dp,
+ unsigned char code __attribute__((unused)),
+ void *arg)
+{
+ unsigned char byte1, byte2, abreg, x, ytreg;
+ unw_word t;
+
+ byte1 = *dp++; byte2 = *dp++;
+ t = unw_decode_uleb128 (&dp);
+ abreg = (byte1 & 0x7f);
+ ytreg = byte2;
+ x = (byte1 >> 7) & 1;
+ if ((byte1 & 0x80) == 0 && ytreg == 0)
+ UNW_DEC_RESTORE(X2, t, abreg, arg);
+ else
+ UNW_DEC_SPILL_REG(X2, t, abreg, x, ytreg, arg);
+ return dp;
+}
+
+static unsigned char *
+unw_decode_x3 (unsigned char *dp,
+ unsigned char code __attribute__((unused)),
+ void *arg)
+{
+ unsigned char byte1, byte2, abreg, qp;
+ unw_word t, off;
+
+ byte1 = *dp++; byte2 = *dp++;
+ t = unw_decode_uleb128 (&dp);
+ off = unw_decode_uleb128 (&dp);
+
+ qp = (byte1 & 0x3f);
+ abreg = (byte2 & 0x7f);
+
+ if (byte1 & 0x80)
+ UNW_DEC_SPILL_SPREL_P(X3, qp, t, abreg, off, arg);
+ else
+ UNW_DEC_SPILL_PSPREL_P(X3, qp, t, abreg, off, arg);
+ return dp;
+}
+
+static unsigned char *
+unw_decode_x4 (unsigned char *dp,
+ unsigned char code __attribute__((unused)),
+ void *arg)
+{
+ unsigned char byte1, byte2, byte3, qp, abreg, x, ytreg;
+ unw_word t;
+
+ byte1 = *dp++; byte2 = *dp++; byte3 = *dp++;
+ t = unw_decode_uleb128 (&dp);
+
+ qp = (byte1 & 0x3f);
+ abreg = (byte2 & 0x7f);
+ x = (byte2 >> 7) & 1;
+ ytreg = byte3;
+
+ if ((byte2 & 0x80) == 0 && byte3 == 0)
+ UNW_DEC_RESTORE_P(X4, qp, t, abreg, arg);
+ else
+ UNW_DEC_SPILL_REG_P(X4, qp, t, abreg, x, ytreg, arg);
+ return dp;
+}
+
+static unsigned char *
+unw_decode_r1 (unsigned char *dp, unsigned char code, void *arg)
+{
+ int body = (code & 0x20) != 0;
+ unw_word rlen;
+
+ rlen = (code & 0x1f);
+ UNW_DEC_PROLOGUE(R1, body, rlen, arg);
+ return dp;
+}
+
+static unsigned char *
+unw_decode_r2 (unsigned char *dp, unsigned char code, void *arg)
+{
+ unsigned char byte1, mask, grsave;
+ unw_word rlen;
+
+ byte1 = *dp++;
+
+ mask = ((code & 0x7) << 1) | ((byte1 >> 7) & 1);
+ grsave = (byte1 & 0x7f);
+ rlen = unw_decode_uleb128 (&dp);
+ UNW_DEC_PROLOGUE_GR(R2, rlen, mask, grsave, arg);
+ return dp;
+}
+
+static unsigned char *
+unw_decode_r3 (unsigned char *dp, unsigned char code, void *arg)
+{
+ unw_word rlen;
+
+ rlen = unw_decode_uleb128 (&dp);
+ UNW_DEC_PROLOGUE(R3, ((code & 0x3) == 1), rlen, arg);
+ return dp;
+}
+
+static unsigned char *
+unw_decode_p1 (unsigned char *dp, unsigned char code, void *arg)
+{
+ unsigned char brmask = (code & 0x1f);
+
+ UNW_DEC_BR_MEM(P1, brmask, arg);
+ return dp;
+}
+
+static unsigned char *
+unw_decode_p2_p5 (unsigned char *dp, unsigned char code, void *arg)
+{
+ if ((code & 0x10) == 0)
+ {
+ unsigned char byte1 = *dp++;
+
+ UNW_DEC_BR_GR(P2, ((code & 0xf) << 1) | ((byte1 >> 7) & 1),
+ (byte1 & 0x7f), arg);
+ }
+ else if ((code & 0x08) == 0)
+ {
+ unsigned char byte1 = *dp++, r, dst;
+
+ r = ((code & 0x7) << 1) | ((byte1 >> 7) & 1);
+ dst = (byte1 & 0x7f);
+ switch (r)
+ {
+ case 0: UNW_DEC_REG_GR(P3, UNW_REG_PSP, dst, arg); break;
+ case 1: UNW_DEC_REG_GR(P3, UNW_REG_RP, dst, arg); break;
+ case 2: UNW_DEC_REG_GR(P3, UNW_REG_PFS, dst, arg); break;
+ case 3: UNW_DEC_REG_GR(P3, UNW_REG_PR, dst, arg); break;
+ case 4: UNW_DEC_REG_GR(P3, UNW_REG_UNAT, dst, arg); break;
+ case 5: UNW_DEC_REG_GR(P3, UNW_REG_LC, dst, arg); break;
+ case 6: UNW_DEC_RP_BR(P3, dst, arg); break;
+ case 7: UNW_DEC_REG_GR(P3, UNW_REG_RNAT, dst, arg); break;
+ case 8: UNW_DEC_REG_GR(P3, UNW_REG_BSP, dst, arg); break;
+ case 9: UNW_DEC_REG_GR(P3, UNW_REG_BSPSTORE, dst, arg); break;
+ case 10: UNW_DEC_REG_GR(P3, UNW_REG_FPSR, dst, arg); break;
+ case 11: UNW_DEC_PRIUNAT_GR(P3, dst, arg); break;
+ default: UNW_DEC_BAD_CODE(r); break;
+ }
+ }
+ else if ((code & 0x7) == 0)
+ UNW_DEC_SPILL_MASK(P4, dp, arg);
+ else if ((code & 0x7) == 1)
+ {
+ unw_word grmask, frmask, byte1, byte2, byte3;
+
+ byte1 = *dp++; byte2 = *dp++; byte3 = *dp++;
+ grmask = ((byte1 >> 4) & 0xf);
+ frmask = ((byte1 & 0xf) << 16) | (byte2 << 8) | byte3;
+ UNW_DEC_FRGR_MEM(P5, grmask, frmask, arg);
+ }
+ else
+ UNW_DEC_BAD_CODE(code);
+ return dp;
+}
+
+static unsigned char *
+unw_decode_p6 (unsigned char *dp, unsigned char code, void *arg)
+{
+ int gregs = (code & 0x10) != 0;
+ unsigned char mask = (code & 0x0f);
+
+ if (gregs)
+ UNW_DEC_GR_MEM(P6, mask, arg);
+ else
+ UNW_DEC_FR_MEM(P6, mask, arg);
+ return dp;
+}
+
+static unsigned char *
+unw_decode_p7_p10 (unsigned char *dp, unsigned char code, void *arg)
+{
+ unsigned char r, byte1, byte2;
+ unw_word t, size;
+
+ if ((code & 0x10) == 0)
+ {
+ r = (code & 0xf);
+ t = unw_decode_uleb128 (&dp);
+ switch (r)
+ {
+ case 0:
+ size = unw_decode_uleb128 (&dp);
+ UNW_DEC_MEM_STACK_F(P7, t, size, arg);
+ break;
+
+ case 1: UNW_DEC_MEM_STACK_V(P7, t, arg); break;
+ case 2: UNW_DEC_SPILL_BASE(P7, t, arg); break;
+ case 3: UNW_DEC_REG_SPREL(P7, UNW_REG_PSP, t, arg); break;
+ case 4: UNW_DEC_REG_WHEN(P7, UNW_REG_RP, t, arg); break;
+ case 5: UNW_DEC_REG_PSPREL(P7, UNW_REG_RP, t, arg); break;
+ case 6: UNW_DEC_REG_WHEN(P7, UNW_REG_PFS, t, arg); break;
+ case 7: UNW_DEC_REG_PSPREL(P7, UNW_REG_PFS, t, arg); break;
+ case 8: UNW_DEC_REG_WHEN(P7, UNW_REG_PR, t, arg); break;
+ case 9: UNW_DEC_REG_PSPREL(P7, UNW_REG_PR, t, arg); break;
+ case 10: UNW_DEC_REG_WHEN(P7, UNW_REG_LC, t, arg); break;
+ case 11: UNW_DEC_REG_PSPREL(P7, UNW_REG_LC, t, arg); break;
+ case 12: UNW_DEC_REG_WHEN(P7, UNW_REG_UNAT, t, arg); break;
+ case 13: UNW_DEC_REG_PSPREL(P7, UNW_REG_UNAT, t, arg); break;
+ case 14: UNW_DEC_REG_WHEN(P7, UNW_REG_FPSR, t, arg); break;
+ case 15: UNW_DEC_REG_PSPREL(P7, UNW_REG_FPSR, t, arg); break;
+ default: UNW_DEC_BAD_CODE(r); break;
+ }
+ }
+ else
+ {
+ switch (code & 0xf)
+ {
+ case 0x0: /* p8 */
+ {
+ r = *dp++;
+ t = unw_decode_uleb128 (&dp);
+ switch (r)
+ {
+ case 1: UNW_DEC_REG_SPREL(P8, UNW_REG_RP, t, arg); break;
+ case 2: UNW_DEC_REG_SPREL(P8, UNW_REG_PFS, t, arg); break;
+ case 3: UNW_DEC_REG_SPREL(P8, UNW_REG_PR, t, arg); break;
+ case 4: UNW_DEC_REG_SPREL(P8, UNW_REG_LC, t, arg); break;
+ case 5: UNW_DEC_REG_SPREL(P8, UNW_REG_UNAT, t, arg); break;
+ case 6: UNW_DEC_REG_SPREL(P8, UNW_REG_FPSR, t, arg); break;
+ case 7: UNW_DEC_REG_WHEN(P8, UNW_REG_BSP, t, arg); break;
+ case 8: UNW_DEC_REG_PSPREL(P8, UNW_REG_BSP, t, arg); break;
+ case 9: UNW_DEC_REG_SPREL(P8, UNW_REG_BSP, t, arg); break;
+ case 10: UNW_DEC_REG_WHEN(P8, UNW_REG_BSPSTORE, t, arg); break;
+ case 11: UNW_DEC_REG_PSPREL(P8, UNW_REG_BSPSTORE, t, arg); break;
+ case 12: UNW_DEC_REG_SPREL(P8, UNW_REG_BSPSTORE, t, arg); break;
+ case 13: UNW_DEC_REG_WHEN(P8, UNW_REG_RNAT, t, arg); break;
+ case 14: UNW_DEC_REG_PSPREL(P8, UNW_REG_RNAT, t, arg); break;
+ case 15: UNW_DEC_REG_SPREL(P8, UNW_REG_RNAT, t, arg); break;
+ case 16: UNW_DEC_PRIUNAT_WHEN_GR(P8, t, arg); break;
+ case 17: UNW_DEC_PRIUNAT_PSPREL(P8, t, arg); break;
+ case 18: UNW_DEC_PRIUNAT_SPREL(P8, t, arg); break;
+ case 19: UNW_DEC_PRIUNAT_WHEN_MEM(P8, t, arg); break;
+ default: UNW_DEC_BAD_CODE(r); break;
+ }
+ }
+ break;
+
+ case 0x1:
+ byte1 = *dp++; byte2 = *dp++;
+ UNW_DEC_GR_GR(P9, (byte1 & 0xf), (byte2 & 0x7f), arg);
+ break;
+
+ case 0xf: /* p10 */
+ byte1 = *dp++; byte2 = *dp++;
+ UNW_DEC_ABI(P10, byte1, byte2, arg);
+ break;
+
+ case 0x9:
+ return unw_decode_x1 (dp, code, arg);
+
+ case 0xa:
+ return unw_decode_x2 (dp, code, arg);
+
+ case 0xb:
+ return unw_decode_x3 (dp, code, arg);
+
+ case 0xc:
+ return unw_decode_x4 (dp, code, arg);
+
+ default:
+ UNW_DEC_BAD_CODE(code);
+ break;
+ }
+ }
+ return dp;
+}
+
+static unsigned char *
+unw_decode_b1 (unsigned char *dp, unsigned char code, void *arg)
+{
+ unw_word label = (code & 0x1f);
+
+ if ((code & 0x20) != 0)
+ UNW_DEC_COPY_STATE(B1, label, arg);
+ else
+ UNW_DEC_LABEL_STATE(B1, label, arg);
+ return dp;
+}
+
+static unsigned char *
+unw_decode_b2 (unsigned char *dp, unsigned char code, void *arg)
+{
+ unw_word t;
+
+ t = unw_decode_uleb128 (&dp);
+ UNW_DEC_EPILOGUE(B2, t, (code & 0x1f), arg);
+ return dp;
+}
+
+static unsigned char *
+unw_decode_b3_x4 (unsigned char *dp, unsigned char code, void *arg)
+{
+ unw_word t, ecount, label;
+
+ if ((code & 0x10) == 0)
+ {
+ t = unw_decode_uleb128 (&dp);
+ ecount = unw_decode_uleb128 (&dp);
+ UNW_DEC_EPILOGUE(B3, t, ecount, arg);
+ }
+ else if ((code & 0x07) == 0)
+ {
+ label = unw_decode_uleb128 (&dp);
+ if ((code & 0x08) != 0)
+ UNW_DEC_COPY_STATE(B4, label, arg);
+ else
+ UNW_DEC_LABEL_STATE(B4, label, arg);
+ }
+ else
+ switch (code & 0x7)
+ {
+ case 1: return unw_decode_x1 (dp, code, arg);
+ case 2: return unw_decode_x2 (dp, code, arg);
+ case 3: return unw_decode_x3 (dp, code, arg);
+ case 4: return unw_decode_x4 (dp, code, arg);
+ default: UNW_DEC_BAD_CODE(code); break;
+ }
+ return dp;
+}
+
+typedef unsigned char *(*unw_decoder) (unsigned char *, unsigned char, void *);
+
+static unw_decoder unw_decode_table[2][8] =
+{
+ /* prologue table: */
+ {
+ unw_decode_r1, /* 0 */
+ unw_decode_r1,
+ unw_decode_r2,
+ unw_decode_r3,
+ unw_decode_p1, /* 4 */
+ unw_decode_p2_p5,
+ unw_decode_p6,
+ unw_decode_p7_p10
+ },
+ {
+ unw_decode_r1, /* 0 */
+ unw_decode_r1,
+ unw_decode_r2,
+ unw_decode_r3,
+ unw_decode_b1, /* 4 */
+ unw_decode_b1,
+ unw_decode_b2,
+ unw_decode_b3_x4
+ }
+};
+
+/*
+ * Decode one descriptor and return address of next descriptor.
+ */
+static inline unsigned char *
+unw_decode (unsigned char *dp, int inside_body, void *arg)
+{
+ unw_decoder decoder;
+ unsigned char code;
+
+ code = *dp++;
+ decoder = unw_decode_table[inside_body][code >> 5];
+ dp = (*decoder) (dp, code, arg);
+ return dp;
+}
+
+
+/* RSE helper functions. */
+
+static inline unsigned long
+ia64_rse_slot_num (unsigned long *addr)
+{
+ return (((unsigned long) addr) >> 3) & 0x3f;
+}
+
+/* Return TRUE if ADDR is the address of an RNAT slot. */
+static inline unsigned long
+ia64_rse_is_rnat_slot (unsigned long *addr)
+{
+ return ia64_rse_slot_num (addr) == 0x3f;
+}
+
+/* Returns the address of the RNAT slot that covers the slot at
+ address SLOT_ADDR. */
+static inline unsigned long *
+ia64_rse_rnat_addr (unsigned long *slot_addr)
+{
+ return (unsigned long *) ((unsigned long) slot_addr | (0x3f << 3));
+}
+
+/* Calcuate the number of registers in the dirty partition starting at
+ BSPSTORE with a size of DIRTY bytes. This isn't simply DIRTY
+ divided by eight because the 64th slot is used to store ar.rnat. */
+static inline unsigned long
+ia64_rse_num_regs (unsigned long *bspstore, unsigned long *bsp)
+{
+ unsigned long slots = (bsp - bspstore);
+
+ return slots - (ia64_rse_slot_num (bspstore) + slots)/0x40;
+}
+
+/* The inverse of the above: given bspstore and the number of
+ registers, calculate ar.bsp. */
+static inline unsigned long *
+ia64_rse_skip_regs (unsigned long *addr, long num_regs)
+{
+ long delta = ia64_rse_slot_num (addr) + num_regs;
+
+ if (num_regs < 0)
+ delta -= 0x3e;
+ return addr + num_regs + delta/0x3f;
+}
+
+
+/* Unwind accessors. */
+
+static void
+unw_access_gr (struct _Unwind_Context *info, int regnum,
+ unsigned long *val, char *nat, int write)
+{
+ unsigned long *addr, *nat_addr = 0, nat_mask = 0, dummy_nat;
+ struct unw_ireg *ireg;
+
+ if ((unsigned) regnum - 1 >= 127)
+ abort ();
+
+ if (regnum < 1)
+ {
+ nat_addr = addr = &dummy_nat;
+ dummy_nat = 0;
+ }
+ else if (regnum < 32)
+ {
+ /* Access a non-stacked register. */
+ ireg = &info->ireg[regnum - 1];
+ addr = ireg->loc;
+ if (addr)
+ {
+ nat_addr = addr + ireg->nat.off;
+ switch (ireg->nat.type)
+ {
+ case UNW_NAT_VAL:
+ /* Simulate getf.sig/setf.sig. */
+ if (write)
+ {
+ if (*nat)
+ {
+ /* Write NaTVal and be done with it. */
+ addr[0] = 0;
+ addr[1] = 0x1fffe;
+ return;
+ }
+ addr[1] = 0x1003e;
+ }
+ else if (addr[0] == 0 && addr[1] == 0x1ffe)
+ {
+ /* Return NaT and be done with it. */
+ *val = 0;
+ *nat = 1;
+ return;
+ }
+ /* FALLTHRU */
+
+ case UNW_NAT_NONE:
+ dummy_nat = 0;
+ nat_addr = &dummy_nat;
+ break;
+
+ case UNW_NAT_MEMSTK:
+ nat_mask = 1UL << ((long) addr & 0x1f8)/8;
+ break;
+
+ case UNW_NAT_REGSTK:
+ nat_addr = ia64_rse_rnat_addr (addr);
+ if ((unsigned long) nat_addr >= info->regstk_top)
+ nat_addr = &info->rnat;
+ nat_mask = 1UL << ia64_rse_slot_num (addr);
+ break;
+ }
+ }
+ }
+ else
+ {
+ /* Access a stacked register. */
+ addr = ia64_rse_skip_regs ((unsigned long *) info->bsp, regnum - 32);
+ nat_addr = ia64_rse_rnat_addr (addr);
+ if ((unsigned long) nat_addr >= info->regstk_top)
+ nat_addr = &info->rnat;
+ nat_mask = 1UL << ia64_rse_slot_num (addr);
+ }
+
+ if (write)
+ {
+ *addr = *val;
+ if (*nat)
+ *nat_addr |= nat_mask;
+ else
+ *nat_addr &= ~nat_mask;
+ }
+ else
+ {
+ *val = *addr;
+ *nat = (*nat_addr & nat_mask) != 0;
+ }
+}
+
+/* Get the value of register REG as saved in CONTEXT. */
+
+_Unwind_Word
+_Unwind_GetGR (struct _Unwind_Context *context, int index)
+{
+ _Unwind_Word ret;
+ char nat;
+
+ if (index == 1)
+ return context->gp;
+ else if (index >= 15 && index <= 18)
+ return context->eh_data[index - 15];
+ else
+ unw_access_gr (context, index, &ret, &nat, 0);
+
+ return ret;
+}
+
+/* Overwrite the saved value for register REG in CONTEXT with VAL. */
+
+void
+_Unwind_SetGR (struct _Unwind_Context *context, int index, _Unwind_Word val)
+{
+ char nat = 0;
+
+ if (index == 1)
+ context->gp = val;
+ else if (index >= 15 && index <= 18)
+ context->eh_data[index - 15] = val;
+ else
+ unw_access_gr (context, index, &val, &nat, 1);
+}
+
+/* Retrieve the return address for CONTEXT. */
+
+inline _Unwind_Ptr
+_Unwind_GetIP (struct _Unwind_Context *context)
+{
+ return context->rp;
+}
+
+/* Overwrite the return address for CONTEXT with VAL. */
+
+inline void
+_Unwind_SetIP (struct _Unwind_Context *context, _Unwind_Ptr val)
+{
+ context->rp = val;
+}
+
+void *
+_Unwind_GetLanguageSpecificData (struct _Unwind_Context *context)
+{
+ return context->lsda;
+}
+
+_Unwind_Ptr
+_Unwind_GetRegionStart (struct _Unwind_Context *context)
+{
+ return context->region_start;
+}
+
+
+static _Unwind_Reason_Code
+uw_frame_state_for (struct _Unwind_Context *context, _Unwind_FrameState *fs)
+{
+ struct unw_table_entry *ent;
+ unsigned long *unw, header, length;
+ unsigned char *insn, *insn_end;
+ unsigned long segment_base;
+
+ memset (fs, 0, sizeof (*fs));
+ context->lsda = 0;
+
+ ent = _Unwind_FindTableEntry ((void *) context->rp,
+ &segment_base, &context->gp);
+ if (ent == NULL)
+ {
+ /* Couldn't find unwind info for this function. Try an
+ os-specific fallback mechanism. This will necessarily
+ not profide a personality routine or LSDA. */
+#ifdef MD_FALLBACK_FRAME_STATE_FOR
+ MD_FALLBACK_FRAME_STATE_FOR (context, fs, success);
+ return _URC_END_OF_STACK;
+ success:
+ return _URC_NO_REASON;
+#else
+ return _URC_END_OF_STACK;
+#endif
+ }
+
+ context->region_start = ent->start_offset + segment_base;
+ fs->when_target = (context->rp - context->region_start) / 16 * 3;
+
+ unw = (unsigned long *) (ent->info_offset + segment_base);
+ header = *unw;
+ length = UNW_LENGTH (header);
+
+ /* ??? Perhaps check UNW_VER / UNW_FLAG_OSMASK. */
+
+ if (UNW_FLAG_EHANDLER (header) | UNW_FLAG_UHANDLER (header))
+ {
+ fs->personality =
+ *(_Unwind_Personality_Fn *) (unw[length + 1] + context->gp);
+ context->lsda = unw + length + 2;
+ }
+
+ insn = (unsigned char *) (unw + 1);
+ insn_end = (unsigned char *) (unw + 1 + length);
+ while (!fs->done && insn < insn_end)
+ insn = unw_decode (insn, fs->in_body, fs);
+
+ /* If we're in the epilogue, sp has been restored and all values
+ on the memory stack below psp also have been restored. */
+ if (fs->when_target > fs->epilogue_start)
+ {
+ struct unw_reg_info *r;
+
+ fs->curr.reg[UNW_REG_PSP].where = UNW_WHERE_NONE;
+ fs->curr.reg[UNW_REG_PSP].val = 0;
+ for (r = fs->curr.reg; r < fs->curr.reg + UNW_NUM_REGS; ++r)
+ if ((r->where == UNW_WHERE_PSPREL && r->val <= 0x10)
+ || r->where == UNW_WHERE_SPREL)
+ r->where = UNW_WHERE_NONE;
+ }
+
+ /* If RP did't get saved, generate entry for the return link register. */
+ if (fs->curr.reg[UNW_REG_RP].when >= fs->when_target)
+ {
+ fs->curr.reg[UNW_REG_RP].where = UNW_WHERE_BR;
+ fs->curr.reg[UNW_REG_RP].when = -1;
+ fs->curr.reg[UNW_REG_RP].val = fs->return_link_reg;
+ }
+
+ return _URC_NO_REASON;
+}
+
+static void
+uw_update_reg_address (struct _Unwind_Context *context,
+ _Unwind_FrameState *fs,
+ enum unw_register_index regno)
+{
+ struct unw_reg_info *r = fs->curr.reg + regno;
+ void *addr;
+ unsigned long rval;
+
+ if (r->where == UNW_WHERE_NONE || r->when >= fs->when_target)
+ return;
+
+ rval = r->val;
+ switch (r->where)
+ {
+ case UNW_WHERE_GR:
+ if (rval >= 32)
+ addr = ia64_rse_skip_regs ((unsigned long *) context->bsp, rval - 32);
+ else if (rval >= 2)
+ addr = context->ireg[rval - 2].loc;
+ else
+ abort ();
+ break;
+
+ case UNW_WHERE_FR:
+ if (rval >= 2 && rval < 32)
+ addr = context->fr_loc[rval - 2];
+ else
+ abort ();
+ break;
+
+ case UNW_WHERE_BR:
+ if (rval >= 1 && rval <= 5)
+ addr = context->br_loc[rval - 1];
+ else
+ abort ();
+ break;
+
+ case UNW_WHERE_SPREL:
+ addr = (void *)(context->sp + rval);
+ break;
+
+ case UNW_WHERE_PSPREL:
+ addr = (void *)(context->psp + rval);
+ break;
+
+ default:
+ abort ();
+ }
+
+ switch (regno)
+ {
+ case UNW_REG_R2 ... UNW_REG_R31:
+ context->ireg[regno - UNW_REG_R2].loc = addr;
+ switch (r->where)
+ {
+ case UNW_WHERE_GR:
+ if (rval >= 32)
+ {
+ context->ireg[regno - UNW_REG_R2].nat.type = UNW_NAT_MEMSTK;
+ context->ireg[regno - UNW_REG_R2].nat.off
+ = context->pri_unat_loc - (unsigned long *) addr;
+ }
+ else if (rval >= 2)
+ {
+ context->ireg[regno - UNW_REG_R2].nat
+ = context->ireg[rval - 2].nat;
+ }
+ else
+ abort ();
+ break;
+
+ case UNW_WHERE_FR:
+ context->ireg[regno - UNW_REG_R2].nat.type = UNW_NAT_VAL;
+ context->ireg[regno - UNW_REG_R2].nat.off = 0;
+ break;
+
+ case UNW_WHERE_BR:
+ context->ireg[regno - UNW_REG_R2].nat.type = UNW_NAT_NONE;
+ context->ireg[regno - UNW_REG_R2].nat.off = 0;
+ break;
+
+ case UNW_WHERE_PSPREL:
+ case UNW_WHERE_SPREL:
+ context->ireg[regno - UNW_REG_R2].nat.type = UNW_NAT_MEMSTK;
+ context->ireg[regno - UNW_REG_R2].nat.off
+ = context->pri_unat_loc - (unsigned long *) addr;
+ break;
+
+ default:
+ abort ();
+ }
+ break;
+
+ case UNW_REG_F2 ... UNW_REG_F31:
+ context->fr_loc[regno - UNW_REG_F2] = addr;
+ break;
+
+ case UNW_REG_B1 ... UNW_REG_B5:
+ context->br_loc[regno - UNW_REG_B1] = addr;
+ break;
+
+ case UNW_REG_BSP:
+ context->bsp_loc = addr;
+ break;
+ case UNW_REG_BSPSTORE:
+ context->bspstore_loc = addr;
+ break;
+ case UNW_REG_PFS:
+ context->pfs_loc = addr;
+ break;
+ case UNW_REG_RP:
+ context->rp = *(unsigned long *)addr;
+ break;
+ case UNW_REG_UNAT:
+ context->unat_loc = addr;
+ break;
+ case UNW_REG_PR:
+ context->pr = *(unsigned long *) addr;
+ break;
+ case UNW_REG_LC:
+ context->lc_loc = addr;
+ break;
+ case UNW_REG_FPSR:
+ context->fpsr_loc = addr;
+ break;
+
+ case UNW_REG_PSP:
+ context->psp = *(unsigned long *)addr;
+ break;
+
+ case UNW_REG_RNAT:
+ case UNW_NUM_REGS:
+ abort ();
+ }
+}
+
+static void
+uw_update_context (struct _Unwind_Context *context, _Unwind_FrameState *fs)
+{
+ long i;
+
+ context->sp = context->psp;
+
+ /* First, set PSP. Subsequent instructions may depend on this value. */
+ if (fs->when_target > fs->curr.reg[UNW_REG_PSP].when)
+ {
+ if (fs->curr.reg[UNW_REG_PSP].where == UNW_WHERE_NONE)
+ context->psp = context->psp + fs->curr.reg[UNW_REG_PSP].val;
+ else
+ uw_update_reg_address (context, fs, UNW_REG_PSP);
+ }
+
+ /* Determine the location of the primary UNaT. */
+ {
+ int i;
+ if (fs->when_target < fs->curr.reg[UNW_REG_PRI_UNAT_GR].when)
+ i = UNW_REG_PRI_UNAT_MEM;
+ else if (fs->when_target < fs->curr.reg[UNW_REG_PRI_UNAT_MEM].when)
+ i = UNW_REG_PRI_UNAT_GR;
+ else if (fs->curr.reg[UNW_REG_PRI_UNAT_MEM].when
+ > fs->curr.reg[UNW_REG_PRI_UNAT_GR].when)
+ i = UNW_REG_PRI_UNAT_MEM;
+ else
+ i = UNW_REG_PRI_UNAT_GR;
+ uw_update_reg_address (context, fs, i);
+ }
+
+ /* Compute the addresses of all registers saved in this frame. */
+ for (i = UNW_REG_BSP; i < UNW_NUM_REGS; ++i)
+ uw_update_reg_address (context, fs, i);
+
+ /* Unwind BSP for the local registers allocated this frame. */
+ /* ??? What to do with stored BSP or BSPSTORE registers. */
+ if (fs->when_target > fs->curr.reg[UNW_REG_PFS].when)
+ {
+ unsigned long pfs = *context->pfs_loc;
+ unsigned long sol = (pfs >> 7) & 0x7f;
+ context->bsp = (unsigned long)
+ ia64_rse_skip_regs ((unsigned long *) context->bsp, -sol);
+ }
+}
+
+/* Fill in CONTEXT for top-of-stack. The only valid registers at this
+ level will be the return address and the CFA. */
+
+#define uw_init_context(CONTEXT) \
+ uw_init_context_1 (CONTEXT, __builtin_dwarf_cfa (), __builtin_ia64_bsp ())
+
+static void
+uw_init_context_1 (struct _Unwind_Context *context, void *psp, void *bsp)
+{
+ void *rp = __builtin_extract_return_addr (__builtin_return_address (0));
+ void *sp = __builtin_dwarf_cfa ();
+ _Unwind_FrameState fs;
+
+ /* Flush the register stack to memory so that we can access it. */
+ __builtin_ia64_flushrs ();
+
+ memset (context, 0, sizeof (struct _Unwind_Context));
+ context->bsp = (unsigned long) bsp;
+ context->sp = (unsigned long) sp;
+ context->psp = (unsigned long) psp;
+ context->rp = (unsigned long) rp;
+
+ asm ("mov %0 = pr" : "=r" (context->pr));
+ /* ??? Get rnat. Don't we have to turn off the rse for that? */
+
+ if (uw_frame_state_for (context, &fs) != _URC_NO_REASON)
+ abort ();
+
+ /* Force the frame state to use the known cfa value. */
+ fs.curr.reg[UNW_REG_PSP].when = -1;
+ fs.curr.reg[UNW_REG_PSP].where = UNW_WHERE_NONE;
+ fs.curr.reg[UNW_REG_PSP].val = sp - psp;
+
+ uw_update_context (context, &fs);
+}
+
+/* Install (ie longjmp to) the contents of TARGET. */
+
+static void __attribute__((noreturn))
+uw_install_context (struct _Unwind_Context *current __attribute__((unused)),
+ struct _Unwind_Context *target)
+{
+ unsigned long ireg_buf[4], ireg_nat = 0, ireg_pr = 0;
+ long i;
+
+ /* Copy integer register data from the target context to a
+ temporary buffer. Do this so that we can frob AR.UNAT
+ to get the NaT bits for these registers set properly. */
+ for (i = 4; i <= 7; ++i)
+ {
+ char nat;
+ void *t = target->ireg[i - 2].loc;
+ if (t)
+ {
+ unw_access_gr (target, i, &ireg_buf[i - 4], &nat, 0);
+ ireg_nat |= (long)nat << (((size_t)&ireg_buf[i - 4] >> 3) & 0x3f);
+ /* Set p6 - p9. */
+ ireg_pr |= 4L << i;
+ }
+ }
+
+ /* The value in uc_bsp that we've computed is that for the
+ target function. The value that we install below will be
+ adjusted by the BR.RET instruction based on the contents
+ of AR.PFS. So we must unadjust that here. */
+ target->bsp
+ = ia64_rse_skip_regs (target->bsp, (*target->pfs_loc >> 7) & 0x7f);
+
+ /* Provide assembly with the offsets into the _Unwind_Context. */
+ asm volatile ("uc_rnat = %0"
+ : : "i"(offsetof (struct _Unwind_Context, rnat)));
+ asm volatile ("uc_bsp = %0"
+ : : "i"(offsetof (struct _Unwind_Context, bsp)));
+ asm volatile ("uc_psp = %0"
+ : : "i"(offsetof (struct _Unwind_Context, psp)));
+ asm volatile ("uc_rp = %0"
+ : : "i"(offsetof (struct _Unwind_Context, rp)));
+ asm volatile ("uc_pr = %0"
+ : : "i"(offsetof (struct _Unwind_Context, pr)));
+ asm volatile ("uc_gp = %0"
+ : : "i"(offsetof (struct _Unwind_Context, gp)));
+ asm volatile ("uc_pfs_loc = %0"
+ : : "i"(offsetof (struct _Unwind_Context, pfs_loc)));
+ asm volatile ("uc_unat_loc = %0"
+ : : "i"(offsetof (struct _Unwind_Context, unat_loc)));
+ asm volatile ("uc_lc_loc = %0"
+ : : "i"(offsetof (struct _Unwind_Context, lc_loc)));
+ asm volatile ("uc_fpsr_loc = %0"
+ : : "i"(offsetof (struct _Unwind_Context, fpsr_loc)));
+ asm volatile ("uc_eh_data = %0"
+ : : "i"(offsetof (struct _Unwind_Context, eh_data)));
+ asm volatile ("uc_br_loc = %0"
+ : : "i"(offsetof (struct _Unwind_Context, br_loc)));
+ asm volatile ("uc_fr_loc = %0"
+ : : "i"(offsetof (struct _Unwind_Context, fr_loc)));
+
+ asm volatile (
+ /* Load up call-saved non-window integer registers from ireg_buf. */
+ "add r20 = 8, %1 \n\t"
+ "mov ar.unat = %2 \n\t"
+ "mov pr = %3, 0x3c0 \n\t"
+ ";; \n\t"
+ "(p6) ld8.fill r4 = [%1] \n\t"
+ "(p7) ld8.fill r5 = [r20] \n\t"
+ "add r21 = uc_br_loc + 8, %0 \n\t"
+ "adds %1 = 16, %1 \n\t"
+ "adds r20 = 16, r20 \n\t"
+ ";; \n\t"
+ "(p8) ld8.fill r6 = [%1] \n\t"
+ "(p9) ld8.fill r7 = [r20] \n\t"
+ "add r20 = uc_br_loc, %0 \n\t"
+ ";; \n\t"
+ /* Load up call-saved branch registers. */
+ "ld8 r22 = [r20], 16 \n\t"
+ "ld8 r23 = [r21], 16 \n\t"
+ ";; \n\t"
+ "ld8 r24 = [r20], 16 \n\t"
+ "ld8 r25 = [r21], uc_fr_loc - (uc_br_loc + 24)\n\t"
+ ";; \n\t"
+ "ld8 r26 = [r20], uc_fr_loc + 8 - (uc_br_loc + 32)\n\t"
+ "ld8 r27 = [r21], 24 \n\t"
+ "cmp.ne p6, p0 = r0, r22 \n\t"
+ ";; \n\t"
+ "ld8 r28 = [r20], 8 \n\t"
+ "(p6) ld8 r22 = [r22] \n\t"
+ "cmp.ne p7, p0 = r0, r23 \n\t"
+ ";; \n\t"
+ "(p7) ld8 r23 = [r23] \n\t"
+ "cmp.ne p8, p0 = r0, r24 \n\t"
+ ";; \n\t"
+ "(p8) ld8 r24 = [r24] \n\t"
+ "(p6) mov b1 = r22 \n\t"
+ "cmp.ne p9, p0 = r0, r25 \n\t"
+ ";; \n\t"
+ "(p9) ld8 r25 = [r25] \n\t"
+ "(p7) mov b2 = r23 \n\t"
+ "cmp.ne p6, p0 = r0, r26 \n\t"
+ ";; \n\t"
+ "(p6) ld8 r26 = [r26] \n\t"
+ "(p8) mov b3 = r24 \n\t"
+ "cmp.ne p7, p0 = r0, r27 \n\t"
+ ";; \n\t"
+ /* Load up call-saved fp registers. */
+ "(p7) ldf.fill f2 = [r27] \n\t"
+ "(p9) mov b4 = r25 \n\t"
+ "cmp.ne p8, p0 = r0, r28 \n\t"
+ ";; \n\t"
+ "(p8) ldf.fill f3 = [r28] \n\t"
+ "(p6) mov b5 = r26 \n\t"
+ ";; \n\t"
+ "ld8 r29 = [r20], 16*8 - 4*8 \n\t"
+ "ld8 r30 = [r21], 17*8 - 5*8 \n\t"
+ ";; \n\t"
+ "ld8 r22 = [r20], 16 \n\t"
+ "ld8 r23 = [r21], 16 \n\t"
+ ";; \n\t"
+ "ld8 r24 = [r20], 16 \n\t"
+ "ld8 r25 = [r21] \n\t"
+ "cmp.ne p6, p0 = r0, r29 \n\t"
+ ";; \n\t"
+ "ld8 r26 = [r20], 8 \n\t"
+ "(p6) ldf.fill f4 = [r29] \n\t"
+ "cmp.ne p7, p0 = r0, r30 \n\t"
+ ";; \n\t"
+ "ld8 r27 = [r20], 8 \n\t"
+ "(p7) ldf.fill f5 = [r30] \n\t"
+ "cmp.ne p6, p0 = r0, r22 \n\t"
+ ";; \n\t"
+ "ld8 r28 = [r20], 8 \n\t"
+ "(p6) ldf.fill f16 = [r22] \n\t"
+ "cmp.ne p7, p0 = r0, r23 \n\t"
+ ";; \n\t"
+ "ld8 r29 = [r20], 8 \n\t"
+ "(p7) ldf.fill f17 = [r23] \n\t"
+ "cmp.ne p6, p0 = r0, r24 \n\t"
+ ";; \n\t"
+ "ld8 r22 = [r20], 8 \n\t"
+ "(p6) ldf.fill f18 = [r24] \n\t"
+ "cmp.ne p7, p0 = r0, r25 \n\t"
+ ";; \n\t"
+ "ld8 r23 = [r20], 8 \n\t"
+ "(p7) ldf.fill f19 = [r25] \n\t"
+ "cmp.ne p6, p0 = r0, r26 \n\t"
+ ";; \n\t"
+ "ld8 r24 = [r20], 8 \n\t"
+ "(p6) ldf.fill f20 = [r26] \n\t"
+ "cmp.ne p7, p0 = r0, r27 \n\t"
+ ";; \n\t"
+ "ld8 r25 = [r20], 8 \n\t"
+ "(p7) ldf.fill f21 = [r27] \n\t"
+ "cmp.ne p6, p0 = r0, r28 \n\t"
+ ";; \n\t"
+ "ld8 r26 = [r20], 8 \n\t"
+ "(p6) ldf.fill f22 = [r28] \n\t"
+ "cmp.ne p7, p0 = r0, r29 \n\t"
+ ";; \n\t"
+ "ld8 r28 = [r20], 8 \n\t"
+ "(p7) ldf.fill f23 = [r29] \n\t"
+ "cmp.ne p6, p0 = r0, r22 \n\t"
+ ";; \n\t"
+ "ld8 r29 = [r20], 8 \n\t"
+ "(p6) ldf.fill f24 = [r22] \n\t"
+ "cmp.ne p7, p0 = r0, r23 \n\t"
+ ";; \n\t"
+ "(p7) ldf.fill f25 = [r23] \n\t"
+ "cmp.ne p6, p0 = r0, r24 \n\t"
+ "cmp.ne p7, p0 = r0, r25 \n\t"
+ ";; \n\t"
+ "(p6) ldf.fill f26 = [r24] \n\t"
+ "(p7) ldf.fill f27 = [r25] \n\t"
+ "cmp.ne p6, p0 = r0, r26 \n\t"
+ ";; \n\t"
+ "(p6) ldf.fill f28 = [r26] \n\t"
+ "cmp.ne p7, p0 = r0, r27 \n\t"
+ "cmp.ne p6, p0 = r0, r28 \n\t"
+ ";; \n\t"
+ "(p7) ldf.fill f29 = [r27] \n\t"
+ "(p6) ldf.fill f30 = [r28] \n\t"
+ "cmp.ne p7, p0 = r0, r29 \n\t"
+ ";; \n\t"
+ "(p7) ldf.fill f31 = [r29] \n\t"
+ "add r20 = uc_rnat, %0 \n\t"
+ "add r21 = uc_bsp, %0 \n\t"
+ ";; \n\t"
+ /* Load the balance of the thread state from the context. */
+ "ld8 r22 = [r20], uc_psp - uc_rnat \n\t"
+ "ld8 r23 = [r21], uc_gp - uc_bsp \n\t"
+ ";; \n\t"
+ "ld8 r24 = [r20], uc_pfs_loc - uc_psp \n\t"
+ "ld8 r1 = [r21], uc_rp - uc_gp \n\t"
+ ";; \n\t"
+ "ld8 r25 = [r20], uc_unat_loc - uc_pfs_loc\n\t"
+ "ld8 r26 = [r21], uc_pr - uc_rp \n\t"
+ ";; \n\t"
+ "ld8 r27 = [r20], uc_lc_loc - uc_unat_loc\n\t"
+ "ld8 r28 = [r21], uc_fpsr_loc - uc_pr \n\t"
+ ";; \n\t"
+ "ld8 r29 = [r20], uc_eh_data - uc_lc_loc\n\t"
+ "ld8 r30 = [r21], uc_eh_data + 8 - uc_fpsr_loc\n\t"
+ ";; \n\t"
+ /* Load data for the exception handler. */
+ "ld8 r15 = [r20], 16 \n\t"
+ "ld8 r16 = [r21], 16 \n\t"
+ ";; \n\t"
+ "ld8 r17 = [r20] \n\t"
+ "ld8 r18 = [r21] \n\t"
+ ";; \n\t"
+ /* Install the balance of the thread state loaded above. */
+ "cmp.ne p6, p0 = r0, r25 \n\t"
+ "cmp.ne p7, p0 = r0, r27 \n\t"
+ ";; \n\t"
+ "(p6) ld8 r25 = [r25] \n\t"
+ "(p7) ld8 r27 = [r27] \n\t"
+ ";; \n\t"
+ "(p7) mov.m ar.unat = r27 \n\t"
+ "(p6) mov.i ar.pfs = r25 \n\t"
+ "cmp.ne p9, p0 = r0, r29 \n\t"
+ ";; \n\t"
+ "(p9) ld8 r29 = [r29] \n\t"
+ "cmp.ne p6, p0 = r0, r30 \n\t"
+ ";; \n\t"
+ "(p6) ld8 r30 = [r30] \n\t"
+ /* Don't clobber p6-p9, which are in use at present. */
+ "mov pr = r28, ~0x3c0 \n\t"
+ "(p9) mov.i ar.lc = r29 \n\t"
+ ";; \n\t"
+ "mov.m r25 = ar.rsc \n\t"
+ "(p6) mov.i ar.fpsr = r30 \n\t"
+ ";; \n\t"
+ "and r25 = 0x1c, r25 \n\t"
+ "mov b0 = r26 \n\t"
+ ";; \n\t"
+ "mov.m ar.rsc = r25 \n\t"
+ ";; \n\t"
+ /* This must be done before setting AR.BSPSTORE, otherwise
+ AR.BSP will be initialized with a random displacement
+ below the value we want, based on the current number of
+ dirty stacked registers. */
+ "loadrs \n\t"
+ "invala \n\t"
+ ";; \n\t"
+ "mov.m ar.bspstore = r23 \n\t"
+ ";; \n\t"
+ "or r25 = 0x3, r25 \n\t"
+ "mov.m ar.rnat = r22 \n\t"
+ ";; \n\t"
+ "mov.m ar.rsc = r25 \n\t"
+ "mov sp = r24 \n\t"
+ "br.ret.sptk.few b0"
+ : : "r"(target), "r"(ireg_buf), "r"(ireg_nat), "r"(ireg_pr)
+ : "r15", "r16", "r17", "r18", "r20", "r21", "r22",
+ "r23", "r24", "r25", "r26", "r27", "r28", "r29",
+ "r30", "r31");
+ /* NOTREACHED */
+ while (1);
+}
+
+static inline _Unwind_Ptr
+uw_identify_context (struct _Unwind_Context *context)
+{
+ return _Unwind_GetIP (context);
+}
+
+#include "unwind.inc"
+#endif
diff --git a/gcc/config/ia64/frame-ia64.h b/gcc/config/ia64/unwind-ia64.h
index d638ca3862b..a6b850df80a 100644
--- a/gcc/config/ia64/frame-ia64.h
+++ b/gcc/config/ia64/unwind-ia64.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
Contributed by Andrew MacLeod <amacleod@cygnus.com>
Andrew Haley <aph@cygnus.com>
@@ -19,18 +19,13 @@
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-/* This structure represents a single unwind table entry. We lie and say
- its the dwarf_fde structure to use the common object in frame.h */
-
-typedef struct dwarf_fde
+struct unw_table_entry
{
- long start_offset;
- long end_offset;
- long unwind_offset;
-} unwind_table_entry;
-
-/* Defining dwarf_fde allows us to use the common object registration. */
-typedef unwind_table_entry dwarf_fde;
-typedef unwind_table_entry fde;
+ unsigned long start_offset;
+ unsigned long end_offset;
+ unsigned long info_offset;
+};
-extern fde *__ia64_find_fde (void *, void **);
+extern struct unw_table_entry *
+_Unwind_FindTableEntry (void *pc, unsigned long *segment_base,
+ unsigned long *gp);
diff --git a/gcc/config/ia64/xm-ia64.h b/gcc/config/ia64/xm-ia64.h
index 481de923085..7f29198701b 100644
--- a/gcc/config/ia64/xm-ia64.h
+++ b/gcc/config/ia64/xm-ia64.h
@@ -18,10 +18,6 @@ along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-/* #defines that need visibility everywhere. */
-#define FALSE 0
-#define TRUE 1
-
/* A C expression for the status code to be returned when the compiler exits
after serious errors. */
#define FATAL_EXIT_CODE 33
diff --git a/gcc/config/linux.h b/gcc/config/linux.h
index 1ef26b3f194..dc1a4c72113 100644
--- a/gcc/config/linux.h
+++ b/gcc/config/linux.h
@@ -47,15 +47,6 @@ Boston, MA 02111-1307, USA. */
#undef MD_EXEC_PREFIX
#undef MD_STARTFILE_PREFIX
-/* 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)
-
/* Provide a STARTFILE_SPEC appropriate for GNU/Linux. Here we add
the GNU/Linux magical crtbegin.o file (see crtstuff.c) which
provides part of the support for getting C++ file-scope static
@@ -84,6 +75,10 @@ Boston, MA 02111-1307, USA. */
#define CC1_SPEC "%{profile:-p}"
#endif
+/* The GNU C++ standard library requires that these macros be defined. */
+#undef CPLUSPLUS_CPP_SPEC
+#define CPLUSPLUS_CPP_SPEC "-D_GNU_SOURCE %(cpp)"
+
#ifndef USE_GNULIBC_1
#undef DEFAULT_VTABLE_THUNKS
#define DEFAULT_VTABLE_THUNKS 1
diff --git a/gcc/config/m32r/m32r.c b/gcc/config/m32r/m32r.c
index 09b7e43e6c5..f57e2798edf 100644
--- a/gcc/config/m32r/m32r.c
+++ b/gcc/config/m32r/m32r.c
@@ -27,7 +27,6 @@ Boston, MA 02111-1307, USA. */
#include "real.h"
#include "insn-config.h"
#include "conditions.h"
-#include "insn-flags.h"
#include "output.h"
#include "insn-attr.h"
#include "flags.h"
diff --git a/gcc/config/m32r/xm-m32r.h b/gcc/config/m32r/xm-m32r.h
index 57100c875cd..b49f76b2918 100644
--- a/gcc/config/m32r/xm-m32r.h
+++ b/gcc/config/m32r/xm-m32r.h
@@ -18,10 +18,6 @@ along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-/* #defines that need visibility everywhere. */
-#define FALSE 0
-#define TRUE 1
-
/* This describes the machine the compiler is hosted on. */
#define HOST_BITS_PER_CHAR 8
#define HOST_BITS_PER_SHORT 16
diff --git a/gcc/config/m68hc11/larith.asm b/gcc/config/m68hc11/larith.asm
index e75772964f1..6ec9ba57f4d 100644
--- a/gcc/config/m68hc11/larith.asm
+++ b/gcc/config/m68hc11/larith.asm
@@ -1,5 +1,5 @@
-/* libgcc1 routines for M68HC11.
- Copyright (C) 1999, 2000 Free Software Foundation, Inc.
+/* libgcc1 routines for M68HC11 & M68HC12.
+ Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -47,35 +47,74 @@ NAME: .word 0; \
/* Pseudo hard registers used by gcc.
They must be located in page0.
They will normally appear at the end of .page0 section. */
+#ifdef mc68hc12
+ .sect .bss
+#else
.sect .page0
- .globl _.tmp,_.frame
+#endif
+ .globl _.tmp
.globl _.z,_.xy
REG(_.tmp)
REG(_.z)
REG(_.xy)
-REG(_.frame)
#endif
-#ifdef L_regs_d1_8
-/* Pseudo hard registers used by gcc.
- They must be located in page0.
- They will normally appear at the end of .page0 section. */
+#ifdef L_regs_frame
+#ifdef mc68hc12
+ .sect .bss
+#else
.sect .page0
- .globl _.d1,_.d2,_.d3,_.d4,_.d5,_.d6
- .globl _.d7,_.d8
+#endif
+ .globl _.frame
+REG(_.frame)
+#endif
+
+#ifdef L_regs_d1_2
+#ifdef mc68hc12
+ .sect .bss
+#else
+ .sect .page0
+#endif
+ .globl _.d1,_.d2
REG(_.d1)
REG(_.d2)
+#endif
+
+#ifdef L_regs_d3_4
+#ifdef mc68hc12
+ .sect .bss
+#else
+ .sect .page0
+#endif
+ .globl _.d3,_.d4
REG(_.d3)
REG(_.d4)
+#endif
+
+#ifdef L_regs_d5_6
+#ifdef mc68hc12
+ .sect .bss
+#else
+ .sect .page0
+#endif
+ .globl _.d5,_.d6
REG(_.d5)
REG(_.d6)
+#endif
+
+#ifdef L_regs_d7_8
+#ifdef mc68hc12
+ .sect .bss
+#else
+ .sect .page0
+#endif
+ .globl _.d7,_.d8
REG(_.d7)
REG(_.d8)
-
#endif
-#ifdef L_regs_d8_16
+#ifdef L_regs_d9_16
/* Pseudo hard registers used by gcc.
They must be located in page0.
They will normally appear at the end of .page0 section. */
@@ -97,7 +136,11 @@ REG(_.d16)
/* Pseudo hard registers used by gcc.
They must be located in page0.
They will normally appear at the end of .page0 section. */
+#ifdef mc68hc12
+ .sect .bss
+#else
.sect .page0
+#endif
.globl _.d17,_.d18,_.d19,_.d20,_.d21,_.d22
.globl _.d23,_.d24,_.d25,_.d26,_.d27,_.d28
.globl _.d29,_.d30,_.d31,_.d32
@@ -136,13 +179,26 @@ __premain:
;;
;; Exit operation. Just loop forever and wait for interrupts.
;; (no other place to go)
+;; This operation is split in several pieces collected together by
+;; the linker script. This allows to support destructors at the
+;; exit stage while not impacting program sizes when there is no
+;; destructors.
;;
- .sect .text
- .globl _exit
+;; _exit:
+;; *(.fini0) /* Beginning of finish code (_exit symbol). */
+;; *(.fini1) /* Place holder for applications. */
+;; *(.fini2) /* C++ destructors. */
+;; *(.fini3) /* Place holder for applications. */
+;; *(.fini4) /* Runtime exit. */
+;;
+ .sect .fini0,"ax",@progbits
+ .globl _exit
.globl exit
.weak exit
exit:
_exit:
+
+ .sect .fini4,"ax",@progbits
fatal:
cli
wai
@@ -157,8 +213,12 @@ fatal:
.globl abort
abort:
ldd #255 ;
+#ifdef mc68hc12
+ trap #0x30
+#else
.byte 0xCD ; Generate an illegal instruction trap
.byte 0x03 ; The simulator catches this and stops.
+#endif
jmp _exit
#endif
@@ -189,6 +249,23 @@ _cleanup:
;;;
__memcpy:
memcpy:
+#ifdef mc68hc12
+ ldx 2,sp
+ ldy 4,sp
+ pshd
+ xgdy
+ lsrd
+ bcc Start
+ movb 1,x+,1,y+
+Start:
+ beq Done
+Loop:
+ movw 2,x+,2,y+
+ dbne d,Loop
+Done:
+ puld
+ rts
+#else
xgdy
tsx
ldd 4,x
@@ -214,6 +291,7 @@ End:
xgdy
rts
#endif
+#endif
#ifdef L_memset
.sect .text
@@ -237,6 +315,19 @@ End:
#endif
__memset:
memset:
+#ifdef mc68hc12
+ xgdx
+ ldab val,sp
+ ldy size,sp
+ pshx
+ beq End
+Loop:
+ stab 1,x+
+ dbne y,Loop
+End:
+ puld
+ rts
+#else
xgdx
tsy
ldab val,y
@@ -253,6 +344,7 @@ End:
xgdx
rts
#endif
+#endif
#ifdef L_adddi3
.sect .text
@@ -260,29 +352,28 @@ End:
___adddi3:
tsx
- tsy
pshb
psha
ldd 8,x
- addd 16,y
+ addd 16,x
pshb
psha
ldd 6,x
- adcb 15,y
- adca 14,y
+ adcb 15,x
+ adca 14,x
pshb
psha
ldd 4,x
- adcb 13,y
- adca 12,y
+ adcb 13,x
+ adca 12,x
pshb
psha
ldd 2,x
- adcb 11,y
- adca 10,y
+ adcb 11,x
+ adca 10,x
tsx
ldy 6,x
@@ -303,29 +394,28 @@ ___adddi3:
___subdi3:
tsx
- tsy
pshb
psha
ldd 8,x
- subd 16,y
+ subd 16,x
pshb
psha
ldd 6,x
- sbcb 15,y
- sbca 14,y
+ sbcb 15,x
+ sbca 14,x
pshb
psha
ldd 4,x
- sbcb 13,y
- sbca 12,y
+ sbcb 13,x
+ sbca 12,x
pshb
psha
ldd 2,x
- sbcb 11,y
- sbca 10,y
+ sbcb 11,x
+ sbca 10,x
tsx
ldy 6,x
@@ -582,6 +672,9 @@ Return_zero:
#endif
#ifdef L_divmodhi4
+#ifndef mc68hc12
+/* 68HC12 signed divisions are generated inline (idivs). */
+
.sect .text
.globl __divmodhi4
@@ -646,6 +739,7 @@ Numerator_neg_denominator_pos:
comb
addd #1
rts
+#endif /* !mc68hc12 */
#endif
#ifdef L_mulqi3
@@ -681,7 +775,6 @@ A_or_B_neg:
addd #1
rts
AB_neg:
- nega
negb
mul
rts
@@ -699,6 +792,13 @@ AB_neg:
; b = register X
;
___mulhi3:
+#ifdef mc68hc12
+ pshx ; Preserve X
+ exg x,y
+ emul
+ exg x,y
+ pulx
+#else
stx *_.tmp
pshb
ldab *_.tmp+1
@@ -714,6 +814,7 @@ ___mulhi3:
pulb
mul ; A.low * B.low
adda *_.tmp
+#endif
rts
#endif
@@ -750,6 +851,11 @@ ___mulhi3:
; <A-high> 0,x
;
__mulhi32:
+#ifdef mc68hc12
+ ldy 2,sp
+ emul
+ exg x,y
+#else
pshb
psha
tsx
@@ -781,6 +887,7 @@ N:
Ret:
pshy
pulx
+#endif
rts
#endif
@@ -806,11 +913,27 @@ Ret:
;
;
+__mulsi3:
+#ifdef mc68hc12
+ pshd ; Save A.low
+ ldy 4,sp
+ emul ; A.low * B.high
+ ldy 6,sp
+ exg x,d
+ emul ; A.high * B.low
+ leax d,x
+ ldy 6,sp
+ puld
+ emul ; A.low * B.low
+ exg d,y
+ leax d,x
+ exg d,y
+ rts
+#else
B_low = 8
B_high = 6
A_low = 0
A_high = 2
-__mulsi3:
pshx
pshb
psha
@@ -921,10 +1044,11 @@ A_low_B_low:
bsr __mulhi32
bra Return
#endif
+#endif
#ifdef L_map_data
- .sect .install3,"ax",@progbits
+ .sect .install2,"ax",@progbits
.globl __map_data_section
__map_data_section:
@@ -933,6 +1057,10 @@ __map_data_section:
ldx #__data_image
ldy #__data_section_start
Loop:
+#ifdef mc68hc12
+ movb 1,x+,1,y+
+ dbne d,Loop
+#else
psha
ldaa 0,x
staa 0,y
@@ -941,13 +1069,14 @@ Loop:
iny
subd #1
bne Loop
+#endif
Done:
#endif
#ifdef L_init_bss
- .sect .install3,"ax",@progbits
+ .sect .install2,"ax",@progbits
.globl __init_bss_section
__init_bss_section:
@@ -955,14 +1084,70 @@ __init_bss_section:
beq Done
ldx #__bss_start
Loop:
+#ifdef mc68hc12
+ clr 1,x+
+ dbne d,Loop
+#else
clr 0,x
inx
subd #1
bne Loop
+#endif
Done:
#endif
-
+
+#ifdef L_ctor
+
+; End of constructor table
+ .sect .install3,"ax",@progbits
+ .globl __do_global_ctors
+
+__do_global_ctors:
+ ; Start from the end - sizeof(void*)
+ ldx #__CTOR_END__-2
+ctors_loop:
+ cpx #__CTOR_LIST__
+ blt ctors_done
+ pshx
+ ldx 0,x
+ jsr 0,x
+ pulx
+ dex
+ dex
+ bra ctors_loop
+ctors_done:
+
+#endif
+
+#ifdef L_dtor
+
+ .sect .fini3,"ax",@progbits
+ .globl __do_global_dtors
+
+;;
+;; This piece of code is inserted in the _exit() code by the linker.
+;;
+__do_global_dtors:
+ pshb ; Save exit code
+ psha
+ ldx #__DTOR_LIST__
+dtors_loop:
+ cpx #__DTOR_END__
+ bge dtors_done
+ pshx
+ ldx 0,x
+ jsr 0,x
+ pulx
+ inx
+ inx
+ bra dtors_loop
+dtors_done:
+ pula ; Restore exit code
+ pulb
+
+#endif
+
;-----------------------------------------
; end required gcclib code
;-----------------------------------------
diff --git a/gcc/config/m68hc11/m68hc11-protos.h b/gcc/config/m68hc11/m68hc11-protos.h
index b63fa30f20e..22eccd02cab 100644
--- a/gcc/config/m68hc11/m68hc11-protos.h
+++ b/gcc/config/m68hc11/m68hc11-protos.h
@@ -1,5 +1,5 @@
/* Prototypes for exported functions defined in m68hc11.c
- Copyright (C) 1999, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
Contributed by Stephane Carrez (stcarrez@worldnet.fr)
This file is part of GNU CC.
@@ -53,15 +53,15 @@ extern void m68hc11_encode_section_info PARAMS((tree));
#endif
#ifdef RTX_CODE
-#if GCC_VERSION > 2095
extern rtx m68hc11_compare_op0;
extern rtx m68hc11_compare_op1;
-#endif
extern rtx m68hc11_soft_tmp_reg;
extern rtx iy_reg;
extern rtx d_reg;
+extern void m68hc11_initialize_trampoline PARAMS((rtx, rtx, rtx));
+
extern rtx m68hc11_expand_compare_and_branch PARAMS((enum rtx_code,
rtx, rtx, rtx));
extern enum reg_class preferred_reload_class PARAMS((rtx, enum reg_class));
@@ -73,6 +73,7 @@ extern int m68hc11_go_if_legitimate_address PARAMS((rtx,
extern int m68hc11_legitimize_address PARAMS((rtx*, rtx, enum machine_mode));
extern void m68hc11_notice_update_cc PARAMS((rtx, rtx));
+extern void m68hc11_notice_keep_cc PARAMS((rtx));
extern void m68hc11_reorg PARAMS((rtx));
@@ -140,8 +141,6 @@ extern int hard_reg_operand PARAMS((rtx, enum machine_mode));
extern int soft_reg_operand PARAMS((rtx, enum machine_mode));
extern int reg_or_some_mem_operand PARAMS((rtx, enum machine_mode));
-extern enum reg_class limit_reload_class PARAMS((enum machine_mode, enum reg_class));
-
#if defined TREE_CODE
extern void m68hc11_init_cumulative_args PARAMS((CUMULATIVE_ARGS*,
tree,
@@ -165,10 +164,8 @@ extern void m68hc11_function_epilogue PARAMS((FILE*,int));
#endif /* TREE_CODE */
-#if GCC_VERSION > 2095
extern HOST_WIDE_INT m68hc11_min_offset;
extern HOST_WIDE_INT m68hc11_max_offset;
-#endif
#endif /* HAVE_MACHINE_MODES */
#endif /* RTX_CODE */
diff --git a/gcc/config/m68hc11/m68hc11.c b/gcc/config/m68hc11/m68hc11.c
index 2fcf4ce6dab..32ab108a552 100644
--- a/gcc/config/m68hc11/m68hc11.c
+++ b/gcc/config/m68hc11/m68hc11.c
@@ -37,15 +37,12 @@ Note:
#include "system.h"
#include "rtl.h"
#include "tree.h"
-#if GCC_VERSION > 2095
#include "tm_p.h"
-#endif
#include "regs.h"
#include "hard-reg-set.h"
#include "real.h"
#include "insn-config.h"
#include "conditions.h"
-#include "insn-flags.h"
#include "output.h"
#include "insn-attr.h"
#include "flags.h"
@@ -53,16 +50,8 @@ Note:
#include "expr.h"
#include "toplev.h"
#include "basic-block.h"
-#if GCC_VERSION > 2095
#include "function.h"
#include "ggc.h"
-#else
-#include "m68hc11-protos.h"
-#endif
-
-#if GCC_VERSION == 2095
-extern char *version_string;
-#endif
static void print_options PARAMS ((FILE *));
static void emit_move_after_reload PARAMS ((rtx, rtx, rtx));
@@ -73,7 +62,7 @@ static int go_if_legitimate_address_internal PARAMS((rtx, enum machine_mode,
static int register_indirect_p PARAMS((rtx, enum machine_mode, int));
static rtx m68hc11_expand_compare PARAMS((enum rtx_code, rtx, rtx));
static int must_parenthesize PARAMS ((rtx));
-
+static int m68hc11_shift_cost PARAMS ((enum machine_mode, rtx, int));
static int m68hc11_auto_inc_p PARAMS ((rtx));
void create_regs_rtx PARAMS ((void));
@@ -131,6 +120,78 @@ rtx m68hc11_compare_op0;
rtx m68hc11_compare_op1;
+struct processor_costs *m68hc11_cost;
+
+/* Costs for a 68HC11. */
+struct processor_costs m6811_cost = {
+ /* add */
+ COSTS_N_INSNS (2),
+ /* logical */
+ COSTS_N_INSNS (2),
+ /* non-constant shift */
+ COSTS_N_INSNS (20),
+ /* shiftQI const */
+ { COSTS_N_INSNS (0), COSTS_N_INSNS (1), COSTS_N_INSNS (2),
+ COSTS_N_INSNS (3), COSTS_N_INSNS (4), COSTS_N_INSNS (3),
+ COSTS_N_INSNS (2), COSTS_N_INSNS (1) },
+
+ /* shiftHI const */
+ { COSTS_N_INSNS (0), COSTS_N_INSNS (1), COSTS_N_INSNS (4),
+ COSTS_N_INSNS (6), COSTS_N_INSNS (8), COSTS_N_INSNS (6),
+ COSTS_N_INSNS (4), COSTS_N_INSNS (2),
+ COSTS_N_INSNS (2), COSTS_N_INSNS (4),
+ COSTS_N_INSNS (6), COSTS_N_INSNS (8), COSTS_N_INSNS (10),
+ COSTS_N_INSNS (8), COSTS_N_INSNS (6), COSTS_N_INSNS (4)
+ },
+ /* mulQI */
+ COSTS_N_INSNS (20),
+ /* mulHI */
+ COSTS_N_INSNS (20 * 4),
+ /* mulSI */
+ COSTS_N_INSNS (20 * 16),
+ /* divQI */
+ COSTS_N_INSNS (20),
+ /* divHI */
+ COSTS_N_INSNS (80),
+ /* divSI */
+ COSTS_N_INSNS (100)
+};
+
+/* Costs for a 68HC12. */
+struct processor_costs m6812_cost = {
+ /* add */
+ COSTS_N_INSNS (1),
+ /* logical */
+ COSTS_N_INSNS (1),
+ /* non-constant shift */
+ COSTS_N_INSNS (20),
+ /* shiftQI const */
+ { COSTS_N_INSNS (0), COSTS_N_INSNS (1), COSTS_N_INSNS (2),
+ COSTS_N_INSNS (3), COSTS_N_INSNS (4), COSTS_N_INSNS (3),
+ COSTS_N_INSNS (2), COSTS_N_INSNS (1) },
+
+ /* shiftHI const */
+ { COSTS_N_INSNS (0), COSTS_N_INSNS (1), COSTS_N_INSNS (4),
+ COSTS_N_INSNS (6), COSTS_N_INSNS (8), COSTS_N_INSNS (6),
+ COSTS_N_INSNS (4), COSTS_N_INSNS (2),
+ COSTS_N_INSNS (2), COSTS_N_INSNS (4), COSTS_N_INSNS (6),
+ COSTS_N_INSNS (8), COSTS_N_INSNS (10), COSTS_N_INSNS (8),
+ COSTS_N_INSNS (6), COSTS_N_INSNS (4)
+ },
+ /* mulQI */
+ COSTS_N_INSNS (3),
+ /* mulHI */
+ COSTS_N_INSNS (3),
+ /* mulSI */
+ COSTS_N_INSNS (3 * 4),
+ /* divQI */
+ COSTS_N_INSNS (12),
+ /* divHI */
+ COSTS_N_INSNS (12),
+ /* divSI */
+ COSTS_N_INSNS (100)
+};
+
/* Machine specific options */
const char *m68hc11_regparm_string;
@@ -141,32 +202,23 @@ static void m68hc11_add_gc_roots PARAMS ((void));
static int nb_soft_regs;
-#if GCC_VERSION > 2095
-/* Flag defined in c-decl.c
-
- Nonzero means don't recognize the non-ANSI builtin functions.
- -ansi sets this.
-
- It is set by 'm68hc11_override_options' to ensure that bcmp() and
- bzero() are not defined. Their prototype are wrong and they
- conflict with newlib definition. Don't define as external to
- avoid a link problem for f77. */
-int flag_no_nonansi_builtin;
-#endif
-
int
m68hc11_override_options ()
{
m68hc11_add_gc_roots ();
-#if GCC_VERSION > 2095
- flag_no_nonansi_builtin = 1;
-#endif
-
memset (m68hc11_reg_valid_for_index, 0,
sizeof (m68hc11_reg_valid_for_index));
memset (m68hc11_reg_valid_for_base, 0, sizeof (m68hc11_reg_valid_for_base));
+ /* Compilation with -fpic generates a wrong code. */
+ if (flag_pic)
+ {
+ warning ("-f%s ignored for 68HC11/68HC12 (not supported)",
+ (flag_pic > 1) ? "PIC" : "pic");
+ flag_pic = 0;
+ }
+
/* Configure for a 68hc11 processor. */
if (TARGET_M6811)
{
@@ -174,7 +226,8 @@ m68hc11_override_options ()
a -m68hc11 option was specified on the command line. */
if (TARGET_DEFAULT != MASK_M6811)
target_flags &= ~TARGET_DEFAULT;
-
+
+ m68hc11_cost = &m6811_cost;
m68hc11_min_offset = 0;
m68hc11_max_offset = 256;
m68hc11_index_reg_class = NO_REGS;
@@ -191,7 +244,8 @@ m68hc11_override_options ()
/* Configure for a 68hc12 processor. */
if (TARGET_M6812)
{
- m68hc11_min_offset = 0;
+ m68hc11_cost = &m6812_cost;
+ m68hc11_min_offset = -65536;
m68hc11_max_offset = 65536;
m68hc11_index_reg_class = D_REGS;
m68hc11_base_reg_class = A_OR_SP_REGS;
@@ -293,29 +347,6 @@ hard_regno_mode_ok (regno, mode)
}
enum reg_class
-limit_reload_class (mode, class)
- enum machine_mode mode;
- enum reg_class class;
-{
- if (mode == Pmode)
- {
- if (class == m68hc11_base_reg_class || class == SP_REGS
- || class == Y_REGS || class == X_REGS
- || class == X_OR_SP_REGS || class == Y_OR_S_REGS
- || class == A_OR_SP_REGS)
- return class;
-
- if (debug_m6811)
- {
- printf ("Forcing to A_REGS\n");
- fflush (stdout);
- }
- return m68hc11_base_reg_class;
- }
- return class;
-}
-
-enum reg_class
preferred_reload_class (operand, class)
rtx operand;
enum reg_class class;
@@ -748,13 +779,14 @@ m68hc11_emit_libcall (name, code, dmode, smode, noperands, operands)
switch (noperands)
{
case 2:
- ret = emit_library_call_value (libcall, NULL_RTX, 1, dmode, 1,
- operands[1], smode);
+ ret = emit_library_call_value (libcall, NULL_RTX, LCT_CONST,
+ dmode, 1, operands[1], smode);
equiv = gen_rtx (code, dmode, operands[1]);
break;
case 3:
- ret = emit_library_call_value (libcall, operands[0], 1, dmode, 2,
+ ret = emit_library_call_value (libcall, NULL_RTX,
+ LCT_CONST, dmode, 2,
operands[1], smode, operands[2],
smode);
equiv = gen_rtx (code, dmode, operands[1], operands[2]);
@@ -880,7 +912,8 @@ d_register_operand (operand, mode)
return GET_CODE (operand) == REG
&& (REGNO (operand) >= FIRST_PSEUDO_REGISTER
- || REGNO (operand) == HARD_D_REGNUM);
+ || REGNO (operand) == HARD_D_REGNUM
+ || (mode == QImode && REGNO (operand) == HARD_B_REGNUM));
}
int
@@ -1032,6 +1065,54 @@ m68hc11_function_block_profiler (out, block_or_label)
{
return 0;
}
+
+/* Emit the code to build the trampoline used to call a nested function.
+
+ 68HC11 68HC12
+
+ ldy #&CXT movw #&CXT,*_.d1
+ sty *_.d1 jmp FNADDR
+ jmp FNADDR
+
+*/
+void
+m68hc11_initialize_trampoline (tramp, fnaddr, cxt)
+ rtx tramp;
+ rtx fnaddr;
+ rtx cxt;
+{
+ char *static_chain_reg = reg_names[STATIC_CHAIN_REGNUM];
+
+ /* Skip the '*'. */
+ if (*static_chain_reg == '*')
+ static_chain_reg++;
+ if (TARGET_M6811)
+ {
+ emit_move_insn (gen_rtx_MEM (HImode, tramp), GEN_INT (0x18ce));
+ emit_move_insn (gen_rtx_MEM (HImode, plus_constant (tramp, 2)), cxt);
+ emit_move_insn (gen_rtx_MEM (HImode, plus_constant (tramp, 4)),
+ GEN_INT (0x18df));
+ emit_move_insn (gen_rtx_MEM (QImode, plus_constant (tramp, 6)),
+ gen_rtx_CONST (QImode,
+ gen_rtx_SYMBOL_REF (Pmode,
+ static_chain_reg)));
+ emit_move_insn (gen_rtx_MEM (QImode, plus_constant (tramp, 7)),
+ GEN_INT (0x7e));
+ emit_move_insn (gen_rtx_MEM (HImode, plus_constant (tramp, 8)), fnaddr);
+ }
+ else
+ {
+ emit_move_insn (gen_rtx_MEM (HImode, tramp), GEN_INT (0x1803));
+ emit_move_insn (gen_rtx_MEM (HImode, plus_constant (tramp, 2)), cxt);
+ emit_move_insn (gen_rtx_MEM (HImode, plus_constant (tramp, 4)),
+ gen_rtx_CONST (HImode,
+ gen_rtx_SYMBOL_REF (Pmode,
+ static_chain_reg)));
+ emit_move_insn (gen_rtx_MEM (QImode, plus_constant (tramp, 6)),
+ GEN_INT (0x06));
+ emit_move_insn (gen_rtx_MEM (HImode, plus_constant (tramp, 7)), fnaddr);
+ }
+}
/* Declaration of types. */
@@ -1174,7 +1255,7 @@ m68hc11_initial_elimination_offset (from, to)
if (from == FRAME_POINTER_REGNUM && to == HARD_FRAME_POINTER_REGNUM)
{
- return 0;
+ return m68hc11_sp_correction;
}
/* Push any 2 byte pseudo hard registers that we need to save. */
@@ -1193,7 +1274,7 @@ m68hc11_initial_elimination_offset (from, to)
if (from == FRAME_POINTER_REGNUM && to == HARD_SP_REGNUM)
{
- return size - m68hc11_sp_correction;
+ return size;
}
return 0;
}
@@ -1325,8 +1406,6 @@ m68hc11_function_arg (cum, mode, type, named)
return NULL_RTX;
}
-#if GCC_VERSION > 2095
-
/* The "standard" implementation of va_start: just assign `nextarg' to
the variable. */
void
@@ -1394,7 +1473,6 @@ m68hc11_va_arg (valist, type)
return addr;
}
-#endif
/* 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
@@ -1862,18 +1940,30 @@ m68hc11_gen_highpart (mode, x)
}
/* gen_highpart crashes when it is called with a SUBREG. */
- if (GET_CODE (x) == SUBREG && SUBREG_WORD (x) != 0)
+ if (GET_CODE (x) == SUBREG)
{
return gen_rtx (SUBREG, mode, XEXP (x, 0), XEXP (x, 1));
}
- x = gen_highpart (mode, x);
+ if (GET_CODE (x) == REG)
+ {
+ if (REGNO (x) < FIRST_PSEUDO_REGISTER)
+ return gen_rtx (REG, mode, REGNO (x));
+ else
+ return gen_rtx_SUBREG (mode, x, 0);
+ }
- /* Return a different rtx to avoid to share it in several insns
- (when used by a split pattern). Sharing addresses within
- a MEM breaks the Z register replacement (and reloading). */
if (GET_CODE (x) == MEM)
- x = copy_rtx (x);
- return x;
+ {
+ x = change_address (x, mode, 0);
+
+ /* Return a different rtx to avoid to share it in several insns
+ (when used by a split pattern). Sharing addresses within
+ a MEM breaks the Z register replacement (and reloading). */
+ if (GET_CODE (x) == MEM)
+ x = copy_rtx (x);
+ return x;
+ }
+ abort ();
}
@@ -2143,9 +2233,19 @@ print_operand (file, op, letter)
}
else
{
+ int need_parenthesize = 0;
+
if (letter != 'i')
asm_fprintf (file, "%0I");
+ else
+ need_parenthesize = must_parenthesize (op);
+
+ if (need_parenthesize)
+ asm_fprintf (file, "(");
+
output_addr_const (file, op);
+ if (need_parenthesize)
+ asm_fprintf (file, ")");
}
}
@@ -2526,6 +2626,7 @@ m68hc11_split_move (to, from, scratch)
rtx low_to, low_from;
rtx high_to, high_from;
enum machine_mode mode;
+ int offset = 0;
mode = GET_MODE (to);
if (GET_MODE_SIZE (mode) == 8)
@@ -2535,6 +2636,22 @@ m68hc11_split_move (to, from, scratch)
else
mode = QImode;
+ if (TARGET_M6812
+ && IS_STACK_PUSH (to)
+ && reg_mentioned_p (gen_rtx (REG, HImode, HARD_SP_REGNUM), from))
+ {
+ if (mode == SImode)
+ {
+ offset = 4;
+ }
+ else if (mode == HImode)
+ {
+ offset = 2;
+ }
+ else
+ offset = 0;
+ }
+
low_to = m68hc11_gen_lowpart (mode, to);
high_to = m68hc11_gen_highpart (mode, to);
@@ -2549,6 +2666,11 @@ m68hc11_split_move (to, from, scratch)
else
high_from = m68hc11_gen_highpart (mode, from);
+ if (offset)
+ {
+ high_from = adj_offsettable_operand (high_from, offset);
+ low_from = high_from;
+ }
if (mode == SImode)
{
m68hc11_split_move (low_to, low_from, scratch);
@@ -2841,6 +2963,7 @@ m68hc11_gen_movhi (insn, operands)
{
if (IS_STACK_PUSH (operands[0]) && H_REG_P (operands[1]))
{
+ cc_status = cc_prev_status;
switch (REGNO (operands[1]))
{
case HARD_X_REGNUM:
@@ -2855,6 +2978,7 @@ m68hc11_gen_movhi (insn, operands)
}
if (IS_STACK_POP (operands[1]) && H_REG_P (operands[0]))
{
+ cc_status = cc_prev_status;
switch (REGNO (operands[0]))
{
case HARD_X_REGNUM:
@@ -2869,6 +2993,7 @@ m68hc11_gen_movhi (insn, operands)
}
if (H_REG_P (operands[0]) && H_REG_P (operands[1]))
{
+ m68hc11_notice_keep_cc (operands[0]);
output_asm_insn ("tfr\t%1,%0", operands);
}
else if (H_REG_P (operands[0]))
@@ -2910,6 +3035,7 @@ m68hc11_gen_movhi (insn, operands)
else
{
/* !!!! SCz wrong here. */
+ fatal_insn ("Move insn not handled", insn);
}
}
else
@@ -2921,6 +3047,7 @@ m68hc11_gen_movhi (insn, operands)
}
else
{
+ m68hc11_notice_keep_cc (operands[0]);
output_asm_insn ("movw\t%1,%0", operands);
}
}
@@ -2930,6 +3057,7 @@ m68hc11_gen_movhi (insn, operands)
if (IS_STACK_POP (operands[1]) && H_REG_P (operands[0]))
{
+ cc_status = cc_prev_status;
switch (REGNO (operands[0]))
{
case HARD_X_REGNUM:
@@ -2965,7 +3093,7 @@ m68hc11_gen_movhi (insn, operands)
}
else
{
- cc_status = cc_prev_status;
+ m68hc11_notice_keep_cc (operands[0]);
output_asm_insn ("pshx\n\tpula\n\tpulb", operands);
}
}
@@ -3020,7 +3148,7 @@ m68hc11_gen_movhi (insn, operands)
}
else
{
- cc_status = cc_prev_status;
+ m68hc11_notice_keep_cc (operands[0]);
output_asm_insn ("pshb", operands);
output_asm_insn ("psha", operands);
output_asm_insn ("pulx", operands);
@@ -3028,8 +3156,20 @@ m68hc11_gen_movhi (insn, operands)
}
else if (Y_REG_P (operands[1]))
{
- output_asm_insn ("sty\t%t1", operands);
- output_asm_insn ("ldx\t%t1", operands);
+ /* When both D and Y are dead, use the sequence xgdy, xgdx
+ to move Y into X. The D and Y registers are modified. */
+ if (optimize && find_regno_note (insn, REG_DEAD, HARD_Y_REGNUM)
+ && dead_register_here (insn, d_reg))
+ {
+ output_asm_insn ("xgdy", operands);
+ output_asm_insn ("xgdx", operands);
+ CC_STATUS_INIT;
+ }
+ else
+ {
+ output_asm_insn ("sty\t%t1", operands);
+ output_asm_insn ("ldx\t%t1", operands);
+ }
}
else if (SP_REG_P (operands[1]))
{
@@ -3058,8 +3198,20 @@ m68hc11_gen_movhi (insn, operands)
}
else if (X_REG_P (operands[1]))
{
- output_asm_insn ("stx\t%t1", operands);
- output_asm_insn ("ldy\t%t1", operands);
+ /* When both D and X are dead, use the sequence xgdx, xgdy
+ to move X into Y. The D and X registers are modified. */
+ if (optimize && find_regno_note (insn, REG_DEAD, HARD_X_REGNUM)
+ && dead_register_here (insn, d_reg))
+ {
+ output_asm_insn ("xgdx", operands);
+ output_asm_insn ("xgdy", operands);
+ CC_STATUS_INIT;
+ }
+ else
+ {
+ output_asm_insn ("stx\t%t1", operands);
+ output_asm_insn ("ldy\t%t1", operands);
+ }
}
else if (SP_REG_P (operands[1]))
{
@@ -3076,7 +3228,7 @@ m68hc11_gen_movhi (insn, operands)
case HARD_SP_REGNUM:
if (D_REG_P (operands[1]))
{
- cc_status = cc_prev_status;
+ m68hc11_notice_keep_cc (operands[0]);
output_asm_insn ("xgdx", operands);
output_asm_insn ("txs", operands);
output_asm_insn ("xgdx", operands);
@@ -3117,6 +3269,7 @@ m68hc11_gen_movhi (insn, operands)
if (IS_STACK_PUSH (operands[0]) && H_REG_P (operands[1]))
{
+ cc_status = cc_prev_status;
switch (REGNO (operands[1]))
{
case HARD_X_REGNUM:
@@ -3158,7 +3311,17 @@ m68hc11_gen_movhi (insn, operands)
if (ix_reg == 0)
create_regs_rtx ();
- if (reg_mentioned_p (ix_reg, operands[0]))
+ if (REG_P (operands[0]) && REGNO (operands[0]) == SOFT_TMP_REGNUM)
+ {
+ output_asm_insn ("pshx", operands);
+ output_asm_insn ("tsx", operands);
+ output_asm_insn ("inx", operands);
+ output_asm_insn ("inx", operands);
+ output_asm_insn ("stx\t%0", operands);
+ output_asm_insn ("pulx", operands);
+ }
+
+ else if (reg_mentioned_p (ix_reg, operands[0]))
{
output_asm_insn ("sty\t%t0", operands);
output_asm_insn ("tsy", operands);
@@ -3200,25 +3363,26 @@ m68hc11_gen_movqi (insn, operands)
if (H_REG_P (operands[0]) && H_REG_P (operands[1]))
{
+ m68hc11_notice_keep_cc (operands[0]);
output_asm_insn ("tfr\t%1,%0", operands);
}
else if (H_REG_P (operands[0]))
{
if (Q_REG_P (operands[0]))
- output_asm_insn ("lda%0\t%1", operands);
+ output_asm_insn ("lda%0\t%b1", operands);
else if (D_REG_P (operands[0]))
- output_asm_insn ("ldab\t%1", operands);
+ output_asm_insn ("ldab\t%b1", operands);
else
- output_asm_insn ("ld%0\t%1", operands);
+ goto m6811_move;
}
else if (H_REG_P (operands[1]))
{
if (Q_REG_P (operands[1]))
- output_asm_insn ("sta%1\t%0", operands);
+ output_asm_insn ("sta%1\t%b0", operands);
else if (D_REG_P (operands[1]))
- output_asm_insn ("staa\t%0", operands);
+ output_asm_insn ("stab\t%b0", operands);
else
- output_asm_insn ("st%1\t%0", operands);
+ goto m6811_move;
}
else
{
@@ -3245,6 +3409,7 @@ m68hc11_gen_movqi (insn, operands)
else
{
/* !!!! SCz wrong here. */
+ fatal_insn ("Move insn not handled", insn);
}
}
else
@@ -3255,13 +3420,15 @@ m68hc11_gen_movqi (insn, operands)
}
else
{
- output_asm_insn ("movb\t%1,%0", operands);
+ m68hc11_notice_keep_cc (operands[0]);
+ output_asm_insn ("movb\t%b1,%b0", operands);
}
}
}
return;
}
+ m6811_move:
if (H_REG_P (operands[0]))
{
switch (REGNO (operands[0]))
@@ -3636,6 +3803,24 @@ m68hc11_notice_update_cc (exp, insn)
&& reg_overlap_mentioned_p (cc_status.value1, cc_status.value2))
cc_status.value2 = 0;
}
+
+/* The current instruction does not affect the flags but changes
+ the register 'reg'. See if the previous flags can be kept for the
+ next instruction to avoid a comparison. */
+void
+m68hc11_notice_keep_cc (reg)
+ rtx reg;
+{
+ if (reg == 0
+ || cc_prev_status.value1 == 0
+ || rtx_equal_p (reg, cc_prev_status.value1)
+ || (cc_prev_status.value2
+ && reg_mentioned_p (reg, cc_prev_status.value2)))
+ CC_STATUS_INIT;
+ else
+ cc_status = cc_prev_status;
+}
+
/* Machine Specific Reorg. */
@@ -3721,6 +3906,7 @@ m68hc11_check_z_replacement (insn, info)
int this_insn_uses_ix;
int this_insn_uses_iy;
int this_insn_uses_z;
+ int this_insn_uses_z_in_dst;
int this_insn_uses_d;
rtx body;
int z_dies_here;
@@ -3824,10 +4010,13 @@ m68hc11_check_z_replacement (insn, info)
{
if (!reg_mentioned_p (z_reg, src))
{
- if (insn == info->first)
+ /* Z reg is used before being set. Treat this as
+ a new sequence of Z register replacement. */
+ if (insn != info->first)
{
- info->must_load_z = 0;
+ return 0;
}
+ info->must_load_z = 0;
}
info->z_set_count++;
info->z_value = src;
@@ -3847,9 +4036,23 @@ m68hc11_check_z_replacement (insn, info)
/* If z is used as an address operand (like (MEM (reg z))),
we can't replace it with d. */
- if (this_insn_uses_z && !Z_REG_P (src))
+ if (this_insn_uses_z && !Z_REG_P (src)
+ && !(m68hc11_arith_operator (src, GET_MODE (src))
+ && Z_REG_P (XEXP (src, 0))
+ && !reg_mentioned_p (z_reg, XEXP (src, 1))
+ && insn == info->first
+ && dead_register_here (insn, d_reg)))
info->can_use_d = 0;
- this_insn_uses_z |= reg_mentioned_p (z_reg, dst);
+
+ this_insn_uses_z_in_dst = reg_mentioned_p (z_reg, dst);
+ if (TARGET_M6812 && !z_dies_here
+ && ((this_insn_uses_z && side_effects_p (src))
+ || (this_insn_uses_z_in_dst && side_effects_p (dst))))
+ {
+ info->need_save_z = 1;
+ info->z_set_count++;
+ }
+ this_insn_uses_z |= this_insn_uses_z_in_dst;
if (this_insn_uses_z && this_insn_uses_ix && this_insn_uses_iy)
{
@@ -3866,6 +4069,9 @@ m68hc11_check_z_replacement (insn, info)
return 0;
}
+ if (this_insn_uses_ix && X_REG_P (dst) && GET_MODE (dst) == SImode)
+ info->can_use_d = 0;
+
if (info->x_used == 0 && this_insn_uses_ix)
{
if (info->y_used)
@@ -3928,8 +4134,8 @@ m68hc11_check_z_replacement (insn, info)
return 0;
}
info->x_used = 1;
- if (z_dies_here && !reg_mentioned_p (src, ix_reg)
- && GET_CODE (src) == REG && REGNO (src) == HARD_X_REGNUM)
+ if (z_dies_here && !reg_mentioned_p (ix_reg, src)
+ && GET_CODE (dst) == REG && REGNO (dst) == HARD_X_REGNUM)
{
info->need_save_z = 0;
info->z_died = 1;
@@ -3939,6 +4145,13 @@ m68hc11_check_z_replacement (insn, info)
info->must_restore_reg = 0;
return 0;
}
+ if (rtx_equal_p (src, z_reg) && rtx_equal_p (dst, ix_reg))
+ {
+ info->regno = HARD_X_REGNUM;
+ info->must_restore_reg = 0;
+ info->must_save_reg = 0;
+ return 0;
+ }
}
if (info->y_used == 0 && this_insn_uses_iy)
{
@@ -3999,8 +4212,8 @@ m68hc11_check_z_replacement (insn, info)
return 0;
}
info->y_used = 1;
- if (z_dies_here && !reg_mentioned_p (src, iy_reg)
- && GET_CODE (src) == REG && REGNO (src) == HARD_Y_REGNUM)
+ if (z_dies_here && !reg_mentioned_p (iy_reg, src)
+ && GET_CODE (dst) == REG && REGNO (dst) == HARD_Y_REGNUM)
{
info->need_save_z = 0;
info->z_died = 1;
@@ -4010,6 +4223,13 @@ m68hc11_check_z_replacement (insn, info)
info->must_restore_reg = 0;
return 0;
}
+ if (rtx_equal_p (src, z_reg) && rtx_equal_p (dst, iy_reg))
+ {
+ info->regno = HARD_Y_REGNUM;
+ info->must_restore_reg = 0;
+ info->must_save_reg = 0;
+ return 0;
+ }
}
if (z_dies_here)
{
@@ -4063,6 +4283,9 @@ m68hc11_check_z_replacement (insn, info)
if (Z_REG_P (dst))
info->z_set_count++;
}
+ if (TARGET_M6812 && uses_z && side_effects_p (x))
+ info->need_save_z = 1;
+
if (z_clobber)
info->need_save_z = 0;
}
@@ -4374,6 +4597,8 @@ m68hc11_z_replacement (insn)
&& INTVAL (src) == 0)
{
XEXP (body, 0) = gen_rtx (REG, GET_MODE (dst), SOFT_Z_REGNUM);
+ /* Force it to be re-recognized. */
+ INSN_CODE (insn) = -1;
return;
}
}
@@ -4589,73 +4814,24 @@ m68hc11_reassign_regs (first)
}
}
-#if GCC_VERSION == 2095
-/* Split all insns in the function. If UPD_LIFE, update life info after. */
-
-static int
-m68hc11_split_all_insns (first)
- rtx first;
-{
- rtx insn;
- int split_done = 0;
-
- for (insn = first; insn; insn = NEXT_INSN (insn))
- {
- rtx last;
-
- if (INSN_DELETED_P (insn))
- continue;
- if (GET_RTX_CLASS (GET_CODE (insn)) != 'i')
- continue;
-
- last = try_split (PATTERN (insn), insn, 1);
-
- /* When not optimizing, the old insn will be still left around
- with only the 'deleted' bit set. Transform it into a note
- to avoid confusion of subsequent processing. */
- if (INSN_DELETED_P (insn))
- {
- PUT_CODE (insn, NOTE);
- NOTE_LINE_NUMBER (insn) = NOTE_INSN_DELETED;
- NOTE_SOURCE_FILE (insn) = 0;
- split_done = 1;
- }
-
- if (last != insn)
- {
- PUT_CODE (insn, NOTE);
- NOTE_SOURCE_FILE (insn) = 0;
- NOTE_LINE_NUMBER (insn) = NOTE_INSN_DELETED;
- split_done = 1;
- }
- }
- return split_done;
-}
-#endif /* GCC_VERSION == 2095 */
-
void
m68hc11_reorg (first)
rtx first;
{
int split_done = 0;
+ rtx insn;
z_replacement_completed = 0;
z_reg = gen_rtx (REG, HImode, HARD_Z_REGNUM);
-#if GCC_VERSION > 2095
/* Some RTX are shared at this point. This breaks the Z register
replacement, unshare everything. */
unshare_all_rtl_again (first);
-#endif
/* Force a split of all splitable insn. This is necessary for the
Z register replacement mechanism because we end up with basic insns. */
-#if GCC_VERSION > 2095
split_all_insns (0);
split_done = 1;
-#else
- split_done = m68hc11_split_all_insns (first);
-#endif
z_replacement_completed = 1;
m68hc11_reassign_regs (first);
@@ -4669,14 +4845,30 @@ m68hc11_reorg (first)
description to use the best assembly directives. */
if (optimize)
{
-#if GCC_VERSION > 2095
+ /* Before recomputing the REG_DEAD notes, remove all of them.
+ This is necessary because the reload_cse_regs() pass can
+ have replaced some (MEM) with a register. In that case,
+ the REG_DEAD that could exist for that register may become
+ wrong. */
+ for (insn = first; insn; insn = NEXT_INSN (insn))
+ {
+ if (INSN_P (insn))
+ {
+ rtx *pnote;
+
+ pnote = &REG_NOTES (insn);
+ while (*pnote != 0)
+ {
+ if (REG_NOTE_KIND (*pnote) == REG_DEAD)
+ *pnote = XEXP (*pnote, 1);
+ else
+ pnote = &XEXP (*pnote, 1);
+ }
+ }
+ }
+
find_basic_blocks (first, max_reg_num (), 0);
life_analysis (first, 0, PROP_REG_INFO | PROP_DEATH_NOTES);
-#else
- find_basic_blocks (first, max_reg_num (), 0, 1);
- life_analysis (first, max_reg_num (), 0,
- 1 /* SCz: dead code elim fails. Must investigate. */ );
-#endif
}
z_replacement_completed = 2;
@@ -4685,11 +4877,7 @@ m68hc11_reorg (first)
split after Z register replacement. This gives more opportunities
for peephole (in particular for consecutives xgdx/xgdy). */
if (optimize > 0)
-#if GCC_VERSION > 2095
split_all_insns (0);
-#else
- m68hc11_split_all_insns (first);
-#endif
/* Once insns are split after the z_replacement_completed == 2,
we must not re-run the life_analysis. The xgdx/xgdy patterns
@@ -4728,8 +4916,6 @@ m68hc11_reorg (first)
/* Cost functions. */
-#define COSTS_N_INSNS(N) ((N) * 4 - 2)
-
/* Cost of moving memory. */
int
m68hc11_memory_move_cost (mode, class, in)
@@ -4860,10 +5046,43 @@ m68hc11_address_cost (addr)
return cost;
}
+static int
+m68hc11_shift_cost (mode, x, shift)
+ enum machine_mode mode;
+ rtx x;
+ int shift;
+{
+ int total;
+
+ total = rtx_cost (x, SET);
+ if (mode == QImode)
+ total += m68hc11_cost->shiftQI_const[shift % 8];
+ else if (mode == HImode)
+ total += m68hc11_cost->shiftHI_const[shift % 16];
+ else if (shift == 8 || shift == 16 || shift == 32)
+ total += m68hc11_cost->shiftHI_const[8];
+ else if (shift != 0 && shift != 16 && shift != 32)
+ {
+ total += m68hc11_cost->shiftHI_const[1] * shift;
+ }
+
+ /* For SI and others, the cost is higher. */
+ if (GET_MODE_SIZE (mode) > 2 && (shift % 16) != 0)
+ total *= GET_MODE_SIZE (mode) / 2;
+
+ /* When optimizing for size, make shift more costly so that
+ multiplications are prefered. */
+ if (optimize_size && (shift % 8) != 0)
+ total *= 2;
+
+ return total;
+}
+
int
m68hc11_rtx_costs (x, code, outer_code)
rtx x;
- enum rtx_code code, outer_code;
+ enum rtx_code code;
+ enum rtx_code outer_code ATTRIBUTE_UNUSED;
{
enum machine_mode mode = GET_MODE (x);
int extra_cost = 0;
@@ -4871,9 +5090,6 @@ m68hc11_rtx_costs (x, code, outer_code)
switch (code)
{
- case MEM:
- return m68hc11_address_cost (XEXP (x, 0)) + 4;
-
case ROTATE:
case ROTATERT:
case ASHIFT:
@@ -4881,82 +5097,87 @@ m68hc11_rtx_costs (x, code, outer_code)
case ASHIFTRT:
if (GET_CODE (XEXP (x, 1)) == CONST_INT)
{
- int val = INTVAL (XEXP (x, 1));
- int cost;
-
- /* 8 or 16 shift instructions are fast.
- Others are proportional to the shift counter. */
- if (val == 8 || val == 16 || val == -8 || val == -16)
- {
- val = 0;
- }
- cost = COSTS_N_INSNS (val + 1);
- cost += rtx_cost (XEXP (x, 0), outer_code);
- if (GET_MODE_SIZE (mode) >= 4 && val)
- {
- cost *= 4;
- }
- return cost;
- }
- total = rtx_cost (XEXP (x, 0), outer_code);
- if (GET_MODE_SIZE (mode) >= 4)
- {
- total += COSTS_N_INSNS (16);
- }
- else
- {
- total += COSTS_N_INSNS (8);
+ return m68hc11_shift_cost (mode, XEXP (x, 0), INTVAL (XEXP (x, 1)));
}
+
+ total = rtx_cost (XEXP (x, 0), code) + rtx_cost (XEXP (x, 1), code);
+ total += m68hc11_cost->shift_var;
return total;
- case MINUS:
- case PLUS:
case AND:
case XOR:
case IOR:
- extra_cost = 0;
+ total = rtx_cost (XEXP (x, 0), code) + rtx_cost (XEXP (x, 1), code);
+ total += m68hc11_cost->logical;
- total = rtx_cost (XEXP (x, 0), outer_code)
- + rtx_cost (XEXP (x, 1), outer_code);
- if (GET_MODE_SIZE (mode) <= 2)
- {
- total += COSTS_N_INSNS (2);
- }
- else
+ /* Logical instructions are byte instructions only. */
+ total *= GET_MODE_SIZE (mode);
+ return total;
+
+ case MINUS:
+ case PLUS:
+ total = rtx_cost (XEXP (x, 0), code) + rtx_cost (XEXP (x, 1), code);
+ total += m68hc11_cost->add;
+ if (GET_MODE_SIZE (mode) > 2)
{
- total += COSTS_N_INSNS (4);
+ total *= GET_MODE_SIZE (mode) / 2;
}
return total;
+ case UDIV:
case DIV:
case MOD:
- if (mode == QImode || mode == HImode)
- {
- return 30;
- }
- else if (mode == SImode)
- {
- return 100;
- }
- else
- {
- return 150;
- }
-
+ total = rtx_cost (XEXP (x, 0), code) + rtx_cost (XEXP (x, 1), code);
+ switch (mode)
+ {
+ case QImode:
+ total += m68hc11_cost->divQI;
+ break;
+
+ case HImode:
+ total += m68hc11_cost->divHI;
+ break;
+
+ case SImode:
+ default:
+ total += m68hc11_cost->divSI;
+ break;
+ }
+ return total;
+
case MULT:
- if (mode == QImode)
- {
- return TARGET_OP_TIME ? 10 : 2;
- }
- if (mode == HImode)
- {
- return TARGET_OP_TIME ? 30 : 4;
- }
- if (mode == SImode)
- {
- return TARGET_OP_TIME ? 100 : 20;
- }
- return 150;
+ /* mul instruction produces 16-bit result. */
+ if (mode == HImode && GET_CODE (XEXP (x, 0)) == ZERO_EXTEND
+ && GET_CODE (XEXP (x, 1)) == ZERO_EXTEND)
+ return m68hc11_cost->multQI
+ + rtx_cost (XEXP (XEXP (x, 0), 0), code)
+ + rtx_cost (XEXP (XEXP (x, 1), 0), code);
+
+ /* emul instruction produces 32-bit result for 68HC12. */
+ if (TARGET_M6812 && mode == SImode
+ && GET_CODE (XEXP (x, 0)) == ZERO_EXTEND
+ && GET_CODE (XEXP (x, 1)) == ZERO_EXTEND)
+ return m68hc11_cost->multHI
+ + rtx_cost (XEXP (XEXP (x, 0), 0), code)
+ + rtx_cost (XEXP (XEXP (x, 1), 0), code);
+
+ total = rtx_cost (XEXP (x, 0), code) + rtx_cost (XEXP (x, 1), code);
+ switch (mode)
+ {
+ case QImode:
+ total += m68hc11_cost->multQI;
+ break;
+
+ case HImode:
+ total += m68hc11_cost->multHI;
+ break;
+
+ case SImode:
+ default:
+ total += m68hc11_cost->multSI;
+ break;
+ }
+ return total;
case NEG:
case SIGN_EXTEND:
@@ -4967,20 +5188,20 @@ m68hc11_rtx_costs (x, code, outer_code)
case COMPARE:
case ABS:
case ZERO_EXTEND:
- total = rtx_cost (XEXP (x, 0), outer_code);
+ total = extra_cost + rtx_cost (XEXP (x, 0), code);
if (mode == QImode)
{
- return total + extra_cost + COSTS_N_INSNS (1);
+ return total + COSTS_N_INSNS (1);
}
if (mode == HImode)
{
- return total + extra_cost + COSTS_N_INSNS (2);
+ return total + COSTS_N_INSNS (2);
}
if (mode == SImode)
{
- return total + extra_cost + COSTS_N_INSNS (4);
+ return total + COSTS_N_INSNS (4);
}
- return total + extra_cost + COSTS_N_INSNS (8);
+ return total + COSTS_N_INSNS (8);
case IF_THEN_ELSE:
if (GET_CODE (XEXP (x, 1)) == PC || GET_CODE (XEXP (x, 2)) == PC)
@@ -4997,9 +5218,6 @@ m68hc11_rtx_costs (x, code, outer_code)
/* print_options - called at the start of the code generation for a
module. */
-#if GCC_VERSION == 2095
-extern char *main_input_filename;
-#endif
extern char *asm_file_name;
#include <time.h>
@@ -5053,7 +5271,6 @@ m68hc11_asm_file_start (out, main_file)
static void
m68hc11_add_gc_roots ()
{
-#if GCC_VERSION > 2095
ggc_add_rtx_root (&m68hc11_soft_tmp_reg, 1);
ggc_add_rtx_root (&ix_reg, 1);
ggc_add_rtx_root (&iy_reg, 1);
@@ -5063,5 +5280,4 @@ m68hc11_add_gc_roots ()
ggc_add_rtx_root (&z_reg_qi, 1);
ggc_add_rtx_root (&stack_push_word, 1);
ggc_add_rtx_root (&stack_pop_word, 1);
-#endif
}
diff --git a/gcc/config/m68hc11/m68hc11.h b/gcc/config/m68hc11/m68hc11.h
index 26ea8aa9e18..7a08fe49990 100644
--- a/gcc/config/m68hc11/m68hc11.h
+++ b/gcc/config/m68hc11/m68hc11.h
@@ -33,16 +33,6 @@ Note:
*/
-#undef GCC_VERSION
-#if 1 /* def N_*/
-# define GCC_VERSION 2096
-#else
-# define GCC_VERSION 2095
-
-/* NLS support in 2.96 */
-# define N_(X) X
-#endif
-
#include "elfos.h"
/*****************************************************************************
@@ -77,7 +67,8 @@ Note:
"%{mshort:-D__HAVE_SHORT_INT__ -D__INT__=16 -D__INT_MAX__=32767}\
%{!mshort:-D__INT__=32 -D__INT_MAX__=2147483647}\
%{m68hc12:-Dmc6812 -DMC6812 -Dmc68hc12}\
- %{!m68hc12:-Dmc6811 -DMC6811 -Dmc68hc11}"
+ %{!m68hc12:-Dmc6811 -DMC6811 -Dmc68hc11}\
+ %{fshort-double:-D__HAVE_SHORT_DOUBLE__}"
#endif
#undef STARTFILE_SPEC
@@ -93,30 +84,6 @@ Note:
#include "gansidecl.h"
-#if GCC_VERSION == 2095
-#ifndef PARAMS
-#if defined(ANSI_PROTOTYPES) || defined(__cplusplus)
-#define PARAMS(args) args
-#else
-#define PARAMS(args) ()
-#endif
-#endif
-
-/* Forward type declaration for prototypes definitions.
- rtx_ptr is equivalent to rtx. Can't use the same name. */
-struct rtx_def;
-typedef struct rtx_def *rtx_ptr;
-
-union tree_node;
-typedef union tree_node *tree_ptr;
-
-/* We can't declare enum machine_mode forward nor include 'machmode.h' here.
- Prototypes defined here will use an int instead. It's better than no
- prototype at all. */
-
-typedef int enum_machine_mode;
-#endif
-
/*****************************************************************************
**
** Run-time Target Specification
@@ -234,6 +201,25 @@ extern const char *m68hc11_soft_reg_count;
`-O'. That is what `OPTIMIZATION_OPTIONS' is for. */
#define OVERRIDE_OPTIONS m68hc11_override_options ();
+
+
+/* Define cost parameters for a given processor variant. */
+struct processor_costs {
+ int add; /* cost of an add instruction */
+ int logical; /* cost of a logical instruction */
+ int shift_var;
+ int shiftQI_const[8];
+ int shiftHI_const[16];
+ int multQI;
+ int multHI;
+ int multSI;
+ int divQI;
+ int divHI;
+ int divSI;
+};
+
+/* Costs for the current processor. */
+extern struct processor_costs *m68hc11_cost;
/* target machine storage layout */
@@ -722,6 +708,9 @@ enum reg_class
#define Y_REGNO_P(REGNO) ((REGNO) == HARD_Y_REGNUM)
#define Y_REG_P(X) (REG_P (X) && Y_REGNO_P (REGNO (X)))
+#define Z_REGNO_P(REGNO) ((REGNO) == HARD_Z_REGNUM)
+#define Z_REG_P(X) (REG_P (X) && Z_REGNO_P (REGNO (X)))
+
#define SP_REGNO_P(REGNO) ((REGNO) == HARD_SP_REGNUM)
#define SP_REG_P(X) (REG_P (X) && SP_REGNO_P (REGNO (X)))
@@ -796,9 +785,6 @@ extern enum reg_class m68hc11_tmp_regs_class;
#define PREFERRED_RELOAD_CLASS(X,CLASS) preferred_reload_class(X,CLASS)
-
-#define LIMIT_RELOAD_CLASS(MODE, CLASS) limit_reload_class(MODE,CLASS)
-
#define SMALL_REGISTER_CLASSES 1
/* A C expression whose value is nonzero if pseudos that have been
@@ -891,22 +877,17 @@ extern enum reg_class m68hc11_tmp_regs_class;
If FRAME_GROWS_DOWNWARD, this is the offset to the END of the
first local allocated. Otherwise, it is the offset to the BEGINNING
of the first local allocated. */
-extern int m68hc11_sp_correction;
-#define STARTING_FRAME_OFFSET m68hc11_sp_correction
+#define STARTING_FRAME_OFFSET 0
/* Offset of first parameter from the argument pointer register value. */
#define FIRST_PARM_OFFSET(FNDECL) 2
-/* 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 REG, indicating that the return
- value is saved in REG, or a MEM representing a location in
- the stack.
-
- Before the prologue, RA is at 0(sp). */
-#define INCOMING_RETURN_ADDR_RTX \
- gen_rtx_MEM (VOIDmode, gen_rtx_REG (VOIDmode, STACK_POINTER_REGNUM))
+/* After the prologue, RA is at 0(AP) in the current frame. */
+#define RETURN_ADDR_RTX(COUNT, FRAME) \
+ ((COUNT) == 0 \
+ ? gen_rtx_MEM (Pmode, arg_pointer_rtx) \
+ : 0)
/* Before the prologue, the top of the frame is at 2(sp). */
#define INCOMING_FRAME_SP_OFFSET 2
@@ -943,7 +924,7 @@ extern int m68hc11_sp_correction;
#define ARG_POINTER_REGNUM SOFT_AP_REGNUM
/* Register in which static-chain is passed to a function. */
-#define STATIC_CHAIN_REGNUM SOFT_REG_FIRST
+#define STATIC_CHAIN_REGNUM SOFT_Z_REGNUM
/* Definitions for register eliminations.
@@ -986,8 +967,6 @@ extern int m68hc11_sp_correction;
#define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \
{ OFFSET = m68hc11_initial_elimination_offset (FROM, TO); }
-/* LONGJMP_RESTORE_FROM_STACK */
-
/* Passing Function Arguments on the Stack. */
@@ -1155,7 +1134,7 @@ typedef struct m68hc11_args
/* Output assembler code to FILE to increment profiler label # LABELNO
for profiling a function entry. */
#define FUNCTION_PROFILER(FILE, LABELNO) \
- asm_fprintf (FILE, "\tldy LP%d\n\tjsr mcount\n", (LABELNO))
+ asm_fprintf (FILE, "\tldy\t.LP%d\n\tjsr mcount\n", (LABELNO))
/* Output assembler code to FILE to initialize this source file's
basic block profiling info, if that has not already been done. */
@@ -1194,21 +1173,17 @@ typedef struct m68hc11_args
asm ("puly"); \
}
-/* Output assembler code for a block containing the constant parts
- of a trampoline, leaving space for the variable parts. */
-#define TRAMPOLINE_TEMPLATE(FILE) { \
- fprintf (FILE, "\t.bogus\t\t; TRAMPOLINE_TEMPLATE unimplemented\n"); }
-
/* Length in units of the trampoline for entering a nested function. */
-#define TRAMPOLINE_SIZE 0
+#define TRAMPOLINE_SIZE (TARGET_M6811 ? 11 : 9)
/* A C statement to initialize the variable parts of a trampoline.
ADDR is an RTX for the address of the trampoline; FNADDR is an
RTX for the address of the nested function; STATIC_CHAIN is an
RTX for the static chain value that should be passed to the
function when it is called. */
-#define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) { \
- }
+#define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \
+ m68hc11_initialize_trampoline ((TRAMP), (FNADDR), (CXT))
+
/* If defined, a C expression whose value is nonzero if IDENTIFIER
@@ -1297,11 +1272,7 @@ extern enum reg_class m68hc11_index_reg_class;
/* Internal macro, return 1 if REGNO is a valid base register. */
-#if GCC_VERSION == 2095
-# define REG_VALID_P(REGNO) ((REGNO) >= 0)
-#else
-# define REG_VALID_P(REGNO) (1) /* ? */
-#endif
+#define REG_VALID_P(REGNO) (1) /* ? */
extern unsigned char m68hc11_reg_valid_for_base[FIRST_PSEUDO_REGISTER];
#define REG_VALID_FOR_BASE_P(REGNO) \
@@ -1487,22 +1458,54 @@ extern unsigned char m68hc11_reg_valid_for_index[FIRST_PSEUDO_REGISTER];
/* Compute the cost of computing a constant rtl expression RTX whose rtx-code
is CODE. The body of this macro is a portion of a switch statement. If
- the code is computed here, return it with a return statement. Otherwise,
- break from the switch. */
-#define CONST_COSTS(RTX,CODE,OUTER_CODE) \
- case CONST_INT: \
- if (RTX == const0_rtx) return 0; \
- case CONST: \
- return 0; \
- case LABEL_REF: \
- case SYMBOL_REF: \
- return 1; \
- case CONST_DOUBLE: \
+ the code is computed here, return it with a return statement. Otherwise,
+ break from the switch.
+
+ Constants are cheap. Moving them in registers must be avoided
+ because most instructions do not handle two register operands. */
+#define CONST_COSTS(RTX,CODE,OUTER_CODE) \
+ case CONST_INT: \
+ /* Logical and arithmetic operations with a constant */ \
+ /* operand are better because they are not supported */ \
+ /* with two registers. */ \
+ /* 'clr' is slow */ \
+ if ((OUTER_CODE) == SET && (RTX) == const0_rtx) \
+ /* After reload, the reload_cse pass checks the cost */ \
+ /* to change a SET into a PLUS. Make const0 cheap. */ \
+ return 1 - reload_completed; \
+ else \
+ return 0; \
+ case CONST: \
+ case LABEL_REF: \
+ case SYMBOL_REF: \
+ if ((OUTER_CODE) == SET) \
+ return 1 - reload_completed; \
+ return 0; \
+ case CONST_DOUBLE: \
return 0;
-#define DEFAULT_RTX_COSTS(X,CODE,OUTER_CODE) \
- return m68hc11_rtx_costs (X, CODE, OUTER_CODE);
-
+#define RTX_COSTS(X,CODE,OUTER_CODE) \
+ case ROTATE: \
+ case ROTATERT: \
+ case ASHIFT: \
+ case LSHIFTRT: \
+ case ASHIFTRT: \
+ case MINUS: \
+ case PLUS: \
+ case AND: \
+ case XOR: \
+ case IOR: \
+ case UDIV: \
+ case DIV: \
+ case MOD: \
+ case MULT: \
+ case NEG: \
+ case SIGN_EXTEND: \
+ case NOT: \
+ case COMPARE: \
+ case ZERO_EXTEND: \
+ case IF_THEN_ELSE: \
+ return m68hc11_rtx_costs (X, CODE, OUTER_CODE);
/* An expression giving the cost of an addressing mode that contains
ADDRESS. If not defined, the cost is computed from the ADDRESS
@@ -1600,6 +1603,52 @@ do { \
/* Output before uninitialized data. */
#define BSS_SECTION_ASM_OP ("\t.sect\t.bss")
+/* This is the pseudo-op used to generate a reference to a specific
+ symbol in some section. It is only used in machine-specific
+ configuration files, typically only in ASM_OUTPUT_CONSTRUCTOR and
+ ASM_OUTPUT_DESTRUCTOR. This is the same for all known svr4
+ assemblers, except those in targets that don't use 32-bit pointers.
+ Those should override INT_ASM_OP. Yes, the name of the macro is
+ misleading. */
+#undef INT_ASM_OP
+#define INT_ASM_OP "\t.word\t"
+
+/* Define the pseudo-ops used to switch to the .ctors and .dtors sections.
+
+ Same as config/elfos.h but don't mark these section SHF_WRITE since
+ there is no shared library problem. */
+#undef CTORS_SECTION_ASM_OP
+#define CTORS_SECTION_ASM_OP "\t.section\t.ctors,\"a\""
+
+#undef DTORS_SECTION_ASM_OP
+#define DTORS_SECTION_ASM_OP "\t.section\t.dtors,\"a\""
+
+#undef CTORS_SECTION_FUNCTION
+#define CTORS_SECTION_FUNCTION \
+void \
+ctors_section () \
+{ \
+ if (in_section != in_ctors) \
+ { \
+ fprintf (asm_out_file, "\t.globl\t__do_global_ctors\n"); \
+ fprintf (asm_out_file, "%s\n", CTORS_SECTION_ASM_OP); \
+ in_section = in_ctors; \
+ } \
+}
+
+#undef DTORS_SECTION_FUNCTION
+#define DTORS_SECTION_FUNCTION \
+void \
+dtors_section () \
+{ \
+ if (in_section != in_dtors) \
+ { \
+ fprintf (asm_out_file, "\t.globl\t__do_global_dtors\n"); \
+ fprintf (asm_out_file, "%s\n", DTORS_SECTION_ASM_OP); \
+ in_section = in_dtors; \
+ } \
+}
+
/* 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
@@ -1882,14 +1931,3 @@ extern int debug_m6811;
extern int z_replacement_completed;
extern int current_function_interrupt;
extern int current_function_trap;
-
-#if GCC_VERSION == 2095
-extern rtx_ptr iy_reg;
-extern rtx_ptr iy_reg;
-extern rtx_ptr d_reg;
-extern rtx_ptr m68hc11_soft_tmp_reg;
-extern rtx_ptr m68hc11_compare_op0;
-extern rtx_ptr m68hc11_compare_op1;
-extern long m68hc11_min_offset;
-extern long m68hc11_max_offset;
-#endif
diff --git a/gcc/config/m68hc11/m68hc11.md b/gcc/config/m68hc11/m68hc11.md
index 4cd495aad37..ecd8937cccb 100644
--- a/gcc/config/m68hc11/m68hc11.md
+++ b/gcc/config/m68hc11/m68hc11.md
@@ -115,6 +115,24 @@
;; Such split pattern must also be valid when z_replacement_completed == 2
;; because flow/cse is not aware that D is composed of {a, b}.
;;
+;; o Split patterns that generate a (mem:QI (symbol_reg _.dx)) to access
+;; the high part of a soft register must be expanded after z_replacement
+;; pass.
+;;
+;;---------------------------------------------------------------------------
+;; Constants
+
+(define_constants [
+ ;; Register numbers
+ (X_REGNUM 0) ; Index X register
+ (D_REGNUM 1) ; Data register
+ (Y_REGNUM 2) ; Index Y register
+ (SP_REGNUM 3) ; Stack pointer
+ (PC_REGNUM 4) ; Program counter
+ (A_REGNUM 5) ; A (high part of D)
+ (B_REGNUM 6) ; B (low part of D)
+ (CC_REGNUM 7) ; Condition code register
+])
;;--------------------------------------------------------------------
;;- Test
@@ -152,11 +170,11 @@
(define_insn "tsthi_1"
[(set (cc0)
- (match_operand:HI 0 "tst_operand" "dx,y"))]
+ (match_operand:HI 0 "tst_operand" "dx,*y"))]
""
"*
{
- if (D_REG_P (operands[0]))
+ if (D_REG_P (operands[0]) && !TARGET_M6812)
return \"std\\t%t0\";
else
return \"cp%0\\t#0\";
@@ -189,11 +207,11 @@
(define_insn "tstqi_1"
[(set (cc0)
- (match_operand:QI 0 "tst_operand" "d,m,*A,!u"))]
+ (match_operand:QI 0 "tst_operand" "m,d,*A,!u"))]
""
"@
- tstb
tst\\t%0
+ tstb
#
tst\\t%b0")
@@ -222,10 +240,10 @@
(use (match_operand:HI 1 "hard_reg_operand" "dxy"))
(use (reg:HI 11))]
"z_replacement_completed == 2"
- [(set (mem:HI (pre_dec:HI (reg:HI 3))) (match_dup 1))
+ [(set (mem:HI (pre_dec:HI (reg:HI SP_REGNUM))) (match_dup 1))
(set (match_dup 1) (match_dup 2))
(set (cc0) (match_dup 0))
- (set (match_dup 1) (mem:HI (post_inc:HI (reg:HI 3))))]
+ (set (match_dup 1) (mem:HI (post_inc:HI (reg:HI SP_REGNUM))))]
"operands[2] = gen_rtx (REG, HImode, SOFT_Z_REGNUM);")
@@ -285,13 +303,18 @@
(define_insn "cmphi_1"
[(set (cc0)
(compare (match_operand:HI 0 "tst_operand"
- "xy,d,?xy,d,dxy,dxy,dxy")
+ "x,dy,xyd,?xy,d,m,!u,dxy,dxy")
(match_operand:HI 1 "cmp_operand"
- "i,i,m,m,?*d*A,?u,!*w")))]
+ "i,i,!u,m,m,dxy,dxy,?*d*A,!*w")))]
""
"*
{
- if (H_REG_P (operands[1]))
+ if (H_REG_P (operands[1]) && !H_REG_P (operands[0]))
+ {
+ cc_status.flags |= CC_REVERSED;
+ return \"cp%1\\t%0\";
+ }
+ else if (H_REG_P (operands[1]))
return \"#\";
else
return \"cp%0\\t%1\";
@@ -299,24 +322,24 @@
(define_insn "cmphi_z_used"
[(set (cc0)
- (compare (match_operand:HI 0 "hard_reg_operand" "dxy")
- (match_operand:HI 1 "cmp_operand" "m")))
- (use (match_operand:HI 2 "hard_reg_operand" "dxy"))
+ (compare (match_operand:HI 0 "tst_operand" "dxy,m")
+ (match_operand:HI 1 "cmp_operand" "m,dxy")))
+ (use (match_operand:HI 2 "hard_reg_operand" "dxy,dxy"))
(use (reg:HI 11))]
""
"#")
(define_split /* "cmphi_z_used" */
[(set (cc0)
- (compare (match_operand:HI 0 "hard_reg_operand" "dxy")
- (match_operand:HI 1 "cmp_operand" "m")))
- (use (match_operand:HI 2 "hard_reg_operand" "dxy"))
+ (compare (match_operand:HI 0 "tst_operand" "dxy,m")
+ (match_operand:HI 1 "cmp_operand" "m,dxy")))
+ (use (match_operand:HI 2 "hard_reg_operand" "dxy,dxy"))
(use (reg:HI 11))]
"z_replacement_completed == 2"
- [(set (mem:HI (pre_dec:HI (reg:HI 3))) (match_dup 2))
+ [(set (mem:HI (pre_dec:HI (reg:HI SP_REGNUM))) (match_dup 2))
(set (match_dup 2) (match_dup 3))
(set (cc0) (compare (match_dup 0) (match_dup 1)))
- (set (match_dup 2) (mem:HI (post_inc:HI (reg:HI 3))))]
+ (set (match_dup 2) (mem:HI (post_inc:HI (reg:HI SP_REGNUM))))]
"operands[3] = gen_rtx (REG, HImode, SOFT_Z_REGNUM);")
;;
@@ -330,12 +353,12 @@
(compare (match_operand:QI 0 "hard_addr_reg_operand" "xy")
(match_operand:QI 1 "cmp_operand" "uimA")))]
"z_replacement_completed == 2 && GET_MODE (operands[0]) == QImode"
- [(parallel [(set (reg:HI 1) (match_dup 3))
- (set (match_dup 3) (reg:HI 1))])
+ [(parallel [(set (reg:HI D_REGNUM) (match_dup 3))
+ (set (match_dup 3) (reg:HI D_REGNUM))])
(set (cc0)
- (compare (reg:QI 1) (match_dup 1)))
- (parallel [(set (reg:HI 1) (match_dup 3))
- (set (match_dup 3) (reg:HI 1))])]
+ (compare (reg:QI D_REGNUM) (match_dup 1)))
+ (parallel [(set (reg:HI D_REGNUM) (match_dup 3))
+ (set (match_dup 3) (reg:HI D_REGNUM))])]
"operands[3] = gen_rtx (REG, HImode, REGNO (operands[0]));")
(define_split
@@ -365,37 +388,139 @@
DONE;
}")
-(define_insn "cmpqi_1"
+(define_insn "bitcmpqi"
[(set (cc0)
- (compare (match_operand:QI 0 "tst_operand" "d,d,*x*y,*x*y")
- (match_operand:QI 1 "cmp_operand" "im,?u,?u,?dim*x*y")))]
+ (and:QI (match_operand:QI 0 "tst_operand" "d,d,d,m,!u")
+ (match_operand:QI 1 "cmp_operand" "im,*B,u,d,d")))]
""
"@
- cmpb\\t%1
- cmpb\\t%b1
+ bitb\\t%b1
#
- #")
+ bitb\\t%b1
+ bitb\\t%b0
+ bitb\\t%b0")
+
+(define_split /* "bitcmpqi" */
+ [(set (cc0)
+ (and:QI (match_operand:QI 0 "tst_operand" "d")
+ (match_operand:QI 1 "hard_addr_reg_operand" "xy")))]
+ "z_replacement_completed == 2 && GET_MODE (operands[0]) == QImode"
+ [(set (match_dup 3) (match_dup 2))
+ (set (cc0) (and:QI (match_dup 0) (match_dup 4)))]
+ "operands[2] = gen_rtx (REG, HImode, REGNO (operands[1]));
+ operands[3] = gen_rtx (REG, HImode, SOFT_TMP_REGNUM);
+ operands[4] = gen_rtx (REG, QImode, SOFT_TMP_REGNUM);")
+
+(define_insn "bitcmpqi_z_used"
+ [(set (cc0)
+ (and:QI (match_operand:QI 0 "tst_operand" "d,m")
+ (match_operand:QI 1 "cmp_operand" "m,d")))
+ (use (match_operand:HI 2 "hard_reg_operand" "xy,xy"))
+ (use (reg:HI 11))]
+ ""
+ "#")
+
+(define_split /* "bitcmpqi_z_used" */
+ [(set (cc0)
+ (and:QI (match_operand:QI 0 "tst_operand" "d,m")
+ (match_operand:QI 1 "cmp_operand" "m,d")))
+ (use (match_operand:HI 2 "hard_reg_operand" "xy,xy"))
+ (use (reg:HI 11))]
+ "z_replacement_completed == 2"
+ [(set (mem:HI (pre_dec:HI (reg:HI 3))) (match_dup 2))
+ (set (match_dup 2) (match_dup 3))
+ (set (cc0) (and:QI (match_dup 0) (match_dup 1)))
+ (set (match_dup 2) (mem:HI (post_inc:HI (reg:HI 3))))]
+ "operands[3] = gen_rtx (REG, HImode, SOFT_Z_REGNUM);")
+
+(define_insn "bitcmphi"
+ [(set (cc0)
+ (and:HI (match_operand:HI 0 "tst_operand" "d")
+ (match_operand:HI 1 "const_int_operand" "i")))]
+ "(INTVAL (operands[1]) & 0x0ff) == 0
+ || (INTVAL (operands[1]) & 0x0ff00) == 0"
+ "*
+{
+ if ((INTVAL (operands[1]) & 0x0ff) == 0)
+ return \"bita\\t%h1\";
+ else
+ return \"bitb\\t%1\";
+}")
+
+(define_insn "bitcmpqi_12"
+ [(set (cc0)
+ (zero_extract (match_operand:HI 0 "tst_operand" "d")
+ (match_operand:HI 1 "const_int_operand" "i")
+ (match_operand:HI 2 "const_int_operand" "i")))]
+ "(unsigned) (INTVAL (operands[2]) + INTVAL (operands[1])) <= 8
+ || (((unsigned) (INTVAL (operands[2]) + INTVAL (operands[1])) <= 16)
+ && (unsigned) INTVAL (operands[2]) >= 8)"
+ "*
+{
+ rtx ops[1];
+ int mask;
+ int startpos = INTVAL (operands[2]);
+ int bitsize = INTVAL (operands[1]);
+
+ if (startpos >= 8)
+ {
+ startpos -= 8;
+ mask = (1 << (startpos + bitsize)) - 1;
+ mask &= ~((1 << startpos) - 1);
+
+ ops[0] = GEN_INT (mask);
+ output_asm_insn (\"bita\\t%0\", ops);
+ }
+ else
+ {
+ mask = (1 << (startpos + bitsize)) - 1;
+ mask &= ~((1 << startpos) - 1);
+
+ ops[0] = GEN_INT (mask);
+ output_asm_insn (\"bitb\\t%0\", ops);
+ }
+ return \"\";
+}")
+
+(define_insn "cmpqi_1"
+ [(set (cc0)
+ (compare (match_operand:QI 0 "tst_operand" "d,m,d,!u,*B,d*B")
+ (match_operand:QI 1 "cmp_operand" "im,d,!u,d,dim*A,*u")))]
+ ""
+ "*
+{
+ if (A_REG_P (operands[0]) || A_REG_P (operands[1]))
+ {
+ return \"#\";
+ }
+ else if (D_REG_P (operands[0]))
+ {
+ return \"cmpb\\t%b1\";
+ }
+ cc_status.flags |= CC_REVERSED;
+ return \"cmpb\\t%b0\";
+}")
(define_insn "cmpqi_z_used"
[(set (cc0)
- (compare (match_operand:QI 0 "hard_reg_operand" "dxy")
- (match_operand:QI 1 "cmp_operand" "m")))
- (use (match_operand:HI 2 "hard_reg_operand" "dxy"))
+ (compare (match_operand:QI 0 "tst_operand" "dxy,m")
+ (match_operand:QI 1 "cmp_operand" "m,dxy")))
+ (use (match_operand:HI 2 "hard_reg_operand" "dxy,dxy"))
(use (reg:HI 11))]
""
"#")
(define_split /* cmpqi_z_used */
[(set (cc0)
- (compare (match_operand:QI 0 "hard_reg_operand" "dxy")
- (match_operand:QI 1 "cmp_operand" "m")))
- (use (match_operand:HI 2 "hard_reg_operand" "dxy"))
+ (compare (match_operand:QI 0 "tst_operand" "dxy,m")
+ (match_operand:QI 1 "cmp_operand" "m,dxy")))
+ (use (match_operand:HI 2 "hard_reg_operand" "dxy,dxy"))
(use (reg:HI 11))]
"z_replacement_completed == 2"
- [(set (mem:HI (pre_dec:HI (reg:HI 3))) (match_dup 2))
+ [(set (mem:HI (pre_dec:HI (reg:HI SP_REGNUM))) (match_dup 2))
(set (match_dup 2) (match_dup 3))
(set (cc0) (compare (match_dup 0) (match_dup 1)))
- (set (match_dup 2) (mem:HI (post_inc:HI (reg:HI 3))))]
+ (set (match_dup 2) (mem:HI (post_inc:HI (reg:HI SP_REGNUM))))]
"operands[3] = gen_rtx (REG, HImode, SOFT_Z_REGNUM);")
(define_expand "cmpdf"
@@ -432,40 +557,40 @@
;; description but not for GCC optimization passes.
;;
(define_insn "movstrictsi"
- [(set (strict_low_part (match_operand:SI 0 "non_push_operand" "+um,+D,+D"))
+ [(set (strict_low_part (match_operand:SI 0 "non_push_operand" "+um,D,D"))
(match_operand:SI 1 "general_operand" "D,Dim,uD"))]
""
"#")
(define_split
- [(set (strict_low_part (match_operand:SI 0 "non_push_operand" "+um,+D,+D"))
+ [(set (strict_low_part (match_operand:SI 0 "non_push_operand" "+um,D,D"))
(match_operand:SI 1 "general_operand" "D,Dim,u"))]
"z_replacement_completed == 2"
[(set (match_dup 0) (match_dup 1))]
"")
(define_insn "movstricthi"
- [(set (strict_low_part (match_operand:HI 0 "non_push_operand" "+um,+d,+d"))
- (match_operand:HI 1 "general_operand" "d,dim,u"))]
+ [(set (strict_low_part (match_operand:HI 0 "non_push_operand" "+um,dA,dA"))
+ (match_operand:HI 1 "general_operand" "dA,dAim,u"))]
""
"#")
(define_split
- [(set (strict_low_part (match_operand:HI 0 "non_push_operand" "+um,+d,+d"))
- (match_operand:HI 1 "general_operand" "d,dim,u"))]
+ [(set (strict_low_part (match_operand:HI 0 "non_push_operand" "+um,dA,dA"))
+ (match_operand:HI 1 "general_operand" "dA,dAim,u"))]
"z_replacement_completed == 2"
[(set (match_dup 0) (match_dup 1))]
"")
(define_insn "movstrictqi"
- [(set (strict_low_part (match_operand:QI 0 "non_push_operand" "+mu,+!d"))
- (match_operand:QI 1 "general_operand" "d,imu"))]
+ [(set (strict_low_part (match_operand:QI 0 "non_push_operand" "+mu,!dA"))
+ (match_operand:QI 1 "general_operand" "d,imudA"))]
""
"#")
(define_split
- [(set (strict_low_part (match_operand:QI 0 "non_push_operand" "+mu,+d,+d"))
- (match_operand:QI 1 "general_operand" "d,dim,u"))]
+ [(set (strict_low_part (match_operand:QI 0 "non_push_operand" "+mu,dA"))
+ (match_operand:QI 1 "general_operand" "d,imudA"))]
"z_replacement_completed == 2"
[(set (match_dup 0) (match_dup 1))]
"")
@@ -488,7 +613,28 @@
;; The insn will be split in one or several memory moves (movw).
;; [SCz: this does not work ?? So, I switched temporary to 'd' reg]
;;--------------------------------------------------------------------
-(define_insn "movdi"
+(define_expand "movdi"
+ [(parallel [(set (match_operand:DI 0 "nonimmediate_operand" "")
+ (match_operand:DI 1 "general_operand" ""))
+ (clobber (match_scratch:HI 2 ""))])]
+ ""
+ "
+ /* For push/pop, emit a REG_INC note to make sure the reload
+ inheritance and reload CSE pass notice the change of the stack
+ pointer. */
+ if (IS_STACK_PUSH (operands[0]) || IS_STACK_POP (operands[1]))
+ {
+ rtx insn;
+
+ insn = emit_insn (gen_movdi_internal (operands[0], operands[1]));
+ REG_NOTES (insn) = alloc_EXPR_LIST (REG_INC,
+ stack_pointer_rtx,
+ REG_NOTES (insn));
+ DONE;
+ }
+")
+
+(define_insn "movdi_internal"
[(set (match_operand:DI 0 "nonimmediate_operand" "=U,!u,U,m,m,!u")
(match_operand:DI 1 "general_operand" "iU,iU,!u,mi,!u,!mu"))
(clobber (match_scratch:HI 2 "=&d,&d,&d,&d,&d,&d"))]
@@ -504,7 +650,27 @@
"m68hc11_split_move (operands[0], operands[1], operands[2]);
DONE;")
-(define_insn "movdf"
+(define_expand "movdf"
+ [(parallel [(set (match_operand:DF 0 "nonimmediate_operand" "")
+ (match_operand:DF 1 "general_operand" ""))
+ (clobber (match_scratch:HI 2 ""))])]
+ ""
+ "/* For push/pop, emit a REG_INC note to make sure the reload
+ inheritance and reload CSE pass notice the change of the stack
+ pointer. */
+ if (IS_STACK_PUSH (operands[0]) || IS_STACK_POP (operands[1]))
+ {
+ rtx insn;
+
+ insn = emit_insn (gen_movdf_internal (operands[0], operands[1]));
+ REG_NOTES (insn) = alloc_EXPR_LIST (REG_INC,
+ stack_pointer_rtx,
+ REG_NOTES (insn));
+ DONE;
+ }
+")
+
+(define_insn "movdf_internal"
[(set (match_operand:DF 0 "nonimmediate_operand" "=U,!u,U,m,m,!u")
(match_operand:DF 1 "general_operand" "iU,iU,!u,mi,!u,!mu"))
(clobber (match_scratch:HI 2 "=&d,&d,&d,&d,&d,&d"))]
@@ -519,7 +685,7 @@
[(const_int 0)]
"m68hc11_split_move (operands[0], operands[1], operands[2]);
DONE;")
-
+
;;--------------------------------------------------------------------
;;- 32-bit Move Operations.
;; The movsi and movsf patterns are identical except for the mode.
@@ -529,7 +695,27 @@
;; pass does not give us a register that dies in the insn and is used
;; for input/output operands.
;;--------------------------------------------------------------------
-(define_insn "movsi"
+(define_expand "movsi"
+ [(parallel [(set (match_operand:SI 0 "nonimmediate_operand" "")
+ (match_operand:SI 1 "general_operand" ""))
+ (clobber (match_scratch:HI 2 ""))])]
+ ""
+ "/* For push/pop, emit a REG_INC note to make sure the reload
+ inheritance and reload CSE pass notice the change of the stack
+ pointer. */
+ if (IS_STACK_PUSH (operands[0]) || IS_STACK_POP (operands[1]))
+ {
+ rtx insn;
+
+ insn = emit_insn (gen_movsi_internal (operands[0], operands[1]));
+ REG_NOTES (insn) = alloc_EXPR_LIST (REG_INC,
+ stack_pointer_rtx,
+ REG_NOTES (insn));
+ DONE;
+ }
+")
+
+(define_insn "movsi_internal"
[(set (match_operand:SI 0 "nonimmediate_operand" "=mu,?D,m,?D,?u,?u,!u,D")
(match_operand:SI 1 "general_operand" "imu,im,?D,!u,?D,mi,!u,!D"))
(clobber (match_scratch:HI 2 "=&d,X,X,X,X,&d,&d,X"))]
@@ -545,7 +731,27 @@
"m68hc11_split_move (operands[0], operands[1], operands[2]);
DONE;")
-(define_insn "movsf"
+(define_expand "movsf"
+ [(parallel [(set (match_operand:SF 0 "nonimmediate_operand" "")
+ (match_operand:SF 1 "general_operand" ""))
+ (clobber (match_scratch:HI 2 ""))])]
+ ""
+ "/* For push/pop, emit a REG_INC note to make sure the reload
+ inheritance and reload CSE pass notice the change of the stack
+ pointer. */
+ if (IS_STACK_PUSH (operands[0]) || IS_STACK_POP (operands[1]))
+ {
+ rtx insn;
+
+ insn = emit_insn (gen_movsf_internal (operands[0], operands[1]));
+ REG_NOTES (insn) = alloc_EXPR_LIST (REG_INC,
+ stack_pointer_rtx,
+ REG_NOTES (insn));
+ DONE;
+ }
+")
+
+(define_insn "movsf_internal"
[(set (match_operand:SF 0 "nonimmediate_operand" "=m,D,m,D,!u,!u,!u,D")
(match_operand:SF 1 "general_operand" "im,im,D,!u,D,mi,!u,!D"))
(clobber (match_scratch:HI 2 "=&d,X,X,X,X,&d,&d,X"))]
@@ -640,6 +846,19 @@
operands[1] = force_reg (HImode, operands[1]);
}
}
+ /* For push/pop, emit a REG_INC note to make sure the reload
+ inheritance and reload CSE pass notice the change of the stack
+ pointer. */
+ if (IS_STACK_PUSH (operands[0]) || IS_STACK_POP (operands[1]))
+ {
+ rtx insn;
+
+ insn = emit_insn (gen_rtx (SET, VOIDmode, operands[0], operands[1]));
+ REG_NOTES (insn) = alloc_EXPR_LIST (REG_INC,
+ stack_pointer_rtx,
+ REG_NOTES (insn));
+ DONE;
+ }
}")
(define_insn "movhi_const0"
@@ -703,11 +922,11 @@
"z_replacement_completed == 2 && GET_MODE (operands[0]) == QImode
&& !reg_mentioned_p (operands[0], operands[1])
&& !D_REG_P (operands[1])"
- [(parallel [(set (reg:HI 1) (match_dup 2))
- (set (match_dup 2) (reg:HI 1))])
- (set (reg:QI 1) (match_dup 1))
- (parallel [(set (reg:HI 1) (match_dup 2))
- (set (match_dup 2) (reg:HI 1))])]
+ [(parallel [(set (reg:HI D_REGNUM) (match_dup 2))
+ (set (match_dup 2) (reg:HI D_REGNUM))])
+ (set (reg:QI D_REGNUM) (match_dup 1))
+ (parallel [(set (reg:HI D_REGNUM) (match_dup 2))
+ (set (match_dup 2) (reg:HI D_REGNUM))])]
"operands[2] = gen_rtx (REG, HImode, REGNO (operands[0]));")
;;
@@ -719,11 +938,11 @@
"z_replacement_completed == 2 && GET_MODE (operands[1]) == QImode
&& !reg_mentioned_p (operands[1], operands[0])
&& !D_REG_P (operands[0])"
- [(parallel [(set (reg:HI 1) (match_dup 2))
- (set (match_dup 2) (reg:HI 1))])
- (set (match_dup 0) (reg:QI 1))
- (parallel [(set (reg:HI 1) (match_dup 2))
- (set (match_dup 2) (reg:HI 1))])]
+ [(parallel [(set (reg:HI D_REGNUM) (match_dup 2))
+ (set (match_dup 2) (reg:HI D_REGNUM))])
+ (set (match_dup 0) (reg:QI D_REGNUM))
+ (parallel [(set (reg:HI D_REGNUM) (match_dup 2))
+ (set (match_dup 2) (reg:HI D_REGNUM))])]
"operands[2] = gen_rtx (REG, HImode, REGNO (operands[1]));")
(define_insn "*movqi2_push"
@@ -767,11 +986,26 @@
operands[1] = force_reg (QImode, operands[1]);
}
}
+ /* For push/pop, emit a REG_INC note to make sure the reload
+ inheritance and reload CSE pass notice the change of the stack
+ pointer. */
+ if (IS_STACK_PUSH (operands[0]) || IS_STACK_POP (operands[1]))
+ {
+ rtx insn;
+
+ insn = emit_insn (gen_rtx (SET, VOIDmode, operands[0], operands[1]));
+ REG_NOTES (insn) = alloc_EXPR_LIST (REG_INC,
+ stack_pointer_rtx,
+ REG_NOTES (insn));
+ DONE;
+ }
}")
(define_insn "*movqi_68hc12"
- [(set (match_operand:QI 0 "nonimmediate_operand" "=d*AuU*q,d*A*qu,d*A*q,m,m")
- (match_operand:QI 1 "general_operand" "rui*q,U,m,d*q,!A"))]
+ [(set (match_operand:QI 0 "nonimmediate_operand"
+ "=d*AU*q,d*A*q,*u,d*A*q,m,m")
+ (match_operand:QI 1 "general_operand"
+ "*ri*q,U,*ri*qU,m,d*q,!A"))]
"TARGET_M6812"
"*
{
@@ -1038,9 +1272,9 @@
}")
(define_insn "zero_extendqisi2"
- [(set (match_operand:SI 0 "non_push_operand" "=D,m,u")
+ [(set (match_operand:SI 0 "non_push_operand" "=D,D,m,m,u")
(zero_extend:SI
- (match_operand:QI 1 "nonimmediate_operand" "dxymu,dxy,dxy")))]
+ (match_operand:QI 1 "nonimmediate_operand" "dmu,xy,d,xy,dxy")))]
""
"#")
@@ -1048,15 +1282,11 @@
[(set (match_operand:SI 0 "non_push_operand" "=mu")
(zero_extend:SI (match_operand:QI 1 "nonimmediate_operand" "dxy")))]
"reload_completed && !X_REG_P (operands[0])"
- [(set (match_dup 2) (match_dup 3))
- (set (match_dup 4) (const_int 0))
- (set (match_dup 5) (const_int 0))]
+ [(set (match_dup 2) (zero_extend:HI (match_dup 1)))
+ (set (match_dup 3) (const_int 0))]
"
operands[2] = m68hc11_gen_lowpart (HImode, operands[0]);
- operands[3] = gen_rtx (REG, HImode, REGNO (operands[1]));
- operands[4] = m68hc11_gen_lowpart (HImode, operands[0]);
- operands[4] = m68hc11_gen_highpart (QImode, operands[4]);
- operands[5] = m68hc11_gen_highpart (HImode, operands[0]);")
+ operands[3] = m68hc11_gen_highpart (HImode, operands[0]);")
(define_split
[(set (match_operand:SI 0 "hard_reg_operand" "=D")
@@ -1178,6 +1408,20 @@
rtx ops[3];
int need_tst = 0;
+ /* The 68HC12 has a sign-extension instruction. Use it when the
+ destination is the register (X,D). First sign-extend the low
+ part and fill X with the sign-extension of the high part. */
+ if (TARGET_M6812 && X_REG_P (operands[0]))
+ {
+ if (!D_REG_P (operands[1]))
+ {
+ ops[0] = gen_rtx (REG, QImode, HARD_D_REGNUM);
+ ops[1] = operands[1];
+ m68hc11_gen_movqi (insn, ops);
+ }
+ return \"sex\\tb,d\\n\\tsex\\ta,x\";
+ }
+
ops[2] = gen_label_rtx ();
if (X_REG_P (operands[1]))
@@ -1273,6 +1517,16 @@
ops[0] = gen_label_rtx ();
if (D_REG_P (operands[0]))
{
+ if (TARGET_M6812)
+ {
+ if (!D_REG_P (operands[1]))
+ {
+ ops[0] = gen_rtx (REG, QImode, HARD_D_REGNUM);
+ ops[1] = operands[1];
+ m68hc11_gen_movqi (insn, ops);
+ }
+ return \"sex\\tb,d\";
+ }
output_asm_insn (\"clra\", operands);
if (H_REG_P (operands[1]))
{
@@ -1320,25 +1574,23 @@
[(set (match_operand:SI 0 "register_operand" "=D")
(sign_extend:SI (match_operand:HI 1 "register_operand" "A")))]
"reload_completed && (Y_REG_P (operands[1]) || Z_REG_P (operands[1]))"
- [(set (reg:HI 1) (match_dup 1))
- (set (match_dup 0) (sign_extend:SI (reg:HI 1)))]
+ [(set (reg:HI D_REGNUM) (match_dup 1))
+ (set (match_dup 0) (sign_extend:SI (reg:HI D_REGNUM)))]
"")
(define_insn "extendhisi2"
- [(set (match_operand:SI 0 "register_operand" "=D,D")
- (sign_extend:SI (match_operand:HI 1 "nonimmediate_operand" "dm,!uA")))]
+ [(set (match_operand:SI 0 "register_operand" "=D,D,D")
+ (sign_extend:SI (match_operand:HI 1 "nonimmediate_operand" "m,!r,dA")))]
""
"*
{
extern rtx ix_reg;
- rtx ops[1];
+ rtx ops[2];
int x_reg_used;
if (Y_REG_P (operands[1]))
return \"#\";
- ops[0] = gen_label_rtx ();
-
if (X_REG_P (operands[1]))
{
output_asm_insn (\"xgdx\", operands);
@@ -1351,9 +1603,29 @@
x_reg_used = reg_mentioned_p (ix_reg, operands[1]);
if (x_reg_used)
{
- output_asm_insn (\"ldd\\t%1\", operands);
+ ops[0] = gen_rtx (REG, HImode, HARD_D_REGNUM);
+ ops[1] = operands[1];
+ m68hc11_gen_movhi (insn, ops);
+ }
+ }
+
+ CC_STATUS_INIT;
+ if (TARGET_M6812 && 0)
+ {
+ /* This sequence of code is larger than the one for 68HC11.
+ Don't use it; keep it for documentation. */
+ if (!D_REG_P (operands[1]) && !x_reg_used)
+ {
+ ops[0] = gen_rtx (REG, HImode, HARD_D_REGNUM);
+ ops[1] = operands[1];
+ m68hc11_gen_movhi (insn, ops);
}
+ output_asm_insn (\"sex\\ta,x\", operands);
+ output_asm_insn (\"xgdx\", operands);
+ output_asm_insn (\"sex\\ta,d\", operands);
+ return \"xgdx\";
}
+
output_asm_insn (\"ldx\\t#0\", operands);
if (D_REG_P (operands[1]) || x_reg_used)
{
@@ -1361,18 +1633,107 @@
}
else
{
- output_asm_insn (\"ldd\\t%1\", operands);
+ ops[0] = gen_rtx (REG, HImode, HARD_D_REGNUM);
+ ops[1] = operands[1];
+ m68hc11_gen_movhi (insn, ops);
}
+
+ ops[0] = gen_label_rtx ();
output_asm_insn (\"bpl\\t%l0\", ops);
output_asm_insn (\"dex\", operands);
ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\", CODE_LABEL_NUMBER (ops[0]));
- CC_STATUS_INIT;
return \"\";
}")
;;--------------------------------------------------------------------
+;;- Min and Max instructions (68HC12).
+;;--------------------------------------------------------------------
+(define_insn "uminqi3"
+ [(set (match_operand:QI 0 "nonimmediate_operand" "=d,m")
+ (umin:QI (match_operand:QI 1 "nonimmediate_operand" "%0,0")
+ (match_operand:QI 2 "general_operand" "m,d")))]
+ "TARGET_M6812"
+ "*
+{
+ /* Flags are set according to (sub:QI (operand 1) (operand2)).
+ The mina/minm use A as the source or destination. This is the
+ high part of D. There is no way to express that in the pattern
+ so we must use 'exg a,b' to put the operand in the good register. */
+ CC_STATUS_INIT;
+ if (D_REG_P (operands[0]))
+ {
+ return \"exg\\ta,b\\n\\tmina\\t%2\\n\\texg\\ta,b\";
+ }
+ else
+ {
+ return \"exg\\ta,b\\n\\tminm\\t%0\\n\\texg\\ta,b\";
+ }
+}")
+
+(define_insn "umaxqi3"
+ [(set (match_operand:QI 0 "nonimmediate_operand" "=d,m")
+ (umax:QI (match_operand:QI 1 "nonimmediate_operand" "%0,0")
+ (match_operand:QI 2 "general_operand" "m,d")))]
+ "TARGET_M6812"
+ "*
+{
+ /* Flags are set according to (sub:QI (operand 1) (operand2)).
+ The maxa/maxm use A as the source or destination. This is the
+ high part of D. There is no way to express that in the pattern
+ so we must use 'exg a,b' to put the operand in the good register. */
+ CC_STATUS_INIT;
+ if (D_REG_P (operands[0]))
+ {
+ return \"exg\\ta,b\\n\\tmaxa\\t%2\\n\\texg\\ta,b\";
+ }
+ else
+ {
+ return \"exg\\ta,b\\n\\tmaxm\\t%0\\n\\texg\\ta,b\";
+ }
+}")
+
+(define_insn "uminhi3"
+ [(set (match_operand:HI 0 "nonimmediate_operand" "=d,m")
+ (umin:HI (match_operand:HI 1 "nonimmediate_operand" "%0,0")
+ (match_operand:HI 2 "general_operand" "m,d")))]
+ "TARGET_M6812"
+ "*
+{
+ /* Flags are set according to (sub:HI (operand 1) (operand2)). */
+ CC_STATUS_INIT;
+ if (D_REG_P (operands[0]))
+ {
+ return \"emind\\t%2\";
+ }
+ else
+ {
+ return \"eminm\\t%0\";
+ }
+}")
+
+(define_insn "umaxhi3"
+ [(set (match_operand:HI 0 "nonimmediate_operand" "=d,m")
+ (umax:HI (match_operand:HI 1 "nonimmediate_operand" "%0,0")
+ (match_operand:HI 2 "general_operand" "m,d")))]
+ "TARGET_M6812"
+ "*
+{
+ /* Flags are set according to (sub:HI (operand 1) (operand2)). */
+ CC_STATUS_INIT;
+ if (D_REG_P (operands[0]))
+ {
+ return \"emaxd\\t%2\";
+ }
+ else
+ {
+ return \"emaxm\\t%0\";
+ }
+}")
+
+
+;;--------------------------------------------------------------------
;;- Add instructions.
;;--------------------------------------------------------------------
;; 64-bit: Use a library call because what GCC generates is huge.
@@ -1409,13 +1770,13 @@
(match_dup 0)))
(clobber (match_scratch:HI 1 "=X"))]
"reload_completed && z_replacement_completed == 2"
- [(set (reg:HI 1) (ashift:HI (reg:HI 1) (const_int 1)))
- (parallel [(set (reg:HI 1) (reg:HI 0))
- (set (reg:HI 0) (reg:HI 1))])
- (set (reg:QI 6) (rotate:QI (reg:QI 6) (reg:QI 7)))
- (set (reg:QI 5) (rotate:QI (reg:QI 5) (reg:QI 7)))
- (parallel [(set (reg:HI 1) (reg:HI 0))
- (set (reg:HI 0) (reg:HI 1))])]
+ [(set (reg:HI D_REGNUM) (ashift:HI (reg:HI D_REGNUM) (const_int 1)))
+ (parallel [(set (reg:HI D_REGNUM) (reg:HI X_REGNUM))
+ (set (reg:HI X_REGNUM) (reg:HI D_REGNUM))])
+ (set (reg:QI B_REGNUM) (rotate:QI (reg:QI B_REGNUM) (reg:QI CC_REGNUM)))
+ (set (reg:QI A_REGNUM) (rotate:QI (reg:QI A_REGNUM) (reg:QI CC_REGNUM)))
+ (parallel [(set (reg:HI D_REGNUM) (reg:HI X_REGNUM))
+ (set (reg:HI X_REGNUM) (reg:HI D_REGNUM))])]
"")
@@ -1472,9 +1833,9 @@
(match_operand:SI 2 "memory_operand" "m,m")))
(clobber (match_scratch:HI 3 "=X,X"))]
"reload_completed"
- [(set (reg:HI 1) (zero_extend:HI (match_dup 1)))
+ [(set (reg:HI D_REGNUM) (zero_extend:HI (match_dup 1)))
(parallel [(set (match_dup 0)
- (plus:SI (zero_extend:SI (reg:HI 1)) (match_dup 2)))
+ (plus:SI (zero_extend:SI (reg:HI D_REGNUM)) (match_dup 2)))
(clobber (match_dup 3))])]
"")
@@ -1550,9 +1911,9 @@
}")
(define_insn "*addsi3"
- [(set (match_operand:SI 0 "non_push_operand" "=m,D,!u,D,!D")
+ [(set (match_operand:SI 0 "non_push_operand" "=m,D,!u,?D,D")
(plus:SI (match_operand:SI 1 "non_push_operand" "%0,0,0,0,0")
- (match_operand:SI 2 "general_operand" "ML,i,L,?miu,!D")))
+ (match_operand:SI 2 "general_operand" "ML,i,ML,?D,?miu")))
(clobber (match_scratch:HI 3 "=d,X,d,X,X"))]
""
"*
@@ -1652,14 +2013,26 @@
}")
(define_split
- [(set (match_operand:SI 0 "register_operand" "=D")
- (plus:SI (match_operand:SI 1 "register_operand" "%0")
+ [(set (match_operand:SI 0 "register_operand" "=D,u")
+ (plus:SI (match_operand:SI 1 "register_operand" "%0,0")
(match_operand:SI 2 "const_int_operand" "")))
- (clobber (match_scratch:HI 3 "=X"))]
+ (clobber (match_scratch:HI 3 "=X,d"))]
"reload_completed && z_replacement_completed == 2
&& ((INTVAL (operands[2]) & 0x0FFFF) == 0)"
- [(set (reg:HI 0) (plus:HI (reg:HI 0) (match_dup 3)))]
- "operands[3] = m68hc11_gen_highpart (HImode, operands[2]);")
+ [(set (match_dup 5) (match_dup 6))
+ (set (reg:HI 0) (plus:HI (reg:HI 0) (match_dup 4)))
+ (set (match_dup 6) (match_dup 5))]
+ "operands[4] = m68hc11_gen_highpart (HImode, operands[2]);
+ if (X_REG_P (operands[0]))
+ {
+ operands[5] = operands[6] = gen_rtx (REG, HImode, HARD_D_REGNUM);
+ }
+ else
+ {
+ operands[6] = m68hc11_gen_highpart (HImode, operands[1]);
+ operands[5] = operands[3];
+ }
+ ")
(define_split
[(set (match_operand:SI 0 "register_operand" "=D")
@@ -1669,13 +2042,13 @@
"reload_completed && z_replacement_completed == 2
&& (GET_CODE (operands[2]) != CONST_INT ||
(!(INTVAL (operands[2]) >= -65536 && INTVAL (operands[2]) <= 65535)))"
- [(set (reg:HI 1) (plus:HI (reg:HI 1) (match_dup 3)))
- (parallel [(set (reg:HI 1) (reg:HI 0))
- (set (reg:HI 0) (reg:HI 1))])
- (set (reg:QI 6) (plus:QI (plus:QI (reg:QI 7) (reg:QI 6)) (match_dup 4)))
- (set (reg:QI 5) (plus:QI (plus:QI (reg:QI 7) (reg:QI 5)) (match_dup 5)))
- (parallel [(set (reg:HI 1) (reg:HI 0))
- (set (reg:HI 0) (reg:HI 1))])]
+ [(set (reg:HI D_REGNUM) (plus:HI (reg:HI D_REGNUM) (match_dup 3)))
+ (parallel [(set (reg:HI D_REGNUM) (reg:HI X_REGNUM))
+ (set (reg:HI X_REGNUM) (reg:HI D_REGNUM))])
+ (set (reg:QI B_REGNUM) (plus:QI (plus:QI (reg:QI CC_REGNUM) (reg:QI B_REGNUM)) (match_dup 4)))
+ (set (reg:QI A_REGNUM) (plus:QI (plus:QI (reg:QI CC_REGNUM) (reg:QI A_REGNUM)) (match_dup 5)))
+ (parallel [(set (reg:HI D_REGNUM) (reg:HI X_REGNUM))
+ (set (reg:HI X_REGNUM) (reg:HI D_REGNUM))])]
"operands[3] = m68hc11_gen_lowpart (HImode, operands[2]);
operands[4] = m68hc11_gen_highpart (HImode, operands[2]);
operands[5] = m68hc11_gen_highpart (QImode, operands[4]);
@@ -1689,7 +2062,7 @@
[(set (match_operand:HI 0 "register_operand" "=x")
(plus:HI (plus:HI (match_operand:HI 1 "register_operand" "0")
(const_int 0))
- (reg:HI 7)))]
+ (reg:HI CC_REGNUM)))]
""
"*
{
@@ -1746,25 +2119,39 @@
"")
(define_insn "*addhi3_68hc12"
- [(set (match_operand:HI 0 "register_operand" "=d,A*w,A*w")
- (plus:HI (match_operand:HI 1 "register_operand" "%0,0,Aw")
- (match_operand:HI 2 "general_operand" "imA*wu,id,id")))]
+ [(set (match_operand:HI 0 "register_operand" "=*d,A*w,A*w,A")
+ (plus:HI (match_operand:HI 1 "register_operand" "%0,0,Aw,0")
+ (match_operand:HI 2 "general_operand" "imA*wu,id,id,!muA")))]
"TARGET_M6812"
"*
{
int val;
const char* insn_code;
+ if (which_alternative >= 3)
+ {
+ if (A_REG_P (operands[2]))
+ {
+ CC_STATUS_INIT;
+ output_asm_insn (\"xgd%2\", operands);
+ output_asm_insn (\"lea%0 d,%0\", operands);
+ return \"xgd%2\";
+ }
+ return \"#\";
+ }
+
if (D_REG_P (operands[0]))
{
if (X_REG_P (operands[2]))
{
+ m68hc11_notice_keep_cc (operands[0]);
output_asm_insn (\"xgdx\", operands);
output_asm_insn (\"leax\\td,%2\", operands);
return \"xgdx\";
}
else if (Y_REG_P (operands[2]))
{
+ m68hc11_notice_keep_cc (operands[0]);
output_asm_insn (\"xgdy\", operands);
output_asm_insn (\"leay\\td,%2\", operands);
return \"xgdy\";
@@ -1784,7 +2171,7 @@
if (val != -1 || val != 1 || !rtx_equal_p (operands[0], operands[1]))
{
- cc_status = cc_prev_status;
+ m68hc11_notice_keep_cc (operands[0]);
switch (REGNO (operands[0]))
{
case HARD_X_REGNUM:
@@ -1922,9 +2309,9 @@
"")
(define_insn "*addhi3"
- [(set (match_operand:HI 0 "hard_reg_operand" "=A,d,!A,d*A,!d,!w")
- (plus:HI (match_operand:HI 1 "general_operand" "%0,0,0,0,0,0")
- (match_operand:HI 2 "general_operand" "N,i,I,umi*A*d,!*d*w,i")))]
+ [(set (match_operand:HI 0 "hard_reg_operand" "=A,d,!A,d*A,!d*A")
+ (plus:HI (match_operand:HI 1 "general_operand" "%0,0,0,0,0")
+ (match_operand:HI 2 "general_operand" "N,i,I,mi*A*d,!u*d*w")))]
"TARGET_M6811"
"*
{
@@ -2045,9 +2432,9 @@
"")
(define_insn "addqi3"
- [(set (match_operand:QI 0 "nonimmediate_operand" "=!*rm,dq*A")
- (plus:QI (match_operand:QI 1 "nonimmediate_operand" "%0,0")
- (match_operand:QI 2 "general_operand" "N,ium*A*d")))]
+ [(set (match_operand:QI 0 "nonimmediate_operand" "=!d*rm,dq,!*A")
+ (plus:QI (match_operand:QI 1 "nonimmediate_operand" "%0,0,0")
+ (match_operand:QI 2 "general_operand" "N,ium*A*d,ium*A*d")))]
""
"*
{
@@ -2110,7 +2497,7 @@
;;
(define_insn "*adcq"
[(set (match_operand:QI 0 "register_operand" "=q")
- (plus:QI (plus:QI (reg:QI 7)
+ (plus:QI (plus:QI (reg:QI CC_REGNUM)
(match_operand:QI 1 "register_operand" "%0"))
(match_operand:QI 2 "general_operand" "ium")))]
""
@@ -2201,13 +2588,13 @@
(clobber (match_scratch:HI 3 "=X"))]
"reload_completed && z_replacement_completed == 2
&& X_REG_P (operands[1])"
- [(set (reg:HI 1) (minus:HI (reg:HI 1) (match_dup 3)))
- (parallel [(set (reg:HI 0) (reg:HI 1))
- (set (reg:HI 1) (reg:HI 0))])
- (set (reg:QI 6) (minus:QI (minus:QI (reg:QI 7) (reg:QI 6)) (match_dup 4)))
- (set (reg:QI 5) (minus:QI (minus:QI (reg:QI 7) (reg:QI 5)) (match_dup 5)))
- (parallel [(set (reg:HI 0) (reg:HI 1))
- (set (reg:HI 1) (reg:HI 0))])]
+ [(set (reg:HI D_REGNUM) (minus:HI (reg:HI D_REGNUM) (match_dup 3)))
+ (parallel [(set (reg:HI X_REGNUM) (reg:HI D_REGNUM))
+ (set (reg:HI D_REGNUM) (reg:HI X_REGNUM))])
+ (set (reg:QI B_REGNUM) (minus:QI (minus:QI (reg:QI CC_REGNUM) (reg:QI B_REGNUM)) (match_dup 4)))
+ (set (reg:QI A_REGNUM) (minus:QI (minus:QI (reg:QI CC_REGNUM) (reg:QI A_REGNUM)) (match_dup 5)))
+ (parallel [(set (reg:HI X_REGNUM) (reg:HI D_REGNUM))
+ (set (reg:HI D_REGNUM) (reg:HI X_REGNUM))])]
"operands[3] = m68hc11_gen_lowpart (HImode, operands[2]);
operands[4] = m68hc11_gen_highpart (HImode, operands[2]);
operands[5] = m68hc11_gen_highpart (QImode, operands[4]);
@@ -2220,13 +2607,13 @@
(clobber (match_scratch:HI 3 "=X"))]
"reload_completed && z_replacement_completed == 2
&& X_REG_P (operands[2])"
- [(set (reg:HI 1) (minus:HI (reg:HI 1) (match_dup 3)))
- (parallel [(set (reg:HI 0) (reg:HI 1))
- (set (reg:HI 1) (reg:HI 0))])
- (set (reg:QI 6) (minus:QI (minus:QI (reg:QI 7) (reg:QI 6)) (match_dup 4)))
- (set (reg:QI 5) (minus:QI (minus:QI (reg:QI 7) (reg:QI 5)) (match_dup 5)))
- (parallel [(set (reg:HI 0) (reg:HI 1))
- (set (reg:HI 1) (reg:HI 0))])
+ [(set (reg:HI D_REGNUM) (minus:HI (reg:HI D_REGNUM) (match_dup 3)))
+ (parallel [(set (reg:HI X_REGNUM) (reg:HI D_REGNUM))
+ (set (reg:HI D_REGNUM) (reg:HI X_REGNUM))])
+ (set (reg:QI B_REGNUM) (minus:QI (minus:QI (reg:QI CC_REGNUM) (reg:QI B_REGNUM)) (match_dup 4)))
+ (set (reg:QI A_REGNUM) (minus:QI (minus:QI (reg:QI CC_REGNUM) (reg:QI A_REGNUM)) (match_dup 5)))
+ (parallel [(set (reg:HI X_REGNUM) (reg:HI D_REGNUM))
+ (set (reg:HI D_REGNUM) (reg:HI X_REGNUM))])
(set (reg:SI 0) (neg:SI (reg:SI 0)))]
"operands[3] = m68hc11_gen_lowpart (HImode, operands[1]);
operands[4] = m68hc11_gen_highpart (HImode, operands[1]);
@@ -2262,7 +2649,7 @@
(define_insn "*subhi3_sp"
[(set (match_operand:HI 0 "stack_register_operand" "=w,w")
(minus:HI (match_operand:HI 1 "register_operand" "0,0")
- (match_operand:HI 2 "general_operand" "uim*d,!*A")))
+ (match_operand:HI 2 "general_operand" "im*d,!u*A")))
(clobber (match_scratch:HI 3 "=A*d,A*d"))]
""
"*
@@ -2311,9 +2698,9 @@
(define_insn "*subhi3"
- [(set (match_operand:HI 0 "register_operand" "=d,*A")
- (minus:HI (match_operand:HI 1 "register_operand" "0,0")
- (match_operand:HI 2 "general_operand" "uim*A*d,uim*d*A")))]
+ [(set (match_operand:HI 0 "register_operand" "=d,*A,d*A")
+ (minus:HI (match_operand:HI 1 "register_operand" "0,0,0")
+ (match_operand:HI 2 "general_operand" "im*A*d,im*d*A,!u")))]
""
"*
{
@@ -2346,9 +2733,9 @@
}")
(define_insn "subqi3"
- [(set (match_operand:QI 0 "hard_reg_operand" "=dq*x*y")
- (minus:QI (match_operand:QI 1 "hard_reg_operand" "0")
- (match_operand:QI 2 "general_operand" "uim*x*y*d")))]
+ [(set (match_operand:QI 0 "hard_reg_operand" "=dq,!*x*y")
+ (minus:QI (match_operand:QI 1 "hard_reg_operand" "0,0")
+ (match_operand:QI 2 "general_operand" "uim*A*d,uim*A*d")))]
""
"*
{
@@ -2365,7 +2752,7 @@
;;
(define_insn "*subcq"
[(set (match_operand:QI 0 "register_operand" "=q")
- (minus:QI (minus:QI (reg:QI 7)
+ (minus:QI (minus:QI (reg:QI CC_REGNUM)
(match_operand:QI 1 "register_operand" "0"))
(match_operand:QI 2 "general_operand" "ium")))]
""
@@ -2378,11 +2765,28 @@
;; 32 and 64-bit multiply are handled by the library
;;
-(define_insn "mulhi3"
+(define_expand "mulsi3"
+ [(set (match_operand:SI 0 "nonimmediate_operand" "")
+ (mult:SI (match_operand:SI 1 "general_operand" "")
+ (match_operand:SI 2 "general_operand" "")))]
+ ""
+ "m68hc11_emit_libcall (\"__mulsi3\", MULT, SImode, SImode, 3, operands);
+ DONE;")
+
+(define_expand "mulhi3"
+ [(parallel [(set (match_operand:HI 0 "register_operand" "")
+ (mult:HI (match_operand:HI 1 "register_operand" "")
+ (match_operand:HI 2 "register_operand" "")))
+ (clobber (match_scratch:HI 3 ""))])]
+ ""
+ "")
+
+(define_insn "mulhi3_m68hc11"
[(set (match_operand:HI 0 "register_operand" "=d")
(mult:HI (match_operand:HI 1 "register_operand" "%0")
- (match_operand:HI 2 "register_operand" "x")))]
- ""
+ (match_operand:HI 2 "register_operand" "x")))
+ (clobber (match_scratch:HI 3 "=X"))]
+ "TARGET_M6811"
"*
{
CC_STATUS_INIT;
@@ -2390,6 +2794,59 @@
return \"jsr\\t___mulhi3\";
}")
+(define_insn "mulhi3_m68hc12"
+ [(set (match_operand:HI 0 "register_operand" "=d,d")
+ (mult:HI (match_operand:HI 1 "register_operand" "%0,0")
+ (match_operand:HI 2 "register_operand" "y,x")))
+ (clobber (match_scratch:HI 3 "=2,2"))]
+ "TARGET_M6812"
+ "*
+{
+ CC_STATUS_INIT;
+ if (X_REG_P (operands[2]))
+ return \"exg\\tx,y\\n\\temul\\n\\texg\\tx,y\";
+ else
+ return \"emul\";
+}")
+
+(define_insn "umulhisi3"
+ [(set (match_operand:SI 0 "register_operand" "=D,D")
+ (mult:SI (zero_extend:SI
+ (match_operand:HI 1 "register_operand" "%d,d"))
+ (zero_extend:SI
+ (match_operand:HI 2 "register_operand" "y,x"))))
+ (clobber (match_scratch:HI 3 "=2,X"))]
+ "TARGET_M6812"
+ "*
+{
+ if (X_REG_P (operands [2]))
+ output_asm_insn (\"exg\\tx,y\", operands);
+
+ /* Can't use the carry after that; other flags are ok when testing
+ the 32-bit result. */
+ cc_status.flags |= CC_NO_OVERFLOW;
+ return \"emul\\n\\texg\\tx,y\";
+}")
+
+(define_insn "mulhisi3"
+ [(set (match_operand:SI 0 "register_operand" "=D,D")
+ (mult:SI (sign_extend:SI
+ (match_operand:HI 1 "register_operand" "%d,d"))
+ (sign_extend:SI
+ (match_operand:HI 2 "register_operand" "y,x"))))
+ (clobber (match_scratch:HI 3 "=2,X"))]
+ "TARGET_M6812"
+ "*
+{
+ if (X_REG_P (operands [2]))
+ output_asm_insn (\"exg\\tx,y\", operands);
+
+ /* Can't use the carry after that; other flags are ok when testing
+ the 32-bit result. */
+ cc_status.flags |= CC_NO_OVERFLOW;
+ return \"emuls\\n\\texg\\tx,y\";
+}")
+
(define_insn "umulqihi3"
[(set (match_operand:HI 0 "register_operand" "=d")
(mult:HI (zero_extend:HI
@@ -2501,7 +2958,7 @@
[(set (match_operand:HI 0 "register_operand" "=d,d")
(div:HI (match_operand:HI 1 "register_operand" "0,0")
(match_operand:HI 2 "general_operand" "A,ium")))
- (set (match_operand:HI 3 "register_operand" "=x,x")
+ (set (match_operand:HI 3 "register_operand" "=&x,&x")
(mod:HI (match_dup 1) (match_dup 2)))]
""
"*
@@ -2518,8 +2975,16 @@
output_asm_insn (\"ldx\\t%2\", operands);
}
}
- CC_STATUS_INIT;
- return \"bsr\\t__divmodhi4\";
+ if (TARGET_M6812)
+ {
+ /* Flags are ok after that. */
+ return \"idivs\\n\\txgdx\";
+ }
+ else
+ {
+ CC_STATUS_INIT;
+ return \"bsr\\t__divmodhi4\";
+ }
}")
(define_insn "udivmodhi4"
@@ -2663,7 +3128,7 @@
(define_insn "andqi3"
[(set (match_operand:QI 0 "register_operand" "=d,!u,d,d,?*A,?*A,!*q")
(and:QI (match_operand:QI 1 "register_operand" "%0,0,0,0,0,0,0")
- (match_operand:QI 2 "general_operand" "i,i,!um,?*A,i!um,?*A,i!um*A")))]
+ (match_operand:QI 2 "general_operand" "i,i,!um,?*A,!ium,?*A*d,!ium*A")))]
""
"*
{
@@ -2770,7 +3235,7 @@
(define_insn "iorqi3"
[(set (match_operand:QI 0 "register_operand" "=d,!u,d,d,?*A,?*A,!*q")
(ior:QI (match_operand:QI 1 "register_operand" "%0,0,0,0,0,0,0")
- (match_operand:QI 2 "general_operand" "i,i,!um,!*A,i!um,!*A,i!um*A")))]
+ (match_operand:QI 2 "general_operand" "i,i,!um,!*A,!ium,?*A*d,!ium*A")))]
""
"*
{
@@ -2864,9 +3329,9 @@
}")
(define_insn "xorqi3"
- [(set (match_operand:QI 0 "register_operand" "=d,d,!*u*A,!*u*A,!*q")
- (xor:QI (match_operand:QI 1 "register_operand" "%0,0,0,0,0")
- (match_operand:QI 2 "general_operand" "ium,!*A,ium,!*A,ium*A*u")))]
+ [(set (match_operand:QI 0 "register_operand" "=d,d,d,?*A,?*A,!*q")
+ (xor:QI (match_operand:QI 1 "register_operand" "%0,0,0,0,0,0")
+ (match_operand:QI 2 "general_operand" "i,!um,!*A,!ium,?*A*d,!ium*A")))]
""
"*
{
@@ -2927,10 +3392,10 @@
(match_operand:QI 1 "general_operand" "dxy,imu"))
(match_operand:SI 2 "general_operand" "imuD,imuD")]))]
"z_replacement_completed == 2"
- [(set (reg:QI 5) (match_dup 4))
- (set (reg:QI 1) (match_dup 7))
- (set (reg:QI 6) (match_op_dup 3 [(reg:QI 6) (match_dup 5)]))
- (set (reg:HI 0) (match_dup 6))]
+ [(set (reg:QI A_REGNUM) (match_dup 4))
+ (set (reg:QI D_REGNUM) (match_dup 7))
+ (set (reg:QI B_REGNUM) (match_op_dup 3 [(reg:QI B_REGNUM) (match_dup 5)]))
+ (set (reg:HI X_REGNUM) (match_dup 6))]
"PUT_MODE (operands[3], QImode);
if (X_REG_P (operands[2]))
{
@@ -2957,9 +3422,9 @@
(match_operand:HI 1 "general_operand" "dA,imu"))
(match_operand:SI 2 "general_operand" "imuD,imuD")]))]
"reload_completed"
- [(set (reg:HI 1) (match_dup 4))
- (set (reg:HI 1) (match_op_dup 3 [(reg:HI 1) (match_dup 5)]))
- (set (reg:HI 0) (match_dup 6))]
+ [(set (reg:HI D_REGNUM) (match_dup 4))
+ (set (reg:HI D_REGNUM) (match_op_dup 3 [(reg:HI D_REGNUM) (match_dup 5)]))
+ (set (reg:HI X_REGNUM) (match_dup 6))]
"PUT_MODE (operands[3], HImode);
if (X_REG_P (operands[2]))
{
@@ -2988,11 +3453,11 @@
"#")
(define_insn "*logicalhi3_zexthi"
- [(set (match_operand:HI 0 "register_operand" "=d")
+ [(set (match_operand:HI 0 "register_operand" "=d,d")
(match_operator:HI 3 "m68hc11_logical_operator"
[(zero_extend:HI
- (match_operand:QI 1 "general_operand" "imud"))
- (match_operand:HI 2 "general_operand" "dimu")]))]
+ (match_operand:QI 1 "general_operand" "imd*A,?u"))
+ (match_operand:HI 2 "general_operand" "dim,?dimu")]))]
""
"#")
@@ -3003,9 +3468,9 @@
(match_operand:QI 1 "general_operand" "imud"))
(match_operand:HI 2 "general_operand" "dimu")]))]
"z_replacement_completed == 2"
- [(set (reg:QI 6) (match_dup 6))
- (set (reg:QI 5) (match_dup 4))
- (set (reg:QI 6) (match_op_dup 3 [(reg:QI 6) (match_dup 5)]))]
+ [(set (reg:QI B_REGNUM) (match_dup 6))
+ (set (reg:QI A_REGNUM) (match_dup 4))
+ (set (reg:QI B_REGNUM) (match_op_dup 3 [(reg:QI B_REGNUM) (match_dup 5)]))]
"
PUT_MODE (operands[3], QImode);
if (D_REG_P (operands[2]))
@@ -3034,8 +3499,8 @@
(match_operand:HI 2 "general_operand" "dimu")
(const_int 8))]))]
"z_replacement_completed == 2"
- [(set (reg:QI 6) (match_dup 5))
- (set (reg:QI 5) (match_dup 4))]
+ [(set (reg:QI A_REGNUM) (match_dup 4))
+ (set (reg:QI B_REGNUM) (match_dup 5))]
"
if (GET_CODE (operands[3]) == AND)
{
@@ -3060,7 +3525,7 @@
[(set (match_operand:SI 0 "register_operand" "=D,D")
(match_operator:SI 3 "m68hc11_logical_operator"
[(lshiftrt:SI
- (match_operand:SI 1 "general_operand" "uim,!D")
+ (match_operand:SI 1 "general_operand" "uim,?D")
(const_int 16))
(match_operand:SI 2 "general_operand" "uim,0")]))]
""
@@ -3070,13 +3535,13 @@
[(set (match_operand:SI 0 "register_operand" "=D,D")
(match_operator:SI 3 "m68hc11_logical_operator"
[(lshiftrt:SI
- (match_operand:SI 1 "general_operand" "uim,!D")
+ (match_operand:SI 1 "general_operand" "uim,?D")
(const_int 16))
(match_operand:SI 2 "general_operand" "uim,0")]))]
"reload_completed"
- [(set (reg:HI 1) (match_dup 4))
- (set (reg:HI 1) (match_op_dup 3 [(reg:HI 1) (match_dup 5)]))
- (set (reg:HI 0) (match_dup 6))]
+ [(set (reg:HI D_REGNUM) (match_dup 4))
+ (set (reg:HI D_REGNUM) (match_op_dup 3 [(reg:HI D_REGNUM) (match_dup 5)]))
+ (set (reg:HI X_REGNUM) (match_dup 6))]
"operands[5] = m68hc11_gen_highpart (HImode, operands[1]);
if (X_REG_P (operands[2]))
{
@@ -3096,7 +3561,7 @@
[(set (match_operand:SI 0 "register_operand" "=D,D")
(match_operator:SI 3 "m68hc11_logical_operator"
[(ashift:SI
- (match_operand:SI 1 "general_operand" "uim,!D")
+ (match_operand:SI 1 "general_operand" "uim,?D")
(const_int 16))
(match_operand:SI 2 "general_operand" "0,0")]))]
""
@@ -3106,15 +3571,15 @@
[(set (match_operand:SI 0 "register_operand" "=D,D")
(match_operator:SI 3 "m68hc11_logical_operator"
[(ashift:SI
- (match_operand:SI 1 "general_operand" "uim,!D")
+ (match_operand:SI 1 "general_operand" "uim,?D")
(const_int 16))
(match_operand:SI 2 "general_operand" "0,0")]))]
"z_replacement_completed == 2"
- [(parallel [(set (reg:HI 1) (reg:HI 0))
- (set (reg:HI 0) (reg:HI 1))])
- (set (reg:HI 1) (match_op_dup 3 [(reg:HI 1) (match_dup 4)]))
- (parallel [(set (reg:HI 1) (reg:HI 0))
- (set (reg:HI 0) (reg:HI 1))])]
+ [(parallel [(set (reg:HI D_REGNUM) (reg:HI X_REGNUM))
+ (set (reg:HI X_REGNUM) (reg:HI D_REGNUM))])
+ (set (reg:HI D_REGNUM) (match_op_dup 3 [(reg:HI D_REGNUM) (match_dup 4)]))
+ (parallel [(set (reg:HI D_REGNUM) (reg:HI X_REGNUM))
+ (set (reg:HI X_REGNUM) (reg:HI D_REGNUM))])]
"operands[4] = m68hc11_gen_lowpart (HImode, operands[1]);
PUT_MODE (operands[3], HImode);")
@@ -3177,21 +3642,24 @@
/* If we are adding a small constant to X or Y, it's
better to use one or several inx/iny instructions. */
&& !(GET_CODE (operands[3]) == PLUS
- && (TARGET_M6812
+ && ((TARGET_M6812
+ && (immediate_operand (operands[2], HImode)
+ || hard_reg_operand (operands[2], HImode)))
|| (GET_CODE (operands[2]) == CONST_INT
&& INTVAL (operands[2]) >= -4
&& INTVAL (operands[2]) <= 4)))"
[(set (match_dup 4) (match_dup 5))
(set (match_dup 8) (match_dup 7))
- (parallel [(set (reg:HI 1) (match_dup 0))
- (set (match_dup 0) (reg:HI 1))])
- (set (reg:HI 1) (match_op_dup 3 [(reg:HI 1) (match_dup 6)]))
- (parallel [(set (reg:HI 1) (match_dup 0))
- (set (match_dup 0) (reg:HI 1))])]
+ (parallel [(set (reg:HI D_REGNUM) (match_dup 0))
+ (set (match_dup 0) (reg:HI D_REGNUM))])
+ (set (reg:HI D_REGNUM) (match_op_dup 3 [(reg:HI D_REGNUM) (match_dup 6)]))
+ (parallel [(set (reg:HI D_REGNUM) (match_dup 0))
+ (set (match_dup 0) (reg:HI D_REGNUM))])]
"
/* Save the operand2 in a temporary location and use it. */
- if (H_REG_P (operands[2])
- || reg_mentioned_p (operands[0], operands[2]))
+ if ((H_REG_P (operands[2])
+ || reg_mentioned_p (operands[0], operands[2]))
+ && !(SP_REG_P (operands[2]) && GET_CODE (operands[3]) == PLUS))
{
operands[4] = gen_rtx (REG, HImode, SOFT_TMP_REGNUM);
operands[6] = operands[4];
@@ -3224,16 +3692,18 @@
/* If we are adding a small constant to X or Y, it's
better to use one or several inx/iny instructions. */
&& !(GET_CODE (operands[3]) == PLUS
- && (TARGET_M6812
+ && ((TARGET_M6812
+ && (immediate_operand (operands[2], HImode)
+ || hard_reg_operand (operands[2], HImode)))
|| (GET_CODE (operands[2]) == CONST_INT
&& INTVAL (operands[2]) >= -4
&& INTVAL (operands[2]) <= 4)))"
[(set (match_dup 0) (match_dup 1))
- (parallel [(set (reg:HI 1) (match_dup 0))
- (set (match_dup 0) (reg:HI 1))])
- (set (reg:HI 1) (match_op_dup 3 [(reg:HI 1) (match_dup 2)]))
- (parallel [(set (reg:HI 1) (match_dup 0))
- (set (match_dup 0) (reg:HI 1))])]
+ (parallel [(set (reg:HI D_REGNUM) (match_dup 0))
+ (set (match_dup 0) (reg:HI D_REGNUM))])
+ (set (reg:HI D_REGNUM) (match_op_dup 3 [(reg:HI D_REGNUM) (match_dup 2)]))
+ (parallel [(set (reg:HI D_REGNUM) (match_dup 0))
+ (set (match_dup 0) (reg:HI D_REGNUM))])]
"
")
@@ -3283,11 +3753,11 @@
[(match_operand 1 "general_operand" "uim*d*A")]))]
"z_replacement_completed == 2"
[(set (match_dup 4) (match_dup 5))
- (parallel [(set (reg:HI 1) (match_dup 0))
- (set (match_dup 0) (reg:HI 1))])
- (set (reg:HI 1) (match_op_dup 2 [(match_dup 3)]))
- (parallel [(set (reg:HI 1) (match_dup 0))
- (set (match_dup 0) (reg:HI 1))])]
+ (parallel [(set (reg:HI D_REGNUM) (match_dup 0))
+ (set (match_dup 0) (reg:HI D_REGNUM))])
+ (set (reg:HI D_REGNUM) (match_op_dup 2 [(match_dup 3)]))
+ (parallel [(set (reg:HI D_REGNUM) (match_dup 0))
+ (set (match_dup 0) (reg:HI D_REGNUM))])]
"
{
if ((H_REG_P (operands[1])
@@ -3331,11 +3801,11 @@
&& GET_CODE (operands[2]) == CONST_INT
&& (INTVAL (operands[2]) == 1 || INTVAL (operands[2]) == -1))"
[(set (match_dup 5) (match_dup 6))
- (parallel [(set (reg:HI 1) (match_dup 4))
- (set (match_dup 4) (reg:HI 1))])
- (set (reg:QI 1) (match_op_dup 3 [(reg:QI 1) (match_dup 7)]))
- (parallel [(set (reg:HI 1) (match_dup 4))
- (set (match_dup 4) (reg:HI 1))])]
+ (parallel [(set (reg:HI D_REGNUM) (match_dup 4))
+ (set (match_dup 4) (reg:HI D_REGNUM))])
+ (set (reg:QI D_REGNUM) (match_op_dup 3 [(reg:QI D_REGNUM) (match_dup 7)]))
+ (parallel [(set (reg:HI D_REGNUM) (match_dup 4))
+ (set (match_dup 4) (reg:HI D_REGNUM))])]
"operands[4] = gen_rtx (REG, HImode, REGNO (operands[0]));
/* For the second operand is a hard register or if the address
@@ -3410,11 +3880,11 @@
[(match_operand:QI 1 "general_operand" "uim*d*x*y")]))]
"z_replacement_completed == 2"
[(set (match_dup 4) (match_dup 5))
- (parallel [(set (reg:HI 1) (match_dup 3))
- (set (match_dup 3) (reg:HI 1))])
- (set (reg:QI 1) (match_op_dup 2 [(match_dup 6)]))
- (parallel [(set (reg:HI 1) (match_dup 3))
- (set (match_dup 3) (reg:HI 1))])]
+ (parallel [(set (reg:HI D_REGNUM) (match_dup 3))
+ (set (match_dup 3) (reg:HI D_REGNUM))])
+ (set (reg:QI D_REGNUM) (match_op_dup 2 [(match_dup 6)]))
+ (parallel [(set (reg:HI D_REGNUM) (match_dup 3))
+ (set (match_dup 3) (reg:HI D_REGNUM))])]
"
{
operands[3] = gen_rtx (REG, HImode, REGNO (operands[0]));
@@ -3530,12 +4000,12 @@
(not:SI (match_operand:SI 1 "non_push_operand" "0")))]
"z_replacement_completed == 2
&& (!D_REG_P (operands[0]) || (optimize && optimize_size == 0))"
- [(set (reg:HI 1) (not:HI (reg:HI 1)))
- (parallel [(set (reg:HI 0) (reg:HI 1))
- (set (reg:HI 1) (reg:HI 0))])
- (set (reg:HI 1) (not:HI (reg:HI 1)))
- (parallel [(set (reg:HI 0) (reg:HI 1))
- (set (reg:HI 1) (reg:HI 0))])]
+ [(set (reg:HI D_REGNUM) (not:HI (reg:HI D_REGNUM)))
+ (parallel [(set (reg:HI X_REGNUM) (reg:HI D_REGNUM))
+ (set (reg:HI D_REGNUM) (reg:HI X_REGNUM))])
+ (set (reg:HI D_REGNUM) (not:HI (reg:HI D_REGNUM)))
+ (parallel [(set (reg:HI X_REGNUM) (reg:HI D_REGNUM))
+ (set (reg:HI D_REGNUM) (reg:HI X_REGNUM))])]
"
{
/* The result pattern only works for D register.
@@ -3576,7 +4046,7 @@
[(set (match_operand:DI 0 "nonimmediate_operand" "=<,m,u")
(ashift:DI (match_operand:DI 1 "general_operand" "umi,umi,umi")
(const_int 32)))
- (clobber (match_scratch:HI 2 "=A,d,d"))]
+ (clobber (match_scratch:HI 2 "=&A,d,d"))]
""
"#")
@@ -3584,7 +4054,7 @@
[(set (match_operand:DI 0 "nonimmediate_operand" "=<,um")
(ashift:DI (match_operand:DI 1 "general_operand" "umi,umi")
(const_int 32)))
- (clobber (match_scratch:HI 2 "=A,d"))]
+ (clobber (match_scratch:HI 2 "=&A,d"))]
"reload_completed"
[(const_int 0)]
"/* Move the lowpart in the highpart first in case the shift
@@ -3623,15 +4093,15 @@
(set (match_dup 4) (match_dup 2))
(set (match_dup 2) (match_dup 5))
- (set (match_dup 2) (rotate:HI (match_dup 2) (reg:HI 7)))
+ (set (match_dup 2) (rotate:HI (match_dup 2) (reg:HI CC_REGNUM)))
(set (match_dup 6) (match_dup 2))
(set (match_dup 2) (match_dup 7))
- (set (match_dup 2) (rotate:HI (match_dup 2) (reg:HI 7)))
+ (set (match_dup 2) (rotate:HI (match_dup 2) (reg:HI CC_REGNUM)))
(set (match_dup 8) (match_dup 2))
(set (match_dup 2) (match_dup 9))
- (set (match_dup 2) (rotate:HI (match_dup 2) (reg:HI 7)))
+ (set (match_dup 2) (rotate:HI (match_dup 2) (reg:HI CC_REGNUM)))
(set (match_dup 10) (match_dup 2))]
"operands[3] = m68hc11_gen_lowpart (SImode, operands[1]);
operands[5] = m68hc11_gen_highpart (HImode, operands[3]);
@@ -3663,8 +4133,8 @@
(const_int 16))
(match_operand:SI 2 "general_operand" "0")))]
"z_replacement_completed == 2"
- [(set (reg:HI 1) (plus:HI (reg:HI 1) (match_dup 3)))
- (set (reg:HI 0) (plus:HI (plus:HI (reg:HI 0) (const_int 0)) (reg:HI 7)))]
+ [(set (reg:HI D_REGNUM) (plus:HI (reg:HI D_REGNUM) (match_dup 3)))
+ (set (reg:HI X_REGNUM) (plus:HI (plus:HI (reg:HI X_REGNUM) (const_int 0)) (reg:HI CC_REGNUM)))]
"operands[3] = m68hc11_gen_highpart (HImode, operands[1]);")
(define_insn "addsi_ashift16"
@@ -3685,7 +4155,7 @@
(match_operand:SI 1 "general_operand" "0")))
(clobber (match_scratch:HI 3 "=X"))]
"0 && reload_completed && z_replacement_completed == 2"
- [(set (reg:HI 0) (plus:HI (reg:HI 0) (match_dup 4)))]
+ [(set (reg:HI X_REGNUM) (plus:HI (reg:HI X_REGNUM) (match_dup 4)))]
"
{
operands[4] = m68hc11_gen_lowpart (HImode, operands[2]);
@@ -3705,8 +4175,8 @@
(const_int 65535))
(match_operand:SI 2 "general_operand" "0")))]
"z_replacement_completed == 2"
- [(set (reg:HI 1) (plus:HI (reg:HI 1) (match_dup 3)))
- (set (reg:HI 0) (plus:HI (plus:HI (reg:HI 0) (const_int 0)) (reg:HI 7)))]
+ [(set (reg:HI D_REGNUM) (plus:HI (reg:HI D_REGNUM) (match_dup 3)))
+ (set (reg:HI X_REGNUM) (plus:HI (plus:HI (reg:HI X_REGNUM) (const_int 0)) (reg:HI CC_REGNUM)))]
"operands[3] = m68hc11_gen_lowpart (HImode, operands[1]);")
;;
@@ -3766,8 +4236,8 @@
(const_int 16)))
(clobber (match_scratch:HI 2 "=X"))]
"reload_completed"
- [(set (reg:HI 0) (match_dup 1))
- (set (reg:HI 1) (const_int 0))]
+ [(set (reg:HI X_REGNUM) (match_dup 1))
+ (set (reg:HI D_REGNUM) (const_int 0))]
"")
(define_insn "*ashlsi3_const1"
@@ -3856,8 +4326,15 @@
is true for 68hc11 only, we save temporary the value of Y. */
if (!Y_REG_P (operands[2]))
{
+ rtx ops[1];
+
+ ops[0] = operands[1];
output_asm_insn (\"pshy\", operands);
- output_asm_insn (\"ldy\\t%1\", operands);
+ if (reg_mentioned_p (stack_pointer_rtx, operands[1]))
+ {
+ ops[0] = adj_offsettable_operand (operands[1], 2);
+ }
+ output_asm_insn (\"ldy\\t%0\", ops);
output_asm_insn (\"bsr\\t___ashlsi3\", operands);
return \"puly\";
}
@@ -3910,7 +4387,7 @@
(define_insn "*ashlhi3_2"
[(set (match_operand:HI 0 "register_operand" "=d")
(ashift:HI (match_operand:HI 1 "register_operand" "0")
- (match_operand:HI 2 "register_operand" "x")))
+ (match_operand:HI 2 "register_operand" "+x")))
(clobber (match_dup 2))]
""
"*
@@ -3919,10 +4396,10 @@
return \"bsr\\t___lshlhi3\";
}")
-(define_insn ""
+(define_insn "*ashlhi3"
[(set (strict_low_part (match_operand:HI 0 "register_operand" "+d"))
(ashift:HI (match_dup 0)
- (match_operand:HI 1 "register_operand" "x")))
+ (match_operand:HI 1 "register_operand" "+x")))
(clobber (match_dup 1))]
""
"*
@@ -4177,9 +4654,9 @@
output_asm_insn (\"rolb\", operands);
output_asm_insn (\"rola\", operands);
output_asm_insn (\"tab\", operands);
- output_asm_insn (\"anda\\t#1\", operands);
+ output_asm_insn (\"anda\\t#0\", operands);
output_asm_insn (\"bcc\\t%l0\", ops);
- output_asm_insn (\"oraa\\t#0xFE\", ops);
+ output_asm_insn (\"coma\", ops);
ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\",
CODE_LABEL_NUMBER (ops[0]));
@@ -4199,7 +4676,7 @@
(define_insn "*ashrhi3"
[(set (match_operand:HI 0 "register_operand" "=d,x")
(ashiftrt:HI (match_operand:HI 1 "register_operand" "0,0")
- (match_operand:HI 2 "register_operand" "x,d")))
+ (match_operand:HI 2 "register_operand" "+x,+d")))
(clobber (match_dup 2))]
""
"*
@@ -4257,8 +4734,15 @@
is true for 68hc11 only, we save temporary the value of Y. */
if (!Y_REG_P (operands[2]))
{
+ rtx ops[1];
+
+ ops[0] = operands[1];
output_asm_insn (\"pshy\", operands);
- output_asm_insn (\"ldy\\t%1\", operands);
+ if (reg_mentioned_p (stack_pointer_rtx, operands[1]))
+ {
+ ops[0] = adj_offsettable_operand (operands[1], 2);
+ }
+ output_asm_insn (\"ldy\\t%0\", ops);
output_asm_insn (\"bsr\\t___ashrsi3\", operands);
return \"puly\";
}
@@ -4355,7 +4839,7 @@
[(set (match_operand:DI 0 "nonimmediate_operand" "=<,m,u")
(lshiftrt:DI (match_operand:DI 1 "general_operand" "umi,umi,umi")
(const_int 32)))
- (clobber (match_scratch:HI 2 "=A,d,d"))]
+ (clobber (match_scratch:HI 2 "=&A,d,d"))]
""
"#")
@@ -4363,7 +4847,7 @@
[(set (match_operand:DI 0 "nonimmediate_operand" "=<,um")
(lshiftrt:DI (match_operand:DI 1 "general_operand" "umi,umi")
(const_int 32)))
- (clobber (match_scratch:HI 2 "=A,d"))]
+ (clobber (match_scratch:HI 2 "=&A,d"))]
"reload_completed"
[(const_int 0)]
"m68hc11_split_move (m68hc11_gen_lowpart (SImode, operands[0]),
@@ -4387,14 +4871,14 @@
(match_operand:DI 2 "const_int_operand" "")))
(clobber (match_scratch:HI 3 "=d"))]
"z_replacement_completed && INTVAL (operands[2]) >= 56"
- [(set (reg:QI 1) (match_dup 9))
- (set (reg:QI 1) (lshiftrt:QI (reg:QI 1) (match_dup 8)))
- (set (reg:HI 1) (zero_extend:HI (reg:QI 1)))
- (set (match_dup 4) (reg:HI 1))
- (set (reg:QI 1) (const_int 0))
- (set (match_dup 5) (reg:HI 1))
- (set (match_dup 6) (reg:HI 1))
- (set (match_dup 7) (reg:HI 1))]
+ [(set (reg:QI D_REGNUM) (match_dup 9))
+ (set (reg:QI D_REGNUM) (lshiftrt:QI (reg:QI D_REGNUM) (match_dup 8)))
+ (set (reg:HI D_REGNUM) (zero_extend:HI (reg:QI D_REGNUM)))
+ (set (match_dup 4) (reg:HI D_REGNUM))
+ (set (reg:QI D_REGNUM) (const_int 0))
+ (set (match_dup 5) (reg:HI D_REGNUM))
+ (set (match_dup 6) (reg:HI D_REGNUM))
+ (set (match_dup 7) (reg:HI D_REGNUM))]
"operands[8] = gen_rtx (CONST_INT, VOIDmode, INTVAL (operands[2]) - 56);
operands[4] = m68hc11_gen_lowpart (SImode, operands[0]);
operands[5] = m68hc11_gen_highpart (HImode, operands[4]);
@@ -4415,13 +4899,13 @@
(clobber (match_scratch:HI 3 "=d"))]
"z_replacement_completed && INTVAL (operands[2]) >= 48
&& INTVAL (operands[2]) < 56"
- [(set (reg:HI 1) (match_dup 9))
- (set (reg:HI 1) (lshiftrt:HI (reg:HI 1) (match_dup 8)))
- (set (match_dup 4) (reg:HI 1))
- (set (reg:HI 1) (const_int 0))
- (set (match_dup 5) (reg:HI 1))
- (set (match_dup 6) (reg:HI 1))
- (set (match_dup 7) (reg:HI 1))]
+ [(set (reg:HI D_REGNUM) (match_dup 9))
+ (set (reg:HI D_REGNUM) (lshiftrt:HI (reg:HI D_REGNUM) (match_dup 8)))
+ (set (match_dup 4) (reg:HI D_REGNUM))
+ (set (reg:HI D_REGNUM) (const_int 0))
+ (set (match_dup 5) (reg:HI D_REGNUM))
+ (set (match_dup 6) (reg:HI D_REGNUM))
+ (set (match_dup 7) (reg:HI D_REGNUM))]
"operands[8] = gen_rtx (CONST_INT, VOIDmode, INTVAL (operands[2]) - 48);
operands[4] = m68hc11_gen_lowpart (SImode, operands[0]);
operands[5] = m68hc11_gen_highpart (HImode, operands[4]);
@@ -4452,15 +4936,15 @@
(set (match_dup 4) (match_dup 2))
(set (match_dup 2) (match_dup 5))
- (set (match_dup 2) (rotatert:HI (match_dup 2) (reg:HI 7)))
+ (set (match_dup 2) (rotatert:HI (match_dup 2) (reg:HI CC_REGNUM)))
(set (match_dup 6) (match_dup 2))
(set (match_dup 2) (match_dup 7))
- (set (match_dup 2) (rotatert:HI (match_dup 2) (reg:HI 7)))
+ (set (match_dup 2) (rotatert:HI (match_dup 2) (reg:HI CC_REGNUM)))
(set (match_dup 8) (match_dup 2))
(set (match_dup 2) (match_dup 9))
- (set (match_dup 2) (rotatert:HI (match_dup 2) (reg:HI 7)))
+ (set (match_dup 2) (rotatert:HI (match_dup 2) (reg:HI CC_REGNUM)))
(set (match_dup 10) (match_dup 2))]
"operands[3] = m68hc11_gen_highpart (SImode, operands[1]);
operands[5] = m68hc11_gen_lowpart (HImode, operands[3]);
@@ -4508,8 +4992,10 @@
(const_int 16)))
(clobber (match_scratch:HI 2 "=X,X,X,X"))]
""
- "#
+ "@
+ #
xgdx\\n\\tldx\\t#0
+ #
#")
(define_insn "*lshrsi3_const1"
@@ -4592,8 +5078,15 @@
is true for 68hc11 only, we save temporary the value of Y. */
if (!Y_REG_P (operands[2]))
{
+ rtx ops[1];
+
+ ops[0] = operands[1];
output_asm_insn (\"pshy\", operands);
- output_asm_insn (\"ldy\\t%1\", operands);
+ if (reg_mentioned_p (stack_pointer_rtx, operands[1]))
+ {
+ ops[0] = adj_offsettable_operand (operands[1], 2);
+ }
+ output_asm_insn (\"ldy\\t%0\", ops);
output_asm_insn (\"bsr\\t___lshrsi3\", operands);
return \"puly\";
}
@@ -4637,7 +5130,7 @@
return \"lsrd\";
CC_STATUS_INIT;
- return \"lsr\\t%h0\\n\\trol\\t%b0\";
+ return \"lsr\\t%h0\\n\\tror\\t%b0\";
}")
(define_insn "lshrhi3_const"
@@ -4727,7 +5220,7 @@
(define_insn "*lshrhi3"
[(set (match_operand:HI 0 "register_operand" "=d,x")
(lshiftrt:HI (match_operand:HI 1 "register_operand" "0,0")
- (match_operand:HI 2 "register_operand" "x,d")))
+ (match_operand:HI 2 "register_operand" "+x,+d")))
(clobber (match_dup 2))]
""
"*
@@ -4751,13 +5244,13 @@
"")
(define_insn "*lshrqi3_const1"
- [(set (match_operand:QI 0 "nonimmediate_operand" "=d,m,!u,!*q,!*A")
+ [(set (match_operand:QI 0 "nonimmediate_operand" "=m,d,!u,!*q,!*A")
(lshiftrt:QI (match_operand:QI 1 "nonimmediate_operand" "0,0,0,0,0")
(const_int 1)))]
""
"@
- lsrb
lsr\\t%b0
+ lsrb
lsr\\t%b0
lsr%0
#")
@@ -4868,7 +5361,7 @@
(define_insn "*rotlqi3_with_carry"
[(set (match_operand:QI 0 "register_operand" "=d,!q")
(rotate:QI (match_operand:QI 1 "register_operand" "0,0")
- (reg:QI 7)))]
+ (reg:QI CC_REGNUM)))]
""
"*
{
@@ -4881,7 +5374,7 @@
(define_insn "*rotlhi3_with_carry"
[(set (match_operand:HI 0 "register_operand" "=d")
(rotate:HI (match_operand:HI 1 "register_operand" "0")
- (reg:HI 7)))]
+ (reg:HI CC_REGNUM)))]
""
"*
{
@@ -4892,7 +5385,7 @@
(define_insn "*rotrhi3_with_carry"
[(set (match_operand:HI 0 "register_operand" "=d")
(rotatert:HI (match_operand:HI 1 "register_operand" "0")
- (reg:HI 7)))]
+ (reg:HI CC_REGNUM)))]
""
"*
{
@@ -5103,6 +5596,78 @@
DONE;
}")
+;;
+;; Test and branch instructions for 68HC12 for EQ and NE.
+;; 'z' must not appear in the constraints because the z replacement
+;; pass does not know how to restore the replacement register.
+;;
+(define_insn "*tbeq"
+ [(set (pc)
+ (if_then_else (eq (match_operand:HI 0 "register_operand" "dxy")
+ (const_int 0))
+ (label_ref (match_operand 1 "" ""))
+ (pc)))]
+ "TARGET_M6812"
+ "*
+{
+ /* If the flags are already set correctly, use 'bne/beq' which are
+ smaller and a little bit faster. This happens quite often due
+ to reloading of operands[0]. In that case, flags are set correctly
+ due to the load instruction. */
+ if (cc_status.value1 && rtx_equal_p (cc_status.value1, operands[0]))
+ return \"beq\\t%l1\";
+ else
+ return \"tbeq\\t%0,%l1\";
+}")
+
+(define_insn "*tbne"
+ [(set (pc)
+ (if_then_else (ne (match_operand:HI 0 "register_operand" "dxy")
+ (const_int 0))
+ (label_ref (match_operand 1 "" ""))
+ (pc)))]
+ "TARGET_M6812"
+ "*
+{
+ if (cc_status.value1 && rtx_equal_p (cc_status.value1, operands[0]))
+ return \"bne\\t%l1\";
+ else
+ return \"tbne\\t%0,%l1\";
+}")
+
+;;
+;; Test and branch with 8-bit register. Register must be B (or A).
+;;
+(define_insn "*tbeq8"
+ [(set (pc)
+ (if_then_else (eq (match_operand:QI 0 "register_operand" "d")
+ (const_int 0))
+ (label_ref (match_operand 1 "" ""))
+ (pc)))]
+ "TARGET_M6812"
+ "*
+{
+ if (cc_status.value1 && rtx_equal_p (cc_status.value1, operands[0]))
+ return \"beq\\t%l1\";
+ else
+ return \"tbeq\\tb,%l1\";
+}")
+
+(define_insn "*tbne8"
+ [(set (pc)
+ (if_then_else (ne (match_operand:QI 0 "register_operand" "d")
+ (const_int 0))
+ (label_ref (match_operand 1 "" ""))
+ (pc)))]
+ "TARGET_M6812"
+ "*
+{
+ if (cc_status.value1 && rtx_equal_p (cc_status.value1, operands[0]))
+ return \"bne\\t%l1\";
+ else
+ return \"tbne\\tb,%l1\";
+}")
+
(define_insn "*beq"
[(set (pc)
(if_then_else (eq (cc0)
@@ -5328,7 +5893,7 @@
;;
;;- Call a function that returns no value.
(define_insn "call"
- [(call (match_operand:QI 0 "memory_operand" "mAi")
+ [(call (match_operand:QI 0 "memory_operand" "m")
(match_operand:SI 1 "general_operand" "g"))]
;; Operand 1 not really used on the m68hc11.
""
@@ -5349,7 +5914,7 @@
(define_insn "call_value"
[(set (match_operand 0 "" "=g")
- (call (match_operand:QI 1 "general_operand" "mAi")
+ (call (match_operand:QI 1 "memory_operand" "m")
(match_operand:SI 2 "general_operand" "g")))]
""
"*
@@ -5478,7 +6043,7 @@
(define_insn "*return_16bit"
[(return)
- (use (reg:HI 1))]
+ (use (reg:HI D_REGNUM))]
"reload_completed && m68hc11_total_frame_size () == 0"
"*
{
@@ -5540,26 +6105,57 @@
;;--------------------------------------------------------------------
;;
+;; Reorganize to optimize address computations.
+;;
+(define_peephole2
+ [(set (match_operand:HI 0 "hard_reg_operand" "")
+ (match_operand:HI 1 "const_int_operand" ""))
+ (set (match_dup 0)
+ (plus:HI (match_dup 0)
+ (match_operand:HI 2 "general_operand" "")))]
+ "(INTVAL (operands[1]) >= -2 && INTVAL (operands[1]) <= 2)"
+ [(set (match_dup 0) (match_dup 2))
+ (set (match_dup 0) (plus:HI (match_dup 0) (match_dup 1)))]
+ "")
+
+;;
+;; Reorganize address computation based on stack pointer.
+;;
+(define_peephole2
+ [(set (match_operand:HI 0 "hard_reg_operand" "")
+ (match_operand:HI 1 "const_int_operand" ""))
+ (set (match_dup 0) (plus:HI (match_dup 0) (reg:HI SP_REGNUM)))]
+ ""
+ [(set (match_dup 0) (reg:HI SP_REGNUM))
+ (set (match_dup 0) (plus:HI (match_dup 0) (match_dup 1)))]
+ "")
+
+;;
;; This peephole catches the address computations generated by the reload
;; pass.
(define_peephole
[(set (match_operand:HI 0 "hard_reg_operand" "xy")
(match_operand:HI 1 "const_int_operand" ""))
- (parallel [(set (reg:HI 1) (match_dup 0))
- (set (match_dup 0) (reg:HI 1))])
- (set (reg:HI 1)
- (plus (reg:HI 1)
+ (parallel [(set (reg:HI D_REGNUM) (match_dup 0))
+ (set (match_dup 0) (reg:HI D_REGNUM))])
+ (set (reg:HI D_REGNUM)
+ (plus (reg:HI D_REGNUM)
(match_operand:HI 2 "general_operand" "")))
- (parallel [(set (reg:HI 1) (match_dup 0))
- (set (match_dup 0) (reg:HI 1))])]
+ (parallel [(set (reg:HI D_REGNUM) (match_dup 0))
+ (set (match_dup 0) (reg:HI D_REGNUM))])]
"(INTVAL (operands[1]) & 0x0FF) == 0"
"*
{
int value_loaded = 1;
- if (X_REG_P (operands[0]))
+ if (X_REG_P (operands[0]) || SP_REG_P (operands[2]))
{
- output_asm_insn (\"ldx\\t%2\\n\\txgdx\", operands);
+ rtx ops[2];
+
+ ops[0] = operands[0];
+ ops[1] = operands[2];
+ m68hc11_gen_movhi (insn, ops);
+ output_asm_insn (\"xgd%0\", operands);
}
else if (Y_REG_P (operands[0]))
{
@@ -5634,9 +6230,9 @@
;; (set ...) insn.
;;
(define_peephole
- [(set (match_operand:HI 0 "hard_reg_operand" "A") (reg:HI 1))
- (parallel [(set (reg:HI 1) (match_dup 0))
- (set (match_dup 0) (reg:HI 1))])]
+ [(set (match_operand:HI 0 "hard_reg_operand" "A") (reg:HI D_REGNUM))
+ (parallel [(set (reg:HI D_REGNUM) (match_dup 0))
+ (set (match_dup 0) (reg:HI D_REGNUM))])]
"find_regno_note (ins1, REG_DEAD, HARD_D_REGNUM)"
"*
{
@@ -5648,10 +6244,10 @@
;; Same as above but due to some split, there may be a noop set
;; between the two.
(define_peephole
- [(set (match_operand:HI 0 "hard_reg_operand" "A") (reg:HI 1))
+ [(set (match_operand:HI 0 "hard_reg_operand" "A") (reg:HI D_REGNUM))
(set (match_dup 0) (match_dup 0))
- (parallel [(set (reg:HI 1) (match_dup 0))
- (set (match_dup 0) (reg:HI 1))])]
+ (parallel [(set (reg:HI D_REGNUM) (match_dup 0))
+ (set (match_dup 0) (reg:HI D_REGNUM))])]
"find_regno_note (ins1, REG_DEAD, HARD_D_REGNUM)"
"*
{
@@ -5665,9 +6261,9 @@
;; and we must, at least, setup X/Y with value of D.
;;
(define_peephole
- [(set (match_operand:HI 0 "hard_reg_operand" "A") (reg:HI 1))
- (parallel [(set (reg:HI 1) (match_dup 0))
- (set (match_dup 0) (reg:HI 1))])]
+ [(set (match_operand:HI 0 "hard_reg_operand" "A") (reg:HI D_REGNUM))
+ (parallel [(set (reg:HI D_REGNUM) (match_dup 0))
+ (set (match_dup 0) (reg:HI D_REGNUM))])]
""
"*
{
@@ -5685,9 +6281,9 @@
;;; need to emit anything. Otherwise, we just need an copy of D to X/Y.
;;;
(define_peephole
- [(parallel [(set (reg:HI 1) (match_operand:HI 0 "hard_reg_operand" "A"))
- (set (match_dup 0) (reg:HI 1))])
- (set (reg:HI 1) (match_dup 0))]
+ [(parallel [(set (reg:HI D_REGNUM) (match_operand:HI 0 "hard_reg_operand" "A"))
+ (set (match_dup 0) (reg:HI D_REGNUM))])
+ (set (reg:HI D_REGNUM) (match_dup 0))]
"find_regno_note (insn, REG_DEAD, REGNO (operands[0]))"
"*
{
@@ -5701,9 +6297,9 @@
;;; need to emit anything. Otherwise, we just need an copy of D to X/Y.
;;;
(define_peephole
- [(parallel [(set (reg:HI 1) (match_operand:HI 0 "hard_reg_operand" "A"))
- (set (match_dup 0) (reg:HI 1))])
- (set (reg:QI 1) (match_operand:QI 1 "hard_reg_operand" "A"))]
+ [(parallel [(set (reg:HI D_REGNUM) (match_operand:HI 0 "hard_reg_operand" "A"))
+ (set (match_dup 0) (reg:HI D_REGNUM))])
+ (set (reg:QI D_REGNUM) (match_operand:QI 1 "hard_reg_operand" "A"))]
"REGNO (operands[0]) == REGNO (operands[1])
&& find_regno_note (insn, REG_DEAD, REGNO (operands[0]))"
"*
@@ -5718,9 +6314,9 @@
;;; need to emit anything. Otherwise, we just need a copy of D to X/Y.
;;;
(define_peephole
- [(parallel [(set (reg:HI 1) (match_operand:HI 0 "hard_reg_operand" "A"))
- (set (match_dup 0) (reg:HI 1))])
- (set (reg:HI 1) (match_dup 0))]
+ [(parallel [(set (reg:HI D_REGNUM) (match_operand:HI 0 "hard_reg_operand" "A"))
+ (set (match_dup 0) (reg:HI D_REGNUM))])
+ (set (reg:HI D_REGNUM) (match_dup 0))]
""
"*
{
@@ -5738,9 +6334,9 @@
;;; with the xgdx.
;;;
(define_peephole
- [(parallel [(set (reg:HI 1) (match_operand:HI 0 "hard_reg_operand" "A"))
- (set (match_dup 0) (reg:HI 1))])
- (set (reg:QI 1) (match_operand:QI 1 "hard_reg_operand" "A"))]
+ [(parallel [(set (reg:HI D_REGNUM) (match_operand:HI 0 "hard_reg_operand" "A"))
+ (set (match_dup 0) (reg:HI D_REGNUM))])
+ (set (reg:QI D_REGNUM) (match_operand:QI 1 "hard_reg_operand" "A"))]
"REGNO (operands[0]) == REGNO (operands[1])"
"*
{
@@ -5757,10 +6353,10 @@
;;; Catch two consecutive xgdx or xgdy, emit nothing.
;;;
(define_peephole
- [(parallel [(set (reg:HI 1) (match_operand:HI 0 "hard_reg_operand" "A"))
- (set (match_dup 0) (reg:HI 1))])
- (parallel [(set (reg:HI 1) (match_dup 0))
- (set (match_dup 0) (reg:HI 1))])]
+ [(parallel [(set (reg:HI D_REGNUM) (match_operand:HI 0 "hard_reg_operand" "A"))
+ (set (match_dup 0) (reg:HI D_REGNUM))])
+ (parallel [(set (reg:HI D_REGNUM) (match_dup 0))
+ (set (match_dup 0) (reg:HI D_REGNUM))])]
""
"*
{
@@ -5770,44 +6366,6 @@
")
(define_peephole
- [(set (match_operand:HI 0 "stack_register_operand" "")
- (plus:HI (match_dup 0)
- (const_int -2)))
- (set (match_operand:HI 2 "memory_operand" "m")
- (match_operand:HI 3 "stack_register_operand" ""))]
- "0 && GET_CODE (operands[2]) == MEM"
- "*
-{
- rtx ops[2];
-
- ops[0] = gen_rtx (MEM, HImode,
- gen_rtx (PRE_DEC, HImode, stack_pointer_rtx));
- ops[1] = operands[3];
- m68hc11_gen_movhi (insn, ops);
- return \"\";
-}
-")
-
-(define_peephole
- [(set (match_operand:HI 0 "hard_reg_operand" "")
- (match_operand:HI 1 "memory_operand" "m"))
- (set (match_operand:HI 2 "stack_register_operand" "")
- (plus:HI (match_dup 2)
- (const_int 2)))]
- "GET_CODE (operands[1]) == MEM"
- "*
-{
- rtx ops[2];
-
- ops[0] = operands[0];
- ops[1] = gen_rtx (MEM, HImode,
- gen_rtx (POST_INC, HImode, stack_pointer_rtx));
- m68hc11_gen_movhi (insn, ops);
- return \"\";
-}
-")
-
-(define_peephole
[(set (match_operand:HI 0 "hard_reg_operand" "")
(match_operand:HI 1 "stack_register_operand" ""))
(set (match_operand:HI 2 "hard_reg_operand" "")
@@ -5834,7 +6392,7 @@
;;
(define_peephole
[(set (match_operand:HI 0 "hard_reg_operand" "dA") (const_int -1))
- (set (match_dup 0) (plus:HI (match_dup 0) (reg:HI 3)))]
+ (set (match_dup 0) (plus:HI (match_dup 0) (reg:HI SP_REGNUM)))]
"TARGET_M6811"
"*
{
diff --git a/gcc/config/m68hc11/m68hc12.h b/gcc/config/m68hc11/m68hc12.h
index c911c47f879..e36e0f3fc10 100644
--- a/gcc/config/m68hc11/m68hc12.h
+++ b/gcc/config/m68hc11/m68hc12.h
@@ -1,5 +1,5 @@
/* Definitions of target machine for GNU compiler, for m68hc12.
- Copyright (C) 1999, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
Contributed by Stephane Carrez (stcarrez@worldnet.fr).
This file is part of GNU CC.
@@ -32,7 +32,8 @@ Boston, MA 02111-1307, USA. */
"%{mshort:-D__HAVE_SHORT_INT__ -D__INT__=16 -D__INT_MAX__=32767}\
%{!mshort:-D__INT__=32 -D__INT_MAX__=2147483647}\
%{m68hc11:-Dmc6811 -DMC6811 -Dmc68hc11}\
- %{!m68hc11:-Dmc6812 -DMC6812 -Dmc68hc12}"
+ %{!m68hc11:-Dmc6812 -DMC6812 -Dmc68hc12}\
+ %{fshort-double:-D__HAVE_SHORT_DOUBLE__}"
/* Default target_flags if no switches specified. */
#define TARGET_DEFAULT (MASK_M6812)
diff --git a/gcc/config/m68hc11/t-m68hc11-gas b/gcc/config/m68hc11/t-m68hc11-gas
index ec4b59e027b..13ca1902b2c 100644
--- a/gcc/config/m68hc11/t-m68hc11-gas
+++ b/gcc/config/m68hc11/t-m68hc11-gas
@@ -21,10 +21,12 @@ LIB1ASMFUNCS = _mulsi3 \
_mulqi3 _ashlsi3 _ashrsi3 _lshrsi3 \
_divmodhi4 _mulhi3 _mulhi32 \
_memcpy _memset _negsi2 _one_cmplsi2 \
- _regs_min _regs_d1_8 _regs_d8_16 _regs_d17_32 \
+ _regs_min _regs_frame _regs_d1_2 \
+ _regs_d3_4 _regs_d5_6 _regs_d7_8 _regs_d9_16 _regs_d17_32 \
_premain __exit _abort _cleanup \
_adddi3 _subdi3 _notdi2 \
- _ashrhi3 _lshrhi3 _lshlhi3 _ashrqi3 _lshlqi3 _map_data _init_bss
+ _ashrhi3 _lshrhi3 _lshlhi3 _ashrqi3 _lshlqi3 _map_data _init_bss \
+ _ctor _dtor
TARGET_LIBGCC2_CFLAGS = -DUSE_GAS -DIN_GCC
diff --git a/gcc/config/m68k/3b1.h b/gcc/config/m68k/3b1.h
index 739a28b92e0..0dac874744f 100644
--- a/gcc/config/m68k/3b1.h
+++ b/gcc/config/m68k/3b1.h
@@ -64,10 +64,6 @@ Boston, MA 02111-1307, USA. */
#define ASM_FILE_START(FILE) \
output_file_directive ((FILE), main_input_filename)
-/* Don't try to define `gcc_compiled.' since the assembler might not
- accept symbols with periods and GDB doesn't run on this machine anyway. */
-#define ASM_IDENTIFY_GCC(FILE)
-
/* Define __HAVE_68881__ in preprocessor if -m68881 is specified.
This will control the use of inline 68881 insns in certain macros. */
diff --git a/gcc/config/m68k/auxgas.h b/gcc/config/m68k/auxgas.h
index c2e0d567b45..c3c76352f93 100644
--- a/gcc/config/m68k/auxgas.h
+++ b/gcc/config/m68k/auxgas.h
@@ -31,14 +31,6 @@ Boston, MA 02111-1307, USA. */
#define ASM_OUTPUT_IDENT(FILE, NAME) \
fprintf (FILE, "\t.ident \"%s\"\n", NAME);
-#ifdef IDENTIFY_WITH_IDENT
-/* Put the GCC identification somewhere nicer, I think.
- Does the COFF GDB use the "gcc2_complied." symbol anyway? */
-#define ASM_IDENTIFY_GCC(FILE) /* nothing */
-#define ASM_IDENTIFY_LANGUAGE(FILE) \
- fprintf (FILE, "\t.ident \"GCC (%s) %s\"\n", lang_identify(), version_string)
-#endif
-
#ifdef USE_COLLECT2
#undef ASM_OUTPUT_CONSTRUCTOR
#undef ASM_OUTPUT_DESTRUCTOR
diff --git a/gcc/config/m68k/crds.h b/gcc/config/m68k/crds.h
index b3e807843f4..12f0fb797bc 100644
--- a/gcc/config/m68k/crds.h
+++ b/gcc/config/m68k/crds.h
@@ -90,10 +90,6 @@ Boston, MA 02111-1307, USA. */
#define TARGET_MEM_FUNCTIONS
-/* Don't try to define `gcc_compiled.' since the assembler might not
- accept symbols with periods and GDB doesn't run on this machine anyway. */
-#define ASM_IDENTIFY_GCC(FILE)
-
/* Define __HAVE_68881__ in preprocessor if -m68881 is specified.
This will control the use of inline 68881 insns in certain macros. */
diff --git a/gcc/config/m68k/hp320.h b/gcc/config/m68k/hp320.h
index 83140058d2d..64a0e0d2c90 100644
--- a/gcc/config/m68k/hp320.h
+++ b/gcc/config/m68k/hp320.h
@@ -607,10 +607,6 @@ do { register int i; \
{ fprintf ((FILE), "mov"); (PTR) += 4; } \
}
-/* Prevent output of `gcc_compiled.:'. */
-
-#define ASM_IDENTIFY_GCC(FILE)
-
#else /* not HPUX_ASM */
#undef FUNCTION_PROFILER
diff --git a/gcc/config/m68k/linux-aout.h b/gcc/config/m68k/linux-aout.h
index d4e5ec47573..dd07a4e983e 100644
--- a/gcc/config/m68k/linux-aout.h
+++ b/gcc/config/m68k/linux-aout.h
@@ -41,7 +41,8 @@ Boston, MA 02111-1307, USA. */
#endif
#undef SUBTARGET_SWITCHES
-#define SUBTARGET_SWITCHES {"ieee-fp", 0},
+#define SUBTARGET_SWITCHES {"ieee-fp", 0, \
+ N_("Use IEEE math for fp comparisons") },
#undef ASM_SPEC
#define ASM_SPEC \
diff --git a/gcc/config/m68k/linux.h b/gcc/config/m68k/linux.h
index 2dea947a07a..bf420917a1d 100644
--- a/gcc/config/m68k/linux.h
+++ b/gcc/config/m68k/linux.h
@@ -42,7 +42,8 @@ Boston, MA 02111-1307, USA. */
#define STRICT_ALIGNMENT 0
#undef SUBTARGET_SWITCHES
-#define SUBTARGET_SWITCHES {"ieee-fp", 0},
+#define SUBTARGET_SWITCHES {"ieee-fp", 0, \
+ N_("Use IEEE math for fp comparisons")},
/* Here are four prefixes that are used by asm_fprintf to
facilitate customization for alternate assembler syntaxes.
diff --git a/gcc/config/m68k/m68k.c b/gcc/config/m68k/m68k.c
index 430e618e37e..4dd8850f1a4 100644
--- a/gcc/config/m68k/m68k.c
+++ b/gcc/config/m68k/m68k.c
@@ -29,11 +29,12 @@ Boston, MA 02111-1307, USA. */
#include "real.h"
#include "insn-config.h"
#include "conditions.h"
-#include "insn-flags.h"
#include "output.h"
#include "insn-attr.h"
#include "recog.h"
#include "toplev.h"
+#include "expr.h"
+#include "reload.h"
#include "tm_p.h"
/* Needed for use_return_insn. */
@@ -878,7 +879,7 @@ not_sp_operand (op, mode)
register rtx op;
enum machine_mode mode;
{
- return op != stack_pointer_rtx && general_operand (op, mode);
+ return op != stack_pointer_rtx && nonimmediate_operand (op, mode);
}
/* Return TRUE if X is a valid comparison operator for the dbcc
@@ -3334,7 +3335,7 @@ const_uint32_operand (op, mode)
return (GET_CODE (op) == CONST_INT
&& (INTVAL (op) >= 0 && INTVAL (op) <= 0xffffffffL));
#else
- return ((GET_CODE (op) == CONST_INT && INTVAL (op) >= 0)
+ return (GET_CODE (op) == CONST_INT
|| (GET_CODE (op) == CONST_DOUBLE && CONST_DOUBLE_HIGH (op) == 0));
#endif
}
diff --git a/gcc/config/m68k/m68k.h b/gcc/config/m68k/m68k.h
index c20cba1b99d..382edbf5f20 100644
--- a/gcc/config/m68k/m68k.h
+++ b/gcc/config/m68k/m68k.h
@@ -147,63 +147,96 @@ extern int target_flags;
where VALUE is the bits to set or minus the bits to clear.
An empty string NAME is used to identify the default VALUE. */
-#define TARGET_SWITCHES \
- { { "68020", - (MASK_5200|MASK_68060|MASK_68040|MASK_68040_ONLY)}, \
- { "c68020", - (MASK_5200|MASK_68060|MASK_68040|MASK_68040_ONLY)}, \
- { "68020", (MASK_68020|MASK_BITFIELD)}, \
- { "c68020", (MASK_68020|MASK_BITFIELD)}, \
+#define TARGET_SWITCHES \
+ { { "68020", - (MASK_5200|MASK_68060|MASK_68040|MASK_68040_ONLY), \
+ N_("Generate code for a 68020") }, \
+ { "c68020", - (MASK_5200|MASK_68060|MASK_68040|MASK_68040_ONLY), \
+ N_("Generate code for a 68020") }, \
+ { "68020", (MASK_68020|MASK_BITFIELD), "" }, \
+ { "c68020", (MASK_68020|MASK_BITFIELD), "" }, \
{ "68000", - (MASK_5200|MASK_68060|MASK_68040|MASK_68040_ONLY \
- |MASK_68020|MASK_BITFIELD|MASK_68881)}, \
+ |MASK_68020|MASK_BITFIELD|MASK_68881), \
+ N_("Generate code for a 68000") }, \
{ "c68000", - (MASK_5200|MASK_68060|MASK_68040|MASK_68040_ONLY \
- |MASK_68020|MASK_BITFIELD|MASK_68881)}, \
- { "bitfield", MASK_BITFIELD}, \
- { "nobitfield", - MASK_BITFIELD}, \
- { "rtd", MASK_RTD}, \
- { "nortd", - MASK_RTD}, \
- { "short", MASK_SHORT}, \
- { "noshort", - MASK_SHORT}, \
- { "fpa", -(MASK_SKY|MASK_68040_ONLY|MASK_68881)}, \
- { "fpa", MASK_FPA}, \
- { "nofpa", - MASK_FPA}, \
- { "sky", -(MASK_FPA|MASK_68040_ONLY|MASK_68881)}, \
- { "sky", MASK_SKY}, \
- { "nosky", - MASK_SKY}, \
- { "68881", - (MASK_FPA|MASK_SKY)}, \
- { "68881", MASK_68881}, \
- { "soft-float", - (MASK_FPA|MASK_SKY|MASK_68040_ONLY|MASK_68881)}, \
- { "68020-40", -(MASK_5200|MASK_68060|MASK_68040_ONLY)}, \
- { "68020-40", (MASK_BITFIELD|MASK_68881|MASK_68020|MASK_68040)}, \
- { "68020-60", -(MASK_5200|MASK_68040_ONLY)}, \
+ |MASK_68020|MASK_BITFIELD|MASK_68881), \
+ N_("Generate code for a 68000") }, \
+ { "bitfield", MASK_BITFIELD, \
+ N_("Use the bit-field instructions") }, \
+ { "nobitfield", - MASK_BITFIELD, \
+ N_("Do not use the bit-field instructions") }, \
+ { "rtd", MASK_RTD, \
+ N_("Use different calling convention using 'rtd'") }, \
+ { "nortd", - MASK_RTD, \
+ N_("Use normal calling convention") }, \
+ { "short", MASK_SHORT, \
+ N_("Consider type `int' to be 16 bits wide") }, \
+ { "noshort", - MASK_SHORT, \
+ N_("Consider type `int' to be 32 bits wide") }, \
+ { "fpa", -(MASK_SKY|MASK_68040_ONLY|MASK_68881), \
+ N_("Generate code for a Sun FPA") }, \
+ { "fpa", MASK_FPA, "" }, \
+ { "nofpa", - MASK_FPA, \
+ N_("Do not generate code for a Sun FPA") }, \
+ { "sky", -(MASK_FPA|MASK_68040_ONLY|MASK_68881), \
+ N_("") }, \
+ { "sky", MASK_SKY, \
+ N_("") }, \
+ { "nosky", - MASK_SKY, \
+ N_("") }, \
+ { "68881", - (MASK_FPA|MASK_SKY), \
+ N_("Generate code for a 68881") }, \
+ { "68881", MASK_68881, "" }, \
+ { "soft-float", - (MASK_FPA|MASK_SKY|MASK_68040_ONLY|MASK_68881), \
+ N_("Generate code with library calls for floating point") }, \
+ { "68020-40", -(MASK_5200|MASK_68060|MASK_68040_ONLY), \
+ N_("Generate code for a 68040, without any new instructions") }, \
+ { "68020-40", (MASK_BITFIELD|MASK_68881|MASK_68020|MASK_68040), ""},\
+ { "68020-60", -(MASK_5200|MASK_68040_ONLY), \
+ N_("Generate code for a 68060, without any new instructions") }, \
{ "68020-60", (MASK_BITFIELD|MASK_68881|MASK_68020|MASK_68040 \
- |MASK_68060)}, \
- { "68030", - (MASK_5200|MASK_68060|MASK_68040|MASK_68040_ONLY)}, \
- { "68030", (MASK_68020|MASK_BITFIELD)}, \
- { "68040", - (MASK_5200|MASK_68060)}, \
+ |MASK_68060), "" }, \
+ { "68030", - (MASK_5200|MASK_68060|MASK_68040|MASK_68040_ONLY), \
+ N_("Generate code for a 68030") }, \
+ { "68030", (MASK_68020|MASK_BITFIELD), "" }, \
+ { "68040", - (MASK_5200|MASK_68060), \
+ N_("Generate code for a 68040") }, \
{ "68040", (MASK_68020|MASK_68881|MASK_BITFIELD \
- |MASK_68040_ONLY|MASK_68040)}, \
- { "68060", - (MASK_5200|MASK_68040)}, \
+ |MASK_68040_ONLY|MASK_68040), "" }, \
+ { "68060", - (MASK_5200|MASK_68040), \
+ N_("Generate code for a 68060") }, \
{ "68060", (MASK_68020|MASK_68881|MASK_BITFIELD \
- |MASK_68040_ONLY|MASK_68060)}, \
+ |MASK_68040_ONLY|MASK_68060), "" }, \
{ "5200", - (MASK_68060|MASK_68040|MASK_68040_ONLY|MASK_68020 \
- |MASK_BITFIELD|MASK_68881)}, \
- { "5200", (MASK_5200)}, \
- { "68851", 0}, \
- { "no-68851", 0}, \
+ |MASK_BITFIELD|MASK_68881), \
+ N_("Generate code for a 520X") }, \
+ { "5200", (MASK_5200), "" }, \
+ { "68851", 0, \
+ N_("Generate code for a 68851") }, \
+ { "no-68851", 0, \
+ N_("Do no generate code for a 68851") }, \
{ "68302", - (MASK_5200|MASK_68060|MASK_68040|MASK_68040_ONLY \
- |MASK_68020|MASK_BITFIELD|MASK_68881)}, \
+ |MASK_68020|MASK_BITFIELD|MASK_68881), \
+ N_("Generate code for a 68302") }, \
{ "68332", - (MASK_5200|MASK_68060|MASK_68040|MASK_68040_ONLY \
- |MASK_BITFIELD|MASK_68881)}, \
- { "68332", MASK_68020}, \
+ |MASK_BITFIELD|MASK_68881), \
+ N_("Generate code for a 68332") }, \
+ { "68332", MASK_68020, "" }, \
{ "cpu32", - (MASK_5200|MASK_68060|MASK_68040|MASK_68040_ONLY \
- |MASK_BITFIELD|MASK_68881)}, \
- { "cpu32", MASK_68020}, \
- { "align-int", MASK_ALIGN_INT }, \
- { "no-align-int", -MASK_ALIGN_INT }, \
- { "pcrel", MASK_PCREL}, \
- { "strict-align", -MASK_NO_STRICT_ALIGNMENT}, \
- { "no-strict-align", MASK_NO_STRICT_ALIGNMENT}, \
+ |MASK_BITFIELD|MASK_68881), \
+ N_("Generate code for a cpu32") }, \
+ { "cpu32", MASK_68020, "" }, \
+ { "align-int", MASK_ALIGN_INT, \
+ N_("Align variables on a 32-bit boundary") }, \
+ { "no-align-int", -MASK_ALIGN_INT, \
+ N_("Align variables on a 16-bit boundary") }, \
+ { "pcrel", MASK_PCREL, \
+ N_("Generate pc-relative code") }, \
+ { "strict-align", -MASK_NO_STRICT_ALIGNMENT, \
+ N_("Do not use unaligned memory references") }, \
+ { "no-strict-align", MASK_NO_STRICT_ALIGNMENT, \
+ N_("Use unaligned memory references") }, \
SUBTARGET_SWITCHES \
- { "", TARGET_DEFAULT}}
+ { "", TARGET_DEFAULT, "" }}
/* TARGET_DEFAULT is defined in sun*.h and isi.h, etc. */
/* This macro is similar to `TARGET_SWITCHES' but defines names of
@@ -216,9 +249,12 @@ extern int target_flags;
option if the fixed part matches. The actual option name is made
by appending `-m' to the specified name. */
#define TARGET_OPTIONS \
-{ { "align-loops=", &m68k_align_loops_string }, \
- { "align-jumps=", &m68k_align_jumps_string }, \
- { "align-functions=", &m68k_align_funcs_string }, \
+{ { "align-loops=", &m68k_align_loops_string, \
+ N_("Loop code aligned to this power of 2") }, \
+ { "align-jumps=", &m68k_align_jumps_string, \
+ N_("Jump targets are aligned to this power of 2") }, \
+ { "align-functions=", &m68k_align_funcs_string, \
+ N_("Function starts are aligned to this power of 2") }, \
SUBTARGET_OPTIONS \
}
diff --git a/gcc/config/m68k/m68k.md b/gcc/config/m68k/m68k.md
index 75c552535c9..2f4af6cde99 100644
--- a/gcc/config/m68k/m68k.md
+++ b/gcc/config/m68k/m68k.md
@@ -885,7 +885,7 @@
;This is never used.
;(define_insn "swapsi"
-; [(set (match_operand:SI 0 "general_operand" "+r")
+; [(set (match_operand:SI 0 "nonimmediate_operand" "+r")
; (match_operand:SI 1 "general_operand" "+r"))
; (set (match_dup 1) (match_dup 0))]
; ""
@@ -896,7 +896,7 @@
;; into a data reg with moveq in order to store it elsewhere.
(define_insn "movsi_const0"
- [(set (match_operand:SI 0 "general_operand" "=g")
+ [(set (match_operand:SI 0 "nonimmediate_operand" "=g")
(const_int 0))]
;; clr insns on 68000 read before writing.
;; This isn't so on the 68010, but we have no TARGET_68010.
@@ -943,7 +943,7 @@
;; In both the PIC and non-PIC cases the patterns generated will
;; matched by the next define_insn.
(define_expand "movsi"
- [(set (match_operand:SI 0 "general_operand" "")
+ [(set (match_operand:SI 0 "nonimmediate_operand" "")
(match_operand:SI 1 "general_operand" ""))]
""
"
@@ -977,7 +977,7 @@
;; Notes: make sure no alternative allows g vs g.
;; We don't allow f-regs since fixed point cannot go in them.
;; We do allow y and x regs since fixed point is allowed in them.
- [(set (match_operand:SI 0 "general_operand" "=g,d,a<,y,!*x*r*m")
+ [(set (match_operand:SI 0 "nonimmediate_operand" "=g,d,a<,y,!*x*r*m")
(match_operand:SI 1 "general_src_operand" "daymSKT,n,i,g,*x*r*m"))]
"!TARGET_5200"
@@ -991,7 +991,7 @@
}")
(define_insn ""
- [(set (match_operand:SI 0 "general_operand" "=r<Q>,g")
+ [(set (match_operand:SI 0 "nonimmediate_operand" "=r<Q>,g")
(match_operand:SI 1 "general_operand" "g,r<Q>"))]
"TARGET_5200"
"* return output_move_simode (operands);")
@@ -999,7 +999,7 @@
;; Special case of fullword move, where we need to get a non-GOT PIC
;; reference into an address register.
(define_insn ""
- [(set (match_operand:SI 0 "general_operand" "=a<")
+ [(set (match_operand:SI 0 "nonimmediate_operand" "=a<")
(match_operand:SI 1 "pcrel_address" ""))]
"TARGET_PCREL"
"*
@@ -1010,87 +1010,87 @@
}")
(define_expand "movhi"
- [(set (match_operand:HI 0 "general_operand" "")
+ [(set (match_operand:HI 0 "nonimmediate_operand" "")
(match_operand:HI 1 "general_operand" ""))]
""
"")
(define_insn ""
- [(set (match_operand:HI 0 "general_operand" "=g")
+ [(set (match_operand:HI 0 "nonimmediate_operand" "=g")
(match_operand:HI 1 "general_src_operand" "gS"))]
"!TARGET_5200"
"* return output_move_himode (operands);")
(define_insn ""
- [(set (match_operand:HI 0 "general_operand" "=r<Q>,g")
+ [(set (match_operand:HI 0 "nonimmediate_operand" "=r<Q>,g")
(match_operand:HI 1 "general_operand" "g,r<Q>"))]
"TARGET_5200"
"* return output_move_himode (operands);")
(define_expand "movstricthi"
- [(set (strict_low_part (match_operand:HI 0 "general_operand" ""))
+ [(set (strict_low_part (match_operand:HI 0 "nonimmediate_operand" ""))
(match_operand:HI 1 "general_src_operand" ""))]
""
"")
(define_insn ""
- [(set (strict_low_part (match_operand:HI 0 "general_operand" "+dm"))
+ [(set (strict_low_part (match_operand:HI 0 "nonimmediate_operand" "+dm"))
(match_operand:HI 1 "general_src_operand" "rmSn"))]
"!TARGET_5200"
"* return output_move_stricthi (operands);")
(define_insn ""
- [(set (strict_low_part (match_operand:HI 0 "general_operand" "+d,m"))
+ [(set (strict_low_part (match_operand:HI 0 "nonimmediate_operand" "+d,m"))
(match_operand:HI 1 "general_src_operand" "rmn,r"))]
"TARGET_5200"
"* return output_move_stricthi (operands);")
(define_expand "movqi"
- [(set (match_operand:QI 0 "general_operand" "")
+ [(set (match_operand:QI 0 "nonimmediate_operand" "")
(match_operand:QI 1 "general_src_operand" ""))]
""
"")
(define_insn ""
- [(set (match_operand:QI 0 "general_operand" "=d,*a,m")
+ [(set (match_operand:QI 0 "nonimmediate_operand" "=d,*a,m")
(match_operand:QI 1 "general_src_operand" "dmSi*a,di*a,dmSi"))]
"!TARGET_5200"
"* return output_move_qimode (operands);")
(define_insn ""
- [(set (match_operand:QI 0 "general_operand" "=d<Q>,dm,d*a")
+ [(set (match_operand:QI 0 "nonimmediate_operand" "=d<Q>,dm,d*a")
(match_operand:QI 1 "general_src_operand" "dmi,d<Q>,di*a"))]
"TARGET_5200"
"* return output_move_qimode (operands);")
(define_expand "movstrictqi"
- [(set (strict_low_part (match_operand:QI 0 "general_operand" ""))
+ [(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" ""))
(match_operand:QI 1 "general_src_operand" ""))]
""
"")
(define_insn ""
- [(set (strict_low_part (match_operand:QI 0 "general_operand" "+dm"))
+ [(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+dm"))
(match_operand:QI 1 "general_src_operand" "dmSn"))]
"!TARGET_5200"
"* return output_move_strictqi (operands);")
(define_insn ""
- [(set (strict_low_part (match_operand:QI 0 "general_operand" "+d,m"))
+ [(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+d,m"))
(match_operand:QI 1 "general_src_operand" "dmn,d"))]
"TARGET_5200"
"* return output_move_strictqi (operands);")
(define_expand "movsf"
- [(set (match_operand:SF 0 "general_operand" "")
+ [(set (match_operand:SF 0 "nonimmediate_operand" "")
(match_operand:SF 1 "general_operand" ""))]
""
"")
(define_insn ""
- [(set (match_operand:SF 0 "general_operand" "=rmf,x,y,rm,!x,!rm")
+ [(set (match_operand:SF 0 "nonimmediate_operand" "=rmf,x,y,rm,!x,!rm")
(match_operand:SF 1 "general_operand" "rmfF,xH,rmF,y,rm,x"))]
-; [(set (match_operand:SF 0 "general_operand" "=rmf")
+; [(set (match_operand:SF 0 "nonimmediate_operand" "=rmf")
; (match_operand:SF 1 "general_operand" "rmfF"))]
"!TARGET_5200"
"*
@@ -1170,23 +1170,23 @@
}")
(define_insn ""
- [(set (match_operand:SF 0 "general_operand" "=r,g")
+ [(set (match_operand:SF 0 "nonimmediate_operand" "=r,g")
(match_operand:SF 1 "general_operand" "g,r"))]
"TARGET_5200"
"* return \"move%.l %1,%0\";")
(define_expand "movdf"
- [(set (match_operand:DF 0 "general_operand" "")
+ [(set (match_operand:DF 0 "nonimmediate_operand" "")
(match_operand:DF 1 "general_operand" ""))]
""
"")
(define_insn ""
- [(set (match_operand:DF 0 "general_operand"
+ [(set (match_operand:DF 0 "nonimmediate_operand"
"=*rm,*rf,*rf,&*rof<>,y,*rm,x,!x,!*rm")
(match_operand:DF 1 "general_operand"
"*rf,m,0,*rofE<>,*rmE,y,xH,*rm,x"))]
-; [(set (match_operand:DF 0 "general_operand" "=rm,&rf,&rof<>")
+; [(set (match_operand:DF 0 "nonimmediate_operand" "=rm,&rf,&rof<>")
; (match_operand:DF 1 "general_operand" "rf,m,rofF<>"))]
"!TARGET_5200"
"*
@@ -1239,7 +1239,7 @@
}")
(define_insn ""
- [(set (match_operand:DF 0 "general_operand" "=r,g")
+ [(set (match_operand:DF 0 "nonimmediate_operand" "=r,g")
(match_operand:DF 1 "general_operand" "g,r"))]
"TARGET_5200"
"* return output_move_double (operands);")
@@ -1359,7 +1359,7 @@
(define_expand "movdi"
;; Let's see if it really still needs to handle fp regs, and, if so, why.
- [(set (match_operand:DI 0 "general_operand" "")
+ [(set (match_operand:DI 0 "nonimmediate_operand" "")
(match_operand:DI 1 "general_operand" ""))]
""
"")
@@ -1367,11 +1367,11 @@
;; movdi can apply to fp regs in some cases
(define_insn ""
;; Let's see if it really still needs to handle fp regs, and, if so, why.
- [(set (match_operand:DI 0 "general_operand" "=rm,r,&ro<>,y,rm,!*x,!rm")
+ [(set (match_operand:DI 0 "nonimmediate_operand" "=rm,r,&ro<>,y,rm,!*x,!rm")
(match_operand:DI 1 "general_operand" "rF,m,roi<>F,rmiF,y,rmF,*x"))]
-; [(set (match_operand:DI 0 "general_operand" "=rm,&r,&ro<>,!&rm,!&f,y,rm,x,!x,!rm")
+; [(set (match_operand:DI 0 "nonimmediate_operand" "=rm,&r,&ro<>,!&rm,!&f,y,rm,x,!x,!rm")
; (match_operand:DI 1 "general_operand" "r,m,roi<>,fF,rfmF,rmi,y,rm,x"))]
-; [(set (match_operand:DI 0 "general_operand" "=rm,&rf,&ro<>,!&rm,!&f")
+; [(set (match_operand:DI 0 "nonimmediate_operand" "=rm,&rf,&ro<>,!&rm,!&f")
; (match_operand:DI 1 "general_operand" "r,m,roi<>,fF,rfF"))]
"!TARGET_5200"
"*
@@ -1411,7 +1411,7 @@
}")
(define_insn ""
- [(set (match_operand:DI 0 "general_operand" "=r,g")
+ [(set (match_operand:DI 0 "nonimmediate_operand" "=r,g")
(match_operand:DI 1 "general_operand" "g,r"))]
"TARGET_5200"
"* return output_move_double (operands);")
@@ -1429,7 +1429,7 @@
;; truncation instructions
(define_insn "truncsiqi2"
- [(set (match_operand:QI 0 "general_operand" "=dm,d")
+ [(set (match_operand:QI 0 "nonimmediate_operand" "=dm,d")
(truncate:QI
(match_operand:SI 1 "general_src_operand" "doJS,i")))]
""
@@ -1448,7 +1448,7 @@
}")
(define_insn "trunchiqi2"
- [(set (match_operand:QI 0 "general_operand" "=dm,d")
+ [(set (match_operand:QI 0 "nonimmediate_operand" "=dm,d")
(truncate:QI
(match_operand:HI 1 "general_src_operand" "doJS,i")))]
""
@@ -1476,7 +1476,7 @@
}")
(define_insn "truncsihi2"
- [(set (match_operand:HI 0 "general_operand" "=dm,d")
+ [(set (match_operand:HI 0 "nonimmediate_operand" "=dm,d")
(truncate:HI
(match_operand:SI 1 "general_src_operand" "roJS,i")))]
""
@@ -1497,7 +1497,7 @@
;; zero extension instructions
(define_insn "zero_extendqidi2"
- [(set (match_operand:DI 0 "general_operand" "=&d")
+ [(set (match_operand:DI 0 "nonimmediate_operand" "=&d")
(zero_extend:DI (match_operand:QI 1 "general_operand" "dm")))]
""
"*
@@ -1508,7 +1508,7 @@
}")
(define_insn "zero_extendhidi2"
- [(set (match_operand:DI 0 "general_operand" "=&d")
+ [(set (match_operand:DI 0 "nonimmediate_operand" "=&d")
(zero_extend:DI (match_operand:HI 1 "general_operand" "rm")))]
""
"*
@@ -1520,7 +1520,7 @@
;; this is the canonical form for (lshiftrt:DI x 32)
(define_insn "zero_extendsidi2"
- [(set (match_operand:DI 0 "general_operand" "=rm")
+ [(set (match_operand:DI 0 "nonimmediate_operand" "=rm")
(zero_extend:DI (match_operand:SI 1 "general_operand" "rm")))]
""
"*
@@ -1597,7 +1597,7 @@
;; of this case will result in worse code than the uncombined patterns.
(define_insn ""
- [(set (match_operand:SI 0 "general_operand" "=do<>,d<")
+ [(set (match_operand:SI 0 "nonimmediate_operand" "=do<>,d<")
(zero_extend:SI (match_operand:HI 1 "nonimmediate_src_operand" "r,mS")))]
"GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM"
"*
@@ -1626,7 +1626,7 @@
}")
(define_insn ""
- [(set (match_operand:HI 0 "general_operand" "=do<>,d")
+ [(set (match_operand:HI 0 "nonimmediate_operand" "=do<>,d")
(zero_extend:HI (match_operand:QI 1 "nonimmediate_src_operand" "d,mS")))]
"GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM"
"*
@@ -1667,7 +1667,7 @@
}")
(define_insn ""
- [(set (match_operand:SI 0 "general_operand" "=do<>,d")
+ [(set (match_operand:SI 0 "nonimmediate_operand" "=do<>,d")
(zero_extend:SI (match_operand:QI 1 "nonimmediate_src_operand" "d,mS")))]
"GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM"
"*
@@ -1720,7 +1720,7 @@
;; sign extension instructions
(define_insn "extendqidi2"
- [(set (match_operand:DI 0 "general_operand" "=d")
+ [(set (match_operand:DI 0 "nonimmediate_operand" "=d")
(sign_extend:DI (match_operand:QI 1 "general_src_operand" "rmS")))]
""
"*
@@ -1734,7 +1734,7 @@
}")
(define_insn "extendhidi2"
- [(set (match_operand:DI 0 "general_operand" "=d")
+ [(set (match_operand:DI 0 "nonimmediate_operand" "=d")
(sign_extend:DI
(match_operand:HI 1 "general_src_operand" "rmS")))]
""
@@ -1749,7 +1749,7 @@
}")
(define_insn "extendsidi2"
- [(set (match_operand:DI 0 "general_operand" "=d")
+ [(set (match_operand:DI 0 "nonimmediate_operand" "=d")
(sign_extend:DI
(match_operand:SI 1 "general_operand" "rm")))]
""
@@ -1796,7 +1796,7 @@
}")
(define_insn "extendhisi2"
- [(set (match_operand:SI 0 "general_operand" "=*d,a")
+ [(set (match_operand:SI 0 "nonimmediate_operand" "=*d,a")
(sign_extend:SI
(match_operand:HI 1 "nonimmediate_src_operand" "0,rmS")))]
""
@@ -1808,13 +1808,13 @@
}")
(define_insn "extendqihi2"
- [(set (match_operand:HI 0 "general_operand" "=d")
+ [(set (match_operand:HI 0 "nonimmediate_operand" "=d")
(sign_extend:HI (match_operand:QI 1 "nonimmediate_operand" "0")))]
""
"ext%.w %0")
(define_insn "extendqisi2"
- [(set (match_operand:SI 0 "general_operand" "=d")
+ [(set (match_operand:SI 0 "nonimmediate_operand" "=d")
(sign_extend:SI (match_operand:QI 1 "nonimmediate_operand" "0")))]
"TARGET_68020 || TARGET_5200"
"extb%.l %0")
@@ -1822,21 +1822,21 @@
;; Conversions between float and double.
(define_expand "extendsfdf2"
- [(set (match_operand:DF 0 "general_operand" "")
+ [(set (match_operand:DF 0 "nonimmediate_operand" "")
(float_extend:DF
(match_operand:SF 1 "general_operand" "")))]
"TARGET_68881 || TARGET_FPA"
"")
(define_insn ""
- [(set (match_operand:DF 0 "general_operand" "=x,y")
+ [(set (match_operand:DF 0 "nonimmediate_operand" "=x,y")
(float_extend:DF
(match_operand:SF 1 "general_operand" "xH,rmF")))]
"TARGET_FPA"
"fpstod %w1,%0")
(define_insn ""
- [(set (match_operand:DF 0 "general_operand" "=*fdm,f")
+ [(set (match_operand:DF 0 "nonimmediate_operand" "=*fdm,f")
(float_extend:DF
(match_operand:SF 1 "general_operand" "f,dmF")))]
"TARGET_68881"
@@ -1869,14 +1869,14 @@
;; sure of truncating in that case.
;; But on the Sun FPA, we can be sure.
(define_expand "truncdfsf2"
- [(set (match_operand:SF 0 "general_operand" "")
+ [(set (match_operand:SF 0 "nonimmediate_operand" "")
(float_truncate:SF
(match_operand:DF 1 "general_operand" "")))]
"TARGET_68881 || TARGET_FPA"
"")
(define_insn ""
- [(set (match_operand:SF 0 "general_operand" "=x,y")
+ [(set (match_operand:SF 0 "nonimmediate_operand" "=x,y")
(float_truncate:SF
(match_operand:DF 1 "general_operand" "xH,rmF")))]
"TARGET_FPA"
@@ -1884,7 +1884,7 @@
;; On the '040 we can truncate in a register accurately and easily.
(define_insn ""
- [(set (match_operand:SF 0 "general_operand" "=f")
+ [(set (match_operand:SF 0 "nonimmediate_operand" "=f")
(float_truncate:SF
(match_operand:DF 1 "general_operand" "fmG")))]
"TARGET_68040_ONLY"
@@ -1896,7 +1896,7 @@
}")
(define_insn ""
- [(set (match_operand:SF 0 "general_operand" "=dm")
+ [(set (match_operand:SF 0 "nonimmediate_operand" "=dm")
(float_truncate:SF
(match_operand:DF 1 "general_operand" "f")))]
"TARGET_68881"
@@ -1911,61 +1911,61 @@
;; rather than as QImode or HImode.
(define_expand "floatsisf2"
- [(set (match_operand:SF 0 "general_operand" "")
+ [(set (match_operand:SF 0 "nonimmediate_operand" "")
(float:SF (match_operand:SI 1 "general_operand" "")))]
"TARGET_68881 || TARGET_FPA"
"")
(define_insn ""
- [(set (match_operand:SF 0 "general_operand" "=y,x")
+ [(set (match_operand:SF 0 "nonimmediate_operand" "=y,x")
(float:SF (match_operand:SI 1 "general_operand" "rmi,x")))]
"TARGET_FPA"
"fpltos %1,%0")
(define_insn ""
- [(set (match_operand:SF 0 "general_operand" "=f")
+ [(set (match_operand:SF 0 "nonimmediate_operand" "=f")
(float:SF (match_operand:SI 1 "general_operand" "dmi")))]
"TARGET_68881"
"f%$move%.l %1,%0")
(define_expand "floatsidf2"
- [(set (match_operand:DF 0 "general_operand" "")
+ [(set (match_operand:DF 0 "nonimmediate_operand" "")
(float:DF (match_operand:SI 1 "general_operand" "")))]
"TARGET_68881 || TARGET_FPA"
"")
(define_insn ""
- [(set (match_operand:DF 0 "general_operand" "=y,x")
+ [(set (match_operand:DF 0 "nonimmediate_operand" "=y,x")
(float:DF (match_operand:SI 1 "general_operand" "rmi,x")))]
"TARGET_FPA"
"fpltod %1,%0")
(define_insn ""
- [(set (match_operand:DF 0 "general_operand" "=f")
+ [(set (match_operand:DF 0 "nonimmediate_operand" "=f")
(float:DF (match_operand:SI 1 "general_operand" "dmi")))]
"TARGET_68881"
"f%&move%.l %1,%0")
(define_insn "floathisf2"
- [(set (match_operand:SF 0 "general_operand" "=f")
+ [(set (match_operand:SF 0 "nonimmediate_operand" "=f")
(float:SF (match_operand:HI 1 "general_operand" "dmn")))]
"TARGET_68881"
"f%$move%.w %1,%0")
(define_insn "floathidf2"
- [(set (match_operand:DF 0 "general_operand" "=f")
+ [(set (match_operand:DF 0 "nonimmediate_operand" "=f")
(float:DF (match_operand:HI 1 "general_operand" "dmn")))]
"TARGET_68881"
"fmove%.w %1,%0")
(define_insn "floatqisf2"
- [(set (match_operand:SF 0 "general_operand" "=f")
+ [(set (match_operand:SF 0 "nonimmediate_operand" "=f")
(float:SF (match_operand:QI 1 "general_operand" "dmn")))]
"TARGET_68881"
"fmove%.b %1,%0")
(define_insn "floatqidf2"
- [(set (match_operand:DF 0 "general_operand" "=f")
+ [(set (match_operand:DF 0 "nonimmediate_operand" "=f")
(float:DF (match_operand:QI 1 "general_operand" "dmn")))]
"TARGET_68881"
"f%&move%.b %1,%0")
@@ -1976,7 +1976,7 @@
;; than calling the subroutines fixsfsi or fixdfsi.
(define_insn "fix_truncdfsi2"
- [(set (match_operand:SI 0 "general_operand" "=dm")
+ [(set (match_operand:SI 0 "nonimmediate_operand" "=dm")
(fix:SI (fix:DF (match_operand:DF 1 "register_operand" "f"))))
(clobber (match_scratch:SI 2 "=d"))
(clobber (match_scratch:SI 3 "=d"))]
@@ -1988,7 +1988,7 @@
}")
(define_insn "fix_truncdfhi2"
- [(set (match_operand:HI 0 "general_operand" "=dm")
+ [(set (match_operand:HI 0 "nonimmediate_operand" "=dm")
(fix:HI (fix:DF (match_operand:DF 1 "register_operand" "f"))))
(clobber (match_scratch:SI 2 "=d"))
(clobber (match_scratch:SI 3 "=d"))]
@@ -2000,7 +2000,7 @@
}")
(define_insn "fix_truncdfqi2"
- [(set (match_operand:QI 0 "general_operand" "=dm")
+ [(set (match_operand:QI 0 "nonimmediate_operand" "=dm")
(fix:QI (fix:DF (match_operand:DF 1 "register_operand" "f"))))
(clobber (match_scratch:SI 2 "=d"))
(clobber (match_scratch:SI 3 "=d"))]
@@ -2015,7 +2015,7 @@
;; This is the first stage of converting it to an integer type.
(define_insn "ftruncdf2"
- [(set (match_operand:DF 0 "general_operand" "=f")
+ [(set (match_operand:DF 0 "nonimmediate_operand" "=f")
(fix:DF (match_operand:DF 1 "general_operand" "fFm")))]
"TARGET_68881 && !TARGET_68040"
"*
@@ -2026,7 +2026,7 @@
}")
(define_insn "ftruncsf2"
- [(set (match_operand:SF 0 "general_operand" "=f")
+ [(set (match_operand:SF 0 "nonimmediate_operand" "=f")
(fix:SF (match_operand:SF 1 "general_operand" "dfFm")))]
"TARGET_68881 && !TARGET_68040"
"*
@@ -2039,37 +2039,37 @@
;; Convert a float whose value is an integer
;; to an actual integer. Second stage of converting float to integer type.
(define_insn "fixsfqi2"
- [(set (match_operand:QI 0 "general_operand" "=dm")
+ [(set (match_operand:QI 0 "nonimmediate_operand" "=dm")
(fix:QI (match_operand:SF 1 "general_operand" "f")))]
"TARGET_68881"
"fmove%.b %1,%0")
(define_insn "fixsfhi2"
- [(set (match_operand:HI 0 "general_operand" "=dm")
+ [(set (match_operand:HI 0 "nonimmediate_operand" "=dm")
(fix:HI (match_operand:SF 1 "general_operand" "f")))]
"TARGET_68881"
"fmove%.w %1,%0")
(define_insn "fixsfsi2"
- [(set (match_operand:SI 0 "general_operand" "=dm")
+ [(set (match_operand:SI 0 "nonimmediate_operand" "=dm")
(fix:SI (match_operand:SF 1 "general_operand" "f")))]
"TARGET_68881"
"fmove%.l %1,%0")
(define_insn "fixdfqi2"
- [(set (match_operand:QI 0 "general_operand" "=dm")
+ [(set (match_operand:QI 0 "nonimmediate_operand" "=dm")
(fix:QI (match_operand:DF 1 "general_operand" "f")))]
"TARGET_68881"
"fmove%.b %1,%0")
(define_insn "fixdfhi2"
- [(set (match_operand:HI 0 "general_operand" "=dm")
+ [(set (match_operand:HI 0 "nonimmediate_operand" "=dm")
(fix:HI (match_operand:DF 1 "general_operand" "f")))]
"TARGET_68881"
"fmove%.w %1,%0")
(define_insn "fixdfsi2"
- [(set (match_operand:SI 0 "general_operand" "=dm")
+ [(set (match_operand:SI 0 "nonimmediate_operand" "=dm")
(fix:SI (match_operand:DF 1 "general_operand" "f")))]
"TARGET_68881"
"fmove%.l %1,%0")
@@ -2078,13 +2078,13 @@
;; On the Sun FPA, this is done in one step.
(define_insn ""
- [(set (match_operand:SI 0 "general_operand" "=x,y")
+ [(set (match_operand:SI 0 "nonimmediate_operand" "=x,y")
(fix:SI (fix:SF (match_operand:SF 1 "general_operand" "xH,rmF"))))]
"TARGET_FPA"
"fpstol %w1,%0")
(define_insn ""
- [(set (match_operand:SI 0 "general_operand" "=x,y")
+ [(set (match_operand:SI 0 "nonimmediate_operand" "=x,y")
(fix:SI (fix:DF (match_operand:DF 1 "general_operand" "xH,rmF"))))]
"TARGET_FPA"
"fpdtol %y1,%0")
@@ -2092,7 +2092,7 @@
;; add instructions
(define_insn "adddi_lshrdi_63"
- [(set (match_operand:DI 0 "general_operand" "=d")
+ [(set (match_operand:DI 0 "nonimmediate_operand" "=d")
(plus:DI (lshiftrt:DI (match_operand:DI 1 "general_operand" "rm")
(const_int 63))
(match_dup 1)))
@@ -2126,7 +2126,7 @@
}")
(define_insn "adddi_sexthishl32"
- [(set (match_operand:DI 0 "general_operand" "=o,a,*d,*d")
+ [(set (match_operand:DI 0 "nonimmediate_operand" "=o,a,*d,*d")
(plus:DI (ashift:DI (sign_extend:DI
(match_operand:HI 1 "general_operand" "rm,rm,rm,rm"))
(const_int 32))
@@ -2145,7 +2145,7 @@
} ")
(define_insn "adddi_dilshr32"
- [(set (match_operand:DI 0 "general_operand" "=d,o")
+ [(set (match_operand:DI 0 "nonimmediate_operand" "=d,o")
;; (plus:DI (match_operand:DI 2 "general_operand" "%0")
;; (lshiftrt:DI (match_operand:DI 1 "general_operand" "ro")
;; (const_int 32))))]
@@ -2164,7 +2164,7 @@
} ")
(define_insn "adddi_dishl32"
- [(set (match_operand:DI 0 "general_operand" "=r,o")
+ [(set (match_operand:DI 0 "nonimmediate_operand" "=r,o")
;; (plus:DI (match_operand:DI 2 "general_operand" "%0")
;; (ashift:DI (match_operand:DI 1 "general_operand" "ro")
;; (const_int 32))))]
@@ -2183,7 +2183,7 @@
} ")
(define_insn "adddi3"
- [(set (match_operand:DI 0 "general_operand" "=<,o<>,d,d,d")
+ [(set (match_operand:DI 0 "nonimmediate_operand" "=<,o<>,d,d,d")
(plus:DI (match_operand:DI 1 "general_operand" "%0,0,0,0,0")
(match_operand:DI 2 "general_operand" "<,d,no>,d,a")))
(clobber (match_scratch:SI 3 "=X,&d,&d,X,&d"))]
@@ -2275,7 +2275,7 @@
} ")
(define_insn "addsi_lshrsi_31"
- [(set (match_operand:SI 0 "general_operand" "=dm")
+ [(set (match_operand:SI 0 "nonimmediate_operand" "=dm")
(plus:SI (lshiftrt:SI (match_operand:SI 1 "general_operand" "rm")
(const_int 31))
(match_dup 1)))]
@@ -2308,7 +2308,7 @@
}")
(define_expand "addsi3"
- [(set (match_operand:SI 0 "general_operand" "")
+ [(set (match_operand:SI 0 "nonimmediate_operand" "")
(plus:SI (match_operand:SI 1 "general_operand" "")
(match_operand:SI 2 "general_src_operand" "")))]
""
@@ -2319,7 +2319,7 @@
;; This is needed since they are not themselves reloaded,
;; so commutativity won't apply to them.
(define_insn "*addsi3_internal"
- [(set (match_operand:SI 0 "general_operand" "=m,?a,?a,d,a")
+ [(set (match_operand:SI 0 "nonimmediate_operand" "=m,?a,?a,d,a")
(plus:SI (match_operand:SI 1 "general_operand" "%0,a,rJK,0,0")
(match_operand:SI 2 "general_src_operand" "dIKLT,rJK,a,mSrIKLT,mSrIKLs")))]
@@ -2328,14 +2328,14 @@
"* return output_addsi3 (operands);")
(define_insn "*addsi3_5200"
- [(set (match_operand:SI 0 "general_operand" "=m,?a,?a,r")
+ [(set (match_operand:SI 0 "nonimmediate_operand" "=m,?a,?a,r")
(plus:SI (match_operand:SI 1 "general_operand" "%0,a,rJK,0")
(match_operand:SI 2 "general_src_operand" "d,rJK,a,mrIKLs")))]
"TARGET_5200"
"* return output_addsi3 (operands);")
(define_insn ""
- [(set (match_operand:SI 0 "general_operand" "=a")
+ [(set (match_operand:SI 0 "nonimmediate_operand" "=a")
(plus:SI (match_operand:SI 1 "general_operand" "0")
(sign_extend:SI
(match_operand:HI 2 "nonimmediate_src_operand" "rmS"))))]
@@ -2343,7 +2343,7 @@
"add%.w %2,%0")
(define_insn "addhi3"
- [(set (match_operand:HI 0 "general_operand" "=m,r")
+ [(set (match_operand:HI 0 "nonimmediate_operand" "=m,r")
(plus:HI (match_operand:HI 1 "general_operand" "%0,0")
(match_operand:HI 2 "general_src_operand" "dn,rmSn")))]
"!TARGET_5200"
@@ -2405,7 +2405,7 @@
;; operand in both positions.
(define_insn ""
- [(set (strict_low_part (match_operand:HI 0 "general_operand" "+m,d"))
+ [(set (strict_low_part (match_operand:HI 0 "nonimmediate_operand" "+m,d"))
(plus:HI (match_dup 0)
(match_operand:HI 1 "general_src_operand" "dn,rmSn")))]
"!TARGET_5200"
@@ -2461,7 +2461,7 @@
}")
(define_insn ""
- [(set (strict_low_part (match_operand:HI 0 "general_operand" "+m,d"))
+ [(set (strict_low_part (match_operand:HI 0 "nonimmediate_operand" "+m,d"))
(plus:HI (match_operand:HI 1 "general_src_operand" "dn,rmSn")
(match_dup 0)))]
"!TARGET_5200"
@@ -2517,7 +2517,7 @@
}")
(define_insn "addqi3"
- [(set (match_operand:QI 0 "general_operand" "=m,d")
+ [(set (match_operand:QI 0 "nonimmediate_operand" "=m,d")
(plus:QI (match_operand:QI 1 "general_operand" "%0,0")
(match_operand:QI 2 "general_src_operand" "dn,dmSn")))]
"!TARGET_5200"
@@ -2543,7 +2543,7 @@
}")
(define_insn ""
- [(set (strict_low_part (match_operand:QI 0 "general_operand" "+m,d"))
+ [(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+m,d"))
(plus:QI (match_dup 0)
(match_operand:QI 1 "general_src_operand" "dn,dmSn")))]
"!TARGET_5200"
@@ -2569,7 +2569,7 @@
}")
(define_insn ""
- [(set (strict_low_part (match_operand:QI 0 "general_operand" "+m,d"))
+ [(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+m,d"))
(plus:QI (match_operand:QI 1 "general_src_operand" "dn,dmSn")
(match_dup 0)))]
"!TARGET_5200"
@@ -2595,14 +2595,14 @@
}")
(define_expand "adddf3"
- [(set (match_operand:DF 0 "general_operand" "")
+ [(set (match_operand:DF 0 "nonimmediate_operand" "")
(plus:DF (match_operand:DF 1 "general_operand" "")
(match_operand:DF 2 "general_operand" "")))]
"TARGET_68881 || TARGET_FPA"
"")
(define_insn ""
- [(set (match_operand:DF 0 "general_operand" "=x,y")
+ [(set (match_operand:DF 0 "nonimmediate_operand" "=x,y")
(plus:DF (match_operand:DF 1 "general_operand" "%xH,y")
(match_operand:DF 2 "general_operand" "xH,dmF")))]
"TARGET_FPA"
@@ -2618,28 +2618,28 @@
}")
(define_insn ""
- [(set (match_operand:DF 0 "general_operand" "=f")
+ [(set (match_operand:DF 0 "nonimmediate_operand" "=f")
(plus:DF (float:DF (match_operand:SI 2 "general_operand" "dmi"))
(match_operand:DF 1 "general_operand" "0")))]
"TARGET_68881"
"f%&add%.l %2,%0")
(define_insn ""
- [(set (match_operand:DF 0 "general_operand" "=f")
+ [(set (match_operand:DF 0 "nonimmediate_operand" "=f")
(plus:DF (float:DF (match_operand:HI 2 "general_operand" "dmn"))
(match_operand:DF 1 "general_operand" "0")))]
"TARGET_68881"
"f%&add%.w %2,%0")
(define_insn ""
- [(set (match_operand:DF 0 "general_operand" "=f")
+ [(set (match_operand:DF 0 "nonimmediate_operand" "=f")
(plus:DF (float:DF (match_operand:QI 2 "general_operand" "dmn"))
(match_operand:DF 1 "general_operand" "0")))]
"TARGET_68881"
"f%&add%.b %2,%0")
(define_insn ""
- [(set (match_operand:DF 0 "general_operand" "=f")
+ [(set (match_operand:DF 0 "nonimmediate_operand" "=f")
(plus:DF (match_operand:DF 1 "general_operand" "%0")
(match_operand:DF 2 "general_operand" "fmG")))]
"TARGET_68881"
@@ -2651,14 +2651,14 @@
}")
(define_expand "addsf3"
- [(set (match_operand:SF 0 "general_operand" "")
+ [(set (match_operand:SF 0 "nonimmediate_operand" "")
(plus:SF (match_operand:SF 1 "general_operand" "")
(match_operand:SF 2 "general_operand" "")))]
"TARGET_68881 || TARGET_FPA"
"")
(define_insn ""
- [(set (match_operand:SF 0 "general_operand" "=x,y")
+ [(set (match_operand:SF 0 "nonimmediate_operand" "=x,y")
(plus:SF (match_operand:SF 1 "general_operand" "%xH,y")
(match_operand:SF 2 "general_operand" "xH,rmF")))]
"TARGET_FPA"
@@ -2674,28 +2674,28 @@
}")
(define_insn ""
- [(set (match_operand:SF 0 "general_operand" "=f")
+ [(set (match_operand:SF 0 "nonimmediate_operand" "=f")
(plus:SF (float:SF (match_operand:SI 2 "general_operand" "dmi"))
(match_operand:SF 1 "general_operand" "0")))]
"TARGET_68881"
"f%$add%.l %2,%0")
(define_insn ""
- [(set (match_operand:SF 0 "general_operand" "=f")
+ [(set (match_operand:SF 0 "nonimmediate_operand" "=f")
(plus:SF (float:SF (match_operand:HI 2 "general_operand" "dmn"))
(match_operand:SF 1 "general_operand" "0")))]
"TARGET_68881"
"f%$add%.w %2,%0")
(define_insn ""
- [(set (match_operand:SF 0 "general_operand" "=f")
+ [(set (match_operand:SF 0 "nonimmediate_operand" "=f")
(plus:SF (float:SF (match_operand:QI 2 "general_operand" "dmn"))
(match_operand:SF 1 "general_operand" "0")))]
"TARGET_68881"
"f%$add%.b %2,%0")
(define_insn ""
- [(set (match_operand:SF 0 "general_operand" "=f")
+ [(set (match_operand:SF 0 "nonimmediate_operand" "=f")
(plus:SF (match_operand:SF 1 "general_operand" "%0")
(match_operand:SF 2 "general_operand" "fdmF")))]
"TARGET_68881"
@@ -2709,7 +2709,7 @@
;; subtract instructions
(define_insn "subdi_sexthishl32"
- [(set (match_operand:DI 0 "general_operand" "=o,a,*d,*d")
+ [(set (match_operand:DI 0 "nonimmediate_operand" "=o,a,*d,*d")
(minus:DI (match_operand:DI 1 "general_operand" "0,0,0,0")
(ashift:DI (sign_extend:DI (match_operand:HI 2 "general_operand" "rm,rm,rm,rm"))
(const_int 32))))
@@ -2727,7 +2727,7 @@
} ")
(define_insn "subdi_dishl32"
- [(set (match_operand:DI 0 "general_operand" "+ro")
+ [(set (match_operand:DI 0 "nonimmediate_operand" "+ro")
(minus:DI (match_dup 0)
(ashift:DI (match_operand:DI 1 "general_operand" "ro")
(const_int 32))))]
@@ -2743,7 +2743,7 @@
} ")
(define_insn "subdi3"
- [(set (match_operand:DI 0 "general_operand" "=<,o<>,d,d,d")
+ [(set (match_operand:DI 0 "nonimmediate_operand" "=<,o<>,d,d,d")
(minus:DI (match_operand:DI 1 "general_operand" "0,0,0,0,0")
(match_operand:DI 2 "general_operand" "<,d,no>,d,a")))
(clobber (match_scratch:SI 3 "=X,&d,&d,X,&d"))]
@@ -2837,14 +2837,14 @@
} ")
(define_insn "subsi3"
- [(set (match_operand:SI 0 "general_operand" "=m,d,a")
+ [(set (match_operand:SI 0 "nonimmediate_operand" "=m,d,a")
(minus:SI (match_operand:SI 1 "general_operand" "0,0,0")
(match_operand:SI 2 "general_src_operand" "dT,mSrT,mSrs")))]
""
"sub%.l %2,%0")
(define_insn ""
- [(set (match_operand:SI 0 "general_operand" "=a")
+ [(set (match_operand:SI 0 "nonimmediate_operand" "=a")
(minus:SI (match_operand:SI 1 "general_operand" "0")
(sign_extend:SI
(match_operand:HI 2 "nonimmediate_src_operand" "rmS"))))]
@@ -2852,42 +2852,42 @@
"sub%.w %2,%0")
(define_insn "subhi3"
- [(set (match_operand:HI 0 "general_operand" "=m,r")
+ [(set (match_operand:HI 0 "nonimmediate_operand" "=m,r")
(minus:HI (match_operand:HI 1 "general_operand" "0,0")
(match_operand:HI 2 "general_src_operand" "dn,rmSn")))]
"!TARGET_5200"
"sub%.w %2,%0")
(define_insn ""
- [(set (strict_low_part (match_operand:HI 0 "general_operand" "+m,d"))
+ [(set (strict_low_part (match_operand:HI 0 "nonimmediate_operand" "+m,d"))
(minus:HI (match_dup 0)
(match_operand:HI 1 "general_src_operand" "dn,rmSn")))]
"!TARGET_5200"
"sub%.w %1,%0")
(define_insn "subqi3"
- [(set (match_operand:QI 0 "general_operand" "=m,d")
+ [(set (match_operand:QI 0 "nonimmediate_operand" "=m,d")
(minus:QI (match_operand:QI 1 "general_operand" "0,0")
(match_operand:QI 2 "general_src_operand" "dn,dmSn")))]
"!TARGET_5200"
"sub%.b %2,%0")
(define_insn ""
- [(set (strict_low_part (match_operand:QI 0 "general_operand" "+m,d"))
+ [(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+m,d"))
(minus:QI (match_dup 0)
(match_operand:QI 1 "general_src_operand" "dn,dmSn")))]
"!TARGET_5200"
"sub%.b %1,%0")
(define_expand "subdf3"
- [(set (match_operand:DF 0 "general_operand" "")
+ [(set (match_operand:DF 0 "nonimmediate_operand" "")
(minus:DF (match_operand:DF 1 "general_operand" "")
(match_operand:DF 2 "general_operand" "")))]
"TARGET_68881 || TARGET_FPA"
"")
(define_insn ""
- [(set (match_operand:DF 0 "general_operand" "=x,y,y")
+ [(set (match_operand:DF 0 "nonimmediate_operand" "=x,y,y")
(minus:DF (match_operand:DF 1 "general_operand" "xH,y,dmF")
(match_operand:DF 2 "general_operand" "xH,dmF,0")))]
"TARGET_FPA"
@@ -2903,28 +2903,28 @@
}")
(define_insn ""
- [(set (match_operand:DF 0 "general_operand" "=f")
+ [(set (match_operand:DF 0 "nonimmediate_operand" "=f")
(minus:DF (match_operand:DF 1 "general_operand" "0")
(float:DF (match_operand:SI 2 "general_operand" "dmi"))))]
"TARGET_68881"
"f%&sub%.l %2,%0")
(define_insn ""
- [(set (match_operand:DF 0 "general_operand" "=f")
+ [(set (match_operand:DF 0 "nonimmediate_operand" "=f")
(minus:DF (match_operand:DF 1 "general_operand" "0")
(float:DF (match_operand:HI 2 "general_operand" "dmn"))))]
"TARGET_68881"
"f%&sub%.w %2,%0")
(define_insn ""
- [(set (match_operand:DF 0 "general_operand" "=f")
+ [(set (match_operand:DF 0 "nonimmediate_operand" "=f")
(minus:DF (match_operand:DF 1 "general_operand" "0")
(float:DF (match_operand:QI 2 "general_operand" "dmn"))))]
"TARGET_68881"
"f%&sub%.b %2,%0")
(define_insn ""
- [(set (match_operand:DF 0 "general_operand" "=f")
+ [(set (match_operand:DF 0 "nonimmediate_operand" "=f")
(minus:DF (match_operand:DF 1 "general_operand" "0")
(match_operand:DF 2 "general_operand" "fmG")))]
"TARGET_68881"
@@ -2936,14 +2936,14 @@
}")
(define_expand "subsf3"
- [(set (match_operand:SF 0 "general_operand" "")
+ [(set (match_operand:SF 0 "nonimmediate_operand" "")
(minus:SF (match_operand:SF 1 "general_operand" "")
(match_operand:SF 2 "general_operand" "")))]
"TARGET_68881 || TARGET_FPA"
"")
(define_insn ""
- [(set (match_operand:SF 0 "general_operand" "=x,y,y")
+ [(set (match_operand:SF 0 "nonimmediate_operand" "=x,y,y")
(minus:SF (match_operand:SF 1 "general_operand" "xH,y,rmF")
(match_operand:SF 2 "general_operand" "xH,rmF,0")))]
"TARGET_FPA"
@@ -2959,28 +2959,28 @@
}")
(define_insn ""
- [(set (match_operand:SF 0 "general_operand" "=f")
+ [(set (match_operand:SF 0 "nonimmediate_operand" "=f")
(minus:SF (match_operand:SF 1 "general_operand" "0")
(float:SF (match_operand:SI 2 "general_operand" "dmi"))))]
"TARGET_68881"
"f%$sub%.l %2,%0")
(define_insn ""
- [(set (match_operand:SF 0 "general_operand" "=f")
+ [(set (match_operand:SF 0 "nonimmediate_operand" "=f")
(minus:SF (match_operand:SF 1 "general_operand" "0")
(float:SF (match_operand:HI 2 "general_operand" "dmn"))))]
"TARGET_68881"
"f%$sub%.w %2,%0")
(define_insn ""
- [(set (match_operand:SF 0 "general_operand" "=f")
+ [(set (match_operand:SF 0 "nonimmediate_operand" "=f")
(minus:SF (match_operand:SF 1 "general_operand" "0")
(float:SF (match_operand:QI 2 "general_operand" "dmn"))))]
"TARGET_68881"
"f%$sub%.b %2,%0")
(define_insn ""
- [(set (match_operand:SF 0 "general_operand" "=f")
+ [(set (match_operand:SF 0 "nonimmediate_operand" "=f")
(minus:SF (match_operand:SF 1 "general_operand" "0")
(match_operand:SF 2 "general_operand" "fdmF")))]
"TARGET_68881"
@@ -2994,7 +2994,7 @@
;; multiply instructions
(define_insn "mulhi3"
- [(set (match_operand:HI 0 "general_operand" "=d")
+ [(set (match_operand:HI 0 "nonimmediate_operand" "=d")
(mult:HI (match_operand:HI 1 "general_operand" "%0")
(match_operand:HI 2 "general_src_operand" "dmSn")))]
""
@@ -3008,7 +3008,7 @@
}")
(define_insn "mulhisi3"
- [(set (match_operand:SI 0 "general_operand" "=d")
+ [(set (match_operand:SI 0 "nonimmediate_operand" "=d")
(mult:SI (sign_extend:SI
(match_operand:HI 1 "nonimmediate_operand" "%0"))
(sign_extend:SI
@@ -3024,7 +3024,7 @@
}")
(define_insn ""
- [(set (match_operand:SI 0 "general_operand" "=d")
+ [(set (match_operand:SI 0 "nonimmediate_operand" "=d")
(mult:SI (sign_extend:SI
(match_operand:HI 1 "nonimmediate_operand" "%0"))
(match_operand:SI 2 "const_int_operand" "n")))]
@@ -3039,14 +3039,14 @@
}")
(define_expand "mulsi3"
- [(set (match_operand:SI 0 "general_operand" "")
+ [(set (match_operand:SI 0 "nonimmediate_operand" "")
(mult:SI (match_operand:SI 1 "general_operand" "")
(match_operand:SI 2 "general_operand" "")))]
"TARGET_68020 || TARGET_5200"
"")
(define_insn ""
- [(set (match_operand:SI 0 "general_operand" "=d")
+ [(set (match_operand:SI 0 "nonimmediate_operand" "=d")
(mult:SI (match_operand:SI 1 "general_operand" "%0")
(match_operand:SI 2 "general_src_operand" "dmSTK")))]
@@ -3054,14 +3054,14 @@
"muls%.l %2,%0")
(define_insn ""
- [(set (match_operand:SI 0 "general_operand" "=d")
+ [(set (match_operand:SI 0 "nonimmediate_operand" "=d")
(mult:SI (match_operand:SI 1 "general_operand" "%0")
(match_operand:SI 2 "general_operand" "d<Q>")))]
"TARGET_5200"
"muls%.l %2,%0")
(define_insn "umulhisi3"
- [(set (match_operand:SI 0 "general_operand" "=d")
+ [(set (match_operand:SI 0 "nonimmediate_operand" "=d")
(mult:SI (zero_extend:SI
(match_operand:HI 1 "nonimmediate_operand" "%0"))
(zero_extend:SI
@@ -3077,7 +3077,7 @@
}")
(define_insn ""
- [(set (match_operand:SI 0 "general_operand" "=d")
+ [(set (match_operand:SI 0 "nonimmediate_operand" "=d")
(mult:SI (zero_extend:SI
(match_operand:HI 1 "nonimmediate_operand" "%0"))
(match_operand:SI 2 "const_int_operand" "n")))]
@@ -3262,14 +3262,14 @@
"muls%.l %3,%0:%1")
(define_expand "muldf3"
- [(set (match_operand:DF 0 "general_operand" "")
+ [(set (match_operand:DF 0 "nonimmediate_operand" "")
(mult:DF (match_operand:DF 1 "general_operand" "")
(match_operand:DF 2 "general_operand" "")))]
"TARGET_68881 || TARGET_FPA"
"")
(define_insn ""
- [(set (match_operand:DF 0 "general_operand" "=x,y")
+ [(set (match_operand:DF 0 "nonimmediate_operand" "=x,y")
(mult:DF (match_operand:DF 1 "general_operand" "%xH,y")
(match_operand:DF 2 "general_operand" "xH,rmF")))]
"TARGET_FPA"
@@ -3287,28 +3287,28 @@
}")
(define_insn ""
- [(set (match_operand:DF 0 "general_operand" "=f")
+ [(set (match_operand:DF 0 "nonimmediate_operand" "=f")
(mult:DF (float:DF (match_operand:SI 2 "general_operand" "dmi"))
(match_operand:DF 1 "general_operand" "0")))]
"TARGET_68881"
"f%&mul%.l %2,%0")
(define_insn ""
- [(set (match_operand:DF 0 "general_operand" "=f")
+ [(set (match_operand:DF 0 "nonimmediate_operand" "=f")
(mult:DF (float:DF (match_operand:HI 2 "general_operand" "dmn"))
(match_operand:DF 1 "general_operand" "0")))]
"TARGET_68881"
"f%&mul%.w %2,%0")
(define_insn ""
- [(set (match_operand:DF 0 "general_operand" "=f")
+ [(set (match_operand:DF 0 "nonimmediate_operand" "=f")
(mult:DF (float:DF (match_operand:QI 2 "general_operand" "dmn"))
(match_operand:DF 1 "general_operand" "0")))]
"TARGET_68881"
"f%&mul%.b %2,%0")
(define_insn ""
- [(set (match_operand:DF 0 "general_operand" "=f")
+ [(set (match_operand:DF 0 "nonimmediate_operand" "=f")
(mult:DF (match_operand:DF 1 "general_operand" "%0")
(match_operand:DF 2 "general_operand" "fmG")))]
"TARGET_68881"
@@ -3327,14 +3327,14 @@
}")
(define_expand "mulsf3"
- [(set (match_operand:SF 0 "general_operand" "")
+ [(set (match_operand:SF 0 "nonimmediate_operand" "")
(mult:SF (match_operand:SF 1 "general_operand" "")
(match_operand:SF 2 "general_operand" "")))]
"TARGET_68881 || TARGET_FPA"
"")
(define_insn ""
- [(set (match_operand:SF 0 "general_operand" "=x,y")
+ [(set (match_operand:SF 0 "nonimmediate_operand" "=x,y")
(mult:SF (match_operand:SF 1 "general_operand" "%xH,y")
(match_operand:SF 2 "general_operand" "xH,rmF")))]
"TARGET_FPA"
@@ -3352,7 +3352,7 @@
}")
(define_insn ""
- [(set (match_operand:SF 0 "general_operand" "=f")
+ [(set (match_operand:SF 0 "nonimmediate_operand" "=f")
(mult:SF (float:SF (match_operand:SI 2 "general_operand" "dmi"))
(match_operand:SF 1 "general_operand" "0")))]
"TARGET_68881"
@@ -3364,7 +3364,7 @@
}")
(define_insn ""
- [(set (match_operand:SF 0 "general_operand" "=f")
+ [(set (match_operand:SF 0 "nonimmediate_operand" "=f")
(mult:SF (float:SF (match_operand:HI 2 "general_operand" "dmn"))
(match_operand:SF 1 "general_operand" "0")))]
"TARGET_68881"
@@ -3376,7 +3376,7 @@
}")
(define_insn ""
- [(set (match_operand:SF 0 "general_operand" "=f")
+ [(set (match_operand:SF 0 "nonimmediate_operand" "=f")
(mult:SF (float:SF (match_operand:QI 2 "general_operand" "dmn"))
(match_operand:SF 1 "general_operand" "0")))]
"TARGET_68881"
@@ -3388,7 +3388,7 @@
}")
(define_insn ""
- [(set (match_operand:SF 0 "general_operand" "=f")
+ [(set (match_operand:SF 0 "nonimmediate_operand" "=f")
(mult:SF (match_operand:SF 1 "general_operand" "%0")
(match_operand:SF 2 "general_operand" "fdmF")))]
"TARGET_68881"
@@ -3413,14 +3413,14 @@
;; divide instructions
(define_expand "divdf3"
- [(set (match_operand:DF 0 "general_operand" "")
+ [(set (match_operand:DF 0 "nonimmediate_operand" "")
(div:DF (match_operand:DF 1 "general_operand" "")
(match_operand:DF 2 "general_operand" "")))]
"TARGET_68881 || TARGET_FPA"
"")
(define_insn ""
- [(set (match_operand:DF 0 "general_operand" "=x,y,y")
+ [(set (match_operand:DF 0 "nonimmediate_operand" "=x,y,y")
(div:DF (match_operand:DF 1 "general_operand" "xH,y,rmF")
(match_operand:DF 2 "general_operand" "xH,rmF,0")))]
"TARGET_FPA"
@@ -3436,28 +3436,28 @@
}")
(define_insn ""
- [(set (match_operand:DF 0 "general_operand" "=f")
+ [(set (match_operand:DF 0 "nonimmediate_operand" "=f")
(div:DF (match_operand:DF 1 "general_operand" "0")
(float:DF (match_operand:SI 2 "general_operand" "dmi"))))]
"TARGET_68881"
"f%&div%.l %2,%0")
(define_insn ""
- [(set (match_operand:DF 0 "general_operand" "=f")
+ [(set (match_operand:DF 0 "nonimmediate_operand" "=f")
(div:DF (match_operand:DF 1 "general_operand" "0")
(float:DF (match_operand:HI 2 "general_operand" "dmn"))))]
"TARGET_68881"
"f%&div%.w %2,%0")
(define_insn ""
- [(set (match_operand:DF 0 "general_operand" "=f")
+ [(set (match_operand:DF 0 "nonimmediate_operand" "=f")
(div:DF (match_operand:DF 1 "general_operand" "0")
(float:DF (match_operand:QI 2 "general_operand" "dmn"))))]
"TARGET_68881"
"f%&div%.b %2,%0")
(define_insn ""
- [(set (match_operand:DF 0 "general_operand" "=f")
+ [(set (match_operand:DF 0 "nonimmediate_operand" "=f")
(div:DF (match_operand:DF 1 "general_operand" "0")
(match_operand:DF 2 "general_operand" "fmG")))]
"TARGET_68881"
@@ -3469,14 +3469,14 @@
}")
(define_expand "divsf3"
- [(set (match_operand:SF 0 "general_operand" "")
+ [(set (match_operand:SF 0 "nonimmediate_operand" "")
(div:SF (match_operand:SF 1 "general_operand" "")
(match_operand:SF 2 "general_operand" "")))]
"TARGET_68881 || TARGET_FPA"
"")
(define_insn ""
- [(set (match_operand:SF 0 "general_operand" "=x,y,y")
+ [(set (match_operand:SF 0 "nonimmediate_operand" "=x,y,y")
(div:SF (match_operand:SF 1 "general_operand" "xH,y,rmF")
(match_operand:SF 2 "general_operand" "xH,rmF,0")))]
"TARGET_FPA"
@@ -3492,7 +3492,7 @@
}")
(define_insn ""
- [(set (match_operand:SF 0 "general_operand" "=f")
+ [(set (match_operand:SF 0 "nonimmediate_operand" "=f")
(div:SF (match_operand:SF 1 "general_operand" "0")
(float:SF (match_operand:SI 2 "general_operand" "dmi"))))]
"TARGET_68881"
@@ -3504,7 +3504,7 @@
}")
(define_insn ""
- [(set (match_operand:SF 0 "general_operand" "=f")
+ [(set (match_operand:SF 0 "nonimmediate_operand" "=f")
(div:SF (match_operand:SF 1 "general_operand" "0")
(float:SF (match_operand:HI 2 "general_operand" "dmn"))))]
"TARGET_68881"
@@ -3516,7 +3516,7 @@
}")
(define_insn ""
- [(set (match_operand:SF 0 "general_operand" "=f")
+ [(set (match_operand:SF 0 "nonimmediate_operand" "=f")
(div:SF (match_operand:SF 1 "general_operand" "0")
(float:SF (match_operand:QI 2 "general_operand" "dmn"))))]
"TARGET_68881"
@@ -3528,7 +3528,7 @@
}")
(define_insn ""
- [(set (match_operand:SF 0 "general_operand" "=f")
+ [(set (match_operand:SF 0 "nonimmediate_operand" "=f")
(div:SF (match_operand:SF 1 "general_operand" "0")
(match_operand:SF 2 "general_operand" "fdmF")))]
"TARGET_68881"
@@ -3553,10 +3553,10 @@
;; Remainder instructions.
(define_insn "divmodsi4"
- [(set (match_operand:SI 0 "general_operand" "=d")
+ [(set (match_operand:SI 0 "nonimmediate_operand" "=d")
(div:SI (match_operand:SI 1 "general_operand" "0")
(match_operand:SI 2 "general_src_operand" "dmSTK")))
- (set (match_operand:SI 3 "general_operand" "=d")
+ (set (match_operand:SI 3 "nonimmediate_operand" "=d")
(mod:SI (match_dup 1) (match_dup 2)))]
"TARGET_68020 && !TARGET_5200"
"*
@@ -3568,10 +3568,10 @@
}")
(define_insn "udivmodsi4"
- [(set (match_operand:SI 0 "general_operand" "=d")
+ [(set (match_operand:SI 0 "nonimmediate_operand" "=d")
(udiv:SI (match_operand:SI 1 "general_operand" "0")
(match_operand:SI 2 "general_src_operand" "dmSTK")))
- (set (match_operand:SI 3 "general_operand" "=d")
+ (set (match_operand:SI 3 "nonimmediate_operand" "=d")
(umod:SI (match_dup 1) (match_dup 2)))]
"TARGET_68020 && !TARGET_5200"
"*
@@ -3583,10 +3583,10 @@
}")
(define_insn "divmodhi4"
- [(set (match_operand:HI 0 "general_operand" "=d")
+ [(set (match_operand:HI 0 "nonimmediate_operand" "=d")
(div:HI (match_operand:HI 1 "general_operand" "0")
(match_operand:HI 2 "general_src_operand" "dmSKT")))
- (set (match_operand:HI 3 "general_operand" "=d")
+ (set (match_operand:HI 3 "nonimmediate_operand" "=d")
(mod:HI (match_dup 1) (match_dup 2)))]
"!TARGET_5200"
"*
@@ -3606,10 +3606,10 @@
}")
(define_insn "udivmodhi4"
- [(set (match_operand:HI 0 "general_operand" "=d")
+ [(set (match_operand:HI 0 "nonimmediate_operand" "=d")
(udiv:HI (match_operand:HI 1 "general_operand" "0")
(match_operand:HI 2 "general_src_operand" "dmSKT")))
- (set (match_operand:HI 3 "general_operand" "=d")
+ (set (match_operand:HI 3 "nonimmediate_operand" "=d")
(umod:HI (match_dup 1) (match_dup 2)))]
"!TARGET_5200"
"*
@@ -3632,7 +3632,7 @@
;; "anddi3" is mainly here to help combine().
(define_insn "anddi3"
- [(set (match_operand:DI 0 "general_operand" "=o,d")
+ [(set (match_operand:DI 0 "nonimmediate_operand" "=o,d")
(and:DI (match_operand:DI 1 "general_operand" "%0,0")
(match_operand:DI 2 "general_operand" "dn,don")))]
"!TARGET_5200"
@@ -3726,42 +3726,42 @@
"and%.l %2,%0")
(define_insn "andhi3"
- [(set (match_operand:HI 0 "general_operand" "=m,d")
+ [(set (match_operand:HI 0 "nonimmediate_operand" "=m,d")
(and:HI (match_operand:HI 1 "general_operand" "%0,0")
(match_operand:HI 2 "general_src_operand" "dn,dmSn")))]
"!TARGET_5200"
"and%.w %2,%0")
(define_insn ""
- [(set (strict_low_part (match_operand:HI 0 "general_operand" "+m,d"))
+ [(set (strict_low_part (match_operand:HI 0 "nonimmediate_operand" "+m,d"))
(and:HI (match_dup 0)
(match_operand:HI 1 "general_src_operand" "dn,dmSn")))]
"!TARGET_5200"
"and%.w %1,%0")
(define_insn ""
- [(set (strict_low_part (match_operand:HI 0 "general_operand" "+m,d"))
+ [(set (strict_low_part (match_operand:HI 0 "nonimmediate_operand" "+m,d"))
(and:HI (match_operand:HI 1 "general_src_operand" "dn,dmSn")
(match_dup 0)))]
"!TARGET_5200"
"and%.w %1,%0")
(define_insn "andqi3"
- [(set (match_operand:QI 0 "general_operand" "=m,d")
+ [(set (match_operand:QI 0 "nonimmediate_operand" "=m,d")
(and:QI (match_operand:QI 1 "general_operand" "%0,0")
(match_operand:QI 2 "general_src_operand" "dn,dmSn")))]
"!TARGET_5200"
"and%.b %2,%0")
(define_insn ""
- [(set (strict_low_part (match_operand:QI 0 "general_operand" "+m,d"))
+ [(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+m,d"))
(and:QI (match_dup 0)
(match_operand:QI 1 "general_src_operand" "dn,dmSn")))]
"!TARGET_5200"
"and%.b %1,%0")
(define_insn ""
- [(set (strict_low_part (match_operand:QI 0 "general_operand" "+m,d"))
+ [(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+m,d"))
(and:QI (match_operand:QI 1 "general_src_operand" "dn,dmSn")
(match_dup 0)))]
"!TARGET_5200"
@@ -3770,7 +3770,7 @@
;; inclusive-or instructions
(define_insn "iordi_zext"
- [(set (match_operand:DI 0 "general_operand" "=o,d")
+ [(set (match_operand:DI 0 "nonimmediate_operand" "=o,d")
(ior:DI (zero_extend:DI (match_operand 1 "general_operand" "dn,dmn"))
(match_operand:DI 2 "general_operand" "0,0")))]
"!TARGET_5200"
@@ -3796,7 +3796,7 @@
;; "iordi3" is mainly here to help combine().
(define_insn "iordi3"
- [(set (match_operand:DI 0 "general_operand" "=o,d")
+ [(set (match_operand:DI 0 "nonimmediate_operand" "=o,d")
(ior:DI (match_operand:DI 1 "general_operand" "%0,0")
(match_operand:DI 2 "general_operand" "dn,don")))]
"!TARGET_5200"
@@ -3866,14 +3866,14 @@
}")
(define_expand "iorsi3"
- [(set (match_operand:SI 0 "general_operand" "")
+ [(set (match_operand:SI 0 "nonimmediate_operand" "")
(ior:SI (match_operand:SI 1 "general_operand" "")
(match_operand:SI 2 "general_src_operand" "")))]
""
"")
(define_insn "iorsi3_internal"
- [(set (match_operand:SI 0 "general_operand" "=m,d")
+ [(set (match_operand:SI 0 "nonimmediate_operand" "=m,d")
(ior:SI (match_operand:SI 1 "general_operand" "%0,0")
(match_operand:SI 2 "general_src_operand" "dKT,dmSMT")))]
"! TARGET_5200"
@@ -3883,49 +3883,49 @@
}")
(define_insn "iorsi3_5200"
- [(set (match_operand:SI 0 "general_operand" "=m,d")
+ [(set (match_operand:SI 0 "nonimmediate_operand" "=m,d")
(ior:SI (match_operand:SI 1 "general_operand" "%0,0")
(match_operand:SI 2 "general_src_operand" "d,dmsK")))]
"TARGET_5200"
"or%.l %2,%0")
(define_insn "iorhi3"
- [(set (match_operand:HI 0 "general_operand" "=m,d")
+ [(set (match_operand:HI 0 "nonimmediate_operand" "=m,d")
(ior:HI (match_operand:HI 1 "general_operand" "%0,0")
(match_operand:HI 2 "general_src_operand" "dn,dmSn")))]
"!TARGET_5200"
"or%.w %2,%0")
(define_insn ""
- [(set (strict_low_part (match_operand:HI 0 "general_operand" "+m,d"))
+ [(set (strict_low_part (match_operand:HI 0 "nonimmediate_operand" "+m,d"))
(ior:HI (match_dup 0)
(match_operand:HI 1 "general_src_operand" "dn,dmSn")))]
"!TARGET_5200"
"or%.w %1,%0")
(define_insn ""
- [(set (strict_low_part (match_operand:HI 0 "general_operand" "+m,d"))
+ [(set (strict_low_part (match_operand:HI 0 "nonimmediate_operand" "+m,d"))
(ior:HI (match_operand:HI 1 "general_src_operand" "dn,dmSn")
(match_dup 0)))]
"!TARGET_5200"
"or%.w %1,%0")
(define_insn "iorqi3"
- [(set (match_operand:QI 0 "general_operand" "=m,d")
+ [(set (match_operand:QI 0 "nonimmediate_operand" "=m,d")
(ior:QI (match_operand:QI 1 "general_operand" "%0,0")
(match_operand:QI 2 "general_src_operand" "dn,dmSn")))]
"!TARGET_5200"
"or%.b %2,%0")
(define_insn ""
- [(set (strict_low_part (match_operand:QI 0 "general_operand" "+m,d"))
+ [(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+m,d"))
(ior:QI (match_dup 0)
(match_operand:QI 1 "general_src_operand" "dn,dmSn")))]
"!TARGET_5200"
"or%.b %1,%0")
(define_insn ""
- [(set (strict_low_part (match_operand:QI 0 "general_operand" "+m,d"))
+ [(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+m,d"))
(ior:QI (match_operand:QI 1 "general_src_operand" "dn,dmSn")
(match_dup 0)))]
"!TARGET_5200"
@@ -3935,7 +3935,7 @@
;; See also ashlsi_16, ashrsi_16 and lshrsi_16.
(define_insn "iorsi_zexthi_ashl16"
- [(set (match_operand:SI 0 "general_operand" "=&d")
+ [(set (match_operand:SI 0 "nonimmediate_operand" "=&d")
(ior:SI (zero_extend:SI (match_operand:HI 1 "general_operand" "rmn"))
(ashift:SI (match_operand:SI 2 "general_operand" "or")
(const_int 16))))]
@@ -3952,7 +3952,7 @@
}")
(define_insn "iorsi_zext"
- [(set (match_operand:SI 0 "general_operand" "=o,d")
+ [(set (match_operand:SI 0 "nonimmediate_operand" "=o,d")
(ior:SI (zero_extend:SI (match_operand 1 "general_operand" "dn,dmn"))
(match_operand:SI 2 "general_operand" "0,0")))]
"!TARGET_5200"
@@ -3974,7 +3974,7 @@
;; "xordi3" is mainly here to help combine().
(define_insn "xordi3"
- [(set (match_operand:DI 0 "general_operand" "=od")
+ [(set (match_operand:DI 0 "nonimmediate_operand" "=od")
(xor:DI (match_operand:DI 1 "general_operand" "%0")
(match_operand:DI 2 "general_operand" "dn")))]
"!TARGET_5200"
@@ -4047,14 +4047,14 @@
}")
(define_expand "xorsi3"
- [(set (match_operand:SI 0 "general_operand" "")
+ [(set (match_operand:SI 0 "nonimmediate_operand" "")
(xor:SI (match_operand:SI 1 "general_operand" "")
(match_operand:SI 2 "general_operand" "")))]
""
"")
(define_insn "xorsi3_internal"
- [(set (match_operand:SI 0 "general_operand" "=do,m")
+ [(set (match_operand:SI 0 "nonimmediate_operand" "=do,m")
(xor:SI (match_operand:SI 1 "general_operand" "%0,0")
(match_operand:SI 2 "general_operand" "di,dKT")))]
@@ -4065,49 +4065,49 @@
}")
(define_insn "xorsi3_5200"
- [(set (match_operand:SI 0 "general_operand" "=dm,d")
+ [(set (match_operand:SI 0 "nonimmediate_operand" "=dm,d")
(xor:SI (match_operand:SI 1 "general_operand" "%0,0")
(match_operand:SI 2 "general_operand" "d,Ks")))]
"TARGET_5200"
"eor%.l %2,%0")
(define_insn "xorhi3"
- [(set (match_operand:HI 0 "general_operand" "=dm")
+ [(set (match_operand:HI 0 "nonimmediate_operand" "=dm")
(xor:HI (match_operand:HI 1 "general_operand" "%0")
(match_operand:HI 2 "general_operand" "dn")))]
"!TARGET_5200"
"eor%.w %2,%0")
(define_insn ""
- [(set (strict_low_part (match_operand:HI 0 "general_operand" "+dm"))
+ [(set (strict_low_part (match_operand:HI 0 "nonimmediate_operand" "+dm"))
(xor:HI (match_dup 0)
(match_operand:HI 1 "general_operand" "dn")))]
"!TARGET_5200"
"eor%.w %1,%0")
(define_insn ""
- [(set (strict_low_part (match_operand:HI 0 "general_operand" "+dm"))
+ [(set (strict_low_part (match_operand:HI 0 "nonimmediate_operand" "+dm"))
(xor:HI (match_operand:HI 1 "general_operand" "dn")
(match_dup 0)))]
"!TARGET_5200"
"eor%.w %1,%0")
(define_insn "xorqi3"
- [(set (match_operand:QI 0 "general_operand" "=dm")
+ [(set (match_operand:QI 0 "nonimmediate_operand" "=dm")
(xor:QI (match_operand:QI 1 "general_operand" "%0")
(match_operand:QI 2 "general_operand" "dn")))]
"!TARGET_5200"
"eor%.b %2,%0")
(define_insn ""
- [(set (strict_low_part (match_operand:QI 0 "general_operand" "+dm"))
+ [(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+dm"))
(xor:QI (match_dup 0)
(match_operand:QI 1 "general_operand" "dn")))]
"!TARGET_5200"
"eor%.b %1,%0")
(define_insn ""
- [(set (strict_low_part (match_operand:QI 0 "general_operand" "+dm"))
+ [(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+dm"))
(xor:QI (match_operand:QI 1 "general_operand" "dn")
(match_dup 0)))]
"!TARGET_5200"
@@ -4116,7 +4116,7 @@
;; negation instructions
(define_expand "negdi2"
- [(set (match_operand:DI 0 "general_operand" "")
+ [(set (match_operand:DI 0 "nonimmediate_operand" "")
(neg:DI (match_operand:DI 1 "general_operand" "")))]
""
"
@@ -4129,7 +4129,7 @@
}")
(define_insn "negdi2_internal"
- [(set (match_operand:DI 0 "general_operand" "=<,do,!*a")
+ [(set (match_operand:DI 0 "nonimmediate_operand" "=<,do,!*a")
(neg:DI (match_operand:DI 1 "general_operand" "0,0,0")))]
"!TARGET_5200"
"*
@@ -4147,7 +4147,7 @@
} ")
(define_insn "negdi2_5200"
- [(set (match_operand:DI 0 "general_operand" "=d")
+ [(set (match_operand:DI 0 "nonimmediate_operand" "=d")
(neg:DI (match_operand:DI 1 "general_operand" "0")))]
"TARGET_5200"
"*
@@ -4157,7 +4157,7 @@
} ")
(define_expand "negsi2"
- [(set (match_operand:SI 0 "general_operand" "")
+ [(set (match_operand:SI 0 "nonimmediate_operand" "")
(neg:SI (match_operand:SI 1 "general_operand" "")))]
""
"
@@ -4170,37 +4170,37 @@
}")
(define_insn "negsi2_internal"
- [(set (match_operand:SI 0 "general_operand" "=dm")
+ [(set (match_operand:SI 0 "nonimmediate_operand" "=dm")
(neg:SI (match_operand:SI 1 "general_operand" "0")))]
"!TARGET_5200"
"neg%.l %0")
(define_insn "negsi2_5200"
- [(set (match_operand:SI 0 "general_operand" "=d")
+ [(set (match_operand:SI 0 "nonimmediate_operand" "=d")
(neg:SI (match_operand:SI 1 "general_operand" "0")))]
"TARGET_5200"
"neg%.l %0")
(define_insn "neghi2"
- [(set (match_operand:HI 0 "general_operand" "=dm")
+ [(set (match_operand:HI 0 "nonimmediate_operand" "=dm")
(neg:HI (match_operand:HI 1 "general_operand" "0")))]
"!TARGET_5200"
"neg%.w %0")
(define_insn ""
- [(set (strict_low_part (match_operand:HI 0 "general_operand" "+dm"))
+ [(set (strict_low_part (match_operand:HI 0 "nonimmediate_operand" "+dm"))
(neg:HI (match_dup 0)))]
"!TARGET_5200"
"neg%.w %0")
(define_insn "negqi2"
- [(set (match_operand:QI 0 "general_operand" "=dm")
+ [(set (match_operand:QI 0 "nonimmediate_operand" "=dm")
(neg:QI (match_operand:QI 1 "general_operand" "0")))]
"!TARGET_5200"
"neg%.b %0")
(define_insn ""
- [(set (strict_low_part (match_operand:QI 0 "general_operand" "+dm"))
+ [(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+dm"))
(neg:QI (match_dup 0)))]
"!TARGET_5200"
"neg%.b %0")
@@ -4208,7 +4208,7 @@
;; If using software floating point, just flip the sign bit.
(define_expand "negsf2"
- [(set (match_operand:SF 0 "general_operand" "")
+ [(set (match_operand:SF 0 "nonimmediate_operand" "")
(neg:SF (match_operand:SF 1 "general_operand" "")))]
""
"
@@ -4235,13 +4235,13 @@
}")
(define_insn ""
- [(set (match_operand:SF 0 "general_operand" "=x,y")
+ [(set (match_operand:SF 0 "nonimmediate_operand" "=x,y")
(neg:SF (match_operand:SF 1 "general_operand" "xH,rmF")))]
"TARGET_FPA"
"fpneg%.s %w1,%0")
(define_insn ""
- [(set (match_operand:SF 0 "general_operand" "=f,d")
+ [(set (match_operand:SF 0 "nonimmediate_operand" "=f,d")
(neg:SF (match_operand:SF 1 "general_operand" "fdmF,0")))]
"TARGET_68881"
"*
@@ -4257,7 +4257,7 @@
}")
(define_expand "negdf2"
- [(set (match_operand:DF 0 "general_operand" "")
+ [(set (match_operand:DF 0 "nonimmediate_operand" "")
(neg:DF (match_operand:DF 1 "general_operand" "")))]
""
"
@@ -4291,13 +4291,13 @@
}")
(define_insn ""
- [(set (match_operand:DF 0 "general_operand" "=x,y")
+ [(set (match_operand:DF 0 "nonimmediate_operand" "=x,y")
(neg:DF (match_operand:DF 1 "general_operand" "xH,rmF")))]
"TARGET_FPA"
"fpneg%.d %y1, %0")
(define_insn ""
- [(set (match_operand:DF 0 "general_operand" "=f,d")
+ [(set (match_operand:DF 0 "nonimmediate_operand" "=f,d")
(neg:DF (match_operand:DF 1 "general_operand" "fmF,0")))]
"TARGET_68881"
"*
@@ -4315,7 +4315,7 @@
;; Sqrt instruction for the 68881
(define_insn "sqrtsf2"
- [(set (match_operand:SF 0 "general_operand" "=f")
+ [(set (match_operand:SF 0 "nonimmediate_operand" "=f")
(sqrt:SF (match_operand:SF 1 "general_operand" "fm")))]
"TARGET_68881"
"*
@@ -4327,7 +4327,7 @@
}")
(define_insn "sqrtdf2"
- [(set (match_operand:DF 0 "general_operand" "=f")
+ [(set (match_operand:DF 0 "nonimmediate_operand" "=f")
(sqrt:DF (match_operand:DF 1 "general_operand" "fm")))]
"TARGET_68881"
"*
@@ -4342,7 +4342,7 @@
;; If using software floating point, just zero the sign bit.
(define_expand "abssf2"
- [(set (match_operand:SF 0 "general_operand" "")
+ [(set (match_operand:SF 0 "nonimmediate_operand" "")
(abs:SF (match_operand:SF 1 "general_operand" "")))]
""
"
@@ -4369,13 +4369,13 @@
}")
(define_insn ""
- [(set (match_operand:SF 0 "general_operand" "=x,y")
+ [(set (match_operand:SF 0 "nonimmediate_operand" "=x,y")
(abs:SF (match_operand:SF 1 "general_operand" "xH,rmF")))]
"TARGET_FPA"
"fpabs%.s %y1,%0")
(define_insn ""
- [(set (match_operand:SF 0 "general_operand" "=f")
+ [(set (match_operand:SF 0 "nonimmediate_operand" "=f")
(abs:SF (match_operand:SF 1 "general_operand" "fdmF")))]
"TARGET_68881"
"*
@@ -4386,7 +4386,7 @@
}")
(define_expand "absdf2"
- [(set (match_operand:DF 0 "general_operand" "")
+ [(set (match_operand:DF 0 "nonimmediate_operand" "")
(abs:DF (match_operand:DF 1 "general_operand" "")))]
""
"
@@ -4420,13 +4420,13 @@
}")
(define_insn ""
- [(set (match_operand:DF 0 "general_operand" "=x,y")
+ [(set (match_operand:DF 0 "nonimmediate_operand" "=x,y")
(abs:DF (match_operand:DF 1 "general_operand" "xH,rmF")))]
"TARGET_FPA"
"fpabs%.d %y1,%0")
(define_insn ""
- [(set (match_operand:DF 0 "general_operand" "=f")
+ [(set (match_operand:DF 0 "nonimmediate_operand" "=f")
(abs:DF (match_operand:DF 1 "general_operand" "fmF")))]
"TARGET_68881"
"*
@@ -4440,7 +4440,7 @@
;; "one_cmpldi2" is mainly here to help combine().
(define_insn "one_cmpldi2"
- [(set (match_operand:DI 0 "general_operand" "=dm")
+ [(set (match_operand:DI 0 "nonimmediate_operand" "=dm")
(not:DI (match_operand:DI 1 "general_operand" "0")))]
"!TARGET_5200"
"*
@@ -4457,7 +4457,7 @@
}")
(define_expand "one_cmplsi2"
- [(set (match_operand:SI 0 "general_operand" "")
+ [(set (match_operand:SI 0 "nonimmediate_operand" "")
(not:SI (match_operand:SI 1 "general_operand" "")))]
""
"
@@ -4470,37 +4470,37 @@
}")
(define_insn "one_cmplsi2_internal"
- [(set (match_operand:SI 0 "general_operand" "=dm")
+ [(set (match_operand:SI 0 "nonimmediate_operand" "=dm")
(not:SI (match_operand:SI 1 "general_operand" "0")))]
"!TARGET_5200"
"not%.l %0")
(define_insn "one_cmplsi2_5200"
- [(set (match_operand:SI 0 "general_operand" "=d")
+ [(set (match_operand:SI 0 "nonimmediate_operand" "=d")
(not:SI (match_operand:SI 1 "general_operand" "0")))]
"TARGET_5200"
"not%.l %0")
(define_insn "one_cmplhi2"
- [(set (match_operand:HI 0 "general_operand" "=dm")
+ [(set (match_operand:HI 0 "nonimmediate_operand" "=dm")
(not:HI (match_operand:HI 1 "general_operand" "0")))]
"!TARGET_5200"
"not%.w %0")
(define_insn ""
- [(set (strict_low_part (match_operand:HI 0 "general_operand" "+dm"))
+ [(set (strict_low_part (match_operand:HI 0 "nonimmediate_operand" "+dm"))
(not:HI (match_dup 0)))]
"!TARGET_5200"
"not%.w %0")
(define_insn "one_cmplqi2"
- [(set (match_operand:QI 0 "general_operand" "=dm")
+ [(set (match_operand:QI 0 "nonimmediate_operand" "=dm")
(not:QI (match_operand:QI 1 "general_operand" "0")))]
"!TARGET_5200"
"not%.b %0")
(define_insn ""
- [(set (strict_low_part (match_operand:QI 0 "general_operand" "+dm"))
+ [(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+dm"))
(not:QI (match_dup 0)))]
"!TARGET_5200"
"not%.b %0")
@@ -4509,7 +4509,7 @@
;; We don't need the shift memory by 1 bit instruction
(define_insn "ashldi_extsi"
- [(set (match_operand:DI 0 "general_operand" "=ro")
+ [(set (match_operand:DI 0 "nonimmediate_operand" "=ro")
(ashift:DI
(match_operator:DI 2 "extend_operator"
[(match_operand:SI 1 "general_operand" "rm")])
@@ -4529,7 +4529,7 @@
} ")
(define_insn "ashldi_sexthi"
- [(set (match_operand:DI 0 "general_operand" "=m,a*d")
+ [(set (match_operand:DI 0 "nonimmediate_operand" "=m,a*d")
(ashift:DI (sign_extend:DI (match_operand:HI 1 "general_operand" "rm,rm"))
(const_int 32)))
(clobber (match_scratch:SI 2 "=a,X"))]
@@ -4556,7 +4556,7 @@
} ")
(define_insn "ashldi_const32"
- [(set (match_operand:DI 0 "general_operand" "=rm")
+ [(set (match_operand:DI 0 "nonimmediate_operand" "=rm")
(ashift:DI (match_operand:DI 1 "general_operand" "ro")
(const_int 32)))]
""
@@ -4583,7 +4583,7 @@
;; The predicate below must be general_operand, because ashldi3 allows that
(define_insn "ashldi_const"
- [(set (match_operand:DI 0 "general_operand" "=d")
+ [(set (match_operand:DI 0 "nonimmediate_operand" "=d")
(ashift:DI (match_operand:DI 1 "general_operand" "0")
(match_operand 2 "const_int_operand" "n")))]
"(!TARGET_5200
@@ -4615,7 +4615,7 @@
} ")
(define_expand "ashldi3"
- [(set (match_operand:DI 0 "general_operand" "")
+ [(set (match_operand:DI 0 "nonimmediate_operand" "")
(ashift:DI (match_operand:DI 1 "general_operand" "")
(match_operand 2 "const_int_operand" "")))]
"!TARGET_5200"
@@ -4729,7 +4729,7 @@
}")
(define_insn "subreghi1ashrdi_const32"
- [(set (match_operand:HI 0 "general_operand" "=rm")
+ [(set (match_operand:HI 0 "nonimmediate_operand" "=rm")
(subreg:HI (ashiftrt:DI (match_operand:DI 1 "general_operand" "ro")
(const_int 32)) 1))]
""
@@ -4741,7 +4741,7 @@
} ")
(define_insn "subregsi1ashrdi_const32"
- [(set (match_operand:SI 0 "general_operand" "=rm")
+ [(set (match_operand:SI 0 "nonimmediate_operand" "=rm")
(subreg:SI (ashiftrt:DI (match_operand:DI 1 "general_operand" "ro")
(const_int 32)) 1))]
""
@@ -4766,7 +4766,7 @@
} ")
(define_insn "ashrdi_const32_mem"
- [(set (match_operand:DI 0 "general_operand" "=o,<")
+ [(set (match_operand:DI 0 "nonimmediate_operand" "=o,<")
(ashiftrt:DI (match_operand:DI 1 "general_operand" "ro,ro")
(const_int 32)))
(clobber (match_scratch:SI 2 "=d,d"))]
@@ -4786,7 +4786,7 @@
;; The predicate below must be general_operand, because ashrdi3 allows that
(define_insn "ashrdi_const"
- [(set (match_operand:DI 0 "general_operand" "=d")
+ [(set (match_operand:DI 0 "nonimmediate_operand" "=d")
(ashiftrt:DI (match_operand:DI 1 "general_operand" "0")
(match_operand 2 "const_int_operand" "n")))]
"(!TARGET_5200
@@ -4805,7 +4805,7 @@
else if (INTVAL (operands[2]) == 8)
return \"move%.b %0,%1\;asr%.l %#8,%0\;ror%.l %#8,%1\";
else if (INTVAL (operands[2]) == 16)
- return \"move%.w %0,%1\;clr%.w %0\;swap %1\;ext%.l %0\";
+ return \"move%.w %0,%1\;swap %0\;ext%.l %0\;swap %1\";
else if (INTVAL (operands[2]) == 48)
return \"swap %0\;ext%.l %0\;move%.l %0,%1\;smi %0\;ext%.w %0\";
else if (INTVAL (operands[2]) == 31)
@@ -4826,7 +4826,7 @@
} ")
(define_expand "ashrdi3"
- [(set (match_operand:DI 0 "general_operand" "")
+ [(set (match_operand:DI 0 "nonimmediate_operand" "")
(ashiftrt:DI (match_operand:DI 1 "general_operand" "")
(match_operand 2 "const_int_operand" "")))]
"!TARGET_5200"
@@ -4895,7 +4895,7 @@
;; [(set (cc0)
;; (subreg:SI (lshiftrt:DI (match_operand:DI 0 "general_operand" "ro")
;; (const_int 32)) 1))
-;; (set (match_operand:SI 1 "general_operand" "=dm")
+;; (set (match_operand:SI 1 "nonimmediate_operand" "=dm")
;; (subreg:SI (lshiftrt:DI (match_dup 0)
;; (const_int 32)) 1))]
;; ""
@@ -4908,7 +4908,7 @@
;; [(set (cc0)
;; (subreg:SI (lshiftrt:DI (match_operand:DI 0 "general_operand" "ro")
;; (const_int 32)) 0))
-;; (set (match_operand:DI 1 "general_operand" "=do")
+;; (set (match_operand:DI 1 "nonimmediate_operand" "=do")
;; (lshiftrt:DI (match_dup 0)
;; (const_int 32)))]
;; ""
@@ -4922,7 +4922,7 @@
;;} ")
(define_insn "subreg1lshrdi_const32"
- [(set (match_operand:SI 0 "general_operand" "=rm")
+ [(set (match_operand:SI 0 "nonimmediate_operand" "=rm")
(subreg:SI (lshiftrt:DI (match_operand:DI 1 "general_operand" "ro")
(const_int 32)) 1))]
""
@@ -4932,7 +4932,7 @@
} ")
(define_insn "lshrdi_const32"
- [(set (match_operand:DI 0 "general_operand" "=ro,<,>")
+ [(set (match_operand:DI 0 "nonimmediate_operand" "=ro,<,>")
(lshiftrt:DI (match_operand:DI 1 "general_operand" "ro,ro,ro")
(const_int 32)))]
""
@@ -4959,7 +4959,7 @@
;; The predicate below must be general_operand, because lshrdi3 allows that
(define_insn "lshrdi_const"
- [(set (match_operand:DI 0 "general_operand" "=d")
+ [(set (match_operand:DI 0 "nonimmediate_operand" "=d")
(lshiftrt:DI (match_operand:DI 1 "general_operand" "0")
(match_operand 2 "const_int_operand" "n")))]
"(!TARGET_5200
@@ -4994,7 +4994,7 @@
} ")
(define_expand "lshrdi3"
- [(set (match_operand:DI 0 "general_operand" "")
+ [(set (match_operand:DI 0 "nonimmediate_operand" "")
(lshiftrt:DI (match_operand:DI 1 "general_operand" "")
(match_operand 2 "const_int_operand" "")))]
"!TARGET_5200"
@@ -5328,7 +5328,7 @@
; than an odd byte aligned bit field instruction.
;
(define_insn ""
- [(set (match_operand:SI 0 "general_operand" "=rm")
+ [(set (match_operand:SI 0 "nonimmediate_operand" "=rm")
(zero_extract:SI (match_operand:QI 1 "memory_src_operand" "oS")
(const_int 32)
(match_operand:SI 2 "const_int_operand" "n")))]
@@ -5344,7 +5344,7 @@
}")
(define_insn ""
- [(set (match_operand:SI 0 "general_operand" "=&d")
+ [(set (match_operand:SI 0 "nonimmediate_operand" "=&d")
(zero_extract:SI (match_operand:SI 1 "register_operand" "do")
(match_operand:SI 2 "const_int_operand" "n")
(match_operand:SI 3 "const_int_operand" "n")))]
@@ -5382,7 +5382,7 @@
; than an odd byte aligned bit field instruction.
;
(define_insn ""
- [(set (match_operand:SI 0 "general_operand" "=rm")
+ [(set (match_operand:SI 0 "nonimmediate_operand" "=rm")
(sign_extract:SI (match_operand:QI 1 "memory_src_operand" "oS")
(const_int 32)
(match_operand:SI 2 "const_int_operand" "n")))]
@@ -5398,7 +5398,7 @@
}")
(define_insn ""
- [(set (match_operand:SI 0 "general_operand" "=d")
+ [(set (match_operand:SI 0 "nonimmediate_operand" "=d")
(sign_extract:SI (match_operand:SI 1 "register_operand" "do")
(match_operand:SI 2 "const_int_operand" "n")
(match_operand:SI 3 "const_int_operand" "n")))]
@@ -5428,7 +5428,7 @@
;; so that its address is reloaded.
(define_expand "extv"
- [(set (match_operand:SI 0 "general_operand" "")
+ [(set (match_operand:SI 0 "nonimmediate_operand" "")
(sign_extract:SI (match_operand:SI 1 "general_operand" "")
(match_operand:SI 2 "general_operand" "")
(match_operand:SI 3 "general_operand" "")))]
@@ -5436,7 +5436,7 @@
"")
(define_insn ""
- [(set (match_operand:SI 0 "general_operand" "=d")
+ [(set (match_operand:SI 0 "nonimmediate_operand" "=d")
(sign_extract:SI (match_operand:QI 1 "memory_operand" "o")
(match_operand:SI 2 "general_operand" "di")
(match_operand:SI 3 "general_operand" "di")))]
@@ -5444,7 +5444,7 @@
"bfexts %1{%b3:%b2},%0")
(define_expand "extzv"
- [(set (match_operand:SI 0 "general_operand" "")
+ [(set (match_operand:SI 0 "nonimmediate_operand" "")
(zero_extract:SI (match_operand:SI 1 "general_operand" "")
(match_operand:SI 2 "general_operand" "")
(match_operand:SI 3 "general_operand" "")))]
@@ -5452,7 +5452,7 @@
"")
(define_insn ""
- [(set (match_operand:SI 0 "general_operand" "=d,d")
+ [(set (match_operand:SI 0 "nonimmediate_operand" "=d,d")
(zero_extract:SI (match_operand:QI 1 "memory_operand" "o,d")
(match_operand:SI 2 "general_operand" "di,di")
(match_operand:SI 3 "general_operand" "di,di")))]
@@ -5512,7 +5512,7 @@
}")
(define_expand "insv"
- [(set (zero_extract:SI (match_operand:SI 0 "general_operand" "")
+ [(set (zero_extract:SI (match_operand:SI 0 "nonimmediate_operand" "")
(match_operand:SI 1 "general_operand" "")
(match_operand:SI 2 "general_operand" ""))
(match_operand:SI 3 "register_operand" ""))]
@@ -5531,7 +5531,7 @@
;; (or at least were intended to do so).
(define_insn ""
- [(set (match_operand:SI 0 "general_operand" "=d")
+ [(set (match_operand:SI 0 "nonimmediate_operand" "=d")
(sign_extract:SI (match_operand:SI 1 "register_operand" "d")
(match_operand:SI 2 "general_operand" "di")
(match_operand:SI 3 "general_operand" "di")))]
@@ -5539,7 +5539,7 @@
"bfexts %1{%b3:%b2},%0")
(define_insn ""
- [(set (match_operand:SI 0 "general_operand" "=d")
+ [(set (match_operand:SI 0 "nonimmediate_operand" "=d")
(zero_extract:SI (match_operand:SI 1 "register_operand" "d")
(match_operand:SI 2 "general_operand" "di")
(match_operand:SI 3 "general_operand" "di")))]
@@ -5654,7 +5654,7 @@
}")
(define_insn "scc0_di"
- [(set (match_operand:QI 0 "general_operand" "=dm")
+ [(set (match_operand:QI 0 "nonimmediate_operand" "=dm")
(match_operator 1 "valid_dbcc_comparison_p"
[(match_operand:DI 2 "general_operand" "ro") (const_int 0)]))]
"! TARGET_5200"
@@ -5664,7 +5664,7 @@
} ")
(define_insn "scc0_di_5200"
- [(set (match_operand:QI 0 "general_operand" "=d")
+ [(set (match_operand:QI 0 "nonimmediate_operand" "=d")
(match_operator 1 "valid_dbcc_comparison_p"
[(match_operand:DI 2 "general_operand" "ro") (const_int 0)]))]
"TARGET_5200"
@@ -5674,7 +5674,7 @@
} ")
(define_insn "scc_di"
- [(set (match_operand:QI 0 "general_operand" "=dm,dm")
+ [(set (match_operand:QI 0 "nonimmediate_operand" "=dm,dm")
(match_operator 1 "valid_dbcc_comparison_p"
[(match_operand:DI 2 "general_operand" "ro,r")
(match_operand:DI 3 "general_operand" "r,ro")]))]
@@ -5685,7 +5685,7 @@
} ")
(define_insn "scc_di_5200"
- [(set (match_operand:QI 0 "general_operand" "=d,d")
+ [(set (match_operand:QI 0 "nonimmediate_operand" "=d,d")
(match_operator 1 "valid_dbcc_comparison_p"
[(match_operand:DI 2 "general_operand" "ro,r")
(match_operand:DI 3 "general_operand" "r,ro")]))]
@@ -6560,7 +6560,7 @@
(define_insn ""
[(set (pc)
(if_then_else
- (ne (match_operand:HI 0 "general_operand" "+d*g")
+ (ne (match_operand:HI 0 "nonimmediate_operand" "+d*g")
(const_int 0))
(label_ref (match_operand 1 "" ""))
(pc)))
@@ -6603,7 +6603,7 @@
(define_insn ""
[(set (pc)
(if_then_else
- (ne (match_operand:SI 0 "general_operand" "+d*g")
+ (ne (match_operand:SI 0 "nonimmediate_operand" "+d*g")
(const_int 0))
(label_ref (match_operand 1 "" ""))
(pc)))
@@ -6649,7 +6649,7 @@
(define_insn ""
[(set (pc)
(if_then_else
- (ge (plus:HI (match_operand:HI 0 "general_operand" "+d*am")
+ (ge (plus:HI (match_operand:HI 0 "nonimmediate_operand" "+d*am")
(const_int -1))
(const_int 0))
(label_ref (match_operand 1 "" ""))
@@ -6694,7 +6694,7 @@
(define_expand "decrement_and_branch_until_zero"
[(parallel [(set (pc)
(if_then_else
- (ge (plus:SI (match_operand:SI 0 "general_operand" "")
+ (ge (plus:SI (match_operand:SI 0 "nonimmediate_operand" "")
(const_int -1))
(const_int 0))
(label_ref (match_operand 1 "" ""))
@@ -6708,7 +6708,7 @@
(define_insn ""
[(set (pc)
(if_then_else
- (ge (plus:SI (match_operand:SI 0 "general_operand" "+d*am")
+ (ge (plus:SI (match_operand:SI 0 "nonimmediate_operand" "+d*am")
(const_int -1))
(const_int 0))
(label_ref (match_operand 1 "" ""))
@@ -6997,7 +6997,7 @@
;; This should not be used unless the add/sub insns can't be.
(define_insn ""
- [(set (match_operand:SI 0 "general_operand" "=a")
+ [(set (match_operand:SI 0 "nonimmediate_operand" "=a")
(match_operand:QI 1 "address_operand" "p"))]
""
"*
@@ -7464,7 +7464,7 @@
}")
(define_insn "extendsfxf2"
- [(set (match_operand:XF 0 "general_operand" "=fm,f")
+ [(set (match_operand:XF 0 "nonimmediate_operand" "=fm,f")
(float_extend:XF (match_operand:SF 1 "general_operand" "f,rmF")))]
"TARGET_68881"
"*
@@ -7496,7 +7496,7 @@
(define_insn "extenddfxf2"
- [(set (match_operand:XF 0 "general_operand" "=fm,f")
+ [(set (match_operand:XF 0 "nonimmediate_operand" "=fm,f")
(float_extend:XF
(match_operand:DF 1 "general_operand" "f,rmE")))]
"TARGET_68881"
@@ -7532,7 +7532,7 @@
}")
(define_insn "truncxfdf2"
- [(set (match_operand:DF 0 "general_operand" "=m,!r")
+ [(set (match_operand:DF 0 "nonimmediate_operand" "=m,!r")
(float_truncate:DF
(match_operand:XF 1 "general_operand" "f,f")))]
"TARGET_68881"
@@ -7548,32 +7548,32 @@
}")
(define_insn "truncxfsf2"
- [(set (match_operand:SF 0 "general_operand" "=dm")
+ [(set (match_operand:SF 0 "nonimmediate_operand" "=dm")
(float_truncate:SF
(match_operand:XF 1 "general_operand" "f")))]
"TARGET_68881"
"fmove%.s %f1,%0")
(define_insn "floatsixf2"
- [(set (match_operand:XF 0 "general_operand" "=f")
+ [(set (match_operand:XF 0 "nonimmediate_operand" "=f")
(float:XF (match_operand:SI 1 "general_operand" "dmi")))]
"TARGET_68881"
"fmove%.l %1,%0")
(define_insn "floathixf2"
- [(set (match_operand:XF 0 "general_operand" "=f")
+ [(set (match_operand:XF 0 "nonimmediate_operand" "=f")
(float:XF (match_operand:HI 1 "general_operand" "dmn")))]
"TARGET_68881"
"fmove%.w %1,%0")
(define_insn "floatqixf2"
- [(set (match_operand:XF 0 "general_operand" "=f")
+ [(set (match_operand:XF 0 "nonimmediate_operand" "=f")
(float:XF (match_operand:QI 1 "general_operand" "dmn")))]
"TARGET_68881"
"fmove%.b %1,%0")
(define_insn "ftruncxf2"
- [(set (match_operand:XF 0 "general_operand" "=f")
+ [(set (match_operand:XF 0 "nonimmediate_operand" "=f")
(fix:XF (match_operand:XF 1 "general_operand" "fFm")))]
"TARGET_68881"
"*
@@ -7584,46 +7584,46 @@
}")
(define_insn "fixxfqi2"
- [(set (match_operand:QI 0 "general_operand" "=dm")
+ [(set (match_operand:QI 0 "nonimmediate_operand" "=dm")
(fix:QI (match_operand:XF 1 "general_operand" "f")))]
"TARGET_68881"
"fmove%.b %1,%0")
(define_insn "fixxfhi2"
- [(set (match_operand:HI 0 "general_operand" "=dm")
+ [(set (match_operand:HI 0 "nonimmediate_operand" "=dm")
(fix:HI (match_operand:XF 1 "general_operand" "f")))]
"TARGET_68881"
"fmove%.w %1,%0")
(define_insn "fixxfsi2"
- [(set (match_operand:SI 0 "general_operand" "=dm")
+ [(set (match_operand:SI 0 "nonimmediate_operand" "=dm")
(fix:SI (match_operand:XF 1 "general_operand" "f")))]
"TARGET_68881"
"fmove%.l %1,%0")
(define_insn ""
- [(set (match_operand:XF 0 "general_operand" "=f")
+ [(set (match_operand:XF 0 "nonimmediate_operand" "=f")
(plus:XF (float:XF (match_operand:SI 2 "general_operand" "dmi"))
(match_operand:XF 1 "nonimmediate_operand" "0")))]
"TARGET_68881"
"fadd%.l %2,%0")
(define_insn ""
- [(set (match_operand:XF 0 "general_operand" "=f")
+ [(set (match_operand:XF 0 "nonimmediate_operand" "=f")
(plus:XF (float:XF (match_operand:HI 2 "general_operand" "dmn"))
(match_operand:XF 1 "nonimmediate_operand" "0")))]
"TARGET_68881"
"fadd%.w %2,%0")
(define_insn ""
- [(set (match_operand:XF 0 "general_operand" "=f")
+ [(set (match_operand:XF 0 "nonimmediate_operand" "=f")
(plus:XF (float:XF (match_operand:QI 2 "general_operand" "dmn"))
(match_operand:XF 1 "general_operand" "0")))]
"TARGET_68881"
"fadd%.b %2,%0")
(define_insn "addxf3"
- [(set (match_operand:XF 0 "general_operand" "=f")
+ [(set (match_operand:XF 0 "nonimmediate_operand" "=f")
(plus:XF (match_operand:XF 1 "nonimmediate_operand" "%0")
(match_operand:XF 2 "nonimmediate_operand" "fm")))]
"TARGET_68881"
@@ -7635,28 +7635,28 @@
}")
(define_insn ""
- [(set (match_operand:XF 0 "general_operand" "=f")
+ [(set (match_operand:XF 0 "nonimmediate_operand" "=f")
(minus:XF (match_operand:XF 1 "nonimmediate_operand" "0")
(float:XF (match_operand:SI 2 "general_operand" "dmi"))))]
"TARGET_68881"
"fsub%.l %2,%0")
(define_insn ""
- [(set (match_operand:XF 0 "general_operand" "=f")
+ [(set (match_operand:XF 0 "nonimmediate_operand" "=f")
(minus:XF (match_operand:XF 1 "nonimmediate_operand" "0")
(float:XF (match_operand:HI 2 "general_operand" "dmn"))))]
"TARGET_68881"
"fsub%.w %2,%0")
(define_insn ""
- [(set (match_operand:XF 0 "general_operand" "=f")
+ [(set (match_operand:XF 0 "nonimmediate_operand" "=f")
(minus:XF (match_operand:XF 1 "nonimmediate_operand" "0")
(float:XF (match_operand:QI 2 "general_operand" "dmn"))))]
"TARGET_68881"
"fsub%.b %2,%0")
(define_insn "subxf3"
- [(set (match_operand:XF 0 "general_operand" "=f")
+ [(set (match_operand:XF 0 "nonimmediate_operand" "=f")
(minus:XF (match_operand:XF 1 "nonimmediate_operand" "0")
(match_operand:XF 2 "nonimmediate_operand" "fm")))]
"TARGET_68881"
@@ -7668,28 +7668,28 @@
}")
(define_insn ""
- [(set (match_operand:XF 0 "general_operand" "=f")
+ [(set (match_operand:XF 0 "nonimmediate_operand" "=f")
(mult:XF (float:XF (match_operand:SI 2 "general_operand" "dmi"))
(match_operand:XF 1 "nonimmediate_operand" "0")))]
"TARGET_68881"
"fmul%.l %2,%0")
(define_insn ""
- [(set (match_operand:XF 0 "general_operand" "=f")
+ [(set (match_operand:XF 0 "nonimmediate_operand" "=f")
(mult:XF (float:XF (match_operand:HI 2 "general_operand" "dmn"))
(match_operand:XF 1 "nonimmediate_operand" "0")))]
"TARGET_68881"
"fmul%.w %2,%0")
(define_insn ""
- [(set (match_operand:XF 0 "general_operand" "=f")
+ [(set (match_operand:XF 0 "nonimmediate_operand" "=f")
(mult:XF (float:XF (match_operand:QI 2 "general_operand" "dmn"))
(match_operand:XF 1 "nonimmediate_operand" "0")))]
"TARGET_68881"
"fmul%.b %2,%0")
(define_insn "mulxf3"
- [(set (match_operand:XF 0 "general_operand" "=f")
+ [(set (match_operand:XF 0 "nonimmediate_operand" "=f")
(mult:XF (match_operand:XF 1 "nonimmediate_operand" "%0")
(match_operand:XF 2 "nonimmediate_operand" "fm")))]
"TARGET_68881"
@@ -7701,28 +7701,28 @@
}")
(define_insn ""
- [(set (match_operand:XF 0 "general_operand" "=f")
+ [(set (match_operand:XF 0 "nonimmediate_operand" "=f")
(div:XF (match_operand:XF 1 "nonimmediate_operand" "0")
(float:XF (match_operand:SI 2 "general_operand" "dmi"))))]
"TARGET_68881"
"fdiv%.l %2,%0")
(define_insn ""
- [(set (match_operand:XF 0 "general_operand" "=f")
+ [(set (match_operand:XF 0 "nonimmediate_operand" "=f")
(div:XF (match_operand:XF 1 "nonimmediate_operand" "0")
(float:XF (match_operand:HI 2 "general_operand" "dmn"))))]
"TARGET_68881"
"fdiv%.w %2,%0")
(define_insn ""
- [(set (match_operand:XF 0 "general_operand" "=f")
+ [(set (match_operand:XF 0 "nonimmediate_operand" "=f")
(div:XF (match_operand:XF 1 "nonimmediate_operand" "0")
(float:XF (match_operand:QI 2 "general_operand" "dmn"))))]
"TARGET_68881"
"fdiv%.b %2,%0")
(define_insn "divxf3"
- [(set (match_operand:XF 0 "general_operand" "=f")
+ [(set (match_operand:XF 0 "nonimmediate_operand" "=f")
(div:XF (match_operand:XF 1 "nonimmediate_operand" "0")
(match_operand:XF 2 "nonimmediate_operand" "fm")))]
"TARGET_68881"
@@ -7734,7 +7734,7 @@
}")
(define_expand "negxf2"
- [(set (match_operand:XF 0 "general_operand" "")
+ [(set (match_operand:XF 0 "nonimmediate_operand" "")
(neg:XF (match_operand:XF 1 "nonimmediate_operand" "")))]
""
"
@@ -7772,7 +7772,7 @@
}")
(define_insn "negxf2_68881"
- [(set (match_operand:XF 0 "general_operand" "=f")
+ [(set (match_operand:XF 0 "nonimmediate_operand" "=f")
(neg:XF (match_operand:XF 1 "nonimmediate_operand" "fm")))]
"TARGET_68881"
"*
@@ -7783,7 +7783,7 @@
}")
(define_expand "absxf2"
- [(set (match_operand:XF 0 "general_operand" "")
+ [(set (match_operand:XF 0 "nonimmediate_operand" "")
(abs:XF (match_operand:XF 1 "nonimmediate_operand" "")))]
""
"
@@ -7821,7 +7821,7 @@
}")
(define_insn "absxf2_68881"
- [(set (match_operand:XF 0 "general_operand" "=f")
+ [(set (match_operand:XF 0 "nonimmediate_operand" "=f")
(abs:XF (match_operand:XF 1 "nonimmediate_operand" "fm")))]
"TARGET_68881"
"*
@@ -7832,13 +7832,13 @@
}")
(define_insn "sqrtxf2"
- [(set (match_operand:XF 0 "general_operand" "=f")
+ [(set (match_operand:XF 0 "nonimmediate_operand" "=f")
(sqrt:XF (match_operand:XF 1 "nonimmediate_operand" "fm")))]
"TARGET_68881"
"fsqrt%.x %1,%0")
(define_insn "sinsf2"
- [(set (match_operand:SF 0 "general_operand" "=f")
+ [(set (match_operand:SF 0 "nonimmediate_operand" "=f")
(unspec:SF [(match_operand:SF 1 "general_operand" "fm")] 1))]
"TARGET_68881 && flag_fast_math"
"*
@@ -7850,7 +7850,7 @@
}")
(define_insn "sindf2"
- [(set (match_operand:DF 0 "general_operand" "=f")
+ [(set (match_operand:DF 0 "nonimmediate_operand" "=f")
(unspec:DF [(match_operand:DF 1 "general_operand" "fm")] 1))]
"TARGET_68881 && flag_fast_math"
"*
@@ -7862,13 +7862,13 @@
}")
(define_insn "sinxf2"
- [(set (match_operand:XF 0 "general_operand" "=f")
+ [(set (match_operand:XF 0 "nonimmediate_operand" "=f")
(unspec:XF [(match_operand:XF 1 "nonimmediate_operand" "fm")] 1))]
"TARGET_68881 && flag_fast_math"
"fsin%.x %1,%0")
(define_insn "cossf2"
- [(set (match_operand:SF 0 "general_operand" "=f")
+ [(set (match_operand:SF 0 "nonimmediate_operand" "=f")
(unspec:SF [(match_operand:SF 1 "general_operand" "fm")] 2))]
"TARGET_68881 && flag_fast_math"
"*
@@ -7880,7 +7880,7 @@
}")
(define_insn "cosdf2"
- [(set (match_operand:DF 0 "general_operand" "=f")
+ [(set (match_operand:DF 0 "nonimmediate_operand" "=f")
(unspec:DF [(match_operand:DF 1 "general_operand" "fm")] 2))]
"TARGET_68881 && flag_fast_math"
"*
@@ -7892,7 +7892,7 @@
}")
(define_insn "cosxf2"
- [(set (match_operand:XF 0 "general_operand" "=f")
+ [(set (match_operand:XF 0 "nonimmediate_operand" "=f")
(unspec:XF [(match_operand:XF 1 "nonimmediate_operand" "fm")] 2))]
"TARGET_68881 && flag_fast_math"
"fcos%.x %1,%0")
diff --git a/gcc/config/m68k/m68kv4.h b/gcc/config/m68k/m68kv4.h
index dafe7fdedfa..9bdc4877685 100644
--- a/gcc/config/m68k/m68kv4.h
+++ b/gcc/config/m68k/m68kv4.h
@@ -27,11 +27,6 @@ Boston, MA 02111-1307, USA. */
#include "m68k/sgs.h" /* The m68k/SVR4 assembler is SGS based */
-/* The SGS assembler requires a special definition of
- ASM_IDENTIFY_GCC. We combine the m68k/sgs.h and the svr4.h
- definitions below. */
-#undef ASM_IDENTIFY_GCC
-
#include "svr4.h" /* Pick up the generic SVR4 macros */
/* See m68k.h. 7 means 68020 with 68881. */
@@ -40,19 +35,6 @@ Boston, MA 02111-1307, USA. */
#define TARGET_DEFAULT (MASK_BITFIELD|MASK_68881|MASK_68020)
#endif
-/* When using an SGS assembler, modify the name of the artificial label which
- identifies this file as having been compiled with gcc, and the macro that
- emits such a label in the assembly output, to use '%' rather than '.' */
-
-#undef ASM_IDENTIFY_GCC
-#define ASM_IDENTIFY_GCC(FILE) \
-do \
- { \
- if (write_symbols != DBX_DEBUG) \
- fputs ("gcc2_compiled%:\n", FILE); \
- } \
-while (0)
-
/* Override the definition of NO_DOLLAR_IN_LABEL in svr4.h, for special
g++ assembler names. When this is defined, g++ uses embedded '.'
characters and some m68k assemblers have problems with this. The
diff --git a/gcc/config/m68k/mot3300.h b/gcc/config/m68k/mot3300.h
index 9c9a0994426..fd914815d64 100644
--- a/gcc/config/m68k/mot3300.h
+++ b/gcc/config/m68k/mot3300.h
@@ -38,6 +38,9 @@ Boston, MA 02111-1307, USA. */
#include "m68k/m68k.h"
+/* GDB expects a slightly different marker on this target. */
+#define STABS_GCC_MARKER "gcc2_compiled%"
+
/* See m68k.h. 0407 means 68020-68040. */
#ifndef TARGET_DEFAULT
@@ -264,11 +267,6 @@ dtors_section () \
}
#endif /* USE_GAS */
-/* The sysV68 assembler does not accept dots in labels.
- Let's use percent instead */
-
-#define ASM_IDENTIFY_GCC(FILE) fputs("gcc2_compiled%:\n", FILE)
-
/* Names to predefine in the preprocessor for this target machine. */
/* ihnp4!lmayk!lgm@eddie.mit.edu says mc68000 and m68k should not be here,
on the other hand I don't care what he says. */
diff --git a/gcc/config/m68k/news.h b/gcc/config/m68k/news.h
index 5661e87ae03..25e820e772b 100644
--- a/gcc/config/m68k/news.h
+++ b/gcc/config/m68k/news.h
@@ -139,11 +139,6 @@ Boston, MA 02111-1307, USA. */
#ifdef MOTOROLA
-/* Don't try to define `gcc_compiled.' since the assembler does not
- accept symbols with periods. This is no real loss since GDB only
- really needs it for parms passed in registers. */
-#define ASM_IDENTIFY_GCC(FILE)
-
#define FUNCTION_PROLOGUE(FILE, SIZE) \
{ register int regno; \
register int mask = 0; \
diff --git a/gcc/config/m68k/rtems.h b/gcc/config/m68k/rtems.h
index 0b0fb82b88d..3cc5fa8b562 100644
--- a/gcc/config/m68k/rtems.h
+++ b/gcc/config/m68k/rtems.h
@@ -1,5 +1,5 @@
/* Definitions for rtems targeting a Motorola m68k using coff.
- Copyright (C) 1996, 1997, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1997, 2000, 2002 Free Software Foundation, Inc.
Contributed by Joel Sherrill (joel@OARcorp.com).
This file is part of GNU CC.
@@ -24,7 +24,7 @@ Boston, MA 02111-1307, USA. */
/* Specify predefined symbols in preprocessor. */
#undef CPP_PREDEFINES
-#define CPP_PREDEFINES "-Dmc68000 -Drtems -D__rtems__ \
+#define CPP_PREDEFINES "-Dmc68000 -D__rtems__ \
-Asystem=rtems -Acpu=mc68000 -Acpu=m68k -Amachine=m68k"
/* Generate calls to memcpy, memcmp and memset. */
diff --git a/gcc/config/m68k/rtemself.h b/gcc/config/m68k/rtemself.h
index 6a06d35acce..0fa04d37833 100644
--- a/gcc/config/m68k/rtemself.h
+++ b/gcc/config/m68k/rtemself.h
@@ -1,5 +1,5 @@
/* Definitions for rtems targeting a Motorola m68k using elf.
- Copyright (C) 1999, 2000, National Research Council of Canada.
+ Copyright (C) 1999, 2000, 2002 National Research Council of Canada.
Contributed by Charles-Antoine Gauthier (charles.gauthier@nrc.ca).
This file is part of GNU CC.
@@ -27,8 +27,8 @@ Boston, MA 02111-1307, USA. */
/* Specify predefined symbols in preprocessor. */
#undef CPP_PREDEFINES
-#define CPP_PREDEFINES "-Dmc68000 -Drtems -D__rtems__ -D__ELF__ \
- -Asystem=rtems -Acpu=mc68000 -Acpu=m68k -Amachine=m68k"
+#define CPP_PREDEFINES "-Dmc68000 -D__rtems__ -D__ELF__ \
+ -Asystem=rtems -Acpu=mc68000 -Acpu=m68k -Amachine=m68k -D__USE_INIT_FINI__"
/* Generate calls to memcpy, memcmp and memset. */
#ifndef TARGET_MEM_FUNCTIONS
diff --git a/gcc/config/m68k/sgs.h b/gcc/config/m68k/sgs.h
index 3e4bbb15329..74716cd9e6a 100644
--- a/gcc/config/m68k/sgs.h
+++ b/gcc/config/m68k/sgs.h
@@ -102,13 +102,6 @@ Boston, MA 02111-1307, USA. */
#endif /* defined SUPPORT_SUN_FPA */
-/* When using an SGS assembler, modify the name of the artificial label which
- identifies this file as having been compiled with gcc, and the macro that
- emits such a label in the assembly output, to use '%' rather than '.' */
-
-#define ASM_IDENTIFY_GCC(FILE) \
- { fprintf ((FILE), "%s:\n", "gcc2_compiled%"); }
-
/* This is how to output an assembler line defining an `int' constant. */
/* The SGS assembler doesn't understand ".word". */
diff --git a/gcc/config/m68k/t-m68kbare b/gcc/config/m68k/t-m68kbare
index d334eabfc1e..e0bc595ec12 100644
--- a/gcc/config/m68k/t-m68kbare
+++ b/gcc/config/m68k/t-m68kbare
@@ -15,10 +15,10 @@ xfgnulib.c: $(srcdir)/config/m68k/fpgnulib.c
echo '#define EXTFLOAT' > xfgnulib.c
cat $(srcdir)/config/m68k/fpgnulib.c >> xfgnulib.c
-MULTILIB_OPTIONS = m68000/m68020/m5200/mcpu32 m68881/msoft-float
+MULTILIB_OPTIONS = m68000/m68020/m5200/mcpu32/m68040/m68060 m68881/msoft-float
MULTILIB_DIRNAMES =
-MULTILIB_MATCHES = m68000=mc68000 m68000=m68302 mcpu32=m68332 m68020=mc68020 m68020=m68040 m68020=m68060
-MULTILIB_EXCEPTIONS = m68000/msoft-float m5200/m68881 m5200/msoft-float mcpu32/m68881 mcpu32/msoft-float
+MULTILIB_MATCHES = m68000=mc68000 m68000=m68302 mcpu32=m68332 m68020=mc68020
+MULTILIB_EXCEPTIONS = m68000/msoft-float m5200/m68881 m5200/msoft-float mcpu32/m68881 mcpu32/msoft-float m68040/m68681 m68060/m68681
LIBGCC = stmp-multilib
INSTALL_LIBGCC = install-multilib
diff --git a/gcc/config/m68k/t-openbsd b/gcc/config/m68k/t-openbsd
new file mode 100644
index 00000000000..24f9a43b000
--- /dev/null
+++ b/gcc/config/m68k/t-openbsd
@@ -0,0 +1,5 @@
+# gdb gets confused if pic code is linked with non pic
+# We cope by building all variants of libgcc.
+MULTILIB_OPTIONS = fpic/fPIC
+LIBGCC = stmp-multilib
+INSTALL_LIBGCC = install-multilib
diff --git a/gcc/config/m68k/tower-as.h b/gcc/config/m68k/tower-as.h
index 2ab94221ad3..bb03b058a82 100644
--- a/gcc/config/m68k/tower-as.h
+++ b/gcc/config/m68k/tower-as.h
@@ -67,11 +67,6 @@ Boston, MA 02111-1307, USA. */
#define SDB_DEBUGGING_INFO
-/* This is only useful if gdb is changed, but doesn't harm anyway. */
-
-#define ASM_IDENTIFY_GCC(FILE) \
- fprintf (FILE, "gcc2_compiled%%:\n")
-
/* All the ASM_OUTPUT macros need to conform to the Tower as syntax. */
#define ASM_OUTPUT_SOURCE_FILENAME(FILE, FILENAME) \
diff --git a/gcc/config/m68k/xm-m68k.h b/gcc/config/m68k/xm-m68k.h
index 757c9af67a1..b5a5420bc3f 100644
--- a/gcc/config/m68k/xm-m68k.h
+++ b/gcc/config/m68k/xm-m68k.h
@@ -18,11 +18,6 @@ along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-
-/* #defines that need visibility everywhere. */
-#define FALSE 0
-#define TRUE 1
-
/* This describes the machine the compiler is hosted on. */
#define HOST_BITS_PER_CHAR 8
#define HOST_BITS_PER_SHORT 16
diff --git a/gcc/config/m88k/m88k.c b/gcc/config/m88k/m88k.c
index beeb8fcfeb7..2e788483166 100644
--- a/gcc/config/m88k/m88k.c
+++ b/gcc/config/m88k/m88k.c
@@ -29,7 +29,6 @@ Boston, MA 02111-1307, USA. */
#include "real.h"
#include "insn-config.h"
#include "conditions.h"
-#include "insn-flags.h"
#include "output.h"
#include "insn-attr.h"
#include "tree.h"
@@ -1573,9 +1572,8 @@ output_file_start (file, f_options, f_len, W_options, W_len)
&& TARGET_SVR4)
fprintf (file, "%s\n", REQUIRES_88110_ASM_OP);
output_file_directive (file, main_input_filename);
- /* Switch to the data section so that the coffsem symbol and the
- gcc2_compiled. symbol aren't in the text section. */
- data_section ();
+ /* Switch to the data section so that the coffsem symbol
+ isn't in the text section. */
ASM_COFFSEM (file);
if (TARGET_IDENTIFY_REVISION)
diff --git a/gcc/config/m88k/xm-m88k.h b/gcc/config/m88k/xm-m88k.h
index 4568fd5f989..1c6882bd206 100644
--- a/gcc/config/m88k/xm-m88k.h
+++ b/gcc/config/m88k/xm-m88k.h
@@ -20,11 +20,6 @@ along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-
-/* #defines that need visibility everywhere. */
-#define FALSE 0
-#define TRUE 1
-
/* This describes the machine the compiler is hosted on. */
#define HOST_BITS_PER_CHAR 8
#define HOST_BITS_PER_SHORT 16
diff --git a/gcc/config/mcore/mcore-elf.h b/gcc/config/mcore/mcore-elf.h
index fce4e8b2850..6058d27dae2 100644
--- a/gcc/config/mcore/mcore-elf.h
+++ b/gcc/config/mcore/mcore-elf.h
@@ -55,20 +55,6 @@ Boston, MA 02111-1307, USA. */
#undef DBX_REGISTER_NUMBER
#define DBX_REGISTER_NUMBER(REGNO) (REGNO)
-/* When using stabs, gcc2_compiled must be a stabs entry, not an
- ordinary symbol, or gdb won't see it. The stabs entry must be
- before the N_SO in order for gdb to find it. */
-#undef ASM_IDENTIFY_GCC
-#define ASM_IDENTIFY_GCC(FILE) \
-do \
- { \
- if (write_symbols != DBX_DEBUG) \
- fputs ("gcc2_compiled.:\n", FILE); \
- else \
- fputs ("\t.stabs\t\"gcc2_compiled.\", 0x3c, 0, 0, 0\n", FILE); \
- } \
-while (0)
-
/* MCore defines .long and .short to NOT force any alignment.
This lets you misalign as much as you wish. */
#define UNALIGNED_INT_ASM_OP "\t.long\t"
diff --git a/gcc/config/mcore/mcore.c b/gcc/config/mcore/mcore.c
index c4650232fa5..9daa7fef835 100644
--- a/gcc/config/mcore/mcore.c
+++ b/gcc/config/mcore/mcore.c
@@ -30,7 +30,6 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "real.h"
#include "insn-config.h"
#include "conditions.h"
-#include "insn-flags.h"
#include "output.h"
#include "insn-attr.h"
#include "flags.h"
@@ -2634,8 +2633,8 @@ mcore_dependent_simplify_rtx (x, int_op0_mode, last, in_dest, general_simplify)
{
int i;
rtx cond = XEXP(x, 0);
- rtx true = XEXP(x, 1);
- rtx false = XEXP(x, 2);
+ rtx true_rtx = XEXP(x, 1);
+ rtx false_rtx = XEXP(x, 2);
enum rtx_code true_code = GET_CODE (cond);
/* On the mcore, when doing -mcmov-one, we don't want to simplify:
@@ -2648,12 +2647,12 @@ mcore_dependent_simplify_rtx (x, int_op0_mode, last, in_dest, general_simplify)
not typically help. see combine.c, line 4217. BRC */
if (true_code == NE && XEXP (cond, 1) == const0_rtx
- && false == const0_rtx && GET_CODE (true) == CONST_INT
+ && false_rtx == const0_rtx && GET_CODE (true_rtx) == CONST_INT
&& ((1 == nonzero_bits (XEXP (cond, 0), mode)
- && (i = exact_log2 (INTVAL (true))) >= 0)
+ && (i = exact_log2 (INTVAL (true_rtx))) >= 0)
|| ((num_sign_bit_copies (XEXP (cond, 0), mode)
== GET_MODE_BITSIZE (mode))
- && (i = exact_log2 (- INTVAL (true))) >= 0)))
+ && (i = exact_log2 (- INTVAL (true_rtx))) >= 0)))
{
*general_simplify = 0;
return x;
diff --git a/gcc/config/mcore/t-mcore b/gcc/config/mcore/t-mcore
index baeb9d2780a..de526942f96 100644
--- a/gcc/config/mcore/t-mcore
+++ b/gcc/config/mcore/t-mcore
@@ -38,9 +38,6 @@ TARGET_LIBGCC2_CFLAGS=-O3 -DNO_FLOATLIB_FIXUNSDFSI #-msifilter
# We have values for float.h.
CROSS_FLOAT_H = $(srcdir)/config/mcore/gfloat.h
-# let the library provider supply an <assert.h>
-INSTALL_ASSERT_H=
-
# If support for -m4align is ever re-enabled then comment out the
# following line and uncomment the mutlilib lines below.
diff --git a/gcc/config/mcore/t-mcore-pe b/gcc/config/mcore/t-mcore-pe
index 6955c9905fa..c055a711399 100644
--- a/gcc/config/mcore/t-mcore-pe
+++ b/gcc/config/mcore/t-mcore-pe
@@ -29,9 +29,6 @@ TARGET_LIBGCC2_CFLAGS=-O3 -DNO_FLOATLIB_FIXUNSDFSI #-msifilter
# We have values for float.h.
CROSS_FLOAT_H = $(srcdir)/config/mcore/gfloat.h
-# let the library provider supply an <assert.h>
-INSTALL_ASSERT_H=
-
MULTILIB_OPTIONS = mbig-endian/mlittle-endian m210/m340
MULTILIB_DIRNAMES = big little m210 m340
MULTILIB_MATCHES =
diff --git a/gcc/config/mcore/xm-mcore.h b/gcc/config/mcore/xm-mcore.h
index 46b4eff5fd0..5210ee672b8 100644
--- a/gcc/config/mcore/xm-mcore.h
+++ b/gcc/config/mcore/xm-mcore.h
@@ -17,10 +17,6 @@ You should have received a copy of the GNU General Public License
along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
-/* #defines that need visibility everywhere. */
-#define FALSE 0
-#define TRUE 1
-
/* This describes the machine the compiler is hosted on. */
#define HOST_BITS_PER_CHAR 8
#define HOST_BITS_PER_SHORT 16
@@ -39,4 +35,3 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
/* Arguments to use with `exit'. */
#define SUCCESS_EXIT_CODE 0
#define FATAL_EXIT_CODE 33
-
diff --git a/gcc/config/mips/abi64.h b/gcc/config/mips/abi64.h
index 95e7d82b9fc..b260d6ffc2e 100644
--- a/gcc/config/mips/abi64.h
+++ b/gcc/config/mips/abi64.h
@@ -1,5 +1,5 @@
/* Definitions of target machine for GNU compiler. 64 bit ABI support.
- Copyright (C) 1994, 1995, 1996, 1998, 1999 Free Software Foundation, Inc.
+ Copyright (C) 1994, 1995, 1996, 1998, 1999, 2001 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -86,12 +86,17 @@ Boston, MA 02111-1307, USA. */
|| GET_MODE_CLASS (MODE) == MODE_INT))) \
? downward : upward))
+/* Under the old (i.e., 32 and O64 ABIs) all BLKmode objects are
+ returned in memory. Under the new (N32 and 64-bit MIPS ABIs) small
+ structures are returned in a register. Objects with varying size
+ must still be returned in memory, of course. */
#undef RETURN_IN_MEMORY
-#define RETURN_IN_MEMORY(TYPE) \
- ((mips_abi == ABI_32 || mips_abi == ABI_O64) \
- ? TYPE_MODE (TYPE) == BLKmode \
- : (int_size_in_bytes (TYPE) \
- > (2 * UNITS_PER_WORD)))
+#define RETURN_IN_MEMORY(TYPE) \
+ ((mips_abi == ABI_32 || mips_abi == ABI_O64) \
+ ? TYPE_MODE (TYPE) == BLKmode \
+ : ((int_size_in_bytes (TYPE) \
+ > (2 * UNITS_PER_WORD)) \
+ || (int_size_in_bytes (TYPE) == -1)))
#ifdef ANSI_PROTOTYPES
union tree_node;
diff --git a/gcc/config/mips/ecoff.h b/gcc/config/mips/ecoff.h
index dcc00a4b4b8..3297d7d4321 100644
--- a/gcc/config/mips/ecoff.h
+++ b/gcc/config/mips/ecoff.h
@@ -32,4 +32,5 @@ Boston, MA 02111-1307, USA. */
/* Don't assume anything about startfiles. The linker script will load the
appropriate startfiles. */
+#undef STARTFILE_SPEC
#define STARTFILE_SPEC ""
diff --git a/gcc/config/mips/elf.h b/gcc/config/mips/elf.h
index fa2a285239d..34d26c773da 100644
--- a/gcc/config/mips/elf.h
+++ b/gcc/config/mips/elf.h
@@ -53,6 +53,7 @@ do { \
specified using the `__attribute__ ((aligned (N)))' construct. If
not defined, the default value is `BIGGEST_ALIGNMENT'. */
+#undef MAX_OFILE_ALIGNMENT
#define MAX_OFILE_ALIGNMENT (32768*8)
/* A C statement to output something to the assembler file to switch to section
@@ -60,6 +61,7 @@ do { \
NULL_TREE. Some target formats do not support arbitrary sections. Do not
define this macro in such cases. */
+#undef ASM_OUTPUT_SECTION_NAME
#define ASM_OUTPUT_SECTION_NAME(F, DECL, NAME, RELOC) \
do { \
extern FILE *asm_out_text_file; \
@@ -191,6 +193,7 @@ do { \
but until that support is generally available, the 'if' below
should serve. */
+#undef ASM_WEAKEN_LABEL
#define ASM_WEAKEN_LABEL(FILE,NAME) ASM_OUTPUT_WEAK_ALIAS(FILE,NAME,0)
#define ASM_OUTPUT_WEAK_ALIAS(FILE,NAME,VALUE) \
do { \
@@ -210,6 +213,7 @@ do { \
#define MAKE_DECL_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 1)
#undef UNIQUE_SECTION_P
#define UNIQUE_SECTION_P(DECL) (DECL_ONE_ONLY (DECL))
+#undef UNIQUE_SECTION
#define UNIQUE_SECTION(DECL,RELOC) \
do { \
int len, size, sec; \
@@ -331,6 +335,7 @@ void FN () \
/* A C statement (sans semicolon) to output an element in the table of
global constructors. */
+#undef ASM_OUTPUT_CONSTRUCTOR
#define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME) \
do { \
ctors_section (); \
@@ -342,6 +347,7 @@ void FN () \
/* A C statement (sans semicolon) to output an element in the table of
global destructors. */
+#undef ASM_OUTPUT_DESTRUCTOR
#define ASM_OUTPUT_DESTRUCTOR(FILE,NAME) \
do { \
dtors_section (); \
diff --git a/gcc/config/mips/elf64.h b/gcc/config/mips/elf64.h
index f0b00372230..0636200ed4b 100644
--- a/gcc/config/mips/elf64.h
+++ b/gcc/config/mips/elf64.h
@@ -54,6 +54,7 @@ Boston, MA 02111-1307, USA. */
specified using the `__attribute__ ((aligned (N)))' construct. If
not defined, the default value is `BIGGEST_ALIGNMENT'. */
+#undef MAX_OFILE_ALIGNMENT
#define MAX_OFILE_ALIGNMENT (32768*8)
/* We need to use .esize and .etype instead of .size and .type to
@@ -77,6 +78,7 @@ do { \
NULL_TREE. Some target formats do not support arbitrary sections. Do not
define this macro in such cases. */
+#undef ASM_OUTPUT_SECTION_NAME
#define ASM_OUTPUT_SECTION_NAME(F, DECL, NAME, RELOC) \
do { \
extern FILE *asm_out_text_file; \
@@ -172,6 +174,7 @@ do { \
but until that support is generally available, the 'if' below
should serve. */
+#undef ASM_WEAKEN_LABEL
#define ASM_WEAKEN_LABEL(FILE,NAME) ASM_OUTPUT_WEAK_ALIAS(FILE,NAME,0)
#define ASM_OUTPUT_WEAK_ALIAS(FILE,NAME,VALUE) \
do { \
@@ -191,6 +194,7 @@ do { \
#define MAKE_DECL_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 1)
#undef UNIQUE_SECTION_P
#define UNIQUE_SECTION_P(DECL) (DECL_ONE_ONLY (DECL))
+#undef UNIQUE_SECTION
#define UNIQUE_SECTION(DECL,RELOC) \
do { \
int len, size, sec; \
@@ -311,6 +315,7 @@ void FN () \
/* A C statement (sans semicolon) to output an element in the table of
global constructors. */
+#undef ASM_OUTPUT_CONSTRUCTOR
#define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME) \
do { \
ctors_section (); \
@@ -322,6 +327,7 @@ void FN () \
/* A C statement (sans semicolon) to output an element in the table of
global destructors. */
+#undef ASM_OUTPUT_DESTRUCTOR
#define ASM_OUTPUT_DESTRUCTOR(FILE,NAME) \
do { \
dtors_section (); \
diff --git a/gcc/config/mips/gnu.h b/gcc/config/mips/gnu.h
index 599dc805e20..293f2234155 100644
--- a/gcc/config/mips/gnu.h
+++ b/gcc/config/mips/gnu.h
@@ -39,24 +39,6 @@ Boston, MA 02111-1307, USA. */
#undef TARGET_VERSION
#define TARGET_VERSION fprintf (stderr, " (MIPS GNU/ELF)");
-/* Output at beginning of assembler file. */
-/* The .file command should always begin the output. */
-#undef ASM_FILE_START
-#define ASM_FILE_START(FILE) \
- do { \
- mips_asm_file_start (FILE); \
- fprintf (FILE, "\t.version\t\"01.01\"\n"); \
- } while (0)
-
-#undef ASM_FILE_END
-#define ASM_FILE_END(FILE) \
- do { \
- mips_asm_file_end(FILE); \
- if (!flag_no_ident) \
- fprintf ((FILE), "%s\"GCC: (GNU) %s\"\n", \
- IDENT_ASM_OP, version_string); \
- } while (0)
-
#undef ASM_OUTPUT_SOURCE_LINE
#define ASM_OUTPUT_SOURCE_LINE(FILE, LINE) \
do { \
diff --git a/gcc/config/mips/iris4.h b/gcc/config/mips/iris4.h
index abdcda59318..db50f37c6aa 100644
--- a/gcc/config/mips/iris4.h
+++ b/gcc/config/mips/iris4.h
@@ -1,5 +1,5 @@
/* Definitions of target machine for GNU compiler. Iris version 4.
- Copyright (C) 1991, 1993, 1999 Free Software Foundation, Inc.
+ Copyright (C) 1991, 1993, 1999, 2001 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -30,15 +30,16 @@ Boston, MA 02111-1307, USA. */
/* Some assemblers have a bug that causes backslash escaped chars in .ascii
to be misassembled, so we just completely avoid it. */
#undef ASM_OUTPUT_ASCII
-#define ASM_OUTPUT_ASCII(FILE,PTR,LEN) \
-do { \
- const unsigned char *s; \
- int i; \
- for (i = 0, s = (const unsigned char *)(PTR); i < (LEN); s++, i++) \
- { \
- if ((i % 8) == 0) \
- fputs ("\n\t.byte\t", (FILE)); \
- fprintf ((FILE), "%s0x%x", (i%8?",":""), (unsigned)*s); \
- } \
- fputs ("\n", (FILE)); \
+#define ASM_OUTPUT_ASCII(FILE,PTR,LEN) \
+do { \
+ const unsigned char *s_ = (const unsigned char *)(PTR); \
+ unsigned len_ = (LEN); \
+ unsigned i_; \
+ for (i_ = 0; i_ < len_; s_++, i_++) \
+ { \
+ if ((i_ % 8) == 0) \
+ fputs ("\n\t.byte\t", (FILE)); \
+ fprintf ((FILE), "%s0x%x", (i_%8?",":""), *s_); \
+ } \
+ fputs ("\n", (FILE)); \
} while (0)
diff --git a/gcc/config/mips/iris5.h b/gcc/config/mips/iris5.h
index 710a2ba64c8..eab210f9d44 100644
--- a/gcc/config/mips/iris5.h
+++ b/gcc/config/mips/iris5.h
@@ -1,5 +1,6 @@
/* Definitions of target machine for GNU compiler. Iris version 5.
- Copyright (C) 1993, 1995, 1996, 1998, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1993, 1995, 1996, 1998, 2000,
+ 2001 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -51,9 +52,9 @@ Boston, MA 02111-1307, USA. */
#undef WCHAR_TYPE_SIZE
#undef MAX_WCHAR_TYPE_SIZE
-#define WCHAR_TYPE "long int"
-#define WCHAR_TYPE_SIZE LONG_TYPE_SIZE
-#define MAX_WCHAR_TYPE_SIZE MAX_LONG_TYPE_SIZE
+#define WCHAR_TYPE "int"
+#define WCHAR_TYPE_SIZE INT_TYPE_SIZE
+#define MAX_WCHAR_TYPE_SIZE MAX_INT_TYPE_SIZE
#define WORD_SWITCH_TAKES_ARG(STR) \
(DEFAULT_WORD_SWITCH_TAKES_ARG (STR) \
@@ -154,6 +155,10 @@ do { \
fputs (" .text\n", FILE); \
} while (0)
+/* To get unaligned data, we have to turn off auto alignment. */
+#define UNALIGNED_SHORT_ASM_OP "\t.align 0\n\t.half\t"
+#define UNALIGNED_INT_ASM_OP "\t.align 0\n\t.word\t"
+
/* Also do this for libcalls. */
#define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN) \
mips_output_external_libcall (FILE, XSTR (FUN, 0))
@@ -165,3 +170,26 @@ do { \
tree name_tree = get_identifier (NAME); \
TREE_ASM_WRITTEN (name_tree) = 1; \
} while (0)
+
+/* This is how we tell the assembler that a symbol is weak. */
+
+#define ASM_OUTPUT_WEAK_ALIAS(FILE, NAME, VALUE) \
+ do \
+ { \
+ ASM_GLOBALIZE_LABEL (FILE, NAME); \
+ fputs ("\t.weakext\t", FILE); \
+ assemble_name (FILE, NAME); \
+ if (VALUE) \
+ { \
+ fputc (' ', FILE); \
+ assemble_name (FILE, VALUE); \
+ } \
+ fputc ('\n', FILE); \
+ } \
+ while (0)
+
+#define ASM_WEAKEN_LABEL(FILE, NAME) ASM_OUTPUT_WEAK_ALIAS(FILE, NAME, 0)
+
+/* Handle #pragma weak and #pragma pack. */
+#undef HANDLE_SYSV_PRAGMA
+#define HANDLE_SYSV_PRAGMA 1
diff --git a/gcc/config/mips/iris6.h b/gcc/config/mips/iris6.h
index b7a6f8f64e3..5f0ca6aa350 100644
--- a/gcc/config/mips/iris6.h
+++ b/gcc/config/mips/iris6.h
@@ -39,6 +39,26 @@ Boston, MA 02111-1307, USA. */
we avoid creating such labels. */
#define DWARF2_GENERATE_TEXT_SECTION_LABEL 0
+/* wchar_t is defined differently with and without -mabi=64. */
+
+#define NO_BUILTIN_WCHAR_TYPE
+
+#undef WCHAR_TYPE
+#define WCHAR_TYPE (Pmode == DImode ? "int" : "long int")
+
+#undef WCHAR_TYPE_SIZE
+#define WCHAR_TYPE_SIZE 32
+
+/* Same for wint_t. */
+
+#define NO_BUILTIN_WINT_TYPE
+
+#undef WINT_TYPE
+#define WINT_TYPE (Pmode == DImode ? "int" : "long int")
+
+#undef WINT_TYPE_SIZE
+#define WINT_TYPE_SIZE 32
+
/* For Irix 6, -mabi=64 implies TARGET_LONG64. */
/* This is handled in override_options. */
@@ -57,10 +77,12 @@ Boston, MA 02111-1307, USA. */
#undef SUBTARGET_CPP_SIZE_SPEC
#define SUBTARGET_CPP_SIZE_SPEC "\
-%{mabi=32: -D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int} \
-%{mabi=n32: -D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int} \
-%{mabi=64: -D__SIZE_TYPE__=long\\ unsigned\\ int -D__PTRDIFF_TYPE__=long\\ int} \
-%{!mabi*: -D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int}"
+%{mabi=32|mabi=n32: -D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int \
+-D__WCHAR_TYPE__=long\\ int -D__WINT_TYPE__=long\\ int} \
+%{mabi=64: -D__SIZE_TYPE__=long\\ unsigned\\ int -D__PTRDIFF_TYPE__=long\\ int \
+-D__WCHAR_TYPE__=int -D__WINT_TYPE__=int} \
+%{!mabi*: -D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int \
+-D__WCHAR_TYPE__=long\\ int -D__WINT_TYPE__=long\\ int}"
/* We must make -mips3 do what -mlong64 used to do. */
/* ??? If no mipsX option given, but a mabi=X option is, then should set
@@ -128,16 +150,13 @@ Boston, MA 02111-1307, USA. */
#undef MACHINE_TYPE
#define MACHINE_TYPE "SGI running IRIX 6.x"
-/* The Irix 6.0.1 assembler doesn't like labels in the text section, so
- just avoid emitting them. */
-#define ASM_IDENTIFY_GCC(x) ((void)0)
-#define ASM_IDENTIFY_LANGUAGE(x) ((void)0)
-
/* Irix 5 stuff that we don't need for Irix 6. */
/* ??? We do need this for the -mabi=32 switch though. */
#undef ASM_OUTPUT_UNDEF_FUNCTION
#undef ASM_OUTPUT_EXTERNAL_LIBCALL
#undef ASM_DECLARE_FUNCTION_SIZE
+#undef UNALIGNED_SHORT_ASM_OP
+#undef UNALIGNED_INT_ASM_OP
/* Stuff we need for Irix 6 that isn't in Irix 5. */
@@ -188,27 +207,14 @@ Boston, MA 02111-1307, USA. */
#define TYPE_ASM_OP "\t.type\t"
#define SIZE_ASM_OP "\t.size\t"
-/* This is how we tell the assembler that a symbol is weak. */
-
-#define ASM_OUTPUT_WEAK_ALIAS(FILE,NAME,VALUE) \
- do { \
- ASM_GLOBALIZE_LABEL (FILE, NAME); \
- fputs ("\t.weakext\t", FILE); \
- assemble_name (FILE, NAME); \
- if (VALUE) \
- { \
- fputc (' ', FILE); \
- assemble_name (FILE, VALUE); \
- } \
- fputc ('\n', FILE); \
- } while (0)
-
-#define ASM_WEAKEN_LABEL(FILE,NAME) ASM_OUTPUT_WEAK_ALIAS(FILE,NAME,0)
-
/* Irix assembler does not support the init_priority C++ attribute. */
#undef SUPPORTS_INIT_PRIORITY
#define SUPPORTS_INIT_PRIORITY 0
+/* A linker error can empirically be avoided by removing duplicate
+ library search directories. */
+#define LINK_ELIMINATE_DUPLICATE_LDIRECTORIES 1
+
#define POPSECTION_ASM_OP "\t.popsection"
#define DEBUG_INFO_SECTION ".debug_info,0x7000001e,0,0,1"
@@ -269,9 +275,12 @@ Boston, MA 02111-1307, USA. */
#if _MIPS_SZPTR == 64
#define CTORS_SECTION_ASM_OP "\t.section\t.ctors,1,2,0,8"
#define DTORS_SECTION_ASM_OP "\t.section\t.dtors,1,2,0,8"
+#define EH_FRAME_SECTION_ASM_OP "\t.section\t.eh_frame,1,2,0,8"
#else /* _MIPS_SZPTR != 64 */
#define CTORS_SECTION_ASM_OP "\t.section\t.ctors,1,2,0,4"
#define DTORS_SECTION_ASM_OP "\t.section\t.dtors,1,2,0,4"
+#define EH_FRAME_SECTION_ASM_OP "\t.section\t.eh_frame,1,2,0,4"
+
#endif /* _MIPS_SZPTR == 64 */
#else /* ! (defined (CRT_BEGIN) || defined (CRT_END)) */
@@ -281,12 +290,10 @@ Boston, MA 02111-1307, USA. */
(Pmode == DImode ? "\t.section\t.ctors,1,2,0,8" : "\t.section\t.ctors,1,2,0,4")
#define DTORS_SECTION_ASM_OP \
(Pmode == DImode ? "\t.section\t.dtors,1,2,0,8" : "\t.section\t.dtors,1,2,0,4")
+#define EH_FRAME_SECTION_ASM_OP \
+ (Pmode == DImode ? "\t.section\t.eh_frame,1,2,0,8" : "\t.section\t.eh_frame,1,2,0,4")
#endif /* defined (CRT_BEGIN) || defined (CRT_END) */
-/* dwarf2out will handle padding this data properly. We definitely don't
- want it 8-byte aligned on n32. */
-#define EH_FRAME_SECTION_ASM_OP "\t.section\t.eh_frame,1,2,0,1"
-
/* A default list of other sections which we might be "in" at any given
time. For targets that use additional sections (e.g. .tdesc) you
should override this definition in the target-specific file which
diff --git a/gcc/config/mips/irix6-libc-compat.c b/gcc/config/mips/irix6-libc-compat.c
new file mode 100644
index 00000000000..cc81ab5a109
--- /dev/null
+++ b/gcc/config/mips/irix6-libc-compat.c
@@ -0,0 +1,140 @@
+/* Compensate for inconsistent structure passing conventions on IRIX 6. */
+/* Compile this one with gcc. */
+/* Copyright (C) 2001 Free Software Foundation, Inc.
+
+This file is part of GNU CC.
+
+GNU CC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+In addition to the permissions in the GNU General Public License, the
+Free Software Foundation gives you unlimited permission to link the
+compiled version of this file into combinations with other programs,
+and to distribute those combinations without any restriction coming
+from the use of this file. (The General Public License restrictions
+do apply in other respects; for example, they cover modification of
+the file, and distribution when not linked into a combine
+executable.)
+
+GNU CC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU CC; see the file COPYING. If not, write to
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA. */
+
+/* GCC doesn't correctly implement the structure and union passing and return
+ conventions of the N32 and N64 ABIs on IRIX 6, as described in the
+ MIPSpro N32 ABI Handbook, ch. 2, Calling Convention Implementations, p.7.
+ The ABI requires that structures (or trailing parts of structures) smaller
+ than 8 bytes (a 64-bit register) are left-justified, whereas GCC
+ right-justifies them.
+
+ While GCC is internally consistent, calling routines compiled with a
+ compiler that does implement the documented ABI (like SGIs MIPSpro C
+ compiler) doesn't work. This is primarily an issue for system libraries
+ like libc. Fortunately, there exist only very few routines that take
+ structure value arguments or return structures by value, so until the
+ underlying bug is fixed, it is possible to work around it by providing
+ wrapper functions for the few affected routines that compensate for the
+ inconsistent alignment.
+
+ These wrappers rely on the fact that e.g. libc contains weak versions of
+ those routines, and the real implementation is provided by _-prefixed
+ variants. So we can provide our own versions, which will only be linked
+ if the application uses any of the affected functions, calling the private
+ variants after shifting the arguments or results as required.
+
+ This is a rewrite of code created by Andy Polyakov. */
+
+#include "config.h"
+#include "system.h"
+
+/* This must only be used for the N32 and N64 ABIs. O32 is correct. */
+
+#if _MIPS_SIM == _ABIN32 || _MIPS_SIM == _ABI64
+
+/* The affected arguments need to be shifted by
+
+ BITS_PER_WORD - (sizeof (arg) * BITS_PER_UNIT).
+
+ Since only 32-bit args and results are involved, the shift count is
+ always 32. */
+#define SHIFT_BITS 32
+
+extern machreg_t _inet_ntoa PARAMS ((machreg_t));
+extern machreg_t _inet_lnaof PARAMS ((machreg_t));
+extern machreg_t _inet_netof PARAMS ((machreg_t));
+extern machreg_t _inet_makeaddr PARAMS ((machreg_t, machreg_t));
+
+/* <arpa/inet.h> has
+
+ char *inet_ntoa (struct in_addr);
+
+ on both IRIX 6.2 and 6.5, with struct in_addr containing a 32-bit int. */
+
+machreg_t
+inet_ntoa (machreg_t in)
+{
+ return _inet_ntoa (in << SHIFT_BITS);
+}
+
+/* <arpa/inet.h> has
+
+ unsigned long inet_lnaof (struct in_addr); (IRIX 6.2)
+ in_addr_t inet_lnaof (struct in_addr); (IRIX 6.5)
+
+ in_addr_t is a 32-bit int. */
+
+machreg_t
+inet_lnaof (machreg_t in)
+{
+ return _inet_lnaof (in << SHIFT_BITS);
+}
+
+/* <arpa/inet.h> has
+
+ unsigned long inet_netof (struct in_addr); (IRIX 6.2)
+ in_addr_t inet_netof (struct in_addr); (IRIX 6.5) */
+
+machreg_t
+inet_netof (machreg_t in)
+{
+ return _inet_netof (in << SHIFT_BITS);
+}
+
+/* <arpa/inet.h> has
+
+ struct in_addr inet_makeaddr (int, int); (IRIX 6.2)
+ struct in_addr inet_makeaddr (in_addr_t, in_addr_t); (IRIX 6.5) */
+
+machreg_t
+inet_makeaddr (machreg_t net, machreg_t lna)
+{
+ return _inet_makeaddr (net, lna) >> SHIFT_BITS;
+}
+
+#if _MIPS_SIM == _ABIN32
+extern machreg_t _semctl PARAMS ((machreg_t, machreg_t, machreg_t, machreg_t));
+
+/* <sys/sem.h> has
+
+ int semctl (int, int, int, ...);
+
+ where the variadic argument is union semun if used. union semun contains
+ an int and two pointers, so the union is already 64 bits wide under the
+ N64 ABI and alignment is not an issue. */
+
+machreg_t
+semctl (machreg_t semid, machreg_t semnum, machreg_t cmd, machreg_t arg)
+{
+ return _semctl(semid, semnum, cmd, arg << SHIFT_BITS);
+}
+#endif /* _ABIN32 */
+
+#endif /* _ABIN32 || _ABI64 */
diff --git a/gcc/config/mips/linux.h b/gcc/config/mips/linux.h
index e6dccb9d414..39adfe36dc7 100644
--- a/gcc/config/mips/linux.h
+++ b/gcc/config/mips/linux.h
@@ -28,16 +28,6 @@ Boston, MA 02111-1307, USA. */
#undef MD_EXEC_PREFIX
#undef MD_STARTFILE_PREFIX
-/* Output at beginning of assembler file. */
-/* The .file command should always begin the output. */
-#undef ASM_FILE_START
-#define ASM_FILE_START(FILE) \
- do { \
- mips_asm_file_start (FILE); \
- fprintf (FILE, "\t.version\t\"01.01\"\n"); \
- } while (0)
-
-
/* Required to keep collect2.c happy */
#undef OBJECT_FORMAT_COFF
@@ -47,6 +37,7 @@ Boston, MA 02111-1307, USA. */
/* Handle #pragma weak and #pragma pack. */
+#undef HANDLE_SYSV_PRAGMA
#define HANDLE_SYSV_PRAGMA 1
/* Use more efficient ``thunks'' to implement C++ vtables. */
@@ -118,6 +109,13 @@ Boston, MA 02111-1307, USA. */
%{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} \
%{pthread:-D_REENTRANT}"
+/* The GNU C++ standard library requires that these macros be defined. */
+#undef CPLUSPLUS_CPP_SPEC
+#define CPLUSPLUS_CPP_SPEC "\
+-D__LANGUAGE_C_PLUS_PLUS -D_LANGUAGE_C_PLUS_PLUS \
+-D_GNU_SOURCE %(cpp) \
+"
+
/* Provide a STARTFILE_SPEC appropriate for GNU/Linux. Here we add
the GNU/Linux magical crtbegin.o file (see crtstuff.c) which
provides part of the support for getting C++ file-scope static
@@ -170,3 +168,92 @@ Boston, MA 02111-1307, USA. */
%{mabi=64: -64} \
%{!fno-PIC:%{!fno-pic:-KPIC}} \
%{fno-PIC:-non_shared} %{fno-pic:-non_shared}"
+
+/* We don't need those nonsenses. */
+#undef INVOKE__main
+#undef CTOR_LIST_BEGIN
+#undef CTOR_LIST_END
+#undef DTOR_LIST_BEGIN
+#undef DTOR_LIST_END
+
+/* The MIPS assembler has different syntax for .set. We set it to
+ .dummy to trap any errors. */
+#undef SET_ASM_OP
+#define SET_ASM_OP "\t.dummy\t"
+
+#undef ASM_OUTPUT_SOURCE_LINE
+#define ASM_OUTPUT_SOURCE_LINE(FILE, LINE) \
+do \
+ { \
+ static int sym_lineno = 1; \
+ fprintf (FILE, "%sLM%d:\n\t%s 68,0,%d,%sLM%d", \
+ LOCAL_LABEL_PREFIX, sym_lineno, ASM_STABN_OP, \
+ LINE, LOCAL_LABEL_PREFIX, sym_lineno); \
+ putc ('-', FILE); \
+ assemble_name (FILE, \
+ XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0));\
+ putc ('\n', FILE); \
+ sym_lineno++; \
+ } \
+while (0)
+
+/* This is how we tell the assembler that two symbols have the
+ same value. */
+#undef ASM_OUTPUT_DEF
+#define ASM_OUTPUT_DEF(FILE,LABEL1,LABEL2) \
+ do { \
+ fprintf ((FILE), "\t"); \
+ assemble_name (FILE, LABEL1); \
+ fprintf (FILE, "="); \
+ assemble_name (FILE, LABEL2); \
+ fprintf (FILE, "\n"); \
+ } while (0)
+
+#undef ASM_OUTPUT_DEFINE_LABEL_DIFFERENCE_SYMBOL
+#define ASM_OUTPUT_DEFINE_LABEL_DIFFERENCE_SYMBOL(FILE, SY, HI, LO) \
+ do { \
+ fputc ('\t', FILE); \
+ assemble_name (FILE, SY); \
+ fputc ('=', FILE); \
+ assemble_name (FILE, HI); \
+ fputc ('-', FILE); \
+ assemble_name (FILE, LO); \
+ } while (0)
+
+#undef ASM_DECLARE_FUNCTION_NAME
+#define ASM_DECLARE_FUNCTION_NAME(STREAM, NAME, DECL) \
+ do { \
+ if (!flag_inhibit_size_directive) \
+ { \
+ fputs ("\t.ent\t", STREAM); \
+ assemble_name (STREAM, NAME); \
+ putc ('\n', STREAM); \
+ } \
+ fprintf (STREAM, "\t%s\t ", TYPE_ASM_OP); \
+ assemble_name (STREAM, NAME); \
+ putc (',', STREAM); \
+ fprintf (STREAM, TYPE_OPERAND_FMT, "function"); \
+ putc ('\n', STREAM); \
+ assemble_name (STREAM, NAME); \
+ fputs (":\n", STREAM); \
+ } while (0)
+
+#undef ASM_DECLARE_FUNCTION_SIZE
+#define ASM_DECLARE_FUNCTION_SIZE(STREAM, NAME, DECL) \
+ do { \
+ if (!flag_inhibit_size_directive) \
+ { \
+ fputs ("\t.end\t", STREAM); \
+ assemble_name (STREAM, NAME); \
+ putc ('\n', STREAM); \
+ } \
+ } while (0)
+
+/* Tell function_prologue in mips.c that we have already output the .ent/.end
+ pseudo-ops. */
+#define FUNCTION_NAME_ALREADY_DECLARED
+
+/* Output #ident as a .ident. */
+#undef ASM_OUTPUT_IDENT
+#define ASM_OUTPUT_IDENT(FILE, NAME) \
+ fprintf (FILE, "\t%s\t\"%s\"\n", IDENT_ASM_OP, NAME);
diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c
index 1f19c98028e..0ec2a7e591e 100644
--- a/gcc/config/mips/mips.c
+++ b/gcc/config/mips/mips.c
@@ -1,6 +1,6 @@
/* Subroutines for insn-output.c for MIPS
Copyright (C) 1989, 1990, 1991, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001 Free Software Foundation, Inc.
+ 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
Contributed by A. Lichnewsky, lich@inria.inria.fr.
Changes by Michael Meissner, meissner@osf.org.
64 bit r4000 support by Ian Lance Taylor, ian@cygnus.com, and
@@ -36,9 +36,7 @@ Boston, MA 02111-1307, USA. */
#include "real.h"
#include "insn-config.h"
#include "conditions.h"
-#include "insn-flags.h"
#include "insn-attr.h"
-#include "insn-codes.h"
#include "recog.h"
#include "toplev.h"
#include "output.h"
@@ -92,7 +90,7 @@ static int mips16_simple_memory_operand PARAMS ((rtx, rtx,
enum machine_mode));
static int m16_check_op PARAMS ((rtx, int, int, int));
static void block_move_loop PARAMS ((rtx, rtx,
- unsigned int,
+ unsigned int,
int,
rtx, rtx));
static void block_move_call PARAMS ((rtx, rtx, rtx));
@@ -113,6 +111,7 @@ static void abort_with_insn PARAMS ((rtx, const char *))
ATTRIBUTE_NORETURN;
static int symbolic_expression_p PARAMS ((rtx));
static void mips_add_gc_roots PARAMS ((void));
+static enum processor_type mips_parse_cpu PARAMS ((const char *));
/* Global variables for machine-dependent things. */
@@ -199,10 +198,13 @@ enum cmp_type branch_type;
static int prev_half_pic_ptrs = 0;
static int prev_half_pic_refs = 0;
-/* which cpu are we scheduling for */
-enum processor_type mips_cpu;
+/* Which cpu we are generating code for. */
+enum processor_type mips_arch;
-/* which instruction set architecture to use. */
+/* The target cpu for optimization and scheduling. */
+enum processor_type mips_tune;
+
+/* Which instruction set architecture to use. */
int mips_isa;
#ifdef MIPS_ABI_DEFAULT
@@ -212,6 +214,8 @@ int mips_abi;
#endif
/* Strings to hold which cpu and instruction set architecture to use. */
+const char *mips_arch_string; /* for -march=<xxx> */
+const char *mips_tune_string; /* for -mtune=<xxx> */
const char *mips_cpu_string; /* for -mcpu=<xxx> */
const char *mips_isa_string; /* for -mips{1,2,3,4} */
const char *mips_abi_string; /* for -mabi={32,n32,64,eabi} */
@@ -225,7 +229,7 @@ int mips16;
just a way to avoid using up another bit in target_flags. */
const char *mips_no_mips16_string;
-/* This is only used to determine if an type size setting option was
+/* This is only used to determine if an type size setting option was
explicitly specified (-mlong64, -mint64, -mlong32). The specs
set this option if such an option is used. */
const char *mips_explicit_type_size_string;
@@ -1224,7 +1228,7 @@ int
mips_check_split (address, mode)
rtx address;
enum machine_mode mode;
-{
+{
/* ??? This is the same check used in simple_memory_operand.
We use it here because LO_SUM is not offsettable. */
if (GET_MODE_SIZE (mode) > (unsigned) UNITS_PER_WORD)
@@ -1248,7 +1252,7 @@ mips_reg_mode_ok_for_base_p (reg, mode, strict)
enum machine_mode mode;
int strict;
{
- return (strict
+ return (strict
? REGNO_MODE_OK_FOR_BASE_P (REGNO (reg), mode)
: GP_REG_OR_PSEUDO_NONSTRICT_P (REGNO (reg), mode));
}
@@ -1264,111 +1268,111 @@ mips_legitimate_address_p (mode, xinsn, strict)
rtx xinsn;
int strict;
{
- if (TARGET_DEBUG_B_MODE)
- {
- GO_PRINTF2 ("\n========== GO_IF_LEGITIMATE_ADDRESS, %sstrict\n",
- strict ? "" : "not ");
- GO_DEBUG_RTX (xinsn);
- }
-
- /* Check for constant before stripping off SUBREG, so that we don't
- accept (subreg (const_int)) which will fail to reload. */
- if (CONSTANT_ADDRESS_P (xinsn)
+ if (TARGET_DEBUG_B_MODE)
+ {
+ GO_PRINTF2 ("\n========== GO_IF_LEGITIMATE_ADDRESS, %sstrict\n",
+ strict ? "" : "not ");
+ GO_DEBUG_RTX (xinsn);
+ }
+
+ /* Check for constant before stripping off SUBREG, so that we don't
+ accept (subreg (const_int)) which will fail to reload. */
+ if (CONSTANT_ADDRESS_P (xinsn)
&& ! (mips_split_addresses && mips_check_split (xinsn, mode))
- && (! TARGET_MIPS16 || mips16_constant (xinsn, mode, 1, 0)))
- return 1;
-
- while (GET_CODE (xinsn) == SUBREG)
- xinsn = SUBREG_REG (xinsn);
-
- /* The mips16 can only use the stack pointer as a base register when
- loading SImode or DImode values. */
- if (GET_CODE (xinsn) == REG
- && mips_reg_mode_ok_for_base_p (xinsn, mode, strict))
- return 1;
-
- if (GET_CODE (xinsn) == LO_SUM && mips_split_addresses)
- {
- register rtx xlow0 = XEXP (xinsn, 0);
- register rtx xlow1 = XEXP (xinsn, 1);
-
- while (GET_CODE (xlow0) == SUBREG)
- xlow0 = SUBREG_REG (xlow0);
- if (GET_CODE (xlow0) == REG
+ && (! TARGET_MIPS16 || mips16_constant (xinsn, mode, 1, 0)))
+ return 1;
+
+ while (GET_CODE (xinsn) == SUBREG)
+ xinsn = SUBREG_REG (xinsn);
+
+ /* The mips16 can only use the stack pointer as a base register when
+ loading SImode or DImode values. */
+ if (GET_CODE (xinsn) == REG
+ && mips_reg_mode_ok_for_base_p (xinsn, mode, strict))
+ return 1;
+
+ if (GET_CODE (xinsn) == LO_SUM && mips_split_addresses)
+ {
+ register rtx xlow0 = XEXP (xinsn, 0);
+ register rtx xlow1 = XEXP (xinsn, 1);
+
+ while (GET_CODE (xlow0) == SUBREG)
+ xlow0 = SUBREG_REG (xlow0);
+ if (GET_CODE (xlow0) == REG
&& mips_reg_mode_ok_for_base_p (xlow0, mode, strict)
&& mips_check_split (xlow1, mode))
- return 1;
- }
-
- if (GET_CODE (xinsn) == PLUS)
- {
- register rtx xplus0 = XEXP (xinsn, 0);
- register rtx xplus1 = XEXP (xinsn, 1);
- register enum rtx_code code0;
- register enum rtx_code code1;
-
- while (GET_CODE (xplus0) == SUBREG)
- xplus0 = SUBREG_REG (xplus0);
- code0 = GET_CODE (xplus0);
-
- while (GET_CODE (xplus1) == SUBREG)
- xplus1 = SUBREG_REG (xplus1);
- code1 = GET_CODE (xplus1);
-
- /* The mips16 can only use the stack pointer as a base register
- when loading SImode or DImode values. */
- if (code0 == REG
- && mips_reg_mode_ok_for_base_p (xplus0, mode, strict))
- {
+ return 1;
+ }
+
+ if (GET_CODE (xinsn) == PLUS)
+ {
+ register rtx xplus0 = XEXP (xinsn, 0);
+ register rtx xplus1 = XEXP (xinsn, 1);
+ register enum rtx_code code0;
+ register enum rtx_code code1;
+
+ while (GET_CODE (xplus0) == SUBREG)
+ xplus0 = SUBREG_REG (xplus0);
+ code0 = GET_CODE (xplus0);
+
+ while (GET_CODE (xplus1) == SUBREG)
+ xplus1 = SUBREG_REG (xplus1);
+ code1 = GET_CODE (xplus1);
+
+ /* The mips16 can only use the stack pointer as a base register
+ when loading SImode or DImode values. */
+ if (code0 == REG
+ && mips_reg_mode_ok_for_base_p (xplus0, mode, strict))
+ {
if (code1 == CONST_INT && SMALL_INT (xplus1))
return 1;
-
- /* On the mips16, we represent GP relative offsets in RTL.
- These are 16 bit signed values, and can serve as register
- offsets. */
- if (TARGET_MIPS16
- && mips16_gp_offset_p (xplus1))
- return 1;
-
- /* For some code sequences, you actually get better code by
- pretending that the MIPS supports an address mode of a
- constant address + a register, even though the real
- machine doesn't support it. This is because the
- assembler can use $r1 to load just the high 16 bits, add
- in the register, and fold the low 16 bits into the memory
- reference, whereas the compiler generates a 4 instruction
- sequence. On the other hand, CSE is not as effective.
- It would be a win to generate the lui directly, but the
- MIPS assembler does not have syntax to generate the
- appropriate relocation. */
-
- /* Also accept CONST_INT addresses here, so no else. */
- /* Reject combining an embedded PIC text segment reference
- with a register. That requires an additional
- instruction. */
- /* ??? Reject combining an address with a register for the MIPS
- 64 bit ABI, because the SGI assembler can not handle this. */
- if (!TARGET_DEBUG_A_MODE
- && (mips_abi == ABI_32
- || mips_abi == ABI_O64
- || mips_abi == ABI_EABI)
- && CONSTANT_ADDRESS_P (xplus1)
- && ! mips_split_addresses
- && (!TARGET_EMBEDDED_PIC
- || code1 != CONST
- || GET_CODE (XEXP (xplus1, 0)) != MINUS)
- /* When assembling for machines with 64 bit registers,
+
+ /* On the mips16, we represent GP relative offsets in RTL.
+ These are 16 bit signed values, and can serve as register
+ offsets. */
+ if (TARGET_MIPS16
+ && mips16_gp_offset_p (xplus1))
+ return 1;
+
+ /* For some code sequences, you actually get better code by
+ pretending that the MIPS supports an address mode of a
+ constant address + a register, even though the real
+ machine doesn't support it. This is because the
+ assembler can use $r1 to load just the high 16 bits, add
+ in the register, and fold the low 16 bits into the memory
+ reference, whereas the compiler generates a 4 instruction
+ sequence. On the other hand, CSE is not as effective.
+ It would be a win to generate the lui directly, but the
+ MIPS assembler does not have syntax to generate the
+ appropriate relocation. */
+
+ /* Also accept CONST_INT addresses here, so no else. */
+ /* Reject combining an embedded PIC text segment reference
+ with a register. That requires an additional
+ instruction. */
+ /* ??? Reject combining an address with a register for the MIPS
+ 64 bit ABI, because the SGI assembler can not handle this. */
+ if (!TARGET_DEBUG_A_MODE
+ && (mips_abi == ABI_32
+ || mips_abi == ABI_O64
+ || mips_abi == ABI_EABI)
+ && CONSTANT_ADDRESS_P (xplus1)
+ && ! mips_split_addresses
+ && (!TARGET_EMBEDDED_PIC
+ || code1 != CONST
+ || GET_CODE (XEXP (xplus1, 0)) != MINUS)
+ /* When assembling for machines with 64 bit registers,
the assembler will not sign-extend the constant "foo"
in "la x, foo(x)" */
&& (!TARGET_64BIT || (INTVAL (xplus1) > 0))
- && !TARGET_MIPS16)
- return 1;
- }
- }
-
- if (TARGET_DEBUG_B_MODE)
+ && !TARGET_MIPS16)
+ return 1;
+ }
+ }
+
+ if (TARGET_DEBUG_B_MODE)
GO_PRINTF ("Not a legitimate address\n");
-
+
/* The address was not legitimate. */
return 0;
}
@@ -1797,7 +1801,7 @@ embedded_pic_offset (x)
rtx seq;
embedded_pic_fnaddr_rtx = gen_reg_rtx (Pmode);
-
+
/* Output code at function start to initialize the pseudo-reg. */
/* ??? We used to do this in FINALIZE_PIC, but that does not work for
inline functions, because it is called after RTL for the function
@@ -2197,7 +2201,7 @@ mips_move_1word (operands, insn, unsignedp)
if (i > sizeof (volatile_buffer) - sizeof ("%{%}"))
abort ();
-
+
sprintf (volatile_buffer, "%%{%s%%}", ret);
ret = volatile_buffer;
}
@@ -2251,7 +2255,7 @@ mips_move_2words (operands, insn)
op1 = SUBREG_REG (op1);
code1 = GET_CODE (op1);
}
-
+
/* Sanity check. */
if (GET_CODE (operands[1]) == SIGN_EXTEND
&& code1 != REG
@@ -2384,7 +2388,7 @@ mips_move_2words (operands, insn)
or higher. For !TARGET_64BIT && gp registers we
need to avoid this by using two li instructions
instead. */
- if (ISA_HAS_64BIT_REGS
+ if (ISA_HAS_64BIT_REGS
&& ! TARGET_64BIT
&& ! FP_REG_P (regno0))
{
@@ -2452,7 +2456,7 @@ mips_move_2words (operands, insn)
: "mt%0\t%.\n");
}
}
-
+
else if (code1 == CONST_INT && GET_MODE (op0) == DImode
&& GP_REG_P (regno0))
{
@@ -2653,7 +2657,7 @@ mips_move_2words (operands, insn)
if (i > sizeof (volatile_buffer) - sizeof ("%{%}"))
abort ();
-
+
sprintf (volatile_buffer, "%%{%s%%}", ret);
ret = volatile_buffer;
}
@@ -2740,7 +2744,7 @@ mips_address_cost (addr)
return 4;
}
-/* Return nonzero if X is an address which needs a temporary register when
+/* Return nonzero if X is an address which needs a temporary register when
reloaded while generating PIC code. */
int
@@ -3051,7 +3055,7 @@ gen_conditional_branch (operands, test_code)
emit_insn (gen_rtx_SET (VOIDmode, reg,
gen_rtx (test_code == NE ? EQ : test_code,
CCmode, cmp0, cmp1)));
-
+
test_code = test_code == NE ? EQ : NE;
mode = CCmode;
cmp0 = reg;
@@ -3148,7 +3152,7 @@ gen_conditional_move (operands)
}
else if (cmp_code == NE)
cmp_code = EQ, move_code = EQ;
-
+
if (mode == SImode || mode == DImode)
cmp_mode = mode;
else if (mode == SFmode || mode == DFmode)
@@ -3373,7 +3377,7 @@ expand_block_move (operands)
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);
-
+
else if (constp && bytes <= (unsigned)2 * MAX_MOVE_BYTES)
emit_insn (gen_movstrsi_internal (change_address (orig_dest, BLKmode,
dest_reg),
@@ -3437,7 +3441,7 @@ expand_block_move (operands)
block_move_call (dest_reg, src_reg, bytes_rtx);
}
-/* Emit load/stores for a small constant block_move.
+/* 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.
@@ -3937,7 +3941,7 @@ function_arg (cum, mode, type, named)
fprintf (stderr, HOST_PTR_PRINTF, (const PTR) type);
fprintf (stderr, ", %d ) = ", named);
}
-
+
cum->last_arg_fp = 0;
switch (mode)
@@ -4100,8 +4104,8 @@ function_arg (cum, mode, type, named)
regno + FP_ARG_FIRST - GP_ARG_FIRST);
else
reg = gen_rtx_REG (word_mode, regno);
-
- XVECEXP (ret, 0, i)
+
+ XVECEXP (ret, 0, i)
= gen_rtx_EXPR_LIST (VOIDmode, reg,
GEN_INT (bitpos / BITS_PER_UNIT));
@@ -4211,15 +4215,15 @@ function_arg_partial_nregs (cum, mode, type, named)
/* Create the va_list data type.
We keep 3 pointers, and two offsets.
- Two pointers are to the overflow area, which starts at the CFA.
+ Two pointers are to the overflow area, which starts at the CFA.
One of these is constant, for addressing into the GPR save area below it.
The other is advanced up the stack through the overflow region.
The third pointer is to the GPR save area. Since the FPR save area
is just below it, we can address FPR slots off this pointer.
We also keep two one-byte offsets, which are to be subtracted from the
constant pointers to yield addresses in the GPR and FPR save areas.
- These are downcounted as float or non-float arguments are used,
- and when they get to zero, the argument must be obtained from the
+ These are downcounted as float or non-float arguments are used,
+ and when they get to zero, the argument must be obtained from the
overflow region.
If TARGET_SOFT_FLOAT or TARGET_SINGLE_FLOAT, then no FPR save area exists,
and a single pointer is enough. It's started at the GPR save area,
@@ -4299,8 +4303,8 @@ mips_va_start (stdarg_p, valist, nextarg)
if (!TARGET_SOFT_FLOAT && !TARGET_SINGLE_FLOAT)
{
- tree f_ovfl, f_gtop, f_ftop, f_goff, f_foff;
- tree ovfl, gtop, ftop, goff, foff;
+ tree f_ovfl, f_gtop, f_ftop, f_goff, f_foff;
+ tree ovfl, gtop, ftop, goff, foff;
tree gprv;
int float_formals, fpr_offset, size_excess, floats_passed_in_regs;
int fpr_save_offset;
@@ -4339,7 +4343,7 @@ mips_va_start (stdarg_p, valist, nextarg)
8 byte boundary. This means that the above calculation should
take into account the exact sequence of floats and non-floats
which make up the excess. That calculation should be rolled
- into the code which sets the current_function_args_info struct.
+ into the code which sets the current_function_args_info struct.
The above then reduces to a fetch from that struct. */
@@ -4369,7 +4373,7 @@ mips_va_start (stdarg_p, valist, nextarg)
fpr_save_offset += 4;
}
if (fpr_save_offset)
- gprv = build (PLUS_EXPR, TREE_TYPE (ftop), gprv,
+ gprv = build (PLUS_EXPR, TREE_TYPE (ftop), gprv,
build_int_2 (-fpr_save_offset,-1));
t = build (MODIFY_EXPR, TREE_TYPE (ftop), ftop, gprv);
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
@@ -4451,8 +4455,8 @@ mips_va_arg (valist, type)
{
int indirect;
rtx r, lab_over = NULL_RTX, lab_false;
- tree f_ovfl, f_gtop, f_ftop, f_goff, f_foff;
- tree ovfl, gtop, ftop, goff, foff;
+ tree f_ovfl, f_gtop, f_ftop, f_goff, f_foff;
+ tree ovfl, gtop, ftop, goff, foff;
indirect
= function_arg_pass_by_reference (NULL, TYPE_MODE (type), type, 0);
@@ -4476,13 +4480,13 @@ mips_va_arg (valist, type)
{
t = build (PLUS_EXPR, TREE_TYPE (gpr), gpr,
build_int_2 (2*UNITS_PER_WORD - 1, 0));
- t = build (BIT_AND_EXPR, TREE_TYPE (t), t,
+ t = build (BIT_AND_EXPR, TREE_TYPE (t), t,
build_int_2 (-2*UNITS_PER_WORD, -1));
t = build (MODIFY_EXPR, TREE_TYPE (gpr), gpr, t);
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
}
- t = build (POSTINCREMENT_EXPR, TREE_TYPE (gpr), gpr,
+ t = build (POSTINCREMENT_EXPR, TREE_TYPE (gpr), gpr,
size_int (rsize));
r = expand_expr (t, addr_rtx, Pmode, EXPAND_NORMAL);
if (r != addr_rtx)
@@ -4537,7 +4541,7 @@ mips_va_arg (valist, type)
if (r != addr_rtx)
emit_move_insn (addr_rtx, r);
- /* Emit code for foff-=8.
+ /* Emit code for foff-=8.
Advances the offset up FPR save area by one double */
t = build (MINUS_EXPR, TREE_TYPE (foff), foff, build_int_2 (8, 0));
t = build (MODIFY_EXPR, TREE_TYPE (foff), foff, t);
@@ -4547,8 +4551,8 @@ mips_va_arg (valist, type)
emit_jump (lab_over);
emit_barrier ();
emit_label (lab_false);
-
- if (!TARGET_64BIT)
+
+ if (!TARGET_64BIT)
{
/* For mips2, the overflow area contains mixed size items.
If a 4-byte int is followed by an 8-byte float, then
@@ -4563,7 +4567,7 @@ mips_va_arg (valist, type)
/* Emit code for addr_rtx = the ovfl pointer into overflow area.
Regardless of mips2, postincrement the ovfl pointer by 8. */
- t = build (POSTINCREMENT_EXPR, TREE_TYPE(ovfl), ovfl,
+ t = build (POSTINCREMENT_EXPR, TREE_TYPE(ovfl), ovfl,
size_int (8));
r = expand_expr (t, addr_rtx, Pmode, EXPAND_NORMAL);
if (r != addr_rtx)
@@ -4582,7 +4586,7 @@ mips_va_arg (valist, type)
&& TREE_CODE (type) == INTEGER_TYPE
&& TYPE_PRECISION (type) == 64)
{
- /* In mips2, int takes 32 bits of the GPR save area, but
+ /* In mips2, int takes 32 bits of the GPR save area, but
longlong takes an aligned 64 bits. So, emit code
to zero the low order bits of goff, thus aligning
the later calculation of (gtop-goff) upwards. */
@@ -4612,7 +4616,7 @@ mips_va_arg (valist, type)
/* Emit code for goff = goff - step_size.
Advances the offset up GPR save area over the item. */
- t = build (MINUS_EXPR, TREE_TYPE (goff), goff,
+ t = build (MINUS_EXPR, TREE_TYPE (goff), goff,
build_int_2 (step_size, 0));
t = build (MODIFY_EXPR, TREE_TYPE (goff), goff, t);
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
@@ -4621,9 +4625,9 @@ mips_va_arg (valist, type)
emit_jump (lab_over);
emit_barrier ();
emit_label (lab_false);
-
+
/* Emit code for addr_rtx -> overflow area, postinc by step_size */
- t = build (POSTINCREMENT_EXPR, TREE_TYPE(ovfl), ovfl,
+ t = build (POSTINCREMENT_EXPR, TREE_TYPE(ovfl), ovfl,
size_int (step_size));
r = expand_expr (t, addr_rtx, Pmode, EXPAND_NORMAL);
if (r != addr_rtx)
@@ -4651,7 +4655,7 @@ mips_va_arg (valist, type)
/* Not EABI. */
int align;
- /* ??? The original va-mips.h did always align, despite the fact
+ /* ??? The original va-mips.h did always align, despite the fact
that alignments <= UNITS_PER_WORD are preserved by the va_arg
increment mechanism. */
@@ -4661,7 +4665,7 @@ mips_va_arg (valist, type)
align = 8;
else
align = 4;
-
+
t = build (PLUS_EXPR, TREE_TYPE (valist), valist,
build_int_2 (align - 1, 0));
t = build (BIT_AND_EXPR, TREE_TYPE (t), t, build_int_2 (-align, -1));
@@ -4704,7 +4708,7 @@ override_options ()
/* If both single-float and soft-float are set, then clear the one that
was set by TARGET_DEFAULT, leaving the one that was set by the
- user. We assume here that the specs prevent both being set by the
+ user. We assume here that the specs prevent both being set by the
user. */
#ifdef TARGET_DEFAULT
if (TARGET_SINGLE_FLOAT && TARGET_SOFT_FLOAT)
@@ -4715,6 +4719,10 @@ override_options ()
if (mips_isa_string == 0)
mips_isa = MIPS_ISA_DEFAULT;
+ else if (mips_isa_string != 0
+ && mips_arch_string != 0)
+ warning ("The -march option is incompatible to -mipsN and therefore ignored.");
+
else if (ISDIGIT (*mips_isa_string))
{
mips_isa = atoi (mips_isa_string);
@@ -4765,7 +4773,7 @@ override_options ()
error ("bad value (%s) for -mabi= switch", mips_abi_string);
/* A specified ISA defaults the ABI if it was not specified. */
- if (mips_abi_string == 0 && mips_isa_string
+ if (mips_abi_string == 0 && mips_isa_string
&& mips_abi != ABI_EABI && mips_abi != ABI_O64)
{
if (! ISA_HAS_64BIT_REGS)
@@ -4775,7 +4783,7 @@ override_options ()
}
/* A specified ABI defaults the ISA if it was not specified. */
- else if (mips_isa_string == 0 && mips_abi_string
+ else if (mips_isa_string == 0 && mips_abi_string
&& mips_abi != ABI_EABI && mips_abi != ABI_O64)
{
if (mips_abi == ABI_32)
@@ -4821,133 +4829,98 @@ override_options ()
greater than that supported by the default processor, then the user gets
an error. Normally, the compiler will just default to the base level cpu
for the indicated isa. */
- if (mips_cpu_string == 0)
- mips_cpu_string = MIPS_CPU_STRING_DEFAULT;
+ if (mips_arch_string == 0)
+ mips_arch_string = MIPS_CPU_STRING_DEFAULT;
+ if (mips_tune_string == 0)
+ mips_tune_string = MIPS_CPU_STRING_DEFAULT;
#endif
/* Identify the processor type. */
- if (mips_cpu_string == 0
- || ! strcmp (mips_cpu_string, "default")
- || ! strcmp (mips_cpu_string, "DEFAULT"))
+ if (mips_cpu_string != 0)
{
- switch (mips_isa)
+ int mips_cpu = mips_parse_cpu (mips_cpu_string);
+
+ if (mips_cpu == PROCESSOR_DEFAULT)
{
- default:
- mips_cpu_string = "3000";
- mips_cpu = PROCESSOR_R3000;
- break;
- case 2:
- mips_cpu_string = "6000";
- mips_cpu = PROCESSOR_R6000;
- break;
- case 3:
- mips_cpu_string = "4000";
- mips_cpu = PROCESSOR_R4000;
- break;
- case 4:
- mips_cpu_string = "8000";
- mips_cpu = PROCESSOR_R8000;
- break;
+ error ("bad value (%s) for -mcpu= switch", mips_cpu_string);
+ mips_cpu_string = "default";
}
+ mips_arch = mips_cpu;
+ mips_tune = mips_cpu;
}
- else
- {
- const char *p = mips_cpu_string;
- int seen_v = 0;
-
- /* We need to cope with the various "vr" prefixes for the NEC 4300
- and 4100 processors. */
- if (*p == 'v' || *p == 'V')
- seen_v = 1, p++;
-
- if (*p == 'r' || *p == 'R')
- p++;
-
- /* Since there is no difference between a R2000 and R3000 in
- terms of the scheduler, we collapse them into just an R3000. */
-
- mips_cpu = PROCESSOR_DEFAULT;
- switch (*p)
- {
- case '2':
- if (!strcmp (p, "2000") || !strcmp (p, "2k") || !strcmp (p, "2K"))
- mips_cpu = PROCESSOR_R3000;
- break;
-
- case '3':
- if (!strcmp (p, "3000") || !strcmp (p, "3k") || !strcmp (p, "3K"))
- mips_cpu = PROCESSOR_R3000;
- else if (!strcmp (p, "3900"))
- mips_cpu = PROCESSOR_R3900;
- break;
-
- case '4':
- if (!strcmp (p, "4000") || !strcmp (p, "4k") || !strcmp (p, "4K"))
- mips_cpu = PROCESSOR_R4000;
- /* The vr4100 is a non-FP ISA III processor with some extra
- instructions. */
- else if (!strcmp (p, "4100"))
- {
- mips_cpu = PROCESSOR_R4100;
- target_flags |= MASK_SOFT_FLOAT ;
- }
- /* The vr4300 is a standard ISA III processor, but with a different
- pipeline. */
- else if (!strcmp (p, "4300"))
- mips_cpu = PROCESSOR_R4300;
- /* The r4400 is exactly the same as the r4000 from the compiler's
- viewpoint. */
- else if (!strcmp (p, "4400"))
- mips_cpu = PROCESSOR_R4000;
- else if (!strcmp (p, "4600"))
- mips_cpu = PROCESSOR_R4600;
- else if (!strcmp (p, "4650"))
- mips_cpu = PROCESSOR_R4650;
- break;
- case '5':
- if (!strcmp (p, "5000") || !strcmp (p, "5k") || !strcmp (p, "5K"))
- mips_cpu = PROCESSOR_R5000;
- break;
-
- case '6':
- if (!strcmp (p, "6000") || !strcmp (p, "6k") || !strcmp (p, "6K"))
- mips_cpu = PROCESSOR_R6000;
- break;
-
- case '8':
- if (!strcmp (p, "8000"))
- mips_cpu = PROCESSOR_R8000;
- break;
-
- case 'o':
- if (!strcmp (p, "orion"))
- mips_cpu = PROCESSOR_R4600;
- break;
+ if (mips_arch_string == 0
+ || ! strcmp (mips_arch_string, "default")
+ || ! strcmp (mips_arch_string, "DEFAULT"))
+ {
+ switch (mips_isa)
+ {
+ default:
+ mips_arch_string = "3000";
+ mips_arch = PROCESSOR_R3000;
+ break;
+ case 2:
+ mips_arch_string = "6000";
+ mips_arch = PROCESSOR_R6000;
+ break;
+ case 3:
+ mips_arch_string = "4000";
+ mips_arch = PROCESSOR_R4000;
+ break;
+ case 4:
+ mips_arch_string = "8000";
+ mips_arch = PROCESSOR_R8000;
+ break;
}
+ }
+ else
+ {
+ mips_arch = mips_parse_cpu (mips_arch_string);
- if (seen_v
- && mips_cpu != PROCESSOR_R4300
- && mips_cpu != PROCESSOR_R4100
- && mips_cpu != PROCESSOR_R5000)
- mips_cpu = PROCESSOR_DEFAULT;
+ if (mips_arch == PROCESSOR_DEFAULT)
+ {
+ error ("bad value (%s) for -march= switch", mips_arch_string);
+ mips_arch_string = "default";
+ }
+ }
+ if (mips_tune_string == 0
+ || ! strcmp (mips_tune_string, "default")
+ || ! strcmp (mips_tune_string, "DEFAULT"))
+ {
+ if (mips_arch != PROCESSOR_DEFAULT)
+ mips_tune = mips_arch;
+ else
+ switch (mips_isa)
+ {
+ default:
+ mips_tune_string = "3000";
+ mips_tune = PROCESSOR_R3000;
+ break;
+ case 2:
+ mips_tune_string = "6000";
+ mips_tune = PROCESSOR_R6000;
+ break;
+ case 3:
+ mips_tune_string = "4000";
+ mips_tune = PROCESSOR_R4000;
+ break;
+ case 4:
+ mips_tune_string = "8000";
+ mips_tune = PROCESSOR_R8000;
+ break;
+ }
- if (mips_cpu == PROCESSOR_DEFAULT)
- {
- error ("bad value (%s) for -mcpu= switch", mips_cpu_string);
- mips_cpu_string = "default";
- }
+ }
+ else
+ {
+ mips_tune = mips_parse_cpu (mips_tune_string);
+ if (mips_tune == PROCESSOR_DEFAULT)
+ {
+ error ("bad value (%s) for -mtune= switch", mips_tune_string);
+ mips_tune_string = "default";
+ }
}
- if ((mips_cpu == PROCESSOR_R3000 && (mips_isa != 1))
- || (mips_cpu == PROCESSOR_R6000 && mips_isa != 1 && mips_isa != 2)
- || ((mips_cpu == PROCESSOR_R4000
- || mips_cpu == PROCESSOR_R4100
- || mips_cpu == PROCESSOR_R4300
- || mips_cpu == PROCESSOR_R4600
- || mips_cpu == PROCESSOR_R4650)
- && mips_isa != 1 && mips_isa != 2 && mips_isa != 3))
- error ("-mcpu=%s does not support -mips%d", mips_cpu_string, mips_isa);
/* make sure sizes of ints/longs/etc. are ok */
if (! ISA_HAS_64BIT_REGS)
@@ -5177,11 +5150,11 @@ override_options ()
/* Provide default values for align_* for 64-bit targets. */
if (TARGET_64BIT && !TARGET_MIPS16)
{
- if (align_loops == 0)
+ if (align_loops == 0)
align_loops = 8;
- if (align_jumps == 0)
+ if (align_jumps == 0)
align_jumps = 8;
- if (align_functions == 0)
+ if (align_functions == 0)
align_functions = 8;
}
@@ -5399,7 +5372,7 @@ print_operand (file, op, letter)
fputs (".set\tnoat\n\t", file);
break;
- case ']':
+ case ']':
if (set_noat == 0)
error ("internal error: %%] found without a %%[ in assembler pattern");
else if (--set_noat == 0)
@@ -5911,7 +5884,7 @@ mips_output_lineno (stream, line)
fprintf (stream, "\n\t%s.loc\t%d %d\n",
(ignore_line_number) ? "#" : "",
num_source_filenames, line);
-
+
LABEL_AFTER_LOC (stream);
}
}
@@ -6020,9 +5993,9 @@ mips_asm_file_start (stream)
asm_out_data_file = asm_out_text_file = stream;
if (flag_verbose_asm)
- fprintf (stream, "\n%s -G value = %d, Cpu = %s, ISA = %d\n",
+ fprintf (stream, "\n%s -G value = %d, Apu = %s, ISA = %d\n",
ASM_COMMENT_START,
- mips_section_threshold, mips_cpu_string, mips_isa);
+ mips_section_threshold, mips_arch_string, mips_isa);
}
/* If we are optimizing the global pointer, emit the text section now and any
@@ -6069,7 +6042,7 @@ mips_asm_file_end (file)
}
}
}
-
+
if (TARGET_FILE_SWITCHING && ! TARGET_MIPS16)
{
fprintf (file, "\n\t.text\n");
@@ -6279,6 +6252,20 @@ compute_frame_size (size)
}
}
+ /* We need to restore these for the handler. */
+ if (current_function_calls_eh_return)
+ {
+ int i;
+ for (i = 0; ; ++i)
+ {
+ regno = EH_RETURN_DATA_REGNO (i);
+ if (regno == INVALID_REGNUM)
+ break;
+ gp_reg_size += GET_MODE_SIZE (gpr_mode);
+ mask |= 1L << (regno - GP_REG_FIRST);
+ }
+ }
+
/* Calculate space needed for fp registers. */
if (TARGET_FLOAT64 || TARGET_SINGLE_FLOAT)
{
@@ -6312,7 +6299,7 @@ compute_frame_size (size)
The gp reg is callee saved in the 64 bit ABI, so all routines must
save the gp reg. This is not a leaf routine if -p, because of the
call to mcount. */
- if (total_size == extra_size
+ if (total_size == extra_size
&& (mips_abi == ABI_32 || mips_abi == ABI_O64 || mips_abi == ABI_EABI)
&& ! profile_flag)
total_size = extra_size = 0;
@@ -6404,6 +6391,7 @@ save_restore_insns (store_p, large_reg, large_offset, file)
{
long mask = current_frame_info.mask;
long fmask = current_frame_info.fmask;
+ long real_mask = mask;
int regno;
rtx base_reg_rtx;
HOST_WIDE_INT base_offset;
@@ -6416,6 +6404,12 @@ save_restore_insns (store_p, large_reg, large_offset, file)
&& ! BITSET_P (mask, HARD_FRAME_POINTER_REGNUM - GP_REG_FIRST))
abort ();
+ /* Do not restore GP under certain conditions. */
+ if (! store_p
+ && TARGET_ABICALLS
+ && (mips_abi == ABI_32 || mips_abi == ABI_O64))
+ mask &= ~(1 << (PIC_OFFSET_TABLE_REGNUM - GP_REG_FIRST));
+
if (mask == 0 && fmask == 0)
return;
@@ -6555,7 +6549,8 @@ save_restore_insns (store_p, large_reg, large_offset, file)
gen_rtx (PLUS, Pmode, base_reg_rtx,
GEN_INT (gp_offset - base_offset)));
- RTX_UNCHANGING_P (mem_rtx) = 1;
+ if (! current_function_calls_eh_return)
+ RTX_UNCHANGING_P (mem_rtx) = 1;
/* The mips16 does not have an instruction to load
$31, so we load $7 instead, and work things out
@@ -6584,9 +6579,7 @@ save_restore_insns (store_p, large_reg, large_offset, file)
insn = emit_move_insn (mem_rtx, reg_rtx);
RTX_FRAME_RELATED_P (insn) = 1;
}
- else if (!TARGET_ABICALLS
- || (mips_abi != ABI_32 && mips_abi != ABI_O64)
- || regno != (PIC_OFFSET_TABLE_REGNUM - GP_REG_FIRST))
+ else
{
emit_move_insn (reg_rtx, mem_rtx);
if (TARGET_MIPS16
@@ -6598,50 +6591,51 @@ save_restore_insns (store_p, large_reg, large_offset, file)
}
else
{
- if (store_p || !TARGET_ABICALLS
- || (mips_abi != ABI_32 && mips_abi != ABI_O64)
- || regno != (PIC_OFFSET_TABLE_REGNUM - GP_REG_FIRST))
+ int r = regno;
+
+ /* The mips16 does not have an instruction to
+ load $31, so we load $7 instead, and work
+ things out in the caller. */
+ if (TARGET_MIPS16 && ! store_p && r == GP_REG_FIRST + 31)
+ r = GP_REG_FIRST + 7;
+
+ /* The mips16 sometimes needs to save $18. */
+ if (TARGET_MIPS16
+ && regno != GP_REG_FIRST + 31
+ && ! M16_REG_P (regno))
{
- int r = regno;
-
- /* The mips16 does not have an instruction to
- load $31, so we load $7 instead, and work
- things out in the caller. */
- if (TARGET_MIPS16 && ! store_p && r == GP_REG_FIRST + 31)
- r = GP_REG_FIRST + 7;
- /* The mips16 sometimes needs to save $18. */
- if (TARGET_MIPS16
- && regno != GP_REG_FIRST + 31
- && ! M16_REG_P (regno))
+ if (! store_p)
+ r = GP_REG_FIRST + 6;
+ else
{
- if (! store_p)
- r = GP_REG_FIRST + 6;
- else
- {
- r = GP_REG_FIRST + 3;
- fprintf (file, "\tmove\t%s,%s\n",
- reg_names[r], reg_names[regno]);
- }
+ r = GP_REG_FIRST + 3;
+ fprintf (file, "\tmove\t%s,%s\n",
+ reg_names[r], reg_names[regno]);
}
- fprintf (file, "\t%s\t%s,",
- (TARGET_64BIT
- ? (store_p) ? "sd" : "ld"
- : (store_p) ? "sw" : "lw"),
- reg_names[r]);
- fprintf (file, HOST_WIDE_INT_PRINT_DEC,
- gp_offset - base_offset);
- fprintf (file, "(%s)\n", reg_names[REGNO(base_reg_rtx)]);
- if (! store_p
- && TARGET_MIPS16
- && regno != GP_REG_FIRST + 31
- && ! M16_REG_P (regno))
- fprintf (file, "\tmove\t%s,%s\n",
- reg_names[regno], reg_names[r]);
}
-
+ fprintf (file, "\t%s\t%s,",
+ (TARGET_64BIT
+ ? (store_p) ? "sd" : "ld"
+ : (store_p) ? "sw" : "lw"),
+ reg_names[r]);
+ fprintf (file, HOST_WIDE_INT_PRINT_DEC,
+ gp_offset - base_offset);
+ fprintf (file, "(%s)\n", reg_names[REGNO(base_reg_rtx)]);
+ if (! store_p
+ && TARGET_MIPS16
+ && regno != GP_REG_FIRST + 31
+ && ! M16_REG_P (regno))
+ fprintf (file, "\tmove\t%s,%s\n",
+ reg_names[regno], reg_names[r]);
}
gp_offset -= GET_MODE_SIZE (gpr_mode);
}
+ /* If the restore is being supressed, still take into account
+ the offset at which it is stored. */
+ else if (BITSET_P (real_mask, regno - GP_REG_FIRST))
+ {
+ gp_offset -= GET_MODE_SIZE (gpr_mode);
+ }
}
else
base_reg_rtx = 0, base_offset = 0;
@@ -6767,7 +6761,8 @@ save_restore_insns (store_p, large_reg, large_offset, file)
gen_rtx (PLUS, Pmode, base_reg_rtx,
GEN_INT (fp_offset
- base_offset)));
- RTX_UNCHANGING_P (mem_rtx) = 1;
+ if (! current_function_calls_eh_return)
+ RTX_UNCHANGING_P (mem_rtx) = 1;
if (store_p)
{
@@ -7040,10 +7035,10 @@ mips_expand_prologue ()
/* For arguments passed in registers, find the register number
of the first argument in the variable part of the argument list,
- otherwise GP_ARG_LAST+1. Note also if the last argument is
+ otherwise GP_ARG_LAST+1. Note also if the last argument is
the varargs special argument, and treat it as part of the
variable arguments.
-
+
This is only needed if store_args_on_stack is true. */
INIT_CUMULATIVE_ARGS (args_so_far, fntype, NULL_RTX, 0);
@@ -7115,13 +7110,22 @@ mips_expand_prologue ()
for (i = 0; i < num; i++)
{
- rtx pattern = RTVEC_ELT (adjust, i);
+ rtx insn, pattern;
+
+ pattern = RTVEC_ELT (adjust, i);
if (GET_CODE (pattern) != SET
|| GET_CODE (SET_SRC (pattern)) != ASHIFT)
abort_with_insn (pattern, "Insn is not a shift");
-
PUT_CODE (SET_SRC (pattern), ASHIFTRT);
- emit_insn (pattern);
+
+ insn = emit_insn (pattern);
+
+ /* Global life information isn't valid at this point, so we
+ can't check whether these shifts are actually used. Mark
+ them MAYBE_DEAD so that flow2 will remove them, and not
+ complain about dead code in the prologue. */
+ REG_NOTES(insn) = gen_rtx_EXPR_LIST (REG_MAYBE_DEAD, NULL_RTX,
+ REG_NOTES (insn));
}
}
@@ -7529,7 +7533,7 @@ mips_expand_epilogue ()
g6_rtx));
tsize = 0;
}
-
+
if (tsize && tsize != orig_tsize)
tsize_rtx = GEN_INT (tsize);
}
@@ -7557,13 +7561,27 @@ mips_expand_epilogue ()
if (tsize > 32767 && TARGET_MIPS16)
abort ();
+ if (current_function_calls_eh_return)
+ {
+ rtx eh_ofs = EH_RETURN_STACKADJ_RTX;
+ if (Pmode == DImode)
+ emit_insn (gen_adddi3 (eh_ofs, eh_ofs, tsize_rtx));
+ else
+ emit_insn (gen_addsi3 (eh_ofs, eh_ofs, tsize_rtx));
+ tsize_rtx = eh_ofs;
+ }
+
emit_insn (gen_blockage ());
- if (Pmode == DImode && tsize != 0)
- emit_insn (gen_adddi3 (stack_pointer_rtx, stack_pointer_rtx,
- tsize_rtx));
- else if (tsize != 0)
- emit_insn (gen_addsi3 (stack_pointer_rtx, stack_pointer_rtx,
- tsize_rtx));
+
+ if (tsize != 0 || current_function_calls_eh_return)
+ {
+ if (Pmode == DImode)
+ emit_insn (gen_adddi3 (stack_pointer_rtx, stack_pointer_rtx,
+ tsize_rtx));
+ else
+ emit_insn (gen_addsi3 (stack_pointer_rtx, stack_pointer_rtx,
+ tsize_rtx));
+ }
}
/* The mips16 loads the return address into $7, not $31. */
@@ -7618,7 +7636,7 @@ symbolic_expression_p (x)
if (GET_CODE (x) == CONST)
return symbolic_expression_p (XEXP (x, 0));
-
+
if (GET_RTX_CLASS (GET_CODE (x)) == '1')
return symbolic_expression_p (XEXP (x, 0));
@@ -7655,7 +7673,7 @@ mips_select_rtx_section (mode, x)
{
/* For hosted applications, always put constants in small data if
possible, as this gives the best performance. */
-
+
if (GET_MODE_SIZE (mode) <= (unsigned) mips_section_threshold
&& mips_section_threshold > 0)
SMALL_DATA_SECTION ();
@@ -7776,8 +7794,8 @@ mips_function_value (valtype, func)
}
else if (TREE_CODE (valtype) == RECORD_TYPE
- && mips_abi != ABI_32
- && mips_abi != ABI_O64
+ && mips_abi != ABI_32
+ && mips_abi != ABI_O64
&& mips_abi != ABI_EABI)
{
/* A struct with only one or two floating point fields is returned in
@@ -7796,7 +7814,7 @@ mips_function_value (valtype, func)
fields[i++] = field;
}
-
+
/* Must check i, so that we reject structures with no elements. */
if (! field)
{
@@ -7867,8 +7885,8 @@ function_arg_pass_by_reference (cum, mode, type, named)
here hopefully is not relevant to mips_va_arg. */
if (cum && MUST_PASS_IN_STACK (mode, type))
{
- /* Don't pass the actual CUM to FUNCTION_ARG, because we would
- get double copies of any offsets generated for small structs
+ /* Don't pass the actual CUM to FUNCTION_ARG, because we would
+ get double copies of any offsets generated for small structs
passed in registers. */
CUMULATIVE_ARGS temp;
temp = *cum;
@@ -8479,7 +8497,7 @@ build_mips16_call_stub (retval, fnmem, arg_size, fp_code)
&& strncmp (XSTR (fn, 0), "__mips16_", 9) == 0)
return 0;
- /* This code will only work for o32 and o64 abis. The other ABI's
+ /* This code will only work for o32 and o64 abis. The other ABI's
require more sophisticated support. */
if (mips_abi != ABI_32 && mips_abi != ABI_O64)
abort ();
@@ -8910,7 +8928,7 @@ mips16_optimize_gp (first)
emit_insn_after (gen_rtx (SET, VOIDmode, SET_DEST (set1),
force_const_mem (Pmode, sym)),
next);
-
+
PUT_CODE (insn, NOTE);
NOTE_LINE_NUMBER (insn) = NOTE_INSN_DELETED;
NOTE_SOURCE_FILE (insn) = 0;
@@ -9275,10 +9293,10 @@ machine_dependent_reorg (first)
constants = NULL;
first_constant_ref = -1;
}
-
+
if (constants != NULL
- && (NEXT_INSN (insn) == NULL
- || (first_constant_ref >= 0
+ && (NEXT_INSN (insn) == NULL
+ || (first_constant_ref >= 0
&& (((addr - first_constant_ref)
+ 2 /* for alignment */
+ 2 /* for a short jump insn */
@@ -9290,7 +9308,7 @@ machine_dependent_reorg (first)
emit a barrier now. */
rtx label, jump, barrier;
-
+
label = gen_label_rtx ();
jump = emit_jump_insn_after (gen_jump (label), insn);
JUMP_LABEL (jump) = label;
@@ -9332,7 +9350,7 @@ highpart_shift_operator (x, mode)
|| code == ROTATE);
}
-/* Return the length of INSN. LENGTH is the initial length computed by
+/* Return the length of INSN. LENGTH is the initial length computed by
attributes in the machine-description file. */
int
@@ -9344,7 +9362,7 @@ mips_adjust_insn_length (insn, length)
of a sequence. A conditional jump normally has a delay slot, but
does not on MIPS16. */
if (simplejump_p (insn)
- || (!TARGET_MIPS16 && (GET_CODE (insn) == JUMP_INSN
+ || (!TARGET_MIPS16 && (GET_CODE (insn) == JUMP_INSN
|| GET_CODE (insn) == CALL_INSN)))
length += 4;
@@ -9355,7 +9373,7 @@ mips_adjust_insn_length (insn, length)
return length;
}
-/* Output assembly instructions to peform a conditional branch.
+/* Output assembly instructions to peform a conditional branch.
INSN is the branch instruction. OPERANDS[0] is the condition.
OPERANDS[1] is the target of the branch. OPERANDS[2] is the target
@@ -9370,8 +9388,8 @@ mips_adjust_insn_length (insn, length)
That tells us whether to generate a simple conditional branch, or a
reversed conditional branch around a `jr' instruction. */
char *
-mips_output_conditional_branch (insn,
- operands,
+mips_output_conditional_branch (insn,
+ operands,
two_operands_p,
float_p,
inverted_p,
@@ -9447,7 +9465,7 @@ mips_output_conditional_branch (insn,
equality comparisons are done between two operands, and therefore
do not require a `z' in the assembly language output. */
need_z_p = (!float_p && code != EQ && code != NE);
- /* For comparisons against zero, the zero is not provided
+ /* For comparisons against zero, the zero is not provided
explicitly. */
if (need_z_p)
op2 = "";
@@ -9456,7 +9474,7 @@ mips_output_conditional_branch (insn,
strcat to add to it. */
buffer[0] = '\0';
- switch (length)
+ switch (length)
{
case 4:
case 8:
@@ -9486,47 +9504,48 @@ mips_output_conditional_branch (insn,
.set macro
.set reorder
l:
+ */
- Because we have to jump four bytes *past* the following
- instruction if this branch was annulled, we can't just use
- a label, as in the picture above; there's no way to put the
- label after the next instruction, as the assembler does not
- accept `.L+4' as the target of a branch. (We can't just
- wait until the next instruction is output; it might be a
- macro and take up more than four bytes. Once again, we see
- why we want to eliminate macros.)
-
- If the branch is annulled, we jump four more bytes that we
- would otherwise; that way we skip the annulled instruction
- in the delay slot. */
-
- const char *target
- = ((mips_branch_likely || length == 16) ? ".+16" : ".+12");
- char *c;
+ rtx orig_target;
+ rtx target = gen_label_rtx ();
- strcpy (buffer, "%(%<");
- c = strchr (buffer, '\0');
- /* Generate the reversed comparision. This takes four
- bytes. */
+ output_asm_insn ("%(%<", NULL);
+ orig_target = operands[1];
+ operands[1] = target;
+ /* Generate the reversed comparision. This takes four bytes. */
if (float_p)
- sprintf (c, "%%*b%s\t%%Z2%s",
+ sprintf (buffer, "%%*b%s\t%%Z2%s",
inverted_p ? comp : inverted_comp,
target);
else
- sprintf (c, "%%*b%s%s\t%s%s,%s",
+ sprintf (buffer, "%%*b%s%s\t%s%s,%s",
inverted_p ? comp : inverted_comp,
need_z_p ? "z" : "",
op1,
op2,
target);
- strcat (c, "\n\tnop\n\tj\t%1");
+ output_asm_insn (buffer, operands);
+ operands[1] = orig_target;
+
+ output_asm_insn ("nop\n\tj\t%1", operands);
+
if (length == 16)
/* The delay slot was unfilled. Since we're inside
.noreorder, the assembler will not fill in the NOP for
us, so we must do it ourselves. */
- strcat (buffer, "\n\tnop");
- strcat (buffer, "%>%)");
- return buffer;
+ output_asm_insn ("nop", 0);
+ else
+ {
+ /* Output delay slot instruction. */
+ rtx insn = final_sequence;
+ final_scan_insn (XVECEXP (insn, 0, 1), asm_out_file,
+ optimize, 0, 1);
+ INSN_DELETED_P (XVECEXP (insn, 0, 1)) = 1;
+ }
+ output_asm_insn ("%>%)", 0);
+ ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "L",
+ CODE_LABEL_NUMBER (target));
+ return "";
}
/* We do not currently use this code. It handles jumps to
@@ -9562,7 +9581,7 @@ mips_output_conditional_branch (insn,
generate only a four-byte sequence, rather than eight, and
there seems to be no way to tell it not to. Thus, we can't
just use a `.+x' addressing form; we don't know what value
- to give for `x'.
+ to give for `x'.
So, we resort to using the explicit relocation syntax
available in the assembler and do:
@@ -9577,7 +9596,7 @@ mips_output_conditional_branch (insn,
anything. */
/* The target of the reversed branch. */
- const char *target
+ const char *target
= ((mips_branch_likely || length == 20) ? ".+20" : ".+16");
const char *at_register = mips_reg_names[ASSEMBLER_SCRATCH_REGNUM];
const char *gp_register = mips_reg_names[PIC_OFFSET_TABLE_REGNUM];
@@ -9585,7 +9604,7 @@ mips_output_conditional_branch (insn,
strcpy (buffer, "%(%<%[");
c = strchr (buffer, '\0');
- /* Generate the reversed comparision. This takes four
+ /* Generate the reversed comparision. This takes four
bytes. */
if (float_p)
sprintf (c, "%%*b%s\t%%Z2%s",
@@ -9640,3 +9659,87 @@ mips_add_gc_roots ()
ggc_add_rtx_root (&embedded_pic_fnaddr_rtx, 1);
ggc_add_rtx_root (&mips16_gp_pseudo_rtx, 1);
}
+
+static enum processor_type
+mips_parse_cpu (cpu_string)
+ const char *cpu_string;
+{
+ const char *p = cpu_string;
+ int seen_v = 0;
+ enum processor_type cpu;
+
+ /* We need to cope with the various "vr" prefixes for the NEC 4300
+ and 4100 processors. */
+ if (*p == 'v' || *p == 'V')
+ seen_v = 1, p++;
+
+ if (*p == 'r' || *p == 'R')
+ p++;
+
+ /* Since there is no difference between a R2000 and R3000 in
+ terms of the scheduler, we collapse them into just an R3000. */
+
+ cpu = PROCESSOR_DEFAULT;
+ switch (*p)
+ {
+ case '2':
+ if (!strcmp (p, "2000") || !strcmp (p, "2k") || !strcmp (p, "2K"))
+ cpu = PROCESSOR_R3000;
+ break;
+
+ case '3':
+ if (!strcmp (p, "3000") || !strcmp (p, "3k") || !strcmp (p, "3K"))
+ cpu = PROCESSOR_R3000;
+ else if (!strcmp (p, "3900"))
+ cpu = PROCESSOR_R3900;
+ break;
+
+ case '4':
+ if (!strcmp (p, "4000") || !strcmp (p, "4k") || !strcmp (p, "4K"))
+ cpu = PROCESSOR_R4000;
+ /* The vr4100 is a non-FP ISA III processor with some extra
+ instructions. */
+ else if (!strcmp (p, "4100"))
+ cpu = PROCESSOR_R4100;
+ /* The vr4300 is a standard ISA III processor, but with a different
+ pipeline. */
+ else if (!strcmp (p, "4300"))
+ cpu = PROCESSOR_R4300;
+ /* The r4400 is exactly the same as the r4000 from the compiler's
+ viewpoint. */
+ else if (!strcmp (p, "4400"))
+ cpu = PROCESSOR_R4000;
+ else if (!strcmp (p, "4600"))
+ cpu = PROCESSOR_R4600;
+ else if (!strcmp (p, "4650"))
+ cpu = PROCESSOR_R4650;
+
+ case '5':
+ if (!strcmp (p, "5000") || !strcmp (p, "5k") || !strcmp (p, "5K"))
+ cpu = PROCESSOR_R5000;
+ break;
+
+ case '6':
+ if (!strcmp (p, "6000") || !strcmp (p, "6k") || !strcmp (p, "6K"))
+ cpu = PROCESSOR_R6000;
+ break;
+
+ case '8':
+ if (!strcmp (p, "8000"))
+ cpu = PROCESSOR_R8000;
+ break;
+
+ case 'o':
+ if (!strcmp (p, "orion"))
+ cpu = PROCESSOR_R4600;
+ break;
+ }
+
+ if (seen_v
+ && cpu != PROCESSOR_R4300
+ && cpu != PROCESSOR_R4100
+ && cpu != PROCESSOR_R5000)
+ cpu = PROCESSOR_DEFAULT;
+
+ return cpu;
+}
diff --git a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h
index 1510ecc445d..dc2f8a27cd9 100644
--- a/gcc/config/mips/mips.h
+++ b/gcc/config/mips/mips.h
@@ -1,6 +1,6 @@
/* Definitions of target machine for GNU compiler. MIPS version.
Copyright (C) 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998
- 1999, 2000, 2001 Free Software Foundation, Inc.
+ 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
Contributed by A. Lichnewsky (lich@inria.inria.fr).
Changed by Michael Meissner (meissner@osf.org).
64 bit r4000 support by Ian Lance Taylor (ian@cygnus.com) and
@@ -71,7 +71,7 @@ enum processor_type {
};
/* Recast the cpu class to be the cpu attribute. */
-#define mips_cpu_attr ((enum attr_cpu)mips_cpu)
+#define mips_cpu_attr ((enum attr_cpu)mips_tune)
/* Which ABI to use. These are constants because abi64.h must check their
value at preprocessing time.
@@ -133,13 +133,16 @@ extern int mips_branch_likely; /* emit 'l' after br (branch likely) */
extern int mips_dbx_regno[]; /* Map register # to debug register # */
extern struct rtx_def *branch_cmp[2]; /* operands for compare */
extern enum cmp_type branch_type; /* what type of branch to use */
-extern enum processor_type mips_cpu; /* which cpu are we scheduling for */
+extern enum processor_type mips_arch; /* which cpu to codegen for */
+extern enum processor_type mips_tune; /* which cpu to schedule for */
extern enum mips_abicalls_type mips_abicalls;/* for svr4 abi pic calls */
extern int mips_isa; /* architectural level */
extern int mips16; /* whether generating mips16 code */
extern int mips16_hard_float; /* mips16 without -msoft-float */
extern int mips_entry; /* generate entry/exit for mips16 */
extern const char *mips_cpu_string; /* for -mcpu=<xxx> */
+extern const char *mips_arch_string; /* for -march=<xxx> */
+extern const char *mips_tune_string; /* for -mtune=<xxx> */
extern const char *mips_isa_string; /* for -mips{1,2,3,4} */
extern const char *mips_abi_string; /* for -mabi={32,n32,64} */
extern const char *mips_entry_string; /* for -mentry */
@@ -459,7 +462,7 @@ extern void sbss_section PARAMS ((void));
| TARGET_CPU_DEFAULT \
| TARGET_ENDIAN_DEFAULT), \
NULL}, \
-}
+}
/* Default target_flags if no switches are specified */
@@ -543,7 +546,7 @@ extern void sbss_section PARAMS ((void));
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.
+ 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.
@@ -560,6 +563,10 @@ extern void sbss_section PARAMS ((void));
SUBTARGET_TARGET_OPTIONS \
{ "cpu=", &mips_cpu_string, \
N_("Specify CPU for scheduling purposes")}, \
+ { "tune=", &mips_tune_string, \
+ N_("Specify CPU for scheduling purposes")}, \
+ { "arch=", &mips_arch_string, \
+ N_("Specify CPU for code generation purposes")}, \
{ "ips", &mips_isa_string, \
N_("Specify MIPS ISA")}, \
{ "entry", &mips_entry_string, \
@@ -589,7 +596,7 @@ extern void sbss_section PARAMS ((void));
#define ISA_HAS_64BIT_REGS (mips_isa == 3 || mips_isa == 4 \
)
-/* ISA has branch likely instructions (eg. mips2). */
+/* ISA has branch likely instructions (eg. mips2). */
#define ISA_HAS_BRANCHLIKELY (mips_isa != 1)
/* ISA has the conditional move instructions introduced in mips4. */
@@ -608,7 +615,7 @@ extern void sbss_section PARAMS ((void));
/* This is a catch all for the other new mips4 instructions: indexed load and
- indexed prefetch instructions, the FP madd,msub,nmadd, and nmsub instructions,
+ indexed prefetch instructions, the FP madd,msub,nmadd, and nmsub instructions,
and the FP recip and recip sqrt instructions */
#define ISA_HAS_FP4 (mips_isa == 4 \
)
@@ -1079,6 +1086,7 @@ while (0)
/* On Sun 4, this limit is 2048. We use 1500 to be safe,
since the length can run past this up to a continuation point. */
+#undef DBX_CONTIN_LENGTH
#define DBX_CONTIN_LENGTH 1500
/* How to renumber registers for dbx and gdb. */
@@ -1097,6 +1105,10 @@ while (0)
/* Before the prologue, RA lives in r31. */
#define INCOMING_RETURN_ADDR_RTX gen_rtx_REG (VOIDmode, GP_REG_FIRST + 31)
+/* Describe how we implement __builtin_eh_return. */
+#define EH_RETURN_DATA_REGNO(N) ((N) < 4 ? (N) + GP_ARG_FIRST : INVALID_REGNUM)
+#define EH_RETURN_STACKADJ_RTX gen_rtx_REG (Pmode, GP_REG_FIRST + 3)
+
/* Overrides for the COFF debug format. */
#define PUT_SDB_SCL(a) \
do { \
@@ -1471,7 +1483,7 @@ do { \
/* Define if loading in MODE, an integral mode narrower than BITS_PER_WORD
will either zero-extend or sign-extend. The value of this macro should
be the code that says which one of the two operations is implicitly
- done, NIL if none.
+ done, NIL if none.
When in 64 bit mode, mips_move_1word will sign extend SImode and CCmode
moves. All other referces are zero extended. */
@@ -1480,7 +1492,7 @@ do { \
? SIGN_EXTEND : ZERO_EXTEND)
/* Define this macro if it is advisable to hold scalars in registers
- in a wider mode than that declared by the program. In such cases,
+ in a wider mode than that declared by the program. In such cases,
the value is constrained to be within the bounds of the declared
type, but kept valid in the wider mode. The signedness of the
extension may differ from that of the type.
@@ -1712,7 +1724,7 @@ extern char mips_hard_regno_mode_ok[][FIRST_PSEUDO_REGISTER];
/* 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).
+ defined by a processor's "application binary interface" (ABI).
When this macro is defined, RTL is generated for this register
once, as with the stack pointer and frame pointer registers. If
this macro is not defined, it is up to the machine-dependent
@@ -1970,7 +1982,7 @@ extern enum reg_class mips_char_to_class[];
&& (VALUE) == CONST0_RTX (GET_MODE (VALUE)))
/* Letters in the range `Q' through `U' may be defined in a
- machine-dependent fashion to stand for arbitrary operand types.
+ machine-dependent fashion to stand for arbitrary operand types.
The machine description macro `EXTRA_CONSTRAINT' is passed the
operand as its first argument and the constraint letter as its
second operand.
@@ -2162,7 +2174,7 @@ extern struct mips_frame_info current_frame_info;
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.
+ 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.
@@ -2314,9 +2326,9 @@ extern struct mips_frame_info current_frame_info;
((MAX_ARGS_IN_REGISTERS*UNITS_PER_WORD) - FIRST_PARM_OFFSET (FNDECL))
/* Define this if it is the responsibility of the caller to
- allocate the area reserved for arguments passed in registers.
+ allocate the area reserved for arguments passed in registers.
If `ACCUMULATE_OUTGOING_ARGS' is also defined, the only effect
- of this macro is to determine whether the space is included in
+ of this macro is to determine whether the space is included in
`current_function_outgoing_args_size'. */
#define OUTGOING_REG_PARM_STACK_SPACE
@@ -2477,7 +2489,7 @@ typedef struct mips_args {
int fp_code; /* Mode of FP arguments (mips16) */
unsigned int num_adjusts; /* number of adjustments made */
/* Adjustments made to args pass in regs. */
- /* ??? The size is doubled to work around a
+ /* ??? The size is doubled to work around a
bug in the code that sets the adjustments
in function_arg. */
struct rtx_def *adjust[MAX_ARGS_IN_REGISTERS*2];
@@ -2615,7 +2627,7 @@ typedef struct mips_args {
/* A C statement to output, on the stream FILE, assembler code for a
- block of data that contains the constant parts of a trampoline.
+ block of data that contains the constant parts of a trampoline.
This code should not include a label--the label is taken care of
automatically. */
@@ -2665,7 +2677,7 @@ typedef struct mips_args {
#define CACHE_FLUSH_FUNC "_flush_cache"
#endif
-/* A C statement to initialize the variable parts of a trampoline.
+/* A C statement to initialize the variable parts of a trampoline.
ADDR is an RTX for the address of the trampoline; FNADDR is an
RTX for the address of the nested function; STATIC_CHAIN is an
RTX for the static chain value that should be passed to the
@@ -2763,7 +2775,7 @@ typedef struct mips_args {
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.
+ 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
@@ -2800,7 +2812,7 @@ typedef struct mips_args {
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.
+ 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. */
@@ -2861,7 +2873,7 @@ typedef struct mips_args {
to be generated at present. Also, the MIPS assembler does not
grok li.d Infinity. */
-/* ??? SGI Irix 6 assembler fails for CONST address, so reject them.
+/* ??? SGI Irix 6 assembler fails for CONST address, so reject them.
Note that the Irix 6 assembler problem may already be fixed.
Note also that the GET_CODE (X) == CONST test catches the mips16
gp pseudo reg (see mips16_gp_pseudo_reg) deciding it is not
@@ -2913,7 +2925,7 @@ typedef struct mips_args {
When PIC, convert addresses of the form memory (symbol+large int) to
memory (reg+large int). */
-
+
#define LEGITIMIZE_ADDRESS(X,OLDX,MODE,WIN) \
{ \
@@ -3014,7 +3026,7 @@ typedef struct mips_args {
function named by the symbol (such as what section it is in).
The macro definition, if any, is executed immediately after the
- rtl for DECL has been created and stored in `DECL_RTL (DECL)'.
+ rtl for DECL has been created and stored in `DECL_RTL (DECL)'.
The value of the rtl will be a `mem' whose address is a
`symbol_ref'.
@@ -3024,7 +3036,7 @@ typedef struct mips_args {
information).
The best way to modify the name string is by adding text to the
- beginning, with suitable punctuation to prevent any ambiguity.
+ 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.
@@ -3043,7 +3055,7 @@ typedef struct mips_args {
constants which are put in the .text section. We also record the
total length of all such strings; this total is used to decide
whether we need to split the constant table, and need not be
- precisely correct.
+ precisely correct.
When not mips16 code nor embedded PIC, if a symbol is in a
gp addresable section, SYMBOL_REF_FLAG is set prevent gcc from
@@ -3436,10 +3448,10 @@ while (0)
enum machine_mode xmode = GET_MODE (X); \
if (xmode == SFmode || xmode == DFmode) \
{ \
- if (mips_cpu == PROCESSOR_R3000 \
- || mips_cpu == PROCESSOR_R3900) \
+ if (mips_tune == PROCESSOR_R3000 \
+ || mips_tune == PROCESSOR_R3900) \
return COSTS_N_INSNS (2); \
- else if (mips_cpu == PROCESSOR_R6000) \
+ else if (mips_tune == PROCESSOR_R6000) \
return COSTS_N_INSNS (3); \
else \
return COSTS_N_INSNS (6); \
@@ -3462,11 +3474,11 @@ while (0)
enum machine_mode xmode = GET_MODE (X); \
if (xmode == SFmode) \
{ \
- if (mips_cpu == PROCESSOR_R3000 \
- || mips_cpu == PROCESSOR_R3900 \
- || mips_cpu == PROCESSOR_R5000) \
+ if (mips_tune == PROCESSOR_R3000 \
+ || mips_tune == PROCESSOR_R3900 \
+ || mips_tune == PROCESSOR_R5000) \
return COSTS_N_INSNS (4); \
- else if (mips_cpu == PROCESSOR_R6000) \
+ else if (mips_tune == PROCESSOR_R6000) \
return COSTS_N_INSNS (5); \
else \
return COSTS_N_INSNS (7); \
@@ -3474,23 +3486,23 @@ while (0)
\
if (xmode == DFmode) \
{ \
- if (mips_cpu == PROCESSOR_R3000 \
- || mips_cpu == PROCESSOR_R3900 \
- || mips_cpu == PROCESSOR_R5000) \
+ if (mips_tune == PROCESSOR_R3000 \
+ || mips_tune == PROCESSOR_R3900 \
+ || mips_tune == PROCESSOR_R5000) \
return COSTS_N_INSNS (5); \
- else if (mips_cpu == PROCESSOR_R6000) \
+ else if (mips_tune == PROCESSOR_R6000) \
return COSTS_N_INSNS (6); \
else \
return COSTS_N_INSNS (8); \
} \
\
- if (mips_cpu == PROCESSOR_R3000) \
+ if (mips_tune == PROCESSOR_R3000) \
return COSTS_N_INSNS (12); \
- else if (mips_cpu == PROCESSOR_R3900) \
+ else if (mips_tune == PROCESSOR_R3900) \
return COSTS_N_INSNS (2); \
- else if (mips_cpu == PROCESSOR_R6000) \
+ else if (mips_tune == PROCESSOR_R6000) \
return COSTS_N_INSNS (17); \
- else if (mips_cpu == PROCESSOR_R5000) \
+ else if (mips_tune == PROCESSOR_R5000) \
return COSTS_N_INSNS (5); \
else \
return COSTS_N_INSNS (10); \
@@ -3502,10 +3514,10 @@ while (0)
enum machine_mode xmode = GET_MODE (X); \
if (xmode == SFmode) \
{ \
- if (mips_cpu == PROCESSOR_R3000 \
- || mips_cpu == PROCESSOR_R3900) \
+ if (mips_tune == PROCESSOR_R3000 \
+ || mips_tune == PROCESSOR_R3900) \
return COSTS_N_INSNS (12); \
- else if (mips_cpu == PROCESSOR_R6000) \
+ else if (mips_tune == PROCESSOR_R6000) \
return COSTS_N_INSNS (15); \
else \
return COSTS_N_INSNS (23); \
@@ -3513,10 +3525,10 @@ while (0)
\
if (xmode == DFmode) \
{ \
- if (mips_cpu == PROCESSOR_R3000 \
- || mips_cpu == PROCESSOR_R3900) \
+ if (mips_tune == PROCESSOR_R3000 \
+ || mips_tune == PROCESSOR_R3900) \
return COSTS_N_INSNS (19); \
- else if (mips_cpu == PROCESSOR_R6000) \
+ else if (mips_tune == PROCESSOR_R6000) \
return COSTS_N_INSNS (16); \
else \
return COSTS_N_INSNS (36); \
@@ -3526,12 +3538,12 @@ while (0)
\
case UDIV: \
case UMOD: \
- if (mips_cpu == PROCESSOR_R3000 \
- || mips_cpu == PROCESSOR_R3900) \
+ if (mips_tune == PROCESSOR_R3000 \
+ || mips_tune == PROCESSOR_R3900) \
return COSTS_N_INSNS (35); \
- else if (mips_cpu == PROCESSOR_R6000) \
+ else if (mips_tune == PROCESSOR_R6000) \
return COSTS_N_INSNS (38); \
- else if (mips_cpu == PROCESSOR_R5000) \
+ else if (mips_tune == PROCESSOR_R5000) \
return COSTS_N_INSNS (36); \
else \
return COSTS_N_INSNS (69); \
@@ -3568,7 +3580,7 @@ while (0)
used.
For example, suppose an address that is equal to the sum of a
- register and a constant is used twice in the same basic block.
+ register and a constant is used twice in the same basic block.
When this macro is not defined, the address will be computed in
a register and memory references will be indirect through that
register. On machines where the cost of the addressing mode
@@ -3588,7 +3600,7 @@ while (0)
defining `ADDRESS_COST' to reflect this can cause two registers
to be live over a region of code where only one would have been
if `ADDRESS_COST' were not defined in that manner. This effect
- should be considered in the definition of this macro.
+ should be considered in the definition of this macro.
Equivalent costs should probably only be given to addresses with
different numbers of registers on machines with lots of registers.
@@ -3649,7 +3661,7 @@ while (0)
/* ??? Fix this to be right for the R8000. */
#define MEMORY_MOVE_COST(MODE,CLASS,TO_P) \
- (((mips_cpu == PROCESSOR_R4000 || mips_cpu == PROCESSOR_R6000) ? 6 : 4) \
+ (((mips_tune == PROCESSOR_R4000 || mips_tune == PROCESSOR_R6000) ? 6 : 4) \
+ memory_move_secondary_cost ((MODE), (CLASS), (TO_P)))
/* Define if copies to/from condition code registers should be avoided.
@@ -3665,7 +3677,7 @@ while (0)
/* ??? Fix this to be right for the R8000. */
#define BRANCH_COST \
((! TARGET_MIPS16 \
- && (mips_cpu == PROCESSOR_R4000 || mips_cpu == PROCESSOR_R6000)) \
+ && (mips_tune == PROCESSOR_R4000 || mips_tune == PROCESSOR_R6000)) \
? 2 : 1)
/* A C statement (sans semicolon) to update the integer variable COST
@@ -3701,7 +3713,7 @@ while (0)
Defining this macro does not affect the generated code (however,
incorrect definitions that omit an rtl code that may be matched
- by the predicate can cause the compiler to malfunction).
+ by the predicate can cause the compiler to malfunction).
Instead, it allows the table built by `genrecog' to be more
compact and efficient, thus speeding up the compiler. The most
important predicates to include in the list specified by this
@@ -3782,6 +3794,7 @@ while (0)
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
@@ -4093,6 +4106,7 @@ while (0)
#define LABEL_AFTER_LOC(STREAM)
#endif
+#undef ASM_OUTPUT_SOURCE_LINE
#define ASM_OUTPUT_SOURCE_LINE(STREAM, LINE) \
mips_output_lineno (STREAM, LINE)
@@ -4126,13 +4140,14 @@ do { \
/* A C statement (sans semicolon) to output to the stdio stream
STREAM any text necessary for declaring the name NAME of an
initialized variable which is being defined. This macro must
- output the label definition (perhaps using `ASM_OUTPUT_LABEL').
+ output the label definition (perhaps using `ASM_OUTPUT_LABEL').
The argument DECL is the `VAR_DECL' tree node representing the
variable.
If this macro is not defined, then the variable name is defined
in the usual manner as a label (by means of `ASM_OUTPUT_LABEL'). */
+#undef ASM_DECLARE_OBJECT_NAME
#define ASM_DECLARE_OBJECT_NAME(STREAM, NAME, DECL) \
do \
{ \
@@ -4193,6 +4208,7 @@ while (0)
mips_output_external(STREAM,DECL,NAME)
/* This says what to print at the end of the assembly file */
+#undef ASM_FILE_END
#define ASM_FILE_END(STREAM) mips_asm_file_end(STREAM)
@@ -4203,6 +4219,7 @@ while (0)
Also, switch files if we are optimizing the global pointer. */
+#undef ASM_DECLARE_FUNCTION_NAME
#define ASM_DECLARE_FUNCTION_NAME(STREAM,NAME,DECL) \
{ \
extern FILE *asm_out_text_file; \
@@ -4225,6 +4242,7 @@ while (0)
/* This is how to output an internal numbered label where
PREFIX is the class of label and NUM is the number within the class. */
+#undef ASM_OUTPUT_INTERNAL_LABEL
#define ASM_OUTPUT_INTERNAL_LABEL(STREAM,PREFIX,NUM) \
fprintf (STREAM, "%s%s%d:\n", LOCAL_LABEL_PREFIX, PREFIX, NUM)
@@ -4233,6 +4251,7 @@ while (0)
PREFIX is the class of label and NUM is the number within the class.
This is suitable for output with `assemble_name'. */
+#undef ASM_GENERATE_INTERNAL_LABEL
#define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \
sprintf ((LABEL), "*%s%s%ld", (LOCAL_LABEL_PREFIX), (PREFIX), (long)(NUM))
@@ -4257,11 +4276,11 @@ do { \
fprintf (STREAM, "\n"); \
} while (0)
-/* Likewise for 64 bit, `char' and `short' constants.
+/* Likewise for 64 bit, `char' and `short' constants.
FIXME: operand_subword can't handle some complex constant expressions
that output_addr_const can (for example it does not call
- simplify_subtraction). Since GAS can handle dword, even for mipsII,
+ simplify_subtraction). Since GAS can handle dword, even for mipsII,
rely on that to avoid operand_subword for most of the cases where this
matters. Try gcc.c-torture/compile/930326-1.c with -mips2 -mlong64,
or the same case with the type of 'i' changed to long long.
@@ -4348,6 +4367,7 @@ do { \
JUMP_TABLES_IN_TEXT_SECTION, because it is not conditional.
Instead, we use ASM_OUTPUT_CASE_LABEL to switch back to the .text
section if appropriate. */
+#undef ASM_OUTPUT_CASE_LABEL
#define ASM_OUTPUT_CASE_LABEL(FILE, PREFIX, NUM, INSN) \
do { \
if (TARGET_EMBEDDED_PIC || TARGET_MIPS16) \
@@ -4365,75 +4385,77 @@ do { \
/* This is how to output an assembler line to advance the location
counter by SIZE bytes. */
+#undef ASM_OUTPUT_SKIP
#define ASM_OUTPUT_SKIP(STREAM,SIZE) \
fprintf (STREAM, "\t.space\t%u\n", (SIZE))
/* This is how to output a string. */
+#undef ASM_OUTPUT_ASCII
#define ASM_OUTPUT_ASCII(STREAM, STRING, LEN) \
do { \
- register int i, c, len = (LEN), cur_pos = 17; \
- register const unsigned char *string = \
+ register int i_, len_ = (LEN), cur_pos_ = 17; \
+ register const unsigned char *string_ = \
(const unsigned char *)(STRING); \
fprintf ((STREAM), "\t.ascii\t\""); \
- for (i = 0; i < len; i++) \
+ for (i_ = 0; i_ < len_; i_++) \
{ \
- register int c = string[i]; \
+ register int c_ = string_[i_]; \
\
- switch (c) \
+ switch (c_) \
{ \
case '\"': \
case '\\': \
putc ('\\', (STREAM)); \
- putc (c, (STREAM)); \
- cur_pos += 2; \
+ putc (c_, (STREAM)); \
+ cur_pos_ += 2; \
break; \
\
case TARGET_NEWLINE: \
fputs ("\\n", (STREAM)); \
- if (i+1 < len \
- && (((c = string[i+1]) >= '\040' && c <= '~') \
- || c == TARGET_TAB)) \
- cur_pos = 32767; /* break right here */ \
+ if (i_+1 < len_ \
+ && (((c_ = string_[i_+1]) >= '\040' && c_ <= '~') \
+ || c_ == TARGET_TAB)) \
+ cur_pos_ = 32767; /* break right here */ \
else \
- cur_pos += 2; \
+ cur_pos_ += 2; \
break; \
\
case TARGET_TAB: \
fputs ("\\t", (STREAM)); \
- cur_pos += 2; \
+ cur_pos_ += 2; \
break; \
\
case TARGET_FF: \
fputs ("\\f", (STREAM)); \
- cur_pos += 2; \
+ cur_pos_ += 2; \
break; \
\
case TARGET_BS: \
fputs ("\\b", (STREAM)); \
- cur_pos += 2; \
+ cur_pos_ += 2; \
break; \
\
case TARGET_CR: \
fputs ("\\r", (STREAM)); \
- cur_pos += 2; \
+ cur_pos_ += 2; \
break; \
\
default: \
- if (c >= ' ' && c < 0177) \
+ if (c_ >= ' ' && c_ < 0177) \
{ \
- putc (c, (STREAM)); \
- cur_pos++; \
+ putc (c_, (STREAM)); \
+ cur_pos_++; \
} \
else \
{ \
- fprintf ((STREAM), "\\%03o", c); \
- cur_pos += 4; \
+ fprintf ((STREAM), "\\%03o", c_); \
+ cur_pos_ += 4; \
} \
} \
\
- if (cur_pos > 72 && i+1 < len) \
+ if (cur_pos_ > 72 && i_+1 < len_) \
{ \
- cur_pos = 17; \
+ cur_pos_ = 17; \
fprintf ((STREAM), "\"\n\t.ascii\t\""); \
} \
} \
@@ -4444,6 +4466,7 @@ do { \
#define SCCS_DIRECTIVE
/* Output #ident as a in the read-only data section. */
+#undef ASM_OUTPUT_IDENT
#define ASM_OUTPUT_IDENT(FILE, STRING) \
{ \
const char *p = STRING; \
@@ -4462,11 +4485,13 @@ do { \
#define DATA_SECTION_ASM_OP "\t.data" /* large data */
#define SDATA_SECTION_ASM_OP "\t.sdata" /* small data */
#define RDATA_SECTION_ASM_OP "\t.rdata" /* read-only data */
+#undef READONLY_DATA_SECTION
#define READONLY_DATA_SECTION rdata_section
#define SMALL_DATA_SECTION sdata_section
/* What other sections we support other than the normal .data/.text. */
+#undef EXTRA_SECTIONS
#define EXTRA_SECTIONS in_sdata, in_rdata
/* Define the additional functions to select our additional sections. */
@@ -4479,6 +4504,7 @@ do { \
if the constant is too large for sdata, and it's readonly, it
will go into the .rdata section. */
+#undef EXTRA_SECTION_FUNCTIONS
#define EXTRA_SECTION_FUNCTIONS \
void \
sdata_section () \
@@ -4503,8 +4529,10 @@ rdata_section () \
/* Given a decl node or constant node, choose the section to output it in
and select that section. */
+#undef SELECT_RTX_SECTION
#define SELECT_RTX_SECTION(MODE,RTX) mips_select_rtx_section (MODE, RTX)
+#undef SELECT_SECTION
#define SELECT_SECTION(DECL, RELOC) mips_select_section (DECL, RELOC)
diff --git a/gcc/config/mips/mips.md b/gcc/config/mips/mips.md
index a37464e569f..e15e8fe033d 100644
--- a/gcc/config/mips/mips.md
+++ b/gcc/config/mips/mips.md
@@ -26,6 +26,27 @@
;; ??? Currently does not have define_function_unit support for the R8000.
;; Must include new entries for fmadd in addition to existing entries.
+;; UNSPEC values used in mips.md
+;; Number USE
+;; 0 movsi_ul
+;; 1 movsi_us, get_fnaddr
+;; 3 eh_set_return
+;; 20 builtin_setjmp_setup
+;;
+;; UNSPEC_VOLATILE values
+;; 0 blockage
+;; 2 loadgp
+;; 3 builtin_longjmp
+;; 4 exception_receiver
+;; 10 consttable_qi
+;; 11 consttable_hi
+;; 12 consttable_si
+;; 13 consttable_di
+;; 14 consttable_sf
+;; 15 consttable_df
+;; 16 align_2
+;; 17 align_4
+;; 18 align_8
;; ....................
@@ -77,7 +98,7 @@
;; instruction which allows full access to the entire address space,
;; but we do not do so at present.
-(define_attr "length" ""
+(define_attr "length" ""
(cond [(eq_attr "type" "branch")
(cond [(lt (abs (minus (match_dup 1) (plus (pc) (const_int 4))))
(const_int 131072))
@@ -91,9 +112,9 @@
;; Attribute describing the processor
;; (define_attr "cpu" "default,r3000,r6000,r4000"
;; (const
-;; (cond [(eq (symbol_ref "mips_cpu") (symbol_ref "PROCESSOR_R3000")) (const_string "r3000")
-;; (eq (symbol_ref "mips_cpu") (symbol_ref "PROCESSOR_R4000")) (const_string "r4000")
-;; (eq (symbol_ref "mips_cpu") (symbol_ref "PROCESSOR_R6000")) (const_string "r6000")]
+;; (cond [(eq (symbol_ref "mips_tune") (symbol_ref "PROCESSOR_R3000")) (const_string "r3000")
+;; (eq (symbol_ref "mips_tune") (symbol_ref "PROCESSOR_R4000")) (const_string "r4000")
+;; (eq (symbol_ref "mips_tune") (symbol_ref "PROCESSOR_R6000")) (const_string "r6000")]
;; (const_string "default"))))
;; ??? Fix everything that tests this attribute.
@@ -103,7 +124,7 @@
;; Does the instruction have a mandatory delay slot?
;; The 3900, is (mostly) mips1, but does not have a mandatory load delay
-;; slot.
+;; slot.
(define_attr "dslot" "no,yes"
(if_then_else (ior (eq_attr "type" "branch,jump,call,xfer,hilo,fcmp")
(and (eq_attr "type" "load")
@@ -475,24 +496,24 @@
;; (define_function_unit "memory" 1 0 (eq_attr "type" "load") 3 0)
;; (define_function_unit "memory" 1 0 (eq_attr "type" "store") 1 0)
-;;
+;;
;; (define_function_unit "fp_comp" 1 0 (eq_attr "type" "fcmp") 2 0)
-;;
+;;
;; (define_function_unit "transfer" 1 0 (eq_attr "type" "xfer") 2 0)
;; (define_function_unit "transfer" 1 0 (eq_attr "type" "hilo") 3 0)
-;;
+;;
;; (define_function_unit "imuldiv" 1 1 (eq_attr "type" "imul") 17 0)
;; (define_function_unit "imuldiv" 1 1 (eq_attr "type" "idiv") 38 0)
-;;
+;;
;; (define_function_unit "adder" 1 1 (eq_attr "type" "fadd") 4 0)
;; (define_function_unit "adder" 1 1 (eq_attr "type" "fabs,fneg") 2 0)
-;;
+;;
;; (define_function_unit "mult" 1 1 (and (eq_attr "type" "fmul") (eq_attr "mode" "SF")) 7 0)
;; (define_function_unit "mult" 1 1 (and (eq_attr "type" "fmul") (eq_attr "mode" "DF")) 8 0)
-;;
+;;
;; (define_function_unit "divide" 1 1 (and (eq_attr "type" "fdiv") (eq_attr "mode" "SF")) 23 0)
;; (define_function_unit "divide" 1 1 (and (eq_attr "type" "fdiv") (eq_attr "mode" "DF")) 36 0)
-;;
+;;
;; (define_function_unit "sqrt" 1 1 (and (eq_attr "type" "fsqrt") (eq_attr "mode" "SF")) 54 0)
;; (define_function_unit "sqrt" 1 1 (and (eq_attr "type" "fsqrt") (eq_attr "mode" "DF")) 112 0)
@@ -1583,7 +1604,7 @@
(const_int 4)
(const_int 8))
(const_int 4)])])
-
+
;;
@@ -1605,7 +1626,7 @@
"TARGET_HARD_FLOAT && TARGET_DOUBLE_FLOAT"
"
{
- if (mips_cpu != PROCESSOR_R4300)
+ if (mips_arch != PROCESSOR_R4300)
emit_insn (gen_muldf3_internal (operands[0], operands[1], operands[2]));
else
emit_insn (gen_muldf3_r4300 (operands[0], operands[1], operands[2]));
@@ -1616,7 +1637,7 @@
[(set (match_operand:DF 0 "register_operand" "=f")
(mult:DF (match_operand:DF 1 "register_operand" "f")
(match_operand:DF 2 "register_operand" "f")))]
- "TARGET_HARD_FLOAT && TARGET_DOUBLE_FLOAT && mips_cpu != PROCESSOR_R4300"
+ "TARGET_HARD_FLOAT && TARGET_DOUBLE_FLOAT && mips_arch != PROCESSOR_R4300"
"mul.d\\t%0,%1,%2"
[(set_attr "type" "fmul")
(set_attr "mode" "DF")])
@@ -1625,7 +1646,7 @@
[(set (match_operand:DF 0 "register_operand" "=f")
(mult:DF (match_operand:DF 1 "register_operand" "f")
(match_operand:DF 2 "register_operand" "f")))]
- "TARGET_HARD_FLOAT && TARGET_DOUBLE_FLOAT && mips_cpu == PROCESSOR_R4300"
+ "TARGET_HARD_FLOAT && TARGET_DOUBLE_FLOAT && mips_arch == PROCESSOR_R4300"
"*
{
output_asm_insn (\"mul.d\\t%0,%1,%2\", operands);
@@ -1644,7 +1665,7 @@
"TARGET_HARD_FLOAT"
"
{
- if (mips_cpu != PROCESSOR_R4300)
+ if (mips_arch != PROCESSOR_R4300)
emit_insn( gen_mulsf3_internal (operands[0], operands[1], operands[2]));
else
emit_insn( gen_mulsf3_r4300 (operands[0], operands[1], operands[2]));
@@ -1655,7 +1676,7 @@
[(set (match_operand:SF 0 "register_operand" "=f")
(mult:SF (match_operand:SF 1 "register_operand" "f")
(match_operand:SF 2 "register_operand" "f")))]
- "TARGET_HARD_FLOAT && mips_cpu != PROCESSOR_R4300"
+ "TARGET_HARD_FLOAT && mips_arch != PROCESSOR_R4300"
"mul.s\\t%0,%1,%2"
[(set_attr "type" "fmul")
(set_attr "mode" "SF")])
@@ -1664,7 +1685,7 @@
[(set (match_operand:SF 0 "register_operand" "=f")
(mult:SF (match_operand:SF 1 "register_operand" "f")
(match_operand:SF 2 "register_operand" "f")))]
- "TARGET_HARD_FLOAT && mips_cpu == PROCESSOR_R4300"
+ "TARGET_HARD_FLOAT && mips_arch == PROCESSOR_R4300"
"*
{
output_asm_insn (\"mul.s\\t%0,%1,%2\", operands);
@@ -1692,7 +1713,7 @@
{
if (HAVE_mulsi3_mult3)
emit_insn (gen_mulsi3_mult3 (operands[0], operands[1], operands[2]));
- else if (mips_cpu != PROCESSOR_R4000 || TARGET_MIPS16)
+ else if (mips_arch != PROCESSOR_R4000 || TARGET_MIPS16)
emit_insn (gen_mulsi3_internal (operands[0], operands[1], operands[2]));
else
emit_insn (gen_mulsi3_r4000 (operands[0], operands[1], operands[2]));
@@ -1725,7 +1746,7 @@
(match_operand:SI 2 "register_operand" "d")))
(clobber (match_scratch:SI 3 "=h"))
(clobber (match_scratch:SI 4 "=a"))]
- "mips_cpu != PROCESSOR_R4000 || TARGET_MIPS16"
+ "mips_arch != PROCESSOR_R4000 || TARGET_MIPS16"
"mult\\t%1,%2"
[(set_attr "type" "imul")
(set_attr "mode" "SI")])
@@ -1737,7 +1758,7 @@
(clobber (match_scratch:SI 3 "=h"))
(clobber (match_scratch:SI 4 "=l"))
(clobber (match_scratch:SI 5 "=a"))]
- "mips_cpu == PROCESSOR_R4000 && !TARGET_MIPS16"
+ "mips_arch == PROCESSOR_R4000 && !TARGET_MIPS16"
"*
{
rtx xoperands[10];
@@ -1834,7 +1855,7 @@
"
{
- if (GENERATE_MULT3 || mips_cpu == PROCESSOR_R4000 || TARGET_MIPS16)
+ if (GENERATE_MULT3 || mips_arch == PROCESSOR_R4000 || TARGET_MIPS16)
emit_insn (gen_muldi3_internal2 (operands[0], operands[1], operands[2]));
else
emit_insn (gen_muldi3_internal (operands[0], operands[1], operands[2]));
@@ -1852,7 +1873,7 @@
(match_operand:DI 2 "register_operand" "d")))
(clobber (match_scratch:DI 3 "=h"))
(clobber (match_scratch:DI 4 "=a"))]
- "TARGET_64BIT && mips_cpu != PROCESSOR_R4000 && !TARGET_MIPS16"
+ "TARGET_64BIT && mips_arch != PROCESSOR_R4000 && !TARGET_MIPS16"
"dmult\\t%1,%2"
[(set_attr "type" "imul")
(set_attr "mode" "DI")])
@@ -1864,12 +1885,12 @@
(clobber (match_scratch:DI 3 "=h"))
(clobber (match_scratch:DI 4 "=l"))
(clobber (match_scratch:DI 5 "=a"))]
- "TARGET_64BIT && (GENERATE_MULT3 || mips_cpu == PROCESSOR_R4000 || TARGET_MIPS16)"
+ "TARGET_64BIT && (GENERATE_MULT3 || mips_arch == PROCESSOR_R4000 || TARGET_MIPS16)"
"*
{
if (GENERATE_MULT3)
output_asm_insn (\"dmult\\t%0,%1,%2\", operands);
- else
+ else
{
rtx xoperands[10];
@@ -2147,7 +2168,7 @@
(minus:SF (mult:SF (match_operand:SF 1 "register_operand" "f")
(match_operand:SF 2 "register_operand" "f"))
(match_operand:SF 3 "register_operand" "f")))]
-
+
"ISA_HAS_FP4 && TARGET_HARD_FLOAT"
"msub.s\\t%0,%3,%1,%2"
[(set_attr "type" "fmadd")
@@ -2280,7 +2301,7 @@
copy_to_mode_reg (SImode, GEN_INT (0x80000000)),
GEN_INT (0x6)));
}
-
+
DONE;
}")
@@ -2327,7 +2348,7 @@
copy_to_mode_reg (DImode, GEN_INT (0x80000000)),
GEN_INT (0x6)));
}
-
+
DONE;
}")
@@ -2365,7 +2386,7 @@
GEN_INT (0),
GEN_INT (0x7)));
}
-
+
DONE;
}")
@@ -2403,7 +2424,7 @@
GEN_INT (0),
GEN_INT (0x7)));
}
-
+
DONE;
}")
@@ -2502,7 +2523,7 @@
have_dep_anti = 1;
if (! have_dep_anti)
{
- /* No branch delay slots on mips16. */
+ /* No branch delay slots on mips16. */
if (which_alternative == 1)
return \"%(bnez\\t%0,1f\\n\\tbreak\\t%2\\n%~1:%)\";
else
@@ -2538,7 +2559,7 @@
copy_to_mode_reg (SImode, GEN_INT (0x80000000)),
GEN_INT (0x6)));
}
-
+
DONE;
}")
@@ -2556,7 +2577,7 @@
(define_expand "divdi3"
[(set (match_operand:DI 0 "register_operand" "=l")
(div:DI (match_operand:DI 1 "se_register_operand" "d")
- (match_operand:DI 2 "se_register_operand" "d")))
+ (match_operand:DI 2 "se_register_operand" "d")))
(clobber (match_scratch:DI 3 "=h"))
(clobber (match_scratch:DI 4 "=a"))]
"TARGET_64BIT && !optimize"
@@ -2578,7 +2599,7 @@
copy_to_mode_reg (DImode, GEN_INT (0x80000000)),
GEN_INT (0x6)));
}
-
+
DONE;
}")
@@ -2618,7 +2639,7 @@
copy_to_mode_reg (SImode, GEN_INT (0x80000000)),
GEN_INT (0x6)));
}
-
+
DONE;
}")
@@ -2658,7 +2679,7 @@
copy_to_mode_reg (DImode, GEN_INT (0x80000000)),
GEN_INT (0x6)));
}
-
+
DONE;
}")
@@ -2689,7 +2710,7 @@
GEN_INT (0),
GEN_INT (0x7)));
}
-
+
DONE;
}")
@@ -2720,7 +2741,7 @@
GEN_INT (0),
GEN_INT (0x7)));
}
-
+
DONE;
}")
@@ -2751,7 +2772,7 @@
GEN_INT (0),
GEN_INT (0x7)));
}
-
+
DONE;
}")
@@ -2782,7 +2803,7 @@
GEN_INT (0),
GEN_INT (0x7)));
}
-
+
DONE;
}")
@@ -2865,7 +2886,7 @@
return \"%(bltzl\\t%1,1f\\n\\tsubu\\t%0,%z2,%0\\n%~1:%)\";
else
return \"bgez\\t%1,1f%#\\n\\tsubu\\t%0,%z2,%0\\n%~1:\";
- }
+ }
else
return \"%(bgez\\t%1,1f\\n\\tmove\\t%0,%1\\n\\tsubu\\t%0,%z2,%0\\n%~1:%)\";
}"
@@ -2883,10 +2904,10 @@
dslots_jump_total++;
dslots_jump_filled++;
operands[2] = const0_rtx;
-
+
if (GET_CODE (operands[1]) == REG)
regno1 = REGNO (operands[1]);
- else
+ else
regno1 = REGNO (XEXP (operands[1], 0));
if (REGNO (operands[0]) == regno1)
@@ -3535,7 +3556,7 @@ move\\t%0,%z4\\n\\
{
if (TARGET_MIPS16)
return \"dsll\\t%0,%1,56\;dsra\\t%0,56\";
- return \"andi\\t%0,%1,0x00ff\";
+ return \"andi\\t%0,%1,0x00ff\";
}"
[(set_attr "type" "darith")
(set_attr "mode" "QI")
@@ -3567,7 +3588,7 @@ move\\t%0,%z4\\n\\
[(set_attr "type" "darith")
(set_attr "mode" "SI")
(set_attr "length" "8")])
-
+
(define_insn ""
[(set (match_operand:SI 0 "register_operand" "=d")
(truncate:SI (lshiftrt:DI (match_operand:DI 1 "se_register_operand" "d")
@@ -4487,7 +4508,7 @@ move\\t%0,%z4\\n\\
"
{
/* If the field does not start on a byte boundary, then fail. */
- if (INTVAL (operands[3]) % 8 != 0)
+ if (INTVAL (operands[3]) % 8 != 0)
FAIL;
/* MIPS I and MIPS II can only handle a 32bit field. */
@@ -4535,7 +4556,7 @@ move\\t%0,%z4\\n\\
"
{
/* If the field does not start on a byte boundary, then fail. */
- if (INTVAL (operands[3]) % 8 != 0)
+ if (INTVAL (operands[3]) % 8 != 0)
FAIL;
/* MIPS I and MIPS II can only handle a 32bit field. */
@@ -4583,7 +4604,7 @@ move\\t%0,%z4\\n\\
"
{
/* If the field does not start on a byte boundary, then fail. */
- if (INTVAL (operands[2]) % 8 != 0)
+ if (INTVAL (operands[2]) % 8 != 0)
FAIL;
/* MIPS I and MIPS II can only handle a 32bit field. */
@@ -5021,7 +5042,7 @@ move\\t%0,%z4\\n\\
"
{
rtx scratch = gen_rtx_REG (DImode,
- (REGNO (operands[0]) == REGNO (operands[2])
+ (REGNO (operands[0]) == REGNO (operands[2])
? REGNO (operands[2]) + 1
: REGNO (operands[2])));
@@ -5087,7 +5108,7 @@ move\\t%0,%z4\\n\\
;; use a TImode scratch reg.
(define_expand "reload_outdi"
- [(set (match_operand:DI 0 "" "=b")
+ [(set (match_operand:DI 0 "general_operand" "=b")
(match_operand:DI 1 "se_register_operand" "b"))
(clobber (match_operand:TI 2 "register_operand" "=&d"))]
"TARGET_64BIT"
@@ -6459,7 +6480,7 @@ move\\t%0,%z4\\n\\
(match_operand:SI 2 "register_operand" "d")))
(clobber (match_operand:SI 3 "register_operand" "=d"))]
"!TARGET_64BIT && !TARGET_DEBUG_G_MODE && !TARGET_MIPS16"
- "*
+ "*
{
operands[4] = const0_rtx;
dslots_jump_total += 3;
@@ -6817,7 +6838,7 @@ move\\t%0,%z4\\n\\
(match_operand:SI 2 "register_operand" "d")))
(clobber (match_operand:SI 3 "register_operand" "=d"))]
"!TARGET_64BIT && !TARGET_DEBUG_G_MODE && !TARGET_MIPS16"
- "*
+ "*
{
operands[4] = const0_rtx;
dslots_jump_total += 3;
@@ -7198,7 +7219,7 @@ move\\t%0,%z4\\n\\
(match_operand:SI 2 "register_operand" "d")))
(clobber (match_operand:SI 3 "register_operand" "=d"))]
"!TARGET_64BIT && !TARGET_DEBUG_G_MODE && !TARGET_MIPS16"
- "*
+ "*
{
operands[4] = const0_rtx;
dslots_jump_total += 3;
@@ -7553,7 +7574,7 @@ move\\t%0,%z4\\n\\
(define_insn "branch_fp"
[(set (pc)
- (if_then_else
+ (if_then_else
(match_operator:CC 0 "cmp_op"
[(match_operand:CC 2 "register_operand" "z")
(const_int 0)])
@@ -7574,7 +7595,7 @@ move\\t%0,%z4\\n\\
(define_insn "branch_fp_inverted"
[(set (pc)
- (if_then_else
+ (if_then_else
(match_operator:CC 0 "cmp_op"
[(match_operand:CC 2 "register_operand" "z")
(const_int 0)])
@@ -7597,7 +7618,7 @@ move\\t%0,%z4\\n\\
(define_insn "branch_zero"
[(set (pc)
- (if_then_else
+ (if_then_else
(match_operator:SI 0 "cmp_op"
[(match_operand:SI 2 "register_operand" "d")
(const_int 0)])
@@ -7618,7 +7639,7 @@ move\\t%0,%z4\\n\\
(define_insn "branch_zero_inverted"
[(set (pc)
- (if_then_else
+ (if_then_else
(match_operator:SI 0 "cmp_op"
[(match_operand:SI 2 "register_operand" "d")
(const_int 0)])
@@ -7639,7 +7660,7 @@ move\\t%0,%z4\\n\\
(define_insn "branch_zero_di"
[(set (pc)
- (if_then_else
+ (if_then_else
(match_operator:DI 0 "cmp_op"
[(match_operand:DI 2 "se_register_operand" "d")
(const_int 0)])
@@ -7660,7 +7681,7 @@ move\\t%0,%z4\\n\\
(define_insn "branch_zero_di_inverted"
[(set (pc)
- (if_then_else
+ (if_then_else
(match_operator:DI 0 "cmp_op"
[(match_operand:DI 2 "se_register_operand" "d")
(const_int 0)])
@@ -7683,7 +7704,7 @@ move\\t%0,%z4\\n\\
(define_insn "branch_equality"
[(set (pc)
- (if_then_else
+ (if_then_else
(match_operator:SI 0 "equality_op"
[(match_operand:SI 2 "register_operand" "d")
(match_operand:SI 3 "register_operand" "d")])
@@ -7704,7 +7725,7 @@ move\\t%0,%z4\\n\\
(define_insn "branch_equality_di"
[(set (pc)
- (if_then_else
+ (if_then_else
(match_operator:DI 0 "equality_op"
[(match_operand:DI 2 "se_register_operand" "d")
(match_operand:DI 3 "se_register_operand" "d")])
@@ -7725,7 +7746,7 @@ move\\t%0,%z4\\n\\
(define_insn "branch_equality_inverted"
[(set (pc)
- (if_then_else
+ (if_then_else
(match_operator:SI 0 "equality_op"
[(match_operand:SI 2 "register_operand" "d")
(match_operand:SI 3 "register_operand" "d")])
@@ -7746,7 +7767,7 @@ move\\t%0,%z4\\n\\
(define_insn "branch_equality_di_inverted"
[(set (pc)
- (if_then_else
+ (if_then_else
(match_operator:DI 0 "equality_op"
[(match_operand:DI 2 "se_register_operand" "d")
(match_operand:DI 3 "se_register_operand" "d")])
@@ -9024,7 +9045,7 @@ move\\t%0,%z4\\n\\
in a switch table, then used in a `j' instruction. */
else if (mips_abi != ABI_32 && mips_abi != ABI_O64)
return \"%*b\\t%l0\";
- else
+ else
return \"%*j\\t%l0\";
}"
[(set_attr "type" "jump")
@@ -9276,10 +9297,10 @@ move\\t%0,%z4\\n\\
/* Do the PIC jump. */
if (Pmode != DImode)
- emit_jump_insn (gen_casesi_internal (reg, operands[3],
+ emit_jump_insn (gen_casesi_internal (reg, operands[3],
gen_reg_rtx (SImode)));
else
- emit_jump_insn (gen_casesi_internal_di (reg, operands[3],
+ emit_jump_insn (gen_casesi_internal_di (reg, operands[3],
gen_reg_rtx (DImode)));
DONE;
@@ -9315,7 +9336,7 @@ lw\\t%2,%1-%S1(%2)\;addu\\t%2,%2,$31\;j\\t%2"
(define_insn "casesi_internal_di"
[(set (pc)
- (mem:DI (plus:DI (sign_extend:DI
+ (mem:DI (plus:DI (sign_extend:DI
(mult:SI (match_operand:SI 0 "register_operand" "d")
(const_int 4)))
(label_ref (match_operand 1 "" "")))))
@@ -9359,7 +9380,7 @@ ld\\t%2,%1-%S1(%2)\;daddu\\t%2,%2,$31\;j\\t%2"
"TARGET_ABICALLS && Pmode == DImode"
"")
-;; For o32/n32/n64, we need to arrange for longjmp to put the
+;; For o32/n32/n64, we need to arrange for longjmp to put the
;; target address in t9 so that we can use it for loading $gp.
(define_expand "builtin_longjmp"
@@ -9453,7 +9474,7 @@ ld\\t%2,%1-%S1(%2)\;daddu\\t%2,%2,$31\;j\\t%2"
}"
[(set_attr "type" "jump")
(set_attr "mode" "none")])
-
+
;; When generating embedded PIC code we need to get the address of the
;; current function. This specialized instruction does just that.
@@ -9468,6 +9489,93 @@ ld\\t%2,%1-%S1(%2)\;daddu\\t%2,%2,$31\;j\\t%2"
(set_attr "mode" "none")
(set_attr "length" "16")])
+;; This is used in compiling the unwind routines.
+(define_expand "eh_return"
+ [(use (match_operand 0 "general_operand" ""))
+ (use (match_operand 1 "general_operand" ""))]
+ ""
+ "
+{
+ enum machine_mode gpr_mode = TARGET_64BIT ? DImode : SImode;
+
+ if (GET_MODE (operands[1]) != gpr_mode)
+ operands[1] = convert_to_mode (gpr_mode, operands[1], 0);
+ if (TARGET_64BIT)
+ emit_insn (gen_eh_set_lr_di (operands[1]));
+ else
+ emit_insn (gen_eh_set_lr_si (operands[1]));
+
+ emit_move_insn (EH_RETURN_STACKADJ_RTX, operands[0]);
+ DONE;
+}")
+
+;; Clobber the return address on the stack. We can't expand this
+;; until we know where it will be put in the stack frame.
+
+(define_insn "eh_set_lr_si"
+ [(unspec [(match_operand:SI 0 "register_operand" "r")] 3)
+ (clobber (match_scratch:SI 1 "=&r"))]
+ "! TARGET_64BIT"
+ "#")
+
+(define_insn "eh_set_lr_di"
+ [(unspec [(match_operand:DI 0 "register_operand" "r")] 3)
+ (clobber (match_scratch:DI 1 "=&r"))]
+ "TARGET_64BIT"
+ "#")
+
+(define_split
+ [(unspec [(match_operand 0 "register_operand" "r")] 3)
+ (clobber (match_scratch 1 "=&r"))]
+ "reload_completed"
+ [(const_int 0)]
+ "
+{
+ HOST_WIDE_INT gp_offset;
+ rtx base;
+
+ compute_frame_size (get_frame_size ());
+ if (((current_frame_info.mask >> 31) & 1) == 0)
+ abort ();
+ gp_offset = current_frame_info.gp_sp_offset;
+
+ if (gp_offset < 32768)
+ base = stack_pointer_rtx;
+ else
+ {
+ base = operands[1];
+ emit_move_insn (base, GEN_INT (gp_offset));
+ if (Pmode == DImode)
+ emit_insn (gen_adddi3 (base, base, stack_pointer_rtx));
+ else
+ emit_insn (gen_addsi3 (base, base, stack_pointer_rtx));
+ gp_offset = 0;
+ }
+ emit_move_insn (gen_rtx_MEM (GET_MODE (operands[0]),
+ plus_constant (base, gp_offset)),
+ operands[0]);
+ DONE;
+}")
+
+(define_insn "exception_receiver"
+ [(unspec_volatile [(const_int 0)] 4)]
+ "TARGET_ABICALLS && (mips_abi == ABI_32 || mips_abi == ABI_O64)"
+ "*
+{
+ rtx loc;
+
+ operands[0] = pic_offset_table_rtx;
+ if (frame_pointer_needed)
+ loc = hard_frame_pointer_rtx;
+ else
+ loc = stack_pointer_rtx;
+ loc = plus_constant (loc, current_frame_info.args_size);
+ operands[1] = gen_rtx_MEM (Pmode, loc);
+
+ return mips_move_1word (operands, insn, 0);
+}"
+ [(set_attr "type" "load")
+ (set_attr "length" "8")])
;;
;; ....................
@@ -9560,10 +9668,10 @@ ld\\t%2,%1-%S1(%2)\;daddu\\t%2,%2,$31\;j\\t%2"
{
register rtx target = operands[0];
- if (GET_CODE (target) == SYMBOL_REF)
- return \"%*jal\\t%0\";
- else if (GET_CODE (target) == CONST_INT)
+ if (GET_CODE (target) == CONST_INT)
return \"%[li\\t%@,%0\\n\\t%*jal\\t%2,%@%]\";
+ else if (CONSTANT_ADDRESS_P (target))
+ return \"%*jal\\t%0\";
else
return \"%*jal\\t%2,%0\";
}"
@@ -9579,15 +9687,15 @@ ld\\t%2,%1-%S1(%2)\;daddu\\t%2,%2,$31\;j\\t%2"
{
register rtx target = operands[0];
- if (GET_CODE (target) == SYMBOL_REF)
+ if (GET_CODE (target) == CONST_INT)
+ return \"li\\t%^,%0\\n\\tjal\\t%2,%^\";
+ else if (CONSTANT_ADDRESS_P (target))
{
if (GET_MODE (target) == SImode)
return \"la\\t%^,%0\\n\\tjal\\t%2,%^\";
else
return \"dla\\t%^,%0\\n\\tjal\\t%2,%^\";
}
- else if (GET_CODE (target) == CONST_INT)
- return \"li\\t%^,%0\\n\\tjal\\t%2,%^\";
else if (REGNO (target) != PIC_FUNCTION_ADDR_REGNUM)
return \"move\\t%^,%0\\n\\tjal\\t%2,%^\";
else
@@ -9767,10 +9875,10 @@ ld\\t%2,%1-%S1(%2)\;daddu\\t%2,%2,$31\;j\\t%2"
{
register rtx target = operands[1];
- if (GET_CODE (target) == SYMBOL_REF)
- return \"%*jal\\t%1\";
- else if (GET_CODE (target) == CONST_INT)
+ if (GET_CODE (target) == CONST_INT)
return \"%[li\\t%@,%1\\n\\t%*jal\\t%3,%@%]\";
+ else if (CONSTANT_ADDRESS_P (target))
+ return \"%*jal\\t%1\";
else
return \"%*jal\\t%3,%1\";
}"
@@ -9787,15 +9895,15 @@ ld\\t%2,%1-%S1(%2)\;daddu\\t%2,%2,$31\;j\\t%2"
{
register rtx target = operands[1];
- if (GET_CODE (target) == SYMBOL_REF)
+ if (GET_CODE (target) == CONST_INT)
+ return \"li\\t%^,%1\\n\\tjal\\t%3,%^\";
+ else if (CONSTANT_ADDRESS_P (target))
{
if (GET_MODE (target) == SImode)
return \"la\\t%^,%1\\n\\tjal\\t%3,%^\";
else
return \"dla\\t%^,%1\\n\\tjal\\t%3,%^\";
}
- else if (GET_CODE (target) == CONST_INT)
- return \"li\\t%^,%1\\n\\tjal\\t%3,%^\";
else if (REGNO (target) != PIC_FUNCTION_ADDR_REGNUM)
return \"move\\t%^,%1\\n\\tjal\\t%3,%^\";
else
@@ -9810,7 +9918,7 @@ ld\\t%2,%1-%S1(%2)\;daddu\\t%2,%2,$31\;j\\t%2"
(call (mem:SI (match_operand:SI 1 "register_operand" "r"))
(match_operand 2 "" "i")))
(clobber (match_operand:SI 3 "register_operand" "=d"))]
- "!TARGET_MIPS16
+ "!TARGET_MIPS16
&& !(Pmode == DImode) && !TARGET_ABICALLS && TARGET_LONG_CALLS"
"%*jal\\t%3,%1"
[(set_attr "type" "call")
@@ -9821,7 +9929,7 @@ ld\\t%2,%1-%S1(%2)\;daddu\\t%2,%2,$31\;j\\t%2"
(call (mem:DI (match_operand:DI 1 "se_register_operand" "r"))
(match_operand 2 "" "i")))
(clobber (match_operand:SI 3 "register_operand" "=d"))]
- "!TARGET_MIPS16
+ "!TARGET_MIPS16
&& Pmode == DImode && !TARGET_ABICALLS && TARGET_LONG_CALLS"
"%*jal\\t%3,%1"
[(set_attr "type" "call")
@@ -9899,10 +10007,10 @@ ld\\t%2,%1-%S1(%2)\;daddu\\t%2,%2,$31\;j\\t%2"
{
register rtx target = operands[1];
- if (GET_CODE (target) == SYMBOL_REF)
- return \"%*jal\\t%1\";
- else if (GET_CODE (target) == CONST_INT)
+ if (GET_CODE (target) == CONST_INT)
return \"%[li\\t%@,%1\\n\\t%*jal\\t%4,%@%]\";
+ else if (CONSTANT_ADDRESS_P (target))
+ return \"%*jal\\t%1\";
else
return \"%*jal\\t%4,%1\";
}"
@@ -9922,15 +10030,15 @@ ld\\t%2,%1-%S1(%2)\;daddu\\t%2,%2,$31\;j\\t%2"
{
register rtx target = operands[1];
- if (GET_CODE (target) == SYMBOL_REF)
+ if (GET_CODE (target) == CONST_INT)
+ return \"li\\t%^,%1\\n\\tjal\\t%4,%^\";
+ else if (CONSTANT_ADDRESS_P (target))
{
if (GET_MODE (target) == SImode)
return \"la\\t%^,%1\\n\\tjal\\t%4,%^\";
else
return \"la\\t%^,%1\\n\\tjal\\t%4,%^\";
}
- else if (GET_CODE (target) == CONST_INT)
- return \"li\\t%^,%1\\n\\tjal\\t%4,%^\";
else if (REGNO (target) != PIC_FUNCTION_ADDR_REGNUM)
return \"move\\t%^,%1\\n\\tjal\\t%4,%^\";
else
@@ -9994,7 +10102,7 @@ ld\\t%2,%1-%S1(%2)\;daddu\\t%2,%2,$31\;j\\t%2"
;; operands[0] = gen_reg_rtx (SImode);
;; operands[1] = gen_rtx_MEM (SImode, stack_pointer_rtx);
;; MEM_VOLATILE_P (operands[1]) = TRUE;
-;;
+;;
;; /* fall through and generate default code */
;; }")
;;
@@ -10207,7 +10315,7 @@ ld\\t%2,%1-%S1(%2)\;daddu\\t%2,%2,$31\;j\\t%2"
(if_then_else:DI (match_dup 5)
(match_operand:DI 2 "se_reg_or_0_operand" "")
(match_operand:DI 3 "se_reg_or_0_operand" "")))]
- "ISA_HAS_CONDMOVE || ISA_HAS_INT_CONDMOVE"
+ "ISA_HAS_CONDMOVE || ISA_HAS_INT_CONDMOVE"
"
{
gen_conditional_move (operands);
diff --git a/gcc/config/mips/osfrose.h b/gcc/config/mips/osfrose.h
index e9ab26b07c3..26fc7448dab 100644
--- a/gcc/config/mips/osfrose.h
+++ b/gcc/config/mips/osfrose.h
@@ -115,32 +115,3 @@ Boston, MA 02111-1307, USA. */
/* Generate calls to memcpy, etc., not bcopy, etc. */
#define TARGET_MEM_FUNCTIONS
-
-/* A C statement to output assembler commands which will identify
- the object file as having been compiled with GNU CC (or another
- GNU compiler).
-
- If you don't define this macro, the string `gcc2_compiled.:' is
- output. This string is calculated to define a symbol which, on
- BSD systems, will never be defined for any other reason. GDB
- checks for the presence of this symbol when reading the symbol
- table of an executable.
-
- On non-BSD systems, you must arrange communication with GDB in
- some other fashion. If GDB is not used on your system, you can
- define this macro with an empty body.
-
- On OSF/1, gcc2_compiled. confuses the kernel debugger, so don't
- put it out. */
-
-#define ASM_IDENTIFY_GCC(STREAM)
-
-/* Identify the front-end which produced this file. To keep symbol
- space down, and not confuse kdb, only do this if the language is
- not C. */
-
-#define ASM_IDENTIFY_LANGUAGE(STREAM) \
-{ \
- if (strcmp (lang_identify (), "c") != 0) \
- output_lang_identify (STREAM); \
-}
diff --git a/gcc/config/mips/rtems.h b/gcc/config/mips/rtems.h
index 23463d7f81e..043677af90b 100644
--- a/gcc/config/mips/rtems.h
+++ b/gcc/config/mips/rtems.h
@@ -23,7 +23,7 @@ Boston, MA 02111-1307, USA. */
#undef CPP_PREDEFINES
#define CPP_PREDEFINES "-Dmips -DMIPSEB -D_mips -D_MIPSEB \
- -Drtems -D__rtems__ -Asystem(rtems)"
+ -D__rtems__ -Asystem(rtems)"
/* Generate calls to memcpy, memcmp and memset. */
#ifndef TARGET_MEM_FUNCTIONS
diff --git a/gcc/config/mips/rtems64.h b/gcc/config/mips/rtems64.h
index ccec7320282..615e2c95a8f 100644
--- a/gcc/config/mips/rtems64.h
+++ b/gcc/config/mips/rtems64.h
@@ -1,5 +1,5 @@
/* Definitions for rtems targeting a MIPS ORION using ecoff.
- Copyright (C) 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1997, 1998, 1999, 2000, 2002 Free Software Foundation, Inc.
Contributed by Joel Sherrill (joel@OARcorp.com).
This file is part of GNU CC.
@@ -23,7 +23,7 @@ Boston, MA 02111-1307, USA. */
#undef CPP_PREDEFINES
#define CPP_PREDEFINES "-Dmips -DMIPSEB -DR4000 -D_mips -D_MIPSEB -D_R4000 \
- -Drtems -D__rtems__ -Asystem=rtems"
+ -D__rtems__ -Asystem=rtems"
/* Generate calls to memcpy, memcmp and memset. */
#ifndef TARGET_MEM_FUNCTIONS
diff --git a/gcc/config/mips/sni-svr4.h b/gcc/config/mips/sni-svr4.h
index 077b96be1be..702a4e42727 100644
--- a/gcc/config/mips/sni-svr4.h
+++ b/gcc/config/mips/sni-svr4.h
@@ -68,15 +68,6 @@ Boston, MA 02111-1307, USA. */
#define NM_FLAGS "-p"
-/* wir haben ein Problem, wenn in einem Assembler-File keine .text-section
- erzeugt wird. Dann landen diese Pseudo-Labels in irgendeiner anderen
- section, z.B. .reginfo. Das macht den ld sehr ungluecklich. */
-
-#define ASM_IDENTIFY_GCC(mw_stream) \
- fprintf(mw_stream, "\t.ident \"gcc2_compiled.\"\n");
-
-#define ASM_IDENTIFY_LANGUAGE(STREAM)
-
#define ASM_LONG ".word\t"
#define ASM_GLOBAL ".rdata\n\t\t.globl\t"
diff --git a/gcc/config/mips/t-iris6 b/gcc/config/mips/t-iris6
index 6fab3fcf9ce..33a4d403e9a 100644
--- a/gcc/config/mips/t-iris6
+++ b/gcc/config/mips/t-iris6
@@ -22,10 +22,10 @@ CRTSTUFF_T_CFLAGS=-g1
# Build a shared libgcc library.
SHLIB_EXT = .so
SHLIB_LINK = $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -shared -nodefaultlibs \
- -Wl,-soname,@shlib_base_name@.so.0 \
+ -Wl,-soname,@shlib_base_name@.so.1 \
-o @shlib_base_name@.so @multilib_flags@ @shlib_objs@ -lc && \
- rm -f @shlib_base_name@.so.0 && \
- $(LN_S) @shlib_base_name@.so @shlib_base_name@.so.0
+ rm -f @shlib_base_name@.so.1 && \
+ $(LN_S) @shlib_base_name@.so @shlib_base_name@.so.1
# ??? Irix 6.5 seems to eat the option fine (if we somehow remove the
# -hidden_symbol option, which is documented to be ignored in conjunction
# with -exports_file), but fails to actually hide any symbols.
@@ -33,9 +33,9 @@ SHLIB_LINK = $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -shared -nodefaultlibs \
# $(slibdir) double quoted to protect it from expansion while building
# libgcc.mk. We want this delayed until actual install time.
-SHLIB_INSTALL = $(INSTALL_DATA) @shlib_base_name@.so $$(slibdir)/@shlib_base_name@.so.0; \
+SHLIB_INSTALL = $(INSTALL_DATA) @shlib_base_name@.so $$(slibdir)/@shlib_base_name@.so.1; \
rm -f $$(slibdir)/@shlib_base_name@.so; \
- $(LN_S) @shlib_base_name@.so.0 $$(slibdir)/@shlib_base_name@.so
+ $(LN_S) @shlib_base_name@.so.1 $$(slibdir)/@shlib_base_name@.so
SHLIB_MKMAP = $(srcdir)/mkmap-flat.awk
SHLIB_MAPFILES = $(srcdir)/libgcc-std.ver
@@ -53,3 +53,7 @@ fp-bit.c: $(srcdir)/config/fp-bit.c
echo '#define FLOAT' > fp-bit.c
echo '#undef US_SOFTWARE_GOFAST' >> fp-bit.c
cat $(srcdir)/config/fp-bit.c >> fp-bit.c
+
+# This is only needed in the static libgcc as a band-aid until gcc correctly
+# implements the N32/N64 ABI structure passing conventions
+LIB2FUNCS_STATIC_EXTRA = $(srcdir)/config/mips/irix6-libc-compat.c
diff --git a/gcc/config/mips/xm-mips.h b/gcc/config/mips/xm-mips.h
index ad49d7f4837..fcb31965c02 100644
--- a/gcc/config/mips/xm-mips.h
+++ b/gcc/config/mips/xm-mips.h
@@ -18,11 +18,6 @@ along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-
-/* #defines that need visibility everywhere. */
-#define FALSE 0
-#define TRUE 1
-
/* This describes the machine the compiler is hosted on. */
#define HOST_BITS_PER_CHAR 8
#define HOST_BITS_PER_SHORT 16
diff --git a/gcc/config/mn10200/mn10200.c b/gcc/config/mn10200/mn10200.c
index 9cafc33a114..1e520a84c60 100644
--- a/gcc/config/mn10200/mn10200.c
+++ b/gcc/config/mn10200/mn10200.c
@@ -28,7 +28,6 @@ Boston, MA 02111-1307, USA. */
#include "real.h"
#include "insn-config.h"
#include "conditions.h"
-#include "insn-flags.h"
#include "output.h"
#include "insn-attr.h"
#include "flags.h"
diff --git a/gcc/config/mn10200/t-mn10200 b/gcc/config/mn10200/t-mn10200
index 072d6f42b88..82f8a88439f 100644
--- a/gcc/config/mn10200/t-mn10200
+++ b/gcc/config/mn10200/t-mn10200
@@ -28,7 +28,9 @@ LIB1ASMFUNCS = _divhi3 \
_prologue \
_epilogue_a0 \
_epilogue_d0 \
- _epilogue_noreturn
+ _epilogue_noreturn \
+ _floatdisf \
+ _fixsfdi
# We do not have DF or DI types, so fake out the libgcc2 compilation.
diff --git a/gcc/config/mn10200/xm-mn10200.h b/gcc/config/mn10200/xm-mn10200.h
index 5e291d0991a..68baf3f06d2 100644
--- a/gcc/config/mn10200/xm-mn10200.h
+++ b/gcc/config/mn10200/xm-mn10200.h
@@ -19,10 +19,6 @@ along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-/* #defines that need visibility everywhere. */
-#define FALSE 0
-#define TRUE 1
-
/* This describes the machine the compiler is hosted on. */
#define HOST_BITS_PER_CHAR 8
#define HOST_BITS_PER_SHORT 16
diff --git a/gcc/config/mn10300/mn10300.c b/gcc/config/mn10300/mn10300.c
index bc6b1fc3c87..225c8789994 100644
--- a/gcc/config/mn10300/mn10300.c
+++ b/gcc/config/mn10300/mn10300.c
@@ -28,7 +28,6 @@ Boston, MA 02111-1307, USA. */
#include "real.h"
#include "insn-config.h"
#include "conditions.h"
-#include "insn-flags.h"
#include "output.h"
#include "insn-attr.h"
#include "flags.h"
diff --git a/gcc/config/mn10300/mn10300.h b/gcc/config/mn10300/mn10300.h
index e6425376e63..ebb6784ca70 100644
--- a/gcc/config/mn10300/mn10300.h
+++ b/gcc/config/mn10300/mn10300.h
@@ -698,7 +698,9 @@ struct cum_arg {int nbytes; };
&& INT_8_BITS (INTVAL (XEXP (XEXP (OP, 0), 1))))))
#define EXTRA_CONSTRAINT(OP, C) \
- ((C) == 'R' ? OK_FOR_R (OP) : (C) == 'S' ? GET_CODE (OP) == SYMBOL_REF : 0)
+ ((C) == 'R' ? OK_FOR_R (OP) \
+ : (C) == 'S' ? GET_CODE (OP) == SYMBOL_REF \
+ : 0)
/* Maximum number of registers that can appear in a valid memory address. */
@@ -1049,12 +1051,7 @@ do { char dstr[30]; \
#define DWARF2_ASM_LINE_DEBUG_INFO 1
-#define DBX_REGISTER_NUMBER(REGNO) \
- (REGNO_DATA_P ((REGNO)) ? (0 + (REGNO) - FIRST_DATA_REGNUM) \
- : REGNO_ADDRESS_P ((REGNO)) ? (4 + (REGNO) - FIRST_ADDRESS_REGNUM) \
- : REGNO_SP_P ((REGNO)) ? 8 \
- : REGNO_EXTENDED_P ((REGNO)) ? (15 + (REGNO) - FIRST_EXTENDED_REGNUM) \
- : -1)
+#define DBX_REGISTER_NUMBER(REGNO) (REGNO)
/* GDB always assumes the current function's frame begins at the value
of the stack pointer upon entry to the current function. Accessing
diff --git a/gcc/config/mn10300/xm-mn10300.h b/gcc/config/mn10300/xm-mn10300.h
index 84f888be488..5a210f3461c 100644
--- a/gcc/config/mn10300/xm-mn10300.h
+++ b/gcc/config/mn10300/xm-mn10300.h
@@ -19,10 +19,6 @@ along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-/* #defines that need visibility everywhere. */
-#define FALSE 0
-#define TRUE 1
-
/* This describes the machine the compiler is hosted on. */
#define HOST_BITS_PER_CHAR 8
#define HOST_BITS_PER_SHORT 16
diff --git a/gcc/config/nextstep.h b/gcc/config/nextstep.h
index 28deb16a3cc..76e1a3505a6 100644
--- a/gcc/config/nextstep.h
+++ b/gcc/config/nextstep.h
@@ -208,11 +208,6 @@ Boston, MA 02111-1307, USA. */
/* Define our object format type for crtstuff.c */
#define OBJECT_FORMAT_MACHO
-/* Don't use .gcc_compiled symbols to communicate with GDB;
- They interfere with numerically sorted symbol lists. */
-
-#undef ASM_IDENTIFY_GCC
-#define ASM_IDENTIFY_GCC(asm_out_file)
#undef INIT_SECTION_ASM_OP
#define INIT_SECTION_ASM_OP
#undef INVOKE__main
diff --git a/gcc/config/ns32k/ns32k.c b/gcc/config/ns32k/ns32k.c
index 42ad19d370f..3fbde5a8f16 100644
--- a/gcc/config/ns32k/ns32k.c
+++ b/gcc/config/ns32k/ns32k.c
@@ -27,7 +27,6 @@ Boston, MA 02111-1307, USA. */
#include "real.h"
#include "insn-config.h"
#include "conditions.h"
-#include "insn-flags.h"
#include "output.h"
#include "insn-attr.h"
#include "tree.h"
diff --git a/gcc/config/ns32k/xm-ns32k.h b/gcc/config/ns32k/xm-ns32k.h
index 3d1d7ac8fc1..5c912fc28a2 100644
--- a/gcc/config/ns32k/xm-ns32k.h
+++ b/gcc/config/ns32k/xm-ns32k.h
@@ -18,10 +18,6 @@ along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-/* #defines that need visibility everywhere. */
-#define FALSE 0
-#define TRUE 1
-
/* target machine dependencies.
tm.h is a symbolic link to the actual target specific file. */
#include "tm.h"
diff --git a/gcc/config/openbsd.h b/gcc/config/openbsd.h
index 87b3a60567f..ff1c1ad540b 100644
--- a/gcc/config/openbsd.h
+++ b/gcc/config/openbsd.h
@@ -78,12 +78,16 @@ Boston, MA 02111-1307, USA. */
since all code must be compiled with -pthread to work.
This two-stage defines makes it easy to pick that for targets that
have subspecs. */
+#ifdef CPP_CPU_SPEC
+#define OBSD_CPP_SPEC "%(cpp_cpu) %{posix:-D_POSIX_SOURCE} %{pthread:-D_POSIX_THREADS}"
+#else
#define OBSD_CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_POSIX_THREADS}"
+#endif
/* LIB_SPEC appropriate for OpenBSD. Select the appropriate libc,
depending on profiling and threads. Basically,
-lc(_r)?(_p)?, select _r for threads, and _p for p or pg. */
-#define OBSD_LIB_SPEC "-lc%{pthread:_r}%{p:_p}%{!p:%{pg:_p}}"
+#define OBSD_LIB_SPEC "%{!shared:-lc%{pthread:_r}%{p:_p}%{!p:%{pg:_p}}}"
#ifndef OBSD_HAS_CORRECT_SPECS
@@ -103,6 +107,7 @@ Boston, MA 02111-1307, USA. */
pic code. */
#undef ASM_SPEC
#define ASM_SPEC "%{fpic:-k} %{fPIC:-k -K} %|"
+
#else
/* Since we use gas, stdin -> - is a good idea, but we don't want to
override native specs just for that. */
@@ -116,10 +121,10 @@ Boston, MA 02111-1307, USA. */
#undef LINK_SPEC
#ifdef OBSD_NO_DYNAMIC_LIBRARIES
#define LINK_SPEC \
- "%{!nostdlib:%{!r*:%{!e*:-e start}}} -dc -dp %{assert*}"
+ "%{g:%{!nostdlib:-L/usr/lib/debug}} %{!nostdlib:%{!r*:%{!e*:-e start}}} -dc -dp %{assert*}"
#else
#define LINK_SPEC \
- "%{!shared:%{!nostdlib:%{!r*:%{!e*:-e start}}}} %{shared:-Bshareable -x} -dc -dp %{R*} %{static:-Bstatic} %{assert*}"
+ "%{g:%{!nostdlib:-L/usr/lib/debug}} %{!shared:%{!nostdlib:%{!r*:%{!e*:-e start}}}} %{shared:-Bshareable -x} -dc -dp %{R*} %{static:-Bstatic} %{assert*}"
#endif
#undef LIB_SPEC
diff --git a/gcc/config/pa/lib2funcs.asm b/gcc/config/pa/lib2funcs.asm
index d2a0f762225..bf632d5e2af 100644
--- a/gcc/config/pa/lib2funcs.asm
+++ b/gcc/config/pa/lib2funcs.asm
@@ -37,7 +37,6 @@
.SUBSPA $MILLICODE$,QUAD=0,ALIGN=8,ACCESS=44,SORT=8
.IMPORT $$dyncall,MILLICODE
-; gcc_compiled.:
.SPACE $TEXT$
.SUBSPA $CODE$
diff --git a/gcc/config/pa/long_double.h b/gcc/config/pa/long_double.h
index 92d03761e0f..e65f15f9345 100644
--- a/gcc/config/pa/long_double.h
+++ b/gcc/config/pa/long_double.h
@@ -52,6 +52,7 @@ do { long value[4]; \
we can massage its return value for PA64. */
#define FIX_TRUNCTFSI2_LIBCALL \
(TARGET_64BIT ? "__U_Qfcnvfxt_quad_to_sgl" : "_U_Qfcnvfxt_quad_to_sgl")
+#define FIXUNS_TRUNCTFSI2_LIBCALL "_U_Qfcnvfxt_quad_to_usgl"
#define FIX_TRUNCTFDI2_LIBCALL "_U_Qfcnvfxt_quad_to_dbl"
#define EQTF2_LIBCALL "_U_Qfeq"
#define NETF2_LIBCALL "_U_Qfne"
@@ -89,7 +90,7 @@ do { long value[4]; \
floatditf_libfunc = gen_rtx_SYMBOL_REF (Pmode, FLOATDITF2_LIBCALL); \
fixtfsi_libfunc = gen_rtx_SYMBOL_REF (Pmode, FIX_TRUNCTFSI2_LIBCALL);\
fixtfdi_libfunc = gen_rtx_SYMBOL_REF (Pmode, FIX_TRUNCTFDI2_LIBCALL);\
- fixunstfsi_libfunc = gen_rtx_SYMBOL_REF (Pmode, FIX_TRUNCTFSI2_LIBCALL); \
+ fixunstfsi_libfunc = gen_rtx_SYMBOL_REF (Pmode, FIXUNS_TRUNCTFSI2_LIBCALL);\
fixunstfdi_libfunc = gen_rtx_SYMBOL_REF (Pmode, FIX_TRUNCTFDI2_LIBCALL); \
eqtf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, EQTF2_LIBCALL); \
netf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, NETF2_LIBCALL); \
diff --git a/gcc/config/pa/pa-hpux10.h b/gcc/config/pa/pa-hpux10.h
index 22223e10c73..94d8a662ee7 100644
--- a/gcc/config/pa/pa-hpux10.h
+++ b/gcc/config/pa/pa-hpux10.h
@@ -1,5 +1,5 @@
/* Definitions of target machine for GNU compiler, for HP PA-RISC 1.1
- Copyright (C) 1995, 1996, 1997, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1995, 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
Contributed by Tim Moore (moore@defmacro.cs.utah.edu)
This file is part of GNU CC.
@@ -40,6 +40,9 @@ Boston, MA 02111-1307, USA. */
%{p: -L/lib/libp/ -lc}\
%{pg: -L/lib/libp/ -lc}}"
+#undef THREAD_MODEL_SPEC
+#define THREAD_MODEL_SPEC "%{!threads:single}%{threads:dce}"
+
/* Under hpux10, the normal location of the `ld' and `as' programs is the
/usr/ccs/bin directory. */
diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c
index a7a0b9ec002..47b02c52476 100644
--- a/gcc/config/pa/pa.c
+++ b/gcc/config/pa/pa.c
@@ -28,7 +28,6 @@ Boston, MA 02111-1307, USA. */
#include "real.h"
#include "insn-config.h"
#include "conditions.h"
-#include "insn-flags.h"
#include "output.h"
#include "insn-attr.h"
#include "flags.h"
@@ -183,8 +182,9 @@ override_options ()
write_symbols = NO_DEBUG;
}
- /* We always generate PIC code when in 64bit mode. */
- if (TARGET_64BIT)
+ /* We only support the "big PIC" model now. And we always generate PIC
+ code when in 64bit mode. */
+ if (flag_pic == 1 || TARGET_64BIT)
flag_pic = 2;
/* Register global variables with the garbage collector. */
@@ -377,13 +377,14 @@ move_operand (op, mode)
op = XEXP (op, 0);
- /* The LO_SUM part of a DLT reference is not considered a move_operand;
- we must reject it here since it must be accepted by memory_address_p. */
+ /* We consider a LO_SUM DLT reference a move_operand now since it has
+ been merged into the normal movsi/movdi patterns. */
if (GET_CODE (op) == LO_SUM
&& GET_CODE (XEXP (op, 0)) == REG
&& REG_OK_FOR_BASE_P (XEXP (op, 0))
- && GET_CODE (XEXP (op, 1)) == UNSPEC)
- return 0;
+ && GET_CODE (XEXP (op, 1)) == UNSPEC
+ && GET_MODE (op) == Pmode)
+ return 1;
/* Since move_operand is only used for source operands, we can always
allow scaled indexing! */
@@ -712,22 +713,15 @@ legitimize_pic_address (orig, mode, reg)
if (reg == 0)
abort ();
- if (flag_pic == 2)
- {
- emit_move_insn (reg,
- gen_rtx_PLUS (word_mode, pic_offset_table_rtx,
- gen_rtx_HIGH (word_mode, orig)));
- pic_ref
- = gen_rtx_MEM (Pmode,
- gen_rtx_LO_SUM (Pmode, reg,
- gen_rtx_UNSPEC (Pmode,
- gen_rtvec (1, orig),
- 0)));
- }
- else
- pic_ref = gen_rtx_MEM (Pmode,
- gen_rtx_PLUS (Pmode, pic_offset_table_rtx,
- orig));
+ emit_move_insn (reg,
+ gen_rtx_PLUS (word_mode, pic_offset_table_rtx,
+ gen_rtx_HIGH (word_mode, orig)));
+ pic_ref
+ = gen_rtx_MEM (Pmode,
+ gen_rtx_LO_SUM (Pmode, reg,
+ gen_rtx_UNSPEC (Pmode,
+ gen_rtvec (1, orig),
+ 0)));
current_function_uses_pic_offset_table = 1;
RTX_UNCHANGING_P (pic_ref) = 1;
@@ -1341,8 +1335,9 @@ emit_move_sequence (operands, mode, scratch_reg)
return 1;
}
/* Handle secondary reloads for SAR. These occur when trying to load
- the SAR from memory a FP register, or with a constant. */
+ the SAR from memory, FP register, or with a constant. */
else if (GET_CODE (operand0) == REG
+ && REGNO (operand0) < FIRST_PSEUDO_REGISTER
&& REGNO_REG_CLASS (REGNO (operand0)) == SHIFT_REGS
&& (GET_CODE (operand1) == MEM
|| GET_CODE (operand1) == CONST_INT
@@ -2988,70 +2983,75 @@ hppa_expand_prologue()
/* Save RP first. The calling conventions manual states RP will
always be stored into the caller's frame at sp-20 or sp - 16
depending on which ABI is in use. */
- if ((regs_ever_live[2] || profile_flag) && TARGET_64BIT)
- store_reg (2, -16, STACK_POINTER_REGNUM);
-
- if ((regs_ever_live[2] || profile_flag) && ! TARGET_64BIT)
- store_reg (2, -20, STACK_POINTER_REGNUM);
+ if (regs_ever_live[2] || profile_flag)
+ store_reg (2, TARGET_64BIT ? -16 : -20, STACK_POINTER_REGNUM);
/* Allocate the local frame and set up the frame pointer if needed. */
- if (actual_fsize)
- {
- if (frame_pointer_needed)
- {
- /* Copy the old frame pointer temporarily into %r1. Set up the
- new stack pointer, then store away the saved old frame pointer
- into the stack at sp+actual_fsize and at the same time update
- the stack pointer by actual_fsize bytes. Two versions, first
- handles small (<8k) frames. The second handles large (>8k)
- frames. */
- emit_move_insn (tmpreg, frame_pointer_rtx);
- emit_move_insn (frame_pointer_rtx, stack_pointer_rtx);
- if (VAL_14_BITS_P (actual_fsize))
- emit_insn (gen_post_store (stack_pointer_rtx, tmpreg, size_rtx));
- else
- {
- /* It is incorrect to store the saved frame pointer at *sp,
- then increment sp (writes beyond the current stack boundary).
-
- So instead use stwm to store at *sp and post-increment the
- stack pointer as an atomic operation. Then increment sp to
- finish allocating the new frame. */
- emit_insn (gen_post_store (stack_pointer_rtx, tmpreg,
- GEN_INT (64)));
+ if (actual_fsize != 0)
+ {
+ if (frame_pointer_needed)
+ {
+ /* Copy the old frame pointer temporarily into %r1. Set up the
+ new stack pointer, then store away the saved old frame pointer
+ into the stack at sp+actual_fsize and at the same time update
+ the stack pointer by actual_fsize bytes. Two versions, first
+ handles small (<8k) frames. The second handles large (>=8k)
+ frames. */
+ emit_move_insn (tmpreg, frame_pointer_rtx);
+ emit_move_insn (frame_pointer_rtx, stack_pointer_rtx);
+ if (VAL_14_BITS_P (actual_fsize))
+ emit_insn (gen_post_store (stack_pointer_rtx, tmpreg, size_rtx));
+ else
+ {
+ /* It is incorrect to store the saved frame pointer at *sp,
+ then increment sp (writes beyond the current stack boundary).
+
+ So instead use stwm to store at *sp and post-increment the
+ stack pointer as an atomic operation. Then increment sp to
+ finish allocating the new frame. */
+ int adjust1 = 8192 - 64;
+ int adjust2 = actual_fsize - adjust1;
+ rtx delta = GEN_INT (adjust1);
+ emit_insn (gen_post_store (stack_pointer_rtx, tmpreg, delta));
+ set_reg_plus_d (STACK_POINTER_REGNUM,
+ STACK_POINTER_REGNUM,
+ adjust2);
+ }
+ /* Prevent register spills from being scheduled before the
+ stack pointer is raised. Necessary as we will be storing
+ registers using the frame pointer as a base register, and
+ we happen to set fp before raising sp. */
+ emit_insn (gen_blockage ());
+ }
+ /* no frame pointer needed. */
+ else
+ {
+ /* In some cases we can perform the first callee register save
+ and allocating the stack frame at the same time. If so, just
+ make a note of it and defer allocating the frame until saving
+ the callee registers. */
+ if (VAL_14_BITS_P (actual_fsize)
+ && local_fsize == 0
+ && ! profile_flag
+ && ! flag_pic)
+ merge_sp_adjust_with_store = 1;
+ /* Can not optimize. Adjust the stack frame by actual_fsize
+ bytes. */
+ else
set_reg_plus_d (STACK_POINTER_REGNUM,
STACK_POINTER_REGNUM,
- actual_fsize - 64);
- }
- }
- /* no frame pointer needed. */
- else
- {
- /* In some cases we can perform the first callee register save
- and allocating the stack frame at the same time. If so, just
- make a note of it and defer allocating the frame until saving
- the callee registers. */
- if (VAL_14_BITS_P (-actual_fsize)
- && local_fsize == 0
- && ! profile_flag
- && ! flag_pic)
- merge_sp_adjust_with_store = 1;
- /* Can not optimize. Adjust the stack frame by actual_fsize bytes. */
- else if (actual_fsize != 0)
- set_reg_plus_d (STACK_POINTER_REGNUM,
- STACK_POINTER_REGNUM,
- actual_fsize);
- }
- }
+ actual_fsize);
+ }
- /* The hppa calling conventions say that %r19, the pic offset
- register, is saved at sp - 32 (in this function's frame) when
- generating PIC code. FIXME: What is the correct thing to do
- for functions which make no calls and allocate no frame? Do
- we need to allocate a frame, or can we just omit the save? For
- now we'll just omit the save. */
- if (actual_fsize != 0 && flag_pic && !TARGET_64BIT)
- store_reg (PIC_OFFSET_TABLE_REGNUM, -32, STACK_POINTER_REGNUM);
+ /* The hppa calling conventions say that %r19, the pic offset
+ register, is saved at sp - 32 (in this function's frame)
+ when generating PIC code. FIXME: What is the correct thing
+ to do for functions which make no calls and allocate no
+ frame? Do we need to allocate a frame, or can we just omit
+ the save? For now we'll just omit the save. */
+ if (flag_pic && !TARGET_64BIT)
+ store_reg (PIC_OFFSET_TABLE_REGNUM, -32, STACK_POINTER_REGNUM);
+ }
/* Profiling code.
@@ -3225,8 +3225,9 @@ void
hppa_expand_epilogue ()
{
rtx tmpreg;
- int offset,i;
- int merge_sp_adjust_with_load = 0;
+ int offset, i;
+ int merge_sp_adjust_with_load = 0;
+ int ret_off = 0;
/* We will use this often. */
tmpreg = gen_rtx_REG (word_mode, 1);
@@ -3234,23 +3235,24 @@ hppa_expand_epilogue ()
/* Try to restore RP early to avoid load/use interlocks when
RP gets used in the return (bv) instruction. This appears to still
be necessary even when we schedule the prologue and epilogue. */
- if (frame_pointer_needed
- && !TARGET_64BIT
- && (regs_ever_live [2] || profile_flag))
- load_reg (2, -20, FRAME_POINTER_REGNUM);
- else if (TARGET_64BIT && frame_pointer_needed
- && (regs_ever_live[2] || profile_flag))
- load_reg (2, -16, FRAME_POINTER_REGNUM);
- else if (TARGET_64BIT
- && ! frame_pointer_needed
- && (regs_ever_live[2] || profile_flag)
- && VAL_14_BITS_P (actual_fsize + 20))
- load_reg (2, - (actual_fsize + 16), STACK_POINTER_REGNUM);
- /* No frame pointer, and stack is smaller than 8k. */
- else if (! frame_pointer_needed
- && VAL_14_BITS_P (actual_fsize + 20)
- && (regs_ever_live[2] || profile_flag))
- load_reg (2, - (actual_fsize + 20), STACK_POINTER_REGNUM);
+ if (regs_ever_live [2] || profile_flag)
+ {
+ ret_off = TARGET_64BIT ? -16 : -20;
+ if (frame_pointer_needed)
+ {
+ load_reg (2, ret_off, FRAME_POINTER_REGNUM);
+ ret_off = 0;
+ }
+ else
+ {
+ /* No frame pointer, and stack is smaller than 8k. */
+ if (VAL_14_BITS_P (ret_off - actual_fsize))
+ {
+ load_reg (2, ret_off - actual_fsize, STACK_POINTER_REGNUM);
+ ret_off = 0;
+ }
+ }
+ }
/* General register restores. */
if (frame_pointer_needed)
@@ -3271,9 +3273,9 @@ hppa_expand_epilogue ()
/* Only for the first load.
merge_sp_adjust_with_load holds the register load
with which we will merge the sp adjustment. */
- if (VAL_14_BITS_P (actual_fsize + 20)
+ if (merge_sp_adjust_with_load == 0
&& local_fsize == 0
- && ! merge_sp_adjust_with_load)
+ && VAL_14_BITS_P (-actual_fsize))
merge_sp_adjust_with_load = i;
else
load_reg (i, offset, STACK_POINTER_REGNUM);
@@ -3313,47 +3315,10 @@ hppa_expand_epilogue ()
This is necessary as we must not cut the stack back before all the
restores are finished. */
emit_insn (gen_blockage ());
- /* No frame pointer, but we have a stack greater than 8k. We restore
- %r2 very late in this case. (All other cases are restored as early
- as possible.) */
- if (! frame_pointer_needed
- && ! VAL_14_BITS_P (actual_fsize + 20)
- && ! TARGET_64BIT
- && (regs_ever_live[2] || profile_flag))
- {
- set_reg_plus_d (STACK_POINTER_REGNUM,
- STACK_POINTER_REGNUM,
- - actual_fsize);
-
- /* This used to try and be clever by not depending on the value in
- %r30 and instead use the value held in %r1 (so that the 2nd insn
- which sets %r30 could be put in the delay slot of the return insn).
-
- That won't work since if the stack is exactly 8k set_reg_plus_d
- doesn't set %r1, just %r30. */
- load_reg (2, - 20, STACK_POINTER_REGNUM);
- }
- else if (! frame_pointer_needed
- && ! VAL_14_BITS_P (actual_fsize + 20)
- && TARGET_64BIT
- && (regs_ever_live[2] || profile_flag))
- {
- set_reg_plus_d (STACK_POINTER_REGNUM,
- STACK_POINTER_REGNUM,
- - actual_fsize);
-
- /* This used to try and be clever by not depending on the value in
- %r30 and instead use the value held in %r1 (so that the 2nd insn
- which sets %r30 could be put in the delay slot of the return insn).
-
- That won't work since if the stack is exactly 8k set_reg_plus_d
- doesn't set %r1, just %r30. */
- load_reg (2, - 16, STACK_POINTER_REGNUM);
- }
/* Reset stack pointer (and possibly frame pointer). The stack
pointer is initially set to fp + 64 to avoid a race condition. */
- else if (frame_pointer_needed)
+ if (frame_pointer_needed)
{
set_reg_plus_d (STACK_POINTER_REGNUM, FRAME_POINTER_REGNUM, 64);
emit_insn (gen_pre_load (frame_pointer_rtx,
@@ -3361,14 +3326,25 @@ hppa_expand_epilogue ()
GEN_INT (-64)));
}
/* If we were deferring a callee register restore, do it now. */
- else if (! frame_pointer_needed && merge_sp_adjust_with_load)
- emit_insn (gen_pre_load (gen_rtx_REG (word_mode, merge_sp_adjust_with_load),
- stack_pointer_rtx,
- GEN_INT (- actual_fsize)));
+ else if (merge_sp_adjust_with_load)
+ {
+ rtx delta = GEN_INT (-actual_fsize);
+ emit_insn (gen_pre_load (gen_rtx_REG (word_mode,
+ merge_sp_adjust_with_load),
+ stack_pointer_rtx,
+ delta));
+ }
else if (actual_fsize != 0)
- set_reg_plus_d (STACK_POINTER_REGNUM,
- STACK_POINTER_REGNUM,
- - actual_fsize);
+ {
+ set_reg_plus_d (STACK_POINTER_REGNUM,
+ STACK_POINTER_REGNUM,
+ - actual_fsize);
+ }
+
+ /* If we haven't restored %r2 yet (no frame pointer, and a stack
+ frame greater than 8k), do so now. */
+ if (ret_off != 0)
+ load_reg (2, ret_off, STACK_POINTER_REGNUM);
}
/* Set up a callee saved register for the pic offset table register. */
@@ -3816,6 +3792,7 @@ pa_adjust_insn_length (insn, length)
/* Block move pattern. */
else if (GET_CODE (insn) == INSN
&& GET_CODE (pat) == PARALLEL
+ && GET_CODE (XVECEXP (pat, 0, 0)) == SET
&& GET_CODE (XEXP (XVECEXP (pat, 0, 0), 0)) == MEM
&& GET_CODE (XEXP (XVECEXP (pat, 0, 0), 1)) == MEM
&& GET_MODE (XEXP (XVECEXP (pat, 0, 0), 0)) == BLKmode
@@ -3901,6 +3878,17 @@ print_operand (file, x, code)
}
else
break;
+ case 'A':
+ {
+ rtx xoperands[2];
+
+ xoperands[0] = XEXP (XEXP (x, 0), 0);
+ xoperands[1] = XVECEXP (XEXP (XEXP (x, 0), 1), 0, 0);
+ output_global_address (file, xoperands[1], 0);
+ fprintf (file, "(%s)", reg_names [REGNO (xoperands[0])]);
+ return;
+ }
+
case 'C': /* Plain (C)ondition */
case 'X':
switch (GET_CODE (x))
@@ -4570,7 +4558,7 @@ secondary_reload_class (class, mode, in)
/* Trying to load a constant into a FP register during PIC code
generation will require %r1 as a scratch register. */
- if (flag_pic == 2
+ if (flag_pic
&& GET_MODE_CLASS (mode) == MODE_INT
&& FP_REG_CLASS_P (class)
&& (GET_CODE (in) == CONST_INT || GET_CODE (in) == CONST_DOUBLE))
@@ -4605,6 +4593,13 @@ secondary_reload_class (class, mode, in)
|| (class == SHIFT_REGS && (regno <= 0 || regno >= 32)))
return GENERAL_REGS;
+ /* A SAR<->FP register copy requires a secondary register (GPR) as
+ well as secondary memory. */
+ if (regno >= 0 && regno < FIRST_PSEUDO_REGISTER
+ && ((REGNO_REG_CLASS (regno) == SHIFT_REGS && FP_REG_CLASS_P (class))
+ || (class == SHIFT_REGS && FP_REG_CLASS_P (REGNO_REG_CLASS (regno)))))
+ return GENERAL_REGS;
+
if (GET_CODE (in) == HIGH)
in = XEXP (in, 0);
diff --git a/gcc/config/pa/pa.h b/gcc/config/pa/pa.h
index e20cffd729f..3faa01a4ee8 100644
--- a/gcc/config/pa/pa.h
+++ b/gcc/config/pa/pa.h
@@ -323,6 +323,17 @@ extern int target_flags;
%{!ansi: -D_HPUX_SOURCE -D_HIUX_SOURCE -D__STDC_EXT__} \
%{threads: -D_REENTRANT -D_DCE_THREADS}"
+#define CPLUSPLUS_CPP_SPEC "\
+-D_HPUX_SOURCE -D_HIUX_SOURCE -D__STDC_EXT__ \
+%{mpa-risc-1-0:%(cpp_pa10)} \
+%{mpa-risc-1-1:%(cpp_pa11)} \
+%{msnake:%(cpp_pa11)} \
+%{mpa-risc-2-0:%(cpp_pa20)} \
+%{!mpa-risc-1-0:%{!mpa-risc-1-1:%{!mpa-risc-2-0:%{!msnake:%(cpp_cpu_default)}}}} \
+%{m64bit:%(cpp_64bit)} \
+%{!m64bit:%(cpp_64bit_default)} \
+%{threads: -D_REENTRANT -D_DCE_THREADS}"
+
/* Defines for a K&R CC */
#define CC1_SPEC "%{pg:} %{p:}"
@@ -1187,8 +1198,15 @@ extern int may_call_alloca;
|| GET_CODE (XEXP (XEXP (OP, 0), 1)) == MULT)))\
: ((C) == 'U' ? \
(GET_CODE (OP) == CONST_INT && INTVAL (OP) == 63) \
+ : ((C) == 'A' ? \
+ (GET_CODE (OP) == MEM \
+ && GET_CODE (XEXP (OP, 0)) == LO_SUM \
+ && GET_CODE (XEXP (XEXP (OP, 0), 0)) == REG \
+ && REG_OK_FOR_BASE_P (XEXP (XEXP (OP, 0), 0)) \
+ && GET_CODE (XEXP (XEXP (OP, 0), 1)) == UNSPEC \
+ && GET_MODE (XEXP (OP, 0)) == Pmode) \
: ((C) == 'S' ? \
- (GET_CODE (OP) == CONST_INT && INTVAL (OP) == 31) : 0)))))
+ (GET_CODE (OP) == CONST_INT && INTVAL (OP) == 31) : 0))))))
/* The macros REG_OK_FOR..._P assume that the arg is a REG rtx
@@ -1262,16 +1280,7 @@ extern int may_call_alloca;
else if (GET_CODE (X) == PLUS) \
{ \
rtx base = 0, index = 0; \
- if (flag_pic && XEXP (X, 0) == pic_offset_table_rtx)\
- { \
- if (GET_CODE (XEXP (X, 1)) == REG \
- && REG_OK_FOR_BASE_P (XEXP (X, 1))) \
- goto ADDR; \
- else if (flag_pic == 1 \
- && GET_CODE (XEXP (X, 1)) == SYMBOL_REF)\
- goto ADDR; \
- } \
- else if (REG_P (XEXP (X, 0)) \
+ if (REG_P (XEXP (X, 0)) \
&& REG_OK_FOR_BASE_P (XEXP (X, 0))) \
base = XEXP (X, 0), index = XEXP (X, 1); \
else if (REG_P (XEXP (X, 1)) \
@@ -1333,7 +1342,11 @@ extern int may_call_alloca;
else if (GET_CODE (X) == LO_SUM \
&& GET_CODE (XEXP (X, 0)) == REG \
&& REG_OK_FOR_BASE_P (XEXP (X, 0)) \
- && GET_CODE (XEXP (X, 1)) == UNSPEC) \
+ && GET_CODE (XEXP (X, 1)) == UNSPEC \
+ && (TARGET_SOFT_FLOAT \
+ || TARGET_PA_20 \
+ || ((MODE) != SFmode \
+ && (MODE) != DFmode))) \
goto ADDR; \
}
@@ -1963,9 +1976,7 @@ while (0)
fputs ("R'", FILE); \
else if (flag_pic == 0) \
fputs ("RR'", FILE); \
- else if (flag_pic == 1) \
- abort (); \
- else if (flag_pic == 2) \
+ else \
fputs ("RT'", FILE); \
output_global_address (FILE, XEXP (addr, 1), 0); \
fputs ("(", FILE); \
diff --git a/gcc/config/pa/pa.md b/gcc/config/pa/pa.md
index ac70bfdc75a..4828da8cd67 100644
--- a/gcc/config/pa/pa.md
+++ b/gcc/config/pa/pa.md
@@ -2085,26 +2085,16 @@
DONE;
}")
-;;; pic symbol references
-
-(define_insn ""
- [(set (match_operand:SI 0 "register_operand" "=r")
- (mem:SI (plus:SI (match_operand:SI 1 "register_operand" "r")
- (match_operand:SI 2 "symbolic_operand" ""))))]
- "flag_pic && operands[1] == pic_offset_table_rtx"
- "ldw T'%2(%1),%0"
- [(set_attr "type" "load")
- (set_attr "length" "4")])
-
(define_insn ""
[(set (match_operand:SI 0 "reg_or_nonsymb_mem_operand"
- "=r,r,r,r,r,Q,*q,!f,f,*TR")
+ "=r,r,r,r,r,r,Q,*q,!f,f,*TR")
(match_operand:SI 1 "move_operand"
- "r,J,N,K,RQ,rM,rM,!fM,*RT,f"))]
+ "A,r,J,N,K,RQ,rM,rM,!fM,*RT,f"))]
"(register_operand (operands[0], SImode)
|| reg_or_0_operand (operands[1], SImode))
&& ! TARGET_SOFT_FLOAT"
"@
+ ldw RT'%A1,%0
copy %1,%0
ldi %1,%0
ldil L'%1,%0
@@ -2115,19 +2105,20 @@
fcpy,sgl %f1,%0
fldw%F1 %1,%0
fstw%F0 %1,%0"
- [(set_attr "type" "move,move,move,shift,load,store,move,fpalu,fpload,fpstore")
+ [(set_attr "type" "load,move,move,move,shift,load,store,move,fpalu,fpload,fpstore")
(set_attr "pa_combine_type" "addmove")
- (set_attr "length" "4,4,4,4,4,4,4,4,4,4")])
+ (set_attr "length" "4,4,4,4,4,4,4,4,4,4,4")])
(define_insn ""
[(set (match_operand:SI 0 "reg_or_nonsymb_mem_operand"
- "=r,r,r,r,r,Q,*q")
+ "=r,r,r,r,r,r,Q,*q")
(match_operand:SI 1 "move_operand"
- "r,J,N,K,RQ,rM,rM"))]
+ "A,r,J,N,K,RQ,rM,rM"))]
"(register_operand (operands[0], SImode)
|| reg_or_0_operand (operands[1], SImode))
&& TARGET_SOFT_FLOAT"
"@
+ ldw RT'%A1,%0
copy %1,%0
ldi %1,%0
ldil L'%1,%0
@@ -2135,9 +2126,9 @@
ldw%M1 %1,%0
stw%M0 %r1,%0
mtsar %r1"
- [(set_attr "type" "move,move,move,move,load,store,move")
+ [(set_attr "type" "load,move,move,move,move,load,store,move")
(set_attr "pa_combine_type" "addmove")
- (set_attr "length" "4,4,4,4,4,4,4")])
+ (set_attr "length" "4,4,4,4,4,4,4,4")])
(define_insn ""
[(set (match_operand:SI 0 "register_operand" "=r")
@@ -2329,7 +2320,7 @@
(high:SI (match_operand 2 "" ""))))]
"symbolic_operand (operands[2], Pmode)
&& ! function_label_operand (operands[2], Pmode)
- && flag_pic == 2"
+ && flag_pic"
"addil LT'%G2,%1"
[(set_attr "type" "binary")
(set_attr "length" "4")])
@@ -2341,46 +2332,11 @@
"symbolic_operand (operands[2], Pmode)
&& ! function_label_operand (operands[2], Pmode)
&& TARGET_64BIT
- && flag_pic == 2"
+ && flag_pic"
"addil LT'%G2,%1"
[(set_attr "type" "binary")
(set_attr "length" "4")])
-; We need this to make sure CSE doesn't simplify a memory load with a
-; symbolic address, whose content it think it knows. For PIC, what CSE
-; think is the real value will be the address of that value.
-(define_insn ""
- [(set (match_operand:SI 0 "register_operand" "=r")
- (mem:SI
- (lo_sum:SI (match_operand:SI 1 "register_operand" "r")
- (unspec:SI
- [(match_operand:SI 2 "symbolic_operand" "")] 0))))]
- ""
- "*
-{
- if (flag_pic != 2)
- abort ();
- return \"ldw RT'%G2(%1),%0\";
-}"
- [(set_attr "type" "load")
- (set_attr "length" "4")])
-
-(define_insn ""
- [(set (match_operand:DI 0 "register_operand" "=r")
- (mem:DI
- (lo_sum:DI (match_operand:DI 1 "register_operand" "r")
- (unspec:DI
- [(match_operand:DI 2 "symbolic_operand" "")] 0))))]
- "TARGET_64BIT"
- "*
-{
- if (flag_pic != 2)
- abort ();
- return \"ldd RT'%G2(%1),%0\";
-}"
- [(set_attr "type" "load")
- (set_attr "length" "4")])
-
;; Always use addil rather than ldil;add sequences. This allows the
;; HP linker to eliminate the dp relocation if the symbolic operand
;; lives in the TEXT space.
@@ -3083,7 +3039,7 @@
}")
(define_expand "reload_outdi"
- [(set (match_operand:DI 0 "general_operand" "")
+ [(set (match_operand:DI 0 "non_hard_reg_operand" "")
(match_operand:DI 1 "register_operand" "Z"))
(clobber (match_operand:SI 2 "register_operand" "=&r"))]
""
@@ -3156,13 +3112,14 @@
(define_insn ""
[(set (match_operand:DI 0 "reg_or_nonsymb_mem_operand"
- "=r,r,r,r,r,Q,*q,!f,f,*TR")
+ "=r,r,r,r,r,r,Q,*q,!f,f,*TR")
(match_operand:DI 1 "move_operand"
- "r,J,N,K,RQ,rM,rM,!fM,*RT,f"))]
+ "A,r,J,N,K,RQ,rM,rM,!fM,*RT,f"))]
"(register_operand (operands[0], DImode)
|| reg_or_0_operand (operands[1], DImode))
&& ! TARGET_SOFT_FLOAT && TARGET_64BIT"
"@
+ ldd RT'%A1,%0
copy %1,%0
ldi %1,%0
ldil L'%1,%0
@@ -3173,9 +3130,9 @@
fcpy,dbl %f1,%0
fldd%F1 %1,%0
fstd%F0 %1,%0"
- [(set_attr "type" "move,move,move,shift,load,store,move,fpalu,fpload,fpstore")
+ [(set_attr "type" "load,move,move,move,shift,load,store,move,fpalu,fpload,fpstore")
(set_attr "pa_combine_type" "addmove")
- (set_attr "length" "4,4,4,4,4,4,4,4,4,4")])
+ (set_attr "length" "4,4,4,4,4,4,4,4,4,4,4")])
(define_insn ""
[(set (match_operand:DI 0 "reg_or_nonsymb_mem_operand"
@@ -6254,8 +6211,7 @@
;;; EH does longjmp's from and within the data section. Thus,
;;; an interspace branch is required for the longjmp implementation.
-;;; Registers r1 and r2 are not saved in the jmpbuf environment.
-;;; Thus, they can be used as scratch registers for the jump.
+;;; Registers r1 and r2 are used as scratch registers for the jump.
(define_expand "interspace_jump"
[(parallel
[(set (pc) (match_operand 0 "pmode_register_operand" "a"))
@@ -6289,8 +6245,10 @@
{
/* The elements of the buffer are, in order: */
rtx fp = gen_rtx_MEM (Pmode, operands[0]);
- rtx lab = gen_rtx_MEM (Pmode, plus_constant (operands[0], 4));
- rtx stack = gen_rtx_MEM (Pmode, plus_constant (operands[0], 8));
+ rtx lab = gen_rtx_MEM (Pmode, plus_constant (operands[0],
+ POINTER_SIZE / BITS_PER_UNIT));
+ rtx stack = gen_rtx_MEM (Pmode, plus_constant (operands[0],
+ (POINTER_SIZE * 2) / BITS_PER_UNIT));
rtx pv = gen_rtx_REG (Pmode, 1);
/* This bit is the same as expand_builtin_longjmp. */
@@ -6303,10 +6261,16 @@
where to look for it when we get back to setjmp's function for
restoring the gp. */
emit_move_insn (pv, lab);
+
+ /* Prevent the insns above from being scheduled into the delay slot
+ of the interspace jump because the space register could change. */
+ emit_insn (gen_blockage ());
+
emit_jump_insn (gen_interspace_jump (pv));
emit_barrier ();
DONE;
}")
+
;;; Hope this is only within a function...
(define_insn "indirect_jump"
[(set (pc) (match_operand 0 "register_operand" "r"))]
@@ -7172,3 +7136,18 @@
emit_insn (gen_blockage ());
DONE;
}")
+
+(define_expand "builtin_setjmp_receiver"
+ [(label_ref (match_operand 0 "" ""))]
+ "flag_pic"
+ "
+{
+ if (PIC_OFFSET_TABLE_SAVE_RTX == NULL_RTX)
+ hppa_init_pic_save ();
+
+ /* Restore the PIC register. Hopefully, this will always be from
+ a stack slot. The only registers that are valid after a
+ builtin_longjmp are the stack and frame pointers. */
+ emit_move_insn (pic_offset_table_rtx, PIC_OFFSET_TABLE_SAVE_RTX);
+ DONE;
+}")
diff --git a/gcc/config/pa/pa32-regs.h b/gcc/config/pa/pa32-regs.h
index 145a90e42a1..54d399e1b16 100644
--- a/gcc/config/pa/pa32-regs.h
+++ b/gcc/config/pa/pa32-regs.h
@@ -174,7 +174,7 @@
? GET_MODE_SIZE (MODE) <= 4 || ((REGNO) & 1) == 0 \
/* Make wide modes be in aligned registers. */ \
: (GET_MODE_SIZE (MODE) <= UNITS_PER_WORD \
- || (GET_MODE_SIZE (MODE) <= 2 * UNITS_PER_WORD && ((REGNO) & 1) == 0)))
+ || (GET_MODE_SIZE (MODE) <= 4 * UNITS_PER_WORD && ((REGNO) & 1) == 0)))
/* How to renumber registers for dbx and gdb.
diff --git a/gcc/config/pa/quadlib.c b/gcc/config/pa/quadlib.c
index 598e0c297cb..cdf3ea989db 100644
--- a/gcc/config/pa/quadlib.c
+++ b/gcc/config/pa/quadlib.c
@@ -92,3 +92,12 @@ __U_Qfcnvfxt_quad_to_sgl (long double a)
return _U_Qfcnvfxt_quad_to_sgl (a) >> 32;
}
#endif
+
+/* HP only has signed conversion in library, so need to synthesize an
+ unsigned version */
+unsigned int
+_U_Qfcnvfxt_quad_to_usgl(long double a)
+{
+ extern long long _U_Qfcnvfxt_quad_to_dbl (long double a);
+ return (unsigned int) _U_Qfcnvfxt_quad_to_dbl (a);
+}
diff --git a/gcc/config/pa/rtems.h b/gcc/config/pa/rtems.h
index c3165ecd9b9..ef355dbd9da 100644
--- a/gcc/config/pa/rtems.h
+++ b/gcc/config/pa/rtems.h
@@ -1,5 +1,5 @@
/* Definitions of target machine for GNU compiler, for PRO.
- Copyright (C) 1997, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1997, 2000, 2002 Free Software Foundation, Inc.
Contributed by Joel Sherrill (joel@OARcorp.com).
This file is part of GNU CC.
@@ -23,7 +23,7 @@ Boston, MA 02111-1307, USA. */
#undef CPP_PREDEFINES
#define CPP_PREDEFINES "-Dhppa -DPWB -Acpu=hppa -Amachine=hppa \
- -Drtems -D__rtems__ -Asystem=rtems"
+ -D__rtems__ -Asystem=rtems"
/* Generate calls to memcpy, memcmp and memset. */
#ifndef TARGET_MEM_FUNCTIONS
diff --git a/gcc/config/pa/som.h b/gcc/config/pa/som.h
index 06ee54b107b..df3cb04a431 100644
--- a/gcc/config/pa/som.h
+++ b/gcc/config/pa/som.h
@@ -1,5 +1,5 @@
/* Definitions for SOM assembler support.
- Copyright (C) 1999 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2001 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -251,6 +251,13 @@ do { \
#define BSS_SECTION_ASM_OP "\t.SPACE $PRIVATE$\n\t.SUBSPA $BSS$\n"
+/* We must not have a reference to an external symbol defined in a
+ shared library in a readonly section, else the SOM linker will
+ complain.
+
+ So, we force exception information into the data section. */
+#define EXCEPTION_SECTION data_section
+
/* Define the .bss section for ASM_OUTPUT_LOCAL to use. */
#ifndef CTORS_SECTION_FUNCTION
@@ -261,34 +268,6 @@ do { \
#define EXTRA_SECTIONS in_readonly_data, in_ctors, in_dtors
#endif
-/* Switch into a generic section.
- This is currently only used to support section attributes.
-
- We make the section read-only and executable for a function decl,
- read-only for a const data decl, and writable for a non-const data decl. */
-#define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME, RELOC) \
- if (DECL && TREE_CODE (DECL) == FUNCTION_DECL) \
- { \
- fputs ("\t.SPACE $TEXT$\n", FILE); \
- fprintf (FILE, \
- "\t.SUBSPA %s%s%s,QUAD=0,ALIGN=8,ACCESS=44,CODE_ONLY,SORT=24\n",\
- TARGET_GAS ? "" : "$", NAME, TARGET_GAS ? "" : "$"); \
- } \
- else if (DECL && DECL_READONLY_SECTION (DECL, RELOC)) \
- { \
- fputs ("\t.SPACE $TEXT$\n", FILE); \
- fprintf (FILE, \
- "\t.SUBSPA %s%s%s,QUAD=0,ALIGN=8,ACCESS=44,SORT=16\n", \
- TARGET_GAS ? "" : "$", NAME, TARGET_GAS ? "" : "$"); \
- } \
- else \
- { \
- fputs ("\t.SPACE $PRIVATE$\n", FILE); \
- fprintf (FILE, \
- "\t.SUBSPA %s%s%s,QUAD=1,ALIGN=8,ACCESS=31,SORT=16\n", \
- TARGET_GAS ? "" : "$", NAME, TARGET_GAS ? "" : "$"); \
- }
-
/* FIXME: HPUX ld generates incorrect GOT entries for "T" fixups
which reference data within the $TEXT$ space (for example constant
strings in the $LIT$ subspace).
@@ -378,20 +357,6 @@ do { \
/* The .align directive in the HP assembler allows up to a 32 alignment. */
#define MAX_OFILE_ALIGNMENT 32768
-#ifdef HAVE_GAS_WEAK
-#define MAKE_DECL_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 1)
-
-/* This is how we tell the assembler that a symbol is weak. */
-
-#define ASM_WEAKEN_LABEL(FILE,NAME) \
- do { fputs ("\t.weak\t", FILE); \
- assemble_name (FILE, NAME); \
- fputc ('\n', FILE); \
- if (! FUNCTION_NAME_P (NAME)) \
- { \
- fputs ("\t.EXPORT ", FILE); \
- assemble_name (FILE, NAME); \
- fputs (",DATA\n", FILE); \
- } \
- } while (0)
-#endif
+/* SOM does not support the init_priority C++ attribute. */
+#undef SUPPORTS_INIT_PRIORITY
+#define SUPPORTS_INIT_PRIORITY 0
diff --git a/gcc/config/pa/xm-linux.h b/gcc/config/pa/xm-linux.h
index e7699d8b7b2..076e935b535 100644
--- a/gcc/config/pa/xm-linux.h
+++ b/gcc/config/pa/xm-linux.h
@@ -21,10 +21,6 @@ Boston, MA 02111-1307, USA. */
extern int errno;
-/* #defines that need visibility everywhere. */
-#define FALSE 0
-#define TRUE 1
-
/* This describes the machine the compiler is hosted on. */
#define HOST_BITS_PER_CHAR 8
#define HOST_BITS_PER_SHORT 16
diff --git a/gcc/config/pa/xm-pa.h b/gcc/config/pa/xm-pa.h
index 5814a898be3..9d9b99a9257 100644
--- a/gcc/config/pa/xm-pa.h
+++ b/gcc/config/pa/xm-pa.h
@@ -21,10 +21,6 @@ Boston, MA 02111-1307, USA. */
extern int errno;
-/* #defines that need visibility everywhere. */
-#define FALSE 0
-#define TRUE 1
-
/* This describes the machine the compiler is hosted on. */
#define HOST_BITS_PER_CHAR 8
#define HOST_BITS_PER_SHORT 16
diff --git a/gcc/config/pa/xm-pa64hpux.h b/gcc/config/pa/xm-pa64hpux.h
index fc1ad27506c..563695d5a0e 100644
--- a/gcc/config/pa/xm-pa64hpux.h
+++ b/gcc/config/pa/xm-pa64hpux.h
@@ -22,11 +22,6 @@ Boston, MA 02111-1307, USA. */
/* HP-UX is a flavor of System V */
#define USG
-/* Use System V memory functions. */
-/* #defines that need visibility everywhere. */
-#define FALSE 0
-#define TRUE 1
-
/* This describes the machine the compiler is hosted on. */
#define HOST_BITS_PER_CHAR 8
#define HOST_BITS_PER_SHORT 16
diff --git a/gcc/config/pa/xm-pahpux.h b/gcc/config/pa/xm-pahpux.h
index d62210a4ab0..5a82566abd2 100644
--- a/gcc/config/pa/xm-pahpux.h
+++ b/gcc/config/pa/xm-pahpux.h
@@ -19,15 +19,9 @@ along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-
/* HP-UX is a flavor of System V */
#define USG
-/* Use System V memory functions. */
-/* #defines that need visibility everywhere. */
-#define FALSE 0
-#define TRUE 1
-
/* This describes the machine the compiler is hosted on. */
#define HOST_BITS_PER_CHAR 8
#define HOST_BITS_PER_SHORT 16
diff --git a/gcc/config/pa/xm-papro.h b/gcc/config/pa/xm-papro.h
index ad4675beba1..6d887a9f803 100644
--- a/gcc/config/pa/xm-papro.h
+++ b/gcc/config/pa/xm-papro.h
@@ -21,10 +21,6 @@ Boston, MA 02111-1307, USA. */
extern int errno;
-/* #defines that need visibility everywhere. */
-#define FALSE 0
-#define TRUE 1
-
/* This describes the machine the compiler is hosted on. */
#define HOST_BITS_PER_CHAR 8
#define HOST_BITS_PER_SHORT 16
diff --git a/gcc/config/pdp11/pdp11.c b/gcc/config/pdp11/pdp11.c
index 83f191f340d..b298ea0ebff 100644
--- a/gcc/config/pdp11/pdp11.c
+++ b/gcc/config/pdp11/pdp11.c
@@ -28,7 +28,6 @@ Boston, MA 02111-1307, USA. */
#include "real.h"
#include "insn-config.h"
#include "conditions.h"
-#include "insn-flags.h"
#include "function.h"
#include "output.h"
#include "insn-attr.h"
diff --git a/gcc/config/pdp11/pdp11.h b/gcc/config/pdp11/pdp11.h
index 39aac2ff6cf..08b7849b0d9 100644
--- a/gcc/config/pdp11/pdp11.h
+++ b/gcc/config/pdp11/pdp11.h
@@ -1245,10 +1245,6 @@ fprintf (FILE, "$help$: . = .+8 ; space for tmp moves!\n") \
fprintf (FILE, "\tmov (sp)+, %s\n", reg_names[REGNO]) \
)
-
-#define ASM_IDENTIFY_GCC(FILE) \
- fprintf(FILE, "gcc_compiled:\n")
-
/* trampoline - how should i do it in separate i+d ?
have some allocate_trampoline magic???
diff --git a/gcc/config/pj/lib1funcs.S b/gcc/config/pj/lib1funcs.S
index 004d73ae941..02390bc5740 100644
--- a/gcc/config/pj/lib1funcs.S
+++ b/gcc/config/pj/lib1funcs.S
@@ -1,19 +1,19 @@
! lib1funcs.S for picoJava.
-! Copyright (C) 2000 Free Software Foundation, Inc.
+! Copyright (C) 2000, 2001 Free Software Foundation, Inc.
!
! This file 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.
!
-| In addition to the permissions in the GNU General Public License, the
-| Free Software Foundation gives you unlimited permission to link the
-| compiled version of this file into combinations with other programs,
-| and to distribute those combinations without any restriction coming
-| from the use of this file. (The General Public License restrictions
-| do apply in other respects; for example, they cover modification of
-| the file, and distribution when not linked into a combine
-| executable.)
+! In addition to the permissions in the GNU General Public License, the
+! Free Software Foundation gives you unlimited permission to link the
+! compiled version of this file into combinations with other programs,
+! and to distribute those combinations without any restriction coming
+! from the use of this file. (The General Public License restrictions
+! do apply in other respects; for example, they cover modification of
+! the file, and distribution when not linked into a combine
+! executable.)
!
! This file is distributed in the hope that it will be useful, but
! WITHOUT ANY WARRANTY; without even the implied warranty of
diff --git a/gcc/config/pj/pj.c b/gcc/config/pj/pj.c
index 43a3066d07c..febe2997bcf 100644
--- a/gcc/config/pj/pj.c
+++ b/gcc/config/pj/pj.c
@@ -89,7 +89,6 @@ Boston, MA 02111-1307, USA. */
#include "real.h"
#include "insn-config.h"
#include "conditions.h"
-#include "insn-flags.h"
#include "output.h"
#include "insn-attr.h"
#include "flags.h"
diff --git a/gcc/config/pj/pj.h b/gcc/config/pj/pj.h
index 39f8d797fb5..a5f5ebaa3e7 100644
--- a/gcc/config/pj/pj.h
+++ b/gcc/config/pj/pj.h
@@ -27,10 +27,10 @@ Boston, MA 02111-1307, USA. */
#undef ASM_SPEC
#ifdef TARGET_LITTLE_ENDIAN_DEFAULT
#define CPP_SPEC "%{mb:-D__BIG_ENDIAN__ }%{!mb:-D__LITTLE_ENDIAN__ }"
-#define ASM_SPEC "%{mb:-mb }%{!mb:-ml }"
+#define ASM_SPEC "%{mb:-EB }%{!mb:-EL }"
#else
#define CPP_SPEC "%{ml:-D__LITTLE_ENDIAN__ }%{!ml:-D__BIG_ENDIAN__}"
-#define ASM_SPEC "%{ml:-ml } %{!ml:-mb }"
+#define ASM_SPEC "%{ml:-EL } %{!ml:-EB }"
#endif
#ifndef CPP_PREDEFINES
@@ -234,7 +234,7 @@ enum
LAST_O_REG=OSC_REG,
LAST_R_REG=R31_REG,
LAST_I_REG=ISC_REG,
- LAST_S_REG=P7_REG,
+ LAST_S_REG=P7_REG
};
@@ -445,7 +445,7 @@ enum reg_class
SRC_REGS, /* All registers valid as a source. */
DST_REGS, /* All registers valid as a destination. */
ALL_REGS,
- LIM_REG_CLASSES,
+ LIM_REG_CLASSES
};
#define GENERAL_REGS SRC_REGS
@@ -460,7 +460,7 @@ enum reg_class
"ARG_REGS", \
"SRC_REGS", \
"DST_REGS", \
- "ALL_REGS", \
+ "ALL_REGS" \
}
/* Define which registers fit in which classes.
@@ -1159,7 +1159,7 @@ do { fputs (current_function_varargs || current_function_stdarg \
/* The prefix to add to an internally generated label. */
-#define LOCAL_LABEL_PREFIX ""
+#define LOCAL_LABEL_PREFIX "."
/* Make an internal label into a string. */
#define ASM_GENERATE_INTERNAL_LABEL(STRING, PREFIX, NUM) \
diff --git a/gcc/config/pj/xm-pj.h b/gcc/config/pj/xm-pj.h
index e635cce87c9..63bd847b3f8 100644
--- a/gcc/config/pj/xm-pj.h
+++ b/gcc/config/pj/xm-pj.h
@@ -18,10 +18,6 @@ along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-/* #defines that need visibility everywhere. */
-#define FALSE 0
-#define TRUE 1
-
/* This describes the machine the compiler is hosted on. */
#define HOST_BITS_PER_CHAR 8
#define HOST_BITS_PER_SHORT 16
diff --git a/gcc/config/psos.h b/gcc/config/psos.h
index cb739fe36d6..361c5bb86cf 100644
--- a/gcc/config/psos.h
+++ b/gcc/config/psos.h
@@ -67,18 +67,6 @@ Boston, MA 02111-1307, USA.
#define TARGET_MEM_FUNCTIONS
-
-/* When using stabs, gcc2_compiled must be a stabs entry, not an
- ordinary symbol, or gdb won't see it. The stabs entry must be
- before the N_SO in order for gdb to find it. */
-
-#define ASM_IDENTIFY_GCC(FILE) \
-do \
- { \
- fputs (".stabs \"gcc2_compiled.\", 0x3c, 0, 0, 0\n", FILE); \
- } \
-while (0)
-
/* This is how we tell the assembler that a symbol is weak. */
#define ASM_WEAKEN_LABEL(FILE,NAME) \
diff --git a/gcc/config/ptx4.h b/gcc/config/ptx4.h
index c7108748d49..57b04645dab 100644
--- a/gcc/config/ptx4.h
+++ b/gcc/config/ptx4.h
@@ -204,21 +204,6 @@ Boston, MA 02111-1307, USA.
#undef DBX_REGISTER_NUMBER
-/* When using stabs, gcc2_compiled must be a stabs entry, not an
- ordinary symbol, or gdb won't see it. The stabs entry must be
- before the N_SO in order for gdb to find it. */
-
-#undef ASM_IDENTIFY_GCC
-#define ASM_IDENTIFY_GCC(FILE) \
-do \
- { \
- if (write_symbols != DBX_DEBUG) \
- fputs ("gcc2_compiled.:\n", FILE); \
- else \
- fputs ("\t.stabs\t\"gcc2_compiled.\", 0x3c, 0, 0, 0\n", FILE); \
- } \
-while (0)
-
/* Like block addresses, stabs line numbers are relative to the
current function. */
diff --git a/gcc/config/romp/romp.c b/gcc/config/romp/romp.c
index 91cfeeba33b..7aedeb60024 100644
--- a/gcc/config/romp/romp.c
+++ b/gcc/config/romp/romp.c
@@ -29,7 +29,6 @@ Boston, MA 02111-1307, USA. */
#include "real.h"
#include "insn-config.h"
#include "conditions.h"
-#include "insn-flags.h"
#include "output.h"
#include "insn-attr.h"
#include "flags.h"
diff --git a/gcc/config/romp/xm-romp.h b/gcc/config/romp/xm-romp.h
index acb5b8cecb1..80a14c3c562 100644
--- a/gcc/config/romp/xm-romp.h
+++ b/gcc/config/romp/xm-romp.h
@@ -18,11 +18,6 @@ along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-
-/* #defines that need visibility everywhere. */
-#define FALSE 0
-#define TRUE 1
-
/* This describes the machine the compiler is hosted on. */
#define HOST_BITS_PER_CHAR 8
#define HOST_BITS_PER_SHORT 16
diff --git a/gcc/config/rs6000/aix.h b/gcc/config/rs6000/aix.h
index a28fe1b517f..66205516f38 100644
--- a/gcc/config/rs6000/aix.h
+++ b/gcc/config/rs6000/aix.h
@@ -68,7 +68,7 @@ Boston, MA 02111-1307, USA. */
/* #define ASM_OUTPUT_DESTRUCTOR(file, name) */
/* The prefix to add to user-visible assembler symbols. */
-#define USER_LABEL_PREFIX "."
+#define USER_LABEL_PREFIX ""
/* Don't turn -B into -L if the argument specifies a relative file name. */
#define RELATIVE_PREFIX_NOT_LINKDIR
@@ -402,9 +402,6 @@ toc_section () \
Also, in order to output proper .bs/.es pairs, we need at least one static
[RW] section emitted.
- We then switch back to text to force the gcc2_compiled. label and the space
- allocated after it (when profiling) into the text section.
-
Finally, declare mcount when profiling to make the assembler happy. */
#define ASM_FILE_START(FILE) \
@@ -561,48 +558,9 @@ toc_section () \
use '.long' or '.word', but that aligns to a 4-byte boundary which
is not what is required. So we define a million macros... */
-#define ASM_OUTPUT_DWARF_ADDR_VAR(FILE, LABEL, LENGTH) \
- do { fprintf ((FILE), "\t.vbyte\t%d,", LENGTH); \
- assemble_name (FILE, LABEL); \
- } while (0)
-
-#define ASM_OUTPUT_DWARF_DELTA_VAR(FILE, LABEL1, LABEL2, LENGTH) \
- do { fprintf ((FILE), "\t.vbyte\t%d,", LENGTH); \
- assemble_name (FILE, LABEL1); \
- fprintf (FILE, "-"); \
- assemble_name (FILE, LABEL2); \
- } while (0)
-
-#define ASM_OUTPUT_DWARF_DELTA2(FILE, LABEL1, LABEL2) \
- ASM_OUTPUT_DWARF_DELTA_VAR (FILE, LABEL1, LABEL2, 2)
-
-#define ASM_OUTPUT_DWARF_DELTA4(FILE, LABEL1, LABEL2) \
- ASM_OUTPUT_DWARF_DELTA_VAR (FILE, LABEL1, LABEL2, 4)
-
-#define ASM_OUTPUT_DWARF_DELTA(FILE, LABEL1, LABEL2) \
- ASM_OUTPUT_DWARF_DELTA_VAR (FILE, LABEL1, LABEL2, DWARF_OFFSET_SIZE)
-
-#define ASM_OUTPUT_DWARF_ADDR_DELTA(FILE, LABEL1, LABEL2) \
- ASM_OUTPUT_DWARF_DELTA_VAR (FILE, LABEL1, LABEL2, \
- POINTER_SIZE / BITS_PER_UNIT)
-
-#define ASM_OUTPUT_DWARF_ADDR(FILE, LABEL) \
- ASM_OUTPUT_DWARF_ADDR_VAR (FILE, LABEL, POINTER_SIZE / BITS_PER_UNIT)
-
-#define ASM_OUTPUT_DWARF_DATA4(FILE, VALUE) \
- fprintf ((FILE), "\t.vbyte\t4,0x%x", (unsigned) (VALUE))
-
-#define ASM_OUTPUT_DWARF_DATA2(FILE, VALUE) \
- fprintf ((FILE), "\t.vbyte\t2,0x%x", (unsigned) (VALUE))
-
-#define ASM_OUTPUT_DWARF_OFFSET4(FILE, LABEL) \
- ASM_OUTPUT_DWARF_ADDR_VAR (FILE, LABEL, 4)
-
-#define ASM_OUTPUT_DWARF_OFFSET(FILE, LABEL) \
- ASM_OUTPUT_DWARF_ADDR_VAR (FILE, LABEL, DWARF_OFFSET_SIZE)
-
-/* dwarf2out keys off this, but we don't have to have a real definition. */
-#define UNALIGNED_INT_ASM_OP bite_me
+#define UNALIGNED_SHORT_ASM_OP "\t.vbyte\t2,"
+#define UNALIGNED_INT_ASM_OP "\t.vbyte\t4,"
+#define UNALIGNED_DOUBLE_INT_ASM_OP "\t.vbyte\t8,"
/* Output before instructions. */
#define TEXT_SECTION_ASM_OP "\t.csect .text[PR]"
@@ -621,7 +579,7 @@ toc_section () \
if (TREE_CODE (DECL) == FUNCTION_DECL) { \
name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (DECL)); \
len = strlen (name) + 5; \
- string = alloca (len) + 1; \
+ string = alloca (len + 1); \
sprintf (string, ".%s[PR]", name); \
DECL_SECTION_NAME (DECL) = build_string (len, string); \
} \
@@ -633,6 +591,12 @@ toc_section () \
putc ('\n', ASM_OUT_FILE); \
} while (0)
+/* Define the name of the section to use for the exception tables.
+ TODO: test and see if we can use read_only_data_section, if so,
+ remove this. */
+
+#define EXCEPTION_SECTION data_section
+
/* __throw will restore its own return address to be the same as the
return address of the function that the throw is being made to.
This is unfortunate, because we want to check the original
diff --git a/gcc/config/rs6000/aix43.h b/gcc/config/rs6000/aix43.h
index 3f08e771fe2..78700eaa209 100644
--- a/gcc/config/rs6000/aix43.h
+++ b/gcc/config/rs6000/aix43.h
@@ -199,6 +199,10 @@ do { \
%{pthread:%{pg:gcrt0_r%O%s}%{!pg:%{p:mcrt0_r%O%s}%{!p:crt0_r%O%s}}}\
%{!pthread:%{pg:gcrt0%O%s}%{!pg:%{p:mcrt0%O%s}%{!p:crt0%O%s}}}}}}"
+/* Since there are separate multilibs for pthreads, determine the
+ thread model based on the command-line arguments. */
+#define THREAD_MODEL_SPEC "%{pthread:posix}%{!pthread:single}"
+
/* AIX 4.3 typedefs ptrdiff_t as "long" while earlier releases used "int". */
#undef PTRDIFF_TYPE
diff --git a/gcc/config/rs6000/aix51.h b/gcc/config/rs6000/aix51.h
index fd679b9c487..ef512e8da5a 100644
--- a/gcc/config/rs6000/aix51.h
+++ b/gcc/config/rs6000/aix51.h
@@ -21,10 +21,7 @@ the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#include "rs6000/rs6000.h"
-#include "rs6000/aix.h"
-
-/* AIX V5 and above support 64-bit executables. */
+/* AIX 4.3 and above support 64-bit executables. */
#undef SUBSUBTARGET_SWITCHES
#define SUBSUBTARGET_SWITCHES \
{"aix64", MASK_64BIT | MASK_POWERPC64 | MASK_POWERPC, \
@@ -106,13 +103,13 @@ do { \
-D_AIX -D_AIX32 -D_AIX41 -D_AIX43 -D_AIX51 -Asystem=unix -Asystem=aix"
#undef CPP_SPEC
-#define CPP_SPEC "%{posix: -D_POSIX_SOURCE} \
- %{ansi: -D_ANSI_C_SOURCE} \
- %{!maix64: -D__WCHAR_TYPE__="short unsigned int"} \
- %{maix64: -D__64BIT__ -D_ARCH_PPC -D__WCHAR_TYPE__="unsigned int" \
- -D__LONG_MAX__=9223372036854775807L} \
- %{mpe: -I/usr/lpp/ppe.poe/include} \
- %{pthread: -D_THREAD_SAFE} \
+#define CPP_SPEC "%{posix: -D_POSIX_SOURCE}\
+ %{ansi: -D_ANSI_C_SOURCE}\
+ %{!maix64: -D__WCHAR_TYPE__=short\\ unsigned\\ int}\
+ %{maix64: -D__64BIT__ -D_ARCH_PPC -D__LONG_MAX__=9223372036854775807L \
+ -D__WCHAR_TYPE__=unsigned\\ int}\
+ %{mpe: -I/usr/lpp/ppe.poe/include}\
+ %{pthread: -D_THREAD_SAFE}\
%(cpp_cpu)"
/* The GNU C++ standard library requires that these macros be
@@ -123,9 +120,9 @@ do { \
-D_XOPEN_SOURCE_EXTENDED=1 \
-D_LARGE_FILE_API \
-D_ALL_SOURCE \
- %{!maix64: -D__WCHAR_TYPE__="short unsigned int"} \
- %{maix64: -D__64BIT__ -D_ARCH_PPC -D__WCHAR_TYPE__="unsigned int" \
- -D__LONG_MAX__=9223372036854775807L} \
+ %{!maix64: -D__WCHAR_TYPE__=short\\ unsigned\\ int}\
+ %{maix64: -D__64BIT__ -D_ARCH_PPC -D__LONG_MAX__=9223372036854775807L \
+ -D__WCHAR_TYPE__=unsigned\\ int}\
%{mpe: -I/usr/lpp/ppe.poe/include}\
%{pthread: -D_THREAD_SAFE}\
%(cpp_cpu)"
@@ -205,6 +202,10 @@ do { \
%{pthread:%{pg:gcrt0_r%O%s}%{!pg:%{p:mcrt0_r%O%s}%{!p:crt0_r%O%s}}}\
%{!pthread:%{pg:gcrt0%O%s}%{!pg:%{p:mcrt0%O%s}%{!p:crt0%O%s}}}}}}"
+/* Since there are separate multilibs for pthreads, determine the
+ thread model based on the command-line arguments. */
+#define THREAD_MODEL_SPEC "%{pthread:posix}%{!pthread:single}"
+
/* AIX V5 typedefs ptrdiff_t as "long" while earlier releases used "int". */
#undef PTRDIFF_TYPE
@@ -213,6 +214,7 @@ do { \
/* __WCHAR_TYPE__ is dynamic, so do not define it statically. */
#define NO_BUILTIN_WCHAR_TYPE
#undef WCHAR_TYPE
+#undef WCHAR_TYPE_SIZE
/* Width of wchar_t in bits. */
#define WCHAR_TYPE_SIZE (!TARGET_64BIT ? 16 : 32)
diff --git a/gcc/config/rs6000/linux.h b/gcc/config/rs6000/linux.h
index f0cf9d18c34..6e06ecbd781 100644
--- a/gcc/config/rs6000/linux.h
+++ b/gcc/config/rs6000/linux.h
@@ -1,6 +1,7 @@
/* Definitions of target machine for GNU compiler,
- for IBM RS/6000 running AIX version 3.1.
- Copyright (C) 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+ for powerpc machines running Linux.
+ Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation,
+ Inc.
Contributed by Michael Meissner (meissner@cygnus.com).
This file is part of GNU CC.
@@ -33,6 +34,12 @@ Boston, MA 02111-1307, USA. */
#undef CPP_OS_DEFAULT_SPEC
#define CPP_OS_DEFAULT_SPEC "%(cpp_os_linux)"
+/* The GNU C++ standard library currently requires _GNU_SOURCE being
+ defined on glibc-based systems. This temporary hack accomplishes this,
+ it should go away as soon as libstdc++-v3 has a real fix. */
+#undef CPLUSPLUS_CPP_SPEC
+#define CPLUSPLUS_CPP_SPEC "-D_GNU_SOURCE %(cpp)"
+
#undef LINK_SHLIB_SPEC
#define LINK_SHLIB_SPEC "%{shared:-shared} %{!shared: %{static:-static}}"
@@ -66,3 +73,58 @@ Boston, MA 02111-1307, USA. */
#ifndef USE_GNULIBC_1
#define DEFAULT_VTABLE_THUNKS 1
#endif
+
+/* Do code reading to identify a signal frame, and set the frame
+ state data appropriately. See unwind-dw2.c for the structs. */
+
+#ifdef IN_LIBGCC2
+#include <signal.h>
+#include <sys/ucontext.h>
+
+enum { SIGNAL_FRAMESIZE = 64 };
+#endif
+
+#define MD_FALLBACK_FRAME_STATE_FOR(CONTEXT, FS, SUCCESS) \
+ do { \
+ unsigned char *pc_ = (CONTEXT)->ra; \
+ struct sigcontext *sc_; \
+ long new_cfa_; \
+ int i_; \
+ \
+ /* li r0, 0x7777; sc (rt_sigreturn) */ \
+ /* li r0, 0x6666; sc (sigreturn) */ \
+ if (((*(unsigned int *) (pc_+0) == 0x38007777) \
+ || (*(unsigned int *) (pc_+0) == 0x38006666)) \
+ && (*(unsigned int *) (pc_+4) == 0x44000002)) \
+ sc_ = (CONTEXT)->cfa + SIGNAL_FRAMESIZE; \
+ else \
+ break; \
+ \
+ new_cfa_ = sc_->regs->gpr[STACK_POINTER_REGNUM]; \
+ (FS)->cfa_how = CFA_REG_OFFSET; \
+ (FS)->cfa_reg = STACK_POINTER_REGNUM; \
+ (FS)->cfa_offset = new_cfa_ - (long) (CONTEXT)->cfa; \
+ \
+ for (i_ = 0; i_ < 32; i_++) \
+ if (i_ != STACK_POINTER_REGNUM) \
+ { \
+ (FS)->regs.reg[i_].how = REG_SAVED_OFFSET; \
+ (FS)->regs.reg[i_].loc.offset \
+ = (long)&(sc_->regs->gpr[i_]) - new_cfa_; \
+ } \
+ \
+ (FS)->regs.reg[LINK_REGISTER_REGNUM].how = REG_SAVED_OFFSET; \
+ (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. */ \
+ sc_->regs->nip += 4; \
+ (FS)->regs.reg[CR0_REGNO].how = REG_SAVED_OFFSET; \
+ (FS)->regs.reg[CR0_REGNO].loc.offset \
+ = (long)&(sc_->regs->nip) - new_cfa_; \
+ (FS)->retaddr_column = CR0_REGNO; \
+ goto SUCCESS; \
+ } while (0)
+
diff --git a/gcc/config/rs6000/netbsd.h b/gcc/config/rs6000/netbsd.h
new file mode 100644
index 00000000000..9978db50231
--- /dev/null
+++ b/gcc/config/rs6000/netbsd.h
@@ -0,0 +1,61 @@
+/* Definitions of target machine for GNU compiler,
+ for PowerPC NetBSD systems.
+ Copyright 2001 Free Software Foundation, Inc.
+
+This file is part of GNU CC.
+
+GNU CC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU CC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU CC; see the file COPYING. If not, write to
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA. */
+
+/* Under NetBSD, the normal location of the various *crt*.o files is
+ the /usr/lib directory [from config/netbsd.h]. */
+
+#undef STANDARD_STARTFILE_PREFIX
+#define STANDARD_STARTFILE_PREFIX "/usr/lib/"
+
+/* FIXME: Should this macro be treated the same as for the other
+ spec's? */
+/* NOTE: -dc and -dp are equivalent yet NetBSD's CC passes both both!
+ NetBSD's CC also passes -O1 but we can skip that. NetBSD explictly
+ sets ``-e _start'', since LD knows this, skip it. */
+
+#undef LINK_SHLIB_SPEC
+#define LINK_SHLIB_SPEC "\
+%{shared:-shared} \
+%{!shared: %{static:-dc -dp -static}} \
+%{!shared: %{!static:-dc -dp}} \
+"
+
+/* Override the defaults. */
+#undef LIB_DEFAULT_SPEC
+#define LIB_DEFAULT_SPEC "%(lib_netbsd)"
+
+#undef STARTFILE_DEFAULT_SPEC
+#define STARTFILE_DEFAULT_SPEC "%(startfile_netbsd)"
+
+#undef ENDFILE_DEFAULT_SPEC
+#define ENDFILE_DEFAULT_SPEC "%(endfile_netbsd)"
+
+#undef LINK_START_DEFAULT_SPEC
+#define LINK_START_DEFAULT_SPEC "%(link_start_netbsd)"
+
+#undef LINK_OS_DEFAULT_SPEC
+#define LINK_OS_DEFAULT_SPEC "%(link_os_netbsd)"
+
+#undef CPP_OS_DEFAULT_SPEC
+#define CPP_OS_DEFAULT_SPEC "%(cpp_os_netbsd)"
+
+#undef TARGET_VERSION
+#define TARGET_VERSION fprintf (stderr, " (PowerPC NetBSD/ELF)");
diff --git a/gcc/config/rs6000/rs6000-protos.h b/gcc/config/rs6000/rs6000-protos.h
index 31e5716bcf8..a69ba1039fd 100644
--- a/gcc/config/rs6000/rs6000-protos.h
+++ b/gcc/config/rs6000/rs6000-protos.h
@@ -42,11 +42,15 @@ extern int reg_or_neg_short_operand PARAMS ((rtx, enum machine_mode));
extern int reg_or_u_short_operand PARAMS ((rtx, enum machine_mode));
extern int reg_or_cint_operand PARAMS ((rtx, enum machine_mode));
extern int reg_or_arith_cint_operand PARAMS ((rtx, enum machine_mode));
+extern int reg_or_add_cint64_operand PARAMS ((rtx, enum machine_mode));
+extern int reg_or_sub_cint64_operand PARAMS ((rtx, enum machine_mode));
extern int reg_or_logical_cint_operand PARAMS ((rtx, enum machine_mode));
+extern int scc_eq_operand PARAMS ((rtx, enum machine_mode));
extern int got_operand PARAMS ((rtx, enum machine_mode));
extern int got_no_const_operand PARAMS ((rtx, enum machine_mode));
extern int num_insns_constant PARAMS ((rtx, enum machine_mode));
extern int easy_fp_constant PARAMS ((rtx, enum machine_mode));
+extern int zero_fp_constant PARAMS ((rtx, enum machine_mode));
extern int volatile_mem_operand PARAMS ((rtx, enum machine_mode));
extern int offsettable_mem_operand PARAMS ((rtx, enum machine_mode));
extern int mem_or_easy_const_operand PARAMS ((rtx, enum machine_mode));
@@ -56,7 +60,6 @@ extern int non_logical_cint_operand PARAMS ((rtx, enum machine_mode));
extern int logical_operand PARAMS ((rtx, enum machine_mode));
extern int mask_operand PARAMS ((rtx, enum machine_mode));
extern int mask64_operand PARAMS ((rtx, enum machine_mode));
-extern int rldic_operand PARAMS ((rtx, enum machine_mode));
extern int and64_operand PARAMS ((rtx, enum machine_mode));
extern int and_operand PARAMS ((rtx, enum machine_mode));
extern int count_register_operand PARAMS ((rtx, enum machine_mode));
@@ -79,9 +82,11 @@ extern int scc_comparison_operator PARAMS ((rtx, enum machine_mode));
extern int trap_comparison_operator PARAMS ((rtx, enum machine_mode));
extern int boolean_operator PARAMS ((rtx, enum machine_mode));
extern int boolean_or_operator PARAMS ((rtx, enum machine_mode));
+extern int min_max_operator PARAMS ((rtx, enum machine_mode));
extern int includes_lshift_p PARAMS ((rtx, rtx));
extern int includes_rshift_p PARAMS ((rtx, rtx));
-extern int includes_lshift64_p PARAMS ((rtx, rtx));
+extern int includes_rldic_lshift_p PARAMS ((rtx, rtx));
+extern int includes_rldicr_lshift_p PARAMS ((rtx, rtx));
extern int registers_ok_for_quad_peep PARAMS ((rtx, rtx));
extern int addrs_ok_for_quad_peep PARAMS ((rtx, rtx));
extern enum reg_class secondary_reload_class PARAMS ((enum reg_class,
@@ -94,6 +99,8 @@ extern enum rtx_code rs6000_reverse_condition PARAMS ((enum machine_mode,
extern void rs6000_emit_sCOND PARAMS ((enum rtx_code, rtx));
extern void rs6000_emit_cbranch PARAMS ((enum rtx_code, rtx));
extern char * output_cbranch PARAMS ((rtx, const char *, int, rtx));
+extern int rs6000_emit_cmove PARAMS ((rtx, rtx, rtx, rtx));
+extern void rs6000_emit_minmax PARAMS ((rtx, enum rtx_code, rtx, rtx));
extern void output_toc PARAMS ((FILE *, rtx, int, enum machine_mode));
extern int rs6000_adjust_cost PARAMS ((rtx, rtx, rtx, int));
extern int rs6000_adjust_priority PARAMS ((rtx, int));
@@ -107,6 +114,7 @@ extern struct rtx_def *create_TOC_reference PARAMS ((rtx));
extern void rs6000_emit_eh_toc_restore PARAMS ((rtx));
extern void rs6000_emit_move PARAMS ((rtx, rtx, enum machine_mode));
extern rtx rs6000_legitimize_address PARAMS ((rtx, rtx, enum machine_mode));
+extern int rs6000_legitimate_address PARAMS ((enum machine_mode, rtx, int));
extern void rs6000_select_rtx_section PARAMS ((enum machine_mode, rtx));
extern rtx rs6000_return_addr PARAMS ((int, rtx));
extern void rs6000_output_symbol_ref PARAMS ((FILE*, rtx));
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index 2640c60c120..bf112ecda3a 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -28,7 +28,6 @@ Boston, MA 02111-1307, USA. */
#include "real.h"
#include "insn-config.h"
#include "conditions.h"
-#include "insn-flags.h"
#include "insn-attr.h"
#include "flags.h"
#include "recog.h"
@@ -38,6 +37,7 @@ Boston, MA 02111-1307, USA. */
#include "except.h"
#include "function.h"
#include "output.h"
+#include "basic-block.h"
#include "toplev.h"
#include "ggc.h"
#include "hashtab.h"
@@ -75,7 +75,7 @@ int rs6000_compare_fp_p;
get the address of the GOT section */
int rs6000_pic_labelno;
-#ifdef USING_SVR4_H
+#ifdef USING_ELFOS_H
/* Which abi to adhere to */
const char *rs6000_abi_name = RS6000_ABI_NAME;
@@ -442,7 +442,7 @@ rs6000_file_start (file, default_cpu)
}
}
-#ifdef USING_SVR4_H
+#ifdef USING_ELFOS_H
switch (rs6000_sdata)
{
case SDATA_NONE: fprintf (file, "%s -msdata=none", start); start = ""; break;
@@ -471,7 +471,8 @@ rs6000_float_const (string, mode)
const char *string;
enum machine_mode mode;
{
- REAL_VALUE_TYPE value = REAL_VALUE_ATOF (string, mode);
+ REAL_VALUE_TYPE value;
+ value = REAL_VALUE_ATOF (string, mode);
return immed_real_const_1 (value, mode);
}
@@ -673,7 +674,43 @@ reg_or_arith_cint_operand (op, mode)
|| (GET_CODE (op) == CONST_INT
#if HOST_BITS_PER_WIDE_INT != 32
&& ((unsigned HOST_WIDE_INT) (INTVAL (op) + 0x80000000)
- < 0x100000000u)
+ < 0x100000000ll)
+#endif
+ ));
+}
+
+/* Return 1 is the operand is either a non-special register or a 32-bit
+ signed constant integer valid for 64-bit addition. */
+
+int
+reg_or_add_cint64_operand (op, mode)
+ register rtx op;
+ enum machine_mode mode;
+{
+ return (gpc_reg_operand (op, mode)
+ || (GET_CODE (op) == CONST_INT
+ && INTVAL (op) < 0x7fff8000
+#if HOST_BITS_PER_WIDE_INT != 32
+ && ((unsigned HOST_WIDE_INT) (INTVAL (op) + 0x80008000)
+ < 0x100000000ll)
+#endif
+ ));
+}
+
+/* Return 1 is the operand is either a non-special register or a 32-bit
+ signed constant integer valid for 64-bit subtraction. */
+
+int
+reg_or_sub_cint64_operand (op, mode)
+ register rtx op;
+ enum machine_mode mode;
+{
+ return (gpc_reg_operand (op, mode)
+ || (GET_CODE (op) == CONST_INT
+ && (- INTVAL (op)) < 0x7fff8000
+#if HOST_BITS_PER_WIDE_INT != 32
+ && ((unsigned HOST_WIDE_INT) ((- INTVAL (op)) + 0x80008000)
+ < 0x100000000ll)
#endif
));
}
@@ -712,7 +749,18 @@ reg_or_logical_cint_operand (op, mode)
return gpc_reg_operand (op, mode);
}
-/* Return 1 if the operand is an operand that can be loaded via the GOT */
+/* Return 1 if the operand is valid for SCC eq. */
+
+int
+scc_eq_operand (op, mode)
+ register rtx op;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
+{
+ return (short_cint_operand (op, mode)
+ || reg_or_logical_cint_operand (op, mode));
+}
+
+/* Return 1 if the operand is an operand that can be loaded via the GOT. */
int
got_operand (op, mode)
@@ -904,6 +952,15 @@ easy_fp_constant (op, mode)
abort ();
}
+/* Return 1 if the operand is 0.0. */
+int
+zero_fp_constant (op, mode)
+ register rtx op;
+ register enum machine_mode mode;
+{
+ return GET_MODE_CLASS (mode) == MODE_FLOAT && op == CONST0_RTX (mode);
+}
+
/* Return 1 if the operand is in volatile memory. Note that during the
RTL generation phase, memory_operand does not return TRUE for
volatile memory references. So this function allows us to
@@ -963,9 +1020,11 @@ add_operand (op, mode)
register rtx op;
enum machine_mode mode;
{
- return (reg_or_short_operand (op, mode)
- || (GET_CODE (op) == CONST_INT
- && CONST_OK_FOR_LETTER_P (INTVAL(op), 'L')));
+ if (GET_CODE (op) == CONST_INT)
+ return (CONST_OK_FOR_LETTER_P (INTVAL(op), 'I')
+ || CONST_OK_FOR_LETTER_P (INTVAL(op), 'L'));
+
+ return gpc_reg_operand (op, mode);
}
/* Return 1 if OP is a constant but not a valid add_operand. */
@@ -1041,26 +1100,36 @@ mask_operand (op, mode)
register rtx op;
enum machine_mode mode ATTRIBUTE_UNUSED;
{
- HOST_WIDE_INT c;
- int i;
- int last_bit_value;
- int transitions = 0;
+ HOST_WIDE_INT c, lsb;
if (GET_CODE (op) != CONST_INT)
return 0;
c = INTVAL (op);
- if (c == 0 || c == ~0)
+ /* We don't change the number of transitions by inverting,
+ so make sure we start with the LS bit zero. */
+ if (c & 1)
+ c = ~c;
+
+ /* Reject all zeros or all ones. */
+ if (c == 0)
return 0;
- last_bit_value = c & 1;
+ /* Find the first transition. */
+ lsb = c & -c;
+
+ /* Invert to look for a second transition. */
+ c = ~c;
+
+ /* Erase first transition. */
+ c &= -lsb;
- for (i = 1; i < 32; i++)
- if (((c >>= 1) & 1) != last_bit_value)
- last_bit_value ^= 1, transitions++;
+ /* Find the second transition (if any). */
+ lsb = c & -c;
- return transitions <= 2;
+ /* Match if all the bits above are 1's (or c is zero). */
+ return c == -lsb;
}
/* Return 1 if the operand is a constant that is a PowerPC64 mask.
@@ -1075,133 +1144,49 @@ mask64_operand (op, mode)
{
if (GET_CODE (op) == CONST_INT)
{
- HOST_WIDE_INT c = INTVAL (op);
- int i;
- int last_bit_value;
- int transitions = 0;
+ HOST_WIDE_INT c, lsb;
- if (c == 0 || c == ~0)
- return 0;
-
- last_bit_value = c & 1;
-
- for (i = 1; i < HOST_BITS_PER_WIDE_INT; i++)
- if (((c >>= 1) & 1) != last_bit_value)
- last_bit_value ^= 1, transitions++;
-
- return transitions <= 1;
- }
- else if (GET_CODE (op) == CONST_DOUBLE
- && (mode == VOIDmode || mode == DImode))
- {
- HOST_WIDE_INT low = CONST_DOUBLE_LOW (op);
-#if HOST_BITS_PER_WIDE_INT == 32
- HOST_WIDE_INT high = CONST_DOUBLE_HIGH (op);
-#endif
- int i;
- int last_bit_value;
- int transitions = 0;
-
- if ((low == 0
-#if HOST_BITS_PER_WIDE_INT == 32
- && high == 0
-#endif
- )
- || (low == ~0
-#if HOST_BITS_PER_WIDE_INT == 32
- && high == ~0
-#endif
- ))
- return 0;
-
- last_bit_value = low & 1;
-
- for (i = 1; i < HOST_BITS_PER_WIDE_INT; i++)
- if (((low >>= 1) & 1) != last_bit_value)
- last_bit_value ^= 1, transitions++;
-
-#if HOST_BITS_PER_WIDE_INT == 32
- if ((high & 1) != last_bit_value)
- last_bit_value ^= 1, transitions++;
-
- for (i = 1; i < HOST_BITS_PER_WIDE_INT; i++)
- if (((high >>= 1) & 1) != last_bit_value)
- last_bit_value ^= 1, transitions++;
-#endif
-
- return transitions <= 1;
- }
- else
- return 0;
-}
-
-/* Return 1 if the operand is a constant that is a PowerPC64 mask.
- It is if there are no more than two 1->0 or 0->1 transitions.
- Reject all ones and all zeros, since these should have been optimized
- away and confuse the making of MB and ME. */
-
-int
-rldic_operand (op, mode)
- register rtx op;
- enum machine_mode mode;
-{
- if (GET_CODE (op) == CONST_INT)
- {
- HOST_WIDE_INT c = INTVAL (op);
- int i;
- int last_bit_value;
- int transitions = 0;
+ /* We don't change the number of transitions by inverting,
+ so make sure we start with the LS bit zero. */
+ c = INTVAL (op);
+ if (c & 1)
+ c = ~c;
- if (c == 0 || c == ~0)
+ /* Reject all zeros or all ones. */
+ if (c == 0)
return 0;
- last_bit_value = c & 1;
-
- for (i = 1; i < HOST_BITS_PER_WIDE_INT; i++)
- if (((c >>= 1) & 1) != last_bit_value)
- last_bit_value ^= 1, transitions++;
-
- return transitions <= 2;
+ /* Find the transition, and check that all bits above are 1's. */
+ lsb = c & -c;
+ return c == -lsb;
}
else if (GET_CODE (op) == CONST_DOUBLE
&& (mode == VOIDmode || mode == DImode))
{
- HOST_WIDE_INT low = CONST_DOUBLE_LOW (op);
-#if HOST_BITS_PER_WIDE_INT == 32
- HOST_WIDE_INT high = CONST_DOUBLE_HIGH (op);
-#endif
- int i;
- int last_bit_value;
- int transitions = 0;
+ HOST_WIDE_INT low, high, lsb;
- if ((low == 0
-#if HOST_BITS_PER_WIDE_INT == 32
- && high == 0
-#endif
- )
- || (low == ~0
-#if HOST_BITS_PER_WIDE_INT == 32
- && high == ~0
-#endif
- ))
- return 0;
-
- last_bit_value = low & 1;
+ if (HOST_BITS_PER_WIDE_INT < 64)
+ high = CONST_DOUBLE_HIGH (op);
- for (i = 1; i < HOST_BITS_PER_WIDE_INT; i++)
- if (((low >>= 1) & 1) != last_bit_value)
- last_bit_value ^= 1, transitions++;
+ low = CONST_DOUBLE_LOW (op);
+ if (low & 1)
+ {
+ if (HOST_BITS_PER_WIDE_INT < 64)
+ high = ~high;
+ low = ~low;
+ }
-#if HOST_BITS_PER_WIDE_INT == 32
- if ((high & 1) != last_bit_value)
- last_bit_value ^= 1, transitions++;
+ if (low == 0)
+ {
+ if (HOST_BITS_PER_WIDE_INT >= 64 || high == 0)
+ return 0;
- for (i = 1; i < HOST_BITS_PER_WIDE_INT; i++)
- if (((high >>= 1) & 1) != last_bit_value)
- last_bit_value ^= 1, transitions++;
-#endif
+ lsb = high & -high;
+ return high == -lsb;
+ }
- return transitions <= 2;
+ lsb = low & -low;
+ return low == -lsb && (HOST_BITS_PER_WIDE_INT >= 64 || high == ~0);
}
else
return 0;
@@ -1264,7 +1249,10 @@ lwa_operand (op, mode)
return gpc_reg_operand (inner, mode)
|| (memory_operand (inner, mode)
&& GET_CODE (XEXP (inner, 0)) != PRE_INC
- && GET_CODE (XEXP (inner, 0)) != PRE_DEC);
+ && GET_CODE (XEXP (inner, 0)) != PRE_DEC
+ && (GET_CODE (XEXP (inner, 0)) != PLUS
+ || GET_CODE (XEXP (XEXP (inner, 0), 1)) != CONST_INT
+ || INTVAL (XEXP (XEXP (inner, 0), 1)) % 4 == 0));
}
/* Return 1 if the operand, used inside a MEM, is a valid first argument
@@ -1535,6 +1523,58 @@ rs6000_legitimize_address (x, oldx, mode)
else
return NULL_RTX;
}
+
+/* GO_IF_LEGITIMATE_ADDRESS recognizes an RTL expression
+ that is a valid memory address for an instruction.
+ The MODE argument is the machine mode for the MEM expression
+ that wants to use this address.
+
+ On the RS/6000, there are four valid address: a SYMBOL_REF that
+ refers to a constant pool entry of an address (or the sum of it
+ plus a constant), a short (16-bit signed) constant plus a register,
+ the sum of two registers, or a register indirect, possibly with an
+ auto-increment. For DFmode and DImode with an constant plus register,
+ we must ensure that both words are addressable or PowerPC64 with offset
+ word aligned.
+
+ For modes spanning multiple registers (DFmode in 32-bit GPRs,
+ 32-bit DImode, TImode), indexed addressing cannot be used because
+ adjacent memory cells are accessed by adding word-sized offsets
+ during assembly output. */
+int
+rs6000_legitimate_address (mode, x, reg_ok_strict)
+ enum machine_mode mode;
+ rtx x;
+ int reg_ok_strict;
+{
+ if (LEGITIMATE_INDIRECT_ADDRESS_P (x, reg_ok_strict))
+ return 1;
+ if ((GET_CODE (x) == PRE_INC || GET_CODE (x) == PRE_DEC)
+ && TARGET_UPDATE
+ && LEGITIMATE_INDIRECT_ADDRESS_P (XEXP (x, 0), reg_ok_strict))
+ return 1;
+ if (LEGITIMATE_SMALL_DATA_P (mode, x))
+ return 1;
+ if (LEGITIMATE_CONSTANT_POOL_ADDRESS_P (x))
+ return 1;
+ /* If not REG_OK_STRICT (before reload) let pass any stack offset. */
+ if (! reg_ok_strict
+ && GET_CODE (x) == PLUS
+ && GET_CODE (XEXP (x, 0)) == REG
+ && XEXP (x, 0) == virtual_stack_vars_rtx
+ && GET_CODE (XEXP (x, 1)) == CONST_INT)
+ return 1;
+ if (LEGITIMATE_OFFSET_ADDRESS_P (mode, x, reg_ok_strict))
+ return 1;
+ if (mode != TImode
+ && (TARGET_HARD_FLOAT || TARGET_POWERPC64 || mode != DFmode)
+ && (TARGET_POWERPC64 || mode != DImode)
+ && LEGITIMATE_INDEXED_ADDRESS_P (x, reg_ok_strict))
+ return 1;
+ if (LEGITIMATE_LO_SUM_ADDRESS_P (mode, x, reg_ok_strict))
+ return 1;
+ return 0;
+}
/* Emit a move from SOURCE to DEST in mode MODE. */
void
@@ -1913,7 +1953,7 @@ function_arg_advance (cum, mode, type, named)
{
if (mode == DFmode)
cum->words += cum->words & 1;
- cum->words += RS6000_ARG_SIZE (mode, type, 1);
+ cum->words += RS6000_ARG_SIZE (mode, type);
}
}
else
@@ -1926,7 +1966,7 @@ function_arg_advance (cum, mode, type, named)
|| mode == TFmode)
n_words = 1;
else
- n_words = RS6000_ARG_SIZE (mode, type, 1);
+ n_words = RS6000_ARG_SIZE (mode, type);
/* Long long is put in odd registers. */
if (n_words == 2 && (gregno & 1) == 0)
@@ -1961,14 +2001,10 @@ function_arg_advance (cum, mode, type, named)
{
int align = (TARGET_32BIT && (cum->words & 1) != 0
&& function_arg_boundary (mode, type) == 64) ? 1 : 0;
- cum->words += align;
+ cum->words += align + RS6000_ARG_SIZE (mode, type);
- if (named)
- {
- cum->words += RS6000_ARG_SIZE (mode, type, named);
- if (GET_MODE_CLASS (mode) == MODE_FLOAT && TARGET_HARD_FLOAT)
- cum->fregno++;
- }
+ if (GET_MODE_CLASS (mode) == MODE_FLOAT && TARGET_HARD_FLOAT)
+ cum->fregno++;
if (TARGET_DEBUG_ARG)
{
@@ -2009,7 +2045,7 @@ function_arg (cum, mode, type, named)
CUMULATIVE_ARGS *cum;
enum machine_mode mode;
tree type;
- int named;
+ int named ATTRIBUTE_UNUSED;
{
enum rs6000_abi abi = DEFAULT_ABI;
@@ -2053,7 +2089,7 @@ function_arg (cum, mode, type, named)
|| mode == TFmode)
n_words = 1;
else
- n_words = RS6000_ARG_SIZE (mode, type, 1);
+ n_words = RS6000_ARG_SIZE (mode, type);
/* Long long is put in odd registers. */
if (n_words == 2 && (gregno & 1) == 0)
@@ -2072,9 +2108,6 @@ function_arg (cum, mode, type, named)
&& function_arg_boundary (mode, type) == 64) ? 1 : 0;
int align_words = cum->words + align;
- if (! named)
- return NULL_RTX;
-
if (type && TREE_CODE (TYPE_SIZE (type)) != INTEGER_CST)
return NULL_RTX;
@@ -2096,7 +2129,7 @@ function_arg (cum, mode, type, named)
((align_words >= GP_ARG_NUM_REG)
? NULL_RTX
: (align_words
- + RS6000_ARG_SIZE (mode, type, named)
+ + RS6000_ARG_SIZE (mode, type)
> GP_ARG_NUM_REG
/* If this is partially on the stack, then
we only include the portion actually
@@ -2126,11 +2159,8 @@ function_arg_partial_nregs (cum, mode, type, named)
CUMULATIVE_ARGS *cum;
enum machine_mode mode;
tree type;
- int named;
+ int named ATTRIBUTE_UNUSED;
{
- if (! named)
- return 0;
-
if (DEFAULT_ABI == ABI_V4 || DEFAULT_ABI == ABI_SOLARIS)
return 0;
@@ -2141,7 +2171,7 @@ function_arg_partial_nregs (cum, mode, type, named)
}
if (cum->words < GP_ARG_NUM_REG
- && GP_ARG_NUM_REG < (cum->words + RS6000_ARG_SIZE (mode, type, named)))
+ && GP_ARG_NUM_REG < (cum->words + RS6000_ARG_SIZE (mode, type)))
{
int ret = GP_ARG_NUM_REG - cum->words;
if (ret && TARGET_DEBUG_ARG)
@@ -2206,25 +2236,24 @@ setup_incoming_varargs (cum, mode, type, pretend_size, no_rtl)
{
CUMULATIVE_ARGS next_cum;
int reg_size = TARGET_32BIT ? 4 : 8;
- rtx save_area, mem;
+ rtx save_area = NULL_RTX, mem;
int first_reg_offset, set;
+ tree fntype;
+ int stdarg_p;
- if (DEFAULT_ABI == ABI_V4 || DEFAULT_ABI == ABI_SOLARIS)
- {
- tree fntype;
- int stdarg_p;
-
- fntype = TREE_TYPE (current_function_decl);
- stdarg_p = (TYPE_ARG_TYPES (fntype) != 0
- && (TREE_VALUE (tree_last (TYPE_ARG_TYPES (fntype)))
- != void_type_node));
+ fntype = TREE_TYPE (current_function_decl);
+ stdarg_p = (TYPE_ARG_TYPES (fntype) != 0
+ && (TREE_VALUE (tree_last (TYPE_ARG_TYPES (fntype)))
+ != void_type_node));
- /* For varargs, we do not want to skip the dummy va_dcl argument.
- For stdargs, we do want to skip the last named argument. */
- next_cum = *cum;
- if (stdarg_p)
- function_arg_advance (&next_cum, mode, type, 1);
+ /* For varargs, we do not want to skip the dummy va_dcl argument.
+ For stdargs, we do want to skip the last named argument. */
+ next_cum = *cum;
+ if (stdarg_p)
+ function_arg_advance (&next_cum, mode, type, 1);
+ if (DEFAULT_ABI == ABI_V4 || DEFAULT_ABI == ABI_SOLARIS)
+ {
/* Indicate to allocate space on the stack for varargs save area. */
/* ??? Does this really have to be located at a magic spot on the
stack, or can we allocate this with assign_stack_local instead. */
@@ -2237,12 +2266,12 @@ setup_incoming_varargs (cum, mode, type, pretend_size, no_rtl)
}
else
{
+ first_reg_offset = next_cum.words;
save_area = virtual_incoming_args_rtx;
cfun->machine->sysv_varargs_p = 0;
- first_reg_offset = cum->words;
if (MUST_PASS_IN_STACK (mode, type))
- first_reg_offset += RS6000_ARG_SIZE (TYPE_MODE (type), type, 1);
+ first_reg_offset += RS6000_ARG_SIZE (TYPE_MODE (type), type);
}
set = get_varargs_alias_set ();
@@ -3080,14 +3109,14 @@ lmw_operation (op, mode)
|| count != 32 - (int) dest_regno)
return 0;
- if (LEGITIMATE_INDIRECT_ADDRESS_P (src_addr))
+ if (LEGITIMATE_INDIRECT_ADDRESS_P (src_addr, 0))
{
offset = 0;
base_regno = REGNO (src_addr);
if (base_regno == 0)
return 0;
}
- else if (LEGITIMATE_OFFSET_ADDRESS_P (SImode, src_addr))
+ else if (LEGITIMATE_OFFSET_ADDRESS_P (SImode, src_addr, 0))
{
offset = INTVAL (XEXP (src_addr, 1));
base_regno = REGNO (XEXP (src_addr, 0));
@@ -3110,12 +3139,12 @@ lmw_operation (op, mode)
|| GET_MODE (SET_SRC (elt)) != SImode)
return 0;
newaddr = XEXP (SET_SRC (elt), 0);
- if (LEGITIMATE_INDIRECT_ADDRESS_P (newaddr))
+ if (LEGITIMATE_INDIRECT_ADDRESS_P (newaddr, 0))
{
newoffset = 0;
addr_reg = newaddr;
}
- else if (LEGITIMATE_OFFSET_ADDRESS_P (SImode, newaddr))
+ else if (LEGITIMATE_OFFSET_ADDRESS_P (SImode, newaddr, 0))
{
addr_reg = XEXP (newaddr, 0);
newoffset = INTVAL (XEXP (newaddr, 1));
@@ -3158,14 +3187,14 @@ stmw_operation (op, mode)
|| count != 32 - (int) src_regno)
return 0;
- if (LEGITIMATE_INDIRECT_ADDRESS_P (dest_addr))
+ if (LEGITIMATE_INDIRECT_ADDRESS_P (dest_addr, 0))
{
offset = 0;
base_regno = REGNO (dest_addr);
if (base_regno == 0)
return 0;
}
- else if (LEGITIMATE_OFFSET_ADDRESS_P (SImode, dest_addr))
+ else if (LEGITIMATE_OFFSET_ADDRESS_P (SImode, dest_addr, 0))
{
offset = INTVAL (XEXP (dest_addr, 1));
base_regno = REGNO (XEXP (dest_addr, 0));
@@ -3188,12 +3217,12 @@ stmw_operation (op, mode)
|| GET_MODE (SET_DEST (elt)) != SImode)
return 0;
newaddr = XEXP (SET_DEST (elt), 0);
- if (LEGITIMATE_INDIRECT_ADDRESS_P (newaddr))
+ if (LEGITIMATE_INDIRECT_ADDRESS_P (newaddr, 0))
{
newoffset = 0;
addr_reg = newaddr;
}
- else if (LEGITIMATE_OFFSET_ADDRESS_P (SImode, newaddr))
+ else if (LEGITIMATE_OFFSET_ADDRESS_P (SImode, newaddr, 0))
{
addr_reg = XEXP (newaddr, 0);
newoffset = INTVAL (XEXP (newaddr, 1));
@@ -3237,8 +3266,9 @@ validate_condition_mode (code, mode)
|| code == UNGE || code == UNLE))
abort();
- /* These should never be generated. */
+ /* These should never be generated except for fast_math. */
if (mode == CCFPmode
+ && ! flag_fast_math
&& (code == LE || code == GE
|| code == UNEQ || code == LTGT
|| code == UNGT || code == UNLT))
@@ -3351,6 +3381,15 @@ boolean_or_operator (op, mode)
enum rtx_code code = GET_CODE (op);
return (code == IOR || code == XOR);
}
+
+int
+min_max_operator (op, mode)
+ rtx op;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
+{
+ enum rtx_code code = GET_CODE (op);
+ return (code == SMIN || code == SMAX || code == UMIN || code == UMAX);
+}
/* Return 1 if ANDOP is a mask that has no bits on that are not in the
mask required to convert the result of a rotate insn into a shift
@@ -3382,36 +3421,171 @@ includes_rshift_p (shiftop, andop)
return (INTVAL (andop) & ~shift_mask) == 0;
}
-/* Return 1 if ANDOP is a mask that has no bits on that are not in the
- mask required to convert the result of a rotate insn into a shift
- left insn of SHIFTOP bits. */
+/* Return 1 if ANDOP is a mask suitable for use with an rldic insn
+ to perform a left shift. It must have exactly SHIFTOP least
+ signifigant 0's, then one or more 1's, then zero or more 0's. */
int
-includes_lshift64_p (shiftop, andop)
+includes_rldic_lshift_p (shiftop, andop)
register rtx shiftop;
register rtx andop;
{
-#if HOST_BITS_PER_WIDE_INT == 64
- unsigned HOST_WIDE_INT shift_mask = ~(unsigned HOST_WIDE_INT) 0;
+ if (GET_CODE (andop) == CONST_INT)
+ {
+ HOST_WIDE_INT c, lsb, shift_mask;
- shift_mask <<= INTVAL (shiftop);
+ c = INTVAL (andop);
+ if (c == 0 || c == ~0)
+ return 0;
- return (INTVAL (andop) & ~shift_mask) == 0;
-#else
- unsigned HOST_WIDE_INT shift_mask_low = ~(unsigned HOST_WIDE_INT) 0;
- unsigned HOST_WIDE_INT shift_mask_high = ~(unsigned HOST_WIDE_INT) 0;
+ shift_mask = ~0;
+ shift_mask <<= INTVAL (shiftop);
+
+ /* Find the least signifigant one bit. */
+ lsb = c & -c;
+
+ /* It must coincide with the LSB of the shift mask. */
+ if (-lsb != shift_mask)
+ return 0;
+
+ /* Invert to look for the next transition (if any). */
+ c = ~c;
+
+ /* Remove the low group of ones (originally low group of zeros). */
+ c &= -lsb;
+
+ /* Again find the lsb, and check we have all 1's above. */
+ lsb = c & -c;
+ return c == -lsb;
+ }
+ else if (GET_CODE (andop) == CONST_DOUBLE
+ && (GET_MODE (andop) == VOIDmode || GET_MODE (andop) == DImode))
+ {
+ HOST_WIDE_INT low, high, lsb;
+ HOST_WIDE_INT shift_mask_low, shift_mask_high;
+
+ low = CONST_DOUBLE_LOW (andop);
+ if (HOST_BITS_PER_WIDE_INT < 64)
+ high = CONST_DOUBLE_HIGH (andop);
+
+ if ((low == 0 && (HOST_BITS_PER_WIDE_INT >= 64 || high == 0))
+ || (low == ~0 && (HOST_BITS_PER_WIDE_INT >= 64 || high == ~0)))
+ return 0;
+
+ if (HOST_BITS_PER_WIDE_INT < 64 && low == 0)
+ {
+ shift_mask_high = ~0;
+ if (INTVAL (shiftop) > 32)
+ shift_mask_high <<= INTVAL (shiftop) - 32;
- shift_mask_low <<= INTVAL (shiftop);
+ lsb = high & -high;
+
+ if (-lsb != shift_mask_high || INTVAL (shiftop) < 32)
+ return 0;
+
+ high = ~high;
+ high &= -lsb;
+
+ lsb = high & -high;
+ return high == -lsb;
+ }
- if (INTVAL (shiftop) > 32)
- shift_mask_high <<= (INTVAL (shiftop) - 32);
+ shift_mask_low = ~0;
+ shift_mask_low <<= INTVAL (shiftop);
+ lsb = low & -low;
+
+ if (-lsb != shift_mask_low)
+ return 0;
+
+ if (HOST_BITS_PER_WIDE_INT < 64)
+ high = ~high;
+ low = ~low;
+ low &= -lsb;
+
+ if (HOST_BITS_PER_WIDE_INT < 64 && low == 0)
+ {
+ lsb = high & -high;
+ return high == -lsb;
+ }
+
+ lsb = low & -low;
+ return low == -lsb && (HOST_BITS_PER_WIDE_INT >= 64 || high == ~0);
+ }
+ else
+ return 0;
+}
+
+/* Return 1 if ANDOP is a mask suitable for use with an rldicr insn
+ to perform a left shift. It must have SHIFTOP or more least
+ signifigant 0's, with the remainder of the word 1's. */
+
+int
+includes_rldicr_lshift_p (shiftop, andop)
+ register rtx shiftop;
+ register rtx andop;
+{
if (GET_CODE (andop) == CONST_INT)
- return (INTVAL (andop) & ~shift_mask_low) == 0;
+ {
+ HOST_WIDE_INT c, lsb, shift_mask;
+
+ shift_mask = ~0;
+ shift_mask <<= INTVAL (shiftop);
+ c = INTVAL (andop);
+
+ /* Find the least signifigant one bit. */
+ lsb = c & -c;
+
+ /* It must be covered by the shift mask.
+ This test also rejects c == 0. */
+ if ((lsb & shift_mask) == 0)
+ return 0;
+
+ /* Check we have all 1's above the transition, and reject all 1's. */
+ return c == -lsb && lsb != 1;
+ }
+ else if (GET_CODE (andop) == CONST_DOUBLE
+ && (GET_MODE (andop) == VOIDmode || GET_MODE (andop) == DImode))
+ {
+ HOST_WIDE_INT low, lsb, shift_mask_low;
+
+ low = CONST_DOUBLE_LOW (andop);
+
+ if (HOST_BITS_PER_WIDE_INT < 64)
+ {
+ HOST_WIDE_INT high, shift_mask_high;
+
+ high = CONST_DOUBLE_HIGH (andop);
+
+ if (low == 0)
+ {
+ shift_mask_high = ~0;
+ if (INTVAL (shiftop) > 32)
+ shift_mask_high <<= INTVAL (shiftop) - 32;
+
+ lsb = high & -high;
+
+ if ((lsb & shift_mask_high) == 0)
+ return 0;
+
+ return high == -lsb;
+ }
+ if (high != ~0)
+ return 0;
+ }
+
+ shift_mask_low = ~0;
+ shift_mask_low <<= INTVAL (shiftop);
+
+ lsb = low & -low;
+
+ if ((lsb & shift_mask_low) == 0)
+ return 0;
+
+ return low == -lsb && lsb != 1;
+ }
else
- return ((CONST_DOUBLE_HIGH (andop) & ~shift_mask_high) == 0
- && (CONST_DOUBLE_LOW (andop) & ~shift_mask_low) == 0);
-#endif
+ return 0;
}
/* Return 1 if REGNO (reg1) == REGNO (reg2) - 1 making them candidates
@@ -3985,6 +4159,7 @@ print_operand (file, x, code)
case 'p':
/* X is a CONST_INT that is a power of two. Output the logarithm. */
if (! INT_P (x)
+ || INT_LOWPART (x) < 0
|| (i = exact_log2 (INT_LOWPART (x))) < 0)
output_operand_lossage ("invalid %%p value");
else
@@ -4214,9 +4389,6 @@ print_operand (file, x, code)
case 'W':
/* MB value for a PowerPC64 rldic operand. */
- if (! rldic_operand (x, VOIDmode))
- output_operand_lossage ("invalid %%W value");
-
val = (GET_CODE (x) == CONST_INT
? INTVAL (x) : CONST_DOUBLE_HIGH (x));
@@ -4250,7 +4422,7 @@ print_operand (file, x, code)
case 'X':
if (GET_CODE (x) == MEM
- && LEGITIMATE_INDEXED_ADDRESS_P (XEXP (x, 0)))
+ && LEGITIMATE_INDEXED_ADDRESS_P (XEXP (x, 0), 0))
putc ('x', file);
return;
@@ -4451,8 +4623,10 @@ rs6000_generate_compare (code)
rs6000_compare_op0,
rs6000_compare_op1)));
- /* Some kinds of FP comparisons need an OR operation. */
+ /* Some kinds of FP comparisons need an OR operation;
+ except that for fast_math we don't bother. */
if (rs6000_compare_fp_p
+ && ! flag_fast_math
&& (code == LE || code == GE
|| code == UNEQ || code == LTGT
|| code == UNGT || code == UNLT))
@@ -4579,12 +4753,18 @@ output_cbranch (op, label, reversed, insn)
{
/* Not all of these are actually distinct opcodes, but
we distinguish them for clarity of the resulting assembler. */
- case NE: ccode = "ne"; break;
- case EQ: ccode = "eq"; break;
- case GE: case GEU: ccode = "ge"; break;
- case GT: case GTU: ccode = "gt"; break;
- case LE: case LEU: ccode = "le"; break;
- case LT: case LTU: ccode = "lt"; break;
+ case NE: case LTGT:
+ ccode = "ne"; break;
+ case EQ: case UNEQ:
+ ccode = "eq"; break;
+ case GE: case GEU:
+ ccode = "ge"; break;
+ case GT: case GTU: case UNGT:
+ ccode = "gt"; break;
+ case LE: case LEU:
+ ccode = "le"; break;
+ case LT: case LTU: case UNLT:
+ ccode = "lt"; break;
case UNORDERED: ccode = "un"; break;
case ORDERED: ccode = "nu"; break;
case UNGE: ccode = "nl"; break;
@@ -4634,6 +4814,181 @@ output_cbranch (op, label, reversed, insn)
return string;
}
+
+/* Emit a conditional move: move TRUE_COND to DEST if OP of the
+ operands of the last comparison is nonzero/true, FALSE_COND if it
+ is zero/false. Return 0 if the hardware has no such operation. */
+int
+rs6000_emit_cmove (dest, op, true_cond, false_cond)
+ rtx dest;
+ rtx op;
+ rtx true_cond;
+ rtx false_cond;
+{
+ enum rtx_code code = GET_CODE (op);
+ rtx op0 = rs6000_compare_op0;
+ rtx op1 = rs6000_compare_op1;
+ REAL_VALUE_TYPE c1;
+ enum machine_mode mode = GET_MODE (op0);
+ rtx temp;
+
+ /* First, work out if the hardware can do this at all, or
+ if it's too slow... */
+ /* If the comparison is an integer one, since we only have fsel
+ it'll be cheaper to use a branch. */
+ if (! rs6000_compare_fp_p)
+ return 0;
+
+ /* Eliminate half of the comparisons by switching operands, this
+ makes the remaining code simpler. */
+ if (code == UNLT || code == UNGT || code == UNORDERED || code == NE
+ || code == LTGT || code == LT)
+ {
+ code = reverse_condition_maybe_unordered (code);
+ temp = true_cond;
+ true_cond = false_cond;
+ false_cond = temp;
+ }
+
+ /* UNEQ and LTGT take four instructions for a comparison with zero,
+ it'll probably be faster to use a branch here too. */
+ if (code == UNEQ)
+ return 0;
+
+ if (GET_CODE (op1) == CONST_DOUBLE)
+ REAL_VALUE_FROM_CONST_DOUBLE (c1, op1);
+
+ /* We're going to try to implement comparions by performing
+ a subtract, then comparing against zero. Unfortunately,
+ Inf - Inf is NaN which is not zero, and so if we don't
+ know that the the operand is finite and the comparison
+ would treat EQ different to UNORDERED, we can't do it. */
+ if (! flag_fast_math
+ && code != GT && code != UNGE
+ && (GET_CODE (op1) != CONST_DOUBLE || target_isinf (c1))
+ /* Constructs of the form (a OP b ? a : b) are safe. */
+ && ((! rtx_equal_p (op0, false_cond) && ! rtx_equal_p (op1, false_cond))
+ || (! rtx_equal_p (op0, true_cond)
+ && ! rtx_equal_p (op1, true_cond))))
+ return 0;
+ /* At this point we know we can use fsel. */
+
+ /* Reduce the comparison to a comparison against zero. */
+ temp = gen_reg_rtx (mode);
+ emit_insn (gen_rtx_SET (VOIDmode, temp,
+ gen_rtx_MINUS (mode, op0, op1)));
+ op0 = temp;
+ op1 = CONST0_RTX (mode);
+
+ /* If we don't care about NaNs we can reduce some of the comparisons
+ down to faster ones. */
+ if (flag_fast_math)
+ switch (code)
+ {
+ case GT:
+ code = LE;
+ temp = true_cond;
+ true_cond = false_cond;
+ false_cond = temp;
+ break;
+ case UNGE:
+ code = GE;
+ break;
+ case UNEQ:
+ code = EQ;
+ break;
+ default:
+ break;
+ }
+
+ /* Now, reduce everything down to a GE. */
+ switch (code)
+ {
+ case GE:
+ break;
+
+ case LE:
+ temp = gen_reg_rtx (mode);
+ emit_insn (gen_rtx_SET (VOIDmode, temp, gen_rtx_NEG (mode, op0)));
+ op0 = temp;
+ break;
+
+ case ORDERED:
+ temp = gen_reg_rtx (mode);
+ emit_insn (gen_rtx_SET (VOIDmode, temp, gen_rtx_ABS (mode, op0)));
+ op0 = temp;
+ break;
+
+ case EQ:
+ temp = gen_reg_rtx (mode);
+ emit_insn (gen_rtx_SET (VOIDmode, temp,
+ gen_rtx_NEG (mode,
+ gen_rtx_ABS (mode, op0))));
+ op0 = temp;
+ break;
+
+ case UNGE:
+ temp = gen_reg_rtx (mode);
+ emit_insn (gen_rtx_SET (VOIDmode, temp,
+ gen_rtx_IF_THEN_ELSE (mode,
+ gen_rtx_GE (VOIDmode,
+ op0, op1),
+ true_cond, false_cond)));
+ false_cond = temp;
+ true_cond = false_cond;
+
+ temp = gen_reg_rtx (mode);
+ emit_insn (gen_rtx_SET (VOIDmode, temp, gen_rtx_NEG (mode, op0)));
+ op0 = temp;
+ break;
+
+ case GT:
+ temp = gen_reg_rtx (mode);
+ emit_insn (gen_rtx_SET (VOIDmode, temp,
+ gen_rtx_IF_THEN_ELSE (mode,
+ gen_rtx_GE (VOIDmode,
+ op0, op1),
+ true_cond, false_cond)));
+ true_cond = temp;
+ false_cond = true_cond;
+
+ temp = gen_reg_rtx (mode);
+ emit_insn (gen_rtx_SET (VOIDmode, temp, gen_rtx_NEG (mode, op0)));
+ op0 = temp;
+ break;
+
+ default:
+ abort ();
+ }
+
+ emit_insn (gen_rtx_SET (VOIDmode, dest,
+ gen_rtx_IF_THEN_ELSE (GET_MODE (dest),
+ gen_rtx_GE (VOIDmode,
+ op0, op1),
+ true_cond, false_cond)));
+ return 1;
+}
+
+void
+rs6000_emit_minmax (dest, code, op0, op1)
+ rtx dest;
+ enum rtx_code code;
+ rtx op0;
+ rtx op1;
+{
+ enum machine_mode mode = GET_MODE (op0);
+ rtx target;
+ if (code == SMAX || code == UMAX)
+ target = emit_conditional_move (dest, GE, op0, op1, mode,
+ op0, op1, mode, 0);
+ else
+ target = emit_conditional_move (dest, GE, op0, op1, mode,
+ op1, op0, mode, 0);
+ if (target == NULL_RTX)
+ abort ();
+ if (target != dest)
+ emit_move_insn (dest, target);
+}
/* This page contains routines that are used to determine what the function
prologue and epilogue code will do and write them out. */
@@ -4804,6 +5159,7 @@ rs6000_stack_info ()
rs6000_stack_t *info_ptr = &info;
int reg_size = TARGET_POWERPC64 ? 8 : 4;
enum rs6000_abi abi;
+ int ehrd_size;
int total_raw_size;
/* Zero all fields portably */
@@ -4856,6 +5212,19 @@ rs6000_stack_info ()
info_ptr->cr_size = reg_size;
}
+ /* If the current function calls __builtin_eh_return, then we need
+ to allocate stack space for registers that will hold data for
+ the exception handler. */
+ if (current_function_calls_eh_return)
+ {
+ unsigned int i;
+ for (i = 0; EH_RETURN_DATA_REGNO (i) != INVALID_REGNUM; ++i)
+ continue;
+ ehrd_size = i * UNITS_PER_WORD;
+ }
+ else
+ ehrd_size = 0;
+
/* Determine various sizes */
info_ptr->reg_size = reg_size;
info_ptr->fixed_size = RS6000_SAVE_AREA;
@@ -4864,6 +5233,7 @@ rs6000_stack_info ()
info_ptr->parm_size = RS6000_ALIGN (current_function_outgoing_args_size, 8);
info_ptr->save_size = RS6000_ALIGN (info_ptr->fp_size
+ info_ptr->gp_size
+ + ehrd_size
+ info_ptr->cr_size
+ info_ptr->lr_size
+ info_ptr->toc_size, 8);
@@ -4879,6 +5249,7 @@ rs6000_stack_info ()
case ABI_AIX_NODESC:
info_ptr->fp_save_offset = - info_ptr->fp_size;
info_ptr->gp_save_offset = info_ptr->fp_save_offset - info_ptr->gp_size;
+ info_ptr->ehrd_offset = info_ptr->gp_save_offset - ehrd_size;
info_ptr->cr_save_offset = reg_size; /* first word when 64-bit. */
info_ptr->lr_save_offset = 2*reg_size;
break;
@@ -4889,6 +5260,7 @@ rs6000_stack_info ()
info_ptr->gp_save_offset = info_ptr->fp_save_offset - info_ptr->gp_size;
info_ptr->cr_save_offset = info_ptr->gp_save_offset - info_ptr->cr_size;
info_ptr->toc_save_offset = info_ptr->cr_save_offset - info_ptr->toc_size;
+ info_ptr->ehrd_offset = info_ptr->toc_save_offset - ehrd_size;
info_ptr->lr_save_offset = reg_size;
break;
}
@@ -5581,7 +5953,7 @@ rs6000_frame_related (insn, reg, val, reg2, rreg)
/* Emit function prologue as insns. */
void
-rs6000_emit_prologue()
+rs6000_emit_prologue ()
{
rs6000_stack_t *info = rs6000_stack_info ();
enum machine_mode reg_mode = TARGET_POWERPC64 ? DImode : SImode;
@@ -5737,6 +6109,31 @@ rs6000_emit_prologue()
}
}
+ /* ??? There's no need to emit actual instructions here, but it's the
+ easiest way to get the frame unwind information emitted. */
+ if (current_function_calls_eh_return)
+ {
+ unsigned int i, regno;
+ for (i = 0; ; ++i)
+ {
+ rtx addr, reg, mem;
+
+ regno = EH_RETURN_DATA_REGNO (i);
+ if (regno == INVALID_REGNUM)
+ break;
+
+ reg = gen_rtx_REG (reg_mode, regno);
+ addr = plus_constant (frame_reg_rtx,
+ info->ehrd_offset + sp_offset + reg_size * i);
+ mem = gen_rtx_MEM (reg_mode, addr);
+ MEM_ALIAS_SET (mem) = rs6000_sr_alias_set;
+
+ insn = emit_move_insn (mem, reg);
+ rs6000_frame_related (insn, frame_ptr_rtx, info->total_size,
+ NULL_RTX, NULL_RTX);
+ }
+ }
+
/* Save lr if we used it. */
if (info->lr_save_p)
{
@@ -5773,9 +6170,10 @@ rs6000_emit_prologue()
to understand '(unspec:SI [(reg:CC 68) ...] 19)'. But that's
OK. All we have to do is specify that _one_ condition code
register is saved in this stack slot. The thrower's epilogue
- will then restore all the call-saved registers. */
+ will then restore all the call-saved registers.
+ We use CR2_REGNO (70) to be compatible with gcc-2.95 on Linux. */
rs6000_frame_related (insn, frame_ptr_rtx, info->total_size,
- cr_save_rtx, gen_rtx_REG (SImode, CR0_REGNO));
+ cr_save_rtx, gen_rtx_REG (SImode, CR2_REGNO));
}
/* Update stack and set back pointer unless this is V.4,
@@ -5800,8 +6198,9 @@ rs6000_emit_prologue()
it. We use R11 for this purpose because emit_load_toc_table
can use register 0. This allows us to use a plain 'blr' to return
from the procedure more often. */
- int save_LR_around_toc_setup = (TARGET_ELF && flag_pic != 0 &&
- ! info->lr_save_p);
+ int save_LR_around_toc_setup = (TARGET_ELF && flag_pic != 0
+ && ! info->lr_save_p
+ && EXIT_BLOCK_PTR->pred != NULL);
if (save_LR_around_toc_setup)
emit_move_insn (gen_rtx_REG (Pmode, 11),
gen_rtx_REG (Pmode, LINK_REGISTER_REGNUM));
@@ -5872,7 +6271,7 @@ output_prolog (file, size)
need special notes to explain where r11 is in relation to the stack. */
void
-rs6000_emit_epilogue(sibcall)
+rs6000_emit_epilogue (sibcall)
int sibcall;
{
rs6000_stack_t *info;
@@ -5891,6 +6290,7 @@ rs6000_emit_epilogue(sibcall)
using_load_multiple = (TARGET_MULTIPLE && ! TARGET_POWERPC64
&& info->first_gp_reg_save < 31);
restoring_FPRs_inline = (sibcall
+ || current_function_calls_eh_return
|| info->first_fp_reg_save == 64
|| FP_SAVE_INLINE (info->first_fp_reg_save));
use_backchain_to_restore_sp = (frame_pointer_needed
@@ -5956,6 +6356,26 @@ rs6000_emit_epilogue(sibcall)
emit_move_insn (gen_rtx_REG (Pmode, LINK_REGISTER_REGNUM),
gen_rtx_REG (Pmode, 0));
+ /* Load exception handler data registers, if needed. */
+ if (current_function_calls_eh_return)
+ {
+ unsigned int i, regno;
+ for (i = 0; ; ++i)
+ {
+ rtx addr, mem;
+
+ regno = EH_RETURN_DATA_REGNO (i);
+ if (regno == INVALID_REGNUM)
+ break;
+
+ addr = plus_constant (frame_reg_rtx,
+ info->ehrd_offset + sp_offset + reg_size * i);
+ mem = gen_rtx_MEM (reg_mode, addr);
+ MEM_ALIAS_SET (mem) = rs6000_sr_alias_set;
+
+ emit_move_insn (gen_rtx_REG (reg_mode, regno), mem);
+ }
+ }
/* Restore GPRs. This is done as a PARALLEL if we are using
the load-multiple instructions. */
@@ -6091,6 +6511,14 @@ rs6000_emit_epilogue(sibcall)
}
}
+ if (current_function_calls_eh_return)
+ {
+ rtx sa = EH_RETURN_STACKADJ_RTX;
+ emit_insn (Pmode == SImode
+ ? gen_addsi3 (sp_reg_rtx, sp_reg_rtx, sa)
+ : gen_adddi3 (sp_reg_rtx, sp_reg_rtx, sa));
+ }
+
if (!sibcall)
{
rtvec p;
@@ -6524,7 +6952,7 @@ output_mi_thunk (file, thunk_fndecl, delta, function)
assemble_name (file, buf);
putc ('\n', file);
text_section ();
- asm_fprintf (file, (TARGET_32BIT) ? "\t{l|lwz} %s," : "\tld %s", r12);
+ asm_fprintf (file, (TARGET_32BIT) ? "\t{l|lwz} %s," : "\tld %s,", r12);
assemble_name (file, buf);
asm_fprintf (file, "(%s)\n", reg_names[2]);
asm_fprintf (file,
@@ -7160,9 +7588,6 @@ output_function_profiler (file, labelno)
FILE *file;
int labelno;
{
- /* The last used parameter register. */
- int last_parm_reg;
- int i, j;
char buf[100];
ASM_GENERATE_INTERNAL_LABEL (buf, "LP", labelno);
@@ -7305,7 +7730,8 @@ rs6000_adjust_priority (insn, priority)
}
/* Return how many instructions the machine can issue per cycle */
-int get_issue_rate()
+int
+get_issue_rate ()
{
switch (rs6000_cpu_attr) {
case CPU_RIOS1: /* ? */
@@ -7383,7 +7809,7 @@ rs6000_initialize_trampoline (addr, fnaddr, cxt)
rtx fn_reg = gen_reg_rtx (pmode);
rtx toc_reg = gen_reg_rtx (pmode);
emit_move_insn (fn_reg, MEM_DEREF (fnaddr));
- emit_move_insn (toc_reg, MEM_PLUS (fnaddr, 4));
+ emit_move_insn (toc_reg, MEM_PLUS (fnaddr, regsize));
emit_move_insn (MEM_DEREF (addr), fn_reg);
emit_move_insn (MEM_PLUS (addr, regsize), toc_reg);
emit_move_insn (MEM_PLUS (addr, 2*regsize), ctx_reg);
@@ -7504,7 +7930,7 @@ rs6000_longcall_ref (call_ref)
Do not define this macro if you put all constants in the read-only
data section. */
-#ifdef USING_SVR4_H
+#ifdef USING_ELFOS_H
void
rs6000_select_rtx_section (mode, x)
@@ -7564,7 +7990,7 @@ rs6000_select_section (decl, reloc)
RELOC indicates whether the initial value of EXP requires
link-time relocations. If you do not define this macro, GCC will use
the symbol name prefixed by `.' as the section name. Note - this
- macro can now be called for unitialised data items as well as
+ macro can now be called for uninitialized data items as well as
initialised data and functions. */
void
@@ -7572,9 +7998,6 @@ rs6000_unique_section (decl, reloc)
tree decl;
int reloc;
{
- int size = int_size_in_bytes (TREE_TYPE (decl));
- int needs_sdata;
- int readonly;
int len;
int sec;
const char *name;
@@ -7583,40 +8006,54 @@ rs6000_unique_section (decl, reloc)
static const char *const prefixes[7][2] =
{
- { ".text.", ".gnu.linkonce.t." },
{ ".rodata.", ".gnu.linkonce.r." },
{ ".sdata2.", ".gnu.linkonce.s2." },
{ ".data.", ".gnu.linkonce.d." },
{ ".sdata.", ".gnu.linkonce.s." },
{ ".bss.", ".gnu.linkonce.b." },
- { ".sbss.", ".gnu.linkonce.sb." }
+ { ".sbss.", ".gnu.linkonce.sb." },
+ { ".text.", ".gnu.linkonce.t." }
};
-
- needs_sdata = (TREE_CODE (decl) != FUNCTION_DECL
- && size > 0
- && size <= g_switch_value
- && rs6000_sdata != SDATA_NONE
- && (rs6000_sdata != SDATA_DATA || TREE_PUBLIC (decl)));
- if (TREE_CODE (decl) == STRING_CST)
- readonly = ! flag_writable_strings;
- else if (TREE_CODE (decl) == VAR_DECL)
- readonly = (! (flag_pic && reloc)
- && TREE_READONLY (decl)
- && ! TREE_SIDE_EFFECTS (decl)
- && DECL_INITIAL (decl)
- && DECL_INITIAL (decl) != error_mark_node
- && TREE_CONSTANT (DECL_INITIAL (decl)));
+ if (TREE_CODE (decl) == FUNCTION_DECL)
+ sec = 6;
else
- readonly = 1;
- if (needs_sdata && rs6000_sdata != SDATA_EABI)
- readonly = 0;
+ {
+ int readonly;
+ int needs_sdata;
+ int size;
+
+ readonly = 1;
+ if (TREE_CODE (decl) == STRING_CST)
+ readonly = ! flag_writable_strings;
+ else if (TREE_CODE (decl) == VAR_DECL)
+ readonly = (! (flag_pic && reloc)
+ && TREE_READONLY (decl)
+ && ! TREE_SIDE_EFFECTS (decl)
+ && TREE_CONSTANT (DECL_INITIAL (decl)));
+
+ size = int_size_in_bytes (TREE_TYPE (decl));
+ needs_sdata = (size > 0
+ && size <= g_switch_value
+ && rs6000_sdata != SDATA_NONE
+ && (rs6000_sdata != SDATA_DATA || TREE_PUBLIC (decl)));
+
+ if (DECL_INITIAL (decl) == 0
+ || DECL_INITIAL (decl) == error_mark_node)
+ sec = 4;
+ else if (! readonly)
+ sec = 2;
+ else
+ sec = 0;
- sec = ((TREE_CODE (decl) == FUNCTION_DECL ? 0 : 1)
- + (readonly ? 0 : 2)
- + (needs_sdata ? 1 : 0)
- + (DECL_INITIAL (decl) == 0
- || DECL_INITIAL (decl) == error_mark_node) ? 4 : 0);
+ if (needs_sdata)
+ {
+ /* .sdata2 is only for EABI. */
+ if (sec == 0 && rs6000_sdata != SDATA_EABI)
+ sec = 2;
+ sec += 1;
+ }
+ }
STRIP_NAME_ENCODING (name, IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)));
prefix = prefixes[sec][DECL_ONE_ONLY (decl)];
@@ -7706,7 +8143,7 @@ rs6000_encode_section_info (decl)
}
}
-#endif /* USING_SVR4_H */
+#endif /* USING_ELFOS_H */
/* Return a REG that occurs in ADDR with coefficient 1.
diff --git a/gcc/config/rs6000/rs6000.h b/gcc/config/rs6000/rs6000.h
index fc70c506c3a..f9f8c63494d 100644
--- a/gcc/config/rs6000/rs6000.h
+++ b/gcc/config/rs6000/rs6000.h
@@ -1044,7 +1044,7 @@ enum reg_class
`K' is a constant with only the low-order 16 bits non-zero
`L' is a signed 16-bit constant shifted left 16 bits
`M' is a constant that is greater than 31
- `N' is a constant that is an exact power of two
+ `N' is a positive constant that is an exact power of two
`O' is the constant zero
`P' is a constant whose negation is a signed 16-bit constant */
@@ -1055,7 +1055,7 @@ enum reg_class
: (C) == 'L' ? (((VALUE) & 0xffff) == 0 \
&& ((VALUE) >> 31 == -1 || (VALUE) >> 31 == 0)) \
: (C) == 'M' ? (VALUE) > 31 \
- : (C) == 'N' ? exact_log2 (VALUE) >= 0 \
+ : (C) == 'N' ? (VALUE) > 0 && exact_log2 (VALUE) >= 0 \
: (C) == 'O' ? (VALUE) == 0 \
: (C) == 'P' ? (unsigned HOST_WIDE_INT) ((- (VALUE)) + 0x8000) < 0x10000 \
: 0)
@@ -1180,6 +1180,7 @@ typedef struct rs6000_stack {
int cr_save_offset; /* offset to save CR from initial SP */
int toc_save_offset; /* offset to save the TOC pointer */
int varargs_save_offset; /* offset to save the varargs registers */
+ int ehrd_offset; /* offset to EH return data */
int reg_size; /* register size (4 or 8) */
int varargs_size; /* size to hold V.4 args passed in regs */
int vars_size; /* variable save area size */
@@ -1422,9 +1423,8 @@ typedef struct rs6000_args
/* Define intermediate macro to compute the size (in registers) of an argument
for the RS/6000. */
-#define RS6000_ARG_SIZE(MODE, TYPE, NAMED) \
-(! (NAMED) ? 0 \
- : (MODE) != BLKmode \
+#define RS6000_ARG_SIZE(MODE, TYPE) \
+((MODE) != BLKmode \
? (GET_MODE_SIZE (MODE) + (UNITS_PER_WORD - 1)) / UNITS_PER_WORD \
: ((unsigned HOST_WIDE_INT) int_size_in_bytes (TYPE) \
+ (UNITS_PER_WORD - 1)) / UNITS_PER_WORD)
@@ -1540,6 +1540,10 @@ typedef struct rs6000_args
#define EXPAND_BUILTIN_VA_ARG(valist, type) \
rs6000_va_arg (valist, type)
+/* 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. */
+#define STRICT_ARGUMENT_NAMING 1
+
/* This macro generates the assembly code for function entry.
FILE is a stdio stream to output the code to.
SIZE is an int: how many units of temporary storage to allocate.
@@ -1569,8 +1573,11 @@ typedef struct rs6000_args
and frame pointer registers are already be assumed to be used as
needed. */
-#define EPILOGUE_USES(REGNO) \
- (reload_completed && (REGNO) == LINK_REGISTER_REGNUM)
+#define EPILOGUE_USES(REGNO) \
+ ((reload_completed && (REGNO) == LINK_REGISTER_REGNUM) \
+ || (current_function_calls_eh_return \
+ && TARGET_AIX \
+ && (REGNO) == TOC_REGISTER))
/* This macro generates the assembly code for function exit,
on machines that need it. If FUNCTION_EPILOGUE is not defined
@@ -1772,26 +1779,28 @@ typedef struct rs6000_args
After reload, it makes no difference, since pseudo regs have
been eliminated by then. */
-#ifndef REG_OK_STRICT
+#ifdef REG_OK_STRICT
+# define REG_OK_STRICT_FLAG 1
+#else
+# define REG_OK_STRICT_FLAG 0
+#endif
/* Nonzero if X is a hard reg that can be used as an index
- or if it is a pseudo reg. */
-#define REG_OK_FOR_INDEX_P(X) \
- (REGNO (X) <= 31 || REGNO (X) == 67 || REGNO (X) >= FIRST_PSEUDO_REGISTER)
+ or if it is a pseudo reg in the non-strict case. */
+#define INT_REG_OK_FOR_INDEX_P(X, STRICT) \
+ ((! (STRICT) \
+ && (REGNO (X) <= 31 \
+ || REGNO (X) == ARG_POINTER_REGNUM \
+ || REGNO (X) >= FIRST_PSEUDO_REGISTER)) \
+ || ((STRICT) && REGNO_OK_FOR_INDEX_P (REGNO (X))))
/* Nonzero if X is a hard reg that can be used as a base reg
- or if it is a pseudo reg. */
-#define REG_OK_FOR_BASE_P(X) \
- (REGNO (X) > 0 && REG_OK_FOR_INDEX_P (X))
-
-#else
+ or if it is a pseudo reg in the non-strict case. */
+#define INT_REG_OK_FOR_BASE_P(X, STRICT) \
+ (REGNO (X) > 0 && INT_REG_OK_FOR_INDEX_P (X, (STRICT)))
-/* Nonzero if X is a hard reg that can be used as an index. */
-#define REG_OK_FOR_INDEX_P(X) REGNO_OK_FOR_INDEX_P (REGNO (X))
-/* Nonzero if X is a hard reg that can be used as a base reg. */
-#define REG_OK_FOR_BASE_P(X) REGNO_OK_FOR_BASE_P (REGNO (X))
-
-#endif
+#define REG_OK_FOR_INDEX_P(X) INT_REG_OK_FOR_INDEX_P (X, REG_OK_STRICT_FLAG)
+#define REG_OK_FOR_BASE_P(X) INT_REG_OK_FOR_BASE_P (X, REG_OK_STRICT_FLAG)
/* GO_IF_LEGITIMATE_ADDRESS recognizes an RTL expression
that is a valid memory address for an instruction.
@@ -1828,68 +1837,51 @@ typedef struct rs6000_args
&& (GET_CODE (X) == SYMBOL_REF || GET_CODE (X) == CONST) \
&& small_data_operand (X, MODE))
-#define LEGITIMATE_ADDRESS_INTEGER_P(X,OFFSET) \
+#define LEGITIMATE_ADDRESS_INTEGER_P(X, OFFSET) \
(GET_CODE (X) == CONST_INT \
&& (unsigned HOST_WIDE_INT) (INTVAL (X) + (OFFSET) + 0x8000) < 0x10000)
-#define LEGITIMATE_OFFSET_ADDRESS_P(MODE,X) \
- (GET_CODE (X) == PLUS \
- && GET_CODE (XEXP (X, 0)) == REG \
- && REG_OK_FOR_BASE_P (XEXP (X, 0)) \
- && LEGITIMATE_ADDRESS_INTEGER_P (XEXP (X, 1), 0) \
- && (((MODE) != DFmode && (MODE) != DImode) \
- || (TARGET_32BIT \
- ? LEGITIMATE_ADDRESS_INTEGER_P (XEXP (X, 1), 4) \
- : ! (INTVAL (XEXP (X, 1)) & 3))) \
- && ((MODE) != TImode \
- || (TARGET_32BIT \
- ? LEGITIMATE_ADDRESS_INTEGER_P (XEXP (X, 1), 12) \
- : (LEGITIMATE_ADDRESS_INTEGER_P (XEXP (X, 1), 8) \
+#define LEGITIMATE_OFFSET_ADDRESS_P(MODE, X, STRICT) \
+ (GET_CODE (X) == PLUS \
+ && GET_CODE (XEXP (X, 0)) == REG \
+ && INT_REG_OK_FOR_BASE_P (XEXP (X, 0), (STRICT)) \
+ && LEGITIMATE_ADDRESS_INTEGER_P (XEXP (X, 1), 0) \
+ && (((MODE) != DFmode && (MODE) != DImode) \
+ || (TARGET_32BIT \
+ ? LEGITIMATE_ADDRESS_INTEGER_P (XEXP (X, 1), 4) \
+ : ! (INTVAL (XEXP (X, 1)) & 3))) \
+ && ((MODE) != TImode \
+ || (TARGET_32BIT \
+ ? LEGITIMATE_ADDRESS_INTEGER_P (XEXP (X, 1), 12) \
+ : (LEGITIMATE_ADDRESS_INTEGER_P (XEXP (X, 1), 8) \
&& ! (INTVAL (XEXP (X, 1)) & 3)))))
-#define LEGITIMATE_INDEXED_ADDRESS_P(X) \
- (GET_CODE (X) == PLUS \
- && GET_CODE (XEXP (X, 0)) == REG \
- && GET_CODE (XEXP (X, 1)) == REG \
- && ((REG_OK_FOR_BASE_P (XEXP (X, 0)) \
- && REG_OK_FOR_INDEX_P (XEXP (X, 1))) \
- || (REG_OK_FOR_BASE_P (XEXP (X, 1)) \
- && REG_OK_FOR_INDEX_P (XEXP (X, 0)))))
-
-#define LEGITIMATE_INDIRECT_ADDRESS_P(X) \
- (GET_CODE (X) == REG && REG_OK_FOR_BASE_P (X))
-
-#define LEGITIMATE_LO_SUM_ADDRESS_P(MODE, X) \
- (TARGET_ELF \
- && ! flag_pic && ! TARGET_TOC \
- && (MODE) != DImode \
- && (MODE) != TImode \
- && (TARGET_HARD_FLOAT || (MODE) != DFmode) \
- && GET_CODE (X) == LO_SUM \
- && GET_CODE (XEXP (X, 0)) == REG \
- && REG_OK_FOR_BASE_P (XEXP (X, 0)) \
+#define LEGITIMATE_INDEXED_ADDRESS_P(X, STRICT) \
+ (GET_CODE (X) == PLUS \
+ && GET_CODE (XEXP (X, 0)) == REG \
+ && GET_CODE (XEXP (X, 1)) == REG \
+ && ((INT_REG_OK_FOR_BASE_P (XEXP (X, 0), (STRICT)) \
+ && INT_REG_OK_FOR_INDEX_P (XEXP (X, 1), (STRICT))) \
+ || (INT_REG_OK_FOR_BASE_P (XEXP (X, 1), (STRICT)) \
+ && INT_REG_OK_FOR_INDEX_P (XEXP (X, 0), (STRICT)))))
+
+#define LEGITIMATE_INDIRECT_ADDRESS_P(X, STRICT) \
+ (GET_CODE (X) == REG && INT_REG_OK_FOR_BASE_P (X, (STRICT)))
+
+#define LEGITIMATE_LO_SUM_ADDRESS_P(MODE, X, STRICT) \
+ (TARGET_ELF \
+ && ! flag_pic && ! TARGET_TOC \
+ && (MODE) != DImode \
+ && (MODE) != TImode \
+ && (TARGET_HARD_FLOAT || (MODE) != DFmode) \
+ && GET_CODE (X) == LO_SUM \
+ && GET_CODE (XEXP (X, 0)) == REG \
+ && INT_REG_OK_FOR_BASE_P (XEXP (X, 0), (STRICT)) \
&& CONSTANT_P (XEXP (X, 1)))
-#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR) \
-{ if (LEGITIMATE_INDIRECT_ADDRESS_P (X)) \
- goto ADDR; \
- if ((GET_CODE (X) == PRE_INC || GET_CODE (X) == PRE_DEC) \
- && TARGET_UPDATE \
- && LEGITIMATE_INDIRECT_ADDRESS_P (XEXP (X, 0))) \
- goto ADDR; \
- if (LEGITIMATE_SMALL_DATA_P (MODE, X)) \
- goto ADDR; \
- if (LEGITIMATE_CONSTANT_POOL_ADDRESS_P (X)) \
- goto ADDR; \
- if (LEGITIMATE_OFFSET_ADDRESS_P (MODE, X)) \
- goto ADDR; \
- if ((MODE) != TImode \
- && (TARGET_HARD_FLOAT || TARGET_POWERPC64 || (MODE) != DFmode) \
- && (TARGET_POWERPC64 || (MODE) != DImode) \
- && LEGITIMATE_INDEXED_ADDRESS_P (X)) \
- goto ADDR; \
- if (LEGITIMATE_LO_SUM_ADDRESS_P (MODE, X)) \
- goto ADDR; \
+#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR) \
+{ if (rs6000_legitimate_address (MODE, X, REG_OK_STRICT_FLAG)) \
+ goto ADDR; \
}
/* Try machine-dependent ways of modifying an illegitimate address
@@ -2316,12 +2308,6 @@ extern int rs6000_compare_fp_p;
#define TARGET_MEM_FUNCTIONS
-/* Define the name of the section to use for the exception tables.
- TODO: test and see if we can use read_only_data_section, if so,
- remove this. */
-
-#define EXCEPTION_SECTION data_section
-
/* Flag to say the TOC is initialized */
extern int toc_initialized;
@@ -2641,6 +2627,10 @@ do { \
#define INCOMING_RETURN_ADDR_RTX gen_rtx_REG (Pmode, LINK_REGISTER_REGNUM)
#define DWARF_FRAME_RETURN_COLUMN DWARF_FRAME_REGNUM (LINK_REGISTER_REGNUM)
+/* Describe how we implement __builtin_eh_return. */
+#define EH_RETURN_DATA_REGNO(N) ((N) < 4 ? (N) + 3 : INVALID_REGNUM)
+#define EH_RETURN_STACKADJ_RTX gen_rtx_REG (Pmode, 10)
+
/* Define results of standard character escape sequences. */
#define TARGET_BELL 007
#define TARGET_BS 010
@@ -2679,10 +2669,14 @@ do { \
{"reg_or_u_short_operand", {SUBREG, REG, CONST_INT}}, \
{"reg_or_cint_operand", {SUBREG, REG, CONST_INT}}, \
{"reg_or_arith_cint_operand", {SUBREG, REG, CONST_INT}}, \
+ {"reg_or_add_cint64_operand", {SUBREG, REG, CONST_INT}}, \
+ {"reg_or_sub_cint64_operand", {SUBREG, REG, CONST_INT}}, \
{"reg_or_logical_cint_operand", {SUBREG, REG, CONST_INT, CONST_DOUBLE}}, \
+ {"scc_eq_operand", {SUBREG, REG, CONST_INT, CONST_DOUBLE}}, \
{"got_operand", {SYMBOL_REF, CONST, LABEL_REF}}, \
{"got_no_const_operand", {SYMBOL_REF, LABEL_REF}}, \
{"easy_fp_constant", {CONST_DOUBLE}}, \
+ {"zero_fp_constant", {CONST_DOUBLE}}, \
{"reg_or_mem_operand", {SUBREG, MEM, REG}}, \
{"lwa_operand", {SUBREG, MEM, REG}}, \
{"volatile_mem_operand", {MEM}}, \
@@ -2696,7 +2690,6 @@ do { \
{"non_logical_cint_operand", {CONST_INT, CONST_DOUBLE}}, \
{"mask_operand", {CONST_INT}}, \
{"mask64_operand", {CONST_INT, CONST_DOUBLE}}, \
- {"rldic_operand", {CONST_INT, CONST_DOUBLE}}, \
{"count_register_operand", {REG}}, \
{"xer_operand", {REG}}, \
{"call_operand", {SYMBOL_REF, REG}}, \
@@ -2718,7 +2711,8 @@ do { \
{"trap_comparison_operator", {EQ, NE, LE, LT, GE, \
GT, LEU, LTU, GEU, GTU}}, \
{"boolean_operator", {AND, IOR, XOR}}, \
- {"boolean_or_operator", {IOR, XOR}},
+ {"boolean_or_operator", {IOR, XOR}}, \
+ {"min_max_operator", {SMIN, SMAX, UMIN, UMAX}},
/* uncomment for disabling the corresponding default options */
/* #define MACHINE_no_sched_interblock */
diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md
index 9df70cf3eaf..8c51a129b98 100644
--- a/gcc/config/rs6000/rs6000.md
+++ b/gcc/config/rs6000/rs6000.md
@@ -1422,16 +1422,14 @@
rtx tmp = ((no_new_pseudos || rtx_equal_p (operands[0], operands[1]))
? operands[0] : gen_reg_rtx (SImode));
- HOST_WIDE_INT low = INTVAL (operands[2]) & 0xffff;
- HOST_WIDE_INT high = INTVAL (operands[2]) & (~ (HOST_WIDE_INT) 0xffff);
-
- if (low & 0x8000)
- high += 0x10000, low |= ((HOST_WIDE_INT) -1) << 16;
+ HOST_WIDE_INT val = INTVAL (operands[2]);
+ HOST_WIDE_INT low = (val & 0xffff) - 2 * (val & 0x8000);
+ HOST_WIDE_INT rest = trunc_int_for_mode (val - low, SImode);
/* The ordering here is important for the prolog expander.
When space is allocated from the stack, adding 'low' first may
produce a temporary deallocation (which would be bad). */
- emit_insn (gen_addsi3 (tmp, operands[1], GEN_INT (high)));
+ emit_insn (gen_addsi3 (tmp, operands[1], GEN_INT (rest)));
emit_insn (gen_addsi3 (operands[0], tmp, GEN_INT (low)));
DONE;
}
@@ -1525,13 +1523,11 @@
(set (match_dup 0) (plus:SI (match_dup 0) (match_dup 4)))]
"
{
- HOST_WIDE_INT low = INTVAL (operands[2]) & 0xffff;
- HOST_WIDE_INT high = INTVAL (operands[2]) & (~ (HOST_WIDE_INT) 0xffff);
-
- if (low & 0x8000)
- high += 0x10000, low |= ((HOST_WIDE_INT) -1) << 16;
+ HOST_WIDE_INT val = INTVAL (operands[2]);
+ HOST_WIDE_INT low = (val & 0xffff) - 2 * (val & 0x8000);
+ HOST_WIDE_INT rest = trunc_int_for_mode (val - low, SImode);
- operands[3] = GEN_INT (high);
+ operands[3] = GEN_INT (rest);
operands[4] = GEN_INT (low);
}")
@@ -2263,6 +2259,7 @@
"
{
if (GET_CODE (operands[2]) == CONST_INT
+ && INTVAL (operands[2]) > 0
&& exact_log2 (INTVAL (operands[2])) >= 0)
;
else if (TARGET_POWERPC)
@@ -2314,12 +2311,9 @@
rtx temp1;
rtx temp2;
- if (GET_CODE (operands[2]) != CONST_INT)
- FAIL;
-
- i = exact_log2 (INTVAL (operands[2]));
-
- if (i < 0)
+ if (GET_CODE (operands[2]) != CONST_INT
+ || INTVAL (operands[2]) < 0
+ || (i = exact_log2 (INTVAL (operands[2]))) < 0)
FAIL;
temp1 = gen_reg_rtx (SImode);
@@ -2335,7 +2329,7 @@
[(set (match_operand:SI 0 "gpc_reg_operand" "=r")
(div:SI (match_operand:SI 1 "gpc_reg_operand" "r")
(match_operand:SI 2 "const_int_operand" "N")))]
- "exact_log2 (INTVAL (operands[2])) >= 0"
+ "INTVAL (operands[2]) > 0 && exact_log2 (INTVAL (operands[2])) >= 0"
"{srai|srawi} %0,%1,%p2\;{aze|addze} %0,%0"
[(set_attr "length" "8")])
@@ -2345,7 +2339,7 @@
(match_operand:SI 2 "const_int_operand" "N,N"))
(const_int 0)))
(clobber (match_scratch:SI 3 "=r,r"))]
- "exact_log2 (INTVAL (operands[2])) >= 0"
+ "INTVAL (operands[2]) > 0 && exact_log2 (INTVAL (operands[2])) >= 0"
"@
{srai|srawi} %3,%1,%p2\;{aze.|addze.} %3,%3
#"
@@ -2358,7 +2352,8 @@
(match_operand:SI 2 "const_int_operand" ""))
(const_int 0)))
(clobber (match_scratch:SI 3 ""))]
- "exact_log2 (INTVAL (operands[2])) >= 0 && reload_completed"
+ "INTVAL (operands[2]) > 0 && exact_log2 (INTVAL (operands[2])) >= 0
+ && reload_completed"
[(set (match_dup 3)
(div:SI (match_dup 1) (match_dup 2)))
(set (match_dup 0)
@@ -2373,7 +2368,7 @@
(const_int 0)))
(set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
(div:SI (match_dup 1) (match_dup 2)))]
- "exact_log2 (INTVAL (operands[2])) >= 0"
+ "INTVAL (operands[2]) > 0 && exact_log2 (INTVAL (operands[2])) >= 0"
"@
{srai|srawi} %0,%1,%p2\;{aze.|addze.} %0,%0
#"
@@ -2387,7 +2382,8 @@
(const_int 0)))
(set (match_operand:SI 0 "gpc_reg_operand" "")
(div:SI (match_dup 1) (match_dup 2)))]
- "exact_log2 (INTVAL (operands[2])) >= 0 && reload_completed"
+ "INTVAL (operands[2]) > 0 && exact_log2 (INTVAL (operands[2])) >= 0
+ && reload_completed"
[(set (match_dup 0)
(div:SI (match_dup 1) (match_dup 2)))
(set (match_dup 3)
@@ -4808,60 +4804,35 @@
;; single DEFINE_INSN for fsel and the define_splits to make them if made by
;; combine.
(define_expand "maxsf3"
- [(set (match_dup 3)
- (minus:SF (match_operand:SF 1 "gpc_reg_operand" "")
- (match_operand:SF 2 "gpc_reg_operand" "")))
- (set (match_operand:SF 0 "gpc_reg_operand" "")
- (if_then_else:SF (ge (match_dup 3)
- (const_int 0))
- (match_dup 1)
- (match_dup 2)))]
- "TARGET_PPC_GFXOPT && TARGET_HARD_FLOAT"
- "
-{ operands[3] = gen_reg_rtx (SFmode); }")
-
-(define_split
[(set (match_operand:SF 0 "gpc_reg_operand" "")
- (smax:SF (match_operand:SF 1 "gpc_reg_operand" "")
- (match_operand:SF 2 "gpc_reg_operand" "")))
- (clobber (match_operand:SF 3 "gpc_reg_operand" ""))]
- "TARGET_PPC_GFXOPT && TARGET_HARD_FLOAT"
- [(set (match_dup 3)
- (minus:SF (match_dup 1) (match_dup 2)))
- (set (match_dup 0)
- (if_then_else:SF (ge (match_dup 3)
- (const_int 0))
+ (if_then_else:SF (ge (match_operand:SF 1 "gpc_reg_operand" "")
+ (match_operand:SF 2 "gpc_reg_operand" ""))
(match_dup 1)
(match_dup 2)))]
- "")
+ "TARGET_PPC_GFXOPT && TARGET_HARD_FLOAT"
+ "{ rs6000_emit_minmax (operands[0], SMAX, operands[1], operands[2]); DONE;}")
(define_expand "minsf3"
- [(set (match_dup 3)
- (minus:SF (match_operand:SF 2 "gpc_reg_operand" "")
- (match_operand:SF 1 "gpc_reg_operand" "")))
- (set (match_operand:SF 0 "gpc_reg_operand" "")
- (if_then_else:SF (ge (match_dup 3)
- (const_int 0))
- (match_dup 1)
- (match_dup 2)))]
+ [(set (match_operand:SF 0 "gpc_reg_operand" "")
+ (if_then_else:SF (ge (match_operand:SF 1 "gpc_reg_operand" "")
+ (match_operand:SF 2 "gpc_reg_operand" ""))
+ (match_dup 2)
+ (match_dup 1)))]
"TARGET_PPC_GFXOPT && TARGET_HARD_FLOAT"
- "
-{ operands[3] = gen_reg_rtx (SFmode); }")
+ "{ rs6000_emit_minmax (operands[0], SMIN, operands[1], operands[2]); DONE;}")
(define_split
[(set (match_operand:SF 0 "gpc_reg_operand" "")
- (smin:SF (match_operand:SF 1 "gpc_reg_operand" "")
- (match_operand:SF 2 "gpc_reg_operand" "")))
- (clobber (match_operand:SF 3 "gpc_reg_operand" ""))]
+ (match_operator:SF 3 "min_max_operator"
+ [(match_operand:SF 1 "gpc_reg_operand" "")
+ (match_operand:SF 2 "gpc_reg_operand" "")]))]
"TARGET_PPC_GFXOPT && TARGET_HARD_FLOAT"
- [(set (match_dup 3)
- (minus:SF (match_dup 2) (match_dup 1)))
- (set (match_dup 0)
- (if_then_else:SF (ge (match_dup 3)
- (const_int 0))
- (match_dup 1)
- (match_dup 2)))]
- "")
+ [(const_int 0)]
+ "
+{ rs6000_emit_minmax (operands[0], GET_CODE (operands[3]),
+ operands[1], operands[2]);
+ DONE;
+}")
(define_expand "movsfcc"
[(set (match_operand:SF 0 "gpc_reg_operand" "")
@@ -4871,82 +4842,26 @@
"TARGET_PPC_GFXOPT && TARGET_HARD_FLOAT"
"
{
- rtx temp, op0, op1;
- enum rtx_code code = GET_CODE (operands[1]);
- if (! rs6000_compare_fp_p)
- FAIL;
- switch (code)
- {
- case GE: case EQ: case NE:
- op0 = rs6000_compare_op0;
- op1 = rs6000_compare_op1;
- break;
- case GT:
- op0 = rs6000_compare_op1;
- op1 = rs6000_compare_op0;
- temp = operands[2]; operands[2] = operands[3]; operands[3] = temp;
- break;
- case LE:
- op0 = rs6000_compare_op1;
- op1 = rs6000_compare_op0;
- break;
- case LT:
- op0 = rs6000_compare_op0;
- op1 = rs6000_compare_op1;
- temp = operands[2]; operands[2] = operands[3]; operands[3] = temp;
- break;
- default:
- FAIL;
- }
- if (GET_MODE (rs6000_compare_op0) == DFmode)
- {
- temp = gen_reg_rtx (DFmode);
- emit_insn (gen_subdf3 (temp, op0, op1));
- emit_insn (gen_fseldfsf4 (operands[0], temp, operands[2], operands[3]));
- if (code == EQ)
- {
- emit_insn (gen_negdf2 (temp, temp));
- emit_insn (gen_fseldfsf4 (operands[0], temp, operands[0], operands[3]));
- }
- else if (code == NE)
- {
- emit_insn (gen_negdf2 (temp, temp));
- emit_insn (gen_fseldfsf4 (operands[0], temp, operands[3], operands[0]));
- }
- }
+ if (rs6000_emit_cmove (operands[0], operands[1], operands[2], operands[3]))
+ DONE;
else
- {
- temp = gen_reg_rtx (SFmode);
- emit_insn (gen_subsf3 (temp, op0, op1));
- emit_insn (gen_fselsfsf4 (operands[0], temp, operands[2], operands[3]));
- if (code == EQ)
- {
- emit_insn (gen_negsf2 (temp, temp));
- emit_insn (gen_fselsfsf4 (operands[0], temp, operands[0], operands[3]));
- }
- else if (code == NE)
- {
- emit_insn (gen_negsf2 (temp, temp));
- emit_insn (gen_fselsfsf4 (operands[0], temp, operands[3], operands[0]));
- }
- }
- DONE;
+ FAIL;
}")
-(define_insn "fselsfsf4"
+(define_insn "*fselsfsf4"
[(set (match_operand:SF 0 "gpc_reg_operand" "=f")
(if_then_else:SF (ge (match_operand:SF 1 "gpc_reg_operand" "f")
- (const_int 0))
+ (match_operand:SF 4 "zero_fp_constant" "F"))
(match_operand:SF 2 "gpc_reg_operand" "f")
(match_operand:SF 3 "gpc_reg_operand" "f")))]
"TARGET_PPC_GFXOPT && TARGET_HARD_FLOAT"
"fsel %0,%1,%2,%3"
[(set_attr "type" "fp")])
-(define_insn "fseldfsf4"
+(define_insn "*fseldfsf4"
[(set (match_operand:SF 0 "gpc_reg_operand" "=f")
(if_then_else:SF (ge (match_operand:DF 1 "gpc_reg_operand" "f")
- (const_int 0))
+ (match_operand:DF 4 "zero_fp_constant" "F"))
(match_operand:SF 2 "gpc_reg_operand" "f")
(match_operand:SF 3 "gpc_reg_operand" "f")))]
"TARGET_PPC_GFXOPT && TARGET_HARD_FLOAT"
@@ -5049,66 +4964,39 @@
"fsqrt %0,%1"
[(set_attr "type" "dsqrt")])
-;; For MIN, MAX, and conditional move, we use DEFINE_EXPAND's that involve a
-;; fsel instruction and some auxiliary computations. Then we just have a
-;; single DEFINE_INSN for fsel and the define_splits to make them if made by
-;; combine.
+;; The conditional move instructions allow us to perform max and min
+;; operations even when
(define_expand "maxdf3"
- [(set (match_dup 3)
- (minus:DF (match_operand:DF 1 "gpc_reg_operand" "")
- (match_operand:DF 2 "gpc_reg_operand" "")))
- (set (match_operand:DF 0 "gpc_reg_operand" "")
- (if_then_else:DF (ge (match_dup 3)
- (const_int 0))
- (match_dup 1)
- (match_dup 2)))]
- "TARGET_PPC_GFXOPT && TARGET_HARD_FLOAT"
- "
-{ operands[3] = gen_reg_rtx (DFmode); }")
-
-(define_split
[(set (match_operand:DF 0 "gpc_reg_operand" "")
- (smax:DF (match_operand:DF 1 "gpc_reg_operand" "")
- (match_operand:DF 2 "gpc_reg_operand" "")))
- (clobber (match_operand:DF 3 "gpc_reg_operand" ""))]
- "TARGET_PPC_GFXOPT && TARGET_HARD_FLOAT"
- [(set (match_dup 3)
- (minus:DF (match_dup 1) (match_dup 2)))
- (set (match_dup 0)
- (if_then_else:DF (ge (match_dup 3)
- (const_int 0))
+ (if_then_else:DF (ge (match_operand:DF 1 "gpc_reg_operand" "")
+ (match_operand:DF 2 "gpc_reg_operand" ""))
(match_dup 1)
(match_dup 2)))]
- "")
+ "TARGET_PPC_GFXOPT && TARGET_HARD_FLOAT"
+ "{ rs6000_emit_minmax (operands[0], SMAX, operands[1], operands[2]); DONE;}")
(define_expand "mindf3"
- [(set (match_dup 3)
- (minus:DF (match_operand:DF 2 "gpc_reg_operand" "")
- (match_operand:DF 1 "gpc_reg_operand" "")))
- (set (match_operand:DF 0 "gpc_reg_operand" "")
- (if_then_else:DF (ge (match_dup 3)
- (const_int 0))
- (match_dup 1)
- (match_dup 2)))]
+ [(set (match_operand:DF 0 "gpc_reg_operand" "")
+ (if_then_else:DF (ge (match_operand:DF 1 "gpc_reg_operand" "")
+ (match_operand:DF 2 "gpc_reg_operand" ""))
+ (match_dup 2)
+ (match_dup 1)))]
"TARGET_PPC_GFXOPT && TARGET_HARD_FLOAT"
- "
-{ operands[3] = gen_reg_rtx (DFmode); }")
+ "{ rs6000_emit_minmax (operands[0], SMIN, operands[1], operands[2]); DONE;}")
(define_split
[(set (match_operand:DF 0 "gpc_reg_operand" "")
- (smin:DF (match_operand:DF 1 "gpc_reg_operand" "")
- (match_operand:DF 2 "gpc_reg_operand" "")))
- (clobber (match_operand:DF 3 "gpc_reg_operand" ""))]
+ (match_operator:DF 3 "min_max_operator"
+ [(match_operand:DF 1 "gpc_reg_operand" "")
+ (match_operand:DF 2 "gpc_reg_operand" "")]))]
"TARGET_PPC_GFXOPT && TARGET_HARD_FLOAT"
- [(set (match_dup 3)
- (minus:DF (match_dup 2) (match_dup 1)))
- (set (match_dup 0)
- (if_then_else:DF (ge (match_dup 3)
- (const_int 0))
- (match_dup 1)
- (match_dup 2)))]
- "")
+ [(const_int 0)]
+ "
+{ rs6000_emit_minmax (operands[0], GET_CODE (operands[3]),
+ operands[1], operands[2]);
+ DONE;
+}")
(define_expand "movdfcc"
[(set (match_operand:DF 0 "gpc_reg_operand" "")
@@ -5118,82 +5006,26 @@
"TARGET_PPC_GFXOPT && TARGET_HARD_FLOAT"
"
{
- rtx temp, op0, op1;
- enum rtx_code code = GET_CODE (operands[1]);
- if (! rs6000_compare_fp_p)
- FAIL;
- switch (code)
- {
- case GE: case EQ: case NE:
- op0 = rs6000_compare_op0;
- op1 = rs6000_compare_op1;
- break;
- case GT:
- op0 = rs6000_compare_op1;
- op1 = rs6000_compare_op0;
- temp = operands[2]; operands[2] = operands[3]; operands[3] = temp;
- break;
- case LE:
- op0 = rs6000_compare_op1;
- op1 = rs6000_compare_op0;
- break;
- case LT:
- op0 = rs6000_compare_op0;
- op1 = rs6000_compare_op1;
- temp = operands[2]; operands[2] = operands[3]; operands[3] = temp;
- break;
- default:
- FAIL;
- }
- if (GET_MODE (rs6000_compare_op0) == DFmode)
- {
- temp = gen_reg_rtx (DFmode);
- emit_insn (gen_subdf3 (temp, op0, op1));
- emit_insn (gen_fseldfdf4 (operands[0], temp, operands[2], operands[3]));
- if (code == EQ)
- {
- emit_insn (gen_negdf2 (temp, temp));
- emit_insn (gen_fseldfdf4 (operands[0], temp, operands[0], operands[3]));
- }
- else if (code == NE)
- {
- emit_insn (gen_negdf2 (temp, temp));
- emit_insn (gen_fseldfdf4 (operands[0], temp, operands[3], operands[0]));
- }
- }
+ if (rs6000_emit_cmove (operands[0], operands[1], operands[2], operands[3]))
+ DONE;
else
- {
- temp = gen_reg_rtx (SFmode);
- emit_insn (gen_subsf3 (temp, op0, op1));
- emit_insn (gen_fselsfdf4 (operands[0], temp, operands[2], operands[3]));
- if (code == EQ)
- {
- emit_insn (gen_negsf2 (temp, temp));
- emit_insn (gen_fselsfdf4 (operands[0], temp, operands[0], operands[3]));
- }
- else if (code == NE)
- {
- emit_insn (gen_negsf2 (temp, temp));
- emit_insn (gen_fselsfdf4 (operands[0], temp, operands[3], operands[0]));
- }
- }
- DONE;
+ FAIL;
}")
-(define_insn "fseldfdf4"
+(define_insn "*fseldfdf4"
[(set (match_operand:DF 0 "gpc_reg_operand" "=f")
(if_then_else:DF (ge (match_operand:DF 1 "gpc_reg_operand" "f")
- (const_int 0))
+ (match_operand:DF 4 "zero_fp_constant" "F"))
(match_operand:DF 2 "gpc_reg_operand" "f")
(match_operand:DF 3 "gpc_reg_operand" "f")))]
"TARGET_PPC_GFXOPT && TARGET_HARD_FLOAT"
"fsel %0,%1,%2,%3"
[(set_attr "type" "fp")])
-(define_insn "fselsfdf4"
+(define_insn "*fselsfdf4"
[(set (match_operand:DF 0 "gpc_reg_operand" "=f")
(if_then_else:DF (ge (match_operand:SF 1 "gpc_reg_operand" "f")
- (const_int 0))
+ (match_operand:SF 4 "zero_fp_constant" "F"))
(match_operand:DF 2 "gpc_reg_operand" "f")
(match_operand:DF 3 "gpc_reg_operand" "f")))]
"TARGET_PPC_GFXOPT"
@@ -5739,7 +5571,7 @@
(define_expand "adddi3"
[(set (match_operand:DI 0 "gpc_reg_operand" "")
(plus:DI (match_operand:DI 1 "gpc_reg_operand" "")
- (match_operand:DI 2 "reg_or_arith_cint_operand" "")))]
+ (match_operand:DI 2 "reg_or_add_cint64_operand" "")))]
""
"
{
@@ -5755,13 +5587,17 @@
rtx tmp = ((no_new_pseudos || rtx_equal_p (operands[0], operands[1]))
? operands[0] : gen_reg_rtx (DImode));
- HOST_WIDE_INT low = INTVAL (operands[2]) & 0xffff;
- HOST_WIDE_INT high = INTVAL (operands[2]) & (~ (HOST_WIDE_INT) 0xffff);
+ HOST_WIDE_INT val = INTVAL (operands[2]);
+ HOST_WIDE_INT low = (val & 0xffff) - 2 * (val & 0x8000);
+ HOST_WIDE_INT rest = trunc_int_for_mode (val - low, DImode);
- if (low & 0x8000)
- high += 0x10000, low |= ((HOST_WIDE_INT) -1) << 16;
+ if (!CONST_OK_FOR_LETTER_P (rest, 'L'))
+ FAIL;
- emit_insn (gen_adddi3 (tmp, operands[1], GEN_INT (high)));
+ /* The ordering here is important for the prolog expander.
+ When space is allocated from the stack, adding 'low' first may
+ produce a temporary deallocation (which would be bad). */
+ emit_insn (gen_adddi3 (tmp, operands[1], GEN_INT (rest)));
emit_insn (gen_adddi3 (operands[0], tmp, GEN_INT (low)));
DONE;
}
@@ -5854,14 +5690,22 @@
(set (match_dup 0) (plus:DI (match_dup 0) (match_dup 4)))]
"
{
- HOST_WIDE_INT low = INTVAL (operands[2]) & 0xffff;
- HOST_WIDE_INT high = INTVAL (operands[2]) & (~ (HOST_WIDE_INT) 0xffff);
+ HOST_WIDE_INT val = INTVAL (operands[2]);
+ HOST_WIDE_INT low = (val & 0xffff) - 2 * (val & 0x8000);
+ HOST_WIDE_INT rest = trunc_int_for_mode (val - low, DImode);
- if (low & 0x8000)
- high+=0x10000, low |= ((HOST_WIDE_INT) -1) << 16;
-
- operands[3] = GEN_INT (high);
operands[4] = GEN_INT (low);
+ if (CONST_OK_FOR_LETTER_P (rest, 'L'))
+ operands[3] = GEN_INT (rest);
+ else if (! no_new_pseudos)
+ {
+ operands[3] = gen_reg_rtx (DImode);
+ emit_move_insn (operands[3], operands[2]);
+ emit_insn (gen_adddi3 (operands[0], operands[1], operands[3]));
+ DONE;
+ }
+ else
+ FAIL;
}")
(define_insn "one_cmpldi2"
@@ -5990,7 +5834,7 @@
(define_expand "subdi3"
[(set (match_operand:DI 0 "gpc_reg_operand" "")
(minus:DI (match_operand:DI 1 "reg_or_short_operand" "")
- (match_operand:DI 2 "reg_or_arith_cint_operand" "")))]
+ (match_operand:DI 2 "reg_or_sub_cint64_operand" "")))]
""
"
{
@@ -6149,6 +5993,7 @@
"
{
if (GET_CODE (operands[2]) == CONST_INT
+ && INTVAL (operands[2]) > 0
&& exact_log2 (INTVAL (operands[2])) >= 0)
;
else
@@ -6162,11 +6007,13 @@
"TARGET_POWERPC64"
"
{
- int i = exact_log2 (INTVAL (operands[2]));
+ int i;
rtx temp1;
rtx temp2;
- if (GET_CODE (operands[2]) != CONST_INT || i < 0)
+ if (GET_CODE (operands[2]) != CONST_INT
+ || INTVAL (operands[2]) <= 0
+ || (i = exact_log2 (INTVAL (operands[2]))) < 0)
FAIL;
temp1 = gen_reg_rtx (DImode);
@@ -6182,7 +6029,8 @@
[(set (match_operand:DI 0 "gpc_reg_operand" "=r")
(div:DI (match_operand:DI 1 "gpc_reg_operand" "r")
(match_operand:DI 2 "const_int_operand" "N")))]
- "TARGET_POWERPC64 && exact_log2 (INTVAL (operands[2])) >= 0"
+ "TARGET_POWERPC64 && INTVAL (operands[2]) > 0
+ && exact_log2 (INTVAL (operands[2])) >= 0"
"sradi %0,%1,%p2\;addze %0,%0"
[(set_attr "length" "8")])
@@ -6192,7 +6040,8 @@
(match_operand:DI 2 "const_int_operand" "N,N"))
(const_int 0)))
(clobber (match_scratch:DI 3 "=r,r"))]
- "TARGET_POWERPC64 && exact_log2 (INTVAL (operands[2])) >= 0"
+ "TARGET_POWERPC64 && INTVAL (operands[2]) > 0
+ && exact_log2 (INTVAL (operands[2])) >= 0"
"@
sradi %3,%1,%p2\;addze. %3,%3
#"
@@ -6205,7 +6054,8 @@
(match_operand:DI 2 "const_int_operand" ""))
(const_int 0)))
(clobber (match_scratch:DI 3 ""))]
- "TARGET_POWERPC64 && exact_log2 (INTVAL (operands[2])) >= 0 && reload_completed"
+ "TARGET_POWERPC64 && INTVAL (operands[2]) > 0
+ && exact_log2 (INTVAL (operands[2])) >= 0 && reload_completed"
[(set (match_dup 3)
(div:DI (match_dup 1) (match_dup 2)))
(set (match_dup 0)
@@ -6220,7 +6070,8 @@
(const_int 0)))
(set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
(div:DI (match_dup 1) (match_dup 2)))]
- "TARGET_POWERPC64 && exact_log2 (INTVAL (operands[2])) >= 0"
+ "TARGET_POWERPC64 && INTVAL (operands[2]) > 0
+ && exact_log2 (INTVAL (operands[2])) >= 0"
"@
sradi %0,%1,%p2\;addze. %0,%0
#"
@@ -6234,7 +6085,8 @@
(const_int 0)))
(set (match_operand:DI 0 "gpc_reg_operand" "")
(div:DI (match_dup 1) (match_dup 2)))]
- "TARGET_POWERPC64 && exact_log2 (INTVAL (operands[2])) >= 0 && reload_completed"
+ "TARGET_POWERPC64 && INTVAL (operands[2]) > 0
+ && exact_log2 (INTVAL (operands[2])) >= 0 && reload_completed"
[(set (match_dup 0)
(div:DI (match_dup 1) (match_dup 2)))
(set (match_dup 3)
@@ -6706,8 +6558,8 @@
[(set (match_operand:DI 0 "gpc_reg_operand" "=r")
(and:DI (ashift:DI (match_operand:DI 1 "gpc_reg_operand" "r")
(match_operand:SI 2 "const_int_operand" "i"))
- (match_operand:DI 3 "rldic_operand" "n")))]
- "includes_lshift64_p (operands[2], operands[3])"
+ (match_operand:DI 3 "const_int_operand" "n")))]
+ "TARGET_POWERPC64 && includes_rldic_lshift_p (operands[2], operands[3])"
"rldic %0,%1,%H2,%W3")
(define_insn "ashldi3_internal5"
@@ -6715,10 +6567,10 @@
(compare:CC
(and:DI (ashift:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
(match_operand:SI 2 "const_int_operand" "i,i"))
- (match_operand:DI 3 "rldic_operand" "n,n"))
+ (match_operand:DI 3 "const_int_operand" "n,n"))
(const_int 0)))
(clobber (match_scratch:DI 4 "=r,r"))]
- "includes_lshift64_p (operands[2], operands[3])"
+ "TARGET_POWERPC64 && includes_rldic_lshift_p (operands[2], operands[3])"
"@
rldic. %4,%1,%H2,%W3
#"
@@ -6730,10 +6582,11 @@
(compare:CC
(and:DI (ashift:DI (match_operand:DI 1 "gpc_reg_operand" "")
(match_operand:SI 2 "const_int_operand" ""))
- (match_operand:DI 3 "rldic_operand" ""))
+ (match_operand:DI 3 "const_int_operand" ""))
(const_int 0)))
(clobber (match_scratch:DI 4 ""))]
- "includes_lshift64_p (operands[2], operands[3]) && reload_completed"
+ "TARGET_POWERPC64 && reload_completed
+ && includes_rldic_lshift_p (operands[2], operands[3])"
[(set (match_dup 4)
(and:DI (ashift:DI (match_dup 1) (match_dup 2))
(match_dup 3)))
@@ -6747,11 +6600,11 @@
(compare:CC
(and:DI (ashift:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
(match_operand:SI 2 "const_int_operand" "i,i"))
- (match_operand:DI 3 "rldic_operand" "n,n"))
+ (match_operand:DI 3 "const_int_operand" "n,n"))
(const_int 0)))
(set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
(and:DI (ashift:DI (match_dup 1) (match_dup 2)) (match_dup 3)))]
- "includes_lshift64_p (operands[2], operands[3])"
+ "TARGET_POWERPC64 && includes_rldic_lshift_p (operands[2], operands[3])"
"@
rldic. %0,%1,%H2,%W3
#"
@@ -6763,11 +6616,88 @@
(compare:CC
(and:DI (ashift:DI (match_operand:DI 1 "gpc_reg_operand" "")
(match_operand:SI 2 "const_int_operand" ""))
- (match_operand:DI 3 "rldic_operand" ""))
+ (match_operand:DI 3 "const_int_operand" ""))
(const_int 0)))
(set (match_operand:DI 0 "gpc_reg_operand" "")
(and:DI (ashift:DI (match_dup 1) (match_dup 2)) (match_dup 3)))]
- "includes_lshift64_p (operands[2], operands[3]) && reload_completed"
+ "TARGET_POWERPC64 && reload_completed
+ && includes_rldic_lshift_p (operands[2], operands[3])"
+ [(set (match_dup 0)
+ (and:DI (ashift:DI (match_dup 1) (match_dup 2))
+ (match_dup 3)))
+ (set (match_dup 4)
+ (compare:CC (match_dup 0)
+ (const_int 0)))]
+ "")
+
+(define_insn "*ashldi3_internal7"
+ [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
+ (and:DI (ashift:DI (match_operand:DI 1 "gpc_reg_operand" "r")
+ (match_operand:SI 2 "const_int_operand" "i"))
+ (match_operand:DI 3 "mask64_operand" "S")))]
+ "TARGET_POWERPC64 && includes_rldicr_lshift_p (operands[2], operands[3])"
+ "rldicr %0,%1,%H2,%S3")
+
+(define_insn "ashldi3_internal8"
+ [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
+ (compare:CC
+ (and:DI (ashift:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
+ (match_operand:SI 2 "const_int_operand" "i,i"))
+ (match_operand:DI 3 "mask64_operand" "S,S"))
+ (const_int 0)))
+ (clobber (match_scratch:DI 4 "=r,r"))]
+ "TARGET_POWERPC64 && includes_rldicr_lshift_p (operands[2], operands[3])"
+ "@
+ rldicr. %4,%1,%H2,%S3
+ #"
+ [(set_attr "type" "delayed_compare")
+ (set_attr "length" "4,8")])
+
+(define_split
+ [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
+ (compare:CC
+ (and:DI (ashift:DI (match_operand:DI 1 "gpc_reg_operand" "")
+ (match_operand:SI 2 "const_int_operand" ""))
+ (match_operand:DI 3 "mask64_operand" ""))
+ (const_int 0)))
+ (clobber (match_scratch:DI 4 ""))]
+ "TARGET_POWERPC64 && reload_completed
+ && includes_rldicr_lshift_p (operands[2], operands[3])"
+ [(set (match_dup 4)
+ (and:DI (ashift:DI (match_dup 1) (match_dup 2))
+ (match_dup 3)))
+ (set (match_dup 0)
+ (compare:CC (match_dup 4)
+ (const_int 0)))]
+ "")
+
+(define_insn "*ashldi3_internal9"
+ [(set (match_operand:CC 4 "cc_reg_operand" "=x,?y")
+ (compare:CC
+ (and:DI (ashift:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
+ (match_operand:SI 2 "const_int_operand" "i,i"))
+ (match_operand:DI 3 "mask64_operand" "S,S"))
+ (const_int 0)))
+ (set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
+ (and:DI (ashift:DI (match_dup 1) (match_dup 2)) (match_dup 3)))]
+ "TARGET_POWERPC64 && includes_rldicr_lshift_p (operands[2], operands[3])"
+ "@
+ rldicr. %0,%1,%H2,%S3
+ #"
+ [(set_attr "type" "delayed_compare")
+ (set_attr "length" "4,8")])
+
+(define_split
+ [(set (match_operand:CC 4 "cc_reg_not_cr0_operand" "")
+ (compare:CC
+ (and:DI (ashift:DI (match_operand:DI 1 "gpc_reg_operand" "")
+ (match_operand:SI 2 "const_int_operand" ""))
+ (match_operand:DI 3 "mask64_operand" ""))
+ (const_int 0)))
+ (set (match_operand:DI 0 "gpc_reg_operand" "")
+ (and:DI (ashift:DI (match_dup 1) (match_dup 2)) (match_dup 3)))]
+ "TARGET_POWERPC64 && reload_completed
+ && includes_rldicr_lshift_p (operands[2], operands[3])"
[(set (match_dup 0)
(and:DI (ashift:DI (match_dup 1) (match_dup 2))
(match_dup 3)))
@@ -9185,8 +9115,9 @@ operands[2] = GEN_INT (INTVAL (operands[1]) >> 32);
;; Code to initialize the TOC register...
(define_insn "load_toc_aix_si"
- [(set (match_operand:SI 0 "register_operand" "=r")
- (unspec:SI [(const_int 0)] 7))]
+ [(parallel [(set (match_operand:SI 0 "register_operand" "=r")
+ (unspec:SI [(const_int 0)] 7))
+ (use (reg:SI 2))])]
"! TARGET_ELF && TARGET_32BIT"
"*
{
@@ -9199,8 +9130,9 @@ operands[2] = GEN_INT (INTVAL (operands[1]) >> 32);
[(set_attr "type" "load")])
(define_insn "load_toc_aix_di"
- [(set (match_operand:DI 0 "register_operand" "=r")
- (unspec:DI [(const_int 0)] 7))]
+ [(parallel [(set (match_operand:DI 0 "register_operand" "=r")
+ (unspec:DI [(const_int 0)] 7))
+ (use (reg:DI 2))])]
"! TARGET_ELF && TARGET_64BIT"
"*
{
@@ -10330,7 +10262,7 @@ operands[2] = GEN_INT (INTVAL (operands[1]) >> 32);
(define_insn ""
[(set (match_operand:DI 0 "gpc_reg_operand" "=r,r,r,r,r")
(eq:DI (match_operand:DI 1 "gpc_reg_operand" "%r,r,r,r,r")
- (match_operand:DI 2 "reg_or_cint_operand" "r,O,K,J,I")))
+ (match_operand:DI 2 "scc_eq_operand" "r,O,K,J,I")))
(clobber (match_scratch:DI 3 "=r,&r,r,r,r"))]
"TARGET_POWERPC64"
"@
@@ -10387,7 +10319,7 @@ operands[2] = GEN_INT (INTVAL (operands[1]) >> 32);
[(set (match_operand:CC 4 "cc_reg_operand" "=x,x,x,x,x,?y,?y,?y,?y,?y")
(compare:CC
(eq:DI (match_operand:DI 1 "gpc_reg_operand" "%r,r,r,r,r,r,r,r,r,r")
- (match_operand:DI 2 "reg_or_cint_operand" "r,O,K,J,I,r,O,K,J,I"))
+ (match_operand:DI 2 "scc_eq_operand" "r,O,K,J,I,r,O,K,J,I"))
(const_int 0)))
(set (match_operand:DI 0 "gpc_reg_operand" "=r,r,r,r,r,r,r,r,r,r")
(eq:DI (match_dup 1) (match_dup 2)))
@@ -10411,7 +10343,7 @@ operands[2] = GEN_INT (INTVAL (operands[1]) >> 32);
[(set (match_operand:CC 4 "cc_reg_not_cr0_operand" "")
(compare:CC
(eq:DI (match_operand:DI 1 "gpc_reg_operand" "")
- (match_operand:DI 2 "reg_or_cint_operand" ""))
+ (match_operand:DI 2 "scc_eq_operand" ""))
(const_int 0)))
(set (match_operand:DI 0 "gpc_reg_operand" "")
(eq:DI (match_dup 1) (match_dup 2)))
@@ -12575,7 +12507,7 @@ operands[2] = GEN_INT (INTVAL (operands[1]) >> 32);
(const_int 0)])
(const_int 0)))]
""
- "crnot %E0,%j1"
+ "{crnor %E0,%j1,%j1|crnot %E0,%j1}"
[(set_attr "type" "cr_logical")])
;; If we are comparing the result of two comparisons, this can be done
@@ -12602,27 +12534,34 @@ operands[2] = GEN_INT (INTVAL (operands[1]) >> 32);
positive_2 = branch_positive_comparison_operator (operands[3], CCEQmode);
if (! positive_1)
- operands[1] = gen_rtx (SImode,
- rs6000_reverse_condition (GET_MODE (operands[2]),
+ operands[1] = gen_rtx (rs6000_reverse_condition (GET_MODE (operands[2]),
GET_CODE (operands[1])),
- operands[2]);
+ SImode,
+ operands[2], const0_rtx);
else if (GET_MODE (operands[1]) != SImode)
- operands[1] = gen_rtx (SImode,
- GET_CODE (operands[1]),
- operands[2]);
+ operands[1] = gen_rtx (GET_CODE (operands[1]),
+ SImode,
+ operands[2], const0_rtx);
if (! positive_2)
- operands[3] = gen_rtx (SImode,
- rs6000_reverse_condition (GET_MODE (operands[4]),
+ operands[3] = gen_rtx (rs6000_reverse_condition (GET_MODE (operands[4]),
GET_CODE (operands[3])),
- operands[4]);
+ SImode,
+ operands[4], const0_rtx);
else if (GET_MODE (operands[3]) != SImode)
- operands[3] = gen_rtx (SImode,
- GET_CODE (operands[3]),
- operands[4]);
+ operands[3] = gen_rtx (GET_CODE (operands[3]),
+ SImode,
+ operands[4], const0_rtx);
if (positive_1 == positive_2)
- operands[1] = gen_rtx_NOT (SImode, operands[1]);
+ {
+ operands[1] = gen_rtx_NOT (SImode, operands[1]);
+ operands[5] = constm1_rtx;
+ }
+ else
+ {
+ operands[5] = const1_rtx;
+ }
}")
;; Unconditional branch and return.
@@ -12807,7 +12746,7 @@ operands[2] = GEN_INT (INTVAL (operands[1]) >> 32);
{
if (which_alternative != 0)
return \"#\";
- else if (get_attr_length (insn) == 8)
+ else if (get_attr_length (insn) == 4)
return \"{bdn|bdnz} %l0\";
else
return \"bdz %$+8\;b %l0\";
@@ -12831,7 +12770,7 @@ operands[2] = GEN_INT (INTVAL (operands[1]) >> 32);
{
if (which_alternative != 0)
return \"#\";
- else if (get_attr_length (insn) == 8)
+ else if (get_attr_length (insn) == 4)
return \"bdz %l0\";
else
return \"{bdn|bdnz} %$+8\;b %l0\";
@@ -12855,7 +12794,7 @@ operands[2] = GEN_INT (INTVAL (operands[1]) >> 32);
{
if (which_alternative != 0)
return \"#\";
- else if (get_attr_length (insn) == 8)
+ else if (get_attr_length (insn) == 4)
return \"{bdn|bdnz} %l0\";
else
return \"bdz %$+8\;b %l0\";
@@ -12879,7 +12818,7 @@ operands[2] = GEN_INT (INTVAL (operands[1]) >> 32);
{
if (which_alternative != 0)
return \"#\";
- else if (get_attr_length (insn) == 8)
+ else if (get_attr_length (insn) == 4)
return \"bdz %l0\";
else
return \"{bdn|bdnz} %$+8\;b %l0\";
@@ -12905,7 +12844,7 @@ operands[2] = GEN_INT (INTVAL (operands[1]) >> 32);
{
if (which_alternative != 0)
return \"#\";
- else if (get_attr_length (insn) == 8)
+ else if (get_attr_length (insn) == 4)
return \"{bdn|bdnz} %l0\";
else
return \"bdz %$+8\;b %l0\";
@@ -12929,7 +12868,7 @@ operands[2] = GEN_INT (INTVAL (operands[1]) >> 32);
{
if (which_alternative != 0)
return \"#\";
- else if (get_attr_length (insn) == 8)
+ else if (get_attr_length (insn) == 4)
return \"bdz %l0\";
else
return \"{bdn|bdnz} %$+8\;b %l0\";
@@ -12953,7 +12892,7 @@ operands[2] = GEN_INT (INTVAL (operands[1]) >> 32);
{
if (which_alternative != 0)
return \"#\";
- else if (get_attr_length (insn) == 8)
+ else if (get_attr_length (insn) == 4)
return \"{bdn|bdnz} %l0\";
else
return \"bdz %$+8\;b %l0\";
@@ -12977,7 +12916,7 @@ operands[2] = GEN_INT (INTVAL (operands[1]) >> 32);
{
if (which_alternative != 0)
return \"#\";
- else if (get_attr_length (insn) == 8)
+ else if (get_attr_length (insn) == 4)
return \"bdz %l0\";
else
return \"{bdn|bdnz} %$+8\;b %l0\";
@@ -13003,7 +12942,7 @@ operands[2] = GEN_INT (INTVAL (operands[1]) >> 32);
{
if (which_alternative != 0)
return \"#\";
- else if (get_attr_length (insn) == 8)
+ else if (get_attr_length (insn) == 4)
return \"bdz %l0\";
else
return \"{bdn|bdnz} %$+8\;b %l0\";
@@ -13027,7 +12966,7 @@ operands[2] = GEN_INT (INTVAL (operands[1]) >> 32);
{
if (which_alternative != 0)
return \"#\";
- else if (get_attr_length (insn) == 8)
+ else if (get_attr_length (insn) == 4)
return \"{bdn|bdnz} %l0\";
else
return \"bdz %$+8\;b %l0\";
@@ -13051,7 +12990,7 @@ operands[2] = GEN_INT (INTVAL (operands[1]) >> 32);
{
if (which_alternative != 0)
return \"#\";
- else if (get_attr_length (insn) == 8)
+ else if (get_attr_length (insn) == 4)
return \"bdz %l0\";
else
return \"{bdn|bdnz} %$+8\;b %l0\";
@@ -13075,7 +13014,7 @@ operands[2] = GEN_INT (INTVAL (operands[1]) >> 32);
{
if (which_alternative != 0)
return \"#\";
- else if (get_attr_length (insn) == 8)
+ else if (get_attr_length (insn) == 4)
return \"{bdn|bdnz} %l0\";
else
return \"bdz %$+8\;b %l0\";
@@ -13374,118 +13313,67 @@ operands[2] = GEN_INT (INTVAL (operands[1]) >> 32);
"TARGET_64BIT"
"b %z2")
-; This is used in compiling the routines __throw and __rethrow.
-; It's a little different to the usual definition...
-
-(define_expand "eh_epilogue"
- [(use (match_operand 0 "general_operand" "r"))
- (use (match_operand 1 "general_operand" "r"))
- (use (match_operand 2 "general_operand" "c"))]
+; This is used in compiling the unwind routines.
+(define_expand "eh_return"
+ [(use (match_operand 0 "general_operand" ""))
+ (use (match_operand 1 "general_operand" ""))]
""
"
{
- rtx stack_reg = gen_rtx_REG (Pmode, STACK_POINTER_REGNUM);
- rtx insn;
-
- /* This is required for binary compatibility. If it's wrong,
- it probably means that eh_regs() in except.c is broken. */
- if (GET_CODE (operands[0]) != REG || REGNO (operands[0]) != 3)
- abort();
-
- /* These can be anything that doesn't interfere with the epilogue. */
- if (GET_CODE (operands[1]) != REG || REGNO (operands[1]) != 4)
- {
- rtx r = gen_rtx_REG (Pmode, 4);
- emit_move_insn (r, operands[1]);
- operands[1] = r;
- }
-
- if (GET_CODE (operands[2]) != REG
- || REGNO (operands[2]) != COUNT_REGISTER_REGNUM)
- {
- rtx r = gen_rtx_REG (Pmode, COUNT_REGISTER_REGNUM);
- emit_move_insn (r, operands[2]);
- operands[2] = r;
- }
-
#if TARGET_AIX
- rs6000_emit_eh_toc_restore (operands[1]);
+ rs6000_emit_eh_toc_restore (operands[0]);
#endif
-
- emit_insn (gen_eh_reg_restore ());
-
- if (Pmode == SImode)
- emit_insn (gen_addsi3 (stack_reg, stack_reg, operands[1]));
- else
- emit_insn (gen_adddi3 (stack_reg, stack_reg, operands[1]));
-
- if (Pmode == SImode)
- insn = emit_jump_insn (gen_return_eh_si (operands[2]));
+ if (TARGET_32BIT)
+ emit_insn (gen_eh_set_lr_si (operands[1]));
else
- insn = emit_jump_insn (gen_return_eh_di (operands[2]));
- emit_barrier_after (insn);
-
+ emit_insn (gen_eh_set_lr_di (operands[1]));
+ emit_move_insn (EH_RETURN_STACKADJ_RTX, operands[0]);
DONE;
}")
-; We can't expand this before we know which registers are restored,
-; but we do want to expand it before flow2 because that way flow2 can
-; remove the redundant loads of the link register.
-(define_expand "eh_reg_restore"
- [(unspec_volatile [(const_int 0)] 9)]
- ""
- "")
+; We can't expand this before we know where the link register is stored.
+(define_insn "eh_set_lr_si"
+ [(unspec_volatile [(match_operand:SI 0 "register_operand" "r")] 9)
+ (clobber (match_scratch:SI 1 "=&r"))]
+ "TARGET_32BIT"
+ "#")
+
+(define_insn "eh_set_lr_di"
+ [(unspec_volatile [(match_operand:DI 0 "register_operand" "r")] 9)
+ (clobber (match_scratch:DI 1 "=&r"))]
+ "TARGET_64BIT"
+ "#")
(define_split
- [(unspec_volatile [(const_int 0)] 9)]
- "reload_completed && TARGET_SCHED_PROLOG"
- [(unspec_volatile [(const_int 0)] 9)]
+ [(unspec_volatile [(match_operand 0 "register_operand" "")] 9)
+ (clobber (match_scratch 1 ""))]
+ "reload_completed"
+ [(const_int 0)]
"
{
- rs6000_emit_epilogue (TRUE);
- DONE;
-}")
-
-(define_insn ""
- [(unspec_volatile [(const_int 0)] 9)]
- ""
- "*
-{
- if (TARGET_SCHED_PROLOG)
- return \"#\";
-
- /* This is slightly ugly, but at least we don't have multiple
- copies of the epilogue-emitting code. */
- start_sequence ();
-
- /* A NOTE_INSN_DELETED is supposed to be at the start
- and end of the \"toplevel\" insn chain. */
- emit_note (0, NOTE_INSN_DELETED);
- rs6000_emit_epilogue (TRUE);
- emit_note (0, NOTE_INSN_DELETED);
-
- if (TARGET_DEBUG_STACK)
- debug_rtx_list (get_insns(), 100);
- final (get_insns(), asm_out_file, FALSE, FALSE);
- end_sequence ();
- return \"\";
-}")
+ rs6000_stack_t *info = rs6000_stack_info ();
+ if (info->lr_save_p)
+ {
+ rtx frame_rtx = stack_pointer_rtx;
+ int sp_offset = 0;
+ rtx tmp;
-(define_insn "return_eh_si"
- [(return)
- (use (match_operand:SI 0 "register_operand" "lc"))
- (use (reg:SI 2))
- (use (reg:SI 3))]
- "TARGET_32BIT"
- "b%T0"
- [(set_attr "type" "jmpreg")])
+ if (frame_pointer_needed
+ || current_function_calls_alloca
+ || info->total_size > 32767)
+ {
+ emit_move_insn (operands[1], gen_rtx_MEM (Pmode, frame_rtx));
+ frame_rtx = operands[1];
+ }
+ else if (info->push_p)
+ sp_offset = info->total_size;
-(define_insn "return_eh_di"
- [(return)
- (use (match_operand:DI 0 "register_operand" "lc"))
- (use (reg:DI 2))
- (use (reg:DI 3))]
- "TARGET_64BIT"
- "b%T0"
- [(set_attr "type" "jmpreg")])
+ tmp = plus_constant (frame_rtx, info->lr_save_offset + sp_offset);
+ tmp = gen_rtx_MEM (Pmode, tmp);
+ emit_move_insn (tmp, operands[0]);
+ }
+ else
+ emit_move_insn (gen_rtx_REG (Pmode, LINK_REGISTER_REGNUM), operands[0]);
+ DONE;
+}")
diff --git a/gcc/config/rs6000/rtems.h b/gcc/config/rs6000/rtems.h
index 6810d38a6b4..148334c0dd0 100644
--- a/gcc/config/rs6000/rtems.h
+++ b/gcc/config/rs6000/rtems.h
@@ -1,5 +1,5 @@
/* Definitions for rtems targeting a PowerPC using elf.
- Copyright (C) 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1997, 2000, 2001, 2002 Free Software Foundation, Inc.
Contributed by Joel Sherrill (joel@OARcorp.com).
This file is part of GNU CC.
@@ -22,8 +22,8 @@ Boston, MA 02111-1307, USA. */
/* Specify predefined symbols in preprocessor. */
#undef CPP_PREDEFINES
-#define CPP_PREDEFINES "-DPPC -Drtems -D__rtems__ \
- -Asystem=rtems -Acpu=powerpc -Amachine=powerpc"
+#define CPP_PREDEFINES "-DPPC -D__rtems__ \
+ -Asystem=rtems -Acpu=powerpc -Amachine=powerpc -D__USE_INIT_FINI__"
/* Generate calls to memcpy, memcmp and memset. */
#ifndef TARGET_MEM_FUNCTIONS
@@ -31,4 +31,10 @@ Boston, MA 02111-1307, USA. */
#endif
#undef STARTFILE_DEFAULT_SPEC
-#define STARTFILE_DEFAULT_SPEC "crt0.o%s"
+#define STARTFILE_DEFAULT_SPEC "ecrti.o%s crt0.o%s"
+
+#undef ENDFILE_DEFAULT_SPEC
+#define ENDFILE_DEFAULT_SPEC "ecrtn.o%s"
+
+/* Get machine-independent configuration parameters for RTEMS. */
+#include <rtems.h>
diff --git a/gcc/config/rs6000/sysv4.h b/gcc/config/rs6000/sysv4.h
index da2f0b7313a..eec89ede21b 100644
--- a/gcc/config/rs6000/sysv4.h
+++ b/gcc/config/rs6000/sysv4.h
@@ -197,6 +197,8 @@ do { \
rs6000_current_abi = ABI_AIX; \
else if (!strcmp (rs6000_abi_name, "linux")) \
rs6000_current_abi = ABI_V4; \
+ else if (!strcmp (rs6000_abi_name, "netbsd")) \
+ rs6000_current_abi = ABI_V4; \
else if (!strcmp (rs6000_abi_name, "solaris")) \
rs6000_current_abi = ABI_SOLARIS; \
else \
@@ -418,13 +420,6 @@ do { \
#define MINIMAL_TOC_SECTION_ASM_OP \
((TARGET_RELOCATABLE || flag_pic) ? "\t.section\t\".got2\",\"aw\"" : "\t.section\t\".got1\",\"aw\"")
-/* Put relocatable data in .data, not .rodata so initialized pointers can be updated. */
-/* Override elfos.h definition. */
-#undef CONST_SECTION_ASM_OP
-#define CONST_SECTION_ASM_OP \
- ((TARGET_RELOCATABLE || flag_pic) ? "\t.section\t\".data\"\t# .rodata" : "\t.section\t\".rodata\"")
-
-
#define SDATA_SECTION_ASM_OP "\t.section\t\".sdata\",\"aw\""
#define SDATA2_SECTION_ASM_OP "\t.section\t\".sdata2\",\"a\""
#define SBSS_SECTION_ASM_OP \
@@ -856,36 +851,6 @@ do { \
} \
} while (0)
-/* This is how to output an assembler line defining an address
- constant for the dwarf call unwinding information.
- For -mrelocatable, we mark all addresses that need to be fixed up
- in the .fixup section. */
-
-#define ASM_OUTPUT_DWARF_ADDR(FILE,LABEL) \
-do { \
- if (TARGET_RELOCATABLE) \
- { \
- char buf[256]; \
- \
- ASM_GENERATE_INTERNAL_LABEL (buf, "LCP", fixuplabelno); \
- fixuplabelno++; \
- ASM_OUTPUT_LABEL (FILE, buf); \
- fprintf (FILE, "\t.%dbyte\t", POINTER_SIZE / BITS_PER_UNIT); \
- assemble_name (FILE, LABEL); \
- fprintf (FILE, "\n"); \
- fprintf (FILE, "\t.section \".fixup\",\"aw\"\n"); \
- ASM_OUTPUT_ALIGN (FILE, 2); \
- fprintf (FILE, "\t.long\t"); \
- assemble_name (FILE, buf); \
- fprintf (FILE, "\n\t.previous\n"); \
- } \
- else \
- { \
- fprintf (FILE, "\t.%dbyte\t", POINTER_SIZE / BITS_PER_UNIT); \
- assemble_name (FILE, LABEL); \
- } \
-} while (0)
-
/* This is the end of what might become sysv4.h. */
/* Allow stabs and dwarf, for now, make stabs the default debugging type,
@@ -1047,7 +1012,8 @@ do { \
#undef TARGET_VERSION
#define TARGET_VERSION fprintf (stderr, " (PowerPC System V.4)");
-#define CPP_PREDEFINES \
+#undef CPP_PREDEFINES
+#define CPP_PREDEFINES \
"-DPPC -Dunix -D__svr4__ -Asystem=unix -Asystem=svr4 -Acpu=powerpc -Amachine=powerpc"
/* Pass various options to the assembler. */
@@ -1061,7 +1027,8 @@ do { \
%{mlittle} %{mlittle-endian} %{mbig} %{mbig-endian} \
%{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian: \
%{mcall-solaris: -mlittle -msolaris} \
- %{mcall-linux: -mbig} }}}}"
+ %{mcall-linux: -mbig} \
+ %{mcall-netbsd: -mbig} }}}}"
#define CC1_ENDIAN_BIG_SPEC ""
@@ -1080,9 +1047,10 @@ do { \
%{mcall-aixdesc: -mbig %(cc1_endian_big) } \
%{mcall-solaris: -mlittle %(cc1_endian_little) } \
%{mcall-linux: -mbig %(cc1_endian_big) } \
- %{!mcall-aixdesc: %{!mcall-solaris: %{!mcall-linux: \
+ %{mcall-netbsd: -mbig %(cc1_endian_big) } \
+ %{!mcall-aixdesc: %{!mcall-solaris: %{!mcall-linux: %{!mcall-netbsd: \
%(cc1_endian_default) \
- }}} \
+ }}}} \
}}}} \
%{mcall-solaris: -mregnames } \
%{mno-sdata: -msdata=none } \
@@ -1090,7 +1058,8 @@ do { \
%{!meabi: %{!mno-eabi: \
%{mrelocatable: -meabi } \
%{mcall-solaris: -mno-eabi } \
- %{mcall-linux: -mno-eabi }}} \
+ %{mcall-linux: -mno-eabi } \
+ %{mcall-netbsd: -mno-eabi }}} \
%{msdata: -msdata=default} \
%{mno-sdata: -msdata=none} \
%{profile: -p}"
@@ -1119,8 +1088,9 @@ do { \
%{mmvme: %(link_start_mvme) } \
%{msim: %(link_start_sim) } \
%{mcall-linux: %(link_start_linux) } \
+%{mcall-netbsd: %(link_start_netbsd) } \
%{mcall-solaris: %(link_start_solaris) } \
-%{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mcall-linux: %{!mcall-solaris: %(link_start_default) }}}}}}"
+%{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mcall-linux: %{!mcall-netbsd: %{!mcall-solaris: %(link_start_default) }}}}}}}"
#define LINK_START_DEFAULT_SPEC ""
@@ -1173,8 +1143,9 @@ do { \
%{mmvme: %(link_os_mvme) } \
%{msim: %(link_os_sim) } \
%{mcall-linux: %(link_os_linux) } \
+%{mcall-netbsd: %(link_os_netbsd) } \
%{mcall-solaris: %(link_os_solaris) } \
-%{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mcall-linux: %{!mcall-solaris: %(link_os_default) }}}}}}"
+%{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mcall-linux: %{!mcall-netbsd: %{!mcall-solaris: %(link_os_default) }}}}}}}"
#define LINK_OS_DEFAULT_SPEC ""
@@ -1221,8 +1192,9 @@ do { \
%{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian: \
%{mcall-solaris: %(cpp_endian_solaris) } \
%{mcall-linux: %(cpp_endian_big) } \
+ %{mcall-netbsd: %(cpp_endian_big) } \
%{mcall-aixdesc: %(cpp_endian_big) } \
- %{!mcall-solaris: %{!mcall-linux: %{!mcall-aixdesc: %(cpp_endian_default) }}}}}}}"
+ %{!mcall-solaris: %{!mcall-linux: %{!mcall-netbsd: %{!mcall-aixdesc: %(cpp_endian_default) }}}}}}}}"
#define CPP_ENDIAN_DEFAULT_SPEC "%(cpp_endian_big)"
@@ -1234,8 +1206,9 @@ do { \
%{mmvme: %(cpp_os_mvme) } \
%{msim: %(cpp_os_sim) } \
%{mcall-linux: %(cpp_os_linux) } \
+%{mcall-netbsd: %(cpp_os_netbsd) } \
%{mcall-solaris: %(cpp_os_solaris) } \
-%{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mcall-linux: %{!mcall-solaris: %(cpp_os_default) }}}}}}"
+%{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mcall-linux: %{!mcall-netbsd: %{!mcall-solaris: %(cpp_os_default) }}}}}}}"
#define CPP_OS_DEFAULT_SPEC ""
@@ -1247,8 +1220,9 @@ do { \
%{mmvme: %(startfile_mvme) } \
%{msim: %(startfile_sim) } \
%{mcall-linux: %(startfile_linux) } \
+%{mcall-netbsd: %(startfile_netbsd) } \
%{mcall-solaris: %(startfile_solaris) } \
-%{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mcall-linux: %{!mcall-solaris: %(startfile_default) }}}}}}"
+%{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mcall-linux: %{!mcall-netbsd: %{!mcall-solaris: %(startfile_default) }}}}}}}"
#define STARTFILE_DEFAULT_SPEC ""
@@ -1260,8 +1234,9 @@ do { \
%{mmvme: %(lib_mvme) } \
%{msim: %(lib_sim) } \
%{mcall-linux: %(lib_linux) } \
+%{mcall-netbsd: %(lib_netbsd) } \
%{mcall-solaris: %(lib_solaris) } \
-%{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mcall-linux: %{!mcall-solaris: %(lib_default) }}}}}}"
+%{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mcall-linux: %{!mcall-netbsd: %{!mcall-solaris: %(lib_default) }}}}}}}"
#define LIB_DEFAULT_SPEC ""
@@ -1273,9 +1248,10 @@ do { \
%{mmvme: %(endfile_mvme)} \
%{msim: %(endfile_sim)} \
%{mcall-linux: %(endfile_linux) } \
+%{mcall-netbsd: %(endfile_netbsd) } \
%{mcall-solaris: %(endfile_solaris)} \
%{mvxworks: %(endfile_vxworks) } \
-%{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mcall-linux: %{!mcall-solaris: %{!mvxworks: %(endfile_default) }}}}}}}"
+%{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mcall-linux: %{!mcall-netbsd: %{!mcall-solaris: %{!mvxworks: %(endfile_default) }}}}}}}}"
#define ENDFILE_DEFAULT_SPEC ""
@@ -1371,6 +1347,29 @@ do { \
-Asystem=unix -Asystem=posix %{pthread:-D_REENTRANT}"
#endif
+/* NetBSD support. */
+#define LIB_NETBSD_SPEC "\
+%{profile:-lgmon -lc_p} %{!profile:-lc}"
+
+#define STARTFILE_NETBSD_SPEC "\
+ncrti.o%s crt0.o%s \
+%{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
+
+#define ENDFILE_NETBSD_SPEC "\
+%{!shared:crtend.o%s} %{shared:crtendS.o%s} \
+ncrtn.o%s"
+
+#define LINK_START_NETBSD_SPEC "\
+"
+
+#define LINK_OS_NETBSD_SPEC "\
+%{!shared: %{!static: \
+ %{rdynamic:-export-dynamic} \
+ %{!dynamic-linker:-dynamic-linker /usr/libexec/ld.elf_so}}}"
+
+#define CPP_OS_NETBSD_SPEC "\
+-D__powerpc__ -D__NetBSD__ -D__ELF__ -D__KPRINTF_ATTRIBUTE__"
+
/* Solaris support. */
/* For Solaris, Gcc automatically adds in one of the files
/usr/ccs/lib/values-Xc.o, /usr/ccs/lib/values-Xa.o, or
@@ -1466,6 +1465,7 @@ do { \
{ "lib_mvme", LIB_MVME_SPEC }, \
{ "lib_sim", LIB_SIM_SPEC }, \
{ "lib_linux", LIB_LINUX_SPEC }, \
+ { "lib_netbsd", LIB_NETBSD_SPEC }, \
{ "lib_solaris", LIB_SOLARIS_SPEC }, \
{ "lib_vxworks", LIB_VXWORKS_SPEC }, \
{ "lib_default", LIB_DEFAULT_SPEC }, \
@@ -1474,6 +1474,7 @@ do { \
{ "startfile_mvme", STARTFILE_MVME_SPEC }, \
{ "startfile_sim", STARTFILE_SIM_SPEC }, \
{ "startfile_linux", STARTFILE_LINUX_SPEC }, \
+ { "startfile_netbsd", STARTFILE_NETBSD_SPEC }, \
{ "startfile_solaris", STARTFILE_SOLARIS_SPEC }, \
{ "startfile_vxworks", STARTFILE_VXWORKS_SPEC }, \
{ "startfile_default", STARTFILE_DEFAULT_SPEC }, \
@@ -1482,6 +1483,7 @@ do { \
{ "endfile_mvme", ENDFILE_MVME_SPEC }, \
{ "endfile_sim", ENDFILE_SIM_SPEC }, \
{ "endfile_linux", ENDFILE_LINUX_SPEC }, \
+ { "endfile_netbsd", ENDFILE_NETBSD_SPEC }, \
{ "endfile_solaris", ENDFILE_SOLARIS_SPEC }, \
{ "endfile_vxworks", ENDFILE_VXWORKS_SPEC }, \
{ "endfile_default", ENDFILE_DEFAULT_SPEC }, \
@@ -1494,6 +1496,7 @@ do { \
{ "link_start_mvme", LINK_START_MVME_SPEC }, \
{ "link_start_sim", LINK_START_SIM_SPEC }, \
{ "link_start_linux", LINK_START_LINUX_SPEC }, \
+ { "link_start_netbsd", LINK_START_NETBSD_SPEC }, \
{ "link_start_solaris", LINK_START_SOLARIS_SPEC }, \
{ "link_start_vxworks", LINK_START_VXWORKS_SPEC }, \
{ "link_start_default", LINK_START_DEFAULT_SPEC }, \
@@ -1503,6 +1506,7 @@ do { \
{ "link_os_mvme", LINK_OS_MVME_SPEC }, \
{ "link_os_sim", LINK_OS_SIM_SPEC }, \
{ "link_os_linux", LINK_OS_LINUX_SPEC }, \
+ { "link_os_netbsd", LINK_OS_NETBSD_SPEC }, \
{ "link_os_solaris", LINK_OS_SOLARIS_SPEC }, \
{ "link_os_vxworks", LINK_OS_VXWORKS_SPEC }, \
{ "link_os_default", LINK_OS_DEFAULT_SPEC }, \
@@ -1519,6 +1523,7 @@ do { \
{ "cpp_os_mvme", CPP_OS_MVME_SPEC }, \
{ "cpp_os_sim", CPP_OS_SIM_SPEC }, \
{ "cpp_os_linux", CPP_OS_LINUX_SPEC }, \
+ { "cpp_os_netbsd", CPP_OS_NETBSD_SPEC }, \
{ "cpp_os_solaris", CPP_OS_SOLARIS_SPEC }, \
{ "cpp_os_vxworks", CPP_OS_VXWORKS_SPEC }, \
{ "cpp_os_default", CPP_OS_DEFAULT_SPEC },
@@ -1610,3 +1615,13 @@ do { \
= init_one_libfunc (SQRTTF_LIBCALL); \
} \
} while (0)
+
+/* Select a format to encode pointers in exception handling data. CODE
+ is 0 for data, 1 for code labels, 2 for function pointers. GLOBAL is
+ true if the symbol may be affected by dynamic relocations. */
+#define ASM_PREFERRED_EH_DATA_FORMAT(CODE,GLOBAL) \
+ ((flag_pic || TARGET_RELOCATABLE) \
+ ? (((GLOBAL) ? DW_EH_PE_indirect : 0) | DW_EH_PE_pcrel | DW_EH_PE_sdata4) \
+ : DW_EH_PE_absptr)
+
+#define EXCEPTION_SECTION readonly_data_section
diff --git a/gcc/config/rs6000/t-ppccomm b/gcc/config/rs6000/t-ppccomm
index 3a1f106ad21..9b8ee43eaa8 100644
--- a/gcc/config/rs6000/t-ppccomm
+++ b/gcc/config/rs6000/t-ppccomm
@@ -6,7 +6,10 @@ CROSS_LIBGCC1 =
# These are really part of libgcc1, but this will cause them to be
# built correctly, so... [taken from t-sparclite]
-LIB2FUNCS_EXTRA = eabi.S tramp.S
+LIB2FUNCS_EXTRA = tramp.S
+
+# This one can't end up in shared libgcc
+LIB2FUNCS_STATIC_EXTRA = eabi.S
# We want fine grained libraries, so use the new code to build the
# floating point emulation libraries.
@@ -36,16 +39,19 @@ MULTILIB_MATCHES_FLOAT = msoft-float=mcpu?401 \
msoft-float=mcpu?823 \
msoft-float=mcpu?860
MULTILIB_MATCHES_ENDIAN = mlittle=mlittle-endian mbig=mbig-endian
-MULTILIB_MATCHES_SYSV = mcall-sysv=mcall-sysv-eabi mcall-sysv=mcall-sysv-noeabi mcall-sysv=mcall-linux
+MULTILIB_MATCHES_SYSV = mcall-sysv=mcall-sysv-eabi mcall-sysv=mcall-sysv-noeabi mcall-sysv=mcall-linux mcall-sysv=mcall-netbsd
LIBGCC = stmp-multilib
INSTALL_LIBGCC = install-multilib
EXTRA_MULTILIB_PARTS = crtbegin$(objext) crtend$(objext) \
crtbeginS$(objext) crtendS$(objext) \
- ecrti$(objext) ecrtn$(objext) scrt0$(objext) scrti$(objext) scrtn$(objext)
+ ecrti$(objext) ecrtn$(objext) \
+ scrt0$(objext) scrti$(objext) scrtn$(objext) \
+ ncrti$(objext) ncrtn$(objext)
-# We build {e,s}crti.o, {e,s}crtn.o, and scrt0.o which serve to add begin and
-# end labels to all of the special sections used when we link using gcc.
+# We build {e,s}crti.o, {e,s}crtn.o, and {s,n}crt0.o which serve to
+# add begin and end labels to all of the special sections used when we
+# link using gcc.
# Assemble startup files.
ecrti.S: $(srcdir)/config/rs6000/eabi-ci.asm
@@ -54,6 +60,14 @@ ecrti.S: $(srcdir)/config/rs6000/eabi-ci.asm
ecrtn.S: $(srcdir)/config/rs6000/eabi-cn.asm
cat $(srcdir)/config/rs6000/eabi-cn.asm >ecrtn.S
+ncrti.S: $(srcdir)/config/rs6000/sol-ci.asm
+ sed -e 's/__init/_init/' -e 's/__fini/_fini/' \
+ $(srcdir)/config/rs6000/sol-ci.asm >ncrti.S
+
+ncrtn.S: $(srcdir)/config/rs6000/sol-cn.asm
+ sed -e 's/__init/_init/' -e 's/__fini/_fini/' \
+ $(srcdir)/config/rs6000/sol-cn.asm >ncrtn.S
+
scrti.S: $(srcdir)/config/rs6000/sol-ci.asm
cat $(srcdir)/config/rs6000/sol-ci.asm >scrti.S
@@ -70,6 +84,12 @@ $(T)ecrti$(objext): ecrti.S
$(T)ecrtn$(objext): ecrtn.S
$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -c ecrtn.S -o $(T)ecrtn$(objext)
+$(T)ncrti$(objext): ncrti.S
+ $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -c ncrti.S -o $(T)ncrti$(objext)
+
+$(T)ncrtn$(objext): ncrtn.S
+ $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -c ncrtn.S -o $(T)ncrtn$(objext)
+
$(T)scrti$(objext): scrti.S
$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -c scrti.S -o $(T)scrti$(objext)
@@ -81,6 +101,6 @@ $(T)scrt0$(objext): scrt0.c
# It is important that crtbegin.o, etc., aren't surprised by stuff in .sdata.
CRTSTUFF_T_CFLAGS = -msdata=none
-# There is no need to add -fPIC here because crtstuff is multilibbed
-# and so automatically gets -fPIC when needed.
-CRTSTUFF_T_CFLAGS_S = -msdata=none
+# Make sure crt*.o are built with -fPIC even if configured with
+# --enable-shared --disable-multilib
+CRTSTUFF_T_CFLAGS_S = -fPIC -msdata=none
diff --git a/gcc/config/rs6000/tramp.asm b/gcc/config/rs6000/tramp.asm
index 5f3048990d9..bd7dbe2daa6 100644
--- a/gcc/config/rs6000/tramp.asm
+++ b/gcc/config/rs6000/tramp.asm
@@ -104,6 +104,6 @@ FUNC_START(__trampoline_setup)
blr
.Labort:
- bl FUNC_NAME(abort)
+ bl JUMP_TARGET(abort)
FUNC_END(__trampoline_setup)
diff --git a/gcc/config/rs6000/xm-beos.h b/gcc/config/rs6000/xm-beos.h
index 3660a696ed1..f4e6b570aac 100644
--- a/gcc/config/rs6000/xm-beos.h
+++ b/gcc/config/rs6000/xm-beos.h
@@ -21,12 +21,6 @@ along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-
-/* #defines that need visibility everywhere. */
-
-#define FALSE 0
-#define TRUE 1
-
/* This describes the machine the compiler is hosted on. */
#define HOST_BITS_PER_CHAR 8
@@ -83,4 +77,3 @@ extern void *alloca ();
/* SYSTEM_INCLUDE_DIR is the location for system specific, non-POSIX headers. */
#define SYSTEM_INCLUDE_DIR "/boot/develop/headers/be"
-
diff --git a/gcc/config/rs6000/xm-rs6000.h b/gcc/config/rs6000/xm-rs6000.h
index 1ad9da9a6ee..9e4658bc82c 100644
--- a/gcc/config/rs6000/xm-rs6000.h
+++ b/gcc/config/rs6000/xm-rs6000.h
@@ -19,11 +19,6 @@ along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-
-/* #defines that need visibility everywhere. */
-#define FALSE 0
-#define TRUE 1
-
/* This describes the machine the compiler is hosted on. */
#define HOST_BITS_PER_CHAR 8
#define HOST_BITS_PER_SHORT 16
diff --git a/gcc/config/rs6000/xm-sysv4.h b/gcc/config/rs6000/xm-sysv4.h
index 46d1ddd8e54..4c0ade6dd38 100644
--- a/gcc/config/rs6000/xm-sysv4.h
+++ b/gcc/config/rs6000/xm-sysv4.h
@@ -19,11 +19,6 @@ along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-
-/* #defines that need visibility everywhere. */
-#define FALSE 0
-#define TRUE 1
-
/* This describes the machine the compiler is hosted on. */
#define HOST_BITS_PER_CHAR 8
#define HOST_BITS_PER_SHORT 16
diff --git a/gcc/config/s390/fixdfdi.h b/gcc/config/s390/fixdfdi.h
new file mode 100644
index 00000000000..4f1fb352f1b
--- /dev/null
+++ b/gcc/config/s390/fixdfdi.h
@@ -0,0 +1,301 @@
+/* Definitions of target machine for GNU compiler, for IBM S/390
+ Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
+ Contributed by Hartmut Penner (hpenner@de.ibm.com) and
+ Ulrich Weigand (uweigand@de.ibm.com).
+
+This file is part of GNU CC.
+
+GNU CC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU CC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU CC; see the file COPYING. If not, write to
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA. */
+
+#ifdef L_fixunsdfdi
+#define EXPD(fp) (((fp.l.upper) >> 20) & 0x7FF)
+#define EXCESSD 1022
+#define SIGNBIT 0x80000000
+#define SIGND(fp) ((fp.l.upper) & SIGNBIT)
+#define MANTD_LL(fp) ((fp.ll & (HIDDEND_LL-1)) | HIDDEND_LL)
+#define FRACD_LL(fp) (fp.ll & (HIDDEND_LL-1))
+#define HIDDEND_LL ((UDItype_x)1 << 52)
+
+typedef int DItype_x __attribute__ ((mode (DI)));
+typedef unsigned int UDItype_x __attribute__ ((mode (DI)));
+typedef int SItype_x __attribute__ ((mode (SI)));
+typedef unsigned int USItype_x __attribute__ ((mode (SI)));
+
+union double_long {
+ double d;
+ struct {
+ SItype_x upper;
+ USItype_x lower;
+ } l;
+ UDItype_x ll;
+};
+
+
+/* convert double to unsigned int */
+UDItype_x
+__fixunsdfdi (double a1)
+{
+ register union double_long dl1;
+ register int exp;
+ register UDItype_x l;
+
+ dl1.d = a1;
+
+ /* +/- 0, denormalized, negativ */
+
+ if (!EXPD (dl1) || SIGND(dl1))
+ return 0;
+
+ exp = EXPD (dl1) - EXCESSD - 53;
+
+ /* number < 1 */
+
+ if (exp < -53)
+ return 0;
+
+ /* NaN */
+
+ if ((EXPD(dl1) == 0x7ff) && (FRACD_LL(dl1) != 0)) /* NaN */
+ return 0x0ULL;
+
+ /* Number big number & + inf */
+
+ if (exp >= 12) {
+ return 0xFFFFFFFFFFFFFFFFULL;
+ }
+
+ l = MANTD_LL(dl1);
+
+ /* shift down until exp < 12 or l = 0 */
+ if (exp > 0)
+ l <<= exp;
+ else
+ l >>= -exp;
+
+ return l;
+}
+#define __fixunsdfdi ___fixunsdfdi
+#endif
+#undef L_fixunsdfdi
+
+#ifdef L_fixdfdi
+#define EXPD(fp) (((fp.l.upper) >> 20) & 0x7FF)
+#define EXCESSD 1022
+#define SIGNBIT 0x80000000
+#define SIGND(fp) ((fp.l.upper) & SIGNBIT)
+#define MANTD_LL(fp) ((fp.ll & (HIDDEND_LL-1)) | HIDDEND_LL)
+#define FRACD_LL(fp) (fp.ll & (HIDDEND_LL-1))
+#define HIDDEND_LL ((UDItype_x)1 << 52)
+
+typedef int DItype_x __attribute__ ((mode (DI)));
+typedef unsigned int UDItype_x __attribute__ ((mode (DI)));
+typedef int SItype_x __attribute__ ((mode (SI)));
+typedef unsigned int USItype_x __attribute__ ((mode (SI)));
+
+union double_long {
+ double d;
+ struct {
+ SItype_x upper;
+ USItype_x lower;
+ } l;
+ UDItype_x ll;
+};
+
+/* convert double to int */
+DItype_x
+__fixdfdi (double a1)
+{
+ register union double_long dl1;
+ register int exp;
+ register DItype_x l;
+
+ dl1.d = a1;
+
+ /* +/- 0, denormalized */
+
+ if (!EXPD (dl1))
+ return 0;
+
+ exp = EXPD (dl1) - EXCESSD - 53;
+
+ /* number < 1 */
+
+ if (exp < -53)
+ return 0;
+
+ /* NaN */
+
+ if ((EXPD(dl1) == 0x7ff) && (FRACD_LL(dl1) != 0)) /* NaN */
+ return 0x8000000000000000ULL;
+
+ /* Number big number & +/- inf */
+
+ if (exp >= 11) {
+ l = (long long)1<<63;
+ if (!SIGND(dl1))
+ l--;
+ return l;
+ }
+
+ l = MANTD_LL(dl1);
+
+ /* shift down until exp < 12 or l = 0 */
+ if (exp > 0)
+ l <<= exp;
+ else
+ l >>= -exp;
+
+ return (SIGND (dl1) ? -l : l);
+}
+#define __fixdfdi ___fixdfdi
+#endif
+#undef L_fixdfdi
+
+#ifdef L_fixunssfdi
+#define EXP(fp) (((fp.l) >> 23) & 0xFF)
+#define EXCESS 126
+#define SIGNBIT 0x80000000
+#define SIGN(fp) ((fp.l) & SIGNBIT)
+#define HIDDEN (1 << 23)
+#define MANT(fp) (((fp.l) & 0x7FFFFF) | HIDDEN)
+#define FRAC(fp) ((fp.l) & 0x7FFFFF)
+
+typedef int DItype_x __attribute__ ((mode (DI)));
+typedef unsigned int UDItype_x __attribute__ ((mode (DI)));
+typedef int SItype_x __attribute__ ((mode (SI)));
+typedef unsigned int USItype_x __attribute__ ((mode (SI)));
+
+union float_long
+ {
+ float f;
+ USItype_x l;
+ };
+
+/* convert float to unsigned int */
+UDItype_x
+__fixunssfdi (float a1)
+{
+ register union float_long fl1;
+ register int exp;
+ register UDItype_x l;
+
+ fl1.f = a1;
+
+ /* +/- 0, denormalized, negativ */
+
+ if (!EXP (fl1) || SIGN(fl1))
+ return 0;
+
+ exp = EXP (fl1) - EXCESS - 24;
+
+ /* number < 1 */
+
+ if (exp < -24)
+ return 0;
+
+ /* NaN */
+
+ if ((EXP(fl1) == 0xff) && (FRAC(fl1) != 0)) /* NaN */
+ return 0x0ULL;
+
+ /* Number big number & + inf */
+
+ if (exp >= 41) {
+ return 0xFFFFFFFFFFFFFFFFULL;
+ }
+
+ l = MANT(fl1);
+
+ if (exp > 0)
+ l <<= exp;
+ else
+ l >>= -exp;
+
+ return l;
+}
+#define __fixunssfdi ___fixunssfdi
+#endif
+#undef L_fixunssfdi
+
+#ifdef L_fixsfdi
+#define EXP(fp) (((fp.l) >> 23) & 0xFF)
+#define EXCESS 126
+#define SIGNBIT 0x80000000
+#define SIGN(fp) ((fp.l) & SIGNBIT)
+#define HIDDEN (1 << 23)
+#define MANT(fp) (((fp.l) & 0x7FFFFF) | HIDDEN)
+#define FRAC(fp) ((fp.l) & 0x7FFFFF)
+
+typedef int DItype_x __attribute__ ((mode (DI)));
+typedef unsigned int UDItype_x __attribute__ ((mode (DI)));
+typedef int SItype_x __attribute__ ((mode (SI)));
+typedef unsigned int USItype_x __attribute__ ((mode (SI)));
+
+union float_long
+ {
+ float f;
+ USItype_x l;
+ };
+
+/* convert double to int */
+DItype_x
+__fixsfdi (float a1)
+{
+ register union float_long fl1;
+ register int exp;
+ register DItype_x l;
+
+ fl1.f = a1;
+
+ /* +/- 0, denormalized */
+
+ if (!EXP (fl1))
+ return 0;
+
+ exp = EXP (fl1) - EXCESS - 24;
+
+ /* number < 1 */
+
+ if (exp < -24)
+ return 0;
+
+ /* NaN */
+
+ if ((EXP(fl1) == 0xff) && (FRAC(fl1) != 0)) /* NaN */
+ return 0x8000000000000000ULL;
+
+ /* Number big number & +/- inf */
+
+ if (exp >= 40) {
+ l = (long long)1<<63;
+ if (!SIGN(fl1))
+ l--;
+ return l;
+ }
+
+ l = MANT(fl1);
+
+ if (exp > 0)
+ l <<= exp;
+ else
+ l >>= -exp;
+
+ return (SIGN (fl1) ? -l : l);
+}
+#define __fixsfdi ___fixsfdi
+#endif
+#undef L_fixsfdi
+
diff --git a/gcc/config/s390/linux.h b/gcc/config/s390/linux.h
new file mode 100644
index 00000000000..6136412c9c5
--- /dev/null
+++ b/gcc/config/s390/linux.h
@@ -0,0 +1,381 @@
+/* Definitions for Linux for S/390.
+ Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
+ Contributed by Hartmut Penner (hpenner@de.ibm.com) and
+ Ulrich Weigand (uweigand@de.ibm.com).
+
+This file is part of GNU CC.
+
+GNU CC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU CC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU CC; see the file COPYING. If not, write to
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA. */
+
+#ifndef _LINUX_H
+#define _LINUX_H
+
+#undef SIZE_TYPE /* use default */
+
+#undef TARGET_VERSION
+#define TARGET_VERSION fprintf (stderr, " (Linux for S/390)");
+
+/* Names to predefine in the preprocessor for this target machine. */
+
+#define CPP_PREDEFINES "-Dlinux -Asystem(linux) -Acpu(s390) -Amachine(s390) -D__s390__ -Asystem(unix) -Dunix -D__ELF__"
+
+/*
+ * Caller save not (always) working in gcc-2.95.2
+ */
+
+#undef CC1_SPEC
+#define CC1_SPEC "-fno-caller-saves"
+#define CC1PLUS_SPEC "-fno-caller-saves"
+
+#undef LINK_SPEC
+#ifdef CROSS_COMPILE
+#define LINK_SPEC "-m elf_s390 %{shared:-shared} \
+ %{!shared: \
+ %{!ibcs: \
+ %{!static: \
+ %{rdynamic:-export-dynamic} \
+ %{!dynamic-linker:-dynamic-linker /lib/ld.so.1 \
+ -rpath-link=/usr/local/s390-ibm-linux/lib}} \
+ %{static:-static}}}"
+#else
+#define LINK_SPEC "-m elf_s390 %{shared:-shared} \
+ %{!shared: \
+ %{!ibcs: \
+ %{!static: \
+ %{rdynamic:-export-dynamic} \
+ %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}} \
+ %{static:-static}}}"
+#endif
+
+/* Need to define this. Otherwise define to BITS_PER_WORD in cexp.c.
+ But BITS_PER_WORD depends on target flags, which are not defined in
+ cexpc.c. */
+
+#undef WCHAR_TYPE
+#define WCHAR_TYPE "int"
+#undef WCHAR_TYPE_SIZE
+#define WCHAR_TYPE_SIZE 32
+#define MAX_LONG_TYPE_SIZE 64
+
+/* Character to start a comment. */
+
+#define ASM_COMMENT_START "#"
+
+
+/* Assembler pseudos to introduce constants of various size. */
+
+#define ASM_SHORT "\t.word"
+#define ASM_LONG "\t.long"
+#define ASM_QUAD "\t.quad"
+#define ASM_DOUBLE "\t.double"
+
+
+/* Prefix for internally generated assembler labels. */
+#define LPREFIX ".L"
+
+#define ASM_OUTPUT_LABELREF(FILE, NAME) \
+ fprintf (FILE, "%s", NAME);
+
+
+/* This is how to output the definition of a user-level label named NAME,
+ such as the label on a static function or variable NAME. */
+
+#undef ASM_OUTPUT_LABEL
+#define ASM_OUTPUT_LABEL(FILE, NAME) \
+ (assemble_name (FILE, NAME), fputs (":\n", FILE))
+
+/* This is how to output an assembler line defining a `double' constant. */
+
+
+/* This is how to output an assembler line defining a `double' constant. */
+
+#undef ASM_OUTPUT_DOUBLE
+#define ASM_OUTPUT_DOUBLE(FILE, VALUE) \
+ { \
+ long t[2]; \
+ REAL_VALUE_TO_TARGET_DOUBLE ((VALUE), t); \
+ fprintf (FILE, "\t.long 0x%lx\n\t.long 0x%lx\n", \
+ t[0] & 0xffffffff, t[1] & 0xffffffff); \
+ }
+
+/* This is how to output an assembler line defining a `float' constant. */
+
+#undef ASM_OUTPUT_FLOAT
+#define ASM_OUTPUT_FLOAT(FILE, VALUE) \
+ { \
+ long t; \
+ REAL_VALUE_TO_TARGET_SINGLE ((VALUE), t); \
+ fprintf (FILE, "\t.long 0x%lx\n", t & 0xffffffff); \
+ }
+
+/* Store in OUTPUT a string (made with alloca) containing
+ an assembler-name for a local static variable named NAME.
+ LABELNO is an integer which is different for each call. */
+
+#undef ASM_FORMAT_PRIVATE_NAME
+#define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
+( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 10), \
+ sprintf ((OUTPUT), "%s.%d", (NAME), (LABELNO)))
+
+
+#define ASM_OUTPUT_DOUBLE_INT(FILE, VALUE) \
+do { fprintf (FILE, "%s\t", ASM_QUAD); \
+ output_addr_const (FILE, (VALUE)); \
+ putc ('\n',FILE); \
+ } while (0)
+
+
+/* This is how to output an assembler line defining an `int' constant. */
+
+#undef ASM_OUTPUT_INT
+#define ASM_OUTPUT_INT(FILE, VALUE) \
+do { fprintf (FILE, "%s\t", ASM_LONG); \
+ output_addr_const (FILE, (VALUE)); \
+ putc ('\n',FILE); \
+ } while (0)
+
+/* Likewise for `char' and `short' constants.
+ is this supposed to do align too?? */
+
+#define ASM_OUTPUT_SHORT(FILE, VALUE) \
+( fprintf (FILE, "%s ", ASM_SHORT), \
+ output_addr_const (FILE, (VALUE)), \
+ putc ('\n',FILE))
+
+#define ASM_OUTPUT_CHAR(FILE, VALUE) \
+( fprintf (FILE, "%s ", ASM_BYTE_OP), \
+ output_addr_const (FILE, (VALUE)), \
+ putc ('\n', FILE))
+
+/* This is how to output an assembler line for a numeric constant byte. */
+
+#define ASM_OUTPUT_BYTE(FILE, VALUE) \
+ fprintf ((FILE), "%s 0x%x\n", ASM_BYTE_OP, (VALUE))
+
+ /* internal macro to output long */
+#define _ASM_OUTPUT_LONG(FILE, VALUE) \
+ fprintf (FILE, "\t.long\t0x%lX\n", VALUE);
+
+
+/* This is how to output an element of a case-vector that is absolute. */
+
+#define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \
+ fprintf (FILE, "%s\t%s%d\n", TARGET_64BIT?ASM_QUAD:ASM_LONG, \
+ LPREFIX, VALUE)
+
+/* This is how to output an element of a case-vector that is relative. */
+
+#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \
+ fprintf (FILE, "%s\t%s%d-%s%d\n", TARGET_64BIT?ASM_QUAD:ASM_LONG, \
+ LPREFIX, VALUE, LPREFIX, REL)
+
+
+/* Define the parentheses used to group arithmetic operations
+ in assembler code. */
+
+#undef ASM_OPEN_PAREN
+#undef ASM_CLOSE_PAREN
+#define ASM_OPEN_PAREN ""
+#define ASM_CLOSE_PAREN ""
+
+
+
+/* This is how to output an assembler line
+ that says to advance the location counter
+ to a multiple of 2**LOG bytes. */
+
+#define ASM_OUTPUT_ALIGN(FILE, LOG) \
+ if ((LOG)!=0) fprintf ((FILE), "\t.align %d\n", 1<<(LOG))
+
+/* This is how to output an assembler line
+ that says to advance the location counter by SIZE bytes. */
+
+#undef ASM_OUTPUT_SKIP
+#define ASM_OUTPUT_SKIP(FILE, SIZE) \
+ fprintf ((FILE), "\t.set .,.+%u\n", (SIZE))
+
+/* This is how to output an assembler line
+ that says to advance the location counter
+ to a multiple of 2**LOG bytes. */
+
+#define ASM_OUTPUT_ALIGN(FILE, LOG) \
+ if ((LOG)!=0) fprintf ((FILE), "\t.align %d\n", 1<<(LOG))
+
+/* This is how to output an assembler line
+ that says to advance the location counter by SIZE bytes. */
+
+#define ASM_OUTPUT_SKIP(FILE, SIZE) \
+ fprintf ((FILE), "\t.set .,.+%u\n", (SIZE))
+
+/* The routine used to output sequences of byte values. We use a special
+ version of this for most svr4 targets because doing so makes the
+ generated assembly code more compact (and thus faster to assemble)
+ as well as more readable. Note that if we find subparts of the
+ character sequence which end with NUL (and which are shorter than
+ STRING_LIMIT) we output those using ASM_OUTPUT_LIMITED_STRING. */
+
+#undef ASM_OUTPUT_ASCII
+#define ASM_OUTPUT_ASCII(FILE, STR, LENGTH) \
+do { \
+ register unsigned char *_ascii_bytes = (unsigned char *) (STR); \
+ register unsigned char *limit = _ascii_bytes + (LENGTH); \
+ register unsigned bytes_in_chunk = 0; \
+ for (; _ascii_bytes < limit; _ascii_bytes++) \
+ { \
+ register unsigned char *p; \
+ if (bytes_in_chunk >= 64) \
+ { \
+ fputc ('\n', (FILE)); \
+ bytes_in_chunk = 0; \
+ } \
+ for (p = _ascii_bytes; p < limit && *p != '\0'; p++) \
+ continue; \
+ if (p < limit && (p - _ascii_bytes) <= STRING_LIMIT) \
+ { \
+ if (bytes_in_chunk > 0) \
+ { \
+ fputc ('\n', (FILE)); \
+ bytes_in_chunk = 0; \
+ } \
+ ASM_OUTPUT_LIMITED_STRING ((FILE), _ascii_bytes); \
+ _ascii_bytes = p; \
+ } \
+ else \
+ { \
+ if (bytes_in_chunk == 0) \
+ fprintf ((FILE), "%s\t", ASM_BYTE_OP); \
+ else \
+ fputc (',', (FILE)); \
+ fprintf ((FILE), "0x%02x", *_ascii_bytes); \
+ bytes_in_chunk += 5; \
+ } \
+ } \
+ if (bytes_in_chunk > 0) \
+ fprintf ((FILE), "\n"); \
+} while (0)
+
+/* Output before read-only data. */
+
+#define TEXT_SECTION_ASM_OP ".text"
+
+/* Output before writable (initialized) data. */
+
+#define DATA_SECTION_ASM_OP ".data"
+
+/* Output before writable (uninitialized) data. */
+
+#define BSS_SECTION_ASM_OP ".bss"
+
+/* This is how to output a command to make the user-level label named NAME
+ defined for reference from other files. */
+
+#define ASM_GLOBALIZE_LABEL(FILE, NAME) \
+ (fputs (".globl ", FILE), assemble_name (FILE, NAME), fputs ("\n", FILE))
+
+#define DBX_REGISTER_NUMBER(REGNO) (REGNO)
+
+/*
+ * This macro generates the assembly code for function entry.
+ */
+
+#define FUNCTION_PROLOGUE(FILE, LSIZE) s390_function_prologue (FILE, LSIZE)
+
+/* This macro generates the assembly code for function exit, on machines
+ that need it. If FUNCTION_EPILOGUE is not defined then individual
+ return instructions are generated for each return statement. Args are
+ same as for FUNCTION_PROLOGUE.
+
+ The function epilogue should not depend on the current stack pointer!
+ It should use the frame pointer only. This is mandatory because
+ of alloca; we also take advantage of it to omit stack adjustments
+ before returning. */
+
+#define FUNCTION_EPILOGUE(FILE, LSIZE) s390_function_epilogue(FILE, LSIZE)
+
+/* Select section for constant in constant pool.
+ We are in the right section.
+ undef for 64 bit mode (linux64.h).
+ */
+
+#undef SELECT_RTX_SECTION
+#define SELECT_RTX_SECTION(MODE, X)
+
+
+/* Output code to add DELTA to the first argument, and then jump to FUNCTION.
+ Used for C++ multiple inheritance. */
+#define ASM_OUTPUT_MI_THUNK(FILE, THUNK_FNDECL, DELTA, FUNCTION) \
+do { \
+ if (TARGET_64BIT) \
+ { \
+ if (flag_pic) \
+ { \
+ fprintf (FILE, "\tlarl 1,0f\n"); \
+ fprintf (FILE, "\tagf %d,0(1)\n", \
+ aggregate_value_p (TREE_TYPE \
+ (TREE_TYPE (FUNCTION))) ? 3 :2 ); \
+ fprintf (FILE, "\tlarl 1,"); \
+ assemble_name (FILE, XSTR (XEXP (DECL_RTL (FUNCTION), 0), 0)); \
+ fprintf (FILE, "@GOTENT\n"); \
+ fprintf (FILE, "\tlg 1,0(1)\n"); \
+ fprintf (FILE, "\tbr 1\n"); \
+ fprintf (FILE, "0:\t.long %d\n",DELTA); \
+ } \
+ else \
+ { \
+ fprintf (FILE, "\tlarl 1,0f\n"); \
+ fprintf (FILE, "\tagf %d,0(1)\n", \
+ aggregate_value_p (TREE_TYPE \
+ (TREE_TYPE (FUNCTION))) ? 3 :2 ); \
+ fprintf (FILE, "\tjg "); \
+ assemble_name (FILE, XSTR (XEXP (DECL_RTL (FUNCTION), 0), 0)); \
+ fprintf (FILE, "\n"); \
+ fprintf (FILE, "0:\t.long %d\n",DELTA); \
+ } \
+ } \
+ else \
+ { \
+ if (flag_pic) \
+ { \
+ fprintf (FILE, "\tbras 1,0f\n"); \
+ fprintf (FILE, "\t.long _GLOBAL_OFFSET_TABLE_-.\n"); \
+ fprintf (FILE, "\t.long "); \
+ assemble_name (FILE, XSTR (XEXP (DECL_RTL (FUNCTION), 0), 0)); \
+ fprintf (FILE, "@GOT\n"); \
+ fprintf (FILE, "\t.long %d\n",DELTA); \
+ fprintf (FILE, "0:\tal %d,8(1)\n", \
+ aggregate_value_p (TREE_TYPE \
+ (TREE_TYPE (FUNCTION))) ? 3 : 2 ); \
+ fprintf (FILE, "\tl 0,4(1)\n"); \
+ fprintf (FILE, "\tal 1,0(1)\n"); \
+ fprintf (FILE, "\talr 1,0\n"); \
+ fprintf (FILE, "\tl 1,0(1)\n"); \
+ fprintf (FILE, "\tbr 1\n"); \
+ } else { \
+ fprintf (FILE, "\tbras 1,0f\n"); \
+ fprintf (FILE, "\t.long "); \
+ assemble_name (FILE, XSTR (XEXP (DECL_RTL (FUNCTION), 0), 0)); \
+ fprintf (FILE, "-.\n"); \
+ fprintf (FILE, "\t.long %d\n",DELTA); \
+ fprintf (FILE, "0:\tal %d,4(1)\n", \
+ aggregate_value_p (TREE_TYPE \
+ (TREE_TYPE (FUNCTION))) ? 3 : 2 ); \
+ fprintf (FILE, "\tal 1,0(1)\n"); \
+ fprintf (FILE, "\tbr 1\n"); \
+ } \
+ } \
+} while (0)
+
+#endif
diff --git a/gcc/config/s390/linux64.h b/gcc/config/s390/linux64.h
new file mode 100644
index 00000000000..1a86715f3d2
--- /dev/null
+++ b/gcc/config/s390/linux64.h
@@ -0,0 +1,80 @@
+/* Definitions for Linux for S/390 64bit.
+ Copyright (C) 2000 Free Software Foundation, Inc.
+ Contributed by Hartmut Penner <hpenner@de.ibm.com>
+
+This file is part of GNU CC.
+
+GNU CC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU CC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU CC; see the file COPYING. If not, write to
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA. */
+
+#ifndef _LINUX64_H
+#define _LINUX64_H
+
+#undef PTRDIFF_TYPE
+#define PTRDIFF_TYPE "long int"
+
+#undef TARGET_DEFAULT
+#define TARGET_DEFAULT 0x13
+
+#undef TARGET_VERSION
+#define TARGET_VERSION fprintf (stderr, " (Linux for S/390 zSeries 64 bit)");
+
+/* Names to predefine in the preprocessor for this target machine. */
+
+#undef CPP_PREDEFINES
+#define CPP_PREDEFINES "-Dlinux -Asystem(linux) -Acpu(s390) -Amachine(s390) -D__s390__ -D__s390x__ -Asystem(unix) -Dunix -D__ELF__"
+
+
+#undef LINK_SPEC
+#ifdef CROSS_COMPILE
+#define LINK_SPEC "-m elf64_s390 %{shared:-shared} \
+ %{!shared: \
+ %{!ibcs: \
+ %{!static: \
+ %{rdynamic:-export-dynamic} \
+ %{!dynamic-linker:-dynamic-linker /lib/ld64.so.1 \
+ -rpath-link=/usr/local/s390x-ibm-linux/lib}} \
+ %{static:-static}}}"
+#else
+#define LINK_SPEC "-m elf64_s390 %{shared:-shared} \
+ %{!shared: \
+ %{!ibcs: \
+ %{!static: \
+ %{rdynamic:-export-dynamic} \
+ %{!dynamic-linker:-dynamic-linker /lib/ld64.so.1}} \
+ %{static:-static}}}"
+#endif
+
+#undef INT_ASM_OP
+#define INT_ASM_OP "\t.quad\t"
+
+#undef PROMOTE_PROTOTYPES
+#undef MASK_RETURN_ADDR
+#undef SELECT_SECTION
+
+/* With 64 bit new linkage for floating point registers. */
+#undef CALL_USED_REGISTERS
+#define CALL_USED_REGISTERS \
+{ 1, 1, 1, 1, \
+ 1, 1, 0, 0, \
+ 0, 0, 0, 0, \
+ 0, 1, 1, 1, \
+ 1, 1, 1, 1, \
+ 1, 1, 1, 1, \
+ 0, 0, 0, 0, \
+ 0, 0, 0, 0, \
+ 1, 1 }
+
+#endif
diff --git a/gcc/config/s390/s390-protos.h b/gcc/config/s390/s390-protos.h
new file mode 100644
index 00000000000..a5f7d8a5746
--- /dev/null
+++ b/gcc/config/s390/s390-protos.h
@@ -0,0 +1,86 @@
+/* Definitions of target machine for GNU compiler, for IBM S/390.
+ Copyright (C) 2000 Free Software Foundation, Inc.
+ Contributed by Hartmut Penner (hpenner@de.ibm.com)
+
+This file is part of GNU CC.
+
+GNU CC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU CC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU CC; see the file COPYING. If not, write to
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA. */
+
+/* Declare functions in s390.c and linux.c */
+
+#ifdef RTX_CODE
+
+#ifdef TREE_CODE
+extern void init_cumulative_args PARAMS ((CUMULATIVE_ARGS *, tree, rtx, int));
+extern void s390_va_start PARAMS ((int, tree, rtx));
+
+#endif /* TREE_CODE */
+
+extern int fp_operand PARAMS ((rtx, enum machine_mode));
+extern int s_operand PARAMS ((rtx, enum machine_mode));
+extern int r_or_im8_operand PARAMS ((rtx, enum machine_mode));
+extern int r_or_s_operand PARAMS ((rtx, enum machine_mode));
+extern int r_or_s_or_im8_operand PARAMS ((rtx, enum machine_mode));
+extern int r_or_x_or_im16_operand PARAMS ((rtx, enum machine_mode));
+extern int bras_sym_operand PARAMS ((rtx, enum machine_mode));
+extern int dead_p PARAMS ((rtx, rtx));
+extern void print_operand PARAMS ((FILE *, rtx, char));
+extern void print_operand_address PARAMS ((FILE *, rtx));
+extern int legitimate_la_operand_p PARAMS ((rtx));
+extern int legitimate_pic_operand_p PARAMS ((rtx));
+extern int legitimate_constant_p PARAMS ((rtx));
+
+extern int unsigned_comparison_operator PARAMS ((rtx));
+extern int unsigned_jump_follows_p PARAMS ((rtx));
+
+extern void update_cc PARAMS ((rtx, rtx));
+
+extern void s390_initialize_trampoline PARAMS ((rtx, rtx, rtx));
+extern void s390_output_symbolic_const PARAMS ((FILE *, rtx));
+extern int s390_adjust_cost PARAMS ((rtx, rtx, rtx, int));
+
+extern int s390_stop_dump_lit_p PARAMS ((rtx));
+extern void s390_dump_literal_pool PARAMS ((rtx, rtx));
+extern void s390_expand_eh_epilogue PARAMS ((rtx, rtx, rtx));
+extern void s390_asm_output_external_libcall PARAMS ((FILE *, rtx));
+
+#endif /* RTX_CODE */
+
+#ifdef TREE_CODE
+extern void s390_function_arg_advance PARAMS ((CUMULATIVE_ARGS *,
+ enum machine_mode,
+ tree, int));
+extern struct rtx_def *s390_function_arg PARAMS ((CUMULATIVE_ARGS *,
+ enum machine_mode, tree, int));
+extern int s390_function_arg_partial_nregs PARAMS ((CUMULATIVE_ARGS *,
+ enum machine_mode, tree, int));
+extern int s390_function_arg_pass_by_reference PARAMS ((enum machine_mode, tree));
+extern void setup_incoming_varargs PARAMS ((CUMULATIVE_ARGS *,
+ enum machine_mode, tree,
+ int *, int));
+extern struct rtx_def *s390_va_arg PARAMS ((tree, tree));
+extern union tree_node *s390_build_va_list PARAMS ((void));
+extern void s390_asm_output_pool_prologue PARAMS ((FILE *, char *, tree, int));
+extern void encode_section_info PARAMS ((tree));
+
+#endif /* TREE_CODE */
+
+
+extern void s390_trampoline_template PARAMS ((FILE *));
+extern int s390_function_prologue PARAMS ((FILE *, int));
+extern int s390_function_epilogue PARAMS ((FILE *, int));
+extern void s390_final_chunkify PARAMS ((int));
+extern int s390_arg_frame_offset PARAMS ((void));
diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c
new file mode 100644
index 00000000000..3dc1dd2f580
--- /dev/null
+++ b/gcc/config/s390/s390.c
@@ -0,0 +1,3182 @@
+/* Subroutines used for code generation on IBM S/390 and zSeries
+ Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
+ Contributed by Hartmut Penner (hpenner@de.ibm.com) and
+ Ulrich Weigand (uweigand@de.ibm.com).
+
+This file is part of GNU CC.
+
+GNU CC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU CC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU CC; see the file COPYING. If not, write to
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA. */
+
+#include "config.h"
+#include "system.h"
+#include "rtl.h"
+#include "expr.h"
+#include "tree.h"
+#include "regs.h"
+#include "hard-reg-set.h"
+#include "real.h"
+#include "insn-config.h"
+#include "conditions.h"
+#include "insn-flags.h"
+#include "output.h"
+#include "insn-attr.h"
+#include "flags.h"
+#include "recog.h"
+#include "math.h"
+#include "obstack.h"
+#include "except.h"
+#include "function.h"
+#include "toplev.h"
+
+#include "tm_p.h"
+
+extern int reload_completed;
+
+/* Function count for creating unique internal labels in a compile unit. */
+int s390_function_count = 0;
+
+/* Save information from a "cmpxx" operation until the branch or scc is
+ emitted. */
+rtx s390_compare_op0, s390_compare_op1;
+
+/* Return TRUE or FALSE depending on whether every SET in INSN that
+ set the CC register has source and destination with matching CC modes,
+ and that the CC mode is at least as constrained as REQ_MODE. */
+
+static int
+s390_match_ccmode_set (set, req_mode)
+ rtx set;
+ int req_mode;
+{
+ int set_mode;
+
+ if (GET_CODE (set) != SET)
+ abort ();
+
+ if (GET_CODE (SET_DEST (set)) != REG || !CC_REGNO_P (REGNO (SET_DEST (set))))
+ return 1;
+
+ set_mode = GET_MODE (SET_DEST (set));
+ switch (set_mode)
+ {
+ case CCmode:
+ return 0;
+
+ case CCSmode:
+ if (req_mode != CCSmode)
+ return 0;
+ break;
+ case CCUmode:
+ if (req_mode != CCUmode)
+ return 0;
+ break;
+ case CCZmode:
+ if (req_mode != CCSmode && req_mode != CCUmode && req_mode != CCTmode)
+ return 0;
+ break;
+
+ default:
+ abort ();
+ }
+
+ return (GET_MODE (SET_SRC (set)) == set_mode);
+}
+
+int
+s390_match_ccmode (insn, req_mode)
+ rtx insn;
+ int req_mode;
+{
+ int i;
+
+ if (GET_CODE (PATTERN (insn)) == SET)
+ return s390_match_ccmode_set (PATTERN (insn), req_mode);
+
+ if (GET_CODE (PATTERN (insn)) == PARALLEL)
+ for (i = 0; i < XVECLEN (PATTERN (insn), 0); i++)
+ {
+ rtx set = XVECEXP (PATTERN (insn), 0, i);
+ if (GET_CODE (set) == SET)
+ if (!s390_match_ccmode_set (set, req_mode))
+ return 0;
+ }
+
+ return 1;
+}
+
+
+void
+optimization_options (level, size)
+ int level;
+ int size ATTRIBUTE_UNUSED;
+{
+#ifdef HAVE_decrement_and_branch_on_count
+ /* When optimizing, enable use of BRCT instruction. */
+ if (level >= 1)
+ flag_branch_on_count_reg = 1;
+#endif
+}
+
+
+/* Map for smallest class containing reg regno. */
+
+enum reg_class regclass_map[FIRST_PSEUDO_REGISTER] =
+{ GENERAL_REGS, ADDR_REGS, ADDR_REGS, ADDR_REGS,
+ ADDR_REGS, ADDR_REGS, ADDR_REGS, ADDR_REGS,
+ ADDR_REGS, ADDR_REGS, ADDR_REGS, ADDR_REGS,
+ ADDR_REGS, ADDR_REGS, ADDR_REGS, ADDR_REGS,
+ FP_REGS, FP_REGS, FP_REGS, FP_REGS,
+ FP_REGS, FP_REGS, FP_REGS, FP_REGS,
+ FP_REGS, FP_REGS, FP_REGS, FP_REGS,
+ FP_REGS, FP_REGS, FP_REGS, FP_REGS,
+ ADDR_REGS, NO_REGS
+};
+
+
+/* Match exactly zero. */
+
+int
+const0_operand (op, mode)
+ register rtx op;
+ enum machine_mode mode;
+{
+ return op == CONST0_RTX (mode);
+}
+
+/* Match exactly one. */
+
+int
+const1_operand (op, mode)
+ register rtx op;
+ enum machine_mode mode;
+{
+ return op == CONST1_RTX (mode);
+}
+
+
+/* Return 1 if OP needs base and index register. */
+
+static int
+base_n_index_p (rtx op)
+{
+ if ((GET_CODE (op) == PLUS) &&
+ (GET_CODE (XEXP (op, 0)) == PLUS ||
+ GET_CODE (XEXP (op, 1)) == PLUS ||
+ GET_CODE (XEXP (op, 1)) == REG ))
+ return 1;
+ return 0;
+}
+
+/* Check mode and mode of op, set it to mode of op, if VOIDmode. */
+
+static int
+check_mode (op, mode)
+ register rtx op;
+ enum machine_mode *mode;
+{
+ if (*mode == VOIDmode)
+ *mode = GET_MODE (op);
+ else
+ {
+ if (GET_MODE (op) != VOIDmode && GET_MODE (op) != *mode)
+ return 0;
+ }
+ return 1;
+}
+
+
+/* Return 1 if OP a valid operand for the LARL instruction.
+ OP is the current operation.
+ MODE is the current operation mode. */
+
+int
+larl_operand (op, mode)
+ register rtx op;
+ enum machine_mode mode;
+{
+ rtx sym;
+ register enum rtx_code code = GET_CODE (op);
+
+ if (! check_mode (op, &mode))
+ return 0;
+
+ /* Allow labels and local symbols. */
+ if (GET_CODE (op) == LABEL_REF)
+ return 1;
+ if (GET_CODE (op) == SYMBOL_REF
+ && (!flag_pic || SYMBOL_REF_FLAG (op)
+ || CONSTANT_POOL_ADDRESS_P (op)))
+ return 1;
+
+ /* Everything else must have a CONST, so strip it. */
+ if (GET_CODE (op) != CONST)
+ return 0;
+ op = XEXP (op, 0);
+
+ /* Allow adding *even* constants. */
+ if (GET_CODE (op) == PLUS)
+ {
+ if (GET_CODE (XEXP (op, 1)) != CONST_INT
+ || (INTVAL (XEXP (op, 1)) & 1) != 0)
+ return 0;
+ op = XEXP (op, 0);
+ }
+
+ /* Labels and local symbols allowed here as well. */
+ if (GET_CODE (op) == LABEL_REF)
+ return 1;
+ if (GET_CODE (op) == SYMBOL_REF
+ && (!flag_pic || SYMBOL_REF_FLAG (op)
+ || CONSTANT_POOL_ADDRESS_P (op)))
+ return 1;
+
+ /* Now we must have a @GOTENT offset or @PLT stub. */
+ if (GET_CODE (op) == UNSPEC
+ && XINT (op, 1) == 111)
+ return 1;
+ if (GET_CODE (op) == UNSPEC
+ && XINT (op, 1) == 113)
+ return 1;
+
+ return 0;
+}
+
+/* Return 1 if OP is a valid FP-Register.
+ OP is the current operation.
+ MODE is the current operation mode. */
+
+int
+fp_operand (op, mode)
+ register rtx op;
+ enum machine_mode mode;
+{
+ register enum rtx_code code = GET_CODE (op);
+ if (! check_mode (op, &mode))
+ return 0;
+ if (code == REG && REGNO_OK_FOR_FP_P (REGNO (op)))
+ return 1;
+ else
+ return 0;
+}
+
+/* Return 1 if OP is a valid S operand for an RS, SI or SS type instruction. */
+
+int
+s_operand (op, mode)
+ register rtx op;
+ enum machine_mode mode;
+{
+ register enum rtx_code code = GET_CODE (op);
+
+ if (! check_mode (op,&mode))
+ return 0;
+
+ if (code == MEM) {
+ if (base_n_index_p (XEXP (op, 0)))
+ return 0;
+ }
+
+ return memory_operand (op, mode);
+}
+
+/* Return 1 if OP is a valid R or S operand for an RS, SI or SS type
+ instruction. */
+
+int
+r_or_s_operand (op, mode)
+ register rtx op;
+ enum machine_mode mode;
+{
+ register enum rtx_code code = GET_CODE (op);
+
+ if (!general_operand (op, mode))
+ return 0;
+
+ if (code == MEM) {
+ if (base_n_index_p (XEXP (op, 0)))
+ return 0;
+ else
+ return memory_operand (op, mode);
+ }
+ return register_operand (op, mode);
+}
+
+/* Return 1 if OP is a valid R or S or immediate operand for
+ RS, SI or SS type instruction. */
+
+int
+r_or_s_or_im8_operand (op, mode)
+ register rtx op;
+ enum machine_mode mode;
+{
+ register enum rtx_code code = GET_CODE (op);
+
+ if (!general_operand (op, mode))
+ return 0;
+
+ if (code == MEM) {
+ if (base_n_index_p (XEXP (op, 0)))
+ return 0;
+ else
+ return memory_operand (op, mode);
+ }
+ return register_operand (op, mode) || immediate_operand (op, mode);
+}
+
+/* Return 1 if OP is a valid R or X or 16 bit immediate operand for
+ RX, RR or RI type instruction. */
+
+int
+r_or_x_or_im16_operand (op, mode)
+ register rtx op;
+ enum machine_mode mode;
+{
+
+ if (! general_operand (op, mode))
+ return 0;
+
+ if (GET_CODE (op) == CONST_INT)
+ return (CONST_OK_FOR_LETTER_P (INTVAL (op), 'K'));
+ return register_operand (op, mode) || memory_operand (op, mode);
+}
+
+/* Return 1 if OP is a valid R or 8 bit immediate operand for
+ !!!!!!! type instruction. */
+
+int
+r_or_im8_operand (op, mode)
+ register rtx op;
+ enum machine_mode mode;
+{
+
+ if (!general_operand (op, mode))
+ return 0;
+
+ if (GET_CODE (op) == CONST_INT)
+ return (CONST_OK_FOR_LETTER_P (INTVAL (op), 'J'));
+ return register_operand (op, mode) || memory_operand (op, mode);
+}
+
+/* Return 1 if OP is a valid operand for the 'test under mask'
+ instruction with 16 bit immediate.
+ The value should only have set bits in one halfword. */
+
+int
+tmxx_operand (op, mode)
+ register rtx op;
+ enum machine_mode mode;
+{
+ rtx con;
+ if (GET_CODE (op) == CONST_INT)
+ return (CONST_OK_FOR_LETTER_P (INTVAL (op), 'L'));
+ if (GET_CODE (op) == MEM && GET_CODE (XEXP (op, 0)) == SYMBOL_REF &&
+ CONSTANT_POOL_ADDRESS_P (XEXP (op, 0)))
+ {
+ con = get_pool_constant (XEXP (op, 0));
+
+ if (GET_CODE (con) == CONST_INT)
+ {
+ unsigned HOST_WIDEST_INT c;
+
+ c = (unsigned HOST_WIDEST_INT) INTVAL (con);
+
+ return ((c & 0xffff) ? ((c & 0xffffffffffff0000ULL)==0) :
+ (c & 0xffff0000) ? ((c & 0xffffffff0000ffffULL)==0) :
+ (c & 0xffff00000000ULL) ? ((c & 0xffff0000ffffffffULL)==0) :
+ (c & 0xffff000000000000ULL) ? ((c & 0xffffffffffffULL)==0) : 1);
+
+ }
+ }
+ return 0;
+}
+
+
+/* Return 1 if valid operand for BRAS
+ OP is the current operation.
+ MODE is the current operation mode. */
+
+int
+bras_sym_operand (op, mode)
+ register rtx op;
+ enum machine_mode mode;
+{
+ register enum rtx_code code = GET_CODE (op);
+
+ /* Allow SYMBOL_REFs. */
+ if (code == SYMBOL_REF)
+ return 1;
+
+ /* Allow @PLT stubs. */
+ if (code == CONST
+ && GET_CODE (XEXP (op, 0)) == UNSPEC
+ && XINT (XEXP (op, 0), 1) == 113)
+ return 1;
+ return 0;
+}
+
+
+/* Return 1 if OP is a load multiple operation. It is known to be a
+ PARALLEL and the first section will be tested. */
+
+int
+load_multiple_operation (op, mode)
+ rtx op;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
+{
+ int count = XVECLEN (op, 0);
+ unsigned int dest_regno;
+ rtx src_addr;
+ int i;
+
+
+ /* Perform a quick check so we don't blow up below. */
+ if (count <= 1
+ || GET_CODE (XVECEXP (op, 0, 0)) != SET
+ || GET_CODE (SET_DEST (XVECEXP (op, 0, 0))) != REG
+ || GET_CODE (SET_SRC (XVECEXP (op, 0, 0))) != MEM)
+ return 0;
+
+ dest_regno = REGNO (SET_DEST (XVECEXP (op, 0, 0)));
+ src_addr = XEXP (SET_SRC (XVECEXP (op, 0, 0)), 0);
+
+ for (i = 1; i < count; i++)
+ {
+ rtx elt = XVECEXP (op, 0, i);
+
+ if (GET_CODE (elt) != SET
+ || GET_CODE (SET_DEST (elt)) != REG
+ || GET_MODE (SET_DEST (elt)) != Pmode
+ || REGNO (SET_DEST (elt)) != dest_regno + i
+ || GET_CODE (SET_SRC (elt)) != MEM
+ || GET_MODE (SET_SRC (elt)) != Pmode
+ || GET_CODE (XEXP (SET_SRC (elt), 0)) != PLUS
+ || ! rtx_equal_p (XEXP (XEXP (SET_SRC (elt), 0), 0), src_addr)
+ || GET_CODE (XEXP (XEXP (SET_SRC (elt), 0), 1)) != CONST_INT
+ || INTVAL (XEXP (XEXP (SET_SRC (elt), 0), 1)) != i * 4)
+ return 0;
+ }
+
+ return 1;
+}
+
+/* Similar, but tests for store multiple. */
+
+int
+store_multiple_operation (op, mode)
+ rtx op;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
+{
+ int count = XVECLEN (op, 0) - 1;
+ unsigned int src_regno;
+ rtx dest_addr;
+ int i;
+
+ /* Perform a quick check so we don't blow up below. */
+ if (count <= 1
+ || GET_CODE (XVECEXP (op, 0, 0)) != SET
+ || GET_CODE (SET_DEST (XVECEXP (op, 0, 0))) != MEM
+ || GET_CODE (SET_SRC (XVECEXP (op, 0, 0))) != REG)
+ return 0;
+
+ src_regno = REGNO (SET_SRC (XVECEXP (op, 0, 0)));
+ dest_addr = XEXP (SET_DEST (XVECEXP (op, 0, 0)), 0);
+
+ for (i = 1; i < count; i++)
+ {
+ rtx elt = XVECEXP (op, 0, i);
+
+ if (GET_CODE (elt) != SET
+ || GET_CODE (SET_SRC (elt)) != REG
+ || GET_MODE (SET_SRC (elt)) != Pmode
+ || REGNO (SET_SRC (elt)) != src_regno + i
+ || GET_CODE (SET_DEST (elt)) != MEM
+ || GET_MODE (SET_DEST (elt)) != Pmode
+ || GET_CODE (XEXP (SET_DEST (elt), 0)) != PLUS
+ || ! rtx_equal_p (XEXP (XEXP (SET_DEST (elt), 0), 0), dest_addr)
+ || GET_CODE (XEXP (XEXP (SET_DEST (elt), 0), 1)) != CONST_INT
+ || INTVAL (XEXP (XEXP (SET_DEST (elt), 0), 1)) != i * 4)
+ return 0;
+ }
+ return 1;
+}
+
+
+/* Returns 1 if OP contains a symbol reference */
+
+int
+symbolic_reference_mentioned_p (op)
+ rtx op;
+{
+ register char *fmt;
+ register int i;
+
+ if (GET_CODE (op) == SYMBOL_REF || GET_CODE (op) == LABEL_REF)
+ return 1;
+
+ fmt = GET_RTX_FORMAT (GET_CODE (op));
+ for (i = GET_RTX_LENGTH (GET_CODE (op)) - 1; i >= 0; i--)
+ {
+ if (fmt[i] == 'E')
+ {
+ register int j;
+
+ for (j = XVECLEN (op, i) - 1; j >= 0; j--)
+ if (symbolic_reference_mentioned_p (XVECEXP (op, i, j)))
+ return 1;
+ }
+
+ else if (fmt[i] == 'e' && symbolic_reference_mentioned_p (XEXP (op, i)))
+ return 1;
+ }
+
+ return 0;
+}
+
+
+/* Returns 1 if OP is a legitimate general operand when
+ generating PIC code. It is given that flag_pic is on
+ and that OP satisfies CONSTANT_P or is a CONST_DOUBLE. */
+
+int
+legitimate_pic_operand_p (op)
+ register rtx op;
+{
+ /* All non-symbolic constants that made it
+ up to here are fine. */
+ if (!SYMBOLIC_CONST (op))
+ return 1;
+
+ /* Accept immediate LARL operands. */
+ if (TARGET_64BIT)
+ return larl_operand (op, VOIDmode);
+
+ /* Reject everything else; must be handled
+ via emit_pic_move. */
+ return 0;
+}
+
+/* Returns 1 if the constant value OP is a legitimate general operand.
+ It is given that OP satisfies CONSTANT_P or is a CONST_DOUBLE. */
+
+int
+legitimate_constant_p (op)
+ register rtx op;
+{
+ /* Reject doubles and integers out of range. */
+ if (GET_CODE (op) == CONST_DOUBLE ||
+ (GET_CODE (op) == CONST_INT &&
+ (INTVAL (op) < -32768 || INTVAL (op) > 32767)))
+ return 0;
+
+ /* Accept all other non-symbolic constants. */
+ if (!SYMBOLIC_CONST (op))
+ return 1;
+
+ /* In the PIC case, symbolic constants must *not* be
+ forced into the literal pool. We accept them here,
+ so that they will be handled by emit_pic_move. */
+ if (flag_pic)
+ return 1;
+
+ /* Even in the non-PIC case, we can accept immediate
+ LARL operands here. */
+ if (TARGET_64BIT)
+ return larl_operand (op, VOIDmode);
+
+ /* All remaining non-PIC symbolic constants are
+ forced into the literal pool. */
+ return 0;
+}
+
+
+/* Structure used to hold the components of a S/390 memory
+ address. A legitimate address on S/390 is of the general
+ form
+ base + index + displacement
+ where any of the components is optional.
+
+ base and index are registers of the class ADDR_REGS,
+ displacement is an unsigned 12-bit immediate constant. */
+
+struct s390_address
+{
+ rtx base;
+ rtx indx;
+ rtx disp;
+};
+
+/* Decompose a RTL expression ADDR for a memory address into
+ its components, returned in OUT. The boolean STRICT
+ specifies whether strict register checking applies.
+ Returns 0 if ADDR is not a valid memory address, nonzero
+ otherwise. If OUT is NULL, don't return the components,
+ but check for validity only.
+
+ Note: Only addresses in canonical form are recognized.
+ LEGITIMIZE_ADDRESS should convert non-canonical forms to the
+ canonical form so that they will be recognized. */
+
+static int
+s390_decompose_address (addr, out, strict)
+ register rtx addr;
+ struct s390_address *out;
+ int strict;
+{
+ rtx base = NULL_RTX;
+ rtx indx = NULL_RTX;
+ rtx disp = NULL_RTX;
+
+ /* Decompose address into base + index + displacement. */
+
+ if (GET_CODE (addr) == REG || GET_CODE (addr) == UNSPEC)
+ base = addr;
+
+ else if (GET_CODE (addr) == PLUS)
+ {
+ rtx op0 = XEXP (addr, 0);
+ rtx op1 = XEXP (addr, 1);
+ enum rtx_code code0 = GET_CODE (op0);
+ enum rtx_code code1 = GET_CODE (op1);
+
+ if (code0 == REG || code0 == UNSPEC)
+ {
+ if (code1 == REG || code1 == UNSPEC)
+ {
+ indx = op0; /* index + base */
+ base = op1;
+ }
+
+ else
+ {
+ base = op0; /* base + displacement */
+ disp = op1;
+ }
+ }
+
+ else if (code0 == PLUS)
+ {
+ indx = XEXP (op0, 0); /* index + base + disp */
+ base = XEXP (op0, 1);
+ disp = op1;
+ }
+
+ else
+ {
+ return FALSE;
+ }
+ }
+
+ else
+ disp = addr; /* displacement */
+
+
+ /* Validate base register. */
+ if (base)
+ {
+ if (GET_CODE (base) == UNSPEC)
+ {
+ if (XVECLEN (base, 0) != 1 || XINT (base, 1) != 101)
+ return FALSE;
+ base = XVECEXP (base, 0, 0);
+ }
+
+ if (GET_CODE (base) != REG || GET_MODE (base) != Pmode)
+ return FALSE;
+
+ if ((strict && ! REG_OK_FOR_BASE_STRICT_P (base))
+ || (! strict && ! REG_OK_FOR_BASE_NONSTRICT_P (base)))
+ return FALSE;
+ }
+
+ /* Validate index register. */
+ if (indx)
+ {
+ if (GET_CODE (indx) == UNSPEC)
+ {
+ if (XVECLEN (indx, 0) != 1 || XINT (indx, 1) != 101)
+ return FALSE;
+ indx = XVECEXP (indx, 0, 0);
+ }
+
+ if (GET_CODE (indx) != REG || GET_MODE (indx) != Pmode)
+ return FALSE;
+
+ if ((strict && ! REG_OK_FOR_BASE_STRICT_P (indx))
+ || (! strict && ! REG_OK_FOR_BASE_NONSTRICT_P (indx)))
+ return FALSE;
+ }
+
+ /* Validate displacement. */
+ if (disp)
+ {
+ /* Allow integer constant in range. */
+ if (GET_CODE (disp) == CONST_INT)
+ {
+ if (INTVAL (disp) < 0 || INTVAL (disp) >= 4096)
+ return FALSE;
+ }
+
+ /* In the small-PIC case, the linker converts @GOT12
+ offsets to possible displacements. */
+ else if (GET_CODE (disp) == CONST
+ && GET_CODE (XEXP (disp, 0)) == UNSPEC
+ && XINT (XEXP (disp, 0), 1) == 110)
+ {
+ if (flag_pic != 1)
+ return FALSE;
+ }
+
+ /* We can convert literal pool addresses to
+ displacements by basing them off the base register. */
+ else
+ {
+ /* In some cases, we can accept an additional
+ small constant offset. Split these off here. */
+
+ int offset = 0;
+
+ if (GET_CODE (disp) == CONST
+ && GET_CODE (XEXP (disp, 0)) == PLUS
+ && GET_CODE (XEXP (XEXP (disp, 0), 1)) == CONST_INT)
+ {
+ offset = INTVAL (XEXP (XEXP (disp, 0), 1));
+ disp = XEXP (XEXP (disp, 0), 0);
+ }
+
+ /* Now we must have a literal pool address. */
+ if (GET_CODE (disp) != SYMBOL_REF
+ || !CONSTANT_POOL_ADDRESS_P (disp))
+ return FALSE;
+
+ /* In 64-bit PIC mode we cannot accept symbolic
+ constants in the constant pool. */
+ if (TARGET_64BIT && flag_pic
+ && SYMBOLIC_CONST (get_pool_constant (disp)))
+ return FALSE;
+
+ /* If we have an offset, make sure it does not
+ exceed the size of the constant pool entry. */
+ if (offset && offset >= GET_MODE_SIZE (get_pool_mode (disp)))
+ return FALSE;
+
+ /* Either base or index must be free to
+ hold the base register. */
+ if (base && indx)
+ return FALSE;
+
+ /* Convert the address. */
+ if (base)
+ indx = gen_rtx_REG (Pmode, BASE_REGISTER);
+ else
+ base = gen_rtx_REG (Pmode, BASE_REGISTER);
+
+ disp = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, disp), 100);
+ disp = gen_rtx_CONST (Pmode, disp);
+
+ if (offset)
+ disp = plus_constant (disp, offset);
+ }
+ }
+
+ if (out)
+ {
+ out->base = base;
+ out->indx = indx;
+ out->disp = disp;
+ }
+
+ return TRUE;
+}
+
+/* Returns nonzero if ADDR is a valid memory address.
+ STRICT specifies whether strict register checking applies. */
+
+int
+legitimate_address_p (mode, addr, strict)
+ enum machine_mode mode;
+ register rtx addr;
+ int strict;
+{
+ return s390_decompose_address (addr, NULL, strict);
+}
+
+/* Return 1 if OP is a valid operand for the LA instruction.
+ In 31-bit, we need to prove that the result is used as an
+ address, as LA performs only a 31-bit addition. */
+
+int
+legitimate_la_operand_p (op)
+ register rtx op;
+{
+ struct s390_address addr;
+ if (!s390_decompose_address (op, &addr, FALSE))
+ return FALSE;
+
+ if (TARGET_64BIT)
+ return TRUE;
+
+ /* Use of the base or stack pointer implies address. */
+
+ if (addr.base && GET_CODE (addr.base) == REG)
+ {
+ if (REGNO (addr.base) == BASE_REGISTER
+ || REGNO (addr.base) == STACK_POINTER_REGNUM)
+ return TRUE;
+ }
+
+ if (addr.indx && GET_CODE (addr.indx) == REG)
+ {
+ if (REGNO (addr.indx) == BASE_REGISTER
+ || REGNO (addr.indx) == STACK_POINTER_REGNUM)
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+/* Return a legitimate reference for ORIG (an address) using the
+ register REG. If REG is 0, a new pseudo is generated.
+
+ There are two types of references that must be handled:
+
+ 1. Global data references must load the address from the GOT, via
+ the PIC reg. An insn is emitted to do this load, and the reg is
+ returned.
+
+ 2. Static data references, constant pool addresses, and code labels
+ compute the address as an offset from the GOT, whose base is in
+ the PIC reg. Static data objects have SYMBOL_REF_FLAG set to
+ differentiate them from global data objects. The returned
+ address is the PIC reg + an unspec constant.
+
+ GO_IF_LEGITIMATE_ADDRESS rejects symbolic references unless the PIC
+ reg also appears in the address. */
+
+rtx
+legitimize_pic_address (orig, reg)
+ rtx orig;
+ rtx reg;
+{
+ rtx addr = orig;
+ rtx new = orig;
+ rtx base;
+
+ if (GET_CODE (addr) == LABEL_REF
+ || (GET_CODE (addr) == SYMBOL_REF
+ && (SYMBOL_REF_FLAG (addr)
+ || CONSTANT_POOL_ADDRESS_P (addr))))
+ {
+ /* This is a local symbol. */
+ if (TARGET_64BIT)
+ {
+ /* Access local symbols PC-relative via LARL.
+ This is the same as in the non-PIC case, so it is
+ handled automatically ... */
+ }
+ else
+ {
+ /* Access local symbols relative to the literal pool. */
+
+ rtx temp = reg? reg : gen_reg_rtx (Pmode);
+
+ addr = gen_rtx_UNSPEC (SImode, gen_rtvec (1, addr), 100);
+ addr = gen_rtx_CONST (SImode, addr);
+ addr = force_const_mem (SImode, addr);
+ emit_move_insn (temp, addr);
+
+ base = gen_rtx_REG (Pmode, BASE_REGISTER);
+ base = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, base), 101);
+ new = gen_rtx_PLUS (Pmode, base, temp);
+
+ if (reg != 0)
+ {
+ emit_move_insn (reg, new);
+ new = reg;
+ }
+ }
+ }
+ else if (GET_CODE (addr) == SYMBOL_REF)
+ {
+ if (reg == 0)
+ reg = gen_reg_rtx (Pmode);
+
+ if (flag_pic == 1)
+ {
+ /* Assume GOT offset < 4k. This is handled the same way
+ in both 31- and 64-bit code (@GOT12). */
+
+ current_function_uses_pic_offset_table = 1;
+
+ new = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, addr), 110);
+ new = gen_rtx_CONST (Pmode, new);
+ new = gen_rtx_PLUS (Pmode, pic_offset_table_rtx, new);
+ new = gen_rtx_MEM (Pmode, new);
+ RTX_UNCHANGING_P (new) = 1;
+ emit_move_insn (reg, new);
+ new = reg;
+ }
+ else if (TARGET_64BIT)
+ {
+ /* If the GOT offset might be >= 4k, we determine the position
+ of the GOT entry via a PC-relative LARL (@GOTENT). */
+
+ rtx temp = gen_reg_rtx (Pmode);
+
+ new = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, addr), 111);
+ new = gen_rtx_CONST (Pmode, new);
+ emit_move_insn (temp, new);
+
+ new = gen_rtx_MEM (Pmode, temp);
+ RTX_UNCHANGING_P (new) = 1;
+ emit_move_insn (reg, new);
+ new = reg;
+ }
+ else
+ {
+ /* If the GOT offset might be >= 4k, we have to load it
+ from the literal pool (@GOT). */
+
+ rtx temp = gen_reg_rtx (Pmode);
+
+ current_function_uses_pic_offset_table = 1;
+
+ addr = gen_rtx_UNSPEC (SImode, gen_rtvec (1, addr), 112);
+ addr = gen_rtx_CONST (SImode, addr);
+ addr = force_const_mem (SImode, addr);
+ emit_move_insn (temp, addr);
+
+ new = gen_rtx_PLUS (Pmode, pic_offset_table_rtx, temp);
+ new = gen_rtx_MEM (Pmode, new);
+ RTX_UNCHANGING_P (new) = 1;
+ emit_move_insn (reg, new);
+ new = reg;
+ }
+ }
+ else
+ {
+ if (GET_CODE (addr) == CONST)
+ {
+ addr = XEXP (addr, 0);
+ if (GET_CODE (addr) == UNSPEC)
+ {
+ if (XVECLEN (addr, 0) != 1)
+ abort ();
+ switch (XINT (addr, 1))
+ {
+ /* If someone moved an @GOT or lt-relative UNSPEC
+ out of the literal pool, force them back in. */
+ case 100:
+ case 112:
+ case 114:
+ new = force_const_mem (SImode, orig);
+ break;
+
+ /* @GOTENT is OK as is. */
+ case 111:
+ break;
+
+ /* @PLT is OK as is on 64-bit, must be converted to
+ lt-relative PLT on 31-bit. */
+ case 113:
+ if (!TARGET_64BIT)
+ {
+ rtx temp = reg? reg : gen_reg_rtx (Pmode);
+
+ addr = XVECEXP (addr, 0, 0);
+ addr = gen_rtx_UNSPEC (SImode, gen_rtvec (1, addr), 114);
+ addr = gen_rtx_CONST (SImode, addr);
+ addr = force_const_mem (SImode, addr);
+ emit_move_insn (temp, addr);
+
+ base = gen_rtx_REG (Pmode, BASE_REGISTER);
+ base = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, base), 101);
+ new = gen_rtx_PLUS (Pmode, base, temp);
+
+ if (reg != 0)
+ {
+ emit_move_insn (reg, new);
+ new = reg;
+ }
+ }
+ break;
+
+ /* Everything else cannot happen. */
+ default:
+ abort ();
+ }
+ }
+ else if (GET_CODE (addr) != PLUS)
+ abort ();
+ }
+ if (GET_CODE (addr) == PLUS)
+ {
+ rtx op0 = XEXP (addr, 0), op1 = XEXP (addr, 1);
+ /* Check first to see if this is a constant offset
+ from a local symbol reference. */
+ if ((GET_CODE (op0) == LABEL_REF
+ || (GET_CODE (op0) == SYMBOL_REF
+ && (SYMBOL_REF_FLAG (op0)
+ || CONSTANT_POOL_ADDRESS_P (op0))))
+ && GET_CODE (op1) == CONST_INT)
+ {
+ if (TARGET_64BIT)
+ {
+ if (INTVAL (op1) & 1)
+ {
+ /* LARL can't handle odd offsets, so emit a
+ pair of LARL and LA. */
+ rtx temp = reg? reg : gen_reg_rtx (Pmode);
+
+ if (INTVAL (op1) < 0 || INTVAL (op1) >= 4096)
+ {
+ int even = INTVAL (op1) - 1;
+ op0 = gen_rtx_PLUS (Pmode, op0, GEN_INT (even));
+ op1 = GEN_INT (1);
+ }
+
+ emit_move_insn (temp, op0);
+ new = gen_rtx_PLUS (Pmode, temp, op1);
+
+ if (reg != 0)
+ {
+ emit_move_insn (reg, new);
+ new = reg;
+ }
+ }
+ else
+ {
+ /* If the offset is even, we can just use LARL.
+ This will happen automatically. */
+ }
+ }
+ else
+ {
+ /* Access local symbols relative to the literal pool. */
+
+ rtx temp = reg? reg : gen_reg_rtx (Pmode);
+
+ addr = gen_rtx_UNSPEC (SImode, gen_rtvec (1, op0), 100);
+ addr = gen_rtx_PLUS (SImode, addr, op1);
+ addr = gen_rtx_CONST (SImode, addr);
+ addr = force_const_mem (SImode, addr);
+ emit_move_insn (temp, addr);
+
+ base = gen_rtx_REG (Pmode, BASE_REGISTER);
+ base = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, base), 101);
+ new = gen_rtx_PLUS (Pmode, base, temp);
+
+ if (reg != 0)
+ {
+ emit_move_insn (reg, new);
+ new = reg;
+ }
+ }
+ }
+
+ /* Now, check whether it is an LT-relative symbol plus offset
+ that was pulled out of the literal pool. Force it back in. */
+
+ else if (GET_CODE (op0) == UNSPEC
+ && GET_CODE (op1) == CONST_INT)
+ {
+ if (XVECLEN (op0, 0) != 1)
+ abort ();
+ if (XINT (op0, 1) != 100)
+ abort ();
+
+ new = force_const_mem (SImode, orig);
+ }
+
+ /* Otherwise, compute the sum. */
+ else
+ {
+ base = legitimize_pic_address (XEXP (addr, 0), reg);
+ new = legitimize_pic_address (XEXP (addr, 1),
+ base == reg ? NULL_RTX : reg);
+ if (GET_CODE (new) == CONST_INT)
+ new = plus_constant (base, INTVAL (new));
+ else
+ {
+ if (GET_CODE (new) == PLUS && CONSTANT_P (XEXP (new, 1)))
+ {
+ base = gen_rtx_PLUS (Pmode, base, XEXP (new, 0));
+ new = XEXP (new, 1);
+ }
+ new = gen_rtx_PLUS (Pmode, base, new);
+ }
+
+ if (GET_CODE (new) == CONST)
+ new = XEXP (new, 0);
+ new = force_operand (new, 0);
+ }
+ }
+ }
+ return new;
+}
+
+/* Emit insns to move operands[1] into operands[0]. */
+
+void
+emit_pic_move (operands, mode)
+ rtx *operands;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
+{
+ rtx temp = reload_in_progress ? operands[0] : gen_reg_rtx (Pmode);
+
+ if (GET_CODE (operands[0]) == MEM && SYMBOLIC_CONST (operands[1]))
+ operands[1] = force_reg (Pmode, operands[1]);
+ else
+ operands[1] = legitimize_pic_address (operands[1], temp);
+}
+
+/* Try machine-dependent ways of modifying an illegitimate address
+ to be legitimate. If we find one, return the new, valid address.
+ This macro is used in only one place: `memory_address' in explow.c.
+
+ OLDX is the address as it was before break_out_memory_refs was called.
+ In some cases it is useful to look at this to decide what needs to be done.
+
+ MODE and WIN are passed so that this macro can use
+ GO_IF_LEGITIMATE_ADDRESS.
+
+ It is always safe for this macro to do nothing. It exists to recognize
+ opportunities to optimize the output.
+
+ When -fpic is used, special handling is needed for symbolic references.
+ See comments by legitimize_pic_address for details. */
+
+rtx
+legitimize_address (x, oldx, mode)
+ register rtx x;
+ register rtx oldx ATTRIBUTE_UNUSED;
+ enum machine_mode mode;
+{
+ rtx constant_term = const0_rtx;
+
+ if (flag_pic)
+ {
+ if (SYMBOLIC_CONST (x)
+ || (GET_CODE (x) == PLUS
+ && (SYMBOLIC_CONST (XEXP (x, 0))
+ || SYMBOLIC_CONST (XEXP (x, 1)))))
+ x = legitimize_pic_address (x, 0);
+
+ if (legitimate_address_p (mode, x, FALSE))
+ return x;
+ }
+
+ x = eliminate_constant_term (x, &constant_term);
+
+ if (GET_CODE (x) == PLUS)
+ {
+ if (GET_CODE (XEXP (x, 0)) == REG)
+ {
+ register rtx temp = gen_reg_rtx (Pmode);
+ register rtx val = force_operand (XEXP (x, 1), temp);
+ if (val != temp)
+ emit_move_insn (temp, val);
+
+ x = gen_rtx_PLUS (Pmode, XEXP (x, 0), temp);
+ }
+
+ else if (GET_CODE (XEXP (x, 1)) == REG)
+ {
+ register rtx temp = gen_reg_rtx (Pmode);
+ register rtx val = force_operand (XEXP (x, 0), temp);
+ if (val != temp)
+ emit_move_insn (temp, val);
+
+ x = gen_rtx_PLUS (Pmode, temp, XEXP (x, 1));
+ }
+ }
+
+ if (constant_term != const0_rtx)
+ x = gen_rtx_PLUS (Pmode, x, constant_term);
+
+ return x;
+}
+
+
+/* Output branch condition code of RTX code in assembler
+ syntax to stdio stream FILE. */
+
+static void
+output_branch_condition (FILE *file, rtx code)
+{
+ switch (GET_CODE (code))
+ {
+ case EQ:
+ fprintf (file, "e");
+ break;
+ case NE:
+ fprintf (file, "ne");
+ break;
+ case GT:
+ case GTU:
+ fprintf (file, "h");
+ break;
+ case LT:
+ case LTU:
+ fprintf (file, "l");
+ break;
+ case GE:
+ case GEU:
+ fprintf (file, "he");
+ break;
+ case LE:
+ case LEU:
+ fprintf (file, "le");
+ break;
+ default:
+ fatal_insn ("Unknown CC code", code);
+ }
+}
+
+/* Output the inverse of the branch condition code of RTX code
+ in assembler syntax to stdio stream FILE. */
+
+static void
+output_inverse_branch_condition (FILE *file, rtx code)
+{
+ switch (GET_CODE (code))
+ {
+ case EQ:
+ fprintf (file, "ne");
+ break;
+ case NE:
+ fprintf (file, "e");
+ break;
+ case GT:
+ case GTU:
+ fprintf (file, "nh");
+ break;
+ case LT:
+ case LTU:
+ fprintf (file, "nl");
+ break;
+ case GE:
+ case GEU:
+ fprintf (file, "nhe");
+ break;
+ case LE:
+ case LEU:
+ fprintf (file, "nle");
+ break;
+ default:
+ fatal_insn ("Unknown CC code", code);
+ }
+}
+
+/* Output symbolic constant X in assembler syntax to
+ stdio stream FILE. */
+
+void
+s390_output_symbolic_const (FILE *file, rtx x)
+{
+ switch (GET_CODE (x))
+ {
+ case CONST:
+ case ZERO_EXTEND:
+ case SIGN_EXTEND:
+ s390_output_symbolic_const (file, XEXP (x, 0));
+ break;
+
+ case PLUS:
+ s390_output_symbolic_const (file, XEXP (x, 0));
+ fprintf (file, "+");
+ s390_output_symbolic_const (file, XEXP (x, 1));
+ break;
+
+ case MINUS:
+ s390_output_symbolic_const (file, XEXP (x, 0));
+ fprintf (file, "-");
+ s390_output_symbolic_const (file, XEXP (x, 1));
+ break;
+
+ case CONST_INT:
+ output_addr_const (file, x);
+ break;
+
+ case LABEL_REF:
+ case CODE_LABEL:
+ output_addr_const (file, x);
+ break;
+
+ case SYMBOL_REF:
+ output_addr_const (file, x);
+ if (CONSTANT_POOL_ADDRESS_P (x) && s390_pool_count != 0)
+ fprintf (file, "_%X", s390_pool_count);
+ break;
+
+ case UNSPEC:
+ if (XVECLEN (x, 0) != 1)
+ output_operand_lossage ("invalid UNSPEC as operand (1)");
+ switch (XINT (x, 1))
+ {
+ case 100:
+ s390_output_symbolic_const (file, XVECEXP (x, 0, 0));
+ fprintf (file, "-.LT%X_%X",
+ s390_function_count, s390_pool_count);
+ break;
+ case 110:
+ s390_output_symbolic_const (file, XVECEXP (x, 0, 0));
+ fprintf (file, "@GOT12");
+ break;
+ case 111:
+ s390_output_symbolic_const (file, XVECEXP (x, 0, 0));
+ fprintf (file, "@GOTENT");
+ break;
+ case 112:
+ s390_output_symbolic_const (file, XVECEXP (x, 0, 0));
+ fprintf (file, "@GOT");
+ break;
+ case 113:
+ s390_output_symbolic_const (file, XVECEXP (x, 0, 0));
+ fprintf (file, "@PLT");
+ break;
+ case 114:
+ s390_output_symbolic_const (file, XVECEXP (x, 0, 0));
+ fprintf (file, "@PLT-.LT%X_%X",
+ s390_function_count, s390_pool_count);
+ break;
+ default:
+ output_operand_lossage ("invalid UNSPEC as operand (2)");
+ break;
+ }
+ break;
+
+ default:
+ fatal_insn ("UNKNOWN in s390_output_symbolic_const !?", x);
+ break;
+ }
+}
+
+/* Output address operand ADDR in assembler syntax to
+ stdio stream FILE. */
+
+void
+print_operand_address (FILE *file, rtx addr)
+{
+ struct s390_address ad;
+
+ if (!s390_decompose_address (addr, &ad, TRUE))
+ output_operand_lossage ("Cannot decompose address.\n");
+
+ if (ad.disp)
+ s390_output_symbolic_const (file, ad.disp);
+ else
+ fprintf (file, "0");
+
+ if (ad.base && ad.indx)
+ fprintf (file, "(%s,%s)", reg_names[REGNO (ad.indx)],
+ reg_names[REGNO (ad.base)]);
+ else if (ad.base)
+ fprintf (file, "(%s)", reg_names[REGNO (ad.base)]);
+}
+
+/* Output operand X in assembler syntax to stdio stream FILE.
+ The following format flags are recognized as CODE:
+
+ 'C': print opcode suffix for branch condition.
+ 'D': print opcode suffix for inverse branch condition.
+ 'Y': print current constant pool address (pc-relative).
+ 'y': print current constant pool address (absolute).
+ 'O': print only the displacement of a memory reference.
+ 'R': print only the base register of a memory reference.
+ 'N': print the second word of a DImode operand.
+ 'M': print the second word of a TImode operand.
+
+ 'b': print integer X as if it's a unsigned byte.
+ 'x': print integer X as if it's a unsigned word.
+ 'h': print integer X as if it's a signed word. */
+
+void
+print_operand (FILE *file, rtx x, char code)
+{
+ switch (code)
+ {
+ case 'C':
+ output_branch_condition (file, x);
+ return;
+
+ case 'D':
+ output_inverse_branch_condition (file, x);
+ return;
+
+ case 'Y':
+ fprintf (file, ".LT%X_%X-.", s390_function_count, s390_pool_count);
+ return;
+
+ case 'y':
+ fprintf (file, ".LT%X_%X", s390_function_count, s390_pool_count);
+ return;
+
+ case 'O':
+ {
+ struct s390_address ad;
+
+ if (GET_CODE (x) != MEM
+ || !s390_decompose_address (XEXP (x, 0), &ad, TRUE)
+ || ad.indx)
+ abort ();
+
+ if (ad.disp)
+ s390_output_symbolic_const (file, ad.disp);
+ else
+ fprintf (file, "0");
+ }
+ return;
+
+ case 'R':
+ {
+ struct s390_address ad;
+
+ if (GET_CODE (x) != MEM
+ || !s390_decompose_address (XEXP (x, 0), &ad, TRUE)
+ || ad.indx)
+ abort ();
+
+ if (ad.base)
+ fprintf (file, "%s", reg_names[REGNO (ad.base)]);
+ else
+ fprintf (file, "0");
+ }
+ return;
+
+ case 'N':
+ if (GET_CODE (x) == REG)
+ x = gen_rtx_REG (GET_MODE (x), REGNO (x) + 1);
+ else if (GET_CODE (x) == MEM)
+ x = change_address (x, VOIDmode, plus_constant (XEXP (x, 0), 4));
+ else
+ abort ();
+ break;
+
+ case 'M':
+ if (GET_CODE (x) == REG)
+ x = gen_rtx_REG (GET_MODE (x), REGNO (x) + 1);
+ else if (GET_CODE (x) == MEM)
+ x = change_address (x, VOIDmode, plus_constant (XEXP (x, 0), 8));
+ else
+ abort ();
+ break;
+ }
+
+ switch (GET_CODE (x))
+ {
+ case REG:
+ fprintf (file, "%s", reg_names[REGNO (x)]);
+ break;
+
+ case MEM:
+ output_address (XEXP (x, 0));
+ break;
+
+ case CONST:
+ case CODE_LABEL:
+ case LABEL_REF:
+ case SYMBOL_REF:
+ s390_output_symbolic_const (file, x);
+ break;
+
+ case CONST_INT:
+ if (code == 'b')
+ fprintf (file, "%d", INTVAL (x) & 0xff);
+ else if (code == 'X')
+ fprintf (file, "%d", INTVAL (x) & 0xff);
+ else if (code == 'x')
+ fprintf (file, "0x%x", INTVAL (x) & 0xffff);
+ else if (code == 'h')
+ fprintf (file, "%d", (INTVAL (x) << 16) >> 16);
+ else
+ fprintf (file, "%d", INTVAL (x));
+ break;
+
+ default:
+ fatal_insn ("UNKNOWN in print_operand !?", x);
+ break;
+ }
+}
+
+#define DEBUG_SCHED 0
+
+/* Returns true if register REGNO is used for forming
+ a memory address in expression X. */
+
+static int
+reg_used_in_mem_p (int regno, rtx x)
+{
+ enum rtx_code code = GET_CODE (x);
+ int i, j;
+ const char *fmt;
+
+ if (code == MEM)
+ {
+ if (refers_to_regno_p (regno, regno+1,
+ XEXP (x, 0), 0))
+ return 1;
+ }
+
+ fmt = GET_RTX_FORMAT (code);
+ for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--)
+ {
+ if (fmt[i] == 'e'
+ && reg_used_in_mem_p (regno, XEXP (x, i)))
+ return 1;
+
+ else if (fmt[i] == 'E')
+ for (j = 0; j < XVECLEN (x, i); j++)
+ if (reg_used_in_mem_p (regno, XVECEXP (x, i, j)))
+ return 1;
+ }
+ return 0;
+}
+
+/* Returns true if expression DEP_RTX sets a address register
+ used by instruction INSN to address memory. */
+
+static int
+addr_generation_dependency_p (rtx dep_rtx, rtx insn)
+{
+ rtx target;
+
+ if (GET_CODE (dep_rtx) == SET)
+ {
+ target = SET_DEST (dep_rtx);
+
+ if (GET_CODE (target) == REG)
+ {
+ int regno = REGNO (target);
+
+ if (get_attr_type (insn) == TYPE_LA)
+ return refers_to_regno_p (regno, regno+1,
+ SET_SRC (PATTERN (insn)), 0);
+ else if (get_attr_atype (insn) == ATYPE_MEM)
+ return reg_used_in_mem_p (regno, PATTERN (insn));
+ }
+ }
+ return 0;
+}
+
+
+/* Data dependencies are all handled without delay. But if an register
+ is changed for a memory access, at least 4 cycle need to be put
+ between the set of the register and the use. Because of that,
+ the delays specified in the .md file needs to check and adjust
+ to the right cost. */
+
+int
+s390_adjust_cost (rtx insn, rtx link, rtx dep_insn, int cost)
+{
+ rtx dep_rtx, dest, x;
+ int i;
+
+ /* If the dependence is an anti-dependence, there is no cost. For an
+ output dependence, there is sometimes a cost, but it doesn't seem
+ worth handling those few cases. */
+
+ if (REG_NOTE_KIND (link) != 0)
+ return 0;
+
+ /* If we can't recognize the insns, we can't really do anything. */
+ if (recog_memoized (insn) < 0 || recog_memoized (dep_insn) < 0)
+ return cost;
+
+ dep_rtx = PATTERN (dep_insn);
+
+ if (GET_CODE (dep_rtx) == SET)
+ {
+ if (addr_generation_dependency_p (dep_rtx, insn))
+ {
+ if (DEBUG_SCHED)
+ {
+ fprintf (stderr, "\n\nAddress dependency detected: cost %d\n",
+ cost);
+ debug_rtx (dep_insn);
+ debug_rtx (insn);
+ }
+ return cost + 4;
+ }
+ }
+
+ else if (GET_CODE (dep_rtx) == PARALLEL)
+ {
+ for (i = 0; i < XVECLEN (dep_rtx, 0); i++)
+ {
+ if (addr_generation_dependency_p (XVECEXP (dep_rtx, 0, i),
+ insn))
+ {
+ if (DEBUG_SCHED)
+ {
+ fprintf (stderr, "\n\nAddress dependency detected: cost %d\n"
+ ,cost);
+ debug_rtx (dep_insn);
+ debug_rtx (insn);
+ }
+ return cost + 4;
+ }
+ }
+ }
+
+ /* default cost. */
+ return cost;
+}
+
+/* Pool concept for Linux 390:
+ - Function prologue saves used register
+ - literal pool is dumped in prologue and jump across with bras
+ - If function has more than 4 k literals, at about every
+ S390_CHUNK_MAX offset in the function a literal pool will be
+ dumped
+ - in this case, a branch from one chunk to other chunk needs
+ a reload of base register at the code label branched to. */
+
+rtx s390_pool_start_insn = NULL_RTX;
+
+/* Count of actual pool in function (-1 -> before function). */
+
+int s390_pool_count = -1;
+
+static int pool_stop_uid;
+
+/* Called from the ASM_OUTPUT_POOL_PROLOGUE macro to
+ prepare for printing a literal pool chunk. */
+
+void
+s390_asm_output_pool_prologue (FILE *file, char *fname, tree fndecl, int size)
+{
+
+ if (s390_pool_count>0) {
+ /*
+ * We are in an internal pool, branch over
+ */
+ if (TARGET_64BIT)
+ {
+ fprintf (file, "\tlarl\t%s,.LT%X_%X\n",
+ reg_names[BASE_REGISTER],
+ s390_function_count, s390_pool_count);
+ readonly_data_section ();
+ ASM_OUTPUT_ALIGN (file, floor_log2 (3));
+ fprintf (file, ".LT%X_%X:\t# Pool %d\n",
+ s390_function_count, s390_pool_count, s390_pool_count);
+ }
+ else
+ fprintf (file,"\t.align 4\n\tbras\t%s,0f\n.LT%X_%X:\t# Pool %d \n",
+ reg_names[BASE_REGISTER],
+ s390_function_count, s390_pool_count, s390_pool_count);
+ }
+ if (!TARGET_64BIT)
+ function_section (fndecl);
+}
+
+/* Return 1 if OTHER_ADDR is in different chunk than MY_ADDR.
+ LTORG points to a list of all literal pools inserted
+ into the current function. */
+
+static int
+other_chunk (int *ltorg, int my_addr, int other_addr)
+{
+ int ad, i=0, j=0;
+
+ while ((ad = ltorg[i++])) {
+ if (INSN_ADDRESSES (ad) >= my_addr)
+ break;
+ }
+
+ while ((ad = ltorg[j++])) {
+ if (INSN_ADDRESSES (ad) > other_addr)
+ break;
+ }
+
+ if (i==j)
+ return 0;
+
+ return 1;
+}
+
+/* Return 1 if OTHER_ADDR is too far away from MY_ADDR
+ to use a relative branch instruction. */
+
+static int
+far_away (int my_addr, int other_addr)
+{
+ /* In 64 bit mode we can jump +- 4GB. */
+ if (TARGET_64BIT)
+ return 0;
+ if (abs (my_addr - other_addr) > S390_REL_MAX)
+ return 1;
+ return 0;
+}
+
+/* Go through all insns in the current function (starting
+ at INSN), replacing branch insn if necessary. A branch
+ needs to be modified if either the distance to the
+ target is too far to use a relative branch, or if the
+ target uses a different literal pool than the origin.
+ LTORG_UIDS points to a list of all literal pool insns
+ that have been inserted. */
+
+static rtx
+check_and_change_labels (rtx insn, int *ltorg_uids)
+{
+ rtx temp_reg = gen_rtx_REG (Pmode, RETURN_REGNUM);
+ rtx target, jump;
+ rtx pattern, tmp, body, label1;
+ int addr0, addr1;
+
+ if (GET_CODE (insn) != JUMP_INSN)
+ return insn;
+
+ pattern = PATTERN (insn);
+
+ addr0 = INSN_ADDRESSES (INSN_UID (insn));
+ if (GET_CODE (pattern) == SET)
+ {
+ body = XEXP (pattern, 1);
+ if (GET_CODE (body) == LABEL_REF)
+ {
+ addr1 = INSN_ADDRESSES (INSN_UID (XEXP (body, 0)));
+
+ if (other_chunk (ltorg_uids, addr0, addr1))
+ {
+ SYMBOL_REF_USED (XEXP (body, 0)) = 1;
+ }
+ if (far_away (addr0, addr1))
+ {
+ if (flag_pic)
+ {
+ target = gen_rtx_UNSPEC (SImode, gen_rtvec (1, body), 100);
+ target = gen_rtx_CONST (SImode, target);
+ target = force_const_mem (SImode, target);
+ jump = gen_rtx_REG (Pmode, BASE_REGISTER);
+ jump = gen_rtx_PLUS (Pmode, jump, temp_reg);
+ }
+ else
+ {
+ target = force_const_mem (Pmode, body);
+ jump = temp_reg;
+ }
+
+ emit_insn_before (gen_movsi (temp_reg, target), insn);
+ tmp = emit_jump_insn_before (gen_indirect_jump (jump), insn);
+ remove_insn (insn);
+ INSN_ADDRESSES_NEW (tmp, -1);
+ return tmp;
+ }
+ }
+ else if (GET_CODE (body) == IF_THEN_ELSE)
+ {
+ if (GET_CODE (XEXP (body, 1)) == LABEL_REF)
+ {
+ addr1 = INSN_ADDRESSES (INSN_UID (XEXP (XEXP (body, 1), 0)));
+
+ if (other_chunk (ltorg_uids, addr0, addr1))
+ {
+ SYMBOL_REF_USED (XEXP (XEXP (body, 1), 0)) = 1;
+ }
+
+ if (far_away (addr0, addr1))
+ {
+ if (flag_pic)
+ {
+ target = gen_rtx_UNSPEC (SImode, gen_rtvec (1, XEXP (body, 1)), 100);
+ target = gen_rtx_CONST (SImode, target);
+ target = force_const_mem (SImode, target);
+ jump = gen_rtx_REG (Pmode, BASE_REGISTER);
+ jump = gen_rtx_PLUS (Pmode, jump, temp_reg);
+ }
+ else
+ {
+ target = force_const_mem (Pmode, XEXP (body, 1));
+ jump = temp_reg;
+ }
+
+ label1 = gen_label_rtx ();
+ emit_jump_insn_before (gen_icjump (label1, XEXP (body, 0)), insn);
+ emit_insn_before (gen_movsi (temp_reg, target), insn);
+ tmp = emit_jump_insn_before (gen_indirect_jump (jump), insn);
+ INSN_ADDRESSES_NEW (emit_label_before (label1, insn), -1);
+ remove_insn (insn);
+ return tmp;
+ }
+ }
+ else if (GET_CODE (XEXP (body, 2)) == LABEL_REF)
+ {
+ addr1 = INSN_ADDRESSES (INSN_UID (XEXP (XEXP (body, 2), 0)));
+
+ if (other_chunk (ltorg_uids, addr0, addr1))
+ {
+ SYMBOL_REF_USED (XEXP (XEXP (body, 2), 0)) = 1;
+ }
+
+ if (far_away (addr0, addr1))
+ {
+ if (flag_pic)
+ {
+ target = gen_rtx_UNSPEC (SImode, gen_rtvec (1, XEXP (body, 2)), 100);
+ target = gen_rtx_CONST (SImode, target);
+ target = force_const_mem (SImode, target);
+ jump = gen_rtx_REG (Pmode, BASE_REGISTER);
+ jump = gen_rtx_PLUS (Pmode, jump, temp_reg);
+ }
+ else
+ {
+ target = force_const_mem (Pmode, XEXP (body, 2));
+ jump = temp_reg;
+ }
+
+ label1 = gen_label_rtx ();
+ emit_jump_insn_before (gen_cjump (label1, XEXP (body, 0)), insn);
+ emit_insn_before (gen_movsi (temp_reg, target), insn);
+ tmp = emit_jump_insn_before (gen_indirect_jump (jump), insn);
+ INSN_ADDRESSES_NEW (emit_label_before (label1, insn), -1);
+ remove_insn (insn);
+ return tmp;
+ }
+ }
+ }
+ }
+ else if (GET_CODE (pattern) == ADDR_VEC ||
+ GET_CODE (pattern) == ADDR_DIFF_VEC)
+ {
+ int i, diff_vec_p = GET_CODE (pattern) == ADDR_DIFF_VEC;
+ int len = XVECLEN (pattern, diff_vec_p);
+
+ for (i = 0; i < len; i++)
+ {
+ addr1 = INSN_ADDRESSES (INSN_UID (XEXP (XVECEXP (pattern, diff_vec_p, i), 0)));
+ if (other_chunk (ltorg_uids, addr0, addr1))
+ {
+ SYMBOL_REF_USED (XEXP (XVECEXP (pattern, diff_vec_p, i), 0)) = 1;
+ }
+ }
+ }
+ return insn;
+}
+
+static int chunk_max=0;
+
+
+/* Called from s390_function_prologue to make final adjustments
+ before outputting code. CHUNKIFY specifies whether we need
+ to use multiple literal pools (because the total size of the
+ literals exceeds 4K). */
+
+void
+s390_final_chunkify (int chunkify)
+{
+ rtx insn, ninsn, tmp;
+ int addr, naddr, uids;
+
+ const char *asms;
+
+ int size = insn_current_address;
+
+ int *ltorg_uids;
+ int max_ltorg=0;
+
+ ltorg_uids = alloca (size / 1024 + 1024);
+ memset (ltorg_uids, 0, size / 1024 + 1024);
+
+ if (chunkify == 1)
+ {
+ chunk_max = size * 2048 / get_pool_size ();
+ chunk_max = chunk_max > S390_CHUNK_MAX
+ ? S390_CHUNK_MAX : chunk_max;
+ }
+
+ for (insn=get_insns (); insn;insn = next_real_insn (insn))
+ {
+ if (GET_RTX_CLASS (GET_CODE (insn)) != 'i')
+ continue;
+
+ addr = INSN_ADDRESSES (INSN_UID (insn));
+ if ((ninsn = next_real_insn (insn)))
+ {
+ naddr = INSN_ADDRESSES (INSN_UID (ninsn));
+ }
+
+ if (chunkify && (addr / chunk_max != naddr / chunk_max))
+ {
+ for (tmp = insn; tmp; tmp = NEXT_INSN (tmp))
+ {
+ if (GET_CODE (tmp) == CODE_LABEL &&
+ GET_CODE (NEXT_INSN (tmp)) != JUMP_INSN)
+ {
+ ltorg_uids[max_ltorg++] = INSN_UID (prev_real_insn (tmp));
+ break;
+ }
+ if (GET_CODE (tmp) == CALL_INSN)
+ {
+ ltorg_uids[max_ltorg++] = INSN_UID (tmp);
+ break;
+ }
+ if (INSN_ADDRESSES (INSN_UID (tmp)) - naddr > S390_CHUNK_OV)
+ {
+ debug_rtx (insn);
+ debug_rtx (tmp);
+ fprintf (stderr, "s390 multiple literalpool support:"
+ "\n No code label between this insn %X %X",
+ naddr, INSN_ADDRESSES (INSN_UID (tmp)));
+ abort ();
+ }
+ }
+ if (tmp == NULL)
+ {
+ warning ("no code label found");
+ }
+ }
+ else if (GET_CODE (PATTERN (insn)) == ASM_INPUT && !TARGET_64BIT)
+ {
+ asms = XSTR (PATTERN (insn),0);
+
+ if ((memcmp (asms,".section",8) == 0) ||
+ (memcmp (asms,".text",5) == 0) ||
+ (memcmp (asms,"\t.section",9) == 0) ||
+ (memcmp (asms,"\t.text",6) == 0)) {
+ ltorg_uids[max_ltorg++] = INSN_UID (insn);
+ INSN_ADDRESSES_NEW (emit_insn_before (gen_rtx_ASM_INPUT (VOIDmode,
+ ".align 4"), insn), -1);
+ }
+ }
+ }
+ ltorg_uids[max_ltorg] = 0;
+ for (insn=get_insns (),uids=0; insn;insn = next_real_insn (insn))
+ {
+ if (GET_RTX_CLASS (GET_CODE (insn)) != 'i')
+ continue;
+ if (INSN_UID (insn) == ltorg_uids[uids])
+ {
+ INSN_ADDRESSES_NEW (emit_insn_after (gen_ltorg (
+ gen_rtx_CONST_INT (Pmode, ltorg_uids[++uids])),
+ insn), -1);
+ }
+ if (GET_CODE (insn) == JUMP_INSN)
+ {
+ insn = check_and_change_labels (insn, ltorg_uids);
+ }
+ }
+ if (chunkify)
+ {
+ for (insn=get_insns (); insn;insn = next_insn (insn))
+ {
+ if (GET_CODE (insn) == CODE_LABEL)
+ {
+ if (SYMBOL_REF_USED (insn))
+ {
+ INSN_ADDRESSES_NEW (emit_insn_after (gen_reload_base (
+ gen_rtx_LABEL_REF (Pmode, XEXP (insn, 0))), insn), -1);
+ }
+ }
+ }
+ }
+ pool_stop_uid = ltorg_uids[0];
+}
+
+/* Return 1 if next literal pool is reached (check for ltorg insn)
+ maybe should use unspec insn. */
+
+int
+s390_stop_dump_lit_p (rtx insn)
+{
+ rtx body=PATTERN (insn);
+ if (GET_CODE (body) == PARALLEL
+ && GET_CODE (XVECEXP (body, 0, 0)) == SET
+ && GET_CODE (XVECEXP (body, 0, 1)) == USE
+ && GET_CODE (XEXP ((XVECEXP (body, 0, 1)),0)) == CONST_INT
+ && GET_CODE (SET_DEST (XVECEXP (body, 0, 0))) == REG
+ && REGNO (SET_DEST (XVECEXP (body, 0, 0))) == BASE_REGISTER
+ && SET_SRC (XVECEXP (body, 0, 0)) == pc_rtx) {
+ return 1;
+ }
+ else
+ return 0;
+}
+
+/* Output literal pool chunk to be used for insns
+ between ACT_INSN and STOP. */
+
+void
+s390_dump_literal_pool (rtx act_insn, rtx stop)
+{
+ s390_pool_start_insn = act_insn;
+ pool_stop_uid = INTVAL (stop);
+ s390_pool_count++;
+ output_constant_pool (current_function_name, current_function_decl);
+ function_section (current_function_decl);
+}
+
+
+#ifdef DWARF2_DEBUGGING_INFO
+extern char *dwarf2out_cfi_label PARAMS ((void));
+#endif
+
+/* Flag set in prologue, used in epilog to know
+ if stack is allocated or not. */
+
+static int leaf_function_flag;
+rtx s390_got_label;
+rtx s390_profile[10];
+int s390_nr_constants;
+
+/* Returns 1 if floating point registers need to be saved. */
+
+static int
+save_fprs_p ()
+{
+ int i;
+ if (!TARGET_64BIT)
+ return 0;
+ for (i=24; i<=31; i++)
+ {
+ if (regs_ever_live[i] == 1)
+ return 1;
+ }
+ return 0;
+}
+
+/* Current function is a leaf function, without automatics,
+ alloca or vararg stuff. */
+
+static int
+cur_is_leaf_function ()
+{
+ int lsize = get_frame_size () + current_function_outgoing_args_size
+ + save_fprs_p () * 64;
+
+ if (leaf_function_p () && ((lsize) == 0) &&
+ ! (current_function_calls_alloca) &&
+ ! (current_function_stdarg) && ! (current_function_varargs))
+ return 1;
+ return 0;
+}
+
+/* Calculate offset between argument pointer and frame pointer
+ initialy after prologue. */
+
+int
+s390_arg_frame_offset ()
+{
+ int lsize = get_frame_size () + current_function_outgoing_args_size
+ + save_fprs_p () * 64;
+
+ if (cur_is_leaf_function ())
+ return STACK_POINTER_OFFSET;
+ else
+ return 2*STACK_POINTER_OFFSET + lsize;
+}
+
+/* Output code to stdio stream FILE to save floating point
+ registers on current stack, at offset OFFSET to the frame
+ pointer register FP. */
+
+static int
+save_fprs (FILE *file, long offset, int fp)
+{
+ int i;
+
+ if (!TARGET_64BIT)
+ return 0;
+
+ for (i=24; i<=31; i++)
+ {
+ if (regs_ever_live[i] == 1)
+ {
+ fprintf (file, "\tstd\t%s,%d(%s)\n", reg_names[i],
+ (i-24) * 8 + offset, reg_names[fp]);
+ }
+ }
+}
+
+/* Output code to stdio stream FILE to restore floating point
+ registers from current stack, at offset OFFSET to the frame
+ pointer register FP. */
+
+static int
+restore_fprs (FILE *file, long offset, int fp)
+{
+ int i;
+
+ if (!TARGET_64BIT)
+ return 0;
+
+ if (!save_fprs_p ())
+ return 0;
+
+ if (offset < 0)
+ {
+ fp = 1;
+ offset = 0;
+ fprintf (file, "\tlgr\t%s,%s\n", reg_names[fp],
+ reg_names[STACK_POINTER_REGNUM]);
+ fprintf (file, "\taghi\t%s,-64\n", reg_names[fp]);
+ }
+
+ for (i=24; i<=31; i++)
+ {
+ if (regs_ever_live[i] == 1)
+ {
+ fprintf (file, "\tld\t%s,%d(%s)\n", reg_names[i],
+ (i-24) * 8 + offset, reg_names[fp]);
+ }
+ }
+}
+
+/* Output constant pool in function prologue (31 bit) or in readonly section. */
+
+static int
+s390_output_constant_pool (FILE* file)
+{
+ /* Output constant pool. */
+ if (s390_nr_constants || regs_ever_live[BASE_REGISTER])
+ {
+ s390_pool_count = 0;
+ if (TARGET_64BIT)
+ {
+ fprintf (file, "\tlarl\t%s,.LT%X_%X\n", reg_names[BASE_REGISTER],
+ s390_function_count, s390_pool_count);
+ readonly_data_section ();
+ ASM_OUTPUT_ALIGN (file, floor_log2 (3));
+ }
+ else
+ {
+ fprintf (file, "\tbras\t%s,.LTN%X_%X\n", reg_names[BASE_REGISTER],
+ s390_function_count, s390_pool_count);
+ }
+ fprintf (file, ".LT%X_%X:\n", s390_function_count, s390_pool_count);
+ output_constant_pool (current_function_name, current_function_decl);
+ fprintf (file, ".LTN%X_%X:\n", s390_function_count,
+ s390_pool_count);
+ if (TARGET_64BIT)
+ function_section (current_function_decl);
+
+ regs_ever_live[BASE_REGISTER] = 1;
+ }
+}
+
+/* Add constant CTX to the constant pool at a late time
+ (after the initial pass to count the number of constants
+ was already done). Returns the resulting constant
+ pool reference. */
+
+static rtx
+s390_force_const_mem_late (rtx cst)
+{
+ cst = force_const_mem (Pmode, cst);
+
+ s390_nr_constants++;
+ regs_ever_live[BASE_REGISTER] = 1;
+
+ emit_insn_before (gen_rtx (USE, Pmode, cst), get_insns ());
+
+ return cst;
+}
+
+/* Add a reference to the symbol NAME to the constant pool.
+ FUNC specifies whether NAME refers to a function, while
+ GLOBAL specifies whether NAME is a global symbol. Depending
+ on these flags, the appopriate PLT or GOT references are
+ generated. Returns the constant pool reference. */
+
+static rtx
+s390_force_const_mem_symbol (char *name, int func, int global)
+{
+ rtx symbol;
+
+ if (TARGET_64BIT)
+ abort ();
+
+ symbol = gen_rtx (SYMBOL_REF, Pmode, name);
+ SYMBOL_REF_FLAG (symbol) = !global;
+
+ if (flag_pic)
+ {
+ if (global)
+ {
+ current_function_uses_pic_offset_table = 1;
+ symbol = gen_rtx_UNSPEC (VOIDmode, gen_rtvec (1, symbol), func? 114 : 112);
+ symbol = gen_rtx_CONST (VOIDmode, symbol);
+ }
+ else
+ {
+ symbol = gen_rtx_UNSPEC (VOIDmode, gen_rtvec (1, symbol), 100);
+ symbol = gen_rtx_CONST (VOIDmode, symbol);
+ }
+ }
+
+ return s390_force_const_mem_late (symbol);
+}
+
+/* Output the function prologue assembly code to the
+ stdio stream FILE. The local frame size is passed
+ in LSIZE. */
+
+int
+s390_function_prologue (FILE * file, int lsize)
+{
+ extern int profile_label_no;
+ int i, j;
+ long frame_size;
+ rtx stack_label = 0, got_label = 0, tmp;
+ char *l;
+ char b64[2] = " ";
+ b64[0] = TARGET_64BIT ? 'g' : '\0';
+
+ /* Check for too large size of local variables */
+
+ if (lsize > 0x7fff0000)
+ fatal_error ("Total size of local variables exceeds architecture limit.");
+ /* Profile code (-p, -a, -ax needs some literals). */
+
+ if (profile_block_flag && !TARGET_64BIT)
+ {
+ s390_profile[0] = s390_force_const_mem_symbol ("__bb_init_func", 1, 1);
+ s390_profile[1] = s390_force_const_mem_symbol ("__bb_init_trace_func", 1, 1);
+ s390_profile[2] = s390_force_const_mem_symbol ("__bb_trace_func", 1, 1);
+ s390_profile[3] = s390_force_const_mem_symbol ("__bb_trace_ret", 1, 1);
+ s390_profile[5] = s390_force_const_mem_symbol ("__bb", 0, 1);
+ s390_profile[6] = s390_force_const_mem_symbol (".LPBX0", 0, 0);
+ s390_profile[7] = s390_force_const_mem_symbol (".LPBX2", 0, 0);
+ }
+
+ if (profile_flag && !TARGET_64BIT)
+ {
+ static char label[128];
+ sprintf (label, "%sP%d", LPREFIX, profile_label_no);
+
+ s390_profile[4] = s390_force_const_mem_symbol ("_mcount", 1, 1);
+ s390_profile[9] = s390_force_const_mem_symbol (label, 0, 0);
+ }
+
+ if (get_pool_size () > S390_POOL_MAX)
+ s390_final_chunkify (1);
+ else
+ s390_final_chunkify (0);
+
+ if (current_function_uses_pic_offset_table)
+ regs_ever_live[12] = 1;
+
+ if (!TARGET_64BIT && current_function_uses_pic_offset_table)
+ {
+ got_label = s390_force_const_mem_symbol ("_GLOBAL_OFFSET_TABLE_", 0, 0);
+ }
+
+ if ((frame_size =
+ STARTING_FRAME_OFFSET + lsize + save_fprs_p () * 64) > 0x7fff)
+ {
+ stack_label = s390_force_const_mem_late (GEN_INT (frame_size));
+ }
+
+ if (!optimize)
+ {
+ /* Stupid register allocation is stupid ...
+ It does not always recognize the base register is used. */
+
+ regs_ever_live[BASE_REGISTER] = 1;
+ }
+
+ if (cur_is_leaf_function ())
+ {
+ leaf_function_flag = 1;
+ fprintf (file, "%s\tleaf function\n", ASM_COMMENT_START);
+ fprintf (file, "%s\thas varargs %d\n", ASM_COMMENT_START,
+ current_function_stdarg);
+ fprintf (file, "%s\tincoming args (stack) %d\n", ASM_COMMENT_START,
+ current_function_args_size);
+ fprintf (file, "%s\tfunction length %d\n", ASM_COMMENT_START,
+ insn_current_address);
+ fprintf (file, "%s\tregister live ", ASM_COMMENT_START);
+ for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
+ fprintf (file, "%d", regs_ever_live[i]);
+ fputc ('\n',file);
+
+ /* Save gprs 6 - 15 and fprs 4 and 6. */
+ for (i = 6; i < 13 && (regs_ever_live[i] == 0); i++);
+
+ if (s390_nr_constants || regs_ever_live[13] || i != 13)
+ {
+ fprintf (file, "\tstm%s\t%s,%s,%d(%s)\n",
+ b64, reg_names[i], reg_names[13],
+ i * UNITS_PER_WORD,
+ reg_names[STACK_POINTER_REGNUM]);
+#ifdef INCOMING_RETURN_ADDR_RTX
+ if (dwarf2out_do_frame ())
+ {
+ l = dwarf2out_cfi_label ();
+ dwarf2out_def_cfa (l, STACK_POINTER_REGNUM,
+ STACK_POINTER_OFFSET);
+ for (j = i; j <= 14; j++)
+ dwarf2out_reg_save (l, j, (TARGET_64BIT ? (j-20) : (j-24))
+ * UNITS_PER_WORD);
+ if (regs_ever_live[18])
+ dwarf2out_reg_save (l, 18, -16);
+ if (regs_ever_live[19])
+ dwarf2out_reg_save (l, 19, -8);
+ }
+#endif
+ }
+
+ s390_output_constant_pool (file);
+
+ /* Save fprs. */
+
+ if (!TARGET_64BIT)
+ {
+ if (regs_ever_live[18])
+ fprintf (file, "\tstd\t4,80(%s)\n", reg_names[STACK_POINTER_REGNUM]);
+ if (regs_ever_live[19])
+ fprintf (file, "\tstd\t6,88(%s)\n", reg_names[STACK_POINTER_REGNUM]);
+ }
+ }
+ else
+ { /* No leaf function. */
+ fprintf (file, "%s\tleaf function %d\n", ASM_COMMENT_START,
+ leaf_function_p ());
+ fprintf (file, "%s\tautomatics %d\n", ASM_COMMENT_START,
+ lsize);
+ fprintf (file, "%s\toutgoing args %d\n", ASM_COMMENT_START,
+ current_function_outgoing_args_size);
+ fprintf (file, "%s\tneed frame pointer %d\n", ASM_COMMENT_START,
+ frame_pointer_needed);
+ fprintf (file, "%s\tcall alloca %d\n", ASM_COMMENT_START,
+ current_function_calls_alloca);
+ fprintf (file, "%s\thas varargs %d\n", ASM_COMMENT_START,
+ current_function_stdarg || current_function_varargs);
+ fprintf (file, "%s\tincoming args (stack) %d\n", ASM_COMMENT_START,
+ current_function_args_size);
+ fprintf (file, "%s\tfunction length %d\n", ASM_COMMENT_START,
+ insn_current_address);
+ fprintf (file, "%s\tregister live ", ASM_COMMENT_START);
+ for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
+ fprintf (file, "%d", regs_ever_live[i]);
+ fputc ('\n',file);
+
+ /* Save gprs 6 - 15 and fprs 4 and 6. */
+
+ if (current_function_stdarg || current_function_varargs)
+ {
+ i = 2;
+ }
+ else
+ {
+ for (i = 6; i < 13 && (regs_ever_live[i] == 0); i++);
+ }
+
+ fprintf (file, "\tstm%s\t%s,%s,%d(%s)\n",
+ b64, reg_names[i], reg_names[15], i * UNITS_PER_WORD,
+ reg_names[STACK_POINTER_REGNUM]);
+
+#ifdef INCOMING_RETURN_ADDR_RTX
+ if (dwarf2out_do_frame ())
+ {
+ l = dwarf2out_cfi_label ();
+ dwarf2out_def_cfa (l, STACK_POINTER_REGNUM, STACK_POINTER_OFFSET);
+ for (j = i; j <= 15; j++)
+ dwarf2out_reg_save (l, j, (TARGET_64BIT ? (j-20) : (j-24)) *
+ UNITS_PER_WORD);
+ if (regs_ever_live[18])
+ dwarf2out_reg_save (l, 18, -16);
+ if (regs_ever_live[19])
+ dwarf2out_reg_save (l, 19, -8);
+ }
+#endif
+
+ s390_output_constant_pool (file);
+
+ /* Save fprs. */
+
+ if (current_function_stdarg || current_function_varargs)
+ {
+ fprintf (file, "\tstd\t%s,%d(%s)\n",
+ reg_names[16],
+ STACK_POINTER_OFFSET-32,
+ reg_names[STACK_POINTER_REGNUM]);
+ fprintf (file, "\tstd\t%s,%d(%s)\n",
+ reg_names[17],
+ STACK_POINTER_OFFSET-24,
+ reg_names[STACK_POINTER_REGNUM]);
+ if (TARGET_64BIT)
+ {
+ fprintf (file, "\tstd\t%s,%d(%s)\n",
+ reg_names[18],
+ STACK_POINTER_OFFSET-16,
+ reg_names[STACK_POINTER_REGNUM]);
+ fprintf (file, "\tstd\t%s,%d(%s)\n",
+ reg_names[19],
+ STACK_POINTER_OFFSET-8,
+ reg_names[STACK_POINTER_REGNUM]);
+ }
+ }
+ if (!TARGET_64BIT)
+ {
+ if (regs_ever_live[18])
+ fprintf (file, "\tstd\t%s,%d(%s)\n",
+ reg_names[18],
+ STACK_POINTER_OFFSET-16,
+ reg_names[STACK_POINTER_REGNUM]);
+ if (regs_ever_live[19])
+ fprintf (file, "\tstd\t%s,%d(%s)\n",
+ reg_names[19],
+ STACK_POINTER_OFFSET-8,
+ reg_names[STACK_POINTER_REGNUM]);
+ }
+
+
+ if (save_fprs_p () && frame_size > 4095)
+ {
+ int fp = 1;
+ int offset = 0;
+ fprintf (file, "\tlgr\t%s,%s\n", reg_names[fp],
+ reg_names[STACK_POINTER_REGNUM]);
+ fprintf (file, "\taghi\t%s,-64\n", reg_names[fp]);
+ save_fprs (file, 0, fp);
+ }
+
+ /* Decrement stack. */
+
+ if (TARGET_BACKCHAIN || (frame_size + STACK_POINTER_OFFSET > 4095
+ || frame_pointer_needed
+ || current_function_calls_alloca))
+ {
+
+ fprintf (file, "\tl%sr\t%s,%s\n", b64,
+ reg_names[1], reg_names[STACK_POINTER_REGNUM]);
+ }
+
+ if (stack_label)
+ {
+ rtx operands[2];
+
+ operands[0] = stack_pointer_rtx;
+ operands[1] = stack_label;
+ if (TARGET_64BIT)
+ output_asm_insn ("sg\t%0,%1", operands);
+ else
+ output_asm_insn ("s\t%0,%1", operands);
+ }
+ else
+ {
+ fprintf (file, "\ta%shi\t%s,-%d\n",b64,
+ reg_names[STACK_POINTER_REGNUM], frame_size);
+ }
+#ifdef INCOMING_RETURN_ADDR_RTX
+ if (dwarf2out_do_frame ())
+ {
+ if (frame_pointer_needed)
+ dwarf2out_def_cfa ("", HARD_FRAME_POINTER_REGNUM,
+ STACK_POINTER_OFFSET+frame_size);
+ else
+ dwarf2out_def_cfa ("", STACK_POINTER_REGNUM,
+ STACK_POINTER_OFFSET+frame_size);
+ }
+#endif
+
+
+ /* Generate backchain. */
+
+ if (TARGET_BACKCHAIN || (frame_size + STACK_POINTER_OFFSET > 4095
+ || frame_pointer_needed
+ || current_function_calls_alloca))
+ {
+ fprintf (file, "\tst%s\t%s,0(%s)\n",
+ b64, reg_names[1], reg_names[STACK_POINTER_REGNUM]);
+ }
+ }
+
+ if (frame_pointer_needed)
+ {
+ fprintf (file, "\tl%sr\t%s,%s\n", b64,
+ reg_names[FRAME_POINTER_REGNUM],
+ reg_names[STACK_POINTER_REGNUM]);
+ }
+
+ /* Load GOT if used and emit use insn that optimizer does not
+ erase literal pool entry. */
+
+ if (current_function_uses_pic_offset_table)
+ {
+ rtx operands[3];
+ if (TARGET_64BIT)
+ {
+ fprintf (file, "\tlarl\t%s,_GLOBAL_OFFSET_TABLE_\n",
+ reg_names[PIC_OFFSET_TABLE_REGNUM]);
+ }
+ else
+ {
+ operands[0] = gen_rtx (REG, Pmode, PIC_OFFSET_TABLE_REGNUM);
+ operands[1] = got_label;
+ operands[2] = gen_rtx (REG, Pmode, BASE_REGISTER);
+ output_asm_insn ("l\t%0,%1\n\tar\t%0,%2", operands);
+ }
+ }
+ /* Save FPRs below save area. */
+
+ if (frame_size <= 4095)
+ save_fprs (file, frame_size - 64, STACK_POINTER_REGNUM);
+
+ return 0;
+}
+
+/* Output the function epilogue assembly code to the
+ stdio stream FILE. The local frame size is passed
+ in LSIZE. */
+
+int
+s390_function_epilogue (FILE * file, int lsize)
+{
+/* Register is call clobbered and not used for eh or return. */
+#define FREE_REG 4
+
+ int i;
+ long frame_size;
+ int return_reg = RETURN_REGNUM;
+ int fp, offset;
+ char b64[2] = " ";
+
+ b64[0] = TARGET_64BIT ? 'g' : '\0';
+ frame_size = STARTING_FRAME_OFFSET + lsize + save_fprs_p () * 64;
+
+ if (current_function_uses_pic_offset_table)
+ regs_ever_live[PIC_OFFSET_TABLE_REGNUM] = 1;
+
+ if (leaf_function_flag)
+ {
+ for (i = 6; i < 13 && (regs_ever_live[i] == 0); i++);
+
+ if (s390_nr_constants || regs_ever_live[13] || i != 13)
+ {
+ fprintf (file, "\tlm%s\t%s,%s,%d(%s)\n", b64,
+ reg_names[i], reg_names[13],
+ UNITS_PER_WORD * i,
+ reg_names[STACK_POINTER_REGNUM]);
+ }
+ if (!TARGET_64BIT)
+ {
+ if (regs_ever_live[18])
+ fprintf (file, "\tld\t%s,%d(%s)\n",
+ reg_names[18],
+ STACK_POINTER_OFFSET-16,
+ reg_names[STACK_POINTER_REGNUM]);
+ if (regs_ever_live[19])
+ fprintf (file, "\tld\t%s,%d(%s)\n",
+ reg_names[19],
+ STACK_POINTER_OFFSET-8,
+ reg_names[STACK_POINTER_REGNUM]);
+ }
+ }
+ else
+ {
+ for (i = 6; i < 13 && (regs_ever_live[i] == 0); i++);
+
+ if (frame_size + STACK_POINTER_OFFSET > 4095)
+ {
+ offset = 0;
+ fp = STACK_POINTER_REGNUM;
+ }
+ else if (frame_pointer_needed || current_function_calls_alloca)
+ {
+ offset = frame_size;
+ fp = FRAME_POINTER_REGNUM;
+ }
+ else
+ {
+ offset = frame_size;
+ fp = STACK_POINTER_REGNUM;
+ }
+
+ /* Restore from offset below save area. */
+
+ if (offset == 0)
+ fprintf (file, "\tl%s\t%s,0(%s)\n", b64,
+ reg_names[fp], reg_names[fp]);
+ restore_fprs (file, offset-64, fp);
+ return_reg = FREE_REG;
+ fprintf (file, "\tl%s\t%s,%d(%s)\n", b64, reg_names[return_reg],
+ UNITS_PER_WORD*RETURN_REGNUM+offset, reg_names[fp]);
+ if (!TARGET_64BIT)
+ {
+ if (regs_ever_live[18])
+ fprintf (file, "\tld\t%s,%d(%s)\n",
+ reg_names[18],
+ offset+STACK_POINTER_OFFSET-16, reg_names[fp]);
+ if (regs_ever_live[19])
+ fprintf (file, "\tld\t%s,%d(%s)\n",
+ reg_names[19],
+ offset+STACK_POINTER_OFFSET-8, reg_names[fp]);
+ }
+ fprintf (file, "\tlm%s\t%s,%s,%d(%s)\n", b64,
+ reg_names[i], reg_names[15],
+ (UNITS_PER_WORD * i) + offset, reg_names[fp]);
+ }
+
+ fprintf (file, "\tbr\t%s\n", reg_names[return_reg]);
+
+ current_function_uses_pic_offset_table = 0;
+ leaf_function_flag = 0;
+ s390_pool_start_insn = NULL_RTX;
+ s390_pool_count = -1;
+ s390_function_count++;
+ return 0;
+}
+
+/* This is epilogue code, maybe should use generic in except.c. */
+
+void
+s390_expand_eh_epilogue (rtx reg1, rtx reg2, rtx reg3)
+{
+ abort ();
+}
+
+
+/* Return the size in bytes of a function argument of
+ type TYPE and/or mode MODE. At least one of TYPE or
+ MODE must be specified. */
+
+static int
+s390_function_arg_size (enum machine_mode mode, tree type)
+{
+ if (type)
+ return int_size_in_bytes (type);
+
+ /* No type info available for some library calls ... */
+ if (mode != BLKmode)
+ return GET_MODE_SIZE (mode);
+
+ /* If we have neither type nor mode, abort */
+ abort ();
+}
+
+/* Return 1 if a function argument of type TYPE and mode MODE
+ is to be passed by reference. The ABI specifies that only
+ structures of size 1, 2, 4, or 8 bytes are passed by value,
+ all other structures (and complex numbers) are passed by
+ reference. */
+
+int
+s390_function_arg_pass_by_reference (enum machine_mode mode, tree type)
+{
+ int size = s390_function_arg_size (mode, type);
+
+ if (type)
+ {
+ if (AGGREGATE_TYPE_P (type) &&
+ size != 1 && size != 2 && size != 4 && size != 8)
+ return 1;
+
+ if (TREE_CODE (type) == COMPLEX_TYPE)
+ return 1;
+ }
+ return 0;
+
+}
+
+/* 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.). */
+
+void
+s390_function_arg_advance (CUMULATIVE_ARGS * cum,
+ enum machine_mode mode, tree type, int named)
+{
+ if (! TARGET_SOFT_FLOAT && (mode == DFmode || mode == SFmode))
+ {
+ cum->fprs++;
+ }
+ else if (s390_function_arg_pass_by_reference (mode, type))
+ {
+ cum->gprs += 1;
+ }
+ else
+ {
+ int size = s390_function_arg_size (mode, type);
+ cum->gprs += ((size + UNITS_PER_WORD-1) / UNITS_PER_WORD);
+ }
+}
+
+/* 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.
+
+ MODE is the argument's machine mode.
+ TYPE is the data type of the argument (as a tree).
+ This is null for libcalls where that information may
+ not be available.
+ CUM is a variable of type CUMULATIVE_ARGS which gives info about
+ the preceding args and about the function being called.
+ NAMED is nonzero if this argument is a named parameter
+ (otherwise it is an extra parameter matching an ellipsis).
+
+ On S/390, we use general purpose registers 2 through 6 to
+ pass integer, pointer, and certain structure arguments, and
+ floating point registers 0 and 2 (0, 2, 4, and 6 on 64-bit)
+ to pass floating point arguments. All remaining arguments
+ are pushed to the stack. */
+
+rtx
+s390_function_arg (CUMULATIVE_ARGS * cum,
+ enum machine_mode mode, tree type, int named)
+{
+ if (s390_function_arg_pass_by_reference (mode, type))
+ return 0;
+
+ if (! TARGET_SOFT_FLOAT && (mode == DFmode || mode == SFmode))
+ {
+ if (cum->fprs + 1 > (TARGET_64BIT? 4 : 2))
+ return 0;
+ else
+ return gen_rtx (REG, mode, cum->fprs + 16);
+ }
+ else
+ {
+ int size = s390_function_arg_size (mode, type);
+ int n_gprs = (size + UNITS_PER_WORD-1) / UNITS_PER_WORD;
+
+ if (cum->gprs + n_gprs > 5)
+ return 0;
+ else
+ return gen_rtx (REG, mode, cum->gprs + 2);
+ }
+}
+
+
+/* Create the va_list datatype.
+
+ On S/390, va_list is a structure of four elements:
+
+ __gpr: number of general purpose registers used for arguments
+ __fpr: number of floating point registers used for arguments
+ __overflow_arg_area:
+ address of area holding arguments that are not
+ passed in a register
+ __reg_save_area:
+ address of register save area; the function prologue
+ saves all registers used for argument passing into this
+ area, if the function uses variable arguments. */
+
+tree
+s390_build_va_list ()
+{
+ tree f_gpr, f_fpr, f_ovf, f_sav, record, type_decl;
+
+ record = make_lang_type (RECORD_TYPE);
+
+ type_decl =
+ build_decl (TYPE_DECL, get_identifier ("__va_list_tag"), record);
+
+ f_gpr = build_decl (FIELD_DECL, get_identifier ("__gpr"),
+ long_integer_type_node);
+ f_fpr = build_decl (FIELD_DECL, get_identifier ("__fpr"),
+ long_integer_type_node);
+ f_ovf = build_decl (FIELD_DECL, get_identifier ("__overflow_arg_area"),
+ ptr_type_node);
+ f_sav = build_decl (FIELD_DECL, get_identifier ("__reg_save_area"),
+ ptr_type_node);
+
+ DECL_FIELD_CONTEXT (f_gpr) = record;
+ DECL_FIELD_CONTEXT (f_fpr) = record;
+ DECL_FIELD_CONTEXT (f_ovf) = record;
+ DECL_FIELD_CONTEXT (f_sav) = record;
+
+ TREE_CHAIN (record) = type_decl;
+ TYPE_NAME (record) = type_decl;
+ TYPE_FIELDS (record) = f_gpr;
+ TREE_CHAIN (f_gpr) = f_fpr;
+ TREE_CHAIN (f_fpr) = f_ovf;
+ TREE_CHAIN (f_ovf) = f_sav;
+
+ layout_type (record);
+
+ /* The correct type is an array type of one element. */
+ return build_array_type (record, build_index_type (size_zero_node));
+}
+
+/* Implement va_start.
+
+ The following global variables are used to initalize
+ the va_list structure:
+
+ current_function_args_info:
+ holds number of gprs and fprs used for arguments.
+ current_function_arg_offset_rtx:
+ holds the offset to the overflow argument area on the stack
+ (relative to the virtual arg pointer). */
+
+void
+s390_va_start (int stdarg_p, tree valist, rtx nextarg)
+{
+ HOST_WIDE_INT n_gpr, n_fpr;
+ int off;
+ tree f_gpr, f_fpr, f_ovf, f_sav;
+ tree gpr, fpr, ovf, sav, t;
+
+ f_gpr = TYPE_FIELDS (TREE_TYPE (va_list_type_node));
+ f_fpr = TREE_CHAIN (f_gpr);
+ f_ovf = TREE_CHAIN (f_fpr);
+ f_sav = TREE_CHAIN (f_ovf);
+
+ valist = build1 (INDIRECT_REF, TREE_TYPE (TREE_TYPE (valist)), valist);
+ gpr = build (COMPONENT_REF, TREE_TYPE (f_gpr), valist, f_gpr);
+ fpr = build (COMPONENT_REF, TREE_TYPE (f_fpr), valist, f_fpr);
+ ovf = build (COMPONENT_REF, TREE_TYPE (f_ovf), valist, f_ovf);
+ sav = build (COMPONENT_REF, TREE_TYPE (f_sav), valist, f_sav);
+
+ /* Count number of gp and fp argument registers used. */
+
+ n_gpr = current_function_args_info.gprs;
+ n_fpr = current_function_args_info.fprs;
+
+ t = build (MODIFY_EXPR, TREE_TYPE (gpr), gpr, build_int_2 (n_gpr, 0));
+ TREE_SIDE_EFFECTS (t) = 1;
+ expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
+
+ t = build (MODIFY_EXPR, TREE_TYPE (fpr), fpr, build_int_2 (n_fpr, 0));
+ TREE_SIDE_EFFECTS (t) = 1;
+ expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
+
+ /* Find the overflow area. */
+ t = make_tree (TREE_TYPE (ovf), virtual_incoming_args_rtx);
+
+ off = INTVAL (current_function_arg_offset_rtx);
+ off = off < 0 ? 0 : off;
+ if (! stdarg_p)
+ off = off > 0 ? off - UNITS_PER_WORD : off;
+ if (TARGET_DEBUG_ARG)
+ fprintf (stderr, "va_start: n_gpr = %d, n_fpr = %d off %d\n",
+ n_gpr, n_fpr, off);
+
+ t = build (PLUS_EXPR, TREE_TYPE (ovf), t, build_int_2 (off, 0));
+
+ t = build (MODIFY_EXPR, TREE_TYPE (ovf), ovf, t);
+ TREE_SIDE_EFFECTS (t) = 1;
+ expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
+
+ /* Find the register save area. */
+ t = make_tree (TREE_TYPE (sav), virtual_incoming_args_rtx);
+ t = build (PLUS_EXPR, TREE_TYPE (sav), t,
+ build_int_2 (-STACK_POINTER_OFFSET, -1));
+ t = build (MODIFY_EXPR, TREE_TYPE (sav), sav, t);
+ TREE_SIDE_EFFECTS (t) = 1;
+ expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
+}
+
+/* Implement va_arg.
+
+ Generates code equivalent to:
+
+ if (integral value) {
+ if (size <= 4 && args.gpr < 5 ||
+ size > 4 && args.gpr < 4 )
+ ret = args.reg_save_area[args.gpr+8]
+ else
+ ret = *args.overflow_arg_area++;
+ } else if (float value) {
+ if (args.fgpr < 2)
+ ret = args.reg_save_area[args.fpr+64]
+ else
+ ret = *args.overflow_arg_area++;
+ } else if (aggregate value) {
+ if (args.gpr < 5)
+ ret = *args.reg_save_area[args.gpr]
+ else
+ ret = **args.overflow_arg_area++;
+ } */
+
+rtx
+s390_va_arg (tree valist, tree type)
+{
+ tree f_gpr, f_fpr, f_ovf, f_sav;
+ tree gpr, fpr, ovf, sav, reg, t, u;
+ int indirect_p, size, n_reg, sav_ofs, sav_scale, max_reg;
+ rtx lab_false, lab_over, addr_rtx, r;
+
+ f_gpr = TYPE_FIELDS (TREE_TYPE (va_list_type_node));
+ f_fpr = TREE_CHAIN (f_gpr);
+ f_ovf = TREE_CHAIN (f_fpr);
+ f_sav = TREE_CHAIN (f_ovf);
+
+ valist = build1 (INDIRECT_REF, TREE_TYPE (TREE_TYPE (valist)), valist);
+ gpr = build (COMPONENT_REF, TREE_TYPE (f_gpr), valist, f_gpr);
+ fpr = build (COMPONENT_REF, TREE_TYPE (f_fpr), valist, f_fpr);
+ ovf = build (COMPONENT_REF, TREE_TYPE (f_ovf), valist, f_ovf);
+ sav = build (COMPONENT_REF, TREE_TYPE (f_sav), valist, f_sav);
+
+ size = int_size_in_bytes (type);
+
+ if (s390_function_arg_pass_by_reference (TYPE_MODE (type), type))
+ {
+ if (TARGET_DEBUG_ARG)
+ {
+ fprintf (stderr, "va_arg: aggregate type");
+ debug_tree (type);
+ }
+
+ /* Aggregates are passed by reference. */
+ indirect_p = 1;
+ reg = gpr;
+ n_reg = 1;
+ sav_ofs = 2 * UNITS_PER_WORD;
+ sav_scale = UNITS_PER_WORD;
+ size = UNITS_PER_WORD;
+ max_reg = 4;
+ }
+ else if (FLOAT_TYPE_P (type) && ! TARGET_SOFT_FLOAT)
+ {
+ if (TARGET_DEBUG_ARG)
+ {
+ fprintf (stderr, "va_arg: float type");
+ debug_tree (type);
+ }
+
+ /* FP args go in FP registers, if present. */
+ indirect_p = 0;
+ reg = fpr;
+ n_reg = 1;
+ sav_ofs = 16 * UNITS_PER_WORD;
+ sav_scale = 8;
+ /* TARGET_64BIT has up to 4 parameter in fprs */
+ max_reg = TARGET_64BIT ? 3 : 1;
+ }
+ else
+ {
+ if (TARGET_DEBUG_ARG)
+ {
+ fprintf (stderr, "va_arg: other type");
+ debug_tree (type);
+ }
+
+ /* Otherwise into GP registers. */
+ indirect_p = 0;
+ reg = gpr;
+ n_reg = (size + UNITS_PER_WORD - 1) / UNITS_PER_WORD;
+ sav_ofs = 2 * UNITS_PER_WORD;
+ if (TARGET_64BIT)
+ sav_ofs += TYPE_MODE (type) == SImode ? 4 :
+ TYPE_MODE (type) == HImode ? 6 :
+ TYPE_MODE (type) == QImode ? 7 : 0;
+ else
+ sav_ofs += TYPE_MODE (type) == HImode ? 2 :
+ TYPE_MODE (type) == QImode ? 3 : 0;
+
+ sav_scale = UNITS_PER_WORD;
+ if (n_reg > 1)
+ max_reg = 3;
+ else
+ max_reg = 4;
+ }
+
+ /* Pull the value out of the saved registers ... */
+
+ lab_false = gen_label_rtx ();
+ lab_over = gen_label_rtx ();
+ addr_rtx = gen_reg_rtx (Pmode);
+
+ emit_cmp_and_jump_insns (expand_expr (reg, NULL_RTX, Pmode, EXPAND_NORMAL),
+ GEN_INT (max_reg),
+ GT, const1_rtx, Pmode, 0, 1, lab_false);
+
+ if (sav_ofs)
+ t = build (PLUS_EXPR, ptr_type_node, sav, build_int_2 (sav_ofs, 0));
+ else
+ t = sav;
+
+ u = build (MULT_EXPR, long_integer_type_node,
+ reg, build_int_2 (sav_scale, 0));
+ TREE_SIDE_EFFECTS (u) = 1;
+
+ t = build (PLUS_EXPR, ptr_type_node, t, u);
+ TREE_SIDE_EFFECTS (t) = 1;
+
+ r = expand_expr (t, addr_rtx, Pmode, EXPAND_NORMAL);
+ if (r != addr_rtx)
+ emit_move_insn (addr_rtx, r);
+
+
+ emit_jump_insn (gen_jump (lab_over));
+ emit_barrier ();
+ emit_label (lab_false);
+
+ /* ... Otherwise out of the overflow area. */
+
+ t = save_expr (ovf);
+
+
+ /* In 64 BIT for each argument on stack, a full 64 bit slot is allocated. */
+ if (size < UNITS_PER_WORD)
+ {
+ t = build (PLUS_EXPR, TREE_TYPE (t), t, build_int_2 (UNITS_PER_WORD-size, 0));
+ t = build (MODIFY_EXPR, TREE_TYPE (ovf), ovf, t);
+ TREE_SIDE_EFFECTS (t) = 1;
+ expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
+
+ t = save_expr (ovf);
+ }
+
+ r = expand_expr (t, addr_rtx, Pmode, EXPAND_NORMAL);
+ if (r != addr_rtx)
+ emit_move_insn (addr_rtx, r);
+
+ t = build (PLUS_EXPR, TREE_TYPE (t), t, build_int_2 (size, 0));
+ t = build (MODIFY_EXPR, TREE_TYPE (ovf), ovf, t);
+ TREE_SIDE_EFFECTS (t) = 1;
+ expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
+
+ emit_label (lab_over);
+
+ /* If less than max_regs a registers are retrieved out
+ of register save area, increment. */
+
+ u = build (PREINCREMENT_EXPR, TREE_TYPE (reg), reg,
+ build_int_2 (n_reg, 0));
+ TREE_SIDE_EFFECTS (u) = 1;
+ expand_expr (u, const0_rtx, VOIDmode, EXPAND_NORMAL);
+
+ if (indirect_p)
+ {
+ r = gen_rtx_MEM (Pmode, addr_rtx);
+ MEM_ALIAS_SET (r) = get_varargs_alias_set ();
+ emit_move_insn (addr_rtx, r);
+ }
+
+
+ return addr_rtx;
+}
+
+/* Do what is necessary for `va_start'. The argument is ignored;
+ we look at the current function to determine if stdarg or varargs
+ is used. */
+
+rtx
+s390_builtin_saveregs (arglist)
+ tree arglist ATTRIBUTE_UNUSED;
+{
+ rtx off, block, dest, tmp;
+ tree fntype = TREE_TYPE (current_function_decl);
+
+ int stdarg = (TYPE_ARG_TYPES (fntype) != 0
+ && (TREE_VALUE (tree_last (TYPE_ARG_TYPES (fntype)))
+ != void_type_node));
+
+ /* Allocate the va_list block. */
+
+ block = assign_stack_local (BLKmode, 4 * UNITS_PER_WORD, BITS_PER_WORD);
+ RTX_UNCHANGING_P (block) = 1;
+ RTX_UNCHANGING_P (XEXP (block, 0)) = 1;
+
+ /* Store the # of named gpr and fpr in 1st and 2nd word of va_list. */
+
+ dest = change_address (block, ptr_mode,
+ plus_constant (XEXP (block, 0), 0));
+ emit_move_insn (dest, GEN_INT (current_function_args_info.gprs));
+ dest = change_address (block, ptr_mode,
+ plus_constant (XEXP (block, 0), UNITS_PER_WORD));
+ emit_move_insn (dest, GEN_INT (current_function_args_info.fprs));
+
+ /* Store the address of the overflow area in 3rd word of va_list. */
+
+ if (stdarg)
+ off = current_function_arg_offset_rtx;
+ else
+ {
+ if (GET_CODE (current_function_arg_offset_rtx) != CONST_INT)
+ {
+ debug_rtx (current_function_arg_offset_rtx);
+ abort ();
+ }
+
+ if (INTVAL (current_function_arg_offset_rtx) != 0)
+ off = gen_rtx_CONST_INT (Pmode,
+ INTVAL (current_function_arg_offset_rtx)-
+ UNITS_PER_WORD);
+ else
+ off = current_function_arg_offset_rtx;
+ }
+
+ dest = change_address (block, ptr_mode,
+ plus_constant (XEXP (block, 0),
+ 2 * UNITS_PER_WORD));
+
+ tmp = expand_binop (Pmode, add_optab, virtual_incoming_args_rtx,
+ off,
+ dest, 0, OPTAB_WIDEN);
+ if (tmp != dest)
+ emit_move_insn (dest, tmp);
+
+ /* Store the address of the register save area in 4th word of va_list. */
+
+ dest = change_address (block, ptr_mode,
+ plus_constant (XEXP (block, 0),
+ 3 * UNITS_PER_WORD));
+
+ tmp = expand_binop (Pmode, add_optab, virtual_incoming_args_rtx,
+ GEN_INT (-STACK_POINTER_OFFSET),
+ dest, 0, OPTAB_WIDEN);
+ if (tmp != dest)
+ emit_move_insn (dest, tmp);
+
+ /* Return the address of the va_list block. */
+
+ return XEXP (block, 0);
+}
+
+
+/* Output assembly code for the trampoline template to
+ stdio stream FILE.
+
+ On S/390, we use gpr 1 internally in the trampoline code;
+ gpr 0 is used to hold the static chain. */
+
+void
+s390_trampoline_template (FILE * file)
+{
+ if (TARGET_64BIT)
+ {
+ fprintf (file, "larl\t%s,0f\n", reg_names[1]);
+ fprintf (file, "lg\t%s,0(%s)\n", reg_names[0], reg_names[1]);
+ fprintf (file, "lg\t%s,8(%s)\n", reg_names[1], reg_names[1]);
+ fprintf (file, "br\t%s\n", reg_names[1]);
+ fprintf (file, "0:\t.quad\t0\n");
+ fprintf (file, ".quad\t0\n");
+ }
+ else
+ {
+ fprintf (file, "basr\t%s,0\n", reg_names[1]);
+ fprintf (file, "l\t%s,10(%s)\n", reg_names[0], reg_names[1]);
+ fprintf (file, "l\t%s,14(%s)\n", reg_names[1], reg_names[1]);
+ fprintf (file, "br\t%s\n", reg_names[1]);
+ fprintf (file, ".long\t0\n");
+ fprintf (file, ".long\t0\n");
+ }
+}
+
+/* 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. */
+
+void
+s390_initialize_trampoline (addr, fnaddr, cxt)
+ rtx addr;
+ rtx fnaddr;
+ rtx cxt;
+{
+ emit_move_insn (gen_rtx
+ (MEM, Pmode,
+ memory_address (Pmode,
+ plus_constant (addr, (TARGET_64BIT ? 20 : 12) ))), cxt);
+ emit_move_insn (gen_rtx
+ (MEM, Pmode,
+ memory_address (Pmode,
+ plus_constant (addr, (TARGET_64BIT ? 28 : 16) ))), fnaddr);
+}
diff --git a/gcc/config/s390/s390.h b/gcc/config/s390/s390.h
new file mode 100644
index 00000000000..721bcb1412c
--- /dev/null
+++ b/gcc/config/s390/s390.h
@@ -0,0 +1,1881 @@
+/* Definitions of target machine for GNU compiler, for IBM S/390
+ Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
+ Contributed by Hartmut Penner (hpenner@de.ibm.com) and
+ Ulrich Weigand (uweigand@de.ibm.com).
+This file is part of GNU CC.
+
+GNU CC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU CC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU CC; see the file COPYING. If not, write to
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA. */
+
+#ifndef _S390_H
+#define _S390_H
+
+#define TARGET_VERSION fprintf (stderr, " (S/390)");
+
+extern int flag_pic;
+
+/* Run-time compilation parameters selecting different hardware subsets. */
+
+extern int target_flags;
+
+/* Target macros checked at runtime of compiler. */
+
+#define TARGET_HARD_FLOAT (target_flags & 1)
+#define TARGET_BACKCHAIN (target_flags & 2)
+#define TARGET_SMALL_EXEC (target_flags & 4)
+#define TARGET_DEBUG_ARG (target_flags & 8)
+#define TARGET_64BIT (target_flags & 16)
+#define TARGET_MVCLE (target_flags & 32)
+
+#define TARGET_DEFAULT 0x3
+#define TARGET_SOFT_FLOAT (!(target_flags & 1))
+
+/* Macro to define tables used to set the flags. This is a list in braces
+ of pairs in braces, each pair being { "NAME", VALUE }
+ where VALUE is the bits to set or minus the bits to clear.
+ An empty string NAME is used to identify the default VALUE. */
+
+#define TARGET_SWITCHES \
+{ { "hard-float", 1, N_("Use hardware fp")}, \
+ { "soft-float", -1, N_("Don't use hardware fp")}, \
+ { "backchain", 2, N_("Set backchain")}, \
+ { "no-backchain", -2, N_("Don't set backchain (faster, but debug harder")}, \
+ { "small-exec", 4, N_("Use bras for execucable < 64k")}, \
+ { "no-small-exec",-4, N_("Don't use bras")}, \
+ { "debug", 8, N_("Additional debug prints")}, \
+ { "no-debug", -8, N_("Don't print additional debug prints")}, \
+ { "64", 16, N_("64 bit mode")}, \
+ { "31", -16, N_("31 bit mode")}, \
+ { "mvcle", 32, N_("mvcle use")}, \
+ { "no-mvcle", -32, N_("mvc&ex")}, \
+ { "", TARGET_DEFAULT, 0 } }
+
+/* Define this to change the optimizations performed by default. */
+#define OPTIMIZATION_OPTIONS(LEVEL, SIZE) optimization_options(LEVEL, SIZE)
+
+/* Defines for REAL_ARITHMETIC. */
+#define IEEE_FLOAT 1
+#define TARGET_IBM_FLOAT 0
+#define TARGET_IEEE_FLOAT 1
+
+/* The current function count for create unique internal labels. */
+
+extern int s390_function_count;
+
+/* The amount of space used for outgoing arguments. */
+
+extern int current_function_outgoing_args_size;
+
+/* Target machine storage layout. */
+
+/* Define this if most significant bit is lowest numbered in instructions
+ that operate on numbered bit-fields. */
+
+#define BITS_BIG_ENDIAN 1
+
+/* Define this if most significant byte of a word is the lowest numbered. */
+
+#define BYTES_BIG_ENDIAN 1
+
+/* Define this if MS word of a multiword 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. */
+
+#define BITS_PER_WORD (TARGET_64BIT ? 64 : 32)
+#define MAX_BITS_PER_WORD 64
+
+/* Width of a word, in units (bytes). */
+
+#define UNITS_PER_WORD (TARGET_64BIT ? 8 : 4)
+#define MIN_UNITS_PER_WORD 4
+
+/* Width in bits of a pointer. See also the macro `Pmode' defined below. */
+
+#define POINTER_SIZE (TARGET_64BIT ? 64 : 32)
+
+/* 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.) */
+#define SHORT_TYPE_SIZE 16
+
+/* 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. */
+#define INT_TYPE_SIZE 32
+
+/* 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. */
+#define LONG_TYPE_SIZE (TARGET_64BIT ? 64 : 32)
+#define MAX_LONG_TYPE_SIZE 64
+
+/* 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. */
+#define LONG_LONG_TYPE_SIZE 64
+
+/* Right now we only support two floating point formats, the
+ 32 and 64 bit ieee formats. */
+
+#define FLOAT_TYPE_SIZE 32
+#define DOUBLE_TYPE_SIZE 64
+#define LONG_DOUBLE_TYPE_SIZE 64
+
+/* Define this macro if it is advisable to hold scalars in registers
+ in a wider mode than that declared by the program. In such cases,
+ the value is constrained to be within the bounds of the declared
+ type, but kept valid in the wider mode. The signedness of the
+ extension may differ from that of the type. */
+
+#define PROMOTE_MODE(MODE, UNSIGNEDP, TYPE) \
+if (INTEGRAL_MODE_P (MODE) && \
+ GET_MODE_SIZE (MODE) < UNITS_PER_WORD) { \
+ (MODE) = Pmode; \
+ }
+
+/* Defining PROMOTE_FUNCTION_ARGS eliminates some unnecessary zero/sign
+ extensions applied to char/short functions arguments. Defining
+ PROMOTE_FUNCTION_RETURN does the same for function returns. */
+
+#define PROMOTE_FUNCTION_ARGS
+#define PROMOTE_FUNCTION_RETURN
+#define PROMOTE_FOR_CALL_ONLY
+
+/* Allocation boundary (in *bits*) for storing pointers in memory. */
+
+#define POINTER_BOUNDARY 32
+
+/* Allocation boundary (in *bits*) for storing arguments in argument list. */
+
+#define PARM_BOUNDARY (TARGET_64BIT ? 64 : 32)
+
+/* Boundary (in *bits*) on which stack pointer should be aligned. */
+
+#define STACK_BOUNDARY 64
+
+/* Allocation boundary (in *bits*) for the code of a function. */
+
+#define FUNCTION_BOUNDARY 32
+
+/* There is no point aligning anything to a rounder boundary than this. */
+
+#define BIGGEST_ALIGNMENT 64
+
+/* Alignment of field after `int : 0' in a structure. */
+
+#define EMPTY_FIELD_BOUNDARY 32
+
+/* Alignment on even adresses for LARL instruction. */
+
+#define CONSTANT_ALIGNMENT(EXP, ALIGN) (ALIGN) < 16 ? 16 : (ALIGN)
+
+#define DATA_ALIGNMENT(TYPE, ALIGN) (ALIGN) < 16 ? 16 : (ALIGN)
+
+/* Define this if move instructions will actually fail to work when given
+ unaligned data. */
+
+#define STRICT_ALIGNMENT 0
+
+/* real arithmetic */
+
+#define REAL_ARITHMETIC
+
+/* Define target floating point format. */
+
+#undef TARGET_FLOAT_FORMAT
+#ifdef IEEE_FLOAT
+#define TARGET_FLOAT_FORMAT IEEE_FLOAT_FORMAT
+#else
+#define TARGET_FLOAT_FORMAT IBM_FLOAT_FORMAT
+#endif
+
+/* Define if special allocation order desired. */
+
+#define REG_ALLOC_ORDER \
+{ 1, 2, 3, 4, 5, 0, 14, 13, 12, 11, 10, 9, 8, 7, 6, \
+ 16, 17, 18, 19, 20, 21, 22, 23, \
+ 24, 25, 26, 27, 28, 29, 30, 31, \
+ 15, 32, 33 }
+
+/* Standard register usage. */
+
+#define INT_REGNO_P(N) ( (N) >= 0 && (N) < 16 )
+#ifdef IEEE_FLOAT
+#define FLOAT_REGNO_P(N) ( (N) >= 16 && (N) < 32 )
+#else
+#define FLOAT_REGNO_P(N) ( (N) >= 16 && (N) < 20 )
+#endif
+#define CC_REGNO_P(N) ( (N) == 33 )
+
+/* Number of actual hardware registers. The hardware registers are
+ assigned numbers for the compiler from 0 to just below
+ FIRST_PSEUDO_REGISTER.
+ All registers that the compiler knows about must be given numbers,
+ even those that are not normally considered general registers.
+ For the 390, we give the data registers numbers 0-15,
+ and the floating point registers numbers 16-19.
+ G5 and following have 16 IEEE floating point register,
+ which get numbers 16-31. */
+
+#define FIRST_PSEUDO_REGISTER 34
+
+/* The following register have a fix usage
+ GPR 12: GOT register points to the GOT, setup in prologue,
+ GOT contains pointer to variables in shared libraries
+ GPR 13: Base register setup in prologue to point to the
+ literal table of each function
+ GPR 14: Return registers holds the return address
+ GPR 15: Stack pointer */
+
+#define PIC_OFFSET_TABLE_REGNUM 12
+#define BASE_REGISTER 13
+#define RETURN_REGNUM 14
+#define STACK_POINTER_REGNUM 15
+
+#define FIXED_REGISTERS \
+{ 0, 0, 0, 0, \
+ 0, 0, 0, 0, \
+ 0, 0, 0, 0, \
+ 0, 1, 1, 1, \
+ 0, 0, 0, 0, \
+ 0, 0, 0, 0, \
+ 0, 0, 0, 0, \
+ 0, 0, 0, 0, \
+ 1, 1 }
+
+/* 1 for registers not available across function calls. These must include
+ the FIXED_REGISTERS and also any registers that can be used without being
+ saved.
+ The latter must include the registers where values are returned
+ and the register where structure-value addresses are passed. */
+
+#define CALL_USED_REGISTERS \
+{ 1, 1, 1, 1, \
+ 1, 1, 0, 0, \
+ 0, 0, 0, 0, \
+ 0, 1, 1, 1, \
+ 1, 1, 0, 0, \
+ 1, 1, 1, 1, \
+ 1, 1, 1, 1, \
+ 1, 1, 1, 1, \
+ 1, 1 }
+
+/* If not pic code, gpr 12 can be used. */
+
+#define CONDITIONAL_REGISTER_USAGE \
+do \
+ { \
+ if (flag_pic) \
+ { \
+ fixed_regs[PIC_OFFSET_TABLE_REGNUM] = 1; \
+ call_used_regs[PIC_OFFSET_TABLE_REGNUM] = 1; \
+ } \
+ } while (0)
+
+/* The following register have a special usage
+ GPR 11: Frame pointer if needed to point to automatic variables.
+ GPR 32: In functions with more the 5 args this register
+ points to that arguments, it is always eliminated
+ with stack- or frame-pointer.
+ GPR 33: Condition code 'register' */
+
+#define FRAME_POINTER_REGNUM 11
+
+#define ARG_POINTER_REGNUM 32
+
+#define CC_REGNUM 33
+
+/* We use the register %r0 to pass the static chain to a nested function.
+
+ Note: It is assumed that this register is call-clobbered!
+ We can't use any of the function-argument registers either,
+ and register 1 is needed by the trampoline code, so we have
+ no other choice but using this one ... */
+
+#define STATIC_CHAIN_REGNUM 0
+
+/* Return number of consecutive hard regs needed starting at reg REGNO
+ to hold something of mode MODE.
+ This is ordinarily the length in words of a value of mode MODE
+ but can be less for certain modes in special long registers. */
+
+#define HARD_REGNO_NREGS(REGNO, MODE) \
+ (FLOAT_REGNO_P(REGNO)? \
+ (GET_MODE_CLASS(MODE) == MODE_COMPLEX_FLOAT ? 2 : 1) : \
+ INT_REGNO_P(REGNO)? \
+ ((GET_MODE_SIZE(MODE)+UNITS_PER_WORD-1) / UNITS_PER_WORD) : \
+ 1)
+
+/* Value is 1 if hard register REGNO can hold a value of machine-mode MODE.
+ The gprs can hold QI, HI, SI, SF, DF, SC and DC.
+ Even gprs can hold DI.
+ The floating point registers can hold DF, SF, DC and SC. */
+
+#define HARD_REGNO_MODE_OK(REGNO, MODE) \
+ (FLOAT_REGNO_P(REGNO)? \
+ (GET_MODE_CLASS(MODE) == MODE_FLOAT || \
+ GET_MODE_CLASS(MODE) == MODE_COMPLEX_FLOAT) : \
+ INT_REGNO_P(REGNO)? \
+ (HARD_REGNO_NREGS(REGNO, MODE) == 1 || !((REGNO) & 1)) : \
+ CC_REGNO_P(REGNO)? \
+ GET_MODE_CLASS (MODE) == MODE_CC : \
+ 0)
+
+/* Value is 1 if it is a good idea to tie two pseudo registers when one has
+ mode MODE1 and one has mode MODE2.
+ If HARD_REGNO_MODE_OK could produce different values for MODE1 and MODE2,
+ for any hard reg, then this must be 0 for correct output. */
+
+#define MODES_TIEABLE_P(MODE1, MODE2) \
+ (((MODE1) == SFmode || (MODE1) == DFmode) \
+ == ((MODE2) == SFmode || (MODE2) == DFmode))
+
+
+/* Define this macro if references to a symbol must be treated
+ differently depending on something about the variable or
+ function named by the symbol (such as what section it is in).
+
+ On s390, if using PIC, mark a SYMBOL_REF for a non-global symbol
+ so that we may access it directly in the GOT. */
+
+#define ENCODE_SECTION_INFO(DECL) \
+do \
+ { \
+ if (flag_pic) \
+ { \
+ rtx rtl = (TREE_CODE_CLASS (TREE_CODE (DECL)) != 'd' \
+ ? TREE_CST_RTL (DECL) : DECL_RTL (DECL)); \
+ \
+ if (GET_CODE (rtl) == MEM) \
+ { \
+ SYMBOL_REF_FLAG (XEXP (rtl, 0)) \
+ = (TREE_CODE_CLASS (TREE_CODE (DECL)) != 'd' \
+ || ! TREE_PUBLIC (DECL)); \
+ } \
+ } \
+ } \
+while (0)
+
+
+/* This is an array of structures. Each structure initializes one pair
+ of eliminable registers. The "from" register number is given first,
+ followed by "to". Eliminations of the same "from" register are listed
+ in order of preference. */
+
+#define ELIMINABLE_REGS \
+{{ FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}, \
+ { ARG_POINTER_REGNUM, STACK_POINTER_REGNUM}, \
+ { ARG_POINTER_REGNUM, FRAME_POINTER_REGNUM}}
+
+#define CAN_ELIMINATE(FROM, TO) (1)
+
+#define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \
+{ if ((FROM) == FRAME_POINTER_REGNUM && (TO) == STACK_POINTER_REGNUM) \
+ { (OFFSET) = 0; } \
+ else if ((FROM) == ARG_POINTER_REGNUM && (TO) == FRAME_POINTER_REGNUM) \
+ { (OFFSET) = s390_arg_frame_offset (); } \
+ else if ((FROM) == ARG_POINTER_REGNUM && (TO) == STACK_POINTER_REGNUM) \
+ { (OFFSET) = s390_arg_frame_offset (); } \
+}
+
+#define CAN_DEBUG_WITHOUT_FP
+
+/* 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 via the stack pointer) in functions that seem suitable.
+ This is computed in `reload', in reload1.c. */
+
+#define FRAME_POINTER_REQUIRED 0
+
+/* Define the classes of registers for register constraints in the
+ machine description. Also define ranges of constants.
+
+ One of the classes must always be named ALL_REGS and include all hard regs.
+ If there is more than one class, another class must be named NO_REGS
+ and contain no registers.
+
+ The name GENERAL_REGS must be the name of a class (or an alias for
+ another name such as ALL_REGS). This is the class of registers
+ that is allowed by "g" or "r" in a register constraint.
+ Also, registers outside this class are allocated only when
+ instructions express preferences for them.
+
+ The classes must be numbered in nondecreasing order; that is,
+ a larger-numbered class must never be contained completely
+ in a smaller-numbered class.
+
+ For any two classes, it is very desirable that there be another
+ class that represents their union. */
+
+/*#define SMALL_REGISTER_CLASSES 1*/
+
+enum reg_class
+{
+ NO_REGS, ADDR_REGS, GENERAL_REGS,
+ FP_REGS, ALL_REGS, LIM_REG_CLASSES
+};
+
+#define N_REG_CLASSES (int) LIM_REG_CLASSES
+
+/* Give names of register classes as strings for dump file. */
+
+#define REG_CLASS_NAMES \
+{ "NO_REGS","ADDR_REGS", "GENERAL_REGS", "FP_REGS", "ALL_REGS" }
+
+/* Define which registers fit in which classes. This is an initializer for
+ a vector of HARD_REG_SET of length N_REG_CLASSES.
+ G5 and latter have 16 register and support IEEE floating point operations. */
+
+#define REG_CLASS_CONTENTS \
+{ \
+ { 0x00000000, 0x00000000 }, /* NO_REGS */ \
+ { 0x0000fffe, 0x00000001 }, /* ADDR_REGS */ \
+ { 0x0000ffff, 0x00000001 }, /* GENERAL_REGS */ \
+ { 0xffff0000, 0x00000000 }, /* FP_REGS */ \
+ { 0xffffffff, 0x00000003 }, /* ALL_REGS */ \
+}
+
+
+/* The same information, inverted:
+ Return the class number of the smallest class containing
+ reg number REGNO. This could be a conditional expression
+ or could index an array. */
+
+#define REGNO_REG_CLASS(REGNO) (regclass_map[REGNO])
+
+extern enum reg_class regclass_map[]; /* smalled class containing REGNO */
+
+/* The class value for index registers, and the one for base regs. */
+
+#define INDEX_REG_CLASS ADDR_REGS
+#define BASE_REG_CLASS ADDR_REGS
+
+/* Get reg_class from a letter such as appears in the machine description. */
+
+#define REG_CLASS_FROM_LETTER(C) \
+ ((C) == 'a' ? ADDR_REGS : \
+ (C) == 'd' ? GENERAL_REGS : \
+ (C) == 'f' ? FP_REGS : NO_REGS)
+
+/* 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. */
+
+#define CONST_OK_FOR_LETTER_P(VALUE, C) \
+ ((C) == 'I' ? (unsigned long) (VALUE) < 256 : \
+ (C) == 'J' ? (unsigned long) (VALUE) < 4096 : \
+ (C) == 'K' ? (VALUE) >= -32768 && (VALUE) < 32768 : \
+ (C) == 'L' ? (unsigned long) (VALUE) < 65536 : 0)
+
+/* Similar, but for floating constants, and defining letters G and H.
+ Here VALUE is the CONST_DOUBLE rtx itself. */
+
+#define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) 1
+
+/* 'Q' means a memory-reference for a S-type operand. */
+
+#define EXTRA_CONSTRAINT(OP, C) \
+ ((C) == 'Q' ? s_operand (OP, GET_MODE (OP)) : \
+ (C) == 'S' ? larl_operand (OP, GET_MODE (OP)) : 0)
+
+/* Given an rtx X being reloaded into a reg required to be in class CLASS,
+ return the class of reg to actually use. In general this is just CLASS;
+ but on some machines in some cases it is preferable to use a more
+ restrictive class. */
+
+#define PREFERRED_RELOAD_CLASS(X, CLASS) \
+ (GET_CODE (X) == CONST_DOUBLE ? \
+ (GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT ? FP_REGS : ADDR_REGS) :\
+ (GET_CODE (X) == CONST_INT ? \
+ (GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT ? FP_REGS : ADDR_REGS) :\
+ GET_CODE (X) == PLUS || \
+ GET_CODE (X) == LABEL_REF || \
+ GET_CODE (X) == SYMBOL_REF || \
+ GET_CODE (X) == CONST ? ADDR_REGS : (CLASS)))
+
+/* Return the maximum number of consecutive registers needed to represent
+ mode MODE in a register of class CLASS. */
+
+#define CLASS_MAX_NREGS(CLASS, MODE) \
+ ((CLASS) == FP_REGS ? \
+ (GET_MODE_CLASS (MODE) == MODE_COMPLEX_FLOAT ? 2 : 1) : \
+ (GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
+
+/* If we are copying between FP registers and anything else, we need a memory
+ location. */
+
+#define SECONDARY_MEMORY_NEEDED(CLASS1, CLASS2, MODE) \
+ ((CLASS1) != (CLASS2) && ((CLASS1) == FP_REGS || (CLASS2) == FP_REGS))
+
+/* Get_secondary_mem widens its argument to BITS_PER_WORD which loses on 64bit
+ because the movsi and movsf patterns don't handle r/f moves. */
+
+#define SECONDARY_MEMORY_NEEDED_MODE(MODE) \
+ (GET_MODE_BITSIZE (MODE) < 32 \
+ ? mode_for_size (32, GET_MODE_CLASS (MODE), 0) \
+ : MODE)
+
+
+/* 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. */
+
+/* Stack layout; function entry, exit and calling. */
+
+/* The current return address is on Offset 56 of the current frame
+ if we are in an leaf_function. Otherwise we have to go one stack
+ back.
+ The return address of anything farther back is accessed normally
+ at an offset of 56 from the frame pointer.
+
+ FIXME: builtin_return_addr does not work correctly in a leaf
+ function, we need to find way to find out, if we
+ are in a leaf function
+ */
+
+#define _RETURN_ADDR_OFFSET (TARGET_64BIT ? 112 : 56)
+
+#define RETURN_ADDR_RTX(count, frame) \
+ gen_rtx (MEM, Pmode, \
+ memory_address (Pmode, \
+ plus_constant ( \
+ copy_to_reg (gen_rtx (MEM, Pmode, \
+ memory_address (Pmode, frame))), \
+ _RETURN_ADDR_OFFSET)));
+
+/* The following macros will turn on dwarf2 exception hndling
+ Other code location for this exception handling are
+ in s390.md (eh_return insn) and in linux.c in the prologue. */
+
+#define INCOMING_RETURN_ADDR_RTX gen_rtx_REG (Pmode, RETURN_REGNUM)
+
+/* We have 31 bit mode. */
+
+#define MASK_RETURN_ADDR (GEN_INT (0x7fffffff))
+
+/* Location, from where return address to load. */
+
+#define DWARF_FRAME_RETURN_COLUMN 14
+
+/* Describe how we implement __builtin_eh_return. */
+#define EH_RETURN_DATA_REGNO(N) ((N) < 4 ? (N) + 6 : INVALID_REGNUM)
+#define EH_RETURN_STACKADJ_RTX gen_rtx_REG (Pmode, 10)
+#define EH_RETURN_HANDLER_RTX \
+ gen_rtx_MEM (Pmode, plus_constant (arg_pointer_rtx, \
+ TARGET_64BIT? -48 : -40))
+
+/* Define this if pushing a word on the stack makes the stack pointer a
+ smaller address. */
+
+#define STACK_GROWS_DOWNWARD
+
+/* Define this if the nominal address of the stack frame is at the
+ high-address end of the local variables; that is, each additional local
+ variable allocated goes at a more negative offset in the frame. */
+
+/* #define FRAME_GROWS_DOWNWARD */
+
+/* Offset from stack-pointer to first location of outgoing args. */
+
+#define STACK_POINTER_OFFSET (TARGET_64BIT ? 160 : 96)
+
+/* Offset within stack frame to start allocating local variables at.
+ If FRAME_GROWS_DOWNWARD, this is the offset to the END of the
+ first local allocated. Otherwise, it is the offset to the BEGINNING
+ of the first local allocated. */
+
+#define STARTING_FRAME_OFFSET \
+ (STACK_POINTER_OFFSET + current_function_outgoing_args_size)
+
+#define INITIAL_FRAME_POINTER_OFFSET(DEPTH) (DEPTH) = 0
+
+/* If we generate an insn to push BYTES bytes, this says how many the stack
+ pointer really advances by. On S/390, we have no push instruction. */
+
+/* #define PUSH_ROUNDING(BYTES) */
+
+/* Accumulate the outgoing argument count so we can request the right
+ DSA size and determine stack offset. */
+
+#define ACCUMULATE_OUTGOING_ARGS 1
+
+/* 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_DYNAMIC_OFFSET(FUNDECL) (STARTING_FRAME_OFFSET)
+
+/* Offset of first parameter from the argument pointer register value.
+ On the S/390, we define the argument pointer to the start of the fixed
+ area. */
+#define FIRST_PARM_OFFSET(FNDECL) 0
+
+/* Define this if stack space is still allocated for a parameter passed
+ in a register. The value is the number of bytes allocated to this
+ area. */
+/* #define REG_PARM_STACK_SPACE(FNDECL) 32 */
+
+/* Define this if the above stack space is to be considered part of the
+ space allocated by the caller. */
+/* #define OUTGOING_REG_PARM_STACK_SPACE */
+
+/* 1 if N is a possible register number for function argument passing.
+ On S390, general registers 2 - 6 and floating point register 0 and 2
+ are used in this way. */
+
+#define FUNCTION_ARG_REGNO_P(N) (((N) >=2 && (N) <7) || \
+ (N) == 16 || (N) == 17)
+
+/* Define a data type for recording info about an argument list during
+ the scan of that argument list. This data type should hold all
+ necessary information about the function itself and about the args
+ processed so far, enough to enable macros such as FUNCTION_ARG to
+ determine where the next arg should go. */
+
+typedef struct s390_arg_structure
+{
+ int gprs; /* gpr so far */
+ int fprs; /* fpr so far */
+}
+CUMULATIVE_ARGS;
+
+
+/* Initialize a variable CUM of type CUMULATIVE_ARGS for a call to
+ a function whose data type is FNTYPE.
+ For a library call, FNTYPE is 0. */
+
+#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, NN) \
+ ((CUM).gprs=0, (CUM).fprs=0)
+
+/* 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) \
+ s390_function_arg_advance (&CUM, MODE, TYPE, NAMED)
+
+/* 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. */
+
+#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
+ s390_function_arg (&CUM, MODE, TYPE, NAMED)
+
+/* Define where to expect the arguments of a function. Value is zero, if
+ the argument is on the stack, or a hard register in which the argument
+ is stored. It is the same like FUNCTION_ARG, except for unnamed args
+ That means, that all in case of varargs used, the arguments are expected
+ from the stack.
+ S/390 has already space on the stack for args coming in registers,
+ they are pushed in prologue, if needed. */
+
+
+/* Define the `__builtin_va_list' type. */
+
+#define BUILD_VA_LIST_TYPE(VALIST) \
+ (VALIST) = s390_build_va_list ()
+
+/* Implement `va_start' for varargs and stdarg. */
+
+#define EXPAND_BUILTIN_VA_START(stdarg, valist, nextarg) \
+ s390_va_start (stdarg, valist, nextarg)
+
+/* Implement `va_arg'. */
+
+#define EXPAND_BUILTIN_VA_ARG(valist, type) \
+ s390_va_arg (valist, type)
+
+/* For an arg passed partly in registers and partly in memory, 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) 0
+
+
+/* Define if returning from a function call automatically pops the
+ arguments described by the number-of-args field in the call. */
+
+#define RETURN_POPS_ARGS(FUNDECL, FUNTYPE, SIZE) 0
+
+
+/* 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 15. */
+
+#define RET_REG(MODE) ((GET_MODE_CLASS (MODE) == MODE_INT \
+ || TARGET_SOFT_FLOAT ) ? 2 : 16)
+
+
+/* for structs the address is passed, and the Callee makes a
+ copy, only if needed */
+
+#define FUNCTION_ARG_PASS_BY_REFERENCE(CUM, MODE, TYPE, NAMED) \
+ s390_function_arg_pass_by_reference (MODE, TYPE)
+
+
+/* Register 2 (and 3) for integral values
+ or floating point register 0 (and 2) for fp values are used. */
+
+#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), \
+ TREE_CODE (VALTYPE) == REAL_TYPE && TARGET_HARD_FLOAT ? 16 : 2)
+
+/* Define how to find the value returned by a library function assuming
+ the value has mode MODE. */
+
+#define LIBCALL_VALUE(MODE) gen_rtx (REG, MODE, RET_REG (MODE))
+
+/* 1 if N is a possible register number for a function value. */
+
+#define FUNCTION_VALUE_REGNO_P(N) ((N) == 2 || (N) == 16)
+
+/* The definition of this macro implies that there are cases where
+ a scalar value cannot be returned in registers. */
+
+#define RETURN_IN_MEMORY(type) \
+ (TYPE_MODE (type) == BLKmode || \
+ GET_MODE_CLASS (TYPE_MODE (type)) == MODE_COMPLEX_INT || \
+ GET_MODE_CLASS (TYPE_MODE (type)) == MODE_COMPLEX_FLOAT)
+
+/* Mode of stack savearea.
+ FUNCTION is VOIDmode because calling convention maintains SP.
+ BLOCK needs Pmode for SP.
+ NONLOCAL needs twice Pmode to maintain both backchain and SP. */
+
+#define STACK_SAVEAREA_MODE(LEVEL) \
+ (LEVEL == SAVE_FUNCTION ? VOIDmode \
+ : LEVEL == SAVE_NONLOCAL ? (TARGET_64BIT ? TImode : DImode) : Pmode)
+
+/* Structure value address is passed as invisible first argument (gpr 2). */
+
+#define STRUCT_VALUE 0
+
+/* This macro definition sets up a default value for `main' to return. */
+
+#define DEFAULT_MAIN_RETURN c_expand_return (integer_zero_node)
+
+/* Length in units of the trampoline for entering a nested function. */
+
+#define TRAMPOLINE_SIZE (TARGET_64BIT ? 36 : 20)
+
+/* Initialize the dynamic part of trampoline. */
+
+#define INITIALIZE_TRAMPOLINE(ADDR, FNADDR, CXT) \
+ s390_initialize_trampoline ((ADDR), (FNADDR), (CXT))
+
+/* Template for constant part of trampoline. */
+
+#define TRAMPOLINE_TEMPLATE(FILE) \
+ s390_trampoline_template (FILE)
+
+/* Output assembler code to FILE to increment profiler label # LABELNO
+ for profiling a function entry. */
+
+#define FUNCTION_PROFILER(FILE, LABELNO) \
+do { \
+ extern rtx s390_profile[]; \
+ extern s390_pool_count; \
+ rtx tmp; \
+ static char label[128]; \
+ fprintf (FILE, "# function profiler \n"); \
+ if (TARGET_64BIT) \
+ { \
+ rtx tmp[1]; \
+ output_asm_insn ("stg\t14,8(15)", tmp); \
+ sprintf (label, "%sP%d", LPREFIX, LABELNO); \
+ tmp[0] = gen_rtx_SYMBOL_REF (Pmode, label); \
+ SYMBOL_REF_FLAG (tmp[0]) = 1; \
+ output_asm_insn ("larl\t1,%0", tmp); \
+ tmp[0] = gen_rtx_SYMBOL_REF (Pmode, "_mcount"); \
+ if (flag_pic) \
+ { \
+ tmp[0] = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, tmp[0]), 113); \
+ tmp[0] = gen_rtx_CONST (Pmode, tmp[0]); \
+ } \
+ output_asm_insn ("brasl\t14,%0", tmp); \
+ output_asm_insn ("lg\t14,8(15)", tmp); \
+ } \
+ else \
+ { \
+ output_asm_insn ("l 14,4(15)", s390_profile); \
+ s390_pool_count = 0; \
+ output_asm_insn ("st 14,4(15)", s390_profile); \
+ output_asm_insn ("l 14,%4", s390_profile); \
+ output_asm_insn ("l 1,%9", s390_profile); \
+ if (flag_pic) \
+ { \
+ output_asm_insn ("ar 1,13", s390_profile); \
+ output_asm_insn ("bas 14,0(14,13)", s390_profile); \
+ } \
+ else \
+ { \
+ output_asm_insn ("basr 14,14", s390_profile); \
+ } \
+ output_asm_insn ("l 14,4(15)", s390_profile); \
+ } \
+} while (0)
+
+/* #define PROFILE_BEFORE_PROLOGUE */
+
+/* There are three profiling modes for basic blocks available.
+ The modes are selected at compile time by using the options
+ -a or -ax of the gnu compiler.
+ The variable `profile_block_flag' will be set according to the
+ selected option.
+
+ profile_block_flag == 0, no option used:
+
+ No profiling done.
+
+ profile_block_flag == 1, -a option used.
+
+ Count frequency of execution of every basic block.
+
+ profile_block_flag == 2, -ax option used.
+
+ Generate code to allow several different profiling modes at run time.
+ Available modes are:
+ Produce a trace of all basic blocks.
+ Count frequency of jump instructions executed.
+ In every mode it is possible to start profiling upon entering
+ certain functions and to disable profiling of some other functions.
+
+ The result of basic-block profiling will be written to a file `bb.out'.
+ If the -ax option is used parameters for the profiling will be read
+ from file `bb.in'.
+
+*/
+
+/* The following macro shall output assembler code to FILE
+ to initialize basic-block profiling.
+
+ If profile_block_flag == 2
+
+ Output code to call the subroutine `__bb_init_trace_func'
+ and pass two parameters to it. The first parameter is
+ the address of a block allocated in the object module.
+ The second parameter is the number of the first basic block
+ of the function.
+
+ The name of the block is a local symbol made with this statement:
+
+ ASM_GENERATE_INTERNAL_LABEL (BUFFER, "LPBX", 0);
+
+ Of course, since you are writing the definition of
+ `ASM_GENERATE_INTERNAL_LABEL' as well as that of this macro, you
+ can take a short cut in the definition of this macro and use the
+ name that you know will result.
+
+ The number of the first basic block of the function is
+ passed to the macro in BLOCK_OR_LABEL.
+
+ If described in a virtual assembler language the code to be
+ output looks like:
+
+ parameter1 <- LPBX0
+ parameter2 <- BLOCK_OR_LABEL
+ call __bb_init_trace_func
+
+ else if profile_block_flag != 0
+
+ Output code to call the subroutine `__bb_init_func'
+ and pass one single parameter to it, which is the same
+ as the first parameter to `__bb_init_trace_func'.
+
+ The first word of this parameter is a flag which will be nonzero if
+ the object module has already been initialized. So test this word
+ first, and do not call `__bb_init_func' if the flag is nonzero.
+ Note: When profile_block_flag == 2 the test need not be done
+ but `__bb_init_trace_func' *must* be called.
+
+ BLOCK_OR_LABEL may be used to generate a label number as a
+ branch destination in case `__bb_init_func' will not be called.
+
+ If described in a virtual assembler language the code to be
+ output looks like:
+
+ cmp (LPBX0),0
+ jne local_label
+ parameter1 <- LPBX0
+ call __bb_init_func
+local_label:
+
+*/
+
+#undef FUNCTION_BLOCK_PROFILER
+#define FUNCTION_BLOCK_PROFILER(FILE, BLOCK_OR_LABEL) \
+do \
+ { \
+ if (TARGET_64BIT) \
+ { \
+ rtx tmp[1]; \
+ fprintf (FILE, "# function block profiler %d \n", profile_block_flag); \
+ output_asm_insn ("ipm 0", tmp); \
+ output_asm_insn ("aghi 15,-224", tmp); \
+ output_asm_insn ("stmg 14,5,160(15)", tmp); \
+ output_asm_insn ("larl 2,.LPBX0", tmp); \
+ switch (profile_block_flag) \
+ { \
+ case 2: \
+ if (BLOCK_OR_LABEL < 0x10000) { \
+ tmp[0] = gen_rtx_CONST_INT (Pmode, (BLOCK_OR_LABEL)); \
+ output_asm_insn ("llill 3,%x0", tmp); \
+ } else { \
+ int bo = BLOCK_OR_LABEL; \
+ tmp[0] = gen_rtx_CONST_INT (Pmode, bo&0x7fff); \
+ output_asm_insn ("llill 3,%x0", tmp); \
+ tmp[0] = gen_rtx_CONST_INT (Pmode, (bo&0xffff0000)>>16); \
+ output_asm_insn ("iilh 3,%x0", tmp); \
+ } \
+ tmp[0] = gen_rtx_SYMBOL_REF (Pmode, "__bb_init_trace_func"); \
+ if (flag_pic) \
+ { \
+ tmp[0] = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, tmp[0]), 113); \
+ tmp[0] = gen_rtx_CONST (Pmode, tmp[0]); \
+ } \
+ output_asm_insn ("brasl\t14,%0", tmp); \
+ break; \
+ default: \
+ output_asm_insn ("cli 7(2),0", tmp); \
+ output_asm_insn ("jne 2f", tmp); \
+ tmp[0] = gen_rtx_SYMBOL_REF (Pmode, "__bb_init_func"); \
+ if (flag_pic) \
+ { \
+ tmp[0] = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, tmp[0]), 113); \
+ tmp[0] = gen_rtx_CONST (Pmode, tmp[0]); \
+ } \
+ output_asm_insn ("brasl\t14,%0", tmp); \
+ break; \
+ } \
+ output_asm_insn ("2:", tmp); \
+ output_asm_insn ("lmg 14,5,160(15)", tmp); \
+ output_asm_insn ("aghi 15,224", tmp); \
+ output_asm_insn ("spm 0", tmp); \
+ } \
+ else \
+ { \
+ extern rtx s390_profile[]; \
+ fprintf (FILE, "# function block profiler %d \n", profile_block_flag); \
+ output_asm_insn ("ipm 0", s390_profile); \
+ output_asm_insn ("ahi 15,-128", s390_profile); \
+ output_asm_insn ("stm 14,5,96(15)", s390_profile); \
+ output_asm_insn ("l 2,%6", s390_profile); \
+ if (flag_pic) \
+ output_asm_insn ("ar 2,13", s390_profile); \
+ switch (profile_block_flag) \
+ { \
+ case 2: \
+ output_asm_insn ("l 4,%1", s390_profile); \
+ if (BLOCK_OR_LABEL < 0x8000) { \
+ s390_profile[8] = gen_rtx_CONST_INT (Pmode, (BLOCK_OR_LABEL)); \
+ output_asm_insn ("lhi 3,%8", s390_profile); \
+ } else { \
+ int bo = BLOCK_OR_LABEL; \
+ s390_profile[8] = gen_rtx_CONST_INT (Pmode, (bo&0xffff8000)>>15); \
+ output_asm_insn ("lhi 3,%8", s390_profile); \
+ output_asm_insn ("sll 3,15", s390_profile); \
+ s390_profile[8] = gen_rtx_CONST_INT (Pmode, bo&0x7fff); \
+ output_asm_insn ("ahi 3,%8", s390_profile); \
+ } \
+ break; \
+ default: \
+ output_asm_insn ("l 4,%0", s390_profile); \
+ output_asm_insn ("cli 3(2),0", s390_profile); \
+ output_asm_insn ("jne 2f", s390_profile); \
+ break; \
+ } \
+ if (flag_pic) \
+ output_asm_insn ("bas 14,0(4,13)", s390_profile); \
+ else \
+ output_asm_insn ("basr 14,4", s390_profile); \
+ output_asm_insn ("2:", s390_profile); \
+ output_asm_insn ("lm 14,5,96(15)", s390_profile); \
+ output_asm_insn ("ahi 15,128", s390_profile); \
+ output_asm_insn ("spm 0", s390_profile); \
+ } \
+ } while (0)
+
+/* The following macro shall output assembler code to FILE
+ to increment a counter associated with basic block number BLOCKNO.
+
+ If profile_block_flag == 2
+
+ Output code to initialize the global structure `__bb' and
+ call the function `__bb_trace_func' which will increment the
+ counter.
+
+ `__bb' consists of two words. In the first word the number
+ of the basic block has to be stored. In the second word
+ the address of a block allocated in the object module
+ has to be stored.
+
+ The basic block number is given by BLOCKNO.
+
+ The address of the block is given by the label created with
+
+ ASM_GENERATE_INTERNAL_LABEL (BUFFER, "LPBX", 0);
+
+ by FUNCTION_BLOCK_PROFILER.
+
+ Of course, since you are writing the definition of
+ `ASM_GENERATE_INTERNAL_LABEL' as well as that of this macro, you
+ can take a short cut in the definition of this macro and use the
+ name that you know will result.
+
+ If described in a virtual assembler language the code to be
+ output looks like:
+
+ move BLOCKNO -> (__bb)
+ move LPBX0 -> (__bb+4)
+ call __bb_trace_func
+
+ Note that function `__bb_trace_func' must not change the
+ machine state, especially the flag register. To grant
+ this, you must output code to save and restore registers
+ either in this macro or in the macros MACHINE_STATE_SAVE
+ and MACHINE_STATE_RESTORE. The last two macros will be
+ used in the function `__bb_trace_func', so you must make
+ sure that the function prologue does not change any
+ register prior to saving it with MACHINE_STATE_SAVE.
+
+ else if profile_block_flag != 0
+
+ Output code to increment the counter directly.
+ Basic blocks are numbered separately from zero within each
+ compiled object module. The count associated with block number
+ BLOCKNO is at index BLOCKNO in an array of words; the name of
+ this array is a local symbol made with this statement:
+
+ ASM_GENERATE_INTERNAL_LABEL (BUFFER, "LPBX", 2);
+
+ Of course, since you are writing the definition of
+ `ASM_GENERATE_INTERNAL_LABEL' as well as that of this macro, you
+ can take a short cut in the definition of this macro and use the
+ name that you know will result.
+
+ If described in a virtual assembler language the code to be
+ output looks like:
+
+ inc (LPBX2+4*BLOCKNO)
+
+*/
+
+#define BLOCK_PROFILER(FILE, BLOCKNO) \
+do \
+ { \
+ if (TARGET_64BIT) \
+ { \
+ rtx tmp[1]; \
+ fprintf (FILE, "# block profiler %d block %d \n", \
+ profile_block_flag, BLOCKNO); \
+ output_asm_insn ("ipm 14", tmp); \
+ output_asm_insn ("aghi 15,-224", tmp); \
+ output_asm_insn ("stmg 14,5,160(15)", tmp); \
+ output_asm_insn ("larl 2,_bb", tmp); \
+ if ((BLOCKNO*8) < 0x10000) { \
+ tmp[0] = gen_rtx_CONST_INT (Pmode, (BLOCKNO*8)); \
+ output_asm_insn ("llill 3,%x0", tmp); \
+ } else { \
+ int bo = BLOCKNO*8; \
+ tmp[0] = gen_rtx_CONST_INT (Pmode, bo&0xffff); \
+ output_asm_insn ("llill 3,%x0", tmp); \
+ tmp[0] = gen_rtx_CONST_INT (Pmode, (bo&0xffff0000)>>16); \
+ output_asm_insn ("iilh 3,%x0", tmp); \
+ } \
+ switch (profile_block_flag) \
+ { \
+ case 2: \
+ output_asm_insn ("stg 3,0(2)", tmp); \
+ output_asm_insn ("larl 3,.LPBX0", tmp); \
+ output_asm_insn ("stg 3,0(2)", tmp); \
+ tmp[0] = gen_rtx_SYMBOL_REF (Pmode, "__bb_trace_func"); \
+ if (flag_pic) \
+ { \
+ tmp[0] = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, tmp[0]), 113); \
+ tmp[0] = gen_rtx_CONST (Pmode, tmp[0]); \
+ } \
+ output_asm_insn ("brasl\t14,%0", tmp); \
+ break; \
+ default: \
+ output_asm_insn ("larl 2,.LPBX2", tmp); \
+ output_asm_insn ("la 2,0(2,3)", tmp); \
+ output_asm_insn ("lg 3,0(2)", tmp); \
+ output_asm_insn ("aghi 3,1", tmp); \
+ output_asm_insn ("stg 3,0(2)", tmp); \
+ break; \
+ } \
+ output_asm_insn ("lmg 14,5,160(15)", tmp); \
+ output_asm_insn ("ahi 15,224", tmp); \
+ output_asm_insn ("spm 14", tmp); \
+ } \
+ else \
+ { \
+ extern rtx s390_profile[]; \
+ fprintf (FILE, "# block profiler %d block %d \n", \
+ profile_block_flag,BLOCKNO); \
+ output_asm_insn ("ipm 14", s390_profile); \
+ output_asm_insn ("ahi 15,-128", s390_profile); \
+ output_asm_insn ("stm 14,5,96(15)", s390_profile); \
+ switch (profile_block_flag) \
+ { \
+ case 2: \
+ output_asm_insn ("l 4,%2", s390_profile); \
+ output_asm_insn ("l 2,%5", s390_profile); \
+ if (flag_pic) \
+ output_asm_insn ("ar 2,13", s390_profile); \
+ if (BLOCKNO < 0x8000) { \
+ s390_profile[7] = gen_rtx_CONST_INT (Pmode, (BLOCKNO)*4); \
+ output_asm_insn ("lhi 3,%8", s390_profile); \
+ } else { \
+ int bo = BLOCKNO; \
+ s390_profile[8] = gen_rtx_CONST_INT (Pmode, (bo&0xffff8000)>>15); \
+ output_asm_insn ("lhi 3,%8", s390_profile); \
+ output_asm_insn ("sll 3,15", s390_profile); \
+ s390_profile[8] = gen_rtx_CONST_INT (Pmode, bo&0x7fff); \
+ output_asm_insn ("ahi 3,%7", s390_profile); \
+ } \
+ output_asm_insn ("st 3,0(2)", s390_profile); \
+ output_asm_insn ("mvc 0(4,2),%5", s390_profile); \
+ if (flag_pic) \
+ output_asm_insn ("bas 14,0(4,13)", s390_profile); \
+ else \
+ output_asm_insn ("basr 14,4", s390_profile); \
+ break; \
+ default: \
+ if (BLOCKNO < 0x2000) { \
+ s390_profile[8] = gen_rtx_CONST_INT (Pmode, (BLOCKNO)*4); \
+ output_asm_insn ("lhi 2,%8", s390_profile); \
+ } else { \
+ int bo = BLOCKNO*4; \
+ s390_profile[8] = gen_rtx_CONST_INT (Pmode, (bo&0xffff8000)>>15); \
+ output_asm_insn ("lhi 2,%8", s390_profile); \
+ output_asm_insn ("sll 2,15", s390_profile); \
+ s390_profile[8] = gen_rtx_CONST_INT (Pmode, bo&0x7fff); \
+ output_asm_insn ("ahi 2,%8", s390_profile); \
+ } \
+ output_asm_insn ("a 2,%7", s390_profile); \
+ if (flag_pic) \
+ output_asm_insn ("l 3,0(2,13)", s390_profile); \
+ else \
+ output_asm_insn ("l 3,0(2)", s390_profile); \
+ output_asm_insn ("ahi 3,1", s390_profile); \
+ if (flag_pic) \
+ output_asm_insn ("st 3,0(2,13)", s390_profile); \
+ else \
+ output_asm_insn ("st 3,0(2)", s390_profile); \
+ break; \
+ } \
+ output_asm_insn ("lm 14,5,96(15)", s390_profile); \
+ output_asm_insn ("ahi 15,128", s390_profile); \
+ output_asm_insn ("spm 14", s390_profile); \
+ } \
+ } while (0)
+
+
+/* The following macro shall output assembler code to FILE
+ to indicate a return from function during basic-block profiling.
+
+ If profiling_block_flag == 2:
+
+ Output assembler code to call function `__bb_trace_ret'.
+
+ Note that function `__bb_trace_ret' must not change the
+ machine state, especially the flag register. To grant
+ this, you must output code to save and restore registers
+ either in this macro or in the macros MACHINE_STATE_SAVE_RET
+ and MACHINE_STATE_RESTORE_RET. The last two macros will be
+ used in the function `__bb_trace_ret', so you must make
+ sure that the function prologue does not change any
+ register prior to saving it with MACHINE_STATE_SAVE_RET.
+
+ else if profiling_block_flag != 0:
+
+ The macro will not be used, so it need not distinguish
+ these cases.
+*/
+
+#define FUNCTION_BLOCK_PROFILER_EXIT(FILE) \
+do { \
+ if (TARGET_64BIT) \
+ { \
+ rtx tmp[1]; \
+ fprintf (FILE, "# block profiler exit \n"); \
+ output_asm_insn ("ipm 14", tmp); \
+ output_asm_insn ("aghi 15,-224", tmp); \
+ output_asm_insn ("stmg 14,5,160(15)", tmp); \
+ tmp[0] = gen_rtx_SYMBOL_REF (Pmode, "__bb_trace_ret"); \
+ if (flag_pic) \
+ { \
+ tmp[0] = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, tmp[0]), 113); \
+ tmp[0] = gen_rtx_CONST (Pmode, tmp[0]); \
+ } \
+ output_asm_insn ("brasl 14,%0", tmp); \
+ output_asm_insn ("lmg 14,5,160(15)", tmp); \
+ output_asm_insn ("aghi 15,224", tmp); \
+ output_asm_insn ("spm 14", tmp); \
+ } \
+ else \
+ { \
+ extern rtx s390_profile[]; \
+ fprintf (FILE, "# block profiler exit \n"); \
+ output_asm_insn ("ipm 14", s390_profile); \
+ output_asm_insn ("ahi 15,-128", s390_profile); \
+ output_asm_insn ("stm 14,5,96(15)", s390_profile); \
+ output_asm_insn ("l 4,%3", s390_profile); \
+ if (flag_pic) \
+ output_asm_insn ("bas 14,0(4,13)", s390_profile); \
+ else \
+ output_asm_insn ("basr 14,4", s390_profile); \
+ output_asm_insn ("lm 14,5,96(15)", s390_profile); \
+ output_asm_insn ("ahi 15,128", s390_profile); \
+ output_asm_insn ("spm 14", s390_profile); \
+ } \
+ } while (0)
+
+/* The function `__bb_trace_func' is called in every basic block
+ and is not allowed to change the machine state. Saving (restoring)
+ the state can either be done in the BLOCK_PROFILER macro,
+ before calling function (rsp. after returning from function)
+ `__bb_trace_func', or it can be done inside the function by
+ defining the macros:
+
+ MACHINE_STATE_SAVE(ID)
+ MACHINE_STATE_RESTORE(ID)
+
+ In the latter case care must be taken, that the prologue code
+ of function `__bb_trace_func' does not already change the
+ state prior to saving it with MACHINE_STATE_SAVE.
+
+ The parameter `ID' is a string identifying a unique macro use.
+
+ On the s390 all save/restore is done in macros above
+*/
+
+/*
+#define MACHINE_STATE_SAVE(ID) \
+ fprintf (FILE, "\tahi 15,-128 # save state\n"); \
+ fprintf (FILE, "\tstm 14,5,96(15)\n"); \
+
+#define MACHINE_STATE_RESTORE(ID) \
+ fprintf (FILE, "\tlm 14,5,96(15) # restore state\n"); \
+ fprintf (FILE, "\tahi 15,128\n"); \
+*/
+
+
+/* Define EXIT_IGNORE_STACK if, when returning from a function, the stack
+ pointer does not matter (provided there is a frame pointer). */
+
+#define EXIT_IGNORE_STACK 1
+
+/* Addressing modes, and classification of registers for them. */
+
+/* #define HAVE_POST_INCREMENT */
+/* #define HAVE_POST_DECREMENT */
+
+/* #define HAVE_PRE_DECREMENT */
+/* #define HAVE_PRE_INCREMENT */
+
+/* These assume that REGNO is a hard or pseudo reg number. They give
+ nonzero only if REGNO is a hard reg of the suitable class or a pseudo
+ reg currently allocated to a suitable hard reg.
+ These definitions are NOT overridden anywhere. */
+
+#define REGNO_OK_FOR_INDEX_P(REGNO) \
+ (((REGNO) > 0 && (REGNO) < 16) || (REGNO) == ARG_POINTER_REGNUM \
+ /* || (REGNO) == FRAME_POINTER_REGNUM */ \
+ || (reg_renumber[REGNO] > 0 && reg_renumber[REGNO] < 16))
+
+#define REGNO_OK_FOR_BASE_P(REGNO) REGNO_OK_FOR_INDEX_P (REGNO)
+
+#define REGNO_OK_FOR_DATA_P(REGNO) \
+ ((REGNO) < 16 || (unsigned) reg_renumber[REGNO] < 16)
+
+#define REGNO_OK_FOR_FP_P(REGNO) \
+ FLOAT_REGNO_P (REGNO)
+
+/* Now macros that check whether X is a register and also,
+ strictly, whether it is in a specified class. */
+
+/* 1 if X is a data register. */
+
+#define DATA_REG_P(X) (REG_P (X) && REGNO_OK_FOR_DATA_P (REGNO (X)))
+
+/* 1 if X is an fp register. */
+
+#define FP_REG_P(X) (REG_P (X) && REGNO_OK_FOR_FP_P (REGNO (X)))
+
+/* 1 if X is an address register. */
+
+#define ADDRESS_REG_P(X) (REG_P (X) && REGNO_OK_FOR_BASE_P (REGNO (X)))
+
+/* Maximum number of registers that can appear in a valid memory address. */
+
+#define MAX_REGS_PER_ADDRESS 2
+
+/* Recognize any constant value that is a valid address. */
+
+#define CONSTANT_ADDRESS_P(X) 0
+
+#define SYMBOLIC_CONST(X) \
+(GET_CODE (X) == SYMBOL_REF \
+ || GET_CODE (X) == LABEL_REF \
+ || (GET_CODE (X) == CONST && symbolic_reference_mentioned_p (X)))
+
+/* General operand is everything except SYMBOL_REF, CONST and CONST_DOUBLE
+ they have to be forced to constant pool
+ CONST_INT have to be forced into constant pool, if greater than
+ 64k. Depending on the insn they have to be force into constant pool
+ for smaller value; in this case we have to work with nonimmediate operand. */
+
+#define LEGITIMATE_PIC_OPERAND_P(X) \
+ legitimate_pic_operand_p (X)
+
+/* Nonzero if the constant value X is a legitimate general operand.
+ It is given that X satisfies CONSTANT_P or is a CONST_DOUBLE. */
+
+#define LEGITIMATE_CONSTANT_P(X) \
+ legitimate_constant_p (X)
+
+/* The macros REG_OK_FOR..._P assume that the arg is a REG rtx and check
+ its validity for a certain class. We have two alternate definitions
+ for each of them. The usual definition accepts all pseudo regs; the
+ other rejects them all. The symbol REG_OK_STRICT causes the latter
+ definition to be used.
+
+ Most source files want to accept pseudo regs in the hope that they will
+ get allocated to the class that the insn wants them to be in.
+ Some source files that are used after register allocation
+ need to be strict. */
+
+/*
+ * Nonzero if X is a hard reg that can be used as an index or if it is
+ * a pseudo reg.
+ */
+
+#define REG_OK_FOR_INDEX_NONSTRICT_P(X) \
+((GET_MODE (X) == Pmode) && \
+ ((REGNO (X) > 0 && REGNO (X) < 16) || \
+ (REGNO (X) == ARG_POINTER_REGNUM) || \
+ (REGNO (X) >= FIRST_PSEUDO_REGISTER)))
+
+/* Nonzero if X is a hard reg that can be used as a base reg or if it is
+ a pseudo reg. */
+
+#define REG_OK_FOR_BASE_NONSTRICT_P(X) REG_OK_FOR_INDEX_NONSTRICT_P (X)
+
+/* Nonzero if X is a hard reg that can be used as an index. */
+
+#define REG_OK_FOR_INDEX_STRICT_P(X) \
+((GET_MODE (X) == Pmode) && (REGNO_OK_FOR_INDEX_P (REGNO (X))))
+
+/* Nonzero if X is a hard reg that can be used as a base reg. */
+
+#define REG_OK_FOR_BASE_STRICT_P(X) \
+((GET_MODE (X) == Pmode) && (REGNO_OK_FOR_BASE_P (REGNO (X))))
+
+
+#ifndef REG_OK_STRICT
+#define REG_OK_FOR_INDEX_P(X) REG_OK_FOR_INDEX_NONSTRICT_P(X)
+#define REG_OK_FOR_BASE_P(X) REG_OK_FOR_BASE_NONSTRICT_P(X)
+#else
+#define REG_OK_FOR_INDEX_P(X) REG_OK_FOR_INDEX_STRICT_P(X)
+#define REG_OK_FOR_BASE_P(X) REG_OK_FOR_BASE_STRICT_P(X)
+#endif
+
+
+/* GO_IF_LEGITIMATE_ADDRESS recognizes an RTL expression that is a
+ valid memory address for an instruction.
+ The MODE argument is the machine mode for the MEM expression
+ that wants to use this address.
+
+ The other macros defined here are used only in GO_IF_LEGITIMATE_ADDRESS,
+ except for CONSTANT_ADDRESS_P which is actually machine-independent. */
+
+#ifdef REG_OK_STRICT
+#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR) \
+{ \
+ if (legitimate_address_p (MODE, X, 1)) \
+ goto ADDR; \
+}
+#else
+#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR) \
+{ \
+ if (legitimate_address_p (MODE, X, 0)) \
+ goto ADDR; \
+}
+#endif
+
+
+/* S/390 has no mode dependent addresses. */
+
+#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR, LABEL)
+
+/* Try machine-dependent ways of modifying an illegitimate address
+ to be legitimate. If we find one, return the new, valid address.
+ This macro is used in only one place: `memory_address' in explow.c. */
+
+#define LEGITIMIZE_ADDRESS(X, OLDX, MODE, WIN) \
+{ \
+ (X) = legitimize_address (X, OLDX, MODE); \
+ if (memory_address_p (MODE, X)) \
+ goto WIN; \
+}
+
+/* Specify the machine mode that this machine uses for the index in the
+ tablejump instruction. */
+
+#define CASE_VECTOR_MODE (TARGET_64BIT ? DImode : SImode)
+
+/* Define this if the tablejump instruction expects the table to contain
+ offsets from the address of the table.
+ Do not define this if the table should contain absolute addresses. */
+
+/* #define CASE_VECTOR_PC_RELATIVE */
+
+/* Load from integral MODE < SI from memory into register makes sign_extend
+ or zero_extend
+ In our case sign_extension happens for Halfwords, other no extension. */
+
+#define LOAD_EXTEND_OP(MODE) \
+(TARGET_64BIT ? ((MODE) == QImode ? ZERO_EXTEND : \
+ (MODE) == HImode ? SIGN_EXTEND : NIL) \
+ : ((MODE) == HImode ? SIGN_EXTEND : NIL))
+
+/* Specify the tree operation to be used to convert reals to integers. */
+
+#define IMPLICIT_FIX_EXPR FIX_ROUND_EXPR
+
+/* Define this if fixuns_trunc is the same as fix_trunc. */
+
+/* #define FIXUNS_TRUNC_LIKE_FIX_TRUNC */
+
+/* We use "unsigned char" as default. */
+
+#define DEFAULT_SIGNED_CHAR 0
+
+/* This is the kind of divide that is easiest to do in the general case. */
+
+#define EASY_DIV_EXPR TRUNC_DIV_EXPR
+
+/* Max number of bytes we can move from memory to memory in one reasonably
+ fast instruction. */
+
+#define MOVE_MAX 256
+
+/* Define this if zero-extension is slow (more than one real instruction). */
+
+#define SLOW_ZERO_EXTEND
+
+/* Nonzero if access to memory by bytes is slow and undesirable. */
+
+#define SLOW_BYTE_ACCESS 1
+
+/* Define if shifts truncate the shift count which implies one can omit
+ a sign-extension or zero-extension of a shift count. */
+
+/* #define SHIFT_COUNT_TRUNCATED */
+
+/* Value is 1 if truncating an integer of INPREC bits to OUTPREC bits
+ is done just by pretending it is already truncated. */
+
+#define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1
+
+/* We assume that the store-condition-codes instructions store 0 for false
+ and some other value for true. This is the value stored for true. */
+
+/* #define STORE_FLAG_VALUE -1 */
+
+/* When a prototype says `char' or `short', really pass an `int'. */
+
+#define PROMOTE_PROTOTYPES 1
+
+/* Don't perform CSE on function addresses. */
+
+#define NO_FUNCTION_CSE
+
+/* Specify the machine mode that pointers have.
+ After generation of rtl, the compiler makes no further distinction
+ between pointers and any other objects of this machine mode. */
+
+#define Pmode (TARGET_64BIT ? DImode : SImode)
+
+/* A function address in a call instruction is a byte address (for
+ indexing purposes) so give the MEM rtx a byte's mode. */
+
+#define FUNCTION_MODE QImode
+
+
+/* A part of a C `switch' statement that describes the relative costs
+ of constant RTL expressions. It must contain `case' labels for
+ expression codes `const_int', `const', `symbol_ref', `label_ref'
+ and `const_double'. Each case must ultimately reach a `return'
+ statement to return the relative cost of the use of that kind of
+ constant value in an expression. The cost may depend on the
+ precise value of the constant, which is available for examination
+ in X, and the rtx code of the expression in which it is contained,
+ found in OUTER_CODE.
+
+ CODE is the expression code--redundant, since it can be obtained
+ with `GET_CODE (X)'. */
+/* Force_const_mem does not work out of reload, because the saveable_obstack
+ is set to reload_obstack, which does not live long enough.
+ Because of this we cannot use force_const_mem in addsi3.
+ This leads to problems with gen_add2_insn with a constant greater
+ than a short. Because of that we give a addition of greater
+ constants a cost of 3 (reload1.c 10096). */
+
+
+#define CONST_COSTS(RTX, CODE, OUTER_CODE) \
+ case CONST: \
+ if ((GET_CODE (XEXP (RTX, 0)) == MINUS) && \
+ (GET_CODE (XEXP (XEXP (RTX, 0), 1)) != CONST_INT)) \
+ return 1000; \
+ case CONST_INT: \
+ if ((OUTER_CODE == PLUS) && \
+ ((INTVAL (RTX) > 32767) || \
+ (INTVAL (RTX) < -32768))) \
+ return COSTS_N_INSNS (3); \
+ case LABEL_REF: \
+ case SYMBOL_REF: \
+ case CONST_DOUBLE: \
+ return 0; \
+
+
+/* Like `CONST_COSTS' but applies to nonconstant RTL expressions.
+ This can be used, for example, to indicate how costly a multiply
+ instruction is. In writing this macro, you can use the construct
+ `COSTS_N_INSNS (N)' to specify a cost equal to N fast
+ instructions. OUTER_CODE is the code of the expression in which X
+ is contained.
+
+ This macro is optional; do not define it if the default cost
+ assumptions are adequate for the target machine. */
+
+#define RTX_COSTS(X, CODE, OUTER_CODE) \
+ case ASHIFT: \
+ case ASHIFTRT: \
+ case LSHIFTRT: \
+ case PLUS: \
+ case AND: \
+ case IOR: \
+ case XOR: \
+ case MINUS: \
+ case NEG: \
+ case NOT: \
+ return 1; \
+ case MULT: \
+ if (GET_MODE (XEXP (X, 0)) == DImode) \
+ return 40; \
+ else \
+ return 7; \
+ case DIV: \
+ case UDIV: \
+ case MOD: \
+ case UMOD: \
+ return 33;
+
+
+/* An expression giving the cost of an addressing mode that contains
+ ADDRESS. If not defined, the cost is computed from the ADDRESS
+ expression and the `CONST_COSTS' values.
+
+ For most CISC machines, the default cost is a good approximation
+ of the true cost of the addressing mode. However, on RISC
+ machines, all instructions normally have the same length and
+ execution time. Hence all addresses will have equal costs.
+
+ In cases where more than one form of an address is known, the form
+ with the lowest cost will be used. If multiple forms have the
+ same, lowest, cost, the one that is the most complex will be used.
+
+ For example, suppose an address that is equal to the sum of a
+ register and a constant is used twice in the same basic block.
+ When this macro is not defined, the address will be computed in a
+ register and memory references will be indirect through that
+ register. On machines where the cost of the addressing mode
+ containing the sum is no higher than that of a simple indirect
+ reference, this will produce an additional instruction and
+ possibly require an additional register. Proper specification of
+ this macro eliminates this overhead for such machines.
+
+ Similar use of this macro is made in strength reduction of loops.
+
+ ADDRESS need not be valid as an address. In such a case, the cost
+ is not relevant and can be any value; invalid addresses need not be
+ assigned a different cost.
+
+ On machines where an address involving more than one register is as
+ cheap as an address computation involving only one register,
+ defining `ADDRESS_COST' to reflect this can cause two registers to
+ be live over a region of code where only one would have been if
+ `ADDRESS_COST' were not defined in that manner. This effect should
+ be considered in the definition of this macro. Equivalent costs
+ should probably only be given to addresses with different numbers
+ of registers on machines with lots of registers.
+
+ This macro will normally either not be defined or be defined as a
+ constant.
+
+ On s390 symbols are expensive if compiled with fpic
+ lifetimes. */
+
+#define ADDRESS_COST(RTX) \
+ ((flag_pic && GET_CODE (RTX) == SYMBOL_REF) ? 2 : 1)
+
+/* On s390, copy between fprs and gprs is expensive. */
+
+#define REGISTER_MOVE_COST(MODE, CLASS1, CLASS2) \
+ (((CLASS1 != CLASS2) && \
+ (CLASS1 == FP_REGS || CLASS2 == FP_REGS)) ? 10 : 1)
+
+
+/* A C expression for the cost of moving data of mode M between a
+ register and memory. A value of 2 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 MEMORY_MOVE_COST(M, C, I) 1
+
+/* A C expression for the cost of a branch instruction. A value of 1
+ is the default; other values are interpreted relative to that. */
+
+#define BRANCH_COST 1
+
+/* Add any extra modes needed to represent the condition code. */
+#define EXTRA_CC_MODES \
+ CC (CCZmode, "CCZ") \
+ CC (CCAmode, "CCA") \
+ CC (CCUmode, "CCU") \
+ CC (CCSmode, "CCS") \
+ CC (CCTmode, "CCT")
+
+/* Given a comparison code (EQ, NE, etc.) and the first operand of a COMPARE,
+ return the mode to be used for the comparison. */
+
+#define SELECT_CC_MODE(OP, X, Y) \
+ ( (OP) == EQ || (OP) == NE ? CCZmode \
+ : (OP) == LE || (OP) == LT || \
+ (OP) == GE || (OP) == GT ? CCSmode \
+ : (OP) == LEU || (OP) == LTU || \
+ (OP) == GEU || (OP) == GTU ? CCUmode \
+ : CCmode )
+
+
+/* Define the information needed to generate branch and scc insns. This is
+ stored from the compare operation. Note that we can't use "rtx" here
+ since it hasn't been defined! */
+
+extern struct rtx_def *s390_compare_op0, *s390_compare_op1;
+
+extern int s390_match_ccmode PARAMS ((struct rtx_def *, int));
+
+
+/* How to refer to registers in assembler output. This sequence is
+ indexed by compiler's hard-register-number (see above). */
+
+#define REGISTER_NAMES \
+{ "%r0", "%r1", "%r2", "%r3", "%r4", "%r5", "%r6", "%r7", \
+ "%r8", "%r9", "%r10", "%r11", "%r12", "%r13", "%r14", "%r15", \
+ "%f0", "%f2", "%f4", "%f6", "%f1", "%f3", "%f5", "%f7", \
+ "%f8", "%f10", "%f12", "%f14", "%f9", "%f11", "%f13", "%f15", \
+ "%ap", "%cc" \
+}
+
+/* implicit call of memcpy, not bcopy */
+
+#define TARGET_MEM_FUNCTIONS
+
+
+/* Define results of standard character escape sequences. */
+
+#define TARGET_BELL (0x07)
+#define TARGET_BS (0x08)
+#define TARGET_TAB (0x09)
+#define TARGET_NEWLINE (0x0A)
+#define TARGET_VT 11
+#define TARGET_FF 12
+#define TARGET_CR 13
+
+/* Print operand X (an rtx) in assembler syntax to file FILE.
+ CODE is a letter or dot (`z' in `%z0') or 0 if no letter was specified.
+ For `%' followed by punctuation, CODE is the punctuation and X is null. */
+
+#define PRINT_OPERAND(FILE, X, CODE) print_operand (FILE, X, CODE)
+
+#define PRINT_OPERAND_ADDRESS(FILE, ADDR) print_operand_address (FILE, ADDR)
+
+
+/* Define the codes that are matched by predicates in aux-output.c. */
+
+#define PREDICATE_CODES \
+ {"s_operand", { MEM }}, \
+ {"bras_sym_operand",{ SYMBOL_REF, CONST }}, \
+ {"r_or_s_operand", { MEM, SUBREG, REG }}, \
+ {"r_or_im8_operand", { CONST_INT, SUBREG, REG }}, \
+ {"r_or_s_or_im8_operand", { MEM, SUBREG, REG, CONST_INT }}, \
+ {"r_or_x_or_im16_operand", { MEM, SUBREG, REG, CONST_INT }}, \
+ {"const0_operand", { CONST_INT, CONST_DOUBLE }}, \
+ {"const1_operand", { CONST_INT, CONST_DOUBLE }}, \
+ {"tmxx_operand", { CONST_INT, MEM }},
+
+
+/* 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. */
+
+#define ADJUST_COST(insn, link, dep_insn, cost) \
+ (cost) = s390_adjust_cost (insn, link, dep_insn, cost)
+
+
+/* Constant Pool for all symbols operands which are changed with
+ force_const_mem during insn generation (expand_insn). */
+
+extern struct rtx_def *s390_pool_start_insn;
+extern int s390_pool_count;
+extern int s390_nr_constants;
+
+/* Function is splitted in chunk, if literal pool could overflow
+ Value need to be lowered, if problems with displacement overflow. */
+
+#define S390_REL_MAX 55000
+#define S390_CHUNK_MAX 0x2000
+#define S390_CHUNK_OV 0x8000
+#define S390_POOL_MAX 0xe00
+
+#define ASM_OUTPUT_POOL_PROLOGUE(FILE, FUNNAME, fndecl, size) \
+{ \
+ register rtx insn; \
+ struct pool_constant *pool; \
+ \
+ if (s390_pool_count == -1) \
+ { \
+ s390_nr_constants = 0; \
+ for (pool = first_pool; pool; pool = pool->next) \
+ if (pool->mark) s390_nr_constants++; \
+ return; \
+ } \
+ if (first_pool == 0) { \
+ s390_asm_output_pool_prologue (FILE, FUNNAME, fndecl, size); \
+ return; \
+ } \
+ for (pool = first_pool; pool; pool = pool->next) \
+ pool->mark = 0; \
+ \
+ insn = s390_pool_start_insn; \
+ \
+ if (insn==NULL_RTX) \
+ insn = get_insns (); \
+ else \
+ insn = NEXT_INSN (insn); \
+ for (; insn; insn = NEXT_INSN (insn)) { \
+ if (GET_RTX_CLASS (GET_CODE (insn)) == 'i') { \
+ if (s390_stop_dump_lit_p (insn)) { \
+ mark_constants (PATTERN (insn)); \
+ break; \
+ } else \
+ mark_constants (PATTERN (insn)); \
+ } \
+ } \
+ \
+ /* Mark entries referenced by other entries */ \
+ for (pool = first_pool; pool; pool = pool->next) \
+ if (pool->mark) \
+ mark_constants (pool->constant); \
+ \
+ s390_asm_output_pool_prologue (FILE, FUNNAME, fndecl, size); \
+}
+
+/* We need to return, because otherwise the pool is deleted of the
+ constant pool after the first output. */
+
+#define ASM_OUTPUT_POOL_EPILOGUE(FILE, FUNNAME, fndecl, size) return;
+
+#define ASM_OUTPUT_SPECIAL_POOL_ENTRY(FILE, EXP, MODE, ALIGN, LABELNO, WIN) \
+{ \
+ if ((s390_pool_count == 0) || (s390_pool_count > 0 && LABELNO >= 0)) \
+ { \
+ fprintf (FILE, ".LC%d:\n", LABELNO); \
+ LABELNO = ~LABELNO; \
+ } \
+ if (s390_pool_count > 0) \
+ { \
+ fprintf (FILE, ".LC%d_%X:\n", ~LABELNO, s390_pool_count); \
+ } \
+ \
+ /* Output the value of the constant itself. */ \
+ switch (GET_MODE_CLASS (pool->mode)) \
+ { \
+ case MODE_FLOAT: \
+ if (GET_CODE (x) != CONST_DOUBLE) \
+ abort (); \
+ \
+ memcpy ((char *) &u, (char *) &CONST_DOUBLE_LOW (x), sizeof u); \
+ assemble_real (u.d, pool->mode); \
+ break; \
+ \
+ case MODE_INT: \
+ case MODE_PARTIAL_INT: \
+ if (flag_pic && (GET_CODE (x) == CONST || \
+ GET_CODE (x) == SYMBOL_REF || \
+ GET_CODE (x) == LABEL_REF )) \
+ { \
+ fprintf (FILE, "%s\t",TARGET_64BIT ? ASM_QUAD : ASM_LONG); \
+ s390_output_symbolic_const (FILE, x); \
+ fputc ('\n', (FILE)); \
+ } \
+ else \
+ assemble_integer (x, GET_MODE_SIZE (pool->mode), 1); \
+ break; \
+ \
+ default: \
+ abort (); \
+ } \
+ goto WIN; \
+}
+
+#endif
diff --git a/gcc/config/s390/s390.md b/gcc/config/s390/s390.md
new file mode 100644
index 00000000000..98bb896f6e6
--- /dev/null
+++ b/gcc/config/s390/s390.md
@@ -0,0 +1,5764 @@
+;;- Machine description for GNU compiler -- S/390 / zSeries version.
+;; Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
+;; Contributed by Hartmut Penner (hpenner@de.ibm.com) and
+;; Ulrich Weigand (uweigand@de.ibm.com).
+;; This file is part of GNU CC.
+
+;; GNU CC is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; GNU CC is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU CC; see the file COPYING. If not, write to
+;; the Free Software Foundation, 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
+
+;;
+;; Special constraints for s/390 machine description:
+;;
+;; a -- Any address register from 1 to 15.
+;; d -- Any register from 0 to 15.
+;; I -- An 8-bit constant (0..255).
+;; J -- A 12-bit constant (0..4095).
+;; K -- A 16-bit constant (-32768..32767).
+;; Q -- A memory reference without index-register.
+;; S -- Valid operand for the LARL instruction.
+;;
+;; Special formats used for outputting 390 instructions.
+;;
+;; %b -- Print a constant byte integer. xy
+;; %h -- Print a signed 16-bit. wxyz
+;; %N -- Print next register (second word of a DImode reg) or next word.
+;; %M -- Print next register (second word of a TImode reg) or next word.
+;; %O -- Print the offset of a memory reference (PLUS (REG) (CONST_INT)).
+;; %R -- Print the register of a memory reference (PLUS (REG) (CONST_INT)).
+;;
+;; We have a special constraint for pattern matching.
+;;
+;; s_operand -- Matches a valid S operand in a RS, SI or SS type instruction.
+;;
+;; r_or_s_operand -- Matches a register or a valid S operand in a RS, SI
+;; or SS type instruction or a register
+;;
+
+;; Insn type. Used to default other attribute values.
+
+;
+; Insn are devide in two classes:
+; mem: Use of base and/or index register for address generation
+; reg: Use of second and third register not for address generation
+;
+
+(define_attr "atype" "mem,reg" (const_string "reg"))
+
+;
+; Insn may take 1,2,3 or many cycles
+; For the scheduling it does not matter, if a instruction has
+; a issue_delay from 4 or more cycles, since the address dependency
+; between two insns needs at least 4 cycles.
+;
+
+(define_attr "cycle" "1,2,3,n" (const_string "1"))
+
+;
+; There are three classes of insns:
+; set: instruction setting a (potential) address relevant register
+; xset: instruction setting no address relevant register
+; la: instruction setting a (potential) address relevant register,
+; but behave 'better' on the pipeline
+;
+
+(define_attr "type" "set,xset,la" (const_string "xset"))
+
+;
+; Dummy function unit. We only care for the cycle count.
+; Everthing else is done by ADJUST_COST.
+;
+
+(define_function_unit "memory" 1 0
+ (eq_attr "cycle" "1") 1 1)
+
+(define_function_unit "memory" 1 0
+ (eq_attr "cycle" "2") 2 2)
+
+(define_function_unit "memory" 1 0
+ (eq_attr "cycle" "3") 3 3)
+
+(define_function_unit "memory" 1 0
+ (eq_attr "cycle" "n") 4 4)
+
+; Operand type. Used to default length attribute values
+
+(define_attr "op_type"
+ "NN,E,RR,RRE,RX,RS,RSI,RI,SI,S,SS,SSE,RXE,RSE,RIL,RIE"
+ (const_string "RX"))
+
+;; Length in bytes.
+
+(define_attr "length" ""
+(cond [ (eq_attr "op_type" "E") (const_int 2)
+ (eq_attr "op_type" "RR") (const_int 2)
+ (eq_attr "op_type" "RX") (const_int 4)
+ (eq_attr "op_type" "RI") (const_int 4)
+ (eq_attr "op_type" "RRE") (const_int 4)
+ (eq_attr "op_type" "RS") (const_int 4)
+ (eq_attr "op_type" "RSI") (const_int 4)
+ (eq_attr "op_type" "RX") (const_int 4)
+ (eq_attr "op_type" "S") (const_int 4)
+ (eq_attr "op_type" "SI") (const_int 4)
+ (eq_attr "op_type" "SS") (const_int 6)
+ (eq_attr "op_type" "SSE") (const_int 6)
+ (eq_attr "op_type" "RXE") (const_int 6)
+ (eq_attr "op_type" "RSE") (const_int 6)
+ (eq_attr "op_type" "RIL") (const_int 6)]
+ (const_int 4)))
+
+;; Define attributes for `asm' insns.
+
+(define_asm_attributes [(set_attr "type" "xset")
+ (set_attr "op_type" "NN")])
+
+;;
+;; Condition Codes
+;;
+;
+; CCL: Zero Nonzero Zero Nonzero (AL, ALR, SL, SLR, N, NC, NI, NR, O, OC, OI, OR, X, XC, XI, XR)
+; CCA: Zero <Zero >Zero Overflow (A, AR, AH, AHI, S, SR, SH, SHI, LTR, LCR, LNR, LPR, SLA, SLDA, SLA, SRDA)
+; CCU: Equal ULess UGreater -- (CL, CLR, CLI, CLM)
+; CCS: Equal SLess SGreater -- (C, CR, CH, CHI, ICM)
+; CCT: Zero Mixed Mixed Ones (TM, TMH, TML)
+
+; CCZ -> CCL / CCZ1
+; CCZ1 -> CCA/CCU/CCS/CCT
+; CCS -> CCA
+
+; String: CLC, CLCL, CLCLE, CLST, CUSE, MVCL, MVCLE, MVPG, MVST, SRST
+; Clobber: CKSM, CFC, CS, CDS, CUUTF, CUTFU, PLO, SPM, STCK, STCKE, TS, TRT, TRE, UPT
+
+
+;;
+;;- Compare instructions.
+;;
+
+(define_expand "cmpdi"
+ [(set (reg:CC 33)
+ (compare:CC (match_operand:DI 0 "register_operand" "")
+ (match_operand:DI 1 "general_operand" "")))]
+ "TARGET_64BIT"
+ "
+{
+ s390_compare_op0 = operands[0];
+ s390_compare_op1 = operands[1];
+ DONE;
+}")
+
+(define_expand "cmpsi"
+ [(set (reg:CC 33)
+ (compare:CC (match_operand:SI 0 "register_operand" "")
+ (match_operand:SI 1 "general_operand" "")))]
+ ""
+ "
+{
+ s390_compare_op0 = operands[0];
+ s390_compare_op1 = operands[1];
+ DONE;
+}")
+
+;(define_expand "cmphi"
+; [(set (reg:CC 33)
+; (compare:CC (match_operand:HI 0 "register_operand" "")
+; (match_operand:HI 1 "general_operand" "")))]
+; ""
+; "
+;{
+; s390_compare_op0 = operands[0];
+; s390_compare_op1 = operands[1];
+; DONE;
+;}")
+
+;(define_expand "cmpqi"
+; [(set (reg:CC 33)
+; (compare:CC (match_operand:QI 0 "register_operand" "")
+; (match_operand:QI 1 "general_operand" "")))]
+; ""
+; "
+;{
+; s390_compare_op0 = operands[0];
+; s390_compare_op1 = operands[1];
+; DONE;
+;}")
+
+(define_expand "cmpdf"
+ [(set (reg:CC 33)
+ (compare:CC (match_operand:DF 0 "register_operand" "")
+ (match_operand:DF 1 "general_operand" "")))]
+ "TARGET_HARD_FLOAT"
+ "
+{
+ s390_compare_op0 = operands[0];
+ s390_compare_op1 = operands[1];
+ DONE;
+}")
+
+(define_expand "cmpsf"
+ [(set (reg:CC 33)
+ (compare:CC (match_operand:SF 0 "register_operand" "")
+ (match_operand:SF 1 "general_operand" "")))]
+ "TARGET_HARD_FLOAT"
+ "
+{
+ s390_compare_op0 = operands[0];
+ s390_compare_op1 = operands[1];
+ DONE;
+}")
+
+
+; DI instructions
+
+(define_insn "*cmpdi_tm2"
+ [(set (reg 33)
+ (compare (zero_extract:DI (match_operand:DI 0 "register_operand" "d")
+ (match_operand:DI 1 "const1_operand" "")
+ (match_operand:DI 2 "immediate_operand" "I"))
+ (const_int 0)))]
+ "s390_match_ccmode(insn, CCTmode) &&
+ INTVAL(operands[2]) >= 0 && INTVAL(operands[2]) < 64"
+ "*
+{
+ if (INTVAL (operands[2]) > 47)
+ {
+ operands[1] = GEN_INT (1 << (63 - INTVAL(operands[2])));
+ return \"tmll\\t%0,%x1\";
+ }
+ else if (INTVAL (operands[2]) > 31)
+ {
+ operands[1] = GEN_INT (1 << (47 - INTVAL(operands[2])));
+ return \"tmlh\\t%0,%x1\";
+ }
+ else if (INTVAL (operands[2]) > 15)
+ {
+ operands[1] = GEN_INT (1 << (31 - INTVAL(operands[2])));
+ return \"tmhl\\t%0,%x1\";
+ }
+ operands[1] = GEN_INT (1 << (15 - INTVAL(operands[2])));
+ return \"tmhh\\t%0,%x1\";
+}"
+ [(set_attr "op_type" "RX")
+ (set_attr "type" "xset")])
+
+
+(define_insn "*cmpdi_tm"
+ [(set (reg 33)
+ (compare (and:DI (match_operand:DI 0 "register_operand" "%d")
+ (match_operand:DI 1 "tmxx_operand" "Lm"))
+ (const_int 0)))]
+ "s390_match_ccmode(insn, CCTmode)"
+ "*
+{
+ unsigned HOST_WIDEST_INT i;
+ if (GET_CODE (operands[1]) == MEM &&
+ GET_CODE (XEXP (operands[1],0)) == SYMBOL_REF &&
+ CONSTANT_POOL_ADDRESS_P (XEXP (operands[1],0)))
+ {
+ operands[1] = get_pool_constant (XEXP (operands[1],0));
+ }
+
+ i = (unsigned HOST_WIDEST_INT) INTVAL (operands[1]);
+
+ if (i >= 0x1000000000000ULL)
+ {
+ operands[1] = GEN_INT (i >> 48);
+ return \"tmhh\\t%0,%x1\";
+ }
+ else if (i > 0x100000000ULL)
+ {
+ operands[1] = GEN_INT (i >> 32);
+ return \"tmhl\\t%0,%x1\";
+ }
+ else if (i >= 0x10000ULL)
+ {
+ operands[1] = GEN_INT (i >> 16);
+ return \"tmlh\\t%0,%x1\";
+ }
+ else
+ return \"tmll\\t%0,%x1\";
+}"
+ [(set_attr "op_type" "RX")
+ (set_attr "type" "xset")])
+
+
+(define_insn "*ltgr"
+ [(set (reg 33)
+ (compare (match_operand:DI 0 "register_operand" "d")
+ (match_operand:DI 1 "const0_operand" "")))
+ (set (match_operand:DI 2 "register_operand" "=d")
+ (match_dup 0))]
+ "s390_match_ccmode(insn, CCSmode) && TARGET_64BIT"
+ "ltgr\\t%2,%0"
+ [(set_attr "op_type" "RRE")
+ (set_attr "type" "set")])
+
+(define_insn "*cmpdi_ccs_0_64"
+ [(set (reg 33)
+ (compare (match_operand:DI 0 "register_operand" "d")
+ (match_operand:DI 1 "const0_operand" "")))]
+ "s390_match_ccmode(insn, CCSmode) && TARGET_64BIT"
+ "ltgr\\t%0,%0"
+ [(set_attr "op_type" "RRE")
+ (set_attr "type" "set")])
+
+(define_insn "*cmpdi_ccs_0_31"
+ [(set (reg 33)
+ (compare (match_operand:DI 0 "register_operand" "d")
+ (match_operand:DI 1 "const0_operand" "")))]
+ "s390_match_ccmode(insn, CCSmode)"
+ "srda\\t%0,0"
+ [(set_attr "op_type" "RS")
+ (set_attr "type" "set")])
+
+(define_insn "*cmpdi_ccs"
+ [(set (reg 33)
+ (compare (match_operand:DI 0 "register_operand" "d,d,d")
+ (match_operand:DI 1 "general_operand" "d,K,m")))]
+ "s390_match_ccmode(insn, CCSmode) && TARGET_64BIT"
+ "@
+ cgr\\t%0,%1
+ cghi\\t%0,%c1
+ cg\\t%0,%1"
+ [(set_attr "op_type" "RRE,RI,RXE")
+ (set_attr "atype" "reg,reg,mem")])
+
+(define_insn "*cmpdi_ccu"
+ [(set (reg 33)
+ (compare (match_operand:DI 0 "register_operand" "d,d")
+ (match_operand:DI 1 "general_operand" "d,m")))]
+ "s390_match_ccmode(insn, CCUmode) && TARGET_64BIT"
+ "@
+ clgr\\t%0,%1
+ clg\\t%0,%1"
+ [(set_attr "op_type" "RRE,RXE")
+ (set_attr "atype" "reg,mem")])
+
+(define_insn "*cmpdi_ccu_mem"
+ [(set (reg 33)
+ (compare (match_operand:DI 0 "s_operand" "oQ")
+ (match_operand:DI 1 "s_operand" "oQ")))]
+ "s390_match_ccmode(insn, CCUmode)"
+ "clc\\t%O0(8,%R0),%1"
+ [(set_attr "op_type" "SS")
+ (set_attr "atype" "mem")])
+
+; SI instructions
+
+(define_insn "*cmpsi_cct"
+ [(set (reg 33)
+ (compare (zero_extract:SI (match_operand:SI 0 "register_operand" "d")
+ (match_operand:SI 1 "const1_operand" "")
+ (match_operand:SI 2 "immediate_operand" "I"))
+ (const_int 0)))]
+ "s390_match_ccmode(insn, CCTmode) &&
+ INTVAL(operands[2]) >= 0 && INTVAL(operands[2]) < 32"
+ "*
+{
+ if (INTVAL (operands[2]) > 15)
+ {
+ operands[1] = GEN_INT (1 << (31 - INTVAL(operands[2])));
+ return \"tml\\t%0,%x1\";
+ }
+ operands[1] = GEN_INT (1 << (15 - INTVAL(operands[2])));
+ return \"tmh\\t%0,%x1\";
+}"
+ [(set_attr "op_type" "RI")
+ (set_attr "type" "xset")])
+
+(define_insn "*cmpsi_tm"
+ [(set (reg 33)
+ (compare (and:SI (match_operand:SI 0 "register_operand" "%d")
+ (match_operand:SI 1 "tmxx_operand" "Lm"))
+ (const_int 0)))]
+ "s390_match_ccmode(insn, CCTmode)"
+ "*
+{
+ unsigned long i;
+ if (GET_CODE (operands[1]) == MEM &&
+ GET_CODE (XEXP (operands[1],0)) == SYMBOL_REF &&
+ CONSTANT_POOL_ADDRESS_P (XEXP (operands[1],0)))
+ {
+ operands[1] = get_pool_constant (XEXP (operands[1],0));
+ }
+
+ i = (unsigned long) INTVAL (operands[1]);
+ if (i > 0xffff)
+ {
+ operands[1] = GEN_INT (i / 0x10000);
+ return \"tmh\\t%0,%x1\";
+ }
+ return \"tml\\t%0,%x1\";
+}"
+ [(set_attr "op_type" "RX")
+ (set_attr "type" "xset")])
+
+
+(define_insn "*ltr"
+ [(set (reg 33)
+ (compare (match_operand:SI 0 "register_operand" "d")
+ (match_operand:SI 1 "const0_operand" "")))
+ (set (match_operand:SI 2 "register_operand" "=d")
+ (match_dup 0))]
+ "s390_match_ccmode(insn, CCSmode)"
+ "ltr\\t%2,%0"
+ [(set_attr "op_type" "RR")
+ (set_attr "type" "set")])
+
+(define_insn "*icm15"
+ [(set (reg 33)
+ (compare (match_operand:SI 0 "s_operand" "Qo")
+ (match_operand:SI 1 "const0_operand" "")))
+ (set (match_operand:SI 2 "register_operand" "=d")
+ (match_dup 0))]
+ "s390_match_ccmode(insn, CCSmode)"
+ "icm\\t%2,15,%0"
+ [(set_attr "op_type" "RS")
+ (set_attr "atype" "mem")
+ (set_attr "type" "set")])
+
+(define_insn "*icm15_cconly"
+ [(set (reg 33)
+ (compare (match_operand:SI 0 "s_operand" "Qo")
+ (match_operand:SI 1 "const0_operand" "")))
+ (clobber (match_scratch:SI 2 "=d"))]
+ "s390_match_ccmode(insn, CCSmode)"
+ "icm\\t%2,15,%0"
+ [(set_attr "op_type" "RS")
+ (set_attr "atype" "mem")
+ (set_attr "type" "set")])
+
+(define_insn "*cmpsi_ccs_0"
+ [(set (reg 33)
+ (compare (match_operand:SI 0 "register_operand" "d")
+ (match_operand:SI 1 "const0_operand" "")))]
+ "s390_match_ccmode(insn, CCSmode)"
+ "ltr\\t%0,%0"
+ [(set_attr "op_type" "RR")
+ (set_attr "type" "set")])
+
+(define_insn "*cmpsidi_ccs"
+ [(set (reg 33)
+ (compare (match_operand:SI 0 "register_operand" "d")
+ (sign_extend:SI (match_operand:HI 1 "memory_operand" "m"))))]
+ "s390_match_ccmode(insn, CCSmode)"
+ "ch\\t%0,%1"
+ [(set_attr "op_type" "RR")
+ (set_attr "atype" "mem")
+ (set_attr "type" "xset")])
+
+(define_insn "*cmpsi_ccs"
+ [(set (reg 33)
+ (compare (match_operand:SI 0 "register_operand" "d,d,d")
+ (match_operand:SI 1 "general_operand" "d,K,m")))]
+ "s390_match_ccmode(insn, CCSmode)"
+ "@
+ cr\\t%0,%1
+ chi\\t%0,%c1
+ c\\t%0,%1"
+ [(set_attr "op_type" "RR,RI,RX")
+ (set_attr "atype" "reg,reg,mem")
+ (set_attr "type" "xset,xset,xset")])
+
+(define_insn "*cmpsi_ccu"
+ [(set (reg 33)
+ (compare (match_operand:SI 0 "register_operand" "d,d")
+ (match_operand:SI 1 "general_operand" "d,m")))]
+ "s390_match_ccmode(insn, CCUmode)"
+ "@
+ clr\\t%0,%1
+ cl\\t%0,%1"
+ [(set_attr "op_type" "RR,RX")
+ (set_attr "atype" "reg,mem")])
+
+(define_insn "*cmpsi_ccu_mem"
+ [(set (reg 33)
+ (compare (match_operand:SI 0 "s_operand" "oQ")
+ (match_operand:SI 1 "s_operand" "oQ")))]
+ "s390_match_ccmode(insn, CCUmode)"
+ "clc\\t%O0(4,%R0),%1"
+ [(set_attr "op_type" "SS")
+ (set_attr "atype" "mem")
+ (set_attr "type" "xset")])
+
+
+; HI instructions
+
+(define_insn "*icm3"
+ [(set (reg 33)
+ (compare (match_operand:HI 0 "s_operand" "Qo")
+ (match_operand:HI 1 "const0_operand" "")))
+ (set (match_operand:HI 2 "register_operand" "=d")
+ (match_dup 0))]
+ "s390_match_ccmode(insn, CCSmode)"
+ "icm\\t%2,3,%0"
+ [(set_attr "op_type" "RS")
+ (set_attr "atype" "mem")
+ (set_attr "type" "set")])
+
+(define_insn "*cmphi_cct_0"
+ [(set (reg 33)
+ (compare (match_operand:HI 0 "register_operand" "d")
+ (match_operand:HI 1 "const0_operand" "")))]
+ "s390_match_ccmode(insn, CCTmode)"
+ "tml\\t%0,65535"
+ [(set_attr "op_type" "RX")
+ (set_attr "type" "xset")])
+
+(define_insn "*cmphi_ccs_0"
+ [(set (reg 33)
+ (compare (match_operand:HI 0 "s_operand" "Qo")
+ (match_operand:HI 1 "const0_operand" "")))
+ (clobber (match_scratch:HI 2 "=d"))]
+ "s390_match_ccmode(insn, CCSmode)"
+ "icm\\t%2,3,%0"
+ [(set_attr "op_type" "RS")
+ (set_attr "atype" "mem")
+ (set_attr "type" "set")])
+
+(define_insn "*cmphi_ccu"
+ [(set (reg 33)
+ (compare (match_operand:HI 0 "register_operand" "d")
+ (match_operand:HI 1 "s_operand" "Qo")))]
+ "s390_match_ccmode(insn, CCUmode)"
+ "clm\\t%0,3,%1"
+ [(set_attr "op_type" "RS")
+ (set_attr "atype" "mem")
+ (set_attr "type" "xset")])
+
+(define_insn "*cmphi_ccu_mem"
+ [(set (reg 33)
+ (compare (match_operand:HI 0 "s_operand" "oQ")
+ (match_operand:HI 1 "s_operand" "oQ")))]
+ "s390_match_ccmode(insn, CCUmode)"
+ "clc\\t%O0(2,%R0),%1"
+ [(set_attr "op_type" "SS")
+ (set_attr "atype" "mem")
+ (set_attr "type" "xset")])
+
+
+; QI instructions
+
+(define_insn "*icm1"
+ [(set (reg 33)
+ (compare (match_operand:QI 0 "s_operand" "Qo")
+ (match_operand:QI 1 "const0_operand" "")))
+ (set (match_operand:QI 2 "register_operand" "=d")
+ (match_dup 0))]
+ "s390_match_ccmode(insn, CCSmode)"
+ "icm\\t%2,1,%0"
+ [(set_attr "op_type" "RS")
+ (set_attr "atype" "mem")
+ (set_attr "type" "set")])
+
+(define_insn "*tm_0"
+ [(set (reg 33)
+ (compare (zero_extend:SI (and:QI (match_operand:QI 0 "s_operand" "Qo")
+ (match_operand:QI 1 "immediate_operand" "")))
+ (const_int 0)))]
+ "s390_match_ccmode(insn, CCTmode) &&
+ INTVAL(operands[1]) >= 0 && INTVAL(operands[1]) < 256"
+ "tm\\t%0,%1"
+ [(set_attr "op_type" "RI")
+ (set_attr "atype" "mem")
+ (set_attr "type" "xset")])
+
+(define_insn "*cmpqi_cct_0"
+ [(set (reg 33)
+ (compare (match_operand:QI 0 "register_operand" "d")
+ (match_operand:QI 1 "const0_operand" "")))]
+ "s390_match_ccmode(insn, CCTmode)"
+ "tml\\t%0,255"
+ [(set_attr "op_type" "RI")
+ (set_attr "type" "xset")])
+
+(define_insn "*cmpqi_ccs_0"
+ [(set (reg 33)
+ (compare (match_operand:QI 0 "s_operand" "Qo")
+ (match_operand:QI 1 "const0_operand" "")))
+ (clobber (match_scratch:QI 2 "=d"))]
+ "s390_match_ccmode(insn, CCSmode)"
+ "icm\\t%2,1,%0"
+ [(set_attr "op_type" "RS")
+ (set_attr "type" "xset")])
+
+(define_insn "*cmpqi_ccu_0"
+ [(set (reg 33)
+ (compare (match_operand:QI 0 "s_operand" "Qo")
+ (match_operand:QI 1 "const0_operand" "")))]
+ "s390_match_ccmode(insn, CCUmode)"
+ "cli\\t%0,0"
+ [(set_attr "op_type" "SI")
+ (set_attr "atype" "mem")
+ (set_attr "type" "xset")])
+
+(define_insn "*cmpqi_ccu"
+ [(set (reg 33)
+ (compare (match_operand:QI 0 "register_operand" "d")
+ (match_operand:QI 1 "s_operand" "Qo")))]
+ "s390_match_ccmode(insn, CCUmode)"
+ "clm\\t%0,1,%1"
+ [(set_attr "op_type" "RS")
+ (set_attr "atype" "mem")
+ (set_attr "type" "xset")])
+
+(define_insn "*cmpqi_ccu_immed"
+ [(set (reg 33)
+ (compare (match_operand:QI 0 "s_operand" "Qo")
+ (match_operand:QI 1 "immediate_operand" "")))]
+ "s390_match_ccmode(insn, CCUmode) &&
+ INTVAL(operands[1]) >= 0 && INTVAL(operands[1]) < 256"
+ "cli\\t%0,%1"
+ [(set_attr "op_type" "SI")
+ (set_attr "atype" "mem")
+ (set_attr "type" "xset")])
+
+(define_insn "*cmpqi_ccu_mem"
+ [(set (reg 33)
+ (compare (match_operand:QI 0 "s_operand" "oQ")
+ (match_operand:QI 1 "s_operand" "oQ")))]
+ "s390_match_ccmode(insn, CCUmode)"
+ "clc\\t%O0(1,%R0),%1"
+ [(set_attr "op_type" "SS")
+ (set_attr "atype" "mem")
+ (set_attr "type" "xset")])
+
+
+; DF instructions
+
+(define_insn "*cmpdf_ccs_0"
+ [(set (reg 33)
+ (compare (match_operand:DF 0 "register_operand" "f")
+ (match_operand:DF 1 "const0_operand" "")))]
+ "s390_match_ccmode(insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
+ "ltdbr\\t%0,%0"
+ [(set_attr "op_type" "RR")
+ (set_attr "type" "set")])
+
+(define_insn "*cmpdf_ccs_0_ibm"
+ [(set (reg 33)
+ (compare (match_operand:DF 0 "register_operand" "f")
+ (match_operand:DF 1 "const0_operand" "")))]
+ "s390_match_ccmode(insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
+ "ltdr\\t%0,%0"
+ [(set_attr "op_type" "RR")
+ (set_attr "type" "set")])
+
+(define_insn "*cmpdf_ccs"
+ [(set (reg 33)
+ (compare (match_operand:DF 0 "register_operand" "f,f")
+ (match_operand:DF 1 "nonimmediate_operand" "f,m")))]
+ "s390_match_ccmode(insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
+ "@
+ cdbr\\t%0,%1
+ cdb\\t%0,%1"
+ [(set_attr "op_type" "RR,RX")
+ (set_attr "atype" "reg,mem")
+ (set_attr "type" "xset,xset")])
+
+(define_insn "*cmpdf_ccs_ibm"
+ [(set (reg 33)
+ (compare (match_operand:DF 0 "register_operand" "f,f")
+ (match_operand:DF 1 "nonimmediate_operand" "f,m")))]
+ "s390_match_ccmode(insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
+ "@
+ cdr\\t%0,%1
+ cd\\t%0,%1"
+ [(set_attr "op_type" "RR,RX")
+ (set_attr "atype" "reg,mem")
+ (set_attr "type" "xset,xset")])
+
+
+; SF instructions
+
+(define_insn "*cmpsf_ccs_0"
+ [(set (reg 33)
+ (compare (match_operand:SF 0 "register_operand" "f")
+ (match_operand:SF 1 "const0_operand" "")))]
+ "s390_match_ccmode(insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
+ "ltebr\\t%0,%0"
+ [(set_attr "op_type" "RR")
+ (set_attr "type" "set")])
+
+(define_insn "*cmpsf_ccs_0_ibm"
+ [(set (reg 33)
+ (compare (match_operand:SF 0 "register_operand" "f")
+ (match_operand:SF 1 "const0_operand" "")))]
+ "s390_match_ccmode(insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
+ "lter\\t%0,%0"
+ [(set_attr "op_type" "RR")
+ (set_attr "type" "set")])
+
+(define_insn "*cmpsf_ccs"
+ [(set (reg 33)
+ (compare (match_operand:SF 0 "register_operand" "f,f")
+ (match_operand:SF 1 "nonimmediate_operand" "f,m")))]
+ "s390_match_ccmode(insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
+ "@
+ cebr\\t%0,%1
+ ceb\\t%0,%1"
+ [(set_attr "op_type" "RR,RX")
+ (set_attr "atype" "reg,mem")
+ (set_attr "type" "xset,xset")])
+
+(define_insn "*cmpsf_ccs"
+ [(set (reg 33)
+ (compare (match_operand:SF 0 "register_operand" "f,f")
+ (match_operand:SF 1 "nonimmediate_operand" "f,m")))]
+ "s390_match_ccmode(insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
+ "@
+ cer\\t%0,%1
+ ce\\t%0,%1"
+ [(set_attr "op_type" "RR,RX")
+ (set_attr "atype" "reg,mem")
+ (set_attr "type" "xset,xset")])
+
+
+;;
+;;- Move instructions.
+;;
+
+;
+; movti instruction pattern(s).
+;
+
+(define_insn "movti"
+ [(set (match_operand:TI 0 "nonimmediate_operand" "=d,d,d,m,Q")
+ (match_operand:TI 1 "general_operand" "d,K,m,d,Q"))]
+ "TARGET_64BIT"
+ "*
+{
+ switch (which_alternative)
+ {
+ case 0: /* d <- d */
+ if (REGNO (operands[0]) == REGNO (operands[1]) + 1)
+ return \"lgr\\t%M0,%M1\;lgr\\t%0,%1\";
+ else
+ return \"lgr\\t%0,%1\;lgr\\t%M0,%M1\";
+
+ case 1: /* d <- K */
+ if (INTVAL(operands[1]) < 0)
+ return \"lghi\\t%0,-1\;lghi\\t%M0,%h1\";
+ else
+ return \"lghi\\t%0,0\;lghi\\t%M0,%h1\";
+
+ case 2: /* d <- m */
+ if (s_operand (operands[1], GET_MODE (operands[1])))
+ return \"lmg\\t%0,%M0,%1\";
+ else
+ return \"la\\t%M0,%1\;lmg\\t%0,%M0,0(%M0)\";
+
+ case 3: /* m <- d */
+ if (!s_operand (operands[0], GET_MODE (operands[0])))
+ return \"stg\\t%1,%0\;stg\\t%M1,%M0\";
+ else
+ return \"stmg\\t%1,%M1,%0\";
+
+ case 4: /* m <- m */
+ return \"mvc\\t%O0(16,%R0),%1\";
+ }
+}"
+ [(set_attr "op_type" "NN,NN,RS,RS,SS")
+ (set_attr "atype" "reg,reg,mem,mem,mem")
+ (set_attr "type" "set")
+ (set_attr "length" "12,8,10,10,*")])
+
+;
+; movdi instruction pattern(s).
+;
+
+;; If generating PIC code and operands[1] is a symbolic CONST, emit a
+;; move to get the address of the symbolic object from the GOT.
+
+(define_expand "movdi"
+ [(set (match_operand:DI 0 "general_operand" "")
+ (match_operand:DI 1 "general_operand" ""))]
+ ""
+ "
+{
+ if (CONSTANT_P (operands[1])
+ && !LEGITIMATE_CONSTANT_P (operands[1]))
+ operands[1] = force_const_mem (DImode, operands[1]);
+
+ if (TARGET_64BIT && flag_pic && SYMBOLIC_CONST (operands[1]))
+ emit_pic_move (operands, DImode);
+}")
+
+(define_insn "*movdi_64"
+ [(set (match_operand:DI 0 "nonimmediate_operand" "=d,d,d,d,m,Q")
+ (match_operand:DI 1 "general_operand" "d,K,S,m,d,Q"))]
+ "TARGET_64BIT"
+ "@
+ lgr\\t%0,%1
+ lghi\\t%0,%h1
+ larl\\t%0,%1
+ lg\\t%0,%1
+ stg\\t%1,%0
+ mvc\\t%O0(8,%R0),%1"
+ [(set_attr "op_type" "RRE,RI,RIL,RXE,RXE,SS")
+ (set_attr "atype" "reg,reg,reg,mem,mem,mem")
+ (set_attr "type" "set,set,la,set,set,set")])
+
+(define_insn "*movdi_31"
+ [(set (match_operand:DI 0 "nonimmediate_operand" "=d,d,d,m,Q")
+ (match_operand:DI 1 "general_operand" "d,K,m,d,Q"))]
+ "!TARGET_64BIT"
+ "*
+{
+ switch (which_alternative)
+ {
+ case 0: /* d <- d */
+ if (REGNO (operands[0]) == REGNO (operands[1]) + 1)
+ return \"lr\\t%N0,%N1\;lr\\t%0,%1\";
+ else
+ return \"lr\\t%0,%1\;lr\\t%N0,%N1\";
+
+ case 1: /* d <- K */
+ if (INTVAL (operands[1]) < 0)
+ return \"lhi\\t%0,-1\;lhi\\t%N0,%h1\";
+ else
+ return \"lhi\\t%0,0\;lhi\\t%N0,%h1\";
+
+ case 2: /* d <- m */
+ if (s_operand (operands[1], GET_MODE (operands[1])))
+ return \"lm\\t%0,%N0,%1\";
+ else
+ return \"la\\t%N0,%1\;lm\\t%0,%N0,0(%N0)\";
+
+ case 3: /* m <- d */
+ if (s_operand (operands[0], GET_MODE (operands[0])))
+ return \"stm\\t%1,%N1,%0\";
+ else
+ return \"st\\t%1,%0\;st\\t%N1,%N0\";
+
+ case 4: /* m <- m */
+ return \"mvc\\t%O0(8,%R0),%1\";
+ }
+}"
+ [(set_attr "op_type" "NN,NN,RS,RS,SS")
+ (set_attr "atype" "reg,reg,mem,mem,mem")
+ (set_attr "type" "set")
+ (set_attr "length" "4,8,8,8,*")])
+
+
+;
+; movsi instruction pattern(s).
+;
+
+;; If generating PIC code and operands[1] is a symbolic CONST, emit a
+;; move to get the address of the symbolic object from the GOT.
+
+(define_expand "movsi"
+ [(set (match_operand:SI 0 "general_operand" "")
+ (match_operand:SI 1 "general_operand" ""))]
+ ""
+ "
+{
+ if (CONSTANT_P (operands[1])
+ && !LEGITIMATE_CONSTANT_P (operands[1]))
+ operands[1] = force_const_mem (SImode, operands[1]);
+
+ if (flag_pic && SYMBOLIC_CONST (operands[1]))
+ emit_pic_move (operands, SImode);
+
+ /* expr.c tries to load an effective address using
+ force_reg. This fails because we don't have a
+ generic load_address pattern. Convert the move
+ to a proper arithmetic operation instead, unless
+ it is guaranteed to be OK. */
+ if (GET_CODE (operands[1]) == PLUS
+ && !legitimate_la_operand_p (operands[1]))
+ {
+ operands[1] = force_operand (operands[1], operands[0]);
+ if (operands[1] == operands[0])
+ DONE;
+ }
+}")
+
+(define_insn "*movsi"
+ [(set (match_operand:SI 0 "nonimmediate_operand" "=d,d,d,m,Q")
+ (match_operand:SI 1 "general_operand" "d,K,m,d,Q"))]
+ ""
+ "@
+ lr\\t%0,%1
+ lhi\\t%0,%h1
+ l\\t%0,%1
+ st\\t%1,%0
+ mvc\\t%O0(4,%R0),%1"
+ [(set_attr "op_type" "RR,RI,RX,RX,SS")
+ (set_attr "atype" "reg,reg,mem,mem,mem")
+ (set_attr "type" "set")])
+
+
+;
+; movhi instruction pattern(s).
+;
+
+(define_insn "movhi"
+ [(set (match_operand:HI 0 "nonimmediate_operand" "=d,d,d,m")
+ (match_operand:HI 1 "r_or_x_or_im16_operand" "d,K,m,d"))]
+ ""
+ "@
+ lr\\t%0,%1
+ lhi\\t%0,%h1
+ lh\\t%0,%1
+ sth\\t%1,%0"
+ [(set_attr "op_type" "RR,RI,RX,RX")
+ (set_attr "atype" "reg,reg,mem,mem")
+ (set_attr "type" "xset")])
+
+
+;
+; movqi instruction pattern(s).
+;
+
+(define_insn "movqi_64"
+ [(set (match_operand:QI 0 "nonimmediate_operand" "=d,d,d,m,Q")
+ (match_operand:QI 1 "general_operand" "d,K,m,d,n"))]
+ "TARGET_64BIT"
+ "@
+ lr\\t%0,%1
+ llill\\t%0,%x1
+ llgc\\t%0,%1
+ stc\\t%1,%0
+ mvi\\t%0,%b1"
+ [(set_attr "op_type" "RR,RI,RXE,RX,SI")
+ (set_attr "atype" "reg,reg,mem,mem,mem")
+ (set_attr "type" "xset")])
+
+
+(define_insn "movqi"
+ [(set (match_operand:QI 0 "nonimmediate_operand" "=d,d,d,m,Q")
+ (match_operand:QI 1 "r_or_x_or_im16_operand" "d,n,m,d,n"))]
+ ""
+ "@
+ lr\\t%0,%1
+ lhi\\t%0,%c1
+ ic\\t%0,%1
+ stc\\t%1,%0
+ mvi\\t%0,%b1"
+ [(set_attr "op_type" "RR,RX,RX,RX,SI")
+ (set_attr "atype" "reg,reg,mem,mem,mem")
+ (set_attr "type" "xset")])
+
+
+;
+; moveqstrictqi instruction pattern(s).
+;
+
+(define_insn "*movstrictqi"
+ [(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+d,m"))
+ (match_operand:QI 1 "nonimmediate_operand" "m,d"))]
+ ""
+ "@
+ ic\\t%0,%1
+ stc\\t%1,%0"
+ [(set_attr "op_type" "RX,RX")
+ (set_attr "atype" "mem,mem")])
+
+
+;
+; movstricthi instruction pattern(s).
+;
+
+(define_insn "*movstricthi"
+ [(set (strict_low_part (match_operand:HI 0 "r_or_s_operand" "+d,Q"))
+ (match_operand:HI 1 "r_or_s_operand" "Q,d"))
+ (clobber (reg:CC 33))]
+ ""
+ "@
+ icm\\t%0,3,%1
+ stcm\\t%1,3,%0"
+ [(set_attr "op_type" "RS,RS")
+ (set_attr "atype" "mem")
+ (set_attr "type" "xset")])
+
+
+;
+; movstrictsi instruction pattern(s).
+;
+
+(define_insn "movestrictsi"
+ [(set (strict_low_part (match_operand:SI 0 "nonimmediate_operand" "+d,d,m"))
+ (match_operand:SI 1 "nonimmediate_operand" "d,m,d"))]
+ "TARGET_64BIT"
+ "@
+ lr\\t%0,%1
+ l\\t%0,%1
+ st\\t%1,%0"
+ [(set_attr "op_type" "RR,RS,RS")
+ (set_attr "atype" "reg,mem,mem")
+ (set_attr "type" "xset")])
+
+
+;
+; movdf instruction pattern(s).
+;
+
+(define_expand "movdf"
+ [(set (match_operand:DF 0 "nonimmediate_operand" "")
+ (match_operand:DF 1 "general_operand" ""))]
+ ""
+ "
+{
+ if (GET_CODE (operands[1]) == CONST_DOUBLE)
+ operands[1] = force_const_mem (DFmode, operands[1]);
+}")
+
+(define_insn "*movdf_64"
+ [(set (match_operand:DF 0 "nonimmediate_operand" "=f,f,m,d,m,d,Q")
+ (match_operand:DF 1 "general_operand" "f,m,f,m,d,d,Q"))]
+ "TARGET_64BIT && TARGET_HARD_FLOAT"
+ "@
+ ldr\\t%0,%1
+ ld\\t%0,%1
+ std\\t%1,%0
+ lg\\t%0,%1
+ stg\\t%1,%0
+ lgr\\t%0,%1
+ mvc\\t%O0(8,%R0),%1"
+ [(set_attr "op_type" "RR,RX,RX,RXE,RXE,RR,SS")
+ (set_attr "atype" "reg,mem,mem,mem,mem,mem,mem")
+ (set_attr "type" "xset")])
+
+(define_insn "*movdf_31"
+ [(set (match_operand:DF 0 "nonimmediate_operand" "=f,f,m,d,m,d,Q")
+ (match_operand:DF 1 "general_operand" "f,m,f,m,d,d,Q"))]
+ "TARGET_HARD_FLOAT"
+ "*
+{
+ switch (which_alternative)
+ {
+ case 0: /* f <- f */
+ return \"ldr\\t%0,%1\";
+
+ case 1: /* f <- m */
+ return \"ld\\t%0,%1\";
+
+ case 2: /* m <- f */
+ return \"std\\t%1,%0\";
+
+ case 3: /* d <- m */
+ if (s_operand (operands[1], GET_MODE (operands[1])))
+ return \"lm\\t%0,%N0,%1\";
+ else
+ return \"la\\t%N0,%1\;lm\\t%0,%N0,0(%N0)\";
+
+ case 4: /* m <- d */
+ if (s_operand (operands[0], GET_MODE (operands[0])))
+ return \"stm\\t%1,%N1,%0\";
+ else
+ return \"st\\t%1,%0\;st\\t%N1,%N0\";
+
+ case 5: /* d <- d */
+ if (REGNO (operands[0]) == REGNO (operands[1]) + 1)
+ return \"lr\\t%N0,%N1\;lr\\t%0,%1\";
+ else
+ return \"lr\\t%0,%1\;lr\\t%N0,%N1\";
+
+ case 6: /* m <- m */
+ return \"mvc\\t%O0(8,%R0),%1\";
+ }
+}"
+ [(set_attr "op_type" "RR,RX,RX,RS,RS,NN,SS")
+ (set_attr "atype" "reg,mem,mem,mem,mem,reg,mem")
+ (set_attr "length" "*,*,*,*,*,4,*")])
+
+(define_insn "*movdf_soft_64"
+ [(set (match_operand:DF 0 "nonimmediate_operand" "=d,m,d,Q")
+ (match_operand:DF 1 "general_operand" "m,d,d,Q"))]
+ "TARGET_64BIT && TARGET_SOFT_FLOAT"
+ "@
+ lg\\t%0,%1
+ stg\\t%1,%0
+ lgr\\t%0,%1
+ mvc\\t%O0(8,%R0),%1"
+ [(set_attr "op_type" "RXE,RXE,RR,SS")
+ (set_attr "atype" "mem,mem,mem,mem")
+ (set_attr "type" "xset")])
+
+(define_insn "*movdf_soft_31"
+ [(set (match_operand:DF 0 "nonimmediate_operand" "=!d,d,m,Q")
+ (match_operand:DF 1 "general_operand" "!d,m,d,Q"))]
+ "TARGET_SOFT_FLOAT"
+ "*
+{
+ switch (which_alternative)
+ {
+ case 0: /* d <- d */
+ if (REGNO (operands[0]) == REGNO (operands[1]) + 1)
+ return \"lr\\t%N0,%N1\;lr\\t%0,%1\";
+ else
+ return \"lr\\t%0,%1\;lr\\t%N0,%N1\";
+
+ case 1: /* d <- m */
+ if (s_operand (operands[1], GET_MODE (operands[1])))
+ return \"lm\\t%0,%N0,%1\";
+ else
+ return \"la\\t%N0,%1\;lm\\t%0,%N0,0(%N0)\";
+
+ case 2: /* m <- d */
+ if (s_operand (operands[0], GET_MODE (operands[0])))
+ return \"stm\\t%1,%N1,%0\";
+ else
+ return \"st\\t%1,%0\;st\\t%N1,%N0\";
+
+ case 3: /* m <- m */
+ return \"mvc\\t%O0(8,%R0),%1\";
+ }
+}"
+ [(set_attr "op_type" "NN,RS,RS,SS")
+ (set_attr "atype" "reg,mem,mem,mem")
+ (set_attr "length" "8,*,*,*")])
+
+
+;
+; movsf instruction pattern(s).
+;
+
+(define_expand "movsf"
+ [(set (match_operand:SF 0 "nonimmediate_operand" "")
+ (match_operand:SF 1 "general_operand" ""))]
+ ""
+ "
+{
+ if (GET_CODE (operands[1]) == CONST_DOUBLE)
+ operands[1] = force_const_mem (SFmode, operands[1]);
+}")
+
+(define_insn "*movsf_64"
+ [(set (match_operand:SF 0 "nonimmediate_operand" "=f,f,m,d,m,d,Q")
+ (match_operand:SF 1 "general_operand" "f,m,f,m,d,d,Q"))]
+ "TARGET_64BIT && TARGET_HARD_FLOAT"
+ "@
+ ler\\t%0,%1
+ le\\t%0,%1
+ ste\\t%1,%0
+ llgf\\t%0,%1
+ st\\t%1,%0
+ lgr\\t%0,%1
+ mvc\\t%O0(4,%R0),%1"
+ [(set_attr "op_type" "RR,RX,RX,RXE,RX,RR,SS")
+ (set_attr "atype" "reg,mem,mem,mem,mem,reg,mem")])
+
+(define_insn "*movsf_31"
+ [(set (match_operand:SF 0 "nonimmediate_operand" "=f,f,m,d,m,d,Q")
+ (match_operand:SF 1 "general_operand" "f,m,f,m,d,d,Q"))]
+ "TARGET_HARD_FLOAT"
+ "@
+ ler\\t%0,%1
+ le\\t%0,%1
+ ste\\t%1,%0
+ l\\t%0,%1
+ st\\t%1,%0
+ lr\\t%0,%1
+ mvc\\t%O0(4,%R0),%1"
+ [(set_attr "op_type" "RR,RX,RX,RX,RX,RR,SS")
+ (set_attr "atype" "reg,mem,mem,mem,mem,reg,mem")])
+
+(define_insn "*movsf_soft"
+ [(set (match_operand:SF 0 "nonimmediate_operand" "=d,d,m,Q")
+ (match_operand:SF 1 "general_operand" "d,m,d,Q"))]
+ "TARGET_SOFT_FLOAT"
+ "@
+ lr\\t%0,%1
+ l\\t%0,%1
+ st\\t%1,%0
+ mvc\\t%O0(4,%R0),%1"
+ [(set_attr "op_type" "RR,RX,RX,SS")
+ (set_attr "atype" "reg,mem,mem,mem")])
+;
+; load_multiple pattern(s).
+;
+
+(define_expand "load_multiple"
+ [(match_par_dup 3 [(set (match_operand 0 "" "")
+ (match_operand 1 "" ""))
+ (use (match_operand 2 "" ""))])]
+ ""
+ "
+{
+ int regno;
+ int count;
+ rtx from;
+ int i;
+
+ /* Support only loading a constant number of fixed-point registers from
+ memory and only bother with this if more than two */
+ if (GET_CODE (operands[2]) != CONST_INT
+ || INTVAL (operands[2]) <= 2
+ || INTVAL (operands[2]) > 16
+ || GET_CODE (operands[1]) != MEM
+ || GET_CODE (operands[0]) != REG
+ || REGNO (operands[0]) >= 16)
+ FAIL;
+
+ count = INTVAL (operands[2]);
+ regno = REGNO (operands[0]);
+
+ operands[3] = gen_rtx_PARALLEL (VOIDmode, rtvec_alloc (count));
+ from = force_reg (Pmode, XEXP (operands[1], 0));
+
+ for (i = 0; i < count; i++)
+ XVECEXP (operands[3], 0, i)
+ = gen_rtx_SET (VOIDmode, gen_rtx_REG (Pmode, regno + i),
+ change_address (operands[1], Pmode,
+ plus_constant (from, i * 4)));
+}")
+
+(define_insn "*load_multiple_di"
+ [(match_parallel 0 "load_multiple_operation"
+ [(set (match_operand:DI 1 "register_operand" "=r")
+ (match_operand:DI 2 "s_operand" "oQ"))])]
+ ""
+ "*
+{
+ int words = XVECLEN (operands[0], 0);
+
+ if (XVECLEN (operands[0], 0) == 1)
+ return \"lg\\t%1,0(%2)\";
+
+ operands[0] = gen_rtx_REG (DImode, REGNO (operands[1]) + words - 1);
+ return \"lmg\\t%1,%0,%2\";
+}"
+ [(set_attr "op_type" "RXE")
+ (set_attr "atype" "mem")
+ (set_attr "type" "set")])
+
+(define_insn "*load_multiple_si"
+ [(match_parallel 0 "load_multiple_operation"
+ [(set (match_operand:SI 1 "register_operand" "=r")
+ (match_operand:SI 2 "s_operand" "oQ"))])]
+ ""
+ "*
+{
+ int words = XVECLEN (operands[0], 0);
+
+ if (XVECLEN (operands[0], 0) == 1)
+ return \"l\\t%1,0(%2)\";
+
+ operands[0] = gen_rtx_REG (SImode, REGNO (operands[1]) + words - 1);
+ return \"lm\\t%1,%0,%2\";
+}"
+ [(set_attr "op_type" "RXE")
+ (set_attr "atype" "mem")
+ (set_attr "type" "set")])
+
+;
+; store multiple pattern(s).
+;
+
+(define_expand "store_multiple"
+ [(match_par_dup 3 [(set (match_operand 0 "" "")
+ (match_operand 1 "" ""))
+ (use (match_operand 2 "" ""))])]
+ ""
+ "
+{
+ int regno;
+ int count;
+ rtx to;
+ int i;
+
+ /* Support only storing a constant number of fixed-point registers to
+ memory and only bother with this if more than two. */
+ if (GET_CODE (operands[2]) != CONST_INT
+ || INTVAL (operands[2]) <= 2
+ || INTVAL (operands[2]) > 16
+ || GET_CODE (operands[0]) != MEM
+ || GET_CODE (operands[1]) != REG
+ || REGNO (operands[1]) >= 16)
+ FAIL;
+
+ count = INTVAL (operands[2]);
+ regno = REGNO (operands[1]);
+
+ operands[3] = gen_rtx_PARALLEL (VOIDmode, rtvec_alloc (count));
+ to = force_reg (Pmode, XEXP (operands[0], 0));
+
+ for (i = 0; i < count; i++)
+ XVECEXP (operands[3], 0, i)
+ = gen_rtx_SET (VOIDmode,
+ change_address (operands[0], Pmode,
+ plus_constant (to, i * 4)),
+ gen_rtx_REG (Pmode, regno + i));
+}")
+
+(define_insn "*store_multiple_di"
+ [(match_parallel 0 "store_multiple_operation"
+ [(set (match_operand:DI 1 "s_operand" "=oQ")
+ (match_operand:DI 2 "register_operand" "r"))])]
+ ""
+ "*
+{
+ int words = XVECLEN (operands[0], 0);
+
+ if (XVECLEN (operands[0], 0) == 1)
+ return \"stg\\t%1,0(%2)\";
+
+ operands[0] = gen_rtx_REG (DImode, REGNO (operands[2]) + words - 1);
+ return \"stmg\\t%2,%0,%1\";
+}"
+ [(set_attr "op_type" "RXE")
+ (set_attr "atype" "mem")
+ (set_attr "type" "xset")])
+
+
+(define_insn "*store_multiple_si"
+ [(match_parallel 0 "store_multiple_operation"
+ [(set (match_operand:SI 1 "s_operand" "=oQ")
+ (match_operand:SI 2 "register_operand" "r"))])]
+ ""
+ "*
+{
+ int words = XVECLEN (operands[0], 0);
+
+ if (XVECLEN (operands[0], 0) == 1)
+ return \"st\\t%1,0(%2)\";
+
+ operands[0] = gen_rtx_REG (SImode, REGNO (operands[2]) + words - 1);
+ return \"stm\\t%2,%0,%1\";
+}"
+ [(set_attr "op_type" "RXE")
+ (set_attr "atype" "mem")
+ (set_attr "type" "xset")])
+
+;;
+;; String instructions.
+;;
+
+;
+; movstrdi instruction pattern(s).
+;
+
+(define_expand "movstrdi"
+ [(set (match_operand:BLK 0 "general_operand" "")
+ (match_operand:BLK 1 "general_operand" ""))
+ (use (match_operand:DI 2 "general_operand" ""))
+ (match_operand 3 "" "")]
+ "TARGET_64BIT"
+ "
+{
+ rtx addr0, addr1;
+
+ addr0 = force_operand (XEXP (operands[0], 0), NULL_RTX);
+ addr1 = force_operand (XEXP (operands[1], 0), NULL_RTX);
+
+ if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) <= 256)
+ {
+ operands[0] = change_address (operands[0], VOIDmode, addr0);
+ operands[1] = change_address (operands[1], VOIDmode, addr1);
+ operands[2] = GEN_INT (INTVAL (operands[2]) - 1);
+
+ emit_insn (gen_movstrsico (operands[0], operands[1], operands[2]));
+ DONE;
+ }
+ else
+ {
+ if (TARGET_MVCLE)
+ {
+ /* implementation suggested by Richard Henderson <rth@cygnus.com> */
+ rtx reg0 = gen_reg_rtx (TImode);
+ rtx reg1 = gen_reg_rtx (TImode);
+ rtx len = operands[2];
+
+ if (! CONSTANT_P (len))
+ len = force_reg (DImode, len);
+
+ /* Load up the address+length pairs. */
+
+ emit_move_insn (gen_rtx_SUBREG (DImode, reg0, 0), addr0);
+ emit_move_insn (gen_rtx_SUBREG (DImode, reg0, 1), len);
+
+ emit_move_insn (gen_rtx_SUBREG (DImode, reg1, 0), addr1);
+ emit_move_insn (gen_rtx_SUBREG (DImode, reg1, 1), len);
+
+ /* MOVE */
+ emit_insn (gen_movstrdi_64 (reg0, reg1));
+ DONE;
+ }
+ else
+ {
+ rtx label = gen_label_rtx ();
+ rtx reg0, reg1, len;
+
+ reg0 = gen_reg_rtx (DImode);
+ reg1 = gen_reg_rtx (DImode);
+ len = gen_reg_rtx (DImode);
+
+ emit_move_insn (len, operands[2]);
+ emit_insn (gen_cmpdi (len, const0_rtx));
+ emit_jump_insn (gen_beq (label));
+ emit_move_insn (reg0, addr0);
+ emit_move_insn (reg1, addr1);
+ emit_insn (gen_adddi3 (len, len, constm1_rtx));
+ emit_insn (gen_movstrdix_64 (reg0, reg1, len));
+ emit_label (label);
+ DONE;
+ }
+ }
+}")
+
+;
+; movstrsi instruction pattern(s).
+;
+
+(define_expand "movstrsi"
+ [(set (match_operand:BLK 0 "general_operand" "")
+ (match_operand:BLK 1 "general_operand" ""))
+ (use (match_operand:SI 2 "general_operand" ""))
+ (match_operand 3 "" "")]
+ ""
+ "
+{
+ rtx addr0 = force_operand (XEXP (operands[0], 0), NULL_RTX);
+ rtx addr1 = force_operand (XEXP (operands[1], 0), NULL_RTX);
+
+ if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) <= 256)
+ {
+ operands[0] = change_address (operands[0], VOIDmode, addr0);
+ operands[1] = change_address (operands[1], VOIDmode, addr1);
+ operands[2] = GEN_INT (INTVAL (operands[2]) - 1);
+
+ emit_insn (gen_movstrsico (operands[0], operands[1], operands[2]));
+ DONE;
+ }
+ else
+ {
+ if (TARGET_64BIT)
+ FAIL;
+
+ if (TARGET_MVCLE)
+ {
+ /* implementation suggested by Richard Henderson <rth@cygnus.com> */
+ rtx reg0 = gen_reg_rtx (DImode);
+ rtx reg1 = gen_reg_rtx (DImode);
+ rtx len = operands[2];
+
+
+ if (! CONSTANT_P (len))
+ len = force_reg (SImode, len);
+
+ /* Load up the address+length pairs. */
+
+ emit_move_insn (gen_rtx_SUBREG (SImode, reg0, 0), addr0);
+ emit_move_insn (gen_rtx_SUBREG (SImode, reg0, 1), len);
+
+ emit_move_insn (gen_rtx_SUBREG (SImode, reg1, 0), addr1);
+ emit_move_insn (gen_rtx_SUBREG (SImode, reg1, 1), len);
+
+ /* MOVE */
+ emit_insn (gen_movstrsi_31 (reg0, reg1));
+ DONE;
+ }
+ else
+ {
+ rtx label = gen_label_rtx ();
+ rtx reg0, reg1, len;
+
+ reg0 = gen_reg_rtx (SImode);
+ reg1 = gen_reg_rtx (SImode);
+ len = gen_reg_rtx (SImode);
+
+ emit_move_insn (len, operands[2]);
+ emit_insn (gen_cmpsi (len, const0_rtx));
+ emit_jump_insn (gen_beq (label));
+ emit_move_insn (reg0, addr0);
+ emit_move_insn (reg1, addr1);
+ emit_insn (gen_addsi3 (len, len, constm1_rtx));
+ emit_insn (gen_movstrsix_31 (reg0, reg1, len));
+ emit_label (label);
+ DONE;
+ }
+ }
+}")
+
+; Move a block that is less than 256 bytes in length.
+
+(define_insn "movstrsico"
+ [(set (match_operand:BLK 0 "s_operand" "=oQ")
+ (match_operand:BLK 1 "s_operand" "oQ"))
+ (use (match_operand 2 "const_int_operand" "I"))]
+ "((unsigned) INTVAL (operands[2]) < 256)"
+ "mvc\\t%O0(%c2+1,%R0),%1"
+ [(set_attr "op_type" "SS")
+ (set_attr "atype" "mem")])
+
+; Move a block that is more than 256 bytes in lenght or length in register
+
+(define_insn "movstrdix_64"
+ [(set (mem:BLK (match_operand:DI 0 "register_operand" "a"))
+ (mem:BLK (match_operand:DI 1 "register_operand" "a")))
+ (use (match_operand:DI 2 "register_operand" "a"))
+ (clobber (match_dup 0))
+ (clobber (match_dup 1))
+ (clobber (match_scratch:DI 3 "=&a"))
+ (clobber (reg:CC 33))]
+ ""
+ "*
+{
+ rtx xop[4];
+ xop[0] = gen_label_rtx ();
+ xop[1] = gen_label_rtx ();
+ xop[2] = gen_label_rtx ();
+ xop[3] = operands[3];
+ output_asm_insn (\"srag\\t%3,%2,8\",operands);
+ output_asm_insn (\"jz\\t%l1\",xop);
+ ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\",
+ CODE_LABEL_NUMBER (xop[0]));
+ output_asm_insn (\"mvc\\t0(256,%0),0(%1)\",operands);
+ output_asm_insn (\"la\\t%0,256(%0)\",operands);
+ output_asm_insn (\"la\\t%1,256(%1)\",operands);
+ xop[3] = operands[3];
+ output_asm_insn (\"brct\\t%3,%l0\",xop);
+ ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\",
+ CODE_LABEL_NUMBER (xop[1]));
+ xop[3] = operands[3];
+ output_asm_insn (\"bras\\t%3,%l2\",xop);
+ output_asm_insn (\"mvc\\t0(1,%0),0(%1)\",operands);
+ ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\",
+ CODE_LABEL_NUMBER (xop[2]));
+ return \"ex\\t%2,0(%3)\";
+}"
+ [(set_attr "op_type" "NN")
+ (set_attr "atype" "mem")
+ (set_attr "length" "44")])
+
+(define_insn "movstrsix_31"
+ [(set (mem:BLK (match_operand:SI 0 "register_operand" "a"))
+ (mem:BLK (match_operand:SI 1 "register_operand" "a")))
+ (use (match_operand:SI 2 "register_operand" "a"))
+ (clobber (match_dup 0))
+ (clobber (match_dup 1))
+ (clobber (match_scratch:SI 3 "=&a"))
+ (clobber (reg:CC 33))]
+ ""
+ "*
+{
+ rtx xop[4];
+ xop[0] = gen_label_rtx ();
+ xop[1] = gen_label_rtx ();
+ xop[2] = gen_label_rtx ();
+ xop[3] = operands[3];
+ output_asm_insn (\"lr\\t%3,%2\",operands);
+ output_asm_insn (\"sra\\t%3,8\",operands);
+ output_asm_insn (\"jz\\t%l1\",xop);
+ ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\",
+ CODE_LABEL_NUMBER (xop[0]));
+ output_asm_insn (\"mvc\\t0(256,%0),0(%1)\",operands);
+ output_asm_insn (\"la\\t%0,256(%0)\",operands);
+ output_asm_insn (\"la\\t%1,256(%1)\",operands);
+ xop[3] = operands[3];
+ output_asm_insn (\"brct\\t%3,%l0\",xop);
+ ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\",
+ CODE_LABEL_NUMBER (xop[1]));
+ xop[3] = operands[3];
+ output_asm_insn (\"bras\\t%3,%l2\",xop);
+ output_asm_insn (\"mvc\\t0(1,%0),0(%1)\",operands);
+ ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\",
+ CODE_LABEL_NUMBER (xop[2]));
+ return \"ex\\t%2,0(%3)\";
+}"
+ [(set_attr "op_type" "NN")
+ (set_attr "length" "42")
+ (set_attr "atype" "mem")])
+
+; Move a block that is larger than 255 bytes in length.
+
+(define_insn "movstrdi_64"
+ [(set (mem:BLK (subreg:DI (match_operand:TI 0 "register_operand" "d") 0))
+ (mem:BLK (subreg:DI (match_operand:TI 1 "register_operand" "d") 0)))
+ (clobber (match_dup 0))
+ (clobber (match_dup 1))
+ (clobber (reg:CC 33))]
+ ""
+ "mvcle\\t%0,%1,0\;jo\\t.-4"
+ [(set_attr "op_type" "NN")
+ (set_attr "atype" "mem")
+ (set_attr "length" "8")])
+
+(define_insn "movstrsi_31"
+ [(set (mem:BLK (subreg:SI (match_operand:DI 0 "register_operand" "d") 0))
+ (mem:BLK (subreg:SI (match_operand:DI 1 "register_operand" "d") 0)))
+ (clobber (match_dup 0))
+ (clobber (match_dup 1))
+ (clobber (reg:CC 33))]
+ ""
+ "mvcle\\t%0,%1,0\;jo\\t.-4"
+ [(set_attr "op_type" "NN")
+ (set_attr "atype" "mem")
+ (set_attr "length" "8")])
+
+;
+; clrstrdi instruction pattern(s).
+;
+
+(define_expand "clrstrdi"
+ [(set (match_operand:BLK 0 "general_operand" "")
+ (const_int 0))
+ (use (match_operand:DI 1 "general_operand" ""))
+ (match_operand 2 "" "")]
+ "TARGET_64BIT"
+ "
+{
+ rtx addr = force_operand (XEXP (operands[0], 0), NULL_RTX);
+
+ operands[0] = change_address (operands[0], VOIDmode, addr);
+
+ if (GET_CODE (operands[1]) == CONST_INT && INTVAL (operands[1]) < 256)
+ {
+ emit_insn (gen_clrstrsico (operands[0], operands[1]));
+ DONE;
+ }
+ else
+ {
+ rtx reg0 = gen_reg_rtx (TImode);
+ rtx reg1 = gen_reg_rtx (TImode);
+ rtx len = operands[1];
+
+ if (! CONSTANT_P (len))
+ len = force_reg (DImode, len);
+
+ /* Load up the address+length pairs. */
+
+ emit_move_insn (gen_rtx_SUBREG (DImode, reg0, 0), addr);
+ emit_move_insn (gen_rtx_SUBREG (DImode, reg0, 1), len);
+
+ emit_move_insn (gen_rtx_SUBREG (DImode, reg1, 1), const0_rtx);
+
+ /* Clear! */
+ emit_insn (gen_clrstrsi_64 (reg0, reg1));
+ DONE;
+ }
+}")
+
+;
+; clrstrsi instruction pattern(s).
+;
+
+(define_expand "clrstrsi"
+ [(set (match_operand:BLK 0 "general_operand" "")
+ (const_int 0))
+ (use (match_operand:SI 1 "general_operand" ""))
+ (match_operand 2 "" "")]
+ "!TARGET_64BIT"
+ "
+{
+ rtx addr = force_operand (XEXP (operands[0], 0), NULL_RTX);
+
+ operands[0] = change_address (operands[0], VOIDmode, addr);
+
+ if (GET_CODE (operands[1]) == CONST_INT && INTVAL (operands[1]) < 256)
+ {
+ emit_insn (gen_clrstrsico (operands[0], operands[1]));
+ DONE;
+ }
+ else
+ {
+ rtx reg0 = gen_reg_rtx (DImode);
+ rtx reg1 = gen_reg_rtx (DImode);
+ rtx len = operands[1];
+
+ if (! CONSTANT_P (len))
+ len = force_reg (SImode, len);
+
+ /* Load up the address+length pairs. */
+
+ emit_move_insn (gen_rtx_SUBREG (SImode, reg0, 0), addr);
+ emit_move_insn (gen_rtx_SUBREG (SImode, reg0, 1), len);
+
+ emit_move_insn (gen_rtx_SUBREG (SImode, reg1, 1), const0_rtx);
+
+ /* CLear! */
+ emit_insn (gen_clrstrsi_31 (reg0, reg1));
+ DONE;
+ }
+}")
+
+; Clear memory with length less than 256 bytes
+
+(define_insn "clrstrsico"
+ [(set (match_operand:BLK 0 "s_operand" "=Qo")
+ (const_int 0))
+ (use (match_operand 1 "immediate_operand" "I"))
+ (clobber (reg:CC 33))]
+ ""
+ "xc\\t%O0(%1,%R0),%0"
+ [(set_attr "op_type" "RS")
+ (set_attr "atype" "mem")])
+
+; Clear memory with length greater 256 bytes or lenght not constant
+
+(define_insn "clrstrsi_64"
+ [(set (mem:BLK (subreg:DI (match_operand:TI 0 "register_operand" "d") 0))
+ (const_int 0))
+ (use (match_operand:TI 1 "register_operand" "d"))
+ (clobber (match_dup 0))
+ (clobber (match_dup 1))
+ (clobber (reg:CC 33))]
+ "TARGET_64BIT"
+ "mvcle\\t%0,%1,0\;jo\\t.-4"
+ [(set_attr "op_type" "NN")
+ (set_attr "atype" "mem")
+ (set_attr "cycle" "n")
+ (set_attr "length" "8")])
+
+(define_insn "clrstrsi_31"
+ [(set (mem:BLK (subreg:SI (match_operand:DI 0 "register_operand" "d") 0))
+ (const_int 0))
+ (use (match_operand:DI 1 "register_operand" "d"))
+ (clobber (match_dup 0))
+ (clobber (match_dup 1))
+ (clobber (reg:CC 33))]
+ "!TARGET_64BIT"
+ "mvcle\\t%0,%1,0\;jo\\t.-4"
+ [(set_attr "op_type" "NN")
+ (set_attr "atype" "mem")
+ (set_attr "cycle" "n")
+ (set_attr "length" "8")])
+
+;
+; cmpstrdi instruction pattern(s).
+;
+
+(define_expand "cmpstrdi"
+ [(set (match_operand:DI 0 "register_operand" "")
+ (compare:DI (match_operand:BLK 1 "s_operand" "")
+ (match_operand:BLK 2 "s_operand" "") ) )
+ (use (match_operand:DI 3 "general_operand" ""))
+ (use (match_operand:DI 4 "" ""))]
+ "TARGET_64BIT"
+ "
+{
+ rtx addr0, addr1;
+
+ /* for pre/post increment */
+ operands[1] = protect_from_queue (operands[1], 0);
+ operands[2] = protect_from_queue (operands[2], 0);
+ operands[3] = protect_from_queue (operands[3], 0);
+
+ addr0 = force_operand (XEXP (operands[1], 0), NULL_RTX);
+ addr1 = force_operand (XEXP (operands[2], 0), NULL_RTX);
+
+ if (GET_CODE (operands[3]) == CONST_INT && INTVAL (operands[3]) < 256)
+ {
+ if (INTVAL (operands[3]) == 0) {
+ emit_move_insn (operands[0], operands[3]);
+ DONE;
+ }
+
+ operands[1] = change_address (operands[1], VOIDmode, addr0);
+ operands[2] = change_address (operands[2], VOIDmode, addr1);
+
+ emit_insn (gen_cmpstr_const (operands[1], operands[2], operands[3]));
+ emit_insn (gen_cmpint_di (operands[0]));
+ DONE;
+ }
+ else
+ {
+ /* implementation suggested by Richard Henderson <rth@cygnus.com> */
+ rtx reg0 = gen_reg_rtx (TImode);
+ rtx reg1 = gen_reg_rtx (TImode);
+ rtx len = operands[3];
+
+ if (! CONSTANT_P (len))
+ len = force_reg (DImode, len);
+
+ /* Load up the address+length pairs. */
+ emit_move_insn (gen_rtx_SUBREG (DImode, reg0, 0), addr0);
+ emit_move_insn (gen_rtx_SUBREG (DImode, reg0, 1), len);
+
+ emit_move_insn (gen_rtx_SUBREG (DImode, reg1, 0), addr1);
+ emit_move_insn (gen_rtx_SUBREG (DImode, reg1, 1), len);
+
+ /* Compare! */
+ emit_insn (gen_cmpstr_64 (reg0, reg1));
+ emit_insn (gen_cmpint_di (operands[0]));
+ DONE;
+ }
+}")
+
+;
+; cmpstrsi instruction pattern(s).
+;
+
+(define_expand "cmpstrsi"
+ [(set (match_operand:SI 0 "register_operand" "")
+ (compare:SI (match_operand:BLK 1 "s_operand" "")
+ (match_operand:BLK 2 "s_operand" "") ) )
+ (use (match_operand:SI 3 "general_operand" ""))
+ (use (match_operand:SI 4 "" ""))]
+ ""
+ "
+{
+ rtx addr0, addr1;
+
+ /* for pre/post increment */
+ operands[1] = protect_from_queue (operands[1], 0);
+ operands[2] = protect_from_queue (operands[2], 0);
+ operands[3] = protect_from_queue (operands[3], 0);
+
+ addr0 = force_operand (XEXP (operands[1], 0), NULL_RTX);
+ addr1 = force_operand (XEXP (operands[2], 0), NULL_RTX);
+
+ if (GET_CODE (operands[3]) == CONST_INT && INTVAL (operands[3]) < 256)
+ {
+ if (INTVAL (operands[3]) == 0) {
+ emit_move_insn (operands[0], operands[3]);
+ DONE;
+ }
+
+ operands[1] = change_address (operands[1], VOIDmode, addr0);
+ operands[2] = change_address (operands[2], VOIDmode, addr1);
+
+ emit_insn (gen_cmpstr_const (operands[1], operands[2], operands[3]));
+ emit_insn (gen_cmpint_si (operands[0]));
+ DONE;
+ }
+ else
+ {
+ /* implementation suggested by Richard Henderson <rth@cygnus.com> */
+ rtx reg0, reg1;
+ rtx len = operands[3];
+
+ if (TARGET_64BIT)
+ {
+ reg0 = gen_reg_rtx (TImode);
+ reg1 = gen_reg_rtx (TImode);
+ }
+ else
+ {
+ reg0 = gen_reg_rtx (DImode);
+ reg1 = gen_reg_rtx (DImode);
+ }
+
+ if (! CONSTANT_P (len))
+ len = force_reg (Pmode, len);
+
+ /* Load up the address+length pairs. */
+ emit_move_insn (gen_rtx_SUBREG (Pmode, reg0, 0), addr0);
+ emit_move_insn (gen_rtx_SUBREG (Pmode, reg0, 1), len);
+
+ emit_move_insn (gen_rtx_SUBREG (Pmode, reg1, 0), addr1);
+ emit_move_insn (gen_rtx_SUBREG (Pmode, reg1, 1), len);
+
+ /* Compare! */
+ if (TARGET_64BIT)
+ emit_insn (gen_cmpstr_64 (reg0, reg1));
+ else
+ emit_insn (gen_cmpstr_31 (reg0, reg1));
+
+ emit_insn (gen_cmpint_si (operands[0]));
+ DONE;
+ }
+}")
+
+; Compare a block that is less than 256 bytes in length.
+
+(define_insn "cmpstr_const"
+ [(set (reg:CCU 33)
+ (compare:CCU (match_operand:BLK 0 "s_operand" "oQ")
+ (match_operand:BLK 1 "s_operand" "oQ")))
+ (use (match_operand 2 "immediate_operand" "I"))]
+ "(unsigned) INTVAL (operands[2]) < 256"
+ "clc\\t%O0(%c2,%R0),%1"
+ [(set_attr "op_type" "SS")
+ (set_attr "atype" "mem")
+ (set_attr "type" "xset")])
+
+; Compare a block that is larger than 255 bytes in length.
+
+(define_insn "cmpstr_64"
+ [(set (reg:CCU 33)
+ (compare:CCU (mem:BLK (subreg:DI (match_operand:TI 0 "register_operand" "d") 0))
+ (mem:BLK (subreg:DI (match_operand:TI 1 "register_operand" "d") 0))))
+ (clobber (subreg:DI (match_dup 0) 0))
+ (clobber (subreg:DI (match_dup 0) 1))
+ (clobber (subreg:DI (match_dup 1) 0))
+ (clobber (subreg:DI (match_dup 1) 1))]
+ "TARGET_64BIT"
+ "clcl\\t%0,%1"
+ [(set_attr "op_type" "RR")
+ (set_attr "atype" "mem")
+ (set_attr "type" "xset")])
+
+(define_insn "cmpstr_31"
+ [(set (reg:CCU 33)
+ (compare:CCU (mem:BLK (subreg:SI (match_operand:DI 0 "register_operand" "d") 0))
+ (mem:BLK (subreg:SI (match_operand:DI 1 "register_operand" "d") 0))))
+ (clobber (subreg:SI (match_dup 0) 0))
+ (clobber (subreg:SI (match_dup 0) 1))
+ (clobber (subreg:SI (match_dup 1) 0))
+ (clobber (subreg:SI (match_dup 1) 1))]
+ "!TARGET_64BIT"
+ "clcl\\t%0,%1"
+ [(set_attr "op_type" "RR")
+ (set_attr "atype" "mem")
+ (set_attr "type" "xset")])
+
+; Convert condition code to integer in range (-1, 0, 1)
+
+(define_insn "cmpint_si"
+ [(set (match_operand:SI 0 "register_operand" "=d")
+ (compare:SI (reg:CCU 33) (const_int 0)))]
+ ""
+ "*
+{
+ output_asm_insn (\"lhi\\t%0,1\", operands);
+ output_asm_insn (\"jh\\t.+12\", operands);
+ output_asm_insn (\"jl\\t.+6\", operands);
+ output_asm_insn (\"sr\\t%0,%0\", operands);
+ return \"lcr\\t%0,%0\";
+}"
+ [(set_attr "op_type" "NN")
+ (set_attr "length" "16")
+ (set_attr "atype" "reg")
+ (set_attr "type" "xset")])
+
+(define_insn "cmpint_di"
+ [(set (match_operand:DI 0 "register_operand" "=d")
+ (compare:DI (reg:CCU 33) (const_int 0)))]
+ "TARGET_64BIT"
+ "*
+{
+ output_asm_insn (\"lghi\\t%0,1\", operands);
+ output_asm_insn (\"jh\\t.+12\", operands);
+ output_asm_insn (\"jl\\t.+6\", operands);
+ output_asm_insn (\"sgr\\t%0,%0\", operands);
+ return \"lcgr\\t%0,%0\";
+}"
+ [(set_attr "op_type" "NN")
+ (set_attr "length" "22")
+ (set_attr "atype" "reg")
+ (set_attr "type" "xset")])
+
+;;
+;;- Conversion instructions.
+;;
+
+;
+; extendsidi2 instruction pattern(s).
+;
+
+(define_insn "extendsidi2"
+ [(set (match_operand:DI 0 "register_operand" "=d,d")
+ (sign_extend:DI (match_operand:SI 1 "nonimmediate_operand" "d,m")))]
+ "TARGET_64BIT"
+ "@
+ lgfr\\t%0,%1
+ lgf\\t%0,%1"
+ [(set_attr "op_type" "RRE,RXE")
+ (set_attr "atype" "reg,mem")
+ (set_attr "type" "set")])
+
+
+;
+; extendhidi2 instruction pattern(s).
+;
+
+(define_insn "extendhidi2"
+ [(set (match_operand:DI 0 "register_operand" "=d")
+ (sign_extend:DI (match_operand:HI 1 "register_operand" "d")))
+ (clobber (reg:CC 33))]
+ "TARGET_64BIT"
+ "sllg\\t%0,%1,48\;srag\\t%0,%0,48"
+ [(set_attr "op_type" "NN")
+ (set_attr "length" "12")
+ (set_attr "cycle" "2")
+ (set_attr "type" "set")])
+
+
+;
+; extendqidi2 instruction pattern(s).
+;
+
+(define_insn "extendqidi2"
+ [(set (match_operand:DI 0 "register_operand" "=d")
+ (sign_extend:DI (match_operand:QI 1 "register_operand" "d")))
+ (clobber (reg:CC 33))]
+ "TARGET_64BIT"
+ "sllg\\t%0,%1,56\;srag\\t%0,%0,56"
+ [(set_attr "op_type" "NN")
+ (set_attr "length" "12")
+ (set_attr "cycle" "2")
+ (set_attr "type" "set")])
+
+
+;
+; extendhisi2 instruction pattern(s).
+;
+
+(define_insn "extendhisi2"
+ [(set (match_operand:SI 0 "register_operand" "=d,!d,d")
+ (sign_extend:SI (match_operand:HI 1 "nonimmediate_operand" "0,d,m")))
+ (clobber (reg:CC 33))]
+ ""
+ "@
+ sll\\t%1,16\;sra\\t%1,16
+ lr\\t%0,%1\;sll\\t%0,16\;sra\\t%0,16
+ lh\\t%0,%1"
+ [(set_attr "op_type" "NN,NN,RX")
+ (set_attr "cycle" "2,3,1")
+ (set_attr "atype" "reg,reg,mem")
+ (set_attr "type" "set")
+ (set_attr "length" "8,10,*")])
+
+
+;
+; extendqisi2 instruction pattern(s).
+;
+
+(define_insn "extendqisi2"
+ [(set (match_operand:SI 0 "register_operand" "=d,d")
+ (sign_extend:SI (match_operand:QI 1 "r_or_s_operand" "0,Q")))
+ (clobber (reg:CC 33))]
+ ""
+ "@
+ sll\\t%0,24\;sra\\t%0,24
+ icm\\t%0,8,%1\;sra\\t%0,24"
+ [(set_attr "op_type" "NN,NN")
+ (set_attr "cycle" "2")
+ (set_attr "atype" "reg,mem")
+ (set_attr "type" "set")
+ (set_attr "length" "8,8")])
+
+
+;
+; extendqihi2 instruction pattern(s).
+;
+
+(define_insn "extendqihi2"
+ [(set (match_operand:HI 0 "register_operand" "=d,d")
+ (sign_extend:HI (match_operand:QI 1 "r_or_s_operand" "0,Q")))
+ (clobber (reg:CC 33))]
+ ""
+ "@
+ sll\\t%0,24\;sra\\t%0,24
+ icm\\t%0,8,%1\;sra\\t%0,24"
+ [(set_attr "op_type" "NN,NN")
+ (set_attr "cycle" "2")
+ (set_attr "atype" "reg,mem")
+ (set_attr "type" "set")
+ (set_attr "length" "8,8")])
+
+
+;
+; zero_extendsidi2 instruction pattern(s).
+;
+
+(define_insn "zero_extendsidi2"
+ [(set (match_operand:DI 0 "register_operand" "=d,d")
+ (zero_extend:DI (match_operand:SI 1 "nonimmediate_operand" "d,m")))]
+ "TARGET_64BIT"
+ "@
+ llgfr\\t%0,%1
+ llgf\\t%0,%1"
+ [(set_attr "op_type" "RRE,RXE")
+ (set_attr "atype" "reg,mem")
+ (set_attr "type" "set")])
+
+
+;
+; zero_extendhidi2 instruction pattern(s).
+;
+
+(define_insn "zero_extendhidi2"
+ [(set (match_operand:DI 0 "register_operand" "=!d,d")
+ (zero_extend:DI (match_operand:HI 1 "nonimmediate_operand" "d,m")))]
+ "TARGET_64BIT"
+ "@
+ llgfr\\t%0,%1\;iilh\\t%0,0
+ llgh\\t%0,%1"
+ [(set_attr "op_type" "NN,RXE")
+ (set_attr "cycle" "2,1")
+ (set_attr "atype" "reg,mem")
+ (set_attr "length" "12,*")
+ (set_attr "type" "set")])
+
+
+;
+; zero_extendqidi2 instruction pattern(s)
+;
+
+(define_insn "zero_extendqidi2"
+ [(set (match_operand:DI 0 "register_operand" "=!d,d")
+ (zero_extend:DI (match_operand:QI 1 "nonimmediate_operand" "d,m")))
+ (clobber (reg:CC 33))]
+ "TARGET_64BIT"
+ "@
+ sllg\\t%0,%1,56\;srlg\\t%0,%0,56
+ llgc\\t%0,%1"
+ [(set_attr "op_type" "NN,RXE")
+ (set_attr "cycle" "2,1")
+ (set_attr "atype" "reg,mem")
+ (set_attr "type" "set")
+ (set_attr "length" "12,*")])
+
+
+;
+; zero_extendhisi2 instruction pattern(s).
+;
+
+(define_expand "zero_extendhisi2"
+ [(set (match_operand:SI 0 "register_operand" "")
+ (zero_extend:SI (match_operand:HI 1 "r_or_s_operand" "")))]
+ ""
+ "
+{
+ if (!TARGET_64BIT)
+ {
+ emit_insn (gen_zero_extendhisi2_31 (operands[0], operands[1],
+ force_const_mem (SImode, const0_rtx)));
+ DONE;
+ }
+}")
+
+(define_insn "*zero_extendhisi2_64"
+ [(set (match_operand:SI 0 "register_operand" "=d,d")
+ (zero_extend:SI (match_operand:HI 1 "nonimmediate_operand" "0,m")))]
+ "TARGET_64BIT"
+ "@
+ iilh\\t%0,0
+ llgh\\t%0,%1"
+ [(set_attr "op_type" "RI,RXE")
+ (set_attr "atype" "reg,mem")])
+
+(define_insn "zero_extendhisi2_31"
+ [(set (match_operand:SI 0 "register_operand" "=d,d")
+ (zero_extend:SI (match_operand:HI 1 "r_or_s_operand" "0,Q")))
+ (use (match_operand:SI 2 "memory_operand" "m,m"))
+ (clobber (reg:CC 33))]
+ ""
+ "@
+ icm\\t%0,12,%2
+ icm\\t%0,12,%1\;srl\\t%0,16"
+ [(set_attr "op_type" "RX,NN")
+ (set_attr "cycle" "1,2")
+ (set_attr "atype" "reg,mem")
+ (set_attr "type" "set")
+ (set_attr "length" "*,8")])
+
+
+;
+; zero_extendqisi2 instruction pattern(s).
+;
+
+(define_insn "*zero_extendqisi2_mem_31"
+ [(set (match_operand:SI 0 "register_operand" "=&d")
+ (zero_extend:SI (match_operand:QI 1 "memory_operand" "m")))
+ (use (match_operand:SI 2 "memory_operand" "m" ))
+ (clobber (reg:CC 33))]
+ ""
+ "sr\\t%0,%0\;ic\\t%0,%1"
+ [(set_attr "op_type" "NN")
+ (set_attr "cycle" "2")
+ (set_attr "atype" "mem")
+ (set_attr "type" "set")
+ (set_attr "length" "6")])
+
+(define_insn "zero_extendqisi2_reg_31"
+ [(set (match_operand:SI 0 "register_operand" "=d")
+ (zero_extend:SI (match_operand:QI 1 "register_operand" "0")))
+ (use (match_operand:SI 2 "memory_operand" "m" ))
+ (clobber (reg:CC 33))]
+ ""
+ "icm\\t%0,14,%2"
+ [(set_attr "op_type" "RX")
+ (set_attr "atype" "mem")
+ (set_attr "type" "set")])
+
+(define_insn "*zero_extendqisi2_64"
+ [(set (match_operand:SI 0 "register_operand" "=!d,d")
+ (zero_extend:SI (match_operand:QI 1 "nonimmediate_operand" "d,m")))]
+ "TARGET_64BIT"
+ "@
+ sllg\\t%0,%1,56\;srlg\\t%0,%0,56
+ llgc\\t%0,%1"
+ [(set_attr "op_type" "NN,RXE")
+ (set_attr "cycle" "2,1")
+ (set_attr "atype" "reg,mem")
+ (set_attr "length" "12,*")])
+
+(define_expand "zero_extendqisi2"
+ [(set (match_operand:SI 0 "register_operand" "")
+ (zero_extend:SI (match_operand:QI 1 "r_or_s_operand" "")))]
+ ""
+ "
+{
+ if (!TARGET_64BIT)
+ {
+ emit_insn (gen_zero_extendqisi2_reg_31 (operands[0], operands[1],
+ force_const_mem (SImode, const0_rtx)));
+ DONE;
+ }
+}")
+
+
+;
+; zero_extendqihi2 instruction pattern(s).
+;
+
+(define_insn "zero_extendqihi2_64"
+ [(set (match_operand:HI 0 "register_operand" "=d,d")
+ (zero_extend:HI (match_operand:QI 1 "nonimmediate_operand" "0,m")))
+ (clobber (reg:CC 33))]
+ "TARGET_64BIT"
+ "@
+ nill\\t%0,0x00FF
+ llgc\\t%0,%1"
+ [(set_attr "op_type" "RI,RXE")
+ (set_attr "atype" "reg,mem")])
+
+(define_insn "zero_extendqihi2_31"
+ [(set (match_operand:HI 0 "register_operand" "=d,&d")
+ (zero_extend:HI (match_operand:QI 1 "nonimmediate_operand" "0,m")))
+ (use (match_operand:SI 2 "memory_operand" "m,m"))
+ (clobber (reg:CC 33))]
+ ""
+ "@
+ icm\\t%0,14,%2
+ sr\\t%0,%0\;ic\\t%0,%1"
+ [(set_attr "op_type" "RX,NN")
+ (set_attr "atype" "reg,mem")
+ (set_attr "length" "*,8")])
+
+(define_expand "zero_extendqihi2"
+ [(set (match_operand:HI 0 "register_operand" "")
+ (zero_extend:HI (match_operand:QI 1 "general_operand" "")))]
+ ""
+ "
+{
+ if (!TARGET_64BIT)
+ {
+ emit_insn (gen_zero_extendqihi2_31 (operands[0], operands[1],
+ force_const_mem (SImode, const0_rtx)));
+ DONE;
+ }
+ else
+ {
+ emit_insn (gen_zero_extendqihi2_64 (operands[0], operands[1]));
+ DONE;
+ }
+}")
+
+
+;
+; truncdisi2 instruction pattern(s).
+;
+
+(define_insn "truncdisi2"
+ [(set (match_operand:SI 0 "register_operand" "=d")
+ (truncate:SI (match_operand:DI 1 "register_operand" "d")))]
+ "TARGET_64BIT"
+ "llgfr\\t%0,%1"
+ [(set_attr "op_type" "RRE")])
+
+
+;
+; truncdihi2 instruction pattern(s).
+;
+
+(define_insn "truncdihi2"
+ [(set (match_operand:HI 0 "register_operand" "=d")
+ (truncate:HI (match_operand:DI 1 "register_operand" "d")))]
+ "TARGET_64BIT"
+ "llgfr\\t%0,%1\;iilh\\t%0,0"
+ [(set_attr "op_type" "NN")
+ (set_attr "length" "10")])
+
+
+;
+; truncdiqi2 instruction pattern(s).
+;
+
+(define_insn "truncdiqi2"
+ [(set (match_operand:QI 0 "register_operand" "=d")
+ (truncate:QI (match_operand:DI 1 "register_operand" "d")))
+ (clobber (reg:CC 33))]
+ "TARGET_64BIT"
+ "sllg\\t%0,%1,56\;srlg\\t%0,%0,56"
+ [(set_attr "op_type" "NN")
+ (set_attr "cycle" "2")
+ (set_attr "length" "12")])
+
+
+;
+; truncsihi2 instruction pattern(s).
+;
+
+(define_expand "truncsihi2"
+ [(set (match_operand:HI 0 "register_operand" "")
+ (truncate:HI (match_operand:SI 1 "register_operand" "")))]
+ ""
+ "
+{
+ if (!TARGET_64BIT)
+ {
+ emit_insn (gen_do_truncsihi2 (operands[0], operands[1],
+ force_const_mem (SImode, const0_rtx)));
+ DONE;
+ }
+}")
+
+
+(define_insn "do_truncsihi2"
+ [(set (match_operand:HI 0 "register_operand" "=d")
+ (truncate:HI (match_operand:SI 1 "register_operand" "0")))
+ (use (match_operand:SI 2 "memory_operand" "m"))
+ (clobber (reg:CC 33))]
+ ""
+ "icm\\t%0,12,%2"
+ [(set_attr "op_type" "RX")])
+
+(define_insn "*truncsihi2_64"
+ [(set (match_operand:HI 0 "register_operand" "=d")
+ (truncate:HI (match_operand:SI 1 "register_operand" "0")))]
+ "TARGET_64BIT"
+ "iilh\\t%0,0"
+ [(set_attr "op_type" "RI")])
+
+
+;
+; truncsiqi2 instruction pattern(s).
+;
+
+(define_insn "truncsiqi2"
+ [(set (match_operand:QI 0 "register_operand" "=d")
+ (truncate:QI (match_operand:SI 1 "register_operand" "0")))
+ (clobber (reg:CC 33))]
+ "TARGET_64BIT"
+ "iilh\\t%0,0\;nill\\t%0,0x00FF"
+ [(set_attr "op_type" "NN")
+ (set_attr "cycle" "2")
+ (set_attr "length" "8")])
+
+
+;
+; trunchiqi2 instruction pattern(s).
+;
+
+(define_insn "trunchiqi2"
+ [(set (match_operand:QI 0 "register_operand" "=d")
+ (truncate:QI (match_operand:HI 1 "register_operand" "0")))
+ (clobber (reg:CC 33))]
+ "TARGET_64BIT"
+ "nill\\t%0,0x00FF"
+ [(set_attr "op_type" "RI")])
+
+
+;
+; fixuns_truncdfdi2 and fix_truncdfsi2 instruction pattern(s).
+;
+
+(define_expand "fixuns_truncdfdi2"
+ [(set (match_operand:DI 0 "register_operand" "")
+ (unsigned_fix:DI (match_operand:DF 1 "register_operand" "")))]
+ "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
+ "
+{
+ rtx label1 = gen_label_rtx ();
+ rtx label2 = gen_label_rtx ();
+ rtx temp = gen_reg_rtx (DFmode);
+ operands[1] = force_reg (DFmode, operands[1]);
+
+ emit_insn (gen_cmpdf (operands[1], force_const_mem (DFmode,
+ CONST_DOUBLE_FROM_REAL_VALUE (0x8000000000000000ULL, DFmode))));
+ emit_jump_insn (gen_blt (label1));
+
+ emit_insn (gen_subdf3 (temp, operands[1], force_const_mem (DFmode,
+ CONST_DOUBLE_FROM_REAL_VALUE (0x10000000000000000ULL, DFmode))));
+ emit_insn (gen_fix_truncdfdi2_ieee (operands[0], temp, GEN_INT(7)));
+ emit_jump_insn (gen_jump (label2));
+
+ emit_label (label1);
+ emit_insn (gen_fix_truncdfdi2_ieee (operands[0], operands[1], GEN_INT(5)));
+ emit_label (label2);
+ DONE;
+}")
+
+(define_expand "fix_truncdfdi2"
+ [(set (match_operand:DI 0 "register_operand" "")
+ (fix:DI (match_operand:DF 1 "nonimmediate_operand" "")))]
+ "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
+ "
+{
+ operands[1] = force_reg (DFmode, operands[1]);
+ emit_insn (gen_fix_truncdfdi2_ieee (operands[0], operands[1], GEN_INT(5)));
+ DONE;
+}")
+
+(define_insn "fix_truncdfdi2_ieee"
+ [(set (match_operand:DI 0 "register_operand" "=d")
+ (fix:DI (match_operand:DF 1 "register_operand" "f")))
+ (unspec:DI [(match_operand:DI 2 "immediate_operand" "K")] 1)
+ (clobber (reg:CC 33))]
+ "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
+ "cgdbr\\t%0,%h2,%1"
+ [(set_attr "op_type" "RRE")
+ (set_attr "cycle" "n")])
+
+;
+; fixuns_truncdfsi2 and fix_truncdfsi2 instruction pattern(s).
+;
+
+(define_expand "fixuns_truncdfsi2"
+ [(set (match_operand:SI 0 "register_operand" "")
+ (unsigned_fix:SI (match_operand:DF 1 "register_operand" "")))]
+ "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
+ "
+{
+ rtx label1 = gen_label_rtx ();
+ rtx label2 = gen_label_rtx ();
+ rtx temp = gen_reg_rtx (DFmode);
+
+ operands[1] = force_reg (DFmode,operands[1]);
+ emit_insn (gen_cmpdf (operands[1], force_const_mem (DFmode,
+ CONST_DOUBLE_FROM_REAL_VALUE (0x80000000, DFmode))));
+ emit_jump_insn (gen_blt (label1));
+ emit_insn (gen_subdf3 (temp, operands[1], force_const_mem (DFmode,
+ CONST_DOUBLE_FROM_REAL_VALUE (0x100000000ULL, DFmode))));
+ emit_insn (gen_fix_truncdfsi2_ieee (operands[0], temp, GEN_INT (7)));
+ emit_jump_insn (gen_jump (label2));
+
+ emit_label (label1);
+ emit_insn (gen_fix_truncdfsi2_ieee (operands[0], operands[1], GEN_INT (5)));
+ emit_label (label2);
+ DONE;
+}")
+
+(define_expand "fix_truncdfsi2"
+ [(set (match_operand:SI 0 "register_operand" "")
+ (fix:SI (match_operand:DF 1 "nonimmediate_operand" "")))]
+ "TARGET_HARD_FLOAT"
+ "
+{
+ if (TARGET_IBM_FLOAT)
+ {
+ /* This is the algorithm from POP chapter A.5.7.2. */
+
+ rtx temp = assign_stack_local (BLKmode, 2 * UNITS_PER_WORD, BITS_PER_WORD);
+ rtx two31r = force_const_mem (DFmode,
+ gen_rtx (CONST_DOUBLE, VOIDmode, cc0_rtx,
+ 0x08000000, 0x4F000000));
+ rtx two32 = force_const_mem (DFmode,
+ gen_rtx (CONST_DOUBLE, VOIDmode, cc0_rtx,
+ 0x0, 0x4E000001));
+
+ operands[1] = force_reg (DFmode, operands[1]);
+ emit_insn (gen_fix_truncdfsi2_ibm (operands[0], operands[1],
+ two31r, two32, temp));
+ }
+ else
+ {
+ operands[1] = force_reg (DFmode, operands[1]);
+ emit_insn (gen_fix_truncdfsi2_ieee (operands[0], operands[1], GEN_INT (5)));
+ }
+
+ DONE;
+}")
+
+(define_insn "fix_truncdfsi2_ieee"
+ [(set (match_operand:SI 0 "register_operand" "=d")
+ (fix:SI (match_operand:DF 1 "register_operand" "f")))
+ (unspec:SI [(match_operand:SI 2 "immediate_operand" "K")] 1)
+ (clobber (reg:CC 33))]
+ "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
+ "cfdbr\\t%0,%h2,%1"
+ [(set_attr "op_type" "RRE")
+ (set_attr "cycle" "n" )])
+
+(define_insn "fix_truncdfsi2_ibm"
+ [(set (match_operand:SI 0 "register_operand" "=d")
+ (fix:SI (match_operand:DF 1 "nonimmediate_operand" "+f")))
+ (use (match_operand:DF 2 "memory_operand" "m"))
+ (use (match_operand:DF 3 "memory_operand" "m"))
+ (use (match_operand:BLK 4 "memory_operand" "m"))
+ (clobber (reg:CC 33))]
+ "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
+ "*
+{
+ output_asm_insn (\"sd\\t%1,%2\", operands);
+ output_asm_insn (\"aw\\t%1,%3\", operands);
+ output_asm_insn (\"std\\t%1,%4\", operands);
+ output_asm_insn (\"xi\\t%N4,128\", operands);
+ return \"l\\t%0,%N4\";
+}"
+ [(set_attr "op_type" "NN")
+ (set_attr "cycle" "n")
+ (set_attr "length" "20")])
+
+;
+; fixuns_truncsfdi2 and fix_truncsfdi2 instruction pattern(s).
+;
+
+(define_expand "fixuns_truncsfdi2"
+ [(set (match_operand:DI 0 "register_operand" "")
+ (unsigned_fix:DI (match_operand:SF 1 "register_operand" "")))]
+ "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
+ "
+{
+ rtx label1 = gen_label_rtx ();
+ rtx label2 = gen_label_rtx ();
+ rtx temp = gen_reg_rtx (SFmode);
+
+ operands[1] = force_reg (SFmode, operands[1]);
+ emit_insn (gen_cmpsf (operands[1], force_const_mem (SFmode,
+ CONST_DOUBLE_FROM_REAL_VALUE (0x8000000000000000ULL, SFmode))));
+ emit_jump_insn (gen_blt (label1));
+
+ emit_insn (gen_subsf3 (temp, operands[1], force_const_mem (SFmode,
+ CONST_DOUBLE_FROM_REAL_VALUE (0x10000000000000000ULL, SFmode))));
+ emit_insn (gen_fix_truncsfdi2_ieee (operands[0], temp, GEN_INT(7)));
+ emit_jump_insn (gen_jump (label2));
+
+ emit_label (label1);
+ emit_insn (gen_fix_truncsfdi2_ieee (operands[0], operands[1], GEN_INT(5)));
+ emit_label (label2);
+ DONE;
+}")
+
+(define_expand "fix_truncsfdi2"
+ [(set (match_operand:DI 0 "register_operand" "")
+ (fix:DI (match_operand:SF 1 "nonimmediate_operand" "")))]
+ "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
+ "
+{
+ operands[1] = force_reg (SFmode, operands[1]);
+ emit_insn (gen_fix_truncsfdi2_ieee (operands[0], operands[1], GEN_INT(5)));
+ DONE;
+}")
+
+(define_insn "fix_truncsfdi2_ieee"
+ [(set (match_operand:DI 0 "register_operand" "=d")
+ (fix:DI (match_operand:SF 1 "register_operand" "f")))
+ (unspec:DI [(match_operand:DI 2 "immediate_operand" "K")] 1)
+ (clobber (reg:CC 33))]
+ "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
+ "cgebr\\t%0,%h2,%1"
+ [(set_attr "op_type" "RRE")
+ (set_attr "cycle" "n")])
+
+;
+; fixuns_truncsfsi2 and fix_truncsfsi2 instruction pattern(s).
+;
+
+(define_expand "fixuns_truncsfsi2"
+ [(set (match_operand:SI 0 "register_operand" "")
+ (unsigned_fix:SI (match_operand:SF 1 "register_operand" "")))]
+ "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
+ "
+{
+ rtx label1 = gen_label_rtx ();
+ rtx label2 = gen_label_rtx ();
+ rtx temp = gen_reg_rtx (SFmode);
+
+ operands[1] = force_reg (SFmode, operands[1]);
+ emit_insn (gen_cmpsf (operands[1], force_const_mem (SFmode,
+ CONST_DOUBLE_FROM_REAL_VALUE (0x80000000, SFmode))));
+ emit_jump_insn (gen_blt (label1));
+ emit_insn (gen_subsf3 (temp, operands[1], force_const_mem (SFmode,
+ CONST_DOUBLE_FROM_REAL_VALUE (0x100000000ULL, SFmode))));
+ emit_insn (gen_fix_truncsfsi2_ieee (operands[0], temp, GEN_INT (7)));
+ emit_jump_insn (gen_jump (label2));
+
+ emit_label (label1);
+ emit_insn (gen_fix_truncsfsi2_ieee (operands[0], operands[1], GEN_INT (5)));
+ emit_label (label2);
+ DONE;
+}")
+
+(define_expand "fix_truncsfsi2"
+ [(set (match_operand:SI 0 "register_operand" "")
+ (fix:SI (match_operand:SF 1 "nonimmediate_operand" "")))]
+ "TARGET_HARD_FLOAT"
+ "
+{
+ if (TARGET_IBM_FLOAT)
+ {
+ /* Convert to DFmode and then use the POP algorithm. */
+ rtx temp = gen_reg_rtx (DFmode);
+ emit_insn (gen_extendsfdf2 (temp, operands[1]));
+ emit_insn (gen_fix_truncdfsi2 (operands[0], temp));
+ }
+ else
+ {
+ operands[1] = force_reg (SFmode, operands[1]);
+ emit_insn (gen_fix_truncsfsi2_ieee (operands[0], operands[1], GEN_INT (5)));
+ }
+
+ DONE;
+}")
+
+(define_insn "fix_truncsfsi2_ieee"
+ [(set (match_operand:SI 0 "register_operand" "=d")
+ (fix:SI (match_operand:SF 1 "register_operand" "f")))
+ (unspec:SI [(match_operand:SI 2 "immediate_operand" "K")] 1)
+ (clobber (reg:CC 33))]
+ "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
+ "cfebr\\t%0,%h2,%1"
+ [(set_attr "op_type" "RRE")
+ (set_attr "cycle" "n")])
+
+;
+; floatdidf2 instruction pattern(s).
+;
+
+(define_insn "floatdidf2"
+ [(set (match_operand:DF 0 "register_operand" "=f")
+ (float:DF (match_operand:DI 1 "register_operand" "d")))]
+ "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
+ "cdgbr\\t%0,%1"
+ [(set_attr "op_type" "RRE")
+ (set_attr "cycle" "n" )])
+
+;
+; floatdisf2 instruction pattern(s).
+;
+
+(define_insn "floatdisf2"
+ [(set (match_operand:SF 0 "register_operand" "=f")
+ (float:SF (match_operand:DI 1 "register_operand" "d")))]
+ "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
+ "cegbr\\t%0,%1"
+ [(set_attr "op_type" "RRE")
+ (set_attr "cycle" "n" )])
+
+;
+; floatsidf2 instruction pattern(s).
+;
+
+(define_expand "floatsidf2"
+ [(set (match_operand:DF 0 "register_operand" "")
+ (float:DF (match_operand:SI 1 "register_operand" "")))]
+ "TARGET_HARD_FLOAT"
+ "
+{
+ if (TARGET_IBM_FLOAT)
+ {
+ /* This is the algorithm from POP chapter A.5.7.1. */
+
+ rtx temp = assign_stack_local (BLKmode, 2 * UNITS_PER_WORD, BITS_PER_WORD);
+ rtx two31 = force_const_mem (DFmode,
+ gen_rtx (CONST_DOUBLE, VOIDmode, cc0_rtx,
+ 0x80000000, 0x4E000000));
+
+ emit_insn (gen_floatsidf2_ibm (operands[0], operands[1], two31, temp));
+ DONE;
+ }
+}")
+
+(define_insn "floatsidf2_ieee"
+ [(set (match_operand:DF 0 "register_operand" "=f")
+ (float:DF (match_operand:SI 1 "register_operand" "d")))]
+ "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
+ "cdfbr\\t%0,%1"
+ [(set_attr "op_type" "RRE")
+ (set_attr "cycle" "n" )])
+
+(define_insn "floatsidf2_ibm"
+ [(set (match_operand:DF 0 "register_operand" "=f")
+ (float:DF (match_operand:SI 1 "register_operand" "d")))
+ (use (match_operand:DF 2 "memory_operand" "m"))
+ (use (match_operand:BLK 3 "memory_operand" "m"))
+ (clobber (reg:CC 33))]
+ "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
+ "*
+{
+ output_asm_insn (\"st\\t%0,%N3\", operands);
+ output_asm_insn (\"xi\\t%N3,128\", operands);
+ output_asm_insn (\"mvc\\t%O3(4,%R3),%2\", operands);
+ output_asm_insn (\"ld\\t%0,%3\", operands);
+ return \"sd\\t%0,%2\";
+}"
+ [(set_attr "op_type" "NN")
+ (set_attr "cycle" "n" )
+ (set_attr "length" "20")])
+
+;
+; floatsisf2 instruction pattern(s).
+;
+
+(define_expand "floatsisf2"
+ [(set (match_operand:SF 0 "register_operand" "")
+ (float:SF (match_operand:SI 1 "register_operand" "")))]
+ "TARGET_HARD_FLOAT"
+ "
+{
+ if (TARGET_IBM_FLOAT)
+ {
+ /* Use the POP algorithm to convert to DFmode and then truncate. */
+ rtx temp = gen_reg_rtx (DFmode);
+ emit_insn (gen_floatsidf2 (temp, operands[1]));
+ emit_insn (gen_truncdfsf2 (operands[0], temp));
+ DONE;
+ }
+}")
+
+(define_insn "floatsisf2_ieee"
+ [(set (match_operand:SF 0 "register_operand" "=f")
+ (float:SF (match_operand:SI 1 "register_operand" "d")))]
+ "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
+ "cefbr\\t%0,%1"
+ [(set_attr "op_type" "RRE")
+ (set_attr "cycle" "n" )])
+
+;
+; truncdfsf2 instruction pattern(s).
+;
+
+(define_expand "truncdfsf2"
+ [(set (match_operand:SF 0 "register_operand" "")
+ (float_truncate:SF (match_operand:DF 1 "general_operand" "")))]
+ "TARGET_HARD_FLOAT"
+ "
+{
+ if (CONSTANT_P(operands[1]))
+ operands[1] = force_const_mem (DFmode, operands[1]);
+}")
+
+(define_insn "truncdfsf2_ieee"
+ [(set (match_operand:SF 0 "register_operand" "=f")
+ (float_truncate:SF (match_operand:DF 1 "nonimmediate_operand" "f")))]
+ "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
+ "ledbr\\t%0,%1"
+ [(set_attr "op_type" "RR")])
+
+(define_insn "truncdfsf2_ibm"
+ [(set (match_operand:SF 0 "register_operand" "=f,f")
+ (float_truncate:SF (match_operand:DF 1 "nonimmediate_operand" "f,m")))]
+ "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
+ "@
+ lrer\\t%0,%1
+ le\\t%0,%1"
+ [(set_attr "op_type" "RR,RX")])
+
+;
+; extendsfdf2 instruction pattern(s).
+;
+
+(define_expand "extendsfdf2"
+ [(set (match_operand:DF 0 "register_operand" "")
+ (float_extend:DF (match_operand:SF 1 "nonimmediate_operand" "")))]
+ "TARGET_HARD_FLOAT"
+ "
+{
+ if (TARGET_IBM_FLOAT)
+ {
+ emit_insn (gen_extendsfdf2_ibm (operands[0], operands[1]));
+ DONE;
+ }
+}")
+
+(define_insn "extendsfdf2_ieee"
+ [(set (match_operand:DF 0 "register_operand" "=f,f")
+ (float_extend:DF (match_operand:SF 1 "nonimmediate_operand" "f,m")))]
+ "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
+ "@
+ ldebr\\t%0,%1
+ ldeb\\t%0,%1"
+ [(set_attr "op_type" "RRE,RXE")])
+
+(define_insn "extendsfdf2_ibm"
+ [(set (match_operand:DF 0 "register_operand" "=f,f")
+ (float_extend:DF (match_operand:SF 1 "nonimmediate_operand" "f,m")))
+ (clobber (reg:CC 33))]
+ "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
+ "@
+ sdr\\t%0,%0\;ler\\t%0,%1
+ sdr\\t%0,%0\;le\\t%0,%1"
+ [(set_attr "op_type" "RRE,RXE")])
+
+
+;;
+;; ARITHMETRIC OPERATIONS
+;;
+; arithmetric operations set the ConditionCode,
+; because of unpredictable Bits in Register for Halfword and Byte
+; the ConditionCode can be set wrong in operations for Halfword and Byte
+
+;;
+;;- Add instructions.
+;;
+
+;
+; adddi3 instruction pattern(s).
+;
+
+(define_insn "addaddr_esame"
+ [(set (match_operand:DI 0 "register_operand" "=a,a")
+ (plus:DI (match_operand:DI 1 "register_operand" "%a,a")
+ (match_operand:DI 2 "nonmemory_operand" "J,a")))]
+ "TARGET_64BIT && (((REGNO (operands[1]) == STACK_POINTER_REGNUM ) ||
+ (REGNO (operands[1]) == BASE_REGISTER)) &&
+ (GET_CODE (operands[2]) == REG ||
+ CONST_OK_FOR_LETTER_P (INTVAL (operands[2]),'J')))"
+ "@
+ la\\t%0,%c2(,%1)
+ la\\t%0,0(%1,%2)"
+ [(set_attr "op_type" "RX")
+ (set_attr "atype" "mem")
+ (set_attr "type" "la")])
+
+(define_insn "adddi3_64"
+ [(set (match_operand:DI 0 "register_operand" "=d,d,d")
+ (plus:DI (match_operand:DI 1 "register_operand" "%0,0,0")
+ (match_operand:DI 2 "general_operand" "d,K,m") ) )
+ (clobber (reg:CC 33))]
+ "TARGET_64BIT"
+ "@
+ agr\\t%0,%2
+ aghi\\t%0,%h2
+ ag\\t%0,%2"
+ [(set_attr "op_type" "RRE,RI,RXE")
+ (set_attr "atype" "reg,reg,mem")
+ (set_attr "type" "set")])
+
+;
+; For weakness of reload, need (set (reg x) (plus (reg y) (reg x)))
+;
+
+(define_insn "adddi3_inv_64"
+ [(set (match_operand:DI 0 "register_operand" "=d,d,d")
+ (plus:DI (match_operand:DI 1 "general_operand" "%d,K,m")
+ (match_operand:DI 2 "register_operand" "0,0,0") ) )
+ (clobber (reg:CC 33))]
+ "TARGET_64BIT"
+ "@
+ agr\\t%0,%1
+ aghi\\t%0,%h1
+ ag\\t%0,%1"
+ [(set_attr "op_type" "RRE,RI,RXE")
+ (set_attr "atype" "reg,reg,mem")
+ (set_attr "type" "set")])
+
+(define_insn "adddi3_31"
+ [(set (match_operand:DI 0 "register_operand" "=d,d")
+ (plus:DI (match_operand:DI 1 "register_operand" "0,0")
+ (match_operand:DI 2 "general_operand" "d,m") ) )
+ (clobber (reg:CC 33))]
+ "!TARGET_64BIT"
+ "*
+{
+ switch(which_alternative)
+ {
+ case 0: /* d <- d */
+ output_asm_insn (\"ar\\t%0,%2\", operands);
+ output_asm_insn (\"alr\\t%N0,%N2\", operands);
+ break;
+
+ case 1: /* d <- m */
+ output_asm_insn (\"a\\t%0,%2\", operands);
+ output_asm_insn (\"al\\t%N0,%N2\", operands);
+ break;
+ }
+
+ output_asm_insn (\"brc\\t12,.+8\", operands);
+ return \"ahi\\t%0,1\";
+}"
+ [(set_attr "op_type" "NN,NN")
+ (set_attr "atype" "reg,mem")
+ (set_attr "length" "12,16")])
+
+(define_expand "adddi3"
+ [(set (match_operand:DI 0 "register_operand" "")
+ (plus:DI (match_operand:DI 1 "register_operand" "")
+ (match_operand:DI 2 "general_operand" "")))]
+ ""
+ "
+{
+ if (TARGET_64BIT)
+ emit_insn(gen_adddi3_64 (operands[0],operands[1],operands[2]));
+ else
+ emit_insn(gen_adddi3_31 (operands[0],operands[1],operands[2]));
+ DONE;
+}")
+
+(define_insn "reload_load_address"
+ [(set (match_operand:DI 0 "register_operand" "=a")
+ (match_operand:QI 1 "address_operand" "p"))]
+ "TARGET_64BIT"
+ "la\\t%0,%a1"
+ [(set_attr "op_type" "RX")
+ (set_attr "atype" "mem")
+ (set_attr "type" "la")])
+
+(define_insn "*reload_load_address_reg_0"
+ [(set (match_operand:DI 0 "register_operand" "=d")
+ (plus:DI (match_operand:DI 1 "register_operand" "%0")
+ (match_operand:DI 2 "register_operand" "d")))]
+ "TARGET_64BIT"
+ "brxlg\\t%0,%2,.+6"
+ [(set_attr "op_type" "RIE")
+ (set_attr "atype" "reg")
+ (set_attr "type" "set")])
+
+(define_insn "*reload_la_64"
+ [(set (match_operand:DI 0 "register_operand" "=d")
+ (plus:DI (match_operand:DI 1 "general_operand" "g")
+ (match_operand:DI 2 "general_operand" "g")))]
+ "TARGET_64BIT && reload_in_progress"
+ "#")
+
+(define_split
+ [(set (match_operand:DI 0 "register_operand" "")
+ (plus:DI (match_operand:DI 1 "general_operand" "")
+ (match_operand:DI 2 "register_operand" "")))]
+ "TARGET_64BIT && reload_completed
+ && !address_operand (gen_rtx_PLUS (DImode, operands[1], operands[2]), QImode)
+ && !rtx_equal_p (operands[0], operands[1])
+ && !rtx_equal_p (operands[0], operands[2])"
+ [(set (match_dup 0) (match_dup 1))
+ (set (match_dup 0) (plus:DI (match_dup 0) (match_dup 2)))]
+ "")
+
+(define_split
+ [(set (match_operand:DI 0 "register_operand" "")
+ (plus:DI (match_operand:DI 1 "register_operand" "")
+ (match_operand:DI 2 "general_operand" "")))]
+ "TARGET_64BIT && reload_completed
+ && !address_operand (gen_rtx_PLUS (DImode, operands[1], operands[2]), QImode)
+ && !rtx_equal_p (operands[0], operands[1])
+ && !rtx_equal_p (operands[0], operands[2])"
+ [(set (match_dup 0) (match_dup 2))
+ (set (match_dup 0) (plus:DI (match_dup 0) (match_dup 1)))]
+ "")
+
+;
+; addsi3 instruction pattern(s).
+;
+; The following insn is used when it is known that operand one is the stack pointer,
+; and operand two is small enough to fit in the displacement field
+; In this case, the result will be a address
+;
+
+(define_insn "addaddr"
+ [(set (match_operand:SI 0 "register_operand" "=d,d")
+ (plus:SI (match_operand:SI 1 "register_operand" "%a,a")
+ (match_operand:SI 2 "nonmemory_operand" "J,a")))]
+ "(((REGNO (operands[1]) == STACK_POINTER_REGNUM ) ||
+ (REGNO (operands[1]) == BASE_REGISTER)) &&
+ (GET_CODE (operands[2]) == REG ||
+ CONST_OK_FOR_LETTER_P (INTVAL (operands[2]),'J')))"
+ "@
+ la\\t%0,%c2(,%1)
+ la\\t%0,0(%1,%2)"
+ [(set_attr "op_type" "RX")
+ (set_attr "atype" "mem")
+ (set_attr "type" "la")])
+
+(define_insn "addsi3"
+ [(set (match_operand:SI 0 "register_operand" "=d,d,d")
+ (plus:SI (match_operand:SI 1 "register_operand" "%0,0,0")
+ (match_operand:SI 2 "general_operand" "d,K,m")))
+ (clobber (reg:CC 33))]
+ ""
+ "@
+ ar\\t%0,%2
+ ahi\\t%0,%h2
+ a\\t%0,%2"
+ [(set_attr "op_type" "RR,RI,RX")
+ (set_attr "atype" "reg,reg,mem")
+ (set_attr "type" "set")])
+
+(define_insn "*do_la"
+ [(set (match_operand:SI 0 "register_operand" "=a")
+ (match_operand:QI 1 "address_operand" "p"))]
+ "reload_in_progress || reload_completed
+ || legitimate_la_operand_p (operands[1])"
+ "la\\t%0,%a1"
+ [(set_attr "op_type" "RX")
+ (set_attr "atype" "mem")
+ (set_attr "type" "la")])
+
+(define_insn "*do_la_reg_0"
+ [(set (match_operand:SI 0 "register_operand" "=d")
+ (plus:SI (match_operand:SI 1 "register_operand" "%0")
+ (match_operand:SI 2 "register_operand" "d")))]
+ "reload_in_progress || reload_completed"
+ "brxle\\t%0,%2,.+4"
+ [(set_attr "op_type" "RSI")
+ (set_attr "atype" "reg")
+ (set_attr "type" "set")])
+
+(define_insn "*reload_la_31"
+ [(set (match_operand:SI 0 "register_operand" "=d")
+ (plus:SI (match_operand:SI 1 "general_operand" "g")
+ (match_operand:SI 2 "general_operand" "g")))]
+ "reload_in_progress"
+ "#")
+
+(define_split
+ [(set (match_operand:SI 0 "register_operand" "")
+ (plus:SI (match_operand:SI 1 "general_operand" "")
+ (match_operand:SI 2 "register_operand" "")))]
+ "reload_completed
+ && !address_operand (gen_rtx_PLUS (SImode, operands[1], operands[2]), QImode)
+ && !rtx_equal_p (operands[0], operands[1])
+ && !rtx_equal_p (operands[0], operands[2])"
+ [(set (match_dup 0) (match_dup 1))
+ (set (match_dup 0) (plus:SI (match_dup 0) (match_dup 2)))]
+ "")
+
+(define_split
+ [(set (match_operand:SI 0 "register_operand" "")
+ (plus:SI (match_operand:SI 1 "register_operand" "")
+ (match_operand:SI 2 "general_operand" "")))]
+ "reload_completed
+ && !address_operand (gen_rtx_PLUS (SImode, operands[1], operands[2]), QImode)
+ && !rtx_equal_p (operands[0], operands[1])
+ && !rtx_equal_p (operands[0], operands[2])"
+ [(set (match_dup 0) (match_dup 2))
+ (set (match_dup 0) (plus:SI (match_dup 0) (match_dup 1)))]
+ "")
+
+(define_insn "addsi_64"
+ [(set (match_operand:SI 0 "register_operand" "=d,d")
+ (plus:SI (match_operand:SI 1 "register_operand" "%a,a")
+ (match_operand:SI 2 "nonmemory_operand" "J,a")))]
+ "TARGET_64BIT"
+ "@
+ la\\t%0,%c2(,%1)
+ la\\t%0,0(%1,%2)"
+ [(set_attr "op_type" "RX")
+ (set_attr "atype" "mem")
+ (set_attr "type" "la")])
+
+;
+; addhi3 instruction pattern(s).
+;
+
+(define_insn "addhi3"
+ [(set (match_operand:HI 0 "register_operand" "=d,d,d")
+ (plus:HI (match_operand:HI 1 "register_operand" "%0,0,0")
+ (match_operand:HI 2 "general_operand" "d,K,m")))
+ (clobber (reg:CC 33))]
+ ""
+ "@
+ ar\\t%0,%2
+ ahi\\t%0,%h2
+ ah\\t%0,%2"
+ [(set_attr "op_type" "RR,RI,RX")
+ (set_attr "atype" "reg,reg,mem")])
+
+
+;
+; addqi3 instruction pattern(s).
+;
+
+(define_insn "addqi3"
+ [(set (match_operand:QI 0 "register_operand" "=d,d")
+ (plus:QI (match_operand:QI 1 "register_operand" "%0,0")
+ (match_operand:QI 2 "general_operand" "a,n")))
+ (clobber (reg:CC 33))]
+ ""
+ "@
+ ar\\t%0,%2
+ ahi\\t%0,%h2"
+ [(set_attr "op_type" "RX,RX")
+ (set_attr "atype" "reg,mem")])
+
+
+;
+; adddf3 instruction pattern(s).
+;
+
+(define_expand "adddf3"
+ [(parallel
+ [(set (match_operand:DF 0 "register_operand" "=f,f")
+ (plus:DF (match_operand:DF 1 "register_operand" "%0,0")
+ (match_operand:DF 2 "nonimmediate_operand" "f,m")))
+ (clobber (reg:CC 33))])]
+ "TARGET_HARD_FLOAT"
+ "")
+
+(define_insn "*adddf3"
+ [(set (match_operand:DF 0 "register_operand" "=f,f")
+ (plus:DF (match_operand:DF 1 "register_operand" "%0,0")
+ (match_operand:DF 2 "nonimmediate_operand" "f,m")))
+ (clobber (reg:CC 33))]
+ "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
+ "@
+ adbr\\t%0,%2
+ adb\\t%0,%2"
+ [(set_attr "op_type" "RR,RX")
+ (set_attr "atype" "reg,mem")])
+
+(define_insn "*adddf3_ibm"
+ [(set (match_operand:DF 0 "register_operand" "=f,f")
+ (plus:DF (match_operand:DF 1 "register_operand" "%0,0")
+ (match_operand:DF 2 "nonimmediate_operand" "f,m")))
+ (clobber (reg:CC 33))]
+ "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
+ "@
+ adr\\t%0,%2
+ ad\\t%0,%2"
+ [(set_attr "op_type" "RR,RX")
+ (set_attr "atype" "reg,mem")])
+
+;
+; addsf3 instruction pattern(s).
+;
+
+(define_expand "addsf3"
+ [(parallel
+ [(set (match_operand:SF 0 "register_operand" "=f,f")
+ (plus:SF (match_operand:SF 1 "register_operand" "%0,0")
+ (match_operand:SF 2 "nonimmediate_operand" "f,m")))
+ (clobber (reg:CC 33))])]
+ "TARGET_HARD_FLOAT"
+ "")
+
+(define_insn "*addsf3"
+ [(set (match_operand:SF 0 "register_operand" "=f,f")
+ (plus:SF (match_operand:SF 1 "register_operand" "%0,0")
+ (match_operand:SF 2 "nonimmediate_operand" "f,m")))
+ (clobber (reg:CC 33))]
+ "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
+ "@
+ aebr\\t%0,%2
+ aeb\\t%0,%2"
+ [(set_attr "op_type" "RR,RX")
+ (set_attr "atype" "reg,mem")])
+
+(define_insn "*addsf3"
+ [(set (match_operand:SF 0 "register_operand" "=f,f")
+ (plus:SF (match_operand:SF 1 "register_operand" "%0,0")
+ (match_operand:SF 2 "nonimmediate_operand" "f,m")))
+ (clobber (reg:CC 33))]
+ "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
+ "@
+ aer\\t%0,%2
+ ae\\t%0,%2"
+ [(set_attr "op_type" "RR,RX")
+ (set_attr "atype" "reg,mem")])
+
+
+;;
+;;- Subtract instructions.
+;;
+
+;
+; subdi3 instruction pattern(s).
+;
+
+(define_insn "*subdi3_64"
+ [(set (match_operand:DI 0 "register_operand" "=d,d")
+ (minus:DI (match_operand:DI 1 "register_operand" "0,0")
+ (match_operand:DI 2 "general_operand" "d,m") ) )
+ (clobber (reg:CC 33))]
+ "TARGET_64BIT"
+ "@
+ sgr\\t%0,%2
+ sg\\t%0,%2"
+ [(set_attr "op_type" "RRE,RRE")
+ (set_attr "atype" "reg,mem")
+ (set_attr "type" "set")])
+
+(define_insn "subdi3"
+ [(set (match_operand:DI 0 "register_operand" "=d,d")
+ (minus:DI (match_operand:DI 1 "register_operand" "0,0")
+ (match_operand:DI 2 "nonimmediate_operand" "d,m")))
+ (clobber (reg:CC 33))]
+ ""
+ "*
+{
+ switch (which_alternative)
+ {
+ case 0: /* d <- d */
+ output_asm_insn (\"sr\\t%0,%2\", operands);
+ output_asm_insn (\"slr\\t%N0,%N2\", operands);
+ break;
+ case 1: /* d <- m */
+ output_asm_insn (\"s\\t%0,%2\", operands);
+ output_asm_insn (\"sl\\t%N0,%N2\", operands);
+ break;
+ }
+
+ output_asm_insn (\"brc\\t11,.+8\", operands);
+ return \"ahi\\t%0,-1\";
+}"
+ [(set_attr "op_type" "NN,NN")
+ (set_attr "atype" "reg,mem")
+ (set_attr "length" "12,16")])
+
+;
+; subsi3 instruction pattern(s).
+;
+
+(define_insn "subsi3"
+ [(set (match_operand:SI 0 "register_operand" "=d,d")
+ (minus:SI (match_operand:SI 1 "register_operand" "0,0")
+ (match_operand:SI 2 "general_operand" "d,m")))
+ (clobber (reg:CC 33))]
+ ""
+ "@
+ sr\\t%0,%2
+ s\\t%0,%2"
+ [(set_attr "op_type" "RR,RX")
+ (set_attr "atype" "reg,mem")
+ (set_attr "type" "set")])
+
+;
+; subhi3 instruction pattern(s).
+;
+
+(define_insn "subhi3"
+ [(set (match_operand:HI 0 "register_operand" "=d,d,d")
+ (minus:HI (match_operand:HI 1 "register_operand" "0,0,0")
+ (match_operand:HI 2 "nonimmediate_operand" "d,K,m")))
+ (clobber (reg:CC 33))]
+ ""
+ "@
+ sr\\t%0,%2
+ ahi\\t%0,-%h2
+ sh\\t%0,%2"
+ [(set_attr "op_type" "RR,RI,RX")
+ (set_attr "atype" "reg,reg,mem")])
+
+;
+; subqi3 instruction pattern(s).
+;
+
+(define_insn "subqi3"
+ [(set (match_operand:QI 0 "register_operand" "=d")
+ (minus:QI (match_operand:QI 1 "register_operand" "0")
+ (match_operand:QI 2 "register_operand" "d")))
+ (clobber (reg:CC 33))]
+ ""
+ "sr\\t%0,%2"
+ [(set_attr "op_type" "RR")])
+
+;
+; subdf3 instruction pattern(s).
+;
+
+(define_expand "subdf3"
+ [(parallel
+ [(set (match_operand:DF 0 "register_operand" "=f,f")
+ (minus:DF (match_operand:DF 1 "register_operand" "0,0")
+ (match_operand:DF 2 "nonimmediate_operand" "f,m")))
+ (clobber (reg:CC 33))])]
+ "TARGET_HARD_FLOAT"
+ "")
+
+(define_insn "*subdf3"
+ [(set (match_operand:DF 0 "register_operand" "=f,f")
+ (minus:DF (match_operand:DF 1 "register_operand" "0,0")
+ (match_operand:DF 2 "nonimmediate_operand" "f,m")))
+ (clobber (reg:CC 33))]
+ "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
+ "@
+ sdbr\\t%0,%2
+ sdb\\t%0,%2"
+ [(set_attr "op_type" "RR,RX")
+ (set_attr "atype" "reg,mem")])
+
+(define_insn "*subdf3_ibm"
+ [(set (match_operand:DF 0 "register_operand" "=f,f")
+ (minus:DF (match_operand:DF 1 "register_operand" "0,0")
+ (match_operand:DF 2 "nonimmediate_operand" "f,m")))
+ (clobber (reg:CC 33))]
+ "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
+ "@
+ sdr\\t%0,%2
+ sd\\t%0,%2"
+ [(set_attr "op_type" "RR,RX")
+ (set_attr "atype" "reg,mem")])
+
+;
+; subsf3 instruction pattern(s).
+;
+
+(define_expand "subsf3"
+ [(parallel
+ [(set (match_operand:SF 0 "register_operand" "=f,f")
+ (minus:SF (match_operand:SF 1 "register_operand" "0,0")
+ (match_operand:SF 2 "nonimmediate_operand" "f,m")))
+ (clobber (reg:CC 33))])]
+ "TARGET_HARD_FLOAT"
+ "")
+
+(define_insn "*subsf3"
+ [(set (match_operand:SF 0 "register_operand" "=f,f")
+ (minus:SF (match_operand:SF 1 "register_operand" "0,0")
+ (match_operand:SF 2 "nonimmediate_operand" "f,m")))
+ (clobber (reg:CC 33))]
+ "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
+ "@
+ sebr\\t%0,%2
+ seb\\t%0,%2"
+ [(set_attr "op_type" "RR,RX")
+ (set_attr "atype" "reg,mem")])
+
+(define_insn "*subsf3_ibm"
+ [(set (match_operand:SF 0 "register_operand" "=f,f")
+ (minus:SF (match_operand:SF 1 "register_operand" "0,0")
+ (match_operand:SF 2 "nonimmediate_operand" "f,m")))
+ (clobber (reg:CC 33))]
+ "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
+ "@
+ ser\\t%0,%2
+ se\\t%0,%2"
+ [(set_attr "op_type" "RR,RX")
+ (set_attr "atype" "reg,mem")])
+
+
+;;
+;;- Multiply instructions.
+;;
+
+(define_expand "muldi3"
+ [(parallel
+ [(set (match_operand:DI 0 "register_operand" "")
+ (mult:DI (match_operand:DI 1 "register_operand" "")
+ (match_operand:DI 2 "register_operand" "")))
+ (clobber (reg:CC 33))])]
+ ""
+ "
+{
+ if (!TARGET_64BIT)
+ {
+ rtx label1 = gen_label_rtx ();
+ rtx label2 = gen_label_rtx ();
+ rtx op0_0 = operand_subword (operands[0], 0 ,1, DImode);
+ rtx op0_1 = operand_subword (operands[0], 1 ,1, DImode);
+ rtx temp1_0 = gen_reg_rtx (SImode);
+ rtx temp1_1 = gen_reg_rtx (SImode);
+ rtx temp2_0 = gen_reg_rtx (SImode);
+ rtx temp2_1 = gen_reg_rtx (SImode);
+
+ emit_move_insn (temp1_0, operand_subword (operands[1], 0 ,1, DImode));
+ emit_move_insn (temp1_1, operand_subword (operands[1], 1 ,1, DImode));
+ emit_move_insn (temp2_0, operand_subword (operands[2], 0 ,1, DImode));
+ emit_move_insn (temp2_1, operand_subword (operands[2], 1 ,1, DImode));
+ emit_move_insn (op0_1, temp1_1);
+ emit_insn (gen_mulsi_6432 (operands[0], operands[0], temp2_1));
+
+ emit_insn (gen_cmpsi (temp1_1, const0_rtx));
+ emit_jump_insn (gen_bge (label1));
+ emit_insn (gen_addsi3 (op0_0, op0_0, temp2_1));
+ emit_label (label1);
+ emit_insn (gen_cmpsi (temp2_1, const0_rtx));
+ emit_jump_insn (gen_bge (label2));
+ emit_insn (gen_addsi3 (op0_0, op0_0, temp1_1));
+ emit_label (label2);
+
+ emit_insn (gen_mulsi3 (temp2_1, temp2_1, temp1_0));
+ emit_insn (gen_addsi3 (op0_0, op0_0, temp2_1));
+
+ emit_insn (gen_mulsi3 (temp1_1, temp1_1, temp2_0));
+ emit_insn (gen_addsi3 (op0_0, op0_0, temp1_1));
+
+ DONE;
+ }
+}")
+
+(define_insn "*muldi3_64"
+ [(set (match_operand:DI 0 "register_operand" "=d,d,d")
+ (mult:DI (match_operand:DI 1 "register_operand" "%0,0,0")
+ (match_operand:DI 2 "general_operand" "d,K,m")))
+ (clobber (reg:CC 33))]
+ "TARGET_64BIT"
+ "@
+ msgr\\t%0,%2
+ mghi\\t%0,%h2
+ msg\\t%0,%2"
+ [(set_attr "op_type" "RRE,RI,RX")
+ (set_attr "cycle" "n")
+ (set_attr "atype" "reg,reg,mem")
+ (set_attr "type" "set")])
+
+;
+; mulsi3 instruction pattern(s).
+;
+
+(define_insn "mulsi3"
+ [(set (match_operand:SI 0 "register_operand" "=d,d,d")
+ (mult:SI (match_operand:SI 1 "register_operand" "%0,0,0")
+ (match_operand:SI 2 "general_operand" "d,K,m")))
+ (clobber (reg:CC 33))]
+ ""
+ "@
+ msr\\t%0,%2
+ mhi\\t%0,%h2
+ ms\\t%0,%2"
+ [(set_attr "op_type" "RRE,RI,RX")
+ (set_attr "cycle" "n")
+ (set_attr "atype" "reg,reg,mem")
+ (set_attr "type" "set")])
+
+(define_insn "mulsi_6432"
+ [(set (match_operand:DI 0 "register_operand" "=d,d")
+ (mult:DI (sign_extend:DI
+ (subreg:SI (match_operand:DI 1 "register_operand" "0,0") 1))
+ (sign_extend:DI
+ (match_operand:SI 2 "general_operand" "d,m"))))
+ (clobber (reg:CC 33))]
+ "!TARGET_64BIT"
+ "@
+ mr\\t%0,%2
+ m\\t%0,%2"
+ [(set_attr "op_type" "RR,RX")
+ (set_attr "cycle" "n")
+ (set_attr "atype" "reg,mem")
+ (set_attr "type" "set")])
+
+
+;
+; muldf3 instruction pattern(s).
+;
+
+(define_expand "muldf3"
+ [(parallel
+ [(set (match_operand:DF 0 "register_operand" "=f,f")
+ (mult:DF (match_operand:DF 1 "register_operand" "%0,0")
+ (match_operand:DF 2 "nonimmediate_operand" "f,m")))
+ (clobber (reg:CC 33))])]
+ "TARGET_HARD_FLOAT"
+ "")
+
+(define_insn "*muldf3"
+ [(set (match_operand:DF 0 "register_operand" "=f,f")
+ (mult:DF (match_operand:DF 1 "register_operand" "%0,0")
+ (match_operand:DF 2 "nonimmediate_operand" "f,m")))
+ (clobber (reg:CC 33))]
+ "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
+ "@
+ mdbr\\t%0,%2
+ mdb\\t%0,%2"
+ [(set_attr "op_type" "RR,RX")
+ (set_attr "cycle" "n")
+ (set_attr "atype" "reg,mem")])
+
+(define_insn "*muldf3_ibm"
+ [(set (match_operand:DF 0 "register_operand" "=f,f")
+ (mult:DF (match_operand:DF 1 "register_operand" "%0,0")
+ (match_operand:DF 2 "nonimmediate_operand" "f,m")))
+ (clobber (reg:CC 33))]
+ "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
+ "@
+ mdr\\t%0,%2
+ md\\t%0,%2"
+ [(set_attr "op_type" "RR,RX")
+ (set_attr "cycle" "n")
+ (set_attr "atype" "reg,mem")])
+
+;
+; mulsf3 instruction pattern(s).
+;
+
+(define_expand "mulsf3"
+ [(parallel
+ [(set (match_operand:SF 0 "register_operand" "=f,f")
+ (mult:SF (match_operand:SF 1 "register_operand" "%0,0")
+ (match_operand:SF 2 "nonimmediate_operand" "f,m")))
+ (clobber (reg:CC 33))])]
+ "TARGET_HARD_FLOAT"
+ "")
+
+(define_insn "*mulsf3"
+ [(set (match_operand:SF 0 "register_operand" "=f,f")
+ (mult:SF (match_operand:SF 1 "register_operand" "%0,0")
+ (match_operand:SF 2 "nonimmediate_operand" "f,m")))
+ (clobber (reg:CC 33))]
+ "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
+ "@
+ meebr\\t%0,%2
+ meeb\\t%0,%2"
+ [(set_attr "op_type" "RR,RX")
+ (set_attr "cycle" "n")
+ (set_attr "atype" "reg,mem")])
+
+(define_insn "*mulsf3_ibm"
+ [(set (match_operand:SF 0 "register_operand" "=f,f")
+ (mult:SF (match_operand:SF 1 "register_operand" "%0,0")
+ (match_operand:SF 2 "nonimmediate_operand" "f,m")))
+ (clobber (reg:CC 33))]
+ "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
+ "@
+ mer\\t%0,%2
+ me\\t%0,%2"
+ [(set_attr "op_type" "RR,RX")
+ (set_attr "cycle" "n")
+ (set_attr "atype" "reg,mem")])
+
+
+;;
+;;- Divide and modulo instructions.
+;;
+
+;
+; divdi3 and moddi3 instruction pattern(s).
+;
+
+(define_expand "divdi3"
+ [(set (match_operand:DI 0 "register_operand" "=d")
+ (div:DI (match_operand:DI 1 "register_operand" "d")
+ (match_operand:DI 2 "general_operand" "")))]
+ "TARGET_64BIT"
+ "
+{
+ rtx op3 = gen_reg_rtx (TImode);
+
+ if (CONSTANT_P (operands[2]))
+ operands[2] = force_const_mem (DImode, operands[2]);
+
+ emit_move_insn (gen_rtx (SUBREG, DImode, op3, 0), const0_rtx);
+ emit_move_insn (gen_rtx (SUBREG, DImode, op3, 1), operands[1]);
+ emit_insn (gen_divmodtidi3 (op3, op3, operands[2]));
+ emit_move_insn (operands[0], gen_rtx (SUBREG, DImode, op3, 1));
+ DONE;
+}")
+
+(define_expand "moddi3"
+ [(set (match_operand:DI 0 "register_operand" "=d")
+ (mod:DI (match_operand:DI 1 "register_operand" "d")
+ (match_operand:DI 2 "general_operand" "")))]
+ "TARGET_64BIT"
+ "
+{
+ rtx op3 = gen_reg_rtx (TImode);
+
+ if (CONSTANT_P (operands[2]))
+ operands[2] = force_const_mem (DImode, operands[2]);
+
+ emit_move_insn (gen_rtx (SUBREG, DImode, op3, 0), const0_rtx);
+ emit_move_insn (gen_rtx (SUBREG, DImode, op3, 1), operands[1]);
+ emit_insn (gen_divmodtidi3 (op3, op3, operands[2]));
+ emit_move_insn (operands[0], gen_rtx (SUBREG, DImode, op3, 0));
+ DONE;
+}")
+
+(define_insn "divmodtidi3"
+ [(set (subreg:DI (match_operand:TI 0 "register_operand" "=d,d") 0)
+ (truncate:DI
+ (mod:TI (match_operand:TI 1 "register_operand" "0,0")
+ (sign_extend:TI
+ (match_operand:DI 2 "nonimmediate_operand" "d,m")))))
+ (set (subreg:DI (match_dup 0) 1)
+ (truncate:DI (div:TI (match_dup 1) (sign_extend:TI (match_dup 2)))))
+ (clobber (reg:CC 33))]
+ "TARGET_64BIT"
+ "@
+ dsgr\\t%0,%2
+ dsg\\t%0,%2"
+ [(set_attr "op_type" "RRE,RXE")
+ (set_attr "cycle" "n")
+ (set_attr "atype" "reg,mem")])
+
+;
+; udivdi3 and umoddi3 instruction pattern(s).
+;
+
+(define_expand "udivdi3"
+ [(set (match_operand:DI 0 "register_operand" "=d")
+ (udiv:DI (match_operand:DI 1 "register_operand" "d")
+ (match_operand:DI 2 "general_operand" "")))]
+ "TARGET_64BIT"
+ "
+{
+ rtx op3 = gen_reg_rtx(TImode);
+
+ if (CONSTANT_P (operands[2]))
+ operands[2] = force_const_mem (DImode, operands[2]);
+
+ emit_move_insn (gen_rtx (SUBREG, DImode, op3, 0), const0_rtx);
+ emit_move_insn (gen_rtx (SUBREG, DImode, op3, 1), operands[1]);
+ emit_insn (gen_udivmodtidi3 (op3, op3, operands[2]));
+ emit_move_insn (operands[0], gen_rtx (SUBREG, DImode, op3, 1));
+ DONE;
+}")
+
+(define_expand "umoddi3"
+ [(set (match_operand:DI 0 "register_operand" "=d")
+ (umod:DI (match_operand:DI 1 "register_operand" "d")
+ (match_operand:DI 2 "general_operand" "")))]
+ "TARGET_64BIT"
+ "
+{
+ rtx op3 = gen_reg_rtx (TImode);
+
+ if (CONSTANT_P (operands[2]))
+ operands[2] = force_const_mem (DImode, operands[2]);
+
+ emit_move_insn (gen_rtx (SUBREG, DImode, op3, 0), const0_rtx);
+ emit_move_insn (gen_rtx (SUBREG, DImode, op3, 1), operands[1]);
+ emit_insn (gen_udivmodtidi3 (op3, op3, operands[2]));
+ emit_move_insn (operands[0], gen_rtx (SUBREG, DImode, op3, 0));
+ DONE;
+}")
+
+(define_insn "udivmodtidi3"
+ [(set (subreg:DI (match_operand:TI 0 "register_operand" "=d,d") 0)
+ (truncate:DI
+ (umod:TI (match_operand:TI 1 "register_operand" "0,0")
+ (zero_extend:TI
+ (match_operand:DI 2 "nonimmediate_operand" "d,m")))))
+ (set (subreg:DI (match_dup 0) 1)
+ (truncate:DI (udiv:TI (match_dup 1) (zero_extend:TI (match_dup 2)))))
+ (clobber (reg:CC 33))]
+ "TARGET_64BIT"
+ "@
+ dlgr\\t%0,%2
+ dlg\\t%0,%2"
+ [(set_attr "op_type" "RRE,RXE")
+ (set_attr "cycle" "n")
+ (set_attr "atype" "reg,mem")])
+
+;
+; divsi3 and modsi3 instruction pattern(s).
+;
+
+(define_expand "divsi3"
+ [(set (match_operand:SI 0 "register_operand" "=d")
+ (div:SI (match_operand:SI 1 "register_operand" "d")
+ (match_operand:SI 2 "nonimmediate_operand" "")))]
+ "!TARGET_64BIT"
+ "
+{
+ rtx tmp = gen_reg_rtx (DImode);
+
+ if (CONSTANT_P (operands[2]))
+ operands[2] = force_const_mem (SImode, operands[2]);
+ else
+ operands[2] = force_reg (SImode, operands[2]);
+
+ emit_insn (gen_rtx_CLOBBER (SImode, gen_rtx_SUBREG (SImode, tmp, 1)));
+ emit_move_insn (gen_rtx_SUBREG (SImode, tmp, 0), operands[1]);
+ emit_insn (gen_ashrdi3 (tmp, tmp, GEN_INT (32)));
+ emit_insn (gen_divmoddisi3 (tmp, tmp, operands[2]));
+ emit_move_insn (operands[0], gen_rtx (SUBREG, SImode, tmp, 1));
+ DONE;
+}")
+
+(define_expand "modsi3"
+ [(set (match_operand:SI 0 "register_operand" "=d")
+ (mod:SI (match_operand:SI 1 "register_operand" "d")
+ (match_operand:SI 2 "nonimmediate_operand" "")))]
+ "!TARGET_64BIT"
+ "
+{
+ rtx tmp = gen_reg_rtx (DImode);
+
+ if (CONSTANT_P (operands[2]))
+ operands[2] = force_const_mem (SImode, operands[2]);
+ else
+ operands[2] = force_reg (SImode, operands[2]);
+
+ emit_insn (gen_rtx_CLOBBER (SImode, gen_rtx_SUBREG (SImode, tmp, 1)));
+ emit_insn (gen_movsi (gen_rtx_SUBREG (SImode, tmp, 0), operands[1]));
+ emit_insn (gen_ashrdi3 (tmp, tmp, GEN_INT (32)));
+ emit_insn (gen_divmoddisi3 (tmp, tmp, operands[2]));
+ emit_move_insn (operands[0], gen_rtx (SUBREG, SImode, tmp, 0));
+ DONE;
+}")
+
+(define_insn "divmoddisi3"
+ [(set (subreg:SI (match_operand:DI 0 "register_operand" "=d,d") 0)
+ (truncate:SI
+ (mod:DI (match_operand:DI 1 "register_operand" "0,0")
+ (sign_extend:DI
+ (match_operand:SI 2 "nonimmediate_operand" "d,m")))))
+ (set (subreg:SI (match_dup 0) 1)
+ (truncate:SI (div:DI (match_dup 1) (sign_extend:DI (match_dup 2)))))
+ (clobber (reg:CC 33))]
+ "!TARGET_64BIT"
+ "@
+ dr\\t%0,%2
+ d\\t%0,%2"
+ [(set_attr "op_type" "RR,RX")
+ (set_attr "cycle" "n")
+ (set_attr "atype" "reg,mem")])
+
+;
+; udivsi3 and umodsi3 instruction pattern(s).
+;
+
+(define_expand "udivsi3"
+ [(set (match_operand:SI 0 "register_operand" "=d")
+ (udiv:SI (match_operand:SI 1 "general_operand" "")
+ (match_operand:SI 2 "general_operand" "")))]
+ "!TARGET_64BIT"
+ "
+{
+ rtx dr_0, dr_1, tmp;
+
+ tmp = gen_reg_rtx (DImode);
+ dr_0 = gen_rtx (SUBREG, SImode, tmp, 0);
+ dr_1 = gen_rtx (SUBREG, SImode, tmp, 1);
+
+ if (CONSTANT_P (operands[2]))
+ {
+ if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) < 0)
+ {
+ rtx label1 = gen_label_rtx ();
+
+ emit_move_insn (dr_0, operands[1]);
+ emit_move_insn (dr_1, const0_rtx);
+ emit_insn (gen_cmpsi (dr_0, operands[2]));
+ emit_jump_insn (gen_bltu (label1));
+ emit_move_insn (dr_1, const1_rtx);
+ emit_label (label1);
+ }
+ else
+ {
+ operands[2] = force_const_mem (SImode, operands[2]);
+ emit_move_insn (gen_rtx_SUBREG (SImode, tmp, 0), const0_rtx);
+ emit_move_insn (gen_rtx_SUBREG (SImode, tmp, 1), operands[1]);
+ emit_insn (gen_divmoddisi3 (tmp, tmp, operands[2]));
+ }
+ }
+ else
+ {
+ rtx label1 = gen_label_rtx ();
+ rtx label2 = gen_label_rtx ();
+ rtx label3 = gen_label_rtx ();
+
+ operands[1] = force_reg (SImode, operands[1]);
+ operands[2] = force_reg (SImode, operands[2]);
+
+ emit_move_insn (dr_1, const0_rtx);
+ emit_insn (gen_cmpsi (operands[2], operands[1]));
+ emit_jump_insn (gen_bgtu (label3));
+ emit_insn (gen_cmpsi (operands[2], const1_rtx));
+ emit_jump_insn (gen_blt (label2));
+ emit_insn (gen_cmpsi (operands[2], const1_rtx));
+ emit_jump_insn (gen_beq (label1));
+ emit_move_insn (gen_rtx_SUBREG (SImode, tmp, 0), const0_rtx);
+ emit_move_insn (gen_rtx_SUBREG (SImode, tmp, 1), operands[1]);
+ emit_insn (gen_divmoddisi3 (tmp, tmp, operands[2]));
+ emit_jump_insn (gen_jump (label3));
+ emit_label (label1);
+ emit_move_insn (dr_1, operands[1]);
+ emit_jump_insn (gen_jump (label3));
+ emit_label (label2);
+ emit_move_insn (dr_1, const1_rtx);
+ emit_label (label3);
+ }
+
+ emit_move_insn (operands[0], dr_1);
+ DONE;
+}")
+
+(define_expand "umodsi3"
+ [(set (match_operand:SI 0 "register_operand" "=d")
+ (umod:SI (match_operand:SI 1 "nonimmediate_operand" "")
+ (match_operand:SI 2 "nonimmediate_operand" "")))]
+ "!TARGET_64BIT"
+ "
+{
+ rtx dr_0, dr_1, tmp;
+
+ tmp = gen_reg_rtx (DImode);
+ dr_0 = gen_rtx (SUBREG, SImode, tmp, 0);
+ dr_1 = gen_rtx (SUBREG, SImode, tmp, 1);
+
+ if (CONSTANT_P (operands[2]))
+ {
+ if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) <= 0)
+ {
+ rtx label1 = gen_label_rtx ();
+
+ emit_move_insn (dr_0, operands[1]);
+ emit_insn (gen_cmpsi (dr_0, operands[2]));
+ emit_jump_insn (gen_bltu (label1));
+ emit_insn (gen_abssi2 (dr_0, operands[2]));
+ emit_insn (gen_addsi3 (dr_0,dr_0, operands[1]));
+ emit_label (label1);
+ }
+ else
+ {
+ operands[2] = force_const_mem (SImode, operands[2]);
+ emit_move_insn (gen_rtx_SUBREG (SImode, tmp, 0), const0_rtx);
+ emit_move_insn (gen_rtx_SUBREG (SImode, tmp, 1), operands[1]);
+ emit_insn (gen_divmoddisi3 (tmp, tmp, operands[2]));
+ }
+ }
+ else
+ {
+ rtx label1 = gen_label_rtx ();
+ rtx label2 = gen_label_rtx ();
+ rtx label3 = gen_label_rtx ();
+
+ operands[1] = force_reg (SImode, operands[1]);
+ operands[2] = force_reg (SImode, operands[2]);
+
+ emit_move_insn(dr_0, operands[1]);
+ emit_insn (gen_cmpsi (operands[2], dr_0));
+ emit_jump_insn (gen_bgtu (label3));
+ emit_insn (gen_cmpsi (operands[2], const1_rtx));
+ emit_jump_insn (gen_blt (label2));
+ emit_insn (gen_cmpsi (operands[2], const1_rtx));
+ emit_jump_insn (gen_beq (label1));
+ emit_move_insn (gen_rtx_SUBREG (SImode, tmp, 0), const0_rtx);
+ emit_move_insn (gen_rtx_SUBREG (SImode, tmp, 1), operands[1]);
+ emit_insn (gen_divmoddisi3 (tmp, tmp, operands[2]));
+ emit_jump_insn (gen_jump (label3));
+ emit_label (label1);
+ emit_move_insn (dr_0, const0_rtx);
+ emit_jump_insn (gen_jump (label3));
+ emit_label (label2);
+ emit_insn (gen_subsi3 (dr_0, dr_0, operands[2]));
+ emit_label (label3);
+ }
+
+ emit_move_insn (operands[0], dr_0);
+ DONE;
+}")
+
+;
+; divdf3 instruction pattern(s).
+;
+
+(define_expand "divdf3"
+ [(parallel
+ [(set (match_operand:DF 0 "nonimmediate_operand" "=f,f")
+ (div:DF (match_operand:DF 1 "general_operand" "0,0")
+ (match_operand:DF 2 "nonimmediate_operand" "f,m")))
+ (clobber (reg:CC 33))])]
+ "TARGET_HARD_FLOAT"
+ "")
+
+(define_insn "*divdf3"
+ [(set (match_operand:DF 0 "nonimmediate_operand" "=f,f")
+ (div:DF (match_operand:DF 1 "general_operand" "0,0")
+ (match_operand:DF 2 "nonimmediate_operand" "f,m")))
+ (clobber (reg:CC 33))]
+ "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
+ "@
+ ddbr\\t%0,%2
+ ddb\\t%0,%2"
+ [(set_attr "op_type" "RR,RX")
+ (set_attr "cycle" "n")
+ (set_attr "atype" "reg,mem")])
+
+(define_insn "*divdf3_ibm"
+ [(set (match_operand:DF 0 "nonimmediate_operand" "=f,f")
+ (div:DF (match_operand:DF 1 "general_operand" "0,0")
+ (match_operand:DF 2 "nonimmediate_operand" "f,m")))
+ (clobber (reg:CC 33))]
+ "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
+ "@
+ ddr\\t%0,%2
+ dd\\t%0,%2"
+ [(set_attr "op_type" "RR,RX")
+ (set_attr "cycle" "n")
+ (set_attr "atype" "reg,mem")])
+
+;
+; divsf3 instruction pattern(s).
+;
+
+(define_expand "divsf3"
+ [(parallel
+ [(set (match_operand:SF 0 "nonimmediate_operand" "=f,f")
+ (div:SF (match_operand:SF 1 "nonimmediate_operand" "0,0")
+ (match_operand:SF 2 "nonimmediate_operand" "f,m")))
+ (clobber (reg:CC 33))])]
+ "TARGET_HARD_FLOAT"
+ "")
+
+(define_insn "*divsf3"
+ [(set (match_operand:SF 0 "nonimmediate_operand" "=f,f")
+ (div:SF (match_operand:SF 1 "nonimmediate_operand" "0,0")
+ (match_operand:SF 2 "nonimmediate_operand" "f,m")))
+ (clobber (reg:CC 33))]
+ "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
+ "@
+ debr\\t%0,%2
+ deb\\t%0,%2"
+ [(set_attr "op_type" "RR,RX")
+ (set_attr "cycle" "n")
+ (set_attr "atype" "reg,mem")])
+
+(define_insn "*divsf3"
+ [(set (match_operand:SF 0 "nonimmediate_operand" "=f,f")
+ (div:SF (match_operand:SF 1 "nonimmediate_operand" "0,0")
+ (match_operand:SF 2 "nonimmediate_operand" "f,m")))
+ (clobber (reg:CC 33))]
+ "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
+ "@
+ der\\t%0,%2
+ de\\t%0,%2"
+ [(set_attr "op_type" "RR,RX")
+ (set_attr "cycle" "n")
+ (set_attr "atype" "reg,mem")])
+
+
+;;
+;;- And instructions.
+;;
+
+;
+; anddi3 instruction pattern(s).
+;
+
+(define_insn "*anddi3_cc"
+ [(set (reg 33)
+ (compare (and:DI (match_operand:DI 1 "r_or_s_operand" "%0,0,0")
+ (match_operand:DI 2 "r_or_s_operand" "d,m,Q"))
+ (const_int 0)))
+ (set (match_operand:DI 0 "r_or_s_operand" "=d,d,Q")
+ (and:DI (match_dup 1) (match_dup 2)))]
+ "s390_match_ccmode(insn, CCTmode) && TARGET_64BIT"
+ "@
+ ngr\\t%0,%2
+ ng\\t%0,%2
+ nc\\t%O0(8,%R0),%2"
+ [(set_attr "op_type" "RR,RX,SS")
+ (set_attr "atype" "reg,mem,mem")
+ (set_attr "type" "set")])
+
+(define_insn "*anddi3_cconly"
+ [(set (reg 33)
+ (compare (and:DI (match_operand:DI 1 "register_operand" "%0,0")
+ (match_operand:DI 2 "r_or_s_operand" "d,m"))
+ (const_int 0)))
+ (clobber (match_scratch:DI 0 "=d,d"))]
+ "s390_match_ccmode(insn, CCTmode) && TARGET_64BIT"
+ "@
+ ngr\\t%0,%2
+ ng\\t%0,%2"
+ [(set_attr "op_type" "RR,RX")
+ (set_attr "atype" "reg,mem")
+ (set_attr "type" "set")])
+
+(define_insn "anddi3"
+ [(set (match_operand:DI 0 "r_or_s_operand" "=d,d,Q")
+ (and:DI (match_operand:DI 1 "r_or_s_operand" "%0,0,0")
+ (match_operand:DI 2 "r_or_s_operand" "d,m,Q")))
+ (clobber (reg:CC 33))]
+ "TARGET_64BIT"
+ "@
+ ngr\\t%0,%2
+ ng\\t%0,%2
+ nc\\t%O0(8,%R0),%2"
+ [(set_attr "op_type" "RR,RX,SS")
+ (set_attr "atype" "reg,mem,mem")
+ (set_attr "type" "set")])
+
+;
+; andsi3 instruction pattern(s).
+;
+
+(define_insn "*andsi3_cc"
+ [(set (reg 33)
+ (compare (and:SI (match_operand:SI 1 "r_or_s_operand" "%0,0,0")
+ (match_operand:SI 2 "r_or_s_operand" "d,m,Q"))
+ (const_int 0)))
+ (set (match_operand:SI 0 "r_or_s_operand" "=d,d,Q")
+ (and:SI (match_dup 1) (match_dup 2)))]
+ "s390_match_ccmode(insn, CCTmode)"
+ "@
+ nr\\t%0,%2
+ n\\t%0,%2
+ nc\\t%O0(4,%R0),%2"
+ [(set_attr "op_type" "RR,RX,SS")
+ (set_attr "atype" "reg,mem,mem")
+ (set_attr "type" "set")])
+
+(define_insn "*andsi3_cconly"
+ [(set (reg 33)
+ (compare (and:SI (match_operand:SI 1 "register_operand" "%0,0")
+ (match_operand:SI 2 "r_or_s_operand" "d,m"))
+ (const_int 0)))
+ (clobber (match_scratch:SI 0 "=d,d"))]
+ "s390_match_ccmode(insn, CCTmode)"
+ "@
+ nr\\t%0,%2
+ n\\t%0,%2"
+ [(set_attr "op_type" "RR,RX")
+ (set_attr "atype" "reg,mem")
+ (set_attr "type" "set")])
+
+(define_insn "andsi3"
+ [(set (match_operand:SI 0 "r_or_s_operand" "=d,d,Q")
+ (and:SI (match_operand:SI 1 "r_or_s_operand" "%0,0,0")
+ (match_operand:SI 2 "r_or_s_operand" "d,m,Q")))
+ (clobber (reg:CC 33))]
+ ""
+ "@
+ nr\\t%0,%2
+ n\\t%0,%2
+ nc\\t%O0(4,%R0),%2"
+ [(set_attr "op_type" "RR,RX,SS")
+ (set_attr "atype" "reg,mem,mem")
+ (set_attr "type" "set")])
+
+;
+; andhi3 instruction pattern(s).
+;
+
+(define_expand "andhi3"
+ [(parallel
+ [(set (match_operand:HI 0 "r_or_s_operand" "")
+ (and:HI (match_operand:HI 1 "r_or_s_operand" "")
+ (match_operand:HI 2 "r_or_s_operand" "")))
+ (clobber (reg:CC 33))])]
+ ""
+ "
+{
+ if (CONSTANT_P (operands[2]))
+ operands[2] = force_const_mem (HImode, operands[2]);
+}")
+
+(define_insn "*andhi3"
+ [(set (match_operand:HI 0 "r_or_s_operand" "=d,Q")
+ (and:HI (match_operand:HI 1 "r_or_s_operand" "%0,0")
+ (match_operand:HI 2 "r_or_s_operand" "d,Q")))
+ (clobber (reg:CC 33))]
+ ""
+ "@
+ nr\\t%0,%2
+ nc\\t%O0(2,%R0),%2"
+ [(set_attr "op_type" "RR,SS")
+ (set_attr "atype" "reg,mem")])
+
+;
+; andqi3 instruction pattern(s).
+;
+
+(define_insn "andqi3"
+ [(set (match_operand:QI 0 "r_or_s_operand" "=d,Q,Q")
+ (and:QI (match_operand:QI 1 "r_or_s_operand" "%0,0,0")
+ (match_operand:QI 2 "r_or_s_or_im8_operand" "d,n,Q")))
+ (clobber (reg:CC 33))]
+ ""
+ "@
+ nr\\t%0,%2
+ ni\\t%0,%b2
+ nc\\t%O0(1,%R0),%2"
+ [(set_attr "op_type" "RR,SI,SS")
+ (set_attr "atype" "reg,mem,mem")])
+
+
+;;
+;;- Bit set (inclusive or) instructions.
+;;
+
+;
+; iordi3 instruction pattern(s).
+;
+
+(define_insn "iordi3"
+ [(set (match_operand:DI 0 "r_or_s_operand" "=d,d,Q,d")
+ (ior:DI (match_operand:DI 1 "r_or_s_operand" "%0,0,0,0")
+ (match_operand:DI 2 "r_or_s_operand" "d,m,Q,L")))
+ (clobber (reg:CC 33))]
+ "TARGET_64BIT"
+ "@
+ ogr\\t%0,%2
+ og\\t%0,%2
+ oc\\t%O0(8,%R0),%2
+ oill\\t%0,%2"
+ [(set_attr "op_type" "RRE,RXE,SS,RI")
+ (set_attr "atype" "reg,mem,mem,reg")
+ (set_attr "type" "set")])
+
+;
+; iorsi3 instruction pattern(s).
+;
+
+(define_expand "iorsi3"
+ [(parallel
+ [(set (match_operand:SI 0 "r_or_s_operand" "")
+ (ior:SI (match_operand:SI 1 "r_or_s_operand" "")
+ (match_operand:SI 2 "r_or_s_operand" "")))
+ (clobber (reg:CC 33))])]
+ ""
+ "
+{
+ if (CONSTANT_P (operands[2]))
+ operands[2] = force_const_mem (SImode, operands[2]);
+}")
+
+(define_insn "*iorsi3"
+ [(set (match_operand:SI 0 "r_or_s_operand" "=d,d,Q")
+ (ior:SI (match_operand:SI 1 "r_or_s_operand" "%0,0,0")
+ (match_operand:SI 2 "r_or_s_operand" "d,m,Q")))
+ (clobber (reg:CC 33))]
+ ""
+ "@
+ or\\t%0,%2
+ o\\t%0,%2
+ oc\\t%O0(4,%R0),%2"
+ [(set_attr "op_type" "RR,RX,SS")
+ (set_attr "atype" "reg,mem,mem")
+ (set_attr "type" "set")])
+
+;
+; iorhi3 instruction pattern(s).
+;
+
+(define_expand "iorhi3"
+ [(parallel
+ [(set (match_operand:HI 0 "r_or_s_operand" "")
+ (ior:HI (match_operand:HI 1 "r_or_s_operand" "")
+ (match_operand:HI 2 "r_or_s_operand" "")))
+ (clobber (reg:CC 33))])]
+ ""
+ "
+{
+ if (CONSTANT_P (operands[2]))
+ operands[2] = force_const_mem (HImode, operands[2]);
+}")
+
+(define_insn "*iorhi3"
+ [(set (match_operand:HI 0 "r_or_s_operand" "=d,Q")
+ (ior:HI (match_operand:HI 1 "r_or_s_operand" "%0,0")
+ (match_operand:HI 2 "r_or_s_operand" "d,Q")))
+ (clobber (reg:CC 33))]
+ ""
+ "@
+ or\\t%0,%2
+ oc\\t%O0(2,%R0),%2"
+ [(set_attr "op_type" "RR,SS")
+ (set_attr "atype" "reg,mem")])
+
+;
+; iorqi3 instruction pattern(s).
+;
+
+(define_insn "iorqi3"
+ [(set (match_operand:QI 0 "r_or_s_operand" "=d,Q,Q")
+ (ior:QI (match_operand:QI 1 "r_or_s_operand" "%0,0,0")
+ (match_operand:QI 2 "r_or_s_or_im8_operand" "d,n,Q")))
+ (clobber (reg:CC 33))]
+ ""
+ "@
+ or\\t%0,%2
+ oi\\t%0,%b2
+ oc\\t%O0(1,%R0),%2"
+ [(set_attr "op_type" "RR,SI,SS")
+ (set_attr "atype" "reg,mem,mem")])
+
+
+;;
+;;- Xor instructions.
+;;
+
+;
+; xordi3 instruction pattern(s).
+;
+
+(define_insn "xordi3"
+ [(set (match_operand:DI 0 "r_or_s_operand" "=d,d,Q")
+ (xor:DI (match_operand:DI 1 "r_or_s_operand" "%0,0,0")
+ (match_operand:DI 2 "r_or_s_operand" "d,m,Q")))
+ (clobber (reg:CC 33))]
+ "TARGET_64BIT"
+ "@
+ xgr\\t%0,%2
+ xg\\t%0,%2
+ xc\\t%O0(8,%R0),%2"
+ [(set_attr "op_type" "RRE,RXE,SS")
+ (set_attr "atype" "reg,mem,mem")
+ (set_attr "type" "set")])
+
+;
+; xorsi3 instruction pattern(s).
+;
+
+(define_expand "xorsi3"
+ [(parallel
+ [(set (match_operand:SI 0 "r_or_s_operand" "")
+ (xor:SI (match_operand:SI 1 "r_or_s_operand" "")
+ (match_operand:SI 2 "r_or_s_operand" "")))
+ (clobber (reg:CC 33))])]
+ ""
+ "
+{
+ if (CONSTANT_P (operands[2]))
+ operands[2] = force_const_mem (SImode, operands[2]);
+}")
+
+(define_insn "*xorsi3"
+ [(set (match_operand:SI 0 "r_or_s_operand" "=d,d,Q")
+ (xor:SI (match_operand:SI 1 "r_or_s_operand" "%0,0,0")
+ (match_operand:SI 2 "r_or_s_operand" "d,m,Q")))
+ (clobber (reg:CC 33))]
+ ""
+ "@
+ xr\\t%0,%2
+ x\\t%0,%2
+ xc\\t%O0(4,%R0),%2"
+ [(set_attr "op_type" "RR,RX,SS")
+ (set_attr "atype" "reg,mem,mem")
+ (set_attr "type" "set")])
+
+;
+; xorhi3 instruction pattern(s).
+;
+
+(define_expand "xorhi3"
+ [(parallel
+ [(set (match_operand:HI 0 "r_or_s_operand" "")
+ (xor:HI (match_operand:HI 1 "r_or_s_operand" "")
+ (match_operand:HI 2 "r_or_s_operand" "")))
+ (clobber (reg:CC 33))])]
+ ""
+ "
+{
+ if (CONSTANT_P (operands[2]))
+ operands[2] = force_const_mem (HImode, operands[2]);
+}")
+
+(define_insn "*xorhi3"
+ [(set (match_operand:HI 0 "r_or_s_operand" "=d,Q")
+ (xor:HI (match_operand:HI 1 "r_or_s_operand" "%0,0")
+ (match_operand:HI 2 "r_or_s_operand" "d,Q")))
+ (clobber (reg:CC 33))]
+ ""
+ "@
+ xr\\t%0,%2
+ xc\\t%O0(2,%R0),%2"
+ [(set_attr "op_type" "RR,SS")
+ (set_attr "atype" "reg,mem")])
+
+;
+; xorqi3 instruction pattern(s).
+;
+
+(define_insn "xorqi3"
+ [(set (match_operand:QI 0 "r_or_s_operand" "=d,Q,Q")
+ (xor:QI (match_operand:QI 1 "r_or_s_operand" "0,0,0")
+ (match_operand:QI 2 "r_or_s_or_im8_operand" "d,n,Q")))
+ (clobber (reg:CC 33))]
+ ""
+ "@
+ xr\\t%0,%2
+ xi\\t%0,%b2
+ xc\\t%O0(1,%R0),%2"
+ [(set_attr "op_type" "RR,SI,SS")
+ (set_attr "atype" "reg,mem,mem")])
+
+
+;;
+;;- Negate instructions.
+;;
+
+;
+; negdi2 instruction pattern(s).
+;
+
+(define_expand "negdi2"
+ [(parallel
+ [(set (match_operand:DI 0 "register_operand" "=d")
+ (neg:DI (match_operand:DI 1 "register_operand" "d")))
+ (clobber (reg:CC 33))])]
+ ""
+ "")
+
+(define_insn "*negdi2_64"
+ [(set (match_operand:DI 0 "register_operand" "=d")
+ (neg:DI (match_operand:DI 1 "register_operand" "d")))
+ (clobber (reg:CC 33))]
+ "TARGET_64BIT"
+ "lcgr\\t%0,%1"
+ [(set_attr "op_type" "RR")
+ (set_attr "type" "set")])
+
+(define_insn "*negdi2_31"
+ [(set (match_operand:DI 0 "register_operand" "=d")
+ (neg:DI (match_operand:DI 1 "register_operand" "d")))
+ (clobber (reg:CC 33))]
+ "!TARGET_64BIT"
+ "*
+{
+ rtx xop[1];
+ xop[0] = gen_label_rtx ();
+ output_asm_insn (\"lcr\\t%0,%1\", operands);
+ output_asm_insn (\"lcr\\t%N0,%N1\", operands);
+ output_asm_insn (\"je\\t%l0\", xop);
+ output_asm_insn (\"bctr\\t%0,0\", operands);
+ ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\",
+ CODE_LABEL_NUMBER (xop[0]));
+ return \"\";
+}"
+ [(set_attr "op_type" "NN")
+ (set_attr "length" "10")])
+
+;
+; negsi2 instruction pattern(s).
+;
+
+(define_insn "negsi2"
+ [(set (match_operand:SI 0 "register_operand" "=d")
+ (neg:SI (match_operand:SI 1 "register_operand" "d")))
+ (clobber (reg:CC 33))]
+ ""
+ "lcr\\t%0,%1"
+ [(set_attr "op_type" "RR")
+ (set_attr "type" "set")])
+
+;
+; negdf2 instruction pattern(s).
+;
+
+(define_expand "negdf2"
+ [(parallel
+ [(set (match_operand:DF 0 "register_operand" "=f")
+ (neg:DF (match_operand:DF 1 "register_operand" "f")))
+ (clobber (reg:CC 33))])]
+ "TARGET_HARD_FLOAT"
+ "")
+
+(define_insn "*negdf2"
+ [(set (match_operand:DF 0 "register_operand" "=f")
+ (neg:DF (match_operand:DF 1 "register_operand" "f")))
+ (clobber (reg:CC 33))]
+ "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
+ "lcdbr\\t%0,%1"
+ [(set_attr "op_type" "RR")])
+
+(define_insn "*negdf2_ibm"
+ [(set (match_operand:DF 0 "register_operand" "=f")
+ (neg:DF (match_operand:DF 1 "register_operand" "f")))
+ (clobber (reg:CC 33))]
+ "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
+ "lcdr\\t%0,%1"
+ [(set_attr "op_type" "RR")])
+
+;
+; negsf2 instruction pattern(s).
+;
+
+(define_expand "negsf2"
+ [(parallel
+ [(set (match_operand:SF 0 "register_operand" "=f")
+ (neg:SF (match_operand:SF 1 "register_operand" "f")))
+ (clobber (reg:CC 33))])]
+ "TARGET_HARD_FLOAT"
+ "")
+
+(define_insn "*negsf2"
+ [(set (match_operand:SF 0 "register_operand" "=f")
+ (neg:SF (match_operand:SF 1 "register_operand" "f")))
+ (clobber (reg:CC 33))]
+ "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
+ "lcebr\\t%0,%1"
+ [(set_attr "op_type" "RR")])
+
+(define_insn "*negsf2"
+ [(set (match_operand:SF 0 "register_operand" "=f")
+ (neg:SF (match_operand:SF 1 "register_operand" "f")))
+ (clobber (reg:CC 33))]
+ "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
+ "lcer\\t%0,%1"
+ [(set_attr "op_type" "RR")])
+
+
+;;
+;;- Absolute value instructions.
+;;
+
+;
+; absdi2 instruction pattern(s).
+;
+
+(define_insn "absdi2"
+ [(set (match_operand:DI 0 "register_operand" "=d")
+ (abs:DI (match_operand:DI 1 "register_operand" "d")))
+ (clobber (reg:CC 33))]
+ "TARGET_64BIT"
+ "lpgr\\t%0,%1"
+ [(set_attr "op_type" "RRE")
+ (set_attr "type" "set")])
+
+;
+; abssi2 instruction pattern(s).
+;
+
+(define_insn "abssi2"
+ [(set (match_operand:SI 0 "register_operand" "=d")
+ (abs:SI (match_operand:SI 1 "register_operand" "d")))
+ (clobber (reg:CC 33))]
+ ""
+ "lpr\\t%0,%1"
+ [(set_attr "op_type" "RR")
+ (set_attr "type" "set")])
+
+;
+; abshi2 instruction pattern(s).
+;
+
+(define_insn "abshi2"
+ [(set (match_operand:HI 0 "register_operand" "=d")
+ (abs:HI (match_operand:HI 1 "register_operand" "d")))
+ (clobber (reg:CC 33))]
+ ""
+ "sll\\t%1,16\;sra\\t%1,16\;lpr\\t%0,%1"
+ [(set_attr "op_type" "NN")
+ (set_attr "cycle" "3")
+ (set_attr "length" "10")])
+
+;
+; absdf2 instruction pattern(s).
+;
+
+(define_expand "absdf2"
+ [(parallel
+ [(set (match_operand:DF 0 "register_operand" "=f")
+ (abs:DF (match_operand:DF 1 "register_operand" "f")))
+ (clobber (reg:CC 33))])]
+ "TARGET_HARD_FLOAT"
+ "")
+
+(define_insn "*absdf2"
+ [(set (match_operand:DF 0 "register_operand" "=f")
+ (abs:DF (match_operand:DF 1 "register_operand" "f")))
+ (clobber (reg:CC 33))]
+ "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
+ "lpdbr\\t%0,%1"
+ [(set_attr "op_type" "RR")])
+
+(define_insn "*absdf2_ibm"
+ [(set (match_operand:DF 0 "register_operand" "=f")
+ (abs:DF (match_operand:DF 1 "register_operand" "f")))
+ (clobber (reg:CC 33))]
+ "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
+ "lpdr\\t%0,%1"
+ [(set_attr "op_type" "RR")])
+
+;
+; abssf2 instruction pattern(s).
+;
+
+(define_expand "abssf2"
+ [(parallel
+ [(set (match_operand:SF 0 "register_operand" "=f")
+ (abs:SF (match_operand:SF 1 "register_operand" "f")))
+ (clobber (reg:CC 33))])]
+ "TARGET_HARD_FLOAT"
+ "")
+
+(define_insn "*abssf2"
+ [(set (match_operand:SF 0 "register_operand" "=f")
+ (abs:SF (match_operand:SF 1 "register_operand" "f")))
+ (clobber (reg:CC 33))]
+ "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
+ "lpebr\\t%0,%1"
+ [(set_attr "op_type" "RR")])
+
+(define_insn "*abssf2_ibm"
+ [(set (match_operand:SF 0 "register_operand" "=f")
+ (abs:SF (match_operand:SF 1 "register_operand" "f")))
+ (clobber (reg:CC 33))]
+ "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
+ "lper\\t%0,%1"
+ [(set_attr "op_type" "RR")])
+
+
+;;
+;;- One complement instructions.
+;;
+
+;
+; one_cmpldi2 instruction pattern(s).
+;
+
+(define_expand "one_cmpldi2"
+ [(parallel
+ [(set (match_operand:DI 0 "r_or_s_operand" "=d")
+ (not:DI (match_operand:DI 1 "r_or_s_operand" "0")))
+ (use (match_dup 2))
+ (clobber (reg:CC 33))])]
+ "TARGET_64BIT"
+ "{ operands[2] = force_const_mem (DImode, constm1_rtx); }")
+
+(define_insn "*one_cmpldi2"
+ [(set (match_operand:DI 0 "r_or_s_operand" "=d,Q")
+ (not:DI (match_operand:DI 1 "r_or_s_operand" "0,0")))
+ (use (match_operand:DI 2 "memory_operand" "m,m"))
+ (clobber (reg:CC 33))]
+ ""
+ "@
+ xg\\t%0,%2
+ xc\\t%O0(8,%R0),%2"
+ [(set_attr "op_type" "RR,SS")
+ (set_attr "atype" "mem")])
+
+;
+; one_cmplsi2 instruction pattern(s).
+;
+
+(define_expand "one_cmplsi2"
+ [(parallel
+ [(set (match_operand:SI 0 "r_or_s_operand" "=d")
+ (not:SI (match_operand:SI 1 "r_or_s_operand" "0")))
+ (use (match_dup 2))
+ (clobber (reg:CC 33))])]
+ ""
+ "{ operands[2] = force_const_mem (SImode, constm1_rtx); }")
+
+(define_insn "*one_cmplsi2"
+ [(set (match_operand:SI 0 "r_or_s_operand" "=d,Q")
+ (not:SI (match_operand:SI 1 "r_or_s_operand" "0,0")))
+ (use (match_operand:SI 2 "memory_operand" "m,m"))
+ (clobber (reg:CC 33))]
+ ""
+ "@
+ x\\t%0,%2
+ xc\\t%O0(4,%R0),%2"
+ [(set_attr "op_type" "RR,SS")
+ (set_attr "atype" "mem")])
+
+;
+; one_cmplhi2 instruction pattern(s).
+;
+
+(define_expand "one_cmplhi2"
+ [(parallel
+ [(set (match_operand:HI 0 "r_or_s_operand" "=d")
+ (not:HI (match_operand:HI 1 "r_or_s_operand" "0")))
+ (use (match_dup 2))
+ (clobber (reg:CC 33))])]
+ ""
+ "{ operands[2] = force_const_mem (SImode, constm1_rtx); }")
+
+(define_insn "*one_cmplhi2"
+ [(set (match_operand:HI 0 "r_or_s_operand" "=d,Q")
+ (not:HI (match_operand:HI 1 "r_or_s_operand" "0,0")))
+ (use (match_operand:SI 2 "memory_operand" "m,m"))
+ (clobber (reg:CC 33))]
+ ""
+ "@
+ x\\t%0,%2
+ xc\\t%O0(2,%R0),%2"
+ [(set_attr "op_type" "RX,SS")
+ (set_attr "atype" "mem")])
+
+;
+; one_cmplqi2 instruction pattern(s).
+;
+
+(define_insn "one_cmpqi2"
+ [(set (match_operand:QI 0 "memory_operand" "=Q")
+ (not:QI (match_operand:QI 1 "memory_operand" "0")))
+ (clobber (reg:CC 33))]
+ ""
+ "xi\\t%0,255"
+ [(set_attr "op_type" "SI")])
+
+
+;;
+;;- Rotate instructions.
+;;
+
+;
+; rotldi3 instruction pattern(s).
+;
+
+(define_insn "rotldi3"
+ [(set (match_operand:DI 0 "register_operand" "=d,d")
+ (rotate:DI (match_operand:DI 1 "register_operand" "d,d")
+ (match_operand:DI 2 "nonmemory_operand" "J,a")))
+ (clobber (reg:CC 33))]
+ "TARGET_64BIT"
+ "@
+ rllg\\t%0,%1,%c2
+ rllg\\t%0,%1,0(%2)"
+ [(set_attr "op_type" "RSE")
+ (set_attr "type" "set")])
+
+;
+; rotlsi3 instruction pattern(s).
+;
+
+(define_insn "rotlsi3"
+ [(set (match_operand:SI 0 "register_operand" "=d,d")
+ (rotate:SI (match_operand:SI 1 "register_operand" "d,d")
+ (match_operand:SI 2 "nonmemory_operand" "J,a")))
+ (clobber (reg:CC 33))]
+ "TARGET_64BIT"
+ "@
+ rll\\t%0,%1,%c2
+ rll\\t%0,%1,0(%2)"
+ [(set_attr "op_type" "RSE")
+ (set_attr "type" "set")])
+
+
+;;
+;;- Arithmetic shift instructions.
+;;
+;; for left shifts always setal shifts are used (ANSI-C)
+
+;
+; ashldi3 instruction pattern(s).
+;
+
+(define_expand "ashldi3"
+ [(parallel
+ [(set (match_operand:DI 0 "register_operand" "")
+ (ashift:DI (match_operand:DI 1 "register_operand" "")
+ (match_operand:SI 2 "nonmemory_operand" "")))
+ (clobber (reg:CC 33))])]
+ ""
+ "")
+
+(define_insn "*ashldi3_31"
+ [(set (match_operand:DI 0 "register_operand" "=d,d")
+ (ashift:DI (match_operand:DI 1 "register_operand" "0,0")
+ (match_operand:SI 2 "nonmemory_operand" "J,a")))
+ (clobber (reg:CC 33))]
+ "!TARGET_64BIT"
+ "@
+ sldl\\t%0,%c2
+ sldl\\t%0,0(%2)"
+ [(set_attr "op_type" "RS")
+ (set_attr "type" "set")])
+
+(define_insn "*ashldi3_64"
+ [(set (match_operand:DI 0 "register_operand" "=d,d")
+ (ashift:DI (match_operand:DI 1 "register_operand" "d,d")
+ (match_operand:SI 2 "nonmemory_operand" "J,a")))
+ (clobber (reg:CC 33))]
+ "TARGET_64BIT"
+ "@
+ sllg\\t%0,%1,%2
+ sllg\\t%0,%1,0(%2)"
+ [(set_attr "op_type" "RSE")
+ (set_attr "type" "set")])
+
+;
+; ashrdi3 instruction pattern(s).
+;
+
+(define_expand "ashrdi3"
+ [(parallel
+ [(set (match_operand:DI 0 "register_operand" "")
+ (ashiftrt:DI (match_operand:DI 1 "register_operand" "")
+ (match_operand:SI 2 "nonmemory_operand" "")))
+ (clobber (reg:CC 33))])]
+ ""
+ "")
+
+(define_insn "*ashrdi3_31"
+ [(set (match_operand:DI 0 "register_operand" "=d,d")
+ (ashiftrt:DI (match_operand:DI 1 "register_operand" "0,0")
+ (match_operand:SI 2 "nonmemory_operand" "J,a")))
+ (clobber (reg:CC 33))]
+ "!TARGET_64BIT"
+ "@
+ srda\\t%0,%c2
+ srda\\t%0,0(%2)"
+ [(set_attr "op_type" "RS")])
+
+(define_insn "*ashrdi3_64"
+ [(set (match_operand:DI 0 "register_operand" "=d,d")
+ (ashiftrt:DI (match_operand:DI 1 "register_operand" "d,d")
+ (match_operand:SI 2 "nonmemory_operand" "J,a")))
+ (clobber (reg:CC 33))]
+ "TARGET_64BIT"
+ "@
+ srag\\t%0,%1,%c2
+ srag\\t%0,%1,0(%2)"
+ [(set_attr "op_type" "RSE")
+ (set_attr "type" "set")])
+
+;
+; ashlsi3 instruction pattern(s).
+;
+; all 32 bits has to be shifted (testcase co750c)
+
+(define_insn "ashlsi3"
+ [(set (match_operand:SI 0 "register_operand" "=d,d")
+ (ashift:SI (match_operand:SI 1 "register_operand" "0,0")
+ (match_operand:SI 2 "r_or_im8_operand" "J,a")))
+ (clobber (reg:CC 33))]
+ ""
+ "@
+ sll\\t%0,%c2
+ sll\\t%0,0(%2)"
+ [(set_attr "op_type" "RS")
+ (set_attr "type" "set")])
+
+;
+; ashrsi3 instruction pattern(s).
+;
+
+(define_insn "ashrsi3"
+ [(set (match_operand:SI 0 "register_operand" "=d,d")
+ (ashiftrt:SI (match_operand:SI 1 "register_operand" "0,0")
+ (match_operand:SI 2 "r_or_im8_operand" "J,a")))
+ (clobber (reg:CC 33))]
+ ""
+ "@
+ sra\\t%0,%c2
+ sra\\t%0,0(%2)"
+ [(set_attr "op_type" "RS")
+ (set_attr "type" "set")])
+
+;
+; ashlhi3 instruction pattern(s).
+;
+
+(define_insn "ashlhi3"
+ [(set (match_operand:HI 0 "register_operand" "=d,d")
+ (ashift:HI (match_operand:HI 1 "register_operand" "0,0")
+ (match_operand:SI 2 "r_or_im8_operand" "J,a")))
+ (clobber (reg:CC 33))]
+ ""
+ "@
+ sll\\t%0,%c2
+ sll\\t%0,0(%2)"
+ [(set_attr "op_type" "RS,RS")])
+
+;
+; ashrhi3 instruction pattern(s).
+;
+
+(define_insn "ashrhi3"
+ [(set (match_operand:HI 0 "register_operand" "=d,d")
+ (ashiftrt:HI (match_operand:HI 1 "register_operand" "0,0")
+ (match_operand:SI 2 "r_or_im8_operand" "J,a")))
+ (clobber (reg:CC 33))]
+ ""
+ "@
+ sll\\t%0,16\;sra\\t%0,16+%c2
+ sll\\t%0,16\;sra\\t%0,16(%2)"
+ [(set_attr "op_type" "NN,NN")
+ (set_attr "length" "8,8")])
+
+
+;;
+;;- logical shift instructions.
+;;
+
+;
+; lshrdi3 instruction pattern(s).
+;
+
+(define_expand "lshrdi3"
+ [(parallel
+ [(set (match_operand:DI 0 "register_operand" "")
+ (lshiftrt:DI (match_operand:DI 1 "register_operand" "")
+ (match_operand:SI 2 "nonmemory_operand" "")))
+ (clobber (reg:CC 33))])]
+ ""
+ "")
+
+(define_insn "*lshrdi3_31"
+ [(set (match_operand:DI 0 "register_operand" "=d,d")
+ (lshiftrt:DI (match_operand:DI 1 "register_operand" "0,0")
+ (match_operand:SI 2 "nonmemory_operand" "J,a")))
+ (clobber (reg:CC 33))]
+ "!TARGET_64BIT"
+ "@
+ srdl\\t%0,%c2
+ srdl\\t%0,0(%2)"
+ [(set_attr "op_type" "RS,RS")])
+
+(define_insn "*lshrdi3_64"
+ [(set (match_operand:DI 0 "register_operand" "=d,d")
+ (lshiftrt:DI (match_operand:DI 1 "register_operand" "d,d")
+ (match_operand:SI 2 "nonmemory_operand" "J,a")))
+ (clobber (reg:CC 33))]
+ "TARGET_64BIT"
+ "@
+ srlg\\t%0,%1,%c2
+ srlg\\t%0,%1,0(%2)"
+ [(set_attr "op_type" "RS,RS")
+ (set_attr "type" "set")])
+
+;
+; lshrsi3 instruction pattern(s).
+;
+
+(define_insn "lshrsi3"
+ [(set (match_operand:SI 0 "register_operand" "=d,d")
+ (lshiftrt:SI (match_operand:SI 1 "register_operand" "0,0")
+ (match_operand:SI 2 "r_or_im8_operand" "J,a")))
+ (clobber (reg:CC 33))]
+ ""
+ "@
+ srl\\t%0,%c2
+ srl\\t%0,0(%2)"
+ [(set_attr "op_type" "RS")
+ (set_attr "type" "set")])
+
+;
+; lshrhi3 instruction pattern(s).
+;
+
+(define_insn "lshrhi3"
+ [(set (match_operand:HI 0 "register_operand" "=d,d")
+ (lshiftrt:HI (match_operand:HI 1 "register_operand" "0,0")
+ (match_operand:SI 2 "r_or_im8_operand" "J,a")))
+ (clobber (reg:CC 33))]
+ ""
+ "@
+ sll\\t%0,16\;srl\\t%0,16+%c2
+ sll\\t%0,16\;srl\\t%0,16(%2)"
+ [(set_attr "op_type" "NN,NN")
+ (set_attr "length" "8,8")])
+
+
+;;
+;; Branch instruction patterns.
+;;
+
+(define_expand "beq"
+ [(set (reg:CCZ 33) (compare:CCZ (match_dup 1) (match_dup 2)))
+ (set (pc)
+ (if_then_else (eq (reg:CCZ 33) (const_int 0))
+ (label_ref (match_operand 0 "" ""))
+ (pc)))]
+ ""
+ "{ operands[1] = s390_compare_op0; operands[2] = s390_compare_op1; }")
+
+(define_expand "bne"
+ [(set (reg:CCZ 33) (compare:CCZ (match_dup 1) (match_dup 2)))
+ (set (pc)
+ (if_then_else (ne (reg:CCZ 33) (const_int 0))
+ (label_ref (match_operand 0 "" ""))
+ (pc)))]
+ ""
+ "{ operands[1] = s390_compare_op0; operands[2] = s390_compare_op1; }")
+
+(define_expand "bgt"
+ [(set (reg:CCS 33) (compare:CCS (match_dup 1) (match_dup 2)))
+ (set (pc)
+ (if_then_else (gt (reg:CCS 33) (const_int 0))
+ (label_ref (match_operand 0 "" ""))
+ (pc)))]
+ ""
+ "{ operands[1] = s390_compare_op0; operands[2] = s390_compare_op1; }")
+
+(define_expand "bgtu"
+ [(set (reg:CCU 33) (compare:CCU (match_dup 1) (match_dup 2)))
+ (set (pc)
+ (if_then_else (gtu (reg:CCU 33) (const_int 0))
+ (label_ref (match_operand 0 "" ""))
+ (pc)))]
+ ""
+ "{ operands[1] = s390_compare_op0; operands[2] = s390_compare_op1; }")
+
+(define_expand "blt"
+ [(set (reg:CCS 33) (compare:CCS (match_dup 1) (match_dup 2)))
+ (set (pc)
+ (if_then_else (lt (reg:CCS 33) (const_int 0))
+ (label_ref (match_operand 0 "" ""))
+ (pc)))]
+ ""
+ "{ operands[1] = s390_compare_op0; operands[2] = s390_compare_op1; }")
+
+(define_expand "bltu"
+ [(set (reg:CCU 33) (compare:CCU (match_dup 1) (match_dup 2)))
+ (set (pc)
+ (if_then_else (ltu (reg:CCU 33) (const_int 0))
+ (label_ref (match_operand 0 "" ""))
+ (pc)))]
+ ""
+ "{ operands[1] = s390_compare_op0; operands[2] = s390_compare_op1; }")
+
+(define_expand "bge"
+ [(set (reg:CCS 33) (compare:CCS (match_dup 1) (match_dup 2)))
+ (set (pc)
+ (if_then_else (ge (reg:CCS 33) (const_int 0))
+ (label_ref (match_operand 0 "" ""))
+ (pc)))]
+ ""
+ "{ operands[1] = s390_compare_op0; operands[2] = s390_compare_op1; }")
+
+(define_expand "bgeu"
+ [(set (reg:CCU 33) (compare:CCU (match_dup 1) (match_dup 2)))
+ (set (pc)
+ (if_then_else (geu (reg:CCU 33) (const_int 0))
+ (label_ref (match_operand 0 "" ""))
+ (pc)))]
+ ""
+ "{ operands[1] = s390_compare_op0; operands[2] = s390_compare_op1; }")
+
+(define_expand "ble"
+ [(set (reg:CCS 33) (compare:CCS (match_dup 1) (match_dup 2)))
+ (set (pc)
+ (if_then_else (le (reg:CCS 33) (const_int 0))
+ (label_ref (match_operand 0 "" ""))
+ (pc)))]
+ ""
+ "{ operands[1] = s390_compare_op0; operands[2] = s390_compare_op1; }")
+
+(define_expand "bleu"
+ [(set (reg:CCU 33) (compare:CCU (match_dup 1) (match_dup 2)))
+ (set (pc)
+ (if_then_else (leu (reg:CCU 33) (const_int 0))
+ (label_ref (match_operand 0 "" ""))
+ (pc)))]
+ ""
+ "{ operands[1] = s390_compare_op0; operands[2] = s390_compare_op1; }")
+
+
+;;
+;;- Conditional jump instructions.
+;;
+
+(define_insn "cjump"
+ [(set (pc)
+ (if_then_else
+ (match_operator 1 "comparison_operator" [(reg 33) (const_int 0)])
+ (label_ref (match_operand 0 "" ""))
+ (pc)))]
+ ""
+ "*
+{
+ if (get_attr_length (insn) == 4 || !TARGET_64BIT)
+ return \"j%C1\\t%l0\";
+ else
+ return \"jg%C1\\t%l0\";
+}"
+ [(set_attr "op_type" "RI")
+ (set (attr "length") (if_then_else
+ (lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
+ (const_int 4) (const_int 6)))])
+
+(define_insn "*cjump_long"
+ [(set (pc)
+ (if_then_else
+ (match_operator 1 "comparison_operator" [(reg 33) (const_int 0)])
+ (match_operand 0 "address_operand" "p")
+ (pc)))]
+ ""
+ "*
+{
+ if (get_attr_op_type (insn) == OP_TYPE_RR)
+ return \"b%C1r\\t%0\";
+ else
+ return \"b%C1\\t%a0\";
+}"
+ [(set (attr "op_type")
+ (if_then_else (match_operand 0 "register_operand" "")
+ (const_string "RR") (const_string "RX")))
+ (set_attr "atype" "mem")])
+
+
+;;
+;;- Negated conditional jump instructions.
+;;
+
+(define_insn "icjump"
+ [(set (pc)
+ (if_then_else
+ (match_operator 1 "comparison_operator" [(reg 33) (const_int 0)])
+ (pc)
+ (label_ref (match_operand 0 "" ""))))]
+ ""
+ "*
+{
+ if (get_attr_length (insn) == 4 || !TARGET_64BIT)
+ return \"j%D1\\t%l0\";
+ else
+ return \"jg%D1\\t%l0\";
+}"
+ [(set_attr "op_type" "RI")
+ (set (attr "length") (if_then_else
+ (lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
+ (const_int 4) (const_int 6)))])
+
+(define_insn "*icjump_long"
+ [(set (pc)
+ (if_then_else
+ (match_operator 1 "comparison_operator" [(reg 33) (const_int 0)])
+ (pc)
+ (match_operand 0 "address_operand" "p")))]
+ ""
+ "*
+{
+ if (get_attr_op_type (insn) == OP_TYPE_RR)
+ return \"b%D1r\\t%0\";
+ else
+ return \"b%D1\\t%a0\";
+}"
+ [(set (attr "op_type")
+ (if_then_else (match_operand 0 "register_operand" "")
+ (const_string "RR") (const_string "RX")))
+ (set_attr "atype" "mem")])
+
+
+;;
+;;- Subtract one and jump if not zero.
+;;
+
+;(define_expand "decrement_and_branch_on_count"
+; [(use (match_operand 0 "register_operand" ""))
+; (use (label_ref (match_operand 1 "" "")))]
+; ""
+; "
+;{
+;/* if (TARGET_64BIT)
+; emit_jump_insn (gen_brctdi (operands[0], operands[1]));
+; else */
+; emit_jump_insn (gen_brctsi (operands[0], operands[1]));
+; DONE;
+;}")
+;
+;(define_insn "brctsi"
+; [(set (pc)
+; (if_then_else
+; (ne (match_operand:SI 0 "register_operand" "+a")
+; (const_int 1))
+; (label_ref (match_operand 1 "" ""))
+; (pc)))
+; (set (match_dup 0)
+; (plus:SI (match_dup 0) (const_int -1)))]
+; ""
+; "brct\\t%0,%l1"
+; [(set_attr "op_type" "RI")
+; (set_attr "type" "branch")]
+;)
+;
+;(define_insn "ibrctsi"
+; [(set (pc)
+; (if_then_else
+; (eq (match_operand:SI 0 "register_operand" "+a")
+; (const_int 1))
+; (pc)
+; (label_ref (match_operand 1 "" ""))))
+; (set (match_dup 0)
+; (plus:SI (match_dup 0) (const_int -1)))]
+; ""
+; "brct\\t%0,%l1"
+; [(set_attr "op_type" "RI")
+; (set_attr "type" "branch")]
+;)
+
+
+;;
+;;- Unconditional jump instructions.
+;;
+
+;
+; jump instruction pattern(s).
+;
+
+(define_insn "jump"
+ [(set (pc) (label_ref (match_operand 0 "" "")))]
+ ""
+ "*
+{
+ if (get_attr_length (insn) == 4 || !TARGET_64BIT)
+ return \"j\\t%l0\";
+ else
+ return \"jg\\t%l0\";
+}"
+ [(set_attr "op_type" "RI")
+ (set (attr "length") (if_then_else
+ (lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
+ (const_int 4) (const_int 6)))])
+
+;
+; indirect-jump instruction pattern(s).
+;
+
+(define_insn "indirect_jump"
+ [(set (pc) (match_operand 0 "address_operand" "p"))]
+ ""
+ "*
+{
+ if (get_attr_op_type (insn) == OP_TYPE_RR)
+ return \"br\\t%0\";
+ else
+ return \"b\\t%a0\";
+}"
+ [(set (attr "op_type")
+ (if_then_else (match_operand 0 "register_operand" "")
+ (const_string "RR") (const_string "RX")))
+ (set_attr "atype" "mem")])
+
+;
+; casesi instruction pattern(s).
+;
+
+(define_insn "casesi_jump"
+ [(set (pc) (match_operand 0 "address_operand" "p"))
+ (use (label_ref (match_operand 1 "" "")))]
+ ""
+ "*
+{
+ if (get_attr_op_type (insn) == OP_TYPE_RR)
+ return \"br\\t%0\";
+ else
+ return \"b\\t%a0\";
+}"
+ [(set (attr "op_type")
+ (if_then_else (match_operand 0 "register_operand" "")
+ (const_string "RR") (const_string "RX")))
+ (set_attr "atype" "mem")])
+
+(define_expand "casesi"
+ [(match_operand:SI 0 "general_operand" "")
+ (match_operand:SI 1 "general_operand" "")
+ (match_operand:SI 2 "general_operand" "")
+ (label_ref (match_operand 3 "" ""))
+ (label_ref (match_operand 4 "" ""))]
+ ""
+ "
+{
+ rtx index = gen_reg_rtx (SImode);
+ rtx base = gen_reg_rtx (Pmode);
+ rtx target = gen_reg_rtx (Pmode);
+
+ emit_move_insn (index, operands[0]);
+ emit_insn (gen_subsi3 (index, index, operands[1]));
+ emit_cmp_and_jump_insns (index, operands[2], GTU, NULL_RTX, SImode, 1,
+ 0, operands[4]);
+
+ if (Pmode != SImode)
+ index = convert_to_mode (Pmode, index, 1);
+ if (GET_CODE (index) != REG)
+ index = copy_to_mode_reg (Pmode, index);
+
+ if (TARGET_64BIT)
+ emit_insn (gen_ashldi3 (index, index, GEN_INT (3)));
+ else
+ emit_insn (gen_ashlsi3 (index, index, GEN_INT (2)));
+
+ emit_move_insn (base, gen_rtx_LABEL_REF (Pmode, operands[3]));
+
+ index = gen_rtx_MEM (Pmode, gen_rtx_PLUS (Pmode, base, index));
+ emit_move_insn (target, index);
+
+ if (flag_pic)
+ target = gen_rtx_PLUS (Pmode, base, target);
+ emit_jump_insn (gen_casesi_jump (target, operands[3]));
+
+ DONE;
+}")
+
+
+;;
+;;- Jump to subroutine.
+;;
+;;
+
+;
+; untyped call instruction pattern(s).
+;
+
+;; Call subroutine returning any type.
+(define_expand "untyped_call"
+ [(parallel [(call (match_operand 0 "" "")
+ (const_int 0))
+ (match_operand 1 "" "")
+ (match_operand 2 "" "")])]
+ ""
+ "
+{
+ int i;
+
+ emit_call_insn (gen_call (operands[0], const0_rtx, const0_rtx));
+
+ for (i = 0; i < XVECLEN (operands[2], 0); i++)
+ {
+ rtx set = XVECEXP (operands[2], 0, i);
+ emit_move_insn (SET_DEST (set), SET_SRC (set));
+ }
+
+ /* The optimizer does not know that the call sets the function value
+ registers we stored in the result block. We avoid problems by
+ claiming that all hard registers are used and clobbered at this
+ point. */
+ emit_insn (gen_blockage ());
+
+ DONE;
+}")
+
+;; UNSPEC_VOLATILE is considered to use and clobber all hard registers and
+;; all of memory. This blocks insns from being moved across this point.
+
+(define_insn "blockage"
+ [(unspec_volatile [(const_int 0)] 0)]
+ ""
+ "")
+
+
+;
+; call instruction pattern(s).
+;
+
+(define_expand "call"
+ [(parallel [(call (match_operand 0 "" "")
+ (match_operand 1 "" ""))
+ (clobber (match_operand 2 "" ""))])]
+ ""
+ "
+{
+ /* Abuse operand 2 to hold the return register. */
+ operands[2] = gen_rtx_REG (Pmode, RETURN_REGNUM);
+
+ /* In 31-bit, we must load the GOT register even if the
+ compiler doesn't know about it, because the PLT glue
+ code uses it. In 64-bit, this is not necessary. */
+ if (flag_pic && !TARGET_64BIT)
+ current_function_uses_pic_offset_table = 1;
+
+ /* Direct function calls need special treatment. */
+ if (GET_CODE (XEXP (operands[0], 0)) == SYMBOL_REF)
+ {
+ rtx sym = XEXP (operands[0], 0);
+
+ /* When calling a global routine in PIC mode, we must
+ replace the symbol itself with the PLT stub. */
+ if (flag_pic && !SYMBOL_REF_FLAG(sym))
+ {
+ sym = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, sym), 113);
+ sym = gen_rtx_CONST (Pmode, sym);
+ }
+
+ /* Unless we can use the bras(l) insn, force the
+ routine address into a register. */
+ if (!TARGET_SMALL_EXEC && !TARGET_64BIT)
+ {
+ rtx target = gen_reg_rtx (Pmode);
+ emit_move_insn (target, sym);
+ sym = target;
+ }
+
+ operands[0] = gen_rtx_MEM (QImode, sym);
+ }
+}")
+
+(define_insn "brasl"
+ [(call (mem:QI (match_operand:DI 0 "bras_sym_operand" "X"))
+ (match_operand:SI 1 "const_int_operand" "n"))
+ (clobber (match_operand:DI 2 "register_operand" "=r"))]
+ "TARGET_64BIT"
+ "brasl\\t%2,%0"
+ [(set_attr "op_type" "RIL")
+ (set_attr "cycle" "n")])
+
+(define_insn "bras"
+ [(call (mem:QI (match_operand:SI 0 "bras_sym_operand" "X"))
+ (match_operand:SI 1 "const_int_operand" "n"))
+ (clobber (match_operand:SI 2 "register_operand" "=r"))]
+ "TARGET_SMALL_EXEC"
+ "bras\\t%2,%0"
+ [(set_attr "op_type" "RI")
+ (set_attr "cycle" "n")])
+
+(define_insn "basr_64"
+ [(call (mem:QI (match_operand:DI 0 "register_operand" "a"))
+ (match_operand:SI 1 "const_int_operand" "n"))
+ (clobber (match_operand:DI 2 "register_operand" "=r"))]
+ "TARGET_64BIT"
+ "basr\\t%2,%0"
+ [(set_attr "op_type" "RR")
+ (set_attr "cycle" "n")
+ (set_attr "atype" "mem")])
+
+(define_insn "basr_31"
+ [(call (mem:QI (match_operand:SI 0 "register_operand" "a"))
+ (match_operand:SI 1 "const_int_operand" "n"))
+ (clobber (match_operand:SI 2 "register_operand" "=r"))]
+ "!TARGET_64BIT"
+ "basr\\t%2,%0"
+ [(set_attr "op_type" "RR")
+ (set_attr "cycle" "n")
+ (set_attr "atype" "mem")])
+
+(define_insn "bas_64"
+ [(call (mem:QI (match_operand:QI 0 "address_operand" "p"))
+ (match_operand:SI 1 "const_int_operand" "n"))
+ (clobber (match_operand:DI 2 "register_operand" "=r"))]
+ "TARGET_64BIT"
+ "bas\\t%2,%a0"
+ [(set_attr "op_type" "RX")
+ (set_attr "cycle" "n")
+ (set_attr "atype" "mem")])
+
+(define_insn "bas_31"
+ [(call (mem:QI (match_operand:QI 0 "address_operand" "p"))
+ (match_operand:SI 1 "const_int_operand" "n"))
+ (clobber (match_operand:SI 2 "register_operand" "=r"))]
+ "!TARGET_64BIT"
+ "bas\\t%2,%a0"
+ [(set_attr "op_type" "RX")
+ (set_attr "cycle" "n")
+ (set_attr "atype" "mem")])
+
+
+;
+; call_value instruction pattern(s).
+;
+
+(define_expand "call_value"
+ [(parallel [(set (match_operand 0 "" "")
+ (call (match_operand 1 "" "")
+ (match_operand 2 "" "")))
+ (clobber (match_operand 3 "" ""))])]
+ ""
+ "
+{
+ /* Abuse operand 3 to hold the return register. */
+ operands[3] = gen_rtx_REG (Pmode, RETURN_REGNUM);
+
+ /* In 31-bit, we must load the GOT register even if the
+ compiler doesn't know about it, because the PLT glue
+ code uses it. In 64-bit, this is not necessary. */
+ if (flag_pic && !TARGET_64BIT)
+ current_function_uses_pic_offset_table = 1;
+
+ /* Direct function calls need special treatment. */
+ if (GET_CODE (XEXP (operands[1], 0)) == SYMBOL_REF)
+ {
+ rtx sym = XEXP (operands[1], 0);
+
+ /* When calling a global routine in PIC mode, we must
+ replace the symbol itself with the PLT stub. */
+ if (flag_pic && !SYMBOL_REF_FLAG(sym))
+ {
+ sym = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, sym), 113);
+ sym = gen_rtx_CONST (Pmode, sym);
+ }
+
+ /* Unless we can use the bras(l) insn, force the
+ routine address into a register. */
+ if (!TARGET_SMALL_EXEC && !TARGET_64BIT)
+ {
+ rtx target = gen_reg_rtx (Pmode);
+ emit_move_insn (target, sym);
+ sym = target;
+ }
+
+ operands[1] = gen_rtx_MEM (QImode, sym);
+ }
+}")
+
+(define_insn "brasl_r"
+ [(set (match_operand 0 "register_operand" "=df")
+ (call (mem:QI (match_operand:DI 1 "bras_sym_operand" "X"))
+ (match_operand:SI 2 "const_int_operand" "n")))
+ (clobber (match_operand:DI 3 "register_operand" "=r"))]
+ "TARGET_64BIT"
+ "brasl\\t%3,%1"
+ [(set_attr "op_type" "RIL")
+ (set_attr "cycle" "n")])
+
+(define_insn "bras_r"
+ [(set (match_operand 0 "register_operand" "=df")
+ (call (mem:QI (match_operand:SI 1 "bras_sym_operand" "X"))
+ (match_operand:SI 2 "const_int_operand" "n")))
+ (clobber (match_operand:SI 3 "register_operand" "=r"))]
+ "TARGET_SMALL_EXEC"
+ "bras\\t%3,%1"
+ [(set_attr "op_type" "RI")
+ (set_attr "cycle" "n")])
+
+(define_insn "basr_r_64"
+ [(set (match_operand 0 "register_operand" "=df")
+ (call (mem:QI (match_operand:DI 1 "register_operand" "a"))
+ (match_operand:SI 2 "const_int_operand" "n")))
+ (clobber (match_operand:DI 3 "register_operand" "=r"))]
+ "TARGET_64BIT"
+ "basr\\t%3,%1"
+ [(set_attr "op_type" "RR")
+ (set_attr "cycle" "n")])
+
+(define_insn "basr_r_31"
+ [(set (match_operand 0 "register_operand" "=df")
+ (call (mem:QI (match_operand:SI 1 "register_operand" "a"))
+ (match_operand:SI 2 "const_int_operand" "n")))
+ (clobber (match_operand:SI 3 "register_operand" "=r"))]
+ "!TARGET_64BIT"
+ "basr\\t%3,%1"
+ [(set_attr "op_type" "RR")
+ (set_attr "cycle" "n")
+ (set_attr "atype" "mem")])
+
+(define_insn "bas_r_64"
+ [(set (match_operand 0 "register_operand" "=df")
+ (call (mem:QI (match_operand:QI 1 "address_operand" "p"))
+ (match_operand:SI 2 "const_int_operand" "n")))
+ (clobber (match_operand:DI 3 "register_operand" "=r"))]
+ "TARGET_64BIT"
+ "bas\\t%3,%a1"
+ [(set_attr "op_type" "RX")
+ (set_attr "cycle" "n")
+ (set_attr "atype" "mem")])
+
+(define_insn "bas_r_31"
+ [(set (match_operand 0 "register_operand" "=df")
+ (call (mem:QI (match_operand:QI 1 "address_operand" "p"))
+ (match_operand:SI 2 "const_int_operand" "n")))
+ (clobber (match_operand:SI 3 "register_operand" "=r"))]
+ "!TARGET_64BIT"
+ "bas\\t%3,%a1"
+ [(set_attr "op_type" "RX")
+ (set_attr "cycle" "n")
+ (set_attr "atype" "mem")])
+
+
+;;
+;;- Miscellaneous instructions.
+;;
+
+;
+; allocate stack instruction pattern(s).
+;
+
+(define_expand "allocate_stack"
+ [(set (reg 15)
+ (plus (reg 15) (match_operand 1 "general_operand" "")))
+ (set (match_operand 0 "general_operand" "")
+ (reg 15))]
+ ""
+ "
+{
+ rtx stack = gen_rtx (REG, Pmode, STACK_POINTER_REGNUM);
+ rtx chain = gen_rtx (MEM, Pmode, stack);
+ rtx temp = gen_reg_rtx (Pmode);
+
+ emit_move_insn (temp, chain);
+
+ if (TARGET_64BIT)
+ emit_insn (gen_adddi3 (stack, stack, negate_rtx (Pmode, operands[1])));
+ else
+ emit_insn (gen_addsi3 (stack, stack, negate_rtx (Pmode, operands[1])));
+
+ emit_move_insn (chain, temp);
+
+ emit_move_insn (operands[0], virtual_stack_dynamic_rtx);
+ DONE;
+}")
+
+
+;
+; setjmp/longjmp instruction pattern(s).
+;
+
+(define_expand "builtin_setjmp_setup"
+ [(unspec [(match_operand 0 "register_operand" "a")] 1)]
+ ""
+ "
+{
+ rtx base = gen_rtx_MEM (Pmode, plus_constant (operands[0], 4 * GET_MODE_SIZE (Pmode)));
+ rtx basereg = gen_rtx_REG (Pmode, BASE_REGISTER);
+
+ emit_move_insn (base, basereg);
+ DONE;
+}")
+
+(define_expand "builtin_setjmp_receiver"
+ [(unspec_volatile [(label_ref (match_operand 0 "" ""))] 2)]
+ "flag_pic"
+ "
+{
+ rtx gotreg = gen_rtx_REG (Pmode, PIC_OFFSET_TABLE_REGNUM);
+ rtx got = gen_rtx_SYMBOL_REF (Pmode, \"_GLOBAL_OFFSET_TABLE_\");
+ SYMBOL_REF_FLAG (got) = 1;
+
+ emit_move_insn (gotreg, got);
+ emit_insn (gen_rtx_USE (VOIDmode, gotreg));
+ DONE;
+}")
+
+(define_expand "builtin_longjmp"
+ [(unspec_volatile [(match_operand 0 "register_operand" "r")] 3)]
+ ""
+ "
+{
+ /* The elements of the buffer are, in order: */
+ rtx fp = gen_rtx_MEM (Pmode, operands[0]);
+ rtx lab = gen_rtx_MEM (Pmode, plus_constant (operands[0], GET_MODE_SIZE (Pmode)));
+ rtx stack = gen_rtx_MEM (Pmode, plus_constant (operands[0], 2 * GET_MODE_SIZE (Pmode)));
+ rtx base = gen_rtx_MEM (Pmode, plus_constant (operands[0], 4 * GET_MODE_SIZE (Pmode)));
+ rtx basereg = gen_rtx_REG (Pmode, BASE_REGISTER);
+ rtx jmp = gen_rtx_REG (Pmode, 14);
+
+ emit_move_insn (jmp, lab);
+ emit_move_insn (basereg, base);
+ emit_stack_restore (SAVE_NONLOCAL, stack, NULL_RTX);
+ emit_move_insn (hard_frame_pointer_rtx, fp);
+
+ emit_insn (gen_rtx_USE (VOIDmode, hard_frame_pointer_rtx));
+ emit_insn (gen_rtx_USE (VOIDmode, stack_pointer_rtx));
+ emit_insn (gen_rtx_USE (VOIDmode, basereg));
+ emit_indirect_jump (jmp);
+ DONE;
+}")
+
+
+;; These patterns say how to save and restore the stack pointer. We need not
+;; save the stack pointer at function level since we are careful to
+;; preserve the backchain. At block level, we have to restore the backchain
+;; when we restore the stack pointer.
+;;
+;; For nonlocal gotos, we must save both the stack pointer and its
+;; backchain and restore both. Note that in the nonlocal case, the
+;; save area is a memory location.
+
+(define_expand "save_stack_function"
+ [(match_operand 0 "general_operand" "")
+ (match_operand 1 "general_operand" "")]
+ ""
+ "DONE;")
+
+(define_expand "restore_stack_function"
+ [(match_operand 0 "general_operand" "")
+ (match_operand 1 "general_operand" "")]
+ ""
+ "DONE;")
+
+(define_expand "restore_stack_block"
+ [(use (match_operand 0 "register_operand" ""))
+ (set (match_dup 2) (match_dup 3))
+ (set (match_dup 0) (match_operand 1 "register_operand" ""))
+ (set (match_dup 3) (match_dup 2))]
+ ""
+ "
+{
+ operands[2] = gen_reg_rtx (Pmode);
+ operands[3] = gen_rtx_MEM (Pmode, operands[0]);
+}")
+
+(define_expand "save_stack_nonlocal"
+ [(match_operand 0 "memory_operand" "")
+ (match_operand 1 "register_operand" "")]
+ ""
+ "
+{
+ rtx temp = gen_reg_rtx (Pmode);
+
+ /* Copy the backchain to the first word, sp to the second. */
+ emit_move_insn (temp, gen_rtx_MEM (Pmode, operands[1]));
+ emit_move_insn (operand_subword (operands[0], 0, 0,
+ TARGET_64BIT ? TImode : DImode),
+ temp);
+ emit_move_insn (operand_subword (operands[0], 1, 0,
+ TARGET_64BIT ? TImode : DImode),
+ operands[1]);
+ DONE;
+}")
+
+(define_expand "restore_stack_nonlocal"
+ [(match_operand 0 "register_operand" "")
+ (match_operand 1 "memory_operand" "")]
+ ""
+ "
+{
+ rtx temp = gen_reg_rtx (Pmode);
+
+ /* Restore the backchain from the first word, sp from the second. */
+ emit_move_insn (temp,
+ operand_subword (operands[1], 0, 0,
+ TARGET_64BIT ? TImode : DImode));
+ emit_move_insn (operands[0],
+ operand_subword (operands[1], 1, 0,
+ TARGET_64BIT ? TImode : DImode));
+ emit_move_insn (gen_rtx_MEM (Pmode, operands[0]), temp);
+ DONE;
+}")
+
+
+(define_expand "eh_epilogue"
+ [(use (match_operand 0 "register_operand" ""))
+ (use (match_operand 1 "register_operand" ""))
+ (use (match_operand 2 "register_operand" ""))]
+ ""
+ "
+{
+ s390_expand_eh_epilogue (operands[0], operands[1], operands[2]);
+ DONE;
+}")
+
+
+;
+; nop instruction pattern(s).
+;
+
+(define_insn "nop"
+ [(const_int 0)]
+ ""
+ "lr\\t0,0"
+ [(set_attr "op_type" "RR")])
+
+
+;
+; Special literal pool access instruction pattern(s).
+;
+
+(define_insn "reload_base"
+ [(parallel [(set (reg 13) (pc))
+ (use (label_ref (match_operand 0 "" "")))])]
+ ""
+ "*
+{
+ if (TARGET_64BIT)
+ return \"larl\\t13,%y0\";
+ else
+ return \"basr\\t13,0\;ahi\\t13,%Y0\";
+}"
+ [(set_attr "op_type" "NN")
+ (set_attr "cycle" "2")
+ (set_attr "length" "8")])
+
+(define_insn "ltorg"
+ [(parallel [(set (reg 13) (pc))
+ (use (match_operand:SI 0 "const_int_operand" ""))])]
+ ""
+ "*
+{
+ s390_dump_literal_pool (insn, operands[0]);
+ return \"0:\";
+}"
+ [(set_attr "op_type" "NN")
+ (set_attr "cycle" "n")
+ (set_attr "length" "4096")])
+
+
+;;
+;; Peephole optimization patterns.
+;;
+
+(define_peephole
+ [(set (match_operand:SI 0 "memory_operand" "m")
+ (match_operand:SI 1 "register_operand" "d"))
+ (set (match_dup 1)
+ (match_dup 0))]
+ ""
+ "st\\t%1,%0")
+
+(define_peephole
+ [(set (match_operand:SI 0 "memory_operand" "m")
+ (match_operand:SI 1 "register_operand" "d"))
+ (set (match_dup 0)
+ (match_dup 1))]
+ ""
+ "st\\t%1,%0")
+
+(define_peephole
+ [(set (match_operand:SI 0 "register_operand" "")
+ (match_operand:SI 1 "register_operand" ""))
+ (parallel
+ [(set (match_dup 0)
+ (plus:SI (match_dup 0)
+ (match_operand:SI 2 "immediate_operand" "")))
+ (clobber (reg:CC 33))])]
+ "(REGNO (operands[0]) == STACK_POINTER_REGNUM ||
+ REGNO (operands[1]) == STACK_POINTER_REGNUM ||
+ REGNO (operands[0]) == BASE_REGISTER ||
+ REGNO (operands[1]) == BASE_REGISTER) &&
+ INTVAL (operands[2]) > 0 && INTVAL (operands[2]) < 4096"
+ "la\\t%0,%c2(%1)")
+
+;
+; peepholes for fast char instructions
+;
+
+;(define_peephole
+; [(set (match_operand:QI 0 "register_operand" "d")
+; (match_operand:QI 1 "s_operand" "Q"))
+; (set (match_operand:SI 2 "register_operand" "0")
+; (zero_extend:SI (match_dup 0)))]
+; "REGNO(operands[0]) == REGNO(operands[2])"
+; "icm\\t%0,8,%1\;srl\\t%0,24")
+
+;(define_peephole
+; [(set (match_operand:QI 0 "register_operand" "d")
+; (match_operand:QI 1 "s_operand" "Q"))
+; (set (match_operand:SI 2 "register_operand" "0")
+; (sign_extend:SI (match_dup 0)))]
+; "REGNO(operands[0]) == REGNO(operands[2])"
+; "icm\\t%0,8,%1\;sra\\t%0,24")
+
+(define_peephole
+ [(set (match_operand:QI 0 "register_operand" "d")
+ (match_operand:QI 1 "immediate_operand" "J"))
+ (set (match_operand:SI 2 "register_operand" "0" )
+ (sign_extend:SI (match_dup 0) ) )]
+ "REGNO(operands[0]) == REGNO(operands[2])"
+ "lhi\\t%0,%h1")
+
+;
+; peepholes for fast short instructions
+;
+
+;(define_peephole
+; [(set (match_operand:HI 0 "register_operand" "d")
+; (match_operand:HI 1 "s_operand" "Q"))
+; (set (match_operand:SI 2 "register_operand" "0" )
+; (zero_extend:SI (match_dup 0)))]
+; "REGNO(operands[0]) == REGNO(operands[2])"
+; "icm\\t%0,12,%1\;srl\\t%0,16")
+
+(define_peephole
+ [(set (match_operand:HI 0 "register_operand" "d")
+ (match_operand:HI 1 "memory_operand" "m"))
+ (set (match_operand:SI 2 "register_operand" "0" )
+ (sign_extend:SI (match_dup 0)))]
+ "REGNO(operands[0]) == REGNO(operands[2])"
+ "lh\\t%0,%1")
+
+(define_peephole
+ [(set (match_operand:HI 0 "register_operand" "d")
+ (match_operand:HI 1 "immediate_operand" "K"))
+ (set (match_operand:SI 2 "register_operand" "0" )
+ (sign_extend:SI (match_dup 0) ) )]
+ "REGNO(operands[0]) == REGNO(operands[2])"
+ "lhi\\t%0,%h1")
+
+;
+; peepholes for divide instructions
+;
+
+(define_peephole
+ [(set (match_operand:DI 0 "register_operand" "d")
+ (match_operand:DI 1 "memory_operand" "m"))
+ (set (match_dup 0)
+ (lshiftrt:DI (match_dup 0)
+ (match_operand:SI 2 "immediate_operand" "J")))
+ (set (match_dup 0)
+ (div:SI (match_dup 0)
+ (match_operand:SI 3 "nonimmediate_operand" "g")))
+ (set (match_dup 1)
+ (match_dup 0))]
+ ""
+ "*
+{
+ output_asm_insn (\"l\\t%0,%1\", operands);
+ output_asm_insn (\"srdl\\t%0,%b2\", operands);
+
+ if (REG_P (operands[3]))
+ output_asm_insn (\"dr\\t%0,%3\", operands);
+ else
+ output_asm_insn (\"d\\t%0,%3\", operands);
+
+ return \"st\\t%N0,%N1\";
+}")
+
+(define_peephole
+ [(set (match_operand:DI 0 "register_operand" "d")
+ (match_operand:DI 1 "memory_operand" "m"))
+ (set (match_dup 0)
+ (lshiftrt:DI (match_dup 0)
+ (match_operand:SI 2 "immediate_operand" "J")))
+ (set (match_dup 0)
+ (mod:SI (match_dup 0)
+ (match_operand:SI 3 "nonimmediate_operand" "g")))
+ (set (match_dup 1)
+ (match_dup 0))]
+ ""
+ "*
+{
+ output_asm_insn (\"l\\t%0,%1\", operands);
+ output_asm_insn (\"srdl\\t%0,%b2\", operands);
+
+ if (REG_P (operands[3]))
+ output_asm_insn (\"dr\\t%0,%3\", operands);
+ else
+ output_asm_insn (\"d\\t%0,%3\", operands);
+
+ return \"st\\t%0,%1\";
+}")
+
diff --git a/gcc/config/s390/t-linux b/gcc/config/s390/t-linux
new file mode 100644
index 00000000000..91585b77b3f
--- /dev/null
+++ b/gcc/config/s390/t-linux
@@ -0,0 +1,6 @@
+# The crtbegin and crtend must not depend on a small GOT
+CRTSTUFF_T_CFLAGS = -O2 -fPIC
+
+# Compile libgcc2.a with pic.
+TARGET_LIBGCC2_CFLAGS = -fPIC -include $(srcdir)/config/s390/fixdfdi.h
+
diff --git a/gcc/ch/actions.h b/gcc/config/s390/xm-s390.h
index acffa4bfd06..a98f23acf10 100644
--- a/gcc/ch/actions.h
+++ b/gcc/config/s390/xm-s390.h
@@ -1,5 +1,6 @@
-/* Declarations for ch-actions.c.
- Copyright (C) 1992, 1993, 1994, 1998, 2000 Free Software Foundation, Inc.
+/* Configuration for GNU C-compiler for S/390
+ Copyright (C) 1999 Free Software Foundation, Inc.
+ Contributed by Hartmut Penner (hpenner@de.ibm.com).
This file is part of GNU CC.
@@ -18,17 +19,23 @@ 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. */
-/* used by compile_file */
+/* This describes the machine the compiler is hosted on. */
-void init_chill PARAMS ((void));
+#define HOST_BITS_PER_CHAR 8
+#define HOST_BITS_PER_SHORT 16
+#define HOST_BITS_PER_INT 32
+#define HOST_BITS_PER_LONG 32
+#define HOST_BITS_PER_LONGLONG 64
-extern int grant_count;
+#define HOST_WORDS_BIG_ENDIAN 1
-extern void push_handler PARAMS ((void));
-extern void pop_handler PARAMS ((int));
-extern void push_action PARAMS ((void));
+/* Target machine dependencies. tm.h is a symbolic link to the actual
+ target specific file. */
+
+#include "tm.h"
+
+/* Arguments to use with `exit'. */
+
+#define SUCCESS_EXIT_CODE 0
+#define FATAL_EXIT_CODE 33
-extern int chill_handle_single_dimension_case_label PARAMS ((tree, tree, int *, int *));
-extern tree build_chill_multi_dimension_case_expr PARAMS ((tree, tree, tree));
-extern tree build_multi_case_selector_expression PARAMS ((tree, tree));
-extern void compute_else_ranges PARAMS ((tree, tree));
diff --git a/gcc/config/s390/xm-s390x.h b/gcc/config/s390/xm-s390x.h
new file mode 100644
index 00000000000..dd96b909b03
--- /dev/null
+++ b/gcc/config/s390/xm-s390x.h
@@ -0,0 +1,41 @@
+/* Configuration for GNU C-compiler for S/390
+ Copyright (C) 1999 Free Software Foundation, Inc.
+ Contributed by Hartmut Penner (hpenner@de.ibm.com).
+
+This file is part of GNU CC.
+
+GNU CC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU CC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU CC; see the file COPYING. If not, write to
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA. */
+
+/* This describes the machine the compiler is hosted on. */
+
+#define HOST_BITS_PER_CHAR 8
+#define HOST_BITS_PER_SHORT 16
+#define HOST_BITS_PER_INT 32
+#define HOST_BITS_PER_LONG 64
+#define HOST_BITS_PER_LONGLONG 64
+
+#define HOST_WORDS_BIG_ENDIAN 1
+
+/* Target machine dependencies. tm.h is a symbolic link to the actual
+ target specific file. */
+
+#include "tm.h"
+
+/* Arguments to use with `exit'. */
+
+#define SUCCESS_EXIT_CODE 0
+#define FATAL_EXIT_CODE 33
+
diff --git a/gcc/config/sh/crti.asm b/gcc/config/sh/crti.asm
index ece86667e74..cfed71d2a86 100644
--- a/gcc/config/sh/crti.asm
+++ b/gcc/config/sh/crti.asm
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2001 Free Software Foundation, Inc.
This file was adapted from glibc sources.
This file is part of GNU CC.
@@ -39,7 +39,7 @@ Boston, MA 02111-1307, USA. */
such object files. */
.section .init
-/* The alignment below can't be smaller, otherwide the mova below
+/* The alignment below can't be smaller, otherwise the mova below
breaks. Yes, we might align just the label, but then we'd be
exchanging an alignment here for one there, since the code fragment
below ensures 4-byte alignment on __ELF__. */
@@ -70,7 +70,7 @@ _init:
#endif
.section .fini
-/* The alignment below can't be smaller, otherwide the mova below
+/* The alignment below can't be smaller, otherwise the mova below
breaks. Yes, we might align just the label, but then we'd be
exchanging an alignment here for one there, since the code fragment
below ensures 4-byte alignment on __ELF__. */
diff --git a/gcc/config/sh/crtn.asm b/gcc/config/sh/crtn.asm
index 86a4ee3f976..6aa9a52d2d6 100644
--- a/gcc/config/sh/crtn.asm
+++ b/gcc/config/sh/crtn.asm
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2001 Free Software Foundation, Inc.
This file was adapted from glibc sources.
This file is part of GNU CC.
@@ -30,7 +30,7 @@ Boston, MA 02111-1307, USA. */
/* See an explanation about .init and .fini in crti.asm. */
.section .init
- mov r15,r14
+ mov r14,r15
lds.l @r15+,pr
mov.l @r15+,r14
rts
@@ -41,7 +41,7 @@ Boston, MA 02111-1307, USA. */
#endif
.section .fini
- mov r15,r14
+ mov r14,r15
lds.l @r15+,pr
mov.l @r15+,r14
rts
diff --git a/gcc/config/sh/lib1funcs.asm b/gcc/config/sh/lib1funcs.asm
index 5ebea99c4d1..7d75cd8f90a 100644
--- a/gcc/config/sh/lib1funcs.asm
+++ b/gcc/config/sh/lib1funcs.asm
@@ -845,7 +845,7 @@ GLOBAL(movstrSI12_i4):
!
GLOBAL(mulsi3):
- mulu r4,r5 ! multiply the lsws macl=bb*dd
+ mulu.w r4,r5 ! multiply the lsws macl=bb*dd
mov r5,r3 ! r3 = ccdd
swap.w r4,r2 ! r2 = bbaa
xtrct r2,r3 ! r3 = aacc
@@ -855,9 +855,9 @@ GLOBAL(mulsi3):
sts macl,r0
hiset: sts macl,r0 ! r0 = bb*dd
- mulu r2,r5 ! brewing macl = aa*dd
+ mulu.w r2,r5 ! brewing macl = aa*dd
sts macl,r1
- mulu r3,r4 ! brewing macl = cc*bb
+ mulu.w r3,r4 ! brewing macl = cc*bb
sts macl,r2
add r1,r2
shll16 r2
@@ -1217,18 +1217,23 @@ GLOBAL(ic_invalidate):
ocbwb @r4
mova 0f,r0
mov.w 1f,r1
+/* Compute how many cache lines 0f is away from r4. */
sub r0,r4
and r1,r4
- add #4,r4
+/* Prepare to branch to 0f plus the cache-line offset. */
+ add # 0f - 1f,r4
braf r4
nop
1:
.short 0x1fe0
- nop
+ .p2align 5
+/* This must be aligned to the beginning of a cache line. */
0:
- .rept 2048
+ .rept 256 /* There are 256 cache lines of 32 bytes. */
rts
+ .rept 15
nop
.endr
+ .endr
#endif /* SH4 */
#endif /* L_ic_invalidate */
diff --git a/gcc/config/sh/rtems.h b/gcc/config/sh/rtems.h
index 014760ec507..2e24adfa9dc 100644
--- a/gcc/config/sh/rtems.h
+++ b/gcc/config/sh/rtems.h
@@ -1,5 +1,5 @@
/* Definitions for rtems targeting a SH using COFF.
- Copyright (C) 1997, 1998, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1998, 2000, 2002 Free Software Foundation, Inc.
Contributed by Joel Sherrill (joel@OARcorp.com).
This file is part of GNU CC.
@@ -22,7 +22,7 @@ Boston, MA 02111-1307, USA. */
/* Specify predefined symbols in preprocessor. */
#undef CPP_PREDEFINES
-#define CPP_PREDEFINES "-D__sh__ -Drtems -D__rtems__ \
+#define CPP_PREDEFINES "-D__sh__ -D__rtems__ \
-Asystem=rtems -Acpu=sh -Amachine=sh"
/* Generate calls to memcpy, memcmp and memset. */
diff --git a/gcc/config/sh/rtemself.h b/gcc/config/sh/rtemself.h
index db7bf7da079..68be53139a0 100644
--- a/gcc/config/sh/rtemself.h
+++ b/gcc/config/sh/rtemself.h
@@ -1,5 +1,5 @@
/* Definitions for rtems targeting a SH using elf.
- Copyright (C) 1997, 1998, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1998, 2000, 2002 Free Software Foundation, Inc.
Contributed by Joel Sherrill (joel@OARcorp.com).
This file is part of GNU CC.
@@ -22,7 +22,7 @@ Boston, MA 02111-1307, USA. */
/* Specify predefined symbols in preprocessor. */
#undef CPP_PREDEFINES
-#define CPP_PREDEFINES "-D__sh__ -D__ELF__ -Drtems -D__rtems__ \
+#define CPP_PREDEFINES "-D__sh__ -D__ELF__ -D__rtems__ \
-Asystem=rtems -Acpu=sh -Amachine=sh"
/* Generate calls to memcpy, memcmp and memset. */
diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c
index 4385a0fa6e0..d466cd7eafc 100644
--- a/gcc/config/sh/sh.c
+++ b/gcc/config/sh/sh.c
@@ -27,7 +27,6 @@ Boston, MA 02111-1307, USA. */
#include "rtl.h"
#include "tree.h"
#include "flags.h"
-#include "insn-flags.h"
#include "expr.h"
#include "function.h"
#include "regs.h"
@@ -44,6 +43,9 @@ int code_for_indirect_jump_scratch = CODE_FOR_indirect_jump_scratch;
#define MSW (TARGET_LITTLE_ENDIAN ? 1 : 0)
#define LSW (TARGET_LITTLE_ENDIAN ? 0 : 1)
+/* Set to 1 by expand_prologue() when the function is an interrupt handler. */
+int current_function_interrupt;
+
/* ??? The pragma interrupt support will not work for SH3. */
/* This is set by #pragma interrupt and #pragma trapa, and causes gcc to
output code for the next function appropriate for an interrupt handler. */
@@ -148,6 +150,7 @@ static void push_regs PARAMS ((int, int));
static int calc_live_regs PARAMS ((int *, int *));
static void mark_use PARAMS ((rtx, rtx *));
static HOST_WIDE_INT rounded_frame_size PARAMS ((int));
+static rtx mark_constant_pool_use PARAMS ((rtx));
/* Print the operand address in x to the stream. */
@@ -171,7 +174,7 @@ print_operand_address (stream, x)
switch (GET_CODE (index))
{
case CONST_INT:
- fprintf (stream, "@(%d,%s)", INTVAL (index),
+ fprintf (stream, "@(%d,%s)", (int) INTVAL (index),
reg_names[true_regnum (base)]);
break;
@@ -202,6 +205,7 @@ print_operand_address (stream, x)
break;
default:
+ x = mark_constant_pool_use (x);
output_addr_const (stream, x);
break;
}
@@ -262,6 +266,7 @@ print_operand (stream, x, code)
fprintf (stream, "\n\tnop");
break;
case 'O':
+ x = mark_constant_pool_use (x);
output_addr_const (stream, x);
break;
case 'R':
@@ -800,8 +805,12 @@ output_branch (logic, insn, operands)
rtx insn;
rtx *operands;
{
- switch (get_attr_length (insn))
+ int len = get_attr_length (insn);
+
+ switch (len)
{
+ case 16:
+ case 12:
case 6:
/* This can happen if filling the delay slot has caused a forward
branch to exceed its range (we could reverse it, but only
@@ -824,16 +833,24 @@ output_branch (logic, insn, operands)
if (final_sequence
&& ! INSN_ANNULLED_BRANCH_P (XVECEXP (final_sequence, 0, 0)))
{
- asm_fprintf (asm_out_file, "\tb%s%ss\t%LLF%d\n", logic ? "f" : "t",
+ asm_fprintf (asm_out_file, "\tb%s%ss\t%LLF%d\n",
+ logic ? "f" : "t",
ASSEMBLER_DIALECT ? "/" : ".", label);
print_slot (final_sequence);
}
else
- asm_fprintf (asm_out_file, "\tb%s\t%LLF%d\n", logic ? "f" : "t", label);
+ asm_fprintf (asm_out_file, "\tb%s\t%LLF%d\n", logic ? "f" : "t",
+ label);
- output_asm_insn ("bra\t%l0", &op0);
- fprintf (asm_out_file, "\tnop\n");
- ASM_OUTPUT_INTERNAL_LABEL(asm_out_file, "LF", label);
+ if (len == 6)
+ {
+ output_asm_insn ("bra\t%l0", &op0);
+ fprintf (asm_out_file, "\tnop\n");
+ }
+ else
+ output_far_jump (insn, op0);
+
+ ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "LF", label);
return "";
}
@@ -905,8 +922,8 @@ output_file_start (file)
{
output_file_directive (file, main_input_filename);
- /* Switch to the data section so that the coffsem symbol and the
- gcc2_compiled. symbol aren't in the text section. */
+ /* Switch to the data section so that the coffsem symbol
+ isn't in the text section. */
data_section ();
if (TARGET_LITTLE_ENDIAN)
@@ -988,6 +1005,16 @@ shiftcosts (x)
{
int value;
+ if (GET_MODE_SIZE (GET_MODE (x)) > UNITS_PER_WORD)
+ {
+ if (GET_MODE (x) == DImode
+ && GET_CODE (XEXP (x, 1)) == CONST_INT
+ && INTVAL (XEXP (x, 1)) == 1)
+ return 2;
+
+ /* Everything else is invalid, because there is no pattern for it. */
+ return 10000;
+ }
/* If shift by a non constant, then this will be expensive. */
if (GET_CODE (XEXP (x, 1)) != CONST_INT)
return SH_DYNAMIC_SHIFT_COST;
@@ -1439,7 +1466,7 @@ shl_and_kind (left_rtx, mask_rtx, attrp)
}
}
/* Try to use a scratch register to hold the AND operand. */
- can_ext = ((mask << left) & 0xe0000000) == 0;
+ can_ext = ((mask << left) & ((unsigned HOST_WIDE_INT)3 << 30)) == 0;
for (i = 0; i <= 2; i++)
{
if (i > right)
@@ -1921,6 +1948,7 @@ typedef struct
{
rtx value; /* Value in table. */
rtx label; /* Label of value. */
+ rtx wend; /* End of window. */
enum machine_mode mode; /* Mode of value. */
} pool_node;
@@ -1931,6 +1959,8 @@ typedef struct
#define MAX_POOL_SIZE (1020/4)
static pool_node pool_vector[MAX_POOL_SIZE];
static int pool_size;
+static rtx pool_window_label;
+static int pool_window_last;
/* ??? If we need a constant in HImode which is the truncated value of a
constant we need in SImode, we could combine the two entries thus saving
@@ -1951,7 +1981,7 @@ add_constant (x, mode, last_value)
rtx last_value;
{
int i;
- rtx lab;
+ rtx lab, new, ref, newref;
/* First see if we've already got it. */
for (i = 0; i < pool_size; i++)
@@ -1966,15 +1996,25 @@ add_constant (x, mode, last_value)
}
if (rtx_equal_p (x, pool_vector[i].value))
{
- lab = 0;
+ lab = new = 0;
if (! last_value
|| ! i
|| ! rtx_equal_p (last_value, pool_vector[i-1].value))
{
- lab = pool_vector[i].label;
- if (! lab)
- pool_vector[i].label = lab = gen_label_rtx ();
+ new = gen_label_rtx ();
+ LABEL_REFS (new) = pool_vector[i].label;
+ pool_vector[i].label = lab = new;
+ }
+ if (lab && pool_window_label)
+ {
+ newref = gen_rtx_LABEL_REF (VOIDmode, pool_window_label);
+ ref = pool_vector[pool_window_last].wend;
+ LABEL_NEXTREF (newref) = ref;
+ pool_vector[pool_window_last].wend = newref;
}
+ if (new)
+ pool_window_label = new;
+ pool_window_last = i;
return lab;
}
}
@@ -1988,6 +2028,17 @@ add_constant (x, mode, last_value)
lab = gen_label_rtx ();
pool_vector[pool_size].mode = mode;
pool_vector[pool_size].label = lab;
+ pool_vector[pool_size].wend = NULL_RTX;
+ if (lab && pool_window_label)
+ {
+ newref = gen_rtx_LABEL_REF (VOIDmode, pool_window_label);
+ ref = pool_vector[pool_window_last].wend;
+ LABEL_NEXTREF (newref) = ref;
+ pool_vector[pool_window_last].wend = newref;
+ }
+ if (lab)
+ pool_window_label = lab;
+ pool_window_last = pool_size;
pool_size++;
return lab;
}
@@ -2000,6 +2051,7 @@ dump_table (scan)
{
int i;
int need_align = 1;
+ rtx lab, ref;
/* Do two passes, first time dump out the HI sized constants. */
@@ -2014,8 +2066,15 @@ dump_table (scan)
scan = emit_insn_after (gen_align_2 (), scan);
need_align = 0;
}
- scan = emit_label_after (p->label, scan);
- scan = emit_insn_after (gen_consttable_2 (p->value), scan);
+ for (lab = p->label; lab; lab = LABEL_REFS (lab))
+ scan = emit_label_after (lab, scan);
+ scan = emit_insn_after (gen_consttable_2 (p->value, const0_rtx),
+ scan);
+ for (ref = p->wend; ref; ref = LABEL_NEXTREF (ref))
+ {
+ lab = XEXP (ref, 0);
+ scan = emit_insn_after (gen_consttable_window_end (lab), scan);
+ }
}
}
@@ -2037,9 +2096,10 @@ dump_table (scan)
scan = emit_label_after (gen_label_rtx (), scan);
scan = emit_insn_after (gen_align_4 (), scan);
}
- if (p->label)
- scan = emit_label_after (p->label, scan);
- scan = emit_insn_after (gen_consttable_4 (p->value), scan);
+ for (lab = p->label; lab; lab = LABEL_REFS (lab))
+ scan = emit_label_after (lab, scan);
+ scan = emit_insn_after (gen_consttable_4 (p->value, const0_rtx),
+ scan);
break;
case DFmode:
case DImode:
@@ -2049,19 +2109,31 @@ dump_table (scan)
scan = emit_label_after (gen_label_rtx (), scan);
scan = emit_insn_after (gen_align_4 (), scan);
}
- if (p->label)
- scan = emit_label_after (p->label, scan);
- scan = emit_insn_after (gen_consttable_8 (p->value), scan);
+ for (lab = p->label; lab; lab = LABEL_REFS (lab))
+ scan = emit_label_after (lab, scan);
+ scan = emit_insn_after (gen_consttable_8 (p->value, const0_rtx),
+ scan);
break;
default:
abort ();
break;
}
+
+ if (p->mode != HImode)
+ {
+ for (ref = p->wend; ref; ref = LABEL_NEXTREF (ref))
+ {
+ lab = XEXP (ref, 0);
+ scan = emit_insn_after (gen_consttable_window_end (lab), scan);
+ }
+ }
}
scan = emit_insn_after (gen_consttable_end (), scan);
scan = emit_barrier_after (scan);
pool_size = 0;
+ pool_window_label = NULL_RTX;
+ pool_window_last = 0;
}
/* Return non-zero if constant would be an ok source for a
@@ -2720,7 +2792,7 @@ struct far_branch
static void gen_far_branch PARAMS ((struct far_branch *));
enum mdep_reorg_phase_e mdep_reorg_phase;
-void
+static void
gen_far_branch (bp)
struct far_branch *bp;
{
@@ -2824,7 +2896,7 @@ barrier_align (barrier_or_label)
the table to the minimum for proper code alignment. */
return ((TARGET_SMALLCODE
|| (XVECLEN (pat, 1) * GET_MODE_SIZE (GET_MODE (pat))
- <= 1 << (CACHE_LOG - 2)))
+ <= (unsigned)1 << (CACHE_LOG - 2)))
? 1 : CACHE_LOG);
}
@@ -2856,7 +2928,7 @@ barrier_align (barrier_or_label)
investigation. Skip to the insn before it. */
prev = prev_real_insn (prev);
- for (slot = 2, credit = 1 << (CACHE_LOG - 2) + 2;
+ for (slot = 2, credit = (1 << (CACHE_LOG - 2)) + 2;
credit >= 0 && prev && GET_CODE (prev) == INSN;
prev = prev_real_insn (prev))
{
@@ -3933,7 +4005,7 @@ rounded_frame_size (pushed)
HOST_WIDE_INT size = get_frame_size ();
HOST_WIDE_INT align = STACK_BOUNDARY / BITS_PER_UNIT;
- return (size + pushed + align - 1 & -align) - pushed;
+ return ((size + pushed + align - 1) & -align) - pushed;
}
void
@@ -3944,6 +4016,11 @@ sh_expand_prologue ()
int live_regs_mask2;
int save_flags = target_flags;
+ current_function_interrupt
+ = lookup_attribute ("interrupt_handler",
+ DECL_MACHINE_ATTRIBUTES (current_function_decl))
+ != NULL_TREE;
+
/* We have pretend args if we had an object sent partially in registers
and partially on the stack, e.g. a large structure. */
output_stack_adjust (-current_function_pretend_args_size,
@@ -3987,7 +4064,23 @@ sh_expand_prologue ()
push_regs (live_regs_mask, live_regs_mask2);
if (flag_pic && regs_ever_live[PIC_OFFSET_TABLE_REGNUM])
- emit_insn (gen_GOTaddr2picreg ());
+ {
+ rtx insn = get_last_insn ();
+ rtx last = emit_insn (gen_GOTaddr2picreg ());
+
+ /* Mark these insns as possibly dead. Sometimes, flow2 may
+ delete all uses of the PIC register. In this case, let it
+ delete the initialization too. */
+ do
+ {
+ insn = NEXT_INSN (insn);
+
+ REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_MAYBE_DEAD,
+ const0_rtx,
+ REG_NOTES (insn));
+ }
+ while (insn != last);
+ }
if (target_flags != save_flags)
{
@@ -4455,6 +4548,13 @@ initial_elimination_offset (from, to)
int save_flags = target_flags;
int live_regs_mask, live_regs_mask2;
+
+ if (from == RETURN_ADDRESS_POINTER_REGNUM)
+ /* Kludge: since we assume that the return address is on the stack,
+ make it so. N.B. We rely on RETURN_ADDRESS_POINTER_REGNUM being
+ processed before ARG_POINTER_REGNUM here. */
+ regs_ever_live[PR_REG] = 1;
+
live_regs_mask = calc_live_regs (&regs_saved, &live_regs_mask2);
total_auto_space = rounded_frame_size (regs_saved);
target_flags = save_flags;
@@ -4473,13 +4573,7 @@ initial_elimination_offset (from, to)
if (from == RETURN_ADDRESS_POINTER_REGNUM
&& (to == FRAME_POINTER_REGNUM || to == STACK_POINTER_REGNUM))
- {
- int i, n = total_saved_regs_space;
- for (i = PR_REG-1; i >= 0; i--)
- if (live_regs_mask & (1 << i))
- n -= 4;
- return n + total_auto_space;
- }
+ return total_auto_space;
abort ();
}
@@ -5013,7 +5107,7 @@ reg_unused_after (reg, insn)
return 1;
}
-extern struct obstack permanent_obstack;
+#include "ggc.h"
rtx
get_fpscr_rtx ()
@@ -5181,8 +5275,6 @@ static rtx
get_free_reg (regs_live)
HARD_REG_SET regs_live;
{
- rtx reg;
-
if (! TEST_HARD_REG_BIT (regs_live, 1))
return gen_rtx_REG (Pmode, 1);
@@ -5204,8 +5296,10 @@ fpscr_set_from_mem (mode, regs_live)
enum attr_fp_mode fp_mode = mode;
rtx addr_reg = get_free_reg (regs_live);
- emit_insn ((fp_mode == (TARGET_FPU_SINGLE ? FP_MODE_SINGLE : FP_MODE_DOUBLE)
- ? gen_fpu_switch1 : gen_fpu_switch0) (addr_reg));
+ if (fp_mode == (enum attr_fp_mode) NORMAL_MODE (FP_MODE))
+ emit_insn (gen_fpu_switch1 (addr_reg));
+ else
+ emit_insn (gen_fpu_switch0 (addr_reg));
}
/* Is the given character a logical line separator for the assembler? */
@@ -5327,7 +5421,7 @@ nonpic_symbol_mentioned_p (x)
rtx
legitimize_pic_address (orig, mode, reg)
rtx orig;
- enum machine_mode mode;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
rtx reg;
{
if (GET_CODE (orig) == LABEL_REF
@@ -5352,3 +5446,68 @@ legitimize_pic_address (orig, mode, reg)
}
return orig;
}
+
+/* Mark the use of a constant in the literal table. If the constant
+ has multiple labels, make it unique. */
+static rtx mark_constant_pool_use (x)
+ rtx x;
+{
+ rtx insn, lab, pattern;
+
+ if (x == NULL)
+ return x;
+
+ switch (GET_CODE (x))
+ {
+ case LABEL_REF:
+ x = XEXP (x, 0);
+ case CODE_LABEL:
+ break;
+ default:
+ return x;
+ }
+
+ /* Get the first label in the list of labels for the same constant
+ and delete another labels in the list. */
+ lab = x;
+ for (insn = PREV_INSN (x); insn; insn = PREV_INSN (insn))
+ {
+ if (GET_CODE (insn) != CODE_LABEL
+ || LABEL_REFS (insn) != NEXT_INSN (insn))
+ break;
+ lab = insn;
+ }
+
+ for (insn = LABEL_REFS (lab); insn; insn = LABEL_REFS (insn))
+ INSN_DELETED_P (insn) = 1;
+
+ /* Mark constants in a window. */
+ for (insn = NEXT_INSN (x); insn; insn = NEXT_INSN (insn))
+ {
+ if (GET_CODE (insn) != INSN)
+ continue;
+
+ pattern = PATTERN (insn);
+ if (GET_CODE (pattern) != UNSPEC_VOLATILE)
+ continue;
+
+ switch (XINT (pattern, 1))
+ {
+ case UNSPECV_CONST2:
+ case UNSPECV_CONST4:
+ case UNSPECV_CONST8:
+ XVECEXP (pattern, 0, 1) = const1_rtx;
+ break;
+ case UNSPECV_WINDOW_END:
+ if (XVECEXP (pattern, 0, 0) == x)
+ return lab;
+ break;
+ case UNSPECV_CONST_END:
+ return lab;
+ default:
+ break;
+ }
+ }
+
+ return lab;
+}
diff --git a/gcc/config/sh/sh.h b/gcc/config/sh/sh.h
index 01473bd3a52..7e39af85f82 100644
--- a/gcc/config/sh/sh.h
+++ b/gcc/config/sh/sh.h
@@ -1670,13 +1670,6 @@ extern int current_function_anonymous_args;
/* Nonzero if access to memory by bytes is no faster than for words. */
#define SLOW_BYTE_ACCESS 1
-/* Force sizeof(bool) == 1 to maintain binary compatibility; otherwise, the
- change in SLOW_BYTE_ACCESS would have changed it to 4. */
-
-/* This used to use INT_TYPE_SIZE / CHAR_TYPE_SIZE, but these are
- not guaranteed to be defined when BOOL_TYPE_SIZE is used. */
-#define BOOL_TYPE_SIZE (flag_new_abi ? BITS_PER_WORD : BITS_PER_UNIT)
-
/* We assume that the store-condition-codes instructions store 0 for false
and some other value for true. This is the value stored for true. */
@@ -1799,6 +1792,13 @@ do \
} \
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) \
+ && (! CONSTANT_POOL_ADDRESS_P (X) \
+ || ! nonpic_symbol_mentioned_p (get_pool_constant (X))))
+
#define SYMBOLIC_CONST_P(X) \
((GET_CODE (X) == SYMBOL_REF || GET_CODE (X) == LABEL_REF) \
&& nonpic_symbol_mentioned_p (X))
@@ -1865,7 +1865,7 @@ while (0)
#define ASM_APP_ON ""
#define ASM_APP_OFF ""
#define FILE_ASM_OP "\t.file\n"
-#define IDENT_ASM_OP "\t.ident\n"
+#define IDENT_ASM_OP "\t.ident\t"
#define SET_ASM_OP "\t.set\t"
/* How to change between sections. */
@@ -2298,6 +2298,10 @@ extern enum mdep_reorg_phase_e mdep_reorg_phase;
extern int pragma_interrupt;
+/* Set when processing a function with interrupt attribute. */
+
+extern int current_function_interrupt;
+
/* Set to an RTX containing the address of the stack to switch to
for interrupt functions. */
extern struct rtx_def *sp_switch;
diff --git a/gcc/config/sh/sh.md b/gcc/config/sh/sh.md
index b471a4a9773..0c0911841bb 100644
--- a/gcc/config/sh/sh.md
+++ b/gcc/config/sh/sh.md
@@ -117,6 +117,7 @@
(UNSPECV_CONST2 2)
(UNSPECV_CONST4 4)
(UNSPECV_CONST8 6)
+ (UNSPECV_WINDOW_END 10)
(UNSPECV_CONST_END 11)
])
@@ -546,7 +547,7 @@
(const_string "yes")))
(define_attr "interrupt_function" "no,yes"
- (const (symbol_ref "pragma_interrupt")))
+ (const (symbol_ref "current_function_interrupt")))
(define_attr "in_delay_slot" "yes,no"
(cond [(eq_attr "type" "cbranch") (const_string "no")
@@ -576,7 +577,9 @@
(ior (and (eq_attr "interrupt_function" "no")
(eq_attr "type" "!pload,prset"))
(and (eq_attr "interrupt_function" "yes")
- (eq_attr "hit_stack" "no")))) (nil) (nil)])
+ (ior
+ (ne (symbol_ref "TARGET_SH3") (const_int 0))
+ (eq_attr "hit_stack" "no"))))) (nil) (nil)])
;; Since a call implicitly uses the PR register, we can't allow
;; a PR register store in a jsr delay slot.
@@ -1160,7 +1163,7 @@
(zero_extend:SI
(match_operand:HI 1 "arith_reg_operand" "r"))))]
""
- "mulu %1,%0"
+ "mulu.w %1,%0"
[(set_attr "type" "smpy")])
(define_insn "mulhisi3_i"
@@ -1170,7 +1173,7 @@
(sign_extend:SI
(match_operand:HI 1 "arith_reg_operand" "r"))))]
""
- "muls %1,%0"
+ "muls.w %1,%0"
[(set_attr "type" "smpy")])
(define_expand "mulhisi3"
@@ -2438,8 +2441,8 @@
;; ??? This allows moves from macl to fpul to be recognized, but these moves
;; will require a 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,y")
- (match_operand:SI 1 "general_movsrc_operand" "Q,rI,r,mr,x,l,t,r,x,l,r,r,>,>,>,i,r,y,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,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"))]
"TARGET_SH3E
&& (register_operand (operands[0], SImode)
|| register_operand (operands[1], SImode))"
@@ -2459,12 +2462,13 @@
lds.l %1,%0
lds.l %1,%0
lds.l %1,%0
+ sts.l %1,%0
fake %1,%0
lds %1,%0
sts %1,%0
! move optimized away"
- [(set_attr "type" "pcload_si,move,*,load_si,move,prget,move,store,store,pstore,move,prset,load,pload,load,pcload_si,gp_fpul,gp_fpul,nil")
- (set_attr "length" "*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,0")])
+ [(set_attr "type" "pcload_si,move,*,load_si,move,prget,move,store,store,pstore,move,prset,load,pload,load,store,pcload_si,gp_fpul,gp_fpul,nil")
+ (set_attr "length" "*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,0")])
(define_insn "movsi_i_lowpart"
[(set (strict_low_part (match_operand:SI 0 "general_movdst_operand" "+r,r,r,r,r,r,m,r"))
@@ -3084,11 +3088,11 @@
;; when the destination changes mode.
(define_insn "movsf_ie"
[(set (match_operand:SF 0 "general_movdst_operand"
- "=f,r,f,f,fy,f,m,r,r,m,f,y,y,rf,r<,y,y")
+ "=f,r,f,f,fy,f,m,r,r,m,f,y,y,rf,r,y,<,y,y")
(match_operand:SF 1 "general_movsrc_operand"
- "f,r,G,H,FQ,mf,f,FQ,mr,r,y,f,>,fr,y,r>,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"))
- (clobber (match_scratch:SI 3 "=X,X,X,X,&z,X,X,X,X,X,X,X,X,y,X,X,X"))]
+ "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"))]
"TARGET_SH3E
&& (arith_reg_operand (operands[0], SFmode)
@@ -3117,9 +3121,11 @@
#
sts %1,%0
lds %1,%0
+ sts.l %1,%0
+ lds.l %1,%0
! move optimized away"
- [(set_attr "type" "fmove,move,fmove,fmove,pcload,load,store,pcload,load,store,fmove,fmove,load,*,gp_fpul,gp_fpul,nil")
- (set_attr "length" "*,*,*,*,4,*,*,*,*,*,2,2,2,4,2,2,0")
+ [(set_attr "type" "fmove,move,fmove,fmove,pcload,load,store,pcload,load,store,fmove,fmove,load,*,gp_fpul,gp_fpul,store,load,nil")
+ (set_attr "length" "*,*,*,*,4,*,*,*,*,*,2,2,2,4,2,2,2,2,0")
(set (attr "fp_mode") (if_then_else (eq_attr "fmovd" "yes")
(const_string "single")
(const_string "none")))])
@@ -3749,6 +3755,15 @@
}
")
+(define_expand "builtin_setjmp_receiver"
+ [(match_operand 0 "" "")]
+ "flag_pic"
+ "
+{
+ emit_insn (gen_GOTaddr2picreg ());
+ DONE;
+}")
+
(define_expand "call_site"
[(unspec [(match_dup 0)] UNSPEC_CALLER)]
""
@@ -4107,12 +4122,14 @@
; 2 byte integer in line
(define_insn "consttable_2"
- [(unspec_volatile [(match_operand:SI 0 "general_operand" "=g")]
+ [(unspec_volatile [(match_operand:SI 0 "general_operand" "=g")
+ (match_operand 1 "" "")]
UNSPECV_CONST2)]
""
"*
{
- assemble_integer (operands[0], 2, 1);
+ if (operands[1] != const0_rtx)
+ assemble_integer (operands[0], 2, 1);
return \"\";
}"
[(set_attr "length" "2")
@@ -4121,12 +4138,14 @@
; 4 byte integer in line
(define_insn "consttable_4"
- [(unspec_volatile [(match_operand:SI 0 "general_operand" "=g")]
+ [(unspec_volatile [(match_operand:SI 0 "general_operand" "=g")
+ (match_operand 1 "" "")]
UNSPECV_CONST4)]
""
"*
{
- assemble_integer (operands[0], 4, 1);
+ if (operands[1] != const0_rtx)
+ assemble_integer (operands[0], 4, 1);
return \"\";
}"
[(set_attr "length" "4")
@@ -4135,12 +4154,14 @@
; 8 byte integer in line
(define_insn "consttable_8"
- [(unspec_volatile [(match_operand:SI 0 "general_operand" "=g")]
+ [(unspec_volatile [(match_operand:SI 0 "general_operand" "=g")
+ (match_operand 1 "" "")]
UNSPECV_CONST8)]
""
"*
{
- assemble_integer (operands[0], 8, 1);
+ if (operands[1] != const0_rtx)
+ assemble_integer (operands[0], 8, 1);
return \"\";
}"
[(set_attr "length" "8")
@@ -4149,14 +4170,18 @@
; 4 byte floating point
(define_insn "consttable_sf"
- [(unspec_volatile [(match_operand:SF 0 "general_operand" "=g")]
+ [(unspec_volatile [(match_operand:SF 0 "general_operand" "=g")
+ (match_operand 1 "" "")]
UNSPECV_CONST4)]
""
"*
{
- union real_extract u;
- memcpy (&u, &CONST_DOUBLE_LOW (operands[0]), sizeof u);
- assemble_real (u.d, SFmode);
+ if (operands[1] != const0_rtx)
+ {
+ union real_extract u;
+ memcpy (&u, &CONST_DOUBLE_LOW (operands[0]), sizeof u);
+ assemble_real (u.d, SFmode);
+ }
return \"\";
}"
[(set_attr "length" "4")
@@ -4165,14 +4190,18 @@
; 8 byte floating point
(define_insn "consttable_df"
- [(unspec_volatile [(match_operand:DF 0 "general_operand" "=g")]
+ [(unspec_volatile [(match_operand:DF 0 "general_operand" "=g")
+ (match_operand 1 "" "")]
UNSPECV_CONST8)]
""
"*
{
- union real_extract u;
- memcpy (&u, &CONST_DOUBLE_LOW (operands[0]), sizeof u);
- assemble_real (u.d, DFmode);
+ if (operands[1] != const0_rtx)
+ {
+ union real_extract u;
+ memcpy (&u, &CONST_DOUBLE_LOW (operands[0]), sizeof u);
+ assemble_real (u.d, DFmode);
+ }
return \"\";
}"
[(set_attr "length" "8")
@@ -4218,6 +4247,15 @@
"* return output_jump_label_table ();"
[(set_attr "in_delay_slot" "no")])
+; emitted at the end of the window in the literal table.
+
+(define_insn "consttable_window_end"
+ [(unspec_volatile [(match_operand 0 "" "")] UNSPECV_WINDOW_END)]
+ ""
+ ""
+ [(set_attr "length" "0")
+ (set_attr "in_delay_slot" "no")])
+
;; -------------------------------------------------------------------------
;; Misc
;; -------------------------------------------------------------------------
diff --git a/gcc/config/sh/xm-sh.h b/gcc/config/sh/xm-sh.h
index f51b787f6df..d28538c7b61 100644
--- a/gcc/config/sh/xm-sh.h
+++ b/gcc/config/sh/xm-sh.h
@@ -18,10 +18,6 @@ along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-/* #defines that need visibility everywhere. */
-#define FALSE 0
-#define TRUE 1
-
/* This describes the machine the compiler is hosted on. */
#define HOST_BITS_PER_CHAR 8
#define HOST_BITS_PER_SHORT 16
diff --git a/gcc/config/sparc/linux-aout.h b/gcc/config/sparc/linux-aout.h
index 91561b0e264..c40c79c124e 100644
--- a/gcc/config/sparc/linux-aout.h
+++ b/gcc/config/sparc/linux-aout.h
@@ -42,11 +42,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); \
- fprintf (FILE, "\t.version\t\"01.01\"\n"); \
- } while (0)
+#define ASM_FILE_START(FILE) output_file_directive (FILE, main_input_filename)
#undef STARTFILE_SPEC
#define STARTFILE_SPEC "%{pg:gcrt0.o%s} %{!pg:%{p:gcrt0.o%s} %{!p:crt0.o%s}} %{static:-static}"
diff --git a/gcc/config/sparc/linux.h b/gcc/config/sparc/linux.h
index ee3b7fde9d1..4b03289ccd8 100644
--- a/gcc/config/sparc/linux.h
+++ b/gcc/config/sparc/linux.h
@@ -32,6 +32,10 @@ Boston, MA 02111-1307, USA. */
#define MULTIBYTE_CHARS 1
#endif
+/* The GNU C++ standard library requires that these macros be defined. */
+#undef CPLUSPLUS_CPP_SPEC
+#define CPLUSPLUS_CPP_SPEC "-D_GNU_SOURCE %(cpp)"
+
#ifndef USE_GNULIBC_1
#undef DEFAULT_VTABLE_THUNKS
#define DEFAULT_VTABLE_THUNKS 1
@@ -45,15 +49,6 @@ Boston, MA 02111-1307, USA. */
#undef MD_EXEC_PREFIX
#undef MD_STARTFILE_PREFIX
-/* 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)
-
/* Provide a STARTFILE_SPEC appropriate for GNU/Linux. Here we add
the GNU/Linux magical crtbegin.o file (see crtstuff.c) which
provides part of the support for getting C++ file-scope static
diff --git a/gcc/config/sparc/linux64.h b/gcc/config/sparc/linux64.h
index da2f4fe825a..e4a8269e09f 100644
--- a/gcc/config/sparc/linux64.h
+++ b/gcc/config/sparc/linux64.h
@@ -26,6 +26,10 @@ Boston, MA 02111-1307, USA. */
/* Don't assume anything about the header files. */
#define NO_IMPLICIT_EXTERN_C
+/* The GNU C++ standard library requires that these macros be defined. */
+#undef CPLUSPLUS_CPP_SPEC
+#define CPLUSPLUS_CPP_SPEC "-D_GNU_SOURCE %(cpp)"
+
#undef DEFAULT_VTABLE_THUNKS
#define DEFAULT_VTABLE_THUNKS 1
@@ -44,15 +48,6 @@ Boston, MA 02111-1307, USA. */
+ MASK_STACK_BIAS + MASK_APP_REGS + MASK_EPILOGUE + MASK_FPU + MASK_LONG_DOUBLE_128)
#endif
-/* 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)
-
#undef ASM_CPU_DEFAULT_SPEC
#define ASM_CPU_DEFAULT_SPEC "-Av9a"
diff --git a/gcc/config/sparc/openbsd.h b/gcc/config/sparc/openbsd.h
index c5dc4431726..ba97ac7b9de 100644
--- a/gcc/config/sparc/openbsd.h
+++ b/gcc/config/sparc/openbsd.h
@@ -64,5 +64,6 @@ Boston, MA 02111-1307, USA. */
configuration files... */
#define DWARF2_UNWIND_INFO 0
-/* Default sparc.h does already define ASM_OUTPUT_MI_THUNK */
+#undef ASM_PREFERRED_EH_DATA_FORMAT
+/* Default sparc.h does already define ASM_OUTPUT_MI_THUNK */
diff --git a/gcc/config/sparc/rtems.h b/gcc/config/sparc/rtems.h
index 36fcf33f578..f72e9dcd5e8 100644
--- a/gcc/config/sparc/rtems.h
+++ b/gcc/config/sparc/rtems.h
@@ -1,5 +1,5 @@
/* Definitions for rtems targeting a SPARC using a.out.
- Copyright (C) 1996, 1997, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1997, 2000, 2002 Free Software Foundation, Inc.
Contributed by Joel Sherrill (joel@OARcorp.com).
This file is part of GNU CC.
@@ -24,8 +24,8 @@ Boston, MA 02111-1307, USA. */
/* Specify predefined symbols in preprocessor. */
#undef CPP_PREDEFINES
-#define CPP_PREDEFINES "-Dsparc -D__GCC_NEW_VARARGS__ -Drtems -D__rtems__ \
- -Asystem=rtems -Acpu=sparc -Amachine=sparc"
+#define CPP_PREDEFINES "-Dsparc -D__GCC_NEW_VARARGS__ -D__rtems__ \
+ -Asystem=rtems"
/* Generate calls to memcpy, memcmp and memset. */
#ifndef TARGET_MEM_FUNCTIONS
diff --git a/gcc/config/sparc/rtemself.h b/gcc/config/sparc/rtemself.h
index 62277abe79d..baf51ad6e11 100644
--- a/gcc/config/sparc/rtemself.h
+++ b/gcc/config/sparc/rtemself.h
@@ -1,5 +1,5 @@
-/* Definitions for rtems targeting a SPARC using a.out.
- Copyright (C) 1996, 1997, 2000 Free Software Foundation, Inc.
+/* Definitions for rtems targeting a SPARC using ELF.
+ Copyright (C) 1996, 1997, 2000, 2002 Free Software Foundation, Inc.
Contributed by Joel Sherrill (joel@OARcorp.com).
This file is part of GNU CC.
@@ -22,8 +22,8 @@ Boston, MA 02111-1307, USA. */
/* Specify predefined symbols in preprocessor. */
#undef CPP_PREDEFINES
-#define CPP_PREDEFINES "-Dsparc -D__GCC_NEW_VARARGS__ -Drtems -D__rtems__ \
- -Asystem=rtems -Acpu=sparc -Amachine=sparc"
+#define CPP_PREDEFINES "-Dsparc -D__GCC_NEW_VARARGS__ -D__rtems__ \
+ -Asystem=rtems -D__USE_INIT_FINI__"
/* Generate calls to memcpy, memcmp and memset. */
#ifndef TARGET_MEM_FUNCTIONS
diff --git a/gcc/config/sparc/sol2-sld-64.h b/gcc/config/sparc/sol2-sld-64.h
index a00f010f899..9179635c636 100644
--- a/gcc/config/sparc/sol2-sld-64.h
+++ b/gcc/config/sparc/sol2-sld-64.h
@@ -136,7 +136,7 @@
%{!p: \
%{pg:gcrt1.o%s gmon.o%s} \
%{!pg:crt1.o%s}}}} \
- crti.o%s" STARTFILE_ARCH_SPEC " \
+ crti.o%s " STARTFILE_ARCH_SPEC " \
crtbegin.o%s"
#ifdef SPARC_BI_ARCH
@@ -161,11 +161,35 @@
%{!m32:" ASM_CPU64_DEFAULT_SPEC "} \
")
+/* wchar_t is called differently in <wchar.h> for 32 and 64-bit
+ compilations. This is called for by SCD 2.4.1, p. 6-83, Figure 6-65
+ (32-bit) and p. 6P-10, Figure 6.38 (64-bit). */
+#define NO_BUILTIN_WCHAR_TYPE
+
+#undef WCHAR_TYPE
+#define WCHAR_TYPE (TARGET_ARCH64 ? "int" : "long int")
+
+#undef WCHAR_TYPE_SIZE
+#define WCHAR_TYPE_SIZE 32
+
+/* Same for wint_t. See SCD 2.4.1, p. 6-83, Figure 6-66 (32-bit). There's
+ no corresponding 64-bit definition, but this is what Solaris 8
+ <iso/wchar_iso.h> uses. */
+#define NO_BUILTIN_WINT_TYPE
+
+#undef WINT_TYPE
+#define WINT_TYPE (TARGET_ARCH64 ? "int" : "long int")
+
+#undef WINT_TYPE_SIZE
+#define WINT_TYPE_SIZE 32
+
#undef CPP_ARCH32_SPEC
#define CPP_ARCH32_SPEC "-D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int \
+-D__WCHAR_TYPE__=long\\ int -D__WINT_TYPE__=long\\ int \
-D__GCC_NEW_VARARGS__ -Acpu=sparc -Amachine=sparc"
#undef CPP_ARCH64_SPEC
#define CPP_ARCH64_SPEC "-D__SIZE_TYPE__=long\\ unsigned\\ int -D__PTRDIFF_TYPE__=long\\ int \
+-D__WCHAR_TYPE__=int -D__WINT_TYPE__=int \
-D__arch64__ -Acpu=sparc64 -Amachine=sparcv9 -D__sparcv9"
#undef CPP_ARCH_SPEC
diff --git a/gcc/config/sparc/sol2.h b/gcc/config/sparc/sol2.h
index 5075f9a1013..ee7fa063b17 100644
--- a/gcc/config/sparc/sol2.h
+++ b/gcc/config/sparc/sol2.h
@@ -1,5 +1,6 @@
/* Definitions of target machine for GNU compiler, for SPARC running Solaris 2
- Copyright 1992, 1995, 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+ Copyright 1992, 1995, 1996, 1997, 1998, 1999, 2000,
+ 2001 Free Software Foundation, Inc.
Contributed by Ron Guilmette (rfg@netcom.com).
Additional changes by David V. Henkel-Wallace (gumby@cygnus.com).
@@ -23,6 +24,14 @@ Boston, MA 02111-1307, USA. */
/* Supposedly the same as vanilla sparc svr4, except for the stuff below: */
#include "sparc/sysv4.h"
+/* Solaris 2 uses a wint_t different from the default. This is required
+ by the SCD 2.4.1, p. 6-83, Figure 6-66. */
+#undef WINT_TYPE
+#define WINT_TYPE "long int"
+
+#undef WINT_TYPE_SIZE
+#define WINT_TYPE_SIZE BITS_PER_WORD
+
#undef CPP_PREDEFINES
#define CPP_PREDEFINES \
"-Dsparc -Dsun -Dunix -D__svr4__ -D__SVR4 \
@@ -35,6 +44,14 @@ Boston, MA 02111-1307, USA. */
%{compat-bsd:-iwithprefixbefore ucbinclude -I/usr/ucbinclude} \
"
+/* For C++ we need to add some additional macro definitions required
+ by the C++ standard library. */
+#define CPLUSPLUS_CPP_SPEC "\
+-D_XOPEN_SOURCE=500 -D_LARGEFILE_SOURCE=1 -D_LARGEFILE64_SOURCE=1 \
+-D__EXTENSIONS__ \
+%(cpp) \
+"
+
/* The sun bundled assembler doesn't accept -Yd, (and neither does gas).
It's safe to pass -s always, even if -g is not used. */
#undef ASM_SPEC
diff --git a/gcc/config/sparc/sp64-elf.h b/gcc/config/sparc/sp64-elf.h
index b3148999c5d..cdd8f4c2361 100644
--- a/gcc/config/sparc/sp64-elf.h
+++ b/gcc/config/sparc/sp64-elf.h
@@ -119,38 +119,6 @@ crtbegin.o%s \
#undef PREFERRED_DEBUGGING_TYPE
#define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
-/* Stabs doesn't use this, and it confuses a simulator. */
-/* ??? Need to see what DWARF needs, if anything. */
-#undef ASM_IDENTIFY_GCC
-#define ASM_IDENTIFY_GCC(FILE)
-
-/* Define the names of various pseudo-ops used by the Sparc/svr4 assembler.
- ??? If ints are 64 bits then UNALIGNED_INT_ASM_OP (defined elsewhere) is
- misnamed. These should all refer to explicit sizes (half/word/xword?),
- anything other than short/int/long/etc. */
-
-#define UNALIGNED_LONGLONG_ASM_OP "\t.uaxword\t"
-
-/* DWARF stuff. */
-
-#define ASM_OUTPUT_DWARF_ADDR(FILE, LABEL) \
-do { \
- fprintf ((FILE), "%s", UNALIGNED_LONGLONG_ASM_OP); \
- assemble_name ((FILE), (LABEL)); \
- fprintf ((FILE), "\n"); \
-} while (0)
-
-#define ASM_OUTPUT_DWARF_ADDR_CONST(FILE, RTX) \
-do { \
- fprintf ((FILE), "%s", UNALIGNED_LONGLONG_ASM_OP); \
- output_addr_const ((FILE), (RTX)); \
- fputc ('\n', (FILE)); \
-} while (0)
-
-/* ??? Not sure if this should be 4 or 8 bytes. 4 works for now. */
-#define ASM_OUTPUT_DWARF_REF(FILE, LABEL) \
-do { \
- fprintf ((FILE), "%s", UNALIGNED_INT_ASM_OP); \
- assemble_name ((FILE), (LABEL)); \
- fprintf ((FILE), "\n"); \
-} while (0)
+/* Define the names of various pseudo-ops used by the Sparc/svr4 assembler. */
+
+#define UNALIGNED_DOUBLE_INT_ASM_OP "\t.uaxword\t"
diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c
index 0d194f1b28a..e6ab012130b 100644
--- a/gcc/config/sparc/sparc.c
+++ b/gcc/config/sparc/sparc.c
@@ -31,7 +31,6 @@ Boston, MA 02111-1307, USA. */
#include "real.h"
#include "insn-config.h"
#include "conditions.h"
-#include "insn-flags.h"
#include "output.h"
#include "insn-attr.h"
#include "flags.h"
@@ -2378,6 +2377,11 @@ eligible_for_epilogue_delay (trial, slot)
if (num_gfregs)
return 0;
+ /* If the function uses __builtin_eh_return, the eh_return machinery
+ occupies the delay slot. */
+ if (current_function_calls_eh_return)
+ return 0;
+
/* In the case of a true leaf function, anything can go into the delay slot.
A delay slot only exists however if the frame size is zero, otherwise
we will put an insn to adjust the stack after the return. */
@@ -2414,7 +2418,8 @@ eligible_for_epilogue_delay (trial, slot)
src = SET_SRC (pat);
/* This matches "*return_[qhs]i" or even "*return_di" on TARGET_ARCH64. */
- if (arith_operand (src, GET_MODE (src)))
+ if (GET_MODE_CLASS (GET_MODE (src)) != MODE_FLOAT
+ && arith_operand (src, GET_MODE (src)))
{
if (TARGET_ARCH64)
return GET_MODE_SIZE (GET_MODE (src)) <= GET_MODE_SIZE (DImode);
@@ -2423,7 +2428,8 @@ eligible_for_epilogue_delay (trial, slot)
}
/* This matches "*return_di". */
- else if (arith_double_operand (src, GET_MODE (src)))
+ else if (GET_MODE_CLASS (GET_MODE (src)) != MODE_FLOAT
+ && arith_double_operand (src, GET_MODE (src)))
return GET_MODE_SIZE (GET_MODE (src)) <= GET_MODE_SIZE (DImode);
/* This matches "*return_sf_no_fpu". */
@@ -2520,7 +2526,8 @@ eligible_for_sibcall_delay (trial)
src = SET_SRC (pat);
- if (arith_operand (src, GET_MODE (src)))
+ if (GET_MODE_CLASS (GET_MODE (src)) != MODE_FLOAT
+ && arith_operand (src, GET_MODE (src)))
{
if (TARGET_ARCH64)
return GET_MODE_SIZE (GET_MODE (src)) <= GET_MODE_SIZE (DImode);
@@ -2528,7 +2535,8 @@ eligible_for_sibcall_delay (trial)
return GET_MODE_SIZE (GET_MODE (src)) <= GET_MODE_SIZE (SImode);
}
- else if (arith_double_operand (src, GET_MODE (src)))
+ else if (GET_MODE_CLASS (GET_MODE (src)) != MODE_FLOAT
+ && arith_double_operand (src, GET_MODE (src)))
return GET_MODE_SIZE (GET_MODE (src)) <= GET_MODE_SIZE (DImode);
else if (! TARGET_FPU && restore_operand (SET_DEST (pat), SFmode)
@@ -2974,7 +2982,7 @@ enum sparc_mode_class {
#define DF_MODES (S_MODES | D_MODES)
/* Modes for double-float only quantities. */
-#define DF_MODES_NO_S (D_MODES)
+#define DF_MODES_NO_S ((1 << (int) D_MODE) | (1 << (int) DF_MODE))
/* Modes for quad-float only quantities. */
#define TF_ONLY_MODES (1 << (int) TF_MODE)
@@ -3591,8 +3599,17 @@ output_function_epilogue (file, size, leaf_function)
if (! leaf_function)
{
+ if (current_function_calls_eh_return)
+ {
+ if (current_function_epilogue_delay_list)
+ abort ();
+ if (SKIP_CALLERS_UNIMP_P)
+ abort ();
+
+ fputs ("\trestore\n\tretl\n\tadd\t%sp, %g1, %sp\n", file);
+ }
/* If we wound up with things in our delay slot, flush them here. */
- if (current_function_epilogue_delay_list)
+ else if (current_function_epilogue_delay_list)
{
rtx delay = PATTERN (XEXP (current_function_epilogue_delay_list, 0));
@@ -3632,6 +3649,8 @@ output_function_epilogue (file, size, leaf_function)
else
fprintf (file, "\t%s\n\trestore\n", ret);
}
+ else if (current_function_calls_eh_return)
+ abort ();
/* All of the following cases are for leaf functions. */
else if (current_function_epilogue_delay_list)
{
@@ -4683,9 +4702,11 @@ function_value (type, mode, incoming_p)
return function_arg_record_value (type, mode, 0, 1, regbase);
}
- else if (TREE_CODE (type) == UNION_TYPE)
+ else if (AGGREGATE_TYPE_P (type))
{
- int bytes = int_size_in_bytes (type);
+ /* All other aggregate types are passed in an integer register
+ in a mode corresponding to the size of the type. */
+ HOST_WIDE_INT bytes = int_size_in_bytes (type);
if (bytes > 32)
abort ();
@@ -4697,7 +4718,7 @@ function_value (type, mode, incoming_p)
if (TARGET_ARCH64
&& GET_MODE_CLASS (mode) == MODE_INT
&& GET_MODE_SIZE (mode) < UNITS_PER_WORD
- && type && TREE_CODE (type) != UNION_TYPE)
+ && type && ! AGGREGATE_TYPE_P (type))
mode = DImode;
if (incoming_p)
@@ -6886,7 +6907,7 @@ sparc_flat_epilogue_delay_slots ()
return 0;
}
-/* Return true is TRIAL is a valid insn for the epilogue delay slot.
+/* Return true if TRIAL is a valid insn for the epilogue delay slot.
Any single length instruction which doesn't reference the stack or frame
pointer is OK. */
diff --git a/gcc/config/sparc/sparc.h b/gcc/config/sparc/sparc.h
index cc6b014900f..4d6feac7997 100644
--- a/gcc/config/sparc/sparc.h
+++ b/gcc/config/sparc/sparc.h
@@ -223,6 +223,7 @@ Unrecognized value in TARGET_CPU_DEFAULT.
/* Common CPP definitions used by CPP_SPEC amongst the various targets
for handling -mcpu=xxx switches. */
#define CPP_CPU_SPEC "\
+%{msoft-float:-D_SOFT_FLOAT} \
%{mcypress:} \
%{msparclite:-D__sparclite__} \
%{mf930:-D__sparclite__} %{mf934:-D__sparclite__} \
@@ -2235,7 +2236,10 @@ LFLGRET"ID":\n\
bias if present. */
#define INCOMING_FRAME_SP_OFFSET SPARC_STACK_BIAS
-#define DOESNT_NEED_UNWINDER (! TARGET_FLAT)
+/* Describe how we implement __builtin_eh_return. */
+#define EH_RETURN_DATA_REGNO(N) ((N) < 4 ? (N) + 24 : INVALID_REGNUM)
+#define EH_RETURN_STACKADJ_RTX gen_rtx_REG (Pmode, 1) /* %g1 */
+#define EH_RETURN_HANDLER_RTX gen_rtx_REG (Pmode, 31) /* %i7 */
/* Addressing modes, and classification of registers for them. */
diff --git a/gcc/config/sparc/sparc.md b/gcc/config/sparc/sparc.md
index 861aee2c866..6ec47192691 100644
--- a/gcc/config/sparc/sparc.md
+++ b/gcc/config/sparc/sparc.md
@@ -1,6 +1,6 @@
;- Machine description for SPARC chip for GNU C compiler
;; Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
-;; 1999, 2000, 2001 Free Software Foundation, Inc.
+;; 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.
@@ -3095,11 +3095,58 @@
[(set_attr "type" "fpmove,fpmove,move,move,move,*,load,fpload,fpstore,store")
(set_attr "length" "1")])
+;; Exactly the same as above, except that all `f' cases are deleted.
+;; This is necessary to prevent reload from ever trying to use a `f' reg
+;; when -mno-fpu.
+
+(define_insn "*movsf_no_f_insn"
+ [(set (match_operand:SF 0 "nonimmediate_operand" "=r,r,r,r,r,m")
+ (match_operand:SF 1 "input_operand" "G,Q,rR,S,m,rG"))]
+ "! TARGET_FPU
+ && (register_operand (operands[0], SFmode)
+ || register_operand (operands[1], SFmode)
+ || fp_zero_operand (operands[1], SFmode))"
+ "*
+{
+ if (GET_CODE (operands[1]) == CONST_DOUBLE
+ && (which_alternative == 1
+ || which_alternative == 2
+ || which_alternative == 3))
+ {
+ REAL_VALUE_TYPE r;
+ long i;
+
+ REAL_VALUE_FROM_CONST_DOUBLE (r, operands[1]);
+ REAL_VALUE_TO_TARGET_SINGLE (r, i);
+ operands[1] = GEN_INT (i);
+ }
+
+ switch (which_alternative)
+ {
+ case 0:
+ return \"clr\\t%0\";
+ case 1:
+ return \"sethi\\t%%hi(%a1), %0\";
+ case 2:
+ return \"mov\\t%1, %0\";
+ case 3:
+ return \"#\";
+ case 4:
+ return \"ld\\t%1, %0\";
+ case 5:
+ return \"st\\t%r1, %0\";
+ default:
+ abort();
+ }
+}"
+ [(set_attr "type" "move,move,move,*,load,store")
+ (set_attr "length" "1")])
+
(define_insn "*movsf_lo_sum"
- [(set (match_operand:SF 0 "register_operand" "")
- (lo_sum:SF (match_operand:SF 1 "register_operand" "")
- (match_operand:SF 2 "const_double_operand" "")))]
- "TARGET_FPU && fp_high_losum_p (operands[2])"
+ [(set (match_operand:SF 0 "register_operand" "=r")
+ (lo_sum:SF (match_operand:SF 1 "register_operand" "r")
+ (match_operand:SF 2 "const_double_operand" "S")))]
+ "fp_high_losum_p (operands[2])"
"*
{
REAL_VALUE_TYPE r;
@@ -3114,9 +3161,9 @@
(set_attr "length" "1")])
(define_insn "*movsf_high"
- [(set (match_operand:SF 0 "register_operand" "")
- (high:SF (match_operand:SF 1 "const_double_operand" "")))]
- "TARGET_FPU && fp_high_losum_p (operands[1])"
+ [(set (match_operand:SF 0 "register_operand" "=r")
+ (high:SF (match_operand:SF 1 "const_double_operand" "S")))]
+ "fp_high_losum_p (operands[1])"
"*
{
REAL_VALUE_TYPE r;
@@ -3133,30 +3180,12 @@
(define_split
[(set (match_operand:SF 0 "register_operand" "")
(match_operand:SF 1 "const_double_operand" ""))]
- "TARGET_FPU
- && fp_high_losum_p (operands[1])
+ "fp_high_losum_p (operands[1])
&& (GET_CODE (operands[0]) == REG
&& REGNO (operands[0]) < 32)"
[(set (match_dup 0) (high:SF (match_dup 1)))
(set (match_dup 0) (lo_sum:SF (match_dup 0) (match_dup 1)))])
-;; Exactly the same as above, except that all `f' cases are deleted.
-;; This is necessary to prevent reload from ever trying to use a `f' reg
-;; when -mno-fpu.
-
-(define_insn "*movsf_no_f_insn"
- [(set (match_operand:SF 0 "nonimmediate_operand" "=r,r,m")
- (match_operand:SF 1 "input_operand" "r,m,r"))]
- "! TARGET_FPU
- && (register_operand (operands[0], SFmode)
- || register_operand (operands[1], SFmode))"
- "@
- mov\\t%1, %0
- ld\\t%1, %0
- st\\t%1, %0"
- [(set_attr "type" "move,load,store")
- (set_attr "length" "1")])
-
(define_expand "movsf"
[(set (match_operand:SF 0 "general_operand" "")
(match_operand:SF 1 "general_operand" ""))]
@@ -3240,6 +3269,11 @@
&& fp_zero_operand (operands[1], DFmode))
goto movdf_is_ok;
+ /* We are able to build any DF constant in integer registers. */
+ if (REGNO (operands[0]) < 32
+ && (reload_completed || reload_in_progress))
+ goto movdf_is_ok;
+
operands[1] = validize_mem (force_const_mem (GET_MODE (operands[0]),
operands[1]));
}
@@ -5477,7 +5511,7 @@
(define_expand "fix_trunctfdi2"
[(set (match_operand:DI 0 "register_operand" "=e")
- (fix:SI (fix:TF (match_operand:TF 1 "register_operand" "e"))))]
+ (fix:DI (fix:TF (match_operand:TF 1 "register_operand" "e"))))]
"TARGET_V9 && TARGET_FPU && (TARGET_HARD_QUAD || TARGET_ARCH64)"
"
{
@@ -7108,8 +7142,8 @@
(match_operand:SI 2 "arith_operand" "rI")])
(const_int 0)))
(set (match_operand:SI 0 "register_operand" "=r")
- (match_dup 3))]
- ""
+ (match_operator:SI 4 "cc_arithop" [(match_dup 1) (match_dup 2)]))]
+ "GET_CODE (operands[3]) == GET_CODE (operands[4])"
"%A3cc\\t%1, %2, %0"
[(set_attr "type" "compare")
(set_attr "length" "1")])
@@ -7122,8 +7156,8 @@
(match_operand:DI 2 "arith_double_operand" "rHI")])
(const_int 0)))
(set (match_operand:DI 0 "register_operand" "=r")
- (match_dup 3))]
- "TARGET_ARCH64"
+ (match_operator:DI 4 "cc_arithop" [(match_dup 1) (match_dup 2)]))]
+ "TARGET_ARCH64 && GET_CODE (operands[3]) == GET_CODE (operands[4])"
"%A3cc\\t%1, %2, %0"
[(set_attr "type" "compare")
(set_attr "length" "1")])
@@ -7208,8 +7242,9 @@
(match_operand:SI 2 "reg_or_0_operand" "rJ")])
(const_int 0)))
(set (match_operand:SI 0 "register_operand" "=r")
- (match_dup 3))]
- ""
+ (match_operator:SI 4 "cc_arithopn"
+ [(not:SI (match_dup 1)) (match_dup 2)]))]
+ "GET_CODE (operands[3]) == GET_CODE (operands[4])"
"%B3cc\\t%r2, %1, %0"
[(set_attr "type" "compare")
(set_attr "length" "1")])
@@ -7222,8 +7257,9 @@
(match_operand:DI 2 "reg_or_0_operand" "rJ")])
(const_int 0)))
(set (match_operand:DI 0 "register_operand" "=r")
- (match_dup 3))]
- "TARGET_ARCH64"
+ (match_operator:DI 4 "cc_arithopn"
+ [(not:DI (match_dup 1)) (match_dup 2)]))]
+ "TARGET_ARCH64 && GET_CODE (operands[3]) == GET_CODE (operands[4])"
"%B3cc\\t%r2, %1, %0"
[(set_attr "type" "compare")
(set_attr "length" "1")])
@@ -8935,9 +8971,9 @@
#if 0
rtx chain = operands[0];
#endif
- rtx fp = operands[1];
+ rtx lab = operands[1];
rtx stack = operands[2];
- rtx lab = operands[3];
+ rtx fp = operands[3];
rtx labreg;
/* Trap instruction to flush all the register windows. */
@@ -9451,8 +9487,7 @@
(clobber (reg:SI 15))])
(set (pc) (label_ref (match_operand 3 "" "")))]
"short_branch (INSN_UID (insn), INSN_UID (operands[3]))
- && in_same_eh_region (insn, operands[3])
- && in_same_eh_region (insn, ins1)"
+ && (USING_SJLJ_EXCEPTIONS || ! can_throw_internal (ins1))"
"call\\t%a1, %2\\n\\tadd\\t%%o7, (%l3-.-4), %%o7")
(define_peephole
@@ -9461,8 +9496,7 @@
(clobber (reg:SI 15))])
(set (pc) (label_ref (match_operand 2 "" "")))]
"short_branch (INSN_UID (insn), INSN_UID (operands[2]))
- && in_same_eh_region (insn, operands[2])
- && in_same_eh_region (insn, ins1)"
+ && (USING_SJLJ_EXCEPTIONS || ! can_throw_internal (ins1))"
"call\\t%a0, %1\\n\\tadd\\t%%o7, (%l2-.-4), %%o7")
(define_peephole
@@ -9473,8 +9507,7 @@
(set (pc) (label_ref (match_operand 3 "" "")))]
"TARGET_ARCH64
&& short_branch (INSN_UID (insn), INSN_UID (operands[3]))
- && in_same_eh_region (insn, operands[3])
- && in_same_eh_region (insn, ins1)"
+ && (USING_SJLJ_EXCEPTIONS || ! can_throw_internal (ins1))"
"call\\t%a1, %2\\n\\tadd\\t%%o7, (%l3-.-4), %%o7")
(define_peephole
@@ -9484,8 +9517,7 @@
(set (pc) (label_ref (match_operand 2 "" "")))]
"TARGET_ARCH64
&& short_branch (INSN_UID (insn), INSN_UID (operands[2]))
- && in_same_eh_region (insn, operands[2])
- && in_same_eh_region (insn, ins1)"
+ && (USING_SJLJ_EXCEPTIONS || ! can_throw_internal (ins1))"
"call\\t%a0, %1\\n\\tadd\\t%%o7, (%l2-.-4), %%o7")
(define_expand "prologue"
diff --git a/gcc/config/sparc/t-openbsd b/gcc/config/sparc/t-openbsd
new file mode 100644
index 00000000000..898a24e079d
--- /dev/null
+++ b/gcc/config/sparc/t-openbsd
@@ -0,0 +1,5 @@
+# The native linker doesn't handle linking -fpic code with -fPIC code. Ugh.
+# We cope by building both variants of libgcc.
+MULTILIB_OPTIONS = fpic/fPIC
+LIBGCC = stmp-multilib
+INSTALL_LIBGCC = install-multilib
diff --git a/gcc/config/sparc/xm-sparc.h b/gcc/config/sparc/xm-sparc.h
index e553a0df0b2..037fc4548c6 100644
--- a/gcc/config/sparc/xm-sparc.h
+++ b/gcc/config/sparc/xm-sparc.h
@@ -19,11 +19,6 @@ along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-
-/* #defines that need visibility everywhere. */
-#define FALSE 0
-#define TRUE 1
-
/* This describes the machine the compiler is hosted on. */
#define HOST_BITS_PER_CHAR 8
#define HOST_BITS_PER_SHORT 16
diff --git a/gcc/config/sparc/xm-sysv4.h b/gcc/config/sparc/xm-sysv4.h
index 6e663d12cfa..43cacdb35a8 100644
--- a/gcc/config/sparc/xm-sysv4.h
+++ b/gcc/config/sparc/xm-sysv4.h
@@ -19,11 +19,6 @@ along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-
-/* #defines that need visibility everywhere. */
-#define FALSE 0
-#define TRUE 1
-
/* This describes the machine the compiler is hosted on. */
#define HOST_BITS_PER_CHAR 8
#define HOST_BITS_PER_SHORT 16
diff --git a/gcc/config/t-freebsd b/gcc/config/t-freebsd
index d284b3e7e41..da9c6429acd 100644
--- a/gcc/config/t-freebsd
+++ b/gcc/config/t-freebsd
@@ -1,2 +1,8 @@
# Don't run fixproto
STMP_FIXPROTO =
+
+# Compile crtbeginS.o and crtendS.o with pic.
+CRTSTUFF_T_CFLAGS_S = -fPIC
+
+# Compile libgcc.a with pic.
+TARGET_LIBGCC2_CFLAGS += -fPIC
diff --git a/gcc/config/t-freebsd-thread b/gcc/config/t-freebsd-thread
index 06315c803b0..bcaa51dde87 100644
--- a/gcc/config/t-freebsd-thread
+++ b/gcc/config/t-freebsd-thread
@@ -1,4 +1,4 @@
# This is currently needed to compile libgcc2 for threads support
-TARGET_LIBGCC2_CFLAGS=-pthread
+TARGET_LIBGCC2_CFLAGS += -pthread
#T_CFLAGS=-pthread
#T_CPPFLAGS=-pthread
diff --git a/gcc/config/t-libgcc-pic b/gcc/config/t-libgcc-pic
new file mode 100644
index 00000000000..ff935fe1e05
--- /dev/null
+++ b/gcc/config/t-libgcc-pic
@@ -0,0 +1,2 @@
+# Compile libgcc2.a with pic.
+TARGET_LIBGCC2_CFLAGS = -fPIC
diff --git a/gcc/config/t-linux b/gcc/config/t-linux
index cac5d2e936a..f1b9340ff54 100644
--- a/gcc/config/t-linux
+++ b/gcc/config/t-linux
@@ -1,28 +1,14 @@
# Don't run fixproto
STMP_FIXPROTO =
-# Don't install "assert.h" in gcc. We use the one in glibc.
-INSTALL_ASSERT_H =
-
# Compile crtbeginS.o and crtendS.o with pic.
CRTSTUFF_T_CFLAGS_S = -fPIC
# Compile libgcc2.a with pic.
TARGET_LIBGCC2_CFLAGS = -fPIC
-# Build a shared libgcc library.
-SHLIB_EXT = .so
-SHLIB_LINK = $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -shared -nodefaultlibs \
- -Wl,--soname=@shlib_base_name@.so.0 \
- -Wl,--version-script=@shlib_map_file@ \
- -o @shlib_base_name@.so @multilib_flags@ @shlib_objs@ -lc && \
- rm -f @shlib_base_name@.so.0 && \
- $(LN_S) @shlib_base_name@.so @shlib_base_name@.so.0
-# $(slibdir) double quoted to protect it from expansion while building
-# libgcc.mk. We want this delayed until actual install time.
-SHLIB_INSTALL = $(INSTALL_DATA) @shlib_base_name@.so $$(slibdir)/@shlib_base_name@.so.0; \
- rm -f $$(slibdir)/@shlib_base_name@.so; \
- $(LN_S) @shlib_base_name@.so.0 $$(slibdir)/@shlib_base_name@.so
-SHLIB_MKMAP = $(srcdir)/mkmap-symver.awk
-SHLIB_MAPFILES = $(srcdir)/libgcc-std.ver $(srcdir)/config/libgcc-glibc.ver
+
+# Override t-slibgcc-elf-ver to export some libgcc symbols with
+# the symbol versions that glibc used.
+SHLIB_MAPFILES += $(srcdir)/config/libgcc-glibc.ver
# Do not build libgcc1. Let gcc generate those functions. The GNU/Linux
# C library can handle them.
diff --git a/gcc/config/t-linux-aout b/gcc/config/t-linux-aout
index 8826cddcab6..d08bcff9867 100644
--- a/gcc/config/t-linux-aout
+++ b/gcc/config/t-linux-aout
@@ -1,9 +1,6 @@
# Don't run fixproto
STMP_FIXPROTO =
-# Don't install "assert.h" in gcc. We use the one in glibc.
-INSTALL_ASSERT_H =
-
# Do not build libgcc1. Let gcc generate those functions. The GNU/Linux
# C library can handle them.
LIBGCC1 =
diff --git a/gcc/config/t-netbsd b/gcc/config/t-netbsd
index 85d6057feb0..f64fe29b6d1 100644
--- a/gcc/config/t-netbsd
+++ b/gcc/config/t-netbsd
@@ -4,6 +4,3 @@ LIBGCC1_TEST=
# Don't run fixproto
STMP_FIXPROTO =
-
-# Don't install "assert.h" in gcc. We use the one in glibc.
-INSTALL_ASSERT_H =
diff --git a/gcc/config/t-openbsd b/gcc/config/t-openbsd
index 14bebc13e6b..0489e872038 100644
--- a/gcc/config/t-openbsd
+++ b/gcc/config/t-openbsd
@@ -3,5 +3,3 @@ STMP_FIXPROTO =
# We don't need GCC's own include files but we do need lang specific ones.
USER_H = ${LANG_EXTRA_HEADERS}
-INSTALL_ASSERT_H =
-
diff --git a/gcc/config/t-rtems b/gcc/config/t-rtems
index 5d7d5696c3d..c403ff85dda 100644
--- a/gcc/config/t-rtems
+++ b/gcc/config/t-rtems
@@ -1,9 +1,6 @@
# RTEMS uses newlib which does not require prototype fixing
STMP_FIXPROTO =
-# Don't install "assert.h" in gcc. RTEMS uses the one in newlib.
-INSTALL_ASSERT_H =
-
# RTEMS always has limits.h.
LIMITS_H_TEST = true
diff --git a/gcc/config/sparc/t-slibgcc b/gcc/config/t-slibgcc-elf-ver
index 1c52bcb1323..9b17c565170 100644
--- a/gcc/config/sparc/t-slibgcc
+++ b/gcc/config/t-slibgcc-elf-ver
@@ -1,16 +1,17 @@
-# Build a shared libgcc library with the GNU linker.
+# Build a shared libgcc library for ELF with symbol versioning
+# with the GNU linker.
SHLIB_EXT = .so
SHLIB_LINK = $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -shared -nodefaultlibs \
- -Wl,--soname=@shlib_base_name@.so.0 \
+ -Wl,--soname=@shlib_base_name@.so.1 \
-Wl,--version-script=@shlib_map_file@ \
-o @shlib_base_name@.so @multilib_flags@ @shlib_objs@ -lc && \
- rm -f @shlib_base_name@.so.0 && \
- $(LN_S) @shlib_base_name@.so @shlib_base_name@.so.0
+ rm -f @shlib_base_name@.so.1 && \
+ $(LN_S) @shlib_base_name@.so @shlib_base_name@.so.1
# $(slibdir) double quoted to protect it from expansion while building
# libgcc.mk. We want this delayed until actual install time.
-SHLIB_INSTALL = $(INSTALL_DATA) @shlib_base_name@.so $$(slibdir)/@shlib_base_name@.so.0; \
+SHLIB_INSTALL = $(INSTALL_DATA) @shlib_base_name@.so $$(slibdir)/@shlib_base_name@.so.1; \
rm -f $$(slibdir)/@shlib_base_name@.so; \
- $(LN_S) @shlib_base_name@.so.0 $$(slibdir)/@shlib_base_name@.so
+ $(LN_S) @shlib_base_name@.so.1 $$(slibdir)/@shlib_base_name@.so
SHLIB_MKMAP = $(srcdir)/mkmap-symver.awk
SHLIB_MAPFILES = $(srcdir)/libgcc-std.ver
diff --git a/gcc/config/sparc/t-slibgcc-sld b/gcc/config/t-slibgcc-sld
index 50107229e50..83db1a95042 100644
--- a/gcc/config/sparc/t-slibgcc-sld
+++ b/gcc/config/t-slibgcc-sld
@@ -2,15 +2,15 @@
SHLIB_EXT = .so
SHLIB_LINK = $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -shared -nodefaultlibs \
- -Wl,-h,@shlib_base_name@.so.0 -Wl,-z,text -Wl,-z,defs \
+ -Wl,-h,@shlib_base_name@.so.1 -Wl,-z,text -Wl,-z,defs \
-Wl,-M,@shlib_map_file@ -o @shlib_base_name@.so \
@multilib_flags@ @shlib_objs@ -lc && \
- rm -f @shlib_base_name@.so.0 && \
- $(LN_S) @shlib_base_name@.so @shlib_base_name@.so.0
+ rm -f @shlib_base_name@.so.1 && \
+ $(LN_S) @shlib_base_name@.so @shlib_base_name@.so.1
# $(slibdir) double quoted to protect it from expansion while building
# libgcc.mk. We want this delayed until actual install time.
-SHLIB_INSTALL = $(INSTALL_DATA) @shlib_base_name@.so $$(slibdir)/@shlib_base_name@.so.0; \
+SHLIB_INSTALL = $(INSTALL_DATA) @shlib_base_name@.so $$(slibdir)/@shlib_base_name@.so.1; \
rm -f $$(slibdir)/@shlib_base_name@.so; \
- $(LN_S) @shlib_base_name@.so.0 $$(slibdir)/@shlib_base_name@.so
+ $(LN_S) @shlib_base_name@.so.1 $$(slibdir)/@shlib_base_name@.so
SHLIB_MKMAP = $(srcdir)/mkmap-symver.awk
SHLIB_MAPFILES = $(srcdir)/libgcc-std.ver
diff --git a/gcc/config/v850/rtems.h b/gcc/config/v850/rtems.h
index 6317e5da455..6d1dfe1a6d6 100644
--- a/gcc/config/v850/rtems.h
+++ b/gcc/config/v850/rtems.h
@@ -1,5 +1,5 @@
/* Definitions for rtems targeting a v850 using elf
- Copyright (C) 1996, 1997, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1997, 2000, 2002 Free Software Foundation, Inc.
Contributed by Joel Sherrill (joel@OARcorp.com).
This file is part of GNU CC.
@@ -24,7 +24,7 @@ Boston, MA 02111-1307, USA. */
/* Specify predefined symbols in preprocessor. */
#undef CPP_PREDEFINES
-#define CPP_PREDEFINES "-D__v851__ -D__v850 -Drtems \
+#define CPP_PREDEFINES "-D__v851__ -D__v850 \
-Asystem=rtems -Acpu=v850 -Amachine=v850"
/* Generate calls to memcpy, memcmp and memset. */
diff --git a/gcc/config/v850/v850.c b/gcc/config/v850/v850.c
index ffc2a2474de..78f6f588bce 100644
--- a/gcc/config/v850/v850.c
+++ b/gcc/config/v850/v850.c
@@ -29,7 +29,6 @@ Boston, MA 02111-1307, USA. */
#include "real.h"
#include "insn-config.h"
#include "conditions.h"
-#include "insn-flags.h"
#include "output.h"
#include "insn-attr.h"
#include "flags.h"
@@ -2806,7 +2805,8 @@ static void
v850_mark_machine_status (p)
struct function * p;
{
- ggc_mark_rtx (p->machine->ra_rtx);
+ if (p->machine)
+ ggc_mark_rtx (p->machine->ra_rtx);
}
static void
diff --git a/gcc/config/v850/xm-v850.h b/gcc/config/v850/xm-v850.h
index 7e2da6749a3..aa6f75bd804 100644
--- a/gcc/config/v850/xm-v850.h
+++ b/gcc/config/v850/xm-v850.h
@@ -19,10 +19,6 @@ along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-/* #defines that need visibility everywhere. */
-#define FALSE 0
-#define TRUE 1
-
/* This describes the machine the compiler is hosted on. */
#define HOST_BITS_PER_CHAR 8
#define HOST_BITS_PER_SHORT 16
diff --git a/gcc/config/vax/vax.c b/gcc/config/vax/vax.c
index 38c86f05351..e642ed965cb 100644
--- a/gcc/config/vax/vax.c
+++ b/gcc/config/vax/vax.c
@@ -27,7 +27,6 @@ Boston, MA 02111-1307, USA. */
#include "real.h"
#include "insn-config.h"
#include "conditions.h"
-#include "insn-flags.h"
#include "function.h"
#include "output.h"
#include "insn-attr.h"
diff --git a/gcc/config/vax/vax.h b/gcc/config/vax/vax.h
index 06b6d219d77..a3a9dde538d 100644
--- a/gcc/config/vax/vax.h
+++ b/gcc/config/vax/vax.h
@@ -1,6 +1,6 @@
/* Definitions of target machine for GNU compiler. Vax version.
Copyright (C) 1987, 1988, 1991, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000 Free Software Foundation, Inc.
+ 1999, 2000, 2001 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -865,6 +865,10 @@ enum reg_class { NO_REGS, ALL_REGS, LIM_REG_CLASSES };
is done just by pretending it is already truncated. */
#define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1
+/* When a prototype says `char' or `short', really pass an `int'.
+ (On the vax, this is required for system-library compatibility.) */
+#define PROMOTE_PROTOTYPES 1
+
/* Specify the machine mode that pointers have.
After generation of rtl, the compiler makes no further distinction
between pointers and any other objects of this machine mode. */
@@ -982,7 +986,30 @@ enum reg_class { NO_REGS, ALL_REGS, LIM_REG_CLASSES };
CC_STATUS_INIT; \
else if (GET_CODE (SET_DEST (EXP)) != ZERO_EXTRACT \
&& GET_CODE (SET_DEST (EXP)) != PC) \
- { cc_status.flags = 0; \
+ { \
+ cc_status.flags = 0; \
+ /* The integer operations below don't set carry or \
+ set it in an incompatible way. That's ok though \
+ as the Z bit is all we need when doing unsigned \
+ comparisons on the result of these insns (since \
+ they're always with 0). Set CC_NO_OVERFLOW to \
+ generate the correct unsigned branches. */ \
+ switch (GET_CODE (SET_SRC (EXP))) \
+ { \
+ case NEG: \
+ if (GET_MODE_CLASS (GET_MODE (EXP)) == MODE_FLOAT)\
+ break; \
+ case AND: \
+ case IOR: \
+ case XOR: \
+ case NOT: \
+ case MEM: \
+ case REG: \
+ cc_status.flags = CC_NO_OVERFLOW; \
+ break; \
+ default: \
+ break; \
+ } \
cc_status.value1 = SET_DEST (EXP); \
cc_status.value2 = SET_SRC (EXP); } } \
else if (GET_CODE (EXP) == PARALLEL \
@@ -1018,8 +1045,17 @@ 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)
-#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. */
@@ -1208,17 +1244,6 @@ do { char dstr[30]; \
( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 10), \
sprintf ((OUTPUT), "%s.%d", (NAME), (LABELNO)))
-/* 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_IDENTIFY_LANGUAGE(FILE) \
- do { \
- output_lang_identify (FILE); \
- if (write_symbols == DBX_DEBUG) \
- fprintf (FILE, "___vax_%c_doubles:\n", ASM_DOUBLE_CHAR); \
- } while (0)
-
/* Output code to add DELTA to the first argument, and then jump to FUNCTION.
Used for C++ multiple inheritance.
.mask ^m<r2,r3,r4,r5,r6,r7,r8,r9,r10,r11> #conservative entry mask
diff --git a/gcc/config/vax/xm-vax.h b/gcc/config/vax/xm-vax.h
index d7ef168f3cd..0f2cffc64cd 100644
--- a/gcc/config/vax/xm-vax.h
+++ b/gcc/config/vax/xm-vax.h
@@ -18,10 +18,6 @@ along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-/* #defines that need visibility everywhere. */
-#define FALSE 0
-#define TRUE 1
-
/* target machine dependencies.
tm.h is a symbolic link to the actual target specific file. */
#include "tm.h"
@@ -42,4 +38,3 @@ Boston, MA 02111-1307, USA. */
/* isinf isn't there, but finite is. */
#define isinf(x) (!finite(x))
-
diff --git a/gcc/config/vax/xm-vms.h b/gcc/config/vax/xm-vms.h
index e2980f29fd6..5ff290eebcf 100644
--- a/gcc/config/vax/xm-vms.h
+++ b/gcc/config/vax/xm-vms.h
@@ -18,10 +18,6 @@ along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-/* #defines that need visibility everywhere. */
-#define FALSE 0
-#define TRUE 1
-
/* Other configurations get these via autoconfig. */
#define STDC_HEADERS 1
#define HAVE_STDLIB_H 1
diff --git a/gcc/config/we32k/xm-we32k.h b/gcc/config/we32k/xm-we32k.h
index be617d37317..c437c25f406 100644
--- a/gcc/config/we32k/xm-we32k.h
+++ b/gcc/config/we32k/xm-we32k.h
@@ -19,11 +19,6 @@ along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-
-/* #defines that need visibility everywhere. */
-#define FALSE 0
-#define TRUE 1
-
/* This describes the machine the compiler is hosted on. */
#define HOST_BITS_PER_CHAR 8
#define HOST_BITS_PER_SHORT 16
diff --git a/gcc/config/x-linux b/gcc/config/x-linux
index a7c091799e8..d284b3e7e41 100644
--- a/gcc/config/x-linux
+++ b/gcc/config/x-linux
@@ -1,5 +1,2 @@
# Don't run fixproto
STMP_FIXPROTO =
-
-# Don't install "assert.h" in gcc. We use the one in glibc.
-INSTALL_ASSERT_H =
diff --git a/gcc/config/xm-lynx.h b/gcc/config/xm-lynx.h
index 009f8445eab..aa75f01021b 100644
--- a/gcc/config/xm-lynx.h
+++ b/gcc/config/xm-lynx.h
@@ -22,10 +22,6 @@ Boston, MA 02111-1307, USA. */
running Lynx. This file should not be specified as $xm_file itself;
instead $xm_file should be CPU/xm-lynx.h, which should include this one. */
-/* #defines that need visibility everywhere. */
-#define FALSE 0
-#define TRUE 1
-
/* Arguments to use with `exit'. */
#define SUCCESS_EXIT_CODE 0
#define FATAL_EXIT_CODE 33
diff --git a/gcc/config/xm-std32.h b/gcc/config/xm-std32.h
index c52782e9741..e38f8247355 100644
--- a/gcc/config/xm-std32.h
+++ b/gcc/config/xm-std32.h
@@ -18,10 +18,6 @@ along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-/* #defines that need visibility everywhere. */
-#define FALSE 0
-#define TRUE 1
-
/* This describes the machine the compiler is hosted on. */
#define HOST_BITS_PER_CHAR 8
#define HOST_BITS_PER_SHORT 16
diff --git a/gcc/config/xtensa/elf.h b/gcc/config/xtensa/elf.h
new file mode 100644
index 00000000000..7a1b70e07b2
--- /dev/null
+++ b/gcc/config/xtensa/elf.h
@@ -0,0 +1,138 @@
+/* Xtensa/Elf configuration.
+ Derived from the configuration for GCC for Intel i386 running Linux.
+ Copyright (C) 2001 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+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.
+
+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 GCC; see the file COPYING. If not, write to the Free
+Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+02111-1307, USA. */
+
+/* Don't assume anything about the header files. */
+#define NO_IMPLICIT_EXTERN_C
+
+#undef ASM_APP_ON
+#define ASM_APP_ON "#APP\n"
+
+#undef ASM_APP_OFF
+#define ASM_APP_OFF "#NO_APP\n"
+
+/* Debug format: prefer DWARF2 */
+#undef PREFERRED_DEBUGGING_TYPE
+#define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
+
+#undef MD_EXEC_PREFIX
+#undef MD_STARTFILE_PREFIX
+
+#undef TARGET_VERSION
+#define TARGET_VERSION fputs (" (Xtensa/ELF)", stderr);
+
+#undef SIZE_TYPE
+#define SIZE_TYPE "unsigned int"
+
+#undef PTRDIFF_TYPE
+#define PTRDIFF_TYPE "int"
+
+#undef WCHAR_TYPE
+#define WCHAR_TYPE "int"
+
+#undef WCHAR_TYPE_SIZE
+#define WCHAR_TYPE_SIZE BITS_PER_WORD
+
+#undef ASM_SPEC
+#define ASM_SPEC "%{v} %{mno-density:--no-density} \
+ %{mtext-section-literals:--text-section-literals} \
+ %{mno-text-section-literals:--no-text-section-literals} \
+ %{mtarget-align:--target-align} \
+ %{mno-target-align:--no-target-align} \
+ %{mlongcalls:--longcalls} \
+ %{mno-longcalls:--no-longcalls}"
+
+#undef ASM_FINAL_SPEC
+
+#undef LIB_SPEC
+#define LIB_SPEC "-lc -lsim -lc -lhandlers-sim"
+
+#undef STARTFILE_SPEC
+#define STARTFILE_SPEC "crt1-sim%O%s crti%O%s crtbegin%O%s _vectors%O%s"
+
+#undef ENDFILE_SPEC
+#define ENDFILE_SPEC "crtend%O%s crtn%O%s"
+
+#undef LINK_SPEC
+#define LINK_SPEC \
+ "%{shared:-shared} \
+ %{!shared: \
+ %{!static: \
+ %{rdynamic:-export-dynamic} \
+ %{static:-static}}}"
+
+#undef CPP_PREDEFINES
+#define CPP_PREDEFINES "-D__XTENSA__ -D__ELF__ -Acpu=xtensa -Amachine=xtensa"
+
+/* Local compiler-generated symbols must have a prefix that the assembler
+ understands. By default, this is $, although some targets (e.g.,
+ NetBSD-ELF) need to override this. */
+
+#ifndef LOCAL_LABEL_PREFIX
+#define LOCAL_LABEL_PREFIX "."
+#endif
+
+/* By default, external symbols do not have an underscore prepended. */
+
+#ifndef USER_LABEL_PREFIX
+#define USER_LABEL_PREFIX ""
+#endif
+
+/* Define this macro if the assembler does not accept the character
+ "." in label names. By default constructors and destructors in G++
+ have names that use ".". If this macro is defined, these names
+ are rewritten to avoid ".". */
+#define NO_DOT_IN_LABEL
+
+/* Define NO_DOLLAR_IN_LABEL in your favorite tm file if your assembler
+ doesn't allow $ in symbol names. */
+#undef NO_DOLLAR_IN_LABEL
+
+/* Do not force "-fpic" for this target. */
+#define XTENSA_ALWAYS_PIC 0
+
+/* Redefine the standard ELF version of ASM_DECLARE_FUNCTION_SIZE to
+ allow adding the ".end literal_prefix" directive at the end of the
+ function. */
+#undef ASM_DECLARE_FUNCTION_SIZE
+#define ASM_DECLARE_FUNCTION_SIZE(FILE, FNAME, DECL) \
+ do \
+ { \
+ if (!flag_inhibit_size_directive) \
+ { \
+ char label[256]; \
+ static int labelno; \
+ \
+ labelno++; \
+ \
+ ASM_GENERATE_INTERNAL_LABEL (label, "Lfe", labelno); \
+ ASM_OUTPUT_INTERNAL_LABEL (FILE, "Lfe", labelno); \
+ \
+ fprintf (FILE, "%s", SIZE_ASM_OP); \
+ assemble_name (FILE, (FNAME)); \
+ fprintf (FILE, ","); \
+ assemble_name (FILE, label); \
+ fprintf (FILE, "-"); \
+ assemble_name (FILE, (FNAME)); \
+ putc ('\n', FILE); \
+ } \
+ XTENSA_DECLARE_FUNCTION_SIZE(FILE, FNAME, DECL); \
+ } \
+ while (0)
diff --git a/gcc/config/xtensa/lib1funcs.asm b/gcc/config/xtensa/lib1funcs.asm
new file mode 100644
index 00000000000..629f57b8a99
--- /dev/null
+++ b/gcc/config/xtensa/lib1funcs.asm
@@ -0,0 +1,428 @@
+/* Assembly functions for the Xtensa version of libgcc1.
+ Copyright (C) 2001 Free Software Foundation, Inc.
+ Contributed by Bob Wilson (bwilson@tensilica.com) at Tensilica.
+
+This file is part of GCC.
+
+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.
+
+In addition to the permissions in the GNU General Public License, the
+Free Software Foundation gives you unlimited permission to link the
+compiled version of this file into combinations with other programs,
+and to distribute those combinations without any restriction coming
+from the use of this file. (The General Public License restrictions
+do apply in other respects; for example, they cover modification of
+the file, and distribution when not linked into a combine
+executable.)
+
+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 GCC; see the file COPYING. If not, write to the Free
+Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+02111-1307, USA. */
+
+#include "xtensa/xtensa-config.h"
+
+#ifdef L_mulsi3
+ .align 4
+ .global __mulsi3
+ .type __mulsi3,@function
+__mulsi3:
+ entry sp, 16
+
+#if XCHAL_HAVE_MUL16
+ or a4, a2, a3
+ srai a4, a4, 16
+ bnez a4, .LMUL16
+ mul16u a2, a2, a3
+ retw
+.LMUL16:
+ srai a4, a2, 16
+ srai a5, a3, 16
+ mul16u a7, a4, a3
+ mul16u a6, a5, a2
+ mul16u a4, a2, a3
+ add a7, a7, a6
+ slli a7, a7, 16
+ add a2, a7, a4
+
+#elif XCHAL_HAVE_MAC16
+ mul.aa.hl a2, a3
+ mula.aa.lh a2, a3
+ rsr a5, 16 # ACCLO
+ umul.aa.ll a2, a3
+ rsr a4, 16 # ACCLO
+ slli a5, a5, 16
+ add a2, a4, a5
+
+#else /* !XCHAL_HAVE_MUL16 && !XCHAL_HAVE_MAC16 */
+
+ # Multiply one bit at a time, but unroll the loop 4x to better
+ # exploit the addx instructions.
+
+ # Peel the first iteration to save a cycle on init
+
+ # avoid negative numbers
+
+ xor a5, a2, a3 # top bit is 1 iff one of the inputs is negative
+ abs a3, a3
+ abs a2, a2
+
+ # swap so that second argument is smaller
+ sub a7, a2, a3
+ mov a4, a3
+ movgez a4, a2, a7 # a4 = max(a2, a3)
+ movltz a3, a2, a7 # a3 = min(a2, a3)
+
+ movi a2, 0
+ extui a6, a3, 0, 1
+ movnez a2, a4, a6
+
+ addx2 a7, a4, a2
+ extui a6, a3, 1, 1
+ movnez a2, a7, a6
+
+ addx4 a7, a4, a2
+ extui a6, a3, 2, 1
+ movnez a2, a7, a6
+
+ addx8 a7, a4, a2
+ extui a6, a3, 3, 1
+ movnez a2, a7, a6
+
+ bgeui a3, 16, .Lmult_main_loop
+ neg a3, a2
+ movltz a2, a3, a5
+ retw
+
+
+ .align 4
+.Lmult_main_loop:
+ srli a3, a3, 4
+ slli a4, a4, 4
+
+ add a7, a4, a2
+ extui a6, a3, 0, 1
+ movnez a2, a7, a6
+
+ addx2 a7, a4, a2
+ extui a6, a3, 1, 1
+ movnez a2, a7, a6
+
+ addx4 a7, a4, a2
+ extui a6, a3, 2, 1
+ movnez a2, a7, a6
+
+ addx8 a7, a4, a2
+ extui a6, a3, 3, 1
+ movnez a2, a7, a6
+
+
+ bgeui a3, 16, .Lmult_main_loop
+
+ neg a3, a2
+ movltz a2, a3, a5
+
+#endif /* !XCHAL_HAVE_MUL16 && !XCHAL_HAVE_MAC16 */
+
+ retw
+.Lfe0:
+ .size __mulsi3,.Lfe0-__mulsi3
+
+#endif /* L_mulsi3 */
+
+
+ # Some Xtensa configurations include the NSAU (unsigned
+ # normalize shift amount) instruction which computes the number
+ # of leading zero bits. For other configurations, the "nsau"
+ # operation is implemented as a macro.
+
+#if !XCHAL_HAVE_NSA
+ .macro nsau cnt, val, tmp, a
+ mov \a, \val
+ movi \cnt, 0
+ extui \tmp, \a, 16, 16
+ bnez \tmp, 0f
+ movi \cnt, 16
+ slli \a, \a, 16
+0:
+ extui \tmp, \a, 24, 8
+ bnez \tmp, 1f
+ addi \cnt, \cnt, 8
+ slli \a, \a, 8
+1:
+ movi \tmp, __nsau_data
+ extui \a, \a, 24, 8
+ add \tmp, \tmp, \a
+ l8ui \tmp, \tmp, 0
+ add \cnt, \cnt, \tmp
+ .endm
+#endif /* !XCHAL_HAVE_NSA */
+
+#ifdef L_nsau
+ .section .rodata
+ .align 4
+ .global __nsau_data
+ .type __nsau_data,@object
+__nsau_data:
+#if !XCHAL_HAVE_NSA
+ .byte 8, 7, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4
+ .byte 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3
+ .byte 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2
+ .byte 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2
+ .byte 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
+ .byte 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
+ .byte 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
+ .byte 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
+ .byte 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+ .byte 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+ .byte 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+ .byte 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+ .byte 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+ .byte 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+ .byte 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+ .byte 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+#endif /* !XCHAL_HAVE_NSA */
+.Lfe1:
+ .size __nsau_data,.Lfe1-__nsau_data
+ .hidden __nsau_data
+#endif /* L_nsau */
+
+
+#ifdef L_udivsi3
+ .align 4
+ .global __udivsi3
+ .type __udivsi3,@function
+__udivsi3:
+ entry sp, 16
+ bltui a3, 2, .Lle_one # check if the divisor <= 1
+
+ mov a6, a2 # keep dividend in a6
+#if XCHAL_HAVE_NSA
+ nsau a5, a6 # dividend_shift = nsau(dividend)
+ nsau a4, a3 # divisor_shift = nsau(divisor)
+#else /* !XCHAL_HAVE_NSA */
+ nsau a5, a6, a2, a7 # dividend_shift = nsau(dividend)
+ nsau a4, a3, a2, a7 # divisor_shift = nsau(divisor)
+#endif /* !XCHAL_HAVE_NSA */
+ bgeu a5, a4, .Lspecial
+
+ sub a4, a4, a5 # count = divisor_shift - dividend_shift
+ ssl a4
+ sll a3, a3 # divisor <<= count
+ movi a2, 0 # quotient = 0
+
+ # test-subtract-and-shift loop; one quotient bit on each iteration
+ loopnez a4, .Lloopend
+ bltu a6, a3, .Lzerobit
+ sub a6, a6, a3
+ addi a2, a2, 1
+.Lzerobit:
+ slli a2, a2, 1
+ srli a3, a3, 1
+.Lloopend:
+
+ bltu a6, a3, .Lreturn
+ addi a2, a2, 1 # increment quotient if dividend >= divisor
+.Lreturn:
+ retw
+
+.Lspecial:
+ # return dividend >= divisor
+ movi a2, 0
+ bltu a6, a3, .Lreturn2
+ movi a2, 1
+.Lreturn2:
+ retw
+
+.Lle_one:
+ beqz a3, .Lerror # if divisor == 1, return the dividend
+ retw
+.Lerror:
+ movi a2, 0 # just return 0; could throw an exception
+ retw
+.Lfe2:
+ .size __udivsi3,.Lfe2-__udivsi3
+
+#endif /* L_udivsi3 */
+
+
+#ifdef L_divsi3
+ .align 4
+ .global __divsi3
+ .type __divsi3,@function
+__divsi3:
+ entry sp, 16
+ xor a7, a2, a3 # sign = dividend ^ divisor
+ abs a6, a2 # udividend = abs(dividend)
+ abs a3, a3 # udivisor = abs(divisor)
+ bltui a3, 2, .Lle_one # check if udivisor <= 1
+#if XCHAL_HAVE_NSA
+ nsau a5, a6 # udividend_shift = nsau(udividend)
+ nsau a4, a3 # udivisor_shift = nsau(udivisor)
+#else /* !XCHAL_HAVE_NSA */
+ nsau a5, a6, a2, a8 # udividend_shift = nsau(udividend)
+ nsau a4, a3, a2, a8 # udivisor_shift = nsau(udivisor)
+#endif /* !XCHAL_HAVE_NSA */
+ bgeu a5, a4, .Lspecial
+
+ sub a4, a4, a5 # count = udivisor_shift - udividend_shift
+ ssl a4
+ sll a3, a3 # udivisor <<= count
+ movi a2, 0 # quotient = 0
+
+ # test-subtract-and-shift loop; one quotient bit on each iteration
+ loopnez a4, .Lloopend
+ bltu a6, a3, .Lzerobit
+ sub a6, a6, a3
+ addi a2, a2, 1
+.Lzerobit:
+ slli a2, a2, 1
+ srli a3, a3, 1
+.Lloopend:
+
+ bltu a6, a3, .Lreturn
+ addi a2, a2, 1 # increment quotient if udividend >= udivisor
+.Lreturn:
+ neg a5, a2
+ movltz a2, a5, a7 # return (sign < 0) ? -quotient : quotient
+ retw
+
+.Lspecial:
+ movi a2, 0
+ bltu a6, a3, .Lreturn2 # if dividend < divisor, return 0
+ movi a2, 1
+ movi a4, -1
+ movltz a2, a4, a7 # else return (sign < 0) ? -1 : 1
+.Lreturn2:
+ retw
+
+.Lle_one:
+ beqz a3, .Lerror
+ neg a2, a6 # if udivisor == 1, then return...
+ movgez a2, a6, a7 # (sign < 0) ? -udividend : udividend
+ retw
+.Lerror:
+ movi a2, 0 # just return 0; could throw an exception
+ retw
+.Lfe3:
+ .size __divsi3,.Lfe3-__divsi3
+
+#endif /* L_divsi3 */
+
+
+#ifdef L_umodsi3
+ .align 4
+ .global __umodsi3
+ .type __umodsi3,@function
+__umodsi3:
+ entry sp, 16
+ bltui a3, 2, .Lle_one # check if the divisor is <= 1
+
+#if XCHAL_HAVE_NSA
+ nsau a5, a2 # dividend_shift = nsau(dividend)
+ nsau a4, a3 # divisor_shift = nsau(divisor)
+#else /* !XCHAL_HAVE_NSA */
+ nsau a5, a2, a6, a7 # dividend_shift = nsau(dividend)
+ nsau a4, a3, a6, a7 # divisor_shift = nsau(divisor)
+#endif /* !XCHAL_HAVE_NSA */
+ bgeu a5, a4, .Lspecial
+
+ sub a4, a4, a5 # count = divisor_shift - dividend_shift
+ ssl a4
+ sll a3, a3 # divisor <<= count
+
+ # test-subtract-and-shift loop
+ loopnez a4, .Lloopend
+ bltu a2, a3, .Lzerobit
+ sub a2, a2, a3
+.Lzerobit:
+ srli a3, a3, 1
+.Lloopend:
+
+ bltu a2, a3, .Lreturn
+ sub a2, a2, a3 # subtract once more if dividend >= divisor
+.Lreturn:
+ retw
+
+.Lspecial:
+ bltu a2, a3, .Lreturn2
+ sub a2, a2, a3 # subtract once if dividend >= divisor
+.Lreturn2:
+ retw
+
+.Lle_one:
+ # the divisor is either 0 or 1, so just return 0.
+ # someday we may want to throw an exception if the divisor is 0.
+ movi a2, 0
+ retw
+.Lfe4:
+ .size __umodsi3,.Lfe4-__umodsi3
+
+#endif /* L_umodsi3 */
+
+
+#ifdef L_modsi3
+ .align 4
+ .global __modsi3
+ .type __modsi3,@function
+__modsi3:
+ entry sp, 16
+ mov a7, a2 # save original (signed) dividend
+ abs a2, a2 # udividend = abs(dividend)
+ abs a3, a3 # udivisor = abs(divisor)
+ bltui a3, 2, .Lle_one # check if udivisor <= 1
+#if XCHAL_HAVE_NSA
+ nsau a5, a2 # udividend_shift = nsau(udividend)
+ nsau a4, a3 # udivisor_shift = nsau(udivisor)
+#else /* !XCHAL_HAVE_NSA */
+ nsau a5, a2, a6, a8 # udividend_shift = nsau(udividend)
+ nsau a4, a3, a6, a8 # udivisor_shift = nsau(udivisor)
+#endif /* !XCHAL_HAVE_NSA */
+ bgeu a5, a4, .Lspecial
+
+ sub a4, a4, a5 # count = udivisor_shift - udividend_shift
+ ssl a4
+ sll a3, a3 # udivisor <<= count
+
+ # test-subtract-and-shift loop
+ loopnez a4, .Lloopend
+ bltu a2, a3, .Lzerobit
+ sub a2, a2, a3
+.Lzerobit:
+ srli a3, a3, 1
+.Lloopend:
+
+ bltu a2, a3, .Lreturn
+ sub a2, a2, a3 # subtract once more if udividend >= udivisor
+.Lreturn:
+ bgez a7, .Lpositive
+ neg a2, a2 # if (dividend < 0), return -udividend
+.Lpositive:
+ retw
+
+.Lspecial:
+ bltu a2, a3, .Lreturn2
+ sub a2, a2, a3 # subtract once if dividend >= divisor
+.Lreturn2:
+ bgez a7, .Lpositive2
+ neg a2, a2 # if (dividend < 0), return -udividend
+.Lpositive2:
+ retw
+
+.Lle_one:
+ # udivisor is either 0 or 1, so just return 0.
+ # someday we may want to throw an exception if udivisor is 0.
+ movi a2, 0
+ retw
+.Lfe5:
+ .size __modsi3,.Lfe5-__modsi3
+
+#endif /* L_modsi3 */
diff --git a/gcc/config/xtensa/lib2funcs.S b/gcc/config/xtensa/lib2funcs.S
new file mode 100644
index 00000000000..f607e01f2ea
--- /dev/null
+++ b/gcc/config/xtensa/lib2funcs.S
@@ -0,0 +1,214 @@
+/* Assembly functions for libgcc2.
+ Copyright (C) 2001 Free Software Foundation, Inc.
+ Contributed by Bob Wilson (bwilson@tensilica.com) at Tensilica.
+
+This file is part of GCC.
+
+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.
+
+In addition to the permissions in the GNU General Public License, the
+Free Software Foundation gives you unlimited permission to link the
+compiled version of this file into combinations with other programs,
+and to distribute those combinations without any restriction coming
+from the use of this file. (The General Public License restrictions
+do apply in other respects; for example, they cover modification of
+the file, and distribution when not linked into a combine
+executable.)
+
+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 GCC; see the file COPYING. If not, write to the Free
+Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+02111-1307, USA. */
+
+#include "xtensa/xtensa-config.h"
+
+/* __xtensa_libgcc_window_spill: This function uses a series of nested
+ calls to flush out all but the current register window. This is
+ used to set up the stack so that arbitrary frames can be accessed.
+ The functions used for the nested calls are also reused by the
+ nonlocal goto function below. */
+
+ .align 4
+ .global __xtensa_libgcc_window_spill
+ .type __xtensa_libgcc_window_spill,@function
+__xtensa_libgcc_window_spill:
+ entry sp, 48
+ call4 .L__wdwspill_assist52 // called with call8, only need a call4
+ retw
+ .size __xtensa_libgcc_window_spill,.-__xtensa_libgcc_window_spill
+
+ .align 4
+.L__wdwspill_assist56:
+ entry sp, 16
+ call4 .L__wdwspill_assist52
+ retw
+ .align 4
+.L__wdwspill_assist52:
+ entry sp, 48
+ call12 .L__wdwspill_assist40
+ retw
+ .align 4
+.L__wdwspill_assist40:
+ entry sp, 48
+ call12 .L__wdwspill_assist28
+ retw
+ .align 4
+.L__wdwspill_assist28:
+ entry sp, 48
+ call12 .L__wdwspill_assist16
+ retw
+ .align 4
+.L__wdwspill_assist16:
+ entry sp, 16
+ movi a15, 0
+ retw
+
+
+/* __xtensa_nonlocal_goto: This code does all the hard work of a
+ nonlocal goto on Xtensa. It is here in the library to avoid the
+ code size bloat of generating it in-line. There are two
+ arguments:
+
+ a2 = frame pointer for the procedure containing the label
+ a3 = goto handler address
+
+ This function never returns to its caller but instead goes directly
+ to the address of the specified goto handler. */
+
+ .align 4
+ .global __xtensa_nonlocal_goto
+ .type __xtensa_nonlocal_goto,@function
+__xtensa_nonlocal_goto:
+ entry sp, 32
+
+ /* flush registers */
+ call8 .L__wdwspill_assist56
+
+ /* Because the save area for a0-a3 is stored one frame below
+ the one identified by a2, the only way to restore those
+ registers is to unwind the stack. If alloca() were never
+ called, we could just unwind until finding the sp value
+ matching a2. However, a2 is a frame pointer, not a stack
+ pointer, and may not be encountered during the unwinding.
+ The solution is to unwind until going _past_ the value
+ given by a2. This involves keeping three stack pointer
+ values during the unwinding:
+
+ next = sp of frame N-1
+ cur = sp of frame N
+ prev = sp of frame N+1
+
+ When next > a2, the desired save area is stored relative
+ to prev. At this point, cur will be the same as a2
+ except in the alloca() case.
+
+ Besides finding the values to be restored to a0-a3, we also
+ need to find the current window size for the target
+ function. This can be extracted from the high bits of the
+ return address, initially in a0. As the unwinding
+ proceeds, the window size is taken from the value of a0
+ saved _two_ frames below the current frame. */
+
+ addi a5, sp, -16 # a5 = prev - save area
+ l32i a6, a5, 4
+ addi a6, a6, -16 # a6 = cur - save area
+ mov a8, a0 # a8 = return address (for window size)
+ j .Lfirstframe
+
+.Lnextframe:
+ l32i a8, a5, 0 # next return address (for window size)
+ mov a5, a6 # advance prev
+ addi a6, a7, -16 # advance cur
+.Lfirstframe:
+ l32i a7, a6, 4 # a7 = next
+ bge a2, a7, .Lnextframe
+
+ /* At this point, prev (a5) points to the save area with the saved
+ values of a0-a3. Copy those values into the save area at the
+ current sp so they will be reloaded when the return from this
+ function underflows. We don't have to worry about exceptions
+ while updating the current save area, because the windows have
+ already been flushed. */
+
+ addi a4, sp, -16 # a4 = save area of this function
+ l32i a6, a5, 0
+ l32i a7, a5, 4
+ s32i a6, a4, 0
+ s32i a7, a4, 4
+ l32i a6, a5, 8
+ l32i a7, a5, 12
+ s32i a6, a4, 8
+ s32i a7, a4, 12
+
+ /* Set return address to goto handler. Use the window size bits
+ from the return address two frames below the target. */
+ extui a8, a8, 30, 2 # get window size from return addr.
+ slli a3, a3, 2 # get goto handler addr. << 2
+ ssai 2
+ src a0, a8, a3 # combine them with a funnel shift
+
+ retw
+ .size __xtensa_nonlocal_goto,.-__xtensa_nonlocal_goto
+
+
+/* __xtensa_sync_caches: This function is called after writing a trampoline
+ on the stack to force all the data writes to memory and invalidate the
+ instruction cache. a2 is the address of the new trampoline.
+
+ After the trampoline data is written out, it must be flushed out of
+ the data cache into memory. We use DHWB in case we have a writeback
+ cache. At least one DHWB instruction is needed for each data cache
+ line which may be touched by the trampoline. An ISYNC instruction
+ must follow the DHWBs.
+
+ We have to flush the i-cache to make sure that the new values get used.
+ At least one IHI instruction is needed for each i-cache line which may
+ be touched by the trampoline. An ISYNC instruction is also needed to
+ make sure that the modified instructions are loaded into the instruction
+ fetch buffer. */
+
+#define TRAMPOLINE_SIZE 49
+
+ .text
+ .align 4
+ .global __xtensa_sync_caches
+ .type __xtensa_sync_caches,@function
+__xtensa_sync_caches:
+ entry sp, 32
+#if XCHAL_DCACHE_SIZE > 0 && XCHAL_DCACHE_IS_WRITEBACK
+ # Flush the trampoline from the data cache
+ extui a4, a2, 0, XCHAL_DCACHE_LINEWIDTH
+ addi a4, a4, TRAMPOLINE_SIZE
+ addi a4, a4, (1 << XCHAL_DCACHE_LINEWIDTH) - 1
+ srli a4, a4, XCHAL_DCACHE_LINEWIDTH
+ mov a3, a2
+.Ldcache_loop:
+ dhwb a3, 0
+ addi a3, a3, (1 << XCHAL_DCACHE_LINEWIDTH)
+ addi a4, a4, -1
+ bnez a4, .Ldcache_loop
+ isync
+#endif
+#if XCHAL_ICACHE_SIZE > 0
+ # Invalidate the corresponding lines in the instruction cache
+ extui a4, a2, 0, XCHAL_ICACHE_LINEWIDTH
+ addi a4, a4, TRAMPOLINE_SIZE
+ addi a4, a4, (1 << XCHAL_ICACHE_LINEWIDTH) - 1
+ srli a4, a4, XCHAL_ICACHE_LINEWIDTH
+.Licache_loop:
+ ihi a2, 0
+ addi a2, a2, (1 << XCHAL_ICACHE_LINEWIDTH)
+ addi a4, a4, -1
+ bnez a4, .Licache_loop
+ isync
+#endif
+ retw
+ .size __xtensa_sync_caches,.-__xtensa_sync_caches
diff --git a/gcc/config/xtensa/linux.h b/gcc/config/xtensa/linux.h
new file mode 100644
index 00000000000..e00a02ede65
--- /dev/null
+++ b/gcc/config/xtensa/linux.h
@@ -0,0 +1,94 @@
+/* Xtensa Linux configuration.
+ Derived from the configuration for GCC for Intel i386 running Linux.
+ Copyright (C) 2001 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+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.
+
+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 GCC; see the file COPYING. If not, write to the Free
+Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+02111-1307, USA. */
+
+#undef TARGET_VERSION
+#define TARGET_VERSION fputs (" (Xtensa GNU/Linux with ELF)", stderr);
+
+/* Debug format: prefer DWARF2 */
+#undef PREFERRED_DEBUGGING_TYPE
+#define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
+
+#undef ASM_SPEC
+#define ASM_SPEC "%{v} %{mno-density:--no-density} \
+ %{mtext-section-literals:--text-section-literals} \
+ %{mno-text-section-literals:--no-text-section-literals} \
+ %{mtarget-align:--target-align} \
+ %{mno-target-align:--no-target-align} \
+ %{mlongcalls:--longcalls} \
+ %{mno-longcalls:--no-longcalls}"
+
+#undef ASM_FINAL_SPEC
+
+#undef LIB_SPEC
+#define LIB_SPEC \
+ "%{shared: -lc} \
+ %{!shared: %{pthread:-lpthread} \
+ %{profile:-lc_p} %{!profile: -lc}}"
+
+#undef LINK_SPEC
+#define LINK_SPEC \
+ "%{shared:-shared} \
+ %{!shared: \
+ %{!ibcs: \
+ %{!static: \
+ %{rdynamic:-export-dynamic} \
+ %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}} \
+ %{static:-static}}}"
+
+#undef CPP_PREDEFINES
+#define CPP_PREDEFINES \
+ "-D__XTENSA__ -D__ELF__ -Acpu=xtensa -Amachine=xtensa \
+ -Dunix -Dlinux -Asystem=posix"
+
+#undef LOCAL_LABEL_PREFIX
+#define LOCAL_LABEL_PREFIX "."
+
+/* Always enable "-fpic" for Xtensa Linux. */
+#define XTENSA_ALWAYS_PIC 1
+
+/* Redefine the standard ELF version of ASM_DECLARE_FUNCTION_SIZE to
+ allow adding the ".end literal_prefix" directive at the end of the
+ function. */
+#undef ASM_DECLARE_FUNCTION_SIZE
+#define ASM_DECLARE_FUNCTION_SIZE(FILE, FNAME, DECL) \
+ do \
+ { \
+ if (!flag_inhibit_size_directive) \
+ { \
+ char label[256]; \
+ static int labelno; \
+ \
+ labelno++; \
+ \
+ ASM_GENERATE_INTERNAL_LABEL (label, "Lfe", labelno); \
+ ASM_OUTPUT_INTERNAL_LABEL (FILE, "Lfe", labelno); \
+ \
+ fprintf (FILE, "%s", SIZE_ASM_OP); \
+ assemble_name (FILE, (FNAME)); \
+ fprintf (FILE, ","); \
+ assemble_name (FILE, label); \
+ fprintf (FILE, "-"); \
+ assemble_name (FILE, (FNAME)); \
+ putc ('\n', FILE); \
+ } \
+ XTENSA_DECLARE_FUNCTION_SIZE(FILE, FNAME, DECL); \
+ } \
+ while (0)
diff --git a/gcc/config/xtensa/t-xtensa b/gcc/config/xtensa/t-xtensa
new file mode 100644
index 00000000000..76b8df65efe
--- /dev/null
+++ b/gcc/config/xtensa/t-xtensa
@@ -0,0 +1,28 @@
+# Use GCC's floating-point emulation code
+LIB2FUNCS_EXTRA = fp-bit.c dp-bit.c
+
+dp-bit.c: $(srcdir)/config/fp-bit.c
+ cat $(srcdir)/config/fp-bit.c > dp-bit.c
+
+fp-bit.c: $(srcdir)/config/fp-bit.c
+ echo '#define FLOAT' > fp-bit.c
+ cat $(srcdir)/config/fp-bit.c >> fp-bit.c
+
+########################################################################
+
+# Skip the libgcc1 test.
+LIBGCC1_TEST =
+
+# Don't run fixproto
+STMP_FIXPROTO =
+
+# Build crtbegin and crtend with the "longcalls" option
+CRTSTUFF_T_CFLAGS += -mlongcalls
+
+CROSS_LIBGCC1 = libgcc1-asm.a
+LIB1ASMSRC = xtensa/lib1funcs.asm
+LIB1ASMFUNCS = _mulsi3 _nsau _divsi3 _modsi3 _udivsi3 _umodsi3
+
+TARGET_LIBGCC2_CFLAGS += -mlongcalls
+
+LIB2FUNCS_EXTRA += $(srcdir)/config/xtensa/lib2funcs.S
diff --git a/gcc/config/xtensa/xm-xtensa.h b/gcc/config/xtensa/xm-xtensa.h
new file mode 100644
index 00000000000..84a4fce919e
--- /dev/null
+++ b/gcc/config/xtensa/xm-xtensa.h
@@ -0,0 +1,44 @@
+/* Xtensa/Elf configuration.
+ Copyright (C) 2001 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+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.
+
+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 GCC; see the file COPYING. If not, write to the Free
+Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+02111-1307, USA. */
+
+/* #defines that need visibility everywhere. */
+#define FALSE 0
+#define TRUE 1
+
+/* This describes the machine the compiler is hosted on. */
+#define HOST_BITS_PER_CHAR 8
+#define HOST_BITS_PER_SHORT 16
+#define HOST_BITS_PER_INT 32
+#define HOST_BITS_PER_LONG 32
+#define HOST_BITS_PER_LONGLONG 64
+
+/* A code distinguishing the floating point format of the host
+ machine. There are three defined values: IEEE_FLOAT_FORMAT,
+ VAX_FLOAT_FORMAT, and UNKNOWN_FLOAT_FORMAT. */
+
+#define HOST_FLOAT_FORMAT IEEE_FLOAT_FORMAT
+
+/* Arguments to use with `exit'. */
+#define SUCCESS_EXIT_CODE 0
+#define FATAL_EXIT_CODE 33
+
+/* target machine dependencies.
+ tm.h is a symbolic link to the actual target specific file. */
+#include "tm.h"
diff --git a/gcc/config/xtensa/xtensa-config.h b/gcc/config/xtensa/xtensa-config.h
new file mode 100644
index 00000000000..277efb2a822
--- /dev/null
+++ b/gcc/config/xtensa/xtensa-config.h
@@ -0,0 +1,50 @@
+/* Xtensa configuration settings.
+ Copyright (C) 2001 Free Software Foundation, Inc.
+ Contributed by Bob Wilson (bwilson@tensilica.com) at Tensilica.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+This program 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 program; if not, write to the Free Software
+Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*/
+
+#ifndef XTENSA_CONFIG_H
+#define XTENSA_CONFIG_H
+
+#define XCHAL_HAVE_BE 1
+#define XCHAL_HAVE_DENSITY 1
+#define XCHAL_HAVE_MAC16 0
+#define XCHAL_HAVE_MUL16 0
+#define XCHAL_HAVE_MUL32 0
+#define XCHAL_HAVE_DIV32 0
+#define XCHAL_HAVE_NSA 1
+#define XCHAL_HAVE_MINMAX 0
+#define XCHAL_HAVE_SEXT 0
+#define XCHAL_HAVE_BOOLEANS 0
+#define XCHAL_HAVE_FP 0
+#define XCHAL_HAVE_FP_DIV 0
+#define XCHAL_HAVE_FP_RECIP 0
+#define XCHAL_HAVE_FP_SQRT 0
+#define XCHAL_HAVE_FP_RSQRT 0
+
+#define XCHAL_ICACHE_SIZE 8192
+#define XCHAL_DCACHE_SIZE 8192
+#define XCHAL_ICACHE_LINESIZE 16
+#define XCHAL_DCACHE_LINESIZE 16
+#define XCHAL_ICACHE_LINEWIDTH 4
+#define XCHAL_DCACHE_LINEWIDTH 4
+#define XCHAL_DCACHE_IS_WRITEBACK 0
+
+#define XCHAL_HAVE_MMU 1
+#define XCHAL_MMU_MIN_PTE_PAGE_SIZE 12
+
+#endif /* !XTENSA_CONFIG_H */
diff --git a/gcc/config/xtensa/xtensa-protos.h b/gcc/config/xtensa/xtensa-protos.h
new file mode 100644
index 00000000000..bb18e3ae84a
--- /dev/null
+++ b/gcc/config/xtensa/xtensa-protos.h
@@ -0,0 +1,116 @@
+/* Prototypes of target machine for GNU compiler for Xtensa.
+ Copyright (C) 2001 Free Software Foundation, Inc.
+ Contributed by Bob Wilson (bwilson@tensilica.com) at Tensilica.
+
+This file is part of GCC.
+
+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.
+
+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 GCC; see the file COPYING. If not, write to the Free
+Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+02111-1307, USA. */
+
+#ifndef __XTENSA_PROTOS_H__
+#define __XTENSA_PROTOS_H__
+
+/* Functions to test whether an immediate fits in a given field. */
+extern int xtensa_simm7 PARAMS ((int));
+extern int xtensa_simm8 PARAMS ((int));
+extern int xtensa_simm8x256 PARAMS ((int));
+extern int xtensa_simm12b PARAMS ((int));
+extern int xtensa_uimm8 PARAMS ((int));
+extern int xtensa_uimm8x2 PARAMS ((int));
+extern int xtensa_uimm8x4 PARAMS ((int));
+extern int xtensa_ai4const PARAMS ((int));
+extern int xtensa_lsi4x4 PARAMS ((int));
+extern int xtensa_b4const PARAMS ((int));
+extern int xtensa_b4constu PARAMS ((int));
+extern int xtensa_tp7 PARAMS ((int));
+
+/* Functions within xtensa.c that we reference. */
+#ifdef RTX_CODE
+extern int xt_true_regnum PARAMS ((rtx));
+extern int add_operand PARAMS ((rtx, enum machine_mode));
+extern int arith_operand PARAMS ((rtx, enum machine_mode));
+extern int nonimmed_operand PARAMS ((rtx, enum machine_mode));
+extern int mem_operand PARAMS ((rtx, enum machine_mode));
+extern int non_acc_reg_operand PARAMS ((rtx, enum machine_mode));
+extern int mask_operand PARAMS ((rtx, enum machine_mode));
+extern int extui_fldsz_operand PARAMS ((rtx, enum machine_mode));
+extern int sext_operand PARAMS ((rtx, enum machine_mode));
+extern int sext_fldsz_operand PARAMS ((rtx, enum machine_mode));
+extern int lsbitnum_operand PARAMS ((rtx, enum machine_mode));
+extern int branch_operand PARAMS ((rtx, enum machine_mode));
+extern int ubranch_operand PARAMS ((rtx, enum machine_mode));
+extern int call_insn_operand PARAMS ((rtx, enum machine_mode));
+extern int move_operand PARAMS ((rtx, enum machine_mode));
+extern int smalloffset_mem_p PARAMS ((rtx));
+extern int smalloffset_double_mem_p PARAMS ((rtx));
+extern int constantpool_address_p PARAMS ((rtx));
+extern int constantpool_mem_p PARAMS ((rtx));
+extern int non_const_move_operand PARAMS ((rtx, enum machine_mode));
+extern int const_float_1_operand PARAMS ((rtx, enum machine_mode));
+extern int fpmem_offset_operand PARAMS ((rtx, enum machine_mode));
+extern void xtensa_extend_reg PARAMS ((rtx, rtx));
+extern void xtensa_load_constant PARAMS ((rtx, rtx));
+extern int branch_operator PARAMS ((rtx, enum machine_mode));
+extern int ubranch_operator PARAMS ((rtx, enum machine_mode));
+extern int boolean_operator PARAMS ((rtx, enum machine_mode));
+extern void xtensa_expand_conditional_branch PARAMS ((rtx *, enum rtx_code));
+extern int xtensa_expand_conditional_move PARAMS ((rtx *, int));
+extern int xtensa_expand_scc PARAMS ((rtx *));
+extern int xtensa_expand_block_move PARAMS ((rtx *));
+extern int xtensa_emit_move_sequence PARAMS ((rtx *, enum machine_mode));
+extern void xtensa_emit_block_move PARAMS ((rtx *, rtx *, int));
+extern void xtensa_expand_nonlocal_goto PARAMS ((rtx *));
+extern void xtensa_emit_loop_end PARAMS ((rtx, rtx *));
+extern char * xtensa_emit_call PARAMS ((int, rtx *));
+
+#ifdef TREE_CODE
+extern void init_cumulative_args PARAMS ((CUMULATIVE_ARGS *, tree, rtx));
+extern void xtensa_va_start PARAMS ((int, tree, rtx));
+extern rtx xtensa_va_arg PARAMS ((tree, tree));
+#endif /* TREE_CODE */
+
+extern void print_operand PARAMS ((FILE *, rtx, int));
+extern void print_operand_address PARAMS ((FILE *, rtx));
+extern void xtensa_output_literal
+ PARAMS ((FILE *, rtx, enum machine_mode, int labelno));
+extern void xtensa_reorg PARAMS ((rtx));
+extern rtx xtensa_builtin_saveregs PARAMS ((void));
+extern enum reg_class xtensa_secondary_reload_class
+ PARAMS ((enum reg_class, enum machine_mode, rtx, int));
+extern int a7_overlap_mentioned_p PARAMS ((rtx x));
+#endif /* RTX_CODE */
+
+#ifdef TREE_CODE
+extern void function_arg_advance
+ PARAMS ((CUMULATIVE_ARGS *, enum machine_mode, tree));
+extern struct rtx_def * function_arg
+ PARAMS ((CUMULATIVE_ARGS *, enum machine_mode, tree, int));
+extern tree xtensa_build_va_list PARAMS ((void));
+#endif /* TREE_CODE */
+
+extern int xtensa_mask_immediate PARAMS ((int));
+extern int xtensa_mem_offset PARAMS ((unsigned, enum machine_mode));
+extern void xtensa_setup_frame_addresses PARAMS ((void));
+extern int xtensa_dbx_register_number PARAMS ((int));
+extern void override_options PARAMS ((void));
+extern void xtensa_declare_object
+ PARAMS ((FILE *, char *, char *, char *, int));
+extern long compute_frame_size PARAMS ((int));
+extern int xtensa_frame_pointer_required PARAMS ((void));
+extern void xtensa_function_prologue PARAMS ((FILE *, int));
+extern void xtensa_function_epilogue PARAMS ((FILE *, int));
+extern void order_regs_for_local_alloc PARAMS ((void));
+
+#endif /* !__XTENSA_PROTOS_H__ */
diff --git a/gcc/config/xtensa/xtensa.c b/gcc/config/xtensa/xtensa.c
new file mode 100644
index 00000000000..c0ca2f86165
--- /dev/null
+++ b/gcc/config/xtensa/xtensa.c
@@ -0,0 +1,2662 @@
+/* Subroutines for insn-output.c for Tensilica's Xtensa architecture.
+ Copyright (C) 2001 Free Software Foundation, Inc.
+ Contributed by Bob Wilson (bwilson@tensilica.com) at Tensilica.
+
+This file is part of GCC.
+
+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.
+
+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 GCC; see the file COPYING. If not, write to the Free
+Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+02111-1307, USA. */
+
+#include "config.h"
+#include "system.h"
+#include "rtl.h"
+#include "regs.h"
+#include "machmode.h"
+#include "hard-reg-set.h"
+#include "basic-block.h"
+#include "real.h"
+#include "insn-config.h"
+#include "conditions.h"
+#include "insn-flags.h"
+#include "insn-attr.h"
+#include "insn-codes.h"
+#include "recog.h"
+#include "output.h"
+#include "tree.h"
+#include "expr.h"
+#include "flags.h"
+#include "reload.h"
+#include "tm_p.h"
+#include "function.h"
+#include "toplev.h"
+
+/* Enumeration for all of the relational tests, so that we can build
+ arrays indexed by the test type, and not worry about the order
+ of EQ, NE, etc. */
+
+enum internal_test {
+ ITEST_EQ,
+ ITEST_NE,
+ ITEST_GT,
+ ITEST_GE,
+ ITEST_LT,
+ ITEST_LE,
+ ITEST_GTU,
+ ITEST_GEU,
+ ITEST_LTU,
+ ITEST_LEU,
+ ITEST_MAX
+ };
+
+/* Cached operands, and operator to compare for use in set/branch on
+ condition codes. */
+rtx branch_cmp[2];
+
+/* what type of branch to use */
+enum cmp_type branch_type;
+
+/* Array giving truth value on whether or not a given hard register
+ can support a given mode. */
+char xtensa_hard_regno_mode_ok
+ [(int) MAX_MACHINE_MODE][FIRST_PSEUDO_REGISTER];
+
+/* Current frame size calculated by compute_frame_size. */
+unsigned xtensa_current_frame_size;
+
+/* Tables of ld/st opcode names for block moves */
+const char *xtensa_ld_opcodes[(int) MAX_MACHINE_MODE];
+const char *xtensa_st_opcodes[(int) MAX_MACHINE_MODE];
+#define LARGEST_MOVE_RATIO 15
+
+/* Define the structure for the machine field in struct function. */
+struct machine_function
+{
+ int accesses_prev_frame;
+};
+
+/* Hardware names for the registers. */
+char xtensa_reg_names[][MAX_REGFILE_NAME_LEN] =
+{
+ "a0", "sp", "a2", "a3", "a4", "a5", "a6", "a7",
+ "a8", "a9", "a10", "a11", "a12", "a13", "a14", "a15",
+ "fp", "argp", "b0",
+ "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7",
+ "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15",
+ "acc",
+};
+
+/* Vector, indexed by hard register number, which contains 1 for a
+ register that is allowable in a candidate for leaf function
+ treatment. */
+
+char xtensa_leaf_regs[] =
+{
+ 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
+};
+
+/* Map hard register number to register class */
+enum reg_class xtensa_regno_to_class[] =
+{
+ GR_REGS, SP_REG, GR_REGS, GR_REGS,
+ GR_REGS, GR_REGS, GR_REGS, GR_REGS,
+ GR_REGS, GR_REGS, GR_REGS, GR_REGS,
+ GR_REGS, GR_REGS, GR_REGS, GR_REGS,
+ AR_REGS, AR_REGS, BR_REGS,
+ FP_REGS, FP_REGS, FP_REGS, FP_REGS,
+ FP_REGS, FP_REGS, FP_REGS, FP_REGS,
+ FP_REGS, FP_REGS, FP_REGS, FP_REGS,
+ FP_REGS, FP_REGS, FP_REGS, FP_REGS,
+ ACC_REG,
+};
+
+/* Map register constraint character to register class. */
+enum reg_class xtensa_char_to_class[256] =
+{
+ NO_REGS, NO_REGS, NO_REGS, NO_REGS,
+ NO_REGS, NO_REGS, NO_REGS, NO_REGS,
+ NO_REGS, NO_REGS, NO_REGS, NO_REGS,
+ NO_REGS, NO_REGS, NO_REGS, NO_REGS,
+ NO_REGS, NO_REGS, NO_REGS, NO_REGS,
+ NO_REGS, NO_REGS, NO_REGS, NO_REGS,
+ NO_REGS, NO_REGS, NO_REGS, NO_REGS,
+ NO_REGS, NO_REGS, NO_REGS, NO_REGS,
+ NO_REGS, NO_REGS, NO_REGS, NO_REGS,
+ NO_REGS, NO_REGS, NO_REGS, NO_REGS,
+ NO_REGS, NO_REGS, NO_REGS, NO_REGS,
+ NO_REGS, NO_REGS, NO_REGS, NO_REGS,
+ NO_REGS, NO_REGS, NO_REGS, NO_REGS,
+ NO_REGS, NO_REGS, NO_REGS, NO_REGS,
+ NO_REGS, NO_REGS, NO_REGS, NO_REGS,
+ NO_REGS, NO_REGS, NO_REGS, NO_REGS,
+ NO_REGS, NO_REGS, NO_REGS, NO_REGS,
+ NO_REGS, NO_REGS, NO_REGS, NO_REGS,
+ NO_REGS, NO_REGS, NO_REGS, NO_REGS,
+ NO_REGS, NO_REGS, NO_REGS, NO_REGS,
+ NO_REGS, NO_REGS, NO_REGS, NO_REGS,
+ NO_REGS, NO_REGS, NO_REGS, NO_REGS,
+ NO_REGS, NO_REGS, NO_REGS, NO_REGS,
+ NO_REGS, NO_REGS, NO_REGS, NO_REGS,
+ NO_REGS, NO_REGS, NO_REGS, NO_REGS,
+ NO_REGS, NO_REGS, NO_REGS, NO_REGS,
+ NO_REGS, NO_REGS, NO_REGS, NO_REGS,
+ NO_REGS, NO_REGS, NO_REGS, NO_REGS,
+ NO_REGS, NO_REGS, NO_REGS, NO_REGS,
+ NO_REGS, NO_REGS, NO_REGS, NO_REGS,
+ NO_REGS, NO_REGS, NO_REGS, NO_REGS,
+ NO_REGS, NO_REGS, NO_REGS, NO_REGS,
+ NO_REGS, NO_REGS, NO_REGS, NO_REGS,
+ NO_REGS, NO_REGS, NO_REGS, NO_REGS,
+ NO_REGS, NO_REGS, NO_REGS, NO_REGS,
+ NO_REGS, NO_REGS, NO_REGS, NO_REGS,
+ NO_REGS, NO_REGS, NO_REGS, NO_REGS,
+ NO_REGS, NO_REGS, NO_REGS, NO_REGS,
+ NO_REGS, NO_REGS, NO_REGS, NO_REGS,
+ NO_REGS, NO_REGS, NO_REGS, NO_REGS,
+ NO_REGS, NO_REGS, NO_REGS, NO_REGS,
+ NO_REGS, NO_REGS, NO_REGS, NO_REGS,
+ NO_REGS, NO_REGS, NO_REGS, NO_REGS,
+ NO_REGS, NO_REGS, NO_REGS, NO_REGS,
+ NO_REGS, NO_REGS, NO_REGS, NO_REGS,
+ NO_REGS, NO_REGS, NO_REGS, NO_REGS,
+ NO_REGS, NO_REGS, NO_REGS, NO_REGS,
+ NO_REGS, NO_REGS, NO_REGS, NO_REGS,
+ NO_REGS, NO_REGS, NO_REGS, NO_REGS,
+ NO_REGS, NO_REGS, NO_REGS, NO_REGS,
+ NO_REGS, NO_REGS, NO_REGS, NO_REGS,
+ NO_REGS, NO_REGS, NO_REGS, NO_REGS,
+ NO_REGS, NO_REGS, NO_REGS, NO_REGS,
+ NO_REGS, NO_REGS, NO_REGS, NO_REGS,
+ NO_REGS, NO_REGS, NO_REGS, NO_REGS,
+ NO_REGS, NO_REGS, NO_REGS, NO_REGS,
+ NO_REGS, NO_REGS, NO_REGS, NO_REGS,
+ NO_REGS, NO_REGS, NO_REGS, NO_REGS,
+ NO_REGS, NO_REGS, NO_REGS, NO_REGS,
+ NO_REGS, NO_REGS, NO_REGS, NO_REGS,
+ NO_REGS, NO_REGS, NO_REGS, NO_REGS,
+ NO_REGS, NO_REGS, NO_REGS, NO_REGS,
+ NO_REGS, NO_REGS, NO_REGS, NO_REGS,
+ NO_REGS, NO_REGS, NO_REGS, NO_REGS,
+};
+
+
+static int b4const_or_zero PARAMS ((int));
+static enum internal_test map_test_to_internal_test PARAMS ((enum rtx_code));
+static rtx gen_int_relational PARAMS ((enum rtx_code, rtx, rtx, int *));
+static rtx gen_float_relational PARAMS ((enum rtx_code, rtx, rtx));
+static rtx gen_conditional_move PARAMS ((rtx));
+static enum machine_mode xtensa_find_mode_for_size PARAMS ((unsigned));
+static void xtensa_init_machine_status PARAMS ((struct function *p));
+static void xtensa_free_machine_status PARAMS ((struct function *p));
+static void printx PARAMS ((FILE *, signed int));
+static rtx frame_size_const;
+static int current_function_arg_words;
+static int reg_nonleaf_alloc_order[] = REG_ALLOC_ORDER;
+
+
+/*
+ * Functions to test Xtensa immediate operand validity.
+ */
+
+int
+xtensa_b4constu (v)
+ int v;
+{
+ switch (v)
+ {
+ case 32768:
+ case 65536:
+ case 2:
+ case 3:
+ case 4:
+ case 5:
+ case 6:
+ case 7:
+ case 8:
+ case 10:
+ case 12:
+ case 16:
+ case 32:
+ case 64:
+ case 128:
+ case 256:
+ return 1;
+ }
+ return 0;
+}
+
+int
+xtensa_simm8x256 (v)
+ int v;
+{
+ return (v & 255) == 0 && (v >= -32768 && v <= 32512);
+}
+
+int
+xtensa_ai4const (v)
+ int v;
+{
+ return (v == -1 || (v >= 1 && v <= 15));
+}
+
+int
+xtensa_simm7 (v)
+ int v;
+{
+ return v >= -32 && v <= 95;
+}
+
+int
+xtensa_b4const (v)
+ int v;
+{
+ switch (v)
+ {
+ case -1:
+ case 1:
+ case 2:
+ case 3:
+ case 4:
+ case 5:
+ case 6:
+ case 7:
+ case 8:
+ case 10:
+ case 12:
+ case 16:
+ case 32:
+ case 64:
+ case 128:
+ case 256:
+ return 1;
+ }
+ return 0;
+}
+
+int
+xtensa_simm8 (v)
+ int v;
+{
+ return v >= -128 && v <= 127;
+}
+
+int
+xtensa_tp7 (v)
+ int v;
+{
+ return (v >= 7 && v <= 22);
+}
+
+int
+xtensa_lsi4x4 (v)
+ int v;
+{
+ return (v & 3) == 0 && (v >= 0 && v <= 60);
+}
+
+int
+xtensa_simm12b (v)
+ int v;
+{
+ return v >= -2048 && v <= 2047;
+}
+
+int
+xtensa_uimm8 (v)
+ int v;
+{
+ return v >= 0 && v <= 255;
+}
+
+int
+xtensa_uimm8x2 (v)
+ int v;
+{
+ return (v & 1) == 0 && (v >= 0 && v <= 510);
+}
+
+int
+xtensa_uimm8x4 (v)
+ int v;
+{
+ return (v & 3) == 0 && (v >= 0 && v <= 1020);
+}
+
+
+/* This is just like the standard true_regnum() function except that it
+ works even when reg_renumber is not initialized. */
+
+int
+xt_true_regnum (x)
+ rtx x;
+{
+ if (GET_CODE (x) == REG)
+ {
+ if (reg_renumber
+ && REGNO (x) >= FIRST_PSEUDO_REGISTER
+ && reg_renumber[REGNO (x)] >= 0)
+ return reg_renumber[REGNO (x)];
+ return REGNO (x);
+ }
+ if (GET_CODE (x) == SUBREG)
+ {
+ int base = xt_true_regnum (SUBREG_REG (x));
+ if (base >= 0 && base < FIRST_PSEUDO_REGISTER)
+ return SUBREG_WORD (x) + base;
+ }
+ return -1;
+}
+
+
+int
+add_operand (op, mode)
+ rtx op;
+ enum machine_mode mode;
+{
+ if (GET_CODE (op) == CONST_INT)
+ return (xtensa_simm8 (INTVAL (op)) ||
+ xtensa_simm8x256 (INTVAL (op)));
+
+ return register_operand (op, mode);
+}
+
+
+int
+arith_operand (op, mode)
+ rtx op;
+ enum machine_mode mode;
+{
+ if (GET_CODE (op) == CONST_INT)
+ return xtensa_simm8 (INTVAL (op));
+
+ return register_operand (op, mode);
+}
+
+
+int
+nonimmed_operand (op, mode)
+ rtx op;
+ enum machine_mode mode;
+{
+ /* We cannot use the standard nonimmediate_operand() predicate because
+ it includes constant pool memory operands. */
+
+ if (memory_operand (op, mode))
+ return !constantpool_address_p (XEXP (op, 0));
+
+ return register_operand (op, mode);
+}
+
+
+int
+mem_operand (op, mode)
+ rtx op;
+ enum machine_mode mode;
+{
+ /* We cannot use the standard memory_operand() predicate because
+ it includes constant pool memory operands. */
+
+ if (memory_operand (op, mode))
+ return !constantpool_address_p (XEXP (op, 0));
+
+ return FALSE;
+}
+
+
+int
+non_acc_reg_operand (op, mode)
+ rtx op;
+ enum machine_mode mode;
+{
+ if (register_operand (op, mode))
+ return !ACC_REG_P (xt_true_regnum (op));
+ return FALSE;
+}
+
+
+int
+mask_operand (op, mode)
+ rtx op;
+ enum machine_mode mode;
+{
+ if (GET_CODE (op) == CONST_INT)
+ return xtensa_mask_immediate (INTVAL (op));
+
+ return register_operand (op, mode);
+}
+
+
+int
+extui_fldsz_operand (op, mode)
+ rtx op;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
+{
+ return ((GET_CODE (op) == CONST_INT)
+ && xtensa_mask_immediate ((1 << INTVAL (op)) - 1));
+}
+
+
+int
+sext_operand (op, mode)
+ rtx op;
+ enum machine_mode mode;
+{
+ if (TARGET_SEXT)
+ return nonimmed_operand (op, mode);
+ return mem_operand (op, mode);
+}
+
+
+int
+sext_fldsz_operand (op, mode)
+ rtx op;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
+{
+ return ((GET_CODE (op) == CONST_INT) && xtensa_tp7 (INTVAL (op) - 1));
+}
+
+
+int
+lsbitnum_operand (op, mode)
+ rtx op;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
+{
+ if (GET_CODE (op) == CONST_INT)
+ {
+ return (BITS_BIG_ENDIAN
+ ? (INTVAL (op) == BITS_PER_WORD-1)
+ : (INTVAL (op) == 0));
+ }
+ return FALSE;
+}
+
+
+static int
+b4const_or_zero (v)
+ int v;
+{
+ if (v == 0)
+ return TRUE;
+ return xtensa_b4const (v);
+}
+
+
+int
+branch_operand (op, mode)
+ rtx op;
+ enum machine_mode mode;
+{
+ if (GET_CODE (op) == CONST_INT)
+ return b4const_or_zero (INTVAL (op));
+
+ return register_operand (op, mode);
+}
+
+
+int
+ubranch_operand (op, mode)
+ rtx op;
+ enum machine_mode mode;
+{
+ if (GET_CODE (op) == CONST_INT)
+ return xtensa_b4constu (INTVAL (op));
+
+ return register_operand (op, mode);
+}
+
+
+int
+call_insn_operand (op, mode)
+ rtx op;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
+{
+ if ((GET_CODE (op) == REG)
+ && (op != arg_pointer_rtx)
+ && ((REGNO (op) < FRAME_POINTER_REGNUM)
+ || (REGNO (op) > LAST_VIRTUAL_REGISTER)))
+ return TRUE;
+
+ if (CONSTANT_ADDRESS_P (op))
+ {
+ /* Direct calls only allowed to static functions with PIC. */
+ return (!flag_pic || (GET_CODE (op) == SYMBOL_REF
+ && SYMBOL_REF_FLAG (op)));
+ }
+
+ return FALSE;
+}
+
+
+int
+move_operand (op, mode)
+ rtx op;
+ enum machine_mode mode;
+{
+ if (register_operand (op, mode))
+ return TRUE;
+
+ /* Accept CONSTANT_P_RTX, since it will be gone by CSE1 and
+ result in 0/1. */
+ if (GET_CODE (op) == CONSTANT_P_RTX)
+ return TRUE;
+
+ if (GET_CODE (op) == CONST_INT)
+ return xtensa_simm12b (INTVAL (op));
+
+ if (GET_CODE (op) == MEM)
+ return memory_address_p (mode, XEXP (op, 0));
+
+ return FALSE;
+}
+
+
+int
+smalloffset_mem_p (op)
+ rtx op;
+{
+ if (GET_CODE (op) == MEM)
+ {
+ rtx addr = XEXP (op, 0);
+ if (GET_CODE (addr) == REG)
+ return REG_OK_FOR_BASE_P (addr);
+ if (GET_CODE (addr) == PLUS)
+ {
+ rtx offset = XEXP (addr, 0);
+ if (GET_CODE (offset) != CONST_INT)
+ offset = XEXP (addr, 1);
+ if (GET_CODE (offset) != CONST_INT)
+ return FALSE;
+ return xtensa_lsi4x4 (INTVAL (offset));
+ }
+ }
+ return FALSE;
+}
+
+
+int
+smalloffset_double_mem_p (op)
+ rtx op;
+{
+ if (!smalloffset_mem_p (op))
+ return FALSE;
+ return smalloffset_mem_p (adj_offsettable_operand (op, 4));
+}
+
+
+int
+constantpool_address_p (addr)
+ rtx addr;
+{
+ rtx sym = addr;
+
+ if (GET_CODE (addr) == CONST)
+ {
+ rtx offset;
+
+ /* only handle (PLUS (SYM, OFFSET)) form */
+ addr = XEXP (addr, 0);
+ if (GET_CODE (addr) != PLUS)
+ return FALSE;
+
+ /* make sure the address is word aligned */
+ offset = XEXP (addr, 1);
+ if ((GET_CODE (offset) != CONST_INT)
+ || ((INTVAL (offset) & 3) != 0))
+ return FALSE;
+
+ sym = XEXP (addr, 0);
+ }
+
+ if ((GET_CODE (sym) == SYMBOL_REF)
+ && CONSTANT_POOL_ADDRESS_P (sym))
+ return TRUE;
+ return FALSE;
+}
+
+
+int
+constantpool_mem_p (op)
+ rtx op;
+{
+ if (GET_CODE (op) == MEM)
+ return constantpool_address_p (XEXP (op, 0));
+ return FALSE;
+}
+
+
+int
+non_const_move_operand (op, mode)
+ rtx op;
+ enum machine_mode mode;
+{
+ if (register_operand (op, mode))
+ return 1;
+ if (GET_CODE (op) == SUBREG)
+ op = SUBREG_REG (op);
+ if (GET_CODE (op) == MEM)
+ return memory_address_p (mode, XEXP (op, 0));
+ return FALSE;
+}
+
+
+/* Accept the floating point constant 1 in the appropriate mode. */
+
+int
+const_float_1_operand (op, mode)
+ rtx op;
+ enum machine_mode mode;
+{
+ REAL_VALUE_TYPE d;
+ static REAL_VALUE_TYPE onedf;
+ static REAL_VALUE_TYPE onesf;
+ static int one_initialized;
+
+ if ((GET_CODE (op) != CONST_DOUBLE)
+ || (mode != GET_MODE (op))
+ || (mode != DFmode && mode != SFmode))
+ return FALSE;
+
+ REAL_VALUE_FROM_CONST_DOUBLE (d, op);
+
+ if (! one_initialized)
+ {
+ onedf = REAL_VALUE_ATOF ("1.0", DFmode);
+ onesf = REAL_VALUE_ATOF ("1.0", SFmode);
+ one_initialized = TRUE;
+ }
+
+ if (mode == DFmode)
+ return REAL_VALUES_EQUAL (d, onedf);
+ else
+ return REAL_VALUES_EQUAL (d, onesf);
+}
+
+
+int
+fpmem_offset_operand (op, mode)
+ rtx op;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
+{
+ if (GET_CODE (op) == CONST_INT)
+ return xtensa_mem_offset (INTVAL (op), SFmode);
+ return 0;
+}
+
+
+void
+xtensa_extend_reg (dst, src)
+ rtx dst;
+ rtx src;
+{
+ int src_subword = 0;
+ int dst_subword = 0;
+ rtx temp = gen_reg_rtx (SImode);
+ rtx shift = GEN_INT (BITS_PER_WORD - GET_MODE_BITSIZE (GET_MODE (src)));
+
+ if (GET_CODE (src) == SUBREG)
+ {
+ src_subword = SUBREG_WORD (src);
+ src = SUBREG_REG (src);
+ }
+ if (GET_CODE (dst) == SUBREG)
+ {
+ dst_subword = SUBREG_WORD (dst);
+ dst = SUBREG_REG (dst);
+ }
+
+ src = gen_rtx_SUBREG (SImode, src, src_subword);
+ if (GET_MODE (dst) != SImode || dst_subword != 0)
+ dst = gen_rtx_SUBREG (SImode, dst, dst_subword);
+
+ emit_insn (gen_ashlsi3 (temp, src, shift));
+ emit_insn (gen_ashrsi3 (dst, temp, shift));
+}
+
+
+void
+xtensa_load_constant (dst, src)
+ rtx dst;
+ rtx src;
+{
+ enum machine_mode mode = GET_MODE (dst);
+ src = force_const_mem (SImode, src);
+
+ /* PC-relative loads are always SImode so we have to add a SUBREG if that
+ is not the desired mode */
+
+ if (mode != SImode)
+ {
+ if (register_operand (dst, mode))
+ {
+ int dst_subword = 0;
+ if (GET_CODE (dst) == SUBREG)
+ {
+ dst_subword = SUBREG_WORD (dst);
+ dst = SUBREG_REG (dst);
+ }
+ dst = gen_rtx_SUBREG (SImode, dst, dst_subword);
+ }
+ else
+ {
+ src = force_reg (SImode, src);
+ src = gen_rtx_SUBREG (mode, src, 0);
+ }
+ }
+
+ emit_move_insn (dst, src);
+}
+
+
+int
+branch_operator (x, mode)
+ rtx x;
+ enum machine_mode mode;
+{
+ if (GET_MODE (x) != mode)
+ return FALSE;
+
+ switch (GET_CODE (x))
+ {
+ case EQ:
+ case NE:
+ case LT:
+ case GE:
+ return TRUE;
+ default:
+ break;
+ }
+ return FALSE;
+}
+
+
+int
+ubranch_operator (x, mode)
+ rtx x;
+ enum machine_mode mode;
+{
+ if (GET_MODE (x) != mode)
+ return FALSE;
+
+ switch (GET_CODE (x))
+ {
+ case LTU:
+ case GEU:
+ return TRUE;
+ default:
+ break;
+ }
+ return FALSE;
+}
+
+
+int
+boolean_operator (x, mode)
+ rtx x;
+ enum machine_mode mode;
+{
+ if (GET_MODE (x) != mode)
+ return FALSE;
+
+ switch (GET_CODE (x))
+ {
+ case EQ:
+ case NE:
+ return TRUE;
+ default:
+ break;
+ }
+ return FALSE;
+}
+
+
+int
+xtensa_mask_immediate (v)
+ int v;
+{
+#define MAX_MASK_SIZE 16
+ int mask_size;
+
+ for (mask_size = 1; mask_size <= MAX_MASK_SIZE; mask_size++)
+ {
+ if ((v & 1) == 0)
+ return FALSE;
+ v = v >> 1;
+ if (v == 0)
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+
+int
+xtensa_mem_offset (v, mode)
+ unsigned v;
+ enum machine_mode mode;
+{
+ switch (mode)
+ {
+ case BLKmode:
+ /* Handle the worst case for block moves. See xtensa_expand_block_move
+ where we emit an optimized block move operation if the block can be
+ moved in < "move_ratio" pieces. The worst case is when the block is
+ aligned but has a size of (3 mod 4) (does this happen?) so that the
+ last piece requires a byte load/store. */
+ return (xtensa_uimm8 (v) &&
+ xtensa_uimm8 (v + MOVE_MAX * LARGEST_MOVE_RATIO));
+
+ case QImode:
+ return xtensa_uimm8 (v);
+
+ case HImode:
+ return xtensa_uimm8x2 (v);
+
+ case DFmode:
+ return (xtensa_uimm8x4 (v) && xtensa_uimm8x4 (v + 4));
+
+ default:
+ break;
+ }
+
+ return xtensa_uimm8x4 (v);
+}
+
+
+/* Make normal rtx_code into something we can index from an array */
+
+static enum internal_test
+map_test_to_internal_test (test_code)
+ enum rtx_code test_code;
+{
+ enum internal_test test = ITEST_MAX;
+
+ switch (test_code)
+ {
+ default: break;
+ case EQ: test = ITEST_EQ; break;
+ case NE: test = ITEST_NE; break;
+ case GT: test = ITEST_GT; break;
+ case GE: test = ITEST_GE; break;
+ case LT: test = ITEST_LT; break;
+ case LE: test = ITEST_LE; break;
+ case GTU: test = ITEST_GTU; break;
+ case GEU: test = ITEST_GEU; break;
+ case LTU: test = ITEST_LTU; break;
+ case LEU: test = ITEST_LEU; break;
+ }
+
+ return test;
+}
+
+
+/* Generate the code to compare two integer values. The return value is
+ the comparison expression. */
+
+static rtx
+gen_int_relational (test_code, cmp0, cmp1, p_invert)
+ enum rtx_code test_code; /* relational test (EQ, etc) */
+ rtx cmp0; /* first operand to compare */
+ rtx cmp1; /* second operand to compare */
+ int *p_invert; /* whether branch needs to reverse its test */
+{
+ struct cmp_info {
+ enum rtx_code test_code; /* test code to use in insn */
+ int (*const_range_p) PARAMS ((int)); /* predicate function to check range */
+ int const_add; /* constant to add (convert LE -> LT) */
+ int reverse_regs; /* reverse registers in test */
+ int invert_const; /* != 0 if invert value if cmp1 is constant */
+ int invert_reg; /* != 0 if invert value if cmp1 is register */
+ int unsignedp; /* != 0 for unsigned comparisons. */
+ };
+
+ static struct cmp_info info[ (int)ITEST_MAX ] = {
+
+ { EQ, b4const_or_zero, 0, 0, 0, 0, 0 }, /* EQ */
+ { NE, b4const_or_zero, 0, 0, 0, 0, 0 }, /* NE */
+
+ { LT, b4const_or_zero, 1, 1, 1, 0, 0 }, /* GT */
+ { GE, b4const_or_zero, 0, 0, 0, 0, 0 }, /* GE */
+ { LT, b4const_or_zero, 0, 0, 0, 0, 0 }, /* LT */
+ { GE, b4const_or_zero, 1, 1, 1, 0, 0 }, /* LE */
+
+ { LTU, xtensa_b4constu, 1, 1, 1, 0, 1 }, /* GTU */
+ { GEU, xtensa_b4constu, 0, 0, 0, 0, 1 }, /* GEU */
+ { LTU, xtensa_b4constu, 0, 0, 0, 0, 1 }, /* LTU */
+ { GEU, xtensa_b4constu, 1, 1, 1, 0, 1 }, /* LEU */
+ };
+
+ enum internal_test test;
+ enum machine_mode mode;
+ struct cmp_info *p_info;
+
+ test = map_test_to_internal_test (test_code);
+ if (test == ITEST_MAX)
+ abort ();
+
+ p_info = &info[ (int)test ];
+
+ mode = GET_MODE (cmp0);
+ if (mode == VOIDmode)
+ mode = GET_MODE (cmp1);
+
+ /* Make sure we can handle any constants given to us. */
+ if (GET_CODE (cmp1) == CONST_INT)
+ {
+ HOST_WIDE_INT value = INTVAL (cmp1);
+ unsigned HOST_WIDE_INT uvalue = (unsigned HOST_WIDE_INT)value;
+
+ /* if the immediate overflows or does not fit in the immediate field,
+ spill it to a register */
+
+ if ((p_info->unsignedp ?
+ (uvalue + p_info->const_add > uvalue) :
+ (value + p_info->const_add > value)) != (p_info->const_add > 0))
+ {
+ cmp1 = force_reg (mode, cmp1);
+ }
+ else if (!(p_info->const_range_p) (value + p_info->const_add))
+ {
+ cmp1 = force_reg (mode, cmp1);
+ }
+ }
+ else if ((GET_CODE (cmp1) != REG) && (GET_CODE (cmp1) != SUBREG))
+ {
+ cmp1 = force_reg (mode, cmp1);
+ }
+
+ /* See if we need to invert the result. */
+ *p_invert = ((GET_CODE (cmp1) == CONST_INT)
+ ? p_info->invert_const
+ : p_info->invert_reg);
+
+ /* Comparison to constants, may involve adding 1 to change a LT into LE.
+ Comparison between two registers, may involve switching operands. */
+ if (GET_CODE (cmp1) == CONST_INT)
+ {
+ if (p_info->const_add != 0)
+ cmp1 = GEN_INT (INTVAL (cmp1) + p_info->const_add);
+
+ }
+ else if (p_info->reverse_regs)
+ {
+ rtx temp = cmp0;
+ cmp0 = cmp1;
+ cmp1 = temp;
+ }
+
+ return gen_rtx (p_info->test_code, VOIDmode, cmp0, cmp1);
+}
+
+
+/* Generate the code to compare two float values. The return value is
+ the comparison expression. */
+
+static rtx
+gen_float_relational (test_code, cmp0, cmp1)
+ enum rtx_code test_code; /* relational test (EQ, etc) */
+ rtx cmp0; /* first operand to compare */
+ rtx cmp1; /* second operand to compare */
+{
+ rtx (*gen_fn) PARAMS ((rtx, rtx, rtx));
+ rtx brtmp;
+ int reverse_regs, invert;
+
+ switch (test_code)
+ {
+ case EQ: reverse_regs = 0; invert = 0; gen_fn = gen_seq_sf; break;
+ case NE: reverse_regs = 0; invert = 1; gen_fn = gen_seq_sf; break;
+ case LE: reverse_regs = 0; invert = 0; gen_fn = gen_sle_sf; break;
+ case GT: reverse_regs = 1; invert = 0; gen_fn = gen_slt_sf; break;
+ case LT: reverse_regs = 0; invert = 0; gen_fn = gen_slt_sf; break;
+ case GE: reverse_regs = 1; invert = 0; gen_fn = gen_sle_sf; break;
+ default:
+ fatal_insn ("bad test", gen_rtx (test_code, VOIDmode, cmp0, cmp1));
+ reverse_regs = 0; invert = 0; gen_fn = 0; /* avoid compiler warnings */
+ }
+
+ if (reverse_regs)
+ {
+ rtx temp = cmp0;
+ cmp0 = cmp1;
+ cmp1 = temp;
+ }
+
+ brtmp = gen_rtx_REG (CCmode, FPCC_REGNUM);
+ emit_insn (gen_fn (brtmp, cmp0, cmp1));
+
+ return gen_rtx (invert ? EQ : NE, VOIDmode, brtmp, const0_rtx);
+}
+
+
+void
+xtensa_expand_conditional_branch (operands, test_code)
+ rtx *operands;
+ enum rtx_code test_code;
+{
+ enum cmp_type type = branch_type;
+ rtx cmp0 = branch_cmp[0];
+ rtx cmp1 = branch_cmp[1];
+ rtx cmp;
+ int invert;
+ rtx label1, label2;
+
+ switch (type)
+ {
+ case CMP_DF:
+ default:
+ fatal_insn ("bad test", gen_rtx (test_code, VOIDmode, cmp0, cmp1));
+
+ case CMP_SI:
+ invert = FALSE;
+ cmp = gen_int_relational (test_code, cmp0, cmp1, &invert);
+ break;
+
+ case CMP_SF:
+ if (!TARGET_HARD_FLOAT)
+ fatal_insn ("bad test", gen_rtx (test_code, VOIDmode, cmp0, cmp1));
+ invert = FALSE;
+ cmp = gen_float_relational (test_code, cmp0, cmp1);
+ break;
+ }
+
+ /* Generate the branch. */
+
+ label1 = gen_rtx_LABEL_REF (VOIDmode, operands[0]);
+ label2 = pc_rtx;
+
+ if (invert)
+ {
+ label2 = label1;
+ label1 = pc_rtx;
+ }
+
+ emit_jump_insn (gen_rtx_SET (VOIDmode, pc_rtx,
+ gen_rtx_IF_THEN_ELSE (VOIDmode, cmp,
+ label1,
+ label2)));
+}
+
+
+static rtx
+gen_conditional_move (cmp)
+ rtx cmp;
+{
+ enum rtx_code code = GET_CODE (cmp);
+ rtx op0 = branch_cmp[0];
+ rtx op1 = branch_cmp[1];
+
+ if (branch_type == CMP_SI)
+ {
+ /* Jump optimization calls get_condition() which canonicalizes
+ comparisons like (GE x <const>) to (GT x <const-1>).
+ Transform those comparisons back to GE, since that is the
+ comparison supported in Xtensa. We shouldn't have to
+ transform <LE x const> comparisons, because neither
+ xtensa_expand_conditional_branch() nor get_condition() will
+ produce them. */
+
+ if ((code == GT) && (op1 == constm1_rtx))
+ {
+ code = GE;
+ op1 = const0_rtx;
+ }
+ cmp = gen_rtx (code, VOIDmode, cc0_rtx, const0_rtx);
+
+ if (boolean_operator (cmp, VOIDmode))
+ {
+ /* swap the operands to make const0 second */
+ if (op0 == const0_rtx)
+ {
+ op0 = op1;
+ op1 = const0_rtx;
+ }
+
+ /* if not comparing against zero, emit a comparison (subtract) */
+ if (op1 != const0_rtx)
+ {
+ op0 = expand_binop (SImode, sub_optab, op0, op1,
+ 0, 0, OPTAB_LIB_WIDEN);
+ op1 = const0_rtx;
+ }
+ }
+ else if (branch_operator (cmp, VOIDmode))
+ {
+ /* swap the operands to make const0 second */
+ if (op0 == const0_rtx)
+ {
+ op0 = op1;
+ op1 = const0_rtx;
+
+ switch (code)
+ {
+ case LT: code = GE; break;
+ case GE: code = LT; break;
+ default: abort ();
+ }
+ }
+
+ if (op1 != const0_rtx)
+ return 0;
+ }
+ else
+ return 0;
+
+ return gen_rtx (code, VOIDmode, op0, op1);
+ }
+
+ if (TARGET_HARD_FLOAT && (branch_type == CMP_SF))
+ return gen_float_relational (code, op0, op1);
+
+ return 0;
+}
+
+
+int
+xtensa_expand_conditional_move (operands, isflt)
+ rtx *operands;
+ int isflt;
+{
+ rtx cmp;
+ rtx (*gen_fn) PARAMS ((rtx, rtx, rtx, rtx, rtx));
+
+ if (!(cmp = gen_conditional_move (operands[1])))
+ return 0;
+
+ if (isflt)
+ gen_fn = (branch_type == CMP_SI
+ ? gen_movsfcc_internal0
+ : gen_movsfcc_internal1);
+ else
+ gen_fn = (branch_type == CMP_SI
+ ? gen_movsicc_internal0
+ : gen_movsicc_internal1);
+
+ emit_insn (gen_fn (operands[0], XEXP (cmp, 0),
+ operands[2], operands[3], cmp));
+ return 1;
+}
+
+
+int
+xtensa_expand_scc (operands)
+ rtx *operands;
+{
+ rtx dest = operands[0];
+ rtx cmp = operands[1];
+ rtx one_tmp, zero_tmp;
+ rtx (*gen_fn) PARAMS ((rtx, rtx, rtx, rtx, rtx));
+
+ if (!(cmp = gen_conditional_move (cmp)))
+ return 0;
+
+ one_tmp = gen_reg_rtx (SImode);
+ zero_tmp = gen_reg_rtx (SImode);
+ emit_insn (gen_movsi (one_tmp, const_true_rtx));
+ emit_insn (gen_movsi (zero_tmp, const0_rtx));
+
+ gen_fn = (branch_type == CMP_SI
+ ? gen_movsicc_internal0
+ : gen_movsicc_internal1);
+ emit_insn (gen_fn (dest, XEXP (cmp, 0), one_tmp, zero_tmp, cmp));
+ return 1;
+}
+
+
+/* Emit insns to move operands[1] into operands[0].
+
+ Return 1 if we have written out everything that needs to be done to
+ do the move. Otherwise, return 0 and the caller will emit the move
+ normally. */
+
+int
+xtensa_emit_move_sequence (operands, mode)
+ rtx *operands;
+ enum machine_mode mode;
+{
+ if (CONSTANT_P (operands[1])
+ && GET_CODE (operands[1]) != CONSTANT_P_RTX
+ && (GET_CODE (operands[1]) != CONST_INT
+ || !xtensa_simm12b (INTVAL (operands[1]))))
+ {
+ xtensa_load_constant (operands[0], operands[1]);
+ return 1;
+ }
+
+ if (!(reload_in_progress | reload_completed))
+ {
+ if (!non_acc_reg_operand (operands[0], mode)
+ && !non_acc_reg_operand (operands[1], mode))
+ operands[1] = force_reg (mode, operands[1]);
+
+ /* Check if this move is copying an incoming argument in a7. If
+ so, emit the move, followed by the special "set_frame_ptr"
+ unspec_volatile insn, at the very beginning of the function.
+ This is necessary because the register allocator will ignore
+ conflicts with a7 and may assign some other pseudo to a7. If
+ that pseudo was assigned prior to this move, it would clobber
+ the incoming argument in a7. By copying the argument out of
+ a7 as the very first thing, and then immediately following
+ that with an unspec_volatile to keep the scheduler away, we
+ should avoid any problems. */
+
+ if (a7_overlap_mentioned_p (operands[1]))
+ {
+ rtx mov;
+ switch (mode)
+ {
+ case SImode:
+ mov = gen_movsi_internal (operands[0], operands[1]);
+ break;
+ case HImode:
+ mov = gen_movhi_internal (operands[0], operands[1]);
+ break;
+ case QImode:
+ mov = gen_movqi_internal (operands[0], operands[1]);
+ break;
+ default:
+ abort ();
+ }
+
+ /* Insert the instructions before any other argument copies.
+ (The set_frame_ptr insn comes _after_ the move, so push it
+ out first.) */
+ push_topmost_sequence ();
+ emit_insn_after (gen_set_frame_ptr (), get_insns ());
+ emit_insn_after (mov, get_insns ());
+ pop_topmost_sequence ();
+
+ return 1;
+ }
+ }
+
+ /* During reload we don't want to emit (subreg:X (mem:Y)) since that
+ instruction won't be recognized after reload. So we remove the
+ subreg and adjust mem accordingly. */
+ if (reload_in_progress && GET_CODE (operands[0]) == SUBREG
+ && GET_CODE (SUBREG_REG (operands[0])) == REG
+ && REGNO (SUBREG_REG (operands[0])) >= FIRST_PSEUDO_REGISTER)
+ {
+ SUBREG_REG (operands[0]) =
+ reg_equiv_mem[REGNO (SUBREG_REG (operands[0]))];
+ operands[0] = alter_subreg (operands[0]);
+ }
+
+ if (reload_in_progress && GET_CODE (operands[1]) == SUBREG
+ && GET_CODE (SUBREG_REG (operands[1])) == REG
+ && REGNO (SUBREG_REG (operands[1])) >= FIRST_PSEUDO_REGISTER)
+ {
+ SUBREG_REG (operands[1]) =
+ reg_equiv_mem[REGNO (SUBREG_REG (operands[1]))];
+ operands[1] = alter_subreg (operands[1]);
+ }
+
+ return 0;
+}
+
+
+/* Try to expand a block move operation to an RTL block move instruction.
+ If not optimizing or if the block size is not a constant or if the
+ block is small, the expansion fails and GCC falls back to calling
+ memcpy().
+
+ operands[0] is the destination
+ operands[1] is the source
+ operands[2] is the length
+ operands[3] is the alignment */
+
+int
+xtensa_expand_block_move (operands)
+ rtx *operands;
+{
+ rtx dest = operands[0];
+ rtx src = operands[1];
+ int bytes = INTVAL (operands[2]);
+ int align = XINT (operands[3], 0);
+ int num_pieces, move_ratio;
+
+ /* If this is not a fixed size move, just call memcpy */
+ if (!optimize || (GET_CODE (operands[2]) != CONST_INT))
+ return 0;
+
+ /* Anything to move? */
+ if (bytes <= 0)
+ return 1;
+
+ if (align > MOVE_MAX)
+ align = MOVE_MAX;
+
+ /* decide whether to expand inline based on the optimization level */
+ move_ratio = 4;
+ if (optimize > 2)
+ move_ratio = LARGEST_MOVE_RATIO;
+ num_pieces = (bytes / align) + (bytes % align); /* close enough anyway */
+ if (num_pieces >= move_ratio)
+ return 0;
+
+ /* make sure the memory addresses are valid */
+ operands[0] = change_address (dest, VOIDmode, NULL);
+ operands[1] = change_address (src, VOIDmode, NULL);
+
+ emit_insn (gen_movstrsi_internal (operands[0], operands[1],
+ operands[2], operands[3]));
+ return 1;
+}
+
+
+/* Emit a sequence of instructions to implement a block move, trying
+ to hide load delay slots as much as possible. Load N values into
+ temporary registers, store those N values, and repeat until the
+ complete block has been moved. N=delay_slots+1 */
+
+struct meminsnbuf {
+ char template[30];
+ rtx operands[2];
+};
+
+void
+xtensa_emit_block_move (operands, tmpregs, delay_slots)
+ rtx *operands;
+ rtx *tmpregs;
+ int delay_slots;
+{
+ rtx dest = operands[0];
+ rtx src = operands[1];
+ int bytes = INTVAL (operands[2]);
+ int align = XINT (operands[3], 0);
+ rtx from_addr = XEXP (src, 0);
+ rtx to_addr = XEXP (dest, 0);
+ int from_struct = MEM_IN_STRUCT_P (src);
+ int to_struct = MEM_IN_STRUCT_P (dest);
+ int offset = 0;
+ int chunk_size, item_size;
+ struct meminsnbuf *ldinsns, *stinsns;
+ const char *ldname, *stname;
+ enum machine_mode mode;
+
+ if (align > MOVE_MAX)
+ align = MOVE_MAX;
+ item_size = align;
+ chunk_size = delay_slots + 1;
+
+ ldinsns = (struct meminsnbuf *)
+ alloca (chunk_size * sizeof (struct meminsnbuf));
+ stinsns = (struct meminsnbuf *)
+ alloca (chunk_size * sizeof (struct meminsnbuf));
+
+ mode = xtensa_find_mode_for_size (item_size);
+ item_size = GET_MODE_SIZE (mode);
+ ldname = xtensa_ld_opcodes[(int) mode];
+ stname = xtensa_st_opcodes[(int) mode];
+
+ while (bytes > 0)
+ {
+ int n;
+
+ for (n = 0; n < chunk_size; n++)
+ {
+ rtx addr, mem;
+
+ if (bytes == 0)
+ {
+ chunk_size = n;
+ break;
+ }
+
+ if (bytes < item_size)
+ {
+ /* find a smaller item_size which we can load & store */
+ item_size = bytes;
+ mode = xtensa_find_mode_for_size (item_size);
+ item_size = GET_MODE_SIZE (mode);
+ ldname = xtensa_ld_opcodes[(int) mode];
+ stname = xtensa_st_opcodes[(int) mode];
+ }
+
+ /* record the load instruction opcode and operands */
+ addr = plus_constant (from_addr, offset);
+ mem = gen_rtx_MEM (mode, addr);
+ if (! memory_address_p (mode, addr))
+ abort ();
+ MEM_IN_STRUCT_P (mem) = from_struct;
+ ldinsns[n].operands[0] = tmpregs[n];
+ ldinsns[n].operands[1] = mem;
+ sprintf (ldinsns[n].template, "%s\t%%0, %%1", ldname);
+
+ /* record the store instruction opcode and operands */
+ addr = plus_constant (to_addr, offset);
+ mem = gen_rtx_MEM (mode, addr);
+ if (! memory_address_p (mode, addr))
+ abort ();
+ MEM_IN_STRUCT_P (mem) = to_struct;
+ stinsns[n].operands[0] = tmpregs[n];
+ stinsns[n].operands[1] = mem;
+ sprintf (stinsns[n].template, "%s\t%%0, %%1", stname);
+
+ offset += item_size;
+ bytes -= item_size;
+ }
+
+ /* now output the loads followed by the stores */
+ for (n = 0; n < chunk_size; n++)
+ output_asm_insn (ldinsns[n].template, ldinsns[n].operands);
+ for (n = 0; n < chunk_size; n++)
+ output_asm_insn (stinsns[n].template, stinsns[n].operands);
+ }
+}
+
+
+static enum machine_mode
+xtensa_find_mode_for_size (item_size)
+ unsigned item_size;
+{
+ enum machine_mode mode, tmode;
+
+ while (1)
+ {
+ mode = VOIDmode;
+
+ /* find mode closest to but not bigger than item_size */
+ for (tmode = GET_CLASS_NARROWEST_MODE (MODE_INT);
+ tmode != VOIDmode; tmode = GET_MODE_WIDER_MODE (tmode))
+ if (GET_MODE_SIZE (tmode) <= item_size)
+ mode = tmode;
+ if (mode == VOIDmode)
+ abort ();
+
+ item_size = GET_MODE_SIZE (mode);
+
+ if (xtensa_ld_opcodes[(int) mode]
+ && xtensa_st_opcodes[(int) mode])
+ break;
+
+ /* cannot load & store this mode; try something smaller */
+ item_size -= 1;
+ }
+
+ return mode;
+}
+
+
+void
+xtensa_expand_nonlocal_goto (operands)
+ rtx *operands;
+{
+ rtx goto_handler = operands[1];
+ rtx containing_fp = operands[3];
+
+ /* generate a call to "__xtensa_nonlocal_goto" (in libgcc); the code
+ is too big to generate in-line */
+
+ if (GET_CODE (containing_fp) != REG)
+ containing_fp = force_reg (Pmode, containing_fp);
+
+ goto_handler = replace_rtx (copy_rtx (goto_handler),
+ virtual_stack_vars_rtx,
+ containing_fp);
+
+ emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__xtensa_nonlocal_goto"),
+ 0, VOIDmode, 2,
+ containing_fp, Pmode,
+ goto_handler, Pmode);
+}
+
+
+static void
+xtensa_init_machine_status (p)
+ struct function *p;
+{
+ p->machine = (struct machine_function *)
+ xcalloc (1, sizeof (struct machine_function));
+}
+
+
+static void
+xtensa_free_machine_status (p)
+ struct function *p;
+{
+ free (p->machine);
+ p->machine = NULL;
+}
+
+
+void
+xtensa_setup_frame_addresses ()
+{
+ /* Set flag to cause FRAME_POINTER_REQUIRED to be set. */
+ cfun->machine->accesses_prev_frame = 1;
+
+ emit_library_call
+ (gen_rtx_SYMBOL_REF (Pmode, "__xtensa_libgcc_window_spill"),
+ 0, VOIDmode, 0);
+}
+
+
+/* Emit the assembly for the end of a zero-cost loop. Normally we just emit
+ a comment showing where the end of the loop is. However, if there is a
+ label or a branch at the end of the loop then we need to place a nop
+ there. If the loop ends with a label we need the nop so that branches
+ targetting that label will target the nop (and thus remain in the loop),
+ instead of targetting the instruction after the loop (and thus exiting
+ the loop). If the loop ends with a branch, we need the nop in case the
+ branch is targetting a location inside the loop. When the branch
+ executes it will cause the loop count to be decremented even if it is
+ taken (because it is the last instruction in the loop), so we need to
+ nop after the branch to prevent the loop count from being decremented
+ when the branch is taken. */
+
+void
+xtensa_emit_loop_end (insn, operands)
+ rtx insn;
+ rtx *operands;
+{
+ char done = 0;
+
+ for (insn = PREV_INSN (insn); insn && !done; insn = PREV_INSN (insn))
+ {
+ switch (GET_CODE (insn))
+ {
+ case NOTE:
+ case BARRIER:
+ break;
+
+ case CODE_LABEL:
+ output_asm_insn ("nop.n", operands);
+ done = 1;
+ break;
+
+ default:
+ {
+ rtx body = PATTERN (insn);
+
+ if (GET_CODE (body) == JUMP_INSN)
+ {
+ output_asm_insn ("nop.n", operands);
+ done = 1;
+ }
+ else if ((GET_CODE (body) != USE)
+ && (GET_CODE (body) != CLOBBER))
+ done = 1;
+ }
+ break;
+ }
+ }
+
+ output_asm_insn ("# loop end for %0", operands);
+}
+
+
+char *
+xtensa_emit_call (callop, operands)
+ int callop;
+ rtx *operands;
+{
+ char *result = (char *) malloc (64);
+ rtx tgt = operands[callop];
+
+ if (GET_CODE (tgt) == CONST_INT)
+ sprintf (result, "call8\t0x%x", INTVAL (tgt));
+ else if (register_operand (tgt, VOIDmode))
+ sprintf (result, "callx8\t%%%d", callop);
+ else
+ sprintf (result, "call8\t%%%d", callop);
+
+ return result;
+}
+
+
+/* Return the stabs register number to use for 'regno'. */
+
+int
+xtensa_dbx_register_number (regno)
+ int regno;
+{
+ int first = -1;
+
+ if (GP_REG_P (regno)) {
+ regno -= GP_REG_FIRST;
+ first = 0;
+ }
+ else if (BR_REG_P (regno)) {
+ regno -= BR_REG_FIRST;
+ first = 16;
+ }
+ else if (FP_REG_P (regno)) {
+ regno -= FP_REG_FIRST;
+ /* The current numbering convention is that TIE registers are
+ numbered in libcc order beginning with 256. We can't guarantee
+ that the FP registers will come first, so the following is just
+ a guess. It seems like we should make a special case for FP
+ registers and give them fixed numbers < 256. */
+ first = 256;
+ }
+ else if (ACC_REG_P (regno))
+ {
+ first = 0;
+ regno = -1;
+ }
+
+ /* When optimizing, we sometimes get asked about pseudo-registers
+ that don't represent hard registers. Return 0 for these. */
+ if (first == -1)
+ return 0;
+
+ return first + regno;
+}
+
+
+/* Argument support functions. */
+
+/* Initialize CUMULATIVE_ARGS for a function. */
+
+void
+init_cumulative_args (cum, fntype, libname)
+ CUMULATIVE_ARGS *cum; /* argument info to initialize */
+ tree fntype ATTRIBUTE_UNUSED; /* tree ptr for function decl */
+ rtx libname ATTRIBUTE_UNUSED; /* SYMBOL_REF of library name or 0 */
+{
+ cum->arg_words = 0;
+}
+
+/* Advance the argument to the next argument position. */
+
+void
+function_arg_advance (cum, mode, type)
+ CUMULATIVE_ARGS *cum; /* current arg information */
+ enum machine_mode mode; /* current arg mode */
+ tree type; /* type of the argument or 0 if lib support */
+{
+ int words, max;
+ int *arg_words;
+
+ arg_words = &cum->arg_words;
+ max = MAX_ARGS_IN_REGISTERS;
+
+ words = (((mode != BLKmode)
+ ? (int) GET_MODE_SIZE (mode)
+ : int_size_in_bytes (type)) + UNITS_PER_WORD - 1) / UNITS_PER_WORD;
+
+ if ((*arg_words + words > max) && (*arg_words < max))
+ *arg_words = max;
+
+ *arg_words += words;
+}
+
+
+/* Return an RTL expression containing the register for the given mode,
+ or 0 if the argument is to be passed on the stack. */
+
+rtx
+function_arg (cum, mode, type, incoming_p)
+ CUMULATIVE_ARGS *cum; /* current arg information */
+ enum machine_mode mode; /* current arg mode */
+ tree type; /* type of the argument or 0 if lib support */
+ int incoming_p; /* computing the incoming registers? */
+{
+ int regbase, words, max;
+ int *arg_words;
+ int regno;
+ enum machine_mode result_mode;
+
+ arg_words = &cum->arg_words;
+ regbase = (incoming_p ? GP_ARG_FIRST : GP_OUTGOING_ARG_FIRST);
+ max = MAX_ARGS_IN_REGISTERS;
+
+ words = (((mode != BLKmode)
+ ? (int) GET_MODE_SIZE (mode)
+ : int_size_in_bytes (type)) + UNITS_PER_WORD - 1) / UNITS_PER_WORD;
+
+ if (type && (TYPE_ALIGN (type) > BITS_PER_WORD))
+ *arg_words += (*arg_words & 1);
+
+ if (*arg_words + words > max)
+ return (rtx)0;
+
+ regno = regbase + *arg_words;
+ result_mode = (mode == BLKmode ? TYPE_MODE (type) : mode);
+
+ /* We need to make sure that references to a7 are represented with
+ rtx that is not equal to hard_frame_pointer_rtx. For BLKmode and
+ modes bigger than 2 words (because we only have patterns for
+ modes of 2 words or smaller), we can't control the expansion
+ unless we explicitly list the individual registers in a PARALLEL. */
+
+ if ((mode == BLKmode || words > 2)
+ && regno < A7_REG
+ && regno + words > A7_REG)
+ {
+ rtx result;
+ int n;
+
+ result = gen_rtx_PARALLEL (result_mode, rtvec_alloc (words));
+ for (n = 0; n < words; n++)
+ {
+ XVECEXP (result, 0, n) =
+ gen_rtx_EXPR_LIST (VOIDmode,
+ gen_raw_REG (SImode, regno + n),
+ GEN_INT (n * UNITS_PER_WORD));
+ }
+ return result;
+ }
+
+ return gen_raw_REG (result_mode, regno);
+}
+
+
+void
+override_options ()
+{
+ int regno;
+ enum machine_mode mode;
+
+ if (!TARGET_BOOLEANS && TARGET_HARD_FLOAT)
+ error ("boolean registers required for the floating-point option");
+
+ /* set up the tables of ld/st opcode names for block moves */
+ xtensa_ld_opcodes[(int) SImode] = "l32i";
+ xtensa_ld_opcodes[(int) HImode] = "l16ui";
+ xtensa_ld_opcodes[(int) QImode] = "l8ui";
+ xtensa_st_opcodes[(int) SImode] = "s32i";
+ xtensa_st_opcodes[(int) HImode] = "s16i";
+ xtensa_st_opcodes[(int) QImode] = "s8i";
+
+ xtensa_char_to_class['q'] = SP_REG;
+ xtensa_char_to_class['a'] = GR_REGS;
+ xtensa_char_to_class['b'] = ((TARGET_BOOLEANS) ? BR_REGS : NO_REGS);
+ xtensa_char_to_class['f'] = ((TARGET_HARD_FLOAT) ? FP_REGS : NO_REGS);
+ xtensa_char_to_class['A'] = ((TARGET_MAC16) ? ACC_REG : NO_REGS);
+ xtensa_char_to_class['B'] = ((TARGET_SEXT) ? GR_REGS : NO_REGS);
+ xtensa_char_to_class['C'] = ((TARGET_MUL16) ? GR_REGS: NO_REGS);
+ xtensa_char_to_class['D'] = ((TARGET_DENSITY) ? GR_REGS: NO_REGS);
+ xtensa_char_to_class['d'] = ((TARGET_DENSITY) ? AR_REGS: NO_REGS);
+
+ /* Set up array giving whether a given register can hold a given mode. */
+ for (mode = VOIDmode;
+ mode != MAX_MACHINE_MODE;
+ mode = (enum machine_mode) ((int) mode + 1))
+ {
+ int size = GET_MODE_SIZE (mode);
+ enum mode_class class = GET_MODE_CLASS (mode);
+
+ for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++)
+ {
+ int temp;
+
+ if (ACC_REG_P (regno))
+ temp = (TARGET_MAC16 &&
+ (class == MODE_INT) && (size <= UNITS_PER_WORD));
+ else if (GP_REG_P (regno))
+ temp = ((regno & 1) == 0 || (size <= UNITS_PER_WORD));
+ else if (FP_REG_P (regno))
+ temp = (TARGET_HARD_FLOAT && (mode == SFmode));
+ else if (BR_REG_P (regno))
+ temp = (TARGET_BOOLEANS && (mode == CCmode));
+ else
+ temp = FALSE;
+
+ xtensa_hard_regno_mode_ok[(int) mode][regno] = temp;
+ }
+ }
+
+ init_machine_status = xtensa_init_machine_status;
+ free_machine_status = xtensa_free_machine_status;
+
+ /* Check PIC settings. There's no need for -fPIC on Xtensa and
+ some targets need to always use PIC. */
+ if (XTENSA_ALWAYS_PIC)
+ {
+ if (flag_pic)
+ warning ("-f%s ignored (all code is position independent)",
+ (flag_pic > 1 ? "PIC" : "pic"));
+ flag_pic = 1;
+ }
+ if (flag_pic > 1)
+ flag_pic = 1;
+}
+
+
+/* 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.
+
+ 'a', 'c', 'l', and 'n' are reserved.
+
+ The Xtensa specific codes are:
+
+ 'd' CONST_INT, print as signed decimal
+ 'x' CONST_INT, print as signed hexadecimal
+ 'K' CONST_INT, print number of bits in mask for EXTUI
+ 'R' CONST_INT, print (X & 0x1f)
+ 'L' CONST_INT, print ((32 - X) & 0x1f)
+ 'D' REG, print second register of double-word register operand
+ 'N' MEM, print address of next word following a memory operand
+ 'v' MEM, if memory reference is volatile, output a MEMW before it
+*/
+
+static void
+printx (file, val)
+ FILE *file;
+ signed int val;
+{
+ /* print a hexadecimal value in a nice way */
+ if ((val > -0xa) && (val < 0xa))
+ fprintf (file, "%d", val);
+ else if (val < 0)
+ fprintf (file, "-0x%x", -val);
+ else
+ fprintf (file, "0x%x", val);
+}
+
+
+void
+print_operand (file, op, letter)
+ FILE *file; /* file to write to */
+ rtx op; /* operand to print */
+ int letter; /* %<letter> or 0 */
+{
+ register enum rtx_code code;
+
+ if (! op)
+ error ("PRINT_OPERAND null pointer");
+
+ code = GET_CODE (op);
+ switch (code)
+ {
+ case REG:
+ case SUBREG:
+ {
+ int regnum = xt_true_regnum (op);
+ if (letter == 'D')
+ regnum++;
+ fprintf (file, "%s", reg_names[regnum]);
+ break;
+ }
+
+ case MEM:
+ /*
+ * For a volatile memory reference, emit a MEMW before the
+ * load or store.
+ */
+ if (letter == 'v')
+ {
+ if (MEM_VOLATILE_P (op) && TARGET_SERIALIZE_VOLATILE)
+ fprintf (file, "memw\n\t");
+ break;
+ }
+ else if (letter == 'N')
+ op = adj_offsettable_operand (op, 4);
+
+ output_address (XEXP (op, 0));
+ break;
+
+ case CONST_INT:
+ switch (letter)
+ {
+ case 'K':
+ {
+ int num_bits = 0;
+ unsigned val = INTVAL (op);
+ while (val & 1)
+ {
+ num_bits += 1;
+ val = val >> 1;
+ }
+ if ((val != 0) || (num_bits == 0) || (num_bits > 16))
+ fatal_insn ("invalid mask", op);
+
+ fprintf (file, "%d", num_bits);
+ break;
+ }
+
+ case 'L':
+ fprintf (file, "%d", (32 - INTVAL (op)) & 0x1f);
+ break;
+
+ case 'R':
+ fprintf (file, "%d", INTVAL (op) & 0x1f);
+ break;
+
+ case 'x':
+ printx (file, INTVAL (op));
+ break;
+
+ case 'd':
+ default:
+ fprintf (file, "%d", INTVAL (op));
+ break;
+
+ }
+ break;
+
+ default:
+ output_addr_const (file, op);
+ }
+}
+
+
+/* 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 ADDR. ADDR 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. */
+
+void
+print_operand_address (file, addr)
+ FILE *file;
+ rtx addr;
+{
+ if (!addr)
+ error ("PRINT_OPERAND_ADDRESS, null pointer");
+
+ switch (GET_CODE (addr))
+ {
+ default:
+ fatal_insn ("invalid address", addr);
+ break;
+
+ case REG:
+ fprintf (file, "%s, 0", reg_names [REGNO (addr)]);
+ break;
+
+ case PLUS:
+ {
+ rtx reg = (rtx)0;
+ rtx offset = (rtx)0;
+ rtx arg0 = XEXP (addr, 0);
+ rtx arg1 = XEXP (addr, 1);
+
+ if (GET_CODE (arg0) == REG)
+ {
+ reg = arg0;
+ offset = arg1;
+ }
+ else if (GET_CODE (arg1) == REG)
+ {
+ reg = arg1;
+ offset = arg0;
+ }
+ else
+ fatal_insn ("no register in address", addr);
+
+ if (CONSTANT_P (offset))
+ {
+ fprintf (file, "%s, ", reg_names [REGNO (reg)]);
+ output_addr_const (file, offset);
+ }
+ else
+ fatal_insn ("address offset not a constant", addr);
+ }
+ break;
+
+ case LABEL_REF:
+ case SYMBOL_REF:
+ case CONST_INT:
+ case CONST:
+ output_addr_const (file, addr);
+ break;
+ }
+}
+
+
+/* Emit either a label, .comm, or .lcomm directive. */
+
+void
+xtensa_declare_object (file, name, init_string, final_string, size)
+ FILE *file;
+ char *name;
+ char *init_string;
+ char *final_string;
+ int size;
+{
+ fputs (init_string, file); /* "", "\t.comm\t", or "\t.lcomm\t" */
+ assemble_name (file, name);
+ fprintf (file, final_string, size); /* ":\n", ",%u\n", ",%u\n" */
+}
+
+
+void
+xtensa_output_literal (file, x, mode, labelno)
+ FILE *file;
+ rtx x;
+ enum machine_mode mode;
+ int labelno;
+{
+ long value_long[2];
+ union real_extract u;
+ int size;
+
+ fprintf (file, "\t.literal .LC%u, ", (unsigned) labelno);
+
+ switch (GET_MODE_CLASS (mode))
+ {
+ case MODE_FLOAT:
+ if (GET_CODE (x) != CONST_DOUBLE)
+ abort ();
+
+ memcpy ((char *) &u, (char *) &CONST_DOUBLE_LOW (x), sizeof u);
+ switch (mode)
+ {
+ case SFmode:
+ REAL_VALUE_TO_TARGET_SINGLE (u.d, value_long[0]);
+ fprintf (file, "0x%08lx\t\t# %.12g (float)\n", value_long[0], u.d);
+ break;
+
+ case DFmode:
+ REAL_VALUE_TO_TARGET_DOUBLE (u.d, value_long);
+ fprintf (file, "0x%08lx, 0x%08lx # %.20g (double)\n",
+ value_long[0], value_long[1], u.d);
+ break;
+
+ default:
+ abort ();
+ }
+
+ break;
+
+ case MODE_INT:
+ case MODE_PARTIAL_INT:
+ size = GET_MODE_SIZE (mode);
+ if (size == 4)
+ {
+ output_addr_const (file, x);
+ fputs ("\n", file);
+ }
+ else if (size == 8)
+ {
+ output_addr_const (file, operand_subword (x, 0, 0, DImode));
+ fputs (", ", file);
+ output_addr_const (file, operand_subword (x, 1, 0, DImode));
+ fputs ("\n", file);
+ }
+ else
+ abort ();
+ break;
+
+ default:
+ abort ();
+ }
+}
+
+
+/* Return the bytes needed to compute the frame pointer from the current
+ stack pointer. */
+
+#define STACK_BYTES (STACK_BOUNDARY / BITS_PER_UNIT)
+#define XTENSA_STACK_ALIGN(LOC) (((LOC) + STACK_BYTES-1) & ~(STACK_BYTES-1))
+
+long
+compute_frame_size (size)
+ int size; /* # of var. bytes allocated */
+{
+ /* add space for the incoming static chain value */
+ if (current_function_needs_context)
+ size += (1 * UNITS_PER_WORD);
+
+ xtensa_current_frame_size =
+ XTENSA_STACK_ALIGN (size
+ + current_function_outgoing_args_size
+ + (WINDOW_SIZE * UNITS_PER_WORD));
+ return xtensa_current_frame_size;
+}
+
+
+int
+xtensa_frame_pointer_required ()
+{
+ /* The code to expand builtin_frame_addr and builtin_return_addr
+ currently uses the hard_frame_pointer instead of frame_pointer.
+ This seems wrong but maybe it's necessary for other architectures.
+ This function is derived from the i386 code. */
+
+ if (cfun->machine->accesses_prev_frame)
+ return 1;
+
+ return 0;
+}
+
+
+void
+xtensa_reorg (first)
+ rtx first;
+{
+ rtx insn, set_frame_ptr_insn = 0;
+
+ unsigned long tsize = compute_frame_size (get_frame_size ());
+ if (tsize < (1 << (12+3)))
+ frame_size_const = 0;
+ else
+ {
+ frame_size_const = force_const_mem (SImode, GEN_INT (tsize - 16));;
+
+ /* make sure the constant is used so it doesn't get eliminated
+ from the constant pool */
+ emit_insn_before (gen_rtx_USE (SImode, frame_size_const), first);
+ }
+
+ if (!frame_pointer_needed)
+ return;
+
+ /* Search all instructions, looking for the insn that sets up the
+ frame pointer. This search will fail if the function does not
+ have an incoming argument in $a7, but in that case, we can just
+ set up the frame pointer at the very beginning of the
+ function. */
+
+ for (insn = first; insn; insn = NEXT_INSN (insn))
+ {
+ rtx pat;
+
+ if (!INSN_P (insn))
+ continue;
+
+ pat = PATTERN (insn);
+ if (GET_CODE (pat) == UNSPEC_VOLATILE
+ && (XINT (pat, 1) == UNSPECV_SET_FP))
+ {
+ set_frame_ptr_insn = insn;
+ break;
+ }
+ }
+
+ if (set_frame_ptr_insn)
+ {
+ /* for all instructions prior to set_frame_ptr_insn, replace
+ hard_frame_pointer references with stack_pointer */
+ for (insn = first; insn != set_frame_ptr_insn; insn = NEXT_INSN (insn))
+ {
+ if (INSN_P (insn))
+ PATTERN (insn) = replace_rtx (copy_rtx (PATTERN (insn)),
+ hard_frame_pointer_rtx,
+ stack_pointer_rtx);
+ }
+ }
+ else
+ {
+ /* emit the frame pointer move immediately after the NOTE that starts
+ the function */
+ emit_insn_after (gen_movsi (hard_frame_pointer_rtx,
+ stack_pointer_rtx), first);
+ }
+}
+
+
+/* Set up the stack and frame (if desired) for the function. */
+
+void
+xtensa_function_prologue (file, size)
+ FILE *file;
+ int size ATTRIBUTE_UNUSED;
+{
+ unsigned long tsize = compute_frame_size (get_frame_size ());
+
+ if (frame_pointer_needed)
+ fprintf (file, "\t.frame\ta7, %ld\n", tsize);
+ else
+ fprintf (file, "\t.frame\tsp, %ld\n", tsize);
+
+
+ if (tsize < (1 << (12+3)))
+ {
+ fprintf (file, "\tentry\tsp, %ld\n", tsize);
+ }
+ else
+ {
+ fprintf (file, "\tentry\tsp, 16\n");
+
+ /* use a8 as a temporary since a0-a7 may be live */
+ fprintf (file, "\tl32r\ta8, ");
+ print_operand (file, frame_size_const, 0);
+ fprintf (file, "\n\tsub\ta8, sp, a8\n");
+ fprintf (file, "\tmovsp\tsp, a8\n");
+ }
+}
+
+
+/* Do any necessary cleanup after a function to restore
+ stack, frame, and regs. */
+
+void
+xtensa_function_epilogue (file, size)
+ FILE *file;
+ int size ATTRIBUTE_UNUSED;
+{
+ rtx insn = get_last_insn ();
+ /* If the last insn was a BARRIER, we don't have to write anything. */
+ if (GET_CODE (insn) == NOTE)
+ insn = prev_nonnote_insn (insn);
+ if (insn == 0 || GET_CODE (insn) != BARRIER)
+ fprintf (file, TARGET_DENSITY ? "\tretw.n\n" : "\tretw\n");
+
+ xtensa_current_frame_size = 0;
+}
+
+
+/* Create the va_list data type.
+ This structure is set up by __builtin_saveregs. The __va_reg
+ field points to a stack-allocated region holding the contents of the
+ incoming argument registers. The __va_ndx field is an index initialized
+ to the position of the first unnamed (variable) argument. This same index
+ is also used to address the arguments passed in memory. Thus, the
+ __va_stk field is initialized to point to the position of the first
+ argument in memory offset to account for the arguments passed in
+ registers. E.G., if there are 6 argument registers, and each register is
+ 4 bytes, then __va_stk is set to $sp - (6 * 4); then __va_reg[N*4]
+ references argument word N for 0 <= N < 6, and __va_stk[N*4] references
+ argument word N for N >= 6. */
+
+tree
+xtensa_build_va_list (void)
+{
+ tree f_stk, f_reg, f_ndx, record;
+
+ record = make_node (RECORD_TYPE);
+
+ f_stk = build_decl (FIELD_DECL, get_identifier ("__va_stk"),
+ ptr_type_node);
+ f_reg = build_decl (FIELD_DECL, get_identifier ("__va_reg"),
+ ptr_type_node);
+ f_ndx = build_decl (FIELD_DECL, get_identifier ("__va_ndx"),
+ integer_type_node);
+
+ DECL_FIELD_CONTEXT (f_stk) = record;
+ DECL_FIELD_CONTEXT (f_reg) = record;
+ DECL_FIELD_CONTEXT (f_ndx) = record;
+
+ TYPE_FIELDS (record) = f_stk;
+ TREE_CHAIN (f_stk) = f_reg;
+ TREE_CHAIN (f_reg) = f_ndx;
+
+ layout_type (record);
+ return record;
+}
+
+
+/* Save the incoming argument registers on the stack. Returns the
+ address of the saved registers. */
+
+rtx
+xtensa_builtin_saveregs ()
+{
+ rtx gp_regs, dest;
+ int arg_words = current_function_arg_words;
+ int gp_left = MAX_ARGS_IN_REGISTERS - arg_words;
+ int i;
+
+ if (gp_left == 0)
+ return const0_rtx;
+
+ /* allocate the general-purpose register space */
+ gp_regs = assign_stack_local
+ (BLKmode, MAX_ARGS_IN_REGISTERS * UNITS_PER_WORD, -1);
+ MEM_IN_STRUCT_P (gp_regs) = 1;
+ RTX_UNCHANGING_P (gp_regs) = 1;
+ RTX_UNCHANGING_P (XEXP (gp_regs, 0)) = 1;
+
+ /* Now store the incoming registers. */
+ dest = change_address (gp_regs, SImode,
+ plus_constant (XEXP (gp_regs, 0),
+ arg_words * UNITS_PER_WORD));
+
+ /* Note: Don't use move_block_from_reg() here because the incoming
+ argument in a7 cannot be represented by hard_frame_pointer_rtx.
+ Instead, call gen_raw_REG() directly so that we get a distinct
+ instance of (REG:SI 7). */
+ for (i = 0; i < gp_left; i++)
+ {
+ emit_move_insn (operand_subword (dest, i, 1, BLKmode),
+ gen_raw_REG (SImode, GP_ARG_FIRST + arg_words + i));
+ }
+
+ if (current_function_check_memory_usage)
+ {
+ emit_library_call
+ (chkr_set_right_libfunc, 1, VOIDmode, 3, dest, ptr_mode,
+ GEN_INT (UNITS_PER_WORD * gp_left),
+ TYPE_MODE (sizetype),
+ GEN_INT (MEMORY_USE_RW), QImode);
+ }
+
+ return XEXP (gp_regs, 0);
+}
+
+
+/* Implement `va_start' for varargs and stdarg. We look at the
+ current function to fill in an initial va_list. */
+
+void
+xtensa_va_start (stdarg_p, valist, nextarg)
+ int stdarg_p ATTRIBUTE_UNUSED;
+ tree valist;
+ rtx nextarg ATTRIBUTE_UNUSED;
+{
+ tree f_stk, stk;
+ tree f_reg, reg;
+ tree f_ndx, ndx;
+ tree t, u;
+ int arg_words;
+
+ arg_words = current_function_args_info.arg_words;
+
+ f_stk = TYPE_FIELDS (va_list_type_node);
+ f_reg = TREE_CHAIN (f_stk);
+ f_ndx = TREE_CHAIN (f_reg);
+
+ stk = build (COMPONENT_REF, TREE_TYPE (f_stk), valist, f_stk);
+ reg = build (COMPONENT_REF, TREE_TYPE (f_reg), valist, f_reg);
+ ndx = build (COMPONENT_REF, TREE_TYPE (f_ndx), valist, f_ndx);
+
+ /* Call __builtin_saveregs; save the result in __va_reg */
+ current_function_arg_words = arg_words;
+ u = make_tree (ptr_type_node, expand_builtin_saveregs ());
+ t = build (MODIFY_EXPR, ptr_type_node, reg, u);
+ TREE_SIDE_EFFECTS (t) = 1;
+ expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
+
+ /* Set the __va_stk member to $arg_ptr - (size of __va_reg area) */
+ u = make_tree (ptr_type_node, virtual_incoming_args_rtx);
+ u = fold (build (PLUS_EXPR, ptr_type_node, u,
+ build_int_2 (-MAX_ARGS_IN_REGISTERS * UNITS_PER_WORD, -1)));
+ t = build (MODIFY_EXPR, ptr_type_node, stk, u);
+ TREE_SIDE_EFFECTS (t) = 1;
+ expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
+
+ /* Set the __va_ndx member. */
+ u = build_int_2 (arg_words * UNITS_PER_WORD, 0);
+ t = build (MODIFY_EXPR, integer_type_node, ndx, u);
+ TREE_SIDE_EFFECTS (t) = 1;
+ expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
+}
+
+
+/* Implement `va_arg'. */
+
+rtx
+xtensa_va_arg (valist, type)
+ tree valist, type;
+{
+ tree f_stk, stk;
+ tree f_reg, reg;
+ tree f_ndx, ndx;
+ tree tmp, addr_tree;
+ rtx array, orig_ndx, r, addr;
+ HOST_WIDE_INT size, va_size;
+ rtx lab_false, lab_over, lab_false2;
+
+ size = int_size_in_bytes (type);
+ va_size = (size + UNITS_PER_WORD - 1) & -UNITS_PER_WORD;
+
+ f_stk = TYPE_FIELDS (va_list_type_node);
+ f_reg = TREE_CHAIN (f_stk);
+ f_ndx = TREE_CHAIN (f_reg);
+
+ stk = build (COMPONENT_REF, TREE_TYPE (f_stk), valist, f_stk);
+ reg = build (COMPONENT_REF, TREE_TYPE (f_reg), valist, f_reg);
+ ndx = build (COMPONENT_REF, TREE_TYPE (f_ndx), valist, f_ndx);
+
+
+ /* First align __va_ndx to a double word boundary if necessary for this arg:
+
+ if (__alignof__ (TYPE) > 4)
+ (AP).__va_ndx = (((AP).__va_ndx + 7) & -8)
+ */
+
+ if (TYPE_ALIGN (type) > BITS_PER_WORD)
+ {
+ tmp = build (PLUS_EXPR, integer_type_node, ndx,
+ build_int_2 ((2 * UNITS_PER_WORD) - 1, 0));
+ tmp = build (BIT_AND_EXPR, integer_type_node, tmp,
+ build_int_2 (-2 * UNITS_PER_WORD, -1));
+ tmp = build (MODIFY_EXPR, integer_type_node, ndx, tmp);
+ TREE_SIDE_EFFECTS (tmp) = 1;
+ expand_expr (tmp, const0_rtx, VOIDmode, EXPAND_NORMAL);
+ }
+
+
+ /* Increment __va_ndx to point past the argument:
+
+ orig_ndx = (AP).__va_ndx;
+ (AP).__va_ndx += __va_size (TYPE);
+ */
+
+ orig_ndx = gen_reg_rtx (SImode);
+ r = expand_expr (ndx, orig_ndx, SImode, EXPAND_NORMAL);
+ if (r != orig_ndx)
+ emit_move_insn (orig_ndx, r);
+
+ tmp = build (PLUS_EXPR, integer_type_node, ndx, build_int_2 (va_size, 0));
+ tmp = build (MODIFY_EXPR, integer_type_node, ndx, tmp);
+ TREE_SIDE_EFFECTS (tmp) = 1;
+ expand_expr (tmp, const0_rtx, VOIDmode, EXPAND_NORMAL);
+
+
+ /* Check if the argument is in registers:
+
+ if ((AP).__va_ndx <= __MAX_ARGS_IN_REGISTERS * 4)
+ __array = (AP).__va_reg;
+ */
+
+ lab_false = gen_label_rtx ();
+ lab_over = gen_label_rtx ();
+ array = gen_reg_rtx (Pmode);
+
+ emit_cmp_and_jump_insns (expand_expr (ndx, NULL_RTX, SImode, EXPAND_NORMAL),
+ GEN_INT (MAX_ARGS_IN_REGISTERS * UNITS_PER_WORD),
+ GT, const1_rtx, SImode, 0, 1, lab_false);
+
+ r = expand_expr (reg, array, Pmode, EXPAND_NORMAL);
+ if (r != array)
+ emit_move_insn (array, r);
+
+ emit_jump_insn (gen_jump (lab_over));
+ emit_barrier ();
+ emit_label (lab_false);
+
+
+ /* ...otherwise, the argument is on the stack (never split between
+ registers and the stack -- change __va_ndx if necessary):
+
+ else
+ {
+ if (orig_ndx < __MAX_ARGS_IN_REGISTERS * 4)
+ (AP).__va_ndx = __MAX_ARGS_IN_REGISTERS * 4 + __va_size (TYPE);
+ __array = (AP).__va_stk;
+ }
+ */
+
+ lab_false2 = gen_label_rtx ();
+ emit_cmp_and_jump_insns (orig_ndx,
+ GEN_INT (MAX_ARGS_IN_REGISTERS * UNITS_PER_WORD),
+ GE, const1_rtx, SImode, 0, 1, lab_false2);
+
+ tmp = build_int_2 ((MAX_ARGS_IN_REGISTERS * UNITS_PER_WORD) + va_size, 0);
+ tmp = build (MODIFY_EXPR, integer_type_node, ndx, tmp);
+ TREE_SIDE_EFFECTS (tmp) = 1;
+ expand_expr (tmp, const0_rtx, VOIDmode, EXPAND_NORMAL);
+
+ emit_label (lab_false2);
+
+ r = expand_expr (stk, array, Pmode, EXPAND_NORMAL);
+ if (r != array)
+ emit_move_insn (array, r);
+
+
+ /* Given the base array pointer (__array) and index to the subsequent
+ argument (__va_ndx), find the address:
+
+ Big-endian:
+ __array + (AP).__va_ndx - sizeof (TYPE)
+
+ Little-endian:
+ __array + (AP).__va_ndx - __va_size (TYPE)
+
+ The results are endian-dependent because values smaller than one word
+ are aligned differently.
+ */
+
+ emit_label (lab_over);
+
+ addr_tree = build (PLUS_EXPR, ptr_type_node,
+ make_tree (ptr_type_node, array),
+ ndx);
+ addr_tree = build (PLUS_EXPR, ptr_type_node,
+ addr_tree,
+ build_int_2 (BYTES_BIG_ENDIAN
+ && size < (PARM_BOUNDARY / BITS_PER_UNIT)
+ ? -size
+ : -va_size, -1));
+ addr = expand_expr (addr_tree, NULL_RTX, Pmode, EXPAND_NORMAL);
+ addr = copy_to_reg (addr);
+ return addr;
+}
+
+
+enum reg_class
+xtensa_secondary_reload_class (class, mode, x, isoutput)
+ enum reg_class class;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
+ rtx x;
+ int isoutput;
+{
+ int regno;
+
+ if (GET_CODE (x) == SIGN_EXTEND)
+ x = XEXP (x, 0);
+ regno = xt_true_regnum (x);
+
+ if (!isoutput)
+ {
+ if (class == FP_REGS && constantpool_mem_p (x))
+ return GR_REGS;
+ }
+
+ if (ACC_REG_P (regno))
+ return (class == GR_REGS ? NO_REGS : GR_REGS);
+ if (class == ACC_REG)
+ return (GP_REG_P (regno) ? NO_REGS : GR_REGS);
+
+ return NO_REGS;
+}
+
+
+void
+order_regs_for_local_alloc ()
+{
+ if (!leaf_function_p ())
+ {
+ bcopy ((char *) reg_nonleaf_alloc_order,
+ (char *) reg_alloc_order, FIRST_PSEUDO_REGISTER * sizeof (int));
+ }
+ else
+ {
+ int i, num_arg_regs;
+ int nxt = 0;
+
+ /* use the AR registers in increasing order (skipping a0 and a1)
+ but save the incoming argument registers for a last resort */
+ num_arg_regs = current_function_args_info.arg_words;
+ if (num_arg_regs > MAX_ARGS_IN_REGISTERS)
+ num_arg_regs = MAX_ARGS_IN_REGISTERS;
+ for (i = GP_ARG_FIRST; i < 16 - num_arg_regs; i++)
+ reg_alloc_order[nxt++] = i + num_arg_regs;
+ for (i = 0; i < num_arg_regs; i++)
+ reg_alloc_order[nxt++] = GP_ARG_FIRST + i;
+
+ /* list the FP registers in order for now */
+ for (i = 0; i < 16; i++)
+ reg_alloc_order[nxt++] = FP_REG_FIRST + i;
+
+ /* GCC requires that we list *all* the registers.... */
+ reg_alloc_order[nxt++] = 0; /* a0 = return address */
+ reg_alloc_order[nxt++] = 1; /* a1 = stack pointer */
+ reg_alloc_order[nxt++] = 16; /* pseudo frame pointer */
+ reg_alloc_order[nxt++] = 17; /* pseudo arg pointer */
+
+ /* list the coprocessor registers in order */
+ for (i = 0; i < BR_REG_NUM; i++)
+ reg_alloc_order[nxt++] = BR_REG_FIRST + i;
+
+ reg_alloc_order[nxt++] = ACC_REG_FIRST; /* MAC16 accumulator */
+ }
+}
+
+
+/* A customized version of reg_overlap_mentioned_p that only looks for
+ references to a7 (as opposed to hard_frame_pointer_rtx). */
+
+int
+a7_overlap_mentioned_p (x)
+ rtx x;
+{
+ int i, j;
+ unsigned int x_regno;
+ const char *fmt;
+
+ if (GET_CODE (x) == REG)
+ {
+ x_regno = REGNO (x);
+ return (x != hard_frame_pointer_rtx
+ && x_regno < A7_REG + 1
+ && x_regno + HARD_REGNO_NREGS (A7_REG, GET_MODE (x)) > A7_REG);
+ }
+
+ if (GET_CODE (x) == SUBREG
+ && GET_CODE (SUBREG_REG (x)) == REG
+ && REGNO (SUBREG_REG (x)) < FIRST_PSEUDO_REGISTER)
+ {
+ x_regno = REGNO (SUBREG_REG (x)) + SUBREG_WORD (x);
+ return (SUBREG_REG (x) != hard_frame_pointer_rtx
+ && x_regno < A7_REG + 1
+ && x_regno + HARD_REGNO_NREGS (A7_REG, GET_MODE (x)) > A7_REG);
+ }
+
+ /* X does not match, so try its subexpressions. */
+ fmt = GET_RTX_FORMAT (GET_CODE (x));
+ for (i = GET_RTX_LENGTH (GET_CODE (x)) - 1; i >= 0; i--)
+ {
+ if (fmt[i] == 'e')
+ {
+ if (a7_overlap_mentioned_p (XEXP (x, i)))
+ return 1;
+ }
+ else if (fmt[i] == 'E')
+ {
+ for (j = XVECLEN (x, i) - 1; j >=0; j--)
+ if (a7_overlap_mentioned_p (XVECEXP (x, i, j)))
+ return 1;
+ }
+ }
+
+ return 0;
+}
diff --git a/gcc/config/xtensa/xtensa.h b/gcc/config/xtensa/xtensa.h
new file mode 100644
index 00000000000..ccafa4630b9
--- /dev/null
+++ b/gcc/config/xtensa/xtensa.h
@@ -0,0 +1,2431 @@
+/* Definitions of Tensilica's Xtensa target machine for GNU compiler.
+ Copyright (C) 2001 Free Software Foundation, Inc.
+ Contributed by Bob Wilson (bwilson@tensilica.com) at Tensilica.
+
+This file is part of GCC.
+
+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.
+
+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 GCC; see the file COPYING. If not, write to the Free
+Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+02111-1307, USA. */
+
+/* Get Xtensa configuration settings */
+#include "xtensa/xtensa-config.h"
+
+/* Standard GCC variables that we reference. */
+extern int current_function_calls_alloca;
+extern int target_flags;
+extern int optimize;
+
+/* External variables defined in xtensa.c. */
+
+/* comparison type */
+enum cmp_type {
+ CMP_SI, /* four byte integers */
+ CMP_DI, /* eight byte integers */
+ CMP_SF, /* single precision floats */
+ CMP_DF, /* double precision floats */
+ CMP_MAX /* max comparison type */
+};
+
+#define MAX_REGFILE_NAME_LEN 16
+extern char xtensa_reg_names[][MAX_REGFILE_NAME_LEN]; /* register names */
+extern struct rtx_def * branch_cmp[2]; /* operands for compare */
+extern enum cmp_type branch_type; /* what type of branch to use */
+extern unsigned xtensa_current_frame_size;
+
+/* Run-time compilation parameters selecting different hardware subsets. */
+
+#define MASK_BIG_ENDIAN 0x00000001 /* big or little endian */
+#define MASK_DENSITY 0x00000002 /* code density option */
+#define MASK_MAC16 0x00000004 /* MAC16 option */
+#define MASK_MUL16 0x00000008 /* 16-bit integer multiply */
+#define MASK_MUL32 0x00000010 /* integer multiply/divide */
+#define MASK_DIV32 0x00000020 /* integer multiply/divide */
+#define MASK_NSA 0x00000040 /* nsa instruction option */
+#define MASK_MINMAX 0x00000080 /* min/max instructions */
+#define MASK_SEXT 0x00000100 /* sign extend insn option */
+#define MASK_BOOLEANS 0x00000200 /* boolean register option */
+#define MASK_HARD_FLOAT 0x00000400 /* floating-point option */
+#define MASK_HARD_FLOAT_DIV 0x00000800 /* floating-point divide */
+#define MASK_HARD_FLOAT_RECIP 0x00001000 /* floating-point reciprocal */
+#define MASK_HARD_FLOAT_SQRT 0x00002000 /* floating-point sqrt */
+#define MASK_HARD_FLOAT_RSQRT 0x00004000 /* floating-point recip sqrt */
+#define MASK_NO_FUSED_MADD 0x00008000 /* avoid f-p mul/add */
+#define MASK_SERIALIZE_VOLATILE 0x00010000 /* serialize volatile refs */
+
+/* Macros used in the machine description to test the flags. */
+
+#define TARGET_BIG_ENDIAN (target_flags & MASK_BIG_ENDIAN)
+#define TARGET_DENSITY (target_flags & MASK_DENSITY)
+#define TARGET_MAC16 (target_flags & MASK_MAC16)
+#define TARGET_MUL16 (target_flags & MASK_MUL16)
+#define TARGET_MUL32 (target_flags & MASK_MUL32)
+#define TARGET_DIV32 (target_flags & MASK_DIV32)
+#define TARGET_NSA (target_flags & MASK_NSA)
+#define TARGET_MINMAX (target_flags & MASK_MINMAX)
+#define TARGET_SEXT (target_flags & MASK_SEXT)
+#define TARGET_BOOLEANS (target_flags & MASK_BOOLEANS)
+#define TARGET_HARD_FLOAT (target_flags & MASK_HARD_FLOAT)
+#define TARGET_HARD_FLOAT_DIV (target_flags & MASK_HARD_FLOAT_DIV)
+#define TARGET_HARD_FLOAT_RECIP (target_flags & MASK_HARD_FLOAT_RECIP)
+#define TARGET_HARD_FLOAT_SQRT (target_flags & MASK_HARD_FLOAT_SQRT)
+#define TARGET_HARD_FLOAT_RSQRT (target_flags & MASK_HARD_FLOAT_RSQRT)
+#define TARGET_NO_FUSED_MADD (target_flags & MASK_NO_FUSED_MADD)
+#define TARGET_SERIALIZE_VOLATILE (target_flags & MASK_SERIALIZE_VOLATILE)
+
+/* Default target_flags if no switches are specified */
+
+#define TARGET_DEFAULT ( \
+ (XCHAL_HAVE_BE ? MASK_BIG_ENDIAN : 0) | \
+ (XCHAL_HAVE_DENSITY ? MASK_DENSITY : 0) | \
+ (XCHAL_HAVE_MAC16 ? MASK_MAC16 : 0) | \
+ (XCHAL_HAVE_MUL16 ? MASK_MUL16 : 0) | \
+ (XCHAL_HAVE_MUL32 ? MASK_MUL32 : 0) | \
+ (XCHAL_HAVE_DIV32 ? MASK_DIV32 : 0) | \
+ (XCHAL_HAVE_NSA ? MASK_NSA : 0) | \
+ (XCHAL_HAVE_MINMAX ? MASK_MINMAX : 0) | \
+ (XCHAL_HAVE_SEXT ? MASK_SEXT : 0) | \
+ (XCHAL_HAVE_BOOLEANS ? MASK_BOOLEANS : 0) | \
+ (XCHAL_HAVE_FP ? MASK_HARD_FLOAT : 0) | \
+ (XCHAL_HAVE_FP_DIV ? MASK_HARD_FLOAT_DIV : 0) | \
+ (XCHAL_HAVE_FP_RECIP ? MASK_HARD_FLOAT_RECIP : 0) | \
+ (XCHAL_HAVE_FP_SQRT ? MASK_HARD_FLOAT_SQRT : 0) | \
+ (XCHAL_HAVE_FP_RSQRT ? MASK_HARD_FLOAT_RSQRT : 0) | \
+ MASK_SERIALIZE_VOLATILE)
+
+/* Macro to define tables used to set the flags.
+ This is a list in braces of pairs in braces,
+ each pair being { "NAME", VALUE }
+ where VALUE is the bits to set or minus the bits to clear.
+ An empty string NAME is used to identify the default VALUE. */
+
+#define TARGET_SWITCHES \
+{ \
+ {"big-endian", MASK_BIG_ENDIAN, \
+ N_("Use big-endian byte order")}, \
+ {"little-endian", -MASK_BIG_ENDIAN, \
+ N_("Use little-endian byte order")}, \
+ {"density", MASK_DENSITY, \
+ N_("Use the Xtensa code density option")}, \
+ {"no-density", -MASK_DENSITY, \
+ N_("Do not use the Xtensa code density option")}, \
+ {"mac16", MASK_MAC16, \
+ N_("Use the Xtensa MAC16 option")}, \
+ {"no-mac16", -MASK_MAC16, \
+ N_("Do not use the Xtensa MAC16 option")}, \
+ {"mul16", MASK_MUL16, \
+ N_("Use the Xtensa MUL16 option")}, \
+ {"no-mul16", -MASK_MUL16, \
+ N_("Do not use the Xtensa MUL16 option")}, \
+ {"mul32", MASK_MUL32, \
+ N_("Use the Xtensa MUL32 option")}, \
+ {"no-mul32", -MASK_MUL32, \
+ N_("Do not use the Xtensa MUL32 option")}, \
+ {"div32", MASK_DIV32, \
+ 0 /* undocumented */}, \
+ {"no-div32", -MASK_DIV32, \
+ 0 /* undocumented */}, \
+ {"nsa", MASK_NSA, \
+ N_("Use the Xtensa NSA option")}, \
+ {"no-nsa", -MASK_NSA, \
+ N_("Do not use the Xtensa NSA option")}, \
+ {"minmax", MASK_MINMAX, \
+ N_("Use the Xtensa MIN/MAX option")}, \
+ {"no-minmax", -MASK_MINMAX, \
+ N_("Do not use the Xtensa MIN/MAX option")}, \
+ {"sext", MASK_SEXT, \
+ N_("Use the Xtensa SEXT option")}, \
+ {"no-sext", -MASK_SEXT, \
+ N_("Do not use the Xtensa SEXT option")}, \
+ {"booleans", MASK_BOOLEANS, \
+ N_("Use the Xtensa boolean register option")}, \
+ {"no-booleans", -MASK_BOOLEANS, \
+ N_("Do not use the Xtensa boolean register option")}, \
+ {"hard-float", MASK_HARD_FLOAT, \
+ N_("Use the Xtensa floating-point unit")}, \
+ {"soft-float", -MASK_HARD_FLOAT, \
+ N_("Do not use the Xtensa floating-point unit")}, \
+ {"hard-float-div", MASK_HARD_FLOAT_DIV, \
+ 0 /* undocumented */}, \
+ {"no-hard-float-div", -MASK_HARD_FLOAT_DIV, \
+ 0 /* undocumented */}, \
+ {"hard-float-recip", MASK_HARD_FLOAT_RECIP, \
+ 0 /* undocumented */}, \
+ {"no-hard-float-recip", -MASK_HARD_FLOAT_RECIP, \
+ 0 /* undocumented */}, \
+ {"hard-float-sqrt", MASK_HARD_FLOAT_SQRT, \
+ 0 /* undocumented */}, \
+ {"no-hard-float-sqrt", -MASK_HARD_FLOAT_SQRT, \
+ 0 /* undocumented */}, \
+ {"hard-float-rsqrt", MASK_HARD_FLOAT_RSQRT, \
+ 0 /* undocumented */}, \
+ {"no-hard-float-rsqrt", -MASK_HARD_FLOAT_RSQRT, \
+ 0 /* undocumented */}, \
+ {"no-fused-madd", MASK_NO_FUSED_MADD, \
+ N_("Disable fused multiply/add and multiply/subtract FP instructions")}, \
+ {"fused-madd", -MASK_NO_FUSED_MADD, \
+ N_("Enable fused multiply/add and multiply/subtract FP instructions")}, \
+ {"serialize-volatile", MASK_SERIALIZE_VOLATILE, \
+ N_("Serialize volatile memory references with MEMW instructions")}, \
+ {"no-serialize-volatile", -MASK_SERIALIZE_VOLATILE, \
+ N_("Do not serialize volatile memory references with MEMW instructions")},\
+ {"text-section-literals", 0, \
+ N_("Intersperse literal pools with code in the text section")}, \
+ {"no-text-section-literals", 0, \
+ N_("Put literal pools in a separate literal section")}, \
+ {"target-align", 0, \
+ N_("Automatically align branch targets to reduce branch penalties")}, \
+ {"no-target-align", 0, \
+ N_("Do not automatically align branch targets")}, \
+ {"longcalls", 0, \
+ N_("Use indirect CALLXn instructions for large programs")}, \
+ {"no-longcalls", 0, \
+ N_("Use direct CALLn instructions for fast calls")}, \
+ {"", TARGET_DEFAULT, 0} \
+}
+
+/* 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. */
+
+#define OVERRIDE_OPTIONS override_options ()
+
+#if XCHAL_HAVE_BE
+#define CPP_ENDIAN_SPEC "\
+ %{mlittle-endian:-D__XTENSA_EL__} \
+ %{!mlittle-endian:-D__XTENSA_EB__} "
+#else /* !XCHAL_HAVE_BE */
+#define CPP_ENDIAN_SPEC "\
+ %{mbig-endian:-D__XTENSA_EB__} \
+ %{!mbig-endian:-D__XTENSA_EL__} "
+#endif /* !XCHAL_HAVE_BE */
+
+#if XCHAL_HAVE_FP
+#define CPP_FLOAT_SPEC "%{msoft-float:-D__XTENSA_SOFT_FLOAT__}"
+#else
+#define CPP_FLOAT_SPEC "%{!mhard-float:-D__XTENSA_SOFT_FLOAT__}"
+#endif
+
+#ifndef CPP_SPEC
+#define CPP_SPEC CPP_ENDIAN_SPEC CPP_FLOAT_SPEC
+#endif
+
+/* Define this to set the endianness to use in libgcc2.c, which can
+ not depend on target_flags. */
+#define LIBGCC2_WORDS_BIG_ENDIAN XCHAL_HAVE_BE
+
+/* Show we can debug even without a frame pointer. */
+#define CAN_DEBUG_WITHOUT_FP
+
+
+/* Target machine storage layout */
+
+/* Define in order to support both big and little endian float formats
+ in the same gcc binary. */
+#define REAL_ARITHMETIC
+
+/* Define this if most significant bit is lowest numbered
+ in instructions that operate on numbered bit-fields.
+*/
+#define BITS_BIG_ENDIAN (TARGET_BIG_ENDIAN != 0)
+
+/* Define this if most significant byte of a word is the lowest numbered. */
+#define BYTES_BIG_ENDIAN (TARGET_BIG_ENDIAN != 0)
+
+/* Define this if most significant word of a multiword number is the lowest. */
+#define WORDS_BIG_ENDIAN (TARGET_BIG_ENDIAN != 0)
+
+/* 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';
+ if using 16-bit ints on a 68000, this would still be 32.
+ But on a machine with 16-bit registers, this would be 16. */
+#define BITS_PER_WORD 32
+#define MAX_BITS_PER_WORD 32
+
+/* Width of a word, in units (bytes). */
+#define UNITS_PER_WORD 4
+#define MIN_UNITS_PER_WORD 4
+
+/* Width of a floating point register. */
+#define UNITS_PER_FPREG 4
+
+/* 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. */
+#define INT_TYPE_SIZE 32
+#define MAX_INT_TYPE_SIZE 32
+
+/* Tell the preprocessor the maximum size of wchar_t. */
+#ifndef MAX_WCHAR_TYPE_SIZE
+#ifndef WCHAR_TYPE_SIZE
+#define MAX_WCHAR_TYPE_SIZE MAX_INT_TYPE_SIZE
+#endif
+#endif
+
+/* 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.) */
+#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. */
+#define LONG_TYPE_SIZE 32
+#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. */
+#define LONG_LONG_TYPE_SIZE 64
+
+/* 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.) */
+#define CHAR_TYPE_SIZE BITS_PER_UNIT
+
+/* 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. */
+#define FLOAT_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. */
+#define DOUBLE_TYPE_SIZE 64
+
+/* 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. */
+#define LONG_DOUBLE_TYPE_SIZE 64
+
+/* Width in bits of a pointer.
+ See also the macro 'Pmode' defined below. */
+#define POINTER_SIZE 32
+
+/* Allocation boundary (in *bits*) for storing pointers in memory. */
+#define POINTER_BOUNDARY 32
+
+/* Allocation boundary (in *bits*) for storing arguments in argument list. */
+#define PARM_BOUNDARY 32
+
+/* Allocation boundary (in *bits*) for the code of a function. */
+#define FUNCTION_BOUNDARY 32
+
+/* Alignment of field after 'int : 0' in a structure. */
+#define EMPTY_FIELD_BOUNDARY 32
+
+/* Every structure's size must be a multiple of this. */
+#define STRUCTURE_SIZE_BOUNDARY 8
+
+/* There is no point aligning anything to a rounder boundary than this. */
+#define BIGGEST_ALIGNMENT 128
+
+/* Set this nonzero if move instructions will actually fail to work
+ when given unaligned data. */
+#define STRICT_ALIGNMENT 1
+
+/* A macro to update M and UNSIGNEDP when an object whose type is
+ TYPE and which has the specified mode and signedness is to be
+ stored in a register. This macro is only called when TYPE is a
+ scalar type.
+
+ On most RISC machines, which only have operations that operate on a
+ full register, define this macro to set M to `word_mode' if M is an
+ integer mode narrower than `BITS_PER_WORD'. In most cases, only
+ integer modes should be widened because wider-precision
+ floating-point operations are usually more expensive than their
+ narrower counterparts.
+
+ For Xtensa, also set UNSIGNEDP for QImode, because there is no
+ 8-bit load from memory with sign extension. Otherwise, leave
+ UNSIGNEDP alone, since Xtensa has 16-bit loads both with and
+ without sign extension. */
+
+#define PROMOTE_MODE(MODE, UNSIGNEDP, TYPE) \
+ do { \
+ if (GET_MODE_CLASS (MODE) == MODE_INT \
+ && GET_MODE_SIZE (MODE) < UNITS_PER_WORD) \
+ { \
+ if ((MODE) == QImode) \
+ (UNSIGNEDP) = 1; \
+ (MODE) = SImode; \
+ } \
+ } while (0)
+
+/* Define this macro if the promotion described by `PROMOTE_MODE'
+ should also be done for outgoing function arguments. */
+
+#define PROMOTE_FUNCTION_ARGS
+
+/* Define this macro if the promotion described by `PROMOTE_MODE'
+ should also be done for the return value of functions.
+
+ If this macro is defined, `FUNCTION_VALUE' must perform the same
+ promotions done by `PROMOTE_MODE'. */
+
+#define PROMOTE_FUNCTION_RETURN
+
+/* Define this if you wish to imitate the way many other C compilers
+ handle alignment of bitfields and the structures that contain
+ them.
+
+ The behavior is that the type written for a bitfield ('int',
+ 'short', or other integer type) imposes an alignment for the
+ entire structure, as if the structure really did contain an
+ ordinary field of that type. In addition, the bitfield is placed
+ within the structure so that it would fit within such a field,
+ not crossing a boundary for it.
+
+ Thus, on most machines, a bitfield whose type is written as 'int'
+ would not cross a four-byte boundary, and would force four-byte
+ alignment for the whole structure. (The alignment used may not
+ be four bytes; it is controlled by the other alignment
+ parameters.)
+
+ If the macro is defined, its definition should be a C expression;
+ a nonzero value for the expression enables this behavior. */
+
+#define PCC_BITFIELD_TYPE_MATTERS 1
+
+/* If defined, a C expression to compute the alignment given to a
+ constant that is being placed in memory. CONSTANT is the constant
+ 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.
+
+ The typical use of this macro is to increase alignment for string
+ constants to be word aligned so that 'strcpy' calls that copy
+ constants can be done inline. */
+
+#define CONSTANT_ALIGNMENT(EXP, ALIGN) \
+ ((TREE_CODE (EXP) == STRING_CST || TREE_CODE (EXP) == CONSTRUCTOR) \
+ && (ALIGN) < BITS_PER_WORD \
+ ? BITS_PER_WORD \
+ : (ALIGN))
+
+/* 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.
+
+ 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 'strcpy' calls
+ that copy constants to character arrays can be done inline. */
+
+#undef DATA_ALIGNMENT
+#define DATA_ALIGNMENT(TYPE, ALIGN) \
+ ((((ALIGN) < BITS_PER_WORD) \
+ && (TREE_CODE (TYPE) == ARRAY_TYPE \
+ || TREE_CODE (TYPE) == UNION_TYPE \
+ || TREE_CODE (TYPE) == RECORD_TYPE)) ? BITS_PER_WORD : (ALIGN))
+
+/* Define this macro if an argument declared as 'char' or 'short' in a
+ prototype should actually be passed as an 'int'. In addition to
+ avoiding errors in certain cases of mismatch, it also makes for
+ better code on certain machines. */
+
+#define PROMOTE_PROTOTYPES 1
+
+/* Define if operations between registers always perform the operation
+ on the full register even if a narrower mode is specified. */
+#define WORD_REGISTER_OPERATIONS
+
+/* Define if loading in MODE, an integral mode narrower than BITS_PER_WORD
+ will either zero-extend or sign-extend. The value of this macro should
+ be the code that says which one of the two operations is implicitly
+ done, NIL if none. */
+#define LOAD_EXTEND_OP(MODE) ZERO_EXTEND
+
+/* Standard register usage. */
+
+/* Number of actual hardware registers.
+ The hardware registers are assigned numbers for the compiler
+ from 0 to just below FIRST_PSEUDO_REGISTER.
+ All registers that the compiler knows about must be given numbers,
+ even those that are not normally considered general registers.
+
+ The fake frame pointer and argument pointer will never appear in
+ the generated code, since they will always be eliminated and replaced
+ by either the stack pointer or the hard frame pointer.
+
+ 0 - 15 AR[0] - AR[15]
+ 16 FRAME_POINTER (fake = initial sp)
+ 17 ARG_POINTER (fake = initial sp + framesize)
+ 18 LOOP_COUNT (loop count special register)
+ 18 BR[0] for floating-point CC
+ 19 - 34 FR[0] - FR[15]
+ 35 MAC16 accumulator */
+
+#define FIRST_PSEUDO_REGISTER 36
+
+/* Return the stabs register number to use for REGNO. */
+#define DBX_REGISTER_NUMBER(REGNO) xtensa_dbx_register_number(REGNO)
+
+/* 1 for registers that have pervasive standard uses
+ and are not available for the register allocator. */
+
+#define FIXED_REGISTERS \
+{ \
+ 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
+ 1, 1, 0, \
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
+ 0, \
+}
+
+/* 1 for registers not available across function calls.
+ These must include the FIXED_REGISTERS and also any
+ registers that can be used without being saved.
+ The latter must include the registers where values are returned
+ and the register where structure-value addresses are passed.
+ Aside from that, you can include as many other registers as you like. */
+
+#define CALL_USED_REGISTERS \
+{ \
+ 1, 1, 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, \
+}
+
+/* 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).
+
+ For non-leaf procedures on Xtensa processors, the allocation order
+ is as specified below by REG_ALLOC_ORDER. For leaf procedures, we
+ want to use the lowest numbered registers first to minimize
+ register window overflows. However, local-alloc is not smart
+ enough to consider conflicts with incoming arguments. If an
+ incoming argument in a2 is live throughout the function and
+ local-alloc decides to use a2, then the incoming argument must
+ either be spilled or copied to another register. To get around
+ this, we define ORDER_REGS_FOR_LOCAL_ALLOC to redefine
+ reg_alloc_order for leaf functions such that lowest numbered
+ registers are used first with the exception that the incoming
+ argument registers are not used until after other register choices
+ have been exhausted. */
+
+#define REG_ALLOC_ORDER \
+{ 8, 9, 10, 11, 12, 13, 14, 15, 7, 6, 5, 4, 3, 2, 19, \
+ 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, \
+ 0, 1, 16, 17, \
+ 36, \
+}
+
+/* A C statement (sans semicolon) to choose the order in which to
+ allocate hard registers for pseudo-registers local to a basic
+ block. */
+
+#define ORDER_REGS_FOR_LOCAL_ALLOC order_regs_for_local_alloc ()
+
+/* 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.
+
+ For Xtensa, the only point of this is to prevent GCC from otherwise
+ giving preference to call-used registers. To minimize window
+ overflows for the AR registers, we want to give preference to the
+ lower-numbered AR registers. For other register files, which are
+ not windowed, we still prefer call-used registers, if there are any. */
+
+extern char xtensa_leaf_regs[];
+#define LEAF_REGISTERS xtensa_leaf_regs
+
+/* A C expression whose value is the register number to which REGNO
+ should be renumbered, when a function is treated as a leaf
+ function.
+
+ For Xtensa, no remapping is necessary, but this macro must be
+ defined if LEAF_REGISTERS is defined. */
+
+#define LEAF_REG_REMAP(REGNO) (REGNO)
+
+/* this must be declared if LEAF_REGISTERS is set */
+extern int leaf_function;
+
+/* Internal macros to classify a register number. */
+
+/* 16 address registers + fake registers */
+#define GP_REG_FIRST 0
+#define GP_REG_LAST 17
+#define GP_REG_NUM (GP_REG_LAST - GP_REG_FIRST + 1)
+
+/* Special registers */
+#define SPEC_REG_FIRST 18
+#define SPEC_REG_LAST 18
+#define SPEC_REG_NUM (SPEC_REG_LAST - SPEC_REG_FIRST + 1)
+
+/* Coprocessor registers */
+#define BR_REG_FIRST 18
+#define BR_REG_LAST 18
+#define BR_REG_NUM (BR_REG_LAST - BR_REG_FIRST + 1)
+
+/* 16 floating-point registers */
+#define FP_REG_FIRST 19
+#define FP_REG_LAST 34
+#define FP_REG_NUM (FP_REG_LAST - FP_REG_FIRST + 1)
+
+/* MAC16 accumulator */
+#define ACC_REG_FIRST 35
+#define ACC_REG_LAST 35
+#define ACC_REG_NUM (ACC_REG_LAST - ACC_REG_FIRST + 1)
+
+#define GP_REG_P(REGNO) ((unsigned) ((REGNO) - GP_REG_FIRST) < GP_REG_NUM)
+#define BR_REG_P(REGNO) ((unsigned) ((REGNO) - BR_REG_FIRST) < BR_REG_NUM)
+#define FP_REG_P(REGNO) ((unsigned) ((REGNO) - FP_REG_FIRST) < FP_REG_NUM)
+#define ACC_REG_P(REGNO) ((unsigned) ((REGNO) - ACC_REG_FIRST) < ACC_REG_NUM)
+
+/* Return number of consecutive hard regs needed starting at reg REGNO
+ to hold something of mode MODE.
+ This is ordinarily the length in words of a value of mode MODE
+ but can be less for certain modes in special long registers. */
+
+#define HARD_REGNO_NREGS(REGNO, MODE) \
+ (FP_REG_P (REGNO) ? \
+ ((GET_MODE_SIZE (MODE) + UNITS_PER_FPREG - 1) / UNITS_PER_FPREG) : \
+ ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD))
+
+/* Value is 1 if hard register REGNO can hold a value of machine-mode
+ MODE. */
+
+extern char xtensa_hard_regno_mode_ok[][FIRST_PSEUDO_REGISTER];
+
+#define HARD_REGNO_MODE_OK(REGNO, MODE) \
+ xtensa_hard_regno_mode_ok[ (int)(MODE) ][ (REGNO) ]
+
+/* Value is 1 if it is a good idea to tie two pseudo registers
+ when one has mode MODE1 and one has mode MODE2.
+ If HARD_REGNO_MODE_OK could produce different values for MODE1 and MODE2,
+ for any hard reg, then this must be 0 for correct output. */
+
+#define MODES_TIEABLE_P(MODE1, MODE2) \
+ ((GET_MODE_CLASS (MODE1) == MODE_FLOAT || \
+ GET_MODE_CLASS (MODE1) == MODE_COMPLEX_FLOAT) \
+ == (GET_MODE_CLASS (MODE2) == MODE_FLOAT || \
+ GET_MODE_CLASS (MODE2) == MODE_COMPLEX_FLOAT))
+
+/* Register to use for LCOUNT special register. */
+#define COUNT_REGISTER_REGNUM (SPEC_REG_FIRST + 0)
+
+/* Register to use for pushing function arguments. */
+#define STACK_POINTER_REGNUM (GP_REG_FIRST + 1)
+
+/* Base register for access to local variables of the function. */
+#define HARD_FRAME_POINTER_REGNUM (GP_REG_FIRST + 7)
+
+/* The register number of the frame pointer register, which is used to
+ access automatic variables in the stack frame. For Xtensa, this
+ register never appears in the output. It is always eliminated to
+ either the stack pointer or the hard frame pointer. */
+#define FRAME_POINTER_REGNUM (GP_REG_FIRST + 16)
+
+/* 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 via the stack pointer) in functions that seem suitable.
+ This is computed in 'reload', in reload1.c. */
+#define FRAME_POINTER_REQUIRED xtensa_frame_pointer_required ()
+
+/* Base register for access to arguments of the function. */
+#define ARG_POINTER_REGNUM (GP_REG_FIRST + 17)
+
+/* If the static chain is passed in memory, these macros provide rtx
+ giving 'mem' expressions that denote where they are stored.
+ 'STATIC_CHAIN' and 'STATIC_CHAIN_INCOMING' give the locations as
+ seen by the calling and called functions, respectively. Often the
+ former will be at an offset from the stack pointer and the latter
+ at an offset from the frame pointer. */
+
+#define STATIC_CHAIN \
+ gen_rtx_MEM (Pmode, plus_constant (stack_pointer_rtx, -5 * UNITS_PER_WORD))
+
+#define STATIC_CHAIN_INCOMING \
+ gen_rtx_MEM (Pmode, plus_constant (arg_pointer_rtx, -5 * UNITS_PER_WORD))
+
+/* For now we don't try to use the full set of boolean registers. Without
+ software pipelining of FP operations, there's not much to gain and it's
+ a real pain to get them reloaded. */
+#define FPCC_REGNUM (BR_REG_FIRST + 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 0
+
+/* 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_FUNCTION_CSE 1
+
+/* 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. */
+#define NO_RECURSIVE_FUNCTION_CSE 1
+
+/* 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 register number OUT as seen by the calling function.
+ Return OUT if register number OUT is not an outbound register. */
+
+#define INCOMING_REGNO(OUT) \
+ ((GP_REG_P(OUT) && \
+ ((unsigned) ((OUT) - GP_REG_FIRST) >= WINDOW_SIZE)) ? \
+ (OUT) - WINDOW_SIZE : (OUT))
+
+/* 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 register number IN as seen by the called function.
+ Return IN if register number IN is not an inbound register. */
+
+#define OUTGOING_REGNO(IN) \
+ ((GP_REG_P(IN) && \
+ ((unsigned) ((IN) - GP_REG_FIRST) < WINDOW_SIZE)) ? \
+ (IN) + WINDOW_SIZE : (IN))
+
+
+/* XTENSA-SPECIFIC FLAG: Define this to prevent reload from using outgoing
+ argument registers for spills. See the comment in reload1.c. */
+
+#define DONT_USE_FUNCTION_ARGS_FOR_RELOADS
+
+
+/* Define the classes of registers for register constraints in the
+ machine description. Also define ranges of constants.
+
+ One of the classes must always be named ALL_REGS and include all hard regs.
+ If there is more than one class, another class must be named NO_REGS
+ and contain no registers.
+
+ The name GENERAL_REGS must be the name of a class (or an alias for
+ another name such as ALL_REGS). This is the class of registers
+ that is allowed by "g" or "r" in a register constraint.
+ Also, registers outside this class are allocated only when
+ instructions express preferences for them.
+
+ The classes must be numbered in nondecreasing order; that is,
+ a larger-numbered class must never be contained completely
+ in a smaller-numbered class.
+
+ For any two classes, it is very desirable that there be another
+ class that represents their union. */
+
+enum reg_class
+{
+ NO_REGS, /* no registers in set */
+ BR_REGS, /* coprocessor boolean registers */
+ FP_REGS, /* floating point registers */
+ ACC_REG, /* MAC16 accumulator */
+ SP_REG, /* sp register (aka a1) */
+ GR_REGS, /* integer registers except sp */
+ AR_REGS, /* all integer registers */
+ ALL_REGS, /* all registers */
+ LIM_REG_CLASSES /* max value + 1 */
+};
+
+#define N_REG_CLASSES (int) LIM_REG_CLASSES
+
+#define GENERAL_REGS AR_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_NAMES \
+{ \
+ "NO_REGS", \
+ "BR_REGS", \
+ "FP_REGS", \
+ "ACC_REG", \
+ "SP_REG", \
+ "GR_REGS", \
+ "AR_REGS", \
+ "ALL_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 REG_CLASS_CONTENTS \
+{ \
+ { 0x00000000, 0x00000000 }, /* no registers */ \
+ { 0x00040000, 0x00000000 }, /* coprocessor boolean registers */ \
+ { 0xfff80000, 0x00000007 }, /* floating-point registers */ \
+ { 0x00000000, 0x00000008 }, /* MAC16 accumulator */ \
+ { 0x00000002, 0x00000000 }, /* stack pointer register */ \
+ { 0x0000fffd, 0x00000000 }, /* general-purpose registers */ \
+ { 0x0003ffff, 0x00000000 }, /* integer registers */ \
+ { 0xffffffff, 0x0000000f } /* all registers */ \
+}
+
+/* A C expression whose value is a register class containing hard
+ register REGNO. In general there is more that one such class;
+ choose a class which is "minimal", meaning that no smaller class
+ also contains the register. */
+
+extern enum reg_class xtensa_regno_to_class[];
+
+#define REGNO_REG_CLASS(REGNO) xtensa_regno_to_class[ (REGNO) ]
+
+/* 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 BASE_REG_CLASS AR_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 INDEX_REG_CLASS NO_REGS
+
+/* 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' on these machines. When it is
+ defined, 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, 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 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.
+
+ For Xtensa, this macro is required because all of the 16 registers
+ may be explicitly used in the RTL, as either incoming or outgoing
+ arguments. */
+
+#define SMALL_REGISTER_CLASSES 1
+
+
+/* REGISTER AND CONSTANT CLASSES */
+
+/* Get reg_class from a letter such as appears in the machine
+ description.
+
+ Available letters: a-f,h,j-l,q,t-z,A-D,W,Y-Z
+
+ DEFINED REGISTER CLASSES:
+
+ 'a' general-purpose registers except sp
+ 'q' sp (aka a1)
+ 'D' general-purpose registers (only if density option enabled)
+ 'd' general-purpose registers, including sp (only if density enabled)
+ 'A' MAC16 accumulator (only if MAC16 option enabled)
+ 'B' general-purpose registers (only if sext instruction enabled)
+ 'C' general-purpose registers (only if mul16 option enabled)
+ 'b' coprocessor boolean registers
+ 'f' floating-point registers
+*/
+
+extern enum reg_class xtensa_char_to_class[];
+
+#define REG_CLASS_FROM_LETTER(C) xtensa_char_to_class[ (int) (C) ]
+
+/* The letters I, J, K, L, M, N, O, and P 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.
+
+ For Xtensa:
+
+ I = 12-bit signed immediate for movi
+ J = 8-bit signed immediate for addi
+ K = 4-bit value in (b4const U {0})
+ L = 4-bit value in b4constu
+ M = 7-bit value in simm7
+ N = 8-bit unsigned immediate shifted left by 8 bits for addmi
+ O = 4-bit value in ai4const
+ P = valid immediate mask value for extui */
+
+#define CONST_OK_FOR_LETTER_P(VALUE, C) \
+ ((C) == 'I' ? (xtensa_simm12b(VALUE)) \
+ : (C) == 'J' ? (xtensa_simm8(VALUE)) \
+ : (C) == 'K' ? (((VALUE) == 0) || xtensa_b4const(VALUE)) \
+ : (C) == 'L' ? (xtensa_b4constu(VALUE)) \
+ : (C) == 'M' ? (xtensa_simm7(VALUE)) \
+ : (C) == 'N' ? (xtensa_simm8x256(VALUE)) \
+ : (C) == 'O' ? (xtensa_ai4const(VALUE)) \
+ : (C) == 'P' ? (xtensa_mask_immediate(VALUE)) \
+ : FALSE)
+
+
+/* Similar, but for floating constants, and defining letters G and H.
+ Here VALUE is the CONST_DOUBLE rtx itself. */
+
+#define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) (0)
+
+
+/* Other letters can be defined in a machine-dependent fashion to
+ stand for particular classes of registers or other arbitrary
+ operand types.
+
+ The machine description macro `REG_CLASS_FROM_LETTER' has first cut
+ at the otherwise unused letters. If it evaluates to `NO_REGS',
+ then `EXTRA_CONSTRAINT' is evaluated.
+
+ The machine description macro 'EXTRA_CONSTRAINT' is passed the
+ operand as its first argument and the constraint letter as its
+ second operand.
+
+ R = memory that can be accessed with a 4-bit unsigned offset
+ S = memory where the second word can be addressed with a 4-bit offset
+ T = memory in a constant pool (addressable with a pc-relative load)
+ U = memory *NOT* in a constant pool
+
+ The offset range should not be checked here (except to distinguish
+ denser versions of the instructions for which more general versions
+ are available). Doing so leads to problems in reloading: an
+ argptr-relative address may become invalid when the phony argptr is
+ eliminated in favor of the stack pointer (the offset becomes too
+ large to fit in the instruction's immediate field); a reload is
+ generated to fix this but the RTL is not immediately updated; in
+ the meantime, the constraints are checked and none match. The
+ solution seems to be to simply skip the offset check here. The
+ address will be checked anyway because of the code in
+ GO_IF_LEGITIMATE_ADDRESS. */
+
+#define EXTRA_CONSTRAINT(OP, CODE) \
+ ((GET_CODE (OP) != MEM) ? \
+ ((CODE) >= 'R' && (CODE) <= 'U' \
+ && reload_in_progress && GET_CODE (OP) == REG \
+ && REGNO (OP) >= FIRST_PSEUDO_REGISTER) \
+ : ((CODE) == 'R') ? smalloffset_mem_p(OP) \
+ : ((CODE) == 'S') ? smalloffset_double_mem_p(OP) \
+ : ((CODE) == 'T') ? constantpool_mem_p(OP) \
+ : ((CODE) == 'U') ? !constantpool_mem_p(OP) \
+ : FALSE)
+
+/* Given an rtx X being reloaded into a reg required to be
+ in class CLASS, return the class of reg to actually use.
+ In general this is just CLASS; but on some machines
+ in some cases it is preferable to use a more restrictive class. */
+
+#define PREFERRED_RELOAD_CLASS(X, CLASS) \
+ (CONSTANT_P (X) \
+ ? (GET_CODE(X) == CONST_DOUBLE) ? NO_REGS : (CLASS) \
+ : (CLASS))
+
+#define PREFERRED_OUTPUT_RELOAD_CLASS(X, CLASS) \
+ (CLASS)
+
+/* 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. */
+
+#define SECONDARY_INPUT_RELOAD_CLASS(CLASS, MODE, X) \
+ xtensa_secondary_reload_class (CLASS, MODE, X, 0)
+
+#define SECONDARY_OUTPUT_RELOAD_CLASS(CLASS, MODE, X) \
+ xtensa_secondary_reload_class (CLASS, MODE, X, 1)
+
+/* Return the maximum number of consecutive registers
+ needed to represent mode MODE in a register of class CLASS. */
+
+#define CLASS_UNITS(mode, size) \
+ ((GET_MODE_SIZE (mode) + (size) - 1) / (size))
+
+#define CLASS_MAX_NREGS(CLASS, MODE) \
+ (CLASS_UNITS (MODE, UNITS_PER_WORD))
+
+
+/* Stack layout; function entry, exit and calling. */
+
+/* Define this if pushing a word on the stack
+ makes the stack pointer a smaller address. */
+#define STACK_GROWS_DOWNWARD
+
+/* Offset within stack frame to start allocating local variables at.
+ If FRAME_GROWS_DOWNWARD, this is the offset to the END of the
+ first local allocated. Otherwise, it is the offset to the BEGINNING
+ of the first local allocated. */
+
+#define STARTING_FRAME_OFFSET \
+ current_function_outgoing_args_size
+
+/* 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 ELIMINABLE_REGS \
+{{ ARG_POINTER_REGNUM, STACK_POINTER_REGNUM}, \
+ { ARG_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM}, \
+ { FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}, \
+ { FRAME_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM}}
+
+/* A C expression that returns non-zero 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 CAN_ELIMINATE(FROM, TO) 1
+
+/* 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 INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \
+ do { \
+ compute_frame_size (get_frame_size ()); \
+ if ((FROM) == FRAME_POINTER_REGNUM) \
+ (OFFSET) = 0; \
+ else if ((FROM) == ARG_POINTER_REGNUM) \
+ (OFFSET) = xtensa_current_frame_size; \
+ else \
+ abort (); \
+ } while (0)
+
+/* If defined, the maximum amount of space required for outgoing
+ arguments will be computed and placed into the variable
+ 'current_function_outgoing_args_size'. No space will be pushed
+ onto the stack for each call; instead, the function prologue
+ should increase the stack frame size by this amount.
+
+ It is not proper to define both 'PUSH_ROUNDING' and
+ 'ACCUMULATE_OUTGOING_ARGS'. */
+
+#define ACCUMULATE_OUTGOING_ARGS 1
+
+/* 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. */
+
+#define FIRST_PARM_OFFSET(FNDECL) 0
+
+/* Define this macro if you wish to preserve a certain alignment for
+ the stack pointer. The definition is a C expression for the
+ desired alignment (measured in bits).
+
+ Align stack frames on 128 bits for Xtensa. This is necessary for
+ 128-bit datatypes defined in TIE (e.g., for Vectra). */
+
+#define STACK_BOUNDARY 128
+
+/* A C expression that should indicate the number of bytes of its
+ own arguments that a function 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 the declaration node of the function (as a tree).
+
+ 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, FUNTYPE
+ 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. */
+
+#define RETURN_POPS_ARGS(FUNDECL, FUNTYPE, SIZE) 0
+
+/* if this is changed, the hardwired values for CALL insns in xtensa.md
+ also need to be changed */
+#define WINDOW_SIZE 8
+
+/* Symbolic macros for the registers used to return integer, floating
+ point, and values of coprocessor and user-defined modes. */
+
+#define GP_RETURN (GP_REG_FIRST + 2 + WINDOW_SIZE)
+#define GP_OUTGOING_RETURN (GP_REG_FIRST + 2)
+
+/* Symbolic macros for the first/last argument registers. */
+
+#define GP_ARG_FIRST (GP_REG_FIRST + 2)
+#define GP_ARG_LAST (GP_REG_FIRST + 7)
+#define GP_OUTGOING_ARG_FIRST (GP_REG_FIRST + 2 + WINDOW_SIZE)
+#define GP_OUTGOING_ARG_LAST (GP_REG_FIRST + 7 + WINDOW_SIZE)
+
+#define MAX_ARGS_IN_REGISTERS 6
+
+/* 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. */
+
+#define DEFAULT_PCC_STRUCT_RETURN 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.
+
+ For Xtensa, we would like to be able to return up to 6 words in
+ memory but GCC cannot support that. The return value must be given
+ one of the standard MODE_INT modes, and there is no 6 word mode.
+ Instead, if we try to return a 6 word structure, GCC selects the
+ next biggest mode (OImode, 8 words) and then the register allocator
+ fails because there is no 8-register group beginning with a10. So
+ we have to fall back on the next largest size which is 4 words... */
+
+#define RETURN_IN_MEMORY(TYPE) \
+ ((unsigned HOST_WIDE_INT) int_size_in_bytes (TYPE) > 4 * UNITS_PER_WORD)
+
+/* Define how to find the value returned by a library function
+ assuming the value has mode MODE. Because we have defined
+ PROMOTE_FUNCTION_RETURN, we have to perform the same promotions as
+ PROMOTE_MODE. */
+
+#define XTENSA_LIBCALL_VALUE(MODE, OUTGOINGP) \
+ gen_rtx_REG ((GET_MODE_CLASS (MODE) == MODE_INT \
+ && GET_MODE_SIZE (MODE) < UNITS_PER_WORD) \
+ ? SImode : (MODE), \
+ OUTGOINGP ? GP_OUTGOING_RETURN : GP_RETURN)
+
+#define LIBCALL_VALUE(MODE) \
+ XTENSA_LIBCALL_VALUE ((MODE), 0)
+
+#define LIBCALL_OUTGOING_VALUE(MODE) \
+ XTENSA_LIBCALL_VALUE ((MODE), 1)
+
+/* 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. */
+
+#define XTENSA_FUNCTION_VALUE(VALTYPE, FUNC, OUTGOINGP) \
+ gen_rtx_REG ((INTEGRAL_TYPE_P (VALTYPE) \
+ && TYPE_PRECISION (VALTYPE) < BITS_PER_WORD) \
+ ? SImode: TYPE_MODE (VALTYPE), \
+ OUTGOINGP ? GP_OUTGOING_RETURN : GP_RETURN)
+
+#define FUNCTION_VALUE(VALTYPE, FUNC) \
+ XTENSA_FUNCTION_VALUE (VALTYPE, FUNC, 0)
+
+#define FUNCTION_OUTGOING_VALUE(VALTYPE, FUNC) \
+ XTENSA_FUNCTION_VALUE (VALTYPE, FUNC, 1)
+
+/* 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. 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 FUNCTION_VALUE_REGNO_P(N) \
+ ((N) == GP_RETURN)
+
+/* 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_ARG_REGNO_P(N) \
+ ((N) >= GP_OUTGOING_ARG_FIRST && (N) <= GP_OUTGOING_ARG_LAST)
+
+/* A code distinguishing the floating point format of the target
+ machine. There are three defined values: IEEE_FLOAT_FORMAT,
+ VAX_FLOAT_FORMAT, and UNKNOWN_FLOAT_FORMAT. */
+
+#define TARGET_FLOAT_FORMAT IEEE_FLOAT_FORMAT
+
+/* Define a data type for recording info about an argument list
+ during the scan of that argument list. This data type should
+ hold all necessary information about the function itself
+ and about the args processed so far, enough to enable macros
+ such as FUNCTION_ARG to determine where the next arg should go. */
+
+typedef struct xtensa_args {
+ int arg_words; /* # total words the arguments take */
+} CUMULATIVE_ARGS;
+
+/* Initialize a variable CUM of type CUMULATIVE_ARGS
+ for a call to a function whose data type is FNTYPE.
+ For a library call, FNTYPE is 0. */
+
+#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT) \
+ init_cumulative_args (&CUM, FNTYPE, LIBNAME)
+
+#define INIT_CUMULATIVE_INCOMING_ARGS(CUM, FNTYPE, LIBNAME) \
+ init_cumulative_args (&CUM, FNTYPE, LIBNAME)
+
+/* 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) \
+ function_arg_advance (&CUM, MODE, TYPE)
+
+/* Determine where to put an argument to a function.
+ Value is zero to push the argument on the stack,
+ or a hard register in which to store the argument.
+
+ MODE is the argument's machine mode.
+ TYPE is the data type of the argument (as a tree).
+ This is null for libcalls where that information may
+ not be available.
+ CUM is a variable of type CUMULATIVE_ARGS which gives info about
+ the preceding args and about the function being called.
+ NAMED is nonzero if this argument is a named parameter
+ (otherwise it is an extra parameter matching an ellipsis). */
+
+#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
+ function_arg (&CUM, MODE, TYPE, FALSE)
+
+#define FUNCTION_INCOMING_ARG(CUM, MODE, TYPE, NAMED) \
+ function_arg (&CUM, MODE, TYPE, TRUE)
+
+/* For an arg passed partly in registers and partly in memory,
+ 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) (0)
+
+/* 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) \
+ ((TYPE) != 0 \
+ ? (TYPE_ALIGN (TYPE) <= PARM_BOUNDARY \
+ ? PARM_BOUNDARY \
+ : TYPE_ALIGN (TYPE)) \
+ : (GET_MODE_ALIGNMENT (MODE) <= PARM_BOUNDARY \
+ ? PARM_BOUNDARY \
+ : GET_MODE_ALIGNMENT (MODE)))
+
+
+/* Nonzero if we do not know how to pass TYPE solely in registers.
+ We cannot do so in the following cases:
+
+ - if the type has variable size
+ - if the type is marked as addressable (it is required to be constructed
+ into the stack)
+
+ This differs from the default in that it does not check if the padding
+ and mode of the type are such that a copy into a register would put it
+ into the wrong part of the register. */
+
+#define MUST_PASS_IN_STACK(MODE, TYPE) \
+ ((TYPE) != 0 \
+ && (TREE_CODE (TYPE_SIZE (TYPE)) != INTEGER_CST \
+ || TREE_ADDRESSABLE (TYPE)))
+
+/* This macro generates the assembly code for function entry.
+ FILE is a stdio stream to output the code to.
+ SIZE is an int: how many units of temporary storage to allocate.
+ Refer to the array 'regs_ever_live' to determine which registers
+ to save; 'regs_ever_live[I]' is nonzero if register number I
+ is ever used in the function. This macro is responsible for
+ knowing which registers should not be saved even if used. */
+
+#define FUNCTION_PROLOGUE(FILE, SIZE) xtensa_function_prologue (FILE, SIZE)
+
+/* This macro generates the assembly code for function exit,
+ on machines that need it. If FUNCTION_EPILOGUE is not defined
+ then individual return instructions are generated for each
+ return statement. Args are same as for FUNCTION_PROLOGUE. */
+
+#define FUNCTION_EPILOGUE(FILE, SIZE) xtensa_function_epilogue (FILE, SIZE)
+
+/* Output assembler code to FILE to increment profiler label LABELNO
+ for profiling a function entry.
+
+ The mcount code in glibc doesn't seem to use this LABELNO stuff.
+ Some ports (e.g., MIPS) don't even bother to pass the label
+ address, and even those that do (e.g., i386) don't seem to use it.
+ The information needed by mcount() is the current PC and the
+ current return address, so that mcount can identify an arc in the
+ call graph. For Xtensa, we pass the current return address as
+ the first argument to mcount, and the current PC is available as
+ a0 in mcount's register window. Both of these values contain
+ window size information in the two most significant bits; we assume
+ that the mcount code will mask off those bits. The call to mcount
+ uses a window size of 8 to make sure that mcount doesn't clobber
+ any incoming argument values. */
+
+#define FUNCTION_PROFILER(FILE, LABELNO) \
+ do { \
+ fprintf (FILE, "\taddi\t%s, %s, 0\t# save current return address\n", \
+ xtensa_reg_names[GP_REG_FIRST+10], \
+ xtensa_reg_names[GP_REG_FIRST+0]); \
+ fprintf (FILE, "\tcall8\t_mcount\n"); \
+ } while (0);
+
+
+/* EXIT_IGNORE_STACK should be nonzero if, when returning from a function,
+ the stack pointer does not matter. The value is tested only in
+ functions that have frame pointers.
+ No definition is equivalent to always zero. */
+
+#define EXIT_IGNORE_STACK 1
+
+
+/* A C statement to output, on the stream 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
+ automatically.
+
+ For Xtensa, the trampoline must perform an entry instruction with a
+ minimal stack frame in order to get some free registers. Once the
+ actual call target is known, the proper stack frame size is extracted
+ from the entry instruction at the target and the current frame is
+ adjusted to match. The trampoline then transfers control to the
+ instruction following the entry at the target. Note: this assumes
+ that the target begins with an entry instruction. */
+
+/* minimum frame = reg save area (4 words) plus static chain (1 word)
+ and the total number of words must be a multiple of 128 bits */
+#define MIN_FRAME_SIZE (8 * UNITS_PER_WORD)
+
+#define TRAMPOLINE_TEMPLATE(STREAM) \
+ do { \
+ fprintf (STREAM, "\t.begin no-generics\n"); \
+ fprintf (STREAM, "\tentry\tsp, %d\n", MIN_FRAME_SIZE); \
+ \
+ /* GCC isn't prepared to deal with data at the beginning of the \
+ trampoline, and the Xtensa l32r instruction requires that the \
+ constant pool be located before the code. We put the constant \
+ pool in the middle of the trampoline and jump around it. */ \
+ \
+ fprintf (STREAM, "\tj\t.Lskipconsts\n"); \
+ fprintf (STREAM, "\t.align\t4\n"); \
+ fprintf (STREAM, ".Lfnaddr:\n\t.word 0\n"); \
+ fprintf (STREAM, ".Lchainval:\n\t.word 0\n"); \
+ fprintf (STREAM, ".Lskipconsts:\n"); \
+ \
+ /* store the static chain */ \
+ fprintf (STREAM, "\tl32r\ta8, .Lchainval\n"); \
+ fprintf (STREAM, "\ts32i\ta8, sp, %d\n", \
+ MIN_FRAME_SIZE - (5 * UNITS_PER_WORD)); \
+ \
+ /* set the proper stack pointer value */ \
+ fprintf (STREAM, "\tl32r\ta8, .Lfnaddr\n"); \
+ fprintf (STREAM, "\tl32i\ta9, a8, 0\n"); \
+ fprintf (STREAM, "\textui\ta9, a9, %d, 12\n", \
+ TARGET_BIG_ENDIAN ? 8 : 12); \
+ fprintf (STREAM, "\tslli\ta9, a9, 3\n"); \
+ fprintf (STREAM, "\taddi\ta9, a9, %d\n", -MIN_FRAME_SIZE); \
+ fprintf (STREAM, "\tsub\ta9, sp, a9\n"); \
+ fprintf (STREAM, "\tmovsp\tsp, a9\n"); \
+ \
+ /* jump to the instruction following the entry */ \
+ fprintf (STREAM, "\taddi\ta8, a8, 3\n"); \
+ fprintf (STREAM, "\tjx\ta8\n"); \
+ fprintf (STREAM, "\t.end no-generics\n"); \
+ } while (0)
+
+/* A C expression for the size in bytes of the trampoline, as an
+ integer. */
+
+#define TRAMPOLINE_SIZE 49
+
+/* Alignment required for trampolines, in bits. */
+
+#define TRAMPOLINE_ALIGNMENT (32)
+
+/* A C statement to initialize the variable parts of a trampoline.
+ ADDR is an RTX for the address of the trampoline; FNADDR is an
+ RTX for the address of the nested function; CHAIN is an
+ RTX for the static chain value that should be passed to the
+ function when it is called. */
+
+#define INITIALIZE_TRAMPOLINE(ADDR, FUNC, CHAIN) \
+ do { \
+ rtx addr = ADDR; \
+ emit_move_insn (gen_rtx_MEM (SImode, plus_constant (addr, 8)), FUNC); \
+ emit_move_insn (gen_rtx_MEM (SImode, plus_constant (addr, 12)), CHAIN); \
+ emit_library_call (gen_rtx (SYMBOL_REF, Pmode, "__xtensa_sync_caches"), \
+ 0, VOIDmode, 1, addr, Pmode); \
+ } while (0)
+
+/* Define the `__builtin_va_list' type for the ABI. */
+#define BUILD_VA_LIST_TYPE(VALIST) \
+ (VALIST) = xtensa_build_va_list ()
+
+/* If defined, is a C expression that produces the machine-specific
+ code for a call to '__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 '__builtin_saveregs'. */
+
+#define EXPAND_BUILTIN_SAVEREGS \
+ xtensa_builtin_saveregs
+
+/* Implement `va_start' for varargs and stdarg. */
+#define EXPAND_BUILTIN_VA_START(stdarg, valist, nextarg) \
+ xtensa_va_start (stdarg, valist, nextarg)
+
+/* Implement `va_arg'. */
+#define EXPAND_BUILTIN_VA_ARG(valist, type) \
+ xtensa_va_arg (valist, type)
+
+/* If defined, a C expression that produces the machine-specific code
+ to setup the stack so that arbitrary frames can be accessed.
+
+ On Xtensa, a stack back-trace must always begin from the stack pointer,
+ so that the register overflow save area can be located. However, the
+ stack-walking code in GCC always begins from the hard_frame_pointer
+ register, not the stack pointer. The frame pointer is usually equal
+ to the stack pointer, but the __builtin_return_address and
+ __builtin_frame_address functions will not work if count > 0 and
+ they are called from a routine that uses alloca. These functions
+ are not guaranteed to work at all if count > 0 so maybe that is OK.
+
+ A nicer solution would be to allow the architecture-specific files to
+ specify whether to start from the stack pointer or frame pointer. That
+ would also allow us to skip the machine->accesses_prev_frame stuff that
+ we currently need to ensure that there is a frame pointer when these
+ builtin functions are used. */
+
+#define SETUP_FRAME_ADDRESSES() \
+ xtensa_setup_frame_addresses ()
+
+/* 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 FRAMEADDR is an RTL expression for the address of the
+ stack frame itself.
+
+ For Xtensa, there is no easy way to get the frame pointer if it is
+ not equivalent to the stack pointer. Moreover, the result of this
+ macro is used for continuing to walk back up the stack, so it must
+ return the stack pointer address. Thus, there is some inconsistency
+ here in that __builtin_frame_address will return the frame pointer
+ when count == 0 and the stack pointer when count > 0. */
+
+#define DYNAMIC_CHAIN_ADDRESS(frame) \
+ gen_rtx (PLUS, Pmode, frame, \
+ gen_rtx_CONST_INT (VOIDmode, -3 * UNITS_PER_WORD))
+
+/* Define this if the return address of a particular stack frame is
+ accessed from the frame pointer of the previous stack frame. */
+
+#define RETURN_ADDR_IN_PREVIOUS_FRAME
+
+/* 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 2 most-significant bits of the return address on Xtensa hold
+ the register window size. To get the real return address, these bits
+ must be masked off and replaced with the high bits from the current
+ PC. Since it is unclear how the __builtin_return_address function
+ is used, the current code does not do this masking and simply returns
+ the raw return address from the a0 register. */
+
+#define RETURN_ADDR_RTX(count, frame) \
+ ((count) == -1 \
+ ? gen_rtx_REG (Pmode, 0) \
+ : gen_rtx_MEM (Pmode, memory_address \
+ (Pmode, plus_constant (frame, -4 * UNITS_PER_WORD))))
+
+/* Addressing modes, and classification of registers for them. */
+
+/* C expressions which are nonzero if register number NUM is suitable
+ for use as a base or 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. */
+
+#define REGNO_OK_FOR_BASE_P(NUM) \
+ (GP_REG_P (NUM) || GP_REG_P ((unsigned) reg_renumber[NUM]))
+
+#define REGNO_OK_FOR_INDEX_P(NUM) 0
+
+/* C expressions that are nonzero if X (assumed to be a `reg' RTX) is
+ valid for use as a base or index 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'. This usually requires two
+ variant definitions, of which `REG_OK_STRICT' controls the one
+ actually used. The difference between an index register and a base
+ register is that the index register may be scaled. */
+
+#ifdef REG_OK_STRICT
+
+#define REG_OK_FOR_INDEX_P(X) 0
+#define REG_OK_FOR_BASE_P(X) \
+ REGNO_OK_FOR_BASE_P (REGNO (X))
+
+#else /* !REG_OK_STRICT */
+
+#define REG_OK_FOR_INDEX_P(X) 0
+#define REG_OK_FOR_BASE_P(X) \
+ ((REGNO (X) >= FIRST_PSEUDO_REGISTER) || (GP_REG_P (REGNO (X))))
+
+#endif /* !REG_OK_STRICT */
+
+/* Maximum number of registers that can appear in a valid memory address. */
+
+#define MAX_REGS_PER_ADDRESS 1
+
+/* 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.
+
+ 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.
+
+ 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'. */
+
+#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR) \
+ do { \
+ rtx xinsn = (X); \
+ \
+ /* allow constant pool addresses */ \
+ if ((MODE) != BLKmode && GET_MODE_SIZE (MODE) >= UNITS_PER_WORD \
+ && constantpool_address_p (xinsn)) \
+ goto ADDR; \
+ \
+ while (GET_CODE (xinsn) == SUBREG) \
+ xinsn = SUBREG_REG (xinsn); \
+ \
+ /* allow base registers */ \
+ if (GET_CODE (xinsn) == REG && REG_OK_FOR_BASE_P (xinsn)) \
+ goto ADDR; \
+ \
+ /* check for "register + offset" addressing */ \
+ if (GET_CODE (xinsn) == PLUS) \
+ { \
+ rtx xplus0 = XEXP (xinsn, 0); \
+ rtx xplus1 = XEXP (xinsn, 1); \
+ enum rtx_code code0; \
+ enum rtx_code code1; \
+ \
+ while (GET_CODE (xplus0) == SUBREG) \
+ xplus0 = SUBREG_REG (xplus0); \
+ code0 = GET_CODE (xplus0); \
+ \
+ while (GET_CODE (xplus1) == SUBREG) \
+ xplus1 = SUBREG_REG (xplus1); \
+ code1 = GET_CODE (xplus1); \
+ \
+ /* swap operands if necessary so the register is first */ \
+ if (code0 != REG && code1 == REG) \
+ { \
+ xplus0 = XEXP (xinsn, 1); \
+ xplus1 = XEXP (xinsn, 0); \
+ code0 = GET_CODE (xplus0); \
+ code1 = GET_CODE (xplus1); \
+ } \
+ \
+ if (code0 == REG && REG_OK_FOR_BASE_P (xplus0) \
+ && code1 == CONST_INT \
+ && xtensa_mem_offset (INTVAL (xplus1), (MODE))) \
+ { \
+ goto ADDR; \
+ } \
+ } \
+ } while (0)
+
+/* A C expression that is 1 if the RTX X is a constant which is a
+ valid address. This is defined to be the same as 'CONSTANT_P (X)',
+ but rejecting CONST_DOUBLE. */
+
+#define CONSTANT_ADDRESS_P(X) \
+ ((GET_CODE (X) == LABEL_REF || GET_CODE (X) == SYMBOL_REF \
+ || GET_CODE (X) == CONST_INT || GET_CODE (X) == HIGH \
+ || (GET_CODE (X) == CONST)))
+
+/* Nonzero if the constant value X is a legitimate general operand.
+ It is given that X satisfies CONSTANT_P or is a CONST_DOUBLE. */
+
+#define LEGITIMATE_CONSTANT_P(X) 1
+
+/* A C expression that is nonzero if X is a legitimate immediate
+ operand on the target machine when generating position independent
+ code. */
+
+#define LEGITIMATE_PIC_OPERAND_P(X) \
+ ((GET_CODE (X) != SYMBOL_REF || SYMBOL_REF_FLAG (X)) \
+ && GET_CODE (X) != LABEL_REF \
+ && GET_CODE (X) != CONST)
+
+/* 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 xinsn = (X); \
+ if (GET_CODE (xinsn) == PLUS) \
+ { \
+ rtx plus0 = XEXP (xinsn, 0); \
+ rtx plus1 = XEXP (xinsn, 1); \
+ \
+ if (GET_CODE (plus0) != REG && GET_CODE (plus1) == REG) \
+ { \
+ plus0 = XEXP (xinsn, 1); \
+ plus1 = XEXP (xinsn, 0); \
+ } \
+ \
+ if (GET_CODE (plus0) == REG \
+ && GET_CODE (plus1) == CONST_INT \
+ && !xtensa_mem_offset (INTVAL (plus1), MODE) \
+ && !xtensa_simm8 (INTVAL (plus1)) \
+ && xtensa_mem_offset (INTVAL (plus1) & 0xff, MODE) \
+ && xtensa_simm8x256 (INTVAL (plus1) & ~0xff)) \
+ { \
+ rtx temp = gen_reg_rtx (Pmode); \
+ emit_insn (gen_rtx (SET, Pmode, temp, \
+ gen_rtx (PLUS, Pmode, plus0, \
+ GEN_INT (INTVAL (plus1) & ~0xff)))); \
+ (X) = gen_rtx (PLUS, Pmode, temp, \
+ GEN_INT (INTVAL (plus1) & 0xff)); \
+ goto WIN; \
+ } \
+ } \
+ } 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.
+
+ 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 GO_IF_MODE_DEPENDENT_ADDRESS(ADDR, LABEL) {}
+
+/* If we are referencing a function that is static, make the SYMBOL_REF
+ special so that we can generate direct calls to it even with -fpic. */
+
+#define ENCODE_SECTION_INFO(DECL) \
+ do { \
+ if (TREE_CODE (DECL) == FUNCTION_DECL && ! TREE_PUBLIC (DECL)) \
+ SYMBOL_REF_FLAG (XEXP (DECL_RTL (DECL), 0)) = 1; \
+ } while (0)
+
+/* Specify the machine mode that this machine uses
+ for the index in the tablejump instruction. */
+#define CASE_VECTOR_MODE (SImode)
+
+/* Define this if the tablejump instruction expects the table
+ to contain offsets from the address of the table.
+ Do not define this if the table should contain absolute addresses. */
+/* #define CASE_VECTOR_PC_RELATIVE */
+
+/* Specify the tree operation to be used to convert reals to integers. */
+#define IMPLICIT_FIX_EXPR FIX_ROUND_EXPR
+
+/* This is the kind of divide that is easiest to do in the general case. */
+#define EASY_DIV_EXPR TRUNC_DIV_EXPR
+
+/* Define this as 1 if 'char' should by default be signed; else as 0. */
+#ifndef DEFAULT_SIGNED_CHAR
+#define DEFAULT_SIGNED_CHAR 0
+#endif
+
+/* Max number of bytes we can move from memory to memory
+ in one reasonably fast instruction. */
+#define MOVE_MAX 4
+#define MAX_MOVE_MAX 4
+
+/* 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.
+
+ On RISC machines, it tends to generate better code to define
+ this as 1, since it avoids making a QI or HI mode register. */
+#define SLOW_BYTE_ACCESS 1
+
+/* Xtensa doesn't have any instructions that set integer values based on the
+ results of comparisons, but the simplification code in the combiner also
+ uses this macro. The value should be either 1 or -1 to enable some
+ optimizations in the combiner; I'm not sure which is better for us. */
+#define STORE_FLAG_VALUE 1
+
+/* Define this if zero-extension is slow (more than one real instruction). */
+#define SLOW_ZERO_EXTEND
+
+/* Define this to be nonzero if shift instructions ignore all but the low-order
+ few bits. */
+#define SHIFT_COUNT_TRUNCATED 1
+
+/* Value is 1 if truncating an integer of INPREC bits to OUTPREC bits
+ is done just by pretending it is already truncated. */
+
+#define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1
+
+/* Specify the machine mode that pointers have.
+ After generation of rtl, the compiler makes no further distinction
+ between pointers and any other objects of this machine mode. */
+
+#define Pmode SImode
+
+/* A function address in a call instruction
+ is a word address (for indexing purposes)
+ so give the MEM rtx a words's mode. */
+
+#define FUNCTION_MODE SImode
+
+/* A C expression that evaluates to true if it is ok to perform a
+ sibling call to DECL.
+
+ It is not uncommon for limitations of calling conventions to
+ prevent tail calls to functions outside the current unit of
+ translation, or during PIC compilation. Use this macro to enforce
+ these restrictions, as the `sibcall' md pattern can not fail, or
+ fall over to a "normal" call. */
+
+/* TODO: fix this up to allow at least some sibcalls */
+#define FUNCTION_OK_FOR_SIBCALL(DECL) 0
+
+/* A part of a C 'switch' statement that describes the relative
+ costs of constant RTL expressions. It must contain 'case'
+ labels for expression codes 'const_int', 'const', 'symbol_ref',
+ 'label_ref' and 'const_double'. Each case must ultimately reach
+ a 'return' statement to return the relative cost of the use of
+ that kind of constant value in an expression. The cost may
+ depend on the precise value of the constant, which is available
+ for examination in X.
+
+ CODE is the expression code--redundant, since it can be obtained
+ with 'GET_CODE (X)'. */
+
+#define CONST_COSTS(X, CODE, OUTER_CODE) \
+ case CONST_INT: \
+ switch (OUTER_CODE) \
+ { \
+ case SET: \
+ if (xtensa_simm12b (INTVAL (X))) return 4; \
+ break; \
+ case PLUS: \
+ if (xtensa_simm8 (INTVAL (X))) return 0; \
+ if (xtensa_simm8x256 (INTVAL (X))) return 0; \
+ break; \
+ case AND: \
+ if (xtensa_mask_immediate (INTVAL (X))) return 0; \
+ break; \
+ case COMPARE: \
+ if ((INTVAL (X) == 0) || xtensa_b4const (INTVAL (X))) return 0; \
+ break; \
+ case ASHIFT: \
+ case ASHIFTRT: \
+ case LSHIFTRT: \
+ case ROTATE: \
+ case ROTATERT: \
+ /* no way to tell if X is the 2nd operand so be conservative */ \
+ default: break; \
+ } \
+ if (xtensa_simm12b (INTVAL (X))) return 5; \
+ return 6; \
+ case CONST: \
+ case LABEL_REF: \
+ case SYMBOL_REF: \
+ return 5; \
+ case CONST_DOUBLE: \
+ return 7;
+
+
+/* Like 'CONST_COSTS' but applies to nonconstant RTL expressions.
+ This can be used, for example, to indicate how costly a multiply
+ instruction is. In writing this macro, you can use the construct
+ 'COSTS_N_INSNS (N)' to specify a cost equal to N fast instructions.
+
+ This macro is optional; do not define it if the default cost
+ assumptions are adequate for the target machine. */
+
+#define RTX_COSTS(X, CODE, OUTER_CODE) \
+ case MEM: \
+ { \
+ int num_words = \
+ (GET_MODE_SIZE (GET_MODE (X)) > UNITS_PER_WORD) ? 2 : 1; \
+ if (memory_address_p (GET_MODE (X), XEXP ((X), 0))) \
+ return COSTS_N_INSNS (num_words); \
+ \
+ return COSTS_N_INSNS (2*num_words); \
+ } \
+ \
+ case FFS: \
+ return COSTS_N_INSNS (TARGET_NSA ? 5 : 50); \
+ \
+ case NOT: \
+ return COSTS_N_INSNS ((GET_MODE (X) == DImode) ? 3 : 2); \
+ \
+ case AND: \
+ case IOR: \
+ case XOR: \
+ if (GET_MODE (X) == DImode) return COSTS_N_INSNS (2); \
+ return COSTS_N_INSNS (1); \
+ \
+ case ASHIFT: \
+ case ASHIFTRT: \
+ case LSHIFTRT: \
+ if (GET_MODE (X) == DImode) return COSTS_N_INSNS (50); \
+ return COSTS_N_INSNS (1); \
+ \
+ case ABS: \
+ { \
+ enum machine_mode xmode = GET_MODE (X); \
+ if (xmode == SFmode) \
+ return COSTS_N_INSNS (TARGET_HARD_FLOAT ? 1 : 50); \
+ if (xmode == DFmode) \
+ return COSTS_N_INSNS (50); \
+ return COSTS_N_INSNS (4); \
+ } \
+ \
+ case PLUS: \
+ case MINUS: \
+ { \
+ enum machine_mode xmode = GET_MODE (X); \
+ if (xmode == SFmode) \
+ return COSTS_N_INSNS (TARGET_HARD_FLOAT ? 1 : 50); \
+ if (xmode == DFmode || xmode == DImode) \
+ return COSTS_N_INSNS (50); \
+ return COSTS_N_INSNS (1); \
+ } \
+ \
+ case NEG: \
+ return COSTS_N_INSNS ((GET_MODE (X) == DImode) ? 4 : 2); \
+ \
+ case MULT: \
+ { \
+ enum machine_mode xmode = GET_MODE (X); \
+ if (xmode == SFmode) \
+ return COSTS_N_INSNS (TARGET_HARD_FLOAT ? 4 : 50); \
+ if (xmode == DFmode || xmode == DImode) \
+ return COSTS_N_INSNS (50); \
+ if (TARGET_MUL32) \
+ return COSTS_N_INSNS (4); \
+ if (TARGET_MAC16) \
+ return COSTS_N_INSNS (16); \
+ if (TARGET_MUL16) \
+ return COSTS_N_INSNS (12); \
+ return COSTS_N_INSNS (50); \
+ } \
+ \
+ case DIV: \
+ case MOD: \
+ { \
+ enum machine_mode xmode = GET_MODE (X); \
+ if (xmode == SFmode) \
+ return COSTS_N_INSNS (TARGET_HARD_FLOAT_DIV ? 8 : 50); \
+ if (xmode == DFmode) \
+ return COSTS_N_INSNS (50); \
+ } \
+ /* fall through */ \
+ \
+ case UDIV: \
+ case UMOD: \
+ { \
+ enum machine_mode xmode = GET_MODE (X); \
+ if (xmode == DImode) \
+ return COSTS_N_INSNS (50); \
+ if (TARGET_DIV32) \
+ return COSTS_N_INSNS (32); \
+ return COSTS_N_INSNS (50); \
+ } \
+ \
+ case SQRT: \
+ if (GET_MODE (X) == SFmode) \
+ return COSTS_N_INSNS (TARGET_HARD_FLOAT_SQRT ? 8 : 50); \
+ return COSTS_N_INSNS (50); \
+ \
+ case SMIN: \
+ case UMIN: \
+ case SMAX: \
+ case UMAX: \
+ return COSTS_N_INSNS (TARGET_MINMAX ? 1 : 50); \
+ \
+ case SIGN_EXTRACT: \
+ case SIGN_EXTEND: \
+ return COSTS_N_INSNS (TARGET_SEXT ? 1 : 2); \
+ \
+ case ZERO_EXTRACT: \
+ case ZERO_EXTEND: \
+ return COSTS_N_INSNS (1);
+
+
+/* An expression giving the cost of an addressing mode that
+ contains ADDRESS. If not defined, the cost is computed from the
+ form of the ADDRESS expression and the 'CONST_COSTS' values.
+ This macro will normally either not be defined or be defined as
+ a constant. */
+
+#define ADDRESS_COST(ADDR) 1
+
+
+/* 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. */
+
+#define REGISTER_MOVE_COST(MODE, FROM, TO) \
+ (((FROM) == (TO) && (FROM) != BR_REGS && (TO) != BR_REGS) \
+ ? 2 \
+ : (reg_class_subset_p ((FROM), AR_REGS) \
+ && reg_class_subset_p ((TO), AR_REGS) \
+ ? 2 \
+ : (reg_class_subset_p ((FROM), AR_REGS) \
+ && (TO) == ACC_REG \
+ ? 3 \
+ : ((FROM) == ACC_REG \
+ && reg_class_subset_p ((TO), AR_REGS) \
+ ? 3 \
+ : 10))))
+
+#define MEMORY_MOVE_COST(MODE, CLASS, IN) 4
+
+#define BRANCH_COST 3
+
+/* Optionally define this if you have added predicates to
+ '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 predicate and the second field is an array of rtl
+ codes. For each predicate, list all rtl codes that can be in
+ expressions matched by the predicate. The list should have a
+ trailing comma. */
+
+#define PREDICATE_CODES \
+ {"add_operand", { REG, CONST_INT, SUBREG }}, \
+ {"arith_operand", { REG, CONST_INT, SUBREG }}, \
+ {"nonimmed_operand", { REG, SUBREG, MEM }}, \
+ {"non_acc_reg_operand", { REG, SUBREG }}, \
+ {"mem_operand", { MEM }}, \
+ {"mask_operand", { REG, CONST_INT, SUBREG }}, \
+ {"extui_fldsz_operand", { CONST_INT }}, \
+ {"sext_fldsz_operand", { CONST_INT }}, \
+ {"lsbitnum_operand", { CONST_INT }}, \
+ {"fpmem_offset_operand", { CONST_INT }}, \
+ {"sext_operand", { REG, SUBREG, MEM }}, \
+ {"branch_operand", { REG, CONST_INT, SUBREG }}, \
+ {"ubranch_operand", { REG, CONST_INT, SUBREG }}, \
+ {"call_insn_operand", { CONST_INT, CONST, SYMBOL_REF, REG }}, \
+ {"move_operand", { REG, SUBREG, MEM, CONST_INT, CONST_DOUBLE, \
+ CONST, SYMBOL_REF, LABEL_REF }}, \
+ {"non_const_move_operand", { REG, SUBREG, MEM }}, \
+ {"const_float_1_operand", { CONST_DOUBLE }}, \
+ {"branch_operator", { EQ, NE, LT, GE }}, \
+ {"ubranch_operator", { LTU, GEU }}, \
+ {"boolean_operator", { EQ, NE }},
+
+/* Control the assembler format that we output. */
+
+/* How to refer to registers in assembler output.
+ This sequence is indexed by compiler's hard-register-number (see above).
+
+ In order to support the two different conventions for register names,
+ we use the name of a table set up in xtensa.c, which is overwritten
+ if -mrnames is used. */
+
+#define REGISTER_NAMES \
+{ \
+ &xtensa_reg_names[0][0], \
+ &xtensa_reg_names[1][0], \
+ &xtensa_reg_names[2][0], \
+ &xtensa_reg_names[3][0], \
+ &xtensa_reg_names[4][0], \
+ &xtensa_reg_names[5][0], \
+ &xtensa_reg_names[6][0], \
+ &xtensa_reg_names[7][0], \
+ &xtensa_reg_names[8][0], \
+ &xtensa_reg_names[9][0], \
+ &xtensa_reg_names[10][0], \
+ &xtensa_reg_names[11][0], \
+ &xtensa_reg_names[12][0], \
+ &xtensa_reg_names[13][0], \
+ &xtensa_reg_names[14][0], \
+ &xtensa_reg_names[15][0], \
+ &xtensa_reg_names[16][0], \
+ &xtensa_reg_names[17][0], \
+ &xtensa_reg_names[18][0], \
+ &xtensa_reg_names[19][0], \
+ &xtensa_reg_names[20][0], \
+ &xtensa_reg_names[21][0], \
+ &xtensa_reg_names[22][0], \
+ &xtensa_reg_names[23][0], \
+ &xtensa_reg_names[24][0], \
+ &xtensa_reg_names[25][0], \
+ &xtensa_reg_names[26][0], \
+ &xtensa_reg_names[27][0], \
+ &xtensa_reg_names[28][0], \
+ &xtensa_reg_names[29][0], \
+ &xtensa_reg_names[30][0], \
+ &xtensa_reg_names[31][0], \
+ &xtensa_reg_names[32][0], \
+ &xtensa_reg_names[33][0], \
+ &xtensa_reg_names[34][0], \
+ &xtensa_reg_names[35][0] \
+}
+
+/* print-rtl.c can't use REGISTER_NAMES, since it depends on xtensa.c.
+ So define this for it. */
+#define DEBUG_REGISTER_NAMES \
+{ \
+ "a0", "sp", "a2", "a3", "a4", "a5", "a6", "a7", \
+ "a8", "a9", "a10", "a11", "a12", "a13", "a14", "a15", \
+ "fp", "argp", "b0", \
+ "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", \
+ "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15", \
+ "acc", \
+}
+
+/* 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 'asm'
+ option in declarations to refer to registers using alternate
+ names.
+
+ We define both names for the integer registers here. */
+
+#define ADDITIONAL_REGISTER_NAMES \
+{ \
+ { "a0", 0 + GP_REG_FIRST }, \
+ { "a1", 1 + GP_REG_FIRST }, \
+ { "a2", 2 + GP_REG_FIRST }, \
+ { "a3", 3 + GP_REG_FIRST }, \
+ { "a4", 4 + GP_REG_FIRST }, \
+ { "a5", 5 + GP_REG_FIRST }, \
+ { "a6", 6 + GP_REG_FIRST }, \
+ { "a7", 7 + GP_REG_FIRST }, \
+ { "a8", 8 + GP_REG_FIRST }, \
+ { "a9", 9 + GP_REG_FIRST }, \
+ { "a10", 10 + GP_REG_FIRST }, \
+ { "a11", 11 + GP_REG_FIRST }, \
+ { "a12", 12 + GP_REG_FIRST }, \
+ { "a13", 13 + GP_REG_FIRST }, \
+ { "a14", 14 + GP_REG_FIRST }, \
+ { "a15", 15 + GP_REG_FIRST }, \
+ { "sp", 1 + GP_REG_FIRST }, \
+ { "b0", 0 + BR_REG_FIRST }, \
+ { "f0", 0 + FP_REG_FIRST }, \
+ { "f1", 1 + FP_REG_FIRST }, \
+ { "f2", 2 + FP_REG_FIRST }, \
+ { "f3", 3 + FP_REG_FIRST }, \
+ { "f4", 4 + FP_REG_FIRST }, \
+ { "f5", 5 + FP_REG_FIRST }, \
+ { "f6", 6 + FP_REG_FIRST }, \
+ { "f7", 7 + FP_REG_FIRST }, \
+ { "f8", 8 + FP_REG_FIRST }, \
+ { "f9", 9 + FP_REG_FIRST }, \
+ { "f10", 10 + FP_REG_FIRST }, \
+ { "f11", 11 + FP_REG_FIRST }, \
+ { "f12", 12 + FP_REG_FIRST }, \
+ { "f13", 13 + FP_REG_FIRST }, \
+ { "f14", 14 + FP_REG_FIRST }, \
+ { "f15", 15 + FP_REG_FIRST }, \
+ { "acc", 0 + ACC_REG_FIRST }, \
+}
+
+/* Define results of standard character escape sequences. */
+#define TARGET_BELL 007
+#define TARGET_BS 010
+#define TARGET_TAB 011
+#define TARGET_NEWLINE 012
+#define TARGET_VT 013
+#define TARGET_FF 014
+#define TARGET_CR 015
+
+
+/* A C compound statement to output to stdio stream STREAM the
+ assembler syntax for an instruction operand X. */
+
+#define PRINT_OPERAND(FILE, X, CODE) print_operand (FILE, X, CODE)
+
+
+/* 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 ADDR. */
+
+#define PRINT_OPERAND_ADDRESS(FILE, ADDR) print_operand_address (FILE, ADDR)
+
+
+/* Recognize machine-specific patterns that may appear within
+ constants. Used for PIC-specific UNSPECs. */
+
+#define OUTPUT_ADDR_CONST_EXTRA(STREAM, X, FAIL) \
+ do { \
+ if (flag_pic && GET_CODE (X) == UNSPEC && XVECLEN ((X), 0) == 1) \
+ { \
+ switch (XINT ((X), 1)) \
+ { \
+ case UNSPEC_PLT: \
+ output_addr_const ((STREAM), XVECEXP ((X), 0, 0)); \
+ fputs ("@PLT", (STREAM)); \
+ break; \
+ default: \
+ goto FAIL; \
+ } \
+ break; \
+ } \
+ else \
+ goto FAIL; \
+ } while (0)
+
+
+/* This is how to output the definition of a user-level label named NAME,
+ such as the label on a static function or variable NAME. */
+
+#define ASM_OUTPUT_LABEL(STREAM, NAME) \
+ do { \
+ assemble_name (STREAM, NAME); \
+ fputs (":\n", STREAM); \
+ } while (0)
+
+
+/* This is how to output a command to make the user-level label named NAME
+ defined for reference from other files. */
+
+#define ASM_GLOBALIZE_LABEL(STREAM, NAME) \
+ do { \
+ fputs ("\t.global\t", STREAM); \
+ assemble_name (STREAM, NAME); \
+ fputs ("\n", STREAM); \
+ } while (0)
+
+
+/* This says how to define a global common symbol. */
+
+#define ASM_OUTPUT_COMMON(STREAM, NAME, SIZE, ROUNDED) \
+ xtensa_declare_object (STREAM, NAME, "\n\t.comm\t", ",%u\n", (SIZE))
+
+
+/* This says how to define a local common symbol (ie, not visible to
+ linker). */
+
+#define ASM_OUTPUT_LOCAL(STREAM, NAME, SIZE, ROUNDED) \
+ xtensa_declare_object (STREAM, NAME, "\n\t.lcomm\t", ",%u\n", (SIZE))
+
+
+/* This is how to output an assembler line defining a 'double' constant. */
+
+#define ASM_OUTPUT_DOUBLE(STREAM, VALUE) \
+ do { \
+ long value_long[2]; \
+ REAL_VALUE_TO_TARGET_DOUBLE ((VALUE), value_long); \
+ fprintf (STREAM, "\t.word\t0x%08lx\t\t# %.20g\n", \
+ value_long[0], (VALUE)); \
+ fprintf (STREAM, "\t.word\t0x%08lx\n", value_long[1]); \
+ } while (0)
+
+
+/* This is how to output an assembler line defining a 'float' constant. */
+
+#define ASM_OUTPUT_FLOAT(STREAM, VALUE) \
+ do { \
+ long value_long; \
+ REAL_VALUE_TO_TARGET_SINGLE ((VALUE), value_long); \
+ fprintf (STREAM, "\t.word\t0x%08lx\t\t# %.12g (float)\n", \
+ value_long, (VALUE)); \
+ } while (0)
+
+
+/* This is how to output an assembler line defining an 'int' constant. */
+
+#define ASM_OUTPUT_INT(STREAM, VALUE) \
+ do { \
+ fprintf (STREAM, "\t.word\t"); \
+ output_addr_const (STREAM, (VALUE)); \
+ fprintf (STREAM, "\n"); \
+ } while (0)
+
+#define ASM_OUTPUT_SHORT(STREAM, VALUE) \
+ do { \
+ fprintf (STREAM, "\t.short\t"); \
+ output_addr_const (STREAM, (VALUE)); \
+ fprintf (STREAM, "\n"); \
+ } while (0)
+
+#define ASM_OUTPUT_CHAR(STREAM, VALUE) \
+ do { \
+ fprintf (STREAM, "\t.byte\t"); \
+ output_addr_const (STREAM, (VALUE)); \
+ fprintf (STREAM, "\n"); \
+ } while (0)
+
+
+/* This is how to output an assembler line for a numeric constant byte. */
+
+#define ASM_OUTPUT_BYTE(STREAM, VALUE) \
+ fprintf (STREAM, "\t.byte\t0x%x\n", (VALUE))
+
+
+/* This is how to output an element of a case-vector that is absolute. */
+
+#define ASM_OUTPUT_ADDR_VEC_ELT(STREAM, VALUE) \
+ fprintf (STREAM, "\t.word\t%sL%u\n", LOCAL_LABEL_PREFIX, VALUE)
+
+
+/* This is how to output an element of a case-vector that is relative.
+ This is used for pc-relative code. */
+
+#define ASM_OUTPUT_ADDR_DIFF_ELT(STREAM, BODY, VALUE, REL) \
+ do { \
+ fprintf (STREAM, "\t.word\t%sL%u-%sL%u\n", \
+ LOCAL_LABEL_PREFIX, (VALUE), \
+ LOCAL_LABEL_PREFIX, (REL)); \
+ } while (0)
+
+
+/* This is how to output an assembler line that says to advance the
+ location counter to a multiple of 2**LOG bytes. */
+
+#define ASM_OUTPUT_ALIGN(STREAM, LOG) \
+ do { \
+ if ((LOG) != 0) \
+ fprintf (STREAM, "\t.align\t%d\n", 1 << (LOG)); \
+ } while (0)
+
+
+/* Indicate that jump tables go in the text section. This is
+ necessary when compiling PIC code. */
+
+#define JUMP_TABLES_IN_TEXT_SECTION (flag_pic)
+
+
+/* Define this macro for the rare case where the RTL needs some sort of
+ machine-dependent fixup immediately before register allocation is done.
+
+ If the stack frame size is too big to fit in the immediate field of
+ the ENTRY instruction, we need to store the frame size in the
+ constant pool. However, the code in xtensa_function_prologue runs too
+ late to be able to add anything to the constant pool. Since the
+ final frame size isn't known until reload is complete, this seems
+ like the best place to do it.
+
+ There may also be some fixup required if there is an incoming argument
+ in a7 and the function requires a frame pointer. */
+
+#define MACHINE_DEPENDENT_REORG(INSN) xtensa_reorg (INSN)
+
+
+/* This macro controls the order that induction variables are combined.
+ In some cases, the strength reduction optimization pass can produce
+ better code if this is defined. This macro is particularly useful if
+ the target has limited addressing modes. For instance, the SH target
+ has only positive offsets in addresses. Thus sorting to put the
+ smallest address first allows the most combinations to be found.
+
+ Since the Xtensa architecture lacks negative address offsets,
+ the givs should be sorted smallest to largest so combine_givs
+ has maximum opportunity to combine givs. */
+
+#define GIV_SORT_CRITERION(X, Y) \
+ do { \
+ if (GET_CODE ((X)->add_val) == CONST_INT \
+ && GET_CODE ((Y)->add_val) == CONST_INT) \
+ return INTVAL ((X)->add_val) - INTVAL ((Y)->add_val); \
+ } while (0)
+
+
+/* A C statement or statements to switch to the appropriate section
+ for output of RTX in mode MODE. You can assume that RTX is some
+ kind of constant in RTL. The argument MODE is redundant except in
+ the case of a 'const_int' rtx. Select the section by calling
+ 'text_section' or one of the alternatives for other sections.
+
+ For Xtensa's constant pools, we use the ".literal" directive,
+ and we don't switch sections at all. */
+
+#undef SELECT_RTX_SECTION
+#define SELECT_RTX_SECTION(MODE, RTX)
+
+/* Define the strings to put out for each section in the object file. */
+#define TEXT_SECTION_ASM_OP "\t.text" /* instructions */
+#define DATA_SECTION_ASM_OP "\t.data" /* large data */
+
+
+/* Define output to appear before the constant pool. If the function
+ has been assigned to a specific ELF section, or if it goes into a
+ unique section, set the name of that section to be the literal
+ prefix. */
+
+#define ASM_OUTPUT_POOL_PROLOGUE(FILE, FUNNAME, FUNDECL, SIZE) \
+ do { \
+ tree fnsection; \
+ if ((flag_function_sections \
+ && DECL_SECTION_NAME (FUNDECL) == NULL_TREE) \
+ || UNIQUE_SECTION_P (FUNDECL)) \
+ UNIQUE_SECTION (FUNDECL, 0); \
+ fnsection = DECL_SECTION_NAME (FUNDECL); \
+ if (fnsection != NULL_TREE) \
+ { \
+ const char *fnsectname = TREE_STRING_POINTER (fnsection); \
+ fprintf (FILE, "\t.begin\tliteral_prefix %s\n", \
+ strcmp (fnsectname, ".text") ? fnsectname : ""); \
+ } \
+ if ((SIZE) > 0) \
+ function_section (FUNDECL); \
+ } while (0)
+
+
+/* Define code to write out the ".end literal_prefix" directive for a
+ function in a special section. This is appended to the standard ELF
+ code for ASM_DECLARE_FUNCTION_SIZE. */
+
+#define XTENSA_DECLARE_FUNCTION_SIZE(FILE, FNAME, DECL) \
+ if (DECL_SECTION_NAME (DECL) != NULL_TREE) \
+ fprintf (FILE, "\t.end\tliteral_prefix\n")
+
+
+/* A C statement (with or without semicolon) to output a constant in
+ the constant pool, if it needs special treatment. */
+
+#define ASM_OUTPUT_SPECIAL_POOL_ENTRY(FILE, X, MODE, ALIGN, LABELNO, JUMPTO) \
+ do { \
+ xtensa_output_literal (FILE, X, MODE, LABELNO); \
+ goto JUMPTO; \
+ } while (0)
+
+
+/* Store in OUTPUT a string (made with alloca) containing
+ an assembler-name for a local static variable named NAME.
+ LABELNO is an integer which is different for each call. */
+
+#define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
+ do { \
+ (OUTPUT) = (char *) alloca (strlen (NAME) + 10); \
+ sprintf ((OUTPUT), "%s.%u", (NAME), (LABELNO)); \
+ } while (0)
+
+/* Define the parentheses used to group arithmetic operations
+ in assembler code. */
+
+#define ASM_OPEN_PAREN "("
+#define ASM_CLOSE_PAREN ")"
+
+/* How to start an assembler comment. */
+#ifndef ASM_COMMENT_START
+#define ASM_COMMENT_START "#"
+#endif
+
+/* Exception handling TODO!! */
+#define DWARF_UNWIND_INFO 0
+
diff --git a/gcc/config/xtensa/xtensa.md b/gcc/config/xtensa/xtensa.md
new file mode 100644
index 00000000000..f27a92e005a
--- /dev/null
+++ b/gcc/config/xtensa/xtensa.md
@@ -0,0 +1,2415 @@
+;; GCC machine description for Tensilica's Xtensa architecture.
+;; Copyright (C) 2001 Free Software Foundation, Inc.
+;; Contributed by Bob Wilson (bwilson@tensilica.com) at Tensilica.
+
+;; This file is part of GCC.
+
+;; 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.
+
+;; 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 GCC; see the file COPYING. If not, write to the Free
+;; Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+;; 02111-1307, USA.
+
+;;
+;; ....................
+;;
+;; CONSTANTS
+;;
+;; ....................
+;;
+
+(define_constants [
+ (A0_REG 0)
+ (A7_REG 7)
+
+ (UNSPEC_NSAU 1)
+ (UNSPEC_NOP 2)
+ (UNSPEC_PLT 3)
+ (UNSPECV_SET_FP 1)
+])
+
+;;
+;; ....................
+;;
+;; ATTRIBUTES
+;;
+;; ....................
+;;
+
+(define_attr "type"
+ "unknown,branch,jump,call,load,store,move,arith,multi,nop,misc,farith,fmadd,fdiv,fsqrt,fconv,fload,fstore,mul16,mul32,div32,mac16,rsr,wsr,udef_move,udef_loadi,udef_storei,udef_loadiu,udef_storeiu,udef_conv,udef_conv_loadiu,udef_conv_storeiu"
+ (const_string "unknown"))
+
+(define_attr "mode"
+ "unknown,none,QI,HI,SI,DI,SF,DF,BL"
+ (const_string "unknown"))
+
+(define_attr "length" "" (const_int 1))
+
+;; Describe a user's asm statement.
+(define_asm_attributes
+ [(set_attr "type" "multi")])
+
+
+;;
+;; ....................
+;;
+;; FUNCTIONAL UNITS
+;;
+;; ....................
+;;
+
+(define_function_unit "memory" 1 0 (eq_attr "type" "load,fload") 2 0)
+
+(define_function_unit "sreg" 1 1 (eq_attr "type" "rsr") 2 0)
+
+(define_function_unit "mul16" 1 0 (eq_attr "type" "mul16") 2 0)
+
+(define_function_unit "mul32" 1 0 (eq_attr "type" "mul32") 2 0)
+
+(define_function_unit "fpmadd" 1 0 (eq_attr "type" "fmadd") 4 0)
+
+(define_function_unit "fpconv" 1 0 (eq_attr "type" "fconv") 2 0)
+
+
+;;
+;; ....................
+;;
+;; ADDITION
+;;
+;; ....................
+;;
+
+(define_insn "addsi3"
+ [(set (match_operand:SI 0 "register_operand" "=D,D,a,a,a")
+ (plus:SI (match_operand:SI 1 "register_operand" "%d,d,r,r,r")
+ (match_operand:SI 2 "add_operand" "d,O,r,J,N")))]
+ ""
+ "@
+ add.n\\t%0, %1, %2
+ addi.n\\t%0, %1, %d2
+ add\\t%0, %1, %2
+ addi\\t%0, %1, %d2
+ addmi\\t%0, %1, %x2"
+ [(set_attr "type" "arith,arith,arith,arith,arith")
+ (set_attr "mode" "SI")
+ (set_attr "length" "2,2,3,3,3")])
+
+(define_insn ""
+ [(set (match_operand:SI 0 "register_operand" "=a")
+ (plus:SI (mult:SI (match_operand:SI 1 "register_operand" "r")
+ (const_int 2))
+ (match_operand:SI 2 "register_operand" "r")))]
+ ""
+ "addx2\\t%0, %1, %2"
+ [(set_attr "type" "arith")
+ (set_attr "mode" "SI")
+ (set_attr "length" "3")])
+
+(define_insn ""
+ [(set (match_operand:SI 0 "register_operand" "=a")
+ (plus:SI (mult:SI (match_operand:SI 1 "register_operand" "r")
+ (const_int 4))
+ (match_operand:SI 2 "register_operand" "r")))]
+ ""
+ "addx4\\t%0, %1, %2"
+ [(set_attr "type" "arith")
+ (set_attr "mode" "SI")
+ (set_attr "length" "3")])
+
+(define_insn ""
+ [(set (match_operand:SI 0 "register_operand" "=a")
+ (plus:SI (mult:SI (match_operand:SI 1 "register_operand" "r")
+ (const_int 8))
+ (match_operand:SI 2 "register_operand" "r")))]
+ ""
+ "addx8\\t%0, %1, %2"
+ [(set_attr "type" "arith")
+ (set_attr "mode" "SI")
+ (set_attr "length" "3")])
+
+(define_insn "addsf3"
+ [(set (match_operand:SF 0 "register_operand" "=f")
+ (plus:SF (match_operand:SF 1 "register_operand" "%f")
+ (match_operand:SF 2 "register_operand" "f")))]
+ "TARGET_HARD_FLOAT"
+ "add.s\\t%0, %1, %2"
+ [(set_attr "type" "fmadd")
+ (set_attr "mode" "SF")
+ (set_attr "length" "3")])
+
+
+;;
+;; ....................
+;;
+;; SUBTRACTION
+;;
+;; ....................
+;;
+
+(define_insn "subsi3"
+ [(set (match_operand:SI 0 "register_operand" "=a")
+ (minus:SI (match_operand:SI 1 "register_operand" "r")
+ (match_operand:SI 2 "register_operand" "r")))]
+ ""
+ "sub\\t%0, %1, %2"
+ [(set_attr "type" "arith")
+ (set_attr "mode" "SI")
+ (set_attr "length" "3")])
+
+(define_insn ""
+ [(set (match_operand:SI 0 "register_operand" "=a")
+ (minus:SI (mult:SI (match_operand:SI 1 "register_operand" "r")
+ (const_int 2))
+ (match_operand:SI 2 "register_operand" "r")))]
+ ""
+ "subx2\\t%0, %1, %2"
+ [(set_attr "type" "arith")
+ (set_attr "mode" "SI")
+ (set_attr "length" "3")])
+
+(define_insn ""
+ [(set (match_operand:SI 0 "register_operand" "=a")
+ (minus:SI (mult:SI (match_operand:SI 1 "register_operand" "r")
+ (const_int 4))
+ (match_operand:SI 2 "register_operand" "r")))]
+ ""
+ "subx4\\t%0, %1, %2"
+ [(set_attr "type" "arith")
+ (set_attr "mode" "SI")
+ (set_attr "length" "3")])
+
+(define_insn ""
+ [(set (match_operand:SI 0 "register_operand" "=a")
+ (minus:SI (mult:SI (match_operand:SI 1 "register_operand" "r")
+ (const_int 8))
+ (match_operand:SI 2 "register_operand" "r")))]
+ ""
+ "subx8\\t%0, %1, %2"
+ [(set_attr "type" "arith")
+ (set_attr "mode" "SI")
+ (set_attr "length" "3")])
+
+(define_insn "subsf3"
+ [(set (match_operand:SF 0 "register_operand" "=f")
+ (minus:SF (match_operand:SF 1 "register_operand" "f")
+ (match_operand:SF 2 "register_operand" "f")))]
+ "TARGET_HARD_FLOAT"
+ "sub.s\\t%0, %1, %2"
+ [(set_attr "type" "fmadd")
+ (set_attr "mode" "SF")
+ (set_attr "length" "3")])
+
+
+;;
+;; ....................
+;;
+;; MULTIPLICATION
+;;
+;; ....................
+;;
+
+(define_insn "mulsi3"
+ [(set (match_operand:SI 0 "register_operand" "=a")
+ (mult:SI (match_operand:SI 1 "register_operand" "%r")
+ (match_operand:SI 2 "register_operand" "r")))]
+ "TARGET_MUL32"
+ "mull\\t%0, %1, %2"
+ [(set_attr "type" "mul32")
+ (set_attr "mode" "SI")
+ (set_attr "length" "3")])
+
+(define_insn "mulhisi3"
+ [(set (match_operand:SI 0 "register_operand" "=C,A")
+ (mult:SI (sign_extend:SI
+ (match_operand:HI 1 "register_operand" "%r,r"))
+ (sign_extend:SI
+ (match_operand:HI 2 "register_operand" "r,r"))))]
+ "TARGET_MUL16 || TARGET_MAC16"
+ "@
+ mul16s\\t%0, %1, %2
+ mul.aa.ll\\t%1, %2"
+ [(set_attr "type" "mul16,mac16")
+ (set_attr "mode" "SI")
+ (set_attr "length" "3,3")])
+
+(define_insn "umulhisi3"
+ [(set (match_operand:SI 0 "register_operand" "=C,A")
+ (mult:SI (zero_extend:SI
+ (match_operand:HI 1 "register_operand" "%r,r"))
+ (zero_extend:SI
+ (match_operand:HI 2 "register_operand" "r,r"))))]
+ "TARGET_MUL16 || TARGET_MAC16"
+ "@
+ mul16u\\t%0, %1, %2
+ umul.aa.ll\\t%1, %2"
+ [(set_attr "type" "mul16,mac16")
+ (set_attr "mode" "SI")
+ (set_attr "length" "3,3")])
+
+(define_insn "muladdhisi"
+ [(set (match_operand:SI 0 "register_operand" "=A")
+ (plus:SI (mult:SI (sign_extend:SI
+ (match_operand:HI 1 "register_operand" "%r"))
+ (sign_extend:SI
+ (match_operand:HI 2 "register_operand" "r")))
+ (match_operand:SI 3 "register_operand" "0")))]
+ "TARGET_MAC16"
+ "mula.aa.ll\\t%1, %2"
+ [(set_attr "type" "mac16")
+ (set_attr "mode" "SI")
+ (set_attr "length" "3")])
+
+(define_insn "mulsubhisi"
+ [(set (match_operand:SI 0 "register_operand" "=A")
+ (minus:SI (match_operand:SI 1 "register_operand" "0")
+ (mult:SI (sign_extend:SI
+ (match_operand:HI 2 "register_operand" "%r"))
+ (sign_extend:SI
+ (match_operand:HI 3 "register_operand" "r")))))]
+ "TARGET_MAC16"
+ "muls.aa.ll\\t%2, %3"
+ [(set_attr "type" "mac16")
+ (set_attr "mode" "SI")
+ (set_attr "length" "3")])
+
+(define_insn "mulsf3"
+ [(set (match_operand:SF 0 "register_operand" "=f")
+ (mult:SF (match_operand:SF 1 "register_operand" "%f")
+ (match_operand:SF 2 "register_operand" "f")))]
+ "TARGET_HARD_FLOAT"
+ "mul.s\\t%0, %1, %2"
+ [(set_attr "type" "fmadd")
+ (set_attr "mode" "SF")
+ (set_attr "length" "3")])
+
+(define_insn "muladdsf3"
+ [(set (match_operand:SF 0 "register_operand" "=f")
+ (plus:SF (mult:SF (match_operand:SF 1 "register_operand" "%f")
+ (match_operand:SF 2 "register_operand" "f"))
+ (match_operand:SF 3 "register_operand" "0")))]
+ "TARGET_HARD_FLOAT && !TARGET_NO_FUSED_MADD"
+ "madd.s\\t%0, %1, %2"
+ [(set_attr "type" "fmadd")
+ (set_attr "mode" "SF")
+ (set_attr "length" "3")])
+
+(define_insn "mulsubsf3"
+ [(set (match_operand:SF 0 "register_operand" "=f")
+ (minus:SF (match_operand:SF 1 "register_operand" "0")
+ (mult:SF (match_operand:SF 2 "register_operand" "%f")
+ (match_operand:SF 3 "register_operand" "f"))))]
+ "TARGET_HARD_FLOAT && !TARGET_NO_FUSED_MADD"
+ "msub.s\\t%0, %2, %3"
+ [(set_attr "type" "fmadd")
+ (set_attr "mode" "SF")
+ (set_attr "length" "3")])
+
+
+;;
+;; ....................
+;;
+;; DIVISION
+;;
+;; ....................
+;;
+
+(define_insn "divsi3"
+ [(set (match_operand:SI 0 "register_operand" "=a")
+ (div:SI (match_operand:SI 1 "register_operand" "r")
+ (match_operand:SI 2 "register_operand" "r")))]
+ "TARGET_DIV32"
+ "quos\\t%0, %1, %2"
+ [(set_attr "type" "div32")
+ (set_attr "mode" "SI")
+ (set_attr "length" "3")])
+
+(define_insn "udivsi3"
+ [(set (match_operand:SI 0 "register_operand" "=a")
+ (udiv:SI (match_operand:SI 1 "register_operand" "r")
+ (match_operand:SI 2 "register_operand" "r")))]
+ "TARGET_DIV32"
+ "quou\\t%0, %1, %2"
+ [(set_attr "type" "div32")
+ (set_attr "mode" "SI")
+ (set_attr "length" "3")])
+
+(define_insn "divsf3"
+ [(set (match_operand:SF 0 "register_operand" "=f")
+ (div:SF (match_operand:SF 1 "register_operand" "f")
+ (match_operand:SF 2 "register_operand" "f")))]
+ "TARGET_HARD_FLOAT_DIV"
+ "div.s\\t%0, %1, %2"
+ [(set_attr "type" "fdiv")
+ (set_attr "mode" "SF")
+ (set_attr "length" "3")])
+
+(define_insn ""
+ [(set (match_operand:SF 0 "register_operand" "=f")
+ (div:SF (match_operand:SF 1 "const_float_1_operand" "")
+ (match_operand:SF 2 "register_operand" "f")))]
+ "TARGET_HARD_FLOAT_RECIP && flag_fast_math"
+ "recip.s\\t%0, %2"
+ [(set_attr "type" "fdiv")
+ (set_attr "mode" "SF")
+ (set_attr "length" "3")])
+
+
+;;
+;; ....................
+;;
+;; REMAINDER
+;;
+;; ....................
+;;
+
+(define_insn "modsi3"
+ [(set (match_operand:SI 0 "register_operand" "=a")
+ (mod:SI (match_operand:SI 1 "register_operand" "r")
+ (match_operand:SI 2 "register_operand" "r")))]
+ "TARGET_DIV32"
+ "rems\\t%0, %1, %2"
+ [(set_attr "type" "div32")
+ (set_attr "mode" "SI")
+ (set_attr "length" "3")])
+
+(define_insn "umodsi3"
+ [(set (match_operand:SI 0 "register_operand" "=a")
+ (umod:SI (match_operand:SI 1 "register_operand" "r")
+ (match_operand:SI 2 "register_operand" "r")))]
+ "TARGET_DIV32"
+ "remu\\t%0, %1, %2"
+ [(set_attr "type" "div32")
+ (set_attr "mode" "SI")
+ (set_attr "length" "3")])
+
+
+;;
+;; ....................
+;;
+;; SQUARE ROOT
+;;
+;; ....................
+;;
+
+(define_insn "sqrtsf2"
+ [(set (match_operand:SF 0 "register_operand" "=f")
+ (sqrt:SF (match_operand:SF 1 "register_operand" "f")))]
+ "TARGET_HARD_FLOAT_SQRT"
+ "sqrt.s\\t%0, %1"
+ [(set_attr "type" "fsqrt")
+ (set_attr "mode" "SF")
+ (set_attr "length" "3")])
+
+(define_insn ""
+ [(set (match_operand:SF 0 "register_operand" "=f")
+ (div:SF (match_operand:SF 1 "const_float_1_operand" "")
+ (sqrt:SF (match_operand:SF 2 "register_operand" "f"))))]
+ "TARGET_HARD_FLOAT_RSQRT && flag_fast_math"
+ "rsqrt.s\\t%0, %2"
+ [(set_attr "type" "fsqrt")
+ (set_attr "mode" "SF")
+ (set_attr "length" "3")])
+
+
+;;
+;; ....................
+;;
+;; ABSOLUTE VALUE
+;;
+;; ....................
+;;
+
+(define_insn "abssi2"
+ [(set (match_operand:SI 0 "register_operand" "=a")
+ (abs:SI (match_operand:SI 1 "register_operand" "r")))]
+ ""
+ "abs\\t%0, %1"
+ [(set_attr "type" "arith")
+ (set_attr "mode" "SI")
+ (set_attr "length" "3")])
+
+(define_insn "abssf2"
+ [(set (match_operand:SF 0 "register_operand" "=f")
+ (abs:SF (match_operand:SF 1 "register_operand" "f")))]
+ "TARGET_HARD_FLOAT"
+ "abs.s\\t%0, %1"
+ [(set_attr "type" "farith")
+ (set_attr "mode" "SF")
+ (set_attr "length" "3")])
+
+
+;;
+;; ....................
+;;
+;; MIN AND MAX INSTRUCTIONS
+;;
+;; ....................
+;;
+
+(define_insn "sminsi3"
+ [(set (match_operand:SI 0 "register_operand" "=a")
+ (smin:SI (match_operand:SI 1 "register_operand" "%r")
+ (match_operand:SI 2 "register_operand" "r")))]
+ "TARGET_MINMAX"
+ "min\\t%0, %1, %2"
+ [(set_attr "type" "arith")
+ (set_attr "mode" "SI")
+ (set_attr "length" "3")])
+
+(define_insn "uminsi3"
+ [(set (match_operand:SI 0 "register_operand" "=a")
+ (umin:SI (match_operand:SI 1 "register_operand" "%r")
+ (match_operand:SI 2 "register_operand" "r")))]
+ "TARGET_MINMAX"
+ "minu\\t%0, %1, %2"
+ [(set_attr "type" "arith")
+ (set_attr "mode" "SI")
+ (set_attr "length" "3")])
+
+(define_insn "smaxsi3"
+ [(set (match_operand:SI 0 "register_operand" "=a")
+ (smax:SI (match_operand:SI 1 "register_operand" "%r")
+ (match_operand:SI 2 "register_operand" "r")))]
+ "TARGET_MINMAX"
+ "max\\t%0, %1, %2"
+ [(set_attr "type" "arith")
+ (set_attr "mode" "SI")
+ (set_attr "length" "3")])
+
+(define_insn "umaxsi3"
+ [(set (match_operand:SI 0 "register_operand" "=a")
+ (umax:SI (match_operand:SI 1 "register_operand" "%r")
+ (match_operand:SI 2 "register_operand" "r")))]
+ "TARGET_MINMAX"
+ "maxu\\t%0, %1, %2"
+ [(set_attr "type" "arith")
+ (set_attr "mode" "SI")
+ (set_attr "length" "3")])
+
+
+;;
+;; ....................
+;;
+;; FIND FIRST BIT INSTRUCTION
+;;
+;; ....................
+;;
+
+(define_expand "ffssi2"
+ [(set (match_operand:SI 0 "register_operand" "")
+ (ffs:SI (match_operand:SI 1 "register_operand" "")))]
+ "TARGET_NSA"
+ "
+{
+ rtx temp = gen_reg_rtx(SImode);
+ emit_insn(gen_negsi2(temp, operands[1]));
+ emit_insn(gen_andsi3(temp, temp, operands[1]));
+ emit_insn(gen_nsau(temp, temp));
+ emit_insn(gen_negsi2(temp, temp));
+ emit_insn(gen_addsi3(operands[0], temp, GEN_INT(32)));
+ DONE;
+}")
+
+;; there is no RTL operator corresponding to NSAU
+(define_insn "nsau"
+ [(set (match_operand:SI 0 "register_operand" "=a")
+ (unspec:SI [(match_operand:SI 1 "register_operand" "r")] UNSPEC_NSAU))]
+ "TARGET_NSA"
+ "nsau\\t%0, %1"
+ [(set_attr "type" "arith")
+ (set_attr "mode" "SI")
+ (set_attr "length" "3")])
+
+
+;;
+;; ....................
+;;
+;; NEGATION and ONE'S COMPLEMENT
+;;
+;; ....................
+;;
+
+(define_insn "negsi2"
+ [(set (match_operand:SI 0 "register_operand" "=a")
+ (neg:SI (match_operand:SI 1 "register_operand" "r")))]
+ ""
+ "neg\\t%0, %1"
+ [(set_attr "type" "arith")
+ (set_attr "mode" "SI")
+ (set_attr "length" "3")])
+
+(define_expand "one_cmplsi2"
+ [(set (match_operand:SI 0 "register_operand" "")
+ (not:SI (match_operand:SI 1 "register_operand" "")))]
+ ""
+ "
+{
+ rtx temp = gen_reg_rtx(SImode);
+ emit_insn(gen_movsi(temp, constm1_rtx));
+ emit_insn(gen_xorsi3(operands[0], temp, operands[1]));
+ DONE;
+}")
+
+(define_insn "negsf2"
+ [(set (match_operand:SF 0 "register_operand" "=f")
+ (neg:SF (match_operand:SF 1 "register_operand" "f")))]
+ "TARGET_HARD_FLOAT"
+ "neg.s\\t%0, %1"
+ [(set_attr "type" "farith")
+ (set_attr "mode" "SF")
+ (set_attr "length" "3")])
+
+
+;;
+;; ....................
+;;
+;; LOGICAL
+;;
+;; ....................
+;;
+
+(define_insn "andsi3"
+ [(set (match_operand:SI 0 "register_operand" "=a,a")
+ (and:SI (match_operand:SI 1 "register_operand" "%r,r")
+ (match_operand:SI 2 "mask_operand" "P,r")))]
+ ""
+ "@
+ extui\\t%0, %1, 0, %K2
+ and\\t%0, %1, %2"
+ [(set_attr "type" "arith,arith")
+ (set_attr "mode" "SI")
+ (set_attr "length" "3,3")])
+
+(define_insn "iorsi3"
+ [(set (match_operand:SI 0 "register_operand" "=a")
+ (ior:SI (match_operand:SI 1 "register_operand" "%r")
+ (match_operand:SI 2 "register_operand" "r")))]
+ ""
+ "or\\t%0, %1, %2"
+ [(set_attr "type" "arith")
+ (set_attr "mode" "SI")
+ (set_attr "length" "3")])
+
+(define_insn "xorsi3"
+ [(set (match_operand:SI 0 "register_operand" "=a")
+ (xor:SI (match_operand:SI 1 "register_operand" "%r")
+ (match_operand:SI 2 "register_operand" "r")))]
+ ""
+ "xor\\t%0, %1, %2"
+ [(set_attr "type" "arith")
+ (set_attr "mode" "SI")
+ (set_attr "length" "3")])
+
+
+;;
+;; ....................
+;;
+;; ZERO EXTENSION
+;;
+;; ....................
+;;
+
+(define_insn "zero_extendhisi2"
+ [(set (match_operand:SI 0 "register_operand" "=a,a")
+ (zero_extend:SI (match_operand:HI 1 "nonimmed_operand" "r,U")))]
+ ""
+ "@
+ extui\\t%0, %1, 0, 16
+ l16ui\\t%0, %1"
+ [(set_attr "type" "arith,load")
+ (set_attr "mode" "SI")
+ (set_attr "length" "3,3")])
+
+(define_insn "zero_extendqisi2"
+ [(set (match_operand:SI 0 "register_operand" "=a,a")
+ (zero_extend:SI (match_operand:QI 1 "nonimmed_operand" "r,U")))]
+ ""
+ "@
+ extui\\t%0, %1, 0, 8
+ l8ui\\t%0, %1"
+ [(set_attr "type" "arith,load")
+ (set_attr "mode" "SI")
+ (set_attr "length" "3,3")])
+
+
+;;
+;; ....................
+;;
+;; SIGN EXTENSION
+;;
+;; ....................
+;;
+
+(define_expand "extendhisi2"
+ [(set (match_operand:SI 0 "register_operand" "")
+ (sign_extend:SI (match_operand:HI 1 "register_operand" "")))]
+ ""
+ "
+{
+ if (sext_operand (operands[1], HImode))
+ emit_insn (gen_extendhisi2_internal (operands[0], operands[1]));
+ else
+ xtensa_extend_reg (operands[0], operands[1]);
+ DONE;
+}")
+
+(define_insn "extendhisi2_internal"
+ [(set (match_operand:SI 0 "register_operand" "=B,a")
+ (sign_extend:SI (match_operand:HI 1 "sext_operand" "r,U")))]
+ ""
+ "@
+ sext\\t%0, %1, 15
+ l16si\\t%0, %1"
+ [(set_attr "type" "arith,load")
+ (set_attr "mode" "SI")
+ (set_attr "length" "3,3")])
+
+(define_expand "extendqisi2"
+ [(set (match_operand:SI 0 "register_operand" "")
+ (sign_extend:SI (match_operand:QI 1 "register_operand" "")))]
+ ""
+ "
+{
+ if (TARGET_SEXT)
+ {
+ emit_insn (gen_extendqisi2_internal (operands[0], operands[1]));
+ DONE;
+ }
+ xtensa_extend_reg (operands[0], operands[1]);
+ DONE;
+}")
+
+(define_insn "extendqisi2_internal"
+ [(set (match_operand:SI 0 "register_operand" "=B")
+ (sign_extend:SI (match_operand:QI 1 "register_operand" "r")))]
+ "TARGET_SEXT"
+ "sext\\t%0, %1, 7"
+ [(set_attr "type" "arith")
+ (set_attr "mode" "SI")
+ (set_attr "length" "3")])
+
+
+;;
+;; ....................
+;;
+;; FIELD EXTRACT
+;;
+;; ....................
+;;
+
+(define_expand "extv"
+ [(set (match_operand:SI 0 "register_operand" "")
+ (sign_extract:SI (match_operand:SI 1 "register_operand" "")
+ (match_operand:SI 2 "const_int_operand" "")
+ (match_operand:SI 3 "const_int_operand" "")))]
+ "TARGET_SEXT"
+ "
+{
+ if (!sext_fldsz_operand (operands[2], SImode)) FAIL;
+ /* we could expand to a right shift followed by sext but that's
+ no better than the standard left and right shift sequence */
+ if (!lsbitnum_operand (operands[3], SImode)) FAIL;
+ emit_insn (gen_extv_internal (operands[0], operands[1],
+ operands[2], operands[3]));
+ DONE;
+}")
+
+(define_insn "extv_internal"
+ [(set (match_operand:SI 0 "register_operand" "=a")
+ (sign_extract:SI (match_operand:SI 1 "register_operand" "r")
+ (match_operand:SI 2 "sext_fldsz_operand" "i")
+ (match_operand:SI 3 "lsbitnum_operand" "i")))]
+ "TARGET_SEXT"
+ "*
+{
+ int fldsz = INTVAL (operands[2]);
+ operands[2] = GEN_INT (fldsz - 1);
+ return \"sext\\t%0, %1, %2\";
+}"
+ [(set_attr "type" "arith")
+ (set_attr "mode" "SI")
+ (set_attr "length" "3")])
+
+(define_expand "extzv"
+ [(set (match_operand:SI 0 "register_operand" "")
+ (zero_extract:SI (match_operand:SI 1 "register_operand" "")
+ (match_operand:SI 2 "const_int_operand" "")
+ (match_operand:SI 3 "const_int_operand" "")))]
+ ""
+ "
+{
+ if (!extui_fldsz_operand (operands[2], SImode)) FAIL;
+ emit_insn (gen_extzv_internal (operands[0], operands[1],
+ operands[2], operands[3]));
+ DONE;
+}")
+
+(define_insn "extzv_internal"
+ [(set (match_operand:SI 0 "register_operand" "=a")
+ (zero_extract:SI (match_operand:SI 1 "register_operand" "r")
+ (match_operand:SI 2 "extui_fldsz_operand" "i")
+ (match_operand:SI 3 "const_int_operand" "i")))]
+ ""
+ "*
+{
+ int shift;
+ if (BITS_BIG_ENDIAN)
+ shift = (32 - (INTVAL(operands[2]) + INTVAL(operands[3]))) & 0x1f;
+ else
+ shift = INTVAL(operands[3]) & 0x1f;
+ operands[3] = GEN_INT (shift);
+ return \"extui\\t%0, %1, %3, %2\";
+}"
+ [(set_attr "type" "arith")
+ (set_attr "mode" "SI")
+ (set_attr "length" "3")])
+
+
+;;
+;; ....................
+;;
+;; CONVERSIONS
+;;
+;; ....................
+;;
+
+(define_insn "fix_truncsfsi2"
+ [(set (match_operand:SI 0 "register_operand" "=a")
+ (fix:SI (match_operand:SF 1 "register_operand" "f")))]
+ "TARGET_HARD_FLOAT"
+ "trunc.s\\t%0, %1, 0"
+ [(set_attr "type" "fconv")
+ (set_attr "mode" "SF")
+ (set_attr "length" "3")])
+
+(define_insn "fixuns_truncsfsi2"
+ [(set (match_operand:SI 0 "register_operand" "=a")
+ (unsigned_fix:SI (match_operand:SF 1 "register_operand" "f")))]
+ "TARGET_HARD_FLOAT"
+ "utrunc.s %0, %1, 0"
+ [(set_attr "type" "fconv")
+ (set_attr "mode" "SF")
+ (set_attr "length" "3")])
+
+(define_insn "floatsisf2"
+ [(set (match_operand:SF 0 "register_operand" "=f")
+ (float:SF (match_operand:SI 1 "register_operand" "a")))]
+ "TARGET_HARD_FLOAT"
+ "float.s\\t%0, %1, 0"
+ [(set_attr "type" "fconv")
+ (set_attr "mode" "SF")
+ (set_attr "length" "3")])
+
+(define_insn "floatunssisf2"
+ [(set (match_operand:SF 0 "register_operand" "=f")
+ (unsigned_float:SF (match_operand:SI 1 "register_operand" "a")))]
+ "TARGET_HARD_FLOAT"
+ "ufloat.s %0, %1, 0"
+ [(set_attr "type" "fconv")
+ (set_attr "mode" "SF")
+ (set_attr "length" "3")])
+
+
+;;
+;; ....................
+;;
+;; DATA MOVEMENT
+;;
+;; ....................
+;;
+
+;; 64-bit Integer moves
+
+(define_expand "movdi"
+ [(set (match_operand:DI 0 "nonimmed_operand" "")
+ (match_operand:DI 1 "general_operand" ""))]
+ ""
+ "
+{
+ if (CONSTANT_P (operands[1]))
+ {
+ rtx src0, src1, dst0, dst1;
+ if ((dst0 = operand_subword (operands[0], 0, 1, DImode))
+ && (src0 = operand_subword (operands[1], 0, 1, DImode))
+ && (dst1 = operand_subword (operands[0], 1, 1, DImode))
+ && (src1 = operand_subword (operands[1], 1, 1, DImode)))
+ {
+ emit_insn (gen_movsi (dst0, src0));
+ emit_insn (gen_movsi (dst1, src1));
+ DONE;
+ }
+ else
+ /* any other constant will be loaded from memory */
+ operands[1] = force_const_mem (DImode, operands[1]);
+ }
+
+ if (!(reload_in_progress | reload_completed))
+ {
+ if (!register_operand (operands[0], DImode)
+ && !register_operand (operands[1], DImode))
+ operands[1] = force_reg (DImode, operands[1]);
+
+ if (a7_overlap_mentioned_p (operands[1]))
+ {
+ emit_insn (gen_movdi_internal (operands[0], operands[1]));
+ emit_insn (gen_set_frame_ptr ());
+ DONE;
+ }
+ }
+}")
+
+(define_insn "movdi_internal"
+ [(set (match_operand:DI 0 "nonimmed_operand" "=D,D,S,a,a,a,U")
+ (match_operand:DI 1 "non_const_move_operand" "d,S,d,r,T,U,r"))]
+ "register_operand (operands[0], DImode)
+ || register_operand (operands[1], DImode)"
+ "*
+{
+ switch (which_alternative)
+ {
+ case 0: return \"mov.n\\t%0, %1\;mov.n\\t%D0, %D1\";
+ case 2: return \"%v0s32i.n\\t%1, %0\;s32i.n\\t%D1, %N0\";
+ case 3: return \"mov\\t%0, %1\;mov\\t%D0, %D1\";
+ case 6: return \"%v0s32i\\t%1, %0\;s32i\\t%D1, %N0\";
+
+ case 1:
+ case 4:
+ case 5:
+ {
+ /* Check if the first half of the destination register is used
+ in the source address. If so, reverse the order of the loads
+ so that the source address doesn't get clobbered until it is
+ no longer needed. */
+
+ rtx dstreg = operands[0];
+ if (GET_CODE (dstreg) == SUBREG)
+ dstreg = SUBREG_REG (dstreg);
+ if (GET_CODE (dstreg) != REG)
+ abort();
+
+ if (reg_mentioned_p (dstreg, operands[1]))
+ {
+ switch (which_alternative)
+ {
+ case 1: return \"%v1l32i.n\\t%D0, %N1\;l32i.n\\t%0, %1\";
+ case 4: return \"%v1l32r\\t%D0, %N1\;l32r\\t%0, %1\";
+ case 5: return \"%v1l32i\\t%D0, %N1\;l32i\\t%0, %1\";
+ }
+ }
+ else
+ {
+ switch (which_alternative)
+ {
+ case 1: return \"%v1l32i.n\\t%0, %1\;l32i.n\\t%D0, %N1\";
+ case 4: return \"%v1l32r\\t%0, %1\;l32r\\t%D0, %N1\";
+ case 5: return \"%v1l32i\\t%0, %1\;l32i\\t%D0, %N1\";
+ }
+ }
+ }
+ }
+ abort ();
+ return \"\";
+}"
+ [(set_attr "type" "move,load,store,move,load,load,store")
+ (set_attr "mode" "DI")
+ (set_attr "length" "4,4,4,6,6,6,6")])
+
+
+;; 32-bit Integer moves
+
+(define_expand "movsi"
+ [(set (match_operand:SI 0 "nonimmed_operand" "")
+ (match_operand:SI 1 "general_operand" ""))]
+ ""
+ "
+{
+ if (xtensa_emit_move_sequence (operands, SImode))
+ DONE;
+}")
+
+(define_insn "movsi_internal"
+ [(set (match_operand:SI 0 "nonimmed_operand" "=D,D,D,D,R,R,a,q,a,a,a,U,*a,*A")
+ (match_operand:SI 1 "move_operand" "M,D,d,R,D,d,r,r,I,T,U,r,*A,*r"))]
+ "non_acc_reg_operand (operands[0], SImode)
+ || non_acc_reg_operand (operands[1], SImode)"
+ "@
+ movi.n\\t%0, %x1
+ mov.n\\t%0, %1
+ mov.n\\t%0, %1
+ %v1l32i.n\\t%0, %1
+ %v0s32i.n\\t%1, %0
+ %v0s32i.n\\t%1, %0
+ mov\\t%0, %1
+ movsp\\t%0, %1
+ movi\\t%0, %x1
+ %v1l32r\\t%0, %1
+ %v1l32i\\t%0, %1
+ %v0s32i\\t%1, %0
+ rsr\\t%0, 16 # ACCLO
+ wsr\\t%1, 16 # ACCLO"
+ [(set_attr "type" "move,move,move,load,store,store,move,move,move,load,load,store,rsr,wsr")
+ (set_attr "mode" "SI")
+ (set_attr "length" "2,2,2,2,2,2,3,3,3,3,3,3,3,3")])
+
+;; 16-bit Integer moves
+
+(define_expand "movhi"
+ [(set (match_operand:HI 0 "nonimmed_operand" "")
+ (match_operand:HI 1 "general_operand" ""))]
+ ""
+ "
+{
+ if (xtensa_emit_move_sequence (operands, HImode))
+ DONE;
+}")
+
+(define_insn "movhi_internal"
+ [(set (match_operand:HI 0 "nonimmed_operand" "=D,D,a,a,a,U,*a,*A")
+ (match_operand:HI 1 "move_operand" "M,d,r,I,U,r,*A,*r"))]
+ "non_acc_reg_operand (operands[0], HImode)
+ || non_acc_reg_operand (operands[1], HImode)"
+ "@
+ movi.n\\t%0, %x1
+ mov.n\\t%0, %1
+ mov\\t%0, %1
+ movi\\t%0, %x1
+ %v1l16ui\\t%0, %1
+ %v0s16i\\t%1, %0
+ rsr\\t%0, 16 # ACCLO
+ wsr\\t%1, 16 # ACCLO"
+ [(set_attr "type" "move,move,move,move,load,store,rsr,wsr")
+ (set_attr "mode" "HI")
+ (set_attr "length" "2,2,3,3,3,3,3,3")])
+
+;; 8-bit Integer moves
+
+(define_expand "movqi"
+ [(set (match_operand:QI 0 "nonimmed_operand" "")
+ (match_operand:QI 1 "general_operand" ""))]
+ ""
+ "
+{
+ if (xtensa_emit_move_sequence (operands, QImode))
+ DONE;
+}")
+
+(define_insn "movqi_internal"
+ [(set (match_operand:QI 0 "nonimmed_operand" "=D,D,a,a,a,U,*a,*A")
+ (match_operand:QI 1 "move_operand" "M,d,r,I,U,r,*A,*r"))]
+ "non_acc_reg_operand (operands[0], QImode)
+ || non_acc_reg_operand (operands[1], QImode)"
+ "@
+ movi.n\\t%0, %x1
+ mov.n\\t%0, %1
+ mov\\t%0, %1
+ movi\\t%0, %x1
+ %v1l8ui\\t%0, %1
+ %v0s8i\\t%1, %0
+ rsr\\t%0, 16 # ACCLO
+ wsr\\t%1, 16 # ACCLO"
+ [(set_attr "type" "move,move,move,move,load,store,rsr,wsr")
+ (set_attr "mode" "QI")
+ (set_attr "length" "2,2,3,3,3,3,3,3")])
+
+;; 32-bit floating point moves
+
+(define_expand "movsf"
+ [(set (match_operand:SF 0 "nonimmed_operand" "")
+ (match_operand:SF 1 "general_operand" ""))]
+ ""
+ "
+{
+ if (GET_CODE (operands[1]) == CONST_DOUBLE)
+ operands[1] = force_const_mem(SFmode, operands[1]);
+
+ if (!(reload_in_progress | reload_completed))
+ {
+ if (((!register_operand (operands[0], SFmode)
+ && !register_operand (operands[1], SFmode))
+ || (FP_REG_P (xt_true_regnum (operands[0]))
+ && constantpool_mem_p (operands[1]))))
+ operands[1] = force_reg (SFmode, operands[1]);
+
+ if (a7_overlap_mentioned_p (operands[1]))
+ {
+ emit_insn (gen_movsf_internal (operands[0], operands[1]));
+ emit_insn (gen_set_frame_ptr ());
+ DONE;
+ }
+ }
+}")
+
+(define_insn "movsf_internal"
+ [(set (match_operand:SF 0 "nonimmed_operand"
+ "=f,f,U,D,D,R,a,f,a,a,a,U")
+ (match_operand:SF 1 "non_const_move_operand"
+ "f,U,f,d,R,d,r,r,f,T,U,r"))]
+ "((register_operand (operands[0], SFmode)
+ || register_operand (operands[1], SFmode))
+ && (!FP_REG_P (xt_true_regnum (operands[0]))
+ || !constantpool_mem_p (operands[1])))"
+ "@
+ mov.s\\t%0, %1
+ %v1lsi\\t%0, %1
+ %v0ssi\\t%1, %0
+ mov.n\\t%0, %1
+ %v1l32i.n\\t%0, %1
+ %v0s32i.n\\t%1, %0
+ mov\\t%0, %1
+ wfr\\t%0, %1
+ rfr\\t%0, %1
+ %v1l32r\\t%0, %1
+ %v1l32i\\t%0, %1
+ %v0s32i\\t%1, %0"
+ [(set_attr "type" "farith,fload,fstore,move,load,store,move,farith,farith,load,load,store")
+ (set_attr "mode" "SF")
+ (set_attr "length" "3,3,3,2,2,2,3,3,3,3,3,3")])
+
+(define_insn ""
+ [(parallel
+ [(set (match_operand:SF 0 "register_operand" "=f")
+ (mem:SF (plus:SI (match_operand:SI 1 "register_operand" "+a")
+ (match_operand:SI 2 "fpmem_offset_operand" "i"))))
+ (set (match_dup 1)
+ (plus:SI (match_dup 1) (match_dup 2)))])]
+ "TARGET_HARD_FLOAT"
+ "*
+{
+ if (TARGET_SERIALIZE_VOLATILE && volatile_refs_p (PATTERN (insn)))
+ output_asm_insn(\"memw\", operands);
+ return \"lsiu\\t%0, %1, %2\";
+}"
+ [(set_attr "type" "fload")
+ (set_attr "mode" "SF")
+ (set_attr "length" "3")])
+
+(define_insn ""
+ [(parallel
+ [(set (mem:SF (plus:SI (match_operand:SI 0 "register_operand" "+a")
+ (match_operand:SI 1 "fpmem_offset_operand" "i")))
+ (match_operand:SF 2 "register_operand" "f"))
+ (set (match_dup 0)
+ (plus:SI (match_dup 0) (match_dup 1)))])]
+ "TARGET_HARD_FLOAT"
+ "*
+{
+ if (TARGET_SERIALIZE_VOLATILE && volatile_refs_p (PATTERN (insn)))
+ output_asm_insn(\"memw\", operands);
+ return \"ssiu\\t%2, %0, %1\";
+}"
+ [(set_attr "type" "fstore")
+ (set_attr "mode" "SF")
+ (set_attr "length" "3")])
+
+;; 64-bit floating point moves
+
+(define_expand "movdf"
+ [(set (match_operand:DF 0 "nonimmed_operand" "")
+ (match_operand:DF 1 "general_operand" ""))]
+ ""
+ "
+{
+ if (GET_CODE(operands[1]) == CONST_DOUBLE)
+ operands[1] = force_const_mem(DFmode, operands[1]);
+
+ if (!(reload_in_progress | reload_completed))
+ {
+ if (!register_operand (operands[0], DFmode)
+ && !register_operand (operands[1], DFmode))
+ operands[1] = force_reg (DFmode, operands[1]);
+
+ if (a7_overlap_mentioned_p (operands[1]))
+ {
+ emit_insn (gen_movdf_internal (operands[0], operands[1]));
+ emit_insn (gen_set_frame_ptr ());
+ DONE;
+ }
+ }
+}")
+
+(define_insn "movdf_internal"
+ [(set (match_operand:DF 0 "nonimmed_operand" "=D,D,S,a,a,a,U")
+ (match_operand:DF 1 "non_const_move_operand" "d,S,d,r,T,U,r"))]
+ "register_operand (operands[0], DFmode)
+ || register_operand (operands[1], DFmode)"
+ "*
+{
+ switch (which_alternative)
+ {
+ case 0: return \"mov.n\\t%0, %1\;mov.n\\t%D0, %D1\";
+ case 2: return \"%v0s32i.n\\t%1, %0\;s32i.n\\t%D1, %N0\";
+ case 3: return \"mov\\t%0, %1\;mov\\t%D0, %D1\";
+ case 6: return \"%v0s32i\\t%1, %0\;s32i\\t%D1, %N0\";
+
+ case 1:
+ case 4:
+ case 5:
+ {
+ /* Check if the first half of the destination register is used
+ in the source address. If so, reverse the order of the loads
+ so that the source address doesn't get clobbered until it is
+ no longer needed. */
+
+ rtx dstreg = operands[0];
+ if (GET_CODE (dstreg) == SUBREG)
+ dstreg = SUBREG_REG (dstreg);
+ if (GET_CODE (dstreg) != REG)
+ abort();
+
+ if (reg_mentioned_p (dstreg, operands[1]))
+ {
+ switch (which_alternative)
+ {
+ case 1: return \"%v1l32i.n\\t%D0, %N1\;l32i.n\\t%0, %1\";
+ case 4: return \"%v1l32r\\t%D0, %N1\;l32r\\t%0, %1\";
+ case 5: return \"%v1l32i\\t%D0, %N1\;l32i\\t%0, %1\";
+ }
+ }
+ else
+ {
+ switch (which_alternative)
+ {
+ case 1: return \"%v1l32i.n\\t%0, %1\;l32i.n\\t%D0, %N1\";
+ case 4: return \"%v1l32r\\t%0, %1\;l32r\\t%D0, %N1\";
+ case 5: return \"%v1l32i\\t%0, %1\;l32i\\t%D0, %N1\";
+ }
+ }
+ }
+ }
+ abort ();
+ return \"\";
+}"
+ [(set_attr "type" "move,load,store,move,load,load,store")
+ (set_attr "mode" "DF")
+ (set_attr "length" "4,4,4,6,6,6,6")])
+
+;; Block moves
+
+(define_expand "movstrsi"
+ [(parallel [(set (match_operand:BLK 0 "" "")
+ (match_operand:BLK 1 "" ""))
+ (use (match_operand:SI 2 "arith_operand" ""))
+ (use (match_operand:SI 3 "const_int_operand" ""))])]
+ ""
+ "
+{
+ if (!xtensa_expand_block_move (operands)) FAIL;
+ DONE;
+}")
+
+(define_insn "movstrsi_internal"
+ [(parallel [(set (match_operand:BLK 0 "memory_operand" "=U")
+ (match_operand:BLK 1 "memory_operand" "U"))
+ (use (match_operand:SI 2 "arith_operand" ""))
+ (use (match_operand:SI 3 "const_int_operand" ""))
+ (clobber (match_scratch:SI 4 "=&r"))
+ (clobber (match_scratch:SI 5 "=&r"))])]
+ ""
+ "*
+{
+ rtx tmpregs[2];
+ tmpregs[0] = operands[4];
+ tmpregs[1] = operands[5];
+ xtensa_emit_block_move (operands, tmpregs, 1);
+ return \"\";
+}"
+ [(set_attr "type" "multi")
+ (set_attr "mode" "none")
+ (set_attr "length" "300")])
+
+
+;;
+;; ....................
+;;
+;; SHIFTS
+;;
+;; ....................
+;;
+
+(define_insn "ashlsi3"
+ [(set (match_operand:SI 0 "register_operand" "=a,a")
+ (ashift:SI (match_operand:SI 1 "register_operand" "r,r")
+ (match_operand:SI 2 "arith_operand" "J,r")))]
+ ""
+ "@
+ slli\\t%0, %1, %R2
+ ssl\\t%2\;sll\\t%0, %1"
+ [(set_attr "type" "arith,arith")
+ (set_attr "mode" "SI")
+ (set_attr "length" "3,6")])
+
+(define_insn "ashrsi3"
+ [(set (match_operand:SI 0 "register_operand" "=a,a")
+ (ashiftrt:SI (match_operand:SI 1 "register_operand" "r,r")
+ (match_operand:SI 2 "arith_operand" "J,r")))]
+ ""
+ "@
+ srai\\t%0, %1, %R2
+ ssr\\t%2\;sra\\t%0, %1"
+ [(set_attr "type" "arith,arith")
+ (set_attr "mode" "SI")
+ (set_attr "length" "3,6")])
+
+(define_insn "lshrsi3"
+ [(set (match_operand:SI 0 "register_operand" "=a,a")
+ (lshiftrt:SI (match_operand:SI 1 "register_operand" "r,r")
+ (match_operand:SI 2 "arith_operand" "J,r")))]
+ ""
+ "*
+{
+ if (which_alternative == 0)
+ {
+ if ((INTVAL (operands[2]) & 0x1f) < 16)
+ return \"srli\\t%0, %1, %R2\";
+ else
+ return \"extui\\t%0, %1, %R2, %L2\";
+ }
+ return \"ssr\\t%2\;srl\\t%0, %1\";
+}"
+ [(set_attr "type" "arith,arith")
+ (set_attr "mode" "SI")
+ (set_attr "length" "3,6")])
+
+(define_insn "rotlsi3"
+ [(set (match_operand:SI 0 "register_operand" "=a,a")
+ (rotate:SI (match_operand:SI 1 "register_operand" "r,r")
+ (match_operand:SI 2 "arith_operand" "J,r")))]
+ ""
+ "@
+ ssai\\t%L2\;src\\t%0, %1, %1
+ ssl\\t%2\;src\\t%0, %1, %1"
+ [(set_attr "type" "multi,multi")
+ (set_attr "mode" "SI")
+ (set_attr "length" "6,6")])
+
+(define_insn "rotrsi3"
+ [(set (match_operand:SI 0 "register_operand" "=a,a")
+ (rotatert:SI (match_operand:SI 1 "register_operand" "r,r")
+ (match_operand:SI 2 "arith_operand" "J,r")))]
+ ""
+ "@
+ ssai\\t%R2\;src\\t%0, %1, %1
+ ssr\\t%2\;src\\t%0, %1, %1"
+ [(set_attr "type" "multi,multi")
+ (set_attr "mode" "SI")
+ (set_attr "length" "6,6")])
+
+;;
+;; ....................
+;;
+;; COMPARISONS
+;;
+;; ....................
+;;
+
+;; Like the md files for MIPS and SPARC, we handle comparisons by stashing
+;; away the operands and then using that information in the subsequent
+;; conditional branch.
+
+(define_expand "cmpsi"
+ [(set (cc0)
+ (compare:CC (match_operand:SI 0 "register_operand" "")
+ (match_operand:SI 1 "nonmemory_operand" "")))]
+ ""
+ "
+{
+ branch_cmp[0] = operands[0];
+ branch_cmp[1] = operands[1];
+ branch_type = CMP_SI;
+ DONE;
+}")
+
+(define_expand "tstsi"
+ [(set (cc0)
+ (match_operand:SI 0 "register_operand" ""))]
+ ""
+ "
+{
+ branch_cmp[0] = operands[0];
+ branch_cmp[1] = const0_rtx;
+ branch_type = CMP_SI;
+ DONE;
+}")
+
+(define_expand "cmpsf"
+ [(set (cc0)
+ (compare:CC (match_operand:SF 0 "register_operand" "")
+ (match_operand:SF 1 "register_operand" "")))]
+ "TARGET_HARD_FLOAT"
+ "
+{
+ branch_cmp[0] = operands[0];
+ branch_cmp[1] = operands[1];
+ branch_type = CMP_SF;
+ DONE;
+}")
+
+
+;;
+;; ....................
+;;
+;; CONDITIONAL BRANCHES
+;;
+;; ....................
+;;
+
+(define_expand "beq"
+ [(set (pc)
+ (if_then_else (eq (cc0) (const_int 0))
+ (label_ref (match_operand 0 "" ""))
+ (pc)))]
+ ""
+ "
+{
+ xtensa_expand_conditional_branch (operands, EQ);
+ DONE;
+}")
+
+(define_expand "bne"
+ [(set (pc)
+ (if_then_else (ne (cc0) (const_int 0))
+ (label_ref (match_operand 0 "" ""))
+ (pc)))]
+ ""
+ "
+{
+ xtensa_expand_conditional_branch (operands, NE);
+ DONE;
+}")
+
+(define_expand "bgt"
+ [(set (pc)
+ (if_then_else (gt (cc0) (const_int 0))
+ (label_ref (match_operand 0 "" ""))
+ (pc)))]
+ ""
+ "
+{
+ xtensa_expand_conditional_branch (operands, GT);
+ DONE;
+}")
+
+(define_expand "bge"
+ [(set (pc)
+ (if_then_else (ge (cc0) (const_int 0))
+ (label_ref (match_operand 0 "" ""))
+ (pc)))]
+ ""
+ "
+{
+ xtensa_expand_conditional_branch (operands, GE);
+ DONE;
+}")
+
+(define_expand "blt"
+ [(set (pc)
+ (if_then_else (lt (cc0) (const_int 0))
+ (label_ref (match_operand 0 "" ""))
+ (pc)))]
+ ""
+ "
+{
+ xtensa_expand_conditional_branch (operands, LT);
+ DONE;
+}")
+
+(define_expand "ble"
+ [(set (pc)
+ (if_then_else (le (cc0) (const_int 0))
+ (label_ref (match_operand 0 "" ""))
+ (pc)))]
+ ""
+ "
+{
+ xtensa_expand_conditional_branch (operands, LE);
+ DONE;
+}")
+
+(define_expand "bgtu"
+ [(set (pc)
+ (if_then_else (gtu (cc0) (const_int 0))
+ (label_ref (match_operand 0 "" ""))
+ (pc)))]
+ ""
+ "
+{
+ xtensa_expand_conditional_branch (operands, GTU);
+ DONE;
+}")
+
+(define_expand "bgeu"
+ [(set (pc)
+ (if_then_else (geu (cc0) (const_int 0))
+ (label_ref (match_operand 0 "" ""))
+ (pc)))]
+ ""
+ "
+{
+ xtensa_expand_conditional_branch (operands, GEU);
+ DONE;
+}")
+
+(define_expand "bltu"
+ [(set (pc)
+ (if_then_else (ltu (cc0) (const_int 0))
+ (label_ref (match_operand 0 "" ""))
+ (pc)))]
+ ""
+ "
+{
+ xtensa_expand_conditional_branch (operands, LTU);
+ DONE;
+}")
+
+(define_expand "bleu"
+ [(set (pc)
+ (if_then_else (leu (cc0) (const_int 0))
+ (label_ref (match_operand 0 "" ""))
+ (pc)))]
+ ""
+ "
+{
+ xtensa_expand_conditional_branch (operands, LEU);
+ DONE;
+}")
+
+;; Branch patterns for standard integer comparisons
+
+(define_insn ""
+ [(set (pc)
+ (if_then_else (match_operator 3 "branch_operator"
+ [(match_operand:SI 0 "register_operand" "r,r")
+ (match_operand:SI 1 "branch_operand" "K,r")])
+ (label_ref (match_operand 2 "" ""))
+ (pc)))]
+ ""
+ "*
+{
+ if (which_alternative == 1)
+ {
+ switch (GET_CODE (operands[3]))
+ {
+ case EQ: return \"beq\\t%0, %1, %2\";
+ case NE: return \"bne\\t%0, %1, %2\";
+ case LT: return \"blt\\t%0, %1, %2\";
+ case GE: return \"bge\\t%0, %1, %2\";
+ default: break;
+ }
+ }
+ else if (INTVAL(operands[1]) == 0)
+ {
+ switch (GET_CODE (operands[3]))
+ {
+ case EQ: return (TARGET_DENSITY
+ ? \"beqz.n\\t%0, %2\"
+ : \"beqz\\t%0, %2\");
+ case NE: return (TARGET_DENSITY
+ ? \"bnez.n\\t%0, %2\"
+ : \"bnez\\t%0, %2\");
+ case LT: return \"bltz\\t%0, %2\";
+ case GE: return \"bgez\\t%0, %2\";
+ default: break;
+ }
+ }
+ else
+ {
+ switch (GET_CODE (operands[3]))
+ {
+ case EQ: return \"beqi\\t%0, %d1, %2\";
+ case NE: return \"bnei\\t%0, %d1, %2\";
+ case LT: return \"blti\\t%0, %d1, %2\";
+ case GE: return \"bgei\\t%0, %d1, %2\";
+ default: break;
+ }
+ }
+ fatal_insn (\"unexpected branch operator\", operands[3]);
+ return \"\";
+}"
+ [(set_attr "type" "jump,jump")
+ (set_attr "mode" "none")
+ (set_attr "length" "3,3")])
+
+(define_insn ""
+ [(set (pc)
+ (if_then_else (match_operator 3 "branch_operator"
+ [(match_operand:SI 0 "register_operand" "r,r")
+ (match_operand:SI 1 "branch_operand" "K,r")])
+ (pc)
+ (label_ref (match_operand 2 "" ""))))]
+ ""
+ "*
+{
+ if (which_alternative == 1)
+ {
+ switch (GET_CODE (operands[3]))
+ {
+ case EQ: return \"bne\\t%0, %1, %2\";
+ case NE: return \"beq\\t%0, %1, %2\";
+ case LT: return \"bge\\t%0, %1, %2\";
+ case GE: return \"blt\\t%0, %1, %2\";
+ default: break;
+ }
+ }
+ else if (INTVAL(operands[1]) == 0)
+ {
+ switch (GET_CODE (operands[3]))
+ {
+ case EQ: return (TARGET_DENSITY
+ ? \"bnez.n\\t%0, %2\"
+ : \"bnez\\t%0, %2\");
+ case NE: return (TARGET_DENSITY
+ ? \"beqz.n\\t%0, %2\"
+ : \"beqz\\t%0, %2\");
+ case LT: return \"bgez\\t%0, %2\";
+ case GE: return \"bltz\\t%0, %2\";
+ default: break;
+ }
+ }
+ else
+ {
+ switch (GET_CODE (operands[3]))
+ {
+ case EQ: return \"bnei\\t%0, %d1, %2\";
+ case NE: return \"beqi\\t%0, %d1, %2\";
+ case LT: return \"bgei\\t%0, %d1, %2\";
+ case GE: return \"blti\\t%0, %d1, %2\";
+ default: break;
+ }
+ }
+ fatal_insn (\"unexpected branch operator\", operands[3]);
+ return \"\";
+}"
+ [(set_attr "type" "jump,jump")
+ (set_attr "mode" "none")
+ (set_attr "length" "3,3")])
+
+(define_insn ""
+ [(set (pc)
+ (if_then_else (match_operator 3 "ubranch_operator"
+ [(match_operand:SI 0 "register_operand" "r,r")
+ (match_operand:SI 1 "ubranch_operand" "L,r")])
+ (label_ref (match_operand 2 "" ""))
+ (pc)))]
+ ""
+ "*
+{
+ if (which_alternative == 1)
+ {
+ switch (GET_CODE (operands[3]))
+ {
+ case LTU: return \"bltu\\t%0, %1, %2\";
+ case GEU: return \"bgeu\\t%0, %1, %2\";
+ default: break;
+ }
+ }
+ else
+ {
+ switch (GET_CODE (operands[3]))
+ {
+ case LTU: return \"bltui\\t%0, %d1, %2\";
+ case GEU: return \"bgeui\\t%0, %d1, %2\";
+ default: break;
+ }
+ }
+ fatal_insn (\"unexpected branch operator\", operands[3]);
+ return \"\";
+}"
+ [(set_attr "type" "jump,jump")
+ (set_attr "mode" "none")
+ (set_attr "length" "3,3")])
+
+(define_insn ""
+ [(set (pc)
+ (if_then_else (match_operator 3 "ubranch_operator"
+ [(match_operand:SI 0 "register_operand" "r,r")
+ (match_operand:SI 1 "ubranch_operand" "L,r")])
+ (pc)
+ (label_ref (match_operand 2 "" ""))))]
+ ""
+ "*
+{
+ if (which_alternative == 1)
+ {
+ switch (GET_CODE (operands[3]))
+ {
+ case LTU: return \"bgeu\\t%0, %1, %2\";
+ case GEU: return \"bltu\\t%0, %1, %2\";
+ default: break;
+ }
+ }
+ else
+ {
+ switch (GET_CODE (operands[3]))
+ {
+ case LTU: return \"bgeui\\t%0, %d1, %2\";
+ case GEU: return \"bltui\\t%0, %d1, %2\";
+ default: break;
+ }
+ }
+ fatal_insn (\"unexpected branch operator\", operands[3]);
+ return \"\";
+}"
+ [(set_attr "type" "jump,jump")
+ (set_attr "mode" "none")
+ (set_attr "length" "3,3")])
+
+;; Branch patterns for bit testing
+
+(define_insn ""
+ [(set (pc)
+ (if_then_else (match_operator 3 "boolean_operator"
+ [(zero_extract:SI
+ (match_operand:SI 0 "register_operand" "r,r")
+ (const_int 1)
+ (match_operand:SI 1 "arith_operand" "J,r"))
+ (const_int 0)])
+ (label_ref (match_operand 2 "" ""))
+ (pc)))]
+ ""
+ "*
+{
+ if (which_alternative == 0)
+ {
+ unsigned bitnum = INTVAL(operands[1]) & 0x1f;
+ operands[1] = GEN_INT(bitnum);
+ switch (GET_CODE (operands[3]))
+ {
+ case EQ: return \"bbci\\t%0, %d1, %2\";
+ case NE: return \"bbsi\\t%0, %d1, %2\";
+ default: break;
+ }
+ }
+ else
+ {
+ switch (GET_CODE (operands[3]))
+ {
+ case EQ: return \"bbc\\t%0, %1, %2\";
+ case NE: return \"bbs\\t%0, %1, %2\";
+ default: break;
+ }
+ }
+ fatal_insn (\"unexpected branch operator\", operands[3]);
+ return \"\";
+}"
+ [(set_attr "type" "jump")
+ (set_attr "mode" "none")
+ (set_attr "length" "3")])
+
+(define_insn ""
+ [(set (pc)
+ (if_then_else (match_operator 3 "boolean_operator"
+ [(zero_extract:SI
+ (match_operand:SI 0 "register_operand" "r,r")
+ (const_int 1)
+ (match_operand:SI 1 "arith_operand" "J,r"))
+ (const_int 0)])
+ (pc)
+ (label_ref (match_operand 2 "" ""))))]
+ ""
+ "*
+{
+ if (which_alternative == 0)
+ {
+ unsigned bitnum = INTVAL(operands[1]) & 0x1f;
+ operands[1] = GEN_INT(bitnum);
+ switch (GET_CODE (operands[3]))
+ {
+ case EQ: return \"bbsi\\t%0, %d1, %2\";
+ case NE: return \"bbci\\t%0, %d1, %2\";
+ default: break;
+ }
+ }
+ else
+ {
+ switch (GET_CODE (operands[3]))
+ {
+ case EQ: return \"bbs\\t%0, %1, %2\";
+ case NE: return \"bbc\\t%0, %1, %2\";
+ default: break;
+ }
+ }
+ fatal_insn (\"unexpected branch operator\", operands[3]);
+ return \"\";
+}"
+ [(set_attr "type" "jump")
+ (set_attr "mode" "none")
+ (set_attr "length" "3")])
+
+(define_insn ""
+ [(set (pc)
+ (if_then_else (match_operator 3 "boolean_operator"
+ [(and:SI (match_operand:SI 0 "register_operand" "r")
+ (match_operand:SI 1 "register_operand" "r"))
+ (const_int 0)])
+ (label_ref (match_operand 2 "" ""))
+ (pc)))]
+ ""
+ "*
+{
+ switch (GET_CODE (operands[3]))
+ {
+ case EQ: return \"bnone\\t%0, %1, %2\";
+ case NE: return \"bany\\t%0, %1, %2\";
+ default: break;
+ }
+ fatal_insn (\"unexpected branch operator\", operands[3]);
+ return \"\";
+}"
+ [(set_attr "type" "jump")
+ (set_attr "mode" "none")
+ (set_attr "length" "3")])
+
+(define_insn ""
+ [(set (pc)
+ (if_then_else (match_operator 3 "boolean_operator"
+ [(and:SI (match_operand:SI 0 "register_operand" "r")
+ (match_operand:SI 1 "register_operand" "r"))
+ (const_int 0)])
+ (pc)
+ (label_ref (match_operand 2 "" ""))))]
+ ""
+ "*
+{
+ switch (GET_CODE (operands[3]))
+ {
+ case EQ: return \"bany\\t%0, %1, %2\";
+ case NE: return \"bnone\\t%0, %1, %2\";
+ default: break;
+ }
+ fatal_insn (\"unexpected branch operator\", operands[3]);
+ return \"\";
+}"
+ [(set_attr "type" "jump")
+ (set_attr "mode" "none")
+ (set_attr "length" "3")])
+
+
+;; Define the loop insns that is used by bct optimization to represent the
+;; start and end of a zero-overhead loop (in loop.c). This start template
+;; generates the loop insn, the end template doesn't generate any instructions
+;; since since loop end is handled in hardware.
+
+(define_insn "zero_cost_loop_start"
+ [(parallel [(set (pc) (if_then_else (eq (match_operand:SI 0 "register_operand" "a")
+ (const_int 0))
+ (label_ref (match_operand 1 "" ""))
+ (pc)))
+ (set (reg:SI 19)
+ (plus:SI (match_dup 0)
+ (const_int -1)))])]
+ ""
+ "loopnez %0, %l1"
+ [(set_attr "type" "jump")
+ (set_attr "mode" "none")
+ (set_attr "length" "3")])
+
+(define_insn "zero_cost_loop_end"
+ [(parallel [(set (pc) (if_then_else (ne (reg:SI 19)
+ (const_int 0))
+ (label_ref (match_operand 0 "" ""))
+ (pc)))
+ (set (reg:SI 19)
+ (plus:SI (reg:SI 19)
+ (const_int -1)))])]
+ ""
+ "*
+ xtensa_emit_loop_end (insn, operands);
+ return \"\";
+ "
+ [(set_attr "type" "jump")
+ (set_attr "mode" "none")
+ (set_attr "length" "0")])
+
+
+;;
+;; ....................
+;;
+;; SETTING A REGISTER FROM A COMPARISON
+;;
+;; ....................
+;;
+
+(define_expand "seq"
+ [(set (match_operand:SI 0 "register_operand" "")
+ (match_dup 1))]
+ ""
+ "
+{
+ operands[1] = gen_rtx (EQ, SImode, branch_cmp[0], branch_cmp[1]);
+ if (!xtensa_expand_scc (operands)) FAIL;
+ DONE;
+}")
+
+(define_expand "sne"
+ [(set (match_operand:SI 0 "register_operand" "")
+ (match_dup 1))]
+ ""
+ "
+{
+ operands[1] = gen_rtx (NE, SImode, branch_cmp[0], branch_cmp[1]);
+ if (!xtensa_expand_scc (operands)) FAIL;
+ DONE;
+}")
+
+(define_expand "sgt"
+ [(set (match_operand:SI 0 "register_operand" "")
+ (match_dup 1))]
+ ""
+ "
+{
+ operands[1] = gen_rtx (GT, SImode, branch_cmp[0], branch_cmp[1]);
+ if (!xtensa_expand_scc (operands)) FAIL;
+ DONE;
+}")
+
+(define_expand "sge"
+ [(set (match_operand:SI 0 "register_operand" "")
+ (match_dup 1))]
+ ""
+ "
+{
+ operands[1] = gen_rtx (GE, SImode, branch_cmp[0], branch_cmp[1]);
+ if (!xtensa_expand_scc (operands)) FAIL;
+ DONE;
+}")
+
+(define_expand "slt"
+ [(set (match_operand:SI 0 "register_operand" "")
+ (match_dup 1))]
+ ""
+ "
+{
+ operands[1] = gen_rtx (LT, SImode, branch_cmp[0], branch_cmp[1]);
+ if (!xtensa_expand_scc (operands)) FAIL;
+ DONE;
+}")
+
+(define_expand "sle"
+ [(set (match_operand:SI 0 "register_operand" "")
+ (match_dup 1))]
+ ""
+ "
+{
+ operands[1] = gen_rtx (LE, SImode, branch_cmp[0], branch_cmp[1]);
+ if (!xtensa_expand_scc (operands)) FAIL;
+ DONE;
+}")
+
+
+;;
+;; ....................
+;;
+;; CONDITIONAL MOVES
+;;
+;; ....................
+;;
+
+(define_expand "movsicc"
+ [(set (match_operand:SI 0 "register_operand" "")
+ (if_then_else:SI (match_operand 1 "comparison_operator" "")
+ (match_operand:SI 2 "register_operand" "")
+ (match_operand:SI 3 "register_operand" "")))]
+ ""
+ "
+{
+ if (!xtensa_expand_conditional_move (operands, 0)) FAIL;
+ DONE;
+}")
+
+(define_expand "movsfcc"
+ [(set (match_operand:SF 0 "register_operand" "")
+ (if_then_else:SF (match_operand 1 "comparison_operator" "")
+ (match_operand:SF 2 "register_operand" "")
+ (match_operand:SF 3 "register_operand" "")))]
+ ""
+ "
+{
+ if (!xtensa_expand_conditional_move (operands, 1)) FAIL;
+ DONE;
+}")
+
+(define_insn "movsicc_internal0"
+ [(set (match_operand:SI 0 "register_operand" "=a,a")
+ (if_then_else:SI (match_operator 4 "branch_operator"
+ [(match_operand:SI 1 "register_operand" "r,r")
+ (const_int 0)])
+ (match_operand:SI 2 "register_operand" "r,0")
+ (match_operand:SI 3 "register_operand" "0,r")))]
+ ""
+ "*
+{
+ if (which_alternative == 0)
+ {
+ switch (GET_CODE (operands[4]))
+ {
+ case EQ: return \"moveqz\\t%0, %2, %1\";
+ case NE: return \"movnez\\t%0, %2, %1\";
+ case LT: return \"movltz\\t%0, %2, %1\";
+ case GE: return \"movgez\\t%0, %2, %1\";
+ default: break;
+ }
+ }
+ else
+ {
+ switch (GET_CODE (operands[4]))
+ {
+ case EQ: return \"movnez\\t%0, %3, %1\";
+ case NE: return \"moveqz\\t%0, %3, %1\";
+ case LT: return \"movgez\\t%0, %3, %1\";
+ case GE: return \"movltz\\t%0, %3, %1\";
+ default: break;
+ }
+ }
+ fatal_insn (\"unexpected cmov operator\", operands[4]);
+ return \"\";
+}"
+ [(set_attr "type" "move,move")
+ (set_attr "mode" "SI")
+ (set_attr "length" "3,3")])
+
+(define_insn "movsicc_internal1"
+ [(set (match_operand:SI 0 "register_operand" "=a,a")
+ (if_then_else:SI (match_operator 4 "boolean_operator"
+ [(match_operand:CC 1 "register_operand" "b,b")
+ (const_int 0)])
+ (match_operand:SI 2 "register_operand" "r,0")
+ (match_operand:SI 3 "register_operand" "0,r")))]
+ "TARGET_BOOLEANS"
+ "*
+{
+ int isEq = (GET_CODE (operands[4]) == EQ);
+ switch (which_alternative)
+ {
+ case 0:
+ if (isEq) return \"movf\\t%0, %2, %1\";
+ return \"movt\\t%0, %2, %1\";
+ case 1:
+ if (isEq) return \"movt\\t%0, %3, %1\";
+ return \"movf\\t%0, %3, %1\";
+ }
+ abort ();
+ return \"\";
+}"
+ [(set_attr "type" "move,move")
+ (set_attr "mode" "SI")
+ (set_attr "length" "3,3")])
+
+(define_insn "movsfcc_internal0"
+ [(set (match_operand:SF 0 "register_operand" "=a,a,f,f")
+ (if_then_else:SF (match_operator 4 "branch_operator"
+ [(match_operand:SI 1 "register_operand" "r,r,r,r")
+ (const_int 0)])
+ (match_operand:SF 2 "register_operand" "r,0,f,0")
+ (match_operand:SF 3 "register_operand" "0,r,0,f")))]
+ ""
+ "*
+{
+ if (which_alternative == 0)
+ {
+ switch (GET_CODE (operands[4]))
+ {
+ case EQ: return \"moveqz\\t%0, %2, %1\";
+ case NE: return \"movnez\\t%0, %2, %1\";
+ case LT: return \"movltz\\t%0, %2, %1\";
+ case GE: return \"movgez\\t%0, %2, %1\";
+ default: break;
+ }
+ }
+ else if (which_alternative == 1)
+ {
+ switch (GET_CODE (operands[4]))
+ {
+ case EQ: return \"movnez\\t%0, %3, %1\";
+ case NE: return \"moveqz\\t%0, %3, %1\";
+ case LT: return \"movgez\\t%0, %3, %1\";
+ case GE: return \"movltz\\t%0, %3, %1\";
+ default: break;
+ }
+ }
+ else if (which_alternative == 2)
+ {
+ switch (GET_CODE (operands[4]))
+ {
+ case EQ: return \"moveqz.s %0, %2, %1\";
+ case NE: return \"movnez.s %0, %2, %1\";
+ case LT: return \"movltz.s %0, %2, %1\";
+ case GE: return \"movgez.s %0, %2, %1\";
+ default: break;
+ }
+ }
+ else if (which_alternative == 3)
+ {
+ switch (GET_CODE (operands[4]))
+ {
+ case EQ: return \"movnez.s %0, %3, %1\";
+ case NE: return \"moveqz.s %0, %3, %1\";
+ case LT: return \"movgez.s %0, %3, %1\";
+ case GE: return \"movltz.s %0, %3, %1\";
+ default: break;
+ }
+ }
+ fatal_insn (\"unexpected cmov operator\", operands[4]);
+ return \"\";
+}"
+ [(set_attr "type" "move,move,move,move")
+ (set_attr "mode" "SF")
+ (set_attr "length" "3,3,3,3")])
+
+(define_insn "movsfcc_internal1"
+ [(set (match_operand:SF 0 "register_operand" "=a,a,f,f")
+ (if_then_else:SF (match_operator 4 "boolean_operator"
+ [(match_operand:CC 1 "register_operand" "b,b,b,b")
+ (const_int 0)])
+ (match_operand:SF 2 "register_operand" "r,0,f,0")
+ (match_operand:SF 3 "register_operand" "0,r,0,f")))]
+ "TARGET_BOOLEANS"
+ "*
+{
+ int isEq = (GET_CODE (operands[4]) == EQ);
+ switch (which_alternative)
+ {
+ case 0:
+ if (isEq) return \"movf\\t%0, %2, %1\";
+ return \"movt\\t%0, %2, %1\";
+ case 1:
+ if (isEq) return \"movt\\t%0, %3, %1\";
+ return \"movf\\t%0, %3, %1\";
+ case 2:
+ if (isEq) return \"movf.s\\t%0, %2, %1\";
+ return \"movt.s\\t%0, %2, %1\";
+ case 3:
+ if (isEq) return \"movt.s\\t%0, %3, %1\";
+ return \"movf.s\\t%0, %3, %1\";
+ }
+ abort ();
+ return \"\";
+}"
+ [(set_attr "type" "move,move,move,move")
+ (set_attr "mode" "SF")
+ (set_attr "length" "3,3,3,3")])
+
+
+;;
+;; ....................
+;;
+;; FLOATING POINT COMPARISONS
+;;
+;; ....................
+;;
+
+(define_insn "seq_sf"
+ [(set (match_operand:CC 0 "register_operand" "=b")
+ (eq:CC (match_operand:SF 1 "register_operand" "f")
+ (match_operand:SF 2 "register_operand" "f")))]
+ "TARGET_HARD_FLOAT"
+ "oeq.s\\t%0, %1, %2"
+ [(set_attr "type" "farith")
+ (set_attr "mode" "BL")
+ (set_attr "length" "3")])
+
+(define_insn "slt_sf"
+ [(set (match_operand:CC 0 "register_operand" "=b")
+ (lt:CC (match_operand:SF 1 "register_operand" "f")
+ (match_operand:SF 2 "register_operand" "f")))]
+ "TARGET_HARD_FLOAT"
+ "olt.s\\t%0, %1, %2"
+ [(set_attr "type" "farith")
+ (set_attr "mode" "BL")
+ (set_attr "length" "3")])
+
+(define_insn "sle_sf"
+ [(set (match_operand:CC 0 "register_operand" "=b")
+ (le:CC (match_operand:SF 1 "register_operand" "f")
+ (match_operand:SF 2 "register_operand" "f")))]
+ "TARGET_HARD_FLOAT"
+ "ole.s\\t%0, %1, %2"
+ [(set_attr "type" "farith")
+ (set_attr "mode" "BL")
+ (set_attr "length" "3")])
+
+
+;;
+;; ....................
+;;
+;; UNCONDITIONAL BRANCHES
+;;
+;; ....................
+;;
+
+(define_insn "jump"
+ [(set (pc)
+ (label_ref (match_operand 0 "" "")))]
+ ""
+ "j\\t%l0"
+ [(set_attr "type" "jump")
+ (set_attr "mode" "none")
+ (set_attr "length" "3")])
+
+(define_expand "indirect_jump"
+ [(set (pc) (match_operand 0 "register_operand" ""))]
+ ""
+ "
+{
+ rtx dest = operands[0];
+ if (GET_CODE (dest) != REG || GET_MODE (dest) != Pmode)
+ operands[0] = copy_to_mode_reg (Pmode, dest);
+
+ emit_jump_insn(gen_indirect_jump_internal(dest));
+ DONE;
+}")
+
+(define_insn "indirect_jump_internal"
+ [(set (pc) (match_operand:SI 0 "register_operand" "r"))]
+ ""
+ "jx\\t%0"
+ [(set_attr "type" "jump")
+ (set_attr "mode" "none")
+ (set_attr "length" "3")])
+
+
+(define_expand "tablejump"
+ [(use (match_operand:SI 0 "register_operand" ""))
+ (use (label_ref (match_operand 1 "" "")))]
+ ""
+ "
+{
+ rtx target = operands[0];
+ if (flag_pic)
+ {
+ /* For PIC, the table entry is relative to the start of the table. */
+ rtx label = gen_reg_rtx (SImode);
+ target = gen_reg_rtx (SImode);
+ emit_move_insn (label, gen_rtx_LABEL_REF (SImode, operands[1]));
+ emit_insn (gen_addsi3 (target, operands[0], label));
+ }
+ emit_jump_insn (gen_tablejump_internal (target, operands[1]));
+ DONE;
+}")
+
+(define_insn "tablejump_internal"
+ [(set (pc)
+ (match_operand:SI 0 "register_operand" "r"))
+ (use (label_ref (match_operand 1 "" "")))]
+ ""
+ "jx\\t%0"
+ [(set_attr "type" "jump")
+ (set_attr "mode" "none")
+ (set_attr "length" "3")])
+
+
+;;
+;; ....................
+;;
+;; FUNCTION CALLS
+;;
+;; ....................
+;;
+
+(define_expand "sym_PLT"
+ [(const (unspec [(match_operand:SI 0 "" "")] UNSPEC_PLT))]
+ ""
+ "")
+
+(define_expand "call"
+ [(call (match_operand 0 "memory_operand" "")
+ (match_operand 1 "" ""))]
+ ""
+ "
+{
+ rtx addr = XEXP (operands[0], 0);
+ if (flag_pic && GET_CODE (addr) == SYMBOL_REF && !SYMBOL_REF_FLAG (addr))
+ addr = gen_sym_PLT (addr);
+ if (!call_insn_operand (addr, VOIDmode))
+ XEXP (operands[0], 0) = copy_to_mode_reg (Pmode, addr);
+}")
+
+(define_insn "call_internal"
+ [(call (mem (match_operand:SI 0 "call_insn_operand" "n,i,r"))
+ (match_operand 1 "" "i,i,i"))]
+ ""
+ "*
+ return xtensa_emit_call (0, operands);
+ "
+ [(set_attr "type" "call")
+ (set_attr "mode" "none")
+ (set_attr "length" "3")])
+
+(define_expand "call_value"
+ [(set (match_operand 0 "register_operand" "")
+ (call (match_operand 1 "memory_operand" "")
+ (match_operand 2 "" "")))]
+ ""
+ "
+{
+ rtx addr = XEXP (operands[1], 0);
+ if (flag_pic && GET_CODE (addr) == SYMBOL_REF && !SYMBOL_REF_FLAG (addr))
+ addr = gen_sym_PLT (addr);
+ if (!call_insn_operand (addr, VOIDmode))
+ XEXP (operands[1], 0) = copy_to_mode_reg (Pmode, addr);
+}")
+
+;; cannot combine constraints for operand 0 into "afvb"
+;; reload.c:find_reloads seems to assume that grouped constraints somehow
+;; specify related register classes, and when they don't the constraints
+;; fail to match. By not grouping the constraints, we get the correct
+;; behavior.
+(define_insn "call_value_internal"
+ [(set (match_operand 0 "register_operand" "=af,af,af,v,v,v,b,b,b")
+ (call (mem (match_operand:SI 1 "call_insn_operand"
+ "n,i,r,n,i,r,n,i,r"))
+ (match_operand 2 "" "i,i,i,i,i,i,i,i,i")))]
+ ""
+ "*
+ return xtensa_emit_call (1, operands);
+ "
+ [(set_attr "type" "call")
+ (set_attr "mode" "none")
+ (set_attr "length" "3")])
+
+(define_insn "return"
+ [(return)
+ (use (reg:SI A0_REG))]
+ "reload_completed"
+ "*
+{
+ return (TARGET_DENSITY ? \"retw.n\" : \"retw\");
+}"
+ [(set_attr "type" "jump")
+ (set_attr "mode" "none")
+ (set_attr "length" "2")])
+
+
+;;
+;; ....................
+;;
+;; MISC.
+;;
+;; ....................
+;;
+
+(define_insn "nop"
+ [(const_int 0)]
+ ""
+ "*
+{
+ return (TARGET_DENSITY ? \"nop.n\" : \"nop\");
+}"
+ [(set_attr "type" "nop")
+ (set_attr "mode" "none")
+ (set_attr "length" "3")])
+
+(define_expand "nonlocal_goto"
+ [(match_operand:SI 0 "general_operand" "")
+ (match_operand:SI 1 "general_operand" "")
+ (match_operand:SI 2 "general_operand" "")
+ (match_operand:SI 3 "" "")]
+ ""
+ "
+{
+ xtensa_expand_nonlocal_goto (operands);
+ DONE;
+}")
+
+;; Setting up a frame pointer is tricky for Xtensa because GCC doesn't
+;; know if a frame pointer is required until the reload pass, and
+;; because there may be an incoming argument value in the hard frame
+;; pointer register (a7). If there is an incoming argument in that
+;; register, the "set_frame_ptr" insn gets inserted immediately after
+;; the insn that copies the incoming argument to a pseudo or to the
+;; stack. This serves several purposes here: (1) it keeps the
+;; optimizer from copy-propagating or scheduling the use of a7 as an
+;; incoming argument away from the beginning of the function; (2) we
+;; can use a post-reload splitter to expand away the insn if a frame
+;; pointer is not required, so that the post-reload scheduler can do
+;; the right thing; and (3) it makes it easy for xtensa_reorg() to
+;; search for this insn to determine whether it should add a new insn
+;; to set up the frame pointer.
+
+(define_insn "set_frame_ptr"
+ [(unspec_volatile [(const_int 0)] UNSPECV_SET_FP)]
+ ""
+ "*
+{
+ if (frame_pointer_needed)
+ return \"mov\\ta7, sp\";
+ return \"\";
+}"
+ [(set_attr "type" "move")
+ (set_attr "mode" "SI")
+ (set_attr "length" "3")])
+
+;; Post-reload splitter to remove fp assignment when it's not needed.
+(define_split
+ [(unspec_volatile [(const_int 0)] UNSPECV_SET_FP)]
+ "reload_completed && !frame_pointer_needed"
+ [(unspec [(const_int 0)] UNSPEC_NOP)]
+ "")
+
+;; The preceding splitter needs something to split the insn into;
+;; things start breaking if the result is just a "use" so instead we
+;; generate the following insn.
+(define_insn ""
+ [(unspec [(const_int 0)] UNSPEC_NOP)]
+ ""
+ ""
+ [(set_attr "type" "nop")
+ (set_attr "mode" "none")
+ (set_attr "length" "0")])
+
+;;
+;; ....................
+;;
+;; BOOLEANS
+;;
+;; ....................
+;;
+
+;; branch patterns
+
+(define_insn ""
+ [(set (pc)
+ (if_then_else (match_operator 2 "boolean_operator"
+ [(match_operand:CC 0 "register_operand" "b")
+ (const_int 0)])
+ (label_ref (match_operand 1 "" ""))
+ (pc)))]
+ "TARGET_BOOLEANS"
+ "*
+{
+ if (GET_CODE (operands[2]) == EQ)
+ return \"bf\\t%0, %1\";
+ else
+ return \"bt\\t%0, %1\";
+}"
+ [(set_attr "type" "jump")
+ (set_attr "mode" "none")
+ (set_attr "length" "3")])
+
+(define_insn ""
+ [(set (pc)
+ (if_then_else (match_operator 2 "boolean_operator"
+ [(match_operand:CC 0 "register_operand" "b")
+ (const_int 0)])
+ (pc)
+ (label_ref (match_operand 1 "" ""))))]
+ "TARGET_BOOLEANS"
+ "*
+{
+ if (GET_CODE (operands[2]) == EQ)
+ return \"bt\\t%0, %1\";
+ else
+ return \"bf\\t%0, %1\";
+}"
+ [(set_attr "type" "jump")
+ (set_attr "mode" "none")
+ (set_attr "length" "3")])
diff --git a/gcc/configure b/gcc/configure
index 6ec98d75760..f84c89e258c 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -14,46 +14,48 @@ ac_default_prefix=/usr/local
ac_help="$ac_help
--with-gnu-ld arrange to work with GNU ld."
ac_help="$ac_help
- --with-ld arrange to use the specified ld (full pathname)."
+ --with-ld arrange to use the specified ld (full pathname)"
ac_help="$ac_help
- --with-gnu-as arrange to work with GNU as."
+ --with-gnu-as arrange to work with GNU as"
ac_help="$ac_help
- --with-as arrange to use the specified as (full pathname)."
+ --with-as arrange to use the specified as (full pathname)"
ac_help="$ac_help
- --with-stabs arrange to use stabs instead of host debug format."
+ --with-stabs arrange to use stabs instead of host debug format"
ac_help="$ac_help
- --with-elf arrange to use ELF instead of host debug format."
+ --with-elf arrange to use ELF instead of host debug format"
ac_help="$ac_help
- --with-local-prefix=DIR specifies directory to put local include."
+ --with-local-prefix=DIR specifies directory to put local include"
ac_help="$ac_help
--with-gxx-include-dir=DIR
- specifies directory to put g++ header files."
+ specifies directory to put g++ header files"
ac_help="$ac_help
- --enable-multilib enable library support for multiple ABIs"
+ --enable-multilib enable library support for multiple ABIs"
ac_help="$ac_help
--enable-checking[=LIST]
enable expensive run-time checks. With LIST,
enable only specific categories of checks.
Categories are: misc,tree,rtl,gc,gcac; default
- is misc,tree,gc"
+ is no checking"
ac_help="$ac_help
- --disable-cpp don't provide a user-visible C preprocessor."
+ --disable-cpp don't provide a user-visible C preprocessor"
ac_help="$ac_help
--with-cpp-install-dir=DIR
install the user visible C preprocessor in DIR
- (relative to PREFIX) as well as PREFIX/bin."
+ (relative to PREFIX) as well as PREFIX/bin"
ac_help="$ac_help
- --enable-c-mbchar Enable multibyte characters for C and C++."
+ --enable-c-mbchar enable multibyte characters for C and C++"
ac_help="$ac_help
- --enable-threads enable thread usage for target GCC.
- --enable-threads=LIB use LIB thread package for target GCC."
+ --enable-threads enable thread usage for target GCC
+ --enable-threads=LIB use LIB thread package for target GCC"
ac_help="$ac_help
--enable-objc-gc enable the use of Boehm's garbage collector with
- the GNU Objective-C runtime."
+ the GNU Objective-C runtime"
ac_help="$ac_help
- --with-dwarf2 force the default debug format to be DWARF2."
+ --with-dwarf2 force the default debug format to be DWARF 2"
ac_help="$ac_help
- --disable-shared don't provide a shared libgcc."
+ --disable-shared don't provide a shared libgcc"
+ac_help="$ac_help
+ --with-libiconv-prefix=DIR search for libiconv in DIR/include and DIR/lib"
ac_help="$ac_help
--enable-nls use Native Language Support (default)"
ac_help="$ac_help
@@ -64,23 +66,28 @@ ac_help="$ac_help
--with-catgets use catgets functions if available"
ac_help="$ac_help
--disable-win32-registry
- Disable lookup of installation paths in the
- Registry on Windows hosts.
- --enable-win32-registry Enable registry lookup (default).
+ disable lookup of installation paths in the
+ Registry on Windows hosts
+ --enable-win32-registry enable registry lookup (default)
--enable-win32-registry=KEY
- Use KEY instead of GCC version as the last portion
- of the registry key."
+ use KEY instead of GCC version as the last portion
+ of the registry key"
ac_help="$ac_help
- --with-gc={simple,page} Choose the garbage collection mechanism to use
- with the compiler."
+ --with-gc={simple,page} choose the garbage collection mechanism to use
+ with the compiler"
ac_help="$ac_help
--with-system-zlib use installed libz"
ac_help="$ac_help
- --enable-maintainer-mode enable make rules and dependencies not useful
+ --enable-maintainer-mode
+ enable make rules and dependencies not useful
(and sometimes confusing) to the casual installer"
ac_help="$ac_help
- --enable-version-specific-runtime-libs Specify that runtime libraries shou
-ld be installed in a compiler-specific directory "
+ --enable-sjlj-exceptions
+ arrange to use setjmp/longjmp exception handling"
+ac_help="$ac_help
+ --enable-version-specific-runtime-libs
+ specify that runtime libraries should be
+ installed in a compiler-specific directory"
ac_help="$ac_help
--with-slibdir=DIR shared libraries in DIR [LIBDIR]"
@@ -100,6 +107,7 @@ program_suffix=NONE
program_transform_name=s,x,x,
silent=
site=
+sitefile=
srcdir=
target=NONE
verbose=
@@ -214,6 +222,7 @@ Configuration:
--help print this message
--no-create do not create output files
--quiet, --silent do not print \`checking...' messages
+ --site-file=FILE use FILE as the site file
--version print the version of autoconf that created configure
Directory and file names:
--prefix=PREFIX install architecture-independent files in PREFIX
@@ -384,6 +393,11 @@ EOF
-site=* | --site=* | --sit=*)
site="$ac_optarg" ;;
+ -site-file | --site-file | --site-fil | --site-fi | --site-f)
+ ac_prev=sitefile ;;
+ -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*)
+ sitefile="$ac_optarg" ;;
+
-srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
ac_prev=srcdir ;;
-srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
@@ -549,12 +563,16 @@ fi
srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
# Prefer explicitly selected file to automatically selected ones.
-if test -z "$CONFIG_SITE"; then
- if test "x$prefix" != xNONE; then
- CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
- else
- CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+if test -z "$sitefile"; then
+ if test -z "$CONFIG_SITE"; then
+ if test "x$prefix" != xNONE; then
+ CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+ else
+ CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+ fi
fi
+else
+ CONFIG_SITE="$sitefile"
fi
for ac_site_file in $CONFIG_SITE; do
if test -r "$ac_site_file"; then
@@ -609,7 +627,7 @@ copy=cp
# - two terminals occur directly after each other
# - the path contains an element with a dot in it
echo $ac_n "checking LIBRARY_PATH variable""... $ac_c" 1>&6
-echo "configure:613: checking LIBRARY_PATH variable" >&5
+echo "configure:631: checking LIBRARY_PATH variable" >&5
case ${LIBRARY_PATH} in
[:\;]* | *[:\;] | *[:\;][:\;]* | *[:\;]. | .[:\;]*| . | *[:\;].[:\;]* )
library_path_setting="contains current directory"
@@ -634,7 +652,7 @@ fi
# - two terminals occur directly after each other
# - the path contains an element with a dot in it
echo $ac_n "checking GCC_EXEC_PREFIX variable""... $ac_c" 1>&6
-echo "configure:638: checking GCC_EXEC_PREFIX variable" >&5
+echo "configure:656: checking GCC_EXEC_PREFIX variable" >&5
case ${GCC_EXEC_PREFIX} in
[:\;]* | *[:\;] | *[:\;][:\;]* | *[:\;]. | .[:\;]*| . | *[:\;].[:\;]* )
gcc_exec_prefix_setting="contains current directory"
@@ -813,9 +831,6 @@ no) ;;
;;
esac
-else
- # Enable some checks by default for development versions of GCC
-ac_checking=1; ac_tree_checking=1; ac_gc_checking=1;
fi
if test x$ac_checking != x ; then
@@ -907,7 +922,7 @@ case x${enable_threads_flag} in
target_thread_file=''
;;
xdecosf1 | xirix | xmach | xos2 | xposix | xpthreads | xsingle | \
- xsolaris | xwin32 | xdce | xvxworks | xaix)
+ xsolaris | xwin32 | xdce | xrtems| xvxworks | xaix)
target_thread_file=$enable_threads_flag
;;
*)
@@ -941,7 +956,21 @@ fi
# Check whether --enable-shared or --disable-shared was given.
if test "${enable_shared+set}" = set; then
enableval="$enable_shared"
- :
+
+ case $enable_shared in
+ yes | no) ;;
+ *)
+ enable_shared=no
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+ for pkg in $enableval; do
+ if test "X$pkg" = "Xgcc" || test "X$pkg" = "Xlibgcc"; then
+ enable_shared=yes
+ fi
+ done
+ IFS="$ac_save_ifs"
+ ;;
+ esac
+
else
enable_shared=yes
fi
@@ -996,7 +1025,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
fi
echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:1000: checking host system type" >&5
+echo "configure:1029: checking host system type" >&5
host_alias=$host
case "$host_alias" in
@@ -1017,7 +1046,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
echo "$ac_t""$host" 1>&6
echo $ac_n "checking target system type""... $ac_c" 1>&6
-echo "configure:1021: checking target system type" >&5
+echo "configure:1050: checking target system type" >&5
target_alias=$target
case "$target_alias" in
@@ -1035,7 +1064,7 @@ target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
echo "$ac_t""$target" 1>&6
echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:1039: checking build system type" >&5
+echo "configure:1068: checking build system type" >&5
build_alias=$build
case "$build_alias" in
@@ -1062,7 +1091,7 @@ test "$host_alias" != "$target_alias" &&
# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1066: checking for $ac_word" >&5
+echo "configure:1095: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1092,7 +1121,7 @@ if test -z "$CC"; then
# Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1096: checking for $ac_word" >&5
+echo "configure:1125: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1143,7 +1172,7 @@ fi
# Extract the first word of "cl", so it can be a program name with args.
set dummy cl; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1147: checking for $ac_word" >&5
+echo "configure:1176: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1175,7 +1204,7 @@ fi
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:1179: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:1208: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -1186,12 +1215,12 @@ cross_compiling=$ac_cv_prog_cc_cross
cat > conftest.$ac_ext << EOF
-#line 1190 "configure"
+#line 1219 "configure"
#include "confdefs.h"
main(){return(0);}
EOF
-if { (eval echo configure:1195: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1224: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ac_cv_prog_cc_works=yes
# If we can't run a trivial program, we are probably using a cross compiler.
if (./conftest; exit) 2>/dev/null; then
@@ -1217,12 +1246,12 @@ if test $ac_cv_prog_cc_works = no; then
{ echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:1221: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:1250: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
cross_compiling=$ac_cv_prog_cc_cross
echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:1226: checking whether we are using GNU C" >&5
+echo "configure:1255: checking whether we are using GNU C" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1231,7 +1260,7 @@ else
yes;
#endif
EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1235: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1264: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
ac_cv_prog_gcc=yes
else
ac_cv_prog_gcc=no
@@ -1250,7 +1279,7 @@ ac_test_CFLAGS="${CFLAGS+set}"
ac_save_CFLAGS="$CFLAGS"
CFLAGS=
echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:1254: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:1283: checking whether ${CC-cc} accepts -g" >&5
if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1283,10 +1312,10 @@ fi
if test "x$CC" != xcc; then
echo $ac_n "checking whether $CC and cc understand -c and -o together""... $ac_c" 1>&6
-echo "configure:1287: checking whether $CC and cc understand -c and -o together" >&5
+echo "configure:1316: checking whether $CC and cc understand -c and -o together" >&5
else
echo $ac_n "checking whether cc understands -c and -o together""... $ac_c" 1>&6
-echo "configure:1290: checking whether cc understands -c and -o together" >&5
+echo "configure:1319: checking whether cc understands -c and -o together" >&5
fi
set dummy $CC; ac_cc="`echo $2 |
sed -e 's/[^a-zA-Z0-9_]/_/g' -e 's/^[0-9]/_/'`"
@@ -1298,16 +1327,16 @@ else
# We do the test twice because some compilers refuse to overwrite an
# existing .o file with -o, though they will create one.
ac_try='${CC-cc} -c conftest.c -o conftest.o 1>&5'
-if { (eval echo configure:1302: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } &&
- test -f conftest.o && { (eval echo configure:1303: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; };
+if { (eval echo configure:1331: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } &&
+ test -f conftest.o && { (eval echo configure:1332: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; };
then
eval ac_cv_prog_cc_${ac_cc}_c_o=yes
if test "x$CC" != xcc; then
# Test first that cc exists at all.
- if { ac_try='cc -c conftest.c 1>&5'; { (eval echo configure:1308: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
+ if { ac_try='cc -c conftest.c 1>&5'; { (eval echo configure:1337: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
ac_try='cc -c conftest.c -o conftest.o 1>&5'
- if { (eval echo configure:1310: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } &&
- test -f conftest.o && { (eval echo configure:1311: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; };
+ if { (eval echo configure:1339: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } &&
+ test -f conftest.o && { (eval echo configure:1340: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; };
then
# cc works too.
:
@@ -1343,7 +1372,7 @@ fi
echo $ac_n "checking for long double""... $ac_c" 1>&6
-echo "configure:1347: checking for long double" >&5
+echo "configure:1376: 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
@@ -1351,7 +1380,7 @@ else
gcc_cv_c_long_double=yes
else
cat > conftest.$ac_ext <<EOF
-#line 1355 "configure"
+#line 1384 "configure"
#include "confdefs.h"
int main() {
@@ -1361,7 +1390,7 @@ long double foo = 0.0;
switch (0) case 0: case (sizeof(long double) >= sizeof(double)):;
; return 0; }
EOF
-if { (eval echo configure:1365: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1394: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gcc_cv_c_long_double=yes
else
@@ -1382,23 +1411,57 @@ EOF
fi
+echo $ac_n "checking for built-in _Bool""... $ac_c" 1>&6
+echo "configure:1416: 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 1421 "configure"
+#include "confdefs.h"
+
+int main() {
+_Bool foo;
+; return 0; }
+EOF
+if { (eval echo configure:1428: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ gcc_cv_c__bool=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ gcc_cv_c__bool=no
+fi
+rm -f conftest*
+
+fi
+
+echo "$ac_t""$gcc_cv_c__bool" 1>&6
+if test $gcc_cv_c__bool = yes; then
+ cat >> confdefs.h <<\EOF
+#define HAVE__BOOL 1
+EOF
+
+fi
+
echo $ac_n "checking whether ${CC-cc} accepts -Wno-long-long""... $ac_c" 1>&6
-echo "configure:1388: checking whether ${CC-cc} accepts -Wno-long-long" >&5
+echo "configure:1451: checking whether ${CC-cc} accepts -Wno-long-long" >&5
if eval "test \"`echo '$''{'ac_cv_prog_cc_no_long_long'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
save_CFLAGS="$CFLAGS"
CFLAGS="-Wno-long-long"
cat > conftest.$ac_ext <<EOF
-#line 1395 "configure"
+#line 1458 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
-if { (eval echo configure:1402: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1465: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_prog_cc_no_long_long=yes
else
@@ -1442,7 +1505,7 @@ esac
echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:1446: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:1509: 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
@@ -1470,7 +1533,7 @@ fi
echo $ac_n "checking whether a default assembler was specified""... $ac_c" 1>&6
-echo "configure:1474: checking whether a default assembler was specified" >&5
+echo "configure:1537: checking whether a default assembler was specified" >&5
if test x"${DEFAULT_ASSEMBLER+set}" = x"set"; then
if test x"$gas_flag" = x"no"; then
echo "$ac_t""yes ($DEFAULT_ASSEMBLER)" 1>&6
@@ -1482,7 +1545,7 @@ else
fi
echo $ac_n "checking whether a default linker was specified""... $ac_c" 1>&6
-echo "configure:1486: checking whether a default linker was specified" >&5
+echo "configure:1549: checking whether a default linker was specified" >&5
if test x"${DEFAULT_LINKER+set}" = x"set"; then
if test x"$gnu_ld_flag" = x"no"; then
echo "$ac_t""yes ($DEFAULT_LINKER)" 1>&6
@@ -1494,12 +1557,12 @@ else
fi
echo $ac_n "checking for GNU C library""... $ac_c" 1>&6
-echo "configure:1498: checking for GNU C library" >&5
+echo "configure:1561: 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 1503 "configure"
+#line 1566 "configure"
#include "confdefs.h"
#include <features.h>
int main() {
@@ -1509,7 +1572,7 @@ int main() {
#endif
; return 0; }
EOF
-if { (eval echo configure:1513: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1576: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gcc_cv_glibc=yes
else
@@ -1530,21 +1593,21 @@ EOF
fi
echo $ac_n "checking for inline""... $ac_c" 1>&6
-echo "configure:1534: checking for inline" >&5
+echo "configure:1597: checking for inline" >&5
if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_cv_c_inline=no
for ac_kw in inline __inline__ __inline; do
cat > conftest.$ac_ext <<EOF
-#line 1541 "configure"
+#line 1604 "configure"
#include "confdefs.h"
int main() {
} $ac_kw foo() {
; return 0; }
EOF
-if { (eval echo configure:1548: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1611: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_inline=$ac_kw; break
else
@@ -1571,12 +1634,12 @@ esac
# Find some useful tools
-for ac_prog in gawk mawk nawk awk
+for ac_prog in mawk gawk nawk awk
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:1580: checking for $ac_word" >&5
+echo "configure:1643: 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
@@ -1606,7 +1669,7 @@ test -n "$AWK" && break
done
echo $ac_n "checking whether ln works""... $ac_c" 1>&6
-echo "configure:1610: checking whether ln works" >&5
+echo "configure:1673: 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
@@ -1638,7 +1701,7 @@ else
fi
echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:1642: checking whether ln -s works" >&5
+echo "configure:1705: 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
@@ -1670,19 +1733,19 @@ else
fi
echo $ac_n "checking for volatile""... $ac_c" 1>&6
-echo "configure:1674: checking for volatile" >&5
+echo "configure:1737: 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 1679 "configure"
+#line 1742 "configure"
#include "confdefs.h"
int main() {
volatile int foo;
; return 0; }
EOF
-if { (eval echo configure:1686: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1749: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gcc_cv_c_volatile=yes
else
@@ -1705,7 +1768,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:1709: checking for $ac_word" >&5
+echo "configure:1772: 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
@@ -1743,7 +1806,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:1747: checking for a BSD compatible install" >&5
+echo "configure:1810: 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
@@ -1794,7 +1857,7 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:1798: checking how to run the C preprocessor" >&5
+echo "configure:1861: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
@@ -1809,13 +1872,13 @@ else
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp.
cat > conftest.$ac_ext <<EOF
-#line 1813 "configure"
+#line 1876 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1819: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1882: \"$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
:
@@ -1826,13 +1889,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
-#line 1830 "configure"
+#line 1893 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1836: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1899: \"$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
:
@@ -1843,13 +1906,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -nologo -E"
cat > conftest.$ac_ext <<EOF
-#line 1847 "configure"
+#line 1910 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1853: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1916: \"$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
:
@@ -1874,12 +1937,12 @@ fi
echo "$ac_t""$CPP" 1>&6
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:1878: checking for ANSI C header files" >&5
+echo "configure:1941: 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 1883 "configure"
+#line 1946 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
@@ -1887,7 +1950,7 @@ else
#include <float.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1891: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1954: \"$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*
@@ -1904,7 +1967,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 1908 "configure"
+#line 1971 "configure"
#include "confdefs.h"
#include <string.h>
EOF
@@ -1922,7 +1985,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 1926 "configure"
+#line 1989 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
@@ -1943,7 +2006,7 @@ if test "$cross_compiling" = yes; then
:
else
cat > conftest.$ac_ext <<EOF
-#line 1947 "configure"
+#line 2010 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -1954,7 +2017,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); }
EOF
-if { (eval echo configure:1958: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2021: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
:
else
@@ -1978,12 +2041,12 @@ EOF
fi
echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:1982: checking whether time.h and sys/time.h may both be included" >&5
+echo "configure:2045: 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 1987 "configure"
+#line 2050 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/time.h>
@@ -1992,7 +2055,7 @@ int main() {
struct tm *tp;
; return 0; }
EOF
-if { (eval echo configure:1996: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2059: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_header_time=yes
else
@@ -2012,13 +2075,46 @@ EOF
fi
+echo $ac_n "checking for working stdbool.h""... $ac_c" 1>&6
+echo "configure:2080: 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 2085 "configure"
+#include "confdefs.h"
+#include <stdbool.h>
+int main() {
+bool foo = false;
+; return 0; }
+EOF
+if { (eval echo configure:2092: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_cv_header_stdbool_h=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_cv_header_stdbool_h=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_header_stdbool_h" 1>&6
+if test $ac_cv_header_stdbool_h = yes; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_STDBOOL_H 1
+EOF
+
+fi
+
echo $ac_n "checking whether string.h and strings.h may both be included""... $ac_c" 1>&6
-echo "configure:2017: checking whether string.h and strings.h may both be included" >&5
+echo "configure:2113: 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 2022 "configure"
+#line 2118 "configure"
#include "confdefs.h"
#include <string.h>
#include <strings.h>
@@ -2026,7 +2122,7 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:2030: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2126: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gcc_cv_header_string=yes
else
@@ -2047,12 +2143,12 @@ EOF
fi
echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
-echo "configure:2051: checking for sys/wait.h that is POSIX.1 compatible" >&5
+echo "configure:2147: 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 2056 "configure"
+#line 2152 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/wait.h>
@@ -2068,7 +2164,7 @@ wait (&s);
s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
; return 0; }
EOF
-if { (eval echo configure:2072: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2168: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_header_sys_wait_h=yes
else
@@ -2091,21 +2187,21 @@ fi
for ac_hdr in limits.h stddef.h string.h strings.h stdlib.h time.h \
fcntl.h unistd.h stab.h sys/file.h sys/time.h \
sys/resource.h sys/param.h sys/times.h sys/stat.h \
- direct.h malloc.h langinfo.h iconv.h
+ direct.h malloc.h langinfo.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2099: checking for $ac_hdr" >&5
+echo "configure:2195: 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 2104 "configure"
+#line 2200 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2109: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2205: \"$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*
@@ -2135,17 +2231,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:2139: checking for thread.h" >&5
+echo "configure:2235: 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 2144 "configure"
+#line 2240 "configure"
#include "confdefs.h"
#include <thread.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2149: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2245: \"$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*
@@ -2169,17 +2265,17 @@ fi
ac_safe=`echo "pthread.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for pthread.h""... $ac_c" 1>&6
-echo "configure:2173: checking for pthread.h" >&5
+echo "configure:2269: 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 2178 "configure"
+#line 2274 "configure"
#include "confdefs.h"
#include <pthread.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2183: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2279: \"$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*
@@ -2206,7 +2302,7 @@ fi
# 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:2210: checking for $ac_word" >&5
+echo "configure:2306: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gnat'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2238,7 +2334,7 @@ fi
# 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:2242: checking for $ac_word" >&5
+echo "configure:2338: 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
@@ -2277,7 +2373,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:2281: checking for $ac_word" >&5
+echo "configure:2377: 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
@@ -2306,13 +2402,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:2310: checking for modern makeinfo" >&5
+echo "configure:2406: 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:2316: version of makeinfo is $ac_prog_version" >&5
+ echo "configure:2412: version of makeinfo is $ac_prog_version" >&5
case $ac_prog_version in
'') gcc_cv_prog_makeinfo_modern=no;;
4.*)
@@ -2340,7 +2436,7 @@ fi
# Is pod2man recent enough to regenerate manpages?
echo $ac_n "checking for recent Pod::Man""... $ac_c" 1>&6
-echo "configure:2344: checking for recent Pod::Man" >&5
+echo "configure:2440: 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
@@ -2356,7 +2452,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:2360: checking for $ac_word" >&5
+echo "configure:2456: 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
@@ -2393,7 +2489,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:2397: checking for $ac_word" >&5
+echo "configure:2493: 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
@@ -2427,12 +2523,12 @@ fi
echo $ac_n "checking for preprocessor stringizing operator""... $ac_c" 1>&6
-echo "configure:2431: checking for preprocessor stringizing operator" >&5
+echo "configure:2527: 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 2436 "configure"
+#line 2532 "configure"
#include "confdefs.h"
#define x(y) #y
@@ -2465,12 +2561,12 @@ 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:2469: checking for inttypes.h" >&5
+echo "configure:2565: 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 2474 "configure"
+#line 2570 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <inttypes.h>
@@ -2478,7 +2574,7 @@ int main() {
intmax_t i = -1;
; return 0; }
EOF
-if { (eval echo configure:2482: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2578: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gcc_cv_header_inttypes_h=yes
else
@@ -2503,7 +2599,7 @@ fi
# be either signed or unsigned.
#
echo $ac_n "checking for unsigned enumerated bitfields""... $ac_c" 1>&6
-echo "configure:2507: checking for unsigned enumerated bitfields" >&5
+echo "configure:2603: checking for unsigned enumerated bitfields" >&5
if eval "test \"`echo '$''{'gcc_cv_enum_bf_unsigned'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2511,7 +2607,7 @@ else
gcc_cv_enum_bf_unsigned=yes
else
cat > conftest.$ac_ext <<EOF
-#line 2515 "configure"
+#line 2611 "configure"
#include "confdefs.h"
#include <stdlib.h>
enum t { BLAH = 128 } ;
@@ -2524,7 +2620,7 @@ int main(void)
}
EOF
-if { (eval echo configure:2528: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2624: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
gcc_cv_enum_bf_unsigned=yes
else
@@ -2549,15 +2645,15 @@ fi
for ac_func in strtoul bsearch putenv popen bcopy \
strchr strrchr kill getrlimit setrlimit atoll atoq \
sysconf isascii gettimeofday strsignal putc_unlocked fputc_unlocked \
- fputs_unlocked getrusage iconv nl_langinfo
+ fputs_unlocked getrusage nl_langinfo lstat
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2556: checking for $ac_func" >&5
+echo "configure:2652: 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 2561 "configure"
+#line 2657 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -2580,7 +2676,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:2584: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2680: \"$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
@@ -2606,12 +2702,12 @@ done
echo $ac_n "checking for ssize_t""... $ac_c" 1>&6
-echo "configure:2610: checking for ssize_t" >&5
+echo "configure:2706: 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 2615 "configure"
+#line 2711 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -2642,12 +2738,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:2646: checking for uid_t in sys/types.h" >&5
+echo "configure:2742: 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 2651 "configure"
+#line 2747 "configure"
#include "confdefs.h"
#include <sys/types.h>
EOF
@@ -2676,7 +2772,7 @@ EOF
fi
echo $ac_n "checking type of array argument to getgroups""... $ac_c" 1>&6
-echo "configure:2680: checking type of array argument to getgroups" >&5
+echo "configure:2776: 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
@@ -2684,7 +2780,7 @@ else
ac_cv_type_getgroups=cross
else
cat > conftest.$ac_ext <<EOF
-#line 2688 "configure"
+#line 2784 "configure"
#include "confdefs.h"
/* Thanks to Mike Rendell for this test. */
@@ -2709,7 +2805,7 @@ main()
}
EOF
-if { (eval echo configure:2713: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2809: \"$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
@@ -2723,7 +2819,7 @@ fi
if test $ac_cv_type_getgroups = cross; then
cat > conftest.$ac_ext <<EOF
-#line 2727 "configure"
+#line 2823 "configure"
#include "confdefs.h"
#include <unistd.h>
EOF
@@ -2764,12 +2860,12 @@ fi
echo $ac_n "checking for vprintf""... $ac_c" 1>&6
-echo "configure:2768: checking for vprintf" >&5
+echo "configure:2864: checking for vprintf" >&5
if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2773 "configure"
+#line 2869 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char vprintf(); below. */
@@ -2792,7 +2888,7 @@ vprintf();
; return 0; }
EOF
-if { (eval echo configure:2796: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2892: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_vprintf=yes"
else
@@ -2816,12 +2912,12 @@ fi
if test "$ac_cv_func_vprintf" != yes; then
echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
-echo "configure:2820: checking for _doprnt" >&5
+echo "configure:2916: checking for _doprnt" >&5
if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2825 "configure"
+#line 2921 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char _doprnt(); below. */
@@ -2844,7 +2940,7 @@ _doprnt();
; return 0; }
EOF
-if { (eval echo configure:2848: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2944: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func__doprnt=yes"
else
@@ -2882,12 +2978,12 @@ fi
for ac_func in strstr
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2886: checking for $ac_func" >&5
+echo "configure:2982: 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 2891 "configure"
+#line 2987 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -2910,7 +3006,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:2914: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3010: \"$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
@@ -2937,7 +3033,7 @@ done
echo $ac_n "checking whether the printf functions support %p""... $ac_c" 1>&6
-echo "configure:2941: checking whether the printf functions support %p" >&5
+echo "configure:3037: 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
@@ -2945,7 +3041,7 @@ else
gcc_cv_func_printf_ptr=no
else
cat > conftest.$ac_ext <<EOF
-#line 2949 "configure"
+#line 3045 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -2958,7 +3054,7 @@ int main()
return (p != q);
}
EOF
-if { (eval echo configure:2962: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3058: \"$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
@@ -2990,12 +3086,12 @@ case "${host}" in
;;
esac
echo $ac_n "checking for pid_t""... $ac_c" 1>&6
-echo "configure:2994: checking for pid_t" >&5
+echo "configure:3090: 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 2999 "configure"
+#line 3095 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -3024,17 +3120,17 @@ fi
ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for vfork.h""... $ac_c" 1>&6
-echo "configure:3028: checking for vfork.h" >&5
+echo "configure:3124: 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 3033 "configure"
+#line 3129 "configure"
#include "confdefs.h"
#include <vfork.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3038: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3134: \"$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*
@@ -3059,18 +3155,18 @@ else
fi
echo $ac_n "checking for working vfork""... $ac_c" 1>&6
-echo "configure:3063: checking for working vfork" >&5
+echo "configure:3159: 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:3069: checking for vfork" >&5
+echo "configure:3165: 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 3074 "configure"
+#line 3170 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char vfork(); below. */
@@ -3093,7 +3189,7 @@ vfork();
; return 0; }
EOF
-if { (eval echo configure:3097: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3193: \"$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
@@ -3115,7 +3211,7 @@ fi
ac_cv_func_vfork_works=$ac_cv_func_vfork
else
cat > conftest.$ac_ext <<EOF
-#line 3119 "configure"
+#line 3215 "configure"
#include "confdefs.h"
/* Thanks to Paul Eggert for this test. */
#include <stdio.h>
@@ -3210,7 +3306,7 @@ main() {
}
}
EOF
-if { (eval echo configure:3214: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3310: \"$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
@@ -3235,12 +3331,12 @@ fi
for ac_func in getpagesize
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3239: checking for $ac_func" >&5
+echo "configure:3335: 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 3244 "configure"
+#line 3340 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -3263,7 +3359,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:3267: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3363: \"$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
@@ -3534,7 +3630,7 @@ main ()
EOF
echo $ac_n "checking for working mmap from /dev/zero""... $ac_c" 1>&6
-echo "configure:3538: checking for working mmap from /dev/zero" >&5
+echo "configure:3634: checking for working mmap from /dev/zero" >&5
if eval "test \"`echo '$''{'ac_cv_func_mmap_dev_zero'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3550,11 +3646,11 @@ else
esac
else
cat > conftest.$ac_ext <<EOF
-#line 3554 "configure"
+#line 3650 "configure"
#include "confdefs.h"
#include "ct-mmap.inc"
EOF
-if { (eval echo configure:3558: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3654: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_func_mmap_dev_zero=yes
else
@@ -3581,7 +3677,7 @@ EOF
fi
echo $ac_n "checking for working mmap with MAP_ANON(YMOUS)""... $ac_c" 1>&6
-echo "configure:3585: checking for working mmap with MAP_ANON(YMOUS)" >&5
+echo "configure:3681: checking for working mmap with MAP_ANON(YMOUS)" >&5
if eval "test \"`echo '$''{'ac_cv_func_mmap_anon'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3591,12 +3687,12 @@ else
ac_cv_func_mmap_anon=no
else
cat > conftest.$ac_ext <<EOF
-#line 3595 "configure"
+#line 3691 "configure"
#include "confdefs.h"
#define USE_MAP_ANON
#include "ct-mmap.inc"
EOF
-if { (eval echo configure:3600: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3696: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_func_mmap_anon=yes
else
@@ -3624,7 +3720,7 @@ fi
rm -f ct-mmap.inc
echo $ac_n "checking for working mmap of a file""... $ac_c" 1>&6
-echo "configure:3628: checking for working mmap of a file" >&5
+echo "configure:3724: checking for working mmap of a file" >&5
if eval "test \"`echo '$''{'ac_cv_func_mmap_file'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3639,7 +3735,7 @@ if test "$cross_compiling" = yes; then
ac_cv_func_mmap_file=no
else
cat > conftest.$ac_ext <<EOF
-#line 3643 "configure"
+#line 3739 "configure"
#include "confdefs.h"
/* Test by Zack Weinberg. Modified from MMAP_ANYWHERE test by
@@ -3676,7 +3772,7 @@ int main()
exit(0);
}
EOF
-if { (eval echo configure:3680: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3776: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_func_mmap_file=yes
else
@@ -3699,6 +3795,136 @@ EOF
fi
+
+
+ am_cv_lib_iconv_ldpath=
+ # Check whether --with-libiconv-prefix or --without-libiconv-prefix was given.
+if test "${with_libiconv_prefix+set}" = set; then
+ withval="$with_libiconv_prefix"
+
+ for dir in `echo "$withval" | tr : ' '`; do
+ if test -d $dir/include; then CPPFLAGS="$CPPFLAGS -I$dir/include"; fi
+ if test -d $dir/lib; then am_cv_lib_iconv_ldpath="-L$dir/lib"; fi
+ done
+
+fi
+
+
+ echo $ac_n "checking for iconv""... $ac_c" 1>&6
+echo "configure:3815: checking for iconv" >&5
+if eval "test \"`echo '$''{'am_cv_func_iconv'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+
+ am_cv_func_iconv="no, consider installing GNU libiconv"
+ am_cv_lib_iconv=no
+ cat > conftest.$ac_ext <<EOF
+#line 3823 "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+#include <iconv.h>
+int main() {
+iconv_t cd = iconv_open("","");
+ iconv(cd,NULL,NULL,NULL,NULL);
+ iconv_close(cd);
+; return 0; }
+EOF
+if { (eval echo configure:3833: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ am_cv_func_iconv=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+fi
+rm -f conftest*
+ if test "$am_cv_func_iconv" != yes; then
+ am_save_LIBS="$LIBS"
+ LIBS="$LIBS $am_cv_libiconv_ldpath -liconv"
+ cat > conftest.$ac_ext <<EOF
+#line 3845 "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+#include <iconv.h>
+int main() {
+iconv_t cd = iconv_open("","");
+ iconv(cd,NULL,NULL,NULL,NULL);
+ iconv_close(cd);
+; return 0; }
+EOF
+if { (eval echo configure:3855: \"$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
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+fi
+rm -f conftest*
+ LIBS="$am_save_LIBS"
+ fi
+
+fi
+
+echo "$ac_t""$am_cv_func_iconv" 1>&6
+ if test "$am_cv_func_iconv" = yes; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_ICONV 1
+EOF
+
+ echo $ac_n "checking for iconv declaration""... $ac_c" 1>&6
+echo "configure:3876: 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 3882 "configure"
+#include "confdefs.h"
+
+#include <stdlib.h>
+#include <iconv.h>
+extern
+#ifdef __cplusplus
+"C"
+#endif
+#if defined(__STDC__) || defined(__cplusplus)
+size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
+#else
+size_t iconv();
+#endif
+
+int main() {
+
+; return 0; }
+EOF
+if { (eval echo configure:3901: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ am_cv_proto_iconv_arg1=""
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ am_cv_proto_iconv_arg1="const"
+fi
+rm -f conftest*
+ am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"
+fi
+
+ am_cv_proto_iconv=`echo "$am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
+ echo "$ac_t""${ac_t:-
+ }$am_cv_proto_iconv" 1>&6
+ cat >> confdefs.h <<EOF
+#define ICONV_CONST $am_cv_proto_iconv_arg1
+EOF
+
+ fi
+ LIBICONV=
+ if test "$am_cv_lib_iconv" = yes; then
+ LIBICONV="$am_cv_lib_iconv_ldpath -liconv"
+ fi
+
+
+
# We will need to find libiberty.h and ansidecl.h
saved_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -I${srcdir} -I${srcdir}/../include"
@@ -3709,13 +3935,16 @@ for ac_func in bcopy \
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:3713: checking whether $ac_func is declared" >&5
+echo "configure:3939: 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 3718 "configure"
+#line 3944 "configure"
#include "confdefs.h"
+#undef $ac_tr_decl
+#define $ac_tr_decl 1
+
#include "gansidecl.h"
#include "system.h"
@@ -3725,7 +3954,7 @@ char *(*pfn) = (char *(*)) $ac_func ;
#endif
; return 0; }
EOF
-if { (eval echo configure:3729: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3958: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
eval "gcc_cv_have_decl_$ac_func=yes"
else
@@ -3751,64 +3980,64 @@ fi
done
if test x = y ; then
- cat >> confdefs.h <<EOF
+ cat >> confdefs.h <<\EOF
#define HAVE_DECL_BCOPY 1
EOF
\
- cat >> confdefs.h <<EOF
+ cat >> confdefs.h <<\EOF
#define HAVE_DECL_GETENV 1
EOF
- cat >> confdefs.h <<EOF
+ cat >> confdefs.h <<\EOF
#define HAVE_DECL_ATOL 1
EOF
- cat >> confdefs.h <<EOF
+ cat >> confdefs.h <<\EOF
#define HAVE_DECL_SBRK 1
EOF
- cat >> confdefs.h <<EOF
+ cat >> confdefs.h <<\EOF
#define HAVE_DECL_ABORT 1
EOF
- cat >> confdefs.h <<EOF
+ cat >> confdefs.h <<\EOF
#define HAVE_DECL_ATOF 1
EOF
- cat >> confdefs.h <<EOF
+ cat >> confdefs.h <<\EOF
#define HAVE_DECL_GETCWD 1
EOF
- cat >> confdefs.h <<EOF
+ cat >> confdefs.h <<\EOF
#define HAVE_DECL_GETWD 1
EOF
\
- cat >> confdefs.h <<EOF
+ cat >> confdefs.h <<\EOF
#define HAVE_DECL_STRSIGNAL 1
EOF
- cat >> confdefs.h <<EOF
+ cat >> confdefs.h <<\EOF
#define HAVE_DECL_PUTC_UNLOCKED 1
EOF
- cat >> confdefs.h <<EOF
+ cat >> confdefs.h <<\EOF
#define HAVE_DECL_FPUTS_UNLOCKED 1
EOF
- cat >> confdefs.h <<EOF
+ cat >> confdefs.h <<\EOF
#define HAVE_DECL_STRSTR 1
EOF
- cat >> confdefs.h <<EOF
+ cat >> confdefs.h <<\EOF
#define HAVE_DECL_ENVIRON 1
EOF
\
- cat >> confdefs.h <<EOF
+ cat >> confdefs.h <<\EOF
#define HAVE_DECL_MALLOC 1
EOF
- cat >> confdefs.h <<EOF
+ cat >> confdefs.h <<\EOF
#define HAVE_DECL_REALLOC 1
EOF
- cat >> confdefs.h <<EOF
+ cat >> confdefs.h <<\EOF
#define HAVE_DECL_CALLOC 1
EOF
- cat >> confdefs.h <<EOF
+ cat >> confdefs.h <<\EOF
#define HAVE_DECL_FREE 1
EOF
- cat >> confdefs.h <<EOF
+ cat >> confdefs.h <<\EOF
#define HAVE_DECL_BASENAME 1
EOF
- cat >> confdefs.h <<EOF
+ cat >> confdefs.h <<\EOF
#define HAVE_DECL_GETOPT 1
EOF
fi
@@ -3818,13 +4047,16 @@ 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:3822: checking whether $ac_func is declared" >&5
+echo "configure:4051: 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 3827 "configure"
+#line 4056 "configure"
#include "confdefs.h"
+#undef $ac_tr_decl
+#define $ac_tr_decl 1
+
#include "gansidecl.h"
#include "system.h"
#ifdef HAVE_SYS_RESOURCE_H
@@ -3838,7 +4070,7 @@ char *(*pfn) = (char *(*)) $ac_func ;
#endif
; return 0; }
EOF
-if { (eval echo configure:3842: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4074: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
eval "gcc_cv_have_decl_$ac_func=yes"
else
@@ -3864,13 +4096,13 @@ fi
done
if test x = y ; then
- cat >> confdefs.h <<EOF
+ cat >> confdefs.h <<\EOF
#define HAVE_DECL_GETRLIMIT 1
EOF
- cat >> confdefs.h <<EOF
+ cat >> confdefs.h <<\EOF
#define HAVE_DECL_SETRLIMIT 1
EOF
- cat >> confdefs.h <<EOF
+ cat >> confdefs.h <<\EOF
#define HAVE_DECL_GETRUSAGE 1
EOF
fi
@@ -3881,12 +4113,12 @@ CFLAGS="$saved_CFLAGS"
# mkdir takes a single argument on some systems.
echo $ac_n "checking if mkdir takes one argument""... $ac_c" 1>&6
-echo "configure:3885: checking if mkdir takes one argument" >&5
+echo "configure:4117: 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 3890 "configure"
+#line 4122 "configure"
#include "confdefs.h"
#include <sys/types.h>
@@ -3903,7 +4135,7 @@ int main() {
mkdir ("foo", 0);
; return 0; }
EOF
-if { (eval echo configure:3907: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4139: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gcc_cv_mkdir_takes_one_arg=no
else
@@ -3990,9 +4222,46 @@ then
fi
# Say what files are being used for the output code and MD file.
-echo "Using \`$srcdir/config/$out_file' to output insns."
+echo "Using \`$srcdir/config/$out_file' for machine-specific logic."
echo "Using \`$srcdir/config/$md_file' as machine description file."
+# If any of the xm_file variables contain nonexistent files, warn
+# about them and drop them. But $cpu/xm-$cpu.h is allowed not to
+# exist, if we have nothing for it to do.
+
+bx=
+for x in $build_xm_file; do
+ if test -f $srcdir/config/$x
+ then bx="$bx $x"
+ elif echo $x | grep '\(a-z0-9a-z0-9*\)/xm-\1\.h' >/dev/null
+ then :
+ else echo "configure: warning: $srcdir/config/$x does not exist." 1>&2
+ fi
+done
+build_xm_file="$bx"
+
+hx=
+for x in $host_xm_file; do
+ if test -f $srcdir/config/$x
+ then hx="$hx $x"
+ elif echo $x | grep '\(a-z0-9a-z0-9*\)/xm-\1\.h' >/dev/null
+ then :
+ else echo "configure: warning: $srcdir/config/$x does not exist." 1>&2
+ fi
+done
+host_xm_file="$hx"
+
+tx=
+for x in $xm_file; do
+ if test -f $srcdir/config/$x
+ then tx="$tx $x"
+ elif echo $x | grep '\(a-z0-9a-z0-9*\)/xm-\1\.h' >/dev/null
+ then :
+ else echo "configure: warning: $srcdir/config/$x does not exist." 1>&2
+ fi
+done
+xm_file="$tx"
+
count=a
for f in $tm_file; do
count=${count}x
@@ -4010,7 +4279,9 @@ count=a
for f in $host_xm_file; do
count=${count}x
done
-if test $count = ax; then
+if test $count = a; then
+ :
+elif test $count = ax; then
echo "Using \`$srcdir/config/$host_xm_file' as host machine macro file."
else
echo "Using the following host machine macro files:"
@@ -4024,7 +4295,9 @@ if test "$host_xm_file" != "$build_xm_file"; then
for f in $build_xm_file; do
count=${count}x
done
- if test $count = ax; then
+ if test $count = a; then
+ :
+ elif test $count = ax; then
echo "Using \`$srcdir/config/$build_xm_file' as build machine macro file."
else
echo "Using the following build machine macro files:"
@@ -4042,12 +4315,8 @@ if test x$thread_file = x; then
fi
fi
-# Set up the header files.
-# $links is the list of header files to create.
-# $vars is the list of shell variables with file names to include.
# auto-host.h is the file containing items generated by autoconf and is
# the first file included by config.h.
-null_defines=
host_xm_file="auto-host.h gansidecl.h ${host_xm_file} defaults.h hwint.h"
# If host=build, it is correct to have hconfig include auto-host.h
@@ -4083,65 +4352,6 @@ fi
xm_file="gansidecl.h ${xm_file} defaults.h"
tm_file="gansidecl.h ${tm_file} defaults.h"
-vars="host_xm_file tm_file tm_p_file xm_file build_xm_file"
-links="config.h tm.h tm_p.h tconfig.h hconfig.h"
-defines="host_xm_defines null_defines null_defines xm_defines build_xm_defines"
-
-rm -f config.bak
-if test -f config.status; then mv -f config.status config.bak; fi
-
-# Make the links.
-while test -n "$vars"
-do
- set $vars; var=$1; shift; vars=$*
- set $links; link=$1; shift; links=$*
- set $defines; define=$1; shift; defines=$*
-
- rm -f $link
- # Make sure the file is created, even if it is empty.
- echo >$link
-
- # Define TARGET_CPU_DEFAULT if the system wants one.
- # This substitutes for lots of *.h files.
- if test "$target_cpu_default" != "" -a $link = tm.h
- then
- echo "#define TARGET_CPU_DEFAULT ($target_cpu_default)" >>$link
- fi
-
- for file in `eval echo '$'$var`; do
- case $file in
- auto-host.h | auto-build.h )
- ;;
- *)
- echo '#ifdef IN_GCC' >>$link
- ;;
- esac
- echo "#include \"$file\"" >>$link
- case $file in
- auto-host.h | auto-build.h )
- ;;
- *)
- echo '#endif' >>$link
- ;;
- esac
- done
-
- for def in `eval echo '$'$define`; do
- echo "#ifndef $def" >>$link
- echo "#define $def" >>$link
- echo "#endif" >>$link
- done
-
- if test $link = tm.h
- then
- # Include insn-codes.h last, because it includes machmode.h,
- # and we want EXTRA_CC_MODES to be taken into account.
- echo "#ifndef GENERATOR_FILE" >>$link
- echo "#include \"insn-codes.h\"" >>$link
- echo "#endif" >>$link
- fi
-done
-
# Truncate the target if necessary
if test x$host_truncate_target != x; then
target=`echo $target | sed -e 's/\(..............\).*/\1/'`
@@ -4153,13 +4363,13 @@ if test "${with_gcc_version_trigger+set}" = set; then
else
gcc_version_trigger=${srcdir}/version.c
fi
-gcc_version_full=`grep version_string ${gcc_version_trigger} | sed -e 's/.*\"\([^\"]*\)\".*/\1/'`
+gcc_version_full=`grep version_string ${gcc_version_trigger} | sed -e 's/.*"\([^"]*\)".*/\1/'`
gcc_version=`echo ${gcc_version_full} | sed -e 's/\([^ ]*\) .*/\1/'`
# Compile in configure arguments.
if test -f configargs.h ; then
# Being re-configured.
- gcc_config_arguments=`grep configuration_arguments configargs.h | sed -e 's/.*\"\([^\"]*\)\".*/\1/'`
+ gcc_config_arguments=`grep configuration_arguments configargs.h | sed -e 's/.*"\([^"]*\)".*/\1/'`
gcc_config_arguments="$gcc_config_arguments : (reconfigured) $TOPLEVEL_CONFIGURE_ARGUMENTS"
else
gcc_config_arguments="$TOPLEVEL_CONFIGURE_ARGUMENTS"
@@ -4167,6 +4377,7 @@ fi
cat > configargs.h <<EOF
/* Generated automatically. */
static const char configuration_arguments[] = "$gcc_config_arguments";
+static const char thread_model[] = "$thread_file";
EOF
# Internationalization
@@ -4183,7 +4394,7 @@ EOF
-ALL_LINGUAS="sv"
+ALL_LINGUAS=
# Enable NLS support by default
# Check whether --enable-nls or --disable-nls was given.
@@ -4214,7 +4425,7 @@ fi
echo $ac_n "checking for strerror in -lcposix""... $ac_c" 1>&6
-echo "configure:4218: checking for strerror in -lcposix" >&5
+echo "configure:4429: checking for strerror in -lcposix" >&5
ac_lib_var=`echo cposix'_'strerror | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -4222,7 +4433,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lcposix $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 4226 "configure"
+#line 4437 "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
@@ -4233,7 +4444,7 @@ int main() {
strerror()
; return 0; }
EOF
-if { (eval echo configure:4237: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4448: \"$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
@@ -4256,12 +4467,12 @@ fi
echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:4260: checking for working const" >&5
+echo "configure:4471: 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 4265 "configure"
+#line 4476 "configure"
#include "confdefs.h"
int main() {
@@ -4310,7 +4521,7 @@ ccp = (char const *const *) p;
; return 0; }
EOF
-if { (eval echo configure:4314: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4525: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_const=yes
else
@@ -4331,12 +4542,12 @@ EOF
fi
echo $ac_n "checking for off_t""... $ac_c" 1>&6
-echo "configure:4335: checking for off_t" >&5
+echo "configure:4546: 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 4340 "configure"
+#line 4551 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -4364,12 +4575,12 @@ EOF
fi
echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:4368: checking for size_t" >&5
+echo "configure:4579: 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 4373 "configure"
+#line 4584 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -4399,19 +4610,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:4403: checking for working alloca.h" >&5
+echo "configure:4614: 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 4408 "configure"
+#line 4619 "configure"
#include "confdefs.h"
#include <alloca.h>
int main() {
char *p = alloca(2 * sizeof(int));
; return 0; }
EOF
-if { (eval echo configure:4415: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4626: \"$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
@@ -4432,12 +4643,12 @@ EOF
fi
echo $ac_n "checking for alloca""... $ac_c" 1>&6
-echo "configure:4436: checking for alloca" >&5
+echo "configure:4647: 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 4441 "configure"
+#line 4652 "configure"
#include "confdefs.h"
#ifdef __GNUC__
@@ -4465,7 +4676,7 @@ int main() {
char *p = (char *) alloca(1);
; return 0; }
EOF
-if { (eval echo configure:4469: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4680: \"$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
@@ -4497,12 +4708,12 @@ EOF
echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-echo "configure:4501: checking whether alloca needs Cray hooks" >&5
+echo "configure:4712: 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 4506 "configure"
+#line 4717 "configure"
#include "confdefs.h"
#if defined(CRAY) && ! defined(CRAY2)
webecray
@@ -4527,12 +4738,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:4531: checking for $ac_func" >&5
+echo "configure:4742: 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 4536 "configure"
+#line 4747 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -4555,7 +4766,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:4559: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4770: \"$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
@@ -4582,7 +4793,7 @@ done
fi
echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-echo "configure:4586: checking stack direction for C alloca" >&5
+echo "configure:4797: 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
@@ -4590,7 +4801,7 @@ else
ac_cv_c_stack_direction=0
else
cat > conftest.$ac_ext <<EOF
-#line 4594 "configure"
+#line 4805 "configure"
#include "confdefs.h"
find_stack_direction ()
{
@@ -4609,7 +4820,7 @@ main ()
exit (find_stack_direction() < 0);
}
EOF
-if { (eval echo configure:4613: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:4824: \"$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
@@ -4636,17 +4847,17 @@ unistd.h sys/param.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4640: checking for $ac_hdr" >&5
+echo "configure:4851: 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 4645 "configure"
+#line 4856 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4650: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4861: \"$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*
@@ -4676,12 +4887,12 @@ done
strdup __argz_count __argz_stringify __argz_next
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4680: checking for $ac_func" >&5
+echo "configure:4891: 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 4685 "configure"
+#line 4896 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -4704,7 +4915,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:4708: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4919: \"$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
@@ -4733,12 +4944,12 @@ done
for ac_func in stpcpy
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4737: checking for $ac_func" >&5
+echo "configure:4948: 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 4742 "configure"
+#line 4953 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -4761,7 +4972,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:4765: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4976: \"$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
@@ -4795,19 +5006,19 @@ EOF
if test $ac_cv_header_locale_h = yes; then
echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6
-echo "configure:4799: checking for LC_MESSAGES" >&5
+echo "configure:5010: 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 4804 "configure"
+#line 5015 "configure"
#include "confdefs.h"
#include <locale.h>
int main() {
return LC_MESSAGES
; return 0; }
EOF
-if { (eval echo configure:4811: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5022: \"$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
@@ -4828,7 +5039,7 @@ EOF
fi
fi
echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6
-echo "configure:4832: checking whether NLS is requested" >&5
+echo "configure:5043: 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"
@@ -4848,7 +5059,7 @@ fi
EOF
echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6
-echo "configure:4852: checking whether included gettext is requested" >&5
+echo "configure:5063: 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"
@@ -4867,17 +5078,17 @@ fi
ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for libintl.h""... $ac_c" 1>&6
-echo "configure:4871: checking for libintl.h" >&5
+echo "configure:5082: 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 4876 "configure"
+#line 5087 "configure"
#include "confdefs.h"
#include <libintl.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4881: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5092: \"$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*
@@ -4894,19 +5105,19 @@ fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
echo "$ac_t""yes" 1>&6
echo $ac_n "checking for gettext in libc""... $ac_c" 1>&6
-echo "configure:4898: checking for gettext in libc" >&5
+echo "configure:5109: checking for gettext in libc" >&5
if eval "test \"`echo '$''{'gt_cv_func_gettext_libc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4903 "configure"
+#line 5114 "configure"
#include "confdefs.h"
#include <libintl.h>
int main() {
return (int) gettext ("")
; return 0; }
EOF
-if { (eval echo configure:4910: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5121: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
gt_cv_func_gettext_libc=yes
else
@@ -4922,7 +5133,7 @@ echo "$ac_t""$gt_cv_func_gettext_libc" 1>&6
if test "$gt_cv_func_gettext_libc" != "yes"; then
echo $ac_n "checking for bindtextdomain in -lintl""... $ac_c" 1>&6
-echo "configure:4926: checking for bindtextdomain in -lintl" >&5
+echo "configure:5137: checking for bindtextdomain in -lintl" >&5
ac_lib_var=`echo intl'_'bindtextdomain | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -4930,7 +5141,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lintl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 4934 "configure"
+#line 5145 "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
@@ -4941,7 +5152,7 @@ int main() {
bindtextdomain()
; return 0; }
EOF
-if { (eval echo configure:4945: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5156: \"$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
@@ -4957,12 +5168,12 @@ fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
echo $ac_n "checking for gettext in libintl""... $ac_c" 1>&6
-echo "configure:4961: checking for gettext in libintl" >&5
+echo "configure:5172: checking for gettext in libintl" >&5
if eval "test \"`echo '$''{'gt_cv_func_gettext_libintl'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
echo $ac_n "checking for gettext in -lintl""... $ac_c" 1>&6
-echo "configure:4966: checking for gettext in -lintl" >&5
+echo "configure:5177: checking for gettext in -lintl" >&5
ac_lib_var=`echo intl'_'gettext | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -4970,7 +5181,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lintl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 4974 "configure"
+#line 5185 "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
@@ -4981,7 +5192,7 @@ int main() {
gettext()
; return 0; }
EOF
-if { (eval echo configure:4985: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5196: \"$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
@@ -5024,7 +5235,7 @@ EOF
# Extract the first word of "msgfmt", so it can be a program name with args.
set dummy msgfmt; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:5028: checking for $ac_word" >&5
+echo "configure:5239: checking for $ac_word" >&5
if eval "test \"`echo '$''{'gcc_cv_path_MSGFMT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -5058,12 +5269,12 @@ fi
for ac_func in dcgettext
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5062: checking for $ac_func" >&5
+echo "configure:5273: 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 5067 "configure"
+#line 5278 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -5086,7 +5297,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:5090: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5301: \"$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
@@ -5113,7 +5324,7 @@ done
# Extract the first word of "gmsgfmt", so it can be a program name with args.
set dummy gmsgfmt; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:5117: checking for $ac_word" >&5
+echo "configure:5328: checking for $ac_word" >&5
if eval "test \"`echo '$''{'gcc_cv_path_GMSGFMT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -5149,7 +5360,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:5153: checking for $ac_word" >&5
+echo "configure:5364: checking for $ac_word" >&5
if eval "test \"`echo '$''{'gcc_cv_path_XGETTEXT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -5181,7 +5392,7 @@ else
fi
cat > conftest.$ac_ext <<EOF
-#line 5185 "configure"
+#line 5396 "configure"
#include "confdefs.h"
int main() {
@@ -5189,7 +5400,7 @@ extern int _nl_msg_cat_cntr;
return _nl_msg_cat_cntr
; return 0; }
EOF
-if { (eval echo configure:5193: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5404: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
CATOBJEXT=.gmo
DATADIRNAME=share
@@ -5214,7 +5425,7 @@ fi
if test "$CATOBJEXT" = "NONE"; then
echo $ac_n "checking whether catgets can be used""... $ac_c" 1>&6
-echo "configure:5218: checking whether catgets can be used" >&5
+echo "configure:5429: checking whether catgets can be used" >&5
# Check whether --with-catgets or --without-catgets was given.
if test "${with_catgets+set}" = set; then
withval="$with_catgets"
@@ -5227,7 +5438,7 @@ fi
if test "$nls_cv_use_catgets" = "yes"; then
echo $ac_n "checking for main in -li""... $ac_c" 1>&6
-echo "configure:5231: checking for main in -li" >&5
+echo "configure:5442: checking for main in -li" >&5
ac_lib_var=`echo i'_'main | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -5235,14 +5446,14 @@ else
ac_save_LIBS="$LIBS"
LIBS="-li $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 5239 "configure"
+#line 5450 "configure"
#include "confdefs.h"
int main() {
main()
; return 0; }
EOF
-if { (eval echo configure:5246: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5457: \"$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
@@ -5270,12 +5481,12 @@ else
fi
echo $ac_n "checking for catgets""... $ac_c" 1>&6
-echo "configure:5274: checking for catgets" >&5
+echo "configure:5485: checking for catgets" >&5
if eval "test \"`echo '$''{'ac_cv_func_catgets'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5279 "configure"
+#line 5490 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char catgets(); below. */
@@ -5298,7 +5509,7 @@ catgets();
; return 0; }
EOF
-if { (eval echo configure:5302: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5513: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_catgets=yes"
else
@@ -5320,7 +5531,7 @@ EOF
# Extract the first word of "gencat", so it can be a program name with args.
set dummy gencat; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:5324: checking for $ac_word" >&5
+echo "configure:5535: checking for $ac_word" >&5
if eval "test \"`echo '$''{'gcc_cv_path_GENCAT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -5356,7 +5567,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:5360: checking for $ac_word" >&5
+echo "configure:5571: checking for $ac_word" >&5
if eval "test \"`echo '$''{'gcc_cv_path_GMSGFMT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -5393,7 +5604,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:5397: checking for $ac_word" >&5
+echo "configure:5608: checking for $ac_word" >&5
if eval "test \"`echo '$''{'gcc_cv_path_GMSGFMT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -5431,7 +5642,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:5435: checking for $ac_word" >&5
+echo "configure:5646: checking for $ac_word" >&5
if eval "test \"`echo '$''{'gcc_cv_path_XGETTEXT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -5489,7 +5700,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:5493: checking for $ac_word" >&5
+echo "configure:5704: checking for $ac_word" >&5
if eval "test \"`echo '$''{'gcc_cv_path_MSGFMT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -5523,7 +5734,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:5527: checking for $ac_word" >&5
+echo "configure:5738: checking for $ac_word" >&5
if eval "test \"`echo '$''{'gcc_cv_path_GMSGFMT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -5562,7 +5773,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:5566: checking for $ac_word" >&5
+echo "configure:5777: checking for $ac_word" >&5
if eval "test \"`echo '$''{'gcc_cv_path_XGETTEXT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -5661,7 +5872,7 @@ fi
LINGUAS=
else
echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6
-echo "configure:5665: checking for catalogs to be installed" >&5
+echo "configure:5876: checking for catalogs to be installed" >&5
if test "x$LINGUAS" = "x"; then
LINGUAS=$ALL_LINGUAS
else
@@ -5693,17 +5904,17 @@ echo "configure:5665: checking for catalogs to be installed" >&5
if test "$CATOBJEXT" = ".cat"; then
ac_safe=`echo "linux/version.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for linux/version.h""... $ac_c" 1>&6
-echo "configure:5697: checking for linux/version.h" >&5
+echo "configure:5908: checking for linux/version.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5702 "configure"
+#line 5913 "configure"
#include "confdefs.h"
#include <linux/version.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5707: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5918: \"$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*
@@ -5778,7 +5989,7 @@ fi
echo $ac_n "checking whether windows registry support is requested""... $ac_c" 1>&6
-echo "configure:5782: checking whether windows registry support is requested" >&5
+echo "configure:5993: 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
@@ -5807,7 +6018,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:5811: checking registry key on windows hosts" >&5
+echo "configure:6022: checking registry key on windows hosts" >&5
cat >> confdefs.h <<EOF
#define WIN32_REGISTRY_KEY "$gcc_cv_win32_registry_key"
EOF
@@ -5881,6 +6092,11 @@ for f in $tm_file; do
esac
done
+tm_p_file_list=
+for f in $tm_p_file; do
+ tm_p_file_list="${tm_p_file_list} \$(srcdir)/config/$f"
+done
+
host_xm_file_list=
for f in $host_xm_file; do
case $f in
@@ -5914,10 +6130,9 @@ fi
# have its own set of headers then define
# inhibit_libc
-# If this is using newlib, then define inhibit_libc in
-# LIBGCC2_CFLAGS. This will cause __eprintf to be left out of
-# libgcc.a, but that's OK because newlib should have its own version of
-# assert.h.
+# If this is using newlib, then define inhibit_libc in LIBGCC2_CFLAGS.
+# This prevents libgcc2 from containing any code which requires libc
+# support.
inhibit_libc=
if test x$host != x$target && test x$with_headers = x; then
inhibit_libc=-Dinhibit_libc
@@ -5987,7 +6202,7 @@ fi
# Figure out what assembler we will be using.
echo $ac_n "checking what assembler to use""... $ac_c" 1>&6
-echo "configure:5991: checking what assembler to use" >&5
+echo "configure:6206: checking what assembler to use" >&5
gcc_cv_as=
gcc_cv_gas_major_version=
gcc_cv_gas_minor_version=
@@ -6038,7 +6253,7 @@ if test "x$gcc_cv_as" = x -a x$host = x$target; then
# If the loop below does not find an assembler, then use whatever
# one we can find in the users's path.
# user's path.
- as=as$host_exeext
+ gcc_cv_as=as$host_exeext
test_dirs="$test_prefix/lib/gcc-lib/$target/$gcc_version \
$test_prefix/lib/gcc-lib/$target \
@@ -6072,7 +6287,7 @@ fi
# Figure out what nm we will be using.
echo $ac_n "checking what nm to use""... $ac_c" 1>&6
-echo "configure:6076: checking what nm to use" >&5
+echo "configure:6291: checking what nm to use" >&5
if test -x nm$host_exeext; then
gcc_cv_nm=./nm$host_exeext
elif test x$host = x$target; then
@@ -6083,7 +6298,7 @@ echo "$ac_t""$gcc_cv_nm" 1>&6
# Figure out what assembler alignment features are present.
echo $ac_n "checking assembler alignment features""... $ac_c" 1>&6
-echo "configure:6087: checking assembler alignment features" >&5
+echo "configure:6302: checking assembler alignment features" >&5
gcc_cv_as_alignment_features=none
if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then
# Gas version 2.6 and later support for .balign and .p2align.
@@ -6131,7 +6346,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:6135: checking assembler subsection support" >&5
+echo "configure:6350: checking assembler subsection support" >&5
gcc_cv_as_subsections=no
if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then
if test "$gcc_cv_gas_major_version" -eq 2 -a "$gcc_cv_gas_minor_version" -ge 9 -o "$gcc_cv_gas_major_version" -gt 2 && grep 'obj_format = elf' ../gas/Makefile > /dev/null; then
@@ -6171,7 +6386,7 @@ fi
echo "$ac_t""$gcc_cv_as_subsections" 1>&6
echo $ac_n "checking assembler weak support""... $ac_c" 1>&6
-echo "configure:6175: checking assembler weak support" >&5
+echo "configure:6390: checking assembler weak support" >&5
gcc_cv_as_weak=no
if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then
if test "$gcc_cv_gas_major_version" -eq 2 -a "$gcc_cv_gas_minor_version" -ge 2 -o "$gcc_cv_gas_major_version" -gt 2; then
@@ -6194,7 +6409,7 @@ fi
echo "$ac_t""$gcc_cv_as_weak" 1>&6
echo $ac_n "checking assembler hidden support""... $ac_c" 1>&6
-echo "configure:6198: checking assembler hidden support" >&5
+echo "configure:6413: checking assembler hidden support" >&5
gcc_cv_as_hidden=no
if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then
if test "$gcc_cv_gas_major_version" -eq 2 -a "$gcc_cv_gas_minor_version" -ge 10 -o "$gcc_cv_gas_major_version" -gt 2 && grep 'obj_format = elf' ../gas/Makefile > /dev/null; then
@@ -6217,10 +6432,136 @@ EOF
fi
echo "$ac_t""$gcc_cv_as_hidden" 1>&6
+echo $ac_n "checking assembler leb128 support""... $ac_c" 1>&6
+echo "configure:6437: checking assembler leb128 support" >&5
+gcc_cv_as_leb128=no
+if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then
+ if test "$gcc_cv_gas_major_version" -eq 2 -a "$gcc_cv_gas_minor_version" -ge 11 -o "$gcc_cv_gas_major_version" -gt 2 && grep 'obj_format = elf' ../gas/Makefile > /dev/null; then
+ gcc_cv_as_leb128="yes"
+ fi
+elif test x$gcc_cv_as != x; then
+ # Check if we have .[us]leb128, and support symbol arithmetic with it.
+ cat > conftest.s <<EOF
+ .data
+ .uleb128 L2 - L1
+L1:
+ .uleb128 1280
+ .sleb128 -1010
+L2:
+EOF
+ if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
+ gcc_cv_as_leb128="yes"
+
+ # GAS versions before 2.11 do not support uleb128,
+ # despite appearing to.
+ # ??? There exists an elf-specific test that will crash
+ # the assembler. Perhaps it's better to figure out whether
+ # arbitrary sections are supported and try the test.
+ as_ver=`$gcc_cv_as --version 2>/dev/null | head -1`
+ if echo "$as_ver" | grep GNU > /dev/null; then
+ as_ver=`echo $as_ver | sed -e 's,[^0-9]*,,' -e 's, .*,,'`
+ as_major=`echo $as_ver | sed 's,\..*,,'`
+ as_minor=`echo $as_ver | sed 's,[^.]*\.\([0-9]*\).*,\1,'`
+ if test $as_major -eq 2 -a $as_minor -lt 11; then
+ gcc_cv_as_leb128="no"
+ fi
+ fi
+ fi
+ rm -f conftest.s conftest.o conftest.nm1 conftest.nm2
+fi
+if test x"$gcc_cv_as_leb128" = xyes; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_AS_LEB128 1
+EOF
+
+fi
+echo "$ac_t""$gcc_cv_as_leb128" 1>&6
+
+echo $ac_n "checking assembler eh_frame optimization""... $ac_c" 1>&6
+echo "configure:6482: checking assembler eh_frame optimization" >&5
+gcc_cv_as_eh_frame=no
+if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then
+ if test "$gcc_cv_gas_major_version" -eq 2 -a "$gcc_cv_gas_minor_version" -ge 12 -o "$gcc_cv_gas_major_version" -gt 2 && grep 'obj_format = elf' ../gas/Makefile > /dev/null; then
+ gcc_cv_as_eh_frame="yes"
+ fi
+elif test x$gcc_cv_as != x; then
+ # Check if this is GAS.
+ as_ver=`$gcc_cv_as --version < /dev/null 2> /dev/null | head -1`
+ rm -f a.out 2> /dev/null
+ if echo "$as_ver" | grep GNU > /dev/null; then
+ # Versions up to and including 2.11.0 may mis-optimize
+ # .eh_frame data. Try something.
+ cat > conftest.s <<EOF
+ .text
+.LFB1:
+ .4byte 0
+.L1:
+ .4byte 0
+.LFE1:
+ .section .eh_frame,"aw",@progbits
+__FRAME_BEGIN__:
+ .4byte .LECIE1-.LSCIE1
+.LSCIE1:
+ .4byte 0x0
+ .byte 0x1
+ .ascii "z\0"
+ .byte 0x1
+ .byte 0x78
+ .byte 0x1a
+ .byte 0x0
+ .byte 0x4
+ .4byte 1
+ .p2align 1
+.LECIE1:
+.LSFDE1:
+ .4byte .LEFDE1-.LASFDE1
+.LASFDE1:
+ .4byte .LASFDE1-__FRAME_BEGIN__
+ .4byte .LFB1
+ .4byte .LFE1-.LFB1
+ .byte 0x4
+ .4byte .LFE1-.LFB1
+ .byte 0x4
+ .4byte .L1-.LFB1
+.LEFDE1:
+EOF
+ cat > conftest.lit <<EOF
+ 0000 10000000 00000000 017a0001 781a0004 .........z..x...
+ 0010 01000000 12000000 18000000 00000000 ................
+ 0020 08000000 04080000 0044 .........D
+EOF
+ cat > conftest.big <<EOF
+ 0000 00000010 00000000 017a0001 781a0004 .........z..x...
+ 0010 00000001 00000012 00000018 00000000 ................
+ 0020 00000008 04000000 0844 .........D
+EOF
+ # If the assembler didn't choke, and we can objdump,
+ # and we got the correct data, then succeed.
+ if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1 \
+ && objdump -s -j .eh_frame conftest.o 2>/dev/null \
+ | tail -3 > conftest.got \
+ && { cmp conftest.lit conftest.got > /dev/null 2>&1 \
+ || cmp conftest.big conftest.got > /dev/null 2>&1; }
+ then
+ gcc_cv_as_eh_frame="yes"
+ else
+ gcc_cv_as_eh_frame="bad"
+ if $gcc_cv_as -o conftest.o --traditional-format /dev/null; then
+ cat >> confdefs.h <<\EOF
+#define USE_AS_TRADITIONAL_FORMAT 1
+EOF
+
+ fi
+ fi
+ fi
+ rm -f conftest.*
+fi
+echo "$ac_t""$gcc_cv_as_eh_frame" 1>&6
+
case "$target" in
sparc*-*-*)
echo $ac_n "checking assembler .register pseudo-op support""... $ac_c" 1>&6
-echo "configure:6224: checking assembler .register pseudo-op support" >&5
+echo "configure:6565: 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
@@ -6248,7 +6589,7 @@ EOF
fi
echo $ac_n "checking assembler supports -relax""... $ac_c" 1>&6
-echo "configure:6252: checking assembler supports -relax" >&5
+echo "configure:6593: 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
@@ -6278,7 +6619,7 @@ EOF
case "$tm_file" in
*64*)
echo $ac_n "checking for 64 bit support in assembler ($gcc_cv_as)""... $ac_c" 1>&6
-echo "configure:6282: checking for 64 bit support in assembler ($gcc_cv_as)" >&5
+echo "configure:6623: checking for 64 bit support in assembler ($gcc_cv_as)" >&5
if eval "test \"`echo '$''{'gcc_cv_as_flags64'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -6323,7 +6664,7 @@ EOF
if test "x$gcc_cv_as_flags64" != xno; then
echo $ac_n "checking for assembler offsetable %lo() support""... $ac_c" 1>&6
-echo "configure:6327: checking for assembler offsetable %lo() support" >&5
+echo "configure:6668: 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
@@ -6358,11 +6699,12 @@ EOF
fi
fi
+
;;
i[34567]86-*-*)
echo $ac_n "checking assembler instructions""... $ac_c" 1>&6
-echo "configure:6366: checking assembler instructions" >&5
+echo "configure:6708: checking assembler instructions" >&5
gcc_cv_as_instructions=
if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then
if test "$gcc_cv_gas_major_version" -eq 2 -a "$gcc_cv_gas_minor_version" -ge 9 -o "$gcc_cv_gas_major_version" -gt 2; then
@@ -6391,7 +6733,7 @@ EOF
esac
echo $ac_n "checking assembler dwarf2 debug_line support""... $ac_c" 1>&6
-echo "configure:6395: checking assembler dwarf2 debug_line support" >&5
+echo "configure:6737: 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
@@ -6400,7 +6742,7 @@ gcc_cv_as_dwarf2_debug_line=no
# ??? Once 2.11 is released, probably need to add first known working
# version to the per-target configury.
case "$target" in
- i?86*-*-* | mips*-*-* | alpha*-*-* | powerpc*-*-* | sparc*-*-*)
+ i?86*-*-* | mips*-*-* | alpha*-*-* | powerpc*-*-* | sparc*-*-* | m68*-*-*)
insn="nop"
;;
ia64*-*-*)
@@ -6417,12 +6759,23 @@ then
gcc_cv_as_dwarf2_debug_line="yes"
fi
elif test x$gcc_cv_as != x -a x"$insn" != x ; then
- echo ' .file 0 "conftest.s"' > conftest.s
- echo ' .loc 0 3 0' >> conftest.s
+ echo ' .file 1 "conftest.s"' > conftest.s
+ echo ' .loc 1 3 0' >> conftest.s
echo " $insn" >> conftest.s
if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1 \
&& grep debug_line conftest.o > /dev/null 2>&1 ; then
- gcc_cv_as_dwarf2_debug_line="yes"
+ # The .debug_line file table must be in the exact order that
+ # we specified the files, since these indicies are also used
+ # by DW_AT_decl_file. Approximate this test by testing if
+ # the assembler bitches if the same index is assigned twice.
+ echo ' .file 1 "foo.s"' > conftest.s
+ echo ' .file 1 "bar.s"' >> conftest.s
+ if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1
+ then
+ gcc_cv_as_dwarf2_debug_line="no"
+ else
+ gcc_cv_as_dwarf2_debug_line="yes"
+ fi
fi
rm -f conftest.s conftest.o conftest.nm1 conftest.nm2
fi
@@ -6434,6 +6787,13 @@ EOF
fi
echo "$ac_t""$gcc_cv_as_dwarf2_debug_line" 1>&6
+if test "$prefix" != "/usr" && test "$prefix" != "/usr/local" ; then
+ cat >> confdefs.h <<EOF
+#define PREFIX_INCLUDE_DIR "$prefix/include"
+EOF
+
+fi
+
# Figure out what language subdirectories are present.
# Look if the user specified --enable-languages="..."; if not, use
# the environment variable $LANGUAGES if defined. $LANGUAGES might
@@ -6449,6 +6809,38 @@ else
{ echo "configure: error: --enable-languages needs at least one argument" 1>&2; exit 1; }
fi
fi
+
+# 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}/*/config-lang.in ..
+do
+ case $lang in
+ ..)
+ ;;
+ # The odd quoting in the next line works around
+ # an apparent bug in bash 1.12 on linux.
+ ${srcdir}/[*]/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
+ case ,${enable_languages}, in
+ *,$other,*)
+ ;;
+ *,all,*)
+ ;;
+ *,$lang_alias,*)
+ enable_languages="$enable_languages,$other"
+ ;;
+ esac
+ done
+ ;;
+ esac
+done
+
subdirs=
for lang in ${srcdir}/*/config-lang.in ..
do
@@ -6537,7 +6929,7 @@ EOF
echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
-echo "configure:6541: checking whether to enable maintainer-specific portions of Makefiles" >&5
+echo "configure:6933: 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"
@@ -6555,6 +6947,18 @@ else
MAINT='#'
fi
+# With Setjmp/Longjmp based exception handling.
+# Check whether --enable-sjlj-exceptions or --disable-sjlj-exceptions was given.
+if test "${enable_sjlj_exceptions+set}" = set; then
+ enableval="$enable_sjlj_exceptions"
+ sjlj=`if test $enableval = yes; then echo 1; else echo 0; fi`
+cat >> confdefs.h <<EOF
+#define CONFIG_SJLJ_EXCEPTIONS $sjlj
+EOF
+
+fi
+
+
# Make empty files to contain the specs and options for each language.
# Then add #include lines to for a compiler that has specs and/or options.
@@ -6685,7 +7089,7 @@ build_canonical=${build}
host_canonical=${host}
target_subdir=
if test "${host}" != "${target}" ; then
- target_subdir=${target}/
+ target_subdir=${target_alias}/
fi
@@ -6821,6 +7225,15 @@ ${CONFIG_SHELL-/bin/sh} $srcdir/configure.frag $srcdir "$subdirs" "$dep_host_xma
+
+
+
+
+
+
+
+
+
# Echo that links are built
if test x$host = x$target
then
@@ -7032,6 +7445,7 @@ s%@TARGET_GETGROUPS_T@%$TARGET_GETGROUPS_T%g
s%@vfprintf@%$vfprintf%g
s%@doprint@%$doprint%g
s%@strstr@%$strstr%g
+s%@LIBICONV@%$LIBICONV%g
s%@manext@%$manext%g
s%@objext@%$objext%g
s%@PACKAGE@%$PACKAGE%g
@@ -7084,6 +7498,8 @@ s%@all_stagestuff@%$all_stagestuff%g
s%@build_exeext@%$build_exeext%g
s%@build_install_headers_dir@%$build_install_headers_dir%g
s%@build_xm_file_list@%$build_xm_file_list%g
+s%@build_xm_file@%$build_xm_file%g
+s%@build_xm_defines@%$build_xm_defines%g
s%@cc_set_by_configure@%$cc_set_by_configure%g
s%@quoted_cc_set_by_configure@%$quoted_cc_set_by_configure%g
s%@cpp_install_dir@%$cpp_install_dir%g
@@ -7105,6 +7521,8 @@ s%@gcc_version_trigger@%$gcc_version_trigger%g
s%@host_exeext@%$host_exeext%g
s%@host_extra_gcc_objs@%$host_extra_gcc_objs%g
s%@host_xm_file_list@%$host_xm_file_list%g
+s%@host_xm_file@%$host_xm_file%g
+s%@host_xm_defines@%$host_xm_defines%g
s%@install@%$install%g
s%@lang_options_files@%$lang_options_files%g
s%@lang_specs_files@%$lang_specs_files%g
@@ -7119,9 +7537,15 @@ s%@stage_prefix_set_by_configure@%$stage_prefix_set_by_configure%g
s%@symbolic_link@%$symbolic_link%g
s%@thread_file@%$thread_file%g
s%@tm_file_list@%$tm_file_list%g
+s%@tm_file@%$tm_file%g
+s%@tm_p_file_list@%$tm_p_file_list%g
+s%@tm_p_file@%$tm_p_file%g
+s%@xm_file@%$xm_file%g
+s%@xm_defines@%$xm_defines%g
s%@will_use_collect2@%$will_use_collect2%g
s%@c_target_objs@%$c_target_objs%g
s%@cxx_target_objs@%$cxx_target_objs%g
+s%@target_cpu_default@%$target_cpu_default%g
/@target_overrides@/r $target_overrides
s%@target_overrides@%%g
/@host_overrides@/r $host_overrides
@@ -7436,7 +7860,7 @@ esac
# This is virtually a duplicate of what happens in configure.lang; we do
# an extra check to make sure this only happens if ln -s can be used.
if test "$symbolic_link" = "ln -s"; then
- for d in .. ${subdirs} ; do
+ for d in .. ${subdirs} fixinc ; do
if test $d != ..; then
STARTDIR=`pwd`
cd $d
diff --git a/gcc/configure.in b/gcc/configure.in
index 1ad41a6b474..9d0e768a603 100644
--- a/gcc/configure.in
+++ b/gcc/configure.in
@@ -93,7 +93,7 @@ gnu_ld_flag=no)
# With pre-defined ld
AC_ARG_WITH(ld,
-[ --with-ld arrange to use the specified ld (full pathname).],
+[ --with-ld arrange to use the specified ld (full pathname)],
DEFAULT_LINKER="$with_ld")
if test x"${DEFAULT_LINKER+set}" = x"set"; then
if test ! -x "$DEFAULT_LINKER"; then
@@ -107,12 +107,12 @@ fi
# With GNU as
AC_ARG_WITH(gnu-as,
-[ --with-gnu-as arrange to work with GNU as.],
+[ --with-gnu-as arrange to work with GNU as],
gas_flag="$with_gnu_as",
gas_flag=no)
AC_ARG_WITH(as,
-[ --with-as arrange to use the specified as (full pathname).],
+[ --with-as arrange to use the specified as (full pathname)],
DEFAULT_ASSEMBLER="$with_as")
if test x"${DEFAULT_ASSEMBLER+set}" = x"set"; then
if test ! -x "$DEFAULT_ASSEMBLER"; then
@@ -126,20 +126,20 @@ fi
# With stabs
AC_ARG_WITH(stabs,
-[ --with-stabs arrange to use stabs instead of host debug format.],
+[ --with-stabs arrange to use stabs instead of host debug format],
stabs="$with_stabs",
stabs=no)
# With ELF
AC_ARG_WITH(elf,
-[ --with-elf arrange to use ELF instead of host debug format.],
+[ --with-elf arrange to use ELF instead of host debug format],
elf="$with_elf",
elf=no)
# Specify the local prefix
local_prefix=
AC_ARG_WITH(local-prefix,
-[ --with-local-prefix=DIR specifies directory to put local include.],
+[ --with-local-prefix=DIR specifies directory to put local include],
[case "${withval}" in
yes) AC_MSG_ERROR(bad value ${withval} given for local include directory prefix) ;;
no) ;;
@@ -158,7 +158,7 @@ gcc_gxx_include_dir=
# Specify the g++ header file directory
AC_ARG_WITH(gxx-include-dir,
[ --with-gxx-include-dir=DIR
- specifies directory to put g++ header files.],
+ specifies directory to put g++ header files],
[case "${withval}" in
yes) AC_MSG_ERROR(bad value ${withval} given for g++ include directory) ;;
no) ;;
@@ -178,7 +178,7 @@ fi
# Determine whether or not multilibs are enabled.
AC_ARG_ENABLE(multilib,
-[ --enable-multilib enable library support for multiple ABIs],
+[ --enable-multilib enable library support for multiple ABIs],
[], [enable_multilib=yes])
AC_SUBST(enable_multilib)
@@ -188,7 +188,7 @@ AC_ARG_ENABLE(checking,
enable expensive run-time checks. With LIST,
enable only specific categories of checks.
Categories are: misc,tree,rtl,gc,gcac; default
- is misc,tree,gc],
+ is no checking],
[ac_checking=
ac_tree_checking=
ac_rtl_checking=
@@ -214,8 +214,7 @@ no) ;;
;;
esac
],
-# Enable some checks by default for development versions of GCC
-[ac_checking=1; ac_tree_checking=1; ac_gc_checking=1;])
+[])
if test x$ac_checking != x ; then
AC_DEFINE(ENABLE_CHECKING, 1,
[Define if you want more run-time sanity checks. This one gets a grab
@@ -247,13 +246,13 @@ fi
AC_ARG_ENABLE(cpp,
-[ --disable-cpp don't provide a user-visible C preprocessor.],
+[ --disable-cpp don't provide a user-visible C preprocessor],
[], [enable_cpp=yes])
AC_ARG_WITH(cpp_install_dir,
[ --with-cpp-install-dir=DIR
install the user visible C preprocessor in DIR
- (relative to PREFIX) as well as PREFIX/bin.],
+ (relative to PREFIX) as well as PREFIX/bin],
[if test x$withval = xyes; then
AC_MSG_ERROR([option --with-cpp-install-dir requires an argument])
elif test x$withval != xno; then
@@ -262,7 +261,7 @@ fi])
# Enable Multibyte Characters for C/C++
AC_ARG_ENABLE(c-mbchar,
-[ --enable-c-mbchar Enable multibyte characters for C and C++.],
+[ --enable-c-mbchar enable multibyte characters for C and C++],
if test x$enable_c_mbchar != xno; then
AC_DEFINE(MULTIBYTE_CHARS, 1,
[Define if you want the C and C++ compilers to support multibyte
@@ -273,8 +272,8 @@ fi)
# Pass with no value to take the default
# Pass with a value to specify a thread package
AC_ARG_ENABLE(threads,
-[ --enable-threads enable thread usage for target GCC.
- --enable-threads=LIB use LIB thread package for target GCC.],,
+[ --enable-threads enable thread usage for target GCC
+ --enable-threads=LIB use LIB thread package for target GCC],,
enable_threads='')
enable_threads_flag=$enable_threads
@@ -289,7 +288,7 @@ case x${enable_threads_flag} in
target_thread_file=''
;;
xdecosf1 | xirix | xmach | xos2 | xposix | xpthreads | xsingle | \
- xsolaris | xwin32 | xdce | xvxworks | xaix)
+ xsolaris | xwin32 | xdce | xrtems| xvxworks | xaix)
target_thread_file=$enable_threads_flag
;;
*)
@@ -300,7 +299,7 @@ esac
AC_ARG_ENABLE(objc-gc,
[ --enable-objc-gc enable the use of Boehm's garbage collector with
- the GNU Objective-C runtime.],
+ the GNU Objective-C runtime],
if test x$enable_objc_gc = xno; then
objc_boehm_gc=''
else
@@ -309,13 +308,27 @@ fi,
objc_boehm_gc='')
AC_ARG_WITH(dwarf2,
-[ --with-dwarf2 force the default debug format to be DWARF2.],
+[ --with-dwarf2 force the default debug format to be DWARF 2],
dwarf2="$with_dwarf2",
dwarf2=no)
AC_ARG_ENABLE(shared,
-[ --disable-shared don't provide a shared libgcc.],
-[], [enable_shared=yes])
+[ --disable-shared don't provide a shared libgcc],
+[
+ case $enable_shared in
+ yes | no) ;;
+ *)
+ enable_shared=no
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+ for pkg in $enableval; do
+ if test "X$pkg" = "Xgcc" || test "X$pkg" = "Xlibgcc"; then
+ enable_shared=yes
+ fi
+ done
+ IFS="$ac_save_ifs"
+ ;;
+ esac
+], [enable_shared=yes])
AC_SUBST(enable_shared)
# Determine the host, build, and target systems
@@ -334,6 +347,7 @@ AC_SUBST(NO_MINUS_C_MINUS_O)
AC_SUBST(OUTPUT_OPTION)
gcc_AC_C_LONG_DOUBLE
+gcc_AC_C__BOOL
AC_CACHE_CHECK(whether ${CC-cc} accepts -Wno-long-long,
ac_cv_prog_cc_no_long_long,
@@ -421,12 +435,13 @@ gcc_AC_PROG_INSTALL
AC_HEADER_STDC
AC_HEADER_TIME
+gcc_AC_HEADER_STDBOOL
gcc_AC_HEADER_STRING
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS(limits.h stddef.h string.h strings.h stdlib.h time.h \
fcntl.h unistd.h stab.h sys/file.h sys/time.h \
sys/resource.h sys/param.h sys/times.h sys/stat.h \
- direct.h malloc.h langinfo.h iconv.h)
+ direct.h malloc.h langinfo.h)
# Check for thread headers.
AC_CHECK_HEADER(thread.h, [have_thread_h=yes], [have_thread_h=])
@@ -530,7 +545,7 @@ fi
AC_CHECK_FUNCS(strtoul bsearch putenv popen bcopy \
strchr strrchr kill getrlimit setrlimit atoll atoq \
sysconf isascii gettimeofday strsignal putc_unlocked fputc_unlocked \
- fputs_unlocked getrusage iconv nl_langinfo)
+ fputs_unlocked getrusage nl_langinfo lstat)
AC_CHECK_TYPE(ssize_t, int)
@@ -569,6 +584,8 @@ AC_FUNC_VFORK
AC_FUNC_MMAP_ANYWHERE
AC_FUNC_MMAP_FILE
+AM_ICONV
+
# We will need to find libiberty.h and ansidecl.h
saved_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -I${srcdir} -I${srcdir}/../include"
@@ -659,9 +676,46 @@ then
fi
# Say what files are being used for the output code and MD file.
-echo "Using \`$srcdir/config/$out_file' to output insns."
+echo "Using \`$srcdir/config/$out_file' for machine-specific logic."
echo "Using \`$srcdir/config/$md_file' as machine description file."
+# If any of the xm_file variables contain nonexistent files, warn
+# about them and drop them. But $cpu/xm-$cpu.h is allowed not to
+# exist, if we have nothing for it to do.
+
+bx=
+for x in $build_xm_file; do
+ if test -f $srcdir/config/$x
+ then bx="$bx $x"
+ elif echo $x | grep '\([a-z0-9][a-z0-9]*\)/xm-\1\.h' >/dev/null
+ then :
+ else AC_MSG_WARN($srcdir/config/$x does not exist.)
+ fi
+done
+build_xm_file="$bx"
+
+hx=
+for x in $host_xm_file; do
+ if test -f $srcdir/config/$x
+ then hx="$hx $x"
+ elif echo $x | grep '\([a-z0-9][a-z0-9]*\)/xm-\1\.h' >/dev/null
+ then :
+ else AC_MSG_WARN($srcdir/config/$x does not exist.)
+ fi
+done
+host_xm_file="$hx"
+
+tx=
+for x in $xm_file; do
+ if test -f $srcdir/config/$x
+ then tx="$tx $x"
+ elif echo $x | grep '\([a-z0-9][a-z0-9]*\)/xm-\1\.h' >/dev/null
+ then :
+ else AC_MSG_WARN($srcdir/config/$x does not exist.)
+ fi
+done
+xm_file="$tx"
+
count=a
for f in $tm_file; do
count=${count}x
@@ -679,7 +733,9 @@ count=a
for f in $host_xm_file; do
count=${count}x
done
-if test $count = ax; then
+if test $count = a; then
+ :
+elif test $count = ax; then
echo "Using \`$srcdir/config/$host_xm_file' as host machine macro file."
else
echo "Using the following host machine macro files:"
@@ -693,7 +749,9 @@ if test "$host_xm_file" != "$build_xm_file"; then
for f in $build_xm_file; do
count=${count}x
done
- if test $count = ax; then
+ if test $count = a; then
+ :
+ elif test $count = ax; then
echo "Using \`$srcdir/config/$build_xm_file' as build machine macro file."
else
echo "Using the following build machine macro files:"
@@ -711,12 +769,8 @@ if test x$thread_file = x; then
fi
fi
-# Set up the header files.
-# $links is the list of header files to create.
-# $vars is the list of shell variables with file names to include.
# auto-host.h is the file containing items generated by autoconf and is
# the first file included by config.h.
-null_defines=
host_xm_file="auto-host.h gansidecl.h ${host_xm_file} defaults.h hwint.h"
# If host=build, it is correct to have hconfig include auto-host.h
@@ -752,65 +806,6 @@ fi
xm_file="gansidecl.h ${xm_file} defaults.h"
tm_file="gansidecl.h ${tm_file} defaults.h"
-vars="host_xm_file tm_file tm_p_file xm_file build_xm_file"
-links="config.h tm.h tm_p.h tconfig.h hconfig.h"
-defines="host_xm_defines null_defines null_defines xm_defines build_xm_defines"
-
-rm -f config.bak
-if test -f config.status; then mv -f config.status config.bak; fi
-
-# Make the links.
-while test -n "$vars"
-do
- set $vars; var=$1; shift; vars=$*
- set $links; link=$1; shift; links=$*
- set $defines; define=$1; shift; defines=$*
-
- rm -f $link
- # Make sure the file is created, even if it is empty.
- echo >$link
-
- # Define TARGET_CPU_DEFAULT if the system wants one.
- # This substitutes for lots of *.h files.
- if test "$target_cpu_default" != "" -a $link = tm.h
- then
- echo "#define TARGET_CPU_DEFAULT ($target_cpu_default)" >>$link
- fi
-
- for file in `eval echo '$'$var`; do
- case $file in
- auto-host.h | auto-build.h )
- ;;
- *)
- echo '#ifdef IN_GCC' >>$link
- ;;
- esac
- echo "#include \"$file\"" >>$link
- case $file in
- auto-host.h | auto-build.h )
- ;;
- *)
- echo '#endif' >>$link
- ;;
- esac
- done
-
- for def in `eval echo '$'$define`; do
- echo "#ifndef $def" >>$link
- echo "#define $def" >>$link
- echo "#endif" >>$link
- done
-
- if test $link = tm.h
- then
- # Include insn-codes.h last, because it includes machmode.h,
- # and we want EXTRA_CC_MODES to be taken into account.
- echo "#ifndef GENERATOR_FILE" >>$link
- echo "#include \"insn-codes.h\"" >>$link
- echo "#endif" >>$link
- fi
-done
-
# Truncate the target if necessary
if test x$host_truncate_target != x; then
target=`echo $target | sed -e 's/\(..............\).*/\1/'`
@@ -823,13 +818,13 @@ else
gcc_version_trigger=${srcdir}/version.c
fi
changequote(,)dnl
-gcc_version_full=`grep version_string ${gcc_version_trigger} | sed -e 's/.*\"\([^\"]*\)\".*/\1/'`
+gcc_version_full=`grep version_string ${gcc_version_trigger} | sed -e 's/.*"\([^"]*\)".*/\1/'`
gcc_version=`echo ${gcc_version_full} | sed -e 's/\([^ ]*\) .*/\1/'`
# Compile in configure arguments.
if test -f configargs.h ; then
# Being re-configured.
- gcc_config_arguments=`grep configuration_arguments configargs.h | sed -e 's/.*\"\([^\"]*\)\".*/\1/'`
+ gcc_config_arguments=`grep configuration_arguments configargs.h | sed -e 's/.*"\([^"]*\)".*/\1/'`
gcc_config_arguments="$gcc_config_arguments : (reconfigured) $TOPLEVEL_CONFIGURE_ARGUMENTS"
else
gcc_config_arguments="$TOPLEVEL_CONFIGURE_ARGUMENTS"
@@ -837,6 +832,7 @@ fi
cat > configargs.h <<EOF
/* Generated automatically. */
static const char configuration_arguments[] = "$gcc_config_arguments";
+static const char thread_model[] = "$thread_file";
EOF
changequote([,])dnl
@@ -850,7 +846,7 @@ AC_DEFINE_UNQUOTED(VERSION, "$VERSION",
AC_SUBST(PACKAGE)
AC_SUBST(VERSION)
-ALL_LINGUAS="sv"
+ALL_LINGUAS=
# Enable NLS support by default
AC_ARG_ENABLE(nls,
@@ -880,12 +876,12 @@ XGETTEXT="AWK='$AWK' \$(SHELL) \$(top_srcdir)/exgettext $XGETTEXT"
# Windows32 Registry support for specifying GCC installation paths.
AC_ARG_ENABLE(win32-registry,
[ --disable-win32-registry
- Disable lookup of installation paths in the
- Registry on Windows hosts.
- --enable-win32-registry Enable registry lookup (default).
+ disable lookup of installation paths in the
+ Registry on Windows hosts
+ --enable-win32-registry enable registry lookup (default)
--enable-win32-registry=KEY
- Use KEY instead of GCC version as the last portion
- of the registry key.],,)
+ use KEY instead of GCC version as the last portion
+ of the registry key],,)
AC_MSG_CHECKING(whether windows registry support is requested)
if test x$enable_win32_registry != xno; then
@@ -986,6 +982,11 @@ for f in $tm_file; do
esac
done
+tm_p_file_list=
+for f in $tm_p_file; do
+ tm_p_file_list="${tm_p_file_list} \$(srcdir)/config/$f"
+done
+
host_xm_file_list=
for f in $host_xm_file; do
case $f in
@@ -1019,10 +1020,9 @@ fi
# have its own set of headers then define
# inhibit_libc
-# If this is using newlib, then define inhibit_libc in
-# LIBGCC2_CFLAGS. This will cause __eprintf to be left out of
-# libgcc.a, but that's OK because newlib should have its own version of
-# assert.h.
+# If this is using newlib, then define inhibit_libc in LIBGCC2_CFLAGS.
+# This prevents libgcc2 from containing any code which requires libc
+# support.
inhibit_libc=
if [test x$host != x$target] && [test x$with_headers = x]; then
inhibit_libc=-Dinhibit_libc
@@ -1146,7 +1146,7 @@ if test "x$gcc_cv_as" = x -a x$host = x$target; then
# If the loop below does not find an assembler, then use whatever
# one we can find in the users's path.
# user's path.
- as=as$host_exeext
+ gcc_cv_as=as$host_exeext
test_dirs="$test_prefix/lib/gcc-lib/$target/$gcc_version \
$test_prefix/lib/gcc-lib/$target \
@@ -1302,6 +1302,128 @@ if test x"$gcc_cv_as_hidden" = xyes; then
fi
AC_MSG_RESULT($gcc_cv_as_hidden)
+AC_MSG_CHECKING(assembler leb128 support)
+gcc_cv_as_leb128=no
+if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then
+ if test "$gcc_cv_gas_major_version" -eq 2 -a "$gcc_cv_gas_minor_version" -ge 11 -o "$gcc_cv_gas_major_version" -gt 2 && grep 'obj_format = elf' ../gas/Makefile > /dev/null; then
+ gcc_cv_as_leb128="yes"
+ fi
+elif test x$gcc_cv_as != x; then
+ # Check if we have .[us]leb128, and support symbol arithmetic with it.
+ cat > conftest.s <<EOF
+ .data
+ .uleb128 L2 - L1
+L1:
+ .uleb128 1280
+ .sleb128 -1010
+L2:
+EOF
+ if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
+ gcc_cv_as_leb128="yes"
+
+ # GAS versions before 2.11 do not support uleb128,
+ # despite appearing to.
+ # ??? There exists an elf-specific test that will crash
+ # the assembler. Perhaps it's better to figure out whether
+ # arbitrary sections are supported and try the test.
+ as_ver=`$gcc_cv_as --version 2>/dev/null | head -1`
+ if echo "$as_ver" | grep GNU > /dev/null; then
+changequote(,)dnl
+ as_ver=`echo $as_ver | sed -e 's,[^0-9]*,,' -e 's, .*,,'`
+ as_major=`echo $as_ver | sed 's,\..*,,'`
+ as_minor=`echo $as_ver | sed 's,[^.]*\.\([0-9]*\).*,\1,'`
+changequote([,])dnl
+ if test $as_major -eq 2 -a $as_minor -lt 11; then
+ gcc_cv_as_leb128="no"
+ fi
+ fi
+ fi
+ rm -f conftest.s conftest.o conftest.nm1 conftest.nm2
+fi
+if test x"$gcc_cv_as_leb128" = xyes; then
+ AC_DEFINE(HAVE_AS_LEB128, 1,
+ [Define if your assembler supports .uleb128.])
+fi
+AC_MSG_RESULT($gcc_cv_as_leb128)
+
+AC_MSG_CHECKING(assembler eh_frame optimization)
+gcc_cv_as_eh_frame=no
+if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then
+ if test "$gcc_cv_gas_major_version" -eq 2 -a "$gcc_cv_gas_minor_version" -ge 12 -o "$gcc_cv_gas_major_version" -gt 2 && grep 'obj_format = elf' ../gas/Makefile > /dev/null; then
+ gcc_cv_as_eh_frame="yes"
+ fi
+elif test x$gcc_cv_as != x; then
+ # Check if this is GAS.
+ as_ver=`$gcc_cv_as --version < /dev/null 2> /dev/null | head -1`
+ rm -f a.out 2> /dev/null
+ if echo "$as_ver" | grep GNU > /dev/null; then
+ # Versions up to and including 2.11.0 may mis-optimize
+ # .eh_frame data. Try something.
+ cat > conftest.s <<EOF
+ .text
+.LFB1:
+ .4byte 0
+.L1:
+ .4byte 0
+.LFE1:
+ .section .eh_frame,"aw",@progbits
+__FRAME_BEGIN__:
+ .4byte .LECIE1-.LSCIE1
+.LSCIE1:
+ .4byte 0x0
+ .byte 0x1
+ .ascii "z\0"
+ .byte 0x1
+ .byte 0x78
+ .byte 0x1a
+ .byte 0x0
+ .byte 0x4
+ .4byte 1
+ .p2align 1
+.LECIE1:
+.LSFDE1:
+ .4byte .LEFDE1-.LASFDE1
+.LASFDE1:
+ .4byte .LASFDE1-__FRAME_BEGIN__
+ .4byte .LFB1
+ .4byte .LFE1-.LFB1
+ .byte 0x4
+ .4byte .LFE1-.LFB1
+ .byte 0x4
+ .4byte .L1-.LFB1
+.LEFDE1:
+EOF
+ cat > conftest.lit <<EOF
+ 0000 10000000 00000000 017a0001 781a0004 .........z..x...
+ 0010 01000000 12000000 18000000 00000000 ................
+ 0020 08000000 04080000 0044 .........D
+EOF
+ cat > conftest.big <<EOF
+ 0000 00000010 00000000 017a0001 781a0004 .........z..x...
+ 0010 00000001 00000012 00000018 00000000 ................
+ 0020 00000008 04000000 0844 .........D
+EOF
+ # If the assembler didn't choke, and we can objdump,
+ # and we got the correct data, then succeed.
+ if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1 \
+ && objdump -s -j .eh_frame conftest.o 2>/dev/null \
+ | tail -3 > conftest.got \
+ && { cmp conftest.lit conftest.got > /dev/null 2>&1 \
+ || cmp conftest.big conftest.got > /dev/null 2>&1; }
+ then
+ gcc_cv_as_eh_frame="yes"
+ else
+ gcc_cv_as_eh_frame="bad"
+ if $gcc_cv_as -o conftest.o --traditional-format /dev/null; then
+ AC_DEFINE(USE_AS_TRADITIONAL_FORMAT, 1,
+ [Define if your assembler mis-optimizes .eh_frame data.])
+ fi
+ fi
+ fi
+ rm -f conftest.*
+fi
+AC_MSG_RESULT($gcc_cv_as_eh_frame)
+
case "$target" in
sparc*-*-*)
AC_CACHE_CHECK([assembler .register pseudo-op support],
@@ -1407,6 +1529,7 @@ changequote([, ])
[Define if your assembler supports offsetable %lo().])
fi
fi
+
;;
changequote(,)dnl
@@ -1446,7 +1569,7 @@ gcc_cv_as_dwarf2_debug_line=no
# ??? Once 2.11 is released, probably need to add first known working
# version to the per-target configury.
case "$target" in
- i?86*-*-* | mips*-*-* | alpha*-*-* | powerpc*-*-* | sparc*-*-*)
+ i?86*-*-* | mips*-*-* | alpha*-*-* | powerpc*-*-* | sparc*-*-* | m68*-*-*)
insn="nop"
;;
ia64*-*-*)
@@ -1463,12 +1586,23 @@ then
gcc_cv_as_dwarf2_debug_line="yes"
fi
elif test x$gcc_cv_as != x -a x"$insn" != x ; then
- echo ' .file 0 "conftest.s"' > conftest.s
- echo ' .loc 0 3 0' >> conftest.s
+ echo ' .file 1 "conftest.s"' > conftest.s
+ echo ' .loc 1 3 0' >> conftest.s
echo " $insn" >> conftest.s
if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1 \
&& grep debug_line conftest.o > /dev/null 2>&1 ; then
- gcc_cv_as_dwarf2_debug_line="yes"
+ # The .debug_line file table must be in the exact order that
+ # we specified the files, since these indicies are also used
+ # by DW_AT_decl_file. Approximate this test by testing if
+ # the assembler bitches if the same index is assigned twice.
+ echo ' .file 1 "foo.s"' > conftest.s
+ echo ' .file 1 "bar.s"' >> conftest.s
+ if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1
+ then
+ gcc_cv_as_dwarf2_debug_line="no"
+ else
+ gcc_cv_as_dwarf2_debug_line="yes"
+ fi
fi
rm -f conftest.s conftest.o conftest.nm1 conftest.nm2
fi
@@ -1478,6 +1612,10 @@ if test x"$gcc_cv_as_dwarf2_debug_line" = xyes; then
fi
AC_MSG_RESULT($gcc_cv_as_dwarf2_debug_line)
+if test "$prefix" != "/usr" && test "$prefix" != "/usr/local" ; then
+ AC_DEFINE_UNQUOTED(PREFIX_INCLUDE_DIR, "$prefix/include")
+fi
+
# Figure out what language subdirectories are present.
# Look if the user specified --enable-languages="..."; if not, use
# the environment variable $LANGUAGES if defined. $LANGUAGES might
@@ -1493,6 +1631,40 @@ else
AC_MSG_ERROR([--enable-languages needs at least one argument])
fi
fi
+
+# 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}/*/config-lang.in ..
+do
+ case $lang in
+ ..)
+ ;;
+ # The odd quoting in the next line works around
+ # an apparent bug in bash 1.12 on linux.
+changequote(,)dnl
+ ${srcdir}/[*]/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
+ case ,${enable_languages}, in
+ *,$other,*)
+ ;;
+ *,all,*)
+ ;;
+ *,$lang_alias,*)
+ enable_languages="$enable_languages,$other"
+ ;;
+ esac
+ done
+ ;;
+changequote([,])dnl
+ esac
+done
+
subdirs=
for lang in ${srcdir}/*/config-lang.in ..
do
@@ -1545,8 +1717,8 @@ AC_SUBST(gthread_flags)
# Find out what GC implementation we want, or may, use.
AC_ARG_WITH(gc,
-[ --with-gc={simple,page} Choose the garbage collection mechanism to use
- with the compiler.],
+[ --with-gc={simple,page} choose the garbage collection mechanism to use
+ with the compiler],
[case "$withval" in
simple | page)
GGC=ggc-$withval
@@ -1578,7 +1750,8 @@ dnl Very limited version of automake's enable-maintainer-mode
AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
dnl maintainer-mode is disabled by default
AC_ARG_ENABLE(maintainer-mode,
-[ --enable-maintainer-mode enable make rules and dependencies not useful
+[ --enable-maintainer-mode
+ enable make rules and dependencies not useful
(and sometimes confusing) to the casual installer],
maintainer_mode=$enableval,
maintainer_mode=no)
@@ -1592,6 +1765,14 @@ else
fi
AC_SUBST(MAINT)dnl
+# With Setjmp/Longjmp based exception handling.
+AC_ARG_ENABLE(sjlj-exceptions,
+[ --enable-sjlj-exceptions
+ arrange to use setjmp/longjmp exception handling],
+[sjlj=`if test $enableval = yes; then echo 1; else echo 0; fi`
+AC_DEFINE_UNQUOTED(CONFIG_SJLJ_EXCEPTIONS, $sjlj,
+ [Define 0/1 to force the choice for exception handling model.])])
+
# Make empty files to contain the specs and options for each language.
# Then add #include lines to for a compiler that has specs and/or options.
@@ -1722,7 +1903,7 @@ build_canonical=${build}
host_canonical=${host}
target_subdir=
if test "${host}" != "${target}" ; then
- target_subdir=${target}/
+ target_subdir=${target_alias}/
fi
AC_SUBST(build_canonical)
AC_SUBST(host_canonical)
@@ -1770,8 +1951,9 @@ AC_SUBST(dollar)
# Find a directory in which to install a shared libgcc.
AC_ARG_ENABLE(version-specific-runtime-libs,
-[ --enable-version-specific-runtime-libs Specify that runtime libraries shou
-ld be installed in a compiler-specific directory ])
+[ --enable-version-specific-runtime-libs
+ specify that runtime libraries should be
+ installed in a compiler-specific directory])
AC_ARG_WITH(slibdir,
[ --with-slibdir=DIR shared libraries in DIR [LIBDIR]],
@@ -1805,6 +1987,8 @@ AC_SUBST(all_stagestuff)
AC_SUBST(build_exeext)
AC_SUBST(build_install_headers_dir)
AC_SUBST(build_xm_file_list)
+AC_SUBST(build_xm_file)
+AC_SUBST(build_xm_defines)
AC_SUBST(cc_set_by_configure)
AC_SUBST(quoted_cc_set_by_configure)
AC_SUBST(cpp_install_dir)
@@ -1826,6 +2010,8 @@ AC_SUBST(gcc_version_trigger)
AC_SUBST(host_exeext)
AC_SUBST(host_extra_gcc_objs)
AC_SUBST(host_xm_file_list)
+AC_SUBST(host_xm_file)
+AC_SUBST(host_xm_defines)
AC_SUBST(install)
AC_SUBST(lang_options_files)
AC_SUBST(lang_specs_files)
@@ -1840,10 +2026,15 @@ AC_SUBST(stage_prefix_set_by_configure)
AC_SUBST(symbolic_link)
AC_SUBST(thread_file)
AC_SUBST(tm_file_list)
+AC_SUBST(tm_file)
+AC_SUBST(tm_p_file_list)
+AC_SUBST(tm_p_file)
+AC_SUBST(xm_file)
+AC_SUBST(xm_defines)
AC_SUBST(will_use_collect2)
AC_SUBST(c_target_objs)
AC_SUBST(cxx_target_objs)
-
+AC_SUBST(target_cpu_default)
AC_SUBST_FILE(target_overrides)
AC_SUBST_FILE(host_overrides)
@@ -1902,7 +2093,7 @@ esac
# This is virtually a duplicate of what happens in configure.lang; we do
# an extra check to make sure this only happens if ln -s can be used.
if test "$symbolic_link" = "ln -s"; then
- for d in .. ${subdirs} ; do
+ for d in .. ${subdirs} fixinc ; do
if test $d != ..; then
STARTDIR=`pwd`
cd $d
diff --git a/gcc/convert.c b/gcc/convert.c
index dd1b91a4e0b..b97d08fa4f7 100644
--- a/gcc/convert.c
+++ b/gcc/convert.c
@@ -310,13 +310,13 @@ convert_to_integer (type, expr)
{
/* Don't do unsigned arithmetic where signed was wanted,
or vice versa.
- Exception: if either of the original operands were
+ Exception: if both of the original operands were
unsigned then can safely do the work as unsigned.
And we may need to do it as unsigned
if we truncate to the original size. */
typex = ((TREE_UNSIGNED (TREE_TYPE (expr))
- || TREE_UNSIGNED (TREE_TYPE (arg0))
- || TREE_UNSIGNED (TREE_TYPE (arg1)))
+ || (TREE_UNSIGNED (TREE_TYPE (arg0))
+ && TREE_UNSIGNED (TREE_TYPE (arg1))))
? unsigned_type (typex) : signed_type (typex));
return convert (type,
fold (build (ex_form, typex,
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 6fd7c0d1fef..d9974bef34b 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,9 +1,1557 @@
+2002-02-20 Release Manager
+
+ * GCC 3.0.4 Released.
+
+2002-02-20 Release Manager
+
+ * GCC 3.0.4 Released.
+
+2002-02-17 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * decl.c (start_method): Fix error in 2002-01-10 change.
+
+2002-02-13 Richard Smith <richard@ex-parrot.com>
+
+ * decl.c (maybe_build_cleanup): Do not destroy thunk parameters.
+
+2002-01-31 Jason Merrill <jason@redhat.com>
+
+ PR c++/3395
+ * semantics.c (finish_class_definition): Clear out TREE_TYPE for
+ all variants.
+
+2002-01-23 Jason Merrill <jason@redhat.com>
+
+ PR c++/3331
+ * init.c (resolve_offset_ref): Use build_indirect_ref.
+
+2002-01-10 Ira Ruben <ira@apple.com>
+
+ PR c++/907
+ * decl.c (start_method): Handle attrlist.
+
+2002-01-07 Jason Merrill <jason@redhat.com>
+
+ PR c++/3536
+ * method.c (make_thunk): If !flag_weak, give the thunk the
+ function's linkage.
+ (use_thunk): Here, too.
+
+2001-12-21 Jason Merrill <jason@redhat.com>
+
+ PR c++/4122
+ * class.c (update_vtable_entry_for_fn): Set delta to zero for a
+ lost primary.
+
+2001-12-18 Jason Merrill <jason@redhat.com>
+
+ PR c++/3242
+ * class.c (add_method): Do compare 'this' quals when trying to match a
+ used function. Don't defer to another used function.
+
+ * optimize.c (maybe_clone_body): Fix parameter updating.
+
+2001-12-20 Release Manager
+
+ * GCC 3.0.3 Released.
+
+2001-12-12 Jason Merrill <jason@redhat.com>
+
+ * semantics.c (setup_vtbl_ptr): Always build a CTOR_INITIALIZER
+ if we're in a template.
+
+2001-12-08 John David Anglin <dave@hiauly1.hia.nrc.ca>
+
+ * semantics.c (simplify_aggr_init_exprs_r): Add DIRECT_BIND flag in
+ call to build_aggr_init.
+ * cp-tree.h (DIRECT_BIND): Document new use of DIRECT_BIND.
+
+2001-12-05 Jason Merrill <jason@redhat.com>
+
+ * pt.c (push_tinst_level): No longer static.
+ * cp-tree.h: Declare it.
+ * optimize.c (expand_call_inline): Record template instantiation
+ context.
+
+ * rtti.c (create_pseudo_type_info): Set CLASSTYPE_INTERFACE_ONLY
+ on the __*_type_info type if we haven't seen a definition.
+
+2001-12-03 Hans-Peter Nilsson <hp@bitrange.com>
+
+ * decl.c (xref_basetypes): Don't use C99 construct in tag_code
+ declaration and initialization.
+
+2001-12-03 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ * mangle.c (write_expression): Handle CAST_EXPR, STATIC_CAST_EXPR,
+ CONST_CAST_EXPR.
+ * operators.def: Add CAST_EXPR, STATIC_CAST_EXPR, CONST_CAST_EXPR.
+
+2001-12-03 Mumit Khan <khan@nanotech.wisc.edu>
+
+ PR c++/3394
+ * decl.c (xref_basetypes): Handle attributes between
+ 'class' and name.
+
+2001-12-03 Jason Merrill <jason@redhat.com>
+
+ * class.c (finish_vtbls): Fill in BINFO_VPTR_FIELD in the
+ immediate binfos for our virtual bases.
+
+2001-11-29 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/3048
+ * cp-tree.h (ovl_member): Remove.
+ * decl2.c (merge_functions): Handle extern "C" functions
+ specially.
+ * tree.c (ovl_member): Remove.
+
+ PR c++/4842
+ * class.c (get_basefndecls): Take an IDENTIFIER_NODE, not a
+ FUNCTION_DECL, as input.
+ (mark_overriders): Remove.
+ (warn_hidden): Rework for the new ABI.
+
+ PR c++/3471
+ * call.c (convert_like_real): Do not build additional temporaries
+ for rvalues of class type.
+
+2001-11-20 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/3637
+ * call.c (non_reference): Add documentation.
+ (convert_class_to_reference): Do not strip reference types
+ from conversion operators.
+ (maybe_handle_ref_bind): Simplify.
+ (compare_ics): Correct handling of references.
+
+2001-11-19 Mark Mitchell <mark@codesourcery.com>
+
+ * cp/decl2.c (grok_alignof): Make sure that expression created
+ while processing a template do not have a type.
+ * cp/typeck.c (c_sizeof): Likewise.
+ (expr_sizeof): Likewise.
+ (c_alignof): Likewise.
+
+2001-11-14 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * Make-lang.in: Change all uses of $(manext) to $(man1ext).
+
+2001-10-23 Release Manager
+
+ * GCC 3.0.2 Released.
+
+2001-10-03 John David Anglin <dave@hiauly1.hia.nrc.ca>
+
+ * rtti.c (get_tinfo_decl): Call typeinfo_in_lib_p with the type used
+ to build the declaration instead of the declaration itself.
+
+2001-09-28 Craig Rodrigues <rodrigc@gcc.gnu.org>
+
+ PR c++/4095
+ * rtti.c (create_pseudo_type_info): Fix parameter.
+
+2001-09-21 Richard Henderson <rth@redhat.com>
+
+ * class.c (set_vindex): Mind TARGET_VTABLE_USES_DESCRIPTORS.
+ (build_vtbl_initializer): Likewise.
+ (build_vfn_ref): New.
+ * cp-tree.h: Declare it.
+ * call.c (build_over_call): Use it.
+ * decl2.c (mark_vtable_entries): Mark FDESC_EXPR.
+ * typeck.c (get_member_function_from_ptrfunc): Mind descriptors.
+ * rtti.c (get_tinfo_decl_dynamic): Use build_vtbl_ref instead
+ of build_vfn_ref.
+
+2001-09-15 Gabriel Dos Reis <gdr@merlin.codesourcery.com>
+
+ * Make-lang.in (cp/error.o): Depend on real.h
+ * error.c: #include "real.h"
+
+2001-09-06 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/3986
+ * class.c (force_canonical_binfo_r): Check & move an indirect
+ primary base first.
+ (force_canonical_binfo): Check that it's not already
+ canonical.
+ (mark_primary_virtual_base): Remove BINFO parameter.
+ (mark_primary_bases): Adjust, set BINFO_LOST_PRIMARY_P here.
+
+ (binfo_ctor_vtable): Add prototype.
+ (get_primary_binfo): Initialize RESULT.
+
+2001-09-04 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/4203
+ * call.c (build_over_call): Do not optimize any empty base
+ construction.
+
+2001-08-30 Kurt Garloff <garloff@suse.de>
+
+ * optimize.c (inlinable_function_p): Allow only smaller single
+ functions. Halve inline limit after reaching recursive limit.
+
+2001-08-23 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ * pt.c (maybe_fold_nontype_arg): Use TREE_TYPE of ARG as the
+ criterion to avoid rebuilding expression tree instead of
+ processing_template_decl.
+
+2001-08-19 Release Manager
+
+ * GCC 3.0.1 Released.
+
+2001-08-19 Release Manager
+
+ * GCC 3.0.1 Released.
+
+2001-08-16 Mark Mitchell <mark@codesourcery.com>
+
+ * cvt.c (convert_to_void): Preserve TREE_SIDE_EFFECTS
+ on COMPOUND_EXPRs.
+
+2001-08-13 Mark Mitchell <mark@codesourcery.com>
+
+ * call.c (build_over_call): Mark COMPOUND_EXPRs generated for
+ empty class assignment as having side-effects to avoid
+ spurious warnings.
+
+2001-08-07 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/3820
+ Stop using TYPE_NONCOPIED_PARTS.
+ * call.c (build_over_call): Be careful when copy constructing
+ or assigning to an empty class.
+ * class.c (check_bases_and_members): It has a
+ COMPLEX_ASSIGN_REF if it has a vptr.
+ (layout_class_type): Don't add empty class padding to
+ TYPE_NONCOPIED_PARTS.
+ (finish_struct_1): Don't add the VFIELD either.
+ * cp-tree.h (TYPE_HAS_TRIVIAL_INIT_REF): Mention _copy_
+ initialization.
+
+2001-08-02 Nathan Sidwell <nathan@codesourcery.com>
+
+ Remove -fhonor-std.
+ * NEWS: Document.
+ * decl2.c (lang_f_options): Remove honor-std.
+ (unsupported_options): Add honor-std.
+ * lang-options.h: Remove -fhonor-std, -fno-honor-std.
+
+2001-07-31 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/3631
+ * class.c (update_vtable_entry_for_fn): The fixed adjustment
+ of a virtual thunk should be from declaring base.
+
+2001-07-31 Nathan Sidwell <nathan@codesourcery.com>
+
+ * class.c (dfs_ctor_vtable_bases_queue_p): Always walk into
+ the shared virtual base, so preserving inheritance graph order.
+
+2001-07-27 Nathan Sidwell <nathan@codesourcery.com>
+
+ * class.c (mark_primary_virtual_base): Don't adjust base
+ offsets here.
+ (dfs_unshared_virtual_bases): Adjust them here.
+ (mark_primary_bases): Explain why we adjust at the end.
+
+2001-07-27 Nathan Sidwell <nathan@codesourcery.com>
+
+ * class.c (finish_struct_1): When copying the primary base's
+ VFIELD, make sure we find it is at offset zero.
+
+2001-07-26 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/3621
+ * spew.c (yylex): Only copy the token's lineno, if it is
+ non-zero.
+
+2001-07-26 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/3624
+ * call.c (resolve_args): Simplify, call
+ convert_from_reference.
+ (build_new_op): Resolve and convert from reference ARG1
+ earlier. Adjust ARG2 & ARG3 resolve and conversion.
+
+2001-07-26 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/3152
+ * decl.c (grokdeclarator): Detect when a function typedef is
+ declaring a function, and create last_function_parms correctly.
+
+2001-07-25 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/3416
+ * call.c (build_conditional_expr): Recheck args after
+ conversions.
+ * cp-tree.h (build_conditional_expr): Move to correct file.
+ * typeck.c (decay_conversion): Diagnose any unknown types
+ reaching here.
+ (build_binary_op): Don't do initial decay or default
+ conversions on overloaded functions.
+ (build_static_cast): Don't do a decay conversion here.
+
+2001-07-25 Jason Merrill <jason_merrill@redhat.com>
+
+ PR c++/3529
+ Copied from mainline.
+ * cvt.c (convert_lvalue): New fn.
+ * cp-tree.h: Declare it.
+ * method.c (do_build_assign_ref): Use it.
+ (do_build_copy_constructor): Convert parm to base types
+ before calling base constructors.
+
+2001-07-25 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/3543
+ * typeck.c (condition_conversion): Resolve an OFFSET_REF.
+ * expr.c (cplus_expand_expr): An OFFSET_REF should never get here.
+
+2001-07-25 Nathan Sidwell <nathan@codesourcery.com>
+
+ * class.c (build_vbase_offset_vbtl_entries): Look for
+ non-primary base of which we are a sub vtable.
+
+2001-07-20 Daniel Berlin <dan@cgsoftware.com>
+
+ * Make-lang.in (cp/optimize.o): Depend on $(PARAMS_H), not
+ params.h.
+
+2001-07-18 Xavier Delacour <xavier@fmaudio.net>,
+ Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
+
+ * NEWS (Changes in GCC 3.0): Fix typo.
+
+2001-07-12 Mark Mitchell <mark@codesourcery.com>
+
+ * decl.c (make_rtl_for_nonlocal_decl): Set DECL_C_HARD_REGISTER
+ for `register' variables with an asm-specification.
+
+2001-07-11 Mark Mitchell <mark@codesourcery.com>
+
+ * semantics.c (finish_asm_stmt): Mark the output operands
+ to an asm addressable, if necessary.
+
+2001-07-10 Mark Mitchell <mark@codesourcery.com>
+
+ * pt.c (tsubst_decl): Set DECL_CONTEXT for namespace-scope
+ variables.
+
+2001-06-19 Richard Sandiford <rsandifo@redhat.com>
+
+ * except.c (initialize_handler_parm): Expect __cxa_begin_catch to
+ return pointers to data members by reference rather than by value.
+
+2001-06-18 Jason Merrill <jason_merrill@redhat.com>
+
+ * class.c (dfs_accumulate_vtbl_inits): Just point to the base we're
+ sharing a ctor vtable with. Merge code for cases 1 and 2.
+ (binfo_ctor_vtable): New fn.
+ (build_vtt_inits, dfs_build_secondary_vptr_vtt_inits): Use it.
+
+ * class.c (dfs_find_final_overrider): Fix logic.
+
+ * pt.c (unify): Don't recurse between the POINTER_TYPE and the
+ OFFSET_TYPE. If we're adding cv-quals, the extra ones would be on
+ PARM, not ARG.
+
+20010617 Release Manager
+
+ * GCC 3.0 Released.
+
+2001-06-14 Jason Merrill <jason_merrill@redhat.com>
+
+ * class.c (update_vtable_entry_for_fn): Uncomment optimization to use
+ virtual thunk instead of non-virtual.
+ (get_matching_virtual): Uncomment.
+
+2001-06-14 Nathan Sidwell <nathan@codesourcery.com>
+
+ * class.c (dfs_accumulate_vtbl_inits): For case 2 & 3, make sure
+ we've not emerged from the hierarchy of RTTI_BINFO on reaching
+ a non-virtual base.
+
+2001-06-13 Mark Mitchell <mark@codesourcery.com>
+
+ * NEWS: Update release number.
+
+2001-06-12 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/3130, c++/3131, c++/3132
+ * cp-tree.h (BINFO_UNSHARED_MARKED): New #define.
+ * class.c (force_canonical_binfo_r): Move
+ BINFO_UNSHARED_MARKED, BINFO_LOST_PRIMARY_P. Don't move
+ virtual bases unless they're primary and what they're primary
+ too has been moved.
+ (dfs_unshared_virtual_bases): Use BINFO_UNSHARED_MARKED. Cope
+ with morally virtual bases. Duplicate BINFO_LOST_PRIMARY_P and
+ BINFO_PRIMARY_BASE_OF. Clear BINFO_VTABLE for all but the most
+ derived binfo.
+ (mark_primary_bases): Use BINFO_UNSHARED_MARKED.
+ (layout_nonempty_base_or_field): Add most derived type
+ parameter. Adjust.
+ (layout_empty_base): Likewise.
+ (build_base_field): Likewise.
+ (build_base_fields): Likewise.
+ (propagate_binfo_offsets): Add most derived type
+ parameter. Skip non canonical virtual bases too.
+ (dfs_set_offset_for_unshared_vbases): Don't skip primary
+ bases. Do skip canonical bases.
+ (layout_virtual_bases): Adjust.
+ (layout_class_type): Adjust.
+ (dfs_get_primary_binfo): Build list of virtual primary base
+ candidates.
+ (get_primary_binfo): Check that the shared virtual primary
+ base candidate was found first.
+ (accumulate_vtbl_inits): Don't do anything for non-vptr
+ containing binfos. For case 1 primary virtual bases, keep
+ checking that we've not emerged from the hierarchy of RTTI_BINFO.
+
+2001-06-12 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/3089
+ * class.c (dfs_accumulate_vtbl_inits): Always walk down the
+ hierarchy looking for primary bases for a ctor
+ vtable. Recursively call oneself, if we meet our primary via
+ this route and haven't met it yet via inheritance graph order.
+
+2001-06-11 Mark Mitchell <mark@codesourcery.com>
+
+ * lang-options.h: Emit documentation for -fno-honor-std, not
+ -fhonor-std.
+
+2001-06-10 Alexandre Oliva <aoliva@redhat.com>
+
+ * typeck.c (get_member_function_from_ptrfunc) [vbit_in_delta]:
+ Don't clobber delta.
+ (expand_ptrmemfunc_cst) [ptrmemfunc_vbit_in_delta]: Adjust pfn.
+
+2001-06-08 Jakub Jelinek <jakub@redhat.com>
+
+ * search.c (lookup_field_r): If looking for type and non-TYPE_DECL
+ is found, look first if name does not match the structure name.
+
+2001-06-08 Nathan Sidwell <nathan@codesourcery.com>
+
+ * decl.c (duplicate_decls): Fix DECL_TEMPLATE_RESULT thinko
+ in previous change.
+
+2001-06-08 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/2929
+ * friend.c (do_friend): Use push_decl_namespace for classes at
+ namespace scope.
+
+2001-06-08 Nathan Sidwell <nathan@codesourcery.com>
+ Jason Merrill <jason_merrill@redhat.com>
+
+ PR c++/3061
+ * class.c (build_secondary_vtable): Use assert, rather than an error
+ message.
+ (dfs_fixup_binfo_vtbls): BINFO_VTABLE might be NULL.
+ (dfs_accumulate_vtbl_inits): A lost primary virtual base may
+ be between ORIG_BINFO and RTTI_BINFO, but neither of them.
+ Don't set BINFO_VTABLE for a primary virtual base.
+
+2001-06-07 Mark Mitchell <mark@codesourcery.com>
+
+ * decl.c (duplicate_decls): Update source position information
+ when a template function is defined.
+
+2001-06-07 Phil Edwards <pme@sources.redhat.com>
+
+ * lang-specs.h: Move -D_GNU_SOURCE to config/linux.h.
+
+2001-06-07 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/2914
+ * decl.c (pushtag): Don't push into a complete type's scope.
+
+2001-06-06 Jason Merrill <jason_merrill@redhat.com>
+
+ * cp-tree.h (THUNK_GENERATE_WITH_VTABLE_P): Lose.
+ (struct lang_decl_flags): Lose generate_with_vtable_p.
+ (BV_GENERATE_THUNK_WITH_VTABLE_P): Lose.
+ * class.c (copy_virtuals): Adjust.
+ * decl2.c (mark_vtable_entries): Adjust.
+ * method.c (make_thunk, build_vtable_entry): Adjust.
+ * class.c (update_vtable_entry_for_fn): Only look as far as the
+ first defining class.
+ (build_vtbl_initializer): Put nothing in the slot for a function only
+ defined in a lost primary virtual base.
+ (add_vcall_offset_vtbl_entries_1): Use the same code for
+ the lost primary case and the normal case.
+ (dfs_unshared_virtual_bases): Don't lose a non-virtual primary base.
+ (get_vfield_offset, get_derived_offset): Lose.
+ (dfs_find_final_overrider): Use look_for_overrides_here.
+ (get_matching_virtual): New fn.
+ * semantics.c (emit_associated_thunks): Check BV_USE_VCALL_INDEX_P,
+ not BV_VCALL_INDEX.
+ * search.c (look_for_overrides_here): Split out from...
+ (look_for_overrides_r): Here.
+
+ * class.c (find_final_overrider): Return error_mark_node on error.
+
+2001-06-06 John David Anglin <dave@hiauly1.hia.nrc.ca>
+
+ * call.c (convert_default_arg): Use INTEGRAL_TYPE_P.
+ (build_over_call): Likewise.
+ * decl.c (grokparms): Likewise.
+ * pt.c (tsubst_decl): Likewise.
+ * typeck.c (convert_arguments): Likewise.
+
+2001-06-05 Mark Mitchell <mark@codesourcery.com>
+
+ * semantics.c (begin_class_definition): Robustify.
+
+ * pt.c (instantiate_decl): Tell the repository code about the
+ clones, not the cloned functions.
+ * repo.c (repo_template_used): Explicitly instantiate the cloned
+ function, not the clones.
+
+2001-06-05 Nathan Sidwell <nathan@codesourcery.com>
+
+ * call.c (build_user_type_conversion_1): Set ICS_USER_FLAG and
+ ICS_BAD_FLAG on created conversion.
+ (compare_ics): Break out rank.
+
+2001-06-05 Nathan Sidwell <nathan@codesourcery.com>
+
+ * class.c (layout_vtable_decl): Fix off by one error on
+ build_index_type.
+ (build_vtt): Likewise.
+ (build_ctor_vtbl_group): Likewise.
+
+2001-06-05 Nathan Sidwell <nathan@codesourcery.com>
+
+ * class.c (maybe_indent_hierarchy): New function.
+ (dump_class_hierarchy_r): Add flags. Dump extra binfo
+ information, if enabled. Use maybe_indent_hierarchy. Adjust
+ output format.
+ (dump_class_hierarchy): Adjust prototype. Adjust output format.
+ (dump_array, dump_vtable, dump_vtt): New functions.
+ (finish_struct_1): Adjust hierarchy dumping.
+ (initialize_vtable): Call dump_vtable.
+ (build_vtt): Call dump_vtt.
+ (build_ctor_vtbl_group): Call dump_vtable.
+ * decl2.c (flag_dump_class_layout): Remove.
+ (cxx_decode_option): Remove dump translation unit
+ and dump class hierarchy check. Call dump_switch_p.
+ (finish_file): Adjust dumping.
+ (dump.c): Only dump base classes if not TDF_SLIM.
+ Only dump namespace members if not TDF_SLIM.
+ * optimize.c (dump_function): New function.
+ (optimize_function): Call dump_function.
+ * semantics.c (expand_body): Use dump_enabled_p.
+
+2001-06-01 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR g++/2936
+ Part missed from first commit
+ * decl2.c (finish_anon_union): Copy context.
+
+2001-05-30 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR g++/2936
+ * optimize.c (remap_decl): Remap anonymous aggregate members too.
+
+2001-05-26 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR g++/2823
+ * semantics.c (expand_body): Don't optimize thunks.
+
+2001-05-24 Mark Mitchell <mark@codesourcery.com>
+
+ * decl.c (duplicate_decls): Tidy.
+ (init_decl_processing): Always set flag_no_builtin.
+
+2001-05-24 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/2184
+ * decl2.c (do_local_using_decl): Push the decls, even in a
+ template.
+
+2001-05-22 Mark Mitchell <mark@codesourcery.com>
+
+ * optimize.c (initialize_inlined_parameters): Don't set
+ TREE_READONLY for a VAR_DECL taking the place of an inlined
+ PARM_DECL.
+
+2001-05-22 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * parse.y: Refer to compound literals as such, not as
+ constructor-expressions.
+
+2001-05-21 Mark Mitchell <mark@codesourcery.com>
+
+ * call.c (build_op_delete_call): Ignore exception-specifications
+ when looking for matching delete operators.
+ * init.c (build_new_1): Compute whether or not the allocation
+ function used is a placement allocation function or not, and
+ communicate this information to build_op_delete_call.
+
+2001-05-21 Jason Merrill <jason_merrill@redhat.com>
+
+ * decl2.c (lang_f_options): Remove huge-objects, vtable-thunks.
+ (unsupported_options): Correspondingly.
+
+2001-05-19 Zack Weinberg <zackw@stanford.edu>
+
+ * except.c (choose_personality_routine): Export. Add
+ explanatory comment. Take an enum languages, not a boolean.
+ (initialize_handler_parm): Adjust to match.
+ * cp-tree.h: Prototype choose_personality_routine.
+ * lex.c (handle_pragma_java_exceptions): New function.
+ (init_cp_pragma): Register #pragma GCC java_exceptions.
+
+2001-05-20 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/2781
+ * optimize.c (update_cloned_parm): Copy addressability and other
+ flags.
+
+2001-05-18 Jason Merrill <jason_merrill@redhat.com>
+
+ * class.c (build_vtable): Set DECL_ASSEMBLER_NAME for vtables here.
+ (get_vtable_decl, build_vtt): Not here.
+
+2001-05-17 Mark Mitchell <mark@codesourcery.com>
+
+ * except.c (cp_protect_cleanup_actions): New function.
+ (init_exception_processing): Don't set protect_cleanup_actions
+ here. Do set lang_protect_cleanup_actions.
+
+2001-05-16 Nathan Sidwell <nathan@codesourcery.com>
+
+ * spew.c (read_token): Call yyerror on all unexpected tokens.
+
+2001-05-12 Richard Henderson <rth@redhat.com>
+
+ EH merge from mainline:
+
+ 2001-04-23 Jason Merrill <jason_merrill@redhat.com>
+ * except.c (build_throw): Wrap the initialization of the exception
+ object in a MUST_NOT_THROW_EXPR.
+ (do_free_exception): #if 0.
+
+ * cp-tree.def (EH_SPEC_BLOCK): New.
+ (MUST_NOT_THROW_EXPR): New.
+ * cp-tree.h: Update changed function declarations.
+ (CPTI_PUSH_EXCEPTION_IDENTIFIER): Remove.
+ (CPTI_CALL_UNEXPECTED): New.
+ (struct cp_language_function): Rename x_eh_spec_try_block
+ to x_eh_spec_block.
+ (EH_SPEC_STMTS, EH_SPEC_RAISES): New.
+ * decl.c (current_binding_level): If no current function
+ bindings, revert to scope_chain.
+ (initialize_predefined_identifiers): Remove __cp_push_exception.
+ (store_parm_decls): Use begin_eh_spec_block.
+ (finish_function): Use finish_eh_spec_block.
+ (mark_lang_function): Update for name changes.
+ * decl2.c (finish_file): No mark_all_runtime_matches.
+ * dump.c (cp_dump_tree): Handle new tree codes.
+ * error.c (dump_expr) [BIND_EXPR]: Fix typo.
+ * except.c (catch_language_init, catch_language): Remove.
+ (init_exception_processing): Don't set language code.
+ Initialize call_unexpected_node, protect_cleanup_actions,
+ eh_personality_libfunc, lang_eh_runtime_type.
+ (call_eh_info, push_eh_info, get_eh_info, get_eh_value): Remove.
+ (get_eh_type, get_eh_caught, get_eh_handlers): Remove.
+ (prepare_eh_type): Split out type canonicalizations ...
+ (build_eh_type_type): ... from here.
+ (build_eh_type_type_ref): Remove.
+ (mark_all_runtime_matches): Remove.
+ (build_exc_ptr): New.
+ (do_begin_catch, do_end_catch): New.
+ (do_pop_exception): Remove.
+ (build_terminate_handler): Remove.
+ (choose_personality_routine): Split out language choice from ...
+ (initialize_handler_parm): ... here.
+ Use MUST_NOT_THROW_EXPR.
+ (expand_start_catch_block): Use do_begin_catch. Simplify Java
+ exception object handling.
+ (expand_start_eh_spec, expand_end_eh_spec): Remove.
+ (expand_exception_blocks, alloc_eh_object): Remove.
+ (begin_eh_spec_block, finish_eh_spec_block): New.
+ (do_allocate_exception, do_free_exception): New.
+ (expand_throw): Merge into ...
+ (build_throw): ... here. Update for abi.
+ * expr.c (cplus_expand_expr): No expand_internal_throw.
+ Handle MUST_NOT_THROW_EXPR.
+ * pt.c (tsubst_expr): Handle EH_SPEC_BLOCK.
+ * semantics.c (*) Update for except.h name changes.
+ (genrtl_try_block): No protect_with_terminate.
+ (genrtl_eh_spec_block): New.
+ (genrtl_handler): Don't emit the goto here.
+ (cp_expand_stmt): Handle EH_SPEC_BLOCK.
+ (genrtl_finish_function): Don't expand_exception_blocks.
+ * tree.c (cp_statement_code_p): Handle EH_SPEC_BLOCK.
+
+ * decl.c (struct named_label_list): Rename eh_region to
+ in_try_scope, add in_catch_scope.
+ (struct binding_level): Rename eh_region to is_try_scope,
+ add is_catch_scope.
+ (note_level_for_try): Rename from note_level_for_eh.
+ (note_level_for_catch): New.
+ (poplevel): Copy both is_try_scope and is_catch_scope to
+ the named_label_list struct.
+ (check_previous_goto_1): Don't check for catch block via
+ DECL_ARTIFICIAL; use in_try_scope instead.
+ (check_goto): Likewise.
+ * cp-tree.h (note_level_for_try, note_level_for_catch): Declare.
+ * except.c (expand_start_catch_block): Call note_level_for_catch.
+ * semantics.c (begin_compound_stmt): Update for note_level_for_try.
+
+ * except.c: Use USING_SJLJ_EXCEPTIONS instead of
+ exceptions_via_longjmp.
+
+2001-05-12 Alexandre Oliva <aoliva@redhat.com>
+
+ * cp-tree.h (ptrmemfunc_vbit_where_t): Declare type.
+ * typeck.c (get_member_function_from_ptrfunc,
+ build_ptrmemfunc, expand_ptrmemfunc_cst): Take
+ TARGET_PTRMEMFUNC_VBIT_LOCATION into account.
+
+2001-05-07 Mark Mitchell <mark@codesourcery.com>
+
+ * class.c (walk_subobject_offsets): Add max_offset parameter.
+ (record_subobject_offsets): Adjust call.
+ (layout_conflict_p): Stop walking when we get past the last empty
+ subobject.
+
+2001-05-03 Mark Mitchell <mark@codesourcery.com>
+
+ * cp-tree.h (flag_inline_trees): Update documentation.
+ * decl.c (init_decl_processing): Adjust handling of
+ flag_inline_functions and flag_inline_trees to support -O3.
+ (grokfndecl): Set DECL_INLINE on all functions if that's what
+ the user requested.
+ (save_function_data): Clear DECL_INLINE in
+ current_function_cannot_inline is non-NULL.
+ * decl2.c (flag_inline_trees): Update documentation.
+
+2001-05-03 Nathan Sidwell <nathan@codesourcery.com>
+
+ * dump.c (cp_dump_tree, USING_STMT case): New case.
+ * tree.c (cp_statement_code_p): Add USING_STMT.
+ * decl2.c (do_using_directive): Add the using directive statement.
+
+ * tree.c (walk_tree): Reformat an if block.
+
+2001-05-02 Mark Mitchell <mark@codesourcery.com>
+
+ * decl.c (compute_array_index_type): Don't try to do anything with
+ the indices when processing a template.
+
+2001-05-01 Mark Mitchell <mark@codesourcery.com>
+
+ * decl2.c (do_using_directive): Revert previous patch.
+
+2001-05-01 Nathan Sidwell <nathan@codesourcery.com>
+
+ * cp-tree.def (USING_STMT): New statement node.
+ * cp-tree.h (USING_STMT_NAMESPACE): New macro.
+ * decl2.c (do_using_directive): Add USING_STMT to statement
+ tree. Don't emit errors when processing template decl.
+ * pt.c (tsubst_expr, USING_STMT case): New case.
+ * semantics.c (cp_expand_stmt, USING_STMT case): New case.
+
+2001-05-01 Nathan Sidwell <nathan@codesourcery.com>
+
+ * call.c (build_new_op): Convert args from reference here.
+ (build_conditional_expr): Don't convert here.
+
+2001-05-01 Nathan Sidwell <nathan@codesourcery.com>
+
+ * spew.c (last_token_id): New static variable.
+ (read_token): Set it here.
+ (yyerror): Use it here.
+
+2001-04-30 Richard Henderson <rth@redhat.com>
+
+ * cvt.c: Downcase C_PROMOTING_INTEGER_TYPE_P invocations.
+ * decl.c: Likewise.
+
+2001-04-30 Mark Mitchell <mark@codesourcery.com>
+
+ * gxxint.texi: Remove.
+ * Make-lang.in: Remove all traces of gxxint.texi.
+
+Mon Apr 30 16:14:10 2001 Mark P Mitchell <mark@codesourcery.com>
+
+ * decl2.c (start_static_initialization_or_destruction): Correct
+ logic to handle the -fno-use-cxa-atexit case.
+
+2001-04-30 Mark Mitchell <mark@codesourcery.com>
+
+ * optimize.c (update_cloned_parm): New function.
+ (maybe_clone_body): Use it. Update the `this' parameter too.
+
+2001-04-29 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * decl2.c (unsupported_options): Add new-abi.
+ * lang-options.h: Remove no longer supported options.
+
+2001-04-27 Nathan Sidwell <nathan@codesourcery.com>
+
+ * except.c (can_convert_eh): Don't check template parms,
+ typename types etc.
+
+2001-04-27 Nathan Sidwell <nathan@codesourcery.com>
+
+ * optimize.c (maybe_clone_body): Copy parameter names and locations.
+
+2001-04-27 Nathan Sidwell <nathan@codesourcery.com>
+
+ * cp-tree.h (adjust_clone_args): Prototype new function.
+ * class.c (adjust_clone_args): New function.
+ * decl.c (start_function): Call it for in charge ctors.
+
+2001-04-26 Mark Mitchell <mark@codesourcery.com>
+
+ * method.c (use_thunk): Make sure that thunks really are emitted
+ when requested.
+
+ Remove support for -Wextern-inline, -flabels-ok, -fvtable-gc, -fxref
+ * cp-tree.h (warn_extern_inline): Remove.
+ (flag_labels_ok): Likewise.
+ * decl2.c (warn_extern_inline): Remove.
+ (flag_labels_ok): Likewise.
+ (lang_f_options): Remove labels-ok, vtable-gc, xref.
+ (unsupported_options): Add them.
+ (cxx_decode_option): Don't accept -Wextern-inline.
+ * method.c (hack_identifier): Remove -flabels-ok support.
+ * spew.c (see_typename): Likewise.
+
+2001-04-26 Nathan Sidwell <nathan@codesourcery.com>
+
+ * mangle.c (write_chars): New macro.
+ (hwint_to_ascii): New function
+ (write_number): Use it.
+ (write_integer_cst): Deal with really big numbers.
+
+2001-04-25 Mark Mitchell <mark@codesourcery.com>
+
+ * optimize.c (maybe_clone_body): Copy TREE_PUBLIC before emitting
+ the clone.
+
+2001-04-25 Nathan Sidwell <nathan@codesourcery.com>
+
+ * decl.c (grokdeclarator): Set context of namespace scope
+ TYPE_DECLS.
+
+2001-04-24 Zack Weinberg <zackw@stanford.edu>
+
+ * cp/optimize.c: Include hashtab.h.
+ (struct inline_data): Add tree_pruner.
+ (expand_call_inline, expand_calls_inline): Use it when calling
+ walk_tree.
+ (optimize_function): Initialize and free tree_pruner.
+
+2001-04-20 Mark Mitchell <mark@codesourcery.com>
+
+ * cp-tree.h (finish_enum): Change prototype.
+ * decl.c (finish_enum): Reorganize.
+ * parse.y (structsp): Adjust calls to finish_enum.
+
+2001-04-20 Nathan Sidwell <nathan@codesourcery.com>
+
+ * tree.c (cp_tree_equal): Adjust final switch formatting. Add
+ 't' case.
+
+2001-04-20 Nathan Sidwell <nathan@codesourcery.com>
+
+ * class.c (dfs_unshared_virtual_bases): Add ATTRIBUTE_UNUSED.
+ (layout_empty_base): Return at end flag.
+ (build_base_field): Likewise.
+ (build_base_fields): Likewise.
+ (layout_virtual_bases): Don't add 1 to eoc value.
+ (end_of_class): Use full size for empty bases.
+ (layout_class_type): Clear CLASSNEARLY_EMPTY_P if we appended
+ empty bases. Don't add 1 to eoc value. Only add trailing padding
+ if we're an empty class with no empty bases.
+ (dump_class_hierarchy): Dump size and alignment.
+
+2001-04-19 Mark Mitchell <mark@codesourcery.com>
+
+ * cp-tree.h (DECL_LANGUAGE): Don't assume DECL_LANG_SPECIFIC is
+ set.
+ (SET_DECL_LANGUAGE): New macro.
+ * decl.c (duplicate_decls): Use SET_DECL_LANGUAGE.
+ (pushdecl): Likewise.
+ (build_library_fn_1): Likewise.
+ (build_cp_library_fn): Likewise.
+ (grokfndecl): Likewise.
+ (grokvardecl): Mark `extern "C"' variables as having C linkage.
+ * decl2.c (grokclassfn): Use SET_DECL_LANGUAGE.
+ * lex.c (retrofit_lang_decl): Likewise.
+ * mangle.c (mangle_decl_string): Don't mangle the names of
+ variables declared with C language linkage.
+ * semantics.c (finish_member_declaration): Use SET_DECL_LANGUAGE.
+
+2001-04-18 John David Anglin <dave@hiauly1.hia.nrc.ca>
+
+ * semantics.c (simplify_aggr_init_exprs_r): Don't restore
+ flag_access_control from uninitialized storage.
+
+2001-04-15 Mark Mitchell <mark@codesourcery.com>
+
+ * cp-tree.h (TYPE_PTRMEM_CLASS_TYPE): Improve documentation.
+ * mangle.c (write_pointer_to_member_type): Fix mangling of
+ pointers to cv-qualified member function types.
+
+ * init.c (build_delete): Create a SAVE_EXPR for the address if
+ we're going to use it more than once.
+
+2001-04-13 Mark Mitchell <mark@codesourcery.com>
+
+ * cp-tree.h (DELTA2_FROM_PTRMEMFUNC): Remove.
+ (expand_ptremfunc_cst): Change prototype.
+ (delta2_from_ptrmemfunc): Remove.
+ * expr.c (cplus_expand_constant): Adjust call to
+ expand_ptrmemfunc_cst.
+ * typeck.c (build_ptrmemfunc1): Simplify.
+ (build_ptrmemfunc): Make sure that casting a PTRMEM_CST still
+ results in a constant.
+ (expand_ptrmemfunc_cst): Remove idx and delta2 parameters.
+ (delta2_from_ptrmemfunc): Remove.
+ (pfn_from_ptrmemfunc): Adjust call to expand_ptrmemfunc_cst.
+
+2001-04-11 Jason Merrill <jason_merrill@redhat.com>
+
+ * cp-tree.h (TYPE_LINKAGE_IDENTIFIER): New macro.
+ (TYPE_ANONYMOUS_P): New macro.
+ (TAGGED_TYPE_P): New macro.
+ * decl.c (check_tag_decl): Use TYPE_ANONYMOUS_P.
+ (grokfndecl, grokvardecl, grokdeclarator): Likewise.
+ * tree.c (no_linkage_helper): Likewise.
+ * semantics.c (begin_class_definition): Likewise.
+ * pt.c (convert_template_argument): Likewise.
+ * lex.c (check_for_missing_semicolon): Likewise.
+
+2001-04-12 Nathan Sidwell <nathan@codesourcery.com>
+
+ * class.c (dfs_unshared_virtual_bases): New function.
+ (mark_primary_bases): Call it.
+ (check_bases): Ignore virtual bases when determining
+ nearly-emptiness.
+
+2001-04-12 Nathan Sidwell <nathan@codesourcery.com>
+
+ * method.c (make_thunk): Clear DECL_CLONED_FUNCTION.
+
+2001-04-11 Mark Mitchell <mark@codesourcery.com>
+
+ * optimize.c (maybe_clone_body): Copy DECL_NUM_STMTS from the
+ cloned function to the clone.
+
+2001-04-11 Jason Merrill <jason_merrill@redhat.com>
+
+ * error.c (GLOBAL_THING): Always use '__'.
+
+2001-04-11 Nathan Sidwell <nathan@codesourcery.com>
+
+ * method.c (implicitly_declare_fn): Commonize code for copy ctor
+ and assignment op. Set TREE_USED for parameter.
+
+2001-04-10 Richard Henderson <rth@redhat.com>
+
+ * typeck.c (build_array_ref): Push the array reference inside
+ COMPOUND_EXPR and COND_EXPR.
+
+2001-04-10 Mark Mitchell <mark@codesourcery.com>
+
+ * class.c (find_final_overrider_data): Add `candidates'.
+ (dfs_find_final_overrider): Don't issue error messages
+ prematurely.
+ (find_final_overrider): Issue error messages here.
+ (build_base_field): Don't warn about amgibuous direct bases here.
+ (warn_about_ambiguous_direct_bases): New function.
+ (layout_class_type): Use it.
+
+2001-04-05 Mark Mitchell <mark@codesourcery.com>
+
+ * cp-tree.h (DECL_THIS_INLINE): Rename to DECL_DECLARED_INLINE_P.
+ * decl.c (duplicate_decls): Adjust accordingly.
+ (maybe_commonize_var): Likewise.
+ (grokfndecl): Likewise.
+ (start_function): Likewise.
+ (start_method): Likewise.
+ * decl2.c (key_method): Likewise.
+ (import_export_decl): Likewise.
+ * method.c (implicitly_declare_fn): Likewise.
+ * optimize.c (maybe_clone_body): Likewise.
+
+2001-04-05 Benjamin Kosnik <bkoz@redhat.com>
+
+ * lang-specs.h: Add __DEPRECATED.
+
+2001-04-04 Jakub Jelinek <jakub@redhat.com>
+
+ * optimize.c (expand_call_inline): Only add newly inlined statements
+ into inlined_stmts.
+
+2001-04-03 Mark Mitchell <mark@codesourcery.com>
+
+ * cp-tree.h (OPERATOR_ASSIGN_FORMAT): Remove.
+ (OPERATOR_FORMAT): Likewise.
+ (OPERATOR_TYPENAME_FORMAT): Likewise.
+ * operators.def: Remove old name-mangling information.
+ * decl.c (grok_op_properties): Adjust accordingly.
+ * lex.c (init_operators): Likewise.
+ * rtti.c (get_tinfo_decl): Issue error messages about types that
+ have variable size.
+
+2001-04-03 Gabriel Dos Reis <gdr@codesourcery.com>
+
+ Correct semantics restrictions checking in throw-expression.
+ * except.c (is_admissible_throw_operand): New function.
+ (build_throw): Use it.
+
+2001-04-03 Mark Mitchell <mark@codesourcery.com>
+
+ * decl2.c (import_export_decl): Don't call import_export_class
+ when processing an inline member function.
+ * semantics.c (expand_body): Call import_export_decl before
+ emitting inline functions.
+
+2001-03-26 Mike Yang <yang@research.att.com>
+ Mark Mitchell <mark@codesourcery.com>
+
+ * dump.c (dump_access): New function.
+ (cp_dump_tree): Use it. Dump basetype information for class
+ types.
+
+2001-03-26 Mark Mitchell <mark@codesourcery.com>
+
+ * Makefile.in (optimize.o): Depend on params.h.
+ (duplicate_decls): Copy DECL_NUM_STMTS, not DECL_FRAME_SIZE.
+ (init_decl_processing): Set flag_no_inline when doing
+ inlining-on-trees.
+ * optimize.c: Include params.h.
+ (struct inline_data): Improve documentation of FNS. Add
+ FIRST_INLINED_FN, INLINED_STMTS, and CLONING_P.
+ (INSNS_PER_STMT): New macro.
+ (remap_block): Use CLONING_P.
+ (inlinable_function_p): Don't inline big functions.
+ (expand_call_inline): Keep track of how much inlining we've done.
+ (optimize_function): Set FIRST_INLINED_FN.
+ (maybe_clone_body): Set CLONING_P.
+ * semantics.c (simplify_aggr_init_exprs_r): Fix typing problems in
+ tree nodes.
+ (genrtl_finish_function): Clear DECL_DEFER_OUTPUT before calling
+ rest_of_compilation. Clear DECL_RTL for local variables
+ afterwards.
+ (clear_decl_rtl): New function.
+
+2001-03-26 Jakub Jelinek <jakub@redhat.com>
+
+ * mangle.c (write_discriminator): Use `_0' for discriminator 1,
+ not `_'.
+
+2001-03-26 Jakub Jelinek <jakub@redhat.com>
+
+ * decl.c (local_names): Define.
+ (push_local_name): New.
+ (grok_reference_init): Return init if initializing static reference
+ variable with non-constant instead of emitting it.
+ Move expand_static_init call to cp_finish_decl.
+ (layout_var_decl): Call push_local_name.
+ (maybe_commonize_var): Allow inlining functions even if they have
+ static local variables, use comdat_linkage for them if flag_weak.
+ (check_initializer): Call obscure_complex_init if
+ grok_reference_init returned non-zero.
+ (save_function_data): Clear x_local_names.
+ (pop_cp_function_context): Free x_local_names.
+ (mark_inlined_fns): Remove.
+ (mark_lang_function): Mark x_local_names.
+ (lang_mark_tree): Don't mark DECL_ACCESS for DECL_DISCRIMINATOR_P.
+ Mark inlined_fns as tree, remove call to mark_inlined_fns.
+ * class.c (alter_access): Ensure DECL_ACCESS is never set if
+ DECL_DISCRIMINATOR_P.
+ * cp-tree.h (cp_language_function): Add x_local_names.
+ (lang_decl_flags): Add discriminator into u2.
+ (lang_decl_inlined_fns): Remove.
+ (lang_decl): inlined_fns is now a TREE_VEC.
+ (DECL_DISCRIMINATOR_P, DECL_DISCRIMINATOR): Define.
+ * optimize.c (inlinable_function_p): DECL_INLINED_FNS is now a
+ TREE_VEC, not a custom structure.
+ (optimize_function): Likewise.
+ * mangle.c (discriminator_for_local_entity): Discriminate among
+ VAR_DECL local entities.
+ * search.c (dfs_access_in_type): If DECL_DISCRIMINATOR_P, DECL_ACCESS
+ is not valid.
+
+2001-03-22 Bryce McKinlay <bryce@albatross.co.nz>
+
+ * call.c (build_java_interface_fn_ref): Fix local declarations.
+
+2001-03-22 Bryce McKinlay <bryce@albatross.co.nz>
+
+ Add support for Java interface method calls.
+ * cp-tree.h (struct lang_type): Add java_interface flag.
+ (TYPE_JAVA_INTERFACE): New macro.
+ * tree.c (cp_valid_lang_attribute): Handle "java_interface" attribute
+ by setting TYPE_JAVA_INTERFACE.
+ * call.c (java_iface_lookup_fn): New static.
+ (build_over_call): If calling a method declared in a
+ TYPE_JAVA_INTERFACE, call build_java_interface_fn_ref to generate the
+ expression which resolves the function address.
+ (build_java_interface_fn_ref): New function.
+
+2001-03-22 Zack Weinberg <zackw@stanford.edu>
+
+ * lang-specs.h: Add zero initializer for cpp_spec field to
+ all array elements. Don't put an #ifdef inside the initializer
+ list; set a default for CPLUSPLUS_CPP_SPEC and use it.
+
+2001-03-22 Jakub Jelinek <jakub@redhat.com>
+
+ * method.c (do_build_assign_ref): Don't use build_modify_expr for
+ anonymous aggregates, since they don't have assignment operator
+ method.
+ * decl.c (fixup_anonymous_aggr): Disallow ctors, dtors and copy
+ assignment operators for anonymous structure fields.
+
+2001-03-21 Jason Merrill <jason@redhat.com>
+
+ * pt.c (instantiate_decl): Abort if we see a member constant
+ instantiation that doesn't already have its initializer.
+
+2001-03-21 Mark Mitchell <mark@codesourcery.com>
+
+ * class.c (build_clone): Clear DECL_ASSEMBLER_NAME.
+
+2001-03-21 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
+ based on an idea from Joe Buck <jbuck@synopsys.com>
+
+ * parse.y (bad_decl, template_arg_list_ignore, arg_list_ignore):
+ New nonterminals.
+ (data_def, component_decl): Add reductions to bad_decl.
+
+2001-03-21 Mark Mitchell <mark@codesourcery.com>
+
+ * mangle.c (mangle_decl_string): Mangle the names of overloaded
+ operators, even when they have `extern "C"' linkage.
+
+2001-03-19 Mark Mitchell <mark@codesourcery.com>
+
+ * class.c (get_vtable_decl): Use SET_DECL_ASSEMBLER_NAME,
+ COPY_DECL_ASSEMBLER_NAME, etc. Don't set DECL_ASSEMBLER_NAME
+ where it's not necessary.
+ (add_method): Remove optimization involving comparison of
+ DECL_ASSEMBLER_NAME.
+ (build_vtbl_or_vbase_field): Use SET_DECL_ASSEMBLER_NAME,
+ COPY_DECL_ASSEMBLER_NAME, etc. Don't set DECL_ASSEMBLER_NAME
+ where it's not necessary.
+ (check_methods): Likewise.
+ (build_clone): Likewise.
+ (built_vtt): Likewise.
+ * cp-tree.h (DECL_NEEDED_P): Likewise.
+ * decl.c (pushtag): Likewise.
+ (duplicate_decls): Likewise.
+ (pushdecl): Likewise.
+ (builtin_function): Likewise.
+ (build_library_fn_1): Set DECL_LANGUAGE for library functions.
+ (build_cp_library_fn): Likewise.
+ (maybe_commonize_var): Use SET_DECL_ASSEMBLER_NAME,
+ COPY_DECL_ASSEMBLER_NAME, etc. Don't set DECL_ASSEMBLER_NAME
+ where it's not necessary.
+ (make_rtl_for_nonlocal_decl): Likewise.
+ (cp_finish_decl): Likewise.
+ (grokfndecl): Likewise.
+ (grokvardecl): Likewise.
+ (grokdeclarator): Likewise.
+ (start_function): Likewise.
+ (cp_missing_return_ok_p): Likewise.
+ * decl2.c (grokclassfn): Likewise.
+ (check_classfn): Likewise.
+ (finish_static_data_member_decl): Likewise.
+ (grokfield): Likewise.
+ * error.c (GLOBAL_IORD_P): Remove.
+ (dump_global_iord): Improve output.
+ (dump_decl): Avoid using DECL_ASSEMBLER_NAME.
+ * except.c (nothrow_libfn_p): Summarily reject any function not in
+ namespace-scope.
+ * init.c (build_java_class_ref): Don't explicitly set
+ DECL_ASSEMBLER_NAME after calling mangle_decl.
+ * mangle.c (mangle_decl_string): Handle extern "C" functions.
+ (mangle_decl): Set the DECL_ASSEMBLER_NAME for the decl.
+ * method.c (set_mangled_name_for_decl): Don't explicitly set
+ DECL_ASSEMBLER_NAME after calling mangle_decl.
+ (make_thunk): Explicitly set the DECL_ASSEMBLER_NAME and
+ IDENTIFIER_GLOBAL_VALUE for the thunk.
+ * pt.c (set_mangled_name_for_template_decl): Remove.
+ (check_explicit_specialization): Don't use it.
+ (looup_template_class): Don't set DECL_ASSEMBLER_NAME.
+ (tsubst_friend_function): Likewise.
+ (tsubst_decl): Likewise.
+ (regenerate_decl_from_template): Use COPY_DECL_ASSEMBLER_NAME.
+ * rtti.c (get_tinfo_decl): Use SET_DECL_ASSEMBLER_NAME,
+ COPY_DECL_ASSEMBLER_NAME, etc. Don't set DECL_ASSEMBLER_NAME
+ where it's not necessary.
+ (tinfo_base_init): Likewise.
+ (create_real_tinfo_var): Likewise.
+ * search.c (looup_field_1): Likewise.
+ * semantics.c (finish_named_return_value): Likewise.
+ * tree.c (init_tree): Set lang_set_decl_assembler_name.
+
+2001-03-15 Neil Booth <neil@daikokuya.demon.co.uk>
+
+ * lex.c: Delete duplicate pending_lang_change.
+
+2001-03-15 Zack Weinberg <zackw@stanford.edu>
+
+ * decl.c: Replace all uses of 'boolean' with 'bool'.
+
+2001-03-15 Gabriel Dos Reis <gdr@codesourcery.com>
+
+ * except.c: Revert previous patch.
+
+2001-03-15 Gabriel Dos Reis <gdr@codesourcery.com>
+
+ Correct semantics restrictions checking in throw-expression.
+ * except.c (is_admissible_throw_operand): New function.
+ (build_throw): Use it.
+
+2001-03-14 Mark Mitchell <mark@codesourcery.com>
+
+ * decl.c (cp_make_fnname_decl): Set DECL_IGNORED_P on __FUNCTION__
+ and its ilk.
+
+ * class.c (build_clone): Use COPY_DECL_RTL, DECL_RTL_SET_P, etc.
+ * cp-tree.h (DECL_IN_MEMORY_P): Likewise.
+ * decl.c (duplicate_decls): Likewise.
+ (builtin_function): Likewise.
+ (build_library_fn): Likewise.
+ (build_cp_library_fn): Likewise.
+ (check_initializer): Likewise.
+ (cp_finish_decl): Likewise.
+ * decl2.c (grokfield): Likewise.
+ (grok_function_init): Remove #if 0'd code.
+ (finish_anon_union): Use COPY_DECL_RTL, DECL_RTL_SET_P, etc.
+ * friend.c (do_friend): Likewise.
+ * init.c (get_temp_regvar): Likewise.
+ * method.c (make_thunk): Likewise.
+ * pt.c (tsubst_friend_function): Likewise.
+ (tsubst_decl): Likewise.
+ (regenerate_decl_from_template): Likewise.
+ * semantics.c (genrtl_named_return_value): Likewise.
+ (expand_body): Likewise.
+ (genrtl_finish_function): Likewise.
+ * tree.c (cp_tree_equal): Likewise.
+
+2001-03-06 Zack Weinberg <zackw@stanford.edu>
+
+ * spew.c: Remove references to CPP_OSTRING.
+
+2001-03-06 Jeffrey Oldham <oldham@codesourcery.com>
+
+ * call.c (joust): Ensure more_specialized()'s argument length
+ parameter has correct value for constructors.
+
+2001-03-03 Nathan Sidwell <nathan@codesourcery.com>
+
+ * call.c (convert_like_real): Add extra semantics to INNER
+ parameter. Don't convert to temporary if a user conversion
+ gives us an lvalue that we're about to bind to a reference.
+ Set INNER to indicate pending reference binding on recursive
+ calls.
+
+2001-03-02 Nathan Sidwell <nathan@codesourcery.com>
+
+ * class.c (check_field_decls): Pointers to member do not a
+ non-pod struct make, as per DR 148.
+
+2001-03-02 Nathan Sidwell <nathan@codesourcery.com>
+
+ * call.c (joust): cp_pedwarn when using gnu extension concerning
+ worst conversion sequences.
+
+2001-03-01 Nathan Sidwell <nathan@codesourcery.com>
+
+ Implement using decls inside template functions.
+ * decl2.c (validate_nonmember_using_decl): Don't special case
+ fake_std_node in the global namespace. Don't reject early when
+ processing a template.
+ (do_local_using_decl): Add to statement tree. Don't do further
+ processing when building a template.
+ * pt.c (tsubst_expr, DECL_STMT case): Deal with USING_DECLs.
+
+2001-03-01 Nathan Sidwell <nathan@codesourcery.com>
+
+ * decl2.c (do_nonmember_using_decl): Don't complain if we find
+ same function. Do complain about ambiguating extern "C"
+ declarations.
+
+2001-02-28 Nathan Sidwell <nathan@codesourcery.com>
+
+ * pt.c (invalid_nontype_parm_type_p): Deprecate float and
+ complex types.
+
+2001-02-27 Nathan Sidwell <nathan@codesourcery.com>
+
+ Fix ctor vtable vcall offsets.
+ * class.c (struct vtbl_init_data_s): Add rtti_binfo member.
+ (build_rtt_vtbl_entries): Lose RTTI_BINFO parameter.
+ (get_matching_base): Remove.
+ (get_original_base): New function.
+ (build_vtbl_initializer): Initialize vid.rtti_binfo.
+ Use a virtual thunk for a ctor vtable with an index
+ (add_vcall_offset_vtbl_entries_1): Check if binfo has lost a
+ primary base within a constructor vtable. Only set
+ BV_VCALL_INDEX when not a constructor vtable. Adjust vcall offset
+ when primary base has been lost.
+ * cp-tree.h (BINFO_VIRTUALS): Remove ambiguity from comment.
+
+2001-02-22 Mark Mitchell <mark@codesourcery.com>
+
+ * spew.c (yylex): Correct handling of friends.
+
+ * mangle.c (write_encoding): Pass write_function_type the
+ FUNCTION_DECL for the function being encoded.
+ (write_function_type): Pass it along to write_bare_function_type.
+ (write_bare_function_type): Pass it along to write_method_parms.
+ (write_method_parms): Don't mangle the compiler-generated
+ parameters to a constructor or destructor.
+
+2001-02-22 Andreas Jaeger <aj@suse.de>
+
+ * optimize.c: Include toplev.h for
+ note_deferral_of_defined_inline_function prototype.
+
+2001-02-22 Jakub Jelinek <jakub@redhat.com>
+
+ * cp-tree.h (struct lang_decl_inlined_fns): New.
+ (struct lang_decls): Add inlined_fns.
+ (DECL_INLINED_FNS): New macro.
+ * optimize.c (struct inline_data): Add inlined_fns.
+ (declare_return_variable): Use VARRAY_ACTIVE_SIZE macro.
+ (inlinable_function_p): Likewise, fix typo in comment,
+ function is not inlinable if it already inlined function currently
+ being optimized.
+ (expand_call_inline): Add fn to inlined_fns if neccessary.
+ (optimize_function): Initialize inlined_fns.
+ Save inlined_fns into DECL_INLINED_FNS after expanding inlines.
+ * decl.c (mark_inlined_fns): New function.
+ (lang_mark_tree): Call it.
+
+2001-02-19 Mark Mitchell <mark@codesourcery.com>
+
+ * decl2.c (set_decl_namespace): Allow explicit instantiations in
+ any namespace.
+
+2001-02-21 Jason Merrill <jason@redhat.com>
+
+ * cp-tree.h (struct lang_decl_flags): Remove uninlinable flag.
+ (DECL_UNINLINABLE): Move to middle-end.
+
+ * class.c (clone_function_decl): Set DECL_ABSTRACT on original fn.
+ * decl.c (duplicate_decls): Preserve DECL_ABSTRACT.
+ * class.c (build_clone): Set DECL_ABSTRACT_ORIGIN for the clone.
+ * optimize.c (maybe_clone_body): Set DECL_ABSTRACT_ORIGIN for the
+ parms and outer BLOCK. note_deferral_of_defined_inline_function.
+
+ * method.c (implicitly_declare_fn): Don't set DECL_ARTIFICIAL on
+ second parm of op=.
+
+2001-02-18 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ * optimize.c (expand_call_inline): Don't walk subtrees of type
+ nodes.
+
+2001-02-18 Mark Mitchell <mark@codesourcery.com>
+
+ * class.c (add_vcall_offset_vtbl_entries_1): Only add one entry
+ for a destructor.
+
+2001-02-17 Mark Mitchell <mark@codesourcery.com>
+
+ * cp-tree.h (new_abi_rtti_p): Remove.
+ (name_mangling_version): Likewise.
+ (flag_do_squangling): Likewise.
+ * class.c (build_rtti_vtbl_entries): Remove old ABI support.
+ * decl.c (grokfndecl): Likewise.
+ * decl2.c (name_mangling_version): Remove.
+ (flag_do_squangling): Likewise.
+ (lang_f_options): Remove `squangle'.
+ (unsupported_options): Add `squangle'.
+ (cxx_decode_option): Issue a warning about uses of
+ -fname-mangling-version.
+ (finish_file): Remove old ABI support.
+ * pt.c (check_explicit_specialization): Likewise.
+ (tsubst_decl): Likewise.
+ * rtti.c (init_rtti_processing): Likewise.
+ (build_headof): Likewise.
+ (get_tinfo_decl_dynamic): Likewise.
+ (tinfo_from_decl): Likewise.
+ (build_dynamic_cast_1): Likewise.
+ (synthesize_tinfo_var): Likewise.
+ * init.c (build_new): Allow enumeration types for the array-bounds
+ in a direct-new-declarator.
+
+ * semantics.c (finish_typeof): Resolve OFFSET_REFs.
+
+ * pt.c (check_explicit_specialization): Copy TREE_PRIVATE and
+ TREE_PROTECTED from the template being specialized.
+
+2001-02-18 Jason Merrill <jason@redhat.com>
+
+ Do put the VTT parameter in DECL_ARGUMENTS.
+ * cp-tree.h (struct cp_language_function): Add x_vtt_parm.
+ (current_vtt_parm): New macro.
+ (struct lang_decl_flags): Add has_vtt_parm_p, remove vtt_parm.
+ (DECL_HAS_VTT_PARM_P): New macro.
+ (DECL_VTT_PARM): Remove.
+ (FUNCTION_FIRST_USER_PARMTYPE, FUNCTION_FIRST_USER_PARM): New macros.
+ * decl.c (duplicate_decls): Only copy the operator code if
+ appropriate.
+ (start_function): Set current_vtt_parm.
+ (lang_mark_tree): Don't mark vtt_parm.
+ * decl2.c (maybe_retrofit_in_chrg): Do add the VTT parm to
+ DECL_ARGUMENTS. Set DECL_HAS_VTT_PARM_P.
+ * class.c (build_clone): Maybe remove the VTT parm.
+ * optimize.c (maybe_clone_body): Set up the VTT parm.
+ * pt.c (copy_default_args_to_explicit_spec): Preserve the VTT parm.
+ * call.c (build_over_call): Just allow the VTT arg.
+ * method.c (make_thunk): Don't set DECL_VTT_PARM.
+ (do_build_copy_constructor): Use FUNCTION_FIRST_USER_PARM.
+ (synthesize_method): Use FUNCTION_FIRST_USER_PARMTYPE.
+ * decl.c (grokdeclarator, copy_args_p, grok_ctor_properties): Likewise.
+ * error.c (dump_function_decl): Likewise.
+ * call.c (build_user_type_conversion_1, convert_like_real): Abort
+ if we try to call a constructor with in-charge or VTT parms.
+ * method.c (skip_artificial_parms_for): New fn.
+ * call.c (add_function_candidate, build_over_call): Call it.
+ * call.c (build_new_method_call): Use current_vtt_parm.
+ * init.c (expand_virtual_init): Likewise.
+ * class.c (same_signature_p): No longer static.
+ * cp-tree.h: Declare it.
+ * search.c (look_for_overrides_r): Use it.
+
+2001-02-17 Anthony Green <green@redhat.com>
+
+ * lang-specs.h: Add more -D__EXCEPTIONS.
+
+2001-02-17 Jason Merrill <jason@redhat.com>
+
+ * decl.c (bad_specifiers): Allow throw specs on things with
+ pointer-to-function or -member-function type.
+ * init.c (build_default_init): Don't use a CONSTRUCTOR to initialize
+ a pmf.
+
+2001-02-16 Jason Merrill <jason@redhat.com>
+
+ * cp-tree.h (DECL_USE_VTT_PARM): Remove.
+ * decl2.c (maybe_retrofit_in_chrg): Don't create it.
+ * optimize.c (maybe_clone_body): Don't substitute it.
+ * call.c (build_new_method_call): Check in_chrg instead.
+ * init.c (expand_virtual_init): Likewise.
+
+2001-02-16 Jakub Jelinek <jakub@redhat.com>
+
+ * call.c (convert_like_real): Create a temporary for non-lvalue.
+
+2001-02-16 Gabriel Dos Reis <gdr@codesourcery.com>
+
+ * decl.c (check_tag_decl): Make sure a typedef for an anonymous
+ class-type introduces at least a type-name.
+
+2001-02-16 Jason Merrill <jason@redhat.com>
+
+ * optimize.c (remap_block): If we're compiling a clone, pass the
+ new block to insert_block.
+
+2001-02-14 Jakub Jelinek <jakub@redhat.com>
+
+ * typeck.c (build_unary_op): Clarify error message.
+
+2001-02-15 Mark Mitchell <mark@codesourcery.com>
+
+ * pt.c (push_template_decl_real): Don't remangle the name of a
+ class template.
+
+2001-02-15 Alexandre Oliva <aoliva@redhat.com>
+
+ * friend.c (do_friend): Don't take the nested [template] class
+ into account when deciding whether to warn about the friend
+ function not referring to a template function.
+
+2001-02-14 Nathan Sidwell <nathan@codesourcery.com>
+
+ * cp-tree.h (setup_vtbl_ptr): Move prototype to semantics.c
+ section.
+ * init.c (emit_base_init): Remove incorrect comment about
+ virtual bases.
+ * method.c (make_thunk): Fix comment alignment.
+
+2001-02-14 Nathan Sidwell <nathan@codesourcery.com>
+
+ Kill remnants of this is variable.
+ * cp-tree.h (flag_this_is_variable): Remove.
+ * decl2.c (flag_this_is_variable): Remove.
+ * class.c (fixed_type_or_null): Add cdtor parm. Adjust.
+ (build_vbase_path): The path is non-static, even in a cdtor.
+ (resolves_to_fixed_type_p): Add additional return value.
+ * search.c (init_vbase_pointers): Adjust.
+ * tree.c (lvalue_p_1): Adjust.
+ * typeck.c (mark_addressable): Adjust.
+
+2001-02-14 Nathan Sidwell <nathan@codesourcery.com>
+
+ * pt.c (unify): Don't check cv quals of array types.
+
+2001-02-14 Nathan Sidwell <nathan@codesourcery.com>
+
+ * tree.c (cp_build_qualified_type_real): Use CP_TYPE_QUALS to
+ check whether we already have the type.
+
+2001-02-14 Nathan Sidwell <nathan@codesourcery.com>
+
+ * typeck2.c (process_init_constructor): Check
+ TREE_HAS_CONSTRUCTOR before issuing missing init warning.
+
+2001-02-14 Nathan Sidwell <nathan@codesourcery.com>
+
+ * errfn.c (cp_deprecated): Tweak diagnostic text.
+ * parse.y (new_initializer): Deprecate initializer lists
+ extension.
+
+2001-02-14 Nathan Sidwell <nathan@codesourcery.com>
+
+ * pt.c (maybe_adjust_types_for_deduction, DEDUCE_ORDER case):
+ Remove spurious information in comment. Allow further
+ adjustments of REFERENCE_TYPE args.
+
+2001-02-13 Mark Mitchell <mark@codesourcery.com>
+
+ * cp-tree.h (CLASSTYPE_DESTRUCTORS): Fix typo in comment.
+ * call.c (build_op_delete_call): Simplify to remove duplicate
+ code.
+ * class.c (clone_function_decl): Don't build the deleting variant
+ of a non-virtual destructor.
+ * decl.c (finish_destructor_body): Don't call delete if this is a
+ non-virtual destructor.
+ * init.c (build_delete): Explicitly call `operator delete' when
+ deleting an object with a non-virtual destructor.
+
+2001-02-13 Jason Merrill <jason@redhat.com>
+
+ * lang-specs.h: Add more __EXCEPTIONS.
+
+2001-02-12 Mark Mitchell <mark@codesourcery.com>
+
+ Remove old ABI support.
+
2001-02-11 Mark Mitchell <mark@codesourcery.com>
* decl2.c (flag_vtable_thunks): Always set it to 1.
(flag_new_abi): Likewise.
* lang-specs.h: Remove conditional on ENABLE_NEW_GXX_ABI.
-
+
* Makefile.in (g++spec.o): Fix typo.
2001-02-09 Jason Merrill <jason@redhat.com>
@@ -27,7 +1575,7 @@
* typeck2.c (friendly_abort): Don't say anything if we have
earlier errors or sorries.
- * decl.c (check_tag_decl): Notice attempts to redefine bool and
+ * decl.c (check_tag_decl): Notice attempts to redefine bool and
wchar_t. Ignore if in_system_header.
* decl.c (maybe_push_cleanup_level): New fn...
@@ -37,7 +1585,7 @@
2001-02-07 Mark Mitchell <mark@codesourcery.com>
- * lang-specs.h: Use CPLUSPLUS_CPP_SPEC for the preprocessor
+ * lang-specs.h: Use CPLUSPLUS_CPP_SPEC for the preprocessor
spec.
2001-02-06 Nathan Sidwell <nathan@codesourcery.com>
@@ -157,7 +1705,7 @@ Sun Feb 4 15:52:44 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
(typeinfo_in_lib_p): New function.
(synthesize_tinfo_var): Use it.
(create_real_tinfo_var): Likewise.
-
+
2001-02-03 Jakub Jelinek <jakub@redhat.com>
* decl.c (push_class_binding): Use context_for_name_lookup instead
@@ -372,9 +1920,9 @@ Sun Feb 4 15:52:44 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
2001-01-16 Daniel Berlin <dberlin@redhat.com>
- * cvt.c (ocp_convert): Handle vector type conversion
- * typeck2.c (digest_init): Handle vector type initializations
-
+ * cvt.c (ocp_convert): Handle vector type conversion
+ * typeck2.c (digest_init): Handle vector type initializations
+
2001-01-16 Phil Edwards <pme@sources.redhat.com>
* g++spec.c: Don't add libraries needlessly if -fsyntax-only
@@ -543,7 +2091,7 @@ Sun Feb 4 15:52:44 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
DECL_INITIALIZED_IN_CLASS_P.
(instantiate_class_template): Likewise.
(instantiate_decl): Check DECL_INITIALIZED_IN_CLASS_P.
-
+
* class.c (finish_struct): Constify saved_filename.
2001-01-08 Nathan Sidwell <nathan@codesourcery.com>
@@ -561,14 +2109,14 @@ Sun Feb 4 15:52:44 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
Don't set TREE_VALUE on the class_shadowed list.
2001-01-07 Alexandre Petit-Bianco <apbianco@cygnus.com>
-
- * decl2.c (acceptable_java_type): Allow references too.
+
+ * decl2.c (acceptable_java_type): Allow references too.
* init.c (build_java_class_ref): When using the new ABI, search
`class$' and have it mangled with `mangle_decl.'
* mangle.c (write_java_integer_type_codes): New function.
(write_builtin_type): Detect and mangle Java integer and real
types.
-
+
2001-01-07 Mark Mitchell <mark@codesourcery.com>
* decl2.c (grokfield): Don't accept `asm' specifiers for
@@ -580,7 +2128,7 @@ Sun Feb 4 15:52:44 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
2001-01-07 Neil Booth <neil@daikokuya.demon.co.uk>
- * cp/decl2.c (cxx_post_options): Call cpp_post_options.
+ * cp/decl2.c (cxx_post_options): Call cpp_post_options.
2001-01-05 Nathan Sidwell <nathan@codesourcery.com>
@@ -625,7 +2173,7 @@ Sun Feb 4 15:52:44 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
(implicitly_declare_fn): Generate the exception spec too.
* search.c (check_final_overrider): Check artificial functions
too.
- * typeck2.c (merge_exception_specifiers): New function.
+ * typeck2.c (merge_exception_specifiers): New function.
2001-01-03 Jason Merrill <jason@redhat.com>
@@ -665,7 +2213,7 @@ Sun Feb 4 15:52:44 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
(tsubst_template_parms): Use size_int, not build_int_2.
(tsubst): Likewise.
* rtti.c (get_vmi_pseudo_type_info): Likewise.
-
+
2001-01-02 Richard Henderson <rth@redhat.com>
* parse.y (asm): Set ASM_INPUT_P.
@@ -683,7 +2231,7 @@ Sun Feb 4 15:52:44 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* typeck.c (build_unary_op): Restore old &a.f diagnostic code.
* cvt.c (convert_to_void): Use type_unknown_p.
- * typeck.c (strip_all_pointer_quals): Also strip quals from
+ * typeck.c (strip_all_pointer_quals): Also strip quals from
pointer-to-member types.
* Make-lang.in (cp/TAGS): Use --no-globals. Ignore parse.c, and treat
@@ -857,7 +2405,8 @@ Sun Feb 4 15:52:44 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* class.c (check_field_decls): Don't special case anonymous
fields in error messages.
- (note_name_declared_in_class): Use %D on diagnostic.
+ (note_name_declared_inpwdpwd
+ _class): Use %D on diagnostic.
* tree.c (pod_type_p): Use strip_array_types.
(cp_valid_lang_attribute): Likewise.
diff --git a/gcc/cp/Make-lang.in b/gcc/cp/Make-lang.in
index de3c596094c..c6afa0b7d69 100644
--- a/gcc/cp/Make-lang.in
+++ b/gcc/cp/Make-lang.in
@@ -129,15 +129,9 @@ c++.all.cross: g++-cross$(exeext) $(DEMANGLER_PROG)
c++.start.encap: g++$(exeext)
c++.rest.encap: $(DEMANGLER_PROG)
-c++.info: $(srcdir)/cp/g++int.info
+c++.info:
c++.dvi:
-$(srcdir)/cp/g++int.info: $(srcdir)/cp/gxxint.texi
- if [ x$(BUILD_INFO) = xinfo ]; then \
- rm -f $(srcdir)/cp/g++int.info*; \
- cd $(srcdir)/cp && $(MAKEINFO) -o g++int.info gxxint.texi; \
- else true; fi
-
#
# Install hooks:
# cc1plus is installed elsewhere as part of $(COMPILERS).
@@ -185,33 +179,18 @@ c++.install-common:
fi ; \
fi
-c++.install-info: c++.info
- if [ -f cc1plus$(exeext) ] ; then \
- if [ -f $(srcdir)/cp/g++int.info ]; then \
- rm -f $(infodir)/g++int.info*; \
- for f in $(srcdir)/cp/g++int.info*; do \
- realfile=`echo $$f | sed -e 's|.*/\([^/]*\)$$|\1|'`; \
- $(INSTALL_DATA) $$f $(infodir)/$$realfile; \
- done; \
- chmod a-x $(infodir)/g++int.info*; \
- else true; fi; \
- else true; fi
- -if [ -f cc1plus$(exeext) ] && [ -f $(infodir)/g++int.info ]; then \
- if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \
- install-info --dir-file=$(infodir)/dir $(infodir)/g++int.info; \
- else true; fi; \
- else true; fi
+c++.install-info:
c++.install-man: $(srcdir)/cp/g++.1
-if [ -f cc1plus$(exeext) ] ; then \
if [ -f g++-cross$(exeext) ] ; then \
- rm -f $(man1dir)/$(GXX_CROSS_NAME)$(manext); \
- $(INSTALL_DATA) $(srcdir)/cp/g++.1 $(man1dir)/$(GXX_CROSS_NAME)$(manext); \
- chmod a-x $(man1dir)/$(GXX_CROSS_NAME)$(manext); \
+ rm -f $(man1dir)/$(GXX_CROSS_NAME)$(man1ext); \
+ $(INSTALL_DATA) $(srcdir)/cp/g++.1 $(man1dir)/$(GXX_CROSS_NAME)$(man1ext); \
+ chmod a-x $(man1dir)/$(GXX_CROSS_NAME)$(man1ext); \
else \
- rm -f $(man1dir)/$(GXX_INSTALL_NAME)$(manext); \
- $(INSTALL_DATA) $(srcdir)/cp/g++.1 $(man1dir)/$(GXX_INSTALL_NAME)$(manext); \
- chmod a-x $(man1dir)/$(GXX_INSTALL_NAME)$(manext); \
+ rm -f $(man1dir)/$(GXX_INSTALL_NAME)$(man1ext); \
+ $(INSTALL_DATA) $(srcdir)/cp/g++.1 $(man1dir)/$(GXX_INSTALL_NAME)$(man1ext); \
+ chmod a-x $(man1dir)/$(GXX_INSTALL_NAME)$(man1ext); \
fi; \
else true; fi
@@ -222,9 +201,8 @@ c++.uninstall:
-rm -rf $(bindir)/$(GXX_CROSS_NAME)$(exeext)
-rm -rf $(bindir)/$(DEMANGLER_INSTALL_NAME)$(exeext)
-rm -rf $(bindir)/$(DEMANGLER_CROSS_NAME)$(exeext)
- -rm -rf $(man1dir)/$(GXX_INSTALL_NAME)$(manext)
- -rm -rf $(man1dir)/$(GXX_CROSS_NAME)$(manext)
- -rm -rf $(infodir)/g++int.info*
+ -rm -rf $(man1dir)/$(GXX_INSTALL_NAME)$(man1ext)
+ -rm -rf $(man1dir)/$(GXX_CROSS_NAME)$(man1ext)
#
# Clean hooks:
# A lot of the ancillary files are deleted by the main makefile.
@@ -239,7 +217,6 @@ c++.distclean:
c++.extraclean:
c++.maintainer-clean:
-rm -f $(srcdir)/cp/parse.c $(srcdir)/cp/parse.h
- -rm -f $(srcdir)/cp/g++int.info*
#
# Stage hooks:
# The main makefile has already created stage?/cp.
@@ -261,19 +238,22 @@ CXX_TREE_H = $(TREE_H) cp/cp-tree.h c-common.h cp/cp-tree.def c-common.def \
cp/spew.o: cp/spew.c $(CXX_TREE_H) cp/parse.h flags.h cp/lex.h toplev.h
cp/lex.o: cp/lex.c $(CXX_TREE_H) cp/parse.h flags.h cp/lex.h c-pragma.h \
- toplev.h output.h mbchar.h $(GGC_H) input.h diagnostic.h cp/operators.def
+ toplev.h output.h mbchar.h $(GGC_H) input.h diagnostic.h cp/operators.def \
+ $(TM_P_H)
cp/decl.o: cp/decl.c $(CXX_TREE_H) flags.h cp/lex.h cp/decl.h stack.h \
- output.h $(EXPR_H) except.h toplev.h hash.h $(GGC_H) $(RTL_H) cp/operators.def
+ output.h $(EXPR_H) except.h toplev.h hash.h $(GGC_H) $(RTL_H) \
+ $(TM_P_H) cp/operators.def
cp/decl2.o: cp/decl2.c $(CXX_TREE_H) flags.h cp/lex.h cp/decl.h $(EXPR_H) \
output.h except.h toplev.h dwarf2out.h dwarfout.h $(GGC_H) $(RTL_H)
-cp/typeck2.o: cp/typeck2.c $(CXX_TREE_H) flags.h toplev.h output.h
+cp/typeck2.o: cp/typeck2.c $(CXX_TREE_H) flags.h toplev.h output.h $(TM_P_H)
cp/typeck.o: cp/typeck.c $(CXX_TREE_H) flags.h $(RTL_H) $(EXPR_H) toplev.h
cp/class.o: cp/class.c $(CXX_TREE_H) flags.h toplev.h $(RTL_H)
cp/call.o: cp/call.c $(CXX_TREE_H) flags.h toplev.h $(RTL_H) $(EXPR_H) $(GGC_H)
cp/friend.o: cp/friend.c $(CXX_TREE_H) flags.h $(RTL_H) toplev.h $(EXPR_H)
cp/init.o: cp/init.c $(CXX_TREE_H) flags.h $(RTL_H) $(EXPR_H) toplev.h \
$(GGC_H) except.h
-cp/method.o: cp/method.c $(CXX_TREE_H) toplev.h $(GGC_H) $(RTL_H) $(EXPR_H)
+cp/method.o: cp/method.c $(CXX_TREE_H) toplev.h $(GGC_H) $(RTL_H) $(EXPR_H) \
+ $(TM_P_H)
cp/cvt.o: cp/cvt.c $(CXX_TREE_H) cp/decl.h flags.h toplev.h convert.h
cp/search.o: cp/search.c $(CXX_TREE_H) stack.h flags.h toplev.h $(RTL_H)
cp/tree.o: cp/tree.c $(CXX_TREE_H) flags.h toplev.h $(GGC_H) $(RTL_H) \
@@ -281,19 +261,20 @@ cp/tree.o: cp/tree.c $(CXX_TREE_H) flags.h toplev.h $(GGC_H) $(RTL_H) \
cp/ptree.o: cp/ptree.c $(CXX_TREE_H) system.h
cp/rtti.o: cp/rtti.c $(CXX_TREE_H) flags.h toplev.h
cp/except.o: cp/except.c $(CXX_TREE_H) flags.h $(RTL_H) except.h toplev.h \
- cp/cfns.h $(EXPR_H) insn-flags.h cp/decl.h $(OBSTACK_H)
-cp/expr.o: cp/expr.c $(CXX_TREE_H) $(RTL_H) flags.h $(EXPR_H) toplev.h except.h
+ cp/cfns.h $(EXPR_H) cp/decl.h $(OBSTACK_H)
+cp/expr.o: cp/expr.c $(CXX_TREE_H) $(RTL_H) flags.h $(EXPR_H) toplev.h \
+ except.h $(TM_P_H)
cp/xref.o: cp/xref.c $(CXX_TREE_H) input.h toplev.h
cp/pt.o: cp/pt.c $(CXX_TREE_H) cp/decl.h cp/parse.h cp/lex.h toplev.h \
$(GGC_H) $(RTL_H) except.h
-cp/error.o: cp/error.c $(CXX_TREE_H) toplev.h diagnostic.h
+cp/error.o: cp/error.c $(CXX_TREE_H) toplev.h diagnostic.h real.h
cp/errfn.o: cp/errfn.c $(CXX_TREE_H) toplev.h
cp/repo.o: cp/repo.c $(CXX_TREE_H) toplev.h $(GGC_H)
cp/semantics.o: cp/semantics.c $(CXX_TREE_H) cp/lex.h except.h toplev.h \
flags.h $(GGC_H) output.h $(RTL_H) $(TIMEVAR_H)
cp/dump.o: cp/dump.c $(CXX_TREE_H) c-dump.h
cp/optimize.o: cp/optimize.c $(CXX_TREE_H) rtl.h integrate.h insn-config.h \
- input.h
+ input.h $(PARAMS_H)
cp/mangle.o: cp/mangle.c $(CXX_TREE_H) toplev.h
cp/parse.o: cp/parse.c $(CXX_TREE_H) flags.h cp/lex.h except.h output.h \
diff --git a/gcc/cp/NEWS b/gcc/cp/NEWS
index d2c483d289c..5fa6cc29eea 100644
--- a/gcc/cp/NEWS
+++ b/gcc/cp/NEWS
@@ -1,4 +1,10 @@
-*** Changes since GCC 2.95:
+*** Changes in GCC 3.0.1:
+
+* -fhonor-std and -fno-honor-std have been removed. -fno-honor-std was
+ a workaround to allow std compliant code to work with the non-std
+ compliant libstdc++-v2. libstdc++-v3 is std compliant.
+
+*** Changes in GCC 3.0:
* Support for guiding declarations has been removed.
@@ -9,7 +15,7 @@
* In some obscure cases, functions with the same type could have the
same mangled name. This bug caused compiler crashes, link-time clashes,
- and debugger crahses. Fixing this bug required breaking ABI
+ and debugger crashes. Fixing this bug required breaking ABI
compatibility for the functions involved. The functions in questions
are those whose types involve non-type template arguments whose
mangled representations require more than one digit.
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index 59bed97d92d..5a86bb39ce3 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -45,6 +45,7 @@ static int equal_functions PARAMS ((tree, tree));
static int joust PARAMS ((struct z_candidate *, struct z_candidate *, int));
static int compare_ics PARAMS ((tree, tree));
static tree build_over_call PARAMS ((struct z_candidate *, tree, int));
+static tree build_java_interface_fn_ref PARAMS ((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 PARAMS ((tree, tree, tree, int, int));
@@ -86,7 +87,7 @@ static tree reference_binding PARAMS ((tree, tree, tree, int));
static tree non_reference PARAMS ((tree));
static tree build_conv PARAMS ((enum tree_code, tree, tree));
static int is_subseq PARAMS ((tree, tree));
-static int maybe_handle_ref_bind PARAMS ((tree*, tree*));
+static tree maybe_handle_ref_bind PARAMS ((tree*));
static void maybe_handle_implicit_object PARAMS ((tree*));
static struct z_candidate * add_candidate PARAMS ((struct z_candidate *,
tree, tree, int));
@@ -637,6 +638,9 @@ build_conv (code, type, from)
return t;
}
+/* If T is a REFERENCE_TYPE return the type to which T refers.
+ Otherwise, return T itself. */
+
static tree
non_reference (t)
tree t;
@@ -997,8 +1001,7 @@ convert_class_to_reference (t, s, expr)
return NULL_TREE;
conv = build1 (IDENTITY_CONV, s, expr);
- conv = build_conv (USER_CONV,
- non_reference (TREE_TYPE (TREE_TYPE (cand->fn))),
+ conv = build_conv (USER_CONV, TREE_TYPE (TREE_TYPE (cand->fn)),
conv);
TREE_OPERAND (conv, 1) = build_ptr_wrapper (cand);
ICS_USER_FLAG (conv) = 1;
@@ -1296,17 +1299,12 @@ add_function_candidate (candidates, fn, ctype, arglist, flags)
tree parmnode, argnode;
int viable = 1;
- /* The `this' and `in_chrg' arguments to constructors are not considered
- in overload resolution. */
+ /* The `this', `in_chrg' and VTT arguments to constructors are not
+ considered in overload resolution. */
if (DECL_CONSTRUCTOR_P (fn))
{
- parmlist = TREE_CHAIN (parmlist);
- arglist = TREE_CHAIN (arglist);
- if (DECL_HAS_IN_CHARGE_PARM_P (fn))
- {
- parmlist = TREE_CHAIN (parmlist);
- arglist = TREE_CHAIN (arglist);
- }
+ parmlist = skip_artificial_parms_for (fn, parmlist);
+ arglist = skip_artificial_parms_for (fn, arglist);
}
len = list_length (arglist);
@@ -2355,9 +2353,7 @@ build_user_type_conversion_1 (totype, expr, flags)
if (IS_AGGR_TYPE (totype))
ctors = lookup_fnfields (TYPE_BINFO (totype),
- (flag_new_abi
- ? complete_ctor_identifier
- : ctor_identifier),
+ complete_ctor_identifier,
0);
if (IS_AGGR_TYPE (fromtype))
@@ -2375,10 +2371,11 @@ build_user_type_conversion_1 (totype, expr, flags)
t = build_int_2 (0, 0);
TREE_TYPE (t) = build_pointer_type (totype);
args = build_tree_list (NULL_TREE, expr);
- if (DECL_HAS_IN_CHARGE_PARM_P (OVL_CURRENT (ctors)))
- args = tree_cons (NULL_TREE,
- in_charge_arg_for_name (complete_ctor_identifier),
- args);
+ if (DECL_HAS_IN_CHARGE_PARM_P (OVL_CURRENT (ctors))
+ || DECL_HAS_VTT_PARM_P (OVL_CURRENT (ctors)))
+ /* We should never try to call the abstract or base constructor
+ from here. */
+ abort ();
args = tree_cons (NULL_TREE, t, args);
}
for (; ctors; ctors = OVL_NEXT (ctors))
@@ -2517,9 +2514,10 @@ build_user_type_conversion_1 (totype, expr, flags)
(DECL_CONSTRUCTOR_P (cand->fn)
? totype : non_reference (TREE_TYPE (TREE_TYPE (cand->fn)))),
expr, build_ptr_wrapper (cand));
- ICS_USER_FLAG (cand->second_conv) = 1;
+
+ ICS_USER_FLAG (cand->second_conv) = ICS_USER_FLAG (*p) = 1;
if (cand->viable == -1)
- ICS_BAD_FLAG (cand->second_conv) = 1;
+ ICS_BAD_FLAG (cand->second_conv) = ICS_BAD_FLAG (*p) = 1;
return cand;
}
@@ -2550,15 +2548,19 @@ resolve_args (args)
tree t;
for (t = args; t; t = TREE_CHAIN (t))
{
- if (TREE_VALUE (t) == error_mark_node)
+ tree arg = TREE_VALUE (t);
+
+ if (arg == error_mark_node)
return error_mark_node;
- else if (TREE_CODE (TREE_TYPE (TREE_VALUE (t))) == VOID_TYPE)
+ else if (VOID_TYPE_P (TREE_TYPE (arg)))
{
error ("invalid use of void expression");
return error_mark_node;
}
- else if (TREE_CODE (TREE_VALUE (t)) == OFFSET_REF)
- TREE_VALUE (t) = resolve_offset_ref (TREE_VALUE (t));
+ else if (TREE_CODE (arg) == OFFSET_REF)
+ arg = resolve_offset_ref (arg);
+ arg = convert_from_reference (arg);
+ TREE_VALUE (t) = arg;
}
return args;
}
@@ -2888,11 +2890,6 @@ build_conditional_expr (arg1, arg2, arg3)
|| TREE_TYPE (arg3) == error_mark_node)
return error_mark_node;
- /* Convert from reference types to ordinary types; no expressions
- really have reference type in C++. */
- arg2 = convert_from_reference (arg2);
- arg3 = convert_from_reference (arg3);
-
/* [expr.cond]
If either the second or the third operand has type (possibly
@@ -3091,6 +3088,9 @@ build_conditional_expr (arg1, arg2, arg3)
arg3 = decay_conversion (arg3);
arg3_type = TREE_TYPE (arg3);
+ if (arg2 == error_mark_node || arg3 == error_mark_node)
+ return error_mark_node;
+
/* [expr.cond]
After those conversions, one of the following shall hold:
@@ -3216,6 +3216,10 @@ build_new_op (code, flags, arg1, arg2, arg3)
else
fnname = ansi_opname (code);
+ if (TREE_CODE (arg1) == OFFSET_REF)
+ arg1 = resolve_offset_ref (arg1);
+ arg1 = convert_from_reference (arg1);
+
switch (code)
{
case NEW_EXPR:
@@ -3232,14 +3236,19 @@ build_new_op (code, flags, arg1, arg2, arg3)
break;
}
- /* The comma operator can have void args. */
- if (TREE_CODE (arg1) == OFFSET_REF)
- arg1 = resolve_offset_ref (arg1);
- if (arg2 && TREE_CODE (arg2) == OFFSET_REF)
- arg2 = resolve_offset_ref (arg2);
- if (arg3 && TREE_CODE (arg3) == OFFSET_REF)
- arg3 = resolve_offset_ref (arg3);
-
+ if (arg2)
+ {
+ if (TREE_CODE (arg2) == OFFSET_REF)
+ arg2 = resolve_offset_ref (arg2);
+ arg2 = convert_from_reference (arg2);
+ }
+ if (arg3)
+ {
+ if (TREE_CODE (arg3) == OFFSET_REF)
+ arg3 = resolve_offset_ref (arg3);
+ arg3 = convert_from_reference (arg3);
+ }
+
if (code == COND_EXPR)
{
if (arg2 == NULL_TREE
@@ -3540,7 +3549,7 @@ builtin:
used to determine what the corresponding new looked like.
SIZE is the size of the memory block to be deleted.
FLAGS are the usual overloading flags.
- PLACEMENT is the corresponding placement new call, or 0. */
+ PLACEMENT is the corresponding placement new call, or NULL_TREE. */
tree
build_op_delete_call (code, addr, size, flags, placement)
@@ -3549,6 +3558,7 @@ build_op_delete_call (code, addr, size, flags, placement)
int flags;
{
tree fn, fns, fnname, fntype, argtypes, args, type;
+ int pass;
if (addr == error_mark_node)
return error_mark_node;
@@ -3597,48 +3607,72 @@ build_op_delete_call (code, addr, size, flags, placement)
args = NULL_TREE;
}
- argtypes = tree_cons (NULL_TREE, ptr_type_node, argtypes);
- fntype = build_function_type (void_type_node, argtypes);
-
/* Strip const and volatile from addr. */
addr = cp_convert (ptr_type_node, addr);
- fn = instantiate_type (fntype, fns, itf_no_attributes);
-
- if (fn != error_mark_node)
+ /* We make two tries at finding a matching `operator delete'. On
+ the first pass, we look for an 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)
{
- if (TREE_CODE (fns) == TREE_LIST)
- /* Member functions. */
- enforce_access (type, fn);
- return build_function_call (fn, tree_cons (NULL_TREE, addr, args));
+ if (pass == 0)
+ argtypes = tree_cons (NULL_TREE, ptr_type_node, argtypes);
+ else
+ /* Normal delete; now try to find a match including the size
+ argument. */
+ argtypes = tree_cons (NULL_TREE, ptr_type_node,
+ tree_cons (NULL_TREE, sizetype,
+ void_list_node));
+ fntype = build_function_type (void_type_node, argtypes);
+
+ /* Go through the `operator delete' functions looking for one
+ with a matching type. */
+ for (fn = BASELINK_P (fns) ? TREE_VALUE (fns) : fns;
+ fn;
+ fn = OVL_NEXT (fn))
+ {
+ tree t;
+
+ /* Exception specifications on the `delete' operator do not
+ matter. */
+ t = build_exception_variant (TREE_TYPE (OVL_CURRENT (fn)),
+ NULL_TREE);
+ /* We also don't compare attributes. We're really just
+ trying to check the types of the first two parameters. */
+ if (comptypes (t, fntype, COMPARE_NO_ATTRIBUTES))
+ break;
+ }
+
+ /* If we found a match, we're done. */
+ if (fn)
+ break;
}
- /* If we are doing placement delete we do nothing if we don't find a
- matching op delete. */
- if (placement)
- return NULL_TREE;
+ /* If we have a matching function, call it. */
+ if (fn)
+ {
+ /* Make sure we have the actual function, and not an
+ OVERLOAD. */
+ fn = OVL_CURRENT (fn);
- /* Normal delete; now try to find a match including the size argument. */
- argtypes = tree_cons (NULL_TREE, ptr_type_node,
- tree_cons (NULL_TREE, sizetype, void_list_node));
- fntype = build_function_type (void_type_node, argtypes);
+ /* If the FN is a member function, make sure that it is
+ accessible. */
+ if (DECL_CLASS_SCOPE_P (fn))
+ enforce_access (type, fn);
- fn = instantiate_type (fntype, fns, itf_no_attributes);
+ if (pass == 0)
+ args = tree_cons (NULL_TREE, addr, args);
+ else
+ args = tree_cons (NULL_TREE, addr,
+ build_tree_list (NULL_TREE, size));
- if (fn != error_mark_node)
- {
- if (BASELINK_P (fns))
- /* Member functions. */
- enforce_access (type, fn);
- return build_function_call
- (fn, tree_cons (NULL_TREE, addr,
- build_tree_list (NULL_TREE, size)));
+ return build_function_call (fn, args);
}
- /* finish_function passes LOOKUP_SPECULATIVELY if we're in a
- destructor, in which case the error should be deferred
- until someone actually tries to delete one of these. */
- if (flags & LOOKUP_SPECULATIVELY)
+ /* If we are doing placement delete we do nothing if we don't find a
+ matching op delete. */
+ if (placement)
return NULL_TREE;
cp_error ("no suitable `operator delete' for `%T'", type);
@@ -3675,7 +3709,8 @@ enforce_access (basetype_path, decl)
/* 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 non-zero when
- being called to continue a conversion chain. */
+ being called to continue a conversion chain. It is negative when a
+ reference binding will be applied, positive otherwise. */
static tree
convert_like_real (convs, expr, fn, argnum, inner)
@@ -3730,8 +3765,11 @@ convert_like_real (convs, expr, fn, argnum, inner)
TREE_TYPE (t) = build_pointer_type (DECL_CONTEXT (convfn));
args = build_tree_list (NULL_TREE, expr);
- if (DECL_HAS_IN_CHARGE_PARM_P (convfn))
- args = tree_cons (NULL_TREE, integer_one_node, args);
+ if (DECL_HAS_IN_CHARGE_PARM_P (convfn)
+ || DECL_HAS_VTT_PARM_P (convfn))
+ /* We should never try to call the abstract or base constructor
+ from here. */
+ abort ();
args = tree_cons (NULL_TREE, t, args);
}
else
@@ -3751,7 +3789,8 @@ convert_like_real (convs, expr, fn, argnum, inner)
conversion, but is not considered during overload resolution.
If the target is a class, that means call a ctor. */
- if (IS_AGGR_TYPE (totype))
+ if (IS_AGGR_TYPE (totype)
+ && (inner >= 0 || !lvalue_p (expr)))
{
savew = warningcount, savee = errorcount;
expr = build_new_method_call
@@ -3800,7 +3839,8 @@ convert_like_real (convs, expr, fn, argnum, inner)
break;
};
- expr = convert_like_real (TREE_OPERAND (convs, 0), expr, fn, argnum, 1);
+ expr = convert_like_real (TREE_OPERAND (convs, 0), expr, fn, argnum,
+ TREE_CODE (convs) == REF_BIND ? -1 : 1);
if (expr == error_mark_node)
return error_mark_node;
@@ -3854,7 +3894,7 @@ convert_like_real (convs, expr, fn, argnum, inner)
tree ref_type = totype;
/* If necessary, create a temporary. */
- if (NEED_TEMPORARY_P (convs))
+ if (NEED_TEMPORARY_P (convs) || !lvalue_p (expr))
{
tree type = TREE_TYPE (TREE_OPERAND (convs, 0));
expr = build_target_expr_with_type (expr, type);
@@ -4017,8 +4057,7 @@ convert_default_arg (type, arg, fn, parmnum)
arg = convert_for_initialization (0, type, arg, LOOKUP_NORMAL,
"default argument", fn, parmnum);
if (PROMOTE_PROTOTYPES
- && (TREE_CODE (type) == INTEGER_TYPE
- || TREE_CODE (type) == ENUMERAL_TYPE)
+ && INTEGRAL_TYPE_P (type)
&& (TYPE_PRECISION (type) < TYPE_PRECISION (integer_type_node)))
arg = default_conversion (arg);
}
@@ -4060,6 +4099,9 @@ build_over_call (cand, args, flags)
arg = TREE_CHAIN (arg);
parm = TREE_CHAIN (parm);
if (DECL_HAS_IN_CHARGE_PARM_P (fn))
+ /* We should never try to call the abstract constructor. */
+ abort ();
+ if (DECL_HAS_VTT_PARM_P (fn))
{
converted_args = tree_cons
(NULL_TREE, TREE_VALUE (arg), converted_args);
@@ -4126,8 +4168,7 @@ build_over_call (cand, args, flags)
}
if (PROMOTE_PROTOTYPES
- && (TREE_CODE (type) == INTEGER_TYPE
- || TREE_CODE (type) == ENUMERAL_TYPE)
+ && INTEGRAL_TYPE_P (type)
&& (TYPE_PRECISION (type) < TYPE_PRECISION (integer_type_node)))
val = default_conversion (val);
converted_args = tree_cons (NULL_TREE, val, converted_args);
@@ -4164,9 +4205,7 @@ build_over_call (cand, args, flags)
&& DECL_COPY_CONSTRUCTOR_P (fn))
{
tree targ;
- arg = TREE_CHAIN (converted_args);
- if (DECL_HAS_IN_CHARGE_PARM_P (fn))
- arg = TREE_CHAIN (arg);
+ arg = skip_artificial_parms_for (fn, converted_args);
arg = TREE_VALUE (arg);
/* Pull out the real argument, disregarding const-correctness. */
@@ -4207,31 +4246,20 @@ build_over_call (cand, args, flags)
else if (TYPE_HAS_TRIVIAL_INIT_REF (DECL_CONTEXT (fn)))
return build_target_expr_with_type (arg, DECL_CONTEXT (fn));
}
- else if (! real_lvalue_p (arg)
- || TYPE_HAS_TRIVIAL_INIT_REF (DECL_CONTEXT (fn)))
+ else if ((!real_lvalue_p (arg)
+ || TYPE_HAS_TRIVIAL_INIT_REF (DECL_CONTEXT (fn)))
+ /* Empty classes have padding which can be hidden
+ inside an (empty) base of the class. This must not
+ be touched as it might overlay things. When the
+ gcc core learns about empty classes, we can treat it
+ like other classes. */
+ && !is_empty_class (DECL_CONTEXT (fn)))
{
tree address;
tree to = stabilize_reference
(build_indirect_ref (TREE_VALUE (args), 0));
- /* If we're initializing an empty class, then we actually
- have to use a MODIFY_EXPR rather than an INIT_EXPR. The
- reason is that the dummy padding member in the target may
- not actually be allocated if TO is a base class
- subobject. Since we've set TYPE_NONCOPIED_PARTS on the
- padding, a MODIFY_EXPR will preserve its value, which is
- the right thing to do if it's not really padding at all.
-
- It's not safe to just throw away the ARG if we're looking
- at an empty class because the ARG might contain a
- TARGET_EXPR which wants to be bound to TO. If it is not,
- expand_expr will assign a dummy slot for the TARGET_EXPR,
- and we will call a destructor for it, which is wrong,
- because we will also destroy TO, but will never have
- constructed it. */
- val = build (is_empty_class (DECL_CONTEXT (fn))
- ? MODIFY_EXPR : INIT_EXPR,
- DECL_CONTEXT (fn), to, arg);
+ val = build (INIT_EXPR, DECL_CONTEXT (fn), to, arg);
address = build_unary_op (ADDR_EXPR, val, 0);
/* Avoid a warning about this expression, if the address is
never used. */
@@ -4247,8 +4275,23 @@ build_over_call (cand, args, flags)
(build_indirect_ref (TREE_VALUE (converted_args), 0));
arg = build_indirect_ref (TREE_VALUE (TREE_CHAIN (converted_args)), 0);
-
- val = build (MODIFY_EXPR, TREE_TYPE (to), to, arg);
+ if (is_empty_class (TREE_TYPE (to)))
+ {
+ TREE_USED (arg) = 1;
+
+ val = build (COMPOUND_EXPR, DECL_CONTEXT (fn), arg, to);
+ /* Even though the assignment may not actually result in any
+ code being generated, we do not want to warn about the
+ assignment having no effect. That would be confusing to
+ users who may be performing the assignment as part of a
+ generic algorithm, for example.
+
+ Ideally, the notions of having side-effects and of being
+ useless would be orthogonal. */
+ TREE_SIDE_EFFECTS (val) = 1;
+ }
+ else
+ val = build (MODIFY_EXPR, TREE_TYPE (to), to, arg);
return val;
}
@@ -4263,7 +4306,10 @@ build_over_call (cand, args, flags)
if (TREE_SIDE_EFFECTS (*p))
*p = save_expr (*p);
t = build_pointer_type (TREE_TYPE (fn));
- fn = build_vfn_ref (p, build_indirect_ref (*p, 0), DECL_VINDEX (fn));
+ if (DECL_CONTEXT (fn) && TYPE_JAVA_INTERFACE (DECL_CONTEXT (fn)))
+ fn = build_java_interface_fn_ref (fn, *p);
+ else
+ fn = build_vfn_ref (p, build_indirect_ref (*p, 0), DECL_VINDEX (fn));
TREE_TYPE (fn) = t;
}
else if (DECL_INLINE (fn))
@@ -4298,6 +4344,72 @@ build_over_call (cand, args, flags)
return convert_from_reference (fn);
}
+static tree java_iface_lookup_fn;
+
+/* Make an expression which yields the address of the Java interface
+ method FN. This is achieved by generating a call to libjava's
+ _Jv_LookupInterfaceMethodIdx(). */
+
+static tree
+build_java_interface_fn_ref (fn, instance)
+ tree fn, instance;
+{
+ tree lookup_args, lookup_fn, method, idx;
+ tree klass_ref, iface, iface_ref;
+ int i;
+
+ if (!java_iface_lookup_fn)
+ {
+ tree endlink = build_void_list_node ();
+ tree t = tree_cons (NULL_TREE, ptr_type_node,
+ tree_cons (NULL_TREE, ptr_type_node,
+ tree_cons (NULL_TREE, java_int_type_node,
+ endlink)));
+ java_iface_lookup_fn
+ = builtin_function ("_Jv_LookupInterfaceMethodIdx",
+ build_function_type (ptr_type_node, t),
+ 0, NOT_BUILT_IN, NULL_PTR);
+ ggc_add_tree_root (&java_iface_lookup_fn, 1);
+ }
+
+ /* Look up the pointer to the runtime java.lang.Class object for `instance'.
+ This is the first entry in the vtable. */
+ klass_ref = build_vtbl_ref (build_indirect_ref (instance, 0),
+ integer_zero_node);
+
+ /* Get the java.lang.Class pointer for the interface being called. */
+ iface = DECL_CONTEXT (fn);
+ iface_ref = lookup_field (iface, get_identifier ("class$"), 0, 0);
+ if (!iface_ref || TREE_CODE (iface_ref) != VAR_DECL
+ || DECL_CONTEXT (iface_ref) != iface)
+ {
+ cp_error ("Could not find class$ field in java interface type `%T'",
+ iface);
+ return error_mark_node;
+ }
+ iface_ref = build1 (ADDR_EXPR, build_pointer_type (iface), iface_ref);
+
+ /* Determine the itable index of FN. */
+ i = 1;
+ for (method = TYPE_METHODS (iface); method; method = TREE_CHAIN (method))
+ {
+ if (!DECL_VIRTUAL_P (method))
+ continue;
+ if (fn == method)
+ break;
+ i++;
+ }
+ idx = build_int_2 (i, 0);
+
+ lookup_args = tree_cons (NULL_TREE, klass_ref,
+ tree_cons (NULL_TREE, iface_ref,
+ build_tree_list (NULL_TREE, idx)));
+ lookup_fn = build1 (ADDR_EXPR,
+ build_pointer_type (TREE_TYPE (java_iface_lookup_fn)),
+ java_iface_lookup_fn);
+ return build (CALL_EXPR, ptr_type_node, lookup_fn, lookup_args, NULL_TREE);
+}
+
/* Returns the value to use for the in-charge parameter when making a
call to a function with the indicated NAME. */
@@ -4415,25 +4527,12 @@ build_new_method_call (instance, name, args, basetype_path, flags)
pretty_name = (constructor_p
? constructor_name (basetype) : dtor_identifier);
- if (!flag_new_abi)
- {
- /* Add the in-charge parameter as an implicit first argument. */
- if (!constructor_p
- || TYPE_USES_VIRTUAL_BASECLASSES (basetype))
- args = tree_cons (NULL_TREE,
- in_charge_arg_for_name (name),
- args);
-
- /* We want to call the normal constructor function under the
- old ABI. */
- name = constructor_p ? ctor_identifier : dtor_identifier;
- }
/* If we're a call to a constructor or destructor for a
subobject that uses virtual base classes, then we need to
pass down a pointer to a VTT for the subobject. */
- else if ((name == base_ctor_identifier
- || name == base_dtor_identifier)
- && TYPE_USES_VIRTUAL_BASECLASSES (basetype))
+ if ((name == base_ctor_identifier
+ || name == base_dtor_identifier)
+ && TYPE_USES_VIRTUAL_BASECLASSES (basetype))
{
tree vtt;
tree sub_vtt;
@@ -4443,17 +4542,17 @@ build_new_method_call (instance, name, args, basetype_path, flags)
or destructor, then we fetch the VTT directly.
Otherwise, we look it up using the VTT we were given. */
vtt = IDENTIFIER_GLOBAL_VALUE (get_vtt_name (current_class_type));
- vtt = build_unary_op (ADDR_EXPR, vtt, /*noconvert=*/1);
- vtt = build (COND_EXPR, TREE_TYPE (vtt),
- DECL_USE_VTT_PARM (current_function_decl),
- DECL_VTT_PARM (current_function_decl),
+ vtt = decay_conversion (vtt);
+ vtt = build (COND_EXPR, TREE_TYPE (vtt),
+ build (EQ_EXPR, boolean_type_node,
+ current_in_charge_parm, integer_zero_node),
+ current_vtt_parm,
vtt);
if (TREE_VIA_VIRTUAL (basebinfo))
basebinfo = binfo_for_vbase (basetype, current_class_type);
my_friendly_assert (BINFO_SUBVTT_INDEX (basebinfo), 20010110);
sub_vtt = build (PLUS_EXPR, TREE_TYPE (vtt), vtt,
BINFO_SUBVTT_INDEX (basebinfo));
- sub_vtt = build_indirect_ref (sub_vtt, NULL);
args = tree_cons (NULL_TREE, sub_vtt, args);
}
@@ -4660,23 +4759,22 @@ maybe_handle_implicit_object (ics)
}
}
-/* If ICS is a REF_BIND, modify it appropriately, set TARGET_TYPE
- to the type the reference originally referred to, and return 1.
- Otherwise, return 0. */
+/* If *ICS is a REF_BIND set *ICS to the remainder of the conversion,
+ and return the type to which the reference refers. Otherwise,
+ leave *ICS unchanged and return NULL_TREE. */
-static int
-maybe_handle_ref_bind (ics, target_type)
+static tree
+maybe_handle_ref_bind (ics)
tree* ics;
- tree* target_type;
{
if (TREE_CODE (*ics) == REF_BIND)
{
- *target_type = TREE_TYPE (TREE_TYPE (*ics));
+ tree type = TREE_TYPE (TREE_TYPE (*ics));
*ics = TREE_OPERAND (*ics, 0);
- return 1;
+ return type;
}
-
- return 0;
+
+ return NULL_TREE;
}
/* Compare two implicit conversion sequences according to the rules set out in
@@ -4698,12 +4796,11 @@ compare_ics (ics1, ics2)
tree deref_from_type2 = NULL_TREE;
tree deref_to_type1 = NULL_TREE;
tree deref_to_type2 = NULL_TREE;
+ int rank1, rank2;
/* REF_BINDING is non-zero if the result of the conversion sequence
is a reference type. In that case TARGET_TYPE is the
type referred to by the reference. */
- int ref_binding1;
- int ref_binding2;
tree target_type1;
tree target_type2;
@@ -4712,8 +4809,8 @@ compare_ics (ics1, ics2)
maybe_handle_implicit_object (&ics2);
/* Handle reference parameters. */
- ref_binding1 = maybe_handle_ref_bind (&ics1, &target_type1);
- ref_binding2 = maybe_handle_ref_bind (&ics2, &target_type2);
+ target_type1 = maybe_handle_ref_bind (&ics1);
+ target_type2 = maybe_handle_ref_bind (&ics2);
/* [over.ics.rank]
@@ -4727,13 +4824,17 @@ compare_ics (ics1, ics2)
--a user-defined conversion sequence (_over.ics.user_) is a
better conversion sequence than an ellipsis conversion sequence
(_over.ics.ellipsis_). */
- if (ICS_RANK (ics1) > ICS_RANK (ics2))
+ rank1 = ICS_RANK (ics1);
+ rank2 = ICS_RANK (ics2);
+
+ if (rank1 > rank2)
return -1;
- else if (ICS_RANK (ics1) < ICS_RANK (ics2))
+ else if (rank1 < rank2)
return 1;
- if (ICS_RANK (ics1) == BAD_RANK)
+ if (rank1 == BAD_RANK)
{
+ /* XXX Isn't this an extension? */
/* Both ICS are bad. We try to make a decision based on what
would have happenned if they'd been good. */
if (ICS_USER_FLAG (ics1) > ICS_USER_FLAG (ics2)
@@ -4948,9 +5049,11 @@ compare_ics (ics1, ics2)
}
}
}
- else if (IS_AGGR_TYPE_CODE (TREE_CODE (from_type1))
+ else if (CLASS_TYPE_P (non_reference (from_type1))
&& same_type_p (from_type1, from_type2))
{
+ tree from = non_reference (from_type1);
+
/* [over.ics.rank]
--binding of an expression of type C to a reference of type
@@ -4958,8 +5061,8 @@ compare_ics (ics1, ics2)
reference of type A&
--conversion of C to B is better than conversion of C to A, */
- if (is_properly_derived_from (from_type1, to_type1)
- && is_properly_derived_from (from_type1, to_type2))
+ if (is_properly_derived_from (from, to_type1)
+ && is_properly_derived_from (from, to_type2))
{
if (is_properly_derived_from (to_type1, to_type2))
return 1;
@@ -4967,9 +5070,11 @@ compare_ics (ics1, ics2)
return -1;
}
}
- else if (IS_AGGR_TYPE_CODE (TREE_CODE (to_type1))
+ else if (CLASS_TYPE_P (non_reference (to_type1))
&& same_type_p (to_type1, to_type2))
{
+ tree to = non_reference (to_type1);
+
/* [over.ics.rank]
--binding of an expression of type B to a reference of type
@@ -4977,8 +5082,8 @@ compare_ics (ics1, ics2)
reference of type A&,
--onversion of B to A is better than conversion of C to A */
- if (is_properly_derived_from (from_type1, to_type1)
- && is_properly_derived_from (from_type2, to_type1))
+ if (is_properly_derived_from (from_type1, to)
+ && is_properly_derived_from (from_type2, to))
{
if (is_properly_derived_from (from_type2, from_type1))
return 1;
@@ -5006,7 +5111,7 @@ compare_ics (ics1, ics2)
initialized by S2 refers is more cv-qualified than the type to
which the reference initialized by S1 refers */
- if (ref_binding1 && ref_binding2
+ if (target_type1 && target_type2
&& same_type_ignoring_top_level_qualifiers_p (to_type1, to_type2))
return comp_cv_qualification (target_type2, target_type1);
@@ -5229,9 +5334,17 @@ joust (cand1, cand2, warn)
winner = more_specialized
(TI_TEMPLATE (cand1->template), TI_TEMPLATE (cand2->template),
DEDUCE_ORDER,
- /* Never do unification on the 'this' parameter. */
+ /* Tell the deduction code how many real function arguments
+ we saw, not counting the implicit 'this' argument. But,
+ add_function_candidate() suppresses the "this" argument
+ for constructors.
+
+ [temp.func.order]: The presence of unused ellipsis and default
+ arguments has no effect on the partial ordering of function
+ templates. */
TREE_VEC_LENGTH (cand1->convs)
- - DECL_NONSTATIC_MEMBER_FUNCTION_P (cand1->fn));
+ - (DECL_NONSTATIC_MEMBER_FUNCTION_P (cand1->fn)
+ -DECL_CONSTRUCTOR_P (cand1->fn)));
if (winner)
return winner;
}
@@ -5311,6 +5424,7 @@ tweak:
if (!pedantic)
{
int rank1 = IDENTITY_RANK, rank2 = IDENTITY_RANK;
+ struct z_candidate *w, *l;
for (i = 0; i < len; ++i)
{
@@ -5319,11 +5433,22 @@ tweak:
if (ICS_RANK (TREE_VEC_ELT (cand2->convs, i+off2)) > rank2)
rank2 = ICS_RANK (TREE_VEC_ELT (cand2->convs, i+off2));
}
-
if (rank1 < rank2)
- return 1;
+ winner = 1, w = cand1, l = cand2;
if (rank1 > rank2)
- return -1;
+ winner = -1, w = cand2, l = cand1;
+ if (winner)
+ {
+ if (warn)
+ {
+ cp_pedwarn ("choosing `%D' over `%D'", w->fn, l->fn);
+ cp_pedwarn (
+" because worst conversion for the former is better than worst conversion for the latter");
+ }
+ else
+ add_warning (w, l);
+ return winner;
+ }
}
my_friendly_assert (!winner, 20010121);
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index 376260b0d6a..3113dcb4322 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -66,12 +66,15 @@ typedef struct vtbl_init_data_s
{
/* The base for which we're building initializers. */
tree binfo;
- /* The binfo for the most-derived type. */
+ /* The type of the most-derived type. */
tree derived;
+ /* The binfo for the dynamic type. This will be TYPE_BINFO (derived),
+ unless ctor_vtbl_p is true. */
+ tree rtti_binfo;
/* The negative-index vtable initializers built up so far. These
are in order from least negative index to most negative index. */
tree inits;
- /* The last (i.e., most negative entry in INITS. */
+ /* The last (i.e., most negative) entry in INITS. */
tree* last_init;
/* The binfo for the virtual base for which we're building
vcall offset initializers. */
@@ -104,9 +107,8 @@ varray_type local_classes;
static tree get_vfield_name PARAMS ((tree));
static void finish_struct_anon PARAMS ((tree));
static tree build_vbase_pointer PARAMS ((tree, tree));
-static tree build_vtable_entry PARAMS ((tree, tree, tree, int));
+static tree build_vtable_entry PARAMS ((tree, tree, tree));
static tree get_vtable_name PARAMS ((tree));
-static tree get_derived_offset PARAMS ((tree, tree));
static tree get_basefndecls PARAMS ((tree, tree));
static int build_primary_vtable PARAMS ((tree, tree));
static int build_secondary_vtable PARAMS ((tree, tree));
@@ -119,9 +121,7 @@ static void delete_duplicate_fields PARAMS ((tree));
static void finish_struct_bits PARAMS ((tree));
static int alter_access PARAMS ((tree, tree, tree));
static void handle_using_decl PARAMS ((tree, tree));
-static int same_signature_p PARAMS ((tree, tree));
static int strictly_overrides PARAMS ((tree, tree));
-static void mark_overriders PARAMS ((tree, tree));
static void check_for_override PARAMS ((tree, tree));
static tree dfs_modify_vtables PARAMS ((tree, void *));
static tree modify_all_vtables PARAMS ((tree, int *, tree));
@@ -131,7 +131,7 @@ static void maybe_warn_about_overly_private_class PARAMS ((tree));
static int field_decl_cmp PARAMS ((const tree *, const tree *));
static int method_name_cmp PARAMS ((const tree *, const tree *));
static tree add_implicitly_declared_members PARAMS ((tree, int, int, int));
-static tree fixed_type_or_null PARAMS ((tree, int *));
+static tree fixed_type_or_null PARAMS ((tree, int *, int *));
static tree resolve_address_of_overloaded_function PARAMS ((tree, tree, int,
int, int, tree));
static void build_vtable_entry_ref PARAMS ((tree, tree, tree));
@@ -142,10 +142,10 @@ static void check_bitfield_decl PARAMS ((tree));
static void check_field_decl PARAMS ((tree, tree, int *, int *, int *, int *));
static void check_field_decls PARAMS ((tree, tree *, int *, int *, int *,
int *));
-static void build_base_field PARAMS ((record_layout_info, tree, int *,
- unsigned int *, splay_tree));
-static void build_base_fields PARAMS ((record_layout_info, int *,
- splay_tree));
+static bool build_base_field PARAMS ((record_layout_info, tree, int *,
+ splay_tree, tree));
+static bool build_base_fields PARAMS ((record_layout_info, int *,
+ splay_tree, tree));
static tree build_vbase_pointer_fields PARAMS ((record_layout_info, int *));
static tree build_vtbl_or_vbase_field PARAMS ((tree, tree, tree, tree, tree,
int *));
@@ -158,7 +158,7 @@ static void layout_class_type PARAMS ((tree, int *, int *, tree *, tree *));
static void fixup_pending_inline PARAMS ((tree));
static void fixup_inline_methods PARAMS ((tree));
static void set_primary_base PARAMS ((tree, tree, int *));
-static void propagate_binfo_offsets PARAMS ((tree, tree));
+static void propagate_binfo_offsets PARAMS ((tree, tree, tree));
static void layout_virtual_bases PARAMS ((tree, splay_tree));
static tree dfs_set_offset_for_unshared_vbases PARAMS ((tree, void *));
static void build_vbase_offset_vtbl_entries PARAMS ((tree, vtbl_init_data *));
@@ -169,48 +169,54 @@ static void layout_vtable_decl PARAMS ((tree, int));
static tree dfs_find_final_overrider PARAMS ((tree, void *));
static tree find_final_overrider PARAMS ((tree, tree, tree));
static int make_new_vtable PARAMS ((tree, tree));
-static void dump_class_hierarchy_r PARAMS ((FILE *, tree, tree, int));
-extern void dump_class_hierarchy PARAMS ((const char *, tree));
+static int maybe_indent_hierarchy PARAMS ((FILE *, int, int));
+static void dump_class_hierarchy_r PARAMS ((FILE *, int, tree, tree, int));
+static void dump_class_hierarchy PARAMS ((tree));
+static void dump_array PARAMS ((FILE *, tree));
+static void dump_vtable PARAMS ((tree, tree, tree));
+static void dump_vtt PARAMS ((tree, tree));
static tree build_vtable PARAMS ((tree, tree, tree));
static void initialize_vtable PARAMS ((tree, tree));
static void initialize_array PARAMS ((tree, tree));
static void layout_nonempty_base_or_field PARAMS ((record_layout_info,
tree, tree,
- splay_tree));
+ splay_tree, tree));
static unsigned HOST_WIDE_INT end_of_class PARAMS ((tree, int));
-static void layout_empty_base PARAMS ((tree, tree, splay_tree));
+static bool layout_empty_base PARAMS ((tree, tree, splay_tree, tree));
static void accumulate_vtbl_inits PARAMS ((tree, tree, tree, tree, tree));
static tree dfs_accumulate_vtbl_inits PARAMS ((tree, tree, tree, tree,
tree));
-static void set_vindex PARAMS ((tree, tree, int *));
-static void build_rtti_vtbl_entries PARAMS ((tree, tree, vtbl_init_data *));
+static void set_vindex PARAMS ((tree, int *));
+static void build_rtti_vtbl_entries PARAMS ((tree, vtbl_init_data *));
static void build_vcall_and_vbase_vtbl_entries PARAMS ((tree,
vtbl_init_data *));
static void force_canonical_binfo_r PARAMS ((tree, tree, tree, tree));
static void force_canonical_binfo PARAMS ((tree, tree, tree, tree));
+static tree dfs_unshared_virtual_bases PARAMS ((tree, void *));
static void mark_primary_bases PARAMS ((tree));
-static tree mark_primary_virtual_base PARAMS ((tree, tree, tree));
+static tree mark_primary_virtual_base PARAMS ((tree, tree));
static void clone_constructors_and_destructors PARAMS ((tree));
static tree build_clone PARAMS ((tree, tree));
static void update_vtable_entry_for_fn PARAMS ((tree, tree, tree, tree *));
static tree copy_virtuals PARAMS ((tree));
static void build_ctor_vtbl_group PARAMS ((tree, tree));
static void build_vtt PARAMS ((tree));
+static tree binfo_ctor_vtable PARAMS ((tree));
static tree *build_vtt_inits PARAMS ((tree, tree, tree *, tree *));
static tree dfs_build_secondary_vptr_vtt_inits PARAMS ((tree, void *));
static tree dfs_ctor_vtable_bases_queue_p PARAMS ((tree, void *data));
static tree dfs_fixup_binfo_vtbls PARAMS ((tree, void *));
-static tree get_matching_base PARAMS ((tree, tree));
+static tree get_original_base PARAMS ((tree, tree));
static tree dfs_get_primary_binfo PARAMS ((tree, void*));
static int record_subobject_offset PARAMS ((tree, tree, splay_tree));
static int check_subobject_offset PARAMS ((tree, tree, splay_tree));
static int walk_subobject_offsets PARAMS ((tree, subobject_offset_fn,
- tree, splay_tree, int));
+ tree, splay_tree, tree, int));
static void record_subobject_offsets PARAMS ((tree, tree, splay_tree, int));
static int layout_conflict_p PARAMS ((tree, tree, splay_tree, int));
static int splay_tree_compare_integer_csts PARAMS ((splay_tree_key k1,
splay_tree_key k2));
-
+static void warn_about_ambiguous_direct_bases PARAMS ((tree));
/* Macros for dfs walking during vtt construction. See
dfs_ctor_vtable_bases_queue_p, dfs_build_secondary_vptr_vtt_inits
@@ -381,6 +387,9 @@ build_vbase_path (code, type, expr, path, nonnull)
convert back to the type we want. Until that is done, we only optimize
if the complete type is the same type as expr has. */
fixed_type_p = resolves_to_fixed_type_p (expr, &nonnull);
+ if (fixed_type_p < 0)
+ /* Virtual base layout is not fixed, even in ctors and dtors. */
+ fixed_type_p = 0;
if (!fixed_type_p && TREE_SIDE_EFFECTS (expr))
expr = save_expr (expr);
@@ -538,9 +547,9 @@ build_vtable_entry_ref (basetype, vtbl, idx)
}
/* Given an object INSTANCE, return an expression which yields the
- virtual function vtable element corresponding to INDEX. There are
- many special cases for INSTANCE which we take care of here, mainly
- to avoid creating extra tree nodes when we don't have to. */
+ vtable element corresponding to INDEX. There are many special
+ cases for INSTANCE which we take care of here, mainly to avoid
+ creating extra tree nodes when we don't have to. */
tree
build_vtbl_ref (instance, idx)
@@ -637,7 +646,15 @@ build_vfn_ref (ptr_to_instptr, instance, idx)
/* When using thunks, there is no extra delta, and we get the pfn
directly. */
if (flag_vtable_thunks)
- return aref;
+ {
+ /* When using function descriptors, the address of the
+ vtable entry is treated as a function pointer. */
+ if (TARGET_VTABLE_USES_DESCRIPTORS)
+ return build1 (NOP_EXPR, TREE_TYPE (aref),
+ build_unary_op (ADDR_EXPR, aref, /*noconvert=*/1));
+
+ return aref;
+ }
if (ptr_to_instptr)
{
@@ -663,11 +680,7 @@ static tree
get_vtable_name (type)
tree type;
{
- if (flag_new_abi)
- return mangle_vtbl_for_type (type);
- else
- return build_overload_with_type (get_identifier (VTABLE_NAME_PREFIX),
- type);
+ return mangle_vtbl_for_type (type);
}
/* Return an IDENTIFIER_NODE for the name of the virtual table table
@@ -677,42 +690,7 @@ tree
get_vtt_name (type)
tree type;
{
- if (flag_new_abi)
- return mangle_vtt_for_type (type);
- else
- return build_overload_with_type (get_identifier (VTT_NAME_PREFIX),
- type);
-}
-
-/* Return the offset to the main vtable for a given base BINFO. */
-
-tree
-get_vfield_offset (binfo)
- tree binfo;
-{
- return
- size_binop (PLUS_EXPR, byte_position (TYPE_VFIELD (BINFO_TYPE (binfo))),
- BINFO_OFFSET (binfo));
-}
-
-/* Get the offset to the start of the original binfo that we derived
- this binfo from. If we find TYPE first, return the offset only
- that far. The shortened search is useful because the this pointer
- on method calling is expected to point to a DECL_CONTEXT (fndecl)
- object, and not a baseclass of it. */
-
-static tree
-get_derived_offset (binfo, type)
- tree binfo, type;
-{
- tree offset1 = get_vfield_offset (TYPE_BINFO (BINFO_TYPE (binfo)));
- tree offset2;
-
- while (!same_type_p (BINFO_TYPE (binfo), type))
- binfo = get_primary_binfo (binfo);
-
- offset2 = get_vfield_offset (TYPE_BINFO (BINFO_TYPE (binfo)));
- return size_binop (MINUS_EXPR, offset1, offset2);
+ return mangle_vtt_for_type (type);
}
/* Create a VAR_DECL for a primary or secondary vtable for CLASS_TYPE.
@@ -728,13 +706,13 @@ build_vtable (class_type, name, vtable_type)
tree decl;
decl = build_lang_decl (VAR_DECL, name, vtable_type);
+ /* vtable names are already mangled; give them their DECL_ASSEMBLER_NAME
+ now to avoid confusion in mangle_decl. */
+ SET_DECL_ASSEMBLER_NAME (decl, name);
DECL_CONTEXT (decl) = class_type;
DECL_ARTIFICIAL (decl) = 1;
TREE_STATIC (decl) = 1;
-#ifndef WRITABLE_VTABLES
- /* Make them READONLY by default. (mrs) */
TREE_READONLY (decl) = 1;
-#endif
DECL_VIRTUAL_P (decl) = 1;
import_export_vtable (decl, class_type, 0);
@@ -796,12 +774,11 @@ copy_virtuals (binfo)
{
BV_VCALL_INDEX (t) = NULL_TREE;
BV_USE_VCALL_INDEX_P (t) = 0;
- BV_GENERATE_THUNK_WITH_VTABLE_P (t) = 0;
}
return copies;
}
-
+
/* Build the primary virtual function table for TYPE. If BINFO is
non-NULL, build the vtable starting with the initial approximation
that it is the same as the one which is the head of the association
@@ -899,20 +876,8 @@ build_secondary_vtable (binfo, for_type)
/* Make fresh virtual list, so we can smash it later. */
BINFO_VIRTUALS (binfo) = copy_virtuals (binfo);
- if (TREE_VIA_VIRTUAL (binfo))
- {
- tree binfo1 = binfo_for_vbase (BINFO_TYPE (binfo), for_type);
-
- /* XXX - This should never happen, if it does, the caller should
- ensure that the binfo is from for_type's binfos, not from any
- base type's. We can remove all this code after a while. */
- if (binfo1 != binfo)
- warning ("internal inconsistency: binfo offset error for rtti");
-
- offset = BINFO_OFFSET (binfo1);
- }
- else
- offset = BINFO_OFFSET (binfo);
+ my_friendly_assert (binfo == CANONICAL_BINFO (binfo, for_type), 20010605);
+ offset = BINFO_OFFSET (binfo);
/* In the new ABI, secondary vtables are laid out as part of the
same structure as the primary vtable. */
@@ -1024,9 +989,11 @@ make_new_vtable (t, binfo)
{
if (binfo == TYPE_BINFO (t))
/* In this case, it is *type*'s vtable we are modifying. We start
- with the approximation that it's vtable is that of the
+ with the approximation that its vtable is that of the
immediate base class. */
- return build_primary_vtable (TYPE_BINFO (DECL_CONTEXT (TYPE_VFIELD (t))),
+ /* ??? This actually passes TYPE_BINFO (t), not the primary base binfo,
+ since we've updated DECL_CONTEXT (TYPE_VFIELD (t)) by now. */
+ return build_primary_vtable (TYPE_BINFO (DECL_CONTEXT (TYPE_VFIELD (t))),
t);
else
/* This is our very own copy of `basetype' to play with. Later,
@@ -1077,7 +1044,12 @@ modify_vtable_entry (t, binfo, fndecl, delta, virtuals)
BV_FN (v) = fndecl;
/* Now assign virtual dispatch information, if unset. We can
- dispatch this, through any overridden base function. */
+ dispatch this through any overridden base function.
+
+ FIXME this can choose a secondary vtable if the primary is not
+ also lexically first, leading to useless conversions.
+ In the V3 ABI, there's no reason for DECL_VIRTUAL_CONTEXT to
+ ever be different from DECL_CONTEXT. */
if (TREE_CODE (DECL_VINDEX (fndecl)) != INTEGER_CST)
{
DECL_VINDEX (fndecl) = DECL_VINDEX (base_fndecl);
@@ -1086,35 +1058,19 @@ modify_vtable_entry (t, binfo, fndecl, delta, virtuals)
}
}
-/* Return the index (in the virtual function table) of the first
- virtual function. */
-
-int
-first_vfun_index (t)
- tree t;
-{
- /* Under the old ABI, the offset-to-top and RTTI entries are at
- indices zero and one; under the new ABI, the first virtual
- function is at index zero. */
- if (!CLASSTYPE_COM_INTERFACE (t) && !flag_new_abi)
- return flag_vtable_thunks ? 2 : 1;
-
- return 0;
-}
-
/* Set DECL_VINDEX for DECL. VINDEX_P is the number of virtual
functions present in the vtable so far. */
static void
-set_vindex (t, decl, vfuns_p)
- tree t;
+set_vindex (decl, vfuns_p)
tree decl;
int *vfuns_p;
{
int vindex;
- vindex = (*vfuns_p)++;
- vindex += first_vfun_index (t);
+ vindex = *vfuns_p;
+ *vfuns_p += (TARGET_VTABLE_USES_DESCRIPTORS
+ ? TARGET_VTABLE_USES_DESCRIPTORS : 1);
DECL_VINDEX (decl) = build_shared_int_cst (vindex);
}
@@ -1158,7 +1114,7 @@ add_virtual_function (new_virtuals_p, overridden_virtuals_p,
CLASSTYPE_RTTI (t) = t;
/* Now assign virtual dispatch information. */
- set_vindex (t, fndecl, vfuns_p);
+ set_vindex (fndecl, vfuns_p);
DECL_VIRTUAL_CONTEXT (fndecl) = t;
/* Save the state we've computed on the NEW_VIRTUALS list. */
@@ -1308,22 +1264,38 @@ add_method (type, method, error_p)
/* [over.load] Member function declarations with the
same name and the same parameter types cannot be
overloaded if any of them is a static member
- function declaration. */
+ function declaration.
+
+ [namespace.udecl] When a using-declaration brings names
+ from a base class into a derived class scope, member
+ functions in the derived class override and/or hide member
+ functions with the same name and parameter types in a base
+ class (rather than conflicting). */
if ((DECL_STATIC_FUNCTION_P (fn)
!= DECL_STATIC_FUNCTION_P (method))
|| using)
{
tree parms1 = TYPE_ARG_TYPES (TREE_TYPE (fn));
tree parms2 = TYPE_ARG_TYPES (TREE_TYPE (method));
-
+ int same = 1;
+
+ /* Compare the quals on the 'this' parm. Don't compare
+ the whole types, as used functions are treated as
+ coming from the using class in overload resolution. */
+ if (using
+ && ! DECL_STATIC_FUNCTION_P (fn)
+ && ! DECL_STATIC_FUNCTION_P (method)
+ && (TYPE_QUALS (TREE_TYPE (TREE_VALUE (parms1)))
+ != TYPE_QUALS (TREE_TYPE (TREE_VALUE (parms2)))))
+ same = 0;
if (! DECL_STATIC_FUNCTION_P (fn))
parms1 = TREE_CHAIN (parms1);
if (! DECL_STATIC_FUNCTION_P (method))
parms2 = TREE_CHAIN (parms2);
- if (compparms (parms1, parms2))
+ if (same && compparms (parms1, parms2))
{
- if (using)
+ if (using && DECL_CONTEXT (fn) == type)
/* Defer to the local function. */
return;
else
@@ -1331,17 +1303,9 @@ add_method (type, method, error_p)
fn, method);
}
}
-
- /* Since this is an ordinary function in a
- non-template class, it's mangled name can be used
- as a unique identifier. This technique is only
- an optimization; we would get the same results if
- we just used decls_match here. */
- if (DECL_ASSEMBLER_NAME (fn)
- != DECL_ASSEMBLER_NAME (method))
- continue;
}
- else if (!decls_match (fn, method))
+
+ if (!decls_match (fn, method))
continue;
/* There has already been a declaration of this method
@@ -1486,6 +1450,9 @@ alter_access (t, fdecl, access)
if (!DECL_LANG_SPECIFIC (fdecl))
retrofit_lang_decl (fdecl);
+ if (DECL_DISCRIMINATOR_P (fdecl))
+ abort ();
+
elem = purpose_member (t, DECL_ACCESS (fdecl));
if (elem)
{
@@ -1622,12 +1589,12 @@ check_bases (t, cant_have_default_ctor_p, cant_have_const_ctor_p,
{
int n_baseclasses;
int i;
- int seen_nearly_empty_base_p;
+ int seen_non_virtual_nearly_empty_base_p;
tree binfos;
binfos = TYPE_BINFO_BASETYPES (t);
n_baseclasses = CLASSTYPE_N_BASECLASSES (t);
- seen_nearly_empty_base_p = 0;
+ seen_non_virtual_nearly_empty_base_p = 0;
/* An aggregate cannot have baseclasses. */
CLASSTYPE_NON_AGGREGATE (t) |= (n_baseclasses != 0);
@@ -1688,19 +1655,23 @@ check_bases (t, cant_have_default_ctor_p, cant_have_const_ctor_p,
basetype);
}
- /* If the base class is not empty or nearly empty, then this
- class cannot be nearly empty. */
- if (!CLASSTYPE_NEARLY_EMPTY_P (basetype) && !is_empty_class (basetype))
- CLASSTYPE_NEARLY_EMPTY_P (t) = 0;
- /* And if there is more than one nearly empty base, then the
- derived class is not nearly empty either. */
- else if (CLASSTYPE_NEARLY_EMPTY_P (basetype)
- && seen_nearly_empty_base_p)
- CLASSTYPE_NEARLY_EMPTY_P (t) = 0;
- /* If this is the first nearly empty base class, then remember
- that we saw it. */
+ if (TREE_VIA_VIRTUAL (base_binfo))
+ /* A virtual base does not effect nearly emptiness. */
+ ;
else if (CLASSTYPE_NEARLY_EMPTY_P (basetype))
- seen_nearly_empty_base_p = 1;
+ {
+ if (seen_non_virtual_nearly_empty_base_p)
+ /* And if there is more than one nearly empty base, then the
+ derived class is not nearly empty either. */
+ CLASSTYPE_NEARLY_EMPTY_P (t) = 0;
+ else
+ /* Remember we've seen one. */
+ seen_non_virtual_nearly_empty_base_p = 1;
+ }
+ else if (!is_empty_class (basetype))
+ /* If the base class is not empty or nearly empty, then this
+ class cannot be nearly empty. */
+ CLASSTYPE_NEARLY_EMPTY_P (t) = 0;
/* A lot of properties from the bases also apply to the derived
class. */
@@ -1742,10 +1713,15 @@ force_canonical_binfo_r (to, from, type, mappings)
tree mappings;
{
int i, n_baseclasses = BINFO_N_BASETYPES (from);
-
+
+ my_friendly_assert (to != from, 20010905);
BINFO_INDIRECT_PRIMARY_P (to)
= BINFO_INDIRECT_PRIMARY_P (from);
BINFO_INDIRECT_PRIMARY_P (from) = 0;
+ BINFO_UNSHARED_MARKED (to) = BINFO_UNSHARED_MARKED (from);
+ BINFO_UNSHARED_MARKED (from) = 0;
+ BINFO_LOST_PRIMARY_P (to) = BINFO_LOST_PRIMARY_P (from);
+ BINFO_LOST_PRIMARY_P (from) = 0;
if (BINFO_PRIMARY_P (from))
{
tree primary = BINFO_PRIMARY_BASE_OF (from);
@@ -1759,18 +1735,31 @@ force_canonical_binfo_r (to, from, type, mappings)
BINFO_PRIMARY_BASE_OF (to) = primary;
BINFO_PRIMARY_BASE_OF (from) = NULL_TREE;
}
- my_friendly_assert (same_type_p (BINFO_TYPE (to), BINFO_TYPE (from)), 20010104);
+ my_friendly_assert (same_type_p (BINFO_TYPE (to), BINFO_TYPE (from)),
+ 20010104);
mappings = tree_cons (from, to, mappings);
+
+ if (CLASSTYPE_HAS_PRIMARY_BASE_P (BINFO_TYPE (from))
+ && TREE_VIA_VIRTUAL (CLASSTYPE_PRIMARY_BINFO (BINFO_TYPE (from))))
+ {
+ tree from_primary = get_primary_binfo (from);
+
+ if (BINFO_PRIMARY_BASE_OF (from_primary) == from)
+ force_canonical_binfo (get_primary_binfo (to), from_primary,
+ type, mappings);
+ }
+
for (i = 0; i != n_baseclasses; i++)
{
tree from_binfo = BINFO_BASETYPE (from, i);
tree to_binfo = BINFO_BASETYPE (to, i);
-
+
if (TREE_VIA_VIRTUAL (from_binfo))
{
- tree shared_binfo = binfo_for_vbase (BINFO_TYPE (from_binfo), type);
-
- if (shared_binfo == from_binfo)
+ if (BINFO_PRIMARY_P (from_binfo) &&
+ purpose_member (BINFO_PRIMARY_BASE_OF (from_binfo), mappings))
+ /* This base is a primary of some binfo we have already
+ reseated. We must reseat this one too. */
force_canonical_binfo (to_binfo, from_binfo, type, mappings);
}
else
@@ -1797,30 +1786,29 @@ force_canonical_binfo (to, from, type, mappings)
{
tree assoc = purpose_member (BINFO_TYPE (to),
CLASSTYPE_VBASECLASSES (type));
- TREE_VALUE (assoc) = to;
- force_canonical_binfo_r (to, from, type, mappings);
+ if (TREE_VALUE (assoc) != to)
+ {
+ TREE_VALUE (assoc) = to;
+ force_canonical_binfo_r (to, from, type, mappings);
+ }
}
-/* Make BASE_BINFO the primary virtual base of BINFO within the hierarchy
- dominated by TYPE. Returns BASE_BINFO, if it can be made so, NULL
+/* Make BASE_BINFO the a primary virtual base within the hierarchy
+ dominated by TYPE. Returns BASE_BINFO, if it is not already one, NULL
otherwise (because something else has already made it primary). */
static tree
-mark_primary_virtual_base (binfo, base_binfo, type)
- tree binfo;
+mark_primary_virtual_base (base_binfo, type)
tree base_binfo;
tree type;
{
tree shared_binfo = binfo_for_vbase (BINFO_TYPE (base_binfo), type);
- tree delta;
if (BINFO_PRIMARY_P (shared_binfo))
{
/* It's already allocated in the hierarchy. BINFO won't have a
primary base in this hierachy, even though the complete object
BINFO is for, would do. */
- BINFO_LOST_PRIMARY_P (binfo) = 1;
-
return NULL_TREE;
}
@@ -1831,13 +1819,60 @@ mark_primary_virtual_base (binfo, base_binfo, type)
if (base_binfo != shared_binfo)
force_canonical_binfo (base_binfo, shared_binfo, type, NULL);
- delta = size_diffop (BINFO_OFFSET (binfo), BINFO_OFFSET (base_binfo));
- if (!integer_zerop (delta))
+ return base_binfo;
+}
+
+/* If BINFO is an unmarked virtual binfo for a class with a primary virtual
+ base, then BINFO has no primary base in this graph. Called from
+ mark_primary_bases. DATA is the most derived type. */
+
+static tree dfs_unshared_virtual_bases (binfo, data)
+ tree binfo;
+ void *data;
+{
+ tree t = (tree) data;
+
+ if (!BINFO_UNSHARED_MARKED (binfo)
+ && CLASSTYPE_HAS_PRIMARY_BASE_P (BINFO_TYPE (binfo)))
{
- propagate_binfo_offsets (base_binfo, delta);
- BINFO_OFFSET (base_binfo) = BINFO_OFFSET (binfo);
+ /* This morally virtual base has a primary base when it
+ is a complete object. We need to locate the shared instance
+ of this binfo in the type dominated by T. We duplicate the
+ primary base information from there to here. */
+ tree vbase;
+ tree unshared_base;
+
+ for (vbase = binfo; !TREE_VIA_VIRTUAL (vbase);
+ vbase = BINFO_INHERITANCE_CHAIN (vbase))
+ continue;
+ unshared_base = get_original_base (binfo,
+ binfo_for_vbase (BINFO_TYPE (vbase),
+ t));
+ my_friendly_assert (unshared_base != binfo, 20010612);
+ BINFO_LOST_PRIMARY_P (binfo) = BINFO_LOST_PRIMARY_P (unshared_base);
+ if (!BINFO_LOST_PRIMARY_P (binfo))
+ BINFO_PRIMARY_BASE_OF (get_primary_binfo (binfo)) = binfo;
}
- return base_binfo;
+
+ if (binfo != TYPE_BINFO (t))
+ /* The vtable fields will have been copied when duplicating the
+ base binfos. That information is bogus, make sure we don't try
+ and use it. */
+ BINFO_VTABLE (binfo) = NULL_TREE;
+
+ /* If this is a virtual primary base, make sure its offset matches
+ that which it is primary for. */
+ if (BINFO_PRIMARY_P (binfo) && TREE_VIA_VIRTUAL (binfo) &&
+ binfo_for_vbase (BINFO_TYPE (binfo), t) == binfo)
+ {
+ tree delta = size_diffop (BINFO_OFFSET (BINFO_PRIMARY_BASE_OF (binfo)),
+ BINFO_OFFSET (binfo));
+ if (!integer_zerop (delta))
+ propagate_binfo_offsets (binfo, delta, t);
+ }
+
+ BINFO_UNSHARED_MARKED (binfo) = 0;
+ return NULL;
}
/* Set BINFO_PRIMARY_BASE_OF for all binfos in the hierarchy
@@ -1861,11 +1896,24 @@ mark_primary_bases (type)
base_binfo = get_primary_binfo (binfo);
if (TREE_VIA_VIRTUAL (base_binfo))
- base_binfo = mark_primary_virtual_base (binfo, base_binfo, type);
+ base_binfo = mark_primary_virtual_base (base_binfo, type);
if (base_binfo)
BINFO_PRIMARY_BASE_OF (base_binfo) = binfo;
+ else
+ BINFO_LOST_PRIMARY_P (binfo) = 1;
+
+ BINFO_UNSHARED_MARKED (binfo) = 1;
}
+ /* There could remain unshared morally virtual bases which were not
+ visited in the inheritance graph walk. These bases will have lost
+ their virtual primary base (should they have one). We must now
+ find them. Also we must fix up the BINFO_OFFSETs of primary
+ virtual bases. We could not do that as we went along, as they
+ were originally copied from the bases we inherited from by
+ unshare_base_binfos. That may have decided differently about
+ where a virtual primary base went. */
+ dfs_walk (TYPE_BINFO (type), dfs_unshared_virtual_bases, NULL, type);
}
/* Make the BINFO the primary base of T. */
@@ -1942,9 +1990,6 @@ determine_primary_base (t, vfuns_p)
= tree_cons (base_binfo,
VF_BASETYPE_VALUE (vfields),
CLASSTYPE_VFIELDS (t));
-
- if (!flag_new_abi && *vfuns_p == 0)
- set_primary_base (t, base_binfo, vfuns_p);
}
}
}
@@ -1994,7 +2039,7 @@ determine_primary_base (t, vfuns_p)
/* The new ABI allows for the use of a "nearly-empty" virtual base
class as the primary base class if no non-virtual polymorphic
base can be found. */
- if (flag_new_abi && !CLASSTYPE_HAS_PRIMARY_BASE_P (t))
+ if (!CLASSTYPE_HAS_PRIMARY_BASE_P (t))
{
/* If not NULL, this is the best primary base candidate we have
found so far. */
@@ -2459,13 +2504,11 @@ layout_vtable_decl (binfo, n)
tree binfo;
int n;
{
- tree itype;
tree atype;
tree vtable;
- itype = size_int (n);
atype = build_cplus_array_type (vtable_entry_type,
- build_index_type (itype));
+ build_index_type (size_int (n - 1)));
layout_type (atype);
/* We may have to grow the vtable. */
@@ -2486,7 +2529,7 @@ layout_vtable_decl (binfo, n)
/* True iff FNDECL and BASE_FNDECL (both non-static member functions)
have the same signature. */
-static int
+int
same_signature_p (fndecl, base_fndecl)
tree fndecl, base_fndecl;
{
@@ -2524,6 +2567,9 @@ typedef struct find_final_overrider_data_s {
tree most_derived_type;
/* The final overriding function. */
tree overriding_fn;
+ /* The functions that we thought might be final overriders, but
+ aren't. */
+ tree candidates;
/* The BINFO for the class in which the final overriding function
appears. */
tree overriding_base;
@@ -2554,13 +2600,8 @@ dfs_find_final_overrider (binfo, data)
path;
path = TREE_CHAIN (path))
{
- for (method = TYPE_METHODS (BINFO_TYPE (TREE_VALUE (path)));
- method;
- method = TREE_CHAIN (method))
- if (DECL_VIRTUAL_P (method)
- && same_signature_p (method, ffod->fn))
- break;
-
+ method = look_for_overrides_here (BINFO_TYPE (TREE_VALUE (path)),
+ ffod->fn);
if (method)
break;
}
@@ -2582,49 +2623,91 @@ dfs_find_final_overrider (binfo, data)
break;
}
- if (ffod->overriding_fn && ffod->overriding_fn != method)
+ /* If we didn't already have an overrider, or any
+ candidates, then this function is the best candidate so
+ far. */
+ if (!ffod->overriding_fn && !ffod->candidates)
{
- /* We've found a different overrider along a different
- path. That can be OK if the new one overrides the
- old one. Consider:
-
- struct S { virtual void f(); };
- struct T : public virtual S { virtual void f(); };
- struct U : public virtual S, public virtual T {};
-
- Here `T::f' is the final overrider for `S::f'. */
- if (strictly_overrides (method, ffod->overriding_fn))
+ ffod->overriding_fn = method;
+ ffod->overriding_base = TREE_VALUE (path);
+ }
+ else if (ffod->overriding_fn)
+ {
+ /* We had a best overrider; let's see how this compares. */
+
+ if (ffod->overriding_fn == method
+ && (tree_int_cst_equal
+ (BINFO_OFFSET (TREE_VALUE (path)),
+ BINFO_OFFSET (ffod->overriding_base))))
+ /* We found the same overrider we already have, and in the
+ same place; it's still the best. */;
+ else if (strictly_overrides (ffod->overriding_fn, method))
+ /* The old function overrides this function; it's still the
+ best. */;
+ else if (strictly_overrides (method, ffod->overriding_fn))
{
+ /* The new function overrides the old; it's now the
+ best. */
ffod->overriding_fn = method;
ffod->overriding_base = TREE_VALUE (path);
}
- else if (!strictly_overrides (ffod->overriding_fn, method))
+ else
{
- cp_error ("no unique final overrider for `%D' in `%T'",
- ffod->most_derived_type,
- ffod->fn);
- cp_error ("candidates are: `%#D'", ffod->overriding_fn);
- cp_error (" `%#D'", method);
- return error_mark_node;
+ /* Ambiguous. */
+ ffod->candidates
+ = build_tree_list (NULL_TREE,
+ ffod->overriding_fn);
+ if (method != ffod->overriding_fn)
+ ffod->candidates
+ = tree_cons (NULL_TREE, method, ffod->candidates);
+ ffod->overriding_fn = NULL_TREE;
+ ffod->overriding_base = NULL_TREE;
}
}
- else if (ffod->overriding_base
- && (!tree_int_cst_equal
- (BINFO_OFFSET (TREE_VALUE (path)),
- BINFO_OFFSET (ffod->overriding_base))))
- {
- /* We've found two instances of the same base that
- provide overriders. */
- cp_error ("no unique final overrider for `%D' since there two instances of `%T' in `%T'",
- ffod->fn,
- BINFO_TYPE (ffod->overriding_base),
- ffod->most_derived_type);
- return error_mark_node;
- }
else
{
- ffod->overriding_fn = method;
- ffod->overriding_base = TREE_VALUE (path);
+ /* We had a list of ambiguous overrides; let's see how this
+ new one compares. */
+
+ tree candidates;
+ bool incomparable = false;
+
+ /* If there were previous candidates, and this function
+ overrides all of them, then it is the new best
+ candidate. */
+ for (candidates = ffod->candidates;
+ candidates;
+ candidates = TREE_CHAIN (candidates))
+ {
+ /* If the candidate overrides the METHOD, then we
+ needn't worry about it any further. */
+ if (strictly_overrides (TREE_VALUE (candidates),
+ method))
+ {
+ method = NULL_TREE;
+ break;
+ }
+
+ /* If the METHOD doesn't override the candidate,
+ then it is incomporable. */
+ if (!strictly_overrides (method,
+ TREE_VALUE (candidates)))
+ incomparable = true;
+ }
+
+ /* If METHOD overrode all the candidates, then it is the
+ new best candidate. */
+ if (!candidates && !incomparable)
+ {
+ ffod->overriding_fn = method;
+ ffod->overriding_base = TREE_VALUE (path);
+ ffod->candidates = NULL_TREE;
+ }
+ /* If METHOD didn't override all the candidates, then it
+ is another candidate. */
+ else if (method && incomparable)
+ ffod->candidates
+ = tree_cons (NULL_TREE, method, ffod->candidates);
}
}
}
@@ -2658,7 +2741,7 @@ find_final_overrider (t, binfo, fn)
struct T : virtual public R { virtual void f (); };
struct U : public S, public T { };
- is not -- there's no way to decide whether to put `S::f' or
+ is not -- there's no way to decide whether to put `S::f' or
`T::f' in the vtable for `R'.
The solution is to look at all paths to BINFO. If we find
@@ -2668,19 +2751,43 @@ find_final_overrider (t, binfo, fn)
ffod.most_derived_type = t;
ffod.overriding_fn = NULL_TREE;
ffod.overriding_base = NULL_TREE;
+ ffod.candidates = NULL_TREE;
- if (dfs_walk (TYPE_BINFO (t),
- dfs_find_final_overrider,
- NULL,
- &ffod))
- return error_mark_node;
+ dfs_walk (TYPE_BINFO (t),
+ dfs_find_final_overrider,
+ NULL,
+ &ffod);
+
+ /* If there was no winner, issue an error message. */
+ if (!ffod.overriding_fn)
+ {
+ cp_error ("no unique final overrider for `%D' in `%T'", fn, t);
+ return error_mark_node;
+ }
return build_tree_list (ffod.overriding_fn, ffod.overriding_base);
}
-/* Update a entry in the vtable for BINFO, which is in the hierarchy
- dominated by T. FN has been overridden in BINFO; VIRTUALS points
- to the corresponding position in the BINFO_VIRTUALS list. */
+/* Returns the function from the BINFO_VIRTUALS entry in T which matches
+ the signature of FUNCTION_DECL FN, or NULL_TREE if none. In other words,
+ the function that the slot in T's primary vtable points to. */
+
+static tree get_matching_virtual PARAMS ((tree, tree));
+static tree
+get_matching_virtual (t, fn)
+ tree t, fn;
+{
+ tree f;
+
+ for (f = BINFO_VIRTUALS (TYPE_BINFO (t)); f; f = TREE_CHAIN (f))
+ if (same_signature_p (BV_FN (f), fn))
+ return BV_FN (f);
+ return NULL_TREE;
+}
+
+/* Update an entry in the vtable for BINFO, which is in the hierarchy
+ dominated by T. FN has been overriden in BINFO; VIRTUALS points to the
+ corresponding position in the BINFO_VIRTUALS list. */
static void
update_vtable_entry_for_fn (t, binfo, fn, virtuals)
@@ -2693,98 +2800,95 @@ update_vtable_entry_for_fn (t, binfo, fn, virtuals)
tree overrider;
tree delta;
tree virtual_base;
- int generate_thunk_with_vtable_p;
+ tree first_defn;
+ bool lost = false;
- /* Find the function which originally caused this vtable
- entry to be present. */
- b = binfo;
- while (1)
+ /* Find the nearest primary base (possibly binfo itself) which defines
+ this function; this is the class the caller will convert to when
+ calling FN through BINFO. */
+ for (b = binfo; ; b = get_primary_binfo (b))
{
- tree primary_base;
- tree f;
-
- primary_base = get_primary_binfo (b);
- if (!primary_base)
- break;
-
- for (f = BINFO_VIRTUALS (TYPE_BINFO (BINFO_TYPE (primary_base)));
- f;
- f = TREE_CHAIN (f))
- if (same_signature_p (BV_FN (f), fn))
- break;
-
- if (!f)
+ if (look_for_overrides_here (BINFO_TYPE (b), fn))
break;
- fn = BV_FN (f);
- b = primary_base;
+ /* The nearest definition is from a lost primary. */
+ if (BINFO_LOST_PRIMARY_P (b))
+ lost = true;
}
+ first_defn = b;
/* Find the final overrider. */
overrider = find_final_overrider (t, b, fn);
if (overrider == error_mark_node)
return;
- /* Compute the constant adjustment to the `this' pointer. The
- `this' pointer, when this function is called, will point at the
- class whose vtable this is. */
- delta = size_binop (PLUS_EXPR,
- get_derived_offset (binfo,
- DECL_VIRTUAL_CONTEXT (fn)),
- BINFO_OFFSET (binfo));
-
/* Assume that we will produce a thunk that convert all the way to
the final overrider, and not to an intermediate virtual base. */
virtual_base = NULL_TREE;
- /* Assume that we will always generate thunks with the vtables that
- reference them. */
- generate_thunk_with_vtable_p = 1;
+ /* See if we can convert to an intermediate virtual base first, and then
+ use the vcall offset located there to finish the conversion. */
+ for (; b; b = BINFO_INHERITANCE_CHAIN (b))
+ {
+ /* If we find the final overrider, then we can stop
+ walking. */
+ if (same_type_p (BINFO_TYPE (b),
+ BINFO_TYPE (TREE_VALUE (overrider))))
+ break;
+
+ /* If we find a virtual base, and we haven't yet found the
+ overrider, then there is a virtual base between the
+ declaring base (first_defn) and the final overrider. */
+ if (!virtual_base && TREE_VIA_VIRTUAL (b))
+ virtual_base = b;
+ }
- /* Under the new ABI, we will convert to an intermediate virtual
- base first, and then use the vcall offset located there to finish
- the conversion. */
- if (flag_new_abi)
+ /* Compute the constant adjustment to the `this' pointer. The
+ `this' pointer, when this function is called, will point at BINFO
+ (or one of its primary bases, which are at the same offset). */
+
+ if (virtual_base)
+ /* The `this' pointer needs to be adjusted from the declaration to
+ the nearest virtual base. */
+ delta = size_diffop (BINFO_OFFSET (virtual_base),
+ BINFO_OFFSET (first_defn));
+ else if (lost)
+ /* If the nearest definition is in a lost primary, we don't need an
+ entry in our vtable. Except possibly in a constructor vtable,
+ if we happen to get our primary back. In that case, the offset
+ will be zero, as it will be a primary base. */
+ delta = size_zero_node;
+ else
{
- while (b)
- {
- /* If we find BINFO, then the final overrider is in a class
- derived from BINFO, so the thunks can be generated with
- the final overrider. */
- if (!virtual_base
- && same_type_p (BINFO_TYPE (b), BINFO_TYPE (binfo)))
- generate_thunk_with_vtable_p = 0;
-
- /* If we find the final overrider, then we can stop
- walking. */
- if (same_type_p (BINFO_TYPE (b),
- BINFO_TYPE (TREE_VALUE (overrider))))
- break;
+ /* The `this' pointer needs to be adjusted from pointing to
+ BINFO to pointing at the base where the final overrider
+ appears. */
+ delta = size_diffop (BINFO_OFFSET (TREE_VALUE (overrider)),
+ BINFO_OFFSET (binfo));
- /* If we find a virtual base, and we haven't yet found the
- overrider, then there is a virtual base between the
- declaring base and the final overrider. */
- if (!virtual_base && TREE_VIA_VIRTUAL (b))
+ if (! integer_zerop (delta))
+ {
+ /* We'll need a thunk. But if we have a (perhaps formerly)
+ primary virtual base, we have a vcall slot for this function,
+ so we can use it rather than create a non-virtual thunk. */
+
+ b = get_primary_binfo (first_defn);
+ for (; b; b = get_primary_binfo (b))
{
- generate_thunk_with_vtable_p = 1;
- virtual_base = b;
+ tree f = get_matching_virtual (BINFO_TYPE (b), fn);
+ if (!f)
+ /* b doesn't have this function; no suitable vbase. */
+ break;
+ if (TREE_VIA_VIRTUAL (b))
+ {
+ /* Found one; we can treat ourselves as a virtual base. */
+ virtual_base = binfo;
+ delta = size_zero_node;
+ break;
+ }
}
-
- b = BINFO_INHERITANCE_CHAIN (b);
}
}
- else
- virtual_base = NULL_TREE;
-
- if (virtual_base)
- /* The `this' pointer needs to be adjusted to the nearest virtual
- base. */
- delta = size_diffop (BINFO_OFFSET (virtual_base), delta);
- else
- /* The `this' pointer needs to be adjusted from pointing to
- BINFO to pointing at the base where the final overrider
- appears. */
- delta = size_diffop (BINFO_OFFSET (TREE_VALUE (overrider)), delta);
modify_vtable_entry (t,
binfo,
@@ -2794,8 +2898,6 @@ update_vtable_entry_for_fn (t, binfo, fn, virtuals)
if (virtual_base)
BV_USE_VCALL_INDEX_P (*virtuals) = 1;
- if (generate_thunk_with_vtable_p)
- BV_GENERATE_THUNK_WITH_VTABLE_P (*virtuals) = 1;
}
/* Called from modify_all_vtables via dfs_walk. */
@@ -2806,9 +2908,9 @@ dfs_modify_vtables (binfo, data)
void *data;
{
if (/* There's no need to modify the vtable for a non-virtual
- primary base; we're not going to use that vtable anyhow
- (virtual primary bases can become non-primary in a
- class derivation of this one.) */
+ primary base; we're not going to use that vtable anyhow.
+ We do still need to do this for virtual primary bases, as they
+ could become non-primary in a construction vtable. */
(!BINFO_PRIMARY_P (binfo) || TREE_VIA_VIRTUAL (binfo))
/* Similarly, a base without a vtable needs no modification. */
&& CLASSTYPE_VFIELDS (BINFO_TYPE (binfo)))
@@ -2822,8 +2924,7 @@ dfs_modify_vtables (binfo, data)
/* If we're supporting RTTI then we always need a new vtable to
point to the RTTI information. Under the new ABI we may need
a new vtable to contain vcall and vbase offsets. */
- if (flag_rtti || flag_new_abi)
- make_new_vtable (t, binfo);
+ make_new_vtable (t, binfo);
/* Now, go through each of the virtual functions in the virtual
function table for BINFO. Find the final overrider, and
@@ -2884,7 +2985,7 @@ modify_all_vtables (t, vfuns_p, overridden_virtuals)
|| !value_member (fn, BINFO_VIRTUALS (binfo)))
{
/* Set the vtable index. */
- set_vindex (t, fn, vfuns_p);
+ set_vindex (fn, vfuns_p);
/* We don't need to convert to a base class when calling
this function. */
DECL_VIRTUAL_CONTEXT (fn) = t;
@@ -2925,59 +3026,37 @@ strictly_overrides (fndecl1, fndecl2)
return 0;
}
-/* Get the base virtual function declarations in T that are either
- overridden or hidden by FNDECL as a list. We set TREE_PURPOSE with
- the overrider/hider. */
+/* Get the base virtual function declarations in T that have the
+ indicated NAME. */
static tree
-get_basefndecls (fndecl, t)
- tree fndecl, t;
+get_basefndecls (name, t)
+ tree name, t;
{
- tree methods = TYPE_METHODS (t);
+ tree methods;
tree base_fndecls = NULL_TREE;
- tree binfos = BINFO_BASETYPES (TYPE_BINFO (t));
- int i, n_baseclasses = binfos ? TREE_VEC_LENGTH (binfos) : 0;
-
- while (methods)
- {
- if (TREE_CODE (methods) == FUNCTION_DECL
- && DECL_VINDEX (methods) != NULL_TREE
- && DECL_NAME (fndecl) == DECL_NAME (methods))
- base_fndecls = tree_cons (fndecl, methods, base_fndecls);
+ int n_baseclasses = CLASSTYPE_N_BASECLASSES (t);
+ int i;
- methods = TREE_CHAIN (methods);
- }
+ for (methods = TYPE_METHODS (t); methods; methods = TREE_CHAIN (methods))
+ if (TREE_CODE (methods) == FUNCTION_DECL
+ && DECL_VINDEX (methods) != NULL_TREE
+ && DECL_NAME (methods) == name)
+ base_fndecls = tree_cons (NULL_TREE, methods, base_fndecls);
if (base_fndecls)
return base_fndecls;
for (i = 0; i < n_baseclasses; i++)
{
- tree base_binfo = TREE_VEC_ELT (binfos, i);
- tree basetype = BINFO_TYPE (base_binfo);
-
- base_fndecls = chainon (get_basefndecls (fndecl, basetype),
+ tree basetype = TYPE_BINFO_BASETYPE (t, i);
+ base_fndecls = chainon (get_basefndecls (name, basetype),
base_fndecls);
}
return base_fndecls;
}
-/* Mark the functions that have been hidden with their overriders.
- Since we start out with all functions already marked with a hider,
- no need to mark functions that are just hidden.
-
- Subroutine of warn_hidden. */
-
-static void
-mark_overriders (fndecl, base_fndecls)
- tree fndecl, base_fndecls;
-{
- for (; base_fndecls; base_fndecls = TREE_CHAIN (base_fndecls))
- if (same_signature_p (fndecl, TREE_VALUE (base_fndecls)))
- TREE_PURPOSE (base_fndecls) = fndecl;
-}
-
/* If this declaration supersedes the declaration of
a method declared virtual in the base class, then
mark this field as being virtual as well. */
@@ -3025,57 +3104,59 @@ warn_hidden (t)
/* We go through each separately named virtual function. */
for (i = 2; i < n_methods && TREE_VEC_ELT (method_vec, i); ++i)
{
- tree fns = TREE_VEC_ELT (method_vec, i);
- tree fndecl = NULL_TREE;
-
- tree base_fndecls = NULL_TREE;
- tree binfos = BINFO_BASETYPES (TYPE_BINFO (t));
- int i, n_baseclasses = binfos ? TREE_VEC_LENGTH (binfos) : 0;
-
- /* First see if we have any virtual functions in this batch. */
- for (; fns; fns = OVL_NEXT (fns))
+ tree fns;
+ tree name;
+ tree fndecl;
+ tree base_fndecls;
+ int j;
+
+ /* All functions in this slot in the CLASSTYPE_METHOD_VEC will
+ have the same name. Figure out what name that is. */
+ name = DECL_NAME (OVL_CURRENT (TREE_VEC_ELT (method_vec, i)));
+ /* There are no possibly hidden functions yet. */
+ base_fndecls = NULL_TREE;
+ /* Iterate through all of the base classes looking for possibly
+ hidden functions. */
+ for (j = 0; j < CLASSTYPE_N_BASECLASSES (t); j++)
{
- fndecl = OVL_CURRENT (fns);
- if (DECL_VINDEX (fndecl))
- break;
+ tree basetype = TYPE_BINFO_BASETYPE (t, j);
+ base_fndecls = chainon (get_basefndecls (name, basetype),
+ base_fndecls);
}
- if (fns == NULL_TREE)
+ /* If there are no functions to hide, continue. */
+ if (!base_fndecls)
continue;
- /* First we get a list of all possible functions that might be
- hidden from each base class. */
- for (i = 0; i < n_baseclasses; i++)
+ /* Remove any overridden functions. */
+ for (fns = TREE_VEC_ELT (method_vec, i); fns; fns = OVL_NEXT (fns))
{
- tree base_binfo = TREE_VEC_ELT (binfos, i);
- tree basetype = BINFO_TYPE (base_binfo);
-
- base_fndecls = chainon (get_basefndecls (fndecl, basetype),
- base_fndecls);
+ fndecl = OVL_CURRENT (fns);
+ if (DECL_VINDEX (fndecl))
+ {
+ tree *prev = &base_fndecls;
+
+ while (*prev)
+ /* If the method from the base class has the same
+ signature as the method from the derived class, it
+ has been overridden. */
+ if (same_signature_p (fndecl, TREE_VALUE (*prev)))
+ *prev = TREE_CHAIN (*prev);
+ else
+ prev = &TREE_CHAIN (*prev);
+ }
}
- fns = OVL_NEXT (fns);
-
- /* ...then mark up all the base functions with overriders, preferring
- overriders to hiders. */
- if (base_fndecls)
- for (; fns; fns = OVL_NEXT (fns))
- {
- fndecl = OVL_CURRENT (fns);
- if (DECL_VINDEX (fndecl))
- mark_overriders (fndecl, base_fndecls);
- }
-
/* Now give a warning for all base functions without overriders,
as they are hidden. */
- for (; base_fndecls; base_fndecls = TREE_CHAIN (base_fndecls))
- if (!same_signature_p (TREE_PURPOSE (base_fndecls),
- TREE_VALUE (base_fndecls)))
- {
- /* Here we know it is a hider, and no overrider exists. */
- cp_warning_at ("`%D' was hidden", TREE_VALUE (base_fndecls));
- cp_warning_at (" by `%D'", TREE_PURPOSE (base_fndecls));
- }
+ while (base_fndecls)
+ {
+ /* Here we know it is a hider, and no overrider exists. */
+ cp_warning_at ("`%D' was hidden", TREE_VALUE (base_fndecls));
+ cp_warning_at (" by `%D'",
+ OVL_CURRENT (TREE_VEC_ELT (method_vec, i)));
+ base_fndecls = TREE_CHAIN (base_fndecls);
+ }
}
}
@@ -3624,10 +3705,9 @@ check_field_decls (t, access_decls, empty_p,
if (DECL_MUTABLE_P (x) || TYPE_HAS_MUTABLE_P (type))
CLASSTYPE_HAS_MUTABLE (t) = 1;
- if (! pod_type_p (type)
- /* For some reason, pointers to members are POD types themselves,
- but are not allowed in POD structs. Silly. */
- || TYPE_PTRMEM_P (type) || TYPE_PTRMEMFUNC_P (type))
+ if (! pod_type_p (type))
+ /* DR 148 now allows pointers to members (which are POD themselves),
+ to be allowed in POD structs. */
CLASSTYPE_NON_POD_P (t) = 1;
/* If any field is const, the structure type is pseudo-const. */
@@ -3724,7 +3804,7 @@ build_vtbl_or_vbase_field (name, assembler_name, type, class_type, fcontext,
/* Build the FIELD_DECL. */
field = build_decl (FIELD_DECL, name, type);
- DECL_ASSEMBLER_NAME (field) = assembler_name;
+ SET_DECL_ASSEMBLER_NAME (field, assembler_name);
DECL_VIRTUAL_P (field) = 1;
DECL_ARTIFICIAL (field) = 1;
DECL_FIELD_CONTEXT (field) = class_type;
@@ -3794,20 +3874,30 @@ check_subobject_offset (type, offset, offsets)
/* Walk through all the subobjects of TYPE (located at OFFSET). Call
F for every subobject, passing it the type, offset, and table of
OFFSETS. If VBASES_P is non-zero, then even virtual non-primary
- bases should be traversed; otherwise, they are ignored. If F
- returns a non-zero value, the traversal ceases, and that value is
- returned. Otherwise, returns zero. */
+ bases should be traversed; otherwise, they are ignored.
+
+ If MAX_OFFSET is non-NULL, then subobjects with an offset greater
+ than MAX_OFFSET will not be walked.
+
+ If F returns a non-zero value, the traversal ceases, and that value
+ is returned. Otherwise, returns zero. */
static int
-walk_subobject_offsets (type, f, offset, offsets, vbases_p)
+walk_subobject_offsets (type, f, offset, offsets, max_offset, vbases_p)
tree type;
subobject_offset_fn f;
tree offset;
splay_tree offsets;
+ tree max_offset;
int vbases_p;
{
int r = 0;
+ /* If this OFFSET is bigger than the MAX_OFFSET, then we should
+ stop. */
+ if (max_offset && INT_CST_LT (max_offset, offset))
+ return 0;
+
if (CLASS_TYPE_P (type))
{
tree field;
@@ -3834,6 +3924,7 @@ walk_subobject_offsets (type, f, offset, offsets, vbases_p)
offset,
BINFO_OFFSET (binfo)),
offsets,
+ max_offset,
vbases_p);
if (r)
return r;
@@ -3849,6 +3940,7 @@ walk_subobject_offsets (type, f, offset, offsets, vbases_p)
offset,
DECL_FIELD_OFFSET (field)),
offsets,
+ max_offset,
/*vbases_p=*/1);
if (r)
return r;
@@ -3868,11 +3960,17 @@ walk_subobject_offsets (type, f, offset, offsets, vbases_p)
f,
offset,
offsets,
+ max_offset,
/*vbases_p=*/1);
if (r)
return r;
offset = size_binop (PLUS_EXPR, offset,
TYPE_SIZE_UNIT (TREE_TYPE (type)));
+ /* If this new OFFSET is bigger than the MAX_OFFSET, then
+ there's no point in iterating through the remaining
+ elements of the array. */
+ if (max_offset && INT_CST_LT (max_offset, offset))
+ break;
}
}
@@ -3891,7 +3989,7 @@ record_subobject_offsets (type, offset, offsets, vbases_p)
int vbases_p;
{
walk_subobject_offsets (type, record_subobject_offset, offset,
- offsets, vbases_p);
+ offsets, /*max_offset=*/NULL_TREE, vbases_p);
}
/* Returns non-zero if any of the empty subobjects of TYPE (located at
@@ -3905,22 +4003,34 @@ layout_conflict_p (type, offset, offsets, vbases_p)
splay_tree offsets;
int vbases_p;
{
+ splay_tree_node max_node;
+
+ /* Get the node in OFFSETS that indicates the maximum offset where
+ an empty subobject is located. */
+ max_node = splay_tree_max (offsets);
+ /* If there aren't any empty subobjects, then there's no point in
+ performing this check. */
+ if (!max_node)
+ return 0;
+
return walk_subobject_offsets (type, check_subobject_offset, offset,
- offsets, vbases_p);
+ offsets, (tree) (max_node->key),
+ vbases_p);
}
/* DECL is a FIELD_DECL corresponding either to a base subobject of a
non-static data member of the type indicated by RLI. BINFO is the
binfo corresponding to the base subobject, OFFSETS maps offsets to
- types already located at those offsets. This function determines
- the position of the DECL. */
+ types already located at those offsets. T is the most derived
+ type. This function determines the position of the DECL. */
static void
-layout_nonempty_base_or_field (rli, decl, binfo, offsets)
+layout_nonempty_base_or_field (rli, decl, binfo, offsets, t)
record_layout_info rli;
tree decl;
tree binfo;
splay_tree offsets;
+ tree t;
{
tree offset = NULL_TREE;
tree type = TREE_TYPE (decl);
@@ -3954,10 +4064,10 @@ layout_nonempty_base_or_field (rli, decl, binfo, offsets)
empty class, have non-zero size, any overlap can happen only
with a direct or indirect base-class -- it can't happen with
a data member. */
- if (flag_new_abi && layout_conflict_p (TREE_TYPE (decl),
- offset,
- offsets,
- field_p))
+ if (layout_conflict_p (TREE_TYPE (decl),
+ offset,
+ offsets,
+ field_p))
{
/* Strip off the size allocated to this field. That puts us
at the first place we could have put the field with
@@ -3977,26 +4087,29 @@ layout_nonempty_base_or_field (rli, decl, binfo, offsets)
break;
}
- /* Now that we know where it wil be placed, update its
+ /* Now that we know where it will be placed, update its
BINFO_OFFSET. */
if (binfo && CLASS_TYPE_P (BINFO_TYPE (binfo)))
propagate_binfo_offsets (binfo,
- convert (ssizetype, offset));
+ convert (ssizetype, offset), t);
}
/* Layout the empty base BINFO. EOC indicates the byte currently just
past the end of the class, and should be correctly aligned for a
class of the type indicated by BINFO; OFFSETS gives the offsets of
- the empty bases allocated so far. */
+ the empty bases allocated so far. T is the most derived
+ type. Return non-zero iff we added it at the end. */
-static void
-layout_empty_base (binfo, eoc, offsets)
+static bool
+layout_empty_base (binfo, eoc, offsets, t)
tree binfo;
tree eoc;
splay_tree offsets;
+ tree t;
{
tree alignment;
tree basetype = BINFO_TYPE (binfo);
+ bool atend = false;
/* This routine should only be used for empty classes. */
my_friendly_assert (is_empty_class (basetype), 20000321);
@@ -4011,7 +4124,8 @@ layout_empty_base (binfo, eoc, offsets)
{
/* That didn't work. Now, we move forward from the next
available spot in the class. */
- propagate_binfo_offsets (binfo, convert (ssizetype, eoc));
+ atend = true;
+ propagate_binfo_offsets (binfo, convert (ssizetype, eoc), t);
while (1)
{
if (!layout_conflict_p (BINFO_TYPE (binfo),
@@ -4022,31 +4136,35 @@ layout_empty_base (binfo, eoc, offsets)
break;
/* There's overlap here, too. Bump along to the next spot. */
- propagate_binfo_offsets (binfo, alignment);
+ propagate_binfo_offsets (binfo, alignment, t);
}
}
+ return atend;
}
/* Build a FIELD_DECL for the base given by BINFO in the class
indicated by RLI. If the new object is non-empty, clear *EMPTY_P.
*BASE_ALIGN is a running maximum of the alignments of any base
- class. OFFSETS gives the location of empty base subobjects. */
+ class. OFFSETS gives the location of empty base subobjects. T is
+ the most derived type. Return non-zero if the new object cannot be
+ nearly-empty. */
-static void
-build_base_field (rli, binfo, empty_p, base_align, offsets)
+static bool
+build_base_field (rli, binfo, empty_p, offsets, t)
record_layout_info rli;
tree binfo;
int *empty_p;
- unsigned int *base_align;
splay_tree offsets;
+ tree t;
{
tree basetype = BINFO_TYPE (binfo);
tree decl;
+ bool atend = false;
if (!COMPLETE_TYPE_P (basetype))
/* This error is now reported in xref_tag, thus giving better
location information. */
- return;
+ return atend;
decl = build_decl (FIELD_DECL, NULL_TREE, basetype);
DECL_ARTIFICIAL (decl) = 1;
@@ -4056,20 +4174,6 @@ build_base_field (rli, binfo, empty_p, base_align, offsets)
DECL_ALIGN (decl) = CLASSTYPE_ALIGN (basetype);
DECL_USER_ALIGN (decl) = CLASSTYPE_USER_ALIGN (basetype);
- if (! flag_new_abi)
- {
- /* Brain damage for backwards compatibility. For no good
- reason, the old basetype layout made every base have at least
- as large as the alignment for the bases up to that point,
- gratuitously wasting space. So we do the same thing here. */
- *base_align = MAX (*base_align, DECL_ALIGN (decl));
- DECL_SIZE (decl)
- = size_binop (MAX_EXPR, DECL_SIZE (decl), bitsize_int (*base_align));
- DECL_SIZE_UNIT (decl)
- = size_binop (MAX_EXPR, DECL_SIZE_UNIT (decl),
- size_int (*base_align / BITS_PER_UNIT));
- }
-
if (!integer_zerop (DECL_SIZE (decl)))
{
/* The containing class is non-empty because it has a non-empty
@@ -4079,7 +4183,7 @@ build_base_field (rli, binfo, empty_p, base_align, offsets)
/* Try to place the field. It may take more than one try if we
have a hard time placing the field without putting two
objects of the same type at the same address. */
- layout_nonempty_base_or_field (rli, decl, binfo, offsets);
+ layout_nonempty_base_or_field (rli, decl, binfo, offsets, t);
}
else
{
@@ -4089,44 +4193,40 @@ build_base_field (rli, binfo, empty_p, base_align, offsets)
byte-aligned. */
eoc = tree_low_cst (rli_size_unit_so_far (rli), 0);
eoc = CEIL (eoc, DECL_ALIGN_UNIT (decl)) * DECL_ALIGN_UNIT (decl);
- layout_empty_base (binfo, size_int (eoc), offsets);
+ atend |= layout_empty_base (binfo, size_int (eoc), offsets, t);
}
- /* Check for inaccessible base classes. If the same base class
- appears more than once in the hierarchy, but isn't virtual, then
- it's ambiguous. */
- if (get_base_distance (basetype, rli->t, 0, NULL) == -2)
- cp_warning ("direct base `%T' inaccessible in `%T' due to ambiguity",
- basetype, rli->t);
-
/* Record the offsets of BINFO and its base subobjects. */
record_subobject_offsets (BINFO_TYPE (binfo),
BINFO_OFFSET (binfo),
offsets,
/*vbases_p=*/0);
+ return atend;
}
/* Layout all of the non-virtual base classes. Record empty
- subobjects in OFFSETS. */
+ subobjects in OFFSETS. T is the most derived type. Return
+ non-zero if the type cannot be nearly empty. */
-static void
-build_base_fields (rli, empty_p, offsets)
+static bool
+build_base_fields (rli, empty_p, offsets, t)
record_layout_info rli;
int *empty_p;
splay_tree offsets;
+ tree t;
{
/* Chain to hold all the new FIELD_DECLs which stand in for base class
subobjects. */
tree rec = rli->t;
int n_baseclasses = CLASSTYPE_N_BASECLASSES (rec);
int i;
- unsigned int base_align = 0;
+ bool atend = 0;
/* Under the new ABI, the primary base class is always allocated
first. */
- if (flag_new_abi && CLASSTYPE_HAS_PRIMARY_BASE_P (rec))
+ if (CLASSTYPE_HAS_PRIMARY_BASE_P (rec))
build_base_field (rli, CLASSTYPE_PRIMARY_BINFO (rec),
- empty_p, &base_align, offsets);
+ empty_p, offsets, t);
/* Now allocate the rest of the bases. */
for (i = 0; i < n_baseclasses; ++i)
@@ -4137,7 +4237,7 @@ build_base_fields (rli, empty_p, offsets)
/* Under the new ABI, the primary base was already allocated
above, so we don't need to allocate it again here. */
- if (flag_new_abi && base_binfo == CLASSTYPE_PRIMARY_BINFO (rec))
+ if (base_binfo == CLASSTYPE_PRIMARY_BINFO (rec))
continue;
/* A primary virtual base class is allocated just like any other
@@ -4147,8 +4247,9 @@ build_base_fields (rli, empty_p, offsets)
&& !BINFO_PRIMARY_P (base_binfo))
continue;
- build_base_field (rli, base_binfo, empty_p, &base_align, offsets);
+ atend |= build_base_field (rli, base_binfo, empty_p, offsets, t);
}
+ return atend;
}
/* Go through the TYPE_METHODS of T issuing any appropriate
@@ -4167,7 +4268,8 @@ check_methods (t)
GNU_xref_member (current_class_name, x);
/* If this was an evil function, don't keep it in class. */
- if (IDENTIFIER_ERROR_LOCUS (DECL_ASSEMBLER_NAME (x)))
+ if (DECL_ASSEMBLER_NAME_SET_P (x)
+ && IDENTIFIER_ERROR_LOCUS (DECL_ASSEMBLER_NAME (x)))
continue;
check_for_override (x, t);
@@ -4196,18 +4298,13 @@ check_methods (t)
[class.free]) requires that the second argument be set
correctly. */
second_parm = TREE_CHAIN (TYPE_ARG_TYPES (TREE_TYPE (x)));
- /* This is overly conservative, but we must maintain this
- behavior for backwards compatibility. */
- if (!flag_new_abi && second_parm != void_list_node)
- TYPE_VEC_DELETE_TAKES_SIZE (t) = 1;
/* Under the new ABI, we choose only those function that are
explicitly declared as `operator delete[] (void *,
size_t)'. */
- else if (flag_new_abi
- && !seen_one_arg_array_delete_p
- && second_parm
- && TREE_CHAIN (second_parm) == void_list_node
- && same_type_p (TREE_VALUE (second_parm), sizetype))
+ if (!seen_one_arg_array_delete_p
+ && second_parm
+ && TREE_CHAIN (second_parm) == void_list_node
+ && same_type_p (TREE_VALUE (second_parm), sizetype))
TYPE_VEC_DELETE_TAKES_SIZE (t) = 1;
/* If there's no second parameter, then this is the usual
deallocation function. */
@@ -4233,16 +4330,15 @@ build_clone (fn, name)
clone = copy_decl (fn);
/* Remember where this function came from. */
DECL_CLONED_FUNCTION (clone) = fn;
+ DECL_ABSTRACT_ORIGIN (clone) = fn;
/* Reset the function name. */
DECL_NAME (clone) = name;
- DECL_ASSEMBLER_NAME (clone) = DECL_NAME (clone);
+ SET_DECL_ASSEMBLER_NAME (clone, NULL_TREE);
/* There's no pending inline data for this function. */
DECL_PENDING_INLINE_INFO (clone) = NULL;
DECL_PENDING_INLINE_P (clone) = 0;
/* And it hasn't yet been deferred. */
DECL_DEFERRED_FN (clone) = 0;
- /* There's no magic VTT parameter in the clone. */
- DECL_VTT_PARM (clone) = NULL_TREE;
/* The base-class destructor is not virtual. */
if (name == base_dtor_identifier)
@@ -4267,10 +4363,12 @@ build_clone (fn, name)
parmtypes = TREE_CHAIN (parmtypes);
/* Skip the in-charge parameter. */
parmtypes = TREE_CHAIN (parmtypes);
+ /* And the VTT parm, in a complete [cd]tor. */
+ if (DECL_HAS_VTT_PARM_P (fn)
+ && ! DECL_NEEDS_VTT_PARM_P (clone))
+ parmtypes = TREE_CHAIN (parmtypes);
/* If this is subobject constructor or destructor, add the vtt
parameter. */
- if (DECL_NEEDS_VTT_PARM_P (clone))
- parmtypes = hash_tree_chain (vtt_parm_type, parmtypes);
TREE_TYPE (clone)
= build_cplus_method_type (basetype,
TREE_TYPE (TREE_TYPE (clone)),
@@ -4280,8 +4378,8 @@ build_clone (fn, name)
exceptions);
}
- /* Copy the function parameters. But, DECL_ARGUMENTS aren't
- function parameters; instead, those are the template parameters. */
+ /* Copy the function parameters. But, DECL_ARGUMENTS on a TEMPLATE_DECL
+ aren't function parameters; those are the template parameters. */
if (TREE_CODE (clone) != TEMPLATE_DECL)
{
DECL_ARGUMENTS (clone) = copy_list (DECL_ARGUMENTS (clone));
@@ -4292,16 +4390,17 @@ build_clone (fn, name)
= TREE_CHAIN (TREE_CHAIN (DECL_ARGUMENTS (clone)));
DECL_HAS_IN_CHARGE_PARM_P (clone) = 0;
}
-
- /* Add the VTT parameter. */
- if (DECL_NEEDS_VTT_PARM_P (clone))
+ /* And the VTT parm, in a complete [cd]tor. */
+ if (DECL_HAS_VTT_PARM_P (fn))
{
- tree parm;
-
- parm = build_artificial_parm (vtt_parm_identifier,
- vtt_parm_type);
- TREE_CHAIN (parm) = TREE_CHAIN (DECL_ARGUMENTS (clone));
- TREE_CHAIN (DECL_ARGUMENTS (clone)) = parm;
+ if (DECL_NEEDS_VTT_PARM_P (clone))
+ DECL_HAS_VTT_PARM_P (clone) = 1;
+ else
+ {
+ TREE_CHAIN (DECL_ARGUMENTS (clone))
+ = TREE_CHAIN (TREE_CHAIN (DECL_ARGUMENTS (clone)));
+ DECL_HAS_VTT_PARM_P (clone) = 0;
+ }
}
for (parms = DECL_ARGUMENTS (clone); parms; parms = TREE_CHAIN (parms))
@@ -4311,11 +4410,8 @@ build_clone (fn, name)
}
}
- /* Mangle the function name. */
- set_mangled_name_for_decl (clone);
-
/* Create the RTL for this function. */
- DECL_RTL (clone) = NULL_RTX;
+ SET_DECL_RTL (clone, NULL_RTX);
rest_of_decl_compilation (clone, NULL, /*top_level=*/1, at_eof);
/* Make it easy to find the CLONE given the FN. */
@@ -4351,9 +4447,8 @@ clone_function_decl (fn, update_method_vec_p)
tree clone;
/* Avoid inappropriate cloning. */
- if (! flag_new_abi
- || (TREE_CHAIN (fn)
- && DECL_CLONED_FUNCTION (TREE_CHAIN (fn))))
+ if (TREE_CHAIN (fn)
+ && DECL_CLONED_FUNCTION (TREE_CHAIN (fn)))
return;
if (DECL_MAYBE_IN_CHARGE_CONSTRUCTOR_P (fn))
@@ -4376,10 +4471,16 @@ clone_function_decl (fn, update_method_vec_p)
version. We clone the deleting version first because that
means it will go second on the TYPE_METHODS list -- and that
corresponds to the correct layout order in the virtual
- function table. */
- clone = build_clone (fn, deleting_dtor_identifier);
- if (update_method_vec_p)
- add_method (DECL_CONTEXT (clone), clone, /*error_p=*/0);
+ function table.
+
+ For a non-virtual destructor, we do not build a deleting
+ destructor. */
+ if (DECL_VIRTUAL_P (fn))
+ {
+ clone = build_clone (fn, deleting_dtor_identifier);
+ if (update_method_vec_p)
+ add_method (DECL_CONTEXT (clone), clone, /*error_p=*/0);
+ }
clone = build_clone (fn, complete_dtor_identifier);
if (update_method_vec_p)
add_method (DECL_CONTEXT (clone), clone, /*error_p=*/0);
@@ -4387,6 +4488,83 @@ clone_function_decl (fn, update_method_vec_p)
if (update_method_vec_p)
add_method (DECL_CONTEXT (clone), clone, /*error_p=*/0);
}
+
+ /* Note that this is an abstract function that is never emitted. */
+ DECL_ABSTRACT (fn) = 1;
+}
+
+/* DECL is an in charge constructor, which is being defined. This will
+ have had an in class declaration, from whence clones were
+ declared. An out-of-class definition can specify additional default
+ arguments. As it is the clones that are involved in overload
+ resolution, we must propagate the information from the DECL to its
+ clones. */
+
+void
+adjust_clone_args (decl)
+ tree decl;
+{
+ tree clone;
+
+ for (clone = TREE_CHAIN (decl); clone && DECL_CLONED_FUNCTION (clone);
+ clone = TREE_CHAIN (clone))
+ {
+ tree orig_clone_parms = TYPE_ARG_TYPES (TREE_TYPE (clone));
+ tree orig_decl_parms = TYPE_ARG_TYPES (TREE_TYPE (decl));
+ tree decl_parms, clone_parms;
+
+ clone_parms = orig_clone_parms;
+
+ /* Skip the 'this' parameter. */
+ orig_clone_parms = TREE_CHAIN (orig_clone_parms);
+ orig_decl_parms = TREE_CHAIN (orig_decl_parms);
+
+ if (DECL_HAS_IN_CHARGE_PARM_P (decl))
+ orig_decl_parms = TREE_CHAIN (orig_decl_parms);
+ if (DECL_HAS_VTT_PARM_P (decl))
+ orig_decl_parms = TREE_CHAIN (orig_decl_parms);
+
+ clone_parms = orig_clone_parms;
+ if (DECL_HAS_VTT_PARM_P (clone))
+ clone_parms = TREE_CHAIN (clone_parms);
+
+ for (decl_parms = orig_decl_parms; decl_parms;
+ decl_parms = TREE_CHAIN (decl_parms),
+ clone_parms = TREE_CHAIN (clone_parms))
+ {
+ my_friendly_assert (same_type_p (TREE_TYPE (decl_parms),
+ TREE_TYPE (clone_parms)), 20010424);
+
+ if (TREE_PURPOSE (decl_parms) && !TREE_PURPOSE (clone_parms))
+ {
+ /* A default parameter has been added. Adjust the
+ clone's parameters. */
+ tree exceptions = TYPE_RAISES_EXCEPTIONS (TREE_TYPE (clone));
+ tree basetype = TYPE_METHOD_BASETYPE (TREE_TYPE (clone));
+ tree type;
+
+ clone_parms = orig_decl_parms;
+
+ if (DECL_HAS_VTT_PARM_P (clone))
+ {
+ clone_parms = tree_cons (TREE_PURPOSE (orig_clone_parms),
+ TREE_VALUE (orig_clone_parms),
+ clone_parms);
+ TREE_TYPE (clone_parms) = TREE_TYPE (orig_clone_parms);
+ }
+ type = build_cplus_method_type (basetype,
+ TREE_TYPE (TREE_TYPE (clone)),
+ clone_parms);
+ if (exceptions)
+ type = build_exception_variant (type, exceptions);
+ TREE_TYPE (clone) = type;
+
+ clone_parms = NULL_TREE;
+ break;
+ }
+ }
+ my_friendly_assert (!clone_parms, 20010424);
+ }
}
/* For each of the constructors and destructors in T, create an
@@ -4398,10 +4576,6 @@ clone_constructors_and_destructors (t)
{
tree fns;
- /* We only clone constructors and destructors under the new ABI. */
- if (!flag_new_abi)
- return;
-
/* If for some reason we don't have a CLASSTYPE_METHOD_VEC, we bail
out now. */
if (!CLASSTYPE_METHOD_VEC (t))
@@ -4500,7 +4674,7 @@ check_bases_and_members (t, empty_p)
|| TYPE_HAS_ASSIGN_REF (t));
TYPE_HAS_REAL_ASSIGN_REF (t) |= TYPE_HAS_ASSIGN_REF (t);
TYPE_HAS_COMPLEX_ASSIGN_REF (t)
- |= TYPE_HAS_ASSIGN_REF (t) || TYPE_USES_VIRTUAL_BASECLASSES (t);
+ |= TYPE_HAS_ASSIGN_REF (t) || TYPE_CONTAINS_VPTR_P (t);
/* Synthesize any needed methods. Note that methods will be synthesized
for anonymous unions; grok_x_components undoes that. */
@@ -4540,8 +4714,7 @@ create_vtable_ptr (t, empty_p, vfuns_p,
/* Loop over the virtual functions, adding them to our various
vtables. */
for (fn = TYPE_METHODS (t); fn; fn = TREE_CHAIN (fn))
- if (DECL_VINDEX (fn)
- && !(flag_new_abi && DECL_MAYBE_IN_CHARGE_DESTRUCTOR_P (fn)))
+ if (DECL_VINDEX (fn) && !DECL_MAYBE_IN_CHARGE_DESTRUCTOR_P (fn))
add_virtual_function (new_virtuals_p, overridden_virtuals_p,
vfuns_p, fn, t);
@@ -4580,7 +4753,7 @@ create_vtable_ptr (t, empty_p, vfuns_p,
t,
empty_p);
- if (flag_new_abi && CLASSTYPE_N_BASECLASSES (t))
+ if (CLASSTYPE_N_BASECLASSES (t))
/* If there were any baseclasses, they can't possibly be at
offset zero any more, because that's where the vtable
pointer is. So, converting to a base class is going to
@@ -4648,9 +4821,10 @@ fixup_inline_methods (type)
OFFSET, which is a type offset, is number of bytes. */
static void
-propagate_binfo_offsets (binfo, offset)
+propagate_binfo_offsets (binfo, offset, t)
tree binfo;
tree offset;
+ tree t;
{
int i;
tree primary_binfo;
@@ -4671,9 +4845,9 @@ propagate_binfo_offsets (binfo, offset)
{
tree base_binfo;
- /* On the first through the loop, do the primary base. Because
- the primary base need not be an immediate base, we must
- handle the primary base specially. */
+ /* On the first time through the loop, do the primary base.
+ Because the primary base need not be an immediate base, we
+ must handle the primary base specially. */
if (i == -1)
{
if (!primary_binfo)
@@ -4689,12 +4863,13 @@ propagate_binfo_offsets (binfo, offset)
continue;
}
- /* Skip virtual bases that aren't our primary base. */
+ /* Skip virtual bases that aren't our canonical primary base. */
if (TREE_VIA_VIRTUAL (base_binfo)
- && BINFO_PRIMARY_BASE_OF (base_binfo) != binfo)
+ && (BINFO_PRIMARY_BASE_OF (base_binfo) != binfo
+ || base_binfo != binfo_for_vbase (BINFO_TYPE (base_binfo), t)))
continue;
- propagate_binfo_offsets (base_binfo, offset);
+ propagate_binfo_offsets (base_binfo, offset, t);
}
}
@@ -4708,15 +4883,18 @@ dfs_set_offset_for_unshared_vbases (binfo, data)
/* If this is a virtual base, make sure it has the same offset as
the shared copy. If it's a primary base, then we know it's
correct. */
- if (TREE_VIA_VIRTUAL (binfo) && !BINFO_PRIMARY_P (binfo))
+ if (TREE_VIA_VIRTUAL (binfo))
{
tree t = (tree) data;
tree vbase;
tree offset;
vbase = binfo_for_vbase (BINFO_TYPE (binfo), t);
- offset = size_diffop (BINFO_OFFSET (vbase), BINFO_OFFSET (binfo));
- propagate_binfo_offsets (binfo, offset);
+ if (vbase != binfo)
+ {
+ offset = size_diffop (BINFO_OFFSET (vbase), BINFO_OFFSET (binfo));
+ propagate_binfo_offsets (binfo, offset, t);
+ }
}
return NULL_TREE;
@@ -4751,26 +4929,19 @@ layout_virtual_bases (t, offsets)
TYPE_ALIGN (t) = MAX (TYPE_ALIGN (t), BITS_PER_UNIT);
/* Go through the virtual bases, allocating space for each virtual
- base that is not already a primary base class. Under the new
+ base that is not already a primary base class. Under the old
ABI, these are allocated according to a depth-first left-to-right
postorder traversal; in the new ABI, inheritance graph order is
used instead. */
- for (vbases = (flag_new_abi
- ? TYPE_BINFO (t)
- : CLASSTYPE_VBASECLASSES (t));
+ for (vbases = TYPE_BINFO (t);
vbases;
vbases = TREE_CHAIN (vbases))
{
tree vbase;
- if (flag_new_abi)
- {
- if (!TREE_VIA_VIRTUAL (vbases))
- continue;
- vbase = binfo_for_vbase (BINFO_TYPE (vbases), t);
- }
- else
- vbase = TREE_VALUE (vbases);
+ if (!TREE_VIA_VIRTUAL (vbases))
+ continue;
+ vbase = binfo_for_vbase (BINFO_TYPE (vbases), t);
if (!BINFO_PRIMARY_P (vbase))
{
@@ -4781,13 +4952,7 @@ layout_virtual_bases (t, offsets)
basetype = BINFO_TYPE (vbase);
- if (flag_new_abi)
- desired_align = CLASSTYPE_ALIGN (basetype);
- else
- /* Under the old ABI, virtual bases were aligned as for the
- entire base object (including its virtual bases). That's
- wasteful, in general. */
- desired_align = TYPE_ALIGN (basetype);
+ desired_align = CLASSTYPE_ALIGN (basetype);
TYPE_ALIGN (t) = MAX (TYPE_ALIGN (t), desired_align);
/* Add padding so that we can put the virtual base class at an
@@ -4796,10 +4961,10 @@ layout_virtual_bases (t, offsets)
/* Under the new ABI, we try to squish empty virtual bases in
just like ordinary empty bases. */
- if (flag_new_abi && is_empty_class (basetype))
+ if (is_empty_class (basetype))
layout_empty_base (vbase,
size_int (CEIL (dsize, BITS_PER_UNIT)),
- offsets);
+ offsets, t);
else
{
tree offset;
@@ -4810,7 +4975,7 @@ layout_virtual_bases (t, offsets)
BINFO_OFFSET (vbase)));
/* And compute the offset of the virtual base. */
- propagate_binfo_offsets (vbase, offset);
+ propagate_binfo_offsets (vbase, offset, t);
/* Every virtual baseclass takes a least a UNIT, so that
we can take it's address and get something different
for each base. */
@@ -4838,7 +5003,7 @@ layout_virtual_bases (t, offsets)
multiple such bases at the same location. */
eoc = end_of_class (t, /*include_virtuals_p=*/1);
if (eoc * BITS_PER_UNIT > dsize)
- dsize = (eoc + 1) * BITS_PER_UNIT;
+ dsize = eoc * BITS_PER_UNIT;
/* Now, make sure that the total size of the type is a multiple of
its alignment. */
@@ -4877,6 +5042,7 @@ end_of_class (t, include_virtuals_p)
{
tree base_binfo;
tree offset;
+ tree size;
unsigned HOST_WIDE_INT end_of_base;
base_binfo = BINFO_BASETYPE (TYPE_BINFO (t), i);
@@ -4886,9 +5052,16 @@ end_of_class (t, include_virtuals_p)
&& !BINFO_PRIMARY_P (base_binfo))
continue;
+ if (is_empty_class (BINFO_TYPE (base_binfo)))
+ /* An empty class has zero CLASSTYPE_SIZE_UNIT, but we need to
+ allocate some space for it. It cannot have virtual bases,
+ so TYPE_SIZE_UNIT is fine. */
+ size = TYPE_SIZE_UNIT (BINFO_TYPE (base_binfo));
+ else
+ size = CLASSTYPE_SIZE_UNIT (BINFO_TYPE (base_binfo));
offset = size_binop (PLUS_EXPR,
BINFO_OFFSET (base_binfo),
- CLASSTYPE_SIZE_UNIT (BINFO_TYPE (base_binfo)));
+ size);
end_of_base = tree_low_cst (offset, /*pos=*/1);
if (end_of_base > result)
result = end_of_base;
@@ -4897,6 +5070,32 @@ end_of_class (t, include_virtuals_p)
return result;
}
+/* Warn about direct bases of T that are inaccessible because they are
+ ambiguous. For example:
+
+ struct S {};
+ struct T : public S {};
+ struct U : public S, public T {};
+
+ Here, `(S*) new U' is not allowed because there are two `S'
+ subobjects of U. */
+
+static void
+warn_about_ambiguous_direct_bases (t)
+ tree t;
+{
+ int i;
+
+ for (i = 0; i < CLASSTYPE_N_BASECLASSES (t); ++i)
+ {
+ tree basetype = TYPE_BINFO_BASETYPE (t, i);
+
+ if (get_base_distance (basetype, t, 0, NULL) == -2)
+ cp_warning ("direct base `%T' inaccessible in `%T' due to ambiguity",
+ basetype, t);
+ }
+}
+
/* Compare two INTEGER_CSTs K1 and K2. */
static int
@@ -4945,7 +5144,7 @@ layout_class_type (t, empty_p, vfuns_p,
/* Under the new ABI, the vptr is always the first thing in the
class. */
- if (flag_new_abi && vptr)
+ if (vptr)
{
TYPE_FIELDS (t) = chainon (vptr, TYPE_FIELDS (t));
place_field (rli, vptr);
@@ -4954,14 +5153,15 @@ layout_class_type (t, empty_p, vfuns_p,
/* Build FIELD_DECLs for all of the non-virtual base-types. */
empty_base_offsets = splay_tree_new (splay_tree_compare_integer_csts,
NULL, NULL);
- build_base_fields (rli, empty_p, empty_base_offsets);
+ if (build_base_fields (rli, empty_p, empty_base_offsets, t))
+ CLASSTYPE_NEARLY_EMPTY_P (t) = 0;
+
/* Add pointers to all of our virtual base-classes. */
TYPE_FIELDS (t) = chainon (build_vbase_pointer_fields (rli, empty_p),
TYPE_FIELDS (t));
/* CLASSTYPE_INLINE_FRIENDS is really TYPE_NONCOPIED_PARTS. Thus,
- we have to save this before we start modifying
- TYPE_NONCOPIED_PARTS. */
+ we have to save this before we zap TYPE_NONCOPIED_PARTS. */
fixup_inline_methods (t);
/* Layout the non-static data members. */
@@ -4986,12 +5186,7 @@ layout_class_type (t, empty_p, vfuns_p,
rules, but the back-end can't handle bitfields longer than a
`long long', so we use the same mechanism. */
if (DECL_C_BIT_FIELD (field)
- && ((flag_new_abi
- && INT_CST_LT (TYPE_SIZE (type), DECL_SIZE (field)))
- || (!flag_new_abi
- && 0 < compare_tree_int (DECL_SIZE (field),
- TYPE_PRECISION
- (long_long_unsigned_type_node)))))
+ && INT_CST_LT (TYPE_SIZE (type), DECL_SIZE (field)))
{
integer_type_kind itk;
tree integer_type;
@@ -5019,7 +5214,7 @@ layout_class_type (t, empty_p, vfuns_p,
padding = NULL_TREE;
layout_nonempty_base_or_field (rli, field, NULL_TREE,
- empty_base_offsets);
+ empty_base_offsets, t);
/* If we needed additional padding after this field, add it
now. */
@@ -5036,7 +5231,7 @@ layout_class_type (t, empty_p, vfuns_p,
DECL_USER_ALIGN (padding_field) = 0;
layout_nonempty_base_or_field (rli, padding_field,
NULL_TREE,
- empty_base_offsets);
+ empty_base_offsets, t);
}
}
@@ -5049,11 +5244,7 @@ layout_class_type (t, empty_p, vfuns_p,
if (TREE_CODE (rli_size_unit_so_far (rli)) == INTEGER_CST
&& compare_tree_int (rli_size_unit_so_far (rli), eoc) < 0)
{
- /* We don't handle zero-sized base classes specially under the
- old ABI, so if we get here, we had better be operating under
- the new ABI rules. */
- my_friendly_assert (flag_new_abi, 20000321);
- rli->offset = size_binop (MAX_EXPR, rli->offset, size_int (eoc + 1));
+ rli->offset = size_binop (MAX_EXPR, rli->offset, size_int (eoc));
rli->bitpos = bitsize_zero_node;
}
@@ -5062,25 +5253,14 @@ layout_class_type (t, empty_p, vfuns_p,
if it has basetypes. Therefore, we add the fake field after all
the other fields; if there are already FIELD_DECLs on the list,
their offsets will not be disturbed. */
- if (*empty_p)
+ if (!eoc && *empty_p)
{
tree padding;
padding = build_decl (FIELD_DECL, NULL_TREE, char_type_node);
place_field (rli, padding);
- TYPE_NONCOPIED_PARTS (t)
- = tree_cons (NULL_TREE, padding, TYPE_NONCOPIED_PARTS (t));
- TREE_STATIC (TYPE_NONCOPIED_PARTS (t)) = 1;
}
- /* Under the old ABI, the vptr comes at the very end of the
- class. */
- if (!flag_new_abi && vptr)
- {
- place_field (rli, vptr);
- TYPE_FIELDS (t) = chainon (TYPE_FIELDS (t), vptr);
- }
-
/* Let the back-end lay out the type. Note that at this point we
have only included non-virtual base-classes; we will lay out the
virtual base classes later. So, the TYPE_SIZE/TYPE_ALIGN after
@@ -5094,21 +5274,16 @@ layout_class_type (t, empty_p, vfuns_p,
/* Remember the size and alignment of the class before adding
the virtual bases. */
- if (*empty_p && flag_new_abi)
+ if (*empty_p)
{
CLASSTYPE_SIZE (t) = bitsize_zero_node;
CLASSTYPE_SIZE_UNIT (t) = size_zero_node;
}
- else if (flag_new_abi)
+ else
{
CLASSTYPE_SIZE (t) = TYPE_BINFO_SIZE (t);
CLASSTYPE_SIZE_UNIT (t) = TYPE_BINFO_SIZE_UNIT (t);
}
- else
- {
- CLASSTYPE_SIZE (t) = TYPE_SIZE (t);
- CLASSTYPE_SIZE_UNIT (t) = TYPE_SIZE_UNIT (t);
- }
CLASSTYPE_ALIGN (t) = TYPE_ALIGN (t);
CLASSTYPE_USER_ALIGN (t) = TYPE_USER_ALIGN (t);
@@ -5124,6 +5299,10 @@ layout_class_type (t, empty_p, vfuns_p,
base subobject fields. */
layout_virtual_bases (t, empty_base_offsets);
+ /* Warn about direct bases that can't be talked about due to
+ ambiguity. */
+ warn_about_ambiguous_direct_bases (t);
+
/* Clean up. */
splay_tree_delete (empty_base_offsets);
}
@@ -5202,29 +5381,27 @@ finish_struct_1 (t)
layout_class_type (t, &empty, &vfuns,
&new_virtuals, &overridden_virtuals);
- if (flag_dump_class_layout)
- dump_class_hierarchy (*flag_dump_class_layout
- ? flag_dump_class_layout : NULL,
- t);
-
- /* Set up the DECL_FIELD_BITPOS of the vfield if we need to, as we
- might need to know it for setting up the offsets in the vtable
- (or in thunks) below. */
+ /* Make sure that we get our own copy of the vfield FIELD_DECL. */
vfield = TYPE_VFIELD (t);
- if (vfield != NULL_TREE
- && DECL_FIELD_CONTEXT (vfield) != t)
- {
- tree binfo = get_binfo (DECL_FIELD_CONTEXT (vfield), t, 0);
-
+ if (vfield && CLASSTYPE_HAS_PRIMARY_BASE_P (t))
+ {
+ tree primary = CLASSTYPE_PRIMARY_BINFO (t);
+
+ my_friendly_assert (same_type_p (DECL_FIELD_CONTEXT (vfield),
+ BINFO_TYPE (primary)),
+ 20010726);
+ /* The vtable better be at the start. */
+ my_friendly_assert (integer_zerop (DECL_FIELD_OFFSET (vfield)),
+ 20010726);
+ my_friendly_assert (integer_zerop (BINFO_OFFSET (primary)),
+ 20010726);
+
vfield = copy_decl (vfield);
-
DECL_FIELD_CONTEXT (vfield) = t;
- DECL_FIELD_OFFSET (vfield)
- = size_binop (PLUS_EXPR,
- BINFO_OFFSET (binfo),
- DECL_FIELD_OFFSET (vfield));
TYPE_VFIELD (t) = vfield;
}
+ else
+ my_friendly_assert (!vfield || DECL_FIELD_CONTEXT (vfield) == t, 20010726);
overridden_virtuals
= modify_all_vtables (t, &vfuns, nreverse (overridden_virtuals));
@@ -5294,14 +5471,9 @@ finish_struct_1 (t)
/* Complete the rtl for any static member objects of the type we're
working on. */
for (x = TYPE_FIELDS (t); x; x = TREE_CHAIN (x))
- {
- if (TREE_CODE (x) == VAR_DECL && TREE_STATIC (x)
- && TREE_TYPE (x) == t)
- {
- DECL_MODE (x) = TYPE_MODE (t);
- make_decl_rtl (x, NULL);
- }
- }
+ if (TREE_CODE (x) == VAR_DECL && TREE_STATIC (x)
+ && TREE_TYPE (x) == t)
+ DECL_MODE (x) = TYPE_MODE (t);
/* Done with FIELDS...now decide whether to sort these for
faster lookups later.
@@ -5345,20 +5517,9 @@ finish_struct_1 (t)
/* Build the VTT for T. */
build_vtt (t);
- if (TYPE_VFIELD (t))
- {
- /* In addition to this one, all the other vfields should be listed. */
- /* Before that can be done, we have to have FIELD_DECLs for them, and
- a place to find them. */
- TYPE_NONCOPIED_PARTS (t)
- = tree_cons (default_conversion (TYPE_BINFO_VTABLE (t)),
- TYPE_VFIELD (t), TYPE_NONCOPIED_PARTS (t));
-
- if (warn_nonvdtor && TYPE_HAS_DESTRUCTOR (t)
- && DECL_VINDEX (TREE_VEC_ELT (CLASSTYPE_METHOD_VEC (t), 1)) == NULL_TREE)
- cp_warning ("`%#T' has virtual functions but non-virtual destructor",
- t);
- }
+ if (warn_nonvdtor && TYPE_POLYMORPHIC_P (t) && TYPE_HAS_DESTRUCTOR (t)
+ && DECL_VINDEX (TREE_VEC_ELT (CLASSTYPE_METHOD_VEC (t), 1)) == NULL_TREE)
+ cp_warning ("`%#T' has virtual functions but non-virtual destructor", t);
hack_incomplete_structures (t);
@@ -5367,6 +5528,8 @@ finish_struct_1 (t)
maybe_suppress_debug_info (t);
+ dump_class_hierarchy (t);
+
/* Finish debugging output for this type. */
rest_of_type_compilation (t, ! LOCAL_CLASS_P (t));
}
@@ -5461,9 +5624,10 @@ finish_struct (t, attributes)
before this function is called. */
static tree
-fixed_type_or_null (instance, nonnull)
+fixed_type_or_null (instance, nonnull, cdtorp)
tree instance;
int *nonnull;
+ int *cdtorp;
{
switch (TREE_CODE (instance))
{
@@ -5491,31 +5655,31 @@ fixed_type_or_null (instance, nonnull)
*nonnull = 1;
return TREE_TYPE (instance);
}
- return fixed_type_or_null (TREE_OPERAND (instance, 0), nonnull);
+ return fixed_type_or_null (TREE_OPERAND (instance, 0), nonnull, cdtorp);
case RTL_EXPR:
return NULL_TREE;
case PLUS_EXPR:
case MINUS_EXPR:
+ if (TREE_CODE (TREE_OPERAND (instance, 0)) == ADDR_EXPR)
+ return fixed_type_or_null (TREE_OPERAND (instance, 0), nonnull, cdtorp);
if (TREE_CODE (TREE_OPERAND (instance, 1)) == INTEGER_CST)
/* Propagate nonnull. */
- fixed_type_or_null (TREE_OPERAND (instance, 0), nonnull);
- if (TREE_CODE (TREE_OPERAND (instance, 0)) == ADDR_EXPR)
- return fixed_type_or_null (TREE_OPERAND (instance, 0), nonnull);
+ fixed_type_or_null (TREE_OPERAND (instance, 0), nonnull, cdtorp);
return NULL_TREE;
case NOP_EXPR:
case CONVERT_EXPR:
- return fixed_type_or_null (TREE_OPERAND (instance, 0), nonnull);
+ return fixed_type_or_null (TREE_OPERAND (instance, 0), nonnull, cdtorp);
case ADDR_EXPR:
if (nonnull)
*nonnull = 1;
- return fixed_type_or_null (TREE_OPERAND (instance, 0), nonnull);
+ return fixed_type_or_null (TREE_OPERAND (instance, 0), nonnull, cdtorp);
case COMPONENT_REF:
- return fixed_type_or_null (TREE_OPERAND (instance, 1), nonnull);
+ return fixed_type_or_null (TREE_OPERAND (instance, 1), nonnull, cdtorp);
case VAR_DECL:
case FIELD_DECL:
@@ -5535,21 +5699,25 @@ fixed_type_or_null (instance, nonnull)
*nonnull = 1;
return TREE_TYPE (instance);
}
- else if (nonnull)
- {
- if (instance == current_class_ptr
- && flag_this_is_variable <= 0)
- {
- /* Normally, 'this' must be non-null. */
- if (flag_this_is_variable == 0)
- *nonnull = 1;
-
- /* <0 means we're in a constructor and we know our type. */
- if (flag_this_is_variable < 0)
- return TREE_TYPE (TREE_TYPE (instance));
- }
- else if (TREE_CODE (TREE_TYPE (instance)) == REFERENCE_TYPE)
- /* Reference variables should be references to objects. */
+ else if (instance == current_class_ptr)
+ {
+ if (nonnull)
+ *nonnull = 1;
+
+ /* if we're in a ctor or dtor, we know our type. */
+ if (DECL_LANG_SPECIFIC (current_function_decl)
+ && (DECL_CONSTRUCTOR_P (current_function_decl)
+ || DECL_DESTRUCTOR_P (current_function_decl)))
+ {
+ if (cdtorp)
+ *cdtorp = 1;
+ return TREE_TYPE (TREE_TYPE (instance));
+ }
+ }
+ else if (TREE_CODE (TREE_TYPE (instance)) == REFERENCE_TYPE)
+ {
+ /* Reference variables should be references to objects. */
+ if (nonnull)
*nonnull = 1;
}
return NULL_TREE;
@@ -5561,7 +5729,9 @@ fixed_type_or_null (instance, nonnull)
/* Return non-zero if the dynamic type of INSTANCE is known, and equivalent
to the static type. We also handle the case where INSTANCE is really
- a pointer.
+ a pointer. Return negative if this is a ctor/dtor. There the dynamic type
+ is known, but this might not be the most derived base of the original object,
+ and hence virtual bases may not be layed out according to this type.
Used to determine whether the virtual function table is needed
or not.
@@ -5576,12 +5746,16 @@ resolves_to_fixed_type_p (instance, nonnull)
int *nonnull;
{
tree t = TREE_TYPE (instance);
- tree fixed = fixed_type_or_null (instance, nonnull);
+ int cdtorp = 0;
+
+ tree fixed = fixed_type_or_null (instance, nonnull, &cdtorp);
if (fixed == NULL_TREE)
return 0;
if (POINTER_TYPE_P (t))
t = TREE_TYPE (t);
- return same_type_ignoring_top_level_qualifiers_p (t, fixed);
+ if (!same_type_ignoring_top_level_qualifiers_p (t, fixed))
+ return 0;
+ return cdtorp ? -1 : 1;
}
@@ -6493,23 +6667,13 @@ int
is_empty_class (type)
tree type;
{
- tree t;
-
if (type == error_mark_node)
return 0;
if (! IS_AGGR_TYPE (type))
return 0;
- if (flag_new_abi)
- return integer_zerop (CLASSTYPE_SIZE (type));
-
- if (TYPE_BINFO_BASETYPES (type))
- return 0;
- t = TYPE_FIELDS (type);
- while (t && TREE_CODE (t) != FIELD_DECL)
- t = TREE_CHAIN (t);
- return (t == NULL_TREE);
+ return integer_zerop (CLASSTYPE_SIZE (type));
}
/* Find the enclosing class of the given NODE. NODE can be a *_DECL or
@@ -6642,36 +6806,43 @@ get_vtbl_decl_for_binfo (binfo)
return decl;
}
-/* Called from get_primary_binfo via dfs_walk. */
+/* Called from get_primary_binfo via dfs_walk. DATA is a TREE_LIST
+ who's TREE_PURPOSE is the TYPE of the required primary base and
+ who's TREE_VALUE is a list of candidate binfos that we fill in. */
static tree
dfs_get_primary_binfo (binfo, data)
tree binfo;
void *data;
{
- tree primary_base = (tree) data;
+ tree cons = (tree) data;
+ tree primary_base = TREE_PURPOSE (cons);
if (TREE_VIA_VIRTUAL (binfo)
- && same_type_p (BINFO_TYPE (binfo), BINFO_TYPE (primary_base)))
- return binfo;
+ && same_type_p (BINFO_TYPE (binfo), primary_base))
+ /* This is the right type of binfo, but it might be an unshared
+ instance, and the shared instance is later in the dfs walk. We
+ must keep looking. */
+ TREE_VALUE (cons) = tree_cons (NULL, binfo, TREE_VALUE (cons));
return NULL_TREE;
}
-/* Returns the binfo for the primary base of BINFO. Note that in a
- complex hierarchy the resulting BINFO may not actually *be*
- primary. In particular if the resulting BINFO is a virtual base,
- and it occurs elsewhere in the hierarchy, then this occurrence may
- not actually be a primary base in the complete object. Check
- BINFO_PRIMARY_P to be sure. */
+/* Returns the unshared binfo for the primary base of BINFO. Note
+ that in a complex hierarchy the resulting BINFO may not actually
+ *be* primary. In particular if the resulting BINFO is a virtual
+ base, and it occurs elsewhere in the hierarchy, then this
+ occurrence may not actually be a primary base in the complete
+ object. Check BINFO_PRIMARY_P to be sure. */
tree
get_primary_binfo (binfo)
tree binfo;
{
tree primary_base;
- tree result;
-
+ tree result = NULL_TREE;
+ tree virtuals;
+
primary_base = CLASSTYPE_PRIMARY_BINFO (BINFO_TYPE (binfo));
if (!primary_base)
return NULL_TREE;
@@ -6699,28 +6870,83 @@ get_primary_binfo (binfo)
/* For a primary virtual base, we have to scan the entire hierarchy
rooted at BINFO; the virtual base could be an indirect virtual
- base. */
- result = dfs_walk (binfo, dfs_get_primary_binfo, NULL, primary_base);
- my_friendly_assert (result != NULL_TREE, 20000730);
+ base. There could be more than one instance of the primary base
+ in the hierarchy, and if one is the canonical binfo we want that
+ one. If it exists, it should be the first one we find, but as a
+ consistency check we find them all and make sure. */
+ virtuals = build_tree_list (BINFO_TYPE (primary_base), NULL_TREE);
+ dfs_walk (binfo, dfs_get_primary_binfo, NULL, virtuals);
+ virtuals = TREE_VALUE (virtuals);
+
+ /* We must have found at least one instance. */
+ my_friendly_assert (virtuals, 20010612);
+
+ if (TREE_CHAIN (virtuals))
+ {
+ /* We found more than one instance of the base. We must make
+ sure that, if one is the canonical one, it is the first one
+ we found. As the chain is in reverse dfs order, that means
+ the last on the list. */
+ tree complete_binfo;
+ tree canonical;
+
+ for (complete_binfo = binfo;
+ BINFO_INHERITANCE_CHAIN (complete_binfo);
+ complete_binfo = BINFO_INHERITANCE_CHAIN (complete_binfo))
+ continue;
+ canonical = binfo_for_vbase (BINFO_TYPE (primary_base),
+ BINFO_TYPE (complete_binfo));
+
+ for (; virtuals; virtuals = TREE_CHAIN (virtuals))
+ {
+ result = TREE_VALUE (virtuals);
+
+ if (canonical == result)
+ {
+ /* This is the unshared instance. Make sure it was the
+ first one found. */
+ my_friendly_assert (!TREE_CHAIN (virtuals), 20010612);
+ break;
+ }
+ }
+ }
+ else
+ result = TREE_VALUE (virtuals);
return result;
}
+/* If INDENTED_P is zero, indent to INDENT. Return non-zero. */
+
+static int
+maybe_indent_hierarchy (stream, indent, indented_p)
+ FILE *stream;
+ int indent;
+ int indented_p;
+{
+ if (!indented_p)
+ fprintf (stream, "%*s", indent, "");
+ return 1;
+}
+
/* Dump the offsets of all the bases rooted at BINFO (in the hierarchy
dominated by T) to stderr. INDENT should be zero when called from
the top level; it is incremented recursively. */
static void
-dump_class_hierarchy_r (stream, t, binfo, indent)
+dump_class_hierarchy_r (stream, flags, t, binfo, indent)
FILE *stream;
+ int flags;
tree t;
tree binfo;
int indent;
{
int i;
-
- fprintf (stream, "%*s0x%lx (%s) ", indent, "",
- (unsigned long) binfo,
- type_as_string (binfo, TFF_PLAIN_IDENTIFIER));
+ int indented = 0;
+
+ indented = maybe_indent_hierarchy (stream, indent, 0);
+ fprintf (stream, "%s (0x%lx) ",
+ type_as_string (binfo, TFF_PLAIN_IDENTIFIER),
+ (unsigned long) binfo);
fprintf (stream, HOST_WIDE_INT_PRINT_DEC,
tree_low_cst (BINFO_OFFSET (binfo), 0));
if (is_empty_class (BINFO_TYPE (binfo)))
@@ -6730,48 +6956,174 @@ dump_class_hierarchy_r (stream, t, binfo, indent)
if (TREE_VIA_VIRTUAL (binfo))
{
tree canonical = binfo_for_vbase (BINFO_TYPE (binfo), t);
-
+
+ fprintf (stream, " virtual");
if (canonical == binfo)
- fprintf (stream, " virtual-canonical");
+ fprintf (stream, " canonical");
else
- fprintf (stream, " virtual-non-canonical");
+ fprintf (stream, " non-canonical");
}
- if (BINFO_PRIMARY_P (binfo))
- fprintf (stream, " primary-for 0x%lx (%s)",
- (unsigned long)BINFO_PRIMARY_BASE_OF (binfo),
- type_as_string (BINFO_PRIMARY_BASE_OF (binfo), TFF_PLAIN_IDENTIFIER));
- if (BINFO_LOST_PRIMARY_P (binfo))
- fprintf (stream, " lost-primary");
fprintf (stream, "\n");
+ indented = 0;
+ if (BINFO_PRIMARY_BASE_OF (binfo))
+ {
+ indented = maybe_indent_hierarchy (stream, indent + 3, indented);
+ fprintf (stream, " primary-for %s (0x%lx)",
+ type_as_string (BINFO_PRIMARY_BASE_OF (binfo),
+ TFF_PLAIN_IDENTIFIER),
+ (unsigned long)BINFO_PRIMARY_BASE_OF (binfo));
+ }
+ if (BINFO_LOST_PRIMARY_P (binfo))
+ {
+ indented = maybe_indent_hierarchy (stream, indent + 3, indented);
+ fprintf (stream, " lost-primary");
+ }
+ if (indented)
+ fprintf (stream, "\n");
+
+ if (!(flags & TDF_SLIM))
+ {
+ int indented = 0;
+
+ if (BINFO_SUBVTT_INDEX (binfo))
+ {
+ indented = maybe_indent_hierarchy (stream, indent + 3, indented);
+ fprintf (stream, " subvttidx=%s",
+ expr_as_string (BINFO_SUBVTT_INDEX (binfo),
+ TFF_PLAIN_IDENTIFIER));
+ }
+ if (BINFO_VPTR_INDEX (binfo))
+ {
+ indented = maybe_indent_hierarchy (stream, indent + 3, indented);
+ fprintf (stream, " vptridx=%s",
+ expr_as_string (BINFO_VPTR_INDEX (binfo),
+ TFF_PLAIN_IDENTIFIER));
+ }
+ if (BINFO_VPTR_FIELD (binfo))
+ {
+ indented = maybe_indent_hierarchy (stream, indent + 3, indented);
+ fprintf (stream, " vbaseoffset=%s",
+ expr_as_string (BINFO_VPTR_FIELD (binfo),
+ TFF_PLAIN_IDENTIFIER));
+ }
+ if (BINFO_VTABLE (binfo))
+ {
+ indented = maybe_indent_hierarchy (stream, indent + 3, indented);
+ fprintf (stream, " vptr=%s",
+ expr_as_string (BINFO_VTABLE (binfo),
+ TFF_PLAIN_IDENTIFIER));
+ }
+
+ if (indented)
+ fprintf (stream, "\n");
+ }
+
+
for (i = 0; i < BINFO_N_BASETYPES (binfo); ++i)
- dump_class_hierarchy_r (stream, t, BINFO_BASETYPE (binfo, i), indent + 2);
+ dump_class_hierarchy_r (stream, flags,
+ t, BINFO_BASETYPE (binfo, i),
+ indent + 2);
}
/* Dump the BINFO hierarchy for T. */
-void
-dump_class_hierarchy (name, t)
- const char *name;
+static void
+dump_class_hierarchy (t)
tree t;
{
- FILE *stream = stderr;
+ int flags;
+ FILE *stream = dump_begin (TDI_class, &flags);
+
+ if (!stream)
+ return;
- if (name)
+ fprintf (stream, "Class %s\n", type_as_string (t, TFF_PLAIN_IDENTIFIER));
+ fprintf (stream, " size=%lu align=%lu\n",
+ (unsigned long)(tree_low_cst (TYPE_SIZE (t), 0) / BITS_PER_UNIT),
+ (unsigned long)(TYPE_ALIGN (t) / BITS_PER_UNIT));
+ dump_class_hierarchy_r (stream, flags, t, TYPE_BINFO (t), 0);
+ fprintf (stream, "\n");
+ dump_end (TDI_class, stream);
+}
+
+static void
+dump_array (stream, decl)
+ FILE *stream;
+ tree decl;
+{
+ tree inits;
+ int ix;
+ HOST_WIDE_INT elt;
+ tree size = TYPE_MAX_VALUE (TYPE_DOMAIN (TREE_TYPE (decl)));
+
+ elt = (tree_low_cst (TYPE_SIZE (TREE_TYPE (TREE_TYPE (decl))), 0)
+ / BITS_PER_UNIT);
+ fprintf (stream, "%s:", decl_as_string (decl, TFF_PLAIN_IDENTIFIER));
+ fprintf (stream, " %s entries",
+ expr_as_string (size_binop (PLUS_EXPR, size, size_one_node),
+ TFF_PLAIN_IDENTIFIER));
+ fprintf (stream, "\n");
+
+ for (ix = 0, inits = TREE_OPERAND (DECL_INITIAL (decl), 1);
+ inits; ix++, inits = TREE_CHAIN (inits))
+ fprintf (stream, "%-4d %s\n", ix * elt,
+ expr_as_string (TREE_VALUE (inits), TFF_PLAIN_IDENTIFIER));
+}
+
+static void
+dump_vtable (t, binfo, vtable)
+ tree t;
+ tree binfo;
+ tree vtable;
+{
+ int flags;
+ FILE *stream = dump_begin (TDI_class, &flags);
+
+ if (!stream)
+ return;
+
+ if (!(flags & TDF_SLIM))
{
- static int append = 0;
+ int ctor_vtbl_p = TYPE_BINFO (t) != binfo;
- stream = fopen (name, append++ ? "a" : "w");
- if (!stream)
- error ("could not open dump file `%s'", name);
- return;
+ fprintf (stream, "%s for %s",
+ ctor_vtbl_p ? "Construction vtable" : "Vtable",
+ type_as_string (binfo, TFF_PLAIN_IDENTIFIER));
+ if (ctor_vtbl_p)
+ {
+ if (!TREE_VIA_VIRTUAL (binfo))
+ fprintf (stream, " (0x%lx instance)", (unsigned long)binfo);
+ fprintf (stream, " in %s", type_as_string (t, TFF_PLAIN_IDENTIFIER));
+ }
+ fprintf (stream, "\n");
+ dump_array (stream, vtable);
+ fprintf (stream, "\n");
}
- fprintf (stream, "%s\n",
- type_as_string (t, TFF_PLAIN_IDENTIFIER));
- dump_class_hierarchy_r (stream, t, TYPE_BINFO (t), 0);
- fprintf (stream, "\n");
- if (name)
- fclose (stream);
+
+ dump_end (TDI_class, stream);
+}
+
+static void
+dump_vtt (t, vtt)
+ tree t;
+ tree vtt;
+{
+ int flags;
+ FILE *stream = dump_begin (TDI_class, &flags);
+
+ if (!stream)
+ return;
+
+ if (!(flags & TDF_SLIM))
+ {
+ fprintf (stream, "VTT for %s\n",
+ type_as_string (t, TFF_PLAIN_IDENTIFIER));
+ dump_array (stream, vtt);
+ fprintf (stream, "\n");
+ }
+
+ dump_end (TDI_class, stream);
}
/* Virtual function table initialization. */
@@ -6786,6 +7138,7 @@ finish_vtbls (t)
{
tree list;
tree vbase;
+ int i;
/* Under the new ABI, we lay out the primary and secondary
vtables in one contiguous vtable. The primary vtable is
@@ -6811,6 +7164,18 @@ finish_vtbls (t)
TYPE_BINFO (t), t, list);
}
+ /* Fill in BINFO_VPTR_FIELD in the immediate binfos for our virtual
+ base classes, for the benefit of the debugging backends. */
+ for (i = 0; i < BINFO_N_BASETYPES (TYPE_BINFO (t)); ++i)
+ {
+ tree base = BINFO_BASETYPE (TYPE_BINFO (t), i);
+ if (TREE_VIA_VIRTUAL (base))
+ {
+ tree vbase = binfo_for_vbase (BINFO_TYPE (base), t);
+ BINFO_VPTR_FIELD (base) = BINFO_VPTR_FIELD (vbase);
+ }
+ }
+
if (TYPE_BINFO_VTABLE (t))
initialize_vtable (TYPE_BINFO (t), TREE_VALUE (list));
}
@@ -6854,6 +7219,7 @@ initialize_vtable (binfo, inits)
layout_vtable_decl (binfo, list_length (inits));
decl = get_vtbl_decl_for_binfo (binfo);
initialize_array (decl, inits);
+ dump_vtable (BINFO_TYPE (binfo), binfo, decl);
}
/* Initialize DECL (a declaration for a namespace-scope array) with
@@ -6894,10 +7260,6 @@ build_vtt (t)
tree vtt;
tree index;
- /* Under the old ABI, we don't use VTTs. */
- if (!flag_new_abi)
- return;
-
/* Build up the initializers for the VTT. */
inits = NULL_TREE;
index = size_zero_node;
@@ -6908,41 +7270,67 @@ build_vtt (t)
return;
/* Figure out the type of the VTT. */
- type = build_index_type (size_int (list_length (inits)));
+ type = build_index_type (size_int (list_length (inits) - 1));
type = build_cplus_array_type (const_ptr_type_node, type);
/* Now, build the VTT object itself. */
vtt = build_vtable (t, get_vtt_name (t), type);
pushdecl_top_level (vtt);
initialize_array (vtt, inits);
+
+ dump_vtt (t, vtt);
}
-/* The type corresponding to BINFO is a base class of T, but BINFO is
- in the base class hierarchy of a class derived from T. Return the
- base, in T's hierarchy, that corresponds to BINFO. */
+/* The type corresponding to BASE_BINFO is a base of the type of BINFO, but
+ from within some heirarchy which is inherited from the type of BINFO.
+ Return BASE_BINFO's equivalent binfo from the hierarchy dominated by
+ BINFO. */
static tree
-get_matching_base (binfo, t)
+get_original_base (base_binfo, binfo)
+ tree base_binfo;
tree binfo;
- tree t;
{
tree derived;
- int i;
-
- if (same_type_p (BINFO_TYPE (binfo), t))
+ int ix;
+
+ if (same_type_p (BINFO_TYPE (base_binfo), BINFO_TYPE (binfo)))
return binfo;
+ if (TREE_VIA_VIRTUAL (base_binfo))
+ return binfo_for_vbase (BINFO_TYPE (base_binfo), BINFO_TYPE (binfo));
+ derived = get_original_base (BINFO_INHERITANCE_CHAIN (base_binfo), binfo);
+
+ for (ix = 0; ix != BINFO_N_BASETYPES (derived); ix++)
+ if (same_type_p (BINFO_TYPE (base_binfo),
+ BINFO_TYPE (BINFO_BASETYPE (derived, ix))))
+ return BINFO_BASETYPE (derived, ix);
+ my_friendly_abort (20010223);
+ return NULL;
+}
- if (TREE_VIA_VIRTUAL (binfo))
- return binfo_for_vbase (BINFO_TYPE (binfo), t);
+/* When building a secondary VTT, BINFO_VTABLE is set to a TREE_LIST with
+ PURPOSE the RTTI_BINFO, VALUE the real vtable pointer for this binfo,
+ and CHAIN the vtable pointer for this binfo after construction is
+ complete. VALUE can also be another BINFO, in which case we recurse. */
- derived = get_matching_base (BINFO_INHERITANCE_CHAIN (binfo), t);
- for (i = 0; i < BINFO_N_BASETYPES (derived); ++i)
- if (same_type_p (BINFO_TYPE (BINFO_BASETYPE (derived, i)),
- BINFO_TYPE (binfo)))
- return BINFO_BASETYPE (derived, i);
+static tree
+binfo_ctor_vtable (binfo)
+ tree binfo;
+{
+ tree vt;
- my_friendly_abort (20000628);
- return NULL_TREE;
+ while (1)
+ {
+ vt = BINFO_VTABLE (binfo);
+ if (TREE_CODE (vt) == TREE_LIST)
+ vt = TREE_VALUE (vt);
+ if (TREE_CODE (vt) == TREE_VEC)
+ binfo = vt;
+ else
+ break;
+ }
+
+ return vt;
}
/* Recursively build the VTT-initializer for BINFO (which is in the
@@ -6981,9 +7369,7 @@ build_vtt_inits (binfo, t, inits, index)
}
/* Add the address of the primary vtable for the complete object. */
- init = BINFO_VTABLE (binfo);
- if (TREE_CODE (init) == TREE_LIST)
- init = TREE_VALUE (init);
+ init = binfo_ctor_vtable (binfo);
*inits = build_tree_list (NULL_TREE, init);
inits = &TREE_CHAIN (*inits);
if (top_level_p)
@@ -7120,33 +7506,26 @@ dfs_build_secondary_vptr_vtt_inits (binfo, data)
while (BINFO_PRIMARY_BASE_OF (binfo))
binfo = BINFO_PRIMARY_BASE_OF (binfo);
}
- init = BINFO_VTABLE (binfo);
- if (TREE_CODE (init) == TREE_LIST)
- init = TREE_VALUE (init);
+ init = binfo_ctor_vtable (binfo);
TREE_VALUE (l) = tree_cons (NULL_TREE, init, TREE_VALUE (l));
return NULL_TREE;
}
/* dfs_walk_real predicate for building vtables. DATA is a TREE_LIST,
- TREE_UNSIGNED indicates that a constructor vtable is being built.
- TREE_USED indicates whether marked or unmarked bases should be walked.
- TREE_PURPOSE is the TREE_TYPE that dominates the hierarchy. */
+ VTT_MARKED_BINFO_P indicates whether marked or unmarked bases
+ should be walked. TREE_PURPOSE is the TREE_TYPE that dominates the
+ hierarchy. */
static tree
dfs_ctor_vtable_bases_queue_p (binfo, data)
tree binfo;
void *data;
{
- if (TREE_VIA_VIRTUAL (binfo) && !BINFO_PRIMARY_P (binfo))
- {
- tree type = TREE_PURPOSE ((tree) data);
+ if (TREE_VIA_VIRTUAL (binfo))
+ /* Get the shared version. */
+ binfo = binfo_for_vbase (BINFO_TYPE (binfo), TREE_PURPOSE ((tree) data));
- /* This is a non-primary virtual base, get the shared version. */
- binfo = binfo_for_vbase (BINFO_TYPE (binfo), type);
- if (VTT_TOP_LEVEL_P ((tree) data) && BINFO_PRIMARY_P (binfo))
- return NULL_TREE;
- }
if (!BINFO_MARKED (binfo) == VTT_MARKED_BINFO_P ((tree) data))
return NULL_TREE;
return binfo;
@@ -7170,7 +7549,8 @@ dfs_fixup_binfo_vtbls (binfo, data)
/* If we scribbled the construction vtable vptr into BINFO, clear it
out now. */
- if (TREE_CODE (BINFO_VTABLE (binfo)) == TREE_LIST
+ if (BINFO_VTABLE (binfo)
+ && TREE_CODE (BINFO_VTABLE (binfo)) == TREE_LIST
&& (TREE_PURPOSE (BINFO_VTABLE (binfo))
== TREE_VALUE ((tree) data)))
BINFO_VTABLE (binfo) = TREE_CHAIN (BINFO_VTABLE (binfo));
@@ -7193,11 +7573,8 @@ build_ctor_vtbl_group (binfo, t)
tree id;
tree vbase;
- /* See if we've already create this construction vtable group. */
- if (flag_new_abi)
- id = mangle_ctor_vtbl_for_type (t, binfo);
- else
- id = get_ctor_vtbl_name (t, binfo);
+ /* See if we've already created this construction vtable group. */
+ id = mangle_ctor_vtbl_for_type (t, binfo);
if (IDENTIFIER_GLOBAL_VALUE (id))
return;
@@ -7229,13 +7606,14 @@ build_ctor_vtbl_group (binfo, t)
inits = TREE_VALUE (list);
/* Figure out the type of the construction vtable. */
- type = build_index_type (size_int (list_length (inits)));
+ type = build_index_type (size_int (list_length (inits) - 1));
type = build_cplus_array_type (vtable_entry_type, type);
TREE_TYPE (vtbl) = type;
/* Initialize the construction vtable. */
pushdecl_top_level (vtbl);
initialize_array (vtbl, inits);
+ dump_vtable (t, binfo, vtbl);
}
/* Add the vtbl initializers for BINFO (and its bases other than
@@ -7263,6 +7641,10 @@ accumulate_vtbl_inits (binfo, orig_binfo, rtti_binfo, t, inits)
BINFO_TYPE (orig_binfo)),
20000517);
+ /* If it doesn't have a vptr, we don't do anything. */
+ if (!TYPE_CONTAINS_VPTR_P (BINFO_TYPE (binfo)))
+ return;
+
/* If we're building a construction vtable, we're not interested in
subobjects that don't require construction vtables. */
if (ctor_vtbl_p
@@ -7314,49 +7696,56 @@ dfs_accumulate_vtbl_inits (binfo, orig_binfo, rtti_binfo, t, l)
if (ctor_vtbl_p
&& TREE_VIA_VIRTUAL (orig_binfo) && BINFO_PRIMARY_P (orig_binfo))
{
- /* In the hierarchy of BINFO_TYPE (RTTI_BINFO), this is a primary
- virtual base. If it is not the same primary in the hierarchy of T,
- we'll need to generate a ctor vtable for it, to place at its
- location in T. If it is the same primary, we still need a VTT
- entry for the vtable, but that must be the base it is a
- primary for within the sub-hierarchy of RTTI_BINFO. */
- tree parent;
- tree best_primary = NULL;
- tree primary_for;
-
- my_friendly_assert (BINFO_PRIMARY_P (binfo), 20010131);
+ /* In the hierarchy of BINFO_TYPE (RTTI_BINFO), this is a
+ primary virtual base. If it is not the same primary in
+ the hierarchy of T, we'll need to generate a ctor vtable
+ for it, to place at its location in T. If it is the same
+ primary, we still need a VTT entry for the vtable, but it
+ should point to the ctor vtable for the base it is a
+ primary for within the sub-hierarchy of RTTI_BINFO.
+
+ There are three possible cases:
+
+ 1) We are in the same place.
+ 2) We are a primary base within a lost primary virtual base of
+ RTTI_BINFO.
+ 3) We are primary to something not a base of RTTI_BINFO. */
+
+ tree b = BINFO_PRIMARY_BASE_OF (binfo);
+ tree last = NULL_TREE;
- for (primary_for = BINFO_PRIMARY_BASE_OF (binfo);
- primary_for;
- primary_for = BINFO_PRIMARY_BASE_OF (primary_for))
- {
- for (parent = primary_for;
- parent;
- parent = BINFO_INHERITANCE_CHAIN (parent))
- {
- if (parent == rtti_binfo)
- {
- best_primary = primary_for;
- break;
- }
- }
- if (!parent)
- break;
- }
- if (best_primary)
- {
- vtbl = BINFO_VTABLE (best_primary);
- if (TREE_CODE (vtbl) == TREE_LIST)
- {
- my_friendly_assert (TREE_PURPOSE (vtbl) == rtti_binfo,
- 20010126);
- vtbl = TREE_VALUE (vtbl);
- }
- }
+ /* First, look through the bases we are primary to for RTTI_BINFO
+ or a virtual base. */
+ for (; b; b = BINFO_PRIMARY_BASE_OF (b))
+ {
+ last = b;
+ if (TREE_VIA_VIRTUAL (b) || b == rtti_binfo)
+ break;
+ }
+ /* If we run out of primary links, keep looking down our
+ inheritance chain; we might be an indirect primary. */
+ if (b == NULL_TREE)
+ for (b = last; b; b = BINFO_INHERITANCE_CHAIN (b))
+ if (TREE_VIA_VIRTUAL (b) || b == rtti_binfo)
+ break;
+
+ /* If we found RTTI_BINFO, this is case 1. If we found a virtual
+ base B and it is a base of RTTI_BINFO, this is case 2. In
+ either case, we share our vtable with LAST, i.e. the
+ derived-most base within B of which we are a primary. */
+ if (b == rtti_binfo
+ || (b && binfo_for_vbase (BINFO_TYPE (b),
+ BINFO_TYPE (rtti_binfo))))
+ /* Just set our BINFO_VTABLE to point to LAST, as we may not have
+ set LAST's BINFO_VTABLE yet. We'll extract the actual vptr in
+ binfo_ctor_vtable after everything's been set up. */
+ vtbl = last;
+
+ /* Otherwise, this is case 3 and we get our own. */
}
else if (!BINFO_NEW_VTABLE_MARKED (orig_binfo, BINFO_TYPE (rtti_binfo)))
return inits;
-
+
if (!vtbl)
{
tree index;
@@ -7381,18 +7770,16 @@ dfs_accumulate_vtbl_inits (binfo, orig_binfo, rtti_binfo, t, l)
TREE_CONSTANT (vtbl) = 1;
}
- if (!ctor_vtbl_p)
- {
- /* For an ordinary vtable, set BINFO_VTABLE. */
- BINFO_VTABLE (binfo) = vtbl;
- if (BINFO_PRIMARY_P (binfo) && TREE_VIA_VIRTUAL (binfo))
- inits = NULL_TREE;
- }
- else
+ if (ctor_vtbl_p)
/* For a construction vtable, we can't overwrite BINFO_VTABLE.
So, we make a TREE_LIST. Later, dfs_fixup_binfo_vtbls will
straighten this out. */
BINFO_VTABLE (binfo) = tree_cons (rtti_binfo, vtbl, BINFO_VTABLE (binfo));
+ else if (BINFO_PRIMARY_P (binfo) && TREE_VIA_VIRTUAL (binfo))
+ inits = NULL_TREE;
+ else
+ /* For an ordinary vtable, set BINFO_VTABLE. */
+ BINFO_VTABLE (binfo) = vtbl;
return inits;
}
@@ -7428,7 +7815,7 @@ build_vtbl_initializer (binfo, orig_binfo, t, rtti_binfo, non_fn_entries_p)
tree rtti_binfo;
int *non_fn_entries_p;
{
- tree v;
+ tree v, b;
tree vfun_inits;
tree vbase;
vtbl_init_data vid;
@@ -7437,6 +7824,7 @@ build_vtbl_initializer (binfo, orig_binfo, t, rtti_binfo, non_fn_entries_p)
memset (&vid, 0, sizeof (vid));
vid.binfo = binfo;
vid.derived = t;
+ vid.rtti_binfo = rtti_binfo;
vid.last_init = &vid.inits;
vid.primary_vtbl_p = (binfo == TYPE_BINFO (t));
vid.ctor_vtbl_p = !same_type_p (BINFO_TYPE (rtti_binfo), t);
@@ -7444,7 +7832,7 @@ build_vtbl_initializer (binfo, orig_binfo, t, rtti_binfo, non_fn_entries_p)
vid.index = ssize_int (-3);
/* Add entries to the vtable for RTTI. */
- build_rtti_vtbl_entries (binfo, rtti_binfo, &vid);
+ build_rtti_vtbl_entries (binfo, &vid);
/* Create an array for keeping track of the functions we've
processed. When we see multiple functions with the same
@@ -7474,7 +7862,7 @@ build_vtbl_initializer (binfo, orig_binfo, t, rtti_binfo, non_fn_entries_p)
tree fn;
tree pfn;
tree init;
-
+
/* Pull the offset for `this', and the function to call, out of
the list. */
delta = BV_DELTA (v);
@@ -7485,7 +7873,7 @@ build_vtbl_initializer (binfo, orig_binfo, t, rtti_binfo, non_fn_entries_p)
my_friendly_assert (vcall_index != NULL_TREE, 20000621);
}
else
- vcall_index = NULL_TREE;
+ vcall_index = NULL_TREE;
fn = BV_FN (v);
my_friendly_assert (TREE_CODE (delta) == INTEGER_CST, 19990727);
@@ -7501,11 +7889,55 @@ build_vtbl_initializer (binfo, orig_binfo, t, rtti_binfo, non_fn_entries_p)
pfn = build1 (ADDR_EXPR, vfunc_ptr_type_node, fn);
/* The address of a function can't change. */
TREE_CONSTANT (pfn) = 1;
+
/* Enter it in the vtable. */
- init = build_vtable_entry (delta, vcall_index, pfn,
- BV_GENERATE_THUNK_WITH_VTABLE_P (v));
+ init = build_vtable_entry (delta, vcall_index, pfn);
+
+ /* If the only definition of this function signature along our
+ primary base chain is from a lost primary, this vtable slot will
+ never be used, so just zero it out. This is important to avoid
+ requiring extra thunks which cannot be generated with the function.
+
+ We could also handle this in update_vtable_entry_for_fn; doing it
+ here means we zero out unused slots in ctor vtables as well,
+ rather than filling them with erroneous values (though harmless,
+ apart from relocation costs). */
+ if (fn != abort_fndecl)
+ for (b = binfo; ; b = get_primary_binfo (b))
+ {
+ /* We found a defn before a lost primary; go ahead as normal. */
+ if (look_for_overrides_here (BINFO_TYPE (b), fn))
+ break;
+
+ /* The nearest definition is from a lost primary; clear the
+ slot. */
+ if (BINFO_LOST_PRIMARY_P (b))
+ {
+ init = size_zero_node;
+ break;
+ }
+ }
+
/* And add it to the chain of initializers. */
- vfun_inits = tree_cons (NULL_TREE, init, vfun_inits);
+ if (TARGET_VTABLE_USES_DESCRIPTORS)
+ {
+ int i;
+ if (init == size_zero_node)
+ for (i = 0; i < TARGET_VTABLE_USES_DESCRIPTORS; ++i)
+ vfun_inits = tree_cons (NULL_TREE, init, vfun_inits);
+ else
+ for (i = 0; i < TARGET_VTABLE_USES_DESCRIPTORS; ++i)
+ {
+ tree fdesc = build (FDESC_EXPR, vfunc_ptr_type_node,
+ TREE_OPERAND (init, 0),
+ build_int_2 (i, 0));
+ TREE_CONSTANT (fdesc) = 1;
+
+ vfun_inits = tree_cons (NULL_TREE, fdesc, vfun_inits);
+ }
+ }
+ else
+ vfun_inits = tree_cons (NULL_TREE, init, vfun_inits);
}
/* The initializers for virtual functions were built up in reverse
@@ -7519,7 +7951,7 @@ build_vtbl_initializer (binfo, orig_binfo, t, rtti_binfo, non_fn_entries_p)
return chainon (vid.inits, vfun_inits);
}
-/* Sets vid->inits to be the initializers for the vbase and vcall
+/* Adds to vid->inits the initializers for the vbase and vcall
offsets in BINFO, which is in the hierarchy dominated by T. */
static void
@@ -7553,6 +7985,7 @@ build_vbase_offset_vtbl_entries (binfo, vid)
{
tree vbase;
tree t;
+ tree non_primary_binfo;
/* Under the old ABI, pointers to virtual bases are stored in each
object. */
@@ -7565,6 +7998,30 @@ build_vbase_offset_vtbl_entries (binfo, vid)
return;
t = vid->derived;
+
+ /* We might be a primary base class. Go up the inheritance hierarchy
+ until we find the most derived class of which we are a primary base:
+ it is the offset of that which we need to use. */
+ non_primary_binfo = binfo;
+ while (BINFO_INHERITANCE_CHAIN (non_primary_binfo))
+ {
+ tree b;
+
+ /* If we have reached a virtual base, then it must be a primary
+ base (possibly multi-level) of vid->binfo, or we wouldn't
+ have called build_vcall_and_vbase_vtbl_entries for it. But it
+ might be a lost primary, so just skip down to vid->binfo. */
+ if (TREE_VIA_VIRTUAL (non_primary_binfo))
+ {
+ non_primary_binfo = vid->binfo;
+ break;
+ }
+
+ b = BINFO_INHERITANCE_CHAIN (non_primary_binfo);
+ if (get_primary_binfo (b) != non_primary_binfo)
+ break;
+ non_primary_binfo = b;
+ }
/* Go through the virtual bases, adding the offsets. */
for (vbase = TYPE_BINFO (BINFO_TYPE (binfo));
@@ -7616,7 +8073,8 @@ build_vbase_offset_vtbl_entries (binfo, vid)
The vbase offsets go in reverse inheritance-graph order, and
we are walking in inheritance graph order so these end up in
the right order. */
- delta = size_diffop (BINFO_OFFSET (b), BINFO_OFFSET (binfo));
+ delta = size_diffop (BINFO_OFFSET (b), BINFO_OFFSET (non_primary_binfo));
+
*vid->last_init
= build_tree_list (NULL_TREE,
fold (build1 (NOP_EXPR,
@@ -7627,8 +8085,8 @@ build_vbase_offset_vtbl_entries (binfo, vid)
}
/* Adds the initializers for the vcall offset entries in the vtable
- for BINFO (which is part of the class hierarchy dominated by T) to
- VID->INITS. */
+ for BINFO (which is part of the class hierarchy dominated by VID->DERIVED)
+ to VID->INITS. */
static void
build_vcall_offset_vtbl_entries (binfo, vid)
@@ -7648,22 +8106,20 @@ build_vcall_offset_vtbl_entries (binfo, vid)
vtable. For example:
class A { virtual void f (); };
- class B : virtual public A { };
- class C: virtual public A, public B {};
-
- Now imagine:
-
- B* b = new C;
- b->f();
-
- The location of `A' is not at a fixed offset relative to `B'; the
- offset depends on the complete object derived from `B'. So,
- `B' vtable contains an entry for `f' that indicates by what
- amount the `this' pointer for `B' needs to be adjusted to arrive
- at `A'.
+ class B1 : virtual public A { virtual void f (); };
+ class B2 : virtual public A { virtual void f (); };
+ class C: public B1, public B2 { virtual void f (); };
+
+ A C object has a primary base of B1, which has a primary base of A. A
+ C also has a secondary base of B2, which no longer has a primary base
+ of A. So the B2-in-C construction vtable needs a secondary vtable for
+ A, which will adjust the A* to a B2* to call f. We have no way of
+ knowing what (or even whether) this offset will be when we define B2,
+ so we store this "vcall offset" in the A sub-vtable and look it up in
+ a "virtual thunk" for B2::f.
We need entries for all the functions in our primary vtable and
- in our non-virtual bases vtables. */
+ in our non-virtual bases' secondary vtables. */
vid->vbase = binfo;
/* Now, walk through the non-virtual bases, adding vcall offsets. */
add_vcall_offset_vtbl_entries_r (binfo, vid);
@@ -7680,7 +8136,9 @@ add_vcall_offset_vtbl_entries_r (binfo, vid)
tree primary_binfo;
/* Don't walk into virtual bases -- except, of course, for the
- virtual base for which we are building vcall offsets. */
+ virtual base for which we are building vcall offsets. Any
+ primary virtual base will have already had its offsets generated
+ through the recursion in build_vcall_and_vbase_vtbl_entries. */
if (TREE_VIA_VIRTUAL (binfo) && vid->vbase != binfo)
return;
@@ -7714,27 +8172,30 @@ add_vcall_offset_vtbl_entries_1 (binfo, vid)
tree base_virtuals;
tree orig_virtuals;
tree binfo_inits;
- /* If BINFO is a primary base, this is the least derived class of
- BINFO that is not a primary base. */
+ /* If BINFO is a primary base, the most derived class which has BINFO as
+ a primary base; otherwise, just BINFO. */
tree non_primary_binfo;
binfo_inits = NULL_TREE;
- /* We might be a primary base class. Go up the inheritance
- hierarchy until we find the class of which we are a primary base:
+ /* We might be a primary base class. Go up the inheritance hierarchy
+ until we find the most derived class of which we are a primary base:
it is the BINFO_VIRTUALS there that we need to consider. */
non_primary_binfo = binfo;
while (BINFO_INHERITANCE_CHAIN (non_primary_binfo))
{
tree b;
- /* If we have reached a virtual base, then it must be the
- virtual base for which we are building vcall offsets. In
- turn, the virtual base must be a (possibly indirect) primary
- base of the class that we are initializing, or we wouldn't
- care about its vtable offsets. */
+ /* If we have reached a virtual base, then it must be vid->vbase,
+ because we ignore other virtual bases in
+ add_vcall_offset_vtbl_entries_r. In turn, it must be a primary
+ base (possibly multi-level) of vid->binfo, or we wouldn't
+ have called build_vcall_and_vbase_vtbl_entries for it. But it
+ might be a lost primary, so just skip down to vid->binfo. */
if (TREE_VIA_VIRTUAL (non_primary_binfo))
{
+ if (non_primary_binfo != vid->vbase)
+ abort ();
non_primary_binfo = vid->binfo;
break;
}
@@ -7745,6 +8206,12 @@ add_vcall_offset_vtbl_entries_1 (binfo, vid)
non_primary_binfo = b;
}
+ if (vid->ctor_vtbl_p)
+ /* For a ctor vtable we need the equivalent binfo within the hierarchy
+ where rtti_binfo is the most derived type. */
+ non_primary_binfo = get_original_base
+ (non_primary_binfo, TYPE_BINFO (BINFO_TYPE (vid->rtti_binfo)));
+
/* Make entries for the rest of the virtuals. */
for (base_virtuals = BINFO_VIRTUALS (binfo),
derived_virtuals = BINFO_VIRTUALS (non_primary_binfo),
@@ -7759,15 +8226,15 @@ add_vcall_offset_vtbl_entries_1 (binfo, vid)
tree base;
tree base_binfo;
size_t i;
+ tree vcall_offset;
/* Find the declaration that originally caused this function to
- be present. */
+ be present in BINFO_TYPE (binfo). */
orig_fn = BV_FN (orig_virtuals);
- /* We do not need an entry if this function is declared in a
- virtual base (or one of its virtual bases), and not
- overridden in the section of the hierarchy dominated by the
- virtual base for which we are building vcall offsets. */
+ /* When processing BINFO, we only want to generate vcall slots for
+ function slots introduced in BINFO. So don't try to generate
+ one if the function isn't even defined in BINFO. */
if (!same_type_p (DECL_CONTEXT (orig_fn), BINFO_TYPE (binfo)))
continue;
@@ -7783,33 +8250,45 @@ add_vcall_offset_vtbl_entries_1 (binfo, vid)
tree derived_entry;
derived_entry = VARRAY_TREE (vid->fns, i);
- if (same_signature_p (BV_FN (derived_entry), fn))
+ if (same_signature_p (BV_FN (derived_entry), fn)
+ /* We only use one vcall offset for virtual destructors,
+ even though there are two virtual table entries. */
+ || (DECL_DESTRUCTOR_P (BV_FN (derived_entry))
+ && DECL_DESTRUCTOR_P (fn)))
{
- BV_VCALL_INDEX (derived_virtuals)
- = BV_VCALL_INDEX (derived_entry);
+ if (!vid->ctor_vtbl_p)
+ BV_VCALL_INDEX (derived_virtuals)
+ = BV_VCALL_INDEX (derived_entry);
break;
}
}
if (i != VARRAY_ACTIVE_SIZE (vid->fns))
continue;
- /* The FN comes from BASE. So, we must calculate the adjustment
- from the virtual base that derived from BINFO to BASE. */
+ /* The FN comes from BASE. So, we must calculate the adjustment from
+ vid->vbase to BASE. We can just look for BASE in the complete
+ object because we are converting from a virtual base, so if there
+ were multiple copies, there would not be a unique final overrider
+ and vid->derived would be ill-formed. */
base = DECL_CONTEXT (fn);
base_binfo = get_binfo (base, vid->derived, /*protect=*/0);
/* Compute the vcall offset. */
- *vid->last_init
- = (build_tree_list
- (NULL_TREE,
- fold (build1 (NOP_EXPR, vtable_entry_type,
- size_diffop (BINFO_OFFSET (base_binfo),
- BINFO_OFFSET (vid->vbase))))));
+ /* As mentioned above, the vbase we're working on is a primary base of
+ vid->binfo. But it might be a lost primary, so its BINFO_OFFSET
+ might be wrong, so we just use the BINFO_OFFSET from vid->binfo. */
+ vcall_offset = BINFO_OFFSET (vid->binfo);
+ vcall_offset = size_diffop (BINFO_OFFSET (base_binfo),
+ vcall_offset);
+ vcall_offset = fold (build1 (NOP_EXPR, vtable_entry_type,
+ vcall_offset));
+
+ *vid->last_init = build_tree_list (NULL_TREE, vcall_offset);
vid->last_init = &TREE_CHAIN (*vid->last_init);
/* Keep track of the vtable index where this vcall offset can be
found. For a construction vtable, we already made this
- annotation when we build the original vtable. */
+ annotation when we built the original vtable. */
if (!vid->ctor_vtbl_p)
BV_VCALL_INDEX (derived_virtuals) = vid->index;
@@ -7824,12 +8303,11 @@ add_vcall_offset_vtbl_entries_1 (binfo, vid)
/* Return vtbl initializers for the RTTI entries coresponding to the
BINFO's vtable. The RTTI entries should indicate the object given
- by RTTI_BINFO. */
+ by VID->rtti_binfo. */
static void
-build_rtti_vtbl_entries (binfo, rtti_binfo, vid)
+build_rtti_vtbl_entries (binfo, vid)
tree binfo;
- tree rtti_binfo;
vtbl_init_data *vid;
{
tree b;
@@ -7840,7 +8318,7 @@ build_rtti_vtbl_entries (binfo, rtti_binfo, vid)
tree init;
basetype = BINFO_TYPE (binfo);
- t = BINFO_TYPE (rtti_binfo);
+ t = BINFO_TYPE (vid->rtti_binfo);
/* For a COM object there is no RTTI entry. */
if (CLASSTYPE_COM_INTERFACE (basetype))
@@ -7858,37 +8336,18 @@ build_rtti_vtbl_entries (binfo, rtti_binfo, vid)
my_friendly_assert (BINFO_PRIMARY_BASE_OF (primary_base) == b, 20010127);
b = primary_base;
}
- offset = size_diffop (BINFO_OFFSET (rtti_binfo), BINFO_OFFSET (b));
+ offset = size_diffop (BINFO_OFFSET (vid->rtti_binfo), BINFO_OFFSET (b));
- /* The second entry is, in the case of the new ABI, the address of
- the typeinfo object, or, in the case of the old ABI, a function
- which returns a typeinfo object. */
- if (new_abi_rtti_p ())
- {
- if (flag_rtti)
- decl = build_unary_op (ADDR_EXPR, get_tinfo_decl (t), 0);
- else
- decl = integer_zero_node;
-
- /* Convert the declaration to a type that can be stored in the
- vtable. */
- init = build1 (NOP_EXPR, vfunc_ptr_type_node, decl);
- TREE_CONSTANT (init) = 1;
- }
+ /* The second entry is the address of the typeinfo object. */
+ if (flag_rtti)
+ decl = build_unary_op (ADDR_EXPR, get_tinfo_decl (t), 0);
else
- {
- if (flag_rtti)
- decl = get_tinfo_decl (t);
- else
- decl = abort_fndecl;
-
- /* Convert the declaration to a type that can be stored in the
- vtable. */
- init = build1 (ADDR_EXPR, vfunc_ptr_type_node, decl);
- TREE_CONSTANT (init) = 1;
- init = build_vtable_entry (offset, NULL_TREE, init,
- /*generate_with_vtable_p=*/0);
- }
+ decl = integer_zero_node;
+
+ /* Convert the declaration to a type that can be stored in the
+ vtable. */
+ init = build1 (NOP_EXPR, vfunc_ptr_type_node, decl);
+ TREE_CONSTANT (init) = 1;
*vid->last_init = build_tree_list (NULL_TREE, init);
vid->last_init = &TREE_CHAIN (*vid->last_init);
@@ -7907,18 +8366,17 @@ build_rtti_vtbl_entries (binfo, rtti_binfo, vid)
/* Build an entry in the virtual function table. DELTA is the offset
for the `this' pointer. VCALL_INDEX is the vtable index containing
- the vcall offset; zero if none. ENTRY is the virtual function
+ the vcall offset; NULL_TREE if none. ENTRY is the virtual function
table entry itself. It's TREE_TYPE must be VFUNC_PTR_TYPE_NODE,
but it may not actually be a virtual function table pointer. (For
example, it might be the address of the RTTI object, under the new
ABI.) */
static tree
-build_vtable_entry (delta, vcall_index, entry, generate_with_vtable_p)
+build_vtable_entry (delta, vcall_index, entry)
tree delta;
tree vcall_index;
tree entry;
- int generate_with_vtable_p;
{
if (flag_vtable_thunks)
{
@@ -7929,8 +8387,7 @@ build_vtable_entry (delta, vcall_index, entry, generate_with_vtable_p)
&& fn != abort_fndecl
&& !DECL_TINFO_FN_P (fn))
{
- entry = make_thunk (entry, delta, vcall_index,
- generate_with_vtable_p);
+ entry = make_thunk (entry, delta, vcall_index);
entry = build1 (ADDR_EXPR, vtable_entry_type, entry);
TREE_READONLY (entry) = 1;
TREE_CONSTANT (entry) = 1;
diff --git a/gcc/cp/cp-tree.def b/gcc/cp/cp-tree.def
index 3d514b518b6..c43c94d9048 100644
--- a/gcc/cp/cp-tree.def
+++ b/gcc/cp/cp-tree.def
@@ -171,6 +171,9 @@ DEFTREECODE (TYPEOF_TYPE, "typeof_type", 't', 0)
This is not an alias, but is later expanded into multiple aliases. */
DEFTREECODE (USING_DECL, "using_decl", 'd', 0)
+/* A using directive. The operand is USING_STMT_NAMESPACE. */
+DEFTREECODE (USING_STMT, "using_directive", 'e', 1)
+
/* An un-parsed default argument. Looks like an IDENTIFIER_NODE. */
DEFTREECODE (DEFAULT_ARG, "default_arg", 'x', 2)
@@ -236,8 +239,13 @@ DEFTREECODE (START_CATCH_STMT, "start_catch_stmt", 'e', 0)
DEFTREECODE (CTOR_INITIALIZER, "ctor_initializer", 'e', 2)
DEFTREECODE (RETURN_INIT, "return_init", 'e', 2)
DEFTREECODE (TRY_BLOCK, "try_block", 'e', 2)
+DEFTREECODE (EH_SPEC_BLOCK, "eh_spec_block", 'e', 2)
DEFTREECODE (HANDLER, "handler", 'e', 2)
+/* A MUST_NOT_THROW_EXPR wraps an expression that may not
+ throw, and must call terminate if it does. */
+DEFTREECODE (MUST_NOT_THROW_EXPR, "must_not_throw_expr", 'e', 1)
+
DEFTREECODE (TAG_DEFN, "tag_defn", 'e', 0)
/* And some codes for expressing conversions for overload resolution. */
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index 43a97143e25..8682fb182fd 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -55,7 +55,6 @@ Boston, MA 02111-1307, USA. */
BASELINK_P (in TREE_LIST)
ICS_ELLIPSIS_FLAG (in _CONV)
BINFO_ACCESS (in BINFO)
- BV_GENERATE_THUNK_WITH_VTABLE_P (in TREE_LIST)
2: IDENTIFIER_OPNAME_P.
TYPE_POLYMORHPIC_P (in _TYPE)
ICS_THIS_FLAG (in _CONV)
@@ -135,10 +134,6 @@ Boston, MA 02111-1307, USA. */
When CLASSTYPE_COM_INTERFACE_P does not hold, the first entry
does not have a BV_FN; it is just an offset.
- The BV_OVERRIDING_BASE is the binfo for the final overrider for
- this function. (This binfo's BINFO_TYPE will always be the same
- as the DECL_CLASS_CONTEXT for the function.)
-
BINFO_VTABLE
Sometimes this is a VAR_DECL. Under the new ABI, it is instead
an expression with POINTER_TYPE pointing that gives the value
@@ -213,10 +208,6 @@ Boston, MA 02111-1307, USA. */
/* ABI control. */
-/* Nonzero to enable experimental ABI changes. */
-
-extern int flag_new_abi;
-
/* Nonzero to use __cxa_atexit, rather than atexit, to register
destructors for local statics and global objects. */
@@ -238,12 +229,12 @@ extern int flag_huge_objects;
/* Nonzero if virtual base class offsets are stored in the virtual
function table. Zero if, instead, a pointer to the virtual base is
stored in the object itself. */
-#define vbase_offsets_in_vtable_p() (flag_new_abi)
+#define vbase_offsets_in_vtable_p() (1)
/* Nonzero if displacements to the `this' pointer to use when calling
virtual functions in a virtual base class are present in the
vtable. */
-#define vcall_offsets_in_vtable_p() (flag_new_abi)
+#define vcall_offsets_in_vtable_p() (1)
/* Nonzero if a derived class that needs a vptr should always get one,
even if a non-primary base class already has one. For example,
@@ -255,7 +246,7 @@ extern int flag_huge_objects;
one could either reuse the vptr in `S' for `T', or create a new
vptr for `T'. If this flag is nonzero we choose the latter
alternative; otherwise, we choose the former. */
-#define vptrs_present_everywhere_p() (flag_new_abi)
+#define vptrs_present_everywhere_p() (1)
/* Nonzero if the vtable for a derived class should contain the
virtual functions from the primary base and all virtual functions
@@ -263,16 +254,11 @@ extern int flag_huge_objects;
only those virtual functions from the primary base together with
the functions declared in the derived class (but not in any base
class). */
-#define all_overridden_vfuns_in_vtables_p() (flag_new_abi)
-
-/* Nonzero if we use access type_info objects directly, and use the
- cross-vendor layout for them. Zero if we use an accessor function
- to get the type_info object address. */
-#define new_abi_rtti_p() (flag_new_abi)
+#define all_overridden_vfuns_in_vtables_p() (1)
/* Nonzero if primary and secondary vtables are combined into a single
vtable. */
-#define merge_primary_and_secondary_vtables_p() (flag_new_abi)
+#define merge_primary_and_secondary_vtables_p() (1)
/* Language-dependent contents of an identifier. */
@@ -625,7 +611,6 @@ enum cp_tree_index
CPTI_PFN_IDENTIFIER,
CPTI_PFN_OR_DELTA2_IDENTIFIER,
CPTI_VPTR_IDENTIFIER,
- CPTI_PUSH_EXCEPTION_IDENTIFIER,
CPTI_STD_IDENTIFIER,
CPTI_LANG_NAME_C,
@@ -636,6 +621,7 @@ enum cp_tree_index
CPTI_NULL,
CPTI_JCLASS,
CPTI_TERMINATE,
+ CPTI_CALL_UNEXPECTED,
CPTI_ATEXIT,
CPTI_DSO_HANDLE,
CPTI_DCAST,
@@ -749,9 +735,6 @@ extern tree cp_global_trees[CPTI_MAX];
#define pfn_identifier cp_global_trees[CPTI_PFN_IDENTIFIER]
#define pfn_or_delta2_identifier cp_global_trees[CPTI_PFN_OR_DELTA2_IDENTIFIER]
#define vptr_identifier cp_global_trees[CPTI_VPTR_IDENTIFIER]
-/* The name of the function to call to push an exception onto the
- exception stack. */
-#define cp_push_exception_identifier cp_global_trees[CPTI_PUSH_EXCEPTION_IDENTIFIER]
/* The name of the std namespace. */
#define std_identifier cp_global_trees[CPTI_STD_IDENTIFIER]
#define lang_name_c cp_global_trees[CPTI_LANG_NAME_C]
@@ -770,6 +753,9 @@ extern tree cp_global_trees[CPTI_MAX];
/* The declaration for `std::terminate'. */
#define terminate_node cp_global_trees[CPTI_TERMINATE]
+/* The declaration for "__cxa_call_unexpected". */
+#define call_unexpected_node cp_global_trees[CPTI_CALL_UNEXPECTED]
+
/* A pointer to `std::atexit'. */
#define atexit_node cp_global_trees[CPTI_ATEXIT]
@@ -883,8 +869,9 @@ struct cp_language_function
tree x_dtor_label;
tree x_current_class_ptr;
tree x_current_class_ref;
- tree x_eh_spec_try_block;
+ tree x_eh_spec_block;
tree x_in_charge_parm;
+ tree x_vtt_parm;
tree *x_vcalls_possible_p;
@@ -897,6 +884,7 @@ struct cp_language_function
struct named_label_use_list *x_named_label_uses;
struct named_label_list *x_named_labels;
struct binding_level *bindings;
+ varray_type x_local_names;
const char *cannot_inline;
};
@@ -925,16 +913,21 @@ struct cp_language_function
#define current_class_ref \
(cfun ? cp_function_chain->x_current_class_ref : NULL_TREE)
-/* The TRY_BLOCK for the exception-specifiers for the current
+/* The EH_SPEC_BLOCK for the exception-specifiers for the current
function, if any. */
-#define current_eh_spec_try_block cp_function_chain->x_eh_spec_try_block
+#define current_eh_spec_block cp_function_chain->x_eh_spec_block
/* The `__in_chrg' parameter for the current function. Only used for
- destructors. */
+ constructors and destructors. */
#define current_in_charge_parm cp_function_chain->x_in_charge_parm
+/* The `__vtt_parm' parameter for the current function. Only used for
+ constructors and destructors. */
+
+#define current_vtt_parm cp_function_chain->x_vtt_parm
+
/* In destructors, this is a pointer to a condition in an
if-statement. If the pointed-to value is boolean_true_node, then
there may be virtual function calls in this destructor. */
@@ -1076,10 +1069,6 @@ extern int warn_ecpp;
extern int warn_sign_promo;
-/* Non-zero means warn when a function is declared extern and later inline. */
-
-extern int warn_extern_inline;
-
/* Non-zero means warn when an old-style cast is used. */
extern int warn_old_style_cast;
@@ -1119,15 +1108,6 @@ extern int flag_ansi;
extern int flag_default_inline;
-/* The name-mangling scheme to use. Versions of gcc before 2.8 use
- version 0. */
-extern int name_mangling_version;
-
-/* Nonzero if squashed mangling is to be performed.
- This uses the B and K codes to reference previously seen class types
- and class qualifiers. */
-extern int flag_do_squangling;
-
/* Nonzero means generate separate instantiation control files and juggle
them at link time. */
extern int flag_use_repository;
@@ -1176,12 +1156,18 @@ enum languages { lang_c, lang_cplusplus, lang_java };
/* Macros to make error reporting functions' lives easier. */
#define TYPE_IDENTIFIER(NODE) (DECL_NAME (TYPE_NAME (NODE)))
+#define TYPE_LINKAGE_IDENTIFIER(NODE) \
+ (TYPE_IDENTIFIER (TYPE_MAIN_VARIANT (NODE)))
#define TYPE_NAME_STRING(NODE) (IDENTIFIER_POINTER (TYPE_IDENTIFIER (NODE)))
#define TYPE_NAME_LENGTH(NODE) (IDENTIFIER_LENGTH (TYPE_IDENTIFIER (NODE)))
#define TYPE_ASSEMBLER_NAME_STRING(NODE) (IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (TYPE_NAME (NODE))))
#define TYPE_ASSEMBLER_NAME_LENGTH(NODE) (IDENTIFIER_LENGTH (DECL_ASSEMBLER_NAME (TYPE_NAME (NODE))))
+/* Nonzero if NODE has no name for linkage purposes. */
+#define TYPE_ANONYMOUS_P(NODE) \
+ (TAGGED_TYPE_P (NODE) && ANON_AGGRNAME_P (TYPE_LINKAGE_IDENTIFIER (NODE)))
+
/* The _DECL for this _TYPE. */
#define TYPE_MAIN_DECL(NODE) (TYPE_STUB_DECL (TYPE_MAIN_VARIANT (NODE)))
@@ -1211,8 +1197,9 @@ enum languages { lang_c, lang_cplusplus, lang_java };
#define IS_AGGR_TYPE_2(TYPE1,TYPE2) \
(TREE_CODE (TYPE1) == TREE_CODE (TYPE2) \
&& IS_AGGR_TYPE (TYPE1) && IS_AGGR_TYPE (TYPE2))
-#define IS_OVERLOAD_TYPE(t) \
- (IS_AGGR_TYPE (t) || TREE_CODE (t) == ENUMERAL_TYPE)
+#define TAGGED_TYPE_P(t) \
+ (CLASS_TYPE_P (t) || TREE_CODE (t) == ENUMERAL_TYPE)
+#define IS_OVERLOAD_TYPE(T) TAGGED_TYPE_P (T)
/* In a *_TYPE, nonzero means a built-in type. */
#define TYPE_BUILT_IN(NODE) TYPE_LANG_FLAG_6(NODE)
@@ -1253,7 +1240,18 @@ enum languages { lang_c, lang_cplusplus, lang_java };
? (ENTRY) \
: DECL_INITIAL (TREE_OPERAND ((ENTRY), 0)))
-#define FUNCTION_ARG_CHAIN(NODE) (TREE_CHAIN (TYPE_ARG_TYPES (TREE_TYPE (NODE))))
+#define FUNCTION_ARG_CHAIN(NODE) \
+ (TREE_CHAIN (TYPE_ARG_TYPES (TREE_TYPE (NODE))))
+
+/* Given a FUNCTION_DECL, returns the first TREE_LIST out of TYPE_ARG_TYPES
+ which refers to a user-written parameter. */
+#define FUNCTION_FIRST_USER_PARMTYPE(NODE) \
+ (skip_artificial_parms_for (NODE, TYPE_ARG_TYPES (TREE_TYPE (NODE))))
+
+/* Similarly, but for DECL_ARGUMENTS. */
+#define FUNCTION_FIRST_USER_PARM(NODE) \
+ (skip_artificial_parms_for (NODE, DECL_ARGUMENTS (NODE)))
+
#define PROMOTES_TO_AGGR_TYPE(NODE,CODE) \
(((CODE) == TREE_CODE (NODE) \
&& IS_AGGR_TYPE (TREE_TYPE (NODE))) \
@@ -1338,7 +1336,8 @@ struct lang_type
/* There are some bits left to fill out a 32-bit word. Keep track
of this by updating the size of this bitfield whenever you add or
remove a flag. */
- unsigned dummy : 8;
+ unsigned java_interface : 1;
+ unsigned dummy : 7;
int vsize;
@@ -1460,7 +1459,7 @@ struct lang_type
#define CLASSTYPE_CONSTRUCTORS(NODE) \
(TREE_VEC_ELT (CLASSTYPE_METHOD_VEC (NODE), CLASSTYPE_CONSTRUCTOR_SLOT))
-/* A FUNCTION_DECL for the destructor for NODE. These are te
+/* A FUNCTION_DECL for the destructor for NODE. These are the
destructors that take an in-charge parameter. */
#define CLASSTYPE_DESTRUCTORS(NODE) \
(TREE_VEC_ELT (CLASSTYPE_METHOD_VEC (NODE), CLASSTYPE_DESTRUCTOR_SLOT))
@@ -1560,6 +1559,10 @@ struct lang_type
#define CLASSTYPE_ALIGN_UNIT(NODE) \
(CLASSTYPE_ALIGN (NODE) / BITS_PER_UNIT)
+/* True if this a Java interface type, declared with
+ '__attribute__ ((java_interface))'. */
+#define TYPE_JAVA_INTERFACE(NODE) (TYPE_LANG_SPECIFIC(NODE)->java_interface)
+
/* A cons list of virtual functions which cannot be inherited by
derived classes. When deriving from this type, the derived
class must provide its own definition for each of these functions. */
@@ -1653,6 +1656,10 @@ struct lang_type
inheritance is indicated by the absence of the other two flags, not
by TREE_VIA_PRIVATE, which is unused. */
+/* Mark the binfo, whether shared or not. Each instance of a virtual
+ base can be separately marked. */
+#define BINFO_UNSHARED_MARKED(NODE) TREE_LANG_FLAG_0(NODE)
+
/* Nonzero means marked by DFS or BFS search, including searches
by `get_binfo' and `get_base_distance'. */
#define BINFO_MARKED(NODE) (TREE_VIA_VIRTUAL(NODE)?CLASSTYPE_MARKED(BINFO_TYPE(NODE)):TREE_LANG_FLAG_0(NODE))
@@ -1757,14 +1764,6 @@ struct lang_type
/* Nonzero if we should use a virtual thunk for this entry. */
#define BV_USE_VCALL_INDEX_P(NODE) \
(TREE_LANG_FLAG_0 (NODE))
-
-/* Nonzero if we should generate this thunk when the vtable that
- references it is emitted, rather than with the final overrider. */
-#define BV_GENERATE_THUNK_WITH_VTABLE_P(NODE) \
- (TREE_LANG_FLAG_1 (NODE))
-
-/* The most derived class. */
-
/* Nonzero for TREE_LIST node means that this list of things
is a list of parameters, as opposed to a list of expressions. */
@@ -1812,7 +1811,7 @@ struct lang_decl_flags
unsigned static_function : 1;
unsigned pure_virtual : 1;
unsigned has_in_charge_parm_p : 1;
- unsigned uninlinable : 1;
+ unsigned has_vtt_parm_p : 1;
unsigned deferred : 1;
unsigned use_template : 2;
@@ -1828,8 +1827,7 @@ struct lang_decl_flags
unsigned tinfo_fn_p : 1;
unsigned assignment_operator_p : 1;
unsigned anticipated_p : 1;
- unsigned generate_with_vtable_p : 1;
- unsigned dummy : 1;
+ /* Two unused bits. */
union {
/* In a FUNCTION_DECL, VAR_DECL, TYPE_DECL, or TEMPLATE_DECL, this
@@ -1844,6 +1842,9 @@ struct lang_decl_flags
/* This is DECL_ACCESS. */
tree access;
+ /* For VAR_DECL in function, this is DECL_DISCRIMINATOR. */
+ int discriminator;
+
/* In a namespace-scope FUNCTION_DECL, this is
GLOBAL_INIT_PRIORITY. */
int init_priority;
@@ -1869,6 +1870,10 @@ struct lang_decl
/* In a FUNCTION_DECL, this is DECL_CLONED_FUNCTION. */
tree cloned_function;
+ /* In a FUNCTION_DECL, these are function data which is to be kept
+ as long as FUNCTION_DECL is kept. */
+ tree inlined_fns;
+
union
{
tree sorted_fields;
@@ -1880,9 +1885,6 @@ struct lang_decl
/* In an overloaded operator, this is the value of
DECL_OVERLOADED_OPERATOR_P. */
enum tree_code operator_code;
- /* In a maybe-in-charge constructor or destructor, this is
- DECL_VTT_PARM. */
- tree vtt_parm;
} u2;
};
@@ -1899,9 +1901,10 @@ struct lang_decl
just been used somewhere, even if it's not really needed. We need
anything that isn't comdat, but we don't know for sure whether or
not something is comdat until end-of-file. */
-#define DECL_NEEDED_P(DECL) \
- ((at_eof && TREE_PUBLIC (DECL) && !DECL_COMDAT (DECL)) \
- || (TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME ((DECL)))) \
+#define DECL_NEEDED_P(DECL) \
+ ((at_eof && TREE_PUBLIC (DECL) && !DECL_COMDAT (DECL)) \
+ || (DECL_ASSEMBLER_NAME_SET_P (DECL) \
+ && TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME ((DECL)))) \
|| (flag_syntax_only && TREE_USED ((DECL))))
/* Non-zero iff DECL is memory-based. The DECL_RTL of
@@ -1910,11 +1913,26 @@ struct lang_decl
here because on most RISC machines, a variable's address
is not, by itself, a legitimate address. */
#define DECL_IN_MEMORY_P(NODE) \
- (DECL_RTL (NODE) != NULL_RTX && GET_CODE (DECL_RTL (NODE)) == MEM)
+ (DECL_RTL_SET_P (NODE) && GET_CODE (DECL_RTL (NODE)) == MEM)
-/* For FUNCTION_DECLs: return the language in which this decl
- was declared. */
-#define DECL_LANGUAGE(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.language)
+/* For a FUNCTION_DECL or a VAR_DECL, the language linkage for the
+ declaration. Some entities (like a member function in a local
+ class, or a local variable) do not have linkage at all, and this
+ macro should not be used in those cases.
+
+ Implementation note: A FUNCTION_DECL without DECL_LANG_SPECIFIC was
+ created by language-independent code, and has C linkage. Most
+ VAR_DECLs have C++ linkage, and do not have DECL_LANG_SPECIFIC, but
+ we do create DECL_LANG_SPECIFIC for variables with non-C++ linkage. */
+#define DECL_LANGUAGE(NODE) \
+ (DECL_LANG_SPECIFIC (NODE) \
+ ? DECL_LANG_SPECIFIC(NODE)->decl_flags.language \
+ : (TREE_CODE (NODE) == FUNCTION_DECL \
+ ? lang_c : lang_cplusplus))
+
+/* Set the language linkage for NODE to LANGUAGE. */
+#define SET_DECL_LANGUAGE(NODE, LANGUAGE) \
+ (DECL_LANG_SPECIFIC (NODE)->decl_flags.language = LANGUAGE)
/* For FUNCTION_DECLs: nonzero means that this function is a constructor. */
#define DECL_CONSTRUCTOR_P(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.constructor_attr)
@@ -1982,17 +2000,22 @@ struct lang_decl
#define DECL_CLONED_FUNCTION(NODE) \
(DECL_LANG_SPECIFIC (NODE)->cloned_function)
-/* In a maybe-in-charge constructor or destructor, this is the VTT
- parameter. It's not actually on the DECL_ARGUMENTS list. */
-#define DECL_VTT_PARM(NODE) \
- (DECL_LANG_SPECIFIC (NODE)->u2.vtt_parm)
+/* List of FUNCION_DECLs inlined into this function's body. */
+#define DECL_INLINED_FNS(NODE) \
+ (DECL_LANG_SPECIFIC (NODE)->inlined_fns)
-/* If there's a DECL_VTT_PARM, this is a magic variable that indicates
- whether or not the VTT parm should be used. In a subobject
- constructor, `true' is substituted for this value; in a complete
- object constructor, `false' is substituted instead. */
-#define DECL_USE_VTT_PARM(NODE) \
- (TREE_CHAIN (DECL_VTT_PARM (NODE)))
+/* Nonzero if NODE has DECL_DISCRIMINATOR and not DECL_ACCESS. */
+#define DECL_DISCRIMINATOR_P(NODE) \
+ (TREE_CODE (NODE) == VAR_DECL \
+ && DECL_FUNCTION_SCOPE_P (NODE))
+
+/* Discriminator for name mangling. */
+#define DECL_DISCRIMINATOR(NODE) \
+ (DECL_LANG_SPECIFIC (NODE)->decl_flags.u2.discriminator)
+
+/* Non-zero if the VTT parm has been added to NODE. */
+#define DECL_HAS_VTT_PARM_P(NODE) \
+ (DECL_LANG_SPECIFIC (NODE)->decl_flags.has_vtt_parm_p)
/* Non-zero if NODE is a FUNCTION_DECL for which a VTT parameter is
required. */
@@ -2481,10 +2504,6 @@ extern int flag_new_for_scope;
/* Record whether a typedef for type `int' was actually `signed int'. */
#define C_TYPEDEF_EXPLICITLY_SIGNED(exp) DECL_LANG_FLAG_1 ((exp))
-/* In a FUNCTION_DECL, nonzero if the function cannot be inlined. */
-#define DECL_UNINLINABLE(NODE) \
- (DECL_LANG_SPECIFIC (NODE)->decl_flags.uninlinable)
-
/* Returns non-zero if DECL has external linkage, as specified by the
language standard. (This predicate may hold even when the
corresponding entity is not actually given external linkage in the
@@ -2574,7 +2593,7 @@ extern int flag_new_for_scope;
#define TYPE_HAS_NONTRIVIAL_DESTRUCTOR(NODE) \
(TYPE_LANG_FLAG_4(NODE))
-/* Nonzero for class type means that initialization of this type can use
+/* Nonzero for class type means that copy initialization of this type can use
a bitwise copy. */
#define TYPE_HAS_TRIVIAL_INIT_REF(NODE) \
(TYPE_HAS_INIT_REF (NODE) && ! TYPE_HAS_COMPLEX_INIT_REF (NODE))
@@ -2675,15 +2694,25 @@ extern int flag_new_for_scope;
(We don't need DELTA2, because the vtable is always the first thing
in the object.) If the function is virtual, then PFN is one plus
twice the index into the vtable; otherwise, it is just a pointer to
- the function. */
+ the function.
+
+ Unfortunately, using the lowest bit of PFN doesn't work in
+ architectures that don't impose alignment requirements on function
+ addresses, or that use the lowest bit to tell one ISA from another,
+ for example. For such architectures, we use the lowest bit of
+ DELTA instead of the lowest bit of the PFN, and DELTA will be
+ multiplied by 2. */
+enum ptrmemfunc_vbit_where_t
+{
+ ptrmemfunc_vbit_in_pfn,
+ ptrmemfunc_vbit_in_delta
+};
/* Get the POINTER_TYPE to the METHOD_TYPE associated with this
pointer to member function. TYPE_PTRMEMFUNC_P _must_ be true,
before using this macro. */
#define TYPE_PTRMEMFUNC_FN_TYPE(NODE) \
- (flag_new_abi \
- ? (TREE_TYPE (TYPE_FIELDS (NODE))) \
- : (TREE_TYPE (TYPE_FIELDS (TREE_TYPE (TREE_CHAIN (TREE_CHAIN (TYPE_FIELDS (NODE))))))))
+ (TREE_TYPE (TYPE_FIELDS (NODE)))
/* Returns `A' for a type like `int (A::*)(double)' */
#define TYPE_PTRMEMFUNC_OBJECT_TYPE(NODE) \
@@ -2693,11 +2722,14 @@ extern int flag_new_for_scope;
hashed POINTER_TYPE, and can only be used on the POINTER_TYPE. */
#define TYPE_GET_PTRMEMFUNC_TYPE(NODE) ((tree)TYPE_LANG_SPECIFIC(NODE))
#define TYPE_SET_PTRMEMFUNC_TYPE(NODE, VALUE) (TYPE_LANG_SPECIFIC(NODE) = ((struct lang_type *)(void*)(VALUE)))
-/* These are to get the delta2 and pfn fields from a TYPE_PTRMEMFUNC_P. */
-#define DELTA2_FROM_PTRMEMFUNC(NODE) delta2_from_ptrmemfunc ((NODE))
+/* Returns the pfn field from a TYPE_PTRMEMFUNC_P. */
#define PFN_FROM_PTRMEMFUNC(NODE) pfn_from_ptrmemfunc ((NODE))
-/* For a pointer-to-member type of the form `T X::*', this is `X'. */
+/* For a pointer-to-member type of the form `T X::*', this is `X'.
+ For a type like `void (X::*)() const', this type is `X', not `const
+ X'. To get at the `const X' you have to look at the
+ TYPE_PTRMEM_POINTED_TO_TYPE; there, the first parameter will have
+ type `const X*'. */
#define TYPE_PTRMEM_CLASS_TYPE(NODE) \
(TYPE_PTRMEM_P ((NODE)) \
? TYPE_OFFSET_BASETYPE (TREE_TYPE ((NODE))) \
@@ -2991,7 +3023,7 @@ extern int flag_new_for_scope;
/* This function was declared inline. This flag controls the linkage
semantics of 'inline'; whether or not the function is inlined is
controlled by DECL_INLINE. */
-#define DECL_THIS_INLINE(NODE) \
+#define DECL_DECLARED_INLINE_P(NODE) \
(DECL_LANG_SPECIFIC (NODE)->decl_flags.declared_inline)
/* DECL_EXTERNAL must be set on a decl until the decl is actually emitted,
@@ -3035,16 +3067,16 @@ extern int flag_new_for_scope;
#define THUNK_VCALL_OFFSET(DECL) \
(DECL_LANG_SPECIFIC (DECL)->decl_flags.u2.vcall_offset)
-/* Nonzero if this thunk should be generated with the vtable that
- references it. */
-#define THUNK_GENERATE_WITH_VTABLE_P(DECL) \
- (DECL_LANG_SPECIFIC (DECL)->decl_flags.generate_with_vtable_p)
-
/* These macros provide convenient access to the various _STMT nodes
created when parsing template declarations. */
#define TRY_STMTS(NODE) TREE_OPERAND (TRY_BLOCK_CHECK (NODE), 0)
#define TRY_HANDLERS(NODE) TREE_OPERAND (TRY_BLOCK_CHECK (NODE), 1)
+#define USING_STMT_NAMESPACE(NODE) TREE_OPERAND (USING_STMT_CHECK (NODE), 0)
+
+#define EH_SPEC_STMTS(NODE) TREE_OPERAND (EH_SPEC_BLOCK_CHECK (NODE), 0)
+#define EH_SPEC_RAISES(NODE) TREE_OPERAND (EH_SPEC_BLOCK_CHECK (NODE), 1)
+
/* Nonzero if this try block is a function try block. */
#define FN_TRY_BLOCK_P(NODE) TREE_LANG_FLAG_3 (TRY_BLOCK_CHECK (NODE))
#define HANDLER_PARMS(NODE) TREE_OPERAND (HANDLER_CHECK (NODE), 0)
@@ -3052,7 +3084,6 @@ extern int flag_new_for_scope;
#define SUBOBJECT_CLEANUP(NODE) TREE_OPERAND (SUBOBJECT_CHECK (NODE), 0)
#define START_CATCH_TYPE(NODE) TREE_TYPE (START_CATCH_STMT_CHECK (NODE))
-
/* Nonzero if this CTOR_STMT is for the beginning of a constructor. */
#define CTOR_BEGIN_P(NODE) \
(TREE_LANG_FLAG_0 (CTOR_STMT_CHECK (NODE)))
@@ -3170,10 +3201,6 @@ typedef enum instantiate_type_flags {
itf_ptrmem_ok = 1 << 2, /* pointers to member ok (internal use) */
} instantiate_type_flags;
-/* Non-zero means that if a label exists, and no other identifier
- applies, use the value of the label. */
-extern int flag_labels_ok;
-
/* Nonzero means allow Microsoft extensions without a pedwarn. */
extern int flag_ms_extensions;
@@ -3247,10 +3274,6 @@ extern varray_type local_classes;
/* Here's where we control how name mangling takes place. */
-#define OPERATOR_ASSIGN_FORMAT "__a%s"
-#define OPERATOR_FORMAT "__%s"
-#define OPERATOR_TYPENAME_FORMAT "__op"
-
/* Cannot use '$' up front, because this confuses gdb
(names beginning with '$' are gdb-local identifiers).
@@ -3426,10 +3449,6 @@ extern varray_type local_classes;
/* Things for handling inline functions. */
-/* Negative values means we know `this' to be of static type. */
-
-extern int flag_this_is_variable;
-
/* Nonzero means do emit exported implementations of functions even if
they can be inlined. */
@@ -3453,8 +3472,10 @@ extern int flag_implicit_templates;
extern int flag_weak;
-/* Nonzero if we should expand functions calls inline at the tree
- level, rather than at the RTL level. */
+/* 0 if we should not perform inlining.
+ 1 if we should expand functions calls inline at the tree level.
+ 2 if we should consider *all* functions to be inline
+ candidates. */
extern int flag_inline_trees;
@@ -3487,7 +3508,10 @@ enum overload_flags { NO_SPECIAL = 0, DTOR_FLAG, OP_FLAG, TYPENAME_FLAG };
LOOKUP_ONLYCONVERTING means that non-conversion constructors are not tried.
DIRECT_BIND means that if a temporary is created, it should be created so
that it lives as long as the current variable bindings; otherwise it
- only lives until the end of the complete-expression.
+ only lives until the end of the complete-expression. It also forces
+ direct-initialization in cases where other parts of the compiler have
+ already generated a temporary, such as reference initialization and the
+ catch parameter.
LOOKUP_SPECULATIVELY means return NULL_TREE if we cannot find what we are
after. Note, LOOKUP_COMPLAIN is checked and error messages printed
before LOOKUP_SPECULATIVELY is checked.
@@ -3694,6 +3718,7 @@ extern int get_arglist_len_in_bytes PARAMS ((tree));
extern tree build_vfield_ref PARAMS ((tree, tree));
extern tree build_scoped_method_call PARAMS ((tree, tree, tree, tree));
+extern tree build_conditional_expr PARAMS ((tree, tree, tree));
extern tree build_addr_func PARAMS ((tree));
extern tree build_call PARAMS ((tree, tree));
extern tree build_method_call PARAMS ((tree, tree, tree, tree, int));
@@ -3724,7 +3749,6 @@ extern tree get_vtable_decl PARAMS ((tree, int));
extern void add_method PARAMS ((tree, tree, int));
extern int currently_open_class PARAMS ((tree));
extern tree currently_open_derived_class PARAMS ((tree));
-extern tree get_vfield_offset PARAMS ((tree));
extern void duplicate_tag_error PARAMS ((tree));
extern tree finish_struct PARAMS ((tree, tree));
extern void finish_struct_1 PARAMS ((tree));
@@ -3739,8 +3763,8 @@ extern void push_lang_context PARAMS ((tree));
extern void pop_lang_context PARAMS ((void));
extern tree instantiate_type PARAMS ((tree, tree, enum instantiate_type_flags));
extern void print_class_statistics PARAMS ((void));
-extern int first_vfun_index PARAMS ((tree));
extern void build_self_reference PARAMS ((void));
+extern int same_signature_p PARAMS ((tree, tree));
extern void warn_hidden PARAMS ((tree));
extern tree get_enclosing_class PARAMS ((tree));
int is_base_of_enclosing_class PARAMS ((tree, tree));
@@ -3756,6 +3780,7 @@ extern tree get_primary_binfo PARAMS ((tree));
/* in cvt.c */
extern tree convert_to_reference PARAMS ((tree, tree, int, int, tree));
extern tree convert_from_reference PARAMS ((tree));
+extern tree convert_lvalue PARAMS ((tree, tree));
extern tree convert_pointer_to_real PARAMS ((tree, tree));
extern tree convert_pointer_to PARAMS ((tree, tree));
extern tree ocp_convert PARAMS ((tree, tree, int, int));
@@ -3768,6 +3793,7 @@ extern tree build_expr_type_conversion PARAMS ((int, tree, int));
extern tree type_promotes_to PARAMS ((tree));
extern tree perform_qualification_conversions PARAMS ((tree, tree));
extern void clone_function_decl PARAMS ((tree, int));
+extern void adjust_clone_args PARAMS ((tree));
/* decl.c */
/* resume_binding_level */
@@ -3783,7 +3809,8 @@ extern void maybe_push_cleanup_level PARAMS ((tree));
extern void begin_scope PARAMS ((scope_kind));
extern void finish_scope PARAMS ((void));
extern void note_level_for_for PARAMS ((void));
-extern void note_level_for_eh PARAMS ((void));
+extern void note_level_for_try PARAMS ((void));
+extern void note_level_for_catch PARAMS ((void));
extern void resume_level PARAMS ((struct binding_level *));
extern void delete_block PARAMS ((tree));
extern void insert_block PARAMS ((tree));
@@ -3873,7 +3900,7 @@ extern tree xref_tag PARAMS ((tree, tree, int));
extern tree xref_tag_from_type PARAMS ((tree, tree, int));
extern void xref_basetypes PARAMS ((tree, tree, tree, tree));
extern tree start_enum PARAMS ((tree));
-extern tree finish_enum PARAMS ((tree));
+extern void finish_enum PARAMS ((tree));
extern void build_enumerator PARAMS ((tree, tree, tree));
extern int start_function PARAMS ((tree, tree, tree, int));
extern tree finish_function PARAMS ((int));
@@ -3938,8 +3965,7 @@ extern int copy_assignment_arg_p PARAMS ((tree, int));
extern void cplus_decl_attributes PARAMS ((tree, tree, tree));
extern tree constructor_name_full PARAMS ((tree));
extern tree constructor_name PARAMS ((tree));
-extern void setup_vtbl_ptr PARAMS ((tree, tree));
-extern void defer_fn PARAMS ((tree));
+extern void defer_fn PARAMS ((tree));
extern tree get_temp_name PARAMS ((tree));
extern void finish_anon_union PARAMS ((tree));
extern tree finish_table PARAMS ((tree, tree, tree, int));
@@ -4017,13 +4043,14 @@ extern void init_exception_processing PARAMS ((void));
extern tree expand_start_catch_block PARAMS ((tree));
extern void expand_end_catch_block PARAMS ((tree));
extern void expand_builtin_throw PARAMS ((void));
-extern tree expand_start_eh_spec PARAMS ((void));
-extern void expand_end_eh_spec PARAMS ((tree, tree));
+extern void expand_eh_spec_block PARAMS ((tree));
extern void expand_exception_blocks PARAMS ((void));
+extern tree build_exc_ptr PARAMS ((void));
extern tree build_throw PARAMS ((tree));
extern void mark_all_runtime_matches PARAMS ((void));
extern int nothrow_libfn_p PARAMS ((tree));
extern void check_handlers PARAMS ((tree));
+extern void choose_personality_routine PARAMS ((enum languages));
/* in expr.c */
extern void init_cplus_expand PARAMS ((void));
@@ -4097,22 +4124,14 @@ extern int cp_type_qual_from_rid PARAMS ((tree));
/* in method.c */
extern void init_method PARAMS ((void));
-extern char *build_overload_name PARAMS ((tree, int, int));
-extern tree build_static_name PARAMS ((tree, tree));
-extern tree build_decl_overload_real PARAMS ((tree, tree, tree, tree,
- tree, int));
extern void set_mangled_name_for_decl PARAMS ((tree));
-extern tree build_typename_overload PARAMS ((tree));
-extern tree build_overload_with_type PARAMS ((tree, tree));
-extern tree build_destructor_name PARAMS ((tree));
extern tree build_opfncall PARAMS ((enum tree_code, int, tree, tree, tree));
extern tree hack_identifier PARAMS ((tree, tree));
-extern tree make_thunk PARAMS ((tree, tree, tree, int));
+extern tree make_thunk PARAMS ((tree, tree, tree));
extern void use_thunk PARAMS ((tree, int));
extern void synthesize_method PARAMS ((tree));
-extern tree get_id_2 PARAMS ((const char *, tree));
extern tree implicitly_declare_fn PARAMS ((special_function_kind, tree, int));
-extern tree get_ctor_vtbl_name PARAMS ((tree, tree));
+extern tree skip_artificial_parms_for PARAMS ((tree, tree));
/* In optimize.c */
extern void optimize_function PARAMS ((tree));
@@ -4157,6 +4176,7 @@ extern void do_decl_instantiation PARAMS ((tree, tree, tree));
extern void do_type_instantiation PARAMS ((tree, tree, int));
extern tree instantiate_decl PARAMS ((tree, int));
extern tree get_bindings PARAMS ((tree, tree, tree));
+extern int push_tinst_level PARAMS ((tree));
extern void pop_tinst_level PARAMS ((void));
extern int more_specialized_class PARAMS ((tree, tree));
extern int is_member_template PARAMS ((tree));
@@ -4191,7 +4211,6 @@ extern tree get_tinfo_decl PARAMS((tree));
extern tree get_typeid PARAMS((tree));
extern tree get_typeid_1 PARAMS((tree));
extern tree build_dynamic_cast PARAMS((tree, tree));
-extern void synthesize_tinfo_fn PARAMS((tree));
extern void emit_support_tinfos PARAMS((void));
extern int tinfo_decl_p PARAMS((tree, void *));
extern int emit_tinfo_decl PARAMS((tree *, void *));
@@ -4226,6 +4245,7 @@ extern tree context_for_name_lookup PARAMS ((tree));
extern tree lookup_conversions PARAMS ((tree));
extern tree binfo_for_vtable PARAMS ((tree));
extern tree binfo_from_vbase PARAMS ((tree));
+extern tree look_for_overrides_here PARAMS ((tree, tree));
extern tree dfs_walk PARAMS ((tree,
tree (*) (tree, void *),
tree (*) (tree, void *),
@@ -4281,6 +4301,8 @@ extern tree finish_case_label PARAMS ((tree, tree));
extern tree finish_goto_stmt PARAMS ((tree));
extern tree begin_try_block PARAMS ((void));
extern void finish_try_block PARAMS ((tree));
+extern tree begin_eh_spec_block PARAMS ((void));
+extern void finish_eh_spec_block PARAMS ((tree, tree));
extern void finish_handler_sequence PARAMS ((tree));
extern tree begin_function_try_block PARAMS ((void));
extern void finish_function_try_block PARAMS ((tree));
@@ -4339,7 +4361,7 @@ extern void prep_stmt PARAMS ((tree));
extern void do_pushlevel PARAMS ((void));
extern tree do_poplevel PARAMS ((void));
extern void finish_mem_initializers PARAMS ((tree));
-
+extern void setup_vtbl_ptr PARAMS ((tree, tree));
extern void clear_out_block PARAMS ((void));
extern tree begin_global_stmt_expr PARAMS ((void));
extern tree finish_global_stmt_expr PARAMS ((tree));
@@ -4386,7 +4408,6 @@ extern int is_overloaded_fn PARAMS ((tree));
extern tree get_first_fn PARAMS ((tree));
extern int bound_pmf_p PARAMS ((tree));
extern tree ovl_cons PARAMS ((tree, tree));
-extern int ovl_member PARAMS ((tree, tree));
extern tree build_overload PARAMS ((tree, tree));
extern tree fnaddr_from_vtable_entry PARAMS ((tree));
extern tree function_arg_chain PARAMS ((tree));
@@ -4482,7 +4503,6 @@ extern tree build_x_unary_op PARAMS ((enum tree_code, tree));
extern tree unary_complex_lvalue PARAMS ((enum tree_code, tree));
extern int mark_addressable PARAMS ((tree));
extern tree build_x_conditional_expr PARAMS ((tree, tree, tree));
-extern tree build_conditional_expr PARAMS ((tree, tree, tree));
extern tree build_x_compound_expr PARAMS ((tree));
extern tree build_compound_expr PARAMS ((tree));
extern tree build_static_cast PARAMS ((tree, tree));
@@ -4500,9 +4520,8 @@ extern int cp_type_quals PARAMS ((tree));
extern int cp_has_mutable_p PARAMS ((tree));
extern int at_least_as_qualified_p PARAMS ((tree, tree));
extern int more_qualified_p PARAMS ((tree, tree));
-extern tree build_ptrmemfunc1 PARAMS ((tree, tree, tree, tree, tree));
-extern void expand_ptrmemfunc_cst PARAMS ((tree, tree *, tree *, tree *, tree *));
-extern tree delta2_from_ptrmemfunc PARAMS ((tree));
+extern tree build_ptrmemfunc1 PARAMS ((tree, tree, tree));
+extern void expand_ptrmemfunc_cst PARAMS ((tree, tree *, tree *));
extern tree pfn_from_ptrmemfunc PARAMS ((tree));
extern tree type_after_usual_arithmetic_conversions PARAMS ((tree, tree));
extern tree composite_pointer_type PARAMS ((tree, tree, tree, tree,
@@ -4552,7 +4571,7 @@ extern void GNU_xref_member PARAMS ((tree, tree));
/* in mangle.c */
extern void init_mangle PARAMS ((void));
-extern tree mangle_decl PARAMS ((tree));
+extern void mangle_decl PARAMS ((tree));
extern const char *mangle_type_string PARAMS ((tree));
extern tree mangle_type PARAMS ((tree));
extern tree mangle_typeinfo_for_type PARAMS ((tree));
diff --git a/gcc/cp/cvt.c b/gcc/cp/cvt.c
index 9fa2a665e15..c03090c1677 100644
--- a/gcc/cp/cvt.c
+++ b/gcc/cp/cvt.c
@@ -258,7 +258,7 @@ cp_convert_to_pointer (type, expr, force)
if (TYPE_PTRMEMFUNC_P (type))
return build_ptrmemfunc (TYPE_PTRMEMFUNC_FN_TYPE (type), expr, 0);
- if (flag_new_abi && TYPE_PTRMEM_P (type))
+ if (TYPE_PTRMEM_P (type))
/* Under the new ABI, a NULL pointer-to-member is represented
by -1, not by zero. */
expr = build_int_2 (-1, -1);
@@ -597,6 +597,20 @@ convert_from_reference (val)
return build_indirect_ref (val, NULL_PTR);
return val;
}
+
+/* Implicitly convert the lvalue EXPR to another lvalue of type TOTYPE,
+ preserving cv-qualification. */
+
+tree
+convert_lvalue (totype, expr)
+ tree totype, expr;
+{
+ totype = cp_build_qualified_type (totype, TYPE_QUALS (TREE_TYPE (expr)));
+ totype = build_reference_type (totype);
+ expr = convert_to_reference (totype, expr, CONV_IMPLICIT, LOOKUP_NORMAL,
+ NULL_TREE);
+ return convert_from_reference (expr);
+}
/* Call this when we know (for any reason) that expr is not, in fact,
zero. This routine is like convert_pointer_to, but it pays
@@ -922,8 +936,13 @@ convert_to_void (expr, implicit)
tree new_op1 = convert_to_void (op1, implicit);
if (new_op1 != op1)
- expr = build (COMPOUND_EXPR, TREE_TYPE (new_op1),
- TREE_OPERAND (expr, 0), new_op1);
+ {
+ tree t = build (COMPOUND_EXPR, TREE_TYPE (new_op1),
+ TREE_OPERAND (expr, 0), new_op1);
+ TREE_SIDE_EFFECTS (t) = TREE_SIDE_EFFECTS (expr);
+ expr = t;
+ }
+
break;
}
@@ -1258,7 +1277,7 @@ type_promotes_to (type)
else
type = totype;
}
- else if (C_PROMOTING_INTEGER_TYPE_P (type))
+ else if (c_promoting_integer_type_p (type))
{
/* Retain unsignedness if really not getting bigger. */
if (TREE_UNSIGNED (type)
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index dcf84e6ddac..9da85542321 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -51,15 +51,10 @@ extern tree global_namespace;
extern int (*valid_lang_attribute) PARAMS ((tree, tree, tree, tree));
#ifndef BOOL_TYPE_SIZE
-#ifdef SLOW_BYTE_ACCESS
/* In the new ABI, `bool' has size and alignment `1', on all
platforms. */
-#define BOOL_TYPE_SIZE \
- ((SLOW_BYTE_ACCESS && !flag_new_abi) ? (POINTER_SIZE) : (CHAR_TYPE_SIZE))
-#else
#define BOOL_TYPE_SIZE CHAR_TYPE_SIZE
#endif
-#endif
static tree grokparms PARAMS ((tree));
static const char *redeclaration_error_message PARAMS ((tree, tree));
@@ -80,8 +75,9 @@ static tree store_bindings PARAMS ((tree, tree));
static tree lookup_tag_reverse PARAMS ((tree, tree));
static tree obscure_complex_init PARAMS ((tree, tree));
static tree lookup_name_real PARAMS ((tree, int, int, int));
+static void push_local_name PARAMS ((tree));
static void warn_extern_redeclared_static PARAMS ((tree, tree));
-static void grok_reference_init PARAMS ((tree, tree, tree));
+static tree grok_reference_init PARAMS ((tree, tree, tree));
static tree grokfndecl PARAMS ((tree, tree, tree, tree, int,
enum overload_flags, tree,
tree, int, int, int, int, int, int, tree));
@@ -98,7 +94,7 @@ static void bad_specifiers PARAMS ((tree, const char *, int, int, int, int,
static tree maybe_process_template_type_declaration PARAMS ((tree, int, struct binding_level*));
static void check_for_uninitialized_const_var PARAMS ((tree));
static unsigned long typename_hash PARAMS ((hash_table_key));
-static boolean typename_compare PARAMS ((hash_table_key, hash_table_key));
+static bool typename_compare PARAMS ((hash_table_key, hash_table_key));
static void push_binding PARAMS ((tree, tree, struct binding_level*));
static int add_binding PARAMS ((tree, tree));
static void pop_binding PARAMS ((tree, tree));
@@ -149,7 +145,7 @@ static void end_cleanup_fn PARAMS ((void));
static tree cp_make_fname_decl PARAMS ((tree, const char *, int));
static void initialize_predefined_identifiers PARAMS ((void));
static tree check_special_function_return_type
- PARAMS ((special_function_kind, tree, tree, tree));
+ PARAMS ((special_function_kind, tree, tree));
static tree push_cp_library_fn PARAMS ((enum tree_code, tree));
static tree build_cp_library_fn PARAMS ((tree, enum tree_code, tree));
static void store_parm_decls PARAMS ((tree));
@@ -252,6 +248,8 @@ struct named_label_use_list
#define named_label_uses cp_function_chain->x_named_label_uses
+#define local_names cp_function_chain->x_local_names
+
/* 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
@@ -284,8 +282,9 @@ struct named_label_list
tree old_value;
tree label_decl;
tree bad_decls;
- int eh_region;
struct named_label_list *next;
+ unsigned int in_try_scope : 1;
+ unsigned int in_catch_scope : 1;
};
#define named_labels cp_function_chain->x_named_labels
@@ -458,12 +457,15 @@ struct binding_level
worry about ambiguous (ARM or ISO) scope rules. */
unsigned is_for_scope : 1;
- /* True if this level corresponds to an EH region, as for a try block.
- Currently this information is only available while building the
- tree structure. */
- unsigned eh_region : 1;
+ /* True if this level corresponds to a TRY block. Currently this
+ information is only available while building the tree structure. */
+ unsigned is_try_scope : 1;
+
+ /* True if this level corresponds to a CATCH block. Currently this
+ information is only available while building the tree structure. */
+ unsigned is_catch_scope : 1;
- /* Four bits left for this word. */
+ /* Three bits left for this word. */
#if defined(DEBUG_CP_BINDING_LEVELS)
/* Binding depth at which this level began. */
@@ -476,7 +478,7 @@ struct binding_level
/* The binding level currently in effect. */
#define current_binding_level \
- (cfun \
+ (cfun && cp_function_chain->bindings \
? cp_function_chain->bindings \
: scope_chain->bindings)
@@ -922,9 +924,17 @@ note_level_for_for ()
/* Record that the current binding level represents a try block. */
void
-note_level_for_eh ()
+note_level_for_try ()
+{
+ current_binding_level->is_try_scope = 1;
+}
+
+/* Record that the current binding level represents a catch block. */
+
+void
+note_level_for_catch ()
{
- current_binding_level->eh_region = 1;
+ current_binding_level->is_catch_scope = 1;
}
/* For a binding between a name and an entity at a block scope,
@@ -1328,8 +1338,10 @@ poplevel (keep, reverse, functionbody)
if (labels->binding_level == current_binding_level)
{
tree decl;
- if (current_binding_level->eh_region)
- labels->eh_region = 1;
+ if (current_binding_level->is_try_scope)
+ labels->in_try_scope = 1;
+ if (current_binding_level->is_catch_scope)
+ labels->in_catch_scope = 1;
for (decl = labels->names_in_scope; decl;
decl = TREE_CHAIN (decl))
if (decl_jump_unsafe (decl))
@@ -2755,6 +2767,41 @@ create_implicit_typedef (name, type)
return decl;
}
+/* Remember a local name for name-mangling purposes. */
+
+static void
+push_local_name (decl)
+ tree decl;
+{
+ size_t i, nelts;
+ tree t, name;
+
+ if (!local_names)
+ VARRAY_TREE_INIT (local_names, 8, "local_names");
+
+ name = DECL_NAME (decl);
+
+ nelts = VARRAY_ACTIVE_SIZE (local_names);
+ for (i = 0; i < nelts; i++)
+ {
+ t = VARRAY_TREE (local_names, i);
+ if (DECL_NAME (t) == name)
+ {
+ if (!DECL_LANG_SPECIFIC (decl))
+ retrofit_lang_decl (decl);
+ if (DECL_LANG_SPECIFIC (t))
+ DECL_DISCRIMINATOR (decl) = DECL_DISCRIMINATOR (t) + 1;
+ else
+ DECL_DISCRIMINATOR (decl) = 1;
+
+ VARRAY_TREE (local_names, i) = decl;
+ return;
+ }
+ }
+
+ VARRAY_PUSH_TREE (local_names, decl);
+}
+
/* Push a tag name NAME for struct/class/union/enum type TYPE.
Normally put it into the inner-most non-tag-transparent scope,
but if GLOBALIZE is true, put it in the inner-most non-class scope.
@@ -2769,7 +2816,13 @@ pushtag (name, type, globalize)
b = current_binding_level;
while (b->tag_transparent
- || (globalize && b->parm_flag == 2))
+ || (b->parm_flag == 2
+ && (globalize
+ /* We may be defining a new type in the initializer
+ of a static member variable. We allow this when
+ not pedantic, and it is particularly useful for
+ type punning via an anonymous union. */
+ || COMPLETE_TYPE_P (b->this_class))))
b = b->level_chain;
b->tags = tree_cons (name, type, b->tags);
@@ -2827,11 +2880,11 @@ pushtag (name, type, globalize)
else
d = pushdecl_with_scope (d, b);
+ /* FIXME what if it gets a name from typedef? */
if (ANON_AGGRNAME_P (name))
DECL_IGNORED_P (d) = 1;
TYPE_CONTEXT (type) = DECL_CONTEXT (d);
- DECL_ASSEMBLER_NAME (d) = DECL_NAME (d);
/* If this is a local class, keep track of it. We need this
information for name-mangling, and so that it is possible to find
@@ -2842,15 +2895,6 @@ pushtag (name, type, globalize)
&& TREE_CODE (TYPE_CONTEXT (type)) == FUNCTION_DECL
&& !processing_template_decl)
VARRAY_PUSH_TREE (local_classes, type);
-
- if (!uses_template_parms (type))
- {
- if (flag_new_abi)
- DECL_ASSEMBLER_NAME (d) = mangle_type (type);
- else
- DECL_ASSEMBLER_NAME (d)
- = get_identifier (build_overload_name (type, 1, 1));
- }
}
if (b->parm_flag == 2)
{
@@ -3169,9 +3213,9 @@ duplicate_decls (newdecl, olddecl)
/* Make the old declaration consistent with the new one so
that all remnants of the builtin-ness of this function
will be banished. */
- DECL_LANGUAGE (olddecl) = DECL_LANGUAGE (newdecl);
- DECL_RTL (olddecl) = DECL_RTL (newdecl);
- DECL_ASSEMBLER_NAME (olddecl) = DECL_ASSEMBLER_NAME (newdecl);
+ SET_DECL_LANGUAGE (olddecl, DECL_LANGUAGE (newdecl));
+ SET_DECL_RTL (olddecl, DECL_RTL (newdecl));
+ COPY_DECL_ASSEMBLER_NAME (olddecl, newdecl);
SET_IDENTIFIER_GLOBAL_VALUE (DECL_ASSEMBLER_NAME (newdecl),
newdecl);
}
@@ -3329,7 +3373,7 @@ duplicate_decls (newdecl, olddecl)
is OK. */
if (current_lang_stack
== &VARRAY_TREE (current_lang_base, 0))
- DECL_LANGUAGE (newdecl) = DECL_LANGUAGE (olddecl);
+ SET_DECL_LANGUAGE (newdecl, DECL_LANGUAGE (olddecl));
else
{
cp_error_at ("previous declaration of `%#D' with %L linkage",
@@ -3374,7 +3418,8 @@ duplicate_decls (newdecl, olddecl)
}
}
- if (DECL_THIS_INLINE (newdecl) && ! DECL_THIS_INLINE (olddecl)
+ if (DECL_DECLARED_INLINE_P (newdecl)
+ && ! DECL_DECLARED_INLINE_P (olddecl)
&& TREE_ADDRESSABLE (olddecl) && warn_inline)
{
cp_warning ("`%#D' was used before it was declared inline",
@@ -3410,7 +3455,9 @@ duplicate_decls (newdecl, olddecl)
DECL_VIRTUAL_P (newdecl) |= DECL_VIRTUAL_P (olddecl);
DECL_NEEDS_FINAL_OVERRIDER_P (newdecl) |= DECL_NEEDS_FINAL_OVERRIDER_P (olddecl);
DECL_THIS_STATIC (newdecl) |= DECL_THIS_STATIC (olddecl);
- DECL_LANG_SPECIFIC (newdecl)->u2 = DECL_LANG_SPECIFIC (olddecl)->u2;
+ if (DECL_OVERLOADED_OPERATOR_P (olddecl) != ERROR_MARK)
+ SET_OVERLOADED_OPERATOR_CODE
+ (newdecl, DECL_OVERLOADED_OPERATOR_P (olddecl));
new_defines_function = DECL_INITIAL (newdecl) != NULL_TREE;
/* Optionally warn about more than one declaration for the same
@@ -3457,6 +3504,19 @@ duplicate_decls (newdecl, olddecl)
= chainon (DECL_TEMPLATE_SPECIALIZATIONS (olddecl),
DECL_TEMPLATE_SPECIALIZATIONS (newdecl));
+ /* If the new declaration is a definition, update the file and
+ line information on the declaration. */
+ if (DECL_INITIAL (DECL_TEMPLATE_RESULT (olddecl)) == NULL_TREE
+ && DECL_INITIAL (DECL_TEMPLATE_RESULT (newdecl)) != NULL_TREE)
+ {
+ DECL_SOURCE_LINE (olddecl)
+ = DECL_SOURCE_LINE (DECL_TEMPLATE_RESULT (olddecl))
+ = DECL_SOURCE_LINE (newdecl);
+ DECL_SOURCE_FILE (olddecl)
+ = DECL_SOURCE_FILE (DECL_TEMPLATE_RESULT (olddecl))
+ = DECL_SOURCE_FILE (newdecl);
+ }
+
return 1;
}
@@ -3541,7 +3601,7 @@ duplicate_decls (newdecl, olddecl)
DECL_SECTION_NAME (newdecl) = DECL_SECTION_NAME (olddecl);
/* Keep the old rtl since we can safely use it. */
- DECL_RTL (newdecl) = DECL_RTL (olddecl);
+ COPY_DECL_RTL (olddecl, newdecl);
if (TREE_CODE (newdecl) == FUNCTION_DECL)
{
@@ -3627,7 +3687,7 @@ duplicate_decls (newdecl, olddecl)
SET_DECL_TEMPLATE_SPECIALIZATION (olddecl);
}
- DECL_THIS_INLINE (newdecl) |= DECL_THIS_INLINE (olddecl);
+ DECL_DECLARED_INLINE_P (newdecl) |= DECL_DECLARED_INLINE_P (olddecl);
/* If either decl says `inline', this fn is inline, unless its
definition was passed already. */
@@ -3635,11 +3695,14 @@ duplicate_decls (newdecl, olddecl)
DECL_INLINE (olddecl) = 1;
DECL_INLINE (newdecl) = DECL_INLINE (olddecl);
+ /* Preserve abstractness on cloned [cd]tors. */
+ DECL_ABSTRACT (newdecl) = DECL_ABSTRACT (olddecl);
+
if (! types_match)
{
- DECL_LANGUAGE (olddecl) = DECL_LANGUAGE (newdecl);
- DECL_ASSEMBLER_NAME (olddecl) = DECL_ASSEMBLER_NAME (newdecl);
- DECL_RTL (olddecl) = DECL_RTL (newdecl);
+ SET_DECL_LANGUAGE (olddecl, DECL_LANGUAGE (newdecl));
+ COPY_DECL_ASSEMBLER_NAME (newdecl, olddecl);
+ SET_DECL_RTL (olddecl, DECL_RTL (newdecl));
}
if (! types_match || new_defines_function)
{
@@ -3652,7 +3715,7 @@ duplicate_decls (newdecl, olddecl)
if (new_defines_function)
/* If defining a function declared with other language
linkage, use the previously declared language linkage. */
- DECL_LANGUAGE (newdecl) = DECL_LANGUAGE (olddecl);
+ SET_DECL_LANGUAGE (newdecl, DECL_LANGUAGE (olddecl));
else if (types_match)
{
/* If redeclaring a builtin function, and not a definition,
@@ -3663,10 +3726,10 @@ duplicate_decls (newdecl, olddecl)
DECL_FUNCTION_CODE (newdecl) = DECL_FUNCTION_CODE (olddecl);
/* If we're keeping the built-in definition, keep the rtl,
regardless of declaration matches. */
- DECL_RTL (newdecl) = DECL_RTL (olddecl);
+ SET_DECL_RTL (newdecl, DECL_RTL (olddecl));
}
else
- DECL_FRAME_SIZE (newdecl) = DECL_FRAME_SIZE (olddecl);
+ DECL_NUM_STMTS (newdecl) = DECL_NUM_STMTS (olddecl);
DECL_RESULT (newdecl) = DECL_RESULT (olddecl);
if ((DECL_SAVED_INSNS (newdecl) = DECL_SAVED_INSNS (olddecl)))
@@ -3678,17 +3741,14 @@ duplicate_decls (newdecl, olddecl)
DECL_ARGUMENTS (newdecl) = DECL_ARGUMENTS (olddecl);
}
}
-
- if (TREE_CODE (newdecl) == NAMESPACE_DECL)
- {
- NAMESPACE_LEVEL (newdecl) = NAMESPACE_LEVEL (olddecl);
- }
+ else if (TREE_CODE (newdecl) == NAMESPACE_DECL)
+ NAMESPACE_LEVEL (newdecl) = NAMESPACE_LEVEL (olddecl);
/* Now preserve various other info from the definition. */
TREE_ADDRESSABLE (newdecl) = TREE_ADDRESSABLE (olddecl);
TREE_ASM_WRITTEN (newdecl) = TREE_ASM_WRITTEN (olddecl);
DECL_COMMON (newdecl) = DECL_COMMON (olddecl);
- DECL_ASSEMBLER_NAME (newdecl) = DECL_ASSEMBLER_NAME (olddecl);
+ COPY_DECL_ASSEMBLER_NAME (olddecl, newdecl);
if (TREE_CODE (newdecl) == FUNCTION_DECL)
{
@@ -3851,8 +3911,7 @@ pushdecl (x)
if (TREE_CODE (x) == FUNCTION_DECL)
for (match = t; match; match = OVL_NEXT (match))
{
- if (DECL_ASSEMBLER_NAME (OVL_CURRENT (t))
- == DECL_ASSEMBLER_NAME (x))
+ if (decls_match (OVL_CURRENT (match), x))
break;
}
else
@@ -3942,7 +4001,7 @@ pushdecl (x)
if (DECL_NON_THUNK_FUNCTION_P (x) && ! DECL_LANG_SPECIFIC (x))
{
retrofit_lang_decl (x);
- DECL_LANGUAGE (x) = lang_c;
+ SET_DECL_LANGUAGE (x, lang_c);
}
if (DECL_NON_THUNK_FUNCTION_P (x) && ! DECL_FUNCTION_MEMBER_P (x))
@@ -4033,32 +4092,15 @@ pushdecl (x)
if (IDENTIFIER_GLOBAL_VALUE (name) == NULL_TREE && TREE_PUBLIC (x))
TREE_PUBLIC (name) = 1;
- /* Bind the mangled name for the entity. In the future, we
- should not need to do this; mangled names are an
- implementation detail of which the front-end should not
- need to be aware. */
- if (!(TREE_CODE (x) == TYPE_DECL && DECL_ARTIFICIAL (x)
- && t != NULL_TREE)
- /* For an ordinary function, we create a binding from
- the mangled name (i.e., NAME) to the DECL. But, for
- an `extern "C"' function, the mangled name and the
- ordinary name are the same so we need not do this. */
- && !DECL_EXTERN_C_FUNCTION_P (x))
- {
- tree mangled_name;
-
- if (TREE_CODE (x) == TYPE_DECL || TREE_CODE (x) == VAR_DECL
- || TREE_CODE (x) == NAMESPACE_DECL)
- mangled_name = name;
- else
- mangled_name = DECL_ASSEMBLER_NAME (x);
-
- if (TREE_CODE (x) == FUNCTION_DECL)
- my_friendly_assert
- ((IDENTIFIER_GLOBAL_VALUE (mangled_name) == NULL_TREE)
- || (IDENTIFIER_GLOBAL_VALUE (mangled_name) == x), 378);
- SET_IDENTIFIER_NAMESPACE_VALUE (mangled_name, x);
- }
+ /* Bind the name for the entity. */
+ if (!(TREE_CODE (x) == TYPE_DECL && DECL_ARTIFICIAL (x)
+ && t != NULL_TREE)
+ && (TREE_CODE (x) == TYPE_DECL
+ || TREE_CODE (x) == VAR_DECL
+ || TREE_CODE (x) == NAMESPACE_DECL
+ || TREE_CODE (x) == CONST_DECL
+ || TREE_CODE (x) == TEMPLATE_DECL))
+ SET_IDENTIFIER_NAMESPACE_VALUE (name, x);
/* Don't forget if the function was used via an implicit decl. */
if (IDENTIFIER_IMPLICIT_DECL (name)
@@ -4938,10 +4980,7 @@ check_previous_goto_1 (decl, level, names, file, line)
identified = 1;
}
- if (problem > 1 && DECL_ARTIFICIAL (new_decls))
- /* Can't skip init of __exception_info. */
- cp_error_at (" enters catch block", new_decls);
- else if (problem > 1)
+ if (problem > 1)
cp_error_at (" crosses initialization of `%#D'",
new_decls);
else
@@ -4951,7 +4990,7 @@ check_previous_goto_1 (decl, level, names, file, line)
if (b == level)
break;
- if (b->eh_region && ! saw_eh)
+ if ((b->is_try_scope || b->is_catch_scope) && ! saw_eh)
{
if (! identified)
{
@@ -4964,7 +5003,10 @@ check_previous_goto_1 (decl, level, names, file, line)
pedwarn_with_file_and_line (file, line, " from here");
identified = 1;
}
- error (" enters try block");
+ if (b->is_try_scope)
+ error (" enters try block");
+ else
+ error (" enters catch block");
saw_eh = 1;
}
}
@@ -5043,7 +5085,8 @@ check_goto (decl)
if (lab == 0)
return;
- if ((lab->eh_region || lab->bad_decls) && !identified)
+ if ((lab->in_try_scope || lab->in_catch_scope || lab->bad_decls)
+ && !identified)
{
cp_pedwarn_at ("jump to label `%D'", decl);
pedwarn (" from here");
@@ -5064,8 +5107,10 @@ check_goto (decl)
cp_pedwarn_at (" enters scope of non-POD `%#D'", b);
}
- if (lab->eh_region)
+ if (lab->in_try_scope)
error (" enters try block");
+ else if (lab->in_catch_scope)
+ error (" enters catch block");
}
/* Define a label, specifying the location in the source file.
@@ -5500,7 +5545,7 @@ typename_hash (k)
/* Compare two TYPENAME_TYPEs. K1 and K2 are really of type `tree'. */
-static boolean
+static bool
typename_compare (k1, k2)
hash_table_key k1;
hash_table_key k2;
@@ -6281,7 +6326,6 @@ initialize_predefined_identifiers ()
{ VTABLE_PFN_NAME, &pfn_identifier, 0 },
{ "__pfn_or_delta2", &pfn_or_delta2_identifier, 0 },
{ "_vptr", &vptr_identifier, 0 },
- { "__cp_push_exception", &cp_push_exception_identifier, 0 },
{ "__vtt_parm", &vtt_parm_identifier, 0 },
{ "std", &std_identifier, 0 },
{ NULL, NULL, 0 }
@@ -6307,8 +6351,8 @@ init_decl_processing ()
/* Check to see that the user did not specify an invalid combination
of command-line options. */
- if (flag_new_abi && !flag_vtable_thunks)
- error ("the new ABI requires vtable thunks");
+ if (!flag_vtable_thunks)
+ error ("the ABI requires vtable thunks");
/* Create all the identifiers we need. */
initialize_predefined_identifiers ();
@@ -6338,7 +6382,21 @@ init_decl_processing ()
if (! flag_permissive && ! pedantic)
flag_pedantic_errors = 1;
if (!flag_no_inline)
- flag_inline_trees = 1;
+ {
+ flag_inline_trees = 1;
+ flag_no_inline = 1;
+ }
+ if (flag_inline_functions)
+ {
+ flag_inline_trees = 2;
+ flag_inline_functions = 0;
+ }
+
+ /* In C++, we never create builtin functions whose name does not
+ begin with `__'. Users should be using headers to get prototypes
+ in C++. It would be nice if we could warn when `-fbuiltin' is
+ used explicitly, but we do not have that information. */
+ flag_no_builtin = 1;
/* Initially, C. */
current_lang_name = lang_name_c;
@@ -6411,17 +6469,8 @@ init_decl_processing ()
record_builtin_type (RID_MAX, NULL_PTR, string_type_node);
#endif
- if (flag_new_abi)
- delta_type_node = ptrdiff_type_node;
- else if (flag_huge_objects)
- delta_type_node = long_integer_type_node;
- else
- delta_type_node = short_integer_type_node;
-
- if (flag_new_abi)
- vtable_index_type = ptrdiff_type_node;
- else
- vtable_index_type = delta_type_node;
+ delta_type_node = ptrdiff_type_node;
+ vtable_index_type = ptrdiff_type_node;
vtt_parm_type = build_pointer_type (const_ptr_type_node);
lang_type_promotes_to = convert_type_from_ellipsis;
@@ -6490,12 +6539,9 @@ init_decl_processing ()
layout_type (vtbl_ptr_type_node);
record_builtin_type (RID_MAX, NULL_PTR, vtbl_ptr_type_node);
- if (flag_new_abi)
- {
- push_namespace (get_identifier ("__cxxabiv1"));
- abi_node = current_namespace;
- pop_namespace ();
- }
+ push_namespace (get_identifier ("__cxxabiv1"));
+ abi_node = current_namespace;
+ pop_namespace ();
global_type_node = make_node (LANG_TYPE);
record_unknown_type (global_type_node, "global type");
@@ -6521,10 +6567,7 @@ init_decl_processing ()
}
abort_fndecl
- = build_library_fn_ptr ((flag_new_abi
- ? "__cxa_pure_virtual"
- : "__pure_virtual"),
- void_ftype);
+ = build_library_fn_ptr ("__cxa_pure_virtual", void_ftype);
/* Perform other language dependent initializations. */
init_class_processing ();
@@ -6534,10 +6577,6 @@ init_decl_processing ()
if (flag_exceptions)
init_exception_processing ();
- if (flag_no_inline)
- {
- flag_inline_functions = 0;
- }
if (! supports_one_only ())
flag_weak = 0;
@@ -6629,6 +6668,7 @@ cp_make_fname_decl (id, name, type_dep)
DECL_SOURCE_LINE (decl) = 0;
DECL_ARTIFICIAL (decl) = 1;
DECL_IN_SYSTEM_HEADER (decl) = 1;
+ DECL_IGNORED_P (decl) = 1;
pushdecl (decl);
if (processing_template_decl)
decl = push_template_decl (decl);
@@ -6689,7 +6729,7 @@ builtin_function (name, type, code, class, libname)
we cannot change DECL_ASSEMBLER_NAME until we have installed this
function in the namespace. */
if (libname)
- DECL_ASSEMBLER_NAME (decl) = get_identifier (libname);
+ SET_DECL_ASSEMBLER_NAME (decl, get_identifier (libname));
make_decl_rtl (decl, NULL);
/* Warn if a function in the namespace for users
@@ -6715,6 +6755,7 @@ build_library_fn_1 (name, operator_code, type)
DECL_ARTIFICIAL (fn) = 1;
TREE_NOTHROW (fn) = 1;
SET_OVERLOADED_OPERATOR_CODE (fn, operator_code);
+ SET_DECL_LANGUAGE (fn, lang_c);
return fn;
}
@@ -6727,9 +6768,7 @@ build_library_fn (name, type)
tree name;
tree type;
{
- tree fn = build_library_fn_1 (name, ERROR_MARK, type);
- make_decl_rtl (fn, NULL);
- return fn;
+ return build_library_fn_1 (name, ERROR_MARK, type);
}
/* Returns the _DECL for a library function with C++ linkage. */
@@ -6743,8 +6782,8 @@ build_cp_library_fn (name, operator_code, type)
tree fn = build_library_fn_1 (name, operator_code, type);
TREE_NOTHROW (fn) = TYPE_NOTHROW_P (type);
DECL_CONTEXT (fn) = FROB_CONTEXT (current_namespace);
+ SET_DECL_LANGUAGE (fn, lang_cplusplus);
set_mangled_name_for_decl (fn);
- make_decl_rtl (fn, NULL);
return fn;
}
@@ -6859,6 +6898,33 @@ fixup_anonymous_aggr (t)
/* ISO C++ 9.5.3. Anonymous unions may not have function members. */
if (TYPE_METHODS (t))
cp_error_at ("an anonymous union cannot have function members", t);
+
+ /* Anonymous aggregates cannot have fields with ctors, dtors or complex
+ assignment operators (because they cannot have these methods themselves).
+ For anonymous unions this is already checked because they are not allowed
+ in any union, otherwise we have to check it. */
+ if (TREE_CODE (t) != UNION_TYPE)
+ {
+ tree field, type;
+
+ for (field = TYPE_FIELDS (t); field; field = TREE_CHAIN (field))
+ if (TREE_CODE (field) == FIELD_DECL)
+ {
+ type = TREE_TYPE (field);
+ if (CLASS_TYPE_P (type))
+ {
+ if (TYPE_NEEDS_CONSTRUCTING (type))
+ cp_error_at ("member %#D' with constructor not allowed in anonymous aggregate",
+ field);
+ if (TYPE_HAS_NONTRIVIAL_DESTRUCTOR (type))
+ cp_error_at ("member %#D' with destructor not allowed in anonymous aggregate",
+ field);
+ if (TYPE_HAS_COMPLEX_ASSIGN_REF (type))
+ cp_error_at ("member %#D' with copy assignment operator not allowed in anonymous aggregate",
+ field);
+ }
+ }
+ }
}
/* Make sure that a declaration with no declarator is well-formed, i.e.
@@ -6872,6 +6938,7 @@ check_tag_decl (declspecs)
{
int found_type = 0;
int saw_friend = 0;
+ int saw_typedef = 0;
tree ob_modifier = NULL_TREE;
register tree link;
register tree t = NULL_TREE;
@@ -6903,6 +6970,8 @@ check_tag_decl (declspecs)
t = value;
}
}
+ else if (value == ridpointers[(int) RID_TYPEDEF])
+ saw_typedef = 1;
else if (value == ridpointers[(int) RID_FRIEND])
{
if (current_class_type == NULL_TREE
@@ -6929,13 +6998,31 @@ check_tag_decl (declspecs)
if (t == NULL_TREE && ! saw_friend)
pedwarn ("declaration does not declare anything");
- /* Check for an anonymous union. We're careful
- accessing TYPE_IDENTIFIER because some built-in types, like
- pointer-to-member types, do not have TYPE_NAME. */
+ /* Check for an anonymous union. */
else if (t && IS_AGGR_TYPE_CODE (TREE_CODE (t))
- && TYPE_NAME (t)
- && ANON_AGGRNAME_P (TYPE_IDENTIFIER (t)))
- {
+ && TYPE_ANONYMOUS_P (t))
+ {
+ /* 7/3 In a simple-declaration, the optional init-declarator-list
+ can be omitted only when declaring a class (clause 9) or
+ enumeration (7.2), that is, when the decl-specifier-seq contains
+ either a class-specifier, an elaborated-type-specifier with
+ a class-key (9.1), or an enum-specifier. In these cases and
+ whenever a class-specifier or enum-specifier is present in the
+ decl-specifier-seq, the identifiers in these specifiers are among
+ the names being declared by the declaration (as class-name,
+ enum-names, or enumerators, depending on the syntax). In such
+ cases, and except for the declaration of an unnamed bit-field (9.6),
+ the decl-specifier-seq shall introduce one or more names into the
+ program, or shall redeclare a name introduced by a previous
+ declaration. [Example:
+ enum { }; // ill-formed
+ typedef class { }; // ill-formed
+ --end example] */
+ if (saw_typedef)
+ {
+ error ("Missing type-name in typedef-declaration.");
+ return NULL_TREE;
+ }
/* Anonymous unions are objects, so they can have specifiers. */;
SET_ANON_AGGR_TYPE_P (t);
@@ -7285,7 +7372,7 @@ start_decl_1 (decl)
Quotes on semantics can be found in ARM 8.4.3. */
-static void
+static tree
grok_reference_init (decl, type, init)
tree decl, type, init;
{
@@ -7297,16 +7384,16 @@ grok_reference_init (decl, type, init)
|| DECL_IN_AGGR_P (decl) == 0)
&& ! DECL_THIS_EXTERN (decl))
cp_error ("`%D' declared as reference but not initialized", decl);
- return;
+ return NULL_TREE;
}
if (init == error_mark_node)
- return;
+ return NULL_TREE;
if (TREE_CODE (init) == CONSTRUCTOR)
{
cp_error ("ISO C++ forbids use of initializer list to initialize reference `%D'", decl);
- return;
+ return NULL_TREE;
}
if (TREE_CODE (init) == TREE_LIST)
@@ -7335,32 +7422,28 @@ grok_reference_init (decl, type, init)
decl);
if (tmp == error_mark_node)
- return;
- else if (tmp != NULL_TREE)
- {
- init = tmp;
- tmp = save_expr (tmp);
- if (building_stmt_tree ())
- {
- /* Initialize the declaration. */
- tmp = build (INIT_EXPR, TREE_TYPE (decl), decl, tmp);
- finish_expr_stmt (tmp);
- }
- else
- DECL_INITIAL (decl) = tmp;
- }
- else
+ return NULL_TREE;
+ else if (tmp == NULL_TREE)
{
cp_error ("cannot initialize `%T' from `%T'", type, TREE_TYPE (init));
- return;
+ return NULL_TREE;
}
- if (TREE_STATIC (decl) && ! TREE_CONSTANT (DECL_INITIAL (decl)))
+ init = tmp;
+ tmp = save_expr (tmp);
+ if (TREE_STATIC (decl) && !TREE_CONSTANT (tmp))
+ return tmp;
+
+ if (building_stmt_tree ())
{
- expand_static_init (decl, DECL_INITIAL (decl));
- DECL_INITIAL (decl) = NULL_TREE;
+ /* Initialize the declaration. */
+ tmp = build (INIT_EXPR, TREE_TYPE (decl), decl, tmp);
+ finish_expr_stmt (tmp);
}
- return;
+ else
+ DECL_INITIAL (decl) = tmp;
+
+ return NULL_TREE;
}
/* Fill in DECL_INITIAL with some magical value to prevent expand_decl from
@@ -7486,6 +7569,12 @@ layout_var_decl (decl)
else
cp_error ("storage size of `%D' isn't constant", decl);
}
+
+ if (TREE_STATIC (decl)
+ && !DECL_ARTIFICIAL (decl)
+ && current_function_decl
+ && DECL_CONTEXT (decl) == current_function_decl)
+ push_local_name (decl);
}
/* If a local static variable is declared in an inline function, or if
@@ -7503,16 +7592,10 @@ maybe_commonize_var (decl)
&& ! DECL_ARTIFICIAL (decl)
&& current_function_decl
&& DECL_CONTEXT (decl) == current_function_decl
- && (DECL_THIS_INLINE (current_function_decl)
+ && (DECL_DECLARED_INLINE_P (current_function_decl)
|| DECL_TEMPLATE_INSTANTIATION (current_function_decl))
&& TREE_PUBLIC (current_function_decl))
{
- /* Rather than try to get this right with inlining, we suppress
- inlining of such functions. */
- current_function_cannot_inline
- = "function with static variable cannot be inline";
- DECL_UNINLINABLE (current_function_decl) = 1;
-
/* If flag_weak, we don't need to mess with this, as we can just
make the function weak, and let it refer to its unique local
copy. This works because we don't allow the function to be
@@ -7533,20 +7616,14 @@ maybe_commonize_var (decl)
/* else we lose. We can only do this if we can use common,
which we can't if it has been initialized. */
- if (TREE_PUBLIC (decl))
- {
- if (flag_new_abi)
- DECL_ASSEMBLER_NAME (decl) = mangle_decl (decl);
- else
- DECL_ASSEMBLER_NAME (decl)
- = build_static_name (current_function_decl, DECL_NAME (decl));
- }
- else
+ if (!TREE_PUBLIC (decl))
{
cp_warning_at ("sorry: semantics of inline function static data `%#D' are wrong (you'll wind up with multiple copies)", decl);
cp_warning_at (" you can work around this by removing the initializer", decl);
}
}
+ else
+ comdat_linkage (decl);
}
else if (DECL_LANG_SPECIFIC (decl) && DECL_COMDAT (decl))
/* Set it up again; we might have set DECL_INITIAL since the last
@@ -7633,10 +7710,9 @@ check_initializer (decl, init)
}
else if (!DECL_EXTERNAL (decl) && TREE_CODE (type) == REFERENCE_TYPE)
{
- if (TREE_STATIC (decl))
- make_decl_rtl (decl, NULL_PTR);
- grok_reference_init (decl, type, init);
- init = NULL_TREE;
+ init = grok_reference_init (decl, type, init);
+ if (init)
+ init = obscure_complex_init (decl, init);
}
else if (init)
{
@@ -7728,7 +7804,14 @@ make_rtl_for_nonlocal_decl (decl, init, asmspec)
/* Set the DECL_ASSEMBLER_NAME for the variable. */
if (asmspec)
- DECL_ASSEMBLER_NAME (decl) = get_identifier (asmspec);
+ {
+ SET_DECL_ASSEMBLER_NAME (decl, get_identifier (asmspec));
+ /* The `register' keyword, when used together with an
+ asm-specification, indicates that the variable should be
+ placed in a particular register. */
+ if (DECL_REGISTER (decl))
+ DECL_C_HARD_REGISTER (decl) = 1;
+ }
/* We don't create any RTL for local variables. */
if (DECL_FUNCTION_SCOPE_P (decl) && !TREE_STATIC (decl))
@@ -7758,12 +7841,15 @@ make_rtl_for_nonlocal_decl (decl, init, asmspec)
defer_p = 1;
}
- /* If we're deferring the variable, just make RTL. Do not actually
- emit the variable. */
- if (defer_p)
+ /* If we're deferring the variable, we only need to make RTL if
+ there's an ASMSPEC. Otherwise, we'll lazily create it later when
+ we need it. (There's no way to lazily create RTL for things that
+ have assembly specs because the information about the specifier
+ isn't stored in the tree, yet) */
+ if (defer_p && asmspec)
make_decl_rtl (decl, asmspec);
/* If we're not deferring, go ahead and assemble the variable. */
- else
+ else if (!defer_p)
rest_of_decl_compilation (decl, asmspec, toplev, at_eof);
}
@@ -8040,8 +8126,8 @@ cp_finish_decl (decl, init, asmspec_tree, flags)
{
/* This must override the asm specifier which was placed by
grokclassfn. Lay this out fresh. */
- DECL_RTL (TREE_TYPE (decl)) = NULL_RTX;
- DECL_ASSEMBLER_NAME (decl) = get_identifier (asmspec);
+ SET_DECL_RTL (TREE_TYPE (decl), NULL_RTX);
+ SET_DECL_ASSEMBLER_NAME (decl, get_identifier (asmspec));
make_decl_rtl (decl, asmspec);
}
@@ -8646,7 +8732,8 @@ bad_specifiers (object, type, virtualp, quals, inlinep, friendp, raises)
object, type);
if (friendp)
cp_error_at ("`%D' declared as a friend", object);
- if (raises)
+ if (raises && !TYPE_PTRFN_P (TREE_TYPE (object))
+ && !TYPE_PTRMEMFUNC_P (TREE_TYPE (object)))
cp_error_at ("`%D' declared with an exception specification", object);
}
@@ -8678,17 +8765,11 @@ grokfndecl (ctype, type, declarator, orig_declarator, virtualp, flags, quals,
int check, friendp, publicp, inlinep, funcdef_flag, template_count;
tree in_namespace;
{
- tree cname, decl;
+ tree decl;
int staticp = ctype && TREE_CODE (type) == FUNCTION_TYPE;
int has_default_arg = 0;
tree t;
- if (ctype)
- cname = TREE_CODE (TYPE_NAME (ctype)) == TYPE_DECL
- ? TYPE_IDENTIFIER (ctype) : TYPE_NAME (ctype);
- else
- cname = NULL_TREE;
-
if (raises)
{
type = build_exception_variant (type, raises);
@@ -8715,7 +8796,7 @@ grokfndecl (ctype, type, declarator, orig_declarator, virtualp, flags, quals,
&& ctype == NULL_TREE
/* NULL_TREE means global namespace. */
&& DECL_CONTEXT (decl) == NULL_TREE)
- DECL_LANGUAGE (decl) = lang_c;
+ SET_DECL_LANGUAGE (decl, lang_c);
/* Should probably propagate const out from type to decl I bet (mrs). */
if (staticp)
@@ -8744,7 +8825,8 @@ grokfndecl (ctype, type, declarator, orig_declarator, virtualp, flags, quals,
/* Members of anonymous types and local classes have no linkage; make
them internal. */
- if (ctype && (ANON_AGGRNAME_P (TYPE_IDENTIFIER (ctype))
+ /* FIXME what if it gets a name from typedef? */
+ if (ctype && (TYPE_ANONYMOUS_P (ctype)
|| decl_function_context (TYPE_MAIN_DECL (ctype))))
publicp = 0;
@@ -8758,13 +8840,19 @@ grokfndecl (ctype, type, declarator, orig_declarator, virtualp, flags, quals,
t = no_linkage_check (TREE_TYPE (decl));
if (t)
{
- if (ANON_AGGRNAME_P (TYPE_IDENTIFIER (t)))
+ if (TYPE_ANONYMOUS_P (t))
{
if (DECL_EXTERN_C_P (decl))
/* Allow this; it's pretty common in C. */;
else
- cp_pedwarn ("non-local function `%#D' uses anonymous type",
- decl);
+ {
+ cp_pedwarn ("non-local function `%#D' uses anonymous type",
+ decl);
+ if (DECL_ORIGINAL_TYPE (TYPE_NAME (t)))
+ cp_pedwarn_at ("\
+`%#D' does not refer to the unqualified type, so it is not used for linkage",
+ TYPE_NAME (t));
+ }
}
else
cp_pedwarn ("non-local function `%#D' uses local type `%T'",
@@ -8779,8 +8867,13 @@ grokfndecl (ctype, type, declarator, orig_declarator, virtualp, flags, quals,
DECL_NOT_REALLY_EXTERN (decl) = 1;
}
+ /* If the declaration was declared inline, mark it as such. */
if (inlinep)
- DECL_THIS_INLINE (decl) = DECL_INLINE (decl) = 1;
+ DECL_DECLARED_INLINE_P (decl) = 1;
+ /* We inline functions that are explicitly declared inline, or, when
+ the user explicitly asks us to, all functions. */
+ if (DECL_DECLARED_INLINE_P (decl) || flag_inline_trees == 2)
+ DECL_INLINE (decl) = 1;
DECL_EXTERNAL (decl) = 1;
if (quals != NULL_TREE && TREE_CODE (type) == FUNCTION_TYPE)
@@ -8864,12 +8957,6 @@ grokfndecl (ctype, type, declarator, orig_declarator, virtualp, flags, quals,
if (has_default_arg)
add_defarg_fn (decl);
- /* Plain overloading: will not be grok'd by grokclassfn. */
- if (! ctype && ! processing_template_decl
- && (! DECL_EXTERN_C_P (decl) || DECL_OVERLOADED_OPERATOR_P (decl))
- && (! DECL_USE_TEMPLATE (decl) || name_mangling_version < 1))
- set_mangled_name_for_decl (decl);
-
if (funcdef_flag)
/* Make the init_value nonzero so pushdecl knows this is not
tentative. error_mark_node is replaced later with the BLOCK. */
@@ -8882,7 +8969,7 @@ grokfndecl (ctype, type, declarator, orig_declarator, virtualp, flags, quals,
if (check < 0)
return decl;
- if (flags == NO_SPECIAL && ctype && constructor_name (cname) == declarator)
+ if (flags == NO_SPECIAL && ctype && constructor_name (ctype) == declarator)
DECL_CONSTRUCTOR_P (decl) = 1;
/* Function gets the ugly name, field gets the nice one. This call
@@ -8974,16 +9061,6 @@ grokvardecl (type, declarator, specbits_in, initialized, constp, in_namespace)
type = TREE_TYPE (type);
decl = build_lang_decl (VAR_DECL, declarator, type);
DECL_CONTEXT (decl) = basetype;
- /* DECL_ASSEMBLER_NAME is needed only for full-instantiated
- templates. */
- if (!uses_template_parms (decl))
- {
- if (flag_new_abi)
- DECL_ASSEMBLER_NAME (decl) = mangle_decl (decl);
- else
- DECL_ASSEMBLER_NAME (decl) = build_static_name (basetype,
- declarator);
- }
}
else
{
@@ -8996,9 +9073,13 @@ grokvardecl (type, declarator, specbits_in, initialized, constp, in_namespace)
else
context = NULL_TREE;
- if (processing_template_decl && context)
- /* For global variables, declared in a template, we need the
- full lang_decl. */
+ /* For namespace-scope variables, declared in a template, we
+ need the full lang_decl. The same is true for
+ namespace-scope variables that do not have C++ language
+ linkage. */
+ if (context
+ && (processing_template_decl
+ || current_lang_name != lang_name_cplusplus))
decl = build_lang_decl (VAR_DECL, declarator, type);
else
decl = build_decl (VAR_DECL, declarator, type);
@@ -9008,13 +9089,10 @@ grokvardecl (type, declarator, specbits_in, initialized, constp, in_namespace)
context = DECL_CONTEXT (decl);
if (declarator && context && current_lang_name != lang_name_c)
- {
- if (flag_new_abi)
- DECL_ASSEMBLER_NAME (decl) = mangle_decl (decl);
- else
- DECL_ASSEMBLER_NAME (decl)
- = build_static_name (context, declarator);
- }
+ /* We can't mangle lazily here because we don't have any
+ way to recover whether or not a variable was `extern
+ "C"' later. */
+ mangle_decl (decl);
}
if (in_namespace)
@@ -9059,7 +9137,7 @@ grokvardecl (type, declarator, specbits_in, initialized, constp, in_namespace)
tree t = no_linkage_check (TREE_TYPE (decl));
if (t)
{
- if (ANON_AGGRNAME_P (TYPE_IDENTIFIER (t)))
+ if (TYPE_ANONYMOUS_P (t))
/* Ignore for now; `enum { foo } e' is pretty common. */;
else
cp_pedwarn ("non-local variable `%#D' uses local type `%T'",
@@ -9079,7 +9157,6 @@ build_ptrmemfunc_type (type)
{
tree fields[4];
tree t;
- tree u;
tree unqualified_variant = NULL_TREE;
if (type == error_mark_node)
@@ -9104,30 +9181,10 @@ build_ptrmemfunc_type (type)
/* ... and not really an aggregate. */
SET_IS_AGGR_TYPE (t, 0);
- if (!flag_new_abi)
- {
- u = make_aggr_type (UNION_TYPE);
- SET_IS_AGGR_TYPE (u, 0);
- fields[0] = build_decl (FIELD_DECL, pfn_identifier, type);
- fields[1] = build_decl (FIELD_DECL, delta2_identifier,
- delta_type_node);
- finish_builtin_type (u, "__ptrmemfunc_type", fields, 1, ptr_type_node);
- TYPE_NAME (u) = NULL_TREE;
-
- fields[0] = build_decl (FIELD_DECL, delta_identifier,
- delta_type_node);
- fields[1] = build_decl (FIELD_DECL, index_identifier,
- delta_type_node);
- fields[2] = build_decl (FIELD_DECL, pfn_or_delta2_identifier, u);
- finish_builtin_type (t, "__ptrmemfunc_type", fields, 2, ptr_type_node);
- }
- else
- {
- fields[0] = build_decl (FIELD_DECL, pfn_identifier, type);
- fields[1] = build_decl (FIELD_DECL, delta_identifier,
- delta_type_node);
- finish_builtin_type (t, "__ptrmemfunc_type", fields, 1, ptr_type_node);
- }
+ fields[0] = build_decl (FIELD_DECL, pfn_identifier, type);
+ fields[1] = build_decl (FIELD_DECL, delta_identifier,
+ delta_type_node);
+ finish_builtin_type (t, "__ptrmemfunc_type", fields, 1, ptr_type_node);
/* Zap out the name so that the back-end will give us the debugging
information for this anonymous RECORD_TYPE. */
@@ -9201,12 +9258,6 @@ compute_array_index_type (name, size)
{
tree itype;
- /* The size might be the result of a cast. */
- STRIP_TYPE_NOPS (size);
-
- /* It might be a const variable or enumeration constant. */
- size = decl_constant_value (size);
-
/* If this involves a template parameter, it will be a constant at
instantiation time, but we don't know what the value is yet.
Even if no template parameters are involved, we may an expression
@@ -9229,6 +9280,12 @@ compute_array_index_type (name, size)
size, integer_one_node));
}
+ /* The size might be the result of a cast. */
+ STRIP_TYPE_NOPS (size);
+
+ /* It might be a const variable or enumeration constant. */
+ size = decl_constant_value (size);
+
/* The array bound must be an integer type. */
if (TREE_CODE (TREE_TYPE (size)) != INTEGER_TYPE
&& TREE_CODE (TREE_TYPE (size)) != ENUMERAL_TYPE
@@ -9399,17 +9456,15 @@ create_array_type_for_decl (name, type, size)
/* Check that it's OK to declare a function with the indicated TYPE.
SFK indicates the kind of special function (if any) that this
- function is. CTYPE is the class of which this function is a
- member. OPTYPE is the type given in a conversion operator
+ function is. OPTYPE is the type given in a conversion operator
declaration. Returns the actual return type of the function; that
may be different than TYPE if an error occurs, or for certain
special functions. */
static tree
-check_special_function_return_type (sfk, type, ctype, optype)
+check_special_function_return_type (sfk, type, optype)
special_function_kind sfk;
tree type;
- tree ctype;
tree optype;
{
switch (sfk)
@@ -9418,9 +9473,8 @@ check_special_function_return_type (sfk, type, ctype, optype)
if (type)
cp_error ("return type specification for constructor invalid");
- /* In the old ABI, we return `this'; in the new ABI we don't
- bother. */
- type = flag_new_abi ? void_type_node : build_pointer_type (ctype);
+ /* In the new ABI constructors do not return a value. */
+ type = void_type_node;
break;
case sfk_destructor:
@@ -10030,7 +10084,6 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
if (sfk != sfk_none)
type = check_special_function_return_type (sfk, type,
- ctor_return_type,
ctor_return_type);
else if (type == NULL_TREE)
{
@@ -11016,8 +11069,12 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
decl = build_lang_decl (TYPE_DECL, declarator, type);
}
else
- decl = build_decl (TYPE_DECL, declarator, type);
-
+ {
+ decl = build_decl (TYPE_DECL, declarator, type);
+ if (!current_function_decl)
+ DECL_CONTEXT (decl) = FROB_CONTEXT (current_namespace);
+ }
+
/* If the user declares "typedef struct {...} foo" then the
struct will have an anonymous name. Fill that name in now.
Nothing can refer to it, so nothing needs know about the name
@@ -11026,7 +11083,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
&& declarator
&& TYPE_NAME (type)
&& TREE_CODE (TYPE_NAME (type)) == TYPE_DECL
- && ANON_AGGRNAME_P (TYPE_IDENTIFIER (type))
+ && TYPE_ANONYMOUS_P (type)
&& CP_TYPE_QUALS (type) == TYPE_UNQUALIFIED)
{
tree oldname = TYPE_NAME (type);
@@ -11048,25 +11105,6 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
DECL_NAME (CLASSTYPE_TI_TEMPLATE (type))
= TYPE_IDENTIFIER (type);
- if (flag_new_abi)
- DECL_ASSEMBLER_NAME (decl) = mangle_type (type);
- else
- {
- /* XXX Temporarily set the scope.
- When returning, start_decl expects it as NULL_TREE,
- and will then then set it using pushdecl. */
- my_friendly_assert (DECL_CONTEXT (decl) == NULL_TREE, 980404);
- if (current_class_type)
- DECL_CONTEXT (decl) = current_class_type;
- else
- DECL_CONTEXT (decl) = FROB_CONTEXT (current_namespace);
-
- DECL_ASSEMBLER_NAME (decl) = DECL_NAME (decl);
- DECL_ASSEMBLER_NAME (decl)
- = get_identifier (build_overload_name (type, 1, 1));
- DECL_CONTEXT (decl) = NULL_TREE;
- }
-
/* FIXME remangle member functions; member functions of a
type with external linkage have external linkage. */
}
@@ -11114,6 +11152,26 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
type = build_cplus_array_type (TREE_TYPE (type), TYPE_DOMAIN (type));
}
+ /* Detect where we're using a typedef of function type to declare a
+ function. last_function_parms will not be set, so we must create
+ it now. */
+
+ if (type == typedef_type && TREE_CODE (type) == FUNCTION_TYPE)
+ {
+ tree decls = NULL_TREE;
+ tree args;
+
+ for (args = TYPE_ARG_TYPES (type); args; args = TREE_CHAIN (args))
+ {
+ tree decl = build_decl (PARM_DECL, NULL_TREE, TREE_VALUE (args));
+
+ TREE_CHAIN (decl) = decls;
+ decls = decl;
+ }
+
+ last_function_parms = nreverse (decls);
+ }
+
/* If this is a type name (such as, in a cast or sizeof),
compute the type and return it now. */
@@ -11361,15 +11419,8 @@ friend declaration requires class-key, i.e. `friend %#T'",
/* The constructor can be called with exactly one
parameter if there is at least one parameter, and
any subsequent parameters have default arguments.
- We don't look at the first parameter, which is
- really just the `this' parameter for the new
- object. */
- tree arg_types =
- TREE_CHAIN (TYPE_ARG_TYPES (TREE_TYPE (decl)));
-
- /* Skip the `in_chrg' argument too, if present. */
- if (DECL_HAS_IN_CHARGE_PARM_P (decl))
- arg_types = TREE_CHAIN (arg_types);
+ Ignore any compiler-added parms. */
+ tree arg_types = FUNCTION_FIRST_USER_PARMTYPE (decl);
if (arg_types == void_list_node
|| (arg_types
@@ -11947,8 +11998,7 @@ grokparms (first_parm)
DECL_ARG_TYPE (decl) = TREE_TYPE (decl);
if (PROMOTE_PROTOTYPES
- && (TREE_CODE (type) == INTEGER_TYPE
- || TREE_CODE (type) == ENUMERAL_TYPE)
+ && INTEGRAL_TYPE_P (type)
&& TYPE_PRECISION (type) < TYPE_PRECISION (integer_type_node))
DECL_ARG_TYPE (decl) = integer_type_node;
if (!any_error && init)
@@ -11984,9 +12034,7 @@ copy_args_p (d)
if (!DECL_FUNCTION_MEMBER_P (d))
return 0;
- t = FUNCTION_ARG_CHAIN (d);
- if (DECL_CONSTRUCTOR_P (d) && DECL_HAS_IN_CHARGE_PARM_P (d))
- t = TREE_CHAIN (t);
+ t = FUNCTION_FIRST_USER_PARMTYPE (d);
if (t && TREE_CODE (TREE_VALUE (t)) == REFERENCE_TYPE
&& (TYPE_MAIN_VARIANT (TREE_TYPE (TREE_VALUE (t)))
== DECL_CONTEXT (d))
@@ -12009,22 +12057,9 @@ int
grok_ctor_properties (ctype, decl)
tree ctype, decl;
{
- tree parmtypes = FUNCTION_ARG_CHAIN (decl);
+ tree parmtypes = FUNCTION_FIRST_USER_PARMTYPE (decl);
tree parmtype = parmtypes ? TREE_VALUE (parmtypes) : void_type_node;
- /* When a type has virtual baseclasses, a magical first int argument is
- added to any ctor so we can tell if the class has been initialized
- yet. This could screw things up in this function, so we deliberately
- ignore the leading int if we're in that situation. */
- if (DECL_HAS_IN_CHARGE_PARM_P (decl))
- {
- my_friendly_assert (parmtypes
- && TREE_VALUE (parmtypes) == integer_type_node,
- 980529);
- parmtypes = TREE_CHAIN (parmtypes);
- parmtype = TREE_VALUE (parmtypes);
- }
-
/* [class.copy]
A non-template constructor for class X is a copy constructor if
@@ -12127,17 +12162,17 @@ grok_op_properties (decl, virtualp, friendp)
else
do
{
-#define DEF_OPERATOR(NAME, CODE, NEW_MANGLING, OLD_MANGING, ARITY, ASSN_P) \
- if (ansi_opname (CODE) == name) \
- { \
- operator_code = CODE; \
- break; \
- } \
- else if (ansi_assopname (CODE) == name) \
- { \
- operator_code = CODE; \
- DECL_ASSIGNMENT_OPERATOR_P (decl) = 1; \
- break; \
+#define DEF_OPERATOR(NAME, CODE, MANGLING, ARITY, ASSN_P) \
+ if (ansi_opname (CODE) == name) \
+ { \
+ operator_code = CODE; \
+ break; \
+ } \
+ else if (ansi_assopname (CODE) == name) \
+ { \
+ operator_code = CODE; \
+ DECL_ASSIGNMENT_OPERATOR_P (decl) = 1; \
+ break; \
}
#include "operators.def"
@@ -12757,7 +12792,16 @@ xref_basetypes (code_type_node, name, ref, binfo)
tree base;
int i, len;
- enum tag_types tag_code = (enum tag_types) tree_low_cst (code_type_node, 1);
+ enum tag_types tag_code;
+
+ /* If we are called from the parser, code_type_node will sometimes be a
+ TREE_LIST. This indicates that the user wrote
+ "class __attribute__ ((foo)) bar". Extract the attributes so that
+ tree_low_cst doesn't crash. */
+ if (TREE_CODE (code_type_node) == TREE_LIST)
+ code_type_node = TREE_VALUE (code_type_node);
+
+ tag_code = (enum tag_types) tree_low_cst (code_type_node, 1);
if (tag_code == union_type)
{
@@ -12959,138 +13003,126 @@ start_enum (name)
/* After processing and defining all the values of an enumeration type,
install their decls in the enumeration type and finish it off.
- ENUMTYPE is the type object and VALUES a list of name-value pairs.
- Returns ENUMTYPE. */
+ ENUMTYPE is the type object and VALUES a list of name-value pairs. */
-tree
+void
finish_enum (enumtype)
tree enumtype;
{
- register tree minnode = NULL_TREE, maxnode = NULL_TREE;
- /* Calculate the maximum value of any enumerator in this type. */
+ tree pair;
+ tree minnode;
+ tree maxnode;
+ tree t;
+ bool unsignedp;
+ int lowprec;
+ int highprec;
+ int precision;
+
+ /* We built up the VALUES in reverse order. */
+ TYPE_VALUES (enumtype) = nreverse (TYPE_VALUES (enumtype));
+
+ /* [dcl.enum]
+
+ Following the closing brace of an enum-specifier, each
+ enumerator has the type of its enumeration. Prior to the
+ closing brace, the type of each enumerator is the type of
+ its initializing value. */
+ for (pair = TYPE_VALUES (enumtype); pair; pair = TREE_CHAIN (pair))
+ TREE_TYPE (TREE_VALUE (pair)) = enumtype;
+
+ /* For a enum defined in a template, all further processing is
+ postponed until the template is instantiated. */
+ if (processing_template_decl)
+ {
+ tree scope = current_scope ();
+ if (scope && TREE_CODE (scope) == FUNCTION_DECL)
+ add_stmt (build_min (TAG_DEFN, enumtype));
- tree values = TYPE_VALUES (enumtype);
- if (values)
+ return;
+ }
+
+ /* Figure out what the minimum and maximum values of the enumerators
+ are. */
+ if (TYPE_VALUES (enumtype))
{
- tree pair;
+ minnode = maxnode = NULL_TREE;
- for (pair = values; pair; pair = TREE_CHAIN (pair))
+ for (pair = TYPE_VALUES (enumtype);
+ pair;
+ pair = TREE_CHAIN (pair))
{
- tree decl;
tree value;
- /* The TREE_VALUE is a CONST_DECL for this enumeration
- constant. */
- decl = TREE_VALUE (pair);
-
- /* [dcl.enum]
-
- Following the closing brace of an enum-specifier, each
- enumerator has the type of its enumeration. Prior to the
- closing brace, the type of each enumerator is the type of
- its initializing value. */
- TREE_TYPE (decl) = enumtype;
-
- /* The DECL_INITIAL will be NULL if we are processing a
- template declaration and this enumeration constant had no
- explicit initializer. */
- value = DECL_INITIAL (decl);
- if (value && !processing_template_decl)
- {
- /* Set the TREE_TYPE for the VALUE as well. That's so
- that when we call decl_constant_value we get an
- entity of the right type (but with the constant
- value). Since we shouldn't ever call
- decl_constant_value on a template type, there's no
- reason to do that when processing_template_decl.
- And, if the expression is something like a
- TEMPLATE_PARM_INDEX or a CAST_EXPR doing so will
- wreak havoc on the intended type of the expression.
-
- Of course, there's also no point in trying to compute
- minimum or maximum values if we're in a template. */
- TREE_TYPE (value) = enumtype;
-
- if (!minnode)
- minnode = maxnode = value;
- else if (tree_int_cst_lt (maxnode, value))
- maxnode = value;
- else if (tree_int_cst_lt (value, minnode))
- minnode = value;
- }
+ value = DECL_INITIAL (TREE_VALUE (pair));
- if (processing_template_decl)
- /* If this is just a template, leave the CONST_DECL
- alone. That way tsubst_copy will find CONST_DECLs for
- CONST_DECLs, and not INTEGER_CSTs. */
- ;
- else
- /* In the list we're building up, we want the enumeration
- values, not the CONST_DECLs. */
- TREE_VALUE (pair) = value;
+ if (!minnode)
+ minnode = maxnode = value;
+ else if (tree_int_cst_lt (maxnode, value))
+ maxnode = value;
+ else if (tree_int_cst_lt (value, minnode))
+ minnode = value;
}
}
else
- maxnode = minnode = integer_zero_node;
-
- TYPE_VALUES (enumtype) = nreverse (values);
-
- if (processing_template_decl)
- {
- tree scope = current_scope ();
- if (scope && TREE_CODE (scope) == FUNCTION_DECL)
- add_stmt (build_min (TAG_DEFN, enumtype));
- }
+ minnode = maxnode = integer_zero_node;
+
+ /* Compute the number of bits require to represent all values of the
+ enumeration. We must do this before the type of MINNODE and
+ MAXNODE are transformed, since min_precision relies on the
+ TREE_TYPE of the value it is passed. */
+ unsignedp = tree_int_cst_sgn (minnode) >= 0;
+ lowprec = min_precision (minnode, unsignedp);
+ highprec = min_precision (maxnode, unsignedp);
+ precision = MAX (lowprec, highprec);
+
+ /* Set the TREE_TYPE for the values as well. That's so that when we
+ call decl_constant_value we get an entity of the right type (but
+ with the constant value). In addition, transform the TYPE_VALUES
+ list to contain the values, rather than the CONST_DECLs for them. */
+ for (pair = TYPE_VALUES (enumtype); pair; pair = TREE_CHAIN (pair))
+ {
+ tree value = DECL_INITIAL (TREE_VALUE (pair));
+
+ TREE_TYPE (value) = enumtype;
+ TREE_VALUE (pair) = value;
+ }
+
+ /* Set TYPE_MIN_VALUE and TYPE_MAX_VALUE according to `precision'. */
+ TYPE_SIZE (enumtype) = NULL_TREE;
+ TYPE_PRECISION (enumtype) = precision;
+ if (unsignedp)
+ fixup_unsigned_type (enumtype);
else
- {
- int unsignedp = tree_int_cst_sgn (minnode) >= 0;
- int lowprec = min_precision (minnode, unsignedp);
- int highprec = min_precision (maxnode, unsignedp);
- int precision = MAX (lowprec, highprec);
- tree tem;
-
- TYPE_SIZE (enumtype) = NULL_TREE;
-
- /* Set TYPE_MIN_VALUE and TYPE_MAX_VALUE according to `precision'. */
+ fixup_signed_type (enumtype);
- TYPE_PRECISION (enumtype) = precision;
- if (unsignedp)
- fixup_unsigned_type (enumtype);
- else
- fixup_signed_type (enumtype);
-
- if (flag_short_enums || (precision > TYPE_PRECISION (integer_type_node)))
- /* Use the width of the narrowest normal C type which is wide
- enough. */
- TYPE_PRECISION (enumtype) = TYPE_PRECISION (type_for_size
- (precision, 1));
- else
- TYPE_PRECISION (enumtype) = TYPE_PRECISION (integer_type_node);
-
- TYPE_SIZE (enumtype) = 0;
- layout_type (enumtype);
+ if (flag_short_enums || (precision > TYPE_PRECISION (integer_type_node)))
+ /* Use the width of the narrowest normal C type which is wide
+ enough. */
+ TYPE_PRECISION (enumtype) = TYPE_PRECISION (type_for_size
+ (precision, 1));
+ else
+ TYPE_PRECISION (enumtype) = TYPE_PRECISION (integer_type_node);
- /* Fix up all variant types of this enum type. */
- for (tem = TYPE_MAIN_VARIANT (enumtype); tem;
- tem = TYPE_NEXT_VARIANT (tem))
- {
- TYPE_VALUES (tem) = TYPE_VALUES (enumtype);
- TYPE_MIN_VALUE (tem) = TYPE_MIN_VALUE (enumtype);
- TYPE_MAX_VALUE (tem) = TYPE_MAX_VALUE (enumtype);
- TYPE_SIZE (tem) = TYPE_SIZE (enumtype);
- TYPE_SIZE_UNIT (tem) = TYPE_SIZE_UNIT (enumtype);
- TYPE_MODE (tem) = TYPE_MODE (enumtype);
- TYPE_PRECISION (tem) = TYPE_PRECISION (enumtype);
- TYPE_ALIGN (tem) = TYPE_ALIGN (enumtype);
- TYPE_USER_ALIGN (tem) = TYPE_USER_ALIGN (enumtype);
- TREE_UNSIGNED (tem) = TREE_UNSIGNED (enumtype);
- }
+ TYPE_SIZE (enumtype) = NULL_TREE;
+ layout_type (enumtype);
- /* Finish debugging output for this type. */
- rest_of_type_compilation (enumtype, namespace_bindings_p ());
+ /* Fix up all variant types of this enum type. */
+ for (t = TYPE_MAIN_VARIANT (enumtype); t; t = TYPE_NEXT_VARIANT (t))
+ {
+ TYPE_VALUES (t) = TYPE_VALUES (enumtype);
+ TYPE_MIN_VALUE (t) = TYPE_MIN_VALUE (enumtype);
+ TYPE_MAX_VALUE (t) = TYPE_MAX_VALUE (enumtype);
+ TYPE_SIZE (t) = TYPE_SIZE (enumtype);
+ TYPE_SIZE_UNIT (t) = TYPE_SIZE_UNIT (enumtype);
+ TYPE_MODE (t) = TYPE_MODE (enumtype);
+ TYPE_PRECISION (t) = TYPE_PRECISION (enumtype);
+ TYPE_ALIGN (t) = TYPE_ALIGN (enumtype);
+ TYPE_USER_ALIGN (t) = TYPE_USER_ALIGN (enumtype);
+ TREE_UNSIGNED (t) = TREE_UNSIGNED (enumtype);
}
- return enumtype;
+ /* Finish debugging output for this type. */
+ rest_of_type_compilation (enumtype, namespace_bindings_p ());
}
/* Build and install a CONST_DECL for an enumeration constant of the
@@ -13372,6 +13404,12 @@ start_function (declspecs, declarator, attrs, flags)
}
}
+ if (DECL_MAYBE_IN_CHARGE_CONSTRUCTOR_P (decl1))
+ /* This is a constructor, we must ensure that any default args
+ introduced by this definition are propagated to the clones
+ now. The clones are used directly in overload resolution. */
+ adjust_clone_args (decl1);
+
/* Sometimes we don't notice that a function is a static member, and
build a METHOD_TYPE for it. Fix that up now. */
if (ctype != NULL_TREE && DECL_STATIC_FUNCTION_P (decl1)
@@ -13534,8 +13572,18 @@ start_function (declspecs, declarator, attrs, flags)
/* Constructors and destructors need to know whether they're "in
charge" of initializing virtual base classes. */
+ t = TREE_CHAIN (t);
if (DECL_HAS_IN_CHARGE_PARM_P (decl1))
- current_in_charge_parm = TREE_CHAIN (t);
+ {
+ current_in_charge_parm = t;
+ t = TREE_CHAIN (t);
+ }
+ if (DECL_HAS_VTT_PARM_P (decl1))
+ {
+ if (DECL_NAME (t) != vtt_parm_identifier)
+ abort ();
+ current_vtt_parm = t;
+ }
}
if (DECL_INTERFACE_KNOWN (decl1))
@@ -13545,7 +13593,7 @@ start_function (declspecs, declarator, attrs, flags)
if (DECL_NOT_REALLY_EXTERN (decl1))
DECL_EXTERNAL (decl1) = 0;
- if (ctx != NULL_TREE && DECL_THIS_INLINE (ctx)
+ if (ctx != NULL_TREE && DECL_DECLARED_INLINE_P (ctx)
&& TREE_PUBLIC (ctx))
/* This is a function in a local class in an extern inline
function. */
@@ -13558,12 +13606,14 @@ start_function (declspecs, declarator, attrs, flags)
&& (! DECL_TEMPLATE_INSTANTIATION (decl1)
|| flag_alt_external_templates))
{
- if (DECL_THIS_INLINE (decl1) || DECL_TEMPLATE_INSTANTIATION (decl1)
+ if (DECL_DECLARED_INLINE_P (decl1)
+ || DECL_TEMPLATE_INSTANTIATION (decl1)
|| processing_template_decl)
{
DECL_EXTERNAL (decl1)
= (interface_only
- || (DECL_THIS_INLINE (decl1) && ! flag_implement_inlines
+ || (DECL_DECLARED_INLINE_P (decl1)
+ && ! flag_implement_inlines
&& !DECL_VINDEX (decl1)));
/* For WIN32 we also want to put these in linkonce sections. */
@@ -13594,7 +13644,8 @@ start_function (declspecs, declarator, attrs, flags)
So clear DECL_EXTERNAL. */
DECL_EXTERNAL (decl1) = 0;
- if ((DECL_THIS_INLINE (decl1) || DECL_TEMPLATE_INSTANTIATION (decl1))
+ if ((DECL_DECLARED_INLINE_P (decl1)
+ || DECL_TEMPLATE_INSTANTIATION (decl1))
&& ! DECL_INTERFACE_KNOWN (decl1)
/* Don't try to defer nested functions for now. */
&& ! decl_function_context (decl1))
@@ -13609,19 +13660,10 @@ start_function (declspecs, declarator, attrs, flags)
if (attrs)
cplus_decl_attributes (decl1, NULL_TREE, attrs);
- /* We need to do this even if we aren't expanding yet so that
- assemble_external works. */
- make_decl_rtl (decl1, NULL);
-
/* Promote the value to int before returning it. */
- if (C_PROMOTING_INTEGER_TYPE_P (restype))
+ if (c_promoting_integer_type_p (restype))
restype = type_promotes_to (restype);
- /* If this fcn was already referenced via a block-scope `extern' decl
- (or an implicit decl), propagate certain information about the usage. */
- if (TREE_ADDRESSABLE (DECL_ASSEMBLER_NAME (decl1)))
- TREE_ADDRESSABLE (decl1) = 1;
-
if (DECL_RESULT (decl1) == NULL_TREE)
{
DECL_RESULT (decl1)
@@ -13637,16 +13679,6 @@ start_function (declspecs, declarator, attrs, flags)
dtor_label = build_decl (LABEL_DECL, NULL_TREE, NULL_TREE);
DECL_CONTEXT (dtor_label) = current_function_decl;
}
- /* Under the old ABI we return `this' from constructors, so we make
- ordinary `return' statements in constructors jump to CTOR_LABEL;
- from there we return `this'. Under the new ABI, we don't bother
- with any of this. By not setting CTOR_LABEL the remainder of the
- machinery is automatically disabled. */
- else if (!flag_new_abi && DECL_CONSTRUCTOR_P (decl1))
- {
- ctor_label = build_decl (LABEL_DECL, NULL_TREE, NULL_TREE);
- DECL_CONTEXT (ctor_label) = current_function_decl;
- }
store_parm_decls (current_function_parms);
@@ -13758,7 +13790,7 @@ store_parm_decls (current_function_parms)
if (flag_exceptions && !processing_template_decl
&& flag_enforce_eh_specs
&& TYPE_RAISES_EXCEPTIONS (TREE_TYPE (current_function_decl)))
- current_eh_spec_try_block = expand_start_eh_spec ();
+ current_eh_spec_block = begin_eh_spec_block ();
}
@@ -13788,6 +13820,7 @@ save_function_data (decl)
f->base.x_stmt_tree.x_last_expr_type = NULL_TREE;
f->x_named_label_uses = NULL;
f->bindings = NULL;
+ f->x_local_names = NULL;
/* When we get back here again, we will be expanding. */
f->x_expanding_p = 1;
@@ -13795,7 +13828,11 @@ save_function_data (decl)
/* If we've already decided that we cannot inline this function, we
must remember that fact when we actually go to expand the
function. */
- f->cannot_inline = current_function_cannot_inline;
+ if (current_function_cannot_inline)
+ {
+ f->cannot_inline = current_function_cannot_inline;
+ DECL_INLINE (decl) = 0;
+ }
}
/* At the end of every constructor we generate to code to return
@@ -13826,9 +13863,7 @@ static void
finish_destructor_body ()
{
tree compound_stmt;
- tree virtual_size;
tree exprstmt;
- tree if_stmt;
/* Create a block to contain all the extra code. */
compound_stmt = begin_compound_stmt (/*has_no_scope=*/0);
@@ -13910,31 +13945,31 @@ finish_destructor_body ()
}
}
- virtual_size = c_sizeof (current_class_type);
-
- /* At the end, call delete if that's what's requested. */
+ /* In a virtual destructor, we must call delete. */
+ if (DECL_VIRTUAL_P (current_function_decl))
+ {
+ tree if_stmt;
+ tree virtual_size = c_sizeof (current_class_type);
- /* FDIS sez: At the point of definition of a virtual destructor
- (including an implicit definition), non-placement operator delete
- shall be looked up in the scope of the destructor's class and if
- found shall be accessible and unambiguous.
+ /* [class.dtor]
- This is somewhat unclear, but I take it to mean that if the class
- only defines placement deletes we don't do anything here. So we
- pass LOOKUP_SPECULATIVELY; delete_sanity will complain for us if
- they ever try to delete one of these. */
- exprstmt = build_op_delete_call
- (DELETE_EXPR, current_class_ptr, virtual_size,
- LOOKUP_NORMAL | LOOKUP_SPECULATIVELY, NULL_TREE);
+ At the point of definition of a virtual destructor (including
+ an implicit definition), non-placement operator delete shall
+ be looked up in the scope of the destructor's class and if
+ found shall be accessible and unambiguous. */
+ exprstmt = build_op_delete_call
+ (DELETE_EXPR, current_class_ptr, virtual_size,
+ LOOKUP_NORMAL | LOOKUP_SPECULATIVELY, NULL_TREE);
- if_stmt = begin_if_stmt ();
- finish_if_stmt_cond (build (BIT_AND_EXPR, integer_type_node,
- current_in_charge_parm,
- integer_one_node),
- if_stmt);
- finish_expr_stmt (exprstmt);
- finish_then_clause (if_stmt);
- finish_if_stmt ();
+ if_stmt = begin_if_stmt ();
+ finish_if_stmt_cond (build (BIT_AND_EXPR, integer_type_node,
+ current_in_charge_parm,
+ integer_one_node),
+ if_stmt);
+ finish_expr_stmt (exprstmt);
+ finish_then_clause (if_stmt);
+ finish_if_stmt ();
+ }
/* Close the block we started above. */
finish_compound_stmt (/*has_no_scope=*/0, compound_stmt);
@@ -14004,9 +14039,9 @@ finish_function (flags)
if (flag_exceptions && !processing_template_decl
&& flag_enforce_eh_specs
&& TYPE_RAISES_EXCEPTIONS (TREE_TYPE (current_function_decl)))
- expand_end_eh_spec (TYPE_RAISES_EXCEPTIONS
- (TREE_TYPE (current_function_decl)),
- current_eh_spec_try_block);
+ finish_eh_spec_block (TYPE_RAISES_EXCEPTIONS
+ (TREE_TYPE (current_function_decl)),
+ current_eh_spec_block);
}
/* If we're saving up tree structure, tie off the function now. */
@@ -14108,6 +14143,9 @@ start_method (declspecs, declarator, attrlist)
if (fndecl == NULL_TREE)
return NULL_TREE;
+ if (attrlist)
+ cplus_decl_attributes (fndecl, attrlist, 0);
+
/* Pass friends other than inline friend functions back. */
if (fndecl == void_type_node)
return fndecl;
@@ -14130,7 +14168,7 @@ start_method (declspecs, declarator, attrlist)
check_template_shadow (fndecl);
- DECL_THIS_INLINE (fndecl) = 1;
+ DECL_DECLARED_INLINE_P (fndecl) = 1;
if (flag_default_inline)
DECL_INLINE (fndecl) = 1;
@@ -14310,7 +14348,11 @@ maybe_build_cleanup (decl)
{
tree type = TREE_TYPE (decl);
- if (type != error_mark_node && TYPE_HAS_NONTRIVIAL_DESTRUCTOR (type))
+ if (type != error_mark_node && TYPE_HAS_NONTRIVIAL_DESTRUCTOR (type)
+ /* The destructor must not be called on the parameters of a thunk
+ because they are not copied when the thunk calls the function
+ to which is thunking. */
+ && (! DECL_CONTEXT (decl) || ! DECL_THUNK_P (DECL_CONTEXT (decl))))
{
int flags = LOOKUP_NORMAL|LOOKUP_DESTRUCTOR;
tree rval;
@@ -14408,7 +14450,13 @@ pop_cp_function_context (f)
struct function *f;
{
if (f->language)
- free (f->language);
+ {
+ struct cp_language_function *cp =
+ (struct cp_language_function *) f->language;
+ if (cp->x_local_names)
+ VARRAY_FREE (cp->x_local_names);
+ free (f->language);
+ }
f->language = 0;
}
@@ -14427,7 +14475,8 @@ mark_lang_function (p)
ggc_mark_tree (p->x_dtor_label);
ggc_mark_tree (p->x_current_class_ptr);
ggc_mark_tree (p->x_current_class_ref);
- ggc_mark_tree (p->x_eh_spec_try_block);
+ ggc_mark_tree (p->x_eh_spec_block);
+ ggc_mark_tree_varray (p->x_local_names);
mark_named_label_lists (&p->x_named_labels, &p->x_named_label_uses);
mark_binding_level (&p->bindings);
@@ -14485,7 +14534,8 @@ lang_mark_tree (t)
c_mark_lang_decl (&ld->decl_flags.base);
if (!DECL_GLOBAL_CTOR_P (t)
&& !DECL_GLOBAL_DTOR_P (t)
- && !DECL_THUNK_P (t))
+ && !DECL_THUNK_P (t)
+ && !DECL_DISCRIMINATOR_P (t))
ggc_mark_tree (ld->decl_flags.u2.access);
else if (DECL_THUNK_P (t))
ggc_mark_tree (ld->decl_flags.u2.vcall_offset);
@@ -14498,8 +14548,7 @@ lang_mark_tree (t)
ggc_mark_tree (ld->befriending_classes);
ggc_mark_tree (ld->context);
ggc_mark_tree (ld->cloned_function);
- if (!DECL_OVERLOADED_OPERATOR_P (t))
- ggc_mark_tree (ld->u2.vtt_parm);
+ ggc_mark_tree (ld->inlined_fns);
if (TREE_CODE (t) == TYPE_DECL)
ggc_mark_tree (ld->u.sorted_fields);
else if (TREE_CODE (t) == FUNCTION_DECL
@@ -14559,5 +14608,5 @@ cp_missing_noreturn_ok_p (decl)
tree decl;
{
/* A missing noreturn is ok for the `main' function. */
- return MAIN_NAME_P (DECL_ASSEMBLER_NAME (decl));
+ return DECL_MAIN_P (decl);
}
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index 442b31bf37d..0f279bc0d53 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -283,10 +283,6 @@ int warn_overloaded_virtual;
int warn_nonvdtor;
-/* Non-zero means warn when a function is declared extern and later inline. */
-
-int warn_extern_inline;
-
/* Non-zero means warn when the compiler will reorder code. */
int warn_reorder;
@@ -337,20 +333,11 @@ int warn_deprecated = 1;
#endif
int dollars_in_ident = DOLLARS_IN_IDENTIFIERS;
-/* Nonzero means that labels can be used as first-class objects */
-
-int flag_labels_ok;
-
/* Nonzero means allow Microsoft extensions without a pedwarn. */
int flag_ms_extensions;
/* C++ specific flags. */
-/* Zero means that `this' is a *const. This gives nice behavior in the
- 2.0 world. 1 gives 1.2-compatible behavior. 2 gives Spring behavior.
- -2 means we're constructing an object and it has fixed type. */
-
-int flag_this_is_variable;
/* Nonzero means we should attempt to elide constructors when possible. */
@@ -396,10 +383,6 @@ int flag_operator_names = 1;
int flag_check_new;
-/* Nonnull if we want to dump class heirarchies. */
-
-const char *flag_dump_class_layout;
-
/* Nonzero if we want the new ISO rules for pushing a new scope for `for'
initialization variables.
0: Old rules, set by -fno-for-scope.
@@ -415,10 +398,6 @@ int flag_new_for_scope = 1;
int flag_weak = 1;
-/* Nonzero to enable experimental ABI changes. */
-
-int flag_new_abi = 1;
-
/* Nonzero to use __cxa_atexit, rather than atexit, to register
destructors for local statics and global objects. */
@@ -428,8 +407,10 @@ int flag_use_cxa_atexit;
int flag_honor_std = ENABLE_STD_NAMESPACE;
-/* Nonzero if we should expand functions calls inline at the tree
- level, rather than at the RTL level. */
+/* 0 if we should not perform inlining.
+ 1 if we should expand functions calls inline at the tree level.
+ 2 if we should consider *all* functions to be inline
+ candidates. */
int flag_inline_trees = 0;
@@ -439,17 +420,6 @@ int flag_inline_trees = 0;
int max_tinst_depth = 50;
-/* The name-mangling scheme to use. Must be 1 or greater to support
- template functions with identical types, but different template
- arguments. */
-int name_mangling_version = 2;
-
-/* Nonzero if squashed mangling is to be performed.
- This uses the B and K codes to reference previously seen class types
- and class qualifiers. */
-
-int flag_do_squangling;
-
/* Nonzero means output .vtable_{entry,inherit} for use in doing vtable gc. */
int flag_vtable_gc;
@@ -503,12 +473,9 @@ lang_f_options[] =
{"for-scope", &flag_new_for_scope, 2},
{"gnu-keywords", &flag_no_gnu_keywords, 0},
{"handle-exceptions", &flag_exceptions, 1},
- {"honor-std", &flag_honor_std, 1},
- {"huge-objects", &flag_huge_objects, 1},
{"implement-inlines", &flag_implement_inlines, 1},
{"implicit-inline-templates", &flag_implicit_inline_templates, 1},
{"implicit-templates", &flag_implicit_templates, 1},
- {"labels-ok", &flag_labels_ok, 1},
{"ms-extensions", &flag_ms_extensions, 1},
{"nonansi-builtins", &flag_no_nonansi_builtin, 0},
{"operator-names", &flag_operator_names, 1},
@@ -516,13 +483,9 @@ lang_f_options[] =
{"permissive", &flag_permissive, 1},
{"repo", &flag_use_repository, 1},
{"rtti", &flag_rtti, 1},
- {"squangle", &flag_do_squangling, 1},
{"stats", &flag_detailed_statistics, 1},
{"use-cxa-atexit", &flag_use_cxa_atexit, 1},
- {"vtable-gc", &flag_vtable_gc, 1},
- {"vtable-thunks", &flag_vtable_thunks, 1},
- {"weak", &flag_weak, 1},
- {"xref", &flag_gnu_xref, 1}
+ {"weak", &flag_weak, 1}
};
/* The list of `-f' options that we no longer support. The `-f'
@@ -533,9 +496,17 @@ static const char * const unsupported_options[] = {
"cond-mismatch",
"enum-int-equiv",
"guiding-decls",
+ "honor-std",
+ "huge-objects",
+ "labels-ok",
+ "new-abi",
"nonnull-objects",
- "this-is-variable",
+ "squangle",
"strict-prototype",
+ "this-is-variable",
+ "vtable-gc",
+ "vtable-thunks",
+ "xref"
};
/* Compare two option strings, pointed two by P1 and P2, for use with
@@ -620,43 +591,18 @@ cxx_decode_option (argc, argv)
flag_external_templates = 1;
cp_deprecated ("-fexternal-templates");
}
- else if (!strcmp (p, "new-abi"))
- {
- flag_new_abi = 1;
- flag_do_squangling = 1;
- flag_vtable_thunks = 1;
- }
- else if (!strcmp (p, "no-new-abi"))
- {
- flag_new_abi = 0;
- flag_do_squangling = 0;
- }
else if ((option_value
= skip_leading_substring (p, "template-depth-")))
max_tinst_depth
= read_integral_parameter (option_value, p - 2, max_tinst_depth);
else if ((option_value
= skip_leading_substring (p, "name-mangling-version-")))
- name_mangling_version
- = read_integral_parameter (option_value, p - 2, name_mangling_version);
- else if ((option_value
- = skip_leading_substring (p, "dump-translation-unit=")))
{
- if (!*option_value)
- error ("no file specified with -fdump-translation-unit");
- else
- flag_dump_translation_unit = option_value;
- }
- else if ((option_value
- = skip_leading_substring (p, "dump-class-layout=")))
- {
- if (!*option_value)
- error ("no file specified with -fdump-class-layout");
- else
- flag_dump_class_layout = option_value;
+ warning ("-fname-mangling-version is no longer supported");
+ return 1;
}
- else if (!strcmp (p, "dump-class-layout"))
- flag_dump_class_layout = ""; /* empty string for stderr */
+ else if (dump_switch_p (p))
+ ;
else
{
int found = 0;
@@ -745,8 +691,6 @@ cxx_decode_option (argc, argv)
warn_parentheses = setting;
else if (!strcmp (p, "non-virtual-dtor"))
warn_nonvdtor = setting;
- else if (!strcmp (p, "extern-inline"))
- warn_extern_inline = setting;
else if (!strcmp (p, "reorder"))
warn_reorder = setting;
else if (!strcmp (p, "synth"))
@@ -949,7 +893,10 @@ build_artificial_parm (name, type)
This function adds the "in-charge" flag to member function FN if
appropriate. It is called from grokclassfn and tsubst.
- FN must be either a constructor or destructor. */
+ FN must be either a constructor or destructor.
+
+ The in-charge flag follows the 'this' parameter, and is followed by the
+ VTT parm (if any), then the user-written parms. */
void
maybe_retrofit_in_chrg (fn)
@@ -972,17 +919,38 @@ maybe_retrofit_in_chrg (fn)
&& !TYPE_USES_VIRTUAL_BASECLASSES (DECL_CONTEXT (fn)))
return;
- /* First add it to DECL_ARGUMENTS... */
- parm = build_artificial_parm (in_charge_identifier, integer_type_node);
- TREE_READONLY (parm) = 1;
- parms = DECL_ARGUMENTS (fn);
- TREE_CHAIN (parm) = TREE_CHAIN (parms);
- TREE_CHAIN (parms) = parm;
-
- /* ...and then to TYPE_ARG_TYPES. */
arg_types = TYPE_ARG_TYPES (TREE_TYPE (fn));
basetype = TREE_TYPE (TREE_VALUE (arg_types));
- arg_types = hash_tree_chain (integer_type_node, TREE_CHAIN (arg_types));
+ arg_types = TREE_CHAIN (arg_types);
+
+ parms = TREE_CHAIN (DECL_ARGUMENTS (fn));
+
+ /* If this is a subobject constructor or destructor, our caller will
+ pass us a pointer to our VTT. */
+ if (TYPE_USES_VIRTUAL_BASECLASSES (DECL_CONTEXT (fn)))
+ {
+ parm = build_artificial_parm (vtt_parm_identifier, vtt_parm_type);
+
+ /* First add it to DECL_ARGUMENTS between 'this' and the real args... */
+ TREE_CHAIN (parm) = parms;
+ parms = parm;
+
+ /* ...and then to TYPE_ARG_TYPES. */
+ arg_types = hash_tree_chain (vtt_parm_type, arg_types);
+
+ DECL_HAS_VTT_PARM_P (fn) = 1;
+ }
+
+ /* Then add the in-charge parm (before the VTT parm). */
+ parm = build_artificial_parm (in_charge_identifier, integer_type_node);
+ TREE_CHAIN (parm) = parms;
+ parms = parm;
+ arg_types = hash_tree_chain (integer_type_node, arg_types);
+
+ /* Insert our new parameter(s) into the list. */
+ TREE_CHAIN (DECL_ARGUMENTS (fn)) = parms;
+
+ /* And rebuild the function type. */
fntype = build_cplus_method_type (basetype, TREE_TYPE (TREE_TYPE (fn)),
arg_types);
if (TYPE_RAISES_EXCEPTIONS (TREE_TYPE (fn)))
@@ -992,18 +960,6 @@ maybe_retrofit_in_chrg (fn)
/* Now we've got the in-charge parameter. */
DECL_HAS_IN_CHARGE_PARM_P (fn) = 1;
-
- /* If this is a subobject constructor or destructor, our caller will
- pass us a pointer to our VTT. */
- if (flag_new_abi && TYPE_USES_VIRTUAL_BASECLASSES (DECL_CONTEXT (fn)))
- {
- DECL_VTT_PARM (fn) = build_artificial_parm (vtt_parm_identifier,
- vtt_parm_type);
- DECL_CONTEXT (DECL_VTT_PARM (fn)) = fn;
- DECL_USE_VTT_PARM (fn) = build_artificial_parm (NULL_TREE,
- boolean_type_node);
- DECL_CONTEXT (DECL_USE_VTT_PARM (fn)) = fn;
- }
}
/* Classes overload their constituent function names automatically.
@@ -1037,7 +993,7 @@ grokclassfn (ctype, function, flags, quals)
/* Even within an `extern "C"' block, members get C++ linkage. See
[dcl.link] for details. */
- DECL_LANGUAGE (function) = lang_cplusplus;
+ SET_DECL_LANGUAGE (function, lang_cplusplus);
if (fn_name == NULL_TREE)
{
@@ -1075,22 +1031,17 @@ grokclassfn (ctype, function, flags, quals)
DECL_ARGUMENTS (function) = last_function_parms;
DECL_CONTEXT (function) = ctype;
+ if (flags == DTOR_FLAG)
+ DECL_DESTRUCTOR_P (function) = 1;
+
if (flags == DTOR_FLAG || DECL_CONSTRUCTOR_P (function))
maybe_retrofit_in_chrg (function);
if (flags == DTOR_FLAG)
{
DECL_DESTRUCTOR_P (function) = 1;
-
- if (flag_new_abi)
- set_mangled_name_for_decl (function);
- else
- DECL_ASSEMBLER_NAME (function) = build_destructor_name (ctype);
-
TYPE_HAS_DESTRUCTOR (ctype) = 1;
}
- else
- set_mangled_name_for_decl (function);
}
/* Work on the expr used by alignof (this is only called by the parser). */
@@ -1103,7 +1054,7 @@ grok_alignof (expr)
int bestalign;
if (processing_template_decl)
- return build_min (ALIGNOF_EXPR, sizetype, expr);
+ return build_min_nt (ALIGNOF_EXPR, expr);
if (TREE_CODE (expr) == COMPONENT_REF
&& DECL_C_BIT_FIELD (TREE_OPERAND (expr, 1)))
@@ -1455,22 +1406,6 @@ check_classfn (ctype, function)
fndecls = OVL_NEXT (fndecls))
{
fndecl = OVL_CURRENT (fndecls);
- /* The DECL_ASSEMBLER_NAME for a TEMPLATE_DECL, or
- for a for member function of a template class, is
- not mangled, so the check below does not work
- correctly in that case. Since mangled destructor
- names do not include the type of the arguments,
- we can't use this short-cut for them, either.
- (It's not legal to declare arguments for a
- destructor, but some people try.) */
- if (!DECL_DESTRUCTOR_P (function)
- && (DECL_ASSEMBLER_NAME (function)
- != DECL_NAME (function))
- && (DECL_ASSEMBLER_NAME (fndecl)
- != DECL_NAME (fndecl))
- && (DECL_ASSEMBLER_NAME (function)
- == DECL_ASSEMBLER_NAME (fndecl)))
- return fndecl;
/* We cannot simply call decls_match because this
doesn't work for static member functions that are
@@ -1544,11 +1479,6 @@ finish_static_data_member_decl (decl, init, asmspec_tree, flags)
tree asmspec_tree;
int flags;
{
- const char *asmspec = 0;
-
- if (asmspec_tree)
- asmspec = TREE_STRING_POINTER (asmspec_tree);
-
my_friendly_assert (TREE_PUBLIC (decl), 0);
DECL_CONTEXT (decl) = current_class_type;
@@ -1557,15 +1487,9 @@ finish_static_data_member_decl (decl, init, asmspec_tree, flags)
decl of our TREE_CHAIN. Instead, we modify cp_finish_decl to do
the right thing, namely, to put this decl out straight away. */
/* current_class_type can be NULL_TREE in case of error. */
- if (!asmspec && current_class_type)
- {
- DECL_INITIAL (decl) = error_mark_node;
- if (flag_new_abi)
- DECL_ASSEMBLER_NAME (decl) = mangle_decl (decl);
- else
- DECL_ASSEMBLER_NAME (decl)
- = build_static_name (current_class_type, DECL_NAME (decl));
- }
+ if (!asmspec_tree && current_class_type)
+ DECL_INITIAL (decl) = error_mark_node;
+
if (! processing_template_decl)
{
if (!pending_statics)
@@ -1695,18 +1619,6 @@ grokfield (declarator, declspecs, init, asmspec_tree, attrlist)
if (CLASS_TYPE_P (TREE_TYPE (value)))
CLASSTYPE_GOT_SEMICOLON (TREE_TYPE (value)) = 1;
- /* Now that we've updated the context, we need to remangle the
- name for this TYPE_DECL. */
- DECL_ASSEMBLER_NAME (value) = DECL_NAME (value);
- if (!uses_template_parms (value))
- {
- if (flag_new_abi)
- DECL_ASSEMBLER_NAME (value) = mangle_type (TREE_TYPE (value));
- else
- DECL_ASSEMBLER_NAME (value) =
- get_identifier (build_overload_name (TREE_TYPE (value), 1, 1));
- }
-
if (processing_template_decl)
value = push_template_decl (value);
@@ -1804,8 +1716,8 @@ grokfield (declarator, declspecs, init, asmspec_tree, attrlist)
{
/* This must override the asm specifier which was placed
by grokclassfn. Lay this out fresh. */
- DECL_RTL (value) = NULL_RTX;
- DECL_ASSEMBLER_NAME (value) = get_identifier (asmspec);
+ SET_DECL_RTL (value, NULL_RTX);
+ SET_DECL_ASSEMBLER_NAME (value, get_identifier (asmspec));
}
cp_finish_decl (value, init, asmspec_tree, flags);
@@ -1886,10 +1798,7 @@ grokoptypename (declspecs, declarator)
tree declspecs, declarator;
{
tree t = grokdeclarator (declarator, declspecs, TYPENAME, 0, NULL_TREE);
- if (flag_new_abi)
- return mangle_conv_op_name_for_type (t);
- else
- return build_typename_overload (t);
+ return mangle_conv_op_name_for_type (t);
}
/* When a function is declared with an initializer,
@@ -1960,25 +1869,8 @@ grok_function_init (decl, init)
if (TREE_CODE (type) == FUNCTION_TYPE)
cp_error ("initializer specified for non-member function `%D'", decl);
-#if 0
- /* We'll check for this in finish_struct_1. */
- else if (DECL_VINDEX (decl) == NULL_TREE)
- cp_error ("initializer specified for non-virtual member function `%D'", decl);
-#endif
else if (integer_zerop (init))
{
-#if 0
- /* Mark this function as being "defined". */
- DECL_INITIAL (decl) = error_mark_node;
- /* pure virtual destructors must be defined. */
- /* pure virtual needs to be defined (as abort) only when put in
- vtbl. For wellformed call, it should be itself. pr4737 */
- if (!DECL_DESTRUCTOR_P (decl)))
- {
- /* Give this node rtl from `abort'. */
- DECL_RTL (decl) = DECL_RTL (abort_fndecl);
- }
-#endif
DECL_PURE_VIRTUAL_P (decl) = 1;
if (DECL_OVERLOADED_OPERATOR_P (decl) == NOP_EXPR)
{
@@ -2216,6 +2108,9 @@ finish_anon_union (anon_union_decl)
int static_p = TREE_STATIC (anon_union_decl);
int external_p = DECL_EXTERNAL (anon_union_decl);
+ /* The VAR_DECL's context is the same as the TYPE's context. */
+ DECL_CONTEXT (anon_union_decl) = DECL_CONTEXT (TYPE_NAME (type));
+
if (TYPE_FIELDS (type) == NULL_TREE)
return;
@@ -2238,7 +2133,7 @@ finish_anon_union (anon_union_decl)
if (static_p)
{
make_decl_rtl (main_decl, 0);
- DECL_RTL (anon_union_decl) = DECL_RTL (main_decl);
+ COPY_DECL_RTL (main_decl, anon_union_decl);
expand_anon_union_decl (anon_union_decl,
NULL_TREE,
DECL_ANON_UNION_ELEMS (anon_union_decl));
@@ -2373,7 +2268,8 @@ mark_vtable_entries (decl)
fnaddr = (flag_vtable_thunks ? TREE_VALUE (entries)
: FNADDR_FROM_VTABLE_ENTRY (TREE_VALUE (entries)));
- if (TREE_CODE (fnaddr) != ADDR_EXPR)
+ if (TREE_CODE (fnaddr) != ADDR_EXPR
+ && TREE_CODE (fnaddr) != FDESC_EXPR)
/* This entry is an offset: a virtual base class offset, a
virtual call offset, and RTTI offset, etc. */
continue;
@@ -2385,7 +2281,7 @@ mark_vtable_entries (decl)
we know all the thunks we'll need when we emit a virtual
function, so we emit the thunks there instead. */
if (DECL_THUNK_P (fn))
- use_thunk (fn, THUNK_GENERATE_WITH_VTABLE_P (fn));
+ use_thunk (fn, /*emit_p=*/0);
mark_used (fn);
}
}
@@ -2488,7 +2384,7 @@ key_method (type)
for (method = TYPE_METHODS (type); method != NULL_TREE;
method = TREE_CHAIN (method))
if (DECL_VINDEX (method) != NULL_TREE
- && ! DECL_THIS_INLINE (method)
+ && ! DECL_DECLARED_INLINE_P (method)
&& ! DECL_PURE_VIRTUAL_P (method))
return method;
@@ -2740,7 +2636,8 @@ import_export_decl (decl)
if ((DECL_IMPLICIT_INSTANTIATION (decl)
|| DECL_FRIEND_PSEUDO_TEMPLATE_INSTANTIATION (decl))
&& (flag_implicit_templates
- || (flag_implicit_inline_templates && DECL_THIS_INLINE (decl))))
+ || (flag_implicit_inline_templates
+ && DECL_DECLARED_INLINE_P (decl))))
{
if (!TREE_PUBLIC (decl))
/* Templates are allowed to have internal linkage. See
@@ -2754,23 +2651,24 @@ import_export_decl (decl)
}
else if (DECL_FUNCTION_MEMBER_P (decl))
{
- tree ctype = DECL_CONTEXT (decl);
- import_export_class (ctype);
- if (CLASSTYPE_INTERFACE_KNOWN (ctype)
- && (flag_new_abi
- ? (! DECL_THIS_INLINE (decl))
- : (! DECL_ARTIFICIAL (decl) || DECL_VINDEX (decl))))
+ if (!DECL_DECLARED_INLINE_P (decl))
{
- DECL_NOT_REALLY_EXTERN (decl)
- = ! (CLASSTYPE_INTERFACE_ONLY (ctype)
- || (DECL_THIS_INLINE (decl) && ! flag_implement_inlines
- && !DECL_VINDEX (decl)));
-
- /* Always make artificials weak. */
- if (DECL_ARTIFICIAL (decl) && flag_weak)
- comdat_linkage (decl);
- else
- maybe_make_one_only (decl);
+ tree ctype = DECL_CONTEXT (decl);
+ import_export_class (ctype);
+ if (CLASSTYPE_INTERFACE_KNOWN (ctype))
+ {
+ DECL_NOT_REALLY_EXTERN (decl)
+ = ! (CLASSTYPE_INTERFACE_ONLY (ctype)
+ || (DECL_DECLARED_INLINE_P (decl)
+ && ! flag_implement_inlines
+ && !DECL_VINDEX (decl)));
+
+ /* Always make artificials weak. */
+ if (DECL_ARTIFICIAL (decl) && flag_weak)
+ comdat_linkage (decl);
+ else
+ maybe_make_one_only (decl);
+ }
}
else
comdat_linkage (decl);
@@ -2797,7 +2695,8 @@ import_export_decl (decl)
{
DECL_NOT_REALLY_EXTERN (decl)
= ! (CLASSTYPE_INTERFACE_ONLY (ctype)
- || (DECL_THIS_INLINE (decl) && ! flag_implement_inlines
+ || (DECL_DECLARED_INLINE_P (decl)
+ && ! flag_implement_inlines
&& !DECL_VINDEX (decl)));
/* Always make artificials weak. */
@@ -2846,23 +2745,7 @@ get_guard (decl)
tree sname;
tree guard;
- /* For a local variable, under the old ABI, we do not try to get a
- unique mangled name for the DECL. */
- if (!flag_new_abi && DECL_FUNCTION_SCOPE_P (decl))
- {
- guard = get_temp_name (integer_type_node);
- cp_finish_decl (guard, NULL_TREE, NULL_TREE, 0);
- return guard;
- }
-
- if (!flag_new_abi)
- /* For struct X foo __attribute__((weak)), there is a counter
- __snfoo. Since base is already an assembler name, sname should
- be globally unique */
- sname = get_id_2 ("__sn", DECL_ASSEMBLER_NAME (decl));
- else
- sname = mangle_guard_variable (decl);
-
+ sname = mangle_guard_variable (decl);
guard = IDENTIFIER_GLOBAL_VALUE (sname);
if (! guard)
{
@@ -2870,11 +2753,7 @@ get_guard (decl)
/* Under the new ABI, we use a type that is big enough to
contain a mutex as well as an integer counter. */
- if (flag_new_abi)
- guard_type = long_long_integer_type_node;
- else
- guard_type = integer_type_node;
-
+ guard_type = long_long_integer_type_node;
guard = build_decl (VAR_DECL, sname, guard_type);
/* The guard should have the same linkage as what it guards. */
@@ -2900,9 +2779,6 @@ static tree
get_guard_bits (guard)
tree guard;
{
- if (!flag_new_abi)
- return guard;
-
/* Under the new ABI, we only set the first byte of the guard,
in order to leave room for a mutex in the high-order bits. */
guard = build1 (ADDR_EXPR,
@@ -3332,10 +3208,13 @@ start_static_initialization_or_destruction (decl, initp)
my_friendly_assert (initp, 20000629);
guard_cond = get_guard_cond (guard);
}
- /* Under the old ABI, e do initializations only if the GUARD is
- zero, i.e., if we are the first to initialize the variable.
- We do destructions only if the GUARD is one, i.e., if we are
- the last to destroy the variable. */
+ /* If we don't have __cxa_atexit, then we will be running
+ destructors from .fini sections, or their equivalents. So,
+ we need to know how many times we've tried to initialize this
+ object. We do initializations only if the GUARD is zero,
+ i.e., if we are the first to initialize the variable. We do
+ destructions only if the GUARD is one, i.e., if we are the
+ last to destroy the variable. */
else if (initp)
guard_cond
= cp_build_binary_op (EQ_EXPR,
@@ -3356,9 +3235,9 @@ start_static_initialization_or_destruction (decl, initp)
finish_if_stmt_cond (cond, guard_if_stmt);
- /* Under the new ABI, we have not already set the GUARD, so we must
- do so now. */
- if (guard && initp && flag_new_abi)
+ /* If we're using __cxa_atexit, we have not already set the GUARD,
+ so we must do so now. */
+ if (guard && initp && flag_use_cxa_atexit)
finish_expr_stmt (set_guard (guard));
return guard_if_stmt;
@@ -3629,8 +3508,7 @@ finish_file ()
timevar_push (TV_VARCONST);
- if (new_abi_rtti_p ())
- emit_support_tinfos ();
+ emit_support_tinfos ();
do
{
@@ -3650,8 +3528,7 @@ finish_file ()
/* Write out needed type info variables. Writing out one variable
might cause others to be needed. */
- if (new_abi_rtti_p ()
- && walk_globals (tinfo_decl_p, emit_tinfo_decl, /*data=*/0))
+ if (walk_globals (tinfo_decl_p, emit_tinfo_decl, /*data=*/0))
reconsider = 1;
/* The list of objects with static storage duration is built up
@@ -3724,19 +3601,12 @@ finish_file ()
finish_function doesn't clean things up, and we end
up with CURRENT_FUNCTION_DECL set. */
push_to_top_level ();
- if (DECL_TINFO_FN_P (decl))
- synthesize_tinfo_fn (decl);
- else
- synthesize_method (decl);
+ synthesize_method (decl);
pop_from_top_level ();
reconsider = 1;
}
}
- /* Mark all functions that might deal with exception-handling as
- referenced. */
- mark_all_runtime_matches ();
-
/* We lie to the back-end, pretending that some functions are
not defined when they really are. This keeps these functions
from being put out unnecessarily. But, we must stop lying
@@ -3842,9 +3712,17 @@ finish_file ()
/* The entire file is now complete. If requested, dump everything
to a file. */
- if (flag_dump_translation_unit)
- dump_node_to_file (global_namespace, flag_dump_translation_unit);
+ {
+ int flags;
+ FILE *stream = dump_begin (TDI_all, &flags);
+ if (stream)
+ {
+ dump_node (global_namespace, flags & ~TDF_SLIM, stream);
+ dump_end (TDI_all, stream);
+ }
+ }
+
/* If there's some tool that wants to examine the entire translation
unit, let it do so now. */
if (back_end_hook)
@@ -4400,9 +4278,26 @@ merge_functions (s1, s2)
{
for (; s2; s2 = OVL_NEXT (s2))
{
- tree fn = OVL_CURRENT (s2);
- if (! ovl_member (fn, s1))
- s1 = build_overload (fn, s1);
+ tree fn2 = OVL_CURRENT (s2);
+ tree fns1;
+
+ for (fns1 = s1; fns1; fns1 = OVL_NEXT (fns1))
+ {
+ tree fn1 = OVL_CURRENT (fns1);
+
+ /* If the function from S2 is already in S1, there is no
+ need to add it again. For `extern "C"' functions, we
+ might have two FUNCTION_DECLs for the same function, in
+ different namespaces; again, we only need one of them. */
+ if (fn1 == fn2
+ || (DECL_EXTERN_C_P (fn1) && DECL_EXTERN_C_P (fn2)
+ && DECL_NAME (fn1) == DECL_NAME (fn2)))
+ break;
+ }
+
+ /* If we exhausted all of the functions in S1, FN2 is new. */
+ if (!fns1)
+ s1 = build_overload (fn2, s1);
}
return s1;
}
@@ -4598,6 +4493,9 @@ set_decl_namespace (decl, scope, friendp)
if (!old)
/* No old declaration at all. */
goto complain;
+ /* A template can be explicitly specialized in any namespace. */
+ if (processing_explicit_instantiation)
+ return;
if (!is_overloaded_fn (decl))
/* Don't compare non-function decls with decls_match here,
since it can't check for the correct constness at this
@@ -5091,16 +4989,6 @@ validate_nonmember_using_decl (decl, scope, name)
if (TREE_CODE (decl) == SCOPE_REF
&& TREE_OPERAND (decl, 0) == fake_std_node)
{
- if (namespace_bindings_p ()
- && current_namespace == global_namespace)
- /* There's no need for a using declaration at all, here,
- since `std' is the same as `::'. We can't just pass this
- on because we'll complain later about declaring something
- in the same scope as a using declaration with the same
- name. We return NULL_TREE which indicates to the caller
- that there's no need to do any further processing. */
- return NULL_TREE;
-
*scope = global_namespace;
*name = TREE_OPERAND (decl, 1);
}
@@ -5113,7 +5001,8 @@ validate_nonmember_using_decl (decl, scope, name)
A using-declaration for a class member shall be a
member-declaration. */
- if (TREE_CODE (*scope) != NAMESPACE_DECL)
+ if (!processing_template_decl
+ && TREE_CODE (*scope) != NAMESPACE_DECL)
{
if (TYPE_P (*scope))
cp_error ("`%T' is not a namespace", *scope);
@@ -5185,22 +5074,21 @@ do_nonmember_using_decl (scope, name, oldval, oldtype, newval, newtype)
{
tree old_fn = OVL_CURRENT (tmp1);
- if (!OVL_USED (tmp1)
- && compparms (TYPE_ARG_TYPES (TREE_TYPE (new_fn)),
- TYPE_ARG_TYPES (TREE_TYPE (old_fn))))
+ if (new_fn == old_fn)
+ /* The function already exists in the current namespace. */
+ break;
+ else if (OVL_USED (tmp1))
+ continue; /* this is a using decl */
+ else if (compparms (TYPE_ARG_TYPES (TREE_TYPE (new_fn)),
+ TYPE_ARG_TYPES (TREE_TYPE (old_fn))))
{
- if (!(DECL_EXTERN_C_P (new_fn)
- && DECL_EXTERN_C_P (old_fn)))
- /* There was already a non-using declaration in
- this scope with the same parameter types. */
- cp_error ("`%D' is already declared in this scope",
- name);
+ /* There was already a non-using declaration in
+ this scope with the same parameter types. If both
+ are the same extern "C" functions, that's ok. */
+ if (!decls_match (new_fn, old_fn))
+ cp_error ("`%D' is already declared in this scope", name);
break;
}
- else if (duplicate_decls (new_fn, old_fn))
- /* We're re-using something we already used
- before. We don't need to add it again. */
- break;
}
/* If we broke out of the loop, there's no reason to add
@@ -5272,6 +5160,10 @@ do_local_using_decl (decl)
if (decl == NULL_TREE)
return;
+ if (building_stmt_tree ()
+ && at_function_scope_p ())
+ add_decl_stmt (decl);
+
oldval = lookup_name_current_level (name);
oldtype = lookup_type_current_level (name);
@@ -5339,18 +5231,23 @@ do_using_directive (namespace)
{
if (namespace == fake_std_node)
return;
+ if (building_stmt_tree ())
+ add_stmt (build_stmt (USING_STMT, namespace));
+
/* using namespace A::B::C; */
if (TREE_CODE (namespace) == SCOPE_REF)
namespace = TREE_OPERAND (namespace, 1);
if (TREE_CODE (namespace) == IDENTIFIER_NODE)
{
/* Lookup in lexer did not find a namespace. */
- cp_error ("namespace `%T' undeclared", namespace);
+ if (!processing_template_decl)
+ cp_error ("namespace `%T' undeclared", namespace);
return;
}
if (TREE_CODE (namespace) != NAMESPACE_DECL)
{
- cp_error ("`%T' is not a namespace", namespace);
+ if (!processing_template_decl)
+ cp_error ("`%T' is not a namespace", namespace);
return;
}
namespace = ORIGINAL_NAMESPACE (namespace);
diff --git a/gcc/cp/dump.c b/gcc/cp/dump.c
index 9be8d88921f..6fdbdb556d9 100644
--- a/gcc/cp/dump.c
+++ b/gcc/cp/dump.c
@@ -1,5 +1,5 @@
/* Tree-dumping functionality for intermediate representation.
- Copyright (C) 1999, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
Written by Mark Mitchell <mark@codesourcery.com>
This file is part of GNU CC.
@@ -25,6 +25,25 @@ Boston, MA 02111-1307, USA. */
#include "cp-tree.h"
#include "c-dump.h"
+static void dump_access
+ PARAMS ((dump_info_p, tree));
+
+/* Dump a representation of the accessibility information associated
+ with T. */
+
+static void
+dump_access (di, t)
+ dump_info_p di;
+ tree t;
+{
+ if (TREE_PROTECTED(t))
+ dump_string (di, "protected");
+ else if (TREE_PRIVATE(t))
+ dump_string (di, "private");
+ else
+ dump_string (di, "public");
+}
+
int
cp_dump_tree (di, t)
dump_info_p di;
@@ -82,13 +101,34 @@ cp_dump_tree (di, t)
}
dump_child ("vfld", TYPE_VFIELD (t));
+
+ if (!dump_flag (di, TDF_SLIM, t))
+ {
+ int i;
+
+ for (i = 0; i < CLASSTYPE_N_BASECLASSES (t); ++i)
+ {
+ tree base_binfo = BINFO_BASETYPE (TYPE_BINFO (t), i);
+ dump_child ("base", BINFO_TYPE (base_binfo));
+ if (TREE_VIA_VIRTUAL (base_binfo))
+ dump_string (di, "virtual");
+ dump_access (di, base_binfo);
+ }
+ }
+ break;
+
+ case FIELD_DECL:
+ dump_access (di, t);
break;
case FUNCTION_DECL:
if (!DECL_THUNK_P (t))
{
- if (DECL_FUNCTION_MEMBER_P (t))
- dump_string (di, "member");
+ if (DECL_FUNCTION_MEMBER_P (t))
+ {
+ dump_string (di, "member");
+ dump_access (di, t);
+ }
if (DECL_CONSTRUCTOR_P (t))
dump_string (di, "constructor");
if (DECL_DESTRUCTOR_P (t))
@@ -124,7 +164,7 @@ cp_dump_tree (di, t)
break;
if (DECL_NAMESPACE_ALIAS (t))
dump_child ("alis", DECL_NAMESPACE_ALIAS (t));
- else
+ else if (!dump_flag (di, TDF_SLIM, t))
dump_child ("dcls", cp_namespace_decls (t));
break;
@@ -132,6 +172,7 @@ cp_dump_tree (di, t)
dump_child ("rslt", DECL_TEMPLATE_RESULT (t));
dump_child ("inst", DECL_TEMPLATE_INSTANTIATIONS (t));
dump_child ("spcs", DECL_TEMPLATE_SPECIALIZATIONS (t));
+ dump_child ("prms", DECL_TEMPLATE_PARMS (t));
break;
case OVERLOAD:
@@ -148,6 +189,13 @@ cp_dump_tree (di, t)
dump_next_stmt (di, t);
break;
+ case EH_SPEC_BLOCK:
+ dump_stmt (di, t);
+ dump_child ("body", EH_SPEC_STMTS (t));
+ dump_child ("raises", EH_SPEC_RAISES (t));
+ dump_next_stmt (di, t);
+ break;
+
case PTRMEM_CST:
dump_child ("clas", PTRMEM_CST_CLASS (t));
dump_child ("mbr", PTRMEM_CST_MEMBER (t));
@@ -187,6 +235,12 @@ cp_dump_tree (di, t)
dump_next_stmt (di, t);
break;
+ case MUST_NOT_THROW_EXPR:
+ dump_stmt (di, t);
+ dump_child ("body", TREE_OPERAND (t, 0));
+ dump_next_stmt (di, t);
+ break;
+
case SUBOBJECT:
dump_stmt (di, t);
dump_child ("clnp", TREE_OPERAND (t, 0));
@@ -199,6 +253,12 @@ cp_dump_tree (di, t)
dump_next_stmt (di, t);
break;
+ case USING_STMT:
+ dump_stmt (di, t);
+ dump_child ("nmsp", USING_STMT_NAMESPACE (t));
+ dump_next_stmt (di, t);
+ break;
+
default:
break;
}
diff --git a/gcc/cp/errfn.c b/gcc/cp/errfn.c
index 802f5676ee7..351dba95888 100644
--- a/gcc/cp/errfn.c
+++ b/gcc/cp/errfn.c
@@ -265,8 +265,7 @@ cp_deprecated (msg)
extern int warn_deprecated;
if (!warn_deprecated)
return;
- cp_warning ("%s is deprecated.", msg);
- cp_warning ("Please see the documentation for details.");
+ cp_warning ("%s is deprecated, please see the documentation for details", msg);
}
void
diff --git a/gcc/cp/error.c b/gcc/cp/error.c
index 5ecdab71fed..660dfe8d708 100644
--- a/gcc/cp/error.c
+++ b/gcc/cp/error.c
@@ -23,6 +23,7 @@ Boston, MA 02111-1307, USA. */
#include "system.h"
#include "tree.h"
#include "cp-tree.h"
+#include "real.h"
#include "obstack.h"
#include "toplev.h"
#include "diagnostic.h"
@@ -873,29 +874,17 @@ ident_fndecl (t)
return NULL_TREE;
}
-#ifndef NO_DOLLAR_IN_LABEL
-# define GLOBAL_THING "_GLOBAL_$"
-#else
-# ifndef NO_DOT_IN_LABEL
-# define GLOBAL_THING "_GLOBAL_."
-# else
-# define GLOBAL_THING "_GLOBAL__"
-# endif
-#endif
-
-#define GLOBAL_IORD_P(NODE) \
- ! strncmp (IDENTIFIER_POINTER(NODE), GLOBAL_THING, sizeof (GLOBAL_THING) - 1)
+#define GLOBAL_THING "_GLOBAL__"
static void
dump_global_iord (t)
tree t;
{
- const char *name = IDENTIFIER_POINTER (t);
const char *p = NULL;
- if (name [sizeof (GLOBAL_THING) - 1] == 'I')
+ if (DECL_GLOBAL_CTOR_P (t))
p = "initializers";
- else if (name [sizeof (GLOBAL_THING) - 1] == 'D')
+ else if (DECL_GLOBAL_DTOR_P (t))
p = "destructors";
else
my_friendly_abort (352);
@@ -1041,8 +1030,8 @@ dump_decl (t, flags)
/* Fall through. */
case FUNCTION_DECL:
- if (GLOBAL_IORD_P (DECL_ASSEMBLER_NAME (t)))
- dump_global_iord (DECL_ASSEMBLER_NAME (t));
+ if (DECL_GLOBAL_CTOR_P (t) || DECL_GLOBAL_DTOR_P (t))
+ dump_global_iord (t);
else if (! DECL_LANG_SPECIFIC (t))
print_identifier (scratch_buffer, "<internal>");
else
@@ -1203,7 +1192,7 @@ dump_function_decl (t, flags)
}
fntype = TREE_TYPE (t);
- parmtypes = TYPE_ARG_TYPES (fntype);
+ parmtypes = FUNCTION_FIRST_USER_PARMTYPE (t);
if (DECL_CLASS_SCOPE_P (t))
cname = DECL_CONTEXT (t);
@@ -1241,14 +1230,6 @@ dump_function_decl (t, flags)
if (flags & TFF_DECL_SPECIFIERS)
{
- if (TREE_CODE (fntype) == METHOD_TYPE && parmtypes)
- /* Skip "this" parameter. */
- parmtypes = TREE_CHAIN (parmtypes);
-
- /* Skip past the "in_charge" parameter. */
- if (DECL_HAS_IN_CHARGE_PARM_P (t))
- parmtypes = TREE_CHAIN (parmtypes);
-
dump_parameters (parmtypes, flags);
if (show_return)
@@ -1963,7 +1944,7 @@ dump_expr (t, flags)
t = TYPE_METHOD_BASETYPE (t);
virtuals = TYPE_BINFO_VIRTUALS (TYPE_MAIN_VARIANT (t));
- n = tree_low_cst (idx, 0) - first_vfun_index (t);
+ n = tree_low_cst (idx, 0);
/* Map vtable index back one, to allow for the null pointer to
member. */
@@ -2123,7 +2104,7 @@ dump_expr (t, flags)
break;
case BIND_EXPR:
- output_add_character (scratch_buffer, '}');
+ output_add_character (scratch_buffer, '{');
dump_expr (TREE_OPERAND (t, 1), flags & ~TFF_EXPR_IN_PARENS);
output_add_character (scratch_buffer, '}');
break;
diff --git a/gcc/cp/except.c b/gcc/cp/except.c
index bcca6863bcb..f558f5a539b 100644
--- a/gcc/cp/except.c
+++ b/gcc/cp/except.c
@@ -34,276 +34,78 @@ Boston, MA 02111-1307, USA. */
#include "output.h"
#include "except.h"
#include "toplev.h"
-#include "eh-common.h"
static void push_eh_cleanup PARAMS ((tree));
+static tree prepare_eh_type PARAMS ((tree));
static tree build_eh_type_type PARAMS ((tree));
-static tree call_eh_info PARAMS ((void));
-static void push_eh_info PARAMS ((void));
-static tree get_eh_info PARAMS ((void));
-static tree get_eh_value PARAMS ((void));
-#if 0
-static tree get_eh_type PARAMS ((void));
-static tree get_eh_caught PARAMS ((void));
-static tree get_eh_handlers PARAMS ((void));
-#endif
+static tree do_begin_catch PARAMS ((void));
static int dtor_nothrow PARAMS ((tree));
-static tree do_pop_exception PARAMS ((tree));
-static tree build_eh_type_type_ref PARAMS ((tree));
-static tree build_terminate_handler PARAMS ((void));
-static tree alloc_eh_object PARAMS ((tree));
+static tree do_end_catch PARAMS ((tree));
+static void push_eh_cleanup PARAMS ((tree));
+static bool decl_is_java_type PARAMS ((tree decl, int err));
+static void initialize_handler_parm PARAMS ((tree, tree));
+static tree do_allocate_exception PARAMS ((tree));
static int complete_ptr_ref_or_void_ptr_p PARAMS ((tree, tree));
+static bool is_admissible_throw_operand PARAMS ((tree));
static int can_convert_eh PARAMS ((tree, tree));
static void check_handlers_1 PARAMS ((tree, tree));
-static void initialize_handler_parm PARAMS ((tree));
-static tree expand_throw PARAMS ((tree));
-static int decl_is_java_type PARAMS ((tree decl, int err));
+static tree cp_protect_cleanup_actions PARAMS ((void));
#include "decl.h"
-#include "insn-flags.h"
#include "obstack.h"
-/* In a given translation unit we are constrained to catch only C++
- types or only Java types. `catch_language' holds the current type,
- and `catch_language_init' registers whether `catch_language' has
- been set. */
-
-static int catch_language_init = 0;
-static int catch_language;
-
-/* ======================================================================
- Briefly the algorithm works like this:
-
- When a constructor or start of a try block is encountered,
- push_eh_entry (&eh_stack) is called. Push_eh_entry () creates a
- new entry in the unwind protection stack and returns a label to
- output to start the protection for that block.
-
- When a destructor or end try block is encountered, pop_eh_entry
- (&eh_stack) is called. Pop_eh_entry () returns the eh_entry it
- created when push_eh_entry () was called. The eh_entry structure
- contains three things at this point. The start protect label,
- the end protect label, and the exception handler label. The end
- protect label should be output before the call to the destructor
- (if any). If it was a destructor, then its parse tree is stored
- in the finalization variable in the eh_entry structure. Otherwise
- the finalization variable is set to NULL to reflect the fact that
- it is the end of a try block. Next, this modified eh_entry node
- is enqueued in the finalizations queue by calling
- enqueue_eh_entry (&queue,entry).
-
- +---------------------------------------------------------------+
- |XXX: Will need modification to deal with partially |
- | constructed arrays of objects |
- | |
- | Basically, this consists of keeping track of how many |
- | of the objects have been constructed already (this |
- | should be in a register though, so that shouldn't be a |
- | problem. |
- +---------------------------------------------------------------+
-
- When a catch block is encountered, there is a lot of work to be
- done.
-
- Since we don't want to generate the catch block inline with the
- regular flow of the function, we need to have some way of doing
- so. Luckily, we can use sequences to defer the catch sections.
- When the start of a catch block is encountered, we start the
- sequence. After the catch block is generated, we end the
- sequence.
-
- Next we must insure that when the catch block is executed, all
- finalizations for the matching try block have been completed. If
- any of those finalizations throw an exception, we must call
- terminate according to the ARM (section r.15.6.1). What this
- means is that we need to dequeue and emit finalizations for each
- entry in the eh_queue until we get to an entry with a NULL
- finalization field. For any of the finalization entries, if it
- is not a call to terminate (), we must protect it by giving it
- another start label, end label, and exception handler label,
- setting its finalization tree to be a call to terminate (), and
- enqueue'ing this new eh_entry to be output at an outer level.
- Finally, after all that is done, we can get around to outputting
- the catch block which basically wraps all the "catch (...) {...}"
- statements in a big if/then/else construct that matches the
- correct block to call.
-
- ===================================================================== */
-
-/* ====================================================================== */
-
-/* sets up all the global eh stuff that needs to be initialized at the
+/* Sets up all the global eh stuff that needs to be initialized at the
start of compilation. */
void
init_exception_processing ()
{
- /* void vtype () */
- tree vtype = build_function_type (void_type_node, void_list_node);
-
+ tree tmp;
+
if (flag_honor_std)
push_namespace (std_identifier);
- terminate_node = build_cp_library_fn_ptr ("terminate", vtype);
+
+ /* void std::terminate (); */
+ tmp = build_function_type (void_type_node, void_list_node);
+ terminate_node = build_cp_library_fn_ptr ("terminate", tmp);
TREE_THIS_VOLATILE (terminate_node) = 1;
TREE_NOTHROW (terminate_node) = 1;
if (flag_honor_std)
pop_namespace ();
- set_exception_lang_code (EH_LANG_C_plus_plus);
- set_exception_version_code (1);
-
- /* If we use setjmp/longjmp EH, arrange for all cleanup actions to
- be protected with __terminate. */
- protect_cleanup_actions_with_terminate = 1;
-}
-
-/* Retrieve a pointer to the cp_eh_info node for the current exception. */
-
-static tree
-call_eh_info ()
-{
- tree fn;
-
- fn = get_identifier ("__start_cp_handler");
- if (IDENTIFIER_GLOBAL_VALUE (fn))
- fn = IDENTIFIER_GLOBAL_VALUE (fn);
- else
- {
- tree t1, t, fields[7];
-
- /* Declare cp_eh_info * __start_cp_handler (void),
- as defined in exception.cc. */
-
- /* struct cp_eh_info. This must match exception.cc. Note that this
- type is not pushed anywhere. */
- t1= make_aggr_type (RECORD_TYPE);
- fields[0] = build_decl (FIELD_DECL,
- get_identifier ("handler_label"), ptr_type_node);
- fields[1] = build_decl (FIELD_DECL,
- get_identifier ("dynamic_handler_chain"), ptr_type_node);
- fields[2] = build_decl (FIELD_DECL,
- get_identifier ("info"), ptr_type_node);
- fields[3] = build_decl (FIELD_DECL,
- get_identifier ("table_index"), ptr_type_node);
- /* N.B.: The fourth field LEN is expected to be
- the number of fields - 1, not the total number of fields. */
- finish_builtin_type (t1, "eh_context", fields, 3, ptr_type_node);
- t1 = build_pointer_type (t1);
-
- t1= make_aggr_type (RECORD_TYPE);
- fields[0] = build_decl (FIELD_DECL,
- get_identifier ("match_function"), ptr_type_node);
- fields[1] = build_decl (FIELD_DECL,
- get_identifier ("language"), short_integer_type_node);
- fields[2] = build_decl (FIELD_DECL,
- get_identifier ("version"), short_integer_type_node);
- /* N.B.: The fourth field LEN is expected to be
- the number of fields - 1, not the total number of fields. */
- finish_builtin_type (t1, "__eh_info", fields, 2, ptr_type_node);
- t = make_aggr_type (RECORD_TYPE);
- fields[0] = build_decl (FIELD_DECL,
- get_identifier ("eh_info"), t1);
- fields[1] = build_decl (FIELD_DECL, get_identifier ("value"),
- ptr_type_node);
- fields[2] = build_decl (FIELD_DECL, get_identifier ("type"),
- ptr_type_node);
- fields[3] = build_decl
- (FIELD_DECL, get_identifier ("cleanup"),
- build_pointer_type (build_function_type
- (ptr_type_node, tree_cons
- (NULL_TREE, ptr_type_node, void_list_node))));
- fields[4] = build_decl (FIELD_DECL, get_identifier ("caught"),
- boolean_type_node);
- fields[5] = build_decl (FIELD_DECL, get_identifier ("next"),
- build_pointer_type (t));
- fields[6] = build_decl
- (FIELD_DECL, get_identifier ("handlers"), long_integer_type_node);
- /* N.B.: The fourth field LEN is expected to be
- the number of fields - 1, not the total number of fields. */
- finish_builtin_type (t, "cp_eh_info", fields, 6, ptr_type_node);
- t = build_pointer_type (t);
-
- /* And now the function. */
- fn = push_library_fn (fn, build_function_type (t, void_list_node));
- }
- return build_function_call (fn, NULL_TREE);
-}
-
-/* Retrieve a pointer to the cp_eh_info node for the current exception
- and save it in the current binding level. */
-
-static void
-push_eh_info ()
-{
- tree decl, fn = call_eh_info ();
-
- /* Remember the pointer to the current exception info; it won't change
- during this catch block. */
- decl = build_decl (VAR_DECL, get_identifier ("__exception_info"),
- TREE_TYPE (fn));
- DECL_ARTIFICIAL (decl) = 1;
- DECL_INITIAL (decl) = fn;
- decl = pushdecl (decl);
- cp_finish_decl (decl, fn, NULL_TREE, 0);
-}
-
-/* Returns a reference to the cp_eh_info node for the current exception. */
-
-static tree
-get_eh_info ()
-{
- /* Look for the pointer pushed in push_eh_info. */
- tree t = lookup_name (get_identifier ("__exception_info"), 0);
- return build_indirect_ref (t, NULL_PTR);
-}
-
-/* Returns a reference to the current exception object. */
-
-static tree
-get_eh_value ()
-{
- return build_component_ref (get_eh_info (), get_identifier ("value"),
- NULL_TREE, 0);
-}
-
-/* Returns a reference to the current exception type. */
-
-#if 0
-static tree
-get_eh_type ()
-{
- return build_component_ref (get_eh_info (), get_identifier ("type"),
- NULL_TREE, 0);
-}
+ /* void __cxa_call_unexpected(void *); */
+ tmp = tree_cons (NULL_TREE, ptr_type_node, void_list_node);
+ tmp = build_function_type (void_type_node, tmp);
+ call_unexpected_node
+ = push_throw_library_fn (get_identifier ("__cxa_call_unexpected"), tmp);
-/* Returns a reference to whether or not the current exception
- has been caught. */
+ eh_personality_libfunc = init_one_libfunc (USING_SJLJ_EXCEPTIONS
+ ? "__gxx_personality_sj0"
+ : "__gxx_personality_v0");
-static tree
-get_eh_caught ()
-{
- return build_component_ref (get_eh_info (), get_identifier ("caught"),
- NULL_TREE, 0);
+ lang_eh_runtime_type = build_eh_type_type;
+ lang_protect_cleanup_actions = &cp_protect_cleanup_actions;
}
-/* Returns a reference to whether or not the current exception
- has been caught. */
+/* Returns an expression to be executed if an unhandled exception is
+ propogated out of a cleanup region. */
static tree
-get_eh_handlers ()
+cp_protect_cleanup_actions ()
{
- return build_component_ref (get_eh_info (), get_identifier ("handlers"),
- NULL_TREE, 0);
-}
-#endif
+ /* [except.terminate]
-/* Build a type value for use at runtime for a type that is matched
- against by the exception handling system. */
+ When the destruction of an object during stack unwinding exits
+ using an exception ... void terminate(); is called. */
+ return build_call (terminate_node, NULL_TREE);
+}
static tree
-build_eh_type_type (type)
+prepare_eh_type (type)
tree type;
{
+ if (type == NULL_TREE)
+ return type;
if (type == error_mark_node)
return error_mark_node;
@@ -314,14 +116,14 @@ build_eh_type_type (type)
/* Peel off cv qualifiers. */
type = TYPE_MAIN_VARIANT (type);
- return build1 (ADDR_EXPR, ptr_type_node, get_typeid_1 (type));
+ return type;
}
/* Build the address of a typeinfo decl for use in the runtime
- matching field of the new exception model */
+ matching field of the exception model. */
static tree
-build_eh_type_type_ref (type)
+build_eh_type_type (type)
tree type;
{
tree exp;
@@ -329,47 +131,43 @@ build_eh_type_type_ref (type)
if (type == NULL_TREE || type == error_mark_node)
return type;
- /* peel back references, so they match. */
- if (TREE_CODE (type) == REFERENCE_TYPE)
- type = TREE_TYPE (type);
-
- /* Peel off cv qualifiers. */
- type = TYPE_MAIN_VARIANT (type);
+ if (decl_is_java_type (type, 0))
+ exp = build_java_class_ref (TREE_TYPE (type));
+ else
+ exp = get_tinfo_decl (type);
- exp = get_tinfo_decl (type);
mark_used (exp);
exp = build1 (ADDR_EXPR, ptr_type_node, exp);
- return (exp);
+ return exp;
+}
+
+tree
+build_exc_ptr ()
+{
+ return build (EXC_PTR_EXPR, ptr_type_node);
}
-/* This routine is called to mark all the symbols representing runtime
- type functions in the exception table as having been referenced.
- This will make sure code is emitted for them. Called from finish_file. */
+/* Build up a call to __cxa_begin_catch, to tell the runtime that the
+ exception has been handled. */
-void
-mark_all_runtime_matches ()
+static tree
+do_begin_catch ()
{
- int x,num;
- void **ptr;
- tree exp;
-
- num = find_all_handler_type_matches (&ptr);
- if (num == 0 || ptr == NULL)
- return;
-
- for (x=0; x <num; x++)
+ tree fn;
+
+ fn = get_identifier ("__cxa_begin_catch");
+ if (IDENTIFIER_GLOBAL_VALUE (fn))
+ fn = IDENTIFIER_GLOBAL_VALUE (fn);
+ else
{
- exp = (tree) ptr[x];
- if (TREE_CODE (exp) == ADDR_EXPR)
- {
- exp = TREE_OPERAND (exp, 0);
- if (TREE_CODE (exp) == FUNCTION_DECL)
- TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (exp)) = 1;
- }
+ /* Declare void* __cxa_begin_catch (void *). */
+ tree tmp = tree_cons (NULL_TREE, ptr_type_node, void_list_node);
+ fn = push_library_fn (fn, build_function_type (ptr_type_node, tmp));
}
-
- free (ptr);
+
+ return build_function_call (fn, tree_cons (NULL_TREE, build_exc_ptr (),
+ NULL_TREE));
}
/* Returns nonzero if cleaning up an exception of type TYPE (which can be
@@ -392,32 +190,29 @@ dtor_nothrow (type)
return TREE_NOTHROW (fn);
}
-/* Build up a call to __cp_pop_exception, to destroy the exception object
+/* Build up a call to __cxa_end_catch, to destroy the exception object
for the current catch block if no others are currently using it. */
static tree
-do_pop_exception (type)
+do_end_catch (type)
tree type;
{
tree fn, cleanup;
- fn = get_identifier ("__cp_pop_exception");
+
+ fn = get_identifier ("__cxa_end_catch");
if (IDENTIFIER_GLOBAL_VALUE (fn))
fn = IDENTIFIER_GLOBAL_VALUE (fn);
else
{
- /* Declare void __cp_pop_exception (void *),
- as defined in exception.cc. */
- fn = push_void_library_fn
- (fn, tree_cons (NULL_TREE, ptr_type_node, void_list_node));
+ /* Declare void __cxa_end_catch (). */
+ fn = push_void_library_fn (fn, void_list_node);
/* This can throw if the destructor for the exception throws. */
TREE_NOTHROW (fn) = 0;
}
- /* Arrange to do a dynamically scoped cleanup upon exit from this region. */
- cleanup = lookup_name (get_identifier ("__exception_info"), 0);
- cleanup = build_function_call (fn, tree_cons
- (NULL_TREE, cleanup, NULL_TREE));
+ cleanup = build_function_call (fn, NULL_TREE);
TREE_NOTHROW (cleanup) = dtor_nothrow (type);
+
return cleanup;
}
@@ -427,29 +222,20 @@ static void
push_eh_cleanup (type)
tree type;
{
- finish_decl_cleanup (NULL_TREE, do_pop_exception (type));
-}
-
-/* Build up a call to terminate on the function obstack, for use as an
- exception handler. */
-
-static tree
-build_terminate_handler ()
-{
- return build_function_call (terminate_node, NULL_TREE);
+ finish_decl_cleanup (NULL_TREE, do_end_catch (type));
}
/* Return nonzero value if DECL is a Java type suitable for catch or
throw. */
-static int
+static bool
decl_is_java_type (decl, err)
tree decl;
int err;
{
- int r = (TREE_CODE (decl) == POINTER_TYPE
- && TREE_CODE (TREE_TYPE (decl)) == RECORD_TYPE
- && TYPE_FOR_JAVA (TREE_TYPE (decl)));
+ bool r = (TREE_CODE (decl) == POINTER_TYPE
+ && TREE_CODE (TREE_TYPE (decl)) == RECORD_TYPE
+ && TYPE_FOR_JAVA (TREE_TYPE (decl)));
if (err)
{
@@ -485,71 +271,97 @@ decl_is_java_type (decl, err)
return r;
}
+/* Select the personality routine to be used for exception handling,
+ or issue an error if we need two different ones in the same
+ translation unit.
+ ??? At present eh_personality_libfunc is set to
+ __gxx_personality_(sj|v)0 in init_exception_processing - should it
+ be done here instead? */
+void
+choose_personality_routine (lang)
+ enum languages lang;
+{
+ static enum {
+ chose_none,
+ chose_cpp,
+ chose_java,
+ gave_error
+ } state;
+
+ switch (state)
+ {
+ case gave_error:
+ return;
+
+ case chose_cpp:
+ if (lang != lang_cplusplus)
+ goto give_error;
+ return;
+
+ case chose_java:
+ if (lang != lang_java)
+ goto give_error;
+ return;
+
+ case chose_none:
+ ; /* proceed to language selection */
+ }
+
+ switch (lang)
+ {
+ case lang_cplusplus:
+ state = chose_cpp;
+ break;
+
+ case lang_java:
+ state = chose_java;
+ eh_personality_libfunc = init_one_libfunc (USING_SJLJ_EXCEPTIONS
+ ? "__gcj_personality_sj0"
+ : "__gcj_personality_v0");
+ break;
+
+ default:
+ abort ();
+ }
+ return;
+
+ give_error:
+ error ("mixing C++ and Java catches in a single translation unit");
+ state = gave_error;
+}
+
/* Initialize the catch parameter DECL. */
static void
-initialize_handler_parm (decl)
+initialize_handler_parm (decl, exp)
tree decl;
+ tree exp;
{
- tree exp;
tree init;
tree init_type;
- int lang;
/* Make sure we mark the catch param as used, otherwise we'll get a
warning about an unused ((anonymous)). */
TREE_USED (decl) = 1;
- /* Figure out the type that the initializer is. */
+ /* Figure out the type that the initializer is. Pointers are returned
+ adjusted by value from __cxa_begin_catch. Others are returned by
+ reference. */
init_type = TREE_TYPE (decl);
- if (TREE_CODE (init_type) != REFERENCE_TYPE
- && TREE_CODE (init_type) != POINTER_TYPE)
+ if (! TYPE_PTR_P (init_type)
+ && TREE_CODE (init_type) != REFERENCE_TYPE)
init_type = build_reference_type (init_type);
- if (decl_is_java_type (init_type, 0))
- {
- tree fn
- = builtin_function ("_Jv_exception_info",
- build_function_type (ptr_type_node,
- tree_cons (NULL_TREE,
- void_type_node,
- NULL_TREE)),
- 0, NOT_BUILT_IN, NULL_PTR);
-
- exp = build (CALL_EXPR, ptr_type_node,
- build1 (ADDR_EXPR, build_pointer_type (TREE_TYPE (fn)),
- fn),
- NULL_TREE, NULL_TREE);
- TREE_SIDE_EFFECTS (exp) = 1;
- lang = EH_LANG_Java;
-
- set_exception_lang_code (EH_LANG_Java);
- set_exception_version_code (1);
- }
- else
- {
- exp = get_eh_value ();
- lang = EH_LANG_C_plus_plus;
- }
-
- if (catch_language_init)
- {
- if (lang != catch_language)
- error ("mixing C++ and Java `catch'es in single translation unit");
- }
- else
- {
- catch_language_init = 1;
- catch_language = lang;
- }
+ choose_personality_routine (decl_is_java_type (init_type, 0)
+ ? lang_java : lang_cplusplus);
/* Since pointers are passed by value, initialize a reference to
- pointer catch parm with the address of the value slot. */
- if (TREE_CODE (init_type) == REFERENCE_TYPE
- && TREE_CODE (TREE_TYPE (init_type)) == POINTER_TYPE)
+ pointer catch parm with the address of the temporary. */
+ if (TREE_CODE (init_type) == REFERENCE_TYPE
+ && TYPE_PTR_P (TREE_TYPE (init_type)))
exp = build_unary_op (ADDR_EXPR, exp, 1);
- exp = ocp_convert (init_type , exp, CONV_IMPLICIT|CONV_FORCE_TEMP, 0);
+ exp = ocp_convert (init_type, exp, CONV_IMPLICIT|CONV_FORCE_TEMP, 0);
init = convert_from_reference (exp);
@@ -561,8 +373,7 @@ initialize_handler_parm (decl)
See also expand_default_init. */
init = ocp_convert (TREE_TYPE (decl), init,
CONV_IMPLICIT|CONV_FORCE_TEMP, 0);
- init = build (TRY_CATCH_EXPR, TREE_TYPE (init), init,
- build_terminate_handler ());
+ init = build1 (MUST_NOT_THROW_EXPR, TREE_TYPE (init), init);
}
/* Let `cp_finish_decl' know that this initializer is ok. */
@@ -582,6 +393,9 @@ expand_start_catch_block (decl)
{
tree compound_stmt_1;
tree compound_stmt_2;
+ tree exp = NULL_TREE;
+ tree type;
+ bool is_java;
if (! doing_eh (1))
return NULL_TREE;
@@ -593,35 +407,56 @@ expand_start_catch_block (decl)
/* Create a binding level for the eh_info and the exception object
cleanup. */
compound_stmt_1 = begin_compound_stmt (/*has_no_scope=*/0);
+ note_level_for_catch ();
+
+ if (decl)
+ type = prepare_eh_type (TREE_TYPE (decl));
+ else
+ type = NULL_TREE;
+ begin_catch_block (type);
- if (! decl || ! decl_is_java_type (TREE_TYPE (decl), 1))
+ is_java = false;
+ if (decl)
{
- /* The ordinary C++ case. */
- tree type;
+ tree init;
- if (decl)
- type = TREE_TYPE (decl);
+ if (decl_is_java_type (type, 1))
+ {
+ /* Java only passes object via pointer and doesn't require
+ adjusting. The java object is immediately before the
+ generic exception header. */
+ init = build_exc_ptr ();
+ init = build1 (NOP_EXPR, build_pointer_type (type), init);
+ init = build (MINUS_EXPR, TREE_TYPE (init), init,
+ TYPE_SIZE_UNIT (TREE_TYPE (init)));
+ init = build_indirect_ref (init, NULL);
+ is_java = true;
+ }
else
- type = NULL_TREE;
- begin_catch_block (build_eh_type_type_ref (type));
-
- push_eh_info ();
- push_eh_cleanup (type);
+ {
+ /* C++ requires that we call __cxa_begin_catch to get the
+ pointer to the actual object. */
+ init = do_begin_catch ();
+ }
+
+ exp = create_temporary_var (ptr_type_node);
+ DECL_REGISTER (exp) = 1;
+ cp_finish_decl (exp, init, NULL_TREE, LOOKUP_ONLYCONVERTING);
+ finish_expr_stmt (build_modify_expr (exp, INIT_EXPR, init));
}
else
- {
- /* The Java case. In this case, the match_info is a pointer to
- the Java class object. We assume that the class is a
- compiled class. */
- tree ref = build_java_class_ref (TREE_TYPE (TREE_TYPE (decl)));
- begin_catch_block (build1 (ADDR_EXPR, jclass_node, ref));
- }
+ finish_expr_stmt (do_begin_catch ());
+
+ /* C++ requires that we call __cxa_end_catch at the end of
+ processing the exception. */
+ if (! is_java)
+ push_eh_cleanup (type);
/* Create a binding level for the parm. */
compound_stmt_2 = begin_compound_stmt (/*has_no_scope=*/0);
if (decl)
- initialize_handler_parm (decl);
+ initialize_handler_parm (decl, exp);
return build_tree_list (compound_stmt_1, compound_stmt_2);
}
@@ -654,204 +489,152 @@ expand_end_catch_block (blocks)
finish_compound_stmt (/*has_no_scope=*/0, compound_stmt_1);
}
-/* An exception spec is implemented more or less like:
-
- try {
- function body;
- } catch (...) {
- void *p[] = { typeid(raises) };
- __check_eh_spec (p, count);
- }
-
- __check_eh_spec in exception.cc handles all the details. */
-
tree
-expand_start_eh_spec ()
+begin_eh_spec_block ()
{
- return begin_try_block ();
+ tree r = build_stmt (EH_SPEC_BLOCK, NULL_TREE, NULL_TREE);
+ add_stmt (r);
+ return r;
}
void
-expand_end_eh_spec (raises, try_block)
- tree raises;
- tree try_block;
+finish_eh_spec_block (raw_raises, eh_spec_block)
+ tree raw_raises;
+ tree eh_spec_block;
{
- tree tmp, fn, decl, types = NULL_TREE;
- tree blocks;
- tree handler;
- int count = 0;
+ tree raises;
- finish_try_block (try_block);
- handler = begin_handler ();
- blocks = finish_handler_parms (NULL_TREE, handler);
-
- if (TREE_VALUE (raises) == NULL_TREE)
- {
- fn = get_identifier ("__check_null_eh_spec");
- if (IDENTIFIER_GLOBAL_VALUE (fn))
- fn = IDENTIFIER_GLOBAL_VALUE (fn);
- else
- {
- tmp = build_function_type (void_type_node, void_list_node);
- fn = push_throw_library_fn (fn, tmp);
- /* Since the spec doesn't allow any exceptions, this call will
- never throw. We use push_throw_library_fn because we do want
- TREE_THIS_VOLATILE to be set. */
- TREE_NOTHROW (fn) = 1;
- }
- tmp = NULL_TREE;
- }
- else
- {
- /* Build up an array of type_infos. */
- for (; raises && TREE_VALUE (raises); raises = TREE_CHAIN (raises))
- {
- types = tree_cons
- (NULL_TREE, build_eh_type_type (TREE_VALUE (raises)), types);
- ++count;
- }
-
- types = build_nt (CONSTRUCTOR, NULL_TREE, types);
- TREE_HAS_CONSTRUCTOR (types) = 1;
-
- /* We can't pass the CONSTRUCTOR directly, so stick it in a variable. */
- tmp = build_cplus_array_type (const_ptr_type_node, NULL_TREE);
- decl = build_decl (VAR_DECL, NULL_TREE, tmp);
- DECL_ARTIFICIAL (decl) = 1;
- DECL_INITIAL (decl) = types;
- DECL_CONTEXT (decl) = current_function_decl;
- cp_finish_decl (decl, types, NULL_TREE, 0);
-
- decl = decay_conversion (decl);
-
- fn = get_identifier ("__check_eh_spec");
- if (IDENTIFIER_GLOBAL_VALUE (fn))
- fn = IDENTIFIER_GLOBAL_VALUE (fn);
- else
- {
- tmp = tree_cons
- (NULL_TREE, integer_type_node, tree_cons
- (NULL_TREE, TREE_TYPE (decl), void_list_node));
- tmp = build_function_type (void_type_node, tmp);
-
- fn = push_throw_library_fn (fn, tmp);
- }
-
- tmp = tree_cons (NULL_TREE, build_int_2 (count, 0),
- tree_cons (NULL_TREE, decl, NULL_TREE));
- }
+ RECHAIN_STMTS (eh_spec_block, EH_SPEC_STMTS (eh_spec_block));
- tmp = build_call (fn, tmp);
- finish_expr_stmt (tmp);
+ /* Strip cv quals, etc, from the specification types. */
+ for (raises = NULL_TREE;
+ raw_raises && TREE_VALUE (raw_raises);
+ raw_raises = TREE_CHAIN (raw_raises))
+ raises = tree_cons (NULL_TREE, prepare_eh_type (TREE_VALUE (raw_raises)),
+ raises);
- finish_handler (blocks, handler);
- finish_handler_sequence (try_block);
+ EH_SPEC_RAISES (eh_spec_block) = raises;
}
-/* This is called to expand all the toplevel exception handling
- finalization for a function. It should only be called once per
- function. */
+/* Return a pointer to a buffer for an exception object of type TYPE. */
-void
-expand_exception_blocks ()
+static tree
+do_allocate_exception (type)
+ tree type;
{
- do_pending_stack_adjust ();
+ tree fn;
- if (catch_clauses)
+ fn = get_identifier ("__cxa_allocate_exception");
+ if (IDENTIFIER_GLOBAL_VALUE (fn))
+ fn = IDENTIFIER_GLOBAL_VALUE (fn);
+ else
{
- rtx funcend = gen_label_rtx ();
- emit_jump (funcend);
-
- /* We cannot protect n regions this way if we must flow into the
- EH region through the top of the region, as we have to with
- the setjmp/longjmp approach. */
- if (exceptions_via_longjmp == 0)
- expand_eh_region_start ();
-
- emit_insns (catch_clauses);
- catch_clauses = catch_clauses_last = NULL_RTX;
-
- if (exceptions_via_longjmp == 0)
- expand_eh_region_end (build_terminate_handler ());
-
- emit_insns (catch_clauses);
- catch_clauses = catch_clauses_last = NULL_RTX;
- emit_label (funcend);
+ /* Declare void *__cxa_allocate_exception(size_t). */
+ tree tmp = tree_cons (NULL_TREE, c_size_type_node, void_list_node);
+ fn = push_library_fn (fn, build_function_type (ptr_type_node, tmp));
}
+
+ return build_function_call (fn, tree_cons (NULL_TREE, size_in_bytes (type),
+ NULL_TREE));
}
-/* Return a pointer to a buffer for an exception object of type TYPE. */
+#if 0
+/* Call __cxa_free_exception from a cleanup. This is never invoked
+ directly. */
static tree
-alloc_eh_object (type)
- tree type;
+do_free_exception (ptr)
+ tree ptr;
{
- tree fn, exp;
+ tree fn;
- fn = get_identifier ("__eh_alloc");
+ fn = get_identifier ("__cxa_free_exception");
if (IDENTIFIER_GLOBAL_VALUE (fn))
fn = IDENTIFIER_GLOBAL_VALUE (fn);
else
{
- /* Declare __eh_alloc (size_t), as defined in exception.cc. */
- tree tmp = tree_cons (NULL_TREE, sizetype, void_list_node);
- fn = push_library_fn (fn, build_function_type (ptr_type_node, tmp));
+ /* Declare void __cxa_free_exception (void *). */
+ fn = push_void_library_fn (fn, tree_cons (NULL_TREE, ptr_type_node,
+ void_list_node));
}
- exp = build_function_call (fn, tree_cons
- (NULL_TREE, size_in_bytes (type), NULL_TREE));
- exp = build1 (NOP_EXPR, build_pointer_type (type), exp);
- return exp;
+ return build_function_call (fn, tree_cons (NULL_TREE, ptr, NULL_TREE));
}
+#endif
-/* Expand a throw statement. This follows the following
- algorithm:
-
- 1. Allocate space to save the current PC onto the stack.
- 2. Generate and emit a label and save its address into the
- newly allocated stack space since we can't save the pc directly.
- 3. If this is the first call to throw in this function:
- generate a label for the throw block
- 4. jump to the throw block label. */
+/* Build a throw expression. */
-static tree
-expand_throw (exp)
+tree
+build_throw (exp)
tree exp;
{
tree fn;
+ if (exp == error_mark_node)
+ return exp;
+
+ if (processing_template_decl)
+ return build_min (THROW_EXPR, void_type_node, exp);
+
+ if (exp == null_node)
+ cp_warning ("throwing NULL, which has integral, not pointer type");
+
+ if (exp != NULL_TREE)
+ {
+ if (!is_admissible_throw_operand (exp))
+ return error_mark_node;
+ }
+
if (! doing_eh (1))
return error_mark_node;
- if (exp
- && decl_is_java_type (TREE_TYPE (exp), 1))
+ if (exp && decl_is_java_type (TREE_TYPE (exp), 1))
{
- /* A Java `throw' statement. */
- tree args = tree_cons (NULL_TREE, exp, NULL);
-
- fn = get_identifier (exceptions_via_longjmp
- ? "_Jv_Sjlj_Throw"
- : "_Jv_Throw");
+ tree fn = get_identifier ("_Jv_Throw");
if (IDENTIFIER_GLOBAL_VALUE (fn))
fn = IDENTIFIER_GLOBAL_VALUE (fn);
else
{
- /* Declare _Jv_Throw (void *), as defined in Java's
- exception.cc. */
+ /* Declare void _Jv_Throw (void *). */
tree tmp = tree_cons (NULL_TREE, ptr_type_node, void_list_node);
tmp = build_function_type (ptr_type_node, tmp);
fn = push_throw_library_fn (fn, tmp);
}
- exp = build_function_call (fn, args);
+ exp = build_function_call (fn, tree_cons (NULL_TREE, exp, NULL_TREE));
}
else if (exp)
{
tree throw_type;
- tree cleanup = NULL_TREE, e;
+ tree cleanup;
tree stmt_expr;
tree compound_stmt;
- tree try_block;
+ tree object, ptr;
+ tree tmp;
+
+ fn = get_identifier ("__cxa_throw");
+ if (IDENTIFIER_GLOBAL_VALUE (fn))
+ fn = IDENTIFIER_GLOBAL_VALUE (fn);
+ else
+ {
+ /* The CLEANUP_TYPE is the internal type of a destructor. */
+ if (cleanup_type == NULL_TREE)
+ {
+ tmp = void_list_node;
+ tmp = tree_cons (NULL_TREE, ptr_type_node, tmp);
+ tmp = build_function_type (void_type_node, tmp);
+ cleanup_type = build_pointer_type (tmp);
+ }
+
+ /* Declare void __cxa_throw (void*, void*, void (*)(void*)). */
+ /* ??? Second argument is supposed to be "std::type_info*". */
+ tmp = void_list_node;
+ tmp = tree_cons (NULL_TREE, cleanup_type, tmp);
+ tmp = tree_cons (NULL_TREE, ptr_type_node, tmp);
+ tmp = tree_cons (NULL_TREE, ptr_type_node, tmp);
+ tmp = build_function_type (void_type_node, tmp);
+ fn = push_throw_library_fn (fn, tmp);
+ }
begin_init_stmts (&stmt_expr, &compound_stmt);
@@ -859,165 +642,100 @@ expand_throw (exp)
/* First, decay it. */
exp = decay_conversion (exp);
- /* The CLEANUP_TYPE is the internal type of a destructor. Under
- the old ABI, destructors are two-argument functions; under
- the new ABI they take only one argument. */
- if (cleanup_type == NULL_TREE)
+ /* OK, this is kind of wacky. The standard says that we call
+ terminate when the exception handling mechanism, after
+ completing evaluation of the expression to be thrown but
+ before the exception is caught (_except.throw_), calls a
+ user function that exits via an uncaught exception.
+
+ So we have to protect the actual initialization of the
+ exception object with terminate(), but evaluate the
+ expression first. Since there could be temps in the
+ expression, we need to handle that, too. We also expand
+ the call to __cxa_allocate_exception first (which doesn't
+ matter, since it can't throw). */
+
+ my_friendly_assert (stmts_are_full_exprs_p () == 1, 19990926);
+
+ /* Store the throw expression into a temp. This can be less
+ efficient than storing it into the allocated space directly, but
+ if we allocated the space first we would have to deal with
+ cleaning it up if evaluating this expression throws. */
+ if (TREE_SIDE_EFFECTS (exp))
{
- tree arg_types;
-
- arg_types = void_list_node;
- if (!flag_new_abi)
- arg_types = tree_cons (NULL_TREE, integer_type_node, arg_types);
- arg_types = tree_cons (NULL_TREE, ptr_type_node, arg_types);
- cleanup_type = (build_pointer_type
- (build_function_type (void_type_node, arg_types)));
+ tmp = create_temporary_var (TREE_TYPE (exp));
+ DECL_INITIAL (tmp) = exp;
+ cp_finish_decl (tmp, exp, NULL_TREE, LOOKUP_ONLYCONVERTING);
+ exp = tmp;
}
- if (TYPE_PTR_P (TREE_TYPE (exp)))
- throw_type = build_eh_type_type (TREE_TYPE (exp));
- else
- {
- tree object, ptr;
-
- /* OK, this is kind of wacky. The standard says that we call
- terminate when the exception handling mechanism, after
- completing evaluation of the expression to be thrown but
- before the exception is caught (_except.throw_), calls a
- user function that exits via an uncaught exception.
-
- So we have to protect the actual initialization of the
- exception object with terminate(), but evaluate the
- expression first. Since there could be temps in the
- expression, we need to handle that, too. We also expand
- the call to __eh_alloc first (which doesn't matter, since
- it can't throw). */
-
- my_friendly_assert (stmts_are_full_exprs_p () == 1, 19990926);
-
- /* Store the throw expression into a temp. This can be less
- efficient than storing it into the allocated space directly, but
- if we allocated the space first we would have to deal with
- cleaning it up if evaluating this expression throws. */
- if (TREE_SIDE_EFFECTS (exp))
- {
- tree temp = create_temporary_var (TREE_TYPE (exp));
- DECL_INITIAL (temp) = exp;
- cp_finish_decl (temp, exp, NULL_TREE, LOOKUP_ONLYCONVERTING);
- exp = temp;
- }
-
- /* Allocate the space for the exception. */
- ptr = save_expr (alloc_eh_object (TREE_TYPE (exp)));
- finish_expr_stmt (ptr);
+ /* Allocate the space for the exception. */
+ ptr = create_temporary_var (ptr_type_node);
+ DECL_REGISTER (ptr) = 1;
+ cp_finish_decl (ptr, NULL_TREE, NULL_TREE, LOOKUP_ONLYCONVERTING);
+ tmp = do_allocate_exception (TREE_TYPE (exp));
+ tmp = build_modify_expr (ptr, INIT_EXPR, tmp);
+ finish_expr_stmt (tmp);
- try_block = begin_try_block ();
- object = build_indirect_ref (ptr, NULL_PTR);
- exp = build_modify_expr (object, INIT_EXPR, exp);
+ object = build1 (NOP_EXPR, build_pointer_type (TREE_TYPE (exp)), ptr);
+ object = build_indirect_ref (object, NULL);
- if (exp == error_mark_node)
- error (" in thrown expression");
+ exp = build_modify_expr (object, INIT_EXPR, exp);
+ if (exp == error_mark_node)
+ error (" in thrown expression");
- finish_expr_stmt (exp);
- finish_cleanup_try_block (try_block);
- finish_cleanup (build_terminate_handler (), try_block);
+ exp = build1 (MUST_NOT_THROW_EXPR, TREE_TYPE (exp), exp);
+ finish_expr_stmt (exp);
- throw_type = build_eh_type_type (TREE_TYPE (object));
+ throw_type = build_eh_type_type (prepare_eh_type (TREE_TYPE (object)));
- if (TYPE_HAS_DESTRUCTOR (TREE_TYPE (object)))
- {
- cleanup = lookup_fnfields (TYPE_BINFO (TREE_TYPE (object)),
- (flag_new_abi
- ? complete_dtor_identifier
- : dtor_identifier),
- 0);
- cleanup = TREE_VALUE (cleanup);
- mark_used (cleanup);
- mark_addressable (cleanup);
- /* Pretend it's a normal function. */
- cleanup = build1 (ADDR_EXPR, cleanup_type, cleanup);
- }
-
- exp = ptr;
+ if (TYPE_HAS_DESTRUCTOR (TREE_TYPE (object)))
+ {
+ cleanup = lookup_fnfields (TYPE_BINFO (TREE_TYPE (object)),
+ complete_dtor_identifier, 0);
+ cleanup = TREE_VALUE (cleanup);
+ mark_used (cleanup);
+ mark_addressable (cleanup);
+ /* Pretend it's a normal function. */
+ cleanup = build1 (ADDR_EXPR, cleanup_type, cleanup);
}
-
- /* Cast EXP to `void *' so that it will match the prototype for
- __cp_push_exception. */
- exp = convert (ptr_type_node, exp);
-
- if (cleanup == NULL_TREE)
+ else
{
cleanup = build_int_2 (0, 0);
TREE_TYPE (cleanup) = cleanup_type;
}
- fn = cp_push_exception_identifier;
- if (IDENTIFIER_GLOBAL_VALUE (fn))
- fn = IDENTIFIER_GLOBAL_VALUE (fn);
- else
- {
- /* Declare __cp_push_exception (void*, void*, void (*)(void*, int)),
- as defined in exception.cc. */
- tree tmp;
- tmp = tree_cons
- (NULL_TREE, ptr_type_node, tree_cons
- (NULL_TREE, ptr_type_node, tree_cons
- (NULL_TREE, cleanup_type, void_list_node)));
- fn = push_void_library_fn (fn, tmp);
- }
+ tmp = tree_cons (NULL_TREE, cleanup, NULL_TREE);
+ tmp = tree_cons (NULL_TREE, throw_type, tmp);
+ tmp = tree_cons (NULL_TREE, ptr, tmp);
+ tmp = build_function_call (fn, tmp);
+
+ /* ??? Indicate that this function call throws throw_type. */
- e = tree_cons (NULL_TREE, exp, tree_cons
- (NULL_TREE, throw_type, tree_cons
- (NULL_TREE, cleanup, NULL_TREE)));
- finish_expr_stmt (build_function_call (fn, e));
+ finish_expr_stmt (tmp);
exp = finish_init_stmts (stmt_expr, compound_stmt);
}
else
{
- /* rethrow current exception; note that it's no longer caught. */
+ /* Rethrow current exception. */
- tree fn = get_identifier ("__uncatch_exception");
+ tree fn = get_identifier ("__cxa_rethrow");
if (IDENTIFIER_GLOBAL_VALUE (fn))
fn = IDENTIFIER_GLOBAL_VALUE (fn);
else
- /* Declare void __uncatch_exception (void)
- as defined in exception.cc. */
- fn = push_void_library_fn (fn, void_list_node);
+ {
+ /* Declare void __cxa_rethrow (void). */
+ fn = push_throw_library_fn
+ (fn, build_function_type (void_type_node, void_list_node));
+ }
exp = build_function_call (fn, NULL_TREE);
}
- return exp;
-}
-
-/* Build a throw expression. */
-
-tree
-build_throw (e)
- tree e;
-{
- if (e == error_mark_node)
- return e;
-
- if (processing_template_decl)
- return build_min (THROW_EXPR, void_type_node, e);
-
- if (e == null_node)
- cp_warning ("throwing NULL, which has integral, not pointer type");
-
- if (e != NULL_TREE)
- {
- if (!complete_ptr_ref_or_void_ptr_p (TREE_TYPE (e), e))
- return error_mark_node;
- }
-
- e = expand_throw (e);
- e = build1 (THROW_EXPR, void_type_node, e);
- TREE_SIDE_EFFECTS (e) = 1;
- TREE_USED (e) = 1;
+ exp = build1 (THROW_EXPR, void_type_node, exp);
- return e;
+ return exp;
}
/* Make sure TYPE is complete, pointer to complete, reference to
@@ -1051,6 +769,38 @@ complete_ptr_ref_or_void_ptr_p (type, from)
return 1;
}
+/* Return truth-value if EXPRESSION is admissible in throw-expression,
+ i.e. if it is not of incomplete type or a pointer/reference to such
+ a type or of an abstract class type. */
+
+static bool
+is_admissible_throw_operand (expr)
+ tree expr;
+{
+ tree type = TREE_TYPE (expr);
+
+ /* 15.1/4 [...] The type of the throw-expression shall not be an
+ incomplete type, or a pointer or a reference to an incomplete
+ type, other than void*, const void*, volatile void*, or
+ const volatile void*. Except for these restriction and the
+ restrictions on type matching mentioned in 15.3, the operand
+ of throw is treated exactly as a function argument in a call
+ (5.2.2) or the operand of a return statement. */
+ if (!complete_ptr_ref_or_void_ptr_p (type, expr))
+ return false;
+
+ /* 10.4/3 An abstract class shall not be used as a parameter type,
+ as a function return type or as type of an explicit
+ conversion. */
+ else if (CLASS_TYPE_P (type) && CLASSTYPE_PURE_VIRTUALS (type))
+ {
+ cp_error ("Expression '%E' of abstract class type '%T' cannot be used in throw-expression", expr, type);
+ return false;
+ }
+
+ return true;
+}
+
/* Returns nonzero if FN is a declaration of a standard C library
function which is known not to throw.
@@ -1069,6 +819,7 @@ nothrow_libfn_p (fn)
if (TREE_PUBLIC (fn)
&& DECL_EXTERNAL (fn)
+ && DECL_NAMESPACE_SCOPE_P (fn)
&& DECL_EXTERN_C_P (fn))
/* OK */;
else
@@ -1105,7 +856,7 @@ can_convert_eh (to, from)
/* else fall through */
}
- if (IS_AGGR_TYPE (to) && IS_AGGR_TYPE (from)
+ if (CLASS_TYPE_P (to) && CLASS_TYPE_P (from)
&& PUBLICLY_UNIQUELY_DERIVED_P (to, from))
return 1;
diff --git a/gcc/cp/expr.c b/gcc/cp/expr.c
index 603984ad017..f2fe6ebf476 100644
--- a/gcc/cp/expr.c
+++ b/gcc/cp/expr.c
@@ -56,26 +56,15 @@ cplus_expand_constant (cst)
{
/* Find the offset for the field. */
tree offset = byte_position (member);
-
- if (flag_new_abi)
- /* Under the new ABI, we use -1 to represent the NULL
- pointer; non-NULL values simply contain the offset of
- the data member. */
- ;
- else
- /* We offset all pointer to data members by 1 so that we
- can distinguish between a null pointer to data member
- and the first data member of a structure. */
- offset = size_binop (PLUS_EXPR, offset, size_one_node);
-
cst = fold (build1 (NOP_EXPR, type, offset));
}
else
{
- tree delta, idx, pfn, delta2;
+ tree delta;
+ tree pfn;
- expand_ptrmemfunc_cst (cst, &delta, &idx, &pfn, &delta2);
- cst = build_ptrmemfunc1 (type, delta, idx, pfn, delta2);
+ expand_ptrmemfunc_cst (cst, &delta, &pfn);
+ cst = build_ptrmemfunc1 (type, delta, pfn);
}
}
break;
@@ -100,6 +89,7 @@ cplus_expand_expr (exp, target, tmode, modifier)
tree type = TREE_TYPE (exp);
register enum machine_mode mode = TYPE_MODE (type);
register enum tree_code code = TREE_CODE (exp);
+ rtx ret;
/* No sense saving up arithmetic to be done
if it's all in the wrong mode to form part of an address.
@@ -115,16 +105,20 @@ cplus_expand_expr (exp, target, tmode, modifier)
target, tmode, modifier);
case OFFSET_REF:
- {
- return expand_expr (default_conversion (resolve_offset_ref (exp)),
- target, tmode, EXPAND_NORMAL);
- }
-
+ /* Offset refs should not make it through to here. */
+ my_friendly_abort (20010724);
+ return const0_rtx;
+
case THROW_EXPR:
expand_expr (TREE_OPERAND (exp, 0), const0_rtx, VOIDmode, 0);
- expand_internal_throw ();
return NULL;
+ case MUST_NOT_THROW_EXPR:
+ expand_eh_region_start ();
+ ret = expand_expr (TREE_OPERAND (exp, 0), target, tmode, modifier);
+ expand_eh_region_end_must_not_throw (build_call (terminate_node, 0));
+ return ret;
+
case EMPTY_CLASS_EXPR:
/* We don't need to generate any code for an empty class. */
return const0_rtx;
diff --git a/gcc/cp/friend.c b/gcc/cp/friend.c
index b817c7c3917..8b2e8f8a4c7 100644
--- a/gcc/cp/friend.c
+++ b/gcc/cp/friend.c
@@ -380,22 +380,41 @@ do_friend (ctype, declarator, decl, parmdecls, attrlist,
if (! DECL_USE_TEMPLATE (decl))
{
- /* We can call pushdecl here, because the TREE_CHAIN of this
- FUNCTION_DECL is not needed for other purposes. Don't do
- this for a template instantiation. However, we don't
- call pushdecl() for a friend function of a template
- class, since in general, such a declaration depends on
- template parameters. Instead, we call pushdecl when the
- class is instantiated. */
- if (!is_friend_template
- && template_class_depth (current_class_type) == 0)
- decl = pushdecl (decl);
- else
+ /* We must check whether the decl refers to template
+ arguments before push_template_decl_real adds a
+ reference to the containing template class. */
+ int warn = (warn_nontemplate_friend
+ && ! funcdef_flag && ! is_friend_template
+ && current_template_parms
+ && uses_template_parms (decl));
+
+ if (is_friend_template
+ || template_class_depth (current_class_type) != 0)
+ /* We can't call pushdecl for a template class, since in
+ general, such a declaration depends on template
+ parameters. Instead, we call pushdecl when the class
+ is instantiated. */
decl = push_template_decl_real (decl, /*is_friend=*/1);
+ else if (current_function_decl)
+ /* This must be a local class, so pushdecl will be ok, and
+ insert an unqualified friend into the local scope
+ (rather than the containing namespace scope, which the
+ next choice will do). */
+ decl = pushdecl (decl);
+ else
+ {
+ /* We can't use pushdecl, as we might be in a template
+ class specialization, and pushdecl will insert an
+ unqualified friend decl into the template parameter
+ scope, rather than the namespace containing it. */
+ tree ns = decl_namespace_context (decl);
+
+ push_nested_namespace (ns);
+ decl = pushdecl_namespace_level (decl);
+ pop_nested_namespace (ns);
+ }
- if (warn_nontemplate_friend
- && ! funcdef_flag && ! is_friend_template
- && current_template_parms && uses_template_parms (decl))
+ if (warn)
{
static int explained;
cp_warning ("friend declaration `%#D' declares a non-template function", decl);
@@ -407,7 +426,6 @@ do_friend (ctype, declarator, decl, parmdecls, attrlist,
}
}
- make_decl_rtl (decl, NULL_PTR);
add_friend (current_class_type,
is_friend_template ? DECL_TI_TEMPLATE (decl) : decl);
DECL_FRIEND_P (decl) = 1;
diff --git a/gcc/cp/gxxint.texi b/gcc/cp/gxxint.texi
deleted file mode 100644
index eaf812222f4..00000000000
--- a/gcc/cp/gxxint.texi
+++ /dev/null
@@ -1,1859 +0,0 @@
-\input texinfo @c -*-texinfo-*-
-@c %**start of header
-@setfilename g++int.info
-@settitle G++ internals
-@setchapternewpage odd
-@ifinfo
-@dircategory Programming
-@direntry
-* G++ internals: (g++int). G++ Internals.
-@end direntry
-@end ifinfo
-@c %**end of header
-
-@node Top, Limitations of g++, (dir), (dir)
-@chapter Internal Architecture of the Compiler
-
-This is meant to describe the C++ front-end for gcc in detail.
-Questions and comments to Jason Merrill @email{jason@@redhat.com} and
-Mark Mitchell @email{mark@@codesourcery.com}.
-
-@menu
-* Limitations of g++::
-* Routines::
-* Implementation Specifics::
-* Glossary::
-* Macros::
-* Typical Behavior::
-* Coding Conventions::
-* Templates::
-* Access Control::
-* Error Reporting::
-* Parser::
-* Exception Handling::
-* Free Store::
-* Mangling:: Function name mangling for C++ and Java
-* Concept Index::
-@end menu
-
-@node Limitations of g++, Routines, Top, Top
-@section Limitations of g++
-
-@itemize @bullet
-@item
-Limitations on input source code: 240 nesting levels with the parser
-stacksize (YYSTACKSIZE) set to 500 (the default), and requires around
-16.4k swap space per nesting level. The parser needs about 2.09 *
-number of nesting levels worth of stackspace.
-
-@cindex pushdecl_class_level
-@item
-I suspect there are other uses of pushdecl_class_level that do not call
-set_identifier_type_value in tandem with the call to
-pushdecl_class_level. It would seem to be an omission.
-
-@end itemize
-
-@node Routines, Implementation Specifics, Limitations of g++, Top
-@section Routines
-
-This section describes some of the routines used in the C++ front-end.
-
-@code{build_vtable} and @code{prepare_fresh_vtable} is used only within
-the @file{cp-class.c} file, and only in @code{finish_struct} and
-@code{modify_vtable_entries}.
-
-@code{build_vtable}, @code{prepare_fresh_vtable}, and
-@code{finish_struct} are the only routines that set @code{DECL_VPARENT}.
-
-@code{finish_struct} can steal the virtual function table from parents,
-this prohibits related_vslot from working. When finish_struct steals,
-we know that
-
-@example
-get_binfo (DECL_FIELD_CONTEXT (CLASSTYPE_VFIELD (t)), t, 0)
-@end example
-
-@noindent
-will get the related binfo.
-
-@code{layout_basetypes} does something with the VIRTUALS.
-
-Supposedly (according to Tiemann) most of the breadth first searching
-done, like in @code{get_base_distance} and in @code{get_binfo} was not
-because of any design decision. I have since found out the at least one
-part of the compiler needs the notion of depth first binfo searching, I
-am going to try and convert the whole thing, it should just work. The
-term left-most refers to the depth first left-most node. It uses
-@code{MAIN_VARIANT == type} as the condition to get left-most, because
-the things that have @code{BINFO_OFFSET}s of zero are shared and will
-have themselves as their own @code{MAIN_VARIANT}s. The non-shared right
-ones, are copies of the left-most one, hence if it is its own
-@code{MAIN_VARIANT}, we know it IS a left-most one, if it is not, it is
-a non-left-most one.
-
-@code{get_base_distance}'s path and distance matters in its use in:
-
-@itemize @bullet
-@item
-@code{prepare_fresh_vtable} (the code is probably wrong)
-@item
-@code{init_vfields} Depends upon distance probably in a safe way,
-build_offset_ref might use partial paths to do further lookups,
-hack_identifier is probably not properly checking access.
-
-@item
-@code{get_first_matching_virtual} probably should check for
-@code{get_base_distance} returning -2.
-
-@item
-@code{resolve_offset_ref} should be called in a more deterministic
-manner. Right now, it is called in some random contexts, like for
-arguments at @code{build_method_call} time, @code{default_conversion}
-time, @code{convert_arguments} time, @code{build_unary_op} time,
-@code{build_c_cast} time, @code{build_modify_expr} time,
-@code{convert_for_assignment} time, and
-@code{convert_for_initialization} time.
-
-But, there are still more contexts it needs to be called in, one was the
-ever simple:
-
-@example
-if (obj.*pmi != 7)
- @dots{}
-@end example
-
-Seems that the problems were due to the fact that @code{TREE_TYPE} of
-the @code{OFFSET_REF} was not a @code{OFFSET_TYPE}, but rather the type
-of the referent (like @code{INTEGER_TYPE}). This problem was fixed by
-changing @code{default_conversion} to check @code{TREE_CODE (x)},
-instead of only checking @code{TREE_CODE (TREE_TYPE (x))} to see if it
-was @code{OFFSET_TYPE}.
-
-@end itemize
-
-@node Implementation Specifics, Glossary, Routines, Top
-@section Implementation Specifics
-
-@itemize @bullet
-@item Explicit Initialization
-
-The global list @code{current_member_init_list} contains the list of
-mem-initializers specified in a constructor declaration. For example:
-
-@example
-foo::foo() : a(1), b(2) @{@}
-@end example
-
-@noindent
-will initialize @samp{a} with 1 and @samp{b} with 2.
-@code{expand_member_init} places each initialization (a with 1) on the
-global list. Then, when the fndecl is being processed,
-@code{emit_base_init} runs down the list, initializing them. It used to
-be the case that g++ first ran down @code{current_member_init_list},
-then ran down the list of members initializing the ones that weren't
-explicitly initialized. Things were rewritten to perform the
-initializations in order of declaration in the class. So, for the above
-example, @samp{a} and @samp{b} will be initialized in the order that
-they were declared:
-
-@example
-class foo @{ public: int b; int a; foo (); @};
-@end example
-
-@noindent
-Thus, @samp{b} will be initialized with 2 first, then @samp{a} will be
-initialized with 1, regardless of how they're listed in the mem-initializer.
-
-@item The Explicit Keyword
-
-The use of @code{explicit} on a constructor is used by @code{grokdeclarator}
-to set the field @code{DECL_NONCONVERTING_P}. That value is used by
-@code{build_method_call} and @code{build_user_type_conversion_1} to decide
-if a particular constructor should be used as a candidate for conversions.
-
-@end itemize
-
-@node Glossary, Macros, Implementation Specifics, Top
-@section Glossary
-
-@table @r
-@item binfo
-The main data structure in the compiler used to represent the
-inheritance relationships between classes. The data in the binfo can be
-accessed by the BINFO_ accessor macros.
-
-@item vtable
-@itemx virtual function table
-
-The virtual function table holds information used in virtual function
-dispatching. In the compiler, they are usually referred to as vtables,
-or vtbls. The first index is not used in the normal way, I believe it
-is probably used for the virtual destructor.
-
-@item vfield
-
-vfields can be thought of as the base information needed to build
-vtables. For every vtable that exists for a class, there is a vfield.
-See also vtable and virtual function table pointer. When a type is used
-as a base class to another type, the virtual function table for the
-derived class can be based upon the vtable for the base class, just
-extended to include the additional virtual methods declared in the
-derived class. The virtual function table from a virtual base class is
-never reused in a derived class. @code{is_normal} depends upon this.
-
-@item virtual function table pointer
-
-These are @code{FIELD_DECL}s that are pointer types that point to
-vtables. See also vtable and vfield.
-@end table
-
-@node Macros, Typical Behavior, Glossary, Top
-@section Macros
-
-This section describes some of the macros used on trees. The list
-should be alphabetical. Eventually all macros should be documented
-here.
-
-@table @code
-@item BINFO_BASETYPES
-A vector of additional binfos for the types inherited by this basetype.
-The binfos are fully unshared (except for virtual bases, in which
-case the binfo structure is shared).
-
- If this basetype describes type D as inherited in C,
- and if the basetypes of D are E anf F,
- then this vector contains binfos for inheritance of E and F by C.
-
-Has values of:
-
- TREE_VECs
-
-
-@item BINFO_INHERITANCE_CHAIN
-Temporarily used to represent specific inheritances. It usually points
-to the binfo associated with the lesser derived type, but it can be
-reversed by reverse_path. For example:
-
-@example
- Z ZbY least derived
- |
- Y YbX
- |
- X Xb most derived
-
-TYPE_BINFO (X) == Xb
-BINFO_INHERITANCE_CHAIN (Xb) == YbX
-BINFO_INHERITANCE_CHAIN (Yb) == ZbY
-BINFO_INHERITANCE_CHAIN (Zb) == 0
-@end example
-
-Not sure is the above is really true, get_base_distance has is point
-towards the most derived type, opposite from above.
-
-Set by build_vbase_path, recursive_bounded_basetype_p,
-get_base_distance, lookup_field, lookup_fnfields, and reverse_path.
-
-What things can this be used on:
-
- TREE_VECs that are binfos
-
-
-@item BINFO_OFFSET
-The offset where this basetype appears in its containing type.
-BINFO_OFFSET slot holds the offset (in bytes) from the base of the
-complete object to the base of the part of the object that is allocated
-on behalf of this `type'. This is always 0 except when there is
-multiple inheritance.
-
-Used on TREE_VEC_ELTs of the binfos BINFO_BASETYPES (...) for example.
-
-
-@item BINFO_VIRTUALS
-A unique list of functions for the virtual function table. See also
-TYPE_BINFO_VIRTUALS.
-
-What things can this be used on:
-
- TREE_VECs that are binfos
-
-
-@item BINFO_VTABLE
-Used to find the VAR_DECL that is the virtual function table associated
-with this binfo. See also TYPE_BINFO_VTABLE. To get the virtual
-function table pointer, see CLASSTYPE_VFIELD.
-
-What things can this be used on:
-
- TREE_VECs that are binfos
-
-Has values of:
-
- VAR_DECLs that are virtual function tables
-
-
-@item BLOCK_SUPERCONTEXT
-In the outermost scope of each function, it points to the FUNCTION_DECL
-node. It aids in better DWARF support of inline functions.
-
-
-@item CLASSTYPE_TAGS
-CLASSTYPE_TAGS is a linked (via TREE_CHAIN) list of member classes of a
-class. TREE_PURPOSE is the name, TREE_VALUE is the type (pushclass scans
-these and calls pushtag on them.)
-
-finish_struct scans these to produce TYPE_DECLs to add to the
-TYPE_FIELDS of the type.
-
-It is expected that name found in the TREE_PURPOSE slot is unique,
-resolve_scope_to_name is one such place that depends upon this
-uniqueness.
-
-
-@item CLASSTYPE_METHOD_VEC
-The following is true after finish_struct has been called (on the
-class?) but not before. Before finish_struct is called, things are
-different to some extent. Contains a TREE_VEC of methods of the class.
-The TREE_VEC_LENGTH is the number of differently named methods plus one
-for the 0th entry. The 0th entry is always allocated, and reserved for
-ctors and dtors. If there are none, TREE_VEC_ELT(N,0) == NULL_TREE.
-Each entry of the TREE_VEC is a FUNCTION_DECL. For each FUNCTION_DECL,
-there is a DECL_CHAIN slot. If the FUNCTION_DECL is the last one with a
-given name, the DECL_CHAIN slot is NULL_TREE. Otherwise it is the next
-method that has the same name (but a different signature). It would
-seem that it is not true that because the DECL_CHAIN slot is used in
-this way, we cannot call pushdecl to put the method in the global scope
-(cause that would overwrite the TREE_CHAIN slot), because they use
-different _CHAINs. finish_struct_methods setups up one version of the
-TREE_CHAIN slots on the FUNCTION_DECLs.
-
-friends are kept in TREE_LISTs, so that there's no need to use their
-TREE_CHAIN slot for anything.
-
-Has values of:
-
- TREE_VECs
-
-
-@item CLASSTYPE_VFIELD
-Seems to be in the process of being renamed TYPE_VFIELD. Use on types
-to get the main virtual function table pointer. To get the virtual
-function table use BINFO_VTABLE (TYPE_BINFO ()).
-
-Has values of:
-
- FIELD_DECLs that are virtual function table pointers
-
-What things can this be used on:
-
- RECORD_TYPEs
-
-
-@item DECL_CLASS_CONTEXT
-Identifies the context that the _DECL was found in. For virtual function
-tables, it points to the type associated with the virtual function
-table. See also DECL_CONTEXT, DECL_FIELD_CONTEXT and DECL_FCONTEXT.
-
-The difference between this and DECL_CONTEXT, is that for virtuals
-functions like:
-
-@example
-struct A
-@{
- virtual int f ();
-@};
-
-struct B : A
-@{
- int f ();
-@};
-
-DECL_CONTEXT (A::f) == A
-DECL_CLASS_CONTEXT (A::f) == A
-
-DECL_CONTEXT (B::f) == A
-DECL_CLASS_CONTEXT (B::f) == B
-@end example
-
-Has values of:
-
- RECORD_TYPEs, or UNION_TYPEs
-
-What things can this be used on:
-
- TYPE_DECLs, _DECLs
-
-
-@item DECL_CONTEXT
-Identifies the context that the _DECL was found in. Can be used on
-virtual function tables to find the type associated with the virtual
-function table, but since they are FIELD_DECLs, DECL_FIELD_CONTEXT is a
-better access method. Internally the same as DECL_FIELD_CONTEXT, so
-don't us both. See also DECL_FIELD_CONTEXT, DECL_FCONTEXT and
-DECL_CLASS_CONTEXT.
-
-Has values of:
-
- RECORD_TYPEs
-
-
-What things can this be used on:
-
-@display
-VAR_DECLs that are virtual function tables
-_DECLs
-@end display
-
-
-@item DECL_FIELD_CONTEXT
-Identifies the context that the FIELD_DECL was found in. Internally the
-same as DECL_CONTEXT, so don't us both. See also DECL_CONTEXT,
-DECL_FCONTEXT and DECL_CLASS_CONTEXT.
-
-Has values of:
-
- RECORD_TYPEs
-
-What things can this be used on:
-
-@display
-FIELD_DECLs that are virtual function pointers
-FIELD_DECLs
-@end display
-
-
-@item DECL_NAME
-
-Has values of:
-
-@display
-0 for things that don't have names
-IDENTIFIER_NODEs for TYPE_DECLs
-@end display
-
-@item DECL_IGNORED_P
-A bit that can be set to inform the debug information output routines in
-the back-end that a certain _DECL node should be totally ignored.
-
-Used in cases where it is known that the debugging information will be
-output in another file, or where a sub-type is known not to be needed
-because the enclosing type is not needed.
-
-A compiler constructed virtual destructor in derived classes that do not
-define an explicit destructor that was defined explicit in a base class
-has this bit set as well. Also used on __FUNCTION__ and
-__PRETTY_FUNCTION__ to mark they are ``compiler generated.'' c-decl and
-c-lex.c both want DECL_IGNORED_P set for ``internally generated vars,''
-and ``user-invisible variable.''
-
-Functions built by the C++ front-end such as default destructors,
-virtual destructors and default constructors want to be marked that
-they are compiler generated, but unsure why.
-
-Currently, it is used in an absolute way in the C++ front-end, as an
-optimization, to tell the debug information output routines to not
-generate debugging information that will be output by another separately
-compiled file.
-
-
-@item DECL_VIRTUAL_P
-A flag used on FIELD_DECLs and VAR_DECLs. (Documentation in tree.h is
-wrong.) Used in VAR_DECLs to indicate that the variable is a vtable.
-It is also used in FIELD_DECLs for vtable pointers.
-
-What things can this be used on:
-
- FIELD_DECLs and VAR_DECLs
-
-
-@item DECL_VPARENT
-Used to point to the parent type of the vtable if there is one, else it
-is just the type associated with the vtable. Because of the sharing of
-virtual function tables that goes on, this slot is not very useful, and
-is in fact, not used in the compiler at all. It can be removed.
-
-What things can this be used on:
-
- VAR_DECLs that are virtual function tables
-
-Has values of:
-
- RECORD_TYPEs maybe UNION_TYPEs
-
-
-@item DECL_FCONTEXT
-Used to find the first baseclass in which this FIELD_DECL is defined.
-See also DECL_CONTEXT, DECL_FIELD_CONTEXT and DECL_CLASS_CONTEXT.
-
-How it is used:
-
- Used when writing out debugging information about vfield and
- vbase decls.
-
-What things can this be used on:
-
- FIELD_DECLs that are virtual function pointers
- FIELD_DECLs
-
-
-@item DECL_REFERENCE_SLOT
-Used to hold the initialize for the reference.
-
-What things can this be used on:
-
- PARM_DECLs and VAR_DECLs that have a reference type
-
-
-@item DECL_VINDEX
-Used for FUNCTION_DECLs in two different ways. Before the structure
-containing the FUNCTION_DECL is laid out, DECL_VINDEX may point to a
-FUNCTION_DECL in a base class which is the FUNCTION_DECL which this
-FUNCTION_DECL will replace as a virtual function. When the class is
-laid out, this pointer is changed to an INTEGER_CST node which is
-suitable to find an index into the virtual function table. See
-get_vtable_entry as to how one can find the right index into the virtual
-function table. The first index 0, of a virtual function table it not
-used in the normal way, so the first real index is 1.
-
-DECL_VINDEX may be a TREE_LIST, that would seem to be a list of
-overridden FUNCTION_DECLs. add_virtual_function has code to deal with
-this when it uses the variable base_fndecl_list, but it would seem that
-somehow, it is possible for the TREE_LIST to pursist until method_call,
-and it should not.
-
-
-What things can this be used on:
-
- FUNCTION_DECLs
-
-
-@item DECL_SOURCE_FILE
-Identifies what source file a particular declaration was found in.
-
-Has values of:
-
- "<built-in>" on TYPE_DECLs to mean the typedef is built in
-
-
-@item DECL_SOURCE_LINE
-Identifies what source line number in the source file the declaration
-was found at.
-
-Has values of:
-
-@display
-0 for an undefined label
-
-0 for TYPE_DECLs that are internally generated
-
-0 for FUNCTION_DECLs for functions generated by the compiler
- (not yet, but should be)
-
-0 for ``magic'' arguments to functions, that the user has no
- control over
-@end display
-
-
-@item TREE_USED
-
-Has values of:
-
- 0 for unused labels
-
-
-@item TREE_ADDRESSABLE
-A flag that is set for any type that has a constructor.
-
-
-@item TREE_COMPLEXITY
-They seem a kludge way to track recursion, poping, and pushing. They only
-appear in cp-decl.c and cp-decl2.c, so the are a good candidate for
-proper fixing, and removal.
-
-
-@item TREE_HAS_CONSTRUCTOR
-A flag to indicate when a CALL_EXPR represents a call to a constructor.
-If set, we know that the type of the object, is the complete type of the
-object, and that the value returned is nonnull. When used in this
-fashion, it is an optimization. Can also be used on SAVE_EXPRs to
-indicate when they are of fixed type and nonnull. Can also be used on
-INDIRECT_EXPRs on CALL_EXPRs that represent a call to a constructor.
-
-
-@item TREE_PRIVATE
-Set for FIELD_DECLs by finish_struct. But not uniformly set.
-
-The following routines do something with PRIVATE access:
-build_method_call, alter_access, finish_struct_methods,
-finish_struct, convert_to_aggr, CWriteLanguageDecl, CWriteLanguageType,
-CWriteUseObject, compute_access, lookup_field, dfs_pushdecl,
-GNU_xref_member, dbxout_type_fields, dbxout_type_method_1
-
-
-@item TREE_PROTECTED
-The following routines do something with PROTECTED access:
-build_method_call, alter_access, finish_struct, convert_to_aggr,
-CWriteLanguageDecl, CWriteLanguageType, CWriteUseObject,
-compute_access, lookup_field, GNU_xref_member, dbxout_type_fields,
-dbxout_type_method_1
-
-
-@item TYPE_BINFO
-Used to get the binfo for the type.
-
-Has values of:
-
- TREE_VECs that are binfos
-
-What things can this be used on:
-
- RECORD_TYPEs
-
-
-@item TYPE_BINFO_BASETYPES
-See also BINFO_BASETYPES.
-
-@item TYPE_BINFO_VIRTUALS
-A unique list of functions for the virtual function table. See also
-BINFO_VIRTUALS.
-
-What things can this be used on:
-
- RECORD_TYPEs
-
-
-@item TYPE_BINFO_VTABLE
-Points to the virtual function table associated with the given type.
-See also BINFO_VTABLE.
-
-What things can this be used on:
-
- RECORD_TYPEs
-
-Has values of:
-
- VAR_DECLs that are virtual function tables
-
-
-@item TYPE_NAME
-Names the type.
-
-Has values of:
-
-@display
-0 for things that don't have names.
-should be IDENTIFIER_NODE for RECORD_TYPEs UNION_TYPEs and
- ENUM_TYPEs.
-TYPE_DECL for RECORD_TYPEs, UNION_TYPEs and ENUM_TYPEs, but
- shouldn't be.
-TYPE_DECL for typedefs, unsure why.
-@end display
-
-What things can one use this on:
-
-@display
-TYPE_DECLs
-RECORD_TYPEs
-UNION_TYPEs
-ENUM_TYPEs
-@end display
-
-History:
-
- It currently points to the TYPE_DECL for RECORD_TYPEs,
- UNION_TYPEs and ENUM_TYPEs, but it should be history soon.
-
-
-@item TYPE_METHODS
-Synonym for @code{CLASSTYPE_METHOD_VEC}. Chained together with
-@code{TREE_CHAIN}. @file{dbxout.c} uses this to get at the methods of a
-class.
-
-
-@item TYPE_DECL
-Used to represent typedefs, and used to represent bindings layers.
-
-Components:
-
- DECL_NAME is the name of the typedef. For example, foo would
- be found in the DECL_NAME slot when @code{typedef int foo;} is
- seen.
-
- DECL_SOURCE_LINE identifies what source line number in the
- source file the declaration was found at. A value of 0
- indicates that this TYPE_DECL is just an internal binding layer
- marker, and does not correspond to a user supplied typedef.
-
- DECL_SOURCE_FILE
-
-@item TYPE_FIELDS
-A linked list (via @code{TREE_CHAIN}) of member types of a class. The
-list can contain @code{TYPE_DECL}s, but there can also be other things
-in the list apparently. See also @code{CLASSTYPE_TAGS}.
-
-
-@item TYPE_VIRTUAL_P
-A flag used on a @code{FIELD_DECL} or a @code{VAR_DECL}, indicates it is
-a virtual function table or a pointer to one. When used on a
-@code{FUNCTION_DECL}, indicates that it is a virtual function. When
-used on an @code{IDENTIFIER_NODE}, indicates that a function with this
-same name exists and has been declared virtual.
-
-When used on types, it indicates that the type has virtual functions, or
-is derived from one that does.
-
-Not sure if the above about virtual function tables is still true. See
-also info on @code{DECL_VIRTUAL_P}.
-
-What things can this be used on:
-
- FIELD_DECLs, VAR_DECLs, FUNCTION_DECLs, IDENTIFIER_NODEs
-
-
-@item VF_BASETYPE_VALUE
-Get the associated type from the binfo that caused the given vfield to
-exist. This is the least derived class (the most parent class) that
-needed a virtual function table. It is probably the case that all uses
-of this field are misguided, but they need to be examined on a
-case-by-case basis. See history for more information on why the
-previous statement was made.
-
-Set at @code{finish_base_struct} time.
-
-What things can this be used on:
-
- TREE_LISTs that are vfields
-
-History:
-
- This field was used to determine if a virtual function table's
- slot should be filled in with a certain virtual function, by
- checking to see if the type returned by VF_BASETYPE_VALUE was a
- parent of the context in which the old virtual function existed.
- This incorrectly assumes that a given type _could_ not appear as
- a parent twice in a given inheritance lattice. For single
- inheritance, this would in fact work, because a type could not
- possibly appear more than once in an inheritance lattice, but
- with multiple inheritance, a type can appear more than once.
-
-
-@item VF_BINFO_VALUE
-Identifies the binfo that caused this vfield to exist. If this vfield
-is from the first direct base class that has a virtual function table,
-then VF_BINFO_VALUE is NULL_TREE, otherwise it will be the binfo of the
-direct base where the vfield came from. Can use @code{TREE_VIA_VIRTUAL}
-on result to find out if it is a virtual base class. Related to the
-binfo found by
-
-@example
-get_binfo (VF_BASETYPE_VALUE (vfield), t, 0)
-@end example
-
-@noindent
-where @samp{t} is the type that has the given vfield.
-
-@example
-get_binfo (VF_BASETYPE_VALUE (vfield), t, 0)
-@end example
-
-@noindent
-will return the binfo for the given vfield.
-
-May or may not be set at @code{modify_vtable_entries} time. Set at
-@code{finish_base_struct} time.
-
-What things can this be used on:
-
- TREE_LISTs that are vfields
-
-
-@item VF_DERIVED_VALUE
-Identifies the type of the most derived class of the vfield, excluding
-the class this vfield is for.
-
-Set at @code{finish_base_struct} time.
-
-What things can this be used on:
-
- TREE_LISTs that are vfields
-
-
-@item VF_NORMAL_VALUE
-Identifies the type of the most derived class of the vfield, including
-the class this vfield is for.
-
-Set at @code{finish_base_struct} time.
-
-What things can this be used on:
-
- TREE_LISTs that are vfields
-
-
-@item WRITABLE_VTABLES
-This is a option that can be defined when building the compiler, that
-will cause the compiler to output vtables into the data segment so that
-the vtables maybe written. This is undefined by default, because
-normally the vtables should be unwritable. People that implement object
-I/O facilities may, or people that want to change the dynamic type of
-objects may want to have the vtables writable. Another way of achieving
-this would be to make a copy of the vtable into writable memory, but the
-drawback there is that that method only changes the type for one object.
-
-@end table
-
-@node Typical Behavior, Coding Conventions, Macros, Top
-@section Typical Behavior
-
-@cindex parse errors
-
-Whenever seemingly normal code fails with errors like
-@code{syntax error at `\@{'}, it's highly likely that grokdeclarator is
-returning a NULL_TREE for whatever reason.
-
-@node Coding Conventions, Templates, Typical Behavior, Top
-@section Coding Conventions
-
-It should never be that case that trees are modified in-place by the
-back-end, @emph{unless} it is guaranteed that the semantics are the same
-no matter how shared the tree structure is. @file{fold-const.c} still
-has some cases where this is not true, but rms hypothesizes that this
-will never be a problem.
-
-@node Templates, Access Control, Coding Conventions, Top
-@section Templates
-
-A template is represented by a @code{TEMPLATE_DECL}. The specific
-fields used are:
-
-@table @code
-@item DECL_TEMPLATE_RESULT
-The generic decl on which instantiations are based. This looks just
-like any other decl.
-
-@item DECL_TEMPLATE_PARMS
-The parameters to this template.
-@end table
-
-The generic decl is parsed as much like any other decl as possible,
-given the parameterization. The template decl is not built up until the
-generic decl has been completed. For template classes, a template decl
-is generated for each member function and static data member, as well.
-
-Template members of template classes are represented by a TEMPLATE_DECL
-for the class' parameters around another TEMPLATE_DECL for the member's
-parameters.
-
-All declarations that are instantiations or specializations of templates
-refer to their template and parameters through DECL_TEMPLATE_INFO.
-
-How should I handle parsing member functions with the proper param
-decls? Set them up again or try to use the same ones? Currently we do
-the former. We can probably do this without any extra machinery in
-store_pending_inline, by deducing the parameters from the decl in
-do_pending_inlines. PRE_PARSED_TEMPLATE_DECL?
-
-If a base is a parm, we can't check anything about it. If a base is not
-a parm, we need to check it for name binding. Do finish_base_struct if
-no bases are parameterized (only if none, including indirect, are
-parms). Nah, don't bother trying to do any of this until instantiation
--- we only need to do name binding in advance.
-
-Always set up method vec and fields, inc. synthesized methods. Really?
-We can't know the types of the copy folks, or whether we need a
-destructor, or can have a default ctor, until we know our bases and
-fields. Otherwise, we can assume and fix ourselves later. Hopefully.
-
-@node Access Control, Error Reporting, Templates, Top
-@section Access Control
-The function compute_access returns one of three values:
-
-@table @code
-@item access_public
-means that the field can be accessed by the current lexical scope.
-
-@item access_protected
-means that the field cannot be accessed by the current lexical scope
-because it is protected.
-
-@item access_private
-means that the field cannot be accessed by the current lexical scope
-because it is private.
-@end table
-
-DECL_ACCESS is used for access declarations; alter_access creates a list
-of types and accesses for a given decl.
-
-Formerly, DECL_@{PUBLIC,PROTECTED,PRIVATE@} corresponded to the return
-codes of compute_access and were used as a cache for compute_access.
-Now they are not used at all.
-
-TREE_PROTECTED and TREE_PRIVATE are used to record the access levels
-granted by the containing class. BEWARE: TREE_PUBLIC means something
-completely unrelated to access control!
-
-@node Error Reporting, Parser, Access Control, Top
-@section Error Reporting
-
-The C++ front-end uses a call-back mechanism to allow functions to print
-out reasonable strings for types and functions without putting extra
-logic in the functions where errors are found. The interface is through
-the @code{cp_error} function (or @code{cp_warning}, etc.). The
-syntax is exactly like that of @code{error}, except that a few more
-conversions are supported:
-
-@itemize @bullet
-@item
-%C indicates a value of `enum tree_code'.
-@item
-%D indicates a *_DECL node.
-@item
-%E indicates a *_EXPR node.
-@item
-%L indicates a value of `enum languages'.
-@item
-%P indicates the name of a parameter (i.e. "this", "1", "2", ...)
-@item
-%T indicates a *_TYPE node.
-@item
-%O indicates the name of an operator (MODIFY_EXPR -> "operator =").
-
-@end itemize
-
-There is some overlap between these; for instance, any of the node
-options can be used for printing an identifier (though only @code{%D}
-tries to decipher function names).
-
-For a more verbose message (@code{class foo} as opposed to just @code{foo},
-including the return type for functions), use @code{%#c}.
-To have the line number on the error message indicate the line of the
-DECL, use @code{cp_error_at} and its ilk; to indicate which argument you want,
-use @code{%+D}, or it will default to the first.
-
-@node Parser, Exception Handling, Error Reporting, Top
-@section Parser
-
-Some comments on the parser:
-
-The @code{after_type_declarator} / @code{notype_declarator} hack is
-necessary in order to allow redeclarations of @code{TYPENAME}s, for
-instance
-
-@example
-typedef int foo;
-class A @{
- char *foo;
-@};
-@end example
-
-In the above, the first @code{foo} is parsed as a @code{notype_declarator},
-and the second as a @code{after_type_declarator}.
-
-Ambiguities:
-
-There are currently four reduce/reduce ambiguities in the parser. They are:
-
-1) Between @code{template_parm} and
-@code{named_class_head_sans_basetype}, for the tokens @code{aggr
-identifier}. This situation occurs in code looking like
-
-@example
-template <class T> class A @{ @};
-@end example
-
-It is ambiguous whether @code{class T} should be parsed as the
-declaration of a template type parameter named @code{T} or an unnamed
-constant parameter of type @code{class T}. Section 14.6, paragraph 3 of
-the January '94 working paper states that the first interpretation is
-the correct one. This ambiguity results in two reduce/reduce conflicts.
-
-2) Between @code{primary} and @code{type_id} for code like @samp{int()}
-in places where both can be accepted, such as the argument to
-@code{sizeof}. Section 8.1 of the pre-San Diego working paper specifies
-that these ambiguous constructs will be interpreted as @code{typename}s.
-This ambiguity results in six reduce/reduce conflicts between
-@samp{absdcl} and @samp{functional_cast}.
-
-3) Between @code{functional_cast} and
-@code{complex_direct_notype_declarator}, for various token strings.
-This situation occurs in code looking like
-
-@example
-int (*a);
-@end example
-
-This code is ambiguous; it could be a declaration of the variable
-@samp{a} as a pointer to @samp{int}, or it could be a functional cast of
-@samp{*a} to @samp{int}. Section 6.8 specifies that the former
-interpretation is correct. This ambiguity results in 7 reduce/reduce
-conflicts. Another aspect of this ambiguity is code like 'int (x[2]);',
-which is resolved at the '[' and accounts for 6 reduce/reduce conflicts
-between @samp{direct_notype_declarator} and
-@samp{primary}/@samp{overqualified_id}. Finally, there are 4 r/r
-conflicts between @samp{expr_or_declarator} and @samp{primary} over code
-like 'int (a);', which could probably be resolved but would also
-probably be more trouble than it's worth. In all, this situation
-accounts for 17 conflicts. Ack!
-
-The second case above is responsible for the failure to parse 'LinppFile
-ppfile (String (argv[1]), &outs, argc, argv);' (from Rogue Wave
-Math.h++) as an object declaration, and must be fixed so that it does
-not resolve until later.
-
-4) Indirectly between @code{after_type_declarator} and @code{parm}, for
-type names. This occurs in (as one example) code like
-
-@example
-typedef int foo, bar;
-class A @{
- foo (bar);
-@};
-@end example
-
-What is @code{bar} inside the class definition? We currently interpret
-it as a @code{parm}, as does Cfront, but IBM xlC interprets it as an
-@code{after_type_declarator}. I believe that xlC is correct, in light
-of 7.1p2, which says "The longest sequence of @i{decl-specifiers} that
-could possibly be a type name is taken as the @i{decl-specifier-seq} of
-a @i{declaration}." However, it seems clear that this rule must be
-violated in the case of constructors. This ambiguity accounts for 8
-conflicts.
-
-Unlike the others, this ambiguity is not recognized by the Working Paper.
-
-@node Exception Handling, Free Store, Parser, Top
-@section Exception Handling
-
-Note, exception handling in g++ is still under development.
-
-This section describes the mapping of C++ exceptions in the C++
-front-end, into the back-end exception handling framework.
-
-The basic mechanism of exception handling in the back-end is
-unwind-protect a la elisp. This is a general, robust, and language
-independent representation for exceptions.
-
-The C++ front-end exceptions are mapping into the unwind-protect
-semantics by the C++ front-end. The mapping is describe below.
-
-When -frtti is used, rtti is used to do exception object type checking,
-when it isn't used, the encoded name for the type of the object being
-thrown is used instead. All code that originates exceptions, even code
-that throws exceptions as a side effect, like dynamic casting, and all
-code that catches exceptions must be compiled with either -frtti, or
--fno-rtti. It is not possible to mix rtti base exception handling
-objects with code that doesn't use rtti. The exceptions to this, are
-code that doesn't catch or throw exceptions, catch (...), and code that
-just rethrows an exception.
-
-Currently we use the normal mangling used in building functions names
-(int's are "i", const char * is PCc) to build the non-rtti base type
-descriptors for exception handling. These descriptors are just plain
-NULL terminated strings, and internally they are passed around as char
-*.
-
-In C++, all cleanups should be protected by exception regions. The
-region starts just after the reason why the cleanup is created has
-ended. For example, with an automatic variable, that has a constructor,
-it would be right after the constructor is run. The region ends just
-before the finalization is expanded. Since the backend may expand the
-cleanup multiple times along different paths, once for normal end of the
-region, once for non-local gotos, once for returns, etc, the backend
-must take special care to protect the finalization expansion, if the
-expansion is for any other reason than normal region end, and it is
-`inline' (it is inside the exception region). The backend can either
-choose to move them out of line, or it can created an exception region
-over the finalization to protect it, and in the handler associated with
-it, it would not run the finalization as it otherwise would have, but
-rather just rethrow to the outer handler, careful to skip the normal
-handler for the original region.
-
-In Ada, they will use the more runtime intensive approach of having
-fewer regions, but at the cost of additional work at run time, to keep a
-list of things that need cleanups. When a variable has finished
-construction, they add the cleanup to the list, when the come to the end
-of the lifetime of the variable, the run the list down. If the take a
-hit before the section finishes normally, they examine the list for
-actions to perform. I hope they add this logic into the back-end, as it
-would be nice to get that alternative approach in C++.
-
-On an rs6000, xlC stores exception objects on that stack, under the try
-block. When is unwinds down into a handler, the frame pointer is
-adjusted back to the normal value for the frame in which the handler
-resides, and the stack pointer is left unchanged from the time at which
-the object was thrown. This is so that there is always someplace for
-the exception object, and nothing can overwrite it, once we start
-throwing. The only bad part, is that the stack remains large.
-
-The below points out some things that work in g++'s exception handling.
-
-All completely constructed temps and local variables are cleaned up in
-all unwinded scopes. Completely constructed parts of partially
-constructed objects are cleaned up. This includes partially built
-arrays. Exception specifications are now handled. Thrown objects are
-now cleaned up all the time. We can now tell if we have an active
-exception being thrown or not (__eh_type != 0). We use this to call
-terminate if someone does a throw; without there being an active
-exception object. uncaught_exception () works. Exception handling
-should work right if you optimize. Exception handling should work with
--fpic or -fPIC.
-
-The below points out some flaws in g++'s exception handling, as it now
-stands.
-
-Only exact type matching or reference matching of throw types works when
--fno-rtti is used. Only works on a SPARC (like Suns) (both -mflat and
--mno-flat models work), SPARClite, Hitachi SH, i386, arm, rs6000,
-PowerPC, Alpha, mips, VAX, m68k and z8k machines. SPARC v9 may not
-work. HPPA is mostly done, but throwing between a shared library and
-user code doesn't yet work. Some targets have support for data-driven
-unwinding. Partial support is in for all other machines, but a stack
-unwinder called __unwind_function has to be written, and added to
-libgcc2 for them. The new EH code doesn't rely upon the
-__unwind_function for C++ code, instead it creates per function
-unwinders right inside the function, unfortunately, on many platforms
-the definition of RETURN_ADDR_RTX in the tm.h file for the machine port
-is wrong. See below for details on __unwind_function. RTL_EXPRs for EH
-cond variables for && and || exprs should probably be wrapped in
-UNSAVE_EXPRs, and RTL_EXPRs tweaked so that they can be unsaved.
-
-We only do pointer conversions on exception matching a la 15.3 p2 case
-3: `A handler with type T, const T, T&, or const T& is a match for a
-throw-expression with an object of type E if [3]T is a pointer type and
-E is a pointer type that can be converted to T by a standard pointer
-conversion (_conv.ptr_) not involving conversions to pointers to private
-or protected base classes.' when -frtti is given.
-
-We don't call delete on new expressions that die because the ctor threw
-an exception. See except/18 for a test case.
-
-15.2 para 13: The exception being handled should be rethrown if control
-reaches the end of a handler of the function-try-block of a constructor
-or destructor, right now, it is not.
-
-15.2 para 12: If a return statement appears in a handler of
-function-try-block of a constructor, the program is ill-formed, but this
-isn't diagnosed.
-
-15.2 para 11: If the handlers of a function-try-block contain a jump
-into the body of a constructor or destructor, the program is ill-formed,
-but this isn't diagnosed.
-
-15.2 para 9: Check that the fully constructed base classes and members
-of an object are destroyed before entering the handler of a
-function-try-block of a constructor or destructor for that object.
-
-build_exception_variant should sort the incoming list, so that it
-implements set compares, not exact list equality. Type smashing should
-smash exception specifications using set union.
-
-Thrown objects are usually allocated on the heap, in the usual way. If
-one runs out of heap space, throwing an object will probably never work.
-This could be relaxed some by passing an __in_chrg parameter to track
-who has control over the exception object. Thrown objects are not
-allocated on the heap when they are pointer to object types. We should
-extend it so that all small (<4*sizeof(void*)) objects are stored
-directly, instead of allocated on the heap.
-
-When the backend returns a value, it can create new exception regions
-that need protecting. The new region should rethrow the object in
-context of the last associated cleanup that ran to completion.
-
-The structure of the code that is generated for C++ exception handling
-code is shown below:
-
-@example
-Ln: throw value;
- copy value onto heap
- jump throw (Ln, id, address of copy of value on heap)
-
- try @{
-+Lstart: the start of the main EH region
-|... ...
-+Lend: the end of the main EH region
- @} catch (T o) @{
- ...1
- @}
-Lresume:
- nop used to make sure there is something before
- the next region ends, if there is one
-... ...
-
- jump Ldone
-[
-Lmainhandler: handler for the region Lstart-Lend
- cleanup
-] zero or more, depending upon automatic vars with dtors
-+Lpartial:
-| jump Lover
-+Lhere:
- rethrow (Lhere, same id, same obj);
-Lterm: handler for the region Lpartial-Lhere
- call terminate
-Lover:
-[
- [
- call throw_type_match
- if (eq) @{
- ] these lines disappear when there is no catch condition
-+Lsregion2:
-| ...1
-| jump Lresume
-|Lhandler: handler for the region Lsregion2-Leregion2
-| rethrow (Lresume, same id, same obj);
-+Leregion2
- @}
-] there are zero or more of these sections, depending upon how many
- catch clauses there are
------------------------------ expand_end_all_catch --------------------------
- here we have fallen off the end of all catch
- clauses, so we rethrow to outer
- rethrow (Lresume, same id, same obj);
------------------------------ expand_end_all_catch --------------------------
-[
-L1: maybe throw routine
-] depending upon if we have expanded it or not
-Ldone:
- ret
-
-start_all_catch emits labels: Lresume,
-
-@end example
-
-The __unwind_function takes a pointer to the throw handler, and is
-expected to pop the stack frame that was built to call it, as well as
-the frame underneath and then jump to the throw handler. It must
-restore all registers to their proper values as well as all other
-machine state as determined by the context in which we are unwinding
-into. The way I normally start is to compile:
-
- void *g;
- foo(void* a) @{ g = a; @}
-
-with -S, and change the thing that alters the PC (return, or ret
-usually) to not alter the PC, making sure to leave all other semantics
-(like adjusting the stack pointer, or frame pointers) in. After that,
-replicate the prologue once more at the end, again, changing the PC
-altering instructions, and finally, at the very end, jump to `g'.
-
-It takes about a week to write this routine, if someone wants to
-volunteer to write this routine for any architecture, exception support
-for that architecture will be added to g++. Please send in those code
-donations. One other thing that needs to be done, is to double check
-that __builtin_return_address (0) works.
-
-@subsection Specific Targets
-
-For the alpha, the __unwind_function will be something resembling:
-
-@example
-void
-__unwind_function(void *ptr)
-@{
- /* First frame */
- asm ("ldq $15, 8($30)"); /* get the saved frame ptr; 15 is fp, 30 is sp */
- asm ("bis $15, $15, $30"); /* reload sp with the fp we found */
-
- /* Second frame */
- asm ("ldq $15, 8($30)"); /* fp */
- asm ("bis $15, $15, $30"); /* reload sp with the fp we found */
-
- /* Return */
- asm ("ret $31, ($16), 1"); /* return to PTR, stored in a0 */
-@}
-@end example
-
-@noindent
-However, there are a few problems preventing it from working. First of
-all, the gcc-internal function @code{__builtin_return_address} needs to
-work given an argument of 0 for the alpha. As it stands as of August
-30th, 1995, the code for @code{BUILT_IN_RETURN_ADDRESS} in @file{expr.c}
-will definitely not work on the alpha. Instead, we need to define
-the macros @code{DYNAMIC_CHAIN_ADDRESS} (maybe),
-@code{RETURN_ADDR_IN_PREVIOUS_FRAME}, and definitely need a new
-definition for @code{RETURN_ADDR_RTX}.
-
-In addition (and more importantly), we need a way to reliably find the
-frame pointer on the alpha. The use of the value 8 above to restore the
-frame pointer (register 15) is incorrect. On many systems, the frame
-pointer is consistently offset to a specific point on the stack. On the
-alpha, however, the frame pointer is pushed last. First the return
-address is stored, then any other registers are saved (e.g., @code{s0}),
-and finally the frame pointer is put in place. So @code{fp} could have
-an offset of 8, but if the calling function saved any registers at all,
-they add to the offset.
-
-The only places the frame size is noted are with the @samp{.frame}
-directive, for use by the debugger and the OSF exception handling model
-(useless to us), and in the initial computation of the new value for
-@code{sp}, the stack pointer. For example, the function may start with:
-
-@example
-lda $30,-32($30)
-.frame $15,32,$26,0
-@end example
-
-@noindent
-The 32 above is exactly the value we need. With this, we can be sure
-that the frame pointer is stored 8 bytes less---in this case, at 24(sp)).
-The drawback is that there is no way that I (Brendan) have found to let
-us discover the size of a previous frame @emph{inside} the definition
-of @code{__unwind_function}.
-
-So to accomplish exception handling support on the alpha, we need two
-things: first, a way to figure out where the frame pointer was stored,
-and second, a functional @code{__builtin_return_address} implementation
-for except.c to be able to use it.
-
-Or just support DWARF 2 unwind info.
-
-@subsection New Backend Exception Support
-
-This subsection discusses various aspects of the design of the
-data-driven model being implemented for the exception handling backend.
-
-The goal is to generate enough data during the compilation of user code,
-such that we can dynamically unwind through functions at run time with a
-single routine (@code{__throw}) that lives in libgcc.a, built by the
-compiler, and dispatch into associated exception handlers.
-
-This information is generated by the DWARF 2 debugging backend, and
-includes all of the information __throw needs to unwind an arbitrary
-frame. It specifies where all of the saved registers and the return
-address can be found at any point in the function.
-
-Major disadvantages when enabling exceptions are:
-
-@itemize @bullet
-@item
-Code that uses caller saved registers, can't, when flow can be
-transferred into that code from an exception handler. In high performance
-code this should not usually be true, so the effects should be minimal.
-
-@end itemize
-
-@subsection Backend Exception Support
-
-The backend must be extended to fully support exceptions. Right now
-there are a few hooks into the alpha exception handling backend that
-resides in the C++ frontend from that backend that allows exception
-handling to work in g++. An exception region is a segment of generated
-code that has a handler associated with it. The exception regions are
-denoted in the generated code as address ranges denoted by a starting PC
-value and an ending PC value of the region. Some of the limitations
-with this scheme are:
-
-@itemize @bullet
-@item
-The backend replicates insns for such things as loop unrolling and
-function inlining. Right now, there are no hooks into the frontend's
-exception handling backend to handle the replication of insns. When
-replication happens, a new exception region descriptor needs to be
-generated for the new region.
-
-@item
-The backend expects to be able to rearrange code, for things like jump
-optimization. Any rearranging of the code needs have exception region
-descriptors updated appropriately.
-
-@item
-The backend can eliminate dead code. Any associated exception region
-descriptor that refers to fully contained code that has been eliminated
-should also be removed, although not doing this is harmless in terms of
-semantics.
-
-@end itemize
-
-The above is not meant to be exhaustive, but does include all things I
-have thought of so far. I am sure other limitations exist.
-
-Below are some notes on the migration of the exception handling code
-backend from the C++ frontend to the backend.
-
-NOTEs are to be used to denote the start of an exception region, and the
-end of the region. I presume that the interface used to generate these
-notes in the backend would be two functions, start_exception_region and
-end_exception_region (or something like that). The frontends are
-required to call them in pairs. When marking the end of a region, an
-argument can be passed to indicate the handler for the marked region.
-This can be passed in many ways, currently a tree is used. Another
-possibility would be insns for the handler, or a label that denotes a
-handler. I have a feeling insns might be the best way to pass it.
-Semantics are, if an exception is thrown inside the region, control is
-transferred unconditionally to the handler. If control passes through
-the handler, then the backend is to rethrow the exception, in the
-context of the end of the original region. The handler is protected by
-the conventional mechanisms; it is the frontend's responsibility to
-protect the handler, if special semantics are required.
-
-This is a very low level view, and it would be nice is the backend
-supported a somewhat higher level view in addition to this view. This
-higher level could include source line number, name of the source file,
-name of the language that threw the exception and possibly the name of
-the exception. Kenner may want to rope you into doing more than just
-the basics required by C++. You will have to resolve this. He may want
-you to do support for non-local gotos, first scan for exception handler,
-if none is found, allow the debugger to be entered, without any cleanups
-being done. To do this, the backend would have to know the difference
-between a cleanup-rethrower, and a real handler, if would also have to
-have a way to know if a handler `matches' a thrown exception, and this
-is frontend specific.
-
-The stack unwinder is one of the hardest parts to do. It is highly
-machine dependent. The form that kenner seems to like was a couple of
-macros, that would do the machine dependent grunt work. One preexisting
-function that might be of some use is __builtin_return_address (). One
-macro he seemed to want was __builtin_return_address, and the other
-would do the hard work of fixing up the registers, adjusting the stack
-pointer, frame pointer, arg pointer and so on.
-
-
-@node Free Store, Mangling, Exception Handling, Top
-@section Free Store
-
-@code{operator new []} adds a magic cookie to the beginning of arrays
-for which the number of elements will be needed by @code{operator delete
-[]}. These are arrays of objects with destructors and arrays of objects
-that define @code{operator delete []} with the optional size_t argument.
-This cookie can be examined from a program as follows:
-
-@example
-typedef unsigned long size_t;
-extern "C" int printf (const char *, ...);
-
-size_t nelts (void *p)
-@{
- struct cookie @{
- size_t nelts __attribute__ ((aligned (sizeof (double))));
- @};
-
- cookie *cp = (cookie *)p;
- --cp;
-
- return cp->nelts;
-@}
-
-struct A @{
- ~A() @{ @}
-@};
-
-main()
-@{
- A *ap = new A[3];
- printf ("%ld\n", nelts (ap));
-@}
-@end example
-
-@section Linkage
-The linkage code in g++ is horribly twisted in order to meet two design goals:
-
-1) Avoid unnecessary emission of inlines and vtables.
-
-2) Support pedantic assemblers like the one in AIX.
-
-To meet the first goal, we defer emission of inlines and vtables until
-the end of the translation unit, where we can decide whether or not they
-are needed, and how to emit them if they are.
-
-@node Mangling, Concept Index, Free Store, Top
-@section Function name mangling for C++ and Java
-
-Both C++ and Java provide overloaded functions and methods,
-which are methods with the same types but different parameter lists.
-Selecting the correct version is done at compile time.
-Though the overloaded functions have the same name in the source code,
-they need to be translated into different assembler-level names,
-since typical assemblers and linkers cannot handle overloading.
-This process of encoding the parameter types with the method name
-into a unique name is called @dfn{name mangling}. The inverse
-process is called @dfn{demangling}.
-
-It is convenient that C++ and Java use compatible mangling schemes,
-since the makes life easier for tools such as gdb, and it eases
-integration between C++ and Java.
-
-Note there is also a standard "Jave Native Interface" (JNI) which
-implements a different calling convention, and uses a different
-mangling scheme. The JNI is a rather abstract ABI so Java can call methods
-written in C or C++;
-we are concerned here about a lower-level interface primarily
-intended for methods written in Java, but that can also be used for C++
-(and less easily C).
-
-Note that on systems that follow BSD tradition, a C identifier @code{var}
-would get "mangled" into the assembler name @samp{_var}. On such
-systems, all other mangled names are also prefixed by a @samp{_}
-which is not shown in the following examples.
-
-@subsection Method name mangling
-
-C++ mangles a method by emitting the function name, followed by @code{__},
-followed by encodings of any method qualifiers (such as @code{const}),
-followed by the mangling of the method's class,
-followed by the mangling of the parameters, in order.
-
-For example @code{Foo::bar(int, long) const} is mangled
-as @samp{bar__C3Fooil}.
-
-For a constructor, the method name is left out.
-That is @code{Foo::Foo(int, long) const} is mangled
-as @samp{__C3Fooil}.
-
-GNU Java does the same.
-
-@subsection Primitive types
-
-The C++ types @code{int}, @code{long}, @code{short}, @code{char},
-and @code{long long} are mangled as @samp{i}, @samp{l},
-@samp{s}, @samp{c}, and @samp{x}, respectively.
-The corresponding unsigned types have @samp{U} prefixed
-to the mangling. The type @code{signed char} is mangled @samp{Sc}.
-
-The C++ and Java floating-point types @code{float} and @code{double}
-are mangled as @samp{f} and @samp{d} respectively.
-
-The C++ @code{bool} type and the Java @code{boolean} type are
-mangled as @samp{b}.
-
-The C++ @code{wchar_t} and the Java @code{char} types are
-mangled as @samp{w}.
-
-The Java integral types @code{byte}, @code{short}, @code{int}
-and @code{long} are mangled as @samp{c}, @samp{s}, @samp{i},
-and @samp{x}, respectively.
-
-C++ code that has included @code{javatypes.h} will mangle
-the typedefs @code{jbyte}, @code{jshort}, @code{jint}
-and @code{jlong} as respectively @samp{c}, @samp{s}, @samp{i},
-and @samp{x}. (This has not been implemented yet.)
-
-@subsection Mangling of simple names
-
-A simple class, package, template, or namespace name is
-encoded as the number of characters in the name, followed by
-the actual characters. Thus the class @code{Foo}
-is encoded as @samp{3Foo}.
-
-If any of the characters in the name are not alphanumeric
-(i.e not one of the standard ASCII letters, digits, or '_'),
-or the initial character is a digit, then the name is
-mangled as a sequence of encoded Unicode letters.
-A Unicode encoding starts with a @samp{U} to indicate
-that Unicode escapes are used, followed by the number of
-bytes used by the Unicode encoding, followed by the bytes
-representing the encoding. ASSCI letters and
-non-initial digits are encoded without change. However, all
-other characters (including underscore and initial digits) are
-translated into a sequence starting with an underscore,
-followed by the big-endian 4-hex-digit lower-case encoding of the character.
-
-If a method name contains Unicode-escaped characters, the
-entire mangled method name is followed by a @samp{U}.
-
-For example, the method @code{X\u0319::M\u002B(int)} is encoded as
-@samp{M_002b__U6X_0319iU}.
-
-
-@subsection Pointer and reference types
-
-A C++ pointer type is mangled as @samp{P} followed by the
-mangling of the type pointed to.
-
-A C++ reference type as mangled as @samp{R} followed by the
-mangling of the type referenced.
-
-A Java object reference type is equivalent
-to a C++ pointer parameter, so we mangle such an parameter type
-as @samp{P} followed by the mangling of the class name.
-
-@subsection Squangled type compression
-
-Squangling (enabled with the @samp{-fsquangle} option), utilizes the
-@samp{B} code to indicate reuse of a previously seen type within an
-indentifier. Types are recognized in a left to right manner and given
-increasing values, which are appended to the code in the standard
-manner. Ie, multiple digit numbers are delimited by @samp{_}
-characters. A type is considered to be any non primitive type,
-regardless of whether its a parameter, template parameter, or entire
-template. Certain codes are considered modifiers of a type, and are not
-included as part of the type. These are the @samp{C}, @samp{V},
-@samp{P}, @samp{A}, @samp{R}, @samp{U} and @samp{u} codes, denoting
-constant, volatile, pointer, array, reference, unsigned, and restrict.
-These codes may precede a @samp{B} type in order to make the required
-modifications to the type.
-
-For example:
-@example
-template <class T> class class1 @{ @};
-
-template <class T> class class2 @{ @};
-
-class class3 @{ @};
-
-int f(class2<class1<class3> > a ,int b, const class1<class3>&c, class3 *d) @{ @}
-
- B0 -> class2<class1<class3>
- B1 -> class1<class3>
- B2 -> class3
-@end example
-Produces the mangled name @samp{f__FGt6class21Zt6class11Z6class3iRCB1PB2}.
-The int parameter is a basic type, and does not receive a B encoding...
-
-@subsection Qualified names
-
-Both C++ and Java allow a class to be lexically nested inside another
-class. C++ also supports namespaces.
-Java also supports packages.
-
-These are all mangled the same way: First the letter @samp{Q}
-indicates that we are emitting a qualified name.
-That is followed by the number of parts in the qualified name.
-If that number is 9 or less, it is emitted with no delimiters.
-Otherwise, an underscore is written before and after the count.
-Then follows each part of the qualified name, as described above.
-
-For example @code{Foo::\u0319::Bar} is encoded as
-@samp{Q33FooU5_03193Bar}.
-
-Squangling utilizes the the letter @samp{K} to indicate a
-remembered portion of a qualified name. As qualified names are processed
-for an identifier, the names are numbered and remembered in a
-manner similar to the @samp{B} type compression code.
-Names are recognized left to right, and given increasing values, which are
-appended to the code in the standard manner. ie, multiple digit numbers
-are delimited by @samp{_} characters.
-
-For example
-@example
-class Andrew
-@{
- class WasHere
- @{
- class AndHereToo
- @{
- @};
- @};
-@};
-
-f(Andrew&r1, Andrew::WasHere& r2, Andrew::WasHere::AndHereToo& r3) @{ @}
-
- K0 -> Andrew
- K1 -> Andrew::WasHere
- K2 -> Andrew::WasHere::AndHereToo
-@end example
-Function @samp{f()} would be mangled as :
-@samp{f__FR6AndrewRQ2K07WasHereRQ2K110AndHereToo}
-
-There are some occasions when either a @samp{B} or @samp{K} code could
-be chosen, preference is always given to the @samp{B} code. Ie, the example
-in the section on @samp{B} mangling could have used a @samp{K} code
-instead of @samp{B2}.
-
-@subsection Templates
-
-A class template instantiation is encoded as the letter @samp{t},
-followed by the encoding of the template name, followed
-the number of template parameters, followed by encoding of the template
-parameters. If a template parameter is a type, it is written
-as a @samp{Z} followed by the encoding of the type. If it is a
-template, it is encoded as @samp{z} followed by the parameter
-of the template template parameter and the template name.
-
-A function template specialization (either an instantiation or an
-explicit specialization) is encoded by an @samp{H} followed by the
-encoding of the template parameters, as described above, followed by an
-@samp{_}, the encoding of the argument types to the template function
-(not the specialization), another @samp{_}, and the return type. (Like
-the argument types, the return type is the return type of the function
-template, not the specialization.) Template parameters in the argument
-and return types are encoded by an @samp{X} for type parameters,
-@samp{zX} for template parameters,
-or a @samp{Y} for constant parameters, an index indicating their position
-in the template parameter list declaration, and their template depth.
-
-@subsection Arrays
-
-C++ array types are mangled by emitting @samp{A}, followed by
-the length of the array, followed by an @samp{_}, followed by
-the mangling of the element type. Of course, normally
-array parameter types decay into a pointer types, so you
-don't see this.
-
-Java arrays are objects. A Java type @code{T[]} is mangled
-as if it were the C++ type @code{JArray<T>}.
-For example @code{java.lang.String[]} is encoded as
-@samp{Pt6JArray1ZPQ34java4lang6String}.
-
-@subsection Static fields
-
-Both C++ and Java classes can have static fields.
-These are allocated statically, and are shared among all instances.
-
-The mangling starts with a prefix (@samp{_} in most systems), which is
-followed by the mangling
-of the class name, followed by the "joiner" and finally the field name.
-The joiner (see @code{JOINER} in @code{cp-tree.h}) is a special
-separator character. For historical reasons (and idiosyncracies
-of assembler syntax) it can @samp{$} or @samp{.} (or even
-@samp{_} on a few systems). If the joiner is @samp{_} then the prefix
-is @samp{__static_} instead of just @samp{_}.
-
-For example @code{Foo::Bar::var} (or @code{Foo.Bar.var} in Java syntax)
-would be encoded as @samp{_Q23Foo3Bar$var} or @samp{_Q23Foo3Bar.var}
-(or rarely @samp{__static_Q23Foo3Bar_var}).
-
-If the name of a static variable needs Unicode escapes,
-the Unicode indicator @samp{U} comes before the "joiner".
-This @code{\u1234Foo::var\u3445} becomes @code{_U8_1234FooU.var_3445}.
-
-@subsection Table of demangling code characters
-
-The following special characters are used in mangling:
-
-@table @samp
-@item A
-Indicates a C++ array type.
-
-@item b
-Encodes the C++ @code{bool} type,
-and the Java @code{boolean} type.
-
-@item B
-Used for squangling. Similar in concept to the 'T' non-squangled code.
-
-@item c
-Encodes the C++ @code{char} type, and the Java @code{byte} type.
-
-@item C
-A modifier to indicate a @code{const} type.
-Also used to indicate a @code{const} member function
-(in which cases it precedes the encoding of the method's class).
-
-@item d
-Encodes the C++ and Java @code{double} types.
-
-@item e
-Indicates extra unknown arguments @code{...}.
-
-@item E
-Indicates the opening parenthesis of an expression.
-
-@item f
-Encodes the C++ and Java @code{float} types.
-
-@item F
-Used to indicate a function type.
-
-@item H
-Used to indicate a template function.
-
-@item i
-Encodes the C++ and Java @code{int} types.
-
-@item I
-Encodes typedef names of the form @code{int@var{n}_t}, where @var{n} is a
-positive decimal number. The @samp{I} is followed by either two
-hexidecimal digits, which encode the value of @var{n}, or by an
-arbitrary number of hexidecimal digits between underscores. For
-example, @samp{I40} encodes the type @code{int64_t}, and @samp{I_200_}
-encodes the type @code{int512_t}.
-
-@item J
-Indicates a complex type.
-
-@item K
-Used by squangling to compress qualified names.
-
-@item l
-Encodes the C++ @code{long} type.
-
-@item n
-Immediate repeated type. Followed by the repeat count.
-
-@item N
-Repeated type. Followed by the repeat count of the repeated type,
-followed by the type index of the repeated type. Due to a bug in
-g++ 2.7.2, this is only generated if index is 0. Superceded by
-@samp{n} when squangling.
-
-@item O
-Pointer-to-member type.
-
-@item o
-vector type.
-
-@item P
-Indicates a pointer type. Followed by the type pointed to.
-
-@item Q
-Used to mangle qualified names, which arise from nested classes.
-Also used for namespaces.
-In Java used to mangle package-qualified names, and inner classes.
-
-@item r
-Encodes the GNU C++ @code{long double} type.
-
-@item R
-Indicates a reference type. Followed by the referenced type.
-
-@item s
-Encodes the C++ and java @code{short} types.
-
-@item S
-A modifier that indicates that the following integer type is signed.
-Only used with @code{char}.
-
-Also used as a modifier to indicate a static member function.
-
-@item t
-Indicates a template instantiation.
-
-@item T
-A back reference to a previously seen type.
-
-@item U
-A modifier that indicates that the following integer type is unsigned.
-Also used to indicate that the following class or namespace name
-is encoded using Unicode-mangling.
-
-@item u
-The @code{restrict} type qualifier.
-
-@item v
-Encodes the C++ and Java @code{void} types.
-
-@item V
-A modifier for a @code{volatile} type or method.
-
-@item w
-Encodes the C++ @code{wchar_t} type, and the Java @code{char} types.
-
-@item W
-Indicates the closing parenthesis of an expression.
-
-@item x
-Encodes the GNU C++ @code{long long} type, and the Java @code{long} type.
-
-@item X
-Encodes a template type parameter, when part of a function type.
-
-@item Y
-Encodes a template constant parameter, when part of a function type.
-
-@item z
-Used for template template parameters.
-
-@item Z
-Used for template type parameters.
-
-@end table
-
-The letters @samp{G}, @samp{M}, @samp{O}, and @samp{p}
-also seem to be used for obscure purposes ...
-
-@node Concept Index, , Mangling, Top
-
-@section Concept Index
-
-@printindex cp
-
-@bye
diff --git a/gcc/cp/init.c b/gcc/cp/init.c
index e7d62934d6d..151ca3d7c9b 100644
--- a/gcc/cp/init.c
+++ b/gcc/cp/init.c
@@ -218,7 +218,7 @@ build_default_init (type)
anything with a CONSTRUCTOR for arrays here, as that would imply
copy-initialization. */
return NULL_TREE;
- else if (AGGREGATE_TYPE_P (type))
+ else if (AGGREGATE_TYPE_P (type) && !TYPE_PTRMEMFUNC_P (type))
{
/* This is a default initialization of an aggregate, but not one of
non-POD class type. We cleverly notice that the initialization
@@ -696,10 +696,7 @@ sort_base_init (t, base_init_list, rbase_ptr, vbase_ptr)
If there is a need for a call to a constructor, we must surround
that call with a pushlevel/poplevel pair, since we are technically
- at the PARM level of scope.
-
- Note that emit_base_init does *not* initialize virtual base
- classes. That is done specially, elsewhere. */
+ at the PARM level of scope. */
void
emit_base_init (mem_init_list, base_init_list)
@@ -863,7 +860,7 @@ expand_virtual_init (binfo, decl)
tree vtt_parm;
/* Compute the value to use, when there's a VTT. */
- vtt_parm = DECL_VTT_PARM (current_function_decl);
+ vtt_parm = current_vtt_parm;
vtbl2 = build (PLUS_EXPR,
TREE_TYPE (vtt_parm),
vtt_parm,
@@ -875,7 +872,8 @@ expand_virtual_init (binfo, decl)
the vtt_parm in the case of the non-subobject constructor. */
vtbl = build (COND_EXPR,
TREE_TYPE (vtbl),
- DECL_USE_VTT_PARM (current_function_decl),
+ build (EQ_EXPR, boolean_type_node,
+ current_in_charge_parm, integer_zero_node),
vtbl2,
vtbl);
}
@@ -1954,17 +1952,8 @@ resolve_offset_ref (exp)
addr = convert_pointer_to (basetype, addr);
member = cp_convert (ptrdiff_type_node, member);
- if (!flag_new_abi)
- /* Pointer to data members are offset by one, so that a null
- pointer with a real value of 0 is distinguishable from an
- offset of the first member of a structure. */
- member = cp_build_binary_op (MINUS_EXPR, member,
- cp_convert (ptrdiff_type_node,
- integer_one_node));
-
- return build1 (INDIRECT_REF, type,
- build (PLUS_EXPR, build_pointer_type (type),
- addr, member));
+ addr = build (PLUS_EXPR, build_pointer_type (type), addr, member);
+ return build_indirect_ref (addr, 0);
}
else if (TYPE_PTRMEMFUNC_P (TREE_TYPE (member)))
{
@@ -2224,20 +2213,18 @@ build_java_class_ref (type)
}
/* Mangle the class$ field, new and old ABI */
- if (flag_new_abi)
- {
- tree field;
- for (field = TYPE_FIELDS (type); field; field = TREE_CHAIN (field))
- if (DECL_NAME (field) == CL_suffix)
- {
- name = mangle_decl (field);
- break;
- }
- if (!field)
- internal_error ("Can't find class$");
+ {
+ tree field;
+ for (field = TYPE_FIELDS (type); field; field = TREE_CHAIN (field))
+ if (DECL_NAME (field) == CL_suffix)
+ {
+ mangle_decl (field);
+ name = DECL_ASSEMBLER_NAME (field);
+ break;
+ }
+ if (!field)
+ internal_error ("Can't find class$");
}
- else
- name = build_static_name (type, CL_suffix);
class_decl = IDENTIFIER_GLOBAL_VALUE (name);
if (class_decl == NULL_TREE)
@@ -2264,27 +2251,17 @@ get_cookie_size (type)
{
tree cookie_size;
- if (flag_new_abi)
- {
- /* Under the new ABI, we need to allocate an additional max
- (sizeof (size_t), alignof (true_type)) bytes. */
- tree sizetype_size;
- tree type_align;
-
- sizetype_size = size_in_bytes (sizetype);
- type_align = size_int (TYPE_ALIGN_UNIT (type));
- if (INT_CST_LT_UNSIGNED (type_align, sizetype_size))
- cookie_size = sizetype_size;
- else
- cookie_size = type_align;
- }
+ /* Under the new ABI, we need to allocate an additional max
+ (sizeof (size_t), alignof (true_type)) bytes. */
+ tree sizetype_size;
+ tree type_align;
+
+ sizetype_size = size_in_bytes (sizetype);
+ type_align = size_int (TYPE_ALIGN_UNIT (type));
+ if (INT_CST_LT_UNSIGNED (type_align, sizetype_size))
+ cookie_size = sizetype_size;
else
- {
- if (TYPE_ALIGN (type) > TYPE_ALIGN (BI_header_type))
- return size_int (TYPE_ALIGN_UNIT (type));
- else
- return size_in_bytes (BI_header_type);
- }
+ cookie_size = type_align;
return cookie_size;
}
@@ -2315,6 +2292,9 @@ build_new_1 (exp)
beginning of the storage allocated for an array-new expression in
order to store the number of elements. */
tree cookie_size = NULL_TREE;
+ /* True if the function we are calling is a placement allocation
+ function. */
+ bool placement_allocation_fn_p;
placement = TREE_OPERAND (exp, 0);
type = TREE_OPERAND (exp, 1);
@@ -2386,7 +2366,7 @@ build_new_1 (exp)
else if (placement && !TREE_CHAIN (placement)
&& same_type_p (TREE_TYPE (TREE_VALUE (placement)),
ptr_type_node))
- use_cookie = (!flag_new_abi || !use_global_new);
+ use_cookie = !use_global_new;
/* Otherwise, we need the cookie. */
else
use_cookie = 1;
@@ -2440,8 +2420,25 @@ build_new_1 (exp)
if (alloc_call == error_mark_node)
return error_mark_node;
- if (alloc_call == NULL_TREE)
- abort ();
+ /* The ALLOC_CALL should be a CALL_EXPR, and the first operand
+ should be the address of a known FUNCTION_DECL. */
+ my_friendly_assert (TREE_CODE (alloc_call) == CALL_EXPR, 20000521);
+ t = TREE_OPERAND (alloc_call, 0);
+ my_friendly_assert (TREE_CODE (t) == ADDR_EXPR, 20000521);
+ t = TREE_OPERAND (t, 0);
+ my_friendly_assert (TREE_CODE (t) == FUNCTION_DECL, 20000521);
+ /* Now, check to see if this function is actually a placement
+ allocation function. This can happen even when PLACEMENT is NULL
+ because we might have something like:
+
+ struct S { void* operator new (size_t, int i = 0); };
+
+ A call to `new S' will get this allocation function, even though
+ there is no explicit placement argument. If there is more than
+ one argument, or there are variable arguments, then this is a
+ placement allocation function. */
+ placement_allocation_fn_p
+ = (type_num_arguments (TREE_TYPE (t)) > 1 || varargs_function_p (t));
/* unless an allocation function is declared with an empty excep-
tion-specification (_except.spec_), throw(), it indicates failure to
@@ -2481,23 +2478,13 @@ build_new_1 (exp)
tree cookie;
/* Store the number of bytes allocated so that we can know how
- many elements to destroy later. */
- if (flag_new_abi)
- {
- /* Under the new ABI, we use the last sizeof (size_t) bytes
- to store the number of elements. */
- cookie = build (MINUS_EXPR, build_pointer_type (sizetype),
- alloc_node, size_in_bytes (sizetype));
- cookie = build_indirect_ref (cookie, NULL_PTR);
- }
- else
- {
- cookie = build (MINUS_EXPR, build_pointer_type (BI_header_type),
- alloc_node, cookie_size);
- cookie = build_indirect_ref (cookie, NULL_PTR);
- cookie = build_component_ref (cookie, nelts_identifier,
- NULL_TREE, 0);
- }
+ many elements to destroy later. Under the new ABI, we use
+ the last sizeof (size_t) bytes to store the number of
+ elements. */
+ cookie = build (MINUS_EXPR, build_pointer_type (sizetype),
+ alloc_node, size_in_bytes (sizetype));
+ cookie = build_indirect_ref (cookie, NULL_PTR);
+
cookie_expr = build (MODIFY_EXPR, void_type_node, cookie, nelts);
TREE_SIDE_EFFECTS (cookie_expr) = 1;
}
@@ -2568,7 +2555,8 @@ build_new_1 (exp)
flags |= LOOKUP_SPECULATIVELY;
cleanup = build_op_delete_call (dcode, alloc_node, size, flags,
- alloc_call);
+ (placement_allocation_fn_p
+ ? alloc_call : NULL_TREE));
/* Ack! First we allocate the memory. Then we set our sentry
variable to true, and expand a cleanup that deletes the memory
@@ -2812,7 +2800,7 @@ get_temp_regvar (type, init)
if (building_stmt_tree ())
add_decl_stmt (decl);
if (!building_stmt_tree ())
- DECL_RTL (decl) = assign_temp (type, 2, 0, 1);
+ SET_DECL_RTL (decl, assign_temp (type, 2, 0, 1));
finish_expr_stmt (build_modify_expr (decl, INIT_EXPR, init));
return decl;
@@ -3187,7 +3175,6 @@ build_delete (type, addr, auto_delete, flags, use_global_delete)
{
tree member;
tree expr;
- tree ref;
if (addr == error_mark_node)
return error_mark_node;
@@ -3216,7 +3203,6 @@ build_delete (type, addr, auto_delete, flags, use_global_delete)
/* throw away const and volatile on target type of addr */
addr = convert_force (build_pointer_type (type), addr, 0);
- ref = build_indirect_ref (addr, NULL_PTR);
}
else if (TREE_CODE (type) == ARRAY_TYPE)
{
@@ -3241,8 +3227,6 @@ build_delete (type, addr, auto_delete, flags, use_global_delete)
addr = save_expr (addr);
addr = convert_force (build_pointer_type (type), addr, 0);
-
- ref = build_indirect_ref (addr, NULL_PTR);
}
my_friendly_assert (IS_AGGR_TYPE (type), 220);
@@ -3266,16 +3250,39 @@ build_delete (type, addr, auto_delete, flags, use_global_delete)
tree do_delete = NULL_TREE;
tree ifexp;
+ /* For `::delete x', we must not use the deleting destructor
+ since then we would not be sure to get the global `operator
+ delete'. */
if (use_global_delete && auto_delete == sfk_deleting_destructor)
{
+ /* We will use ADDR multiple times so we must save it. */
+ addr = save_expr (addr);
/* Delete the object. */
do_delete = build_builtin_delete_call (addr);
/* Otherwise, treat this like a complete object destructor
call. */
auto_delete = sfk_complete_destructor;
}
+ /* If the destructor is non-virtual, there is no deleting
+ variant. Instead, we must explicitly call the appropriate
+ `operator delete' here. */
+ else if (!DECL_VIRTUAL_P (CLASSTYPE_DESTRUCTORS (type))
+ && auto_delete == sfk_deleting_destructor)
+ {
+ /* We will use ADDR multiple times so we must save it. */
+ addr = save_expr (addr);
+ /* Build the call. */
+ do_delete = build_op_delete_call (DELETE_EXPR,
+ addr,
+ c_sizeof_nowarn (type),
+ LOOKUP_NORMAL,
+ NULL_TREE);
+ /* Call the complete object destructor. */
+ auto_delete = sfk_complete_destructor;
+ }
- expr = build_dtor_call (ref, auto_delete, flags);
+ expr = build_dtor_call (build_indirect_ref (addr, NULL_PTR),
+ auto_delete, flags);
if (do_delete)
expr = build (COMPOUND_EXPR, void_type_node, expr, do_delete);
@@ -3299,6 +3306,7 @@ build_delete (type, addr, auto_delete, flags, use_global_delete)
int i, n_baseclasses = CLASSTYPE_N_BASECLASSES (type);
tree base_binfo = n_baseclasses > 0 ? TREE_VEC_ELT (binfos, 0) : NULL_TREE;
tree exprstmt = NULL_TREE;
+ tree ref = build_indirect_ref (addr, NULL_PTR);
/* Set this again before we call anything, as we might get called
recursively. */
@@ -3412,24 +3420,11 @@ build_vec_delete (base, maxindex, auto_delete_vec, use_global_delete)
tree cookie_addr;
type = strip_array_types (TREE_TYPE (type));
- if (flag_new_abi)
- {
- cookie_addr = build (MINUS_EXPR,
- build_pointer_type (sizetype),
- base,
- TYPE_SIZE_UNIT (sizetype));
- maxindex = build_indirect_ref (cookie_addr, NULL_PTR);
- }
- else
- {
- tree cookie;
-
- cookie_addr = build (MINUS_EXPR, build_pointer_type (BI_header_type),
- base, get_cookie_size (type));
- cookie = build_indirect_ref (cookie_addr, NULL_PTR);
- maxindex = build_component_ref (cookie, nelts_identifier,
- NULL_TREE, 0);
- }
+ cookie_addr = build (MINUS_EXPR,
+ build_pointer_type (sizetype),
+ base,
+ TYPE_SIZE_UNIT (sizetype));
+ maxindex = build_indirect_ref (cookie_addr, NULL_PTR);
}
else if (TREE_CODE (type) == ARRAY_TYPE)
{
diff --git a/gcc/cp/lang-options.h b/gcc/cp/lang-options.h
index 64fdf2a32e5..5a3f94a4d40 100644
--- a/gcc/cp/lang-options.h
+++ b/gcc/cp/lang-options.h
@@ -25,116 +25,135 @@ DEFINE_LANG_NAME ("C++")
toplev.c for g++. */
{ "-faccess-control", "" },
- { "-fno-access-control", "Do not obey access control semantics" },
- { "-fall-virtual", "" },
- { "-fno-all-virtual", "" },
- { "-falt-external-templates", "Change when template instances are emitted" },
+ { "-fno-access-control",
+ N_("Do not obey access control semantics") },
+ { "-falt-external-templates",
+ N_("Change when template instances are emitted") },
{ "-fno-alt-external-templates", "" },
{ "-fansi-overloading", "" },
{ "-fno-ansi-overloading", "" },
- { "-fcheck-new", "Check the return value of new" },
+ { "-fcheck-new",
+ N_("Check the return value of new") },
{ "-fno-check-new", "" },
- { "-fconserve-space", "Reduce size of object files" },
+ { "-fconserve-space",
+ N_("Reduce size of object files") },
{ "-fno-conserve-space", "" },
{ "-fconst-strings", "" },
- { "-fno-const-strings", "Make string literals `char[]' instead of `const char[]'" },
+ { "-fno-const-strings",
+ N_("Make string literals `char[]' instead of `const char[]'") },
{ "-fdefault-inline", "" },
- { "-fdump-translation-unit-", "Dump the entire translation unit to a file"},
- { "-fno-default-inline", "Do not inline member functions by default"},
+ { "-fdump-translation-unit-",
+ N_("Dump the entire translation unit to a file") },
+ { "-fno-default-inline",
+ N_("Do not inline member functions by default") },
{ "-frtti", "" },
- { "-fno-rtti", "Do not generate run time type descriptor information" },
+ { "-fno-rtti",
+ N_("Do not generate run time type descriptor information") },
{ "-felide-constructors", "" },
{ "-fno-elide-constructors", "" },
{ "-fenforce-eh-specs", "" },
- { "-fno-enforce-eh-specs", "Do not generate code to check exception specifications" },
- { "-fenum-int-equiv", "" },
- { "-fno-enum-int-equiv", "" },
+ { "-fno-enforce-eh-specs",
+ N_("Do not generate code to check exception specifications") },
{ "-fexternal-templates", "" },
{ "-fno-external-templates", "" },
{ "-ffor-scope", "" },
- { "-fno-for-scope", "Scope of for-init-statement vars extends outside" },
- { "-fguiding-decls", "Implement guiding declarations" },
- { "-fno-guiding-decls", "" },
+ { "-fno-for-scope",
+ N_("Scope of for-init-statement vars extends outside") },
{ "-fgnu-keywords", "" },
- { "-fno-gnu-keywords", "Do not recognise GNU defined keywords" },
+ { "-fno-gnu-keywords",
+ N_("Do not recognise GNU defined keywords") },
{ "-fhandle-exceptions", "" },
{ "-fno-handle-exceptions", "" },
- { "-fhonor-std", "Treat the namespace `std' as a normal namespace" },
- { "-fno-honor-std", "" },
- { "-fhuge-objects", "Enable support for huge objects" },
+ { "-fhuge-objects",
+ N_("Enable support for huge objects") },
{ "-fno-huge-objects", "" },
{ "-fimplement-inlines", "" },
- { "-fno-implement-inlines", "Export functions even if they can be inlined" },
+ { "-fno-implement-inlines",
+ N_("Export functions even if they can be inlined") },
{ "-fimplicit-templates", "" },
- { "-fno-implicit-templates", "Only emit explicit template instatiations" },
+ { "-fno-implicit-templates",
+ N_("Only emit explicit template instatiations") },
{ "-fimplicit-inline-templates", "" },
- { "-fno-implicit-inline-templates", "Only emit explicit instatiations of inline templates" },
+ { "-fno-implicit-inline-templates",
+ N_("Only emit explicit instatiations of inline templates") },
{ "-finit-priority", "" },
{ "-fno-init-priority", "" },
- { "-flabels-ok", "Labels can be used as first class objects" },
- { "-fno-labels-ok", "" },
{ "-fmemoize-lookups", "" },
{ "-fno-memoize-lookups", "" },
- { "-fms-extensions", "Don't pedwarn about uses of Microsoft extensions" },
+ { "-fms-extensions",
+ N_("Don't pedwarn about uses of Microsoft extensions") },
{ "-fno-ms-extensions", "" },
- { "-fname-mangling-version-", "" },
- { "-fnew-abi", "Enable experimental ABI changes" },
- { "-fno-new-abi", "" },
- { "-fnonnull-objects", "" },
- { "-fno-nonnull-objects", "" },
- { "-foperator-names", "Recognise and/bitand/bitor/compl/not/or/xor" },
+ { "-foperator-names",
+ N_("Recognise and/bitand/bitor/compl/not/or/xor") },
{ "-fno-operator-names", "" },
{ "-foptional-diags", "" },
- { "-fno-optional-diags", "Disable optional diagnostics" },
- { "-fpermissive", "Downgrade conformance errors to warnings" },
+ { "-fno-optional-diags",
+ N_("Disable optional diagnostics") },
+ { "-fpermissive",
+ N_("Downgrade conformance errors to warnings") },
{ "-fno-permissive", "" },
- { "-frepo", "Enable automatic template instantiation" },
+ { "-frepo",
+ N_("Enable automatic template instantiation") },
{ "-fno-repo", "" },
{ "-fsave-memoized", "" },
{ "-fno-save-memoized", "" },
- { "-fsquangle", "Enable squashed name mangling" },
- { "-fno-squangle", "" },
- { "-fstats", "Display statistics accumulated during compilation" },
+ { "-fstats",
+ N_("Display statistics accumulated during compilation") },
{ "-fno-stats", "" },
- { "-fstrict-prototype", "" },
- { "-fno-strict-prototype", "Do not assume that empty prototype means no args" },
- { "-ftemplate-depth-", "Specify maximum template instantiation depth"},
- { "-fthis-is-variable", "" },
- { "-fno-this-is-variable", "" },
- { "-fuse-cxa-atexit", "Use __cxa_atexit to register destructors." },
+ { "-ftemplate-depth-",
+ N_("Specify maximum template instantiation depth") },
+ { "-fuse-cxa-atexit",
+ N_("Use __cxa_atexit to register destructors.") },
{ "-fno-use-cxa-atexit", "" },
- { "-fvtable-gc", "Discard unused virtual functions" },
+ { "-fvtable-gc",
+ N_("Discard unused virtual functions") },
{ "-fno-vtable-gc", "" },
- { "-fvtable-thunks", "Implement vtables using thunks" },
+ { "-fvtable-thunks",
+ N_("Implement vtables using thunks") },
{ "-fno-vtable-thunks", "" },
- { "-fweak", "Emit common-like symbols as weak symbols" },
+ { "-fweak",
+ N_("Emit common-like symbols as weak symbols") },
{ "-fno-weak", "" },
- { "-fxref", "Emit cross referencing information" },
+ { "-fxref",
+ N_("Emit cross referencing information") },
{ "-fno-xref", "" },
- { "-Wreturn-type", "Warn about inconsistent return types" },
+ { "-Wreturn-type",
+ N_("Warn about inconsistent return types") },
{ "-Wno-return-type", "" },
- { "-Woverloaded-virtual", "Warn about overloaded virtual function names" },
+ { "-Woverloaded-virtual",
+ N_("Warn about overloaded virtual function names") },
{ "-Wno-overloaded-virtual", "" },
{ "-Wctor-dtor-privacy", "" },
- { "-Wno-ctor-dtor-privacy", "Don't warn when all ctors/dtors are private" },
- { "-Wnon-virtual-dtor", "Warn about non virtual destructors" },
+ { "-Wno-ctor-dtor-privacy",
+ N_("Don't warn when all ctors/dtors are private") },
+ { "-Wnon-virtual-dtor",
+ N_("Warn about non virtual destructors") },
{ "-Wno-non-virtual-dtor", "" },
- { "-Wextern-inline", "Warn when a function is declared extern, then inline" },
+ { "-Wextern-inline",
+ N_("Warn when a function is declared extern, then inline") },
{ "-Wno-extern-inline", "" },
- { "-Wreorder", "Warn when the compiler reorders code" },
+ { "-Wreorder",
+ N_("Warn when the compiler reorders code") },
{ "-Wno-reorder", "" },
- { "-Wsynth", "Warn when synthesis behaviour differs from Cfront" },
+ { "-Wsynth",
+ N_("Warn when synthesis behaviour differs from Cfront") },
{ "-Wno-synth", "" },
{ "-Wpmf-conversions", "" },
- { "-Wno-pmf-conversions", "Don't warn when type converting pointers to member functions" },
- { "-Weffc++", "Warn about violations of Effective C++ style rules" },
+ { "-Wno-pmf-conversions",
+ N_("Don't warn when type converting pointers to member functions") },
+ { "-Weffc++",
+ N_("Warn about violations of Effective C++ style rules") },
{ "-Wno-effc++", "" },
- { "-Wsign-promo", "Warn when overload promotes from unsigned to signed" },
+ { "-Wsign-promo",
+ N_("Warn when overload promotes from unsigned to signed") },
{ "-Wno-sign-promo", "" },
- { "-Wold-style-cast", "Warn if a C style cast is used in a program" },
+ { "-Wold-style-cast",
+ N_("Warn if a C style cast is used in a program") },
{ "-Wno-old-style-cast", "" },
{ "-Wnon-template-friend", "" },
- { "-Wno-non-template-friend", "Don't warn when non-templatized friend functions are declared within a template" },
+ { "-Wno-non-template-friend",
+ N_("Don't warn when non-templatized friend functions are declared within a template") },
{ "-Wdeprecated", "" },
- { "-Wno-deprecated", "Don't announce deprecation of compiler features" },
+ { "-Wno-deprecated",
+ N_("Don't announce deprecation of compiler features") },
diff --git a/gcc/cp/lang-specs.h b/gcc/cp/lang-specs.h
index 54ed9684425..c8488f26426 100644
--- a/gcc/cp/lang-specs.h
+++ b/gcc/cp/lang-specs.h
@@ -1,5 +1,5 @@
/* Definitions for specs for C++.
- Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000
+ Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001
Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -22,39 +22,45 @@ Boston, MA 02111-1307, USA. */
/* This is the contribution to the `default_compilers' array in gcc.c for
g++. */
- {".cc", "@c++"},
- {".cp", "@c++"},
- {".cxx", "@c++"},
- {".cpp", "@c++"},
- {".c++", "@c++"},
- {".C", "@c++"},
+#ifndef CPLUSPLUS_CPP_SPEC
+#define CPLUSPLUS_CPP_SPEC 0
+#endif
+
+ {".cc", "@c++", 0},
+ {".cp", "@c++", 0},
+ {".cxx", "@c++", 0},
+ {".cpp", "@c++", 0},
+ {".c++", "@c++", 0},
+ {".C", "@c++", 0},
{"@c++",
/* cc1plus has an integrated ISO C preprocessor. We should invoke
the external preprocessor if -save-temps is given. */
- "%{E|M|MM:cpp0 -lang-c++ -D_GNU_SOURCE %{!no-gcc:-D__GNUG__=%v1}\
+ "%{E|M|MM:cpp0 -lang-c++ %{!no-gcc:-D__GNUG__=%v1}\
+ %{!Wno-deprecated:-D__GXX_DEPRECATED}\
%{!fno-exceptions:-D__EXCEPTIONS}\
%{!fno-new-abi:-D__GXX_ABI_VERSION=100}\
%{ansi:-D__STRICT_ANSI__ -trigraphs -$} %(cpp_options)}\
%{!E:%{!M:%{!MM:\
- %{save-temps:cpp0 -lang-c++ -D_GNU_SOURCE \
+ %{save-temps:cpp0 -lang-c++ \
%{!no-gcc:-D__GNUG__=%v1}\
+ %{!Wno-deprecated:-D__GXX_DEPRECATED}\
+ %{!fno-exceptions:-D__EXCEPTIONS}\
%{!fno-new-abi:-D__GXX_ABI_VERSION=100}\
%{ansi:-D__STRICT_ANSI__ -trigraphs -$}\
%(cpp_options) %b.ii \n}\
cc1plus %{save-temps:-fpreprocessed %b.ii}\
%{!save-temps:%(cpp_options)\
- %{!no-gcc:-D__GNUG__=%v1} -D_GNU_SOURCE \
+ %{!no-gcc:-D__GNUG__=%v1} \
+ %{!Wno-deprecated:-D__GXX_DEPRECATED}\
+ %{!fno-exceptions:-D__EXCEPTIONS}\
%{!fno-new-abi:-D__GXX_ABI_VERSION=100}\
%{ansi:-D__STRICT_ANSI__}}\
%{ansi:-trigraphs -$}\
%(cc1_options) %2 %{+e1*}\
- %{!fsyntax-only:%(invoke_as)}}}}"
-#ifdef CPLUSPLUS_CPP_SPEC
- , CPLUSPLUS_CPP_SPEC
-#endif
- },
- {".ii", "@c++-cpp-output"},
+ %{!fsyntax-only:%(invoke_as)}}}}",
+ CPLUSPLUS_CPP_SPEC},
+ {".ii", "@c++-cpp-output", 0},
{"@c++-cpp-output",
"%{!M:%{!MM:%{!E:\
cc1plus -fpreprocessed %i %(cc1_options) %2 %{+e*}\
- %{!fsyntax-only:%(invoke_as)}}}}"},
+ %{!fsyntax-only:%(invoke_as)}}}}", 0},
diff --git a/gcc/cp/lex.c b/gcc/cp/lex.c
index 58ab5d3aed4..e2b18b4be36 100644
--- a/gcc/cp/lex.c
+++ b/gcc/cp/lex.c
@@ -61,6 +61,7 @@ static void handle_pragma_vtable PARAMS ((cpp_reader *));
static void handle_pragma_unit PARAMS ((cpp_reader *));
static void handle_pragma_interface PARAMS ((cpp_reader *));
static void handle_pragma_implementation PARAMS ((cpp_reader *));
+static void handle_pragma_java_exceptions PARAMS ((cpp_reader *));
static void cxx_init PARAMS ((void));
static void cxx_finish PARAMS ((void));
static void cxx_init_options PARAMS ((void));
@@ -84,10 +85,6 @@ static void init_operators PARAMS ((void));
#include "cpplib.h"
-/* Pending language change.
- Positive is push count, negative is pop count. */
-int pending_lang_change = 0;
-
extern int yychar; /* the lookahead symbol */
extern YYSTYPE yylval; /* the semantic value of the */
/* lookahead symbol */
@@ -317,7 +314,7 @@ operator_name_info_t assignment_operator_name_info[(int) LAST_CPLUS_TREE_CODE];
/* Initialize data structures that keep track of operator names. */
-#define DEF_OPERATOR(NAME, C, NM, OM, AR, AP) \
+#define DEF_OPERATOR(NAME, C, M, AR, AP) \
CONSTRAINT (C, sizeof "operator " + sizeof NAME <= 256);
#include "operators.def"
#undef DEF_OPERATOR
@@ -329,7 +326,7 @@ init_operators ()
char buffer[256];
struct operator_name_info_t *oni;
-#define DEF_OPERATOR(NAME, CODE, NEW_MANGLING, OLD_MANGLING, ARITY, ASSN_P) \
+#define DEF_OPERATOR(NAME, CODE, MANGLING, ARITY, ASSN_P) \
sprintf (buffer, ISALPHA (NAME[0]) ? "operator %s" : "operator%s", NAME); \
identifier = get_identifier (buffer); \
IDENTIFIER_OPNAME_P (identifier) = 1; \
@@ -339,7 +336,7 @@ init_operators ()
: &operator_name_info[(int) CODE]); \
oni->identifier = identifier; \
oni->name = NAME; \
- oni->mangled_name = flag_new_abi ? NEW_MANGLING : OLD_MANGLING;
+ oni->mangled_name = MANGLING;
#include "operators.def"
#undef DEF_OPERATOR
@@ -684,6 +681,8 @@ init_cp_pragma ()
cpp_register_pragma (parse_in, "GCC", "interface", handle_pragma_interface);
cpp_register_pragma (parse_in, "GCC", "implementation",
handle_pragma_implementation);
+ cpp_register_pragma (parse_in, "GCC", "java_exceptions",
+ handle_pragma_java_exceptions);
}
const char *
@@ -1015,7 +1014,7 @@ check_for_missing_semicolon (type)
&& yychar != SELFNAME)
|| yychar == 0 /* EOF */)
{
- if (ANON_AGGRNAME_P (TYPE_IDENTIFIER (type)))
+ if (TYPE_ANONYMOUS_P (type))
error ("semicolon missing after %s declaration",
TREE_CODE (type) == ENUMERAL_TYPE ? "enum" : "struct");
else
@@ -1182,6 +1181,18 @@ handle_pragma_implementation (dfile)
}
}
+/* Indicate that this file uses Java-personality exception handling. */
+static void
+handle_pragma_java_exceptions (dfile)
+ cpp_reader *dfile ATTRIBUTE_UNUSED;
+{
+ tree x;
+ if (c_lex (&x) != CPP_EOF)
+ warning ("junk at end of #pragma GCC java_exceptions");
+
+ choose_personality_routine (lang_java);
+}
+
void
do_pending_lang_change ()
{
@@ -1517,11 +1528,11 @@ retrofit_lang_decl (t)
DECL_LANG_SPECIFIC (t) = ld;
if (current_lang_name == lang_name_cplusplus)
- DECL_LANGUAGE (t) = lang_cplusplus;
+ SET_DECL_LANGUAGE (t, lang_cplusplus);
else if (current_lang_name == lang_name_c)
- DECL_LANGUAGE (t) = lang_c;
+ SET_DECL_LANGUAGE (t, lang_c);
else if (current_lang_name == lang_name_java)
- DECL_LANGUAGE (t) = lang_java;
+ SET_DECL_LANGUAGE (t, lang_java);
else my_friendly_abort (64);
#ifdef GATHER_STATISTICS
diff --git a/gcc/cp/mangle.c b/gcc/cp/mangle.c
index 10f0bc89828..3f99dec2cf5 100644
--- a/gcc/cp/mangle.c
+++ b/gcc/cp/mangle.c
@@ -153,6 +153,7 @@ static void write_prefix PARAMS ((tree));
static void write_template_prefix PARAMS ((tree));
static void write_unqualified_name PARAMS ((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));
@@ -163,8 +164,8 @@ 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));
-static void write_method_parms PARAMS ((tree, int));
+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));
@@ -198,6 +199,10 @@ static void write_java_integer_type_codes PARAMS ((tree));
#define write_char(CHAR) \
obstack_1grow (&G.name_obstack, (CHAR))
+/* Append a sized buffer to the end of the mangled representation. */
+#define write_chars(CHAR, LEN) \
+ obstack_grow (&G.name_obstack, (CHAR), (LEN))
+
/* Append a NUL-terminated string to the end of the mangled
representation. */
#define write_string(STRING) \
@@ -653,7 +658,8 @@ write_encoding (decl)
(!DECL_CONSTRUCTOR_P (decl)
&& !DECL_DESTRUCTOR_P (decl)
&& !DECL_CONV_FN_P (decl)
- && decl_is_template_id (decl, NULL)));
+ && decl_is_template_id (decl, NULL)),
+ decl);
}
}
@@ -1012,6 +1018,38 @@ write_source_name (identifier)
write_identifier (IDENTIFIER_POINTER (identifier));
}
+/* Convert NUMBER to ascii using base BASE and generating at least
+ MIN_DIGITS characters. BUFFER points to the _end_ of the buffer
+ into which to store the characters. Returns the number of
+ characters generated (these will be layed out in advance of where
+ 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;
+{
+ static const char base_digits[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
+ unsigned digits = 0;
+
+ while (number)
+ {
+ unsigned HOST_WIDE_INT d = number / base;
+
+ *--buffer = base_digits[number - d * base];
+ digits++;
+ number = d;
+ }
+ while (digits < min_digits)
+ {
+ *--buffer = base_digits[0];
+ digits++;
+ }
+ return digits;
+}
+
/* Non-terminal <number>.
<number> ::= [n] </decimal integer/> */
@@ -1022,50 +1060,91 @@ write_number (number, unsigned_p, base)
int unsigned_p;
unsigned int base;
{
- static const char digits[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
- unsigned HOST_WIDE_INT n;
- unsigned HOST_WIDE_INT m = 1;
+ char buffer[sizeof (HOST_WIDE_INT) * 8];
+ unsigned count = 0;
if (!unsigned_p && (HOST_WIDE_INT) number < 0)
{
write_char ('n');
number = -((HOST_WIDE_INT) number);
}
-
- /* Figure out how many digits there are. */
- n = number;
- while (n >= base)
- {
- n /= base;
- m *= base;
- }
-
- /* Write them out. */
- while (m > 0)
- {
- int digit = number / m;
- write_char (digits[digit]);
- number -= digit * m;
- m /= base;
- }
-
- my_friendly_assert (number == 0, 20000407);
+ count = hwint_to_ascii (number, base, buffer + sizeof (buffer), 1);
+ write_chars (buffer + sizeof (buffer) - count, count);
}
-/* Write out an integeral CST in decimal. */
+/* Write out an integral CST in decimal. Most numbers are small, and
+ representable in a HOST_WIDE_INT. Occasionally we'll have numbers
+ bigger than that, which we must deal with. */
static inline void
write_integer_cst (cst)
tree cst;
{
- if (tree_int_cst_sgn (cst) >= 0)
+ int sign = tree_int_cst_sgn (cst);
+
+ if (TREE_INT_CST_HIGH (cst) + (sign < 0))
{
- if (TREE_INT_CST_HIGH (cst) != 0)
- sorry ("mangling very large integers");
- write_unsigned_number (TREE_INT_CST_LOW (cst));
+ /* A bignum. We do this in chunks, each of which fits in a
+ HOST_WIDE_INT. */
+ char buffer[sizeof (HOST_WIDE_INT) * 8 * 2];
+ unsigned HOST_WIDE_INT chunk;
+ unsigned chunk_digits;
+ char *ptr = buffer + sizeof (buffer);
+ unsigned count = 0;
+ tree n, base, type;
+ int done;
+
+ /* HOST_WIDE_INT must be at least 32 bits, so 10^9 is
+ representable. */
+ chunk = 1000000000;
+ chunk_digits = 9;
+
+ if (sizeof (HOST_WIDE_INT) >= 8)
+ {
+ /* It is at least 64 bits, so 10^18 is representable. */
+ chunk_digits = 18;
+ chunk *= chunk;
+ }
+
+ type = signed_or_unsigned_type (1, TREE_TYPE (cst));
+ base = build_int_2 (chunk, 0);
+ n = build_int_2 (TREE_INT_CST_LOW (cst), TREE_INT_CST_HIGH (cst));
+ TREE_TYPE (n) = TREE_TYPE (base) = type;
+
+ if (sign < 0)
+ {
+ write_char ('n');
+ n = fold (build1 (NEGATE_EXPR, type, n));
+ }
+ do
+ {
+ 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,
+ done ? 1 : chunk_digits);
+ ptr -= c;
+ count += c;
+ n = d;
+ }
+ while (!done);
+ write_chars (ptr, count);
+ }
+ else
+ {
+ /* A small num. */
+ unsigned HOST_WIDE_INT low = TREE_INT_CST_LOW (cst);
+
+ if (sign < 0)
+ {
+ write_char ('n');
+ low = -low;
+ }
+ write_unsigned_number (low);
}
- else
- write_signed_number (tree_low_cst (cst, 0));
}
/* Non-terminal <identifier>.
@@ -1153,16 +1232,17 @@ discriminator_for_local_entity (entity)
/* Assume this is the only local entity with this name. */
discriminator = 0;
- /* For now, we don't discriminate amongst local variables. */
- if (TREE_CODE (entity) != TYPE_DECL)
- return 0;
-
- /* Scan the list of local classes. */
- entity = TREE_TYPE (entity);
- for (type = &VARRAY_TREE (local_classes, 0); *type != entity; ++type)
- if (TYPE_IDENTIFIER (*type) == TYPE_IDENTIFIER (entity)
- && TYPE_CONTEXT (*type) == TYPE_CONTEXT (entity))
- ++discriminator;
+ if (DECL_DISCRIMINATOR_P (entity) && DECL_LANG_SPECIFIC (entity))
+ discriminator = DECL_DISCRIMINATOR (entity);
+ else if (TREE_CODE (entity) == TYPE_DECL)
+ {
+ /* Scan the list of local classes. */
+ entity = TREE_TYPE (entity);
+ for (type = &VARRAY_TREE (local_classes, 0); *type != entity; ++type)
+ if (TYPE_IDENTIFIER (*type) == TYPE_IDENTIFIER (entity)
+ && TYPE_CONTEXT (*type) == TYPE_CONTEXT (entity))
+ ++discriminator;
+ }
return discriminator;
}
@@ -1194,10 +1274,7 @@ write_discriminator (discriminator)
if (discriminator > 0)
{
write_char ('_');
- /* The number is omitted for discriminator == 1. Beyond 1, the
- numbering starts at 0. */
- if (discriminator > 1)
- write_unsigned_number (discriminator - 2);
+ write_unsigned_number (discriminator - 1);
}
}
@@ -1530,20 +1607,23 @@ write_function_type (type)
extern "C" function_t f; // Vice versa.
See [dcl.link]. */
- write_bare_function_type (type, /*include_return_type_p=*/1);
+ write_bare_function_type (type, /*include_return_type_p=*/1,
+ /*decl=*/NULL);
write_char ('E');
}
-/* Non-terminal <bare-function-type>. NODE is a FUNCTION_DECL or a
+/* Non-terminal <bare-function-type>. TYPE is a FUNCTION_TYPE or
METHOD_TYPE. If INCLUDE_RETURN_TYPE is non-zero, the return value
- is mangled before the parameter types.
+ is mangled before the parameter types. If non-NULL, DECL is
+ FUNCTION_DECL for the function whose type is being emitted.
<bare-function-type> ::= </signature/ type>+ */
static void
-write_bare_function_type (type, include_return_type_p)
+write_bare_function_type (type, include_return_type_p, decl)
tree type;
int include_return_type_p;
+ tree decl;
{
MANGLE_TRACE_TREE ("bare-function-type", type);
@@ -1553,19 +1633,25 @@ write_bare_function_type (type, include_return_type_p)
/* Now mangle the types of the arguments. */
write_method_parms (TYPE_ARG_TYPES (type),
- TREE_CODE (type) == METHOD_TYPE);
+ TREE_CODE (type) == METHOD_TYPE,
+ decl);
}
/* Write the mangled representation of a method parameter list of
- types given in PARM_LIST. If METHOD_P is non-zero, the function is
- considered a non-static method, and the this parameter is omitted. */
+ types given in PARM_TYPES. If METHOD_P is non-zero, the function is
+ considered a non-static method, and the this parameter is omitted.
+ If non-NULL, DECL is the FUNCTION_DECL for the function whose
+ parameters are being emitted. */
static void
-write_method_parms (parm_list, method_p)
- tree parm_list;
+write_method_parms (parm_types, method_p, decl)
+ tree decl;
+ tree parm_types;
int method_p;
{
- tree first_parm;
+ tree first_parm_type;
+ tree parm_decl = decl ? DECL_ARGUMENTS (decl) : NULL_TREE;
+
/* Assume this parameter type list is variable-length. If it ends
with a void type, then it's not. */
int varargs_p = 1;
@@ -1573,28 +1659,39 @@ write_method_parms (parm_list, method_p)
/* If this is a member function, skip the first arg, which is the
this pointer.
"Member functions do not encode the type of their implicit this
- parameter." */
+ parameter."
+
+ Similarly, there's no need to mangle artificial parameters, like
+ the VTT parameters for constructors and destructors. */
if (method_p)
- parm_list = TREE_CHAIN (parm_list);
-
- for (first_parm = parm_list;
- parm_list;
- parm_list = TREE_CHAIN (parm_list))
{
- tree parm = TREE_VALUE (parm_list);
+ parm_types = TREE_CHAIN (parm_types);
+ parm_decl = parm_decl ? TREE_CHAIN (parm_decl) : NULL_TREE;
+
+ while (parm_decl && DECL_ARTIFICIAL (parm_decl))
+ {
+ parm_types = TREE_CHAIN (parm_types);
+ parm_decl = TREE_CHAIN (parm_decl);
+ }
+ }
+ for (first_parm_type = parm_types;
+ parm_types;
+ parm_types = TREE_CHAIN (parm_types))
+ {
+ tree parm = TREE_VALUE (parm_types);
if (parm == void_type_node)
{
/* "Empty parameter lists, whether declared as () or
conventionally as (void), are encoded with a void parameter
(v)." */
- if (parm_list == first_parm)
+ if (parm_types == first_parm_type)
write_type (parm);
/* If the parm list is terminated with a void type, it's
fixed-length. */
varargs_p = 0;
/* A void type better be the last one. */
- my_friendly_assert (TREE_CHAIN (parm_list) == NULL, 20000523);
+ my_friendly_assert (TREE_CHAIN (parm_types) == NULL, 20000523);
}
else
write_type (parm);
@@ -1720,18 +1817,32 @@ write_expression (expr)
/* If it wasn't any of those, recursively expand the expression. */
write_string (operator_name_info[(int) code].mangled_name);
- /* Handle pointers-to-members specially. */
- if (code == SCOPE_REF)
+ switch (code)
{
+ case CAST_EXPR:
+ write_type (TREE_TYPE (expr));
+ write_expression (TREE_VALUE (TREE_OPERAND (expr, 0)));
+ break;
+
+ case STATIC_CAST_EXPR:
+ case CONST_CAST_EXPR:
+ write_type (TREE_TYPE (expr));
+ write_expression (TREE_OPERAND (expr, 0));
+ break;
+
+ /* Handle pointers-to-members specially. */
+ case SCOPE_REF:
write_type (TREE_OPERAND (expr, 0));
if (TREE_CODE (TREE_OPERAND (expr, 1)) == IDENTIFIER_NODE)
write_source_name (TREE_OPERAND (expr, 1));
else
write_encoding (TREE_OPERAND (expr, 1));
+ break;
+
+ default:
+ for (i = 0; i < TREE_CODE_LENGTH (code); ++i)
+ write_expression (TREE_OPERAND (expr, i));
}
- else
- for (i = 0; i < TREE_CODE_LENGTH (code); ++i)
- write_expression (TREE_OPERAND (expr, i));
}
}
@@ -1909,7 +2020,24 @@ write_pointer_to_member_type (type)
tree type;
{
write_char ('M');
- write_type (TYPE_PTRMEM_CLASS_TYPE (type));
+ /* For a pointer-to-function member, the class type may be
+ cv-qualified, bug that won't be reflected in
+ TYPE_PTRMEM_CLASS_TYPE. So, we go fishing around in
+ TYPE_PTRMEM_POINTED_TO_TYPE instead. */
+ if (TYPE_PTRMEMFUNC_P (type))
+ {
+ tree fn_type;
+ tree this_type;
+
+ fn_type = TYPE_PTRMEM_POINTED_TO_TYPE (type);
+ /* The first parameter must be a POINTER_TYPE pointing to the
+ `this' parameter. */
+ this_type = TREE_TYPE (TREE_VALUE (TYPE_ARG_TYPES (fn_type)));
+ write_type (this_type);
+ }
+ /* For a pointer-to-data member, things are simpler. */
+ else
+ write_type (TYPE_PTRMEM_CLASS_TYPE (type));
write_type (TYPE_PTRMEM_POINTED_TO_TYPE (type));
}
@@ -2048,6 +2176,17 @@ mangle_decl_string (decl)
if (TREE_CODE (decl) == TYPE_DECL)
write_type (TREE_TYPE (decl));
+ else if (/* The names of `extern "C"' functions are not mangled. */
+ (DECL_EXTERN_C_FUNCTION_P (decl)
+ /* But overloaded operator names *are* mangled. */
+ && !DECL_OVERLOADED_OPERATOR_P (decl))
+ /* The names of global variables aren't mangled either. */
+ || (TREE_CODE (decl) == VAR_DECL
+ && CP_DECL_CONTEXT (decl) == global_namespace)
+ /* And neither are `extern "C"' variables. */
+ || (TREE_CODE (decl) == VAR_DECL
+ && DECL_EXTERN_C_P (decl)))
+ write_string (IDENTIFIER_POINTER (DECL_NAME (decl)));
else
{
write_mangled_name (decl);
@@ -2068,11 +2207,13 @@ mangle_decl_string (decl)
/* Create an identifier for the external mangled name of DECL. */
-tree
+void
mangle_decl (decl)
tree decl;
{
- return get_identifier (mangle_decl_string (decl));
+ tree id = get_identifier (mangle_decl_string (decl));
+
+ SET_DECL_ASSEMBLER_NAME (decl, id);
}
/* Generate the mangled representation of TYPE. */
diff --git a/gcc/cp/method.c b/gcc/cp/method.c
index 72702b402f1..cef0400d6d0 100644
--- a/gcc/cp/method.c
+++ b/gcc/cp/method.c
@@ -61,1851 +61,38 @@ struct pending_inline *pending_inlines;
#define obstack_chunk_alloc xmalloc
#define obstack_chunk_free free
-/* Obstack where we build text strings for overloading, etc. */
-static struct obstack scratch_obstack;
-static char *scratch_firstobj;
-
-static void icat PARAMS ((HOST_WIDE_INT));
-static void dicat PARAMS ((HOST_WIDE_INT, HOST_WIDE_INT));
-static int old_backref_index PARAMS ((tree));
-static int flush_repeats PARAMS ((int, tree));
-static void build_overload_identifier PARAMS ((tree));
-static void build_overload_nested_name PARAMS ((tree));
-static void mangle_expression PARAMS ((tree));
-static void build_overload_int PARAMS ((tree, mangling_flags));
-static void build_overload_identifier PARAMS ((tree));
-static void build_qualified_name PARAMS ((tree));
-static void build_overload_value PARAMS ((tree, tree, mangling_flags));
-static void issue_nrepeats PARAMS ((int, tree));
-static char *build_mangled_name PARAMS ((tree,int,int));
-static void process_modifiers PARAMS ((tree));
-static void process_overload_item PARAMS ((tree,int));
static void do_build_assign_ref PARAMS ((tree));
static void do_build_copy_constructor PARAMS ((tree));
-static void build_template_template_parm_names PARAMS ((tree));
-static void build_template_parm_names PARAMS ((tree, tree));
-static void build_underscore_int PARAMS ((int));
-static void start_squangling PARAMS ((void));
-static void end_squangling PARAMS ((void));
-static int check_ktype PARAMS ((tree, int));
-static int issue_ktype PARAMS ((tree));
-static void build_overload_scope_ref PARAMS ((tree));
-static void build_mangled_template_parm_index PARAMS ((const char *, tree));
#if HOST_BITS_PER_WIDE_INT >= 64
static void build_mangled_C99_name PARAMS ((int));
#endif
-static int is_back_referenceable_type PARAMS ((tree));
-static int check_btype PARAMS ((tree));
-static void build_mangled_name_for_type PARAMS ((tree));
-static void build_mangled_name_for_type_with_Gcode PARAMS ((tree, int));
static tree synthesize_exception_spec PARAMS ((tree, tree (*) (tree, void *), void *));
static tree locate_dtor PARAMS ((tree, void *));
static tree locate_ctor PARAMS ((tree, void *));
static tree locate_copy PARAMS ((tree, void *));
-# define OB_INIT() (scratch_firstobj ? (obstack_free (&scratch_obstack, scratch_firstobj), 0) : 0)
-# define OB_PUTC(C) (obstack_1grow (&scratch_obstack, (C)))
-# define OB_PUTC2(C1,C2) \
- (obstack_1grow (&scratch_obstack, (C1)), obstack_1grow (&scratch_obstack, (C2)))
-# define OB_PUTS(S) (obstack_grow (&scratch_obstack, (S), sizeof (S) - 1))
-# define OB_PUTID(ID) \
- (obstack_grow (&scratch_obstack, IDENTIFIER_POINTER (ID), \
- IDENTIFIER_LENGTH (ID)))
-# define OB_PUTCP(S) (obstack_grow (&scratch_obstack, (S), strlen (S)))
-# define OB_FINISH() (obstack_1grow (&scratch_obstack, '\0'))
-# define OB_LAST() (obstack_next_free (&scratch_obstack)[-1])
-
-/* type tables for K and B type compression */
-static varray_type btypelist;
-static varray_type ktypelist;
-
-/* number of each type seen */
-static size_t maxbtype;
-static size_t maxktype;
-
-/* Array of types seen so far in top-level call to `build_mangled_name'.
- Allocated and deallocated by caller. */
-static varray_type typevec;
-
-/* Number of types interned by `build_mangled_name' so far. */
-static size_t maxtype;
-
/* Called once to initialize method.c. */
void
init_method ()
{
- gcc_obstack_init (&scratch_obstack);
- scratch_firstobj = (char *)obstack_alloc (&scratch_obstack, 0);
- ggc_add_tree_varray_root (&btypelist, 1);
- ggc_add_tree_varray_root (&ktypelist, 1);
- ggc_add_tree_varray_root (&typevec, 1);
- if (flag_new_abi)
- init_mangle ();
-}
-
-/* This must be large enough to hold any printed integer or floating-point
- value. */
-static char digit_buffer[128];
-
-
-/* Here is where overload code starts. */
-
-/* Nonzero if we should not try folding parameter types. */
-static int nofold;
-
-/* Nonzero if an underscore is required before adding a digit to the
- mangled name currently being built. */
-static int numeric_output_need_bar;
-
-static inline void
-start_squangling ()
-{
- /* This function is obsoleted by the new ABI. */
- my_friendly_assert (!flag_new_abi, 200005222);
-
- if (flag_do_squangling)
- {
- nofold = 0;
- maxbtype = 0;
- maxktype = 0;
- VARRAY_TREE_INIT (btypelist, 50, "btypelist");
- VARRAY_TREE_INIT (ktypelist, 50, "ktypelist");
- }
-}
-
-static inline void
-end_squangling ()
-{
- if (flag_do_squangling)
- {
- VARRAY_FREE (ktypelist);
- VARRAY_FREE (btypelist);
- maxbtype = 0;
- maxktype = 0;
- }
-}
-
-/* Code to concatenate an asciified integer to a string. */
-
-static inline void
-icat (i)
- HOST_WIDE_INT i;
-{
- unsigned HOST_WIDE_INT ui;
-
- /* Handle this case first, to go really quickly. For many common values,
- the result of ui/10 below is 1. */
- if (i == 1)
- {
- OB_PUTC ('1');
- return;
- }
-
- if (i >= 0)
- ui = i;
- else
- {
- OB_PUTC ('m');
- ui = -i;
- }
-
- if (ui >= 10)
- icat (ui / 10);
-
- OB_PUTC ('0' + (ui % 10));
-}
-
-static void
-dicat (lo, hi)
- HOST_WIDE_INT lo, hi;
-{
- unsigned HOST_WIDE_INT ulo, uhi, qlo, qhi;
-
- if (hi >= 0)
- {
- uhi = hi;
- ulo = lo;
- }
- else
- {
- uhi = (lo == 0 ? -hi : -hi-1);
- ulo = -lo;
- }
- if (uhi == 0
- && ulo < ((unsigned HOST_WIDE_INT)1 << (HOST_BITS_PER_WIDE_INT - 1)))
- {
- icat (ulo);
- return;
- }
- /* Divide 2^HOST_WIDE_INT*uhi+ulo by 10. */
- qhi = uhi / 10;
- uhi = uhi % 10;
- qlo = uhi * (((unsigned HOST_WIDE_INT)1 << (HOST_BITS_PER_WIDE_INT - 1)) / 5);
- qlo += ulo / 10;
- ulo = ulo % 10;
- ulo += uhi * (((unsigned HOST_WIDE_INT)1 << (HOST_BITS_PER_WIDE_INT - 1)) % 5)
- * 2;
- qlo += ulo / 10;
- ulo = ulo % 10;
- /* Quotient is 2^HOST_WIDE_INT*qhi+qlo, remainder is ulo. */
- dicat (qlo, qhi);
- OB_PUTC ('0' + ulo);
-}
-
-/* Returns the index of TYPE in the typevec, or -1 if it's not there. */
-
-static inline int
-old_backref_index (type)
- tree type;
-{
- size_t tindex;
-
- if (! is_back_referenceable_type (type))
- return -1;
-
- /* The entry for this parm is at maxtype-1, so don't look there for
- something to repeat. */
- for (tindex = 0; tindex < maxtype - 1; ++tindex)
- if (same_type_p (VARRAY_TREE (typevec, tindex), type))
- break;
-
- if (tindex == maxtype - 1)
- return -1;
-
- return tindex;
-}
-
-/* Old mangling style: If TYPE has already been used in the parameter list,
- emit a backward reference and return non-zero; otherwise, return 0.
-
- NREPEATS is the number of repeats we've recorded of this type, or 0 if
- this is the first time we've seen it and we're just looking to see if
- it had been used before. */
-
-static inline int
-flush_repeats (nrepeats, type)
- int nrepeats;
- tree type;
-{
- int tindex = old_backref_index (type);
-
- if (tindex == -1)
- {
- my_friendly_assert (nrepeats == 0, 990316);
- return 0;
- }
-
- if (nrepeats > 1)
- {
- OB_PUTC ('N');
- icat (nrepeats);
- if (nrepeats > 9)
- OB_PUTC ('_');
- }
- else
- OB_PUTC ('T');
- icat (tindex);
- if (tindex > 9)
- OB_PUTC ('_');
-
- return 1;
-}
-
-/* Returns nonzero iff this is a type to which we will want to make
- back-references (using the `B' code). */
-
-static int
-is_back_referenceable_type (type)
- tree type;
-{
- /* For some reason, the Java folks don't want back refs on these. */
- if (TYPE_FOR_JAVA (type))
- return 0;
-
- switch (TREE_CODE (type))
- {
- case BOOLEAN_TYPE:
- if (!flag_do_squangling)
- /* Even though the mangling of this is just `b', we did
- historically generate back-references for it. */
- return 1;
- /* Fall through. */
-
- case INTEGER_TYPE:
- case REAL_TYPE:
- case VOID_TYPE:
- /* These types have single-character manglings, so there's no
- point in generating back-references. */
- return 0;
-
- case TEMPLATE_TYPE_PARM:
- /* It would be a bit complex to demangle signatures correctly if
- we generated back-references to these, and the manglings of
- type parameters are short. */
- return 0;
-
- default:
- return 1;
- }
-}
-
-/* Issue the squangling code indicating NREPEATS repetitions of TYPE,
- which was the last parameter type output. */
-
-static void
-issue_nrepeats (nrepeats, type)
- int nrepeats;
- tree type;
-{
- if (nrepeats == 1 && !is_back_referenceable_type (type))
- /* For types whose manglings are short, don't bother using the
- repetition code if there's only one repetition, since the
- repetition code will be about as long as the ordinary mangling. */
- build_mangled_name_for_type (type);
- else
- {
- OB_PUTC ('n');
- icat (nrepeats);
- if (nrepeats > 9)
- OB_PUTC ('_');
- }
-}
-
-/* Check to see if a tree node has been entered into the Kcode typelist.
- If not, add it. Returns -1 if it isn't found, otherwise returns the
- index. */
-
-static int
-check_ktype (node, add)
- tree node;
- int add;
-{
- size_t x;
- tree localnode = node;
-
- if (ktypelist == NULL)
- return -1;
-
- if (TREE_CODE (node) == TYPE_DECL)
- localnode = TREE_TYPE (node);
-
- for (x = 0; x < maxktype; x++)
- {
- if (same_type_p (localnode, VARRAY_TREE (ktypelist, x)))
- return x;
- }
- /* Didn't find it, so add it here. */
- if (add)
- {
- if (VARRAY_SIZE (ktypelist) <= maxktype)
- VARRAY_GROW (ktypelist,
- VARRAY_SIZE (ktypelist) * 3 / 2);
- VARRAY_TREE (ktypelist, maxktype) = localnode;
- maxktype++;
- }
- return -1;
-}
-
-
-static inline int
-issue_ktype (decl)
- tree decl;
-{
- int kindex;
- kindex = check_ktype (decl, FALSE);
- if (kindex != -1)
- {
- OB_PUTC ('K');
- icat (kindex);
- if (kindex > 9)
- OB_PUTC ('_');
- return TRUE;
- }
- return FALSE;
-}
-
-/* Build a representation for DECL, which may be an entity not at
- global scope. If so, a marker indicating that the name is
- qualified has already been output, but the qualifying context has
- not. */
-
-static void
-build_overload_nested_name (decl)
- tree decl;
-{
- tree context;
-
- if (ktypelist && issue_ktype (decl))
- return;
-
- if (decl == global_namespace)
- return;
-
- context = CP_DECL_CONTEXT (decl);
-
- /* try to issue a K type, and if we can't continue the normal path */
- if (!(ktypelist && issue_ktype (context)))
- {
- /* For a template type parameter, we want to output an 'Xn'
- rather than 'T' or some such. */
- if (TREE_CODE (context) == TEMPLATE_TYPE_PARM
- || TREE_CODE (context) == TEMPLATE_TEMPLATE_PARM
- || TREE_CODE (context) == BOUND_TEMPLATE_TEMPLATE_PARM)
- build_mangled_name_for_type (context);
- else
- {
- if (TYPE_P (context))
- context = TYPE_NAME (context);
- build_overload_nested_name (context);
- }
- }
-
- if (TREE_CODE (decl) == FUNCTION_DECL)
- {
- static int static_labelno;
-
- tree name = DECL_ASSEMBLER_NAME (decl);
- char *label;
-
- ASM_FORMAT_PRIVATE_NAME (label, IDENTIFIER_POINTER (name), static_labelno);
- static_labelno++;
-
- if (numeric_output_need_bar)
- OB_PUTC ('_');
- icat (strlen (label));
- OB_PUTCP (label);
- numeric_output_need_bar = 1;
- }
- else if (TREE_CODE (decl) == NAMESPACE_DECL)
- build_overload_identifier (DECL_NAME (decl));
- else /* TYPE_DECL */
- build_overload_identifier (decl);
-}
-
-/* Output the decimal representation of I. If I > 9, the decimal
- representation is preceeded and followed by an underscore. */
-
-static void
-build_underscore_int (i)
- int i;
-{
- if (i > 9)
- OB_PUTC ('_');
- icat (i);
- if (i > 9)
- OB_PUTC ('_');
-}
-
-static void
-build_overload_scope_ref (value)
- tree value;
-{
- OB_PUTC2 ('Q', '2');
- numeric_output_need_bar = 0;
- build_mangled_name_for_type (TREE_OPERAND (value, 0));
- build_overload_identifier (TREE_OPERAND (value, 1));
-}
-
-/* VALUE is a complex expression. Produce an appropriate mangling.
- (We are forced to mangle complex expressions when dealing with
- templates, and an expression involving template parameters appears
- in the type of a function parameter.) */
-
-static void
-mangle_expression (value)
- tree value;
-{
- if (TREE_CODE (value) == SCOPE_REF)
- {
- build_overload_scope_ref (value);
- return;
- }
-
- OB_PUTC ('E');
- numeric_output_need_bar = 0;
-
- if (IS_EXPR_CODE_CLASS (TREE_CODE_CLASS (TREE_CODE (value))))
- {
- int i;
- int operands = TREE_CODE_LENGTH (TREE_CODE (value));
- const char *name;
-
- name = operator_name_info[TREE_CODE (value)].mangled_name;
- if (name == NULL)
- /* On some erroneous inputs, we can get here with VALUE a
- LOOKUP_EXPR. We must survive this routine in order to issue
- a sensible error message, so we fall through to the case
- below. */
- goto bad_value;
-
- for (i = 0; i < operands; ++i)
- {
- tree operand;
- enum tree_code tc;
-
- /* We just outputted either the `E' or the name of the
- operator. */
- numeric_output_need_bar = 0;
-
- if (i != 0)
- /* Skip the leading underscores. */
- OB_PUTCP (name + 2);
-
- operand = TREE_OPERAND (value, i);
- tc = TREE_CODE (operand);
-
- if (TREE_CODE_CLASS (tc) == 't')
- /* We can get here with sizeof, e.g.:
-
- template <class T> void f(A<sizeof(T)>); */
- build_mangled_name_for_type (operand);
- else
- build_overload_value (TREE_TYPE (operand),
- operand,
- mf_maybe_uninstantiated);
- }
- }
- else
- {
- /* We don't ever want this output, but it's
- inconvenient not to be able to build the string.
- This should cause assembler errors we'll notice. */
-
- static int n;
- bad_value:
- sprintf (digit_buffer, " *%d", n++);
- OB_PUTCP (digit_buffer);
- }
-
- OB_PUTC ('W');
- numeric_output_need_bar = 0;
-}
-
-/* Encoding for an INTEGER_CST value. */
-
-static void
-build_overload_int (value, flags)
- tree value;
- mangling_flags flags;
-{
- int multiple_words_p = 0;
- int multiple_digits_p = 0;
-
- if ((flags & mf_maybe_uninstantiated) && TREE_CODE (value) != INTEGER_CST)
- {
- mangle_expression (value);
- return;
- }
-
- /* Unless we were looking at an uninstantiated template, integers
- should always be represented by constants. */
- my_friendly_assert (TREE_CODE (value) == INTEGER_CST, 243);
-
- /* If value doesn't fit in a single HOST_WIDE_INT, we must use a
- special output routine that can deal with this. */
- if (! host_integerp (value, 0))
- {
- multiple_words_p = 1;
- /* And there is certainly going to be more than one digit. */
- multiple_digits_p = 1;
- }
- else
- multiple_digits_p = ((HOST_WIDE_INT) TREE_INT_CST_LOW (value) > 9
- || (HOST_WIDE_INT) TREE_INT_CST_LOW (value) < -9);
-
- /* If necessary, add a leading underscore. */
- if (multiple_digits_p && (flags & mf_use_underscores_around_value))
- OB_PUTC ('_');
-
- /* Output the number itself. */
- if (multiple_words_p)
- dicat (TREE_INT_CST_LOW (value), TREE_INT_CST_HIGH (value));
- else
- icat (TREE_INT_CST_LOW (value));
-
- if (flags & mf_use_underscores_around_value)
- {
- if (multiple_digits_p)
- OB_PUTC ('_');
- /* Whether or not there were multiple digits, we don't need an
- underscore. We've either terminated the number with an
- underscore, or else it only had one digit. */
- numeric_output_need_bar = 0;
- }
- else
- /* We just output a numeric value. */
- numeric_output_need_bar = 1;
-}
-
-
-/* Output S followed by a representation of the TEMPLATE_PARM_INDEX
- supplied in INDEX. */
-
-static void
-build_mangled_template_parm_index (s, index)
- const char *s;
- tree index;
-{
- OB_PUTCP (s);
- build_underscore_int (TEMPLATE_PARM_IDX (index));
- /* We use the LEVEL, not the ORIG_LEVEL, because the mangling is a
- representation of the function from the point of view of its
- type. */
- build_underscore_int (TEMPLATE_PARM_LEVEL (index));
-}
-
-
-/* Mangling for C99 integer types (and Cygnus extensions for 128-bit
- and other types) is based on the letter "I" followed by the hex
- representations of the bitsize for the type in question. For
- encodings that result in larger than two digits, a leading and
- trailing underscore is added.
-
- Thus:
- int1_t = 001 = I01
- int8_t = 008 = I08
- int16_t = 010 = I10
- int24_t = 018 = I18
- int32_t = 020 = I20
- int64_t = 040 = I40
- int80_t = 050 = I50
- int128_t = 080 = I80
- int256_t = 100 = I_100_
- int512_t = 200 = I_200_
-
- Given an integer in decimal format, mangle according to this scheme. */
-
-#if HOST_BITS_PER_WIDE_INT >= 64
-static void
-build_mangled_C99_name (bits)
- int bits;
-{
- char mangled[10] = "";
-
- if (bits > 255)
- sprintf (mangled, "I_%x_", bits);
- else
- sprintf (mangled, "I%.2x", bits);
-
- OB_PUTCP (mangled);
-}
-#endif
-
-static void
-build_overload_value (type, value, flags)
- tree type, value;
- mangling_flags flags;
-{
- my_friendly_assert (TYPE_P (type), 0);
-
- while (TREE_CODE (value) == NON_LVALUE_EXPR
- || TREE_CODE (value) == NOP_EXPR)
- value = TREE_OPERAND (value, 0);
-
- if (numeric_output_need_bar)
- {
- OB_PUTC ('_');
- numeric_output_need_bar = 0;
- }
-
- if (TREE_CODE (value) == TEMPLATE_PARM_INDEX)
- {
- build_mangled_template_parm_index ("Y", value);
- return;
- }
-
- if (TYPE_PTRMEM_P (type))
- {
- if (TREE_CODE (value) != PTRMEM_CST)
- /* We should have already rejected this pointer to member,
- since it is not a constant. */
- my_friendly_abort (0);
-
- /* Get the actual FIELD_DECL. */
- value = PTRMEM_CST_MEMBER (value);
- my_friendly_assert (TREE_CODE (value) == FIELD_DECL, 0);
-
- /* Output the name of the field. */
- build_overload_identifier (DECL_NAME (value));
- return;
- }
- else if (INTEGRAL_TYPE_P (type))
- {
- build_overload_int (value, flags);
- return;
- }
-
- /* The only case where we use the extra underscores here is when
- forming the mangling for an integral non-type template argument.
- If that didn't happen, stop now. */
- flags &= ~mf_use_underscores_around_value;
-
- switch (TREE_CODE (type))
- {
- case REAL_TYPE:
- {
- REAL_VALUE_TYPE val;
- char *bufp = digit_buffer;
-
- /* We must handle non-constants in templates. */
- if (TREE_CODE (value) != REAL_CST)
- {
- mangle_expression (value);
- break;
- }
-
- val = TREE_REAL_CST (value);
- if (REAL_VALUE_ISNAN (val))
- {
- sprintf (bufp, "NaN");
- }
- else
- {
- if (REAL_VALUE_NEGATIVE (val))
- {
- val = REAL_VALUE_NEGATE (val);
- *bufp++ = 'm';
- }
- if (REAL_VALUE_ISINF (val))
- {
- sprintf (bufp, "Infinity");
- }
- else
- {
- REAL_VALUE_TO_DECIMAL (val, "%.20e", bufp);
- bufp = (char *) strchr (bufp, 'e');
- if (!bufp)
- strcat (digit_buffer, "e0");
- else
- {
- char *p;
- bufp++;
- if (*bufp == '-')
- {
- *bufp++ = 'm';
- }
- p = bufp;
- if (*p == '+')
- p++;
- while (*p == '0')
- p++;
- if (*p == 0)
- {
- *bufp++ = '0';
- *bufp = 0;
- }
- else if (p != bufp)
- {
- while (*p)
- *bufp++ = *p++;
- *bufp = 0;
- }
- }
-#ifdef NO_DOT_IN_LABEL
- bufp = (char *) strchr (bufp, '.');
- if (bufp)
- *bufp = '_';
-#endif
- }
- }
- OB_PUTCP (digit_buffer);
- numeric_output_need_bar = 1;
- return;
- }
- case POINTER_TYPE:
- if (TREE_CODE (value) == INTEGER_CST)
- {
- build_overload_int (value, flags);
- return;
- }
- else if (TREE_CODE (value) == TEMPLATE_PARM_INDEX)
- {
- build_mangled_template_parm_index ("", value);
- numeric_output_need_bar = 1;
- return;
- }
-
- value = TREE_OPERAND (value, 0);
-
- /* Fall through. */
-
- case REFERENCE_TYPE:
- if (TREE_CODE (value) == ADDR_EXPR)
- value = TREE_OPERAND (value, 0);
-
- if (TREE_CODE (value) == VAR_DECL)
- {
- my_friendly_assert (DECL_NAME (value) != 0, 245);
- build_overload_identifier (DECL_ASSEMBLER_NAME (value));
- return;
- }
- else if (TREE_CODE (value) == FUNCTION_DECL)
- {
- my_friendly_assert (DECL_NAME (value) != 0, 246);
- build_overload_identifier (DECL_ASSEMBLER_NAME (value));
- return;
- }
- else if (TREE_CODE (value) == SCOPE_REF)
- build_overload_scope_ref (value);
- else
- my_friendly_abort (71);
- break; /* not really needed */
-
- case RECORD_TYPE:
- {
- tree delta;
- tree idx;
- tree pfn;
- tree delta2;
- tree fn;
-
- my_friendly_assert (TYPE_PTRMEMFUNC_P (type), 0);
-
- /* We'll get a ADDR_EXPR of a SCOPE_REF here if we're
- mangling, an instantiation of something like:
-
- template <class T, void (T::*fp)()> class C {};
- template <class T> C<T, &T::f> x();
-
- We mangle the return type of the function, and that
- contains template parameters. */
- if (TREE_CODE (value) == ADDR_EXPR
- && TREE_CODE (TREE_OPERAND (value, 0)) == SCOPE_REF)
- {
- build_overload_scope_ref (TREE_OPERAND (value, 0));
- break;
- }
-
- my_friendly_assert (TREE_CODE (value) == PTRMEM_CST, 0);
-
- expand_ptrmemfunc_cst (value, &delta, &idx, &pfn, &delta2);
- fn = PTRMEM_CST_MEMBER (value);
- build_overload_int (delta, flags);
- OB_PUTC ('_');
- if (!flag_new_abi)
- {
- build_overload_int (idx, flags);
- OB_PUTC ('_');
- }
- else if (DECL_VIRTUAL_P (fn))
- {
- build_overload_int (DECL_VINDEX (fn), flags);
- OB_PUTC ('_');
- }
-
- if (!DECL_VIRTUAL_P (fn))
- {
- numeric_output_need_bar = 0;
- build_overload_identifier (DECL_ASSEMBLER_NAME (fn));
- }
- else if (!flag_new_abi)
- {
- OB_PUTC ('i');
- build_overload_int (delta2, flags);
- }
- }
- break;
-
- default:
- sorry ("conversion of %s as template parameter",
- tree_code_name [(int) TREE_CODE (type)]);
- my_friendly_abort (72);
- }
-}
-
-
-/* Add encodings for the declaration of template template parameters.
- PARMLIST must be a TREE_VEC. */
-
-static void
-build_template_template_parm_names (parmlist)
- tree parmlist;
-{
- int i, nparms;
-
- my_friendly_assert (TREE_CODE (parmlist) == TREE_VEC, 990228);
- nparms = TREE_VEC_LENGTH (parmlist);
- icat (nparms);
- for (i = 0; i < nparms; i++)
- {
- tree parm = TREE_VALUE (TREE_VEC_ELT (parmlist, i));
- if (TREE_CODE (parm) == TYPE_DECL)
- {
- /* This parameter is a type. */
- OB_PUTC ('Z');
- }
- else if (TREE_CODE (parm) == TEMPLATE_DECL)
- {
- /* This parameter is a template. */
- OB_PUTC ('z');
- build_template_template_parm_names (DECL_INNERMOST_TEMPLATE_PARMS (parm));
- }
- else
- /* It's a PARM_DECL. */
- build_mangled_name_for_type (TREE_TYPE (parm));
- }
-}
-
-
-/* Add encodings for the vector of template parameters in PARMLIST,
- given the vector of arguments to be substituted in ARGLIST. */
-
-static void
-build_template_parm_names (parmlist, arglist)
- tree parmlist;
- tree arglist;
-{
- int i, nparms;
- tree inner_args = INNERMOST_TEMPLATE_ARGS (arglist);
-
- nparms = TREE_VEC_LENGTH (parmlist);
- icat (nparms);
- for (i = 0; i < nparms; i++)
- {
- tree parm = TREE_VALUE (TREE_VEC_ELT (parmlist, i));
- tree arg = TREE_VEC_ELT (inner_args, i);
- if (TREE_CODE (parm) == TYPE_DECL)
- {
- /* This parameter is a type. */
- OB_PUTC ('Z');
- build_mangled_name_for_type (arg);
- }
- else if (TREE_CODE (parm) == TEMPLATE_DECL)
- {
- /* This parameter is a template. */
- if (TREE_CODE (arg) == TEMPLATE_TEMPLATE_PARM)
- /* Output parameter declaration, argument index and level. */
- build_mangled_name_for_type (arg);
- else
- {
- /* A TEMPLATE_DECL node, output the parameter declaration
- and template name */
-
- OB_PUTC ('z');
- build_template_template_parm_names
- (DECL_INNERMOST_TEMPLATE_PARMS (parm));
- icat (IDENTIFIER_LENGTH (DECL_NAME (arg)));
- OB_PUTID (DECL_NAME (arg));
- }
- }
- else
- {
- parm = tsubst (parm, inner_args, /*complain=*/1, NULL_TREE);
- /* It's a PARM_DECL. */
- build_mangled_name_for_type (TREE_TYPE (parm));
- build_overload_value (TREE_TYPE (parm), arg,
- ((mf_maybe_uninstantiated
- * uses_template_parms (arglist))
- | mf_use_underscores_around_value));
- }
- }
- }
-
-/* Output the representation for NAME, which is either a TYPE_DECL or
- an IDENTIFIER. */
-
-static void
-build_overload_identifier (name)
- tree name;
-{
- if (TREE_CODE (name) == TYPE_DECL
- && CLASS_TYPE_P (TREE_TYPE (name))
- && CLASSTYPE_TEMPLATE_INFO (TREE_TYPE (name))
- && (PRIMARY_TEMPLATE_P (CLASSTYPE_TI_TEMPLATE (TREE_TYPE (name)))
- || (TREE_CODE (CP_DECL_CONTEXT (CLASSTYPE_TI_TEMPLATE
- (TREE_TYPE (name))))
- == FUNCTION_DECL)))
- {
- /* NAME is the TYPE_DECL for a template specialization. */
- tree template, parmlist, arglist, tname;
- template = CLASSTYPE_TI_TEMPLATE (TREE_TYPE (name));
- arglist = CLASSTYPE_TI_ARGS (TREE_TYPE (name));
- tname = DECL_NAME (template);
- parmlist = DECL_INNERMOST_TEMPLATE_PARMS (template);
- OB_PUTC ('t');
- icat (IDENTIFIER_LENGTH (tname));
- OB_PUTID (tname);
- build_template_parm_names (parmlist, arglist);
- }
- else
- {
- if (TREE_CODE (name) == TYPE_DECL)
- name = DECL_NAME (name);
- if (numeric_output_need_bar)
- {
- OB_PUTC ('_');
- numeric_output_need_bar = 0;
- }
- icat (IDENTIFIER_LENGTH (name));
- OB_PUTID (name);
- }
-}
-
-/* Given DECL, either a class TYPE, TYPE_DECL or FUNCTION_DECL, produce
- the mangling for it. Used by build_mangled_name and build_static_name. */
-
-static void
-build_qualified_name (decl)
- tree decl;
-{
- tree context;
- int i = 1;
-
- if (TYPE_P (decl))
- decl = TYPE_NAME (decl);
-
- /* If DECL_ASSEMBLER_NAME has been set properly, use it. */
- if (TREE_CODE (decl) == TYPE_DECL
- && DECL_ASSEMBLER_NAME (decl) != DECL_NAME (decl) && !flag_do_squangling)
- {
- tree id = DECL_ASSEMBLER_NAME (decl);
- OB_PUTID (id);
- if (ISDIGIT (IDENTIFIER_POINTER (id) [IDENTIFIER_LENGTH (id) - 1]))
- numeric_output_need_bar = 1;
- return;
- }
-
- context = decl;
- /* If we can't find a Ktype, do it the hard way. */
- if (check_ktype (context, FALSE) == -1)
- {
- /* Count type and namespace scopes. */
- while (1)
- {
- context = CP_DECL_CONTEXT (context);
- if (context == global_namespace)
- break;
- i += 1;
- if (check_ktype (context, FALSE) != -1)
- /* Found one! */
- break;
- if (TYPE_P (context))
- context = TYPE_NAME (context);
- }
- }
-
- if (i > 1)
- {
- OB_PUTC ('Q');
- build_underscore_int (i);
- numeric_output_need_bar = 0;
- }
- build_overload_nested_name (decl);
-}
-
-/* Output the mangled representation for TYPE. If EXTRA_GCODE is
- non-zero, mangled names for structure/union types are intentionally
- mangled differently from the method described in the ARM. */
-
-static void
-build_mangled_name_for_type_with_Gcode (type, extra_Gcode)
- tree type;
- int extra_Gcode;
-{
- if (TYPE_PTRMEMFUNC_P (type))
- type = TYPE_PTRMEMFUNC_FN_TYPE (type);
- process_modifiers (type);
- process_overload_item (type, extra_Gcode);
-}
-
-/* Like build_mangled_name_for_type_with_Gcode, but never outputs the
- `G'. */
-
-static void
-build_mangled_name_for_type (type)
- tree type;
-{
- build_mangled_name_for_type_with_Gcode (type, 0);
-}
-
-/* Given a list of parameters in PARMTYPES, create an unambiguous
- overload string. Should distinguish any type that C (or C++) can
- distinguish. I.e., pointers to functions are treated correctly.
-
- Caller must deal with whether a final `e' goes on the end or not.
-
- Any default conversions must take place before this function
- is called.
-
- BEGIN and END control initialization and finalization of the
- obstack where we build the string. */
-
-char *
-build_overload_name (parmtypes, begin, end)
- tree parmtypes;
- int begin, end;
-{
- char *ret;
-
- /* This function is obsoleted by the new ABI. */
- my_friendly_assert (!flag_new_abi, 200005221);
-
- start_squangling ();
- ret = build_mangled_name (parmtypes, begin, end);
- end_squangling ();
- return ret ;
-}
-
-/* Output the mangled representation for PARMTYPES. If PARMTYPES is a
- TREE_LIST, then it is a list of parameter types. Otherwise,
- PARMTYPES must be a single type. */
-
-static char *
-build_mangled_name (parmtypes, begin, end)
- tree parmtypes;
- int begin, end;
-{
- /* This function is obsoleted by the new ABI. */
- my_friendly_assert (!flag_new_abi, 200004105);
-
- if (begin)
- OB_INIT ();
-
- if (TREE_CODE (parmtypes) != TREE_LIST)
- /* There is only one type. */
- build_mangled_name_for_type (parmtypes);
- else
- {
- /* There are several types in a parameter list. */
- int nrepeats = 0;
- int old_style_repeats = !flag_do_squangling && !nofold && typevec;
- tree last_type = NULL_TREE;
-
- for (; parmtypes && parmtypes != void_list_node;
- parmtypes = TREE_CHAIN (parmtypes))
- {
- /* We used to call canonical_type_variant here, but that isn't
- good enough; it doesn't handle pointers to typedef types. So
- we can't just set TREE_USED to say we've seen a type already;
- we have to check each of the earlier types with same_type_p. */
- tree parmtype = TREE_VALUE (parmtypes);
-
- if (old_style_repeats)
- {
- /* Every argument gets counted. */
- my_friendly_assert (maxtype < VARRAY_SIZE (typevec), 387);
- VARRAY_TREE (typevec, maxtype) = parmtype;
- maxtype++;
- }
-
- if (last_type && same_type_p (parmtype, last_type))
- {
- if (flag_do_squangling
- || (old_style_repeats
- && is_back_referenceable_type (parmtype)))
- {
- /* The next type is the same as this one. Keep
- track of the repetition, and output the repeat
- count later. */
- nrepeats++;
- continue;
- }
- }
- else if (nrepeats != 0)
- {
- /* Indicate how many times the previous parameter was
- repeated. */
- if (old_style_repeats)
- flush_repeats (nrepeats, last_type);
- else
- issue_nrepeats (nrepeats, last_type);
- nrepeats = 0;
- }
-
- /* Insead of protecting flush_repeats() against
- error_mark_node, we can do it here. Since we wouldn't
- add anything for an ERROR_MARK anyway, it's ok to skip
- the mangling for this type. */
- if (old_style_repeats && parmtype == error_mark_node)
- {
- last_type = NULL_TREE;
- continue;
- }
-
- last_type = parmtype;
-
- /* Note that for bug-compatibility with 2.7.2, we can't build up
- repeats of types other than the most recent one. So we call
- flush_repeats every round, if we get this far. */
- if (old_style_repeats && flush_repeats (0, parmtype))
- continue;
-
- /* Output the PARMTYPE. */
- build_mangled_name_for_type_with_Gcode (parmtype, 1);
- }
-
- /* Output the repeat count for the last parameter, if
- necessary. */
- if (nrepeats != 0)
- {
- if (old_style_repeats)
- flush_repeats (nrepeats, last_type);
- else
- issue_nrepeats (nrepeats, last_type);
- nrepeats = 0;
- }
-
- if (!parmtypes)
- /* The parameter list ends in an ellipsis. */
- OB_PUTC ('e');
- }
-
- if (end)
- OB_FINISH ();
- return (char *) obstack_base (&scratch_obstack);
-}
-
-/* Emit modifiers such as constant, read-only, and volatile. */
-
-static void
-process_modifiers (parmtype)
- tree parmtype;
-{
- /* Note that here we do not use CP_TYPE_CONST_P and friends because
- we describe types recursively; we will get the `const' in
- `const int ()[10]' when processing the `const int' part. */
- if (TYPE_READONLY (parmtype))
- OB_PUTC ('C');
- if (TREE_CODE (parmtype) == INTEGER_TYPE
- && ! same_type_p (parmtype, char_type_node)
- && ! same_type_p (parmtype, wchar_type_node)
- && (TYPE_MAIN_VARIANT (parmtype)
- == unsigned_type (TYPE_MAIN_VARIANT (parmtype)))
- && ! TYPE_FOR_JAVA (parmtype))
- OB_PUTC ('U');
- if (TYPE_VOLATILE (parmtype))
- OB_PUTC ('V');
- /* It would be better to use `R' for `restrict', but that's already
- used for reference types. And `r' is used for `long double'. */
- if (TYPE_RESTRICT (parmtype))
- OB_PUTC ('u');
-}
-
-/* Check to see if TYPE has been entered into the Bcode typelist. If
- so, return 1 and emit a backreference to TYPE. Otherwise, add TYPE
- to the list of back-referenceable types and return 0. */
-
-static int
-check_btype (type)
- tree type;
-{
- size_t x;
-
- if (btypelist == NULL)
- return 0;
-
- if (!is_back_referenceable_type (type))
- return 0;
-
- for (x = 0; x < maxbtype; x++)
- if (same_type_p (type, VARRAY_TREE (btypelist, x)))
- {
- OB_PUTC ('B');
- icat (x);
- if (x > 9)
- OB_PUTC ('_');
- return 1 ;
- }
-
- if (VARRAY_SIZE (btypelist) <= maxbtype)
- /* Enlarge the table. */
- VARRAY_GROW (btypelist,
- VARRAY_SIZE (btypelist) * 3 / 2);
-
- /* Register the TYPE. */
- VARRAY_TREE (btypelist, maxbtype) = type;
- maxbtype++;
-
- return 0;
-}
-
-/* Emit the correct code for various node types. */
-
-static void
-process_overload_item (parmtype, extra_Gcode)
- tree parmtype;
- int extra_Gcode;
-{
- tree tmp;
-
- numeric_output_need_bar = 0;
-
- /* Our caller should have already handed any qualifiers, so pull out the
- TYPE_MAIN_VARIANT to avoid typedef confusion. Except we can't do that
- for arrays, because they are transparent to qualifiers. Sigh. */
- if (TREE_CODE (parmtype) == ARRAY_TYPE)
- parmtype = canonical_type_variant (parmtype);
- else
- parmtype = TYPE_MAIN_VARIANT (parmtype);
-
- /* These tree types are considered modifiers for B code squangling,
- and therefore should not get entries in the Btypelist. They are,
- however, repeatable types. */
-
- switch (TREE_CODE (parmtype))
- {
- case REFERENCE_TYPE:
- OB_PUTC ('R');
- goto more;
-
- case ARRAY_TYPE:
- {
- OB_PUTC ('A');
- if (TYPE_DOMAIN (parmtype) == NULL_TREE)
- OB_PUTC ('_');
- else
- {
- tree length = array_type_nelts (parmtype);
- if (TREE_CODE (length) != INTEGER_CST || flag_do_squangling)
- {
- if (TREE_CODE (length) == MINUS_EXPR
- && TREE_OPERAND (length, 1) == integer_one_node)
- length = TREE_OPERAND (length, 0);
- else
- length = fold (build (PLUS_EXPR, TREE_TYPE (length),
- length, integer_one_node));
- STRIP_NOPS (length);
- }
- build_overload_value (sizetype, length, 1);
- }
- if (numeric_output_need_bar && ! flag_do_squangling)
- OB_PUTC ('_');
- goto more;
- }
-
- case POINTER_TYPE:
- OB_PUTC ('P');
- more:
- build_mangled_name_for_type (TREE_TYPE (parmtype));
- return;
- break;
-
- default:
- break;
- }
-
- if (flag_do_squangling && check_btype (parmtype))
- /* If PARMTYPE is already in the list of back-referenceable types,
- then check_btype will output the appropriate reference, and
- there's nothing more to do. */
- return;
-
- switch (TREE_CODE (parmtype))
- {
- case OFFSET_TYPE:
- OB_PUTC ('O');
- build_mangled_name_for_type (TYPE_OFFSET_BASETYPE (parmtype));
- OB_PUTC ('_');
- build_mangled_name_for_type (TREE_TYPE (parmtype));
- break;
-
- case FUNCTION_TYPE:
- case METHOD_TYPE:
- {
- tree parms = TYPE_ARG_TYPES (parmtype);
-
- /* Rather than implementing a reentrant TYPEVEC, we turn off
- repeat codes here, unless we're squangling. Squangling
- doesn't make use of the TYPEVEC, so there's no reentrancy
- problem. */
- int old_nofold = nofold;
- if (!flag_do_squangling)
- nofold = 1;
-
- if (TREE_CODE (parmtype) == METHOD_TYPE)
- {
- /* Mark this as a method. */
- OB_PUTC ('M');
- /* Output the class of which this method is a member. */
- build_mangled_name_for_type (TYPE_METHOD_BASETYPE (parmtype));
- /* Output any qualifiers for the `this' parameter. */
- process_modifiers (TREE_TYPE (TREE_VALUE (parms)));
- }
-
- /* Output the parameter types. */
- OB_PUTC ('F');
- if (parms == NULL_TREE)
- OB_PUTC ('e');
- else if (parms == void_list_node)
- OB_PUTC ('v');
- else
- build_mangled_name (parms, 0, 0);
-
- /* Output the return type. */
- OB_PUTC ('_');
- build_mangled_name_for_type (TREE_TYPE (parmtype));
-
- nofold = old_nofold;
- break;
- }
-
- case INTEGER_TYPE:
- iagain:
- if (parmtype == integer_type_node
- || parmtype == unsigned_type_node
- || parmtype == java_int_type_node)
- OB_PUTC ('i');
- else if (parmtype == long_integer_type_node
- || parmtype == long_unsigned_type_node)
- OB_PUTC ('l');
- else if (parmtype == short_integer_type_node
- || parmtype == short_unsigned_type_node
- || parmtype == java_short_type_node)
- OB_PUTC ('s');
- else if (parmtype == signed_char_type_node)
- {
- OB_PUTC ('S');
- OB_PUTC ('c');
- }
- else if (parmtype == char_type_node
- || parmtype == unsigned_char_type_node
- || parmtype == java_byte_type_node)
- OB_PUTC ('c');
- else if (parmtype == wchar_type_node
- || parmtype == java_char_type_node)
- OB_PUTC ('w');
- else if (parmtype == long_long_integer_type_node
- || parmtype == long_long_unsigned_type_node
- || parmtype == java_long_type_node)
- OB_PUTC ('x');
- else if (parmtype == java_boolean_type_node)
- OB_PUTC ('b');
- /* Handle intSI_type_node and such like their C++ equivalents. */
- else if (tmp = type_for_mode (TYPE_MODE (parmtype),
- TREE_UNSIGNED (parmtype)),
- parmtype != tmp)
- {
- parmtype = tmp;
- goto iagain;
- }
-#if HOST_BITS_PER_WIDE_INT >= 64
- else
- {
- int bits = TREE_INT_CST_LOW (TYPE_SIZE (parmtype));
- build_mangled_C99_name (bits);
- }
-#else
- else
- my_friendly_abort (73);
-#endif
- break;
-
- case BOOLEAN_TYPE:
- OB_PUTC ('b');
- break;
-
- case REAL_TYPE:
- if (parmtype == long_double_type_node)
- OB_PUTC ('r');
- else if (parmtype == double_type_node
- || parmtype == java_double_type_node)
- OB_PUTC ('d');
- else if (parmtype == float_type_node
- || parmtype == java_float_type_node)
- OB_PUTC ('f');
- else my_friendly_abort (74);
- break;
-
- case COMPLEX_TYPE:
- OB_PUTC ('J');
- build_mangled_name_for_type (TREE_TYPE (parmtype));
- break;
-
- case VECTOR_TYPE:
- OB_PUTC ('o');
- build_mangled_name_for_type (TREE_TYPE (parmtype));
- break;
-
- case VOID_TYPE:
- OB_PUTC ('v');
- break;
-
- case ERROR_MARK: /* not right, but nothing is anyway */
- break;
-
- /* have to do these */
- case UNION_TYPE:
- case RECORD_TYPE:
- {
- if (extra_Gcode)
- OB_PUTC ('G'); /* make it look incompatible with AT&T */
- /* drop through into next case */
- }
- case ENUMERAL_TYPE:
- {
- tree name = TYPE_NAME (parmtype);
-
- my_friendly_assert (TREE_CODE (name) == TYPE_DECL, 248);
-
- build_qualified_name (name);
- break;
- }
-
- case UNKNOWN_TYPE:
- /* This will take some work. */
- OB_PUTC ('?');
- break;
-
- case BOUND_TEMPLATE_TEMPLATE_PARM:
- /* Find and output the original template parameter
- declaration. */
- build_mangled_template_parm_index ("tzX",
- TEMPLATE_TYPE_PARM_INDEX
- (parmtype));
- build_template_parm_names
- (DECL_INNERMOST_TEMPLATE_PARMS (TYPE_TI_TEMPLATE (parmtype)),
- TYPE_TI_ARGS (parmtype));
- break;
-
- case TEMPLATE_TEMPLATE_PARM:
- build_mangled_template_parm_index ("ZzX",
- TEMPLATE_TYPE_PARM_INDEX
- (parmtype));
- build_template_template_parm_names
- (DECL_INNERMOST_TEMPLATE_PARMS (TYPE_STUB_DECL (parmtype)));
- break;
-
- case TEMPLATE_TYPE_PARM:
- build_mangled_template_parm_index ("X",
- TEMPLATE_TYPE_PARM_INDEX
- (parmtype));
- break;
-
- case TYPENAME_TYPE:
- /* When mangling the type of a function template whose
- declaration looks like:
-
- template <class T> void foo(typename T::U)
-
- we have to mangle these. */
- build_qualified_name (parmtype);
- break;
-
- default:
- my_friendly_abort (75);
- }
-
+ init_mangle ();
}
-/* Produce the mangling for a variable named NAME in CONTEXT, which can
- be either a class TYPE or a FUNCTION_DECL. */
-
-tree
-build_static_name (context, name)
- tree context, name;
-{
- /* This function is obsoleted by the new ABI. */
- my_friendly_assert (!flag_new_abi, 200004106);
-
- OB_INIT ();
- numeric_output_need_bar = 0;
- start_squangling ();
-#ifdef JOINER
- OB_PUTC ('_');
- build_qualified_name (context);
- OB_PUTC (JOINER);
-#else
- OB_PUTS ("__static_");
- build_qualified_name (context);
- OB_PUTC ('_');
-#endif
- OB_PUTID (name);
- OB_FINISH ();
- end_squangling ();
-
- return get_identifier ((char *)obstack_base (&scratch_obstack));
-}
-/* FOR_METHOD should be 1 if the declaration in question is for a member
- of a class (including a static member) and 2 if the declaration is
- for a constructor. */
-tree
-build_decl_overload_real (decl, parms, ret_type, tparms, targs,
- for_method)
- tree decl;
- tree parms;
- tree ret_type;
- tree tparms;
- tree targs;
- int for_method;
-{
- const char *name;
- enum tree_code operator_code;
-
- /* This function is obsoleted by the new ABI. */
- my_friendly_assert (!flag_new_abi, 20000410);
-
- operator_code = DECL_OVERLOADED_OPERATOR_P (decl);
- if (!DECL_CONV_FN_P (decl) && operator_code)
- {
- /* member operators new and delete look like methods at this
- point. */
- if (! for_method && CP_DECL_CONTEXT (decl) == global_namespace
- && parms != NULL_TREE && TREE_CODE (parms) == TREE_LIST
- && TREE_CHAIN (parms) == void_list_node)
- switch (operator_code)
- {
- case DELETE_EXPR:
- return get_identifier ("__builtin_delete");
- case VEC_DELETE_EXPR:
- return get_identifier ("__builtin_vec_delete");
- case NEW_EXPR:
- return get_identifier ("__builtin_new");
- case VEC_NEW_EXPR:
- return get_identifier ("__builtin_vec_new");
- default:
- break;
- }
-
- if (DECL_ASSIGNMENT_OPERATOR_P (decl))
- name = assignment_operator_name_info[(int) operator_code].mangled_name;
- else
- name = operator_name_info[(int) operator_code].mangled_name;
- }
- else
- name = IDENTIFIER_POINTER (DECL_NAME (decl));
-
- start_squangling ();
- OB_INIT ();
- if (for_method != 2)
- OB_PUTCP (name);
- /* Otherwise, we can divine that this is a constructor,
- and figure out its name without any extra encoding. */
-
- OB_PUTC2 ('_', '_');
- numeric_output_need_bar = 0;
-
- if (tparms)
- {
- OB_PUTC ('H');
- build_template_parm_names (tparms, targs);
- OB_PUTC ('_');
- }
- else if (!for_method && CP_DECL_CONTEXT (decl) == global_namespace)
- OB_PUTC ('F');
-
- if (!for_method && CP_DECL_CONTEXT (decl) != global_namespace)
- /* qualify with namespace */
- build_qualified_name (CP_DECL_CONTEXT (decl));
-
- if (parms == NULL_TREE)
- OB_PUTC ('e');
- else if (parms == void_list_node)
- OB_PUTC ('v');
- else
- {
- if (!flag_do_squangling)
- {
- /* Allocate typevec array. */
- size_t typevec_size = list_length (parms);
- maxtype = 0;
- if (!for_method && CP_DECL_CONTEXT (decl) != global_namespace)
- /* The namespace of a global function needs one slot. */
- typevec_size++;
- VARRAY_TREE_INIT (typevec, typevec_size, "typevec");
- }
- nofold = 0;
-
- if (for_method)
- {
- tree this_type = TREE_TYPE (TREE_VALUE (parms));
-
- build_mangled_name_for_type (this_type);
-
- if (!flag_do_squangling)
- {
- my_friendly_assert (maxtype < VARRAY_SIZE (typevec), 387);
- VARRAY_TREE (typevec, maxtype) = this_type;
- maxtype++;
- }
-
- if (TREE_CHAIN (parms))
- build_mangled_name (TREE_CHAIN (parms), 0, 0);
- else
- OB_PUTC ('e');
- }
- else
- {
- /* the namespace qualifier for a global function
- will count as type */
- if (CP_DECL_CONTEXT (decl) != global_namespace
- && !flag_do_squangling)
- {
- my_friendly_assert (maxtype < VARRAY_SIZE (typevec), 387);
- VARRAY_TREE (typevec, maxtype) = CP_DECL_CONTEXT (decl);
- maxtype++;
- }
- build_mangled_name (parms, 0, 0);
- }
-
- if (!flag_do_squangling)
- /* Deallocate typevec array. */
- VARRAY_FREE (typevec);
- }
-
- if (ret_type != NULL_TREE && for_method != 2)
- {
- /* Add the return type. */
- OB_PUTC ('_');
- build_mangled_name_for_type (ret_type);
- }
-
- OB_FINISH ();
- end_squangling ();
- {
- tree n = get_identifier (obstack_base (&scratch_obstack));
- return n;
- }
-}
-
/* Set the mangled name (DECL_ASSEMBLER_NAME) for DECL. */
void
set_mangled_name_for_decl (decl)
tree decl;
{
- tree parm_types;
-
if (processing_template_decl)
/* There's no need to mangle the name of a template function. */
return;
- if (flag_new_abi)
- {
- DECL_ASSEMBLER_NAME (decl) = mangle_decl (decl);
- return;
- }
-
- if (DECL_EXTERN_C_P (decl))
- {
- /* In extern "C" we have to mangle at least overloaded operators,
- because they contain characters invalid in assembler. */
- enum tree_code code = DECL_OVERLOADED_OPERATOR_P (decl);
- const char *name;
-
- if (code)
- {
- if (DECL_ASSIGNMENT_OPERATOR_P (decl))
- name = assignment_operator_name_info[(int) code].mangled_name;
- else
- name = operator_name_info[(int) code].mangled_name;
- DECL_ASSEMBLER_NAME (decl) = get_identifier (name);
- return;
- }
- }
-
- parm_types = TYPE_ARG_TYPES (TREE_TYPE (decl));
-
- if (DECL_STATIC_FUNCTION_P (decl))
- parm_types =
- hash_tree_chain (build_pointer_type (DECL_CONTEXT (decl)),
- parm_types);
- else
- /* The only member functions whose type is a FUNCTION_TYPE, rather
- than a METHOD_TYPE, should be static members. */
- my_friendly_assert (!DECL_CONTEXT (decl)
- || !IS_AGGR_TYPE_CODE (TREE_CODE (DECL_CONTEXT (decl)))
- || TREE_CODE (TREE_TYPE (decl)) != FUNCTION_TYPE,
- 0);
-
- DECL_ASSEMBLER_NAME (decl)
- = build_decl_overload_real (decl, parm_types, NULL_TREE,
- NULL_TREE, NULL_TREE,
- DECL_FUNCTION_MEMBER_P (decl)
- + DECL_MAYBE_IN_CHARGE_CONSTRUCTOR_P (decl));
-}
-
-/* Build an overload name for the type expression TYPE. */
-
-tree
-build_typename_overload (type)
- tree type;
-{
- tree id;
-
- /* This function is obsoleted by the new ABI. */
- my_friendly_assert (!flag_new_abi, 200004108);
-
- OB_INIT ();
- OB_PUTS (OPERATOR_TYPENAME_FORMAT);
- nofold = 1;
- start_squangling ();
- build_mangled_name (type, 0, 1);
- id = get_identifier (obstack_base (&scratch_obstack));
- IDENTIFIER_OPNAME_P (id) = 1;
- IDENTIFIER_TYPENAME_P (id) = 1;
- TREE_TYPE (id) = type;
- end_squangling ();
- return id;
+ mangle_decl (decl);
}
-tree
-build_overload_with_type (name, type)
- tree name, type;
-{
- /* This function is obsoleted by the new ABI. */
- my_friendly_assert (!flag_new_abi, 200004109);
-
- OB_INIT ();
- OB_PUTID (name);
- nofold = 1;
-
- start_squangling ();
- build_mangled_name (type, 0, 1);
- end_squangling ();
- return get_identifier (obstack_base (&scratch_obstack));
-}
-
-tree
-get_id_2 (name, name2)
- const char *name;
- tree name2;
-{
- /* This function is obsoleted by the new ABI. */
- my_friendly_assert (!flag_new_abi, 20000411);
-
- OB_INIT ();
- OB_PUTCP (name);
- OB_PUTID (name2);
- OB_FINISH ();
- return get_identifier (obstack_base (&scratch_obstack));
-}
-
-/* Returns the name of a construction vtable group. TYPE is the most
- derived class in the hierarhcy. BINFO is the most derived class in
- the construction vtable group. */
-
-tree
-get_ctor_vtbl_name (type, binfo)
- tree type;
- tree binfo;
-{
- /* This function is obsoleted by the new ABI. */
- my_friendly_assert (!flag_new_abi, 200005220);
-
- start_squangling ();
- OB_INIT ();
- OB_PUTCP (CTOR_VTBL_NAME_PREFIX);
- build_mangled_name (type, 0, 0);
- OB_PUTC ('_');
- build_mangled_name (BINFO_TYPE (binfo), 0, 0);
- OB_PUTC ('_');
- build_overload_int (BINFO_OFFSET (binfo), mf_none);
- OB_FINISH ();
- end_squangling ();
- return get_identifier (obstack_base (&scratch_obstack));
-}
-
-/* Returns a DECL_ASSEMBLER_NAME for the destructor of type TYPE. */
-
-tree
-build_destructor_name (type)
- tree type;
-{
- return build_overload_with_type (get_identifier (DESTRUCTOR_DECL_PREFIX),
- type);
-}
/* Given a tree_code CODE, and some arguments (at least one),
attempt to use an overloaded operator on the arguments.
@@ -1995,10 +182,6 @@ hack_identifier (value, name)
#endif
}
}
- if (flag_labels_ok && IDENTIFIER_LABEL_VALUE (name))
- {
- return IDENTIFIER_LABEL_VALUE (name);
- }
return error_mark_node;
}
@@ -2112,14 +295,13 @@ request for member `%D' is ambiguous in multiple inheritance lattice",
/* Return a thunk to FUNCTION. For a virtual thunk, DELTA is the
offset to this used to locate the vptr, and VCALL_INDEX is used to
look up the eventual subobject location. For a non-virtual thunk,
- DELTA is the offset to this and VCALL_INDEX is zero. */
+ DELTA is the offset to this and VCALL_INDEX is NULL. */
tree
-make_thunk (function, delta, vcall_index, generate_with_vtable_p)
+make_thunk (function, delta, vcall_index)
tree function;
tree delta;
tree vcall_index;
- int generate_with_vtable_p;
{
tree thunk_id;
tree thunk;
@@ -2145,31 +327,8 @@ make_thunk (function, delta, vcall_index, generate_with_vtable_p)
if (TREE_CODE (func_decl) != FUNCTION_DECL)
abort ();
- if (flag_new_abi)
- thunk_id = mangle_thunk (TREE_OPERAND (function, 0),
- delta, vcall_offset);
- else
- {
- OB_INIT ();
- OB_PUTS ("__thunk_");
- if (d > 0)
- {
- OB_PUTC ('n');
- icat (d);
- }
- else
- icat (-d);
- OB_PUTC ('_');
- if (vcall_index)
- {
- icat (tree_low_cst (vcall_index, 0));
- OB_PUTC ('_');
- }
- OB_PUTID (DECL_ASSEMBLER_NAME (func_decl));
- OB_FINISH ();
- thunk_id = get_identifier (obstack_base (&scratch_obstack));
- }
-
+ thunk_id = mangle_thunk (TREE_OPERAND (function, 0),
+ delta, vcall_offset);
thunk = IDENTIFIER_GLOBAL_VALUE (thunk_id);
if (thunk && !DECL_THUNK_P (thunk))
{
@@ -2182,25 +341,28 @@ make_thunk (function, delta, vcall_index, generate_with_vtable_p)
thunk = build_decl (FUNCTION_DECL, thunk_id, TREE_TYPE (func_decl));
DECL_LANG_SPECIFIC (thunk) = DECL_LANG_SPECIFIC (func_decl);
copy_lang_decl (func_decl);
+ SET_DECL_ASSEMBLER_NAME (thunk, thunk_id);
DECL_CONTEXT (thunk) = DECL_CONTEXT (func_decl);
TREE_READONLY (thunk) = TREE_READONLY (func_decl);
TREE_THIS_VOLATILE (thunk) = TREE_THIS_VOLATILE (func_decl);
- comdat_linkage (thunk);
+ TREE_PUBLIC (thunk) = TREE_PUBLIC (func_decl);
+ if (flag_weak)
+ comdat_linkage (thunk);
SET_DECL_THUNK_P (thunk);
DECL_INITIAL (thunk) = function;
THUNK_DELTA (thunk) = d;
THUNK_VCALL_OFFSET (thunk) = vcall_offset;
- THUNK_GENERATE_WITH_VTABLE_P (thunk) = generate_with_vtable_p;
/* The thunk itself is not a constructor or destructor, even if
- the thing it is thunking to is. */
+ the thing it is thunking to is. */
DECL_INTERFACE_KNOWN (thunk) = 1;
DECL_NOT_REALLY_EXTERN (thunk) = 1;
DECL_SAVED_FUNCTION_DATA (thunk) = NULL;
DECL_DESTRUCTOR_P (thunk) = 0;
DECL_CONSTRUCTOR_P (thunk) = 0;
+ /* And neither is it a clone. */
+ DECL_CLONED_FUNCTION (thunk) = NULL_TREE;
DECL_EXTERNAL (thunk) = 1;
DECL_ARTIFICIAL (thunk) = 1;
- DECL_VTT_PARM (thunk) = NULL_TREE;
/* Even if this thunk is a member of a local class, we don't
need a static chain. */
DECL_NO_STATIC_CHAIN (thunk) = 1;
@@ -2210,19 +372,18 @@ make_thunk (function, delta, vcall_index, generate_with_vtable_p)
DECL_DEFERRED_FN (thunk) = 0;
/* So that finish_file can write out any thunks that need to be: */
pushdecl_top_level (thunk);
- /* Create RTL for this thunk so that its address can be taken. */
- make_decl_rtl (thunk, NULL);
+ SET_IDENTIFIER_GLOBAL_VALUE (thunk_id, thunk);
}
return thunk;
}
-/* Emit the definition of a C++ multiple inheritance vtable thunk. */
+/* Emit the definition of a C++ multiple inheritance vtable thunk. If
+ EMIT_P is non-zero, the thunk is emitted immediately. */
void
use_thunk (thunk_fndecl, emit_p)
tree thunk_fndecl;
int emit_p;
-
{
tree fnaddr;
tree function;
@@ -2259,6 +420,9 @@ use_thunk (thunk_fndecl, emit_p)
mark_used (thunk_fndecl);
/* This thunk is actually defined. */
DECL_EXTERNAL (thunk_fndecl) = 0;
+ /* The linkage of the function may have changed. FIXME in linkage
+ rewrite. */
+ TREE_PUBLIC (thunk_fndecl) = TREE_PUBLIC (function);
if (flag_syntax_only)
{
@@ -2358,6 +522,11 @@ use_thunk (thunk_fndecl, emit_p)
DECL_INITIAL (thunk_fndecl) = make_node (BLOCK);
BLOCK_VARS (DECL_INITIAL (thunk_fndecl))
= DECL_ARGUMENTS (thunk_fndecl);
+
+ /* Since we want to emit the thunk, we explicitly mark its name as
+ referenced. */
+ TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (thunk_fndecl)) = 1;
+
expand_body (finish_function (0));
}
@@ -2372,11 +541,9 @@ static void
do_build_copy_constructor (fndecl)
tree fndecl;
{
- tree parm = TREE_CHAIN (DECL_ARGUMENTS (fndecl));
+ tree parm = FUNCTION_FIRST_USER_PARM (fndecl);
tree t;
- if (DECL_HAS_IN_CHARGE_PARM_P (fndecl))
- parm = TREE_CHAIN (parm);
parm = convert_from_reference (parm);
if (TYPE_HAS_TRIVIAL_INIT_REF (current_class_type)
@@ -2398,25 +565,31 @@ do_build_copy_constructor (fndecl)
int cvquals = CP_TYPE_QUALS (TREE_TYPE (parm));
int i;
- /* Initialize all the base-classes. */
+ /* Initialize all the base-classes with the parameter converted to
+ their type so that we get their copy constructor and not another
+ constructor that takes current_class_type. */
for (t = CLASSTYPE_VBASECLASSES (current_class_type); t;
t = TREE_CHAIN (t))
- base_init_list
- = tree_cons (BINFO_TYPE (TREE_VALUE (t)), parm,
- base_init_list);
+ {
+ tree type = BINFO_TYPE (TREE_VALUE (t));
+ base_init_list = tree_cons (type, convert_lvalue (type, parm),
+ base_init_list);
+ }
+
for (i = 0; i < n_bases; ++i)
{
t = TREE_VEC_ELT (binfos, i);
if (TREE_VIA_VIRTUAL (t))
continue;
- base_init_list
- = tree_cons (BINFO_TYPE (t), parm, base_init_list);
+ t = BINFO_TYPE (t);
+ base_init_list = tree_cons (t, convert_lvalue (t, parm),
+ base_init_list);
}
for (; fields; fields = TREE_CHAIN (fields))
{
- tree init, t;
+ tree init;
tree field = fields;
if (TREE_CODE (field) != FIELD_DECL)
@@ -2486,12 +659,7 @@ do_build_assign_ref (fndecl)
for (i = 0; i < n_bases; ++i)
{
tree basetype = BINFO_TYPE (TREE_VEC_ELT (binfos, i));
- tree p = build_qualified_type (basetype, cvquals);
-
- p = convert_to_reference
- (build_reference_type (p), parm,
- CONV_IMPLICIT, LOOKUP_COMPLAIN, NULL_TREE);
- p = convert_from_reference (p);
+ tree p = convert_lvalue (basetype, parm);
p = build_member_call (basetype, ansi_assopname (NOP_EXPR),
build_tree_list (NULL_TREE, p));
finish_expr_stmt (p);
@@ -2542,7 +710,11 @@ do_build_assign_ref (fndecl)
build_qualified_type (TREE_TYPE (field), cvquals),
init, field);
- finish_expr_stmt (build_modify_expr (comp, NOP_EXPR, init));
+ if (DECL_NAME (field))
+ finish_expr_stmt (build_modify_expr (comp, NOP_EXPR, init));
+ else
+ finish_expr_stmt (build (MODIFY_EXPR, TREE_TYPE (comp), comp,
+ init));
}
}
finish_return_stmt (current_class_ref);
@@ -2596,9 +768,7 @@ synthesize_method (fndecl)
setup_vtbl_ptr (NULL_TREE, NULL_TREE);
else
{
- tree arg_chain = FUNCTION_ARG_CHAIN (fndecl);
- if (DECL_HAS_IN_CHARGE_PARM_P (fndecl))
- arg_chain = TREE_CHAIN (arg_chain);
+ tree arg_chain = FUNCTION_FIRST_USER_PARMTYPE (fndecl);
if (arg_chain != void_list_node)
do_build_copy_constructor (fndecl);
else if (TYPE_NEEDS_CONSTRUCTING (current_class_type))
@@ -2794,8 +964,8 @@ implicitly_declare_fn (kind, type, const_p)
tree declspecs = NULL_TREE;
tree fn, args = NULL_TREE;
tree raises = empty_except_spec;
- tree argtype;
int retref = 0;
+ int has_parm = 0;
tree name = constructor_name (TYPE_IDENTIFIER (type));
switch (kind)
@@ -2814,40 +984,33 @@ implicitly_declare_fn (kind, type, const_p)
break;
case sfk_copy_constructor:
- {
- struct copy_data data;
-
- if (const_p)
- type = build_qualified_type (type, TYPE_QUAL_CONST);
- argtype = build_reference_type (type);
- args = tree_cons (NULL_TREE,
- build_tree_list (hash_tree_chain (argtype, NULL_TREE),
- get_identifier ("_ctor_arg")),
- void_list_node);
- data.name = NULL;
- data.quals = const_p ? TYPE_QUAL_CONST : 0;
- raises = synthesize_exception_spec (type, &locate_copy, &data);
- break;
- }
case sfk_assignment_operator:
{
struct copy_data data;
+ tree argtype;
- retref = 1;
- declspecs = build_tree_list (NULL_TREE, type);
+ has_parm = 1;
+ data.name = NULL;
+ data.quals = 0;
+ if (kind == sfk_assignment_operator)
+ {
+ retref = 1;
+ declspecs = build_tree_list (NULL_TREE, type);
+ name = ansi_assopname (NOP_EXPR);
+ data.name = name;
+ }
if (const_p)
- type = build_qualified_type (type, TYPE_QUAL_CONST);
-
- name = ansi_assopname (NOP_EXPR);
-
+ {
+ data.quals = TYPE_QUAL_CONST;
+ type = build_qualified_type (type, TYPE_QUAL_CONST);
+ }
+
argtype = build_reference_type (type);
- args = tree_cons (NULL_TREE,
- build_tree_list (hash_tree_chain (argtype, NULL_TREE),
- get_identifier ("_ctor_arg")),
- void_list_node);
- data.name = name;
- data.quals = const_p ? TYPE_QUAL_CONST : 0;
+ args = build_tree_list (hash_tree_chain (argtype, NULL_TREE),
+ get_identifier ("_ctor_arg"));
+ args = tree_cons (NULL_TREE, args, void_list_node);
+
raises = synthesize_exception_spec (type, &locate_copy, &data);
break;
}
@@ -2859,21 +1022,41 @@ implicitly_declare_fn (kind, type, const_p)
{
tree declarator = make_call_declarator (name, args, NULL_TREE, raises);
+
if (retref)
declarator = build_nt (ADDR_EXPR, declarator);
fn = grokfield (declarator, declspecs, NULL_TREE, NULL_TREE, NULL_TREE);
+ if (has_parm)
+ TREE_USED (FUNCTION_FIRST_USER_PARM (fn)) = 1;
}
my_friendly_assert (TREE_CODE (fn) == FUNCTION_DECL, 20000408);
- if (kind != sfk_constructor && kind != sfk_destructor)
- DECL_ARTIFICIAL (TREE_CHAIN (DECL_ARGUMENTS (fn))) = 1;
DECL_ARTIFICIAL (fn) = 1;
DECL_NOT_REALLY_EXTERN (fn) = 1;
- DECL_THIS_INLINE (fn) = 1;
+ DECL_DECLARED_INLINE_P (fn) = 1;
DECL_INLINE (fn) = 1;
defer_fn (fn);
return fn;
}
+
+/* Given a FUNCTION_DECL FN and a chain LIST, skip as many elements of LIST
+ as there are artificial parms in FN. */
+
+tree
+skip_artificial_parms_for (fn, list)
+ tree fn, list;
+{
+ if (DECL_NONSTATIC_MEMBER_FUNCTION_P (fn))
+ list = TREE_CHAIN (list);
+ else
+ return list;
+
+ if (DECL_HAS_IN_CHARGE_PARM_P (fn))
+ list = TREE_CHAIN (list);
+ if (DECL_HAS_VTT_PARM_P (fn))
+ list = TREE_CHAIN (list);
+ return list;
+}
diff --git a/gcc/cp/operators.def b/gcc/cp/operators.def
index 2fbb42121bb..8e0f7b2478e 100644
--- a/gcc/cp/operators.def
+++ b/gcc/cp/operators.def
@@ -5,7 +5,7 @@
non-overloadable operators (like the `?:' ternary operator).
Writtey by Mark Mitchell <mark@codesourcery.com>
- Copyright (C) 2000 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2001 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -71,84 +71,87 @@ Boston, MA 02111-1307, USA. */
arguments are as for DEF_OPERATOR, but there is no need to provide
an ASSIGNMENT_P argument; it is always zero. */
-#define DEF_SIMPLE_OPERATOR(NAME, CODE, NEW_MANGLING, OLD_MANGLING, ARITY) \
- DEF_OPERATOR(NAME, CODE, NEW_MANGLING, OLD_MANGLING, ARITY, 0)
+#define DEF_SIMPLE_OPERATOR(NAME, CODE, MANGLING, ARITY) \
+ DEF_OPERATOR(NAME, CODE, MANGLING, ARITY, 0)
/* Use DEF_ASSN_OPERATOR to define an assignment operator. Its
arguments are as for DEF_OPERATOR, but there is no need to provide
an ASSIGNMENT_P argument; it is always one. */
-#define DEF_ASSN_OPERATOR(NAME, CODE, NEW_MANGLING, OLD_MANGLING, ARITY) \
- DEF_OPERATOR(NAME, CODE, NEW_MANGLING, OLD_MANGLING, ARITY, 1)
+#define DEF_ASSN_OPERATOR(NAME, CODE, MANGLING, ARITY) \
+ DEF_OPERATOR(NAME, CODE, MANGLING, ARITY, 1)
/* Memory allocation operators. */
-DEF_SIMPLE_OPERATOR ("new", NEW_EXPR, "nw", "__nw", -1)
-DEF_SIMPLE_OPERATOR ("new []", VEC_NEW_EXPR, "na", "__vn", -1)
-DEF_SIMPLE_OPERATOR ("delete", DELETE_EXPR, "dl", "__dl", -1)
-DEF_SIMPLE_OPERATOR ("delete []", VEC_DELETE_EXPR, "da", "__vd", -1)
+DEF_SIMPLE_OPERATOR ("new", NEW_EXPR, "nw", -1)
+DEF_SIMPLE_OPERATOR ("new []", VEC_NEW_EXPR, "na", -1)
+DEF_SIMPLE_OPERATOR ("delete", DELETE_EXPR, "dl", -1)
+DEF_SIMPLE_OPERATOR ("delete []", VEC_DELETE_EXPR, "da", -1)
/* Unary operators. */
-DEF_SIMPLE_OPERATOR ("+", CONVERT_EXPR, "ps", "__pl", 1)
-DEF_SIMPLE_OPERATOR ("-", NEGATE_EXPR, "ng", "__mi", 1)
-DEF_SIMPLE_OPERATOR ("&", ADDR_EXPR, "ad", "__ad", 1)
-DEF_SIMPLE_OPERATOR ("*", INDIRECT_REF, "de", "__ml", 1)
-DEF_SIMPLE_OPERATOR ("~", BIT_NOT_EXPR, "co", "__co", 1)
-DEF_SIMPLE_OPERATOR ("!", TRUTH_NOT_EXPR, "nt", "__nt", 1)
-DEF_SIMPLE_OPERATOR ("++", PREINCREMENT_EXPR, "pp", "__pp", 1)
-DEF_SIMPLE_OPERATOR ("--", PREDECREMENT_EXPR, "mm", "__mm", 1)
-DEF_SIMPLE_OPERATOR ("sizeof", SIZEOF_EXPR, "sz", "__sz", 1)
+DEF_SIMPLE_OPERATOR ("+", CONVERT_EXPR, "ps", 1)
+DEF_SIMPLE_OPERATOR ("-", NEGATE_EXPR, "ng", 1)
+DEF_SIMPLE_OPERATOR ("&", ADDR_EXPR, "ad", 1)
+DEF_SIMPLE_OPERATOR ("*", INDIRECT_REF, "de", 1)
+DEF_SIMPLE_OPERATOR ("~", BIT_NOT_EXPR, "co", 1)
+DEF_SIMPLE_OPERATOR ("!", TRUTH_NOT_EXPR, "nt", 1)
+DEF_SIMPLE_OPERATOR ("++", PREINCREMENT_EXPR, "pp", 1)
+DEF_SIMPLE_OPERATOR ("--", PREDECREMENT_EXPR, "mm", 1)
+DEF_SIMPLE_OPERATOR ("sizeof", SIZEOF_EXPR, "sz", 1)
/* This is an extension. */
-DEF_SIMPLE_OPERATOR ("alignof", ALIGNOF_EXPR, "v17alignof", "__al", 1)
+DEF_SIMPLE_OPERATOR ("alignof", ALIGNOF_EXPR, "v17alignof", 1)
/* The cast operator. */
-DEF_SIMPLE_OPERATOR ("", TYPE_EXPR, "cv", OPERATOR_TYPENAME_FORMAT, 1)
+DEF_SIMPLE_OPERATOR ("", TYPE_EXPR, "cv", 1)
+DEF_SIMPLE_OPERATOR ("", CAST_EXPR, "cv", 1)
+DEF_SIMPLE_OPERATOR ("", CONST_CAST_EXPR, "cv", 1)
+DEF_SIMPLE_OPERATOR ("", STATIC_CAST_EXPR, "cv", 1)
/* Binary operators. */
-DEF_SIMPLE_OPERATOR ("+", PLUS_EXPR, "pl", "__pl", 2)
-DEF_SIMPLE_OPERATOR ("-", MINUS_EXPR, "mi", "__mi", 2)
-DEF_SIMPLE_OPERATOR ("*", MULT_EXPR, "ml", "__ml", 2)
-DEF_SIMPLE_OPERATOR ("/", TRUNC_DIV_EXPR, "dv", "__dv", 2)
-DEF_SIMPLE_OPERATOR ("%", TRUNC_MOD_EXPR, "rm", "__md", 2)
-DEF_SIMPLE_OPERATOR ("&", BIT_AND_EXPR, "an", "__ad", 2)
-DEF_SIMPLE_OPERATOR ("|", BIT_IOR_EXPR, "or", "__or", 2)
-DEF_SIMPLE_OPERATOR ("^", BIT_XOR_EXPR, "eo", "__er", 2)
-DEF_SIMPLE_OPERATOR ("<<", LSHIFT_EXPR, "ls", "__ls", 2)
-DEF_SIMPLE_OPERATOR (">>", RSHIFT_EXPR, "rs", "__rs", 2)
-DEF_SIMPLE_OPERATOR ("==", EQ_EXPR, "eq", "__eq", 2)
-DEF_SIMPLE_OPERATOR ("!=", NE_EXPR, "ne", "__ne", 2)
-DEF_SIMPLE_OPERATOR ("<", LT_EXPR, "lt", "__lt", 2)
-DEF_SIMPLE_OPERATOR (">", GT_EXPR, "gt", "__gt", 2)
-DEF_SIMPLE_OPERATOR ("<=", LE_EXPR, "le", "__le", 2)
-DEF_SIMPLE_OPERATOR (">=", GE_EXPR, "ge", "__ge", 2)
-DEF_SIMPLE_OPERATOR ("&&", TRUTH_ANDIF_EXPR, "aa", "__aa", 2)
-DEF_SIMPLE_OPERATOR ("||", TRUTH_ORIF_EXPR, "oo", "__oo", 2)
-DEF_SIMPLE_OPERATOR (",", COMPOUND_EXPR, "cm", "__cm", 2)
-DEF_SIMPLE_OPERATOR ("->*", MEMBER_REF, "pm", "__rm", 2)
-DEF_SIMPLE_OPERATOR ("->", COMPONENT_REF, "pt", "__rf", 2)
-DEF_SIMPLE_OPERATOR ("[]", ARRAY_REF, "ix", "__vc", 2)
-DEF_SIMPLE_OPERATOR ("++", POSTINCREMENT_EXPR, "pp", "__pp", 2)
-DEF_SIMPLE_OPERATOR ("--", POSTDECREMENT_EXPR, "mm", "__mm", 2)
+DEF_SIMPLE_OPERATOR ("+", PLUS_EXPR, "pl", 2)
+DEF_SIMPLE_OPERATOR ("-", MINUS_EXPR, "mi", 2)
+DEF_SIMPLE_OPERATOR ("*", MULT_EXPR, "ml", 2)
+DEF_SIMPLE_OPERATOR ("/", TRUNC_DIV_EXPR, "dv", 2)
+DEF_SIMPLE_OPERATOR ("%", TRUNC_MOD_EXPR, "rm", 2)
+DEF_SIMPLE_OPERATOR ("&", BIT_AND_EXPR, "an", 2)
+DEF_SIMPLE_OPERATOR ("|", BIT_IOR_EXPR, "or", 2)
+DEF_SIMPLE_OPERATOR ("^", BIT_XOR_EXPR, "eo", 2)
+DEF_SIMPLE_OPERATOR ("<<", LSHIFT_EXPR, "ls", 2)
+DEF_SIMPLE_OPERATOR (">>", RSHIFT_EXPR, "rs", 2)
+DEF_SIMPLE_OPERATOR ("==", EQ_EXPR, "eq", 2)
+DEF_SIMPLE_OPERATOR ("!=", NE_EXPR, "ne", 2)
+DEF_SIMPLE_OPERATOR ("<", LT_EXPR, "lt", 2)
+DEF_SIMPLE_OPERATOR (">", GT_EXPR, "gt", 2)
+DEF_SIMPLE_OPERATOR ("<=", LE_EXPR, "le", 2)
+DEF_SIMPLE_OPERATOR (">=", GE_EXPR, "ge", 2)
+DEF_SIMPLE_OPERATOR ("&&", TRUTH_ANDIF_EXPR, "aa", 2)
+DEF_SIMPLE_OPERATOR ("||", TRUTH_ORIF_EXPR, "oo", 2)
+DEF_SIMPLE_OPERATOR (",", COMPOUND_EXPR, "cm", 2)
+DEF_SIMPLE_OPERATOR ("->*", MEMBER_REF, "pm", 2)
+DEF_SIMPLE_OPERATOR ("->", COMPONENT_REF, "pt", 2)
+DEF_SIMPLE_OPERATOR ("[]", ARRAY_REF, "ix", 2)
+DEF_SIMPLE_OPERATOR ("++", POSTINCREMENT_EXPR, "pp", 2)
+DEF_SIMPLE_OPERATOR ("--", POSTDECREMENT_EXPR, "mm", 2)
/* These are extensions. */
-DEF_SIMPLE_OPERATOR ("<?", MIN_EXPR, "v23min", "__mn", 2)
-DEF_SIMPLE_OPERATOR (">?", MAX_EXPR, "v23max", "__mx", 2)
+DEF_SIMPLE_OPERATOR ("<?", MIN_EXPR, "v23min", 2)
+DEF_SIMPLE_OPERATOR (">?", MAX_EXPR, "v23max", 2)
/* This one is needed for mangling. */
-DEF_SIMPLE_OPERATOR ("::", SCOPE_REF, "sr", NULL, 2);
+DEF_SIMPLE_OPERATOR ("::", SCOPE_REF, "sr", 2);
/* Assignment operators. */
-DEF_ASSN_OPERATOR ("=", NOP_EXPR, "aS", "__as", 2)
-DEF_ASSN_OPERATOR ("+=", PLUS_EXPR, "pL", "__apl", 2)
-DEF_ASSN_OPERATOR ("-=", MINUS_EXPR, "mI", "__ami", 2)
-DEF_ASSN_OPERATOR ("*=", MULT_EXPR, "mL", "__aml", 2)
-DEF_ASSN_OPERATOR ("/=", TRUNC_DIV_EXPR, "dV", "__adv", 2)
-DEF_ASSN_OPERATOR ("%=", TRUNC_MOD_EXPR, "rM", "__amd", 2)
-DEF_ASSN_OPERATOR ("&=", BIT_AND_EXPR, "aN", "__aad", 2)
-DEF_ASSN_OPERATOR ("|=", BIT_IOR_EXPR, "oR", "__aor", 2)
-DEF_ASSN_OPERATOR ("^=", BIT_XOR_EXPR, "eO", "__aer", 2)
-DEF_ASSN_OPERATOR ("<<=", LSHIFT_EXPR, "lS", "__als", 2)
-DEF_ASSN_OPERATOR (">>=", RSHIFT_EXPR, "rS", "__ars", 2)
+DEF_ASSN_OPERATOR ("=", NOP_EXPR, "aS", 2)
+DEF_ASSN_OPERATOR ("+=", PLUS_EXPR, "pL", 2)
+DEF_ASSN_OPERATOR ("-=", MINUS_EXPR, "mI", 2)
+DEF_ASSN_OPERATOR ("*=", MULT_EXPR, "mL", 2)
+DEF_ASSN_OPERATOR ("/=", TRUNC_DIV_EXPR, "dV", 2)
+DEF_ASSN_OPERATOR ("%=", TRUNC_MOD_EXPR, "rM", 2)
+DEF_ASSN_OPERATOR ("&=", BIT_AND_EXPR, "aN", 2)
+DEF_ASSN_OPERATOR ("|=", BIT_IOR_EXPR, "oR", 2)
+DEF_ASSN_OPERATOR ("^=", BIT_XOR_EXPR, "eO", 2)
+DEF_ASSN_OPERATOR ("<<=", LSHIFT_EXPR, "lS", 2)
+DEF_ASSN_OPERATOR (">>=", RSHIFT_EXPR, "rS", 2)
/* Ternary operators. */
-DEF_SIMPLE_OPERATOR ("?:", COND_EXPR, "qu", "__cn", 3)
+DEF_SIMPLE_OPERATOR ("?:", COND_EXPR, "qu", 3)
/* Miscellaneous. */
-DEF_SIMPLE_OPERATOR ("()", CALL_EXPR, "cl", "__cl", -1)
+DEF_SIMPLE_OPERATOR ("()", CALL_EXPR, "cl", -1)
diff --git a/gcc/cp/optimize.c b/gcc/cp/optimize.c
index 16d3a4798d6..76a57d06c90 100644
--- a/gcc/cp/optimize.c
+++ b/gcc/cp/optimize.c
@@ -1,5 +1,5 @@
/* Perform optimizations on tree structure.
- Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
Written by Mark Michell (mark@codesourcery.com).
This file is part of GNU CC.
@@ -13,7 +13,7 @@ GNU CC is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
-
+
You should have received a copy of the GNU General Public License
along with GNU CC; see the file COPYING. If not, write to the Free
Software Foundation, 59 Temple Place - Suite 330, Boston, MA
@@ -27,7 +27,11 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "insn-config.h"
#include "input.h"
#include "integrate.h"
+#include "toplev.h"
#include "varray.h"
+#include "ggc.h"
+#include "params.h"
+#include "hashtab.h"
/* To Do:
@@ -37,7 +41,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
function-local static constants just like global static
constants; the back-end already knows not to output them if they
are not needed.
-
+
o Provide heuristics to clamp inlining of recursive template
calls? */
@@ -48,8 +52,13 @@ typedef struct inline_data
/* A stack of the functions we are inlining. For example, if we are
compiling `f', which calls `g', which calls `h', and we are
inlining the body of `h', the stack will contain, `h', followed
- by `g', followed by `f'. */
+ by `g', followed by `f'. The first few elements of the stack may
+ contain other functions that we know we should not recurse into,
+ even though they are not directly being inlined. */
varray_type fns;
+ /* The index of the first element of FNS that really represents an
+ inlined function. */
+ unsigned first_inlined_fn;
/* The label to jump to when a return statement is encountered. If
this value is NULL, then return statements will simply be
remapped as return statements, rather than as jumps. */
@@ -62,6 +71,19 @@ typedef struct inline_data
int in_target_cleanup_p;
/* A stack of the TARGET_EXPRs that we are currently processing. */
varray_type target_exprs;
+ /* A list of the functions current function has inlined. */
+ varray_type inlined_fns;
+ /* The approximate number of statements we have inlined in the
+ current call stack. */
+ int inlined_stmts;
+ /* We use the same mechanism to build clones that we do to perform
+ inlining. However, there are a few places where we need to
+ distinguish between those two situations. This flag is true nif
+ we are cloning, rather than inlining. */
+ bool cloning_p;
+ /* Hash table used to prevent walk_tree from visiting the same node
+ umpteen million times. */
+ htab_t tree_pruner;
} inline_data;
/* Prototypes. */
@@ -77,9 +99,15 @@ static tree remap_decl PARAMS ((tree, inline_data *));
static void remap_block PARAMS ((tree, tree, inline_data *));
static void copy_scope_stmt PARAMS ((tree *, int *, inline_data *));
static tree calls_setjmp_r PARAMS ((tree *, int *, void *));
+static void update_cloned_parm PARAMS ((tree, tree));
+static void dump_function PARAMS ((enum tree_dump_index, tree));
+
+/* The approximate number of instructions per statement. This number
+ need not be particularly accurate; it is used only to make
+ decisions about when a function is too big to inline. */
+#define INSNS_PER_STMT (10)
-/* Remap DECL during the copying of the BLOCK tree for the function.
- DATA is really an `inline_data *'. */
+/* Remap DECL during the copying of the BLOCK tree for the function. */
static tree
remap_decl (decl, id)
@@ -101,9 +129,9 @@ remap_decl (decl, id)
if (!n)
{
tree t;
-
+
/* Make a copy of the variable or label. */
- t = copy_decl_for_inlining (decl, fn,
+ t = copy_decl_for_inlining (decl, fn,
VARRAY_TREE (id->fns, 0));
/* The decl T could be a dynamic array or other variable size type,
@@ -115,19 +143,39 @@ remap_decl (decl, id)
&& TYPE_DOMAIN (TREE_TYPE (t)))
{
TREE_TYPE (t) = copy_node (TREE_TYPE (t));
- TYPE_DOMAIN (TREE_TYPE (t))
+ TYPE_DOMAIN (TREE_TYPE (t))
= copy_node (TYPE_DOMAIN (TREE_TYPE (t)));
walk_tree (&TYPE_MAX_VALUE (TYPE_DOMAIN (TREE_TYPE (t))),
copy_body_r, id, NULL);
}
+ if (!DECL_NAME (t) && TREE_TYPE (t)
+ && ANON_AGGR_TYPE_P (TREE_TYPE ((t))))
+ {
+ /* For a VAR_DECL of anonymous type, we must also copy the
+ member VAR_DECLS here and rechain the
+ DECL_ANON_UNION_ELEMS. */
+ tree members = NULL;
+ tree src;
+
+ for (src = DECL_ANON_UNION_ELEMS (t); src;
+ src = TREE_CHAIN (src))
+ {
+ tree member = remap_decl (TREE_VALUE (src), id);
+
+ my_friendly_assert (!TREE_PURPOSE (src), 20010529);
+ members = tree_cons (NULL, member, members);
+ }
+ DECL_ANON_UNION_ELEMS (t) = nreverse (members);
+ }
+
/* Remember it, so that if we encounter this local entity
again we can reuse this copy. */
- n = splay_tree_insert (id->decl_map,
- (splay_tree_key) decl,
+ n = splay_tree_insert (id->decl_map,
+ (splay_tree_key) decl,
(splay_tree_value) t);
}
-
+
return (tree) n->value;
}
@@ -161,7 +209,6 @@ remap_block (scope_stmt, decls, id)
tree old_block;
tree new_block;
tree old_var;
- tree *first_block;
tree fn;
/* Make the new block. */
@@ -172,8 +219,8 @@ remap_block (scope_stmt, decls, id)
SCOPE_STMT_BLOCK (scope_stmt) = new_block;
/* Remap its variables. */
- for (old_var = decls ? decls : BLOCK_VARS (old_block);
- old_var;
+ for (old_var = decls ? decls : BLOCK_VARS (old_block);
+ old_var;
old_var = TREE_CHAIN (old_var))
{
tree new_var;
@@ -195,16 +242,25 @@ remap_block (scope_stmt, decls, id)
}
/* We put the BLOCK_VARS in reverse order; fix that now. */
BLOCK_VARS (new_block) = nreverse (BLOCK_VARS (new_block));
- /* Attach this new block after the DECL_INITIAL block for the
- function into which this block is being inlined. In
- rest_of_compilation we will straighten out the BLOCK tree. */
fn = VARRAY_TREE (id->fns, 0);
- if (DECL_INITIAL (fn))
- first_block = &BLOCK_CHAIN (DECL_INITIAL (fn));
+ if (id->cloning_p)
+ /* We're building a clone; DECL_INITIAL is still
+ error_mark_node, and current_binding_level is the parm
+ binding level. */
+ insert_block (new_block);
else
- first_block = &DECL_INITIAL (fn);
- BLOCK_CHAIN (new_block) = *first_block;
- *first_block = new_block;
+ {
+ /* Attach this new block after the DECL_INITIAL block for the
+ function into which this block is being inlined. In
+ rest_of_compilation we will straighten out the BLOCK tree. */
+ tree *first_block;
+ if (DECL_INITIAL (fn))
+ first_block = &BLOCK_CHAIN (DECL_INITIAL (fn));
+ else
+ first_block = &DECL_INITIAL (fn);
+ BLOCK_CHAIN (new_block) = *first_block;
+ *first_block = new_block;
+ }
/* Remember the remapped block. */
splay_tree_insert (id->decl_map,
(splay_tree_key) old_block,
@@ -217,7 +273,7 @@ remap_block (scope_stmt, decls, id)
splay_tree_node n;
/* Find this block in the table of remapped things. */
- n = splay_tree_lookup (id->decl_map,
+ n = splay_tree_lookup (id->decl_map,
(splay_tree_key) SCOPE_STMT_BLOCK (scope_stmt));
my_friendly_assert (n != NULL, 19991203);
SCOPE_STMT_BLOCK (scope_stmt) = (tree) n->value;
@@ -283,11 +339,11 @@ copy_body_r (tp, walk_subtrees, data)
TREE_CHAIN (goto_stmt) = TREE_CHAIN (return_stmt);
/* If we're returning something, just turn that into an
- assignment into the equivalent of the original
+ assignment into the equivalent of the original
RESULT_DECL. */
if (RETURN_EXPR (return_stmt))
{
- *tp = build_stmt (EXPR_STMT,
+ *tp = build_stmt (EXPR_STMT,
RETURN_EXPR (return_stmt));
STMT_IS_FULL_EXPR_P (*tp) = 1;
/* And then jump to the end of the function. */
@@ -312,11 +368,11 @@ copy_body_r (tp, walk_subtrees, data)
STRIP_TYPE_NOPS (new_decl);
*tp = new_decl;
}
- else if (nonstatic_local_decl_p (*tp)
+ else if (nonstatic_local_decl_p (*tp)
&& DECL_CONTEXT (*tp) != VARRAY_TREE (id->fns, 0))
my_friendly_abort (0);
else if (TREE_CODE (*tp) == SAVE_EXPR)
- remap_save_expr (tp, id->decl_map, VARRAY_TREE (id->fns, 0),
+ remap_save_expr (tp, id->decl_map, VARRAY_TREE (id->fns, 0),
walk_subtrees);
else if (TREE_CODE (*tp) == UNSAVE_EXPR)
/* UNSAVE_EXPRs should not be generated until expansion time. */
@@ -406,19 +462,19 @@ initialize_inlined_parameters (id, args, fn)
tree init_stmt;
tree var;
tree value;
-
+
/* Find the initializer. */
value = TREE_VALUE (a);
/* If the parameter is never assigned to, we may not need to
create a new variable here at all. Instead, we may be able
to just use the argument value. */
- if (TREE_READONLY (p)
+ if (TREE_READONLY (p)
&& !TREE_ADDRESSABLE (p)
&& !TREE_SIDE_EFFECTS (value))
{
/* Simplify the value, if possible. */
value = fold (decl_constant_value (value));
-
+
/* We can't risk substituting complex expressions. They
might contain variables that will be assigned to later.
Theoretically, we could check the expression to see if
@@ -438,13 +494,13 @@ initialize_inlined_parameters (id, args, fn)
continue;
}
}
-
+
/* Make an equivalent VAR_DECL. */
var = copy_decl_for_inlining (p, fn, VARRAY_TREE (id->fns, 0));
/* Register the VAR_DECL as the equivalent for the PARM_DECL;
that way, when the PARM_DECL is encountered, it will be
automatically replaced by the VAR_DECL. */
- splay_tree_insert (id->decl_map,
+ splay_tree_insert (id->decl_map,
(splay_tree_key) p,
(splay_tree_value) var);
@@ -462,6 +518,18 @@ initialize_inlined_parameters (id, args, fn)
DECL_INITIAL (var) = value;
else
{
+ /* Even if P was TREE_READONLY, the new VAR should not be.
+ In the original code, we would have constructed a
+ temporary, and then the function body would have never
+ changed the value of P. However, now, we will be
+ constructing VAR directly. The constructor body may
+ change its value multiple times as it is being
+ constructed. Therefore, it must not be TREE_READONLY;
+ the back-end assumes that TREE_READONLY variable is
+ assigned to only once. */
+ TREE_READONLY (var) = 0;
+
+ /* Build a run-time initialization. */
init_stmt = build_stmt (EXPR_STMT,
build (INIT_EXPR, TREE_TYPE (p),
var, value));
@@ -513,11 +581,11 @@ declare_return_variable (id, use_stmt)
references to the RESULT into references to the target. */
if (aggregate_return_p)
{
- my_friendly_assert (id->target_exprs->elements_used != 0,
+ my_friendly_assert (VARRAY_ACTIVE_SIZE (id->target_exprs) != 0,
20000430);
var = TREE_OPERAND (VARRAY_TOP_TREE (id->target_exprs), 0);
- my_friendly_assert
- (same_type_ignoring_top_level_qualifiers_p (TREE_TYPE (var),
+ my_friendly_assert
+ (same_type_ignoring_top_level_qualifiers_p (TREE_TYPE (var),
TREE_TYPE (result)),
20000430);
}
@@ -528,7 +596,7 @@ declare_return_variable (id, use_stmt)
/* Register the VAR_DECL as the equivalent for the RESULT_DECL; that
way, when the RESULT_DECL is encountered, it will be
automatically replaced by the VAR_DECL. */
- splay_tree_insert (id->decl_map,
+ splay_tree_insert (id->decl_map,
(splay_tree_key) result,
(splay_tree_value) var);
@@ -572,6 +640,10 @@ inlinable_function_p (fn, id)
/* We can't inline varargs functions. */
else if (varargs_function_p (fn))
;
+ /* We can't inline functions that are too big.
+ * Only allow a single function to eat up half of our budget. */
+ else if (DECL_NUM_STMTS (fn) * INSNS_PER_STMT > MAX_INLINE_INSNS / 2)
+ ;
/* All is well. We can inline this function. Traditionally, GCC
has refused to inline functions using alloca, or functions whose
values are returned in a PARALLEL, and a few other such obscure
@@ -582,10 +654,18 @@ inlinable_function_p (fn, id)
/* Squirrel away the result so that we don't have to check again. */
DECL_UNINLINABLE (fn) = !inlinable;
+ /* Even if this function is not itself too big to inline, it might
+ be that we've done so much inlining already that we don't want to
+ risk too much inlining any more and thus halve the acceptable size. */
+ if ((DECL_NUM_STMTS (fn) + id->inlined_stmts) * INSNS_PER_STMT
+ > MAX_INLINE_INSNS
+ && DECL_NUM_STMTS (fn) * INSNS_PER_STMT > MAX_INLINE_INSNS / 4)
+ inlinable = 0;
+
/* We can inline a template instantiation only if it's fully
instantiated. */
- if (inlinable
- && DECL_TEMPLATE_INFO (fn)
+ if (inlinable
+ && DECL_TEMPLATE_INFO (fn)
&& TI_PENDING_TEMPLATE_FLAG (DECL_TEMPLATE_INFO (fn)))
{
fn = instantiate_decl (fn, /*defer_ok=*/0);
@@ -598,14 +678,24 @@ inlinable_function_p (fn, id)
inlinable = 0;
/* Don't do recursive inlining, either. We don't record this in
- DECL_UNLINABLE; we may be able to inline this function later. */
+ DECL_UNINLINABLE; we may be able to inline this function later. */
if (inlinable)
{
size_t i;
- for (i = 0; i < id->fns->elements_used; ++i)
+ for (i = 0; i < VARRAY_ACTIVE_SIZE (id->fns); ++i)
if (VARRAY_TREE (id->fns, i) == fn)
- inlinable = 0;
+ return 0;
+
+ if (inlinable && DECL_LANG_SPECIFIC (fn) && DECL_INLINED_FNS (fn))
+ {
+ int j;
+ tree inlined_fns = DECL_INLINED_FNS (fn);
+
+ for (j = 0; j < TREE_VEC_LENGTH (inlined_fns); ++j)
+ if (TREE_VEC_ELT (inlined_fns, j) == VARRAY_TREE (id->fns, 0))
+ return 0;
+ }
}
/* Return the result. */
@@ -633,7 +723,7 @@ expand_call_inline (tp, walk_subtrees, data)
/* See what we've got. */
id = (inline_data *) data;
- t = *tp;
+ t = *tp;
/* Recurse, but letting recursive invocations know that we are
inside the body of a TARGET_EXPR. */
@@ -655,7 +745,7 @@ expand_call_inline (tp, walk_subtrees, data)
if (i == 2)
++id->in_target_cleanup_p;
walk_tree (&TREE_OPERAND (*tp, i), expand_call_inline, data,
- NULL);
+ id->tree_pruner);
if (i == 2)
--id->in_target_cleanup_p;
}
@@ -666,6 +756,12 @@ expand_call_inline (tp, walk_subtrees, data)
return NULL_TREE;
}
+ if (TREE_CODE_CLASS (TREE_CODE (t)) == 't')
+ /* Because types were not copied in copy_body, CALL_EXPRs beneath
+ them should not be expanded. This can happen if the type is a
+ dynamic array type, for example. */
+ *walk_subtrees = 0;
+
/* From here on, we're only interested in CALL_EXPRs. */
if (TREE_CODE (t) != CALL_EXPR)
return NULL_TREE;
@@ -681,6 +777,10 @@ expand_call_inline (tp, walk_subtrees, data)
if (!inlinable_function_p (fn, id))
return NULL_TREE;
+ if (DECL_TEMPLATE_INSTANTIATION (fn)
+ && ! push_tinst_level (fn))
+ return NULL_TREE;
+
/* Set the current filename and line number to the function we are
inlining so that when we create new _STMT nodes here they get
line numbers corresponding to the function we are calling. We
@@ -715,6 +815,19 @@ expand_call_inline (tp, walk_subtrees, data)
recursing into it. */
VARRAY_PUSH_TREE (id->fns, fn);
+ /* Record the function we are about to inline if optimize_function
+ has not been called on it yet and we don't have it in the list. */
+ if (DECL_LANG_SPECIFIC (fn) && !DECL_INLINED_FNS (fn))
+ {
+ int i;
+
+ for (i = VARRAY_ACTIVE_SIZE (id->inlined_fns) - 1; i >= 0; i--)
+ if (VARRAY_TREE (id->inlined_fns, i) == fn)
+ break;
+ if (i < 0)
+ VARRAY_PUSH_TREE (id->inlined_fns, fn);
+ }
+
/* Return statements in the function body will be replaced by jumps
to the RET_LABEL. */
id->ret_label = build_decl (LABEL_DECL, NULL_TREE, NULL_TREE);
@@ -737,9 +850,9 @@ expand_call_inline (tp, walk_subtrees, data)
/* Declare the return variable for the function. */
STMT_EXPR_STMT (expr)
- = chainon (STMT_EXPR_STMT (expr),
+ = chainon (STMT_EXPR_STMT (expr),
declare_return_variable (id, &use_stmt));
-
+
/* After we've initialized the parameters, we insert the body of the
function itself. */
inlined_body = &STMT_EXPR_STMT (expr);
@@ -750,7 +863,7 @@ expand_call_inline (tp, walk_subtrees, data)
/* Close the block for the parameters. */
scope_stmt = build_stmt (SCOPE_STMT, DECL_INITIAL (fn));
SCOPE_NO_CLEANUPS_P (scope_stmt) = 1;
- my_friendly_assert (DECL_INITIAL (fn)
+ my_friendly_assert (DECL_INITIAL (fn)
&& TREE_CODE (DECL_INITIAL (fn)) == BLOCK,
19991203);
remap_block (scope_stmt, NULL_TREE, id);
@@ -761,7 +874,7 @@ expand_call_inline (tp, walk_subtrees, data)
before we evaluate the returned value below, because that evalulation
may cause RTL to be generated. */
STMT_EXPR_STMT (expr)
- = chainon (STMT_EXPR_STMT (expr),
+ = chainon (STMT_EXPR_STMT (expr),
build_stmt (LABEL_STMT, id->ret_label));
/* Finally, mention the returned value so that the value of the
@@ -790,13 +903,25 @@ expand_call_inline (tp, walk_subtrees, data)
the equivalent inlined version either. */
TREE_USED (*tp) = 1;
+ /* Our function now has more statements than it did before. */
+ DECL_NUM_STMTS (VARRAY_TREE (id->fns, 0)) += DECL_NUM_STMTS (fn);
+ id->inlined_stmts += DECL_NUM_STMTS (fn);
+
/* Recurse into the body of the just inlined function. */
expand_calls_inline (inlined_body, id);
VARRAY_POP (id->fns);
+ /* If we've returned to the top level, clear out the record of how
+ much inlining has been done. */
+ if (VARRAY_ACTIVE_SIZE (id->fns) == id->first_inlined_fn)
+ id->inlined_stmts = 0;
+
/* Don't walk into subtrees. We've already handled them above. */
*walk_subtrees = 0;
+ if (DECL_TEMPLATE_INSTANTIATION (fn))
+ pop_tinst_level ();
+
/* Keep iterating. */
return NULL_TREE;
}
@@ -810,16 +935,22 @@ expand_calls_inline (tp, id)
inline_data *id;
{
/* Search through *TP, replacing all calls to inline functions by
- appropriate equivalents. */
- walk_tree (tp, expand_call_inline, id, NULL);
+ appropriate equivalents. Use walk_tree in no-duplicates mode
+ to avoid exponential time complexity. (We can't just use
+ walk_tree_without_duplicates, because of the special TARGET_EXPR
+ handling in expand_calls. The hash table is set up in
+ optimize_function. */
+ walk_tree (tp, expand_call_inline, id, id->tree_pruner);
}
-/* Optimize the body of FN. */
+/* Optimize the body of FN. */
void
optimize_function (fn)
tree fn;
{
+ dump_function (TDI_original, fn);
+
/* While in this function, we may choose to go off and compile
another function. For example, we might instantiate a function
in the hopes of inlining it. Normally, that wouldn't trigger any
@@ -861,17 +992,38 @@ optimize_function (fn)
/* Create the stack of TARGET_EXPRs. */
VARRAY_TREE_INIT (id.target_exprs, 32, "target_exprs");
+ /* Create the list of functions this call will inline. */
+ VARRAY_TREE_INIT (id.inlined_fns, 32, "inlined_fns");
+
+ /* Keep track of the low-water mark, i.e., the point where
+ the first real inlining is represented in ID.FNS. */
+ id.first_inlined_fn = VARRAY_ACTIVE_SIZE (id.fns);
+
/* Replace all calls to inline functions with the bodies of those
functions. */
+ id.tree_pruner = htab_create (37, htab_hash_pointer,
+ htab_eq_pointer, NULL);
expand_calls_inline (&DECL_SAVED_TREE (fn), &id);
/* Clean up. */
+ htab_delete (id.tree_pruner);
VARRAY_FREE (id.fns);
VARRAY_FREE (id.target_exprs);
+ if (DECL_LANG_SPECIFIC (fn))
+ {
+ tree ifn = make_tree_vec (VARRAY_ACTIVE_SIZE (id.inlined_fns));
+
+ memcpy (&TREE_VEC_ELT (ifn, 0), &VARRAY_TREE (id.inlined_fns, 0),
+ VARRAY_ACTIVE_SIZE (id.inlined_fns) * sizeof (tree));
+ DECL_INLINED_FNS (fn) = ifn;
+ }
+ VARRAY_FREE (id.inlined_fns);
}
/* Undo the call to ggc_push_context above. */
--function_depth;
+
+ dump_function (TDI_optimized, fn);
}
/* Called from calls_setjmp_p via walk_tree. */
@@ -898,11 +1050,38 @@ int
calls_setjmp_p (fn)
tree fn;
{
- return walk_tree_without_duplicates (&DECL_SAVED_TREE (fn),
- calls_setjmp_r,
+ return walk_tree_without_duplicates (&DECL_SAVED_TREE (fn),
+ calls_setjmp_r,
NULL) != NULL_TREE;
}
+/* CLONED_PARM is a copy of CLONE, generated for a cloned constructor
+ or destructor. Update it to ensure that the source-position for
+ the cloned parameter matches that for the original, and that the
+ debugging generation code will be able to find the original PARM. */
+
+static void
+update_cloned_parm (parm, cloned_parm)
+ tree parm;
+ tree cloned_parm;
+{
+ DECL_ABSTRACT_ORIGIN (cloned_parm) = parm;
+
+ /* We may have taken its address. */
+ TREE_ADDRESSABLE (cloned_parm) = TREE_ADDRESSABLE (parm);
+
+ /* The definition might have different constness. */
+ TREE_READONLY (cloned_parm) = TREE_READONLY (parm);
+
+ TREE_USED (cloned_parm) = TREE_USED (parm);
+
+ /* The name may have changed from the declaration. */
+ DECL_NAME (cloned_parm) = DECL_NAME (parm);
+ DECL_SOURCE_FILE (cloned_parm) = DECL_SOURCE_FILE (parm);
+ DECL_SOURCE_LINE (cloned_parm) = DECL_SOURCE_LINE (parm);
+
+}
+
/* FN is a function that has a complete body. Clone the body as
necessary. Returns non-zero if there's no longer any need to
process the main body. */
@@ -913,21 +1092,21 @@ maybe_clone_body (fn)
{
inline_data id;
tree clone;
-
- /* We don't clone constructors and destructors under the old ABI. */
- if (!flag_new_abi)
- return 0;
+ int first = 1;
/* We only clone constructors and destructors. */
if (!DECL_MAYBE_IN_CHARGE_CONSTRUCTOR_P (fn)
&& !DECL_MAYBE_IN_CHARGE_DESTRUCTOR_P (fn))
return 0;
+ /* Emit the DWARF1 abstract instance. */
+ note_deferral_of_defined_inline_function (fn);
+
/* We know that any clones immediately follow FN in the TYPE_METHODS
list. */
for (clone = TREE_CHAIN (fn);
clone && DECL_CLONED_FUNCTION_P (clone);
- clone = TREE_CHAIN (clone))
+ clone = TREE_CHAIN (clone), first = 0)
{
tree parm;
tree clone_parm;
@@ -937,7 +1116,7 @@ maybe_clone_body (fn)
DECL_SOURCE_FILE (clone) = DECL_SOURCE_FILE (fn);
DECL_SOURCE_LINE (clone) = DECL_SOURCE_LINE (fn);
DECL_INLINE (clone) = DECL_INLINE (fn);
- DECL_THIS_INLINE (clone) = DECL_THIS_INLINE (fn);
+ DECL_DECLARED_INLINE_P (clone) = DECL_DECLARED_INLINE_P (fn);
DECL_COMDAT (clone) = DECL_COMDAT (fn);
DECL_WEAK (clone) = DECL_WEAK (fn);
DECL_ONE_ONLY (clone) = DECL_ONE_ONLY (fn);
@@ -946,6 +1125,30 @@ maybe_clone_body (fn)
DECL_EXTERNAL (clone) = DECL_EXTERNAL (fn);
DECL_INTERFACE_KNOWN (clone) = DECL_INTERFACE_KNOWN (fn);
DECL_NOT_REALLY_EXTERN (clone) = DECL_NOT_REALLY_EXTERN (fn);
+ TREE_PUBLIC (clone) = TREE_PUBLIC (fn);
+
+ /* Adjust the parameter names and locations. */
+ parm = DECL_ARGUMENTS (fn);
+ clone_parm = DECL_ARGUMENTS (clone);
+ /* Update the `this' parameter, which is always first. */
+ update_cloned_parm (parm, clone_parm);
+ parm = TREE_CHAIN (parm);
+ clone_parm = TREE_CHAIN (clone_parm);
+ if (DECL_HAS_IN_CHARGE_PARM_P (fn))
+ parm = TREE_CHAIN (parm);
+ if (DECL_HAS_VTT_PARM_P (fn))
+ parm = TREE_CHAIN (parm);
+ if (DECL_HAS_VTT_PARM_P (clone))
+ clone_parm = TREE_CHAIN (clone_parm);
+ for (; parm;
+ parm = TREE_CHAIN (parm), clone_parm = TREE_CHAIN (clone_parm))
+ {
+ /* Update this paramter. */
+ update_cloned_parm (parm, clone_parm);
+ /* We should only give unused information for one clone. */
+ if (!first)
+ TREE_USED (clone_parm) = 1;
+ }
/* Start processing the function. */
push_to_top_level ();
@@ -960,6 +1163,10 @@ maybe_clone_body (fn)
VARRAY_PUSH_TREE (id.fns, clone);
VARRAY_PUSH_TREE (id.fns, fn);
+ /* Cloning is treated slightly differently from inlining. Set
+ CLONING_P so that its clear which operation we're performing. */
+ id.cloning_p = true;
+
/* Remap the parameters. */
id.decl_map = splay_tree_new (splay_tree_compare_pointers,
NULL, NULL);
@@ -978,29 +1185,27 @@ maybe_clone_body (fn)
splay_tree_insert (id.decl_map,
(splay_tree_key) parm,
(splay_tree_value) in_charge);
-
+ }
+ else if (DECL_ARTIFICIAL (parm)
+ && DECL_NAME (parm) == vtt_parm_identifier)
+ {
/* For a subobject constructor or destructor, the next
argument is the VTT parameter. Remap the VTT_PARM
from the CLONE to this parameter. */
- if (DECL_NEEDS_VTT_PARM_P (clone))
+ if (DECL_HAS_VTT_PARM_P (clone))
{
+ DECL_ABSTRACT_ORIGIN (clone_parm) = parm;
splay_tree_insert (id.decl_map,
- (splay_tree_key) DECL_VTT_PARM (fn),
+ (splay_tree_key) parm,
(splay_tree_value) clone_parm);
- splay_tree_insert (id.decl_map,
- (splay_tree_key) DECL_USE_VTT_PARM (fn),
- (splay_tree_value) boolean_true_node);
clone_parm = TREE_CHAIN (clone_parm);
}
/* Otherwise, map the VTT parameter to `NULL'. */
- else if (DECL_VTT_PARM (fn))
+ else
{
splay_tree_insert (id.decl_map,
- (splay_tree_key) DECL_VTT_PARM (fn),
+ (splay_tree_key) parm,
(splay_tree_value) null_pointer_node);
- splay_tree_insert (id.decl_map,
- (splay_tree_key) DECL_USE_VTT_PARM (fn),
- (splay_tree_value) boolean_false_node);
}
}
/* Map other parameters to their equivalents in the cloned
@@ -1017,16 +1222,45 @@ maybe_clone_body (fn)
/* Actually copy the body. */
TREE_CHAIN (DECL_SAVED_TREE (clone)) = copy_body (&id);
+ /* There are as many statements in the clone as in the
+ original. */
+ DECL_NUM_STMTS (clone) = DECL_NUM_STMTS (fn);
+
/* Clean up. */
splay_tree_delete (id.decl_map);
VARRAY_FREE (id.fns);
/* Now, expand this function into RTL, if appropriate. */
function_name_declared_p = 1;
- expand_body (finish_function (0));
+ finish_function (0);
+ BLOCK_ABSTRACT_ORIGIN (DECL_INITIAL (clone)) = DECL_INITIAL (fn);
+ expand_body (clone);
pop_from_top_level ();
}
-
+
/* We don't need to process the original function any further. */
return 1;
}
+
+/* Dump FUNCTION_DECL FN as tree dump PHASE. */
+
+static void
+dump_function (phase, fn)
+ enum tree_dump_index phase;
+ tree fn;
+{
+ FILE *stream;
+ int flags;
+
+ stream = dump_begin (phase, &flags);
+ if (stream)
+ {
+ fprintf (stream, "\n;; Function %s",
+ decl_as_string (fn, TFF_DECL_SPECIFIERS));
+ fprintf (stream, " (%s)", decl_as_string (DECL_ASSEMBLER_NAME (fn), 0));
+ fprintf (stream, "\n\n");
+
+ dump_node (fn, TDF_SLIM | flags, stream);
+ dump_end (phase, stream);
+ }
+}
diff --git a/gcc/cp/parse.y b/gcc/cp/parse.y
index e84efb53a73..1ce797cd35b 100644
--- a/gcc/cp/parse.y
+++ b/gcc/cp/parse.y
@@ -733,6 +733,7 @@ datadef:
| error ';'
| error '}'
| ';'
+ | bad_decl
;
ctor_initializer_opt:
@@ -1290,11 +1291,14 @@ new_initializer:
}
/* GNU extension so people can use initializer lists. Note that
this alters the meaning of `new int = 1', which was previously
- syntactically valid but semantically invalid. */
+ syntactically valid but semantically invalid.
+ This feature is now deprecated and will be removed in a future
+ release. */
| '=' init
{
if (pedantic)
pedwarn ("ISO C++ forbids initialization of new expression with `='");
+ cp_deprecated ("new initializer lists extension");
if (TREE_CODE ($2) != TREE_LIST
&& TREE_CODE ($2) != CONSTRUCTOR)
$$ = build_tree_list (NULL_TREE, $2);
@@ -1324,8 +1328,8 @@ cast_expr:
tree init = build_nt (CONSTRUCTOR, NULL_TREE,
nreverse ($3));
if (pedantic)
- pedwarn ("ISO C++ forbids constructor-expressions");
- /* Indicate that this was a GNU C constructor expression. */
+ pedwarn ("ISO C++ forbids compound literals");
+ /* Indicate that this was a C99 compound literal. */
TREE_HAS_CONSTRUCTOR (init) = 1;
$$ = reparse_absdcl_as_casts ($$, init);
@@ -2225,7 +2229,8 @@ structsp:
{ $<ttype>$ = current_enum_type;
current_enum_type = start_enum ($2); }
enumlist_opt '}'
- { $$.t = finish_enum (current_enum_type);
+ { $$.t = current_enum_type;
+ finish_enum (current_enum_type);
$$.new_type_flag = 1;
current_enum_type = $<ttype>4;
check_for_missing_semicolon ($$.t); }
@@ -2233,7 +2238,8 @@ structsp:
{ $<ttype>$ = current_enum_type;
current_enum_type = start_enum (make_anon_name ()); }
enumlist_opt '}'
- { $$.t = finish_enum (current_enum_type);
+ { $$.t = current_enum_type;
+ finish_enum (current_enum_type);
$$.new_type_flag = 1;
current_enum_type = $<ttype>3;
check_for_missing_semicolon ($$.t); }
@@ -2579,6 +2585,8 @@ component_decl:
$$ = finish_member_class_template ($2.t);
finish_template_decl ($1);
}
+ | bad_decl
+ { $$ = NULL_TREE; }
;
component_decl_1:
@@ -3750,6 +3758,26 @@ bad_parm:
}
;
+bad_decl:
+ IDENTIFIER template_arg_list_ignore IDENTIFIER arg_list_ignore ';'
+ {
+ cp_error("'%D' is used as a type, but is not defined as a type.", $1);
+ $3 = error_mark_node;
+ }
+ ;
+
+template_arg_list_ignore:
+ '<' template_arg_list_opt template_close_bracket
+ { }
+ | /* empty */
+ ;
+
+arg_list_ignore:
+ '(' nonnull_exprlist ')'
+ { }
+ | /* empty */
+ ;
+
exception_specification_opt:
/* empty */ %prec EMPTY
{ $$ = NULL_TREE; }
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 181a00eb77b..b552d9831f4 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -100,7 +100,6 @@ 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 int push_tinst_level 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));
@@ -144,7 +143,6 @@ static tree tsubst_template_parms PARAMS ((tree, tree, int));
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 void set_mangled_name_for_template_decl PARAMS ((tree));
static int template_class_depth_real PARAMS ((tree, int));
static tree tsubst_aggr_type PARAMS ((tree, tree, int, tree, int));
static tree tsubst_decl PARAMS ((tree, tree, tree));
@@ -1208,6 +1206,7 @@ copy_default_args_to_explicit_spec (decl)
tree t;
tree object_type = NULL_TREE;
tree in_charge = NULL_TREE;
+ tree vtt = NULL_TREE;
/* See if there's anything we need to do. */
tmpl = DECL_TI_TEMPLATE (decl);
@@ -1236,6 +1235,11 @@ copy_default_args_to_explicit_spec (decl)
in_charge = spec_types;
spec_types = TREE_CHAIN (spec_types);
}
+ if (DECL_HAS_VTT_PARM_P (decl))
+ {
+ vtt = spec_types;
+ spec_types = TREE_CHAIN (spec_types);
+ }
}
/* Compute the merged default arguments. */
@@ -1245,6 +1249,11 @@ copy_default_args_to_explicit_spec (decl)
/* Compute the new FUNCTION_TYPE. */
if (object_type)
{
+ if (vtt)
+ new_spec_types = hash_tree_cons (TREE_PURPOSE (vtt),
+ TREE_VALUE (vtt),
+ new_spec_types);
+
if (in_charge)
/* Put the in-charge parameter back. */
new_spec_types = hash_tree_cons (TREE_PURPOSE (in_charge),
@@ -1662,25 +1671,6 @@ check_explicit_specialization (declarator, decl, template_count, flags)
DECL is specializing. */
copy_default_args_to_explicit_spec (decl);
- /* Mangle the function name appropriately. Note that we do
- not mangle specializations of non-template member
- functions of template classes, e.g. with
-
- template <class T> struct S { void f(); }
-
- and given the specialization
-
- template <> void S<int>::f() {}
-
- we do not mangle S<int>::f() here. That's because it's
- just an ordinary member function and doesn't need special
- treatment. We do this here so that the ordinary,
- non-template, name-mangling algorithm will not be used
- later. */
- if ((is_member_template (tmpl) || ctype == NULL_TREE)
- && name_mangling_version >= 1)
- set_mangled_name_for_template_decl (decl);
-
if (is_friend && !have_def)
/* This is not really a declaration of a specialization.
It's just the name of an instantiation. But, it's not
@@ -2718,7 +2708,9 @@ push_template_decl_real (decl, is_friend)
{
SET_TYPE_TEMPLATE_INFO (TREE_TYPE (tmpl), info);
if ((!ctx || TREE_CODE (ctx) != FUNCTION_DECL)
- && TREE_CODE (TREE_TYPE (decl)) != ENUMERAL_TYPE)
+ && TREE_CODE (TREE_TYPE (decl)) != ENUMERAL_TYPE
+ /* Don't change the name if we've already set it up. */
+ && !IDENTIFIER_TEMPLATE (DECL_NAME (decl)))
DECL_NAME (decl) = classtype_mangled_name (TREE_TYPE (decl));
}
else if (DECL_LANG_SPECIFIC (decl))
@@ -3411,7 +3403,7 @@ convert_template_argument (parm, arg, args, complain, i, in_decl)
tree t = no_linkage_check (val);
if (t)
{
- if (ANON_AGGRNAME_P (TYPE_IDENTIFIER (t)))
+ if (TYPE_ANONYMOUS_P (t))
cp_pedwarn
("template-argument `%T' uses anonymous type", val);
else
@@ -4193,9 +4185,8 @@ lookup_template_class (d1, arglist, in_decl, context, entering_scope, complain)
Create the partial instantiation.
*/
TREE_VEC_LENGTH (arglist)--;
- template = tsubst (template, arglist, /*complain=*/0, NULL_TREE);
+ found = tsubst (template, arglist, /*complain=*/0, NULL_TREE);
TREE_VEC_LENGTH (arglist)++;
- found = template;
}
}
@@ -4219,15 +4210,8 @@ lookup_template_class (d1, arglist, in_decl, context, entering_scope, complain)
is set up. */
if (TREE_CODE (t) != ENUMERAL_TYPE)
DECL_NAME (type_decl) = classtype_mangled_name (t);
- DECL_ASSEMBLER_NAME (type_decl) = DECL_NAME (type_decl);
if (!is_partial_instantiation)
{
- if (flag_new_abi)
- DECL_ASSEMBLER_NAME (type_decl) = mangle_decl (type_decl);
- else
- DECL_ASSEMBLER_NAME (type_decl)
- = get_identifier (build_overload_name (t, 1, 1));
-
/* For backwards compatibility; code that uses
-fexternal-templates expects looking up a template to
instantiate it. I think DDD still relies on this.
@@ -4448,7 +4432,7 @@ static int last_template_error_tick;
/* We're starting to instantiate D; record the template instantiation context
for diagnostics and to restore it later. */
-static int
+int
push_tinst_level (d)
tree d;
{
@@ -4609,19 +4593,14 @@ tsubst_friend_function (decl, args)
= DECL_SAVED_TREE (DECL_TEMPLATE_RESULT (decl));
}
- /* The mangled name for the NEW_FRIEND is incorrect. The call to
- tsubst will have resulted in a call to
- set_mangled_name_for_template_decl. But, the function is not a
- template instantiation and should not be mangled like one.
- Therefore, we remangle the function name. We don't have to do
- this if the NEW_FRIEND is a template since
- set_mangled_name_for_template_decl doesn't do anything if the
- function declaration still uses template arguments. */
+ /* The mangled name for the NEW_FRIEND is incorrect. The function
+ is not a template instantiation and should not be mangled like
+ one. Therefore, we forget the mangling here; we'll recompute it
+ later if we need it. */
if (TREE_CODE (new_friend) != TEMPLATE_DECL)
{
- set_mangled_name_for_decl (new_friend);
- DECL_RTL (new_friend) = 0;
- make_decl_rtl (new_friend, NULL_PTR);
+ SET_DECL_RTL (new_friend, NULL_RTX);
+ SET_DECL_ASSEMBLER_NAME (new_friend, NULL_TREE);
}
if (DECL_NAMESPACE_SCOPE_P (new_friend))
@@ -5313,12 +5292,7 @@ static tree
maybe_fold_nontype_arg (arg)
tree arg;
{
- /* If we're not in a template, ARG is already as simple as it's going to
- get, and trying to reprocess the trees will break. */
- if (! processing_template_decl)
- return arg;
-
- if (!TYPE_P (arg) && !uses_template_parms (arg))
+ if (arg && !TYPE_P (arg) && !uses_template_parms (arg))
{
/* Sometimes, one of the args was an expression involving a
template constant parameter, like N - 1. Now that we've
@@ -5328,10 +5302,18 @@ maybe_fold_nontype_arg (arg)
fool build_expr_from_tree() into building an actual
tree. */
- int saved_processing_template_decl = processing_template_decl;
- processing_template_decl = 0;
- arg = fold (build_expr_from_tree (arg));
- processing_template_decl = saved_processing_template_decl;
+ /* If the TREE_TYPE of ARG is not NULL_TREE, ARG is already
+ as simple as it's going to get, and trying to reprocess
+ the trees will break. */
+ if (!TREE_TYPE (arg))
+ {
+ int saved_processing_template_decl = processing_template_decl;
+ processing_template_decl = 0;
+ arg = build_expr_from_tree (arg);
+ processing_template_decl = saved_processing_template_decl;
+ }
+
+ arg = fold (arg);
}
return arg;
}
@@ -5809,6 +5791,9 @@ tsubst_decl (t, args, type)
r = copy_decl (t);
DECL_USE_TEMPLATE (r) = 0;
TREE_TYPE (r) = type;
+ /* Clear out the mangled name and RTL for the instantiation. */
+ SET_DECL_ASSEMBLER_NAME (r, NULL_TREE);
+ SET_DECL_RTL (r, NULL_RTX);
DECL_CONTEXT (r) = ctx;
DECL_VIRTUAL_CONTEXT (r)
@@ -5817,14 +5802,9 @@ tsubst_decl (t, args, type)
/*entering_scope=*/1);
if (member && DECL_CONV_FN_P (r))
- {
- /* Type-conversion operator. Reconstruct the name, in
- case it's the name of one of the template's parameters. */
- if (flag_new_abi)
- DECL_NAME (r) = mangle_conv_op_name_for_type (TREE_TYPE (type));
- else
- DECL_NAME (r) = build_typename_overload (TREE_TYPE (type));
- }
+ /* Type-conversion operator. Reconstruct the name, in
+ case it's the name of one of the template's parameters. */
+ DECL_NAME (r) = mangle_conv_op_name_for_type (TREE_TYPE (type));
DECL_ARGUMENTS (r) = tsubst (DECL_ARGUMENTS (t), args,
/*complain=*/1, t);
@@ -5848,9 +5828,9 @@ tsubst_decl (t, args, type)
TREE_CHAIN (DECL_CLONED_FUNCTION (r)) = r;
}
- /* Set up the DECL_TEMPLATE_INFO for R and compute its mangled
- name. There's no need to do this in the special friend
- case mentioned above where GEN_TMPL is NULL. */
+ /* Set up the DECL_TEMPLATE_INFO for R. There's no need to do
+ this in the special friend case mentioned above where
+ GEN_TMPL is NULL. */
if (gen_tmpl)
{
DECL_TEMPLATE_INFO (r)
@@ -5858,44 +5838,6 @@ tsubst_decl (t, args, type)
SET_DECL_IMPLICIT_INSTANTIATION (r);
register_specialization (r, gen_tmpl, argvec);
- /* Set the mangled name for R. */
- if (DECL_DESTRUCTOR_P (t))
- {
- if (flag_new_abi)
- set_mangled_name_for_decl (r);
- else
- DECL_ASSEMBLER_NAME (r) = build_destructor_name (ctx);
- }
- else
- {
- /* Instantiations of template functions must be mangled
- specially, in order to conform to 14.5.5.1
- [temp.over.link]. */
- tree tmpl = DECL_TI_TEMPLATE (t);
-
- /* TMPL will be NULL if this is a specialization of a
- member function of a template class. */
- if (name_mangling_version < 1
- || tmpl == NULL_TREE
- || (member && !is_member_template (tmpl)
- && !DECL_TEMPLATE_INFO (tmpl)))
- set_mangled_name_for_decl (r);
- else
- set_mangled_name_for_template_decl (r);
- }
-
- DECL_RTL (r) = 0;
- make_decl_rtl (r, NULL_PTR);
-
- /* Like grokfndecl. If we don't do this, pushdecl will
- mess up our TREE_CHAIN because it doesn't find a
- previous decl. Sigh. */
- if (member
- && ! uses_template_parms (r)
- && (IDENTIFIER_GLOBAL_VALUE (DECL_ASSEMBLER_NAME (r))
- == NULL_TREE))
- SET_IDENTIFIER_GLOBAL_VALUE (DECL_ASSEMBLER_NAME (r), r);
-
/* We're not supposed to instantiate default arguments
until they are called, for a template. But, for a
declaration like:
@@ -5954,8 +5896,7 @@ tsubst_decl (t, args, type)
DECL_CONTEXT (r) = NULL_TREE;
if (PROMOTE_PROTOTYPES
- && (TREE_CODE (type) == INTEGER_TYPE
- || TREE_CODE (type) == ENUMERAL_TYPE)
+ && INTEGRAL_TYPE_P (type)
&& TYPE_PRECISION (type) < TYPE_PRECISION (integer_type_node))
DECL_ARG_TYPE (r) = integer_type_node;
if (TREE_CHAIN (t))
@@ -6019,12 +5960,13 @@ tsubst_decl (t, args, type)
ctx = tsubst_aggr_type (DECL_CONTEXT (t), args,
/*complain=*/1,
in_decl, /*entering_scope=*/1);
+ else if (DECL_NAMESPACE_SCOPE_P (t))
+ ctx = DECL_CONTEXT (t);
else
{
/* Subsequent calls to pushdecl will fill this in. */
ctx = NULL_TREE;
- if (!DECL_NAMESPACE_SCOPE_P (t))
- local_p = 1;
+ local_p = 1;
}
/* Check to see if we already have this specialization. */
@@ -6048,11 +5990,14 @@ tsubst_decl (t, args, type)
TREE_TYPE (r) = type;
c_apply_type_quals_to_decl (CP_TYPE_QUALS (type), r);
DECL_CONTEXT (r) = ctx;
+ /* Clear out the mangled name and RTL for the instantiation. */
+ SET_DECL_ASSEMBLER_NAME (r, NULL_TREE);
+ SET_DECL_RTL (r, NULL_RTX);
/* Don't try to expand the initializer until someone tries to use
this variable; otherwise we run into circular dependencies. */
DECL_INITIAL (r) = NULL_TREE;
- DECL_RTL (r) = 0;
+ SET_DECL_RTL (r, NULL_RTX);
DECL_SIZE (r) = DECL_SIZE_UNIT (r) = 0;
/* For __PRETTY_FUNCTION__ we have to adjust the initializer. */
@@ -6976,7 +6921,7 @@ tsubst_copy (t, args, complain, in_decl)
case LOOKUP_EXPR:
{
- /* We must tsbust into a LOOKUP_EXPR in case the names to
+ /* We must tsubst into a LOOKUP_EXPR in case the names to
which it refers is a conversion operator; in that case the
name will change. We avoid making unnecessary copies,
however. */
@@ -7223,10 +7168,7 @@ tsubst_copy (t, args, complain, in_decl)
if (IDENTIFIER_TYPENAME_P (t))
{
tree new_type = tsubst (TREE_TYPE (t), args, complain, in_decl);
- if (flag_new_abi)
- return mangle_conv_op_name_for_type (new_type);
- else
- return (build_typename_overload (new_type));
+ return mangle_conv_op_name_for_type (new_type);
}
else
return t;
@@ -7307,6 +7249,12 @@ tsubst_expr (t, args, complain, in_decl)
args, complain, in_decl));
break;
+ case USING_STMT:
+ prep_stmt (t);
+ do_using_directive (tsubst_expr (USING_STMT_NAMESPACE (t),
+ args, complain, in_decl));
+ break;
+
case DECL_STMT:
{
tree decl;
@@ -7316,6 +7264,14 @@ tsubst_expr (t, args, complain, in_decl)
decl = DECL_STMT_DECL (t);
if (TREE_CODE (decl) == LABEL_DECL)
finish_label_decl (DECL_NAME (decl));
+ else if (TREE_CODE (decl) == USING_DECL)
+ {
+ tree scope = DECL_INITIAL (decl);
+ tree name = DECL_NAME (decl);
+
+ scope = tsubst_expr (scope, args, complain, in_decl);
+ do_local_using_decl (build_nt (SCOPE_REF, scope, name));
+ }
else
{
init = DECL_INITIAL (decl);
@@ -7850,31 +7806,18 @@ maybe_adjust_types_for_deduction (strict, parm, arg)
compiler accepts it).
John also confirms that deduction should proceed as in a function
- call. Which implies the usual ARG and PARM bashing as DEDUCE_CALL.
+ call. Which implies the usual ARG and PARM conversions as DEDUCE_CALL.
However, in ordering, ARG can have REFERENCE_TYPE, but no argument
to an actual call can have such a type.
- When deducing against a REFERENCE_TYPE, we can either not change
- PARM's type, or we can change ARG's type too. The latter, though
- seemingly more safe, turns out to give the following quirk. Consider
- deducing a call to a `const int *' with the following template
- function parameters
- #1; T const *const & ; T = int
- #2; T *const & ; T = const int
- #3; T * ; T = const int
- It looks like #1 is the more specialized. Taken pairwise, #1 is
- more specialized than #2 and #2 is more specialized than #3, yet
- there is no ordering between #1 and #3.
-
- So, if ARG is a reference, we look though it when PARM is
- not a refence. When both are references we don't change either. */
+ If both ARG and PARM are REFERENCE_TYPE, we change neither.
+ If only ARG is a REFERENCE_TYPE, we look through that and then
+ proceed as with DEDUCE_CALL (which could further convert it). */
if (TREE_CODE (*arg) == REFERENCE_TYPE)
{
if (TREE_CODE (*parm) == REFERENCE_TYPE)
return 0;
*arg = TREE_TYPE (*arg);
- result |= UNIFY_ALLOW_OUTER_LESS_CV_QUAL;
- goto skip_arg;
}
break;
default:
@@ -7907,7 +7850,6 @@ maybe_adjust_types_for_deduction (strict, parm, arg)
*arg = TYPE_MAIN_VARIANT (*arg);
}
- skip_arg:;
/* [temp.deduct.call]
If P is a cv-qualified type, the top level cv-qualifiers
@@ -8583,6 +8525,10 @@ unify (tparms, targs, parm, arg, strict)
cv-qualification mismatches. */
if (TREE_CODE (arg) == TREE_CODE (parm)
&& TYPE_P (arg)
+ /* It is the elements of the array which hold the cv quals of an array
+ type, and the elements might be template type parms. We'll check
+ when we recurse. */
+ && TREE_CODE (arg) != ARRAY_TYPE
/* We check the cv-qualifiers when unifying with template type
parameters below. We want to allow ARG `const T' to unify with
PARM `T' for example, when computing which of two templates
@@ -8592,7 +8538,7 @@ unify (tparms, targs, parm, arg, strict)
return 1;
if (!(strict & UNIFY_ALLOW_OUTER_LEVEL)
- && TYPE_P (arg) && !CP_TYPE_CONST_P (arg))
+ && TYPE_P (parm) && !CP_TYPE_CONST_P (parm))
strict &= ~UNIFY_ALLOW_MORE_CV_QUAL;
strict &= ~UNIFY_ALLOW_OUTER_LEVEL;
strict &= ~UNIFY_ALLOW_DERIVED;
@@ -8800,6 +8746,18 @@ unify (tparms, targs, parm, arg, strict)
level of pointers. */
strict |= (strict_in & UNIFY_ALLOW_DERIVED);
+ if (TREE_CODE (TREE_TYPE (parm)) == OFFSET_TYPE
+ && TREE_CODE (TREE_TYPE (arg)) == OFFSET_TYPE)
+ {
+ /* Avoid getting confused about cv-quals; don't recurse here.
+ Pointers to members should really be just OFFSET_TYPE, not
+ this two-level nonsense... */
+
+ parm = TREE_TYPE (parm);
+ arg = TREE_TYPE (arg);
+ goto offset;
+ }
+
return unify (tparms, targs, TREE_TYPE (parm),
TREE_TYPE (arg), strict);
}
@@ -8952,6 +8910,7 @@ unify (tparms, targs, parm, arg, strict)
DEDUCE_EXACT, 0, -1);
case OFFSET_TYPE:
+ offset:
if (TREE_CODE (arg) != OFFSET_TYPE)
return 1;
if (unify (tparms, targs, TYPE_OFFSET_BASETYPE (parm),
@@ -9783,8 +9742,8 @@ regenerate_decl_from_template (decl, tmpl)
functions, this is not so. See tsubst_friend_function for
details. */
DECL_TI_TEMPLATE (new_decl) = DECL_TI_TEMPLATE (decl);
- DECL_ASSEMBLER_NAME (new_decl) = DECL_ASSEMBLER_NAME (decl);
- DECL_RTL (new_decl) = DECL_RTL (decl);
+ COPY_DECL_ASSEMBLER_NAME (decl, new_decl);
+ COPY_DECL_RTL (decl, new_decl);
DECL_USE_TEMPLATE (new_decl) = DECL_USE_TEMPLATE (decl);
/* Call duplicate decls to merge the old and new declarations. */
@@ -9909,7 +9868,25 @@ instantiate_decl (d, defer_ok)
if (pattern_defined)
{
- repo_template_used (d);
+ /* Let the repository code that this template definition is
+ available.
+
+ The repository doesn't need to know about cloned functions
+ because they never actually show up in the object file. It
+ does need to know about the clones; those are the symbols
+ that the linker will be emitting error messages about. */
+ if (DECL_MAYBE_IN_CHARGE_CONSTRUCTOR_P (d)
+ || DECL_MAYBE_IN_CHARGE_DESTRUCTOR_P (d))
+ {
+ tree t;
+
+ for (t = TREE_CHAIN (d);
+ t && DECL_CLONED_FUNCTION_P (t);
+ t = TREE_CHAIN (t))
+ repo_template_used (t);
+ }
+ else
+ repo_template_used (d);
if (flag_external_templates && ! DECL_INTERFACE_KNOWN (d))
{
@@ -9931,10 +9908,10 @@ instantiate_decl (d, defer_ok)
import_export_decl (d);
}
- /* We need to set up DECL_INITIAL regardless, if
- the variable is initialized in the class body. */
- if (TREE_CODE (d) == VAR_DECL && DECL_INITIALIZED_IN_CLASS_P (d))
- ;
+ if (TREE_CODE (d) == VAR_DECL && DECL_INITIALIZED_IN_CLASS_P (d)
+ && DECL_INITIAL (d) == NULL_TREE)
+ /* We should have set up DECL_INITIAL in instantiate_class_template. */
+ abort ();
/* Reject all external templates except inline functions. */
else if (DECL_INTERFACE_KNOWN (d)
&& ! DECL_NOT_REALLY_EXTERN (d)
@@ -10313,100 +10290,6 @@ get_mostly_instantiated_function_type (decl, contextp, tparmsp)
return fn_type;
}
-/* Set the DECL_ASSEMBLER_NAME for DECL, which is a FUNCTION_DECL that
- is either an instantiation or specialization of a template
- function. */
-
-static void
-set_mangled_name_for_template_decl (decl)
- tree decl;
-{
- tree context = NULL_TREE;
- tree fn_type;
- tree ret_type;
- tree parm_types;
- tree tparms;
- tree targs;
-
- my_friendly_assert (TREE_CODE (decl) == FUNCTION_DECL, 0);
- my_friendly_assert (DECL_TEMPLATE_INFO (decl) != NULL_TREE, 0);
-
- /* Under the new ABI, we don't need special machinery. */
- if (flag_new_abi)
- {
- set_mangled_name_for_decl (decl);
- return;
- }
-
- /* The names of template functions must be mangled so as to indicate
- what template is being specialized with what template arguments.
- For example, each of the following three functions must get
- different mangled names:
-
- void f(int);
- template <> void f<7>(int);
- template <> void f<8>(int); */
-
- targs = DECL_TI_ARGS (decl);
- if (uses_template_parms (targs))
- /* This DECL is for a partial instantiation. There's no need to
- mangle the name of such an entity. */
- return;
-
- /* We now compute the PARMS and RET_TYPE to give to
- build_decl_overload_real. The PARMS and RET_TYPE are the
- parameter and return types of the template, after all but the
- innermost template arguments have been substituted, not the
- parameter and return types of the function DECL. For example,
- given:
-
- template <class T> T f(T);
-
- both PARMS and RET_TYPE should be `T' even if DECL is `int f(int)'.
- A more subtle example is:
-
- template <class T> struct S { template <class U> void f(T, U); }
-
- Here, if DECL is `void S<int>::f(int, double)', PARMS should be
- {int, U}. Thus, the args that we want to subsitute into the
- return and parameter type for the function are those in TARGS,
- with the innermost level omitted. */
- fn_type = get_mostly_instantiated_function_type (decl, &context, &tparms);
-
- /* Now, get the innermost parameters and arguments, and figure out
- the parameter and return types. */
- tparms = INNERMOST_TEMPLATE_PARMS (tparms);
- targs = INNERMOST_TEMPLATE_ARGS (targs);
- ret_type = TREE_TYPE (fn_type);
- parm_types = TYPE_ARG_TYPES (fn_type);
-
- /* For a static member function, we generate a fake `this' pointer,
- for the purposes of mangling. This indicates of which class the
- function is a member. Because of:
-
- [class.static]
-
- There shall not be a static and a nonstatic member function
- with the same name and the same parameter types
-
- we don't have to worry that this will result in a clash with a
- non-static member function. */
- if (DECL_STATIC_FUNCTION_P (decl))
- parm_types = hash_tree_chain (build_pointer_type (context), parm_types);
-
- /* There should be the same number of template parameters as
- template arguments. */
- my_friendly_assert (TREE_VEC_LENGTH (tparms) == TREE_VEC_LENGTH (targs),
- 0);
-
- /* Actually set the DECL_ASSEMBLER_NAME. */
- DECL_ASSEMBLER_NAME (decl)
- = build_decl_overload_real (decl, parm_types, ret_type,
- tparms, targs,
- DECL_FUNCTION_MEMBER_P (decl)
- + DECL_MAYBE_IN_CHARGE_CONSTRUCTOR_P (decl));
-}
-
/* Return truthvalue if we're processing a template different from
the last one involved in diagnostics. */
int
@@ -10446,9 +10329,17 @@ invalid_nontype_parm_type_p (type, complain)
else if (TYPE_PTRMEMFUNC_P (type))
return 0;
else if (!pedantic && TREE_CODE (type) == REAL_TYPE)
- return 0; /* GNU extension */
+ {
+ if (complain)
+ cp_deprecated ("floating point template constant parameter");
+ return 0; /* GNU extension */
+ }
else if (!pedantic && TREE_CODE (type) == COMPLEX_TYPE)
- return 0; /* GNU extension */
+ {
+ if (complain)
+ cp_deprecated ("complex template constant parameter");
+ return 0; /* GNU extension */
+ }
else if (TREE_CODE (type) == TEMPLATE_TYPE_PARM)
return 0;
else if (TREE_CODE (type) == TYPENAME_TYPE)
diff --git a/gcc/cp/repo.c b/gcc/cp/repo.c
index 8feab839038..7d93e4b8f0c 100644
--- a/gcc/cp/repo.c
+++ b/gcc/cp/repo.c
@@ -1,5 +1,5 @@
/* Code to maintain a C++ template repository.
- Copyright (C) 1995, 1996, 1997, 1998, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1995, 1996, 1997, 1998, 2000, 2001 Free Software Foundation, Inc.
Contributed by Jason Merrill (jason@cygnus.com)
This file is part of GNU CC.
@@ -107,25 +107,6 @@ repo_get_id (t)
vtable = get_vtbl_decl_for_binfo (TYPE_BINFO (t));
- /* If we don't have a primary vtable, try looking for a secondary
- vtable. */
- if (vtable == NULL_TREE && !flag_new_abi
- && TYPE_USES_VIRTUAL_BASECLASSES (t))
- {
- tree binfos = BINFO_BASETYPES (TYPE_BINFO (t));
- int i, n_baselinks = binfos ? TREE_VEC_LENGTH (binfos) : 0;
- for (i = 0; i < n_baselinks; ++i)
- {
- tree base_binfo = TREE_VEC_ELT (binfos, i);
- if (TREE_VIA_VIRTUAL (base_binfo))
- {
- vtable = get_vtbl_decl_for_binfo (base_binfo);
- if (vtable)
- break;
- }
- }
- }
-
t = vtable;
if (t == NULL_TREE)
return t;
@@ -157,7 +138,13 @@ repo_template_used (t)
else if (DECL_P (t))
{
if (IDENTIFIER_REPO_CHOSEN (id))
- mark_decl_instantiated (t, 0);
+ /* It doesn't make sense to instantiate a clone, so we
+ instantiate the cloned function instead. Note that this
+ approach will not work correctly if collect2 assigns
+ different clones to different files -- but it shouldn't. */
+ mark_decl_instantiated (DECL_CLONED_FUNCTION_P (t)
+ ? DECL_CLONED_FUNCTION (t) : t,
+ 0);
}
else
my_friendly_abort (1);
diff --git a/gcc/cp/rtti.c b/gcc/cp/rtti.c
index 8be6f7e1087..0794fde8f01 100644
--- a/gcc/cp/rtti.c
+++ b/gcc/cp/rtti.c
@@ -43,16 +43,10 @@ extern struct obstack permanent_obstack;
static tree build_headof_sub PARAMS((tree));
static tree build_headof PARAMS((tree));
-static tree get_tinfo_var PARAMS((tree));
static tree ifnonnull PARAMS((tree, tree));
static tree tinfo_name PARAMS((tree));
static tree get_base_offset PARAMS((tree, tree));
static tree build_dynamic_cast_1 PARAMS((tree, tree));
-static void expand_si_desc PARAMS((tree, tree));
-static void expand_class_desc PARAMS((tree, tree));
-static void expand_attr_desc PARAMS((tree, tree));
-static void expand_ptr_desc PARAMS((tree, tree));
-static void expand_generic_desc PARAMS((tree, tree, const char *));
static tree throw_bad_cast PARAMS((void));
static tree throw_bad_typeid PARAMS((void));
static tree get_tinfo_decl_dynamic PARAMS((tree));
@@ -85,24 +79,11 @@ init_rtti_processing ()
(class_type_node, get_identifier ("type_info"), 1);
if (flag_honor_std)
pop_namespace ();
- if (!new_abi_rtti_p ())
- {
- tinfo_decl_id = get_identifier ("__tf");
- tinfo_decl_type = build_function_type
- (build_reference_type
- (build_qualified_type
- (type_info_type_node, TYPE_QUAL_CONST)),
- void_list_node);
- tinfo_var_id = get_identifier ("__ti");
- }
- else
- {
- /* FIXME: These identifier prefixes are not set in stone yet. */
- tinfo_decl_id = get_identifier ("__ti");
- tinfo_var_id = get_identifier ("__tn");
- tinfo_decl_type = build_qualified_type
- (type_info_type_node, TYPE_QUAL_CONST);
- }
+ /* FIXME: These identifier prefixes are not set in stone yet. */
+ tinfo_decl_id = get_identifier ("__ti");
+ tinfo_var_id = get_identifier ("__tn");
+ tinfo_decl_type =
+ build_qualified_type (type_info_type_node, TYPE_QUAL_CONST);
}
/* Given a pointer to an object with at least one virtual table
@@ -156,11 +137,7 @@ build_headof (exp)
/* Under the new ABI, the offset-to-top field is at index -2 from
the vptr. */
- if (new_abi_rtti_p ())
- index = build_int_2 (-2, -1);
- /* But under the old ABI, it is at offset zero. */
- else
- index = integer_zero_node;
+ index = build_int_2 (-2, -1);
aref = build_vtbl_ref (build_indirect_ref (exp, NULL_PTR), index);
@@ -182,9 +159,7 @@ build_headof (exp)
static tree
throw_bad_cast ()
{
- tree fn = get_identifier (flag_new_abi
- ? "__cxa_bad_cast" :
- "__throw_bad_cast");
+ tree fn = get_identifier ("__cxa_bad_cast");
if (IDENTIFIER_GLOBAL_VALUE (fn))
fn = IDENTIFIER_GLOBAL_VALUE (fn);
else
@@ -197,9 +172,7 @@ throw_bad_cast ()
static tree
throw_bad_typeid ()
{
- tree fn = get_identifier (flag_new_abi
- ? "__cxa_bad_typeid"
- : "__throw_bad_typeid");
+ tree fn = get_identifier ("__cxa_bad_typeid");
if (IDENTIFIER_GLOBAL_VALUE (fn))
fn = IDENTIFIER_GLOBAL_VALUE (fn);
else
@@ -263,15 +236,9 @@ get_tinfo_decl_dynamic (exp)
exp = build_indirect_ref (exp, NULL_PTR);
}
- /* The RTTI information is always in the vtable, but it's at
- different indices depending on the ABI. */
- if (new_abi_rtti_p ())
- index = integer_minus_one_node;
- else if (flag_vtable_thunks)
- index = integer_one_node;
- else
- index = integer_zero_node;
- t = build_vfn_ref ((tree *) 0, exp, index);
+ /* The RTTI information is at index -1. */
+ index = integer_minus_one_node;
+ t = build_vtbl_ref (exp, index);
TREE_TYPE (t) = build_pointer_type (tinfo_decl_type);
return t;
}
@@ -330,49 +297,6 @@ build_typeid (exp)
return convert_from_reference (exp);
}
-static tree
-get_tinfo_var (type)
- tree type;
-{
- tree tname = build_overload_with_type (tinfo_var_id, type);
- tree arrtype;
- int size;
-
- my_friendly_assert (!new_abi_rtti_p (), 20000118);
- if (IDENTIFIER_GLOBAL_VALUE (tname))
- return IDENTIFIER_GLOBAL_VALUE (tname);
-
- /* Figure out how much space we need to allocate for the type_info object.
- If our struct layout or the type_info classes are changed, this will
- need to be modified. */
- if (TYPE_QUALS (type) != TYPE_UNQUALIFIED)
- size = 3 * POINTER_SIZE + INT_TYPE_SIZE;
- else if (TREE_CODE (type) == POINTER_TYPE
- && ! (TREE_CODE (TREE_TYPE (type)) == OFFSET_TYPE
- || TREE_CODE (TREE_TYPE (type)) == METHOD_TYPE))
- size = 3 * POINTER_SIZE;
- else if (IS_AGGR_TYPE (type))
- {
- if (CLASSTYPE_N_BASECLASSES (type) == 0)
- size = 2 * POINTER_SIZE;
- else if (! TYPE_BASE_CONVS_MAY_REQUIRE_CODE_P (type)
- && (TREE_VIA_PUBLIC
- (TREE_VEC_ELT (TYPE_BINFO_BASETYPES (type), 0))))
- size = 3 * POINTER_SIZE;
- else
- size = 3 * POINTER_SIZE + TYPE_PRECISION (sizetype);
- }
- else
- size = 2 * POINTER_SIZE;
-
- /* The type for a character array of the appropriate size. */
- arrtype = build_cplus_array_type
- (unsigned_char_type_node,
- build_index_type (size_int (size / BITS_PER_UNIT - 1)));
-
- return declare_global_var (tname, arrtype);
-}
-
/* Generate the NTBS name of a type. */
static tree
tinfo_name (type)
@@ -381,10 +305,7 @@ tinfo_name (type)
const char *name;
tree name_string;
- if (flag_new_abi)
- name = mangle_type_string (type);
- else
- name = build_overload_name (type, 1, 1);
+ name = mangle_type_string (type);
name_string = combine_strings (build_string (strlen (name) + 1, name));
return name_string;
}
@@ -404,30 +325,25 @@ get_tinfo_decl (type)
tree name;
tree d;
+ if (COMPLETE_TYPE_P (type)
+ && TREE_CODE (TYPE_SIZE (type)) != INTEGER_CST)
+ {
+ cp_error ("cannot create type information for type `%T' because its size is variable",
+ type);
+ return error_mark_node;
+ }
+
if (TREE_CODE (type) == OFFSET_TYPE)
type = TREE_TYPE (type);
if (TREE_CODE (type) == METHOD_TYPE)
type = build_function_type (TREE_TYPE (type),
TREE_CHAIN (TYPE_ARG_TYPES (type)));
- if (flag_new_abi)
- name = mangle_typeinfo_for_type (type);
- else
- name = build_overload_with_type (tinfo_decl_id, type);
+ name = mangle_typeinfo_for_type (type);
d = IDENTIFIER_GLOBAL_VALUE (name);
if (d)
/* OK */;
- else if (!new_abi_rtti_p ())
- {
- /* The tinfo decl is a function returning a reference to the
- type_info object. */
- d = push_library_fn (name, tinfo_decl_type);
- DECL_NOT_REALLY_EXTERN (d) = 1;
- SET_DECL_TINFO_FN_P (d);
- TREE_TYPE (name) = type;
- defer_fn (d);
- }
else
{
/* The tinfo decl is the type_info object itself. We make all
@@ -444,9 +360,9 @@ get_tinfo_decl (type)
TREE_STATIC (d) = 1;
DECL_EXTERNAL (d) = 1;
TREE_PUBLIC (d) = 1;
- if (flag_weak || !typeinfo_in_lib_p (d))
+ if (flag_weak || !typeinfo_in_lib_p (type))
comdat_linkage (d);
- DECL_ASSEMBLER_NAME (d) = DECL_NAME (d);
+ SET_DECL_ASSEMBLER_NAME (d, name);
cp_finish_decl (d, NULL_TREE, NULL_TREE, 0);
pushdecl_top_level (d);
@@ -466,9 +382,7 @@ tinfo_from_decl (expr)
{
tree t;
- if (!new_abi_rtti_p ())
- t = build_call (expr, NULL_TREE);
- else if (TREE_CODE (TREE_TYPE (expr)) == POINTER_TYPE)
+ if (TREE_CODE (TREE_TYPE (expr)) == POINTER_TYPE)
t = build_indirect_ref (expr, NULL);
else
t = expr;
@@ -786,67 +700,34 @@ build_dynamic_cast_1 (type, expr)
if (tc == REFERENCE_TYPE)
expr1 = build_unary_op (ADDR_EXPR, expr1, 0);
- if (!new_abi_rtti_p ())
- {
- tree expr2 = build_headof (expr1);
- tree td1 = expr;
-
- if (tc == POINTER_TYPE)
- td1 = build_indirect_ref (td1, NULL_PTR);
- td1 = get_tinfo_decl_dynamic (td1);
-
- elems = tree_cons
- (NULL_TREE, td1, tree_cons
- (NULL_TREE, td2, tree_cons
- (NULL_TREE, boff, tree_cons
- (NULL_TREE, expr2, tree_cons
- (NULL_TREE, td3, tree_cons
- (NULL_TREE, expr1, NULL_TREE))))));
- }
- else
- elems = tree_cons
- (NULL_TREE, expr1, tree_cons
- (NULL_TREE, td3, tree_cons
- (NULL_TREE, td2, tree_cons
- (NULL_TREE, boff, NULL_TREE))));
+ elems = tree_cons
+ (NULL_TREE, expr1, tree_cons
+ (NULL_TREE, td3, tree_cons
+ (NULL_TREE, td2, tree_cons
+ (NULL_TREE, boff, NULL_TREE))));
dcast_fn = dynamic_cast_node;
if (!dcast_fn)
{
tree tmp;
tree tinfo_ptr;
- tree ns = new_abi_rtti_p () ? abi_node : global_namespace;
+ tree ns = abi_node;
const char *name;
push_nested_namespace (ns);
- if (!new_abi_rtti_p ())
- {
- tinfo_ptr = build_pointer_type (tinfo_decl_type);
- name = "__dynamic_cast_2";
- tmp = tree_cons
- (NULL_TREE, tinfo_ptr, tree_cons
- (NULL_TREE, tinfo_ptr, tree_cons
- (NULL_TREE, integer_type_node, tree_cons
- (NULL_TREE, ptr_type_node, tree_cons
- (NULL_TREE, tinfo_ptr, tree_cons
- (NULL_TREE, ptr_type_node, void_list_node))))));
- }
- else
- {
- tinfo_ptr = xref_tag (class_type_node,
- get_identifier ("__class_type_info"),
- 1);
-
- tinfo_ptr = build_pointer_type
- (build_qualified_type
- (tinfo_ptr, TYPE_QUAL_CONST));
- name = "__dynamic_cast";
- tmp = tree_cons
- (NULL_TREE, const_ptr_type_node, tree_cons
- (NULL_TREE, tinfo_ptr, tree_cons
- (NULL_TREE, tinfo_ptr, tree_cons
- (NULL_TREE, ptrdiff_type_node, void_list_node))));
- }
+ tinfo_ptr = xref_tag (class_type_node,
+ get_identifier ("__class_type_info"),
+ 1);
+
+ tinfo_ptr = build_pointer_type
+ (build_qualified_type
+ (tinfo_ptr, TYPE_QUAL_CONST));
+ name = "__dynamic_cast";
+ tmp = tree_cons
+ (NULL_TREE, const_ptr_type_node, tree_cons
+ (NULL_TREE, tinfo_ptr, tree_cons
+ (NULL_TREE, tinfo_ptr, tree_cons
+ (NULL_TREE, ptrdiff_type_node, void_list_node))));
tmp = build_function_type (ptr_type_node, tmp);
dcast_fn = build_library_fn_ptr (name, tmp);
pop_nested_namespace (ns);
@@ -889,381 +770,6 @@ build_dynamic_cast (type, expr)
return convert_from_reference (build_dynamic_cast_1 (type, expr));
}
-/* Build and initialize various sorts of descriptors. Every descriptor
- node has a name associated with it (the name created by mangling).
- For this reason, we use the identifier as our access to the __*_desc
- nodes, instead of sticking them directly in the types. Otherwise we
- would burden all built-in types (and pointer types) with slots that
- we don't necessarily want to use.
-
- For each descriptor we build, we build a variable that contains
- the descriptor's information. When we need this info at runtime,
- all we need is access to these variables.
-
- Note: these constructors always return the address of the descriptor
- info, since that is simplest for their mutual interaction. */
-
-/* Build an initializer for a __si_type_info node. */
-
-static void
-expand_si_desc (tdecl, type)
- tree tdecl;
- tree type;
-{
- tree t, elems, fn;
- tree name_string = tinfo_name (type);
-
- type = BINFO_TYPE (TREE_VEC_ELT (TYPE_BINFO_BASETYPES (type), 0));
- finish_expr_stmt (get_typeid_1 (type));
- t = decay_conversion (get_tinfo_var (type));
- elems = tree_cons
- (NULL_TREE, decay_conversion (tdecl), tree_cons
- (NULL_TREE, decay_conversion (name_string), tree_cons
- (NULL_TREE, t, NULL_TREE)));
-
- fn = get_identifier ("__rtti_si");
- if (IDENTIFIER_GLOBAL_VALUE (fn))
- fn = IDENTIFIER_GLOBAL_VALUE (fn);
- else
- {
- tree tmp;
- tmp = tree_cons
- (NULL_TREE, ptr_type_node, tree_cons
- (NULL_TREE, const_string_type_node, tree_cons
- (NULL_TREE, build_pointer_type (type_info_type_node),
- void_list_node)));
- fn = push_void_library_fn (fn, tmp);
- }
-
- fn = build_call (fn, elems);
- finish_expr_stmt (fn);
-}
-
-/* Build an initializer for a __class_type_info node. */
-
-static void
-expand_class_desc (tdecl, type)
- tree tdecl;
- tree type;
-{
- tree name_string;
- tree fn, tmp;
-
- int i = CLASSTYPE_N_BASECLASSES (type);
- int base_cnt = 0;
- tree binfos = TYPE_BINFO_BASETYPES (type);
- tree base, elems, access, offset, isvir;
- tree elt, elts = NULL_TREE;
-
- if (base_desc_type_node == NULL_TREE)
- {
- tree fields [4];
-
- /* A reasonably close approximation of __class_type_info::base_info */
-
- base_desc_type_node = make_aggr_type (RECORD_TYPE);
-
- /* Actually const __user_type_info * */
- fields [0] = build_decl
- (FIELD_DECL, NULL_TREE,
- build_pointer_type (build_qualified_type
- (type_info_type_node,
- TYPE_QUAL_CONST)));
- fields [1] = build_decl
- (FIELD_DECL, NULL_TREE,
- flag_new_abi ? intSI_type_node : unsigned_intSI_type_node);
- DECL_BIT_FIELD (fields[1]) = 1;
- DECL_SIZE (fields[1]) = bitsize_int (29);
-
- fields [2] = build_decl (FIELD_DECL, NULL_TREE, boolean_type_node);
- DECL_BIT_FIELD (fields[2]) = 1;
- DECL_SIZE (fields[2]) = bitsize_one_node;
-
- /* Actually enum access */
- fields [3] = build_decl (FIELD_DECL, NULL_TREE, integer_type_node);
- DECL_BIT_FIELD (fields[3]) = 1;
- DECL_SIZE (fields[3]) = bitsize_int (2);
-
- finish_builtin_type (base_desc_type_node, "__base_info", fields,
- 3, ptr_type_node);
- }
-
- while (--i >= 0)
- {
- tree binfo = TREE_VEC_ELT (binfos, i);
-
- finish_expr_stmt (get_typeid_1 (BINFO_TYPE (binfo)));
- base = decay_conversion (get_tinfo_var (BINFO_TYPE (binfo)));
- offset = get_base_offset (binfo, type);
-
- if (TREE_VIA_PUBLIC (binfo))
- access = access_public_node;
- else if (TREE_VIA_PROTECTED (binfo))
- access = access_protected_node;
- else
- access = access_private_node;
- if (TREE_VIA_VIRTUAL (binfo))
- isvir = boolean_true_node;
- else
- isvir = boolean_false_node;
-
- elt = build
- (CONSTRUCTOR, base_desc_type_node, NULL_TREE, tree_cons
- (NULL_TREE, base, tree_cons
- (NULL_TREE, offset, tree_cons
- (NULL_TREE, isvir, tree_cons
- (NULL_TREE, access, NULL_TREE)))));
- TREE_HAS_CONSTRUCTOR (elt) = TREE_CONSTANT (elt) = TREE_STATIC (elt) = 1;
- elts = tree_cons (NULL_TREE, elt, elts);
- base_cnt++;
- }
-
- name_string = tinfo_name (type);
-
- {
- tree arrtype = build_array_type (base_desc_type_node, NULL_TREE);
- elts = build (CONSTRUCTOR, arrtype, NULL_TREE, elts);
- TREE_HAS_CONSTRUCTOR (elts) = TREE_CONSTANT (elts)
- = TREE_STATIC (elts) = 1;
- complete_array_type (arrtype, elts, 1);
- }
-
- elems = tree_cons
- (NULL_TREE, decay_conversion (tdecl), tree_cons
- (NULL_TREE, decay_conversion (name_string), tree_cons
- (NULL_TREE, decay_conversion (elts), tree_cons
- (NULL_TREE, cp_convert (sizetype, build_int_2 (base_cnt, 0)),
- NULL_TREE))));
-
- fn = get_identifier ("__rtti_class");
- if (IDENTIFIER_GLOBAL_VALUE (fn))
- fn = IDENTIFIER_GLOBAL_VALUE (fn);
- else
- {
- tmp = tree_cons
- (NULL_TREE, ptr_type_node, tree_cons
- (NULL_TREE, const_string_type_node, tree_cons
- (NULL_TREE, build_pointer_type (base_desc_type_node), tree_cons
- (NULL_TREE, sizetype, void_list_node))));
-
- fn = push_void_library_fn (fn, tmp);
- }
-
- fn = build_call (fn, elems);
- finish_expr_stmt (fn);
-}
-
-/* Build an initializer for a __pointer_type_info node. */
-
-static void
-expand_ptr_desc (tdecl, type)
- tree tdecl;
- tree type;
-{
- tree t, elems, fn;
- tree name_string = tinfo_name (type);
-
- type = TREE_TYPE (type);
- finish_expr_stmt (get_typeid_1 (type));
- t = decay_conversion (get_tinfo_var (type));
- elems = tree_cons
- (NULL_TREE, decay_conversion (tdecl), tree_cons
- (NULL_TREE, decay_conversion (name_string), tree_cons
- (NULL_TREE, t, NULL_TREE)));
-
- fn = get_identifier ("__rtti_ptr");
- if (IDENTIFIER_GLOBAL_VALUE (fn))
- fn = IDENTIFIER_GLOBAL_VALUE (fn);
- else
- {
- tree tmp;
- tmp = tree_cons
- (NULL_TREE, ptr_type_node, tree_cons
- (NULL_TREE, const_string_type_node, tree_cons
- (NULL_TREE, build_pointer_type (type_info_type_node),
- void_list_node)));
- fn = push_void_library_fn (fn, tmp);
- }
-
- fn = build_call (fn, elems);
- finish_expr_stmt (fn);
-}
-
-/* Build an initializer for a __attr_type_info node. */
-
-static void
-expand_attr_desc (tdecl, type)
- tree tdecl;
- tree type;
-{
- tree elems, t, fn;
- tree name_string = tinfo_name (type);
- tree attrval = build_int_2 (TYPE_QUALS (type), 0);
-
- finish_expr_stmt (get_typeid_1 (TYPE_MAIN_VARIANT (type)));
- t = decay_conversion (get_tinfo_var (TYPE_MAIN_VARIANT (type)));
- elems = tree_cons
- (NULL_TREE, decay_conversion (tdecl), tree_cons
- (NULL_TREE, decay_conversion (name_string), tree_cons
- (NULL_TREE, attrval, tree_cons (NULL_TREE, t, NULL_TREE))));
-
- fn = get_identifier ("__rtti_attr");
- if (IDENTIFIER_GLOBAL_VALUE (fn))
- fn = IDENTIFIER_GLOBAL_VALUE (fn);
- else
- {
- tree tmp;
- tmp = tree_cons
- (NULL_TREE, ptr_type_node, tree_cons
- (NULL_TREE, const_string_type_node, tree_cons
- (NULL_TREE, integer_type_node, tree_cons
- (NULL_TREE, build_pointer_type (type_info_type_node),
- void_list_node))));
- fn = push_void_library_fn (fn, tmp);
- }
-
- fn = build_call (fn, elems);
- finish_expr_stmt (fn);
-}
-
-/* Build an initializer for a type_info node that just has a name. */
-
-static void
-expand_generic_desc (tdecl, type, fnname)
- tree tdecl;
- tree type;
- const char *fnname;
-{
- tree name_string = tinfo_name (type);
- tree elems = tree_cons
- (NULL_TREE, decay_conversion (tdecl), tree_cons
- (NULL_TREE, decay_conversion (name_string), NULL_TREE));
-
- tree fn = get_identifier (fnname);
- if (IDENTIFIER_GLOBAL_VALUE (fn))
- fn = IDENTIFIER_GLOBAL_VALUE (fn);
- else
- {
- tree tmp;
- tmp = tree_cons
- (NULL_TREE, ptr_type_node, tree_cons
- (NULL_TREE, const_string_type_node, void_list_node));
- fn = push_void_library_fn (fn, tmp);
- }
-
- fn = build_call (fn, elems);
- finish_expr_stmt (fn);
-}
-
-/* Generate the code for a type_info initialization function.
- Note that we take advantage of the passage
-
- 5.2.7 Type identification [expr.typeid]
-
- Whether or not the destructor is called for the type_info object at the
- end of the program is unspecified.
-
- and don't bother to arrange for these objects to be destroyed. It
- doesn't matter, anyway, since the destructors don't do anything.
-
- This must only be called from toplevel (i.e. from finish_file)! */
-
-void
-synthesize_tinfo_fn (fndecl)
- tree fndecl;
-{
- tree type = TREE_TYPE (DECL_NAME (fndecl));
- tree tmp, addr, tdecl;
- tree compound_stmt;
- tree if_stmt;
- tree then_clause;
-
- my_friendly_assert (!new_abi_rtti_p (), 20000118);
- if (at_eof)
- {
- import_export_decl (fndecl);
- if (DECL_REALLY_EXTERN (fndecl))
- return;
- }
-
- /* Declare the static typeinfo variable. */
- tdecl = get_tinfo_var (type);
- DECL_EXTERNAL (tdecl) = 0;
- TREE_STATIC (tdecl) = 1;
- DECL_COMMON (tdecl) = 1;
- TREE_USED (tdecl) = 1;
- DECL_ALIGN (tdecl) = TYPE_ALIGN (ptr_type_node);
- DECL_USER_ALIGN (tdecl) = 0;
- cp_finish_decl (tdecl, NULL_TREE, NULL_TREE, 0);
-
- /* Begin processing the function. */
- start_function (NULL_TREE, fndecl, NULL_TREE,
- SF_DEFAULT | SF_PRE_PARSED);
- DECL_DEFER_OUTPUT (fndecl) = 1;
- clear_last_expr ();
-
- /* Begin the body of the function. */
- compound_stmt = begin_compound_stmt (/*has_no_scope=*/0);
-
- /* For convenience, we save away the address of the static
- variable. */
- addr = decay_conversion (tdecl);
-
- /* If the first word of the array (the vtable) is non-zero, we've already
- initialized the object, so don't do it again. */
- if_stmt = begin_if_stmt ();
- tmp = cp_convert (build_pointer_type (ptr_type_node), addr);
- tmp = build_indirect_ref (tmp, 0);
- tmp = cp_build_binary_op (EQ_EXPR, tmp, integer_zero_node);
- finish_if_stmt_cond (tmp, if_stmt);
- then_clause = begin_compound_stmt (/*has_no_scope=*/0);
-
- if (TREE_CODE (type) == FUNCTION_TYPE)
- expand_generic_desc (tdecl, type, "__rtti_func");
- else if (TREE_CODE (type) == ARRAY_TYPE)
- expand_generic_desc (tdecl, type, "__rtti_array");
- else if (TYPE_QUALS (type) != TYPE_UNQUALIFIED)
- expand_attr_desc (tdecl, type);
- else if (TREE_CODE (type) == POINTER_TYPE)
- {
- if (TREE_CODE (TREE_TYPE (type)) == OFFSET_TYPE)
- expand_generic_desc (tdecl, type, "__rtti_ptmd");
- else if (TREE_CODE (TREE_TYPE (type)) == METHOD_TYPE)
- expand_generic_desc (tdecl, type, "__rtti_ptmf");
- else
- expand_ptr_desc (tdecl, type);
- }
- else if (TYPE_PTRMEMFUNC_P (type))
- expand_generic_desc (tdecl, type, "__rtti_ptmf");
- else if (IS_AGGR_TYPE (type))
- {
- if (CLASSTYPE_N_BASECLASSES (type) == 0)
- expand_generic_desc (tdecl, type, "__rtti_user");
- else if (! TYPE_BASE_CONVS_MAY_REQUIRE_CODE_P (type)
- && (TREE_VIA_PUBLIC
- (TREE_VEC_ELT (TYPE_BINFO_BASETYPES (type), 0))))
- expand_si_desc (tdecl, type);
- else
- expand_class_desc (tdecl, type);
- }
- else if (TREE_CODE (type) == ENUMERAL_TYPE)
- expand_generic_desc (tdecl, type, "__rtti_user");
- else
- my_friendly_abort (252);
-
- finish_compound_stmt (/*has_no_scope=*/0, then_clause);
- finish_then_clause (if_stmt);
- finish_if_stmt ();
-
- /* OK, now return the type_info object. */
- tmp = cp_convert (build_pointer_type (type_info_type_node), addr);
- tmp = build_indirect_ref (tmp, 0);
- finish_return_stmt (tmp);
- /* Finish the function body. */
- finish_compound_stmt (/*has_no_scope=*/0, compound_stmt);
- expand_body (finish_function (0));
-}
-
/* Return the runtime bit mask encoding the qualifiers of TYPE. */
static int
@@ -1328,10 +834,7 @@ tinfo_base_init (desc, target)
NULL_TREE);
tree name_string = tinfo_name (target);
- if (flag_new_abi)
- name_name = mangle_typeinfo_string_for_type (target);
- else
- name_name = build_overload_with_type (tinfo_var_id, target);
+ name_name = mangle_typeinfo_string_for_type (target);
name_decl = build_lang_decl (VAR_DECL, name_name, name_type);
DECL_ARTIFICIAL (name_decl) = 1;
@@ -1340,13 +843,10 @@ tinfo_base_init (desc, target)
DECL_EXTERNAL (name_decl) = 0;
TREE_PUBLIC (name_decl) = 1;
comdat_linkage (name_decl);
- if (flag_new_abi)
- /* The new ABI specifies the external name of the string
- containing the type's name. */
- DECL_ASSEMBLER_NAME (name_decl)
- = mangle_typeinfo_string_for_type (target);
- else
- DECL_ASSEMBLER_NAME (name_decl) = DECL_NAME (name_decl);
+ /* The new ABI specifies the external name of the string
+ containing the type's name. */
+ 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);
@@ -1584,8 +1084,6 @@ synthesize_tinfo_var (target_type, real_name)
tree var_type = NULL_TREE;
int non_public = 0;
- my_friendly_assert (new_abi_rtti_p (), 20000118);
-
switch (TREE_CODE (target_type))
{
case POINTER_TYPE:
@@ -1753,7 +1251,7 @@ create_real_tinfo_var (target_type, name, type, init, non_public)
if (flag_weak || !typeinfo_in_lib_p (target_type))
comdat_linkage (decl);
}
- DECL_ASSEMBLER_NAME (decl) = name;
+ SET_DECL_ASSEMBLER_NAME (decl, name);
DECL_INITIAL (decl) = init;
cp_finish_decl (decl, init, NULL_TREE, 0);
pushdecl_top_level (decl);
@@ -1792,7 +1290,7 @@ create_pseudo_type_info VPARAMS((const char *real_name, int ident, ...))
VA_START (ap, ident);
#ifndef ANSI_PROTOTYPES
real_name = va_arg (ap, char const *);
- ident = va_arg (app, int);
+ ident = va_arg (ap, int);
#endif
/* Generate the pseudo type name. */
@@ -1804,21 +1302,27 @@ create_pseudo_type_info VPARAMS((const char *real_name, int ident, ...))
/* Get the vtable decl. */
real_type = xref_tag (class_type_node, get_identifier (real_name), 1);
+ if (! TYPE_SIZE (real_type))
+ {
+ /* We never saw a definition of this type, so we need to tell the
+ compiler that this is an exported class, as indeed all of the
+ __*_type_info classes are. */
+ SET_CLASSTYPE_INTERFACE_KNOWN (real_type);
+ CLASSTYPE_INTERFACE_ONLY (real_type) = 1;
+ }
+
vtable_decl = get_vtable_decl (real_type, /*complete=*/1);
vtable_decl = build_unary_op (ADDR_EXPR, vtable_decl, 0);
/* Under the new ABI, we need to point into the middle of the
vtable. */
- if (flag_new_abi)
- {
- vtable_decl = build (PLUS_EXPR,
- TREE_TYPE (vtable_decl),
- vtable_decl,
- size_binop (MULT_EXPR,
- size_int (2),
- TYPE_SIZE_UNIT (vtable_entry_type)));
- TREE_CONSTANT (vtable_decl) = 1;
- }
+ vtable_decl = build (PLUS_EXPR,
+ TREE_TYPE (vtable_decl),
+ vtable_decl,
+ size_binop (MULT_EXPR,
+ size_int (2),
+ TYPE_SIZE_UNIT (vtable_entry_type)));
+ TREE_CONSTANT (vtable_decl) = 1;
/* First field is the pseudo type_info base class. */
fields[0] = build_decl (FIELD_DECL, NULL_TREE, ti_desc_type_node);
diff --git a/gcc/cp/search.c b/gcc/cp/search.c
index 620d7592085..9b263cff1df 100644
--- a/gcc/cp/search.c
+++ b/gcc/cp/search.c
@@ -649,8 +649,8 @@ lookup_field_1 (type, name)
;
else if (DECL_NAME (field) == name)
{
- if ((TREE_CODE(field) == VAR_DECL || TREE_CODE(field) == CONST_DECL)
- && DECL_ASSEMBLER_NAME (field) != NULL)
+ if (TREE_CODE(field) == VAR_DECL
+ && (TREE_STATIC (field) || DECL_EXTERNAL (field)))
GNU_xref_ref(current_function_decl,
IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (field)));
return field;
@@ -842,7 +842,7 @@ dfs_access_in_type (binfo, data)
access to the DECL. The CONST_DECL for an enumeration
constant will not have DECL_LANG_SPECIFIC, and thus no
DECL_ACCESS. */
- if (DECL_LANG_SPECIFIC (decl))
+ if (DECL_LANG_SPECIFIC (decl) && !DECL_DISCRIMINATOR_P (decl))
{
tree decl_access = purpose_member (type, DECL_ACCESS (decl));
if (decl_access)
@@ -1382,11 +1382,27 @@ lookup_field_r (binfo, data)
we ignore all non-types we find. */
if (lfi->want_type && TREE_CODE (nval) != TYPE_DECL)
{
- nval = purpose_member (lfi->name, CLASSTYPE_TAGS (type));
- if (nval)
- nval = TYPE_MAIN_DECL (TREE_VALUE (nval));
- else
- return NULL_TREE;
+ if (lfi->name == TYPE_IDENTIFIER (type))
+ {
+ /* If the aggregate has no user defined constructors, we allow
+ it to have fields with the same name as the enclosing type.
+ If we are looking for that name, find the corresponding
+ TYPE_DECL. */
+ for (nval = TREE_CHAIN (nval); nval; nval = TREE_CHAIN (nval))
+ if (DECL_NAME (nval) == lfi->name
+ && TREE_CODE (nval) == TYPE_DECL)
+ break;
+ }
+ else
+ nval = NULL_TREE;
+ if (!nval)
+ {
+ nval = purpose_member (lfi->name, CLASSTYPE_TAGS (type));
+ if (nval)
+ nval = TYPE_MAIN_DECL (TREE_VALUE (nval));
+ else
+ return NULL_TREE;
+ }
}
/* You must name a template base class with a template-id. */
@@ -2006,65 +2022,72 @@ look_for_overrides (type, fndecl)
return found;
}
-/* Look in TYPE for virtual functions overridden by FNDECL. Check both
- TYPE itself and its bases. */
+/* Look in TYPE for virtual functions with the same signature as FNDECL.
+ This differs from get_matching_virtual in that it will only return
+ a function from TYPE. */
-static int
-look_for_overrides_r (type, fndecl)
+tree
+look_for_overrides_here (type, fndecl)
tree type, fndecl;
{
int ix;
-
- if (DECL_DESTRUCTOR_P (fndecl))
+
+ if (DECL_MAYBE_IN_CHARGE_DESTRUCTOR_P (fndecl))
ix = CLASSTYPE_DESTRUCTOR_SLOT;
else
ix = lookup_fnfields_1 (type, DECL_NAME (fndecl));
if (ix >= 0)
{
tree fns = TREE_VEC_ELT (CLASSTYPE_METHOD_VEC (type), ix);
- tree dtypes = TYPE_ARG_TYPES (TREE_TYPE (fndecl));
- tree thistype = DECL_STATIC_FUNCTION_P (fndecl)
- ? NULL_TREE : TREE_TYPE (TREE_VALUE (dtypes));
for (; fns; fns = OVL_NEXT (fns))
{
tree fn = OVL_CURRENT (fns);
- tree btypes = TYPE_ARG_TYPES (TREE_TYPE (fn));
-
+
if (!DECL_VIRTUAL_P (fn))
- /* Not a virtual */;
+ /* Not a virtual. */;
else if (DECL_CONTEXT (fn) != type)
- /* Introduced with a using declaration */;
- else if (thistype == NULL_TREE)
+ /* Introduced with a using declaration. */;
+ else if (DECL_STATIC_FUNCTION_P (fndecl))
{
- if (compparms (TREE_CHAIN (btypes), dtypes))
- {
- /* A static member function cannot match an inherited
- virtual member function. */
- cp_error_at ("`%#D' cannot be declared", fndecl);
- cp_error_at (" since `%#D' declared in base class", fn);
- return 1;
- }
+ tree btypes = TYPE_ARG_TYPES (TREE_TYPE (fn));
+ tree dtypes = TYPE_ARG_TYPES (TREE_TYPE (fndecl));
+ if (compparms (TREE_CHAIN (btypes), dtypes))
+ return fn;
}
- else
- {
- if (/* The first parameter is the `this' parameter,
- which has POINTER_TYPE, and we can therefore
- safely use TYPE_QUALS, rather than
- CP_TYPE_QUALS. */
- (TYPE_QUALS (TREE_TYPE (TREE_VALUE (btypes)))
- == TYPE_QUALS (thistype))
- && compparms (TREE_CHAIN (btypes), TREE_CHAIN (dtypes)))
- {
- /* It's definitely virtual, even if not explicitly set. */
- DECL_VIRTUAL_P (fndecl) = 1;
- check_final_overrider (fndecl, fn);
-
- return 1;
- }
- }
+ else if (same_signature_p (fndecl, fn))
+ return fn;
}
}
+ return NULL_TREE;
+}
+
+/* Look in TYPE for virtual functions overridden by FNDECL. Check both
+ TYPE itself and its bases. */
+
+static int
+look_for_overrides_r (type, fndecl)
+ tree type, fndecl;
+{
+ tree fn = look_for_overrides_here (type, fndecl);
+ if (fn)
+ {
+ if (DECL_STATIC_FUNCTION_P (fndecl))
+ {
+ /* A static member function cannot match an inherited
+ virtual member function. */
+ cp_error_at ("`%#D' cannot be declared", fndecl);
+ cp_error_at (" since `%#D' declared in base class", fn);
+ }
+ else
+ {
+ /* It's definitely virtual, even if not explicitly set. */
+ DECL_VIRTUAL_P (fndecl) = 1;
+ check_final_overrider (fndecl, fn);
+ }
+ return 1;
+ }
+
/* We failed to find one declared in this class. Look in its bases. */
return look_for_overrides (type, fndecl);
}
@@ -2388,9 +2411,7 @@ init_vbase_pointers (type, decl_ptr)
if (TYPE_USES_VIRTUAL_BASECLASSES (type))
{
struct vbase_info vi;
- int old_flag = flag_this_is_variable;
tree binfo = TYPE_BINFO (type);
- flag_this_is_variable = -2;
/* Find all the virtual base classes, marking them for later
initialization. */
@@ -2408,7 +2429,6 @@ init_vbase_pointers (type, decl_ptr)
marked_vtable_pathp,
NULL);
- flag_this_is_variable = old_flag;
return vi.inits;
}
@@ -2507,8 +2527,7 @@ expand_upcast_fixups (binfo, addr, orig_addr, vbase, vbase_addr, t,
*vbase_offsets = delta;
}
- for (virtuals = BINFO_VIRTUALS (binfo),
- n = first_vfun_index (BINFO_TYPE (binfo));
+ for (virtuals = BINFO_VIRTUALS (binfo), n = 0;
virtuals;
virtuals = TREE_CHAIN (virtuals), ++n)
{
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index c5bbe1be604..b840447f79a 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -51,6 +51,7 @@ static tree simplify_aggr_init_exprs_r PARAMS ((tree *, int *, void *));
static void deferred_type_access_control PARAMS ((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 genrtl_catch_block PARAMS ((tree));
static void genrtl_ctor_stmt PARAMS ((tree));
@@ -59,6 +60,7 @@ static void genrtl_named_return_value PARAMS ((void));
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 *));
/* Finish processing the COND, the SUBSTMT condition for STMT. */
@@ -574,14 +576,14 @@ genrtl_try_block (t)
{
expand_eh_region_start ();
expand_stmt (TRY_STMTS (t));
- expand_eh_region_end (protect_with_terminate (TRY_HANDLERS (t)));
+ expand_eh_region_end_cleanup (TRY_HANDLERS (t));
}
else
{
if (!FN_TRY_BLOCK_P (t))
emit_line_note (input_filename, lineno);
- expand_start_try_stmts ();
+ expand_eh_region_start ();
expand_stmt (TRY_STMTS (t));
if (FN_TRY_BLOCK_P (t))
@@ -602,6 +604,21 @@ genrtl_try_block (t)
}
}
+/* Generate the RTL for T, which is an EH_SPEC_BLOCK. */
+
+static void
+genrtl_eh_spec_block (t)
+ tree t;
+{
+ expand_eh_region_start ();
+ expand_stmt (EH_SPEC_STMTS (t));
+ expand_eh_region_end_allowed (EH_SPEC_RAISES (t),
+ build_call (call_unexpected_node,
+ tree_cons (NULL_TREE,
+ build_exc_ptr (),
+ NULL_TREE)));
+}
+
/* Begin a try-block. Returns a newly-created TRY_BLOCK if
appropriate. */
@@ -705,13 +722,7 @@ genrtl_handler (t)
genrtl_do_pushlevel ();
expand_stmt (HANDLER_BODY (t));
if (!processing_template_decl)
- {
- /* Fall to outside the try statement when done executing
- handler and we fall off end of handler. This is jump
- Lresume in the documentation. */
- expand_goto (top_label_entry (&caught_return_label_stack));
- end_catch_handler ();
- }
+ expand_end_catch ();
}
/* Begin a handler. Returns a HANDLER if appropriate. */
@@ -756,13 +767,13 @@ finish_handler_parms (decl, handler)
return blocks;
}
-/* Generate the RTL for a CATCH_BLOCK. */
+/* Generate the RTL for a START_CATCH_STMT. */
static void
genrtl_catch_block (type)
tree type;
{
- start_catch_handler (type);
+ expand_start_catch (type);
}
/* Note the beginning of a handler for TYPE. This function is called
@@ -831,7 +842,7 @@ begin_compound_stmt (has_no_scope)
{
do_pushlevel ();
if (is_try)
- note_level_for_eh ();
+ note_level_for_try ();
}
else
/* Normally, we try hard to keep the BLOCK for a
@@ -911,8 +922,50 @@ finish_asm_stmt (cv_qualifier, string, output_operands,
}
if (!processing_template_decl)
- for (t = input_operands; t; t = TREE_CHAIN (t))
- TREE_VALUE (t) = decay_conversion (TREE_VALUE (t));
+ {
+ int i;
+ int ninputs;
+ int noutputs;
+
+ for (t = input_operands; t; t = TREE_CHAIN (t))
+ TREE_VALUE (t) = decay_conversion (TREE_VALUE (t));
+
+ ninputs = list_length (input_operands);
+ noutputs = list_length (output_operands);
+
+ for (i = 0, t = output_operands; t; t = TREE_CHAIN (t), ++i)
+ {
+ bool allows_mem;
+ bool allows_reg;
+ bool is_inout;
+ const char *constraint;
+ tree operand;
+
+ constraint = TREE_STRING_POINTER (TREE_PURPOSE (t));
+ operand = TREE_VALUE (output_operands);
+
+ if (!parse_output_constraint (&constraint,
+ i, ninputs, noutputs,
+ &allows_mem,
+ &allows_reg,
+ &is_inout))
+ {
+ /* By marking the type as erroneous, we will not try to
+ process this operand again in expand_asm_operands. */
+ TREE_TYPE (operand) = error_mark_node;
+ continue;
+ }
+
+ /* If the operand is a DECL that is going to end up in
+ memory, assume it is addressable. This is a bit more
+ conservative than it would ideally be; the exact test is
+ buried deep in expand_asm_operands and depends on the
+ DECL_RTL for the OPERAND -- which we don't have at this
+ point. */
+ if (!allows_reg && DECL_P (operand))
+ mark_addressable (operand);
+ }
+ }
r = build_stmt (ASM_STMT, cv_qualifier, string,
output_operands, input_operands,
@@ -991,7 +1044,7 @@ genrtl_named_return_value ()
SImode but the DECL_RTL for the DECL_RESULT has DImode. So,
here, we use the mode the back-end has already assigned for
the return value. */
- DECL_RTL (decl) = gen_reg_rtx (GET_MODE (DECL_RTL (decl)));
+ SET_DECL_RTL (decl, gen_reg_rtx (GET_MODE (DECL_RTL (decl))));
if (TREE_ADDRESSABLE (decl))
put_var_into_stack (decl);
}
@@ -1018,10 +1071,7 @@ finish_named_return_value (return_id, init)
if (return_id != NULL_TREE)
{
if (DECL_NAME (decl) == NULL_TREE)
- {
- DECL_NAME (decl) = return_id;
- DECL_ASSEMBLER_NAME (decl) = return_id;
- }
+ DECL_NAME (decl) = return_id;
else
{
cp_error ("return identifier `%D' already in place", return_id);
@@ -1117,9 +1167,12 @@ finish_mem_initializers (init_list)
setup_vtbl_ptr (member_init_list, base_init_list);
}
-/* Cache the value of this class's main virtual function table pointer
- in a register variable. This will save one indirection if a
- more than one virtual function call is made this function. */
+/* Do the initialization work necessary at the beginning of a constructor
+ or destructor. This means processing member initializers and setting
+ vtable pointers.
+
+ ??? The call to keep_next_level at the end applies to all functions, but
+ should probably go somewhere else. */
void
setup_vtbl_ptr (member_init_list, base_init_list)
@@ -1132,27 +1185,22 @@ setup_vtbl_ptr (member_init_list, base_init_list)
if (vtbls_set_up_p)
return;
- if (DECL_CONSTRUCTOR_P (current_function_decl))
+ if (processing_template_decl)
+ add_stmt (build_min_nt (CTOR_INITIALIZER,
+ member_init_list, base_init_list));
+ else if (DECL_CONSTRUCTOR_P (current_function_decl))
{
- if (processing_template_decl)
- add_stmt (build_min_nt
- (CTOR_INITIALIZER,
- member_init_list, base_init_list));
- else
- {
- tree ctor_stmt;
+ tree ctor_stmt;
- /* Mark the beginning of the constructor. */
- ctor_stmt = build_stmt (CTOR_STMT);
- CTOR_BEGIN_P (ctor_stmt) = 1;
- add_stmt (ctor_stmt);
+ /* Mark the beginning of the constructor. */
+ ctor_stmt = build_stmt (CTOR_STMT);
+ CTOR_BEGIN_P (ctor_stmt) = 1;
+ add_stmt (ctor_stmt);
- /* And actually initialize the base-classes and members. */
- emit_base_init (member_init_list, base_init_list);
- }
+ /* And actually initialize the base-classes and members. */
+ emit_base_init (member_init_list, base_init_list);
}
- else if (DECL_DESTRUCTOR_P (current_function_decl)
- && !processing_template_decl)
+ else if (DECL_DESTRUCTOR_P (current_function_decl))
{
tree if_stmt;
tree compound_stmt;
@@ -1725,18 +1773,29 @@ begin_class_definition (t)
cp_error ("definition of `%#T' inside template parameter list", t);
return error_mark_node;
}
- if (t == error_mark_node
- || ! IS_AGGR_TYPE (t))
+
+ /* In a definition of a member class template, we will get here with
+ an implicit typename. */
+ if (IMPLICIT_TYPENAME_P (t))
+ t = TREE_TYPE (t);
+ /* A non-implicit typename comes from code like:
+
+ template <typename T> struct A {
+ template <typename U> struct A<T>::B ...
+
+ This is erroneous. */
+ else if (TREE_CODE (t) == TYPENAME_TYPE)
+ {
+ cp_error ("invalid definition of qualified type `%T'", t);
+ t = error_mark_node;
+ }
+
+ if (t == error_mark_node || ! IS_AGGR_TYPE (t))
{
t = make_aggr_type (RECORD_TYPE);
pushtag (make_anon_name (), t, 0);
}
- /* In a definition of a member class template, we will get here with an
- implicit typename, a TYPENAME_TYPE with a type. */
- if (TREE_CODE (t) == TYPENAME_TYPE)
- t = TREE_TYPE (t);
-
/* If we generated a partial instantiation of this type, but now
we're seeing a real definition, we're actually looking at a
partial specialization. Consider:
@@ -1804,22 +1863,18 @@ begin_class_definition (t)
/* Reset the interface data, at the earliest possible
moment, as it might have been set via a class foo;
before. */
- {
- tree name = TYPE_IDENTIFIER (t);
-
- if (! ANON_AGGRNAME_P (name))
- {
- CLASSTYPE_INTERFACE_ONLY (t) = interface_only;
- SET_CLASSTYPE_INTERFACE_UNKNOWN_X
- (t, interface_unknown);
- }
-
- /* Only leave this bit clear if we know this
- class is part of an interface-only specification. */
- if (! CLASSTYPE_INTERFACE_KNOWN (t)
- || ! CLASSTYPE_INTERFACE_ONLY (t))
- CLASSTYPE_VTABLE_NEEDS_WRITING (t) = 1;
- }
+ if (! TYPE_ANONYMOUS_P (t))
+ {
+ CLASSTYPE_INTERFACE_ONLY (t) = interface_only;
+ SET_CLASSTYPE_INTERFACE_UNKNOWN_X
+ (t, interface_unknown);
+ }
+
+ /* Only leave this bit clear if we know this
+ class is part of an interface-only specification. */
+ if (! CLASSTYPE_INTERFACE_KNOWN (t)
+ || ! CLASSTYPE_INTERFACE_ONLY (t))
+ CLASSTYPE_VTABLE_NEEDS_WRITING (t) = 1;
reset_specialization();
/* Make a declaration for this class in its own scope. */
@@ -1864,7 +1919,7 @@ finish_member_declaration (decl)
A C language linkage is ignored for the names of class members
and the member function type of class member functions. */
if (DECL_LANG_SPECIFIC (decl) && DECL_LANGUAGE (decl) == lang_c)
- DECL_LANGUAGE (decl) = lang_cplusplus;
+ SET_DECL_LANGUAGE (decl, lang_cplusplus);
/* Put functions on the TYPE_METHODS list and everything else on the
TYPE_FIELDS list. Note that these are built up in reverse order.
@@ -1924,6 +1979,8 @@ finish_class_definition (t, attributes, semi, pop_scope_p)
int semi;
int pop_scope_p;
{
+ tree variant;
+
/* finish_struct nukes this anyway; if finish_exception does too,
then it can go. */
if (semi)
@@ -1932,7 +1989,10 @@ finish_class_definition (t, attributes, semi, pop_scope_p)
/* If we got any attributes in class_head, xref_tag will stick them in
TREE_TYPE of the type. Grab them now. */
attributes = chainon (TREE_TYPE (t), attributes);
- TREE_TYPE (t) = NULL_TREE;
+
+ /* And then clear it out. */
+ for (variant = t; variant; variant = TYPE_NEXT_VARIANT (variant))
+ TREE_TYPE (variant) = NULL_TREE;
if (TREE_CODE (t) == ENUMERAL_TYPE)
;
@@ -2165,6 +2225,10 @@ cp_expand_stmt (t)
genrtl_try_block (t);
break;
+ case EH_SPEC_BLOCK:
+ genrtl_eh_spec_block (t);
+ break;
+
case HANDLER:
genrtl_handler (t);
break;
@@ -2177,6 +2241,9 @@ cp_expand_stmt (t)
genrtl_named_return_value ();
break;
+ case USING_STMT:
+ break;
+
default:
my_friendly_abort (19990810);
break;
@@ -2198,7 +2265,6 @@ simplify_aggr_init_exprs_r (tp, walk_subtrees, data)
tree args;
tree slot;
tree type;
- tree call_type;
int copy_from_buffer_p;
aggr_init_expr = *tp;
@@ -2221,17 +2287,20 @@ simplify_aggr_init_exprs_r (tp, walk_subtrees, data)
args = TREE_OPERAND (aggr_init_expr, 1);
slot = TREE_OPERAND (aggr_init_expr, 2);
type = TREE_TYPE (aggr_init_expr);
- call_type = type;
if (AGGR_INIT_VIA_CTOR_P (aggr_init_expr))
{
/* Replace the first argument with the address of the third
argument to the AGGR_INIT_EXPR. */
- call_type = build_pointer_type (type);
mark_addressable (slot);
- args = tree_cons (NULL_TREE, build1 (ADDR_EXPR, call_type, slot),
+ args = tree_cons (NULL_TREE,
+ build1 (ADDR_EXPR,
+ build_pointer_type (TREE_TYPE (slot)),
+ slot),
TREE_CHAIN (args));
}
- call_expr = build (CALL_EXPR, call_type, fn, args, NULL_TREE);
+ call_expr = build (CALL_EXPR,
+ TREE_TYPE (TREE_TYPE (TREE_TYPE (fn))),
+ fn, args, NULL_TREE);
TREE_SIDE_EFFECTS (call_expr) = 1;
/* If we're using the non-reentrant PCC calling convention, then we
@@ -2241,10 +2310,11 @@ simplify_aggr_init_exprs_r (tp, walk_subtrees, data)
#ifdef PCC_STATIC_STRUCT_RETURN
if (!AGGR_INIT_VIA_CTOR_P (aggr_init_expr) && aggregate_value_p (type))
{
- int old_ac;
+ int old_ac = flag_access_control;
flag_access_control = 0;
- call_expr = build_aggr_init (slot, call_expr, LOOKUP_ONLYCONVERTING);
+ call_expr = build_aggr_init (slot, call_expr,
+ DIRECT_BIND | LOOKUP_ONLYCONVERTING);
flag_access_control = old_ac;
copy_from_buffer_p = 1;
}
@@ -2290,7 +2360,7 @@ emit_associated_thunks (fn)
for (v = BINFO_VIRTUALS (binfo); v; v = TREE_CHAIN (v))
if (BV_FN (v) == fn
&& (!integer_zerop (BV_DELTA (v))
- || BV_VCALL_INDEX (v)))
+ || BV_USE_VCALL_INDEX_P (v)))
{
tree thunk;
tree vcall_index;
@@ -2307,8 +2377,7 @@ emit_associated_thunks (fn)
vfunc_ptr_type_node,
fn),
BV_DELTA (v),
- vcall_index,
- /*generate_with_vtable_p=*/0);
+ vcall_index);
use_thunk (thunk, /*emit_p=*/1);
}
}
@@ -2373,9 +2442,6 @@ expand_body (fn)
/* Or if this is a nested function. */
&& !decl_function_context (fn))
{
- /* Give the function RTL now so that we can assign it to a
- function pointer, etc. */
- make_decl_rtl (fn, NULL);
/* Set DECL_EXTERNAL so that assemble_external will be called as
necessary. We'll clear it again in finish_file. */
if (!DECL_EXTERNAL (fn))
@@ -2391,13 +2457,23 @@ expand_body (fn)
return;
}
+ /* Compute the appropriate object-file linkage for inline
+ functions. */
+ if (DECL_DECLARED_INLINE_P (fn))
+ import_export_decl (fn);
+
/* Emit any thunks that should be emitted at the same time as FN. */
emit_associated_thunks (fn);
timevar_push (TV_INTEGRATION);
- /* Optimize the body of the function before expanding it. */
- optimize_function (fn);
+ /* Optimize the body of the function before expanding it. We do not
+ optimize thunks, as (1) the backend tries to optimize the call to
+ the thunkee, (b) the tree based inliner breaks that optimization,
+ (c) virtual functions are rarely inlineable, and (d)
+ ASM_OUTPUT_MI_THUNK is there to DTRT anyway. */
+ if (!DECL_THUNK_P (fn))
+ optimize_function (fn);
timevar_pop (TV_INTEGRATION);
timevar_push (TV_EXPAND);
@@ -2434,7 +2510,7 @@ expand_body (fn)
/* If possible, obliterate the body of the function so that it can
be garbage collected. */
- if (flag_dump_translation_unit)
+ if (dump_enabled_p (TDI_all))
/* Keep the body; we're going to dump it. */
;
else if (DECL_INLINE (fn) && flag_inline_trees)
@@ -2572,9 +2648,6 @@ genrtl_finish_function (fn)
&& ! DECL_NAME (DECL_RESULT (current_function_decl)))
no_return_label = build_decl (LABEL_DECL, NULL_TREE, NULL_TREE);
- if (flag_exceptions)
- expand_exception_blocks ();
-
/* If this function is supposed to return a value, ensure that
we do not fall into the cleanups by mistake. The end of our
function will look like this:
@@ -2641,6 +2714,10 @@ genrtl_finish_function (fn)
if (function_depth > 1)
ggc_push_context ();
+ /* There's no need to defer outputting this function any more; we
+ know we want to output it. */
+ DECL_DEFER_OUTPUT (fn) = 0;
+
/* Run the optimizers and output the assembler code for this
function. */
rest_of_compilation (fn);
@@ -2681,25 +2758,54 @@ genrtl_finish_function (fn)
--function_depth;
- if (!DECL_SAVED_INSNS (fn)
- && !(flag_inline_trees && DECL_INLINE (fn)))
+ /* If we don't need the RTL for this function anymore, stop pointing
+ to it. That's especially important for LABEL_DECLs, since you
+ can reach all the instructions in the function from the
+ CODE_LABEL stored in the DECL_RTL for the LABEL_DECL. */
+ if (!DECL_SAVED_INSNS (fn))
{
tree t;
- /* Stop pointing to the local nodes about to be freed. */
- /* But DECL_INITIAL must remain nonzero so we know this
- was an actual function definition. */
- DECL_INITIAL (fn) = error_mark_node;
+ /* Walk the BLOCK-tree, clearing DECL_RTL for LABEL_DECLs and
+ non-static local variables. */
+ walk_tree_without_duplicates (&DECL_SAVED_TREE (fn),
+ clear_decl_rtl,
+ NULL);
+
+ /* Clear out the RTL for the arguments. */
for (t = DECL_ARGUMENTS (fn); t; t = TREE_CHAIN (t))
- DECL_RTL (t) = DECL_INCOMING_RTL (t) = NULL_RTX;
- }
+ {
+ SET_DECL_RTL (t, NULL_RTX);
+ DECL_INCOMING_RTL (t) = NULL_RTX;
+ }
+ if (!(flag_inline_trees && DECL_INLINE (fn)))
+ /* DECL_INITIAL must remain nonzero so we know this was an
+ actual function definition. */
+ DECL_INITIAL (fn) = error_mark_node;
+ }
+
/* Let the error reporting routines know that we're outside a
function. For a nested function, this value is used in
pop_cp_function_context and then reset via pop_function_context. */
current_function_decl = NULL_TREE;
}
+/* Clear out the DECL_RTL for the non-static variables in BLOCK and
+ its sub-blocks. */
+
+static tree
+clear_decl_rtl (tp, walk_subtrees, data)
+ tree *tp;
+ int *walk_subtrees ATTRIBUTE_UNUSED;
+ void *data ATTRIBUTE_UNUSED;
+{
+ if (nonstatic_local_decl_p (*tp))
+ SET_DECL_RTL (*tp, NULL_RTX);
+
+ return NULL_TREE;
+}
+
/* Perform initialization related to this module. */
void
diff --git a/gcc/cp/spew.c b/gcc/cp/spew.c
index ba2013b8142..c47c6a505ca 100644
--- a/gcc/cp/spew.c
+++ b/gcc/cp/spew.c
@@ -1,6 +1,6 @@
/* Type Analyzer for GNU C++.
Copyright (C) 1987, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000 Free Software Foundation, Inc.
+ 1999, 2000, 2001 Free Software Foundation, Inc.
Hacked... nay, bludgeoned... by Mark Eichin (eichin@cygnus.com)
This file is part of GNU CC.
@@ -140,6 +140,7 @@ static void debug_yychar PARAMS ((int));
extern char *debug_yytranslate PARAMS ((int));
#endif
static enum cpp_ttype last_token;
+static tree last_token_id;
/* From lex.c: */
/* the declaration found for the last IDENTIFIER token read in.
@@ -259,7 +260,8 @@ read_token (t)
{
retry:
- last_token = c_lex (&t->yylval.ttype);
+ last_token = c_lex (&last_token_id);
+ t->yylval.ttype = last_token_id;
switch (last_token)
{
@@ -351,17 +353,9 @@ read_token (t)
t->yychar = STRING;
break;
- /* This token should not be generated in C++ mode. */
- case CPP_OSTRING:
-
- /* These tokens should not survive translation phase 4. */
- case CPP_HASH:
- case CPP_PASTE:
- error ("syntax error before '#' token");
- goto retry;
-
default:
- abort ();
+ yyerror ("parse error");
+ goto retry;
}
t->lineno = lineno;
@@ -704,12 +698,7 @@ see_typename ()
if (yychar == IDENTIFIER)
{
lastiddecl = lookup_name (yylval.ttype, -2);
- if (lastiddecl == 0)
- {
- if (flag_labels_ok)
- lastiddecl = IDENTIFIER_LABEL_VALUE (yylval.ttype);
- }
- else
+ if (lastiddecl)
yychar = identifier_type (lastiddecl);
}
}
@@ -719,6 +708,8 @@ yylex ()
{
int yychr;
int old_looking_for_typename = 0;
+ int just_saw_new = 0;
+ int just_saw_friend = 0;
timevar_push (TV_LEX);
@@ -804,13 +795,13 @@ yylex ()
}
/* do_aggr needs to know if the previous token was `friend'. */
else if (nth_token (0)->yylval.ttype == ridpointers[RID_FRIEND])
- after_friend = 1;
+ just_saw_friend = 1;
break;
case NEW:
/* do_aggr needs to know if the previous token was `new'. */
- after_new = 1;
+ just_saw_new = 1;
break;
case TYPESPEC:
@@ -824,7 +815,6 @@ yylex ()
case AGGR:
do_aggr ();
- after_friend = after_new = 0;
break;
case ENUM:
@@ -836,14 +826,22 @@ yylex ()
break;
}
+ after_friend = just_saw_friend;
+ after_new = just_saw_new;
+
/* class member lookup only applies to the first token after the object
expression, except for explicit destructor calls. */
if (yychr != '~')
got_object = NULL_TREE;
yychar = yychr;
- yylval = nth_token (0)->yylval;
- lineno = nth_token (0)->lineno;
+ {
+ struct token *tok = nth_token (0);
+
+ yylval = tok->yylval;
+ if (tok->lineno)
+ lineno = tok->lineno;
+ }
#ifdef SPEW_DEBUG
if (spew_debug)
@@ -1495,8 +1493,7 @@ yyerror (msgid)
error ("%s before %s'\\x%x'", string, ell, val);
}
else if (last_token == CPP_STRING
- || last_token == CPP_WSTRING
- || last_token == CPP_OSTRING)
+ || last_token == CPP_WSTRING)
error ("%s before string constant", string);
else if (last_token == CPP_NUMBER
|| last_token == CPP_INT
@@ -1504,10 +1501,12 @@ yyerror (msgid)
error ("%s before numeric constant", string);
else if (last_token == CPP_NAME)
{
- if (yylval.ttype && TREE_CODE (yylval.ttype) == IDENTIFIER_NODE)
- error ("%s before `%s'", string, IDENTIFIER_POINTER (yylval.ttype));
- else
+ if (TREE_CODE (last_token_id) == IDENTIFIER_NODE)
+ error ("%s before `%s'", string, IDENTIFIER_POINTER (last_token_id));
+ else if (ISGRAPH (yychar))
error ("%s before `%c'", string, yychar);
+ else
+ error ("%s before `\%o'", string, yychar);
}
else
error ("%s before `%s' token", string, NAME (last_token));
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index d027726b3da..add0ff9c58b 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -65,7 +65,7 @@ lvalue_p_1 (ref, treat_class_rvalues_as_lvalues)
if (TREE_CODE (TREE_TYPE (ref)) == REFERENCE_TYPE)
return clk_ordinary;
- if (ref == current_class_ptr && flag_this_is_variable <= 0)
+ if (ref == current_class_ptr)
return clk_none;
switch (TREE_CODE (ref))
@@ -516,7 +516,7 @@ cp_build_qualified_type_real (type, type_quals, complain)
if (type == error_mark_node)
return type;
- if (type_quals == TYPE_QUALS (type))
+ if (type_quals == CP_TYPE_QUALS (type))
return type;
/* A restrict-qualified pointer type must be a pointer (or reference)
@@ -883,7 +883,7 @@ debug_binfo (elem)
fprintf (stderr, "no vtable decl yet\n");
fprintf (stderr, "virtuals:\n");
virtuals = BINFO_VIRTUALS (elem);
- n = first_vfun_index (BINFO_TYPE (elem));
+ n = 0;
while (virtuals)
{
@@ -995,23 +995,6 @@ build_overload (decl, chain)
return ovl_cons (decl, chain);
}
-/* True if fn is in ovl. */
-
-int
-ovl_member (fn, ovl)
- tree fn;
- tree ovl;
-{
- if (ovl == NULL_TREE)
- return 0;
- if (TREE_CODE (ovl) != OVERLOAD)
- return ovl == fn;
- for (; ovl; ovl = OVL_CHAIN (ovl))
- if (OVL_FUNCTION (ovl) == fn)
- return 1;
- return 0;
-}
-
int
is_aggr_type_2 (t1, t2)
tree t1, t2;
@@ -1037,6 +1020,8 @@ cp_statement_code_p (code)
case RETURN_INIT:
case TRY_BLOCK:
case HANDLER:
+ case USING_STMT:
+ case EH_SPEC_BLOCK:
return 1;
default:
@@ -1187,16 +1172,18 @@ walk_tree (tp, func, data, htab)
if (!*tp)
return NULL_TREE;
- if (htab) {
- void **slot;
- /* Don't walk the same tree twice, if the user has requested that we
- avoid doing so. */
- if (htab_find (htab, *tp))
- return NULL_TREE;
- /* If we haven't already seen this node, add it to the table. */
- slot = htab_find_slot (htab, *tp, INSERT);
- *slot = *tp;
- }
+ if (htab)
+ {
+ void **slot;
+
+ /* Don't walk the same tree twice, if the user has requested
+ that we avoid doing so. */
+ if (htab_find (htab, *tp))
+ return NULL_TREE;
+ /* If we haven't already seen this node, add it to the table. */
+ slot = htab_find_slot (htab, *tp, INSERT);
+ *slot = *tp;
+ }
/* Call the function. */
walk_subtrees = 1;
@@ -1501,7 +1488,7 @@ no_linkage_helper (tp, walk_subtrees, data)
if (TYPE_P (t)
&& (CLASS_TYPE_P (t) || TREE_CODE (t) == ENUMERAL_TYPE)
&& (decl_function_context (TYPE_MAIN_DECL (t))
- || ANON_AGGRNAME_P (TYPE_IDENTIFIER (t))))
+ || TYPE_ANONYMOUS_P (t)))
return t;
return NULL_TREE;
}
@@ -1955,10 +1942,10 @@ cp_tree_equal (t1, t2)
as being equivalent to anything. */
if ((TREE_CODE (TREE_OPERAND (t1, 0)) == VAR_DECL
&& DECL_NAME (TREE_OPERAND (t1, 0)) == NULL_TREE
- && DECL_RTL (TREE_OPERAND (t1, 0)) == 0)
+ && !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 (TREE_OPERAND (t2, 0)) == 0))
+ && !DECL_RTL_SET_P (TREE_OPERAND (t2, 0))))
cmp = 1;
else
cmp = cp_tree_equal (TREE_OPERAND (t1, 0), TREE_OPERAND (t2, 0));
@@ -2007,21 +1994,27 @@ cp_tree_equal (t1, t2)
switch (TREE_CODE_CLASS (code1))
{
- int i;
case '1':
case '2':
case '<':
case 'e':
case 'r':
case 's':
- 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;
+ {
+ 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;
+ }
+
+ case 't':
+ return same_type_p (t1, t2) ? 1 : 0;
}
return -1;
@@ -2212,6 +2205,19 @@ cp_valid_lang_attribute (attr_name, attr_args, decl, type)
tree decl ATTRIBUTE_UNUSED;
tree type ATTRIBUTE_UNUSED;
{
+ if (is_attribute_p ("java_interface", attr_name))
+ {
+ if (attr_args != NULL_TREE
+ || decl != NULL_TREE
+ || ! CLASS_TYPE_P (type)
+ || ! TYPE_FOR_JAVA (type))
+ {
+ error ("`java_interface' attribute can only be applied to Java class definitions");
+ return 0;
+ }
+ TYPE_JAVA_INTERFACE (type) = 1;
+ return 1;
+ }
if (is_attribute_p ("com_interface", attr_name))
{
if (! flag_vtable_thunks)
@@ -2229,9 +2235,6 @@ cp_valid_lang_attribute (attr_name, attr_args, decl, type)
return 0;
}
- if (!flag_new_abi)
- /* The v3 ABI is already COM compliant; don't set this flag. */
- CLASSTYPE_COM_INTERFACE (type) = 1;
return 1;
}
else if (is_attribute_p ("init_priority", attr_name))
@@ -2322,6 +2325,7 @@ init_tree ()
make_lang_type_fn = cp_make_lang_type;
lang_unsave = cp_unsave;
lang_statement_code_p = cp_statement_code_p;
+ lang_set_decl_assembler_name = mangle_decl;
list_hash_table = htab_create (31, list_hash, list_hash_eq, NULL);
ggc_add_root (&list_hash_table, 1,
sizeof (list_hash_table),
diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c
index ef2a9217a81..2539a9d857c 100644
--- a/gcc/cp/typeck.c
+++ b/gcc/cp/typeck.c
@@ -1550,7 +1550,7 @@ c_sizeof (type)
tree size;
if (processing_template_decl)
- return build_min (SIZEOF_EXPR, sizetype, type);
+ return build_min_nt (SIZEOF_EXPR, type);
if (code == FUNCTION_TYPE)
{
@@ -1612,7 +1612,7 @@ expr_sizeof (e)
tree e;
{
if (processing_template_decl)
- return build_min (SIZEOF_EXPR, sizetype, e);
+ return build_min_nt (SIZEOF_EXPR, e);
if (TREE_CODE (e) == COMPONENT_REF
&& DECL_C_BIT_FIELD (TREE_OPERAND (e, 1)))
@@ -1686,7 +1686,7 @@ c_alignof (type)
tree t;
if (processing_template_decl)
- return build_min (ALIGNOF_EXPR, sizetype, type);
+ return build_min_nt (ALIGNOF_EXPR, type);
if (code == FUNCTION_TYPE || code == METHOD_TYPE)
t = size_int (FUNCTION_BOUNDARY / BITS_PER_UNIT);
@@ -1733,6 +1733,12 @@ decay_conversion (exp)
if (type == error_mark_node)
return error_mark_node;
+ if (type_unknown_p (exp))
+ {
+ incomplete_type_error (exp, TREE_TYPE (exp));
+ return error_mark_node;
+ }
+
/* Constants can be used directly unless they're not loadable. */
if (TREE_CODE (exp) == CONST_DECL)
exp = DECL_INITIAL (exp);
@@ -2433,6 +2439,27 @@ build_array_ref (array, idx)
|| TREE_TYPE (idx) == error_mark_node)
return error_mark_node;
+ /* If ARRAY is a COMPOUND_EXPR or COND_EXPR, move our reference
+ inside it. */
+ switch (TREE_CODE (array))
+ {
+ case COMPOUND_EXPR:
+ {
+ tree value = build_array_ref (TREE_OPERAND (array, 1), idx);
+ return build (COMPOUND_EXPR, TREE_TYPE (value),
+ TREE_OPERAND (array, 0), value);
+ }
+
+ case COND_EXPR:
+ return build_conditional_expr
+ (TREE_OPERAND (array, 0),
+ build_array_ref (TREE_OPERAND (array, 1), idx),
+ build_array_ref (TREE_OPERAND (array, 2), idx));
+
+ default:
+ break;
+ }
+
if (TREE_CODE (TREE_TYPE (array)) == ARRAY_TYPE
&& TREE_CODE (array) != INDIRECT_REF)
{
@@ -2469,6 +2496,7 @@ build_array_ref (array, idx)
if (mark_addressable (array) == 0)
return error_mark_node;
}
+
/* An array that is indexed by a constant value which is not within
the array bounds cannot be stored in a register either; because we
would get a crash in store_bit_field/extract_bit_field when trying
@@ -2872,6 +2900,11 @@ get_member_function_from_ptrfunc (instance_ptrptr, function)
e3 = PFN_FROM_PTRMEMFUNC (function);
+ vtbl = convert_pointer_to (ptr_type_node, instance);
+ delta = cp_convert (ptrdiff_type_node,
+ build_component_ref (function, delta_identifier,
+ NULL_TREE, 0));
+
/* This used to avoid checking for virtual functions if basetype
has no virtual functions, according to an earlier ANSI draft.
With the final ISO C++ rules, such an optimization is
@@ -2884,35 +2917,34 @@ get_member_function_from_ptrfunc (instance_ptrptr, function)
load-with-sign-extend, while the second used normal load then
shift to sign-extend. An optimizer flaw, perhaps, but it's
easier to make this change. */
- if (flag_new_abi)
+ switch (TARGET_PTRMEMFUNC_VBIT_LOCATION)
{
+ case ptrmemfunc_vbit_in_pfn:
idx = cp_build_binary_op (TRUNC_DIV_EXPR,
build1 (NOP_EXPR, vtable_index_type, e3),
TYPE_SIZE_UNIT (vtable_entry_type));
e1 = cp_build_binary_op (BIT_AND_EXPR,
build1 (NOP_EXPR, vtable_index_type, e3),
integer_one_node);
- }
- else
- {
- idx = save_expr (default_conversion
- (build_component_ref (function,
- index_identifier,
- NULL_TREE, 0)));
- e1 = cp_build_binary_op (GE_EXPR, idx, integer_zero_node);
- idx = cp_build_binary_op (MINUS_EXPR, idx, integer_one_node);
+ break;
+
+ case ptrmemfunc_vbit_in_delta:
+ idx = build1 (NOP_EXPR, vtable_index_type, e3);
+ e1 = cp_build_binary_op (BIT_AND_EXPR,
+ delta, integer_one_node);
+ delta = cp_build_binary_op (RSHIFT_EXPR,
+ build1 (NOP_EXPR, vtable_index_type,
+ delta),
+ integer_one_node);
+ break;
+
+ default:
+ abort ();
}
- vtbl = convert_pointer_to (ptr_type_node, instance);
- delta = cp_convert (ptrdiff_type_node,
- build_component_ref (function, delta_identifier,
- NULL_TREE, 0));
- if (flag_new_abi)
- /* DELTA2 is the amount by which to adjust the `this' pointer
- to find the vtbl. */
- delta2 = delta;
- else
- delta2 = DELTA2_FROM_PTRMEMFUNC (function);
+ /* DELTA2 is the amount by which to adjust the `this' pointer
+ to find the vtbl. */
+ delta2 = delta;
vtbl = build
(PLUS_EXPR,
build_pointer_type (build_pointer_type (vtable_entry_type)),
@@ -2938,6 +2970,13 @@ get_member_function_from_ptrfunc (instance_ptrptr, function)
e2 = aref;
else
e2 = build_component_ref (aref, pfn_identifier, NULL_TREE, 0);
+
+ /* When using function descriptors, the address of the
+ vtable entry is treated as a function pointer. */
+ if (TARGET_VTABLE_USES_DESCRIPTORS)
+ e2 = build1 (NOP_EXPR, TREE_TYPE (e2),
+ build_unary_op (ADDR_EXPR, e2, /*noconvert=*/1));
+
TREE_TYPE (e2) = TREE_TYPE (e3);
e1 = build_conditional_expr (e1, e2, e3);
@@ -3205,8 +3244,7 @@ convert_arguments (typelist, values, fndecl, flags)
(NULL_TREE, type, val, flags,
"argument passing", fndecl, i);
if (PROMOTE_PROTOTYPES
- && (TREE_CODE (type) == INTEGER_TYPE
- || TREE_CODE (type) == ENUMERAL_TYPE)
+ && INTEGRAL_TYPE_P (type)
&& (TYPE_PRECISION (type)
< TYPE_PRECISION (integer_type_node)))
parmval = default_conversion (parmval);
@@ -3355,17 +3393,24 @@ build_binary_op (code, orig_op0, orig_op1, convert_p)
int common = 0;
/* Apply default conversions. */
+ op0 = orig_op0;
+ op1 = orig_op1;
+
if (code == TRUTH_AND_EXPR || code == TRUTH_ANDIF_EXPR
|| code == TRUTH_OR_EXPR || code == TRUTH_ORIF_EXPR
|| code == TRUTH_XOR_EXPR)
{
- op0 = decay_conversion (orig_op0);
- op1 = decay_conversion (orig_op1);
+ if (!really_overloaded_fn (op0))
+ op0 = decay_conversion (op0);
+ if (!really_overloaded_fn (op1))
+ op1 = decay_conversion (op1);
}
else
{
- op0 = default_conversion (orig_op0);
- op1 = default_conversion (orig_op1);
+ if (!really_overloaded_fn (op0))
+ op0 = default_conversion (op0);
+ if (!really_overloaded_fn (op1))
+ op1 = default_conversion (op1);
}
/* Strip NON_LVALUE_EXPRs, etc., since we aren't using as an lvalue. */
@@ -3630,16 +3675,8 @@ build_binary_op (code, orig_op0, orig_op1, convert_p)
}
else if (TYPE_PTRMEMFUNC_P (type0) && null_ptr_cst_p (op1))
{
- if (flag_new_abi)
- {
- op0 = build_component_ref (op0, pfn_identifier, NULL_TREE, 0);
- op1 = cp_convert (TREE_TYPE (op0), integer_zero_node);
- }
- else
- {
- op0 = build_component_ref (op0, index_identifier, NULL_TREE, 0);
- op1 = integer_zero_node;
- }
+ op0 = build_component_ref (op0, pfn_identifier, NULL_TREE, 0);
+ op1 = cp_convert (TREE_TYPE (op0), integer_zero_node);
result_type = TREE_TYPE (op0);
}
else if (TYPE_PTRMEMFUNC_P (type1) && null_ptr_cst_p (op0))
@@ -3652,80 +3689,38 @@ build_binary_op (code, orig_op0, orig_op1, convert_p)
/* E1 and E2 are for scratch. */
tree e1;
tree e2;
+ tree pfn0;
+ tree pfn1;
+ tree delta0;
+ tree delta1;
if (TREE_SIDE_EFFECTS (op0))
op0 = save_expr (op0);
if (TREE_SIDE_EFFECTS (op1))
op1 = save_expr (op1);
- if (flag_new_abi)
- {
- /* We generate:
-
- (op0.pfn == op1.pfn
- && (!op0.pfn || op0.delta == op1.delta))
-
- The reason for the `!op0.pfn' bit is that a NULL
- pointer-to-member is any member with a zero PFN; the
- DELTA field is unspecified. */
- tree pfn0;
- tree pfn1;
- tree delta0;
- tree delta1;
-
- pfn0 = pfn_from_ptrmemfunc (op0);
- pfn1 = pfn_from_ptrmemfunc (op1);
- delta0 = build_component_ref (op0, delta_identifier,
- NULL_TREE, 0);
- delta1 = build_component_ref (op1, delta_identifier,
- NULL_TREE, 0);
- e1 = cp_build_binary_op (EQ_EXPR, delta0, delta1);
- e2 = cp_build_binary_op (EQ_EXPR,
- pfn0,
- cp_convert (TREE_TYPE (pfn0),
- integer_zero_node));
- e1 = cp_build_binary_op (TRUTH_ORIF_EXPR, e1, e2);
- e2 = build (EQ_EXPR, boolean_type_node, pfn0, pfn1);
- e = cp_build_binary_op (TRUTH_ANDIF_EXPR, e2, e1);
- }
- else
- {
- /* The code we generate for the test is:
-
- (op0.index == op1.index
- && op0.delta == op1.delta
- && (op1.index == -1 ? op0.pfn == op1.pfn
- : op0.delta2 == op1.delta2)) */
-
- tree index0 = build_component_ref (op0, index_identifier,
- NULL_TREE, 0);
- tree index1
- = save_expr (build_component_ref (op1, index_identifier,
- NULL_TREE, 0));
- tree delta0 = build_component_ref (op0, delta_identifier,
- NULL_TREE, 0);
- tree delta1 = build_component_ref (op1, delta_identifier,
- NULL_TREE, 0);
- tree pfn0 = PFN_FROM_PTRMEMFUNC (op0);
- tree pfn1 = PFN_FROM_PTRMEMFUNC (op1);
- tree delta20 = DELTA2_FROM_PTRMEMFUNC (op0);
- tree delta21 = DELTA2_FROM_PTRMEMFUNC (op1);
- tree e3;
- tree integer_neg_one_node
- = cp_build_binary_op (MINUS_EXPR, integer_zero_node,
- integer_one_node);
- e1 = cp_build_binary_op (EQ_EXPR, index1, integer_neg_one_node);
- /* We can't use build_binary_op for this cmp because it
- would get confused by the ptr to method types and
- think we want pmfs. */
- e2 = build (EQ_EXPR, boolean_type_node, pfn0, pfn1);
- e3 = cp_build_binary_op (EQ_EXPR, delta20, delta21);
- e = build_conditional_expr (e1, e2, e3);
- e1 = cp_build_binary_op (EQ_EXPR, index0, index1);
- e = cp_build_binary_op (TRUTH_ANDIF_EXPR, e1, e);
- e1 = cp_build_binary_op (EQ_EXPR, delta0, delta1);
- e = cp_build_binary_op (TRUTH_ANDIF_EXPR, e1, e);
- }
+ /* We generate:
+
+ (op0.pfn == op1.pfn
+ && (!op0.pfn || op0.delta == op1.delta))
+
+ The reason for the `!op0.pfn' bit is that a NULL
+ pointer-to-member is any member with a zero PFN; the
+ DELTA field is unspecified. */
+ pfn0 = pfn_from_ptrmemfunc (op0);
+ pfn1 = pfn_from_ptrmemfunc (op1);
+ delta0 = build_component_ref (op0, delta_identifier,
+ NULL_TREE, 0);
+ delta1 = build_component_ref (op1, delta_identifier,
+ NULL_TREE, 0);
+ e1 = cp_build_binary_op (EQ_EXPR, delta0, delta1);
+ e2 = cp_build_binary_op (EQ_EXPR,
+ pfn0,
+ cp_convert (TREE_TYPE (pfn0),
+ integer_zero_node));
+ e1 = cp_build_binary_op (TRUTH_ORIF_EXPR, e1, e2);
+ e2 = build (EQ_EXPR, boolean_type_node, pfn0, pfn1);
+ e = cp_build_binary_op (TRUTH_ANDIF_EXPR, e2, e1);
if (code == EQ_EXPR)
return e;
return cp_build_binary_op (EQ_EXPR, e, integer_zero_node);
@@ -4371,6 +4366,8 @@ condition_conversion (expr)
tree t;
if (processing_template_decl)
return expr;
+ if (TREE_CODE (expr) == OFFSET_REF)
+ expr = resolve_offset_ref (expr);
t = perform_implicit_conversion (boolean_type_node, expr);
t = fold (build1 (CLEANUP_POINT_EXPR, boolean_type_node, t));
return t;
@@ -4717,7 +4714,7 @@ build_unary_op (code, xarg, noconvert)
if (current_class_type
&& TREE_OPERAND (arg, 0) == current_class_ref)
/* An expression like &memfn. */
- cp_pedwarn ("ISO C++ forbids taking the address of a non-static member function to form a pointer to member function. Say `&%T::%D'", base, name);
+ cp_pedwarn ("ISO C++ forbids taking the address of an unqualified non-static member function to form a pointer to member function. Say `&%T::%D'", base, name);
else
cp_pedwarn ("ISO C++ forbids taking the address of a bound member function to form a pointer to member function. Say `&%T::%D'", base, name);
}
@@ -4951,8 +4948,7 @@ mark_addressable (exp)
case PARM_DECL:
if (x == current_class_ptr)
{
- if (! flag_this_is_variable)
- error ("cannot take the address of `this', which is an ravlue expression");
+ error ("cannot take the address of `this', which is an rvalue expression");
TREE_ADDRESSABLE (x) = 1; /* so compiler doesn't die later */
return 1;
}
@@ -5130,7 +5126,6 @@ build_static_cast (type, expr)
build_tree_list (NULL_TREE, expr),
TYPE_BINFO (type), LOOKUP_NORMAL)));
- expr = decay_conversion (expr);
intype = TREE_TYPE (expr);
/* FIXME handle casting to array type. */
@@ -6025,96 +6020,30 @@ get_delta_difference (from, to, force)
the other components as specified. */
tree
-build_ptrmemfunc1 (type, delta, idx, pfn, delta2)
- tree type, delta, idx, pfn, delta2;
+build_ptrmemfunc1 (type, delta, pfn)
+ tree type, delta, pfn;
{
tree u = NULL_TREE;
tree delta_field;
- tree idx_field;
- tree pfn_or_delta2_field;
tree pfn_field;
- tree delta2_field;
- tree subtype;
- int allconstant, allsimple;
/* Pull the FIELD_DECLs out of the type. */
- if (flag_new_abi)
- {
- pfn_field = TYPE_FIELDS (type);
- delta_field = TREE_CHAIN (pfn_field);
- idx_field = NULL_TREE;
- pfn_or_delta2_field = NULL_TREE;
- delta2_field = NULL_TREE;
- subtype = NULL_TREE;
- }
- else
- {
- delta_field = TYPE_FIELDS (type);
- idx_field = TREE_CHAIN (delta_field);
- pfn_or_delta2_field = TREE_CHAIN (idx_field);
- subtype = TREE_TYPE (pfn_or_delta2_field);
- pfn_field = TYPE_FIELDS (subtype);
- delta2_field = TREE_CHAIN (pfn_field);
- }
+ pfn_field = TYPE_FIELDS (type);
+ delta_field = TREE_CHAIN (pfn_field);
/* Make sure DELTA has the type we want. */
delta = convert_and_check (delta_type_node, delta);
- /* Keep track of whether the initializer is a) constant, and b) can
- be done statically. */
- allconstant = TREE_CONSTANT (delta);
- allsimple = (initializer_constant_valid_p (delta, TREE_TYPE (delta))
- != NULL_TREE);
-
- if (pfn)
- {
- /* A non-virtual function. */
- if (!flag_new_abi)
- u = build_tree_list (pfn_field, pfn);
-
- allconstant &= TREE_CONSTANT (pfn);
- allsimple &= (initializer_constant_valid_p (pfn, TREE_TYPE (pfn))
- != NULL_TREE);
- }
- else
- {
- /* A virtual function. */
- if (flag_new_abi)
- {
- allconstant &= TREE_CONSTANT (pfn);
- allsimple &= (initializer_constant_valid_p (pfn, TREE_TYPE (pfn))
- != NULL_TREE);
- }
- else
- {
- idx = convert_and_check (delta_type_node, idx);
- u = build_tree_list (delta2_field, delta2);
-
- allconstant &= TREE_CONSTANT (idx) && TREE_CONSTANT (delta2);
- allsimple &= ((initializer_constant_valid_p (idx, TREE_TYPE (idx))
- != NULL_TREE)
- && (initializer_constant_valid_p (delta2,
- TREE_TYPE (delta2))
- != NULL_TREE));
- }
- }
-
/* Finish creating the initializer. */
- if (flag_new_abi)
- u = tree_cons (pfn_field, pfn,
- build_tree_list (delta_field, delta));
- else
- {
- u = build (CONSTRUCTOR, subtype, NULL_TREE, u);
- u = tree_cons (delta_field, delta,
- tree_cons (idx_field,
- idx,
- build_tree_list (pfn_or_delta2_field,
- u)));
- }
+ u = tree_cons (pfn_field, pfn,
+ build_tree_list (delta_field, delta));
u = build (CONSTRUCTOR, type, NULL_TREE, u);
- TREE_CONSTANT (u) = allconstant;
- TREE_STATIC (u) = allconstant && allsimple;
+ TREE_CONSTANT (u) = TREE_CONSTANT (pfn) && TREE_CONSTANT (delta);
+ TREE_STATIC (u) = (TREE_CONSTANT (u)
+ && (initializer_constant_valid_p (pfn, TREE_TYPE (pfn))
+ != NULL_TREE)
+ && (initializer_constant_valid_p (delta, TREE_TYPE (delta))
+ != NULL_TREE));
return u;
}
@@ -6141,12 +6070,9 @@ build_ptrmemfunc (type, pfn, force)
/* Handle multiple conversions of pointer to member functions. */
if (TYPE_PTRMEMFUNC_P (TREE_TYPE (pfn)))
{
- tree idx = integer_zero_node;
- tree delta = integer_zero_node;
- tree delta2 = integer_zero_node;
+ tree delta = NULL_TREE;
tree npfn = NULL_TREE;
- tree ndelta, ndelta2;
- tree e1, e2, e3, n;
+ tree n;
if (!force
&& !can_convert_arg (to_type, TREE_TYPE (pfn), pfn))
@@ -6172,56 +6098,22 @@ build_ptrmemfunc (type, pfn, force)
if (TREE_SIDE_EFFECTS (pfn))
pfn = save_expr (pfn);
- if (flag_new_abi)
- {
- /* Under the new ABI, the conversion is easy. Just adjust
- the DELTA field. */
- npfn = build_component_ref (pfn, pfn_identifier, NULL_TREE, 0);
- delta = build_component_ref (pfn, delta_identifier, NULL_TREE, 0);
- delta = cp_convert (ptrdiff_type_node, delta);
- delta = cp_build_binary_op (PLUS_EXPR, delta, n);
- return build_ptrmemfunc1 (to_type, delta, NULL_TREE, npfn,
- NULL_TREE);
- }
-
+ /* Obtain the function pointer and the current DELTA. */
if (TREE_CODE (pfn) == PTRMEM_CST)
- {
- /* We could just build the resulting CONSTRUCTOR now, but we
- don't, relying on the general machinery below, together
- with constant-folding, to do the right thing. */
- expand_ptrmemfunc_cst (pfn, &ndelta, &idx, &npfn, &ndelta2);
- if (npfn)
- /* This constant points to a non-virtual function.
- NDELTA2 will be NULL, but it's value doesn't really
- matter since we won't use it anyhow. */
- ndelta2 = integer_zero_node;
- }
+ expand_ptrmemfunc_cst (pfn, &delta, &npfn);
else
{
- ndelta = cp_convert (ptrdiff_type_node,
- build_component_ref (pfn,
- delta_identifier,
- NULL_TREE, 0));
- ndelta2 = cp_convert (ptrdiff_type_node,
- DELTA2_FROM_PTRMEMFUNC (pfn));
- idx = build_component_ref (pfn, index_identifier, NULL_TREE, 0);
+ npfn = build_component_ref (pfn, pfn_identifier, NULL_TREE, 0);
+ delta = build_component_ref (pfn, delta_identifier, NULL_TREE, 0);
}
- delta = cp_build_binary_op (PLUS_EXPR, ndelta, n);
- delta2 = cp_build_binary_op (PLUS_EXPR, ndelta2, n);
- e1 = fold (build (GT_EXPR, boolean_type_node, idx, integer_zero_node));
-
- /* If it's a virtual function, this is what we want. */
- e2 = build_ptrmemfunc1 (to_type, delta, idx, NULL_TREE, delta2);
-
- pfn = PFN_FROM_PTRMEMFUNC (pfn);
- npfn = build1 (NOP_EXPR, type, pfn);
- TREE_CONSTANT (npfn) = TREE_CONSTANT (pfn);
-
- /* But if it's a non-virtual function, or NULL, we use this
- instead. */
- e3 = build_ptrmemfunc1 (to_type, delta, idx, npfn, NULL_TREE);
- return build_conditional_expr (e1, e2, e3);
+ /* Under the new ABI, the conversion is easy. Just adjust
+ the DELTA field. */
+ delta = cp_convert (ptrdiff_type_node, delta);
+ if (TARGET_PTRMEMFUNC_VBIT_LOCATION == ptrmemfunc_vbit_in_delta)
+ n = cp_build_binary_op (LSHIFT_EXPR, n, integer_one_node);
+ delta = cp_build_binary_op (PLUS_EXPR, delta, n);
+ return build_ptrmemfunc1 (to_type, delta, npfn);
}
/* Handle null pointer to member function conversions. */
@@ -6229,8 +6121,8 @@ build_ptrmemfunc (type, pfn, force)
{
pfn = build_c_cast (type, integer_zero_node);
return build_ptrmemfunc1 (to_type,
- integer_zero_node, integer_zero_node,
- pfn, NULL_TREE);
+ integer_zero_node,
+ pfn);
}
if (type_unknown_p (pfn))
@@ -6249,12 +6141,10 @@ build_ptrmemfunc (type, pfn, force)
integer_type_node. */
void
-expand_ptrmemfunc_cst (cst, delta, idx, pfn, delta2)
+expand_ptrmemfunc_cst (cst, delta, pfn)
tree cst;
tree *delta;
- tree *idx;
tree *pfn;
- tree *delta2;
{
tree type = TREE_TYPE (cst);
tree fn = PTRMEM_CST_MEMBER (cst);
@@ -6272,14 +6162,7 @@ expand_ptrmemfunc_cst (cst, delta, idx, pfn, delta2)
*delta = get_delta_difference (fn_class, ptr_class, /*force=*/0);
if (!DECL_VIRTUAL_P (fn))
- {
- if (!flag_new_abi)
- *idx = build_int_2 (-1, -1);
- else
- *idx = NULL_TREE;
- *pfn = convert (TYPE_PTRMEMFUNC_FN_TYPE (type), build_addr_func (fn));
- *delta2 = NULL_TREE;
- }
+ *pfn = convert (TYPE_PTRMEMFUNC_FN_TYPE (type), build_addr_func (fn));
else
{
/* If we're dealing with a virtual function, we have to adjust 'this'
@@ -6290,59 +6173,35 @@ expand_ptrmemfunc_cst (cst, delta, idx, pfn, delta2)
*delta = fold (build (PLUS_EXPR, TREE_TYPE (*delta),
*delta, BINFO_OFFSET (binfo)));
- if (!flag_new_abi)
- {
- /* Map everything down one to make room for the null PMF. */
- *idx = fold (build (PLUS_EXPR, integer_type_node,
- DECL_VINDEX (fn), integer_one_node));
- *pfn = NULL_TREE;
- }
- else
+ /* Under the new ABI, we set PFN to the vtable offset at
+ which the function can be found, plus one (unless
+ ptrmemfunc_vbit_in_delta, in which case delta is shifted
+ left, and then incremented). */
+ *pfn = DECL_VINDEX (fn);
+ *pfn = fold (build (MULT_EXPR, integer_type_node, *pfn,
+ TYPE_SIZE_UNIT (vtable_entry_type)));
+
+ switch (TARGET_PTRMEMFUNC_VBIT_LOCATION)
{
- /* Under the new ABI, we set PFN to the vtable offset, plus
- one, at which the function can be found. */
- *idx = NULL_TREE;
- *pfn = fold (build (MULT_EXPR, integer_type_node,
- DECL_VINDEX (fn),
- TYPE_SIZE_UNIT (vtable_entry_type)));
+ case ptrmemfunc_vbit_in_pfn:
*pfn = fold (build (PLUS_EXPR, integer_type_node, *pfn,
integer_one_node));
- *pfn = fold (build1 (NOP_EXPR, TYPE_PTRMEMFUNC_FN_TYPE (type),
- *pfn));
- }
-
- /* Offset from an object of PTR_CLASS to the vptr for ORIG_CLASS. */
- *delta2 = fold (build (PLUS_EXPR, integer_type_node, *delta,
- get_vfield_offset (TYPE_BINFO (orig_class))));
- }
-}
+ break;
-/* Return an expression for DELTA2 from the pointer-to-member function
- given by T. */
+ case ptrmemfunc_vbit_in_delta:
+ *delta = fold (build (LSHIFT_EXPR, TREE_TYPE (*delta),
+ *delta, integer_one_node));
+ *delta = fold (build (PLUS_EXPR, TREE_TYPE (*delta),
+ *delta, integer_one_node));
+ break;
-tree
-delta2_from_ptrmemfunc (t)
- tree t;
-{
- my_friendly_assert (!flag_new_abi, 20000221);
+ default:
+ abort ();
+ }
- if (TREE_CODE (t) == PTRMEM_CST)
- {
- tree delta;
- tree idx;
- tree pfn;
- tree delta2;
-
- expand_ptrmemfunc_cst (t, &delta, &idx, &pfn, &delta2);
- if (delta2)
- return delta2;
+ *pfn = fold (build1 (NOP_EXPR, TYPE_PTRMEMFUNC_FN_TYPE (type),
+ *pfn));
}
-
- return (build_component_ref
- (build_component_ref (t,
- pfn_or_delta2_identifier, NULL_TREE,
- 0),
- delta2_identifier, NULL_TREE, 0));
}
/* Return an expression for PFN from the pointer-to-member function
@@ -6355,23 +6214,14 @@ pfn_from_ptrmemfunc (t)
if (TREE_CODE (t) == PTRMEM_CST)
{
tree delta;
- tree idx;
tree pfn;
- tree delta2;
- expand_ptrmemfunc_cst (t, &delta, &idx, &pfn, &delta2);
+ expand_ptrmemfunc_cst (t, &delta, &pfn);
if (pfn)
return pfn;
}
- if (flag_new_abi)
- return build_component_ref (t, pfn_identifier, NULL_TREE, 0);
- else
- return (build_component_ref
- (build_component_ref (t,
- pfn_or_delta2_identifier, NULL_TREE,
- 0),
- pfn_identifier, NULL_TREE, 0));
+ return build_component_ref (t, pfn_identifier, NULL_TREE, 0);
}
/* Expression EXPR is about to be implicitly converted to TYPE. Warn
@@ -6778,11 +6628,6 @@ check_return_expr (retval)
return NULL_TREE;
}
- /* Under the old ABI, constructors actually always return `this',
- even though in C++ you can't return a value from a constructor. */
- if (!flag_new_abi && DECL_CONSTRUCTOR_P (current_function_decl))
- retval = current_class_ptr;
-
/* When no explicit return-value is given in a function with a named
return value, the named return value is used. */
result = DECL_RESULT (current_function_decl);
diff --git a/gcc/cp/typeck2.c b/gcc/cp/typeck2.c
index c62949ef405..b2a63c7efd1 100644
--- a/gcc/cp/typeck2.c
+++ b/gcc/cp/typeck2.c
@@ -814,12 +814,18 @@ process_init_constructor (type, init, elts)
next1 = build_functional_cast (TREE_TYPE (field),
NULL_TREE);
else
- next1 = build (CONSTRUCTOR, NULL_TREE, NULL_TREE,
- NULL_TREE);
+ {
+ next1 = build (CONSTRUCTOR, NULL_TREE, NULL_TREE,
+ NULL_TREE);
+ if (init)
+ TREE_HAS_CONSTRUCTOR (next1)
+ = TREE_HAS_CONSTRUCTOR (init);
+ }
next1 = digest_init (TREE_TYPE (field), next1, 0);
/* Warn when some struct elements are implicitly initialized. */
- if (extra_warnings)
+ if (extra_warnings
+ && (!init || TREE_HAS_CONSTRUCTOR (init)))
cp_warning ("missing initializer for member `%D'", field);
}
else
@@ -835,7 +841,8 @@ process_init_constructor (type, init, elts)
/* Warn when some struct elements are implicitly initialized
to zero. */
- if (extra_warnings)
+ if (extra_warnings
+ && (!init || TREE_HAS_CONSTRUCTOR (init)))
cp_warning ("missing initializer for member `%D'", field);
/* The default zero-initialization is fine for us; don't
@@ -1086,6 +1093,9 @@ build_m_component_ref (datum, component)
return build_min_nt (DOTSTAR_EXPR, datum, component);
datum = decay_conversion (datum);
+ if (datum == error_mark_node || component == error_mark_node)
+ return error_mark_node;
+
objtype = TYPE_MAIN_VARIANT (TREE_TYPE (datum));
if (TYPE_PTRMEMFUNC_P (TREE_TYPE (component)))
@@ -1093,18 +1103,18 @@ build_m_component_ref (datum, component)
type = TREE_TYPE (TYPE_PTRMEMFUNC_FN_TYPE (TREE_TYPE (component)));
field_type = type;
}
- else
+ else if (TYPE_PTRMEM_P (TREE_TYPE (component)))
{
type = TREE_TYPE (TREE_TYPE (component));
field_type = TREE_TYPE (type);
}
-
- if (datum == error_mark_node || component == error_mark_node)
- return error_mark_node;
+ else
+ type = error_mark_node;
if (TREE_CODE (type) != OFFSET_TYPE && TREE_CODE (type) != METHOD_TYPE)
{
- cp_error ("`%E' cannot be used as a member pointer, since it is of type `%T'", component, type);
+ cp_error ("`%E' cannot be used as a member pointer, since it is of type `%T'",
+ component, TREE_TYPE (component));
return error_mark_node;
}
diff --git a/gcc/cpp.1 b/gcc/cpp.1
deleted file mode 100644
index 0f950fa887f..00000000000
--- a/gcc/cpp.1
+++ /dev/null
@@ -1,731 +0,0 @@
-.\" Automatically generated by Pod::Man version 1.1
-.\" Wed Jan 24 19:43:25 2001
-.\"
-.\" Standard preamble:
-.\" ======================================================================
-.de Sh \" Subsection heading
-.br
-.if t .Sp
-.ne 5
-.PP
-\fB\\$1\fR
-.PP
-..
-.de Sp \" Vertical space (when we can't use .PP)
-.if t .sp .5v
-.if n .sp
-..
-.de Ip \" List item
-.br
-.ie \\n(.$>=3 .ne \\$3
-.el .ne 3
-.IP "\\$1" \\$2
-..
-.de Vb \" Begin verbatim text
-.ft CW
-.nf
-.ne \\$1
-..
-.de Ve \" End verbatim text
-.ft R
-
-.fi
-..
-.\" Set up some character translations and predefined strings. \*(-- will
-.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
-.\" double quote, and \*(R" will give a right double quote. | will give a
-.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used
-.\" to do unbreakable dashes and therefore won't be available. \*(C` and
-.\" \*(C' expand to `' in nroff, nothing in troff, for use with C<>
-.tr \(*W-|\(bv\*(Tr
-.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
-.ie n \{\
-. ds -- \(*W-
-. ds PI pi
-. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
-. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
-. ds L" ""
-. ds R" ""
-. ds C` ""
-. ds C' ""
-'br\}
-.el\{\
-. ds -- \|\(em\|
-. ds PI \(*p
-. ds L" ``
-. ds R" ''
-'br\}
-.\"
-.\" If the F register is turned on, we'll generate index entries on stderr
-.\" for titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and
-.\" index entries marked with X<> in POD. Of course, you'll have to process
-.\" the output yourself in some meaningful fashion.
-.if \nF \{\
-. de IX
-. tm Index:\\$1\t\\n%\t"\\$2"
-..
-. nr % 0
-. rr F
-.\}
-.\"
-.\" For nroff, turn off justification. Always turn off hyphenation; it
-.\" makes way too many mistakes in technical documents.
-.hy 0
-.if n .na
-.\"
-.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
-.\" Fear. Run. Save yourself. No user-serviceable parts.
-.bd B 3
-. \" fudge factors for nroff and troff
-.if n \{\
-. ds #H 0
-. ds #V .8m
-. ds #F .3m
-. ds #[ \f1
-. ds #] \fP
-.\}
-.if t \{\
-. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
-. ds #V .6m
-. ds #F 0
-. ds #[ \&
-. ds #] \&
-.\}
-. \" simple accents for nroff and troff
-.if n \{\
-. ds ' \&
-. ds ` \&
-. ds ^ \&
-. ds , \&
-. ds ~ ~
-. ds /
-.\}
-.if t \{\
-. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
-. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
-. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
-. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
-. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
-. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
-.\}
-. \" troff and (daisy-wheel) nroff accents
-.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
-.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
-.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
-.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
-.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
-.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
-.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
-.ds ae a\h'-(\w'a'u*4/10)'e
-.ds Ae A\h'-(\w'A'u*4/10)'E
-. \" corrections for vroff
-.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
-.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
-. \" for low resolution devices (crt and lpr)
-.if \n(.H>23 .if \n(.V>19 \
-\{\
-. ds : e
-. ds 8 ss
-. ds o a
-. ds d- d\h'-1'\(ga
-. ds D- D\h'-1'\(hy
-. ds th \o'bp'
-. ds Th \o'LP'
-. ds ae ae
-. ds Ae AE
-.\}
-.rm #[ #] #H #V #F C
-.\" ======================================================================
-.\"
-.IX Title "CPP 1"
-.TH CPP 1 "gcc-2.97" "2001-01-24" "GNU"
-.UC
-.SH "NAME"
-cpp \- The C Preprocessor
-.SH "SYNOPSIS"
-.IX Header "SYNOPSIS"
-cpp [\fB\-P\fR] [\fB\-C\fR] [\fB\-gcc\fR] [\fB\-traditional\fR]
- [\fB\-undef\fR] [\fB\-trigraphs\fR] [\fB\-pedantic\fR]
- [\fB\-W\fR\fIwarn\fR...] [\fB\-I\fR\fIdir\fR...]
- [\fB\-D\fR\fImacro\fR[=\fIdefn\fR]...] [\fB\-U\fR\fImacro\fR]
- [\fB\-A\fR\fIpredicate\fR(\fIanswer\fR)]
- [\fB\-M\fR|\fB\-MM\fR][\fB\-MG\fR][\fB\-MF\fR\fIfilename\fR]
- [\fB\-MP\fR][\fB\-MQ\fR\fItarget\fR...][\fB\-MT\fR\fItarget\fR...]
- [\fB\-x\fR \fIlanguage\fR] [\fB\-std=\fR\fIstandard\fR]
- \fIinfile\fR \fIoutfile\fR
-.PP
-Only the most useful options are listed here; see below for the remainder.
-.SH "DESCRIPTION"
-.IX Header "DESCRIPTION"
-The C preprocessor is a \fImacro processor\fR that is used automatically
-by the C compiler to transform your program before actual compilation.
-It is called a macro processor because it allows you to define
-\&\fImacros\fR, which are brief abbreviations for longer constructs.
-.PP
-The C preprocessor is intended only for macro processing of C, \*(C+ and
-Objective C source files. For macro processing of other files, you are
-strongly encouraged to use alternatives like M4, which will likely give
-you better results and avoid many problems. For example, normally the C
-preprocessor does not preserve arbitrary whitespace verbatim, but
-instead replaces each sequence with a single space.
-.PP
-For use on C-like source files, the C preprocessor provides four
-separate facilities that you can use as you see fit:
-.Ip "\(bu" 4
-Inclusion of header files. These are files of declarations that can be
-substituted into your program.
-.Ip "\(bu" 4
-Macro expansion. You can define \fImacros\fR, which are abbreviations
-for arbitrary fragments of C code, and then the C preprocessor will
-replace the macros with their definitions throughout the program.
-.Ip "\(bu" 4
-Conditional compilation. Using special preprocessing directives, you
-can include or exclude parts of the program according to various
-conditions.
-.Ip "\(bu" 4
-Line control. If you use a program to combine or rearrange source files
-into an intermediate file which is then compiled, you can use line
-control to inform the compiler of where each source line originally came
-from.
-.PP
-C preprocessors vary in some details. This manual discusses the \s-1GNU\s0 C
-preprocessor, which provides a small superset of the features of \s-1ISO\s0
-Standard C.
-.PP
-In its default mode, the \s-1GNU\s0 C preprocessor does not do a few things
-required by the standard. These are features which are rarely, if ever,
-used, and may cause surprising changes to the meaning of a program which
-does not expect them. To get strict \s-1ISO\s0 Standard C, you should use the
-\&\fB\-std=c89\fR or \fB\-std=c99\fR options, depending on which version
-of the standard you want. To get all the mandatory diagnostics, you
-must also use \fB\-pedantic\fR.
-.SH "OPTIONS"
-.IX Header "OPTIONS"
-The C preprocessor expects two file names as arguments, \fIinfile\fR and
-\&\fIoutfile\fR. The preprocessor reads \fIinfile\fR together with any
-other files it specifies with \fB#include\fR. All the output generated
-by the combined input files is written in \fIoutfile\fR.
-.PP
-Either \fIinfile\fR or \fIoutfile\fR may be \fB-\fR, which as
-\&\fIinfile\fR means to read from standard input and as \fIoutfile\fR
-means to write to standard output. Also, if either file is omitted, it
-means the same as if \fB-\fR had been specified for that file.
-.PP
-Here is a table of command options accepted by the C preprocessor.
-These options can also be given when compiling a C program; they are
-passed along automatically to the preprocessor when it is invoked by the
-compiler.
-.Ip "\fB\-P\fR" 4
-.IX Item "-P"
-Inhibit generation of \fB#\fR\-lines with line-number information in the
-output from the preprocessor. This might be useful when running the
-preprocessor on something that is not C code and will be sent to a
-program which might be confused by the \fB#\fR\-lines.
-.Ip "\fB\-C\fR" 4
-.IX Item "-C"
-Do not discard comments. All comments are passed through to the output
-file, except for comments in processed directives, which are deleted
-along with the directive. Comments appearing in the expansion list of a
-macro will be preserved, and appear in place wherever the macro is
-invoked.
-.Sp
-You should be prepared for side effects when using \fB\-C\fR; it causes
-the preprocessor to treat comments as tokens in their own right. For
-example, macro redefinitions that were trivial when comments were
-replaced by a single space might become significant when comments are
-retained. Also, comments appearing at the start of what would be a
-directive line have the effect of turning that line into an ordinary
-source line, since the first token on the line is no longer a \fB#\fR.
-.Ip "\fB\-traditional\fR" 4
-.IX Item "-traditional"
-Try to imitate the behavior of old-fashioned C, as opposed to \s-1ISO\s0 C.
-.RS 4
-.Ip "\(bu" 4
-Traditional macro expansion pays no attention to single-quote or
-double-quote characters; macro argument symbols are replaced by the
-argument values even when they appear within apparent string or
-character constants.
-.Ip "\(bu" 4
-Traditionally, it is permissible for a macro expansion to end in the
-middle of a string or character constant. The constant continues into
-the text surrounding the macro call.
-.Ip "\(bu" 4
-However, traditionally the end of the line terminates a string or
-character constant, with no error.
-.Ip "\(bu" 4
-In traditional C, a comment is equivalent to no text at all. (In \s-1ISO\s0
-C, a comment counts as whitespace.)
-.Ip "\(bu" 4
-Traditional C does not have the concept of a ``preprocessing number''.
-It considers \fB1.0e+4\fR to be three tokens: \fB1.0e\fR, \fB+\fR,
-and \fB4\fR.
-.Ip "\(bu" 4
-A macro is not suppressed within its own definition, in traditional C.
-Thus, any macro that is used recursively inevitably causes an error.
-.Ip "\(bu" 4
-The character \fB#\fR has no special meaning within a macro definition
-in traditional C.
-.Ip "\(bu" 4
-In traditional C, the text at the end of a macro expansion can run
-together with the text after the macro call, to produce a single token.
-(This is impossible in \s-1ISO\s0 C.)
-.Ip "\(bu" 4
-None of the \s-1GNU\s0 extensions to the preprocessor are available in
-\&\fB\-traditional\fR mode.
-.RE
-.RS 4
-.Sp
-Use the \fB\-traditional\fR option when preprocessing Fortran code, so
-that single-quotes and double-quotes within Fortran comment lines (which
-are generally not recognized as such by the preprocessor) do not cause
-diagnostics about unterminated character or string constants.
-.Sp
-However, this option does not prevent diagnostics about unterminated
-comments when a C-style comment appears to start, but not end, within
-Fortran-style commentary.
-.Sp
-So, the following Fortran comment lines are accepted with
-\&\fB\-traditional\fR:
-.Sp
-.Vb 3
-\& C This isn't an unterminated character constant
-\& C Neither is "20000000000, an octal constant
-\& C in some dialects of Fortran
-.Ve
-However, this type of comment line will likely produce a diagnostic, or
-at least unexpected output from the preprocessor, due to the
-unterminated comment:
-.Sp
-.Vb 2
-\& C Some Fortran compilers accept /* as starting
-\& C an inline comment.
-.Ve
-Note that \f(CW\*(C`g77\*(C'\fR automatically supplies the \fB\-traditional\fR
-option when it invokes the preprocessor. However, a future version of
-\&\f(CW\*(C`g77\*(C'\fR might use a different, more-Fortran-aware preprocessor in
-place of \f(CW\*(C`cpp\*(C'\fR.
-.RE
-.Ip "\fB\-trigraphs\fR" 4
-.IX Item "-trigraphs"
-Process \s-1ISO\s0 standard trigraph sequences. These are three-character
-sequences, all starting with \fB??\fR, that are defined by \s-1ISO\s0 C to
-stand for single characters. For example, \fB??/\fR stands for
-\&\fB\e\fR, so \fB'??/n'\fR is a character constant for a newline. By
-default, \s-1GCC\s0 ignores trigraphs, but in standard-conforming modes it
-converts them. See the \fB\-std\fR option.
-.Sp
-The nine trigraph sequences are
-.RS 4
-.Ip "\fB??(\fR" 4
-.IX Item "??("
--> \fB[\fR
-.Ip "\fB??)\fR" 4
-.IX Item "??)"
--> \fB]\fR
-.Ip "\fB??<\fR" 4
-.IX Item "??<"
--> \fB{\fR
-.Ip "\fB??>\fR" 4
-.IX Item "??>"
--> \fB}\fR
-.Ip "\fB??=\fR" 4
-.IX Item "??="
--> \fB#\fR
-.Ip "\fB??/\fR" 4
-.IX Item "??/"
--> \fB\e\fR
-.Ip "\fB??'\fR" 4
-.IX Item "??'"
--> \fB^\fR
-.Ip "\fB??!\fR" 4
-.IX Item "??!"
--> \fB|\fR
-.Ip "\fB??-\fR" 4
-.IX Item "??-"
--> \fB~\fR
-.RE
-.RS 4
-.Sp
-Trigraph support is not popular, so many compilers do not implement it
-properly. Portable code should not rely on trigraphs being either
-converted or ignored.
-.RE
-.Ip "\fB\-pedantic\fR" 4
-.IX Item "-pedantic"
-Issue warnings required by the \s-1ISO\s0 C standard in certain cases such
-as when text other than a comment follows \fB#else\fR or \fB#endif\fR.
-.Ip "\fB\-pedantic-errors\fR" 4
-.IX Item "-pedantic-errors"
-Like \fB\-pedantic\fR, except that errors are produced rather than
-warnings.
-.Ip "\fB\-Wcomment\fR" 4
-.IX Item "-Wcomment"
-.PD 0
-.Ip "\fB\-Wcomments\fR" 4
-.IX Item "-Wcomments"
-.PD
-(Both forms have the same effect).
-Warn whenever a comment-start sequence \fB/*\fR appears in a \fB/*\fR
-comment, or whenever a backslash-newline appears in a \fB//\fR comment.
-.Ip "\fB\-Wtrigraphs\fR" 4
-.IX Item "-Wtrigraphs"
-Warn if any trigraphs are encountered. This option used to take effect
-only if \fB\-trigraphs\fR was also specified, but now works
-independently. Warnings are not given for trigraphs within comments, as
-we feel this is obnoxious.
-.Ip "\fB\-Wwhite-space\fR" 4
-.IX Item "-Wwhite-space"
-Warn about possible white space confusion, e.g. white space between a
-backslash and a newline.
-.Ip "\fB\-Wall\fR" 4
-.IX Item "-Wall"
-Requests \fB\-Wcomment\fR, \fB\-Wtrigraphs\fR, and \fB\-Wwhite-space\fR
-(but not \fB\-Wtraditional\fR or \fB\-Wundef\fR).
-.Ip "\fB\-Wtraditional\fR" 4
-.IX Item "-Wtraditional"
-Warn about certain constructs that behave differently in traditional and
-\&\s-1ISO\s0 C.
-.Ip "\fB\-Wundef\fR" 4
-.IX Item "-Wundef"
-Warn if an undefined identifier is evaluated in an \fB#if\fR directive.
-.Ip "\fB\-I\fR \fIdirectory\fR" 4
-.IX Item "-I directory"
-Add the directory \fIdirectory\fR to the head of the list of
-directories to be searched for header files.
-This can be used to override a system header file, substituting your
-own version, since these directories are searched before the system
-header file directories. If you use more than one \fB\-I\fR option,
-the directories are scanned in left-to-right order; the standard
-system directories come after.
-.Ip "\fB\-I-\fR" 4
-.IX Item "-I-"
-Any directories specified with \fB\-I\fR options before the \fB\-I-\fR
-option are searched only for the case of \fB#include "\fR\fIfile\fR\fB"\fR;
-they are not searched for \fB#include <\fR\fIfile\fR\fB>\fR.
-.Sp
-If additional directories are specified with \fB\-I\fR options after
-the \fB\-I-\fR, these directories are searched for all \fB#include\fR
-directives.
-.Sp
-In addition, the \fB\-I-\fR option inhibits the use of the current
-directory as the first search directory for \fB#include "\fR\fIfile\fR\fB"\fR.
-Therefore, the current directory is searched only if it is requested
-explicitly with \fB\-I.\fR. Specifying both \fB\-I-\fR and \fB\-I.\fR
-allows you to control precisely which directories are searched before
-the current one and which are searched after.
-.Ip "\fB\-nostdinc\fR" 4
-.IX Item "-nostdinc"
-Do not search the standard system directories for header files.
-Only the directories you have specified with \fB\-I\fR options
-(and the current directory, if appropriate) are searched.
-.Sp
-By using both \fB\-nostdinc\fR and \fB\-I-\fR, you can limit the include-file
-search path to only those directories you specify explicitly.
-.Ip "\fB\-nostdinc++\fR" 4
-.IX Item "-nostdinc++"
-Do not search for header files in the \*(C+\-specific standard directories,
-but do still search the other standard directories. (This option is
-used when building the \*(C+ library.)
-.Ip "\fB\-remap\fR" 4
-.IX Item "-remap"
-When searching for a header file in a directory, remap file names if a
-file named \fIheader.gcc\fR exists in that directory. This can be used
-to work around limitations of file systems with file name restrictions.
-The \fIheader.gcc\fR file should contain a series of lines with two
-tokens on each line: the first token is the name to map, and the second
-token is the actual name to use.
-.Ip "\fB\-D\fR \fIname\fR" 4
-.IX Item "-D name"
-Predefine \fIname\fR as a macro, with definition \fB1\fR.
-.Ip "\fB\-D\fR \fIname\fR\fB=\fR\fIdefinition\fR" 4
-.IX Item "-D name=definition"
-Predefine \fIname\fR as a macro, with definition \fIdefinition\fR.
-There are no restrictions on the contents of \fIdefinition\fR, but if
-you are invoking the preprocessor from a shell or shell-like program you
-may need to use the shell's quoting syntax to protect characters such as
-spaces that have a meaning in the shell syntax. If you use more than
-one \fB\-D\fR for the same \fIname\fR, the rightmost definition takes
-effect.
-.Sp
-Any \fB\-D\fR and \fB\-U\fR options on the command line are processed in
-order, and always before \fB\-imacros\fR \fIfile\fR, regardless of the
-order in which they are written.
-.Ip "\fB\-U\fR \fIname\fR" 4
-.IX Item "-U name"
-Do not predefine \fIname\fR.
-.Sp
-Any \fB\-D\fR and \fB\-U\fR options on the command line are processed in
-order, and always before \fB\-imacros\fR \fIfile\fR, regardless of the
-order in which they are written.
-.Ip "\fB\-undef\fR" 4
-.IX Item "-undef"
-Do not predefine any nonstandard macros.
-.Ip "\fB\-gcc\fR" 4
-.IX Item "-gcc"
-Define the macros \fI_\|_GNUC_\|_\fR, \fI_\|_GNUC_MINOR_\|_\fR and
-\&\fI_\|_GNUC_PATCHLEVEL_\|_\fR. These are defined automatically when you use
-\&\fBgcc \-E\fR; you can turn them off in that case with \fB\-no-gcc\fR.
-.Ip "\fB\-A\fR \fIpredicate\fR\fB=\fR\fIanswer\fR" 4
-.IX Item "-A predicate=answer"
-Make an assertion with the predicate \fIpredicate\fR and answer
-\&\fIanswer\fR. This form is preferred to the older form \fB\-A\fR
-\&\fIpredicate\fR\fB(\fR\fIanswer\fR\fB)\fR, which is still supported, because
-it does not use shell special characters.
-.Ip "\fB\-A -\fR\fIpredicate\fR\fB=\fR\fIanswer\fR" 4
-.IX Item "-A -predicate=answer"
-Disable an assertion with the predicate \fIpredicate\fR and answer
-\&\fIanswer\fR. Specifying no predicate, by \fB\-A-\fR or \fB\-A -\fR,
-disables all predefined assertions and all assertions preceding it on
-the command line; and also undefines all predefined macros and all
-macros preceding it on the command line.
-.Ip "\fB\-dM\fR" 4
-.IX Item "-dM"
-Instead of outputting the result of preprocessing, output a list of
-\&\fB#define\fR directives for all the macros defined during the
-execution of the preprocessor, including predefined macros. This gives
-you a way of finding out what is predefined in your version of the
-preprocessor; assuming you have no file \fBfoo.h\fR, the command
-.Sp
-.Vb 1
-\& touch foo.h; cpp -dM foo.h
-.Ve
-will show the values of any predefined macros.
-.Ip "\fB\-dD\fR" 4
-.IX Item "-dD"
-Like \fB\-dM\fR except in two respects: it does \fInot\fR include the
-predefined macros, and it outputs \fIboth\fR the \fB#define\fR
-directives and the result of preprocessing. Both kinds of output go to
-the standard output file.
-.Ip "\fB\-dN\fR" 4
-.IX Item "-dN"
-Like \fB\-dD\fR, but emit only the macro names, not their expansions.
-.Ip "\fB\-dI\fR" 4
-.IX Item "-dI"
-Output \fB#include\fR directives in addition to the result of
-preprocessing.
-.Ip "\fB\-M\fR" 4
-.IX Item "-M"
-Instead of outputting the result of preprocessing, output a rule
-suitable for \f(CW\*(C`make\*(C'\fR describing the dependencies of the main source
-file. The preprocessor outputs one \f(CW\*(C`make\*(C'\fR rule containing the
-object file name for that source file, a colon, and the names of all the
-included files, including those coming from \fB\-include\fR or
-\&\fB\-imacros\fR command line options. If there are many included files
-then the rule is split into several lines using \fB\e\fR\-newline.
-.Ip "\fB\-MM\fR" 4
-.IX Item "-MM"
-Like \fB\-M\fR, but mention only the files included with \fB#include
-"\fR\fIfile\fR\fB"\fR or with \fB\-include\fR or \fB\-imacros\fR command line
-options. System header files included with \fB#include <\fR\fIfile\fR\fB>\fR
-are omitted.
-.Ip "\fB\-MF\fR \fIfile\fR" 4
-.IX Item "-MF file"
-When used with \fB\-M\fR or \fB\-MM\fR, specifies a file to write the
-dependencies to. This allows the preprocessor to write the preprocessed
-file to stdout normally. If no \fB\-MF\fR switch is given, \s-1CPP\s0 sends
-the rules to stdout and suppresses normal preprocessed output.
-.Ip "\fB\-MG\fR" 4
-.IX Item "-MG"
-When used with \fB\-M\fR or \fB\-MM\fR, \fB\-MG\fR says to treat missing
-header files as generated files and assume they live in the same
-directory as the source file. It suppresses preprocessed output, as a
-missing header file is ordinarily an error.
-.Sp
-This feature is used in automatic updating of makefiles.
-.Ip "\fB\-MP\fR" 4
-.IX Item "-MP"
-This option instructs \s-1CPP\s0 to add a phony target for each dependency
-other than the main file, causing each to depend on nothing. These
-dummy rules work around errors \f(CW\*(C`make\*(C'\fR gives if you remove header
-files without updating the \f(CW\*(C`Makefile\*(C'\fR to match.
-.Sp
-This is typical output:\-
-.Sp
-.Vb 1
-\& /tmp/test.o: /tmp/test.c /tmp/test.h
-.Ve
-.Vb 1
-\& /tmp/test.h:
-.Ve
-.Ip "\fB\-MQ\fR \fItarget\fR" 4
-.IX Item "-MQ target"
-.PD 0
-.Ip "\fB\-MT\fR \fItarget\fR" 4
-.IX Item "-MT target"
-.PD
-By default \s-1CPP\s0 uses the main file name, including any path, and appends
-the object suffix, normally ``.o'', to it to obtain the name of the
-target for dependency generation. With \fB\-MT\fR you can specify a
-target yourself, overriding the default one.
-.Sp
-If you want multiple targets, you can specify them as a single argument
-to \fB\-MT\fR, or use multiple \fB\-MT\fR options.
-.Sp
-The targets you specify are output in the order they appear on the
-command line. \fB\-MQ\fR is identical to \fB\-MT\fR, except that the
-target name is quoted for Make, but with \fB\-MT\fR it isn't. For
-example, \-MT '$(objpfx)foo.o' gives
-.Sp
-.Vb 1
-\& $(objpfx)foo.o: /tmp/foo.c
-.Ve
-but \-MQ '$(objpfx)foo.o' gives
-.Sp
-.Vb 1
-\& $$(objpfx)foo.o: /tmp/foo.c
-.Ve
-The default target is automatically quoted, as if it were given with
-\&\fB\-MQ\fR.
-.Ip "\fB\-H\fR" 4
-.IX Item "-H"
-Print the name of each header file used, in addition to other normal
-activities.
-.Ip "\fB\-imacros\fR \fIfile\fR" 4
-.IX Item "-imacros file"
-Process \fIfile\fR as input, discarding the resulting output, before
-processing the regular input file. Because the output generated from
-\&\fIfile\fR is discarded, the only effect of \fB\-imacros\fR \fIfile\fR
-is to make the macros defined in \fIfile\fR available for use in the
-main input.
-.Ip "\fB\-include\fR \fIfile\fR" 4
-.IX Item "-include file"
-Process \fIfile\fR as input, and include all the resulting output,
-before processing the regular input file.
-.Ip "\fB\-idirafter\fR \fIdir\fR" 4
-.IX Item "-idirafter dir"
-Add the directory \fIdir\fR to the second include path. The directories
-on the second include path are searched when a header file is not found
-in any of the directories in the main include path (the one that
-\&\fB\-I\fR adds to).
-.Ip "\fB\-iprefix\fR \fIprefix\fR" 4
-.IX Item "-iprefix prefix"
-Specify \fIprefix\fR as the prefix for subsequent \fB\-iwithprefix\fR
-options. If the prefix represents a directory, you should include the
-final \fB/\fR.
-.Ip "\fB\-iwithprefix\fR \fIdir\fR" 4
-.IX Item "-iwithprefix dir"
-Add a directory to the second include path. The directory's name is
-made by concatenating \fIprefix\fR and \fIdir\fR, where \fIprefix\fR was
-specified previously with \fB\-iprefix\fR.
-.Ip "\fB\-isystem\fR \fIdir\fR" 4
-.IX Item "-isystem dir"
-Add a directory to the beginning of the second include path, marking it
-as a system directory, so that it gets the same special treatment as
-is applied to the standard system directories.
-.Ip "\fB\-x c\fR" 4
-.IX Item "-x c"
-.PD 0
-.Ip "\fB\-x c++\fR" 4
-.IX Item "-x c++"
-.Ip "\fB\-x objective-c\fR" 4
-.IX Item "-x objective-c"
-.Ip "\fB\-x assembler-with-cpp\fR" 4
-.IX Item "-x assembler-with-cpp"
-.PD
-Specify the source language: C, \*(C+, Objective-C, or assembly. This has
-nothing to do with standards conformance or extensions; it merely
-selects which base syntax to expect. If you give none of these options,
-cpp will deduce the language from the extension of the source file:
-\&\fB.c\fR, \fB.cc\fR, \fB.m\fR, or \fB.S\fR. Some other common
-extensions for \*(C+ and assembly are also recognized. If cpp does not
-recognize the extension, it will treat the file as C; this is the most
-generic mode.
-.Sp
-\&\fBNote:\fR Previous versions of cpp accepted a \fB\-lang\fR option
-which selected both the language and the standards conformance level.
-This option has been removed, because it conflicts with the \fB\-l\fR
-option.
-.Ip "\fB\-std=\fR\fIstandard\fR" 4
-.IX Item "-std=standard"
-.PD 0
-.Ip "\fB\-ansi\fR" 4
-.IX Item "-ansi"
-.PD
-Specify the standard to which the code should conform. Currently cpp
-only knows about the standards for C; other language standards will be
-added in the future.
-.Sp
-\&\fIstandard\fR
-may be one of:
-.RS 4
-.if n .Ip "\f(CW""iso9899:1990""\fR" 4
-.el .Ip "\f(CWiso9899:1990\fR" 4
-.IX Item "iso9899:1990"
-.PD 0
-.if n .Ip "\f(CW""c89""\fR" 4
-.el .Ip "\f(CWc89\fR" 4
-.IX Item "c89"
-.PD
-The \s-1ISO\s0 C standard from 1990. \fBc89\fR is the customary shorthand for
-this version of the standard.
-.Sp
-The \fB\-ansi\fR option is equivalent to \fB\-std=c89\fR.
-.if n .Ip "\f(CW""iso9899:199409""\fR" 4
-.el .Ip "\f(CWiso9899:199409\fR" 4
-.IX Item "iso9899:199409"
-The 1990 C standard, as amended in 1994.
-.if n .Ip "\f(CW""iso9899:1999""\fR" 4
-.el .Ip "\f(CWiso9899:1999\fR" 4
-.IX Item "iso9899:1999"
-.PD 0
-.if n .Ip "\f(CW""c99""\fR" 4
-.el .Ip "\f(CWc99\fR" 4
-.IX Item "c99"
-.if n .Ip "\f(CW""iso9899:199x""\fR" 4
-.el .Ip "\f(CWiso9899:199x\fR" 4
-.IX Item "iso9899:199x"
-.if n .Ip "\f(CW""c9x""\fR" 4
-.el .Ip "\f(CWc9x\fR" 4
-.IX Item "c9x"
-.PD
-The revised \s-1ISO\s0 C standard, published in December 1999. Before
-publication, this was known as C9X.
-.if n .Ip "\f(CW""gnu89""\fR" 4
-.el .Ip "\f(CWgnu89\fR" 4
-.IX Item "gnu89"
-The 1990 C standard plus \s-1GNU\s0 extensions. This is the default.
-.if n .Ip "\f(CW""gnu99""\fR" 4
-.el .Ip "\f(CWgnu99\fR" 4
-.IX Item "gnu99"
-.PD 0
-.if n .Ip "\f(CW""gnu9x""\fR" 4
-.el .Ip "\f(CWgnu9x\fR" 4
-.IX Item "gnu9x"
-.PD
-The 1999 C standard plus \s-1GNU\s0 extensions.
-.RE
-.RS 4
-.RE
-.Ip "\fB\-ftabstop=NUMBER\fR" 4
-.IX Item "-ftabstop=NUMBER"
-Set the distance between tab stops. This helps the preprocessor
-report correct column numbers in warnings or errors, even if tabs appear
-on the line. Values less than 1 or greater than 100 are ignored. The
-default is 8.
-.Ip "\fB\-$\fR" 4
-.IX Item "-$"
-Forbid the use of \fB$\fR in identifiers. The C standard allows
-implementations to define extra characters that can appear in
-identifiers. By default the \s-1GNU\s0 C preprocessor permits \fB$\fR, a
-common extension.
-.SH "SEE ALSO"
-.IX Header "SEE ALSO"
-\&\fIgcc\fR\|(1), \fIas\fR\|(1), \fIld\fR\|(1), and the Info entries for \fIcpp\fR, \fIgcc\fR, and
-\&\fIbinutils\fR.
-.SH "COPYRIGHT"
-.IX Header "COPYRIGHT"
-Copyright (c) 1987, 1989, 1991, 1992, 1993, 1994, 1995, 1996,
-1997, 1998, 1999, 2000, 2001
-Free Software Foundation, Inc.
-.PP
-Permission is granted to make and distribute verbatim copies of
-this manual provided the copyright notice and this permission notice
-are preserved on all copies.
-.PP
-Permission is granted to copy and distribute modified versions of this
-manual under the conditions for verbatim copying, provided also that
-the entire resulting derived work is distributed under the terms of a
-permission notice identical to this one.
-.PP
-Permission is granted to copy and distribute translations of this manual
-into another language, under the above conditions for modified versions.
diff --git a/gcc/cpp.texi b/gcc/cpp.texi
deleted file mode 100644
index 363b84c6079..00000000000
--- a/gcc/cpp.texi
+++ /dev/null
@@ -1,3695 +0,0 @@
-\input texinfo
-@setfilename cpp.info
-@settitle The C Preprocessor
-
-@ifinfo
-@dircategory Programming
-@direntry
-* Cpp: (cpp). The GNU C preprocessor.
-@end direntry
-@end ifinfo
-
-@c @smallbook
-@c @cropmarks
-@c @finalout
-@setchapternewpage odd
-@ifinfo
-This file documents the GNU C Preprocessor.
-
-Copyright 1987, 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
-1999, 2000, 2001 Free Software Foundation, Inc.
-
-Permission is granted to make and distribute verbatim copies of
-this manual provided the copyright notice and this permission notice
-are preserved on all copies.
-
-@ignore
-Permission is granted to process this file through Tex and print the
-results, provided the printed document carries copying permission
-notice identical to this one except for the removal of this paragraph
-(this paragraph not being relevant to the printed manual).
-
-@end ignore
-Permission is granted to copy and distribute modified versions of this
-manual under the conditions for verbatim copying, provided also that
-the entire resulting derived work is distributed under the terms of a
-permission notice identical to this one.
-
-Permission is granted to copy and distribute translations of this manual
-into another language, under the above conditions for modified versions.
-@end ifinfo
-
-@titlepage
-@c @finalout
-@title The C Preprocessor
-@subtitle Last revised January 2001
-@subtitle for GCC version 2
-@author Richard M. Stallman
-@page
-@vskip 2pc
-This booklet is eventually intended to form the first chapter of a GNU
-C Language manual.
-
-@vskip 0pt plus 1filll
-@c man begin COPYRIGHT
-Copyright @copyright{} 1987, 1989, 1991, 1992, 1993, 1994, 1995, 1996,
-1997, 1998, 1999, 2000, 2001
-Free Software Foundation, Inc.
-
-Permission is granted to make and distribute verbatim copies of
-this manual provided the copyright notice and this permission notice
-are preserved on all copies.
-
-Permission is granted to copy and distribute modified versions of this
-manual under the conditions for verbatim copying, provided also that
-the entire resulting derived work is distributed under the terms of a
-permission notice identical to this one.
-
-Permission is granted to copy and distribute translations of this manual
-into another language, under the above conditions for modified versions.
-@c man end
-@end titlepage
-@page
-
-@node Top, Global Actions,, (DIR)
-@chapter The C Preprocessor
-@c man begin DESCRIPTION
-
-The C preprocessor is a @dfn{macro processor} that is used automatically
-by the C compiler to transform your program before actual compilation.
-It is called a macro processor because it allows you to define
-@dfn{macros}, which are brief abbreviations for longer constructs.
-
-The C preprocessor is intended only for macro processing of C, C++ and
-Objective C source files. For macro processing of other files, you are
-strongly encouraged to use alternatives like M4, which will likely give
-you better results and avoid many problems. For example, normally the C
-preprocessor does not preserve arbitrary whitespace verbatim, but
-instead replaces each sequence with a single space.
-
-For use on C-like source files, the C preprocessor provides four
-separate facilities that you can use as you see fit:
-
-@itemize @bullet
-@item
-Inclusion of header files. These are files of declarations that can be
-substituted into your program.
-
-@item
-Macro expansion. You can define @dfn{macros}, which are abbreviations
-for arbitrary fragments of C code, and then the C preprocessor will
-replace the macros with their definitions throughout the program.
-
-@item
-Conditional compilation. Using special preprocessing directives, you
-can include or exclude parts of the program according to various
-conditions.
-
-@item
-Line control. If you use a program to combine or rearrange source files
-into an intermediate file which is then compiled, you can use line
-control to inform the compiler of where each source line originally came
-from.
-@end itemize
-
-C preprocessors vary in some details. This manual discusses the GNU C
-preprocessor, which provides a small superset of the features of ISO
-Standard C@.
-
-In its default mode, the GNU C preprocessor does not do a few things
-required by the standard. These are features which are rarely, if ever,
-used, and may cause surprising changes to the meaning of a program which
-does not expect them. To get strict ISO Standard C, you should use the
-@samp{-std=c89} or @samp{-std=c99} options, depending on which version
-of the standard you want. To get all the mandatory diagnostics, you
-must also use @samp{-pedantic}. @xref{Invocation}.
-
-@c man end
-
-@menu
-* Global Actions:: Actions made uniformly on all input files.
-* Directives:: General syntax of preprocessing directives.
-* Header Files:: How and why to use header files.
-* Macros:: How and why to use macros.
-* Conditionals:: How and why to use conditionals.
-* Assertions:: How and why to use assertions.
-* Line Control:: Use of line control when you combine source files.
-* Other Directives:: Miscellaneous preprocessing directives.
-* Output:: Format of output from the C preprocessor.
-* Implementation:: Implementation limits and behavior.
-* Unreliable Features:: Undefined behavior and deprecated features.
-* Invocation:: How to invoke the preprocessor; command options.
-* Concept Index:: Index of concepts and terms.
-* Index:: Index of directives, predefined macros and options.
-@end menu
-
-@node Global Actions, Directives, Top, Top
-@section Transformations Made Globally
-@cindex ASCII NUL handling
-
-Most C preprocessor features are inactive unless you give specific
-directives to request their use. (Preprocessing directives are lines
-starting with a @samp{#} token, possibly preceded by whitespace;
-@pxref{Directives}). However, there are four transformations that the
-preprocessor always makes on all the input it receives, even in the
-absence of directives. These are, in order:
-
-@enumerate
-@item
-Trigraphs, if enabled, are replaced with the character they represent.
-
-@item
-Backslash-newline sequences are deleted, no matter where. This
-feature allows you to break long lines for cosmetic purposes without
-changing their meaning.
-
-Recently, the non-traditional preprocessor has relaxed its treatment of
-escaped newlines. Previously, the newline had to immediately follow a
-backslash. The current implementation allows whitespace in the form of
-spaces, horizontal and vertical tabs, and form feeds between the
-backslash and the subsequent newline. The preprocessor issues a
-warning, but treats it as a valid escaped newline and combines the two
-lines to form a single logical line. This works within comments and
-tokens, including multi-line strings, as well as between tokens.
-Comments are @emph{not} treated as whitespace for the purposes of this
-relaxation, since they have not yet been replaced with spaces.
-
-@item
-All comments are replaced with single spaces.
-
-@item
-Predefined macro names are replaced with their expansions
-(@pxref{Predefined}).
-@end enumerate
-
-For end-of-line indicators, any of \n, \r\n, \n\r and \r are recognised,
-and treated as ending a single line. As a result, if you mix these in a
-single file you might get incorrect line numbering, because the
-preprocessor would interpret the two-character versions as ending just
-one line. Previous implementations would only handle UNIX-style \n
-correctly, so DOS-style \r\n would need to be passed through a filter
-first.
-
-The first three transformations are done @emph{before} all other parsing
-and before preprocessing directives are recognized. Thus, for example,
-you can split a line mechanically with backslash-newline anywhere
-(except within trigraphs since they are replaced first; see below).
-
-@example
-/*
-*/ # /*
-*/ defi\
-ne FO\
-O 10\
-20
-@end example
-
-@noindent
-is equivalent into @samp{#define FOO 1020}.
-
-There is no way to prevent a backslash at the end of a line from being
-interpreted as a backslash-newline. For example,
-
-@example
-"foo\\
-bar"
-@end example
-
-is equivalent to @code{"foo\bar"}, not to @code{"foo\\bar"}. To avoid
-having to worry about this, do not use the GNU extension which permits
-multi-line strings. Instead, use string constant concatenation:
-
-@example
- "foo\\"
- "bar"
-@end example
-
-Your program will be more portable this way, too.
-
-There are a few things to note about the above four transformations.
-
-@itemize @bullet
-@item
-Comments and predefined macro names (or any macro names, for that
-matter) are not recognized inside the argument of an @samp{#include}
-directive, when it is delimited with quotes or with @samp{<} and
-@samp{>}.
-
-@item
-Comments and predefined macro names are never recognized within a
-character or string constant.
-
-@item
-ISO ``trigraphs'' are converted before backslash-newlines are deleted.
-If you write what looks like a trigraph with a backslash-newline inside,
-the backslash-newline is deleted as usual, but it is too late to
-recognize the trigraph.
-
-This is relevant only if you use the @samp{-trigraphs} option to enable
-trigraph processing. @xref{Invocation}.
-@end itemize
-
-The preprocessor handles null characters embedded in the input file
-depending upon the context in which the null appears. Note that here we
-are referring not to the two-character escape sequence "\0", but to the
-single character ASCII NUL.
-
-There are three different contexts in which a null character may
-appear:
-
-@itemize @bullet
-@item
-Within comments. Here, null characters are silently ignored.
-
-@item
-Within a string or character constant. Here the preprocessor emits a
-warning, but preserves the null character and passes it through to the
-output file or compiler front-end.
-
-@item
-In any other context, the preprocessor issues a warning, and discards
-the null character. The preprocessor treats it like whitespace,
-combining it with any surrounding whitespace to become a single
-whitespace block. Representing the null character by "^@@", this means
-that code like
-
-@example
-#define X^@@1
-@end example
-
-is equivalent to
-
-@example
-#define X 1
-@end example
-
-and X is defined with replacement text "1".
-@end itemize
-
-@node Directives, Header Files, Global Actions, Top
-@section Preprocessing Directives
-
-@cindex preprocessing directives
-@cindex directives
-Most preprocessor features are active only if you use preprocessing
-directives to request their use.
-
-Preprocessing directives are lines in your program that start with
-@samp{#}. Whitespace is allowed before and after the @samp{#}. The
-@samp{#} is followed by an identifier that is the @dfn{directive name}.
-For example, @samp{#define} is the directive that defines a macro.
-
-Since the @samp{#} must be the first token on the line, it cannot come
-from a macro expansion if you wish it to begin a directive. Also, the
-directive name is not macro expanded. Thus, if @samp{foo} is defined as
-a macro expanding to @samp{define}, that does not make @samp{#foo} a
-valid preprocessing directive.
-
-The set of valid directive names is fixed. Programs cannot define new
-preprocessing directives.
-
-Some directive names require arguments; these make up the rest of the
-directive line and must be separated from the directive name by
-whitespace. For example, @samp{#define} must be followed by a macro
-name and the intended expansion of the macro. @xref{Object-like
-Macros}.
-
-A preprocessing directive cannot cover more than one line. It may be
-logically extended with backslash-newline, but that has no effect on its
-meaning. Comments containing newlines can also divide the directive
-into multiple lines, but a comment is replaced by a single space before
-the directive is interpreted.
-
-@node Header Files, Macros, Directives, Top
-@section Header Files
-
-@cindex header file
-A header file is a file containing C declarations and macro definitions
-(@pxref{Macros}) to be shared between several source files. You request
-the use of a header file in your program with the C preprocessing
-directive @samp{#include}.
-
-@menu
-* Header Uses:: What header files are used for.
-* Include Syntax:: How to write @samp{#include} directives.
-* Include Operation:: What @samp{#include} does.
-* Once-Only:: Preventing multiple inclusion of one header file.
-* Inheritance:: Including one header file in another header file.
-* System Headers:: Special treatment for some header files.
-@end menu
-
-@node Header Uses, Include Syntax, Header Files, Header Files
-@subsection Uses of Header Files
-
-Header files serve two kinds of purposes.
-
-@itemize @bullet
-@item
-@cindex system header files
-System header files declare the interfaces to parts of the operating
-system. You include them in your program to supply the definitions and
-declarations you need to invoke system calls and libraries.
-
-@item
-Your own header files contain declarations for interfaces between the
-source files of your program. Each time you have a group of related
-declarations and macro definitions all or most of which are needed in
-several different source files, it is a good idea to create a header
-file for them.
-@end itemize
-
-Including a header file produces the same results in C compilation as
-copying the header file into each source file that needs it. Such
-copying would be time-consuming and error-prone. With a header file,
-the related declarations appear in only one place. If they need to be
-changed, they can be changed in one place, and programs that include the
-header file will automatically use the new version when next recompiled.
-The header file eliminates the labor of finding and changing all the
-copies as well as the risk that a failure to find one copy will result
-in inconsistencies within a program.
-
-The usual convention is to give header files names that end with
-@file{.h}. Avoid unusual characters in header file names, as they
-reduce portability.
-
-@node Include Syntax, Include Operation, Header Uses, Header Files
-@subsection The @samp{#include} Directive
-
-@findex #include
-Both user and system header files are included using the preprocessing
-directive @samp{#include}. It has three variants:
-
-@table @code
-@item #include <@var{file}>
-This variant is used for system header files. It searches for a file
-named @var{file} in a list of directories specified by you, then in a
-standard list of system directories. You specify directories to search
-for header files with the command option @samp{-I} (@pxref{Invocation}).
-The option @samp{-nostdinc} inhibits searching the standard system
-directories; in this case only the directories you specify are searched.
-
-The first @samp{>} character terminates the file name. The file name
-may contain a @samp{<} character.
-
-@item #include "@var{file}"
-This variant is used for header files of your own program. It searches
-for a file named @var{file} first in the current directory, then in the
-same directories used for system header files. The current directory is
-the directory of the current input file. It is tried first because it
-is presumed to be the location of the files that the current input file
-refers to. (If the @samp{-I-} option is used, the special treatment of
-the current directory is inhibited. @xref{Invocation}.)
-
-The first @samp{"} character terminates the file name.
-
-In both these variants, the argument behaves like a string constant in
-that comments are not recognized, and macro names are not expanded.
-Thus, in @samp{#include <x/*y>} the @samp{/*} does not start a comment
-and the directive specifies inclusion of a system header file named
-@file{x/*y}.
-
-However, in either variant, if backslashes occur within @var{file}, they
-are considered ordinary text characters, not escape characters. None of
-the character escape sequences appropriate to string constants in C are
-processed. Thus, @samp{#include "x\n\\y"} specifies a filename
-containing three backslashes.
-
-@item #include @var{anything else}
-@cindex computed @samp{#include}
-This variant is called a @dfn{computed #include}. Any @samp{#include}
-directive whose argument does not fit the above two forms is a computed
-include. The text @var{anything else} is checked for macro calls, which
-are expanded (@pxref{Macros}). When this is done, the result must match
-one of the above two variants --- in particular, the expansion must form
-a string literal token, or a sequence of tokens surrounded by angle
-braces. @xref{Implementation}.
-
-This feature allows you to define a macro which controls the file name
-to be used at a later point in the program. One application of this is
-to allow a site-specific configuration file for your program to specify
-the names of the system include files to be used. This can help in
-porting the program to various operating systems in which the necessary
-system header files are found in different places.
-@end table
-
-@node Include Operation, Once-Only, Include Syntax, Header Files
-@subsection How @samp{#include} Works
-
-The @samp{#include} directive works by directing the C preprocessor to
-scan the specified file as input before continuing with the rest of the
-current file. The output from the preprocessor contains the output
-already generated, followed by the output resulting from the included
-file, followed by the output that comes from the text after the
-@samp{#include} directive. For example, given a header file
-@file{header.h} as follows,
-
-@example
-char *test ();
-@end example
-
-@noindent
-and a main program called @file{program.c} that uses the header file,
-like this,
-
-@example
-int x;
-#include "header.h"
-
-main ()
-@{
- printf (test ());
-@}
-@end example
-
-@noindent
-the output generated by the C preprocessor for @file{program.c} as input
-would be
-
-@example
-int x;
-char *test ();
-
-main ()
-@{
- printf (test ());
-@}
-@end example
-
-Included files are not limited to declarations and macro definitions;
-those are merely the typical uses. Any fragment of a C program can be
-included from another file. The include file could even contain the
-beginning of a statement that is concluded in the containing file, or
-the end of a statement that was started in the including file. However,
-a comment or a string or character constant may not start in the
-included file and finish in the including file. An unterminated
-comment, string constant or character constant in an included file is
-considered to end (with an error message) at the end of the file.
-
-It is possible for a header file to begin or end a syntactic unit such
-as a function definition, but that would be very confusing, so don't do
-it.
-
-The line following the @samp{#include} directive is always treated as a
-separate line by the C preprocessor, even if the included file lacks a
-final newline.
-
-@node Once-Only, Inheritance, Include Operation, Header Files
-@subsection Once-Only Include Files
-@cindex repeated inclusion
-@cindex including just once
-
-Very often, one header file includes another. It can easily result that
-a certain header file is included more than once. This may lead to
-errors, if the header file defines structure types or typedefs, and is
-certainly wasteful. Therefore, we often wish to prevent multiple
-inclusion of a header file.
-
-The standard way to do this is to enclose the entire real contents of the
-file in a conditional, like this:
-
-@example
-#ifndef FILE_FOO_SEEN
-#define FILE_FOO_SEEN
-
-@var{the entire file}
-
-#endif /* FILE_FOO_SEEN */
-@end example
-
-The macro @code{FILE_FOO_SEEN} indicates that the file has been included
-once already. In a user header file, the macro name should not begin
-with @samp{_}. In a system header file, this name should begin with
-@samp{__} to avoid conflicts with user programs. In any kind of header
-file, the macro name should contain the name of the file and some
-additional text, to avoid conflicts with other header files.
-
-The GNU C preprocessor is programmed to notice when a header file uses
-this particular construct and handle it efficiently. If a header file
-is contained entirely in a @samp{#ifndef} conditional, modulo whitespace
-and comments, then it remembers that fact. If a subsequent
-@samp{#include} specifies the same file, and the macro in the
-@samp{#ifndef} is already defined, then the directive is skipped without
-processing the specified file at all.
-
-@findex #import
-In the Objective C language, there is a variant of @samp{#include}
-called @samp{#import} which includes a file, but does so at most once.
-If you use @samp{#import} @emph{instead of} @samp{#include}, then you
-don't need the conditionals inside the header file to prevent multiple
-execution of the contents.
-
-@samp{#import} is obsolete because it is not a well designed feature.
-It requires the users of a header file --- the applications programmers
---- to know that a certain header file should only be included once. It
-is much better for the header file's implementor to write the file so
-that users don't need to know this. Using @samp{#ifndef} accomplishes
-this goal.
-
-@node Inheritance, System Headers, Once-Only, Header Files
-@subsection Inheritance and Header Files
-@cindex inheritance
-@cindex overriding a header file
-
-@dfn{Inheritance} is what happens when one object or file derives some
-of its contents by virtual copying from another object or file. In
-the case of C header files, inheritance means that one header file
-includes another header file and then replaces or adds something.
-
-If the inheriting header file and the base header file have different
-names, then inheritance is straightforward: simply write @samp{#include
-"@var{base}"} in the inheriting file.
-
-Sometimes it is necessary to give the inheriting file the same name as
-the base file. This is less straightforward.
-
-For example, suppose an application program uses the system header
-@file{sys/signal.h}, but the version of @file{/usr/include/sys/signal.h}
-on a particular system doesn't do what the application program expects.
-It might be convenient to define a ``local'' version, perhaps under the
-name @file{/usr/local/include/sys/signal.h}, to override or add to the
-one supplied by the system.
-
-You can do this by compiling with the option @samp{-I.}, and writing a
-file @file{sys/signal.h} that does what the application program expects.
-Making this file include the standard @file{sys/signal.h} is not so easy
---- writing @samp{#include <sys/signal.h>} in that file doesn't work,
-because it includes your own version of the file, not the standard
-system version. Used in that file itself, this leads to an infinite
-recursion and a fatal error in compilation.
-
-@samp{#include </usr/include/sys/signal.h>} would find the proper file,
-but that is not clean, since it makes an assumption about where the
-system header file is found. This is bad for maintenance, since it
-means that any change in where the system's header files are kept
-requires a change somewhere else.
-
-@findex #include_next
-The clean way to solve this problem is to use
-@samp{#include_next}, which means, ``Include the @emph{next} file with
-this name.'' This directive works like @samp{#include} except in
-searching for the specified file: it starts searching the list of header
-file directories @emph{after} the directory in which the current file
-was found.
-
-Suppose you specify @samp{-I /usr/local/include}, and the list of
-directories to search also includes @file{/usr/include}; and suppose
-both directories contain @file{sys/signal.h}. Ordinary @samp{#include
-<sys/signal.h>} finds the file under @file{/usr/local/include}. If that
-file contains @samp{#include_next <sys/signal.h>}, it starts searching
-after that directory, and finds the file in @file{/usr/include}.
-
-@samp{#include_next} is a GCC extension and should not be used in
-programs intended to be portable to other compilers.
-
-@node System Headers,, Inheritance, Header Files
-@subsection System Headers
-@cindex system header files
-
-The header files declaring interfaces to the operating system and
-runtime libraries often cannot be written in strictly conforming C.
-Therefore, GNU C gives code found in @dfn{system headers} special
-treatment. Certain categories of warnings are suppressed, notably those
-enabled by @samp{-pedantic}.
-
-Normally, only the headers found in specific directories are considered
-system headers. The set of these directories is determined when GCC is
-compiled. There are, however, two ways to add to the set.
-
-@findex -isystem
-The @samp{-isystem} command line option adds its argument to the list of
-directories to search for headers, just like @samp{-I}. In addition,
-any headers found in that directory will be considered system headers.
-Note that unlike @samp{-I}, you must put a space between @samp{-isystem}
-and its argument.
-
-All directories named by @samp{-isystem} are searched @strong{after} all
-directories named by @samp{-I}, no matter what their order was on the
-command line. If the same directory is named by both @samp{-I} and
-@samp{-isystem}, @samp{-I} wins; it is as if the @samp{-isystem} option
-had never been specified at all.
-
-@findex #pragma GCC system_header
-There is also a directive, @samp{#pragma GCC system_header}, which tells
-GCC to consider the rest of the current include file a system header, no
-matter where it was found. Code that comes before the @samp{#pragma} in
-the file will not be affected.
-
-@samp{#pragma GCC system_header} has no effect in the primary source file.
-
-@node Macros, Conditionals, Header Files, Top
-@section Macros
-
-A macro is a sort of abbreviation which you can define once and then
-use later. There are many complicated features associated with macros
-in the C preprocessor.
-
-@menu
-* Object-like Macros:: Macros that always expand the same way.
-* Function-like Macros:: Macros that accept arguments that are substituted
- into the macro expansion.
-* Macro Varargs:: Macros with variable number of arguments.
-* Predefined:: Predefined macros that are always available.
-* Stringification:: Macro arguments converted into string constants.
-* Concatenation:: Building tokens from parts taken from macro arguments.
-* Undefining:: Cancelling a macro's definition.
-* Redefining:: Changing a macro's definition.
-* Poisoning:: Ensuring a macro is never defined or used.
-* Macro Pitfalls:: Macros can confuse the unwary. Here we explain
- several common problems and strange features.
-@end menu
-
-@node Object-like Macros, Function-like Macros, Macros, Macros
-@subsection Object-like Macros
-@cindex object-like macro
-@cindex manifest constant
-
-An @dfn{object-like macro} is a kind of abbreviation. It is a name
-which stands for a fragment of code. Some people refer to these as
-@dfn{manifest constants}.
-
-Before you can use a macro, you must @dfn{define} it explicitly with the
-@samp{#define} directive. @samp{#define} is followed by the name of the
-macro and then the token sequence it should be an abbreviation for,
-which is variously referred to as the macro's @dfn{body},
-@dfn{expansion} or @dfn{replacement list}. For example,
-
-@example
-#define BUFFER_SIZE 1020
-@end example
-
-@noindent
-defines a macro named @samp{BUFFER_SIZE} as an abbreviation for the
-token @samp{1020}. If somewhere after this @samp{#define} directive
-there comes a C statement of the form
-
-@example
-foo = (char *) xmalloc (BUFFER_SIZE);
-@end example
-
-@noindent
-then the C preprocessor will recognize and @dfn{expand} the macro
-@samp{BUFFER_SIZE}, resulting in
-
-@example
-foo = (char *) xmalloc (1020);
-@end example
-
-The use of all upper case for macro names is a standard convention.
-Programs are easier to read when it is possible to tell at a glance
-which names are macros.
-
-Normally, a macro definition can only span a single logical line, like
-all C preprocessing directives. Comments within a macro definition may
-contain newlines, which make no difference since each comment is
-replaced by a space regardless of its contents.
-
-Apart from this, there is no restriction on what can go in a macro body
-provided it decomposes into valid preprocessing tokens. In particular,
-parentheses need not balance, and the body need not resemble valid C
-code. (If it does not, you may get error messages from the C
-compiler when you use the macro.)
-
-The C preprocessor scans your program sequentially, so macro definitions
-take effect at the place you write them. Therefore, the following input
-to the C preprocessor
-
-@example
-foo = X;
-#define X 4
-bar = X;
-@end example
-
-@noindent
-produces as output
-
-@example
-foo = X;
-
-bar = 4;
-@end example
-
-When the preprocessor expands a macro name, the macro's expansion
-replaces the macro invocation, and the result is re-scanned for more
-macros to expand. For example, after
-
-@example
-#define BUFSIZE 1020
-#define TABLESIZE BUFSIZE
-@end example
-
-@noindent
-the name @samp{TABLESIZE} when used in the program would go through two
-stages of expansion, resulting ultimately in @samp{1020}.
-
-This is not the same as defining @samp{TABLESIZE} to be @samp{1020}.
-The @samp{#define} for @samp{TABLESIZE} uses exactly the expansion you
-specify --- in this case, @samp{BUFSIZE} --- and does not check to see
-whether it too contains macro names. Only when you @emph{use}
-@samp{TABLESIZE} is the result of its expansion scanned for more macro
-names. @xref{Cascaded Macros}.
-
-@node Function-like Macros, Macro Varargs, Object-like Macros, Macros
-@subsection Macros with Arguments
-@cindex macros with argument
-@cindex arguments in macro definitions
-@cindex function-like macro
-
-An object-like macro is always replaced by exactly the same tokens each
-time it is used. Macros can be made more flexible by taking
-@dfn{arguments}. Arguments are fragments of code that you supply each
-time the macro is used. These fragments are included in the expansion
-of the macro according to the directions in the macro definition. A
-macro that accepts arguments is called a @dfn{function-like macro}
-because the syntax for using it looks like a function call.
-
-@findex #define
-To define a macro that uses arguments, you write a @samp{#define}
-directive with a list of @dfn{parameters} in parentheses after the name
-of the macro. The parameters must be valid C identifiers, separated by
-commas and optionally whitespace. The @samp{(} must follow the macro
-name immediately, with no space in between. If you leave a space, you
-instead define an object-like macro whose expansion begins with a
-@samp{(}, and often leads to confusing errors at compile time.
-
-As an example, here is a macro that computes the minimum of two numeric
-values, as it is defined in many C programs:
-
-@example
-#define min(X, Y) ((X) < (Y) ? (X) : (Y))
-@end example
-
-@noindent
-(This is not the best way to define a ``minimum'' macro in GNU C@.
-@xref{Side Effects}, for more information.)
-
-To invoke a function-like macro, you write the name of the macro
-followed by a list of @dfn{arguments} in parentheses, separated by
-commas. The invocation of the macro need not be restricted to a single
-logical line - it can cross as many lines in the source file as you
-wish. The number of arguments you give must match the number of
-parameters in the macro definition; empty arguments are fine. Examples
-of use of the macro @samp{min} include @samp{min (1, 2)} and @samp{min
-(x + 28, *p)}.
-
-The expansion text of the macro depends on the arguments you use. Each
-macro parameter is replaced throughout the macro expansion with the
-tokens of the corresponding argument. Leading and trailing argument
-whitespace is dropped, and all whitespace between the tokens of an
-argument is reduced to a single space. Using the same macro @samp{min}
-defined above, @samp{min (1, 2)} expands into
-
-@example
-((1) < (2) ? (1) : (2))
-@end example
-
-@noindent
-where @samp{1} has been substituted for @samp{X} and @samp{2} for @samp{Y}.
-
-Likewise, @samp{min (x + 28, *p)} expands into
-
-@example
-((x + 28) < (*p) ? (x + 28) : (*p))
-@end example
-
-Parentheses within each argument must balance; a comma within such
-parentheses does not end the argument. However, there is no requirement
-for square brackets or braces to balance, and they do not prevent a
-comma from separating arguments. Thus,
-
-@example
-macro (array[x = y, x + 1])
-@end example
-
-@noindent
-passes two arguments to @code{macro}: @samp{array[x = y} and @samp{x +
-1]}. If you want to supply @samp{array[x = y, x + 1]} as an argument,
-you must write it as @samp{array[(x = y, x + 1)]}, which is equivalent C
-code.
-
-After the arguments have been substituted into the macro body, the
-resulting expansion replaces the macro invocation, and re-scanned for
-more macro calls. Therefore even arguments can contain calls to other
-macros, either with or without arguments, and even to the same macro.
-For example, @samp{min (min (a, b), c)} expands into this text:
-
-@example
-((((a) < (b) ? (a) : (b))) < (c)
- ? (((a) < (b) ? (a) : (b)))
- : (c))
-@end example
-
-@noindent
-(Line breaks shown here for clarity would not actually be generated.)
-
-@cindex empty macro arguments
-If a macro @code{foo} takes one argument, and you want to supply an
-empty argument, simply supply no preprocessing tokens. Since whitespace
-does not form a preprocessing token, it is optional. For example,
-@samp{foo ()}, @samp{foo ( )} and @samp{bar (, arg2)}.
-
-Previous GNU preprocessor implementations and documentation were
-incorrect on this point, insisting that a function-like macro that takes
-a single argument be passed a space if an empty argument was required.
-
-If you use a macro name followed by something other than a @samp{(}
-(after ignoring any whitespace that might follow), it does not form an
-invocation of the macro, and the preprocessor does not change what you
-have written. Therefore, it is possible for the same identifier to be a
-variable or function in your program as well as a macro, and you can
-choose in each instance whether to refer to the macro (if an actual
-argument list follows) or the variable or function (if an argument list
-does not follow). For example,
-
-@example
-#define foo(X) X
-foo bar foo(baz)
-@end example
-
-expands to @samp{foo bar baz}. Such dual use of one name could be
-confusing and should be avoided except when the two meanings are
-effectively synonymous: that is, when the name is both a macro and a
-function and the two have similar effects. You can think of the name
-simply as a function; use of the name for purposes other than calling it
-(such as, to take the address) will refer to the function, while calls
-will expand the macro and generate better but equivalent code.
-
-For example, you can use a function named @samp{min} in the same source
-file that defines the macro. If you write @samp{&min} with no argument
-list, you refer to the function. If you write @samp{min (x, bb)}, with
-an argument list, the macro is expanded. If you write @samp{(min) (a,
-bb)}, where the name @samp{min} is not followed by an open-parenthesis,
-the macro is not expanded, so you wind up with a call to the function
-@samp{min}.
-
-In the definition of a macro with arguments, the list of argument names
-must follow the macro name immediately with no space in between. If
-there is a space after the macro name, the macro is defined as taking no
-arguments, and all the rest of the line is taken to be the expansion.
-The reason for this is that it is often useful to define a macro that
-takes no arguments and whose definition begins with an identifier in
-parentheses. This rule makes it possible for you to do either this:
-
-@example
-#define FOO(x) - 1 / (x)
-@end example
-
-@noindent
-(which defines @samp{FOO} to take an argument and expand into minus the
-reciprocal of that argument) or this:
-
-@example
-#define BAR (x) - 1 / (x)
-@end example
-
-@noindent
-(which defines @samp{BAR} to take no argument and always expand into
-@samp{(x) - 1 / (x)}).
-
-Note that the @emph{uses} of a macro with arguments can have spaces
-before the left parenthesis; it's the @emph{definition} where it matters
-whether there is a space.
-
-@node Macro Varargs, Predefined, Function-like Macros, Macros
-@subsection Macros with Variable Numbers of Arguments
-@cindex variable number of arguments
-@cindex macro with variable arguments
-@cindex rest argument (in macro)
-
-In the ISO C standard of 1999, a macro can be declared to accept a
-variable number of arguments much as a function can. The syntax for
-defining the macro is similar to that of a function. Here is an
-example:
-
-@example
-#define eprintf(...) fprintf (stderr, __VA_ARGS__)
-@end example
-
-Here @samp{@dots{}} is a @dfn{variable argument}. In the invocation of
-such a macro, it represents the zero or more tokens until the closing
-parenthesis that ends the invocation, including any commas. This set of
-tokens replaces the identifier @code{__VA_ARGS__} in the macro body
-wherever it appears. Thus, we have this expansion:
-
-@example
-eprintf ("%s:%d: ", input_file_name, line_number)
-@expansion{}
-fprintf (stderr, "%s:%d: " , input_file_name, line_number)
-@end example
-
-Within a @samp{#define} directive, ISO C mandates that the only place
-the identifier @code{__VA_ARGS__} can appear is in the replacement list
-of a variable-argument macro. It may not be used as a macro name, macro
-argument name, or within a different type of macro. It may also be
-forbidden in open text; the standard is ambiguous. We recommend you
-avoid using it except for its defined purpose.
-
-If your macro is complicated, you may want a more descriptive name for
-the variable argument than @code{__VA_ARGS__}. GNU cpp permits this, as
-an extension. You may write an argument name immediately before the
-@samp{@dots{}}; that name is used for the variable argument. The
-@code{eprintf} macro above could be written
-
-@example
-#define eprintf(args...) fprintf (stderr, args)
-@end example
-
-@noindent
-using this extension. You cannot use @code{__VA_ARGS__} and this
-extension in the same macro.
-
-We might instead have defined eprintf as follows:
-
-@example
-#define eprintf(format, ...) fprintf (stderr, format, __VA_ARGS__)
-@end example
-
-This formulation looks more descriptive, but cannot be used as flexibly.
-There is no way to produce expanded output of
-
-@example
-fprintf (stderr, "success!\n")
-@end example
-
-@noindent
-because, in standard C, you are not allowed to leave the variable
-argument out entirely, and passing an empty argument for the variable
-arguments will not do what you want. Writing
-
-@example
-eprintf ("success!\n", )
-@end example
-
-@noindent
-produces
-
-@example
-fprintf (stderr, "success!\n",)
-@end example
-
-@noindent
-where the extra comma originates from the replacement list and not from
-the arguments to eprintf.
-
-There is another extension in the GNU C preprocessor which deals with
-this difficulty. First, you are allowed to leave the variable argument
-out entirely:
-
-@example
-eprintf ("success!\n")
-@end example
-
-Second, the @samp{##} token paste operator has a special meaning when
-placed between a comma and a variable argument. If you write
-
-@example
-#define eprintf(format, ...) fprintf (stderr, format, ##__VA_ARGS__)
-@end example
-
-and the variable argument is left out when the @samp{eprintf} macro is
-used, then the comma before the @samp{##} will be deleted. This does
-@emph{not} happen if you pass an empty argument, nor does it happen if
-the token preceding @samp{##} is anything other than a comma.
-
-Previous versions of the preprocessor implemented this extension much
-more generally. We have restricted it in order to minimize the
-difference from the C standard. @xref{Unreliable Features}.
-
-@node Predefined, Stringification, Macro Varargs, Macros
-@subsection Predefined Macros
-
-@cindex predefined macros
-Several object-like macros are predefined; you use them without
-supplying their definitions. They fall into two classes: standard
-macros and system-specific macros.
-
-@menu
-* Standard Predefined:: Standard predefined macros.
-* Nonstandard Predefined:: Nonstandard predefined macros.
-@end menu
-
-@node Standard Predefined, Nonstandard Predefined, Predefined, Predefined
-@subsubsection Standard Predefined Macros
-@cindex standard predefined macros
-
-The standard predefined macros are available with the same meanings
-regardless of the machine or operating system on which you are using GNU
-C@. Their names all start and end with double underscores. Those
-preceding @code{__GNUC__} in this table are standardized by ISO C; the
-rest are GNU C extensions.
-
-@table @code
-@item __FILE__
-@findex __FILE__
-This macro expands to the name of the current input file, in the form of
-a C string constant. The precise name returned is the one that was
-specified in @samp{#include} or as the input file name argument. For
-example, @samp{"/usr/local/include/myheader.h"} is a possible expansion
-of this macro.
-
-@item __LINE__
-@findex __LINE__
-This macro expands to the current input line number, in the form of a
-decimal integer constant. While we call it a predefined macro, it's
-a pretty strange macro, since its ``definition'' changes with each
-new line of source code.
-
-This and @samp{__FILE__} are useful in generating an error message to
-report an inconsistency detected by the program; the message can state
-the source line at which the inconsistency was detected. For example,
-
-@smallexample
-fprintf (stderr, "Internal error: "
- "negative string length "
- "%d at %s, line %d.",
- length, __FILE__, __LINE__);
-@end smallexample
-
-A @samp{#include} directive changes the expansions of @samp{__FILE__}
-and @samp{__LINE__} to correspond to the included file. At the end of
-that file, when processing resumes on the input file that contained
-the @samp{#include} directive, the expansions of @samp{__FILE__} and
-@samp{__LINE__} revert to the values they had before the
-@samp{#include} (but @samp{__LINE__} is then incremented by one as
-processing moves to the line after the @samp{#include}).
-
-The expansions of both @samp{__FILE__} and @samp{__LINE__} are altered
-if a @samp{#line} directive is used. @xref{Line Control}.
-
-@item __DATE__
-@findex __DATE__
-This macro expands to a string constant that describes the date on
-which the preprocessor is being run. The string constant contains
-eleven characters and looks like @w{@samp{"Feb 1 1996"}}.
-@c After reformatting the above, check that the date remains `Feb 1 1996',
-@c all on one line, with two spaces between the `Feb' and the `1'.
-
-@item __TIME__
-@findex __TIME__
-This macro expands to a string constant that describes the time at
-which the preprocessor is being run. The string constant contains
-eight characters and looks like @samp{"23:59:01"}.
-
-@item __STDC__
-@findex __STDC__
-This macro expands to the constant 1, to signify that this is ISO
-Standard C@. (Whether that is actually true depends on what C compiler
-will operate on the output from the preprocessor.)
-
-On some hosts, system include files use a different convention, where
-@samp{__STDC__} is normally 0, but is 1 if the user specifies strict
-conformance to the C Standard. The preprocessor follows the host
-convention when processing system include files, but when processing
-user files it follows the usual GNU C convention.
-
-This macro is not defined if the @samp{-traditional} option is used.
-
-@item __STDC_VERSION__
-@findex __STDC_VERSION__
-This macro expands to the C Standard's version number, a long integer
-constant of the form @samp{@var{yyyy}@var{mm}L} where @var{yyyy} and
-@var{mm} are the year and month of the Standard version. This signifies
-which version of the C Standard the preprocessor conforms to. Like
-@samp{__STDC__}, whether this version number is accurate for the entire
-implementation depends on what C compiler will operate on the output
-from the preprocessor.
-
-This macro is not defined if the @samp{-traditional} option is used.
-
-@item __GNUC__
-@findex __GNUC__
-This macro is defined if and only if this is GNU C@. This macro is
-defined only when the entire GNU C compiler is in use; if you invoke the
-preprocessor directly, @samp{__GNUC__} is undefined. The value
-identifies the major version number of GNU CC (@samp{1} for GNU CC
-version 1, which is now obsolete, and @samp{2} for version 2).
-
-@item __GNUC_MINOR__
-@findex __GNUC_MINOR__
-The macro contains the minor version number of the compiler. This can
-be used to work around differences between different releases of the
-compiler (for example, if GCC 2.6.x is known to support a feature, you
-can test for @code{__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 6)}).
-
-@item __GNUC_PATCHLEVEL__
-@findex __GNUC_PATCHLEVEL__
-This macro contains the patch level of the compiler. This can be
-used to work around differences between different patch level releases
-of the compiler (for example, if GCC 2.6.2 is known to contain a bug,
-whereas GCC 2.6.3 contains a fix, and you have code which can workaround
-the problem depending on whether the bug is fixed or not, you can test for
-@code{__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 6) ||
-(__GNUC__ == 2 && __GNUC_MINOR__ == 6 && __GNUC_PATCHLEVEL__ >= 3)}).
-
-@item __GNUG__
-@findex __GNUG__
-The GNU C compiler defines this when the compilation language is
-C++; use @samp{__GNUG__} to distinguish between GNU C and GNU
-C++.
-
-@item __cplusplus
-@findex __cplusplus
-The ISO standard for C++ requires predefining this variable. You can
-use @samp{__cplusplus} to test whether a header is compiled by a C
-compiler or a C++ compiler. The compiler currently uses a value of
-@samp{1}, instead of the value @samp{199711L}, which would indicate full
-conformance with the standard.
-
-@item __STRICT_ANSI__
-@findex __STRICT_ANSI__
-GNU C defines this macro if and only if the @option{-ansi} switch, or a
-@option{-std} switch specifying strict conformance to some version of ISO C,
-was specified when GNU C was invoked. Its definition is the null string.
-This macro exists primarily to direct certain GNU header files not to
-define certain traditional Unix constructs which are incompatible with
-ISO C@.
-
-@item __BASE_FILE__
-@findex __BASE_FILE__
-This macro expands to the name of the main input file, in the form
-of a C string constant. This is the source file that was specified
-on the command line of the preprocessor or C compiler.
-
-@item __INCLUDE_LEVEL__
-@findex __INCLUDE_LEVEL_
-This macro expands to a decimal integer constant that represents the
-depth of nesting in include files. The value of this macro is
-incremented on every @samp{#include} directive and decremented at the
-end of every included file. It starts out at 0, it's value within the
-base file specified on the command line.
-
-@item __VERSION__
-@findex __VERSION__
-This macro expands to a string constant which describes the version
-number of GNU C@. The string is normally a sequence of decimal numbers
-separated by periods, such as @samp{"2.6.0"}.
-
-@item __OPTIMIZE__
-@findex __OPTIMIZE__
-GNU CC defines this macro in optimizing compilations. It causes certain
-GNU header files to define alternative macro definitions for some system
-library functions. You should not refer to or test the definition of
-this macro unless you make very sure that programs will execute with the
-same effect regardless.
-
-@item __OPTIMIZE_SIZE__
-@findex __OPTIMIZE_SIZE__
-GNU CC defines this macro when optimizing for size with @samp{-Os}. It
-causes certain GNU header files to define alternative macro definitions
-for some system library functions. You should not refer to or test the
-definition of this macro unless you make very sure that programs will
-execute with the same effect regardless.
-
-@item __CHAR_UNSIGNED__
-@findex __CHAR_UNSIGNED__
-GNU C defines this macro if and only if the data type @code{char} is
-unsigned on the target machine. It exists to cause the standard header
-file @file{limits.h} to work correctly. You should not refer to this
-macro yourself; instead, refer to the standard macros defined in
-@file{limits.h}. The preprocessor uses this macro to determine whether
-or not to sign-extend large character constants written in octal; see
-@ref{#if Directive,,The @samp{#if} Directive}.
-
-@item __REGISTER_PREFIX__
-@findex __REGISTER_PREFIX__
-This macro expands to a string (not a string constant) describing the
-prefix applied to CPU registers in assembler code. You can use it to
-write assembler code that is usable in multiple environments. For
-example, in the @samp{m68k-aout} environment it expands to the null
-string, but in the @samp{m68k-coff} environment it expands to the string
-@samp{%}.
-
-@item __USER_LABEL_PREFIX__
-@findex __USER_LABEL_PREFIX__
-Similar to @code{__REGISTER_PREFIX__}, but describes the prefix applied
-to user generated labels in assembler code. For example, in the
-@samp{m68k-aout} environment it expands to the string @samp{_}, but in
-the @samp{m68k-coff} environment it expands to the null string. This
-does not work with the @samp{-mno-underscores} option that the i386
-OSF/rose and m88k targets provide nor with the @samp{-mcall*} options of
-the rs6000 System V Release 4 target.
-@end table
-
-@node Nonstandard Predefined,, Standard Predefined, Predefined
-@subsubsection Nonstandard Predefined Macros
-
-The C preprocessor normally has several predefined macros that vary
-between machines because their purpose is to indicate what type of
-system and machine is in use. This manual, being for all systems and
-machines, cannot tell you exactly what their names are; instead, we
-offer a list of some typical ones. You can use @samp{cpp -dM} to see
-the values of predefined macros; see @ref{Invocation}.
-
-Some nonstandard predefined macros describe the operating system in use,
-with more or less specificity. For example,
-
-@table @code
-@item unix
-@findex unix
-@samp{unix} is normally predefined on all Unix systems.
-
-@item BSD
-@findex BSD
-@samp{BSD} is predefined on recent versions of Berkeley Unix
-(perhaps only in version 4.3).
-@end table
-
-Other nonstandard predefined macros describe the kind of CPU, with more or
-less specificity. For example,
-
-@table @code
-@item vax
-@findex vax
-@samp{vax} is predefined on Vax computers.
-
-@item mc68000
-@findex mc68000
-@samp{mc68000} is predefined on most computers whose CPU is a Motorola
-68000, 68010 or 68020.
-
-@item m68k
-@findex m68k
-@samp{m68k} is also predefined on most computers whose CPU is a 68000,
-68010 or 68020; however, some makers use @samp{mc68000} and some use
-@samp{m68k}. Some predefine both names. What happens in GNU C
-depends on the system you are using it on.
-
-@item M68020
-@findex M68020
-@samp{M68020} has been observed to be predefined on some systems that
-use 68020 CPUs --- in addition to @samp{mc68000} and @samp{m68k}, which
-are less specific.
-
-@item _AM29K
-@findex _AM29K
-@itemx _AM29000
-@findex _AM29000
-Both @samp{_AM29K} and @samp{_AM29000} are predefined for the AMD 29000
-CPU family.
-
-@item ns32000
-@findex ns32000
-@samp{ns32000} is predefined on computers which use the National
-Semiconductor 32000 series CPU.
-@end table
-
-Yet other nonstandard predefined macros describe the manufacturer of
-the system. For example,
-
-@table @code
-@item sun
-@findex sun
-@samp{sun} is predefined on all models of Sun computers.
-
-@item pyr
-@findex pyr
-@samp{pyr} is predefined on all models of Pyramid computers.
-
-@item sequent
-@findex sequent
-@samp{sequent} is predefined on all models of Sequent computers.
-@end table
-
-These predefined symbols are not only nonstandard, they are contrary to the
-ISO standard because their names do not start with underscores.
-Therefore, the option @samp{-ansi} inhibits the definition of these
-symbols.
-
-This tends to make @samp{-ansi} useless, since many programs depend on
-the customary nonstandard predefined symbols. Even system header files
-check them and will generate incorrect declarations if they do not find
-the names that are expected. You might think that the header files
-supplied for the Uglix computer would not need to test what machine they
-are running on, because they can simply assume it is the Uglix; but
-often they do, and they do so using the customary names. As a result,
-very few C programs will compile with @samp{-ansi}. We intend to avoid
-such problems on the GNU system.
-
-What, then, should you do in an ISO C program to test the type of machine
-it will run on?
-
-GNU C offers a parallel series of symbols for this purpose, whose names
-are made from the customary ones by adding @samp{__} at the beginning
-and end. Thus, the symbol @code{__vax__} would be available on a Vax,
-and so on.
-
-The set of nonstandard predefined names in the GNU C preprocessor is
-controlled (when @code{cpp} is itself compiled) by the macro
-@samp{CPP_PREDEFINES}, which should be a string containing @samp{-D}
-options, separated by spaces. For example, on the Sun 3, we use the
-following definition:
-
-@example
-#define CPP_PREDEFINES "-Dmc68000 -Dsun -Dunix -Dm68k"
-@end example
-
-@noindent
-This macro is usually specified in @file{tm.h}.
-
-@node Stringification, Concatenation, Predefined, Macros
-@subsection Stringification
-
-@cindex stringification
-@dfn{Stringification} means turning a sequence of preprocessing tokens
-into a string literal. For example, stringifying @samp{foo (z)} results
-in @samp{"foo (z)"}.
-
-In the C preprocessor, stringification is possible when macro arguments
-are substituted during macro expansion. When a parameter appears
-preceded by a @samp{#} token in the replacement list of a function-like
-macro, it indicates that both tokens should be replaced with the
-stringification of the corresponding argument during expansion. The
-same argument may be substituted in other places in the definition
-without stringification if the argument name appears in those places
-with no preceding @samp{#}.
-
-Here is an example of a macro definition that uses stringification:
-
-@smallexample
-@group
-#define WARN_IF(EXP) \
-do @{ if (EXP) \
- fprintf (stderr, "Warning: " #EXP "\n"); @} \
-while (0)
-@end group
-@end smallexample
-
-@noindent
-Here the argument for @samp{EXP} is substituted once, as-is, into the
-@samp{if} statement, and once, stringified, into the argument to
-@samp{fprintf}. The @samp{do} and @samp{while (0)} are a kludge to make
-it possible to write @samp{WARN_IF (@var{arg});}, which the resemblance
-of @samp{WARN_IF} to a function would make C programmers want to do; see
-@ref{Swallow Semicolon}.
-
-The stringification feature is limited to transforming the tokens of a
-macro argument into a string constant: there is no way to combine the
-argument with surrounding text and stringify it all together. The
-example above shows how an equivalent result can be obtained in ISO
-Standard C, using the fact that adjacent string constants are
-concatenated by the C compiler to form a single string constant. The
-preprocessor stringifies the actual value of @samp{EXP} into a separate
-string constant, resulting in text like
-
-@smallexample
-@group
-do @{ if (x == 0) \
- fprintf (stderr, "Warning: " "x == 0" "\n"); @} \
-while (0)
-@end group
-@end smallexample
-
-@noindent
-but the compiler then sees three consecutive string constants and
-concatenates them into one, producing effectively
-
-@smallexample
-do @{ if (x == 0) \
- fprintf (stderr, "Warning: x == 0\n"); @} \
-while (0)
-@end smallexample
-
-Stringification in C involves more than putting double-quote characters
-around the fragment. The preprocessor backslash-escapes the surrounding
-quotes of string literals, and all backslashes within string and
-character constants, in order to get a valid C string constant with the
-proper contents. Thus, stringifying @samp{p = "foo\n";} results in
-@samp{"p = \"foo\\n\";"}. However, backslashes that are not inside
-string or character constants are not duplicated: @samp{\n} by itself
-stringifies to @samp{"\n"}.
-
-Whitespace (including comments) in the text being stringified is handled
-according to precise rules. All leading and trailing whitespace is
-ignored. Any sequence of whitespace in the middle of the text is
-converted to a single space in the stringified result.
-
-@node Concatenation, Undefining, Stringification, Macros
-@subsection Concatenation
-@cindex concatenation
-@cindex @samp{##}
-@dfn{Concatenation} means joining two strings into one. In the context
-of macro expansion, concatenation refers to joining two preprocessing
-tokens to form one. In particular, a token of a macro argument can be
-concatenated with another argument's token or with fixed text to produce
-a longer name. The longer name might be the name of a function,
-variable, type, or a C keyword; it might even be the name of another
-macro, in which case it will be expanded.
-
-When you define a function-like or object-like macro, you request
-concatenation with the special operator @samp{##} in the macro's
-replacement list. When the macro is called, any arguments are
-substituted without performing macro expansion, every @samp{##} operator
-is deleted, and the two tokens on either side of it are concatenated to
-form a single token.
-
-Consider a C program that interprets named commands. There probably needs
-to be a table of commands, perhaps an array of structures declared as
-follows:
-
-@example
-struct command
-@{
- char *name;
- void (*function) ();
-@};
-
-struct command commands[] =
-@{
- @{ "quit", quit_command@},
- @{ "help", help_command@},
- @dots{}
-@};
-@end example
-
-It would be cleaner not to have to give each command name twice, once in
-the string constant and once in the function name. A macro which takes the
-name of a command as an argument can make this unnecessary. The string
-constant can be created with stringification, and the function name by
-concatenating the argument with @samp{_command}. Here is how it is done:
-
-@example
-#define COMMAND(NAME) @{ #NAME, NAME ## _command @}
-
-struct command commands[] =
-@{
- COMMAND (quit),
- COMMAND (help),
- @dots{}
-@};
-@end example
-
-The usual case of concatenation is concatenating two names (or a name
-and a number) into a longer name. This isn't the only valid case.
-It is also possible to concatenate two numbers (or a number and a name,
-such as @samp{1.5} and @samp{e3}) into a number. Also, multi-character
-operators such as @samp{+=} can be formed by concatenation. However,
-two tokens that don't together form a valid token cannot be
-concatenated. For example, concatenation of @samp{x} on one side and
-@samp{+} on the other is not meaningful because those two tokens do not
-form a valid preprocessing token when concatenated. UNDEFINED
-
-Keep in mind that the C preprocessor converts comments to whitespace
-before macros are even considered. Therefore, you cannot create a
-comment by concatenating @samp{/} and @samp{*}: the @samp{/*} sequence
-that starts a comment is not a token, but rather the beginning of a
-comment. You can freely use comments next to @samp{##} in a macro
-definition, or in arguments that will be concatenated, because the
-comments will be converted to spaces at first sight, and concatenation
-operates on tokens and so ignores whitespace.
-
-@node Undefining, Redefining, Concatenation, Macros
-@subsection Undefining Macros
-
-@cindex undefining macros
-To @dfn{undefine} a macro means to cancel its definition. This is done
-with the @samp{#undef} directive. @samp{#undef} is followed by the macro
-name to be undefined.
-
-Like definition, undefinition occurs at a specific point in the source
-file, and it applies starting from that point. The name ceases to be a
-macro name, and from that point on it is treated by the preprocessor as
-if it had never been a macro name.
-
-For example,
-
-@example
-#define FOO 4
-x = FOO;
-#undef FOO
-x = FOO;
-@end example
-
-@noindent
-expands into
-
-@example
-x = 4;
-
-x = FOO;
-@end example
-
-@noindent
-In this example, @samp{FOO} had better be a variable or function as well
-as (temporarily) a macro, in order for the result of the expansion to be
-valid C code.
-
-The same form of @samp{#undef} directive will cancel definitions with
-arguments or definitions that don't expect arguments. The @samp{#undef}
-directive has no effect when used on a name not currently defined as a
-macro.
-
-@node Redefining, Poisoning, Undefining, Macros
-@subsection Redefining Macros
-
-@cindex redefining macros
-@dfn{Redefining} a macro means defining (with @samp{#define}) a name that
-is already defined as a macro.
-
-A redefinition is trivial if the new definition is transparently
-identical to the old one. You probably wouldn't deliberately write a
-trivial redefinition, but they can happen automatically when a header
-file is included more than once (@pxref{Header Files}), so they are
-accepted silently and without effect.
-
-Nontrivial redefinition is considered likely to be an error, so it
-provokes a warning message from the preprocessor. However, sometimes it
-is useful to change the definition of a macro in mid-compilation. You
-can inhibit the warning by undefining the macro with @samp{#undef}
-before the second definition.
-
-In order for a redefinition to be trivial, the parameter names must
-match and be in the same order, and the new replacement list must
-exactly match the one already in effect, with two possible exceptions:
-
-@itemize @bullet
-@item
-Whitespace may be added or deleted at the beginning or the end of the
-replacement list. In a sense this is vacuous, since strictly such
-whitespace doesn't form part of the macro's expansion.
-
-@item
-Between tokens in the expansion, any two forms of whitespace are
-considered equivalent. In particular, whitespace may not be eliminated
-entirely, nor may it be added where there previously wasn't any.
-@end itemize
-
-Recall that a comment counts as whitespace.
-
-As a particular case of the above, you may not redefine an object-like
-macro as a function-like macro, and vice-versa.
-
-@node Poisoning, Macro Pitfalls, Redefining, Macros
-@subsection Poisoning Macros
-@cindex poisoning macros
-@findex #pragma GCC poison
-
-Sometimes, there is an identifier that you want to remove completely
-from your program, and make sure that it never creeps back in. To
-enforce this, the @samp{#pragma GCC poison} directive can be used.
-@samp{#pragma GCC poison} is followed by a list of identifiers to
-poison, and takes effect for the rest of the source. You cannot
-@samp{#undef} a poisoned identifier or test to see if it's defined with
-@samp{#ifdef}.
-
-For example,
-
-@example
-#pragma GCC poison printf sprintf fprintf
-sprintf(some_string, "hello");
-@end example
-
-@noindent
-will produce an error.
-
-@node Macro Pitfalls,, Poisoning, Macros
-@subsection Pitfalls and Subtleties of Macros
-@cindex problems with macros
-@cindex pitfalls of macros
-
-In this section we describe some special rules that apply to macros and
-macro expansion, and point out certain cases in which the rules have
-counterintuitive consequences that you must watch out for.
-
-@menu
-* Misnesting:: Macros can contain unmatched parentheses.
-* Macro Parentheses:: Why apparently superfluous parentheses
- may be necessary to avoid incorrect grouping.
-* Swallow Semicolon:: Macros that look like functions
- but expand into compound statements.
-* Side Effects:: Unsafe macros that cause trouble when
- arguments contain side effects.
-* Self-Reference:: Macros whose definitions use the macros' own names.
-* Argument Prescan:: Arguments are checked for macro calls before they
- are substituted.
-* Cascaded Macros:: Macros whose definitions use other macros.
-* Newlines in Args:: Sometimes line numbers get confused.
-@end menu
-
-@node Misnesting, Macro Parentheses, Macro Pitfalls, Macro Pitfalls
-@subsubsection Improperly Nested Constructs
-
-Recall that when a macro is called with arguments, the arguments are
-substituted into the macro body and the result is checked, together with
-the rest of the input file, for more macro calls.
-
-It is possible to piece together a macro call coming partially from the
-macro body and partially from the arguments. For example,
-
-@example
-#define double(x) (2*(x))
-#define call_with_1(x) x(1)
-@end example
-
-@noindent
-would expand @samp{call_with_1 (double)} into @samp{(2*(1))}.
-
-Macro definitions do not have to have balanced parentheses. By writing
-an unbalanced open parenthesis in a macro body, it is possible to create
-a macro call that begins inside the macro body but ends outside of it.
-For example,
-
-@example
-#define strange(file) fprintf (file, "%s %d",
-@dots{}
-strange(stderr) p, 35)
-@end example
-
-@noindent
-This bizarre example expands to @samp{fprintf (stderr, "%s %d", p, 35)}!
-
-@node Macro Parentheses, Swallow Semicolon, Misnesting, Macro Pitfalls
-@subsubsection Unintended Grouping of Arithmetic
-@cindex parentheses in macro bodies
-
-You may have noticed that in most of the macro definition examples shown
-above, each occurrence of a macro argument name had parentheses around
-it. In addition, another pair of parentheses usually surround the
-entire macro definition. Here is why it is best to write macros that
-way.
-
-Suppose you define a macro as follows,
-
-@example
-#define ceil_div(x, y) (x + y - 1) / y
-@end example
-
-@noindent
-whose purpose is to divide, rounding up. (One use for this operation is
-to compute how many @samp{int} objects are needed to hold a certain
-number of @samp{char} objects.) Then suppose it is used as follows:
-
-@example
-a = ceil_div (b & c, sizeof (int));
-@end example
-
-@noindent
-This expands into
-
-@example
-a = (b & c + sizeof (int) - 1) / sizeof (int);
-@end example
-
-@noindent
-which does not do what is intended. The operator-precedence rules of
-C make it equivalent to this:
-
-@example
-a = (b & (c + sizeof (int) - 1)) / sizeof (int);
-@end example
-
-@noindent
-What we want is this:
-
-@example
-a = ((b & c) + sizeof (int) - 1)) / sizeof (int);
-@end example
-
-@noindent
-Defining the macro as
-
-@example
-#define ceil_div(x, y) ((x) + (y) - 1) / (y)
-@end example
-
-@noindent
-provides the desired result.
-
-Unintended grouping can result in another way. Consider @samp{sizeof
-ceil_div(1, 2)}. That has the appearance of a C expression that would
-compute the size of the type of @samp{ceil_div (1, 2)}, but in fact it
-means something very different. Here is what it expands to:
-
-@example
-sizeof ((1) + (2) - 1) / (2)
-@end example
-
-@noindent
-This would take the size of an integer and divide it by two. The
-precedence rules have put the division outside the @samp{sizeof} when it
-was intended to be inside.
-
-Parentheses around the entire macro definition can prevent such
-problems. Here, then, is the recommended way to define @samp{ceil_div}:
-
-@example
-#define ceil_div(x, y) (((x) + (y) - 1) / (y))
-@end example
-
-@node Swallow Semicolon, Side Effects, Macro Parentheses, Macro Pitfalls
-@subsubsection Swallowing the Semicolon
-
-@cindex semicolons (after macro calls)
-Often it is desirable to define a macro that expands into a compound
-statement. Consider, for example, the following macro, that advances a
-pointer (the argument @samp{p} says where to find it) across whitespace
-characters:
-
-@example
-#define SKIP_SPACES(p, limit) \
-@{ register char *lim = (limit); \
- while (p != lim) @{ \
- if (*p++ != ' ') @{ \
- p--; break; @}@}@}
-@end example
-
-@noindent
-Here backslash-newline is used to split the macro definition, which must
-be a single logical line, so that it resembles the way such C code would
-be laid out if not part of a macro definition.
-
-A call to this macro might be @samp{SKIP_SPACES (p, lim)}. Strictly
-speaking, the call expands to a compound statement, which is a complete
-statement with no need for a semicolon to end it. However, since it
-looks like a function call, it minimizes confusion if you can use it
-like a function call, writing a semicolon afterward, as in
-@samp{SKIP_SPACES (p, lim);}
-
-This can cause trouble before @samp{else} statements, because the
-semicolon is actually a null statement. Suppose you write
-
-@example
-if (*p != 0)
- SKIP_SPACES (p, lim);
-else @dots{}
-@end example
-
-@noindent
-The presence of two statements --- the compound statement and a null
-statement --- in between the @samp{if} condition and the @samp{else}
-makes invalid C code.
-
-The definition of the macro @samp{SKIP_SPACES} can be altered to solve
-this problem, using a @samp{do @dots{} while} statement. Here is how:
-
-@example
-#define SKIP_SPACES(p, limit) \
-do @{ register char *lim = (limit); \
- while (p != lim) @{ \
- if (*p++ != ' ') @{ \
- p--; break; @}@}@} \
-while (0)
-@end example
-
-Now @samp{SKIP_SPACES (p, lim);} expands into
-
-@example
-do @{@dots{}@} while (0);
-@end example
-
-@noindent
-which is one statement.
-
-@node Side Effects, Self-Reference, Swallow Semicolon, Macro Pitfalls
-@subsubsection Duplication of Side Effects
-
-@cindex side effects (in macro arguments)
-@cindex unsafe macros
-Many C programs define a macro @samp{min}, for ``minimum'', like this:
-
-@example
-#define min(X, Y) ((X) < (Y) ? (X) : (Y))
-@end example
-
-When you use this macro with an argument containing a side effect,
-as shown here,
-
-@example
-next = min (x + y, foo (z));
-@end example
-
-@noindent
-it expands as follows:
-
-@example
-next = ((x + y) < (foo (z)) ? (x + y) : (foo (z)));
-@end example
-
-@noindent
-where @samp{x + y} has been substituted for @samp{X} and @samp{foo (z)}
-for @samp{Y}.
-
-The function @samp{foo} is used only once in the statement as it appears
-in the program, but the expression @samp{foo (z)} has been substituted
-twice into the macro expansion. As a result, @samp{foo} might be called
-two times when the statement is executed. If it has side effects or if
-it takes a long time to compute, the results might not be what you
-intended. We say that @samp{min} is an @dfn{unsafe} macro.
-
-The best solution to this problem is to define @samp{min} in a way that
-computes the value of @samp{foo (z)} only once. The C language offers
-no standard way to do this, but it can be done with GNU C extensions as
-follows:
-
-@example
-#define min(X, Y) \
-(@{ typeof (X) __x = (X), __y = (Y); \
- (__x < __y) ? __x : __y; @})
-@end example
-
-If you do not wish to use GNU C extensions, the only solution is to be
-careful when @emph{using} the macro @samp{min}. For example, you can
-calculate the value of @samp{foo (z)}, save it in a variable, and use
-that variable in @samp{min}:
-
-@example
-#define min(X, Y) ((X) < (Y) ? (X) : (Y))
-@dots{}
-@{
- int tem = foo (z);
- next = min (x + y, tem);
-@}
-@end example
-
-@noindent
-(where we assume that @samp{foo} returns type @samp{int}).
-
-@node Self-Reference, Argument Prescan, Side Effects, Macro Pitfalls
-@subsubsection Self-Referential Macros
-
-@cindex self-reference
-A @dfn{self-referential} macro is one whose name appears in its
-definition. A special feature of ISO Standard C is that the
-self-reference is not considered a macro call. It is passed into the
-preprocessor output unchanged.
-
-Let's consider an example:
-
-@example
-#define foo (4 + foo)
-@end example
-
-@noindent
-where @samp{foo} is also a variable in your program.
-
-Following the ordinary rules, each reference to @samp{foo} will expand
-into @samp{(4 + foo)}; then this will be rescanned and will expand into
-@samp{(4 + (4 + foo))}; and so on until it causes a fatal error (memory
-full) in the preprocessor.
-
-However, the special rule about self-reference cuts this process short
-after one step, at @samp{(4 + foo)}. Therefore, this macro definition
-has the possibly useful effect of causing the program to add 4 to the
-value of @samp{foo} wherever @samp{foo} is referred to.
-
-In most cases, it is a bad idea to take advantage of this feature. A
-person reading the program who sees that @samp{foo} is a variable will
-not expect that it is a macro as well. The reader will come across the
-identifier @samp{foo} in the program and think its value should be that
-of the variable @samp{foo}, whereas in fact the value is four greater.
-
-The special rule for self-reference applies also to @dfn{indirect}
-self-reference. This is the case where a macro @var{x} expands to use a
-macro @samp{y}, and the expansion of @samp{y} refers to the macro
-@samp{x}. The resulting reference to @samp{x} comes indirectly from the
-expansion of @samp{x}, so it is a self-reference and is not further
-expanded. Thus, after
-
-@example
-#define x (4 + y)
-#define y (2 * x)
-@end example
-
-@noindent
-@samp{x} would expand into @samp{(4 + (2 * x))}. Clear?
-
-Suppose @samp{y} is used elsewhere, not from the definition of @samp{x}.
-Then the use of @samp{x} in the expansion of @samp{y} is not a
-self-reference because @samp{x} is not ``in progress''. So it does
-expand. However, the expansion of @samp{x} contains a reference to
-@samp{y}, and that is an indirect self-reference now because @samp{y} is
-``in progress''. The result is that @samp{y} expands to @samp{(2 * (4 +
-y))}.
-
-This behavior is specified by the ISO C standard, so you may need to
-understand it.
-
-@node Argument Prescan, Cascaded Macros, Self-Reference, Macro Pitfalls
-@subsubsection Separate Expansion of Macro Arguments
-@cindex expansion of arguments
-@cindex macro argument expansion
-@cindex prescan of macro arguments
-
-We have explained that the expansion of a macro, including the substituted
-arguments, is re-scanned for macro calls to be expanded.
-
-What really happens is more subtle: first each argument is scanned
-separately for macro calls. Then the resulting tokens are substituted
-into the macro body to produce the macro expansion, and the macro
-expansion is scanned again for macros to expand.
-
-The result is that the arguments are scanned @emph{twice} to expand
-macro calls in them.
-
-Most of the time, this has no effect. If the argument contained any
-macro calls, they are expanded during the first scan. The result
-therefore contains no macro calls, so the second scan does not change
-it. If the argument were substituted as given, with no prescan, the
-single remaining scan would find the same macro calls and produce the
-same results.
-
-You might expect the double scan to change the results when a
-self-referential macro is used in an argument of another macro
-(@pxref{Self-Reference}): the self-referential macro would be expanded
-once in the first scan, and a second time in the second scan. However,
-this is not what happens. The self-references that do not expand in the
-first scan are marked so that they will not expand in the second scan
-either.
-
-The prescan is not done when an argument is stringified or concatenated.
-Thus,
-
-@example
-#define str(s) #s
-#define foo 4
-str (foo)
-@end example
-
-@noindent
-expands to @samp{"foo"}. Once more, prescan has been prevented from
-having any noticeable effect.
-
-More precisely, stringification and concatenation use the argument
-tokens as given without initially scanning for macros. The same
-argument would be used in expanded form if it is substituted elsewhere
-without stringification or concatenation.
-
-@example
-#define str(s) #s lose(s)
-#define foo 4
-str (foo)
-@end example
-
-expands to @samp{"foo" lose(4)}.
-
-You might now ask, ``Why mention the prescan, if it makes no difference?
-And why not skip it and make the preprocessor faster?'' The answer is
-that the prescan does make a difference in three special cases:
-
-@itemize @bullet
-@item
-Nested calls to a macro.
-
-@item
-Macros that call other macros that stringify or concatenate.
-
-@item
-Macros whose expansions contain unshielded commas.
-@end itemize
-
-We say that @dfn{nested} calls to a macro occur when a macro's argument
-contains a call to that very macro. For example, if @samp{f} is a macro
-that expects one argument, @samp{f (f (1))} is a nested pair of calls to
-@samp{f}. The desired expansion is made by expanding @samp{f (1)} and
-substituting that into the definition of @samp{f}. The prescan causes
-the expected result to happen. Without the prescan, @samp{f (1)} itself
-would be substituted as an argument, and the inner use of @samp{f} would
-appear during the main scan as an indirect self-reference and would not
-be expanded. Here, the prescan cancels an undesirable side effect (in
-the medical, not computational, sense of the term) of the special rule
-for self-referential macros.
-
-Prescan causes trouble in certain other cases of nested macro calls.
-Here is an example:
-
-@example
-#define foo a,b
-#define bar(x) lose(x)
-#define lose(x) (1 + (x))
-
-bar(foo)
-@end example
-
-@noindent
-We would like @samp{bar(foo)} to turn into @samp{(1 + (foo))}, which
-would then turn into @samp{(1 + (a,b))}. Instead, @samp{bar(foo)}
-expands into @samp{lose(a,b)}, and you get an error because @code{lose}
-requires a single argument. In this case, the problem is easily solved
-by the same parentheses that ought to be used to prevent misnesting of
-arithmetic operations:
-
-@example
-#define foo (a,b)
-#define bar(x) lose((x))
-@end example
-
-The problem is more serious when the operands of the macro are not
-expressions; for example, when they are statements. Then parentheses
-are unacceptable because they would make for invalid C code:
-
-@example
-#define foo @{ int a, b; @dots{} @}
-@end example
-
-@noindent
-In GNU C you can shield the commas using the @samp{(@{@dots{}@})}
-construct which turns a compound statement into an expression:
-
-@example
-#define foo (@{ int a, b; @dots{} @})
-@end example
-
-Or you can rewrite the macro definition to avoid such commas:
-
-@example
-#define foo @{ int a; int b; @dots{} @}
-@end example
-
-There is also one case where prescan is useful. It is possible to use
-prescan to expand an argument and then stringify it --- if you use two
-levels of macros. Let's add a new macro @samp{xstr} to the example
-shown above:
-
-@example
-#define xstr(s) str(s)
-#define str(s) #s
-#define foo 4
-xstr (foo)
-@end example
-
-This expands into @samp{"4"}, not @samp{"foo"}. The reason for the
-difference is that the argument of @samp{xstr} is expanded at prescan
-(because @samp{xstr} does not specify stringification or concatenation
-of the argument). The result of prescan then forms the argument for
-@samp{str}. @samp{str} uses its argument without prescan because it
-performs stringification; but it cannot prevent or undo the prescanning
-already done by @samp{xstr}.
-
-@node Cascaded Macros, Newlines in Args, Argument Prescan, Macro Pitfalls
-@subsubsection Cascaded Use of Macros
-
-@cindex cascaded macros
-@cindex macro body uses macro
-A @dfn{cascade} of macros is when one macro's body contains a reference
-to another macro. This is very common practice. For example,
-
-@example
-#define BUFSIZE 1020
-#define TABLESIZE BUFSIZE
-@end example
-
-This is not at all the same as defining @samp{TABLESIZE} to be
-@samp{1020}. The @samp{#define} for @samp{TABLESIZE} uses exactly the
-body you specify --- in this case, @samp{BUFSIZE} --- and does not check
-to see whether it too is the name of a macro.
-
-It's only when you @emph{use} @samp{TABLESIZE} that the result of its
-expansion is checked for more macro names.
-
-This makes a difference if you change the definition of @samp{BUFSIZE}
-at some point in the source file. @samp{TABLESIZE}, defined as shown,
-will always expand using the definition of @samp{BUFSIZE} that is
-currently in effect:
-
-@example
-#define BUFSIZE 1020
-#define TABLESIZE BUFSIZE
-#undef BUFSIZE
-#define BUFSIZE 37
-@end example
-
-@noindent
-Now @samp{TABLESIZE} expands (in two stages) to @samp{37}. (The
-@samp{#undef} is to prevent any warning about the nontrivial
-redefinition of @code{BUFSIZE}.)
-
-@node Newlines in Args,, Cascaded Macros, Macro Pitfalls
-@subsection Newlines in Macro Arguments
-@cindex newlines in macro arguments
-
-The invocation of a function-like macro can extend over many logical
-lines. The ISO C standard requires that newlines within a macro
-invocation be treated as ordinary whitespace. This means that when the
-expansion of a function-like macro replaces its invocation, it appears
-on the same line as the macro name did. Thus line numbers emitted by
-the compiler or debugger refer to the line the invocation started on,
-which might be different to the line containing the argument causing the
-problem.
-
-Here is an example illustrating this:
-
-@example
-#define ignore_second_arg(a,b,c) a; c
-
-ignore_second_arg (foo (),
- ignored (),
- syntax error);
-@end example
-
-@noindent
-The syntax error triggered by the tokens @samp{syntax error} results in
-an error message citing line three --- the line of ignore_second_arg ---
-even though the problematic code comes from line five.
-
-@node Conditionals, Assertions, Macros, Top
-@section Conditionals
-
-@cindex conditionals
-In a macro processor, a @dfn{conditional} is a directive that allows a
-part of the program to be ignored during compilation, on some
-conditions. In the C preprocessor, a conditional can test either an
-arithmetic expression or whether a name is defined as a macro.
-
-A conditional in the C preprocessor resembles in some ways an @samp{if}
-statement in C, but it is important to understand the difference between
-them. The condition in an @samp{if} statement is tested during the
-execution of your program. Its purpose is to allow your program to
-behave differently from run to run, depending on the data it is
-operating on. The condition in a preprocessing conditional directive is
-tested when your program is compiled. Its purpose is to allow different
-code to be included in the program depending on the situation at the
-time of compilation.
-
-@menu
-* Uses: Conditional Uses. What conditionals are for.
-* Syntax: Conditional Syntax. How conditionals are written.
-* Deletion: Deleted Code. Making code into a comment.
-* Macros: Conditionals-Macros. Why conditionals are used with macros.
-* Errors: #error Directive. Detecting inconsistent compilation parameters.
-@end menu
-
-@node Conditional Uses
-@subsection Why Conditionals are Used
-
-Generally there are three kinds of reason to use a conditional.
-
-@itemize @bullet
-@item
-A program may need to use different code depending on the machine or
-operating system it is to run on. In some cases the code for one
-operating system may be erroneous on another operating system; for
-example, it might refer to library routines that do not exist on the
-other system. When this happens, it is not enough to avoid executing
-the invalid code: merely having it in the program makes it impossible to
-link the program and run it. With a preprocessing conditional, the
-offending code can be effectively excised from the program when it is
-not valid.
-
-@item
-You may want to be able to compile the same source file into two
-different programs. Sometimes the difference between the programs is
-that one makes frequent time-consuming consistency checks on its
-intermediate data, or prints the values of those data for debugging,
-while the other does not.
-
-@item
-A conditional whose condition is always false is a good way to exclude
-code from the program but keep it as a sort of comment for future
-reference.
-@end itemize
-
-Most simple programs that are intended to run on only one machine will
-not need to use preprocessing conditionals.
-
-@node Conditional Syntax
-@subsection Syntax of Conditionals
-
-@findex #if
-A conditional in the C preprocessor begins with a @dfn{conditional
-directive}: @samp{#if}, @samp{#ifdef} or @samp{#ifndef}.
-@xref{Conditionals-Macros}, for information on @samp{#ifdef} and
-@samp{#ifndef}; only @samp{#if} is explained here.
-
-@menu
-* If: #if Directive. Basic conditionals using @samp{#if} and @samp{#endif}.
-* Else: #else Directive. Including some text if the condition fails.
-* Elif: #elif Directive. Testing several alternative possibilities.
-@end menu
-
-@node #if Directive
-@subsubsection The @samp{#if} Directive
-
-The @samp{#if} directive in its simplest form consists of
-
-@example
-#if @var{expression}
-@var{controlled text}
-#endif /* @var{expression} */
-@end example
-
-The comment following the @samp{#endif} is not required, but it is a
-good practice because it helps people match the @samp{#endif} to the
-corresponding @samp{#if}. Such comments should always be used, except
-in short conditionals that are not nested. In fact, you can put
-anything at all after the @samp{#endif} and it will be ignored by the
-GNU C preprocessor, but only comments are acceptable in ISO Standard C@.
-
-@var{expression} is a C expression of integer type, subject to stringent
-restrictions. It may contain
-
-@itemize @bullet
-@item
-Integer constants, which are all regarded as @code{long} or
-@code{unsigned long}.
-
-@item
-Character constants, which are interpreted according to the character
-set and conventions of the machine and operating system on which the
-preprocessor is running. The GNU C preprocessor uses the C data type
-@samp{char} for these character constants; therefore, whether some
-character codes are negative is determined by the C compiler used to
-compile the preprocessor. If it treats @samp{char} as signed, then
-character codes large enough to set the sign bit will be considered
-negative; otherwise, no character code is considered negative.
-
-@item
-Arithmetic operators for addition, subtraction, multiplication,
-division, bitwise operations, shifts, comparisons, and logical
-operations (@samp{&&} and @samp{||}). The latter two obey the usual
-short-circuiting rules of standard C.
-
-@item
-Identifiers that are not macros, which are all treated as zero(!).
-
-@item
-Macro calls. All macro calls in the expression are expanded before
-actual computation of the expression's value begins.
-@end itemize
-
-Note that @samp{sizeof} operators and @code{enum}-type values are not
-allowed. @code{enum}-type values, like all other identifiers that are
-not taken as macro calls and expanded, are treated as zero.
-
-The @var{controlled text} inside of a conditional can include
-preprocessing directives. Then the directives inside the conditional
-are obeyed only if that branch of the conditional succeeds. The text
-can also contain other conditional groups. However, the @samp{#if} and
-@samp{#endif} directives must balance.
-
-@node #else Directive
-@subsubsection The @samp{#else} Directive
-
-@findex #else
-The @samp{#else} directive can be added to a conditional to provide
-alternative text to be used if the condition is false. This is what
-it looks like:
-
-@example
-#if @var{expression}
-@var{text-if-true}
-#else /* Not @var{expression} */
-@var{text-if-false}
-#endif /* Not @var{expression} */
-@end example
-
-If @var{expression} is nonzero, and thus the @var{text-if-true} is
-active, then @samp{#else} acts like a failing conditional and the
-@var{text-if-false} is ignored. Conversely, if the @samp{#if}
-conditional fails, the @var{text-if-false} is considered included.
-
-@node #elif Directive
-@subsubsection The @samp{#elif} Directive
-
-@findex #elif
-One common case of nested conditionals is used to check for more than two
-possible alternatives. For example, you might have
-
-@example
-#if X == 1
-@dots{}
-#else /* X != 1 */
-#if X == 2
-@dots{}
-#else /* X != 2 */
-@dots{}
-#endif /* X != 2 */
-#endif /* X != 1 */
-@end example
-
-Another conditional directive, @samp{#elif}, allows this to be
-abbreviated as follows:
-
-@example
-#if X == 1
-@dots{}
-#elif X == 2
-@dots{}
-#else /* X != 2 and X != 1*/
-@dots{}
-#endif /* X != 2 and X != 1*/
-@end example
-
-@samp{#elif} stands for ``else if''. Like @samp{#else}, it goes in the
-middle of a @samp{#if}-@samp{#endif} pair and subdivides it; it does not
-require a matching @samp{#endif} of its own. Like @samp{#if}, the
-@samp{#elif} directive includes an expression to be tested.
-
-The text following the @samp{#elif} is processed only if the original
-@samp{#if}-condition failed and the @samp{#elif} condition succeeds.
-More than one @samp{#elif} can go in the same @samp{#if}-@samp{#endif}
-group. Then the text after each @samp{#elif} is processed only if the
-@samp{#elif} condition succeeds after the original @samp{#if} and any
-previous @samp{#elif} directives within it have failed. @samp{#else} is
-equivalent to @samp{#elif 1}, and @samp{#else} is allowed after any
-number of @samp{#elif} directives, but @samp{#elif} may not follow
-@samp{#else}.
-
-@node Deleted Code
-@subsection Keeping Deleted Code for Future Reference
-@cindex commenting out code
-
-If you replace or delete a part of the program but want to keep the old
-code around as a comment for future reference, the easy way to do this
-is to put @samp{#if 0} before it and @samp{#endif} after it. This is
-better than using comment delimiters @samp{/*} and @samp{*/} since those
-won't work if the code already contains comments (C comments do not
-nest).
-
-This works even if the code being turned off contains conditionals, but
-they must be entire conditionals (balanced @samp{#if} and @samp{#endif}).
-
-Conversely, do not use @samp{#if 0} for comments which are not C code.
-Use the comment delimiters @samp{/*} and @samp{*/} instead. The
-interior of @samp{#if 0} must consist of complete tokens; in particular,
-single-quote characters must balance. Comments often contain unbalanced
-single-quote characters (known in English as apostrophes). These
-confuse @samp{#if 0}. They do not confuse @samp{/*}.
-
-@node Conditionals-Macros
-@subsection Conditionals and Macros
-
-Conditionals are useful in connection with macros or assertions, because
-those are the only ways that an expression's value can vary from one
-compilation to another. A @samp{#if} directive whose expression uses no
-macros or assertions is equivalent to @samp{#if 1} or @samp{#if 0}; you
-might as well determine which one, by computing the value of the
-expression yourself, and then simplify the program.
-
-For example, here is a conditional that tests the expression
-@samp{BUFSIZE == 1020}, where @samp{BUFSIZE} must be a macro.
-
-@example
-#if BUFSIZE == 1020
- printf ("Large buffers!\n");
-#endif /* BUFSIZE is large */
-@end example
-
-(Programmers often wish they could test the size of a variable or data
-type in @samp{#if}, but this does not work. The preprocessor does not
-understand @code{sizeof}, or typedef names, or even the type keywords
-such as @code{int}.)
-
-@findex defined
-The special operator @samp{defined} is used in @samp{#if} and
-@samp{#elif} expressions to test whether a certain name is defined as a
-macro. Either @samp{defined @var{name}} or @samp{defined (@var{name})}
-is an expression whose value is 1 if @var{name} is defined as macro at
-the current point in the program, and 0 otherwise. To the
-@samp{defined} operator it makes no difference what the definition of
-the macro is; all that matters is whether there is a definition. Thus,
-for example,@refill
-
-@example
-#if defined (vax) || defined (ns16000)
-@end example
-
-@noindent
-would succeed if either of the names @samp{vax} and @samp{ns16000} is
-defined as a macro. You can test the same condition using assertions
-(@pxref{Assertions}), like this:
-
-@example
-#if #cpu (vax) || #cpu (ns16000)
-@end example
-
-If a macro is defined and later undefined with @samp{#undef}, subsequent
-use of the @samp{defined} operator returns 0, because the name is no
-longer defined. If the macro is defined again with another
-@samp{#define}, @samp{defined} will recommence returning 1.
-
-If the @samp{defined} operator appears as a result of a macro expansion,
-the C standard says the behavior is undefined. GNU cpp treats it as a
-genuine @samp{defined} operator and evaluates it normally. It will warn
-wherever your code uses this feature if you use the command-line option
-@samp{-pedantic}, since other compilers may handle it differently.
-
-@findex #ifdef
-@findex #ifndef
-Conditionals that test whether a single macro is defined are very common,
-so there are two special short conditional directives for this case.
-
-@table @code
-@item #ifdef @var{name}
-is equivalent to @samp{#if defined (@var{name})}.
-
-@item #ifndef @var{name}
-is equivalent to @samp{#if ! defined (@var{name})}.
-@end table
-
-Macro definitions can vary between compilations for several reasons.
-
-@itemize @bullet
-@item
-Some macros are predefined on each kind of machine. For example, on a
-Vax, the name @samp{vax} is a predefined macro. On other machines, it
-would not be defined.
-
-@item
-Many more macros are defined by system header files. Different systems
-and machines define different macros, or give them different values. It
-is useful to test these macros with conditionals to avoid using a system
-feature on a machine where it is not implemented.
-
-@item
-Macros are a common way of allowing users to customize a program for
-different machines or applications. For example, the macro
-@samp{BUFSIZE} might be defined in a configuration file for your program
-that is included as a header file in each source file. You would use
-@samp{BUFSIZE} in a preprocessing conditional in order to generate
-different code depending on the chosen configuration.
-
-@item
-Macros can be defined or undefined with @samp{-D} and @samp{-U} command
-options when you compile the program. You can arrange to compile the
-same source file into two different programs by choosing a macro name to
-specify which program you want, writing conditionals to test whether or
-how this macro is defined, and then controlling the state of the macro
-with compiler command options. @xref{Invocation}.
-@end itemize
-
-@ifinfo
-Assertions are usually predefined, but can be defined with preprocessor
-directives or command-line options.
-@end ifinfo
-
-@node #error Directive
-@subsection The @samp{#error} and @samp{#warning} Directives
-
-@findex #error
-The directive @samp{#error} causes the preprocessor to report a fatal
-error. The tokens forming the rest of the line following @samp{#error}
-are used as the error message, and not macro-expanded. Internal
-whitespace sequences are each replaced with a single space. The line
-must consist of complete tokens.
-
-You would use @samp{#error} inside of a conditional that detects a
-combination of parameters which you know the program does not properly
-support. For example, if you know that the program will not run
-properly on a Vax, you might write
-
-@smallexample
-@group
-#ifdef __vax__
-#error "Won't work on Vaxen. See comments at get_last_object."
-#endif
-@end group
-@end smallexample
-
-@noindent
-@xref{Nonstandard Predefined}, for why this works.
-
-If you have several configuration parameters that must be set up by
-the installation in a consistent way, you can use conditionals to detect
-an inconsistency and report it with @samp{#error}. For example,
-
-@smallexample
-#if HASH_TABLE_SIZE % 2 == 0 || HASH_TABLE_SIZE % 3 == 0 \
- || HASH_TABLE_SIZE % 5 == 0
-#error HASH_TABLE_SIZE should not be divisible by a small prime
-#endif
-@end smallexample
-
-@findex #warning
-The directive @samp{#warning} is like the directive @samp{#error}, but
-causes the preprocessor to issue a warning and continue preprocessing.
-The tokens following @samp{#warning} are used as the warning message,
-and not macro-expanded.
-
-You might use @samp{#warning} in obsolete header files, with a message
-directing the user to the header file which should be used instead.
-
-@node Assertions, Line Control, Conditionals, Top
-@section Assertions
-@cindex assertions
-@dfn{Assertions} are a more systematic alternative to macros in writing
-conditionals to test what sort of computer or system the compiled
-program will run on. Assertions are usually predefined, but you can
-define them with preprocessing directives or command-line options.
-
-@cindex predicates
-The macros traditionally used to describe the type of target are not
-classified in any way according to which question they answer; they may
-indicate a hardware architecture, a particular hardware model, an
-operating system, a particular version of an operating system, or
-specific configuration options. These are jumbled together in a single
-namespace. In contrast, each assertion consists of a named question and
-an answer. The question is usually called the @dfn{predicate}. An
-assertion looks like this:
-
-@example
-#@var{predicate} (@var{answer})
-@end example
-
-@noindent
-You must use a properly formed identifier for @var{predicate}. The
-value of @var{answer} can be any sequence of words; all characters are
-significant except for leading and trailing whitespace, and differences
-in internal whitespace sequences are ignored. (This is similar to the
-rules governing macro redefinition.) Thus, @samp{x + y} is different
-from @samp{x+y} but equivalent to @samp{ x + y }. @samp{)} is not
-allowed in an answer.
-
-@cindex testing predicates
-Here is a conditional to test whether the answer @var{answer} is asserted
-for the predicate @var{predicate}:
-
-@example
-#if #@var{predicate} (@var{answer})
-@end example
-
-@noindent
-There may be more than one answer asserted for a given predicate. If
-you omit the answer, you can test whether @emph{any} answer is asserted
-for @var{predicate}:
-
-@example
-#if #@var{predicate}
-@end example
-
-@findex #system
-@findex #machine
-@findex #cpu
-Most of the time, the assertions you test will be predefined assertions.
-GNU C provides three predefined predicates: @code{system}, @code{cpu},
-and @code{machine}. @code{system} is for assertions about the type of
-software, @code{cpu} describes the type of computer architecture, and
-@code{machine} gives more information about the computer. For example,
-on a GNU system, the following assertions would be true:
-
-@example
-#system (gnu)
-#system (mach)
-#system (mach 3)
-#system (mach 3.@var{subversion})
-#system (hurd)
-#system (hurd @var{version})
-@end example
-
-@noindent
-and perhaps others. The alternatives with
-more or less version information let you ask more or less detailed
-questions about the type of system software.
-
-On a Unix system, you would find @code{#system (unix)} and perhaps one of:
-@code{#system (aix)}, @code{#system (bsd)}, @code{#system (hpux)},
-@code{#system (lynx)}, @code{#system (mach)}, @code{#system (posix)},
-@code{#system (svr3)}, @code{#system (svr4)}, or @code{#system (xpg4)}
-with possible version numbers following.
-
-Other values for @code{system} are @code{#system (mvs)}
-and @code{#system (vms)}.
-
-@strong{Portability note:} Many Unix C compilers provide only one answer
-for the @code{system} assertion: @code{#system (unix)}, if they support
-assertions at all. This is less than useful.
-
-An assertion with a multi-word answer is completely different from several
-assertions with individual single-word answers. For example, the presence
-of @code{system (mach 3.0)} does not mean that @code{system (3.0)} is true.
-It also does not directly imply @code{system (mach)}, but in GNU C, that
-last will normally be asserted as well.
-
-The current list of possible assertion values for @code{cpu} is:
-@code{#cpu (a29k)}, @code{#cpu (alpha)}, @code{#cpu (arm)}, @code{#cpu
-(clipper)}, @code{#cpu (convex)}, @code{#cpu (elxsi)}, @code{#cpu
-(tron)}, @code{#cpu (h8300)}, @code{#cpu (i370)}, @code{#cpu (i386)},
-@code{#cpu (i860)}, @code{#cpu (i960)}, @code{#cpu (m68k)}, @code{#cpu
-(m88k)}, @code{#cpu (mips)}, @code{#cpu (ns32k)}, @code{#cpu (hppa)},
-@code{#cpu (pyr)}, @code{#cpu (ibm032)}, @code{#cpu (rs6000)},
-@code{#cpu (sh)}, @code{#cpu (sparc)}, @code{#cpu (spur)}, @code{#cpu
-(tahoe)}, @code{#cpu (vax)}, @code{#cpu (we32000)}.
-
-@findex #assert
-You can create assertions within a C program using @samp{#assert}, like
-this:
-
-@example
-#assert @var{predicate} (@var{answer})
-@end example
-
-@noindent
-(Note the absence of a @samp{#} before @var{predicate}.)
-
-@cindex unassert
-@cindex assertions, undoing
-@cindex retracting assertions
-@findex #unassert
-Each time you do this, you assert a new true answer for @var{predicate}.
-Asserting one answer does not invalidate previously asserted answers;
-they all remain true. The only way to remove an answer is with
-@samp{#unassert}. @samp{#unassert} has the same syntax as
-@samp{#assert}. You can also remove all answers to a @var{predicate}
-like this:
-
-@example
-#unassert @var{predicate}
-@end example
-
-You can also add or cancel assertions using command options
-when you run @code{gcc} or @code{cpp}. @xref{Invocation}.
-
-@node Line Control, Other Directives, Assertions, Top
-@section Combining Source Files
-
-@cindex line control
-One of the jobs of the C preprocessor is to inform the C compiler of where
-each line of C code came from: which source file and which line number.
-
-C code can come from multiple source files if you use @samp{#include};
-both @samp{#include} and the use of conditionals and macros can cause
-the line number of a line in the preprocessor output to be different
-from the line's number in the original source file. You will appreciate
-the value of making both the C compiler (in error messages) and symbolic
-debuggers such as GDB use the line numbers in your source file.
-
-The C preprocessor builds on this feature by offering a directive by
-which you can control the feature explicitly. This is useful when a
-file for input to the C preprocessor is the output from another program
-such as the @code{bison} parser generator, which operates on another
-file that is the true source file. Parts of the output from
-@code{bison} are generated from scratch, other parts come from a
-standard parser file. The rest are copied nearly verbatim from the
-source file, but their line numbers in the @code{bison} output are not
-the same as their original line numbers. Naturally you would like
-compiler error messages and symbolic debuggers to know the original
-source file and line number of each line in the @code{bison} input.
-
-@findex #line
-@code{bison} arranges this by writing @samp{#line} directives into the output
-file. @samp{#line} is a directive that specifies the original line number
-and source file name for subsequent input in the current preprocessor input
-file. @samp{#line} has three variants:
-
-@table @code
-@item #line @var{linenum}
-Here @var{linenum} is a decimal integer constant. This specifies that
-the line number of the following line of input, in its original source file,
-was @var{linenum}.
-
-@item #line @var{linenum} @var{filename}
-Here @var{linenum} is a decimal integer constant and @var{filename} is a
-string constant. This specifies that the following line of input came
-originally from source file @var{filename} and its line number there was
-@var{linenum}. Keep in mind that @var{filename} is not just a file
-name; it is surrounded by double-quote characters so that it looks like
-a string constant.
-
-@item #line @var{anything else}
-@var{anything else} is checked for macro calls, which are expanded.
-The result should be a decimal integer constant followed optionally
-by a string constant, as described above.
-@end table
-
-@samp{#line} directives alter the results of the @samp{__FILE__} and
-@samp{__LINE__} predefined macros from that point on. @xref{Standard
-Predefined}.
-
-The output of the preprocessor (which is the input for the rest of the
-compiler) contains directives that look much like @samp{#line}
-directives. They start with just @samp{#} instead of @samp{#line}, but
-this is followed by a line number and file name as in @samp{#line}.
-@xref{Output}.
-
-@node Other Directives, Output, Line Control, Top
-@section Miscellaneous Preprocessing Directives
-
-This section describes some additional, rarely used, preprocessing
-directives.
-
-@findex #pragma
-@findex #pragma GCC
-
-The ISO standard specifies that the effect of the @samp{#pragma}
-directive is implementation-defined. The GNU C preprocessor recognizes
-some pragmas, and passes unrecognized ones through to the preprocessor
-output, so they are available to the compilation pass.
-
-In line with the C99 standard, which introduces a STDC namespace for C99
-pragmas, the preprocessor introduces a GCC namespace for GCC pragmas.
-Supported GCC preprocessor pragmas are of the form @samp{#pragma GCC
-...}. For backwards compatibility previously supported pragmas are also
-recognized without the @samp{GCC} prefix, however that use is
-deprecated. Pragmas that are already deprecated are not recognized with
-a @samp{GCC} prefix.
-
-@findex #pragma GCC dependency
-The @samp{#pragma GCC dependency} allows you to check the relative dates
-of the current file and another file. If the other file is more recent
-than the current file, a warning is issued. This is useful if the
-include file is derived from the other file, and should be regenerated.
-The other file is searched for using the normal include search path.
-Optional trailing text can be used to give more information in the
-warning message.
-
-@smallexample
-#pragma GCC dependency "parse.y"
-#pragma GCC dependency "/usr/include/time.h" rerun /path/to/fixincludes
-@end smallexample
-
-@findex _Pragma
-The C99 standard also introduces the @samp{_Pragma} operator. The
-syntax is @code{_Pragma (string-literal)}, where @samp{string-literal}
-can be either a normal or wide-character string literal. It is
-destringized, by replacing all @samp{\\} with a single @samp{\} and all
-@samp{\"} with a @samp{"}. The result is then processed as if it had
-appeared as the right hand side of a @samp{#pragma} directive. For
-example,
-
-@smallexample
-_Pragma ("GCC dependency \"parse.y\"")
-@end smallexample
-
-@noindent has the same effect as @samp{#pragma GCC dependency
-"parse.y"}. The same effect could be achieved using macros, for example
-
-@smallexample
-#define DO_PRAGMA(x) _Pragma (#x)
-DO_PRAGMA (GCC dependency "parse.y")
-@end smallexample
-
-The standard is unclear on where a @samp{_Pragma} operator can appear.
-The preprocessor accepts it even within a preprocessing conditional
-directive like @samp{#if}. To be safe, you are probably best keeping it
-out of directives other than @samp{#define}, and putting it on a line of
-its own.
-
-@findex #ident
-The @samp{#ident} directive is supported for compatibility with certain
-other systems. It is followed by a line of text. On some systems, the
-text is copied into a special place in the object file; on most systems,
-the text is ignored and this directive has no effect. Typically
-@samp{#ident} is only used in header files supplied with those systems
-where it is meaningful.
-
-@cindex null directive
-The @dfn{null directive} consists of a @samp{#} followed by a newline,
-with only whitespace (including comments) in between. A null directive
-is understood as a preprocessing directive but has no effect on the
-preprocessor output. The primary significance of the existence of the
-null directive is that an input line consisting of just a @samp{#} will
-produce no output, rather than a line of output containing just a
-@samp{#}. Supposedly some old C programs contain such lines.
-
-@node Output, Implementation, Other Directives, Top
-@section C Preprocessor Output
-
-@cindex output format
-The output from the C preprocessor looks much like the input, except
-that all preprocessing directive lines have been replaced with blank
-lines and all comments with spaces.
-
-The ISO standard specifies that it is implementation defined whether a
-preprocessor preserves whitespace between tokens, or replaces it with
-e.g. a single space. In the GNU C preprocessor, whitespace between
-tokens is collapsed to become a single space, with the exception that
-the first token on a non-directive line is preceded with sufficient
-spaces that it appears in the same column in the preprocessed output
-that it appeared in in the original source file. This is so the output
-is easy to read. @xref{Unreliable Features}.
-
-Source file name and line number information is conveyed by lines
-of the form
-
-@example
-# @var{linenum} @var{filename} @var{flags}
-@end example
-
-@noindent
-which are inserted as needed into the output (but never within a string
-or character constant), and in place of long sequences of empty lines.
-Such a line means that the following line originated in file
-@var{filename} at line @var{linenum}.
-
-After the file name comes zero or more flags, which are @samp{1},
-@samp{2}, @samp{3}, or @samp{4}. If there are multiple flags, spaces
-separate them. Here is what the flags mean:
-
-@table @samp
-@item 1
-This indicates the start of a new file.
-@item 2
-This indicates returning to a file (after having included another file).
-@item 3
-This indicates that the following text comes from a system header file,
-so certain warnings should be suppressed.
-@item 4
-This indicates that the following text should be treated as C@.
-@c maybe cross reference NO_IMPLICIT_EXTERN_C
-@end table
-
-@node Implementation, Unreliable Features, Output, Top
-@section Implementation-defined Behavior and Implementation Limits
-@cindex implementation limits
-@cindex implementation-defined behavior
-
-The ISO C standard mandates that implementations document various
-aspects of preprocessor behavior. You should try to avoid undue
-reliance on behaviour described here, as it is possible that it will
-change subtly in future implementations.
-
-@itemize @bullet
-
-@item The mapping of physical source file multi-byte characters to the
-execution character set.
-
-Currently, GNU cpp only supports character sets that are strict supersets
-of ASCII, and performs no translation of characters.
-
-@item Non-empty sequences of whitespace characters.
-
-Each whitespace sequence is not preserved, but collapsed to a single
-space. For aesthetic reasons, the first token on each non-directive
-line of output is preceded with sufficient spaces that it appears in the
-same column as it did in the original source file.
-
-@item The numeric value of character constants in preprocessor expressions.
-
-The preprocessor interprets character constants in preprocessing
-directives on the host machine. Expressions outside preprocessing
-directives are compiled to be interpreted on the target machine. In the
-normal case of a native compiler, these two environments are the same
-and so character constants will be evaluated identically in both cases.
-However, in the case of a cross compiler, the values may be different.
-
-Multi-character character constants are interpreted a character at a
-time, shifting the previous result left by the number of bits per
-character on the host, and adding the new character. For example, 'ab'
-on an 8-bit host would be interpreted as 'a' * 256 + 'b'. If there are
-more characters in the constant than can fit in the widest native
-integer type on the host, usually a @samp{long}, the behavior is
-undefined.
-
-Evaluation of wide character constants is not properly implemented yet.
-
-@item Source file inclusion.
-
-For a discussion on how the preprocessor locates header files,
-@pxref{Include Operation}.
-
-@item Interpretation of the filename resulting from a macro-expanded
-@samp{#include} directive.
-
-If the macro expands to a string literal, the @samp{#include} directive
-is processed as if the string had been specified directly. Otherwise,
-the macro must expand to a token stream beginning with a @samp{<} token
-and including a @samp{>} token. In this case, the tokens between the
-@samp{<} and the first @samp{>} are combined to form the filename to be
-included. Any whitespace between tokens is reduced to a single space;
-then any space after the initial @samp{<} is retained, but a trailing
-space before the closing @samp{>} is ignored.
-
-In either case, if any excess tokens remain, an error occurs and the
-directive is not processed.
-
-@item Treatment of a @samp{#pragma} directive that after macro-expansion
-results in a standard pragma.
-
-The pragma is processed as if it were a normal standard pragma.
-
-@end itemize
-
-The following documents internal limits of GNU cpp.
-
-@itemize @bullet
-
-@item Nesting levels of @samp{#include} files.
-
-We impose an arbitrary limit of 200 levels, to avoid runaway recursion.
-The standard requires at least 15 levels.
-
-@item Nesting levels of conditional inclusion.
-
-The C standard mandates this be at least 63. The GNU C preprocessor
-is limited only by available memory.
-
-@item Levels of parenthesised expressions within a full expression.
-
-The C standard requires this to be at least 63. In preprocessor
-conditional expressions it is limited only by available memory.
-
-@item Significant initial characters in an identifier or macro name.
-
-The preprocessor treats all characters as significant. The C standard
-requires only that the first 63 be significant.
-
-@item Number of macros simultaneously defined in a single translation unit.
-
-The standard requires at least 4095 be possible; GNU cpp is limited only
-by available memory.
-
-@item Number of parameters in a macro definition and arguments in a macro call.
-
-We allow USHRT_MAX, which is normally 65,535, and above the minimum of
-127 required by the standard.
-
-@item Number of characters on a logical source line.
-
-The C standard requires a minimum of 4096 be permitted. GNU cpp places
-no limits on this, but you may get incorrect column numbers reported in
-diagnostics for lines longer than 65,535 characters.
-
-@end itemize
-
-@node Unreliable Features, Invocation, Implementation, Top
-@section Undefined Behavior and Deprecated Features
-@cindex undefined behavior
-@cindex deprecated features
-
-This section details GNU C preprocessor behavior that is subject to
-change or deprecated. You are @emph{strongly advised} to write your
-software so it does not rely on anything described here; future versions
-of the preprocessor may subtly change such behavior or even remove the
-feature altogether.
-
-Preservation of the form of whitespace between tokens is unlikely to
-change from current behavior (@ref{Output}), but you are advised not
-to rely on it.
-
-The following are undocumented and subject to change:-
-
-@itemize @bullet
-
-@item Precedence of ## operators with respect to each other
-
-Whether a sequence of ## operators is evaluated left-to-right,
-right-to-left or indeed in a consistent direction at all is not
-specified. An example of where this might matter is pasting the
-arguments @samp{1}, @samp{e} and @samp{-2}. This would be fine for
-left-to-right pasting, but right-to-left pasting would produce an
-invalid token @samp{e-2}. It is possible to guarantee precedence by
-suitable use of nested macros.
-
-@item Precedence of # operator with respect to the ## operator
-
-Which of these two operators is evaluated first is not specified.
-
-@end itemize
-
-The following features are in flux and should not be used in portable
-code:
-
-@itemize @bullet
-
-@item Optional argument when invoking rest argument macros
-
-As an extension, GCC permits you to omit the variable arguments entirely
-when you use a variable argument macro. This works whether or not you
-give the variable argument a name. For example, the two macro
-invocations in the example below expand to the same thing:
-
-@smallexample
-#define debug(format, ...) printf (format, __VA_ARGS__)
-debug("string"); /* Not permitted by C standard. */
-debug("string",); /* OK. */
-@end smallexample
-
-This extension will be preserved, but the special behavior of @samp{##}
-in this context has changed in the past and may change again in the
-future.
-
-@item ## swallowing preceding text in rest argument macros
-
-Formerly, in a macro expansion, if @samp{##} appeared before a variable
-arguments parameter, and the set of tokens specified for that argument in
-the macro invocation was empty, previous versions of the GNU C
-preprocessor would back up and remove the preceding sequence of
-non-whitespace characters (@strong{not} the preceding token). This
-extension is in direct conflict with the 1999 C standard and has been
-drastically pared back.
-
-In the current version of the preprocessor, if @samp{##} appears between
-a comma and a variable arguments parameter, and the variable argument is
-omitted entirely, the comma will be removed from the expansion. If the
-variable argument is empty, or the token before @samp{##} is not a
-comma, then @samp{##} behaves as a normal token paste.
-
-Portable code should avoid this extension at all costs.
-
-@end itemize
-
-The following features are deprecated and will likely be removed at some
-point in the future:-
-
-@itemize @bullet
-
-@item Attempting to paste two tokens which together do not form a valid
-preprocessing token
-
-The preprocessor currently warns about this and outputs the two tokens
-adjacently, which is probably the behavior the programmer intends. It
-may not work in future, though.
-
-Most of the time, when you get this warning, you will find that @samp{##}
-is being used superstitiously, to guard against whitespace appearing
-between two tokens. It is almost always safe to delete the @samp{##}.
-
-@findex #pragma once
-@item #pragma once
-
-This pragma was once used to tell the preprocessor that it need not
-include a file more than once. It is now obsolete and should not be
-used at all.
-
-@item #pragma poison
-
-This pragma has been superseded by @samp{#pragma GCC poison}.
-@xref{Poisoning}.
-
-@item Multi-line string literals in directives
-
-The GNU C preprocessor currently allows newlines in string literals
-within a directive. This is forbidden by the C standard and will
-eventually be removed. (Multi-line string literals in open text are
-still supported.)
-
-@item Preprocessing things which are not C
-
-The C preprocessor is intended to be used only with C, C++, and
-Objective C source code. In the past, it has been abused as a general
-text processor. It will choke on input which is not lexically valid C;
-for example, apostrophes will be interpreted as the beginning of
-character constants, and cause errors. Also, you cannot rely on it
-preserving characteristics of the input which are not significant to
-C-family languages. For instance, if a Makefile is preprocessed, all
-the hard tabs will be lost, and the Makefile will not work.
-
-Having said that, you can often get away with using cpp on things which
-are not C. Other Algol-ish programming languages are often safe
-(Pascal, Ada, ...) and so is assembly, with caution. @samp{-traditional}
-mode is much more permissive, and can safely be used with e.g. Fortran.
-Many of the problems go away if you write C or C++ style comments
-instead of native language comments, and if you avoid elaborate macros.
-
-Wherever possible, you should use a preprocessor geared to the language
-you are writing in. Modern versions of the GNU assembler have macro
-facilities. Most high level programming languages have their own
-conditional compilation and inclusion mechanism. If all else fails,
-try a true general text processor, such as @xref{Top, M4, , m4, GNU `m4'}.
-
-@end itemize
-
-@node Invocation, Concept Index, Unreliable Features, Top
-@section Invoking the C Preprocessor
-@cindex invocation of the preprocessor
-
-Most often when you use the C preprocessor you will not have to invoke it
-explicitly: the C compiler will do so automatically. However, the
-preprocessor is sometimes useful on its own.
-
-@ignore
-@c man begin SYNOPSIS
-cpp [@samp{-P}] [@samp{-C}] [@samp{-gcc}] [@samp{-traditional}]
- [@samp{-undef}] [@samp{-trigraphs}] [@samp{-pedantic}]
- [@samp{-W}@var{warn}...] [@samp{-I}@var{dir}...]
- [@samp{-D}@var{macro}[=@var{defn}]...] [@samp{-U}@var{macro}]
- [@samp{-A}@var{predicate}(@var{answer})]
- [@samp{-M}|@samp{-MM}][@samp{-MG}][@samp{-MF}@var{filename}]
- [@samp{-MP}][@samp{-MQ}@var{target}...][@samp{-MT}@var{target}...]
- [@samp{-x} @var{language}] [@samp{-std=}@var{standard}]
- @var{infile} @var{outfile}
-
-Only the most useful options are listed here; see below for the remainder.
-@c man end
-@c man begin SEEALSO
-gcc(1), as(1), ld(1), and the Info entries for @file{cpp}, @file{gcc}, and
-@file{binutils}.
-@c man end
-@end ignore
-
-@c man begin OPTIONS
-The C preprocessor expects two file names as arguments, @var{infile} and
-@var{outfile}. The preprocessor reads @var{infile} together with any
-other files it specifies with @samp{#include}. All the output generated
-by the combined input files is written in @var{outfile}.
-
-Either @var{infile} or @var{outfile} may be @samp{-}, which as
-@var{infile} means to read from standard input and as @var{outfile}
-means to write to standard output. Also, if either file is omitted, it
-means the same as if @samp{-} had been specified for that file.
-
-@cindex options
-Here is a table of command options accepted by the C preprocessor.
-These options can also be given when compiling a C program; they are
-passed along automatically to the preprocessor when it is invoked by the
-compiler.
-
-@table @samp
-@item -P
-@findex -P
-Inhibit generation of @samp{#}-lines with line-number information in the
-output from the preprocessor. This might be useful when running the
-preprocessor on something that is not C code and will be sent to a
-program which might be confused by the @samp{#}-lines. @xref{Output}.
-
-@item -C
-@findex -C
-Do not discard comments. All comments are passed through to the output
-file, except for comments in processed directives, which are deleted
-along with the directive. Comments appearing in the expansion list of a
-macro will be preserved, and appear in place wherever the macro is
-invoked.
-
-You should be prepared for side effects when using @samp{-C}; it causes
-the preprocessor to treat comments as tokens in their own right. For
-example, macro redefinitions that were trivial when comments were
-replaced by a single space might become significant when comments are
-retained. Also, comments appearing at the start of what would be a
-directive line have the effect of turning that line into an ordinary
-source line, since the first token on the line is no longer a @samp{#}.
-
-@item -traditional
-@findex -traditional
-Try to imitate the behavior of old-fashioned C, as opposed to ISO C@.
-
-@itemize @bullet
-@item
-Traditional macro expansion pays no attention to single-quote or
-double-quote characters; macro argument symbols are replaced by the
-argument values even when they appear within apparent string or
-character constants.
-
-@item
-Traditionally, it is permissible for a macro expansion to end in the
-middle of a string or character constant. The constant continues into
-the text surrounding the macro call.
-
-@item
-However, traditionally the end of the line terminates a string or
-character constant, with no error.
-
-@item
-In traditional C, a comment is equivalent to no text at all. (In ISO
-C, a comment counts as whitespace.)
-
-@item
-Traditional C does not have the concept of a ``preprocessing number''.
-It considers @samp{1.0e+4} to be three tokens: @samp{1.0e}, @samp{+},
-and @samp{4}.
-
-@item
-A macro is not suppressed within its own definition, in traditional C@.
-Thus, any macro that is used recursively inevitably causes an error.
-
-@item
-The character @samp{#} has no special meaning within a macro definition
-in traditional C@.
-
-@item
-In traditional C, the text at the end of a macro expansion can run
-together with the text after the macro call, to produce a single token.
-(This is impossible in ISO C@.)
-
-@item
-None of the GNU extensions to the preprocessor are available in
-@samp{-traditional} mode.
-
-@end itemize
-
-@cindex Fortran
-@cindex unterminated
-Use the @samp{-traditional} option when preprocessing Fortran code, so
-that single-quotes and double-quotes within Fortran comment lines (which
-are generally not recognized as such by the preprocessor) do not cause
-diagnostics about unterminated character or string constants.
-
-However, this option does not prevent diagnostics about unterminated
-comments when a C-style comment appears to start, but not end, within
-Fortran-style commentary.
-
-So, the following Fortran comment lines are accepted with
-@samp{-traditional}:
-
-@smallexample
-C This isn't an unterminated character constant
-C Neither is "20000000000, an octal constant
-C in some dialects of Fortran
-@end smallexample
-
-However, this type of comment line will likely produce a diagnostic, or
-at least unexpected output from the preprocessor, due to the
-unterminated comment:
-
-@smallexample
-C Some Fortran compilers accept /* as starting
-C an inline comment.
-@end smallexample
-
-@cindex g77
-Note that @code{g77} automatically supplies the @samp{-traditional}
-option when it invokes the preprocessor. However, a future version of
-@code{g77} might use a different, more-Fortran-aware preprocessor in
-place of @code{cpp}.
-
-@item -trigraphs
-@findex -trigraphs
-Process ISO standard trigraph sequences. These are three-character
-sequences, all starting with @samp{??}, that are defined by ISO C to
-stand for single characters. For example, @samp{??/} stands for
-@samp{\}, so @samp{'??/n'} is a character constant for a newline. By
-default, GCC ignores trigraphs, but in standard-conforming modes it
-converts them. See the @samp{-std} option.
-
-The nine trigraph sequences are
-@table @samp
-@item ??(
--> @samp{[}
-
-@item ??)
--> @samp{]}
-
-@item ??<
--> @samp{@{}
-
-@item ??>
--> @samp{@}}
-
-@item ??=
--> @samp{#}
-
-@item ??/
--> @samp{\}
-
-@item ??'
--> @samp{^}
-
-@item ??!
--> @samp{|}
-
-@item ??-
--> @samp{~}
-
-@end table
-
-Trigraph support is not popular, so many compilers do not implement it
-properly. Portable code should not rely on trigraphs being either
-converted or ignored.
-
-@item -pedantic
-@findex -pedantic
-Issue warnings required by the ISO C standard in certain cases such
-as when text other than a comment follows @samp{#else} or @samp{#endif}.
-
-@item -pedantic-errors
-@findex -pedantic-errors
-Like @samp{-pedantic}, except that errors are produced rather than
-warnings.
-
-@item -Wcomment
-@findex -Wcomment
-@itemx -Wcomments
-(Both forms have the same effect).
-Warn whenever a comment-start sequence @samp{/*} appears in a @samp{/*}
-comment, or whenever a backslash-newline appears in a @samp{//} comment.
-
-@item -Wtrigraphs
-@findex -Wtrigraphs
-Warn if any trigraphs are encountered. This option used to take effect
-only if @samp{-trigraphs} was also specified, but now works
-independently. Warnings are not given for trigraphs within comments, as
-we feel this is obnoxious.
-
-@item -Wwhite-space
-@findex -Wwhite-space
-Warn about possible white space confusion, e.g. white space between a
-backslash and a newline.
-
-@item -Wall
-@findex -Wall
-Requests @samp{-Wcomment}, @samp{-Wtrigraphs}, and @samp{-Wwhite-space}
-(but not @samp{-Wtraditional} or @samp{-Wundef}).
-
-@item -Wtraditional
-@findex -Wtraditional
-Warn about certain constructs that behave differently in traditional and
-ISO C@.
-
-@itemize @bullet
-@item
-Macro parameters that appear within string literals in the macro body.
-In traditional C macro replacement takes place within string literals,
-but does not in ISO C.
-
-@item
-In traditional C, some preprocessor directives did not exist.
-Traditional preprocessors would only consider a line to be a directive
-if the @samp{#} appeared in column 1 on the line. Therefore
-@samp{-Wtraditional} warns about directives that traditional C
-understands but would ignore because the @samp{#} does not appear as the
-first character on the line. It also suggests you hide directives like
-@samp{#pragma} not understood by traditional C by indenting them. Some
-traditional implementations would not recognise @samp{#elif}, so it
-suggests avoiding it altogether.
-
-@item
-A function-like macro that appears without arguments.
-
-@item
-The unary plus operator.
-
-@item
-The `U' integer constant suffix. (Traditonal C does support the `L'
-suffix on integer constants.) Note, these suffixes appear in macros
-defined in the system headers of most modern systems, e.g. the _MIN/_MAX
-macros in limits.h. Use of these macros can lead to spurious warnings
-as they do not necessarily reflect whether the code in question is any
-less portable to traditional C given that suitable backup definitions
-are provided.
-@end itemize
-
-@item -Wundef
-@findex -Wundef
-Warn if an undefined identifier is evaluated in an @samp{#if} directive.
-
-@item -I @var{directory}
-@findex -I
-Add the directory @var{directory} to the head of the list of
-directories to be searched for header files (@pxref{Include Syntax}).
-This can be used to override a system header file, substituting your
-own version, since these directories are searched before the system
-header file directories. If you use more than one @samp{-I} option,
-the directories are scanned in left-to-right order; the standard
-system directories come after.
-
-@item -I-
-Any directories specified with @samp{-I} options before the @samp{-I-}
-option are searched only for the case of @samp{#include "@var{file}"};
-they are not searched for @samp{#include <@var{file}>}.
-
-If additional directories are specified with @samp{-I} options after
-the @samp{-I-}, these directories are searched for all @samp{#include}
-directives.
-
-In addition, the @samp{-I-} option inhibits the use of the current
-directory as the first search directory for @samp{#include "@var{file}"}.
-Therefore, the current directory is searched only if it is requested
-explicitly with @samp{-I.}. Specifying both @samp{-I-} and @samp{-I.}
-allows you to control precisely which directories are searched before
-the current one and which are searched after.
-
-@item -nostdinc
-@findex -nostdinc
-Do not search the standard system directories for header files.
-Only the directories you have specified with @samp{-I} options
-(and the current directory, if appropriate) are searched.
-
-By using both @samp{-nostdinc} and @samp{-I-}, you can limit the include-file
-search path to only those directories you specify explicitly.
-
-@item -nostdinc++
-@findex -nostdinc++
-Do not search for header files in the C++-specific standard directories,
-but do still search the other standard directories. (This option is
-used when building the C++ library.)
-
-@item -remap
-@findex -remap
-When searching for a header file in a directory, remap file names if a
-file named @file{header.gcc} exists in that directory. This can be used
-to work around limitations of file systems with file name restrictions.
-The @file{header.gcc} file should contain a series of lines with two
-tokens on each line: the first token is the name to map, and the second
-token is the actual name to use.
-
-@item -D @var{name}
-@findex -D
-Predefine @var{name} as a macro, with definition @samp{1}.
-
-@item -D @var{name}=@var{definition}
-Predefine @var{name} as a macro, with definition @var{definition}.
-There are no restrictions on the contents of @var{definition}, but if
-you are invoking the preprocessor from a shell or shell-like program you
-may need to use the shell's quoting syntax to protect characters such as
-spaces that have a meaning in the shell syntax. If you use more than
-one @samp{-D} for the same @var{name}, the rightmost definition takes
-effect.
-
-Any @samp{-D} and @samp{-U} options on the command line are processed in
-order, and always before @samp{-imacros @var{file}}, regardless of the
-order in which they are written.
-
-@item -U @var{name}
-@findex -U
-Do not predefine @var{name}.
-
-Any @samp{-D} and @samp{-U} options on the command line are processed in
-order, and always before @samp{-imacros @var{file}}, regardless of the
-order in which they are written.
-
-@item -undef
-@findex -undef
-Do not predefine any nonstandard macros.
-
-@item -gcc
-@findex -gcc
-Define the macros @var{__GNUC__}, @var{__GNUC_MINOR__} and
-@var{__GNUC_PATCHLEVEL__}. These are defined automatically when you use
-@samp{gcc -E}; you can turn them off in that case with @samp{-no-gcc}.
-
-@item -A @var{predicate}=@var{answer}
-@findex -A
-Make an assertion with the predicate @var{predicate} and answer
-@var{answer}. This form is preferred to the older form @samp{-A
-@var{predicate}(@var{answer})}, which is still supported, because
-it does not use shell special characters. @xref{Assertions}.
-
-@item -A -@var{predicate}=@var{answer}
-Disable an assertion with the predicate @var{predicate} and answer
-@var{answer}. Specifying no predicate, by @samp{-A-} or @samp{-A -},
-disables all predefined assertions and all assertions preceding it on
-the command line; and also undefines all predefined macros and all
-macros preceding it on the command line.
-
-@item -dM
-@findex -dM
-Instead of outputting the result of preprocessing, output a list of
-@samp{#define} directives for all the macros defined during the
-execution of the preprocessor, including predefined macros. This gives
-you a way of finding out what is predefined in your version of the
-preprocessor; assuming you have no file @samp{foo.h}, the command
-
-@example
-touch foo.h; cpp -dM foo.h
-@end example
-
-@noindent
-will show the values of any predefined macros.
-
-@item -dD
-@findex -dD
-Like @samp{-dM} except in two respects: it does @emph{not} include the
-predefined macros, and it outputs @emph{both} the @samp{#define}
-directives and the result of preprocessing. Both kinds of output go to
-the standard output file.
-
-@item -dN
-@findex -dN
-Like @samp{-dD}, but emit only the macro names, not their expansions.
-
-@item -dI
-@findex -dI
-Output @samp{#include} directives in addition to the result of
-preprocessing.
-
-@item -M
-@findex -M
-Instead of outputting the result of preprocessing, output a rule
-suitable for @code{make} describing the dependencies of the main source
-file. The preprocessor outputs one @code{make} rule containing the
-object file name for that source file, a colon, and the names of all the
-included files, including those coming from @samp{-include} or
-@samp{-imacros} command line options. If there are many included files
-then the rule is split into several lines using @samp{\}-newline.
-
-@item -MM
-@findex -MM
-Like @samp{-M}, but mention only the files included with @samp{#include
-"@var{file}"} or with @samp{-include} or @samp{-imacros} command line
-options. System header files included with @samp{#include <@var{file}>}
-are omitted.
-
-@item -MF @var{file}
-@findex -MF
-When used with @samp{-M} or @samp{-MM}, specifies a file to write the
-dependencies to. This allows the preprocessor to write the preprocessed
-file to stdout normally. If no @samp{-MF} switch is given, CPP sends
-the rules to stdout and suppresses normal preprocessed output.
-
-@item -MG
-@findex -MG
-When used with @samp{-M} or @samp{-MM}, @samp{-MG} says to treat missing
-header files as generated files and assume they live in the same
-directory as the source file. It suppresses preprocessed output, as a
-missing header file is ordinarily an error.
-
-This feature is used in automatic updating of makefiles.
-
-@item -MP
-@findex -MP
-This option instructs CPP to add a phony target for each dependency
-other than the main file, causing each to depend on nothing. These
-dummy rules work around errors @code{make} gives if you remove header
-files without updating the @code{Makefile} to match.
-
-This is typical output:-
-
-@smallexample
-/tmp/test.o: /tmp/test.c /tmp/test.h
-
-/tmp/test.h:
-@end smallexample
-
-@item -MQ @var{target}
-@item -MT @var{target}
-@findex -MQ
-@findex -MT
-By default CPP uses the main file name, including any path, and appends
-the object suffix, normally ``.o'', to it to obtain the name of the
-target for dependency generation. With @samp{-MT} you can specify a
-target yourself, overriding the default one.
-
-If you want multiple targets, you can specify them as a single argument
-to @samp{-MT}, or use multiple @samp{-MT} options.
-
-The targets you specify are output in the order they appear on the
-command line. @samp{-MQ} is identical to @samp{-MT}, except that the
-target name is quoted for Make, but with @samp{-MT} it isn't. For
-example, -MT '$(objpfx)foo.o' gives
-
-@smallexample
-$(objpfx)foo.o: /tmp/foo.c
-@end smallexample
-
-but -MQ '$(objpfx)foo.o' gives
-
-@smallexample
-$$(objpfx)foo.o: /tmp/foo.c
-@end smallexample
-
-The default target is automatically quoted, as if it were given with
-@samp{-MQ}.
-
-@item -H
-@findex -H
-Print the name of each header file used, in addition to other normal
-activities.
-
-@item -imacros @var{file}
-@findex -imacros
-Process @var{file} as input, discarding the resulting output, before
-processing the regular input file. Because the output generated from
-@var{file} is discarded, the only effect of @samp{-imacros @var{file}}
-is to make the macros defined in @var{file} available for use in the
-main input.
-
-@item -include @var{file}
-@findex -include
-Process @var{file} as input, and include all the resulting output,
-before processing the regular input file.
-
-@item -idirafter @var{dir}
-@findex -idirafter
-@cindex second include path
-Add the directory @var{dir} to the second include path. The directories
-on the second include path are searched when a header file is not found
-in any of the directories in the main include path (the one that
-@samp{-I} adds to).
-
-@item -iprefix @var{prefix}
-@findex -iprefix
-Specify @var{prefix} as the prefix for subsequent @samp{-iwithprefix}
-options. If the prefix represents a directory, you should include the
-final @samp{/}.
-
-@item -iwithprefix @var{dir}
-@findex -iwithprefix
-Add a directory to the second include path. The directory's name is
-made by concatenating @var{prefix} and @var{dir}, where @var{prefix} was
-specified previously with @samp{-iprefix}.
-
-@item -isystem @var{dir}
-@findex -isystem
-Add a directory to the beginning of the second include path, marking it
-as a system directory, so that it gets the same special treatment as
-is applied to the standard system directories. @xref{System Headers}.
-
-@item -x c
-@itemx -x c++
-@itemx -x objective-c
-@itemx -x assembler-with-cpp
-@findex -x c
-@findex -x objective-c
-@findex -x assembler-with-cpp
-Specify the source language: C, C++, Objective-C, or assembly. This has
-nothing to do with standards conformance or extensions; it merely
-selects which base syntax to expect. If you give none of these options,
-cpp will deduce the language from the extension of the source file:
-@samp{.c}, @samp{.cc}, @samp{.m}, or @samp{.S}. Some other common
-extensions for C++ and assembly are also recognized. If cpp does not
-recognize the extension, it will treat the file as C; this is the most
-generic mode.
-
-@strong{Note:} Previous versions of cpp accepted a @samp{-lang} option
-which selected both the language and the standards conformance level.
-This option has been removed, because it conflicts with the @samp{-l}
-option.
-
-@item -std=@var{standard}
-@itemx -ansi
-@findex -std
-@findex -ansi
-Specify the standard to which the code should conform. Currently cpp
-only knows about the standards for C; other language standards will be
-added in the future.
-
-@var{standard}
-may be one of:
-@table @code
-@item iso9899:1990
-@itemx c89
-The ISO C standard from 1990. @samp{c89} is the customary shorthand for
-this version of the standard.
-
-The @samp{-ansi} option is equivalent to @samp{-std=c89}.
-
-@item iso9899:199409
-The 1990 C standard, as amended in 1994.
-
-@item iso9899:1999
-@itemx c99
-@itemx iso9899:199x
-@itemx c9x
-The revised ISO C standard, published in December 1999. Before
-publication, this was known as C9X.
-
-@item gnu89
-The 1990 C standard plus GNU extensions. This is the default.
-
-@item gnu99
-@itemx gnu9x
-The 1999 C standard plus GNU extensions.
-@end table
-
-@item -ftabstop=NUMBER
-@findex -ftabstop
-Set the distance between tab stops. This helps the preprocessor
-report correct column numbers in warnings or errors, even if tabs appear
-on the line. Values less than 1 or greater than 100 are ignored. The
-default is 8.
-
-@item -$
-@findex -$
-Forbid the use of @samp{$} in identifiers. The C standard allows
-implementations to define extra characters that can appear in
-identifiers. By default the GNU C preprocessor permits @samp{$}, a
-common extension.
-@end table
-@c man end
-
-@node Concept Index, Index, Invocation, Top
-@unnumbered Concept Index
-@printindex cp
-
-@node Index,, Concept Index, Top
-@unnumbered Index of Directives, Macros and Options
-@printindex fn
-
-@contents
-@bye
diff --git a/gcc/cppdefault.c b/gcc/cppdefault.c
index a51b05a7c57..81ee564ec7e 100644
--- a/gcc/cppdefault.c
+++ b/gcc/cppdefault.c
@@ -39,10 +39,17 @@ const struct default_include cpp_include_defaults[]
/* Pick up GNU C++ target-dependent include files. */
{ GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1 },
#endif
+#ifdef GPLUSPLUS_BACKWARD_INCLUDE_DIR
+ /* Pick up GNU C++ backward and deprecated include files. */
+ { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1 },
+#endif
#ifdef LOCAL_INCLUDE_DIR
/* /usr/local/include comes before the fixincluded header files. */
{ LOCAL_INCLUDE_DIR, 0, 0, 1 },
#endif
+#ifdef PREFIX_INCLUDE_DIR
+ { PREFIX_INCLUDE_DIR, 0, 0, 1 },
+#endif
#ifdef GCC_INCLUDE_DIR
/* This is the dir for fixincludes and for gcc's private headers. */
{ GCC_INCLUDE_DIR, "GCC", 0, 0 },
diff --git a/gcc/cpperror.c b/gcc/cpperror.c
index 50bd9076dbd..60af7b5dff8 100644
--- a/gcc/cpperror.c
+++ b/gcc/cpperror.c
@@ -124,8 +124,6 @@ print_location (pfile, filename, pos)
if (filename == 0)
filename = buffer->nominal_fname;
- if (*filename == '\0')
- filename = _("<stdin>");
if (line == 0)
fprintf (stderr, "%s: ", filename);
@@ -159,6 +157,7 @@ _cpp_begin_message (pfile, code, file, pos)
if (CPP_IN_SYSTEM_HEADER (pfile)
&& ! CPP_OPTION (pfile, warn_system_headers))
return 0;
+ case WARNING_SYSHDR:
if (CPP_OPTION (pfile, warnings_are_errors)
|| (code == PEDWARN && CPP_OPTION (pfile, pedantic_errors)))
{
diff --git a/gcc/cppexp.c b/gcc/cppexp.c
index 11cde7066e1..1231a7e2669 100644
--- a/gcc/cppexp.c
+++ b/gcc/cppexp.c
@@ -203,7 +203,9 @@ parse_number (pfile, tok)
goto invalid_suffix;
op.unsignedp = sufftab[i].u;
- if (CPP_WTRADITIONAL (pfile) && sufftab[i].u)
+ if (CPP_WTRADITIONAL (pfile)
+ && sufftab[i].u
+ && ! cpp_sys_macro_p (pfile))
cpp_warning (pfile, "traditional C rejects the `U' suffix");
if (sufftab[i].l == 2 && CPP_OPTION (pfile, pedantic)
&& ! CPP_OPTION (pfile, c99))
@@ -475,7 +477,8 @@ lex (pfile, skip_evaluation, token)
/* Fall through. */
default:
- if ((token->type > CPP_EQ && token->type < CPP_PLUS_EQ)
+ if (((int) token->type > (int) CPP_EQ
+ && (int) token->type < (int) CPP_PLUS_EQ)
|| token->type == CPP_EOF)
{
op.op = token->type;
diff --git a/gcc/cppfiles.c b/gcc/cppfiles.c
index 01b8d5fb6ae..8a7226506e5 100644
--- a/gcc/cppfiles.c
+++ b/gcc/cppfiles.c
@@ -43,10 +43,6 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
# define O_BINARY 0
#endif
-#ifndef INCLUDE_LEN_FUDGE
-# define INCLUDE_LEN_FUDGE 0
-#endif
-
/* If errno is inspected immediately after a system call fails, it will be
nonzero, and no error number will ever be zero. */
#ifndef ENOENT
@@ -55,9 +51,6 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#ifndef ENOTDIR
# define ENOTDIR 0
#endif
-#ifndef ENOMEM
-# define ENOMEM 0
-#endif
/* Suppress warning about function macros used w/o arguments in traditional
C. It is unlikely that glibc's strcmp macro helps this file at all. */
@@ -68,7 +61,7 @@ struct include_file
{
const char *name; /* actual path name of file */
const cpp_hashnode *cmacro; /* macro, if any, preventing reinclusion. */
- const struct file_name_list *foundhere;
+ const struct search_path *foundhere;
/* location in search path where file was
found, for #include_next and sysp. */
const unsigned char *buffer; /* pointer to cached file contents */
@@ -77,54 +70,51 @@ struct include_file
unsigned short include_count; /* number of times file has been read */
unsigned short refcnt; /* number of stacked buffers using this file */
unsigned char mapped; /* file buffer is mmapped */
- unsigned char defined; /* cmacro prevents inclusion in this state */
};
/* The cmacro works like this: If it's NULL, the file is to be
included again. If it's NEVER_REREAD, the file is never to be
included again. Otherwise it is a macro hashnode, and the file is
- to be included again if the macro is defined or not as specified by
- DEFINED. */
+ to be included again if the macro is defined. */
#define NEVER_REREAD ((const cpp_hashnode *)-1)
#define DO_NOT_REREAD(inc) \
((inc)->cmacro && ((inc)->cmacro == NEVER_REREAD \
- || ((inc)->cmacro->type == NT_MACRO) == (inc)->defined))
+ || (inc)->cmacro->type == NT_MACRO))
+#define NO_INCLUDE_PATH ((struct include_file *) -1)
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 file_name_list *));
-static struct file_name_list *actual_directory
- PARAMS ((cpp_reader *, const char *));
-static struct include_file *find_include_file
- PARAMS ((cpp_reader *, const char *,
- struct file_name_list *));
+ struct search_path *));
+static struct search_path *search_from PARAMS ((cpp_reader *,
+ enum include_type));
+static struct include_file *
+ find_include_file PARAMS ((cpp_reader *, const cpp_token *,
+ enum include_type));
static struct include_file *open_file PARAMS ((cpp_reader *, const char *));
-static void read_include_file PARAMS ((cpp_reader *, struct include_file *));
+static int read_include_file PARAMS ((cpp_reader *, struct include_file *));
static void stack_include_file PARAMS ((cpp_reader *, struct include_file *));
static void purge_cache PARAMS ((struct include_file *));
-static void destroy_include_file_node PARAMS ((splay_tree_value));
+static void destroy_node PARAMS ((splay_tree_value));
static int report_missing_guard PARAMS ((splay_tree_node, void *));
-
-/* We use a splay tree to store information about all the include
- files seen in this compilation. The key of each tree node is the
- physical path to the file. The value is 0 if the file does not
- exist, or a struct include_file pointer. */
-
-static void
-destroy_include_file_node (v)
- splay_tree_value v;
-{
- struct include_file *f = (struct include_file *)v;
-
- if (f)
- {
- purge_cache (f);
- free (f); /* The tree is registered with free to free f->name. */
- }
-}
-
+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 *));
+
+/* 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
+ file we tried to open but failed; this saves system calls since we
+ don't try to open it again in future.
+
+ The key of each node is the file name, after processing by
+ _cpp_simplify_pathname. The path name may or may not be absolute.
+ The path string has been malloced, as is automatically freed by
+ registering free () as the splay tree key deletion function.
+
+ A node's value is a pointer to a struct include_file, and is never
+ NULL. */
void
_cpp_init_includes (pfile)
cpp_reader *pfile;
@@ -132,9 +122,10 @@ _cpp_init_includes (pfile)
pfile->all_include_files
= splay_tree_new ((splay_tree_compare_fn) strcmp,
(splay_tree_delete_key_fn) free,
- destroy_include_file_node);
+ destroy_node);
}
+/* Tear down the splay tree. */
void
_cpp_cleanup_includes (pfile)
cpp_reader *pfile;
@@ -142,6 +133,20 @@ _cpp_cleanup_includes (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;
+{
+ struct include_file *f = (struct include_file *)v;
+
+ if (f)
+ {
+ purge_cache (f);
+ free (f);
+ }
+}
+
/* Mark a file to not be reread (e.g. #import, read failure). */
void
_cpp_never_reread (file)
@@ -150,31 +155,49 @@ _cpp_never_reread (file)
file->cmacro = NEVER_REREAD;
}
-/* Put a file name in the splay tree, for the sake of cpp_included ().
- Assume that FNAME has already had its path simplified. */
-void
-_cpp_fake_include (pfile, fname)
+/* Lookup a filename, which is simplified after making a copy, and
+ create an entry if none exists. errno is nonzero iff a (reported)
+ stat() error occurred during simplification. */
+static splay_tree_node
+find_or_create_entry (pfile, fname)
cpp_reader *pfile;
const char *fname;
{
- splay_tree_node nd;
+ splay_tree_node node;
+ struct include_file *file;
+ char *name = xstrdup (fname);
- nd = splay_tree_lookup (pfile->all_include_files, (splay_tree_key) fname);
- if (! nd)
+ _cpp_simplify_pathname (name);
+ node = splay_tree_lookup (pfile->all_include_files, (splay_tree_key) name);
+ if (node)
+ free (name);
+ else
{
- struct include_file *file = xcnew (struct include_file);
- file->name = xstrdup (fname);
- splay_tree_insert (pfile->all_include_files,
- (splay_tree_key) file->name,
- (splay_tree_value) file);
+ file = xcnew (struct include_file);
+ file->name = name;
+ node = splay_tree_insert (pfile->all_include_files,
+ (splay_tree_key) file->name,
+ (splay_tree_value) file);
}
+
+ return node;
+}
+
+/* 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;
+{
+ find_or_create_entry (pfile, fname);
}
/* Given a file name, look it up in the cache; if there is no entry,
create one with a non-NULL value (regardless of success in opening
the file). If the file doesn't exist or is inaccessible, this
entry is flagged so we don't attempt to open it again in the
- future. If the file isn't open, open it.
+ future. If the file isn't open, open it. The empty string is
+ interpreted as stdin.
Returns an include_file structure with an open file descriptor on
success, or NULL on failure. */
@@ -184,36 +207,23 @@ open_file (pfile, filename)
cpp_reader *pfile;
const char *filename;
{
- splay_tree_node nd;
- struct include_file *file;
-
- nd = splay_tree_lookup (pfile->all_include_files, (splay_tree_key) filename);
+ splay_tree_node nd = find_or_create_entry (pfile, filename);
+ struct include_file *file = (struct include_file *) nd->value;
- if (nd)
- {
- file = (struct include_file *) nd->value;
+ if (errno)
+ file->fd = -2;
- /* Don't retry opening if we failed previously. */
- if (file->fd == -2)
- return 0;
+ /* Don't retry opening if we failed previously. */
+ if (file->fd == -2)
+ return 0;
- /* Don't reopen an idempotent file. */
- if (DO_NOT_REREAD (file))
- return file;
+ /* Don't reopen an idempotent file. */
+ if (DO_NOT_REREAD (file))
+ return file;
- /* Don't reopen one which is already loaded. */
- if (file->buffer != NULL)
- return file;
- }
- else
- {
- /* In particular, this clears foundhere. */
- file = xcnew (struct include_file);
- file->name = xstrdup (filename);
- splay_tree_insert (pfile->all_include_files,
- (splay_tree_key) file->name,
- (splay_tree_value) file);
- }
+ /* Don't reopen one which is already loaded. */
+ if (file->buffer != NULL)
+ return file;
/* We used to open files in nonblocking mode, but that caused more
problems than it solved. Do take care not to acquire a
@@ -232,24 +242,32 @@ open_file (pfile, filename)
if (filename[0] == '\0')
file->fd = 0;
else
- file->fd = open (filename, O_RDONLY | O_NOCTTY | O_BINARY, 0666);
+ file->fd = open (file->name, O_RDONLY | O_NOCTTY | O_BINARY, 0666);
if (file->fd != -1 && fstat (file->fd, &file->st) == 0)
{
- /* Mark a regular, zero-length file never-reread now. */
- if (S_ISREG (file->st.st_mode) && file->st.st_size == 0)
- {
- _cpp_never_reread (file);
- close (file->fd);
- file->fd = -1;
- }
+ /* If it's a directory, we return null and continue the search
+ as the file we're looking for may appear elsewhere in the
+ search path. */
+ if (S_ISDIR (file->st.st_mode))
+ errno = ENOENT;
+ else
+ {
+ /* Mark a regular, zero-length file never-reread now. */
+ if (S_ISREG (file->st.st_mode) && file->st.st_size == 0)
+ {
+ _cpp_never_reread (file);
+ close (file->fd);
+ file->fd = -1;
+ }
- return file;
+ return file;
+ }
}
/* Don't issue an error message if the file doesn't exist. */
if (errno != ENOENT && errno != ENOTDIR)
- cpp_error_from_errno (pfile, filename);
+ cpp_error_from_errno (pfile, file->name);
/* Create a negative node for this path, and return null. */
file->fd = -2;
@@ -259,7 +277,7 @@ open_file (pfile, filename)
/* Place the file referenced by INC into a new buffer on PFILE's
stack. If there are errors, or the file should not be re-included,
- a null buffer is pushed. */
+ a null (zero-length) buffer is pushed. */
static void
stack_include_file (pfile, inc)
@@ -268,25 +286,50 @@ stack_include_file (pfile, inc)
{
size_t len = 0;
cpp_buffer *fp;
+ int sysp, deps_sysp;
+
+ /* We'll try removing deps_sysp after the release of 3.0. */
+ deps_sysp = pfile->system_include_depth != 0;
+ sysp = MAX ((pfile->buffer ? pfile->buffer->sysp : 0),
+ (inc->foundhere ? inc->foundhere->sysp : 0));
+
+ /* For -M, add the file to the dependencies on its first inclusion. */
+ if (CPP_OPTION (pfile, print_deps) > deps_sysp && !inc->include_count)
+ deps_add_dep (pfile->deps, inc->name);
/* Not in cache? */
- if (! inc->buffer)
- read_include_file (pfile, inc);
+ if (! DO_NOT_REREAD (inc) && ! inc->buffer)
+ {
+ /* If an error occurs, do not try to read this file again. */
+ if (read_include_file (pfile, inc))
+ _cpp_never_reread (inc);
+ close (inc->fd);
+ inc->fd = -1;
+ }
if (! DO_NOT_REREAD (inc))
- len = inc->st.st_size;
+ {
+ len = inc->st.st_size;
+ if (pfile->buffer)
+ {
+ /* We don't want MI guard advice for the main file. */
+ inc->include_count++;
+
+ /* Handle -H option. */
+ if (CPP_OPTION (pfile, print_include_names))
+ {
+ for (fp = pfile->buffer; fp; fp = fp->prev)
+ putc ('.', stderr);
+ fprintf (stderr, " %s\n", inc->name);
+ }
+ }
+ }
/* Push a buffer. */
fp = cpp_push_buffer (pfile, inc->buffer, len, BUF_FILE, inc->name);
fp->inc = inc;
fp->inc->refcnt++;
- if (inc->foundhere)
- fp->sysp = inc->foundhere->sysp;
-
- /* The ->actual_dir field is only used when ignore_srcdir is not in effect;
- see do_include */
- if (!CPP_OPTION (pfile, ignore_srcdir))
- fp->actual_dir = actual_directory (pfile, inc->name);
+ fp->sysp = sysp;
/* Initialise controlling macro state. */
pfile->mi_state = MI_OUTSIDE;
@@ -304,17 +347,17 @@ stack_include_file (pfile, inc)
If fd points to a plain file, we might be able to mmap it; we can
definitely allocate the buffer all at once. If fd is a pipe or
terminal, we can't do either. If fd is something weird, like a
- block device or a directory, we don't want to read it at all.
+ block device, we don't want to read it at all.
Unfortunately, different systems use different st.st_mode values
for pipes: some have S_ISFIFO, some S_ISSOCK, some are buggy and
zero the entire struct stat except a couple fields. Hence we don't
- even try to figure out what something is, except for plain files,
- directories, and block devices.
+ even try to figure out what something is, except for plain files
+ and block devices.
FIXME: Flush file cache and try again if we run out of memory. */
-static void
+static int
read_include_file (pfile, inc)
cpp_reader *pfile;
struct include_file *inc;
@@ -325,9 +368,6 @@ read_include_file (pfile, inc)
static int pagesize = -1;
#endif
- if (DO_NOT_REREAD (inc))
- return;
-
if (S_ISREG (inc->st.st_mode))
{
/* off_t might have a wider range than ssize_t - in other words,
@@ -381,11 +421,6 @@ read_include_file (pfile, inc)
cpp_error (pfile, "%s is a block device", inc->name);
goto fail;
}
- else if (S_ISDIR (inc->st.st_mode))
- {
- cpp_error (pfile, "%s is a directory", inc->name);
- goto fail;
- }
else
{
/* 8 kilobytes is a sensible starting size. It ought to be
@@ -409,19 +444,13 @@ read_include_file (pfile, inc)
inc->st.st_size = offset;
}
- close (inc->fd);
inc->buffer = buf;
- inc->fd = -1;
- return;
+ return 0;
perror_fail:
cpp_error_from_errno (pfile, inc->name);
fail:
- /* Do not try to read this file again. */
- close (inc->fd);
- inc->fd = -1;
- _cpp_never_reread (inc);
- return;
+ return 1;
}
static void
@@ -447,8 +476,8 @@ cpp_included (pfile, fname)
cpp_reader *pfile;
const char *fname;
{
- struct file_name_list *path;
- char *name;
+ struct search_path *path;
+ char *name, *n;
splay_tree_node nd;
if (IS_ABSOLUTE_PATHNAME (fname))
@@ -459,60 +488,80 @@ cpp_included (pfile, fname)
}
/* Search directory path for the file. */
- name = (char *) alloca (strlen (fname) + pfile->max_include_len
- + 2 + INCLUDE_LEN_FUDGE);
+ name = (char *) alloca (strlen (fname) + pfile->max_include_len + 2);
for (path = CPP_OPTION (pfile, quote_include); path; path = path->next)
{
- memcpy (name, path->name, path->nlen);
- name[path->nlen] = '/';
- strcpy (&name[path->nlen+1], fname);
- _cpp_simplify_pathname (name);
+ memcpy (name, path->name, path->len);
+ name[path->len] = '/';
+ strcpy (&name[path->len + 1], fname);
if (CPP_OPTION (pfile, remap))
- name = remap_filename (pfile, name, path);
+ n = remap_filename (pfile, name, path);
+ else
+ n = name;
- nd = splay_tree_lookup (pfile->all_include_files, (splay_tree_key) name);
+ nd = splay_tree_lookup (pfile->all_include_files, (splay_tree_key) n);
if (nd && nd->value)
return 1;
}
return 0;
}
-/* Search for include file FNAME in the include chain starting at
- SEARCH_START. Return 0 if there is no such file (or it's un-openable),
- otherwise an include_file structure. */
+/* Search for HEADER. Return 0 if there is no such file (or it's
+ un-openable), in which case an error code will be in errno. If
+ there is no include path to use it returns NO_INCLUDE_PATH,
+ otherwise an include_file structure. If this request originates
+ from a #include_next directive, set INCLUDE_NEXT to true. */
static struct include_file *
-find_include_file (pfile, fname, search_start)
+find_include_file (pfile, header, type)
cpp_reader *pfile;
- const char *fname;
- struct file_name_list *search_start;
+ const cpp_token *header;
+ enum include_type type;
{
- struct file_name_list *path;
- char *name;
+ const char *fname = (const char *) header->val.str.text;
+ struct search_path *path;
struct include_file *file;
+ char *name, *n;
if (IS_ABSOLUTE_PATHNAME (fname))
return open_file (pfile, fname);
-
+
+ /* For #include_next, skip in the search path past the dir in which
+ the current file was found, but if it was found via an absolute
+ path use the normal search logic. */
+ if (type == IT_INCLUDE_NEXT && pfile->buffer->inc->foundhere)
+ path = pfile->buffer->inc->foundhere->next;
+ else if (header->type == CPP_HEADER_NAME)
+ path = CPP_OPTION (pfile, bracket_include);
+ else
+ path = search_from (pfile, type);
+
+ if (path == NULL)
+ {
+ cpp_error (pfile, "No include path in which to find %s", fname);
+ return NO_INCLUDE_PATH;
+ }
+
/* Search directory path for the file. */
- name = (char *) alloca (strlen (fname) + pfile->max_include_len
- + 2 + INCLUDE_LEN_FUDGE);
- for (path = search_start; path; path = path->next)
+ name = (char *) alloca (strlen (fname) + pfile->max_include_len + 2);
+ for (; path; path = path->next)
{
- memcpy (name, path->name, path->nlen);
- name[path->nlen] = '/';
- strcpy (&name[path->nlen+1], fname);
- _cpp_simplify_pathname (name);
+ memcpy (name, path->name, path->len);
+ name[path->len] = '/';
+ strcpy (&name[path->len + 1], fname);
if (CPP_OPTION (pfile, remap))
- name = remap_filename (pfile, name, path);
+ n = remap_filename (pfile, name, path);
+ else
+ n = name;
- file = open_file (pfile, name);
+ file = open_file (pfile, n);
if (file)
{
file->foundhere = path;
return file;
}
}
+
return 0;
}
@@ -530,6 +579,8 @@ cpp_make_system_header (pfile, syshdr, externc)
if (syshdr)
flags = 1 + (externc != 0);
pfile->buffer->sysp = flags;
+ _cpp_do_file_change (pfile, FC_RENAME, pfile->buffer->nominal_fname,
+ pfile->buffer->lineno);
}
/* Report on all files that might benefit from a multiple include guard.
@@ -564,200 +615,113 @@ report_missing_guard (n, b)
return 0;
}
-#define PRINT_THIS_DEP(p, b) (CPP_PRINT_DEPS(p) > (b||p->system_include_depth))
-void
-_cpp_execute_include (pfile, header, no_reinclude, include_next)
+/* Create a dependency, or issue an error message as appropriate. */
+static void
+handle_missing_header (pfile, fname, angle_brackets)
cpp_reader *pfile;
- const cpp_token *header;
- int no_reinclude;
- int include_next;
+ const char *fname;
+ int angle_brackets;
{
- struct file_name_list *search_start = 0;
- unsigned int len = header->val.str.len;
- unsigned int angle_brackets = header->type == CPP_HEADER_NAME;
- struct include_file *inc;
- char *fname;
-
- /* Help protect #include or similar from recursion. */
- if (pfile->buffer_stack_depth >= CPP_STACK_MAX)
- {
- cpp_fatal (pfile, "#include nested too deeply");
- return;
- }
-
- /* Check we've tidied up #include before entering the buffer. */
- if (pfile->context->prev)
- {
- cpp_ice (pfile, "attempt to push file buffer with contexts stacked");
- return;
- }
-
- /* For #include_next, skip in the search path past the dir in which
- the current file was found. If this is the last directory in the
- search path, don't include anything. If the current file was
- specified with an absolute path, use the normal search logic. If
- this is the primary source file, use the normal search logic and
- generate a warning. */
- if (include_next)
- {
- if (! pfile->buffer->prev)
- cpp_warning (pfile, "#include_next in primary source file");
- else
- {
- if (pfile->buffer->inc->foundhere)
- {
- search_start = pfile->buffer->inc->foundhere->next;
- if (! search_start)
- return;
- }
- }
- }
-
- fname = alloca (len + 1);
- memcpy (fname, header->val.str.text, len);
- fname[len] = '\0';
-
- if (!search_start)
- {
- if (angle_brackets)
- search_start = CPP_OPTION (pfile, bracket_include);
- else if (CPP_OPTION (pfile, ignore_srcdir))
- search_start = CPP_OPTION (pfile, quote_include);
- else
- search_start = CPP_BUFFER (pfile)->actual_dir;
+ /* We will try making the RHS pfile->buffer->sysp after 3.0. */
+ int print_dep = CPP_PRINT_DEPS(pfile) > (angle_brackets
+ || pfile->system_include_depth);
- if (!search_start)
- {
- cpp_error (pfile, "No include path in which to find %s", fname);
- return;
- }
- }
-
- inc = find_include_file (pfile, fname, search_start);
-
- if (inc)
- {
- /* For -M, add the file to the dependencies on its first inclusion. */
- if (!inc->include_count && PRINT_THIS_DEP (pfile, angle_brackets))
- deps_add_dep (pfile->deps, inc->name);
- inc->include_count++;
-
- /* Actually process the file. */
- stack_include_file (pfile, inc);
-
- if (angle_brackets)
- pfile->system_include_depth++;
-
- if (! DO_NOT_REREAD (inc))
- {
- if (no_reinclude)
- _cpp_never_reread (inc);
-
- /* Handle -H option. */
- if (CPP_OPTION (pfile, print_include_names))
- {
- cpp_buffer *fp = CPP_BUFFER (pfile);
- while ((fp = CPP_PREV_BUFFER (fp)) != NULL)
- putc ('.', stderr);
- fprintf (stderr, " %s\n", inc->name);
- }
- }
-
- return;
- }
-
- if (CPP_OPTION (pfile, print_deps_missing_files)
- && PRINT_THIS_DEP (pfile, angle_brackets))
+ if (CPP_OPTION (pfile, print_deps_missing_files) && print_dep)
{
if (!angle_brackets || IS_ABSOLUTE_PATHNAME (fname))
deps_add_dep (pfile->deps, fname);
else
{
+ /* If requested as a system header, assume it belongs in
+ the first system header directory. */
+ struct search_path *ptr = CPP_OPTION (pfile, bracket_include);
char *p;
- struct file_name_list *ptr;
- int len;
+ int len = 0, fname_len = strlen (fname);
- /* If requested as a system header, assume it belongs in
- the first system header directory. */
- if (CPP_OPTION (pfile, bracket_include))
- ptr = CPP_OPTION (pfile, bracket_include);
- else
- ptr = CPP_OPTION (pfile, quote_include);
+ if (ptr)
+ len = ptr->len;
- len = strlen (ptr->name);
- p = (char *) alloca (len + strlen (fname) + 2);
+ p = (char *) alloca (len + fname_len + 2);
if (len)
{
memcpy (p, ptr->name, len);
p[len++] = '/';
}
- strcpy (p + len, fname);
- _cpp_simplify_pathname (p);
+ memcpy (p + len, fname, fname_len + 1);
deps_add_dep (pfile->deps, p);
}
}
- /* If -M was specified, and this header file won't be added to
- the dependency list, then don't count this as an error,
- because we can still produce correct output. Otherwise, we
- can't produce correct output, because there may be
- dependencies we need inside the missing file, and we don't
- know what directory this missing file exists in. */
- else if (CPP_PRINT_DEPS (pfile)
- && ! PRINT_THIS_DEP (pfile, angle_brackets))
- cpp_warning (pfile, "No include path in which to find %s", fname);
+ /* If -M was specified, then don't count this as an error, because
+ we can still produce correct output. Otherwise, we can't produce
+ correct output, because there may be dependencies we need inside
+ the missing file, and we don't know what directory this missing
+ file exists in. FIXME: Use a future cpp_diagnotic_with_errno ()
+ for both of these cases. */
+ else if (CPP_PRINT_DEPS (pfile) && ! print_dep)
+ cpp_warning (pfile, "%s: %s", fname, xstrerror (errno));
else
cpp_error_from_errno (pfile, fname);
}
-/* Locate file F, and determine whether it is newer than PFILE. Return -1,
- if F cannot be located or dated, 1, if it is newer and 0 if older. */
+/* Returns non-zero if a buffer was stacked. */
int
-_cpp_compare_file_date (pfile, f)
+_cpp_execute_include (pfile, header, type)
cpp_reader *pfile;
- const cpp_token *f;
+ const cpp_token *header;
+ enum include_type type;
{
- unsigned int len = f->val.str.len;
- char *fname;
- struct file_name_list *search_start;
- struct include_file *inc;
-
- if (f->type == CPP_HEADER_NAME)
- search_start = CPP_OPTION (pfile, bracket_include);
- else if (CPP_OPTION (pfile, ignore_srcdir))
- search_start = CPP_OPTION (pfile, quote_include);
- else
- search_start = CPP_BUFFER (pfile)->actual_dir;
+ struct include_file *inc = find_include_file (pfile, header, type);
+
+ if (inc == 0)
+ handle_missing_header (pfile, (const char *) header->val.str.text,
+ header->type == CPP_HEADER_NAME);
+ else if (inc != NO_INCLUDE_PATH)
+ {
+ if (header->type == CPP_HEADER_NAME)
+ pfile->system_include_depth++;
- fname = alloca (len + 1);
- memcpy (fname, f->val.str.text, len);
- fname[len] = '\0';
- inc = find_include_file (pfile, fname, search_start);
+ stack_include_file (pfile, inc);
+
+ if (type == IT_IMPORT)
+ _cpp_never_reread (inc);
+
+ return 1;
+ }
+
+ return 0;
+}
+
+/* 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
+ newer, return 1, otherwise 0. */
+int
+_cpp_compare_file_date (pfile, header)
+ cpp_reader *pfile;
+ const cpp_token *header;
+{
+ struct include_file *inc = find_include_file (pfile, header, 0);
- if (!inc)
+ if (inc == NULL || inc == NO_INCLUDE_PATH)
return -1;
+
if (inc->fd > 0)
{
close (inc->fd);
inc->fd = -1;
}
- return inc->st.st_mtime > CPP_BUFFER (pfile)->inc->st.st_mtime;
+ return inc->st.st_mtime > pfile->buffer->inc->st.st_mtime;
}
/* Push an input buffer and load it up with the contents of FNAME.
- If FNAME is "" or NULL, read standard input. */
+ If FNAME is "", read standard input. */
int
_cpp_read_file (pfile, fname)
cpp_reader *pfile;
const char *fname;
{
- struct include_file *f;
-
- if (fname == NULL)
- fname = "";
-
- f = open_file (pfile, fname);
+ struct include_file *f = open_file (pfile, fname);
if (f == NULL)
{
@@ -765,9 +729,6 @@ _cpp_read_file (pfile, fname)
return 0;
}
- if (CPP_OPTION (pfile, print_deps))
- deps_add_dep (pfile->deps, f->name);
-
stack_include_file (pfile, f);
return 1;
}
@@ -786,13 +747,10 @@ _cpp_pop_file_buffer (pfile, buf)
if (pfile->include_depth)
pfile->include_depth--;
- /* Record the inclusion-preventing macro and its definedness. */
- if (pfile->mi_state == MI_OUTSIDE && inc->cmacro != NEVER_REREAD)
- {
- /* This could be NULL meaning no controlling macro. */
- inc->cmacro = pfile->mi_cmacro;
- inc->defined = 1;
- }
+ /* Record the inclusion-preventing macro, which could be NULL
+ meaning no controlling macro, if we haven't got it already. */
+ if (pfile->mi_state == MI_OUTSIDE && inc->cmacro == NULL)
+ inc->cmacro = pfile->mi_cmacro;
/* Invalidate control macros in the #including file. */
pfile->mi_state = MI_FAILED;
@@ -802,6 +760,61 @@ _cpp_pop_file_buffer (pfile, buf)
purge_cache (inc);
}
+/* Returns the first place in the include chain to start searching for
+ "" includes. This involves stripping away the basename of the
+ current file, unless -I- was specified.
+
+ If we're handling -include or -imacros, use the "" chain, but with
+ the preprocessor's cwd prepended. */
+static struct search_path *
+search_from (pfile, type)
+ cpp_reader *pfile;
+ enum include_type type;
+{
+ cpp_buffer *buffer = pfile->buffer;
+ unsigned int dlen;
+
+ /* Command line uses the cwd, and does not cache the result. */
+ if (type == IT_CMDLINE)
+ goto use_cwd;
+
+ /* Ignore the current file's directory if -I- was given. */
+ if (CPP_OPTION (pfile, ignore_srcdir))
+ return CPP_OPTION (pfile, quote_include);
+
+ if (! buffer->search_cached)
+ {
+ buffer->search_cached = 1;
+
+ dlen = lbasename (buffer->inc->name) - buffer->inc->name;
+
+ if (dlen)
+ {
+ /* We don't guarantee NAME is null-terminated. This saves
+ allocating and freeing memory, and duplicating it when faking
+ buffers in cpp_push_buffer. Drop a trailing '/'. */
+ buffer->dir.name = buffer->inc->name;
+ if (dlen > 1)
+ dlen--;
+ }
+ else
+ {
+ use_cwd:
+ buffer->dir.name = ".";
+ dlen = 1;
+ }
+
+ if (dlen > pfile->max_include_len)
+ pfile->max_include_len = dlen;
+
+ buffer->dir.len = dlen;
+ buffer->dir.next = CPP_OPTION (pfile, quote_include);
+ buffer->dir.sysp = buffer->sysp;
+ }
+
+ return &buffer->dir;
+}
+
/* The file_name_map structure holds a mapping of file names for a
particular directory. This mapping is read from the file named
FILE_NAME_MAP_FILE in that directory. Such a file can be used to
@@ -942,13 +955,13 @@ read_name_map (pfile, dirname)
return map_list_ptr->map_list_map;
}
-/* Remap NAME based on the file_name_map (if any) for LOC. */
-
+/* 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 file_name_list *loc;
+ struct search_path *loc;
{
struct file_name_map *map;
const char *from, *p;
@@ -956,12 +969,18 @@ remap_filename (pfile, name, loc)
if (! loc->name_map)
{
- loc->name_map = read_name_map (pfile, loc->name ? loc->name : ".");
+ /* Get a null-terminated path. */
+ char *dname = alloca (loc->len + 1);
+ memcpy (dname, loc->name, loc->len);
+ dname[loc->len] = '\0';
+
+ loc->name_map = read_name_map (pfile, dname);
if (! loc->name_map)
return name;
}
- from = name + strlen (loc->name) + 1;
+ /* This works since NAME has not been simplified yet. */
+ from = name + loc->len + 1;
for (map = loc->name_map; map; map = map->map_next)
if (!strcmp (map->map_from, from))
@@ -991,63 +1010,30 @@ remap_filename (pfile, name, loc)
return name;
}
-/* Given a path FNAME, extract the directory component and place it
- onto the actual_dirs list. Return a pointer to the allocated
- file_name_list structure. These structures are used to implement
- current-directory "" include searching. */
-
-static struct file_name_list *
-actual_directory (pfile, fname)
- cpp_reader *pfile;
- const char *fname;
+/* Returns true if it is safe to remove the final component of path,
+ when it is followed by a ".." component. We use lstat to avoid
+ symlinks if we have it. If not, we can still catch errors with
+ stat (). */
+static int
+remove_component_p (path)
+ const char *path;
{
- char *last_slash, *dir;
- size_t dlen;
- struct file_name_list *x;
-
- dir = xstrdup (fname);
- last_slash = strrchr (dir, '/');
- if (last_slash)
- {
- if (last_slash == dir)
- {
- dlen = 1;
- last_slash[1] = '\0';
- }
- else
- {
- dlen = last_slash - dir;
- *last_slash = '\0';
- }
- }
- else
- {
- free (dir);
- dir = xstrdup (".");
- dlen = 1;
- }
+ struct stat s;
+ int result;
- if (dlen > pfile->max_include_len)
- pfile->max_include_len = dlen;
-
- for (x = pfile->actual_dirs; x; x = x->alloc)
- if (!strcmp (x->name, dir))
- {
- free (dir);
- return x;
- }
-
- /* Not found, make a new one. */
- x = (struct file_name_list *) xmalloc (sizeof (struct file_name_list));
- x->name = dir;
- x->nlen = dlen;
- x->next = CPP_OPTION (pfile, quote_include);
- x->alloc = pfile->actual_dirs;
- x->sysp = pfile->buffer->sysp;
- x->name_map = NULL;
-
- pfile->actual_dirs = x;
- return x;
+#ifdef HAVE_LSTAT
+ result = lstat (path, &s);
+#else
+ result = stat (path, &s);
+#endif
+
+ /* There's no guarantee that errno will be unchanged, even on
+ success. Cygwin's lstat(), for example, will often set errno to
+ ENOSYS. In case of success, reset errno to zero. */
+ if (result == 0)
+ errno = 0;
+
+ return result == 0 && S_ISDIR (s.st_mode);
}
/* Simplify a path name in place, deleting redundant components. This
@@ -1061,124 +1047,122 @@ actual_directory (pfile, fname)
/../quux /quux
//quux //quux (POSIX allows leading // as a namespace escape)
- Guarantees no trailing slashes. All transforms reduce the length
- of the string.
- */
-void
+ Guarantees no trailing slashes. All transforms reduce the length
+ of the string. Returns PATH. errno is 0 if no error occurred;
+ nonzero if an error occurred when using stat () or lstat (). */
+
+char *
_cpp_simplify_pathname (path)
char *path;
{
- char *from, *to;
- char *base;
- int absolute = 0;
+#ifndef VMS
+ char *from, *to;
+ char *base, *orig_base;
+ int absolute = 0;
+
+ errno = 0;
+ /* Don't overflow the empty path by putting a '.' in it below. */
+ if (*path == '\0')
+ return path;
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
- /* Convert all backslashes to slashes. */
- for (from = path; *from; from++)
- if (*from == '\\') *from = '/';
+ /* Convert all backslashes to slashes. */
+ for (from = path; *from; from++)
+ if (*from == '\\') *from = '/';
- /* Skip over leading drive letter if present. */
- if (ISALPHA (path[0]) && path[1] == ':')
- from = to = &path[2];
- else
- from = to = path;
-#else
+ /* Skip over leading drive letter if present. */
+ if (ISALPHA (path[0]) && path[1] == ':')
+ from = to = &path[2];
+ else
from = to = path;
+#else
+ from = to = path;
#endif
- /* Remove redundant initial /s. */
- if (*from == '/')
+ /* Remove redundant leading /s. */
+ if (*from == '/')
{
- absolute = 1;
- to++;
- from++;
- if (*from == '/')
+ absolute = 1;
+ to++;
+ from++;
+ if (*from == '/')
{
- if (*++from == '/')
- /* 3 or more initial /s are equivalent to 1 /. */
- while (*++from == '/');
- else
- /* On some hosts // differs from /; Posix allows this. */
- to++;
+ if (*++from == '/')
+ /* 3 or more initial /s are equivalent to 1 /. */
+ while (*++from == '/');
+ else
+ /* On some hosts // differs from /; Posix allows this. */
+ to++;
}
}
- base = to;
-
- for (;;)
+
+ base = orig_base = to;
+ for (;;)
{
- while (*from == '/')
- from++;
-
- if (from[0] == '.' && from[1] == '/')
- from += 2;
- else if (from[0] == '.' && from[1] == '\0')
- goto done;
- else if (from[0] == '.' && from[1] == '.' && from[2] == '/')
+ int move_base = 0;
+
+ while (*from == '/')
+ from++;
+
+ if (*from == '\0')
+ break;
+
+ if (*from == '.')
{
- if (base == to)
- {
- if (absolute)
- from += 3;
- else
- {
- *to++ = *from++;
- *to++ = *from++;
- *to++ = *from++;
- base = to;
- }
- }
- else
+ if (from[1] == '\0')
+ break;
+ if (from[1] == '/')
{
- to -= 2;
- while (to > base && *to != '/') to--;
- if (*to == '/')
- to++;
- from += 3;
+ from += 2;
+ continue;
}
- }
- else if (from[0] == '.' && from[1] == '.' && from[2] == '\0')
- {
- if (base == to)
+ else if (from[1] == '.' && (from[2] == '/' || from[2] == '\0'))
{
- if (!absolute)
+ /* Don't simplify if there was no previous component. */
+ if (absolute && orig_base == to)
{
- *to++ = *from++;
- *to++ = *from++;
+ from += 2;
+ continue;
}
- }
- else
- {
- to -= 2;
- while (to > base && *to != '/') to--;
- if (*to == '/')
- to++;
- }
- goto done;
- }
- else
- /* Copy this component and trailing /, if any. */
- while ((*to++ = *from++) != '/')
- {
- if (!to[-1])
+ /* Don't simplify if the previous component was "../",
+ or if an error has already occurred with (l)stat. */
+ if (base != to && errno == 0)
{
- to--;
- goto done;
+ /* We don't back up if it's a symlink. */
+ *to = '\0';
+ if (remove_component_p (path))
+ {
+ while (to > base && *to != '/')
+ to--;
+ from += 2;
+ continue;
+ }
}
+ move_base = 1;
}
-
+ }
+
+ /* Add the component separator. */
+ if (to > orig_base)
+ *to++ = '/';
+
+ /* Copy this component until the trailing null or '/'. */
+ while (*from != '\0' && *from != '/')
+ *to++ = *from++;
+
+ if (move_base)
+ base = to;
}
- done:
- /* Trim trailing slash */
- if (to[0] == '/' && (!absolute || to > path+1))
- to--;
-
- /* Change the empty string to "." so that stat() on the result
- will always work. */
- if (to == path)
- *to++ = '.';
-
- *to = '\0';
-
- return;
+ /* Change the empty string to "." so that it is not treated as stdin.
+ Null terminate. */
+ if (to == path)
+ *to++ = '.';
+ *to = '\0';
+
+ return path;
+#else /* VMS */
+ errno = 0;
+ return path;
+#endif /* !VMS */
}
diff --git a/gcc/cpphash.h b/gcc/cpphash.h
index ddeacac5f7f..cf027f095c6 100644
--- a/gcc/cpphash.h
+++ b/gcc/cpphash.h
@@ -72,23 +72,23 @@ struct cpp_pool
unsigned int locks;
};
-/* List of directories to look for include files in. */
-struct file_name_list
+/* List of directories to look for include files in. */
+struct search_path
{
- struct file_name_list *next;
- struct file_name_list *alloc; /* for the cache of
- current directory entries */
- char *name;
- unsigned int nlen;
+ struct search_path *next;
+
+ /* NOTE: NAME may not be null terminated for the case of the current
+ file's directory! */
+ const char *name;
+ unsigned int len;
/* We use these to tell if the directory mentioned here is a duplicate
- of an earlier directory on the search path. */
+ of an earlier directory on the search path. */
ino_t ino;
dev_t dev;
- /* If the following is nonzero, it is a C-language system include
- directory. */
+ /* Non-zero if it is a system include directory. */
int sysp;
- /* Mapping of file names for this directory.
- Only used on MS-DOS and related platforms. */
+ /* Mapping of file names for this directory. Only used on MS-DOS
+ and related platforms. */
struct file_name_map *name_map;
};
@@ -96,6 +96,9 @@ struct file_name_list
enum mi_state {MI_FAILED = 0, MI_OUTSIDE};
enum mi_ind {MI_IND_NONE = 0, MI_IND_NOT};
+/* #include types. */
+enum include_type {IT_INCLUDE, IT_INCLUDE_NEXT, IT_IMPORT, IT_CMDLINE};
+
typedef struct toklist toklist;
struct toklist
{
@@ -180,9 +183,6 @@ struct cpp_buffer
/* Filename specified with #line command. */
const char *nominal_fname;
- /* Actual directory of this file, used only for "" includes */
- struct file_name_list *actual_dir;
-
/* Pointer into the include table. Used for include_next and
to record control macros. */
struct include_file *inc;
@@ -225,8 +225,16 @@ struct cpp_buffer
containing files that matches the current status. */
unsigned char include_stack_listed;
+ /* Nonzero means that the directory to start searching for ""
+ include files has been calculated and stored in "dir" below. */
+ unsigned char search_cached;
+
/* Buffer type. */
ENUM_BITFIELD (cpp_buffer_type) type : 8;
+
+ /* The directory of the this buffer's file. Its NAME member is not
+ allocated, so we don't need to worry about freeing it. */
+ struct search_path dir;
};
/* A cpp_reader encapsulates the "state" of a pre-processor run.
@@ -297,10 +305,6 @@ struct cpp_reader
/* Tree of other included files. See cppfiles.c. */
struct splay_tree_s *all_include_files;
- /* Chain of `actual directory' file_name_list entries, for ""
- inclusion. */
- struct file_name_list *actual_dirs;
-
/* Current maximum length of directory names in the search path
for include files. (Altered as we get more of them.) */
unsigned int max_include_len;
@@ -337,12 +341,12 @@ struct cpp_reader
/* We're printed a warning recommending against using #import. */
unsigned char import_warning;
- /* True after cpp_start_read completes. Used to inhibit some
- warnings while parsing the command line. */
- unsigned char done_initializing;
-
/* True if we are skipping a failed conditional group. */
unsigned char skipping;
+
+ /* Whether to print our version number. Done this way so
+ we don't get it twice for -v -version. */
+ unsigned char print_version;
};
/* Character classes. Based on the more primitive macros in safe-ctype.h.
@@ -374,7 +378,6 @@ extern unsigned char _cpp_trigraph_map[UCHAR_MAX + 1];
/* Macros. */
-#define CPP_PREV_BUFFER(BUFFER) ((BUFFER)->prev)
#define CPP_PRINT_DEPS(PFILE) CPP_OPTION (PFILE, print_deps)
#define CPP_IN_SYSTEM_HEADER(PFILE) \
(CPP_BUFFER (PFILE) && CPP_BUFFER (PFILE)->sysp)
@@ -386,7 +389,7 @@ extern unsigned char _cpp_trigraph_map[UCHAR_MAX + 1];
#define HASHSTEP(r, c) ((r) * 67 + (c - 113));
/* In cpperror.c */
-enum error_type { WARNING = 0, PEDWARN, ERROR, FATAL, ICE };
+enum error_type { WARNING = 0, WARNING_SYSHDR, PEDWARN, ERROR, FATAL, ICE };
extern int _cpp_begin_message PARAMS ((cpp_reader *, enum error_type,
const char *, const cpp_lexer_pos *));
@@ -408,10 +411,11 @@ extern cpp_hashnode *_cpp_lookup_with_hash PARAMS ((cpp_reader*, size_t,
/* In cppfiles.c */
extern void _cpp_fake_include PARAMS ((cpp_reader *, const char *));
extern void _cpp_never_reread PARAMS ((struct include_file *));
-extern void _cpp_simplify_pathname PARAMS ((char *));
+extern char *_cpp_simplify_pathname PARAMS ((char *));
extern int _cpp_read_file PARAMS ((cpp_reader *, const char *));
-extern void _cpp_execute_include PARAMS ((cpp_reader *,
- const cpp_token *, int, int));
+extern int _cpp_execute_include PARAMS ((cpp_reader *,
+ const cpp_token *,
+ enum include_type));
extern int _cpp_compare_file_date PARAMS ((cpp_reader *,
const cpp_token *));
extern void _cpp_report_missing_guards PARAMS ((cpp_reader *));
diff --git a/gcc/cppinit.c b/gcc/cppinit.c
index 539366660b1..ad7f2b83cfa 100644
--- a/gcc/cppinit.c
+++ b/gcc/cppinit.c
@@ -70,10 +70,10 @@ struct cpp_pending
{
struct pending_option *directive_head, *directive_tail;
- struct file_name_list *quote_head, *quote_tail;
- struct file_name_list *brack_head, *brack_tail;
- struct file_name_list *systm_head, *systm_tail;
- struct file_name_list *after_head, *after_tail;
+ struct search_path *quote_head, *quote_tail;
+ struct search_path *brack_head, *brack_tail;
+ struct search_path *systm_head, *systm_tail;
+ struct search_path *after_head, *after_tail;
struct pending_option *imacros_head, *imacros_tail;
struct pending_option *include_head, *include_tail;
@@ -100,10 +100,10 @@ static void init_library PARAMS ((void));
static void init_builtins PARAMS ((cpp_reader *));
static void append_include_chain PARAMS ((cpp_reader *,
char *, int, int));
-struct file_name_list * remove_dup_dir PARAMS ((cpp_reader *,
- struct file_name_list *));
-struct file_name_list * remove_dup_dirs PARAMS ((cpp_reader *,
- struct file_name_list *));
+struct search_path * remove_dup_dir PARAMS ((cpp_reader *,
+ struct search_path *));
+struct search_path * remove_dup_dirs PARAMS ((cpp_reader *,
+ struct search_path *));
static void merge_include_chains PARAMS ((cpp_reader *));
static void do_includes PARAMS ((cpp_reader *,
struct pending_option *,
@@ -117,8 +117,9 @@ static void new_pending_directive PARAMS ((struct cpp_pending *,
static void output_deps PARAMS ((cpp_reader *));
static int parse_option PARAMS ((const char *));
-/* Fourth argument to append_include_chain: chain to use. */
-enum { QUOTE = 0, BRACKET, SYSTEM, AFTER };
+/* Fourth argument to append_include_chain: chain to use.
+ Note it's never asked to append to the quote chain. */
+enum { BRACKET = 0, SYSTEM, AFTER };
/* If we have designated initializers (GCC >2.7) these tables can be
initialized, constant data. Otherwise, they have to be filled in at
@@ -206,14 +207,16 @@ append_include_chain (pfile, dir, path, cxx_aware)
int cxx_aware ATTRIBUTE_UNUSED;
{
struct cpp_pending *pend = CPP_OPTION (pfile, pending);
- struct file_name_list *new;
+ struct search_path *new;
struct stat st;
unsigned int len;
+ if (*dir == '\0')
+ dir = xstrdup (".");
_cpp_simplify_pathname (dir);
if (stat (dir, &st))
{
- /* Dirs that don't exist are silently ignored. */
+ /* Dirs that don't exist are silently ignored. */
if (errno != ENOENT)
cpp_notice_from_errno (pfile, dir);
else if (CPP_OPTION (pfile, verbose))
@@ -231,12 +234,15 @@ append_include_chain (pfile, dir, path, cxx_aware)
if (len > pfile->max_include_len)
pfile->max_include_len = len;
- new = (struct file_name_list *) xmalloc (sizeof (struct file_name_list));
+ new = (struct search_path *) xmalloc (sizeof (struct search_path));
new->name = dir;
- new->nlen = len;
+ new->len = len;
new->ino = st.st_ino;
new->dev = st.st_dev;
- if (path == SYSTEM)
+ /* Both systm and after include file lists should be treated as system
+ include files since these two lists are really just a concatenation
+ of one "system" list. */
+ if (path == SYSTEM || path == AFTER)
#ifdef NO_IMPLICIT_EXTERN_C
new->sysp = 1;
#else
@@ -246,11 +252,9 @@ append_include_chain (pfile, dir, path, cxx_aware)
new->sysp = 0;
new->name_map = NULL;
new->next = NULL;
- new->alloc = NULL;
switch (path)
{
- case QUOTE: APPEND (pend, quote, new); break;
case BRACKET: APPEND (pend, brack, new); break;
case SYSTEM: APPEND (pend, systm, new); break;
case AFTER: APPEND (pend, after, new); break;
@@ -260,18 +264,18 @@ append_include_chain (pfile, dir, path, cxx_aware)
/* Handle a duplicated include path. PREV is the link in the chain
before the duplicate. The duplicate is removed from the chain and
freed. Returns PREV. */
-struct file_name_list *
+struct search_path *
remove_dup_dir (pfile, prev)
cpp_reader *pfile;
- struct file_name_list *prev;
+ struct search_path *prev;
{
- struct file_name_list *cur = prev->next;
+ struct search_path *cur = prev->next;
if (CPP_OPTION (pfile, verbose))
fprintf (stderr, _("ignoring duplicate directory \"%s\"\n"), cur->name);
prev->next = cur->next;
- free (cur->name);
+ free ((PTR) cur->name);
free (cur);
return prev;
@@ -281,12 +285,12 @@ remove_dup_dir (pfile, prev)
chain, or NULL if the chain is empty. This algorithm is quadratic
in the number of -I switches, which is acceptable since there
aren't usually that many of them. */
-struct file_name_list *
+struct search_path *
remove_dup_dirs (pfile, head)
cpp_reader *pfile;
- struct file_name_list *head;
+ struct search_path *head;
{
- struct file_name_list *prev = NULL, *cur, *other;
+ struct search_path *prev = NULL, *cur, *other;
for (cur = head; cur; cur = cur->next)
{
@@ -315,7 +319,7 @@ static void
merge_include_chains (pfile)
cpp_reader *pfile;
{
- struct file_name_list *quote, *brack, *systm, *qtail;
+ struct search_path *quote, *brack, *systm, *qtail;
struct cpp_pending *pend = CPP_OPTION (pfile, pending);
@@ -338,7 +342,7 @@ merge_include_chains (pfile)
/* This is a bit tricky. First we drop dupes from the quote-include
list. Then we drop dupes from the bracket-include list.
Finally, if qtail and brack are the same directory, we cut out
- brack.
+ brack and move brack up to point to qtail.
We can't just merge the lists and then uniquify them because
then we may lose directories from the <> search path that should
@@ -371,8 +375,6 @@ set_lang (pfile, lang)
cpp_reader *pfile;
enum c_lang lang;
{
- struct cpp_pending *pend = CPP_OPTION (pfile, pending);
-
/* Defaults. */
CPP_OPTION (pfile, lang) = lang;
CPP_OPTION (pfile, objc) = 0;
@@ -388,7 +390,6 @@ set_lang (pfile, lang)
CPP_OPTION (pfile, cplusplus_comments) = 1;
CPP_OPTION (pfile, digraphs) = 1;
CPP_OPTION (pfile, c99) = 1;
- new_pending_directive (pend, "__STDC_VERSION__=199901L", cpp_define);
break;
case CLK_GNUC89:
CPP_OPTION (pfile, trigraphs) = 0;
@@ -400,7 +401,6 @@ set_lang (pfile, lang)
/* ISO C. */
case CLK_STDC94:
- new_pending_directive (pend, "__STDC_VERSION__=199409L", cpp_define);
case CLK_STDC89:
CPP_OPTION (pfile, trigraphs) = 1;
CPP_OPTION (pfile, dollars_in_ident) = 0;
@@ -408,7 +408,6 @@ set_lang (pfile, lang)
CPP_OPTION (pfile, digraphs) = lang == CLK_STDC94;
CPP_OPTION (pfile, c99) = 0;
CPP_OPTION (pfile, extended_numbers) = 0;
- new_pending_directive (pend, "__STRICT_ANSI__", cpp_define);
break;
case CLK_STDC99:
CPP_OPTION (pfile, trigraphs) = 1;
@@ -416,13 +415,10 @@ set_lang (pfile, lang)
CPP_OPTION (pfile, cplusplus_comments) = 1;
CPP_OPTION (pfile, digraphs) = 1;
CPP_OPTION (pfile, c99) = 1;
- new_pending_directive (pend, "__STRICT_ANSI__", cpp_define);
- new_pending_directive (pend, "__STDC_VERSION__=199901L", cpp_define);
break;
/* Objective C. */
case CLK_OBJCXX:
- new_pending_directive (pend, "__cplusplus", cpp_define);
CPP_OPTION (pfile, cplusplus) = 1;
case CLK_OBJC:
CPP_OPTION (pfile, trigraphs) = 0;
@@ -431,7 +427,6 @@ set_lang (pfile, lang)
CPP_OPTION (pfile, digraphs) = 1;
CPP_OPTION (pfile, c99) = 0;
CPP_OPTION (pfile, objc) = 1;
- new_pending_directive (pend, "__OBJC__", cpp_define);
break;
/* C++. */
@@ -443,7 +438,6 @@ set_lang (pfile, lang)
CPP_OPTION (pfile, cplusplus_comments) = 1;
CPP_OPTION (pfile, digraphs) = 1;
CPP_OPTION (pfile, c99) = 0;
- new_pending_directive (pend, "__cplusplus", cpp_define);
break;
/* Assembler. */
@@ -453,7 +447,6 @@ set_lang (pfile, lang)
CPP_OPTION (pfile, cplusplus_comments) = 1;
CPP_OPTION (pfile, digraphs) = 0;
CPP_OPTION (pfile, c99) = 0;
- new_pending_directive (pend, "__ASSEMBLER__", cpp_define);
break;
}
}
@@ -509,6 +502,7 @@ cpp_create_reader (lang)
pfile = (cpp_reader *) xcalloc (1, sizeof (cpp_reader));
+ set_lang (pfile, lang);
CPP_OPTION (pfile, warn_import) = 1;
CPP_OPTION (pfile, discard_comments) = 1;
CPP_OPTION (pfile, show_column) = 1;
@@ -518,9 +512,6 @@ cpp_create_reader (lang)
CPP_OPTION (pfile, pending) =
(struct cpp_pending *) xcalloc (1, sizeof (struct cpp_pending));
- /* After creating pfile->pending. */
- set_lang (pfile, lang);
-
/* It's simplest to just create this struct whether or not it will
be needed. */
pfile->deps = deps_init ();
@@ -572,7 +563,7 @@ cpp_destroy (pfile)
cpp_reader *pfile;
{
int result;
- struct file_name_list *dir, *dirn;
+ struct search_path *dir, *dirn;
cpp_context *context, *contextn;
while (CPP_BUFFER (pfile) != NULL)
@@ -600,7 +591,7 @@ cpp_destroy (pfile)
for (dir = CPP_OPTION (pfile, quote_include); dir; dir = dirn)
{
dirn = dir->next;
- free (dir->name);
+ free ((PTR) dir->name);
free (dir);
}
@@ -620,7 +611,9 @@ cpp_destroy (pfile)
/* This structure defines one built-in identifier. A node will be
entered in the hash table under the name NAME, with value VALUE (if
any). If flags has OPERATOR, the node's operator field is used; if
- flags has BUILTIN the node's builtin field is used.
+ flags has BUILTIN the node's builtin field is used. Macros that are
+ known at build time should not be flagged BUILTIN, as then they do
+ not appear in macro dumps with e.g. -dM or -dD.
Two values are not compile time constants, so we tag
them in the FLAGS field instead:
@@ -645,7 +638,6 @@ struct builtin
#define OPERATOR 0x10
#define B(n, t) { U n, 0, t, 0, BUILTIN, sizeof n - 1 }
-#define BC(n, t) { U n, 0, t, 0, BUILTIN | CPLUS, sizeof n - 1 }
#define C(n, v) { U n, v, 0, 0, 0, sizeof n - 1 }
#define X(n, f) { U n, 0, 0, 0, f, sizeof n - 1 }
#define O(n, c, f) { U n, 0, 0, c, OPERATOR | f, sizeof n - 1 }
@@ -657,8 +649,6 @@ static const struct builtin builtin_array[] =
B("__BASE_FILE__", BT_BASE_FILE),
B("__LINE__", BT_SPECLINE),
B("__INCLUDE_LEVEL__", BT_INCLUDE_LEVEL),
- B("__STDC__", BT_STDC),
- BC("__GXX_WEAK__", BT_WEAK),
X("__VERSION__", VERS),
X("__USER_LABEL_PREFIX__", ULP),
@@ -676,6 +666,11 @@ static const struct builtin builtin_array[] =
#ifndef NO_BUILTIN_WINT_TYPE
C("__WINT_TYPE__", WINT_TYPE),
#endif
+#ifdef STDC_0_IN_SYSTEM_HEADERS
+ B("__STDC__", BT_STDC),
+#else
+ C("__STDC__", "1"),
+#endif
/* Named operators known to the preprocessor. These cannot be #defined
and always have their stated meaning. They are treated like normal
@@ -727,7 +722,7 @@ init_builtins (pfile)
else
{
hp->type = NT_MACRO;
- hp->flags |= NODE_BUILTIN;
+ hp->flags |= NODE_BUILTIN | NODE_WARN;
hp->value.builtin = b->builtin;
}
}
@@ -757,6 +752,29 @@ init_builtins (pfile)
_cpp_define_builtin (pfile, str);
}
}
+
+ if (CPP_OPTION (pfile, cplusplus))
+ {
+ _cpp_define_builtin (pfile, "__cplusplus 1");
+ if (SUPPORTS_ONE_ONLY)
+ _cpp_define_builtin (pfile, "__GXX_WEAK__ 1");
+ else
+ _cpp_define_builtin (pfile, "__GXX_WEAK__ 0");
+ }
+ if (CPP_OPTION (pfile, objc))
+ _cpp_define_builtin (pfile, "__OBJC__ 1");
+
+ if (CPP_OPTION (pfile, lang) == CLK_STDC94)
+ _cpp_define_builtin (pfile, "__STDC_VERSION__ 199409L");
+ else if (CPP_OPTION (pfile, c99))
+ _cpp_define_builtin (pfile, "__STDC_VERSION__ 199901L");
+
+ if (CPP_OPTION (pfile, lang) == CLK_STDC89
+ || CPP_OPTION (pfile, lang) == CLK_STDC94
+ || CPP_OPTION (pfile, lang) == CLK_STDC99)
+ _cpp_define_builtin (pfile, "__STRICT_ANSI__ 1");
+ else if (CPP_OPTION (pfile, lang) == CLK_ASM)
+ _cpp_define_builtin (pfile, "__ASSEMBLER__ 1");
}
#undef BUILTIN
#undef OPERATOR
@@ -869,8 +887,15 @@ do_includes (pfile, p, scan)
use the #include "" search path if cpp_read_file fails. */
if (CPP_OPTION (pfile, preprocessed))
cpp_error (pfile, "-include and -imacros cannot be used with -fpreprocessed");
- else if (_cpp_read_file (pfile, p->arg) && scan)
- cpp_scan_buffer_nooutput (pfile, 0);
+ else
+ {
+ cpp_token header;
+ header.type = CPP_STRING;
+ header.val.str.text = (const unsigned char *) p->arg;
+ header.val.str.len = strlen (p->arg);
+ if (_cpp_execute_include (pfile, &header, IT_CMDLINE) && scan)
+ cpp_scan_buffer_nooutput (pfile, 0);
+ }
q = p->next;
free (p);
p = q;
@@ -878,9 +903,8 @@ do_includes (pfile, p, scan)
}
/* This is called after options have been processed. Setup for
- processing input from the file named FNAME. (Use standard input if
- FNAME == NULL.) Return 1 on success, 0 on failure. */
-
+ processing input from the file named FNAME, or stdin if it is the
+ empty string. Return 1 on success, 0 on failure. */
int
cpp_start_read (pfile, fname)
cpp_reader *pfile;
@@ -897,7 +921,7 @@ cpp_start_read (pfile, fname)
/* With -v, print the list of dirs to search. */
if (CPP_OPTION (pfile, verbose))
{
- struct file_name_list *l;
+ struct search_path *l;
fprintf (stderr, _("#include \"...\" search starts here:\n"));
for (l = CPP_OPTION (pfile, quote_include); l; l = l->next)
{
@@ -908,19 +932,9 @@ cpp_start_read (pfile, fname)
fprintf (stderr, _("End of search list.\n"));
}
- if (CPP_OPTION (pfile, in_fname) == NULL
- || *CPP_OPTION (pfile, in_fname) == 0)
- {
- CPP_OPTION (pfile, in_fname) = fname;
- if (CPP_OPTION (pfile, in_fname) == NULL)
- CPP_OPTION (pfile, in_fname) = "";
- }
- if (CPP_OPTION (pfile, out_fname) == NULL)
- CPP_OPTION (pfile, out_fname) = "";
-
if (CPP_OPTION (pfile, print_deps))
/* Set the default target (if there is none already). */
- deps_add_default_target (pfile->deps, CPP_OPTION (pfile, in_fname));
+ deps_add_default_target (pfile->deps, fname);
/* Open the main input file. This must be done early, so we have a
buffer to stand on. */
@@ -943,8 +957,6 @@ cpp_start_read (pfile, fname)
p = q;
}
- pfile->done_initializing = 1;
-
/* The -imacros files can be scanned now, but the -include files
have to be pushed onto the buffer stack and processed later,
otherwise cppmain.c won't see the tokens. include_head was built
@@ -1047,7 +1059,6 @@ new_pending_directive (pend, text, handler)
/* This is the list of all command line options, with the leading
"-" removed. It must be sorted in ASCII collating order. */
#define COMMAND_LINE_OPTIONS \
- DEF_OPT("", 0, OPT_stdin_stdout) \
DEF_OPT("$", 0, OPT_dollar) \
DEF_OPT("+", 0, OPT_plus) \
DEF_OPT("-help", 0, OPT__help) \
@@ -1189,7 +1200,7 @@ parse_option (input)
Otherwise, return the longest option-accepting match.
This loops no more than twice with current options. */
mx = md;
- for (; mn < N_OPTS; mn++)
+ for (; mn < (unsigned int) N_OPTS; mn++)
{
opt_len = cl_options[mn].opt_len;
if (memcmp (input, cl_options[mn].opt_text, opt_len))
@@ -1220,15 +1231,16 @@ cpp_handle_option (pfile, argc, argv)
int i = 0;
struct cpp_pending *pend = CPP_OPTION (pfile, pending);
- if (argv[i][0] != '-')
+ /* Interpret "-" or a non-option as a file name. */
+ if (argv[i][0] != '-' || argv[i][1] == '\0')
{
- if (CPP_OPTION (pfile, out_fname) != NULL)
- cpp_fatal (pfile, "Too many arguments. Type %s --help for usage info",
- progname);
- else if (CPP_OPTION (pfile, in_fname) != NULL)
+ if (CPP_OPTION (pfile, in_fname) == NULL)
+ CPP_OPTION (pfile, in_fname) = argv[i];
+ else if (CPP_OPTION (pfile, out_fname) == NULL)
CPP_OPTION (pfile, out_fname) = argv[i];
else
- CPP_OPTION (pfile, in_fname) = argv[i];
+ cpp_fatal (pfile, "Too many filenames. Type %s --help for usage info",
+ progname);
}
else
{
@@ -1313,18 +1325,14 @@ cpp_handle_option (pfile, argc, argv)
verbose and -version. Historical reasons, don't ask. */
case OPT__version:
CPP_OPTION (pfile, help_only) = 1;
- goto version;
+ pfile->print_version = 1;
+ break;
case OPT_v:
CPP_OPTION (pfile, verbose) = 1;
- goto version;
-
+ pfile->print_version = 1;
+ break;
case OPT_version:
- version:
- fprintf (stderr, _("GNU CPP version %s (cpplib)"), version_string);
-#ifdef TARGET_VERSION
- TARGET_VERSION;
-#endif
- fputc ('\n', stderr);
+ pfile->print_version = 1;
break;
case OPT_C:
@@ -1411,21 +1419,13 @@ cpp_handle_option (pfile, argc, argv)
CPP_OPTION (pfile, no_standard_cplusplus_includes) = 1;
break;
case OPT_o:
- if (CPP_OPTION (pfile, out_fname) != NULL)
+ if (CPP_OPTION (pfile, out_fname) == NULL)
+ CPP_OPTION (pfile, out_fname) = arg;
+ else
{
cpp_fatal (pfile, "Output filename specified twice");
return argc;
}
- CPP_OPTION (pfile, out_fname) = arg;
- if (!strcmp (CPP_OPTION (pfile, out_fname), "-"))
- CPP_OPTION (pfile, out_fname) = "";
- break;
- case OPT_stdin_stdout:
- /* JF handle '-' as file name meaning stdin or stdout. */
- if (CPP_OPTION (pfile, in_fname) == NULL)
- CPP_OPTION (pfile, in_fname) = "";
- else if (CPP_OPTION (pfile, out_fname) == NULL)
- CPP_OPTION (pfile, out_fname) = "";
break;
case OPT_d:
/* Args to -d specify what parts of macros to dump.
@@ -1689,6 +1689,25 @@ void
cpp_post_options (pfile)
cpp_reader *pfile;
{
+ if (pfile->print_version)
+ {
+ fprintf (stderr, _("GNU CPP version %s (cpplib)"), version_string);
+#ifdef TARGET_VERSION
+ TARGET_VERSION;
+#endif
+ fputc ('\n', stderr);
+ }
+
+ /* Canonicalize in_fname and out_fname. We guarantee they are not
+ NULL, and that the empty string represents stdin / stdout. */
+ if (CPP_OPTION (pfile, in_fname) == NULL
+ || !strcmp (CPP_OPTION (pfile, in_fname), "-"))
+ CPP_OPTION (pfile, in_fname) = "";
+
+ if (CPP_OPTION (pfile, out_fname) == NULL
+ || !strcmp (CPP_OPTION (pfile, out_fname), "-"))
+ CPP_OPTION (pfile, out_fname) = "";
+
/* -Wtraditional is not useful in C++ mode. */
if (CPP_OPTION (pfile, cplusplus))
CPP_OPTION (pfile, warn_traditional) = 0;
@@ -1697,6 +1716,11 @@ cpp_post_options (pfile)
if (CPP_OPTION (pfile, user_label_prefix) == NULL)
CPP_OPTION (pfile, user_label_prefix) = USER_LABEL_PREFIX;
+ /* Permanently disable macro expansion if we are rescanning
+ preprocessed text. */
+ if (CPP_OPTION (pfile, preprocessed))
+ pfile->state.prevent_expansion = 1;
+
/* We need to do this after option processing and before
cpp_start_read, as cppmain.c relies on the options->no_output to
set its callbacks correctly before calling cpp_start_read. */
@@ -1757,12 +1781,14 @@ init_dependency_output (pfile)
}
/* If dependencies go to standard output, or -MG is used, we should
- suppress output. The user may be requesting other stuff to
- stdout, with -dM, -v etc. We let them shoot themselves in the
- foot. */
+ suppress output, including -dM, -dI etc. */
if (CPP_OPTION (pfile, deps_file) == 0
|| CPP_OPTION (pfile, print_deps_missing_files))
- CPP_OPTION (pfile, no_output) = 1;
+ {
+ CPP_OPTION (pfile, no_output) = 1;
+ CPP_OPTION (pfile, dump_macros) = 0;
+ CPP_OPTION (pfile, dump_includes) = 0;
+ }
}
static void
@@ -1856,6 +1882,7 @@ Switches:\n\
-dI Include #include directives in the output\n\
"), stdout);
fputs (_("\
+ -fpreprocessed Treat the input file as already preprocessed\n\
-ftabstop=<number> Distance between tab stops for column reporting\n\
-P Do not generate #line directives\n\
-$ Do not allow '$' in identifiers\n\
diff --git a/gcc/cpplex.c b/gcc/cpplex.c
index 9025b0531a8..8feb98f8ee4 100644
--- a/gcc/cpplex.c
+++ b/gcc/cpplex.c
@@ -629,10 +629,11 @@ unescaped_terminator_p (pfile, dest)
}
/* Parses a string, character constant, or angle-bracketed header file
- name. Handles embedded trigraphs and escaped newlines.
+ name. Handles embedded trigraphs and escaped newlines. The stored
+ string is guaranteed NUL-terminated, but it is not guaranteed that
+ this is the first NUL since embedded NULs are preserved.
- Multi-line strings are allowed, but they are deprecated within
- directives. */
+ Multi-line strings are allowed, but they are deprecated. */
static void
parse_string (pfile, token, terminator)
cpp_reader *pfile;
@@ -644,6 +645,7 @@ parse_string (pfile, token, terminator)
unsigned char *dest, *limit;
cppchar_t c;
unsigned int nulls = 0;
+ bool warned_multi = false;
dest = POOL_FRONT (pool);
limit = POOL_LIMIT (pool);
@@ -651,14 +653,21 @@ parse_string (pfile, token, terminator)
for (;;)
{
if (buffer->cur == buffer->rlimit)
+ c = EOF;
+ else
+ c = *buffer->cur++;
+
+ have_char:
+ /* We need space for the terminating NUL. */
+ if (dest >= limit)
+ limit = _cpp_next_chunk (pool, 0, &dest);
+
+ if (c == EOF)
{
- c = EOF;
unterminated (pfile, terminator);
break;
}
- c = *buffer->cur++;
- have_char:
/* Handle trigraphs, escaped newlines etc. */
if (c == '?' || c == '\\')
c = skip_escaped_newlines (buffer, c);
@@ -686,15 +695,18 @@ parse_string (pfile, token, terminator)
break;
}
- if (pfile->mlstring_pos.line == 0)
+ if (!warned_multi)
{
- pfile->mlstring_pos = pfile->lexer_pos;
- if (CPP_PEDANTIC (pfile))
- cpp_pedwarn (pfile, "multi-line string constant");
+ warned_multi = true;
+ cpp_pedwarn (pfile, "multi-line string literals are deprecated");
}
+
+ if (pfile->mlstring_pos.line == 0)
+ pfile->mlstring_pos = pfile->lexer_pos;
- handle_newline (buffer, c); /* Stores to read_ahead. */
- c = '\n';
+ c = handle_newline (buffer, c);
+ *dest++ = '\n';
+ goto have_char;
}
else if (c == '\0')
{
@@ -702,25 +714,16 @@ parse_string (pfile, token, terminator)
cpp_warning (pfile, "null character(s) preserved in literal");
}
- /* No terminating null for strings - they could contain nulls. */
- if (dest >= limit)
- limit = _cpp_next_chunk (pool, 0, &dest);
*dest++ = c;
-
- /* If we had a new line, the next character is in read_ahead. */
- if (c != '\n')
- continue;
- c = buffer->read_ahead;
- if (c != EOF)
- goto have_char;
}
/* Remember the next character. */
buffer->read_ahead = c;
+ *dest = '\0';
token->val.str.text = POOL_FRONT (pool);
token->val.str.len = dest - token->val.str.text;
- POOL_COMMIT (pool, token->val.str.len);
+ POOL_COMMIT (pool, token->val.str.len + 1);
}
/* The stored comment includes the comment start and any terminator. */
@@ -876,9 +879,11 @@ _cpp_lex_token (pfile, result)
switch (c)
{
case EOF:
- /* Non-empty files should end in a newline. Ignore for command
- line and _Pragma buffers. */
- if (pfile->lexer_pos.col != 0 && !buffer->from_stage3)
+ /* Non-empty files should end in a newline. Checking "bol" too
+ prevents multiple warnings when hitting the EOF more than
+ once, like in a directive. Don't warn for command line and
+ _Pragma buffers. */
+ if (pfile->lexer_pos.col != 0 && !bol && !buffer->from_stage3)
cpp_pedwarn (pfile, "no newline at end of file");
pfile->state.next_bol = 1;
pfile->skipping = 0; /* In case missing #endif. */
@@ -994,7 +999,7 @@ _cpp_lex_token (pfile, result)
ACCEPT_CHAR (CPP_DIV_EQ);
if (c != '/' && c != '*')
break;
-
+
if (c == '*')
{
if (skip_block_comment (pfile))
@@ -1021,14 +1026,14 @@ _cpp_lex_token (pfile, result)
}
/* Skip_line_comment updates buffer->read_ahead. */
- if (skip_line_comment (pfile))
+ if (skip_line_comment (pfile) && CPP_OPTION (pfile, warn_comments))
cpp_warning_with_line (pfile, pfile->lexer_pos.line,
pfile->lexer_pos.col,
"multi-line comment");
}
/* Skipping the comment has updated buffer->read_ahead. */
- if (!pfile->state.save_comments)
+ if (!pfile->state.save_comments || pfile->skipping)
{
result->flags |= PREV_WHITE;
goto next_char;
@@ -1174,38 +1179,36 @@ _cpp_lex_token (pfile, result)
result->type = CPP_HASH;
do_hash:
- if (bol)
+ if (!bol)
+ break;
+ /* 6.10.3 paragraph 11: If there are sequences of preprocessing
+ tokens within the list of arguments that would otherwise act
+ as preprocessing directives, the behavior is undefined.
+
+ This implementation will report a hard error, terminate the
+ macro invocation, and proceed to process the directive. */
+ if (pfile->state.parsing_args)
{
- if (pfile->state.parsing_args)
- {
- /* 6.10.3 paragraph 11: If there are sequences of
- preprocessing tokens within the list of arguments that
- would otherwise act as preprocessing directives, the
- behavior is undefined.
-
- This implementation will report a hard error, terminate
- the macro invocation, and proceed to process the
- directive. */
- cpp_error (pfile,
- "directives may not be used inside a macro argument");
-
- /* Put a '#' in lookahead, return CPP_EOF for parse_arg. */
- buffer->extra_char = buffer->read_ahead;
- buffer->read_ahead = '#';
- pfile->state.next_bol = 1;
- result->type = CPP_EOF;
-
- /* Get whitespace right - newline_in_args sets it. */
- if (pfile->lexer_pos.col == 1)
- result->flags &= ~(PREV_WHITE | AVOID_LPASTE);
- }
- else
- {
- /* This is the hash introducing a directive. */
- if (_cpp_handle_directive (pfile, result->flags & PREV_WHITE))
- goto done_directive; /* bol still 1. */
- /* This is in fact an assembler #. */
- }
+ if (pfile->state.parsing_args == 2)
+ cpp_error (pfile,
+ "directives may not be used inside a macro argument");
+
+ /* Put a '#' in lookahead, return CPP_EOF for parse_arg. */
+ buffer->extra_char = buffer->read_ahead;
+ buffer->read_ahead = '#';
+ pfile->state.next_bol = 1;
+ result->type = CPP_EOF;
+
+ /* Get whitespace right - newline_in_args sets it. */
+ if (pfile->lexer_pos.col == 1)
+ result->flags &= ~(PREV_WHITE | AVOID_LPASTE);
+ }
+ else
+ {
+ /* This is the hash introducing a directive. */
+ if (_cpp_handle_directive (pfile, result->flags & PREV_WHITE))
+ goto done_directive; /* bol still 1. */
+ /* This is in fact an assembler #. */
}
break;
@@ -1246,29 +1249,8 @@ _cpp_lex_token (pfile, result)
case '}': result->type = CPP_CLOSE_BRACE; break;
case ';': result->type = CPP_SEMICOLON; break;
- case '@':
- if (CPP_OPTION (pfile, objc))
- {
- /* In Objective C, '@' may begin keywords or strings, like
- @keyword or @"string". It would be nice to call
- get_effective_char here and test the result. However, we
- would then need to pass 2 characters to parse_identifier,
- making it ugly and slowing down its main loop. Instead,
- we assume we have an identifier, and recover if not. */
- result->type = CPP_NAME;
- result->val.node = parse_identifier (pfile, c);
- if (result->val.node->length != 1)
- break;
-
- /* OK, so it wasn't an identifier. Maybe a string? */
- if (buffer->read_ahead == '"')
- {
- c = '"';
- ACCEPT_CHAR (CPP_OSTRING);
- goto make_string;
- }
- }
- goto random_char;
+ /* @ is a punctuator in Objective C. */
+ case '@': result->type = CPP_ATSIGN; break;
random_char:
default:
@@ -1321,7 +1303,8 @@ cpp_spell_token (pfile, token, buffer)
unsigned char c;
if (token->flags & DIGRAPH)
- spelling = digraph_spellings[token->type - CPP_FIRST_DIGRAPH];
+ spelling
+ = digraph_spellings[(int) token->type - (int) CPP_FIRST_DIGRAPH];
else if (token->flags & NAMED_OP)
goto spell_ident;
else
@@ -1345,7 +1328,6 @@ cpp_spell_token (pfile, token, buffer)
{
case CPP_STRING: left = '"'; right = '"'; tag = '\0'; break;
case CPP_WSTRING: left = '"'; right = '"'; tag = 'L'; break;
- case CPP_OSTRING: left = '"'; right = '"'; tag = '@'; break;
case CPP_CHAR: left = '\''; right = '\''; tag = '\0'; break;
case CPP_WCHAR: left = '\''; right = '\''; tag = 'L'; break;
case CPP_HEADER_NAME: left = '<'; right = '>'; tag = '\0'; break;
@@ -1413,7 +1395,8 @@ cpp_output_token (token, fp)
const unsigned char *spelling;
if (token->flags & DIGRAPH)
- spelling = digraph_spellings[token->type - CPP_FIRST_DIGRAPH];
+ spelling
+ = digraph_spellings[(int) token->type - (int) CPP_FIRST_DIGRAPH];
else if (token->flags & NAMED_OP)
goto spell_ident;
else
@@ -1435,7 +1418,6 @@ cpp_output_token (token, fp)
{
case CPP_STRING: left = '"'; right = '"'; tag = '\0'; break;
case CPP_WSTRING: left = '"'; right = '"'; tag = 'L'; break;
- case CPP_OSTRING: left = '"'; right = '"'; tag = '@'; break;
case CPP_CHAR: left = '\''; right = '\''; tag = '\0'; break;
case CPP_WCHAR: left = '\''; right = '\''; tag = 'L'; break;
case CPP_HEADER_NAME: left = '<'; right = '>'; tag = '\0'; break;
@@ -1484,26 +1466,6 @@ _cpp_equiv_tokens (a, b)
return 0;
}
-#if 0
-/* Compare two token lists. */
-int
-_cpp_equiv_toklists (a, b)
- const struct toklist *a, *b;
-{
- unsigned int i, count;
-
- count = a->limit - a->first;
- if (count != (b->limit - b->first))
- return 0;
-
- for (i = 0; i < count; i++)
- if (! _cpp_equiv_tokens (&a->first[i], &b->first[i]))
- return 0;
-
- return 1;
-}
-#endif
-
/* Determine whether two tokens can be pasted together, and if so,
what the resulting token is. Returns CPP_EOF if the tokens cannot
be pasted, or the appropriate type for the merged token if they
@@ -1523,8 +1485,8 @@ cpp_can_paste (pfile, token1, token2, digraph)
if (token2->flags & NAMED_OP)
b = CPP_NAME;
- if (a <= CPP_LAST_EQ && b == CPP_EQ)
- return a + (CPP_EQ_EQ - CPP_EQ);
+ if ((int) a <= (int) CPP_LAST_EQ && b == CPP_EQ)
+ return (enum cpp_ttype) ((int) a + ((int) CPP_EQ_EQ - (int) CPP_EQ));
switch (a)
{
@@ -1603,13 +1565,6 @@ cpp_can_paste (pfile, token1, token2, digraph)
return CPP_NUMBER;
break;
- case CPP_OTHER:
- if (CPP_OPTION (pfile, objc) && token1->val.c == '@')
- {
- if (b == CPP_NAME) return CPP_NAME;
- if (b == CPP_STRING) return CPP_OSTRING;
- }
-
default:
break;
}
@@ -1637,12 +1592,12 @@ cpp_avoid_paste (pfile, token1, token2)
c = EOF;
if (token2->flags & DIGRAPH)
- c = digraph_spellings[b - CPP_FIRST_DIGRAPH][0];
+ c = digraph_spellings[(int) b - (int) CPP_FIRST_DIGRAPH][0];
else if (token_spellings[b].category == SPELL_OPERATOR)
c = token_spellings[b].name[0];
/* Quickly get everything that can paste with an '='. */
- if (a <= CPP_LAST_EQ && c == '=')
+ if ((int) a <= (int) CPP_LAST_EQ && c == '=')
return 1;
switch (a)
diff --git a/gcc/cpplib.c b/gcc/cpplib.c
index da6e39758b0..f063ae4b42d 100644
--- a/gcc/cpplib.c
+++ b/gcc/cpplib.c
@@ -95,6 +95,7 @@ static int strtoul_for_line PARAMS ((const U_CHAR *, unsigned int,
unsigned long *));
static void do_diagnostic PARAMS ((cpp_reader *, enum error_type, int));
static cpp_hashnode *lex_macro_node PARAMS ((cpp_reader *));
+static void do_include_common PARAMS ((cpp_reader *, enum include_type));
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 *));
@@ -311,7 +312,32 @@ _cpp_handle_directive (pfile, indented)
/* If we are rescanning preprocessed input, only directives tagged
with IN_I are honored, and the warnings below are suppressed. */
- if (! CPP_OPTION (pfile, preprocessed) || dir->flags & IN_I)
+ if (CPP_OPTION (pfile, preprocessed))
+ {
+ /* Kluge alert. In order to be sure that code like this
+ #define HASH #
+ HASH define foo bar
+ does not cause '#define foo bar' to get executed when
+ compiled with -save-temps, we recognize directives in
+ -fpreprocessed mode only if the # is in column 1 and the
+ directive name starts in column 2. This output can only
+ be generated by the directive callbacks in cppmain.c (see
+ also the special case in scan_buffer). */
+ if (dir->flags & IN_I && !indented && !(dname.flags & PREV_WHITE))
+ (*dir->handler) (pfile);
+ /* That check misses '# 123' linemarkers. Let them through too. */
+ else if (dname.type == CPP_NUMBER)
+ (*dir->handler) (pfile);
+ else
+ {
+ /* We don't want to process this directive. Put back the
+ tokens so caller will see them (and issue an error,
+ probably). */
+ _cpp_push_token (pfile, &dname, &pfile->directive_pos);
+ skip = 0;
+ }
+ }
+ else
{
/* Traditionally, a directive is ignored unless its # is in
column 1. Therefore in code intended to work with K+R
@@ -397,7 +423,8 @@ run_directive (pfile, dir_no, type, buf, count)
start_directive (pfile);
pfile->state.prevent_expansion++;
- (void) (*dtable[dir_no].handler) (pfile);
+ pfile->directive = &dtable[dir_no];
+ (void) (*pfile->directive->handler) (pfile);
pfile->state.prevent_expansion--;
check_eol (pfile);
end_directive (pfile, 1);
@@ -477,7 +504,7 @@ do_undef (pfile)
if (pfile->cb.undef)
(*pfile->cb.undef) (pfile, node);
- if (node->flags & NODE_BUILTIN)
+ if (node->flags & NODE_WARN)
cpp_warning (pfile, "undefining \"%s\"", node->name);
_cpp_free_definition (node);
@@ -525,8 +552,9 @@ glue_header_name (pfile, header)
cpp_error (pfile, "missing terminating > character");
else
{
- token_mem = _cpp_pool_alloc (&pfile->ident_pool, total_len);
+ token_mem = _cpp_pool_alloc (&pfile->ident_pool, total_len + 1);
memcpy (token_mem, buffer, total_len);
+ token_mem[total_len] = '\0';
header->type = CPP_HEADER_NAME;
header->flags &= ~PREV_WHITE;
@@ -584,22 +612,47 @@ parse_include (pfile, header)
return 0;
}
+/* Handle #include, #include_next and #import. */
static void
-do_include (pfile)
+do_include_common (pfile, type)
cpp_reader *pfile;
+ enum include_type type;
{
cpp_token header;
if (!parse_include (pfile, &header))
- _cpp_execute_include (pfile, &header, 0, 0);
+ {
+ /* Prevent #include recursion. */
+ if (pfile->buffer_stack_depth >= CPP_STACK_MAX)
+ cpp_fatal (pfile, "#include nested too deeply");
+ else if (pfile->context->prev)
+ cpp_ice (pfile, "attempt to push file buffer with contexts stacked");
+ else
+ {
+ /* For #include_next, if this is the primary source file,
+ warn and use the normal search logic. */
+ if (type == IT_INCLUDE_NEXT && ! pfile->buffer->prev)
+ {
+ cpp_warning (pfile, "#include_next in primary source file");
+ type = IT_INCLUDE;
+ }
+
+ _cpp_execute_include (pfile, &header, type);
+ }
+ }
}
static void
-do_import (pfile)
+do_include (pfile)
cpp_reader *pfile;
{
- cpp_token header;
+ do_include_common (pfile, IT_INCLUDE);
+}
+static void
+do_import (pfile)
+ cpp_reader *pfile;
+{
if (!pfile->import_warning && CPP_OPTION (pfile, warn_import))
{
pfile->import_warning = 1;
@@ -607,18 +660,14 @@ do_import (pfile)
"#import is obsolete, use an #ifndef wrapper in the header file");
}
- if (!parse_include (pfile, &header))
- _cpp_execute_include (pfile, &header, 1, 0);
+ do_include_common (pfile, IT_IMPORT);
}
static void
do_include_next (pfile)
cpp_reader *pfile;
{
- cpp_token header;
-
- if (!parse_include (pfile, &header))
- _cpp_execute_include (pfile, &header, 0, 1);
+ do_include_common (pfile, IT_INCLUDE_NEXT);
}
/* Subroutine of do_line. Read possible flags after file name. LAST
@@ -707,16 +756,7 @@ do_line (pfile)
cpp_get_token (pfile, &token);
if (token.type == CPP_STRING)
{
- char *fname;
- unsigned int len;
-
- /* FIXME: memory leak. */
- len = token.val.str.len;
- fname = xmalloc (len + 1);
- memcpy (fname, token.val.str.text, len);
- fname[len] = '\0';
-
- _cpp_simplify_pathname (fname);
+ const char *fname = (const char *) token.val.str.text;
/* Only accept flags for the # 55 form. */
if (! pfile->state.line_extension)
@@ -761,6 +801,7 @@ do_line (pfile)
{
cpp_pop_buffer (pfile);
buffer = pfile->buffer;
+#ifdef ENABLE_CHECKING
if (strcmp (buffer->nominal_fname, fname))
cpp_warning (pfile, "expected to return to file \"%s\"",
buffer->nominal_fname);
@@ -770,6 +811,7 @@ do_line (pfile)
if (buffer->sysp != sysp)
cpp_warning (pfile, "header flags for \"%s\" have changed",
buffer->nominal_fname);
+#endif
}
}
buffer->sysp = sysp;
@@ -825,7 +867,7 @@ _cpp_do_file_change (pfile, reason, from_file, from_lineno)
fc.from.filename = from_file;
fc.from.lineno = from_lineno;
- pfile->cb.file_change (pfile, &fc);
+ (*pfile->cb.file_change) (pfile, &fc);
}
}
@@ -861,7 +903,8 @@ static void
do_warning (pfile)
cpp_reader *pfile;
{
- do_diagnostic (pfile, WARNING, 1);
+ /* We want #warning diagnostics to be emitted in system headers too. */
+ do_diagnostic (pfile, WARNING_SYSHDR, 1);
}
/* Report program identification. */
@@ -1027,10 +1070,9 @@ do_pragma (pfile)
}
cpp_stop_lookahead (pfile, drop);
- pfile->state.prevent_expansion--;
-
if (!drop && pfile->cb.def_pragma)
(*pfile->cb.def_pragma) (pfile);
+ pfile->state.prevent_expansion--;
}
static void
@@ -1799,7 +1841,10 @@ cpp_push_buffer (pfile, buffer, len, type, filename)
pfile->lexer_pos.output_line = 1;
}
- new->nominal_fname = filename;
+ if (*filename == '\0')
+ new->nominal_fname = _("<stdin>");
+ else
+ new->nominal_fname = filename;
new->type = type;
new->prev = pfile->buffer;
new->pfile = pfile;
@@ -1879,7 +1924,7 @@ _cpp_init_stacks (pfile)
obstack_init (pfile->buffer_ob);
/* Register the directives. */
- for (i = 0; i < N_DIRECTIVES; i++)
+ for (i = 0; i < (unsigned int) N_DIRECTIVES; i++)
{
node = cpp_lookup (pfile, dtable[i].name, dtable[i].length);
node->directive_index = i + 1;
diff --git a/gcc/cpplib.h b/gcc/cpplib.h
index eec4f1eb435..b9b706bd75e 100644
--- a/gcc/cpplib.h
+++ b/gcc/cpplib.h
@@ -119,6 +119,7 @@ struct file_name_map_list;
OP(CPP_SCOPE, "::") \
OP(CPP_DEREF_STAR, "->*") \
OP(CPP_DOT_STAR, ".*") \
+ OP(CPP_ATSIGN, "@") /* used in Objective C */ \
\
TK(CPP_NAME, SPELL_IDENT) /* word */ \
TK(CPP_INT, SPELL_STRING) /* 23 */ \
@@ -131,7 +132,6 @@ struct file_name_map_list;
\
TK(CPP_STRING, SPELL_STRING) /* "string" */ \
TK(CPP_WSTRING, SPELL_STRING) /* L"string" */ \
- TK(CPP_OSTRING, SPELL_STRING) /* @"string" - Objective C */ \
TK(CPP_HEADER_NAME, SPELL_STRING) /* <stdio.h> in #include */ \
\
TK(CPP_COMMENT, SPELL_STRING) /* Only if output comments. */ \
@@ -240,8 +240,8 @@ struct cpp_options
const char *deps_file;
/* Search paths for include files. */
- struct file_name_list *quote_include; /* First dir to search for "file" */
- struct file_name_list *bracket_include;/* First dir to search for <file> */
+ struct search_path *quote_include; /* "" */
+ struct search_path *bracket_include; /* <> */
/* Map between header names and file names, used only on DOS where
file names are limited in length. */
@@ -444,6 +444,7 @@ enum cpp_buffer_type {BUF_FAKE, BUF_FILE, BUF_BUILTIN,
#define NODE_POISONED (1 << 1) /* Poisoned identifier. */
#define NODE_BUILTIN (1 << 2) /* Builtin macro. */
#define NODE_DIAGNOSTIC (1 << 3) /* Possible diagnostic when lexed. */
+#define NODE_WARN (1 << 4) /* Warn if redefined or undefined. */
/* Different flavors of hash node. */
enum node_type
@@ -462,9 +463,7 @@ enum builtin_type
BT_BASE_FILE, /* `__BASE_FILE__' */
BT_INCLUDE_LEVEL, /* `__INCLUDE_LEVEL__' */
BT_TIME, /* `__TIME__' */
- BT_STDC, /* `__STDC__' */
- BT_WEAK /* Whether or not G++ supports weak
- symbols. */
+ BT_STDC /* `__STDC__' */
};
/* There is a slot in the hashnode for use by front ends when integrated
@@ -604,6 +603,7 @@ extern void cpp_forall_identifiers PARAMS ((cpp_reader *,
extern void cpp_scan_buffer_nooutput PARAMS ((cpp_reader *, int));
extern void cpp_start_lookahead PARAMS ((cpp_reader *));
extern void cpp_stop_lookahead PARAMS ((cpp_reader *, int));
+extern int cpp_sys_macro_p PARAMS ((cpp_reader *));
/* In cppfiles.c */
extern int cpp_included PARAMS ((cpp_reader *, const char *));
diff --git a/gcc/cppmacro.c b/gcc/cppmacro.c
index 3b9f64c2c67..786c4204940 100644
--- a/gcc/cppmacro.c
+++ b/gcc/cppmacro.c
@@ -29,10 +29,6 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "cpplib.h"
#include "cpphash.h"
-#ifndef STDC_0_IN_SYSTEM_HEADERS
-#define STDC_0_IN_SYSTEM_HEADERS 0 /* Boolean macro. */
-#endif
-
struct cpp_macro
{
cpp_hashnode **params; /* Parameters, if any. */
@@ -44,6 +40,7 @@ struct cpp_macro
unsigned int fun_like : 1; /* If a function-like macro. */
unsigned int variadic : 1; /* If a variadic macro. */
unsigned int disabled : 1; /* If macro is disabled. */
+ unsigned int syshdr : 1; /* If macro defined in system header. */
};
typedef struct macro_arg macro_arg;
@@ -91,9 +88,8 @@ static void free_lookahead PARAMS ((cpp_lookahead *));
/* #define directive parsing and handling. */
static cpp_token *lex_expansion_token PARAMS ((cpp_reader *, cpp_macro *));
-static int check_macro_redefinition PARAMS ((cpp_reader *,
- const cpp_hashnode *,
- const cpp_macro *));
+static int warn_of_redefinition PARAMS ((cpp_reader *, const cpp_hashnode *,
+ const cpp_macro *));
static int save_parameter PARAMS ((cpp_reader *, cpp_macro *, cpp_hashnode *));
static int parse_params PARAMS ((cpp_reader *, cpp_macro *));
static void check_trad_stringification PARAMS ((cpp_reader *,
@@ -109,11 +105,12 @@ make_string_token (pool, token, text, len)
const U_CHAR *text;
unsigned int len;
{
- U_CHAR *buf = _cpp_pool_alloc (pool, len * 4);
+ U_CHAR *buf = _cpp_pool_alloc (pool, len * 4 + 1);
token->type = CPP_STRING;
token->val.str.text = buf;
token->val.str.len = quote_string (buf, text, len) - buf;
+ buf[token->val.str.len] = '\0';
token->flags = 0;
}
@@ -183,11 +180,8 @@ builtin_macro (pfile, token)
case BT_STDC:
{
- int stdc = 1;
-
- if (STDC_0_IN_SYSTEM_HEADERS && CPP_IN_SYSTEM_HEADER (pfile)
- && pfile->spec_nodes.n__STRICT_ANSI__->type == NT_VOID)
- stdc = 0;
+ int stdc = (!CPP_IN_SYSTEM_HEADER (pfile)
+ || pfile->spec_nodes.n__STRICT_ANSI__->type != NT_VOID);
make_number_token (pfile, token, stdc);
}
break;
@@ -216,10 +210,6 @@ builtin_macro (pfile, token)
*token = node->value.builtin == BT_DATE ? pfile->date: pfile->time;
break;
- case BT_WEAK:
- make_number_token (pfile, token, SUPPORTS_ONE_ONLY);
- break;
-
default:
cpp_ice (pfile, "invalid builtin macro \"%s\"", node->name);
break;
@@ -302,13 +292,12 @@ stringify_arg (pfile, arg)
unsigned int len = cpp_token_len (token);
escape_it = (token->type == CPP_STRING || token->type == CPP_WSTRING
- || token->type == CPP_CHAR || token->type == CPP_WCHAR
- || token->type == CPP_OSTRING);
+ || token->type == CPP_CHAR || token->type == CPP_WCHAR);
if (escape_it)
/* Worst case is each char is octal. */
len *= 4;
- len++; /* Room for initial space. */
+ len += 2; /* Room for initial space and final NUL. */
dest = &start[total_len];
if (dest + len > POOL_LIMIT (pool))
@@ -346,7 +335,9 @@ stringify_arg (pfile, arg)
total_len--;
}
- POOL_COMMIT (pool, total_len);
+ /* Null terminate, and commit the memory. */
+ start[total_len] = '\0';
+ POOL_COMMIT (pool, total_len + 1);
arg->stringified = xnew (cpp_token);
arg->stringified->flags = 0;
@@ -562,7 +553,7 @@ parse_args (pfile, node)
if (argc + 1 == macro->paramc && macro->variadic)
{
- if (CPP_PEDANTIC (pfile))
+ if (CPP_PEDANTIC (pfile) && ! macro->syshdr)
cpp_pedwarn (pfile, "ISO C99 requires rest arguments to be used");
}
else
@@ -613,10 +604,11 @@ funlike_invocation_p (pfile, node, list)
cpp_start_lookahead (pfile);
cpp_get_token (pfile, &maybe_paren);
cpp_stop_lookahead (pfile, maybe_paren.type == CPP_OPEN_PAREN);
+ pfile->state.parsing_args = 2;
if (maybe_paren.type == CPP_OPEN_PAREN)
args = parse_args (pfile, node);
- else if (CPP_WTRADITIONAL (pfile))
+ else if (CPP_WTRADITIONAL (pfile) && ! node->value.macro->syshdr)
cpp_warning (pfile,
"function-like macro \"%s\" must be used with arguments in traditional C",
node->name);
@@ -626,11 +618,12 @@ funlike_invocation_p (pfile, node, list)
pfile->state.prevent_expansion--;
pfile->state.parsing_args = 0;
+ /* Reset the position in case of failure. If success, the macro's
+ expansion appears where the name would have. */
+ pfile->lexer_pos = macro_pos;
+
if (args)
{
- /* The macro's expansion appears where the name would have. */
- pfile->lexer_pos = macro_pos;
-
if (node->value.macro->paramc > 0)
{
/* Don't save tokens during pre-expansion. */
@@ -675,16 +668,12 @@ enter_macro_context (pfile, node)
list.limit = macro->expansion + macro->count;
}
- /* Only push a macro context for non-empty replacement lists. */
- if (list.first != list.limit)
- {
- context = next_context (pfile);
- context->list = list;
- context->macro = macro;
+ context = next_context (pfile);
+ context->list = list;
+ context->macro = macro;
- /* Disable the macro within its expansion. */
- macro->disabled = 1;
- }
+ /* Disable the macro within its expansion. */
+ macro->disabled = 1;
return 1;
}
@@ -995,6 +984,18 @@ cpp_get_token (pfile, token)
save_lookahead_token (pfile, token);
}
+/* Returns true if we're expanding an object-like macro that was
+ 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_macro *macro = pfile->context->macro;
+
+ return macro && macro->syshdr;
+}
+
/* Read each token in, until EOF. Directives are transparently
processed. */
void
@@ -1165,9 +1166,9 @@ _cpp_push_token (pfile, token, pos)
/* #define directive parsing and handling. */
-/* Returns non-zero if a macro redefinition is trivial. */
+/* Returns non-zero if a macro redefinition warning is required. */
static int
-check_macro_redefinition (pfile, node, macro2)
+warn_of_redefinition (pfile, node, macro2)
cpp_reader *pfile;
const cpp_hashnode *node;
const cpp_macro *macro2;
@@ -1175,9 +1176,12 @@ check_macro_redefinition (pfile, node, macro2)
const cpp_macro *macro1;
unsigned int i;
- if (node->type != NT_MACRO || node->flags & NODE_BUILTIN)
- return ! pfile->done_initializing;
+ /* Some redefinitions need to be warned about regardless. */
+ if (node->flags & NODE_WARN)
+ return 1;
+ /* Redefinition of a macro is allowed if and only if the old and new
+ definitions are the same. (6.10.3 paragraph 2). */
macro1 = node->value.macro;
/* The quick failures. */
@@ -1185,19 +1189,19 @@ check_macro_redefinition (pfile, node, macro2)
|| macro1->paramc != macro2->paramc
|| macro1->fun_like != macro2->fun_like
|| macro1->variadic != macro2->variadic)
- return 0;
+ return 1;
/* Check each token. */
for (i = 0; i < macro1->count; i++)
if (! _cpp_equiv_tokens (&macro1->expansion[i], &macro2->expansion[i]))
- return 0;
+ return 1;
/* Check parameter spellings. */
for (i = 0; i < macro1->paramc; i++)
if (macro1->params[i] != macro2->params[i])
- return 0;
+ return 1;
- return 1;
+ return 0;
}
/* Free the definition of hashnode H. */
@@ -1389,9 +1393,6 @@ _cpp_create_definition (pfile, node)
else if (token->type != CPP_EOF && !(token->flags & PREV_WHITE))
cpp_pedwarn (pfile, "ISO C requires whitespace after the macro name");
- /* Setting it here means we don't catch leading comments. */
- pfile->state.save_comments = ! CPP_OPTION (pfile, discard_comments);
-
for (;;)
{
/* Check the stringifying # constraint 6.10.3.2.1 of
@@ -1453,22 +1454,21 @@ _cpp_create_definition (pfile, node)
&& macro->expansion[0].type == CPP_NAME
&& macro->expansion[0].val.node == node);
+ /* To suppress some diagnostics. */
+ macro->syshdr = pfile->buffer->sysp != 0;
+
/* Commit the memory. */
POOL_COMMIT (&pfile->macro_pool, macro->count * sizeof (cpp_token));
- /* Redefinition of a macro is allowed if and only if the old and new
- definitions are the same. (6.10.3 paragraph 2). */
if (node->type != NT_VOID)
{
- if (CPP_PEDANTIC (pfile)
- && !check_macro_redefinition (pfile, node, macro))
+ if (warn_of_redefinition (pfile, node, macro))
{
cpp_pedwarn_with_line (pfile, pfile->directive_pos.line,
pfile->directive_pos.col,
"\"%s\" redefined", node->name);
- if (pfile->done_initializing && node->type == NT_MACRO
- && !(node->flags & NODE_BUILTIN))
+ if (node->type == NT_MACRO && !(node->flags & NODE_BUILTIN))
cpp_pedwarn_with_file_and_line (pfile,
node->value.macro->file,
node->value.macro->line, 1,
@@ -1480,6 +1480,8 @@ _cpp_create_definition (pfile, node)
/* Enter definition in hash table. */
node->type = NT_MACRO;
node->value.macro = macro;
+ if (! ustrncmp (node->name, DSC ("__STDC_")))
+ node->flags |= NODE_WARN;
cleanup:
diff --git a/gcc/cppmain.c b/gcc/cppmain.c
index a68d19cf9db..db7f0736fea 100644
--- a/gcc/cppmain.c
+++ b/gcc/cppmain.c
@@ -238,6 +238,13 @@ scan_buffer (pfile)
== AVOID_LPASTE
&& cpp_avoid_paste (pfile, &tokens[1 - index], token))
token->flags |= PREV_WHITE;
+ /* Special case '# <directive name>': insert a space between
+ the # and the token. This will prevent it from being
+ treated as a directive when this code is re-preprocessed.
+ XXX Should do this only at the beginning of a line, but how? */
+ else if (token->type == CPP_NAME && token->val.node->directive_index
+ && tokens[1 - index].type == CPP_HASH)
+ token->flags |= PREV_WHITE;
cpp_output_token (token, print.outf);
print.printed = 1;
@@ -271,9 +278,6 @@ printer_init (pfile)
print.lineno = 0;
print.printed = 0;
- if (options->out_fname == NULL)
- options->out_fname = "";
-
if (options->out_fname[0] == '\0')
print.outf = stdout;
else
@@ -350,7 +354,7 @@ cb_ident (pfile, str)
const cpp_string * str;
{
maybe_print_line (cpp_get_line (pfile)->output_line);
- fprintf (print.outf, "#ident \"%.*s\"\n", (int) str->len, str->text);
+ fprintf (print.outf, "#ident \"%s\"\n", str->text);
print.lineno++;
}
diff --git a/gcc/cppspec.c b/gcc/cppspec.c
index e5ad4e4f55f..8fe45f1ef38 100644
--- a/gcc/cppspec.c
+++ b/gcc/cppspec.c
@@ -103,6 +103,9 @@ lang_specific_driver (in_argc, in_argv, in_added_libraries)
int i, j, quote = 0;
const char **new_argv;
int new_argc;
+ extern int is_cpp_driver;
+
+ is_cpp_driver = 1;
/* First pass. If we see an -S or -c, barf. If we see an input file,
turn off read_stdin. If we see a second input file, it is actually
diff --git a/gcc/cross-make b/gcc/cross-make
index fef123c40cd..241edba8ad0 100644
--- a/gcc/cross-make
+++ b/gcc/cross-make
@@ -9,6 +9,3 @@ SYSTEM_HEADER_DIR = $(CROSS_SYSTEM_HEADER_DIR)
# Don't try to compile the things we can't compile.
ALL = all.cross
-
-# Don't install assert.h in /usr/local/include.
-assertdir = $(tooldir)/include
diff --git a/gcc/crtstuff.c b/gcc/crtstuff.c
index f51cf16da03..8259f693040 100644
--- a/gcc/crtstuff.c
+++ b/gcc/crtstuff.c
@@ -58,16 +58,15 @@ Boston, MA 02111-1307, USA. */
#include "auto-host.h"
#include "tm.h"
#include "tsystem.h"
-
-#include "frame.h"
+#include "unwind-dw2-fde.h"
#ifndef CRT_CALL_STATIC_FUNCTION
# define CRT_CALL_STATIC_FUNCTION(func) func ()
#endif
/* We do not want to add the weak attribute to the declarations of these
- routines in frame.h because that will cause the definition of these
- symbols to be weak as well.
+ routines in unwind-dw2-fde.h because that will cause the definition of
+ these symbols to be weak as well.
This exposes a core issue, how to handle creating weak references vs
how to create weak definitions. Either we have to have the definition
@@ -89,9 +88,13 @@ Boston, MA 02111-1307, USA. */
be weak in this file if at all possible. */
extern void __register_frame_info (void *, struct object *)
TARGET_ATTRIBUTE_WEAK;
-
+extern void __register_frame_info_bases (void *, struct object *,
+ void *, void *)
+ TARGET_ATTRIBUTE_WEAK;
extern void *__deregister_frame_info (void *)
TARGET_ATTRIBUTE_WEAK;
+extern void *__deregister_frame_info_bases (void *)
+ TARGET_ATTRIBUTE_WEAK;
#ifndef OBJECT_FORMAT_MACHO
@@ -189,9 +192,10 @@ static void
__do_global_dtors_aux (void)
{
static func_ptr *p = __DTOR_LIST__ + 1;
- static int completed = 0;
+ static int completed;
+ func_ptr f;
- if (completed)
+ if (__builtin_expect (completed, 0))
return;
#ifdef CRTSTUFFS_O
@@ -199,16 +203,24 @@ __do_global_dtors_aux (void)
__cxa_finalize (__dso_handle);
#endif
- while (*p)
+ while ((f = *p))
{
p++;
- (*(p-1)) ();
+ f ();
}
#ifdef EH_FRAME_SECTION_ASM_OP
+#if defined(CRT_GET_RFIB_TEXT) || defined(CRT_GET_RFIB_DATA)
+ /* If we used the new __register_frame_info_bases interface,
+ make sure that we deregister from the same place. */
+ if (__deregister_frame_info_bases)
+ __deregister_frame_info_bases (__EH_FRAME_BEGIN__);
+#else
if (__deregister_frame_info)
__deregister_frame_info (__EH_FRAME_BEGIN__);
#endif
+#endif
+
completed = 1;
}
@@ -235,8 +247,24 @@ static void
frame_dummy (void)
{
static struct object object;
+#if defined(CRT_GET_RFIB_TEXT) || defined(CRT_GET_RFIB_DATA)
+ void *tbase, *dbase;
+#ifdef CRT_GET_RFIB_TEXT
+ CRT_GET_RFIB_TEXT (tbase);
+#else
+ tbase = 0;
+#endif
+#ifdef CRT_GET_RFIB_DATA
+ CRT_GET_RFIB_DATA (dbase);
+#else
+ dbase = 0;
+#endif
+ if (__register_frame_info_bases)
+ __register_frame_info_bases (__EH_FRAME_BEGIN__, &object, tbase, dbase);
+#else
if (__register_frame_info)
__register_frame_info (__EH_FRAME_BEGIN__, &object);
+#endif
}
static void __attribute__ ((__unused__))
@@ -316,9 +344,9 @@ static func_ptr __DTOR_LIST__[];
void
__do_global_dtors (void)
{
- func_ptr *p;
- for (p = __DTOR_LIST__ + 1; *p; p++)
- (*p) ();
+ func_ptr *p, f;
+ for (p = __DTOR_LIST__ + 1; (f = *p); p++)
+ f ();
#ifdef EH_FRAME_SECTION_ASM_OP
if (__deregister_frame_info)
@@ -413,20 +441,8 @@ init_dummy (void)
FORCE_INIT_SECTION_ALIGN;
#endif
asm (TEXT_SECTION_ASM_OP);
-
-/* This is a kludge. The i386 GNU/Linux dynamic linker needs ___brk_addr,
- __environ and atexit (). We have to make sure they are in the .dynsym
- section. We accomplish it by making a dummy call here. This
- code is never reached. */
-
-#if defined(__linux__) && defined(__PIC__) && defined(__i386__)
- {
- extern void *___brk_addr;
- extern char **__environ;
-
- ___brk_addr = __environ;
- atexit (0);
- }
+#ifdef CRT_END_INIT_DUMMY
+ CRT_END_INIT_DUMMY;
#endif
}
diff --git a/gcc/cse.c b/gcc/cse.c
index e69bb634ebb..42d756b2e68 100644
--- a/gcc/cse.c
+++ b/gcc/cse.c
@@ -2277,10 +2277,10 @@ canon_hash (x, mode)
&& (global_regs[regno]
|| (SMALL_REGISTER_CLASSES
&& ! fixed_regs[regno]
- && regno != FRAME_POINTER_REGNUM
- && regno != HARD_FRAME_POINTER_REGNUM
- && regno != ARG_POINTER_REGNUM
- && regno != STACK_POINTER_REGNUM
+ && x != frame_pointer_rtx
+ && x != hard_frame_pointer_rtx
+ && x != arg_pointer_rtx
+ && x != stack_pointer_rtx
&& GET_MODE_CLASS (GET_MODE (x)) != MODE_CC)))
{
do_not_record = 1;
@@ -3910,15 +3910,15 @@ fold_rtx (x, insn)
if (const_arg0 == 0 || const_arg1 == 0)
{
struct table_elt *p0, *p1;
- rtx true = const_true_rtx, false = const0_rtx;
+ rtx true_rtx = const_true_rtx, false_rtx = const0_rtx;
enum machine_mode mode_arg1;
#ifdef FLOAT_STORE_FLAG_VALUE
if (GET_MODE_CLASS (mode) == MODE_FLOAT)
{
- true = (CONST_DOUBLE_FROM_REAL_VALUE
+ true_rtx = (CONST_DOUBLE_FROM_REAL_VALUE
(FLOAT_STORE_FLAG_VALUE (mode), mode));
- false = CONST0_RTX (mode);
+ false_rtx = CONST0_RTX (mode);
}
#endif
@@ -3952,9 +3952,9 @@ fold_rtx (x, insn)
|| GET_CODE (folded_arg0) == CONST))
{
if (code == EQ)
- return false;
+ return false_rtx;
else if (code == NE)
- return true;
+ return true_rtx;
}
/* See if the two operands are the same. */
@@ -3978,12 +3978,12 @@ fold_rtx (x, insn)
return ((code == EQ || code == LE || code == GE
|| code == LEU || code == GEU || code == UNEQ
|| code == UNLE || code == UNGE || code == ORDERED)
- ? true : false);
+ ? true_rtx : false_rtx);
/* Take care for the FP compares we can resolve. */
if (code == UNEQ || code == UNLE || code == UNGE)
- return true;
+ return true_rtx;
if (code == LTGT || code == LT || code == GT)
- return false;
+ return false_rtx;
}
/* If FOLDED_ARG0 is a register, see if the comparison we are
@@ -4008,7 +4008,7 @@ fold_rtx (x, insn)
|| (GET_CODE (folded_arg1) == REG
&& (REG_QTY (REGNO (folded_arg1)) == ent->comparison_qty))))
return (comparison_dominates_p (ent->comparison_code, code)
- ? true : false);
+ ? true_rtx : false_rtx);
}
}
}
@@ -4032,30 +4032,30 @@ fold_rtx (x, insn)
int has_sign = (HOST_BITS_PER_WIDE_INT >= sign_bitnum
&& (INTVAL (inner_const)
& ((HOST_WIDE_INT) 1 << sign_bitnum)));
- rtx true = const_true_rtx, false = const0_rtx;
+ rtx true_rtx = const_true_rtx, false_rtx = const0_rtx;
#ifdef FLOAT_STORE_FLAG_VALUE
if (GET_MODE_CLASS (mode) == MODE_FLOAT)
{
- true = (CONST_DOUBLE_FROM_REAL_VALUE
+ true_rtx = (CONST_DOUBLE_FROM_REAL_VALUE
(FLOAT_STORE_FLAG_VALUE (mode), mode));
- false = CONST0_RTX (mode);
+ false_rtx = CONST0_RTX (mode);
}
#endif
switch (code)
{
case EQ:
- return false;
+ return false_rtx;
case NE:
- return true;
+ return true_rtx;
case LT: case LE:
if (has_sign)
- return true;
+ return true_rtx;
break;
case GT: case GE:
if (has_sign)
- return false;
+ return false_rtx;
break;
default:
break;
@@ -5060,18 +5060,16 @@ cse_insn (insn, libcall_insn)
sets[i].src_in_memory = hash_arg_in_memory;
/* If SRC is a MEM, there is a REG_EQUIV note for SRC, and DEST is
- a pseudo that is set more than once, do not record SRC. Using
- SRC as a replacement for anything else will be incorrect in that
- situation. Note that this usually occurs only for stack slots,
- in which case all the RTL would be referring to SRC, so we don't
- lose any optimization opportunities by not having SRC in the
- hash table. */
+ a pseudo, do not record SRC. Using SRC as a replacement for
+ anything else will be incorrect in that situation. Note that
+ this usually occurs only for stack slots, in which case all the
+ RTL would be referring to SRC, so we don't lose any optimization
+ opportunities by not having SRC in the hash table. */
if (GET_CODE (src) == MEM
- && find_reg_note (insn, REG_EQUIV, src) != 0
+ && find_reg_note (insn, REG_EQUIV, NULL_RTX) != 0
&& GET_CODE (dest) == REG
- && REGNO (dest) >= FIRST_PSEUDO_REGISTER
- && REG_N_SETS (REGNO (dest)) != 1)
+ && REGNO (dest) >= FIRST_PSEUDO_REGISTER)
sets[i].src_volatile = 1;
#if 0
@@ -5513,31 +5511,17 @@ cse_insn (insn, libcall_insn)
check for this separately here. We will delete such an
insn below.
- Tablejump insns contain a USE of the table, so simply replacing
- the operand with the constant won't match. This is simply an
- unconditional branch, however, and is therefore valid. Just
- insert the substitution here and we will delete and re-emit
- the insn later. */
-
+ For other cases such as a table jump or conditional jump
+ where we know the ultimate target, go ahead and replace the
+ operand. While that may not make a valid insn, we will
+ reemit the jump below (and also insert any necessary
+ barriers). */
if (n_sets == 1 && dest == pc_rtx
&& (trial == pc_rtx
|| (GET_CODE (trial) == LABEL_REF
&& ! condjump_p (insn))))
{
- if (trial == pc_rtx)
- {
- SET_SRC (sets[i].rtl) = trial;
- cse_jumps_altered = 1;
- break;
- }
-
- PATTERN (insn) = gen_jump (XEXP (trial, 0));
- INSN_CODE (insn) = -1;
-
- if (NEXT_INSN (insn) != 0
- && GET_CODE (NEXT_INSN (insn)) != BARRIER)
- emit_barrier_after (insn);
-
+ SET_SRC (sets[i].rtl) = trial;
cse_jumps_altered = 1;
break;
}
@@ -5799,13 +5783,17 @@ cse_insn (insn, libcall_insn)
}
/* If this SET is now setting PC to a label, we know it used to
- be a conditional or computed branch. So we see if we can follow
- it. If it was a computed branch, delete it and re-emit. */
+ be a conditional or computed branch. */
else if (dest == pc_rtx && GET_CODE (src) == LABEL_REF)
{
- /* If this is not in the format for a simple branch and
- we are the only SET in it, re-emit it. */
- if (! simplejump_p (insn) && n_sets == 1)
+ /* We reemit the jump in as many cases as possible just in
+ case the form of an unconditional jump is significantly
+ different than a computed jump or conditional jump.
+
+ If this insn has multiple sets, then reemitting the
+ jump is nontrivial. So instead we just force rerecognition
+ and hope for the best. */
+ if (n_sets == 1)
{
rtx new = emit_jump_insn_before (gen_jump (XEXP (src, 0)), insn);
JUMP_LABEL (new) = XEXP (src, 0);
@@ -5813,11 +5801,6 @@ cse_insn (insn, libcall_insn)
insn = new;
}
else
- /* Otherwise, force rerecognition, since it probably had
- a different pattern before.
- This shouldn't really be necessary, since whatever
- changed the source value above should have done this.
- Until the right place is found, might as well do this here. */
INSN_CODE (insn) = -1;
never_reached_warning (insn);
@@ -6465,7 +6448,8 @@ cse_process_notes (x, object)
return x;
case MEM:
- XEXP (x, 0) = cse_process_notes (XEXP (x, 0), x);
+ validate_change (x, &XEXP (x, 0),
+ cse_process_notes (XEXP (x, 0), x), 0);
return x;
case EXPR_LIST:
diff --git a/gcc/dbxout.c b/gcc/dbxout.c
index 4c4a61a6b6b..fd32b4addb4 100644
--- a/gcc/dbxout.c
+++ b/gcc/dbxout.c
@@ -124,6 +124,13 @@ Boston, MA 02111-1307, USA. */
#define FILE_NAME_JOINER "/"
#endif
+/* GDB needs to know that the stabs were generated by GCC. We emit an
+ N_OPT stab at the beginning of the source file to indicate this.
+ The string is historical, and different on a very few targets. */
+#ifndef STABS_GCC_MARKER
+#define STABS_GCC_MARKER "gcc2_compiled."
+#endif
+
/* Nonzero means if the type has methods, only output debugging
information if methods are actually written to the asm file. This
optimization only works if the debugger can detect the special C++
@@ -176,6 +183,11 @@ static int source_label_number = 1;
#ifndef N_CATCH
#define N_CATCH 0x54
#endif
+
+/* This is a Solaris extension we need to reference in this file. */
+#ifndef N_OPT
+#define N_OPT 0x3c
+#endif
#endif
#ifdef __GNU_STAB__
@@ -416,11 +428,12 @@ dbxout_init (asm_file, input_file_name, syms)
ASM_OUTPUT_INTERNAL_LABEL (asmfile, "Ltext", 0);
#endif /* no DBX_OUTPUT_MAIN_SOURCE_FILENAME */
- /* Possibly output something to inform GDB that this compilation was by
- GCC. It's easier for GDB to parse it when after the N_SO's. This
- is used in Solaris 2. */
-#ifdef ASM_IDENTIFY_GCC_AFTER_SOURCE
- ASM_IDENTIFY_GCC_AFTER_SOURCE (asmfile);
+#ifdef DBX_OUTPUT_GCC_MARKER
+ DBX_OUTPUT_GCC_MARKER (asmfile);
+#else
+ /* Emit an N_OPT stab to indicate that this file was compiled by GCC. */
+ fprintf (asmfile, "%s\"%s\",%d,0,0,0\n",
+ ASM_STABS_OP, STABS_GCC_MARKER, N_OPT);
#endif
lastfile = input_file_name;
@@ -833,15 +846,25 @@ dbxout_type_methods (type)
{
/* This is the "mangled" name of the method.
It encodes the argument types. */
- const char *debug_name =
- IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (fndecl));
+ const char *debug_name;
int show_arg_types = 0;
+ /* Skip methods that aren't FUNCTION_DECLs. (In C++, these
+ include TEMPLATE_DECLs.) The debugger doesn't know what
+ to do with such entities anyhow. */
+ if (TREE_CODE (fndecl) != FUNCTION_DECL)
+ continue;
+
+ debug_name =
+ IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (fndecl));
+
CONTIN;
last = fndecl;
- if (DECL_IGNORED_P (fndecl))
+ /* Also ignore abstract methods; those are only interesting to
+ the DWARF backends. */
+ if (DECL_IGNORED_P (fndecl) || DECL_ABSTRACT (fndecl))
continue;
if (flag_minimal_debug)
@@ -1419,9 +1442,17 @@ dbxout_type (type, full, show_arg_types)
have_used_extensions = 1;
putc (TREE_VIA_VIRTUAL (child) ? '1' : '0', asmfile);
putc (TREE_VIA_PUBLIC (child) ? '2' : '0', asmfile);
- fprintf (asmfile, HOST_WIDE_INT_PRINT_DEC,
- (tree_low_cst (BINFO_OFFSET (child), 0)
- * BITS_PER_UNIT));
+ if (TREE_VIA_VIRTUAL (child) && strcmp (language_string, "GNU C++") == 0)
+ /* For a virtual base, print the (negative) offset within
+ the vtable where we must look to find the necessary
+ adjustment. */
+ fprintf (asmfile, HOST_WIDE_INT_PRINT_DEC,
+ (tree_low_cst (BINFO_VPTR_FIELD (child), 0)
+ * BITS_PER_UNIT));
+ else
+ fprintf (asmfile, HOST_WIDE_INT_PRINT_DEC,
+ (tree_low_cst (BINFO_OFFSET (child), 0)
+ * BITS_PER_UNIT));
fputc (',', asmfile);
CHARS (15);
dbxout_type (BINFO_TYPE (child), 0, 0);
@@ -1925,7 +1956,7 @@ dbxout_symbol (decl, local)
case RESULT_DECL:
/* Named return value, treat like a VAR_DECL. */
case VAR_DECL:
- if (DECL_RTL (decl) == 0)
+ if (! DECL_RTL_SET_P (decl))
return 0;
/* Don't mention a variable that is external.
Let the file that defines it describe it. */
@@ -1969,7 +2000,7 @@ dbxout_symbol (decl, local)
/* else it is something we handle like a normal variable. */
}
- DECL_RTL (decl) = eliminate_regs (DECL_RTL (decl), 0, NULL_RTX);
+ SET_DECL_RTL (decl, eliminate_regs (DECL_RTL (decl), 0, NULL_RTX));
#ifdef LEAF_REG_REMAP
if (current_function_uses_only_leaf_regs)
leaf_renumber_regs_insn (DECL_RTL (decl));
@@ -2159,7 +2190,15 @@ dbxout_symbol_location (decl, type, suffix, home)
}
else if (GET_CODE (home) == CONCAT)
{
- tree subtype = TREE_TYPE (type);
+ tree subtype;
+
+ /* If TYPE is not a COMPLEX_TYPE (it might be a RECORD_TYPE,
+ for example), then there is no easy way to figure out
+ what SUBTYPE should be. So, we give up. */
+ if (TREE_CODE (type) != COMPLEX_TYPE)
+ return 0;
+
+ subtype = TREE_TYPE (type);
/* If the variable's storage is in two parts,
output each as a separate stab with a modified name. */
@@ -2305,7 +2344,7 @@ dbxout_parms (parms)
so that the debugging output will be accurate. */
DECL_INCOMING_RTL (parms)
= eliminate_regs (DECL_INCOMING_RTL (parms), 0, NULL_RTX);
- DECL_RTL (parms) = eliminate_regs (DECL_RTL (parms), 0, NULL_RTX);
+ SET_DECL_RTL (parms, eliminate_regs (DECL_RTL (parms), 0, NULL_RTX));
#ifdef LEAF_REG_REMAP
if (current_function_uses_only_leaf_regs)
{
diff --git a/gcc/defaults.h b/gcc/defaults.h
index 20ea99ab62c..7f6790b42cf 100644
--- a/gcc/defaults.h
+++ b/gcc/defaults.h
@@ -102,16 +102,6 @@ do { ASM_OUTPUT_LABEL(FILE,LABEL_ALTERNATE_NAME (INSN)); } while (0)
while (0)
#endif
-#ifndef ASM_IDENTIFY_GCC
- /* Default the definition, only if ASM_IDENTIFY_GCC is not set,
- because if it is set, we might not want ASM_IDENTIFY_LANGUAGE
- outputting labels, if we do want it to, then it must be defined
- in the tm.h file. */
-#ifndef ASM_IDENTIFY_LANGUAGE
-#define ASM_IDENTIFY_LANGUAGE(FILE) output_lang_identify (FILE);
-#endif
-#endif
-
/* This is how we tell the assembler to equate two values. */
#ifdef SET_ASM_OP
#ifndef ASM_OUTPUT_DEF
@@ -140,6 +130,20 @@ do { ASM_OUTPUT_LABEL(FILE,LABEL_ALTERNATE_NAME (INSN)); } while (0)
ASM_OUTPUT_INTERNAL_LABEL (FILE, PREFIX, NUM)
#endif
+/* This is how we tell the assembler that a symbol is weak. */
+#ifndef ASM_OUTPUT_WEAK_ALIAS
+#if defined (ASM_WEAKEN_LABEL) && defined (ASM_OUTPUT_DEF)
+#define ASM_OUTPUT_WEAK_ALIAS(STREAM, NAME, VALUE) \
+ do \
+ { \
+ ASM_WEAKEN_LABEL (STREAM, NAME); \
+ if (VALUE) \
+ ASM_OUTPUT_DEF (STREAM, NAME, VALUE); \
+ } \
+ while (0)
+#endif
+#endif
+
/* This determines whether or not we support weak symbols. */
#ifndef SUPPORTS_WEAK
#ifdef ASM_WEAKEN_LABEL
@@ -180,6 +184,13 @@ do { ASM_OUTPUT_LABEL(FILE,LABEL_ALTERNATE_NAME (INSN)); } while (0)
#define SUPPORTS_INIT_PRIORITY 1
#endif /* SUPPORTS_INIT_PRIORITY */
+/* If duplicate library search directories can be removed from a
+ linker command without changing the linker's semantics, give this
+ symbol a nonzero. */
+#ifndef LINK_ELIMINATE_DUPLICATE_LDIRECTORIES
+#define LINK_ELIMINATE_DUPLICATE_LDIRECTORIES 0
+#endif /* LINK_ELIMINATE_DUPLICATE_LDIRECTORIES */
+
/* If we have a definition of INCOMING_RETURN_ADDR_RTX, assume that
the rest of the DWARF 2 frame unwind support is also provided. */
#if !defined (DWARF2_UNWIND_INFO) && defined (INCOMING_RETURN_ADDR_RTX)
@@ -304,5 +315,53 @@ do { \
#endif
#endif
+/* By default, the C++ compiler will use the lowest bit of the pointer
+ to function to indicate a pointer-to-member-function points to a
+ virtual member function. However, if FUNCTION_BOUNDARY indicates
+ function addresses aren't always even, the lowest bit of the delta
+ field will be used. */
+#ifndef TARGET_PTRMEMFUNC_VBIT_LOCATION
+#define TARGET_PTRMEMFUNC_VBIT_LOCATION \
+ (FUNCTION_BOUNDARY >= 2 * BITS_PER_UNIT \
+ ? ptrmemfunc_vbit_in_pfn : ptrmemfunc_vbit_in_delta)
+#endif
+
+/* By default, the C++ compiler will use function addresses in the
+ vtable entries. Setting this non-zero tells the compiler to use
+ function descriptors instead. The value of this macro says how
+ many words wide the descriptor is (normally 2). It is assumed
+ that the address of a function descriptor may be treated as a
+ pointer to a function. */
+#ifndef TARGET_VTABLE_USES_DESCRIPTORS
+#define TARGET_VTABLE_USES_DESCRIPTORS 0
+#endif
+
+/* Select a format to encode pointers in exception handling data. We
+ prefer those that result in fewer dynamic relocations. Assume no
+ special support here and encode direct references. */
+#ifndef ASM_PREFERRED_EH_DATA_FORMAT
+#define ASM_PREFERRED_EH_DATA_FORMAT(CODE,GLOBAL) DW_EH_PE_absptr
+#endif
+
+/* True if it is possible to profile code that does not have a frame
+ pointer. */
+
+#ifndef TARGET_ALLOWS_PROFILING_WITHOUT_FRAME_POINTER
+#define TARGET_ALLOWS_PROFILING_WITHOUT_FRAME_POINTER true
+#endif
+
+#ifndef ACCUMULATE_OUTGOING_ARGS
+#define ACCUMULATE_OUTGOING_ARGS 0
+#endif
+
+/* Supply a default definition for PUSH_ARGS. */
+#ifndef PUSH_ARGS
+#ifdef PUSH_ROUNDING
+#define PUSH_ARGS !ACCUMULATE_OUTGOING_ARGS
+#else
+#define PUSH_ARGS 0
+#endif
+#endif
+
#endif /* GCC_DEFAULTS_H */
diff --git a/gcc/diagnostic.c b/gcc/diagnostic.c
index 11039403e27..8ac0e89199a 100644
--- a/gcc/diagnostic.c
+++ b/gcc/diagnostic.c
@@ -34,7 +34,6 @@ Boston, MA 02111-1307, USA. */
#include "flags.h"
#include "input.h"
#include "insn-attr.h"
-#include "insn-codes.h"
#include "insn-config.h"
#include "toplev.h"
#include "intl.h"
@@ -79,10 +78,8 @@ static void format_with_decl PARAMS ((output_buffer *, tree));
static void file_and_line_for_asm PARAMS ((rtx, const char **, int *));
static void diagnostic_for_asm PARAMS ((rtx, const char *, va_list *, int));
static void diagnostic_for_decl PARAMS ((tree, const char *, va_list *, int));
-static void vnotice PARAMS ((FILE *, const char *, va_list))
- ATTRIBUTE_PRINTF (2, 0);
static void set_real_maximum_length PARAMS ((output_buffer *));
-
+
static void output_unsigned_decimal PARAMS ((output_buffer *, unsigned int));
static void output_long_decimal PARAMS ((output_buffer *, long int));
static void output_long_unsigned_decimal PARAMS ((output_buffer *,
@@ -104,7 +101,6 @@ static void default_diagnostic_finalizer PARAMS ((output_buffer *,
diagnostic_context *));
static void error_recursion PARAMS ((void)) ATTRIBUTE_NORETURN;
-static const char *trim_filename PARAMS ((const char *));
extern int rtl_dump_and_exit;
extern int inhibit_warnings;
@@ -798,35 +794,35 @@ output_format (buffer)
}
static char *
-vbuild_message_string (msgid, ap)
- const char *msgid;
+vbuild_message_string (msg, ap)
+ const char *msg;
va_list ap;
{
char *str;
- vasprintf (&str, msgid, ap);
+ vasprintf (&str, msg, ap);
return str;
}
-/* Return a malloc'd string containing MSGID formatted a la
+/* Return a malloc'd string containing MSG formatted a la
printf. The caller is reponsible for freeing the memory. */
static char *
-build_message_string VPARAMS ((const char *msgid, ...))
+build_message_string VPARAMS ((const char *msg, ...))
{
#ifndef ANSI_PROTOTYPES
- const char *msgid;
+ const char *msg;
#endif
va_list ap;
char *str;
- VA_START (ap, msgid);
+ VA_START (ap, msg);
#ifndef ANSI_PROTOTYPES
- msgid = va_arg (ap, const char *);
+ msg = va_arg (ap, const char *);
#endif
- str = vbuild_message_string (msgid, ap);
+ str = vbuild_message_string (msg, ap);
va_end (ap);
@@ -845,14 +841,14 @@ context_as_prefix (file, line, warn)
if (file)
{
if (warn)
- return build_message_string ("%s:%d: warning: ", file, line);
+ return build_message_string (_("%s:%d: warning: "), file, line);
else
return build_message_string ("%s:%d: ", file, line);
}
else
{
if (warn)
- return build_message_string ("%s: warning: ", progname);
+ return build_message_string (_("%s: warning: "), progname);
else
return build_message_string ("%s: ", progname);
}
@@ -870,11 +866,11 @@ file_name_as_prefix (f)
/* Format a MESSAGE into BUFFER. Automatically wrap lines. */
static void
-output_do_printf (buffer, msgid)
+output_do_printf (buffer, msg)
output_buffer *buffer;
- const char *msgid;
+ const char *msg;
{
- char *message = vbuild_message_string (msgid,
+ char *message = vbuild_message_string (msg,
output_buffer_format_args (buffer));
wrap_text (buffer, message, message + strlen (message));
@@ -901,22 +897,11 @@ output_printf VPARAMS ((struct output_buffer *buffer, const char *msgid, ...))
#endif
old_args = output_buffer_ptr_to_format_args (buffer);
output_buffer_ptr_to_format_args (buffer) = &ap;
- output_do_printf (buffer, msgid);
+ output_do_printf (buffer, _(msgid));
output_buffer_ptr_to_format_args (buffer) = old_args;
va_end (ap);
}
-/* Print the message MSGID in FILE. */
-
-static void
-vnotice (file, msgid, ap)
- FILE *file;
- const char *msgid;
- va_list ap;
-{
- vfprintf (file, _(msgid), ap);
-}
-
/* Print a message relevant to the given DECL. */
static void
@@ -1027,9 +1012,9 @@ diagnostic_for_asm (insn, msg, args_ptr, warn)
name; subsequent substitutions are a la output_format. */
static void
-diagnostic_for_decl (decl, msg, args_ptr, warn)
+diagnostic_for_decl (decl, msgid, args_ptr, warn)
tree decl;
- const char *msg;
+ const char *msgid;
va_list *args_ptr;
int warn;
{
@@ -1046,7 +1031,7 @@ diagnostic_for_decl (decl, msg, args_ptr, warn)
(diagnostic_buffer, context_as_prefix
(DECL_SOURCE_FILE (decl), DECL_SOURCE_LINE (decl), warn));
output_buffer_ptr_to_format_args (diagnostic_buffer) = args_ptr;
- output_buffer_text_cursor (diagnostic_buffer) = msg;
+ output_buffer_text_cursor (diagnostic_buffer) = _(msgid);
format_with_decl (diagnostic_buffer, decl);
finish_diagnostic ();
output_destroy_prefix (diagnostic_buffer);
@@ -1085,7 +1070,8 @@ count_error (warningp)
return 1;
}
-/* Print a diagnistic MSGID on FILE. */
+/* Print a diagnostic MSGID on FILE. This is just fprintf, except it
+ runs its second argument through gettext. */
void
fnotice VPARAMS ((FILE *file, const char *msgid, ...))
@@ -1103,7 +1089,7 @@ fnotice VPARAMS ((FILE *file, const char *msgid, ...))
msgid = va_arg (ap, const char *);
#endif
- vnotice (file, msgid, ap);
+ vfprintf (file, _(msgid), ap);
va_end (ap);
}
@@ -1129,7 +1115,7 @@ fatal_io_error VPARAMS ((const char *msgid, ...))
output_printf (diagnostic_buffer, "%s: %s: ", progname, xstrerror (errno));
output_buffer_ptr_to_format_args (diagnostic_buffer) = &ap;
- output_buffer_text_cursor (diagnostic_buffer) = msgid;
+ output_buffer_text_cursor (diagnostic_buffer) = _(msgid);
output_format (diagnostic_buffer);
finish_diagnostic ();
output_buffer_state (diagnostic_buffer) = os;
@@ -1237,7 +1223,7 @@ sorry VPARAMS ((const char *msgid, ...))
(diagnostic_buffer, context_as_prefix (input_filename, lineno, 0));
output_printf (diagnostic_buffer, "sorry, not implemented: ");
output_buffer_ptr_to_format_args (diagnostic_buffer) = &ap;
- output_buffer_text_cursor (diagnostic_buffer) = msgid;
+ output_buffer_text_cursor (diagnostic_buffer) = _(msgid);
output_format (diagnostic_buffer);
finish_diagnostic ();
output_buffer_state (diagnostic_buffer) = os;
@@ -1279,7 +1265,7 @@ default_print_error_function (file)
output_set_prefix (diagnostic_buffer, prefix);
if (current_function_decl == NULL)
- output_add_string (diagnostic_buffer, "At top level:");
+ output_add_string (diagnostic_buffer, _("At top level:"));
else
{
if (TREE_CODE (TREE_TYPE (current_function_decl)) == METHOD_TYPE)
@@ -1423,7 +1409,7 @@ fatal_error VPARAMS ((const char *msgid, ...))
report_diagnostic (&dc);
va_end (ap);
- fprintf (stderr, "compilation terminated.\n");
+ fnotice (stderr, "compilation terminated.\n");
exit (FATAL_EXIT_CODE);
}
@@ -1458,7 +1444,7 @@ internal_error VPARAMS ((const char *msgid, ...))
if (errorcount > 0 || sorrycount > 0)
{
- fprintf (stderr, "%s:%d: confused by earlier errors, bailing out\n",
+ fnotice (stderr, "%s:%d: confused by earlier errors, bailing out\n",
input_filename, lineno);
exit (FATAL_EXIT_CODE);
}
@@ -1471,9 +1457,10 @@ internal_error VPARAMS ((const char *msgid, ...))
report_diagnostic (&dc);
va_end (ap);
- fprintf (stderr, "Please submit a full bug report, ");
- fprintf (stderr, "with preprocessed source if appropriate.\n");
- fprintf (stderr, "See %s for instructions.\n", GCCBUGURL);
+ fnotice (stderr,
+"Please submit a full bug report,\n\
+with preprocessed source if appropriate.\n\
+See %s for instructions.\n", GCCBUGURL);
exit (FATAL_EXIT_CODE);
}
@@ -1485,7 +1472,12 @@ _fatal_insn (msgid, insn, file, line, function)
int line;
const char *function;
{
- error ("%s", msgid);
+ error ("%s", _(msgid));
+
+ /* The above incremented error_count, but isn't an error that we want to
+ count, so reset it here. */
+ errorcount--;
+
debug_rtx (insn);
fancy_abort (file, line, function);
}
@@ -1605,9 +1597,9 @@ finish_diagnostic ()
settings needed by BUFFER for a verbatim formatting. */
static void
-output_do_verbatim (buffer, msg, args_ptr)
+output_do_verbatim (buffer, msgid, args_ptr)
output_buffer *buffer;
- const char *msg;
+ const char *msgid;
va_list *args_ptr;
{
output_state os;
@@ -1615,7 +1607,7 @@ output_do_verbatim (buffer, msg, args_ptr)
os = output_buffer_state (buffer);
output_prefix (buffer) = NULL;
prefixing_policy (buffer) = DIAGNOSTICS_SHOW_PREFIX_NEVER;
- output_buffer_text_cursor (buffer) = msg;
+ output_buffer_text_cursor (buffer) = _(msgid);
output_buffer_ptr_to_format_args (buffer) = args_ptr;
output_set_maximum_length (buffer, 0);
output_format (buffer);
@@ -1625,38 +1617,38 @@ output_do_verbatim (buffer, msg, args_ptr)
/* Output MESSAGE verbatim into BUFFER. */
void
-output_verbatim VPARAMS ((output_buffer *buffer, const char *msg, ...))
+output_verbatim VPARAMS ((output_buffer *buffer, const char *msgid, ...))
{
#ifndef ANSI_PROTOTYPES
output_buffer *buffer;
- const char *msg;
+ const char *msgid;
#endif
va_list ap;
- VA_START (ap, msg);
+ VA_START (ap, msgid);
#ifndef ANSI_PROTOTYPES
buffer = va_arg (ap, output_buffer *);
- msg = va_arg (ap, const char *);
+ msgid = va_arg (ap, const char *);
#endif
- output_do_verbatim (buffer, msg, &ap);
+ output_do_verbatim (buffer, msgid, &ap);
va_end (ap);
}
/* Same as above but use diagnostic_buffer. */
void
-verbatim VPARAMS ((const char *msg, ...))
+verbatim VPARAMS ((const char *msgid, ...))
{
#ifndef ANSI_PROTOTYPES
- const char *msg;
+ const char *msgid;
#endif
va_list ap;
- VA_START (ap, msg);
+ VA_START (ap, msgid);
#ifndef ANSI_PROTOTYPES
- msg = va_arg (ap, const char *);
+ msgid = va_arg (ap, const char *);
#endif
- output_do_verbatim (diagnostic_buffer, msg, &ap);
+ output_do_verbatim (diagnostic_buffer, msgid, &ap);
output_to_stream (diagnostic_buffer, stderr);
va_end (ap);
}
@@ -1693,7 +1685,8 @@ report_diagnostic (dc)
/* Inform the user that an error occurred while trying to report some
other error. This indicates catastrophic internal inconsistencies,
- so give up now. But do try to flush out the previous error. */
+ so give up now. But do try to flush out the previous error.
+ This mustn't use internal_error, that will cause infinite recursion. */
static void
error_recursion ()
@@ -1701,8 +1694,13 @@ error_recursion ()
if (diagnostic_lock < 3)
finish_diagnostic ();
- internal_error
- ("Internal compiler error: Error reporting routines re-entered.");
+ fnotice (stderr,
+ "Internal compiler error: Error reporting routines re-entered.\n");
+ fnotice (stderr,
+"Please submit a full bug report,\n\
+with preprocessed source if appropriate.\n\
+See %s for instructions.\n", GCCBUGURL);
+ exit (FATAL_EXIT_CODE);
}
/* Given a partial pathname as input, return another pathname that
@@ -1710,7 +1708,7 @@ error_recursion ()
is used by fancy_abort() to print `Internal compiler error in expr.c'
instead of `Internal compiler error in ../../GCC/gcc/expr.c'. */
-static const char *
+const char *
trim_filename (name)
const char *name;
{
@@ -1768,16 +1766,16 @@ fancy_abort (file, line, function)
by FILE and LINE. */
void
-set_diagnostic_context (dc, message, args_ptr, file, line, warn)
+set_diagnostic_context (dc, msgid, args_ptr, file, line, warn)
diagnostic_context *dc;
- const char *message;
+ const char *msgid;
va_list *args_ptr;
const char *file;
int line;
int warn;
{
memset (dc, 0, sizeof (diagnostic_context));
- diagnostic_message (dc) = message;
+ diagnostic_message (dc) = _(msgid);
diagnostic_argument_list (dc) = args_ptr;
diagnostic_file_location (dc) = file;
diagnostic_line_location (dc) = line;
diff --git a/gcc/doc/.cvsignore b/gcc/doc/.cvsignore
new file mode 100644
index 00000000000..26fdfb2454c
--- /dev/null
+++ b/gcc/doc/.cvsignore
@@ -0,0 +1,3 @@
+gcc.info*
+cpp.info*
+cppinternals.info*
diff --git a/gcc/c-tree.texi b/gcc/doc/c-tree.texi
index c62070a2787..80ed8a70001 100644
--- a/gcc/c-tree.texi
+++ b/gcc/doc/c-tree.texi
@@ -1,80 +1,40 @@
-\input texinfo
+@c Copyright (c) 1999, 2000, 2001 Free Software Foundation, Inc.
+@c Free Software Foundation, Inc.
+@c This is part of the GCC manual.
+@c For copying conditions, see the file gcc.texi.
@c ---------------------------------------------------------------------
-@c This file is part of GNU CC.
-@c
-@c GNU CC is free software; you can redistribute it and/or modify
-@c it under the terms of the GNU General Public License as published by
-@c the Free Software Foundation; either version 2, or (at your option)
-@c any later version.
-@c
-@c GNU CC is distributed in the hope that it will be useful,
-@c but WITHOUT ANY WARRANTY; without even the implied warranty of
-@c MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-@c GNU General Public License for more details.
-@c
-@c You should have received a copy of the GNU General Public License
-@c along with GNU CC; see the file COPYING. If not, write to
-@c the Free Software Foundation, 59 Temple Place - Suite 330,
-@c Boston, MA 02111-1307, USA.
-@c ---------------------------------------------------------------------
-
-@c ---------------------------------------------------------------------
-@c Prologue
-@c ---------------------------------------------------------------------
-
-@setfilename c-tree.info
-@settitle C/C++ Internal Representation
-@setchapternewpage on
-
-@ifinfo
-@dircategory Programming
-@direntry
-* c-tree: (c-tree). C/C++ Internal Representation
-@end direntry
-This manual documents the internal representation used by GCC to represent
-C and C++ source programs.
-
-Copyright (c) 1999, 2000, 2001 Free Software Foundation, Inc.
-@end ifinfo
-
-@c ---------------------------------------------------------------------
-@c Title page
-@c ---------------------------------------------------------------------
-
-@titlepage
-@title C/C++ Internal Representation
-@author CodeSourcery, LLC <info@@codesourcery.com>
-@page
-@vskip 0pt plus 1filll
-Copyright @copyright{} 1999, 2000, 2001 Free Software Foundation, Inc.
-@end titlepage
-
-@c ---------------------------------------------------------------------
-@c Top
+@c Trees
@c ---------------------------------------------------------------------
-@node Top
-@top C/C++ Internal Representation
+@node Trees
+@chapter Trees: The intermediate representation used by the C and C++ front ends
+@cindex Trees
+@cindex C/C++ Internal Representation
-This manual documents the internal representation used by GCC and C++ to
+This chapter documents the internal representation used by GCC and C++ to
represent C and C++ source programs. When presented with a C or C++
source program, GCC parses the program, performs semantic analysis
(including the generation of error messages), and then produces the
internal representation described here. This representation contains a
complete representation for the entire translation unit provided as
-input to the front-end. This representation is then typically processed
+input to the front end. This representation is then typically processed
by a code-generator in order to produce machine code, but could also be
used in the creation of source browsers, intelligent editors, automatic
documentation generators, interpreters, and any other programs needing
the ability to process C or C++ code.
-This manual explains the internal representation. In particular, this
-manual documents the internal representation for C and C++ source
+This chapter explains the internal representation. In particular, it
+documents the internal representation for C and C++ source
constructs, and the macros, functions, and variables that can be used to
-access these constructs.
+access these constructs. The C++ representation which is largely a superset
+of the representation used in the C front end. There is only one
+construct used in C that does not appear in the C++ front end and that
+is the GNU ``nested function'' extension. Many of the macros documented
+here do not apply in C because the corresponding language constructs do
+not appear in C@.
-If you are developing a ``back-end'', be it is a code-generator or some
+If you are developing a ``back end'', be it is a code-generator or some
other tool, that uses this representation, you may occasionally find
that you need to ask questions not easily answered by the functions and
macros available here. If that situation occurs, it is quite likely
@@ -82,28 +42,19 @@ that GCC already supports the functionality you desire, but that the
interface is simply not documented here. In that case, you should ask
the GCC maintainers (via mail to @email{gcc@@gcc.gnu.org}) about
documenting the functionality you require. Similarly, if you find
-yourself writing functions that do not deal directly with your back-end,
-but instead might be useful to other people using the GCC front-end, you
-should submit your patches for inclusion in GCC.
-
-This manual documents the C++ representation which is largely a superset
-of the representation used in the C front-end. There is only one
-construct used in C that does not appear in the C++ front-end and that
-is the GNU ``nested function'' extension. Many of the macros documented
-here do not apply in C because the corresponding language constructs do
-not appear in C.
+yourself writing functions that do not deal directly with your back end,
+but instead might be useful to other people using the GCC front end, you
+should submit your patches for inclusion in GCC@.
@menu
* Deficiencies:: Topics net yet covered in this document.
-* Overview:: All about @code{tree}s.
-* Types:: Fundamental and aggregate types.
+* Tree overview:: All about @code{tree}s.
+* Types:: Fundamental and aggregate types.
* Scopes:: Namespaces and classes.
* Functions:: Overloading, function bodies, and linkage.
* Declarations:: Type declarations and variables.
-* Expressions:: From @code{typeid} to @code{throw}.
-* Node Index:: The various types of tree nodes.
-* Function Index:: Functions and macros described in this manual.
-* Concept Index:: Index.
+* Attributes:: Declaration and type attributes.
+* Expression trees:: From @code{typeid} to @code{throw}.
@end menu
@c ---------------------------------------------------------------------
@@ -111,7 +62,7 @@ not appear in C.
@c ---------------------------------------------------------------------
@node Deficiencies
-@chapter Deficiencies
+@section Deficiencies
There are many places in which this document is incomplet and incorrekt.
It is, as of yet, only @emph{preliminary} documentation.
@@ -120,8 +71,8 @@ It is, as of yet, only @emph{preliminary} documentation.
@c Overview
@c ---------------------------------------------------------------------
-@node Overview
-@chapter Overview
+@node Tree overview
+@section Overview
@cindex tree
@findex TREE_CODE
@@ -138,7 +89,7 @@ return trees as output. However, most macros require a certain kinds of
tree node as input. In other words, there is a type-system for trees,
but it is not reflected in the C type-system.
-For safety, it is useful to configure G++ with @code{--enable-checking}.
+For safety, it is useful to configure GCC with @option{--enable-checking}.
Although this results in a significant performance penalty (since all
tree types are checked at run-time), and is therefore inappropriate in a
release version, it is extremely helpful during the development process.
@@ -159,7 +110,7 @@ int i = (TEST_P (t) != 0);
@noindent
are legal. Macros that return @code{int} values now may be changed to
return @code{tree} values, or other pointers in the future. Even those
-that continue to return @code{int} may return multiple non-zero codes
+that continue to return @code{int} may return multiple nonzero codes
where previously they returned only zero and one. Therefore, you should
not write code like
@example
@@ -184,7 +135,7 @@ The @code{error_mark_node} is a special tree. Its tree code is
the usual practice is to compare the tree against
@code{error_mark_node}. (This test is just a test for pointer
equality.) If an error has occurred during front-end processing the
-flag @code{errorcount} will be set. If the front-end has encountered
+flag @code{errorcount} will be set. If the front end has encountered
code it cannot handle, it will issue a message to the user and set
@code{sorrycount}. When these flags are set, any macro or function
which normally returns a tree of a particular kind may instead return
@@ -194,21 +145,21 @@ erroneous code, you must be prepared to deal with the
Occasionally, a particular tree slot (like an operand to an expression,
or a particular field in a declaration) will be referred to as
-``reserved for the back-end.'' These slots are used to store RTL when
-the tree is converted to RTL for use by the GCC back-end. However, if
-that process is not taking place (e.g., if the front-end is being hooked
+``reserved for the back end.'' These slots are used to store RTL when
+the tree is converted to RTL for use by the GCC back end. However, if
+that process is not taking place (e.g., if the front end is being hooked
up to an intelligent editor), then those slots may be used by the
-back-end presently in use.
+back end presently in use.
If you encounter situations that do not match this documentation, such
as tree nodes of types not mentioned here, or macros documented to
return entities of a particular kind that instead return entities of
-some different kind, you have found a bug, either in the front-end or in
+some different kind, you have found a bug, either in the front end or in
the documentation. Please report these bugs as you would any other
bug.
@menu
-* Trees:: Macros and functions that can be used with all trees.
+* Macros and Functions::Macros and functions that can be used with all trees.
* Identifiers:: The names of things.
* Containers:: Lists and vectors.
@end menu
@@ -217,8 +168,8 @@ bug.
@c Trees
@c ---------------------------------------------------------------------
-@node Trees
-@section Trees
+@node Macros and Functions
+@subsection Trees
@cindex tree
This section is not here yet.
@@ -228,7 +179,7 @@ This section is not here yet.
@c ---------------------------------------------------------------------
@node Identifiers
-@section Identifiers
+@subsection Identifiers
@cindex identifier
@cindex name
@tindex IDENTIFIER_NODE
@@ -274,7 +225,7 @@ operator converts.
@c ---------------------------------------------------------------------
@node Containers
-@section Containers
+@subsection Containers
@cindex container
@cindex list
@cindex vector
@@ -309,7 +260,7 @@ The elements are indexed from zero.
@c ---------------------------------------------------------------------
@node Types
-@chapter Types
+@section Types
@cindex type
@cindex pointer
@cindex reference
@@ -398,7 +349,7 @@ This macro holds if the type is @code{restrict}-qualified.
@item CP_TYPE_CONST_NON_VOLATILE_P
This predicate holds for a type that is @code{const}-qualified, but
@emph{not} @code{volatile}-qualified; other cv-qualifiers are ignored as
-well: only the @code{const}-ness is tested.
+well: only the @code{const}-ness is tested.
@item TYPE_MAIN_VARIANT
This macro returns the unqualified version of a type. It may be applied
@@ -422,12 +373,12 @@ the type. (Note this macro does @emph{not} return a
@code{IDENTIFIER_NODE}, as you might expect, given its name!) You can
look at the @code{DECL_NAME} of the @code{TYPE_DECL} to obtain the
actual name of the type. The @code{TYPE_NAME} will be @code{NULL_TREE}
-for a type that is not a builtin type, the result of a typedef, or a
+for a type that is not a built-in type, the result of a typedef, or a
named class type.
@item CP_INTEGRAL_TYPE
This predicate holds if the type is an integral type. Notice that in
-C++, enumerations are @emph{not} integral types.
+C++, enumerations are @emph{not} integral types.
@item ARITHMETIC_TYPE_P
This predicate holds if the type is an integral type (in the C++ sense)
@@ -437,21 +388,21 @@ or a floating point type.
This predicate holds for a class-type.
@item TYPE_BUILT_IN
-This predicate holds for a builtin type.
+This predicate holds for a built-in type.
@item TYPE_PTRMEM_P
This predicate holds if the type is a pointer to data member.
@item TYPE_PTR_P
This predicate holds if the type is a pointer type, and the pointee is
-not a data member.
+not a data member.
@item TYPE_PTRFN_P
This predicate holds for a pointer to function type.
@item TYPE_PTROB_P
This predicate holds for a pointer to object type. Note however that it
-does not hold for the generic pointer to object type @code{void *}. You
+does not hold for the generic pointer to object type @code{void *}. You
may use @code{TYPE_PTROBV_P} to test for a pointer to object type as
well as @code{void *}.
@@ -500,7 +451,7 @@ double} types. The number of bits in the floating-point representation
is given by @code{TYPE_PRECISION}, as in the @code{INTEGER_TYPE} case.
@item COMPLEX_TYPE
-Used to represent GCC builtin @code{__complex__} data types. The
+Used to represent GCC built-in @code{__complex__} data types. The
@code{TREE_TYPE} is the type of the real and imaginary parts.
@item ENUMERAL_TYPE
@@ -549,7 +500,7 @@ arguments.
Note that in C (but not in C++) a function declared like @code{void f()}
is an unprototyped function taking a variable number of arguments; the
-@code{TYPE_ARG_TYPES} of such a function will be NULL.
+@code{TYPE_ARG_TYPES} of such a function will be @code{NULL}.
@item METHOD_TYPE
Used to represent the type of a non-static member function. Like a
@@ -594,7 +545,7 @@ the type of @code{m}.
@item TYPENAME_TYPE
Used to represent a construct of the form @code{typename T::A}. The
@code{TYPE_CONTEXT} is @code{T}; the @code{TYPE_NAME} is an
-@code{IDENTIFIER_NODE} for @code{A}. If the type is specified via a
+@code{IDENTIFIER_NODE} for @code{A}. If the type is specified via a
template-id, then @code{TYPENAME_TYPE_FULLNAME} yields a
@code{TEMPLATE_ID_EXPR}. The @code{TREE_TYPE} is non-@code{NULL} if the
node is implicitly generated in support for the implicit typename
@@ -604,7 +555,7 @@ base-class.
@item TYPEOF_TYPE
Used to represent the @code{__typeof__} extension. The
@code{TYPE_FIELDS} is the expression the type of which is being
-represented.
+represented.
@item UNION_TYPE
Used to represent @code{union} types. For more information, @pxref{Classes}.
@@ -634,7 +585,7 @@ in hand, using @code{same_type_p}.
@c ---------------------------------------------------------------------
@node Scopes
-@chapter Scopes
+@section Scopes
@cindex namespace, class, scope
The root of the entire intermediate representation is the variable
@@ -658,7 +609,7 @@ keywords.)
@c ---------------------------------------------------------------------
@node Namespaces
-@section Namespaces
+@subsection Namespaces
@cindex namespace
@tindex NAMESPACE_DECL
@@ -669,16 +620,13 @@ representation, the global namespace is no different from any other
namespace. Thus, in what follows, we describe namespaces generally,
rather than the global namespace in particular.
-The @code{::std} namespace, however, @emph{is} special, unless
-@code{flag_honor_std} is set. This variable is set by the use
-@samp{-fhonor-std} (or an option that implies it, like
-@samp{-fnew-abi}), when invoking G++. When @code{flag_honor_std} is
-set, the @code{std} namespace is just like any other namespace. When
+The @code{::std} namespace, however, @emph{is} special when
+@code{flag_honor_std} is not set. When @code{flag_honor_std} is set,
+the @code{std} namespace is just like any other namespace. When
@code{flag_honor_std} is not set, however, the @code{::std} namespace is
treated as a synonym for the global namespace, thereby allowing users to
write code that will work with compilers that put the standard library
-in the @code{::std} namespace, even though the library supplied with G++
-does not do so, as of GCC 2.95. The @code{std} namespace is represented
+in the @code{::std} namespace. The @code{std} namespace is represented
by the variable @code{std_node}. Although @code{std_node} is a
@code{NAMESPACE_DECL}, it does not have all the fields required of a
real namespace, and the macros and functions described here do not work,
@@ -709,7 +657,7 @@ the @code{global_namespace} is @code{NULL_TREE}.
@item DECL_NAMESPACE_ALIAS
If this declaration is for a namespace alias, then
@code{DECL_NAMESPACE_ALIAS} is the namespace for which this one is an
-alias.
+alias.
Do not attempt to use @code{cp_namespace_decls} for a namespace which is
an alias. Instead, follow @code{DECL_NAMESPACE_ALIAS} links until you
@@ -718,19 +666,19 @@ reach an ordinary, non-alias, namespace, and call
@item DECL_NAMESPACE_STD_P
This predicate holds if the namespace is the special @code{::std}
-namespace.
+namespace.
@item cp_namespace_decls
This function will return the declarations contained in the namespace,
including types, overloaded functions, other namespaces, and so forth.
If there are no declarations, this function will return
@code{NULL_TREE}. The declarations are connected through their
-@code{TREE_CHAIN} fields.
+@code{TREE_CHAIN} fields.
Although most entries on this list will be declarations,
@code{TREE_LIST} nodes may also appear. In this case, the
@code{TREE_VALUE} will be an @code{OVERLOAD}. The value of the
-@code{TREE_PURPOSE} is unspecified; back-ends should ignore this value.
+@code{TREE_PURPOSE} is unspecified; back ends should ignore this value.
As with the other kinds of declarations returned by
@code{cp_namespace_decls}, the @code{TREE_CHAIN} will point to the next
declaration in this list.
@@ -750,7 +698,7 @@ This function cannot be used with namespaces that have
@c ---------------------------------------------------------------------
@node Classes
-@section Classes
+@subsection Classes
@cindex class
@tindex RECORD_TYPE
@tindex UNION_TYPE
@@ -777,7 +725,7 @@ Almost all non-function members are available on the @code{TYPE_FIELDS}
list. Given one member, the next can be found by following the
@code{TREE_CHAIN}. You should not depend in any way on the order in
which fields appear on this list. All nodes on this list will be
-@samp{DECL} nodes. A @code{FIELD_DECL} is used to represent a non-static
+@samp{DECL} nodes. A @code{FIELD_DECL} is used to represent a non-static
data member, a @code{VAR_DECL} is used to represent a static data
member, and a @code{TYPE_DECL} is used to represent a type. Note that
the @code{CONST_DECL} for an enumeration constant will appear on this
@@ -789,7 +737,7 @@ object.
The @code{TYPE_VFIELD} is a compiler-generated field used to point to
virtual function tables. It may or may not appear on the
-@code{TYPE_FIELDS} list. However, back-ends should handle the
+@code{TYPE_FIELDS} list. However, back ends should handle the
@code{TYPE_VFIELD} just like all the entries on the @code{TYPE_FIELDS}
list.
@@ -828,7 +776,7 @@ virtually.
FIXME: Talk about @code{TYPE_NONCOPIED_PARTS}.
-The following macros can be used on a tree node representing a class-type.
+The following macros can be used on a tree node representing a class-type.
@ftable @code
@item LOCAL_CLASS_P
@@ -845,30 +793,30 @@ default constructor.
@item CLASSTYPE_HAS_MUTABLE
@item TYPE_HAS_MUTABLE_P
-These predicates hold for a class-type having a mutable data member.
+These predicates hold for a class-type having a mutable data member.
@item CLASSTYPE_NON_POD_P
This predicate holds only for class-types that are not PODs.
@item TYPE_HAS_NEW_OPERATOR
-This predicate holds for a class-type that defines
+This predicate holds for a class-type that defines
@code{operator new}.
@item TYPE_HAS_ARRAY_NEW_OPERATOR
-This predicate holds for a class-type for which
+This predicate holds for a class-type for which
@code{operator new[]} is defined.
@item TYPE_OVERLOADS_CALL_EXPR
-This predicate holds for class-type for which the function call
+This predicate holds for class-type for which the function call
@code{operator()} is overloaded.
@item TYPE_OVERLOADS_ARRAY_REF
-This predicate holds for a class-type that overloads
+This predicate holds for a class-type that overloads
@code{operator[]}
@item TYPE_OVERLOADS_ARROW
This predicate holds for a class-type for which @code{operator->} is
-overloaded.
+overloaded.
@end ftable
@@ -877,7 +825,7 @@ overloaded.
@c ---------------------------------------------------------------------
@node Declarations
-@chapter Declarations
+@section Declarations
@cindex declaration
@cindex variable
@cindex type declaration
@@ -898,7 +846,7 @@ overloaded.
@findex DECL_ALIGN
@findex DECL_EXTERNAL
-This chapter covers the various kinds of declarations that appear in the
+This section covers the various kinds of declarations that appear in the
internal representation, except for declarations of functions
(represented by @code{FUNCTION_DECL} nodes), which are described in
@ref{Functions}.
@@ -922,7 +870,7 @@ compiler (like @code{__builtin_memcpy}), this will be the string
This macro returns the line number at which the entity was declared, as
an @code{int}.
-@item DECL_ARTIFICIAL
+@item DECL_ARTIFICIAL
This predicate holds if the declaration was implicitly generated by the
compiler. For example, this predicate will hold of an implicitly
declared member function, or of the @code{TYPE_DECL} implicitly
@@ -947,7 +895,7 @@ This predicate holds if the entity was declared at a class scope.
@item DECL_FUNCTION_SCOPE_P
This predicate holds if the entity was declared inside a function
-body.
+body.
@end ftable
@@ -983,10 +931,10 @@ analogous to @code{TYPE_SIZE} and @code{TYPE_ALIGN}. For a declaration,
you should always use the @code{DECL_SIZE} and @code{DECL_ALIGN} rather
than the @code{TYPE_SIZE} and @code{TYPE_ALIGN} given by the
@code{TREE_TYPE}, since special attributes may have been applied to the
-variable to give it a particular size and alignment. You may use the
+variable to give it a particular size and alignment. You may use the
predicates @code{DECL_THIS_STATIC} or @code{DECL_THIS_EXTERN} to test
whether the storage class specifiers @code{static} or @code{extern} were
-used to declare a variable.
+used to declare a variable.
If this variable is initialized (but does not require a constructor),
the @code{DECL_INITIAL} will be an expression for the initializer. The
@@ -1020,7 +968,7 @@ These nodes represent non-static data members. The @code{DECL_SIZE} and
@code{INTEGER_CST}. These values are indexed from zero, where zero
indicates the first bit in the object.
-If @code{DECL_C_BIT_FIELD} holds, this field is a bitfield.
+If @code{DECL_C_BIT_FIELD} holds, this field is a bit-field.
@item NAMESPACE_DECL
@xref{Namespaces}.
@@ -1029,9 +977,9 @@ If @code{DECL_C_BIT_FIELD} holds, this field is a bitfield.
These nodes are used to represent class, function, and variable (static
data member) templates. The @code{DECL_TEMPLATE_SPECIALIZATIONS} are a
-@code{TREE_LIST}. The @code{TREE_VALUE} of each node in the lst is a
+@code{TREE_LIST}. The @code{TREE_VALUE} of each node in the list is a
@code{TEMPLATE_DECL}s or @code{FUNCTION_DECL}s representing
-specializations (including instantiations) of this template. Back-ends
+specializations (including instantiations) of this template. Back ends
can safely ignore @code{TEMPLATE_DECL}s, but should examine
@code{FUNCTION_DECL} nodes on the specializations list just as they
would ordinary @code{FUNCTION_DECL} nodes.
@@ -1043,7 +991,7 @@ contains partial specializations of the class.
@item USING_DECL
-Back-ends can safely ignore these nodes.
+Back ends can safely ignore these nodes.
@end table
@@ -1052,7 +1000,7 @@ Back-ends can safely ignore these nodes.
@c ---------------------------------------------------------------------
@node Functions
-@chapter Functions
+@section Functions
@cindex function
@tindex FUNCTION_DECL
@tindex OVERLOAD
@@ -1097,12 +1045,12 @@ representation indicates that the GNU nested function extension is in
use. For details on the semantics of nested functions, see the GCC
Manual. The nested function can refer to local variables in its
containing function. Such references are not explicitly marked in the
-tree structure; back-ends must look at the @code{DECL_CONTEXT} for the
+tree structure; back ends must look at the @code{DECL_CONTEXT} for the
referenced @code{VAR_DECL}. If the @code{DECL_CONTEXT} for the
referenced @code{VAR_DECL} is not the same as the function currently
being processed, and neither @code{DECL_EXTERNAL} nor @code{DECL_STATIC}
hold, then the reference is to a local variable in a containing
-function, and the back-end must take appropriate action.
+function, and the back end must take appropriate action.
@menu
* Function Basics:: Function names, linkage, and so forth.
@@ -1114,7 +1062,7 @@ function, and the back-end must take appropriate action.
@c ---------------------------------------------------------------------
@node Function Basics
-@section Function Basics
+@subsection Function Basics
@cindex constructor
@cindex destructor
@cindex copy constructor
@@ -1138,7 +1086,7 @@ The following macros and functions can be used on a @code{FUNCTION_DECL}:
@ftable @code
@item DECL_MAIN_P
This predicate holds for a function that is the program entry point
-@code{::code}.
+@code{::code}.
@item DECL_NAME
This macro returns the unqualified name of the function, as an
@@ -1156,8 +1104,8 @@ This macro returns the mangled name of the function, also an
on systems that prefix all identifiers with underscores. The mangled
name is computed in the same way on all platforms; if special processing
is required to deal with the object file format used on a particular
-platform, it is the responsibility of the back-end to perform those
-modifications. (Of course, the back-end should not modify
+platform, it is the responsibility of the back end to perform those
+modifications. (Of course, the back end should not modify
@code{DECL_ASSEMBLER_NAME} itself.)
@item DECL_EXTERNAL
@@ -1172,7 +1120,7 @@ though it has a global scope.
@item DECL_ANTICIPATED
This predicate holds if the function is a built-in function but its
-prototype is not yet explicitly declared.
+prototype is not yet explicitly declared.
@item DECL_EXTERN_C_FUNCTION_P
This predicate holds if the function is declared as an
@@ -1251,9 +1199,9 @@ returns, control is transferred directly to the caller, without
returning to the thunk. The first parameter to the thunk is always the
@code{this} pointer; the thunk should add @code{THUNK_DELTA} to this
value. (The @code{THUNK_DELTA} is an @code{int}, not an
-@code{INTEGER_CST}.)
+@code{INTEGER_CST}.)
-Then, if @code{THUNK_VCALL_OFFSET} (an @code{INTEGER_CST}) is non-zero
+Then, if @code{THUNK_VCALL_OFFSET} (an @code{INTEGER_CST}) is nonzero
the adjusted @code{this} pointer must be adjusted again. The complete
calculation is given by the following pseudo-code:
@@ -1317,7 +1265,7 @@ This predicate holds if the function an overloaded
@c ---------------------------------------------------------------------
@node Function Bodies
-@section Function Bodies
+@subsection Function Bodies
@cindex function body
@cindex statements
@tindex ASM_STMT
@@ -1346,6 +1294,8 @@ This predicate holds if the function an overloaded
@findex FOR_COND
@findex FOR_EXPR
@findex FOR_BODY
+@tindex FILE_STMT
+@findex FILE_STMT_FILENAME
@tindex GOTO_STMT
@findex GOTO_DESTINATION
@tindex HANDLER
@@ -1374,12 +1324,13 @@ This predicate holds if the function an overloaded
@findex TRY_HANDLERS
@findex HANDLER_PARMS
@findex HANDLER_BODY
+@findex USING_STMT
@tindex WHILE_STMT
@findex WHILE_BODY
@findex WHILE_COND
A function that has a definition in the current translation unit will
-have a non-NULL @code{DECL_INITIAL}. However, back-ends should not make
+have a non-@code{NULL} @code{DECL_INITIAL}. However, back ends should not make
use of the particular value given by @code{DECL_INITIAL}.
The @code{DECL_SAVED_TREE} macro will give the complete body of the
@@ -1387,7 +1338,7 @@ function. This node will usually be a @code{COMPOUND_STMT} representing
the outermost block of the function, but it may also be a
@code{TRY_BLOCK}, a @code{RETURN_INIT}, or any other valid statement.
-@subsection Statements
+@subsubsection Statements
There are tree nodes corresponding to all of the source-level statement
constructs. These are enumerated here, together with a list of the
@@ -1421,7 +1372,7 @@ Here is the list of the various statement nodes, and the macros used to
access them. This documentation describes the use of these nodes in
non-template functions (including instantiations of template functions).
In template functions, the same nodes are used, but sometimes in
-slightly different ways.
+slightly different ways.
Many of the statements have substatements. For example, a @code{while}
loop will have a body, which is itself a statement. If the substatement
@@ -1443,8 +1394,8 @@ void process_stmt (stmt)
process_stmt (THEN_CLAUSE (stmt));
/* More processing here. */
break;
-
- ...
+
+ @dots{}
@}
stmt = TREE_CHAIN (stmt);
@@ -1465,7 +1416,7 @@ statement like:
asm ("mov x, y");
@end example
The @code{ASM_STRING} macro will return a @code{STRING_CST} node for
-@code{"mov x, y"}. If the original statement made use of the
+@code{"mov x, y"}. If the original statement made use of the
extended-assembly syntax, then @code{ASM_OUTPUTS},
@code{ASM_INPUTS}, and @code{ASM_CLOBBERS} will be the outputs, inputs,
and clobbers for the statement, represented as @code{STRING_CST} nodes.
@@ -1494,8 +1445,8 @@ fields.
@item CASE_LABEL
Use to represent a @code{case} label, range of @code{case} labels, or a
-@code{default} label. If @code{CASE_LOW} is NULL_TREE, then this is a a
-@code{default} label. Otherwise, if @code{CASE_HIGH} is NULL_TREE, then
+@code{default} label. If @code{CASE_LOW} is @code{NULL_TREE}, then this is a
+@code{default} label. Otherwise, if @code{CASE_HIGH} is @code{NULL_TREE}, then
this is an ordinary @code{case} label. In this case, @code{CASE_LOW} is
an expression giving the value of the label. Both @code{CASE_LOW} and
@code{CASE_HIGH} are @code{INTEGER_CST} nodes. These values will have
@@ -1514,7 +1465,7 @@ The first value will be @code{CASE_LOW}, while the second will be
Used to represent an action that should take place upon exit from the
enclosing scope. Typically, these actions are calls to destructors for
-local objects, but back-ends cannot rely on this fact. If these nodes
+local objects, but back ends cannot rely on this fact. If these nodes
are in fact representing such destructors, @code{CLEANUP_DECL} will be
the @code{VAR_DECL} destroyed. Otherwise, @code{CLEANUP_DECL} will be
@code{NULL_TREE}. In any case, the @code{CLEANUP_EXPR} is the
@@ -1527,6 +1478,8 @@ should be run in the reverse order of the order in which the associated
Used to represent a brace-enclosed block. The first substatement is
given by @code{COMPOUND_BODY}. Subsequent substatements are found by
following the @code{TREE_CHAIN} link from one substatement to the next.
+The @code{COMPOUND_BODY} will be @code{NULL_TREE} if there are no
+substatements.
@item CONTINUE_STMT
@@ -1567,6 +1520,11 @@ address is never taken. (All such objects are interchangeable.) The
Used to represent an expression statement. Use @code{EXPR_STMT_EXPR} to
obtain the expression.
+@item FILE_STMT
+
+Used to record a change in filename within the body of a function.
+Use @code{FILE_STMT_FILENAME} to obtain the new filename.
+
@item FOR_STMT
Used to represent a @code{for} statement. The @code{FOR_INIT_STMT} is
@@ -1589,16 +1547,16 @@ always have pointer type.
@item IF_STMT
Used to represent an @code{if} statement. The @code{IF_COND} is the
-expression.
+expression.
If the condition is a @code{TREE_LIST}, then the @code{TREE_PURPOSE} is
-a statement (usually a @code{DECL_STMT}). Each time the coondition is
+a statement (usually a @code{DECL_STMT}). Each time the condition is
evaluated, the statement should be executed. Then, the
@code{TREE_VALUE} should be used as the conditional expression itself.
This representation is used to handle C++ code like this:
@example
-if (int i = 7) ...
+if (int i = 7) @dots{}
@end example
where there is a new local variable (or variables) declared within the
@@ -1620,7 +1578,7 @@ the @code{LABEL_DECL} with @code{DECL_NAME}.
If the function uses the G++ ``named return value'' extension, meaning
that the function has been defined like:
@example
-S f(int) return s @{...@}
+S f(int) return s @{@dots{}@}
@end example
then there will be a @code{RETURN_INIT}. There is never a named
returned value for a constructor. The first argument to the
@@ -1648,7 +1606,7 @@ scope; if @code{SCOPE_END_P} holds this statement represents the end of
a scope. On exit from a scope, all cleanups from @code{CLEANUP_STMT}s
occurring in the scope must be run, in reverse order to the order in
which they were encountered. If @code{SCOPE_NULLIFIED_P} or
-@code{SCOPE_NO_CLEANUPS_P} holds of the scope, back-ends should behave
+@code{SCOPE_NO_CLEANUPS_P} holds of the scope, back ends should behave
as if the @code{SCOPE_STMT} were not present at all.
@item START_CATCH_STMT
@@ -1689,6 +1647,12 @@ the try block. It must rethrow the exception after executing that code.
And, if an exception is thrown while the expression is executing,
@code{terminate} must be called.
+@item USING_STMT
+Used to represent a @code{using} directive. The namespace is given by
+@code{USING_STMT_NAMESPACE}, which will be a NAMESPACE_DECL@. This node
+is needed inside template functions, to implement using directives
+during instantiation.
+
@item WHILE_STMT
Used to represent a @code{while} loop. The @code{WHILE_COND} is the
@@ -1701,11 +1665,45 @@ The @code{WHILE_BODY} is the body of the loop.
@end table
@c ---------------------------------------------------------------------
+@c Attributes
+@c ---------------------------------------------------------------------
+@node Attributes
+@section Attributes in trees
+@cindex attributes
+
+Attributes, as specified using the @code{__attribute__} keyword, are
+represented internally as a @code{TREE_LIST}. The @code{TREE_PURPOSE}
+is the name of the attribute, as an @code{IDENTIFIER_NODE}. The
+@code{TREE_VALUE} is a @code{TREE_LIST} of the arguments of the
+attribute, if any, or @code{NULL_TREE} if there are no arguments; the
+arguments are stored as the @code{TREE_VALUE} of successive entries in
+the list, and may be identifiers or expressions. The @code{TREE_CHAIN}
+of the attribute is the next attribute in a list of attributes applying
+to the same declaration or type, or @code{NULL_TREE} if there are no
+further attributes in the list.
+
+Attributes may be attached to declarations and to types; these
+attributes may be accessed with the following macros. At present only
+machine-dependent attributes are stored in this way (other attributes
+cause changes to the declaration or type or to other internal compiler
+data structures, but are not themselves stored along with the
+declaration or type), but in future all attributes may be stored like
+this.
+
+@deftypefn {Tree Macro} tree DECL_MACHINE_ATTRIBUTES (tree @var{decl})
+This macro returns the attributes on the declaration @var{decl}.
+@end deftypefn
+
+@deftypefn {Tree Macro} tree TYPE_ATTRIBUTES (tree @var{type})
+This macro returns the attributes on the type @var{type}.
+@end deftypefn
+
+@c ---------------------------------------------------------------------
@c Expressions
@c ---------------------------------------------------------------------
-@node Expressions
-@chapter Expressions
+@node Expression trees
+@section Expressions
@cindex expression
@findex TREE_OPERAND
@tindex INTEGER_CST
@@ -1791,10 +1789,10 @@ same type that would be given the expression in the original program.
In what follows, some nodes that one might expect to always have type
@code{bool} are documented to have either integral or boolean type. At
-some point in the future, the C front-end may also make use of this same
+some point in the future, the C front end may also make use of this same
intermediate representation, and at this point these nodes will
certainly have integral type. The previous sentence is not meant to
-imply that the C++ front-end does not or will not give these nodes
+imply that the C++ front end does not or will not give these nodes
integral type.
Below, we list the various kinds of expression nodes. Except where
@@ -1819,7 +1817,7 @@ constants is obtained with @code{TREE_TYPE}; they are not always of type
@code{int}. In particular, @code{char} constants are represented with
@code{INTEGER_CST} nodes. The value of the integer constant @code{e} is
given by @example
-((TREE_INT_CST_HIGH (e) << HOST_BITS_PER_WIDE_INT)
+((TREE_INT_CST_HIGH (e) << HOST_BITS_PER_WIDE_INT)
+ TREE_INST_CST_LOW (e))
@end example
@noindent
@@ -1830,7 +1828,7 @@ as a signed or unsigned quantity depending on the type of the constant.
In general, the expression given above will overflow, so it should not
be used to calculate the value of the constant.
-The variable @code{integer_zero_node} is a integer constant with value
+The variable @code{integer_zero_node} is an integer constant with value
zero. Similarly, @code{integer_one_node} is an integer constant with
value one. The @code{size_zero_node} and @code{size_one_node} variables
are analogous, but have type @code{size_t} rather than @code{int}.
@@ -1855,7 +1853,7 @@ comparisons, and so forth.
@item COMPLEX_CST
These nodes are used to represent complex number constants, that is a
-@code{__complex__} whose parts are constant nodes. The
+@code{__complex__} whose parts are constant nodes. The
@code{TREE_REALPART} and @code{TREE_IMAGPART} return the real and the
imaginary parts respectively.
@@ -1868,7 +1866,15 @@ embedded @code{NUL} characters. Therefore, the
@code{TREE_STRING_LENGTH} includes the trailing @code{NUL} if it is
present.
-FIXME: How are wide strings represented?
+For wide string constants, the @code{TREE_STRING_LENGTH} is the number
+of bytes in the string, and the @code{TREE_STRING_POINTER}
+points to an array of the bytes of the string, as represented on the
+target system (that is, as integers in the target endianness). Wide and
+non-wide string constants are distinguished only by the @code{TREE_TYPE}
+of the @code{STRING_CST}.
+
+FIXME: The formats of string constants are not well-defined when the
+target system bytes are not the same width as host system bytes.
@item PTRMEM_CST
These nodes are used to represent pointer-to-member constants. The
@@ -1876,7 +1882,7 @@ These nodes are used to represent pointer-to-member constants. The
or @code{UNION_TYPE} within which the pointer points), and the
@code{PTRMEM_CST_MEMBER} is the declaration for the pointed to object.
Note that the @code{DECL_CONTEXT} for the @code{PTRMEM_CST_MEMBER} is in
-general different from from the @code{PTRMEM_CST_CLASS}. For example,
+general different from the @code{PTRMEM_CST_CLASS}. For example,
given:
@example
struct B @{ int i; @};
@@ -1931,7 +1937,7 @@ this case, the operand of the @code{ADDR_EXPR} will be a
If the object addressed is not an lvalue, a temporary is created, and
the address of the temporary is used.
-@item INDIRECT_REF
+@item INDIRECT_REF
These nodes are used to represent the object pointed to by a pointer.
The operand is the pointer being dereferenced; it will always have
pointer or reference type.
@@ -1945,10 +1951,10 @@ operand is rounded towards zero.
@item FLOAT_EXPR
These nodes represent conversion of an integral (or boolean) value to a
floating-point value. The single operand will have integral type, while
-the complete expression will have a floating-point type.
+the complete expression will have a floating-point type.
FIXME: How is the operand supposed to be rounded? Is this dependent on
--mieee?
+@option{-mieee}?
@item COMPLEX_EXPR
These nodes are used to represent complex numbers constructed from two
@@ -1965,7 +1971,7 @@ of complex numbers (their sole argument).
@item NON_LVALUE_EXPR
These nodes indicate that their one and only operand is not an lvalue.
-A back-end can treat these identically to the single operand.
+A back end can treat these identically to the single operand.
@item NOP_EXPR
These nodes are used to represent conversions that do not require any
@@ -1992,7 +1998,7 @@ an expression for the code that should be executed to throw the
exception. However, there is one implicit action not represented in
that expression; namely the call to @code{__throw}. This function takes
no arguments. If @code{setjmp}/@code{longjmp} exceptions are used, the
-function @code{__sjthrow} is called instead. The normal GCC back-end
+function @code{__sjthrow} is called instead. The normal GCC back end
uses the function @code{emit_throw} to generate this code; you can
examine this function to see what needs to be done.
@@ -2025,7 +2031,7 @@ boolean or integral type.
@itemx TRUTH_XOR_EXPR
These nodes represent logical and, logical or, and logical exclusive or.
They are strict; both arguments are always evaluated. There are no
-corresponding operators in C or C++, but the front-end will sometimes
+corresponding operators in C or C++, but the front end will sometimes
generate these expressions anyhow, if it can tell that strictness does
not matter.
@@ -2077,7 +2083,7 @@ will be a @code{VAR_DECL}, @code{INDIRECT_REF}, @code{COMPONENT_REF}, or
other lvalue.
These nodes are used to represent not only assignment with @samp{=} but
-also compount assignments (like @samp{+=}), by reduction to @samp{=}
+also compound assignments (like @samp{+=}), by reduction to @samp{=}
assignment. In other words, the representation for @samp{i += 3} looks
just like that for @samp{i = i + 3}.
@@ -2098,7 +2104,7 @@ the value of the second operand.
@item COND_EXPR
These nodes represent @code{?:} expressions. The first operand
-is of boolean or integral type. If it evaluates to a non-zero value,
+is of boolean or integral type. If it evaluates to a nonzero value,
the second operand should be evaluated, and returned as the value of the
expression. Otherwise, the third operand is evaluated, and returned as
the value of the expression. As a GNU extension, the middle operand of
@@ -2108,7 +2114,7 @@ the @code{?:} operator may be omitted in the source, like this:
x ? : 3
@end example
@noindent
-which is equivalent to
+which is equivalent to
@example
x ? x : 3
@@ -2176,7 +2182,7 @@ an @code{EXIT_EXPR} is encountered.
@item EXIT_EXPR
These nodes represent conditional exits from the nearest enclosing
@code{LOOP_EXPR}. The single operand is the condition; if it is
-non-zero, then the loop should be exited. An @code{EXIT_EXPR} will only
+nonzero, then the loop should be exited. An @code{EXIT_EXPR} will only
appear within a @code{LOOP_EXPR}.
@item CLEANUP_POINT_EXPR
@@ -2187,7 +2193,7 @@ performed immediately after the expression is evaluated.
@item CONSTRUCTOR
These nodes represent the brace-enclosed initializers for a structure or
-array. The first operand is reserved for use by the back-end. The
+array. The first operand is reserved for use by the back end. The
second operand is a @code{TREE_LIST}. If the @code{TREE_TYPE} of the
@code{CONSTRUCTOR} is a @code{RECORD_TYPE} or @code{UNION_TYPE}, then
the @code{TREE_PURPOSE} of each node in the @code{TREE_LIST} will be a
@@ -2265,39 +2271,3 @@ given by the third operand to the @code{AGGR_INIT_EXPR}; constructors do
not return a value.
@end table
-
-@c ---------------------------------------------------------------------
-@c Node Index
-@c ---------------------------------------------------------------------
-
-@node Node Index
-@unnumbered Node Index
-
-@printindex tp
-
-@c ---------------------------------------------------------------------
-@c Function Index
-@c ---------------------------------------------------------------------
-
-@node Function Index
-@unnumbered Function Index
-
-@printindex fn
-
-@c ---------------------------------------------------------------------
-@c Concept Index
-@c ---------------------------------------------------------------------
-
-@node Concept Index
-@unnumbered Concept Index
-
-@printindex cp
-
-@c ---------------------------------------------------------------------
-@c Epilogue
-@c ---------------------------------------------------------------------
-
-@summarycontents
-@contents
-@contents
-@bye
diff --git a/gcc/contrib.texi b/gcc/doc/contrib.texi
index 42fd6b3af6e..d8d10076e91 100644
--- a/gcc/contrib.texi
+++ b/gcc/doc/contrib.texi
@@ -1,3 +1,8 @@
+@c Copyright (C) 1988,1989,1992,1993,1994,1995,1996,1997,1998,1999,2000,2001
+@c Free Software Foundation, Inc.
+@c This is part of the GCC manual.
+@c For copying conditions, see the file gcc.texi.
+
The GCC project would like to thank its many contributors. Without them the
project would not have been nearly as successful as it has been. Any omissions
in this list are accidental. Feel free to contact
@@ -5,6 +10,10 @@ in this list are accidental. Feel free to contact
or some of your contributions are not listed. Please keep this list in
alphabetical order.
+Some projects operating under the GCC project maintain their own list
+of contributors, such as
+@uref{http://gcc.gnu.org/libstdc++/,the C++ library}.
+
@itemize @bullet
@item
@@ -19,7 +28,7 @@ the Intel 80387 register stack.
Alasdair Baird for various bugfixes.
@item
-Gerald Baumgartner added the signature extension to the C++ front-end.
+Gerald Baumgartner added the signature extension to the C++ front end.
@item
Neil Booth for various work on cpplib.
@@ -70,7 +79,7 @@ Scott Christley for his ObjC contributions.
Branko Cibej for more warning contributions.
@item
-Nick Clifton for arm, mcore, fr30, v850, m32r work, --help, and other random
+Nick Clifton for arm, mcore, fr30, v850, m32r work, @option{--help}, and other random
hacking.
@item
@@ -91,11 +100,11 @@ Dario Dariol contributed the four varieties of sample programs
that print a copy of their source.
@item
-Ulrich Drepper for his work on the C++ runtime libraries, glibc,
+Ulrich Drepper for his work on the C++ runtime libraries, glibc,
testing of GCC using glibc, ISO C99 support, CFG dumping support, etc.
@item
-Richard Earnshaw for his ongoing work with the ARM.
+Richard Earnshaw for his ongoing work with the ARM@.
@item
David Edelsohn for his direction via the steering committee,
@@ -103,6 +112,9 @@ ongoing work with the RS6000/PowerPC port, and help cleaning up Haifa
loop changes.
@item
+Paul Eggert for random hacking all over GCC@.
+
+@item
Mark Elbrecht for various DJGPP improvements.
@item
@@ -110,9 +122,6 @@ Ben Elliston for his work to move the Objective-C runtime into its
own subdirectory and for his work on autoconf.
@item
-Paul Eggert for random hacking all over gcc.
-
-@item
Marc Espie for OpenBSD support.
@item
@@ -126,11 +135,8 @@ Fred Fish for BeOS support and Ada fixes.
Peter Gerwinski for various bugfixes and the Pascal front end.
@item
-Anthony Green for his -Os contributions and Java front end work.
-
-@item
Kaveh Ghazi for his direction via the steering committee and
-amazing work to make -W -Wall useful.
+amazing work to make @samp{-W -Wall} useful.
@item
Judy Goldberg for c++ contributions.
@@ -142,10 +148,13 @@ support, improved leaf function register allocation, and his direction
via the steering committee.
@item
+Anthony Green for his @option{-Os} contributions and Java front end work.
+
+@item
Michael K. Gschwind contributed the port to the PDP-11.
@item
-Ron Guilmette implemented the @code{protoize} and @code{unprotoize}
+Ron Guilmette implemented the @command{protoize} and @command{unprotoize}
tools, the support for Dwarf symbolic debugging information, and much of
the support for System V Release 4. He has also worked heavily on the
Intel 386 and 860 support.
@@ -209,7 +218,17 @@ J. Kean Johnston for OpenServer support.
Klaus Kaempf for his ongoing work to make alpha-vms a viable target.
@item
-David Kashtan of SRI adapted GCC to VMS.
+David Kashtan of SRI adapted GCC to VMS@.
+
+@item
+Geoffrey Keating for his ongoing work to make the PPC work for Linux.
+
+@item
+Brendan Kehoe for his ongoing work with g++.
+
+@item
+Oliver M. Kellogg of Deutsche Aerospace contributed the port to the
+MIL-STD-1750A@.
@item
Richard Kenner of the New York University Ultracomputer Research
@@ -223,24 +242,14 @@ elimination and delay slot scheduling. Richard Kenner was also the
head maintainer of GCC for several years.
@item
-Robin Kirkham for cpu32 support.
-
-@item
-Mark Klein for PA improvements.
-
-@item
-Geoffrey Keating for his ongoing work to make the PPC work for Linux.
-
-@item
-Brendan Kehoe for his ongoing work with g++.
+Mumit Khan for various contributions to the cygwin and mingw32 ports and
+maintaining binary releases for Windows hosts.
@item
-Oliver M. Kellogg of Deutsche Aerospace contributed the port to the
-MIL-STD-1750A.
+Robin Kirkham for cpu32 support.
@item
-Mumit Khan for various contributions to the cygwin and mingw32 ports and
-maintaining binary releases for Windows hosts.
+Mark Klein for PA improvements.
@item
Thomas Koenig for various bugfixes.
@@ -252,9 +261,6 @@ Bruce Korb for the new and improved fixincludes code.
Benjamin Kosnik for his g++ work.
@item
-Ted Lemon wrote parts of the RTL reader and printer.
-
-@item
Charles LaBrec contributed the support for the Integrated Solutions
68020 system.
@@ -269,11 +275,14 @@ Marc Lehmann for his direction via the steering committee and helping
with analysis and improvements of x86 performance.
@item
+Ted Lemon wrote parts of the RTL reader and printer.
+
+@item
Kriang Lerdsuwanakij for improvements to demangler and various c++ fixes.
@item
-Warren Levy major work on libgjc (Java Runtime Library) and random
-work on the Java front-end.
+Warren Levy major work on libgcj (Java Runtime Library) and random
+work on the Java front end.
@item
Alain Lichnewsky ported GCC to the Mips cpu.
@@ -285,23 +294,23 @@ Robert Lipe for OpenServer support, new testsuites, testing, etc.
Weiwen Liu for testing and various bugfixes.
@item
-Martin von L&ouml;wis for internal consistency checking infrastructure,
-and various C++ improvements including namespace support.
+Dave Love for his ongoing work with the Fortran front end and
+runtime libraries.
@item
-Dave Love for his ongoing work with the Fortran front end and
-runtime libraries.
+Martin von L@"owis for internal consistency checking infrastructure,
+and various C++ improvements including namespace support.
@item
H.J. Lu for his previous contributions to the steering committee, many x86
bug reports, prototype patches, and keeping the Linux ports working.
@item
-Andrew MacLeod for his ongoing work in building a real EH system,
-various code generation improvements, work on the global optimizer, etc.
+Greg McGary for random fixes and (someday) bounded pointers.
@item
-Bob Manson for his behind the scenes work on dejagnu.
+Andrew MacLeod for his ongoing work in building a real EH system,
+various code generation improvements, work on the global optimizer, etc.
@item
Vladimir Makarov for hacking some ugly i960 problems, PowerPC
@@ -309,7 +318,7 @@ hacking improvements to compile-time performance and overall knowledge
and direction in the area of instruction scheduling.
@item
-Greg McGary for random fixes and (someday) bounded pointers.
+Bob Manson for his behind the scenes work on dejagnu.
@item
Michael Meissner for LRS framework, ia32, m32r, v850, m88k, MIPS powerpc, haifa,
@@ -320,22 +329,6 @@ Jason Merrill for his direction via the steering committee and leading
the g++ effort.
@item
-Jason Molenda for major help in the care and feeding of all the services
-on the gcc.gnu.org (formerly egcs.cygnus.com) machine -- mail, web
-services, ftp services, etc etc.
-
-@item
-David Mosberger-Tang for various Alpha improvements.
-
-@item
-Stephen Moshier contributed the floating point emulator that assists in
-cross-compilation and permits support for floating point numbers wider
-than 64 bits and for ISO C99 support.
-
-@item
-Bill Moyer for his behind the scenes work on various issues.
-
-@item
David Miller for his direction via the steering committee, lots of
SPARC work, improvements in jump.c and interfacing with the Linux kernel
developers.
@@ -344,16 +337,21 @@ developers.
Gary Miller ported GCC to Charles River Data Systems machines.
@item
-Mark Mitchell for his direction via the steering committee, mountains
-of C++ work, load/store hoisting out of loops and alias analysis
-improvements, ISO "restrict" support.
+Mark Mitchell for his direction via the steering committee, mountains of
+C++ work, load/store hoisting out of loops, alias analysis improvements,
+ISO C @code{restrict} support, and serving as release manager for GCC 3.0.
@item
Alan Modra for various Linux bits and testing.
@item
Toon Moene for his direction via the steering committee, Fortran
-maintainance, and his ongoing work to make us make Fortran run fast.
+maintenance, and his ongoing work to make us make Fortran run fast.
+
+@item
+Jason Molenda for major help in the care and feeding of all the services
+on the gcc.gnu.org (formerly egcs.cygnus.com) machine---mail, web
+services, ftp services, etc etc.
@item
Catherine Moore for fixing various ugly problems we have sent her
@@ -361,11 +359,22 @@ way, including the haifa bug which was killing the Alpha & PowerPC Linux
kernels.
@item
+David Mosberger-Tang for various Alpha improvements.
+
+@item
+Stephen Moshier contributed the floating point emulator that assists in
+cross-compilation and permits support for floating point numbers wider
+than 64 bits and for ISO C99 support.
+
+@item
+Bill Moyer for his behind the scenes work on various issues.
+
+@item
Philippe De Muyter for his work on the m68k port.
@item
-Joseph Myers for his work on the PDP-11 port, format checking and ISO
-C99 support.
+Joseph S. Myers for his work on the PDP-11 port, format checking and ISO
+C99 support, and continuous emphasis on (and contributions to) documentation.
@item
Nathan Myers for his work on libstdc++-v3.
@@ -386,11 +395,11 @@ Alexandre Oliva for various build infrastructure improvements, scripts and
amazing testing work.
@item
-Rainer Orth for random MIPS work, including improvements to our o32
-ABI support, improvements to dejagnu's MIPS support, etc.
+Melissa O'Neill for various NeXT fixes.
@item
-Melissa O'Neill for various NeXT fixes.
+Rainer Orth for random MIPS work, including improvements to our o32
+ABI support, improvements to dejagnu's MIPS support, etc.
@item
Paul Petersen wrote the machine description for the Alliant FX/8.
@@ -402,8 +411,9 @@ Alexandre Petit-Bianco for his Java work.
Matthias Pfaller for major improvements to the NS32k port.
@item
-Gerald Pfeifer his direction via the steering committee, maintenance of
-the web pages and pointing out lots of problems we need to solve.
+Gerald Pfeifer for his direction via the steering committee, pointing
+out lots of problems we need to solve, maintenance of the web pages, and
+taking care of documentation maintenance in general.
@item
Ovidiu Predescu for his work on the ObjC front end and runtime libraries.
@@ -433,12 +443,6 @@ Ken Rose for fixes to our delay slot filling code.
Paul Rubin wrote most of the preprocessor.
@item
-Andreas Schwab for his work on the m68k port.
-
-@item
-Graham Stott. for various infrastructure improvements.
-
-@item
Juha Sarlin for improvements to the H8 code generator.
@item
@@ -452,11 +456,11 @@ William Schelter did most of the work on the Intel 80386 support.
@item
Bernd Schmidt for various code generation improvements and major
-work in the reload pass.
+work in the reload pass as well a serving as release manager for
+GCC 2.95.3.
@item
-Franz Sirl for his ongoing work with making the PPC port stable
-for linux.
+Andreas Schwab for his work on the m68k port.
@item
Joel Sherrill for his direction via the steering committee, RTEMS
@@ -471,15 +475,19 @@ code which handles the parse tree and RTL data structures, constant
folding and help with the original VAX & m68k ports.
@item
-Andrey Slepuhin for assorted AIX hacking.
+Franz Sirl for his ongoing work with making the PPC port stable
+for linux.
@item
-Randy Smith finished the Sun FPA support.
+Andrey Slepuhin for assorted AIX hacking.
@item
Christopher Smith did the port for Convex machines.
@item
+Randy Smith finished the Sun FPA support.
+
+@item
Scott Snyder for various fixes.
@item
@@ -496,6 +504,9 @@ Nigel Stephens for various mips16 related fixes/improvements.
Jonathan Stone wrote the machine description for the Pyramid computer.
@item
+Graham Stott for various infrastructure improvements.
+
+@item
Mike Stump for his Elxsi port, g++ contributions over the years and more
recently his vxworks contributions
@@ -510,11 +521,6 @@ fixincludes, etc.
Holger Teutsch provided the support for the Clipper cpu.
@item
-Michael Tiemann for random bugfixes the first instruction scheduler,
-initial C++ support, function integration, NS32k, sparc and M88k
-machine description work, delay slot scheduling.
-
-@item
Gary Thomas for his ongoing work to make the PPC work for Linux.
@item
@@ -525,6 +531,11 @@ Kresten Krab Thorup wrote the run time support for the Objective C
language.
@item
+Michael Tiemann for random bugfixes the first instruction scheduler,
+initial C++ support, function integration, NS32k, sparc and M88k
+machine description work, delay slot scheduling.
+
+@item
Teemu Torma for thread safe exception handling support.
@item
@@ -542,6 +553,10 @@ types.
Todd Vierling for contributions for NetBSD ports.
@item
+Dean Wakerley for converting the install documentation from HTML to texinfo
+in time for GCC 3.0.
+
+@item
Krister Walfridsson for random bugfixes.
@item
@@ -550,10 +565,13 @@ related infrastructure improvements to help x86 code generation,
value range propagation and other work, WE32k port.
@item
+Zack Weinberg for major work on cpplib and various other bugfixes.
+
+@item
Dale Wiles helped port GCC to the Tahoe.
@item
-Zack Weinberg for major work on cpplib and various other bugfixes.
+Bob Wilson from Tensilica, Inc.@: for the Xtensa port.
@item
Jim Wilson for his direction via the steering committee, tackling hard
@@ -602,10 +620,13 @@ Ulrich Drepper
David Edelsohn
@item
+Yung Shing Gene
+
+@item
Kaveh Ghazi
@item
-Yung Shing Gene
+Kate Hedstrom
@item
Richard Henderson
@@ -614,9 +635,6 @@ Richard Henderson
Manfred Hollstein
@item
-Kate Hedstrom
-
-@item
Kamil Iskra
@item
@@ -629,10 +647,10 @@ Jeff Law
Robert Lipe
@item
-Dave Love
+Damon Love
@item
-Damon Love
+Dave Love
@item
H.J. Lu
@@ -647,10 +665,10 @@ Matthias Klose
Martin Knoblauch
@item
-Toon Moene
+David Miller
@item
-David Miller
+Toon Moene
@item
Matthias Mueller
diff --git a/gcc/doc/cpp.1 b/gcc/doc/cpp.1
new file mode 100644
index 00000000000..a22da8eeaf4
--- /dev/null
+++ b/gcc/doc/cpp.1
@@ -0,0 +1,721 @@
+.\" Automatically generated by Pod::Man v1.32, Pod::Parser v1.13
+.\"
+.\" Standard preamble:
+.\" ========================================================================
+.de Sh \" Subsection heading
+.br
+.if t .Sp
+.ne 5
+.PP
+\fB\\$1\fR
+.PP
+..
+.de Sp \" Vertical space (when we can't use .PP)
+.if t .sp .5v
+.if n .sp
+..
+.de Vb \" Begin verbatim text
+.ft CW
+.nf
+.ne \\$1
+..
+.de Ve \" End verbatim text
+.ft R
+.fi
+..
+.\" Set up some character translations and predefined strings. \*(-- will
+.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
+.\" double quote, and \*(R" will give a right double quote. | will give a
+.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to
+.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C'
+.\" expand to `' in nroff, nothing in troff, for use with C<>.
+.tr \(*W-|\(bv\*(Tr
+.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
+.ie n \{\
+. ds -- \(*W-
+. ds PI pi
+. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
+. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
+. ds L" ""
+. ds R" ""
+. ds C` ""
+. ds C' ""
+'br\}
+.el\{\
+. ds -- \|\(em\|
+. ds PI \(*p
+. ds L" ``
+. ds R" ''
+'br\}
+.\"
+.\" If the F register is turned on, we'll generate index entries on stderr for
+.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
+.\" entries marked with X<> in POD. Of course, you'll have to process the
+.\" output yourself in some meaningful fashion.
+.if \nF \{\
+. de IX
+. tm Index:\\$1\t\\n%\t"\\$2"
+..
+. nr % 0
+. rr F
+.\}
+.\"
+.\" For nroff, turn off justification. Always turn off hyphenation; it makes
+.\" way too many mistakes in technical documents.
+.hy 0
+.if n .na
+.\"
+.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
+.\" Fear. Run. Save yourself. No user-serviceable parts.
+. \" fudge factors for nroff and troff
+.if n \{\
+. ds #H 0
+. ds #V .8m
+. ds #F .3m
+. ds #[ \f1
+. ds #] \fP
+.\}
+.if t \{\
+. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
+. ds #V .6m
+. ds #F 0
+. ds #[ \&
+. ds #] \&
+.\}
+. \" simple accents for nroff and troff
+.if n \{\
+. ds ' \&
+. ds ` \&
+. ds ^ \&
+. ds , \&
+. ds ~ ~
+. ds /
+.\}
+.if t \{\
+. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
+. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
+. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
+. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
+. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
+. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
+.\}
+. \" troff and (daisy-wheel) nroff accents
+.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
+.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
+.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
+.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
+.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
+.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
+.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
+.ds ae a\h'-(\w'a'u*4/10)'e
+.ds Ae A\h'-(\w'A'u*4/10)'E
+. \" corrections for vroff
+.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
+.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
+. \" for low resolution devices (crt and lpr)
+.if \n(.H>23 .if \n(.V>19 \
+\{\
+. ds : e
+. ds 8 ss
+. ds o a
+. ds d- d\h'-1'\(ga
+. ds D- D\h'-1'\(hy
+. ds th \o'bp'
+. ds Th \o'LP'
+. ds ae ae
+. ds Ae AE
+.\}
+.rm #[ #] #H #V #F C
+.\" ========================================================================
+.\"
+.IX Title "CPP 1"
+.TH CPP 1 "2002-01-26" "gcc-3.0.4" "GNU"
+.SH "NAME"
+cpp \- The C Preprocessor
+.SH "SYNOPSIS"
+.IX Header "SYNOPSIS"
+cpp [\fB\-D\fR\fImacro\fR[=\fIdefn\fR]...] [\fB\-U\fR\fImacro\fR]
+ [\fB\-I\fR\fIdir\fR...] [\fB\-W\fR\fIwarn\fR...]
+ [\fB\-M\fR|\fB\-MM\fR] [\fB\-MG\fR] [\fB\-MF\fR \fIfilename\fR]
+ [\fB\-MP\fR] [\fB\-MQ\fR \fItarget\fR...] [\fB\-MT\fR \fItarget\fR...]
+ [\fB\-x\fR \fIlanguage\fR] [\fB\-std=\fR\fIstandard\fR]
+ \fIinfile\fR \fIoutfile\fR
+.PP
+Only the most useful options are listed here; see below for the remainder.
+.SH "DESCRIPTION"
+.IX Header "DESCRIPTION"
+The C preprocessor, often known as \fIcpp\fR, is a \fImacro processor\fR
+that is used automatically by the C compiler to transform your program
+before compilation. It is called a macro processor because it allows
+you to define \fImacros\fR, which are brief abbreviations for longer
+constructs.
+.PP
+The C preprocessor is intended to be used only with C, \*(C+, and
+Objective-C source code. In the past, it has been abused as a general
+text processor. It will choke on input which does not obey C's lexical
+rules. For example, apostrophes will be interpreted as the beginning of
+character constants, and cause errors. Also, you cannot rely on it
+preserving characteristics of the input which are not significant to
+C\-family languages. If a Makefile is preprocessed, all the hard tabs
+will be removed, and the Makefile will not work.
+.PP
+Having said that, you can often get away with using cpp on things which
+are not C. Other Algol-ish programming languages are often safe
+(Pascal, Ada, etc.) So is assembly, with caution. \fB\-traditional\fR
+mode preserves more white space, and is otherwise more permissive. Many
+of the problems can be avoided by writing C or \*(C+ style comments
+instead of native language comments, and keeping macros simple.
+.PP
+Wherever possible, you should use a preprocessor geared to the language
+you are writing in. Modern versions of the \s-1GNU\s0 assembler have macro
+facilities. Most high level programming languages have their own
+conditional compilation and inclusion mechanism. If all else fails,
+try a true general text processor, such as \s-1GNU\s0 M4.
+.PP
+C preprocessors vary in some details. This manual discusses the \s-1GNU\s0 C
+preprocessor, which provides a small superset of the features of \s-1ISO\s0
+Standard C. In its default mode, the \s-1GNU\s0 C preprocessor does not do a
+few things required by the standard. These are features which are
+rarely, if ever, used, and may cause surprising changes to the meaning
+of a program which does not expect them. To get strict \s-1ISO\s0 Standard C,
+you should use the \fB\-std=c89\fR or \fB\-std=c99\fR options, depending
+on which version of the standard you want. To get all the mandatory
+diagnostics, you must also use \fB\-pedantic\fR.
+.SH "OPTIONS"
+.IX Header "OPTIONS"
+The C preprocessor expects two file names as arguments, \fIinfile\fR and
+\&\fIoutfile\fR. The preprocessor reads \fIinfile\fR together with any
+other files it specifies with \fB#include\fR. All the output generated
+by the combined input files is written in \fIoutfile\fR.
+.PP
+Either \fIinfile\fR or \fIoutfile\fR may be \fB\-\fR, which as
+\&\fIinfile\fR means to read from standard input and as \fIoutfile\fR
+means to write to standard output. Also, if either file is omitted, it
+means the same as if \fB\-\fR had been specified for that file.
+.PP
+Unless otherwise noted, or the option ends in \fB=\fR, all options
+which take an argument may have that argument appear either immediately
+after the option, or with a space between option and argument:
+\&\fB\-Ifoo\fR and \fB\-I foo\fR have the same effect.
+.PP
+Many options have multi-letter names; therefore multiple single-letter
+options may \fInot\fR be grouped: \fB\-dM\fR is very different from
+\&\fB\-d\ \-M\fR.
+.IP "\fB\-D\fR \fIname\fR" 4
+.IX Item "-D name"
+Predefine \fIname\fR as a macro, with definition \f(CW1\fR.
+.IP "\fB\-D\fR \fIname\fR\fB=\fR\fIdefinition\fR" 4
+.IX Item "-D name=definition"
+Predefine \fIname\fR as a macro, with definition \fIdefinition\fR.
+There are no restrictions on the contents of \fIdefinition\fR, but if
+you are invoking the preprocessor from a shell or shell-like program you
+may need to use the shell's quoting syntax to protect characters such as
+spaces that have a meaning in the shell syntax. If you use more than
+one \fB\-D\fR for the same \fIname\fR, the rightmost definition takes
+effect.
+.Sp
+If you wish to define a function-like macro on the command line, write
+its argument list with surrounding parentheses before the equals sign
+(if any). Parentheses are meaningful to most shells, so you will need
+to quote the option. With \fBsh\fR and \fBcsh\fR,
+\&\fB\-D'\fR\fIname\fR\fB(\fR\fIargs...\fR\fB)=\fR\fIdefinition\fR\fB'\fR works.
+.IP "\fB\-U\fR \fIname\fR" 4
+.IX Item "-U name"
+Cancel any previous definition of \fIname\fR, either built in or
+provided with a \fB\-D\fR option.
+.Sp
+All \fB\-imacros\fR \fIfile\fR and \fB\-include\fR \fIfile\fR options
+are processed after all \fB\-D\fR and \fB\-U\fR options.
+.IP "\fB\-undef\fR" 4
+.IX Item "-undef"
+Do not predefine any system-specific macros. The common predefined
+macros remain defined.
+.IP "\fB\-I\fR \fIdir\fR" 4
+.IX Item "-I dir"
+Add the directory \fIdir\fR to the list of directories to be searched
+for header files. Directories named by \fB\-I\fR
+are searched before the standard system include directories.
+.Sp
+It is dangerous to specify a standard system include directory in an
+\&\fB\-I\fR option. This defeats the special treatment of system
+headers. It can also defeat the repairs to
+buggy system headers which \s-1GCC\s0 makes when it is installed.
+.IP "\fB\-o\fR \fIfile\fR" 4
+.IX Item "-o file"
+Write output to \fIfile\fR. This is the same as specifying \fIfile\fR
+as the second non-option argument to \fBcpp\fR. \fBgcc\fR has a
+different interpretation of a second non-option argument, so you must
+use \fB\-o\fR to specify the output file.
+.IP "\fB\-Wall\fR" 4
+.IX Item "-Wall"
+Turns on all optional warnings which are desirable for normal code. At
+present this is \fB\-Wcomment\fR and \fB\-Wtrigraphs\fR. Note that
+many of the preprocessor's warnings are on by default and have no
+options to control them.
+.IP "\fB\-Wcomment\fR" 4
+.IX Item "-Wcomment"
+.PD 0
+.IP "\fB\-Wcomments\fR" 4
+.IX Item "-Wcomments"
+.PD
+Warn whenever a comment-start sequence \fB/*\fR appears in a \fB/*\fR
+comment, or whenever a backslash-newline appears in a \fB//\fR comment.
+(Both forms have the same effect.)
+.IP "\fB\-Wtrigraphs\fR" 4
+.IX Item "-Wtrigraphs"
+Warn if any trigraphs are encountered. This option used to take effect
+only if \fB\-trigraphs\fR was also specified, but now works
+independently. Warnings are not given for trigraphs within comments, as
+they do not affect the meaning of the program.
+.IP "\fB\-Wtraditional\fR" 4
+.IX Item "-Wtraditional"
+Warn about certain constructs that behave differently in traditional and
+\&\s-1ISO\s0 C. Also warn about \s-1ISO\s0 C constructs that have no traditional C
+equivalent, and problematic constructs which should be avoided.
+.IP "\fB\-Wimport\fR" 4
+.IX Item "-Wimport"
+Warn the first time \fB#import\fR is used.
+.IP "\fB\-Wundef\fR" 4
+.IX Item "-Wundef"
+Warn whenever an identifier which is not a macro is encountered in an
+\&\fB#if\fR directive, outside of \fBdefined\fR. Such identifiers are
+replaced with zero.
+.IP "\fB\-Werror\fR" 4
+.IX Item "-Werror"
+Make all warnings into hard errors. Source code which triggers warnings
+will be rejected.
+.IP "\fB\-Wsystem\-headers\fR" 4
+.IX Item "-Wsystem-headers"
+Issue warnings for code in system headers. These are normally unhelpful
+in finding bugs in your own code, therefore suppressed. If you are
+responsible for the system library, you may want to see them.
+.IP "\fB\-w\fR" 4
+.IX Item "-w"
+Suppress all warnings, including those which \s-1GNU\s0 \s-1CPP\s0 issues by default.
+.IP "\fB\-pedantic\fR" 4
+.IX Item "-pedantic"
+Issue all the mandatory diagnostics listed in the C standard. Some of
+them are left out by default, since they trigger frequently on harmless
+code.
+.IP "\fB\-pedantic\-errors\fR" 4
+.IX Item "-pedantic-errors"
+Issue all the mandatory diagnostics, and make all mandatory diagnostics
+into errors. This includes mandatory diagnostics that \s-1GCC\s0 issues
+without \fB\-pedantic\fR but treats as warnings.
+.IP "\fB\-M\fR" 4
+.IX Item "-M"
+Instead of outputting the result of preprocessing, output a rule
+suitable for \fBmake\fR describing the dependencies of the main
+source file. The preprocessor outputs one \fBmake\fR rule containing
+the object file name for that source file, a colon, and the names of all
+the included files, including those coming from \fB\-include\fR or
+\&\fB\-imacros\fR command line options.
+.Sp
+Unless specified explicitly (with \fB\-MT\fR or \fB\-MQ\fR), the
+object file name consists of the basename of the source file with any
+suffix replaced with object file suffix. If there are many included
+files then the rule is split into several lines using \fB\e\fR\-newline.
+The rule has no commands.
+.IP "\fB\-MM\fR" 4
+.IX Item "-MM"
+Like \fB\-M\fR, but mention only the files included with \f(CW\*(C`#include\ "\f(CIfile\f(CW"\*(C'\fR or with \fB\-include\fR or \fB\-imacros\fR command line
+options. System header files included with \f(CW\*(C`#include\ <\f(CIfile\f(CW>\*(C'\fR
+are omitted.
+.IP "\fB\-MF\fR \fIfile\fR" 4
+.IX Item "-MF file"
+When used with \fB\-M\fR or \fB\-MM\fR, specifies a file to write the
+dependencies to. This allows the preprocessor to write the preprocessed
+file to stdout normally. If no \fB\-MF\fR switch is given, \s-1CPP\s0 sends
+the rules to stdout and suppresses normal preprocessed output.
+.IP "\fB\-MG\fR" 4
+.IX Item "-MG"
+When used with \fB\-M\fR or \fB\-MM\fR, \fB\-MG\fR says to treat missing
+header files as generated files and assume they live in the same
+directory as the source file. It suppresses preprocessed output, as a
+missing header file is ordinarily an error.
+.Sp
+This feature is used in automatic updating of makefiles.
+.IP "\fB\-MP\fR" 4
+.IX Item "-MP"
+This option instructs \s-1CPP\s0 to add a phony target for each dependency
+other than the main file, causing each to depend on nothing. These
+dummy rules work around errors \fBmake\fR gives if you remove header
+files without updating the \fIMakefile\fR to match.
+.Sp
+This is typical output:
+.Sp
+.Vb 1
+\& test.o: test.c test.h
+.Ve
+.Sp
+.Vb 1
+\& test.h:
+.Ve
+.IP "\fB\-MT\fR \fItarget\fR" 4
+.IX Item "-MT target"
+Change the target of the rule emitted by dependency generation. By
+default \s-1CPP\s0 takes the name of the main input file, including any path,
+deletes any file suffix such as \fB.c\fR, and appends the platform's
+usual object suffix. The result is the target.
+.Sp
+An \fB\-MT\fR option will set the target to be exactly the string you
+specify. If you want multiple targets, you can specify them as a single
+argument to \fB\-MT\fR, or use multiple \fB\-MT\fR options.
+.Sp
+For example, \fB\-MT\ '$(objpfx)foo.o'\fR might give
+.Sp
+.Vb 1
+\& $(objpfx)foo.o: foo.c
+.Ve
+.IP "\fB\-MQ\fR \fItarget\fR" 4
+.IX Item "-MQ target"
+Same as \fB\-MT\fR, but it quotes any characters which are special to
+Make. \fB\-MQ\ '$(objpfx)foo.o'\fR gives
+.Sp
+.Vb 1
+\& $$(objpfx)foo.o: foo.c
+.Ve
+.Sp
+The default target is automatically quoted, as if it were given with
+\&\fB\-MQ\fR.
+.IP "\fB\-MD\fR \fIfile\fR" 4
+.IX Item "-MD file"
+.PD 0
+.IP "\fB\-MMD\fR \fIfile\fR" 4
+.IX Item "-MMD file"
+.PD
+\&\fB\-MD\fR \fIfile\fR is equivalent to \fB\-M \-MF\fR \fIfile\fR, and
+\&\fB\-MMD\fR \fIfile\fR is equivalent to \fB\-MM \-MF\fR \fIfile\fR.
+.Sp
+Due to limitations in the compiler driver, you must use these switches
+when you want to generate a dependency file as a side-effect of normal
+compilation.
+.IP "\fB\-x c\fR" 4
+.IX Item "-x c"
+.PD 0
+.IP "\fB\-x c++\fR" 4
+.IX Item "-x c++"
+.IP "\fB\-x objective-c\fR" 4
+.IX Item "-x objective-c"
+.IP "\fB\-x assembler-with-cpp\fR" 4
+.IX Item "-x assembler-with-cpp"
+.PD
+Specify the source language: C, \*(C+, Objective\-C, or assembly. This has
+nothing to do with standards conformance or extensions; it merely
+selects which base syntax to expect. If you give none of these options,
+cpp will deduce the language from the extension of the source file:
+\&\fB.c\fR, \fB.cc\fR, \fB.m\fR, or \fB.S\fR. Some other common
+extensions for \*(C+ and assembly are also recognized. If cpp does not
+recognize the extension, it will treat the file as C; this is the most
+generic mode.
+.Sp
+\&\fBNote:\fR Previous versions of cpp accepted a \fB\-lang\fR option
+which selected both the language and the standards conformance level.
+This option has been removed, because it conflicts with the \fB\-l\fR
+option.
+.IP "\fB\-std=\fR\fIstandard\fR" 4
+.IX Item "-std=standard"
+.PD 0
+.IP "\fB\-ansi\fR" 4
+.IX Item "-ansi"
+.PD
+Specify the standard to which the code should conform. Currently cpp
+only knows about the standards for C; other language standards will be
+added in the future.
+.Sp
+\&\fIstandard\fR
+may be one of:
+.RS 4
+.ie n .IP """iso9899:1990""" 4
+.el .IP "\f(CWiso9899:1990\fR" 4
+.IX Item "iso9899:1990"
+.PD 0
+.ie n .IP """c89""" 4
+.el .IP "\f(CWc89\fR" 4
+.IX Item "c89"
+.PD
+The \s-1ISO\s0 C standard from 1990. \fBc89\fR is the customary shorthand for
+this version of the standard.
+.Sp
+The \fB\-ansi\fR option is equivalent to \fB\-std=c89\fR.
+.ie n .IP """iso9899:199409""" 4
+.el .IP "\f(CWiso9899:199409\fR" 4
+.IX Item "iso9899:199409"
+The 1990 C standard, as amended in 1994.
+.ie n .IP """iso9899:1999""" 4
+.el .IP "\f(CWiso9899:1999\fR" 4
+.IX Item "iso9899:1999"
+.PD 0
+.ie n .IP """c99""" 4
+.el .IP "\f(CWc99\fR" 4
+.IX Item "c99"
+.ie n .IP """iso9899:199x""" 4
+.el .IP "\f(CWiso9899:199x\fR" 4
+.IX Item "iso9899:199x"
+.ie n .IP """c9x""" 4
+.el .IP "\f(CWc9x\fR" 4
+.IX Item "c9x"
+.PD
+The revised \s-1ISO\s0 C standard, published in December 1999. Before
+publication, this was known as C9X.
+.ie n .IP """gnu89""" 4
+.el .IP "\f(CWgnu89\fR" 4
+.IX Item "gnu89"
+The 1990 C standard plus \s-1GNU\s0 extensions. This is the default.
+.ie n .IP """gnu99""" 4
+.el .IP "\f(CWgnu99\fR" 4
+.IX Item "gnu99"
+.PD 0
+.ie n .IP """gnu9x""" 4
+.el .IP "\f(CWgnu9x\fR" 4
+.IX Item "gnu9x"
+.PD
+The 1999 C standard plus \s-1GNU\s0 extensions.
+.RE
+.RS 4
+.RE
+.IP "\fB\-I\-\fR" 4
+.IX Item "-I-"
+Split the include path. Any directories specified with \fB\-I\fR
+options before \fB\-I\-\fR are searched only for headers requested with
+\&\f(CW\*(C`#include\ "\f(CIfile\f(CW"\*(C'\fR; they are not searched for
+\&\f(CW\*(C`#include\ <\f(CIfile\f(CW>\*(C'\fR. If additional directories are
+specified with \fB\-I\fR options after the \fB\-I\-\fR, those
+directories are searched for all \fB#include\fR directives.
+.Sp
+In addition, \fB\-I\-\fR inhibits the use of the directory of the current
+file directory as the first search directory for \f(CW\*(C`#include\ "\f(CIfile\f(CW"\*(C'\fR.
+.IP "\fB\-nostdinc\fR" 4
+.IX Item "-nostdinc"
+Do not search the standard system directories for header files.
+Only the directories you have specified with \fB\-I\fR options
+(and the directory of the current file, if appropriate) are searched.
+.IP "\fB\-nostdinc++\fR" 4
+.IX Item "-nostdinc++"
+Do not search for header files in the \*(C+\-specific standard directories,
+but do still search the other standard directories. (This option is
+used when building the \*(C+ library.)
+.IP "\fB\-include\fR \fIfile\fR" 4
+.IX Item "-include file"
+Process \fIfile\fR as if \f(CW\*(C`#include "file"\*(C'\fR appeared as the first
+line of the primary source file. However, the first directory searched
+for \fIfile\fR is the preprocessor's working directory \fIinstead of\fR
+the directory containing the main source file. If not found there, it
+is searched for in the remainder of the \f(CW\*(C`#include "..."\*(C'\fR search
+chain as normal.
+.Sp
+If multiple \fB\-include\fR options are given, the files are included
+in the order they appear on the command line.
+.IP "\fB\-imacros\fR \fIfile\fR" 4
+.IX Item "-imacros file"
+Exactly like \fB\-include\fR, except that any output produced by
+scanning \fIfile\fR is thrown away. Macros it defines remain defined.
+This allows you to acquire all the macros from a header without also
+processing its declarations.
+.Sp
+All files specified by \fB\-imacros\fR are processed before all files
+specified by \fB\-include\fR.
+.IP "\fB\-idirafter\fR \fIdir\fR" 4
+.IX Item "-idirafter dir"
+Search \fIdir\fR for header files, but do it \fIafter\fR all
+directories specified with \fB\-I\fR and the standard system directories
+have been exhausted. \fIdir\fR is treated as a system include directory.
+.IP "\fB\-iprefix\fR \fIprefix\fR" 4
+.IX Item "-iprefix prefix"
+Specify \fIprefix\fR as the prefix for subsequent \fB\-iwithprefix\fR
+options. If the prefix represents a directory, you should include the
+final \fB/\fR.
+.IP "\fB\-iwithprefix\fR \fIdir\fR" 4
+.IX Item "-iwithprefix dir"
+.PD 0
+.IP "\fB\-iwithprefixbefore\fR \fIdir\fR" 4
+.IX Item "-iwithprefixbefore dir"
+.PD
+Append \fIdir\fR to the prefix specified previously with
+\&\fB\-iprefix\fR, and add the resulting directory to the include search
+path. \fB\-iwithprefixbefore\fR puts it in the same place \fB\-I\fR
+would; \fB\-iwithprefix\fR puts it where \fB\-idirafter\fR would.
+.Sp
+Use of these options is discouraged.
+.IP "\fB\-isystem\fR \fIdir\fR" 4
+.IX Item "-isystem dir"
+Search \fIdir\fR for header files, after all directories specified by
+\&\fB\-I\fR but before the standard system directories. Mark it
+as a system directory, so that it gets the same special treatment as
+is applied to the standard system directories.
+.IP "\fB\-fpreprocessed\fR" 4
+.IX Item "-fpreprocessed"
+Indicate to the preprocessor that the input file has already been
+preprocessed. This suppresses things like macro expansion, trigraph
+conversion, escaped newline splicing, and processing of most directives.
+The preprocessor still recognizes and removes comments, so that you can
+pass a file preprocessed with \fB\-C\fR to the compiler without
+problems. In this mode the integrated preprocessor is little more than
+a tokenizer for the front ends.
+.Sp
+\&\fB\-fpreprocessed\fR is implicit if the input file has one of the
+extensions \fB.i\fR, \fB.ii\fR or \fB.mi\fR. These are the
+extensions that \s-1GCC\s0 uses for preprocessed files created by
+\&\fB\-save\-temps\fR.
+.IP "\fB\-ftabstop=\fR\fIwidth\fR" 4
+.IX Item "-ftabstop=width"
+Set the distance between tab stops. This helps the preprocessor report
+correct column numbers in warnings or errors, even if tabs appear on the
+line. If the value is less than 1 or greater than 100, the option is
+ignored. The default is 8.
+.IP "\fB\-fno\-show\-column\fR" 4
+.IX Item "-fno-show-column"
+Do not print column numbers in diagnostics. This may be necessary if
+diagnostics are being scanned by a program that does not understand the
+column numbers, such as \fBdejagnu\fR.
+.IP "\fB\-A\fR \fIpredicate\fR\fB=\fR\fIanswer\fR" 4
+.IX Item "-A predicate=answer"
+Make an assertion with the predicate \fIpredicate\fR and answer
+\&\fIanswer\fR. This form is preferred to the older form \fB\-A\fR
+\&\fIpredicate\fR\fB(\fR\fIanswer\fR\fB)\fR, which is still supported, because
+it does not use shell special characters.
+.IP "\fB\-A \-\fR\fIpredicate\fR\fB=\fR\fIanswer\fR" 4
+.IX Item "-A -predicate=answer"
+Cancel an assertion with the predicate \fIpredicate\fR and answer
+\&\fIanswer\fR.
+.IP "\fB\-A\-\fR" 4
+.IX Item "-A-"
+Cancel all predefined assertions and all assertions preceding it on
+the command line. Also, undefine all predefined macros and all
+macros preceding it on the command line. (This is a historical wart and
+may change in the future.)
+.IP "\fB\-dCHARS\fR" 4
+.IX Item "-dCHARS"
+\&\fI\s-1CHARS\s0\fR is a sequence of one or more of the following characters,
+and must not be preceded by a space. Other characters are interpreted
+by the compiler proper, or reserved for future versions of \s-1GCC\s0, and so
+are silently ignored. If you specify characters whose behavior
+conflicts, the result is undefined.
+.RS 4
+.IP "\fBM\fR" 4
+.IX Item "M"
+Instead of the normal output, generate a list of \fB#define\fR
+directives for all the macros defined during the execution of the
+preprocessor, including predefined macros. This gives you a way of
+finding out what is predefined in your version of the preprocessor.
+Assuming you have no file \fIfoo.h\fR, the command
+.Sp
+.Vb 1
+\& touch foo.h; cpp -dM foo.h
+.Ve
+.Sp
+will show all the predefined macros.
+.IP "\fBD\fR" 4
+.IX Item "D"
+Like \fBM\fR except in two respects: it does \fInot\fR include the
+predefined macros, and it outputs \fIboth\fR the \fB#define\fR
+directives and the result of preprocessing. Both kinds of output go to
+the standard output file.
+.IP "\fBN\fR" 4
+.IX Item "N"
+Like \fBD\fR, but emit only the macro names, not their expansions.
+.IP "\fBI\fR" 4
+.IX Item "I"
+Output \fB#include\fR directives in addition to the result of
+preprocessing.
+.RE
+.RS 4
+.RE
+.IP "\fB\-P\fR" 4
+.IX Item "-P"
+Inhibit generation of linemarkers in the output from the preprocessor.
+This might be useful when running the preprocessor on something that is
+not C code, and will be sent to a program which might be confused by the
+linemarkers.
+.IP "\fB\-C\fR" 4
+.IX Item "-C"
+Do not discard comments. All comments are passed through to the output
+file, except for comments in processed directives, which are deleted
+along with the directive.
+.Sp
+You should be prepared for side effects when using \fB\-C\fR; it
+causes the preprocessor to treat comments as tokens in their own right.
+For example, comments appearing at the start of what would be a
+directive line have the effect of turning that line into an ordinary
+source line, since the first token on the line is no longer a \fB#\fR.
+.IP "\fB\-gcc\fR" 4
+.IX Item "-gcc"
+Define the macros _\|_GNUC_\|_, _\|_GNUC_MINOR_\|_ and
+_\|_GNUC_PATCHLEVEL_\|_. These are defined automatically when you use
+\&\fBgcc \-E\fR; you can turn them off in that case with
+\&\fB\-no\-gcc\fR.
+.IP "\fB\-traditional\fR" 4
+.IX Item "-traditional"
+Try to imitate the behavior of old-fashioned C, as opposed to \s-1ISO\s0
+C.
+.IP "\fB\-trigraphs\fR" 4
+.IX Item "-trigraphs"
+Process trigraph sequences.
+.IP "\fB\-remap\fR" 4
+.IX Item "-remap"
+Enable special code to work around file systems which only permit very
+short file names, such as \s-1MS\-DOS\s0.
+.IP "\fB\-$\fR" 4
+.IX Item "-$"
+Forbid the use of \fB$\fR in identifiers. The C standard allows
+implementations to define extra characters that can appear in
+identifiers. By default \s-1GNU\s0 \s-1CPP\s0 permits \fB$\fR, a common extension.
+.IP "\fB\-h\fR" 4
+.IX Item "-h"
+.PD 0
+.IP "\fB\-\-help\fR" 4
+.IX Item "--help"
+.IP "\fB\-\-target\-help\fR" 4
+.IX Item "--target-help"
+.PD
+Print text describing all the command line options instead of
+preprocessing anything.
+.IP "\fB\-v\fR" 4
+.IX Item "-v"
+Verbose mode. Print out \s-1GNU\s0 \s-1CPP\s0's version number at the beginning of
+execution, and report the final form of the include path.
+.IP "\fB\-H\fR" 4
+.IX Item "-H"
+Print the name of each header file used, in addition to other normal
+activities. Each name is indented to show how deep in the
+\&\fB#include\fR stack it is.
+.IP "\fB\-version\fR" 4
+.IX Item "-version"
+.PD 0
+.IP "\fB\-\-version\fR" 4
+.IX Item "--version"
+.PD
+Print out \s-1GNU\s0 \s-1CPP\s0's version number. With one dash, proceed to
+preprocess as normal. With two dashes, exit immediately.
+.SH "SEE ALSO"
+.IX Header "SEE ALSO"
+\&\fIgpl\fR\|(7), \fIgfdl\fR\|(7), \fIfsf\-funding\fR\|(7),
+\&\fIgcc\fR\|(1), \fIas\fR\|(1), \fIld\fR\|(1), and the Info entries for \fIcpp\fR, \fIgcc\fR, and
+\&\fIbinutils\fR.
+.SH "COPYRIGHT"
+.IX Header "COPYRIGHT"
+Copyright (c) 1987, 1989, 1991, 1992, 1993, 1994, 1995, 1996,
+1997, 1998, 1999, 2000, 2001
+Free Software Foundation, Inc.
+.PP
+Permission is granted to copy, distribute and/or modify this document
+under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.1 or
+any later version published by the Free Software Foundation. A copy of
+the license is included in the
+man page \fIgfdl\fR\|(7).
+This manual contains no Invariant Sections. The Front-Cover Texts are
+(a) (see below), and the Back-Cover Texts are (b) (see below).
+.PP
+(a) The \s-1FSF\s0's Front-Cover Text is:
+.PP
+.Vb 1
+\& A GNU Manual
+.Ve
+.PP
+(b) The \s-1FSF\s0's Back-Cover Text is:
+.PP
+.Vb 3
+\& You have freedom to copy and modify this GNU Manual, like GNU
+\& software. Copies published by the Free Software Foundation raise
+\& funds for GNU development.
+.Ve
diff --git a/gcc/doc/cpp.texi b/gcc/doc/cpp.texi
new file mode 100644
index 00000000000..c299e09e603
--- /dev/null
+++ b/gcc/doc/cpp.texi
@@ -0,0 +1,4287 @@
+\input texinfo
+@setfilename cpp.info
+@settitle The C Preprocessor
+@setchapternewpage off
+@c @smallbook
+@c @cropmarks
+@c @finalout
+
+@macro copyrightnotice
+@c man begin COPYRIGHT
+Copyright @copyright{} 1987, 1989, 1991, 1992, 1993, 1994, 1995, 1996,
+1997, 1998, 1999, 2000, 2001
+Free Software Foundation, Inc.
+
+Permission is granted to copy, distribute and/or modify this document
+under the terms of the GNU Free Documentation License, Version 1.1 or
+any later version published by the Free Software Foundation. A copy of
+the license is included in the
+@c man end
+section entitled ``GNU Free Documentation License''.
+@ignore
+@c man begin COPYRIGHT
+man page gfdl(7).
+@c man end
+@end ignore
+@end macro
+
+@macro covertexts
+@c man begin COPYRIGHT
+This manual contains no Invariant Sections. The Front-Cover Texts are
+(a) (see below), and the Back-Cover Texts are (b) (see below).
+
+(a) The FSF's Front-Cover Text is:
+
+ A GNU Manual
+
+(b) The FSF's Back-Cover Text is:
+
+ You have freedom to copy and modify this GNU Manual, like GNU
+ software. Copies published by the Free Software Foundation raise
+ funds for GNU development.
+@c man end
+@end macro
+
+@macro gcctabopt{body}
+@code{\body\}
+@end macro
+
+@ifinfo
+@dircategory Programming
+@direntry
+* Cpp: (cpp). The GNU C preprocessor.
+@end direntry
+@end ifinfo
+
+@titlepage
+@title The C Preprocessor
+@subtitle Last revised April 2001
+@subtitle for GCC version 3
+@author Richard M. Stallman
+@author Zachary Weinberg
+@page
+@c There is a fill at the bottom of the page, so we need a filll to
+@c override it.
+@vskip 0pt plus 1filll
+@copyrightnotice{}
+@covertexts{}
+@end titlepage
+@contents
+@page
+
+@ifinfo
+@node Top
+@top
+The C preprocessor implements the macro language used to transform C,
+C++, and Objective-C programs before they are compiled. It can also be
+useful on its own.
+
+@menu
+* Overview::
+* Header Files::
+* Macros::
+* Conditionals::
+* Diagnostics::
+* Line Control::
+* Pragmas::
+* Other Directives::
+* Preprocessor Output::
+* Traditional Mode::
+* Implementation Details::
+* Invocation::
+* GNU Free Documentation License::
+* Index of Directives::
+* Concept Index::
+
+@detailmenu
+ --- The Detailed Node Listing ---
+
+Overview
+
+* Initial processing::
+* Tokenization::
+* The preprocessing language::
+
+Header Files
+
+* Include Syntax::
+* Include Operation::
+* Search Path::
+* Once-Only Headers::
+* Computed Includes::
+* Wrapper Headers::
+* System Headers::
+
+Macros
+
+* Object-like Macros::
+* Function-like Macros::
+* Macro Arguments::
+* Stringification::
+* Concatenation::
+* Variadic Macros::
+* Predefined Macros::
+* Undefining and Redefining Macros::
+* Macro Pitfalls::
+
+Predefined Macros
+
+* Standard Predefined Macros::
+* Common Predefined Macros::
+* System-specific Predefined Macros::
+* C++ Named Operators::
+
+Macro Pitfalls
+
+* Misnesting::
+* Operator Precedence Problems::
+* Swallowing the Semicolon::
+* Duplication of Side Effects::
+* Self-Referential Macros::
+* Argument Prescan::
+* Newlines in Arguments::
+
+Conditionals
+
+* Conditional Uses::
+* Conditional Syntax::
+* Deleted Code::
+
+Conditional Syntax
+
+* Ifdef::
+* If::
+* Defined::
+* Else::
+* Elif::
+
+Implementation Details
+
+* Implementation-defined behavior::
+* Implementation limits::
+* Obsolete Features::
+* Differences from previous versions::
+
+Obsolete Features
+
+* Assertions::
+* Obsolete once-only headers::
+* Miscellaneous obsolete features::
+
+@end detailmenu
+@end menu
+
+@copyrightnotice{}
+@covertexts{}
+@end ifinfo
+
+@node Overview
+@chapter Overview
+@c man begin DESCRIPTION
+The C preprocessor, often known as @dfn{cpp}, is a @dfn{macro processor}
+that is used automatically by the C compiler to transform your program
+before compilation. It is called a macro processor because it allows
+you to define @dfn{macros}, which are brief abbreviations for longer
+constructs.
+
+The C preprocessor is intended to be used only with C, C++, and
+Objective-C source code. In the past, it has been abused as a general
+text processor. It will choke on input which does not obey C's lexical
+rules. For example, apostrophes will be interpreted as the beginning of
+character constants, and cause errors. Also, you cannot rely on it
+preserving characteristics of the input which are not significant to
+C-family languages. If a Makefile is preprocessed, all the hard tabs
+will be removed, and the Makefile will not work.
+
+Having said that, you can often get away with using cpp on things which
+are not C@. Other Algol-ish programming languages are often safe
+(Pascal, Ada, etc.) So is assembly, with caution. @option{-traditional}
+mode preserves more white space, and is otherwise more permissive. Many
+of the problems can be avoided by writing C or C++ style comments
+instead of native language comments, and keeping macros simple.
+
+Wherever possible, you should use a preprocessor geared to the language
+you are writing in. Modern versions of the GNU assembler have macro
+facilities. Most high level programming languages have their own
+conditional compilation and inclusion mechanism. If all else fails,
+try a true general text processor, such as GNU M4.
+
+C preprocessors vary in some details. This manual discusses the GNU C
+preprocessor, which provides a small superset of the features of ISO
+Standard C@. In its default mode, the GNU C preprocessor does not do a
+few things required by the standard. These are features which are
+rarely, if ever, used, and may cause surprising changes to the meaning
+of a program which does not expect them. To get strict ISO Standard C,
+you should use the @option{-std=c89} or @option{-std=c99} options, depending
+on which version of the standard you want. To get all the mandatory
+diagnostics, you must also use @option{-pedantic}. @xref{Invocation}.
+@c man end
+
+@menu
+* Initial processing::
+* Tokenization::
+* The preprocessing language::
+@end menu
+
+@node Initial processing
+@section Initial processing
+
+The preprocessor performs a series of textual transformations on its
+input. These happen before all other processing. Conceptually, they
+happen in a rigid order, and the entire file is run through each
+transformation before the next one begins. GNU CPP actually does them
+all at once, for performance reasons. These transformations correspond
+roughly to the first three ``phases of translation'' described in the C
+standard.
+
+@enumerate
+@item
+@cindex character sets
+@cindex line endings
+The input file is read into memory and broken into lines.
+
+GNU CPP expects its input to be a text file, that is, an unstructured
+stream of ASCII characters, with some characters indicating the end of a
+line of text. Extended ASCII character sets, such as ISO Latin-1 or
+Unicode encoded in UTF-8, are also acceptable. Character sets that are
+not strict supersets of seven-bit ASCII will not work. We plan to add
+complete support for international character sets in a future release.
+
+Different systems use different conventions to indicate the end of a
+line. GCC accepts the ASCII control sequences @kbd{LF}, @kbd{@w{CR
+LF}}, @kbd{CR}, and @kbd{@w{LF CR}} as end-of-line markers. The first
+three are the canonical sequences used by Unix, DOS and VMS, and the
+classic Mac OS (before OSX) respectively. You may therefore safely copy
+source code written on any of those systems to a different one and use
+it without conversion. (GCC may lose track of the current line number
+if a file doesn't consistently use one convention, as sometimes happens
+when it is edited on computers with different conventions that share a
+network file system.) @kbd{@w{LF CR}} is included because it has been
+reported as an end-of-line marker under exotic conditions.
+
+If the last line of any input file lacks an end-of-line marker, the end
+of the file is considered to implicitly supply one. The C standard says
+that this condition provokes undefined behavior, so GCC will emit a
+warning message.
+
+@item
+@cindex trigraphs
+If trigraphs are enabled, they are replaced by their corresponding
+single characters.
+
+These are nine three-character sequences, all starting with @samp{??},
+that are defined by ISO C to stand for single characters. They permit
+obsolete systems that lack some of C's punctuation to use C@. For
+example, @samp{??/} stands for @samp{\}, so @t{'??/n'} is a character
+constant for a newline. By default, GCC ignores trigraphs, but if you
+request a strictly conforming mode with the @option{-std} option, then
+it converts them.
+
+Trigraphs are not popular and many compilers implement them incorrectly.
+Portable code should not rely on trigraphs being either converted or
+ignored. If you use the @option{-Wall} or @option{-Wtrigraphs} options,
+GCC will warn you when a trigraph would change the meaning of your
+program if it were converted.
+
+In a string constant, you can prevent a sequence of question marks from
+being confused with a trigraph by inserting a backslash between the
+question marks. @t{"(??\?)"} is the string @samp{(???)}, not
+@samp{(?]}. Traditional C compilers do not recognize this idiom.
+
+The nine trigraphs and their replacements are
+
+@example
+Trigraph: ??( ??) ??< ??> ??= ??/ ??' ??! ??-
+Replacement: [ ] @{ @} # \ ^ | ~
+@end example
+
+@item
+@cindex continued lines
+@cindex backslash-newline
+Continued lines are merged into one long line.
+
+A continued line is a line which ends with a backslash, @samp{\}. The
+backslash is removed and the following line is joined with the current
+one. No space is inserted, so you may split a line anywhere, even in
+the middle of a word. (It is generally more readable to split lines
+only at white space.)
+
+The trailing backslash on a continued line is commonly referred to as a
+@dfn{backslash-newline}.
+
+If there is white space between a backslash and the end of a line, that
+is still a continued line. However, as this is usually the result of an
+editing mistake, and many compilers will not accept it as a continued
+line, GCC will warn you about it.
+
+@item
+@cindex comments
+@cindex line comments
+@cindex block comments
+All comments are replaced with single spaces.
+
+There are two kinds of comments. @dfn{Block comments} begin with
+@samp{/*} and continue until the next @samp{*/}. Block comments do not
+nest:
+
+@example
+/* @r{this is} /* @r{one comment} */ @r{text outside comment}
+@end example
+
+@dfn{Line comments} begin with @samp{//} and continue to the end of the
+current line. Line comments do not nest either, but it does not matter,
+because they would end in the same place anyway.
+
+@example
+// @r{this is} // @r{one comment}
+@r{text outside comment}
+@end example
+@end enumerate
+
+It is safe to put line comments inside block comments, or vice versa.
+
+@example
+@group
+/* @r{block comment}
+ // @r{contains line comment}
+ @r{yet more comment}
+ */ @r{outside comment}
+
+// @r{line comment} /* @r{contains block comment} */
+@end group
+@end example
+
+But beware of commenting out one end of a block comment with a line
+comment.
+
+@example
+@group
+ // @r{l.c.} /* @r{block comment begins}
+ @r{oops! this isn't a comment anymore} */
+@end group
+@end example
+
+Comments are not recognized within string literals. @t{@w{"/* blah
+*/"}} is the string constant @samp{@w{/* blah */}}, not an empty string.
+
+Line comments are not in the 1989 edition of the C standard, but they
+are recognized by GCC as an extension. In C++ and in the 1999 edition
+of the C standard, they are an official part of the language.
+
+Since these transformations happen before all other processing, you can
+split a line mechanically with backslash-newline anywhere. You can
+comment out the end of a line. You can continue a line comment onto the
+next line with backslash-newline. You can even split @samp{/*},
+@samp{*/}, and @samp{//} onto multiple lines with backslash-newline.
+For example:
+
+@example
+@group
+/\
+*
+*/ # /*
+*/ defi\
+ne FO\
+O 10\
+20
+@end group
+@end example
+
+@noindent
+is equivalent to @code{@w{#define FOO 1020}}. All these tricks are
+extremely confusing and should not be used in code intended to be
+readable.
+
+There is no way to prevent a backslash at the end of a line from being
+interpreted as a backslash-newline.
+
+@example
+"foo\\
+bar"
+@end example
+
+@noindent
+is equivalent to @code{"foo\bar"}, not to @code{"foo\\bar"}. To avoid
+having to worry about this, do not use the deprecated GNU extension
+which permits multi-line strings. Instead, use string literal
+concatenation:
+
+@example
+ "foo\\"
+ "bar"
+@end example
+
+@noindent
+Your program will be more portable this way, too.
+
+@node Tokenization
+@section Tokenization
+
+@cindex tokens
+@cindex preprocessing tokens
+After the textual transformations are finished, the input file is
+converted into a sequence of @dfn{preprocessing tokens}. These mostly
+correspond to the syntactic tokens used by the C compiler, but there are
+a few differences. White space separates tokens; it is not itself a
+token of any kind. Tokens do not have to be separated by white space,
+but it is often necessary to avoid ambiguities.
+
+When faced with a sequence of characters that has more than one possible
+tokenization, the preprocessor is greedy. It always makes each token,
+starting from the left, as big as possible before moving on to the next
+token. For instance, @code{a+++++b} is interpreted as
+@code{@w{a ++ ++ + b}}, not as @code{@w{a ++ + ++ b}}, even though the
+latter tokenization could be part of a valid C program and the former
+could not.
+
+Once the input file is broken into tokens, the token boundaries never
+change, except when the @samp{##} preprocessing operator is used to paste
+tokens together. @xref{Concatenation}. For example,
+
+@example
+@group
+#define foo() bar
+foo()baz
+ @expansion{} bar baz
+@emph{not}
+ @expansion{} barbaz
+@end group
+@end example
+
+The compiler does not re-tokenize the preprocessor's output. Each
+preprocessing token becomes one compiler token.
+
+@cindex identifiers
+Preprocessing tokens fall into five broad classes: identifiers,
+preprocessing numbers, string literals, punctuators, and other. An
+@dfn{identifier} is the same as an identifier in C: any sequence of
+letters, digits, or underscores, which begins with a letter or
+underscore. Keywords of C have no significance to the preprocessor;
+they are ordinary identifiers. You can define a macro whose name is a
+keyword, for instance. The only identifier which can be considered a
+preprocessing keyword is @code{defined}. @xref{Defined}.
+
+This is mostly true of other languages which use the C preprocessor.
+However, a few of the keywords of C++ are significant even in the
+preprocessor. @xref{C++ Named Operators}.
+
+In the 1999 C standard, identifiers may contain letters which are not
+part of the ``basic source character set,'' at the implementation's
+discretion (such as accented Latin letters, Greek letters, or Chinese
+ideograms). This may be done with an extended character set, or the
+@samp{\u} and @samp{\U} escape sequences. GCC does not presently
+implement either feature in the preprocessor or the compiler.
+
+As an extension, GCC treats @samp{$} as a letter. This is for
+compatibility with some systems, such as VMS, where @samp{$} is commonly
+used in system-defined function and object names. @samp{$} is not a
+letter in strictly conforming mode, or if you specify the @option{-$}
+option. @xref{Invocation}.
+
+@cindex numbers
+@cindex preprocessing numbers
+A @dfn{preprocessing number} has a rather bizarre definition. The
+category includes all the normal integer and floating point constants
+one expects of C, but also a number of other things one might not
+initially recognize as a number. Formally, preprocessing numbers begin
+with an optional period, a required decimal digit, and then continue
+with any sequence of letters, digits, underscores, periods, and
+exponents. Exponents are the two-character sequences @samp{e+},
+@samp{e-}, @samp{E+}, @samp{E-}, @samp{p+}, @samp{p-}, @samp{P+}, and
+@samp{P-}. (The exponents that begin with @samp{p} or @samp{P} are new
+to C99. They are used for hexadecimal floating-point constants.)
+
+The purpose of this unusual definition is to isolate the preprocessor
+from the full complexity of numeric constants. It does not have to
+distinguish between lexically valid and invalid floating-point numbers,
+which is complicated. The definition also permits you to split an
+identifier at any position and get exactly two tokens, which can then be
+pasted back together with the @samp{##} operator.
+
+It's possible for preprocessing numbers to cause programs to be
+misinterpreted. For example, @code{0xE+12} is a preprocessing number
+which does not translate to any valid numeric constant, therefore a
+syntax error. It does not mean @code{@w{0xE + 12}}, which is what you
+might have intended.
+
+@cindex string literals
+@cindex string constants
+@cindex character constants
+@cindex header file names
+@c the @: prevents makeinfo from turning '' into ".
+@dfn{String literals} are string constants, character constants, and
+header file names (the argument of @samp{#include}).@footnote{The C
+standard uses the term @dfn{string literal} to refer only to what we are
+calling @dfn{string constants}.} String constants and character
+constants are straightforward: @t{"@dots{}"} or @t{'@dots{}'}. In
+either case embedded quotes should be escaped with a backslash:
+@t{'\'@:'} is the character constant for @samp{'}. There is no limit on
+the length of a character constant, but the value of a character
+constant that contains more than one character is
+implementation-defined. @xref{Implementation Details}.
+
+Header file names either look like string constants, @t{"@dots{}"}, or are
+written with angle brackets instead, @t{<@dots{}>}. In either case,
+backslash is an ordinary character. There is no way to escape the
+closing quote or angle bracket. The preprocessor looks for the header
+file in different places depending on which form you use. @xref{Include
+Operation}.
+
+In standard C, no string literal may extend past the end of a line. GNU
+CPP accepts multi-line string constants, but not multi-line character
+constants or header file names. This extension is deprecated and will
+be removed in GCC 3.1. You may use continued lines instead, or string
+constant concatenation. @xref{Differences from previous versions}.
+
+@cindex punctuators
+@cindex digraphs
+@cindex alternative tokens
+@dfn{Punctuators} are all the usual bits of punctuation which are
+meaningful to C and C++. All but three of the punctuation characters in
+ASCII are C punctuators. The exceptions are @samp{@@}, @samp{$}, and
+@samp{`}. In addition, all the two- and three-character operators are
+punctuators. There are also six @dfn{digraphs}, which the C++ standard
+calls @dfn{alternative tokens}, which are merely alternate ways to spell
+other punctuators. This is a second attempt to work around missing
+punctuation in obsolete systems. It has no negative side effects,
+unlike trigraphs, but does not cover as much ground. The digraphs and
+their corresponding normal punctuators are:
+
+@example
+Digraph: <% %> <: :> %: %:%:
+Punctuator: @{ @} [ ] # ##
+@end example
+
+@cindex other tokens
+Any other single character is considered ``other.'' It is passed on to
+the preprocessor's output unmolested. The C compiler will almost
+certainly reject source code containing ``other'' tokens. In ASCII, the
+only other characters are @samp{@@}, @samp{$}, @samp{`}, and control
+characters other than NUL (all bits zero). (Note that @samp{$} is
+normally considered a letter.) All characters with the high bit set
+(numeric range 0x7F--0xFF) are also ``other'' in the present
+implementation. This will change when proper support for international
+character sets is added to GCC@.
+
+NUL is a special case because of the high probability that its
+appearance is accidental, and because it may be invisible to the user
+(many terminals do not display NUL at all). Within comments, NULs are
+silently ignored, just as any other character would be. In running
+text, NUL is considered white space. For example, these two directives
+have the same meaning.
+
+@example
+#define X^@@1
+#define X 1
+@end example
+
+@noindent
+(where @samp{^@@} is ASCII NUL)@. Within string or character constants,
+NULs are preserved. In the latter two cases the preprocessor emits a
+warning message.
+
+@node The preprocessing language
+@section The preprocessing language
+@cindex directives
+@cindex preprocessing directives
+@cindex directive line
+@cindex directive name
+
+After tokenization, the stream of tokens may simply be passed straight
+to the compiler's parser. However, if it contains any operations in the
+@dfn{preprocessing language}, it will be transformed first. This stage
+corresponds roughly to the standard's ``translation phase 4'' and is
+what most people think of as the preprocessor's job.
+
+The preprocessing language consists of @dfn{directives} to be executed
+and @dfn{macros} to be expanded. Its primary capabilities are:
+
+@itemize @bullet
+@item
+Inclusion of header files. These are files of declarations that can be
+substituted into your program.
+
+@item
+Macro expansion. You can define @dfn{macros}, which are abbreviations
+for arbitrary fragments of C code. The preprocessor will replace the
+macros with their definitions throughout the program. Some macros are
+automatically defined for you.
+
+@item
+Conditional compilation. You can include or exclude parts of the
+program according to various conditions.
+
+@item
+Line control. If you use a program to combine or rearrange source files
+into an intermediate file which is then compiled, you can use line
+control to inform the compiler where each source line originally came
+from.
+
+@item
+Diagnostics. You can detect problems at compile time and issue errors
+or warnings.
+@end itemize
+
+There are a few more, less useful, features.
+
+Except for expansion of predefined macros, all these operations are
+triggered with @dfn{preprocessing directives}. Preprocessing directives
+are lines in your program that start with @samp{#}. Whitespace is
+allowed before and after the @samp{#}. The @samp{#} is followed by an
+identifier, the @dfn{directive name}. It specifies the operation to
+perform. Directives are commonly referred to as @samp{#@var{name}}
+where @var{name} is the directive name. For example, @samp{#define} is
+the directive that defines a macro.
+
+The @samp{#} which begins a directive cannot come from a macro
+expansion. Also, the directive name is not macro expanded. Thus, if
+@code{foo} is defined as a macro expanding to @code{define}, that does
+not make @samp{#foo} a valid preprocessing directive.
+
+The set of valid directive names is fixed. Programs cannot define new
+preprocessing directives.
+
+Some directives require arguments; these make up the rest of the
+directive line and must be separated from the directive name by
+whitespace. For example, @samp{#define} must be followed by a macro
+name and the intended expansion of the macro.
+
+A preprocessing directive cannot cover more than one line. The line
+may, however, be continued with backslash-newline, or by a block comment
+which extends past the end of the line. In either case, when the
+directive is processed, the continuations have already been merged with
+the first line to make one long line.
+
+@node Header Files
+@chapter Header Files
+
+@cindex header file
+A header file is a file containing C declarations and macro definitions
+(@pxref{Macros}) to be shared between several source files. You request
+the use of a header file in your program by @dfn{including} it, with the
+C preprocessing directive @samp{#include}.
+
+Header files serve two purposes.
+
+@itemize @bullet
+@item
+@cindex system header files
+System header files declare the interfaces to parts of the operating
+system. You include them in your program to supply the definitions and
+declarations you need to invoke system calls and libraries.
+
+@item
+Your own header files contain declarations for interfaces between the
+source files of your program. Each time you have a group of related
+declarations and macro definitions all or most of which are needed in
+several different source files, it is a good idea to create a header
+file for them.
+@end itemize
+
+Including a header file produces the same results as copying the header
+file into each source file that needs it. Such copying would be
+time-consuming and error-prone. With a header file, the related
+declarations appear in only one place. If they need to be changed, they
+can be changed in one place, and programs that include the header file
+will automatically use the new version when next recompiled. The header
+file eliminates the labor of finding and changing all the copies as well
+as the risk that a failure to find one copy will result in
+inconsistencies within a program.
+
+In C, the usual convention is to give header files names that end with
+@file{.h}. It is most portable to use only letters, digits, dashes, and
+underscores in header file names, and at most one dot.
+
+@menu
+* Include Syntax::
+* Include Operation::
+* Search Path::
+* Once-Only Headers::
+* Computed Includes::
+* Wrapper Headers::
+* System Headers::
+@end menu
+
+@node Include Syntax
+@section Include Syntax
+
+@findex #include
+Both user and system header files are included using the preprocessing
+directive @samp{#include}. It has two variants:
+
+@table @code
+@item #include <@var{file}>
+This variant is used for system header files. It searches for a file
+named @var{file} in a standard list of system directories. You can prepend
+directories to this list with the @option{-I} option (@pxref{Invocation}).
+
+@item #include "@var{file}"
+This variant is used for header files of your own program. It searches
+for a file named @var{file} first in the directory containing the
+current file, then in the same directories used for @code{<@var{file}>}.
+@end table
+
+The argument of @samp{#include}, whether delimited with quote marks or
+angle brackets, behaves like a string constant in that comments are not
+recognized, and macro names are not expanded. Thus, @code{@w{#include
+<x/*y>}} specifies inclusion of a system header file named @file{x/*y}.
+
+However, if backslashes occur within @var{file}, they are considered
+ordinary text characters, not escape characters. None of the character
+escape sequences appropriate to string constants in C are processed.
+Thus, @code{@w{#include "x\n\\y"}} specifies a filename containing three
+backslashes. (Some systems interpret @samp{\} as a pathname separator.
+All of these also interpret @samp{/} the same way. It is most portable
+to use only @samp{/}.)
+
+It is an error if there is anything (other than comments) on the line
+after the file name.
+
+@node Include Operation
+@section Include Operation
+
+The @samp{#include} directive works by directing the C preprocessor to
+scan the specified file as input before continuing with the rest of the
+current file. The output from the preprocessor contains the output
+already generated, followed by the output resulting from the included
+file, followed by the output that comes from the text after the
+@samp{#include} directive. For example, if you have a header file
+@file{header.h} as follows,
+
+@example
+char *test (void);
+@end example
+
+@noindent
+and a main program called @file{program.c} that uses the header file,
+like this,
+
+@example
+int x;
+#include "header.h"
+
+int
+main (void)
+@{
+ puts (test ());
+@}
+@end example
+
+@noindent
+the compiler will see the same token stream as it would if
+@file{program.c} read
+
+@example
+int x;
+char *test (void);
+
+int
+main (void)
+@{
+ puts (test ());
+@}
+@end example
+
+Included files are not limited to declarations and macro definitions;
+those are merely the typical uses. Any fragment of a C program can be
+included from another file. The include file could even contain the
+beginning of a statement that is concluded in the containing file, or
+the end of a statement that was started in the including file. However,
+a comment or a string or character constant may not start in the
+included file and finish in the including file. An unterminated
+comment, string constant or character constant in an included file is
+considered to end (with an error message) at the end of the file.
+
+To avoid confusion, it is best if header files contain only complete
+syntactic units---function declarations or definitions, type
+declarations, etc.
+
+The line following the @samp{#include} directive is always treated as a
+separate line by the C preprocessor, even if the included file lacks a
+final newline.
+
+@node Search Path
+@section Search Path
+
+GCC looks in several different places for headers. On a normal Unix
+system, if you do not instruct it otherwise, it will look for headers
+requested with @code{@w{#include <@var{file}>}} in:
+
+@example
+/usr/local/include
+/usr/lib/gcc-lib/@var{target}/@var{version}/include
+/usr/@var{target}/include
+/usr/include
+@end example
+
+For C++ programs, it will also look in @file{/usr/include/g++-v3},
+first. In the above, @var{target} is the canonical name of the system
+GCC was configured to compile code for; often but not always the same as
+the canonical name of the system it runs on. @var{version} is the
+version of GCC in use.
+
+You can add to this list with the @option{-I@var{dir}} command line
+option. All the directories named by @option{-I} are searched, in
+left-to-right order, @emph{before} the default directories. You can
+also prevent GCC from searching any of the default directories with the
+@option{-nostdinc} option. This is useful when you are compiling an
+operating system kernel or some other program that does not use the
+standard C library facilities, or the standard C library itself.
+
+GCC looks for headers requested with @code{@w{#include "@var{file}"}}
+first in the directory containing the current file, then in the same
+places it would have looked for a header requested with angle brackets.
+For example, if @file{/usr/include/sys/stat.h} contains
+@code{@w{#include "types.h"}}, GCC looks for @file{types.h} first in
+@file{/usr/include/sys}, then in its usual search path.
+
+@samp{#line} (@pxref{Line Control}) does not change GCC's idea of the
+directory containing the current file.
+
+You may put @option{-I-} at any point in your list of @option{-I} options.
+This has two effects. First, directories appearing before the
+@option{-I-} in the list are searched only for headers requested with
+quote marks. Directories after @option{-I-} are searched for all
+headers. Second, the directory containing the current file is not
+searched for anything, unless it happens to be one of the directories
+named by an @option{-I} switch.
+
+@option{-I. -I-} is not the same as no @option{-I} options at all, and does
+not cause the same behavior for @samp{<>} includes that @samp{""}
+includes get with no special options. @option{-I.} searches the
+compiler's current working directory for header files. That may or may
+not be the same as the directory containing the current file.
+
+If you need to look for headers in a directory named @file{-}, write
+@option{-I./-}.
+
+There are several more ways to adjust the header search path. They are
+generally less useful. @xref{Invocation}.
+
+@node Once-Only Headers
+@section Once-Only Headers
+@cindex repeated inclusion
+@cindex including just once
+@cindex wrapper @code{#ifndef}
+
+If a header file happens to be included twice, the compiler will process
+its contents twice. This is very likely to cause an error, e.g.@: when the
+compiler sees the same structure definition twice. Even if it does not,
+it will certainly waste time.
+
+The standard way to prevent this is to enclose the entire real contents
+of the file in a conditional, like this:
+
+@example
+@group
+/* File foo. */
+#ifndef FILE_FOO_SEEN
+#define FILE_FOO_SEEN
+
+@var{the entire file}
+
+#endif /* !FILE_FOO_SEEN */
+@end group
+@end example
+
+This construct is commonly known as a @dfn{wrapper #ifndef}.
+When the header is included again, the conditional will be false,
+because @code{FILE_FOO_SEEN} is defined. The preprocessor will skip
+over the entire contents of the file, and the compiler will not see it
+twice.
+
+GNU CPP optimizes even further. It remembers when a header file has a
+wrapper @samp{#ifndef}. If a subsequent @samp{#include} specifies that
+header, and the macro in the @samp{#ifndef} is still defined, it does
+not bother to rescan the file at all.
+
+You can put comments outside the wrapper. They will not interfere with
+this optimization.
+
+@cindex controlling macro
+@cindex guard macro
+The macro @code{FILE_FOO_SEEN} is called the @dfn{controlling macro} or
+@dfn{guard macro}. In a user header file, the macro name should not
+begin with @samp{_}. In a system header file, it should begin with
+@samp{__} to avoid conflicts with user programs. In any kind of header
+file, the macro name should contain the name of the file and some
+additional text, to avoid conflicts with other header files.
+
+@node Computed Includes
+@section Computed Includes
+@cindex computed includes
+@cindex macros in include
+
+Sometimes it is necessary to select one of several different header
+files to be included into your program. They might specify
+configuration parameters to be used on different sorts of operating
+systems, for instance. You could do this with a series of conditionals,
+
+@example
+#if SYSTEM_1
+# include "system_1.h"
+#elif SYSTEM_2
+# include "system_2.h"
+#elif SYSTEM_3
+@dots{}
+#endif
+@end example
+
+That rapidly becomes tedious. Instead, the preprocessor offers the
+ability to use a macro for the header name. This is called a
+@dfn{computed include}. Instead of writing a header name as the direct
+argument of @samp{#include}, you simply put a macro name there instead:
+
+@example
+#define SYSTEM_H "system_1.h"
+@dots{}
+#include SYSTEM_H
+@end example
+
+@noindent
+@code{SYSTEM_H} will be expanded, and the preprocessor will look for
+@file{system_1.h} as if the @samp{#include} had been written that way
+originally. @code{SYSTEM_H} could be defined by your Makefile with a
+@option{-D} option.
+
+You must be careful when you define the macro. @samp{#define} saves
+tokens, not text. The preprocessor has no way of knowing that the macro
+will be used as the argument of @samp{#include}, so it generates
+ordinary tokens, not a header name. This is unlikely to cause problems
+if you use double-quote includes, which are close enough to string
+constants. If you use angle brackets, however, you may have trouble.
+
+The syntax of a computed include is actually a bit more general than the
+above. If the first non-whitespace character after @samp{#include} is
+not @samp{"} or @samp{<}, then the entire line is macro-expanded
+like running text would be.
+
+If the line expands to a single string constant, the contents of that
+string constant are the file to be included. CPP does not re-examine the
+string for embedded quotes, but neither does it process backslash
+escapes in the string. Therefore
+
+@example
+#define HEADER "a\"b"
+#include HEADER
+@end example
+
+@noindent
+looks for a file named @file{a\"b}. CPP searches for the file according
+to the rules for double-quoted includes.
+
+If the line expands to a token stream beginning with a @samp{<} token
+and including a @samp{>} token, then the tokens between the @samp{<} and
+the first @samp{>} are combined to form the filename to be included.
+Any whitespace between tokens is reduced to a single space; then any
+space after the initial @samp{<} is retained, but a trailing space
+before the closing @samp{>} is ignored. CPP searches for the file
+according to the rules for angle-bracket includes.
+
+In either case, if there are any tokens on the line after the file name,
+an error occurs and the directive is not processed. It is also an error
+if the result of expansion does not match either of the two expected
+forms.
+
+These rules are implementation-defined behavior according to the C
+standard. To minimize the risk of different compilers interpreting your
+computed includes differently, we recommend you use only a single
+object-like macro which expands to a string constant. This will also
+minimize confusion for people reading your program.
+
+@node Wrapper Headers
+@section Wrapper Headers
+@cindex wrapper headers
+@cindex overriding a header file
+@findex #include_next
+
+Sometimes it is necessary to adjust the contents of a system-provided
+header file without editing it directly. GCC's @command{fixincludes}
+operation does this, for example. One way to do that would be to create
+a new header file with the same name and insert it in the search path
+before the original header. That works fine as long as you're willing
+to replace the old header entirely. But what if you want to refer to
+the old header from the new one?
+
+You cannot simply include the old header with @samp{#include}. That
+will start from the beginning, and find your new header again. If your
+header is not protected from multiple inclusion (@pxref{Once-Only
+Headers}), it will recurse infinitely and cause a fatal error.
+
+You could include the old header with an absolute pathname:
+@example
+#include "/usr/include/old-header.h"
+@end example
+@noindent
+This works, but is not clean; should the system headers ever move, you
+would have to edit the new headers to match.
+
+There is no way to solve this problem within the C standard, but you can
+use the GNU extension @samp{#include_next}. It means, ``Include the
+@emph{next} file with this name.'' This directive works like
+@samp{#include} except in searching for the specified file: it starts
+searching the list of header file directories @emph{after} the directory
+in which the current file was found.
+
+Suppose you specify @option{-I /usr/local/include}, and the list of
+directories to search also includes @file{/usr/include}; and suppose
+both directories contain @file{signal.h}. Ordinary @code{@w{#include
+<signal.h>}} finds the file under @file{/usr/local/include}. If that
+file contains @code{@w{#include_next <signal.h>}}, it starts searching
+after that directory, and finds the file in @file{/usr/include}.
+
+@samp{#include_next} does not distinguish between @code{<@var{file}>}
+and @code{"@var{file}"} inclusion, nor does it check that the file you
+specify has the same name as the current file. It simply looks for the
+file named, starting with the directory in the search path after the one
+where the current file was found.
+
+The use of @samp{#include_next} can lead to great confusion. We
+recommend it be used only when there is no other alternative. In
+particular, it should not be used in the headers belonging to a specific
+program; it should be used only to make global corrections along the
+lines of @command{fixincludes}.
+
+@node System Headers
+@section System Headers
+@cindex system header files
+
+The header files declaring interfaces to the operating system and
+runtime libraries often cannot be written in strictly conforming C@.
+Therefore, GCC gives code found in @dfn{system headers} special
+treatment. All warnings, other than those generated by @samp{#warning}
+(@pxref{Diagnostics}), are suppressed while GCC is processing a system
+header. Macros defined in a system header are immune to a few warnings
+wherever they are expanded. This immunity is granted on an ad-hoc
+basis, when we find that a warning generates lots of false positives
+because of code in macros defined in system headers.
+
+Normally, only the headers found in specific directories are considered
+system headers. These directories are determined when GCC is compiled.
+There are, however, two ways to make normal headers into system headers.
+
+The @option{-isystem} command line option adds its argument to the list of
+directories to search for headers, just like @option{-I}. Any headers
+found in that directory will be considered system headers.
+
+All directories named by @option{-isystem} are searched @emph{after} all
+directories named by @option{-I}, no matter what their order was on the
+command line. If the same directory is named by both @option{-I} and
+@option{-isystem}, @option{-I} wins; it is as if the @option{-isystem} option
+had never been specified at all.
+
+@findex #pragma GCC system_header
+There is also a directive, @code{@w{#pragma GCC system_header}}, which
+tells GCC to consider the rest of the current include file a system
+header, no matter where it was found. Code that comes before the
+@samp{#pragma} in the file will not be affected. @code{@w{#pragma GCC
+system_header}} has no effect in the primary source file.
+
+On very old systems, some of the pre-defined system header directories
+get even more special treatment. GNU C++ considers code in headers
+found in those directories to be surrounded by an @code{@w{extern "C"}}
+block. There is no way to request this behavior with a @samp{#pragma},
+or from the command line.
+
+@node Macros
+@chapter Macros
+
+A @dfn{macro} is a fragment of code which has been given a name.
+Whenever the name is used, it is replaced by the contents of the macro.
+There are two kinds of macros. They differ mostly in what they look
+like when they are used. @dfn{Object-like} macros resemble data objects
+when used, @dfn{function-like} macros resemble function calls.
+
+You may define any valid identifier as a macro, even if it is a C
+keyword. The preprocessor does not know anything about keywords. This
+can be useful if you wish to hide a keyword such as @code{const} from an
+older compiler that does not understand it. However, the preprocessor
+operator @code{defined} (@pxref{Defined}) can never be defined as a
+macro, and C++'s named operators (@pxref{C++ Named Operators}) cannot be
+macros when you are compiling C++.
+
+@menu
+* Object-like Macros::
+* Function-like Macros::
+* Macro Arguments::
+* Stringification::
+* Concatenation::
+* Variadic Macros::
+* Predefined Macros::
+* Undefining and Redefining Macros::
+* Macro Pitfalls::
+@end menu
+
+@node Object-like Macros
+@section Object-like Macros
+@cindex object-like macro
+@cindex symbolic constants
+@cindex manifest constants
+
+An @dfn{object-like macro} is a simple identifier which will be replaced
+by a code fragment. It is called object-like because it looks like a
+data object in code that uses it. They are most commonly used to give
+symbolic names to numeric constants.
+
+@findex #define
+You create macros with the @samp{#define} directive. @samp{#define} is
+followed by the name of the macro and then the token sequence it should
+be an abbreviation for, which is variously referred to as the macro's
+@dfn{body}, @dfn{expansion} or @dfn{replacement list}. For example,
+
+@example
+#define BUFFER_SIZE 1024
+@end example
+
+@noindent
+defines a macro named @code{BUFFER_SIZE} as an abbreviation for the
+token @code{1024}. If somewhere after this @samp{#define} directive
+there comes a C statement of the form
+
+@example
+foo = (char *) malloc (BUFFER_SIZE);
+@end example
+
+@noindent
+then the C preprocessor will recognize and @dfn{expand} the macro
+@code{BUFFER_SIZE}. The C compiler will see the same tokens as it would
+if you had written
+
+@example
+foo = (char *) malloc (1024);
+@end example
+
+By convention, macro names are written in upper case. Programs are
+easier to read when it is possible to tell at a glance which names are
+macros.
+
+The macro's body ends at the end of the @samp{#define} line. You may
+continue the definition onto multiple lines, if necessary, using
+backslash-newline. When the macro is expanded, however, it will all
+come out on one line. For example,
+
+@example
+#define NUMBERS 1, \
+ 2, \
+ 3
+int x[] = @{ NUMBERS @};
+ @expansion{} int x[] = @{ 1, 2, 3 @};
+@end example
+
+@noindent
+The most common visible consequence of this is surprising line numbers
+in error messages.
+
+There is no restriction on what can go in a macro body provided it
+decomposes into valid preprocessing tokens. Parentheses need not
+balance, and the body need not resemble valid C code. (If it does not,
+you may get error messages from the C compiler when you use the macro.)
+
+The C preprocessor scans your program sequentially. Macro definitions
+take effect at the place you write them. Therefore, the following input
+to the C preprocessor
+
+@example
+foo = X;
+#define X 4
+bar = X;
+@end example
+
+@noindent
+produces
+
+@example
+foo = X;
+bar = 4;
+@end example
+
+When the preprocessor expands a macro name, the macro's expansion
+replaces the macro invocation, then the expansion is examined for more
+macros to expand. For example,
+
+@example
+@group
+#define TABLESIZE BUFSIZE
+#define BUFSIZE 1024
+TABLESIZE
+ @expansion{} BUFSIZE
+ @expansion{} 1024
+@end group
+@end example
+
+@noindent
+@code{TABLESIZE} is expanded first to produce @code{BUFSIZE}, then that
+macro is expanded to produce the final result, @code{1024}.
+
+Notice that @code{BUFSIZE} was not defined when @code{TABLESIZE} was
+defined. The @samp{#define} for @code{TABLESIZE} uses exactly the
+expansion you specify---in this case, @code{BUFSIZE}---and does not
+check to see whether it too contains macro names. Only when you
+@emph{use} @code{TABLESIZE} is the result of its expansion scanned for
+more macro names.
+
+This makes a difference if you change the definition of @code{BUFSIZE}
+at some point in the source file. @code{TABLESIZE}, defined as shown,
+will always expand using the definition of @code{BUFSIZE} that is
+currently in effect:
+
+@example
+#define BUFSIZE 1020
+#define TABLESIZE BUFSIZE
+#undef BUFSIZE
+#define BUFSIZE 37
+@end example
+
+@noindent
+Now @code{TABLESIZE} expands (in two stages) to @code{37}.
+
+If the expansion of a macro contains its own name, either directly or
+via intermediate macros, it is not expanded again when the expansion is
+examined for more macros. This prevents infinite recursion.
+@xref{Self-Referential Macros}, for the precise details.
+
+@node Function-like Macros
+@section Function-like Macros
+@cindex function-like macros
+
+You can also define macros whose use looks like a function call. These
+are called @dfn{function-like macros}. To define a function-like macro,
+you use the same @samp{#define} directive, but you put a pair of
+parentheses immediately after the macro name. For example,
+
+@example
+#define lang_init() c_init()
+lang_init()
+ @expansion{} c_init()
+@end example
+
+A function-like macro is only expanded if its name appears with a pair
+of parentheses after it. If you write just the name, it is left alone.
+This can be useful when you have a function and a macro of the same
+name, and you wish to use the function sometimes.
+
+@example
+extern void foo(void);
+#define foo() /* optimized inline version */
+@dots{}
+ foo();
+ funcptr = foo;
+@end example
+
+Here the call to @code{foo()} will use the macro, but the function
+pointer will get the address of the real function. If the macro were to
+be expanded, it would cause a syntax error.
+
+If you put spaces between the macro name and the parentheses in the
+macro definition, that does not define a function-like macro, it defines
+an object-like macro whose expansion happens to begin with a pair of
+parentheses.
+
+@example
+#define lang_init () c_init()
+lang_init()
+ @expansion{} () c_init()()
+@end example
+
+The first two pairs of parentheses in this expansion come from the
+macro. The third is the pair that was originally after the macro
+invocation. Since @code{lang_init} is an object-like macro, it does not
+consume those parentheses.
+
+@node Macro Arguments
+@section Macro Arguments
+@cindex arguments
+@cindex macros with arguments
+@cindex arguments in macro definitions
+
+Function-like macros can take @dfn{arguments}, just like true functions.
+To define a macro that uses arguments, you insert @dfn{parameters}
+between the pair of parentheses in the macro definition that make the
+macro function-like. The parameters must be valid C identifiers,
+separated by commas and optionally whitespace.
+
+To invoke a macro that takes arguments, you write the name of the macro
+followed by a list of @dfn{actual arguments} in parentheses, separated
+by commas. The invocation of the macro need not be restricted to a
+single logical line---it can cross as many lines in the source file as
+you wish. The number of arguments you give must match the number of
+parameters in the macro definition. When the macro is expanded, each
+use of a parameter in its body is replaced by the tokens of the
+corresponding argument. (You need not use all of the parameters in the
+macro body.)
+
+As an example, here is a macro that computes the minimum of two numeric
+values, as it is defined in many C programs, and some uses.
+
+@example
+#define min(X, Y) ((X) < (Y) ? (X) : (Y))
+ x = min(a, b); @expansion{} x = ((a) < (b) ? (a) : (b));
+ y = min(1, 2); @expansion{} y = ((1) < (2) ? (1) : (2));
+ z = min(a + 28, *p); @expansion{} z = ((a + 28) < (*p) ? (a + 28) : (*p));
+@end example
+
+@noindent
+(In this small example you can already see several of the dangers of
+macro arguments. @xref{Macro Pitfalls}, for detailed explanations.)
+
+Leading and trailing whitespace in each argument is dropped, and all
+whitespace between the tokens of an argument is reduced to a single
+space. Parentheses within each argument must balance; a comma within
+such parentheses does not end the argument. However, there is no
+requirement for square brackets or braces to balance, and they do not
+prevent a comma from separating arguments. Thus,
+
+@example
+macro (array[x = y, x + 1])
+@end example
+
+@noindent
+passes two arguments to @code{macro}: @code{array[x = y} and @code{x +
+1]}. If you want to supply @code{array[x = y, x + 1]} as an argument,
+you can write it as @code{array[(x = y, x + 1)]}, which is equivalent C
+code.
+
+All arguments to a macro are completely macro-expanded before they are
+substituted into the macro body. After substitution, the complete text
+is scanned again for macros to expand, including the arguments. This rule
+may seem strange, but it is carefully designed so you need not worry
+about whether any function call is actually a macro invocation. You can
+run into trouble if you try to be too clever, though. @xref{Argument
+Prescan}, for detailed discussion.
+
+For example, @code{min (min (a, b), c)} is first expanded to
+
+@example
+ min (((a) < (b) ? (a) : (b)), (c))
+@end example
+
+@noindent
+and then to
+
+@example
+@group
+((((a) < (b) ? (a) : (b))) < (c)
+ ? (((a) < (b) ? (a) : (b)))
+ : (c))
+@end group
+@end example
+
+@noindent
+(Line breaks shown here for clarity would not actually be generated.)
+
+@cindex empty macro arguments
+You can leave macro arguments empty; this is not an error to the
+preprocessor (but many macros will then expand to invalid code).
+You cannot leave out arguments entirely; if a macro takes two arguments,
+there must be exactly one comma at the top level of its argument list.
+Here are some silly examples using @code{min}:
+
+@example
+min(, b) @expansion{} (( ) < (b) ? ( ) : (b))
+min(a, ) @expansion{} ((a ) < ( ) ? (a ) : ( ))
+min(,) @expansion{} (( ) < ( ) ? ( ) : ( ))
+min((,),) @expansion{} (((,)) < ( ) ? ((,)) : ( ))
+
+min() @error{} macro "min" requires 2 arguments, but only 1 given
+min(,,) @error{} macro "min" passed 3 arguments, but takes just 2
+@end example
+
+Whitespace is not a preprocessing token, so if a macro @code{foo} takes
+one argument, @code{@w{foo ()}} and @code{@w{foo ( )}} both supply it an
+empty argument. Previous GNU preprocessor implementations and
+documentation were incorrect on this point, insisting that a
+function-like macro that takes a single argument be passed a space if an
+empty argument was required.
+
+Macro parameters appearing inside string literals are not replaced by
+their corresponding actual arguments.
+
+@example
+#define foo(x) x, "x"
+foo(bar) @expansion{} bar, "x"
+@end example
+
+@node Stringification
+@section Stringification
+@cindex stringification
+@cindex @samp{#} operator
+
+Sometimes you may want to convert a macro argument into a string
+constant. Parameters are not replaced inside string constants, but you
+can use the @samp{#} preprocessing operator instead. When a macro
+parameter is used with a leading @samp{#}, the preprocessor replaces it
+with the literal text of the actual argument, converted to a string
+constant. Unlike normal parameter replacement, the argument is not
+macro-expanded first. This is called @dfn{stringification}.
+
+There is no way to combine an argument with surrounding text and
+stringify it all together. Instead, you can write a series of adjacent
+string constants and stringified arguments. The preprocessor will
+replace the stringified arguments with string constants. The C
+compiler will then combine all the adjacent string constants into one
+long string.
+
+Here is an example of a macro definition that uses stringification:
+
+@example
+@group
+#define WARN_IF(EXP) \
+do @{ if (EXP) \
+ fprintf (stderr, "Warning: " #EXP "\n"); @} \
+while (0)
+WARN_IF (x == 0);
+ @expansion{} do @{ if (x == 0)
+ fprintf (stderr, "Warning: " "x == 0" "\n"); @} while (0);
+@end group
+@end example
+
+@noindent
+The argument for @code{EXP} is substituted once, as-is, into the
+@code{if} statement, and once, stringified, into the argument to
+@code{fprintf}. If @code{x} were a macro, it would be expanded in the
+@code{if} statement, but not in the string.
+
+The @code{do} and @code{while (0)} are a kludge to make it possible to
+write @code{WARN_IF (@var{arg});}, which the resemblance of
+@code{WARN_IF} to a function would make C programmers want to do; see
+@ref{Swallowing the Semicolon}.
+
+Stringification in C involves more than putting double-quote characters
+around the fragment. The preprocessor backslash-escapes the quotes
+surrounding embedded string constants, and all backslashes within string and
+character constants, in order to get a valid C string constant with the
+proper contents. Thus, stringifying @code{@w{p = "foo\n";}} results in
+@t{@w{"p = \"foo\\n\";"}}. However, backslashes that are not inside string
+or character constants are not duplicated: @samp{\n} by itself
+stringifies to @t{"\n"}.
+
+All leading and trailing whitespace in text being stringified is
+ignored. Any sequence of whitespace in the middle of the text is
+converted to a single space in the stringified result. Comments are
+replaced by whitespace long before stringification happens, so they
+never appear in stringified text.
+
+There is no way to convert a macro argument into a character constant.
+
+If you want to stringify the result of expansion of a macro argument,
+you have to use two levels of macros.
+
+@example
+#define xstr(s) str(s)
+#define str(s) #s
+#define foo 4
+str (foo)
+ @expansion{} "foo"
+xstr (foo)
+ @expansion{} xstr (4)
+ @expansion{} str (4)
+ @expansion{} "4"
+@end example
+
+@code{s} is stringified when it is used in @code{str}, so it is not
+macro-expanded first. But @code{s} is an ordinary argument to
+@code{xstr}, so it is completely macro-expanded before @code{xstr}
+itself is expanded (@pxref{Argument Prescan}). Therefore, by the time
+@code{str} gets to its argument, it has already been macro-expanded.
+
+@node Concatenation
+@section Concatenation
+@cindex concatenation
+@cindex token pasting
+@cindex token concatenation
+@cindex @samp{##} operator
+
+It is often useful to merge two tokens into one while expanding macros.
+This is called @dfn{token pasting} or @dfn{token concatenation}. The
+@samp{##} preprocessing operator performs token pasting. When a macro
+is expanded, the two tokens on either side of each @samp{##} operator
+are combined into a single token, which then replaces the @samp{##} and
+the two original tokens in the macro expansion. Usually both will be
+identifiers, or one will be an identifier and the other a preprocessing
+number. When pasted, they make a longer identifier. This isn't the
+only valid case. It is also possible to concatenate two numbers (or a
+number and a name, such as @code{1.5} and @code{e3}) into a number.
+Also, multi-character operators such as @code{+=} can be formed by
+token pasting.
+
+However, two tokens that don't together form a valid token cannot be
+pasted together. For example, you cannot concatenate @code{x} with
+@code{+} in either order. If you try, the preprocessor issues a warning
+and emits the two tokens. Whether it puts white space between the
+tokens is undefined. It is common to find unnecessary uses of @samp{##}
+in complex macros. If you get this warning, it is likely that you can
+simply remove the @samp{##}.
+
+Both the tokens combined by @samp{##} could come from the macro body,
+but you could just as well write them as one token in the first place.
+Token pasting is most useful when one or both of the tokens comes from a
+macro argument. If either of the tokens next to an @samp{##} is a
+parameter name, it is replaced by its actual argument before @samp{##}
+executes. As with stringification, the actual argument is not
+macro-expanded first. If the argument is empty, that @samp{##} has no
+effect.
+
+Keep in mind that the C preprocessor converts comments to whitespace
+before macros are even considered. Therefore, you cannot create a
+comment by concatenating @samp{/} and @samp{*}. You can put as much
+whitespace between @samp{##} and its operands as you like, including
+comments, and you can put comments in arguments that will be
+concatenated. However, it is an error if @samp{##} appears at either
+end of a macro body.
+
+Consider a C program that interprets named commands. There probably
+needs to be a table of commands, perhaps an array of structures declared
+as follows:
+
+@example
+@group
+struct command
+@{
+ char *name;
+ void (*function) (void);
+@};
+@end group
+
+@group
+struct command commands[] =
+@{
+ @{ "quit", quit_command @},
+ @{ "help", help_command @},
+ @dots{}
+@};
+@end group
+@end example
+
+It would be cleaner not to have to give each command name twice, once in
+the string constant and once in the function name. A macro which takes the
+name of a command as an argument can make this unnecessary. The string
+constant can be created with stringification, and the function name by
+concatenating the argument with @samp{_command}. Here is how it is done:
+
+@example
+#define COMMAND(NAME) @{ #NAME, NAME ## _command @}
+
+struct command commands[] =
+@{
+ COMMAND (quit),
+ COMMAND (help),
+ @dots{}
+@};
+@end example
+
+@node Variadic Macros
+@section Variadic Macros
+@cindex variable number of arguments
+@cindex macros with variable arguments
+@cindex variadic macros
+
+A macro can be declared to accept a variable number of arguments much as
+a function can. The syntax for defining the macro is similar to that of
+a function. Here is an example:
+
+@example
+#define eprintf(@dots{}) fprintf (stderr, __VA_ARGS__)
+@end example
+
+This kind of macro is called @dfn{variadic}. When the macro is invoked,
+all the tokens in its argument list after the last named argument (this
+macro has none), including any commas, become the @dfn{variable
+argument}. This sequence of tokens replaces the identifier
+@code{@w{__VA_ARGS__}} in the macro body wherever it appears. Thus, we
+have this expansion:
+
+@example
+eprintf ("%s:%d: ", input_file, lineno)
+ @expansion{} fprintf (stderr, "%s:%d: ", input_file, lineno)
+@end example
+
+The variable argument is completely macro-expanded before it is inserted
+into the macro expansion, just like an ordinary argument. You may use
+the @samp{#} and @samp{##} operators to stringify the variable argument
+or to paste its leading or trailing token with another token. (But see
+below for an important special case for @samp{##}.)
+
+If your macro is complicated, you may want a more descriptive name for
+the variable argument than @code{@w{__VA_ARGS__}}. GNU CPP permits
+this, as an extension. You may write an argument name immediately
+before the @samp{@dots{}}; that name is used for the variable argument.
+The @code{eprintf} macro above could be written
+
+@example
+#define eprintf(args@dots{}) fprintf (stderr, args)
+@end example
+
+@noindent
+using this extension. You cannot use @code{__VA_ARGS__} and this
+extension in the same macro.
+
+You can have named arguments as well as variable arguments in a variadic
+macro. We could define @code{eprintf} like this, instead:
+
+@example
+#define eprintf(format, @dots{}) fprintf (stderr, format, __VA_ARGS__)
+@end example
+
+@noindent
+This formulation looks more descriptive, but unfortunately it is less
+flexible: you must now supply at least one argument after the format
+string. In standard C, you cannot omit the comma separating the named
+argument from the variable arguments. Furthermore, if you leave the
+variable argument empty, you will get a syntax error, because
+there will be an extra comma after the format string.
+
+@example
+eprintf("success!\n", );
+ @expansion{} fprintf(stderr, "success!\n", );
+@end example
+
+GNU CPP has a pair of extensions which deal with this problem. First,
+you are allowed to leave the variable argument out entirely:
+
+@example
+eprintf ("success!\n")
+ @expansion{} fprintf(stderr, "success!\n", );
+@end example
+
+@noindent
+Second, the @samp{##} token paste operator has a special meaning when
+placed between a comma and a variable argument. If you write
+
+@example
+#define eprintf(format, @dots{}) fprintf (stderr, format, ##__VA_ARGS__)
+@end example
+
+@noindent
+and the variable argument is left out when the @code{eprintf} macro is
+used, then the comma before the @samp{##} will be deleted. This does
+@emph{not} happen if you pass an empty argument, nor does it happen if
+the token preceding @samp{##} is anything other than a comma.
+
+@example
+eprintf ("success!\n")
+ @expansion{} fprintf(stderr, "success!\n");
+@end example
+
+C99 mandates that the only place the identifier @code{@w{__VA_ARGS__}}
+can appear is in the replacement list of a variadic macro. It may not
+be used as a macro name, macro argument name, or within a different type
+of macro. It may also be forbidden in open text; the standard is
+ambiguous. We recommend you avoid using it except for its defined
+purpose.
+
+Variadic macros are a new feature in C99. GNU CPP has supported them
+for a long time, but only with a named variable argument
+(@samp{args@dots{}}, not @samp{@dots{}} and @code{@w{__VA_ARGS__}}). If you are
+concerned with portability to previous versions of GCC, you should use
+only named variable arguments. On the other hand, if you are concerned
+with portability to other conforming implementations of C99, you should
+use only @code{@w{__VA_ARGS__}}.
+
+Previous versions of GNU CPP implemented the comma-deletion extension
+much more generally. We have restricted it in this release to minimize
+the differences from C99. To get the same effect with both this and
+previous versions of GCC, the token preceding the special @samp{##} must
+be a comma, and there must be white space between that comma and
+whatever comes immediately before it:
+
+@example
+#define eprintf(format, args@dots{}) fprintf (stderr, format , ##args)
+@end example
+
+@noindent
+@xref{Differences from previous versions}, for the gory details.
+
+@node Predefined Macros
+@section Predefined Macros
+
+@cindex predefined macros
+Several object-like macros are predefined; you use them without
+supplying their definitions. They fall into three classes: standard,
+common, and system-specific.
+
+In C++, there is a fourth category, the named operators. They act like
+predefined macros, but you cannot undefine them.
+
+@menu
+* Standard Predefined Macros::
+* Common Predefined Macros::
+* System-specific Predefined Macros::
+* C++ Named Operators::
+@end menu
+
+@node Standard Predefined Macros
+@subsection Standard Predefined Macros
+@cindex standard predefined macros.
+
+The standard predefined macros are specified by the C and/or C++
+language standards, so they are available with all compilers that
+implement those standards. Older compilers may not provide all of
+them. Their names all start with double underscores.
+
+@table @code
+@item __FILE__
+This macro expands to the name of the current input file, in the form of
+a C string constant. This is the path by which the preprocessor opened
+the file, not the short name specified in @samp{#include} or as the
+input file name argument. For example,
+@code{"/usr/local/include/myheader.h"} is a possible expansion of this
+macro.
+
+@item __LINE__
+This macro expands to the current input line number, in the form of a
+decimal integer constant. While we call it a predefined macro, it's
+a pretty strange macro, since its ``definition'' changes with each
+new line of source code.
+@end table
+
+@code{__FILE__} and @code{__LINE__} are useful in generating an error
+message to report an inconsistency detected by the program; the message
+can state the source line at which the inconsistency was detected. For
+example,
+
+@example
+fprintf (stderr, "Internal error: "
+ "negative string length "
+ "%d at %s, line %d.",
+ length, __FILE__, __LINE__);
+@end example
+
+An @samp{#include} directive changes the expansions of @code{__FILE__}
+and @code{__LINE__} to correspond to the included file. At the end of
+that file, when processing resumes on the input file that contained
+the @samp{#include} directive, the expansions of @code{__FILE__} and
+@code{__LINE__} revert to the values they had before the
+@samp{#include} (but @code{__LINE__} is then incremented by one as
+processing moves to the line after the @samp{#include}).
+
+A @samp{#line} directive changes @code{__LINE__}, and may change
+@code{__FILE__} as well. @xref{Line Control}.
+
+C99 introduces @code{__func__}, and GCC has provided @code{__FUNCTION__}
+for a long time. Both of these are strings containing the name of the
+current function (there are slight semantic differences; see the GCC
+manual). Neither of them is a macro; the preprocessor does not know the
+name of the current function. They tend to be useful in conjunction
+with @code{__FILE__} and @code{__LINE__}, though.
+
+@table @code
+
+@item __DATE__
+This macro expands to a string constant that describes the date on which
+the preprocessor is being run. The string constant contains eleven
+characters and looks like @code{@w{"Feb 12 1996"}}. If the day of the
+month is less than 10, it is padded with a space on the left.
+
+@item __TIME__
+This macro expands to a string constant that describes the time at
+which the preprocessor is being run. The string constant contains
+eight characters and looks like @code{"23:59:01"}.
+
+@item __STDC__
+In normal operation, this macro expands to the constant 1, to signify
+that this compiler conforms to ISO Standard C@. If GNU CPP is used with
+a compiler other than GCC, this is not necessarily true; however, the
+preprocessor always conforms to the standard, unless the
+@option{-traditional} option is used.
+
+This macro is not defined if the @option{-traditional} option is used.
+
+On some hosts, the system compiler uses a different convention, where
+@code{__STDC__} is normally 0, but is 1 if the user specifies strict
+conformance to the C Standard. GNU CPP follows the host convention when
+processing system header files, but when processing user files
+@code{__STDC__} is always 1. This has been reported to cause problems;
+for instance, some versions of Solaris provide X Windows headers that
+expect @code{__STDC__} to be either undefined or 1. You may be able to
+work around this sort of problem by using an @option{-I} option to
+cancel treatment of those headers as system headers. @xref{Invocation}.
+
+@item __STDC_VERSION__
+This macro expands to the C Standard's version number, a long integer
+constant of the form @code{@var{yyyy}@var{mm}L} where @var{yyyy} and
+@var{mm} are the year and month of the Standard version. This signifies
+which version of the C Standard the compiler conforms to. Like
+@code{__STDC__}, this is not necessarily accurate for the entire
+implementation, unless GNU CPP is being used with GCC@.
+
+The value @code{199409L} signifies the 1989 C standard as amended in
+1994, which is the current default; the value @code{199901L} signifies
+the 1999 revision of the C standard. Support for the 1999 revision is
+not yet complete.
+
+This macro is not defined if the @option{-traditional} option is used, nor
+when compiling C++ or Objective-C@.
+
+@item __STDC_HOSTED__
+This macro is defined, with value 1, if the compiler's target is a
+@dfn{hosted environment}. A hosted environment has the complete
+facilities of the standard C library available.
+
+@item __cplusplus
+This macro is defined when the C++ compiler is in use. You can use
+@code{__cplusplus} to test whether a header is compiled by a C compiler
+or a C++ compiler. This macro is similar to @code{__STDC_VERSION__}, in
+that it expands to a version number. A fully conforming implementation
+of the 1998 C++ standard will define this macro to @code{199711L}. The
+GNU C++ compiler is not yet fully conforming, so it uses @code{1}
+instead. We hope to complete our implementation in the near future.
+
+@end table
+
+@node Common Predefined Macros
+@subsection Common Predefined Macros
+@cindex common predefined macros
+
+The common predefined macros are GNU C extensions. They are available
+with the same meanings regardless of the machine or operating system on
+which you are using GNU C@. Their names all start with double
+underscores.
+
+@table @code
+
+@item __GNUC__
+@itemx __GNUC_MINOR__
+@itemx __GNUC_PATCHLEVEL__
+These macros are defined by all GNU compilers that use the C
+preprocessor: C, C++, and Objective-C@. Their values are the major
+version, minor version, and patch level of the compiler, as integer
+constants. For example, GCC 3.2.1 will define @code{__GNUC__} to 3,
+@code{__GNUC_MINOR__} to 2, and @code{__GNUC_PATCHLEVEL__} to 1. They
+are defined only when the entire compiler is in use; if you invoke the
+preprocessor directly, they are not defined.
+
+@code{__GNUC_PATCHLEVEL__} is new to GCC 3.0; it is also present in the
+widely-used development snapshots leading up to 3.0 (which identify
+themselves as GCC 2.96 or 2.97, depending on which snapshot you have).
+
+If all you need to know is whether or not your program is being compiled
+by GCC, you can simply test @code{__GNUC__}. If you need to write code
+which depends on a specific version, you must be more careful. Each
+time the minor version is increased, the patch level is reset to zero;
+each time the major version is increased (which happens rarely), the
+minor version and patch level are reset. If you wish to use the
+predefined macros directly in the conditional, you will need to write it
+like this:
+
+@example
+/* @r{Test for GCC > 3.2.0} */
+#if __GNUC__ > 3 || \
+ (__GNUC__ == 3 && (__GNUC_MINOR__ > 2 || \
+ (__GNUC_MINOR__ == 2 && \
+ __GNUC_PATCHLEVEL__ > 0))
+@end example
+
+@noindent
+Another approach is to use the predefined macros to
+calculate a single number, then compare that against a threshold:
+
+@example
+#define GCC_VERSION (__GNUC__ * 10000 \
+ + __GNUC_MINOR__ * 100 \
+ + __GNUC_PATCHLEVEL__)
+@dots{}
+/* @r{Test for GCC > 3.2.0} */
+#if GCC_VERSION > 30200
+@end example
+
+@noindent
+Many people find this form easier to understand.
+
+@item __GNUG__
+The GNU C++ compiler defines this. Testing it is equivalent to
+testing @code{@w{(__GNUC__ && __cplusplus)}}.
+
+@item __STRICT_ANSI__
+GCC defines this macro if and only if the @option{-ansi} switch, or a
+@option{-std} switch specifying strict conformance to some version of ISO C,
+was specified when GCC was invoked. It is defined to @samp{1}.
+This macro exists primarily to direct GNU libc's header files to
+restrict their definitions to the minimal set found in the 1989 C
+standard.
+
+@item __BASE_FILE__
+This macro expands to the name of the main input file, in the form
+of a C string constant. This is the source file that was specified
+on the command line of the preprocessor or C compiler.
+
+@item __INCLUDE_LEVEL__
+This macro expands to a decimal integer constant that represents the
+depth of nesting in include files. The value of this macro is
+incremented on every @samp{#include} directive and decremented at the
+end of every included file. It starts out at 0, it's value within the
+base file specified on the command line.
+
+@item __VERSION__
+This macro expands to a string constant which describes the version of
+the compiler in use. You should not rely on its contents having any
+particular form, but it can be counted on to contain at least the
+release number.
+
+@item __OPTIMIZE__
+@itemx __OPTIMIZE_SIZE__
+@itemx __NO_INLINE__
+These macros describe the compilation mode. @code{__OPTIMIZE__} is
+defined in all optimizing compilations. @code{__OPTIMIZE_SIZE__} is
+defined if the compiler is optimizing for size, not speed.
+@code{__NO_INLINE__} is defined if no functions will be inlined into
+their callers (when not optimizing, or when inlining has been
+specifically disabled by @option{-fno-inline}).
+
+These macros cause certain GNU header files to provide optimized
+definitions, using macros or inline functions, of system library
+functions. You should not use these macros in any way unless you make
+sure that programs will execute with the same effect whether or not they
+are defined. If they are defined, their value is 1.
+
+@item __CHAR_UNSIGNED__
+GCC defines this macro if and only if the data type @code{char} is
+unsigned on the target machine. It exists to cause the standard header
+file @file{limits.h} to work correctly. You should not use this macro
+yourself; instead, refer to the standard macros defined in @file{limits.h}.
+
+@item __REGISTER_PREFIX__
+This macro expands to a single token (not a string constant) which is
+the prefix applied to CPU register names in assembly language for this
+target. You can use it to write assembly that is usable in multiple
+environments. For example, in the @code{m68k-aout} environment it
+expands to nothing, but in the @code{m68k-coff} environment it expands
+to a single @samp{%}.
+
+@item __USER_LABEL_PREFIX__
+This macro expands to a single token which is the prefix applied to
+user labels (symbols visible to C code) in assembly. For example, in
+the @code{m68k-aout} environment it expands to an @samp{_}, but in the
+@code{m68k-coff} environment it expands to nothing.
+
+This macro will have the correct definition even if
+@option{-f(no-)underscores} is in use, but it will not be correct if
+target-specific options that adjust this prefix are used (e.g.@: the
+OSF/rose @option{-mno-underscores} option).
+
+@item __SIZE_TYPE__
+@itemx __PTRDIFF_TYPE__
+@itemx __WCHAR_TYPE__
+@itemx __WINT_TYPE__
+These macros are defined to the correct underlying types for the
+@code{size_t}, @code{ptrdiff_t}, @code{wchar_t}, and @code{wint_t}
+typedefs, respectively. They exist to make the standard header files
+@file{stddef.h} and @file{wchar.h} work correctly. You should not use
+these macros directly; instead, include the appropriate headers and use
+the typedefs.
+
+@end table
+
+@node System-specific Predefined Macros
+@subsection System-specific Predefined Macros
+
+@cindex system-specific predefined macros
+@cindex predefined macros, system-specific
+@cindex reserved namespace
+
+The C preprocessor normally predefines several macros that indicate what
+type of system and machine is in use. They are obviously different on
+each target supported by GCC@. This manual, being for all systems and
+machines, cannot tell you what their names are, but you can use
+@command{cpp -dM} to see them all. @xref{Invocation}. All system-specific
+predefined macros expand to the constant 1, so you can test them with
+either @samp{#ifdef} or @samp{#if}.
+
+The C standard requires that all system-specific macros be part of the
+@dfn{reserved namespace}. All names which begin with two underscores,
+or an underscore and a capital letter, are reserved for the compiler and
+library to use as they wish. However, historically system-specific
+macros have had names with no special prefix; for instance, it is common
+to find @code{unix} defined on Unix systems. For all such macros, GCC
+provides a parallel macro with two underscores added at the beginning
+and the end. If @code{unix} is defined, @code{__unix__} will be defined
+too. There will never be more than two underscores; the parallel of
+@code{_mips} is @code{__mips__}.
+
+When the @option{-ansi} option, or any @option{-std} option that
+requests strict conformance, is given to the compiler, all the
+system-specific predefined macros outside the reserved namespace are
+suppressed. The parallel macros, inside the reserved namespace, remain
+defined.
+
+We are slowly phasing out all predefined macros which are outside the
+reserved namespace. You should never use them in new programs, and we
+encourage you to correct older code to use the parallel macros whenever
+you find it. We don't recommend you use the system-specific macros that
+are in the reserved namespace, either. It is better in the long run to
+check specifically for features you need, using a tool such as
+@command{autoconf}.
+
+@node C++ Named Operators
+@subsection C++ Named Operators
+@cindex named operators
+@cindex C++ named operators
+@cindex iso646.h
+
+In C++, there are eleven keywords which are simply alternate spellings
+of operators normally written with punctuation. These keywords are
+treated as such even in the preprocessor. They function as operators in
+@samp{#if}, and they cannot be defined as macros or poisoned. In C, you
+can request that those keywords take their C++ meaning by including
+@file{iso646.h}. That header defines each one as a normal object-like
+macro expanding to the appropriate punctuator.
+
+These are the named operators and their corresponding punctuators:
+
+@multitable {Named Operator} {Punctuator}
+@item Named Operator @tab Punctuator
+@item @code{and} @tab @code{&&}
+@item @code{and_eq} @tab @code{&=}
+@item @code{bitand} @tab @code{&}
+@item @code{bitor} @tab @code{|}
+@item @code{compl} @tab @code{~}
+@item @code{not} @tab @code{!}
+@item @code{not_eq} @tab @code{!=}
+@item @code{or} @tab @code{||}
+@item @code{or_eq} @tab @code{|=}
+@item @code{xor} @tab @code{^}
+@item @code{xor_eq} @tab @code{^=}
+@end multitable
+
+@node Undefining and Redefining Macros
+@section Undefining and Redefining Macros
+@cindex undefining macros
+@cindex redefining macros
+@findex #undef
+
+If a macro ceases to be useful, it may be @dfn{undefined} with the
+@samp{#undef} directive. @samp{#undef} takes a single argument, the
+name of the macro to undefine. You use the bare macro name, even if the
+macro is function-like. It is an error if anything appears on the line
+after the macro name. @samp{#undef} has no effect if the name is not a
+macro.
+
+@example
+#define FOO 4
+x = FOO; @expansion{} x = 4;
+#undef FOO
+x = FOO; @expansion{} x = FOO;
+@end example
+
+Once a macro has been undefined, that identifier may be @dfn{redefined}
+as a macro by a subsequent @samp{#define} directive. The new definition
+need not have any resemblance to the old definition.
+
+However, if an identifier which is currently a macro is redefined, then
+the new definition must be @dfn{effectively the same} as the old one.
+Two macro definitions are effectively the same if:
+@itemize @bullet
+@item Both are the same type of macro (object- or function-like).
+@item All the tokens of the replacement list are the same.
+@item If there are any parameters, they are the same.
+@item Whitespace appears in the same places in both. It need not be
+exactly the same amount of whitespace, though. Remember that comments
+count as whitespace.
+@end itemize
+
+@noindent
+These definitions are effectively the same:
+@example
+#define FOUR (2 + 2)
+#define FOUR (2 + 2)
+#define FOUR (2 /* two */ + 2)
+@end example
+@noindent
+but these are not:
+@example
+#define FOUR (2 + 2)
+#define FOUR ( 2+2 )
+#define FOUR (2 * 2)
+#define FOUR(score,and,seven,years,ago) (2 + 2)
+@end example
+
+If a macro is redefined with a definition that is not effectively the
+same as the old one, the preprocessor issues a warning and changes the
+macro to use the new definition. If the new definition is effectively
+the same, the redefinition is silently ignored. This allows, for
+instance, two different headers to define a common macro. The
+preprocessor will only complain if the definitions do not match.
+
+@node Macro Pitfalls
+@section Macro Pitfalls
+@cindex problems with macros
+@cindex pitfalls of macros
+
+In this section we describe some special rules that apply to macros and
+macro expansion, and point out certain cases in which the rules have
+counter-intuitive consequences that you must watch out for.
+
+@menu
+* Misnesting::
+* Operator Precedence Problems::
+* Swallowing the Semicolon::
+* Duplication of Side Effects::
+* Self-Referential Macros::
+* Argument Prescan::
+* Newlines in Arguments::
+@end menu
+
+@node Misnesting
+@subsection Misnesting
+
+When a macro is called with arguments, the arguments are substituted
+into the macro body and the result is checked, together with the rest of
+the input file, for more macro calls. It is possible to piece together
+a macro call coming partially from the macro body and partially from the
+arguments. For example,
+
+@example
+#define twice(x) (2*(x))
+#define call_with_1(x) x(1)
+call_with_1 (twice)
+ @expansion{} twice(1)
+ @expansion{} (2*(1))
+@end example
+
+Macro definitions do not have to have balanced parentheses. By writing
+an unbalanced open parenthesis in a macro body, it is possible to create
+a macro call that begins inside the macro body but ends outside of it.
+For example,
+
+@example
+#define strange(file) fprintf (file, "%s %d",
+@dots{}
+strange(stderr) p, 35)
+ @expansion{} fprintf (stderr, "%s %d", p, 35)
+@end example
+
+The ability to piece together a macro call can be useful, but the use of
+unbalanced open parentheses in a macro body is just confusing, and
+should be avoided.
+
+@node Operator Precedence Problems
+@subsection Operator Precedence Problems
+@cindex parentheses in macro bodies
+
+You may have noticed that in most of the macro definition examples shown
+above, each occurrence of a macro argument name had parentheses around
+it. In addition, another pair of parentheses usually surround the
+entire macro definition. Here is why it is best to write macros that
+way.
+
+Suppose you define a macro as follows,
+
+@example
+#define ceil_div(x, y) (x + y - 1) / y
+@end example
+
+@noindent
+whose purpose is to divide, rounding up. (One use for this operation is
+to compute how many @code{int} objects are needed to hold a certain
+number of @code{char} objects.) Then suppose it is used as follows:
+
+@example
+a = ceil_div (b & c, sizeof (int));
+ @expansion{} a = (b & c + sizeof (int) - 1) / sizeof (int);
+@end example
+
+@noindent
+This does not do what is intended. The operator-precedence rules of
+C make it equivalent to this:
+
+@example
+a = (b & (c + sizeof (int) - 1)) / sizeof (int);
+@end example
+
+@noindent
+What we want is this:
+
+@example
+a = ((b & c) + sizeof (int) - 1)) / sizeof (int);
+@end example
+
+@noindent
+Defining the macro as
+
+@example
+#define ceil_div(x, y) ((x) + (y) - 1) / (y)
+@end example
+
+@noindent
+provides the desired result.
+
+Unintended grouping can result in another way. Consider @code{sizeof
+ceil_div(1, 2)}. That has the appearance of a C expression that would
+compute the size of the type of @code{ceil_div (1, 2)}, but in fact it
+means something very different. Here is what it expands to:
+
+@example
+sizeof ((1) + (2) - 1) / (2)
+@end example
+
+@noindent
+This would take the size of an integer and divide it by two. The
+precedence rules have put the division outside the @code{sizeof} when it
+was intended to be inside.
+
+Parentheses around the entire macro definition prevent such problems.
+Here, then, is the recommended way to define @code{ceil_div}:
+
+@example
+#define ceil_div(x, y) (((x) + (y) - 1) / (y))
+@end example
+
+@node Swallowing the Semicolon
+@subsection Swallowing the Semicolon
+@cindex semicolons (after macro calls)
+
+Often it is desirable to define a macro that expands into a compound
+statement. Consider, for example, the following macro, that advances a
+pointer (the argument @code{p} says where to find it) across whitespace
+characters:
+
+@example
+#define SKIP_SPACES(p, limit) \
+@{ char *lim = (limit); \
+ while (p < lim) @{ \
+ if (*p++ != ' ') @{ \
+ p--; break; @}@}@}
+@end example
+
+@noindent
+Here backslash-newline is used to split the macro definition, which must
+be a single logical line, so that it resembles the way such code would
+be laid out if not part of a macro definition.
+
+A call to this macro might be @code{SKIP_SPACES (p, lim)}. Strictly
+speaking, the call expands to a compound statement, which is a complete
+statement with no need for a semicolon to end it. However, since it
+looks like a function call, it minimizes confusion if you can use it
+like a function call, writing a semicolon afterward, as in
+@code{SKIP_SPACES (p, lim);}
+
+This can cause trouble before @code{else} statements, because the
+semicolon is actually a null statement. Suppose you write
+
+@example
+if (*p != 0)
+ SKIP_SPACES (p, lim);
+else @dots{}
+@end example
+
+@noindent
+The presence of two statements---the compound statement and a null
+statement---in between the @code{if} condition and the @code{else}
+makes invalid C code.
+
+The definition of the macro @code{SKIP_SPACES} can be altered to solve
+this problem, using a @code{do @dots{} while} statement. Here is how:
+
+@example
+#define SKIP_SPACES(p, limit) \
+do @{ char *lim = (limit); \
+ while (p < lim) @{ \
+ if (*p++ != ' ') @{ \
+ p--; break; @}@}@} \
+while (0)
+@end example
+
+Now @code{SKIP_SPACES (p, lim);} expands into
+
+@example
+do @{@dots{}@} while (0);
+@end example
+
+@noindent
+which is one statement. The loop executes exactly once; most compilers
+generate no extra code for it.
+
+@node Duplication of Side Effects
+@subsection Duplication of Side Effects
+
+@cindex side effects (in macro arguments)
+@cindex unsafe macros
+Many C programs define a macro @code{min}, for ``minimum'', like this:
+
+@example
+#define min(X, Y) ((X) < (Y) ? (X) : (Y))
+@end example
+
+When you use this macro with an argument containing a side effect,
+as shown here,
+
+@example
+next = min (x + y, foo (z));
+@end example
+
+@noindent
+it expands as follows:
+
+@example
+next = ((x + y) < (foo (z)) ? (x + y) : (foo (z)));
+@end example
+
+@noindent
+where @code{x + y} has been substituted for @code{X} and @code{foo (z)}
+for @code{Y}.
+
+The function @code{foo} is used only once in the statement as it appears
+in the program, but the expression @code{foo (z)} has been substituted
+twice into the macro expansion. As a result, @code{foo} might be called
+two times when the statement is executed. If it has side effects or if
+it takes a long time to compute, the results might not be what you
+intended. We say that @code{min} is an @dfn{unsafe} macro.
+
+The best solution to this problem is to define @code{min} in a way that
+computes the value of @code{foo (z)} only once. The C language offers
+no standard way to do this, but it can be done with GNU extensions as
+follows:
+
+@example
+#define min(X, Y) \
+(@{ typeof (X) x_ = (X); \
+ typeof (Y) y_ = (Y); \
+ (x_ < y_) ? x_ : y_; @})
+@end example
+
+The @samp{(@{ @dots{} @})} notation produces a compound statement that
+acts as an expression. Its value is the value of its last statement.
+This permits us to define local variables and assign each argument to
+one. The local variables have underscores after their names to reduce
+the risk of conflict with an identifier of wider scope (it is impossible
+to avoid this entirely). Now each argument is evaluated exactly once.
+
+If you do not wish to use GNU C extensions, the only solution is to be
+careful when @emph{using} the macro @code{min}. For example, you can
+calculate the value of @code{foo (z)}, save it in a variable, and use
+that variable in @code{min}:
+
+@example
+@group
+#define min(X, Y) ((X) < (Y) ? (X) : (Y))
+@dots{}
+@{
+ int tem = foo (z);
+ next = min (x + y, tem);
+@}
+@end group
+@end example
+
+@noindent
+(where we assume that @code{foo} returns type @code{int}).
+
+@node Self-Referential Macros
+@subsection Self-Referential Macros
+@cindex self-reference
+
+A @dfn{self-referential} macro is one whose name appears in its
+definition. Recall that all macro definitions are rescanned for more
+macros to replace. If the self-reference were considered a use of the
+macro, it would produce an infinitely large expansion. To prevent this,
+the self-reference is not considered a macro call. It is passed into
+the preprocessor output unchanged. Let's consider an example:
+
+@example
+#define foo (4 + foo)
+@end example
+
+@noindent
+where @code{foo} is also a variable in your program.
+
+Following the ordinary rules, each reference to @code{foo} will expand
+into @code{(4 + foo)}; then this will be rescanned and will expand into
+@code{(4 + (4 + foo))}; and so on until the computer runs out of memory.
+
+The self-reference rule cuts this process short after one step, at
+@code{(4 + foo)}. Therefore, this macro definition has the possibly
+useful effect of causing the program to add 4 to the value of @code{foo}
+wherever @code{foo} is referred to.
+
+In most cases, it is a bad idea to take advantage of this feature. A
+person reading the program who sees that @code{foo} is a variable will
+not expect that it is a macro as well. The reader will come across the
+identifier @code{foo} in the program and think its value should be that
+of the variable @code{foo}, whereas in fact the value is four greater.
+
+One common, useful use of self-reference is to create a macro which
+expands to itself. If you write
+
+@example
+#define EPERM EPERM
+@end example
+
+@noindent
+then the macro @code{EPERM} expands to @code{EPERM}. Effectively, it is
+left alone by the preprocessor whenever it's used in running text. You
+can tell that it's a macro with @samp{#ifdef}. You might do this if you
+want to define numeric constants with an @code{enum}, but have
+@samp{#ifdef} be true for each constant.
+
+If a macro @code{x} expands to use a macro @code{y}, and the expansion of
+@code{y} refers to the macro @code{x}, that is an @dfn{indirect
+self-reference} of @code{x}. @code{x} is not expanded in this case
+either. Thus, if we have
+
+@example
+#define x (4 + y)
+#define y (2 * x)
+@end example
+
+@noindent
+then @code{x} and @code{y} expand as follows:
+
+@example
+@group
+x @expansion{} (4 + y)
+ @expansion{} (4 + (2 * x))
+
+y @expansion{} (2 * x)
+ @expansion{} (2 * (4 + y))
+@end group
+@end example
+
+@noindent
+Each macro is expanded when it appears in the definition of the other
+macro, but not when it indirectly appears in its own definition.
+
+@node Argument Prescan
+@subsection Argument Prescan
+@cindex expansion of arguments
+@cindex macro argument expansion
+@cindex prescan of macro arguments
+
+Macro arguments are completely macro-expanded before they are
+substituted into a macro body, unless they are stringified or pasted
+with other tokens. After substitution, the entire macro body, including
+the substituted arguments, is scanned again for macros to be expanded.
+The result is that the arguments are scanned @emph{twice} to expand
+macro calls in them.
+
+Most of the time, this has no effect. If the argument contained any
+macro calls, they are expanded during the first scan. The result
+therefore contains no macro calls, so the second scan does not change
+it. If the argument were substituted as given, with no prescan, the
+single remaining scan would find the same macro calls and produce the
+same results.
+
+You might expect the double scan to change the results when a
+self-referential macro is used in an argument of another macro
+(@pxref{Self-Referential Macros}): the self-referential macro would be
+expanded once in the first scan, and a second time in the second scan.
+However, this is not what happens. The self-references that do not
+expand in the first scan are marked so that they will not expand in the
+second scan either.
+
+You might wonder, ``Why mention the prescan, if it makes no difference?
+And why not skip it and make the preprocessor faster?'' The answer is
+that the prescan does make a difference in three special cases:
+
+@itemize @bullet
+@item
+Nested calls to a macro.
+
+We say that @dfn{nested} calls to a macro occur when a macro's argument
+contains a call to that very macro. For example, if @code{f} is a macro
+that expects one argument, @code{f (f (1))} is a nested pair of calls to
+@code{f}. The desired expansion is made by expanding @code{f (1)} and
+substituting that into the definition of @code{f}. The prescan causes
+the expected result to happen. Without the prescan, @code{f (1)} itself
+would be substituted as an argument, and the inner use of @code{f} would
+appear during the main scan as an indirect self-reference and would not
+be expanded.
+
+@item
+Macros that call other macros that stringify or concatenate.
+
+If an argument is stringified or concatenated, the prescan does not
+occur. If you @emph{want} to expand a macro, then stringify or
+concatenate its expansion, you can do that by causing one macro to call
+another macro that does the stringification or concatenation. For
+instance, if you have
+
+@example
+#define AFTERX(x) X_ ## x
+#define XAFTERX(x) AFTERX(x)
+#define TABLESIZE 1024
+#define BUFSIZE TABLESIZE
+@end example
+
+then @code{AFTERX(BUFSIZE)} expands to @code{X_BUFSIZE}, and
+@code{XAFTERX(BUFSIZE)} expands to @code{X_1024}. (Not to
+@code{X_TABLESIZE}. Prescan always does a complete expansion.)
+
+@item
+Macros used in arguments, whose expansions contain unshielded commas.
+
+This can cause a macro expanded on the second scan to be called with the
+wrong number of arguments. Here is an example:
+
+@example
+#define foo a,b
+#define bar(x) lose(x)
+#define lose(x) (1 + (x))
+@end example
+
+We would like @code{bar(foo)} to turn into @code{(1 + (foo))}, which
+would then turn into @code{(1 + (a,b))}. Instead, @code{bar(foo)}
+expands into @code{lose(a,b)}, and you get an error because @code{lose}
+requires a single argument. In this case, the problem is easily solved
+by the same parentheses that ought to be used to prevent misnesting of
+arithmetic operations:
+
+@example
+#define foo (a,b)
+@exdent or
+#define bar(x) lose((x))
+@end example
+
+The extra pair of parentheses prevents the comma in @code{foo}'s
+definition from being interpreted as an argument separator.
+
+@end itemize
+
+@node Newlines in Arguments
+@subsection Newlines in Arguments
+@cindex newlines in macro arguments
+
+The invocation of a function-like macro can extend over many logical
+lines. However, in the present implementation, the entire expansion
+comes out on one line. Thus line numbers emitted by the compiler or
+debugger refer to the line the invocation started on, which might be
+different to the line containing the argument causing the problem.
+
+Here is an example illustrating this:
+
+@example
+#define ignore_second_arg(a,b,c) a; c
+
+ignore_second_arg (foo (),
+ ignored (),
+ syntax error);
+@end example
+
+@noindent
+The syntax error triggered by the tokens @code{syntax error} results in
+an error message citing line three---the line of ignore_second_arg---
+even though the problematic code comes from line five.
+
+We consider this a bug, and intend to fix it in the near future.
+
+@node Conditionals
+@chapter Conditionals
+@cindex conditionals
+
+A @dfn{conditional} is a directive that instructs the preprocessor to
+select whether or not to include a chunk of code in the final token
+stream passed to the compiler. Preprocessor conditionals can test
+arithmetic expressions, or whether a name is defined as a macro, or both
+simultaneously using the special @code{defined} operator.
+
+A conditional in the C preprocessor resembles in some ways an @code{if}
+statement in C, but it is important to understand the difference between
+them. The condition in an @code{if} statement is tested during the
+execution of your program. Its purpose is to allow your program to
+behave differently from run to run, depending on the data it is
+operating on. The condition in a preprocessing conditional directive is
+tested when your program is compiled. Its purpose is to allow different
+code to be included in the program depending on the situation at the
+time of compilation.
+
+However, the distinction is becoming less clear. Modern compilers often
+do test @code{if} statements when a program is compiled, if their
+conditions are known not to vary at run time, and eliminate code which
+can never be executed. If you can count on your compiler to do this,
+you may find that your program is more readable if you use @code{if}
+statements with constant conditions (perhaps determined by macros). Of
+course, you can only use this to exclude code, not type definitions or
+other preprocessing directives, and you can only do it if the code
+remains syntactically valid when it is not to be used.
+
+GCC version 3 eliminates this kind of never-executed code even when
+not optimizing. Older versions did it only when optimizing.
+
+@menu
+* Conditional Uses::
+* Conditional Syntax::
+* Deleted Code::
+@end menu
+
+@node Conditional Uses
+@section Conditional Uses
+
+There are three general reasons to use a conditional.
+
+@itemize @bullet
+@item
+A program may need to use different code depending on the machine or
+operating system it is to run on. In some cases the code for one
+operating system may be erroneous on another operating system; for
+example, it might refer to data types or constants that do not exist on
+the other system. When this happens, it is not enough to avoid
+executing the invalid code. Its mere presence will cause the compiler
+to reject the program. With a preprocessing conditional, the offending
+code can be effectively excised from the program when it is not valid.
+
+@item
+You may want to be able to compile the same source file into two
+different programs. One version might make frequent time-consuming
+consistency checks on its intermediate data, or print the values of
+those data for debugging, and the other not.
+
+@item
+A conditional whose condition is always false is one way to exclude code
+from the program but keep it as a sort of comment for future reference.
+@end itemize
+
+Simple programs that do not need system-specific logic or complex
+debugging hooks generally will not need to use preprocessing
+conditionals.
+
+@node Conditional Syntax
+@section Conditional Syntax
+
+@findex #if
+A conditional in the C preprocessor begins with a @dfn{conditional
+directive}: @samp{#if}, @samp{#ifdef} or @samp{#ifndef}.
+
+@menu
+* Ifdef::
+* If::
+* Defined::
+* Else::
+* Elif::
+@end menu
+
+@node Ifdef
+@subsection Ifdef
+@findex #ifdef
+@findex #endif
+
+The simplest sort of conditional is
+
+@example
+@group
+#ifdef @var{MACRO}
+
+@var{controlled text}
+
+#endif /* @var{MACRO} */
+@end group
+@end example
+
+@cindex conditional group
+This block is called a @dfn{conditional group}. @var{controlled text}
+will be included in the output of the preprocessor if and only if
+@var{MACRO} is defined. We say that the conditional @dfn{succeeds} if
+@var{MACRO} is defined, @dfn{fails} if it is not.
+
+The @var{controlled text} inside of a conditional can include
+preprocessing directives. They are executed only if the conditional
+succeeds. You can nest conditional groups inside other conditional
+groups, but they must be completely nested. In other words,
+@samp{#endif} always matches the nearest @samp{#ifdef} (or
+@samp{#ifndef}, or @samp{#if}). Also, you cannot start a conditional
+group in one file and end it in another.
+
+Even if a conditional fails, the @var{controlled text} inside it is
+still run through initial transformations and tokenization. Therefore,
+it must all be lexically valid C@. Normally the only way this matters is
+that all comments and string literals inside a failing conditional group
+must still be properly ended.
+
+The comment following the @samp{#endif} is not required, but it is a
+good practice if there is a lot of @var{controlled text}, because it
+helps people match the @samp{#endif} to the corresponding @samp{#ifdef}.
+Older programs sometimes put @var{MACRO} directly after the
+@samp{#endif} without enclosing it in a comment. This is invalid code
+according to the C standard. GNU CPP accepts it with a warning. It
+never affects which @samp{#ifndef} the @samp{#endif} matches.
+
+@findex #ifndef
+Sometimes you wish to use some code if a macro is @emph{not} defined.
+You can do this by writing @samp{#ifndef} instead of @samp{#ifdef}.
+One common use of @samp{#ifndef} is to include code only the first
+time a header file is included. @xref{Once-Only Headers}.
+
+Macro definitions can vary between compilations for several reasons.
+Here are some samples.
+
+@itemize @bullet
+@item
+Some macros are predefined on each kind of machine
+(@pxref{System-specific Predefined Macros}). This allows you to provide
+code specially tuned for a particular machine.
+
+@item
+System header files define more macros, associated with the features
+they implement. You can test these macros with conditionals to avoid
+using a system feature on a machine where it is not implemented.
+
+@item
+Macros can be defined or undefined with the @option{-D} and @option{-U}
+command line options when you compile the program. You can arrange to
+compile the same source file into two different programs by choosing a
+macro name to specify which program you want, writing conditionals to
+test whether or how this macro is defined, and then controlling the
+state of the macro with command line options, perhaps set in the
+Makefile. @xref{Invocation}.
+
+@item
+Your program might have a special header file (often called
+@file{config.h}) that is adjusted when the program is compiled. It can
+define or not define macros depending on the features of the system and
+the desired capabilities of the program. The adjustment can be
+automated by a tool such as @command{autoconf}, or done by hand.
+@end itemize
+
+@node If
+@subsection If
+
+The @samp{#if} directive allows you to test the value of an arithmetic
+expression, rather than the mere existence of one macro. Its syntax is
+
+@example
+@group
+#if @var{expression}
+
+@var{controlled text}
+
+#endif /* @var{expression} */
+@end group
+@end example
+
+@var{expression} is a C expression of integer type, subject to stringent
+restrictions. It may contain
+
+@itemize @bullet
+@item
+Integer constants.
+
+@item
+Character constants, which are interpreted as they would be in normal
+code.
+
+@item
+Arithmetic operators for addition, subtraction, multiplication,
+division, bitwise operations, shifts, comparisons, and logical
+operations (@code{&&} and @code{||}). The latter two obey the usual
+short-circuiting rules of standard C@.
+
+@item
+Macros. All macros in the expression are expanded before actual
+computation of the expression's value begins.
+
+@item
+Uses of the @code{defined} operator, which lets you check whether macros
+are defined in the middle of an @samp{#if}.
+
+@item
+Identifiers that are not macros, which are all considered to be the
+number zero. This allows you to write @code{@w{#if MACRO}} instead of
+@code{@w{#ifdef MACRO}}, if you know that MACRO, when defined, will
+always have a nonzero value. Function-like macros used without their
+function call parentheses are also treated as zero.
+
+In some contexts this shortcut is undesirable. The @option{-Wundef}
+option causes GCC to warn whenever it encounters an identifier which is
+not a macro in an @samp{#if}.
+@end itemize
+
+The preprocessor does not know anything about types in the language.
+Therefore, @code{sizeof} operators are not recognized in @samp{#if}, and
+neither are @code{enum} constants. They will be taken as identifiers
+which are not macros, and replaced by zero. In the case of
+@code{sizeof}, this is likely to cause the expression to be invalid.
+
+The preprocessor calculates the value of @var{expression}. It carries
+out all calculations in the widest integer type known to the compiler;
+on most machines supported by GCC this is 64 bits. This is not the same
+rule as the compiler uses to calculate the value of a constant
+expression, and may give different results in some cases. If the value
+comes out to be nonzero, the @samp{#if} succeeds and the @var{controlled
+text} is included; otherwise it is skipped.
+
+If @var{expression} is not correctly formed, GCC issues an error and
+treats the conditional as having failed.
+
+@node Defined
+@subsection Defined
+
+@cindex @code{defined}
+The special operator @code{defined} is used in @samp{#if} and
+@samp{#elif} expressions to test whether a certain name is defined as a
+macro. @code{defined @var{name}} and @code{defined (@var{name})} are
+both expressions whose value is 1 if @var{name} is defined as a macro at
+the current point in the program, and 0 otherwise. Thus, @code{@w{#if
+defined MACRO}} is precisely equivalent to @code{@w{#ifdef MACRO}}.
+
+@code{defined} is useful when you wish to test more than one macro for
+existence at once. For example,
+
+@example
+#if defined (__vax__) || defined (__ns16000__)
+@end example
+
+@noindent
+would succeed if either of the names @code{__vax__} or
+@code{__ns16000__} is defined as a macro.
+
+Conditionals written like this:
+
+@example
+#if defined BUFSIZE && BUFSIZE >= 1024
+@end example
+
+@noindent
+can generally be simplified to just @code{@w{#if BUFSIZE >= 1024}},
+since if @code{BUFSIZE} is not defined, it will be interpreted as having
+the value zero.
+
+If the @code{defined} operator appears as a result of a macro expansion,
+the C standard says the behavior is undefined. GNU cpp treats it as a
+genuine @code{defined} operator and evaluates it normally. It will warn
+wherever your code uses this feature if you use the command-line option
+@option{-pedantic}, since other compilers may handle it differently.
+
+@node Else
+@subsection Else
+
+@findex #else
+The @samp{#else} directive can be added to a conditional to provide
+alternative text to be used if the condition fails. This is what it
+looks like:
+
+@example
+@group
+#if @var{expression}
+@var{text-if-true}
+#else /* Not @var{expression} */
+@var{text-if-false}
+#endif /* Not @var{expression} */
+@end group
+@end example
+
+@noindent
+If @var{expression} is nonzero, the @var{text-if-true} is included and
+the @var{text-if-false} is skipped. If @var{expression} is zero, the
+opposite happens.
+
+You can use @samp{#else} with @samp{#ifdef} and @samp{#ifndef}, too.
+
+@node Elif
+@subsection Elif
+
+@findex #elif
+One common case of nested conditionals is used to check for more than two
+possible alternatives. For example, you might have
+
+@example
+#if X == 1
+@dots{}
+#else /* X != 1 */
+#if X == 2
+@dots{}
+#else /* X != 2 */
+@dots{}
+#endif /* X != 2 */
+#endif /* X != 1 */
+@end example
+
+Another conditional directive, @samp{#elif}, allows this to be
+abbreviated as follows:
+
+@example
+#if X == 1
+@dots{}
+#elif X == 2
+@dots{}
+#else /* X != 2 and X != 1*/
+@dots{}
+#endif /* X != 2 and X != 1*/
+@end example
+
+@samp{#elif} stands for ``else if''. Like @samp{#else}, it goes in the
+middle of a conditional group and subdivides it; it does not require a
+matching @samp{#endif} of its own. Like @samp{#if}, the @samp{#elif}
+directive includes an expression to be tested. The text following the
+@samp{#elif} is processed only if the original @samp{#if}-condition
+failed and the @samp{#elif} condition succeeds.
+
+More than one @samp{#elif} can go in the same conditional group. Then
+the text after each @samp{#elif} is processed only if the @samp{#elif}
+condition succeeds after the original @samp{#if} and all previous
+@samp{#elif} directives within it have failed.
+
+@samp{#else} is allowed after any number of @samp{#elif} directives, but
+@samp{#elif} may not follow @samp{#else}.
+
+@node Deleted Code
+@section Deleted Code
+@cindex commenting out code
+
+If you replace or delete a part of the program but want to keep the old
+code around for future reference, you often cannot simply comment it
+out. Block comments do not nest, so the first comment inside the old
+code will end the commenting-out. The probable result is a flood of
+syntax errors.
+
+One way to avoid this problem is to use an always-false conditional
+instead. For instance, put @code{#if 0} before the deleted code and
+@code{#endif} after it. This works even if the code being turned
+off contains conditionals, but they must be entire conditionals
+(balanced @samp{#if} and @samp{#endif}).
+
+Some people use @code{#ifdef notdef} instead. This is risky, because
+@code{notdef} might be accidentally defined as a macro, and then the
+conditional would succeed. @code{#if 0} can be counted on to fail.
+
+Do not use @code{#if 0} for comments which are not C code. Use a real
+comment, instead. The interior of @code{#if 0} must consist of complete
+tokens; in particular, single-quote characters must balance. Comments
+often contain unbalanced single-quote characters (known in English as
+apostrophes). These confuse @code{#if 0}. They don't confuse
+@samp{/*}.
+
+@node Diagnostics
+@chapter Diagnostics
+@cindex diagnostic
+@cindex reporting errors
+@cindex reporting warnings
+
+@findex #error
+The directive @samp{#error} causes the preprocessor to report a fatal
+error. The tokens forming the rest of the line following @samp{#error}
+are used as the error message.
+
+You would use @samp{#error} inside of a conditional that detects a
+combination of parameters which you know the program does not properly
+support. For example, if you know that the program will not run
+properly on a VAX, you might write
+
+@example
+@group
+#ifdef __vax__
+#error "Won't work on VAXen. See comments at get_last_object."
+#endif
+@end group
+@end example
+
+If you have several configuration parameters that must be set up by
+the installation in a consistent way, you can use conditionals to detect
+an inconsistency and report it with @samp{#error}. For example,
+
+@example
+#if !defined(UNALIGNED_INT_ASM_OP) && defined(DWARF2_DEBUGGING_INFO)
+#error "DWARF2_DEBUGGING_INFO requires UNALIGNED_INT_ASM_OP."
+#endif
+@end example
+
+@findex #warning
+The directive @samp{#warning} is like @samp{#error}, but causes the
+preprocessor to issue a warning and continue preprocessing. The tokens
+following @samp{#warning} are used as the warning message.
+
+You might use @samp{#warning} in obsolete header files, with a message
+directing the user to the header file which should be used instead.
+
+Neither @samp{#error} nor @samp{#warning} macro-expands its argument.
+Internal whitespace sequences are each replaced with a single space.
+The line must consist of complete tokens. It is wisest to make the
+argument of these directives be a single string constant; this avoids
+problems with apostrophes and the like.
+
+@node Line Control
+@chapter Line Control
+@cindex line control
+
+The C preprocessor informs the C compiler of the location in your source
+code where each token came from. Presently, this is just the file name
+and line number. All the tokens resulting from macro expansion are
+reported as having appeared on the line of the source file where the
+outermost macro was used. We intend to be more accurate in the future.
+
+If you write a program which generates source code, such as the
+@command{bison} parser generator, you may want to adjust the preprocessor's
+notion of the current file name and line number by hand. Parts of the
+output from @command{bison} are generated from scratch, other parts come
+from a standard parser file. The rest are copied verbatim from
+@command{bison}'s input. You would like compiler error messages and
+symbolic debuggers to be able to refer to @code{bison}'s input file.
+
+@findex #line
+@command{bison} or any such program can arrange this by writing
+@samp{#line} directives into the output file. @samp{#line} is a
+directive that specifies the original line number and source file name
+for subsequent input in the current preprocessor input file.
+@samp{#line} has three variants:
+
+@table @code
+@item #line @var{linenum}
+@var{linenum} is a non-negative decimal integer constant. It specifies
+the line number which should be reported for the following line of
+input. Subsequent lines are counted from @var{linenum}.
+
+@item #line @var{linenum} @var{filename}
+@var{linenum} is the same as for the first form, and has the same
+effect. In addition, @var{filename} is a string constant. The
+following line and all subsequent lines are reported to come from the
+file it specifies, until something else happens to change that.
+
+@item #line @var{anything else}
+@var{anything else} is checked for macro calls, which are expanded.
+The result should match one of the above two forms.
+@end table
+
+@samp{#line} directives alter the results of the @code{__FILE__} and
+@code{__LINE__} predefined macros from that point on. @xref{Standard
+Predefined Macros}. They do not have any effect on @samp{#include}'s
+idea of the directory containing the current file.
+
+@node Pragmas
+@chapter Pragmas
+
+The @samp{#pragma} directive is the method specified by the C standard
+for providing additional information to the compiler, beyond what is
+conveyed in the language itself. Three forms of this directive
+(commonly known as @dfn{pragmas}) are specified by the 1999 C standard.
+A C compiler is free to attach any meaning it likes to other pragmas.
+
+GCC has historically preferred to use extensions to the syntax of the
+language, such as @code{__attribute__}, for this purpose. However, GCC
+does define a few pragmas of its own. These mostly have effects on the
+entire translation unit or source file.
+
+In GCC version 3, all GNU-defined, supported pragmas have been given a
+@code{GCC} prefix. This is in line with the @code{STDC} prefix on all
+pragmas defined by C99. For backward compatibility, pragmas which were
+recognized by previous versions are still recognized without the
+@code{GCC} prefix, but that usage is deprecated. Some older pragmas are
+deprecated in their entirety. They are not recognized with the
+@code{GCC} prefix. @xref{Obsolete Features}.
+
+@cindex @code{_Pragma}
+C99 introduces the @code{@w{_Pragma}} operator. This feature addresses a
+major problem with @samp{#pragma}: being a directive, it cannot be
+produced as the result of macro expansion. @code{@w{_Pragma}} is an
+operator, much like @code{sizeof} or @code{defined}, and can be embedded
+in a macro.
+
+Its syntax is @code{@w{_Pragma (@var{string-literal})}}, where
+@var{string-literal} can be either a normal or wide-character string
+literal. It is destringized, by replacing all @samp{\\} with a single
+@samp{\} and all @samp{\"} with a @samp{"}. The result is then
+processed as if it had appeared as the right hand side of a
+@samp{#pragma} directive. For example,
+
+@example
+_Pragma ("GCC dependency \"parse.y\"")
+@end example
+
+@noindent
+has the same effect as @code{#pragma GCC dependency "parse.y"}. The
+same effect could be achieved using macros, for example
+
+@example
+#define DO_PRAGMA(x) _Pragma (#x)
+DO_PRAGMA (GCC dependency "parse.y")
+@end example
+
+The standard is unclear on where a @code{_Pragma} operator can appear.
+The preprocessor does not accept it within a preprocessing conditional
+directive like @samp{#if}. To be safe, you are probably best keeping it
+out of directives other than @samp{#define}, and putting it on a line of
+its own.
+
+This manual documents the pragmas which are meaningful to the
+preprocessor itself. Other pragmas are meaningful to the C or C++
+compilers. They are documented in the GCC manual.
+
+@ftable @code
+@item #pragma GCC dependency
+@code{#pragma GCC dependency} allows you to check the relative dates of
+the current file and another file. If the other file is more recent than
+the current file, a warning is issued. This is useful if the current
+file is derived from the other file, and should be regenerated. The
+other file is searched for using the normal include search path.
+Optional trailing text can be used to give more information in the
+warning message.
+
+@example
+#pragma GCC dependency "parse.y"
+#pragma GCC dependency "/usr/include/time.h" rerun fixincludes
+@end example
+
+@item #pragma GCC poison
+Sometimes, there is an identifier that you want to remove completely
+from your program, and make sure that it never creeps back in. To
+enforce this, you can @dfn{poison} the identifier with this pragma.
+@code{#pragma GCC poison} is followed by a list of identifiers to
+poison. If any of those identifiers appears anywhere in the source
+after the directive, it is a hard error. For example,
+
+@example
+#pragma GCC poison printf sprintf fprintf
+sprintf(some_string, "hello");
+@end example
+
+@noindent
+will produce an error.
+
+If a poisoned identifier appears as part of the expansion of a macro
+which was defined before the identifier was poisoned, it will @emph{not}
+cause an error. This lets you poison an identifier without worrying
+about system headers defining macros that use it.
+
+For example,
+
+@example
+#define strrchr rindex
+#pragma GCC poison rindex
+strrchr(some_string, 'h');
+@end example
+
+@noindent
+will not produce an error.
+
+@item #pragma GCC system_header
+This pragma takes no arguments. It causes the rest of the code in the
+current file to be treated as if it came from a system header.
+@xref{System Headers}.
+
+@end ftable
+
+@node Other Directives
+@chapter Other Directives
+
+@findex #ident
+The @samp{#ident} directive takes one argument, a string constant. On
+some systems, that string constant is copied into a special segment of
+the object file. On other systems, the directive is ignored.
+
+This directive is not part of the C standard, but it is not an official
+GNU extension either. We believe it came from System V@.
+
+@findex #sccs
+The @samp{#sccs} directive is recognized on some systems, because it
+appears in their header files. It is a very old, obscure, extension
+which we did not invent, and we have been unable to find any
+documentation of what it should do, so GCC simply ignores it.
+
+@cindex null directive
+The @dfn{null directive} consists of a @samp{#} followed by a newline,
+with only whitespace (including comments) in between. A null directive
+is understood as a preprocessing directive but has no effect on the
+preprocessor output. The primary significance of the existence of the
+null directive is that an input line consisting of just a @samp{#} will
+produce no output, rather than a line of output containing just a
+@samp{#}. Supposedly some old C programs contain such lines.
+
+@node Preprocessor Output
+@chapter Preprocessor Output
+
+When the C preprocessor is used with the C, C++, or Objective-C
+compilers, it is integrated into the compiler and communicates a stream
+of binary tokens directly to the compiler's parser. However, it can
+also be used in the more conventional standalone mode, where it produces
+textual output.
+@c FIXME: Document the library interface.
+
+@cindex output format
+The output from the C preprocessor looks much like the input, except
+that all preprocessing directive lines have been replaced with blank
+lines and all comments with spaces. Long runs of blank lines are
+discarded.
+
+The ISO standard specifies that it is implementation defined whether a
+preprocessor preserves whitespace between tokens, or replaces it with
+e.g.@: a single space. In GNU CPP, whitespace between tokens is collapsed
+to become a single space, with the exception that the first token on a
+non-directive line is preceded with sufficient spaces that it appears in
+the same column in the preprocessed output that it appeared in the
+original source file. This is so the output is easy to read.
+@xref{Differences from previous versions}. CPP does not insert any
+whitespace where there was none in the original source, except where
+necessary to prevent an accidental token paste.
+
+@cindex linemarkers
+Source file name and line number information is conveyed by lines
+of the form
+
+@example
+# @var{linenum} @var{filename} @var{flags}
+@end example
+
+@noindent
+These are called @dfn{linemarkers}. They are inserted as needed into
+the output (but never within a string or character constant). They mean
+that the following line originated in file @var{filename} at line
+@var{linenum}.
+
+After the file name comes zero or more flags, which are @samp{1},
+@samp{2}, @samp{3}, or @samp{4}. If there are multiple flags, spaces
+separate them. Here is what the flags mean:
+
+@table @samp
+@item 1
+This indicates the start of a new file.
+@item 2
+This indicates returning to a file (after having included another file).
+@item 3
+This indicates that the following text comes from a system header file,
+so certain warnings should be suppressed.
+@item 4
+This indicates that the following text should be treated as being
+wrapped in an implicit @code{extern "C"} block.
+@c maybe cross reference NO_IMPLICIT_EXTERN_C
+@end table
+
+As an extension, the preprocessor accepts linemarkers in non-assembler
+input files. They are treated like the corresponding @samp{#line}
+directive, (@pxref{Line Control}), except that trailing flags are
+permitted, and are interpreted with the meanings described above. If
+multiple flags are given, they must be in ascending order.
+
+Some directives may be duplicated in the output of the preprocessor.
+These are @samp{#ident} (always), @samp{#pragma} (only if the
+preprocessor does not handle the pragma itself), and @samp{#define} and
+@samp{#undef} (with certain debugging options). If this happens, the
+@samp{#} of the directive will always be in the first column, and there
+will be no space between the @samp{#} and the directive name. If macro
+expansion happens to generate tokens which might be mistaken for a
+duplicated directive, a space will be inserted between the @samp{#} and
+the directive name.
+
+@node Traditional Mode
+@chapter Traditional Mode
+
+Traditional (pre-standard) C preprocessing is rather different from
+the preprocessing specified by the standard. When GCC is given the
+@option{-traditional} option, it attempts to emulate a traditional
+preprocessor. We do not guarantee that GCC's behavior under
+@option{-traditional} matches any pre-standard preprocessor exactly.
+
+Traditional mode exists only for backward compatibility. We have no
+plans to augment it in any way nor will we change it except to fix
+catastrophic bugs. You should be aware that modern C libraries often
+have header files which are incompatible with traditional mode.
+
+This is a list of the differences. It may not be complete, and may not
+correspond exactly to the behavior of either GCC or a true traditional
+preprocessor.
+
+@itemize @bullet
+@item
+Traditional macro expansion pays no attention to single-quote or
+double-quote characters; macro argument symbols are replaced by the
+argument values even when they appear within apparent string or
+character constants.
+
+@item
+Traditionally, it is permissible for a macro expansion to end in the
+middle of a string or character constant. The constant continues into
+the text surrounding the macro call.
+
+@item
+However, the end of the line terminates a string or character constant,
+with no error. (This is a kluge. Traditional mode is commonly used to
+preprocess things which are not C, and have a different comment syntax.
+Single apostrophes often appear in comments. This kluge prevents the
+traditional preprocessor from issuing errors on such comments.)
+
+@item
+Preprocessing directives are recognized in traditional C only when their
+leading @samp{#} appears in the first column. There can be no
+whitespace between the beginning of the line and the @samp{#}.
+
+@item
+In traditional C, a comment is equivalent to no text at all. (In ISO
+C, a comment counts as whitespace.) It can be used sort of the same way
+that @samp{##} is used in ISO C, to paste macro arguments together.
+
+@item
+Traditional C does not have the concept of a preprocessing number.
+
+@item
+A macro is not suppressed within its own definition, in traditional C@.
+Thus, any macro that is used recursively inevitably causes an error.
+
+@item
+The @samp{#} and @samp{##} operators are not available in traditional
+C@.
+
+@item
+In traditional C, the text at the end of a macro expansion can run
+together with the text after the macro call, to produce a single token.
+This is impossible in ISO C@.
+
+@item
+None of the GNU extensions to the preprocessor are available in
+traditional mode, with the exception of a partial implementation of
+assertions, and those may be removed in the future.
+
+@item
+A true traditional C preprocessor does not recognize @samp{#elif},
+@samp{#error}, or @samp{#pragma}. GCC supports @samp{#elif} and
+@samp{#error} even in traditional mode, but not @samp{#pragma}.
+
+@item
+Traditional mode is text-based, not token-based, and comments are
+stripped after macro expansion. Therefore, @samp{/**/} can be used to
+paste tokens together provided that there is no whitespace between it
+and the tokens to be pasted.
+
+@item
+Traditional mode preserves the amount and form of whitespace provided by
+the user. Hard tabs remain hard tabs. This can be useful, e.g.@: if you
+are preprocessing a Makefile (which we do not encourage).
+@end itemize
+
+You can request warnings about features that did not exist, or worked
+differently, in traditional C with the @option{-Wtraditional} option.
+This works only if you do @emph{not} specify @option{-traditional}. GCC
+does not warn about features of ISO C which you must use when you are
+using a conforming compiler, such as the @samp{#} and @samp{##}
+operators.
+
+Presently @option{-Wtraditional} warns about:
+
+@itemize @bullet
+@item
+Macro parameters that appear within string literals in the macro body.
+In traditional C macro replacement takes place within string literals,
+but does not in ISO C@.
+
+@item
+In traditional C, some preprocessor directives did not exist.
+Traditional preprocessors would only consider a line to be a directive
+if the @samp{#} appeared in column 1 on the line. Therefore
+@option{-Wtraditional} warns about directives that traditional C
+understands but would ignore because the @samp{#} does not appear as the
+first character on the line. It also suggests you hide directives like
+@samp{#pragma} not understood by traditional C by indenting them. Some
+traditional implementations would not recognise @samp{#elif}, so it
+suggests avoiding it altogether.
+
+@item
+A function-like macro that appears without an argument list. In
+traditional C this was an error. In ISO C it merely means that the
+macro is not expanded.
+
+@item
+The unary plus operator. This did not exist in traditional C@.
+
+@item
+The @samp{U} and @samp{LL} integer constant suffixes, which were not
+available in traditional C@. (Traditional C does support the @samp{L}
+suffix for simple long integer constants.) You are not warned about
+uses of these suffixes in macros defined in system headers. For
+instance, @code{UINT_MAX} may well be defined as @code{4294967295U}, but
+you will not be warned if you use @code{UINT_MAX}.
+
+You can usually avoid the warning, and the related warning about
+constants which are so large that they are unsigned, by writing the
+integer constant in question in hexadecimal, with no U suffix. Take
+care, though, because this gives the wrong result in exotic cases.
+@end itemize
+
+@node Implementation Details
+@chapter Implementation Details
+
+Here we document details of how the preprocessor's implementation
+affects its user-visible behavior. You should try to avoid undue
+reliance on behaviour described here, as it is possible that it will
+change subtly in future implementations.
+
+Also documented here are obsolete features and changes from previous
+versions of GNU CPP@.
+
+@menu
+* Implementation-defined behavior::
+* Implementation limits::
+* Obsolete Features::
+* Differences from previous versions::
+@end menu
+
+@node Implementation-defined behavior
+@section Implementation-defined behavior
+@cindex implementation-defined behavior
+
+This is how GNU CPP behaves in all the cases which the C standard
+describes as @dfn{implementation-defined}. This term means that the
+implementation is free to do what it likes, but must document its choice
+and stick to it.
+@c FIXME: Check the C++ standard for more implementation-defined stuff.
+
+@itemize @bullet
+@need 1000
+@item The mapping of physical source file multi-byte characters to the
+execution character set.
+
+Currently, GNU cpp only supports character sets that are strict supersets
+of ASCII, and performs no translation of characters.
+
+@item Non-empty sequences of whitespace characters.
+
+In textual output, each whitespace sequence is collapsed to a single
+space. For aesthetic reasons, the first token on each non-directive
+line of output is preceded with sufficient spaces that it appears in the
+same column as it did in the original source file.
+
+@item The numeric value of character constants in preprocessor expressions.
+
+The preprocessor and compiler interpret character constants in the same
+way; escape sequences such as @samp{\a} are given the values they would
+have on the target machine.
+
+Multi-character character constants are interpreted a character at a
+time, shifting the previous result left by the number of bits per
+character on the host, and adding the new character. For example, 'ab'
+on an 8-bit host would be interpreted as @w{'a' * 256 + 'b'}. If there
+are more characters in the constant than can fit in the widest native
+integer type on the host, usually a @code{long}, the excess characters
+are ignored and a diagnostic is given.
+
+@item Source file inclusion.
+
+For a discussion on how the preprocessor locates header files,
+@ref{Include Operation}.
+
+@item Interpretation of the filename resulting from a macro-expanded
+@samp{#include} directive.
+
+@xref{Computed Includes}.
+
+@item Treatment of a @samp{#pragma} directive that after macro-expansion
+results in a standard pragma.
+
+No macro expansion occurs on any @samp{#pragma} directive line, so the
+question does not arise.
+
+Note that GCC does not yet implement any of the standard
+pragmas.
+
+@end itemize
+
+@node Implementation limits
+@section Implementation limits
+@cindex implementation limits
+
+GNU CPP has a small number of internal limits. This section lists the
+limits which the C standard requires to be no lower than some minimum,
+and all the others we are aware of. We intend there to be as few limits
+as possible. If you encounter an undocumented or inconvenient limit,
+please report that to us as a bug. (See the section on reporting bugs in
+the GCC manual.)
+
+Where we say something is limited @dfn{only by available memory}, that
+means that internal data structures impose no intrinsic limit, and space
+is allocated with @code{malloc} or equivalent. The actual limit will
+therefore depend on many things, such as the size of other things
+allocated by the compiler at the same time, the amount of memory
+consumed by other processes on the same computer, etc.
+
+@itemize @bullet
+
+@item Nesting levels of @samp{#include} files.
+
+We impose an arbitrary limit of 200 levels, to avoid runaway recursion.
+The standard requires at least 15 levels.
+
+@item Nesting levels of conditional inclusion.
+
+The C standard mandates this be at least 63. GNU CPP is limited only by
+available memory.
+
+@item Levels of parenthesised expressions within a full expression.
+
+The C standard requires this to be at least 63. In preprocessor
+conditional expressions, it is limited only by available memory.
+
+@item Significant initial characters in an identifier or macro name.
+
+The preprocessor treats all characters as significant. The C standard
+requires only that the first 63 be significant.
+
+@item Number of macros simultaneously defined in a single translation unit.
+
+The standard requires at least 4095 be possible. GNU CPP is limited only
+by available memory.
+
+@item Number of parameters in a macro definition and arguments in a macro call.
+
+We allow @code{USHRT_MAX}, which is no smaller than 65,535. The minimum
+required by the standard is 127.
+
+@item Number of characters on a logical source line.
+
+The C standard requires a minimum of 4096 be permitted. GNU CPP places
+no limits on this, but you may get incorrect column numbers reported in
+diagnostics for lines longer than 65,535 characters.
+
+@item Maximum size of a source file.
+
+The standard does not specify any lower limit on the maximum size of a
+source file. GNU cpp maps files into memory, so it is limited by the
+available address space. This is generally at least two gigabytes.
+Depending on the operating system, the size of physical memory may or
+may not be a limitation.
+
+@end itemize
+
+@node Obsolete Features
+@section Obsolete Features
+
+GNU CPP has a number of features which are present mainly for
+compatibility with older programs. We discourage their use in new code.
+In some cases, we plan to remove the feature in a future version of GCC@.
+
+@menu
+* Assertions::
+* Obsolete once-only headers::
+* Miscellaneous obsolete features::
+@end menu
+
+@node Assertions
+@subsection Assertions
+@cindex assertions
+
+@dfn{Assertions} are a deprecated alternative to macros in writing
+conditionals to test what sort of computer or system the compiled
+program will run on. Assertions are usually predefined, but you can
+define them with preprocessing directives or command-line options.
+
+Assertions were intended to provide a more systematic way to describe
+the compiler's target system. However, in practice they are just as
+unpredictable as the system-specific predefined macros. In addition, they
+are not part of any standard, and only a few compilers support them.
+Therefore, the use of assertions is @strong{less} portable than the use
+of system-specific predefined macros. We recommend you do not use them at
+all.
+
+@cindex predicates
+An assertion looks like this:
+
+@example
+#@var{predicate} (@var{answer})
+@end example
+
+@noindent
+@var{predicate} must be a single identifier. @var{answer} can be any
+sequence of tokens; all characters are significant except for leading
+and trailing whitespace, and differences in internal whitespace
+sequences are ignored. (This is similar to the rules governing macro
+redefinition.) Thus, @code{(x + y)} is different from @code{(x+y)} but
+equivalent to @code{@w{( x + y )}}. Parentheses do not nest inside an
+answer.
+
+@cindex testing predicates
+To test an assertion, you write it in an @samp{#if}. For example, this
+conditional succeeds if either @code{vax} or @code{ns16000} has been
+asserted as an answer for @code{machine}.
+
+@example
+#if #machine (vax) || #machine (ns16000)
+@end example
+
+@noindent
+You can test whether @emph{any} answer is asserted for a predicate by
+omitting the answer in the conditional:
+
+@example
+#if #machine
+@end example
+
+@findex #assert
+Assertions are made with the @samp{#assert} directive. Its sole
+argument is the assertion to make, without the leading @samp{#} that
+identifies assertions in conditionals.
+
+@example
+#assert @var{predicate} (@var{answer})
+@end example
+
+@noindent
+You may make several assertions with the same predicate and different
+answers. Subsequent assertions do not override previous ones for the
+same predicate. All the answers for any given predicate are
+simultaneously true.
+
+@cindex assertions, cancelling
+@findex #unassert
+Assertions can be cancelled with the @samp{#unassert} directive. It
+has the same syntax as @samp{#assert}. In that form it cancels only the
+answer which was specified on the @samp{#unassert} line; other answers
+for that predicate remain true. You can cancel an entire predicate by
+leaving out the answer:
+
+@example
+#unassert @var{predicate}
+@end example
+
+@noindent
+In either form, if no such assertion has been made, @samp{#unassert} has
+no effect.
+
+You can also make or cancel assertions using command line options.
+@xref{Invocation}.
+
+@node Obsolete once-only headers
+@subsection Obsolete once-only headers
+
+GNU CPP supports two more ways of indicating that a header file should be
+read only once. Neither one is as portable as a wrapper @samp{#ifndef},
+and we recommend you do not use them in new programs.
+
+@findex #import
+In the Objective-C language, there is a variant of @samp{#include}
+called @samp{#import} which includes a file, but does so at most once.
+If you use @samp{#import} instead of @samp{#include}, then you don't
+need the conditionals inside the header file to prevent multiple
+inclusion of the contents. GCC permits the use of @samp{#import} in C
+and C++ as well as Objective-C@. However, it is not in standard C or C++
+and should therefore not be used by portable programs.
+
+@samp{#import} is not a well designed feature. It requires the users of
+a header file to know that it should only be included once. It is much
+better for the header file's implementor to write the file so that users
+don't need to know this. Using a wrapper @samp{#ifndef} accomplishes
+this goal.
+
+In the present implementation, a single use of @samp{#import} will
+prevent the file from ever being read again, by either @samp{#import} or
+@samp{#include}. You should not rely on this; do not use both
+@samp{#import} and @samp{#include} to refer to the same header file.
+
+Another way to prevent a header file from being included more than once
+is with the @samp{#pragma once} directive. If @samp{#pragma once} is
+seen when scanning a header file, that file will never be read again, no
+matter what.
+
+@samp{#pragma once} does not have the problems that @samp{#import} does,
+but it is not recognized by all preprocessors, so you cannot rely on it
+in a portable program.
+
+@node Miscellaneous obsolete features
+@subsection Miscellaneous obsolete features
+
+Here are a few more obsolete features.
+
+@itemize @bullet
+@cindex invalid token paste
+@item Attempting to paste two tokens which together do not form a valid
+preprocessing token.
+
+The preprocessor currently warns about this and outputs the two tokens
+adjacently, which is probably the behavior the programmer intends. It
+may not work in future, though.
+
+Most of the time, when you get this warning, you will find that @samp{##}
+is being used superstitiously, to guard against whitespace appearing
+between two tokens. It is almost always safe to delete the @samp{##}.
+
+@cindex pragma poison
+@item @code{#pragma poison}
+
+This is the same as @code{#pragma GCC poison}. The version without the
+@code{GCC} prefix is deprecated. @xref{Pragmas}.
+
+@cindex multi-line string constants
+@item Multi-line string constants
+
+GCC currently allows a string constant to extend across multiple logical
+lines of the source file. This extension is deprecated and will be
+removed in a future version of GCC@. Such string constants are already
+rejected in all directives apart from @samp{#define}.
+
+Instead, make use of ISO C concatenation of adjacent string literals, or
+use @samp{\n} followed by a backslash-newline.
+
+@end itemize
+
+@node Differences from previous versions
+@section Differences from previous versions
+@cindex differences from previous versions
+
+This section details behavior which has changed from previous versions
+of GNU CPP@. We do not plan to change it again in the near future, but
+we do not promise not to, either.
+
+The ``previous versions'' discussed here are 2.95 and before. The
+behavior of GCC 3.0 is mostly the same as the behavior of the widely
+used 2.96 and 2.97 development snapshots. Where there are differences,
+they generally represent bugs in the snapshots.
+
+@itemize @bullet
+
+@item Order of evaluation of @samp{#} and @samp{##} operators
+
+The standard does not specify the order of evaluation of a chain of
+@samp{##} operators, nor whether @samp{#} is evaluated before, after, or
+at the same time as @samp{##}. You should therefore not write any code
+which depends on any specific ordering. It is possible to guarantee an
+ordering, if you need one, by suitable use of nested macros.
+
+An example of where this might matter is pasting the arguments @samp{1},
+@samp{e} and @samp{-2}. This would be fine for left-to-right pasting,
+but right-to-left pasting would produce an invalid token @samp{e-2}.
+
+GCC 3.0 evaluates @samp{#} and @samp{##} at the same time and strictly
+left to right. Older versions evaluated all @samp{#} operators first,
+then all @samp{##} operators, in an unreliable order.
+
+@item The form of whitespace betwen tokens in preprocessor output
+
+@xref{Preprocessor Output}, for the current textual format. This is
+also the format used by stringification. Normally, the preprocessor
+communicates tokens directly to the compiler's parser, and whitespace
+does not come up at all.
+
+Older versions of GCC preserved all whitespace provided by the user and
+inserted lots more whitespace of their own, because they could not
+accurately predict when extra spaces were needed to prevent accidental
+token pasting.
+
+@item Optional argument when invoking rest argument macros
+
+As an extension, GCC permits you to omit the variable arguments entirely
+when you use a variable argument macro. This is forbidden by the 1999 C
+standard, and will provoke a pedantic warning with GCC 3.0. Previous
+versions accepted it silently.
+
+@item @samp{##} swallowing preceding text in rest argument macros
+
+Formerly, in a macro expansion, if @samp{##} appeared before a variable
+arguments parameter, and the set of tokens specified for that argument
+in the macro invocation was empty, previous versions of GNU CPP would
+back up and remove the preceding sequence of non-whitespace characters
+(@strong{not} the preceding token). This extension is in direct
+conflict with the 1999 C standard and has been drastically pared back.
+
+In the current version of the preprocessor, if @samp{##} appears between
+a comma and a variable arguments parameter, and the variable argument is
+omitted entirely, the comma will be removed from the expansion. If the
+variable argument is empty, or the token before @samp{##} is not a
+comma, then @samp{##} behaves as a normal token paste.
+
+@item Traditional mode and GNU extensions
+
+Traditional mode used to be implemented in the same program as normal
+preprocessing. Therefore, all the GNU extensions to the preprocessor
+were still available in traditional mode. It is now a separate program
+and does not implement any of the GNU extensions, except for a partial
+implementation of assertions. Even those may be removed in a future
+release.
+@end itemize
+
+@node Invocation
+@chapter Invocation
+@cindex invocation
+@cindex command line
+
+Most often when you use the C preprocessor you will not have to invoke it
+explicitly: the C compiler will do so automatically. However, the
+preprocessor is sometimes useful on its own. All the options listed
+here are also acceptable to the C compiler and have the same meaning,
+except that the C compiler has different rules for specifying the output
+file.
+
+@strong{Note:} Whether you use the preprocessor by way of @command{gcc}
+or @command{cpp}, the @dfn{compiler driver} is run first. This
+program's purpose is to translate your command into invocations of the
+programs that do the actual work. Their command line interfaces are
+similar but not identical to the documented interface, and may change
+without notice.
+
+@ignore
+@c man begin SYNOPSIS
+cpp [@option{-D}@var{macro}[=@var{defn}]@dots{}] [@option{-U}@var{macro}]
+ [@option{-I}@var{dir}@dots{}] [@option{-W}@var{warn}@dots{}]
+ [@option{-M}|@option{-MM}] [@option{-MG}] [@option{-MF} @var{filename}]
+ [@option{-MP}] [@option{-MQ} @var{target}@dots{}] [@option{-MT} @var{target}@dots{}]
+ [@option{-x} @var{language}] [@option{-std=}@var{standard}]
+ @var{infile} @var{outfile}
+
+Only the most useful options are listed here; see below for the remainder.
+@c man end
+@c man begin SEEALSO
+gpl(7), gfdl(7), fsf-funding(7),
+gcc(1), as(1), ld(1), and the Info entries for @file{cpp}, @file{gcc}, and
+@file{binutils}.
+@c man end
+@end ignore
+
+@c man begin OPTIONS
+The C preprocessor expects two file names as arguments, @var{infile} and
+@var{outfile}. The preprocessor reads @var{infile} together with any
+other files it specifies with @samp{#include}. All the output generated
+by the combined input files is written in @var{outfile}.
+
+Either @var{infile} or @var{outfile} may be @option{-}, which as
+@var{infile} means to read from standard input and as @var{outfile}
+means to write to standard output. Also, if either file is omitted, it
+means the same as if @option{-} had been specified for that file.
+
+Unless otherwise noted, or the option ends in @samp{=}, all options
+which take an argument may have that argument appear either immediately
+after the option, or with a space between option and argument:
+@option{-Ifoo} and @option{-I foo} have the same effect.
+
+@cindex grouping options
+@cindex options, grouping
+Many options have multi-letter names; therefore multiple single-letter
+options may @emph{not} be grouped: @option{-dM} is very different from
+@w{@samp{-d -M}}.
+
+@cindex options
+@table @gcctabopt
+@item -D @var{name}
+Predefine @var{name} as a macro, with definition @code{1}.
+
+@item -D @var{name}=@var{definition}
+Predefine @var{name} as a macro, with definition @var{definition}.
+There are no restrictions on the contents of @var{definition}, but if
+you are invoking the preprocessor from a shell or shell-like program you
+may need to use the shell's quoting syntax to protect characters such as
+spaces that have a meaning in the shell syntax. If you use more than
+one @option{-D} for the same @var{name}, the rightmost definition takes
+effect.
+
+If you wish to define a function-like macro on the command line, write
+its argument list with surrounding parentheses before the equals sign
+(if any). Parentheses are meaningful to most shells, so you will need
+to quote the option. With @command{sh} and @command{csh},
+@option{-D'@var{name}(@var{args@dots{}})=@var{definition}'} works.
+
+@item -U @var{name}
+Cancel any previous definition of @var{name}, either built in or
+provided with a @option{-D} option.
+
+All @option{-imacros @var{file}} and @option{-include @var{file}} options
+are processed after all @option{-D} and @option{-U} options.
+
+@item -undef
+Do not predefine any system-specific macros. The common predefined
+macros remain defined.
+
+@item -I @var{dir}
+Add the directory @var{dir} to the list of directories to be searched
+for header files. @xref{Search Path}. Directories named by @option{-I}
+are searched before the standard system include directories.
+
+It is dangerous to specify a standard system include directory in an
+@option{-I} option. This defeats the special treatment of system
+headers (@pxref{System Headers}). It can also defeat the repairs to
+buggy system headers which GCC makes when it is installed.
+
+@item -o @var{file}
+Write output to @var{file}. This is the same as specifying @var{file}
+as the second non-option argument to @command{cpp}. @command{gcc} has a
+different interpretation of a second non-option argument, so you must
+use @option{-o} to specify the output file.
+
+@item -Wall
+Turns on all optional warnings which are desirable for normal code. At
+present this is @option{-Wcomment} and @option{-Wtrigraphs}. Note that
+many of the preprocessor's warnings are on by default and have no
+options to control them.
+
+@item -Wcomment
+@itemx -Wcomments
+Warn whenever a comment-start sequence @samp{/*} appears in a @samp{/*}
+comment, or whenever a backslash-newline appears in a @samp{//} comment.
+(Both forms have the same effect.)
+
+@item -Wtrigraphs
+Warn if any trigraphs are encountered. This option used to take effect
+only if @option{-trigraphs} was also specified, but now works
+independently. Warnings are not given for trigraphs within comments, as
+they do not affect the meaning of the program.
+
+@item -Wtraditional
+Warn about certain constructs that behave differently in traditional and
+ISO C@. Also warn about ISO C constructs that have no traditional C
+equivalent, and problematic constructs which should be avoided.
+@xref{Traditional Mode}.
+
+@item -Wimport
+Warn the first time @samp{#import} is used.
+
+@item -Wundef
+Warn whenever an identifier which is not a macro is encountered in an
+@samp{#if} directive, outside of @samp{defined}. Such identifiers are
+replaced with zero.
+
+@item -Werror
+Make all warnings into hard errors. Source code which triggers warnings
+will be rejected.
+
+@item -Wsystem-headers
+Issue warnings for code in system headers. These are normally unhelpful
+in finding bugs in your own code, therefore suppressed. If you are
+responsible for the system library, you may want to see them.
+
+@item -w
+Suppress all warnings, including those which GNU CPP issues by default.
+
+@item -pedantic
+Issue all the mandatory diagnostics listed in the C standard. Some of
+them are left out by default, since they trigger frequently on harmless
+code.
+
+@item -pedantic-errors
+Issue all the mandatory diagnostics, and make all mandatory diagnostics
+into errors. This includes mandatory diagnostics that GCC issues
+without @samp{-pedantic} but treats as warnings.
+
+@item -M
+Instead of outputting the result of preprocessing, output a rule
+suitable for @command{make} describing the dependencies of the main
+source file. The preprocessor outputs one @command{make} rule containing
+the object file name for that source file, a colon, and the names of all
+the included files, including those coming from @option{-include} or
+@option{-imacros} command line options.
+
+Unless specified explicitly (with @option{-MT} or @option{-MQ}), the
+object file name consists of the basename of the source file with any
+suffix replaced with object file suffix. If there are many included
+files then the rule is split into several lines using @samp{\}-newline.
+The rule has no commands.
+
+@item -MM
+Like @option{-M}, but mention only the files included with @code{@w{#include
+"@var{file}"}} or with @option{-include} or @option{-imacros} command line
+options. System header files included with @code{@w{#include <@var{file}>}}
+are omitted.
+
+@item -MF @var{file}
+When used with @option{-M} or @option{-MM}, specifies a file to write the
+dependencies to. This allows the preprocessor to write the preprocessed
+file to stdout normally. If no @option{-MF} switch is given, CPP sends
+the rules to stdout and suppresses normal preprocessed output.
+
+@item -MG
+When used with @option{-M} or @option{-MM}, @option{-MG} says to treat missing
+header files as generated files and assume they live in the same
+directory as the source file. It suppresses preprocessed output, as a
+missing header file is ordinarily an error.
+
+This feature is used in automatic updating of makefiles.
+
+@item -MP
+This option instructs CPP to add a phony target for each dependency
+other than the main file, causing each to depend on nothing. These
+dummy rules work around errors @command{make} gives if you remove header
+files without updating the @file{Makefile} to match.
+
+This is typical output:
+
+@example
+test.o: test.c test.h
+
+test.h:
+@end example
+
+@item -MT @var{target}
+
+Change the target of the rule emitted by dependency generation. By
+default CPP takes the name of the main input file, including any path,
+deletes any file suffix such as @samp{.c}, and appends the platform's
+usual object suffix. The result is the target.
+
+An @option{-MT} option will set the target to be exactly the string you
+specify. If you want multiple targets, you can specify them as a single
+argument to @option{-MT}, or use multiple @option{-MT} options.
+
+For example, @option{@w{-MT '$(objpfx)foo.o'}} might give
+
+@example
+$(objpfx)foo.o: foo.c
+@end example
+
+@item -MQ @var{target}
+
+Same as @option{-MT}, but it quotes any characters which are special to
+Make. @option{@w{-MQ '$(objpfx)foo.o'}} gives
+
+@example
+$$(objpfx)foo.o: foo.c
+@end example
+
+The default target is automatically quoted, as if it were given with
+@option{-MQ}.
+
+@item -MD @var{file}
+@itemx -MMD @var{file}
+@option{-MD @var{file}} is equivalent to @option{-M -MF @var{file}}, and
+@option{-MMD @var{file}} is equivalent to @option{-MM -MF @var{file}}.
+
+Due to limitations in the compiler driver, you must use these switches
+when you want to generate a dependency file as a side-effect of normal
+compilation.
+
+@item -x c
+@itemx -x c++
+@itemx -x objective-c
+@itemx -x assembler-with-cpp
+Specify the source language: C, C++, Objective-C, or assembly. This has
+nothing to do with standards conformance or extensions; it merely
+selects which base syntax to expect. If you give none of these options,
+cpp will deduce the language from the extension of the source file:
+@samp{.c}, @samp{.cc}, @samp{.m}, or @samp{.S}. Some other common
+extensions for C++ and assembly are also recognized. If cpp does not
+recognize the extension, it will treat the file as C; this is the most
+generic mode.
+
+@strong{Note:} Previous versions of cpp accepted a @option{-lang} option
+which selected both the language and the standards conformance level.
+This option has been removed, because it conflicts with the @option{-l}
+option.
+
+@item -std=@var{standard}
+@itemx -ansi
+Specify the standard to which the code should conform. Currently cpp
+only knows about the standards for C; other language standards will be
+added in the future.
+
+@var{standard}
+may be one of:
+@table @code
+@item iso9899:1990
+@itemx c89
+The ISO C standard from 1990. @samp{c89} is the customary shorthand for
+this version of the standard.
+
+The @option{-ansi} option is equivalent to @option{-std=c89}.
+
+@item iso9899:199409
+The 1990 C standard, as amended in 1994.
+
+@item iso9899:1999
+@itemx c99
+@itemx iso9899:199x
+@itemx c9x
+The revised ISO C standard, published in December 1999. Before
+publication, this was known as C9X@.
+
+@item gnu89
+The 1990 C standard plus GNU extensions. This is the default.
+
+@item gnu99
+@itemx gnu9x
+The 1999 C standard plus GNU extensions.
+@end table
+
+@item -I-
+Split the include path. Any directories specified with @option{-I}
+options before @option{-I-} are searched only for headers requested with
+@code{@w{#include "@var{file}"}}; they are not searched for
+@code{@w{#include <@var{file}>}}. If additional directories are
+specified with @option{-I} options after the @option{-I-}, those
+directories are searched for all @samp{#include} directives.
+
+In addition, @option{-I-} inhibits the use of the directory of the current
+file directory as the first search directory for @code{@w{#include
+"@var{file}"}}. @xref{Search Path}.
+
+@item -nostdinc
+Do not search the standard system directories for header files.
+Only the directories you have specified with @option{-I} options
+(and the directory of the current file, if appropriate) are searched.
+
+@item -nostdinc++
+Do not search for header files in the C++-specific standard directories,
+but do still search the other standard directories. (This option is
+used when building the C++ library.)
+
+@item -include @var{file}
+
+Process @var{file} as if @code{#include "file"} appeared as the first
+line of the primary source file. However, the first directory searched
+for @var{file} is the preprocessor's working directory @emph{instead of}
+the directory containing the main source file. If not found there, it
+is searched for in the remainder of the @code{#include "@dots{}"} search
+chain as normal.
+
+If multiple @option{-include} options are given, the files are included
+in the order they appear on the command line.
+
+@item -imacros @var{file}
+
+Exactly like @option{-include}, except that any output produced by
+scanning @var{file} is thrown away. Macros it defines remain defined.
+This allows you to acquire all the macros from a header without also
+processing its declarations.
+
+All files specified by @option{-imacros} are processed before all files
+specified by @option{-include}.
+
+@item -idirafter @var{dir}
+Search @var{dir} for header files, but do it @emph{after} all
+directories specified with @option{-I} and the standard system directories
+have been exhausted. @var{dir} is treated as a system include directory.
+
+@item -iprefix @var{prefix}
+Specify @var{prefix} as the prefix for subsequent @option{-iwithprefix}
+options. If the prefix represents a directory, you should include the
+final @samp{/}.
+
+@item -iwithprefix @var{dir}
+@itemx -iwithprefixbefore @var{dir}
+
+Append @var{dir} to the prefix specified previously with
+@option{-iprefix}, and add the resulting directory to the include search
+path. @option{-iwithprefixbefore} puts it in the same place @option{-I}
+would; @option{-iwithprefix} puts it where @option{-idirafter} would.
+
+Use of these options is discouraged.
+
+@item -isystem @var{dir}
+Search @var{dir} for header files, after all directories specified by
+@option{-I} but before the standard system directories. Mark it
+as a system directory, so that it gets the same special treatment as
+is applied to the standard system directories. @xref{System Headers}.
+
+@item -fpreprocessed
+Indicate to the preprocessor that the input file has already been
+preprocessed. This suppresses things like macro expansion, trigraph
+conversion, escaped newline splicing, and processing of most directives.
+The preprocessor still recognizes and removes comments, so that you can
+pass a file preprocessed with @option{-C} to the compiler without
+problems. In this mode the integrated preprocessor is little more than
+a tokenizer for the front ends.
+
+@option{-fpreprocessed} is implicit if the input file has one of the
+extensions @samp{.i}, @samp{.ii} or @samp{.mi}. These are the
+extensions that GCC uses for preprocessed files created by
+@option{-save-temps}.
+
+@item -ftabstop=@var{width}
+Set the distance between tab stops. This helps the preprocessor report
+correct column numbers in warnings or errors, even if tabs appear on the
+line. If the value is less than 1 or greater than 100, the option is
+ignored. The default is 8.
+
+@item -fno-show-column
+Do not print column numbers in diagnostics. This may be necessary if
+diagnostics are being scanned by a program that does not understand the
+column numbers, such as @command{dejagnu}.
+
+@item -A @var{predicate}=@var{answer}
+Make an assertion with the predicate @var{predicate} and answer
+@var{answer}. This form is preferred to the older form @option{-A
+@var{predicate}(@var{answer})}, which is still supported, because
+it does not use shell special characters. @xref{Assertions}.
+
+@item -A -@var{predicate}=@var{answer}
+Cancel an assertion with the predicate @var{predicate} and answer
+@var{answer}.
+
+@item -A-
+Cancel all predefined assertions and all assertions preceding it on
+the command line. Also, undefine all predefined macros and all
+macros preceding it on the command line. (This is a historical wart and
+may change in the future.)
+
+@item -dCHARS
+@var{CHARS} is a sequence of one or more of the following characters,
+and must not be preceded by a space. Other characters are interpreted
+by the compiler proper, or reserved for future versions of GCC, and so
+are silently ignored. If you specify characters whose behavior
+conflicts, the result is undefined.
+
+@table @samp
+@item M
+Instead of the normal output, generate a list of @samp{#define}
+directives for all the macros defined during the execution of the
+preprocessor, including predefined macros. This gives you a way of
+finding out what is predefined in your version of the preprocessor.
+Assuming you have no file @file{foo.h}, the command
+
+@example
+touch foo.h; cpp -dM foo.h
+@end example
+
+@noindent
+will show all the predefined macros.
+
+@item D
+Like @samp{M} except in two respects: it does @emph{not} include the
+predefined macros, and it outputs @emph{both} the @samp{#define}
+directives and the result of preprocessing. Both kinds of output go to
+the standard output file.
+
+@item N
+Like @samp{D}, but emit only the macro names, not their expansions.
+
+@item I
+Output @samp{#include} directives in addition to the result of
+preprocessing.
+@end table
+
+@item -P
+Inhibit generation of linemarkers in the output from the preprocessor.
+This might be useful when running the preprocessor on something that is
+not C code, and will be sent to a program which might be confused by the
+linemarkers. @xref{Preprocessor Output}.
+
+@item -C
+Do not discard comments. All comments are passed through to the output
+file, except for comments in processed directives, which are deleted
+along with the directive.
+
+You should be prepared for side effects when using @option{-C}; it
+causes the preprocessor to treat comments as tokens in their own right.
+For example, comments appearing at the start of what would be a
+directive line have the effect of turning that line into an ordinary
+source line, since the first token on the line is no longer a @samp{#}.
+
+@item -gcc
+Define the macros @sc{__gnuc__}, @sc{__gnuc_minor__} and
+@sc{__gnuc_patchlevel__}. These are defined automatically when you use
+@command{gcc -E}; you can turn them off in that case with
+@option{-no-gcc}.
+
+@item -traditional
+Try to imitate the behavior of old-fashioned C, as opposed to ISO
+C@. @xref{Traditional Mode}.
+
+@item -trigraphs
+Process trigraph sequences. @xref{Initial processing}.
+
+@item -remap
+Enable special code to work around file systems which only permit very
+short file names, such as MS-DOS@.
+
+@item -$
+Forbid the use of @samp{$} in identifiers. The C standard allows
+implementations to define extra characters that can appear in
+identifiers. By default GNU CPP permits @samp{$}, a common extension.
+
+@item -h
+@itemx --help
+@itemx --target-help
+Print text describing all the command line options instead of
+preprocessing anything.
+
+@item -v
+Verbose mode. Print out GNU CPP's version number at the beginning of
+execution, and report the final form of the include path.
+
+@item -H
+Print the name of each header file used, in addition to other normal
+activities. Each name is indented to show how deep in the
+@samp{#include} stack it is.
+
+@item -version
+@itemx --version
+Print out GNU CPP's version number. With one dash, proceed to
+preprocess as normal. With two dashes, exit immediately.
+@end table
+@c man end
+
+@include fdl.texi
+
+@page
+@node Index of Directives
+@unnumbered Index of Directives
+@printindex fn
+
+@node Concept Index
+@unnumbered Concept Index
+@printindex cp
+
+@bye
diff --git a/gcc/cppinternals.texi b/gcc/doc/cppinternals.texi
index 7cd7d494547..d03e143025d 100644
--- a/gcc/cppinternals.texi
+++ b/gcc/doc/cppinternals.texi
@@ -63,15 +63,16 @@ Permission is granted to copy and distribute translations of this manual
into another language, under the above conditions for modified versions.
@c man end
@end titlepage
+@contents
@page
@node Top, Conventions,, (DIR)
-@chapter Cpplib - the core of the GNU C Preprocessor
+@chapter Cpplib---the core of the GNU C Preprocessor
The GNU C preprocessor in GCC 3.0 has been completely rewritten. It is
now implemented as a library, cpplib, so it can be easily shared between
a stand-alone preprocessor, and a preprocessor integrated with the C,
-C++ and Objective C front ends. It is also available for use by other
+C++ and Objective-C front ends. It is also available for use by other
programs, though this is not recommended as its exposed interface has
not yet reached a point of reasonable stability.
@@ -89,27 +90,30 @@ Identifiers, macro expansion, hash nodes, lexing.
@menu
* Conventions:: Conventions used in the code.
-* Lexer:: The combined C, C++ and Objective C Lexer.
+* Lexer:: The combined C, C++ and Objective-C Lexer.
* Whitespace:: Input and output newlines and whitespace.
* Hash Nodes:: All identifiers are hashed.
* Macro Expansion:: Macro expansion algorithm.
* Files:: File handling.
-* Concept Index:: Index of concepts and terms.
* Index:: Index.
@end menu
@node Conventions, Lexer, Top, Top
@unnumbered Conventions
+@cindex interface
+@cindex header files
-cpplib has two interfaces - one is exposed internally only, and the
+cpplib has two interfaces---one is exposed internally only, and the
other is for both internal and external use.
The convention is that functions and types that are exposed to multiple
files internally are prefixed with @samp{_cpp_}, and are to be found in
-the file @samp{cpphash.h}. Functions and types exposed to external
-clients are in @samp{cpplib.h}, and prefixed with @samp{cpp_}.
+the file @file{cpphash.h}. Functions and types exposed to external
+clients are in @file{cpplib.h}, and prefixed with @samp{cpp_}. For
+historical reasons this is no longer quite true, but we should strive to
+stick to it.
-We are striving to reduce the information exposed in cpplib.h to the
+We are striving to reduce the information exposed in @file{cpplib.h} to the
bare minimum necessary, and then to keep it there. This makes clear
exactly what external clients are entitled to assume, and allows us to
change internals in the future without worrying whether library clients
@@ -118,14 +122,16 @@ behaviour.
@node Lexer, Whitespace, Conventions, Top
@unnumbered The Lexer
+@cindex lexer
+@cindex tokens
-The lexer is contained in the file @samp{cpplex.c}. We want to have a
+The lexer is contained in the file @file{cpplex.c}. We want to have a
lexer that is single-pass, for efficiency reasons. We would also like
the lexer to only step forwards through the input files, and not step
back. This will make future changes to support different character
sets, in particular state or shift-dependent ones, much easier.
-This file also contains all information needed to spell a token, i.e. to
+This file also contains all information needed to spell a token, i.e.@: to
output it either in a diagnostic or to a preprocessed output file. This
information is not exported, but made available to clients through such
functions as @samp{cpp_spell_token} and @samp{cpp_token_len}.
@@ -137,10 +143,10 @@ there is a trigraph representation for a backslash, so it is possible for
the trigraph @samp{??/} to introduce an escaped newline.
Escaped newlines are tedious because theoretically they can occur
-anywhere - between the @samp{+} and @samp{=} of the @samp{+=} token,
+anywhere---between the @samp{+} and @samp{=} of the @samp{+=} token,
within the characters of an identifier, and even between the @samp{*}
and @samp{/} that terminates a comment. Moreover, you cannot be sure
-there is just one - there might be an arbitrarily long sequence of them.
+there is just one---there might be an arbitrarily long sequence of them.
So the routine @samp{parse_identifier}, that lexes an identifier, cannot
assume that it can scan forwards until the first non-identifier
@@ -159,7 +165,7 @@ some sort. These cases use the function @samp{get_effective_char},
which returns the first character after any intervening newlines.
The lexer needs to keep track of the correct column position,
-including counting tabs as specified by the @samp{-ftabstop=} option.
+including counting tabs as specified by the @option{-ftabstop=} option.
This should be done even within comments; C-style comments can appear in
the middle of a line, and we want to report diagnostics in the correct
position for text appearing after the end of the comment.
@@ -179,28 +185,33 @@ problem.
Another place where state flags are used to change behaviour is whilst
parsing header names. Normally, a @samp{<} would be lexed as a single
-token. After a @samp{#include} directive, though, it should be lexed
+token. After a @code{#include} directive, though, it should be lexed
as a single token as far as the nearest @samp{>} character. Note that
we don't allow the terminators of header names to be escaped; the first
@samp{"} or @samp{>} terminates the header name.
Interpretation of some character sequences depends upon whether we are
-lexing C, C++ or Objective C, and on the revision of the standard in
-force. For example, @samp{@@foo} is a single identifier token in
-objective C, but two separate tokens @samp{@@} and @samp{foo} in C or
-C++. Such cases are handled in the main function @samp{_cpp_lex_token},
-based upon the flags set in the @samp{cpp_options} structure.
+lexing C, C++ or Objective-C, and on the revision of the standard in
+force. For example, @samp{::} is a single token in C++, but two
+separate @samp{:} tokens, and almost certainly a syntax error, in C@.
+Such cases are handled in the main function @samp{_cpp_lex_token}, based
+upon the flags set in the @samp{cpp_options} structure.
Note we have almost, but not quite, achieved the goal of not stepping
backwards in the input stream. Currently @samp{skip_escaped_newlines}
does step back, though with care it should be possible to adjust it so
that this does not happen. For example, one tricky issue is if we meet
-a trigraph, but the command line option @samp{-trigraphs} is not in
-force but @samp{-Wtrigraphs} is, we need to warn about it but then
+a trigraph, but the command line option @option{-trigraphs} is not in
+force but @option{-Wtrigraphs} is, we need to warn about it but then
buffer it and continue to treat it as 3 separate characters.
@node Whitespace, Hash Nodes, Lexer, Top
@unnumbered Whitespace
+@cindex whitespace
+@cindex newlines
+@cindex escaped newlines
+@cindex paste avoidance
+@cindex line numbers
The lexer has been written to treat each of @samp{\r}, @samp{\n},
@samp{\r\n} and @samp{\n\r} as a single new line indicator. This allows
@@ -221,14 +232,76 @@ characters, and @samp{skip_escaped_newlines} takes care of arbitrarily
long sequences of escaped newlines, deferring to @samp{handle_newline}
to handle the newlines themselves.
+Another whitespace issue only concerns the stand-alone preprocessor: we
+want to guarantee that re-reading the preprocessed output results in an
+identical token stream. Without taking special measures, this might not
+be the case because of macro substitution. We could simply insert a
+space between adjacent tokens, but ideally we would like to keep this to
+a minimum, both for aesthetic reasons and because it causes problems for
+people who still try to abuse the preprocessor for things like Fortran
+source and Makefiles.
+
+The token structure contains a flags byte, and two flags are of interest
+here: @samp{PREV_WHITE} and @samp{AVOID_LPASTE}. @samp{PREV_WHITE}
+indicates that the token was preceded by whitespace; if this is the case
+we need not worry about it incorrectly pasting with its predecessor.
+The @samp{AVOID_LPASTE} flag is set by the macro expansion routines, and
+indicates that paste avoidance by insertion of a space to the left of
+the token may be necessary. Recursively, the first token of a macro
+substitution, the first token after a macro substitution, the first
+token of a substituted argument, and the first token after a substituted
+argument are all flagged @samp{AVOID_LPASTE} by the macro expander.
+
+If a token flagged in this way does not have a @samp{PREV_WHITE} flag,
+and the routine @code{cpp_avoid_paste} determines that it might be
+misinterpreted by the lexer if a space is not inserted between it and
+the immediately preceding token, then stand-alone CPP's output routines
+will insert a space between them. To avoid excessive spacing,
+@code{cpp_avoid_paste} tries hard to only request a space if one is
+likely to be necessary, but for reasons of efficiency it is slightly
+conservative and might recommend a space where one is not strictly
+needed.
+
+Finally, the preprocessor takes great care to ensure it keeps track of
+both the position of a token in the source file, for diagnostic
+purposes, and where it should appear in the output file, because using
+CPP for other languages like assembler requires this. The two positions
+may differ for the following reasons:
+
+@itemize @bullet
+@item
+Escaped newlines are deleted, so lines spliced in this way are joined to
+form a single logical line.
+
+@item
+A macro expansion replaces the tokens that form its invocation, but any
+newlines appearing in the macro's arguments are interpreted as a single
+space, with the result that the macro's replacement appears in full on
+the same line that the macro name appeared in the source file. This is
+particularly important for stringification of arguments---newlines
+embedded in the arguments must appear in the string as spaces.
+@end itemize
+
+The source file location is maintained in the @code{lineno} member of the
+@code{cpp_buffer} structure, and the column number inferred from the
+current position in the buffer relative to the @code{line_base} buffer
+variable, which is updated with every newline whether escaped or not.
+
+TODO: Finish this.
+
@node Hash Nodes, Macro Expansion, Whitespace, Top
@unnumbered Hash Nodes
-
-When cpplib encounters an "identifier", it generates a hash code for it
-and stores it in the hash table. By "identifier" we mean tokens with
+@cindex hash table
+@cindex identifiers
+@cindex macros
+@cindex assertions
+@cindex named operators
+
+When cpplib encounters an ``identifier'', it generates a hash code for it
+and stores it in the hash table. By ``identifier'' we mean tokens with
type @samp{CPP_NAME}; this includes identifiers in the usual C sense, as
well as keywords, directive names, macro names and so on. For example,
-all of "pragma", "int", "foo" and "__GNUC__" are identifiers and hashed
+all of @samp{pragma}, @samp{int}, @samp{foo} and @samp{__GNUC__} are identifiers and hashed
when lexed.
Each node in the hash table contain various information about the
@@ -239,7 +312,7 @@ time, each identifier falls into exactly one of three categories:
@item Macros
These have been declared to be macros, either on the command line or
-with @samp{#define}. A few, such as @samp{__TIME__} are builtins
+with @code{#define}. A few, such as @samp{__TIME__} are builtins
entered in the hash table during initialisation. The hash node for a
normal macro points to a structure with more information about the
macro, such as whether it is function-like, how many arguments it takes,
@@ -249,29 +322,29 @@ contain an enum indicating which of the various builtin macros it is.
@item Assertions
Assertions are in a separate namespace to macros. To enforce this, cpp
-actually prepends a @samp{#} character before hashing and entering it in
+actually prepends a @code{#} character before hashing and entering it in
the hash table. An assertion's node points to a chain of answers to
that assertion.
@item Void
-Everything else falls into this category - an identifier that is not
+Everything else falls into this category---an identifier that is not
currently a macro, or a macro that has since been undefined with
-@samp{#undef}.
+@code{#undef}.
When preprocessing C++, this category also includes the named operators,
such as @samp{xor}. In expressions these behave like the operators they
represent, but in contexts where the spelling of a token matters they
are spelt differently. This spelling distinction is relevant when they
-are operands of the stringizing and pasting macro operators @samp{#} and
-@samp{##}. Named operator hash nodes are flagged, both to catch the
+are operands of the stringizing and pasting macro operators @code{#} and
+@code{##}. Named operator hash nodes are flagged, both to catch the
spelling distinction and to prevent them from being defined as macros.
@end itemize
The same identifiers share the same hash node. Since each identifier
token, after lexing, contains a pointer to its hash node, this is used
to provide rapid lookup of various information. For example, when
-parsing a @samp{#define} statement, CPP flags each argument's identifier
+parsing a @code{#define} statement, CPP flags each argument's identifier
hash node with the index of that argument. This makes duplicated
argument checking an O(1) operation for each argument. Similarly, for
each identifier in the macro's expansion, lookup to see if it is an
@@ -279,24 +352,79 @@ argument, and which argument it is, is also an O(1) operation. Further,
each directive name, such as @samp{endif}, has an associated directive
enum stored in its hash node, so that directive lookup is also O(1).
-Later, CPP may also store C front-end information in its identifier hash
-table, such as a @samp{tree} pointer.
-
@node Macro Expansion, Files, Hash Nodes, Top
@unnumbered Macro Expansion Algorithm
-@printindex cp
-@node Files, Concept Index, Macro Expansion, Top
+@node Files, Index, Macro Expansion, Top
@unnumbered File Handling
+@cindex files
+
+Fairly obviously, the file handling code of cpplib resides in the file
+@file{cppfiles.c}. It takes care of the details of file searching,
+opening, reading and caching, for both the main source file and all the
+headers it recursively includes.
+
+The basic strategy is to minimize the number of system calls. On many
+systems, the basic @code{open ()} and @code{fstat ()} system calls can
+be quite expensive. For every @code{#include}-d file, we need to try
+all the directories in the search path until we find a match. Some
+projects, such as glibc, pass twenty or thirty include paths on the
+command line, so this can rapidly become time consuming.
+
+For a header file we have not encountered before we have little choice
+but to do this. However, it is often the case that the same headers are
+repeatedly included, and in these cases we try to avoid repeating the
+filesystem queries whilst searching for the correct file.
+
+For each file we try to open, we store the constructed path in a splay
+tree. This path first undergoes simplification by the function
+@code{_cpp_simplify_pathname}. For example,
+@samp{/usr/include/bits/../foo.h} is simplified to
+@samp{/usr/include/foo.h} before we enter it in the splay tree and try
+to @code{open ()} the file. CPP will then find subsequent uses of
+@samp{foo.h}, even as @samp{/usr/include/foo.h}, in the splay tree and
+save system calls.
+
+Further, it is likely the file contents have also been cached, saving a
+@code{read ()} system call. We don't bother caching the contents of
+header files that are re-inclusion protected, and whose re-inclusion
+macro is defined when we leave the header file for the first time. If
+the host supports it, we try to map suitably large files into memory,
+rather than reading them in directly.
+
+The include paths are internally stored on a null-terminated
+singly-linked list, starting with the @code{"header.h"} directory search
+chain, which then links into the @code{<header.h>} directory chain.
+
+Files included with the @code{<foo.h>} syntax start the lookup directly
+in the second half of this chain. However, files included with the
+@code{"foo.h"} syntax start at the beginning of the chain, but with one
+extra directory prepended. This is the directory of the current file;
+the one containing the @code{#include} directive. Prepending this
+directory on a per-file basis is handled by the function
+@code{search_from}.
+
+Note that a header included with a directory component, such as
+@code{#include "mydir/foo.h"} and opened as
+@samp{/usr/local/include/mydir/foo.h}, will have the complete path minus
+the basename @samp{foo.h} as the current directory.
+
+Enough information is stored in the splay tree that CPP can immediately
+tell whether it can skip the header file because of the multiple include
+optimisation, whether the file didn't exist or couldn't be opened for
+some reason, or whether the header was flagged not to be re-used, as it
+is with the obsolete @code{#import} directive.
+
+For the benefit of MS-DOS filesystems with an 8.3 filename limitation,
+CPP offers the ability to treat various include file names as aliases
+for the real header files with shorter names. The map from one to the
+other is found in a special file called @samp{header.gcc}, stored in the
+command line (or system) include directories to which the mapping
+applies. This may be higher up the directory tree than the full path to
+the file minus the base name.
+
+@node Index,, Files, Top
+@unnumbered Index
@printindex cp
-@node Concept Index, Index, Files, Top
-@unnumbered Concept Index
-@printindex cp
-
-@node Index,, Concept Index, Top
-@unnumbered Index of Directives, Macros and Options
-@printindex fn
-
-@contents
@bye
diff --git a/gcc/extend.texi b/gcc/doc/extend.texi
index c1d523378ee..5827ce3c05a 100644
--- a/gcc/extend.texi
+++ b/gcc/doc/extend.texi
@@ -1,4 +1,4 @@
-@c Copyright (C) 1988,89,92,93,94,96,98,99,2000,01 Free Software Foundation, Inc.
+@c Copyright (C) 1988,1989,1992,1993,1994,1996,1998,1999,2000,2001 Free Software Foundation, Inc.
@c This is part of the GCC manual.
@c For copying conditions, see the file gcc.texi.
@@ -7,22 +7,19 @@
@cindex extensions, C language
@cindex C language extensions
-GNU C provides several language features not found in ISO standard C.
-(The @samp{-pedantic} option directs GNU CC to print a warning message if
+@opindex pedantic
+GNU C provides several language features not found in ISO standard C@.
+(The @option{-pedantic} option directs GCC to print a warning message if
any of these features is used.) To test for the availability of these
features in conditional compilation, check for a predefined macro
-@code{__GNUC__}, which is always defined under GNU CC.
+@code{__GNUC__}, which is always defined under GCC@.
-These extensions are available in C and Objective C. Most of them are
+These extensions are available in C and Objective C@. Most of them are
also available in C++. @xref{C++ Extensions,,Extensions to the
C++ Language}, for extensions that apply @emph{only} to C++.
-@c FIXME: document clearly which features are in ISO C99, but also
-@c accepted as extensions for -std=gnu89 and possibly for C++.
-@c See PR other/930.
-
-@c FIXME: the documentation for preprocessor extensions here is out of
-@c date. See PR other/928.
+Some features that are in ISO C99 but not C89 or C++ are also, as
+extensions, accepted by GCC in C89 mode and in C++.
@c The only difference between the two versions of this menu is that the
@c version for clear INTERNALS has an extra node, "Constraints" (which
@@ -49,11 +46,12 @@ C++ Language}, for extensions that apply @emph{only} to C++.
* Subscripting:: Any array can be subscripted, even if not an lvalue.
* Pointer Arith:: Arithmetic on @code{void}-pointers and function pointers.
* Initializers:: Non-constant initializers.
-* Constructors:: Constructor expressions give structures, unions
+* Compound Literals:: Compound literals give structures, unions
or arrays as values.
-* Labeled Elements:: Labeling elements of initializers.
+* Designated Inits:: Labeling elements of initializers.
* Cast to Union:: Casting to union type from any member of the union.
* Case Ranges:: `case 1 ... 9' and such.
+* Mixed Declarations:: Mixing declarations and code.
* Function Attributes:: Declaring that functions have no side effects,
or that they can never return.
* Attribute Syntax:: Formal syntax for attributes.
@@ -99,11 +97,12 @@ C++ Language}, for extensions that apply @emph{only} to C++.
* Subscripting:: Any array can be subscripted, even if not an lvalue.
* Pointer Arith:: Arithmetic on @code{void}-pointers and function pointers.
* Initializers:: Non-constant initializers.
-* Constructors:: Constructor expressions give structures, unions
+* Compound Literals:: Compound literals give structures, unions
or arrays as values.
-* Labeled Elements:: Labeling elements of initializers.
+* Designated Inits:: Labeling elements of initializers.
* Cast to Union:: Casting to union type from any member of the union.
* Case Ranges:: `case 1 ... 9' and such.
+* Mixed Declarations:: Mixing declarations and code.
* Function Attributes:: Declaring that functions have no side effects,
or that they can never return.
* Attribute Syntax:: Formal syntax for attributes.
@@ -140,7 +139,7 @@ C++ Language}, for extensions that apply @emph{only} to C++.
@c changed it from "within" to "in". --mew 4feb93
A compound statement enclosed in parentheses may appear as an expression
-in GNU C. This allows you to use loops, switches, and local variables
+in GNU C@. This allows you to use loops, switches, and local variables
within an expression.
Recall that a compound statement is a sequence of statements surrounded
@@ -186,7 +185,7 @@ the macro safely as follows:
@end example
Embedded statements are not allowed in constant expressions, such as
-the value of an enumeration constant, the width of a bit field, or
+the value of an enumeration constant, the width of a bit-field, or
the initial value of a static variable.
If you don't know the type of the operand, you can still do this, but you
@@ -197,7 +196,7 @@ Statement expressions are not supported fully in G++, and their fate
there is unclear. (It is possible that they will become fully supported
at some point, or that they will be deprecated, or that the bugs that
are present will continue to exist indefinitely.) Presently, statement
-expressions do not work well as default arguments.
+expressions do not work well as default arguments.
In addition, there are semantic issues with statement-expressions in
C++. If you try to use statement-expressions instead of inline
@@ -267,7 +266,7 @@ example:
@example
#define SEARCH(array, target) \
-(@{ \
+(@{ \
__label__ found; \
typeof (target) _SEARCH_target = (target); \
typeof (*(array)) *_SEARCH_array = (array); \
@@ -276,7 +275,7 @@ example:
for (i = 0; i < max; i++) \
for (j = 0; j < max; j++) \
if (_SEARCH_array[i][j] == _SEARCH_target) \
- @{ value = i; goto found; @} \
+ @{ value = i; goto found; @} \
value = -1; \
found: \
value; \
@@ -340,7 +339,7 @@ Another use of label values is in an interpreter for threaded code.
The labels within the interpreter function can be stored in the
threaded code for super-fast dispatching.
-You may not use this mechanism to jump to code in a different function.
+You may not use this mechanism to jump to code in a different function.
If you do that, totally unpredictable things will happen. The best way to
avoid this is to store the label address only in automatic variables and
never pass it as an argument.
@@ -348,7 +347,8 @@ never pass it as an argument.
An alternate way to write the above example is
@example
-static const int array[] = @{ &&foo - &&foo, &&bar - &&foo, &&hack - &&foo @};
+static const int array[] = @{ &&foo - &&foo, &&bar - &&foo,
+ &&hack - &&foo @};
goto *(&&foo + array[i]);
@end example
@@ -385,6 +385,7 @@ called @dfn{lexical scoping}. For example, here we show a nested
function which uses an inherited variable named @code{offset}:
@example
+@group
bar (int *array, int offset, int size)
@{
int access (int *array, int index)
@@ -394,6 +395,7 @@ bar (int *array, int offset, int size)
for (i = 0; i < size; i++)
@dots{} access (array, i) @dots{}
@}
+@end group
@end example
Nested function definitions are permitted within functions in the places
@@ -427,7 +429,7 @@ but it's not wise to take the risk. If, however, the nested function
does not refer to anything that has gone out of scope, you should be
safe.
-GNU CC implements taking the address of a nested function using a
+GCC implements taking the address of a nested function using a
technique called @dfn{trampolines}. A paper describing them is
available as @uref{http://people.debian.org/~karlheg/Usenix88-lexic.pdf}.
@@ -499,10 +501,8 @@ and later return that value, without knowing what data type
the function tried to return (as long as your caller expects
that data type).
-@table @code
-@findex __builtin_apply_args
-@item __builtin_apply_args ()
-This built-in function returns a pointer of type @code{void *} to data
+@deftypefn {Built-in Function} {void *} __builtin_apply_args ()
+This built-in function returns a pointer to data
describing how to perform a call with the same arguments as were passed
to the current function.
@@ -510,18 +510,18 @@ The function saves the arg pointer register, structure value address,
and all registers that might be used to pass arguments to a function
into a block of memory allocated on the stack. Then it returns the
address of that block.
+@end deftypefn
-@findex __builtin_apply
-@item __builtin_apply (@var{function}, @var{arguments}, @var{size})
-This built-in function invokes @var{function} (type @code{void (*)()})
-with a copy of the parameters described by @var{arguments} (type
-@code{void *}) and @var{size} (type @code{int}).
+@deftypefn {Built-in Function} {void *} __builtin_apply (void (*@var{function})(), void *@var{arguments}, size_t @var{size})
+This built-in function invokes @var{function}
+with a copy of the parameters described by @var{arguments}
+and @var{size}.
The value of @var{arguments} should be the value returned by
@code{__builtin_apply_args}. The argument @var{size} specifies the size
of the stack argument data, in bytes.
-This function returns a pointer of type @code{void *} to data describing
+This function returns a pointer to data describing
how to return whatever value was returned by @var{function}. The data
is saved in a block of memory allocated on the stack.
@@ -529,13 +529,13 @@ It is not always simple to compute the proper value for @var{size}. The
value is used by @code{__builtin_apply} to compute the amount of data
that should be pushed on the stack and copied from the incoming argument
area.
+@end deftypefn
-@findex __builtin_return
-@item __builtin_return (@var{result})
+@deftypefn {Built-in Function} {void} __builtin_return (void *@var{result})
This built-in function returns the value described by @var{result} from
the containing function. You should specify, for @var{result}, a value
returned by @code{__builtin_apply}.
-@end table
+@end deftypefn
@node Naming Types
@section Naming an Expression's Type
@@ -788,13 +788,16 @@ effects of recomputing it.
@cindex @code{long long} data types
@cindex double-word arithmetic
@cindex multiprecision arithmetic
+@cindex @code{LL} integer suffix
+@cindex @code{ULL} integer suffix
-GNU C supports data types for integers that are twice as long as
-@code{int}. Simply write @code{long long int} for a signed integer, or
+ISO C99 supports data types for integers that are at least 64 bits wide,
+and as an extension GCC supports them in C89 mode and in C++.
+Simply write @code{long long int} for a signed integer, or
@code{unsigned long long int} for an unsigned integer. To make an
-integer constant of type @code{long long int}, add the suffix @code{LL}
+integer constant of type @code{long long int}, add the suffix @samp{LL}
to the integer. To make an integer constant of type @code{unsigned long
-long int}, add the suffix @code{ULL} to the integer.
+long int}, add the suffix @samp{ULL} to the integer.
You can use these types in arithmetic like any other integer types.
Addition, subtraction, and bitwise boolean operations on these types
@@ -802,7 +805,7 @@ are open-coded on all types of machines. Multiplication is open-coded
if the machine supports fullword-to-doubleword a widening multiply
instruction. Division and shifts are open-coded only on machines that
provide special support. The operations that are not open-coded use
-special library routines that come with GNU CC.
+special library routines that come with GCC@.
There may be pitfalls when you use @code{long long} types for function
arguments, unless you declare function prototypes. If a function
@@ -815,36 +818,54 @@ Likewise, if the function expects @code{long long int} and you pass
@node Complex
@section Complex Numbers
@cindex complex numbers
+@cindex @code{_Complex} keyword
+@cindex @code{__complex__} keyword
-GNU C supports complex data types. You can declare both complex integer
-types and complex floating types, using the keyword @code{__complex__}.
+ISO C99 supports complex floating data types, and as an extension GCC
+supports them in C89 mode and in C++, and supports complex integer data
+types which are not part of ISO C99. You can declare complex types
+using the keyword @code{_Complex}. As an extension, the older GNU
+keyword @code{__complex__} is also supported.
-For example, @samp{__complex__ double x;} declares @code{x} as a
+For example, @samp{_Complex double x;} declares @code{x} as a
variable whose real part and imaginary part are both of type
-@code{double}. @samp{__complex__ short int y;} declares @code{y} to
+@code{double}. @samp{_Complex short int y;} declares @code{y} to
have real and imaginary parts of type @code{short int}; this is not
likely to be useful, but it shows that the set of complex types is
complete.
To write a constant with a complex data type, use the suffix @samp{i} or
@samp{j} (either one; they are equivalent). For example, @code{2.5fi}
-has type @code{__complex__ float} and @code{3i} has type
-@code{__complex__ int}. Such a constant always has a pure imaginary
+has type @code{_Complex float} and @code{3i} has type
+@code{_Complex int}. Such a constant always has a pure imaginary
value, but you can form any complex value you like by adding one to a
-real constant.
+real constant. This is a GNU extension; if you have an ISO C99
+conforming C library (such as GNU libc), and want to construct complex
+constants of floating type, you should include @code{<complex.h>} and
+use the macros @code{I} or @code{_Complex_I} instead.
+@cindex @code{__real__} keyword
+@cindex @code{__imag__} keyword
To extract the real part of a complex-valued expression @var{exp}, write
@code{__real__ @var{exp}}. Likewise, use @code{__imag__} to
-extract the imaginary part.
+extract the imaginary part. This is a GNU extension; for values of
+floating type, you should use the ISO C99 functions @code{crealf},
+@code{creal}, @code{creall}, @code{cimagf}, @code{cimag} and
+@code{cimagl}, declared in @code{<complex.h>} and also provided as
+built-in functions by GCC@.
+@cindex complex conjugation
The operator @samp{~} performs complex conjugation when used on a value
-with a complex type.
+with a complex type. This is a GNU extension; for values of
+floating type, you should use the ISO C99 functions @code{conjf},
+@code{conj} and @code{conjl}, declared in @code{<complex.h>} and also
+provided as built-in functions by GCC@.
-GNU CC can allocate complex automatic variables in a noncontiguous
+GCC can allocate complex automatic variables in a noncontiguous
fashion; it's even possible for the real part to be in a register while
the imaginary part is on the stack (or vice-versa). None of the
supported debugging info formats has a way to represent noncontiguous
-allocation like this, so GNU CC describes a noncontiguous complex
+allocation like this, so GCC describes a noncontiguous complex
variable as if it were two separate variables of noncomplex type.
If the variable's actual name is @code{foo}, the two fictitious
variables are named @code{foo$real} and @code{foo$imag}. You can
@@ -857,19 +878,27 @@ them as a single variable with a complex type.
@section Hex Floats
@cindex hex floats
-GNU CC recognizes floating-point numbers written not only in the usual
+ISO C99 supports floating-point numbers written not only in the usual
decimal notation, such as @code{1.55e1}, but also numbers such as
-@code{0x1.fp3} written in hexadecimal format. In that format the
-@code{0x} hex introducer and the @code{p} or @code{P} exponent field are
+@code{0x1.fp3} written in hexadecimal format. As a GNU extension, GCC
+supports this in C89 mode (except in some cases when strictly
+conforming) and in C++. In that format the
+@samp{0x} hex introducer and the @samp{p} or @samp{P} exponent field are
mandatory. The exponent is a decimal number that indicates the power of
-2 by which the significant part will be multiplied. Thus @code{0x1.f} is
-1 15/16, @code{p3} multiplies it by 8, and the value of @code{0x1.fp3}
+2 by which the significant part will be multiplied. Thus @samp{0x1.f} is
+@tex
+$1 {15\over16}$,
+@end tex
+@ifnottex
+1 15/16,
+@end ifnottex
+@samp{p3} multiplies it by 8, and the value of @code{0x1.fp3}
is the same as @code{1.55e1}.
Unlike for floating-point numbers in the decimal notation the exponent
is always required in the hexadecimal notation. Otherwise the compiler
would not be able to resolve the ambiguity of, e.g., @code{0x1.f}. This
-could mean @code{1.0f} or @code{1.9375} since @code{f} is also the
+could mean @code{1.0f} or @code{1.9375} since @samp{f} is also the
extension for floating-point constants of type @code{float}.
@node Zero Length
@@ -879,7 +908,7 @@ extension for floating-point constants of type @code{float}.
@cindex length-zero arrays
@cindex flexible array members
-Zero-length arrays are allowed in GNU C. They are very useful as the
+Zero-length arrays are allowed in GNU C@. They are very useful as the
last element of a structure which is really a header for a variable-length
object:
@@ -897,7 +926,7 @@ thisline->length = this_length;
In ISO C89, you would have to give @code{contents} a length of 1, which
means either you waste space or complicate the argument to @code{malloc}.
-In ISO C99, you would use a @dfn{flexible array member}, which is
+In ISO C99, you would use a @dfn{flexible array member}, which is
slightly different in syntax and semantics:
@itemize @bullet
@@ -912,7 +941,7 @@ of zero-length arrays, @code{sizeof} evaluates to zero.
@item
Flexible array members may only appear as the last member of a
-@code{struct} that is otherwise non-empty. GCC currently allows
+@code{struct} that is otherwise non-empty. GCC currently allows
zero-length arrays anywhere. You may encounter problems, however,
defining structures containing only a zero-length array. Such usage
is deprecated, and we recommend using zero-length arrays only in
@@ -927,7 +956,7 @@ Non-empty initialization of zero-length arrays is now deprecated.
Instead GCC allows static initialization of flexible array members.
This is equivalent to defining a new structure containing the original
structure followed by an array of sufficient size to contain the data.
-I.e. in the following, @code{f1} is constructed as if it were declared
+I.e.@: in the following, @code{f1} is constructed as if it were declared
like @code{f2}.
@example
@@ -958,18 +987,22 @@ object. For example:
struct foo @{ int x; int y[]; @};
struct bar @{ struct foo z; @};
-struct foo a = @{ 1, @{ 2, 3, 4 @} @}; // Legal.
-struct bar b = @{ @{ 1, @{ 2, 3, 4 @} @} @}; // Illegal.
-struct bar c = @{ @{ 1, @{ @} @} @}; // Legal.
-struct foo d[1] = @{ @{ 1 @{ 2, 3, 4 @} @} @}; // Illegal.
+struct foo a = @{ 1, @{ 2, 3, 4 @} @}; // @r{Valid.}
+struct bar b = @{ @{ 1, @{ 2, 3, 4 @} @} @}; // @r{Invalid.}
+struct bar c = @{ @{ 1, @{ @} @} @}; // @r{Valid.}
+struct foo d[1] = @{ @{ 1 @{ 2, 3, 4 @} @} @}; // @r{Invalid.}
@end example
@node Variable Length
@section Arrays of Variable Length
@cindex variable-length arrays
@cindex arrays of variable length
+@cindex VLAs
-Variable-length automatic arrays are allowed in GNU C. These arrays are
+Variable-length automatic arrays are allowed in ISO C99, and as an
+extension GCC accepts them in C89 mode and in C++. (However, GCC's
+implementation of variable-length arrays does not yet conform in detail
+to the ISO C99 standard.) These arrays are
declared like any other automatic arrays, but with a length that is not
a constant expression. The storage is allocated at the point of
declaration and deallocated when the brace-level is exited. For
@@ -1040,7 +1073,8 @@ You can write any number of such parameter forward declarations in the
parameter list. They can be separated by commas or semicolons, but the
last one must end with a semicolon, which is followed by the ``real''
parameter declarations. Each forward declaration must match a ``real''
-declaration in parameter name and data type.
+declaration in parameter name and data type. ISO C99 does not support
+parameter forward declarations.
@node Variadic Macros
@section Macros with a Variable Number of Arguments.
@@ -1142,8 +1176,10 @@ removed.
@cindex subscripting and function values
Subscripting is allowed on arrays that are not lvalues, even though the
-unary @samp{&} operator is not. For example, this is valid in GNU C though
-not valid in other C dialects:
+unary @samp{&} operator is not. (In ISO C99, both are allowed (though
+the array may not be used after the next sequence point), but this ISO
+C99 feature is not yet fully supported in GCC@.) For example,
+this is valid in GNU C though not valid in C89:
@example
@group
@@ -1172,7 +1208,8 @@ size of a @code{void} or of a function as 1.
A consequence of this is that @code{sizeof} is also allowed on @code{void}
and on function types, and returns 1.
-The option @samp{-Wpointer-arith} requests a warning if these extensions
+@opindex Wpointer-arith
+The option @option{-Wpointer-arith} requests a warning if these extensions
are used.
@node Initializers
@@ -1180,8 +1217,8 @@ are used.
@cindex initializers, non-constant
@cindex non-constant initializers
-As in standard C++, the elements of an aggregate initializer for an
-automatic variable are not required to be constant expressions in GNU C.
+As in standard C++ and ISO C99, the elements of an aggregate initializer for an
+automatic variable are not required to be constant expressions in GNU C@.
Here is an example of an initializer with run-time varying elements:
@example
@@ -1192,17 +1229,21 @@ foo (float f, float g)
@}
@end example
-@node Constructors
-@section Constructor Expressions
+@node Compound Literals
+@section Compound Literals
@cindex constructor expressions
@cindex initializations in expressions
@cindex structures, constructor expression
@cindex expressions, constructor
+@cindex compound literals
+@c The GNU C name for what C99 calls compound literals was "constructor expressions".
-GNU C supports constructor expressions. A constructor looks like
+ISO C99 supports compound literals. A compound literal looks like
a cast containing an initializer. Its value is an object of the
type specified in the cast, containing the elements specified in
-the initializer.
+the initializer. (GCC does not yet implement the full ISO C99 semantics
+for compound literals.) As an extension, GCC supports compound literals
+in C89 mode and in C++.
Usually, the specified type is a structure. Assume that
@code{struct foo} and @code{structure} are declared as shown:
@@ -1212,7 +1253,7 @@ struct foo @{int a; char b[2];@} structure;
@end example
@noindent
-Here is an example of constructing a @code{struct foo} with a constructor:
+Here is an example of constructing a @code{struct foo} with a compound literal:
@example
structure = ((struct foo) @{x + y, 'a', 0@});
@@ -1228,36 +1269,40 @@ This is equivalent to writing the following:
@}
@end example
-You can also construct an array. If all the elements of the constructor
+You can also construct an array. If all the elements of the compound literal
are (made up of) simple constant expressions, suitable for use in
-initializers, then the constructor is an lvalue and can be coerced to a
+initializers, then the compound literal is an lvalue and can be coerced to a
pointer to its first element, as shown here:
@example
char **foo = (char *[]) @{ "x", "y", "z" @};
@end example
-Array constructors whose elements are not simple constants are
-not very useful, because the constructor is not an lvalue. There
-are only two valid ways to use it: to subscript it, or initialize
+Array compound literals whose elements are not simple constants are
+not very useful, because the compound literal is not an lvalue; ISO C99
+specifies that it is, being a temporary object with automatic storage
+duration associated with the enclosing block, but GCC does not yet
+implement this. There are currently only two valid ways to use it with
+GCC: to subscript it, or initialize
an array variable with it. The former is probably slower than a
@code{switch} statement, while the latter does the same thing an
ordinary C initializer would do. Here is an example of
-subscripting an array constructor:
+subscripting an array compound literal:
@example
output = ((int[]) @{ 2, x, 28 @}) [input];
@end example
-Constructor expressions for scalar types and union types are is
-also allowed, but then the constructor expression is equivalent
+Compound literals for scalar types and union types are is
+also allowed, but then the compound literal is equivalent
to a cast.
-@node Labeled Elements
-@section Labeled Elements in Initializers
+@node Designated Inits
+@section Designated Initializers
@cindex initializers with labeled elements
@cindex labeled elements in initializers
@cindex case labels in initializers
+@cindex designated initializers
Standard C89 requires the elements of an initializer to appear in a fixed
order, the same as the order of the elements in the array or structure
@@ -1335,9 +1380,11 @@ Another syntax which has the same meaning, obsolete since GCC 2.5, is
struct point p = @{ y: yvalue, x: xvalue @};
@end example
-You can also use an element label (with either the colon syntax or the
-period-equal syntax) when initializing a union, to specify which element
-of the union should be used. For example,
+@cindex designators
+The @samp{[@var{index}]} or @samp{.@var{fieldname}} is known as a
+@dfn{designator}. You can also use a designator (or the obsolete colon
+syntax) when initializing a union, to specify which element of the union
+should be used. For example,
@example
union foo @{ int i; double d; @};
@@ -1353,7 +1400,7 @@ an integer. (@xref{Cast to Union}.)
You can combine this technique of naming elements with ordinary C
initialization of successive elements. Each initializer element that
-does not have a label applies to the next consecutive element of the
+does not have a designator applies to the next consecutive element of the
array or structure. For example,
@example
@@ -1377,8 +1424,9 @@ int whitespace[256]
['\f'] = 1, ['\n'] = 1, ['\r'] = 1 @};
@end example
+@cindex designator lists
You can also write a series of @samp{.@var{fieldname}} and
-@samp{[@var{index}]} element labels before an @samp{=} to specify a
+@samp{[@var{index}]} designators before an @samp{=} to specify a
nested subobject to initialize; the list is taken relative to the
subobject corresponding to the closest surrounding brace pair. For
example, with the @samp{struct point} declaration above:
@@ -1439,7 +1487,7 @@ A cast to union type is similar to other casts, except that the type
specified is a union type. You can specify the type either with
@code{union @var{tag}} or with a typedef name. A cast to union is actually
a constructor though, not a cast, and hence does not yield an lvalue like
-normal casts. (@xref{Constructors}.)
+normal casts. (@xref{Compound Literals}.)
The types that may be cast to the union type are those of the members
of the union. Thus, given the following union and variables:
@@ -1451,7 +1499,7 @@ double y;
@end example
@noindent
-both @code{x} and @code{y} can be cast to type @code{union} foo.
+both @code{x} and @code{y} can be cast to type @code{union foo}.
Using the cast as the right-hand side of an assignment to a variable of
union type is equivalent to storing in a member of the union:
@@ -1471,6 +1519,26 @@ void hack (union foo);
hack ((union foo) x);
@end example
+@node Mixed Declarations
+@section Mixed Declarations and Code
+@cindex mixed declarations and code
+@cindex declarations, mixed with code
+@cindex code, mixed with declarations
+
+ISO C99 and ISO C++ allow declarations and code to be freely mixed
+within compound statements. As an extension, GCC also allows this in
+C89 mode. For example, you could do:
+
+@example
+int i;
+@dots{}
+i++;
+int j = i + 2;
+@end example
+
+Each identifier is visible from where it is declared until the end of
+the enclosing block.
+
@node Function Attributes
@section Declaring Attributes of Functions
@cindex function attributes
@@ -1514,11 +1582,12 @@ attributes.
@cindex @code{noreturn} function attribute
@item noreturn
A few standard library functions, such as @code{abort} and @code{exit},
-cannot return. GNU CC knows this automatically. Some programs define
+cannot return. GCC knows this automatically. Some programs define
their own functions that never return. You can declare them
@code{noreturn} to tell the compiler this fact. For example,
@smallexample
+@group
void fatal () __attribute__ ((noreturn));
void
@@ -1527,6 +1596,7 @@ fatal (@dots{})
@dots{} /* @r{Print error message.} */ @dots{}
exit (1);
@}
+@end group
@end smallexample
The @code{noreturn} keyword tells the compiler to assume that
@@ -1541,7 +1611,7 @@ restored before calling the @code{noreturn} function.
It does not make sense for a @code{noreturn} function to have a return
type other than @code{void}.
-The attribute @code{noreturn} is not implemented in GNU C versions
+The attribute @code{noreturn} is not implemented in GCC versions
earlier than 2.5. An alternative way to declare that a function does
not return, which works in the current version and in some older
versions, is as follows:
@@ -1574,13 +1644,13 @@ Interesting non-pure functions are functions with infinite loops or those
depending on volatile memory or other system resource, that may change between
two consecutive calls (such as @code{feof} in a multithreading environment).
-The attribute @code{pure} is not implemented in GNU C versions earlier
+The attribute @code{pure} is not implemented in GCC versions earlier
than 2.96.
@cindex @code{const} function attribute
@item const
Many functions do not examine any values except their arguments, and
have no effects except the return value. Basically this is just slightly
-more strict class than the "pure" attribute above, since function is not
+more strict class than the @code{pure} attribute above, since function is not
allowed to read global memory.
@cindex pointer arguments
@@ -1590,7 +1660,7 @@ function that calls a non-@code{const} function usually must not be
@code{const}. It does not make sense for a @code{const} function to
return @code{void}.
-The attribute @code{const} is not implemented in GNU C versions earlier
+The attribute @code{const} is not implemented in GCC versions earlier
than 2.5. An alternative way to declare that a function has no side
effects, which works in the current version and in some older versions,
is as follows:
@@ -1607,6 +1677,7 @@ specifies that the @samp{const} must be attached to the return value.
@item format (@var{archetype}, @var{string-index}, @var{first-to-check})
@cindex @code{format} function attribute
+@opindex Wformat
The @code{format} attribute specifies that a function takes @code{printf},
@code{scanf}, @code{strftime} or @code{strfmon} style arguments which
should be type-checked against a format string. For example, the
@@ -1640,14 +1711,15 @@ argument of the function @code{my_print}, and the arguments to check
start with the third argument, so the correct parameters for the format
attribute are 2 and 3.
+@opindex ffreestanding
The @code{format} attribute allows you to identify your own functions
-which take format strings as arguments, so that GNU CC can check the
+which take format strings as arguments, so that GCC can check the
calls to these functions for errors. The compiler always (unless
-@samp{-ffreestanding} is used) checks formats
+@option{-ffreestanding} is used) checks formats
for the standard library functions @code{printf}, @code{fprintf},
@code{sprintf}, @code{scanf}, @code{fscanf}, @code{sscanf}, @code{strftime},
@code{vprintf}, @code{vfprintf} and @code{vsprintf} whenever such
-warnings are requested (using @samp{-Wformat}), so there is no need to
+warnings are requested (using @option{-Wformat}), so there is no need to
modify the header file @file{stdio.h}. In C99 mode, the functions
@code{snprintf}, @code{vsnprintf}, @code{vscanf}, @code{vfscanf} and
@code{vsscanf} are also checked. Except in strictly conforming C
@@ -1656,6 +1728,7 @@ standard modes, the X/Open function @code{strfmon} is also checked.
@item format_arg (@var{string-index})
@cindex @code{format_arg} function attribute
+@opindex Wformat-nonliteral
The @code{format_arg} attribute specifies that a function takes a format
string for a @code{printf}, @code{scanf}, @code{strftime} or
@code{strfmon} style function and modifies it (for example, to translate
@@ -1679,29 +1752,30 @@ consistency with the format string argument @code{my_format}. If the
@code{format_arg} attribute had not been specified, all the compiler
could tell in such calls to format functions would be that the format
string argument is not constant; this would generate a warning when
-@code{-Wformat-nonliteral} is used, but the calls could not be checked
+@option{-Wformat-nonliteral} is used, but the calls could not be checked
without the attribute.
The parameter @var{string-index} specifies which argument is the format
string argument (starting from 1).
The @code{format-arg} attribute allows you to identify your own
-functions which modify format strings, so that GNU CC can check the
+functions which modify format strings, so that GCC can check the
calls to @code{printf}, @code{scanf}, @code{strftime} or @code{strfmon}
type function whose operands are a call to one of your own function.
The compiler always treats @code{gettext}, @code{dgettext}, and
@code{dcgettext} in this manner except when strict ISO C support is
-requested by @samp{-ansi} or an appropriate @samp{-std} option, or
-@samp{-ffreestanding} is used. @xref{C Dialect Options,,Options
+requested by @option{-ansi} or an appropriate @option{-std} option, or
+@option{-ffreestanding} is used. @xref{C Dialect Options,,Options
Controlling C Dialect}.
@item no_instrument_function
@cindex @code{no_instrument_function} function attribute
-If @samp{-finstrument-functions} is given, profiling function calls will
+@opindex finstrument-functions
+If @option{-finstrument-functions} is given, profiling function calls will
be generated at entry and exit of most user-compiled functions.
Functions with this attribute will not be so instrumented.
-@item section ("section-name")
+@item section ("@var{section-name}")
@cindex @code{section} function attribute
Normally, the compiler places the code it generates in the @code{text} section.
Sometimes, however, you need additional sections, or you need certain
@@ -1733,11 +1807,11 @@ been called. Functions with these attributes are useful for
initializing data that will be used implicitly during the execution of
the program.
-These attributes are not currently implemented for Objective C.
+These attributes are not currently implemented for Objective C@.
@item unused
This attribute, attached to a function, means that the function is meant
-to be possibly unused. GNU CC will not produce a warning for this
+to be possibly unused. GCC will not produce a warning for this
function. GNU C++ does not currently support this attribute as
definitions without parameters are valid in C++.
@@ -1757,7 +1831,7 @@ may be treated as if it were the malloc function. The compiler assumes
that calls to malloc result in a pointers that cannot alias anything.
This will often improve optimization.
-@item alias ("target")
+@item alias ("@var{target}")
@cindex @code{alias} attribute
The @code{alias} attribute causes the declaration to be emitted as an
alias for another symbol, which must be specified. For instance,
@@ -1774,25 +1848,26 @@ Not all target machines support this attribute.
@item no_check_memory_usage
@cindex @code{no_check_memory_usage} function attribute
-The @code{no_check_memory_usage} attribute causes GNU CC to omit checks
+@opindex fcheck-memory-usage
+The @code{no_check_memory_usage} attribute causes GCC to omit checks
of memory references when it generates code for that function. Normally
-if you specify @samp{-fcheck-memory-usage} (see @pxref{Code Gen
-Options}), GNU CC generates calls to support routines before most memory
+if you specify @option{-fcheck-memory-usage} (see @pxref{Code Gen
+Options}), GCC generates calls to support routines before most memory
accesses to permit support code to record usage and detect uses of
-uninitialized or unallocated storage. Since GNU CC cannot handle
+uninitialized or unallocated storage. Since GCC cannot handle
@code{asm} statements properly they are not allowed in such functions.
-If you declare a function with this attribute, GNU CC will not generate
+If you declare a function with this attribute, GCC will not generate
memory checking code for that function, permitting the use of @code{asm}
statements without having to compile that function with different
options. This also allows you to write support routines of your own if
you wish, without getting infinite recursion if they get compiled with
-@code{-fcheck-memory-usage}.
+@option{-fcheck-memory-usage}.
@item regparm (@var{number})
@cindex functions that are passed arguments in registers on the 386
On the Intel 386, the @code{regparm} attribute causes the compiler to
-pass up to @var{number} integer arguments in registers @var{EAX},
-@var{EDX}, and @var{ECX} instead of on the stack. Functions that take a
+pass up to @var{number} integer arguments in registers EAX,
+EDX, and ECX instead of on the stack. Functions that take a
variable number of arguments will continue to be passed all of their
arguments on the stack.
@@ -1807,10 +1882,11 @@ attribute.
@item cdecl
@cindex functions that do pop the argument stack on the 386
+@opindex mrtd
On the Intel 386, the @code{cdecl} attribute causes the compiler to
assume that the calling function will pop off the stack space used to
pass arguments. This is
-useful to override the effects of the @samp{-mrtd} switch.
+useful to override the effects of the @option{-mrtd} switch.
The PowerPC compiler for Windows NT currently ignores the @code{cdecl}
attribute.
@@ -1825,7 +1901,7 @@ current location can be called.
@item long_call/short_call
@cindex indirect calls on ARM
This attribute allows to specify how to call a particular function on
-ARM. Both attributes override the @code{-mlong-calls} (@pxref{ARM Options})
+ARM@. Both attributes override the @option{-mlong-calls} (@pxref{ARM Options})
command line switch and @code{#pragma long_calls} settings. The
@code{long_call} attribute causes the compiler to always call the
function by first loading its address into a register and then using the
@@ -1869,13 +1945,6 @@ and 64 entries on the H8/300H) and shares space with the interrupt vector.
You must use GAS and GLD from GNU binutils version 2.7 or later for
this option to work correctly.
-@item interrupt_handler
-@cindex interrupt handler functions on the H8/300 processors
-Use this option on the H8/300 and H8/300H to indicate that the specified
-function is an interrupt handler. The compiler will generate function
-entry and exit sequences suitable for use in an interrupt handler when this
-attribute is present.
-
@item interrupt
@cindex interrupt handler functions
Use this option on the ARM, AVR and M32R/D ports to indicate that the
@@ -1883,8 +1952,8 @@ specified function is an interrupt handler. The compiler will generate
function entry and exit sequences suitable for use in an interrupt
handler when this attribute is present.
-Note, interrupt handlers for the H8/300 and H8/300H processors can be
-specified via the @code{interrupt_handler} attribute.
+Note, interrupt handlers for the H8/300, H8/300H and SH processors can
+be specified via the @code{interrupt_handler} attribute.
Note, on the AVR interrupts will be enabled inside the function.
@@ -1895,7 +1964,31 @@ adding an optional parameter to the interrupt attribute like this:
void f () __attribute__ ((interrupt ("IRQ")));
@end smallexample
-Permissible values for this parameter are: IRQ, FIQ, SWI, ABORT and UNDEF.
+Permissible values for this parameter are: IRQ, FIQ, SWI, ABORT and UNDEF@.
+
+@item interrupt_handler
+@cindex interrupt handler functions on the H8/300 and SH processors
+Use this option on the H8/300, H8/300H and SH to indicate that the
+specified function is an interrupt handler. The compiler will generate
+function entry and exit sequences suitable for use in an interrupt
+handler when this attribute is present.
+
+@item sp_switch
+Use this option on the SH to indicate an @code{interrupt_handler}
+function should switch to an alternate stack. It expects a string
+argument that names a global variable holding the address of the
+alternate stack.
+
+@smallexample
+void *alt_stack;
+void f () __attribute__ ((interrupt_handler,
+ sp_switch ("alt_stack")));
+@end smallexample
+
+@item trap_exit
+Use this option on the SH for an @code{interrupt_handle} to return using
+@code{trapa} instead of @code{rte}. This attribute expects an integer
+argument specifying the trap number to be used.
@item eightbit_data
@cindex eight bit data on the H8/300 and H8/300H
@@ -1921,7 +2014,7 @@ slightly under 32kbytes of data.
Use this option on the AVR to indicate that the specified
function is an signal handler. The compiler will generate function
entry and exit sequences suitable for use in an signal handler when this
-attribute is present. Interrupts will be disabled inside function.
+attribute is present. Interrupts will be disabled inside function.
@item naked
@cindex function without a prologue/epilogue code
@@ -1940,11 +2033,11 @@ Small model objects live in the lower 16MB of memory (so that their
addresses can be loaded with the @code{ld24} instruction), and are
callable with the @code{bl} instruction.
-Medium model objects may live anywhere in the 32 bit address space (the
+Medium model objects may live anywhere in the 32-bit address space (the
compiler will generate @code{seth/add3} instructions to load their addresses),
and are callable with the @code{bl} instruction.
-Large model objects may live anywhere in the 32 bit address space (the
+Large model objects may live anywhere in the 32-bit address space (the
compiler will generate @code{seth/add3} instructions to load their addresses),
and may not be reachable with the @code{bl} instruction (the compiler will
generate the much slower @code{seth/add3/jl} instruction sequence).
@@ -1990,7 +2083,7 @@ Preprocessing Directives, cpp, The C Preprocessor}.
This section describes the syntax with which @code{__attribute__} may be
used, and the constructs to which attribute specifiers bind, for the C
-language. Some details may vary for C++ and Objective C. Because of
+language. Some details may vary for C++ and Objective C@. Because of
infelicities in the grammar for attributes, some forms described here
may not be successfully parsed in all cases.
@@ -2057,7 +2150,7 @@ to relate to the structure, union or enumerated type defined, not to any
enclosing declaration the type specifier appears in, and the type
defined is not complete until after the attribute specifiers.
@c Otherwise, there would be the following problems: a shift/reduce
-@c conflict between attributes binding the the struct/union/enum and
+@c conflict between attributes binding the struct/union/enum and
@c binding to the list of specifiers/qualifiers; and "aligned"
@c attributes could use sizeof for the structure, but the size could be
@c changed later by "packed" attributes.
@@ -2067,7 +2160,11 @@ counting declarations of unnamed parameters and type names, and relates
to that declaration (which may be nested in another declaration, for
example in the case of a parameter declaration). In future, attribute
specifiers in some places may however apply to a particular declarator
-within a declaration instead; these cases are noted below.
+within a declaration instead; these cases are noted below. Where an
+attribute specifier is applied to a parameter declared as a function or
+an array, it should apply to the function or array rather than the
+pointer to which the parameter is implicitly converted, but this is not
+yet correctly implemented.
Any list of specifiers and qualifiers at the start of a declaration may
contain attribute specifiers, whether or not such a list may in that
@@ -2081,7 +2178,7 @@ the function instead by syntax described below (which, however, is not
yet implemented in this case). In some other cases, attribute
specifiers are permitted by this grammar but not yet supported by the
compiler. All attribute specifiers in this place relate to the
-declaration as a whole. In the obsolencent usage where a type of
+declaration as a whole. In the obsolescent usage where a type of
@code{int} is implied by the absence of type specifiers, such a list of
specifiers and qualifiers may be an attribute specifier list with no
other specifiers or qualifiers.
@@ -2121,7 +2218,7 @@ declarations or the function body).
An attribute specifier list may appear at the start of a nested
declarator. At present, there are some limitations in this usage: the
-attributes apply to the identifer declared, and to all subsequent
+attributes apply to the identifier declared, and to all subsequent
identifiers declared in that declaration (if it includes a
comma-separated list of declarators), rather than to a specific
declarator. When attribute specifiers follow the @code{*} of a pointer
@@ -2227,8 +2324,8 @@ In GNU C, you may use C++ style comments, which start with @samp{//} and
continue until the end of the line. Many other C implementations allow
such comments, and they are likely to be in a future C standard.
However, C++ style comments are not recognized if you specify
-@w{@samp{-ansi}}, a @option{-std} option specifying a version of ISO C
-before C99, or @w{@samp{-traditional}}, since they are incompatible
+@w{@option{-ansi}}, a @option{-std} option specifying a version of ISO C
+before C99, or @w{@option{-traditional}}, since they are incompatible
with traditional constructs like @code{dividend//*comment*/divisor}.
@node Dollar Signs
@@ -2267,27 +2364,22 @@ Some machines never actually require alignment; they allow reference to any
data type even at an odd addresses. For these machines, @code{__alignof__}
reports the @emph{recommended} alignment of a type.
-When the operand of @code{__alignof__} is an lvalue rather than a type, the
-value is the largest alignment that the lvalue is known to have. It may
-have this alignment as a result of its data type, or because it is part of
-a structure and inherits alignment from that structure. For example, after
-this declaration:
+If the operand of @code{__alignof__} is an lvalue rather than a type,
+its value is the required alignment for its type, taking into account
+any minimum alignment specified with GCC's @code{__attribute__}
+extension (@pxref{Variable Attributes}). For example, after this
+declaration:
@example
struct foo @{ int x; char y; @} foo1;
@end example
@noindent
-the value of @code{__alignof__ (foo1.y)} is probably 2 or 4, the same as
-@code{__alignof__ (int)}, even though the data type of @code{foo1.y}
-does not itself demand any alignment.@refill
+the value of @code{__alignof__ (foo1.y)} is 1, even though its actual
+alignment is probably 2 or 4, the same as @code{__alignof__ (int)}.
It is an error to ask for the alignment of an incomplete type.
-A related feature which lets you specify the alignment of an object is
-@code{__attribute__ ((aligned (@var{alignment})))}; see the following
-section.
-
@node Variable Attributes
@section Specifying Attributes of Variables
@cindex attribute of variables
@@ -2301,7 +2393,7 @@ attributes are currently defined for variables: @code{aligned},
@code{transparent_union}, @code{unused}, and @code{weak}. Some other
attributes are defined for variables on particular target systems. Other
attributes are available for functions (@pxref{Function Attributes}) and
-for types (@pxref{Type Attributes}). Other front-ends might define more
+for types (@pxref{Type Attributes}). Other front ends might define more
attributes (@pxref{C++ Extensions,,Extensions to the C++ Language}).
You may also specify attributes with @samp{__} preceding and following
@@ -2388,9 +2480,10 @@ or @samp{__pointer__} for the mode used to represent pointers.
@item nocommon
@cindex @code{nocommon} attribute
-This attribute specifies requests GNU CC not to place a variable
+@opindex fno-common
+This attribute specifies requests GCC not to place a variable
``common'' but instead to allocate space for it directly. If you
-specify the @samp{-fno-common} flag, GNU CC will do this for all
+specify the @option{-fno-common} flag, GCC will do this for all
variables.
Specifying the @code{nocommon} attribute for a variable provides an
@@ -2415,7 +2508,7 @@ struct foo
@};
@end example
-@item section ("section-name")
+@item section ("@var{section-name}")
@cindex @code{section} variable attribute
Normally, the compiler places the objects it generates in sections like
@code{data} and @code{bss}. Sometimes, however, you need additional sections,
@@ -2446,7 +2539,7 @@ main()
@noindent
Use the @code{section} attribute with an @emph{initialized} definition
-of a @emph{global} variable, as shown in the example. GNU CC issues
+of a @emph{global} variable, as shown in the example. GCC issues
a warning and otherwise ignores the @code{section} attribute in
uninitialized variable declarations.
@@ -2454,8 +2547,8 @@ You may only use the @code{section} attribute with a fully initialized
global definition because of the way linkers work. The linker requires
each object be defined once, with the exception that uninitialized
variables tentatively go in the @code{common} (or @code{bss}) section
-and can be multiply "defined". You can force a variable to be
-initialized with the @samp{-fno-common} flag or the @code{nocommon}
+and can be multiply ``defined''. You can force a variable to be
+initialized with the @option{-fno-common} flag or the @code{nocommon}
attribute.
Some file formats do not support arbitrary sections so the @code{section}
@@ -2465,10 +2558,10 @@ section, consider using the facilities of the linker instead.
@item shared
@cindex @code{shared} variable attribute
-On Windows NT, in addition to putting variable definitions in a named
-section, the section can also be shared among all running copies of an
-executable or DLL. For example, this small program defines shared data
-by putting it in a named section "shared" and marking the section
+On Windows NT, in addition to putting variable definitions in a named
+section, the section can also be shared among all running copies of an
+executable or DLL@. For example, this small program defines shared data
+by putting it in a named section @code{shared} and marking the section
shareable:
@smallexample
@@ -2477,17 +2570,18 @@ int foo __attribute__((section ("shared"), shared)) = 0;
int
main()
@{
- /* Read and write foo. All running copies see the same value. */
+ /* Read and write foo. All running
+ copies see the same value. */
return 0;
@}
@end smallexample
@noindent
You may only use the @code{shared} attribute along with @code{section}
-attribute with a fully initialized global definition because of the way
+attribute with a fully initialized global definition because of the way
linkers work. See @code{section} attribute for more information.
-The @code{shared} attribute is only available on Windows NT.
+The @code{shared} attribute is only available on Windows NT@.
@item transparent_union
This attribute, attached to a function parameter which is a union, means
@@ -2499,7 +2593,7 @@ applies to all function parameters with that type.
@item unused
This attribute, attached to a variable, means that the variable is meant
-to be possibly unused. GNU CC will not produce a warning for this
+to be possibly unused. GCC will not produce a warning for this
variable.
@item weak
@@ -2514,7 +2608,7 @@ or @code{large}, representing each of the code models.
Small model objects live in the lower 16MB of memory (so that their
addresses can be loaded with the @code{ld24} instruction).
-Medium and large model objects may live anywhere in the 32 bit address space
+Medium and large model objects may live anywhere in the 32-bit address space
(the compiler will generate @code{seth/add3} instructions to load their
addresses).
@@ -2640,9 +2734,10 @@ This attribute, attached to an @code{enum}, @code{struct}, or
@code{union} type definition, specified that the minimum required memory
be used to represent the type.
+@opindex fshort-enums
Specifying this attribute for @code{struct} and @code{union} types is
equivalent to specifying the @code{packed} attribute on each of the
-structure or union members. Specifying the @samp{-fshort-enums}
+structure or union members. Specifying the @option{-fshort-enums}
flag on the line is equivalent to specifying the @code{packed}
attribute on all @code{enum} definitions.
@@ -2711,7 +2806,7 @@ pid_t wait (wait_status_ptr_t p)
@item unused
When attached to a type (including a @code{union} or a @code{struct}),
this attribute means that variables of that type are meant to appear
-possibly unused. GNU CC will not produce a warning for any variables of
+possibly unused. GCC will not produce a warning for any variables of
that type, even if the variable appears to do nothing. This is often
the case with lock or thread classes, which are usually defined and then
not referenced, but contain constructors and destructors that have
@@ -2730,7 +2825,7 @@ packed))}.
@cindex open coding
@cindex macros, inline alternative
-By declaring a function @code{inline}, you can direct GNU CC to
+By declaring a function @code{inline}, you can direct GCC to
integrate that function's code into the code for its callers. This
makes execution faster by eliminating the function-call overhead; in
addition, if any of the actual argument values are constant, their known
@@ -2739,7 +2834,11 @@ inline function's code needs to be included. The effect on code size is
less predictable; object code may be larger or smaller with function
inlining, depending on the particular case. Inlining of functions is an
optimization and it really ``works'' only in optimizing compilation. If
-you don't use @samp{-O}, no function is really inline.
+you don't use @option{-O}, no function is really inline.
+
+Inline functions are included in the ISO C99 standard, but there are
+currently substantial differences between what GCC implements and what
+the ISO C99 standard requires.
To declare a function inline, use the @code{inline} keyword in its
declaration, like this:
@@ -2755,13 +2854,14 @@ inc (int *a)
(If you are writing a header file to be included in ISO C programs, write
@code{__inline__} instead of @code{inline}. @xref{Alternate Keywords}.)
You can also make all ``simple enough'' functions inline with the option
-@samp{-finline-functions}.
+@option{-finline-functions}.
+@opindex Winline
Note that certain usages in a function definition can make it unsuitable
for inline substitution. Among these usages are: use of varargs, use of
alloca, use of variable sized data types (@pxref{Variable Length}),
use of computed goto (@pxref{Labels as Values}), use of nonlocal goto,
-and nested functions (@pxref{Nested Functions}). Using @samp{-Winline}
+and nested functions (@pxref{Nested Functions}). Using @option{-Winline}
will warn when a function marked @code{inline} could not be substituted,
and will give the reason for the failure.
@@ -2772,17 +2872,19 @@ does not affect the linkage of the function.
@cindex @code{inline} automatic for C++ member fns
@cindex member fns, automatically @code{inline}
@cindex C++ member fns, automatically @code{inline}
-GNU CC automatically inlines member functions defined within the class
+@opindex fno-default-inline
+GCC automatically inlines member functions defined within the class
body of C++ programs even if they are not explicitly declared
-@code{inline}. (You can override this with @samp{-fno-default-inline};
+@code{inline}. (You can override this with @option{-fno-default-inline};
@pxref{C++ Dialect Options,,Options Controlling C++ Dialect}.)
@cindex inline functions, omission of
+@opindex fkeep-inline-functions
When a function is both inline and @code{static}, if all calls to the
function are integrated into the caller, and the function's address is
never used, then the function's own assembler code is never referenced.
-In this case, GNU CC does not actually output assembler code for the
-function, unless you specify the option @samp{-fkeep-inline-functions}.
+In this case, GCC does not actually output assembler code for the
+function, unless you specify the option @option{-fkeep-inline-functions}.
Some calls cannot be integrated for various reasons (in particular,
calls that precede the function's definition cannot be integrated, and
neither can recursive calls within the definition). If there is a
@@ -2812,7 +2914,13 @@ The definition in the header file will cause most calls to the function
to be inlined. If any uses of the function remain, they will refer to
the single copy in the library.
-GNU C does not inline any functions when not optimizing. It is not
+For future compatibility with when GCC implements ISO C99 semantics for
+inline functions, it is best to use @code{static inline} only. (The
+existing semantics will remain available when @option{-std=gnu89} is
+specified, but eventually the default will be @option{-std=gnu99} and
+that will implement the C99 semantics, though it does not do so yet.)
+
+GCC does not inline any functions when not optimizing. It is not
clear whether it is better to inline or not, in this case, but we found
that a correct implementation when not optimizing was difficult. So we
did the easy thing, and turned it off.
@@ -2867,11 +2975,11 @@ template and does not know what it means or even whether it is valid
assembler input. The extended @code{asm} feature is most often used for
machine instructions the compiler itself does not know exist. If
the output expression cannot be directly addressed (for example, it is a
-bit field), your constraint must allow a register. In that case, GNU CC
+bit-field), your constraint must allow a register. In that case, GCC
will use the register as the output of the @code{asm}, and then store
that register into the output.
-The ordinary output operands must be write-only; GNU CC will assume that
+The ordinary output operands must be write-only; GCC will assume that
the values in these operands before the instruction are dead and need
not be generated. Extended asm supports input-output or read-write
operands. Use the constraint character @samp{+} to indicate such an
@@ -2908,12 +3016,12 @@ asm ("combine %2,%0" : "=r" (foo) : "r" (foo), "g" (bar));
@end example
Various optimizations or reloading could cause operands 0 and 1 to be in
-different registers; GNU CC knows no reason not to do so. For example, the
+different registers; GCC knows no reason not to do so. For example, the
compiler might find a copy of the value of @code{foo} in one register and
use it for operand 1, but generate the output operand 0 in a different
register (copying it afterward to @code{foo}'s own address). Of course,
since the register for operand 1 is not even mentioned in the assembler
-code, the result will not work, but GNU CC can't tell that.
+code, the result will not work, but GCC can't tell that.
Some instructions clobber specific hard registers. To describe this,
write a third colon after the input operands, followed by the names of
@@ -2935,7 +3043,7 @@ operand is modified without also specifying it as an output
operand. Note that if all the output operands you specify are for this
purpose (and hence unused), you will then also need to specify
@code{volatile} for the @code{asm} construct, as described below, to
-prevent GNU CC from deleting the @code{asm} statement as unused.
+prevent GCC from deleting the @code{asm} statement as unused.
If you refer to a particular hardware register from the assembler code,
you will probably have to list the register after the third colon to
@@ -2944,7 +3052,7 @@ the register names begin with @samp{%}; to produce one @samp{%} in the
assembler code, you must write @samp{%%} in the input.
If your assembler instruction can alter the condition code register, add
-@samp{cc} to the list of clobbered registers. GNU CC on some machines
+@samp{cc} to the list of clobbered registers. GCC on some machines
represents the condition codes as a specific hardware register;
@samp{cc} serves to name this register. On other machines, the
condition code is handled differently, and specifying @samp{cc} has no
@@ -2952,7 +3060,7 @@ effect. But it is valid no matter what the machine.
If your assembler instruction modifies memory in an unpredictable
fashion, add @samp{memory} to the list of clobbered registers. This
-will cause GNU CC to not keep memory values cached in registers across
+will cause GCC to not keep memory values cached in registers across
the assembler instruction. You will also want to add the
@code{volatile} keyword if the memory affected is not listed in the
inputs or outputs of the @code{asm}, as the @samp{memory} clobber does
@@ -2978,7 +3086,7 @@ asm ("movl %0,r9\n\tmovl %1,r10\n\tcall _foo"
: "r9", "r10");
@end example
-Unless an output operand has the @samp{&} constraint modifier, GNU CC
+Unless an output operand has the @samp{&} constraint modifier, GCC
may allocate it in the same register as an unrelated input operand, on
the assumption the inputs are consumed before the outputs are produced.
This assumption may be false if the assembler code actually consists of
@@ -3028,7 +3136,7 @@ example, if the desired type were @code{int}, casting the argument to
argument to an @code{int} variable named @code{__arg} would warn about
using a pointer unless the caller explicitly casts it.
-If an @code{asm} has output operands, GNU CC assumes for optimization
+If an @code{asm} has output operands, GCC assumes for optimization
purposes the instruction has no side effects except to change the output
operands. This does not mean instructions with a side effect cannot be
used, but you must be careful, because the compiler may eliminate them
@@ -3043,32 +3151,48 @@ significantly, or combined, by writing the keyword @code{volatile} after
the @code{asm}. For example:
@example
-#define get_and_set_priority(new) \
-(@{ int __old; \
- asm volatile ("get_and_set_priority %0, %1": "=g" (__old) : "g" (new)); \
+#define get_and_set_priority(new) \
+(@{ int __old; \
+ asm volatile ("get_and_set_priority %0, %1" \
+ : "=g" (__old) : "g" (new)); \
__old; @})
@end example
@noindent
-If you write an @code{asm} instruction with no outputs, GNU CC will know
+If you write an @code{asm} instruction with no outputs, GCC will know
the instruction has side-effects and will not delete the instruction or
-move it outside of loops. If the side-effects of your instruction are
-not purely external, but will affect variables in your program in ways
-other than reading the inputs and clobbering the specified registers or
-memory, you should write the @code{volatile} keyword to prevent future
-versions of GNU CC from moving the instruction around within a core
-region.
-
-An @code{asm} instruction without any operands or clobbers (and ``old
-style'' @code{asm}) will not be deleted or moved significantly,
-regardless, unless it is unreachable, the same way as if you had
-written a @code{volatile} keyword.
+move it outside of loops.
+
+The @code{volatile} keyword indicates that the instruction has
+important side-effects. GCC will not delete a volatile @code{asm} if
+it is reachable. (The instruction can still be deleted if GCC can
+prove that control-flow will never reach the location of the
+instruction.) In addition, GCC will not reschedule instructions
+across a volatile @code{asm} instruction. For example:
+
+@example
+*(volatile int *)addr = foo;
+asm volatile ("eieio" : : );
+@end example
+
+@noindent
+Assume @code{addr} contains the address of a memory mapped device
+register. The PowerPC @code{eieio} instruction (Enforce In-order
+Execution of I/O) tells the CPU to make sure that the store to that
+device register happens before it issues any other I/O@.
Note that even a volatile @code{asm} instruction can be moved in ways
that appear insignificant to the compiler, such as across jump
instructions. You can't expect a sequence of volatile @code{asm}
instructions to remain perfectly consecutive. If you want consecutive
-output, use a single @code{asm}.
+output, use a single @code{asm}. Also, GCC will perform some
+optimizations across a volatile @code{asm} instruction; GCC does not
+``forget everything'' when it encounters a volatile @code{asm}
+instruction the way some other compilers do.
+
+An @code{asm} instruction without any operands or clobbers (an ``old
+style'' @code{asm}) will be treated identically to a volatile
+@code{asm} instruction.
It is a natural idea to look for a way to give access to the condition
code left by the assembler instruction. However, when we attempted to
@@ -3108,7 +3232,7 @@ For any input reg that is implicitly popped by an asm, it is
necessary to know how to adjust the stack to compensate for the pop.
If any non-popped input is closer to the top of the reg-stack than
the implicitly popped reg, it would not be possible to know what the
-stack looked like --- it's not clear how the rest of the stack ``slides
+stack looked like---it's not clear how the rest of the stack ``slides
up''.
All implicitly popped input regs must be closer to the top of
@@ -3122,7 +3246,7 @@ asm ("foo" : "=t" (a) : "f" (b));
@end example
This asm says that input B is not popped by the asm, and that
-the asm pushes a result onto the reg-stack, ie, the stack is one
+the asm pushes a result onto the reg-stack, i.e., the stack is one
deeper after the asm than it was before. But, it is possible that
reload will think that it can use the same reg for both the input and
the output, if input B dies in this insn.
@@ -3138,7 +3262,7 @@ asm ("foo" : "=&t" (a) : "f" (b));
@item
Some operands need to be in particular places on the stack. All
-output operands fall in this category --- there is no other way to
+output operands fall in this category---there is no other way to
know which regs the outputs appear in unless the user indicates
this in the constraints.
@@ -3206,6 +3330,13 @@ On systems where an underscore is normally prepended to the name of a C
function or variable, this feature allows you to define names for the
linker that do not start with an underscore.
+It does not make sense to use this feature with a non-static local
+variable since such variables do not have assembler names. If you are
+trying to put the variable in a particular register, see @ref{Explicit
+Reg Vars}. GCC presently accepts such code with a warning, but will
+probably be changed to issue an error, rather than a warning, in the
+future.
+
You cannot use @code{asm} in this way in a function @emph{definition}; but
you can get the same effect by writing a declaration for the function
before its definition and putting @code{asm} there, like this:
@@ -3220,8 +3351,8 @@ func (x, y)
It is up to you to make sure that the assembler names you choose do not
conflict with any other assembler symbols. Also, you must not use a
-register name; that would produce completely invalid assembler code. GNU
-CC does not as yet have the ability to store static variables in registers.
+register name; that would produce completely invalid assembler code. GCC
+does not as yet have the ability to store static variables in registers.
Perhaps that will be added.
@node Explicit Reg Vars
@@ -3308,7 +3439,7 @@ you recompile them specially for the task at hand).
@cindex @code{qsort}, and global register variables
It is not safe for one function that uses a global register variable to
call another such function @code{foo} by way of a third function
-@code{lose} that was compiled without knowledge of this variable (i.e. in a
+@code{lose} that was compiled without knowledge of this variable (i.e.@: in a
different source file in which the variable wasn't declared). This is
because @code{lose} might save the register and put some other value there.
For example, you can't expect a global register variable to be available in
@@ -3320,7 +3451,7 @@ solve this problem.)
If you want to recompile @code{qsort} or other source files which do not
actually use your global register variable, so that they will not use that
register for any other purpose, then it suffices to specify the compiler
-option @samp{-ffixed-@var{reg}}. You need not actually add a global
+option @option{-ffixed-@var{reg}}. You need not actually add a global
register declaration to their source code.
A function which can alter the value of a global register variable cannot
@@ -3394,7 +3525,7 @@ unavailable for use in the reload pass; excessive use of this feature
leaves the compiler too few available registers to compile certain
functions.
-This option does not guarantee that GNU CC will generate code that has
+This option does not guarantee that GCC will generate code that has
this variable in the register you specify at all times. You may not
code an explicit reference to this register in an @code{asm} statement
and assume it will always refer to this variable.
@@ -3421,7 +3552,7 @@ since they won't work in a program compiled with @option{-ansi}
compiled with @option{-traditional}. The ISO C99 keyword
@code{restrict} is only available when @option{-std=gnu99} (which will
eventually be the default) or @option{-std=c99} (or the equivalent
-@option{-std=iso9899:1999}) is used.@refill
+@option{-std=iso9899:1999}) is used.
The way to solve these problems is to put @samp{__} at the beginning and
end of each problematical keyword. For example, use @code{__asm__}
@@ -3439,7 +3570,8 @@ macros to replace them with the customary keywords. It looks like this:
@end example
@findex __extension__
-@samp{-pedantic} and other options cause warnings for many GNU C extensions.
+@opindex pedantic
+@option{-pedantic} and other options cause warnings for many GNU C extensions.
You can
prevent such warnings within one expression by writing
@code{__extension__} before the expression. @code{__extension__} has no
@@ -3464,10 +3596,13 @@ This extension is not supported by GNU C++.
@node Function Names
@section Function Names as Strings
+@cindex @code{__FUNCTION__} identifier
+@cindex @code{__PRETTY_FUNCTION__} identifier
+@cindex @code{__func__} identifier
-GNU CC predefines two magic identifiers to hold the name of the current
-function. The identifier @code{__FUNCTION__} holds the name of the function
-as it appears in the source. The identifier @code{__PRETTY_FUNCTION__}
+GCC predefines two magic identifiers to hold the name of the current
+function. The identifier @code{__FUNCTION__} holds the name of the function
+as it appears in the source. The identifier @code{__PRETTY_FUNCTION__}
holds the name of the function pretty printed in a language specific
fashion.
@@ -3506,10 +3641,10 @@ __PRETTY_FUNCTION__ = int a::sub (int)
@end smallexample
The compiler automagically replaces the identifiers with a string
-literal containing the appropriate name. Thus, they are neither
+literal containing the appropriate name. Thus, they are neither
preprocessor macros, like @code{__FILE__} and @code{__LINE__}, nor
-variables. This means that they catenate with other string literals, and
-that they can be used to initialize char arrays. For example
+variables. This means that they catenate with other string literals,
+and that they can be used to initialize char arrays. For example
@smallexample
char here[] = "Function " __FUNCTION__ " in " __FILE__;
@@ -3519,8 +3654,9 @@ On the other hand, @samp{#ifdef __FUNCTION__} does not have any special
meaning inside a function, since the preprocessor does not do anything
special with the identifier @code{__FUNCTION__}.
-GNU CC also supports the magic word @code{__func__}, defined by the
-ISO standard C-99:
+Note that these semantics are deprecated, and that GCC 3.2 will handle
+@code{__FUNCTION__} and @code{__PRETTY_FUNCTION__} the same way as
+@code{__func__}. @code{__func__} is defined by the ISO standard C99:
@display
The identifier @code{__func__} is implicitly declared by the translator
@@ -3532,7 +3668,7 @@ static const char __func__[] = "function-name";
@end smallexample
appeared, where function-name is the name of the lexically-enclosing
-function. This name is the unadorned name of the function.
+function. This name is the unadorned name of the function.
@end display
By this definition, @code{__func__} is a variable, not a string literal.
@@ -3548,9 +3684,7 @@ variables, declared in the same way as @code{__func__}.
These functions may be used to get information about the callers of a
function.
-@table @code
-@findex __builtin_return_address
-@item __builtin_return_address (@var{level})
+@deftypefn {Built-in Function} {void *} __builtin_return_address (unsigned int @var{level})
This function returns the return address of the current function, or of
one of its callers. The @var{level} argument is number of frames to
scan up the call stack. A value of @code{0} yields the return address
@@ -3563,11 +3697,11 @@ On some machines it may be impossible to determine the return address of
any function other than the current one; in such cases, or when the top
of the stack has been reached, this function will return @code{0}.
-This function should only be used with a non-zero argument for debugging
+This function should only be used with a nonzero argument for debugging
purposes.
+@end deftypefn
-@findex __builtin_frame_address
-@item __builtin_frame_address (@var{level})
+@deftypefn {Built-in Function} {void *} __builtin_frame_address (unsigned int @var{level})
This function is similar to @code{__builtin_return_address}, but it
returns the address of the function frame rather than the return address
of the function. Calling @code{__builtin_frame_address} with a value of
@@ -3585,11 +3719,11 @@ pointer register.
The caveats that apply to @code{__builtin_return_address} apply to this
function as well.
-@end table
+@end deftypefn
@node Other Builtins
-@section Other built-in functions provided by GNU CC
-@cindex builtin functions
+@section Other built-in functions provided by GCC
+@cindex built-in functions
@findex __builtin_isgreater
@findex __builtin_isgreaterequal
@findex __builtin_isless
@@ -3651,7 +3785,7 @@ function as well.
@findex strspn
@findex strstr
-GNU CC provides a large number of built-in functions other than the ones
+GCC provides a large number of built-in functions other than the ones
mentioned above. Some of these are for internal use in the processing
of exceptions or variable-length argument lists and will not be
documented here because they may change from time to time; we do not
@@ -3659,67 +3793,67 @@ recommend general use of these functions.
The remaining functions are provided for optimization purposes.
-GNU CC includes builtin versions of many of the functions in the
+@opindex fno-builtin
+GCC includes built-in versions of many of the functions in the
standard C library. The versions prefixed with @code{__builtin_} will
always be treated as having the same meaning as the C library function
-even if you specify the @samp{-fno-builtin} (@pxref{C Dialect Options})
+even if you specify the @option{-fno-builtin} (@pxref{C Dialect Options})
option. Many of these functions are only optimized in certain cases; if
not optimized in a particular case, a call to the library function will
be emitted.
+@opindex ansi
+@opindex std
The functions @code{abort}, @code{exit}, @code{_Exit} and @code{_exit}
are recognized and presumed not to return, but otherwise are not built
-in. @code{_exit} is not recognized in strict ISO C mode (@samp{-ansi},
-@samp{-std=c89} or @samp{-std=c99}). @code{_Exit} is not recognized in
-strict C89 mode (@samp{-ansi} or @samp{-std=c89}).
+in. @code{_exit} is not recognized in strict ISO C mode (@option{-ansi},
+@option{-std=c89} or @option{-std=c99}). @code{_Exit} is not recognized in
+strict C89 mode (@option{-ansi} or @option{-std=c89}).
Outside strict ISO C mode, the functions @code{alloca}, @code{bcmp},
@code{bzero}, @code{index}, @code{rindex} and @code{ffs} may be handled
-as builtins. Corresponding versions @code{__builtin_alloca},
+as built-in functions. Corresponding versions @code{__builtin_alloca},
@code{__builtin_bcmp}, @code{__builtin_bzero}, @code{__builtin_index},
@code{__builtin_rindex} and @code{__builtin_ffs} are also recognized in
strict ISO C mode.
The ISO C99 functions @code{conj}, @code{conjf}, @code{conjl},
@code{creal}, @code{crealf}, @code{creall}, @code{cimag}, @code{cimagf},
-@code{cimagl}, @code{llabs} and @code{imaxabs} are handled as builtins
-except in strict ISO C89 mode. There are also builtin versions of the ISO C99
+@code{cimagl}, @code{llabs} and @code{imaxabs} are handled as built-in functions
+except in strict ISO C89 mode. There are also built-in versions of the ISO C99
functions @code{cosf}, @code{cosl}, @code{fabsf}, @code{fabsl},
@code{sinf}, @code{sinl}, @code{sqrtf}, and @code{sqrtl}, that are
recognized in any mode since ISO C89 reserves these names for the
purpose to which ISO C99 puts them. All these functions have
corresponding versions prefixed with @code{__builtin_}.
-The following ISO C89 functions are recognized as builtins unless
-@samp{-fno-builtin} is specified: @code{abs}, @code{cos}, @code{fabs},
+The following ISO C89 functions are recognized as built-in functions unless
+@option{-fno-builtin} is specified: @code{abs}, @code{cos}, @code{fabs},
@code{fprintf}, @code{fputs}, @code{labs}, @code{memcmp}, @code{memcpy},
@code{memset}, @code{printf}, @code{sin}, @code{sqrt}, @code{strcat},
@code{strchr}, @code{strcmp}, @code{strcpy}, @code{strcspn},
@code{strlen}, @code{strncat}, @code{strncmp}, @code{strncpy},
@code{strpbrk}, @code{strrchr}, @code{strspn}, and @code{strstr}. All
of these functions have corresponding versions prefixed with
-@code{__builtin_}, except that the version for @code{sqrt} is called
-@code{__builtin_fsqrt}.
+@code{__builtin_}.
-GNU CC provides builtin versions of the ISO C99 floating point
+GCC provides built-in versions of the ISO C99 floating point
comparison macros (that avoid raising exceptions for unordered
operands): @code{__builtin_isgreater}, @code{__builtin_isgreaterequal},
@code{__builtin_isless}, @code{__builtin_islessequal},
@code{__builtin_islessgreater}, and @code{__builtin_isunordered}.
-@table @code
-@findex __builtin_constant_p
-@item __builtin_constant_p (@var{exp})
-You can use the builtin function @code{__builtin_constant_p} to
+@deftypefn {Built-in Function} int __builtin_constant_p (@var{exp})
+You can use the built-in function @code{__builtin_constant_p} to
determine if a value is known to be constant at compile-time and hence
-that GNU CC can perform constant-folding on expressions involving that
+that GCC can perform constant-folding on expressions involving that
value. The argument of the function is the value to test. The function
returns the integer 1 if the argument is known to be a compile-time
constant and 0 if it is not known to be a compile-time constant. A
return of 0 does not indicate that the value is @emph{not} a constant,
-but merely that GNU CC cannot prove it is a constant with the specified
-value of the @samp{-O} option.
+but merely that GCC cannot prove it is a constant with the specified
+value of the @option{-O} option.
You would typically use this function in an embedded application where
memory was a critical resource. If you have some complex calculation,
@@ -3727,30 +3861,52 @@ you may want it to be folded if it involves constants, but need to call
a function if it does not. For example:
@smallexample
-#define Scale_Value(X) \
- (__builtin_constant_p (X) ? ((X) * SCALE + OFFSET) : Scale (X))
+#define Scale_Value(X) \
+ (__builtin_constant_p (X) \
+ ? ((X) * SCALE + OFFSET) : Scale (X))
@end smallexample
-You may use this builtin function in either a macro or an inline
+You may use this built-in function in either a macro or an inline
function. However, if you use it in an inlined function and pass an
-argument of the function as the argument to the builtin, GNU CC will
+argument of the function as the argument to the built-in, GCC will
never return 1 when you call the inline function with a string constant
-or constructor expression (@pxref{Constructors}) and will not return 1
+or compound literal (@pxref{Compound Literals}) and will not return 1
when you pass a constant numeric value to the inline function unless you
-specify the @samp{-O} option.
+specify the @option{-O} option.
+
+You may also use @code{__builtin_constant_p} in initializers for static
+data. For instance, you can write
+
+@smallexample
+static const int table[] = @{
+ __builtin_constant_p (EXPRESSION) ? (EXPRESSION) : -1,
+ /* ... */
+@};
+@end smallexample
-@findex __builtin_expect
-@item __builtin_expect(@var{exp}, @var{c})
-You may use @code{__builtin_expect} to provide the compiler with
+@noindent
+This is an acceptable initializer even if @var{EXPRESSION} is not a
+constant expression. GCC must be more conservative about evaluating the
+built-in in this case, because it has no opportunity to perform
+optimization.
+
+Previous versions of GCC did not accept this built-in in data
+initializers. The earliest version where it is completely safe is
+3.0.1.
+@end deftypefn
+
+@deftypefn {Built-in Function} long __builtin_expect (long @var{exp}, long @var{c})
+@opindex fprofile-arcs
+You may use @code{__builtin_expect} to provide the compiler with
branch prediction information. In general, you should prefer to
-use actual profile feedback for this (@samp{-fprofile-arcs}), as
+use actual profile feedback for this (@option{-fprofile-arcs}), as
programmers are notoriously bad at predicting how their programs
actually perform. However, there are applications in which this
data is hard to collect.
The return value is the value of @var{exp}, which should be an
integral expression. The value of @var{c} must be a compile-time
-constant. The semantics of the builtin are that it is expected
+constant. The semantics of the built-in are that it is expected
that @var{exp} == @var{c}. For example:
@smallexample
@@ -3770,7 +3926,7 @@ if (__builtin_expect (ptr != NULL, 1))
@noindent
when testing pointer or floating-point values.
-@end table
+@end deftypefn
@node C++ Extensions
@chapter Extensions to the C++ Language
@@ -3789,6 +3945,7 @@ Predefined Macros,cpp.info,The C Preprocessor}).
* Min and Max:: C++ Minimum and maximum operators.
* Volatiles:: What constitutes an access to a volatile object.
* Restricted Pointers:: C99 restricted pointers and references.
+* Vague Linkage:: Where G++ puts inlines, vtables and such.
* C++ Interface:: You can use a single C++ header file for both
declarations and definitions.
* Template Instantiation:: Methods for ensuring that exactly one copy of
@@ -3796,6 +3953,7 @@ Predefined Macros,cpp.info,The C Preprocessor}).
* Bound member functions:: You can extract a function pointer to the
method denoted by a @samp{->*} or @samp{.*} expression.
* C++ Attributes:: Variable, function, and type attributes for C++ only.
+* Java Exceptions:: Tweaking exception handling to work with Java.
* Deprecated Features:: Things might disappear from g++.
* Backwards Compatibility:: Compatibilities with earlier definitions of C++.
@end menu
@@ -3852,78 +4010,78 @@ works correctly.
@cindex volatile write
@cindex volatile access
-Both the C and C++ standard have the concept of volatile objects. These
-are normally accessed by pointers and used for accessing hardware. The
+Both the C and C++ standard have the concept of volatile objects. These
+are normally accessed by pointers and used for accessing hardware. The
standards encourage compilers to refrain from optimizations
concerning accesses to volatile objects that it might perform on
-non-volatile objects. The C standard leaves it implementation defined
-as to what constitutes a volatile access. The C++ standard omits to
+non-volatile objects. The C standard leaves it implementation defined
+as to what constitutes a volatile access. The C++ standard omits to
specify this, except to say that C++ should behave in a similar manner
-to C with respect to volatiles, where possible. The minimum either
+to C with respect to volatiles, where possible. The minimum either
standard specifies is that at a sequence point all previous accesses to
volatile objects have stabilized and no subsequent accesses have
-occurred. Thus an implementation is free to reorder and combine
+occurred. Thus an implementation is free to reorder and combine
volatile accesses which occur between sequence points, but cannot do so
-for accesses across a sequence point. The use of volatiles does not
+for accesses across a sequence point. The use of volatiles does not
allow you to violate the restriction on updating objects multiple times
within a sequence point.
In most expressions, it is intuitively obvious what is a read and what is
-a write. For instance
+a write. For instance
@example
-volatile int *dst = <somevalue>;
-volatile int *src = <someothervalue>;
+volatile int *dst = @var{somevalue};
+volatile int *src = @var{someothervalue};
*dst = *src;
@end example
@noindent
will cause a read of the volatile object pointed to by @var{src} and stores the
-value into the volatile object pointed to by @var{dst}. There is no
+value into the volatile object pointed to by @var{dst}. There is no
guarantee that these reads and writes are atomic, especially for objects
larger than @code{int}.
Less obvious expressions are where something which looks like an access
-is used in a void context. An example would be,
+is used in a void context. An example would be,
@example
-volatile int *src = <somevalue>;
+volatile int *src = @var{somevalue};
*src;
@end example
With C, such expressions are rvalues, and as rvalues cause a read of
-the object, gcc interprets this as a read of the volatile being pointed
-to. The C++ standard specifies that such expressions do not undergo
+the object, GCC interprets this as a read of the volatile being pointed
+to. The C++ standard specifies that such expressions do not undergo
lvalue to rvalue conversion, and that the type of the dereferenced
-object may be incomplete. The C++ standard does not specify explicitly
+object may be incomplete. The C++ standard does not specify explicitly
that it is this lvalue to rvalue conversion which is responsible for
-causing an access. However, there is reason to believe that it is,
-because otherwise certain simple expressions become undefined. However,
-because it would surprise most programmers, g++ treats dereferencing a
+causing an access. However, there is reason to believe that it is,
+because otherwise certain simple expressions become undefined. However,
+because it would surprise most programmers, G++ treats dereferencing a
pointer to volatile object of complete type in a void context as a read
-of the object. When the object has incomplete type, g++ issues a
+of the object. When the object has incomplete type, G++ issues a
warning.
@example
struct S;
struct T @{int m;@};
-volatile S *ptr1 = <somevalue>;
-volatile T *ptr2 = <somevalue>;
+volatile S *ptr1 = @var{somevalue};
+volatile T *ptr2 = @var{somevalue};
*ptr1;
*ptr2;
@end example
In this example, a warning is issued for @code{*ptr1}, and @code{*ptr2}
-causes a read of the object pointed to. If you wish to force an error on
+causes a read of the object pointed to. If you wish to force an error on
the first case, you must force a conversion to rvalue with, for instance
a static cast, @code{static_cast<S>(*ptr1)}.
-When using a reference to volatile, g++ does not treat equivalent
+When using a reference to volatile, G++ does not treat equivalent
expressions as accesses to volatiles, but instead issues a warning that
-no volatile is accessed. The rationale for this is that otherwise it
+no volatile is accessed. The rationale for this is that otherwise it
becomes difficult to determine where volatile access occur, and not
possible to ignore the return value from functions returning volatile
-references. Again, if you wish to force a read, cast the reference to
+references. Again, if you wish to force a read, cast the reference to
an rvalue.
@node Restricted Pointers
@@ -3934,7 +4092,7 @@ an rvalue.
As with gcc, g++ understands the C99 feature of restricted pointers,
specified with the @code{__restrict__}, or @code{__restrict} type
-qualifier. Because you cannot compile C++ by specifying the -std=c99
+qualifier. Because you cannot compile C++ by specifying the @option{-std=c99}
language flag, @code{restrict} is not a keyword in C++.
In addition to allowing restricted pointers, you can specify restricted
@@ -3964,17 +4122,94 @@ void T::fn () __restrict__
@noindent
Within the body of @code{T::fn}, @var{this} will have the effective
-definition @code{T *__restrict__ const this}. Notice that the
+definition @code{T *__restrict__ const this}. Notice that the
interpretation of a @code{__restrict__} member function qualifier is
different to that of @code{const} or @code{volatile} qualifier, in that it
-is applied to the pointer rather than the object. This is consistent with
+is applied to the pointer rather than the object. This is consistent with
other compilers which implement restricted pointers.
As with all outermost parameter qualifiers, @code{__restrict__} is
-ignored in function definition matching. This means you only need to
+ignored in function definition matching. This means you only need to
specify @code{__restrict__} in a function definition, rather than
in a function prototype as well.
+@node Vague Linkage
+@section Vague Linkage
+@cindex vague linkage
+
+There are several constructs in C++ which require space in the object
+file but are not clearly tied to a single translation unit. We say that
+these constructs have ``vague linkage''. Typically such constructs are
+emitted wherever they are needed, though sometimes we can be more
+clever.
+
+@table @asis
+@item Inline Functions
+Inline functions are typically defined in a header file which can be
+included in many different compilations. Hopefully they can usually be
+inlined, but sometimes an out-of-line copy is necessary, if the address
+of the function is taken or if inlining fails. In general, we emit an
+out-of-line copy in all translation units where one is needed. As an
+exception, we only emit inline virtual functions with the vtable, since
+it will always require a copy.
+
+Local static variables and string constants used in an inline function
+are also considered to have vague linkage, since they must be shared
+between all inlined and out-of-line instances of the function.
+
+@item VTables
+@cindex vtable
+C++ virtual functions are implemented in most compilers using a lookup
+table, known as a vtable. The vtable contains pointers to the virtual
+functions provided by a class, and each object of the class contains a
+pointer to its vtable (or vtables, in some multiple-inheritance
+situations). If the class declares any non-inline, non-pure virtual
+functions, the first one is chosen as the ``key method'' for the class,
+and the vtable is only emitted in the translation unit where the key
+method is defined.
+
+@emph{Note:} If the chosen key method is later defined as inline, the
+vtable will still be emitted in every translation unit which defines it.
+Make sure that any inline virtuals are declared inline in the class
+body, even if they are not defined there.
+
+@item type_info objects
+@cindex type_info
+@cindex RTTI
+C++ requires information about types to be written out in order to
+implement @samp{dynamic_cast}, @samp{typeid} and exception handling.
+For polymorphic classes (classes with virtual functions), the type_info
+object is written out along with the vtable so that @samp{dynamic_cast}
+can determine the dynamic type of a class object at runtime. For all
+other types, we write out the type_info object when it is used: when
+applying @samp{typeid} to an expression, throwing an object, or
+referring to a type in a catch clause or exception specification.
+
+@item Template Instantiations
+Most everything in this section also applies to template instantiations,
+but there are other options as well.
+@xref{Template Instantiation,,Where's the Template?}.
+
+@end table
+
+When used with GNU ld version 2.8 or later on an ELF system such as
+Linux/GNU or Solaris 2, or on Microsoft Windows, duplicate copies of
+these constructs will be discarded at link time. This is known as
+COMDAT support.
+
+On targets that don't support COMDAT, but do support weak symbols, GCC
+will use them. This way one copy will override all the others, but
+the unused copies will still take up space in the executable.
+
+For targets which do not support either COMDAT or weak symbols,
+most entities with vague linkage will be emitted as local symbols to
+avoid duplicate definition errors from the linker. This will not happen
+for local statics in inlines, however, as having multiple copies will
+almost certainly break things.
+
+@xref{C++ Interface,,Declarations and Definitions in One Header}, for
+another way to control placement of these constructs.
+
@node C++ Interface
@section Declarations and Definitions in One Header
@@ -4081,12 +4316,13 @@ an explicit @code{extern} declaration---the compiler emits no code at
all to define an independent version of the function. Its definition
is used only for inlining with its callers.
+@opindex fno-implement-inlines
Conversely, when you include the same header file in a main source file
that declares it as @samp{#pragma implementation}, the compiler emits
code for the function itself; this defines a version of the function
that can be found via pointers (or by callers compiled without
inlining). If all calls to the function can be inlined, you can avoid
-emitting the function by compiling with @samp{-fno-implement-inlines}.
+emitting the function by compiling with @option{-fno-implement-inlines}.
If any calls were not inlined, you will get linker errors.
@node Template Instantiation
@@ -4152,7 +4388,8 @@ template instantiations:
@enumerate
@item
-Compile your template-using code with @samp{-frepo}. The compiler will
+@opindex frepo
+Compile your template-using code with @option{-frepo}. The compiler will
generate files with the extension @samp{.rpo} listing all of the
template instantiations used in the corresponding object files which
could be instantiated there; the link wrapper, @samp{collect2}, will
@@ -4176,7 +4413,8 @@ For greater control, use explicit instantiation as described in the next
option.
@item
-Compile your code with @samp{-fno-implicit-templates} to disable the
+@opindex fno-implicit-templates
+Compile your code with @option{-fno-implicit-templates} to disable the
implicit generation of template instances, and explicitly instantiate
all the ones you use. This approach requires more knowledge of exactly
which instances you need than do the others, but it's less
@@ -4200,18 +4438,18 @@ for each of the instances you need, and create a template instantiation
library from those.
If you are using Cfront-model code, you can probably get away with not
-using @samp{-fno-implicit-templates} when compiling files that don't
+using @option{-fno-implicit-templates} when compiling files that don't
@samp{#include} the member template definitions.
If you use one big file to do the instantiations, you may want to
-compile it without @samp{-fno-implicit-templates} so you get all of the
+compile it without @option{-fno-implicit-templates} so you get all of the
instances required by your explicit instantiations (but not by any
other files) without having to specify them as well.
g++ has extended the template instantiation syntax outlined in the
Working Paper to allow forward declaration of explicit instantiations
(with @code{extern}), instantiation of the compiler support data for a
-template class (i.e. the vtable) without instantiating any of its
+template class (i.e.@: the vtable) without instantiating any of its
members (with @code{inline}), and instantiation of only the static data
members of a template class, without the support data or member
functions (with (@code{static}):
@@ -4230,12 +4468,13 @@ uses. In a large program, this can lead to an unacceptable amount of code
duplication.
@item
+@opindex fexternal-templates
Add @samp{#pragma interface} to all files containing template
definitions. For each of these files, add @samp{#pragma implementation
"@var{filename}"} to the top of some @samp{.C} file which
@samp{#include}s it. Then compile everything with
-@samp{-fexternal-templates}. The templates will then only be expanded
-in the translation unit which implements them (i.e. has a @samp{#pragma
+@option{-fexternal-templates}. The templates will then only be expanded
+in the translation unit which implements them (i.e.@: has a @samp{#pragma
implementation} line for the file where they live); all other files will
use external references. If you're lucky, everything should work
properly. If you get undefined symbol errors, you need to make sure
@@ -4254,8 +4493,9 @@ using code written for the Cfront model, the file containing a class
template and the file containing its member templates should be
implemented in the same translation unit.
+@opindex falt-external-templates
A slight variation on this approach is to instead use the flag
-@samp{-falt-external-templates}; this flag causes template
+@option{-falt-external-templates}; this flag causes template
instances to be emitted in the translation unit that implements the
header where they are first instantiated, rather than the one which
implements the file where the templates are defined. This header must
@@ -4284,7 +4524,7 @@ the inner loop, to save a bit of time.
Note that you will still be paying the penalty for the call through a
function pointer; on most modern architectures, such a call defeats the
-branch prediction features of the CPU. This is also true of normal
+branch prediction features of the CPU@. This is also true of normal
virtual function calls.
The syntax for this extension is
@@ -4297,15 +4537,16 @@ typedef int (*fptr)(A *);
fptr p = (fptr)(a.*fp);
@end example
-For PMF constants (i.e. expressions of the form @samp{&Klasse::Member}),
-no object is needed to obtain the address of the function. They can be
+For PMF constants (i.e.@: expressions of the form @samp{&Klasse::Member}),
+no object is needed to obtain the address of the function. They can be
converted to function pointers directly:
@example
fptr p1 = (fptr)(&A::foo);
@end example
-You must specify @samp{-Wno-pmf-conversions} to use this extension.
+@opindex Wno-pmf-conversions
+You must specify @option{-Wno-pmf-conversions} to use this extension.
@node C++ Attributes
@section C++-Specific Variable, Function, and Type Attributes
@@ -4321,7 +4562,7 @@ In Standard C++, objects defined at namespace scope are guaranteed to be
initialized in an order in strict accordance with that of their definitions
@emph{in a given translation unit}. No guarantee is made for initializations
across translation units. However, GNU C++ allows users to control the
-order of initialization of objects defined at namespace socpe with the
+order of initialization of objects defined at namespace scope with the
@code{init_priority} attribute by specifying a relative @var{priority},
a constant integral expression currently bounded between 101 and 65535
inclusive. Lower numbers indicate a higher priority.
@@ -4339,32 +4580,59 @@ Note that the particular values of @var{priority} do not matter; only their
relative ordering.
-@item com_interface
-@cindex com_interface attribute
+@item java_interface
+@cindex java_interface attribute
-@c This is based on: 1) grepping the code,
-@c 2) http://gcc.gnu.org/ml/gcc-bugs/1999-08n/msg01212.html
-@c 3) http://gcc.gnu.org/ml/gcc-bugs/1999-08n/msg01215.html
-@c and 4) a lot of guesswork. You can tell I don't use COM. -pme 21Dec00
-
-This type attribute takes no parameters, and marks a class or struct as an
-interface for communication via COM; the class will support the COM ABI
-rather than the full C++ ABI. Currently this means that RTTI is not possible
-with the resulting class heirarchy. The virtual pointer table will be
-changed to be COM-compliant. Also, all classes and structs derived from one
-marked with this attribute are implicitly marked with the same attribute;
-thus, only the base class in a COM hierarchy needs @code{com_interface}.
+This type attribute informs C++ that the class is a Java interface. It may
+only be applied to classes declared within an @code{extern "Java"} block.
+Calls to methods declared in this interface will be dispatched using GCJ's
+interface table mechanism, instead of regular virtual table dispatch.
@end table
+@node Java Exceptions
+@section Java Exceptions
+
+The Java language uses a slightly different exception handling model
+from C++. Normally, GNU C++ will automatically detect when you are
+writing C++ code that uses Java exceptions, and handle them
+appropriately. However, if C++ code only needs to execute destructors
+when Java exceptions are thrown through it, GCC will guess incorrectly.
+Sample problematic code:
+
+@example
+ struct S @{ ~S(); @};
+ extern void bar(); // is implemented in Java and may throw exceptions
+ void foo()
+ @{
+ S s;
+ bar();
+ @}
+@end example
+
+@noindent
+The usual effect of an incorrect guess is a link failure, complaining of
+a missing routine called @samp{__gxx_personality_v0}.
+
+You can inform the compiler that Java exceptions are to be used in a
+translation unit, irrespective of what it might think, by writing
+@samp{@w{#pragma GCC java_exceptions}} at the head of the file. This
+@samp{#pragma} must appear before any functions that throw or catch
+exceptions, or run destructors when exceptions are thrown through them.
+
+You cannot mix Java and C++ exceptions in the same translation unit. It
+is believed to be safe to throw a C++ exception from one file through
+another file compiled for the for the Java exception model, or vice
+versa, but there may be bugs in this area.
+
@node Deprecated Features
@section Deprecated Features
In the past, the GNU C++ compiler was extended to experiment with new
-features, at a time when the C++ language was still evolving. Now that
+features, at a time when the C++ language was still evolving. Now that
the C++ standard is complete, some of those features are superseded by
-superior alternatives. Using the old features might cause a warning in
-some cases that the feature will be dropped in the future. In other
+superior alternatives. Using the old features might cause a warning in
+some cases that the feature will be dropped in the future. In other
cases, the feature might be gone already.
While the list below is not exhaustive, it documents some of the options
@@ -4374,47 +4642,53 @@ that are now deprecated:
@item -fexternal-templates
@itemx -falt-external-templates
These are two of the many ways for g++ to implement template
-instantiation. @xref{Template Instantiation}. The C++ standard clearly
+instantiation. @xref{Template Instantiation}. The C++ standard clearly
defines how template definitions have to be organized across
-implementation units. g++ has an implicit instantiation mechanism that
+implementation units. g++ has an implicit instantiation mechanism that
should work just fine for standard-conforming code.
@item -fstrict-prototype
@itemx -fno-strict-prototype
Previously it was possible to use an empty prototype parameter list to
indicate an unspecified number of parameters (like C), rather than no
-parameters, as C++ demands. This feature has been removed, except where
+parameters, as C++ demands. This feature has been removed, except where
it is required for backwards compatibility @xref{Backwards Compatibility}.
@end table
The named return value extension has been deprecated, and will be
removed from g++ at some point.
+The use of initializer lists with new expressions has been deprecated,
+and will be removed from g++ at some point.
+
+Floating point and complex template constant parameters are deprecated,
+and will be removed from g++ at some point.
+
@node Backwards Compatibility
@section Backwards Compatibility
@cindex Backwards Compatibility
@cindex ARM [Annotated C++ Reference Manual]
-Now that there is a definitive ISO standard C++, g++ has a specification
-to adhere to. The C++ language evolved over time, and features that
+Now that there is a definitive ISO standard C++, G++ has a specification
+to adhere to. The C++ language evolved over time, and features that
used to be acceptable in previous drafts of the standard, such as the ARM
-[Annotated C++ Reference Manual], are no longer accepted. In order to allow
-compilation of C++ written to such drafts, g++ contains some backwards
-compatibilities. @emph{All such backwards compatibility features are
-liable to disappear in future versions of g++.} They should be considered
+[Annotated C++ Reference Manual], are no longer accepted. In order to allow
+compilation of C++ written to such drafts, G++ contains some backwards
+compatibilities. @emph{All such backwards compatibility features are
+liable to disappear in future versions of G++.} They should be considered
deprecated @xref{Deprecated Features}.
@table @code
@item For scope
If a variable is declared at for scope, it used to remain in scope until
the end of the scope which contained the for statement (rather than just
-within the for scope). g++ retains this, but issues a warning, if such a
+within the for scope). G++ retains this, but issues a warning, if such a
variable is accessed outside the for scope.
@item implicit C language
-Old C system header files did not contain an @code{extern "C" @{...@}}
-scope to set the language. On such systems, all header files are
-implicitly scoped inside a C language scope. Also, an empty prototype
+Old C system header files did not contain an @code{extern "C" @{@dots{}@}}
+scope to set the language. On such systems, all header files are
+implicitly scoped inside a C language scope. Also, an empty prototype
@code{()} will be treated as an unspecified number of arguments, rather
than no arguments, as C++ demands.
@end table
diff --git a/gcc/doc/fsf-funding.7 b/gcc/doc/fsf-funding.7
new file mode 100644
index 00000000000..36126da2414
--- /dev/null
+++ b/gcc/doc/fsf-funding.7
@@ -0,0 +1,185 @@
+.\" Automatically generated by Pod::Man v1.32, Pod::Parser v1.13
+.\"
+.\" Standard preamble:
+.\" ========================================================================
+.de Sh \" Subsection heading
+.br
+.if t .Sp
+.ne 5
+.PP
+\fB\\$1\fR
+.PP
+..
+.de Sp \" Vertical space (when we can't use .PP)
+.if t .sp .5v
+.if n .sp
+..
+.de Vb \" Begin verbatim text
+.ft CW
+.nf
+.ne \\$1
+..
+.de Ve \" End verbatim text
+.ft R
+.fi
+..
+.\" Set up some character translations and predefined strings. \*(-- will
+.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
+.\" double quote, and \*(R" will give a right double quote. | will give a
+.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to
+.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C'
+.\" expand to `' in nroff, nothing in troff, for use with C<>.
+.tr \(*W-|\(bv\*(Tr
+.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
+.ie n \{\
+. ds -- \(*W-
+. ds PI pi
+. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
+. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
+. ds L" ""
+. ds R" ""
+. ds C` ""
+. ds C' ""
+'br\}
+.el\{\
+. ds -- \|\(em\|
+. ds PI \(*p
+. ds L" ``
+. ds R" ''
+'br\}
+.\"
+.\" If the F register is turned on, we'll generate index entries on stderr for
+.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
+.\" entries marked with X<> in POD. Of course, you'll have to process the
+.\" output yourself in some meaningful fashion.
+.if \nF \{\
+. de IX
+. tm Index:\\$1\t\\n%\t"\\$2"
+..
+. nr % 0
+. rr F
+.\}
+.\"
+.\" For nroff, turn off justification. Always turn off hyphenation; it makes
+.\" way too many mistakes in technical documents.
+.hy 0
+.if n .na
+.\"
+.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
+.\" Fear. Run. Save yourself. No user-serviceable parts.
+. \" fudge factors for nroff and troff
+.if n \{\
+. ds #H 0
+. ds #V .8m
+. ds #F .3m
+. ds #[ \f1
+. ds #] \fP
+.\}
+.if t \{\
+. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
+. ds #V .6m
+. ds #F 0
+. ds #[ \&
+. ds #] \&
+.\}
+. \" simple accents for nroff and troff
+.if n \{\
+. ds ' \&
+. ds ` \&
+. ds ^ \&
+. ds , \&
+. ds ~ ~
+. ds /
+.\}
+.if t \{\
+. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
+. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
+. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
+. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
+. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
+. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
+.\}
+. \" troff and (daisy-wheel) nroff accents
+.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
+.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
+.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
+.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
+.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
+.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
+.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
+.ds ae a\h'-(\w'a'u*4/10)'e
+.ds Ae A\h'-(\w'A'u*4/10)'E
+. \" corrections for vroff
+.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
+.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
+. \" for low resolution devices (crt and lpr)
+.if \n(.H>23 .if \n(.V>19 \
+\{\
+. ds : e
+. ds 8 ss
+. ds o a
+. ds d- d\h'-1'\(ga
+. ds D- D\h'-1'\(hy
+. ds th \o'bp'
+. ds Th \o'LP'
+. ds ae ae
+. ds Ae AE
+.\}
+.rm #[ #] #H #V #F C
+.\" ========================================================================
+.\"
+.IX Title "FSF-FUNDING 7"
+.TH FSF-FUNDING 7 "2002-01-26" "gcc-3.0.4" "GNU"
+.SH "NAME"
+fsf\-funding \- Funding Free Software
+.SH "DESCRIPTION"
+.IX Header "DESCRIPTION"
+.Sh "Funding Free Software"
+.IX Subsection "Funding Free Software"
+If you want to have more free software a few years from now, it makes
+sense for you to help encourage people to contribute funds for its
+development. The most effective approach known is to encourage
+commercial redistributors to donate.
+.PP
+Users of free software systems can boost the pace of development by
+encouraging for-a-fee distributors to donate part of their selling price
+to free software developers\-\-\-the Free Software Foundation, and others.
+.PP
+The way to convince distributors to do this is to demand it and expect
+it from them. So when you compare distributors, judge them partly by
+how much they give to free software development. Show distributors
+they must compete to be the one who gives the most.
+.PP
+To make this approach work, you must insist on numbers that you can
+compare, such as, ``We will donate ten dollars to the Frobnitz project
+for each disk sold.'' Don't be satisfied with a vague promise, such as
+``A portion of the profits are donated,'' since it doesn't give a basis
+for comparison.
+.PP
+Even a precise fraction ``of the profits from this disk'' is not very
+meaningful, since creative accounting and unrelated business decisions
+can greatly alter what fraction of the sales price counts as profit.
+If the price you pay is \f(CW$50\fR, ten percent of the profit is probably
+less than a dollar; it might be a few cents, or nothing at all.
+.PP
+Some redistributors do development work themselves. This is useful too;
+but to keep everyone honest, you need to inquire how much they do, and
+what kind. Some kinds of development make much more long-term
+difference than others. For example, maintaining a separate version of
+a program contributes very little; maintaining the standard version of a
+program for the whole community contributes much. Easy new ports
+contribute little, since someone else would surely do them; difficult
+ports such as adding a new \s-1CPU\s0 to the \s-1GNU\s0 Compiler Collection contribute more;
+major new features or packages contribute the most.
+.PP
+By establishing the idea that supporting further development is ``the
+proper thing to do'' when distributing free software for a fee, we can
+assure a steady flow of resources into making more free software.
+.SH "SEE ALSO"
+.IX Header "SEE ALSO"
+\&\fIgpl\fR\|(7), \fIgfdl\fR\|(7).
+.SH "COPYRIGHT"
+.IX Header "COPYRIGHT"
+Copyright (c) 1994 Free Software Foundation, Inc.
+Verbatim copying and redistribution of this section is permitted
+without royalty; alteration is not permitted.
diff --git a/gcc/gcc.1 b/gcc/doc/gcc.1
index c78214a4112..9004e862248 100644
--- a/gcc/gcc.1
+++ b/gcc/doc/gcc.1
@@ -1,8 +1,7 @@
-.\" Automatically generated by Pod::Man version 1.1
-.\" Wed Jan 24 19:43:11 2001
+.\" Automatically generated by Pod::Man v1.32, Pod::Parser v1.13
.\"
.\" Standard preamble:
-.\" ======================================================================
+.\" ========================================================================
.de Sh \" Subsection heading
.br
.if t .Sp
@@ -15,12 +14,6 @@
.if t .sp .5v
.if n .sp
..
-.de Ip \" List item
-.br
-.ie \\n(.$>=3 .ne \\$3
-.el .ne 3
-.IP "\\$1" \\$2
-..
.de Vb \" Begin verbatim text
.ft CW
.nf
@@ -28,15 +21,14 @@
..
.de Ve \" End verbatim text
.ft R
-
.fi
..
.\" Set up some character translations and predefined strings. \*(-- will
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
.\" double quote, and \*(R" will give a right double quote. | will give a
-.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used
-.\" to do unbreakable dashes and therefore won't be available. \*(C` and
-.\" \*(C' expand to `' in nroff, nothing in troff, for use with C<>
+.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to
+.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C'
+.\" expand to `' in nroff, nothing in troff, for use with C<>.
.tr \(*W-|\(bv\*(Tr
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.ie n \{\
@@ -56,10 +48,10 @@
. ds R" ''
'br\}
.\"
-.\" If the F register is turned on, we'll generate index entries on stderr
-.\" for titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and
-.\" index entries marked with X<> in POD. Of course, you'll have to process
-.\" the output yourself in some meaningful fashion.
+.\" If the F register is turned on, we'll generate index entries on stderr for
+.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
+.\" entries marked with X<> in POD. Of course, you'll have to process the
+.\" output yourself in some meaningful fashion.
.if \nF \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
@@ -68,14 +60,13 @@
. rr F
.\}
.\"
-.\" For nroff, turn off justification. Always turn off hyphenation; it
-.\" makes way too many mistakes in technical documents.
+.\" For nroff, turn off justification. Always turn off hyphenation; it makes
+.\" way too many mistakes in technical documents.
.hy 0
.if n .na
.\"
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
.\" Fear. Run. Save yourself. No user-serviceable parts.
-.bd B 3
. \" fudge factors for nroff and troff
.if n \{\
. ds #H 0
@@ -135,13 +126,12 @@
. ds Ae AE
.\}
.rm #[ #] #H #V #F C
-.\" ======================================================================
+.\" ========================================================================
.\"
.IX Title "GCC 1"
-.TH GCC 1 "gcc-2.97" "2001-01-24" "GNU"
-.UC
+.TH GCC 1 "2002-01-31" "gcc-3.0.4" "GNU"
.SH "NAME"
-gcc \- \s-1GNU\s0 project C and \*(C+ compiler
+gcc \- GNU project C and C++ compiler
.SH "SYNOPSIS"
.IX Header "SYNOPSIS"
gcc [\fB\-c\fR|\fB\-S\fR|\fB\-E\fR] [\fB\-std=\fR\fIstandard\fR]
@@ -183,10 +173,10 @@ of the same kind; for example, if you specify \fB\-L\fR more than once,
the directories are searched in the order specified.
.PP
Many options have long names starting with \fB\-f\fR or with
-\&\fB\-W\fR\-\-\-for example, \fB\-fforce-mem\fR,
-\&\fB\-fstrength-reduce\fR, \fB\-Wformat\fR and so on. Most of
+\&\fB\-W\fR\-\-\-for example, \fB\-fforce\-mem\fR,
+\&\fB\-fstrength\-reduce\fR, \fB\-Wformat\fR and so on. Most of
these have both positive and negative forms; the negative form of
-\&\fB\-ffoo\fR would be \fB\-fno-foo\fR. This manual documents
+\&\fB\-ffoo\fR would be \fB\-fno\-foo\fR. This manual documents
only one of these two forms, whichever one is not the default.
.SH "OPTIONS"
.IX Header "OPTIONS"
@@ -194,144 +184,157 @@ only one of these two forms, whichever one is not the default.
.IX Subsection "Option Summary"
Here is a summary of all the options, grouped by type. Explanations are
in the following sections.
-.Ip "\fIOverall Options\fR" 4
+.IP "\fIOverall Options\fR" 4
.IX Item "Overall Options"
-\&\fB\-c \-S \-E \-o\fR \fIfile\fR \fB\-pipe \-pass-exit-codes \-x\fR \fIlanguage\fR
-\&\fB\-v \-\-target-help \-\-help\fR
-.Ip "\fIC Language Options\fR" 4
+\&\fB\-c \-S \-E \-o\fR \fIfile\fR \fB\-pipe \-pass\-exit\-codes \-x\fR \fIlanguage\fR
+\&\fB\-v \-\-target\-help \-\-help\fR
+.IP "\fIC Language Options\fR" 4
.IX Item "C Language Options"
-\&\fB\-ansi \-std=\fR\fIstandard\fR \fB\-fno-asm \-fno-builtin
+\&\fB\-ansi \-std=\fR\fIstandard\fR \fB\-aux\-info\fR \fIfilename\fR
+\&\fB\-fno\-asm \-fno\-builtin
\&\-fhosted \-ffreestanding
-\&\-trigraphs \-traditional \-traditional-cpp
-\&\-fallow-single-precision \-fcond-mismatch
-\&\-fsigned-bitfields \-fsigned-char
-\&\-funsigned-bitfields \-funsigned-char
-\&\-fwritable-strings \-fshort-wchar\fR
-.Ip "\fI\*(C+ Language Options\fR" 4
+\&\-trigraphs \-traditional \-traditional\-cpp
+\&\-fallow\-single\-precision \-fcond\-mismatch
+\&\-fsigned\-bitfields \-fsigned\-char
+\&\-funsigned\-bitfields \-funsigned\-char
+\&\-fwritable\-strings \-fshort\-wchar\fR
+.IP "\fI\*(C+ Language Options\fR" 4
.IX Item " Language Options"
-\&\fB\-fno-access-control \-fcheck-new \-fconserve-space
-\&\-fdollars-in-identifiers \-fno-elide-constructors
-\&\-fno-enforce-eh-specs \-fexternal-templates
-\&\-falt-external-templates
-\&\-ffor-scope \-fno-for-scope \-fno-gnu-keywords \-fhonor-std
-\&\-fhuge-objects \-fno-implicit-templates
-\&\-fno-implicit-inline-templates
-\&\-fno-implement-inlines \-fms-extensions
-\&\-fname-mangling-version-\fR\fIn\fR \fB\-fno-operator-names
-\&\-fno-optional-diags \-fpermissive
-\&\-frepo \-fno-rtti \-fsquangle \-ftemplate-depth-\fR\fIn\fR
-\&\fB\-fuse-cxa-atexit \-fvtable-thunks \-nostdinc++
-\&\-fno-default-inline \-Wctor-dtor-privacy
-\&\-Wnon-virtual-dtor \-Wreorder
-\&\-Weffc++ \-Wno-deprecated
-\&\-Wno-non-template-friend \-Wold-style-cast
-\&\-Woverloaded-virtual \-Wno-pmf-conversions
-\&\-Wsign-promo \-Wsynth\fR
-.Ip "\fILanguage Independent Options\fR" 4
+\&\fB\-fno\-access\-control \-fcheck\-new \-fconserve\-space
+\&\-fno\-const\-strings \-fdollars\-in\-identifiers
+\&\-fno\-elide\-constructors
+\&\-fno\-enforce\-eh\-specs \-fexternal\-templates
+\&\-falt\-external\-templates
+\&\-ffor\-scope \-fno\-for\-scope \-fno\-gnu\-keywords
+\&\-fno\-implicit\-templates
+\&\-fno\-implicit\-inline\-templates
+\&\-fno\-implement\-inlines \-fms\-extensions
+\&\-fno\-nonansi\-builtins \-fno\-operator\-names
+\&\-fno\-optional\-diags \-fpermissive
+\&\-frepo \-fno\-rtti \-fstats \-ftemplate\-depth\-\fR\fIn\fR
+\&\fB\-fuse\-cxa\-atexit \-fno\-weak \-nostdinc++
+\&\-fno\-default\-inline \-Wctor\-dtor\-privacy
+\&\-Wnon\-virtual\-dtor \-Wreorder
+\&\-Weffc++ \-Wno\-deprecated
+\&\-Wno\-non\-template\-friend \-Wold\-style\-cast
+\&\-Woverloaded\-virtual \-Wno\-pmf\-conversions
+\&\-Wsign\-promo \-Wsynth\fR
+.IP "\fIObjective-C Language Options\fR" 4
+.IX Item "Objective-C Language Options"
+\&\fB\-fconstant\-string\-class=\fR\fIclass-name\fR
+\&\fB\-fgnu\-runtime \-fnext\-runtime \-gen\-decls
+\&\-Wno\-protocol \-Wselector\fR
+.IP "\fILanguage Independent Options\fR" 4
.IX Item "Language Independent Options"
-\&\fB\-fmessage-length=\fR\fIn\fR
-\&\fB\-fdiagnostics-show-location=\fR[\fBonce\fR|\fBevery-line\fR]
-.Ip "\fIWarning Options\fR" 4
+\&\fB\-fmessage\-length=\fR\fIn\fR
+\&\fB\-fdiagnostics\-show\-location=\fR[\fBonce\fR|\fBevery-line\fR]
+.IP "\fIWarning Options\fR" 4
.IX Item "Warning Options"
-\&\fB\-fsyntax-only \-pedantic \-pedantic-errors
-\&\-w \-W \-Wall \-Waggregate-return
-\&\-Wcast-align \-Wcast-qual \-Wchar-subscripts \-Wcomment
-\&\-Wconversion \-Wdisabled-optimization \-Werror
-\&\-Wfloat-equal \-Wformat \-Wformat=2
-\&\-Wformat-nonliteral \-Wformat-security
-\&\-Wid-clash-\fR\fIlen\fR \fB\-Wimplicit \-Wimplicit-int
-\&\-Wimplicit-function-declaration
-\&\-Werror-implicit-function-declaration
+\&\fB\-fsyntax\-only \-pedantic \-pedantic\-errors
+\&\-w \-W \-Wall \-Waggregate\-return
+\&\-Wcast\-align \-Wcast\-qual \-Wchar\-subscripts \-Wcomment
+\&\-Wconversion \-Wdisabled\-optimization \-Werror
+\&\-Wfloat\-equal \-Wformat \-Wformat=2
+\&\-Wformat\-nonliteral \-Wformat\-security
+\&\-Wid\-clash\-\fR\fIlen\fR \fB\-Wimplicit \-Wimplicit\-int
+\&\-Wimplicit\-function\-declaration
+\&\-Werror\-implicit\-function\-declaration
\&\-Wimport \-Winline
-\&\-Wlarger-than-\fR\fIlen\fR \fB\-Wlong-long
-\&\-Wmain \-Wmissing-declarations
-\&\-Wmissing-format-attribute \-Wmissing-noreturn
-\&\-Wmultichar \-Wno-format-extra-args \-Wno-format-y2k
-\&\-Wno-import \-Wpacked \-Wpadded
-\&\-Wparentheses \-Wpointer-arith \-Wredundant-decls
-\&\-Wreturn-type \-Wsequence-point \-Wshadow
-\&\-Wsign-compare \-Wswitch \-Wsystem-headers
+\&\-Wlarger\-than\-\fR\fIlen\fR \fB\-Wlong\-long
+\&\-Wmain \-Wmissing\-braces \-Wmissing\-declarations
+\&\-Wmissing\-format\-attribute \-Wmissing\-noreturn
+\&\-Wmultichar \-Wno\-format\-extra\-args \-Wno\-format\-y2k
+\&\-Wno\-import \-Wpacked \-Wpadded
+\&\-Wparentheses \-Wpointer\-arith \-Wredundant\-decls
+\&\-Wreturn\-type \-Wsequence\-point \-Wshadow
+\&\-Wsign\-compare \-Wswitch \-Wsystem\-headers
\&\-Wtrigraphs \-Wundef \-Wuninitialized
-\&\-Wunknown-pragmas \-Wunreachable-code
-\&\-Wunused \-Wunused-function \-Wunused-label \-Wunused-parameter
-\&\-Wunused-value \-Wunused-variable \-Wwrite-strings\fR
-.Ip "\fIC-only Warning Options\fR" 4
+\&\-Wunknown\-pragmas \-Wunreachable\-code
+\&\-Wunused \-Wunused\-function \-Wunused\-label \-Wunused\-parameter
+\&\-Wunused\-value \-Wunused\-variable \-Wwrite\-strings\fR
+.IP "\fIC\-only Warning Options\fR" 4
.IX Item "C-only Warning Options"
-\&\fB\-Wbad-function-cast \-Wmissing-prototypes \-Wnested-externs
-\&\-Wstrict-prototypes \-Wtraditional\fR
-.Ip "\fIDebugging Options\fR" 4
+\&\fB\-Wbad\-function\-cast \-Wmissing\-prototypes \-Wnested\-externs
+\&\-Wstrict\-prototypes \-Wtraditional\fR
+.IP "\fIDebugging Options\fR" 4
.IX Item "Debugging Options"
-\&\fB\-a \-ax \-d\fR\fIletters\fR \fB\-fdump-unnumbered \-fdump-translation-unit-\fR\fIfile\fR
-\&\fB\-fpretend-float \-fprofile-arcs \-ftest-coverage
-\&\-g \-g\fR\fIlevel\fR \fB\-gcoff \-gdwarf \-gdwarf-1 \-gdwarf-1+ \-gdwarf-2
+\&\fB\-a \-ax \-d\fR\fIletters\fR \fB\-dumpspecs \-dumpmachine \-dumpversion
+\&\-fdump\-unnumbered \-fdump\-translation\-unit\fR[\fB\-\fR\fIn\fR]
+\&\fB\-fdump\-class\-hierarchy\fR[\fB\-\fR\fIn\fR]
+\&\fB\-fdump\-ast\-original\fR[\fB\-\fR\fIn\fR] \fB\-fdump\-ast\-optimized\fR[\fB\-\fR\fIn\fR]
+\&\fB\-fmem\-report \-fpretend\-float
+\&\-fprofile\-arcs \-ftest\-coverage \-ftime\-report
+\&\-g \-g\fR\fIlevel\fR \fB\-gcoff \-gdwarf \-gdwarf\-1 \-gdwarf\-1+ \-gdwarf\-2
\&\-ggdb \-gstabs \-gstabs+ \-gxcoff \-gxcoff+
-\&\-p \-pg \-print-file-name=\fR\fIlibrary\fR \fB\-print-libgcc-file-name
-\&\-print-prog-name=\fR\fIprogram\fR \fB\-print-search-dirs \-Q
-\&\-save-temps \-time\fR
-.Ip "\fIOptimization Options\fR" 4
+\&\-p \-pg \-print\-file\-name=\fR\fIlibrary\fR \fB\-print\-libgcc\-file\-name
+\&\-print\-multi\-directory \-print\-multi\-lib
+\&\-print\-prog\-name=\fR\fIprogram\fR \fB\-print\-search\-dirs \-Q
+\&\-save\-temps \-time\fR
+.IP "\fIOptimization Options\fR" 4
.IX Item "Optimization Options"
-\&\fB\-falign-functions=\fR\fIn\fR \fB\-falign-jumps=\fR\fIn\fR
-\&\fB\-falign-labels=\fR\fIn\fR \fB\-falign-loops=\fR\fIn\fR
-\&\fB\-fbranch-probabilities \-fcaller-saves
-\&\-fcse-follow-jumps \-fcse-skip-blocks \-fdata-sections \-fdce
-\&\-fdelayed-branch \-fdelete-null-pointer-checks
-\&\-fexpensive-optimizations \-ffast-math \-ffloat-store
-\&\-fforce-addr \-fforce-mem \-ffunction-sections \-fgcse
-\&\-finline-functions \-finline-limit=\fR\fIn\fR \fB\-fkeep-inline-functions
-\&\-fkeep-static-consts \-fmove-all-movables
-\&\-fno-default-inline \-fno-defer-pop
-\&\-fno-function-cse \-fno-guess-branch-probability
-\&\-fno-inline \-fno-math-errno \-fno-peephole
-\&\-fomit-frame-pointer \-foptimize-register-move
-\&\-foptimize-sibling-calls \-freduce-all-givs
-\&\-fregmove \-frename-registers
-\&\-frerun-cse-after-loop \-frerun-loop-opt
-\&\-fschedule-insns \-fschedule-insns2
-\&\-fsingle-precision-constant \-fssa
-\&\-fstrength-reduce \-fstrict-aliasing \-fthread-jumps \-ftrapv
-\&\-funroll-all-loops \-funroll-loops
-\&\-O \-O0 \-O1 \-O2 \-O3 \-Os\fR
-.Ip "\fIPreprocessor Options\fR" 4
+\&\fB\-falign\-functions=\fR\fIn\fR \fB\-falign\-jumps=\fR\fIn\fR
+\&\fB\-falign\-labels=\fR\fIn\fR \fB\-falign\-loops=\fR\fIn\fR
+\&\fB\-fbranch\-probabilities \-fcaller\-saves
+\&\-fcse\-follow\-jumps \-fcse\-skip\-blocks \-fdata\-sections \-fdce
+\&\-fdelayed\-branch \-fdelete\-null\-pointer\-checks
+\&\-fexpensive\-optimizations \-ffast\-math \-ffloat\-store
+\&\-fforce\-addr \-fforce\-mem \-ffunction\-sections \-fgcse
+\&\-finline\-functions \-finline\-limit=\fR\fIn\fR \fB\-fkeep\-inline\-functions
+\&\-fkeep\-static\-consts \-fmove\-all\-movables
+\&\-fno\-default\-inline \-fno\-defer\-pop
+\&\-fno\-function\-cse \-fno\-guess\-branch\-probability
+\&\-fno\-inline \-fno\-math\-errno \-fno\-peephole \-fno\-peephole2
+\&\-fomit\-frame\-pointer \-foptimize\-register\-move
+\&\-foptimize\-sibling\-calls \-freduce\-all\-givs
+\&\-fregmove \-frename\-registers
+\&\-frerun\-cse\-after\-loop \-frerun\-loop\-opt
+\&\-fschedule\-insns \-fschedule\-insns2
+\&\-fsingle\-precision\-constant \-fssa
+\&\-fstrength\-reduce \-fstrict\-aliasing \-fthread\-jumps \-ftrapv
+\&\-funroll\-all\-loops \-funroll\-loops
+\&\-\-param\fR \fIname\fR\fB=\fR\fIvalue\fR
+\&\fB\-O \-O0 \-O1 \-O2 \-O3 \-Os\fR
+.IP "\fIPreprocessor Options\fR" 4
.IX Item "Preprocessor Options"
-\&\fB\-$ \-A\fR\fIquestion\fR\fB=\fR\fIanswer\fR \fB\-A-\fR\fIquestion\fR[\fB=\fR\fIanswer\fR]
+\&\fB\-$ \-A\fR\fIquestion\fR\fB=\fR\fIanswer\fR \fB\-A\-\fR\fIquestion\fR[\fB=\fR\fIanswer\fR]
\&\fB\-C \-dD \-dI \-dM \-dN
\&\-D\fR\fImacro\fR[\fB=\fR\fIdefn\fR] \fB\-E \-H
\&\-idirafter\fR \fIdir\fR
\&\fB\-include\fR \fIfile\fR \fB\-imacros\fR \fIfile\fR
\&\fB\-iprefix\fR \fIfile\fR \fB\-iwithprefix\fR \fIdir\fR
-\&\fB\-iwithprefixbefore\fR \fIdir\fR \fB\-isystem\fR \fIdir\fR \fB\-isystem-c++\fR \fIdir\fR
+\&\fB\-iwithprefixbefore\fR \fIdir\fR \fB\-isystem\fR \fIdir\fR
\&\fB\-M \-MM \-MF \-MG \-MP \-MQ \-MT \-nostdinc \-P \-remap
\&\-trigraphs \-undef \-U\fR\fImacro\fR \fB\-Wp,\fR\fIoption\fR
-.Ip "\fIAssembler Option\fR" 4
+.IP "\fIAssembler Option\fR" 4
.IX Item "Assembler Option"
\&\fB\-Wa,\fR\fIoption\fR
-.Ip "\fILinker Options\fR" 4
+.IP "\fILinker Options\fR" 4
.IX Item "Linker Options"
\&\fB
\&\fR\fIobject-file-name\fR \fB\-l\fR\fIlibrary\fR
\&\fB\-nostartfiles \-nodefaultlibs \-nostdlib
-\&\-s \-static \-static-libgcc \-shared \-shared-libgcc \-symbolic
+\&\-s \-static \-static\-libgcc \-shared \-shared\-libgcc \-symbolic
\&\-Wl,\fR\fIoption\fR \fB\-Xlinker\fR \fIoption\fR
\&\fB\-u\fR \fIsymbol\fR
-.Ip "\fIDirectory Options\fR" 4
+.IP "\fIDirectory Options\fR" 4
.IX Item "Directory Options"
-\&\fB\-B\fR\fIprefix\fR \fB\-I\fR\fIdir\fR \fB\-I- \-L\fR\fIdir\fR \fB\-specs=\fR\fIfile\fR
-.Ip "\fITarget Options\fR" 4
+\&\fB\-B\fR\fIprefix\fR \fB\-I\fR\fIdir\fR \fB\-I\- \-L\fR\fIdir\fR \fB\-specs=\fR\fIfile\fR
+.IP "\fITarget Options\fR" 4
.IX Item "Target Options"
\&\fB\-b\fR \fImachine\fR \fB\-V\fR \fIversion\fR
-.Ip "\fIMachine Dependent Options\fR" 4
+.IP "\fIMachine Dependent Options\fR" 4
.IX Item "Machine Dependent Options"
\&\fIM680x0 Options\fR
.Sp
\&\fB\-m68000 \-m68020 \-m68020\-40 \-m68020\-60 \-m68030 \-m68040
\&\-m68060 \-mcpu32 \-m5200 \-m68881 \-mbitfield \-mc68000 \-mc68020
-\&\-mfpa \-mnobitfield \-mrtd \-mshort \-msoft-float \-mpcrel
-\&\-malign-int \-mstrict-align\fR
+\&\-mfpa \-mnobitfield \-mrtd \-mshort \-msoft\-float \-mpcrel
+\&\-malign\-int \-mstrict\-align\fR
.Sp
\&\fIM68hc1x Options\fR
.Sp
\&\fB\-m6811 \-m6812 \-m68hc11 \-m68hc12
-\&\-mauto-incdec \-mshort \-msoft-reg-count=\fR\fIcount\fR
+\&\-mauto\-incdec \-mshort \-msoft\-reg\-count=\fR\fIcount\fR
.Sp
\&\fI\s-1VAX\s0 Options\fR
.Sp
@@ -339,68 +342,59 @@ in the following sections.
.Sp
\&\fI\s-1SPARC\s0 Options\fR
.Sp
-\&\fB\-mcpu=\fR\fIcpu type\fR
-\&\fB\-mtune=\fR\fIcpu type\fR
-\&\fB\-mcmodel=\fR\fIcode model\fR
+\&\fB\-mcpu=\fR\fIcpu-type\fR
+\&\fB\-mtune=\fR\fIcpu-type\fR
+\&\fB\-mcmodel=\fR\fIcode-model\fR
\&\fB\-m32 \-m64
-\&\-mapp-regs \-mbroken-saverestore \-mcypress
-\&\-mepilogue \-mfaster-structs \-mflat
-\&\-mfpu \-mhard-float \-mhard-quad-float
-\&\-mimpure-text \-mlive-g0 \-mno-app-regs
-\&\-mno-epilogue \-mno-faster-structs \-mno-flat \-mno-fpu
-\&\-mno-impure-text \-mno-stack-bias \-mno-unaligned-doubles
-\&\-msoft-float \-msoft-quad-float \-msparclite \-mstack-bias
-\&\-msupersparc \-munaligned-doubles \-mv8\fR
+\&\-mapp\-regs \-mbroken\-saverestore \-mcypress
+\&\-mepilogue \-mfaster\-structs \-mflat
+\&\-mfpu \-mhard\-float \-mhard\-quad\-float
+\&\-mimpure\-text \-mlive\-g0 \-mno\-app\-regs
+\&\-mno\-epilogue \-mno\-faster\-structs \-mno\-flat \-mno\-fpu
+\&\-mno\-impure\-text \-mno\-stack\-bias \-mno\-unaligned\-doubles
+\&\-msoft\-float \-msoft\-quad\-float \-msparclite \-mstack\-bias
+\&\-msupersparc \-munaligned\-doubles \-mv8\fR
.Sp
\&\fIConvex Options\fR
.Sp
\&\fB\-mc1 \-mc2 \-mc32 \-mc34 \-mc38
\&\-margcount \-mnoargcount
\&\-mlong32 \-mlong64
-\&\-mvolatile-cache \-mvolatile-nocache\fR
+\&\-mvolatile\-cache \-mvolatile\-nocache\fR
.Sp
\&\fI\s-1AMD29K\s0 Options\fR
.Sp
\&\fB\-m29000 \-m29050 \-mbw \-mnbw \-mdw \-mndw
\&\-mlarge \-mnormal \-msmall
-\&\-mkernel-registers \-mno-reuse-arg-regs
-\&\-mno-stack-check \-mno-storem-bug
-\&\-mreuse-arg-regs \-msoft-float \-mstack-check
-\&\-mstorem-bug \-muser-registers\fR
+\&\-mkernel\-registers \-mno\-reuse\-arg\-regs
+\&\-mno\-stack\-check \-mno\-storem\-bug
+\&\-mreuse\-arg\-regs \-msoft\-float \-mstack\-check
+\&\-mstorem\-bug \-muser\-registers\fR
.Sp
\&\fI\s-1ARM\s0 Options\fR
.Sp
-\&\fB\-mapcs-frame \-mno-apcs-frame
-\&\-mapcs-26 \-mapcs-32
-\&\-mapcs-stack-check \-mno-apcs-stack-check
-\&\-mapcs-float \-mno-apcs-float
-\&\-mapcs-reentrant \-mno-apcs-reentrant
-\&\-msched-prolog \-mno-sched-prolog
-\&\-mlittle-endian \-mbig-endian \-mwords-little-endian
-\&\-malignment-traps \-mno-alignment-traps
-\&\-msoft-float \-mhard-float \-mfpe
-\&\-mthumb-interwork \-mno-thumb-interwork
-\&\-mcpu= \-march= \-mfpe=
-\&\-mstructure-size-boundary=
-\&\-mbsd \-mxopen \-mno-symrename
-\&\-mabort-on-noreturn
-\&\-mlong-calls \-mno-long-calls
-\&\-mnop-fun-dllimport \-mno-nop-fun-dllimport
-\&\-msingle-pic-base \-mno-single-pic-base
-\&\-mpic-register=\fR
-.Sp
-\&\fIThumb Options\fR
-.Sp
-\&\fB\-mtpcs-frame \-mno-tpcs-frame
-\&\-mtpcs-leaf-frame \-mno-tpcs-leaf-frame
-\&\-mlittle-endian \-mbig-endian
-\&\-mthumb-interwork \-mno-thumb-interwork
-\&\-mstructure-size-boundary=
-\&\-mnop-fun-dllimport \-mno-nop-fun-dllimport
-\&\-mcallee-super-interworking \-mno-callee-super-interworking
-\&\-mcaller-super-interworking \-mno-caller-super-interworking
-\&\-msingle-pic-base \-mno-single-pic-base
-\&\-mpic-register=\fR
+\&\fB\-mapcs\-frame \-mno\-apcs\-frame
+\&\-mapcs\-26 \-mapcs\-32
+\&\-mapcs\-stack\-check \-mno\-apcs\-stack\-check
+\&\-mapcs\-float \-mno\-apcs\-float
+\&\-mapcs\-reentrant \-mno\-apcs\-reentrant
+\&\-msched\-prolog \-mno\-sched\-prolog
+\&\-mlittle\-endian \-mbig\-endian \-mwords\-little\-endian
+\&\-malignment\-traps \-mno\-alignment\-traps
+\&\-msoft\-float \-mhard\-float \-mfpe
+\&\-mthumb\-interwork \-mno\-thumb\-interwork
+\&\-mcpu=\fR\fIname\fR \fB\-march=\fR\fIname\fR \fB\-mfpe=\fR\fIname\fR
+\&\fB\-mstructure\-size\-boundary=\fR\fIn\fR
+\&\fB\-mbsd \-mxopen \-mno\-symrename
+\&\-mabort\-on\-noreturn
+\&\-mlong\-calls \-mno\-long\-calls
+\&\-msingle\-pic\-base \-mno\-single\-pic\-base
+\&\-mpic\-register=\fR\fIreg\fR
+\&\fB\-mnop\-fun\-dllimport
+\&\-mpoke\-function\-name
+\&\-mthumb \-marm
+\&\-mtpcs\-frame \-mtpcs\-leaf\-frame
+\&\-mcaller\-super\-interworking \-mcallee\-super\-interworking\fR
.Sp
\&\fI\s-1MN10200\s0 Options\fR
.Sp
@@ -408,121 +402,119 @@ in the following sections.
.Sp
\&\fI\s-1MN10300\s0 Options\fR
.Sp
-\&\fB\-mmult-bug
-\&\-mno-mult-bug
-\&\-mam33
-\&\-mno-am33
-\&\-mrelax\fR
+\&\fB\-mmult\-bug \-mno\-mult\-bug
+\&\-mam33 \-mno\-am33
+\&\-mno\-crt0 \-mrelax\fR
.Sp
\&\fIM32R/D Options\fR
.Sp
-\&\fB\-mcode-model=\fR\fImodel type\fR \fB\-msdata=\fR\fIsdata type\fR
+\&\fB\-mcode\-model=\fR\fImodel-type\fR \fB\-msdata=\fR\fIsdata-type\fR
\&\fB\-G\fR \fInum\fR
.Sp
\&\fIM88K Options\fR
.Sp
-\&\fB\-m88000 \-m88100 \-m88110 \-mbig-pic
-\&\-mcheck-zero-division \-mhandle-large-shift
-\&\-midentify-revision \-mno-check-zero-division
-\&\-mno-ocs-debug-info \-mno-ocs-frame-position
-\&\-mno-optimize-arg-area \-mno-serialize-volatile
-\&\-mno-underscores \-mocs-debug-info
-\&\-mocs-frame-position \-moptimize-arg-area
-\&\-mserialize-volatile \-mshort-data-\fR\fInum\fR \fB\-msvr3
-\&\-msvr4 \-mtrap-large-shift \-muse-div-instruction
-\&\-mversion-03.00 \-mwarn-passed-structs\fR
+\&\fB\-m88000 \-m88100 \-m88110 \-mbig\-pic
+\&\-mcheck\-zero\-division \-mhandle\-large\-shift
+\&\-midentify\-revision \-mno\-check\-zero\-division
+\&\-mno\-ocs\-debug\-info \-mno\-ocs\-frame\-position
+\&\-mno\-optimize\-arg\-area \-mno\-serialize\-volatile
+\&\-mno\-underscores \-mocs\-debug\-info
+\&\-mocs\-frame\-position \-moptimize\-arg\-area
+\&\-mserialize\-volatile \-mshort\-data\-\fR\fInum\fR \fB\-msvr3
+\&\-msvr4 \-mtrap\-large\-shift \-muse\-div\-instruction
+\&\-mversion\-03.00 \-mwarn\-passed\-structs\fR
.Sp
\&\fI\s-1RS/6000\s0 and PowerPC Options\fR
.Sp
-\&\fB\-mcpu=\fR\fIcpu type\fR
-\&\fB\-mtune=\fR\fIcpu type\fR
-\&\fB\-mpower \-mno-power \-mpower2 \-mno-power2
-\&\-mpowerpc \-mpowerpc64 \-mno-powerpc
-\&\-mpowerpc-gpopt \-mno-powerpc-gpopt
-\&\-mpowerpc-gfxopt \-mno-powerpc-gfxopt
-\&\-mnew-mnemonics \-mold-mnemonics
-\&\-mfull-toc \-mminimal-toc \-mno-fop-in-toc \-mno-sum-in-toc
-\&\-m64 \-m32 \-mxl-call \-mno-xl-call \-mthreads \-mpe
-\&\-msoft-float \-mhard-float \-mmultiple \-mno-multiple
-\&\-mstring \-mno-string \-mupdate \-mno-update
-\&\-mfused-madd \-mno-fused-madd \-mbit-align \-mno-bit-align
-\&\-mstrict-align \-mno-strict-align \-mrelocatable
-\&\-mno-relocatable \-mrelocatable-lib \-mno-relocatable-lib
-\&\-mtoc \-mno-toc \-mlittle \-mlittle-endian \-mbig \-mbig-endian
-\&\-mcall-aix \-mcall-sysv \-mprototype \-mno-prototype
+\&\fB\-mcpu=\fR\fIcpu-type\fR
+\&\fB\-mtune=\fR\fIcpu-type\fR
+\&\fB\-mpower \-mno\-power \-mpower2 \-mno\-power2
+\&\-mpowerpc \-mpowerpc64 \-mno\-powerpc
+\&\-mpowerpc\-gpopt \-mno\-powerpc\-gpopt
+\&\-mpowerpc\-gfxopt \-mno\-powerpc\-gfxopt
+\&\-mnew\-mnemonics \-mold\-mnemonics
+\&\-mfull\-toc \-mminimal\-toc \-mno\-fop\-in\-toc \-mno\-sum\-in\-toc
+\&\-m64 \-m32 \-mxl\-call \-mno\-xl\-call \-mthreads \-mpe
+\&\-msoft\-float \-mhard\-float \-mmultiple \-mno\-multiple
+\&\-mstring \-mno\-string \-mupdate \-mno\-update
+\&\-mfused\-madd \-mno\-fused\-madd \-mbit\-align \-mno\-bit\-align
+\&\-mstrict\-align \-mno\-strict\-align \-mrelocatable
+\&\-mno\-relocatable \-mrelocatable\-lib \-mno\-relocatable\-lib
+\&\-mtoc \-mno\-toc \-mlittle \-mlittle\-endian \-mbig \-mbig\-endian
+\&\-mcall\-aix \-mcall\-sysv \-mcall\-netbsd \-mprototype \-mno\-prototype
\&\-msim \-mmvme \-mads \-myellowknife \-memb \-msdata
\&\-msdata=\fR\fIopt\fR \fB\-mvxworks \-G\fR \fInum\fR
.Sp
\&\fI\s-1RT\s0 Options\fR
.Sp
-\&\fB\-mcall-lib-mul \-mfp-arg-in-fpregs \-mfp-arg-in-gregs
-\&\-mfull-fp-blocks \-mhc-struct-return \-min-line-mul
-\&\-mminimum-fp-blocks \-mnohc-struct-return\fR
+\&\fB\-mcall\-lib\-mul \-mfp\-arg\-in\-fpregs \-mfp\-arg\-in\-gregs
+\&\-mfull\-fp\-blocks \-mhc\-struct\-return \-min\-line\-mul
+\&\-mminimum\-fp\-blocks \-mnohc\-struct\-return\fR
.Sp
\&\fI\s-1MIPS\s0 Options\fR
.Sp
-\&\fB\-mabicalls \-mcpu=\fR\fIcpu type\fR
-\&\fB\-membedded-data \-muninit-const-in-rodata
-\&\-membedded-pic \-mfp32 \-mfp64 \-mgas \-mgp32 \-mgp64
-\&\-mgpopt \-mhalf-pic \-mhard-float \-mint64 \-mips1
-\&\-mips2 \-mips3 \-mips4 \-mlong64 \-mlong32 \-mlong-calls \-mmemcpy
-\&\-mmips-as \-mmips-tfile \-mno-abicalls
-\&\-mno-embedded-data \-mno-uninit-const-in-rodata \-mno-embedded-pic
-\&\-mno-gpopt \-mno-long-calls
-\&\-mno-memcpy \-mno-mips-tfile \-mno-rnames \-mno-stats
-\&\-mrnames \-msoft-float
-\&\-m4650 \-msingle-float \-mmad
+\&\fB\-mabicalls \-mcpu=\fR\fIcpu-type\fR
+\&\fB\-membedded\-data \-muninit\-const\-in\-rodata
+\&\-membedded\-pic \-mfp32 \-mfp64 \-mgas \-mgp32 \-mgp64
+\&\-mgpopt \-mhalf\-pic \-mhard\-float \-mint64 \-mips1
+\&\-mips2 \-mips3 \-mips4 \-mlong64 \-mlong32 \-mlong\-calls \-mmemcpy
+\&\-mmips\-as \-mmips\-tfile \-mno\-abicalls
+\&\-mno\-embedded\-data \-mno\-uninit\-const\-in\-rodata
+\&\-mno\-embedded\-pic \-mno\-gpopt \-mno\-long\-calls
+\&\-mno\-memcpy \-mno\-mips\-tfile \-mno\-rnames \-mno\-stats
+\&\-mrnames \-msoft\-float
+\&\-m4650 \-msingle\-float \-mmad
\&\-mstats \-EL \-EB \-G\fR \fInum\fR \fB\-nocpp
-\&\-mabi=32 \-mabi=n32 \-mabi=64 \-mabi=eabi
-\&\-mfix7000 \-mno-crt0\fR
+\&\-mabi=32 \-mabi=n32 \-mabi=64 \-mabi=eabi
+\&\-mfix7000 \-mno\-crt0\fR
.Sp
\&\fIi386 Options\fR
.Sp
-\&\fB\-mcpu=\fR\fIcpu type\fR \fB\-march=\fR\fIcpu type\fR
-\&\fB\-mintel-syntax \-mieee-fp \-mno-fancy-math-387
-\&\-mno-fp-ret-in-387 \-msoft-float \-msvr3\-shlib
-\&\-mno-wide-multiply \-mrtd \-malign-double
-\&\-mreg-alloc=\fR\fIlist\fR \fB\-mregparm=\fR\fInum\fR
-\&\fB\-malign-jumps=\fR\fInum\fR \fB\-malign-loops=\fR\fInum\fR
-\&\fB\-malign-functions=\fR\fInum\fR \fB\-mpreferred-stack-boundary=\fR\fInum\fR
-\&\fB\-mthreads \-mno-align-stringops \-minline-all-stringops
-\&\-mpush-args \-maccumulate-outgoing-args \-m128bit-long-double
-\&\-m96bit-long-double\fR
+\&\fB\-mcpu=\fR\fIcpu-type\fR \fB\-march=\fR\fIcpu-type\fR
+\&\fB\-mintel\-syntax \-mieee\-fp \-mno\-fancy\-math\-387
+\&\-mno\-fp\-ret\-in\-387 \-msoft\-float \-msvr3\-shlib
+\&\-mno\-wide\-multiply \-mrtd \-malign\-double
+\&\-mreg\-alloc=\fR\fIlist\fR \fB\-mregparm=\fR\fInum\fR
+\&\fB\-malign\-jumps=\fR\fInum\fR \fB\-malign\-loops=\fR\fInum\fR
+\&\fB\-malign\-functions=\fR\fInum\fR \fB\-mpreferred\-stack\-boundary=\fR\fInum\fR
+\&\fB\-mthreads \-mno\-align\-stringops \-minline\-all\-stringops
+\&\-mpush\-args \-maccumulate\-outgoing\-args \-m128bit\-long\-double
+\&\-m96bit\-long\-double \-momit\-leaf\-frame\-pointer\fR
.Sp
\&\fI\s-1HPPA\s0 Options\fR
.Sp
-\&\fB\-march=\fR\fIarchitecture type\fR
-\&\fB\-mbig-switch \-mdisable-fpregs \-mdisable-indexing
-\&\-mfast-indirect-calls \-mgas \-mjump-in-delay
-\&\-mlong-load-store \-mno-big-switch \-mno-disable-fpregs
-\&\-mno-disable-indexing \-mno-fast-indirect-calls \-mno-gas
-\&\-mno-jump-in-delay \-mno-long-load-store
-\&\-mno-portable-runtime \-mno-soft-float
-\&\-mno-space-regs \-msoft-float \-mpa-risc-1\-0
-\&\-mpa-risc-1\-1 \-mpa-risc-2\-0 \-mportable-runtime
-\&\-mschedule=\fR\fIcpu type\fR \fB\-mspace-regs\fR
+\&\fB\-march=\fR\fIarchitecture-type\fR
+\&\fB\-mbig\-switch \-mdisable\-fpregs \-mdisable\-indexing
+\&\-mfast\-indirect\-calls \-mgas \-mjump\-in\-delay
+\&\-mlong\-load\-store \-mno\-big\-switch \-mno\-disable\-fpregs
+\&\-mno\-disable\-indexing \-mno\-fast\-indirect\-calls \-mno\-gas
+\&\-mno\-jump\-in\-delay \-mno\-long\-load\-store
+\&\-mno\-portable\-runtime \-mno\-soft\-float
+\&\-mno\-space\-regs \-msoft\-float \-mpa\-risc\-1\-0
+\&\-mpa\-risc\-1\-1 \-mpa\-risc\-2\-0 \-mportable\-runtime
+\&\-mschedule=\fR\fIcpu-type\fR \fB\-mspace\-regs\fR
.Sp
\&\fIIntel 960 Options\fR
.Sp
-\&\fB\-m\fR\fIcpu type\fR \fB\-masm-compat \-mclean-linkage
-\&\-mcode-align \-mcomplex-addr \-mleaf-procedures
-\&\-mic-compat \-mic2.0\-compat \-mic3.0\-compat
-\&\-mintel-asm \-mno-clean-linkage \-mno-code-align
-\&\-mno-complex-addr \-mno-leaf-procedures
-\&\-mno-old-align \-mno-strict-align \-mno-tail-call
-\&\-mnumerics \-mold-align \-msoft-float \-mstrict-align
-\&\-mtail-call\fR
+\&\fB\-m\fR\fIcpu-type\fR \fB\-masm\-compat \-mclean\-linkage
+\&\-mcode\-align \-mcomplex\-addr \-mleaf\-procedures
+\&\-mic\-compat \-mic2.0\-compat \-mic3.0\-compat
+\&\-mintel\-asm \-mno\-clean\-linkage \-mno\-code\-align
+\&\-mno\-complex\-addr \-mno\-leaf\-procedures
+\&\-mno\-old\-align \-mno\-strict\-align \-mno\-tail\-call
+\&\-mnumerics \-mold\-align \-msoft\-float \-mstrict\-align
+\&\-mtail\-call\fR
.Sp
\&\fI\s-1DEC\s0 Alpha Options\fR
.Sp
-\&\fB\-mfp-regs \-mno-fp-regs \-mno-soft-float \-msoft-float
-\&\-malpha-as \-mgas
-\&\-mieee \-mieee-with-inexact \-mieee-conformant
-\&\-mfp-trap-mode=\fR\fImode\fR \fB\-mfp-rounding-mode=\fR\fImode\fR
-\&\fB\-mtrap-precision=\fR\fImode\fR \fB\-mbuild-constants
-\&\-mcpu=\fR\fIcpu type\fR
-\&\fB\-mbwx \-mno-bwx \-mcix \-mno-cix \-mmax \-mno-max
-\&\-mmemory-latency=\fR\fItime\fR
+\&\fB\-mfp\-regs \-mno\-fp\-regs \-mno\-soft\-float \-msoft\-float
+\&\-malpha\-as \-mgas
+\&\-mieee \-mieee\-with\-inexact \-mieee\-conformant
+\&\-mfp\-trap\-mode=\fR\fImode\fR \fB\-mfp\-rounding\-mode=\fR\fImode\fR
+\&\fB\-mtrap\-precision=\fR\fImode\fR \fB\-mbuild\-constants
+\&\-mcpu=\fR\fIcpu-type\fR
+\&\fB\-mbwx \-mno\-bwx \-mcix \-mno\-cix \-mmax \-mno\-max
+\&\-mmemory\-latency=\fR\fItime\fR
.Sp
\&\fIClipper Options\fR
.Sp
@@ -530,17 +522,16 @@ in the following sections.
.Sp
\&\fIH8/300 Options\fR
.Sp
-\&\fB\-mrelax \-mh \-ms \-mint32 \-malign-300\fR
+\&\fB\-mrelax \-mh \-ms \-mint32 \-malign\-300\fR
.Sp
\&\fI\s-1SH\s0 Options\fR
.Sp
\&\fB\-m1 \-m2 \-m3 \-m3e
-\&\-m4\-nofpu \-m4\-single-only \-m4\-single \-m4
+\&\-m4\-nofpu \-m4\-single\-only \-m4\-single \-m4
\&\-mb \-ml \-mdalign \-mrelax
\&\-mbigtable \-mfmovd \-mhitachi \-mnomacsave
-\&\-misize \-mpadstruct \-mspace
-\&\-mprefergot
-\&\-musermode\fR
+\&\-mieee \-misize \-mpadstruct \-mspace
+\&\-mprefergot \-musermode\fR
.Sp
\&\fISystem V Options\fR
.Sp
@@ -549,64 +540,90 @@ in the following sections.
\&\fI\s-1ARC\s0 Options\fR
.Sp
\&\fB\-EB \-EL
-\&\-mmangle-cpu \-mcpu=\fR\fIcpu\fR \fB\-mtext=\fR\fItext section\fR
-\&\fB\-mdata=\fR\fIdata section\fR \fB\-mrodata=\fR\fIreadonly data section\fR
+\&\-mmangle\-cpu \-mcpu=\fR\fIcpu\fR \fB\-mtext=\fR\fItext-section\fR
+\&\fB\-mdata=\fR\fIdata-section\fR \fB\-mrodata=\fR\fIreadonly-data-section\fR
.Sp
\&\fITMS320C3x/C4x Options\fR
.Sp
-\&\fB\-mcpu=\fR\fIcpu\fR \fB\-mbig \-msmall \-mregparm \-mmemparm
-\&\-mfast-fix \-mmpyi \-mbk \-mti \-mdp-isr-reload
-\&\-mrpts=\fR\fIcount\fR \fB\-mrptb \-mdb \-mloop-unsigned
-\&\-mparallel-insns \-mparallel-mpy \-mpreserve-float\fR
+\&\fB\-mcpu=\fR\fIcpu\fR \fB\-mbig \-msmall \-mregparm \-mmemparm
+\&\-mfast\-fix \-mmpyi \-mbk \-mti \-mdp\-isr\-reload
+\&\-mrpts=\fR\fIcount\fR \fB\-mrptb \-mdb \-mloop\-unsigned
+\&\-mparallel\-insns \-mparallel\-mpy \-mpreserve\-float\fR
.Sp
\&\fIV850 Options\fR
.Sp
-\&\fB\-mlong-calls \-mno-long-calls \-mep \-mno-ep
-\&\-mprolog-function \-mno-prolog-function \-mspace
-\&\-mtda=\fR\fIn\fR \fB\-msda=\fR\fIn\fR \fB\-mzda=\fR\fIn\fR
-\&\fB\-mv850 \-mbig-switch\fR
+\&\fB\-mlong\-calls \-mno\-long\-calls \-mep \-mno\-ep
+\&\-mprolog\-function \-mno\-prolog\-function \-mspace
+\&\-mtda=\fR\fIn\fR \fB\-msda=\fR\fIn\fR \fB\-mzda=\fR\fIn\fR
+\&\fB\-mv850 \-mbig\-switch\fR
.Sp
\&\fI\s-1NS32K\s0 Options\fR
.Sp
-\&\fB\-m32032 \-m32332 \-m32532 \-m32081 \-m32381 \-mmult-add \-mnomult-add
-\&\-msoft-float \-mrtd \-mnortd \-mregparam \-mnoregparam \-msb \-mnosb
-\&\-mbitfield \-mnobitfield \-mhimem \-mnohimem\fR
+\&\fB\-m32032 \-m32332 \-m32532 \-m32081 \-m32381
+\&\-mmult\-add \-mnomult\-add \-msoft\-float \-mrtd \-mnortd
+\&\-mregparam \-mnoregparam \-msb \-mnosb
+\&\-mbitfield \-mnobitfield \-mhimem \-mnohimem\fR
.Sp
\&\fI\s-1AVR\s0 Options\fR
.Sp
-\&\fB\-mmcu=\fR\fImcu\fR \fB\-msize \-minit-stack=\fR\fIn\fR \fB\-mno-interrupts
-\&\-mcall-prologues \-mno-tablejump \-mtiny-stack\fR
+\&\fB\-mmcu=\fR\fImcu\fR \fB\-msize \-minit\-stack=\fR\fIn\fR \fB\-mno\-interrupts
+\&\-mcall\-prologues \-mno\-tablejump \-mtiny\-stack\fR
.Sp
\&\fIMCore Options\fR
.Sp
-\&\fB\-mhardlit \-mno-hardlit \-mdiv \-mno-div \-mrelax-immediates
-\&\-mno-relax-immediates \-mwide-bitfields \-mno-wide-bitfields
-\&\-m4byte-functions \-mno-4byte-functions \-mcallgraph-data
-\&\-mno-callgraph-data \-mslow-bytes \-mno-slow-bytes \-mno-lsim
-\&\-mlittle-endian \-mbig-endian \-m210 \-m340 \-mstack-increment\fR
-.Sp
-\&\fI\s-1IA-64\s0 Options\fR
-.Sp
-\&\fB\-mbig-endian \-mlittle-endian \-mgnu-as \-mgnu-ld \-mno-pic
-\&\-mvolatile-asm-stop \-mb-step \-mregister-names \-mno-sdata
-\&\-mconstant-gp \-mauto-pic \-minline-divide-min-latency
-\&\-minline-divide-max-throughput \-mno-dwarf2\-asm
-\&\-mfixed-range=\fR\fIregister range\fR
-.Ip "\fICode Generation Options\fR" 4
+\&\fB\-mhardlit \-mno\-hardlit \-mdiv \-mno\-div \-mrelax\-immediates
+\&\-mno\-relax\-immediates \-mwide\-bitfields \-mno\-wide\-bitfields
+\&\-m4byte\-functions \-mno\-4byte\-functions \-mcallgraph\-data
+\&\-mno\-callgraph\-data \-mslow\-bytes \-mno\-slow\-bytes \-mno\-lsim
+\&\-mlittle\-endian \-mbig\-endian \-m210 \-m340 \-mstack\-increment\fR
+.Sp
+\&\fI\s-1IA\-64\s0 Options\fR
+.Sp
+\&\fB\-mbig\-endian \-mlittle\-endian \-mgnu\-as \-mgnu\-ld \-mno\-pic
+\&\-mvolatile\-asm\-stop \-mb\-step \-mregister\-names \-mno\-sdata
+\&\-mconstant\-gp \-mauto\-pic \-minline\-divide\-min\-latency
+\&\-minline\-divide\-max\-throughput \-mno\-dwarf2\-asm
+\&\-mfixed\-range=\fR\fIregister-range\fR
+.Sp
+\&\fIS/390 and zSeries Options\fR
+.Sp
+\&\fB\-mhard\-float \-msoft\-float \-mbackchain \-mno\-backchain
+\&\-msmall\-exec \-mno\-small\-exec \-mmvcle \-mno\-mvcle
+\&\-m64 \-m31 \-mdebug \-mno\-debug\fR
+.Sp
+\&\fIXtensa Options\fR
+.Sp
+\&\fB\-mbig\-endian \-mlittle\-endian
+\&\-mdensity \-mno\-density
+\&\-mmac16 \-mno\-mac16
+\&\-mmul16 \-mno\-mul16
+\&\-mmul32 \-mno\-mul32
+\&\-mnsa \-mno\-nsa
+\&\-mminmax \-mno\-minmax
+\&\-msext \-mno\-sext
+\&\-mbooleans \-mno\-booleans
+\&\-mhard\-float \-msoft\-float
+\&\-mfused\-madd \-mno\-fused\-madd
+\&\-mserialize\-volatile \-mno\-serialize\-volatile
+\&\-mtext\-section\-literals \-mno\-text\-section\-literals
+\&\-mtarget\-align \-mno\-target\-align
+\&\-mlongcalls \-mno\-longcalls\fR
+.IP "\fICode Generation Options\fR" 4
.IX Item "Code Generation Options"
-\&\fB\-fcall-saved-\fR\fIreg\fR \fB\-fcall-used-\fR\fIreg\fR
-\&\fB\-fexceptions \-funwind-tables \-ffixed-\fR\fIreg\fR
-\&\fB\-finhibit-size-directive \-finstrument-functions
-\&\-fcheck-memory-usage \-fprefix-function-name
-\&\-fno-common \-fno-ident \-fno-gnu-linker
-\&\-fpcc-struct-return \-fpic \-fPIC
-\&\-freg-struct-return \-fshared-data \-fshort-enums
-\&\-fshort-double \-fvolatile \-fvolatile-global \-fvolatile-static
-\&\-fverbose-asm \-fpack-struct \-fstack-check
-\&\-fstack-limit-register=\fR\fIreg\fR \fB\-fstack-limit-symbol=\fR\fIsym\fR
-\&\fB\-fargument-alias \-fargument-noalias
-\&\-fargument-noalias-global
-\&\-fleading-underscore\fR
+\&\fB\-fcall\-saved\-\fR\fIreg\fR \fB\-fcall\-used\-\fR\fIreg\fR
+\&\fB\-ffixed\-\fR\fIreg\fR \fB\-fexceptions
+\&\-fnon\-call\-exceptions \-funwind\-tables
+\&\-finhibit\-size\-directive \-finstrument\-functions
+\&\-fcheck\-memory\-usage \-fprefix\-function\-name
+\&\-fno\-common \-fno\-ident \-fno\-gnu\-linker
+\&\-fpcc\-struct\-return \-fpic \-fPIC
+\&\-freg\-struct\-return \-fshared\-data \-fshort\-enums
+\&\-fshort\-double \-fvolatile
+\&\-fvolatile\-global \-fvolatile\-static
+\&\-fverbose\-asm \-fpack\-struct \-fstack\-check
+\&\-fstack\-limit\-register=\fR\fIreg\fR \fB\-fstack\-limit\-symbol=\fR\fIsym\fR
+\&\fB\-fargument\-alias \-fargument\-noalias
+\&\-fargument\-noalias\-global \-fleading\-underscore\fR
.Sh "Options Controlling the Kind of Output"
.IX Subsection "Options Controlling the Kind of Output"
Compilation can involve up to four stages: preprocessing, compilation
@@ -617,85 +634,78 @@ compiled, and those specified as input) into an executable file.
.PP
For any given input file, the file name suffix determines what kind of
compilation is done:
-.Ip "\fIfile\fR\fB.c\fR" 4
+.IP "\fIfile\fR\fB.c\fR" 4
.IX Item "file.c"
C source code which must be preprocessed.
-.Ip "\fIfile\fR\fB.i\fR" 4
+.IP "\fIfile\fR\fB.i\fR" 4
.IX Item "file.i"
C source code which should not be preprocessed.
-.Ip "\fIfile\fR\fB.ii\fR" 4
+.IP "\fIfile\fR\fB.ii\fR" 4
.IX Item "file.ii"
\&\*(C+ source code which should not be preprocessed.
-.Ip "\fIfile\fR\fB.m\fR" 4
+.IP "\fIfile\fR\fB.m\fR" 4
.IX Item "file.m"
Objective-C source code. Note that you must link with the library
\&\fIlibobjc.a\fR to make an Objective-C program work.
-.Ip "\fIfile\fR\fB.mi\fR" 4
+.IP "\fIfile\fR\fB.mi\fR" 4
.IX Item "file.mi"
Objective-C source code which should not be preprocessed.
-.Ip "\fIfile\fR\fB.h\fR" 4
+.IP "\fIfile\fR\fB.h\fR" 4
.IX Item "file.h"
C header file (not to be compiled or linked).
-.Ip "\fIfile\fR\fB.cc\fR" 4
+.IP "\fIfile\fR\fB.cc\fR" 4
.IX Item "file.cc"
.PD 0
-.Ip "\fIfile\fR\fB.cp\fR" 4
+.IP "\fIfile\fR\fB.cp\fR" 4
.IX Item "file.cp"
-.Ip "\fIfile\fR\fB.cxx\fR" 4
+.IP "\fIfile\fR\fB.cxx\fR" 4
.IX Item "file.cxx"
-.Ip "\fIfile\fR\fB.cpp\fR" 4
+.IP "\fIfile\fR\fB.cpp\fR" 4
.IX Item "file.cpp"
-.Ip "\fIfile\fR\fB.c++\fR" 4
+.IP "\fIfile\fR\fB.c++\fR" 4
.IX Item "file.c++"
-.Ip "\fIfile\fR\fB.C\fR" 4
+.IP "\fIfile\fR\fB.C\fR" 4
.IX Item "file.C"
.PD
\&\*(C+ source code which must be preprocessed. Note that in \fB.cxx\fR,
the last two letters must both be literally \fBx\fR. Likewise,
\&\fB.C\fR refers to a literal capital C.
-.Ip "\fIfile\fR\fB.f\fR" 4
+.IP "\fIfile\fR\fB.f\fR" 4
.IX Item "file.f"
.PD 0
-.Ip "\fIfile\fR\fB.for\fR" 4
+.IP "\fIfile\fR\fB.for\fR" 4
.IX Item "file.for"
-.Ip "\fIfile\fR\fB.FOR\fR" 4
+.IP "\fIfile\fR\fB.FOR\fR" 4
.IX Item "file.FOR"
.PD
Fortran source code which should not be preprocessed.
-.Ip "\fIfile\fR\fB.F\fR" 4
+.IP "\fIfile\fR\fB.F\fR" 4
.IX Item "file.F"
.PD 0
-.Ip "\fIfile\fR\fB.fpp\fR" 4
+.IP "\fIfile\fR\fB.fpp\fR" 4
.IX Item "file.fpp"
-.Ip "\fIfile\fR\fB.FPP\fR" 4
+.IP "\fIfile\fR\fB.FPP\fR" 4
.IX Item "file.FPP"
.PD
Fortran source code which must be preprocessed (with the traditional
preprocessor).
-.Ip "\fIfile\fR\fB.r\fR" 4
+.IP "\fIfile\fR\fB.r\fR" 4
.IX Item "file.r"
Fortran source code which must be preprocessed with a \s-1RATFOR\s0
preprocessor (not included with \s-1GCC\s0).
-.Ip "\fIfile\fR\fB.ch\fR" 4
-.IX Item "file.ch"
-.PD 0
-.Ip "\fIfile\fR\fB.chi\fR" 4
-.IX Item "file.chi"
-.PD
-\&\s-1CHILL\s0 source code (preprocessed with the traditional preprocessor).
-.Ip "\fIfile\fR\fB.s\fR" 4
+.IP "\fIfile\fR\fB.s\fR" 4
.IX Item "file.s"
Assembler code.
-.Ip "\fIfile\fR\fB.S\fR" 4
+.IP "\fIfile\fR\fB.S\fR" 4
.IX Item "file.S"
Assembler code which must be preprocessed.
-.Ip "\fIother\fR" 4
+.IP "\fIother\fR" 4
.IX Item "other"
An object file to be fed straight into linking.
Any file name with no recognized suffix is treated this way.
.PP
You can specify the input language explicitly with the \fB\-x\fR option:
-.Ip "\fB\-x\fR \fIlanguage\fR" 4
+.IP "\fB\-x\fR \fIlanguage\fR" 4
.IX Item "-x language"
Specify explicitly the \fIlanguage\fR for the following input files
(rather than letting the compiler choose a default based on the file
@@ -708,18 +718,18 @@ the next \fB\-x\fR option. Possible values for \fIlanguage\fR are:
\& objective-c objc-cpp-output
\& assembler assembler-with-cpp
\& f77 f77-cpp-input ratfor
-\& java chill
+\& java
.Ve
-.Ip "\fB\-x none\fR" 4
+.IP "\fB\-x none\fR" 4
.IX Item "-x none"
Turn off any specification of a language, so that subsequent files are
handled according to their file name suffixes (as they are if \fB\-x\fR
has not been used at all).
-.Ip "\fB\-pass-exit-codes\fR" 4
+.IP "\fB\-pass\-exit\-codes\fR" 4
.IX Item "-pass-exit-codes"
Normally the \fBgcc\fR program will exit with the code of 1 if any
phase of the compiler returns a non-success return code. If you specify
-\&\fB\-pass-exit-codes\fR, the \fBgcc\fR program will instead return with
+\&\fB\-pass\-exit\-codes\fR, the \fBgcc\fR program will instead return with
numerically highest error produced by any phase that returned an error
indication.
.PP
@@ -728,7 +738,7 @@ If you only want some of the stages of compilation, you can use
one of the options \fB\-c\fR, \fB\-S\fR, or \fB\-E\fR to say where
\&\fBgcc\fR is to stop. Note that some combinations (for example,
\&\fB\-x cpp-output \-E\fR) instruct \fBgcc\fR to do nothing at all.
-.Ip "\fB\-c\fR" 4
+.IP "\fB\-c\fR" 4
.IX Item "-c"
Compile or assemble the source files, but do not link. The linking
stage simply is not done. The ultimate output is in the form of an
@@ -739,7 +749,7 @@ the suffix \fB.c\fR, \fB.i\fR, \fB.s\fR, etc., with \fB.o\fR.
.Sp
Unrecognized input files, not requiring compilation or assembly, are
ignored.
-.Ip "\fB\-S\fR" 4
+.IP "\fB\-S\fR" 4
.IX Item "-S"
Stop after the stage of compilation proper; do not assemble. The output
is in the form of an assembler code file for each non-assembler input
@@ -749,14 +759,14 @@ By default, the assembler file name for a source file is made by
replacing the suffix \fB.c\fR, \fB.i\fR, etc., with \fB.s\fR.
.Sp
Input files that don't require compilation are ignored.
-.Ip "\fB\-E\fR" 4
+.IP "\fB\-E\fR" 4
.IX Item "-E"
Stop after the preprocessing stage; do not run the compiler proper. The
output is in the form of preprocessed source code, which is sent to the
standard output.
.Sp
Input files which don't require preprocessing are ignored.
-.Ip "\fB\-o\fR \fIfile\fR" 4
+.IP "\fB\-o\fR \fIfile\fR" 4
.IX Item "-o file"
Place output in file \fIfile\fR. This applies regardless to whatever
sort of output is being produced, whether it be an executable file,
@@ -770,28 +780,28 @@ If \fB\-o\fR is not specified, the default is to put an executable file
in \fIa.out\fR, the object file for \fI\fIsource\fI.\fIsuffix\fI\fR in
\&\fI\fIsource\fI.o\fR, its assembler file in \fI\fIsource\fI.s\fR, and
all preprocessed C source on standard output.
-.Ip "\fB\-v\fR" 4
+.IP "\fB\-v\fR" 4
.IX Item "-v"
Print (on standard error output) the commands executed to run the stages
of compilation. Also print the version number of the compiler driver
program and of the preprocessor and the compiler proper.
-.Ip "\fB\-pipe\fR" 4
+.IP "\fB\-pipe\fR" 4
.IX Item "-pipe"
Use pipes rather than temporary files for communication between the
various stages of compilation. This fails to work on some systems where
the assembler is unable to read from a pipe; but the \s-1GNU\s0 assembler has
no trouble.
-.Ip "\fB\*(--help\fR" 4
-.IX Item "help"
+.IP "\fB\-\-help\fR" 4
+.IX Item "--help"
Print (on the standard output) a description of the command line options
understood by \fBgcc\fR. If the \fB\-v\fR option is also specified
-then \fB\*(--help\fR will also be passed on to the various processes
+then \fB\-\-help\fR will also be passed on to the various processes
invoked by \fBgcc\fR, so that they can display the command line options
they accept. If the \fB\-W\fR option is also specified then command
line options which have no documentation associated with them will also
be displayed.
-.Ip "\fB\*(--target-help\fR" 4
-.IX Item "target-help"
+.IP "\fB\-\-target\-help\fR" 4
+.IX Item "--target-help"
Print (on the standard output) a description of target specific command
line options for each tool.
.Sh "Compiling \*(C+ Programs"
@@ -820,17 +830,17 @@ languages; or options that are meaningful only for \*(C+ programs.
.IX Subsection "Options Controlling C Dialect"
The following options control the dialect of C (or languages derived
from C, such as \*(C+ and Objective C) that the compiler accepts:
-.Ip "\fB\-ansi\fR" 4
+.IP "\fB\-ansi\fR" 4
.IX Item "-ansi"
In C mode, support all \s-1ISO\s0 C89 programs. In \*(C+ mode,
remove \s-1GNU\s0 extensions that conflict with \s-1ISO\s0 \*(C+.
.Sp
This turns off certain features of \s-1GCC\s0 that are incompatible with \s-1ISO\s0
-C (when compiling C code), or of standard \*(C+ (when compiling \*(C+ code),
+C89 (when compiling C code), or of standard \*(C+ (when compiling \*(C+ code),
such as the \f(CW\*(C`asm\*(C'\fR and \f(CW\*(C`typeof\*(C'\fR keywords, and
predefined macros such as \f(CW\*(C`unix\*(C'\fR and \f(CW\*(C`vax\*(C'\fR that identify the
type of system you are using. It also enables the undesirable and
-rarely used \s-1ISO\s0 trigraph feature. For the C compiler,
+rarely used \s-1ISO\s0 trigraph feature. For the C compiler,
it disables recognition of \*(C+ style \fB//\fR comments as well as
the \f(CW\*(C`inline\*(C'\fR keyword.
.Sp
@@ -852,45 +862,49 @@ from declaring certain functions or defining certain macros that the
\&\s-1ISO\s0 standard doesn't call for; this is to avoid interfering with any
programs that might use these names for other things.
.Sp
-Functions which would normally be builtin but do not have semantics
-defined by \s-1ISO\s0 C (such as \f(CW\*(C`alloca\*(C'\fR and \f(CW\*(C`ffs\*(C'\fR) are not builtin
+Functions which would normally be built in but do not have semantics
+defined by \s-1ISO\s0 C (such as \f(CW\*(C`alloca\*(C'\fR and \f(CW\*(C`ffs\*(C'\fR) are not built-in
functions with \fB\-ansi\fR is used.
-.Ip "\fB\-std=\fR" 4
+.IP "\fB\-std=\fR" 4
.IX Item "-std="
-Determine the language standard. A value for this option must be provided;
-possible values are
+Determine the language standard. This option is currently only
+supported when compiling C. A value for this option must be provided;
+possible values are
.RS 4
-.Ip "\fBiso9899:1990\fR" 4
+.IP "\fBc89\fR" 4
+.IX Item "c89"
+.PD 0
+.IP "\fBiso9899:1990\fR" 4
.IX Item "iso9899:1990"
-Same as \fB\-ansi\fR
-.Ip "\fBiso9899:199409\fR" 4
+.PD
+\&\s-1ISO\s0 C89 (same as \fB\-ansi\fR).
+.IP "\fBiso9899:199409\fR" 4
.IX Item "iso9899:199409"
-\&\s-1ISO\s0 C as modified in amend. 1
-.Ip "\fBiso9899:1999\fR" 4
+\&\s-1ISO\s0 C89 as modified in amendment 1.
+.IP "\fBc99\fR" 4
+.IX Item "c99"
+.PD 0
+.IP "\fBc9x\fR" 4
+.IX Item "c9x"
+.IP "\fBiso9899:1999\fR" 4
.IX Item "iso9899:1999"
+.IP "\fBiso9899:199x\fR" 4
+.IX Item "iso9899:199x"
+.PD
\&\s-1ISO\s0 C99. Note that this standard is not yet fully supported; see
-<\fBhttp://gcc.gnu.org/c99status.html\fR> for more information.
-.Ip "\fBc89\fR" 4
-.IX Item "c89"
-same as \fB\-std=iso9899:1990\fR
-.Ip "\fBc99\fR" 4
-.IX Item "c99"
-same as \fB\-std=iso9899:1999\fR
-.Ip "\fBgnu89\fR" 4
+<\fBhttp://gcc.gnu.org/c99status.html\fR> for more information. The
+names \fBc9x\fR and \fBiso9899:199x\fR are deprecated.
+.IP "\fBgnu89\fR" 4
.IX Item "gnu89"
-default, iso9899:1990 + gnu extensions
-.Ip "\fBgnu99\fR" 4
+Default, \s-1ISO\s0 C89 plus \s-1GNU\s0 extensions (including some C99 features).
+.IP "\fBgnu99\fR" 4
.IX Item "gnu99"
-iso9899:1999 + gnu extensions
-.Ip "\fBiso9899:199x\fR" 4
-.IX Item "iso9899:199x"
-same as \fB\-std=iso9899:1999\fR, deprecated
-.Ip "\fBc9x\fR" 4
-.IX Item "c9x"
-same as \fB\-std=iso9899:1999\fR, deprecated
-.Ip "\fBgnu9x\fR" 4
+.PD 0
+.IP "\fBgnu9x\fR" 4
.IX Item "gnu9x"
-same as \fB\-std=gnu99\fR, deprecated
+.PD
+\&\s-1ISO\s0 C99 plus \s-1GNU\s0 extensions. When \s-1ISO\s0 C99 is fully implemented in \s-1GCC\s0,
+this will become the default. The name \fBgnu9x\fR is deprecated.
.RE
.RS 4
.Sp
@@ -904,84 +918,105 @@ effects as \fB\-ansi\fR, except that features that were not in \s-1ISO\s0 C89
but are in the specified version (for example, \fB//\fR comments and
the \f(CW\*(C`inline\*(C'\fR keyword in \s-1ISO\s0 C99) are not disabled.
.RE
-.Ip "\fB\-fno-asm\fR" 4
+.IP "\fB\-aux\-info\fR \fIfilename\fR" 4
+.IX Item "-aux-info filename"
+Output to the given filename prototyped declarations for all functions
+declared and/or defined in a translation unit, including those in header
+files. This option is silently ignored in any language other than C.
+.Sp
+Besides declarations, the file indicates, in comments, the origin of
+each declaration (source file and line), whether the declaration was
+implicit, prototyped or unprototyped (\fBI\fR, \fBN\fR for new or
+\&\fBO\fR for old, respectively, in the first character after the line
+number and the colon), and whether it came from a declaration or a
+definition (\fBC\fR or \fBF\fR, respectively, in the following
+character). In the case of function definitions, a K&R\-style list of
+arguments followed by their declarations is also provided, inside
+comments, after the declaration.
+.IP "\fB\-fno\-asm\fR" 4
.IX Item "-fno-asm"
Do not recognize \f(CW\*(C`asm\*(C'\fR, \f(CW\*(C`inline\*(C'\fR or \f(CW\*(C`typeof\*(C'\fR as a
keyword, so that code can use these words as identifiers. You can use
the keywords \f(CW\*(C`_\|_asm_\|_\*(C'\fR, \f(CW\*(C`_\|_inline_\|_\*(C'\fR and \f(CW\*(C`_\|_typeof_\|_\*(C'\fR
-instead. \fB\-ansi\fR implies \fB\-fno-asm\fR.
+instead. \fB\-ansi\fR implies \fB\-fno\-asm\fR.
.Sp
In \*(C+, this switch only affects the \f(CW\*(C`typeof\*(C'\fR keyword, since
\&\f(CW\*(C`asm\*(C'\fR and \f(CW\*(C`inline\*(C'\fR are standard keywords. You may want to
-use the \fB\-fno-gnu-keywords\fR flag instead, which has the same
+use the \fB\-fno\-gnu\-keywords\fR flag instead, which has the same
effect. In C99 mode (\fB\-std=c99\fR or \fB\-std=gnu99\fR), this
switch only affects the \f(CW\*(C`asm\*(C'\fR and \f(CW\*(C`typeof\*(C'\fR keywords, since
\&\f(CW\*(C`inline\*(C'\fR is a standard keyword in \s-1ISO\s0 C99.
-.Ip "\fB\-fno-builtin\fR" 4
+.IP "\fB\-fno\-builtin\fR" 4
.IX Item "-fno-builtin"
-Don't recognize builtin functions that do not begin with
+Don't recognize built-in functions that do not begin with
\&\fB_\|_builtin_\fR as prefix.
.Sp
-\&\s-1GCC\s0 normally generates special code to handle certain builtin functions
+\&\s-1GCC\s0 normally generates special code to handle certain built-in functions
more efficiently; for instance, calls to \f(CW\*(C`alloca\*(C'\fR may become single
instructions that adjust the stack directly, and calls to \f(CW\*(C`memcpy\*(C'\fR
may become inline copy loops. The resulting code is often both smaller
and faster, but since the function calls no longer appear as such, you
cannot set a breakpoint on those calls, nor can you change the behavior
of the functions by linking with a different library.
-.Ip "\fB\-fhosted\fR" 4
+.Sp
+In \*(C+, \fB\-fno\-builtin\fR is always in effect. The \fB\-fbuiltin\fR
+option has no effect. Therefore, in \*(C+, the only way to get the
+optimization benefits of built-in functions is to call the function
+using the \fB_\|_builtin_\fR prefix. The \s-1GNU\s0 \*(C+ Standard Library uses
+built-in functions to implement many functions (like
+\&\f(CW\*(C`std::strchr\*(C'\fR), so that you automatically get efficient code.
+.IP "\fB\-fhosted\fR" 4
.IX Item "-fhosted"
Assert that compilation takes place in a hosted environment. This implies
\&\fB\-fbuiltin\fR. A hosted environment is one in which the
entire standard library is available, and in which \f(CW\*(C`main\*(C'\fR has a return
type of \f(CW\*(C`int\*(C'\fR. Examples are nearly everything except a kernel.
-This is equivalent to \fB\-fno-freestanding\fR.
-.Ip "\fB\-ffreestanding\fR" 4
+This is equivalent to \fB\-fno\-freestanding\fR.
+.IP "\fB\-ffreestanding\fR" 4
.IX Item "-ffreestanding"
Assert that compilation takes place in a freestanding environment. This
-implies \fB\-fno-builtin\fR. A freestanding environment
+implies \fB\-fno\-builtin\fR. A freestanding environment
is one in which the standard library may not exist, and program startup may
not necessarily be at \f(CW\*(C`main\*(C'\fR. The most obvious example is an \s-1OS\s0 kernel.
-This is equivalent to \fB\-fno-hosted\fR.
-.Ip "\fB\-trigraphs\fR" 4
+This is equivalent to \fB\-fno\-hosted\fR.
+.IP "\fB\-trigraphs\fR" 4
.IX Item "-trigraphs"
-Support \s-1ISO\s0 C trigraphs. You don't want to know about this
-brain-damage. The \fB\-ansi\fR option (and \fB\-std\fR options for
-strict \s-1ISO\s0 C conformance) implies \fB\-trigraphs\fR.
-.Ip "\fB\-traditional\fR" 4
+Support \s-1ISO\s0 C trigraphs. The \fB\-ansi\fR option (and \fB\-std\fR
+options for strict \s-1ISO\s0 C conformance) implies \fB\-trigraphs\fR.
+.IP "\fB\-traditional\fR" 4
.IX Item "-traditional"
Attempt to support some aspects of traditional C compilers.
Specifically:
.RS 4
-.Ip "\(bu" 4
+.IP "\(bu" 4
All \f(CW\*(C`extern\*(C'\fR declarations take effect globally even if they
are written inside of a function definition. This includes implicit
declarations of functions.
-.Ip "\(bu" 4
+.IP "\(bu" 4
The newer keywords \f(CW\*(C`typeof\*(C'\fR, \f(CW\*(C`inline\*(C'\fR, \f(CW\*(C`signed\*(C'\fR, \f(CW\*(C`const\*(C'\fR
and \f(CW\*(C`volatile\*(C'\fR are not recognized. (You can still use the
alternative keywords such as \f(CW\*(C`_\|_typeof_\|_\*(C'\fR, \f(CW\*(C`_\|_inline_\|_\*(C'\fR, and
so on.)
-.Ip "\(bu" 4
+.IP "\(bu" 4
Comparisons between pointers and integers are always allowed.
-.Ip "\(bu" 4
+.IP "\(bu" 4
Integer types \f(CW\*(C`unsigned short\*(C'\fR and \f(CW\*(C`unsigned char\*(C'\fR promote
to \f(CW\*(C`unsigned int\*(C'\fR.
-.Ip "\(bu" 4
+.IP "\(bu" 4
Out-of-range floating point literals are not an error.
-.Ip "\(bu" 4
+.IP "\(bu" 4
Certain constructs which \s-1ISO\s0 regards as a single invalid preprocessing
-number, such as \fB0xe-0xd\fR, are treated as expressions instead.
-.Ip "\(bu" 4
+number, such as \fB0xe\-0xd\fR, are treated as expressions instead.
+.IP "\(bu" 4
String ``constants'' are not necessarily constant; they are stored in
writable space, and identical looking constants are allocated
separately. (This is the same as the effect of
-\&\fB\-fwritable-strings\fR.)
-.Ip "\(bu" 4
+\&\fB\-fwritable\-strings\fR.)
+.IP "\(bu" 4
All automatic variables not declared \f(CW\*(C`register\*(C'\fR are preserved by
\&\f(CW\*(C`longjmp\*(C'\fR. Ordinarily, \s-1GNU\s0 C follows \s-1ISO\s0 C: automatic variables
not declared \f(CW\*(C`volatile\*(C'\fR may be clobbered.
-.Ip "\(bu" 4
+.IP "\(bu" 4
The character escape sequences \fB\ex\fR and \fB\ea\fR evaluate as the
literal characters \fBx\fR and \fBa\fR respectively. Without
\&\fB\-traditional\fR, \fB\ex\fR is a prefix for the hexadecimal
@@ -989,8 +1024,8 @@ representation of a character, and \fB\ea\fR produces a bell.
.RE
.RS 4
.Sp
-You may wish to use \fB\-fno-builtin\fR as well as \fB\-traditional\fR
-if your program uses names that are normally \s-1GNU\s0 C builtin functions for
+You may wish to use \fB\-fno\-builtin\fR as well as \fB\-traditional\fR
+if your program uses names that are normally \s-1GNU\s0 C built-in functions for
other purposes of its own.
.Sp
You cannot use \fB\-traditional\fR if you include any header files that
@@ -998,26 +1033,26 @@ rely on \s-1ISO\s0 C features. Some vendors are starting to ship systems with
\&\s-1ISO\s0 C header files and you cannot use \fB\-traditional\fR on such
systems to compile files that include any system headers.
.Sp
-The \fB\-traditional\fR option also enables \fB\-traditional-cpp\fR,
+The \fB\-traditional\fR option also enables \fB\-traditional\-cpp\fR,
which is described next.
.RE
-.Ip "\fB\-traditional-cpp\fR" 4
+.IP "\fB\-traditional\-cpp\fR" 4
.IX Item "-traditional-cpp"
Attempt to support some aspects of traditional C preprocessors.
Specifically:
.RS 4
-.Ip "\(bu" 4
+.IP "\(bu" 4
Comments convert to nothing at all, rather than to a space. This allows
traditional token concatenation.
-.Ip "\(bu" 4
+.IP "\(bu" 4
In a preprocessing directive, the \fB#\fR symbol must appear as the first
character of a line.
-.Ip "\(bu" 4
+.IP "\(bu" 4
Macro arguments are recognized within string constants in a macro
definition (and their values are stringified, though without additional
quote marks, when they appear in such a context). The preprocessor
always considers a string constant to end at a newline.
-.Ip "\(bu" 4
+.IP "\(bu" 4
The predefined macro \f(CW\*(C`_\|_STDC_\|_\*(C'\fR is not defined when you use
\&\fB\-traditional\fR, but \f(CW\*(C`_\|_GNUC_\|_\*(C'\fR is (since the \s-1GNU\s0 extensions
which \f(CW\*(C`_\|_GNUC_\|_\*(C'\fR indicates are not affected by
@@ -1027,19 +1062,19 @@ testing both of these predefined macros you can distinguish four
situations: \s-1GNU\s0 C, traditional \s-1GNU\s0 C, other \s-1ISO\s0 C compilers, and other
old C compilers. The predefined macro \f(CW\*(C`_\|_STDC_VERSION_\|_\*(C'\fR is also
not defined when you use \fB\-traditional\fR.
-.Ip "\(bu" 4
+.IP "\(bu" 4
The preprocessor considers a string constant to end at a newline (unless
the newline is escaped with \fB\e\fR). (Without \fB\-traditional\fR,
string constants can contain the newline character as typed.)
.RE
.RS 4
.RE
-.Ip "\fB\-fcond-mismatch\fR" 4
+.IP "\fB\-fcond\-mismatch\fR" 4
.IX Item "-fcond-mismatch"
Allow conditional expressions with mismatched types in the second and
third arguments. The value of such an expression is void. This option
is not supported for \*(C+.
-.Ip "\fB\-funsigned-char\fR" 4
+.IP "\fB\-funsigned\-char\fR" 4
.IX Item "-funsigned-char"
Let the type \f(CW\*(C`char\*(C'\fR be unsigned, like \f(CW\*(C`unsigned char\*(C'\fR.
.Sp
@@ -1057,40 +1092,31 @@ make such a program work with the opposite default.
The type \f(CW\*(C`char\*(C'\fR is always a distinct type from each of
\&\f(CW\*(C`signed char\*(C'\fR or \f(CW\*(C`unsigned char\*(C'\fR, even though its behavior
is always just like one of those two.
-.Ip "\fB\-fsigned-char\fR" 4
+.IP "\fB\-fsigned\-char\fR" 4
.IX Item "-fsigned-char"
Let the type \f(CW\*(C`char\*(C'\fR be signed, like \f(CW\*(C`signed char\*(C'\fR.
.Sp
-Note that this is equivalent to \fB\-fno-unsigned-char\fR, which is
-the negative form of \fB\-funsigned-char\fR. Likewise, the option
-\&\fB\-fno-signed-char\fR is equivalent to \fB\-funsigned-char\fR.
-.Sp
-You may wish to use \fB\-fno-builtin\fR as well as \fB\-traditional\fR
-if your program uses names that are normally \s-1GNU\s0 C builtin functions for
-other purposes of its own.
-.Sp
-You cannot use \fB\-traditional\fR if you include any header files that
-rely on \s-1ISO\s0 C features. Some vendors are starting to ship systems with
-\&\s-1ISO\s0 C header files and you cannot use \fB\-traditional\fR on such
-systems to compile files that include any system headers.
-.Ip "\fB\-fsigned-bitfields\fR" 4
+Note that this is equivalent to \fB\-fno\-unsigned\-char\fR, which is
+the negative form of \fB\-funsigned\-char\fR. Likewise, the option
+\&\fB\-fno\-signed\-char\fR is equivalent to \fB\-funsigned\-char\fR.
+.IP "\fB\-fsigned\-bitfields\fR" 4
.IX Item "-fsigned-bitfields"
.PD 0
-.Ip "\fB\-funsigned-bitfields\fR" 4
+.IP "\fB\-funsigned\-bitfields\fR" 4
.IX Item "-funsigned-bitfields"
-.Ip "\fB\-fno-signed-bitfields\fR" 4
+.IP "\fB\-fno\-signed\-bitfields\fR" 4
.IX Item "-fno-signed-bitfields"
-.Ip "\fB\-fno-unsigned-bitfields\fR" 4
+.IP "\fB\-fno\-unsigned\-bitfields\fR" 4
.IX Item "-fno-unsigned-bitfields"
.PD
-These options control whether a bitfield is signed or unsigned, when the
+These options control whether a bit-field is signed or unsigned, when the
declaration does not use either \f(CW\*(C`signed\*(C'\fR or \f(CW\*(C`unsigned\*(C'\fR. By
-default, such a bitfield is signed, because this is consistent: the
+default, such a bit-field is signed, because this is consistent: the
basic integer types such as \f(CW\*(C`int\*(C'\fR are signed types.
.Sp
-However, when \fB\-traditional\fR is used, bitfields are all unsigned
+However, when \fB\-traditional\fR is used, bit-fields are all unsigned
no matter what.
-.Ip "\fB\-fwritable-strings\fR" 4
+.IP "\fB\-fwritable\-strings\fR" 4
.IX Item "-fwritable-strings"
Store string constants in the writable data segment and don't uniquize
them. This is for compatibility with old programs which assume they can
@@ -1099,7 +1125,7 @@ this effect.
.Sp
Writing into string constants is a very bad idea; ``constants'' should
be constant.
-.Ip "\fB\-fallow-single-precision\fR" 4
+.IP "\fB\-fallow\-single\-precision\fR" 4
.IX Item "-fallow-single-precision"
Do not promote single precision math operations to double precision,
even when compiling with \fB\-traditional\fR.
@@ -1111,7 +1137,7 @@ than double precision. If you must use \fB\-traditional\fR, but want
to use single precision operations when the operands are single
precision, use this option. This option has no effect when compiling
with \s-1ISO\s0 or \s-1GNU\s0 C conventions (the default).
-.Ip "\fB\-fshort-wchar\fR" 4
+.IP "\fB\-fshort\-wchar\fR" 4
.IX Item "-fshort-wchar"
Override the underlying type for \fBwchar_t\fR to be \fBshort
unsigned int\fR instead of the default for the target. This option is
@@ -1126,16 +1152,17 @@ might compile a file \f(CW\*(C`firstClass.C\*(C'\fR like this:
.Vb 1
\& g++ -g -frepo -O -c firstClass.C
.Ve
+.PP
In this example, only \fB\-frepo\fR is an option meant
only for \*(C+ programs; you can use the other options with any
language supported by \s-1GCC\s0.
.PP
Here is a list of options that are \fIonly\fR for compiling \*(C+ programs:
-.Ip "\fB\-fno-access-control\fR" 4
+.IP "\fB\-fno\-access\-control\fR" 4
.IX Item "-fno-access-control"
Turn off all access checking. This switch is mainly useful for working
around bugs in the access control code.
-.Ip "\fB\-fcheck-new\fR" 4
+.IP "\fB\-fcheck\-new\fR" 4
.IX Item "-fcheck-new"
Check that the pointer returned by \f(CW\*(C`operator new\*(C'\fR is non-null
before attempting to modify the storage allocated. The current Working
@@ -1144,9 +1171,9 @@ this check is normally unnecessary.
.Sp
An alternative to using this option is to specify that your
\&\f(CW\*(C`operator new\*(C'\fR does not throw any exceptions; if you declare it
-\&\fB\f(BIthrow()\fB\fR, g++ will check the return value. See also \fBnew
+\&\fB\f(BIthrow()\fB\fR, G++ will check the return value. See also \fBnew
(nothrow)\fR.
-.Ip "\fB\-fconserve-space\fR" 4
+.IP "\fB\-fconserve\-space\fR" 4
.IX Item "-fconserve-space"
Put uninitialized or runtime-initialized global variables into the
common segment, as C does. This saves space in the executable at the
@@ -1157,129 +1184,115 @@ two definitions were merged.
.Sp
This option is no longer useful on most targets, now that support has
been added for putting variables into \s-1BSS\s0 without making them common.
-.Ip "\fB\-fdollars-in-identifiers\fR" 4
+.IP "\fB\-fno\-const\-strings\fR" 4
+.IX Item "-fno-const-strings"
+Give string constants type \f(CW\*(C`char *\*(C'\fR instead of type \f(CW\*(C`const
+char *\*(C'\fR. By default, G++ uses type \f(CW\*(C`const char *\*(C'\fR as required by
+the standard. Even if you use \fB\-fno\-const\-strings\fR, you cannot
+actually modify the value of a string constant, unless you also use
+\&\fB\-fwritable\-strings\fR.
+.Sp
+This option might be removed in a future release of G++. For maximum
+portability, you should structure your code so that it works with
+string constants that have type \f(CW\*(C`const char *\*(C'\fR.
+.IP "\fB\-fdollars\-in\-identifiers\fR" 4
.IX Item "-fdollars-in-identifiers"
Accept \fB$\fR in identifiers. You can also explicitly prohibit use of
-\&\fB$\fR with the option \fB\-fno-dollars-in-identifiers\fR. (\s-1GNU\s0 C allows
+\&\fB$\fR with the option \fB\-fno\-dollars\-in\-identifiers\fR. (\s-1GNU\s0 C allows
\&\fB$\fR by default on most target systems, but there are a few exceptions.)
Traditional C allowed the character \fB$\fR to form part of
identifiers. However, \s-1ISO\s0 C and \*(C+ forbid \fB$\fR in identifiers.
-.Ip "\fB\-fno-elide-constructors\fR" 4
+.IP "\fB\-fno\-elide\-constructors\fR" 4
.IX Item "-fno-elide-constructors"
The \*(C+ standard allows an implementation to omit creating a temporary
which is only used to initialize another object of the same type.
-Specifying this option disables that optimization, and forces g++ to
+Specifying this option disables that optimization, and forces G++ to
call the copy constructor in all cases.
-.Ip "\fB\-fno-enforce-eh-specs\fR" 4
+.IP "\fB\-fno\-enforce\-eh\-specs\fR" 4
.IX Item "-fno-enforce-eh-specs"
Don't check for violation of exception specifications at runtime. This
option violates the \*(C+ standard, but may be useful for reducing code
size in production builds, much like defining \fB\s-1NDEBUG\s0\fR. The compiler
will still optimize based on the exception specifications.
-.Ip "\fB\-fexternal-templates\fR" 4
+.IP "\fB\-fexternal\-templates\fR" 4
.IX Item "-fexternal-templates"
Cause template instantiations to obey \fB#pragma interface\fR and
\&\fBimplementation\fR; template instances are emitted or not according
to the location of the template definition.
.Sp
This option is deprecated.
-.Ip "\fB\-falt-external-templates\fR" 4
+.IP "\fB\-falt\-external\-templates\fR" 4
.IX Item "-falt-external-templates"
-Similar to \-fexternal-templates, but template instances are emitted or
+Similar to \fB\-fexternal\-templates\fR, but template instances are emitted or
not according to the place where they are first instantiated.
.Sp
This option is deprecated.
-.Ip "\fB\-ffor-scope\fR" 4
+.IP "\fB\-ffor\-scope\fR" 4
.IX Item "-ffor-scope"
.PD 0
-.Ip "\fB\-fno-for-scope\fR" 4
+.IP "\fB\-fno\-for\-scope\fR" 4
.IX Item "-fno-for-scope"
.PD
-If \-ffor-scope is specified, the scope of variables declared in
+If \fB\-ffor\-scope\fR is specified, the scope of variables declared in
a \fIfor-init-statement\fR is limited to the \fBfor\fR loop itself,
as specified by the \*(C+ standard.
-If \-fno-for-scope is specified, the scope of variables declared in
+If \fB\-fno\-for\-scope\fR is specified, the scope of variables declared in
a \fIfor-init-statement\fR extends to the end of the enclosing scope,
-as was the case in old versions of gcc, and other (traditional)
+as was the case in old versions of G++, and other (traditional)
implementations of \*(C+.
.Sp
The default if neither flag is given to follow the standard,
but to allow and give a warning for old-style code that would
otherwise be invalid, or have different behavior.
-.Ip "\fB\-fno-gnu-keywords\fR" 4
+.IP "\fB\-fno\-gnu\-keywords\fR" 4
.IX Item "-fno-gnu-keywords"
Do not recognize \f(CW\*(C`typeof\*(C'\fR as a keyword, so that code can use this
-word as an identifier. You can use the keyword \f(CW\*(C`_\|_typeof_\|_\*(C'\fR instead.
-\&\fB\-ansi\fR implies \fB\-fno-gnu-keywords\fR.
-.Ip "\fB\-fhonor-std\fR" 4
-.IX Item "-fhonor-std"
-Treat the \f(CW\*(C`namespace std\*(C'\fR as a namespace, instead of ignoring
-it. For compatibility with earlier versions of g++, the compiler will,
-by default, ignore \f(CW\*(C`namespace\-declarations\*(C'\fR,
-\&\f(CW\*(C`using\-declarations\*(C'\fR, \f(CW\*(C`using\-directives\*(C'\fR, and
-\&\f(CW\*(C`namespace\-names\*(C'\fR, if they involve \f(CW\*(C`std\*(C'\fR.
-.Ip "\fB\-fhuge-objects\fR" 4
-.IX Item "-fhuge-objects"
-Support virtual function calls for objects that exceed the size
-representable by a \fBshort int\fR. Users should not use this flag by
-default; if you need to use it, the compiler will tell you so.
-.Sp
-This flag is not useful when compiling with \-fvtable-thunks.
-.Sp
-Like all options that change the \s-1ABI\s0, all \*(C+ code, \fIincluding
-libgcc\fR must be built with the same setting of this option.
-.Ip "\fB\-fno-implicit-templates\fR" 4
+word as an identifier. You can use the keyword \f(CW\*(C`_\|_typeof_\|_\*(C'\fR instead.
+\&\fB\-ansi\fR implies \fB\-fno\-gnu\-keywords\fR.
+.IP "\fB\-fno\-implicit\-templates\fR" 4
.IX Item "-fno-implicit-templates"
Never emit code for non-inline templates which are instantiated
implicitly (i.e. by use); only emit code for explicit instantiations.
-.Ip "\fB\-fno-implicit-inline-templates\fR" 4
+.IP "\fB\-fno\-implicit\-inline\-templates\fR" 4
.IX Item "-fno-implicit-inline-templates"
Don't emit code for implicit instantiations of inline templates, either.
The default is to handle inlines differently so that compiles with and
without optimization will need the same set of explicit instantiations.
-.Ip "\fB\-fno-implement-inlines\fR" 4
+.IP "\fB\-fno\-implement\-inlines\fR" 4
.IX Item "-fno-implement-inlines"
To save space, do not emit out-of-line copies of inline functions
controlled by \fB#pragma implementation\fR. This will cause linker
errors if these functions are not inlined everywhere they are called.
-.Ip "\fB\-fms-extensions\fR" 4
+.IP "\fB\-fms\-extensions\fR" 4
.IX Item "-fms-extensions"
Disable pedantic warnings about constructs used in \s-1MFC\s0, such as implicit
int and getting a pointer to member function via non-standard syntax.
-.Ip "\fB\-fname-mangling-version-\fR\fIn\fR" 4
-.IX Item "-fname-mangling-version-n"
-Control the way in which names are mangled. Version 0 is compatible
-with versions of g++ before 2.8. Version 1 is the default. Version 1
-will allow correct mangling of function templates. For example,
-version 0 mangling does not mangle foo<int, double> and foo<int, char>
-given this declaration:
-.Sp
-.Vb 1
-\& template <class T, class U> void foo(T t);
-.Ve
-Like all options that change the \s-1ABI\s0, all \*(C+ code, \fIincluding
-libgcc\fR must be built with the same setting of this option.
-.Ip "\fB\-fno-operator-names\fR" 4
+.IP "\fB\-fno\-nonansi\-builtins\fR" 4
+.IX Item "-fno-nonansi-builtins"
+Disable built-in declarations of functions that are not mandated by
+\&\s-1ANSI/ISO\s0 C. These include \f(CW\*(C`ffs\*(C'\fR, \f(CW\*(C`alloca\*(C'\fR, \f(CW\*(C`_exit\*(C'\fR,
+\&\f(CW\*(C`index\*(C'\fR, \f(CW\*(C`bzero\*(C'\fR, \f(CW\*(C`conjf\*(C'\fR, and other related functions.
+.IP "\fB\-fno\-operator\-names\fR" 4
.IX Item "-fno-operator-names"
Do not treat the operator name keywords \f(CW\*(C`and\*(C'\fR, \f(CW\*(C`bitand\*(C'\fR,
\&\f(CW\*(C`bitor\*(C'\fR, \f(CW\*(C`compl\*(C'\fR, \f(CW\*(C`not\*(C'\fR, \f(CW\*(C`or\*(C'\fR and \f(CW\*(C`xor\*(C'\fR as
synonyms as keywords.
-.Ip "\fB\-fno-optional-diags\fR" 4
+.IP "\fB\-fno\-optional\-diags\fR" 4
.IX Item "-fno-optional-diags"
Disable diagnostics that the standard says a compiler does not need to
-issue. Currently, the only such diagnostic issued by g++ is the one for
+issue. Currently, the only such diagnostic issued by G++ is the one for
a name having multiple meanings within a class.
-.Ip "\fB\-fpermissive\fR" 4
+.IP "\fB\-fpermissive\fR" 4
.IX Item "-fpermissive"
Downgrade messages about nonconformant code from errors to warnings. By
-default, g++ effectively sets \fB\-pedantic-errors\fR without
+default, G++ effectively sets \fB\-pedantic\-errors\fR without
\&\fB\-pedantic\fR; this option reverses that. This behavior and this
option are superseded by \fB\-pedantic\fR, which works as it does for \s-1GNU\s0 C.
-.Ip "\fB\-frepo\fR" 4
+.IP "\fB\-frepo\fR" 4
.IX Item "-frepo"
Enable automatic template instantiation. This option also implies
-\&\fB\-fno-implicit-templates\fR.
-.Ip "\fB\-fno-rtti\fR" 4
+\&\fB\-fno\-implicit\-templates\fR.
+.IP "\fB\-fno\-rtti\fR" 4
.IX Item "-fno-rtti"
Disable generation of information about every class with virtual
functions for use by the \*(C+ runtime type identification features
@@ -1287,51 +1300,31 @@ functions for use by the \*(C+ runtime type identification features
of the language, you can save some space by using this flag. Note that
exception handling uses the same information, but it will generate it as
needed.
-.Ip "\fB\-fsquangle\fR" 4
-.IX Item "-fsquangle"
-.PD 0
-.Ip "\fB\-fno-squangle\fR" 4
-.IX Item "-fno-squangle"
-.PD
-\&\fB\-fsquangle\fR will enable a compressed form of name mangling for
-identifiers. In particular, it helps to shorten very long names by recognizing
-types and class names which occur more than once, replacing them with special
-short \s-1ID\s0 codes. This option also requires any \*(C+ libraries being used to
-be compiled with this option as well. The compiler has this disabled (the
-equivalent of \fB\-fno-squangle\fR) by default.
-.Sp
-Like all options that change the \s-1ABI\s0, all \*(C+ code, \fIincluding
-libgcc.a\fR must be built with the same setting of this option.
-.Ip "\fB\-ftemplate-depth-\fR\fIn\fR" 4
+.IP "\fB\-fstats\fR" 4
+.IX Item "-fstats"
+Emit statistics about front-end processing at the end of the compilation.
+This information is generally only useful to the G++ development team.
+.IP "\fB\-ftemplate\-depth\-\fR\fIn\fR" 4
.IX Item "-ftemplate-depth-n"
Set the maximum instantiation depth for template classes to \fIn\fR.
A limit on the template instantiation depth is needed to detect
-endless recursions during template class instantiation. \s-1ANSI/ISO\s0 \*(C+
+endless recursions during template class instantiation. \s-1ANSI/ISO\s0 \*(C+
conforming programs must not rely on a maximum depth greater than 17.
-.Ip "\fB\-fuse-cxa-atexit\fR" 4
+.IP "\fB\-fuse\-cxa\-atexit\fR" 4
.IX Item "-fuse-cxa-atexit"
Register destructors for objects with static storage duration with the
\&\f(CW\*(C`_\|_cxa_atexit\*(C'\fR function rather than the \f(CW\*(C`atexit\*(C'\fR function.
This option is required for fully standards-compliant handling of static
destructors, but will only work if your C library supports
\&\f(CW\*(C`_\|_cxa_atexit\*(C'\fR.
-.Ip "\fB\-fvtable-thunks\fR" 4
-.IX Item "-fvtable-thunks"
-Use \fBthunks\fR to implement the virtual function dispatch table
-(\fBvtable\fR). The traditional (cfront-style) approach to
-implementing vtables was to store a pointer to the function and two
-offsets for adjusting the \fBthis\fR pointer at the call site. Newer
-implementations store a single pointer to a \fBthunk\fR function which
-does any necessary adjustment and then calls the target function.
-.Sp
-This option also enables a heuristic for controlling emission of
-vtables; if a class has any non-inline virtual functions, the vtable
-will be emitted in the translation unit containing the first one of
-those.
-.Sp
-Like all options that change the \s-1ABI\s0, all \*(C+ code, \fIincluding
-libgcc.a\fR must be built with the same setting of this option.
-.Ip "\fB\-nostdinc++\fR" 4
+.IP "\fB\-fno\-weak\fR" 4
+.IX Item "-fno-weak"
+Do not use weak symbol support, even if it is provided by the linker.
+By default, G++ will use weak symbols if they are available. This
+option exists only for testing, and should not be used by end\-users;
+it will result in inferior code and has no benefits. This option may
+be removed in a future release of G++.
+.IP "\fB\-nostdinc++\fR" 4
.IX Item "-nostdinc++"
Do not search for header files in the standard directories specific to
\&\*(C+, but do still search the other standard directories. (This option
@@ -1339,22 +1332,22 @@ is used when building the \*(C+ library.)
.PP
In addition, these optimization, warning, and code generation options
have meanings only for \*(C+ programs:
-.Ip "\fB\-fno-default-inline\fR" 4
+.IP "\fB\-fno\-default\-inline\fR" 4
.IX Item "-fno-default-inline"
Do not assume \fBinline\fR for functions defined inside a class scope.
Note that these
functions will have linkage like inline functions; they just won't be
inlined by default.
-.Ip "\fB\-Wctor-dtor-privacy (\*(C+ only)\fR" 4
+.IP "\fB\-Wctor\-dtor\-privacy\fR (\*(C+ only)" 4
.IX Item "-Wctor-dtor-privacy ( only)"
Warn when a class seems unusable, because all the constructors or
destructors in a class are private and the class has no friends or
public static member functions.
-.Ip "\fB\-Wnon-virtual-dtor (\*(C+ only)\fR" 4
+.IP "\fB\-Wnon\-virtual\-dtor\fR (\*(C+ only)" 4
.IX Item "-Wnon-virtual-dtor ( only)"
Warn when a class declares a non-virtual destructor that should probably
be virtual, because it looks like the class will be used polymorphically.
-.Ip "\fB\-Wreorder (\*(C+ only)\fR" 4
+.IP "\fB\-Wreorder\fR (\*(C+ only)" 4
.IX Item "-Wreorder ( only)"
Warn when the order of member initializers given in the code does not
match the order in which they must be executed. For instance:
@@ -1366,41 +1359,43 @@ match the order in which they must be executed. For instance:
\& A(): j (0), i (1) { }
\& };
.Ve
+.Sp
Here the compiler will warn that the member initializers for \fBi\fR
and \fBj\fR will be rearranged to match the declaration order of the
members.
.PP
The following \fB\-W...\fR options are not affected by \fB\-Wall\fR.
-.Ip "\fB\-Weffc++ (\*(C+ only)\fR" 4
+.IP "\fB\-Weffc++\fR (\*(C+ only)" 4
.IX Item "-Weffc++ ( only)"
Warn about violations of various style guidelines from Scott Meyers'
\&\fIEffective \*(C+\fR books. If you use this option, you should be aware
that the standard library headers do not obey all of these guidelines;
you can use \fBgrep \-v\fR to filter out those warnings.
-.Ip "\fB\-Wno-deprecated (\*(C+ only)\fR" 4
+.IP "\fB\-Wno\-deprecated\fR (\*(C+ only)" 4
.IX Item "-Wno-deprecated ( only)"
-Do not warn about usage of deprecated features.
-.Ip "\fB\-Wno-non-template-friend (\*(C+ only)\fR" 4
+Do not warn about usage of deprecated features.
+.IP "\fB\-Wno\-non\-template\-friend\fR (\*(C+ only)" 4
.IX Item "-Wno-non-template-friend ( only)"
Disable warnings when non-templatized friend functions are declared
-within a template. With the advent of explicit template specification
-support in g++, if the name of the friend is an unqualified-id (ie,
+within a template. With the advent of explicit template specification
+support in G++, if the name of the friend is an unqualified-id (i.e.,
\&\fBfriend foo(int)\fR), the \*(C+ language specification demands that the
-friend declare or define an ordinary, nontemplate function. (Section
-14.5.3). Before g++ implemented explicit specification, unqualified-ids
+friend declare or define an ordinary, nontemplate function. (Section
+14.5.3). Before G++ implemented explicit specification, unqualified-ids
could be interpreted as a particular specialization of a templatized
-function. Because this non-conforming behavior is no longer the default
-behavior for g++, \fB\-Wnon-template-friend\fR allows the compiler to
+function. Because this non-conforming behavior is no longer the default
+behavior for G++, \fB\-Wnon\-template\-friend\fR allows the compiler to
check existing code for potential trouble spots, and is on by default.
This new compiler behavior can be turned off with
-\&\fB\-Wno-non-template-friend\fR which keeps the conformant compiler code
+\&\fB\-Wno\-non\-template\-friend\fR which keeps the conformant compiler code
but disables the helpful warning.
-.Ip "\fB\-Wold-style-cast (\*(C+ only)\fR" 4
+.IP "\fB\-Wold\-style\-cast\fR (\*(C+ only)" 4
.IX Item "-Wold-style-cast ( only)"
-Warn if an old-style (C-style) cast is used within a \*(C+ program. The
+Warn if an old-style (C\-style) cast is used within a \*(C+ program. The
new-style casts (\fBstatic_cast\fR, \fBreinterpret_cast\fR, and
-\&\fBconst_cast\fR) are less vulnerable to unintended effects.
-.Ip "\fB\-Woverloaded-virtual (\*(C+ only)\fR" 4
+\&\fBconst_cast\fR) are less vulnerable to unintended effects, and much
+easier to grep for.
+.IP "\fB\-Woverloaded\-virtual\fR (\*(C+ only)" 4
.IX Item "-Woverloaded-virtual ( only)"
Warn when a derived class function declaration may be an error in
defining a virtual function. In a derived class, the
@@ -1409,19 +1404,19 @@ virtual function declared in the base class. With this option, the
compiler warns when you define a function with the same name as a
virtual function, but with a type signature that does not match any
declarations from the base class.
-.Ip "\fB\-Wno-pmf-conversions (\*(C+ only)\fR" 4
+.IP "\fB\-Wno\-pmf\-conversions\fR (\*(C+ only)" 4
.IX Item "-Wno-pmf-conversions ( only)"
Disable the diagnostic for converting a bound pointer to member function
to a plain pointer.
-.Ip "\fB\-Wsign-promo (\*(C+ only)\fR" 4
+.IP "\fB\-Wsign\-promo\fR (\*(C+ only)" 4
.IX Item "-Wsign-promo ( only)"
Warn when overload resolution chooses a promotion from unsigned or
enumeral type to a signed type over a conversion to an unsigned type of
-the same size. Previous versions of g++ would try to preserve
+the same size. Previous versions of G++ would try to preserve
unsignedness, but the standard mandates the current behavior.
-.Ip "\fB\-Wsynth (\*(C+ only)\fR" 4
+.IP "\fB\-Wsynth\fR (\*(C+ only)" 4
.IX Item "-Wsynth ( only)"
-Warn when g++'s synthesis behavior does not match that of cfront. For
+Warn when G++'s synthesis behavior does not match that of cfront. For
instance:
.Sp
.Vb 4
@@ -1430,6 +1425,7 @@ instance:
\& A& operator = (int);
\& };
.Ve
+.Sp
.Vb 5
\& main ()
\& {
@@ -1437,37 +1433,79 @@ instance:
\& a = b;
\& }
.Ve
-In this example, g++ will synthesize a default \fBA& operator =
+.Sp
+In this example, G++ will synthesize a default \fBA& operator =
(const A&);\fR, while cfront will use the user-defined \fBoperator =\fR.
+.Sh "Options Controlling Objective-C Dialect"
+.IX Subsection "Options Controlling Objective-C Dialect"
+This section describes the command-line options that are only meaningful
+for Objective-C programs; but you can also use most of the \s-1GNU\s0 compiler
+options regardless of what language your program is in. For example,
+you might compile a file \f(CW\*(C`some_class.m\*(C'\fR like this:
+.PP
+.Vb 1
+\& gcc -g -fgnu-runtime -O -c some_class.m
+.Ve
+.PP
+In this example, only \fB\-fgnu\-runtime\fR is an option meant only for
+Objective-C programs; you can use the other options with any language
+supported by \s-1GCC\s0.
+.PP
+Here is a list of options that are \fIonly\fR for compiling Objective-C
+programs:
+.IP "\fB\-fconstant\-string\-class=\fR\fIclass-name\fR" 4
+.IX Item "-fconstant-string-class=class-name"
+Use \fIclass-name\fR as the name of the class to instantiate for each
+literal string specified with the syntax \f(CW\*(C`@"..."\*(C'\fR. The default
+class name is \f(CW\*(C`NXConstantString\*(C'\fR.
+.IP "\fB\-fgnu\-runtime\fR" 4
+.IX Item "-fgnu-runtime"
+Generate object code compatible with the standard \s-1GNU\s0 Objective-C
+runtime. This is the default for most types of systems.
+.IP "\fB\-fnext\-runtime\fR" 4
+.IX Item "-fnext-runtime"
+Generate output compatible with the NeXT runtime. This is the default
+for NeXT-based systems, including Darwin and Mac \s-1OS\s0 X.
+.IP "\fB\-gen\-decls\fR" 4
+.IX Item "-gen-decls"
+Dump interface declarations for all classes seen in the source file to a
+file named \fI\fIsourcename\fI.decl\fR.
+.IP "\fB\-Wno\-protocol\fR" 4
+.IX Item "-Wno-protocol"
+Do not warn if methods required by a protocol are not implemented
+in the class adopting it.
+.IP "\fB\-Wselector\fR" 4
+.IX Item "-Wselector"
+Warn if a selector has multiple methods of different types defined.
.Sh "Options to Control Diagnostic Messages Formatting"
.IX Subsection "Options to Control Diagnostic Messages Formatting"
Traditionally, diagnostic messages have been formatted irrespective of
the output device's aspect (e.g. its width, ...). The options described
below can be used to control the diagnostic messages formatting
algorithm, e.g. how many characters per line, how often source location
-information should be reported. Right now, only the \*(C+ front-end can
+information should be reported. Right now, only the \*(C+ front end can
honor these options. However it is expected, in the near future, that
-the remaining front-ends would be able to digest them correctly.
-.Ip "\fB\-fmessage-length=\fR\fIn\fR" 4
+the remaining front ends would be able to digest them correctly.
+.IP "\fB\-fmessage\-length=\fR\fIn\fR" 4
.IX Item "-fmessage-length=n"
Try to format error messages so that they fit on lines of about \fIn\fR
-characters. The default is 72 characters for g++ and 0 for the rest of
-the front-ends supported by \s-1GCC\s0. If \fIn\fR is zero, then no
-line-wrapping will be done; each error message will appear on a single
+characters. The default is 72 characters for \fBg++\fR and 0 for the rest of
+the front ends supported by \s-1GCC\s0. If \fIn\fR is zero, then no
+line-wrapping will be done; each error message will appear on a single
line.
-.Ip "\fB\-fdiagnostics-show-location=once\fR" 4
+.IP "\fB\-fdiagnostics\-show\-location=once\fR" 4
.IX Item "-fdiagnostics-show-location=once"
Only meaningful in line-wrapping mode. Instructs the diagnostic messages
reporter to emit \fIonce\fR source location information; that is, in
case the message is too long to fit on a single physical line and has to
be wrapped, the source location won't be emitted (as prefix) again,
over and over, in subsequent continuation lines. This is the default
-behaviour.
-.Ip "\fB\-fdiagnostics-show-location=every-line\fR" 4
+behaviour.
+.IP "\fB\-fdiagnostics\-show\-location=every\-line\fR" 4
.IX Item "-fdiagnostics-show-location=every-line"
Only meaningful in line-wrapping mode. Instructs the diagnostic
messages reporter to emit the same source location information (as
-prefix) for physical lines that result from the process of breaking a
+prefix) for physical lines that result from the process of breaking
a message which is too long to fit on a single line.
.Sh "Options to Request or Suppress Warnings"
.IX Subsection "Options to Request or Suppress Warnings"
@@ -1478,15 +1516,15 @@ may have been an error.
You can request many specific warnings with options beginning \fB\-W\fR,
for example \fB\-Wimplicit\fR to request warnings on implicit
declarations. Each of these specific warning options also has a
-negative form beginning \fB\-Wno-\fR to turn off warnings;
-for example, \fB\-Wno-implicit\fR. This manual lists only one of the
+negative form beginning \fB\-Wno\-\fR to turn off warnings;
+for example, \fB\-Wno\-implicit\fR. This manual lists only one of the
two forms, whichever is not the default.
.PP
These options control the amount and kinds of warnings produced by \s-1GCC:\s0
-.Ip "\fB\-fsyntax-only\fR" 4
+.IP "\fB\-fsyntax\-only\fR" 4
.IX Item "-fsyntax-only"
Check the code for syntax errors, but don't do anything beyond that.
-.Ip "\fB\-pedantic\fR" 4
+.IP "\fB\-pedantic\fR" 4
.IX Item "-pedantic"
Issue all the warnings demanded by strict \s-1ISO\s0 C and \s-1ISO\s0 \*(C+;
reject all programs that use forbidden extensions, and some other
@@ -1515,26 +1553,36 @@ A feature to report any failure to conform to \s-1ISO\s0 C might be useful in
some instances, but would require considerable additional work and would
be quite different from \fB\-pedantic\fR. We don't have plans to
support such a feature in the near future.
-.Ip "\fB\-pedantic-errors\fR" 4
+.Sp
+Where the standard specified with \fB\-std\fR represents a \s-1GNU\s0
+extended dialect of C, such as \fBgnu89\fR or \fBgnu99\fR, there is a
+corresponding \fIbase standard\fR, the version of \s-1ISO\s0 C on which the \s-1GNU\s0
+extended dialect is based. Warnings from \fB\-pedantic\fR are given
+where they are required by the base standard. (It would not make sense
+for such warnings to be given only for features not in the specified \s-1GNU\s0
+C dialect, since by definition the \s-1GNU\s0 dialects of C include all
+features the compiler supports with the given option, and there would be
+nothing to warn about.)
+.IP "\fB\-pedantic\-errors\fR" 4
.IX Item "-pedantic-errors"
Like \fB\-pedantic\fR, except that errors are produced rather than
warnings.
-.Ip "\fB\-w\fR" 4
+.IP "\fB\-w\fR" 4
.IX Item "-w"
Inhibit all warning messages.
-.Ip "\fB\-Wno-import\fR" 4
+.IP "\fB\-Wno\-import\fR" 4
.IX Item "-Wno-import"
Inhibit warning messages about the use of \fB#import\fR.
-.Ip "\fB\-Wchar-subscripts\fR" 4
+.IP "\fB\-Wchar\-subscripts\fR" 4
.IX Item "-Wchar-subscripts"
Warn if an array subscript has type \f(CW\*(C`char\*(C'\fR. This is a common cause
of error, as programmers often forget that this type is signed on some
machines.
-.Ip "\fB\-Wcomment\fR" 4
+.IP "\fB\-Wcomment\fR" 4
.IX Item "-Wcomment"
Warn whenever a comment-start sequence \fB/*\fR appears in a \fB/*\fR
comment, or whenever a Backslash-Newline appears in a \fB//\fR comment.
-.Ip "\fB\-Wformat\fR" 4
+.IP "\fB\-Wformat\fR" 4
.IX Item "-Wformat"
Check calls to \f(CW\*(C`printf\*(C'\fR and \f(CW\*(C`scanf\*(C'\fR, etc., to make sure that
the arguments supplied have types appropriate to the format string
@@ -1555,25 +1603,25 @@ in the selected standard version (but not for \f(CW\*(C`strfmon\*(C'\fR formats,
since those are not in any version of the C standard).
.Sp
\&\fB\-Wformat\fR is included in \fB\-Wall\fR. For more control over some
-aspects of format checking, the options \fB\-Wno-format-y2k\fR,
-\&\fB\-Wno-format-extra-args\fR, \fB\-Wformat-nonliteral\fR,
-\&\fB\-Wformat-security\fR and \fB\-Wformat=2\fR are available, but are
+aspects of format checking, the options \fB\-Wno\-format\-y2k\fR,
+\&\fB\-Wno\-format\-extra\-args\fR, \fB\-Wformat\-nonliteral\fR,
+\&\fB\-Wformat\-security\fR and \fB\-Wformat=2\fR are available, but are
not included in \fB\-Wall\fR.
-.Ip "\fB\-Wno-format-y2k\fR" 4
+.IP "\fB\-Wno\-format\-y2k\fR" 4
.IX Item "-Wno-format-y2k"
If \fB\-Wformat\fR is specified, do not warn about \f(CW\*(C`strftime\*(C'\fR
formats which may yield only a two-digit year.
-.Ip "\fB\-Wno-format-extra-args\fR" 4
+.IP "\fB\-Wno\-format\-extra\-args\fR" 4
.IX Item "-Wno-format-extra-args"
If \fB\-Wformat\fR is specified, do not warn about excess arguments to a
\&\f(CW\*(C`printf\*(C'\fR or \f(CW\*(C`scanf\*(C'\fR format function. The C standard specifies
that such arguments are ignored.
-.Ip "\fB\-Wformat-nonliteral\fR" 4
+.IP "\fB\-Wformat\-nonliteral\fR" 4
.IX Item "-Wformat-nonliteral"
If \fB\-Wformat\fR is specified, also warn if the format string is not a
string literal and so cannot be checked, unless the format function
takes its format arguments as a \f(CW\*(C`va_list\*(C'\fR.
-.Ip "\fB\-Wformat-security\fR" 4
+.IP "\fB\-Wformat\-security\fR" 4
.IX Item "-Wformat-security"
If \fB\-Wformat\fR is specified, also warn about uses of format
functions that represent possible security problems. At present, this
@@ -1581,39 +1629,49 @@ warns about calls to \f(CW\*(C`printf\*(C'\fR and \f(CW\*(C`scanf\*(C'\fR functi
format string is not a string literal and there are no format arguments,
as in \f(CW\*(C`printf (foo);\*(C'\fR. This may be a security hole if the format
string came from untrusted input and contains \fB%n\fR. (This is
-currently a subset of what \fB\-Wformat-nonliteral\fR warns about, but
-in future warnings may be added to \fB\-Wformat-security\fR that are not
-included in \fB\-Wformat-nonliteral\fR.)
-.Ip "\fB\-Wformat=2\fR" 4
+currently a subset of what \fB\-Wformat\-nonliteral\fR warns about, but
+in future warnings may be added to \fB\-Wformat\-security\fR that are not
+included in \fB\-Wformat\-nonliteral\fR.)
+.IP "\fB\-Wformat=2\fR" 4
.IX Item "-Wformat=2"
Enable \fB\-Wformat\fR plus format checks not included in
\&\fB\-Wformat\fR. Currently equivalent to \fB\-Wformat
-\&\-Wformat-nonliteral \-Wformat-security\fR.
-.Ip "\fB\-Wimplicit-int\fR" 4
+\&\-Wformat\-nonliteral \-Wformat\-security\fR.
+.IP "\fB\-Wimplicit\-int\fR" 4
.IX Item "-Wimplicit-int"
Warn when a declaration does not specify a type.
-.Ip "\fB\-Wimplicit-function-declaration\fR" 4
+.IP "\fB\-Wimplicit\-function\-declaration\fR" 4
.IX Item "-Wimplicit-function-declaration"
.PD 0
-.Ip "\fB\-Werror-implicit-function-declaration\fR" 4
+.IP "\fB\-Werror\-implicit\-function\-declaration\fR" 4
.IX Item "-Werror-implicit-function-declaration"
.PD
Give a warning (or error) whenever a function is used before being
declared.
-.Ip "\fB\-Wimplicit\fR" 4
+.IP "\fB\-Wimplicit\fR" 4
.IX Item "-Wimplicit"
-Same as \fB\-Wimplicit-int\fR and \fB\-Wimplicit-function-\fR\fBdeclaration\fR.
-.Ip "\fB\-Wmain\fR" 4
+Same as \fB\-Wimplicit\-int\fR and \fB\-Wimplicit\-function\-declaration\fR.
+.IP "\fB\-Wmain\fR" 4
.IX Item "-Wmain"
Warn if the type of \fBmain\fR is suspicious. \fBmain\fR should be a
function with external linkage, returning int, taking either zero
arguments, two, or three arguments of appropriate types.
-.Ip "\fB\-Wmultichar\fR" 4
+.IP "\fB\-Wmissing\-braces\fR" 4
+.IX Item "-Wmissing-braces"
+Warn if an aggregate or union initializer is not fully bracketed. In
+the following example, the initializer for \fBa\fR is not fully
+bracketed, but that for \fBb\fR is fully bracketed.
+.Sp
+.Vb 2
+\& int a[2][2] = { 0, 1, 2, 3 };
+\& int b[2][2] = { { 0, 1 }, { 2, 3 } };
+.Ve
+.IP "\fB\-Wmultichar\fR" 4
.IX Item "-Wmultichar"
Warn if a multicharacter constant (\fB'\s-1FOOF\s0'\fR) is used. Usually they
indicate a typo in the user's code, as they have implementation-defined
values, and should not be used in portable code.
-.Ip "\fB\-Wparentheses\fR" 4
+.IP "\fB\-Wparentheses\fR" 4
.IX Item "-Wparentheses"
Warn if parentheses are omitted in certain contexts, such
as when there is an assignment in a context where a truth value
@@ -1633,11 +1691,12 @@ such a case:
\& bar ();
\& }
.Ve
+.Sp
In C, every \f(CW\*(C`else\*(C'\fR branch belongs to the innermost possible \f(CW\*(C`if\*(C'\fR
statement, which in this example is \f(CW\*(C`if (b)\*(C'\fR. This is often not
what the programmer expected, as illustrated in the above example by
indentation the programmer chose. When there is the potential for this
-confusion, \s-1GNU\s0 C will issue a warning when this flag is specified.
+confusion, \s-1GCC\s0 will issue a warning when this flag is specified.
To eliminate the warning, add explicit braces around the innermost
\&\f(CW\*(C`if\*(C'\fR statement so there is no way the \f(CW\*(C`else\*(C'\fR could belong to
the enclosing \f(CW\*(C`if\*(C'\fR. The resulting code would look like this:
@@ -1653,7 +1712,7 @@ the enclosing \f(CW\*(C`if\*(C'\fR. The resulting code would look like this:
\& }
\& }
.Ve
-.Ip "\fB\-Wsequence-point\fR" 4
+.IP "\fB\-Wsequence\-point\fR" 4
.IX Item "-Wsequence-point"
Warn about code that may have undefined semantics because of violations
of sequence point rules in the C standard.
@@ -1694,68 +1753,62 @@ The present implementation of this option only works for C programs. A
future implementation may also work for \*(C+ programs.
.Sp
There is some controversy over the precise meaning of the sequence point
-rules in subtle cases. Alternative formal definitions may be found in
-Clive Feather's ``Annex S''
-<\fBhttp://wwwold.dkuug.dk/JTC1/SC22/WG14/www/docs/n925.htm\fR> and in
-Michael Norrish's thesis
-<\fBhttp://www.cl.cam.ac.uk/users/mn200/PhD/thesis-report.ps.gz\fR>.
-Other discussions are by Raymond Mak
-<\fBhttp://wwwold.dkuug.dk/JTC1/SC22/WG14/www/docs/n926.htm\fR> and
-D. Hugh Redelmeier
-<\fBhttp://wwwold.dkuug.dk/JTC1/SC22/WG14/www/docs/n927.htm\fR>.
-.Ip "\fB\-Wreturn-type\fR" 4
+rules in subtle cases. Links to papers with alternative formal definitions
+and other related discussions may be found on our readings page
+<\fBhttp://gcc.gnu.org/readings.html\fR>.
+.IP "\fB\-Wreturn\-type\fR" 4
.IX Item "-Wreturn-type"
Warn whenever a function is defined with a return-type that defaults to
\&\f(CW\*(C`int\*(C'\fR. Also warn about any \f(CW\*(C`return\*(C'\fR statement with no
-return-value in a function whose return-type is not \f(CW\*(C`void\*(C'\fR.
+return-value in a function whose return-type is not \f(CW\*(C`void\*(C'\fR.
.Sp
For \*(C+, a function without return type always produces a diagnostic
-message, even when \fB\-Wno-return-type\fR is specified. The only
+message, even when \fB\-Wno\-return\-type\fR is specified. The only
exceptions are \fBmain\fR and functions defined in system headers.
-.Ip "\fB\-Wswitch\fR" 4
+.IP "\fB\-Wswitch\fR" 4
.IX Item "-Wswitch"
Warn whenever a \f(CW\*(C`switch\*(C'\fR statement has an index of enumeral type
and lacks a \f(CW\*(C`case\*(C'\fR for one or more of the named codes of that
enumeration. (The presence of a \f(CW\*(C`default\*(C'\fR label prevents this
warning.) \f(CW\*(C`case\*(C'\fR labels outside the enumeration range also
provoke warnings when this option is used.
-.Ip "\fB\-Wtrigraphs\fR" 4
+.IP "\fB\-Wtrigraphs\fR" 4
.IX Item "-Wtrigraphs"
Warn if any trigraphs are encountered that might change the meaning of
the program (trigraphs within comments are not warned about).
-.Ip "\fB\-Wunused-function\fR" 4
+.IP "\fB\-Wunused\-function\fR" 4
.IX Item "-Wunused-function"
Warn whenever a static function is declared but not defined or a
-non\e-inline static function is unused.
-.Ip "\fB\-Wunused-label\fR" 4
+non\e\-inline static function is unused.
+.IP "\fB\-Wunused\-label\fR" 4
.IX Item "-Wunused-label"
Warn whenever a label is declared but not used.
.Sp
To suppress this warning use the \fBunused\fR attribute.
-.Ip "\fB\-Wunused-parameter\fR" 4
+.IP "\fB\-Wunused\-parameter\fR" 4
.IX Item "-Wunused-parameter"
Warn whenever a function parameter is unused aside from its declaration.
.Sp
To suppress this warning use the \fBunused\fR attribute.
-.Ip "\fB\-Wunused-variable\fR" 4
+.IP "\fB\-Wunused\-variable\fR" 4
.IX Item "-Wunused-variable"
Warn whenever a local variable or non-constant static variable is unused
aside from its declaration
.Sp
To suppress this warning use the \fBunused\fR attribute.
-.Ip "\fB\-Wunused-value\fR" 4
+.IP "\fB\-Wunused\-value\fR" 4
.IX Item "-Wunused-value"
Warn whenever a statement computes a result that is explicitly not used.
.Sp
To suppress this warning cast the expression to \fBvoid\fR.
-.Ip "\fB\-Wunused\fR" 4
+.IP "\fB\-Wunused\fR" 4
.IX Item "-Wunused"
All all the above \fB\-Wunused\fR options combined.
.Sp
In order to get a warning about an unused function parameter, you must
either specify \fB\-W \-Wunused\fR or separately specify
-\&\fB\-Wunused-parameter\fR.
-.Ip "\fB\-Wuninitialized\fR" 4
+\&\fB\-Wunused\-parameter\fR.
+.IP "\fB\-Wuninitialized\fR" 4
.IX Item "-Wuninitialized"
Warn if an automatic variable is used without first being initialized or
if a variable may be clobbered by a \f(CW\*(C`setjmp\*(C'\fR call.
@@ -1795,6 +1848,7 @@ this can happen:
\& foo (x);
\& }
.Ve
+.Sp
If the value of \f(CW\*(C`y\*(C'\fR is always 1, 2 or 3, then \f(CW\*(C`x\*(C'\fR is
always initialized, but \s-1GCC\s0 doesn't know this. Here is
another common case:
@@ -1807,6 +1861,7 @@ another common case:
\& if (change_y) y = save_y;
\& }
.Ve
+.Sp
This has no bug because \f(CW\*(C`save_y\*(C'\fR is used only if it is set.
.Sp
This option also warns when a non-volatile automatic variable might be
@@ -1821,23 +1876,23 @@ in fact be called at the place which would cause a problem.
.Sp
Some spurious warnings can be avoided if you declare all the functions
you use that never return as \f(CW\*(C`noreturn\*(C'\fR.
-.Ip "\fB\-Wreorder (\*(C+ only)\fR" 4
+.IP "\fB\-Wreorder\fR (\*(C+ only)" 4
.IX Item "-Wreorder ( only)"
Warn when the order of member initializers given in the code does not
match the order in which they must be executed. For instance:
-.Ip "\fB\-Wunknown-pragmas\fR" 4
+.IP "\fB\-Wunknown\-pragmas\fR" 4
.IX Item "-Wunknown-pragmas"
Warn when a #pragma directive is encountered which is not understood by
\&\s-1GCC\s0. If this command line option is used, warnings will even be issued
for unknown pragmas in system header files. This is not the case if
the warnings were only enabled by the \fB\-Wall\fR command line option.
-.Ip "\fB\-Wall\fR" 4
+.IP "\fB\-Wall\fR" 4
.IX Item "-Wall"
All of the above \fB\-W\fR options combined. This enables all the
warnings about constructions that some users consider questionable, and
that are easy to avoid (or modify to prevent the warning), even in
conjunction with macros.
-.Ip "\fB\-Wsystem-headers\fR" 4
+.IP "\fB\-Wsystem\-headers\fR" 4
.IX Item "-Wsystem-headers"
Print warning messages for constructs found in system header files.
Warnings from system headers are normally suppressed, on the assumption
@@ -1846,7 +1901,7 @@ compiler output harder to read. Using this command line option tells
\&\s-1GCC\s0 to emit warnings from system headers as if they occurred in user
code. However, note that using \fB\-Wall\fR in conjunction with this
option will \fInot\fR warn about unknown pragmas in system
-headers\-\-\-for that, \fB\-Wunknown-pragmas\fR must also be used.
+headers\-\-\-for that, \fB\-Wunknown\-pragmas\fR must also be used.
.PP
The following \fB\-W...\fR options are not implied by \fB\-Wall\fR.
Some of them warn about constructions that users generally do not
@@ -1854,11 +1909,11 @@ consider questionable, but which occasionally you might wish to check
for; others warn about constructions that are necessary or hard to avoid
in some cases, and there is no simple way to modify the code to suppress
the warning.
-.Ip "\fB\-W\fR" 4
+.IP "\fB\-W\fR" 4
.IX Item "-W"
Print extra warning messages for these events:
.RS 4
-.Ip "\(bu" 4
+.IP "\(bu" 4
A function can return either with or without a value. (Falling
off the end of the function body is considered returning without
a value.) For example, this function would evoke such a
@@ -1871,35 +1926,35 @@ warning:
\& return a;
\& }
.Ve
-.Ip "\(bu" 4
+.IP "\(bu" 4
An expression-statement or the left-hand side of a comma expression
contains no side effects.
To suppress the warning, cast the unused expression to void.
For example, an expression such as \fBx[i,j]\fR will cause a warning,
but \fBx[(void)i,j]\fR will not.
-.Ip "\(bu" 4
+.IP "\(bu" 4
An unsigned value is compared against zero with \fB<\fR or \fB<=\fR.
-.Ip "\(bu" 4
+.IP "\(bu" 4
A comparison like \fBx<=y<=z\fR appears; this is equivalent to
\&\fB(x<=y ? 1 : 0) <= z\fR, which is a different interpretation from
that of ordinary mathematical notation.
-.Ip "\(bu" 4
+.IP "\(bu" 4
Storage-class specifiers like \f(CW\*(C`static\*(C'\fR are not the first things in
a declaration. According to the C Standard, this usage is obsolescent.
-.Ip "\(bu" 4
+.IP "\(bu" 4
The return type of a function has a type qualifier such as \f(CW\*(C`const\*(C'\fR.
Such a type qualifier has no effect, since the value returned by a
function is not an lvalue. (But don't warn about the \s-1GNU\s0 extension of
\&\f(CW\*(C`volatile void\*(C'\fR return types. That extension will be warned about
if \fB\-pedantic\fR is specified.)
-.Ip "\(bu" 4
+.IP "\(bu" 4
If \fB\-Wall\fR or \fB\-Wunused\fR is also specified, warn about unused
arguments.
-.Ip "\(bu" 4
+.IP "\(bu" 4
A comparison between signed and unsigned values could produce an
incorrect result when the signed value is converted to unsigned.
-(But don't warn if \fB\-Wno-sign-compare\fR is also specified.)
-.Ip "\(bu" 4
+(But don't warn if \fB\-Wno\-sign\-compare\fR is also specified.)
+.IP "\(bu" 4
An aggregate has a partly bracketed initializer.
For example, the following code would evoke such a warning,
because braces are missing around the initializer for \f(CW\*(C`x.h\*(C'\fR:
@@ -1909,7 +1964,7 @@ because braces are missing around the initializer for \f(CW\*(C`x.h\*(C'\fR:
\& struct t { struct s h; int i; };
\& struct t x = { 1, 2, 3 };
.Ve
-.Ip "\(bu" 4
+.IP "\(bu" 4
An aggregate has an initializer which does not initialize all members.
For example, the following code would cause such a warning, because
\&\f(CW\*(C`x.h\*(C'\fR would be implicitly initialized to zero:
@@ -1921,7 +1976,7 @@ For example, the following code would cause such a warning, because
.RE
.RS 4
.RE
-.Ip "\fB\-Wfloat-equal\fR" 4
+.IP "\fB\-Wfloat\-equal\fR" 4
.IX Item "-Wfloat-equal"
Warn if floating point values are used in equality comparisons.
.Sp
@@ -1935,101 +1990,121 @@ different problem). In particular, instead of testing for equality, you
would check to see whether the two values have ranges that overlap; and
this is done with the relational operators, so equality comparisons are
probably mistaken.
-.Ip "\fB\-Wtraditional (C only)\fR" 4
+.IP "\fB\-Wtraditional\fR (C only)" 4
.IX Item "-Wtraditional (C only)"
Warn about certain constructs that behave differently in traditional and
-\&\s-1ISO\s0 C.
+\&\s-1ISO\s0 C. Also warn about \s-1ISO\s0 C constructs that have no traditional C
+equivalent, and/or problematic constructs which should be avoided.
.RS 4
-.Ip "\(bu" 4
-Macro arguments occurring within string constants in the macro body.
-These would substitute the argument in traditional C, but are part of
-the constant in \s-1ISO\s0 C.
-.Ip "\(bu" 4
+.IP "\(bu" 4
+Macro parameters that appear within string literals in the macro body.
+In traditional C macro replacement takes place within string literals,
+but does not in \s-1ISO\s0 C.
+.IP "\(bu" 4
+In traditional C, some preprocessor directives did not exist.
+Traditional preprocessors would only consider a line to be a directive
+if the \fB#\fR appeared in column 1 on the line. Therefore
+\&\fB\-Wtraditional\fR warns about directives that traditional C
+understands but would ignore because the \fB#\fR does not appear as the
+first character on the line. It also suggests you hide directives like
+\&\fB#pragma\fR not understood by traditional C by indenting them. Some
+traditional implementations would not recognise \fB#elif\fR, so it
+suggests avoiding it altogether.
+.IP "\(bu" 4
+A function-like macro that appears without arguments.
+.IP "\(bu" 4
+The unary plus operator.
+.IP "\(bu" 4
+The \fBU\fR integer constant suffix, or the \fBF\fR or \fBL\fR floating point
+constant suffixes. (Traditional C does support the \fBL\fR suffix on integer
+constants.) Note, these suffixes appear in macros defined in the system
+headers of most modern systems, e.g. the \fB_MIN\fR/\fB_MAX\fR macros in \f(CW\*(C`<limits.h>\*(C'\fR.
+Use of these macros in user code might normally lead to spurious
+warnings, however gcc's integrated preprocessor has enough context to
+avoid warning in these cases.
+.IP "\(bu" 4
A function declared external in one block and then used after the end of
the block.
-.Ip "\(bu" 4
+.IP "\(bu" 4
A \f(CW\*(C`switch\*(C'\fR statement has an operand of type \f(CW\*(C`long\*(C'\fR.
-.Ip "\(bu" 4
-A non-\f(CW\*(C`static\*(C'\fR function declaration follows a \f(CW\*(C`static\*(C'\fR one.
+.IP "\(bu" 4
+A non\-\f(CW\*(C`static\*(C'\fR function declaration follows a \f(CW\*(C`static\*(C'\fR one.
This construct is not accepted by some traditional C compilers.
-.Ip "\(bu" 4
+.IP "\(bu" 4
The \s-1ISO\s0 type of an integer constant has a different width or
signedness from its traditional type. This warning is only issued if
the base of the constant is ten. I.e. hexadecimal or octal values, which
typically represent bit patterns, are not warned about.
-.Ip "\(bu" 4
+.IP "\(bu" 4
Usage of \s-1ISO\s0 string concatenation is detected.
-.Ip "\(bu" 4
-A function macro appears without arguments.
-.Ip "\(bu" 4
-The unary plus operator.
-.Ip "\(bu" 4
+.IP "\(bu" 4
Initialization of automatic aggregates.
-.Ip "\(bu" 4
+.IP "\(bu" 4
Identifier conflicts with labels. Traditional C lacks a separate
namespace for labels.
-.Ip "\(bu" 4
+.IP "\(bu" 4
Initialization of unions. If the initializer is zero, the warning is
omitted. This is done under the assumption that the zero initializer in
user code appears conditioned on e.g. \f(CW\*(C`_\|_STDC_\|_\*(C'\fR to avoid missing
initializer warnings and relies on default initialization to zero in the
traditional C case.
-.Ip "\(bu" 4
-The `U' integer constant suffix, or the `F' or `L' floating point
-constant suffixes. (Traditonal C does support the `L' suffix on integer
-constants.) Note, these suffixes appear in macros defined in the system
-headers of most modern systems, e.g. the _MIN/_MAX macros in limits.h.
-Use of these macros can lead to spurious warnings as they do not
-necessarily reflect whether the code in question is any less portable to
-traditional C given that suitable backup definitions are provided.
+.IP "\(bu" 4
+Conversions by prototypes between fixed/floating point values and vice
+versa. The absence of these prototypes when compiling with traditional
+C would cause serious problems. This is a subset of the possible
+conversion warnings, for the full set use \fB\-Wconversion\fR.
.RE
.RS 4
.RE
-.Ip "\fB\-Wundef\fR" 4
+.IP "\fB\-Wundef\fR" 4
.IX Item "-Wundef"
Warn if an undefined identifier is evaluated in an \fB#if\fR directive.
-.Ip "\fB\-Wshadow\fR" 4
+.IP "\fB\-Wshadow\fR" 4
.IX Item "-Wshadow"
-Warn whenever a local variable shadows another local variable.
-.Ip "\fB\-Wid-clash-\fR\fIlen\fR" 4
+Warn whenever a local variable shadows another local variable, parameter or
+global variable or whenever a built-in function is shadowed.
+.IP "\fB\-Wid\-clash\-\fR\fIlen\fR" 4
.IX Item "-Wid-clash-len"
Warn whenever two distinct identifiers match in the first \fIlen\fR
characters. This may help you prepare a program that will compile
with certain obsolete, brain-damaged compilers.
-.Ip "\fB\-Wlarger-than-\fR\fIlen\fR" 4
+.IP "\fB\-Wlarger\-than\-\fR\fIlen\fR" 4
.IX Item "-Wlarger-than-len"
Warn whenever an object of larger than \fIlen\fR bytes is defined.
-.Ip "\fB\-Wpointer-arith\fR" 4
+.IP "\fB\-Wpointer\-arith\fR" 4
.IX Item "-Wpointer-arith"
Warn about anything that depends on the ``size of'' a function type or
of \f(CW\*(C`void\*(C'\fR. \s-1GNU\s0 C assigns these types a size of 1, for
convenience in calculations with \f(CW\*(C`void *\*(C'\fR pointers and pointers
to functions.
-.Ip "\fB\-Wbad-function-cast (C only)\fR" 4
+.IP "\fB\-Wbad\-function\-cast\fR (C only)" 4
.IX Item "-Wbad-function-cast (C only)"
Warn whenever a function call is cast to a non-matching type.
For example, warn if \f(CW\*(C`int malloc()\*(C'\fR is cast to \f(CW\*(C`anything *\*(C'\fR.
-.Ip "\fB\-Wcast-qual\fR" 4
+.IP "\fB\-Wcast\-qual\fR" 4
.IX Item "-Wcast-qual"
Warn whenever a pointer is cast so as to remove a type qualifier from
the target type. For example, warn if a \f(CW\*(C`const char *\*(C'\fR is cast
to an ordinary \f(CW\*(C`char *\*(C'\fR.
-.Ip "\fB\-Wcast-align\fR" 4
+.IP "\fB\-Wcast\-align\fR" 4
.IX Item "-Wcast-align"
Warn whenever a pointer is cast such that the required alignment of the
target is increased. For example, warn if a \f(CW\*(C`char *\*(C'\fR is cast to
an \f(CW\*(C`int *\*(C'\fR on machines where integers can only be accessed at
-two- or four-byte boundaries.
-.Ip "\fB\-Wwrite-strings\fR" 4
+two\- or four-byte boundaries.
+.IP "\fB\-Wwrite\-strings\fR" 4
.IX Item "-Wwrite-strings"
-Give string constants the type \f(CW\*(C`const char[\f(CIlength\f(CW]\*(C'\fR so that
-copying the address of one into a non-\f(CW\*(C`const\*(C'\fR \f(CW\*(C`char *\*(C'\fR
-pointer will get a warning. These warnings will help you find at
+When compiling C, give string constants the type \f(CW\*(C`const
+char[\f(CIlength\f(CW]\*(C'\fR so that
+copying the address of one into a non\-\f(CW\*(C`const\*(C'\fR \f(CW\*(C`char *\*(C'\fR
+pointer will get a warning; when compiling \*(C+, warn about the
+deprecated conversion from string constants to \f(CW\*(C`char *\*(C'\fR.
+These warnings will help you find at
compile time code that can try to write into a string constant, but
only if you have been very careful about using \f(CW\*(C`const\*(C'\fR in
declarations and prototypes. Otherwise, it will just be a nuisance;
this is why we did not make \fB\-Wall\fR request these warnings.
-.Ip "\fB\-Wconversion\fR" 4
+.IP "\fB\-Wconversion\fR" 4
.IX Item "-Wconversion"
Warn if a prototype causes a type conversion that is different from what
would happen to the same argument in the absence of a prototype. This
@@ -2041,36 +2116,36 @@ Also, warn if a negative integer constant expression is implicitly
converted to an unsigned type. For example, warn about the assignment
\&\f(CW\*(C`x = \-1\*(C'\fR if \f(CW\*(C`x\*(C'\fR is unsigned. But do not warn about explicit
casts like \f(CW\*(C`(unsigned) \-1\*(C'\fR.
-.Ip "\fB\-Wsign-compare\fR" 4
+.IP "\fB\-Wsign\-compare\fR" 4
.IX Item "-Wsign-compare"
Warn when a comparison between signed and unsigned values could produce
an incorrect result when the signed value is converted to unsigned.
This warning is also enabled by \fB\-W\fR; to get the other warnings
-of \fB\-W\fR without this warning, use \fB\-W \-Wno-sign-compare\fR.
-.Ip "\fB\-Waggregate-return\fR" 4
+of \fB\-W\fR without this warning, use \fB\-W \-Wno\-sign\-compare\fR.
+.IP "\fB\-Waggregate\-return\fR" 4
.IX Item "-Waggregate-return"
Warn if any functions that return structures or unions are defined or
called. (In languages where you can return an array, this also elicits
a warning.)
-.Ip "\fB\-Wstrict-prototypes (C only)\fR" 4
+.IP "\fB\-Wstrict\-prototypes\fR (C only)" 4
.IX Item "-Wstrict-prototypes (C only)"
Warn if a function is declared or defined without specifying the
argument types. (An old-style function definition is permitted without
a warning if preceded by a declaration which specifies the argument
types.)
-.Ip "\fB\-Wmissing-prototypes (C only)\fR" 4
+.IP "\fB\-Wmissing\-prototypes\fR (C only)" 4
.IX Item "-Wmissing-prototypes (C only)"
Warn if a global function is defined without a previous prototype
declaration. This warning is issued even if the definition itself
provides a prototype. The aim is to detect global functions that fail
to be declared in header files.
-.Ip "\fB\-Wmissing-declarations\fR" 4
+.IP "\fB\-Wmissing\-declarations\fR" 4
.IX Item "-Wmissing-declarations"
Warn if a global function is defined without a previous declaration.
Do so even if the definition itself provides a prototype.
Use this option to detect global functions that are not declared in
header files.
-.Ip "\fB\-Wmissing-noreturn\fR" 4
+.IP "\fB\-Wmissing\-noreturn\fR" 4
.IX Item "-Wmissing-noreturn"
Warn about functions which might be candidates for attribute \f(CW\*(C`noreturn\*(C'\fR.
Note these are only possible candidates, not absolute ones. Care should
@@ -2078,7 +2153,7 @@ be taken to manually verify functions actually do not ever return before
adding the \f(CW\*(C`noreturn\*(C'\fR attribute, otherwise subtle code generation
bugs could be introduced. You will not get a warning for \f(CW\*(C`main\*(C'\fR in
hosted C environments.
-.Ip "\fB\-Wmissing-format-attribute\fR" 4
+.IP "\fB\-Wmissing\-format\-attribute\fR" 4
.IX Item "-Wmissing-format-attribute"
If \fB\-Wformat\fR is enabled, also warn about functions which might be
candidates for \f(CW\*(C`format\*(C'\fR attributes. Note these are only possible
@@ -2088,10 +2163,10 @@ like \f(CW\*(C`vprintf\*(C'\fR or \f(CW\*(C`vscanf\*(C'\fR, but this might not a
case, and some functions for which \f(CW\*(C`format\*(C'\fR attributes are
appropriate may not be detected. This option has no effect unless
\&\fB\-Wformat\fR is enabled (possibly by \fB\-Wall\fR).
-.Ip "\fB\-Wpacked\fR" 4
+.IP "\fB\-Wpacked\fR" 4
.IX Item "-Wpacked"
Warn if a structure is given the packed attribute, but the packed
-attribute has no effect on the layout or size of the structure.
+attribute has no effect on the layout or size of the structure.
Such structures may be mis-aligned for little benefit. For
instance, in this code, the variable \f(CW\*(C`f.x\*(C'\fR in \f(CW\*(C`struct bar\*(C'\fR
will be misaligned even though \f(CW\*(C`struct bar\*(C'\fR does not itself
@@ -2107,20 +2182,20 @@ have the packed attribute:
\& struct foo f;
\& };
.Ve
-.Ip "\fB\-Wpadded\fR" 4
+.IP "\fB\-Wpadded\fR" 4
.IX Item "-Wpadded"
Warn if padding is included in a structure, either to align an element
of the structure or to align the whole structure. Sometimes when this
happens it is possible to rearrange the fields of the structure to
reduce the padding and so make the structure smaller.
-.Ip "\fB\-Wredundant-decls\fR" 4
+.IP "\fB\-Wredundant\-decls\fR" 4
.IX Item "-Wredundant-decls"
Warn if anything is declared more than once in the same scope, even in
cases where multiple declaration is valid and changes nothing.
-.Ip "\fB\-Wnested-externs (C only)\fR" 4
+.IP "\fB\-Wnested\-externs\fR (C only)" 4
.IX Item "-Wnested-externs (C only)"
Warn if an \f(CW\*(C`extern\*(C'\fR declaration is encountered within a function.
-.Ip "\fB\-Wunreachable-code\fR" 4
+.IP "\fB\-Wunreachable\-code\fR" 4
.IX Item "-Wunreachable-code"
Warn if the compiler detects that code will never be executed.
.Sp
@@ -2134,23 +2209,23 @@ are circumstances under which part of the affected line can be executed,
so care should be taken when removing apparently-unreachable code.
.Sp
For instance, when a function is inlined, a warning may mean that the
-line is unreachable in only one inlined copy of the function.
+line is unreachable in only one inlined copy of the function.
.Sp
This option is not made part of \fB\-Wall\fR because in a debugging
version of a program there is often substantial code which checks
correct functioning of the program and is, hopefully, unreachable
because the program does work. Another common use of unreachable
-code is to provide behaviour which is selectable at compile-time.
-.Ip "\fB\-Winline\fR" 4
+code is to provide behaviour which is selectable at compile\-time.
+.IP "\fB\-Winline\fR" 4
.IX Item "-Winline"
Warn if a function can not be inlined and it was declared as inline.
-.Ip "\fB\-Wlong-long\fR" 4
+.IP "\fB\-Wlong\-long\fR" 4
.IX Item "-Wlong-long"
Warn if \fBlong long\fR type is used. This is default. To inhibit
-the warning messages, use \fB\-Wno-long-long\fR. Flags
-\&\fB\-Wlong-long\fR and \fB\-Wno-long-long\fR are taken into account
+the warning messages, use \fB\-Wno\-long\-long\fR. Flags
+\&\fB\-Wlong\-long\fR and \fB\-Wno\-long\-long\fR are taken into account
only when \fB\-pedantic\fR flag is used.
-.Ip "\fB\-Wdisabled-optimization\fR" 4
+.IP "\fB\-Wdisabled\-optimization\fR" 4
.IX Item "-Wdisabled-optimization"
Warn if a requested optimization pass is disabled. This warning does
not generally indicate that there is anything wrong with your code; it
@@ -2158,14 +2233,14 @@ merely indicates that \s-1GCC\s0's optimizers were unable to handle the code
effectively. Often, the problem is that your code is too big or too
complex; \s-1GCC\s0 will refuse to optimize programs when the optimization
itself is likely to take inordinate amounts of time.
-.Ip "\fB\-Werror\fR" 4
+.IP "\fB\-Werror\fR" 4
.IX Item "-Werror"
Make all warnings into errors.
.Sh "Options for Debugging Your Program or \s-1GCC\s0"
.IX Subsection "Options for Debugging Your Program or GCC"
\&\s-1GCC\s0 has various special options that are used for debugging
either your program or \s-1GCC:\s0
-.Ip "\fB\-g\fR" 4
+.IP "\fB\-g\fR" 4
.IX Item "-g"
Produce debugging information in the operating system's native format
(stabs, \s-1COFF\s0, \s-1XCOFF\s0, or \s-1DWARF\s0). \s-1GDB\s0 can work with this debugging
@@ -2177,7 +2252,7 @@ makes debugging work better in \s-1GDB\s0 but will probably make other debuggers
crash or
refuse to read the program. If you want to control for certain whether
to generate the extra information, use \fB\-gstabs+\fR, \fB\-gstabs\fR,
-\&\fB\-gxcoff+\fR, \fB\-gxcoff\fR, \fB\-gdwarf-1+\fR, or \fB\-gdwarf-1\fR
+\&\fB\-gxcoff+\fR, \fB\-gxcoff\fR, \fB\-gdwarf\-1+\fR, or \fB\-gdwarf\-1\fR
(see below).
.Sp
Unlike most other C compilers, \s-1GCC\s0 allows you to use \fB\-g\fR with
@@ -2193,70 +2268,70 @@ it reasonable to use the optimizer for programs that might have bugs.
.Sp
The following options are useful when \s-1GCC\s0 is generated with the
capability for more than one debugging format.
-.Ip "\fB\-ggdb\fR" 4
+.IP "\fB\-ggdb\fR" 4
.IX Item "-ggdb"
Produce debugging information for use by \s-1GDB\s0. This means to use the
most expressive format available (\s-1DWARF\s0 2, stabs, or the native format
if neither of those are supported), including \s-1GDB\s0 extensions if at all
possible.
-.Ip "\fB\-gstabs\fR" 4
+.IP "\fB\-gstabs\fR" 4
.IX Item "-gstabs"
Produce debugging information in stabs format (if that is supported),
without \s-1GDB\s0 extensions. This is the format used by \s-1DBX\s0 on most \s-1BSD\s0
systems. On \s-1MIPS\s0, Alpha and System V Release 4 systems this option
produces stabs debugging output which is not understood by \s-1DBX\s0 or \s-1SDB\s0.
On System V Release 4 systems this option requires the \s-1GNU\s0 assembler.
-.Ip "\fB\-gstabs+\fR" 4
+.IP "\fB\-gstabs+\fR" 4
.IX Item "-gstabs+"
Produce debugging information in stabs format (if that is supported),
using \s-1GNU\s0 extensions understood only by the \s-1GNU\s0 debugger (\s-1GDB\s0). The
use of these extensions is likely to make other debuggers crash or
refuse to read the program.
-.Ip "\fB\-gcoff\fR" 4
+.IP "\fB\-gcoff\fR" 4
.IX Item "-gcoff"
Produce debugging information in \s-1COFF\s0 format (if that is supported).
This is the format used by \s-1SDB\s0 on most System V systems prior to
System V Release 4.
-.Ip "\fB\-gxcoff\fR" 4
+.IP "\fB\-gxcoff\fR" 4
.IX Item "-gxcoff"
Produce debugging information in \s-1XCOFF\s0 format (if that is supported).
This is the format used by the \s-1DBX\s0 debugger on \s-1IBM\s0 \s-1RS/6000\s0 systems.
-.Ip "\fB\-gxcoff+\fR" 4
+.IP "\fB\-gxcoff+\fR" 4
.IX Item "-gxcoff+"
Produce debugging information in \s-1XCOFF\s0 format (if that is supported),
using \s-1GNU\s0 extensions understood only by the \s-1GNU\s0 debugger (\s-1GDB\s0). The
use of these extensions is likely to make other debuggers crash or
refuse to read the program, and may cause assemblers other than the \s-1GNU\s0
assembler (\s-1GAS\s0) to fail with an error.
-.Ip "\fB\-gdwarf\fR" 4
+.IP "\fB\-gdwarf\fR" 4
.IX Item "-gdwarf"
Produce debugging information in \s-1DWARF\s0 version 1 format (if that is
supported). This is the format used by \s-1SDB\s0 on most System V Release 4
systems.
-.Ip "\fB\-gdwarf+\fR" 4
+.IP "\fB\-gdwarf+\fR" 4
.IX Item "-gdwarf+"
Produce debugging information in \s-1DWARF\s0 version 1 format (if that is
supported), using \s-1GNU\s0 extensions understood only by the \s-1GNU\s0 debugger
(\s-1GDB\s0). The use of these extensions is likely to make other debuggers
crash or refuse to read the program.
-.Ip "\fB\-gdwarf-2\fR" 4
+.IP "\fB\-gdwarf\-2\fR" 4
.IX Item "-gdwarf-2"
Produce debugging information in \s-1DWARF\s0 version 2 format (if that is
supported). This is the format used by \s-1DBX\s0 on \s-1IRIX\s0 6.
-.Ip "\fB\-g\fR\fIlevel\fR" 4
+.IP "\fB\-g\fR\fIlevel\fR" 4
.IX Item "-glevel"
.PD 0
-.Ip "\fB\-ggdb\fR\fIlevel\fR" 4
+.IP "\fB\-ggdb\fR\fIlevel\fR" 4
.IX Item "-ggdblevel"
-.Ip "\fB\-gstabs\fR\fIlevel\fR" 4
+.IP "\fB\-gstabs\fR\fIlevel\fR" 4
.IX Item "-gstabslevel"
-.Ip "\fB\-gcoff\fR\fIlevel\fR" 4
+.IP "\fB\-gcoff\fR\fIlevel\fR" 4
.IX Item "-gcofflevel"
-.Ip "\fB\-gxcoff\fR\fIlevel\fR" 4
+.IP "\fB\-gxcoff\fR\fIlevel\fR" 4
.IX Item "-gxcofflevel"
-.Ip "\fB\-gdwarf\fR\fIlevel\fR" 4
+.IP "\fB\-gdwarf\fR\fIlevel\fR" 4
.IX Item "-gdwarflevel"
-.Ip "\fB\-gdwarf-2\fR\fIlevel\fR" 4
+.IP "\fB\-gdwarf\-2\fR\fIlevel\fR" 4
.IX Item "-gdwarf-2level"
.PD
Request debugging information and also use \fIlevel\fR to specify how
@@ -2270,19 +2345,19 @@ about local variables and no line numbers.
Level 3 includes extra information, such as all the macro definitions
present in the program. Some debuggers support macro expansion when
you use \fB\-g3\fR.
-.Ip "\fB\-p\fR" 4
+.IP "\fB\-p\fR" 4
.IX Item "-p"
Generate extra code to write profile information suitable for the
analysis program \f(CW\*(C`prof\*(C'\fR. You must use this option when compiling
the source files you want data about, and you must also use it when
linking.
-.Ip "\fB\-pg\fR" 4
+.IP "\fB\-pg\fR" 4
.IX Item "-pg"
Generate extra code to write profile information suitable for the
analysis program \f(CW\*(C`gprof\*(C'\fR. You must use this option when compiling
the source files you want data about, and you must also use it when
linking.
-.Ip "\fB\-a\fR" 4
+.IP "\fB\-a\fR" 4
.IX Item "-a"
Generate extra code to write profile information for basic blocks, which will
record the number of times each basic block is executed, the basic block start
@@ -2294,11 +2369,19 @@ to append to the text file \fIbb.out\fR.
This data could be analyzed by a program like \f(CW\*(C`tcov\*(C'\fR. Note,
however, that the format of the data is not what \f(CW\*(C`tcov\*(C'\fR expects.
Eventually \s-1GNU\s0 \f(CW\*(C`gprof\*(C'\fR should be extended to process this data.
-.Ip "\fB\-Q\fR" 4
+.IP "\fB\-Q\fR" 4
.IX Item "-Q"
Makes the compiler print out each function name as it is compiled, and
print some statistics about each pass when it finishes.
-.Ip "\fB\-ax\fR" 4
+.IP "\fB\-ftime\-report\fR" 4
+.IX Item "-ftime-report"
+Makes the compiler print some statistics about the time consumed by each
+pass when it finishes.
+.IP "\fB\-fmem\-report\fR" 4
+.IX Item "-fmem-report"
+Makes the compiler print some statistics about permanent memory
+allocation when it finishes.
+.IP "\fB\-ax\fR" 4
.IX Item "-ax"
Generate extra code to profile basic blocks. Your executable will
produce output that is a superset of that produced when \fB\-a\fR is
@@ -2311,27 +2394,27 @@ You can examine different profiling aspects without recompilation. Your
executable will read a list of function names from file \fIbb.in\fR.
Profiling starts when a function on the list is entered and stops when
that invocation is exited. To exclude a function from profiling, prefix
-its name with `\-'. If a function name is not unique, you can
+its name with \fB\-\fR. If a function name is not unique, you can
disambiguate it by writing it in the form
\&\fB/path/filename.d:functionname\fR. Your executable will write the
available paths and filenames in file \fIbb.out\fR.
.Sp
Several function names have a special meaning:
.RS 4
-.if n .Ip "\f(CW""_\|_bb_jumps_\|_""\fR" 4
-.el .Ip "\f(CW_\|_bb_jumps_\|_\fR" 4
+.ie n .IP """_\|_bb_jumps_\|_""" 4
+.el .IP "\f(CW_\|_bb_jumps_\|_\fR" 4
.IX Item "__bb_jumps__"
Write source, target and frequency of jumps to file \fIbb.out\fR.
-.if n .Ip "\f(CW""_\|_bb_hidecall_\|_""\fR" 4
-.el .Ip "\f(CW_\|_bb_hidecall_\|_\fR" 4
+.ie n .IP """_\|_bb_hidecall_\|_""" 4
+.el .IP "\f(CW_\|_bb_hidecall_\|_\fR" 4
.IX Item "__bb_hidecall__"
Exclude function calls from frequency count.
-.if n .Ip "\f(CW""_\|_bb_showret_\|_""\fR" 4
-.el .Ip "\f(CW_\|_bb_showret_\|_\fR" 4
+.ie n .IP """_\|_bb_showret_\|_""" 4
+.el .IP "\f(CW_\|_bb_showret_\|_\fR" 4
.IX Item "__bb_showret__"
Include function returns in frequency count.
-.if n .Ip "\f(CW""_\|_bb_trace_\|_""\fR" 4
-.el .Ip "\f(CW_\|_bb_trace_\|_\fR" 4
+.ie n .IP """_\|_bb_trace_\|_""" 4
+.el .IP "\f(CW_\|_bb_trace_\|_\fR" 4
.IX Item "__bb_trace__"
Write the sequence of basic blocks executed to file \fIbbtrace.gz\fR.
The file will be compressed using the program \fBgzip\fR, which must
@@ -2372,6 +2455,7 @@ frequencies:
\& Jump from block 0x2 to block 0x1 executed 1 time(s)
\& Jump from block 0x2 to block 0x4 executed 1 time(s)
.Ve
+.Sp
With \f(CW\*(C`_\|_bb_hidecall_\|_\*(C'\fR, control transfer due to call instructions
is removed from the trace, that is the trace is cut into three parts: 0
3 4, 0 1 2 and 0 1 2. With \f(CW\*(C`_\|_bb_showret_\|_\*(C'\fR, control transfer due
@@ -2380,7 +2464,7 @@ to return instructions is added to the trace. The trace becomes: 0 3 1
written to \fIbbtrace.gz\fR. It is solely used for counting jump
frequencies.
.RE
-.Ip "\fB\-fprofile-arcs\fR" 4
+.IP "\fB\-fprofile\-arcs\fR" 4
.IX Item "-fprofile-arcs"
Instrument \fIarcs\fR during compilation. For each function of your
program, \s-1GCC\s0 creates a program flow graph, then finds a spanning tree
@@ -2400,198 +2484,249 @@ flow graph until the entire graph has been solved. Hence, \f(CW\*(C`gcov\*(C'\f
runs a little more slowly than a program which uses information from
\&\fB\-a\fR.
.Sp
-\&\fB\-fprofile-arcs\fR also makes it possible to estimate branch
+\&\fB\-fprofile\-arcs\fR also makes it possible to estimate branch
probabilities, and to calculate basic block execution counts. In
general, basic block execution counts do not give enough information to
estimate all branch probabilities. When the compiled program exits, it
saves the arc execution counts to a file called
\&\fI\fIsourcename\fI.da\fR. Use the compiler option
-\&\fB\-fbranch-probabilities\fR when recompiling, to optimize using estimated
+\&\fB\-fbranch\-probabilities\fR when recompiling, to optimize using estimated
branch probabilities.
-.Ip "\fB\-ftest-coverage\fR" 4
+.IP "\fB\-ftest\-coverage\fR" 4
.IX Item "-ftest-coverage"
Create data files for the \f(CW\*(C`gcov\*(C'\fR code-coverage utility.
The data file names begin with the name of your source file:
.RS 4
-.Ip "\fIsourcename\fR\fB.bb\fR" 4
+.IP "\fIsourcename\fR\fB.bb\fR" 4
.IX Item "sourcename.bb"
A mapping from basic blocks to line numbers, which \f(CW\*(C`gcov\*(C'\fR uses to
associate basic block execution counts with line numbers.
-.Ip "\fIsourcename\fR\fB.bbg\fR" 4
+.IP "\fIsourcename\fR\fB.bbg\fR" 4
.IX Item "sourcename.bbg"
A list of all arcs in the program flow graph. This allows \f(CW\*(C`gcov\*(C'\fR
to reconstruct the program flow graph, so that it can compute all basic
block and arc execution counts from the information in the
\&\f(CW\*(C`\f(CIsourcename\f(CW.da\*(C'\fR file (this last file is the output from
-\&\fB\-fprofile-arcs\fR).
+\&\fB\-fprofile\-arcs\fR).
.RE
.RS 4
.RE
-.Ip "\fB\-d\fR\fIletters\fR" 4
+.IP "\fB\-d\fR\fIletters\fR" 4
.IX Item "-dletters"
Says to make debugging dumps during compilation at times specified by
\&\fIletters\fR. This is used for debugging the compiler. The file names
for most of the dumps are made by appending a pass number and a word to
-the source file name (e.g. \fIfoo.c.00.rtl\fR or \fIfoo.c.01.sibling\fR).
+the source file name (e.g. \fIfoo.c.00.rtl\fR or \fIfoo.c.01.sibling\fR).
Here are the possible letters for use in \fIletters\fR, and their meanings:
.RS 4
-.Ip "\fBA\fR" 4
+.IP "\fBA\fR" 4
.IX Item "A"
Annotate the assembler output with miscellaneous debugging information.
-.Ip "\fBb\fR" 4
+.IP "\fBb\fR" 4
.IX Item "b"
Dump after computing branch probabilities, to \fI\fIfile\fI.11.bp\fR.
-.Ip "\fBB\fR" 4
+.IP "\fBB\fR" 4
.IX Item "B"
Dump after block reordering, to \fI\fIfile\fI.26.bbro\fR.
-.Ip "\fBc\fR" 4
+.IP "\fBc\fR" 4
.IX Item "c"
Dump after instruction combination, to the file \fI\fIfile\fI.14.combine\fR.
-.Ip "\fBC\fR" 4
+.IP "\fBC\fR" 4
.IX Item "C"
Dump after the first if conversion, to the file \fI\fIfile\fI.15.ce\fR.
-.Ip "\fBd\fR" 4
+.IP "\fBd\fR" 4
.IX Item "d"
Dump after delayed branch scheduling, to \fI\fIfile\fI.29.dbr\fR.
-.Ip "\fBD\fR" 4
+.IP "\fBD\fR" 4
.IX Item "D"
Dump all macro definitions, at the end of preprocessing, in addition to
normal output.
-.Ip "\fBe\fR" 4
+.IP "\fBe\fR" 4
.IX Item "e"
Dump after \s-1SSA\s0 optimizations, to \fI\fIfile\fI.05.ssa\fR and
\&\fI\fIfile\fI.06.ussa\fR.
-.Ip "\fBE\fR" 4
+.IP "\fBE\fR" 4
.IX Item "E"
Dump after the second if conversion, to \fI\fIfile\fI.24.ce2\fR.
-.Ip "\fBf\fR" 4
+.IP "\fBf\fR" 4
.IX Item "f"
Dump after life analysis, to \fI\fIfile\fI.13.life\fR.
-.Ip "\fBF\fR" 4
+.IP "\fBF\fR" 4
.IX Item "F"
Dump after purging \f(CW\*(C`ADDRESSOF\*(C'\fR codes, to \fI\fIfile\fI.04.addressof\fR.
-.Ip "\fBg\fR" 4
+.IP "\fBg\fR" 4
.IX Item "g"
Dump after global register allocation, to \fI\fIfile\fI.19.greg\fR.
-.Ip "\fBo\fR" 4
+.IP "\fBo\fR" 4
.IX Item "o"
Dump after post-reload \s-1CSE\s0 and other optimizations, to \fI\fIfile\fI.20.postreload\fR.
-.Ip "\fBG\fR" 4
+.IP "\fBG\fR" 4
.IX Item "G"
Dump after \s-1GCSE\s0, to \fI\fIfile\fI.08.gcse\fR.
-.Ip "\fBi\fR" 4
+.IP "\fBi\fR" 4
.IX Item "i"
Dump after sibling call optimizations, to \fI\fIfile\fI.01.sibling\fR.
-.Ip "\fBj\fR" 4
+.IP "\fBj\fR" 4
.IX Item "j"
Dump after the first jump optimization, to \fI\fIfile\fI.02.jump\fR.
-.Ip "\fBJ\fR" 4
+.IP "\fBJ\fR" 4
.IX Item "J"
Dump after the last jump optimization, to \fI\fIfile\fI.27.jump2\fR.
-.Ip "\fBk\fR" 4
+.IP "\fBk\fR" 4
.IX Item "k"
Dump after conversion from registers to stack, to \fI\fIfile\fI.29.stack\fR.
-.Ip "\fBl\fR" 4
+.IP "\fBl\fR" 4
.IX Item "l"
Dump after local register allocation, to \fI\fIfile\fI.18.lreg\fR.
-.Ip "\fBL\fR" 4
+.IP "\fBL\fR" 4
.IX Item "L"
Dump after loop optimization, to \fI\fIfile\fI.09.loop\fR.
-.Ip "\fBM\fR" 4
+.IP "\fBM\fR" 4
.IX Item "M"
Dump after performing the machine dependent reorganisation pass, to
-\&\fI\fIfile\fI.28.mach\fR.
-.Ip "\fBn\fR" 4
+\&\fI\fIfile\fI.28.mach\fR.
+.IP "\fBn\fR" 4
.IX Item "n"
Dump after register renumbering, to \fI\fIfile\fI.23.rnreg\fR.
-.Ip "\fBN\fR" 4
+.IP "\fBN\fR" 4
.IX Item "N"
Dump after the register move pass, to \fI\fIfile\fI.16.regmove\fR.
-.Ip "\fBr\fR" 4
+.IP "\fBr\fR" 4
.IX Item "r"
Dump after \s-1RTL\s0 generation, to \fI\fIfile\fI.00.rtl\fR.
-.Ip "\fBR\fR" 4
+.IP "\fBR\fR" 4
.IX Item "R"
Dump after the second instruction scheduling pass, to
\&\fI\fIfile\fI.25.sched2\fR.
-.Ip "\fBs\fR" 4
+.IP "\fBs\fR" 4
.IX Item "s"
Dump after \s-1CSE\s0 (including the jump optimization that sometimes follows
-\&\s-1CSE\s0), to \fI\fIfile\fI.03.cse\fR.
-.Ip "\fBS\fR" 4
+\&\s-1CSE\s0), to \fI\fIfile\fI.03.cse\fR.
+.IP "\fBS\fR" 4
.IX Item "S"
Dump after the first instruction scheduling pass, to
\&\fI\fIfile\fI.17.sched\fR.
-.Ip "\fBt\fR" 4
+.IP "\fBt\fR" 4
.IX Item "t"
Dump after the second \s-1CSE\s0 pass (including the jump optimization that
sometimes follows \s-1CSE\s0), to \fI\fIfile\fI.10.cse2\fR.
-.Ip "\fBw\fR" 4
+.IP "\fBw\fR" 4
.IX Item "w"
Dump after the second flow pass, to \fI\fIfile\fI.21.flow2\fR.
-.Ip "\fBX\fR" 4
+.IP "\fBX\fR" 4
.IX Item "X"
Dump after dead code elimination, to \fI\fIfile\fI.06.dce\fR.
-.Ip "\fBz\fR" 4
+.IP "\fBz\fR" 4
.IX Item "z"
Dump after the peephole pass, to \fI\fIfile\fI.22.peephole2\fR.
-.Ip "\fBa\fR" 4
+.IP "\fBa\fR" 4
.IX Item "a"
Produce all the dumps listed above.
-.Ip "\fBm\fR" 4
+.IP "\fBm\fR" 4
.IX Item "m"
Print statistics on memory usage, at the end of the run, to
standard error.
-.Ip "\fBp\fR" 4
+.IP "\fBp\fR" 4
.IX Item "p"
Annotate the assembler output with a comment indicating which
pattern and alternative was used. The length of each instruction is
also printed.
-.Ip "\fBP\fR" 4
+.IP "\fBP\fR" 4
.IX Item "P"
Dump the \s-1RTL\s0 in the assembler output as a comment before each instruction.
Also turns on \fB\-dp\fR annotation.
-.Ip "\fBv\fR" 4
+.IP "\fBv\fR" 4
.IX Item "v"
For each of the other indicated dump files (except for
\&\fI\fIfile\fI.00.rtl\fR), dump a representation of the control flow graph
suitable for viewing with \s-1VCG\s0 to \fI\fIfile\fI.\fIpass\fI.vcg\fR.
-.Ip "\fBx\fR" 4
+.IP "\fBx\fR" 4
.IX Item "x"
Just generate \s-1RTL\s0 for a function instead of compiling it. Usually used
with \fBr\fR.
-.Ip "\fBy\fR" 4
+.IP "\fBy\fR" 4
.IX Item "y"
Dump debugging information during parsing, to standard error.
.RE
.RS 4
.RE
-.Ip "\fB\-fdump-unnumbered\fR" 4
+.IP "\fB\-fdump\-unnumbered\fR" 4
.IX Item "-fdump-unnumbered"
-When doing debugging dumps (see \-d option above), suppress instruction
+When doing debugging dumps (see \fB\-d\fR option above), suppress instruction
numbers and line number note output. This makes it more feasible to
use diff on debugging dumps for compiler invocations with different
-options, in particular with and without \-g.
-.Ip "\fB\-fdump-translation-unit-\fR\fIfile\fR \fB(C and \*(C+ only)\fR" 4
-.IX Item "-fdump-translation-unit-file (C and only)"
+options, in particular with and without \fB\-g\fR.
+.IP "\fB\-fdump\-translation\-unit\fR (C and \*(C+ only)" 4
+.IX Item "-fdump-translation-unit (C and only)"
+.PD 0
+.IP "\fB\-fdump\-translation\-unit\-\fR\fInumber\fR\fB \fR(C and \*(C+ only)" 4
+.IX Item "-fdump-translation-unit-number (C and only)"
+.PD
Dump a representation of the tree structure for the entire translation
-unit to \fIfile\fR.
-.Ip "\fB\-fpretend-float\fR" 4
+unit to a file. The file name is made by appending \fI.tu\fR to the
+source file name. If the \fB\-\fR\fInumber\fR form is used, \fInumber\fR
+controls the details of the dump as described for the \fB\-fdump\-tree\fR options.
+.IP "\fB\-fdump\-class\-hierarchy\fR (\*(C+ only)" 4
+.IX Item "-fdump-class-hierarchy ( only)"
+.PD 0
+.IP "\fB\-fdump\-class\-hierarchy\-\fR\fInumber\fR\fB \fR(\*(C+ only)" 4
+.IX Item "-fdump-class-hierarchy-number ( only)"
+.PD
+Dump a representation of each class's hierarchy and virtual function
+table layout to a file. The file name is made by appending \fI.class\fR
+to the source file name. If the \fB\-\fR\fInumber\fR form is used, \fInumber\fR
+controls the details of the dump as described for the \fB\-fdump\-tree\fR
+options.
+.IP "\fB\-fdump\-ast\-\fR\fIswitch\fR\fB \fR(\*(C+ only)" 4
+.IX Item "-fdump-ast-switch ( only)"
+.PD 0
+.IP "\fB\-fdump\-ast\-\fR\fIswitch\fR\fB\-\fR\fInumber\fR\fB \fR(\*(C+ only)" 4
+.IX Item "-fdump-ast-switch-number ( only)"
+.PD
+Control the dumping at various stages of processing the abstract syntax
+tree to a file. The file name is generated by appending a switch
+specific suffix to the source file name. If the \fB\-\fR\fInumber\fR form is
+used, \fInumber\fR is a bit mask which controls the details of the
+dump. The following bits are meaningful (these are not set symbolically,
+as the primary function of these dumps is for debugging gcc itself):
+.RS 4
+.IP "\fBbit0 (1)\fR" 4
+.IX Item "bit0 (1)"
+Print the address of each node. Usually this is not meaningful as it
+changes according to the environment and source file.
+.IP "\fBbit1 (2)\fR" 4
+.IX Item "bit1 (2)"
+Inhibit dumping of members of a scope or body of a function, unless they
+are reachable by some other path.
+.RE
+.RS 4
+.Sp
+The following tree dumps are possible:
+.IP "\fBoriginal\fR" 4
+.IX Item "original"
+Dump before any tree based optimization, to \fI\fIfile\fI.original\fR.
+.IP "\fBoptimized\fR" 4
+.IX Item "optimized"
+Dump after all tree based optimization, to \fI\fIfile\fI.optimized\fR.
+.RE
+.RS 4
+.RE
+.IP "\fB\-fpretend\-float\fR" 4
.IX Item "-fpretend-float"
-When running a cross-compiler, pretend that the target machine uses the
+When running a cross\-compiler, pretend that the target machine uses the
same floating point format as the host machine. This causes incorrect
output of the actual floating constants, but the actual instruction
sequence will probably be the same as \s-1GCC\s0 would make when running on
the target machine.
-.Ip "\fB\-save-temps\fR" 4
+.IP "\fB\-save\-temps\fR" 4
.IX Item "-save-temps"
Store the usual ``temporary'' intermediate files permanently; place them
in the current directory and name them based on the source file. Thus,
-compiling \fIfoo.c\fR with \fB\-c \-save-temps\fR would produce files
+compiling \fIfoo.c\fR with \fB\-c \-save\-temps\fR would produce files
\&\fIfoo.i\fR and \fIfoo.s\fR, as well as \fIfoo.o\fR. This creates a
preprocessed \fIfoo.i\fR output file even though the compiler now
normally uses an integrated preprocessor.
-.Ip "\fB\-time\fR" 4
+.IP "\fB\-time\fR" 4
.IX Item "-time"
Report the \s-1CPU\s0 time taken by each subprocess in the compilation
sequence. For C source files, this is the compiler proper and assembler
@@ -2601,30 +2736,43 @@ sequence. For C source files, this is the compiler proper and assembler
\& # cc1 0.12 0.01
\& # as 0.00 0.01
.Ve
+.Sp
The first number on each line is the ``user time,'' that is time spent
executing the program itself. The second number is ``system time,''
time spent executing operating system routines on behalf of the program.
Both numbers are in seconds.
-.Ip "\fB\-print-file-name=\fR\fIlibrary\fR" 4
+.IP "\fB\-print\-file\-name=\fR\fIlibrary\fR" 4
.IX Item "-print-file-name=library"
Print the full absolute name of the library file \fIlibrary\fR that
would be used when linking\-\-\-and don't do anything else. With this
option, \s-1GCC\s0 does not compile or link anything; it just prints the
file name.
-.Ip "\fB\-print-prog-name=\fR\fIprogram\fR" 4
+.IP "\fB\-print\-multi\-directory\fR" 4
+.IX Item "-print-multi-directory"
+Print the directory name corresponding to the multilib selected by any
+other switches present in the command line. This directory is supposed
+to exist in \fB\s-1GCC_EXEC_PREFIX\s0\fR.
+.IP "\fB\-print\-multi\-lib\fR" 4
+.IX Item "-print-multi-lib"
+Print the mapping from multilib directory names to compiler switches
+that enable them. The directory name is separated from the switches by
+\&\fB;\fR, and each switch starts with an \fB@} instead of the
+\&\f(CB@samp\fB{\-\fR, without spaces between multiple switches. This is supposed to
+ease shell\-processing.
+.IP "\fB\-print\-prog\-name=\fR\fIprogram\fR" 4
.IX Item "-print-prog-name=program"
-Like \fB\-print-file-name\fR, but searches for a program such as \fBcpp\fR.
-.Ip "\fB\-print-libgcc-file-name\fR" 4
+Like \fB\-print\-file\-name\fR, but searches for a program such as \fBcpp\fR.
+.IP "\fB\-print\-libgcc\-file\-name\fR" 4
.IX Item "-print-libgcc-file-name"
-Same as \fB\-print-file-name=libgcc.a\fR.
+Same as \fB\-print\-file\-name=libgcc.a\fR.
.Sp
This is useful when you use \fB\-nostdlib\fR or \fB\-nodefaultlibs\fR
but you do want to link with \fIlibgcc.a\fR. You can do
.Sp
.Vb 1
-\& gcc -nostdlib I<files>... `gcc -print-libgcc-file-name`
+\& gcc -nostdlib <files>... `gcc -print-libgcc-file-name`
.Ve
-.Ip "\fB\-print-search-dirs\fR" 4
+.IP "\fB\-print\-search\-dirs\fR" 4
.IX Item "-print-search-dirs"
Print the name of the configured installation directory and a list of
program and library directories gcc will search\-\-\-and don't do anything else.
@@ -2635,13 +2783,25 @@ To resolve this you either need to put \fIcpp0\fR and the other compiler
components where gcc expects to find them, or you can set the environment
variable \fB\s-1GCC_EXEC_PREFIX\s0\fR to the directory where you installed them.
Don't forget the trailing '/'.
+.IP "\fB\-dumpmachine\fR" 4
+.IX Item "-dumpmachine"
+Print the compiler's target machine (for example,
+\&\fBi686\-pc\-linux\-gnu\fR)\-\-\-and don't do anything else.
+.IP "\fB\-dumpversion\fR" 4
+.IX Item "-dumpversion"
+Print the compiler version (for example, \fB3.0\fR)\-\-\-and don't do
+anything else.
+.IP "\fB\-dumpspecs\fR" 4
+.IX Item "-dumpspecs"
+Print the compiler's built-in specs\-\-\-and don't do anything else. (This
+is used when \s-1GCC\s0 itself is being built.)
.Sh "Options That Control Optimization"
.IX Subsection "Options That Control Optimization"
These options control various sorts of optimizations:
-.Ip "\fB\-O\fR" 4
+.IP "\fB\-O\fR" 4
.IX Item "-O"
.PD 0
-.Ip "\fB\-O1\fR" 4
+.IP "\fB\-O1\fR" 4
.IX Item "-O1"
.PD
Optimize. Optimizing compilation takes somewhat more time, and a lot
@@ -2661,13 +2821,13 @@ worse than produced by \s-1PCC\s0 without \fB\-O\fR.
With \fB\-O\fR, the compiler tries to reduce code size and execution
time.
.Sp
-When you specify \fB\-O\fR, the compiler turns on \fB\-fthread-jumps\fR
-and \fB\-fdefer-pop\fR on all machines. The compiler turns on
-\&\fB\-fdelayed-branch\fR on machines that have delay slots, and
-\&\fB\-fomit-frame-pointer\fR on machines that can support debugging even
+When you specify \fB\-O\fR, the compiler turns on \fB\-fthread\-jumps\fR
+and \fB\-fdefer\-pop\fR on all machines. The compiler turns on
+\&\fB\-fdelayed\-branch\fR on machines that have delay slots, and
+\&\fB\-fomit\-frame\-pointer\fR on machines that can support debugging even
without a frame pointer. On some machines the compiler also turns
on other flags.
-.Ip "\fB\-O2\fR" 4
+.IP "\fB\-O2\fR" 4
.IX Item "-O2"
Optimize even more. \s-1GCC\s0 performs nearly all supported optimizations
that do not involve a space-speed tradeoff. The compiler does not
@@ -2677,17 +2837,20 @@ and the performance of the generated code.
.Sp
\&\fB\-O2\fR turns on all optional optimizations except for loop unrolling,
function inlining, and register renaming. It also turns on the
-\&\fB\-fforce-mem\fR option on all machines and frame pointer elimination
+\&\fB\-fforce\-mem\fR option on all machines and frame pointer elimination
on machines where doing so does not interfere with debugging.
-.Ip "\fB\-O3\fR" 4
+.Sp
+Please note the warning under \fB\-fgcse\fR about
+invoking \fB\-O2\fR on programs that use computed gotos.
+.IP "\fB\-O3\fR" 4
.IX Item "-O3"
Optimize yet more. \fB\-O3\fR turns on all optimizations specified by
-\&\fB\-O2\fR and also turns on the \fB\-finline-functions\fR and
-\&\fB\-frename-registers\fR options.
-.Ip "\fB\-O0\fR" 4
+\&\fB\-O2\fR and also turns on the \fB\-finline\-functions\fR and
+\&\fB\-frename\-registers\fR options.
+.IP "\fB\-O0\fR" 4
.IX Item "-O0"
Do not optimize.
-.Ip "\fB\-Os\fR" 4
+.IP "\fB\-Os\fR" 4
.IX Item "-Os"
Optimize for size. \fB\-Os\fR enables all \fB\-O2\fR optimizations that
do not typically increase code size. It also performs further
@@ -2698,11 +2861,11 @@ the last such option is the one that is effective.
.PP
Options of the form \fB\-f\fR\fIflag\fR specify machine-independent
flags. Most flags have both positive and negative forms; the negative
-form of \fB\-ffoo\fR would be \fB\-fno-foo\fR. In the table below,
+form of \fB\-ffoo\fR would be \fB\-fno\-foo\fR. In the table below,
only one of the forms is listed\-\-\-the one which is not the default.
-You can figure out the other form by either removing \fBno-\fR or
+You can figure out the other form by either removing \fBno\-\fR or
adding it.
-.Ip "\fB\-ffloat-store\fR" 4
+.IP "\fB\-ffloat\-store\fR" 4
.IX Item "-ffloat-store"
Do not store floating point variables in registers, and inhibit other
options that might change whether a floating point value is taken from a
@@ -2713,34 +2876,34 @@ the 68000 where the floating registers (of the 68881) keep more
precision than a \f(CW\*(C`double\*(C'\fR is supposed to have. Similarly for the
x86 architecture. For most programs, the excess precision does only
good, but a few programs rely on the precise definition of \s-1IEEE\s0 floating
-point. Use \fB\-ffloat-store\fR for such programs, after modifying
+point. Use \fB\-ffloat\-store\fR for such programs, after modifying
them to store all pertinent intermediate computations into variables.
-.Ip "\fB\-fno-default-inline\fR" 4
+.IP "\fB\-fno\-default\-inline\fR" 4
.IX Item "-fno-default-inline"
Do not make member functions inline by default merely because they are
defined inside the class scope (\*(C+ only). Otherwise, when you specify
\&\fB\-O\fR, member functions defined inside class scope are compiled
inline by default; i.e., you don't need to add \fBinline\fR in front of
the member function name.
-.Ip "\fB\-fno-defer-pop\fR" 4
+.IP "\fB\-fno\-defer\-pop\fR" 4
.IX Item "-fno-defer-pop"
Always pop the arguments to each function call as soon as that function
returns. For machines which must pop arguments after a function call,
the compiler normally lets arguments accumulate on the stack for several
function calls and pops them all at once.
-.Ip "\fB\-fforce-mem\fR" 4
+.IP "\fB\-fforce\-mem\fR" 4
.IX Item "-fforce-mem"
Force memory operands to be copied into registers before doing
arithmetic on them. This produces better code by making all memory
references potential common subexpressions. When they are not common
subexpressions, instruction combination should eliminate the separate
-register-load. The \fB\-O2\fR option turns on this option.
-.Ip "\fB\-fforce-addr\fR" 4
+register\-load. The \fB\-O2\fR option turns on this option.
+.IP "\fB\-fforce\-addr\fR" 4
.IX Item "-fforce-addr"
Force memory address constants to be copied into registers before
doing arithmetic on them. This may produce better code just as
-\&\fB\-fforce-mem\fR may.
-.Ip "\fB\-fomit-frame-pointer\fR" 4
+\&\fB\-fforce\-mem\fR may.
+.IP "\fB\-fomit\-frame\-pointer\fR" 4
.IX Item "-fomit-frame-pointer"
Don't keep the frame pointer in a register for functions that
don't need one. This avoids the instructions to save, set up and
@@ -2753,19 +2916,19 @@ the standard calling sequence automatically handles the frame pointer
and nothing is saved by pretending it doesn't exist. The
machine-description macro \f(CW\*(C`FRAME_POINTER_REQUIRED\*(C'\fR controls
whether a target machine supports this flag.
-.Ip "\fB\-foptimize-sibling-calls\fR" 4
+.IP "\fB\-foptimize\-sibling\-calls\fR" 4
.IX Item "-foptimize-sibling-calls"
Optimize sibling and tail recursive calls.
-.Ip "\fB\-ftrapv\fR" 4
+.IP "\fB\-ftrapv\fR" 4
.IX Item "-ftrapv"
This option generates traps for signed overflow on addition, subtraction,
multiplication operations.
-.Ip "\fB\-fno-inline\fR" 4
+.IP "\fB\-fno\-inline\fR" 4
.IX Item "-fno-inline"
Don't pay attention to the \f(CW\*(C`inline\*(C'\fR keyword. Normally this option
is used to keep the compiler from expanding any functions inline.
Note that if you are not optimizing, no functions can be expanded inline.
-.Ip "\fB\-finline-functions\fR" 4
+.IP "\fB\-finline\-functions\fR" 4
.IX Item "-finline-functions"
Integrate all simple functions into their callers. The compiler
heuristically decides which functions are simple enough to be worth
@@ -2774,38 +2937,39 @@ integrating in this way.
If all calls to a given function are integrated, and the function is
declared \f(CW\*(C`static\*(C'\fR, then the function is normally not output as
assembler code in its own right.
-.Ip "\fB\-finline-limit=\fR\fIn\fR" 4
+.IP "\fB\-finline\-limit=\fR\fIn\fR" 4
.IX Item "-finline-limit=n"
By default, gcc limits the size of functions that can be inlined. This flag
allows the control of this limit for functions that are explicitly marked as
-inline (ie marked with the inline keyword or defined within the class
-definition in c++). \fIn\fR is the size of functions that can be inlined in
+inline (ie marked with the inline keyword or defined within the class
+definition in c++). \fIn\fR is the size of functions that can be inlined in
number of pseudo instructions (not counting parameter handling). The default
-value of n is 10000. Increasing this value can result in more inlined code at
+value of \fIn\fR is 600.
+Increasing this value can result in more inlined code at
the cost of compilation time and memory consumption. Decreasing usually makes
-the compilation faster and less code will be inlined (which presumably
-means slower programs). This option is particularly useful for programs that
-use inlining heavily such as those based on recursive templates with c++.
+the compilation faster and less code will be inlined (which presumably
+means slower programs). This option is particularly useful for programs that
+use inlining heavily such as those based on recursive templates with \*(C+.
.Sp
\&\fINote:\fR pseudo instruction represents, in this particular context, an
abstract measurement of function's size. In no way, it represents a count
of assembly instructions and as such its exact meaning might change from one
release to an another.
-.Ip "\fB\-fkeep-inline-functions\fR" 4
+.IP "\fB\-fkeep\-inline\-functions\fR" 4
.IX Item "-fkeep-inline-functions"
Even if all calls to a given function are integrated, and the function
is declared \f(CW\*(C`static\*(C'\fR, nevertheless output a separate run-time
callable version of the function. This switch does not affect
\&\f(CW\*(C`extern inline\*(C'\fR functions.
-.Ip "\fB\-fkeep-static-consts\fR" 4
+.IP "\fB\-fkeep\-static\-consts\fR" 4
.IX Item "-fkeep-static-consts"
Emit variables declared \f(CW\*(C`static const\*(C'\fR when optimization isn't turned
on, even if the variables aren't referenced.
.Sp
\&\s-1GCC\s0 enables this option by default. If you want to force the compiler to
check if the variable was referenced, regardless of whether or not
-optimization is turned on, use the \fB\-fno-keep-static-consts\fR option.
-.Ip "\fB\-fno-function-cse\fR" 4
+optimization is turned on, use the \fB\-fno\-keep\-static\-consts\fR option.
+.IP "\fB\-fno\-function\-cse\fR" 4
.IX Item "-fno-function-cse"
Do not put function addresses in registers; make each instruction that
calls a constant function contain the function's address explicitly.
@@ -2813,7 +2977,7 @@ calls a constant function contain the function's address explicitly.
This option results in less efficient code, but some strange hacks
that alter the assembler output may be confused by the optimizations
performed when this option is not used.
-.Ip "\fB\-ffast-math\fR" 4
+.IP "\fB\-ffast\-math\fR" 4
.IX Item "-ffast-math"
This option allows \s-1GCC\s0 to violate some \s-1ISO\s0 or \s-1IEEE\s0 rules and/or
specifications in the interest of optimizing code for speed. For
@@ -2821,78 +2985,85 @@ example, it allows the compiler to assume arguments to the \f(CW\*(C`sqrt\*(C'\f
function are non-negative numbers and that no floating-point values
are NaNs.
.Sp
+This option causes the preprocessor macro \f(CW\*(C`_\|_FAST_MATH_\|_\*(C'\fR to be defined.
+.Sp
This option should never be turned on by any \fB\-O\fR option since
it can result in incorrect output for programs which depend on
an exact implementation of \s-1IEEE\s0 or \s-1ISO\s0 rules/specifications for
math functions.
-.Ip "\fB\-fno-math-errno\fR" 4
+.IP "\fB\-fno\-math\-errno\fR" 4
.IX Item "-fno-math-errno"
Do not set \s-1ERRNO\s0 after calling math functions that are executed
with a single instruction, e.g., sqrt. A program that relies on
\&\s-1IEEE\s0 exceptions for math error handling may want to use this flag
for speed while maintaining \s-1IEEE\s0 arithmetic compatibility.
.Sp
-The default is \fB\-fmath-errno\fR. The \fB\-ffast-math\fR option
-sets \fB\-fno-math-errno\fR.
+The default is \fB\-fmath\-errno\fR. The \fB\-ffast\-math\fR option
+sets \fB\-fno\-math\-errno\fR.
.PP
The following options control specific optimizations. The \fB\-O2\fR
-option turns on all of these optimizations except \fB\-funroll-loops\fR
-and \fB\-funroll-all-loops\fR. On most machines, the \fB\-O\fR option
-turns on the \fB\-fthread-jumps\fR and \fB\-fdelayed-branch\fR options,
+option turns on all of these optimizations except \fB\-funroll\-loops\fR
+and \fB\-funroll\-all\-loops\fR. On most machines, the \fB\-O\fR option
+turns on the \fB\-fthread\-jumps\fR and \fB\-fdelayed\-branch\fR options,
but specific machines may handle it differently.
.PP
-You can use the following flags in the rare cases when ``fine-tuning''
+You can use the following flags in the rare cases when ``fine\-tuning''
of optimizations to be performed is desired.
-.Ip "\fB\-fstrength-reduce\fR" 4
+.IP "\fB\-fstrength\-reduce\fR" 4
.IX Item "-fstrength-reduce"
Perform the optimizations of loop strength reduction and
elimination of iteration variables.
-.Ip "\fB\-fthread-jumps\fR" 4
+.IP "\fB\-fthread\-jumps\fR" 4
.IX Item "-fthread-jumps"
Perform optimizations where we check to see if a jump branches to a
location where another comparison subsumed by the first is found. If
so, the first branch is redirected to either the destination of the
second branch or a point immediately following it, depending on whether
the condition is known to be true or false.
-.Ip "\fB\-fcse-follow-jumps\fR" 4
+.IP "\fB\-fcse\-follow\-jumps\fR" 4
.IX Item "-fcse-follow-jumps"
In common subexpression elimination, scan through jump instructions
when the target of the jump is not reached by any other path. For
example, when \s-1CSE\s0 encounters an \f(CW\*(C`if\*(C'\fR statement with an
\&\f(CW\*(C`else\*(C'\fR clause, \s-1CSE\s0 will follow the jump when the condition
tested is false.
-.Ip "\fB\-fcse-skip-blocks\fR" 4
+.IP "\fB\-fcse\-skip\-blocks\fR" 4
.IX Item "-fcse-skip-blocks"
-This is similar to \fB\-fcse-follow-jumps\fR, but causes \s-1CSE\s0 to
+This is similar to \fB\-fcse\-follow\-jumps\fR, but causes \s-1CSE\s0 to
follow jumps which conditionally skip over blocks. When \s-1CSE\s0
encounters a simple \f(CW\*(C`if\*(C'\fR statement with no else clause,
-\&\fB\-fcse-skip-blocks\fR causes \s-1CSE\s0 to follow the jump around the
+\&\fB\-fcse\-skip\-blocks\fR causes \s-1CSE\s0 to follow the jump around the
body of the \f(CW\*(C`if\*(C'\fR.
-.Ip "\fB\-frerun-cse-after-loop\fR" 4
+.IP "\fB\-frerun\-cse\-after\-loop\fR" 4
.IX Item "-frerun-cse-after-loop"
Re-run common subexpression elimination after loop optimizations has been
performed.
-.Ip "\fB\-frerun-loop-opt\fR" 4
+.IP "\fB\-frerun\-loop\-opt\fR" 4
.IX Item "-frerun-loop-opt"
Run the loop optimizer twice.
-.Ip "\fB\-fgcse\fR" 4
+.IP "\fB\-fgcse\fR" 4
.IX Item "-fgcse"
Perform a global common subexpression elimination pass.
This pass also performs global constant and copy propagation.
-.Ip "\fB\-fdelete-null-pointer-checks\fR" 4
+.Sp
+\&\fINote:\fR When compiling a program using computed gotos, a \s-1GCC\s0
+extension, you may get better runtime performance if you disable
+the global common subexpression elmination pass by adding
+\&\fB\-fno\-gcse\fR to the command line.
+.IP "\fB\-fdelete\-null\-pointer\-checks\fR" 4
.IX Item "-fdelete-null-pointer-checks"
Use global dataflow analysis to identify and eliminate useless null
pointer checks. Programs which rely on \s-1NULL\s0 pointer dereferences \fInot\fR
halting the program may not work properly with this option. Use
-\&\-fno-delete-null-pointer-checks to disable this optimizing for programs
+\&\fB\-fno\-delete\-null\-pointer\-checks\fR to disable this optimizing for programs
which depend on that behavior.
-.Ip "\fB\-fexpensive-optimizations\fR" 4
+.IP "\fB\-fexpensive\-optimizations\fR" 4
.IX Item "-fexpensive-optimizations"
Perform a number of minor optimizations that are relatively expensive.
-.Ip "\fB\-foptimize-register-move\fR" 4
+.IP "\fB\-foptimize\-register\-move\fR" 4
.IX Item "-foptimize-register-move"
.PD 0
-.Ip "\fB\-fregmove\fR" 4
+.IP "\fB\-fregmove\fR" 4
.IX Item "-fregmove"
.PD
Attempt to reassign register numbers in move instructions and as
@@ -2901,30 +3072,30 @@ register tying. This is especially helpful on machines with two-operand
instructions. \s-1GCC\s0 enables this optimization by default with \fB\-O2\fR
or higher.
.Sp
-Note \fB\-fregmove\fR and \fB\-foptimize-register-move\fR are the same
+Note \fB\-fregmove\fR and \fB\-foptimize\-register\-move\fR are the same
optimization.
-.Ip "\fB\-fdelayed-branch\fR" 4
+.IP "\fB\-fdelayed\-branch\fR" 4
.IX Item "-fdelayed-branch"
If supported for the target machine, attempt to reorder instructions
to exploit instruction slots available after delayed branch
instructions.
-.Ip "\fB\-fschedule-insns\fR" 4
+.IP "\fB\-fschedule\-insns\fR" 4
.IX Item "-fschedule-insns"
If supported for the target machine, attempt to reorder instructions to
eliminate execution stalls due to required data being unavailable. This
helps machines that have slow floating point or memory load instructions
by allowing other instructions to be issued until the result of the load
or floating point instruction is required.
-.Ip "\fB\-fschedule-insns2\fR" 4
+.IP "\fB\-fschedule\-insns2\fR" 4
.IX Item "-fschedule-insns2"
-Similar to \fB\-fschedule-insns\fR, but requests an additional pass of
+Similar to \fB\-fschedule\-insns\fR, but requests an additional pass of
instruction scheduling after register allocation has been done. This is
especially useful on machines with a relatively small number of
registers and where memory load instructions take more than one cycle.
-.Ip "\fB\-ffunction-sections\fR" 4
+.IP "\fB\-ffunction\-sections\fR" 4
.IX Item "-ffunction-sections"
.PD 0
-.Ip "\fB\-fdata-sections\fR" 4
+.IP "\fB\-fdata\-sections\fR" 4
.IX Item "-fdata-sections"
.PD
Place each function or data item into its own section in the output
@@ -2934,7 +3105,7 @@ in the output file.
.Sp
Use these options on systems where the linker can perform optimizations
to improve locality of reference in the instruction space. \s-1HPPA\s0
-processors running \s-1HP-UX\s0 and Sparc processors running Solaris 2 have
+processors running HP-UX and Sparc processors running Solaris 2 have
linkers with such optimizations. Other systems using the \s-1ELF\s0 object format
as well as \s-1AIX\s0 may have these optimizations in the future.
.Sp
@@ -2944,7 +3115,7 @@ create larger object and executable files and will also be slower.
You will not be able to use \f(CW\*(C`gprof\*(C'\fR on all systems if you
specify this option and you may have problems with debugging if
you specify both this option and \fB\-g\fR.
-.Ip "\fB\-fcaller-saves\fR" 4
+.IP "\fB\-fcaller\-saves\fR" 4
.IX Item "-fcaller-saves"
Enable values to be allocated in registers that will be clobbered by
function calls, by emitting extra instructions to save and restore the
@@ -2956,28 +3127,28 @@ those which have no call-preserved registers to use instead.
.Sp
For all machines, optimization level 2 and higher enables this flag by
default.
-.Ip "\fB\-funroll-loops\fR" 4
+.IP "\fB\-funroll\-loops\fR" 4
.IX Item "-funroll-loops"
Perform the optimization of loop unrolling. This is only done for loops
whose number of iterations can be determined at compile time or run time.
-\&\fB\-funroll-loops\fR implies both \fB\-fstrength-reduce\fR and
-\&\fB\-frerun-cse-after-loop\fR.
-.Ip "\fB\-funroll-all-loops\fR" 4
+\&\fB\-funroll\-loops\fR implies both \fB\-fstrength\-reduce\fR and
+\&\fB\-frerun\-cse\-after\-loop\fR.
+.IP "\fB\-funroll\-all\-loops\fR" 4
.IX Item "-funroll-all-loops"
Perform the optimization of loop unrolling. This is done for all loops
-and usually makes programs run more slowly. \fB\-funroll-all-loops\fR
-implies \fB\-fstrength-reduce\fR as well as \fB\-frerun-cse-after-loop\fR.
-.Ip "\fB\-fmove-all-movables\fR" 4
+and usually makes programs run more slowly. \fB\-funroll\-all\-loops\fR
+implies \fB\-fstrength\-reduce\fR as well as \fB\-frerun\-cse\-after\-loop\fR.
+.IP "\fB\-fmove\-all\-movables\fR" 4
.IX Item "-fmove-all-movables"
Forces all invariant computations in loops to be moved
outside the loop.
-.Ip "\fB\-freduce-all-givs\fR" 4
+.IP "\fB\-freduce\-all\-givs\fR" 4
.IX Item "-freduce-all-givs"
Forces all general-induction variables in loops to be
-strength-reduced.
+strength\-reduced.
.Sp
\&\fINote:\fR When compiling programs written in Fortran,
-\&\fB\-fmove-all-movables\fR and \fB\-freduce-all-givs\fR are enabled
+\&\fB\-fmove\-all\-movables\fR and \fB\-freduce\-all\-givs\fR are enabled
by default when you use the optimizer.
.Sp
These options may generate better or worse code; results are highly
@@ -2992,24 +3163,31 @@ know how use of these options affects
the performance of your production code.
We're very interested in code that runs \fIslower\fR
when these options are \fIenabled\fR.
-.Ip "\fB\-fno-peephole\fR" 4
+.IP "\fB\-fno\-peephole\fR" 4
.IX Item "-fno-peephole"
-Disable any machine-specific peephole optimizations.
-.Ip "\fB\-fbranch-probabilities\fR" 4
+.PD 0
+.IP "\fB\-fno\-peephole2\fR" 4
+.IX Item "-fno-peephole2"
+.PD
+Disable any machine-specific peephole optimizations. The difference
+between \fB\-fno\-peephole\fR and \fB\-fno\-peephole2\fR is in how they
+are implemented in the compiler; some targets use one, some use the
+other, a few use both.
+.IP "\fB\-fbranch\-probabilities\fR" 4
.IX Item "-fbranch-probabilities"
-After running a program compiled with \fB\-fprofile-arcs\fR, you can compile it a second time using
-\&\fB\-fbranch-probabilities\fR, to improve optimizations based on
+After running a program compiled with \fB\-fprofile\-arcs\fR, you can compile it a second time using
+\&\fB\-fbranch\-probabilities\fR, to improve optimizations based on
guessing the path a branch might take.
-.Ip "\fB\-fno-guess-branch-probability\fR" 4
+.IP "\fB\-fno\-guess\-branch\-probability\fR" 4
.IX Item "-fno-guess-branch-probability"
Sometimes gcc will opt to guess branch probabilities when none are
-available from either profile directed feedback (\fB\-fprofile-arcs\fR)
+available from either profile directed feedback (\fB\-fprofile\-arcs\fR)
or \fB_\|_builtin_expect\fR. In a hard real-time system, people don't
want different runs of the compiler to produce code that has different
behavior; minimizing non-determinism is of paramount import. This
-switch allows users to reduce non-determinism, possibly at the expense
+switch allows users to reduce non\-determinism, possibly at the expense
of inferior optimization.
-.Ip "\fB\-fstrict-aliasing\fR" 4
+.IP "\fB\-fstrict\-aliasing\fR" 4
.IX Item "-fstrict-aliasing"
Allows the compiler to assume the strictest aliasing rules applicable to
the language being compiled. For C (and \*(C+), this activates
@@ -3018,16 +3196,17 @@ object of one type is assumed never to reside at the same address as an
object of a different type, unless the types are almost the same. For
example, an \f(CW\*(C`unsigned int\*(C'\fR can alias an \f(CW\*(C`int\*(C'\fR, but not a
\&\f(CW\*(C`void*\*(C'\fR or a \f(CW\*(C`double\*(C'\fR. A character type may alias any other
-type.
+type.
.Sp
Pay special attention to code like this:
.Sp
.Vb 4
-\& union a_union {
+\& union a_union {
\& int i;
\& double d;
\& };
.Ve
+.Sp
.Vb 5
\& int f() {
\& a_union t;
@@ -3035,14 +3214,15 @@ Pay special attention to code like this:
\& return t.i;
\& }
.Ve
+.Sp
The practice of reading from a different union member than the one most
-recently written to (called ``type-punning'') is common. Even with
-\&\fB\-fstrict-aliasing\fR, type-punning is allowed, provided the memory
+recently written to (called ``type\-punning'') is common. Even with
+\&\fB\-fstrict\-aliasing\fR, type-punning is allowed, provided the memory
is accessed through the union type. So, the code above will work as
expected. However, this code might not:
.Sp
.Vb 7
-\& int f() {
+\& int f() {
\& a_union t;
\& int* ip;
\& t.d = 3.0;
@@ -3050,86 +3230,133 @@ expected. However, this code might not:
\& return *ip;
\& }
.Ve
-.Ip "\fB\-falign-functions\fR" 4
+.IP "\fB\-falign\-functions\fR" 4
.IX Item "-falign-functions"
.PD 0
-.Ip "\fB\-falign-functions=\fR\fIn\fR" 4
+.IP "\fB\-falign\-functions=\fR\fIn\fR" 4
.IX Item "-falign-functions=n"
.PD
Align the start of functions to the next power-of-two greater than
\&\fIn\fR, skipping up to \fIn\fR bytes. For instance,
-\&\fB\-falign-functions=32\fR aligns functions to the next 32\-byte
-boundary, but \fB\-falign-functions=24\fR would align to the next
+\&\fB\-falign\-functions=32\fR aligns functions to the next 32\-byte
+boundary, but \fB\-falign\-functions=24\fR would align to the next
32\-byte boundary only if this can be done by skipping 23 bytes or less.
.Sp
-\&\fB\-fno-align-functions\fR and \fB\-falign-functions=1\fR are
+\&\fB\-fno\-align\-functions\fR and \fB\-falign\-functions=1\fR are
equivalent and mean that functions will not be aligned.
.Sp
Some assemblers only support this flag when \fIn\fR is a power of two;
in that case, it is rounded up.
.Sp
If \fIn\fR is not specified, use a machine-dependent default.
-.Ip "\fB\-falign-labels\fR" 4
+.IP "\fB\-falign\-labels\fR" 4
.IX Item "-falign-labels"
.PD 0
-.Ip "\fB\-falign-labels=\fR\fIn\fR" 4
+.IP "\fB\-falign\-labels=\fR\fIn\fR" 4
.IX Item "-falign-labels=n"
.PD
Align all branch targets to a power-of-two boundary, skipping up to
-\&\fIn\fR bytes like \fB\-falign-functions\fR. This option can easily
+\&\fIn\fR bytes like \fB\-falign\-functions\fR. This option can easily
make code slower, because it must insert dummy operations for when the
branch target is reached in the usual flow of the code.
.Sp
-If \fB\-falign-loops\fR or \fB\-falign-jumps\fR are applicable and
+If \fB\-falign\-loops\fR or \fB\-falign\-jumps\fR are applicable and
are greater than this value, then their values are used instead.
.Sp
If \fIn\fR is not specified, use a machine-dependent default which is
very likely to be \fB1\fR, meaning no alignment.
-.Ip "\fB\-falign-loops\fR" 4
+.IP "\fB\-falign\-loops\fR" 4
.IX Item "-falign-loops"
.PD 0
-.Ip "\fB\-falign-loops=\fR\fIn\fR" 4
+.IP "\fB\-falign\-loops=\fR\fIn\fR" 4
.IX Item "-falign-loops=n"
.PD
Align loops to a power-of-two boundary, skipping up to \fIn\fR bytes
-like \fB\-falign-functions\fR. The hope is that the loop will be
+like \fB\-falign\-functions\fR. The hope is that the loop will be
executed many times, which will make up for any execution of the dummy
operations.
.Sp
If \fIn\fR is not specified, use a machine-dependent default.
-.Ip "\fB\-falign-jumps\fR" 4
+.IP "\fB\-falign\-jumps\fR" 4
.IX Item "-falign-jumps"
.PD 0
-.Ip "\fB\-falign-jumps=\fR\fIn\fR" 4
+.IP "\fB\-falign\-jumps=\fR\fIn\fR" 4
.IX Item "-falign-jumps=n"
.PD
Align branch targets to a power-of-two boundary, for branch targets
where the targets can only be reached by jumping, skipping up to \fIn\fR
-bytes like \fB\-falign-functions\fR. In this case, no dummy operations
+bytes like \fB\-falign\-functions\fR. In this case, no dummy operations
need be executed.
.Sp
If \fIn\fR is not specified, use a machine-dependent default.
-.Ip "\fB\-fssa\fR" 4
+.IP "\fB\-fssa\fR" 4
.IX Item "-fssa"
Perform optimizations in static single assignment form. Each function's
flow graph is translated into \s-1SSA\s0 form, optimizations are performed, and
-the flow graph is translated back from \s-1SSA\s0 form. User's should not
+the flow graph is translated back from \s-1SSA\s0 form. Users should not
specify this option, since it is not yet ready for production use.
-.Ip "\fB\-fdce\fR" 4
+.IP "\fB\-fdce\fR" 4
.IX Item "-fdce"
Perform dead-code elimination in \s-1SSA\s0 form. Requires \fB\-fssa\fR. Like
\&\fB\-fssa\fR, this is an experimental feature.
-.Ip "\fB\-fsingle-precision-constant\fR" 4
+.IP "\fB\-fsingle\-precision\-constant\fR" 4
.IX Item "-fsingle-precision-constant"
Treat floating point constant as single precision constant instead of
implicitly converting it to double precision constant.
-.Ip "\fB\-frename-registers\fR" 4
+.IP "\fB\-frename\-registers\fR" 4
.IX Item "-frename-registers"
-Attempt to avoid false dependancies in scheduled code by making use
+Attempt to avoid false dependencies in scheduled code by making use
of registers left over after register allocation. This optimization
will most benefit processors with lots of registers. It can, however,
make debugging impossible, since variables will no longer stay in
a ``home register''.
+.IP "\fB\-\-param\fR \fIname\fR\fB=\fR\fIvalue\fR" 4
+.IX Item "--param name=value"
+In some places, \s-1GCC\s0 uses various constants to control the amount of
+optimization that is done. For example, \s-1GCC\s0 will not inline functions
+that contain more that a certain number of instructions. You can
+control some of these constants on the command-line using the
+\&\fB\-\-param\fR option.
+.Sp
+In each case, the \fIvalue\fR is an integer. The allowable choices for
+\&\fIname\fR are given in the following table:
+.RS 4
+.IP "\fBmax-delay-slot-insn-search\fR" 4
+.IX Item "max-delay-slot-insn-search"
+The maximum number of instructions to consider when looking for an
+instruction to fill a delay slot. If more than this arbitrary number of
+instructions is searched, the time savings from filling the delay slot
+will be minimal so stop searching. Increasing values mean more
+aggressive optimization, making the compile time increase with probably
+small improvement in executable run time.
+.IP "\fBmax-delay-slot-live-search\fR" 4
+.IX Item "max-delay-slot-live-search"
+When trying to fill delay slots, the maximum number of instructions to
+consider when searching for a block with valid live register
+information. Increasing this arbitrarily chosen value means more
+aggressive optimization, increasing the compile time. This parameter
+should be removed when the delay slot code is rewritten to maintain the
+control-flow graph.
+.IP "\fBmax-gcse-memory\fR" 4
+.IX Item "max-gcse-memory"
+The approximate maximum amount of memory that will be allocated in
+order to perform the global common subexpression elimination
+optimization. If more memory than specified is required, the
+optimization will not be done.
+.IP "\fBmax-pending-list-length\fR" 4
+.IX Item "max-pending-list-length"
+The maximum number of pending dependencies scheduling will allow
+before flushing the current state and starting over. Large functions
+with few branches or calls can create excessively large lists which
+needlessly consume memory and resources.
+.IP "\fBmax-inline-insns\fR" 4
+.IX Item "max-inline-insns"
+If an function contains more than this many instructions, it
+will not be inlined. This option is precisely equivalent to
+\&\fB\-finline\-limit\fR.
+.RE
+.RS 4
+.RE
.Sh "Options Controlling the Preprocessor"
.IX Subsection "Options Controlling the Preprocessor"
These options control the C preprocessor, which is run on each C source
@@ -3139,7 +3366,7 @@ If you use the \fB\-E\fR option, nothing is done except preprocessing.
Some of these options make sense only together with \fB\-E\fR because
they cause the preprocessor output to be unsuitable for actual
compilation.
-.Ip "\fB\-include\fR \fIfile\fR" 4
+.IP "\fB\-include\fR \fIfile\fR" 4
.IX Item "-include file"
Process \fIfile\fR as input before processing the regular input file.
In effect, the contents of \fIfile\fR are compiled first. Any \fB\-D\fR
@@ -3147,7 +3374,7 @@ and \fB\-U\fR options on the command line are always processed before
\&\fB\-include\fR \fIfile\fR, regardless of the order in which they are
written. All the \fB\-include\fR and \fB\-imacros\fR options are
processed in the order in which they are written.
-.Ip "\fB\-imacros\fR \fIfile\fR" 4
+.IP "\fB\-imacros\fR \fIfile\fR" 4
.IX Item "-imacros file"
Process \fIfile\fR as input, discarding the resulting output, before
processing the regular input file. Because the output generated from
@@ -3155,42 +3382,42 @@ processing the regular input file. Because the output generated from
is to make the macros defined in \fIfile\fR available for use in the
main input. All the \fB\-include\fR and \fB\-imacros\fR options are
processed in the order in which they are written.
-.Ip "\fB\-idirafter\fR \fIdir\fR" 4
+.IP "\fB\-idirafter\fR \fIdir\fR" 4
.IX Item "-idirafter dir"
Add the directory \fIdir\fR to the second include path. The directories
on the second include path are searched when a header file is not found
in any of the directories in the main include path (the one that
\&\fB\-I\fR adds to).
-.Ip "\fB\-iprefix\fR \fIprefix\fR" 4
+.IP "\fB\-iprefix\fR \fIprefix\fR" 4
.IX Item "-iprefix prefix"
Specify \fIprefix\fR as the prefix for subsequent \fB\-iwithprefix\fR
options.
-.Ip "\fB\-iwithprefix\fR \fIdir\fR" 4
+.IP "\fB\-iwithprefix\fR \fIdir\fR" 4
.IX Item "-iwithprefix dir"
Add a directory to the second include path. The directory's name is
made by concatenating \fIprefix\fR and \fIdir\fR, where \fIprefix\fR was
specified previously with \fB\-iprefix\fR. If you have not specified a
prefix yet, the directory containing the installed passes of the
compiler is used as the default.
-.Ip "\fB\-iwithprefixbefore\fR \fIdir\fR" 4
+.IP "\fB\-iwithprefixbefore\fR \fIdir\fR" 4
.IX Item "-iwithprefixbefore dir"
Add a directory to the main include path. The directory's name is made
by concatenating \fIprefix\fR and \fIdir\fR, as in the case of
\&\fB\-iwithprefix\fR.
-.Ip "\fB\-isystem\fR \fIdir\fR" 4
+.IP "\fB\-isystem\fR \fIdir\fR" 4
.IX Item "-isystem dir"
Add a directory to the beginning of the second include path, marking it
as a system directory, so that it gets the same special treatment as
is applied to the standard system directories.
-.Ip "\fB\-nostdinc\fR" 4
+.IP "\fB\-nostdinc\fR" 4
.IX Item "-nostdinc"
Do not search the standard system directories for header files. Only
the directories you have specified with \fB\-I\fR options (and the
current directory, if appropriate) are searched.
.Sp
-By using both \fB\-nostdinc\fR and \fB\-I-\fR, you can limit the include-file
+By using both \fB\-nostdinc\fR and \fB\-I\-\fR, you can limit the include-file
search path to only those directories you specify explicitly.
-.Ip "\fB\-remap\fR" 4
+.IP "\fB\-remap\fR" 4
.IX Item "-remap"
When searching for a header file in a directory, remap file names if a
file named \fIheader.gcc\fR exists in that directory. This can be used
@@ -3198,55 +3425,57 @@ to work around limitations of file systems with file name restrictions.
The \fIheader.gcc\fR file should contain a series of lines with two
tokens on each line: the first token is the name to map, and the second
token is the actual name to use.
-.Ip "\fB\-undef\fR" 4
+.IP "\fB\-undef\fR" 4
.IX Item "-undef"
Do not predefine any nonstandard macros. (Including architecture flags).
-.Ip "\fB\-E\fR" 4
+.IP "\fB\-E\fR" 4
.IX Item "-E"
Run only the C preprocessor. Preprocess all the C source files
specified and output the results to standard output or to the
specified output file.
-.Ip "\fB\-C\fR" 4
+.IP "\fB\-C\fR" 4
.IX Item "-C"
Tell the preprocessor not to discard comments. Used with the
\&\fB\-E\fR option.
-.Ip "\fB\-P\fR" 4
+.IP "\fB\-P\fR" 4
.IX Item "-P"
Tell the preprocessor not to generate \fB#line\fR directives.
Used with the \fB\-E\fR option.
-.Ip "\fB\-M\fR" 4
+.IP "\fB\-M\fR" 4
.IX Item "-M"
Instead of outputting the result of preprocessing, output a rule
suitable for \f(CW\*(C`make\*(C'\fR describing the dependencies of the main source
file. The preprocessor outputs one \f(CW\*(C`make\*(C'\fR rule containing the
object file name for that source file, a colon, and the names of all the
-included files. If there are many included files then the rule is split
-into several lines using \fB\e\fR\-newline.
+included files. Unless overridden explicitly, the object file name
+consists of the basename of the source file with any suffix replaced with
+object file suffix. If there are many included files then the
+rule is split into several lines using \fB\e\fR\-newline.
.Sp
\&\fB\-M\fR implies \fB\-E\fR.
-.Ip "\fB\-MM\fR" 4
+.IP "\fB\-MM\fR" 4
.IX Item "-MM"
Like \fB\-M\fR, but mention only the files included with \fB#include
"\fR\fIfile\fR\fB"\fR. System header files included with \fB#include
<\fR\fIfile\fR\fB>\fR are omitted.
-.Ip "\fB\-MD\fR" 4
+.IP "\fB\-MD\fR" 4
.IX Item "-MD"
Like \fB\-M\fR but the dependency information is written to a file
rather than stdout. \f(CW\*(C`gcc\*(C'\fR will use the same file name and
-directory as the object file, but with the suffix \*(L".d\*(R" instead.
+directory as the object file, but with the suffix \fI.d\fR instead.
.Sp
-This is in addition to compiling the main file as specified \-\-\-
-\&\fB\-MD\fR does not inhibit ordinary compilation the way \fB\-M\fR does,
+This is in addition to compiling the main file as specified\-\-\-\fB\-MD\fR
+does not inhibit ordinary compilation the way \fB\-M\fR does,
unless you also specify \fB\-MG\fR.
.Sp
With Mach, you can use the utility \f(CW\*(C`md\*(C'\fR to merge multiple
dependency files into a single dependency file suitable for using with
the \fBmake\fR command.
-.Ip "\fB\-MMD\fR" 4
+.IP "\fB\-MMD\fR" 4
.IX Item "-MMD"
Like \fB\-MD\fR except mention only user header files, not system
\&\-header files.
-.Ip "\fB\-MF\fR \fIfile\fR" 4
+.IP "\fB\-MF\fR \fIfile\fR" 4
.IX Item "-MF file"
When used with \fB\-M\fR or \fB\-MM\fR, specifies a file to write the
dependencies to. This allows the preprocessor to write the preprocessed
@@ -3255,7 +3484,7 @@ the rules to stdout and suppresses normal preprocessed output.
.Sp
Another way to specify output of a \f(CW\*(C`make\*(C'\fR rule is by setting
the environment variable \fB\s-1DEPENDENCIES_OUTPUT\s0\fR.
-.Ip "\fB\-MG\fR" 4
+.IP "\fB\-MG\fR" 4
.IX Item "-MG"
When used with \fB\-M\fR or \fB\-MM\fR, \fB\-MG\fR says to treat missing
header files as generated files and assume they live in the same
@@ -3263,7 +3492,7 @@ directory as the source file. It suppresses preprocessed output, as a
missing header file is ordinarily an error.
.Sp
This feature is used in automatic updating of makefiles.
-.Ip "\fB\-MP\fR" 4
+.IP "\fB\-MP\fR" 4
.IX Item "-MP"
This option instructs \s-1CPP\s0 to add a phony target for each dependency
other than the main file, causing each to depend on nothing. These
@@ -3275,13 +3504,14 @@ This is typical output:\-
.Vb 1
\& /tmp/test.o: /tmp/test.c /tmp/test.h
.Ve
+.Sp
.Vb 1
\& /tmp/test.h:
.Ve
-.Ip "\fB\-MQ\fR \fItarget\fR" 4
+.IP "\fB\-MQ\fR \fItarget\fR" 4
.IX Item "-MQ target"
.PD 0
-.Ip "\fB\-MT\fR \fItarget\fR" 4
+.IP "\fB\-MT\fR \fItarget\fR" 4
.IX Item "-MT target"
.PD
By default \s-1CPP\s0 uses the main file name, including any path, and appends
@@ -3295,32 +3525,34 @@ to \fB\-MT\fR, or use multiple \fB\-MT\fR options.
The targets you specify are output in the order they appear on the
command line. \fB\-MQ\fR is identical to \fB\-MT\fR, except that the
target name is quoted for Make, but with \fB\-MT\fR it isn't. For
-example, \-MT '$(objpfx)foo.o' gives
+example, \fB\-MT '$(objpfx)foo.o'\fR gives
.Sp
.Vb 1
\& $(objpfx)foo.o: /tmp/foo.c
.Ve
-but \-MQ '$(objpfx)foo.o' gives
+.Sp
+but \fB\-MQ '$(objpfx)foo.o'\fR gives
.Sp
.Vb 1
\& $$(objpfx)foo.o: /tmp/foo.c
.Ve
+.Sp
The default target is automatically quoted, as if it were given with
\&\fB\-MQ\fR.
-.Ip "\fB\-H\fR" 4
+.IP "\fB\-H\fR" 4
.IX Item "-H"
Print the name of each header file used, in addition to other normal
activities.
-.Ip "\fB\-A\fR\fIquestion\fR\fB(\fR\fIanswer\fR\fB)\fR" 4
+.IP "\fB\-A\fR\fIquestion\fR\fB(\fR\fIanswer\fR\fB)\fR" 4
.IX Item "-Aquestion(answer)"
Assert the answer \fIanswer\fR for \fIquestion\fR, in case it is tested
with a preprocessing conditional such as \fB#if
-#\fR\fIquestion\fR\fB(\fR\fIanswer\fR\fB)\fR. \fB\-A-\fR disables the standard
+#\fR\fIquestion\fR\fB(\fR\fIanswer\fR\fB)\fR. \fB\-A\-\fR disables the standard
assertions that normally describe the target machine.
-.Ip "\fB\-D\fR\fImacro\fR" 4
+.IP "\fB\-D\fR\fImacro\fR" 4
.IX Item "-Dmacro"
Define macro \fImacro\fR with the string \fB1\fR as its definition.
-.Ip "\fB\-D\fR\fImacro\fR\fB=\fR\fIdefn\fR" 4
+.IP "\fB\-D\fR\fImacro\fR\fB=\fR\fIdefn\fR" 4
.IX Item "-Dmacro=defn"
Define macro \fImacro\fR as \fIdefn\fR. All instances of \fB\-D\fR on
the command line are processed before any \fB\-U\fR options.
@@ -3328,7 +3560,7 @@ the command line are processed before any \fB\-U\fR options.
Any \fB\-D\fR and \fB\-U\fR options on the command line are processed in
order, and always before \fB\-imacros\fR \fIfile\fR, regardless of the
order in which they are written.
-.Ip "\fB\-U\fR\fImacro\fR" 4
+.IP "\fB\-U\fR\fImacro\fR" 4
.IX Item "-Umacro"
Undefine macro \fImacro\fR. \fB\-U\fR options are evaluated after all
\&\fB\-D\fR options, but before any \fB\-include\fR and \fB\-imacros\fR
@@ -3337,24 +3569,35 @@ options.
Any \fB\-D\fR and \fB\-U\fR options on the command line are processed in
order, and always before \fB\-imacros\fR \fIfile\fR, regardless of the
order in which they are written.
-.Ip "\fB\-dM\fR" 4
+.IP "\fB\-dM\fR" 4
.IX Item "-dM"
Tell the preprocessor to output only a list of the macro definitions
that are in effect at the end of preprocessing. Used with the \fB\-E\fR
option.
-.Ip "\fB\-dD\fR" 4
+.IP "\fB\-dD\fR" 4
.IX Item "-dD"
Tell the preprocessing to pass all macro definitions into the output, in
their proper sequence in the rest of the output.
-.Ip "\fB\-dN\fR" 4
+.IP "\fB\-dN\fR" 4
.IX Item "-dN"
Like \fB\-dD\fR except that the macro arguments and contents are omitted.
Only \fB#define\fR \fIname\fR is included in the output.
-.Ip "\fB\-dI\fR" 4
+.IP "\fB\-dI\fR" 4
.IX Item "-dI"
Output \fB#include\fR directives in addition to the result of
preprocessing.
-.Ip "\fB\-trigraphs\fR" 4
+.IP "\fB\-fpreprocessed\fR" 4
+.IX Item "-fpreprocessed"
+Indicate to the preprocessor that the input file has already been
+preprocessed. This suppresses things like macro expansion, trigraph
+conversion, escaped newline splicing, and processing of most directives.
+In this mode the integrated preprocessor is little more than a tokenizer
+for the front ends.
+.Sp
+\&\fB\-fpreprocessed\fR is implicit if the input file has one of the
+extensions \fBi\fR, \fBii\fR or \fBmi\fR indicating it has already
+been preprocessed.
+.IP "\fB\-trigraphs\fR" 4
.IX Item "-trigraphs"
Process \s-1ISO\s0 standard trigraph sequences. These are three-character
sequences, all starting with \fB??\fR, that are defined by \s-1ISO\s0 C to
@@ -3365,33 +3608,33 @@ converts them. See the \fB\-std\fR and \fB\-ansi\fR options.
.Sp
The nine trigraph sequences are
.RS 4
-.Ip "\fB??(\fR" 4
+.IP "\fB??(\fR" 4
.IX Item "??("
--> \fB[\fR
-.Ip "\fB??)\fR" 4
+@expansion{} \fB[\fR
+.IP "\fB??)\fR" 4
.IX Item "??)"
--> \fB]\fR
-.Ip "\fB??<\fR" 4
+@expansion{} \fB]\fR
+.IP "\fB??<\fR" 4
.IX Item "??<"
--> \fB{\fR
-.Ip "\fB??>\fR" 4
+@expansion{} \fB{\fR
+.IP "\fB??>\fR" 4
.IX Item "??>"
--> \fB}\fR
-.Ip "\fB??=\fR" 4
+@expansion{} \fB}\fR
+.IP "\fB??=\fR" 4
.IX Item "??="
--> \fB#\fR
-.Ip "\fB??/\fR" 4
+@expansion{} \fB#\fR
+.IP "\fB??/\fR" 4
.IX Item "??/"
--> \fB\e\fR
-.Ip "\fB??'\fR" 4
+@expansion{} \fB\e\fR
+.IP "\fB??'\fR" 4
.IX Item "??'"
--> \fB^\fR
-.Ip "\fB??!\fR" 4
+@expansion{} \fB^\fR
+.IP "\fB??!\fR" 4
.IX Item "??!"
--> \fB|\fR
-.Ip "\fB??-\fR" 4
+@expansion{} \fB|\fR
+.IP "\fB??\-\fR" 4
.IX Item "??-"
--> \fB~\fR
+@expansion{} \fB~\fR
.RE
.RS 4
.Sp
@@ -3399,14 +3642,14 @@ Trigraph support is not popular, so many compilers do not implement it
properly. Portable code should not rely on trigraphs being either
converted or ignored.
.RE
-.Ip "\fB\-Wp,\fR\fIoption\fR" 4
+.IP "\fB\-Wp,\fR\fIoption\fR" 4
.IX Item "-Wp,option"
Pass \fIoption\fR as an option to the preprocessor. If \fIoption\fR
contains commas, it is split into multiple options at the commas.
.Sh "Passing Options to the Assembler"
.IX Subsection "Passing Options to the Assembler"
You can pass options to the assembler.
-.Ip "\fB\-Wa,\fR\fIoption\fR" 4
+.IP "\fB\-Wa,\fR\fIoption\fR" 4
.IX Item "-Wa,option"
Pass \fIoption\fR as an option to the assembler. If \fIoption\fR
contains commas, it is split into multiple options at the commas.
@@ -3415,24 +3658,24 @@ contains commas, it is split into multiple options at the commas.
These options come into play when the compiler links object files into
an executable output file. They are meaningless if the compiler is
not doing a link step.
-.Ip "\fIobject-file-name\fR" 4
+.IP "\fIobject-file-name\fR" 4
.IX Item "object-file-name"
A file name that does not end in a special recognized suffix is
considered to name an object file or library. (Object files are
distinguished from libraries by the linker according to the file
contents.) If linking is done, these object files are used as input
to the linker.
-.Ip "\fB\-c\fR" 4
+.IP "\fB\-c\fR" 4
.IX Item "-c"
.PD 0
-.Ip "\fB\-S\fR" 4
+.IP "\fB\-S\fR" 4
.IX Item "-S"
-.Ip "\fB\-E\fR" 4
+.IP "\fB\-E\fR" 4
.IX Item "-E"
.PD
If any of these options is used, then the linker is not run, and
object file names should not be used as arguments.
-.Ip "\fB\-l\fR\fIlibrary\fR" 4
+.IP "\fB\-l\fR\fIlibrary\fR" 4
.IX Item "-llibrary"
Search the library named \fIlibrary\fR when linking.
.Sp
@@ -3457,16 +3700,16 @@ ordinary object file, it is linked in the usual fashion. The only
difference between using an \fB\-l\fR option and specifying a file name
is that \fB\-l\fR surrounds \fIlibrary\fR with \fBlib\fR and \fB.a\fR
and searches several directories.
-.Ip "\fB\-lobjc\fR" 4
+.IP "\fB\-lobjc\fR" 4
.IX Item "-lobjc"
You need this special case of the \fB\-l\fR option in order to
link an Objective C program.
-.Ip "\fB\-nostartfiles\fR" 4
+.IP "\fB\-nostartfiles\fR" 4
.IX Item "-nostartfiles"
Do not use the standard system startup files when linking.
The standard system libraries are used normally, unless \fB\-nostdlib\fR
or \fB\-nodefaultlibs\fR is used.
-.Ip "\fB\-nodefaultlibs\fR" 4
+.IP "\fB\-nodefaultlibs\fR" 4
.IX Item "-nodefaultlibs"
Do not use the standard system libraries when linking.
Only the libraries you specify will be passed to the linker.
@@ -3476,11 +3719,11 @@ for System V (and \s-1ISO\s0 C) environments or to bcopy and bzero for
\&\s-1BSD\s0 environments. These entries are usually resolved by entries in
libc. These entry points should be supplied through some other
mechanism when this option is specified.
-.Ip "\fB\-nostdlib\fR" 4
+.IP "\fB\-nostdlib\fR" 4
.IX Item "-nostdlib"
Do not use the standard system startup files or libraries when linking.
No startup files and only the libraries you specify will be passed to
-the linker. The compiler may generate calls to memcmp, memset, and memcpy
+the linker. The compiler may generate calls to memcmp, memset, and memcpy
for System V (and \s-1ISO\s0 C) environments or to bcopy and bzero for
\&\s-1BSD\s0 environments. These entries are usually resolved by entries in
libc. These entry points should be supplied through some other
@@ -3497,24 +3740,24 @@ or \fB\-nodefaultlibs\fR you should usually specify \fB\-lgcc\fR as well.
This ensures that you have no unresolved references to internal \s-1GCC\s0
library subroutines. (For example, \fB_\|_main\fR, used to ensure \*(C+
constructors will be called.)
-.Ip "\fB\-s\fR" 4
+.IP "\fB\-s\fR" 4
.IX Item "-s"
Remove all symbol table and relocation information from the executable.
-.Ip "\fB\-static\fR" 4
+.IP "\fB\-static\fR" 4
.IX Item "-static"
On systems that support dynamic linking, this prevents linking with the shared
libraries. On other systems, this option has no effect.
-.Ip "\fB\-shared\fR" 4
+.IP "\fB\-shared\fR" 4
.IX Item "-shared"
Produce a shared object which can then be linked with other objects to
form an executable. Not all systems support this option. For predictable
-results, you must also specify the same set of options that were used to
+results, you must also specify the same set of options that were used to
generate code (\fB\-fpic\fR, \fB\-fPIC\fR, or model suboptions)
when you specify this option.[1]
-.Ip "\fB\-shared-libgcc\fR" 4
+.IP "\fB\-shared\-libgcc\fR" 4
.IX Item "-shared-libgcc"
.PD 0
-.Ip "\fB\-static-libgcc\fR" 4
+.IP "\fB\-static\-libgcc\fR" 4
.IX Item "-static-libgcc"
.PD
On systems that provide \fIlibgcc\fR as a shared library, these options
@@ -3528,18 +3771,23 @@ of these is when the application wishes to throw and catch exceptions
across different shared libraries. In that case, each of the libraries
as well as the application itself should use the shared \fIlibgcc\fR.
.Sp
-At present the \s-1GCC\s0 driver makes no attempt to recognize the situations
-in which the shared \fIlibgcc\fR should be used, and defaults to using
-the static \fIlibgcc\fR always. This will likely change in the future,
-at which time \fB\-static-libgcc\fR becomes useful as a means for
-overriding \s-1GCC\s0's choice.
-.Ip "\fB\-symbolic\fR" 4
+Therefore, whenever you specify the \fB\-shared\fR option, the \s-1GCC\s0
+driver automatically adds \fB\-shared\-libgcc\fR, unless you explicitly
+specify \fB\-static\-libgcc\fR. The G++ driver automatically adds
+\&\fB\-shared\-libgcc\fR when you build a main executable as well because
+for \*(C+ programs that is typically the right thing to do.
+(Exception\-handling will not work reliably otherwise.)
+.Sp
+However, when linking a main executable written in C, you must
+explicitly say \fB\-shared\-libgcc\fR if you want to use the shared
+\&\fIlibgcc\fR.
+.IP "\fB\-symbolic\fR" 4
.IX Item "-symbolic"
Bind references to global symbols when building a shared object. Warn
about any unresolved references (unless overridden by the link editor
option \fB\-Xlinker \-z \-Xlinker defs\fR). Only a few systems support
this option.
-.Ip "\fB\-Xlinker\fR \fIoption\fR" 4
+.IP "\fB\-Xlinker\fR \fIoption\fR" 4
.IX Item "-Xlinker option"
Pass \fIoption\fR as an option to the linker. You can use this to
supply system-specific linker options which \s-1GCC\s0 does not know how to
@@ -3551,11 +3799,11 @@ For example, to pass \fB\-assert definitions\fR, you must write
\&\fB\-Xlinker \-assert \-Xlinker definitions\fR. It does not work to write
\&\fB\-Xlinker \*(L"\-assert definitions\*(R"\fR, because this passes the entire
string as a single argument, which is not what the linker expects.
-.Ip "\fB\-Wl,\fR\fIoption\fR" 4
+.IP "\fB\-Wl,\fR\fIoption\fR" 4
.IX Item "-Wl,option"
Pass \fIoption\fR as an option to the linker. If \fIoption\fR contains
commas, it is split into multiple options at the commas.
-.Ip "\fB\-u\fR \fIsymbol\fR" 4
+.IP "\fB\-u\fR \fIsymbol\fR" 4
.IX Item "-u symbol"
Pretend the symbol \fIsymbol\fR is undefined, to force linking of
library modules to define it. You can use \fB\-u\fR multiple times with
@@ -3564,41 +3812,43 @@ different symbols to force loading of additional library modules.
.IX Subsection "Options for Directory Search"
These options specify directories to search for header files, for
libraries and for parts of the compiler:
-.Ip "\fB\-I\fR\fIdir\fR" 4
+.IP "\fB\-I\fR\fIdir\fR" 4
.IX Item "-Idir"
Add the directory \fIdir\fR to the head of the list of directories to be
searched for header files. This can be used to override a system header
file, substituting your own version, since these directories are
-searched before the system header file directories. If you use more
-than one \fB\-I\fR option, the directories are scanned in left-to-right
+searched before the system header file directories. However, you should
+not use this option to add directories that contain vendor-supplied
+system header files (use \fB\-isystem\fR for that). If you use more than
+one \fB\-I\fR option, the directories are scanned in left-to-right
order; the standard system directories come after.
-.Ip "\fB\-I-\fR" 4
+.IP "\fB\-I\-\fR" 4
.IX Item "-I-"
-Any directories you specify with \fB\-I\fR options before the \fB\-I-\fR
+Any directories you specify with \fB\-I\fR options before the \fB\-I\-\fR
option are searched only for the case of \fB#include "\fR\fIfile\fR\fB"\fR;
they are not searched for \fB#include <\fR\fIfile\fR\fB>\fR.
.Sp
If additional directories are specified with \fB\-I\fR options after
-the \fB\-I-\fR, these directories are searched for all \fB#include\fR
+the \fB\-I\-\fR, these directories are searched for all \fB#include\fR
directives. (Ordinarily \fIall\fR \fB\-I\fR directories are used
this way.)
.Sp
-In addition, the \fB\-I-\fR option inhibits the use of the current
+In addition, the \fB\-I\-\fR option inhibits the use of the current
directory (where the current input file came from) as the first search
directory for \fB#include "\fR\fIfile\fR\fB"\fR. There is no way to
-override this effect of \fB\-I-\fR. With \fB\-I.\fR you can specify
+override this effect of \fB\-I\-\fR. With \fB\-I.\fR you can specify
searching the directory which was current when the compiler was
invoked. That is not exactly the same as what the preprocessor does
by default, but it is often satisfactory.
.Sp
-\&\fB\-I-\fR does not inhibit the use of the standard system directories
-for header files. Thus, \fB\-I-\fR and \fB\-nostdinc\fR are
+\&\fB\-I\-\fR does not inhibit the use of the standard system directories
+for header files. Thus, \fB\-I\-\fR and \fB\-nostdinc\fR are
independent.
-.Ip "\fB\-L\fR\fIdir\fR" 4
+.IP "\fB\-L\fR\fIdir\fR" 4
.IX Item "-Ldir"
Add directory \fIdir\fR to the list of directories to be searched
for \fB\-l\fR.
-.Ip "\fB\-B\fR\fIprefix\fR" 4
+.IP "\fB\-B\fR\fIprefix\fR" 4
.IX Item "-Bprefix"
This option specifies where to find the executables, libraries,
include files, and data files of the compiler itself.
@@ -3611,7 +3861,7 @@ without \fImachine\fR\fB/\fR\fIversion\fR\fB/\fR.
For each subprogram to be run, the compiler driver first tries the
\&\fB\-B\fR prefix, if any. If that name is not found, or if \fB\-B\fR
was not specified, the driver tries two standard prefixes, which are
-\&\fI/usr/lib/gcc/\fR and \fI/usr/local/lib/gcc-lib/\fR. If neither of
+\&\fI/usr/lib/gcc/\fR and \fI/usr/local/lib/gcc\-lib/\fR. If neither of
those results in a file name that is found, the unmodified program
name is searched for using the directories specified in your
\&\fB\s-1PATH\s0\fR environment variable.
@@ -3630,7 +3880,7 @@ out of the link if it is not found by those means.
.Sp
Another way to specify a prefix much like the \fB\-B\fR prefix is to use
the environment variable \fB\s-1GCC_EXEC_PREFIX\s0\fR.
-.Ip "\fB\-specs=\fR\fIfile\fR" 4
+.IP "\fB\-specs=\fR\fIfile\fR" 4
.IX Item "-specs=file"
Process \fIfile\fR after the compiler reads in the standard \fIspecs\fR
file, in order to override the defaults that the \fIgcc\fR driver
@@ -3641,7 +3891,7 @@ are processed in order, from left to right.
.Sh "Specifying Target Machine and Compiler Version"
.IX Subsection "Specifying Target Machine and Compiler Version"
By default, \s-1GCC\s0 compiles code for the same type of machine that you
-are using. However, it can also be installed as a cross-compiler, to
+are using. However, it can also be installed as a cross\-compiler, to
compile for some other type of machine. In fact, several different
configurations of \s-1GCC\s0, for different target machines, can be
installed side by side. Then you specify which one to use with the
@@ -3650,20 +3900,20 @@ installed side by side. Then you specify which one to use with the
In addition, older and newer versions of \s-1GCC\s0 can be installed side
by side. One of them (probably the newest) will be the default, but
you may sometimes wish to use another.
-.Ip "\fB\-b\fR \fImachine\fR" 4
+.IP "\fB\-b\fR \fImachine\fR" 4
.IX Item "-b machine"
The argument \fImachine\fR specifies the target machine for compilation.
-This is useful when you have installed \s-1GCC\s0 as a cross-compiler.
+This is useful when you have installed \s-1GCC\s0 as a cross\-compiler.
.Sp
The value to use for \fImachine\fR is the same as was specified as the
-machine type when configuring \s-1GCC\s0 as a cross-compiler. For
+machine type when configuring \s-1GCC\s0 as a cross\-compiler. For
example, if a cross-compiler was configured with \fBconfigure
i386v\fR, meaning to compile for an 80386 running System V, then you
would specify \fB\-b i386v\fR to run that cross compiler.
.Sp
When you do not specify \fB\-b\fR, it normally means to compile for
the same type of machine that you are using.
-.Ip "\fB\-V\fR \fIversion\fR" 4
+.IP "\fB\-V\fR \fIversion\fR" 4
.IX Item "-V version"
The argument \fIversion\fR specifies which version of \s-1GCC\s0 to run.
This is useful when multiple versions are installed. For example,
@@ -3675,11 +3925,11 @@ version of \s-1GCC\s0 that you installed.
The \fB\-b\fR and \fB\-V\fR options actually work by controlling part of
the file name used for the executable files and libraries used for
compilation. A given version of \s-1GCC\s0, for a given target machine, is
-normally kept in the directory \fI/usr/local/lib/gcc-lib/\fImachine\fI/\fIversion\fI\fR.
+normally kept in the directory \fI/usr/local/lib/gcc\-lib/\fImachine\fI/\fIversion\fI\fR.
.PP
Thus, sites can customize the effect of \fB\-b\fR or \fB\-V\fR either by
changing the names of these directories or adding alternate names (or
-symbolic links). If in directory \fI/usr/local/lib/gcc-lib/\fR the
+symbolic links). If in directory \fI/usr/local/lib/gcc\-lib/\fR the
file \fI80386\fR is a link to the file \fIi386v\fR, then \fB\-b
80386\fR becomes an alias for \fB\-b i386v\fR.
.PP
@@ -3731,17 +3981,17 @@ Some configurations of the compiler also support additional special
options, usually for compatibility with other compilers on the same
platform.
.PP
-.I "M680x0 Options"
+\fIM680x0 Options\fR
.IX Subsection "M680x0 Options"
.PP
These are the \fB\-m\fR options defined for the 68000 series. The default
values for these options depends on which style of 68000 was selected when
the compiler was configured; the defaults for the most common choices are
given below.
-.Ip "\fB\-m68000\fR" 4
+.IP "\fB\-m68000\fR" 4
.IX Item "-m68000"
.PD 0
-.Ip "\fB\-mc68000\fR" 4
+.IP "\fB\-mc68000\fR" 4
.IX Item "-mc68000"
.PD
Generate output for a 68000. This is the default
@@ -3749,24 +3999,24 @@ when the compiler is configured for 68000\-based systems.
.Sp
Use this option for microcontrollers with a 68000 or \s-1EC000\s0 core,
including the 68008, 68302, 68306, 68307, 68322, 68328 and 68356.
-.Ip "\fB\-m68020\fR" 4
+.IP "\fB\-m68020\fR" 4
.IX Item "-m68020"
.PD 0
-.Ip "\fB\-mc68020\fR" 4
+.IP "\fB\-mc68020\fR" 4
.IX Item "-mc68020"
.PD
Generate output for a 68020. This is the default
when the compiler is configured for 68020\-based systems.
-.Ip "\fB\-m68881\fR" 4
+.IP "\fB\-m68881\fR" 4
.IX Item "-m68881"
Generate output containing 68881 instructions for floating point.
-This is the default for most 68020 systems unless \fB\-nfp\fR was
+This is the default for most 68020 systems unless \fB\-\-nfp\fR was
specified when the compiler was configured.
-.Ip "\fB\-m68030\fR" 4
+.IP "\fB\-m68030\fR" 4
.IX Item "-m68030"
Generate output for a 68030. This is the default when the compiler is
configured for 68030\-based systems.
-.Ip "\fB\-m68040\fR" 4
+.IP "\fB\-m68040\fR" 4
.IX Item "-m68040"
Generate output for a 68040. This is the default when the compiler is
configured for 68040\-based systems.
@@ -3774,7 +4024,7 @@ configured for 68040\-based systems.
This option inhibits the use of 68881/68882 instructions that have to be
emulated by software on the 68040. Use this option if your 68040 does not
have code to emulate those instructions.
-.Ip "\fB\-m68060\fR" 4
+.IP "\fB\-m68060\fR" 4
.IX Item "-m68060"
Generate output for a 68060. This is the default when the compiler is
configured for 68060\-based systems.
@@ -3782,58 +4032,58 @@ configured for 68060\-based systems.
This option inhibits the use of 68020 and 68881/68882 instructions that
have to be emulated by software on the 68060. Use this option if your 68060
does not have code to emulate those instructions.
-.Ip "\fB\-mcpu32\fR" 4
+.IP "\fB\-mcpu32\fR" 4
.IX Item "-mcpu32"
-Generate output for a \s-1CPU32\s0. This is the default
+Generate output for a \s-1CPU32\s0. This is the default
when the compiler is configured for CPU32\-based systems.
.Sp
Use this option for microcontrollers with a
\&\s-1CPU32\s0 or \s-1CPU32+\s0 core, including the 68330, 68331, 68332, 68333, 68334,
68336, 68340, 68341, 68349 and 68360.
-.Ip "\fB\-m5200\fR" 4
+.IP "\fB\-m5200\fR" 4
.IX Item "-m5200"
-Generate output for a 520X \*(L"coldfire\*(R" family cpu. This is the default
-when the compiler is configured for 520X-based systems.
+Generate output for a 520X ``coldfire'' family cpu. This is the default
+when the compiler is configured for 520X\-based systems.
.Sp
-Use this option for microcontroller with a 5200 core, including
+Use this option for microcontroller with a 5200 core, including
the \s-1MCF5202\s0, \s-1MCF5203\s0, \s-1MCF5204\s0 and \s-1MCF5202\s0.
-.Ip "\fB\-m68020\-40\fR" 4
+.IP "\fB\-m68020\-40\fR" 4
.IX Item "-m68020-40"
Generate output for a 68040, without using any of the new instructions.
This results in code which can run relatively efficiently on either a
68020/68881 or a 68030 or a 68040. The generated code does use the
68881 instructions that are emulated on the 68040.
-.Ip "\fB\-m68020\-60\fR" 4
+.IP "\fB\-m68020\-60\fR" 4
.IX Item "-m68020-60"
Generate output for a 68060, without using any of the new instructions.
This results in code which can run relatively efficiently on either a
68020/68881 or a 68030 or a 68040. The generated code does use the
68881 instructions that are emulated on the 68060.
-.Ip "\fB\-mfpa\fR" 4
+.IP "\fB\-mfpa\fR" 4
.IX Item "-mfpa"
Generate output containing Sun \s-1FPA\s0 instructions for floating point.
-.Ip "\fB\-msoft-float\fR" 4
+.IP "\fB\-msoft\-float\fR" 4
.IX Item "-msoft-float"
Generate output containing library calls for floating point.
\&\fBWarning:\fR the requisite libraries are not available for all m68k
targets. Normally the facilities of the machine's usual C compiler are
-used, but this can't be done directly in cross-compilation. You must
+used, but this can't be done directly in cross\-compilation. You must
make your own arrangements to provide suitable library functions for
-cross-compilation. The embedded targets \fBm68k-*\-aout\fR and
-\&\fBm68k-*\-coff\fR do provide software floating point support.
-.Ip "\fB\-mshort\fR" 4
+cross\-compilation. The embedded targets \fBm68k\-*\-aout\fR and
+\&\fBm68k\-*\-coff\fR do provide software floating point support.
+.IP "\fB\-mshort\fR" 4
.IX Item "-mshort"
Consider type \f(CW\*(C`int\*(C'\fR to be 16 bits wide, like \f(CW\*(C`short int\*(C'\fR.
-.Ip "\fB\-mnobitfield\fR" 4
+.IP "\fB\-mnobitfield\fR" 4
.IX Item "-mnobitfield"
Do not use the bit-field instructions. The \fB\-m68000\fR, \fB\-mcpu32\fR
and \fB\-m5200\fR options imply \fB\-mnobitfield\fR.
-.Ip "\fB\-mbitfield\fR" 4
+.IP "\fB\-mbitfield\fR" 4
.IX Item "-mbitfield"
Do use the bit-field instructions. The \fB\-m68020\fR option implies
\&\fB\-mbitfield\fR. This is the default if you use a configuration
designed for a 68020.
-.Ip "\fB\-mrtd\fR" 4
+.IP "\fB\-mrtd\fR" 4
.IX Item "-mrtd"
Use a different function-calling convention, in which functions
that take a fixed number of arguments return with the \f(CW\*(C`rtd\*(C'\fR
@@ -3856,140 +4106,140 @@ harmlessly ignored.)
.Sp
The \f(CW\*(C`rtd\*(C'\fR instruction is supported by the 68010, 68020, 68030,
68040, 68060 and \s-1CPU32\s0 processors, but not by the 68000 or 5200.
-.Ip "\fB\-malign-int\fR" 4
+.IP "\fB\-malign\-int\fR" 4
.IX Item "-malign-int"
.PD 0
-.Ip "\fB\-mno-align-int\fR" 4
+.IP "\fB\-mno\-align\-int\fR" 4
.IX Item "-mno-align-int"
.PD
-Control whether \s-1GCC\s0 aligns \f(CW\*(C`int\*(C'\fR, \f(CW\*(C`long\*(C'\fR, \f(CW\*(C`long long\*(C'\fR,
+Control whether \s-1GCC\s0 aligns \f(CW\*(C`int\*(C'\fR, \f(CW\*(C`long\*(C'\fR, \f(CW\*(C`long long\*(C'\fR,
\&\f(CW\*(C`float\*(C'\fR, \f(CW\*(C`double\*(C'\fR, and \f(CW\*(C`long double\*(C'\fR variables on a 32\-bit
-boundary (\fB\-malign-int\fR) or a 16\-bit boundary (\fB\-mno-align-int\fR).
+boundary (\fB\-malign\-int\fR) or a 16\-bit boundary (\fB\-mno\-align\-int\fR).
Aligning variables on 32\-bit boundaries produces code that runs somewhat
faster on processors with 32\-bit busses at the expense of more memory.
.Sp
-\&\fBWarning:\fR if you use the \fB\-malign-int\fR switch, \s-1GCC\s0 will
+\&\fBWarning:\fR if you use the \fB\-malign\-int\fR switch, \s-1GCC\s0 will
align structures containing the above types differently than
most published application binary interface specifications for the m68k.
-.Ip "\fB\-mpcrel\fR" 4
+.IP "\fB\-mpcrel\fR" 4
.IX Item "-mpcrel"
Use the pc-relative addressing mode of the 68000 directly, instead of
-using a global offset table. At present, this option implies \-fpic,
-allowing at most a 16\-bit offset for pc-relative addressing. \-fPIC is
-not presently supported with \-mpcrel, though this could be supported for
+using a global offset table. At present, this option implies \fB\-fpic\fR,
+allowing at most a 16\-bit offset for pc-relative addressing. \fB\-fPIC\fR is
+not presently supported with \fB\-mpcrel\fR, though this could be supported for
68020 and higher processors.
-.Ip "\fB\-mno-strict-align\fR" 4
+.IP "\fB\-mno\-strict\-align\fR" 4
.IX Item "-mno-strict-align"
.PD 0
-.Ip "\fB\-mstrict-align\fR" 4
+.IP "\fB\-mstrict\-align\fR" 4
.IX Item "-mstrict-align"
.PD
Do not (do) assume that unaligned memory references will be handled by
the system.
.PP
-.I "M68hc1x Options"
+\fIM68hc1x Options\fR
.IX Subsection "M68hc1x Options"
.PP
These are the \fB\-m\fR options defined for the 68hc11 and 68hc12
-microcontrollers. The default values for these options depends on
+microcontrollers. The default values for these options depends on
which style of microcontroller was selected when the compiler was configured;
the defaults for the most common choices are given below.
-.Ip "\fB\-m6811\fR" 4
+.IP "\fB\-m6811\fR" 4
.IX Item "-m6811"
.PD 0
-.Ip "\fB\-m68hc11\fR" 4
+.IP "\fB\-m68hc11\fR" 4
.IX Item "-m68hc11"
.PD
Generate output for a 68HC11. This is the default
when the compiler is configured for 68HC11\-based systems.
-.Ip "\fB\-m6812\fR" 4
+.IP "\fB\-m6812\fR" 4
.IX Item "-m6812"
.PD 0
-.Ip "\fB\-m68hc12\fR" 4
+.IP "\fB\-m68hc12\fR" 4
.IX Item "-m68hc12"
.PD
Generate output for a 68HC12. This is the default
when the compiler is configured for 68HC12\-based systems.
-.Ip "\fB\-mauto-incdec\fR" 4
+.IP "\fB\-mauto\-incdec\fR" 4
.IX Item "-mauto-incdec"
Enable the use of 68HC12 pre and post auto-increment and auto-decrement
addressing modes.
-.Ip "\fB\-mshort\fR" 4
+.IP "\fB\-mshort\fR" 4
.IX Item "-mshort"
Consider type \f(CW\*(C`int\*(C'\fR to be 16 bits wide, like \f(CW\*(C`short int\*(C'\fR.
-.Ip "\fB\-msoft-reg-count=\fR\fIcount\fR" 4
+.IP "\fB\-msoft\-reg\-count=\fR\fIcount\fR" 4
.IX Item "-msoft-reg-count=count"
Specify the number of pseudo-soft registers which are used for the
code generation. The maximum number is 32. Using more pseudo-soft
register may or may not result in better code depending on the program.
The default is 4 for 68HC11 and 2 for 68HC12.
.PP
-.I "\s-1VAX\s0 Options"
+\fI\s-1VAX\s0 Options\fR
.IX Subsection "VAX Options"
.PP
These \fB\-m\fR options are defined for the Vax:
-.Ip "\fB\-munix\fR" 4
+.IP "\fB\-munix\fR" 4
.IX Item "-munix"
Do not output certain jump instructions (\f(CW\*(C`aobleq\*(C'\fR and so on)
that the Unix assembler for the Vax cannot handle across long
ranges.
-.Ip "\fB\-mgnu\fR" 4
+.IP "\fB\-mgnu\fR" 4
.IX Item "-mgnu"
Do output those jump instructions, on the assumption that you
will assemble with the \s-1GNU\s0 assembler.
-.Ip "\fB\-mg\fR" 4
+.IP "\fB\-mg\fR" 4
.IX Item "-mg"
-Output code for g-format floating point numbers instead of d-format.
+Output code for g\-format floating point numbers instead of d\-format.
.PP
-.I "\s-1SPARC\s0 Options"
+\fI\s-1SPARC\s0 Options\fR
.IX Subsection "SPARC Options"
.PP
These \fB\-m\fR switches are supported on the \s-1SPARC:\s0
-.Ip "\fB\-mno-app-regs\fR" 4
+.IP "\fB\-mno\-app\-regs\fR" 4
.IX Item "-mno-app-regs"
.PD 0
-.Ip "\fB\-mapp-regs\fR" 4
+.IP "\fB\-mapp\-regs\fR" 4
.IX Item "-mapp-regs"
.PD
-Specify \fB\-mapp-regs\fR to generate output using the global registers
+Specify \fB\-mapp\-regs\fR to generate output using the global registers
2 through 4, which the \s-1SPARC\s0 \s-1SVR4\s0 \s-1ABI\s0 reserves for applications. This
is the default.
.Sp
To be fully \s-1SVR4\s0 \s-1ABI\s0 compliant at the cost of some performance loss,
-specify \fB\-mno-app-regs\fR. You should compile libraries and system
+specify \fB\-mno\-app\-regs\fR. You should compile libraries and system
software with this option.
-.Ip "\fB\-mfpu\fR" 4
+.IP "\fB\-mfpu\fR" 4
.IX Item "-mfpu"
.PD 0
-.Ip "\fB\-mhard-float\fR" 4
+.IP "\fB\-mhard\-float\fR" 4
.IX Item "-mhard-float"
.PD
Generate output containing floating point instructions. This is the
default.
-.Ip "\fB\-mno-fpu\fR" 4
+.IP "\fB\-mno\-fpu\fR" 4
.IX Item "-mno-fpu"
.PD 0
-.Ip "\fB\-msoft-float\fR" 4
+.IP "\fB\-msoft\-float\fR" 4
.IX Item "-msoft-float"
.PD
Generate output containing library calls for floating point.
\&\fBWarning:\fR the requisite libraries are not available for all \s-1SPARC\s0
targets. Normally the facilities of the machine's usual C compiler are
-used, but this cannot be done directly in cross-compilation. You must make
+used, but this cannot be done directly in cross\-compilation. You must make
your own arrangements to provide suitable library functions for
-cross-compilation. The embedded targets \fBsparc-*\-aout\fR and
-\&\fBsparclite-*\-*\fR do provide software floating point support.
+cross\-compilation. The embedded targets \fBsparc\-*\-aout\fR and
+\&\fBsparclite\-*\-*\fR do provide software floating point support.
.Sp
-\&\fB\-msoft-float\fR changes the calling convention in the output file;
+\&\fB\-msoft\-float\fR changes the calling convention in the output file;
therefore, it is only useful if you compile \fIall\fR of a program with
this option. In particular, you need to compile \fIlibgcc.a\fR, the
-library that comes with \s-1GCC\s0, with \fB\-msoft-float\fR in order for
+library that comes with \s-1GCC\s0, with \fB\-msoft\-float\fR in order for
this to work.
-.Ip "\fB\-mhard-quad-float\fR" 4
+.IP "\fB\-mhard\-quad\-float\fR" 4
.IX Item "-mhard-quad-float"
Generate output containing quad-word (long double) floating point
instructions.
-.Ip "\fB\-msoft-quad-float\fR" 4
+.IP "\fB\-msoft\-quad\-float\fR" 4
.IX Item "-msoft-quad-float"
Generate output containing library calls for quad-word (long double)
floating point instructions. The functions called are those specified
@@ -4000,11 +4250,11 @@ support for the quad-word floating point instructions. They all invoke
a trap handler for one of these instructions, and then the trap handler
emulates the effect of the instruction. Because of the trap handler overhead,
this is much slower than calling the \s-1ABI\s0 library routines. Thus the
-\&\fB\-msoft-quad-float\fR option is the default.
-.Ip "\fB\-mno-epilogue\fR" 4
+\&\fB\-msoft\-quad\-float\fR option is the default.
+.IP "\fB\-mno\-epilogue\fR" 4
.IX Item "-mno-epilogue"
.PD 0
-.Ip "\fB\-mepilogue\fR" 4
+.IP "\fB\-mepilogue\fR" 4
.IX Item "-mepilogue"
.PD
With \fB\-mepilogue\fR (the default), the compiler always emits code for
@@ -4012,44 +4262,44 @@ function exit at the end of each function. Any function exit in
the middle of the function (such as a return statement in C) will
generate a jump to the exit code at the end of the function.
.Sp
-With \fB\-mno-epilogue\fR, the compiler tries to emit exit code inline
+With \fB\-mno\-epilogue\fR, the compiler tries to emit exit code inline
at every function exit.
-.Ip "\fB\-mno-flat\fR" 4
+.IP "\fB\-mno\-flat\fR" 4
.IX Item "-mno-flat"
.PD 0
-.Ip "\fB\-mflat\fR" 4
+.IP "\fB\-mflat\fR" 4
.IX Item "-mflat"
.PD
With \fB\-mflat\fR, the compiler does not generate save/restore instructions
-and will use a \*(L"flat\*(R" or single register window calling convention.
+and will use a ``flat'' or single register window calling convention.
This model uses \f(CW%i7\fR as the frame pointer and is compatible with the normal
register window model. Code from either may be intermixed.
-The local registers and the input registers (0\-5) are still treated as
-\&\*(L"call saved\*(R" registers and will be saved on the stack as necessary.
+The local registers and the input registers (0\-\-5) are still treated as
+``call saved'' registers and will be saved on the stack as necessary.
.Sp
-With \fB\-mno-flat\fR (the default), the compiler emits save/restore
+With \fB\-mno\-flat\fR (the default), the compiler emits save/restore
instructions (except for leaf functions) and is the normal mode of operation.
-.Ip "\fB\-mno-unaligned-doubles\fR" 4
+.IP "\fB\-mno\-unaligned\-doubles\fR" 4
.IX Item "-mno-unaligned-doubles"
.PD 0
-.Ip "\fB\-munaligned-doubles\fR" 4
+.IP "\fB\-munaligned\-doubles\fR" 4
.IX Item "-munaligned-doubles"
.PD
Assume that doubles have 8 byte alignment. This is the default.
.Sp
-With \fB\-munaligned-doubles\fR, \s-1GCC\s0 assumes that doubles have 8 byte
+With \fB\-munaligned\-doubles\fR, \s-1GCC\s0 assumes that doubles have 8 byte
alignment only if they are contained in another type, or if they have an
absolute address. Otherwise, it assumes they have 4 byte alignment.
Specifying this option avoids some rare compatibility problems with code
generated by other compilers. It is not the default because it results
in a performance loss, especially for floating point code.
-.Ip "\fB\-mno-faster-structs\fR" 4
+.IP "\fB\-mno\-faster\-structs\fR" 4
.IX Item "-mno-faster-structs"
.PD 0
-.Ip "\fB\-mfaster-structs\fR" 4
+.IP "\fB\-mfaster\-structs\fR" 4
.IX Item "-mfaster-structs"
.PD
-With \fB\-mfaster-structs\fR, the compiler assumes that structures
+With \fB\-mfaster\-structs\fR, the compiler assumes that structures
should have 8 byte alignment. This enables the use of pairs of
\&\f(CW\*(C`ldd\*(C'\fR and \f(CW\*(C`std\*(C'\fR instructions for copies in structure
assignment, in place of twice as many \f(CW\*(C`ld\*(C'\fR and \f(CW\*(C`st\*(C'\fR pairs.
@@ -4057,10 +4307,10 @@ However, the use of this changed alignment directly violates the Sparc
\&\s-1ABI\s0. Thus, it's intended only for use on targets where the developer
acknowledges that their resulting code will not be directly in line with
the rules of the \s-1ABI\s0.
-.Ip "\fB\-mv8\fR" 4
+.IP "\fB\-mv8\fR" 4
.IX Item "-mv8"
.PD 0
-.Ip "\fB\-msparclite\fR" 4
+.IP "\fB\-msparclite\fR" 4
.IX Item "-msparclite"
.PD
These two options select variations on the \s-1SPARC\s0 architecture.
@@ -4078,10 +4328,10 @@ exist in SPARClite but not in \s-1SPARC\s0 v7.
.Sp
These options are deprecated and will be deleted in a future \s-1GCC\s0 release.
They have been replaced with \fB\-mcpu=xxx\fR.
-.Ip "\fB\-mcypress\fR" 4
+.IP "\fB\-mcypress\fR" 4
.IX Item "-mcypress"
.PD 0
-.Ip "\fB\-msupersparc\fR" 4
+.IP "\fB\-msupersparc\fR" 4
.IX Item "-msupersparc"
.PD
These two options select the processor for which the code is optimised.
@@ -4091,12 +4341,12 @@ Cypress \s-1CY7C602\s0 chip, as used in the SparcStation/SparcServer 3xx series.
This is also appropriate for the older SparcStation 1, 2, \s-1IPX\s0 etc.
.Sp
With \fB\-msupersparc\fR the compiler optimizes code for the SuperSparc cpu, as
-used in the SparcStation 10, 1000 and 2000 series. This flag also enables use
+used in the SparcStation 10, 1000 and 2000 series. This flag also enables use
of the full \s-1SPARC\s0 v8 instruction set.
.Sp
These options are deprecated and will be deleted in a future \s-1GCC\s0 release.
They have been replaced with \fB\-mcpu=xxx\fR.
-.Ip "\fB\-mcpu=\fR\fIcpu_type\fR" 4
+.IP "\fB\-mcpu=\fR\fIcpu_type\fR" 4
.IX Item "-mcpu=cpu_type"
Set the instruction set, register set, and instruction scheduling parameters
for machine type \fIcpu_type\fR. Supported values for \fIcpu_type\fR are
@@ -4118,7 +4368,7 @@ implementations.
\& sparclet: tsc701
\& v9: ultrasparc
.Ve
-.Ip "\fB\-mtune=\fR\fIcpu_type\fR" 4
+.IP "\fB\-mtune=\fR\fIcpu_type\fR" 4
.IX Item "-mtune=cpu_type"
Set the instruction scheduling parameters for machine type
\&\fIcpu_type\fR, but do not set the instruction set or register set that the
@@ -4132,15 +4382,15 @@ select a particular cpu implementation: \fBcypress\fR, \fBsupersparc\fR,
.PP
These \fB\-m\fR switches are supported in addition to the above
on the \s-1SPARCLET\s0 processor.
-.Ip "\fB\-mlittle-endian\fR" 4
+.IP "\fB\-mlittle\-endian\fR" 4
.IX Item "-mlittle-endian"
Generate code for a processor running in little-endian mode.
-.Ip "\fB\-mlive-g0\fR" 4
+.IP "\fB\-mlive\-g0\fR" 4
.IX Item "-mlive-g0"
-Treat register \f(CW\*(C`%g0\*(C'\fR as a normal register.
+Treat register \f(CW%g0\fR as a normal register.
\&\s-1GCC\s0 will continue to clobber it as necessary but will not assume
it always reads as 0.
-.Ip "\fB\-mbroken-saverestore\fR" 4
+.IP "\fB\-mbroken\-saverestore\fR" 4
.IX Item "-mbroken-saverestore"
Generate code that does not use non-trivial forms of the \f(CW\*(C`save\*(C'\fR and
\&\f(CW\*(C`restore\*(C'\fR instructions. Early versions of the \s-1SPARCLET\s0 processor do
@@ -4152,152 +4402,152 @@ overflow trap handler will properly handle this case as will interrupt
handlers.
.PP
These \fB\-m\fR switches are supported in addition to the above
-on \s-1SPARC\s0 V9 processors in 64 bit environments.
-.Ip "\fB\-mlittle-endian\fR" 4
+on \s-1SPARC\s0 V9 processors in 64\-bit environments.
+.IP "\fB\-mlittle\-endian\fR" 4
.IX Item "-mlittle-endian"
Generate code for a processor running in little-endian mode.
-.Ip "\fB\-m32\fR" 4
+.IP "\fB\-m32\fR" 4
.IX Item "-m32"
.PD 0
-.Ip "\fB\-m64\fR" 4
+.IP "\fB\-m64\fR" 4
.IX Item "-m64"
.PD
-Generate code for a 32 bit or 64 bit environment.
-The 32 bit environment sets int, long and pointer to 32 bits.
-The 64 bit environment sets int to 32 bits and long and pointer
+Generate code for a 32\-bit or 64\-bit environment.
+The 32\-bit environment sets int, long and pointer to 32 bits.
+The 64\-bit environment sets int to 32 bits and long and pointer
to 64 bits.
-.Ip "\fB\-mcmodel=medlow\fR" 4
+.IP "\fB\-mcmodel=medlow\fR" 4
.IX Item "-mcmodel=medlow"
Generate code for the Medium/Low code model: the program must be linked
in the low 32 bits of the address space. Pointers are 64 bits.
Programs can be statically or dynamically linked.
-.Ip "\fB\-mcmodel=medmid\fR" 4
+.IP "\fB\-mcmodel=medmid\fR" 4
.IX Item "-mcmodel=medmid"
Generate code for the Medium/Middle code model: the program must be linked
in the low 44 bits of the address space, the text segment must be less than
2G bytes, and data segment must be within 2G of the text segment.
Pointers are 64 bits.
-.Ip "\fB\-mcmodel=medany\fR" 4
+.IP "\fB\-mcmodel=medany\fR" 4
.IX Item "-mcmodel=medany"
Generate code for the Medium/Anywhere code model: the program may be linked
anywhere in the address space, the text segment must be less than
2G bytes, and data segment must be within 2G of the text segment.
Pointers are 64 bits.
-.Ip "\fB\-mcmodel=embmedany\fR" 4
+.IP "\fB\-mcmodel=embmedany\fR" 4
.IX Item "-mcmodel=embmedany"
Generate code for the Medium/Anywhere code model for embedded systems:
-assume a 32 bit text and a 32 bit data segment, both starting anywhere
+assume a 32\-bit text and a 32\-bit data segment, both starting anywhere
(determined at link time). Register \f(CW%g4\fR points to the base of the
-data segment. Pointers still 64 bits.
+data segment. Pointers are still 64 bits.
Programs are statically linked, \s-1PIC\s0 is not supported.
-.Ip "\fB\-mstack-bias\fR" 4
+.IP "\fB\-mstack\-bias\fR" 4
.IX Item "-mstack-bias"
.PD 0
-.Ip "\fB\-mno-stack-bias\fR" 4
+.IP "\fB\-mno\-stack\-bias\fR" 4
.IX Item "-mno-stack-bias"
.PD
-With \fB\-mstack-bias\fR, \s-1GCC\s0 assumes that the stack pointer, and
+With \fB\-mstack\-bias\fR, \s-1GCC\s0 assumes that the stack pointer, and
frame pointer if present, are offset by \-2047 which must be added back
when making stack frame references.
Otherwise, assume no such offset is present.
.PP
-.I "Convex Options"
+\fIConvex Options\fR
.IX Subsection "Convex Options"
.PP
These \fB\-m\fR options are defined for Convex:
-.Ip "\fB\-mc1\fR" 4
+.IP "\fB\-mc1\fR" 4
.IX Item "-mc1"
Generate output for C1. The code will run on any Convex machine.
The preprocessor symbol \f(CW\*(C`_\|_convex_\|_c1_\|_\*(C'\fR is defined.
-.Ip "\fB\-mc2\fR" 4
+.IP "\fB\-mc2\fR" 4
.IX Item "-mc2"
Generate output for C2. Uses instructions not available on C1.
Scheduling and other optimizations are chosen for max performance on C2.
The preprocessor symbol \f(CW\*(C`_\|_convex_c2_\|_\*(C'\fR is defined.
-.Ip "\fB\-mc32\fR" 4
+.IP "\fB\-mc32\fR" 4
.IX Item "-mc32"
Generate output for C32xx. Uses instructions not available on C1.
Scheduling and other optimizations are chosen for max performance on C32.
The preprocessor symbol \f(CW\*(C`_\|_convex_c32_\|_\*(C'\fR is defined.
-.Ip "\fB\-mc34\fR" 4
+.IP "\fB\-mc34\fR" 4
.IX Item "-mc34"
Generate output for C34xx. Uses instructions not available on C1.
Scheduling and other optimizations are chosen for max performance on C34.
The preprocessor symbol \f(CW\*(C`_\|_convex_c34_\|_\*(C'\fR is defined.
-.Ip "\fB\-mc38\fR" 4
+.IP "\fB\-mc38\fR" 4
.IX Item "-mc38"
Generate output for C38xx. Uses instructions not available on C1.
Scheduling and other optimizations are chosen for max performance on C38.
The preprocessor symbol \f(CW\*(C`_\|_convex_c38_\|_\*(C'\fR is defined.
-.Ip "\fB\-margcount\fR" 4
+.IP "\fB\-margcount\fR" 4
.IX Item "-margcount"
Generate code which puts an argument count in the word preceding each
argument list. This is compatible with regular \s-1CC\s0, and a few programs
may need the argument count word. \s-1GDB\s0 and other source-level debuggers
do not need it; this info is in the symbol table.
-.Ip "\fB\-mnoargcount\fR" 4
+.IP "\fB\-mnoargcount\fR" 4
.IX Item "-mnoargcount"
Omit the argument count word. This is the default.
-.Ip "\fB\-mvolatile-cache\fR" 4
+.IP "\fB\-mvolatile\-cache\fR" 4
.IX Item "-mvolatile-cache"
Allow volatile references to be cached. This is the default.
-.Ip "\fB\-mvolatile-nocache\fR" 4
+.IP "\fB\-mvolatile\-nocache\fR" 4
.IX Item "-mvolatile-nocache"
Volatile references bypass the data cache, going all the way to memory.
This is only needed for multi-processor code that does not use standard
synchronization instructions. Making non-volatile references to volatile
locations will not necessarily work.
-.Ip "\fB\-mlong32\fR" 4
+.IP "\fB\-mlong32\fR" 4
.IX Item "-mlong32"
Type long is 32 bits, the same as type int. This is the default.
-.Ip "\fB\-mlong64\fR" 4
+.IP "\fB\-mlong64\fR" 4
.IX Item "-mlong64"
Type long is 64 bits, the same as type long long. This option is useless,
because no library support exists for it.
.PP
-.I "\s-1AMD29K\s0 Options"
+\fI\s-1AMD29K\s0 Options\fR
.IX Subsection "AMD29K Options"
.PP
These \fB\-m\fR options are defined for the \s-1AMD\s0 Am29000:
-.Ip "\fB\-mdw\fR" 4
+.IP "\fB\-mdw\fR" 4
.IX Item "-mdw"
Generate code that assumes the \f(CW\*(C`DW\*(C'\fR bit is set, i.e., that byte and
halfword operations are directly supported by the hardware. This is the
default.
-.Ip "\fB\-mndw\fR" 4
+.IP "\fB\-mndw\fR" 4
.IX Item "-mndw"
Generate code that assumes the \f(CW\*(C`DW\*(C'\fR bit is not set.
-.Ip "\fB\-mbw\fR" 4
+.IP "\fB\-mbw\fR" 4
.IX Item "-mbw"
Generate code that assumes the system supports byte and halfword write
operations. This is the default.
-.Ip "\fB\-mnbw\fR" 4
+.IP "\fB\-mnbw\fR" 4
.IX Item "-mnbw"
Generate code that assumes the systems does not support byte and
halfword write operations. \fB\-mnbw\fR implies \fB\-mndw\fR.
-.Ip "\fB\-msmall\fR" 4
+.IP "\fB\-msmall\fR" 4
.IX Item "-msmall"
Use a small memory model that assumes that all function addresses are
either within a single 256 \s-1KB\s0 segment or at an absolute address of less
than 256k. This allows the \f(CW\*(C`call\*(C'\fR instruction to be used instead
of a \f(CW\*(C`const\*(C'\fR, \f(CW\*(C`consth\*(C'\fR, \f(CW\*(C`calli\*(C'\fR sequence.
-.Ip "\fB\-mnormal\fR" 4
+.IP "\fB\-mnormal\fR" 4
.IX Item "-mnormal"
Use the normal memory model: Generate \f(CW\*(C`call\*(C'\fR instructions only when
calling functions in the same file and \f(CW\*(C`calli\*(C'\fR instructions
otherwise. This works if each file occupies less than 256 \s-1KB\s0 but allows
the entire executable to be larger than 256 \s-1KB\s0. This is the default.
-.Ip "\fB\-mlarge\fR" 4
+.IP "\fB\-mlarge\fR" 4
.IX Item "-mlarge"
Always use \f(CW\*(C`calli\*(C'\fR instructions. Specify this option if you expect
a single file to compile into more than 256 \s-1KB\s0 of code.
-.Ip "\fB\-m29050\fR" 4
+.IP "\fB\-m29050\fR" 4
.IX Item "-m29050"
Generate code for the Am29050.
-.Ip "\fB\-m29000\fR" 4
+.IP "\fB\-m29000\fR" 4
.IX Item "-m29000"
Generate code for the Am29000. This is the default.
-.Ip "\fB\-mkernel-registers\fR" 4
+.IP "\fB\-mkernel\-registers\fR" 4
.IX Item "-mkernel-registers"
Generate references to registers \f(CW\*(C`gr64\-gr95\*(C'\fR instead of to
registers \f(CW\*(C`gr96\-gr127\*(C'\fR. This option can be used when compiling
@@ -4305,115 +4555,93 @@ kernel code that wants a set of global registers disjoint from that used
by user-mode code.
.Sp
Note that when this option is used, register names in \fB\-f\fR flags
-must use the normal, user-mode, names.
-.Ip "\fB\-muser-registers\fR" 4
+must use the normal, user\-mode, names.
+.IP "\fB\-muser\-registers\fR" 4
.IX Item "-muser-registers"
Use the normal set of global registers, \f(CW\*(C`gr96\-gr127\*(C'\fR. This is the
default.
-.Ip "\fB\-mstack-check\fR" 4
+.IP "\fB\-mstack\-check\fR" 4
.IX Item "-mstack-check"
.PD 0
-.Ip "\fB\-mno-stack-check\fR" 4
+.IP "\fB\-mno\-stack\-check\fR" 4
.IX Item "-mno-stack-check"
.PD
Insert (or do not insert) a call to \f(CW\*(C`_\|_msp_check\*(C'\fR after each stack
adjustment. This is often used for kernel code.
-.Ip "\fB\-mstorem-bug\fR" 4
+.IP "\fB\-mstorem\-bug\fR" 4
.IX Item "-mstorem-bug"
.PD 0
-.Ip "\fB\-mno-storem-bug\fR" 4
+.IP "\fB\-mno\-storem\-bug\fR" 4
.IX Item "-mno-storem-bug"
.PD
-\&\fB\-mstorem-bug\fR handles 29k processors which cannot handle the
+\&\fB\-mstorem\-bug\fR handles 29k processors which cannot handle the
separation of a mtsrim insn and a storem instruction (most 29000 chips
to date, but not the 29050).
-.Ip "\fB\-mno-reuse-arg-regs\fR" 4
+.IP "\fB\-mno\-reuse\-arg\-regs\fR" 4
.IX Item "-mno-reuse-arg-regs"
.PD 0
-.Ip "\fB\-mreuse-arg-regs\fR" 4
+.IP "\fB\-mreuse\-arg\-regs\fR" 4
.IX Item "-mreuse-arg-regs"
.PD
-\&\fB\-mno-reuse-arg-regs\fR tells the compiler to only use incoming argument
+\&\fB\-mno\-reuse\-arg\-regs\fR tells the compiler to only use incoming argument
registers for copying out arguments. This helps detect calling a function
with fewer arguments than it was declared with.
-.Ip "\fB\-mno-impure-text\fR" 4
+.IP "\fB\-mno\-impure\-text\fR" 4
.IX Item "-mno-impure-text"
.PD 0
-.Ip "\fB\-mimpure-text\fR" 4
+.IP "\fB\-mimpure\-text\fR" 4
.IX Item "-mimpure-text"
.PD
-\&\fB\-mimpure-text\fR, used in addition to \fB\-shared\fR, tells the compiler to
+\&\fB\-mimpure\-text\fR, used in addition to \fB\-shared\fR, tells the compiler to
not pass \fB\-assert pure-text\fR to the linker when linking a shared object.
-.Ip "\fB\-msoft-float\fR" 4
+.IP "\fB\-msoft\-float\fR" 4
.IX Item "-msoft-float"
Generate output containing library calls for floating point.
\&\fBWarning:\fR the requisite libraries are not part of \s-1GCC\s0.
Normally the facilities of the machine's usual C compiler are used, but
-this can't be done directly in cross-compilation. You must make your
+this can't be done directly in cross\-compilation. You must make your
own arrangements to provide suitable library functions for
-cross-compilation.
-.Ip "\fB\-mno-multm\fR" 4
+cross\-compilation.
+.IP "\fB\-mno\-multm\fR" 4
.IX Item "-mno-multm"
Do not generate multm or multmu instructions. This is useful for some embedded
systems which do not have trap handlers for these instructions.
.PP
-.I "\s-1ARM\s0 Options"
+\fI\s-1ARM\s0 Options\fR
.IX Subsection "ARM Options"
.PP
These \fB\-m\fR options are defined for Advanced \s-1RISC\s0 Machines (\s-1ARM\s0)
architectures:
-.Ip "\fB\-mapcs-frame\fR" 4
+.IP "\fB\-mapcs\-frame\fR" 4
.IX Item "-mapcs-frame"
Generate a stack frame that is compliant with the \s-1ARM\s0 Procedure Call
Standard for all functions, even if this is not strictly necessary for
-correct execution of the code. Specifying \fB\-fomit-frame-pointer\fR
+correct execution of the code. Specifying \fB\-fomit\-frame\-pointer\fR
with this option will cause the stack frames not to be generated for
-leaf functions. The default is \fB\-mno-apcs-frame\fR.
-.Ip "\fB\-mapcs\fR" 4
+leaf functions. The default is \fB\-mno\-apcs\-frame\fR.
+.IP "\fB\-mapcs\fR" 4
.IX Item "-mapcs"
-This is a synonym for \fB\-mapcs-frame\fR.
-.Ip "\fB\-mapcs-26\fR" 4
+This is a synonym for \fB\-mapcs\-frame\fR.
+.IP "\fB\-mapcs\-26\fR" 4
.IX Item "-mapcs-26"
Generate code for a processor running with a 26\-bit program counter,
and conforming to the function calling standards for the \s-1APCS\s0 26\-bit
option. This option replaces the \fB\-m2\fR and \fB\-m3\fR options
of previous releases of the compiler.
-.Ip "\fB\-mapcs-32\fR" 4
+.IP "\fB\-mapcs\-32\fR" 4
.IX Item "-mapcs-32"
Generate code for a processor running with a 32\-bit program counter,
and conforming to the function calling standards for the \s-1APCS\s0 32\-bit
option. This option replaces the \fB\-m6\fR option of previous releases
of the compiler.
-.Ip "\fB\-mapcs-stack-check\fR" 4
-.IX Item "-mapcs-stack-check"
-Generate code to check the amount of stack space available upon entry to
-every function (that actually uses some stack space). If there is
-insufficient space available then either the function
-\&\fB_\|_rt_stkovf_split_small\fR or \fB_\|_rt_stkovf_split_big\fR will be
-called, depending upon the amount of stack space required. The run time
-system is required to provide these functions. The default is
-\&\fB\-mno-apcs-stack-check\fR, since this produces smaller code.
-.Ip "\fB\-mapcs-float\fR" 4
-.IX Item "-mapcs-float"
-Pass floating point arguments using the float point registers. This is
-one of the variants of the \s-1APCS\s0. This option is recommended if the
-target hardware has a floating point unit or if a lot of floating point
-arithmetic is going to be performed by the code. The default is
-\&\fB\-mno-apcs-float\fR, since integer only code is slightly increased in
-size if \fB\-mapcs-float\fR is used.
-.Ip "\fB\-mapcs-reentrant\fR" 4
-.IX Item "-mapcs-reentrant"
-Generate reentrant, position independent code. This is the equivalent
-to specifying the \fB\-fpic\fR option. The default is
-\&\fB\-mno-apcs-reentrant\fR.
-.Ip "\fB\-mthumb-interwork\fR" 4
+.IP "\fB\-mthumb\-interwork\fR" 4
.IX Item "-mthumb-interwork"
-Generate code which supports calling between the \s-1ARM\s0 and \s-1THUMB\s0
+Generate code which supports calling between the \s-1ARM\s0 and Thumb
instruction sets. Without this option the two instruction sets cannot
be reliably used inside one program. The default is
-\&\fB\-mno-thumb-interwork\fR, since slightly larger code is generated
-when \fB\-mthumb-interwork\fR is specified.
-.Ip "\fB\-mno-sched-prolog\fR" 4
+\&\fB\-mno\-thumb\-interwork\fR, since slightly larger code is generated
+when \fB\-mthumb\-interwork\fR is specified.
+.IP "\fB\-mno\-sched\-prolog\fR" 4
.IX Item "-mno-sched-prolog"
Prevent the reordering of instructions in the function prolog, or the
merging of those instruction with the instructions in the function's
@@ -4421,34 +4649,34 @@ body. This means that all functions will start with a recognizable set
of instructions (or in fact one of a choice from a small set of
different function prologues), and this information can be used to
locate the start if functions inside an executable piece of code. The
-default is \fB\-msched-prolog\fR.
-.Ip "\fB\-mhard-float\fR" 4
+default is \fB\-msched\-prolog\fR.
+.IP "\fB\-mhard\-float\fR" 4
.IX Item "-mhard-float"
Generate output containing floating point instructions. This is the
default.
-.Ip "\fB\-msoft-float\fR" 4
+.IP "\fB\-msoft\-float\fR" 4
.IX Item "-msoft-float"
Generate output containing library calls for floating point.
\&\fBWarning:\fR the requisite libraries are not available for all \s-1ARM\s0
targets. Normally the facilities of the machine's usual C compiler are
-used, but this cannot be done directly in cross-compilation. You must make
+used, but this cannot be done directly in cross\-compilation. You must make
your own arrangements to provide suitable library functions for
-cross-compilation.
+cross\-compilation.
.Sp
-\&\fB\-msoft-float\fR changes the calling convention in the output file;
+\&\fB\-msoft\-float\fR changes the calling convention in the output file;
therefore, it is only useful if you compile \fIall\fR of a program with
this option. In particular, you need to compile \fIlibgcc.a\fR, the
-library that comes with \s-1GCC\s0, with \fB\-msoft-float\fR in order for
+library that comes with \s-1GCC\s0, with \fB\-msoft\-float\fR in order for
this to work.
-.Ip "\fB\-mlittle-endian\fR" 4
+.IP "\fB\-mlittle\-endian\fR" 4
.IX Item "-mlittle-endian"
Generate code for a processor running in little-endian mode. This is
the default for all standard configurations.
-.Ip "\fB\-mbig-endian\fR" 4
+.IP "\fB\-mbig\-endian\fR" 4
.IX Item "-mbig-endian"
Generate code for a processor running in big-endian mode; the default is
to compile code for a little-endian processor.
-.Ip "\fB\-mwords-little-endian\fR" 4
+.IP "\fB\-mwords\-little\-endian\fR" 4
.IX Item "-mwords-little-endian"
This option only applies when generating code for big-endian processors.
Generate code for a little-endian word order but a big-endian byte
@@ -4456,7 +4684,7 @@ order. That is, a byte order of the form \fB32107654\fR. Note: this
option should only be used if you require compatibility with code for
big-endian \s-1ARM\s0 processors generated by versions of the compiler prior to
2.8.
-.Ip "\fB\-malignment-traps\fR" 4
+.IP "\fB\-malignment\-traps\fR" 4
.IX Item "-malignment-traps"
Generate code that will not trap if the \s-1MMU\s0 has alignment traps enabled.
On \s-1ARM\s0 architectures prior to ARMv4, there were no instructions to
@@ -4471,86 +4699,94 @@ address is aligned to a word boundary.
.Sp
This option is ignored when compiling for \s-1ARM\s0 architecture 4 or later,
since these processors have instructions to directly access half-word
-objects in memory.
-.Ip "\fB\-mno-alignment-traps\fR" 4
+objects in memory.
+.IP "\fB\-mno\-alignment\-traps\fR" 4
.IX Item "-mno-alignment-traps"
Generate code that assumes that the \s-1MMU\s0 will not trap unaligned
accesses. This produces better code when the target instruction set
-does not have half-word memory operations (implementations prior to
-ARMv4).
+does not have half-word memory operations (i.e. implementations prior to
+ARMv4).
.Sp
Note that you cannot use this option to access unaligned word objects,
since the processor will only fetch one 32\-bit aligned object from
-memory.
+memory.
.Sp
-The default setting for most targets is \-mno-alignment-traps, since
+The default setting for most targets is \fB\-mno\-alignment\-traps\fR, since
this produces better code when there are no half-word memory
-instructions available.
-.Ip "\fB\-mshort-load-bytes\fR" 4
+instructions available.
+.IP "\fB\-mshort\-load\-bytes\fR" 4
.IX Item "-mshort-load-bytes"
-This is a deprecated alias for \fB\-malignment-traps\fR.
-.Ip "\fB\-mno-short-load-bytes\fR" 4
+.PD 0
+.IP "\fB\-mno\-short\-load\-words\fR" 4
+.IX Item "-mno-short-load-words"
+.PD
+These are deprecated aliases for \fB\-malignment\-traps\fR.
+.IP "\fB\-mno\-short\-load\-bytes\fR" 4
.IX Item "-mno-short-load-bytes"
-This is a deprecated alias for \fB\-mno-alignment-traps\fR.
-.Ip "\fB\-mshort-load-words\fR" 4
+.PD 0
+.IP "\fB\-mshort\-load\-words\fR" 4
.IX Item "-mshort-load-words"
-This is a deprecated alias for \fB\-mno-alignment-traps\fR.
-.Ip "\fB\-mno-short-load-words\fR" 4
-.IX Item "-mno-short-load-words"
-This is a deprecated alias for \fB\-malignment-traps\fR.
-.Ip "\fB\-mbsd\fR" 4
+.PD
+This are deprecated aliases for \fB\-mno\-alignment\-traps\fR.
+.IP "\fB\-mbsd\fR" 4
.IX Item "-mbsd"
This option only applies to \s-1RISC\s0 iX. Emulate the native BSD-mode
compiler. This is the default if \fB\-ansi\fR is not specified.
-.Ip "\fB\-mxopen\fR" 4
+.IP "\fB\-mxopen\fR" 4
.IX Item "-mxopen"
-This option only applies to \s-1RISC\s0 iX. Emulate the native X/Open-mode
+This option only applies to \s-1RISC\s0 iX. Emulate the native X/Open\-mode
compiler.
-.Ip "\fB\-mno-symrename\fR" 4
+.IP "\fB\-mno\-symrename\fR" 4
.IX Item "-mno-symrename"
This option only applies to \s-1RISC\s0 iX. Do not run the assembler
-post-processor, \fBsymrename\fR, after code has been assembled.
+post\-processor, \fBsymrename\fR, after code has been assembled.
Normally it is necessary to modify some of the standard symbols in
preparation for linking with the \s-1RISC\s0 iX C library; this option
suppresses this pass. The post-processor is never run when the
-compiler is built for cross-compilation.
-.Ip "\fB\-mcpu=<name>\fR" 4
-.IX Item "-mcpu=<name>"
+compiler is built for cross\-compilation.
+.IP "\fB\-mcpu=\fR\fIname\fR" 4
+.IX Item "-mcpu=name"
This specifies the name of the target \s-1ARM\s0 processor. \s-1GCC\s0 uses this name
-to determine what kind of instructions it can use when generating
-assembly code. Permissible names are: arm2, arm250, arm3, arm6, arm60,
-arm600, arm610, arm620, arm7, arm7m, arm7d, arm7dm, arm7di, arm7dmi,
-arm70, arm700, arm700i, arm710, arm710c, arm7100, arm7500, arm7500fe,
-arm7tdmi, arm8, strongarm, strongarm110, strongarm1100, arm8, arm810,
-arm9, arm920, arm920t, arm9tdmi.
-.Ip "\fB\-mtune=<name>\fR" 4
-.IX Item "-mtune=<name>"
+to determine what kind of instructions it can emit when generating
+assembly code. Permissible names are: \fBarm2\fR, \fBarm250\fR,
+\&\fBarm3\fR, \fBarm6\fR, \fBarm60\fR, \fBarm600\fR, \fBarm610\fR,
+\&\fBarm620\fR, \fBarm7\fR, \fBarm7m\fR, \fBarm7d\fR, \fBarm7dm\fR,
+\&\fBarm7di\fR, \fBarm7dmi\fR, \fBarm70\fR, \fBarm700\fR,
+\&\fBarm700i\fR, \fBarm710\fR, \fBarm710c\fR, \fBarm7100\fR,
+\&\fBarm7500\fR, \fBarm7500fe\fR, \fBarm7tdmi\fR, \fBarm8\fR,
+\&\fBstrongarm\fR, \fBstrongarm110\fR, \fBstrongarm1100\fR,
+\&\fBarm8\fR, \fBarm810\fR, \fBarm9\fR, \fBarm9e\fR, \fBarm920\fR,
+\&\fBarm920t\fR, \fBarm940t\fR, \fBarm9tdmi\fR, \fBarm10tdmi\fR,
+\&\fBarm1020t\fR, \fBxscale\fR.
+.IP "\fB\-mtune=\fR\fIname\fR" 4
+.IX Item "-mtune=name"
This option is very similar to the \fB\-mcpu=\fR option, except that
instead of specifying the actual target processor type, and hence
restricting which instructions can be used, it specifies that \s-1GCC\s0 should
tune the performance of the code as if the target were of the type
specified in this option, but still choosing the instructions that it
will generate based on the cpu specified by a \fB\-mcpu=\fR option.
-For some arm implementations better performance can be obtained by using
+For some \s-1ARM\s0 implementations better performance can be obtained by using
this option.
-.Ip "\fB\-march=<name>\fR" 4
-.IX Item "-march=<name>"
+.IP "\fB\-march=\fR\fIname\fR" 4
+.IX Item "-march=name"
This specifies the name of the target \s-1ARM\s0 architecture. \s-1GCC\s0 uses this
-name to determine what kind of instructions it can use when generating
+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 \fB\-mcpu=\fR option. Permissible names are: armv2, armv2a,
-armv3, armv3m, armv4, armv4t, armv5.
-.Ip "\fB\-mfpe=<number>\fR" 4
-.IX Item "-mfpe=<number>"
+of the \fB\-mcpu=\fR option. Permissible names are: \fBarmv2\fR,
+\&\fBarmv2a\fR, \fBarmv3\fR, \fBarmv3m\fR, \fBarmv4\fR, \fBarmv4t\fR,
+\&\fBarmv5\fR, \fBarmv5t\fR, \fBarmv5te\fR.
+.IP "\fB\-mfpe=\fR\fInumber\fR" 4
+.IX Item "-mfpe=number"
.PD 0
-.Ip "\fB\-mfp=<number>\fR" 4
-.IX Item "-mfp=<number>"
+.IP "\fB\-mfp=\fR\fInumber\fR" 4
+.IX Item "-mfp=number"
.PD
This specifies the version of the floating point emulation available on
the target. Permissible values are 2 and 3. \fB\-mfp=\fR is a synonym
-for \fB\-mfpe=\fR to support older versions of \s-1GCC\s0.
-.Ip "\fB\-mstructure-size-boundary=<n>\fR" 4
-.IX Item "-mstructure-size-boundary=<n>"
+for \fB\-mfpe=\fR, for compatibility with older versions of \s-1GCC\s0.
+.IP "\fB\-mstructure\-size\-boundary=\fR\fIn\fR" 4
+.IX Item "-mstructure-size-boundary=n"
The size of all structures and unions will be rounded up to a multiple
of the number of bits set by this option. Permissible values are 8 and
32. The default value varies for different toolchains. For the \s-1COFF\s0
@@ -4559,23 +4795,23 @@ can produce faster, more efficient code, but can also increase the size
of the program. The two values are potentially incompatible. Code
compiled with one value cannot necessarily expect to work with code or
libraries compiled with the other value, if they exchange information
-using structures or unions. Programmers are encouraged to use the 32
-value as future versions of the toolchain may default to this value.
-.Ip "\fB\-mabort-on-noreturn\fR" 4
+using structures or unions.
+.IP "\fB\-mabort\-on\-noreturn\fR" 4
.IX Item "-mabort-on-noreturn"
-Generate a call to the function abort at the end of a noreturn function.
-It will be executed if the function tries to return.
-.Ip "\fB\-mlong-calls\fR" 4
+Generate a call to the function \f(CW\*(C`abort\*(C'\fR at the end of a
+\&\f(CW\*(C`noreturn\*(C'\fR function. It will be executed if the function tries to
+return.
+.IP "\fB\-mlong\-calls\fR" 4
.IX Item "-mlong-calls"
.PD 0
-.Ip "\fB\-mno-long-calls\fR" 4
+.IP "\fB\-mno\-long\-calls\fR" 4
.IX Item "-mno-long-calls"
.PD
Tells the compiler to perform function calls by first loading the
address of the function into a register and then performing a subroutine
call on this register. This switch is needed if the target function
will lie outside of the 64 megabyte addressing range of the offset based
-version of subroutine call instruction.
+version of subroutine call instruction.
.Sp
Even if this switch is enabled, not all function calls will be turned
into long calls. The heuristic is that static functions, functions
@@ -4589,132 +4825,120 @@ the scope of a \fB#pragma long_calls\fR directive, will always be
turned into long calls.
.Sp
This feature is not enabled by default. Specifying
-\&\fB\*(--no-long-calls\fR will restore the default behaviour, as will
+\&\fB\-mno\-long\-calls\fR will restore the default behaviour, as will
placing the function calls within the scope of a \fB#pragma
long_calls_off\fR directive. Note these switches have no effect on how
the compiler generates code to handle function calls via function
-pointers.
-.Ip "\fB\-mnop-fun-dllimport\fR" 4
+pointers.
+.IP "\fB\-mnop\-fun\-dllimport\fR" 4
.IX Item "-mnop-fun-dllimport"
-Disable the support for the \fIdllimport\fR attribute.
-.Ip "\fB\-msingle-pic-base\fR" 4
+Disable support for the \f(CW\*(C`dllimport\*(C'\fR attribute.
+.IP "\fB\-msingle\-pic\-base\fR" 4
.IX Item "-msingle-pic-base"
-Treat the register used for \s-1PIC\s0 addressing as read-only, rather than
+Treat the register used for \s-1PIC\s0 addressing as read\-only, rather than
loading it in the prologue for each function. The run-time system is
responsible for initialising this register with an appropriate value
before execution begins.
-.Ip "\fB\-mpic-register=<reg>\fR" 4
-.IX Item "-mpic-register=<reg>"
+.IP "\fB\-mpic\-register=\fR\fIreg\fR" 4
+.IX Item "-mpic-register=reg"
Specify the register to be used for \s-1PIC\s0 addressing. The default is R10
unless stack-checking is enabled, when R9 is used.
-.PP
-.I "Thumb Options"
-.IX Subsection "Thumb Options"
-.Ip "\fB\-mthumb-interwork\fR" 4
-.IX Item "-mthumb-interwork"
-Generate code which supports calling between the \s-1THUMB\s0 and \s-1ARM\s0
-instruction sets. Without this option the two instruction sets cannot
-be reliably used inside one program. The default is
-\&\fB\-mno-thumb-interwork\fR, since slightly smaller code is generated
-with this option.
-.Ip "\fB\-mtpcs-frame\fR" 4
+.IP "\fB\-mpoke\-function\-name\fR" 4
+.IX Item "-mpoke-function-name"
+Write the name of each function into the text section, directly
+preceding the function prologue. The generated code is similar to this:
+.Sp
+.Vb 9
+\& t0
+\& .ascii "arm_poke_function_name", 0
+\& .align
+\& t1
+\& .word 0xff000000 + (t1 - t0)
+\& arm_poke_function_name
+\& mov ip, sp
+\& stmfd sp!, {fp, ip, lr, pc}
+\& sub fp, ip, #4
+.Ve
+.Sp
+When performing a stack backtrace, code can inspect the value of
+\&\f(CW\*(C`pc\*(C'\fR stored at \f(CW\*(C`fp + 0\*(C'\fR. If the trace function then looks at
+location \f(CW\*(C`pc \- 12\*(C'\fR and the top 8 bits are set, then we know that
+there is a function name embedded immediately preceding this location
+and has length \f(CW\*(C`((pc[\-3]) & 0xff000000)\*(C'\fR.
+.IP "\fB\-mthumb\fR" 4
+.IX Item "-mthumb"
+Generate code for the 16\-bit Thumb instruction set. The default is to
+use the 32\-bit \s-1ARM\s0 instruction set.
+.IP "\fB\-mtpcs\-frame\fR" 4
.IX Item "-mtpcs-frame"
Generate a stack frame that is compliant with the Thumb Procedure Call
Standard for all non-leaf functions. (A leaf function is one that does
-not call any other functions). The default is \fB\-mno-apcs-frame\fR.
-.Ip "\fB\-mtpcs-leaf-frame\fR" 4
+not call any other functions.) The default is \fB\-mno\-tpcs\-frame\fR.
+.IP "\fB\-mtpcs\-leaf\-frame\fR" 4
.IX Item "-mtpcs-leaf-frame"
Generate a stack frame that is compliant with the Thumb Procedure Call
Standard for all leaf functions. (A leaf function is one that does
-not call any other functions). The default is \fB\-mno-apcs-leaf-frame\fR.
-.Ip "\fB\-mlittle-endian\fR" 4
-.IX Item "-mlittle-endian"
-Generate code for a processor running in little-endian mode. This is
-the default for all standard configurations.
-.Ip "\fB\-mbig-endian\fR" 4
-.IX Item "-mbig-endian"
-Generate code for a processor running in big-endian mode.
-.Ip "\fB\-mstructure-size-boundary=<n>\fR" 4
-.IX Item "-mstructure-size-boundary=<n>"
-The size of all structures and unions will be rounded up to a multiple
-of the number of bits set by this option. Permissible values are 8 and
-32. The default value varies for different toolchains. For the \s-1COFF\s0
-targeted toolchain the default value is 8. Specifying the larger number
-can produced faster, more efficient code, but can also increase the size
-of the program. The two values are potentially incompatible. Code
-compiled with one value cannot necessarily expect to work with code or
-libraries compiled with the other value, if they exchange information
-using structures or unions. Programmers are encouraged to use the 32
-value as future versions of the toolchain may default to this value.
-.Ip "\fB\-mnop-fun-dllimport\fR" 4
-.IX Item "-mnop-fun-dllimport"
-Disable the support for the \fIdllimport\fR attribute.
-.Ip "\fB\-mcallee-super-interworking\fR" 4
+not call any other functions.) The default is \fB\-mno\-apcs\-leaf\-frame\fR.
+.IP "\fB\-mcallee\-super\-interworking\fR" 4
.IX Item "-mcallee-super-interworking"
Gives all externally visible functions in the file being compiled an \s-1ARM\s0
instruction set header which switches to Thumb mode before executing the
rest of the function. This allows these functions to be called from
non-interworking code.
-.Ip "\fB\-mcaller-super-interworking\fR" 4
+.IP "\fB\-mcaller\-super\-interworking\fR" 4
.IX Item "-mcaller-super-interworking"
Allows calls via function pointers (including virtual functions) to
execute correctly regardless of whether the target code has been
compiled for interworking or not. There is a small overhead in the cost
of executing a function pointer if this option is enabled.
-.Ip "\fB\-msingle-pic-base\fR" 4
-.IX Item "-msingle-pic-base"
-Treat the register used for \s-1PIC\s0 addressing as read-only, rather than
-loading it in the prologue for each function. The run-time system is
-responsible for initialising this register with an appropriate value
-before execution begins.
-.Ip "\fB\-mpic-register=<reg>\fR" 4
-.IX Item "-mpic-register=<reg>"
-Specify the register to be used for \s-1PIC\s0 addressing. The default is R10.
.PP
-.I "\s-1MN10200\s0 Options"
+\fI\s-1MN10200\s0 Options\fR
.IX Subsection "MN10200 Options"
.PP
These \fB\-m\fR options are defined for Matsushita \s-1MN10200\s0 architectures:
-.Ip "\fB\-mrelax\fR" 4
+.IP "\fB\-mrelax\fR" 4
.IX Item "-mrelax"
Indicate to the linker that it should perform a relaxation optimization pass
to shorten branches, calls and absolute memory addresses. This option only
has an effect when used on the command line for the final link step.
.Sp
-This option makes symbolic debugging impossible.
+This option makes symbolic debugging impossible.
.PP
-.I "\s-1MN10300\s0 Options"
+\fI\s-1MN10300\s0 Options\fR
.IX Subsection "MN10300 Options"
.PP
These \fB\-m\fR options are defined for Matsushita \s-1MN10300\s0 architectures:
-.Ip "\fB\-mmult-bug\fR" 4
+.IP "\fB\-mmult\-bug\fR" 4
.IX Item "-mmult-bug"
Generate code to avoid bugs in the multiply instructions for the \s-1MN10300\s0
processors. This is the default.
-.Ip "\fB\-mno-mult-bug\fR" 4
+.IP "\fB\-mno\-mult\-bug\fR" 4
.IX Item "-mno-mult-bug"
Do not generate code to avoid bugs in the multiply instructions for the
\&\s-1MN10300\s0 processors.
-.Ip "\fB\-mam33\fR" 4
+.IP "\fB\-mam33\fR" 4
.IX Item "-mam33"
Generate code which uses features specific to the \s-1AM33\s0 processor.
-.Ip "\fB\-mno-am33\fR" 4
+.IP "\fB\-mno\-am33\fR" 4
.IX Item "-mno-am33"
Do not generate code which uses features specific to the \s-1AM33\s0 processor. This
is the default.
-.Ip "\fB\-mrelax\fR" 4
+.IP "\fB\-mno\-crt0\fR" 4
+.IX Item "-mno-crt0"
+Do not link in the C run-time initialization object file.
+.IP "\fB\-mrelax\fR" 4
.IX Item "-mrelax"
Indicate to the linker that it should perform a relaxation optimization pass
to shorten branches, calls and absolute memory addresses. This option only
has an effect when used on the command line for the final link step.
.Sp
-This option makes symbolic debugging impossible.
+This option makes symbolic debugging impossible.
.PP
-.I "M32R/D Options"
+\fIM32R/D Options\fR
.IX Subsection "M32R/D Options"
.PP
These \fB\-m\fR options are defined for Mitsubishi M32R/D architectures:
-.Ip "\fB\-mcode-model=small\fR" 4
+.IP "\fB\-mcode\-model=small\fR" 4
.IX Item "-mcode-model=small"
Assume all objects live in the lower 16MB of memory (so that their addresses
can be loaded with the \f(CW\*(C`ld24\*(C'\fR instruction), and assume all subroutines
@@ -4723,19 +4947,19 @@ This is the default.
.Sp
The addressability of a particular object can be set with the
\&\f(CW\*(C`model\*(C'\fR attribute.
-.Ip "\fB\-mcode-model=medium\fR" 4
+.IP "\fB\-mcode\-model=medium\fR" 4
.IX Item "-mcode-model=medium"
-Assume objects may be anywhere in the 32 bit address space (the compiler
+Assume objects may be anywhere in the 32\-bit address space (the compiler
will generate \f(CW\*(C`seth/add3\*(C'\fR instructions to load their addresses), and
assume all subroutines are reachable with the \f(CW\*(C`bl\*(C'\fR instruction.
-.Ip "\fB\-mcode-model=large\fR" 4
+.IP "\fB\-mcode\-model=large\fR" 4
.IX Item "-mcode-model=large"
-Assume objects may be anywhere in the 32 bit address space (the compiler
+Assume objects may be anywhere in the 32\-bit address space (the compiler
will generate \f(CW\*(C`seth/add3\*(C'\fR instructions to load their addresses), and
assume subroutines may not be reachable with the \f(CW\*(C`bl\*(C'\fR instruction
(the compiler will generate the much slower \f(CW\*(C`seth/add3/jl\*(C'\fR
instruction sequence).
-.Ip "\fB\-msdata=none\fR" 4
+.IP "\fB\-msdata=none\fR" 4
.IX Item "-msdata=none"
Disable use of the small data area. Variables will be put into
one of \fB.data\fR, \fBbss\fR, or \fB.rodata\fR (unless the
@@ -4745,15 +4969,15 @@ This is the default.
The small data area consists of sections \fB.sdata\fR and \fB.sbss\fR.
Objects may be explicitly put in the small data area with the
\&\f(CW\*(C`section\*(C'\fR attribute using one of these sections.
-.Ip "\fB\-msdata=sdata\fR" 4
+.IP "\fB\-msdata=sdata\fR" 4
.IX Item "-msdata=sdata"
Put small global and static data in the small data area, but do not
generate special code to reference them.
-.Ip "\fB\-msdata=use\fR" 4
+.IP "\fB\-msdata=use\fR" 4
.IX Item "-msdata=use"
Put small global and static data in the small data area, and generate
special instructions to reference them.
-.Ip "\fB\-G\fR \fInum\fR" 4
+.IP "\fB\-G\fR \fInum\fR" 4
.IX Item "-G num"
Put global and static objects less than or equal to \fInum\fR bytes
into the small data or bss sections instead of the normal data or bss
@@ -4763,43 +4987,43 @@ for this option to have any effect.
.Sp
All modules should be compiled with the same \fB\-G\fR \fInum\fR value.
Compiling with different values of \fInum\fR may or may not work; if it
-doesn't the linker will give an error message \- incorrect code will not be
+doesn't the linker will give an error message\-\-\-incorrect code will not be
generated.
.PP
-.I "M88K Options"
+\fIM88K Options\fR
.IX Subsection "M88K Options"
.PP
These \fB\-m\fR options are defined for Motorola 88k architectures:
-.Ip "\fB\-m88000\fR" 4
+.IP "\fB\-m88000\fR" 4
.IX Item "-m88000"
Generate code that works well on both the m88100 and the
m88110.
-.Ip "\fB\-m88100\fR" 4
+.IP "\fB\-m88100\fR" 4
.IX Item "-m88100"
Generate code that works best for the m88100, but that also
runs on the m88110.
-.Ip "\fB\-m88110\fR" 4
+.IP "\fB\-m88110\fR" 4
.IX Item "-m88110"
Generate code that works best for the m88110, and may not run
on the m88100.
-.Ip "\fB\-mbig-pic\fR" 4
+.IP "\fB\-mbig\-pic\fR" 4
.IX Item "-mbig-pic"
Obsolete option to be removed from the next revision.
Use \fB\-fPIC\fR.
-.Ip "\fB\-midentify-revision\fR" 4
+.IP "\fB\-midentify\-revision\fR" 4
.IX Item "-midentify-revision"
Include an \f(CW\*(C`ident\*(C'\fR directive in the assembler output recording the
source file name, compiler name and version, timestamp, and compilation
flags used.
-.Ip "\fB\-mno-underscores\fR" 4
+.IP "\fB\-mno\-underscores\fR" 4
.IX Item "-mno-underscores"
In assembler output, emit symbol names without adding an underscore
character at the beginning of each name. The default is to use an
underscore as prefix on each name.
-.Ip "\fB\-mocs-debug-info\fR" 4
+.IP "\fB\-mocs\-debug\-info\fR" 4
.IX Item "-mocs-debug-info"
.PD 0
-.Ip "\fB\-mno-ocs-debug-info\fR" 4
+.IP "\fB\-mno\-ocs\-debug\-info\fR" 4
.IX Item "-mno-ocs-debug-info"
.PD
Include (or omit) additional debugging information (about registers used
@@ -4808,46 +5032,46 @@ Standard, ``\s-1OCS\s0''. This extra information allows debugging of code that
has had the frame pointer eliminated. The default for \s-1DG/UX\s0, SVr4, and
Delta 88 SVr3.2 is to include this information; other 88k configurations
omit this information by default.
-.Ip "\fB\-mocs-frame-position\fR" 4
+.IP "\fB\-mocs\-frame\-position\fR" 4
.IX Item "-mocs-frame-position"
When emitting \s-1COFF\s0 debugging information for automatic variables and
parameters stored on the stack, use the offset from the canonical frame
address, which is the stack pointer (register 31) on entry to the
function. The \s-1DG/UX\s0, SVr4, Delta88 SVr3.2, and \s-1BCS\s0 configurations use
-\&\fB\-mocs-frame-position\fR; other 88k configurations have the default
-\&\fB\-mno-ocs-frame-position\fR.
-.Ip "\fB\-mno-ocs-frame-position\fR" 4
+\&\fB\-mocs\-frame\-position\fR; other 88k configurations have the default
+\&\fB\-mno\-ocs\-frame\-position\fR.
+.IP "\fB\-mno\-ocs\-frame\-position\fR" 4
.IX Item "-mno-ocs-frame-position"
When emitting \s-1COFF\s0 debugging information for automatic variables and
parameters stored on the stack, use the offset from the frame pointer
register (register 30). When this option is in effect, the frame
pointer is not eliminated when debugging information is selected by the
\&\-g switch.
-.Ip "\fB\-moptimize-arg-area\fR" 4
+.IP "\fB\-moptimize\-arg\-area\fR" 4
.IX Item "-moptimize-arg-area"
.PD 0
-.Ip "\fB\-mno-optimize-arg-area\fR" 4
+.IP "\fB\-mno\-optimize\-arg\-area\fR" 4
.IX Item "-mno-optimize-arg-area"
.PD
Control how function arguments are stored in stack frames.
-\&\fB\-moptimize-arg-area\fR saves space by optimizing them, but this
+\&\fB\-moptimize\-arg\-area\fR saves space by optimizing them, but this
conflicts with the 88open specifications. The opposite alternative,
-\&\fB\-mno-optimize-arg-area\fR, agrees with 88open standards. By default
+\&\fB\-mno\-optimize\-arg\-area\fR, agrees with 88open standards. By default
\&\s-1GCC\s0 does not optimize the argument area.
-.Ip "\fB\-mshort-data-\fR\fInum\fR" 4
+.IP "\fB\-mshort\-data\-\fR\fInum\fR" 4
.IX Item "-mshort-data-num"
Generate smaller data references by making them relative to \f(CW\*(C`r0\*(C'\fR,
which allows loading a value using a single instruction (rather than the
usual two). You control which data references are affected by
specifying \fInum\fR with this option. For example, if you specify
-\&\fB\-mshort-data-512\fR, then the data references affected are those
+\&\fB\-mshort\-data\-512\fR, then the data references affected are those
involving displacements of less than 512 bytes.
-\&\fB\-mshort-data-\fR\fInum\fR is not effective for \fInum\fR greater
+\&\fB\-mshort\-data\-\fR\fInum\fR is not effective for \fInum\fR greater
than 64k.
-.Ip "\fB\-mserialize-volatile\fR" 4
+.IP "\fB\-mserialize\-volatile\fR" 4
.IX Item "-mserialize-volatile"
.PD 0
-.Ip "\fB\-mno-serialize-volatile\fR" 4
+.IP "\fB\-mno\-serialize\-volatile\fR" 4
.IX Item "-mno-serialize-volatile"
.PD
Do, or don't, generate code to guarantee sequential consistency
@@ -4860,50 +5084,50 @@ references. In particular, a load instruction may execute before
a preceding store instruction. Such reordering violates
sequential consistency of volatile memory references, when there
are multiple processors. When consistency must be guaranteed,
-\&\s-1GNU\s0 C generates special instructions, as needed, to force
+\&\s-1GCC\s0 generates special instructions, as needed, to force
execution in the proper order.
.Sp
The \s-1MC88100\s0 processor does not reorder memory references and so
-always provides sequential consistency. However, by default, \s-1GNU\s0
-C generates the special instructions to guarantee consistency
+always provides sequential consistency. However, by default, \s-1GCC\s0
+generates the special instructions to guarantee consistency
even when you use \fB\-m88100\fR, so that the code may be run on an
\&\s-1MC88110\s0 processor. If you intend to run your code only on the
-\&\s-1MC88100\s0 processor, you may use \fB\-mno-serialize-volatile\fR.
+\&\s-1MC88100\s0 processor, you may use \fB\-mno\-serialize\-volatile\fR.
.Sp
The extra code generated to guarantee consistency may affect the
performance of your application. If you know that you can safely
-forgo this guarantee, you may use \fB\-mno-serialize-volatile\fR.
-.Ip "\fB\-msvr4\fR" 4
+forgo this guarantee, you may use \fB\-mno\-serialize\-volatile\fR.
+.IP "\fB\-msvr4\fR" 4
.IX Item "-msvr4"
.PD 0
-.Ip "\fB\-msvr3\fR" 4
+.IP "\fB\-msvr3\fR" 4
.IX Item "-msvr3"
.PD
Turn on (\fB\-msvr4\fR) or off (\fB\-msvr3\fR) compiler extensions
related to System V release 4 (SVr4). This controls the following:
.RS 4
-.Ip "1." 4
+.IP "1." 4
Which variant of the assembler syntax to emit.
-.Ip "2." 4
+.IP "2." 4
\&\fB\-msvr4\fR makes the C preprocessor recognize \fB#pragma weak\fR
that is used on System V release 4.
-.Ip "3." 4
+.IP "3." 4
\&\fB\-msvr4\fR makes \s-1GCC\s0 issue additional declaration directives used in
SVr4.
.RE
.RS 4
.Sp
-\&\fB\-msvr4\fR is the default for the m88k-motorola-sysv4 and
-m88k-dg-dgux m88k configurations. \fB\-msvr3\fR is the default for all
+\&\fB\-msvr4\fR is the default for the m88k\-motorola\-sysv4 and
+m88k\-dg\-dgux m88k configurations. \fB\-msvr3\fR is the default for all
other m88k configurations.
.RE
-.Ip "\fB\-mversion-03.00\fR" 4
+.IP "\fB\-mversion\-03.00\fR" 4
.IX Item "-mversion-03.00"
This option is obsolete, and is ignored.
-.Ip "\fB\-mno-check-zero-division\fR" 4
+.IP "\fB\-mno\-check\-zero\-division\fR" 4
.IX Item "-mno-check-zero-division"
.PD 0
-.Ip "\fB\-mcheck-zero-division\fR" 4
+.IP "\fB\-mcheck\-zero\-division\fR" 4
.IX Item "-mcheck-zero-division"
.PD
Do, or don't, generate code to guarantee that integer division by
@@ -4911,18 +5135,18 @@ zero will be detected. By default, detection is guaranteed.
.Sp
Some models of the \s-1MC88100\s0 processor fail to trap upon integer
division by zero under certain conditions. By default, when
-compiling code that might be run on such a processor, \s-1GNU\s0 C
+compiling code that might be run on such a processor, \s-1GCC\s0
generates code that explicitly checks for zero-valued divisors
and traps with exception number 503 when one is detected. Use of
mno-check-zero-division suppresses such checking for code
generated to run on an \s-1MC88100\s0 processor.
.Sp
-\&\s-1GNU\s0 C assumes that the \s-1MC88110\s0 processor correctly detects all
+\&\s-1GCC\s0 assumes that the \s-1MC88110\s0 processor correctly detects all
instances of integer division by zero. When \fB\-m88110\fR is
-specified, both \fB\-mcheck-zero-division\fR and
-\&\fB\-mno-check-zero-division\fR are ignored, and no explicit checks for
+specified, both \fB\-mcheck\-zero\-division\fR and
+\&\fB\-mno\-check\-zero\-division\fR are ignored, and no explicit checks for
zero-valued divisors are generated.
-.Ip "\fB\-muse-div-instruction\fR" 4
+.IP "\fB\-muse\-div\-instruction\fR" 4
.IX Item "-muse-div-instruction"
Use the div instruction for signed integer division on the
\&\s-1MC88100\s0 processor. By default, the div instruction is not used.
@@ -4931,7 +5155,7 @@ On the \s-1MC88100\s0 processor the signed integer division instruction
div) traps to the operating system on a negative operand. The
operating system transparently completes the operation, but at a
large cost in execution time. By default, when compiling code
-that might be run on an \s-1MC88100\s0 processor, \s-1GNU\s0 C emulates signed
+that might be run on an \s-1MC88100\s0 processor, \s-1GCC\s0 emulates signed
integer division using the unsigned integer division instruction
divu), thereby avoiding the large penalty of a trap to the
operating system. Such emulation has its own, smaller, execution
@@ -4943,56 +5167,56 @@ instruction directly.
On the \s-1MC88110\s0 processor the div instruction (also known as the
divs instruction) processes negative operands without trapping to
the operating system. When \fB\-m88110\fR is specified,
-\&\fB\-muse-div-instruction\fR is ignored, and the div instruction is used
+\&\fB\-muse\-div\-instruction\fR is ignored, and the div instruction is used
for signed integer division.
.Sp
-Note that the result of dividing \s-1INT_MIN\s0 by \-1 is undefined. In
+Note that the result of dividing \f(CW\*(C`INT_MIN\*(C'\fR by \-1 is undefined. In
particular, the behavior of such a division with and without
-\&\fB\-muse-div-instruction\fR may differ.
-.Ip "\fB\-mtrap-large-shift\fR" 4
+\&\fB\-muse\-div\-instruction\fR may differ.
+.IP "\fB\-mtrap\-large\-shift\fR" 4
.IX Item "-mtrap-large-shift"
.PD 0
-.Ip "\fB\-mhandle-large-shift\fR" 4
+.IP "\fB\-mhandle\-large\-shift\fR" 4
.IX Item "-mhandle-large-shift"
.PD
Include code to detect bit-shifts of more than 31 bits; respectively,
trap such shifts or emit code to handle them properly. By default \s-1GCC\s0
makes no special provision for large bit shifts.
-.Ip "\fB\-mwarn-passed-structs\fR" 4
+.IP "\fB\-mwarn\-passed\-structs\fR" 4
.IX Item "-mwarn-passed-structs"
Warn when a function passes a struct as an argument or result.
Structure-passing conventions have changed during the evolution of the C
language, and are often the source of portability problems. By default,
\&\s-1GCC\s0 issues no such warning.
.PP
-.I "\s-1IBM\s0 \s-1RS/6000\s0 and PowerPC Options"
+\fI\s-1IBM\s0 \s-1RS/6000\s0 and PowerPC Options\fR
.IX Subsection "IBM RS/6000 and PowerPC Options"
.PP
These \fB\-m\fR options are defined for the \s-1IBM\s0 \s-1RS/6000\s0 and PowerPC:
-.Ip "\fB\-mpower\fR" 4
+.IP "\fB\-mpower\fR" 4
.IX Item "-mpower"
.PD 0
-.Ip "\fB\-mno-power\fR" 4
+.IP "\fB\-mno\-power\fR" 4
.IX Item "-mno-power"
-.Ip "\fB\-mpower2\fR" 4
+.IP "\fB\-mpower2\fR" 4
.IX Item "-mpower2"
-.Ip "\fB\-mno-power2\fR" 4
+.IP "\fB\-mno\-power2\fR" 4
.IX Item "-mno-power2"
-.Ip "\fB\-mpowerpc\fR" 4
+.IP "\fB\-mpowerpc\fR" 4
.IX Item "-mpowerpc"
-.Ip "\fB\-mno-powerpc\fR" 4
+.IP "\fB\-mno\-powerpc\fR" 4
.IX Item "-mno-powerpc"
-.Ip "\fB\-mpowerpc-gpopt\fR" 4
+.IP "\fB\-mpowerpc\-gpopt\fR" 4
.IX Item "-mpowerpc-gpopt"
-.Ip "\fB\-mno-powerpc-gpopt\fR" 4
+.IP "\fB\-mno\-powerpc\-gpopt\fR" 4
.IX Item "-mno-powerpc-gpopt"
-.Ip "\fB\-mpowerpc-gfxopt\fR" 4
+.IP "\fB\-mpowerpc\-gfxopt\fR" 4
.IX Item "-mpowerpc-gfxopt"
-.Ip "\fB\-mno-powerpc-gfxopt\fR" 4
+.IP "\fB\-mno\-powerpc\-gfxopt\fR" 4
.IX Item "-mno-powerpc-gfxopt"
-.Ip "\fB\-mpowerpc64\fR" 4
+.IP "\fB\-mpowerpc64\fR" 4
.IX Item "-mpowerpc64"
-.Ip "\fB\-mno-powerpc64\fR" 4
+.IP "\fB\-mno\-powerpc64\fR" 4
.IX Item "-mno-powerpc64"
.PD
\&\s-1GCC\s0 supports two related instruction set architectures for the
@@ -5021,33 +5245,33 @@ not the original \s-1POWER\s0 architecture.
.Sp
The \fB\-mpowerpc\fR option allows \s-1GCC\s0 to generate instructions that
are found only in the 32\-bit subset of the PowerPC architecture.
-Specifying \fB\-mpowerpc-gpopt\fR implies \fB\-mpowerpc\fR and also allows
+Specifying \fB\-mpowerpc\-gpopt\fR implies \fB\-mpowerpc\fR and also allows
\&\s-1GCC\s0 to use the optional PowerPC architecture instructions in the
General Purpose group, including floating-point square root. Specifying
-\&\fB\-mpowerpc-gfxopt\fR implies \fB\-mpowerpc\fR and also allows \s-1GCC\s0 to
+\&\fB\-mpowerpc\-gfxopt\fR implies \fB\-mpowerpc\fR and also allows \s-1GCC\s0 to
use the optional PowerPC architecture instructions in the Graphics
group, including floating-point select.
.Sp
The \fB\-mpowerpc64\fR option allows \s-1GCC\s0 to generate the additional
64\-bit instructions that are found in the full PowerPC64 architecture
and to treat GPRs as 64\-bit, doubleword quantities. \s-1GCC\s0 defaults to
-\&\fB\-mno-powerpc64\fR.
+\&\fB\-mno\-powerpc64\fR.
.Sp
-If you specify both \fB\-mno-power\fR and \fB\-mno-powerpc\fR, \s-1GCC\s0
+If you specify both \fB\-mno\-power\fR and \fB\-mno\-powerpc\fR, \s-1GCC\s0
will use only the instructions in the common subset of both
architectures plus some special \s-1AIX\s0 common-mode calls, and will not use
the \s-1MQ\s0 register. Specifying both \fB\-mpower\fR and \fB\-mpowerpc\fR
permits \s-1GCC\s0 to use any instruction from either architecture and to
allow use of the \s-1MQ\s0 register; specify this for the Motorola \s-1MPC601\s0.
-.Ip "\fB\-mnew-mnemonics\fR" 4
+.IP "\fB\-mnew\-mnemonics\fR" 4
.IX Item "-mnew-mnemonics"
.PD 0
-.Ip "\fB\-mold-mnemonics\fR" 4
+.IP "\fB\-mold\-mnemonics\fR" 4
.IX Item "-mold-mnemonics"
.PD
Select which mnemonics to use in the generated assembler code.
-\&\fB\-mnew-mnemonics\fR requests output that uses the assembler mnemonics
-defined for the PowerPC architecture, while \fB\-mold-mnemonics\fR
+\&\fB\-mnew\-mnemonics\fR requests output that uses the assembler mnemonics
+defined for the PowerPC architecture, while \fB\-mold\-mnemonics\fR
requests the assembler mnemonics defined for the \s-1POWER\s0 architecture.
Instructions defined in only one architecture have only one mnemonic;
\&\s-1GCC\s0 uses that mnemonic irrespective of which of these options is
@@ -5055,10 +5279,10 @@ specified.
.Sp
\&\s-1GCC\s0 defaults to the mnemonics appropriate for the architecture in
use. Specifying \fB\-mcpu=\fR\fIcpu_type\fR sometimes overrides the
-value of these option. Unless you are building a cross-compiler, you
-should normally not specify either \fB\-mnew-mnemonics\fR or
-\&\fB\-mold-mnemonics\fR, but should instead accept the default.
-.Ip "\fB\-mcpu=\fR\fIcpu_type\fR" 4
+value of these option. Unless you are building a cross\-compiler, you
+should normally not specify either \fB\-mnew\-mnemonics\fR or
+\&\fB\-mold\-mnemonics\fR, but should instead accept the default.
+.IP "\fB\-mcpu=\fR\fIcpu_type\fR" 4
.IX Item "-mcpu=cpu_type"
Set architecture type, register usage, choice of mnemonics, and
instruction scheduling parameters for machine type \fIcpu_type\fR.
@@ -5073,19 +5297,19 @@ specify generic \s-1POWER\s0, \s-1POWER2\s0, pure 32\-bit PowerPC (i.e., not \s-
and 64\-bit PowerPC architecture machine types, with an appropriate,
generic processor model assumed for scheduling purposes.
.Sp
-Specifying any of the following options:
+Specifying any of the following options:
\&\fB\-mcpu=rios1\fR, \fB\-mcpu=rios2\fR, \fB\-mcpu=rsc\fR,
-\&\fB\-mcpu=power\fR, or \fB\-mcpu=power2\fR
-enables the \fB\-mpower\fR option and disables the \fB\-mpowerpc\fR option;
+\&\fB\-mcpu=power\fR, or \fB\-mcpu=power2\fR
+enables the \fB\-mpower\fR option and disables the \fB\-mpowerpc\fR option;
\&\fB\-mcpu=601\fR enables both the \fB\-mpower\fR and \fB\-mpowerpc\fR options.
All of \fB\-mcpu=rs64a\fR, \fB\-mcpu=602\fR, \fB\-mcpu=603\fR,
\&\fB\-mcpu=603e\fR, \fB\-mcpu=604\fR, \fB\-mcpu=620\fR, \fB\-mcpu=630\fR,
\&\fB\-mcpu=740\fR, and \fB\-mcpu=750\fR
-enable the \fB\-mpowerpc\fR option and disable the \fB\-mpower\fR option.
+enable the \fB\-mpowerpc\fR option and disable the \fB\-mpower\fR option.
Exactly similarly, all of \fB\-mcpu=403\fR,
-\&\fB\-mcpu=505\fR, \fB\-mcpu=821\fR, \fB\-mcpu=860\fR and \fB\-mcpu=powerpc\fR
+\&\fB\-mcpu=505\fR, \fB\-mcpu=821\fR, \fB\-mcpu=860\fR and \fB\-mcpu=powerpc\fR
enable the \fB\-mpowerpc\fR option and disable the \fB\-mpower\fR option.
-\&\fB\-mcpu=common\fR disables both the
+\&\fB\-mcpu=common\fR disables both the
\&\fB\-mpower\fR and \fB\-mpowerpc\fR options.
.Sp
\&\s-1AIX\s0 versions 4 or greater selects \fB\-mcpu=common\fR by default, so
@@ -5104,8 +5328,8 @@ disables the \fBnew-mnemonics\fR option. Specifying \fB\-mcpu=601\fR,
the \fBnew-mnemonics\fR option.
.Sp
Specifying \fB\-mcpu=403\fR, \fB\-mcpu=821\fR, or \fB\-mcpu=860\fR also
-enables the \fB\-msoft-float\fR option.
-.Ip "\fB\-mtune=\fR\fIcpu_type\fR" 4
+enables the \fB\-msoft\-float\fR option.
+.IP "\fB\-mtune=\fR\fIcpu_type\fR" 4
.IX Item "-mtune=cpu_type"
Set the instruction scheduling parameters for machine type
\&\fIcpu_type\fR, but do not set the architecture type, register usage,
@@ -5114,18 +5338,18 @@ values for \fIcpu_type\fR are used for \fB\-mtune=\fR\fIcpu_type\fR as
for \fB\-mcpu=\fR\fIcpu_type\fR. The \fB\-mtune=\fR\fIcpu_type\fR
option overrides the \fB\-mcpu=\fR\fIcpu_type\fR option in terms of
instruction scheduling parameters.
-.Ip "\fB\-mfull-toc\fR" 4
+.IP "\fB\-mfull\-toc\fR" 4
.IX Item "-mfull-toc"
.PD 0
-.Ip "\fB\-mno-fp-in-toc\fR" 4
+.IP "\fB\-mno\-fp\-in\-toc\fR" 4
.IX Item "-mno-fp-in-toc"
-.Ip "\fB\-mno-sum-in-toc\fR" 4
+.IP "\fB\-mno\-sum\-in\-toc\fR" 4
.IX Item "-mno-sum-in-toc"
-.Ip "\fB\-mminimal-toc\fR" 4
+.IP "\fB\-mminimal\-toc\fR" 4
.IX Item "-mminimal-toc"
.PD
Modify generation of the \s-1TOC\s0 (Table Of Contents), which is created for
-every executable file. The \fB\-mfull-toc\fR option is selected by
+every executable file. The \fB\-mfull\-toc\fR option is selected by
default. In that case, \s-1GCC\s0 will allocate at least one \s-1TOC\s0 entry for
each unique non-automatic variable reference in your program. \s-1GCC\s0
will also place floating-point constants in the \s-1TOC\s0. However, only
@@ -5133,35 +5357,35 @@ will also place floating-point constants in the \s-1TOC\s0. However, only
.Sp
If you receive a linker error message that saying you have overflowed
the available \s-1TOC\s0 space, you can reduce the amount of \s-1TOC\s0 space used
-with the \fB\-mno-fp-in-toc\fR and \fB\-mno-sum-in-toc\fR options.
-\&\fB\-mno-fp-in-toc\fR prevents \s-1GCC\s0 from putting floating-point
-constants in the \s-1TOC\s0 and \fB\-mno-sum-in-toc\fR forces \s-1GCC\s0 to
+with the \fB\-mno\-fp\-in\-toc\fR and \fB\-mno\-sum\-in\-toc\fR options.
+\&\fB\-mno\-fp\-in\-toc\fR prevents \s-1GCC\s0 from putting floating-point
+constants in the \s-1TOC\s0 and \fB\-mno\-sum\-in\-toc\fR forces \s-1GCC\s0 to
generate code to calculate the sum of an address and a constant at
run-time instead of putting that sum into the \s-1TOC\s0. You may specify one
or both of these options. Each causes \s-1GCC\s0 to produce very slightly
slower and larger code at the expense of conserving \s-1TOC\s0 space.
.Sp
If you still run out of space in the \s-1TOC\s0 even when you specify both of
-these options, specify \fB\-mminimal-toc\fR instead. This option causes
+these options, specify \fB\-mminimal\-toc\fR instead. This option causes
\&\s-1GCC\s0 to make only one \s-1TOC\s0 entry for every file. When you specify this
option, \s-1GCC\s0 will produce code that is slower and larger but which
uses extremely little \s-1TOC\s0 space. You may wish to use this option
-only on files that contain less frequently executed code.
-.Ip "\fB\-maix64\fR" 4
+only on files that contain less frequently executed code.
+.IP "\fB\-maix64\fR" 4
.IX Item "-maix64"
.PD 0
-.Ip "\fB\-maix32\fR" 4
+.IP "\fB\-maix32\fR" 4
.IX Item "-maix32"
.PD
Enable 64\-bit \s-1AIX\s0 \s-1ABI\s0 and calling convention: 64\-bit pointers, 64\-bit
\&\f(CW\*(C`long\*(C'\fR type, and the infrastructure needed to support them.
Specifying \fB\-maix64\fR implies \fB\-mpowerpc64\fR and
\&\fB\-mpowerpc\fR, while \fB\-maix32\fR disables the 64\-bit \s-1ABI\s0 and
-implies \fB\-mno-powerpc64\fR. \s-1GCC\s0 defaults to \fB\-maix32\fR.
-.Ip "\fB\-mxl-call\fR" 4
+implies \fB\-mno\-powerpc64\fR. \s-1GCC\s0 defaults to \fB\-maix32\fR.
+.IP "\fB\-mxl\-call\fR" 4
.IX Item "-mxl-call"
.PD 0
-.Ip "\fB\-mno-xl-call\fR" 4
+.IP "\fB\-mno\-xl\-call\fR" 4
.IX Item "-mno-xl-call"
.PD
On \s-1AIX\s0, pass floating-point arguments to prototyped functions beyond the
@@ -5175,12 +5399,12 @@ optimization. Because always storing floating-point arguments on the
stack is inefficient and rarely needed, this option is not enabled by
default and only is necessary when calling subroutines compiled by \s-1AIX\s0
\&\s-1XL\s0 compilers without optimization.
-.Ip "\fB\-mthreads\fR" 4
+.IP "\fB\-mthreads\fR" 4
.IX Item "-mthreads"
Support \fI\s-1AIX\s0 Threads\fR. Link an application written to use
\&\fIpthreads\fR with special libraries and startup code to enable the
application to run.
-.Ip "\fB\-mpe\fR" 4
+.IP "\fB\-mpe\fR" 4
.IX Item "-mpe"
Support \fI\s-1IBM\s0 \s-1RS/6000\s0 \s-1SP\s0\fR \fIParallel Environment\fR (\s-1PE\s0). Link an
application written to use message passing with special startup code to
@@ -5190,19 +5414,19 @@ must be overridden with the \fB\-specs=\fR option to specify the
appropriate directory location. The Parallel Environment does not
support threads, so the \fB\-mpe\fR option and the \fB\-mthreads\fR
option are incompatible.
-.Ip "\fB\-msoft-float\fR" 4
+.IP "\fB\-msoft\-float\fR" 4
.IX Item "-msoft-float"
.PD 0
-.Ip "\fB\-mhard-float\fR" 4
+.IP "\fB\-mhard\-float\fR" 4
.IX Item "-mhard-float"
.PD
Generate code that does not use (uses) the floating-point register set.
Software floating point emulation is provided if you use the
-\&\fB\-msoft-float\fR option, and pass the option to \s-1GCC\s0 when linking.
-.Ip "\fB\-mmultiple\fR" 4
+\&\fB\-msoft\-float\fR option, and pass the option to \s-1GCC\s0 when linking.
+.IP "\fB\-mmultiple\fR" 4
.IX Item "-mmultiple"
.PD 0
-.Ip "\fB\-mno-multiple\fR" 4
+.IP "\fB\-mno\-multiple\fR" 4
.IX Item "-mno-multiple"
.PD
Generate code that uses (does not use) the load multiple word
@@ -5212,10 +5436,10 @@ generated on PowerPC systems. Do not use \fB\-mmultiple\fR on little
endian PowerPC systems, since those instructions do not work when the
processor is in little endian mode. The exceptions are \s-1PPC740\s0 and
\&\s-1PPC750\s0 which permit the instructions usage in little endian mode.
-.Ip "\fB\-mstring\fR" 4
+.IP "\fB\-mstring\fR" 4
.IX Item "-mstring"
.PD 0
-.Ip "\fB\-mno-string\fR" 4
+.IP "\fB\-mno\-string\fR" 4
.IX Item "-mno-string"
.PD
Generate code that uses (does not use) the load string instructions
@@ -5226,128 +5450,132 @@ do small block moves. These instructions are generated by default on
instructions do not work when the processor is in little endian mode.
The exceptions are \s-1PPC740\s0 and \s-1PPC750\s0 which permit the instructions
usage in little endian mode.
-.Ip "\fB\-mupdate\fR" 4
+.IP "\fB\-mupdate\fR" 4
.IX Item "-mupdate"
.PD 0
-.Ip "\fB\-mno-update\fR" 4
+.IP "\fB\-mno\-update\fR" 4
.IX Item "-mno-update"
.PD
Generate code that uses (does not use) the load or store instructions
that update the base register to the address of the calculated memory
location. These instructions are generated by default. If you use
-\&\fB\-mno-update\fR, there is a small window between the time that the
+\&\fB\-mno\-update\fR, there is a small window between the time that the
stack pointer is updated and the address of the previous frame is
stored, which means code that walks the stack frame across interrupts or
signals may get corrupted data.
-.Ip "\fB\-mfused-madd\fR" 4
+.IP "\fB\-mfused\-madd\fR" 4
.IX Item "-mfused-madd"
.PD 0
-.Ip "\fB\-mno-fused-madd\fR" 4
+.IP "\fB\-mno\-fused\-madd\fR" 4
.IX Item "-mno-fused-madd"
.PD
Generate code that uses (does not use) the floating point multiply and
accumulate instructions. These instructions are generated by default if
hardware floating is used.
-.Ip "\fB\-mno-bit-align\fR" 4
+.IP "\fB\-mno\-bit\-align\fR" 4
.IX Item "-mno-bit-align"
.PD 0
-.Ip "\fB\-mbit-align\fR" 4
+.IP "\fB\-mbit\-align\fR" 4
.IX Item "-mbit-align"
.PD
On System V.4 and embedded PowerPC systems do not (do) force structures
-and unions that contain bit fields to be aligned to the base type of the
-bit field.
+and unions that contain bit-fields to be aligned to the base type of the
+bit\-field.
.Sp
For example, by default a structure containing nothing but 8
-\&\f(CW\*(C`unsigned\*(C'\fR bitfields of length 1 would be aligned to a 4 byte
-boundary and have a size of 4 bytes. By using \fB\-mno-bit-align\fR,
+\&\f(CW\*(C`unsigned\*(C'\fR bit-fields of length 1 would be aligned to a 4 byte
+boundary and have a size of 4 bytes. By using \fB\-mno\-bit\-align\fR,
the structure would be aligned to a 1 byte boundary and be one byte in
size.
-.Ip "\fB\-mno-strict-align\fR" 4
+.IP "\fB\-mno\-strict\-align\fR" 4
.IX Item "-mno-strict-align"
.PD 0
-.Ip "\fB\-mstrict-align\fR" 4
+.IP "\fB\-mstrict\-align\fR" 4
.IX Item "-mstrict-align"
.PD
On System V.4 and embedded PowerPC systems do not (do) assume that
unaligned memory references will be handled by the system.
-.Ip "\fB\-mrelocatable\fR" 4
+.IP "\fB\-mrelocatable\fR" 4
.IX Item "-mrelocatable"
.PD 0
-.Ip "\fB\-mno-relocatable\fR" 4
+.IP "\fB\-mno\-relocatable\fR" 4
.IX Item "-mno-relocatable"
.PD
On embedded PowerPC systems generate code that allows (does not allow)
the program to be relocated to a different address at runtime. If you
use \fB\-mrelocatable\fR on any module, all objects linked together must
-be compiled with \fB\-mrelocatable\fR or \fB\-mrelocatable-lib\fR.
-.Ip "\fB\-mrelocatable-lib\fR" 4
+be compiled with \fB\-mrelocatable\fR or \fB\-mrelocatable\-lib\fR.
+.IP "\fB\-mrelocatable\-lib\fR" 4
.IX Item "-mrelocatable-lib"
.PD 0
-.Ip "\fB\-mno-relocatable-lib\fR" 4
+.IP "\fB\-mno\-relocatable\-lib\fR" 4
.IX Item "-mno-relocatable-lib"
.PD
On embedded PowerPC systems generate code that allows (does not allow)
the program to be relocated to a different address at runtime. Modules
-compiled with \fB\-mrelocatable-lib\fR can be linked with either modules
-compiled without \fB\-mrelocatable\fR and \fB\-mrelocatable-lib\fR or
+compiled with \fB\-mrelocatable\-lib\fR can be linked with either modules
+compiled without \fB\-mrelocatable\fR and \fB\-mrelocatable\-lib\fR or
with modules compiled with the \fB\-mrelocatable\fR options.
-.Ip "\fB\-mno-toc\fR" 4
+.IP "\fB\-mno\-toc\fR" 4
.IX Item "-mno-toc"
.PD 0
-.Ip "\fB\-mtoc\fR" 4
+.IP "\fB\-mtoc\fR" 4
.IX Item "-mtoc"
.PD
On System V.4 and embedded PowerPC systems do not (do) assume that
register 2 contains a pointer to a global area pointing to the addresses
used in the program.
-.Ip "\fB\-mlittle\fR" 4
+.IP "\fB\-mlittle\fR" 4
.IX Item "-mlittle"
.PD 0
-.Ip "\fB\-mlittle-endian\fR" 4
+.IP "\fB\-mlittle\-endian\fR" 4
.IX Item "-mlittle-endian"
.PD
On System V.4 and embedded PowerPC systems compile code for the
-processor in little endian mode. The \fB\-mlittle-endian\fR option is
+processor in little endian mode. The \fB\-mlittle\-endian\fR option is
the same as \fB\-mlittle\fR.
-.Ip "\fB\-mbig\fR" 4
+.IP "\fB\-mbig\fR" 4
.IX Item "-mbig"
.PD 0
-.Ip "\fB\-mbig-endian\fR" 4
+.IP "\fB\-mbig\-endian\fR" 4
.IX Item "-mbig-endian"
.PD
On System V.4 and embedded PowerPC systems compile code for the
-processor in big endian mode. The \fB\-mbig-endian\fR option is
+processor in big endian mode. The \fB\-mbig\-endian\fR option is
the same as \fB\-mbig\fR.
-.Ip "\fB\-mcall-sysv\fR" 4
+.IP "\fB\-mcall\-sysv\fR" 4
.IX Item "-mcall-sysv"
On System V.4 and embedded PowerPC systems compile code using calling
conventions that adheres to the March 1995 draft of the System V
Application Binary Interface, PowerPC processor supplement. This is the
-default unless you configured \s-1GCC\s0 using \fBpowerpc-*\-eabiaix\fR.
-.Ip "\fB\-mcall-sysv-eabi\fR" 4
+default unless you configured \s-1GCC\s0 using \fBpowerpc\-*\-eabiaix\fR.
+.IP "\fB\-mcall\-sysv\-eabi\fR" 4
.IX Item "-mcall-sysv-eabi"
-Specify both \fB\-mcall-sysv\fR and \fB\-meabi\fR options.
-.Ip "\fB\-mcall-sysv-noeabi\fR" 4
+Specify both \fB\-mcall\-sysv\fR and \fB\-meabi\fR options.
+.IP "\fB\-mcall\-sysv\-noeabi\fR" 4
.IX Item "-mcall-sysv-noeabi"
-Specify both \fB\-mcall-sysv\fR and \fB\-mno-eabi\fR options.
-.Ip "\fB\-mcall-aix\fR" 4
+Specify both \fB\-mcall\-sysv\fR and \fB\-mno\-eabi\fR options.
+.IP "\fB\-mcall\-aix\fR" 4
.IX Item "-mcall-aix"
On System V.4 and embedded PowerPC systems compile code using calling
conventions that are similar to those used on \s-1AIX\s0. This is the
-default if you configured \s-1GCC\s0 using \fBpowerpc-*\-eabiaix\fR.
-.Ip "\fB\-mcall-solaris\fR" 4
+default if you configured \s-1GCC\s0 using \fBpowerpc\-*\-eabiaix\fR.
+.IP "\fB\-mcall\-solaris\fR" 4
.IX Item "-mcall-solaris"
On System V.4 and embedded PowerPC systems compile code for the Solaris
operating system.
-.Ip "\fB\-mcall-linux\fR" 4
+.IP "\fB\-mcall\-linux\fR" 4
.IX Item "-mcall-linux"
On System V.4 and embedded PowerPC systems compile code for the
Linux-based \s-1GNU\s0 system.
-.Ip "\fB\-mprototype\fR" 4
+.IP "\fB\-mcall\-netbsd\fR" 4
+.IX Item "-mcall-netbsd"
+On System V.4 and embedded PowerPC systems compile code for the
+NetBSD operating system.
+.IP "\fB\-mprototype\fR" 4
.IX Item "-mprototype"
.PD 0
-.Ip "\fB\-mno-prototype\fR" 4
+.IP "\fB\-mno\-prototype\fR" 4
.IX Item "-mno-prototype"
.PD
On System V.4 and embedded PowerPC systems assume that all calls to
@@ -5358,39 +5586,39 @@ indicate whether floating point values were passed in the floating point
registers in case the function takes a variable arguments. With
\&\fB\-mprototype\fR, only calls to prototyped variable argument functions
will set or clear the bit.
-.Ip "\fB\-msim\fR" 4
+.IP "\fB\-msim\fR" 4
.IX Item "-msim"
On embedded PowerPC systems, assume that the startup module is called
-\&\fIsim-crt0.o\fR and that the standard C libraries are \fIlibsim.a\fR and
-\&\fIlibc.a\fR. This is the default for \fBpowerpc-*\-eabisim\fR.
+\&\fIsim\-crt0.o\fR and that the standard C libraries are \fIlibsim.a\fR and
+\&\fIlibc.a\fR. This is the default for \fBpowerpc\-*\-eabisim\fR.
configurations.
-.Ip "\fB\-mmvme\fR" 4
+.IP "\fB\-mmvme\fR" 4
.IX Item "-mmvme"
On embedded PowerPC systems, assume that the startup module is called
\&\fIcrt0.o\fR and the standard C libraries are \fIlibmvme.a\fR and
\&\fIlibc.a\fR.
-.Ip "\fB\-mads\fR" 4
+.IP "\fB\-mads\fR" 4
.IX Item "-mads"
On embedded PowerPC systems, assume that the startup module is called
\&\fIcrt0.o\fR and the standard C libraries are \fIlibads.a\fR and
\&\fIlibc.a\fR.
-.Ip "\fB\-myellowknife\fR" 4
+.IP "\fB\-myellowknife\fR" 4
.IX Item "-myellowknife"
On embedded PowerPC systems, assume that the startup module is called
\&\fIcrt0.o\fR and the standard C libraries are \fIlibyk.a\fR and
\&\fIlibc.a\fR.
-.Ip "\fB\-mvxworks\fR" 4
+.IP "\fB\-mvxworks\fR" 4
.IX Item "-mvxworks"
On System V.4 and embedded PowerPC systems, specify that you are
compiling for a VxWorks system.
-.Ip "\fB\-memb\fR" 4
+.IP "\fB\-memb\fR" 4
.IX Item "-memb"
On embedded PowerPC systems, set the \fI\s-1PPC_EMB\s0\fR bit in the \s-1ELF\s0 flags
header to indicate that \fBeabi\fR extended relocations are used.
-.Ip "\fB\-meabi\fR" 4
+.IP "\fB\-meabi\fR" 4
.IX Item "-meabi"
.PD 0
-.Ip "\fB\-mno-eabi\fR" 4
+.IP "\fB\-mno\-eabi\fR" 4
.IX Item "-mno-eabi"
.PD
On System V.4 and embedded PowerPC systems do (do not) adhere to the
@@ -5400,23 +5628,23 @@ means that the stack is aligned to an 8 byte boundary, a function
\&\f(CW\*(C`_\|_eabi\*(C'\fR is called to from \f(CW\*(C`main\*(C'\fR to set up the eabi
environment, and the \fB\-msdata\fR option can use both \f(CW\*(C`r2\*(C'\fR and
\&\f(CW\*(C`r13\*(C'\fR to point to two separate small data areas. Selecting
-\&\fB\-mno-eabi\fR means that the stack is aligned to a 16 byte boundary,
+\&\fB\-mno\-eabi\fR means that the stack is aligned to a 16 byte boundary,
do not call an initialization function from \f(CW\*(C`main\*(C'\fR, and the
\&\fB\-msdata\fR option will only use \f(CW\*(C`r13\*(C'\fR to point to a single
small data area. The \fB\-meabi\fR option is on by default if you
configured \s-1GCC\s0 using one of the \fBpowerpc*\-*\-eabi*\fR options.
-.Ip "\fB\-msdata=eabi\fR" 4
+.IP "\fB\-msdata=eabi\fR" 4
.IX Item "-msdata=eabi"
On System V.4 and embedded PowerPC systems, put small initialized
\&\f(CW\*(C`const\*(C'\fR global and static data in the \fB.sdata2\fR section, which
is pointed to by register \f(CW\*(C`r2\*(C'\fR. Put small initialized
-non-\f(CW\*(C`const\*(C'\fR global and static data in the \fB.sdata\fR section,
+non\-\f(CW\*(C`const\*(C'\fR global and static data in the \fB.sdata\fR section,
which is pointed to by register \f(CW\*(C`r13\*(C'\fR. Put small uninitialized
global and static data in the \fB.sbss\fR section, which is adjacent to
the \fB.sdata\fR section. The \fB\-msdata=eabi\fR option is
incompatible with the \fB\-mrelocatable\fR option. The
\&\fB\-msdata=eabi\fR option also sets the \fB\-memb\fR option.
-.Ip "\fB\-msdata=sysv\fR" 4
+.IP "\fB\-msdata=sysv\fR" 4
.IX Item "-msdata=sysv"
On System V.4 and embedded PowerPC systems, put small global and static
data in the \fB.sdata\fR section, which is pointed to by register
@@ -5424,150 +5652,150 @@ data in the \fB.sdata\fR section, which is pointed to by register
\&\fB.sbss\fR section, which is adjacent to the \fB.sdata\fR section.
The \fB\-msdata=sysv\fR option is incompatible with the
\&\fB\-mrelocatable\fR option.
-.Ip "\fB\-msdata=default\fR" 4
+.IP "\fB\-msdata=default\fR" 4
.IX Item "-msdata=default"
.PD 0
-.Ip "\fB\-msdata\fR" 4
+.IP "\fB\-msdata\fR" 4
.IX Item "-msdata"
.PD
On System V.4 and embedded PowerPC systems, if \fB\-meabi\fR is used,
compile code the same as \fB\-msdata=eabi\fR, otherwise compile code the
same as \fB\-msdata=sysv\fR.
-.Ip "\fB\-msdata-data\fR" 4
+.IP "\fB\-msdata\-data\fR" 4
.IX Item "-msdata-data"
On System V.4 and embedded PowerPC systems, put small global and static
data in the \fB.sdata\fR section. Put small uninitialized global and
static data in the \fB.sbss\fR section. Do not use register \f(CW\*(C`r13\*(C'\fR
to address small data however. This is the default behavior unless
other \fB\-msdata\fR options are used.
-.Ip "\fB\-msdata=none\fR" 4
+.IP "\fB\-msdata=none\fR" 4
.IX Item "-msdata=none"
.PD 0
-.Ip "\fB\-mno-sdata\fR" 4
+.IP "\fB\-mno\-sdata\fR" 4
.IX Item "-mno-sdata"
.PD
On embedded PowerPC systems, put all initialized global and static data
in the \fB.data\fR section, and all uninitialized data in the
\&\fB.bss\fR section.
-.Ip "\fB\-G\fR \fInum\fR" 4
+.IP "\fB\-G\fR \fInum\fR" 4
.IX Item "-G num"
On embedded PowerPC systems, put global and static items less than or
equal to \fInum\fR bytes into the small data or bss sections instead of
the normal data or bss section. By default, \fInum\fR is 8. The
\&\fB\-G\fR \fInum\fR switch is also passed to the linker.
All modules should be compiled with the same \fB\-G\fR \fInum\fR value.
-.Ip "\fB\-mregnames\fR" 4
+.IP "\fB\-mregnames\fR" 4
.IX Item "-mregnames"
.PD 0
-.Ip "\fB\-mno-regnames\fR" 4
+.IP "\fB\-mno\-regnames\fR" 4
.IX Item "-mno-regnames"
.PD
On System V.4 and embedded PowerPC systems do (do not) emit register
names in the assembly language output using symbolic forms.
.PP
-.I "\s-1IBM\s0 \s-1RT\s0 Options"
+\fI\s-1IBM\s0 \s-1RT\s0 Options\fR
.IX Subsection "IBM RT Options"
.PP
These \fB\-m\fR options are defined for the \s-1IBM\s0 \s-1RT\s0 \s-1PC:\s0
-.Ip "\fB\-min-line-mul\fR" 4
+.IP "\fB\-min\-line\-mul\fR" 4
.IX Item "-min-line-mul"
Use an in-line code sequence for integer multiplies. This is the
default.
-.Ip "\fB\-mcall-lib-mul\fR" 4
+.IP "\fB\-mcall\-lib\-mul\fR" 4
.IX Item "-mcall-lib-mul"
Call \f(CW\*(C`lmul$$\*(C'\fR for integer multiples.
-.Ip "\fB\-mfull-fp-blocks\fR" 4
+.IP "\fB\-mfull\-fp\-blocks\fR" 4
.IX Item "-mfull-fp-blocks"
Generate full-size floating point data blocks, including the minimum
amount of scratch space recommended by \s-1IBM\s0. This is the default.
-.Ip "\fB\-mminimum-fp-blocks\fR" 4
+.IP "\fB\-mminimum\-fp\-blocks\fR" 4
.IX Item "-mminimum-fp-blocks"
Do not include extra scratch space in floating point data blocks. This
results in smaller code, but slower execution, since scratch space must
be allocated dynamically.
-.Ip "\fB\-mfp-arg-in-fpregs\fR" 4
+.IP "\fB\-mfp\-arg\-in\-fpregs\fR" 4
.IX Item "-mfp-arg-in-fpregs"
Use a calling sequence incompatible with the \s-1IBM\s0 calling convention in
which floating point arguments are passed in floating point registers.
-Note that \f(CW\*(C`varargs.h\*(C'\fR and \f(CW\*(C`stdargs.h\*(C'\fR will not work with
+Note that \f(CW\*(C`varargs.h\*(C'\fR and \f(CW\*(C`stdarg.h\*(C'\fR will not work with
floating point operands if this option is specified.
-.Ip "\fB\-mfp-arg-in-gregs\fR" 4
+.IP "\fB\-mfp\-arg\-in\-gregs\fR" 4
.IX Item "-mfp-arg-in-gregs"
Use the normal calling convention for floating point arguments. This is
the default.
-.Ip "\fB\-mhc-struct-return\fR" 4
+.IP "\fB\-mhc\-struct\-return\fR" 4
.IX Item "-mhc-struct-return"
Return structures of more than one word in memory, rather than in a
register. This provides compatibility with the MetaWare HighC (hc)
-compiler. Use the option \fB\-fpcc-struct-return\fR for compatibility
+compiler. Use the option \fB\-fpcc\-struct\-return\fR for compatibility
with the Portable C Compiler (pcc).
-.Ip "\fB\-mnohc-struct-return\fR" 4
+.IP "\fB\-mnohc\-struct\-return\fR" 4
.IX Item "-mnohc-struct-return"
Return some structures of more than one word in registers, when
convenient. This is the default. For compatibility with the
-IBM-supplied compilers, use the option \fB\-fpcc-struct-return\fR or the
-option \fB\-mhc-struct-return\fR.
+IBM-supplied compilers, use the option \fB\-fpcc\-struct\-return\fR or the
+option \fB\-mhc\-struct\-return\fR.
.PP
-.I "\s-1MIPS\s0 Options"
+\fI\s-1MIPS\s0 Options\fR
.IX Subsection "MIPS Options"
.PP
These \fB\-m\fR options are defined for the \s-1MIPS\s0 family of computers:
-.Ip "\fB\-mcpu=\fR\fIcpu type\fR" 4
-.IX Item "-mcpu=cpu type"
-Assume the defaults for the machine type \fIcpu type\fR when scheduling
-instructions. The choices for \fIcpu type\fR are \fBr2000\fR, \fBr3000\fR,
+.IP "\fB\-mcpu=\fR\fIcpu-type\fR" 4
+.IX Item "-mcpu=cpu-type"
+Assume the defaults for the machine type \fIcpu-type\fR when scheduling
+instructions. The choices for \fIcpu-type\fR are \fBr2000\fR, \fBr3000\fR,
\&\fBr3900\fR, \fBr4000\fR, \fBr4100\fR, \fBr4300\fR, \fBr4400\fR,
\&\fBr4600\fR, \fBr4650\fR, \fBr5000\fR, \fBr6000\fR, \fBr8000\fR,
and \fBorion\fR. Additionally, the \fBr2000\fR, \fBr3000\fR,
\&\fBr4000\fR, \fBr5000\fR, and \fBr6000\fR can be abbreviated as
\&\fBr2k\fR (or \fBr2K\fR), \fBr3k\fR, etc. While picking a specific
-\&\fIcpu type\fR will schedule things appropriately for that particular
+\&\fIcpu-type\fR will schedule things appropriately for that particular
chip, the compiler will not generate any code that does not meet level 1
of the \s-1MIPS\s0 \s-1ISA\s0 (instruction set architecture) without a \fB\-mipsX\fR
or \fB\-mabi\fR switch being used.
-.Ip "\fB\-mips1\fR" 4
+.IP "\fB\-mips1\fR" 4
.IX Item "-mips1"
Issue instructions from level 1 of the \s-1MIPS\s0 \s-1ISA\s0. This is the default.
-\&\fBr3000\fR is the default \fIcpu type\fR at this \s-1ISA\s0 level.
-.Ip "\fB\-mips2\fR" 4
+\&\fBr3000\fR is the default \fIcpu-type\fR at this \s-1ISA\s0 level.
+.IP "\fB\-mips2\fR" 4
.IX Item "-mips2"
Issue instructions from level 2 of the \s-1MIPS\s0 \s-1ISA\s0 (branch likely, square
-root instructions). \fBr6000\fR is the default \fIcpu type\fR at this
+root instructions). \fBr6000\fR is the default \fIcpu-type\fR at this
\&\s-1ISA\s0 level.
-.Ip "\fB\-mips3\fR" 4
+.IP "\fB\-mips3\fR" 4
.IX Item "-mips3"
-Issue instructions from level 3 of the \s-1MIPS\s0 \s-1ISA\s0 (64 bit instructions).
-\&\fBr4000\fR is the default \fIcpu type\fR at this \s-1ISA\s0 level.
-.Ip "\fB\-mips4\fR" 4
+Issue instructions from level 3 of the \s-1MIPS\s0 \s-1ISA\s0 (64\-bit instructions).
+\&\fBr4000\fR is the default \fIcpu-type\fR at this \s-1ISA\s0 level.
+.IP "\fB\-mips4\fR" 4
.IX Item "-mips4"
Issue instructions from level 4 of the \s-1MIPS\s0 \s-1ISA\s0 (conditional move,
prefetch, enhanced \s-1FPU\s0 instructions). \fBr8000\fR is the default
-\&\fIcpu type\fR at this \s-1ISA\s0 level.
-.Ip "\fB\-mfp32\fR" 4
+\&\fIcpu-type\fR at this \s-1ISA\s0 level.
+.IP "\fB\-mfp32\fR" 4
.IX Item "-mfp32"
Assume that 32 32\-bit floating point registers are available. This is
the default.
-.Ip "\fB\-mfp64\fR" 4
+.IP "\fB\-mfp64\fR" 4
.IX Item "-mfp64"
Assume that 32 64\-bit floating point registers are available. This is
the default when the \fB\-mips3\fR option is used.
-.Ip "\fB\-mgp32\fR" 4
+.IP "\fB\-mgp32\fR" 4
.IX Item "-mgp32"
Assume that 32 32\-bit general purpose registers are available. This is
the default.
-.Ip "\fB\-mgp64\fR" 4
+.IP "\fB\-mgp64\fR" 4
.IX Item "-mgp64"
Assume that 32 64\-bit general purpose registers are available. This is
the default when the \fB\-mips3\fR option is used.
-.Ip "\fB\-mint64\fR" 4
+.IP "\fB\-mint64\fR" 4
.IX Item "-mint64"
Force int and long types to be 64 bits wide. See \fB\-mlong32\fR for an
explanation of the default, and the width of pointers.
-.Ip "\fB\-mlong64\fR" 4
+.IP "\fB\-mlong64\fR" 4
.IX Item "-mlong64"
Force long types to be 64 bits wide. See \fB\-mlong32\fR for an
explanation of the default, and the width of pointers.
-.Ip "\fB\-mlong32\fR" 4
+.IP "\fB\-mlong32\fR" 4
.IX Item "-mlong32"
Force long, int, and pointer types to be 32 bits wide.
.Sp
@@ -5580,16 +5808,16 @@ and longs are 32 bits wide. For \fB\-mabi=eabi\fR and higher ISAs, ints
are 32 bits, and longs are 64 bits wide. The width of pointer types is
the smaller of the width of longs or the width of general purpose
registers (which in turn depends on the \s-1ISA\s0).
-.Ip "\fB\-mabi=32\fR" 4
+.IP "\fB\-mabi=32\fR" 4
.IX Item "-mabi=32"
.PD 0
-.Ip "\fB\-mabi=o64\fR" 4
+.IP "\fB\-mabi=o64\fR" 4
.IX Item "-mabi=o64"
-.Ip "\fB\-mabi=n32\fR" 4
+.IP "\fB\-mabi=n32\fR" 4
.IX Item "-mabi=n32"
-.Ip "\fB\-mabi=64\fR" 4
+.IP "\fB\-mabi=64\fR" 4
.IX Item "-mabi=64"
-.Ip "\fB\-mabi=eabi\fR" 4
+.IP "\fB\-mabi=eabi\fR" 4
.IX Item "-mabi=eabi"
.PD
Generate code for the indicated \s-1ABI\s0. The default instruction level is
@@ -5597,7 +5825,7 @@ Generate code for the indicated \s-1ABI\s0. The default instruction level is
\&\fB\-mips4\fR otherwise. Conversely, with \fB\-mips1\fR or
\&\fB\-mips2\fR, the default \s-1ABI\s0 is \fB32\fR; otherwise, the default \s-1ABI\s0
is \fB64\fR.
-.Ip "\fB\-mmips-as\fR" 4
+.IP "\fB\-mmips\-as\fR" 4
.IX Item "-mmips-as"
Generate code for the \s-1MIPS\s0 assembler, and invoke \fImips-tfile\fR to
add normal debug information. This is the default for all
@@ -5605,36 +5833,36 @@ platforms except for the \s-1OSF/1\s0 reference platform, using the OSF/rose
object format. If the either of the \fB\-gstabs\fR or \fB\-gstabs+\fR
switches are used, the \fImips-tfile\fR program will encapsulate the
stabs within \s-1MIPS\s0 \s-1ECOFF\s0.
-.Ip "\fB\-mgas\fR" 4
+.IP "\fB\-mgas\fR" 4
.IX Item "-mgas"
Generate code for the \s-1GNU\s0 assembler. This is the default on the \s-1OSF/1\s0
reference platform, using the OSF/rose object format. Also, this is
-the default if the configure option \fB\*(--with-gnu-as\fR is used.
-.Ip "\fB\-msplit-addresses\fR" 4
+the default if the configure option \fB\-\-with\-gnu\-as\fR is used.
+.IP "\fB\-msplit\-addresses\fR" 4
.IX Item "-msplit-addresses"
.PD 0
-.Ip "\fB\-mno-split-addresses\fR" 4
+.IP "\fB\-mno\-split\-addresses\fR" 4
.IX Item "-mno-split-addresses"
.PD
Generate code to load the high and low parts of address constants separately.
-This allows \f(CW\*(C`gcc\*(C'\fR to optimize away redundant loads of the high order
+This allows \s-1GCC\s0 to optimize away redundant loads of the high order
bits of addresses. This optimization requires \s-1GNU\s0 as and \s-1GNU\s0 ld.
This optimization is enabled by default for some embedded targets where
\&\s-1GNU\s0 as and \s-1GNU\s0 ld are standard.
-.Ip "\fB\-mrnames\fR" 4
+.IP "\fB\-mrnames\fR" 4
.IX Item "-mrnames"
.PD 0
-.Ip "\fB\-mno-rnames\fR" 4
+.IP "\fB\-mno\-rnames\fR" 4
.IX Item "-mno-rnames"
.PD
The \fB\-mrnames\fR switch says to output code using the \s-1MIPS\s0 software
names for the registers, instead of the hardware names (ie, \fIa0\fR
instead of \fI$4\fR). The only known assembler that supports this option
is the Algorithmics assembler.
-.Ip "\fB\-mgpopt\fR" 4
+.IP "\fB\-mgpopt\fR" 4
.IX Item "-mgpopt"
.PD 0
-.Ip "\fB\-mno-gpopt\fR" 4
+.IP "\fB\-mno\-gpopt\fR" 4
.IX Item "-mno-gpopt"
.PD
The \fB\-mgpopt\fR switch says to write all of the data declarations
@@ -5642,84 +5870,84 @@ before the instructions in the text section, this allows the \s-1MIPS\s0
assembler to generate one word memory references instead of using two
words for short global or static data items. This is on by default if
optimization is selected.
-.Ip "\fB\-mstats\fR" 4
+.IP "\fB\-mstats\fR" 4
.IX Item "-mstats"
.PD 0
-.Ip "\fB\-mno-stats\fR" 4
+.IP "\fB\-mno\-stats\fR" 4
.IX Item "-mno-stats"
.PD
For each non-inline function processed, the \fB\-mstats\fR switch
causes the compiler to emit one line to the standard error file to
print statistics about the program (number of registers saved, stack
size, etc.).
-.Ip "\fB\-mmemcpy\fR" 4
+.IP "\fB\-mmemcpy\fR" 4
.IX Item "-mmemcpy"
.PD 0
-.Ip "\fB\-mno-memcpy\fR" 4
+.IP "\fB\-mno\-memcpy\fR" 4
.IX Item "-mno-memcpy"
.PD
The \fB\-mmemcpy\fR switch makes all block moves call the appropriate
string function (\fBmemcpy\fR or \fBbcopy\fR) instead of possibly
generating inline code.
-.Ip "\fB\-mmips-tfile\fR" 4
+.IP "\fB\-mmips\-tfile\fR" 4
.IX Item "-mmips-tfile"
.PD 0
-.Ip "\fB\-mno-mips-tfile\fR" 4
+.IP "\fB\-mno\-mips\-tfile\fR" 4
.IX Item "-mno-mips-tfile"
.PD
-The \fB\-mno-mips-tfile\fR switch causes the compiler not
+The \fB\-mno\-mips\-tfile\fR switch causes the compiler not
postprocess the object file with the \fImips-tfile\fR program,
after the \s-1MIPS\s0 assembler has generated it to add debug support. If
\&\fImips-tfile\fR is not run, then no local variables will be
available to the debugger. In addition, \fIstage2\fR and
\&\fIstage3\fR objects will have the temporary file names passed to the
assembler embedded in the object file, which means the objects will
-not compare the same. The \fB\-mno-mips-tfile\fR switch should only
+not compare the same. The \fB\-mno\-mips\-tfile\fR switch should only
be used when there are bugs in the \fImips-tfile\fR program that
prevents compilation.
-.Ip "\fB\-msoft-float\fR" 4
+.IP "\fB\-msoft\-float\fR" 4
.IX Item "-msoft-float"
Generate output containing library calls for floating point.
\&\fBWarning:\fR the requisite libraries are not part of \s-1GCC\s0.
Normally the facilities of the machine's usual C compiler are used, but
-this can't be done directly in cross-compilation. You must make your
+this can't be done directly in cross\-compilation. You must make your
own arrangements to provide suitable library functions for
-cross-compilation.
-.Ip "\fB\-mhard-float\fR" 4
+cross\-compilation.
+.IP "\fB\-mhard\-float\fR" 4
.IX Item "-mhard-float"
Generate output containing floating point instructions. This is the
default if you use the unmodified sources.
-.Ip "\fB\-mabicalls\fR" 4
+.IP "\fB\-mabicalls\fR" 4
.IX Item "-mabicalls"
.PD 0
-.Ip "\fB\-mno-abicalls\fR" 4
+.IP "\fB\-mno\-abicalls\fR" 4
.IX Item "-mno-abicalls"
.PD
Emit (or do not emit) the pseudo operations \fB.abicalls\fR,
\&\fB.cpload\fR, and \fB.cprestore\fR that some System V.4 ports use for
position independent code.
-.Ip "\fB\-mlong-calls\fR" 4
+.IP "\fB\-mlong\-calls\fR" 4
.IX Item "-mlong-calls"
.PD 0
-.Ip "\fB\-mno-long-calls\fR" 4
+.IP "\fB\-mno\-long\-calls\fR" 4
.IX Item "-mno-long-calls"
.PD
Do all calls with the \fB\s-1JALR\s0\fR instruction, which requires
loading up a function's address into a register before the call.
You need to use this switch, if you call outside of the current
512 megabyte segment to functions that are not through pointers.
-.Ip "\fB\-mhalf-pic\fR" 4
+.IP "\fB\-mhalf\-pic\fR" 4
.IX Item "-mhalf-pic"
.PD 0
-.Ip "\fB\-mno-half-pic\fR" 4
+.IP "\fB\-mno\-half\-pic\fR" 4
.IX Item "-mno-half-pic"
.PD
Put pointers to extern references into the data section and load them
up, rather than put the references in the text section.
-.Ip "\fB\-membedded-pic\fR" 4
+.IP "\fB\-membedded\-pic\fR" 4
.IX Item "-membedded-pic"
.PD 0
-.Ip "\fB\-mno-embedded-pic\fR" 4
+.IP "\fB\-mno\-embedded\-pic\fR" 4
.IX Item "-mno-embedded-pic"
.PD
Generate \s-1PIC\s0 code suitable for some embedded systems. All calls are
@@ -5727,66 +5955,66 @@ made using \s-1PC\s0 relative address, and all data is addressed using the \f(CW
register. No more than 65536 bytes of global data may be used. This
requires \s-1GNU\s0 as and \s-1GNU\s0 ld which do most of the work. This currently
only works on targets which use \s-1ECOFF\s0; it does not work with \s-1ELF\s0.
-.Ip "\fB\-membedded-data\fR" 4
+.IP "\fB\-membedded\-data\fR" 4
.IX Item "-membedded-data"
.PD 0
-.Ip "\fB\-mno-embedded-data\fR" 4
+.IP "\fB\-mno\-embedded\-data\fR" 4
.IX Item "-mno-embedded-data"
.PD
Allocate variables to the read-only data section first if possible, then
next in the small data section if possible, otherwise in data. This gives
slightly slower code than the default, but reduces the amount of \s-1RAM\s0 required
when executing, and thus may be preferred for some embedded systems.
-.Ip "\fB\-muninit-const-in-rodata\fR" 4
+.IP "\fB\-muninit\-const\-in\-rodata\fR" 4
.IX Item "-muninit-const-in-rodata"
.PD 0
-.Ip "\fB\-mno-uninit-const-in-rodata\fR" 4
+.IP "\fB\-mno\-uninit\-const\-in\-rodata\fR" 4
.IX Item "-mno-uninit-const-in-rodata"
.PD
-When used together with \-membedded-data, it will always store uninitialized
+When used together with \fB\-membedded\-data\fR, it will always store uninitialized
const variables in the read-only data section.
-.Ip "\fB\-msingle-float\fR" 4
+.IP "\fB\-msingle\-float\fR" 4
.IX Item "-msingle-float"
.PD 0
-.Ip "\fB\-mdouble-float\fR" 4
+.IP "\fB\-mdouble\-float\fR" 4
.IX Item "-mdouble-float"
.PD
-The \fB\-msingle-float\fR switch tells gcc to assume that the floating
+The \fB\-msingle\-float\fR switch tells gcc to assume that the floating
point coprocessor only supports single precision operations, as on the
-\&\fBr4650\fR chip. The \fB\-mdouble-float\fR switch permits gcc to use
+\&\fBr4650\fR chip. The \fB\-mdouble\-float\fR switch permits gcc to use
double precision operations. This is the default.
-.Ip "\fB\-mmad\fR" 4
+.IP "\fB\-mmad\fR" 4
.IX Item "-mmad"
.PD 0
-.Ip "\fB\-mno-mad\fR" 4
+.IP "\fB\-mno\-mad\fR" 4
.IX Item "-mno-mad"
.PD
Permit use of the \fBmad\fR, \fBmadu\fR and \fBmul\fR instructions,
as on the \fBr4650\fR chip.
-.Ip "\fB\-m4650\fR" 4
+.IP "\fB\-m4650\fR" 4
.IX Item "-m4650"
-Turns on \fB\-msingle-float\fR, \fB\-mmad\fR, and, at least for now,
+Turns on \fB\-msingle\-float\fR, \fB\-mmad\fR, and, at least for now,
\&\fB\-mcpu=r4650\fR.
-.Ip "\fB\-mips16\fR" 4
+.IP "\fB\-mips16\fR" 4
.IX Item "-mips16"
.PD 0
-.Ip "\fB\-mno-mips16\fR" 4
+.IP "\fB\-mno\-mips16\fR" 4
.IX Item "-mno-mips16"
.PD
Enable 16\-bit instructions.
-.Ip "\fB\-mentry\fR" 4
+.IP "\fB\-mentry\fR" 4
.IX Item "-mentry"
Use the entry and exit pseudo ops. This option can only be used with
\&\fB\-mips16\fR.
-.Ip "\fB\-EL\fR" 4
+.IP "\fB\-EL\fR" 4
.IX Item "-EL"
Compile code for the processor in little endian mode.
The requisite libraries are assumed to exist.
-.Ip "\fB\-EB\fR" 4
+.IP "\fB\-EB\fR" 4
.IX Item "-EB"
Compile code for the processor in big endian mode.
The requisite libraries are assumed to exist.
-.Ip "\fB\-G\fR \fInum\fR" 4
+.IP "\fB\-G\fR \fInum\fR" 4
.IX Item "-G num"
Put global and static items less than or equal to \fInum\fR bytes into
the small data or bss sections instead of the normal data or bss
@@ -5797,78 +6025,78 @@ the \s-1MIPS\s0 assembler is used, and 0 when the \s-1GNU\s0 assembler is used.
\&\fB\-G\fR \fInum\fR switch is also passed to the assembler and linker.
All modules should be compiled with the same \fB\-G\fR \fInum\fR
value.
-.Ip "\fB\-nocpp\fR" 4
+.IP "\fB\-nocpp\fR" 4
.IX Item "-nocpp"
Tell the \s-1MIPS\s0 assembler to not run its preprocessor over user
assembler files (with a \fB.s\fR suffix) when assembling them.
-.Ip "\fB\-mfix7000\fR" 4
+.IP "\fB\-mfix7000\fR" 4
.IX Item "-mfix7000"
Pass an option to gas which will cause nops to be inserted if
the read of the destination register of an mfhi or mflo instruction
occurs in the following two instructions.
-.Ip "\fB\-no-crt0\fR" 4
+.IP "\fB\-no\-crt0\fR" 4
.IX Item "-no-crt0"
Do not include the default crt0.
.PP
-.I "Intel 386 Options"
+\fIIntel 386 Options\fR
.IX Subsection "Intel 386 Options"
.PP
These \fB\-m\fR options are defined for the i386 family of computers:
-.Ip "\fB\-mcpu=\fR\fIcpu type\fR" 4
-.IX Item "-mcpu=cpu type"
-Assume the defaults for the machine type \fIcpu type\fR when scheduling
-instructions. The choices for \fIcpu type\fR are \fBi386\fR,
+.IP "\fB\-mcpu=\fR\fIcpu-type\fR" 4
+.IX Item "-mcpu=cpu-type"
+Assume the defaults for the machine type \fIcpu-type\fR when scheduling
+instructions. The choices for \fIcpu-type\fR are \fBi386\fR,
\&\fBi486\fR, \fBi586\fR, \fBi686\fR, \fBpentium\fR,
\&\fBpentiumpro\fR, \fBk6\fR, and \fBathlon\fR
.Sp
-While picking a specific \fIcpu type\fR will schedule things appropriately
+While picking a specific \fIcpu-type\fR will schedule things appropriately
for that particular chip, the compiler will not generate any code that
-does not run on the i386 without the \fB\-march=\fR\fIcpu type\fR option
+does not run on the i386 without the \fB\-march=\fR\fIcpu-type\fR option
being used. \fBi586\fR is equivalent to \fBpentium\fR and \fBi686\fR
is equivalent to \fBpentiumpro\fR. \fBk6\fR is the \s-1AMD\s0 chip as
opposed to the Intel ones.
-.Ip "\fB\-march=\fR\fIcpu type\fR" 4
-.IX Item "-march=cpu type"
-Generate instructions for the machine type \fIcpu type\fR. The choices
-for \fIcpu type\fR are the same as for \fB\-mcpu\fR. Moreover,
-specifying \fB\-march=\fR\fIcpu type\fR implies \fB\-mcpu=\fR\fIcpu type\fR.
-.Ip "\fB\-m386\fR" 4
+.IP "\fB\-march=\fR\fIcpu-type\fR" 4
+.IX Item "-march=cpu-type"
+Generate instructions for the machine type \fIcpu-type\fR. The choices
+for \fIcpu-type\fR are the same as for \fB\-mcpu\fR. Moreover,
+specifying \fB\-march=\fR\fIcpu-type\fR implies \fB\-mcpu=\fR\fIcpu-type\fR.
+.IP "\fB\-m386\fR" 4
.IX Item "-m386"
.PD 0
-.Ip "\fB\-m486\fR" 4
+.IP "\fB\-m486\fR" 4
.IX Item "-m486"
-.Ip "\fB\-mpentium\fR" 4
+.IP "\fB\-mpentium\fR" 4
.IX Item "-mpentium"
-.Ip "\fB\-mpentiumpro\fR" 4
+.IP "\fB\-mpentiumpro\fR" 4
.IX Item "-mpentiumpro"
.PD
-Synonyms for \-mcpu=i386, \-mcpu=i486, \-mcpu=pentium, and \-mcpu=pentiumpro
+Synonyms for \fB\-mcpu=i386\fR, \fB\-mcpu=i486\fR, \fB\-mcpu=pentium\fR, and \fB\-mcpu=pentiumpro\fR
respectively. These synonyms are deprecated.
-.Ip "\fB\-mintel-syntax\fR" 4
+.IP "\fB\-mintel\-syntax\fR" 4
.IX Item "-mintel-syntax"
Emit assembly using Intel syntax opcodes instead of \s-1AT&T\s0 syntax.
-.Ip "\fB\-mieee-fp\fR" 4
+.IP "\fB\-mieee\-fp\fR" 4
.IX Item "-mieee-fp"
.PD 0
-.Ip "\fB\-mno-ieee-fp\fR" 4
+.IP "\fB\-mno\-ieee\-fp\fR" 4
.IX Item "-mno-ieee-fp"
.PD
Control whether or not the compiler uses \s-1IEEE\s0 floating point
comparisons. These handle correctly the case where the result of a
comparison is unordered.
-.Ip "\fB\-msoft-float\fR" 4
+.IP "\fB\-msoft\-float\fR" 4
.IX Item "-msoft-float"
Generate output containing library calls for floating point.
\&\fBWarning:\fR the requisite libraries are not part of \s-1GCC\s0.
Normally the facilities of the machine's usual C compiler are used, but
-this can't be done directly in cross-compilation. You must make your
+this can't be done directly in cross\-compilation. You must make your
own arrangements to provide suitable library functions for
-cross-compilation.
+cross\-compilation.
.Sp
On machines where a function returns floating point results in the 80387
register stack, some floating point opcodes may be emitted even if
-\&\fB\-msoft-float\fR is used.
-.Ip "\fB\-mno-fp-ret-in-387\fR" 4
+\&\fB\-msoft\-float\fR is used.
+.IP "\fB\-mno\-fp\-ret\-in\-387\fR" 4
.IX Item "-mno-fp-ret-in-387"
Do not use the \s-1FPU\s0 registers for return values of functions.
.Sp
@@ -5877,19 +6105,19 @@ The usual calling convention has functions return values of types
is no \s-1FPU\s0. The idea is that the operating system should emulate
an \s-1FPU\s0.
.Sp
-The option \fB\-mno-fp-ret-in-387\fR causes such values to be returned
+The option \fB\-mno\-fp\-ret\-in\-387\fR causes such values to be returned
in ordinary \s-1CPU\s0 registers instead.
-.Ip "\fB\-mno-fancy-math-387\fR" 4
+.IP "\fB\-mno\-fancy\-math\-387\fR" 4
.IX Item "-mno-fancy-math-387"
Some 387 emulators do not support the \f(CW\*(C`sin\*(C'\fR, \f(CW\*(C`cos\*(C'\fR and
\&\f(CW\*(C`sqrt\*(C'\fR instructions for the 387. Specify this option to avoid
-generating those instructions. This option is the default on FreeBSD.
+generating those instructions. This option is the default on FreeBSD.
As of revision 2.6.1, these instructions are not generated unless you
-also use the \fB\-ffast-math\fR switch.
-.Ip "\fB\-malign-double\fR" 4
+also use the \fB\-ffast\-math\fR switch.
+.IP "\fB\-malign\-double\fR" 4
.IX Item "-malign-double"
.PD 0
-.Ip "\fB\-mno-align-double\fR" 4
+.IP "\fB\-mno\-align\-double\fR" 4
.IX Item "-mno-align-double"
.PD
Control whether \s-1GCC\s0 aligns \f(CW\*(C`double\*(C'\fR, \f(CW\*(C`long double\*(C'\fR, and
@@ -5897,48 +6125,31 @@ Control whether \s-1GCC\s0 aligns \f(CW\*(C`double\*(C'\fR, \f(CW\*(C`long doubl
boundary. Aligning \f(CW\*(C`double\*(C'\fR variables on a two word boundary will
produce code that runs somewhat faster on a \fBPentium\fR at the
expense of more memory.
-.Ip "\fB\-m128bit-long-double\fR" 4
+.IP "\fB\-m128bit\-long\-double\fR" 4
.IX Item "-m128bit-long-double"
-.PD 0
-.Ip "\fB\-m128bit-long-double\fR" 4
-.IX Item "-m128bit-long-double"
-.PD
Control the size of \f(CW\*(C`long double\*(C'\fR type. i386 application binary interface
specify the size to be 12 bytes, while modern architectures (Pentium and newer)
-preffer \f(CW\*(C`long double\*(C'\fR aligned to 8 or 16 byte boundary. This is
+prefer \f(CW\*(C`long double\*(C'\fR aligned to 8 or 16 byte boundary. This is
impossible to reach with 12 byte long doubles in the array accesses.
.Sp
-\&\fBWarning:\fR if you use the \fB\-m128bit-long-double\fR switch, the
+\&\fBWarning:\fR if you use the \fB\-m128bit\-long\-double\fR switch, the
structures and arrays containing \f(CW\*(C`long double\*(C'\fR will change their size as
well as function calling convention for function taking \f(CW\*(C`long double\*(C'\fR
-will be modified.
-.Ip "\fB\-m96bit-long-double\fR" 4
+will be modified.
+.IP "\fB\-m96bit\-long\-double\fR" 4
.IX Item "-m96bit-long-double"
-.PD 0
-.Ip "\fB\-m96bit-long-double\fR" 4
-.IX Item "-m96bit-long-double"
-.PD
Set the size of \f(CW\*(C`long double\*(C'\fR to 96 bits as required by the i386
application binary interface. This is the default.
-.Ip "\fB\-msvr3\-shlib\fR" 4
+.IP "\fB\-msvr3\-shlib\fR" 4
.IX Item "-msvr3-shlib"
.PD 0
-.Ip "\fB\-mno-svr3\-shlib\fR" 4
+.IP "\fB\-mno\-svr3\-shlib\fR" 4
.IX Item "-mno-svr3-shlib"
.PD
Control whether \s-1GCC\s0 places uninitialized locals into \f(CW\*(C`bss\*(C'\fR or
\&\f(CW\*(C`data\*(C'\fR. \fB\-msvr3\-shlib\fR places these locals into \f(CW\*(C`bss\*(C'\fR.
These options are meaningful only on System V Release 3.
-.Ip "\fB\-mno-wide-multiply\fR" 4
-.IX Item "-mno-wide-multiply"
-.PD 0
-.Ip "\fB\-mwide-multiply\fR" 4
-.IX Item "-mwide-multiply"
-.PD
-Control whether \s-1GCC\s0 uses the \f(CW\*(C`mul\*(C'\fR and \f(CW\*(C`imul\*(C'\fR that produce
-64 bit results in \f(CW\*(C`eax:edx\*(C'\fR from 32 bit operands to do \f(CW\*(C`long
-long\*(C'\fR multiplies and 32\-bit division by constants.
-.Ip "\fB\-mrtd\fR" 4
+.IP "\fB\-mrtd\fR" 4
.IX Item "-mrtd"
Use a different function-calling convention, in which functions that
take a fixed number of arguments return with the \f(CW\*(C`ret\*(C'\fR \fInum\fR
@@ -5963,14 +6174,16 @@ functions.
In addition, seriously incorrect code will result if you call a
function with too many arguments. (Normally, extra arguments are
harmlessly ignored.)
-.Ip "\fB\-mreg-alloc=\fR\fIregs\fR" 4
+.IP "\fB\-mreg\-alloc=\fR\fIregs\fR" 4
.IX Item "-mreg-alloc=regs"
Control the default allocation order of integer registers. The
string \fIregs\fR is a series of letters specifying a register. The
supported letters are: \f(CW\*(C`a\*(C'\fR allocate \s-1EAX\s0; \f(CW\*(C`b\*(C'\fR allocate \s-1EBX\s0;
\&\f(CW\*(C`c\*(C'\fR allocate \s-1ECX\s0; \f(CW\*(C`d\*(C'\fR allocate \s-1EDX\s0; \f(CW\*(C`S\*(C'\fR allocate \s-1ESI\s0;
\&\f(CW\*(C`D\*(C'\fR allocate \s-1EDI\s0; \f(CW\*(C`B\*(C'\fR allocate \s-1EBP\s0.
-.Ip "\fB\-mregparm=\fR\fInum\fR" 4
+This option is deprecated and will not be supported by future releases
+of gcc.
+.IP "\fB\-mregparm=\fR\fInum\fR" 4
.IX Item "-mregparm=num"
Control how many registers are used to pass integer arguments. By
default, no registers are used to pass arguments, and at most 3
@@ -5981,41 +6194,41 @@ function by using the function attribute \fBregparm\fR.
\&\fInum\fR is nonzero, then you must build all modules with the same
value, including any libraries. This includes the system libraries and
startup modules.
-.Ip "\fB\-malign-loops=\fR\fInum\fR" 4
+.IP "\fB\-malign\-loops=\fR\fInum\fR" 4
.IX Item "-malign-loops=num"
Align loops to a 2 raised to a \fInum\fR byte boundary. If
-\&\fB\-malign-loops\fR is not specified, the default is 2 unless
+\&\fB\-malign\-loops\fR is not specified, the default is 2 unless
gas 2.8 (or later) is being used in which case the default is
to align the loop on a 16 byte boundary if it is less than 8
bytes away.
-.Ip "\fB\-malign-jumps=\fR\fInum\fR" 4
+.IP "\fB\-malign\-jumps=\fR\fInum\fR" 4
.IX Item "-malign-jumps=num"
Align instructions that are only jumped to to a 2 raised to a \fInum\fR
-byte boundary. If \fB\-malign-jumps\fR is not specified, the default is
+byte boundary. If \fB\-malign\-jumps\fR is not specified, the default is
2 if optimizing for a 386, and 4 if optimizing for a 486 unless
gas 2.8 (or later) is being used in which case the default is
to align the instruction on a 16 byte boundary if it is less
than 8 bytes away.
-.Ip "\fB\-malign-functions=\fR\fInum\fR" 4
+.IP "\fB\-malign\-functions=\fR\fInum\fR" 4
.IX Item "-malign-functions=num"
Align the start of functions to a 2 raised to \fInum\fR byte boundary.
-If \fB\-malign-functions\fR is not specified, the default is 2 if optimizing
+If \fB\-malign\-functions\fR is not specified, the default is 2 if optimizing
for a 386, and 4 if optimizing for a 486.
-.Ip "\fB\-mpreferred-stack-boundary=\fR\fInum\fR" 4
+.IP "\fB\-mpreferred\-stack\-boundary=\fR\fInum\fR" 4
.IX Item "-mpreferred-stack-boundary=num"
Attempt to keep the stack boundary aligned to a 2 raised to \fInum\fR
-byte boundary. If \fB\-mpreferred-stack-boundary\fR is not specified,
+byte boundary. If \fB\-mpreferred\-stack\-boundary\fR is not specified,
the default is 4 (16 bytes or 128 bits).
.Sp
The stack is required to be aligned on a 4 byte boundary. On Pentium
and PentiumPro, \f(CW\*(C`double\*(C'\fR and \f(CW\*(C`long double\*(C'\fR values should be
-aligned to an 8 byte boundary (see \fB\-malign-double\fR) or suffer
+aligned to an 8 byte boundary (see \fB\-malign\-double\fR) or suffer
significant run time performance penalties. On Pentium \s-1III\s0, the
Streaming \s-1SIMD\s0 Extension (\s-1SSE\s0) data type \f(CW\*(C`_\|_m128\*(C'\fR suffers similar
penalties if it is not 16 byte aligned.
.Sp
To ensure proper alignment of this values on the stack, the stack boundary
-must be as aligned as that required by any value stored on the stack.
+must be as aligned as that required by any value stored on the stack.
Further, every function must be generated such that it keeps the stack
aligned. Thus calling a function compiled with a higher preferred
stack boundary from a function compiled with a lower preferred stack
@@ -6025,163 +6238,174 @@ libraries that use callbacks always use the default setting.
This extra alignment does consume extra stack space. Code that is sensitive
to stack space usage, such as embedded systems and operating system kernels,
may want to reduce the preferred alignment to
-\&\fB\-mpreferred-stack-boundary=2\fR.
-.Ip "\fB\-mpush-args\fR" 4
+\&\fB\-mpreferred\-stack\-boundary=2\fR.
+.IP "\fB\-mpush\-args\fR" 4
.IX Item "-mpush-args"
-Use \s-1PUSH\s0 operations to store outgoing parameters. This method is shorter
+.PD 0
+.IP "\fB\-mno\-push\-args\fR" 4
+.IX Item "-mno-push-args"
+.PD
+Use \s-1PUSH\s0 operations to store outgoing parameters. This method is shorter
and usually equally fast as method using \s-1SUB/MOV\s0 operations and is enabled
-by default. In some cases disabling it may improve performance because of
+by default. In some cases disabling it may improve performance because of
improved scheduling and reduced dependencies.
-.Ip "\fB\-maccumulate-outgoing-args\fR" 4
+.IP "\fB\-maccumulate\-outgoing\-args\fR" 4
.IX Item "-maccumulate-outgoing-args"
If enabled, the maximum amount of space required for outgoing arguments will be
-computed in the function prologue. This in faster on most modern CPUs
+computed in the function prologue. This is faster on most modern CPUs
because of reduced dependencies, improved scheduling and reduced stack usage
when preferred stack boundary is not equal to 2. The drawback is a notable
-increase in code size. This switch implies \-mno-push-args.
-.Ip "\fB\-mthreads\fR" 4
+increase in code size. This switch implies \fB\-mno\-push\-args\fR.
+.IP "\fB\-mthreads\fR" 4
.IX Item "-mthreads"
-Support thread-safe exception handling on \fBMingw32\fR. Code that relies
-on thread-safe exception handling must compile and link all code with the
-\&\fB\-mthreads\fR option. When compiling, \fB\-mthreads\fR defines
-\&\fB\-D_MT\fR; when linking, it links in a special thread helper library
+Support thread-safe exception handling on \fBMingw32\fR. Code that relies
+on thread-safe exception handling must compile and link all code with the
+\&\fB\-mthreads\fR option. When compiling, \fB\-mthreads\fR defines
+\&\fB\-D_MT\fR; when linking, it links in a special thread helper library
\&\fB\-lmingwthrd\fR which cleans up per thread exception handling data.
-.Ip "\fB\-mno-align-stringops\fR" 4
+.IP "\fB\-mno\-align\-stringops\fR" 4
.IX Item "-mno-align-stringops"
-Do not align destination of inlined string operations. This switch reduces
+Do not align destination of inlined string operations. This switch reduces
code size and improves performance in case the destination is already aligned,
but gcc don't know about it.
-.Ip "\fB\-minline-all-stringops\fR" 4
+.IP "\fB\-minline\-all\-stringops\fR" 4
.IX Item "-minline-all-stringops"
By default \s-1GCC\s0 inlines string operations only when destination is known to be
-aligned at least to 4 byte boundary. This enables more inlining, increase code
+aligned at least to 4 byte boundary. This enables more inlining, increase code
size, but may improve performance of code that depends on fast memcpy, strlen
and memset for short lengths.
+.IP "\fB\-momit\-leaf\-frame\-pointer\fR" 4
+.IX Item "-momit-leaf-frame-pointer"
+Don't keep the frame pointer in a register for leaf functions. This
+avoids the instructions to save, set up and restore frame pointers and
+makes an extra register available in leaf functions. The option
+\&\fB\-fomit\-frame\-pointer\fR removes the frame pointer for all functions
+which might make debugging harder.
.PP
-.I "\s-1HPPA\s0 Options"
+\fI\s-1HPPA\s0 Options\fR
.IX Subsection "HPPA Options"
.PP
These \fB\-m\fR options are defined for the \s-1HPPA\s0 family of computers:
-.Ip "\fB\-march=\fR\fIarchitecture type\fR" 4
-.IX Item "-march=architecture type"
+.IP "\fB\-march=\fR\fIarchitecture-type\fR" 4
+.IX Item "-march=architecture-type"
Generate code for the specified architecture. The choices for
-\&\fIarchitecture type\fR are \fB1.0\fR for \s-1PA\s0 1.0, \fB1.1\fR for \s-1PA\s0
+\&\fIarchitecture-type\fR are \fB1.0\fR for \s-1PA\s0 1.0, \fB1.1\fR for \s-1PA\s0
1.1, and \fB2.0\fR for \s-1PA\s0 2.0 processors. Refer to
-\&\fI/usr/lib/sched.models\fR on an \s-1HP-UX\s0 system to determine the proper
+\&\fI/usr/lib/sched.models\fR on an HP-UX system to determine the proper
architecture option for your machine. Code compiled for lower numbered
architectures will run on higher numbered architectures, but not the
other way around.
.Sp
\&\s-1PA\s0 2.0 support currently requires gas snapshot 19990413 or later. The
next release of binutils (current is 2.9.1) will probably contain \s-1PA\s0 2.0
-support.
-.Ip "\fB\-mpa-risc-1\-0\fR" 4
+support.
+.IP "\fB\-mpa\-risc\-1\-0\fR" 4
.IX Item "-mpa-risc-1-0"
.PD 0
-.Ip "\fB\-mpa-risc-1\-1\fR" 4
+.IP "\fB\-mpa\-risc\-1\-1\fR" 4
.IX Item "-mpa-risc-1-1"
-.Ip "\fB\-mpa-risc-2\-0\fR" 4
+.IP "\fB\-mpa\-risc\-2\-0\fR" 4
.IX Item "-mpa-risc-2-0"
.PD
-Synonyms for \-march=1.0, \-march=1.1, and \-march=2.0 respectively.
-.Ip "\fB\-mbig-switch\fR" 4
+Synonyms for \fB\-march=1.0\fR, \fB\-march=1.1\fR, and \fB\-march=2.0\fR respectively.
+.IP "\fB\-mbig\-switch\fR" 4
.IX Item "-mbig-switch"
Generate code suitable for big switch tables. Use this option only if
the assembler/linker complain about out of range branches within a switch
table.
-.Ip "\fB\-mjump-in-delay\fR" 4
+.IP "\fB\-mjump\-in\-delay\fR" 4
.IX Item "-mjump-in-delay"
Fill delay slots of function calls with unconditional jump instructions
by modifying the return pointer for the function call to be the target
of the conditional jump.
-.Ip "\fB\-mdisable-fpregs\fR" 4
+.IP "\fB\-mdisable\-fpregs\fR" 4
.IX Item "-mdisable-fpregs"
Prevent floating point registers from being used in any manner. This is
necessary for compiling kernels which perform lazy context switching of
floating point registers. If you use this option and attempt to perform
floating point operations, the compiler will abort.
-.Ip "\fB\-mdisable-indexing\fR" 4
+.IP "\fB\-mdisable\-indexing\fR" 4
.IX Item "-mdisable-indexing"
Prevent the compiler from using indexing address modes. This avoids some
rather obscure problems when compiling \s-1MIG\s0 generated code under \s-1MACH\s0.
-.Ip "\fB\-mno-space-regs\fR" 4
+.IP "\fB\-mno\-space\-regs\fR" 4
.IX Item "-mno-space-regs"
Generate code that assumes the target has no space registers. This allows
\&\s-1GCC\s0 to generate faster indirect calls and use unscaled index address modes.
.Sp
Such code is suitable for level 0 \s-1PA\s0 systems and kernels.
-.Ip "\fB\-mfast-indirect-calls\fR" 4
+.IP "\fB\-mfast\-indirect\-calls\fR" 4
.IX Item "-mfast-indirect-calls"
Generate code that assumes calls never cross space boundaries. This
allows \s-1GCC\s0 to emit code which performs faster indirect calls.
.Sp
This option will not work in the presence of shared libraries or nested
functions.
-.Ip "\fB\-mlong-load-store\fR" 4
+.IP "\fB\-mlong\-load\-store\fR" 4
.IX Item "-mlong-load-store"
Generate 3\-instruction load and store sequences as sometimes required by
-the \s-1HP-UX\s0 10 linker. This is equivalent to the \fB+k\fR option to
+the HP-UX 10 linker. This is equivalent to the \fB+k\fR option to
the \s-1HP\s0 compilers.
-.Ip "\fB\-mportable-runtime\fR" 4
+.IP "\fB\-mportable\-runtime\fR" 4
.IX Item "-mportable-runtime"
Use the portable calling conventions proposed by \s-1HP\s0 for \s-1ELF\s0 systems.
-.Ip "\fB\-mgas\fR" 4
+.IP "\fB\-mgas\fR" 4
.IX Item "-mgas"
Enable the use of assembler directives only \s-1GAS\s0 understands.
-.Ip "\fB\-mschedule=\fR\fIcpu type\fR" 4
-.IX Item "-mschedule=cpu type"
+.IP "\fB\-mschedule=\fR\fIcpu-type\fR" 4
+.IX Item "-mschedule=cpu-type"
Schedule code according to the constraints for the machine type
-\&\fIcpu type\fR. The choices for \fIcpu type\fR are \fB700\fR
-\&\fB7100\fR, \fB7100LC\fR, \fB7200\fR, and \fB8000\fR. Refer to
-\&\fI/usr/lib/sched.models\fR on an \s-1HP-UX\s0 system to determine the
+\&\fIcpu-type\fR. The choices for \fIcpu-type\fR are \fB700\fR
+\&\fB7100\fR, \fB7100LC\fR, \fB7200\fR, and \fB8000\fR. Refer to
+\&\fI/usr/lib/sched.models\fR on an HP-UX system to determine the
proper scheduling option for your machine.
-.Ip "\fB\-mlinker-opt\fR" 4
+.IP "\fB\-mlinker\-opt\fR" 4
.IX Item "-mlinker-opt"
Enable the optimization pass in the \s-1HPUX\s0 linker. Note this makes symbolic
debugging impossible. It also triggers a bug in the \s-1HPUX\s0 8 and \s-1HPUX\s0 9 linkers
in which they give bogus error messages when linking some programs.
-.Ip "\fB\-msoft-float\fR" 4
+.IP "\fB\-msoft\-float\fR" 4
.IX Item "-msoft-float"
Generate output containing library calls for floating point.
\&\fBWarning:\fR the requisite libraries are not available for all \s-1HPPA\s0
targets. Normally the facilities of the machine's usual C compiler are
-used, but this cannot be done directly in cross-compilation. You must make
+used, but this cannot be done directly in cross\-compilation. You must make
your own arrangements to provide suitable library functions for
-cross-compilation. The embedded target \fBhppa1.1\-*\-pro\fR
+cross\-compilation. The embedded target \fBhppa1.1\-*\-pro\fR
does provide software floating point support.
.Sp
-\&\fB\-msoft-float\fR changes the calling convention in the output file;
+\&\fB\-msoft\-float\fR changes the calling convention in the output file;
therefore, it is only useful if you compile \fIall\fR of a program with
this option. In particular, you need to compile \fIlibgcc.a\fR, the
-library that comes with \s-1GCC\s0, with \fB\-msoft-float\fR in order for
+library that comes with \s-1GCC\s0, with \fB\-msoft\-float\fR in order for
this to work.
.PP
-.I "Intel 960 Options"
+\fIIntel 960 Options\fR
.IX Subsection "Intel 960 Options"
.PP
These \fB\-m\fR options are defined for the Intel 960 implementations:
-.Ip "\fB\-m\fR\fIcpu type\fR" 4
-.IX Item "-mcpu type"
-Assume the defaults for the machine type \fIcpu type\fR for some of
+.IP "\fB\-m\fR\fIcpu-type\fR" 4
+.IX Item "-mcpu-type"
+Assume the defaults for the machine type \fIcpu-type\fR for some of
the other options, including instruction scheduling, floating point
-support, and addressing modes. The choices for \fIcpu type\fR are
+support, and addressing modes. The choices for \fIcpu-type\fR are
\&\fBka\fR, \fBkb\fR, \fBmc\fR, \fBca\fR, \fBcf\fR,
\&\fBsa\fR, and \fBsb\fR.
The default is
\&\fBkb\fR.
-.Ip "\fB\-mnumerics\fR" 4
+.IP "\fB\-mnumerics\fR" 4
.IX Item "-mnumerics"
.PD 0
-.Ip "\fB\-msoft-float\fR" 4
+.IP "\fB\-msoft\-float\fR" 4
.IX Item "-msoft-float"
.PD
The \fB\-mnumerics\fR option indicates that the processor does support
-floating-point instructions. The \fB\-msoft-float\fR option indicates
+floating-point instructions. The \fB\-msoft\-float\fR option indicates
that floating-point support should not be assumed.
-.Ip "\fB\-mleaf-procedures\fR" 4
+.IP "\fB\-mleaf\-procedures\fR" 4
.IX Item "-mleaf-procedures"
.PD 0
-.Ip "\fB\-mno-leaf-procedures\fR" 4
+.IP "\fB\-mno\-leaf\-procedures\fR" 4
.IX Item "-mno-leaf-procedures"
.PD
Do (or do not) attempt to alter leaf procedures to be callable with the
@@ -6190,84 +6414,84 @@ efficient code for explicit calls when the \f(CW\*(C`bal\*(C'\fR instruction can
substituted by the assembler or linker, but less efficient code in other
cases, such as calls via function pointers, or using a linker that doesn't
support this optimization.
-.Ip "\fB\-mtail-call\fR" 4
+.IP "\fB\-mtail\-call\fR" 4
.IX Item "-mtail-call"
.PD 0
-.Ip "\fB\-mno-tail-call\fR" 4
+.IP "\fB\-mno\-tail\-call\fR" 4
.IX Item "-mno-tail-call"
.PD
Do (or do not) make additional attempts (beyond those of the
machine-independent portions of the compiler) to optimize tail-recursive
calls into branches. You may not want to do this because the detection of
cases where this is not valid is not totally complete. The default is
-\&\fB\-mno-tail-call\fR.
-.Ip "\fB\-mcomplex-addr\fR" 4
+\&\fB\-mno\-tail\-call\fR.
+.IP "\fB\-mcomplex\-addr\fR" 4
.IX Item "-mcomplex-addr"
.PD 0
-.Ip "\fB\-mno-complex-addr\fR" 4
+.IP "\fB\-mno\-complex\-addr\fR" 4
.IX Item "-mno-complex-addr"
.PD
Assume (or do not assume) that the use of a complex addressing mode is a
win on this implementation of the i960. Complex addressing modes may not
-be worthwhile on the K-series, but they definitely are on the C-series.
-The default is currently \fB\-mcomplex-addr\fR for all processors except
+be worthwhile on the K\-series, but they definitely are on the C\-series.
+The default is currently \fB\-mcomplex\-addr\fR for all processors except
the \s-1CB\s0 and \s-1CC\s0.
-.Ip "\fB\-mcode-align\fR" 4
+.IP "\fB\-mcode\-align\fR" 4
.IX Item "-mcode-align"
.PD 0
-.Ip "\fB\-mno-code-align\fR" 4
+.IP "\fB\-mno\-code\-align\fR" 4
.IX Item "-mno-code-align"
.PD
Align code to 8\-byte boundaries for faster fetching (or don't bother).
-Currently turned on by default for C-series implementations only.
-.Ip "\fB\-mic-compat\fR" 4
+Currently turned on by default for C\-series implementations only.
+.IP "\fB\-mic\-compat\fR" 4
.IX Item "-mic-compat"
.PD 0
-.Ip "\fB\-mic2.0\-compat\fR" 4
+.IP "\fB\-mic2.0\-compat\fR" 4
.IX Item "-mic2.0-compat"
-.Ip "\fB\-mic3.0\-compat\fR" 4
+.IP "\fB\-mic3.0\-compat\fR" 4
.IX Item "-mic3.0-compat"
.PD
Enable compatibility with iC960 v2.0 or v3.0.
-.Ip "\fB\-masm-compat\fR" 4
+.IP "\fB\-masm\-compat\fR" 4
.IX Item "-masm-compat"
.PD 0
-.Ip "\fB\-mintel-asm\fR" 4
+.IP "\fB\-mintel\-asm\fR" 4
.IX Item "-mintel-asm"
.PD
Enable compatibility with the iC960 assembler.
-.Ip "\fB\-mstrict-align\fR" 4
+.IP "\fB\-mstrict\-align\fR" 4
.IX Item "-mstrict-align"
.PD 0
-.Ip "\fB\-mno-strict-align\fR" 4
+.IP "\fB\-mno\-strict\-align\fR" 4
.IX Item "-mno-strict-align"
.PD
Do not permit (do permit) unaligned accesses.
-.Ip "\fB\-mold-align\fR" 4
+.IP "\fB\-mold\-align\fR" 4
.IX Item "-mold-align"
Enable structure-alignment compatibility with Intel's gcc release version
-1.3 (based on gcc 1.37). This option implies \fB\-mstrict-align\fR.
-.Ip "\fB\-mlong-double-64\fR" 4
+1.3 (based on gcc 1.37). This option implies \fB\-mstrict\-align\fR.
+.IP "\fB\-mlong\-double\-64\fR" 4
.IX Item "-mlong-double-64"
Implement type \fBlong double\fR as 64\-bit floating point numbers.
Without the option \fBlong double\fR is implemented by 80\-bit
floating point numbers. The only reason we have it because there is
-no 128\-bit \fBlong double\fR support in \fBfp-bit.c\fR yet. So it
+no 128\-bit \fBlong double\fR support in \fBfp\-bit.c\fR yet. So it
is only useful for people using soft-float targets. Otherwise, we
should recommend against use of it.
.PP
-.I "\s-1DEC\s0 Alpha Options"
+\fI\s-1DEC\s0 Alpha Options\fR
.IX Subsection "DEC Alpha Options"
.PP
These \fB\-m\fR options are defined for the \s-1DEC\s0 Alpha implementations:
-.Ip "\fB\-mno-soft-float\fR" 4
+.IP "\fB\-mno\-soft\-float\fR" 4
.IX Item "-mno-soft-float"
.PD 0
-.Ip "\fB\-msoft-float\fR" 4
+.IP "\fB\-msoft\-float\fR" 4
.IX Item "-msoft-float"
.PD
Use (do not use) the hardware floating-point instructions for
-floating-point operations. When \fB\-msoft-float\fR is specified,
+floating-point operations. When \fB\-msoft\-float\fR is specified,
functions in \fIlibgcc1.c\fR will be used to perform floating-point
operations. Unless they are replaced by routines that emulate the
floating-point operations, or compiled in such a way as to call such
@@ -6278,94 +6502,94 @@ them.
.Sp
Note that Alpha implementations without floating-point operations are
required to have floating-point registers.
-.Ip "\fB\-mfp-reg\fR" 4
+.IP "\fB\-mfp\-reg\fR" 4
.IX Item "-mfp-reg"
.PD 0
-.Ip "\fB\-mno-fp-regs\fR" 4
+.IP "\fB\-mno\-fp\-regs\fR" 4
.IX Item "-mno-fp-regs"
.PD
Generate code that uses (does not use) the floating-point register set.
-\&\fB\-mno-fp-regs\fR implies \fB\-msoft-float\fR. If the floating-point
+\&\fB\-mno\-fp\-regs\fR implies \fB\-msoft\-float\fR. If the floating-point
register set is not used, floating point operands are passed in integer
registers as if they were integers and floating-point results are passed
in \f(CW$0\fR instead of \f(CW$f0\fR. This is a non-standard calling sequence, so any
function with a floating-point argument or return value called by code
-compiled with \fB\-mno-fp-regs\fR must also be compiled with that
+compiled with \fB\-mno\-fp\-regs\fR must also be compiled with that
option.
.Sp
A typical use of this option is building a kernel that does not use,
and hence need not save and restore, any floating-point registers.
-.Ip "\fB\-mieee\fR" 4
+.IP "\fB\-mieee\fR" 4
.IX Item "-mieee"
The Alpha architecture implements floating-point hardware optimized for
maximum performance. It is mostly compliant with the \s-1IEEE\s0 floating
point standard. However, for full compliance, software assistance is
required. This option generates code fully \s-1IEEE\s0 compliant code
-\&\fIexcept\fR that the \fIinexact flag\fR is not maintained (see below).
+\&\fIexcept\fR that the \fIinexact-flag\fR is not maintained (see below).
If this option is turned on, the \s-1CPP\s0 macro \f(CW\*(C`_IEEE_FP\*(C'\fR is defined
during compilation. The option is a shorthand for: \fB\-D_IEEE_FP
-\&\-mfp-trap-mode=su \-mtrap-precision=i \-mieee-conformant\fR. The resulting
+\&\-mfp\-trap\-mode=su \-mtrap\-precision=i \-mieee\-conformant\fR. The resulting
code is less efficient but is able to correctly support denormalized
numbers and exceptional \s-1IEEE\s0 values such as not-a-number and plus/minus
infinity. Other Alpha compilers call this option
\&\fB\-ieee_with_no_inexact\fR.
-.Ip "\fB\-mieee-with-inexact\fR" 4
+.IP "\fB\-mieee\-with\-inexact\fR" 4
.IX Item "-mieee-with-inexact"
This is like \fB\-mieee\fR except the generated code also maintains the
-\&\s-1IEEE\s0 \fIinexact flag\fR. Turning on this option causes the generated
+\&\s-1IEEE\s0 \fIinexact-flag\fR. Turning on this option causes the generated
code to implement fully-compliant \s-1IEEE\s0 math. The option is a shorthand
for \fB\-D_IEEE_FP \-D_IEEE_FP_INEXACT\fR plus the three following:
-\&\fB\-mieee-conformant\fR,
-\&\fB\-mfp-trap-mode=sui\fR,
-and \fB\-mtrap-precision=i\fR.
+\&\fB\-mieee\-conformant\fR,
+\&\fB\-mfp\-trap\-mode=sui\fR,
+and \fB\-mtrap\-precision=i\fR.
On some Alpha implementations the resulting code may execute
significantly slower than the code generated by default. Since there
-is very little code that depends on the \fIinexact flag\fR, you should
+is very little code that depends on the \fIinexact-flag\fR, you should
normally not specify this option. Other Alpha compilers call this
option \fB\-ieee_with_inexact\fR.
-.Ip "\fB\-mfp-trap-mode=\fR\fItrap mode\fR" 4
-.IX Item "-mfp-trap-mode=trap mode"
+.IP "\fB\-mfp\-trap\-mode=\fR\fItrap-mode\fR" 4
+.IX Item "-mfp-trap-mode=trap-mode"
This option controls what floating-point related traps are enabled.
-Other Alpha compilers call this option \fB\-fptm\fR \fItrap mode\fR.
+Other Alpha compilers call this option \fB\-fptm\fR \fItrap-mode\fR.
The trap mode can be set to one of four values:
.RS 4
-.Ip "\fBn\fR" 4
+.IP "\fBn\fR" 4
.IX Item "n"
This is the default (normal) setting. The only traps that are enabled
are the ones that cannot be disabled in software (e.g., division by zero
trap).
-.Ip "\fBu\fR" 4
+.IP "\fBu\fR" 4
.IX Item "u"
In addition to the traps enabled by \fBn\fR, underflow traps are enabled
as well.
-.Ip "\fBsu\fR" 4
+.IP "\fBsu\fR" 4
.IX Item "su"
Like \fBsu\fR, but the instructions are marked to be safe for software
completion (see Alpha architecture manual for details).
-.Ip "\fBsui\fR" 4
+.IP "\fBsui\fR" 4
.IX Item "sui"
Like \fBsu\fR, but inexact traps are enabled as well.
.RE
.RS 4
.RE
-.Ip "\fB\-mfp-rounding-mode=\fR\fIrounding mode\fR" 4
-.IX Item "-mfp-rounding-mode=rounding mode"
+.IP "\fB\-mfp\-rounding\-mode=\fR\fIrounding-mode\fR" 4
+.IX Item "-mfp-rounding-mode=rounding-mode"
Selects the \s-1IEEE\s0 rounding mode. Other Alpha compilers call this option
-\&\fB\-fprm\fR \fIrounding mode\fR. The \fIrounding mode\fR can be one
+\&\fB\-fprm\fR \fIrounding-mode\fR. The \fIrounding-mode\fR can be one
of:
.RS 4
-.Ip "\fBn\fR" 4
+.IP "\fBn\fR" 4
.IX Item "n"
Normal \s-1IEEE\s0 rounding mode. Floating point numbers are rounded towards
the nearest machine number or towards the even machine number in case
of a tie.
-.Ip "\fBm\fR" 4
+.IP "\fBm\fR" 4
.IX Item "m"
Round towards minus infinity.
-.Ip "\fBc\fR" 4
+.IP "\fBc\fR" 4
.IX Item "c"
Chopped rounding mode. Floating point numbers are rounded towards zero.
-.Ip "\fBd\fR" 4
+.IP "\fBd\fR" 4
.IX Item "d"
Dynamic rounding mode. A field in the floating point control register
(\fIfpcr\fR, see Alpha architecture reference manual) controls the
@@ -6375,8 +6599,8 @@ rounding towards plus infinity. Thus, unless your program modifies the
.RE
.RS 4
.RE
-.Ip "\fB\-mtrap-precision=\fR\fItrap precision\fR" 4
-.IX Item "-mtrap-precision=trap precision"
+.IP "\fB\-mtrap\-precision=\fR\fItrap-precision\fR" 4
+.IX Item "-mtrap-precision=trap-precision"
In the Alpha architecture, floating point traps are imprecise. This
means without software assistance it is impossible to recover from a
floating trap and program execution normally needs to be terminated.
@@ -6385,15 +6609,15 @@ in determining the exact location that caused a floating point trap.
Depending on the requirements of an application, different levels of
precisions can be selected:
.RS 4
-.Ip "\fBp\fR" 4
+.IP "\fBp\fR" 4
.IX Item "p"
Program precision. This option is the default and means a trap handler
can only identify which program caused a floating point exception.
-.Ip "\fBf\fR" 4
+.IP "\fBf\fR" 4
.IX Item "f"
Function precision. The trap handler can determine the function that
caused a floating point exception.
-.Ip "\fBi\fR" 4
+.IP "\fBi\fR" 4
.IX Item "i"
Instruction precision. The trap handler can determine the exact
instruction that caused a floating point exception.
@@ -6403,15 +6627,15 @@ instruction that caused a floating point exception.
Other Alpha compilers provide the equivalent options called
\&\fB\-scope_safe\fR and \fB\-resumption_safe\fR.
.RE
-.Ip "\fB\-mieee-conformant\fR" 4
+.IP "\fB\-mieee\-conformant\fR" 4
.IX Item "-mieee-conformant"
This option marks the generated code as \s-1IEEE\s0 conformant. You must not
-use this option unless you also specify \fB\-mtrap-precision=i\fR and either
-\&\fB\-mfp-trap-mode=su\fR or \fB\-mfp-trap-mode=sui\fR. Its only effect
+use this option unless you also specify \fB\-mtrap\-precision=i\fR and either
+\&\fB\-mfp\-trap\-mode=su\fR or \fB\-mfp\-trap\-mode=sui\fR. Its only effect
is to emit the line \fB.eflag 48\fR in the function prologue of the
generated assembly file. Under \s-1DEC\s0 Unix, this has the effect that
IEEE-conformant math library routines will be linked in.
-.Ip "\fB\-mbuild-constants\fR" 4
+.IP "\fB\-mbuild\-constants\fR" 4
.IX Item "-mbuild-constants"
Normally \s-1GCC\s0 examines a 32\- or 64\-bit integer constant to
see if it can construct it from smaller constants in two or three
@@ -6424,33 +6648,33 @@ using code, even if it takes more instructions (the maximum is six).
You would typically use this option to build a shared library dynamic
loader. Itself a shared library, it must relocate itself in memory
before it can find the variables and constants in its own data segment.
-.Ip "\fB\-malpha-as\fR" 4
+.IP "\fB\-malpha\-as\fR" 4
.IX Item "-malpha-as"
.PD 0
-.Ip "\fB\-mgas\fR" 4
+.IP "\fB\-mgas\fR" 4
.IX Item "-mgas"
.PD
Select whether to generate code to be assembled by the vendor-supplied
-assembler (\fB\-malpha-as\fR) or by the \s-1GNU\s0 assembler \fB\-mgas\fR.
-.Ip "\fB\-mbwx\fR" 4
+assembler (\fB\-malpha\-as\fR) or by the \s-1GNU\s0 assembler \fB\-mgas\fR.
+.IP "\fB\-mbwx\fR" 4
.IX Item "-mbwx"
.PD 0
-.Ip "\fB\-mno-bwx\fR" 4
+.IP "\fB\-mno\-bwx\fR" 4
.IX Item "-mno-bwx"
-.Ip "\fB\-mcix\fR" 4
+.IP "\fB\-mcix\fR" 4
.IX Item "-mcix"
-.Ip "\fB\-mno-cix\fR" 4
+.IP "\fB\-mno\-cix\fR" 4
.IX Item "-mno-cix"
-.Ip "\fB\-mmax\fR" 4
+.IP "\fB\-mmax\fR" 4
.IX Item "-mmax"
-.Ip "\fB\-mno-max\fR" 4
+.IP "\fB\-mno\-max\fR" 4
.IX Item "-mno-max"
.PD
Indicate whether \s-1GCC\s0 should generate code to use the optional \s-1BWX\s0,
\&\s-1CIX\s0, and \s-1MAX\s0 instruction sets. The default is to use the instruction sets
supported by the \s-1CPU\s0 type specified via \fB\-mcpu=\fR option or that
of the \s-1CPU\s0 on which \s-1GCC\s0 was built if none was specified.
-.Ip "\fB\-mcpu=\fR\fIcpu_type\fR" 4
+.IP "\fB\-mcpu=\fR\fIcpu_type\fR" 4
.IX Item "-mcpu=cpu_type"
Set the instruction set, register set, and instruction scheduling
parameters for machine type \fIcpu_type\fR. You can specify either the
@@ -6462,40 +6686,40 @@ the processor you specify. If you do not specify a processor type,
.Sp
Supported values for \fIcpu_type\fR are
.RS 4
-.Ip "\fBev4\fR" 4
+.IP "\fBev4\fR" 4
.IX Item "ev4"
.PD 0
-.Ip "\fB21064\fR" 4
+.IP "\fB21064\fR" 4
.IX Item "21064"
.PD
Schedules as an \s-1EV4\s0 and has no instruction set extensions.
-.Ip "\fBev5\fR" 4
+.IP "\fBev5\fR" 4
.IX Item "ev5"
.PD 0
-.Ip "\fB21164\fR" 4
+.IP "\fB21164\fR" 4
.IX Item "21164"
.PD
Schedules as an \s-1EV5\s0 and has no instruction set extensions.
-.Ip "\fBev56\fR" 4
+.IP "\fBev56\fR" 4
.IX Item "ev56"
.PD 0
-.Ip "\fB21164a\fR" 4
+.IP "\fB21164a\fR" 4
.IX Item "21164a"
.PD
Schedules as an \s-1EV5\s0 and supports the \s-1BWX\s0 extension.
-.Ip "\fBpca56\fR" 4
+.IP "\fBpca56\fR" 4
.IX Item "pca56"
.PD 0
-.Ip "\fB21164pc\fR" 4
+.IP "\fB21164pc\fR" 4
.IX Item "21164pc"
-.Ip "\fB21164PC\fR" 4
+.IP "\fB21164PC\fR" 4
.IX Item "21164PC"
.PD
Schedules as an \s-1EV5\s0 and supports the \s-1BWX\s0 and \s-1MAX\s0 extensions.
-.Ip "\fBev6\fR" 4
+.IP "\fBev6\fR" 4
.IX Item "ev6"
.PD 0
-.Ip "\fB21264\fR" 4
+.IP "\fB21264\fR" 4
.IX Item "21264"
.PD
Schedules as an \s-1EV5\s0 (until Digital releases the scheduling parameters
@@ -6503,7 +6727,7 @@ for the \s-1EV6\s0) and supports the \s-1BWX\s0, \s-1CIX\s0, and \s-1MAX\s0 exte
.RE
.RS 4
.RE
-.Ip "\fB\-mmemory-latency=\fR\fItime\fR" 4
+.IP "\fB\-mmemory\-latency=\fR\fItime\fR" 4
.IX Item "-mmemory-latency=time"
Sets the latency the scheduler should assume for typical memory
references as seen by the application. This number is highly
@@ -6512,17 +6736,17 @@ and the size of the external cache on the machine.
.Sp
Valid options for \fItime\fR are
.RS 4
-.Ip "\fInumber\fR" 4
+.IP "\fInumber\fR" 4
.IX Item "number"
A decimal number representing clock cycles.
-.Ip "\fBL1\fR" 4
+.IP "\fBL1\fR" 4
.IX Item "L1"
.PD 0
-.Ip "\fBL2\fR" 4
+.IP "\fBL2\fR" 4
.IX Item "L2"
-.Ip "\fBL3\fR" 4
+.IP "\fBL3\fR" 4
.IX Item "L3"
-.Ip "\fBmain\fR" 4
+.IP "\fBmain\fR" 4
.IX Item "main"
.PD
The compiler contains estimates of the number of clock cycles for
@@ -6533,171 +6757,174 @@ Note that L3 is only valid for \s-1EV5\s0.
.RS 4
.RE
.PP
-.I "Clipper Options"
+\fIClipper Options\fR
.IX Subsection "Clipper Options"
.PP
These \fB\-m\fR options are defined for the Clipper implementations:
-.Ip "\fB\-mc300\fR" 4
+.IP "\fB\-mc300\fR" 4
.IX Item "-mc300"
-Produce code for a C300 Clipper processor. This is the default.
-.Ip "\fB\-mc400\fR" 4
+Produce code for a C300 Clipper processor. This is the default.
+.IP "\fB\-mc400\fR" 4
.IX Item "-mc400"
Produce code for a C400 Clipper processor i.e. use floating point
-registers f8..f15.
+registers f8\-\-\-f15.
.PP
-.I "H8/300 Options"
+\fIH8/300 Options\fR
.IX Subsection "H8/300 Options"
.PP
These \fB\-m\fR options are defined for the H8/300 implementations:
-.Ip "\fB\-mrelax\fR" 4
+.IP "\fB\-mrelax\fR" 4
.IX Item "-mrelax"
Shorten some address references at link time, when possible; uses the
linker option \fB\-relax\fR.
-.Ip "\fB\-mh\fR" 4
+.IP "\fB\-mh\fR" 4
.IX Item "-mh"
Generate code for the H8/300H.
-.Ip "\fB\-ms\fR" 4
+.IP "\fB\-ms\fR" 4
.IX Item "-ms"
Generate code for the H8/S.
-.Ip "\fB\-ms2600\fR" 4
+.IP "\fB\-ms2600\fR" 4
.IX Item "-ms2600"
-Generate code for the H8/S2600. This switch must be used with \-ms.
-.Ip "\fB\-mint32\fR" 4
+Generate code for the H8/S2600. This switch must be used with \fB\-ms\fR.
+.IP "\fB\-mint32\fR" 4
.IX Item "-mint32"
Make \f(CW\*(C`int\*(C'\fR data 32 bits by default.
-.Ip "\fB\-malign-300\fR" 4
+.IP "\fB\-malign\-300\fR" 4
.IX Item "-malign-300"
On the H8/300H and H8/S, use the same alignment rules as for the H8/300.
The default for the H8/300H and H8/S is to align longs and floats on 4
byte boundaries.
-\&\fB\-malign-300\fR causes them to be aligned on 2 byte boundaries.
+\&\fB\-malign\-300\fR causes them to be aligned on 2 byte boundaries.
This option has no effect on the H8/300.
.PP
-.I "\s-1SH\s0 Options"
+\fI\s-1SH\s0 Options\fR
.IX Subsection "SH Options"
.PP
These \fB\-m\fR options are defined for the \s-1SH\s0 implementations:
-.Ip "\fB\-m1\fR" 4
+.IP "\fB\-m1\fR" 4
.IX Item "-m1"
Generate code for the \s-1SH1\s0.
-.Ip "\fB\-m2\fR" 4
+.IP "\fB\-m2\fR" 4
.IX Item "-m2"
Generate code for the \s-1SH2\s0.
-.Ip "\fB\-m3\fR" 4
+.IP "\fB\-m3\fR" 4
.IX Item "-m3"
Generate code for the \s-1SH3\s0.
-.Ip "\fB\-m3e\fR" 4
+.IP "\fB\-m3e\fR" 4
.IX Item "-m3e"
Generate code for the SH3e.
-.Ip "\fB\-m4\-nofpu\fR" 4
+.IP "\fB\-m4\-nofpu\fR" 4
.IX Item "-m4-nofpu"
Generate code for the \s-1SH4\s0 without a floating-point unit.
-.Ip "\fB\-m4\-single-only\fR" 4
+.IP "\fB\-m4\-single\-only\fR" 4
.IX Item "-m4-single-only"
Generate code for the \s-1SH4\s0 with a floating-point unit that only
-supports single-precision arithmentic.
-.Ip "\fB\-m4\-single\fR" 4
+supports single-precision arithmetic.
+.IP "\fB\-m4\-single\fR" 4
.IX Item "-m4-single"
Generate code for the \s-1SH4\s0 assuming the floating-point unit is in
single-precision mode by default.
-.Ip "\fB\-m4\fR" 4
+.IP "\fB\-m4\fR" 4
.IX Item "-m4"
Generate code for the \s-1SH4\s0.
-.Ip "\fB\-mb\fR" 4
+.IP "\fB\-mb\fR" 4
.IX Item "-mb"
Compile code for the processor in big endian mode.
-.Ip "\fB\-ml\fR" 4
+.IP "\fB\-ml\fR" 4
.IX Item "-ml"
Compile code for the processor in little endian mode.
-.Ip "\fB\-mdalign\fR" 4
+.IP "\fB\-mdalign\fR" 4
.IX Item "-mdalign"
-Align doubles at 64 bit boundaries. Note that this changes the calling
+Align doubles at 64\-bit boundaries. Note that this changes the calling
conventions, and thus some functions from the standard C library will
-not work unless you recompile it first with \-mdalign.
-.Ip "\fB\-mrelax\fR" 4
+not work unless you recompile it first with \fB\-mdalign\fR.
+.IP "\fB\-mrelax\fR" 4
.IX Item "-mrelax"
Shorten some address references at link time, when possible; uses the
linker option \fB\-relax\fR.
-.Ip "\fB\-mbigtable\fR" 4
+.IP "\fB\-mbigtable\fR" 4
.IX Item "-mbigtable"
Use 32\-bit offsets in \f(CW\*(C`switch\*(C'\fR tables. The default is to use
16\-bit offsets.
-.Ip "\fB\-mfmovd\fR" 4
+.IP "\fB\-mfmovd\fR" 4
.IX Item "-mfmovd"
Enable the use of the instruction \f(CW\*(C`fmovd\*(C'\fR.
-.Ip "\fB\-mhitachi\fR" 4
+.IP "\fB\-mhitachi\fR" 4
.IX Item "-mhitachi"
Comply with the calling conventions defined by Hitachi.
-.Ip "\fB\-mnomacsave\fR" 4
+.IP "\fB\-mnomacsave\fR" 4
.IX Item "-mnomacsave"
-Mark the \f(CW\*(C`MAC\*(C'\fR register as call-clobbered, even if
+Mark the \f(CW\*(C`MAC\*(C'\fR register as call\-clobbered, even if
\&\fB\-mhitachi\fR is given.
-.Ip "\fB\-misize\fR" 4
+.IP "\fB\-mieee\fR" 4
+.IX Item "-mieee"
+Increase IEEE-compliance of floating-point code.
+.IP "\fB\-misize\fR" 4
.IX Item "-misize"
Dump instruction size and location in the assembly code.
-.Ip "\fB\-mpadstruct\fR" 4
+.IP "\fB\-mpadstruct\fR" 4
.IX Item "-mpadstruct"
This option is deprecated. It pads structures to multiple of 4 bytes,
which is incompatible with the \s-1SH\s0 \s-1ABI\s0.
-.Ip "\fB\-mspace\fR" 4
+.IP "\fB\-mspace\fR" 4
.IX Item "-mspace"
Optimize for space instead of speed. Implied by \fB\-Os\fR.
-.Ip "\fB\-mprefergot\fR" 4
+.IP "\fB\-mprefergot\fR" 4
.IX Item "-mprefergot"
When generating position-independent code, emit function calls using
the Global Offset Table instead of the Procedure Linkage Table.
-.Ip "\fB\-musermode\fR" 4
+.IP "\fB\-musermode\fR" 4
.IX Item "-musermode"
Generate a library function call to invalidate instruction cache
entries, after fixing up a trampoline. This library function call
doesn't assume it can write to the whole memory address space. This
is the default when the target is \f(CW\*(C`sh\-*\-linux*\*(C'\fR.
.PP
-.I "Options for System V"
+\fIOptions for System V\fR
.IX Subsection "Options for System V"
.PP
These additional options are available on System V Release 4 for
compatibility with other compilers on those systems:
-.Ip "\fB\-G\fR" 4
+.IP "\fB\-G\fR" 4
.IX Item "-G"
Create a shared object.
It is recommended that \fB\-symbolic\fR or \fB\-shared\fR be used instead.
-.Ip "\fB\-Qy\fR" 4
+.IP "\fB\-Qy\fR" 4
.IX Item "-Qy"
Identify the versions of each tool used by the compiler, in a
\&\f(CW\*(C`.ident\*(C'\fR assembler directive in the output.
-.Ip "\fB\-Qn\fR" 4
+.IP "\fB\-Qn\fR" 4
.IX Item "-Qn"
Refrain from adding \f(CW\*(C`.ident\*(C'\fR directives to the output file (this is
the default).
-.Ip "\fB\-YP,\fR\fIdirs\fR" 4
+.IP "\fB\-YP,\fR\fIdirs\fR" 4
.IX Item "-YP,dirs"
Search the directories \fIdirs\fR, and no others, for libraries
specified with \fB\-l\fR.
-.Ip "\fB\-Ym,\fR\fIdir\fR" 4
+.IP "\fB\-Ym,\fR\fIdir\fR" 4
.IX Item "-Ym,dir"
Look in the directory \fIdir\fR to find the M4 preprocessor.
The assembler uses this option.
.PP
-.I "TMS320C3x/C4x Options"
+\fITMS320C3x/C4x Options\fR
.IX Subsection "TMS320C3x/C4x Options"
.PP
These \fB\-m\fR options are defined for TMS320C3x/C4x implementations:
-.Ip "\fB\-mcpu=\fR\fIcpu_type\fR" 4
+.IP "\fB\-mcpu=\fR\fIcpu_type\fR" 4
.IX Item "-mcpu=cpu_type"
Set the instruction set, register set, and instruction scheduling
parameters for machine type \fIcpu_type\fR. Supported values for
\&\fIcpu_type\fR are \fBc30\fR, \fBc31\fR, \fBc32\fR, \fBc40\fR, and
\&\fBc44\fR. The default is \fBc40\fR to generate code for the
\&\s-1TMS320C40\s0.
-.Ip "\fB\-mbig-memory\fR" 4
+.IP "\fB\-mbig\-memory\fR" 4
.IX Item "-mbig-memory"
.PD 0
-.Ip "\fB\-mbig\fR" 4
+.IP "\fB\-mbig\fR" 4
.IX Item "-mbig"
-.Ip "\fB\-msmall-memory\fR" 4
+.IP "\fB\-msmall\-memory\fR" 4
.IX Item "-msmall-memory"
-.Ip "\fB\-msmall\fR" 4
+.IP "\fB\-msmall\fR" 4
.IX Item "-msmall"
.PD
Generates code for the big or small memory model. The small memory
@@ -6706,22 +6933,22 @@ the data page (\s-1DP\s0) register must be set to point to the 64K page
containing the .bss and .data program sections. The big memory model is
the default and requires reloading of the \s-1DP\s0 register for every direct
memory access.
-.Ip "\fB\-mbk\fR" 4
+.IP "\fB\-mbk\fR" 4
.IX Item "-mbk"
.PD 0
-.Ip "\fB\-mno-bk\fR" 4
+.IP "\fB\-mno\-bk\fR" 4
.IX Item "-mno-bk"
.PD
Allow (disallow) allocation of general integer operands into the block
-count register \s-1BK\s0.
-.Ip "\fB\-mdb\fR" 4
+count register \s-1BK\s0.
+.IP "\fB\-mdb\fR" 4
.IX Item "-mdb"
.PD 0
-.Ip "\fB\-mno-db\fR" 4
+.IP "\fB\-mno\-db\fR" 4
.IX Item "-mno-db"
.PD
Enable (disable) generation of code using decrement and branch,
-\&\fIDBcond\fR\|(D), instructions. This is enabled by default for the C4x. To be
+DBcond(D), instructions. This is enabled by default for the C4x. To be
on the safe side, this is disabled for the C3x, since the maximum
iteration count on the C3x is 2^23 + 1 (but who iterates loops more than
2^23 times on the C3x?). Note that \s-1GCC\s0 will try to reverse a loop so
@@ -6729,10 +6956,10 @@ that it can utilise the decrement and branch instruction, but will give
up if there is more than one memory reference in the loop. Thus a loop
where the loop counter is decremented can generate slightly more
efficient code, in cases where the \s-1RPTB\s0 instruction cannot be utilised.
-.Ip "\fB\-mdp-isr-reload\fR" 4
+.IP "\fB\-mdp\-isr\-reload\fR" 4
.IX Item "-mdp-isr-reload"
.PD 0
-.Ip "\fB\-mparanoid\fR" 4
+.IP "\fB\-mparanoid\fR" 4
.IX Item "-mparanoid"
.PD
Force the \s-1DP\s0 register to be saved on entry to an interrupt service
@@ -6740,21 +6967,21 @@ routine (\s-1ISR\s0), reloaded to point to the data section, and restored on
exit from the \s-1ISR\s0. This should not be required unless someone has
violated the small memory model by modifying the \s-1DP\s0 register, say within
an object library.
-.Ip "\fB\-mmpyi\fR" 4
+.IP "\fB\-mmpyi\fR" 4
.IX Item "-mmpyi"
.PD 0
-.Ip "\fB\-mno-mpyi\fR" 4
+.IP "\fB\-mno\-mpyi\fR" 4
.IX Item "-mno-mpyi"
.PD
For the C3x use the 24\-bit \s-1MPYI\s0 instruction for integer multiplies
instead of a library call to guarantee 32\-bit results. Note that if one
of the operands is a constant, then the multiplication will be performed
-using shifts and adds. If the \-mmpyi option is not specified for the C3x,
+using shifts and adds. If the \fB\-mmpyi\fR option is not specified for the C3x,
then squaring operations are performed inline instead of a library call.
-.Ip "\fB\-mfast-fix\fR" 4
+.IP "\fB\-mfast\-fix\fR" 4
.IX Item "-mfast-fix"
.PD 0
-.Ip "\fB\-mno-fast-fix\fR" 4
+.IP "\fB\-mno\-fast\-fix\fR" 4
.IX Item "-mno-fast-fix"
.PD
The C3x/C4x \s-1FIX\s0 instruction to convert a floating point value to an
@@ -6764,10 +6991,10 @@ floating point number is negative, the result will be incorrectly
truncated an additional code is necessary to detect and correct this
case. This option can be used to disable generation of the additional
code required to correct the result.
-.Ip "\fB\-mrptb\fR" 4
+.IP "\fB\-mrptb\fR" 4
.IX Item "-mrptb"
.PD 0
-.Ip "\fB\-mno-rptb\fR" 4
+.IP "\fB\-mno\-rptb\fR" 4
.IX Item "-mno-rptb"
.PD
Enable (disable) generation of repeat block sequences using the \s-1RPTB\s0
@@ -6775,11 +7002,11 @@ instruction for zero overhead looping. The \s-1RPTB\s0 construct is only used
for innermost loops that do not call functions or jump across the loop
boundaries. There is no advantage having nested \s-1RPTB\s0 loops due to the
overhead required to save and restore the \s-1RC\s0, \s-1RS\s0, and \s-1RE\s0 registers.
-This is enabled by default with \-O2.
-.Ip "\fB\-mrpts=\fR\fIcount\fR" 4
+This is enabled by default with \fB\-O2\fR.
+.IP "\fB\-mrpts=\fR\fIcount\fR" 4
.IX Item "-mrpts=count"
.PD 0
-.Ip "\fB\-mno-rpts\fR" 4
+.IP "\fB\-mno\-rpts\fR" 4
.IX Item "-mno-rpts"
.PD
Enable (disable) the use of the single instruction repeat instruction
@@ -6791,10 +7018,10 @@ at compile time. Note that the repeated instruction following \s-1RPTS\s0 does
not have to be reloaded from memory each iteration, thus freeing up the
\&\s-1CPU\s0 buses for operands. However, since interrupts are blocked by this
instruction, it is disabled by default.
-.Ip "\fB\-mloop-unsigned\fR" 4
+.IP "\fB\-mloop\-unsigned\fR" 4
.IX Item "-mloop-unsigned"
.PD 0
-.Ip "\fB\-mno-loop-unsigned\fR" 4
+.IP "\fB\-mno\-loop\-unsigned\fR" 4
.IX Item "-mno-loop-unsigned"
.PD
The maximum iteration count when using \s-1RPTS\s0 and \s-1RPTB\s0 (and \s-1DB\s0 on the C40)
@@ -6802,201 +7029,201 @@ is 2^31 + 1 since these instructions test if the iteration count is
negative to terminate the loop. If the iteration count is unsigned
there is a possibility than the 2^31 + 1 maximum iteration count may be
exceeded. This switch allows an unsigned iteration count.
-.Ip "\fB\-mti\fR" 4
+.IP "\fB\-mti\fR" 4
.IX Item "-mti"
Try to emit an assembler syntax that the \s-1TI\s0 assembler (asm30) is happy
with. This also enforces compatibility with the \s-1API\s0 employed by the \s-1TI\s0
C3x C compiler. For example, long doubles are passed as structures
rather than in floating point registers.
-.Ip "\fB\-mregparm\fR" 4
+.IP "\fB\-mregparm\fR" 4
.IX Item "-mregparm"
.PD 0
-.Ip "\fB\-mmemparm\fR" 4
+.IP "\fB\-mmemparm\fR" 4
.IX Item "-mmemparm"
.PD
Generate code that uses registers (stack) for passing arguments to functions.
By default, arguments are passed in registers where possible rather
than by pushing arguments on to the stack.
-.Ip "\fB\-mparallel-insns\fR" 4
+.IP "\fB\-mparallel\-insns\fR" 4
.IX Item "-mparallel-insns"
.PD 0
-.Ip "\fB\-mno-parallel-insns\fR" 4
+.IP "\fB\-mno\-parallel\-insns\fR" 4
.IX Item "-mno-parallel-insns"
.PD
Allow the generation of parallel instructions. This is enabled by
-default with \-O2.
-.Ip "\fB\-mparallel-mpy\fR" 4
+default with \fB\-O2\fR.
+.IP "\fB\-mparallel\-mpy\fR" 4
.IX Item "-mparallel-mpy"
.PD 0
-.Ip "\fB\-mno-parallel-mpy\fR" 4
+.IP "\fB\-mno\-parallel\-mpy\fR" 4
.IX Item "-mno-parallel-mpy"
.PD
Allow the generation of MPY||ADD and MPY||SUB parallel instructions,
-provided \-mparallel-insns is also specified. These instructions have
+provided \fB\-mparallel\-insns\fR is also specified. These instructions have
tight register constraints which can pessimize the code generation
of large functions.
.PP
-.I "V850 Options"
+\fIV850 Options\fR
.IX Subsection "V850 Options"
.PP
These \fB\-m\fR options are defined for V850 implementations:
-.Ip "\fB\-mlong-calls\fR" 4
+.IP "\fB\-mlong\-calls\fR" 4
.IX Item "-mlong-calls"
.PD 0
-.Ip "\fB\-mno-long-calls\fR" 4
+.IP "\fB\-mno\-long\-calls\fR" 4
.IX Item "-mno-long-calls"
.PD
Treat all calls as being far away (near). If calls are assumed to be
far away, the compiler will always load the functions address up into a
register, and call indirect through the pointer.
-.Ip "\fB\-mno-ep\fR" 4
+.IP "\fB\-mno\-ep\fR" 4
.IX Item "-mno-ep"
.PD 0
-.Ip "\fB\-mep\fR" 4
+.IP "\fB\-mep\fR" 4
.IX Item "-mep"
.PD
Do not optimize (do optimize) basic blocks that use the same index
pointer 4 or more times to copy pointer into the \f(CW\*(C`ep\*(C'\fR register, and
use the shorter \f(CW\*(C`sld\*(C'\fR and \f(CW\*(C`sst\*(C'\fR instructions. The \fB\-mep\fR
option is on by default if you optimize.
-.Ip "\fB\-mno-prolog-function\fR" 4
+.IP "\fB\-mno\-prolog\-function\fR" 4
.IX Item "-mno-prolog-function"
.PD 0
-.Ip "\fB\-mprolog-function\fR" 4
+.IP "\fB\-mprolog\-function\fR" 4
.IX Item "-mprolog-function"
.PD
Do not use (do use) external functions to save and restore registers at
the prolog and epilog of a function. The external functions are slower,
but use less code space if more than one function saves the same number
-of registers. The \fB\-mprolog-function\fR option is on by default if
+of registers. The \fB\-mprolog\-function\fR option is on by default if
you optimize.
-.Ip "\fB\-mspace\fR" 4
+.IP "\fB\-mspace\fR" 4
.IX Item "-mspace"
Try to make the code as small as possible. At present, this just turns
-on the \fB\-mep\fR and \fB\-mprolog-function\fR options.
-.Ip "\fB\-mtda=\fR\fIn\fR" 4
+on the \fB\-mep\fR and \fB\-mprolog\-function\fR options.
+.IP "\fB\-mtda=\fR\fIn\fR" 4
.IX Item "-mtda=n"
Put static or global variables whose size is \fIn\fR bytes or less into
the tiny data area that register \f(CW\*(C`ep\*(C'\fR points to. The tiny data
area can hold up to 256 bytes in total (128 bytes for byte references).
-.Ip "\fB\-msda=\fR\fIn\fR" 4
+.IP "\fB\-msda=\fR\fIn\fR" 4
.IX Item "-msda=n"
Put static or global variables whose size is \fIn\fR bytes or less into
the small data area that register \f(CW\*(C`gp\*(C'\fR points to. The small data
area can hold up to 64 kilobytes.
-.Ip "\fB\-mzda=\fR\fIn\fR" 4
+.IP "\fB\-mzda=\fR\fIn\fR" 4
.IX Item "-mzda=n"
Put static or global variables whose size is \fIn\fR bytes or less into
the first 32 kilobytes of memory.
-.Ip "\fB\-mv850\fR" 4
+.IP "\fB\-mv850\fR" 4
.IX Item "-mv850"
Specify that the target processor is the V850.
-.Ip "\fB\-mbig-switch\fR" 4
+.IP "\fB\-mbig\-switch\fR" 4
.IX Item "-mbig-switch"
Generate code suitable for big switch tables. Use this option only if
the assembler/linker complain about out of range branches within a switch
table.
.PP
-.I "\s-1ARC\s0 Options"
+\fI\s-1ARC\s0 Options\fR
.IX Subsection "ARC Options"
.PP
These options are defined for \s-1ARC\s0 implementations:
-.Ip "\fB\-EL\fR" 4
+.IP "\fB\-EL\fR" 4
.IX Item "-EL"
Compile code for little endian mode. This is the default.
-.Ip "\fB\-EB\fR" 4
+.IP "\fB\-EB\fR" 4
.IX Item "-EB"
Compile code for big endian mode.
-.Ip "\fB\-mmangle-cpu\fR" 4
+.IP "\fB\-mmangle\-cpu\fR" 4
.IX Item "-mmangle-cpu"
Prepend the name of the cpu to all public symbol names.
In multiple-processor systems, there are many \s-1ARC\s0 variants with different
instruction and register set characteristics. This flag prevents code
compiled for one cpu to be linked with code compiled for another.
-No facility exists for handling variants that are \*(L"almost identical\*(R".
+No facility exists for handling variants that are ``almost identical''.
This is an all or nothing option.
-.Ip "\fB\-mcpu=\fR\fIcpu\fR" 4
+.IP "\fB\-mcpu=\fR\fIcpu\fR" 4
.IX Item "-mcpu=cpu"
Compile code for \s-1ARC\s0 variant \fIcpu\fR.
Which variants are supported depend on the configuration.
All variants support \fB\-mcpu=base\fR, this is the default.
-.Ip "\fB\-mtext=\fR\fItext section\fR" 4
-.IX Item "-mtext=text section"
+.IP "\fB\-mtext=\fR\fItext-section\fR" 4
+.IX Item "-mtext=text-section"
.PD 0
-.Ip "\fB\-mdata=\fR\fIdata section\fR" 4
-.IX Item "-mdata=data section"
-.Ip "\fB\-mrodata=\fR\fIreadonly data section\fR" 4
-.IX Item "-mrodata=readonly data section"
+.IP "\fB\-mdata=\fR\fIdata-section\fR" 4
+.IX Item "-mdata=data-section"
+.IP "\fB\-mrodata=\fR\fIreadonly-data-section\fR" 4
+.IX Item "-mrodata=readonly-data-section"
.PD
-Put functions, data, and readonly data in \fItext section\fR,
-\&\fIdata section\fR, and \fIreadonly data section\fR respectively
+Put functions, data, and readonly data in \fItext-section\fR,
+\&\fIdata-section\fR, and \fIreadonly-data-section\fR respectively
by default. This can be overridden with the \f(CW\*(C`section\*(C'\fR attribute.
.PP
-.I "\s-1NS32K\s0 Options"
+\fI\s-1NS32K\s0 Options\fR
.IX Subsection "NS32K Options"
.PP
These are the \fB\-m\fR options defined for the 32000 series. The default
values for these options depends on which style of 32000 was selected when
the compiler was configured; the defaults for the most common choices are
given below.
-.Ip "\fB\-m32032\fR" 4
+.IP "\fB\-m32032\fR" 4
.IX Item "-m32032"
.PD 0
-.Ip "\fB\-m32032\fR" 4
+.IP "\fB\-m32032\fR" 4
.IX Item "-m32032"
.PD
Generate output for a 32032. This is the default
when the compiler is configured for 32032 and 32016 based systems.
-.Ip "\fB\-m32332\fR" 4
+.IP "\fB\-m32332\fR" 4
.IX Item "-m32332"
.PD 0
-.Ip "\fB\-m32332\fR" 4
+.IP "\fB\-m32332\fR" 4
.IX Item "-m32332"
.PD
Generate output for a 32332. This is the default
when the compiler is configured for 32332\-based systems.
-.Ip "\fB\-m32532\fR" 4
+.IP "\fB\-m32532\fR" 4
.IX Item "-m32532"
.PD 0
-.Ip "\fB\-m32532\fR" 4
+.IP "\fB\-m32532\fR" 4
.IX Item "-m32532"
.PD
Generate output for a 32532. This is the default
when the compiler is configured for 32532\-based systems.
-.Ip "\fB\-m32081\fR" 4
+.IP "\fB\-m32081\fR" 4
.IX Item "-m32081"
Generate output containing 32081 instructions for floating point.
This is the default for all systems.
-.Ip "\fB\-m32381\fR" 4
+.IP "\fB\-m32381\fR" 4
.IX Item "-m32381"
Generate output containing 32381 instructions for floating point. This
-also implies \fB\-m32081\fR. The 32381 is only compatible with the 32332
-and 32532 cpus. This is the default for the pc532\-netbsd configuration.
-.Ip "\fB\-mmulti-add\fR" 4
+also implies \fB\-m32081\fR. The 32381 is only compatible with the 32332
+and 32532 cpus. This is the default for the pc532\-netbsd configuration.
+.IP "\fB\-mmulti\-add\fR" 4
.IX Item "-mmulti-add"
Try and generate multiply-add floating point instructions \f(CW\*(C`polyF\*(C'\fR
-and \f(CW\*(C`dotF\*(C'\fR. This option is only available if the \fB\-m32381\fR
-option is in effect. Using these instructions requires changes to to
+and \f(CW\*(C`dotF\*(C'\fR. This option is only available if the \fB\-m32381\fR
+option is in effect. Using these instructions requires changes to
register allocation which generally has a negative impact on
performance. This option should only be enabled when compiling code
particularly likely to make heavy use of multiply-add instructions.
-.Ip "\fB\-mnomulti-add\fR" 4
+.IP "\fB\-mnomulti\-add\fR" 4
.IX Item "-mnomulti-add"
Do not try and generate multiply-add floating point instructions
-\&\f(CW\*(C`polyF\*(C'\fR and \f(CW\*(C`dotF\*(C'\fR. This is the default on all platforms.
-.Ip "\fB\-msoft-float\fR" 4
+\&\f(CW\*(C`polyF\*(C'\fR and \f(CW\*(C`dotF\*(C'\fR. This is the default on all platforms.
+.IP "\fB\-msoft\-float\fR" 4
.IX Item "-msoft-float"
Generate output containing library calls for floating point.
\&\fBWarning:\fR the requisite libraries may not be available.
-.Ip "\fB\-mnobitfield\fR" 4
+.IP "\fB\-mnobitfield\fR" 4
.IX Item "-mnobitfield"
-Do not use the bit-field instructions. On some machines it is faster to
-use shifting and masking operations. This is the default for the pc532.
-.Ip "\fB\-mbitfield\fR" 4
+Do not use the bit-field instructions. On some machines it is faster to
+use shifting and masking operations. This is the default for the pc532.
+.IP "\fB\-mbitfield\fR" 4
.IX Item "-mbitfield"
-Do use the bit-field instructions. This is the default for all platforms
+Do use the bit-field instructions. This is the default for all platforms
except the pc532.
-.Ip "\fB\-mrtd\fR" 4
+.IP "\fB\-mrtd\fR" 4
.IX Item "-mrtd"
Use a different function-calling convention, in which functions
that take a fixed number of arguments return pop their
@@ -7016,7 +7243,7 @@ function with too many arguments. (Normally, extra arguments are
harmlessly ignored.)
.Sp
This option takes its name from the 680x0 \f(CW\*(C`rtd\*(C'\fR instruction.
-.Ip "\fB\-mregparam\fR" 4
+.IP "\fB\-mregparam\fR" 4
.IX Item "-mregparam"
Use a different function-calling convention where the first two arguments
are passed in registers.
@@ -7024,36 +7251,36 @@ are passed in registers.
This calling convention is incompatible with the one normally
used on Unix, so you cannot use it if you need to call libraries
compiled with the Unix compiler.
-.Ip "\fB\-mnoregparam\fR" 4
+.IP "\fB\-mnoregparam\fR" 4
.IX Item "-mnoregparam"
-Do not pass any arguments in registers. This is the default for all
+Do not pass any arguments in registers. This is the default for all
targets.
-.Ip "\fB\-msb\fR" 4
+.IP "\fB\-msb\fR" 4
.IX Item "-msb"
It is \s-1OK\s0 to use the sb as an index register which is always loaded with
-zero. This is the default for the pc532\-netbsd target.
-.Ip "\fB\-mnosb\fR" 4
+zero. This is the default for the pc532\-netbsd target.
+.IP "\fB\-mnosb\fR" 4
.IX Item "-mnosb"
The sb register is not available for use or has not been initialized to
-zero by the run time system. This is the default for all targets except
-the pc532\-netbsd. It is also implied whenever \fB\-mhimem\fR or
+zero by the run time system. This is the default for all targets except
+the pc532\-netbsd. It is also implied whenever \fB\-mhimem\fR or
\&\fB\-fpic\fR is set.
-.Ip "\fB\-mhimem\fR" 4
+.IP "\fB\-mhimem\fR" 4
.IX Item "-mhimem"
Many ns32000 series addressing modes use displacements of up to 512MB.
If an address is above 512MB then displacements from zero can not be used.
This option causes code to be generated which can be loaded above 512MB.
This may be useful for operating systems or \s-1ROM\s0 code.
-.Ip "\fB\-mnohimem\fR" 4
+.IP "\fB\-mnohimem\fR" 4
.IX Item "-mnohimem"
Assume code will be loaded in the first 512MB of virtual address space.
This is the default for all platforms.
.PP
-.I "\s-1AVR\s0 Options"
+\fI\s-1AVR\s0 Options\fR
.IX Subsection "AVR Options"
.PP
These options are defined for \s-1AVR\s0 implementations:
-.Ip "\fB\-mmcu=\fR\fImcu\fR" 4
+.IP "\fB\-mmcu=\fR\fImcu\fR" 4
.IX Item "-mmcu=mcu"
Specify \s-1ATMEL\s0 \s-1AVR\s0 instruction set or \s-1MCU\s0 type.
.Sp
@@ -7074,268 +7301,527 @@ memory space (\s-1MCU\s0 types: atmega83, atmega85).
.Sp
Instruction set avr5 is for the enhanced \s-1AVR\s0 core with up to 128K program
memory space (\s-1MCU\s0 types: atmega161, atmega163, atmega32, at94k).
-.Ip "\fB\-msize\fR" 4
+.IP "\fB\-msize\fR" 4
.IX Item "-msize"
Output instruction sizes to the asm file.
-.Ip "\fB\-minit-stack=\fR\fIN\fR" 4
+.IP "\fB\-minit\-stack=\fR\fIN\fR" 4
.IX Item "-minit-stack=N"
Specify the initial stack address, which may be a symbol or numeric value,
-_\|_stack is the default.
-.Ip "\fB\-mno-interrupts\fR" 4
+\&\fB_\|_stack\fR is the default.
+.IP "\fB\-mno\-interrupts\fR" 4
.IX Item "-mno-interrupts"
Generated code is not compatible with hardware interrupts.
Code size will be smaller.
-.Ip "\fB\-mcall-prologues\fR" 4
+.IP "\fB\-mcall\-prologues\fR" 4
.IX Item "-mcall-prologues"
Functions prologues/epilogues expanded as call to appropriate
-subroutines. Code size will be smaller.
-.Ip "\fB\-mno-tablejump\fR" 4
+subroutines. Code size will be smaller.
+.IP "\fB\-mno\-tablejump\fR" 4
.IX Item "-mno-tablejump"
Do not generate tablejump insns which sometimes increase code size.
-.Ip "\fB\-mtiny-stack\fR" 4
+.IP "\fB\-mtiny\-stack\fR" 4
.IX Item "-mtiny-stack"
Change only the low 8 bits of the stack pointer.
.PP
-.I "MCore Options"
+\fIMCore Options\fR
.IX Subsection "MCore Options"
.PP
These are the \fB\-m\fR options defined for the Motorola M*Core
-processors.
-.Ip "\fB\-mhardlit\fR" 4
+processors.
+.IP "\fB\-mhardlit\fR" 4
.IX Item "-mhardlit"
.PD 0
-.Ip "\fB\-mhardlit\fR" 4
+.IP "\fB\-mhardlit\fR" 4
.IX Item "-mhardlit"
-.Ip "\fB\-mno-hardlit\fR" 4
+.IP "\fB\-mno\-hardlit\fR" 4
.IX Item "-mno-hardlit"
.PD
Inline constants into the code stream if it can be done in two
instructions or less.
-.Ip "\fB\-mdiv\fR" 4
+.IP "\fB\-mdiv\fR" 4
.IX Item "-mdiv"
.PD 0
-.Ip "\fB\-mdiv\fR" 4
+.IP "\fB\-mdiv\fR" 4
.IX Item "-mdiv"
-.Ip "\fB\-mno-div\fR" 4
+.IP "\fB\-mno\-div\fR" 4
.IX Item "-mno-div"
.PD
Use the divide instruction. (Enabled by default).
-.Ip "\fB\-mrelax-immediate\fR" 4
+.IP "\fB\-mrelax\-immediate\fR" 4
.IX Item "-mrelax-immediate"
.PD 0
-.Ip "\fB\-mrelax-immediate\fR" 4
+.IP "\fB\-mrelax\-immediate\fR" 4
.IX Item "-mrelax-immediate"
-.Ip "\fB\-mno-relax-immediate\fR" 4
+.IP "\fB\-mno\-relax\-immediate\fR" 4
.IX Item "-mno-relax-immediate"
.PD
Allow arbitrary sized immediates in bit operations.
-.Ip "\fB\-mwide-bitfields\fR" 4
+.IP "\fB\-mwide\-bitfields\fR" 4
.IX Item "-mwide-bitfields"
.PD 0
-.Ip "\fB\-mwide-bitfields\fR" 4
+.IP "\fB\-mwide\-bitfields\fR" 4
.IX Item "-mwide-bitfields"
-.Ip "\fB\-mno-wide-bitfields\fR" 4
+.IP "\fB\-mno\-wide\-bitfields\fR" 4
.IX Item "-mno-wide-bitfields"
.PD
-Always treat bitfields as int-sized.
-.Ip "\fB\-m4byte-functions\fR" 4
+Always treat bit-fields as int\-sized.
+.IP "\fB\-m4byte\-functions\fR" 4
.IX Item "-m4byte-functions"
.PD 0
-.Ip "\fB\-m4byte-functions\fR" 4
+.IP "\fB\-m4byte\-functions\fR" 4
.IX Item "-m4byte-functions"
-.Ip "\fB\-mno-4byte-functions\fR" 4
+.IP "\fB\-mno\-4byte\-functions\fR" 4
.IX Item "-mno-4byte-functions"
.PD
Force all functions to be aligned to a four byte boundary.
-.Ip "\fB\-mcallgraph-data\fR" 4
+.IP "\fB\-mcallgraph\-data\fR" 4
.IX Item "-mcallgraph-data"
.PD 0
-.Ip "\fB\-mcallgraph-data\fR" 4
+.IP "\fB\-mcallgraph\-data\fR" 4
.IX Item "-mcallgraph-data"
-.Ip "\fB\-mno-callgraph-data\fR" 4
+.IP "\fB\-mno\-callgraph\-data\fR" 4
.IX Item "-mno-callgraph-data"
.PD
Emit callgraph information.
-.Ip "\fB\-mslow-bytes\fR" 4
+.IP "\fB\-mslow\-bytes\fR" 4
.IX Item "-mslow-bytes"
.PD 0
-.Ip "\fB\-mslow-bytes\fR" 4
+.IP "\fB\-mslow\-bytes\fR" 4
.IX Item "-mslow-bytes"
-.Ip "\fB\-mno-slow-bytes\fR" 4
+.IP "\fB\-mno\-slow\-bytes\fR" 4
.IX Item "-mno-slow-bytes"
.PD
Prefer word access when reading byte quantities.
-.Ip "\fB\-mlittle-endian\fR" 4
+.IP "\fB\-mlittle\-endian\fR" 4
.IX Item "-mlittle-endian"
.PD 0
-.Ip "\fB\-mlittle-endian\fR" 4
+.IP "\fB\-mlittle\-endian\fR" 4
.IX Item "-mlittle-endian"
-.Ip "\fB\-mbig-endian\fR" 4
+.IP "\fB\-mbig\-endian\fR" 4
.IX Item "-mbig-endian"
.PD
Generate code for a little endian target.
-.Ip "\fB\-m210\fR" 4
+.IP "\fB\-m210\fR" 4
.IX Item "-m210"
.PD 0
-.Ip "\fB\-m210\fR" 4
+.IP "\fB\-m210\fR" 4
.IX Item "-m210"
-.Ip "\fB\-m340\fR" 4
+.IP "\fB\-m340\fR" 4
.IX Item "-m340"
.PD
Generate code for the 210 processor.
.PP
-.I "\s-1IA-64\s0 Options"
+\fI\s-1IA\-64\s0 Options\fR
.IX Subsection "IA-64 Options"
.PP
-These are the \fB\-m\fR options defined for the Intel \s-1IA-64\s0 architecture.
-.Ip "\fB\-mbig-endian\fR" 4
+These are the \fB\-m\fR options defined for the Intel \s-1IA\-64\s0 architecture.
+.IP "\fB\-mbig\-endian\fR" 4
.IX Item "-mbig-endian"
Generate code for a big endian target. This is the default for \s-1HPUX\s0.
-.Ip "\fB\-mlittle-endian\fR" 4
+.IP "\fB\-mlittle\-endian\fR" 4
.IX Item "-mlittle-endian"
Generate code for a little endian target. This is the default for \s-1AIX5\s0
and Linux.
-.Ip "\fB\-mgnu-as\fR" 4
+.IP "\fB\-mgnu\-as\fR" 4
.IX Item "-mgnu-as"
.PD 0
-.Ip "\fB\-mno-gnu-as\fR" 4
+.IP "\fB\-mno\-gnu\-as\fR" 4
.IX Item "-mno-gnu-as"
.PD
Generate (or don't) code for the \s-1GNU\s0 assembler. This is the default.
-.Ip "\fB\-mgnu-ld\fR" 4
+.IP "\fB\-mgnu\-ld\fR" 4
.IX Item "-mgnu-ld"
.PD 0
-.Ip "\fB\-mno-gnu-ld\fR" 4
+.IP "\fB\-mno\-gnu\-ld\fR" 4
.IX Item "-mno-gnu-ld"
.PD
Generate (or don't) code for the \s-1GNU\s0 linker. This is the default.
-.Ip "\fB\-mno-pic\fR" 4
+.IP "\fB\-mno\-pic\fR" 4
.IX Item "-mno-pic"
Generate code that does not use a global pointer register. The result
-is not position independent code, and violates the \s-1IA-64\s0 \s-1ABI\s0.
-.Ip "\fB\-mvolatile-asm-stop\fR" 4
+is not position independent code, and violates the \s-1IA\-64\s0 \s-1ABI\s0.
+.IP "\fB\-mvolatile\-asm\-stop\fR" 4
.IX Item "-mvolatile-asm-stop"
.PD 0
-.Ip "\fB\-mno-volatile-asm-stop\fR" 4
+.IP "\fB\-mno\-volatile\-asm\-stop\fR" 4
.IX Item "-mno-volatile-asm-stop"
.PD
Generate (or don't) a stop bit immediately before and after volatile asm
statements.
-.Ip "\fB\-mb-step\fR" 4
+.IP "\fB\-mb\-step\fR" 4
.IX Item "-mb-step"
Generate code that works around Itanium B step errata.
-.Ip "\fB\-mregister-names\fR" 4
+.IP "\fB\-mregister\-names\fR" 4
.IX Item "-mregister-names"
.PD 0
-.Ip "\fB\-mno-register-names\fR" 4
+.IP "\fB\-mno\-register\-names\fR" 4
.IX Item "-mno-register-names"
.PD
Generate (or don't) \fBin\fR, \fBloc\fR, and \fBout\fR register names for
the stacked registers. This may make assembler output more readable.
-.Ip "\fB\-mno-sdata\fR" 4
+.IP "\fB\-mno\-sdata\fR" 4
.IX Item "-mno-sdata"
.PD 0
-.Ip "\fB\-msdata\fR" 4
+.IP "\fB\-msdata\fR" 4
.IX Item "-msdata"
.PD
Disable (or enable) optimizations that use the small data section. This may
be useful for working around optimizer bugs.
-.Ip "\fB\-mconstant-gp\fR" 4
+.IP "\fB\-mconstant\-gp\fR" 4
.IX Item "-mconstant-gp"
Generate code that uses a single constant global pointer value. This is
useful when compiling kernel code.
-.Ip "\fB\-mauto-pic\fR" 4
+.IP "\fB\-mauto\-pic\fR" 4
.IX Item "-mauto-pic"
-Generate code that is self-relocatable. This implies \fB\-mconstant-gp\fR.
+Generate code that is self\-relocatable. This implies \fB\-mconstant\-gp\fR.
This is useful when compiling firmware code.
-.Ip "\fB\-minline-divide-min-latency\fR" 4
+.IP "\fB\-minline\-divide\-min\-latency\fR" 4
.IX Item "-minline-divide-min-latency"
Generate code for inline divides using the minimum latency algorithm.
-.Ip "\fB\-minline-divide-max-throughput\fR" 4
+.IP "\fB\-minline\-divide\-max\-throughput\fR" 4
.IX Item "-minline-divide-max-throughput"
Generate code for inline divides using the maximum throughput algorithm.
-.Ip "\fB\-mno-dwarf2\-asm\fR" 4
+.IP "\fB\-mno\-dwarf2\-asm\fR" 4
.IX Item "-mno-dwarf2-asm"
.PD 0
-.Ip "\fB\-mdwarf2\-asm\fR" 4
+.IP "\fB\-mdwarf2\-asm\fR" 4
.IX Item "-mdwarf2-asm"
.PD
Don't (or do) generate assembler code for the \s-1DWARF2\s0 line number debugging
info. This may be useful when not using the \s-1GNU\s0 assembler.
-.Ip "\fB\-mfixed-range=\fR\fIregister range\fR" 4
-.IX Item "-mfixed-range=register range"
+.IP "\fB\-mfixed\-range=\fR\fIregister-range\fR" 4
+.IX Item "-mfixed-range=register-range"
Generate code treating the given register range as fixed registers.
A fixed register is one that the register allocator can not use. This is
useful when compiling kernel code. A register range is specified as
two registers separated by a dash. Multiple register ranges can be
specified separated by a comma.
.PP
-.I "D30V Options"
+\fID30V Options\fR
.IX Subsection "D30V Options"
.PP
These \fB\-m\fR options are defined for D30V implementations:
-.Ip "\fB\-mextmem\fR" 4
+.IP "\fB\-mextmem\fR" 4
.IX Item "-mextmem"
Link the \fB.text\fR, \fB.data\fR, \fB.bss\fR, \fB.strings\fR,
\&\fB.rodata\fR, \fB.rodata1\fR, \fB.data1\fR sections into external
-memory, which starts at location \f(CW\*(C`0x80000000\*(C'\fR.
-.Ip "\fB\-mextmemory\fR" 4
+memory, which starts at location \f(CW0x80000000\fR.
+.IP "\fB\-mextmemory\fR" 4
.IX Item "-mextmemory"
Same as the \fB\-mextmem\fR switch.
-.Ip "\fB\-monchip\fR" 4
+.IP "\fB\-monchip\fR" 4
.IX Item "-monchip"
Link the \fB.text\fR section into onchip text memory, which starts at
-location \f(CW\*(C`0x0\*(C'\fR. Also link \fB.data\fR, \fB.bss\fR,
+location \f(CW0x0\fR. Also link \fB.data\fR, \fB.bss\fR,
\&\fB.strings\fR, \fB.rodata\fR, \fB.rodata1\fR, \fB.data1\fR sections
-into onchip data memory, which starts at location \f(CW\*(C`0x20000000\*(C'\fR.
-.Ip "\fB\-mno-asm-optimize\fR" 4
+into onchip data memory, which starts at location \f(CW0x20000000\fR.
+.IP "\fB\-mno\-asm\-optimize\fR" 4
.IX Item "-mno-asm-optimize"
.PD 0
-.Ip "\fB\-masm-optimize\fR" 4
+.IP "\fB\-masm\-optimize\fR" 4
.IX Item "-masm-optimize"
.PD
Disable (enable) passing \fB\-O\fR to the assembler when optimizing.
The assembler uses the \fB\-O\fR option to automatically parallelize
adjacent short instructions where possible.
-.Ip "\fB\-mbranch-cost=\fR\fIn\fR" 4
+.IP "\fB\-mbranch\-cost=\fR\fIn\fR" 4
.IX Item "-mbranch-cost=n"
Increase the internal costs of branches to \fIn\fR. Higher costs means
that the compiler will issue more instructions to avoid doing a branch.
The default is 2.
-.Ip "\fB\-mcond-exec=\fR\fIn\fR" 4
+.IP "\fB\-mcond\-exec=\fR\fIn\fR" 4
.IX Item "-mcond-exec=n"
Specify the maximum number of conditionally executed instructions that
replace a branch. The default is 4.
+.PP
+\fIS/390 and zSeries Options\fR
+.IX Subsection "S/390 and zSeries Options"
+.PP
+These are the \fB\-m\fR options defined for the S/390 and zSeries architecture.
+.IP "\fB\-mhard\-float\fR" 4
+.IX Item "-mhard-float"
+.PD 0
+.IP "\fB\-msoft\-float\fR" 4
+.IX Item "-msoft-float"
+.PD
+Use (do not use) the hardware floating-point instructions and registers
+for floating-point operations. When \fB\-msoft\-float\fR is specified,
+functions in \fIlibgcc.a\fR will be used to perform floating-point
+operations. When \fB\-mhard\-float\fR is specified, the compiler
+generates \s-1IEEE\s0 floating-point instructions. This is the default.
+.IP "\fB\-mbackchain\fR" 4
+.IX Item "-mbackchain"
+.PD 0
+.IP "\fB\-mno\-backchain\fR" 4
+.IX Item "-mno-backchain"
+.PD
+Generate (or do not generate) code which maintains an explicit
+backchain within the stack frame that points to the caller's frame.
+This is currently needed to allow debugging. The default is to
+generate the backchain.
+.IP "\fB\-msmall\-exec\fR" 4
+.IX Item "-msmall-exec"
+.PD 0
+.IP "\fB\-mno\-small\-exec\fR" 4
+.IX Item "-mno-small-exec"
+.PD
+Generate (or do not generate) code using the \f(CW\*(C`bras\*(C'\fR instruction
+to do subroutine calls.
+This only works reliably if the total executable size does not
+exceed 64k. The default is to use the \f(CW\*(C`basr\*(C'\fR instruction instead,
+which does not have this limitation.
+.IP "\fB\-m64\fR" 4
+.IX Item "-m64"
+.PD 0
+.IP "\fB\-m31\fR" 4
+.IX Item "-m31"
+.PD
+When \fB\-m31\fR is specified, generate code compliant to the
+Linux for S/390 \s-1ABI\s0. When \fB\-m64\fR is specified, generate
+code compliant to the Linux for zSeries \s-1ABI\s0. This allows \s-1GCC\s0 in
+particular to generate 64\-bit instructions. For the \fBs390\fR
+targets, the default is \fB\-m31\fR, while the \fBs390x\fR
+targets default to \fB\-m64\fR.
+.IP "\fB\-mmvcle\fR" 4
+.IX Item "-mmvcle"
+.PD 0
+.IP "\fB\-mno\-mvcle\fR" 4
+.IX Item "-mno-mvcle"
+.PD
+Generate (or do not generate) code using the \f(CW\*(C`mvcle\*(C'\fR instruction
+to perform block moves. When \fB\-mno\-mvcle\fR is specifed,
+use a \f(CW\*(C`mvc\*(C'\fR loop instead. This is the default.
+.IP "\fB\-mdebug\fR" 4
+.IX Item "-mdebug"
+.PD 0
+.IP "\fB\-mno\-debug\fR" 4
+.IX Item "-mno-debug"
+.PD
+Print (or do not print) additional debug information when compiling.
+The default is to not print debug information.
+.PP
+\fIXtensa Options\fR
+.IX Subsection "Xtensa Options"
+.PP
+The Xtensa architecture is designed to support many different
+configurations. The compiler's default options can be set to match a
+particular Xtensa configuration by copying a configuration file into the
+\&\s-1GCC\s0 sources when building \s-1GCC\s0. The options below may be used to
+override the default options.
+.IP "\fB\-mbig\-endian\fR" 4
+.IX Item "-mbig-endian"
+.PD 0
+.IP "\fB\-mlittle\-endian\fR" 4
+.IX Item "-mlittle-endian"
+.PD
+Specify big-endian or little-endian byte ordering for the target Xtensa
+processor.
+.IP "\fB\-mdensity\fR" 4
+.IX Item "-mdensity"
+.PD 0
+.IP "\fB\-mno\-density\fR" 4
+.IX Item "-mno-density"
+.PD
+Enable or disable use of the optional Xtensa code density instructions.
+.IP "\fB\-mmac16\fR" 4
+.IX Item "-mmac16"
+.PD 0
+.IP "\fB\-mno\-mac16\fR" 4
+.IX Item "-mno-mac16"
+.PD
+Enable or disable use of the Xtensa \s-1MAC16\s0 option. When enabled, \s-1GCC\s0
+will generate \s-1MAC16\s0 instructions from standard C code, with the
+limitation that it will use neither the \s-1MR\s0 register file nor any
+instruction that operates on the \s-1MR\s0 registers. When this option is
+disabled, \s-1GCC\s0 will translate 16\-bit multiply/accumulate operations to a
+combination of core instructions and library calls, depending on whether
+any other multiplier options are enabled.
+.IP "\fB\-mmul16\fR" 4
+.IX Item "-mmul16"
+.PD 0
+.IP "\fB\-mno\-mul16\fR" 4
+.IX Item "-mno-mul16"
+.PD
+Enable or disable use of the 16\-bit integer multiplier option. When
+enabled, the compiler will generate 16\-bit multiply instructions for
+multiplications of 16 bits or smaller in standard C code. When this
+option is disabled, the compiler will either use 32\-bit multiply or
+\&\s-1MAC16\s0 instructions if they are available or generate library calls to
+perform the multiply operations using shifts and adds.
+.IP "\fB\-mmul32\fR" 4
+.IX Item "-mmul32"
+.PD 0
+.IP "\fB\-mno\-mul32\fR" 4
+.IX Item "-mno-mul32"
+.PD
+Enable or disable use of the 32\-bit integer multiplier option. When
+enabled, the compiler will generate 32\-bit multiply instructions for
+multiplications of 32 bits or smaller in standard C code. When this
+option is disabled, the compiler will generate library calls to perform
+the multiply operations using either shifts and adds or 16\-bit multiply
+instructions if they are available.
+.IP "\fB\-mnsa\fR" 4
+.IX Item "-mnsa"
+.PD 0
+.IP "\fB\-mno\-nsa\fR" 4
+.IX Item "-mno-nsa"
+.PD
+Enable or disable use of the optional normalization shift amount
+(\f(CW\*(C`NSA\*(C'\fR) instructions to implement the built-in \f(CW\*(C`ffs\*(C'\fR function.
+.IP "\fB\-mminmax\fR" 4
+.IX Item "-mminmax"
+.PD 0
+.IP "\fB\-mno\-minmax\fR" 4
+.IX Item "-mno-minmax"
+.PD
+Enable or disable use of the optional minimum and maximum value
+instructions.
+.IP "\fB\-msext\fR" 4
+.IX Item "-msext"
+.PD 0
+.IP "\fB\-mno\-sext\fR" 4
+.IX Item "-mno-sext"
+.PD
+Enable or disable use of the optional sign extend (\f(CW\*(C`SEXT\*(C'\fR)
+instruction.
+.IP "\fB\-mbooleans\fR" 4
+.IX Item "-mbooleans"
+.PD 0
+.IP "\fB\-mno\-booleans\fR" 4
+.IX Item "-mno-booleans"
+.PD
+Enable or disable support for the boolean register file used by Xtensa
+coprocessors. This is not typically useful by itself but may be
+required for other options that make use of the boolean registers (e.g.,
+the floating-point option).
+.IP "\fB\-mhard\-float\fR" 4
+.IX Item "-mhard-float"
+.PD 0
+.IP "\fB\-msoft\-float\fR" 4
+.IX Item "-msoft-float"
+.PD
+Enable or disable use of the floating-point option. When enabled, \s-1GCC\s0
+generates floating-point instructions for 32\-bit \f(CW\*(C`float\*(C'\fR
+operations. When this option is disabled, \s-1GCC\s0 generates library calls
+to emulate 32\-bit floating-point operations using integer instructions.
+Regardless of this option, 64\-bit \f(CW\*(C`double\*(C'\fR operations are always
+emulated with calls to library functions.
+.IP "\fB\-mfused\-madd\fR" 4
+.IX Item "-mfused-madd"
+.PD 0
+.IP "\fB\-mno\-fused\-madd\fR" 4
+.IX Item "-mno-fused-madd"
+.PD
+Enable or disable use of fused multiply/add and multiply/subtract
+instructions in the floating-point option. This has no effect if the
+floating-point option is not also enabled. Disabling fused multiply/add
+and multiply/subtract instructions forces the compiler to use separate
+instructions for the multiply and add/subtract operations. This may be
+desirable in some cases where strict \s-1IEEE\s0 754\-compliant results are
+required: the fused multiply add/subtract instructions do not round the
+intermediate result, thereby producing results with \fImore\fR bits of
+precision than specified by the \s-1IEEE\s0 standard. Disabling fused multiply
+add/subtract instructions also ensures that the program output is not
+sensitive to the compiler's ability to combine multiply and add/subtract
+operations.
+.IP "\fB\-mserialize\-volatile\fR" 4
+.IX Item "-mserialize-volatile"
+.PD 0
+.IP "\fB\-mno\-serialize\-volatile\fR" 4
+.IX Item "-mno-serialize-volatile"
+.PD
+When this option is enabled, \s-1GCC\s0 inserts \f(CW\*(C`MEMW\*(C'\fR instructions before
+\&\f(CW\*(C`volatile\*(C'\fR memory references to guarantee sequential consistency.
+The default is \fB\-mserialize\-volatile\fR. Use
+\&\fB\-mno\-serialize\-volatile\fR to omit the \f(CW\*(C`MEMW\*(C'\fR instructions.
+.IP "\fB\-mtext\-section\-literals\fR" 4
+.IX Item "-mtext-section-literals"
+.PD 0
+.IP "\fB\-mno\-text\-section\-literals\fR" 4
+.IX Item "-mno-text-section-literals"
+.PD
+Control the treatment of literal pools. The default is
+\&\fB\-mno\-text\-section\-literals\fR, which places literals in a separate
+section in the output file. This allows the literal pool to be placed
+in a data \s-1RAM/ROM\s0, and it also allows the linker to combine literal
+pools from separate object files to remove redundant literals and
+improve code size. With \fB\-mtext\-section\-literals\fR, the literals
+are interspersed in the text section in order to keep them as close as
+possible to their references. This may be necessary for large assembly
+files.
+.IP "\fB\-mtarget\-align\fR" 4
+.IX Item "-mtarget-align"
+.PD 0
+.IP "\fB\-mno\-target\-align\fR" 4
+.IX Item "-mno-target-align"
+.PD
+When this option is enabled, \s-1GCC\s0 instructs the assembler to
+automatically align instructions to reduce branch penalties at the
+expense of some code density. The assembler attempts to widen density
+instructions to align branch targets and the instructions following call
+instructions. If there are not enough preceding safe density
+instructions to align a target, no widening will be performed. The
+default is \fB\-mtarget\-align\fR. These options do not affect the
+treatment of auto-aligned instructions like \f(CW\*(C`LOOP\*(C'\fR, which the
+assembler will always align, either by widening density instructions or
+by inserting no-op instructions.
+.IP "\fB\-mlongcalls\fR" 4
+.IX Item "-mlongcalls"
+.PD 0
+.IP "\fB\-mno\-longcalls\fR" 4
+.IX Item "-mno-longcalls"
+.PD
+When this option is enabled, \s-1GCC\s0 instructs the assembler to translate
+direct calls to indirect calls unless it can determine that the target
+of a direct call is in the range allowed by the call instruction. This
+translation typically occurs for calls to functions in other source
+files. Specifically, the assembler translates a direct \f(CW\*(C`CALL\*(C'\fR
+instruction into an \f(CW\*(C`L32R\*(C'\fR followed by a \f(CW\*(C`CALLX\*(C'\fR instruction.
+The default is \fB\-mno\-longcalls\fR. This option should be used in
+programs where the call target can potentially be out of range. This
+option is implemented in the assembler, not the compiler, so the
+assembly code generated by \s-1GCC\s0 will still show direct call
+instructions\-\-\-look at the disassembled object code to see the actual
+instructions. Note that the assembler will use an indirect call for
+every cross-file call, not just those that really will be out of range.
.Sh "Options for Code Generation Conventions"
.IX Subsection "Options for Code Generation Conventions"
These machine-independent options control the interface conventions
used in code generation.
.PP
Most of them have both positive and negative forms; the negative form
-of \fB\-ffoo\fR would be \fB\-fno-foo\fR. In the table below, only
+of \fB\-ffoo\fR would be \fB\-fno\-foo\fR. In the table below, only
one of the forms is listed\-\-\-the one which is not the default. You
-can figure out the other form by either removing \fBno-\fR or adding
+can figure out the other form by either removing \fBno\-\fR or adding
it.
-.Ip "\fB\-fexceptions\fR" 4
+.IP "\fB\-fexceptions\fR" 4
.IX Item "-fexceptions"
-Enable exception handling. Generates extra code needed to propagate
-exceptions. For some targets, this implies \s-1GNU\s0 \s-1CC\s0 will generate frame
+Enable exception handling. Generates extra code needed to propagate
+exceptions. For some targets, this implies \s-1GCC\s0 will generate frame
unwind information for all functions, which can produce significant data
size overhead, although it does not affect execution. If you do not
-specify this option, \s-1GNU\s0 \s-1CC\s0 will enable it by default for languages like
-\&\*(C+ which normally require exception handling, and disable itfor
+specify this option, \s-1GCC\s0 will enable it by default for languages like
+\&\*(C+ which normally require exception handling, and disable it for
languages like C that do not normally require it. However, you may need
to enable this option when compiling C code that needs to interoperate
properly with exception handlers written in \*(C+. You may also wish to
disable this option if you are compiling older \*(C+ programs that don't
use exception handling.
-.Ip "\fB\-funwind-tables\fR" 4
+.IP "\fB\-fnon\-call\-exceptions\fR" 4
+.IX Item "-fnon-call-exceptions"
+Generate code that allows trapping instructions to throw exceptions.
+Note that this requires platform-specific runtime support that does
+not exist everywhere. Moreover, it only allows \fItrapping\fR
+instructions to throw exceptions, i.e. memory references or floating
+point instructions. It does not allow exceptions to be thrown from
+arbitrary signal handlers such as \f(CW\*(C`SIGALRM\*(C'\fR.
+.IP "\fB\-funwind\-tables\fR" 4
.IX Item "-funwind-tables"
Similar to \fB\-fexceptions\fR, except that it will just generate any needed
static data, but will not affect the generated code in any other way.
You will normally not enable this option; instead, a language processor
that needs this handling would enable it on your behalf.
-.Ip "\fB\-fpcc-struct-return\fR" 4
+.IP "\fB\-fpcc\-struct\-return\fR" 4
.IX Item "-fpcc-struct-return"
Return ``short'' \f(CW\*(C`struct\*(C'\fR and \f(CW\*(C`union\*(C'\fR values in memory like
longer ones, rather than in registers. This convention is less
@@ -7347,45 +7833,45 @@ on the target configuration macros.
.Sp
Short structures and unions are those whose size and alignment match
that of some integer type.
-.Ip "\fB\-freg-struct-return\fR" 4
+.IP "\fB\-freg\-struct\-return\fR" 4
.IX Item "-freg-struct-return"
Use the convention that \f(CW\*(C`struct\*(C'\fR and \f(CW\*(C`union\*(C'\fR values are
returned in registers when possible. This is more efficient for small
-structures than \fB\-fpcc-struct-return\fR.
+structures than \fB\-fpcc\-struct\-return\fR.
.Sp
-If you specify neither \fB\-fpcc-struct-return\fR nor its contrary
-\&\fB\-freg-struct-return\fR, \s-1GCC\s0 defaults to whichever convention is
+If you specify neither \fB\-fpcc\-struct\-return\fR nor its contrary
+\&\fB\-freg\-struct\-return\fR, \s-1GCC\s0 defaults to whichever convention is
standard for the target. If there is no standard convention, \s-1GCC\s0
-defaults to \fB\-fpcc-struct-return\fR, except on targets where \s-1GCC\s0
+defaults to \fB\-fpcc\-struct\-return\fR, except on targets where \s-1GCC\s0
is the principal compiler. In those cases, we can choose the standard,
and we chose the more efficient register return alternative.
-.Ip "\fB\-fshort-enums\fR" 4
+.IP "\fB\-fshort\-enums\fR" 4
.IX Item "-fshort-enums"
Allocate to an \f(CW\*(C`enum\*(C'\fR type only as many bytes as it needs for the
declared range of possible values. Specifically, the \f(CW\*(C`enum\*(C'\fR type
will be equivalent to the smallest integer type which has enough room.
-.Ip "\fB\-fshort-double\fR" 4
+.IP "\fB\-fshort\-double\fR" 4
.IX Item "-fshort-double"
Use the same size for \f(CW\*(C`double\*(C'\fR as for \f(CW\*(C`float\*(C'\fR.
-.Ip "\fB\-fshared-data\fR" 4
+.IP "\fB\-fshared\-data\fR" 4
.IX Item "-fshared-data"
-Requests that the data and non-\f(CW\*(C`const\*(C'\fR variables of this
+Requests that the data and non\-\f(CW\*(C`const\*(C'\fR variables of this
compilation be shared data rather than private data. The distinction
makes sense only on certain operating systems, where shared data is
shared between processes running the same program, while private data
exists in one copy per process.
-.Ip "\fB\-fno-common\fR" 4
+.IP "\fB\-fno\-common\fR" 4
.IX Item "-fno-common"
-Allocate even uninitialized global variables in the data section of the
+In C, allocate even uninitialized global variables in the data section of the
object file, rather than generating them as common blocks. This has the
effect that if the same variable is declared (without \f(CW\*(C`extern\*(C'\fR) in
two different compilations, you will get an error when you link them.
The only reason this might be useful is if you wish to verify that the
program will work on other systems which always work this way.
-.Ip "\fB\-fno-ident\fR" 4
+.IP "\fB\-fno\-ident\fR" 4
.IX Item "-fno-ident"
Ignore the \fB#ident\fR directive.
-.Ip "\fB\-fno-gnu-linker\fR" 4
+.IP "\fB\-fno\-gnu\-linker\fR" 4
.IX Item "-fno-gnu-linker"
Do not output global initializations (such as \*(C+ constructors and
destructors) in the form used by the \s-1GNU\s0 linker (on systems where the \s-1GNU\s0
@@ -7395,35 +7881,35 @@ you want to use a non-GNU linker, which also requires using the
constructors and destructors. (\fBcollect2\fR is included in the \s-1GCC\s0
distribution.) For systems which \fImust\fR use \fBcollect2\fR, the
compiler driver \fBgcc\fR is configured to do this automatically.
-.Ip "\fB\-finhibit-size-directive\fR" 4
+.IP "\fB\-finhibit\-size\-directive\fR" 4
.IX Item "-finhibit-size-directive"
Don't output a \f(CW\*(C`.size\*(C'\fR assembler directive, or anything else that
would cause trouble if the function is split in the middle, and the
two halves are placed at locations far apart in memory. This option is
used when compiling \fIcrtstuff.c\fR; you should not need to use it
for anything else.
-.Ip "\fB\-fverbose-asm\fR" 4
+.IP "\fB\-fverbose\-asm\fR" 4
.IX Item "-fverbose-asm"
Put extra commentary information in the generated assembly code to
make it more readable. This option is generally only of use to those
who actually need to read the generated assembly code (perhaps while
debugging the compiler itself).
.Sp
-\&\fB\-fno-verbose-asm\fR, the default, causes the
+\&\fB\-fno\-verbose\-asm\fR, the default, causes the
extra information to be omitted and is useful when comparing two assembler
files.
-.Ip "\fB\-fvolatile\fR" 4
+.IP "\fB\-fvolatile\fR" 4
.IX Item "-fvolatile"
Consider all memory references through pointers to be volatile.
-.Ip "\fB\-fvolatile-global\fR" 4
+.IP "\fB\-fvolatile\-global\fR" 4
.IX Item "-fvolatile-global"
Consider all memory references to extern and global data items to
be volatile. \s-1GCC\s0 does not consider static data items to be volatile
because of this switch.
-.Ip "\fB\-fvolatile-static\fR" 4
+.IP "\fB\-fvolatile\-static\fR" 4
.IX Item "-fvolatile-static"
Consider all memory references to static data to be volatile.
-.Ip "\fB\-fpic\fR" 4
+.IP "\fB\-fpic\fR" 4
.IX Item "-fpic"
Generate position-independent code (\s-1PIC\s0) suitable for use in a shared
library, if supported for the target machine. Such code accesses all
@@ -7439,8 +7925,8 @@ on the m68k and \s-1RS/6000\s0. The 386 has no such limit.)
Position-independent code requires special support, and therefore works
only on certain machines. For the 386, \s-1GCC\s0 supports \s-1PIC\s0 for System V
but not for the Sun 386i. Code generated for the \s-1IBM\s0 \s-1RS/6000\s0 is always
-position-independent.
-.Ip "\fB\-fPIC\fR" 4
+position\-independent.
+.IP "\fB\-fPIC\fR" 4
.IX Item "-fPIC"
If supported for the target machine, emit position-independent code,
suitable for dynamic linking and avoiding any limit on the size of the
@@ -7449,7 +7935,7 @@ and the Sparc.
.Sp
Position-independent code requires special support, and therefore works
only on certain machines.
-.Ip "\fB\-ffixed-\fR\fIreg\fR" 4
+.IP "\fB\-ffixed\-\fR\fIreg\fR" 4
.IX Item "-ffixed-reg"
Treat the register named \fIreg\fR as a fixed register; generated code
should never refer to it (except perhaps as a stack pointer, frame
@@ -7461,7 +7947,7 @@ macro in the machine description macro file.
.Sp
This flag does not have a negative form, because it specifies a
three-way choice.
-.Ip "\fB\-fcall-used-\fR\fIreg\fR" 4
+.IP "\fB\-fcall\-used\-\fR\fIreg\fR" 4
.IX Item "-fcall-used-reg"
Treat the register named \fIreg\fR as an allocable register that is
clobbered by function calls. It may be allocated for temporaries or
@@ -7474,7 +7960,7 @@ the machine's execution model will produce disastrous results.
.Sp
This flag does not have a negative form, because it specifies a
three-way choice.
-.Ip "\fB\-fcall-saved-\fR\fIreg\fR" 4
+.IP "\fB\-fcall\-saved\-\fR\fIreg\fR" 4
.IX Item "-fcall-saved-reg"
Treat the register named \fIreg\fR as an allocable register saved by
functions. It may be allocated even for temporaries or variables that
@@ -7490,12 +7976,12 @@ a register in which function values may be returned.
.Sp
This flag does not have a negative form, because it specifies a
three-way choice.
-.Ip "\fB\-fpack-struct\fR" 4
+.IP "\fB\-fpack\-struct\fR" 4
.IX Item "-fpack-struct"
Pack all structure members together without holes. Usually you would
not want to use this option, since it makes the code suboptimal, and
the offsets of structure members won't agree with system libraries.
-.Ip "\fB\-fcheck-memory-usage\fR" 4
+.IP "\fB\-fcheck\-memory\-usage\fR" 4
.IX Item "-fcheck-memory-usage"
Generate extra code to check each memory access. \s-1GCC\s0 will generate
code that is suitable for a detector of bad memory accesses such as
@@ -7512,35 +7998,35 @@ If you do not, you might get erroneous messages from the detector.
If you use functions from a library that have side-effects (such as
\&\f(CW\*(C`read\*(C'\fR), you might not be able to recompile the library and
specify this option. In that case, you can enable the
-\&\fB\-fprefix-function-name\fR option, which requests \s-1GCC\s0 to encapsulate
+\&\fB\-fprefix\-function\-name\fR option, which requests \s-1GCC\s0 to encapsulate
your code and make other functions look as if they were compiled with
-\&\fB\-fcheck-memory-usage\fR. This is done by calling ``stubs'',
+\&\fB\-fcheck\-memory\-usage\fR. This is done by calling ``stubs'',
which are provided by the detector. If you cannot find or build
stubs for every function you call, you might have to specify
-\&\fB\-fcheck-memory-usage\fR without \fB\-fprefix-function-name\fR.
+\&\fB\-fcheck\-memory\-usage\fR without \fB\-fprefix\-function\-name\fR.
.Sp
If you specify this option, you can not use the \f(CW\*(C`asm\*(C'\fR or
-\&\f(CW\*(C`_\|_asm_\|_\*(C'\fR keywords in functions with memory checking enabled. \s-1GNU\s0
-\&\s-1CC\s0 cannot understand what the \f(CW\*(C`asm\*(C'\fR statement may do, and therefore
+\&\f(CW\*(C`_\|_asm_\|_\*(C'\fR keywords in functions with memory checking enabled. \s-1GCC\s0
+cannot understand what the \f(CW\*(C`asm\*(C'\fR statement may do, and therefore
cannot generate the appropriate code, so it will reject it. However, if
-you specify the function attribute \f(CW\*(C`no_check_memory_usage\*(C'\fR, \s-1GNU\s0 \s-1CC\s0 will disable memory checking within a
+you specify the function attribute \f(CW\*(C`no_check_memory_usage\*(C'\fR, \s-1GCC\s0 will disable memory checking within a
function; you may use \f(CW\*(C`asm\*(C'\fR statements inside such functions. You
may have an inline expansion of a non-checked function within a checked
-function; in that case \s-1GNU\s0 \s-1CC\s0 will not generate checks for the inlined
+function; in that case \s-1GCC\s0 will not generate checks for the inlined
function's memory accesses.
.Sp
If you move your \f(CW\*(C`asm\*(C'\fR statements to non-checked inline functions
and they do access memory, you can add calls to the support code in your
inline function, to indicate any reads, writes, or copies being done.
These calls would be similar to those done in the stubs described above.
-.Ip "\fB\-fprefix-function-name\fR" 4
+.IP "\fB\-fprefix\-function\-name\fR" 4
.IX Item "-fprefix-function-name"
Request \s-1GCC\s0 to add a prefix to the symbols generated for function names.
\&\s-1GCC\s0 adds a prefix to the names of functions defined as well as
functions called. Code compiled with this option and code compiled
without the option can't be linked together, unless stubs are used.
.Sp
-If you compile the following code with \fB\-fprefix-function-name\fR
+If you compile the following code with \fB\-fprefix\-function\-name\fR
.Sp
.Vb 6
\& extern void bar (int);
@@ -7550,6 +8036,7 @@ If you compile the following code with \fB\-fprefix-function-name\fR
\& return bar (a + 5);
\& }
.Ve
+.Sp
\&\s-1GCC\s0 will compile the code as if it was written:
.Sp
.Vb 6
@@ -7560,8 +8047,9 @@ If you compile the following code with \fB\-fprefix-function-name\fR
\& return prefix_bar (a + 5);
\& }
.Ve
-This option is designed to be used with \fB\-fcheck-memory-usage\fR.
-.Ip "\fB\-finstrument-functions\fR" 4
+.Sp
+This option is designed to be used with \fB\-fcheck\-memory\-usage\fR.
+.IP "\fB\-finstrument\-functions\fR" 4
.IX Item "-finstrument-functions"
Generate instrumentation calls for entry and exit to functions. Just
after function entry and just before function exit, the following
@@ -7571,10 +8059,13 @@ function and its call site. (On some platforms,
function, so the call site information may not be available to the
profiling functions otherwise.)
.Sp
-.Vb 2
-\& void __cyg_profile_func_enter (void *this_fn, void *call_site);
-\& void __cyg_profile_func_exit (void *this_fn, void *call_site);
+.Vb 4
+\& void __cyg_profile_func_enter (void *this_fn,
+\& void *call_site);
+\& void __cyg_profile_func_exit (void *this_fn,
+\& void *call_site);
.Ve
+.Sp
The first argument is the address of the start of the current function,
which may be looked up exactly in the symbol table.
.Sp
@@ -7595,7 +8086,7 @@ example, for the profiling functions listed above, high-priority
interrupt routines, and any functions from which the profiling functions
cannot safely be called (perhaps signal handlers, if the profiling
routines generate output or allocate memory).
-.Ip "\fB\-fstack-check\fR" 4
+.IP "\fB\-fstack\-check\fR" 4
.IX Item "-fstack-check"
Generate code to verify that you do not go beyond the boundary of the
stack. You should specify this flag if you are running in an
@@ -7606,12 +8097,12 @@ detected on nearly all systems if there is only one stack.
Note that this switch does not actually cause checking to be done; the
operating system must do that. The switch causes generation of code
to ensure that the operating system sees the stack being extended.
-.Ip "\fB\-fstack-limit-register=\fR\fIreg\fR" 4
+.IP "\fB\-fstack\-limit\-register=\fR\fIreg\fR" 4
.IX Item "-fstack-limit-register=reg"
.PD 0
-.Ip "\fB\-fstack-limit-symbol=\fR\fIsym\fR" 4
+.IP "\fB\-fstack\-limit\-symbol=\fR\fIsym\fR" 4
.IX Item "-fstack-limit-symbol=sym"
-.Ip "\fB\-fno-stack-limit\fR" 4
+.IP "\fB\-fno\-stack\-limit\fR" 4
.IX Item "-fno-stack-limit"
.PD
Generate code to ensure that the stack does not grow beyond a certain value,
@@ -7622,32 +8113,32 @@ it is possible to catch the signal without taking special precautions.
.Sp
For instance, if the stack starts at address \fB0x80000000\fR and grows
downwards you can use the flags
-\&\fB\-fstack-limit-symbol=_\|_stack_limit\fR
-\&\fB\-Wl,\-\-defsym,_\|_stack_limit=0x7ffe0000\fR which will enforce a stack
+\&\fB\-fstack\-limit\-symbol=_\|_stack_limit
+\&\-Wl,\-\-defsym,_\|_stack_limit=0x7ffe0000\fR which will enforce a stack
limit of 128K.
-.Ip "\fB\-fargument-alias\fR" 4
+.IP "\fB\-fargument\-alias\fR" 4
.IX Item "-fargument-alias"
.PD 0
-.Ip "\fB\-fargument-noalias\fR" 4
+.IP "\fB\-fargument\-noalias\fR" 4
.IX Item "-fargument-noalias"
-.Ip "\fB\-fargument-noalias-global\fR" 4
+.IP "\fB\-fargument\-noalias\-global\fR" 4
.IX Item "-fargument-noalias-global"
.PD
Specify the possible relationships among parameters and between
parameters and global data.
.Sp
-\&\fB\-fargument-alias\fR specifies that arguments (parameters) may
+\&\fB\-fargument\-alias\fR specifies that arguments (parameters) may
alias each other and may alias global storage.
-\&\fB\-fargument-noalias\fR specifies that arguments do not alias
+\&\fB\-fargument\-noalias\fR specifies that arguments do not alias
each other, but may alias global storage.
-\&\fB\-fargument-noalias-global\fR specifies that arguments do not
+\&\fB\-fargument\-noalias\-global\fR specifies that arguments do not
alias each other and do not alias global storage.
.Sp
Each language will automatically use whatever option is required by
the language standard. You should not need to use these options yourself.
-.Ip "\fB\-fleading-underscore\fR" 4
+.IP "\fB\-fleading\-underscore\fR" 4
.IX Item "-fleading-underscore"
-This option and its counterpart, \-fno-leading-underscore, forcibly
+This option and its counterpart, \fB\-fno\-leading\-underscore\fR, forcibly
change the way C symbols are represented in the object file. One use
is to help link with legacy assembly code.
.Sp
@@ -7657,21 +8148,21 @@ option, and that not all targets provide complete support for it.
.IX Header "ENVIRONMENT"
This section describes several environment variables that affect how \s-1GCC\s0
operates. Some of them work by specifying directories or prefixes to use
-when searching for various kinds of files. Some are used to specify other
+when searching for various kinds of files. Some are used to specify other
aspects of the compilation environment.
.PP
Note that you can also specify places to search using options such as
\&\fB\-B\fR, \fB\-I\fR and \fB\-L\fR. These
take precedence over places specified using environment variables, which
in turn take precedence over those specified by the configuration of \s-1GCC\s0.
-.Ip "\fB\s-1LANG\s0\fR" 4
+.IP "\fB\s-1LANG\s0\fR" 4
.IX Item "LANG"
.PD 0
-.Ip "\fB\s-1LC_CTYPE\s0\fR" 4
+.IP "\fB\s-1LC_CTYPE\s0\fR" 4
.IX Item "LC_CTYPE"
-.Ip "\fB\s-1LC_MESSAGES\s0\fR" 4
+.IP "\fB\s-1LC_MESSAGES\s0\fR" 4
.IX Item "LC_MESSAGES"
-.Ip "\fB\s-1LC_ALL\s0\fR" 4
+.IP "\fB\s-1LC_ALL\s0\fR" 4
.IX Item "LC_ALL"
.PD
These environment variables control the way that \s-1GCC\s0 uses
@@ -7696,28 +8187,28 @@ of \fB\s-1LC_CTYPE\s0\fR and \fB\s-1LC_MESSAGES\s0\fR; otherwise, \fB\s-1LC_CTYP
and \fB\s-1LC_MESSAGES\s0\fR default to the value of the \fB\s-1LANG\s0\fR
environment variable. If none of these variables are set, \s-1GCC\s0
defaults to traditional C English behavior.
-.Ip "\fB\s-1TMPDIR\s0\fR" 4
+.IP "\fB\s-1TMPDIR\s0\fR" 4
.IX Item "TMPDIR"
If \fB\s-1TMPDIR\s0\fR is set, it specifies the directory to use for temporary
files. \s-1GCC\s0 uses temporary files to hold the output of one stage of
compilation which is to be used as input to the next stage: for example,
the output of the preprocessor, which is the input to the compiler
proper.
-.Ip "\fB\s-1GCC_EXEC_PREFIX\s0\fR" 4
+.IP "\fB\s-1GCC_EXEC_PREFIX\s0\fR" 4
.IX Item "GCC_EXEC_PREFIX"
If \fB\s-1GCC_EXEC_PREFIX\s0\fR is set, it specifies a prefix to use in the
names of the subprograms executed by the compiler. No slash is added
when this prefix is combined with the name of a subprogram, but you can
specify a prefix that ends with a slash if you wish.
.Sp
-If \fB\s-1GCC_EXEC_PREFIX\s0\fR is not set, \s-1GNU\s0 \s-1CC\s0 will attempt to figure out
+If \fB\s-1GCC_EXEC_PREFIX\s0\fR is not set, \s-1GCC\s0 will attempt to figure out
an appropriate prefix to use based on the pathname it was invoked with.
.Sp
If \s-1GCC\s0 cannot find the subprogram using the specified prefix, it
tries looking in the usual places for the subprogram.
.Sp
The default value of \fB\s-1GCC_EXEC_PREFIX\s0\fR is
-\&\fI\fIprefix\fI/lib/gcc-lib/\fR where \fIprefix\fR is the value
+\&\fI\fIprefix\fI/lib/gcc\-lib/\fR where \fIprefix\fR is the value
of \f(CW\*(C`prefix\*(C'\fR when you ran the \fIconfigure\fR script.
.Sp
Other prefixes specified with \fB\-B\fR take precedence over this prefix.
@@ -7727,20 +8218,20 @@ used for linking.
.Sp
In addition, the prefix is used in an unusual way in finding the
directories to search for header files. For each of the standard
-directories whose name normally begins with \fB/usr/local/lib/gcc-lib\fR
+directories whose name normally begins with \fB/usr/local/lib/gcc\-lib\fR
(more precisely, with the value of \fB\s-1GCC_INCLUDE_DIR\s0\fR), \s-1GCC\s0 tries
replacing that beginning with the specified prefix to produce an
alternate directory name. Thus, with \fB\-Bfoo/\fR, \s-1GCC\s0 will search
\&\fIfoo/bar\fR where it would normally search \fI/usr/local/lib/bar\fR.
These alternate directories are searched first; the standard directories
come next.
-.Ip "\fB\s-1COMPILER_PATH\s0\fR" 4
+.IP "\fB\s-1COMPILER_PATH\s0\fR" 4
.IX Item "COMPILER_PATH"
The value of \fB\s-1COMPILER_PATH\s0\fR is a colon-separated list of
directories, much like \fB\s-1PATH\s0\fR. \s-1GCC\s0 tries the directories thus
specified when searching for subprograms, if it can't find the
subprograms using \fB\s-1GCC_EXEC_PREFIX\s0\fR.
-.Ip "\fB\s-1LIBRARY_PATH\s0\fR" 4
+.IP "\fB\s-1LIBRARY_PATH\s0\fR" 4
.IX Item "LIBRARY_PATH"
The value of \fB\s-1LIBRARY_PATH\s0\fR is a colon-separated list of
directories, much like \fB\s-1PATH\s0\fR. When configured as a native compiler,
@@ -7749,12 +8240,12 @@ linker files, if it can't find them using \fB\s-1GCC_EXEC_PREFIX\s0\fR. Linking
using \s-1GCC\s0 also uses these directories when searching for ordinary
libraries for the \fB\-l\fR option (but directories specified with
\&\fB\-L\fR come first).
-.Ip "\fBC_INCLUDE_PATH\fR" 4
+.IP "\fBC_INCLUDE_PATH\fR" 4
.IX Item "C_INCLUDE_PATH"
.PD 0
-.Ip "\fB\s-1CPLUS_INCLUDE_PATH\s0\fR" 4
+.IP "\fB\s-1CPLUS_INCLUDE_PATH\s0\fR" 4
.IX Item "CPLUS_INCLUDE_PATH"
-.Ip "\fB\s-1OBJC_INCLUDE_PATH\s0\fR" 4
+.IP "\fB\s-1OBJC_INCLUDE_PATH\s0\fR" 4
.IX Item "OBJC_INCLUDE_PATH"
.PD
These environment variables pertain to particular languages. Each
@@ -7763,7 +8254,7 @@ variable's value is a colon-separated list of directories, much like
directories listed in the variable for the language you are using, after
the directories specified with \fB\-I\fR but before the standard header
file directories.
-.Ip "\fB\s-1DEPENDENCIES_OUTPUT\s0\fR" 4
+.IP "\fB\s-1DEPENDENCIES_OUTPUT\s0\fR" 4
.IX Item "DEPENDENCIES_OUTPUT"
If this variable is set, its value specifies how to output dependencies
for Make based on the header files processed by the compiler. This
@@ -7775,21 +8266,21 @@ which case the Make rules are written to that file, guessing the target
name from the source file name. Or the value can have the form
\&\fIfile\fR\fB \fR\fItarget\fR, in which case the rules are written to
file \fIfile\fR using \fItarget\fR as the target name.
-.Ip "\fB\s-1LANG\s0\fR" 4
+.IP "\fB\s-1LANG\s0\fR" 4
.IX Item "LANG"
-This variable is used to pass locale information to the compiler. One way in
+This variable is used to pass locale information to the compiler. One way in
which this information is used is to determine the character set to be used
when character literals, string literals and comments are parsed in C and \*(C+.
When the compiler is configured to allow multibyte characters,
the following values for \fB\s-1LANG\s0\fR are recognized:
.RS 4
-.Ip "\fBC-JIS\fR" 4
+.IP "\fBC\-JIS\fR" 4
.IX Item "C-JIS"
Recognize \s-1JIS\s0 characters.
-.Ip "\fBC-SJIS\fR" 4
+.IP "\fBC\-SJIS\fR" 4
.IX Item "C-SJIS"
Recognize \s-1SJIS\s0 characters.
-.Ip "\fBC-EUCJP\fR" 4
+.IP "\fBC\-EUCJP\fR" 4
.IX Item "C-EUCJP"
Recognize \s-1EUCJP\s0 characters.
.RE
@@ -7806,38 +8297,47 @@ For instructions on reporting bugs, see
script to report bugs is recommended.
.SH "FOOTNOTES"
.IX Header "FOOTNOTES"
-.Ip "1." 4
+.IP "1." 4
On some systems, \fBgcc \-shared\fR
-needs to build supplementary stub code for constructors to work. On
+needs to build supplementary stub code for constructors to work. On
multi-libbed systems, \fBgcc \-shared\fR must select the correct support
libraries to link against. Failing to supply the correct flags may lead
-to subtle defects. Supplying them in cases where they are not necessary
+to subtle defects. Supplying them in cases where they are not necessary
is innocuous.
.SH "SEE ALSO"
.IX Header "SEE ALSO"
+\&\fIgpl\fR\|(7), \fIgfdl\fR\|(7), \fIfsf\-funding\fR\|(7),
\&\fIcpp\fR\|(1), \fIgcov\fR\|(1), \fIg77\fR\|(1), \fIas\fR\|(1), \fIld\fR\|(1), \fIgdb\fR\|(1), \fIadb\fR\|(1), \fIdbx\fR\|(1), \fIsdb\fR\|(1)
and the Info entries for \fIgcc\fR, \fIcpp\fR, \fIg77\fR, \fIas\fR,
\&\fIld\fR, \fIbinutils\fR and \fIgdb\fR.
.SH "AUTHOR"
.IX Header "AUTHOR"
-See the Info entry for \fIgcc\fR, or
-<\fBhttp://gcc.gnu.org/thanks.html\fR>, for contributors to \s-1GCC\s0.
+See the Info entry for \fBgcc\fR, or
+<\fBhttp://gcc.gnu.org/onlinedocs/gcc/Contributors.html\fR>,
+for contributors to \s-1GCC\s0.
.SH "COPYRIGHT"
.IX Header "COPYRIGHT"
Copyright (c) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997,
1998, 1999, 2000, 2001 Free Software Foundation, Inc.
.PP
-Permission is granted to make and distribute verbatim copies of this
-manual provided the copyright notice and this permission notice are
-preserved on all copies.
+Permission is granted to copy, distribute and/or modify this document
+under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.1 or
+any later version published by the Free Software Foundation; with the
+Invariant Sections being ``\s-1GNU\s0 General Public License'' and ``Funding
+Free Software'', the Front-Cover texts being (a) (see below), and with
+the Back-Cover Texts being (b) (see below). A copy of the license is
+included in the \fIgfdl\fR\|(7) man page.
+.PP
+(a) The \s-1FSF\s0's Front-Cover Text is:
.PP
-Permission is granted to copy and distribute modified versions of this
-manual under the conditions for verbatim copying, provided also that the
-entire resulting derived work is distributed under the terms of a
-permission notice identical to this one.
+.Vb 1
+\& A GNU Manual
+.Ve
+.PP
+(b) The \s-1FSF\s0's Back-Cover Text is:
.PP
-Permission is granted to copy and distribute translations of this manual
-into another language, under the above conditions for modified versions,
-except that this permission notice may be included in translations
-approved by the Free Software Foundation instead of in the original
-English.
+.Vb 3
+\& You have freedom to copy and modify this GNU Manual, like GNU
+\& software. Copies published by the Free Software Foundation raise
+\& funds for GNU development.
+.Ve
diff --git a/gcc/gcc.texi b/gcc/doc/gcc.texi
index bc355d0e443..cb9268dab9b 100644
--- a/gcc/gcc.texi
+++ b/gcc/doc/gcc.texi
@@ -28,14 +28,12 @@
@c NOTE: checks/things to do:
@c
@c -have bob do a search in all seven files for "mew" (ideally --mew,
-@c but i may have forgotten the occasional "--"..).
+@c but i may have forgotten the occasional "--"..).
@c Just checked... all have `--'! Bob 22Jul96
@c Use this to search: grep -n '\-\-mew' *.texi
@c -item/itemx, text after all (sub/sub)section titles, etc..
@c -consider putting the lists of options on pp 17--> etc in columns or
@c some such.
-@c -spellcheck
-@c -continuity of phrasing; ie, bit-field vs bitfield in rtl.texi
@c -overfulls. do a search for "mew" in the files, and you will see
@c overfulls that i noted but could not deal with.
@c -have to add text: beginning of chapter 8
@@ -75,8 +73,15 @@
@settitle Porting the GNU Compiler Collection
@end ifclear
+@c Create a separate index for command line options.
+@defcodeindex op
+@c Merge the standard indexes into a single one.
@syncodeindex fn cp
@syncodeindex vr cp
+@syncodeindex ky cp
+@syncodeindex pg cp
+@syncodeindex tp cp
+
@c %**end of header
@c Use with @@smallbook.
@@ -96,6 +101,12 @@
@c \global\normaloffset =0.75in
@c @end tex
+@c Change the font used for @def... commands, since the default
+@c proportional one used is bad for names starting __.
+@tex
+\global\setfont\defbf\ttbshape{10}{\magstep1}
+@end tex
+
@ifnottex
@dircategory Programming
@direntry
@@ -122,30 +133,23 @@ Boston, MA 02111-1307 USA
Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
1999, 2000, 2001 Free Software Foundation, Inc.
@sp 1
-Permission is granted to make and distribute verbatim copies of
-this manual provided the copyright notice and this permission notice
-are preserved on all copies.
-@sp 1
-@ignore
-Permission is granted to process this file through Tex and print the
-results, provided the printed document carries copying permission
-notice identical to this one except for the removal of this paragraph
-(this paragraph not being relevant to the printed manual).
+Permission is granted to copy, distribute and/or modify this document
+under the terms of the GNU Free Documentation License, Version 1.1 or
+any later version published by the Free Software Foundation; with the
+Invariant Sections being ``GNU General Public License'' and ``Funding
+Free Software'', the Front-Cover texts being (a) (see below), and with
+the Back-Cover Texts being (b) (see below). A copy of the license is
+included in the section entitled ``GNU Free Documentation License''.
-@end ignore
-Permission is granted to copy and distribute modified versions of this
-manual under the conditions for verbatim copying, provided also that the
-sections entitled ``GNU General Public License'' and ``Funding for Free
-Software'' are included exactly as in the original, and provided that
-the entire resulting derived work is distributed under the terms of a
-permission notice identical to this one.
-@sp 1
-Permission is granted to copy and distribute translations of this manual
-into another language, under the above conditions for modified versions,
-except that the sections entitled ``GNU General Public License'' and
-``Funding for Free Software'', and this permission notice, may be
-included in translations approved by the Free Software Foundation
-instead of in the original English.
+(a) The FSF's Front-Cover Text is:
+
+ A GNU Manual
+
+(b) The FSF's Back-Cover Text is:
+
+ You have freedom to copy and modify this GNU Manual, like GNU
+ software. Copies published by the Free Software Foundation raise
+ funds for GNU development.
@end ifnottex
@setchapternewpage odd
@@ -166,43 +170,45 @@ instead of in the original English.
@sp 2
@center Richard M. Stallman
@sp 3
-@center Last updated 8 February 2001
+@center Last updated 22 June 2001
@sp 1
@c The version number appears five times more in this file.
-@center for gcc-2.97
+@center for GCC 3.0
@page
@vskip 0pt plus 1filll
Copyright @copyright{} 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1998,
1999, 2000, 2001 Free Software Foundation, Inc.
@sp 2
-For GCC Version 2.97@*
+For GCC Version 3.0@*
@sp 1
Published by the Free Software Foundation @*
-59 Temple Place - Suite 330@*
+59 Temple Place---Suite 330@*
Boston, MA 02111-1307, USA@*
Last printed April, 1998.@*
Printed copies are available for $50 each.@*
ISBN 1-882114-37-X
@sp 1
-Permission is granted to make and distribute verbatim copies of
-this manual provided the copyright notice and this permission notice
-are preserved on all copies.
-
-Permission is granted to copy and distribute modified versions of this
-manual under the conditions for verbatim copying, provided also that the
-sections entitled ``GNU General Public License'' and ``Funding for Free
-Software'' are included exactly as in the original, and provided that
-the entire resulting derived work is distributed under the terms of a
-permission notice identical to this one.
-
-Permission is granted to copy and distribute translations of this manual
-into another language, under the above conditions for modified versions,
-except that the sections entitled ``GNU General Public License'' and
-``Funding for Free Software'', and this permission notice, may be
-included in translations approved by the Free Software Foundation
-instead of in the original English.
+Permission is granted to copy, distribute and/or modify this document
+under the terms of the GNU Free Documentation License, Version 1.1 or
+any later version published by the Free Software Foundation; with the
+Invariant Sections being ``GNU General Public License'', the Front-Cover
+texts being (a) (see below), and with the Back-Cover Texts being (b)
+(see below). A copy of the license is included in the section entitled
+``GNU Free Documentation License''.
+
+(a) The FSF's Front-Cover Text is:
+
+ A GNU Manual
+
+(b) The FSF's Back-Cover Text is:
+
+ You have freedom to copy and modify this GNU Manual, like GNU
+ software. Copies published by the Free Software Foundation raise
+ funds for GNU development.
@end titlepage
+@summarycontents
+@contents
@page
@node Top, G++ and GCC,, (DIR)
@@ -213,19 +219,19 @@ instead of in the original English.
@ifset USING
This manual documents how to run, install and port the GNU
compiler, as well as its new features and incompatibilities, and how to
-report bugs. It corresponds to GCC version 2.97.
+report bugs. It corresponds to GCC version 3.0.
@end ifset
@end ifset
@ifclear INTERNALS
This manual documents how to run and install the GNU compiler,
as well as its new features and incompatibilities, and how to report
-bugs. It corresponds to GCC version 2.97.
+bugs. It corresponds to GCC version 3.0.
@end ifclear
@ifclear USING
This manual documents how to port the GNU compiler,
as well as its new features and incompatibilities, and how to report
-bugs. It corresponds to GCC version 2.97.
+bugs. It corresponds to GCC version 3.0.
@end ifclear
@menu
@@ -236,18 +242,20 @@ bugs. It corresponds to GCC version 2.97.
* Installation:: How to configure, compile and install GCC.
* C Extensions:: GNU extensions to the C language family.
* C++ Extensions:: GNU extensions to the C++ language.
+* Objective C:: GNU Objective-C runtime features.
* Gcov:: gcov: a GCC test coverage program.
* Trouble:: If you have trouble installing GCC.
* Bugs:: How, why and where to report bugs.
* Service:: How to find suppliers of support for GCC.
* Contributing:: How to contribute to testing and developing GCC.
* VMS:: Using GCC on VMS.
-* Makefile:: List of Makefile targets.
+* Makefile:: Additional Makefile and configure information.
@end ifset
@ifset INTERNALS
* Portability:: Goals of GCC's portability features.
* Interface:: Function-call interface of GCC output.
* Passes:: Order of passes, what they do, and what each file is for.
+* Trees:: The source representation used by the C and C++ front ends.
* RTL:: The intermediate representation that most passes work on.
* Machine Desc:: How to write machine description instruction patterns.
* Target Macros:: How to write the machine description C macros.
@@ -260,20 +268,23 @@ bugs. It corresponds to GCC version 2.97.
* Copying:: GNU General Public License says
how you can copy and share GCC.
+* GNU Free Documentation License:: How you can copy and share this manual.
* Contributors:: People who have contributed to GCC.
+* Option Index:: Index to command line options.
* Index:: Index of concepts and symbol names.
@end menu
@ifset USING
@node G++ and GCC
-@chapter Compile C, C++, Objective C, Fortran, Java or CHILL
+@chapter Compile C, C++, Objective C, Fortran, Java
@cindex Objective C
-Several versions of the compiler (C, C++, Objective C, Fortran, Java
-and CHILL) are integrated; this is why we use the name
-``GNU Compiler Collection''. GCC can compile programs written in any of these
-languages. The Fortran, CHILL, and Java compilers are described in
+@cindex Fortran
+@cindex Java
+Several versions of the compiler (C, C++, Objective C, Fortran, Java) are integrated; this is why we use the name
+``GNU Compiler Collection''. GCC can compile programs written in any of these
+languages. The Fortran and Java compilers are described in
separate manuals.
@cindex GCC
@@ -295,7 +306,7 @@ compiler. For example, we refer to the optimization options as
affecting the behavior of ``GCC'' or sometimes just ``the compiler''.
Front ends for other languages, such as Ada 95 and Pascal exist but
-have not yet been integrated into GCC. These front-ends, like that for C++,
+have not yet been integrated into GCC@. These front ends, like that for C++,
are built in subdirectories of GCC and link to it. The result is an
integrated compiler that can compile programs written in C, C++,
Objective C, or any of the languages for which you have installed front
@@ -367,6 +378,10 @@ with some exceptions, and possibly with some extensions.
GCC supports three versions of the C standard, although support for
the most recent version is not yet complete.
+@opindex std
+@opindex ansi
+@opindex pedantic
+@opindex pedantic-errors
The original ANSI C standard (X3.159-1989) was ratified in 1989 and
published in 1990. This standard was ratified as an ISO standard
(ISO/IEC 9899:1990) later in 1990. There were no technical
@@ -376,9 +391,9 @@ This standard, in both its forms, is commonly known as @dfn{C89}, or
occasionally as @dfn{C90}, from the dates of ratification. The ANSI
standard, but not the ISO standard, also came with a Rationale
document. To select this standard in GCC, use one of the options
-@samp{-ansi}, @samp{-std=c89} or @samp{-std=iso9899:1990}; to obtain
+@option{-ansi}, @option{-std=c89} or @option{-std=iso9899:1990}; to obtain
all the diagnostics required by the standard, you should also specify
-@samp{-pedantic} (or @samp{-pedantic-errors} if you want them to be
+@option{-pedantic} (or @option{-pedantic-errors} if you want them to be
errors rather than warnings). @xref{C Dialect Options,,Options
Controlling C Dialect}.
@@ -391,19 +406,20 @@ amendment added digraphs and @code{__STDC_VERSION__} to the language,
but otherwise concerned the library. This amendment is commonly known
as @dfn{AMD1}; the amended standard is sometimes known as @dfn{C94} or
@dfn{C95}. To select this standard in GCC, use the option
-@samp{-std=iso9899:199409} (with, as for other standard versions,
-@samp{-pedantic} to receive all required diagnostics).
+@option{-std=iso9899:199409} (with, as for other standard versions,
+@option{-pedantic} to receive all required diagnostics).
A new edition of the ISO C standard was published in 1999 as ISO/IEC
9899:1999, and is commonly known as @dfn{C99}. GCC has incomplete
support for this standard version; see
-@uref{http://gcc.gnu.org/c99status.html} for details. To select this
-standard, use @samp{-std=c99} or @samp{-std=iso9899:1999}. (While in
+@uref{http://gcc.gnu.org/gcc-3.0/c99status.html} for details. To select this
+standard, use @option{-std=c99} or @option{-std=iso9899:1999}. (While in
development, drafts of this standard version were referred to as
@dfn{C9X}.)
+@opindex traditional
GCC also has some limited support for traditional (pre-ISO) C with the
-@samp{-traditional} option. This support may be of use for compiling
+@option{-traditional} option. This support may be of use for compiling
some very old programs that have not been updated to ISO C, but should
not be used for new programs. It will not work with some modern C
libraries such as the GNU C library.
@@ -411,13 +427,13 @@ libraries such as the GNU C library.
By default, GCC provides some extensions to the C language that on
rare occasions conflict with the C standard. @xref{C
Extensions,,Extensions to the C Language Family}. Use of the
-@samp{-std} options listed above will disable these extensions where
+@option{-std} options listed above will disable these extensions where
they conflict with the C standard version selected. You may also
select an extended version of the C language explicitly with
-@samp{-std=gnu89} (for C89 with GNU extensions) or @samp{-std=gnu99}
+@option{-std=gnu89} (for C89 with GNU extensions) or @option{-std=gnu99}
(for C99 with GNU extensions). The default, if no C language dialect
-options are given, is @samp{-std=gnu89}; this will change to
-@samp{-std=gnu99} in some future release when the C99 support is
+options are given, is @option{-std=gnu89}; this will change to
+@option{-std=gnu99} in some future release when the C99 support is
complete. Some features that are part of the C99 standard are
accepted as extensions in C89 mode.
@@ -441,21 +457,22 @@ char *[])}. An OS kernel would be a freestanding environment; a
program using the facilities of an operating system would normally be
in a hosted implementation.
-GNU CC aims towards being usable as a conforming freestanding
+@opindex ffreestanding
+GCC aims towards being usable as a conforming freestanding
implementation, or as the compiler for a conforming hosted
implementation. By default, it will act as the compiler for a hosted
implementation, defining @code{__STDC_HOSTED__} as @code{1} and
presuming that when the names of ISO C functions are used, they have
the semantics defined in the standard. To make it act as a conforming
freestanding implementation for a freestanding environment, use the
-option @samp{-ffreestanding}; it will then define
+option @option{-ffreestanding}; it will then define
@code{__STDC_HOSTED__} to @code{0} and not make assumptions about the
meanings of function names from the standard library. To build an OS
kernel, you may well still need to make your own arrangements for
linking and startup. @xref{C Dialect Options,,Options Controlling C
Dialect}.
-GNU CC does not provide the library facilities required only of hosted
+GCC does not provide the library facilities required only of hosted
implementations, nor yet all the facilities required by C99 of
freestanding implementations; to use the facilities of a hosted
environment, you will need to find them elsewhere (for example, in the
@@ -466,23 +483,29 @@ information concerning the history of C that is available online, see
@uref{http://gcc.gnu.org/readings.html}
@c FIXME: details of C++ standard.
-@c FIXME: definitions of Java and Objective C.
+
+There is no formal written standard for Objective-C@. The most
+authoritative manual is ``Object-Oriented Programming and the
+Objective-C Language'', available at a number of web sites;
+@uref{http://developer.apple.com/techpubs/macosx/Cocoa/ObjectiveC/} has a
+recent version, while @uref{http://www.toodarkpark.org/computers/objc/}
+is an older example. @uref{http://www.gnustep.org} includes useful
+information as well.
@xref{Language,,The GNU Fortran Language, g77, Using and Porting GNU
-Fortran}, for details of the Fortran language supported by GCC.
+Fortran}, for details of the Fortran language supported by GCC@.
@xref{Compatibility,,Compatibility with the Java Platform, gcj, GNU gcj},
for details of compatibility between @code{gcj} and the Java Platform.
-@xref{References,,Language Definition References, chill, GNU Chill},
-for details of the CHILL standard.
-
@include invoke.texi
-@include install.texi
+@include install-old.texi
@include extend.texi
+@include objc.texi
+
@include gcov.texi
@node Trouble
@@ -491,7 +514,7 @@ for details of the CHILL standard.
@cindex installation trouble
@cindex known causes of trouble
-This section describes known problems that affect users of GCC. Most
+This section describes known problems that affect users of GCC@. Most
of these are not GCC bugs per se---if they were, we would fix them.
But the result for a user may be like the result of a bug.
@@ -501,15 +524,14 @@ where people's opinions differ as to what is best.
@menu
* Actual Bugs:: Bugs we will fix later.
-* Installation Problems:: Problems that manifest when you install GCC.
* Cross-Compiler Problems:: Common problems of cross compiling with GCC.
* Interoperation:: Problems using GCC with other compilers,
and with certain linkers, assemblers and debuggers.
* External Bugs:: Problems compiling certain programs.
* Incompatibilities:: GCC is incompatible with traditional C.
-* Fixed Headers:: GNU C uses corrected versions of system header files.
+* Fixed Headers:: GCC uses corrected versions of system header files.
This is necessary, but doesn't always work smoothly.
-* Standard Libraries:: GNU C uses the system C library, which might not be
+* Standard Libraries:: GCC uses the system C library, which might not be
compliant with the ISO C standard.
* Disappointments:: Regrettable things we can't change, but not quite bugs.
* C++ Misunderstandings:: Common misunderstandings with GNU C++.
@@ -537,392 +559,10 @@ edit the offending file and place the typedef in front of the
prototypes.
@item
-When @samp{-pedantic-errors} is specified, GCC will incorrectly give
+@opindex pedantic-errors
+When @option{-pedantic-errors} is specified, GCC will incorrectly give
an error message when a function name is specified in an expression
involving the comma operator.
-
-@item
-Loop unrolling doesn't work properly for certain C++ programs. This is
-a bug in the C++ front end. It sometimes emits incorrect debug info, and
-the loop unrolling code is unable to recover from this error.
-@end itemize
-
-@node Installation Problems
-@section Installation Problems
-
-This is a list of problems (and some apparent problems which don't
-really mean anything is wrong) that show up during installation of GNU
-CC.
-
-@itemize @bullet
-@item
-On certain systems, defining certain environment variables such as
-@code{CC} can interfere with the functioning of @code{make}.
-
-@item
-If you encounter seemingly strange errors when trying to build the
-compiler in a directory other than the source directory, it could be
-because you have previously configured the compiler in the source
-directory. Make sure you have done all the necessary preparations.
-@xref{Other Dir}.
-
-@item
-If you build GCC on a BSD system using a directory stored in a System
-V file system, problems may occur in running @code{fixincludes} if the
-System V file system doesn't support symbolic links. These problems
-result in a failure to fix the declaration of @code{size_t} in
-@file{sys/types.h}. If you find that @code{size_t} is a signed type and
-that type mismatches occur, this could be the cause.
-
-The solution is not to use such a directory for building GCC.
-
-@item
-In previous versions of GCC, the @code{gcc} driver program looked for
-@code{as} and @code{ld} in various places; for example, in files
-beginning with @file{/usr/local/lib/gcc-}. GCC version 2 looks for
-them in the directory
-@file{/usr/local/lib/gcc-lib/@var{target}/@var{version}}.
-
-Thus, to use a version of @code{as} or @code{ld} that is not the system
-default, for example @code{gas} or GNU @code{ld}, you must put them in
-that directory (or make links to them from that directory).
-
-@item
-Some commands executed when making the compiler may fail (return a
-non-zero status) and be ignored by @code{make}. These failures, which
-are often due to files that were not found, are expected, and can safely
-be ignored.
-
-@item
-It is normal to have warnings in compiling certain files about
-unreachable code and about enumeration type clashes. These files' names
-begin with @samp{insn-}. Also, @file{real.c} may get some warnings that
-you can ignore.
-
-@item
-Sometimes @code{make} recompiles parts of the compiler when installing
-the compiler. In one case, this was traced down to a bug in
-@code{make}. Either ignore the problem or switch to GNU Make.
-
-@item
-If you have installed a program known as purify, you may find that it
-causes errors while linking @code{enquire}, which is part of building
-GCC. The fix is to get rid of the file @code{real-ld} which purify
-installs---so that GCC won't try to use it.
-
-@item
-On GNU/Linux SLS 1.01, there is a problem with @file{libc.a}: it does not
-contain the obstack functions. However, GCC assumes that the obstack
-functions are in @file{libc.a} when it is the GNU C library. To work
-around this problem, change the @code{__GNU_LIBRARY__} conditional
-around line 31 to @samp{#if 1}.
-
-@item
-On some 386 systems, building the compiler never finishes because
-@code{enquire} hangs due to a hardware problem in the motherboard---it
-reports floating point exceptions to the kernel incorrectly. You can
-install GCC except for @file{float.h} by patching out the command to
-run @code{enquire}. You may also be able to fix the problem for real by
-getting a replacement motherboard. This problem was observed in
-Revision E of the Micronics motherboard, and is fixed in Revision F.
-It has also been observed in the MYLEX MXA-33 motherboard.
-
-If you encounter this problem, you may also want to consider removing
-the FPU from the socket during the compilation. Alternatively, if you
-are running SCO Unix, you can reboot and force the FPU to be ignored.
-To do this, type @samp{hd(40)unix auto ignorefpu}.
-
-@item
-On some 386 systems, GCC crashes trying to compile @file{enquire.c}.
-This happens on machines that don't have a 387 FPU chip. On 386
-machines, the system kernel is supposed to emulate the 387 when you
-don't have one. The crash is due to a bug in the emulator.
-
-One of these systems is the Unix from Interactive Systems: 386/ix.
-On this system, an alternate emulator is provided, and it does work.
-To use it, execute this command as super-user:
-
-@example
-ln /etc/emulator.rel1 /etc/emulator
-@end example
-
-@noindent
-and then reboot the system. (The default emulator file remains present
-under the name @file{emulator.dflt}.)
-
-Try using @file{/etc/emulator.att}, if you have such a problem on the
-SCO system.
-
-Another system which has this problem is Esix. We don't know whether it
-has an alternate emulator that works.
-
-On NetBSD 0.8, a similar problem manifests itself as these error messages:
-
-@example
-enquire.c: In function `fprop':
-enquire.c:2328: floating overflow
-@end example
-
-@item
-On SCO systems, when compiling GCC with the system's compiler,
-do not use @samp{-O}. Some versions of the system's compiler miscompile
-GCC with @samp{-O}.
-
-@cindex @code{genflags}, crash on Sun 4
-@item
-Sometimes on a Sun 4 you may observe a crash in the program
-@code{genflags} or @code{genoutput} while building GCC. This is said to
-be due to a bug in @code{sh}. You can probably get around it by running
-@code{genflags} or @code{genoutput} manually and then retrying the
-@code{make}.
-
-@item
-On Solaris 2, executables of GCC version 2.0.2 are commonly
-available, but they have a bug that shows up when compiling current
-versions of GCC: undefined symbol errors occur during assembly if you
-use @samp{-g}.
-
-The solution is to compile the current version of GCC without
-@samp{-g}. That makes a working compiler which you can use to recompile
-with @samp{-g}.
-
-@item
-Solaris 2 comes with a number of optional OS packages. Some of these
-packages are needed to use GCC fully. If you did not install all
-optional packages when installing Solaris, you will need to verify that
-the packages that GCC needs are installed.
-
-To check whether an optional package is installed, use
-the @code{pkginfo} command. To add an optional package, use the
-@code{pkgadd} command. For further details, see the Solaris
-documentation.
-
-For Solaris 2.0 and 2.1, GCC needs six packages: @samp{SUNWarc},
-@samp{SUNWbtool}, @samp{SUNWesu}, @samp{SUNWhea}, @samp{SUNWlibm}, and
-@samp{SUNWtoo}.
-
-For Solaris 2.2, GCC needs an additional seventh package: @samp{SUNWsprot}.
-
-@item
-On Solaris 2, trying to use the linker and other tools in
-@file{/usr/ucb} to install GCC has been observed to cause trouble.
-For example, the linker may hang indefinitely. The fix is to remove
-@file{/usr/ucb} from your @code{PATH}.
-
-@item
-If you use the 1.31 version of the MIPS assembler (such as was shipped
-with Ultrix 3.1), you will need to use the -fno-delayed-branch switch
-when optimizing floating point code. Otherwise, the assembler will
-complain when the GCC compiler fills a branch delay slot with a
-floating point instruction, such as @code{add.d}.
-
-@item
-If on a MIPS system you get an error message saying ``does not have gp
-sections for all it's [sic] sectons [sic]'', don't worry about it. This
-happens whenever you use GAS with the MIPS linker, but there is not
-really anything wrong, and it is okay to use the output file. You can
-stop such warnings by installing the GNU linker.
-
-It would be nice to extend GAS to produce the gp tables, but they are
-optional, and there should not be a warning about their absence.
-
-@item
-In Ultrix 4.0 on the MIPS machine, @file{stdio.h} does not work with GNU
-CC at all unless it has been fixed with @code{fixincludes}. This causes
-problems in building GCC. Once GCC is installed, the problems go
-away.
-
-To work around this problem, when making the stage 1 compiler, specify
-this option to Make:
-
-@example
-GCC_FOR_TARGET="./xgcc -B./ -I./include"
-@end example
-
-When making stage 2 and stage 3, specify this option:
-
-@example
-CFLAGS="-g -I./include"
-@end example
-
-@item
-Users have reported some problems with version 2.0 of the MIPS
-compiler tools that were shipped with Ultrix 4.1. Version 2.10
-which came with Ultrix 4.2 seems to work fine.
-
-Users have also reported some problems with version 2.20 of the
-MIPS compiler tools that were shipped with RISC/os 4.x. The earlier
-version 2.11 seems to work fine.
-
-@item
-Some versions of the MIPS linker will issue an assertion failure
-when linking code that uses @code{alloca} against shared
-libraries on RISC-OS 5.0, and DEC's OSF/1 systems. This is a bug
-in the linker, that is supposed to be fixed in future revisions.
-To protect against this, GCC passes @samp{-non_shared} to the
-linker unless you pass an explicit @samp{-shared} or
-@samp{-call_shared} switch.
-
-@item
-On System V release 3, you may get this error message
-while linking:
-
-@smallexample
-ld fatal: failed to write symbol name @var{something}
- in strings table for file @var{whatever}
-@end smallexample
-
-This probably indicates that the disk is full or your ULIMIT won't allow
-the file to be as large as it needs to be.
-
-This problem can also result because the kernel parameter @code{MAXUMEM}
-is too small. If so, you must regenerate the kernel and make the value
-much larger. The default value is reported to be 1024; a value of 32768
-is said to work. Smaller values may also work.
-
-@item
-On System V, if you get an error like this,
-
-@example
-/usr/local/lib/bison.simple: In function `yyparse':
-/usr/local/lib/bison.simple:625: virtual memory exhausted
-@end example
-
-@noindent
-that too indicates a problem with disk space, ULIMIT, or @code{MAXUMEM}.
-
-@item
-Current GCC versions probably do not work on version 2 of the NeXT
-operating system.
-
-@item
-On NeXTStep 3.0, the Objective C compiler does not work, due,
-apparently, to a kernel bug that it happens to trigger. This problem
-does not happen on 3.1.
-
-@item
-On the Tower models 4@var{n}0 and 6@var{n}0, by default a process is not
-allowed to have more than one megabyte of memory. GCC cannot compile
-itself (or many other programs) with @samp{-O} in that much memory.
-
-To solve this problem, reconfigure the kernel adding the following line
-to the configuration file:
-
-@smallexample
-MAXUMEM = 4096
-@end smallexample
-
-@item
-On HP 9000 series 300 or 400 running HP-UX release 8.0, there is a bug
-in the assembler that must be fixed before GCC can be built. This
-bug manifests itself during the first stage of compilation, while
-building @file{libgcc2.a}:
-
-@smallexample
-_floatdisf
-cc1: warning: `-g' option not supported on this version of GCC
-cc1: warning: `-g1' option not supported on this version of GCC
-./xgcc: Internal compiler error: program as got fatal signal 11
-@end smallexample
-
-A patched version of the assembler is available as the file
-@uref{ftp://altdorf.ai.mit.edu/archive/cph/hpux-8.0-assembler}. If you
-have HP software support, the patch can also be obtained directly from
-HP, as described in the following note:
-
-@quotation
-This is the patched assembler, to patch SR#1653-010439, where the
-assembler aborts on floating point constants.
-
-The bug is not really in the assembler, but in the shared library
-version of the function ``cvtnum(3c)''. The bug on ``cvtnum(3c)'' is
-SR#4701-078451. Anyway, the attached assembler uses the archive
-library version of ``cvtnum(3c)'' and thus does not exhibit the bug.
-@end quotation
-
-This patch is also known as PHCO_4484.
-
-@item
-On HP-UX version 8.05, but not on 8.07 or more recent versions,
-the @code{fixproto} shell script triggers a bug in the system shell.
-If you encounter this problem, upgrade your operating system or
-use BASH (the GNU shell) to run @code{fixproto}.
-
-@item
-Some versions of the Pyramid C compiler are reported to be unable to
-compile GCC. You must use an older version of GCC for
-bootstrapping. One indication of this problem is if you get a crash
-when GCC compiles the function @code{muldi3} in file @file{libgcc2.c}.
-
-You may be able to succeed by getting GCC version 1, installing it,
-and using it to compile GCC version 2. The bug in the Pyramid C
-compiler does not seem to affect GCC version 1.
-
-@item
-There may be similar problems on System V Release 3.1 on 386 systems.
-
-@item
-On the Intel Paragon (an i860 machine), if you are using operating
-system version 1.0, you will get warnings or errors about redefinition
-of @code{va_arg} when you build GCC.
-
-If this happens, then you need to link most programs with the library
-@file{iclib.a}. You must also modify @file{stdio.h} as follows: before
-the lines
-
-@example
-#if defined(__i860__) && !defined(_VA_LIST)
-#include <va_list.h>
-@end example
-
-@noindent
-insert the line
-
-@example
-#if __PGC__
-@end example
-
-@noindent
-and after the lines
-
-@example
-extern int vprintf(const char *, va_list );
-extern int vsprintf(char *, const char *, va_list );
-#endif
-@end example
-
-@noindent
-insert the line
-
-@example
-#endif /* __PGC__ */
-@end example
-
-These problems don't exist in operating system version 1.1.
-
-@item
-On the Altos 3068, programs compiled with GCC won't work unless you
-fix a kernel bug. This happens using system versions V.2.2 1.0gT1 and
-V.2.2 1.0e and perhaps later versions as well. See the file
-@file{README.ALTOS}.
-
-@item
-You will get several sorts of compilation and linking errors on the
-we32k if you don't follow the special instructions. @xref{Configurations}.
-
-@item
-A bug in the HP-UX 8.05 (and earlier) shell will cause the fixproto
-program to report an error of the form:
-
-@example
-./fixproto: sh internal 1K buffer overflow
-@end example
-
-To fix this, change the first line of the fixproto script to look like:
-
-@example
-#!/bin/ksh
-@end example
@end itemize
@node Cross-Compiler Problems
@@ -969,16 +609,13 @@ compile environment.
@node Interoperation
@section Interoperation
-This section lists various difficulties encountered in using GNU C or
-GNU C++ together with other compilers or with the assemblers, linkers,
+This section lists various difficulties encountered in using GCC
+together with other compilers or with the assemblers, linkers,
libraries and debuggers on certain systems.
@itemize @bullet
@item
-Objective C does not work on the RS/6000.
-
-@item
-GNU C++ does not do name mangling in the same way as other C++
+G++ does not do name mangling in the same way as other C++
compilers. This means that object files compiled with one compiler
cannot be used with another.
@@ -998,12 +635,12 @@ Older GDB versions sometimes fail to read the output of GCC version
@item
@cindex DBX
DBX rejects some files produced by GCC, though it accepts similar
-constructs in output from PCC. Until someone can supply a coherent
+constructs in output from PCC@. Until someone can supply a coherent
description of what is valid DBX input and what is not, there is
nothing I can do about these problems. You are on your own.
@item
-The GNU assembler (GAS) does not support PIC. To generate PIC code, you
+The GNU assembler (GAS) does not support PIC@. To generate PIC code, you
must use some other assembler, such as @file{/bin/as}.
@item
@@ -1012,12 +649,12 @@ causes static variable destructors (currently used only in C++) not to
be run.
@item
-Use of @samp{-I/usr/include} may cause trouble.
+Use of @option{-I/usr/include} may cause trouble.
Many systems come with header files that won't work with GCC unless
corrected by @code{fixincludes}. The corrected header files go in a new
directory; GCC searches this directory before @file{/usr/include}.
-If you use @samp{-I/usr/include}, this tells GCC to search
+If you use @option{-I/usr/include}, this tells GCC to search
@file{/usr/include} earlier on, before the corrected headers. The
result is that you get the uncorrected header files.
@@ -1051,13 +688,13 @@ parent across the call to @code{vfork}.
If you encounter this, you can work around the problem by declaring
variables @code{volatile} in the function that calls @code{vfork}, until
the problem goes away, or by not declaring them @code{register} and not
-using @samp{-O} for those source files.
+using @option{-O} for those source files.
@end ignore
@item
-On some SGI systems, when you use @samp{-lgl_s} as an option,
+On some SGI systems, when you use @option{-lgl_s} as an option,
it gets translated magically to @samp{-lgl_s -lX11_s -lc_s}.
-Naturally, this does not happen when you use GCC.
+Naturally, this does not happen when you use GCC@.
You must specify all three options explicitly.
@item
@@ -1071,8 +708,8 @@ argument of type @code{double} and passes this pointer of type
@code{double *} to a function compiled with GCC, dereferencing the
pointer may cause a fatal signal.
-One way to solve this problem is to compile your entire program with GNU
-CC. Another solution is to modify the function that is compiled with
+One way to solve this problem is to compile your entire program with GCC@.
+Another solution is to modify the function that is compiled with
Sun CC to copy the argument into a local variable; local variables
are always properly aligned. A third solution is to modify the function
that uses the pointer to dereference it via the following function
@@ -1111,7 +748,7 @@ this problem.
@item
Sun forgot to include a static version of @file{libdl.a} with some
versions of SunOS (mainly 4.1). This results in undefined symbols when
-linking static binaries (that is, if you use @samp{-static}). If you
+linking static binaries (that is, if you use @option{-static}). If you
see undefined symbols @code{_dlclose}, @code{_dlsym} or @code{_dlopen}
when linking, compile and link against the file
@file{mit/util/misc/dlsym.c} from the MIT version of X windows.
@@ -1136,13 +773,13 @@ compile itself properly on 9.01.
@item
On the HP PA machine, ADB sometimes fails to work on functions compiled
-with GCC. Specifically, it fails to work on functions that use
+with GCC@. Specifically, it fails to work on functions that use
@code{alloca} or variable-size arrays. This is because GCC doesn't
generate HP-UX unwind descriptors for such functions. It may even be
impossible to generate them.
@item
-Debugging (@samp{-g}) is not supported on the HP PA machine, unless you use
+Debugging (@option{-g}) is not supported on the HP PA machine, unless you use
the preliminary GNU tools (@pxref{Installation}).
@item
@@ -1175,8 +812,8 @@ These warnings are harmless and can be safely ignored.
@item
The current version of the assembler (@file{/bin/as}) for the RS/6000
-has certain problems that prevent the @samp{-g} option in GCC from
-working. Note that @file{Makefile.in} uses @samp{-g} by default when
+has certain problems that prevent the @option{-g} option in GCC from
+working. Note that @file{Makefile.in} uses @option{-g} by default when
compiling @file{libgcc2.c}.
IBM has produced a fixed version of the assembler. The upgraded
@@ -1194,7 +831,7 @@ as -u < /dev/null
@noindent
If the command exits normally, the assembler fix already is installed.
-If the assembler complains that "-u" is an unknown flag, you need to
+If the assembler complains that @option{-u} is an unknown flag, you need to
order the fix.
@item
@@ -1212,34 +849,54 @@ static int foo;
will cause the linker to report an undefined symbol @code{foo}.
Although this behavior differs from most other systems, it is not a
bug because redefining an @code{extern} variable as @code{static}
-is undefined in ISO C.
+is undefined in ISO C@.
+
+@item
+The @file{libstdc++.a} library in GCC relies on the SVR4 dynamic
+linker semantics which merges global symbols between libraries and
+applications, especially necessary for C++ streams functionality.
+This is not the default behavior of AIX shared libraries and dynamic
+linking. @file{libstdc++.a} is built on AIX with ``runtime-linking''
+enabled so that symbol merging can occur. To utilize this feature,
+the application linked with @file{libstdc++.a} must include the
+@option{-Wl,-brtl} flag on the link line. G++ cannot impose this
+because this option may interfere with the semantics of the user
+program and users may not always use @samp{g++} to link his or her
+application. Applications are not required to use the
+@option{-Wl,-brtl} flag on the link line---the rest of the
+@file{libstdc++.a} library which is not dependent on the symbol
+merging semantics will continue to function correctly.
+
+@item
+An application can interpose its own definition of functions for
+functions invoked by @file{libstdc++.a} with ``runtime-linking''
+enabled on AIX. To accomplish this the application must be linked
+with ``runtime-linking'' option and the functions explicitly must be
+exported by the application (@option{-Wl,-brtl,-bE:exportfile}).
@item
AIX on the RS/6000 provides support (NLS) for environments outside of
the United States. Compilers and assemblers use NLS to support
locale-specific representations of various objects including
-floating-point numbers ("." vs "," for separating decimal fractions).
+floating-point numbers (@samp{.} vs @samp{,} for separating decimal fractions).
There have been problems reported where the library linked with GCC does
not produce the same floating-point formats that the assembler accepts.
-If you have this problem, set the LANG environment variable to "C" or
-"En_US".
+If you have this problem, set the @env{LANG} environment variable to
+@samp{C} or @samp{En_US}.
@item
-Even if you specify @samp{-fdollars-in-identifiers},
+@opindex fdollars-in-identifiers
+Even if you specify @option{-fdollars-in-identifiers},
you cannot successfully use @samp{$} in identifiers on the RS/6000 due
to a restriction in the IBM assembler. GAS supports these
identifiers.
@item
-On the RS/6000, XLC version 1.3.0.0 will miscompile @file{jump.c}. XLC
-version 1.3.0.1 or later fixes this problem. You can obtain XLC-1.3.0.2
-by requesting PTF 421749 from IBM.
-
-@item
+@opindex mno-serialize-volatile
There is an assembler bug in versions of DG/UX prior to 5.4.2.01 that
occurs when the @samp{fldcr} instruction is used. GCC uses
@samp{fldcr} on the 88100 to serialize volatile memory references. Use
-the option @samp{-mno-serialize-volatile} if your version of the
+the option @option{-mno-serialize-volatile} if your version of the
assembler has this bug.
@item
@@ -1256,7 +913,7 @@ lines around the definition of @code{size_t}:
@smallexample
#ifndef _SIZE_T
#define _SIZE_T
-@var{actual typedef here}
+@var{actual-typedef-here}
#endif
@end smallexample
@@ -1269,14 +926,16 @@ what options are used.
@cindex RT PC
@cindex IBM RT PC
@item
+@opindex mhc-struct-return
On the IBM RT PC, the MetaWare HighC compiler (hc) uses a different
convention for structure and union returning. Use the option
-@samp{-mhc-struct-return} to tell GCC to use a convention compatible
+@option{-mhc-struct-return} to tell GCC to use a convention compatible
with it.
@cindex Vax calling convention
@cindex Ultrix calling convention
@item
+@opindex fcall-saved
On Ultrix, the Fortran compiler expects registers 2 through 5 to be saved
by function calls. However, the C compiler uses conventions compatible
with BSD Unix: registers 2 through 5 may be clobbered by function calls.
@@ -1299,11 +958,11 @@ options:
@end smallexample
The first specifies where to find the library @file{libgcc.a}
-specified with the @samp{-lgcc} option.
+specified with the @option{-lgcc} option.
-GCC does linking by invoking @code{ld}, just as @code{cc} does, and
+GCC does linking by invoking @command{ld}, just as @command{cc} does, and
there is no reason why it @emph{should} matter which compilation program
-you use to invoke @code{ld}. If someone tracks this problem down,
+you use to invoke @command{ld}. If someone tracks this problem down,
it can probably be fixed easily.
@item
@@ -1318,12 +977,13 @@ sometimes reorders instructions incorrectly when optimization is turned
on. If you think this may be happening to you, try using the GNU
assembler; GAS version 2.1 supports ECOFF on Irix.
-Or use the @samp{-noasmopt} option when you compile GCC with itself,
+@opindex noasmopt
+Or use the @option{-noasmopt} option when you compile GCC with itself,
and then again when you compile your program. (This is a temporary
kludge to turn off assembler optimization on Irix.) If this proves to
be what you need, edit the assembler spec in the file @file{specs} so
-that it unconditionally passes @samp{-O0} to the assembler, and never
-passes @samp{-O2} or @samp{-O3}.
+that it unconditionally passes @option{-O0} to the assembler, and never
+passes @option{-O2} or @option{-O3}.
@end itemize
@node External Bugs
@@ -1337,8 +997,8 @@ Certain programs have problems compiling.
Parse errors may occur compiling X11 on a Decstation running Ultrix 4.2
because of problems in DEC's versions of the X11 header files
@file{X11/Xlib.h} and @file{X11/Xutil.h}. People recommend adding
-@samp{-I/usr/include/mit} to use the MIT versions of the header files,
-using the @samp{-traditional} switch to turn off ISO C, or fixing the
+@option{-I/usr/include/mit} to use the MIT versions of the header files,
+using the @option{-traditional} switch to turn off ISO C, or fixing the
header files by adding this:
@example
@@ -1376,11 +1036,12 @@ MALLOC=gmalloc.o
@node Incompatibilities
@section Incompatibilities of GCC
@cindex incompatibilities of GCC
+@opindex traditional
-There are several noteworthy incompatibilities between GNU C and K&R
-(non-ISO) versions of C. The @samp{-traditional} option
+There are several noteworthy incompatibilities between GNU C and K&R
+(non-ISO) versions of C@. The @option{-traditional} option
eliminates many of these incompatibilities, @emph{but not all}, by
-telling GNU C to behave like a K&R C compiler.
+telling GCC to behave like a K&R C compiler.
@itemize @bullet
@cindex string constants
@@ -1404,12 +1065,13 @@ when passed a string constant as its format control string or input.
This is because @code{sscanf} incorrectly tries to write into the string
constant. Likewise @code{fscanf} and @code{scanf}.
+@opindex fwritable-strings
The best solution to these problems is to change the program to use
@code{char}-array variables with initialization strings for these
purposes instead of string constants. But if this is not possible,
-you can use the @samp{-fwritable-strings} flag, which directs GCC
+you can use the @option{-fwritable-strings} flag, which directs GCC
to handle string constants the same way most C compilers do.
-@samp{-traditional} also has this effect, among others.
+@option{-traditional} also has this effect, among others.
@item
@code{-2147483648} is positive.
@@ -1429,7 +1091,7 @@ string constants. For example, the following macro in GCC
@noindent
will produce output @code{"a"} regardless of what the argument @var{a} is.
-The @samp{-traditional} option directs GCC to handle such cases
+The @option{-traditional} option directs GCC to handle such cases
(among others) in the old-fashioned (non-ISO) fashion.
@cindex @code{setjmp} incompatibilities
@@ -1462,32 +1124,35 @@ Here @code{a} may or may not be restored to its first value when the
its first value is restored; otherwise, it keeps the last value stored
in it.
-If you use the @samp{-W} option with the @samp{-O} option, you will
+@opindex W
+If you use the @option{-W} option with the @option{-O} option, you will
get a warning when GCC thinks such a problem might be possible.
-The @samp{-traditional} option directs GNU C to put variables in
+The @option{-traditional} option directs GCC to put variables in
the stack by default, rather than in registers, in functions that
call @code{setjmp}. This results in the behavior found in
traditional C compilers.
@item
Programs that use preprocessing directives in the middle of macro
-arguments do not work with GCC. For example, a program like this
+arguments do not work with GCC@. For example, a program like this
will not work:
@example
+@group
foobar (
#define luser
hack)
+@end group
@end example
ISO C does not permit such a construct. It would make sense to support
-it when @samp{-traditional} is used, but it is too much work to
+it when @option{-traditional} is used, but it is too much work to
implement.
@item
-K&R compilers allow comments to cross over an inclusion boundary (i.e.
-started in an include file and ended in the including file). I think
+K&R compilers allow comments to cross over an inclusion boundary
+(i.e.@: started in an include file and ended in the including file). I think
this would be quite ugly and can't imagine it could be needed.
@cindex external declaration scope
@@ -1501,7 +1166,7 @@ have the same scope as any other declaration in the same place.
In some other C compilers, a @code{extern} declaration affects all the
rest of the file even if it happens within a block.
-The @samp{-traditional} option directs GNU C to treat all @code{extern}
+The @option{-traditional} option directs GCC to treat all @code{extern}
declarations as global, like traditional compilers.
@item
@@ -1515,7 +1180,7 @@ typedef long foo bar;
In ISO C, this is not allowed: @code{long} and other type modifiers
require an explicit @code{int}. Because this criterion is expressed
-by Bison grammar rules rather than C code, the @samp{-traditional}
+by Bison grammar rules rather than C code, the @option{-traditional}
flag cannot alter it.
@cindex typedef names as function parameters
@@ -1524,7 +1189,7 @@ PCC allows typedef names to be used as function parameters. The
difficulty described immediately above applies here too.
@item
-When in @samp{-traditional} mode, GCC allows the following erroneous
+When in @option{-traditional} mode, GCC allows the following erroneous
pair of declarations to appear together in a given scope:
@example
@@ -1534,7 +1199,7 @@ typedef foo foo;
@item
GCC treats all characters of identifiers as significant, even when in
-@samp{-traditional} mode. According to K&R-1 (2.2), ``No more than the
+@option{-traditional} mode. According to K&R-1 (2.2), ``No more than the
first eight characters are significant, although more may be used.''.
Also according to K&R-1 (2.2), ``An identifier is a sequence of letters
and digits; the first character must be a letter. The underscore _
@@ -1564,7 +1229,7 @@ You can't expect this to work.
The best solution to such a problem is to put the text into an actual
C comment delimited by @samp{/*@dots{}*/}. However,
-@samp{-traditional} suppresses these error messages.
+@option{-traditional} suppresses these error messages.
@item
Many user programs contain the declaration @samp{long time ();}. In the
@@ -1613,17 +1278,18 @@ structure and union returning. GCC on most of these machines uses a
compatible convention when returning structures and unions in memory,
but still returns small structures and unions in registers.
+@opindex fpcc-struct-return
You can tell GCC to use a compatible convention for all structure and
-union returning with the option @samp{-fpcc-struct-return}.
+union returning with the option @option{-fpcc-struct-return}.
@cindex preprocessing tokens
@cindex preprocessing numbers
@item
-GNU C complains about program fragments such as @samp{0x74ae-0x4000}
+GCC complains about program fragments such as @samp{0x74ae-0x4000}
which appear to be two hexadecimal constants separated by the minus
operator. Actually, this string is a single @dfn{preprocessing token}.
-Each such token must correspond to one token in C. Since this does not,
-GNU C prints an error message. Although it may appear obvious that what
+Each such token must correspond to one token in C@. Since this does not,
+GCC prints an error message. Although it may appear obvious that what
is meant is an operator and two values, the ISO C standard specifically
requires that this be treated as erroneous.
@@ -1657,7 +1323,7 @@ doesn't do the right thing automatically.
@item
If you update the system's header files, such as by installing a new
system version, the fixed header files of GCC are not automatically
-updated. The easiest way to update them is to reinstall GCC. (If
+updated. The easiest way to update them is to reinstall GCC@. (If
you want to be clever, look in the makefile and you can find a
shortcut.)
@@ -1691,13 +1357,14 @@ does mean that there's nothing for us to do about them.
@node Standard Libraries
@section Standard Libraries
+@opindex Wall
GCC by itself attempts to be a conforming freestanding implementation.
@xref{Standards,,Language Standards Supported by GCC}, for details of
what this means. Beyond the library facilities required of such an
implementation, the rest of the C library is supplied by the vendor of
the operating system. If that C library doesn't conform to the C
standards, then your programs might get warnings (especially when using
-@samp{-Wall}) that you don't expect.
+@option{-Wall}) that you don't expect.
For example, the @code{sprintf} function on SunOS 4.1.3 returns
@code{char *} while the C standard says that @code{sprintf} returns an
@@ -1765,13 +1432,13 @@ being incompatible with ISO C just to avoid an error for the example
shown above.
@item
-Accesses to bitfields even in volatile objects works by accessing larger
+Accesses to bit-fields even in volatile objects works by accessing larger
objects, such as a byte or a word. You cannot rely on what size of
-object is accessed in order to read or write the bitfield; it may even
-vary for a given bitfield according to the precise usage.
+object is accessed in order to read or write the bit-field; it may even
+vary for a given bit-field according to the precise usage.
If you care about controlling the amount of memory that is accessed, use
-volatile but do not use bitfields.
+volatile but do not use bit-fields.
@item
GCC comes with shell scripts to fix certain known problems in system
@@ -1797,7 +1464,8 @@ hold a few more bits of precision than fit in a @code{double} in memory.
Compiled code moves values between memory and floating point registers
at its convenience, and moving them into memory truncates them.
-You can partially avoid this problem by using the @samp{-ffloat-store}
+@opindex ffloat-store
+You can partially avoid this problem by using the @option{-ffloat-store}
option (@pxref{Optimize Options}).
@item
@@ -1817,6 +1485,11 @@ implemented using the ISO standard @file{stdarg.h} method of
variable arguments. Furthermore, calls to functions using @file{stdarg.h}
variable arguments must have a prototype for the called function
in scope at the time of the call.
+
+@item
+On AIX and other platforms without weak symbol support, templates
+need to be instantiated explicitly and symbols for static members
+of templates will not be generated.
@end itemize
@node C++ Misunderstandings
@@ -1883,7 +1556,7 @@ temporary object. The compiler may very well delete the object before
you expect it to, leaving a pointer to garbage. The most common place
where this problem crops up is in classes like string classes,
especially ones that define a conversion function to type @code{char *}
-or @code{const char *} -- which is one reason why the standard
+or @code{const char *}---which is one reason why the standard
@code{string} class requires you to call the @code{c_str} member
function. However, any class that returns a pointer to some internal
structure is potentially subject to this problem.
@@ -1896,13 +1569,13 @@ operates on pointers to @code{char}:
string strfunc ();
void charfunc (const char *);
-void
+void
f ()
@{
const char *p = strfunc().c_str();
- ...
+ @dots{}
charfunc (p);
- ...
+ @dots{}
charfunc (p);
@}
@end example
@@ -1933,9 +1606,9 @@ charfunc (tmp.c_str ());
@subsection Implicit Copy-Assignment for Virtual Bases
When a base class is virtual, only one subobject of the base class
-belongs to each full object. Also, the constructors and destructors are
-invoked only once, and called from the most-derived class. However, such
-objects behave unspecified when being assigned. For example:
+belongs to each full object. Also, the constructors and destructors are
+invoked only once, and called from the most-derived class. However, such
+objects behave unspecified when being assigned. For example:
@example
struct Base@{
@@ -1968,57 +1641,58 @@ void func(Derived &d1, Derived &d2)
@end example
The C++ standard specifies that @samp{Base::Base} is only called once
-when constructing or copy-constructing a Derived object. It is
+when constructing or copy-constructing a Derived object. It is
unspecified whether @samp{Base::operator=} is called more than once when
the implicit copy-assignment for Derived objects is invoked (as it is
inside @samp{func} in the example).
-g++ implements the "intuitive" algorithm for copy-assignment: assign all
-direct bases, then assign all members. In that algorithm, the virtual
-base subobject can be encountered many times. In the example, copying
+g++ implements the ``intuitive'' algorithm for copy-assignment: assign all
+direct bases, then assign all members. In that algorithm, the virtual
+base subobject can be encountered many times. In the example, copying
proceeds in the following order: @samp{val}, @samp{name} (via
@code{strdup}), @samp{bval}, and @samp{name} again.
If application code relies on copy-assignment, a user-defined
-copy-assignment operator removes any uncertainties. With such an
+copy-assignment operator removes any uncertainties. With such an
operator, the application can define whether and how the virtual base
subobject is assigned.
@node Protoize Caveats
-@section Caveats of using @code{protoize}
+@section Caveats of using @command{protoize}
-The conversion programs @code{protoize} and @code{unprotoize} can
+The conversion programs @command{protoize} and @command{unprotoize} can
sometimes change a source file in a way that won't work unless you
rearrange it.
@itemize @bullet
@item
-@code{protoize} can insert references to a type name or type tag before
+@command{protoize} can insert references to a type name or type tag before
the definition, or in a file where they are not defined.
If this happens, compiler error messages should show you where the new
references are, so fixing the file by hand is straightforward.
@item
-There are some C constructs which @code{protoize} cannot figure out.
+There are some C constructs which @command{protoize} cannot figure out.
For example, it can't determine argument types for declaring a
-pointer-to-function variable; this you must do by hand. @code{protoize}
+pointer-to-function variable; this you must do by hand. @command{protoize}
inserts a comment containing @samp{???} each time it finds such a
variable; so you can find all such variables by searching for this
string. ISO C does not require declaring the argument types of
pointer-to-function types.
@item
-Using @code{unprotoize} can easily introduce bugs. If the program
+Using @command{unprotoize} can easily introduce bugs. If the program
relied on prototypes to bring about conversion of arguments, these
conversions will not take place in the program without prototypes.
-One case in which you can be sure @code{unprotoize} is safe is when
-you are removing prototypes that were made with @code{protoize}; if
+One case in which you can be sure @command{unprotoize} is safe is when
+you are removing prototypes that were made with @command{protoize}; if
the program worked before without any prototypes, it will work again
without them.
+@opindex Wconversion
You can find all the places where this problem might occur by compiling
-the program with the @samp{-Wconversion} option. It prints a warning
+the program with the @option{-Wconversion} option. It prints a warning
whenever an argument is converted.
@item
@@ -2030,14 +1704,14 @@ only a few functions have confusing macro calls, you can easily convert
them manually.
@item
-@code{protoize} cannot get the argument types for a function whose
+@command{protoize} cannot get the argument types for a function whose
definition was not actually compiled due to preprocessing conditionals.
-When this happens, @code{protoize} changes nothing in regard to such
-a function. @code{protoize} tries to detect such instances and warn
+When this happens, @command{protoize} changes nothing in regard to such
+a function. @command{protoize} tries to detect such instances and warn
about them.
-You can generally work around this problem by using @code{protoize} step
-by step, each time specifying a different set of @samp{-D} options for
+You can generally work around this problem by using @command{protoize} step
+by step, each time specifying a different set of @option{-D} options for
compilation, until all of the functions have been converted. There is
no automatic way to verify that you have got them all, however.
@@ -2057,7 +1731,7 @@ parenthesis of the function header). This should circumvent the
problem.
@item
-@code{unprotoize} can become confused when trying to convert a function
+@command{unprotoize} can become confused when trying to convert a function
definition or declaration which contains a declaration for a
pointer-to-function formal argument which has the same name as the
function being defined or declared. We recommend you avoid such choices
@@ -2108,14 +1782,8 @@ clutter the program with a cast to @code{void} whenever the value isn't
useful.
@item
-Assuming (for optimization) that the address of an external symbol is
-never zero.
-
-This assumption is false on certain systems when @samp{#pragma weak} is
-used.
-
-@item
-Making @samp{-fshort-enums} the default.
+@opindex fshort-enums
+Making @option{-fshort-enums} the default.
This would cause storage layout to be incompatible with most other C
compilers. And it doesn't seem very important, given that you can get
@@ -2124,31 +1792,33 @@ the enumeration-valued object is inside a structure, and in that case
you can specify a field width explicitly.
@item
-Making bitfields unsigned by default on particular machines where ``the
+Making bit-fields unsigned by default on particular machines where ``the
ABI standard'' says to do so.
-The ISO C standard leaves it up to the implementation whether a bitfield
+The ISO C standard leaves it up to the implementation whether a bit-field
declared plain @code{int} is signed or not. This in effect creates two
-alternative dialects of C.
+alternative dialects of C@.
+@opindex fsigned-bitfields
+@opindex funsigned-bitfields
The GNU C compiler supports both dialects; you can specify the signed
-dialect with @samp{-fsigned-bitfields} and the unsigned dialect with
-@samp{-funsigned-bitfields}. However, this leaves open the question of
+dialect with @option{-fsigned-bitfields} and the unsigned dialect with
+@option{-funsigned-bitfields}. However, this leaves open the question of
which dialect to use by default.
-Currently, the preferred dialect makes plain bitfields signed, because
+Currently, the preferred dialect makes plain bit-fields signed, because
this is simplest. Since @code{int} is the same as @code{signed int} in
-every other context, it is cleanest for them to be the same in bitfields
+every other context, it is cleanest for them to be the same in bit-fields
as well.
Some computer manufacturers have published Application Binary Interface
-standards which specify that plain bitfields should be unsigned. It is
-a mistake, however, to say anything about this issue in an ABI. This is
-because the handling of plain bitfields distinguishes two dialects of C.
+standards which specify that plain bit-fields should be unsigned. It is
+a mistake, however, to say anything about this issue in an ABI@. This is
+because the handling of plain bit-fields distinguishes two dialects of C@.
Both dialects are meaningful on every type of machine. Whether a
-particular object file was compiled using signed bitfields or unsigned
+particular object file was compiled using signed bit-fields or unsigned
is of no concern to other object files, even if they access the same
-bitfields in the same data structures.
+bit-fields in the same data structures.
A given program is written in one or the other of these two dialects.
The program stands a chance to work on most any machine if it is
@@ -2157,7 +1827,7 @@ compiled with the wrong dialect.
Many users appreciate the GNU C compiler because it provides an
environment that is uniform across machines. These users would be
-inconvenienced if the compiler treated plain bitfields differently on
+inconvenienced if the compiler treated plain bit-fields differently on
certain machines.
Occasionally users write programs intended only for a particular machine
@@ -2167,27 +1837,30 @@ that machine. But such applications are rare. And users writing a
program to run on more than one type of machine cannot possibly benefit
from this kind of compatibility.
-This is why GCC does and will treat plain bitfields in the same
+This is why GCC does and will treat plain bit-fields in the same
fashion on all types of machines (by default).
-There are some arguments for making bitfields unsigned by default on all
+There are some arguments for making bit-fields unsigned by default on all
machines. If, for example, this becomes a universal de facto standard,
it would make sense for GCC to go along with it. This is something
to be considered in the future.
(Of course, users strongly concerned about portability should indicate
-explicitly in each bitfield whether it is signed or not. In this way,
+explicitly in each bit-field whether it is signed or not. In this way,
they write programs which have the same meaning in both C dialects.)
@item
-Undefining @code{__STDC__} when @samp{-ansi} is not used.
+@opindex ansi
+@opindex traditional
+@opindex std
+Undefining @code{__STDC__} when @option{-ansi} is not used.
Currently, GCC defines @code{__STDC__} as long as you don't use
-@samp{-traditional}. This provides good results in practice.
+@option{-traditional}. This provides good results in practice.
Programmers normally use conditionals on @code{__STDC__} to ask whether
it is safe to use certain features of ISO C, such as function
-prototypes or ISO token concatenation. Since plain @samp{gcc} supports
+prototypes or ISO token concatenation. Since plain @command{gcc} supports
all the features of ISO C, the correct answer to these questions is
``yes''.
@@ -2204,13 +1877,13 @@ Sometimes people say that defining @code{__STDC__} in a compiler that
does not completely conform to the ISO C standard somehow violates the
standard. This is illogical. The standard is a standard for compilers
that claim to support ISO C, such as @samp{gcc -ansi}---not for other
-compilers such as plain @samp{gcc}. Whatever the ISO C standard says
-is relevant to the design of plain @samp{gcc} without @samp{-ansi} only
+compilers such as plain @command{gcc}. Whatever the ISO C standard says
+is relevant to the design of plain @command{gcc} without @option{-ansi} only
for pragmatic reasons, not as a requirement.
GCC normally defines @code{__STDC__} to be 1, and in addition
defines @code{__STRICT_ANSI__} if you specify the @option{-ansi} option,
-or a @option{-std} option for strict conformance to some version of ISO C.
+or a @option{-std} option for strict conformance to some version of ISO C@.
On some hosts, system include files use a different convention, where
@code{__STDC__} is normally 0, but is 1 if the user specifies strict
conformance to the C Standard. GCC follows the host convention when
@@ -2231,7 +1904,7 @@ These programs work properly with GNU C++ if @code{__STDC__} is defined.
They would not work otherwise.
In addition, many header files are written to provide prototypes in ISO
-C but not in traditional C. Many of these header files can work without
+C but not in traditional C@. Many of these header files can work without
change in C++ provided @code{__STDC__} is defined. If @code{__STDC__}
is not defined, they will all fail, and will all need to be changed to
test explicitly for C++ as well.
@@ -2248,7 +1921,8 @@ However, the rationale here is that optimization of a nonempty loop
cannot produce an empty one, which holds for C but is not always the
case for C++.
-Moreover, with @samp{-funroll-loops} small ``empty'' loops are already
+@opindex funroll-loops
+Moreover, with @option{-funroll-loops} small ``empty'' loops are already
removed, so the current behavior is both sub-optimal and inconsistent
and will change in the future.
@@ -2287,11 +1961,12 @@ Making certain warnings into errors by default.
Some ISO C testsuites report failure when the compiler does not produce
an error message for a certain program.
+@opindex pedantic-errors
ISO C requires a ``diagnostic'' message for certain kinds of invalid
programs, but a warning is defined by GCC to count as a diagnostic. If
GCC produces a warning but not an error, that is correct ISO C support.
If test suites call this ``failure'', they should be run with the GCC
-option @samp{-pedantic-errors}, which will turn these warnings into
+option @option{-pedantic-errors}, which will turn these warnings into
errors.
@end itemize
@@ -2307,12 +1982,12 @@ warnings. Each kind has a different purpose:
@itemize @w{}
@item
-@emph{Errors} report problems that make it impossible to compile your
+@dfn{Errors} report problems that make it impossible to compile your
program. GCC reports errors with the source file name and line
number where the problem is apparent.
@item
-@emph{Warnings} report other unusual conditions in your code that
+@dfn{Warnings} report other unusual conditions in your code that
@emph{may} indicate a problem, although compilation can (and does)
proceed. Warning messages also report the source file name and line
number, but include the text @samp{warning:} to distinguish them
@@ -2322,17 +1997,19 @@ from error messages.
Warnings may indicate danger points where you should check to make sure
that your program really does what you intend; or the use of obsolete
features; or the use of nonstandard features of GNU C or C++. Many
-warnings are issued only if you ask for them, with one of the @samp{-W}
-options (for instance, @samp{-Wall} requests a variety of useful
+warnings are issued only if you ask for them, with one of the @option{-W}
+options (for instance, @option{-Wall} requests a variety of useful
warnings).
+@opindex pedantic
+@opindex pedantic-errors
GCC always tries to compile your program if possible; it never
gratuitously rejects a program whose meaning is clear merely because
(for instance) it fails to conform to a standard. In some cases,
however, the C and C++ standards specify that certain extensions are
forbidden, and a diagnostic @emph{must} be issued by a conforming
-compiler. The @samp{-pedantic} option tells GCC to issue warnings in
-such cases; @samp{-pedantic-errors} says to make them errors instead.
+compiler. The @option{-pedantic} option tells GCC to issue warnings in
+such cases; @option{-pedantic-errors} says to make them errors instead.
This does not mean that @emph{all} non-ISO constructs get warnings
or errors.
@@ -2354,7 +2031,7 @@ Reporting a bug may help you by bringing a solution to your problem, or
it may not. (If it does not, look in the service directory; see
@ref{Service}.) In any case, the principal function of a bug report is
to help the entire community by making the next version of GCC work
-better. Bug reports are your contribution to the maintenance of GCC.
+better. Bug reports are your contribution to the maintenance of GCC@.
Since the maintainers are very overloaded, we cannot respond to every
bug report. However, if the bug has not been fixed, we are likely to
@@ -2368,7 +2045,6 @@ information that makes for fixing the bug.
* Where: Bug Lists. Where to send your bug report.
* Reporting: Bug Reporting. How to report a bug effectively.
* GNATS: gccbug. You can use a bug reporting tool.
-* Patches: Sending Patches. How to send a patch for GCC.
* Known: Trouble. Known problems.
* Help: Service. Where to ask for help.
@end menu
@@ -2436,7 +2112,7 @@ that is a compiler bug. However, you should note that your idea of
for traditional practice''.
@item
-If you are an experienced user of one of the languages GCC supports, your
+If you are an experienced user of one of the languages GCC supports, your
suggestions for improvement of GCC are welcome in any case.
@end itemize
@@ -2494,20 +2170,20 @@ things:
@itemize @bullet
@item
-The version of GCC. You can get this by running it with the
-@samp{-v} option.
+The version of GCC@. You can get this by running it with the
+@option{-v} option.
Without this, we won't know whether there is any point in looking for
-the bug in the current version of GCC.
+the bug in the current version of GCC@.
@item
A complete input file that will reproduce the bug. If the bug is in the
C preprocessor, send a source file and any header files that it
requires. If the bug is in the compiler proper (@file{cc1}), send the
-preprocessor output generated by adding @samp{-save-temps} to the
+preprocessor output generated by adding @option{-save-temps} to the
compilation command (@pxref{Debugging Options}). When you do this, use
-the same @samp{-I}, @samp{-D} or @samp{-U} options that you used in
-actual compilation. Then send the @var{input}.i or @var{input}.ii files
+the same @option{-I}, @option{-D} or @option{-U} options that you used in
+actual compilation. Then send the @var{input}.i or @var{input}.ii files
generated.
A single statement is not enough of an example. In order to compile it,
@@ -2530,7 +2206,7 @@ a certain percentage of wild goose chases.
@item
The command arguments you gave GCC to compile that example
-and observe the bug. For example, did you use @samp{-O}? To guarantee
+and observe the bug. For example, did you use @option{-O}? To guarantee
you won't omit something important, list all the options.
If we were to try to guess the arguments, we would probably guess wrong
@@ -2558,7 +2234,7 @@ don't support) is a modification of the compiler source.
@item
Details of any other deviations from the standard procedure for installing
-GCC.
+GCC@.
@item
A description of what behavior you observe that you believe is
@@ -2595,7 +2271,7 @@ bug in the program itself.
@item
If you send examples of assembler code output from GCC,
-please use @samp{-g} when you make them. The debugging information
+please use @option{-g} when you make them. The debugging information
includes source line numbers which are essential for correlating the
output with the input.
@@ -2693,7 +2369,8 @@ And if we can't understand what bug you are trying to fix, or why your
patch should be an improvement, we won't install it. A test case will
help us to understand.
-@xref{Sending Patches}, for guidelines on how to make it easy for us to
+See @uref{http://gcc.gnu.org/contribute.html}
+for guidelines on how to make it easy for us to
understand and install your patches.
@item
@@ -2710,252 +2387,24 @@ unless we have an identical system---and if we do have one,
we should be able to reproduce the crash ourselves.
@end itemize
-@node gccbug,Sending Patches, Bug Reporting, Bugs
+@node gccbug,, Bug Reporting, Bugs
@section The gccbug script
@cindex gccbug script
To simplify creation of bug reports, and to allow better tracking of
-reports, we use the GNATS bug tracking system. Part of that system is
-the @code{gccbug} script. This is a Unix shell script, so you need a
-shell to run it. It is normally installed in the same directory where
+reports, we use the GNATS bug tracking system. Part of that system is
+the @code{gccbug} script. This is a Unix shell script, so you need a
+shell to run it. It is normally installed in the same directory where
@code{gcc} is installed.
The gccbug script is derived from send-pr, @pxref{using
-send-pr,,Creating new Problem Reports,send-pr,Reporting Problems}. When
+send-pr,,Creating new Problem Reports,send-pr,Reporting Problems}. When
invoked, it starts a text editor so you can fill out the various fields
-of the report. When the you quit the editor, the report is automatically
+of the report. When the you quit the editor, the report is automatically
send to the bug reporting address.
A number of fields in this bug report form are specific to GCC, and are
-explained here.
-
-@table @code
-
-@cindex @code{Category} field
-@cindex @code{>Category:}
-@item >Category:
-The category of a GCC problem can be one of the following:
-
-@table @code
-@item c
-A problem with the C compiler proper.
-driver.
-
-@item c++
-A problem with the C++ compiler.
-driver.
-
-@item fortran
-A problem with the Fortran 77.
-
-@item java
-A problem with the Java compiler.
-
-@item objc
-A problem with the Objective C compiler.
-
-@item libstdc++
-A problem with the C++ standard library.
-
-@item libf2c
-A problem with the Fortran 77 library.
-
-@item libobjc
-A problem with the Objective C library.
-
-@item optimization
-The problem occurs only when generating optimized code.
-
-@item debug
-The problem occurs only when generating code for debugging.
-
-@item target
-The problem is specific to the target architecture.
-
-@item middle-end
-The problem is independent from target architecture and programming
-language.
-
-@item other
-It is a problem in some other part of the GCC software.
-
-@item web
-There is a problem with the GCC home page.
-
-@end table
-
-@cindex @code{Class} field
-@cindex @code{>Class:}
-@item >Class:
-The class of a problem can be one of the following:
-
-@table @code
-@cindex @emph{doc-bug} class
-@item doc-bug
-A problem with the documentation.
-
-@cindex @emph{accepts-illegal} class
-@item accepts-illegal
-GCC fails to reject erroneous code.
-
-@cindex @emph{rejects-legal} class
-@item rejects-legal
-GCC gives an error message for correct code.
-
-@cindex @emph{wrong-code} class
-@item wrong-code
-The machine code generated by gcc is incorrect.
-
-@cindex @emph{ice-on-legal-code} class
-@item ice-on-legal-code
-GCC gives an Internal Compiler Error (ICE) for correct code.
-
-@cindex @emph{ice-on-illegal-code} class
-@item ice-on-illegal-code
-GCC gives an ICE instead of reporting an error
-
-@cindex @emph{pessimizes-code} class
-@item pessimizes-code
-GCC misses an important optimization opportunity.
-
-@cindex @emph{sw-bug} class
-@item sw-bug
-A general product problem. (@samp{sw} stands for ``software''.)
-
-@cindex @emph{change-request} class
-@item change-request
-A request for a change in behavior, etc.
-
-@cindex @emph{support} class
-@item support
-A support problem or question.
-
-@cindex @emph{duplicate} class
-@item duplicate (@var{pr-number})
-Duplicate PR. @var{pr-number} should be the number of the original PR.
-
-@noindent
-The default is @samp{sw-bug}.
-@sp 1
-@end table
-
-@end table
-
-@node Sending Patches,, gccbug, Bugs
-@section Sending Patches for GCC
-
-If you would like to write bug fixes or improvements for the GNU C
-compiler, that is very helpful. Send suggested fixes to the patches
-mailing list, @email{gcc-patches@@gcc.gnu.org}.
-
-Please follow these guidelines so we can study your patches efficiently.
-If you don't follow these guidelines, your information might still be
-useful, but using it will take extra work. Maintaining GNU C is a lot
-of work in the best of circumstances, and we can't keep up unless you do
-your best to help.
-
-@itemize @bullet
-@item
-Send an explanation with your changes of what problem they fix or what
-improvement they bring about. For a bug fix, just include a copy of the
-bug report, and explain why the change fixes the bug.
-
-(Referring to a bug report is not as good as including it, because then
-we will have to look it up, and we have probably already deleted it if
-we've already fixed the bug.)
-
-@item
-Always include a proper bug report for the problem you think you have
-fixed. We need to convince ourselves that the change is right before
-installing it. Even if it is right, we might have trouble judging it if
-we don't have a way to reproduce the problem.
-
-@item
-Include all the comments that are appropriate to help people reading the
-source in the future understand why this change was needed.
-
-@item
-Don't mix together changes made for different reasons.
-Send them @emph{individually}.
-
-If you make two changes for separate reasons, then we might not want to
-install them both. We might want to install just one. If you send them
-all jumbled together in a single set of diffs, we have to do extra work
-to disentangle them---to figure out which parts of the change serve
-which purpose. If we don't have time for this, we might have to ignore
-your changes entirely.
-
-If you send each change as soon as you have written it, with its own
-explanation, then the two changes never get tangled up, and we can
-consider each one properly without any extra work to disentangle them.
-
-Ideally, each change you send should be impossible to subdivide into
-parts that we might want to consider separately, because each of its
-parts gets its motivation from the other parts.
-
-@item
-Send each change as soon as that change is finished. Sometimes people
-think they are helping us by accumulating many changes to send them all
-together. As explained above, this is absolutely the worst thing you
-could do.
-
-Since you should send each change separately, you might as well send it
-right away. That gives us the option of installing it immediately if it
-is important.
-
-@item
-Use @samp{diff -c} to make your diffs. Diffs without context are hard
-for us to install reliably. More than that, they make it hard for us to
-study the diffs to decide whether we want to install them. Unidiff
-format is better than contextless diffs, but not as easy to read as
-@samp{-c} format.
-
-If you have GNU diff, use @samp{diff -cp}, which shows the name of the
-function that each change occurs in.
-
-@item
-Write the change log entries for your changes. We get lots of changes,
-and we don't have time to do all the change log writing ourselves.
-
-Read the @file{ChangeLog} file to see what sorts of information to put
-in, and to learn the style that we use. The purpose of the change log
-is to show people where to find what was changed. So you need to be
-specific about what functions you changed; in large functions, it's
-often helpful to indicate where within the function the change was.
-
-On the other hand, once you have shown people where to find the change,
-you need not explain its purpose. Thus, if you add a new function, all
-you need to say about it is that it is new. If you feel that the
-purpose needs explaining, it probably does---but the explanation will be
-much more useful if you put it in comments in the code.
-
-If you would like your name to appear in the header line for who made
-the change, send us the header line.
-
-@item
-When you write the fix, keep in mind that we can't install a change that
-would break other systems.
-
-People often suggest fixing a problem by changing machine-independent
-files such as @file{toplev.c} to do something special that a particular
-system needs. Sometimes it is totally obvious that such changes would
-break GCC for almost all users. We can't possibly make a change like
-that. At best it might tell us how to write another patch that would
-solve the problem acceptably.
-
-Sometimes people send fixes that @emph{might} be an improvement in
-general---but it is hard to be sure of this. It's hard to install
-such changes because we have to study them very carefully. Of course,
-a good explanation of the reasoning by which you concluded the change
-was correct can help convince us.
-
-The safest changes are changes to the configuration files for a
-particular machine. These are safe because they can't create new bugs
-on other machines.
-
-Please help us keep up with the workload by designing the patch in a
-form that is good to install.
-@end itemize
+explained at @uref{http://gcc.gnu.org/gnats.html}.
@node Service
@chapter How To Get Help with GCC
@@ -3001,7 +2450,7 @@ projects are listed at @uref{http://gcc.gnu.org/projects/}.
@chapter Using GCC on VMS
@c prevent bad page break with this line
-Here is how to use GCC on VMS.
+Here is how to use GCC on VMS@.
@menu
* Include Files and VMS:: Where the preprocessor looks for the include files.
@@ -3041,7 +2490,7 @@ preprocessor then uses this name with no prefix in an attempt to open
the include file.
@item
-If the file specification is not a valid VMS filename (i.e. does not
+If the file specification is not a valid VMS filename (i.e.@: does not
contain a device or a directory specifier, and contains a @samp{/}
character), the preprocessor tries to convert it from Unix syntax to
VMS syntax.
@@ -3064,7 +2513,7 @@ Include directives of the form:
@end example
@noindent
-are a common source of incompatibility between VAX-C and GCC. VAX-C
+are a common source of incompatibility between VAX-C and GCC@. VAX-C
treats this much like a standard @code{#include <foobar.h>} directive.
That is incompatible with the ISO C behavior implemented by GCC: to
expand the name @code{foobar} as a macro. Macro expansion should
@@ -3123,7 +2572,7 @@ whether explicitly, or implicitly via a logical name.
@findex GLOBALVALUEDEF
@findex GLOBALVALUEREF
GCC does not provide the @code{globalref}, @code{globaldef} and
-@code{globalvalue} keywords of VAX-C. You can get the same effect with
+@code{globalvalue} keywords of VAX-C@. You can get the same effect with
an obscure feature of GAS, the GNU assembler. (This requires GAS
version 1.39 or later.) The following macros allow you to use this
feature in a fairly natural way:
@@ -3246,10 +2695,10 @@ you fail to specify an explicit return value. This will be interpreted
by VMS as a status code indicating a normal successful completion.
Version 1 of GCC did not provide this default.
-GCC on VMS works only with the GNU assembler, GAS. You need version
+GCC on VMS works only with the GNU assembler, GAS@. You need version
1.37 or later of GAS in order to produce value debugging information for
the VMS debugger. Use the ordinary VMS linker with the object files
-produced by GAS.
+produced by GAS@.
@cindex shared VMS run time system
@cindex @file{VAXCRTL}
@@ -3284,13 +2733,13 @@ Name augmentation yields bad results for programs that use precompiled
libraries (such as Xlib) which were generated by another compiler. You
can use the compiler option @samp{/NOCASE_HACK} to inhibit augmentation;
it makes external C functions and variables case-independent as is usual
-on VMS. Alternatively, you could write all references to the functions
+on VMS@. Alternatively, you could write all references to the functions
and variables in such libraries using lower case; this will work on VMS,
but is not portable to other systems. The compiler option @samp{/NAMES}
also provides control over global name handling.
-Function and variable names are handled somewhat differently with GNU
-C++. The GNU C++ compiler performs @dfn{name mangling} on function
+Function and variable names are handled somewhat differently with G++.
+The GNU C++ compiler performs @dfn{name mangling} on function
names, which means that it adds information to the function name to
describe the data types of the arguments that the function takes. One
result of this is that the name of a function can become very long.
@@ -3325,7 +2774,9 @@ These macro definitions can be placed in a header file to minimize the
number of changes to your source code.
@node Makefile
-@chapter Makefile Targets
+@chapter Additional Makefile and configure information.
+
+@section Makefile Targets
@cindex makefile targets
@cindex targets, makefile
@@ -3378,12 +2829,12 @@ Note that running the testsuite may require additional tools be
installed, such as TCL or dejagnu.
@item bootstrap
-Builds gcc three times - once with the native compiler, once with the
+Builds gcc three times---once with the native compiler, once with the
native-built compiler it just built, and once with the compiler it built
the second time. In theory, the last two should produce the same
results, which @code{make compare} can check. Each step of this process
-is called a "stage", and the results of each stage N (N=1..3) are copied
-to a subdirectory @file{stageN/}.
+is called a ``stage'', and the results of each stage @var{N}
+(@var{N} = 1@dots{}3) are copied to a subdirectory @file{stage@var{N}/}.
@item bootstrap-lean
Like @code{bootstrap}, except that the various stages are removed once
@@ -3391,8 +2842,8 @@ they're no longer needed. This saves disk space.
@item bubblestrap
Once bootstrapped, this incrementally rebuilds each of the three stages,
-one at a time. It does this by "bubbling" the stages up from their
-stubdirectories, rebuilding them, and copying them back to their
+one at a time. It does this by ``bubbling'' the stages up from their
+subdirectories, rebuilding them, and copying them back to their
subdirectories. This will allow you to, for example, quickly rebuild a
bootstrapped compiler after changing the sources, without having to do a
full bootstrap.
@@ -3405,14 +2856,15 @@ of which stage you're on or what invocation that stage needs.
@item cleanstrap
Removed everything (@code{make clean}) and rebuilds (@code{make bootstrap}).
-@item stageN (N=1..4)
-For each stage, moves the appropriate files to the stageN subdirectory.
+@item stage@var{N} (@var{N} = 1@dots{}4)
+For each stage, moves the appropriate files to the @file{stage@var{N}}
+subdirectory.
-@item unstageN (N=1..4)
-Undoes the corresponding @code{stageN}.
+@item unstage@var{N} (@var{N} = 1@dots{}4)
+Undoes the corresponding @code{stage@var{N}}.
-@item restageN (N=1..4)
-Undoes the corresponding @code{stageN} and rebuilds it with the
+@item restage@var{N} (@var{N} = 1@dots{}4)
+Undoes the corresponding @code{stage@var{N}} and rebuilds it with the
appropriate flags.
@item compare
@@ -3422,6 +2874,68 @@ regardless of how it itself was compiled.
@end table
+@section Configure Terms and History
+@cindex configure terms
+@cindex canadian
+
+This section is not instructions for building GCC. If you are trying to
+do a build, you should first read @uref{http://gcc.gnu.org/install/} or
+whatever installation instructions came with your source package.
+
+The configure and build process has a long and colorful history, and can
+be confusing to anyone who doesn't know why things are the way they are.
+While there are other documents which describe the configuration process
+in detail, here are a few things that everyone working on GCC should
+know.
+
+There are three system names that the build knows about: the machine you
+are building on (@dfn{build}), the machine that you are building for
+(@dfn{host}), and the machine that GCC will produce code for
+(@dfn{target}). When you configure GCC, you specify these with
+@option{--build=}, @option{--host=}, and @option{--target=}.
+
+Specifying the host without specifying the build should be avoided, as
+@command{configure} may (and once did) assume that the host you specify
+is also the build, which may not be true.
+
+If build, host, and target are all the same, this is called a
+@dfn{native}. If build and host are the same but target is different,
+this is called a @dfn{cross}. If build, host, and target are all
+different this is called a @dfn{canadian} (for obscure reasons dealing
+with Canada's political party and the background of the person working
+on the build at that time). If host and target are the same, but build
+is different, you are using a cross-compiler to build a native for a
+different system. Some people call this a @dfn{host-x-host},
+@dfn{crossed native}, or @dfn{cross-built native}. If build and target
+are the same, but host is different, you are using a cross compiler to
+build a cross compiler that produces code for the machine you're
+building on. This is rare, so there is no common say of describing it
+(although I propose calling it a @dfn{crossback}).
+
+If build and host are the same, the GCC you are building will also be
+used to build the target libraries (like @code{libstdc++}). If build and host
+are different, you must have already build and installed a cross
+compiler that will be used to build the target libraries (if you
+configured with @option{--target=foo-bar}, this compiler will be called
+@command{foo-bar-gcc}).
+
+In the case of target libraries, the machine you're building for is the
+machine you specified with @option{--target}. So, build is the machine
+you're building on (no change there), host is the machine you're
+building for (the target libraries are built for the target, so host is
+the target you specified), and target doesn't apply (because you're not
+building a compiler, you're building libraries). The configure/make
+process will adjust these variables as needed. It also sets
+@code{$with_cross_host} to the original @option{--host} value in case you
+need it.
+
+Libiberty, for example, is built twice. The first time, host comes from
+@option{--host} and the second time host comes from @option{--target}.
+Historically, libiberty has not been built for the build machine,
+though, which causes some interesting issues with programs used to
+generate sources for the build. Fixing this, so that libiberty is built
+three times, has long been on the to-do list.
+
@end ifset
@ifset INTERNALS
@@ -3513,7 +3027,7 @@ incompatibility with code that follows the standard convention. So this
change is practical only if you are switching to GCC as the sole C
compiler for the system. We may implement register argument passing on
certain machines once we have a complete GNU system so that we can
-compile the libraries with GCC.
+compile the libraries with GCC@.
On some machines (particularly the Sparc), certain types of arguments
are passed ``by invisible reference''. This means that the value is
@@ -3544,11 +3058,12 @@ go in a register:
@cindex arithmetic libraries
@cindex math libraries
+@opindex msoft-float
Code compiled with GCC may call certain library routines. Most of
them handle arithmetic for which there are no instructions. This
includes multiply and divide on some machines, and floating point
operations on any machine for which floating point support is disabled
-with @samp{-msoft-float}. Some standard parts of the C library, such as
+with @option{-msoft-float}. Some standard parts of the C library, such as
@code{bcopy} or @code{memcpy}, are also called automatically. The usual
function call interface is used for calling the library routines.
@@ -3579,14 +3094,19 @@ file is responsible for initialization, decoding arguments, opening and
closing files, and sequencing the passes.
@cindex parsing pass
-The parsing pass is invoked only once, to parse the entire input. The RTL
-intermediate code for a function is generated as the function is parsed, a
-statement at a time. Each statement is read in as a syntax tree and then
-converted to RTL; then the storage for the tree for the statement is
-reclaimed. Storage for types (and the expressions for their sizes),
-declarations, and a representation of the binding contours and how they nest,
-remain until the function is finished being compiled; these are all needed
-to output the debugging information.
+The parsing pass is invoked only once, to parse the entire input. A
+high level tree representation is then generated from the input,
+one function at a time. This tree code is then transformed into RTL
+intermediate code, and processed. The files involved in transforming
+the trees into RTL are @file{expr.c}, @file{expmed.c}, and
+@file{stmt.c}.
+@c Note, the above files aren't strictly the only files involved. It's
+@c all over the place (function.c, final.c,etc). However, those are
+@c the files that are supposed to be directly involved, and have
+@c their purpose listed as such, so i've only listed them.
+The order of trees that are processed, is not
+necessarily the same order they are generated from
+the input, due to deferred inlining, and other considerations.
@findex rest_of_compilation
@findex rest_of_decl_compilation
@@ -3599,7 +3119,8 @@ the assembler language. All other compiler passes run, in sequence,
within @code{rest_of_compilation}. When that function returns from
compiling a function definition, the storage used for that function
definition's compilation is entirely freed, unless it is an inline
-function
+function, or was deferred for some reason (this can occur in
+templates, for example).
@ifset USING
(@pxref{Inline,,An Inline Function is As Fast As a Macro}).
@end ifset
@@ -3609,14 +3130,14 @@ function
Here is a list of all the passes of the compiler and their source files.
Also included is a description of where debugging dumps can be requested
-with @samp{-d} options.
+with @option{-d} options.
@itemize @bullet
@item
Parsing. This pass reads the entire text of a function definition,
-constructing partial syntax trees. This and RTL generation are no longer
-truly separate passes (formerly they were), but it is easier to think
-of them as separate.
+constructing a high level tree representation. (Because of the semantic
+analysis that takes place during this pass, it does more than is
+formally considered to be parsing.)
The tree representation does not entirely follow C syntax, because it is
intended to support other languages as well.
@@ -3625,37 +3146,39 @@ Language-specific data type analysis is also done in this pass, and every
tree node that represents an expression has a data type attached.
Variables are represented as declaration nodes.
-@cindex constant folding
-@cindex arithmetic simplifications
-@cindex simplifications, arithmetic
-Constant folding and some arithmetic simplifications are also done
-during this pass.
-
The language-independent source files for parsing are
@file{stor-layout.c}, @file{fold-const.c}, and @file{tree.c}.
There are also header files @file{tree.h} and @file{tree.def}
-which define the format of the tree representation.@refill
+which define the format of the tree representation.
+
+C Preprocessing, for language front ends, that want or require it, is
+performed by cpplib, which is covered in separate documentation. In
+particular, the internals are covered in @xref{Top, ,Cpplib internals, cppinternals, Cpplib Internals}.
+
@c Avoiding overfull is tricky here.
The source files to parse C are
-@file{c-parse.in},
-@file{c-decl.c},
-@file{c-typeck.c},
@file{c-aux-info.c},
@file{c-convert.c},
-and @file{c-lang.c}
-along with header files
-@file{c-lex.h}, and
-@file{c-tree.h}.
+@file{c-decl.c},
+@file{c-errors.c},
+@file{c-lang.c},
+@file{c-parse.in},
+and
+@file{c-typeck.c},
+along with a header file
+@file{c-tree.h}
+and some files shared with Objective-C and C++.
The source files for parsing C++ are in @file{cp/}.
They are @file{parse.y},
-@file{class.c},@*
-@file{cvt.c}, @file{decl.c}, @file{decl2.c},
-@file{except.c},@*
+@file{class.c},
+@file{cvt.c}, @file{decl.c}, @file{decl2.c},
+@file{except.c},
@file{expr.c}, @file{init.c}, @file{lex.c},
-@file{method.c}, @file{ptree.c},@*
-@file{search.c}, @file{tree.c},
+@file{method.c}, @file{ptree.c},
+@file{search.c}, @file{spew.c},
+@file{semantics.c}, @file{tree.c},
@file{typeck2.c}, and
@file{typeck.c}, along with header files @file{cp-tree.def},
@file{cp-tree.h}, and @file{decl.h}.
@@ -3665,13 +3188,48 @@ They are @file{objc-parse.y}, @file{objc-act.c}, @file{objc-tree.def}, and
@file{objc-act.h}. Certain C-specific files are used for this as
well.
-The file @file{c-common.c} is also used for all of the above languages.
+The files
+@file{c-common.c},
+@file{c-common.def},
+@file{c-dump.c},
+@file{c-format.c},
+@file{c-lex.c},
+@file{c-pragma.c},
+and
+@file{c-semantics.c},
+along with header files
+@file{c-common.h},
+@file{c-dump.h},
+@file{c-lex.h},
+and
+@file{c-pragma.h},
+are also used for all of the above languages.
+
+
+@cindex Tree optimization
+@item
+Tree optimization. This is the optimization of the tree
+representation, before converting into RTL code.
+
+@cindex inline on trees, automatic
+Currently, the main optimization performed here is tree-based
+inlining.
+This is implemented for C++ in @file{cp/optimize.c}. Note that
+tree based inlining turns off rtx based inlining (since it's more
+powerful, it would be a waste of time to do rtx based inlining in
+addition).
+The C front end currently does not perform tree based inlining.
+
+@cindex constant folding
+@cindex arithmetic simplifications
+@cindex simplifications, arithmetic
+Constant folding and some arithmetic simplifications are also done
+during this pass, on the tree representation.
+The routines that perform these tasks are located in @file{fold-const.c}.
@cindex RTL generation
@item
RTL generation. This is the conversion of syntax tree into RTL code.
-It is actually done statement-by-statement during parsing, but for
-most purposes it can be thought of as a separate pass.
@cindex target-parameter-dependent code
This is where the bulk of target-parameter-dependent code is found,
@@ -3699,35 +3257,52 @@ and @file{emit-rtl.c}.
Also, the file
@file{insn-emit.c}, generated from the machine description by the
program @code{genemit}, is used in this pass. The header file
-@file{expr.h} is used for communication within this pass.@refill
+@file{expr.h} is used for communication within this pass.
@findex genflags
@findex gencodes
The header files @file{insn-flags.h} and @file{insn-codes.h},
generated from the machine description by the programs @code{genflags}
and @code{gencodes}, tell this pass which standard names are available
-for use and which patterns correspond to them.@refill
+for use and which patterns correspond to them.
Aside from debugging information output, none of the following passes
refers to the tree structure representation of the function (only
part of which is saved).
-@cindex inline, automatic
+@cindex inline on rtx, automatic
The decision of whether the function can and should be expanded inline
in its subsequent callers is made at the end of rtl generation. The
function must meet certain criteria, currently related to the size of
the function and the types and number of parameters it has. Note that
this function may contain loops, recursive calls to itself
(tail-recursive functions can be inlined!), gotos, in short, all
-constructs supported by GCC. The file @file{integrate.c} contains
+constructs supported by GCC@. The file @file{integrate.c} contains
the code to save a function's rtl for later inlining and to inline that
rtl when the function is called. The header file @file{integrate.h}
is also used for this purpose.
-The option @samp{-dr} causes a debugging dump of the RTL code after
+@opindex dr
+The option @option{-dr} causes a debugging dump of the RTL code after
this pass. This dump file's name is made by appending @samp{.rtl} to
the input file name.
+@c Should the exception handling pass be talked about here?
+
+@cindex sibling call optimization
+@item
+Sibiling call optimization. This pass performs tail recursion
+elimination, and tail and sibling call optimizations. The purpose of
+these optimizations is to reduce the overhead of function calls,
+whenever possible.
+
+The source file of this pass is @file{sibcall.c}
+
+@opindex di
+The option @option{-di} causes a debugging dump of the RTL code after
+this pass is run. This dump file's name is made by appending
+@samp{.sibling} to the input file name.
+
@cindex jump optimization
@cindex unreachable code
@cindex dead code
@@ -3750,7 +3325,8 @@ optimizations described above.
The source file of this pass is @file{jump.c}.
-The option @samp{-dj} causes a debugging dump of the RTL code after
+@opindex dj
+The option @option{-dj} causes a debugging dump of the RTL code after
this pass is run for the first time. This dump file's name is made by
appending @samp{.jump} to the input file name.
@@ -3762,37 +3338,85 @@ is in @file{regclass.c}.
@cindex jump threading
@item
+@opindex fthread-jumps
Jump threading. This pass detects a condition jump that branches to an
identical or inverse test. Such jumps can be @samp{threaded} through
the second conditional test. The source code for this pass is in
@file{jump.c}. This optimization is only performed if
-@samp{-fthread-jumps} is enabled.
+@option{-fthread-jumps} is enabled.
@cindex common subexpression elimination
@cindex constant propagation
@item
Common subexpression elimination. This pass also does constant
-propagation. Its source file is @file{cse.c}. If constant
-propagation causes conditional jumps to become unconditional or to
-become no-ops, jump optimization is run again when CSE is finished.
+propagation. Its source files are @file{cse.c}, and @file{cselib.c}.
+If constant propagation causes conditional jumps to become
+unconditional or to become no-ops, jump optimization is run again when
+CSE is finished.
-The option @samp{-ds} causes a debugging dump of the RTL code after
+@opindex ds
+The option @option{-ds} causes a debugging dump of the RTL code after
this pass. This dump file's name is made by appending @samp{.cse} to
the input file name.
+@cindex SSA optimizations
+@cindex Single Static Assignment optimizations
+@opindex fssa
+@item
+Static Single Assignment (SSA) based optimization passes. The
+SSA conversion passes (to/from) are turned on by the @option{-fssa}
+option (it is also done automatically if you enable an SSA optimization pass).
+These passes utilize a form called Static Single Assignment. In SSA form,
+each variable (pseudo register) is only set once, giving you def-use
+and use-def chains for free, and enabling a lot more optimization
+passes to be run in linear time.
+Conversion to and from SSA form is handled by functions in
+@file{ssa.c}.
+
+@opindex de
+The option @option{-de} causes a debugging dump of the RTL code after
+this pass. This dump file's name is made by appending @samp{.ssa} to
+the input file name.
+@itemize @bullet
+@cindex SSA DCE
+@cindex DCE, SSA based
+@cindex dead code elimination
+@opindex fdce
+@item
+Dead Code Elimination. Turned on by the @option{-fdce} option.
+This pass performs elimination of code considered unnecessary because it
+is never executed. It operates in linear time.
+
+@opindex dX
+The option @option{-dX} causes a debugging dump of the RTL code after
+this pass. This dump file's name is made by appending @samp{.dce} to
+the input file name.
+@end itemize
@cindex global common subexpression elimination
@cindex constant propagation
@cindex copy propagation
-@item
-Global common subexpression elimination. This pass performs GCSE
-using Morel-Renvoise Partial Redundancy Elimination, with the exception
-that it does not try to move invariants out of loops - that is left to
-the loop optimization pass. This pass also performs global constant
-and copy propagation.
-
-The source file for this pass is gcse.c.
-
-The option @samp{-dG} causes a debugging dump of the RTL code after
+@item
+Global common subexpression elimination. This pass performs two
+different types of GCSE depending on whether you are optimizing for
+size or not (LCM based GCSE tends to increase code size for a gain in
+speed, while Morel-Renvoise based GCSE does not).
+When optimizing for size, GCSE is done using Morel-Renvoise Partial
+Redundancy Elimination, with the exception that it does not try to move
+invariants out of loops---that is left to the loop optimization pass.
+If MR PRE GCSE is done, code hoisting (aka unification) is also done, as
+well as load motion.
+If you are optimizing for speed, LCM (lazy code motion) based GCSE is
+done. LCM is based on the work of Knoop, Ruthing, and Steffen. LCM
+based GCSE also does loop invariant code motion. We also perform load
+and store motion when optimizing for speed.
+Regardless of which type of GCSE is used, the GCSE pass also performs
+global constant and copy propagation.
+
+The source file for this pass is @file{gcse.c}, and the LCM routines
+are in @file{lcm.c}.
+
+@opindex dG
+The option @option{-dG} causes a debugging dump of the RTL code after
this pass. This dump file's name is made by appending @samp{.gcse} to
the input file name.
@@ -3805,17 +3429,21 @@ and optionally does strength-reduction and loop unrolling as well.
Its source files are @file{loop.c} and @file{unroll.c}, plus the header
@file{loop.h} used for communication between them. Loop unrolling uses
some functions in @file{integrate.c} and the header @file{integrate.h}.
+Loop dependency analysis routines are contained in @file{dependence.c}.
-The option @samp{-dL} causes a debugging dump of the RTL code after
+@opindex dL
+The option @option{-dL} causes a debugging dump of the RTL code after
this pass. This dump file's name is made by appending @samp{.loop} to
the input file name.
@item
-If @samp{-frerun-cse-after-loop} was enabled, a second common
+@opindex frerun-cse-after-loop
+If @option{-frerun-cse-after-loop} was enabled, a second common
subexpression elimination pass is performed after the loop optimization
pass. Jump threading is also done again at this time if it was specified.
-The option @samp{-dt} causes a debugging dump of the RTL code after
+@opindex dt
+The option @option{-dt} causes a debugging dump of the RTL code after
this pass. This dump file's name is made by appending @samp{.cse2} to
the input file name.
@@ -3834,7 +3462,8 @@ This pass also deletes computations whose results are never used, and
combines memory references with add or subtract instructions to make
autoincrement or autodecrement addressing.
-The option @samp{-df} causes a debugging dump of the RTL code after
+@opindex df
+The option @option{-df} causes a debugging dump of the RTL code after
this pass. This dump file's name is made by appending @samp{.flow} to
the input file name. If stupid register allocation is in use, this
dump file reflects the full results of such allocation.
@@ -3847,19 +3476,33 @@ flow into single instructions. It combines the RTL expressions for
the instructions by substitution, simplifies the result using algebra,
and then attempts to match the result against the machine description.
-The option @samp{-dc} causes a debugging dump of the RTL code after
+@opindex dc
+The option @option{-dc} causes a debugging dump of the RTL code after
this pass. This dump file's name is made by appending @samp{.combine}
to the input file name.
+@cindex if conversion
+@item
+If-conversion is a transformation that transforms control dependencies
+into data dependencies (IE it transforms conditional code into a
+single control stream).
+It is implemented in the file @file{ifcvt.c}.
+
+@opindex dE
+The option @option{-dE} causes a debugging dump of the RTL code after
+this pass. This dump file's name is made by appending @samp{.ce} to
+the input file name.
+
@cindex register movement
@item
-Register movement (@file{regmove.c}). This pass looks for cases where
+Register movement (@file{regmove.c}). This pass looks for cases where
matching constraints would force an instruction to need a reload, and
this reload would be a register to register move. It then attempts
to change the registers used by the instruction to avoid the move
instruction.
-The option @samp{-dN} causes a debugging dump of the RTL code after
+@opindex dN
+The option @option{-dN} causes a debugging dump of the RTL code after
this pass. This dump file's name is made by appending @samp{.regmove}
to the input file name.
@@ -3876,7 +3519,8 @@ use of items that otherwise would cause pipeline stalls.
Instruction scheduling is performed twice. The first time is immediately
after instruction combination and the second is immediately after reload.
-The option @samp{-dS} causes a debugging dump of the RTL code after this
+@opindex dS
+The option @option{-dS} causes a debugging dump of the RTL code after this
pass is run for the first time. The dump file's name is made by
appending @samp{.sched} to the input file name.
@@ -3894,7 +3538,8 @@ hard registers to pseudo registers that are used only within one basic
block. Because the basic block is linear, it can use fast and
powerful techniques to do a very good job.
-The option @samp{-dl} causes a debugging dump of the RTL code after
+@opindex dl
+The option @option{-dl} causes a debugging dump of the RTL code after
this pass. This dump file's name is made by appending @samp{.lreg} to
the input file name.
@@ -3921,7 +3566,8 @@ instructions to save and restore call-clobbered registers around calls.
Source files are @file{reload.c} and @file{reload1.c}, plus the header
@file{reload.h} used for communication between them.
-The option @samp{-dg} causes a debugging dump of the RTL code after
+@opindex dg
+The option @option{-dg} causes a debugging dump of the RTL code after
this pass. This dump file's name is made by appending @samp{.greg} to
the input file name.
@@ -3931,17 +3577,34 @@ the input file name.
Instruction scheduling is repeated here to try to avoid pipeline stalls
due to memory loads generated for spilled pseudo registers.
-The option @samp{-dR} causes a debugging dump of the RTL code after
+@opindex dR
+The option @option{-dR} causes a debugging dump of the RTL code after
this pass. This dump file's name is made by appending @samp{.sched2}
to the input file name.
+@cindex basic block reordering
+@cindex reordering, block
+@item
+Basic block reordering. This pass implements profile guided code
+positioning. If profile information is not available, various types of
+static analysis are performed to make the predictions normally coming
+from the profile feedback (IE execution frequency, branch probability,
+etc). It is implemented in the file @file{bb-reorder.c}, and the
+various prediction routines are in @file{predict.c}.
+
+@opindex dB
+The option @option{-dB} causes a debugging dump of the RTL code after
+this pass. This dump file's name is made by appending @samp{.bbro} to
+the input file name.
+
@cindex cross-jumping
@cindex no-op move instructions
@item
Jump optimization is repeated, this time including cross-jumping
and deletion of no-op move instructions.
-The option @samp{-dJ} causes a debugging dump of the RTL code after
+@opindex dJ
+The option @option{-dJ} causes a debugging dump of the RTL code after
this pass. This dump file's name is made by appending @samp{.jump2}
to the input file name.
@@ -3952,18 +3615,19 @@ Delayed branch scheduling. This optional pass attempts to find
instructions that can go into the delay slots of other instructions,
usually jumps and calls. The source file name is @file{reorg.c}.
-The option @samp{-dd} causes a debugging dump of the RTL code after
+@opindex dd
+The option @option{-dd} causes a debugging dump of the RTL code after
this pass. This dump file's name is made by appending @samp{.dbr}
to the input file name.
@cindex branch shortening
@item
Branch shortening. On many RISC machines, branch instructions have a
-limited range. Thus, longer sequences of instructions must be used for
+limited range. Thus, longer sequences of instructions must be used for
long branches. In this pass, the compiler figures out what how far each
instruction will be from each other instruction, and therefore whether
the usual instructions, or the longer sequences, must be used for each
-branch.
+branch.
@cindex register-to-stack conversion
@item
@@ -3972,7 +3636,8 @@ stack may be done at this point. Currently, this is supported only
for the floating-point registers of the Intel 80387 coprocessor. The
source file name is @file{reg-stack.c}.
-The options @samp{-dk} causes a debugging dump of the RTL code after
+@opindex dk
+The options @option{-dk} causes a debugging dump of the RTL code after
this pass. This dump file's name is made by appending @samp{.stack}
to the input file name.
@@ -3983,7 +3648,7 @@ Final. This pass outputs the assembler code for the function. It is
also responsible for identifying spurious test and compare
instructions. Machine-specific peephole optimizations are performed
at the same time. The function entry and exit sequences are generated
-directly as assembler code in this pass; they never exist as RTL.
+directly as assembler code in this pass; they never exist as RTL@.
The source files are @file{final.c} plus @file{insn-output.c}; the
latter is generated automatically from the machine description by the
@@ -3995,8 +3660,9 @@ for communication between these files.
Debugging information output. This is run after final because it must
output the stack slot offsets for pseudo registers that did not get
hard registers. Source files are @file{dbxout.c} for DBX symbol table
-format, @file{sdbout.c} for SDB symbol table format, and
-@file{dwarfout.c} for DWARF symbol table format.
+format, @file{sdbout.c} for SDB symbol table format, @file{dwarfout.c}
+for DWARF symbol table format, and the files @file{dwarf2out.c} and
+@file{dwarf2asm.c} for DWARF2 symbol table format.
@end itemize
Some additional files are used by all or many passes:
@@ -4014,7 +3680,7 @@ representation of floating point constants and how to operate on them.
All the passes that work with RTL use the header files @file{rtl.h}
and @file{rtl.def}, and subroutines in file @file{rtl.c}. The tools
@code{gen*} also use these files to read and work with the machine
-description RTL.
+description RTL@.
@findex genconfig
@item
@@ -4029,7 +3695,7 @@ Several passes use the instruction recognizer, which consists of
@file{recog.c} and @file{recog.h}, plus the files @file{insn-recog.c}
and @file{insn-extract.c} that are generated automatically from the
machine description by the tools @file{genrecog} and
-@file{genextract}.@refill
+@file{genextract}.
@item
Several passes use the header files @file{regs.h} which defines the
@@ -4049,11 +3715,12 @@ attributes defined for a particular machine is in file
@file{insn-attr.h}, which is generated from the machine description by
the program @file{genattr}. The file @file{insn-attrtab.c} contains
subroutines to obtain the attribute values for insns. It is generated
-from the machine description by the program @file{genattrtab}.@refill
+from the machine description by the program @file{genattrtab}.
@end itemize
@end ifset
@ifset INTERNALS
+@include c-tree.texi
@include rtl.texi
@include md.texi
@include tm.texi
@@ -4076,11 +3743,11 @@ are identical. But there are some macros that vary:
@table @code
@findex USG
@item USG
-Define this macro if the host system is System V.
+Define this macro if the host system is System V@.
@findex VMS
@item VMS
-Define this macro if the host system is VMS.
+Define this macro if the host system is VMS@.
@findex FATAL_EXIT_CODE
@item FATAL_EXIT_CODE
@@ -4134,10 +3801,15 @@ machine.
A C expression for the number of bits in @code{long} on the host
machine.
+@findex HOST_BITS_PER_LONGLONG
+@item HOST_BITS_PER_LONGLONG
+A C expression for the number of bits in @code{long long} on the host
+machine.
+
@findex ONLY_INT_FIELDS
@item ONLY_INT_FIELDS
Define this macro to indicate that the host compiler only supports
-@code{int} bit fields, rather than other integral types, including
+@code{int} bit-fields, rather than other integral types, including
@code{enum}, as do most C compilers.
@findex OBSTACK_CHUNK_SIZE
@@ -4158,7 +3830,7 @@ If you don't define this, @code{free} is used.
@findex USE_C_ALLOCA
@item USE_C_ALLOCA
Define this macro to indicate that the compiler is running with the
-@code{alloca} implemented in C. This version of @code{alloca} can be
+@code{alloca} implemented in C@. This version of @code{alloca} can be
found in the file @file{alloca.c}; to use it, you must also alter the
@file{Makefile} variable @code{ALLOCA}. (This is done automatically
for the systems on which we know it is needed.)
@@ -4186,7 +3858,7 @@ used in an expression.
@findex MULTIBYTE_CHARS
@item MULTIBYTE_CHARS
Define this macro to enable support for multibyte characters in the
-input to GCC. This requires that the host system support the ISO C
+input to GCC@. This requires that the host system support the ISO C
library functions for converting multibyte characters to wide
characters.
@@ -4217,6 +3889,14 @@ character constant specifying that character. When GCC displays file
names, the character you specify will be used. GCC will test for
both slash and the character you specify when parsing filenames.
+@findex DIR_SEPARATOR_2
+@item DIR_SEPARATOR_2
+If your system uses an alternative character other than
+@samp{DIR_SEPARATOR} to separate directory names within a file
+specification, define this macro to be a C character constant specifying
+that character. If you define this macro, GCC will test for slash,
+@samp{DIR_SEPARATOR}, and @samp{DIR_SEPARATOR_2} when parsing filenames.
+
@findex OBJECT_SUFFIX
@item OBJECT_SUFFIX
Define this macro to be a C string representing the suffix for object
@@ -4229,13 +3909,19 @@ Define this macro to be a C string representing the suffix for executable
files on your machine. If you do not define this macro, GCC will use
the null string as the suffix for object files.
+@findex NO_AUTO_EXE_SUFFIX
+@item NO_AUTO_EXE_SUFFIX
+Define this macro if executable files on your machine have a suffix, but
+the compiler driver should not automatically append it to the output file
+name, if user hasn't specified one.
+
@findex HOST_BIT_BUCKET
@item HOST_BIT_BUCKET
The name of a file or file-like object on the host system which acts as
a ``bit bucket''. If you do not define this macro, GCC will use
@samp{/dev/null} as the bit bucket. If the target does not support a
bit bucket, this should be defined to the null string, or some other
-illegal filename. If the bit bucket is not writable, GCC will use a
+invalid filename. If the bit bucket is not writable, GCC will use a
temporary file instead.
@findex COLLECT_EXPORT_LIST
@@ -4260,8 +3946,8 @@ initialization when a compilation driver is being initialized.
@item UPDATE_PATH_HOST_CANONICALIZE (@var{path}, @var{key})
If defined, a C statement (sans semicolon) that performs host-dependent
canonicalization when a path used in a compilation driver or preprocessor is
-canonicalized. @var{path} is the path to be canonicalized, and @var{key} is
-a translation prefix when its value isn't @code{NULL}. If the C statement
+canonicalized. @var{path} is the path to be canonicalized, and @var{key} is
+a translation prefix when its value isn't @code{NULL}. If the C statement
does canonicalize @var{path}, the new path should be returned.
@end table
@@ -4309,7 +3995,7 @@ set this to empty.
@item CROSS_LIBGCC1
The rule to use to build @file{libgcc1.a} when building a cross
compiler. If your target does not need to use the functions in
-@file{libgcc1.a}, set this to empty. @xref{Cross Runtime}.
+@file{libgcc1.a}, set this to empty.
@findex LIBGCC2_CFLAGS
@item LIBGCC2_CFLAGS
@@ -4325,8 +4011,8 @@ into @file{libgcc.a}.
To have GCC include software floating point libraries in @file{libgcc.a}
define @code{FPBIT} and @code{DPBIT} along with a few rules as follows:
@smallexample
-# We want fine grained libraries, so use the new code to build the
-# floating point emulation libraries.
+# We want fine grained libraries, so use the new code
+# to build the floating point emulation libraries.
FPBIT = fp-bit.c
DPBIT = dp-bit.c
@@ -4373,8 +4059,8 @@ procedure will build all combinations of compatible options.
For example, if you set @code{MULTILIB_OPTIONS} to @samp{m68000/m68020
msoft-float}, @file{Makefile} will build special versions of
-@file{libgcc.a} using the following sets of options: @samp{-m68000},
-@samp{-m68020}, @samp{-msoft-float}, @samp{-m68000 -msoft-float}, and
+@file{libgcc.a} using the following sets of options: @option{-m68000},
+@option{-m68020}, @option{-msoft-float}, @samp{-m68000 -msoft-float}, and
@samp{-m68020 -msoft-float}.
@findex MULTILIB_DIRNAMES
@@ -4407,8 +4093,8 @@ case, set @code{MULTILIB_EXCEPTIONS} to be all of the switch exceptions
in shell case syntax that should not be built.
For example, in the PowerPC embedded ABI support, it is not desirable
-to build libraries compiled with the @samp{-mcall-aix} option
-and either of the @samp{-fleading-underscore} or @samp{-mlittle} options
+to build libraries compiled with the @option{-mcall-aix} option
+and either of the @option{-fleading-underscore} or @option{-mlittle} options
at the same time. Therefore @code{MULTILIB_EXCEPTIONS} is set to
@code{*mcall-aix/*fleading-underscore* *mlittle/*mcall-aix*}.
@@ -4453,54 +4139,7 @@ The install program to use.
@end table
@end ifset
-@node Funding
-@unnumbered Funding Free Software
-
-If you want to have more free software a few years from now, it makes
-sense for you to help encourage people to contribute funds for its
-development. The most effective approach known is to encourage
-commercial redistributors to donate.
-
-Users of free software systems can boost the pace of development by
-encouraging for-a-fee distributors to donate part of their selling price
-to free software developers---the Free Software Foundation, and others.
-
-The way to convince distributors to do this is to demand it and expect
-it from them. So when you compare distributors, judge them partly by
-how much they give to free software development. Show distributors
-they must compete to be the one who gives the most.
-
-To make this approach work, you must insist on numbers that you can
-compare, such as, ``We will donate ten dollars to the Frobnitz project
-for each disk sold.'' Don't be satisfied with a vague promise, such as
-``A portion of the profits are donated,'' since it doesn't give a basis
-for comparison.
-
-Even a precise fraction ``of the profits from this disk'' is not very
-meaningful, since creative accounting and unrelated business decisions
-can greatly alter what fraction of the sales price counts as profit.
-If the price you pay is $50, ten percent of the profit is probably
-less than a dollar; it might be a few cents, or nothing at all.
-
-Some redistributors do development work themselves. This is useful too;
-but to keep everyone honest, you need to inquire how much they do, and
-what kind. Some kinds of development make much more long-term
-difference than others. For example, maintaining a separate version of
-a program contributes very little; maintaining the standard version of a
-program for the whole community contributes much. Easy new ports
-contribute little, since someone else would surely do them; difficult
-ports such as adding a new CPU to the GNU Compiler Collection contribute more;
-major new features or packages contribute the most.
-
-By establishing the idea that supporting further development is ``the
-proper thing to do'' when distributing free software for a fee, we can
-assure a steady flow of resources into making more free software.
-
-@display
-Copyright (C) 1994 Free Software Foundation, Inc.
-Verbatim copying and redistribution of this section is permitted
-without royalty; alteration is not permitted.
-@end display
+@include funding.texi
@node GNU/Linux
@unnumbered Linux and the GNU Project
@@ -4532,8 +4171,8 @@ already available.
What they found was no accident---it was the GNU system. The available
free software added up to a complete system because the GNU Project
had been working since 1984 to make one. The GNU Manifesto
-had set forth the goal of developing a free Unix-like system, called
-GNU. By the time Linux was written, the system was almost finished.
+had set forth the goal of developing a free Unix-like system, called
+GNU@. By the time Linux was written, the system was almost finished.
Most free software projects have the goal of developing a particular
program for a particular job. For example, Linus Torvalds set out to
@@ -4549,7 +4188,7 @@ distribution'', GNU software was the largest single contingent, around
major components without which there could be no system. Linux itself
was about 3%. So if you were going to pick a name for the system
based on who wrote the programs in the system, the most appropriate
-single choice would be ``GNU''.
+single choice would be ``GNU''@.
But we don't think that is the right way to consider the question.
The GNU Project was not, is not, a project to develop specific
@@ -4601,408 +4240,41 @@ name ``Linux'' ambiguously. Linux is the kernel, one of the essential
major components of the system. The system as a whole is more or less
the GNU system.
-@node Copying
-@unnumbered GNU GENERAL PUBLIC LICENSE
-@center Version 2, June 1991
-
-@display
-Copyright @copyright{} 1989, 1991 Free Software Foundation, Inc.
-59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
-
-Everyone is permitted to copy and distribute verbatim copies
-of this license document, but changing it is not allowed.
-@end display
-
-@unnumberedsec Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software---to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.) You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary. To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
+@include gpl.texi
-@iftex
-@unnumberedsec TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-@end iftex
-@ifnottex
-@center TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-@end ifnottex
-
-@enumerate 0
-@item
-This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License. The ``Program'', below,
-refers to any such program or work, and a ``work based on the Program''
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language. (Hereinafter, translation is included without limitation in
-the term ``modification''.) Each licensee is addressed as ``you''.
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
-@item
-You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
-@item
-You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
-@enumerate a
-@item
-You must cause the modified files to carry prominent notices
-stating that you changed the files and the date of any change.
-
-@item
-You must cause any work that you distribute or publish, that in
-whole or in part contains or is derived from the Program or any
-part thereof, to be licensed as a whole at no charge to all third
-parties under the terms of this License.
-
-@item
-If the modified program normally reads commands interactively
-when run, you must cause it, when started running for such
-interactive use in the most ordinary way, to print or display an
-announcement including an appropriate copyright notice and a
-notice that there is no warranty (or else, saying that you provide
-a warranty) and that users may redistribute the program under
-these conditions, and telling the user how to view a copy of this
-License. (Exception: if the Program itself is interactive but
-does not normally print such an announcement, your work based on
-the Program is not required to print an announcement.)
-@end enumerate
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
+@c ---------------------------------------------------------------------
+@c GFDL
+@c ---------------------------------------------------------------------
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
-@item
-You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
-@enumerate a
-@item
-Accompany it with the complete corresponding machine-readable
-source code, which must be distributed under the terms of Sections
-1 and 2 above on a medium customarily used for software interchange; or,
-
-@item
-Accompany it with a written offer, valid for at least three
-years, to give any third party, for a charge no more than your
-cost of physically performing source distribution, a complete
-machine-readable copy of the corresponding source code, to be
-distributed under the terms of Sections 1 and 2 above on a medium
-customarily used for software interchange; or,
-
-@item
-Accompany it with the information you received as to the offer
-to distribute corresponding source code. (This alternative is
-allowed only for noncommercial distribution and only if you
-received the program in object code or executable form with such
-an offer, in accord with Subsection b above.)
-@end enumerate
-
-The source code for a work means the preferred form of the work for
-making modifications to it. For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable. However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
-@item
-You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License. Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
-@item
-You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Program or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
-@item
-Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
-@item
-If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all. For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
-@item
-If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded. In such case, this License incorporates
-the limitation as if written in the body of this License.
-
-@item
-The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and ``any
-later version'', you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation. If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
-@item
-If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission. For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this. Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
-@iftex
-@heading NO WARRANTY
-@end iftex
-@ifnottex
-@center NO WARRANTY
-@end ifnottex
-
-@item
-BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM ``AS IS'' WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
-@item
-IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-@end enumerate
-
-@iftex
-@heading END OF TERMS AND CONDITIONS
-@end iftex
-@ifnottex
-@center END OF TERMS AND CONDITIONS
-@end ifnottex
-
-@page
-@unnumberedsec How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the ``copyright'' line and a pointer to where the full notice is found.
-
-@smallexample
-@var{one line to give the program's name and a brief idea of what it does.}
-Copyright (C) @var{yyyy} @var{name of author}
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-This program 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 program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-@end smallexample
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
-@smallexample
-Gnomovision version 69, Copyright (C) @var{yyyy} @var{name of author}
-Gnomovision comes with ABSOLUTELY NO WARRANTY; for details
-type `show w'.
-This is free software, and you are welcome to redistribute it
-under certain conditions; type `show c' for details.
-@end smallexample
-
-The hypothetical commands @samp{show w} and @samp{show c} should show
-the appropriate parts of the General Public License. Of course, the
-commands you use may be called something other than @samp{show w} and
-@samp{show c}; they could even be mouse-clicks or menu items---whatever
-suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a ``copyright disclaimer'' for the program, if
-necessary. Here is a sample; alter the names:
-
-@smallexample
-Yoyodyne, Inc., hereby disclaims all copyright interest in the program
-`Gnomovision' (which makes passes at compilers) written by James Hacker.
-
-@var{signature of Ty Coon}, 1 April 1989
-Ty Coon, President of Vice
-@end smallexample
-
-This General Public License does not permit incorporating your program into
-proprietary programs. If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Library General
-Public License instead of this License.
+@include fdl.texi
@node Contributors
@unnumbered Contributors to GCC
@cindex contributors
@include contrib.texi
+@c ---------------------------------------------------------------------
+@c Indexes
+@c ---------------------------------------------------------------------
+
+@node Option Index
+@unnumbered Option Index
+
+GCC's command line options are indexed here without any initial @samp{-}
+or @samp{--}. Where an option has both positive and negative forms
+(such as @option{-f@var{option}} and @option{-fno-@var{option}}),
+relevant entries in the manual are indexed under the most appropriate
+form; it may sometimes be useful to look up both forms.
+
+@printindex op
+
@node Index
@unnumbered Index
@printindex cp
-@summarycontents
-@contents
+@c ---------------------------------------------------------------------
+@c Epilogue
+@c ---------------------------------------------------------------------
+
@bye
diff --git a/gcc/gcov.1 b/gcc/doc/gcov.1
index 2e6e26fd53e..9b69cb321c4 100644
--- a/gcc/gcov.1
+++ b/gcc/doc/gcov.1
@@ -1,8 +1,7 @@
-.\" Automatically generated by Pod::Man version 1.1
-.\" Wed Jan 3 20:06:14 2001
+.\" Automatically generated by Pod::Man v1.32, Pod::Parser v1.13
.\"
.\" Standard preamble:
-.\" ======================================================================
+.\" ========================================================================
.de Sh \" Subsection heading
.br
.if t .Sp
@@ -15,12 +14,6 @@
.if t .sp .5v
.if n .sp
..
-.de Ip \" List item
-.br
-.ie \\n(.$>=3 .ne \\$3
-.el .ne 3
-.IP "\\$1" \\$2
-..
.de Vb \" Begin verbatim text
.ft CW
.nf
@@ -28,15 +21,14 @@
..
.de Ve \" End verbatim text
.ft R
-
.fi
..
.\" Set up some character translations and predefined strings. \*(-- will
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
.\" double quote, and \*(R" will give a right double quote. | will give a
-.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used
-.\" to do unbreakable dashes and therefore won't be available. \*(C` and
-.\" \*(C' expand to `' in nroff, nothing in troff, for use with C<>
+.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to
+.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C'
+.\" expand to `' in nroff, nothing in troff, for use with C<>.
.tr \(*W-|\(bv\*(Tr
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.ie n \{\
@@ -56,10 +48,10 @@
. ds R" ''
'br\}
.\"
-.\" If the F register is turned on, we'll generate index entries on stderr
-.\" for titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and
-.\" index entries marked with X<> in POD. Of course, you'll have to process
-.\" the output yourself in some meaningful fashion.
+.\" If the F register is turned on, we'll generate index entries on stderr for
+.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
+.\" entries marked with X<> in POD. Of course, you'll have to process the
+.\" output yourself in some meaningful fashion.
.if \nF \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
@@ -68,14 +60,13 @@
. rr F
.\}
.\"
-.\" For nroff, turn off justification. Always turn off hyphenation; it
-.\" makes way too many mistakes in technical documents.
+.\" For nroff, turn off justification. Always turn off hyphenation; it makes
+.\" way too many mistakes in technical documents.
.hy 0
.if n .na
.\"
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
.\" Fear. Run. Save yourself. No user-serviceable parts.
-.bd B 3
. \" fudge factors for nroff and troff
.if n \{\
. ds #H 0
@@ -135,11 +126,10 @@
. ds Ae AE
.\}
.rm #[ #] #H #V #F C
-.\" ======================================================================
+.\" ========================================================================
.\"
.IX Title "GCOV 1"
-.TH GCOV 1 "gcc-2.97" "2001-01-03" "GNU"
-.UC
+.TH GCOV 1 "2002-01-26" "gcc-3.0.4" "GNU"
.SH "NAME"
gcov \- coverage testing tool
.SH "SYNOPSIS"
@@ -147,27 +137,27 @@ gcov \- coverage testing tool
gcov [\fB\-b\fR] [\fB\-c\fR] [\fB\-v\fR] [\fB\-n\fR] [\fB\-l\fR] [\fB\-f\fR] [\fB\-o\fR \fIdirectory\fR] \fIsourcefile\fR
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
-\&\f(CW\*(C`gcov\*(C'\fR is a test coverage program. Use it in concert with \s-1GNU\s0
-\&\s-1CC\s0 to analyze your programs to help create more efficient, faster
-running code. You can use \f(CW\*(C`gcov\*(C'\fR as a profiling tool to help
+\&\fBgcov\fR is a test coverage program. Use it in concert with \s-1GCC\s0
+to analyze your programs to help create more efficient, faster
+running code. You can use \fBgcov\fR as a profiling tool to help
discover where your optimization efforts will best affect your code. You
-can also use \f(CW\*(C`gcov\*(C'\fR along with the other profiling tool,
-\&\f(CW\*(C`gprof\*(C'\fR, to assess which parts of your code use the greatest amount
+can also use \fBgcov\fR along with the other profiling tool,
+\&\fBgprof\fR, to assess which parts of your code use the greatest amount
of computing time.
.PP
Profiling tools help you analyze your code's performance. Using a
-profiler such as \f(CW\*(C`gcov\*(C'\fR or \f(CW\*(C`gprof\*(C'\fR, you can find out some
+profiler such as \fBgcov\fR or \fBgprof\fR, you can find out some
basic performance statistics, such as:
-.Ip "\(bu" 4
+.IP "\(bu" 4
how often each line of code executes
-.Ip "\(bu" 4
+.IP "\(bu" 4
what lines of code are actually executed
-.Ip "\(bu" 4
+.IP "\(bu" 4
how much computing time each section of code uses
.PP
Once you know these things about how your code works when compiled, you
can look at each module to see which modules should be optimized.
-\&\f(CW\*(C`gcov\*(C'\fR helps you determine where to work on optimization.
+\&\fBgcov\fR helps you determine where to work on optimization.
.PP
Software developers also use coverage testing in concert with
testsuites, to make sure software is actually good enough for a release.
@@ -178,10 +168,10 @@ to be added to the testsuites to create both better testing and a better
final product.
.PP
You should compile your code without optimization if you plan to use
-\&\f(CW\*(C`gcov\*(C'\fR because the optimization, by combining some lines of code
+\&\fBgcov\fR because the optimization, by combining some lines of code
into one function, may not give you as much information as you need to
look for `hot spots' where the code is using a great deal of computer
-time. Likewise, because \f(CW\*(C`gcov\*(C'\fR accumulates statistics by line (at
+time. Likewise, because \fBgcov\fR accumulates statistics by line (at
the lowest resolution), it works best with a programming style that
places only one statement on each line. If you use complicated macros
that expand to loops or to other control structures, the statistics are
@@ -189,56 +179,49 @@ less helpful\-\-\-they only report on the line where the macro call
appears. If your complex macros behave like functions, you can replace
them with inline functions to solve this problem.
.PP
-\&\f(CW\*(C`gcov\*(C'\fR creates a logfile called \fI\fIsourcefile\fI.gcov\fR which
+\&\fBgcov\fR creates a logfile called \fI\fIsourcefile\fI.gcov\fR which
indicates how many times each line of a source file \fI\fIsourcefile\fI.c\fR
-has executed. You can use these logfiles along with \f(CW\*(C`gprof\*(C'\fR to aid
-in fine-tuning the performance of your programs. \f(CW\*(C`gprof\*(C'\fR gives
+has executed. You can use these logfiles along with \fBgprof\fR to aid
+in fine-tuning the performance of your programs. \fBgprof\fR gives
timing information you can use along with the information you get from
-\&\f(CW\*(C`gcov\*(C'\fR.
+\&\fBgcov\fR.
.PP
-\&\f(CW\*(C`gcov\*(C'\fR works only on code compiled with \s-1GNU\s0 \s-1CC\s0. It is not
+\&\fBgcov\fR works only on code compiled with \s-1GCC\s0. It is not
compatible with any other profiling or test coverage mechanism.
.SH "OPTIONS"
.IX Header "OPTIONS"
-.if n .Ip "\f(CW""\-b""\fR" 4
-.el .Ip "\f(CW\-b\fR" 4
+.IP "\fB\-b\fR" 4
.IX Item "-b"
Write branch frequencies to the output file, and write branch summary
info to the standard output. This option allows you to see how often
each branch in your program was taken.
-.if n .Ip "\f(CW""\-c""\fR" 4
-.el .Ip "\f(CW\-c\fR" 4
+.IP "\fB\-c\fR" 4
.IX Item "-c"
-Write branch frequencies as the number of branches taken, rather than
+Write branch frequencies as the number of branches taken, rather than
the percentage of branches taken.
-.if n .Ip "\f(CW""\-v""\fR" 4
-.el .Ip "\f(CW\-v\fR" 4
+.IP "\fB\-v\fR" 4
.IX Item "-v"
-Display the \f(CW\*(C`gcov\*(C'\fR version number (on the standard error stream).
-.if n .Ip "\f(CW""\-n""\fR" 4
-.el .Ip "\f(CW\-n\fR" 4
+Display the \fBgcov\fR version number (on the standard error stream).
+.IP "\fB\-n\fR" 4
.IX Item "-n"
-Do not create the \f(CW\*(C`gcov\*(C'\fR output file.
-.if n .Ip "\f(CW""\-l""\fR" 4
-.el .Ip "\f(CW\-l\fR" 4
+Do not create the \fBgcov\fR output file.
+.IP "\fB\-l\fR" 4
.IX Item "-l"
Create long file names for included source files. For example, if the
-header file \fBx.h\fR contains code, and was included in the file
-\&\fBa.c\fR, then running \f(CW\*(C`gcov\*(C'\fR on the file \fBa.c\fR will produce
-an output file called \fBa.c.x.h.gcov\fR instead of \fBx.h.gcov\fR.
-This can be useful if \fBx.h\fR is included in multiple source files.
-.if n .Ip "\f(CW""\-f""\fR" 4
-.el .Ip "\f(CW\-f\fR" 4
+header file \fIx.h\fR contains code, and was included in the file
+\&\fIa.c\fR, then running \fBgcov\fR on the file \fIa.c\fR will produce
+an output file called \fIa.c.x.h.gcov\fR instead of \fIx.h.gcov\fR.
+This can be useful if \fIx.h\fR is included in multiple source files.
+.IP "\fB\-f\fR" 4
.IX Item "-f"
Output summaries for each function in addition to the file level summary.
-.if n .Ip "\f(CW""\-o""\fR" 4
-.el .Ip "\f(CW\-o\fR" 4
+.IP "\fB\-o\fR" 4
.IX Item "-o"
-The directory where the object files live. Gcov will search for \f(CW\*(C`.bb\*(C'\fR,
-\&\f(CW\*(C`.bbg\*(C'\fR, and \f(CW\*(C`.da\*(C'\fR files in this directory.
+The directory where the object files live. Gcov will search for \fI.bb\fR,
+\&\fI.bbg\fR, and \fI.da\fR files in this directory.
.PP
-When using \f(CW\*(C`gcov\*(C'\fR, you must first compile your program with two
-special \s-1GNU\s0 \s-1CC\s0 options: \fB\-fprofile-arcs \-ftest-coverage\fR.
+When using \fBgcov\fR, you must first compile your program with two
+special \s-1GCC\s0 options: \fB\-fprofile\-arcs \-ftest\-coverage\fR.
This tells the compiler to generate additional information needed by
gcov (basically a flow graph of the program) and also includes
additional code in the object files for generating the extra profiling
@@ -246,13 +229,13 @@ information needed by gcov. These additional files are placed in the
directory where the source code is located.
.PP
Running the program will cause profile output to be generated. For each
-source file compiled with \-fprofile-arcs, an accompanying \f(CW\*(C`.da\*(C'\fR
+source file compiled with \fB\-fprofile\-arcs\fR, an accompanying \fI.da\fR
file will be placed in the source directory.
.PP
-Running \f(CW\*(C`gcov\*(C'\fR with your program's source file names as arguments
+Running \fBgcov\fR with your program's source file names as arguments
will now produce a listing of the code along with frequency of execution
-for each line. For example, if your program is called \fBtmp.c\fR, this
-is what you see when you use the basic \f(CW\*(C`gcov\*(C'\fR facility:
+for each line. For example, if your program is called \fItmp.c\fR, this
+is what you see when you use the basic \fBgcov\fR facility:
.PP
.Vb 5
\& $ gcc -fprofile-arcs -ftest-coverage tmp.c
@@ -261,7 +244,8 @@ is what you see when you use the basic \f(CW\*(C`gcov\*(C'\fR facility:
\& 87.50% of 8 source lines executed in file tmp.c
\& Creating tmp.c.gcov.
.Ve
-The file \fItmp.c.gcov\fR contains output from \f(CW\*(C`gcov\*(C'\fR.
+.PP
+The file \fItmp.c.gcov\fR contains output from \fBgcov\fR.
Here is a sample:
.PP
.Vb 3
@@ -269,13 +253,16 @@ Here is a sample:
\& {
\& 1 int i, total;
.Ve
+.PP
.Vb 1
\& 1 total = 0;
.Ve
+.PP
.Vb 2
\& 11 for (i = 0; i < 10; i++)
\& 10 total += i;
.Ve
+.PP
.Vb 5
\& 1 if (total != 45)
\& ###### printf ("Failure\en");
@@ -283,6 +270,7 @@ Here is a sample:
\& 1 printf ("Success\en");
\& 1 }
.Ve
+.PP
When you use the \fB\-b\fR option, your output looks like this:
.PP
.Vb 6
@@ -293,6 +281,7 @@ When you use the \fB\-b\fR option, your output looks like this:
\& 50.00% of 2 calls executed in file tmp.c
\& Creating tmp.c.gcov.
.Ve
+.PP
Here is a sample of a resulting \fItmp.c.gcov\fR file:
.PP
.Vb 3
@@ -300,9 +289,11 @@ Here is a sample of a resulting \fItmp.c.gcov\fR file:
\& {
\& 1 int i, total;
.Ve
+.PP
.Vb 1
\& 1 total = 0;
.Ve
+.PP
.Vb 5
\& 11 for (i = 0; i < 10; i++)
\& branch 0 taken = 91%
@@ -310,6 +301,7 @@ Here is a sample of a resulting \fItmp.c.gcov\fR file:
\& branch 2 taken = 100%
\& 10 total += i;
.Ve
+.PP
.Vb 9
\& 1 if (total != 45)
\& branch 0 taken = 100%
@@ -321,6 +313,7 @@ Here is a sample of a resulting \fItmp.c.gcov\fR file:
\& call 0 returns = 100%
\& 1 }
.Ve
+.PP
For each basic block, a line is printed after the last line of the basic
block describing the branch or call that ends the basic block. There can
be multiple branches and calls listed for a single source line if there
@@ -342,27 +335,26 @@ of times the call was executed will be printed. This will usually be
and thus may not return every time they are called.
.PP
The execution counts are cumulative. If the example program were
-executed again without removing the \f(CW\*(C`.da\*(C'\fR file, the count for the
+executed again without removing the \fI.da\fR file, the count for the
number of times each line in the source was executed would be added to
-the results of the previous \fIrun\fR\|(s). This is potentially useful in
+the results of the previous run(s). This is potentially useful in
several ways. For example, it could be used to accumulate data over a
number of program runs as part of a test verification suite, or to
provide more accurate long-term information over a large number of
program runs.
.PP
-The data in the \f(CW\*(C`.da\*(C'\fR files is saved immediately before the program
-exits. For each source file compiled with \-fprofile-arcs, the profiling
-code first attempts to read in an existing \f(CW\*(C`.da\*(C'\fR file; if the file
+The data in the \fI.da\fR files is saved immediately before the program
+exits. For each source file compiled with \fB\-fprofile\-arcs\fR, the profiling
+code first attempts to read in an existing \fI.da\fR file; if the file
doesn't match the executable (differing number of basic block counts) it
will ignore the contents of the file. It then adds in the new execution
counts and finally writes the data to the file.
-.if n .Sh "Using \f(CW""gcov""\fP with \s-1GCC\s0 Optimization"
-.el .Sh "Using \f(CWgcov\fP with \s-1GCC\s0 Optimization"
+.Sh "Using \fBgcov\fP with \s-1GCC\s0 Optimization"
.IX Subsection "Using gcov with GCC Optimization"
-If you plan to use \f(CW\*(C`gcov\*(C'\fR to help optimize your code, you must
-first compile your program with two special \s-1GNU\s0 \s-1CC\s0 options:
-\&\fB\-fprofile-arcs \-ftest-coverage\fR. Aside from that, you can use any
-other \s-1GNU\s0 \s-1CC\s0 options; but if you want to prove that every single line
+If you plan to use \fBgcov\fR to help optimize your code, you must
+first compile your program with two special \s-1GCC\s0 options:
+\&\fB\-fprofile\-arcs \-ftest\-coverage\fR. Aside from that, you can use any
+other \s-1GCC\s0 options; but if you want to prove that every single line
in your program was executed, you should not compile with optimization
at the same time. On some machines the optimizer can eliminate some
simple code lines by combining them with other lines. For example, code
@@ -374,10 +366,11 @@ like this:
\& else
\& c = 0;
.Ve
+.PP
can be compiled into one instruction on some machines. In this case,
-there is no way for \f(CW\*(C`gcov\*(C'\fR to calculate separate execution counts
+there is no way for \fBgcov\fR to calculate separate execution counts
for each line because there isn't separate code for each line. Hence
-the \f(CW\*(C`gcov\*(C'\fR output looks like this if you compiled the program with
+the \fBgcov\fR output looks like this if you compiled the program with
optimization:
.PP
.Vb 4
@@ -386,6 +379,7 @@ optimization:
\& 100 else
\& 100 c = 0;
.Ve
+.PP
The output shows that this block of code, combined by optimization,
executed 100 times. In one sense this result is correct, because there
was only one instruction representing all four of these lines. However,
@@ -393,22 +387,29 @@ the output does not indicate how many times the result was 0 and how
many times the result was 1.
.SH "SEE ALSO"
.IX Header "SEE ALSO"
-\&\fIgcc\fR\|(1) and the Info entry for \fIgcc\fR.
+\&\fIgpl\fR\|(7), \fIgfdl\fR\|(7), \fIfsf\-funding\fR\|(7), \fIgcc\fR\|(1) and the Info entry for \fIgcc\fR.
.SH "COPYRIGHT"
.IX Header "COPYRIGHT"
Copyright (c) 1996, 1997, 1999, 2000 Free Software Foundation, Inc.
.PP
-Permission is granted to make and distribute verbatim copies of this
-manual provided the copyright notice and this permission notice are
-preserved on all copies.
+Permission is granted to copy, distribute and/or modify this document
+under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.1 or
+any later version published by the Free Software Foundation; with the
+Invariant Sections being ``\s-1GNU\s0 General Public License'' and ``Funding
+Free Software'', the Front-Cover texts being (a) (see below), and with
+the Back-Cover Texts being (b) (see below). A copy of the license is
+included in the \fIgfdl\fR\|(7) man page.
+.PP
+(a) The \s-1FSF\s0's Front-Cover Text is:
.PP
-Permission is granted to copy and distribute modified versions of this
-manual under the conditions for verbatim copying, provided also that the
-entire resulting derived work is distributed under the terms of a
-permission notice identical to this one.
+.Vb 1
+\& A GNU Manual
+.Ve
+.PP
+(b) The \s-1FSF\s0's Back-Cover Text is:
.PP
-Permission is granted to copy and distribute translations of this manual
-into another language, under the above conditions for modified versions,
-except that this permission notice may be included in translations
-approved by the Free Software Foundation instead of in the original
-English.
+.Vb 3
+\& You have freedom to copy and modify this GNU Manual, like GNU
+\& software. Copies published by the Free Software Foundation raise
+\& funds for GNU development.
+.Ve
diff --git a/gcc/gcov.texi b/gcc/doc/gcov.texi
index f7fd815be4c..3102abc621d 100644
--- a/gcc/gcov.texi
+++ b/gcc/doc/gcov.texi
@@ -6,20 +6,23 @@
@c man begin COPYRIGHT
Copyright @copyright{} 1996, 1997, 1999, 2000 Free Software Foundation, Inc.
-Permission is granted to make and distribute verbatim copies of this
-manual provided the copyright notice and this permission notice are
-preserved on all copies.
-
-Permission is granted to copy and distribute modified versions of this
-manual under the conditions for verbatim copying, provided also that the
-entire resulting derived work is distributed under the terms of a
-permission notice identical to this one.
-
-Permission is granted to copy and distribute translations of this manual
-into another language, under the above conditions for modified versions,
-except that this permission notice may be included in translations
-approved by the Free Software Foundation instead of in the original
-English.
+Permission is granted to copy, distribute and/or modify this document
+under the terms of the GNU Free Documentation License, Version 1.1 or
+any later version published by the Free Software Foundation; with the
+Invariant Sections being ``GNU General Public License'' and ``Funding
+Free Software'', the Front-Cover texts being (a) (see below), and with
+the Back-Cover Texts being (b) (see below). A copy of the license is
+included in the gfdl(7) man page.
+
+(a) The FSF's Front-Cover Text is:
+
+ A GNU Manual
+
+(b) The FSF's Back-Cover Text is:
+
+ You have freedom to copy and modify this GNU Manual, like GNU
+ software. Copies published by the Free Software Foundation raise
+ funds for GNU development.
@c man end
@c Set file name and title for the man page.
@setfilename gcov
@@ -27,12 +30,12 @@ English.
@end ignore
@node Gcov
-@chapter @code{gcov}: a Test Coverage Program
+@chapter @command{gcov}: a Test Coverage Program
-@code{gcov} is a tool you can use in conjunction with @sc{gnu} CC to
+@command{gcov} is a tool you can use in conjunction with GCC to
test code coverage in your programs.
-This chapter describes version 1.5 of @code{gcov}.
+This chapter describes version 1.5 of @command{gcov}.
@menu
* Gcov Intro:: Introduction to gcov.
@@ -42,19 +45,19 @@ This chapter describes version 1.5 of @code{gcov}.
@end menu
@node Gcov Intro
-@section Introduction to @code{gcov}
+@section Introduction to @command{gcov}
@c man begin DESCRIPTION
-@code{gcov} is a test coverage program. Use it in concert with @sc{gnu}
-CC to analyze your programs to help create more efficient, faster
-running code. You can use @code{gcov} as a profiling tool to help
+@command{gcov} is a test coverage program. Use it in concert with GCC
+to analyze your programs to help create more efficient, faster
+running code. You can use @command{gcov} as a profiling tool to help
discover where your optimization efforts will best affect your code. You
-can also use @code{gcov} along with the other profiling tool,
-@code{gprof}, to assess which parts of your code use the greatest amount
+can also use @command{gcov} along with the other profiling tool,
+@command{gprof}, to assess which parts of your code use the greatest amount
of computing time.
Profiling tools help you analyze your code's performance. Using a
-profiler such as @code{gcov} or @code{gprof}, you can find out some
+profiler such as @command{gcov} or @command{gprof}, you can find out some
basic performance statistics, such as:
@itemize @bullet
@@ -70,7 +73,7 @@ how much computing time each section of code uses
Once you know these things about how your code works when compiled, you
can look at each module to see which modules should be optimized.
-@code{gcov} helps you determine where to work on optimization.
+@command{gcov} helps you determine where to work on optimization.
Software developers also use coverage testing in concert with
testsuites, to make sure software is actually good enough for a release.
@@ -81,10 +84,10 @@ to be added to the testsuites to create both better testing and a better
final product.
You should compile your code without optimization if you plan to use
-@code{gcov} because the optimization, by combining some lines of code
+@command{gcov} because the optimization, by combining some lines of code
into one function, may not give you as much information as you need to
look for `hot spots' where the code is using a great deal of computer
-time. Likewise, because @code{gcov} accumulates statistics by line (at
+time. Likewise, because @command{gcov} accumulates statistics by line (at
the lowest resolution), it works best with a programming style that
places only one statement on each line. If you use complicated macros
that expand to loops or to other control structures, the statistics are
@@ -92,14 +95,14 @@ less helpful---they only report on the line where the macro call
appears. If your complex macros behave like functions, you can replace
them with inline functions to solve this problem.
-@code{gcov} creates a logfile called @file{@var{sourcefile}.gcov} which
+@command{gcov} creates a logfile called @file{@var{sourcefile}.gcov} which
indicates how many times each line of a source file @file{@var{sourcefile}.c}
-has executed. You can use these logfiles along with @code{gprof} to aid
-in fine-tuning the performance of your programs. @code{gprof} gives
+has executed. You can use these logfiles along with @command{gprof} to aid
+in fine-tuning the performance of your programs. @command{gprof} gives
timing information you can use along with the information you get from
-@code{gcov}.
+@command{gcov}.
-@code{gcov} works only on code compiled with @sc{gnu} CC. It is not
+@command{gcov} works only on code compiled with GCC@. It is not
compatible with any other profiling or test coverage mechanism.
@c man end
@@ -113,48 +116,48 @@ gcov [-b] [-c] [-v] [-n] [-l] [-f] [-o directory] @var{sourcefile}
@ignore
@c man begin SYNOPSIS
-gcov [@samp{-b}] [@samp{-c}] [@samp{-v}] [@samp{-n}] [@samp{-l}] [@samp{-f}] [@samp{-o} @var{directory}] @var{sourcefile}
+gcov [@option{-b}] [@option{-c}] [@option{-v}] [@option{-n}] [@option{-l}] [@option{-f}] [@option{-o} @var{directory}] @var{sourcefile}
@c man end
@c man begin SEEALSO
-gcc(1) and the Info entry for @file{gcc}.
+gpl(7), gfdl(7), fsf-funding(7), gcc(1) and the Info entry for @file{gcc}.
@c man end
@end ignore
@c man begin OPTIONS
-@table @code
+@table @gcctabopt
@item -b
Write branch frequencies to the output file, and write branch summary
info to the standard output. This option allows you to see how often
each branch in your program was taken.
@item -c
-Write branch frequencies as the number of branches taken, rather than
+Write branch frequencies as the number of branches taken, rather than
the percentage of branches taken.
@item -v
-Display the @code{gcov} version number (on the standard error stream).
+Display the @command{gcov} version number (on the standard error stream).
@item -n
-Do not create the @code{gcov} output file.
+Do not create the @command{gcov} output file.
@item -l
Create long file names for included source files. For example, if the
-header file @samp{x.h} contains code, and was included in the file
-@samp{a.c}, then running @code{gcov} on the file @samp{a.c} will produce
-an output file called @samp{a.c.x.h.gcov} instead of @samp{x.h.gcov}.
-This can be useful if @samp{x.h} is included in multiple source files.
+header file @file{x.h} contains code, and was included in the file
+@file{a.c}, then running @command{gcov} on the file @file{a.c} will produce
+an output file called @file{a.c.x.h.gcov} instead of @file{x.h.gcov}.
+This can be useful if @file{x.h} is included in multiple source files.
@item -f
Output summaries for each function in addition to the file level summary.
@item -o
-The directory where the object files live. Gcov will search for @code{.bb},
-@code{.bbg}, and @code{.da} files in this directory.
+The directory where the object files live. Gcov will search for @file{.bb},
+@file{.bbg}, and @file{.da} files in this directory.
@end table
@need 3000
-When using @code{gcov}, you must first compile your program with two
-special @sc{gnu} CC options: @samp{-fprofile-arcs -ftest-coverage}.
+When using @command{gcov}, you must first compile your program with two
+special GCC options: @samp{-fprofile-arcs -ftest-coverage}.
This tells the compiler to generate additional information needed by
gcov (basically a flow graph of the program) and also includes
additional code in the object files for generating the extra profiling
@@ -162,13 +165,13 @@ information needed by gcov. These additional files are placed in the
directory where the source code is located.
Running the program will cause profile output to be generated. For each
-source file compiled with -fprofile-arcs, an accompanying @code{.da}
+source file compiled with @option{-fprofile-arcs}, an accompanying @file{.da}
file will be placed in the source directory.
-Running @code{gcov} with your program's source file names as arguments
+Running @command{gcov} with your program's source file names as arguments
will now produce a listing of the code along with frequency of execution
-for each line. For example, if your program is called @samp{tmp.c}, this
-is what you see when you use the basic @code{gcov} facility:
+for each line. For example, if your program is called @file{tmp.c}, this
+is what you see when you use the basic @command{gcov} facility:
@smallexample
$ gcc -fprofile-arcs -ftest-coverage tmp.c
@@ -178,19 +181,19 @@ $ gcov tmp.c
Creating tmp.c.gcov.
@end smallexample
-The file @file{tmp.c.gcov} contains output from @code{gcov}.
+The file @file{tmp.c.gcov} contains output from @command{gcov}.
Here is a sample:
@smallexample
main()
@{
1 int i, total;
-
+
1 total = 0;
-
+
11 for (i = 0; i < 10; i++)
10 total += i;
-
+
1 if (total != 45)
###### printf ("Failure\n");
else
@@ -199,7 +202,7 @@ Here is a sample:
@end smallexample
@need 450
-When you use the @samp{-b} option, your output looks like this:
+When you use the @option{-b} option, your output looks like this:
@smallexample
$ gcov -b tmp.c
@@ -216,15 +219,15 @@ Here is a sample of a resulting @file{tmp.c.gcov} file:
main()
@{
1 int i, total;
-
+
1 total = 0;
-
+
11 for (i = 0; i < 10; i++)
branch 0 taken = 91%
branch 1 taken = 100%
branch 2 taken = 100%
10 total += i;
-
+
1 if (total != 45)
branch 0 taken = 100%
###### printf ("Failure\n");
@@ -257,7 +260,7 @@ of times the call was executed will be printed. This will usually be
and thus may not return every time they are called.
The execution counts are cumulative. If the example program were
-executed again without removing the @code{.da} file, the count for the
+executed again without removing the @file{.da} file, the count for the
number of times each line in the source was executed would be added to
the results of the previous run(s). This is potentially useful in
several ways. For example, it could be used to accumulate data over a
@@ -265,20 +268,20 @@ number of program runs as part of a test verification suite, or to
provide more accurate long-term information over a large number of
program runs.
-The data in the @code{.da} files is saved immediately before the program
-exits. For each source file compiled with -fprofile-arcs, the profiling
-code first attempts to read in an existing @code{.da} file; if the file
+The data in the @file{.da} files is saved immediately before the program
+exits. For each source file compiled with @option{-fprofile-arcs}, the profiling
+code first attempts to read in an existing @file{.da} file; if the file
doesn't match the executable (differing number of basic block counts) it
will ignore the contents of the file. It then adds in the new execution
counts and finally writes the data to the file.
@node Gcov and Optimization
-@section Using @code{gcov} with GCC Optimization
+@section Using @command{gcov} with GCC Optimization
-If you plan to use @code{gcov} to help optimize your code, you must
-first compile your program with two special @sc{gnu} CC options:
+If you plan to use @command{gcov} to help optimize your code, you must
+first compile your program with two special GCC options:
@samp{-fprofile-arcs -ftest-coverage}. Aside from that, you can use any
-other @sc{gnu} CC options; but if you want to prove that every single line
+other GCC options; but if you want to prove that every single line
in your program was executed, you should not compile with optimization
at the same time. On some machines the optimizer can eliminate some
simple code lines by combining them with other lines. For example, code
@@ -293,9 +296,9 @@ else
@noindent
can be compiled into one instruction on some machines. In this case,
-there is no way for @code{gcov} to calculate separate execution counts
+there is no way for @command{gcov} to calculate separate execution counts
for each line because there isn't separate code for each line. Hence
-the @code{gcov} output looks like this if you compiled the program with
+the @command{gcov} output looks like this if you compiled the program with
optimization:
@smallexample
@@ -313,35 +316,35 @@ many times the result was 1.
@c man end
@node Gcov Data Files
-@section Brief description of @code{gcov} data files
+@section Brief description of @command{gcov} data files
-@code{gcov} uses three files for doing profiling. The names of these
+@command{gcov} uses three files for doing profiling. The names of these
files are derived from the original @emph{source} file by substituting
-the file suffix with either @code{.bb}, @code{.bbg}, or @code{.da}. All
+the file suffix with either @file{.bb}, @file{.bbg}, or @file{.da}. All
of these files are placed in the same directory as the source file, and
contain data stored in a platform-independent method.
-The @code{.bb} and @code{.bbg} files are generated when the source file
-is compiled with the @sc{gnu} CC @samp{-ftest-coverage} option. The
-@code{.bb} file contains a list of source files (including headers),
+The @file{.bb} and @file{.bbg} files are generated when the source file
+is compiled with the GCC @option{-ftest-coverage} option. The
+@file{.bb} file contains a list of source files (including headers),
functions within those files, and line numbers corresponding to each
basic block in the source file.
-The @code{.bb} file format consists of several lists of 4-byte integers
+The @file{.bb} file format consists of several lists of 4-byte integers
which correspond to the line numbers of each basic block in the
-file. Each list is terminated by a line number of 0. A line number of -1
+file. Each list is terminated by a line number of 0. A line number of @minus{}1
is used to designate that the source file name (padded to a 4-byte
-boundary and followed by another -1) follows. In addition, a line number
-of -2 is used to designate that the name of a function (also padded to a
-4-byte boundary and followed by a -2) follows.
+boundary and followed by another @minus{}1) follows. In addition, a line number
+of @minus{}2 is used to designate that the name of a function (also padded to a
+4-byte boundary and followed by a @minus{}2) follows.
-The @code{.bbg} file is used to reconstruct the program flow graph for
+The @file{.bbg} file is used to reconstruct the program flow graph for
the source file. It contains a list of the program flow arcs (possible
branches taken from one basic block to another) for each function which,
-in combination with the @code{.bb} file, enables gcov to reconstruct the
+in combination with the @file{.bb} file, enables gcov to reconstruct the
program flow.
-In the @code{.bbg} file, the format is:
+In the @file{.bbg} file, the format is:
@smallexample
number of basic blocks for function #0 (4-byte number)
total number of arcs for function #0 (4-byte number)
@@ -350,37 +353,37 @@ In the @code{.bbg} file, the format is:
flag bits (4-byte number)
destination basic block of arc #1 (4-byte number)
flag bits (4-byte number)
- ...
+ @dots{}
destination basic block of arc #N (4-byte number)
flag bits (4-byte number)
count of arcs in basic block #1 (4-byte number)
destination basic block of arc #0 (4-byte number)
flag bits (4-byte number)
- ...
+ @dots{}
@end smallexample
-A -1 (stored as a 4-byte number) is used to separate each function's
+A @minus{}1 (stored as a 4-byte number) is used to separate each function's
list of basic blocks, and to verify that the file has been read
correctly.
-The @code{.da} file is generated when a program containing object files
-built with the @sc{gnu} CC @samp{-fprofile-arcs} option is executed. A
-separate @code{.da} file is created for each source file compiled with
-this option, and the name of the @code{.da} file is stored as an
+The @file{.da} file is generated when a program containing object files
+built with the GCC @option{-fprofile-arcs} option is executed. A
+separate @file{.da} file is created for each source file compiled with
+this option, and the name of the @file{.da} file is stored as an
absolute pathname in the resulting object file. This path name is
-derived from the source file name by substituting a @code{.da} suffix.
+derived from the source file name by substituting a @file{.da} suffix.
-The format of the @code{.da} file is fairly simple. The first 8-byte
+The format of the @file{.da} file is fairly simple. The first 8-byte
number is the number of counts in the file, followed by the counts
(stored as 8-byte numbers). Each count corresponds to the number of
times each arc in the program is executed. The counts are cumulative;
each time the program is executed, it attempts to combine the existing
-@code{.da} files with the new counts for this invocation of the
-program. It ignores the contents of any @code{.da} files whose number of
+@file{.da} files with the new counts for this invocation of the
+program. It ignores the contents of any @file{.da} files whose number of
arcs doesn't correspond to the current program, and merely overwrites
them instead.
-All three of these files use the functions in @code{gcov-io.h} to store
+All three of these files use the functions in @file{gcov-io.h} to store
integers; the functions in this header provide a machine-independent
mechanism for storing and retrieving data from a stream.
diff --git a/gcc/doc/gfdl.7 b/gcc/doc/gfdl.7
new file mode 100644
index 00000000000..faffca79f06
--- /dev/null
+++ b/gcc/doc/gfdl.7
@@ -0,0 +1,515 @@
+.\" Automatically generated by Pod::Man v1.32, Pod::Parser v1.13
+.\"
+.\" Standard preamble:
+.\" ========================================================================
+.de Sh \" Subsection heading
+.br
+.if t .Sp
+.ne 5
+.PP
+\fB\\$1\fR
+.PP
+..
+.de Sp \" Vertical space (when we can't use .PP)
+.if t .sp .5v
+.if n .sp
+..
+.de Vb \" Begin verbatim text
+.ft CW
+.nf
+.ne \\$1
+..
+.de Ve \" End verbatim text
+.ft R
+.fi
+..
+.\" Set up some character translations and predefined strings. \*(-- will
+.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
+.\" double quote, and \*(R" will give a right double quote. | will give a
+.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to
+.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C'
+.\" expand to `' in nroff, nothing in troff, for use with C<>.
+.tr \(*W-|\(bv\*(Tr
+.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
+.ie n \{\
+. ds -- \(*W-
+. ds PI pi
+. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
+. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
+. ds L" ""
+. ds R" ""
+. ds C` ""
+. ds C' ""
+'br\}
+.el\{\
+. ds -- \|\(em\|
+. ds PI \(*p
+. ds L" ``
+. ds R" ''
+'br\}
+.\"
+.\" If the F register is turned on, we'll generate index entries on stderr for
+.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
+.\" entries marked with X<> in POD. Of course, you'll have to process the
+.\" output yourself in some meaningful fashion.
+.if \nF \{\
+. de IX
+. tm Index:\\$1\t\\n%\t"\\$2"
+..
+. nr % 0
+. rr F
+.\}
+.\"
+.\" For nroff, turn off justification. Always turn off hyphenation; it makes
+.\" way too many mistakes in technical documents.
+.hy 0
+.if n .na
+.\"
+.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
+.\" Fear. Run. Save yourself. No user-serviceable parts.
+. \" fudge factors for nroff and troff
+.if n \{\
+. ds #H 0
+. ds #V .8m
+. ds #F .3m
+. ds #[ \f1
+. ds #] \fP
+.\}
+.if t \{\
+. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
+. ds #V .6m
+. ds #F 0
+. ds #[ \&
+. ds #] \&
+.\}
+. \" simple accents for nroff and troff
+.if n \{\
+. ds ' \&
+. ds ` \&
+. ds ^ \&
+. ds , \&
+. ds ~ ~
+. ds /
+.\}
+.if t \{\
+. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
+. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
+. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
+. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
+. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
+. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
+.\}
+. \" troff and (daisy-wheel) nroff accents
+.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
+.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
+.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
+.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
+.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
+.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
+.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
+.ds ae a\h'-(\w'a'u*4/10)'e
+.ds Ae A\h'-(\w'A'u*4/10)'E
+. \" corrections for vroff
+.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
+.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
+. \" for low resolution devices (crt and lpr)
+.if \n(.H>23 .if \n(.V>19 \
+\{\
+. ds : e
+. ds 8 ss
+. ds o a
+. ds d- d\h'-1'\(ga
+. ds D- D\h'-1'\(hy
+. ds th \o'bp'
+. ds Th \o'LP'
+. ds ae ae
+. ds Ae AE
+.\}
+.rm #[ #] #H #V #F C
+.\" ========================================================================
+.\"
+.IX Title "GFDL 7"
+.TH GFDL 7 "2002-01-26" "gcc-3.0.4" "GNU"
+.SH "NAME"
+gfdl \- GNU Free Documentation License
+.SH "DESCRIPTION"
+.IX Header "DESCRIPTION"
+.Sh "\s-1GNU\s0 Free Documentation License"
+.IX Subsection "GNU Free Documentation License"
+.Sh "Version 1.1, March 2000"
+.IX Subsection "Version 1.1, March 2000"
+.Vb 2
+\& Copyright (c) 2000 Free Software Foundation, Inc.
+\& 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
+.Ve
+.PP
+.Vb 2
+\& Everyone is permitted to copy and distribute verbatim copies
+\& of this license document, but changing it is not allowed.
+.Ve
+.IP "0." 4
+\&\s-1PREAMBLE\s0
+.Sp
+The purpose of this License is to make a manual, textbook, or other
+written document \fIfree\fR in the sense of freedom: to assure everyone
+the effective freedom to copy and redistribute it, with or without
+modifying it, either commercially or noncommercially. Secondarily,
+this License preserves for the author and publisher a way to get
+credit for their work, while not being considered responsible for
+modifications made by others.
+.Sp
+This License is a kind of ``copyleft'', which means that derivative
+works of the document must themselves be free in the same sense. It
+complements the \s-1GNU\s0 General Public License, which is a copyleft
+license designed for free software.
+.Sp
+We have designed this License in order to use it for manuals for free
+software, because free software needs free documentation: a free
+program should come with manuals providing the same freedoms that the
+software does. But this License is not limited to software manuals;
+it can be used for any textual work, regardless of subject matter or
+whether it is published as a printed book. We recommend this License
+principally for works whose purpose is instruction or reference.
+.IP "1." 4
+\&\s-1APPLICABILITY\s0 \s-1AND\s0 \s-1DEFINITIONS\s0
+.Sp
+This License applies to any manual or other work that contains a
+notice placed by the copyright holder saying it can be distributed
+under the terms of this License. The ``Document'', below, refers to any
+such manual or work. Any member of the public is a licensee, and is
+addressed as ``you''.
+.Sp
+A ``Modified Version'' of the Document means any work containing the
+Document or a portion of it, either copied verbatim, or with
+modifications and/or translated into another language.
+.Sp
+A ``Secondary Section'' is a named appendix or a front-matter section of
+the Document that deals exclusively with the relationship of the
+publishers or authors of the Document to the Document's overall subject
+(or to related matters) and contains nothing that could fall directly
+within that overall subject. (For example, if the Document is in part a
+textbook of mathematics, a Secondary Section may not explain any
+mathematics.) The relationship could be a matter of historical
+connection with the subject or with related matters, or of legal,
+commercial, philosophical, ethical or political position regarding
+them.
+.Sp
+The ``Invariant Sections'' are certain Secondary Sections whose titles
+are designated, as being those of Invariant Sections, in the notice
+that says that the Document is released under this License.
+.Sp
+The ``Cover Texts'' are certain short passages of text that are listed,
+as Front-Cover Texts or Back-Cover Texts, in the notice that says that
+the Document is released under this License.
+.Sp
+A ``Transparent'' copy of the Document means a machine-readable copy,
+represented in a format whose specification is available to the
+general public, whose contents can be viewed and edited directly and
+straightforwardly with generic text editors or (for images composed of
+pixels) generic paint programs or (for drawings) some widely available
+drawing editor, and that is suitable for input to text formatters or
+for automatic translation to a variety of formats suitable for input
+to text formatters. A copy made in an otherwise Transparent file
+format whose markup has been designed to thwart or discourage
+subsequent modification by readers is not Transparent. A copy that is
+not ``Transparent'' is called ``Opaque''.
+.Sp
+Examples of suitable formats for Transparent copies include plain
+\&\s-1ASCII\s0 without markup, Texinfo input format, LaTeX input format,
+\&\f(CW@acronym\fR{\s-1SGML\s0} or \f(CW@acronym\fR{\s-1XML\s0} using a publicly available
+\&\f(CW@acronym\fR{\s-1DTD\s0}, and standard-conforming simple \f(CW@acronym\fR{\s-1HTML\s0} designed
+for human modification. Opaque formats include PostScript,
+\&\f(CW@acronym\fR{\s-1PDF\s0}, proprietary formats that can be read and edited only by
+proprietary word processors, \f(CW@acronym\fR{\s-1SGML\s0} or \f(CW@acronym\fR{\s-1XML\s0} for which
+the \f(CW@acronym\fR{\s-1DTD\s0} and/or processing tools are not generally available,
+and the machine-generated \f(CW@acronym\fR{\s-1HTML\s0} produced by some word
+processors for output purposes only.
+.Sp
+The ``Title Page'' means, for a printed book, the title page itself,
+plus such following pages as are needed to hold, legibly, the material
+this License requires to appear in the title page. For works in
+formats which do not have any title page as such, ``Title Page'' means
+the text near the most prominent appearance of the work's title,
+preceding the beginning of the body of the text.
+.IP "2." 4
+\&\s-1VERBATIM\s0 \s-1COPYING\s0
+.Sp
+You may copy and distribute the Document in any medium, either
+commercially or noncommercially, provided that this License, the
+copyright notices, and the license notice saying this License applies
+to the Document are reproduced in all copies, and that you add no other
+conditions whatsoever to those of this License. You may not use
+technical measures to obstruct or control the reading or further
+copying of the copies you make or distribute. However, you may accept
+compensation in exchange for copies. If you distribute a large enough
+number of copies you must also follow the conditions in section 3.
+.Sp
+You may also lend copies, under the same conditions stated above, and
+you may publicly display copies.
+.IP "3." 4
+\&\s-1COPYING\s0 \s-1IN\s0 \s-1QUANTITY\s0
+.Sp
+If you publish printed copies of the Document numbering more than 100,
+and the Document's license notice requires Cover Texts, you must enclose
+the copies in covers that carry, clearly and legibly, all these Cover
+Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
+the back cover. Both covers must also clearly and legibly identify
+you as the publisher of these copies. The front cover must present
+the full title with all words of the title equally prominent and
+visible. You may add other material on the covers in addition.
+Copying with changes limited to the covers, as long as they preserve
+the title of the Document and satisfy these conditions, can be treated
+as verbatim copying in other respects.
+.Sp
+If the required texts for either cover are too voluminous to fit
+legibly, you should put the first ones listed (as many as fit
+reasonably) on the actual cover, and continue the rest onto adjacent
+pages.
+.Sp
+If you publish or distribute Opaque copies of the Document numbering
+more than 100, you must either include a machine-readable Transparent
+copy along with each Opaque copy, or state in or with each Opaque copy
+a publicly-accessible computer-network location containing a complete
+Transparent copy of the Document, free of added material, which the
+general network-using public has access to download anonymously at no
+charge using public-standard network protocols. If you use the latter
+option, you must take reasonably prudent steps, when you begin
+distribution of Opaque copies in quantity, to ensure that this
+Transparent copy will remain thus accessible at the stated location
+until at least one year after the last time you distribute an Opaque
+copy (directly or through your agents or retailers) of that edition to
+the public.
+.Sp
+It is requested, but not required, that you contact the authors of the
+Document well before redistributing any large number of copies, to give
+them a chance to provide you with an updated version of the Document.
+.IP "4." 4
+\&\s-1MODIFICATIONS\s0
+.Sp
+You may copy and distribute a Modified Version of the Document under
+the conditions of sections 2 and 3 above, provided that you release
+the Modified Version under precisely this License, with the Modified
+Version filling the role of the Document, thus licensing distribution
+and modification of the Modified Version to whoever possesses a copy
+of it. In addition, you must do these things in the Modified Version:
+.RS 4
+.IP "A." 4
+Use in the Title Page (and on the covers, if any) a title distinct
+from that of the Document, and from those of previous versions
+(which should, if there were any, be listed in the History section
+of the Document). You may use the same title as a previous version
+if the original publisher of that version gives permission.
+.IP "B." 4
+List on the Title Page, as authors, one or more persons or entities
+responsible for authorship of the modifications in the Modified
+Version, together with at least five of the principal authors of the
+Document (all of its principal authors, if it has less than five).
+.IP "C." 4
+State on the Title page the name of the publisher of the
+Modified Version, as the publisher.
+.IP "D." 4
+Preserve all the copyright notices of the Document.
+.IP "E." 4
+Add an appropriate copyright notice for your modifications
+adjacent to the other copyright notices.
+.IP "F." 4
+Include, immediately after the copyright notices, a license notice
+giving the public permission to use the Modified Version under the
+terms of this License, in the form shown in the Addendum below.
+.IP "G." 4
+Preserve in that license notice the full lists of Invariant Sections
+and required Cover Texts given in the Document's license notice.
+.IP "H." 4
+Include an unaltered copy of this License.
+.IP "I." 4
+Preserve the section entitled ``History'', and its title, and add to
+it an item stating at least the title, year, new authors, and
+publisher of the Modified Version as given on the Title Page. If
+there is no section entitled ``History'' in the Document, create one
+stating the title, year, authors, and publisher of the Document as
+given on its Title Page, then add an item describing the Modified
+Version as stated in the previous sentence.
+.IP "J." 4
+Preserve the network location, if any, given in the Document for
+public access to a Transparent copy of the Document, and likewise
+the network locations given in the Document for previous versions
+it was based on. These may be placed in the ``History'' section.
+You may omit a network location for a work that was published at
+least four years before the Document itself, or if the original
+publisher of the version it refers to gives permission.
+.IP "K." 4
+In any section entitled ``Acknowledgments'' or ``Dedications'',
+preserve the section's title, and preserve in the section all the
+substance and tone of each of the contributor acknowledgments
+and/or dedications given therein.
+.IP "L." 4
+Preserve all the Invariant Sections of the Document,
+unaltered in their text and in their titles. Section numbers
+or the equivalent are not considered part of the section titles.
+.IP "M." 4
+Delete any section entitled ``Endorsements''. Such a section
+may not be included in the Modified Version.
+.IP "N." 4
+Do not retitle any existing section as ``Endorsements''
+or to conflict in title with any Invariant Section.
+.RE
+.RS 4
+.Sp
+If the Modified Version includes new front-matter sections or
+appendices that qualify as Secondary Sections and contain no material
+copied from the Document, you may at your option designate some or all
+of these sections as invariant. To do this, add their titles to the
+list of Invariant Sections in the Modified Version's license notice.
+These titles must be distinct from any other section titles.
+.Sp
+You may add a section entitled ``Endorsements'', provided it contains
+nothing but endorsements of your Modified Version by various
+parties\-\-\-for example, statements of peer review or that the text has
+been approved by an organization as the authoritative definition of a
+standard.
+.Sp
+You may add a passage of up to five words as a Front-Cover Text, and a
+passage of up to 25 words as a Back-Cover Text, to the end of the list
+of Cover Texts in the Modified Version. Only one passage of
+Front-Cover Text and one of Back-Cover Text may be added by (or
+through arrangements made by) any one entity. If the Document already
+includes a cover text for the same cover, previously added by you or
+by arrangement made by the same entity you are acting on behalf of,
+you may not add another; but you may replace the old one, on explicit
+permission from the previous publisher that added the old one.
+.Sp
+The author(s) and publisher(s) of the Document do not by this License
+give permission to use their names for publicity for or to assert or
+imply endorsement of any Modified Version.
+.RE
+.IP "5." 4
+\&\s-1COMBINING\s0 \s-1DOCUMENTS\s0
+.Sp
+You may combine the Document with other documents released under this
+License, under the terms defined in section 4 above for modified
+versions, provided that you include in the combination all of the
+Invariant Sections of all of the original documents, unmodified, and
+list them all as Invariant Sections of your combined work in its
+license notice.
+.Sp
+The combined work need only contain one copy of this License, and
+multiple identical Invariant Sections may be replaced with a single
+copy. If there are multiple Invariant Sections with the same name but
+different contents, make the title of each such section unique by
+adding at the end of it, in parentheses, the name of the original
+author or publisher of that section if known, or else a unique number.
+Make the same adjustment to the section titles in the list of
+Invariant Sections in the license notice of the combined work.
+.Sp
+In the combination, you must combine any sections entitled ``History''
+in the various original documents, forming one section entitled
+``History''; likewise combine any sections entitled ``Acknowledgments'',
+and any sections entitled ``Dedications''. You must delete all sections
+entitled ``Endorsements.''
+.IP "6." 4
+\&\s-1COLLECTIONS\s0 \s-1OF\s0 \s-1DOCUMENTS\s0
+.Sp
+You may make a collection consisting of the Document and other documents
+released under this License, and replace the individual copies of this
+License in the various documents with a single copy that is included in
+the collection, provided that you follow the rules of this License for
+verbatim copying of each of the documents in all other respects.
+.Sp
+You may extract a single document from such a collection, and distribute
+it individually under this License, provided you insert a copy of this
+License into the extracted document, and follow this License in all
+other respects regarding verbatim copying of that document.
+.IP "7." 4
+\&\s-1AGGREGATION\s0 \s-1WITH\s0 \s-1INDEPENDENT\s0 \s-1WORKS\s0
+.Sp
+A compilation of the Document or its derivatives with other separate
+and independent documents or works, in or on a volume of a storage or
+distribution medium, does not as a whole count as a Modified Version
+of the Document, provided no compilation copyright is claimed for the
+compilation. Such a compilation is called an ``aggregate'', and this
+License does not apply to the other self-contained works thus compiled
+with the Document, on account of their being thus compiled, if they
+are not themselves derivative works of the Document.
+.Sp
+If the Cover Text requirement of section 3 is applicable to these
+copies of the Document, then if the Document is less than one quarter
+of the entire aggregate, the Document's Cover Texts may be placed on
+covers that surround only the Document within the aggregate.
+Otherwise they must appear on covers around the whole aggregate.
+.IP "8." 4
+\&\s-1TRANSLATION\s0
+.Sp
+Translation is considered a kind of modification, so you may
+distribute translations of the Document under the terms of section 4.
+Replacing Invariant Sections with translations requires special
+permission from their copyright holders, but you may include
+translations of some or all Invariant Sections in addition to the
+original versions of these Invariant Sections. You may include a
+translation of this License provided that you also include the
+original English version of this License. In case of a disagreement
+between the translation and the original English version of this
+License, the original English version will prevail.
+.IP "9." 4
+\&\s-1TERMINATION\s0
+.Sp
+You may not copy, modify, sublicense, or distribute the Document except
+as expressly provided for under this License. Any other attempt to
+copy, modify, sublicense or distribute the Document is void, and will
+automatically terminate your rights under this License. However,
+parties who have received copies, or rights, from you under this
+License will not have their licenses terminated so long as such
+parties remain in full compliance.
+.IP "10." 4
+.IX Item "10."
+\&\s-1FUTURE\s0 \s-1REVISIONS\s0 \s-1OF\s0 \s-1THIS\s0 \s-1LICENSE\s0
+.Sp
+The Free Software Foundation may publish new, revised versions
+of the \s-1GNU\s0 Free Documentation License from time to time. Such new
+versions will be similar in spirit to the present version, but may
+differ in detail to address new problems or concerns. See
+<\fBhttp://www.gnu.org/copyleft/\fR>.
+.Sp
+Each version of the License is given a distinguishing version number.
+If the Document specifies that a particular numbered version of this
+License ``or any later version'' applies to it, you have the option of
+following the terms and conditions either of that specified version or
+of any later version that has been published (not as a draft) by the
+Free Software Foundation. If the Document does not specify a version
+number of this License, you may choose any version ever published (not
+as a draft) by the Free Software Foundation.
+.Sh "\s-1ADDENDUM:\s0 How to use this License for your documents"
+.IX Subsection "ADDENDUM: How to use this License for your documents"
+To use this License in a document you have written, include a copy of
+the License in the document and put the following copyright and
+license notices just after the title page:
+.PP
+.Vb 8
+\& Copyright (C) <year> <your name>.
+\& Permission is granted to copy, distribute and/or modify this document
+\& under the terms of the GNU Free Documentation License, Version 1.1
+\& or any later version published by the Free Software Foundation;
+\& with the Invariant Sections being <list their titles>, with the
+\& Front-Cover Texts being <list>, and with the Back-Cover Texts being <list>.
+\& A copy of the license is included in the section entitled ``GNU
+\& Free Documentation License''.
+.Ve
+.PP
+If you have no Invariant Sections, write ``with no Invariant Sections''
+instead of saying which ones are invariant. If you have no
+Front-Cover Texts, write ``no Front-Cover Texts'' instead of
+``Front\-Cover Texts being \fIlist\fR''; likewise for Back-Cover Texts.
+.PP
+If your document contains nontrivial examples of program code, we
+recommend releasing these examples in parallel under your choice of
+free software license, such as the \s-1GNU\s0 General Public License,
+to permit their use in free software.
+.SH "SEE ALSO"
+.IX Header "SEE ALSO"
+\&\fIgpl\fR\|(7), \fIfsf\-funding\fR\|(7).
+.SH "COPYRIGHT"
+.IX Header "COPYRIGHT"
+Copyright (c) 2000 Free Software Foundation, Inc.
+59 Temple Place, Suite 330, Boston, \s-1MA\s0 02111\-1307, \s-1USA\s0
+.PP
+Everyone is permitted to copy and distribute verbatim copies
+of this license document, but changing it is not allowed.
diff --git a/gcc/doc/gpl.7 b/gcc/doc/gpl.7
new file mode 100644
index 00000000000..5e9a4952ccb
--- /dev/null
+++ b/gcc/doc/gpl.7
@@ -0,0 +1,536 @@
+.\" Automatically generated by Pod::Man v1.32, Pod::Parser v1.13
+.\"
+.\" Standard preamble:
+.\" ========================================================================
+.de Sh \" Subsection heading
+.br
+.if t .Sp
+.ne 5
+.PP
+\fB\\$1\fR
+.PP
+..
+.de Sp \" Vertical space (when we can't use .PP)
+.if t .sp .5v
+.if n .sp
+..
+.de Vb \" Begin verbatim text
+.ft CW
+.nf
+.ne \\$1
+..
+.de Ve \" End verbatim text
+.ft R
+.fi
+..
+.\" Set up some character translations and predefined strings. \*(-- will
+.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
+.\" double quote, and \*(R" will give a right double quote. | will give a
+.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to
+.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C'
+.\" expand to `' in nroff, nothing in troff, for use with C<>.
+.tr \(*W-|\(bv\*(Tr
+.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
+.ie n \{\
+. ds -- \(*W-
+. ds PI pi
+. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
+. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
+. ds L" ""
+. ds R" ""
+. ds C` ""
+. ds C' ""
+'br\}
+.el\{\
+. ds -- \|\(em\|
+. ds PI \(*p
+. ds L" ``
+. ds R" ''
+'br\}
+.\"
+.\" If the F register is turned on, we'll generate index entries on stderr for
+.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
+.\" entries marked with X<> in POD. Of course, you'll have to process the
+.\" output yourself in some meaningful fashion.
+.if \nF \{\
+. de IX
+. tm Index:\\$1\t\\n%\t"\\$2"
+..
+. nr % 0
+. rr F
+.\}
+.\"
+.\" For nroff, turn off justification. Always turn off hyphenation; it makes
+.\" way too many mistakes in technical documents.
+.hy 0
+.if n .na
+.\"
+.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
+.\" Fear. Run. Save yourself. No user-serviceable parts.
+. \" fudge factors for nroff and troff
+.if n \{\
+. ds #H 0
+. ds #V .8m
+. ds #F .3m
+. ds #[ \f1
+. ds #] \fP
+.\}
+.if t \{\
+. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
+. ds #V .6m
+. ds #F 0
+. ds #[ \&
+. ds #] \&
+.\}
+. \" simple accents for nroff and troff
+.if n \{\
+. ds ' \&
+. ds ` \&
+. ds ^ \&
+. ds , \&
+. ds ~ ~
+. ds /
+.\}
+.if t \{\
+. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
+. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
+. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
+. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
+. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
+. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
+.\}
+. \" troff and (daisy-wheel) nroff accents
+.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
+.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
+.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
+.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
+.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
+.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
+.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
+.ds ae a\h'-(\w'a'u*4/10)'e
+.ds Ae A\h'-(\w'A'u*4/10)'E
+. \" corrections for vroff
+.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
+.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
+. \" for low resolution devices (crt and lpr)
+.if \n(.H>23 .if \n(.V>19 \
+\{\
+. ds : e
+. ds 8 ss
+. ds o a
+. ds d- d\h'-1'\(ga
+. ds D- D\h'-1'\(hy
+. ds th \o'bp'
+. ds Th \o'LP'
+. ds ae ae
+. ds Ae AE
+.\}
+.rm #[ #] #H #V #F C
+.\" ========================================================================
+.\"
+.IX Title "GPL 7"
+.TH GPL 7 "2002-01-26" "gcc-3.0.4" "GNU"
+.SH "NAME"
+gpl \- GNU General Public License
+.SH "DESCRIPTION"
+.IX Header "DESCRIPTION"
+.Sh "\s-1GNU\s0 \s-1GENERAL\s0 \s-1PUBLIC\s0 \s-1LICENSE\s0"
+.IX Subsection "GNU GENERAL PUBLIC LICENSE"
+.Sh "Version 2, June 1991"
+.IX Subsection "Version 2, June 1991"
+.Vb 2
+\& Copyright (c) 1989, 1991 Free Software Foundation, Inc.
+\& 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+.Ve
+.PP
+.Vb 2
+\& Everyone is permitted to copy and distribute verbatim copies
+\& of this license document, but changing it is not allowed.
+.Ve
+.Sh "Preamble"
+.IX Subsection "Preamble"
+.Vb 9
+\& The licenses for most software are designed to take away your
+\&freedom to share and change it. By contrast, the GNU General Public
+\&License is intended to guarantee your freedom to share and change free
+\&software---to make sure the software is free for all its users. This
+\&General Public License applies to most of the Free Software
+\&Foundation's software and to any other program whose authors commit to
+\&using it. (Some other Free Software Foundation software is covered by
+\&the GNU Library General Public License instead.) You can apply it to
+\&your programs, too.
+.Ve
+.PP
+.Vb 6
+\& When we speak of free software, we are referring to freedom, not
+\&price. Our General Public Licenses are designed to make sure that you
+\&have the freedom to distribute copies of free software (and charge for
+\&this service if you wish), that you receive source code or can get it
+\&if you want it, that you can change the software or use pieces of it
+\&in new free programs; and that you know you can do these things.
+.Ve
+.PP
+.Vb 4
+\& To protect your rights, we need to make restrictions that forbid
+\&anyone to deny you these rights or to ask you to surrender the rights.
+\&These restrictions translate to certain responsibilities for you if you
+\&distribute copies of the software, or if you modify it.
+.Ve
+.PP
+.Vb 5
+\& For example, if you distribute copies of such a program, whether
+\&gratis or for a fee, you must give the recipients all the rights that
+\&you have. You must make sure that they, too, receive or can get the
+\&source code. And you must show them these terms so they know their
+\&rights.
+.Ve
+.PP
+.Vb 3
+\& We protect your rights with two steps: (1) copyright the software, and
+\&(2) offer you this license which gives you legal permission to copy,
+\&distribute and/or modify the software.
+.Ve
+.PP
+.Vb 6
+\& Also, for each author's protection and ours, we want to make certain
+\&that everyone understands that there is no warranty for this free
+\&software. If the software is modified by someone else and passed on, we
+\&want its recipients to know that what they have is not the original, so
+\&that any problems introduced by others will not reflect on the original
+\&authors' reputations.
+.Ve
+.PP
+.Vb 5
+\& Finally, any free program is threatened constantly by software
+\&patents. We wish to avoid the danger that redistributors of a free
+\&program will individually obtain patent licenses, in effect making the
+\&program proprietary. To prevent this, we have made it clear that any
+\&patent must be licensed for everyone's free use or not licensed at all.
+.Ve
+.PP
+.Vb 2
+\& The precise terms and conditions for copying, distribution and
+\&modification follow.
+.Ve
+.Sh "\s-1TERMS\s0 \s-1AND\s0 \s-1CONDITIONS\s0 \s-1FOR\s0 \s-1COPYING\s0, \s-1DISTRIBUTION\s0 \s-1AND\s0 \s-1MODIFICATION\s0"
+.IX Subsection "TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION"
+.IP "0." 4
+This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The ``Program'', below,
+refers to any such program or work, and a ``work based on the Program''
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term ``modification''.) Each licensee is addressed as ``you''.
+.Sp
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+.IP "1." 4
+You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+.Sp
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+.IP "2." 4
+You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+.RS 4
+.IP "a." 4
+You must cause the modified files to carry prominent notices
+stating that you changed the files and the date of any change.
+.IP "b." 4
+You must cause any work that you distribute or publish, that in
+whole or in part contains or is derived from the Program or any
+part thereof, to be licensed as a whole at no charge to all third
+parties under the terms of this License.
+.IP "c." 4
+If the modified program normally reads commands interactively
+when run, you must cause it, when started running for such
+interactive use in the most ordinary way, to print or display an
+announcement including an appropriate copyright notice and a
+notice that there is no warranty (or else, saying that you provide
+a warranty) and that users may redistribute the program under
+these conditions, and telling the user how to view a copy of this
+License. (Exception: if the Program itself is interactive but
+does not normally print such an announcement, your work based on
+the Program is not required to print an announcement.)
+.RE
+.RS 4
+.Sp
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+.Sp
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+.Sp
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+.RE
+.IP "3." 4
+You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+.RS 4
+.IP "a." 4
+Accompany it with the complete corresponding machine-readable
+source code, which must be distributed under the terms of Sections
+1 and 2 above on a medium customarily used for software interchange; or,
+.IP "b." 4
+Accompany it with a written offer, valid for at least three
+years, to give any third party, for a charge no more than your
+cost of physically performing source distribution, a complete
+machine-readable copy of the corresponding source code, to be
+distributed under the terms of Sections 1 and 2 above on a medium
+customarily used for software interchange; or,
+.IP "c." 4
+Accompany it with the information you received as to the offer
+to distribute corresponding source code. (This alternative is
+allowed only for noncommercial distribution and only if you
+received the program in object code or executable form with such
+an offer, in accord with Subsection b above.)
+.RE
+.RS 4
+.Sp
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+.Sp
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+.RE
+.IP "4." 4
+You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+.IP "5." 4
+You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+.IP "6." 4
+Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+.IP "7." 4
+If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+.Sp
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+.Sp
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+.Sp
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+.IP "8." 4
+If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+.IP "9." 4
+The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+.Sp
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and ``any
+later version'', you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+.IP "10." 4
+.IX Item "10."
+If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+.Sh "\s-1NO\s0 \s-1WARRANTY\s0"
+.IX Subsection "NO WARRANTY"
+.IP "11." 4
+.IX Item "11."
+\&\s-1BECAUSE\s0 \s-1THE\s0 \s-1PROGRAM\s0 \s-1IS\s0 \s-1LICENSED\s0 \s-1FREE\s0 \s-1OF\s0 \s-1CHARGE\s0, \s-1THERE\s0 \s-1IS\s0 \s-1NO\s0 \s-1WARRANTY\s0
+\&\s-1FOR\s0 \s-1THE\s0 \s-1PROGRAM\s0, \s-1TO\s0 \s-1THE\s0 \s-1EXTENT\s0 \s-1PERMITTED\s0 \s-1BY\s0 \s-1APPLICABLE\s0 \s-1LAW\s0. \s-1EXCEPT\s0 \s-1WHEN\s0
+\&\s-1OTHERWISE\s0 \s-1STATED\s0 \s-1IN\s0 \s-1WRITING\s0 \s-1THE\s0 \s-1COPYRIGHT\s0 \s-1HOLDERS\s0 \s-1AND/OR\s0 \s-1OTHER\s0 \s-1PARTIES\s0
+\&\s-1PROVIDE\s0 \s-1THE\s0 \s-1PROGRAM\s0 ``\s-1AS\s0 \s-1IS\s0'' \s-1WITHOUT\s0 \s-1WARRANTY\s0 \s-1OF\s0 \s-1ANY\s0 \s-1KIND\s0, \s-1EITHER\s0 \s-1EXPRESSED\s0
+\&\s-1OR\s0 \s-1IMPLIED\s0, \s-1INCLUDING\s0, \s-1BUT\s0 \s-1NOT\s0 \s-1LIMITED\s0 \s-1TO\s0, \s-1THE\s0 \s-1IMPLIED\s0 \s-1WARRANTIES\s0 \s-1OF\s0
+\&\s-1MERCHANTABILITY\s0 \s-1AND\s0 \s-1FITNESS\s0 \s-1FOR\s0 A \s-1PARTICULAR\s0 \s-1PURPOSE\s0. \s-1THE\s0 \s-1ENTIRE\s0 \s-1RISK\s0 \s-1AS\s0
+\&\s-1TO\s0 \s-1THE\s0 \s-1QUALITY\s0 \s-1AND\s0 \s-1PERFORMANCE\s0 \s-1OF\s0 \s-1THE\s0 \s-1PROGRAM\s0 \s-1IS\s0 \s-1WITH\s0 \s-1YOU\s0. \s-1SHOULD\s0 \s-1THE\s0
+\&\s-1PROGRAM\s0 \s-1PROVE\s0 \s-1DEFECTIVE\s0, \s-1YOU\s0 \s-1ASSUME\s0 \s-1THE\s0 \s-1COST\s0 \s-1OF\s0 \s-1ALL\s0 \s-1NECESSARY\s0 \s-1SERVICING\s0,
+\&\s-1REPAIR\s0 \s-1OR\s0 \s-1CORRECTION\s0.
+.IP "12." 4
+.IX Item "12."
+\&\s-1IN\s0 \s-1NO\s0 \s-1EVENT\s0 \s-1UNLESS\s0 \s-1REQUIRED\s0 \s-1BY\s0 \s-1APPLICABLE\s0 \s-1LAW\s0 \s-1OR\s0 \s-1AGREED\s0 \s-1TO\s0 \s-1IN\s0 \s-1WRITING\s0
+\&\s-1WILL\s0 \s-1ANY\s0 \s-1COPYRIGHT\s0 \s-1HOLDER\s0, \s-1OR\s0 \s-1ANY\s0 \s-1OTHER\s0 \s-1PARTY\s0 \s-1WHO\s0 \s-1MAY\s0 \s-1MODIFY\s0 \s-1AND/OR\s0
+\&\s-1REDISTRIBUTE\s0 \s-1THE\s0 \s-1PROGRAM\s0 \s-1AS\s0 \s-1PERMITTED\s0 \s-1ABOVE\s0, \s-1BE\s0 \s-1LIABLE\s0 \s-1TO\s0 \s-1YOU\s0 \s-1FOR\s0 \s-1DAMAGES\s0,
+\&\s-1INCLUDING\s0 \s-1ANY\s0 \s-1GENERAL\s0, \s-1SPECIAL\s0, \s-1INCIDENTAL\s0 \s-1OR\s0 \s-1CONSEQUENTIAL\s0 \s-1DAMAGES\s0 \s-1ARISING\s0
+\&\s-1OUT\s0 \s-1OF\s0 \s-1THE\s0 \s-1USE\s0 \s-1OR\s0 \s-1INABILITY\s0 \s-1TO\s0 \s-1USE\s0 \s-1THE\s0 \s-1PROGRAM\s0 (\s-1INCLUDING\s0 \s-1BUT\s0 \s-1NOT\s0 \s-1LIMITED\s0
+\&\s-1TO\s0 \s-1LOSS\s0 \s-1OF\s0 \s-1DATA\s0 \s-1OR\s0 \s-1DATA\s0 \s-1BEING\s0 \s-1RENDERED\s0 \s-1INACCURATE\s0 \s-1OR\s0 \s-1LOSSES\s0 \s-1SUSTAINED\s0 \s-1BY\s0
+\&\s-1YOU\s0 \s-1OR\s0 \s-1THIRD\s0 \s-1PARTIES\s0 \s-1OR\s0 A \s-1FAILURE\s0 \s-1OF\s0 \s-1THE\s0 \s-1PROGRAM\s0 \s-1TO\s0 \s-1OPERATE\s0 \s-1WITH\s0 \s-1ANY\s0 \s-1OTHER\s0
+\&\s-1PROGRAMS\s0), \s-1EVEN\s0 \s-1IF\s0 \s-1SUCH\s0 \s-1HOLDER\s0 \s-1OR\s0 \s-1OTHER\s0 \s-1PARTY\s0 \s-1HAS\s0 \s-1BEEN\s0 \s-1ADVISED\s0 \s-1OF\s0 \s-1THE\s0
+\&\s-1POSSIBILITY\s0 \s-1OF\s0 \s-1SUCH\s0 \s-1DAMAGES\s0.
+.Sh "\s-1END\s0 \s-1OF\s0 \s-1TERMS\s0 \s-1AND\s0 \s-1CONDITIONS\s0"
+.IX Subsection "END OF TERMS AND CONDITIONS"
+.Sh "How to Apply These Terms to Your New Programs"
+.IX Subsection "How to Apply These Terms to Your New Programs"
+.Vb 3
+\& If you develop a new program, and you want it to be of the greatest
+\&possible use to the public, the best way to achieve this is to make it
+\&free software which everyone can redistribute and change under these terms.
+.Ve
+.PP
+.Vb 4
+\& To do so, attach the following notices to the program. It is safest
+\&to attach them to the start of each source file to most effectively
+\&convey the exclusion of warranty; and each file should have at least
+\&the ``copyright'' line and a pointer to where the full notice is found.
+.Ve
+.PP
+.Vb 2
+\& <one line to give the program's name and a brief idea of what it does.>
+\& Copyright (C) <year> <name of author>
+.Ve
+.PP
+.Vb 4
+\& This program is free software; you can redistribute it and/or modify
+\& it under the terms of the GNU General Public License as published by
+\& the Free Software Foundation; either version 2 of the License, or
+\& (at your option) any later version.
+.Ve
+.PP
+.Vb 4
+\& This program 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.
+.Ve
+.PP
+.Vb 4
+\& You should have received a copy of the GNU General Public License
+\& along with this program; if not, write to the Free Software
+\& Foundation, Inc., 59 Temple Place - Suite 330,
+\& Boston, MA 02111-1307, USA.
+.Ve
+.PP
+Also add information on how to contact you by electronic and paper mail.
+.PP
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+.PP
+.Vb 5
+\& Gnomovision version 69, Copyright (C) <year> <name of author>
+\& Gnomovision comes with ABSOLUTELY NO WARRANTY; for details
+\& type `show w'.
+\& This is free software, and you are welcome to redistribute it
+\& under certain conditions; type `show c' for details.
+.Ve
+.PP
+The hypothetical commands \fBshow w\fR and \fBshow c\fR should show
+the appropriate parts of the General Public License. Of course, the
+commands you use may be called something other than \fBshow w\fR and
+\&\fBshow c\fR; they could even be mouse-clicks or menu items\-\-\-whatever
+suits your program.
+.PP
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a ``copyright disclaimer'' for the program, if
+necessary. Here is a sample; alter the names:
+.PP
+.Vb 2
+\& Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+\& `Gnomovision' (which makes passes at compilers) written by James Hacker.
+.Ve
+.PP
+.Vb 2
+\& <signature of Ty Coon>, 1 April 1989
+\& Ty Coon, President of Vice
+.Ve
+.PP
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the \s-1GNU\s0 Library General
+Public License instead of this License.
+.SH "SEE ALSO"
+.IX Header "SEE ALSO"
+\&\fIgfdl\fR\|(7), \fIfsf\-funding\fR\|(7).
+.SH "COPYRIGHT"
+.IX Header "COPYRIGHT"
+Copyright (c) 1989, 1991 Free Software Foundation, Inc.
+59 Temple Place \- Suite 330, Boston, \s-1MA\s0 02111\-1307, \s-1USA\s0
+.PP
+Everyone is permitted to copy and distribute verbatim copies
+of this license document, but changing it is not allowed.
diff --git a/gcc/doc/include/fdl.texi b/gcc/doc/include/fdl.texi
new file mode 100644
index 00000000000..88cf36762c8
--- /dev/null
+++ b/gcc/doc/include/fdl.texi
@@ -0,0 +1,434 @@
+@ignore
+@c Set file name and title for man page.
+@setfilename gfdl
+@settitle GNU Free Documentation License
+@c man begin SEEALSO
+gpl(7), fsf-funding(7).
+@c man end
+@c man begin COPYRIGHT
+Copyright @copyright{} 2000 Free Software Foundation, Inc.
+59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
+
+Everyone is permitted to copy and distribute verbatim copies
+of this license document, but changing it is not allowed.
+@c man end
+@end ignore
+@c Special handling for inclusion in the install manual.
+@ifset gfdlhtml
+@ifnothtml
+@comment node-name, next, previous, up
+@node GNU Free Documentation License, Concept Index, Specific, Top
+@end ifnothtml
+@html
+<h1 align="center">Installing GCC: GNU Free Documentation License</h1>
+@end html
+@ifnothtml
+@unnumbered GNU Free Documentation License
+@end ifnothtml
+@end ifset
+@c man begin DESCRIPTION
+@ifclear gfdlhtml
+@node GNU Free Documentation License
+@unnumbered GNU Free Documentation License
+@end ifclear
+
+@cindex FDL, GNU Free Documentation License
+@center Version 1.1, March 2000
+
+@display
+Copyright @copyright{} 2000 Free Software Foundation, Inc.
+59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
+
+Everyone is permitted to copy and distribute verbatim copies
+of this license document, but changing it is not allowed.
+@end display
+
+@enumerate 0
+@item
+PREAMBLE
+
+The purpose of this License is to make a manual, textbook, or other
+written document @dfn{free} in the sense of freedom: to assure everyone
+the effective freedom to copy and redistribute it, with or without
+modifying it, either commercially or noncommercially. Secondarily,
+this License preserves for the author and publisher a way to get
+credit for their work, while not being considered responsible for
+modifications made by others.
+
+This License is a kind of ``copyleft'', which means that derivative
+works of the document must themselves be free in the same sense. It
+complements the GNU General Public License, which is a copyleft
+license designed for free software.
+
+We have designed this License in order to use it for manuals for free
+software, because free software needs free documentation: a free
+program should come with manuals providing the same freedoms that the
+software does. But this License is not limited to software manuals;
+it can be used for any textual work, regardless of subject matter or
+whether it is published as a printed book. We recommend this License
+principally for works whose purpose is instruction or reference.
+
+@item
+APPLICABILITY AND DEFINITIONS
+
+This License applies to any manual or other work that contains a
+notice placed by the copyright holder saying it can be distributed
+under the terms of this License. The ``Document'', below, refers to any
+such manual or work. Any member of the public is a licensee, and is
+addressed as ``you''.
+
+A ``Modified Version'' of the Document means any work containing the
+Document or a portion of it, either copied verbatim, or with
+modifications and/or translated into another language.
+
+A ``Secondary Section'' is a named appendix or a front-matter section of
+the Document that deals exclusively with the relationship of the
+publishers or authors of the Document to the Document's overall subject
+(or to related matters) and contains nothing that could fall directly
+within that overall subject. (For example, if the Document is in part a
+textbook of mathematics, a Secondary Section may not explain any
+mathematics.) The relationship could be a matter of historical
+connection with the subject or with related matters, or of legal,
+commercial, philosophical, ethical or political position regarding
+them.
+
+The ``Invariant Sections'' are certain Secondary Sections whose titles
+are designated, as being those of Invariant Sections, in the notice
+that says that the Document is released under this License.
+
+The ``Cover Texts'' are certain short passages of text that are listed,
+as Front-Cover Texts or Back-Cover Texts, in the notice that says that
+the Document is released under this License.
+
+A ``Transparent'' copy of the Document means a machine-readable copy,
+represented in a format whose specification is available to the
+general public, whose contents can be viewed and edited directly and
+straightforwardly with generic text editors or (for images composed of
+pixels) generic paint programs or (for drawings) some widely available
+drawing editor, and that is suitable for input to text formatters or
+for automatic translation to a variety of formats suitable for input
+to text formatters. A copy made in an otherwise Transparent file
+format whose markup has been designed to thwart or discourage
+subsequent modification by readers is not Transparent. A copy that is
+not ``Transparent'' is called ``Opaque''.
+
+Examples of suitable formats for Transparent copies include plain
+@sc{ascii} without markup, Texinfo input format, La@TeX{} input format,
+@acronym{SGML} or @acronym{XML} using a publicly available
+@acronym{DTD}, and standard-conforming simple @acronym{HTML} designed
+for human modification. Opaque formats include PostScript,
+@acronym{PDF}, proprietary formats that can be read and edited only by
+proprietary word processors, @acronym{SGML} or @acronym{XML} for which
+the @acronym{DTD} and/or processing tools are not generally available,
+and the machine-generated @acronym{HTML} produced by some word
+processors for output purposes only.
+
+The ``Title Page'' means, for a printed book, the title page itself,
+plus such following pages as are needed to hold, legibly, the material
+this License requires to appear in the title page. For works in
+formats which do not have any title page as such, ``Title Page'' means
+the text near the most prominent appearance of the work's title,
+preceding the beginning of the body of the text.
+
+@item
+VERBATIM COPYING
+
+You may copy and distribute the Document in any medium, either
+commercially or noncommercially, provided that this License, the
+copyright notices, and the license notice saying this License applies
+to the Document are reproduced in all copies, and that you add no other
+conditions whatsoever to those of this License. You may not use
+technical measures to obstruct or control the reading or further
+copying of the copies you make or distribute. However, you may accept
+compensation in exchange for copies. If you distribute a large enough
+number of copies you must also follow the conditions in section 3.
+
+You may also lend copies, under the same conditions stated above, and
+you may publicly display copies.
+
+@item
+COPYING IN QUANTITY
+
+If you publish printed copies of the Document numbering more than 100,
+and the Document's license notice requires Cover Texts, you must enclose
+the copies in covers that carry, clearly and legibly, all these Cover
+Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
+the back cover. Both covers must also clearly and legibly identify
+you as the publisher of these copies. The front cover must present
+the full title with all words of the title equally prominent and
+visible. You may add other material on the covers in addition.
+Copying with changes limited to the covers, as long as they preserve
+the title of the Document and satisfy these conditions, can be treated
+as verbatim copying in other respects.
+
+If the required texts for either cover are too voluminous to fit
+legibly, you should put the first ones listed (as many as fit
+reasonably) on the actual cover, and continue the rest onto adjacent
+pages.
+
+If you publish or distribute Opaque copies of the Document numbering
+more than 100, you must either include a machine-readable Transparent
+copy along with each Opaque copy, or state in or with each Opaque copy
+a publicly-accessible computer-network location containing a complete
+Transparent copy of the Document, free of added material, which the
+general network-using public has access to download anonymously at no
+charge using public-standard network protocols. If you use the latter
+option, you must take reasonably prudent steps, when you begin
+distribution of Opaque copies in quantity, to ensure that this
+Transparent copy will remain thus accessible at the stated location
+until at least one year after the last time you distribute an Opaque
+copy (directly or through your agents or retailers) of that edition to
+the public.
+
+It is requested, but not required, that you contact the authors of the
+Document well before redistributing any large number of copies, to give
+them a chance to provide you with an updated version of the Document.
+
+@item
+MODIFICATIONS
+
+You may copy and distribute a Modified Version of the Document under
+the conditions of sections 2 and 3 above, provided that you release
+the Modified Version under precisely this License, with the Modified
+Version filling the role of the Document, thus licensing distribution
+and modification of the Modified Version to whoever possesses a copy
+of it. In addition, you must do these things in the Modified Version:
+
+@enumerate A
+@item
+Use in the Title Page (and on the covers, if any) a title distinct
+from that of the Document, and from those of previous versions
+(which should, if there were any, be listed in the History section
+of the Document). You may use the same title as a previous version
+if the original publisher of that version gives permission.
+
+@item
+List on the Title Page, as authors, one or more persons or entities
+responsible for authorship of the modifications in the Modified
+Version, together with at least five of the principal authors of the
+Document (all of its principal authors, if it has less than five).
+
+@item
+State on the Title page the name of the publisher of the
+Modified Version, as the publisher.
+
+@item
+Preserve all the copyright notices of the Document.
+
+@item
+Add an appropriate copyright notice for your modifications
+adjacent to the other copyright notices.
+
+@item
+Include, immediately after the copyright notices, a license notice
+giving the public permission to use the Modified Version under the
+terms of this License, in the form shown in the Addendum below.
+
+@item
+Preserve in that license notice the full lists of Invariant Sections
+and required Cover Texts given in the Document's license notice.
+
+@item
+Include an unaltered copy of this License.
+
+@item
+Preserve the section entitled ``History'', and its title, and add to
+it an item stating at least the title, year, new authors, and
+publisher of the Modified Version as given on the Title Page. If
+there is no section entitled ``History'' in the Document, create one
+stating the title, year, authors, and publisher of the Document as
+given on its Title Page, then add an item describing the Modified
+Version as stated in the previous sentence.
+
+@item
+Preserve the network location, if any, given in the Document for
+public access to a Transparent copy of the Document, and likewise
+the network locations given in the Document for previous versions
+it was based on. These may be placed in the ``History'' section.
+You may omit a network location for a work that was published at
+least four years before the Document itself, or if the original
+publisher of the version it refers to gives permission.
+
+@item
+In any section entitled ``Acknowledgments'' or ``Dedications'',
+preserve the section's title, and preserve in the section all the
+substance and tone of each of the contributor acknowledgments
+and/or dedications given therein.
+
+@item
+Preserve all the Invariant Sections of the Document,
+unaltered in their text and in their titles. Section numbers
+or the equivalent are not considered part of the section titles.
+
+@item
+Delete any section entitled ``Endorsements''. Such a section
+may not be included in the Modified Version.
+
+@item
+Do not retitle any existing section as ``Endorsements''
+or to conflict in title with any Invariant Section.
+@end enumerate
+
+If the Modified Version includes new front-matter sections or
+appendices that qualify as Secondary Sections and contain no material
+copied from the Document, you may at your option designate some or all
+of these sections as invariant. To do this, add their titles to the
+list of Invariant Sections in the Modified Version's license notice.
+These titles must be distinct from any other section titles.
+
+You may add a section entitled ``Endorsements'', provided it contains
+nothing but endorsements of your Modified Version by various
+parties---for example, statements of peer review or that the text has
+been approved by an organization as the authoritative definition of a
+standard.
+
+You may add a passage of up to five words as a Front-Cover Text, and a
+passage of up to 25 words as a Back-Cover Text, to the end of the list
+of Cover Texts in the Modified Version. Only one passage of
+Front-Cover Text and one of Back-Cover Text may be added by (or
+through arrangements made by) any one entity. If the Document already
+includes a cover text for the same cover, previously added by you or
+by arrangement made by the same entity you are acting on behalf of,
+you may not add another; but you may replace the old one, on explicit
+permission from the previous publisher that added the old one.
+
+The author(s) and publisher(s) of the Document do not by this License
+give permission to use their names for publicity for or to assert or
+imply endorsement of any Modified Version.
+
+@item
+COMBINING DOCUMENTS
+
+You may combine the Document with other documents released under this
+License, under the terms defined in section 4 above for modified
+versions, provided that you include in the combination all of the
+Invariant Sections of all of the original documents, unmodified, and
+list them all as Invariant Sections of your combined work in its
+license notice.
+
+The combined work need only contain one copy of this License, and
+multiple identical Invariant Sections may be replaced with a single
+copy. If there are multiple Invariant Sections with the same name but
+different contents, make the title of each such section unique by
+adding at the end of it, in parentheses, the name of the original
+author or publisher of that section if known, or else a unique number.
+Make the same adjustment to the section titles in the list of
+Invariant Sections in the license notice of the combined work.
+
+In the combination, you must combine any sections entitled ``History''
+in the various original documents, forming one section entitled
+``History''; likewise combine any sections entitled ``Acknowledgments'',
+and any sections entitled ``Dedications''. You must delete all sections
+entitled ``Endorsements.''
+
+@item
+COLLECTIONS OF DOCUMENTS
+
+You may make a collection consisting of the Document and other documents
+released under this License, and replace the individual copies of this
+License in the various documents with a single copy that is included in
+the collection, provided that you follow the rules of this License for
+verbatim copying of each of the documents in all other respects.
+
+You may extract a single document from such a collection, and distribute
+it individually under this License, provided you insert a copy of this
+License into the extracted document, and follow this License in all
+other respects regarding verbatim copying of that document.
+
+@item
+AGGREGATION WITH INDEPENDENT WORKS
+
+A compilation of the Document or its derivatives with other separate
+and independent documents or works, in or on a volume of a storage or
+distribution medium, does not as a whole count as a Modified Version
+of the Document, provided no compilation copyright is claimed for the
+compilation. Such a compilation is called an ``aggregate'', and this
+License does not apply to the other self-contained works thus compiled
+with the Document, on account of their being thus compiled, if they
+are not themselves derivative works of the Document.
+
+If the Cover Text requirement of section 3 is applicable to these
+copies of the Document, then if the Document is less than one quarter
+of the entire aggregate, the Document's Cover Texts may be placed on
+covers that surround only the Document within the aggregate.
+Otherwise they must appear on covers around the whole aggregate.
+
+@item
+TRANSLATION
+
+Translation is considered a kind of modification, so you may
+distribute translations of the Document under the terms of section 4.
+Replacing Invariant Sections with translations requires special
+permission from their copyright holders, but you may include
+translations of some or all Invariant Sections in addition to the
+original versions of these Invariant Sections. You may include a
+translation of this License provided that you also include the
+original English version of this License. In case of a disagreement
+between the translation and the original English version of this
+License, the original English version will prevail.
+
+@item
+TERMINATION
+
+You may not copy, modify, sublicense, or distribute the Document except
+as expressly provided for under this License. Any other attempt to
+copy, modify, sublicense or distribute the Document is void, and will
+automatically terminate your rights under this License. However,
+parties who have received copies, or rights, from you under this
+License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+@item
+FUTURE REVISIONS OF THIS LICENSE
+
+The Free Software Foundation may publish new, revised versions
+of the GNU Free Documentation License from time to time. Such new
+versions will be similar in spirit to the present version, but may
+differ in detail to address new problems or concerns. See
+@uref{http://www.gnu.org/copyleft/}.
+
+Each version of the License is given a distinguishing version number.
+If the Document specifies that a particular numbered version of this
+License ``or any later version'' applies to it, you have the option of
+following the terms and conditions either of that specified version or
+of any later version that has been published (not as a draft) by the
+Free Software Foundation. If the Document does not specify a version
+number of this License, you may choose any version ever published (not
+as a draft) by the Free Software Foundation.
+@end enumerate
+
+@page
+@unnumberedsec ADDENDUM: How to use this License for your documents
+
+To use this License in a document you have written, include a copy of
+the License in the document and put the following copyright and
+license notices just after the title page:
+
+@smallexample
+@group
+ Copyright (C) @var{year} @var{your name}.
+ Permission is granted to copy, distribute and/or modify this document
+ under the terms of the GNU Free Documentation License, Version 1.1
+ or any later version published by the Free Software Foundation;
+ with the Invariant Sections being @var{list their titles}, with the
+ Front-Cover Texts being @var{list}, and with the Back-Cover Texts being @var{list}.
+ A copy of the license is included in the section entitled ``GNU
+ Free Documentation License''.
+@end group
+@end smallexample
+
+If you have no Invariant Sections, write ``with no Invariant Sections''
+instead of saying which ones are invariant. If you have no
+Front-Cover Texts, write ``no Front-Cover Texts'' instead of
+``Front-Cover Texts being @var{list}''; likewise for Back-Cover Texts.
+
+If your document contains nontrivial examples of program code, we
+recommend releasing these examples in parallel under your choice of
+free software license, such as the GNU General Public License,
+to permit their use in free software.
+
+@c Local Variables:
+@c ispell-local-pdict: "ispell-dict"
+@c End:
+
+@c man end
diff --git a/gcc/doc/include/funding.texi b/gcc/doc/include/funding.texi
new file mode 100644
index 00000000000..d1583fabc0d
--- /dev/null
+++ b/gcc/doc/include/funding.texi
@@ -0,0 +1,60 @@
+@ignore
+@c Set file name and title for man page.
+@setfilename fsf-funding
+@settitle Funding Free Software
+@c man begin SEEALSO
+gpl(7), gfdl(7).
+@c man end
+@end ignore
+@node Funding
+@c man begin DESCRIPTION
+@unnumbered Funding Free Software
+
+If you want to have more free software a few years from now, it makes
+sense for you to help encourage people to contribute funds for its
+development. The most effective approach known is to encourage
+commercial redistributors to donate.
+
+Users of free software systems can boost the pace of development by
+encouraging for-a-fee distributors to donate part of their selling price
+to free software developers---the Free Software Foundation, and others.
+
+The way to convince distributors to do this is to demand it and expect
+it from them. So when you compare distributors, judge them partly by
+how much they give to free software development. Show distributors
+they must compete to be the one who gives the most.
+
+To make this approach work, you must insist on numbers that you can
+compare, such as, ``We will donate ten dollars to the Frobnitz project
+for each disk sold.'' Don't be satisfied with a vague promise, such as
+``A portion of the profits are donated,'' since it doesn't give a basis
+for comparison.
+
+Even a precise fraction ``of the profits from this disk'' is not very
+meaningful, since creative accounting and unrelated business decisions
+can greatly alter what fraction of the sales price counts as profit.
+If the price you pay is $50, ten percent of the profit is probably
+less than a dollar; it might be a few cents, or nothing at all.
+
+Some redistributors do development work themselves. This is useful too;
+but to keep everyone honest, you need to inquire how much they do, and
+what kind. Some kinds of development make much more long-term
+difference than others. For example, maintaining a separate version of
+a program contributes very little; maintaining the standard version of a
+program for the whole community contributes much. Easy new ports
+contribute little, since someone else would surely do them; difficult
+ports such as adding a new CPU to the GNU Compiler Collection contribute more;
+major new features or packages contribute the most.
+
+By establishing the idea that supporting further development is ``the
+proper thing to do'' when distributing free software for a fee, we can
+assure a steady flow of resources into making more free software.
+@c man end
+
+@display
+@c man begin COPYRIGHT
+Copyright @copyright{} 1994 Free Software Foundation, Inc.
+Verbatim copying and redistribution of this section is permitted
+without royalty; alteration is not permitted.
+@c man end
+@end display
diff --git a/gcc/doc/include/gpl.texi b/gcc/doc/include/gpl.texi
new file mode 100644
index 00000000000..6632a443ae8
--- /dev/null
+++ b/gcc/doc/include/gpl.texi
@@ -0,0 +1,409 @@
+@ignore
+@c Set file name and title for man page.
+@setfilename gpl
+@settitle GNU General Public License
+@c man begin SEEALSO
+gfdl(7), fsf-funding(7).
+@c man end
+@c man begin COPYRIGHT
+Copyright @copyright{} 1989, 1991 Free Software Foundation, Inc.
+59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+
+Everyone is permitted to copy and distribute verbatim copies
+of this license document, but changing it is not allowed.
+@c man end
+@end ignore
+@node Copying
+@c man begin DESCRIPTION
+@unnumbered GNU GENERAL PUBLIC LICENSE
+@center Version 2, June 1991
+
+@display
+Copyright @copyright{} 1989, 1991 Free Software Foundation, Inc.
+59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+
+Everyone is permitted to copy and distribute verbatim copies
+of this license document, but changing it is not allowed.
+@end display
+
+@unnumberedsec Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software---to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+@iftex
+@unnumberedsec TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+@end iftex
+@ifnottex
+@center TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+@end ifnottex
+
+@enumerate 0
+@item
+This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The ``Program'', below,
+refers to any such program or work, and a ``work based on the Program''
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term ``modification''.) Each licensee is addressed as ``you''.
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+@item
+You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+@item
+You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+@enumerate a
+@item
+You must cause the modified files to carry prominent notices
+stating that you changed the files and the date of any change.
+
+@item
+You must cause any work that you distribute or publish, that in
+whole or in part contains or is derived from the Program or any
+part thereof, to be licensed as a whole at no charge to all third
+parties under the terms of this License.
+
+@item
+If the modified program normally reads commands interactively
+when run, you must cause it, when started running for such
+interactive use in the most ordinary way, to print or display an
+announcement including an appropriate copyright notice and a
+notice that there is no warranty (or else, saying that you provide
+a warranty) and that users may redistribute the program under
+these conditions, and telling the user how to view a copy of this
+License. (Exception: if the Program itself is interactive but
+does not normally print such an announcement, your work based on
+the Program is not required to print an announcement.)
+@end enumerate
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+@item
+You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+@enumerate a
+@item
+Accompany it with the complete corresponding machine-readable
+source code, which must be distributed under the terms of Sections
+1 and 2 above on a medium customarily used for software interchange; or,
+
+@item
+Accompany it with a written offer, valid for at least three
+years, to give any third party, for a charge no more than your
+cost of physically performing source distribution, a complete
+machine-readable copy of the corresponding source code, to be
+distributed under the terms of Sections 1 and 2 above on a medium
+customarily used for software interchange; or,
+
+@item
+Accompany it with the information you received as to the offer
+to distribute corresponding source code. (This alternative is
+allowed only for noncommercial distribution and only if you
+received the program in object code or executable form with such
+an offer, in accord with Subsection b above.)
+@end enumerate
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+@item
+You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+@item
+You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+@item
+Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+@item
+If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+@item
+If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+@item
+The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and ``any
+later version'', you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+@item
+If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+@iftex
+@heading NO WARRANTY
+@end iftex
+@ifnottex
+@center NO WARRANTY
+@end ifnottex
+
+@item
+BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM ``AS IS'' WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+@item
+IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+@end enumerate
+
+@iftex
+@heading END OF TERMS AND CONDITIONS
+@end iftex
+@ifnottex
+@center END OF TERMS AND CONDITIONS
+@end ifnottex
+
+@page
+@unnumberedsec How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the ``copyright'' line and a pointer to where the full notice is found.
+
+@smallexample
+@var{one line to give the program's name and a brief idea of what it does.}
+Copyright (C) @var{year} @var{name of author}
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program 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 program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.
+@end smallexample
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+@smallexample
+Gnomovision version 69, Copyright (C) @var{year} @var{name of author}
+Gnomovision comes with ABSOLUTELY NO WARRANTY; for details
+type `show w'.
+This is free software, and you are welcome to redistribute it
+under certain conditions; type `show c' for details.
+@end smallexample
+
+The hypothetical commands @samp{show w} and @samp{show c} should show
+the appropriate parts of the General Public License. Of course, the
+commands you use may be called something other than @samp{show w} and
+@samp{show c}; they could even be mouse-clicks or menu items---whatever
+suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a ``copyright disclaimer'' for the program, if
+necessary. Here is a sample; alter the names:
+
+@smallexample
+Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+`Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+@var{signature of Ty Coon}, 1 April 1989
+Ty Coon, President of Vice
+@end smallexample
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Library General
+Public License instead of this License.
+@c man end
diff --git a/gcc/texinfo.tex b/gcc/doc/include/texinfo.tex
index 1889b4c6d1a..9dffef42188 100644
--- a/gcc/texinfo.tex
+++ b/gcc/doc/include/texinfo.tex
@@ -3,10 +3,10 @@
% Load plain if necessary, i.e., if running under initex.
\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
%
-\def\texinfoversion{2000-12-11.07}
+\def\texinfoversion{2001-05-24.08}
%
-% Copyright (C) 1985, 86, 88, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000
-% Free Software Foundation, Inc.
+% Copyright (C) 1985, 86, 88, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99,
+% 2000, 01 Free Software Foundation, Inc.
%
% This texinfo.tex file is free software; you can redistribute it and/or
% modify it under the terms of the GNU General Public License as
@@ -170,6 +170,16 @@
}%
\fi
+% add check for \lastpenalty to plain's definitions. If the last thing
+% we did was a \nobreak, we don't want to insert more space.
+%
+\def\smallbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\smallskipamount
+ \removelastskip\penalty-50\smallskip\fi\fi}
+\def\medbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\medskipamount
+ \removelastskip\penalty-100\medskip\fi\fi}
+\def\bigbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\bigskipamount
+ \removelastskip\penalty-200\bigskip\fi\fi}
+
% For @cropmarks command.
% Do @cropmarks to get crop marks.
%
@@ -730,9 +740,9 @@ where each line of input produces a line of output.}
\fi
%
\ifodd\pageno
- \def\temp{\inleftmargin\lefttext}%
+ \def\temp{\inrightmargin\righttext}% odd page -> outside is right margin
\else
- \def\temp{\inrightmargin\righttext}%
+ \def\temp{\inleftmargin\lefttext}%
\fi
\temp
}
@@ -924,11 +934,15 @@ where each line of input produces a line of output.}
\fi
\ifx\empty\imagewidth\else width \imagewidth \fi
\ifx\empty\imageheight\else height \imageheight \fi
- {#1.pdf}%
+ \ifnum\pdftexversion<13
+ #1.pdf%
+ \else
+ {#1.pdf}%
+ \fi
\ifnum\pdftexversion < 14 \else
\pdfrefximage \pdflastximage
\fi}
- \def\pdfmkdest#1{\pdfdest name{#1@} xyz}
+ \def\pdfmkdest#1{\pdfdest name{#1} xyz}
\def\pdfmkpgn#1{#1@}
\let\linkcolor = \Blue % was Cyan, but that seems light?
\def\endlink{\Black\pdfendlink}
@@ -1026,6 +1040,7 @@ where each line of input produces a line of output.}
\def\pdfurl#1{%
\begingroup
\normalturnoffactive\def\@{@}%
+ \let\value=\expandablevalue
\leavevmode\Red
\startlink attr{/Border [0 0 0]}%
user{/Subtype /Link /A << /S /URI /URI (#1) >>}%
@@ -2904,16 +2919,17 @@ width0pt\relax} \fi
% Now the real index entry with the fonts.
\toks0 = {#2}%
%
- % If third (subentry) arg is present, add it to the index
- % string. And include a space.
+ % If the third (subentry) arg is present, add it to the index
+ % line to write.
\ifx\thirdarg\emptymacro \else
- \toks0 = \expandafter{\the\toks0 \space #3}%
+ \toks0 = \expandafter{\the\toks0{#3}}%
\fi
%
- % Set up the complete index entry, with both the sort key
- % and the original text, including any font commands. We write
- % three arguments to \entry to the .?? file, texindex reduces to
- % two when writing the .??s sorted result.
+ % Set up the complete index entry, with both the sort key and
+ % the original text, including any font commands. We write
+ % three arguments to \entry to the .?? file (four in the
+ % subentry case), texindex reduces to two when writing the .??s
+ % sorted result.
\edef\temp{%
\write\csname#1indfile\endcsname{%
\realbackslash entry{\indexsorttmp}{\folio}{\the\toks0}}%
@@ -3135,11 +3151,18 @@ width0pt\relax} \fi
\def\primary #1{\line{#1\hfil}}
\newskip\secondaryindent \secondaryindent=0.5cm
-
-\def\secondary #1#2{
-{\parfillskip=0in \parskip=0in
-\hangindent =1in \hangafter=1
-\noindent\hskip\secondaryindent\hbox{#1}\indexdotfill #2\par
+\def\secondary#1#2{{%
+ \parfillskip=0in
+ \parskip=0in
+ \hangindent=1in
+ \hangafter=1
+ \noindent\hskip\secondaryindent\hbox{#1}\indexdotfill
+ \ifpdf
+ \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph.
+ \else
+ #2
+ \fi
+ \par
}}
% Define two-column mode, which we use to typeset indexes.
@@ -4134,9 +4157,17 @@ width0pt\relax} \fi
% is reset to zero; thus the \afterenvbreak inserts no space -- but the
% start of the next paragraph will insert \parskip
%
-\def\aboveenvbreak{{\advance\envskipamount by \parskip
-\endgraf \ifdim\lastskip<\envskipamount
-\removelastskip \penalty-50 \vskip\envskipamount \fi}}
+\def\aboveenvbreak{{%
+ \ifnum\lastpenalty < 10000
+ \advance\envskipamount by \parskip
+ \endgraf
+ \ifdim\lastskip<\envskipamount
+ \removelastskip
+ \penalty-50
+ \vskip\envskipamount
+ \fi
+ \fi
+}}
\let\afterenvbreak = \aboveenvbreak
@@ -5836,7 +5867,8 @@ width0pt\relax} \fi
\setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi
\setbox0 = \hbox{\ignorespaces #3}\ifdim\wd0 > 0pt \epsfysize=#3\relax \fi
\begingroup
- \catcode`\^^M = 5 % in case we're inside an example
+ \catcode`\^^M = 5 % in case we're inside an example
+ \normalturnoffactive % allow _ et al. in names
% If the image is by itself, center it.
\ifvmode
\nobreak\bigskip
@@ -5948,6 +5980,15 @@ should work if nowhere else does.}
\setemergencystretch
}
+% Use `small' versions.
+%
+\def\smallenvironments{%
+ \let\smalldisplay = \smalldisplayx
+ \let\smallexample = \smalllispx
+ \let\smallformat = \smallformatx
+ \let\smalllisp = \smalllispx
+}
+
% @letterpaper (the default).
\def\letterpaper{{\globaldefs = 1
\parskip = 3pt plus 2pt minus 1pt
@@ -5970,11 +6011,7 @@ should work if nowhere else does.}
\contentsrightmargin = 0pt
\deftypemargin = 0pt
\defbodyindent = .5cm
- %
- \let\smalldisplay = \smalldisplayx
- \let\smallexample = \smalllispx
- \let\smallformat = \smallformatx
- \let\smalllisp = \smalllispx
+ \smallenvironments
}}
% Use @afourpaper to print on European A4 paper.
@@ -5988,6 +6025,26 @@ should work if nowhere else does.}
\hfuzz = 1pt
}}
+% Use @afivepaper to print on European A5 paper.
+% From romildo@urano.iceb.ufop.br, 2 July 2000.
+% He also recommends making @example and @lisp be small.
+\def\afivepaper{{\globaldefs = 1
+ \setleading{12.5pt}%
+ \parskip = 2pt plus 1pt minus 0.1pt
+ %
+ \internalpagesizes{166mm}{120mm}{\voffset}{-8mm}{\bindingoffset}{8pt}%
+ %
+ \lispnarrowing = 0.2in
+ \tolerance = 800
+ \hfuzz = 1.2pt
+ \contentsrightmargin = 0mm
+ \deftypemargin = 0pt
+ \defbodyindent = 2mm
+ \tableindent = 12mm
+ %
+ \smallenvironments
+}}
+
% A specific text layout, 24x15cm overall, intended for A4 paper. Top margin
% 29mm, hence bottom margin 28mm, nominal side margin 3cm.
\def\afourlatex{{\globaldefs = 1
diff --git a/gcc/doc/install-old.texi b/gcc/doc/install-old.texi
new file mode 100644
index 00000000000..ea186cfbeb6
--- /dev/null
+++ b/gcc/doc/install-old.texi
@@ -0,0 +1,843 @@
+@c Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+@c This is part of the GCC manual.
+@c For copying conditions, see the file gcc.texi.
+
+@node Installation
+@chapter Installing GNU CC
+@cindex installing GNU CC
+
+Note most of this information is out of date and superseded by the
+new GCC install manual @file{gcc/doc/install.texi}. It is
+provided for historical reference only.
+
+@menu
+* Configuration Files:: Files created by running @code{configure}.
+* Configurations:: Configurations Supported by GNU CC.
+* Cross-Compiler:: Building and installing a cross-compiler.
+* VMS Install:: See below for installation on VMS.
+* Collect2:: How @code{collect2} works; how it finds @code{ld}.
+* Header Dirs:: Understanding the standard header file directories.
+@end menu
+
+Here is the procedure for installing GNU CC on a GNU or Unix system.
+See @ref{VMS Install}, for VMS systems.
+
+@enumerate
+@item
+If you have chosen a configuration for GNU CC which requires other GNU
+tools (such as GAS or the GNU linker) instead of the standard system
+tools, install the required tools in the build directory under the names
+@file{as}, @file{ld} or whatever is appropriate. This will enable the
+compiler to find the proper tools for compilation of the program
+@file{enquire}.
+
+Alternatively, you can do subsequent compilation using a value of the
+@code{PATH} environment variable such that the necessary GNU tools come
+before the standard system tools.
+
+@item
+Specify the host, build and target machine configurations. You do this
+when you run the @file{configure} script.
+
+The @dfn{build} machine is the system which you are using, the
+@dfn{host} machine is the system where you want to run the resulting
+compiler (normally the build machine), and the @dfn{target} machine is
+the system for which you want the compiler to generate code.
+
+If you are building a compiler to produce code for the machine it runs
+on (a native compiler), you normally do not need to specify any operands
+to @file{configure}; it will try to guess the type of machine you are on
+and use that as the build, host and target machines. So you don't need
+to specify a configuration when building a native compiler unless
+@file{configure} cannot figure out what your configuration is or guesses
+wrong.
+
+In those cases, specify the build machine's @dfn{configuration name}
+with the @option{--host} option; the host and target will default to be
+the same as the host machine. (If you are building a cross-compiler,
+see @ref{Cross-Compiler}.)
+
+Here is an example:
+
+@smallexample
+./configure --host=sparc-sun-sunos4.1
+@end smallexample
+
+A configuration name may be canonical or it may be more or less
+abbreviated.
+
+A canonical configuration name has three parts, separated by dashes.
+It looks like this: @samp{@var{cpu}-@var{company}-@var{system}}.
+(The three parts may themselves contain dashes; @file{configure}
+can figure out which dashes serve which purpose.) For example,
+@samp{m68k-sun-sunos4.1} specifies a Sun 3.
+
+You can also replace parts of the configuration by nicknames or aliases.
+For example, @samp{sun3} stands for @samp{m68k-sun}, so
+@samp{sun3-sunos4.1} is another way to specify a Sun 3.
+
+You can specify a version number after any of the system types, and some
+of the CPU types. In most cases, the version is irrelevant, and will be
+ignored. So you might as well specify the version if you know it.
+
+See @ref{Configurations}, for a list of supported configuration names and
+notes on many of the configurations. You should check the notes in that
+section before proceeding any further with the installation of GNU CC@.
+
+@end enumerate
+
+@node Configuration Files
+@section Files Created by @code{configure}
+
+Here we spell out what files will be set up by @code{configure}. Normally
+you need not be concerned with these files.
+
+@itemize @bullet
+@item
+@ifset INTERNALS
+A file named @file{config.h} is created that contains a @samp{#include}
+of the top-level config file for the machine you will run the compiler
+on (@pxref{Config}). This file is responsible for defining information
+about the host machine. It includes @file{tm.h}.
+@end ifset
+@ifclear INTERNALS
+A file named @file{config.h} is created that contains a @samp{#include}
+of the top-level config file for the machine you will run the compiler
+on (@pxref{Config,,The Configuration File, gcc.info, Using and Porting
+GCC}). This file is responsible for defining information about the host
+machine. It includes @file{tm.h}.
+@end ifclear
+
+The top-level config file is located in the subdirectory @file{config}.
+Its name is always @file{xm-@var{something}.h}; usually
+@file{xm-@var{machine}.h}, but there are some exceptions.
+
+If your system does not support symbolic links, you might want to
+set up @file{config.h} to contain a @samp{#include} command which
+refers to the appropriate file.
+
+@item
+A file named @file{tconfig.h} is created which includes the top-level config
+file for your target machine. This is used for compiling certain
+programs to run on that machine.
+
+@item
+A file named @file{tm.h} is created which includes the
+machine-description macro file for your target machine. It should be in
+the subdirectory @file{config} and its name is often
+@file{@var{machine}.h}.
+
+@item
+The command file @file{configure} also constructs the file
+@file{Makefile} by adding some text to the template file
+@file{Makefile.in}. The additional text comes from files in the
+@file{config} directory, named @file{t-@var{target}} and
+@file{x-@var{host}}. If these files do not exist, it means nothing
+needs to be added for a given target or host.
+@end itemize
+
+@node Configurations
+@section Configurations Supported by GNU CC
+@cindex configurations supported by GNU CC
+
+Here are the possible CPU types:
+
+@quotation
+@c gmicro, fx80, spur and tahoe omitted since they don't work.
+1750a, a29k, alpha, arm, avr, c@var{n}, clipper, dsp16xx, elxsi, fr30, h8300,
+hppa1.0, hppa1.1, i370, i386, i486, i586, i686, i786, i860, i960, m32r,
+m68000, m68k, m6811, m6812, m88k, mcore, mips, mipsel, mips64, mips64el,
+mn10200, mn10300, ns32k, pdp11, powerpc, powerpcle, romp, rs6000, sh, sparc,
+sparclite, sparc64, v850, vax, we32k.
+@end quotation
+
+Here are the recognized company names. As you can see, customary
+abbreviations are used rather than the longer official names.
+
+@c What should be done about merlin, tek*, dolphin?
+@quotation
+acorn, alliant, altos, apollo, apple, att, bull,
+cbm, convergent, convex, crds, dec, dg, dolphin,
+elxsi, encore, harris, hitachi, hp, ibm, intergraph, isi,
+mips, motorola, ncr, next, ns, omron, plexus,
+sequent, sgi, sony, sun, tti, unicom, wrs.
+@end quotation
+
+The company name is meaningful only to disambiguate when the rest of
+the information supplied is insufficient. You can omit it, writing
+just @samp{@var{cpu}-@var{system}}, if it is not needed. For example,
+@samp{vax-ultrix4.2} is equivalent to @samp{vax-dec-ultrix4.2}.
+
+Here is a list of system types:
+
+@quotation
+386bsd, aix, acis, amigaos, aos, aout, aux, bosx, bsd, clix, coff, ctix, cxux,
+dgux, dynix, ebmon, ecoff, elf, esix, freebsd, hms, genix, gnu, linux,
+linux-gnu, hiux, hpux, iris, irix, isc, luna, lynxos, mach, minix, msdos, mvs,
+netbsd, newsos, nindy, ns, osf, osfrose, ptx, riscix, riscos, rtu, sco, sim,
+solaris, sunos, sym, sysv, udi, ultrix, unicos, uniplus, unos, vms, vsta,
+vxworks, winnt, xenix.
+@end quotation
+
+@noindent
+You can omit the system type; then @file{configure} guesses the
+operating system from the CPU and company.
+
+You can add a version number to the system type; this may or may not
+make a difference. For example, you can write @samp{bsd4.3} or
+@samp{bsd4.4} to distinguish versions of BSD@. In practice, the version
+number is most needed for @samp{sysv3} and @samp{sysv4}, which are often
+treated differently.
+
+@samp{linux-gnu} is the canonical name for the GNU/Linux target; however
+GNU CC will also accept @samp{linux}. The version of the kernel in use is
+not relevant on these systems. A suffix such as @samp{libc1} or @samp{aout}
+distinguishes major versions of the C library; all of the suffixed versions
+are obsolete.
+
+If you specify an impossible combination such as @samp{i860-dg-vms},
+then you may get an error message from @file{configure}, or it may
+ignore part of the information and do the best it can with the rest.
+@file{configure} always prints the canonical name for the alternative
+that it used. GNU CC does not support all possible alternatives.
+
+Often a particular model of machine has a name. Many machine names are
+recognized as aliases for CPU/company combinations. Thus, the machine
+name @samp{sun3}, mentioned above, is an alias for @samp{m68k-sun}.
+Sometimes we accept a company name as a machine name, when the name is
+popularly used for a particular machine. Here is a table of the known
+machine names:
+
+@quotation
+3300, 3b1, 3b@var{n}, 7300, altos3068, altos,
+apollo68, att-7300, balance,
+convex-c@var{n}, crds, decstation-3100,
+decstation, delta, encore,
+fx2800, gmicro, hp7@var{nn}, hp8@var{nn},
+hp9k2@var{nn}, hp9k3@var{nn}, hp9k7@var{nn},
+hp9k8@var{nn}, iris4d, iris, isi68,
+m3230, magnum, merlin, miniframe,
+mmax, news-3600, news800, news, next,
+pbd, pc532, pmax, powerpc, powerpcle, ps2, risc-news,
+rtpc, sun2, sun386i, sun386, sun3,
+sun4, symmetry, tower-32, tower.
+@end quotation
+
+@noindent
+Remember that a machine name specifies both the cpu type and the company
+name.
+If you want to install your own homemade configuration files, you can
+use @samp{local} as the company name to access them. If you use
+configuration @samp{@var{cpu}-local}, the configuration name
+without the cpu prefix
+is used to form the configuration file names.
+
+Thus, if you specify @samp{m68k-local}, configuration uses
+files @file{m68k.md}, @file{local.h}, @file{m68k.c},
+@file{xm-local.h}, @file{t-local}, and @file{x-local}, all in the
+directory @file{config/m68k}.
+
+Here is a list of configurations that have special treatment or special
+things you must know:
+
+@table @samp
+@item vax-dec-vms
+See @ref{VMS Install}, for details on how to install GNU CC on VMS@.
+@end table
+
+@node Cross-Compiler
+@section Building and Installing a Cross-Compiler
+@cindex cross-compiler, installation
+
+GNU CC can function as a cross-compiler for many machines, but not all.
+
+@itemize @bullet
+@item
+Cross-compilers for the Mips as target using the Mips assembler
+currently do not work, because the auxiliary programs
+@file{mips-tdump.c} and @file{mips-tfile.c} can't be compiled on
+anything but a Mips. It does work to cross compile for a Mips
+if you use the GNU assembler and linker.
+
+@item
+Cross-compilers between machines with different floating point formats
+have not all been made to work. GNU CC now has a floating point
+emulator with which these can work, but each target machine description
+needs to be updated to take advantage of it.
+
+@item
+Cross-compilation between machines of different word sizes is
+somewhat problematic and sometimes does not work.
+@end itemize
+
+Since GNU CC generates assembler code, you probably need a
+cross-assembler that GNU CC can run, in order to produce object files.
+If you want to link on other than the target machine, you need a
+cross-linker as well. You also need header files and libraries suitable
+for the target machine that you can install on the host machine.
+
+@menu
+* Steps of Cross:: Using a cross-compiler involves several steps
+ that may be carried out on different machines.
+* Configure Cross:: Configuring a cross-compiler.
+* Tools and Libraries:: Where to put the linker and assembler, and the C library.
+* Cross Headers:: Finding and installing header files
+ for a cross-compiler.
+* Build Cross:: Actually compiling the cross-compiler.
+@end menu
+
+@node Steps of Cross
+@subsection Steps of Cross-Compilation
+
+To compile and run a program using a cross-compiler involves several
+steps:
+
+@itemize @bullet
+@item
+Run the cross-compiler on the host machine to produce assembler files
+for the target machine. This requires header files for the target
+machine.
+
+@item
+Assemble the files produced by the cross-compiler. You can do this
+either with an assembler on the target machine, or with a
+cross-assembler on the host machine.
+
+@item
+Link those files to make an executable. You can do this either with a
+linker on the target machine, or with a cross-linker on the host
+machine. Whichever machine you use, you need libraries and certain
+startup files (typically @file{crt@dots{}.o}) for the target machine.
+@end itemize
+
+It is most convenient to do all of these steps on the same host machine,
+since then you can do it all with a single invocation of GNU CC@. This
+requires a suitable cross-assembler and cross-linker. For some targets,
+the GNU assembler and linker are available.
+
+@node Configure Cross
+@subsection Configuring a Cross-Compiler
+
+To build GNU CC as a cross-compiler, you start out by running
+@file{configure}. Use the @option{--target=@var{target}} to specify the
+target type. If @file{configure} was unable to correctly identify the
+system you are running on, also specify the @option{--build=@var{build}}
+option. For example, here is how to configure for a cross-compiler that
+produces code for an HP 68030 system running BSD on a system that
+@file{configure} can correctly identify:
+
+@smallexample
+./configure --target=m68k-hp-bsd4.3
+@end smallexample
+
+@node Tools and Libraries
+@subsection Tools and Libraries for a Cross-Compiler
+
+If you have a cross-assembler and cross-linker available, you should
+install them now. Put them in the directory
+@file{/usr/local/@var{target}/bin}. Here is a table of the tools
+you should put in this directory:
+
+@table @file
+@item as
+This should be the cross-assembler.
+
+@item ld
+This should be the cross-linker.
+
+@item ar
+This should be the cross-archiver: a program which can manipulate
+archive files (linker libraries) in the target machine's format.
+
+@item ranlib
+This should be a program to construct a symbol table in an archive file.
+@end table
+
+The installation of GNU CC will find these programs in that directory,
+and copy or link them to the proper place to for the cross-compiler to
+find them when run later.
+
+The easiest way to provide these files is to build the Binutils package
+and GAS@. Configure them with the same @option{--host} and @option{--target}
+options that you use for configuring GNU CC, then build and install
+them. They install their executables automatically into the proper
+directory. Alas, they do not support all the targets that GNU CC
+supports.
+
+If you want to install libraries to use with the cross-compiler, such as
+a standard C library, put them in the directory
+@file{/usr/local/@var{target}/lib}; installation of GNU CC copies
+all the files in that subdirectory into the proper place for GNU CC to
+find them and link with them. Here's an example of copying some
+libraries from a target machine:
+
+@example
+ftp @var{target-machine}
+lcd /usr/local/@var{target}/lib
+cd /lib
+get libc.a
+cd /usr/lib
+get libg.a
+get libm.a
+quit
+@end example
+
+@noindent
+The precise set of libraries you'll need, and their locations on
+the target machine, vary depending on its operating system.
+
+@cindex start files
+Many targets require ``start files'' such as @file{crt0.o} and
+@file{crtn.o} which are linked into each executable; these too should be
+placed in @file{/usr/local/@var{target}/lib}. There may be several
+alternatives for @file{crt0.o}, for use with profiling or other
+compilation options. Check your target's definition of
+@code{STARTFILE_SPEC} to find out what start files it uses.
+Here's an example of copying these files from a target machine:
+
+@example
+ftp @var{target-machine}
+lcd /usr/local/@var{target}/lib
+prompt
+cd /lib
+mget *crt*.o
+cd /usr/lib
+mget *crt*.o
+quit
+@end example
+
+@node Cross Headers
+@subsection Cross-Compilers and Header Files
+
+If you are cross-compiling a standalone program or a program for an
+embedded system, then you may not need any header files except the few
+that are part of GNU CC (and those of your program). However, if you
+intend to link your program with a standard C library such as
+@file{libc.a}, then you probably need to compile with the header files
+that go with the library you use.
+
+The GNU C compiler does not come with these files, because (1) they are
+system-specific, and (2) they belong in a C library, not in a compiler.
+
+If the GNU C library supports your target machine, then you can get the
+header files from there (assuming you actually use the GNU library when
+you link your program).
+
+If your target machine comes with a C compiler, it probably comes with
+suitable header files also. If you make these files accessible from the host
+machine, the cross-compiler can use them also.
+
+Otherwise, you're on your own in finding header files to use when
+cross-compiling.
+
+When you have found suitable header files, put them in the directory
+@file{/usr/local/@var{target}/include}, before building the cross
+compiler. Then installation will run fixincludes properly and install
+the corrected versions of the header files where the compiler will use
+them.
+
+Provide the header files before you build the cross-compiler, because
+the build stage actually runs the cross-compiler to produce parts of
+@file{libgcc.a}. (These are the parts that @emph{can} be compiled with
+GNU CC@.) Some of them need suitable header files.
+
+Here's an example showing how to copy the header files from a target
+machine. On the target machine, do this:
+
+@example
+(cd /usr/include; tar cf - .) > tarfile
+@end example
+
+Then, on the host machine, do this:
+
+@example
+ftp @var{target-machine}
+lcd /usr/local/@var{target}/include
+get tarfile
+quit
+tar xf tarfile
+@end example
+
+@node Build Cross
+@subsection Actually Building the Cross-Compiler
+
+Now you can proceed just as for compiling a single-machine compiler
+through the step of building stage 1.
+
+If your target is exotic, you may need to provide the header file
+@file{float.h}.One way to do this is to compile @file{enquire} and run
+it on your target machine. The job of @file{enquire} is to run on the
+target machine and figure out by experiment the nature of its floating
+point representation. @file{enquire} records its findings in the header
+file @file{float.h}. If you can't produce this file by running
+@file{enquire} on the target machine, then you will need to come up with
+a suitable @file{float.h} in some other way (or else, avoid using it in
+your programs).
+
+Do not try to build stage 2 for a cross-compiler. It doesn't work to
+rebuild GNU CC as a cross-compiler using the cross-compiler, because
+that would produce a program that runs on the target machine, not on the
+host. For example, if you compile a 386-to-68030 cross-compiler with
+itself, the result will not be right either for the 386 (because it was
+compiled into 68030 code) or for the 68030 (because it was configured
+for a 386 as the host). If you want to compile GNU CC into 68030 code,
+whether you compile it on a 68030 or with a cross-compiler on a 386, you
+must specify a 68030 as the host when you configure it.
+
+To install the cross-compiler, use @samp{make install}, as usual.
+
+@node VMS Install
+@section Installing GNU CC on VMS
+@cindex VMS installation
+@cindex installing GNU CC on VMS
+
+The VMS version of GNU CC is distributed in a backup saveset containing
+both source code and precompiled binaries.
+
+To install the @file{gcc} command so you can use the compiler easily, in
+the same manner as you use the VMS C compiler, you must install the VMS CLD
+file for GNU CC as follows:
+
+@enumerate
+@item
+Define the VMS logical names @samp{GNU_CC} and @samp{GNU_CC_INCLUDE}
+to point to the directories where the GNU CC executables
+(@file{gcc-cpp.exe}, @file{gcc-cc1.exe}, etc.) and the C include files are
+kept respectively. This should be done with the commands:
+
+@smallexample
+$ assign /system /translation=concealed -
+ disk:[gcc.] gnu_cc
+$ assign /system /translation=concealed -
+ disk:[gcc.include.] gnu_cc_include
+@end smallexample
+
+@noindent
+with the appropriate disk and directory names. These commands can be
+placed in your system startup file so they will be executed whenever
+the machine is rebooted. You may, if you choose, do this via the
+@file{GCC_INSTALL.COM} script in the @file{[GCC]} directory.
+
+@item
+Install the @file{GCC} command with the command line:
+
+@smallexample
+$ set command /table=sys$common:[syslib]dcltables -
+ /output=sys$common:[syslib]dcltables gnu_cc:[000000]gcc
+$ install replace sys$common:[syslib]dcltables
+@end smallexample
+
+@item
+To install the help file, do the following:
+
+@smallexample
+$ library/help sys$library:helplib.hlb gcc.hlp
+@end smallexample
+
+@noindent
+Now you can invoke the compiler with a command like @samp{gcc /verbose
+file.c}, which is equivalent to the command @samp{gcc -v -c file.c} in
+Unix.
+@end enumerate
+
+If you wish to use GNU C++ you must first install GNU CC, and then
+perform the following steps:
+
+@enumerate
+@item
+Define the VMS logical name @samp{GNU_GXX_INCLUDE} to point to the
+directory where the preprocessor will search for the C++ header files.
+This can be done with the command:
+
+@smallexample
+$ assign /system /translation=concealed -
+ disk:[gcc.gxx_include.] gnu_gxx_include
+@end smallexample
+
+@noindent
+with the appropriate disk and directory name. If you are going to be
+using a C++ runtime library, this is where its install procedure will install
+its header files.
+
+@item
+Obtain the file @file{gcc-cc1plus.exe}, and place this in the same
+directory that @file{gcc-cc1.exe} is kept.
+
+The GNU C++ compiler can be invoked with a command like @samp{gcc /plus
+/verbose file.cc}, which is equivalent to the command @samp{g++ -v -c
+file.cc} in Unix.
+@end enumerate
+
+We try to put corresponding binaries and sources on the VMS distribution
+tape. But sometimes the binaries will be from an older version than the
+sources, because we don't always have time to update them. (Use the
+@samp{/version} option to determine the version number of the binaries and
+compare it with the source file @file{version.c} to tell whether this is
+so.) In this case, you should use the binaries you get to recompile the
+sources. If you must recompile, here is how:
+
+@enumerate
+@item
+Execute the command procedure @file{vmsconfig.com} to set up the files
+@file{tm.h}, @file{config.h}, @file{aux-output.c}, and @file{md.}, and
+to create files @file{tconfig.h} and @file{hconfig.h}. This procedure
+also creates several linker option files used by @file{make-cc1.com} and
+a data file used by @file{make-l2.com}.
+
+@smallexample
+$ @@vmsconfig.com
+@end smallexample
+
+@item
+Setup the logical names and command tables as defined above. In
+addition, define the VMS logical name @samp{GNU_BISON} to point at the
+to the directories where the Bison executable is kept. This should be
+done with the command:
+
+@smallexample
+$ assign /system /translation=concealed -
+ disk:[bison.] gnu_bison
+@end smallexample
+
+You may, if you choose, use the @file{INSTALL_BISON.COM} script in the
+@file{[BISON]} directory.
+
+@item
+Install the @samp{BISON} command with the command line:
+
+@smallexample
+$ set command /table=sys$common:[syslib]dcltables -
+ /output=sys$common:[syslib]dcltables -
+ gnu_bison:[000000]bison
+$ install replace sys$common:[syslib]dcltables
+@end smallexample
+
+@item
+Type @samp{@@make-gcc} to recompile everything (alternatively, submit
+the file @file{make-gcc.com} to a batch queue). If you wish to build
+the GNU C++ compiler as well as the GNU CC compiler, you must first edit
+@file{make-gcc.com} and follow the instructions that appear in the
+comments.
+
+@item
+In order to use GCC, you need a library of functions which GCC compiled code
+will call to perform certain tasks, and these functions are defined in the
+file @file{libgcc2.c}. To compile this you should use the command procedure
+@file{make-l2.com}, which will generate the library @file{libgcc2.olb}.
+@file{libgcc2.olb} should be built using the compiler built from
+the same distribution that @file{libgcc2.c} came from, and
+@file{make-gcc.com} will automatically do all of this for you.
+
+To install the library, use the following commands:
+
+@smallexample
+$ library gnu_cc:[000000]gcclib/delete=(new,eprintf)
+$ library gnu_cc:[000000]gcclib/delete=L_*
+$ library libgcc2/extract=*/output=libgcc2.obj
+$ library gnu_cc:[000000]gcclib libgcc2.obj
+@end smallexample
+
+The first command simply removes old modules that will be replaced with
+modules from @file{libgcc2} under different module names. The modules
+@code{new} and @code{eprintf} may not actually be present in your
+@file{gcclib.olb}---if the VMS librarian complains about those modules
+not being present, simply ignore the message and continue on with the
+next command. The second command removes the modules that came from the
+previous version of the library @file{libgcc2.c}.
+
+Whenever you update the compiler on your system, you should also update the
+library with the above procedure.
+
+@item
+You may wish to build GCC in such a way that no files are written to the
+directory where the source files reside. An example would be the when
+the source files are on a read-only disk. In these cases, execute the
+following DCL commands (substituting your actual path names):
+
+@smallexample
+$ assign dua0:[gcc.build_dir.]/translation=concealed, -
+ dua1:[gcc.source_dir.]/translation=concealed gcc_build
+$ set default gcc_build:[000000]
+@end smallexample
+
+@noindent
+where the directory @file{dua1:[gcc.source_dir]} contains the source
+code, and the directory @file{dua0:[gcc.build_dir]} is meant to contain
+all of the generated object files and executables. Once you have done
+this, you can proceed building GCC as described above. (Keep in mind
+that @file{gcc_build} is a rooted logical name, and thus the device
+names in each element of the search list must be an actual physical
+device name rather than another rooted logical name).
+
+@item
+@strong{If you are building GNU CC with a previous version of GNU CC,
+you also should check to see that you have the newest version of the
+assembler}. In particular, GNU CC version 2 treats global constant
+variables slightly differently from GNU CC version 1, and GAS version
+1.38.1 does not have the patches required to work with GCC version 2.
+If you use GAS 1.38.1, then @code{extern const} variables will not have
+the read-only bit set, and the linker will generate warning messages
+about mismatched psect attributes for these variables. These warning
+messages are merely a nuisance, and can safely be ignored.
+
+If you are compiling with a version of GNU CC older than 1.33, specify
+@samp{/DEFINE=("inline=")} as an option in all the compilations. This
+requires editing all the @code{gcc} commands in @file{make-cc1.com}.
+(The older versions had problems supporting @code{inline}.) Once you
+have a working 1.33 or newer GNU CC, you can change this file back.
+
+@item
+If you want to build GNU CC with the VAX C compiler, you will need to
+make minor changes in @file{make-cccp.com} and @file{make-cc1.com}
+to choose alternate definitions of @code{CC}, @code{CFLAGS}, and
+@code{LIBS}. See comments in those files. However, you must
+also have a working version of the GNU assembler (GNU as, aka GAS) as
+it is used as the back end for GNU CC to produce binary object modules
+and is not included in the GNU CC sources. GAS is also needed to
+compile @file{libgcc2} in order to build @file{gcclib} (see above);
+@file{make-l2.com} expects to be able to find it operational in
+@file{gnu_cc:[000000]gnu-as.exe}.
+
+To use GNU CC on VMS, you need the VMS driver programs
+@file{gcc.exe}, @file{gcc.com}, and @file{gcc.cld}. They are
+distributed with the VMS binaries (@file{gcc-vms}) rather than the
+GNU CC sources. GAS is also included in @file{gcc-vms}, as is Bison.
+
+Once you have successfully built GNU CC with VAX C, you should use the
+resulting compiler to rebuild itself. Before doing this, be sure to
+restore the @code{CC}, @code{CFLAGS}, and @code{LIBS} definitions in
+@file{make-cccp.com} and @file{make-cc1.com}. The second generation
+compiler will be able to take advantage of many optimizations that must
+be suppressed when building with other compilers.
+@end enumerate
+
+Under previous versions of GNU CC, the generated code would occasionally
+give strange results when linked with the sharable @file{VAXCRTL} library.
+Now this should work.
+
+Even with this version, however, GNU CC itself should not be linked with
+the sharable @file{VAXCRTL}. The version of @code{qsort} in
+@file{VAXCRTL} has a bug (known to be present in VMS versions V4.6
+through V5.5) which causes the compiler to fail.
+
+The executables are generated by @file{make-cc1.com} and
+@file{make-cccp.com} use the object library version of @file{VAXCRTL} in
+order to make use of the @code{qsort} routine in @file{gcclib.olb}. If
+you wish to link the compiler executables with the shareable image
+version of @file{VAXCRTL}, you should edit the file @file{tm.h} (created
+by @file{vmsconfig.com}) to define the macro @code{QSORT_WORKAROUND}.
+
+@code{QSORT_WORKAROUND} is always defined when GNU CC is compiled with
+VAX C, to avoid a problem in case @file{gcclib.olb} is not yet
+available.
+
+@node Collect2
+@section @code{collect2}
+
+GNU CC uses a utility called @code{collect2} on nearly all systems to arrange
+to call various initialization functions at start time.
+
+The program @code{collect2} works by linking the program once and
+looking through the linker output file for symbols with particular names
+indicating they are constructor functions. If it finds any, it
+creates a new temporary @samp{.c} file containing a table of them,
+compiles it, and links the program a second time including that file.
+
+@findex __main
+@cindex constructors, automatic calls
+The actual calls to the constructors are carried out by a subroutine
+called @code{__main}, which is called (automatically) at the beginning
+of the body of @code{main} (provided @code{main} was compiled with GNU
+CC)@. Calling @code{__main} is necessary, even when compiling C code, to
+allow linking C and C++ object code together. (If you use
+@option{-nostdlib}, you get an unresolved reference to @code{__main},
+since it's defined in the standard GCC library. Include @option{-lgcc} at
+the end of your compiler command line to resolve this reference.)
+
+The program @code{collect2} is installed as @code{ld} in the directory
+where the passes of the compiler are installed. When @code{collect2}
+needs to find the @emph{real} @code{ld}, it tries the following file
+names:
+
+@itemize @bullet
+@item
+@file{real-ld} in the directories listed in the compiler's search
+directories.
+
+@item
+@file{real-ld} in the directories listed in the environment variable
+@code{PATH}.
+
+@item
+The file specified in the @code{REAL_LD_FILE_NAME} configuration macro,
+if specified.
+
+@item
+@file{ld} in the compiler's search directories, except that
+@code{collect2} will not execute itself recursively.
+
+@item
+@file{ld} in @code{PATH}.
+@end itemize
+
+``The compiler's search directories'' means all the directories where
+@code{gcc} searches for passes of the compiler. This includes
+directories that you specify with @option{-B}.
+
+Cross-compilers search a little differently:
+
+@itemize @bullet
+@item
+@file{real-ld} in the compiler's search directories.
+
+@item
+@file{@var{target}-real-ld} in @code{PATH}.
+
+@item
+The file specified in the @code{REAL_LD_FILE_NAME} configuration macro,
+if specified.
+
+@item
+@file{ld} in the compiler's search directories.
+
+@item
+@file{@var{target}-ld} in @code{PATH}.
+@end itemize
+
+@code{collect2} explicitly avoids running @code{ld} using the file name
+under which @code{collect2} itself was invoked. In fact, it remembers
+up a list of such names---in case one copy of @code{collect2} finds
+another copy (or version) of @code{collect2} installed as @code{ld} in a
+second place in the search path.
+
+@code{collect2} searches for the utilities @code{nm} and @code{strip}
+using the same algorithm as above for @code{ld}.
+
+@node Header Dirs
+@section Standard Header File Directories
+
+@code{GCC_INCLUDE_DIR} means the same thing for native and cross. It is
+where GNU CC stores its private include files, and also where GNU CC
+stores the fixed include files. A cross compiled GNU CC runs
+@code{fixincludes} on the header files in @file{$(tooldir)/include}.
+(If the cross compilation header files need to be fixed, they must be
+installed before GNU CC is built. If the cross compilation header files
+are already suitable for ISO C and GNU CC, nothing special need be
+done).
+
+@code{GPLUSPLUS_INCLUDE_DIR} means the same thing for native and cross. It
+is where @code{g++} looks first for header files. The C++ library
+installs only target independent header files in that directory.
+
+@code{LOCAL_INCLUDE_DIR} is used only for a native compiler. It is
+normally @file{/usr/local/include}. GNU CC searches this directory so
+that users can install header files in @file{/usr/local/include}.
+
+@code{CROSS_INCLUDE_DIR} is used only for a cross compiler. GNU CC
+doesn't install anything there.
+
+@code{TOOL_INCLUDE_DIR} is used for both native and cross compilers. It
+is the place for other packages to install header files that GNU CC will
+use. For a cross-compiler, this is the equivalent of
+@file{/usr/include}. When you build a cross-compiler,
+@code{fixincludes} processes any header files in this directory.
diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi
new file mode 100644
index 00000000000..43ec56070bf
--- /dev/null
+++ b/gcc/doc/install.texi
@@ -0,0 +1,3583 @@
+\input texinfo.tex @c -*-texinfo-*-
+@c @ifnothtml
+@c %**start of header
+@setfilename install.info
+@settitle Installing GCC
+@setchapternewpage odd
+@c %**end of header
+@c @end ifnothtml
+
+@c Specify title for specific html page
+@ifset indexhtml
+@settitle Installing GCC
+@end ifset
+@ifset specifichtml
+@settitle Host/Target specific installation notes for GCC
+@end ifset
+@ifset downloadhtml
+@settitle Downloading GCC
+@end ifset
+@ifset configurehtml
+@settitle Installing GCC: Configuration
+@end ifset
+@ifset buildhtml
+@settitle Installing GCC: Building
+@end ifset
+@ifset testhtml
+@settitle Installing GCC: Testing
+@end ifset
+@ifset finalinstallhtml
+@settitle Installing GCC: Final installation
+@end ifset
+@ifset binarieshtml
+@settitle Installing GCC: Binaries
+@end ifset
+@ifset gfdlhtml
+@settitle Installing GCC: GNU Free Documentation License
+@end ifset
+
+@c Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
+@c 1999, 2000, 2001 Free Software Foundation, Inc.
+@c *** Converted to texinfo by Dean Wakerley, dean@wakerley.com
+
+@c Include everything if we're not making html
+@ifnothtml
+@set indexhtml
+@set specifichtml
+@set downloadhtml
+@set configurehtml
+@set buildhtml
+@set testhtml
+@set finalinstallhtml
+@set binarieshtml
+@set gfdlhtml
+@end ifnothtml
+
+@c Part 2 Summary Description and Copyright
+@macro copyrightnotice
+Copyright @copyright{} 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
+1999, 2000, 2001 Free Software Foundation, Inc.
+@sp 1
+Permission is granted to copy, distribute and/or modify this document
+under the terms of the GNU Free Documentation License, Version 1.1 or
+any later version published by the Free Software Foundation; with no
+Invariant Sections, the Front-Cover texts being (a) (see below), and
+with the Back-Cover Texts being (b) (see below). A copy of the
+license is included in the section entitled ``@uref{./gfdl.html,,GNU
+Free Documentation License}''.
+
+(a) The FSF's Front-Cover Text is:
+
+ A GNU Manual
+
+(b) The FSF's Back-Cover Text is:
+
+ You have freedom to copy and modify this GNU Manual, like GNU
+ software. Copies published by the Free Software Foundation raise
+ funds for GNU development.
+@end macro
+@ifinfo
+@copyrightnotice{}
+@end ifinfo
+
+@c Part 3 Titlepage and Copyright
+@titlepage
+@sp 10
+@comment The title is printed in a large font.
+@center @titlefont{Installing GCC}
+
+@c The following two commands start the copyright page.
+@page
+@vskip 0pt plus 1filll
+@copyrightnotice{}
+@end titlepage
+
+@c Part 4 Top node and Master Menu
+@ifinfo
+@node Top, , , (dir)
+@comment node-name, next, Previous, up
+
+@menu
+* Installing GCC:: This document describes the generic installation
+ procedure for GCC as well as detailing some target
+ specific installation instructions.
+
+* Specific:: Host/target specific installation notes for GCC.
+* Binaries:: Where to get pre-compiled binaries.
+
+* GNU Free Documentation License:: How you can copy and share this manual.
+* Concept Index:: This index has two entries.
+@end menu
+@end ifinfo
+
+@c Part 5 The Body of the Document
+@c ***Installing GCC**********************************************************
+@ifnothtml
+@comment node-name, next, previous, up
+@node Installing GCC, Binaries, , Top
+@end ifnothtml
+@ifset indexhtml
+@html
+<h1 align="center">Installing GCC</h1>
+@end html
+@ifnothtml
+@chapter Installing GCC
+@end ifnothtml
+
+The latest version of this document is always available at
+@uref{http://gcc.gnu.org/install/,,http://gcc.gnu.org/install/}.
+
+This document describes the generic installation procedure for GCC as well
+as detailing some target specific installation instructions.
+
+GCC includes several components that previously were separate distributions
+with their own installation instructions. This document supersedes all
+package specific installation instructions.
+
+@emph{Before} starting the build/install procedure please check the
+@ifnothtml
+@ref{Specific, host/target specific installation notes}.
+@end ifnothtml
+@ifnotinfo
+@uref{specific.html,,host/target specific installation notes}.
+@end ifnotinfo
+We recommend you browse the entire generic installation instructions before
+you proceed.
+
+A
+@uref{http://gcc.gnu.org/gcc-3.0/buildstat.html,,list of successful builds}
+for GCC 3.0 releases is available at our web pages. This list is updated
+as new information becomes available.
+
+The installation procedure itself is broken into five steps.
+
+@ifinfo
+@menu
+* Downloading the source::
+* Configuration::
+* Building::
+* Testing:: (optional)
+* Final install::
+@end menu
+@end ifinfo
+@ifnotinfo
+@enumerate
+@item
+@uref{download.html,,Downloading the source}
+@item
+@uref{configure.html,,Configuration}
+@item
+@uref{build.html,,Building}
+@item
+@uref{test.html,,Testing} (optional)
+@item
+@uref{finalinstall.html,,Final install}
+@end enumerate
+@end ifnotinfo
+
+Please note that GCC does not support @samp{make uninstall} and probably
+won't do so in the near future as this would open a can of worms. Instead,
+we suggest that you install GCC into a directory of its own and simply
+remove that directory when you do not need that specific version of GCC
+any longer, and, if shared libraries are installed there as well, no
+more binaries exist that use them.
+
+@html
+<hr>
+<p>
+@end html
+@ifhtml
+@uref{./index.html,,Return to the GCC Installation page}
+
+@copyrightnotice{}
+@end ifhtml
+@end ifset
+
+@c ***Downloading the source**************************************************
+@ifnothtml
+@comment node-name, next, previous, up
+@node Downloading the source, Configuration, , Installing GCC
+@end ifnothtml
+@ifset downloadhtml
+@html
+<h1 align="center">Downloading GCC</h1>
+@end html
+@ifnothtml
+@chapter Downloading GCC
+@end ifnothtml
+@cindex Downloading GCC
+@cindex Downloading the Source
+
+GCC is distributed via @uref{http://gcc.gnu.org/cvs.html,,CVS} and FTP
+tarballs compressed with @command{gzip} or
+@command{bzip2}. It is possible to download a full distribution or specific
+components.
+
+Please refer to our @uref{http://gcc.gnu.org/releases.html,,releases web page}
+for information on how to obtain GCC@.
+
+The full distribution includes the C, C++, Objective-C, Fortran, Java,
+and CHILL compilers. The full distribution also includes runtime libraries
+for C++, Objective-C, Fortran, Java and CHILL. (GCC 3.0 does not
+include CHILL.) In GCC 3.0 and later versions, GNU compiler testsuites
+are also included in the full distribution.
+
+If you choose to download specific components, you must download the core
+GCC distribution plus any language specific distributions you wish to
+use. The core distribution includes the C language front end as well as the
+shared components. Each language has a tarball which includes the language
+front end as well as the language runtime (when appropriate).
+
+Unpack the core distribution as well as any language specific
+distributions in the same directory.
+
+If you also intend to build binutils (either to upgrade an existing
+installation or for use in place of the corresponding tools of your
+OS), unpack the binutils distribution either in the same directory or
+a separate one. In the latter case, add symbolic links to any
+components of the binutils you intend to build alongside the compiler
+(@file{bfd}, @file{binutils}, @file{gas}, @file{gprof}, @file{ld},
+@file{opcodes}, @dots{}) to the directory containing the GCC sources.
+
+@html
+<hr>
+<p>
+@end html
+@ifhtml
+@uref{./index.html,,Return to the GCC Installation page}
+@end ifhtml
+@end ifset
+
+@c ***Configuration***********************************************************
+@ifnothtml
+@comment node-name, next, previous, up
+@node Configuration, Building, Downloading the source, Installing GCC
+@end ifnothtml
+@ifset configurehtml
+@html
+<h1 align="center">Installing GCC: Configuration</h1>
+@end html
+@ifnothtml
+@chapter Installing GCC: Configuration
+@end ifnothtml
+@cindex Configuration
+@cindex Installing GCC: Configuration
+
+Like most GNU software, GCC must be configured before it can be built.
+This document describes the recommended configuration procedure
+for both native and cross targets.
+
+We use @var{srcdir} to refer to the toplevel source directory for
+GCC; we use @var{objdir} to refer to the toplevel build/object directory.
+
+If you obtained the sources via CVS, @var{srcdir} must refer to the top
+@file{gcc} directory, the one where the @file{MAINTAINERS} can be found,
+and not its @file{gcc} subdirectory, otherwise the build will fail.
+
+First, we @strong{highly} recommend that GCC be built into a
+separate directory than the sources which does @strong{not} reside
+within the source tree. This is how we generally build GCC; building
+where @var{srcdir} == @var{objdir} should still work, but doesn't
+get extensive testing; building where @var{objdir} is a subdirectory
+of @var{srcdir} is unsupported.
+
+If you have previously built GCC in the same directory for a
+different target machine, do @samp{make distclean} to delete all files
+that might be invalid. One of the files this deletes is
+@file{Makefile}; if @samp{make distclean} complains that @file{Makefile}
+does not exist, it probably means that the directory is already suitably
+clean. However, with the recommended method of building in a separate
+@var{objdir}, you should simply use a different @var{objdir} for each
+target.
+
+Second, when configuring a native system, either @command{cc} or
+@command{gcc} must be in your path or you must set @env{CC} in
+your environment before running configure. Otherwise the configuration
+scripts may fail.
+
+Note that the bootstrap compiler and the resulting GCC must be link
+compatible, else the bootstrap will fail with linker errors about
+incompatible object file formats. Several multilibed targets are
+affected by this requirement, see
+@ifnothtml
+@ref{Specific, host/target specific installation notes}.
+@end ifnothtml
+@ifnotinfo
+@uref{specific.html,,host/target specific installation notes}.
+@end ifnotinfo
+
+To configure GCC:
+
+@example
+ % mkdir @var{objdir}
+ % cd @var{objdir}
+ % @var{srcdir}/configure [@var{options}] [@var{target}]
+@end example
+
+
+@heading Target specification
+@itemize @bullet
+@item
+GCC has code to correctly determine the correct value for @var{target}
+for nearly all native systems. Therefore, we highly recommend you not
+provide a configure target when configuring a native compiler.
+
+@item
+@var{target} must be specified as @option{--target=@var{target}}
+when configuring a cross compiler; examples of valid targets would be
+i960-rtems, m68k-coff, sh-elf, etc.
+
+@item
+Specifying just @var{target} instead of @option{--target=@var{target}}
+implies that the host defaults to @var{target}.
+@end itemize
+
+
+@heading Options specification
+
+Use @var{options} to override several configure time options for
+GCC@. A list of supported @var{options} follows; @command{configure
+--help} may list other options, but those not listed below may not
+work and should not normally be used.
+
+@table @code
+@item --prefix=@var{dirname}
+Specify the toplevel installation
+directory. This is the recommended way to install the tools into a directory
+other than the default. The toplevel installation directory defaults to
+@file{/usr/local}.
+
+We @strong{highly} recommend against @var{dirname} being the same or a
+subdirectory of @var{objdir} or vice versa.
+
+These additional options control where certain parts of the distribution
+are installed. Normally you should not need to use these options.
+@table @code
+
+@item --exec-prefix=@var{dirname}
+Specify the toplevel installation directory for architecture-dependent
+files. The default is @file{@var{prefix}}.
+
+@item --bindir=@var{dirname}
+Specify the installation directory for the executables called by users
+(such as @command{gcc} and @command{g++}). The default is
+@file{@var{exec-prefix}/bin}.
+
+@item --libdir=@var{dirname}
+Specify the installation directory for object code libraries and
+internal parts of GCC@. The default is @file{@var{exec-prefix}/lib}.
+
+@item --with-slibdir=@var{dirname}
+Specify the installation directory for the shared libgcc library. The
+default is @file{@var{libdir}}.
+
+@item --infodir=@var{dirname}
+Specify the installation directory for documentation in info format.
+The default is @file{@var{prefix}/info}.
+
+@item --mandir=@var{dirname}
+Specify the installation directory for manual pages. The default is
+@file{@var{prefix}/man}. (Note that the manual pages are only extracts from
+the full GCC manuals, which are provided in Texinfo format. The
+@command{g77} manpage is unmaintained and may be out of date; the others
+are derived by an automatic conversion process from parts of the full
+manual.)
+
+@item --with-gxx-include-dir=@var{dirname}
+Specify
+the installation directory for G++ header files. The default is
+@file{@var{prefix}/include/g++-v3}.
+
+@end table
+
+@item --with-local-prefix=@var{dirname}
+Specify the
+installation directory for local include files. The default is
+@file{/usr/local}. Specify this option if you want the compiler to
+search directory @file{@var{dirname}/include} for locally installed
+header files @emph{instead} of @file{/usr/local/include}.
+
+You should specify @option{--with-local-prefix} @strong{only} if your
+site has a different convention (not @file{/usr/local}) for where to put
+site-specific files.
+
+The default value for @option{--with-local-prefix} is @file{/usr/local}
+regardless of the value of @option{--prefix}. Specifying
+@option{--prefix} has no effect on which directory GCC searches for
+local header files. This may seem counterintuitive, but actually it is
+logical.
+
+The purpose of @option{--prefix} is to specify where to @emph{install
+GCC}. The local header files in @file{/usr/local/include}---if you put
+any in that directory---are not part of GCC@. They are part of other
+programs---perhaps many others. (GCC installs its own header files in
+another directory which is based on the @option{--prefix} value.)
+
+@strong{Do not} specify @file{/usr} as the @option{--with-local-prefix}!
+The directory you use for @option{--with-local-prefix} @strong{must not}
+contain any of the system's standard header files. If it did contain
+them, certain programs would be miscompiled (including GNU Emacs, on
+certain targets), because this would override and nullify the header
+file corrections made by the @code{fixincludes} script.
+
+Indications are that people who use this option use it based on mistaken
+ideas of what it is for. People use it as if it specified where to
+install part of GCC@. Perhaps they make this assumption because
+installing GCC creates the directory.
+
+@item --enable-shared[=@var{package}[,@dots{}]]
+Build shared versions of libraries, if shared libraries are supported on
+the target platform. Unlike GCC 2.95.x and earlier, shared libraries
+are enabled by default on all platforms that support shared libraries,
+except for @samp{libobjc} which is built as a static library only by
+default.
+
+If a list of packages is given as an argument, build shared libraries
+only for the listed packages. For other packages, only static libraries
+will be built. Package names currently recognized in the GCC tree are
+@samp{libgcc} (also known as @samp{gcc}), @samp{libstdc++} (not
+@samp{libstdc++-v3}), @samp{libffi}, @samp{zlib}, @samp{boehm-gc} and
+@samp{libjava}. Note that @samp{libobjc} does not recognize itself by
+any name, so, if you list package names in @option{--enable-shared},
+you will only get static Objective-C libraries. @samp{libf2c} and
+@samp{libiberty} do not support shared libraries at all.
+
+Use @option{--disable-shared} to build only static libraries. Note that
+@option{--disable-shared} does not accept a list of package names as
+argument, only @option{--enable-shared} does.
+
+@item @anchor{with-gnu-as}--with-gnu-as
+Specify that the compiler should assume that the
+assembler it finds is the GNU assembler. However, this does not modify
+the rules to find an assembler and will result in confusion if found
+assembler is not actually the GNU assembler. (Confusion will also
+result if the compiler finds the GNU assembler but has not been
+configured with @option{--with-gnu-as}.) If you have more than one
+assembler installed on your system, you may want to use this option in
+connection with @option{--with-as=@var{pathname}}.
+
+The systems where it makes a difference whether you use the GNU assembler are
+@samp{hppa1.0-@var{any}-@var{any}}, @samp{hppa1.1-@var{any}-@var{any}},
+@samp{i386-@var{any}-sysv}, @samp{i386-@var{any}-isc},
+@samp{i860-@var{any}-bsd}, @samp{m68k-bull-sysv},
+@samp{m68k-hp-hpux}, @samp{m68k-sony-bsd},
+@samp{m68k-altos-sysv}, @samp{m68000-hp-hpux},
+@samp{m68000-att-sysv}, @samp{@var{any}-lynx-lynxos},
+and @samp{mips-@var{any}}.
+On any other system, @option{--with-gnu-as} has no effect.
+
+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,
+you should also use the GNU linker (and specify @option{--with-gnu-ld}).
+
+@item --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
+are:
+@itemize @bullet
+@item
+Check the
+@file{@var{exec_prefix}/lib/gcc-lib/@var{target}/@var{version}}
+directory, where @var{exec_prefix} defaults to @var{prefix} which
+defaults to @file{/usr/local} unless overridden by the
+@option{--prefix=@var{pathname}} switch described above. @var{target} is the
+target system triple, such as @samp{sparc-sun-solaris2.7}, and
+@var{version} denotes the GCC version, such as 3.0.
+@item
+Check operating system specific directories (e.g.@: @file{/usr/ccs/bin} on
+Sun Solaris 2).
+@end itemize
+Note that these rules do not check for the value of @env{PATH}. You may
+want to use @option{--with-as} if no assembler is installed in the
+directories listed above, or if you have multiple assemblers installed
+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.
+
+
+@item --with-ld=@var{pathname}
+Same as
+@option{--with-as}, but for the linker.
+
+@item --with-stabs
+Specify that stabs debugging
+information should be used instead of whatever format the host normally
+uses. Normally GCC uses the same debug format as the host system.
+
+On MIPS based systems and on Alphas, you must specify whether you want
+GCC to create the normal ECOFF debugging format, or to use BSD-style
+stabs passed through the ECOFF symbol table. The normal ECOFF debug
+format cannot fully handle languages other than C@. BSD stabs format can
+handle other languages, but it only works with the GNU debugger GDB@.
+
+Normally, GCC uses the ECOFF debugging format by default; if you
+prefer BSD stabs, specify @option{--with-stabs} when you configure GCC@.
+
+No matter which default you choose when you configure GCC, the user
+can use the @option{-gcoff} and @option{-gstabs+} options to specify explicitly
+the debug format for a particular compilation.
+
+@option{--with-stabs} is meaningful on the ISC system on the 386, also, if
+@option{--with-gas} is used. It selects use of stabs debugging
+information embedded in COFF output. This kind of debugging information
+supports C++ well; ordinary COFF debugging information does not.
+
+@option{--with-stabs} is also meaningful on 386 systems running SVR4. It
+selects use of stabs debugging information embedded in ELF output. The
+C++ compiler currently (2.6.0) does not support the DWARF debugging
+information normally used on 386 SVR4 platforms; stabs provide a
+workable alternative. This requires gas and gdb, as the normal SVR4
+tools can not generate or interpret stabs.
+
+@item --disable-multilib
+Specify that multiple target
+libraries to support different target variants, calling
+conventions, etc should not be built. The default is to build a
+predefined set of them.
+
+Some targets provide finer-grained control over which multilibs are built
+(e.g., @option{--disable-softfloat}):
+@table @code
+
+@item arc-*-elf*
+biendian.
+
+@item arm-*-*
+fpu, 26bit, underscore, interwork, biendian, nofmult.
+
+@item m68*-*-*
+softfloat, m68881, m68000, m68020.
+
+@item mips*-*-*
+single-float, biendian, softfloat.
+
+@item powerpc*-*-*, rs6000*-*-*
+aix64, pthread, softfloat, powercpu, powerpccpu, powerpcos, biendian,
+sysv, aix.
+
+@end table
+
+@item --enable-threads
+Specify that the target
+supports threads. This affects the Objective-C compiler and runtime
+library, and exception handling for other languages like C++ and Java.
+On some systems, this is the default.
+
+In general, the best (and, in many cases, the only known) threading
+model available will be configured for use. Beware that on some
+systems, gcc has not been taught what threading models are generally
+available for the system. In this case, @option{--enable-threads} is an
+alias for @option{--enable-threads=single}.
+
+@item --disable-threads
+Specify that threading support should be disabled for the system.
+This is an alias for @option{--enable-threads=single}.
+
+@item --enable-threads=@var{lib}
+Specify that
+@var{lib} is the thread support library. This affects the Objective-C
+compiler and runtime library, and exception handling for other languages
+like C++ and Java. The possibilities for @var{lib} are:
+
+@table @code
+@item aix
+AIX thread support.
+@item dce
+DCE thread support.
+@item mach
+Generic MACH thread support, known to work on NeXTSTEP@. (Please note
+that the file needed to support this configuration, @file{gthr-mach.h}, is
+missing and thus this setting will cause a known bootstrap failure.)
+@item no
+This is an alias for @samp{single}.
+@item posix
+Generic POSIX thread support.
+@item pthreads
+Same as @samp{posix} on arm*-*-linux*, *-*-chorusos* and *-*-freebsd*
+only. A future release of gcc might remove this alias or extend it
+to all platforms.
+@item rtems
+RTEMS thread support.
+@item single
+Disable thread support, should work for all platforms.
+@item solaris
+Sun Solaris 2 thread support.
+@item vxworks
+VxWorks thread support.
+@item win32
+Microsoft Win32 API thread support.
+@end table
+
+@item --with-cpu=@var{cpu}
+Specify which cpu variant the
+compiler should generate code for by default. This is currently
+only supported on the some ports, specifically arm, powerpc, and
+SPARC@. If configure does not recognize the model name (e.g.@: arm700,
+603e, or ultrasparc) you provide, please check the configure script
+for a complete list of supported models.
+
+@item --enable-target-optspace
+Specify that target
+libraries should be optimized for code space instead of code speed.
+This is the default for the m32r platform.
+
+@item --disable-cpp
+Specify that a user visible @command{cpp} program should not be installed.
+
+@item --with-cpp-install-dir=@var{dirname}
+Specify that the user visible @command{cpp} program should be installed
+in @file{@var{prefix}/@var{dirname}/cpp}, in addition to @var{bindir}.
+
+@item --enable-maintainer-mode
+The build rules that
+regenerate the GCC master message catalog @file{gcc.pot} are normally
+disabled. This is because it can only be rebuilt if the complete source
+tree is present. If you have changed the sources and want to rebuild the
+catalog, configuring with @option{--enable-maintainer-mode} will enable
+this. Note that you need a recent version of the @code{gettext} tools
+to do so.
+
+@item --enable-version-specific-runtime-libs
+Specify
+that runtime libraries should be installed in the compiler specific
+subdirectory (@file{@var{libsubdir}}) rather than the usual places. In
+addition, @samp{libstdc++}'s include files will be installed in
+@file{@var{libsubdir}/include/g++} unless you overruled it by using
+@option{--with-gxx-include-dir=@var{dirname}}. Using this option is
+particularly useful if you intend to use several versions of GCC in
+parallel. This is currently supported by @samp{libf2c} and
+@samp{libstdc++}, and is the default for @samp{libobjc} which cannot be
+changed in this case.
+
+@item --enable-languages=@var{lang1},@var{lang2},@dots{}
+Specify that only a particular subset of compilers and
+their runtime libraries should be built. For a list of valid values for
+@var{langN} you can issue the following command in the
+@file{gcc} directory of your GCC source tree:@*
+@example
+grep language= */config-lang.in
+@end example
+Currently, you can use any of the following:
+@code{c}, @code{c++}, @code{f77}, @code{java} and @code{objc}.
+@code{CHILL} is not currently maintained, and will almost
+certainly fail to compile.@*
+If you do not pass this flag, all languages available in the @file{gcc}
+sub-tree will be configured. Re-defining @code{LANGUAGES} when calling
+@samp{make bootstrap} @strong{does not} work anymore, as those
+language sub-directories might not have been configured!
+
+@item --disable-libgcj
+Specify that the run-time libraries
+used by GCJ should not be built. This is useful in case you intend
+to use GCJ with some other run-time, or you're going to install it
+separately, or it just happens not to build on your particular
+machine. In general, if the Java front end is enabled, the GCJ
+libraries will be enabled too, unless they're known to not work on
+the target platform. If GCJ is enabled but @samp{libgcj} isn't built, you
+may need to port it; in this case, before modifying the top-level
+@file{configure.in} so that @samp{libgcj} is enabled by default on this platform,
+you may use @option{--enable-libgcj} to override the default.
+
+@item --with-dwarf2
+Specify that the compiler should
+use DWARF 2 debugging information as the default.
+
+@item --enable-win32-registry
+@itemx --enable-win32-registry=@var{key}
+@itemx --disable-win32-registry
+The @option{--enable-win32-registry} option enables Windows-hosted GCC
+to look up installations paths in the registry using the following key:
+
+@smallexample
+@code{HKEY_LOCAL_MACHINE\SOFTWARE\Free Software Foundation\@var{key}}
+@end smallexample
+
+@var{key} defaults to GCC version number, and can be overridden by the
+@option{--enable-win32-registry=@var{key}} option. Vendors and distributors
+who use custom installers are encouraged to provide a different key,
+perhaps one comprised of vendor name and GCC version number, to
+avoid conflict with existing installations. This feature is enabled
+by default, and can be disabled by @option{--disable-win32-registry}
+option. This option has no effect on the other hosts.
+
+@item --nfp
+Specify that the machine does not have a floating point unit. This
+option only applies to @samp{m68k-sun-sunos@var{n}} and
+@samp{m68k-isi-bsd}. On any other system, @option{--nfp} has no effect.
+
+@item --enable-checking
+@itemx --enable-checking=@var{list}
+When you specify this option, the compiler is built to perform checking
+of tree node types when referencing fields of that node, and some other
+internal consistency checks. This does not change the generated code,
+but adds error checking within the compiler. This will slow down the
+compiler and may only work properly if you are building the compiler
+with GCC@. This is on by default when building from CVS or snapshots,
+but off for releases. More control over the checks may be had by
+specifying @var{list}; the categories of checks available are
+@samp{misc}, @samp{tree}, @samp{gc}, @samp{rtl} and @samp{gcac}. The
+default when @var{list} is not specified is @samp{misc,tree,gc}; the
+checks @samp{rtl} and @samp{gcac} are very expensive.
+
+@item --enable-nls
+@itemx --disable-nls
+The @option{--enable-nls} option enables Native Language Support (NLS),
+which lets GCC output diagnostics in languages other than American
+English. Native Language Support is enabled by default if not doing a
+canadian cross build. The @option{--disable-nls} option disables NLS@.
+
+@item --with-included-gettext
+If NLS is enabled, the @option{--with-included-gettext} option causes the build
+procedure to prefer its copy of GNU @command{gettext}.
+
+@item --with-catgets
+If NLS is enabled, and if the host lacks @code{gettext} but has the
+inferior @code{catgets} interface, the GCC build procedure normally
+ignores @code{catgets} and instead uses GCC's copy of the GNU
+@code{gettext} library. The @option{--with-catgets} option causes the
+build procedure to use the host's @code{catgets} in this situation.
+
+@item --with-system-zlib
+Use installed zlib rather than that included with GCC@. This option
+only applies if the Java front end is being built.
+@end table
+
+Some options which only apply to building cross compilers:
+@table @code
+@item --with-headers=@var{dir}
+Specifies a directory
+which has target include files.
+@emph{This options is required} when building a cross
+compiler, if @file{@var{prefix}/@var{target}/sys-include} doesn't pre-exist.
+These include files will be copied into the @file{gcc} install directory.
+Fixincludes will be run on these files to make them compatible with
+GCC.
+@item --with-libs=``@var{dir1} @var{dir2} @dots{} @var{dirN}''
+Specifies a list of directories which contain the target runtime
+libraries. These libraries will be copied into the @file{gcc} install
+directory.
+@item --with-newlib
+Specifies that @samp{newlib} is
+being used as the target C library. This causes @code{__eprintf} to be
+omitted from @file{libgcc.a} on the assumption that it will be provided by
+@samp{newlib}.
+@end table
+
+Note that each @option{--enable} option has a corresponding
+@option{--disable} option and that each @option{--with} option has a
+corresponding @option{--without} option.
+
+@html
+<hr>
+<p>
+@end html
+@ifhtml
+@uref{./index.html,,Return to the GCC Installation page}
+@end ifhtml
+@end ifset
+
+@c ***Building****************************************************************
+@ifnothtml
+@comment node-name, next, previous, up
+@node Building, Testing, Configuration, Installing GCC
+@end ifnothtml
+@ifset buildhtml
+@html
+<h1 align="center">Installing GCC: Building</h1>
+@end html
+@ifnothtml
+@chapter Building
+@end ifnothtml
+@cindex Installing GCC: Building
+
+Now that GCC is configured, you are ready to build the compiler and
+runtime libraries.
+
+We @strong{highly} recommend that GCC be built using GNU make;
+other versions may work, then again they might not.
+
+(For example, many broken versions of make will fail if you use the
+recommended setup where @var{objdir} is different from @var{srcdir}.
+Other broken versions may recompile parts of the compiler when
+installing the compiler.)
+
+Some commands executed when making the compiler may fail (return a
+nonzero status) and be ignored by @code{make}. These failures, which
+are often due to files that were not found, are expected, and can safely
+be ignored.
+
+It is normal to have compiler warnings when compiling certain files.
+Unless you are a GCC developer, you can generally ignore these warnings
+unless they cause compilation to fail.
+
+On certain old systems, defining certain environment variables such as
+@env{CC} can interfere with the functioning of @command{make}.
+
+If you encounter seemingly strange errors when trying to build the
+compiler in a directory other than the source directory, it could be
+because you have previously configured the compiler in the source
+directory. Make sure you have done all the necessary preparations.
+
+If you build GCC on a BSD system using a directory stored in an old System
+V file system, problems may occur in running @code{fixincludes} if the
+System V file system doesn't support symbolic links. These problems
+result in a failure to fix the declaration of @code{size_t} in
+@file{sys/types.h}. If you find that @code{size_t} is a signed type and
+that type mismatches occur, this could be the cause.
+
+The solution is not to use such a directory for building GCC@.
+
+When building from CVS or snapshots, or if you modify parser sources,
+you need the Bison parser generator installed. Any version 1.25 or
+later should work; older versions may also work. If you do not modify
+parser sources, releases contain the Bison-generated files and you do
+not need Bison installed to build them.
+
+When building from CVS or snapshots, or if you modify Texinfo
+documentation, you need version 4.0 or later of Texinfo installed if you
+want Info documentation to be regenerated. Releases contain Info
+documentation pre-built for the unmodified documentation in the release.
+
+@section Building a native compiler
+
+For a native build issue the command @samp{make bootstrap}. This
+will build the entire GCC system, which includes the following steps:
+
+@itemize @bullet
+@item
+Build host tools necessary to build the compiler such as texinfo, bison,
+gperf.
+
+@item
+Build target tools for use by the compiler such as binutils (bfd,
+binutils, gas, gprof, ld, and opcodes)
+if they have been individually linked
+or moved into the top level GCC source tree before configuring.
+
+@item
+Perform a 3-stage bootstrap of the compiler.
+
+@item
+Perform a comparison test of the stage2 and stage3 compilers.
+
+@item
+Build runtime libraries using the stage3 compiler from the previous step.
+
+@end itemize
+
+If you are short on disk space you might consider @samp{make
+bootstrap-lean} instead. This is identical to @samp{make
+bootstrap} except that object files from the stage1 and
+stage2 of the 3-stage bootstrap of the compiler are deleted as
+soon as they are no longer needed.
+
+
+If you want to save additional space during the bootstrap and in
+the final installation as well, you can build the compiler binaries
+without debugging information with @samp{make CFLAGS='-O' LIBCFLAGS='-g
+-O2' LIBCXXFLAGS='-g -O2 -fno-implicit-templates' bootstrap}. This will save
+roughly 40% of disk space both for the bootstrap and the final installation.
+(Libraries will still contain debugging information.)
+
+If you wish to use non-default GCC flags when compiling the stage2 and
+stage3 compilers, set @code{BOOT_CFLAGS} on the command line when doing
+@samp{make bootstrap}. Non-default optimization flags are less well
+tested here than the default of @samp{-g -O2}, but should still work.
+In a few cases, you may find that you need to specify special flags such
+as @option{-msoft-float} here to complete the bootstrap; or, if the
+native compiler miscompiles the stage1 compiler, you may need to work
+around this, by choosing @code{BOOT_CFLAGS} to avoid the parts of the
+stage1 compiler that were miscompiled, or by using @samp{make
+bootstrap4} to increase the number of stages of bootstrap.
+
+If you used the flag @option{--enable-languages=@dots{}} to restrict
+the compilers to be built, only those you've actually enabled will be
+built. This will of course only build those runtime libraries, for
+which the particular compiler has been built. Please note,
+that re-defining @env{LANGUAGES} when calling @samp{make bootstrap}
+@strong{does not} work anymore!
+
+If the comparison of stage2 and stage3 fails, this normally indicates
+that the stage2 compiler has compiled GCC incorrectly, and is therefore
+a potentially serious bug which you should investigate and report. (On
+a few systems, meaningful comparison of object files is impossible; they
+always appear ``different''. If you encounter this problem, you will
+need to disable comparison in the @file{Makefile}.)
+
+@section Building a cross compiler
+
+We recommend reading the
+@uref{http://www.objsw.com/CrossGCC/,,crossgcc FAQ}
+for information about building cross compilers.
+
+When building a cross compiler, it is not generally possible to do a
+3-stage bootstrap of the compiler. This makes for an interesting problem
+as parts of GCC can only be built with GCC@.
+
+To build a cross compiler, we first recommend building and installing a
+native compiler. You can then use the native GCC compiler to build the
+cross compiler. The installed native compiler needs to be GCC version
+2.95 or later.
+
+Assuming you have already installed a native copy of GCC and configured
+your cross compiler, issue the command @command{make}, which performs the
+following steps:
+
+@itemize @bullet
+@item
+Build host tools necessary to build the compiler such as texinfo, bison,
+gperf.
+
+@item
+Build target tools for use by the compiler such as binutils (bfd,
+binutils, gas, gprof, ld, and opcodes)
+if they have been individually linked or moved into the top level GCC source
+tree before configuring.
+
+@item
+Build the compiler (single stage only).
+
+@item
+Build runtime libraries using the compiler from the previous step.
+@end itemize
+
+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.
+
+@html
+<hr>
+<p>
+@end html
+@ifhtml
+@uref{./index.html,,Return to the GCC Installation page}
+@end ifhtml
+@end ifset
+
+@c ***Testing*****************************************************************
+@ifnothtml
+@comment node-name, next, previous, up
+@node Testing, Final install, Building, Installing GCC
+@end ifnothtml
+@ifset testhtml
+@html
+<h1 align="center">Installing GCC: Testing</h1>
+@end html
+@ifnothtml
+@chapter Installing GCC: Testing
+@end ifnothtml
+@cindex Testing
+@cindex Installing GCC: Testing
+@cindex Testsuite
+
+Before you install GCC, you might wish to run the testsuite. This
+step is optional and may require you to download additional software.
+
+First, you must have @uref{download.html,,downloaded the testsuites}.
+The full distribution contains testsuites; only if you downloaded the
+``core'' compiler plus any front ends, you do not have the testsuites.
+
+Second, you must have a @uref{http://www.gnu.org/software/dejagnu/,,current version of DejaGnu} installed;
+dejagnu 1.3 is not sufficient.
+
+Now you may need specific preparations:
+
+@itemize @bullet
+
+@item
+The following environment variables may need to be set appropriately, as in
+the following example (which assumes that DejaGnu has been installed
+under @file{/usr/local}):
+
+@example
+ TCL_LIBRARY = /usr/local/share/tcl8.0
+ DEJAGNULIBS = /usr/local/share/dejagnu
+@end example
+
+On systems such as Cygwin, these paths are required to be actual
+paths, not mounts or links; presumably this is due to some lack of
+portability in the DejaGnu code.
+
+If the directories where @command{runtest} and @command{expect} were
+installed are in the @env{PATH}, it should not be necessary to set these
+environment variables.
+
+@end itemize
+
+Finally, you can run the testsuite (which may take a long time):
+@example
+ cd @var{objdir}; make -k check
+@end example
+
+The testing process will try to test as many components in the GCC
+distribution as possible, including the C, C++, Objective-C and Fortran
+compilers as well as the C++ and Java runtime libraries.
+
+@section How can I run the test suite on selected tests?
+
+As a first possibility to cut down the number of tests that are run it is
+possible to use @samp{make check-gcc} or @samp{make check-g++}
+in the @file{gcc} subdirectory of the object directory. To further cut down the
+tests the following is possible:
+
+@example
+ make check-gcc RUNTESTFLAGS="execute.exp @var{other-options}"
+@end example
+
+This will run all @command{gcc} execute tests in the testsuite.
+
+@example
+ make check-g++ RUNTESTFLAGS="old-deja.exp=9805* @var{other-options}"
+@end example
+
+This will run the @command{g++} ``old-deja'' tests in the testsuite where the filename
+matches @samp{9805*}.
+
+The @file{*.exp} files are located in the testsuite directories of the GCC
+source, the most important ones being @file{compile.exp},
+@file{execute.exp}, @file{dg.exp} and @file{old-deja.exp}.
+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.
+
+@section How to interpret test results
+
+After the testsuite has run you'll find various @file{*.sum} and @file{*.log}
+files in the testsuite subdirectories. The @file{*.log} files contain a
+detailed log of the compiler invocations and the corresponding
+results, the @file{*.sum} files summarize the results. These summaries list
+all the tests that have been run with a corresponding status code:
+
+@itemize @bullet
+@item
+PASS: the test passed as expected
+@item
+XPASS: the test unexpectedly passed
+@item
+FAIL: the test unexpectedly failed
+@item
+XFAIL: the test failed as expected
+@item
+UNSUPPORTED: the test is not supported on this platform
+@item
+ERROR: the testsuite detected an error
+@item
+WARNING: the testsuite detected a possible problem
+@end itemize
+
+It is normal for some tests to report unexpected failures. At the
+current time our testing harness does not allow fine grained control
+over whether or not a test is expected to fail. We expect to fix this
+problem in future releases.
+
+
+@section Submitting test results
+
+If you want to report the results to the GCC project, use the
+@file{contrib/test_summary} shell script. Start it in the @var{objdir} with
+
+@example
+ @var{srcdir}/contrib/test_summary -p your_commentary.txt \
+ -m gcc-testresults@@gcc.gnu.org |sh
+@end example
+
+This script uses the @command{Mail} program to send the results, so
+make sure it is in your @env{PATH}. The file @file{your_commentary.txt} is
+prepended to the testsuite summary and should contain any special
+remarks you have on your results or your build environment. Please
+do not edit the testsuite result block or the subject line, as these
+messages are automatically parsed and presented at the
+@uref{http://gcc.gnu.org/testresults/,,GCC testresults} web
+page. Here you can also gather information on how specific tests
+behave on different platforms and compare them with your results. A
+few failing testcases are possible even on released versions and you
+should look here first if you think your results are unreasonable.
+
+@html
+<hr>
+<p>
+@end html
+@ifhtml
+@uref{./index.html,,Return to the GCC Installation page}
+@end ifhtml
+@end ifset
+
+@c ***Final install***********************************************************
+@ifnothtml
+@comment node-name, next, previous, up
+@node Final install, , Testing, Installing GCC
+@end ifnothtml
+@ifset finalinstallhtml
+@html
+<h1 align="center">Installing GCC: Final installation</h1>
+@end html
+@ifnothtml
+@chapter Installing GCC: Final installation
+@end ifnothtml
+
+Now that GCC has been built (and optionally tested), you can install it with
+@example
+cd @var{objdir}; make install
+@end example
+
+That step completes the installation of GCC; user level binaries can
+be found in @file{@var{prefix}/bin} where @var{prefix} is the value you
+specified with the @option{--prefix} to configure (or @file{/usr/local}
+by default). (If you specified @option{--bindir}, that directory will
+be used instead; otherwise, if you specified @option{--exec-prefix},
+@file{@var{exec-prefix}/bin} will be used.) Headers for the C++ and
+Java libraries are installed in @file{@var{prefix}/include}; libraries
+in @file{@var{libdir}} (normally @file{@var{prefix}/lib}); internal
+parts of the compiler in @file{@var{libdir}/gcc-lib}; documentation in
+info format in @file{@var{infodir}} (normally @file{@var{prefix}/info}).
+
+If you don't mind, please quickly review the
+@uref{http://gcc.gnu.org/gcc-3.0/buildstat.html,,3.0 build status page}.
+If your system is not listed for the version of GCC that you built,
+send a note to
+@email{gcc@@gcc.gnu.org} indicating
+that you successfully built and installed GCC.
+Include the following information:
+
+@itemize @bullet
+@item
+Output from running @file{@var{srcdir}/config.guess}. Do not send us
+that file itself, just the one-line output from running it.
+
+@item
+The output of @samp{gcc -v} for your newly installed gcc.
+This tells us which version of GCC you built and the options you passed to
+configure.
+
+@item
+If the build was for GNU/Linux, also include:
+@itemize @bullet
+@item
+The distribution name and version (e.g., Red Hat 7.1 or Debian 2.2.3);
+this information should be available from @file{/etc/issue}.
+
+@item
+The version of the Linux kernel, available from @samp{uname --version}
+or @samp{uname -a}.
+
+@item
+The version of glibc you used; for RPM-based systems like Red Hat,
+Mandrake, and SuSE type @samp{rpm -q glibc} to get the glibc version,
+and on systems like Debian and Progeny use @samp{dpkg -l libc6}.
+@end itemize
+For other systems, you can include similar information if you think it is
+relevant.
+
+@item
+Any other information that you think would be useful to people building
+GCC on the same configuration. The new entry in the build status list
+will include a link to the archived copy of your message.
+@end itemize
+
+We'd also like to know if the
+@ifnothtml
+@ref{Specific, host/target specific installation notes}
+@end ifnothtml
+@ifhtml
+@uref{specific.html,,host/target specific installation notes}
+@end ifhtml
+didn't include your host/target information or if that information is
+incomplete or out of date. Send a note to
+@email{gcc@@gcc.gnu.org} telling us how the information should be changed.
+
+If you find a bug, please report it following our
+@uref{../bugs.html,,bug reporting guidelines}.
+
+If you want to print the GCC manuals, do @samp{cd @var{objdir}; make
+dvi}. You will need to have @command{texi2dvi} (version at least 4.0)
+and @TeX{} installed. This creates a number of @file{.dvi} files in
+subdirectories of @file{@var{objdir}}; these may be converted for
+printing with programs such as @command{dvips}. You can also
+@uref{http://www.gnu.org/order/order.html,,buy printed manuals from the
+Free Software Foundation}, though such manuals may not be for the most
+recent version of GCC@.
+
+@html
+<hr>
+<p>
+@end html
+@ifhtml
+@uref{./index.html,,Return to the GCC Installation page}
+@end ifhtml
+@end ifset
+
+@c ***Binaries****************************************************************
+@ifnothtml
+@comment node-name, next, previous, up
+@node Binaries, Specific, Installing GCC, Top
+@end ifnothtml
+@ifset binarieshtml
+@html
+<h1 align="center">Installing GCC: Binaries</h1>
+@end html
+@ifnothtml
+@chapter Installing GCC: Binaries
+@end ifnothtml
+@cindex Binaries
+@cindex Installing GCC: Binaries
+
+We are often asked about pre-compiled versions of GCC@. While we cannot
+provide these for all platforms, below you'll find links to binaries for
+various platforms where creating them by yourself is not easy due to various
+reasons.
+
+Please note that we did not create these binaries, nor do we
+support them. If you have any problems installing them, please
+contact their makers.
+
+@itemize
+@item
+AIX:
+@itemize
+@item
+@uref{http://freeware.bull.net,,Bull's Freeware and Shareware Archive for AIX};
+
+@item
+@uref{http://aixpdslib.seas.ucla.edu,,UCLA Software Library for AIX};
+@end itemize
+
+@item
+DOS---@uref{http://www.delorie.com/djgpp/,,DJGPP};
+
+@item
+HP-UX:
+@itemize
+@item
+@uref{http://hpux.cae.wisc.edu/,,HP-UX Porting Center};
+
+@item
+@uref{ftp://sunsite.informatik.rwth-aachen.de/pub/packages/gcc_hpux/,,Binaries for HP-UX 11.00 at Aachen University of Technology}.
+@end itemize
+
+@item
+@uref{http://www.sco.com/skunkware/devtools/index.html#gcc,,SCO
+OpenServer/Unixware};
+
+@item
+Solaris 2 (SPARC, Intel)---@uref{http://www.sunfreeware.com/,,Sunfreeware};
+
+@item
+SGI---@uref{http://freeware.sgi.com/,,SGI Freeware};
+
+@item
+Windows 95, 98, and NT:
+@itemize
+@item
+The @uref{http://sources.redhat.com/cygwin/,,Cygwin} project;
+@item
+@uref{http://www.xraylith.wisc.edu/~khan/software/gnu-win32/,,GNU Win32}
+related projects by Mumit Khan.
+@end itemize
+
+@item
+@uref{ftp://ftp.thewrittenword.com/packages/free/by-name/,,The
+Written Word} offers binaries for Solaris 2.5.1, 2.6, 2.7/SPARC, 2.7/Intel,
+IRIX 6.2, 6.5, Digital UNIX 4.0D, HP-UX 10.20, and HP-UX 11.00.
+
+@item
+Hitachi H8/300[HS]---@uref{http://h8300-hms.sourceforge.net/,,GNU
+Development Tools for the Hitachi H8/300[HS] Series}
+
+@end itemize
+
+In addition to those specific offerings, you can get a binary
+distribution CD-ROM from the
+@uref{http://www.fsf.org/order/order.html,,Free Software Foundation}.
+It contains binaries for a number of platforms, and
+includes not only GCC, but other stuff as well. The current CD does
+not contain the latest version of GCC, but it should allow
+bootstrapping the compiler. An updated version of that disk is in the
+works.
+
+@html
+<hr>
+<p>
+@end html
+@ifhtml
+@uref{./index.html,,Return to the GCC Installation page}
+@end ifhtml
+@end ifset
+
+@c ***Specific****************************************************************
+@ifnothtml
+@comment node-name, next, previous, up
+@node Specific, GNU Free Documentation License, Binaries, Top
+@end ifnothtml
+@ifset specifichtml
+@html
+<h1 align="center">Host/target specific installation notes for GCC</h1>
+@end html
+@ifnothtml
+@chapter Host/target specific installation notes for GCC
+@end ifnothtml
+@cindex Specific
+@cindex Specific installation notes
+@cindex Target specific installation
+@cindex Host specific installation
+@cindex Target specific installation notes
+
+Please read this document carefully @emph{before} installing the
+GNU Compiler Collection on your machine.
+
+A
+@uref{http://gcc.gnu.org/gcc-3.0/buildstat.html,,list of successful builds}
+for GCC 3.0 releases is available at our web pages. This list is updated
+as new information becomes available.
+
+@ifhtml
+@itemize
+@item
+@uref{#1750a-*-*,,1750a-*-*}
+@item
+@uref{#a29k,,a29k}
+@item
+@uref{#a29k-*-bsd,,a29k-*-bsd}
+@item
+@uref{#alpha*-*-*,,alpha*-*-*}
+@item
+@uref{#alpha*-dec-osf*,,alpha*-dec-osf*}
+@item
+@uref{#arc-*-elf,,arc-*-elf}
+@item
+@uref{#arm-*-aout,,arm-*-aout}
+@item
+@uref{#arm-*-elf,,arm-*-elf}
+@item
+@uref{#arm*-*-linux-gnu,,arm*-*-linux-gnu}
+@item
+@uref{#arm-*-riscix,,arm-*-riscix}
+@item
+@uref{#avr,,avr}
+@item
+@uref{#c4x,,c4x}
+@item
+@uref{#dos,,DOS}
+@item
+@uref{#dsp16xx,,dsp16xx}
+@item
+@uref{#elxsi-elxsi-bsd,,elxsi-elxsi-bsd}
+@item
+@uref{#*-*-freebsd*,,*-*-freebsd*}
+@item
+@uref{#h8300-hms,,h8300-hms}
+@item
+@uref{#hppa*-hp-hpux*,,hppa*-hp-hpux*}
+@item
+@uref{#hppa*-hp-hpux9,,hppa*-hp-hpux9}
+@item
+@uref{#hppa*-hp-hpux10,,hppa*-hp-hpux10}
+@item
+@uref{#hppa*-hp-hpux11,,hppa*-hp-hpux11}
+@item
+@uref{#i370-*-*,,i370-*-*}
+@item
+@uref{#*-*-linux-gnu,,*-*-linux-gnu}
+@item
+@uref{#ix86-*-linux*oldld,,i?86-*-linux*oldld}
+@item
+@uref{#ix86-*-linux*aout,,i?86-*-linux*aout}
+@item
+@uref{#ix86-*-linux*,,i?86-*-linux*}
+@item
+@uref{#ix86-*-sco,,i?86-*-sco}
+@item
+@uref{#ix86-*-sco3.2v4,,i?86-*-sco3.2v4}
+@item
+@uref{#ix86-*-sco3.2v5*,,i?86-*-sco3.2v5*}
+@item
+@uref{#ix86-*-udk,,i?86-*-udk}
+@item
+@uref{#ix86-*-isc,,i?86-*-isc}
+@item
+@uref{#ix86-*-esix,,i?86-*-esix}
+@item
+@uref{#ix86-ibm-aix,,i?86-ibm-aix}
+@item
+@uref{#ix86-sequent-bsd,,i?86-sequent-bsd}
+@item
+@uref{#ix86-sequent-ptx1*,,i?86-sequent-ptx1*, i?86-sequent-ptx2*}
+@item
+@uref{#ix86-*-sysv3*,,i?86-*-sysv3*}
+@item
+@uref{#i860-intel-osf*,,i860-intel-osf*}
+@item
+@uref{#ia64-*-linux,,ia64-*-linux}
+@item
+@uref{#*-lynx-lynxos,,*-lynx-lynxos}
+@item
+@uref{#*-ibm-aix*,,*-ibm-aix*}
+@item
+@uref{#m32r-*-elf,,m32r-*-elf}
+@item
+@uref{#m68000-hp-bsd,,m68000-hp-bsd}
+@item
+@uref{#m6811-elf,,m6811-elf}
+@item
+@uref{#m6812-elf,,m6812-elf}
+@item
+@uref{#m68k-altos,,m68k-altos}
+@item
+@uref{#m68k-apple-aux,,m68k-apple-aux}
+@item
+@uref{#m68k-att-sysv,,m68k-att-sysv}
+@item
+@uref{#m68k-bull-sysv,,m68k-bull-sysv}
+@item
+@uref{#m68k-crds-unox,,m68k-crds-unox}
+@item
+@uref{#m68k-hp-hpux,,m68k-hp-hpux}
+@item
+@uref{#m68k-*-nextstep*,,m68k-*-nextstep*}
+@item
+@uref{#m68k-ncr-*,,m68k-ncr-*}
+@item
+@uref{#m68k-sun,,m68k-sun}
+@item
+@uref{#m68k-sun-sunos4.1.1,,m68k-sun-sunos4.1.1}
+@item
+@uref{#m88k-*-svr3,,m88k-*-svr3}
+@item
+@uref{#m88k-*-dgux,,m88k-*-dgux}
+@item
+@uref{#m88k-tektronix-sysv3,,m88k-tektronix-sysv3}
+@item
+@uref{#mips-*-*,,mips-*-*}
+@item
+@uref{#mips-dec-*,,mips-dec-*}
+@item
+@uref{#mips-mips-bsd,,mips-mips-bsd}
+@item
+@uref{#mips-mips-riscos*,,mips-mips-riscos*}
+@item
+@uref{#mips-sgi-irix4,,mips-sgi-irix4}
+@item
+@uref{#mips-sgi-irix5,,mips-sgi-irix5}
+@item
+@uref{#mips-sgi-irix6,,mips-sgi-irix6}
+@item
+@uref{#mips-sony-sysv,,mips-sony-sysv}
+@item
+@uref{#ns32k-encore,,ns32k-encore}
+@item
+@uref{#ns32k-*-genix,,ns32k-*-genix}
+@item
+@uref{#ns32k-sequent,,ns32k-sequent}
+@item
+@uref{#ns32k-utek,,ns32k-utek}
+@item
+@uref{#powerpc*-*-*,,powerpc*-*-*, powerpc-*-sysv4}
+@item
+@uref{#powerpc-*-elf,,powerpc-*-elf, powerpc-*-sysv4}
+@item
+@uref{#powerpc-*-linux-gnu*,,powerpc-*-linux-gnu*}
+@item
+@uref{#powerpc-*-netbsd*,,powerpc-*-netbsd*}
+@item
+@uref{#powerpc-*-eabiaix,,powerpc-*-eabiaix}
+@item
+@uref{#powerpc-*-eabisim,,powerpc-*-eabisim}
+@item
+@uref{#powerpc-*-eabi,,powerpc-*-eabi}
+@item
+@uref{#powerpcle-*-elf,,powerpcle-*-elf, powerpcle-*-sysv4}
+@item
+@uref{#powerpcle-*-eabisim,,powerpcle-*-eabisim}
+@item
+@uref{#powerpcle-*-eabi,,powerpcle-*-eabi}
+@item
+@uref{#powerpcle-*-winnt,,powerpcle-*-winnt, powerpcle-*-pe}
+@item
+@uref{#romp-*-aos,,romp-*-aos, romp-*-mach}
+@item
+@uref{#s390-*-linux*}
+@item
+@uref{#s390x-*-linux*}
+@item
+@uref{#*-*-solaris2*,,*-*-solaris2*}
+@item
+@uref{#sparc-sun-solaris2*,,sparc-sun-solaris2*}
+@item
+@uref{#sparc-sun-solaris2.7,,sparc-sun-solaris2.7}
+@item
+@uref{#*-*-solaris2.8,,*-*-solaris2.8}
+@item
+@uref{#sparc-sun-sunos4*,,sparc-sun-sunos4*}
+@item
+@uref{#sparc-unknown-linux-gnulibc1,,sparc-unknown-linux-gnulibc1}
+@item
+@uref{#sparc-*-linux*,,sparc-*-linux*}
+@item
+@uref{#sparc64-*-*,,sparc64-*-*}
+@item
+@uref{#*-*-sysv*,,*-*-sysv*}
+@item
+@uref{#vax-dec-ultrix,,vax-dec-ultrix}
+@item
+@uref{#we32k-*-*,,we32k-*-*}
+@item
+@uref{#xtensa-*-elf,,xtensa-*-elf}
+@item
+@uref{#xtensa-*-linux*,,xtensa-*-linux*}
+@item
+@uref{#windows,,Microsoft Windows}
+@item
+@uref{#os2,,OS/2}
+@item
+@uref{#older,,Older systems}
+@end itemize
+
+@itemize
+@item
+@uref{#elf_targets,,all ELF targets} (SVR4, Solaris 2, etc.)
+@end itemize
+@end ifhtml
+
+
+@html
+<!-- -------- host/target specific issues start here ---------------- -->
+<hr>
+@end html
+@heading @anchor{1750a-*-*}1750a-*-*
+MIL-STD-1750A processors.
+
+The MIL-STD-1750A cross configuration produces output for
+@code{as1750}, an assembler/linker available under the GNU General Public
+License for the 1750A@. @code{as1750} can be obtained at
+@uref{ftp://ftp.fta-berlin.de/pub/crossgcc/1750gals/}.
+A similarly licensed simulator for
+the 1750A is available from same address.
+
+You should ignore a fatal error during the building of @samp{libgcc}
+(@samp{libgcc} is not yet implemented for the 1750A@.)
+
+The @code{as1750} assembler requires the file @file{ms1750.inc}, which is
+found in the directory @file{gcc/config/1750a}.
+
+GCC produced the same sections as the Fairchild F9450 C Compiler,
+namely:
+
+@table @code
+@item Normal
+The program code section.
+
+@item Static
+The read/write (RAM) data section.
+
+@item Konst
+The read-only (ROM) constants section.
+
+@item Init
+Initialization section (code to copy KREL to SREL)@.
+@end table
+
+The smallest addressable unit is 16 bits (@code{BITS_PER_UNIT} is 16). This
+means that type @code{char} is represented with a 16-bit word per character.
+The 1750A's ``Load/Store Upper/Lower Byte'' instructions are not used by
+GCC@.
+
+@html
+</p>
+<hr>
+@end html
+@heading @anchor{a29k}a29k
+AMD Am29k-family processors. These are normally used in embedded
+applications. There are no standard Unix configurations.
+This configuration
+corresponds to AMD's standard calling sequence and binary interface
+and is compatible with other 29k tools.
+
+You may need to make a variant of the file @file{a29k.h} for your
+particular configuration.
+
+@html
+</p>
+<hr>
+@end html
+@heading @anchor{a29k-*-bsd}a29k-*-bsd
+AMD Am29050 used in a system running a variant of BSD Unix.
+
+@html
+</p>
+<hr>
+@end html
+@heading @anchor{alpha*-*-*}alpha*-*-*
+
+This section contains general configuration information for all
+alpha-based platforms using ELF (in particular, ignore this section for
+DEC OSF/1, Digital UNIX and Tru64 UNIX)@. In addition to reading this
+section, please read all other sections that match your target.
+
+We require binutils 2.11.2 or newer.
+Previous binutils releases had a number of problems with DWARF 2
+debugging information, not the least of which is incorrect linking of
+shared libraries.
+
+@html
+</p>
+<hr>
+@end html
+@heading @anchor{alpha*-dec-osf*}alpha*-dec-osf*
+Systems using processors that implement the DEC Alpha architecture and
+are running the DEC/Compaq Unix (DEC OSF/1, Digital UNIX, or Compaq
+Tru64 UNIX) operating system, for example the DEC Alpha AXP systems.
+
+In Tru64 UNIX V5.1, Compaq introduced a new assembler that does not
+currently (2001-06-13) work with @command{mips-tfile}. As a workaround,
+we need to use the old assembler, invoked via the barely documented
+@option{-oldas} option. To bootstrap GCC, you either need to use the
+Compaq C Compiler:
+
+@example
+ % CC=cc @var{srcdir}/configure [@var{options}] [@var{target}]
+@end example
+
+or you can use a copy of GCC 2.95.3 or higher built on Tru64 UNIX V4.0:
+
+@example
+ % CC=gcc -Wa,-oldas @var{srcdir}/configure [@var{options}] [@var{target}]
+@end example
+
+As of GNU binutils 2.11.2, neither GNU @command{as} nor GNU @command{ld}
+are supported on Tru64 UNIX, so you must not configure GCC with
+@option{--with-gnu-as} or @option{--with-gnu-ld}.
+
+The @option{--enable-threads} options isn't supported yet. A patch is
+in preparation for a future release. The Java runtime library has been
+reported to work on Tru64 UNIX V4.0F, V5.0, and V5.1, so you may try
+@option{--enable-libgcj} and report your results.
+
+GCC writes a @samp{.verstamp} directive to the assembler output file
+unless it is built as a cross-compiler. It gets the version to use from
+the system header file @file{/usr/include/stamp.h}. If you install a
+new version of DEC Unix, you should rebuild GCC to pick up the new version
+stamp.
+
+Note that since the Alpha is a 64-bit architecture, cross-compilers from
+32-bit machines will not generate code as efficient as that generated
+when the compiler is running on a 64-bit machine because many
+optimizations that depend on being able to represent a word on the
+target in an integral value on the host cannot be performed. Building
+cross-compilers on the Alpha for 32-bit machines has only been tested in
+a few cases and may not work properly.
+
+@code{make compare} may fail on old versions of DEC Unix unless you add
+@option{-save-temps} to @code{CFLAGS}. On these systems, the name of the
+assembler input file is stored in the object file, and that makes
+comparison fail if it differs between the @code{stage1} and
+@code{stage2} compilations. The option @option{-save-temps} forces a
+fixed name to be used for the assembler input file, instead of a
+randomly chosen name in @file{/tmp}. Do not add @option{-save-temps}
+unless the comparisons fail without that option. If you add
+@option{-save-temps}, you will have to manually delete the @samp{.i} and
+@samp{.s} files after each series of compilations.
+
+GCC now supports both the native (ECOFF) debugging format used by DBX
+and GDB and an encapsulated STABS format for use only with GDB@. See the
+discussion of the @option{--with-stabs} option of @file{configure} above
+for more information on these formats and how to select them.
+
+There is a bug in DEC's assembler that produces incorrect line numbers
+for ECOFF format when the @samp{.align} directive is used. To work
+around this problem, GCC will not emit such alignment directives
+while writing ECOFF format debugging information even if optimization is
+being performed. Unfortunately, this has the very undesirable
+side-effect that code addresses when @option{-O} is specified are
+different depending on whether or not @option{-g} is also specified.
+
+To avoid this behavior, specify @option{-gstabs+} and use GDB instead of
+DBX@. DEC is now aware of this problem with the assembler and hopes to
+provide a fix shortly.
+
+@html
+</p>
+<hr>
+@end html
+@heading @anchor{arc-*-elf}arc-*-elf
+Argonaut ARC processor.
+This configuration is intended for embedded systems.
+
+@html
+</p>
+<hr>
+@end html
+@heading @anchor{arm-*-aout}arm-*-aout
+Advanced RISC Machines ARM-family processors. These are often used in
+embedded applications. There are no standard Unix configurations.
+This configuration corresponds to the basic instruction sequences and will
+produce @file{a.out} format object modules.
+
+You may need to make a variant of the file @file{arm.h} for your particular
+configuration.
+
+@html
+</p>
+<hr>
+@end html
+@heading @anchor{arm-*-elf}arm-*-elf
+This configuration is intended for embedded systems.
+
+@html
+</p>
+<hr>
+@end html
+@heading @anchor{arm*-*-linux-gnu}arm*-*-linux-gnu
+
+We require GNU binutils 2.10 or newer.
+
+@html
+</p>
+<hr>
+@end html
+@heading @anchor{arm-*-riscix}arm-*-riscix
+The ARM2 or ARM3 processor running RISC iX, Acorn's port of BSD Unix.
+If you are running a version of RISC iX prior to 1.2 then you must
+specify the version number during configuration. Note that the
+assembler shipped with RISC iX does not support stabs debugging
+information; a new version of the assembler, with stabs support
+included, is now available from Acorn and via ftp
+@uref{ftp://ftp.acorn.com/pub/riscix/as+xterm.tar.Z}. To enable stabs
+debugging, pass @option{--with-gnu-as} to configure.
+
+You will need to install GNU @command{sed} before you can run configure.
+
+@html
+</p>
+<hr>
+@end html
+@heading @anchor{avr}avr
+
+ATMEL AVR-family micro controllers. These are used in embedded
+applications. There are no standard Unix configurations.
+@ifnothtml
+@xref{AVR Options,, AVR Options, gcc, Using and Porting the GNU Compiler
+Collection (GCC)},
+@end ifnothtml
+@ifhtml
+See ``AVR Options'' in the main manual
+@end ifhtml
+for the list of supported MCU types.
+
+Use @samp{configure --target=avr --enable-languages="c"} to configure GCC@.
+
+Further installation notes and other useful information about AVR tools
+can also be obtained from:
+
+@itemize @bullet
+@item
+@uref{http://home.overta.ru/users/denisc,,http://home.overta.ru/users/denisc}
+@item
+@uref{http://www.amelek.gda.pl/avr,,http://www.amelek.gda.pl/avr}
+@end itemize
+
+We @emph{strongly} recommend using binutils 2.11 or newer.
+
+The following error:
+@example
+ Error: register required
+@end example
+
+indicates that you should upgrade to a newer version of the binutils.
+
+@html
+</p>
+<hr>
+@end html
+@heading @anchor{c4x}c4x
+
+Texas Instruments TMS320C3x and TMS320C4x Floating Point Digital Signal
+Processors. These are used in embedded applications. There are no
+standard Unix configurations.
+@ifnothtml
+@xref{TMS320C3x/C4x Options,, TMS320C3x/C4x Options, gcc, Using and
+Porting the GNU Compiler Collection (GCC)},
+@end ifnothtml
+@ifhtml
+See ``TMS320C3x/C4x Options'' in the main manual
+@end ifhtml
+for the list of supported MCU types.
+
+GCC can be configured as a cross compiler for both the C3x and C4x
+architectures on the same system. Use @samp{configure --target=c4x
+--enable-languages="c,c++"} to configure.
+
+
+Further installation notes and other useful information about C4x tools
+can also be obtained from:
+
+@itemize @bullet
+@item
+@uref{http://www.elec.canterbury.ac.nz/c4x/,,http://www.elec.canterbury.ac.nz/c4x/}
+@end itemize
+
+@html
+</p>
+<hr>
+@end html
+@heading @anchor{dos}DOS
+
+Please have a look at our @uref{binaries.html,,binaries page}.
+
+You cannot install GCC by itself on MSDOS; it will not compile under
+any MSDOS compiler except itself. You need to get the complete
+compilation package DJGPP, which includes binaries as well as sources,
+and includes all the necessary compilation tools and libraries.
+
+@html
+</p>
+<hr>
+@end html
+@heading @anchor{dsp16xx}dsp16xx
+A port to the AT&T DSP1610 family of processors.
+
+@html
+</p>
+<hr>
+@end html
+@heading @anchor{*-*-freebsd*}*-*-freebsd*
+
+The version of binutils installed in @file{/usr/bin} is known to work unless
+otherwise specified in any per-architecture notes. However, binutils
+2.11 is known to improve overall testsuite results.
+
+For FreeBSD 1, FreeBSD 2 or any mutant a.out versions of FreeBSD 3: All
+configuration support and files as shipped with GCC 2.95 are still in
+place. FreeBSD 2.2.7 has been known to bootstrap completely; however,
+it is unknown which version of binutils was used (it is assumed that it
+was the system copy in @file{/usr/bin}) and C++ EH failures were noted.
+
+For FreeBSD using the ELF file format: DWARF 2 debugging is now the
+default for all CPU architectures. It had been the default on
+FreeBSD/alpha since its inception. You may use @option{-gstabs} instead
+of @option{-g}, if you really want the old debugging format. There are
+no known issues with mixing object files and libraries with different
+debugging formats. Otherwise, this release of GCC should now match more
+of the configuration used in the stock FreeBSD configuration of GCC. In
+particular, @option{--enable-threads} is now configured by default.
+However, as a general user, do not attempt to replace the system
+compiler with this release. Known to bootstrap and check with good
+results on FreeBSD 3.0, 3.4, 4.0, 4.2, 4.3 and 5-CURRENT@.
+
+At this time, @option{--enable-threads} is not compatible with
+@option{--enable-libgcj} on FreeBSD@.
+
+@html
+</p>
+<hr>
+@end html
+@heading @anchor{elxsi-elxsi-bsd}elxsi-elxsi-bsd
+The Elxsi's C compiler has known limitations that prevent it from
+compiling GCC@. Please contact @email{mrs@@wrs.com} for more details.
+
+@html
+</p>
+<hr>
+@end html
+@heading @anchor{h8300-hms}h8300-hms
+Hitachi H8/300 series of processors.
+
+Please have a look at our @uref{binaries.html,,binaries page}.
+
+The calling convention and structure layout has changed in release 2.6.
+All code must be recompiled. The calling convention now passes the
+first three arguments in function calls in registers. Structures are no
+longer a multiple of 2 bytes.
+
+@html
+</p>
+<hr>
+@end html
+@heading @anchor{hppa*-hp-hpux*}hppa*-hp-hpux*
+
+We @emph{highly} recommend using gas/binutils 2.8 or newer on all hppa
+platforms; you may encounter a variety of problems when using the HP
+assembler.
+
+Specifically, @option{-g} does not work on HP-UX (since that system
+uses a peculiar debugging format which GCC does not know about), unless you
+use GAS and GDB and configure GCC with the
+@uref{./configure.html#with-gnu-as,,@option{--with-gnu-as}} and
+@option{--with-as=@dots{}} options.
+
+If you wish to use pa-risc 2.0 architecture support, you must use either
+the HP assembler, gas/binutils 2.11 or a recent
+@uref{ftp://sources.redhat.com/pub/binutils/snapshots,,snapshot of gas}.
+
+More specific information to @samp{hppa*-hp-hpux*} targets follows.
+
+@html
+</p>
+<hr>
+@end html
+@heading @anchor{hppa*-hp-hpux9}hppa*-hp-hpux9
+
+The HP assembler has major problems on this platform. We've tried to work
+around the worst of the problems. However, those workarounds may be causing
+linker crashes in some circumstances; the workarounds also probably prevent
+shared libraries from working. Use the GNU assembler to avoid these problems.
+
+
+The configuration scripts for GCC will also trigger a bug in the hpux9
+shell. To avoid this problem set @env{CONFIG_SHELL} to @file{/bin/ksh}
+and @env{SHELL} to @file{/bin/ksh} in your environment.
+
+
+@html
+</p>
+<hr>
+@end html
+@heading @anchor{hppa*-hp-hpux10}hppa*-hp-hpux10
+
+For hpux10.20, we @emph{highly} recommend you pick up the latest sed patch
+@code{PHCO_19798} from HP@. HP has two sites which provide patches free of
+charge:
+
+@itemize @bullet
+@item
+@html
+<a href="http://us-support.external.hp.com">US, Canada, Asia-Pacific, and
+Latin-America</a>
+@end html
+@ifnothtml
+@uref{http://us-support.external.hp.com,,}US, Canada, Asia-Pacific, and
+Latin-America
+@end ifnothtml
+@item
+@uref{http://europe-support.external.hp.com,,Europe}
+@end itemize
+
+The HP assembler on these systems is much better than the hpux9 assembler,
+but still has some problems. Most notably the assembler inserts timestamps
+into each object file it creates, causing the 3-stage comparison test to fail
+during a @samp{make bootstrap}. You should be able to continue by
+saying @samp{make all} after getting the failure from @samp{make
+bootstrap}.
+
+
+@html
+</p>
+<hr>
+@end html
+@heading @anchor{hppa*-hp-hpux11}hppa*-hp-hpux11
+
+GCC 3.0 supports HP-UX 11. You must use GNU binutils 2.11 or above on
+this platform. Thread support is not currently implemented for this
+platform, so @option{--enable-threads} does not work.
+See @uref{http://gcc.gnu.org/ml/gcc-prs/2002-01/msg00551.html}
+and @uref{http://gcc.gnu.org/ml/gcc-bugs/2002-01/msg00663.html}.
+GCC 2.95.x is not supported under HP-UX 11 and cannot be used to
+compile GCC 3.0. Refer to @uref{binaries.html,,binaries} for information
+about obtaining precompiled GCC binaries for HP-UX.
+
+@html
+</p>
+<hr>
+@end html
+@heading @anchor{i370-*-*}i370-*-*
+This port is very preliminary and has many known bugs. We hope to
+have a higher-quality port for this machine soon.
+
+@html
+</p>
+<hr>
+@end html
+@heading @anchor{*-*-linux-gnu}*-*-linux-gnu
+
+If you use glibc 2.2 (or 2.1.9x), GCC 2.95.2 won't install
+out-of-the-box. You'll get compile errors while building @samp{libstdc++}.
+The patch @uref{glibc-2.2.patch,,glibc-2.2.patch}, that is to be
+applied in the GCC source tree, fixes the compatibility problems.
+
+@html
+</p>
+@end html
+
+@html
+<p>
+@end html
+
+Currently Glibc 2.2.3 (and older releases) and GCC 3.0 are out of sync
+since the latest exception handling changes for GCC@. Compiling glibc
+with GCC 3.0 will give a binary incompatible glibc and therefore cause
+lots of problems and might make your system completly unusable. This
+will definitly need fixes in glibc but might also need fixes in GCC@. We
+strongly advise to wait for glibc 2.2.4 and to read the release notes of
+glibc 2.2.4 whether patches for GCC 3.0 are needed. You can use glibc
+2.2.3 with GCC 3.0, just do not try to recompile it.
+
+@html
+</p>
+<hr>
+@end html
+@heading @anchor{ix86-*-linux*oldld}i?86-*-linux*oldld
+Use this configuration to generate @file{a.out} binaries on Linux-based
+GNU systems if you do not have gas/binutils version 2.5.2 or later
+installed. This is an obsolete configuration.
+
+@html
+</p>
+<hr>
+@end html
+@heading @anchor{ix86-*-linux*aout}i?86-*-linux*aout
+Use this configuration to generate @file{a.out} binaries on Linux-based
+GNU systems. This configuration is being superseded. You must use
+gas/binutils version 2.5.2 or later.
+
+@html
+</p>
+<hr>
+@end html
+@heading @anchor{ix86-*-linux*}i?86-*-linux*
+
+You will need binutils 2.9.1.0.15 or newer for exception handling to work.
+
+If you receive Signal 11 errors when building on GNU/Linux, then it is
+possible you have a hardware problem. Further information on this can be
+found on @uref{http://www.bitwizard.nl/sig11/,,www.bitwizard.nl}.
+
+@html
+</p>
+<hr>
+@end html
+@heading @anchor{ix86-*-sco}i?86-*-sco
+Compilation with RCC is recommended. Also, it may be a good idea to
+link with GNU malloc instead of the malloc that comes with the system.
+
+@html
+</p>
+<hr>
+@end html
+@heading @anchor{ix86-*-sco3.2v4}i?86-*-sco3.2v4
+Use this configuration for SCO release 3.2 version 4.
+
+@html
+</p>
+<hr>
+@end html
+@heading @anchor{ix86-*-sco3.2v5*}i?86-*-sco3.2v5*
+Use this for the SCO OpenServer Release 5 family of operating systems.
+
+Unlike earlier versions of GCC, the ability to generate COFF with this
+target is no longer provided.
+
+Earlier versions of GCC emitted DWARF 1 when generating ELF to allow
+the system debugger to be used. That support was too burdensome to
+maintain. GCC now emits only DWARF 2 for this target. This means you
+may use either the UDK debugger or GDB to debug programs built by this
+version of GCC@.
+
+Use of the @option{-march=pentiumpro} flag can result in
+unrecognized opcodes when using the native assembler on OS versions before
+5.0.6. (Support for P6 opcodes was added to the native ELF assembler in
+that version.) While it's rather rare to see these emitted by GCC yet,
+errors of the basic form:
+
+@example
+ /usr/tmp/ccaNlqBc.s:22:unknown instruction: fcomip
+ /usr/tmp/ccaNlqBc.s:50:unknown instruction: fucomip
+@end example
+
+are symptoms of this problem. You may work around this by not
+building affected files with that flag, by using the GNU assembler, or
+by using the assembler provided with the current version of the OS@.
+Users of GNU assembler should see the note below for hazards on doing
+so.
+
+The native SCO assembler that is provided with the OS at no
+charge is normally required. If, however, you must be able to use
+the GNU assembler (perhaps you're compiling code with asms that
+require GAS syntax) you may configure this package using the flags
+@uref{./configure.html#with-gnu-as,,@option{--with-gnu-as}}. You must
+use a recent version of GNU binutils; versions past 2.9.1 seem to work
+well.
+
+In general, the @option{--with-gnu-as} option isn't as well tested
+as the native assembler.
+
+Look in @file{gcc/config/i386/sco5.h} (search for ``messy'') for
+additional OpenServer-specific flags.
+
+Systems based on OpenServer before 5.0.4 (@samp{uname -X}
+will tell you what you're running) require TLS597 from
+@uref{ftp://ftp.sco.com/TLS/,,ftp://ftp.sco.com/TLS/}
+for C++ constructors and destructors to work right.
+
+The system linker in (at least) 5.0.4 and 5.0.5 will sometimes
+do the wrong thing for a construct that GCC will emit for PIC
+code. This can be seen as execution testsuite failures when using
+@option{-fPIC} on @file{921215-1.c}, @file{931002-1.c}, @file{nestfunc-1.c}, and @file{gcov-1.c}.
+For 5.0.5, an updated linker that will cure this problem is
+available. You must install both
+@uref{ftp://ftp.sco.com/Supplements/rs505a/,,ftp://ftp.sco.com/Supplements/rs505a/}
+and @uref{ftp://ftp.sco.com/SLS/,,OSS499A}.
+
+The dynamic linker in OpenServer 5.0.5 (earlier versions may show
+the same problem) aborts on certain G77-compiled programs. It's particularly
+likely to be triggered by building Fortran code with the @option{-fPIC} flag.
+Although it's conceivable that the error could be triggered by other
+code, only G77-compiled code has been observed to cause this abort.
+If you are getting core dumps immediately upon execution of your
+G77 program---and especially if it's compiled with @option{-fPIC}---try applying
+@uref{sco_osr5_g77.patch,,@file{sco_osr5_g77.patch}} to your @samp{libf2c} and
+rebuilding GCC@.
+Affected faults, when analyzed in a debugger, will show a stack
+backtrace with a fault occurring in @code{rtld()} and the program
+running as @file{/usr/lib/ld.so.1}. This problem has been reported to SCO
+engineering and will hopefully be addressed in later releases.
+
+
+@html
+</p>
+<hr>
+@end html
+@heading @anchor{ix86-*-udk}i?86-*-udk
+
+This target emulates the SCO Universal Development Kit and requires that
+package be installed. (If it is installed, you will have a
+@file{/udk/usr/ccs/bin/cc} file present.) It's very much like the
+@samp{i?86-*-unixware7*} target
+but is meant to be used when hosting on a system where UDK isn't the
+default compiler such as OpenServer 5 or Unixware 2. This target will
+generate binaries that will run on OpenServer, Unixware 2, or Unixware 7,
+with the same warnings and caveats as the SCO UDK@.
+
+This target is a little tricky to build because we have to distinguish
+it from the native tools (so it gets headers, startups, and libraries
+from the right place) while making the tools not think we're actually
+building a cross compiler. The easiest way to do this is with a configure
+command like this:
+
+@samp{CC=/udk/usr/ccs/bin/cc @var{/your/path/to}/gcc/configure
+--host=i686-pc-udk --target=i686-pc-udk --program-prefix=udk-}
+
+@emph{You should substitute @samp{i686} in the above command with the appropriate
+processor for your host.}
+
+After the usual @samp{make bootstrap} and
+@samp{make install}, you can then access the UDK-targeted GCC
+tools by adding @command{udk-} before the commonly known name. For
+example, to invoke the C compiler, you would use @command{udk-gcc}.
+They will coexist peacefully with any native-target GCC tools you may
+have installed.
+
+
+@html
+</p>
+<hr>
+@end html
+@heading @anchor{ix86-*-isc}i?86-*-isc
+It may be a good idea to link with GNU malloc instead of the malloc that
+comes with the system.
+
+In ISC version 4.1, @command{sed} core dumps when building
+@file{deduced.h}. Use the version of @command{sed} from version 4.0.
+
+@html
+</p>
+<hr>
+@end html
+@heading @anchor{ix86-*-esix}i?86-*-esix
+It may be good idea to link with GNU malloc instead of the malloc that
+comes with the system.
+
+@html
+</p>
+<hr>
+@end html
+@heading @anchor{ix86-ibm-aix}i?86-ibm-aix
+You need to use GAS version 2.1 or later, and LD from
+GNU binutils version 2.2 or later.
+
+@html
+</p>
+<hr>
+@end html
+@heading @anchor{ix86-sequent-bsd}i?86-sequent-bsd
+Go to the Berkeley universe before compiling.
+
+@html
+</p>
+<hr>
+@end html
+@heading @anchor{ix86-sequent-ptx1*}i?86-sequent-ptx1*, i?86-sequent-ptx2*
+You must install GNU @command{sed} before running @command{configure}.
+
+@html
+</p>
+<hr>
+@end html
+@heading @anchor{#ix86-*-sysv3*}i?86-*-sysv3*
+The @code{fixproto} shell script may trigger a bug in the system shell.
+If you encounter this problem, upgrade your operating system or
+use @command{bash} (the GNU shell) to run @code{fixproto}.
+
+
+@html
+</p>
+<hr>
+@end html
+@heading @anchor{i860-intel-osf*}i860-intel-osf*
+On the Intel Paragon (an i860 machine), if you are using operating
+system version 1.0, you will get warnings or errors about redefinition
+of @code{va_arg} when you build GCC@.
+
+If this happens, then you need to link most programs with the library
+@file{iclib.a}. You must also modify @file{stdio.h} as follows: before
+the lines
+
+@example
+#if defined(__i860__) && !defined(_VA_LIST)
+#include <va_list.h>
+@end example
+
+@noindent
+insert the line
+
+@example
+#if __PGC__
+@end example
+
+@noindent
+and after the lines
+
+@example
+extern int vprintf(const char *, va_list );
+extern int vsprintf(char *, const char *, va_list );
+#endif
+@end example
+
+@noindent
+insert the line
+
+@example
+#endif /* __PGC__ */
+@end example
+
+These problems don't exist in operating system version 1.1.
+
+@html
+</p>
+<hr>
+@end html
+@heading @anchor{ia64-*-linux}ia64-*-linux
+IA-64 processor (also known as IPF, or Itanium Processor Family)
+running GNU/Linux.
+
+The toolchain is not completely finished, so requirements will continue
+to change.
+GCC 3.0.1 and later require glibc 2.2.4.
+GCC 3.0.2 requires binutils from 2001-09-05 or later.
+GCC 3.0.1 requires binutils 2.11.1 or later.
+
+None of the following versions of GCC has an ABI that is compatible
+with any of the other versions in this list, with the exception that
+Red Hat 2.96 and Trillian 000171 are compatible with each other:
+3.0.2, 3.0.1, 3.0, Red Hat 2.96, and Trillian 000717.
+This primarily affects C++ programs and programs that create shared libraries.
+Because of these ABI incompatibilities, GCC 3.0.2 is not recommended for
+user programs on GNU/Linux systems built using earlier compiler releases.
+GCC 3.0.2 is recommended for compiling linux, the kernel.
+GCC 3.0.2 is believed to be fully ABI compliant, and hence no more major
+ABI changes are expected.
+
+@html
+</p>
+<hr>
+@end html
+@heading @anchor{*-lynx-lynxos}*-lynx-lynxos
+LynxOS 2.2 and earlier comes with GCC 1.x already installed as
+@file{/bin/gcc}. You should compile with this instead of @file{/bin/cc}.
+You can tell GCC to use the GNU assembler and linker, by specifying
+@samp{--with-gnu-as --with-gnu-ld} when configuring. These will produce
+COFF format object files and executables; otherwise GCC will use the
+installed tools, which produce @file{a.out} format executables.
+
+@html
+</p>
+<hr>
+<!-- rs6000-ibm-aix*, powerpc-ibm-aix* -->
+@end html
+@heading @anchor{*-ibm-aix*}*-ibm-aix*
+
+AIX Make frequently has problems with GCC makefiles. GNU Make 3.76 or
+newer is recommended to build on this platform.
+
+Errors involving @code{alloca} when building GCC generally are due
+to an incorrect definition of @code{CC} in the Makefile or mixing files
+compiled with the native C compiler and GCC@. During the stage1 phase of
+the build, the native AIX compiler @strong{must} be invoked as @command{cc}
+(not @command{xlc}). Once @command{configure} has been informed of
+@command{xlc}, one needs to use @samp{make distclean} to remove the
+configure cache files and ensure that @env{CC} environment variable
+does not provide a definition that will confuse @command{configure}.
+If this error occurs during stage2 or later, then the problem most likely
+is the version of Make (see above).
+
+The GNU Assembler incorrectly reports that it supports WEAK symbols on
+AIX which causes GCC to try to utilize weak symbol functionality which
+is not really supported on the platform. The native @command{as} and
+@command{ld} still are recommended. The native AIX tools do
+interoperate with GCC@.
+
+Building @file{libstdc++.a} requires a fix for a AIX Assembler bug
+APAR IY26685 (AIX 4.3) or APAR IY25528 (AIX 5.1).
+
+Linking executables and shared libraries may produce warnings of
+duplicate symbols. The assembly files generated by GCC for AIX always
+have included multiple symbol definitions for certain global variable
+and function declarations in the original program. The warnings should
+not prevent the linker from producing a correct library or runnable
+executable.
+
+GCC's exception handling implementation stores process-specific data in
+the shared library which prevents exception handling from working
+correctly on AIX in a default installation. To work around this, the
+shared objects need to be loaded in the process private segment to
+prevent them from being shared and marked read-only. This is
+accomplished on AIX by installing the shared libraries
+(@file{libgcc_s.a} and @file{libstdc++.a}) with file permissions
+disallowing read-other (@samp{chmod a+x,o-r}). If the shared libraries
+have been used, the shared library segment can be cleaned using the
+@samp{/usr/sbin/slibclean} command.
+
+AIX 4.3 utilizes a ``large format'' archive to support both 32-bit and
+64-bit object modules. The routines provided in AIX 4.3.0 and AIX 4.3.1
+to parse archive libraries did not handle the new format correctly.
+These routines are used by GCC and result in error messages during
+linking such as ``not a COFF file''. The version of the routines shipped
+with AIX 4.3.1 should work for a 32-bit environment. The @option{-g}
+option of the archive command may be used to create archives of 32-bit
+objects using the original ``small format''. A correct version of the
+routines is shipped with AIX 4.3.2 and above.
+
+Some versions of the AIX binder (linker) can fail with a relocation
+overflow severe error when the @option{-bbigtoc} option is used to link
+GCC-produced object files into an executable that overflows the TOC@. A fix
+for APAR IX75823 (OVERFLOW DURING LINK WHEN USING GCC AND -BBIGTOC) is
+available from IBM Customer Support and from its
+@uref{http://techsupport.services.ibm.com/,,techsupport.services.ibm.com}
+website as PTF U455193.
+
+The AIX 4.3.2.1 linker (bos.rte.bind_cmds Level 4.3.2.1) will dump core
+with a segmentation fault when invoked by any version of GCC@. A fix for
+APAR IX87327 is available from IBM Customer Support and from its
+@uref{http://techsupport.services.ibm.com/,,techsupport.services.ibm.com}
+website as PTF U461879. This fix is incorporated in AIX 4.3.3 and above.
+
+The initial assembler shipped with AIX 4.3.0 generates incorrect object
+files. A fix for APAR IX74254 (64BIT DISASSEMBLED OUTPUT FROM COMPILER FAILS
+TO ASSEMBLE/BIND) is available from IBM Customer Support and from its
+@uref{http://techsupport.services.ibm.com/,,techsupport.services.ibm.com}
+website as PTF U453956. This fix is incorporated in AIX 4.3.1 and above.
+
+AIX provides National Language Support (NLS)@. Compilers and assemblers
+use NLS to support locale-specific representations of various data
+formats including floating-point numbers (e.g., @samp{.} vs @samp{,} for
+separating decimal fractions). There have been problems reported where
+GCC does not produce the same floating-point formats that the assembler
+expects. If one encounters this problem, set the @env{LANG}
+environment variable to @samp{C} or @samp{En_US}.
+
+By default, GCC for AIX 4.1 and above produces code that can be used on
+both Power or PowerPC processors.
+
+A default can be specified with the @option{-mcpu=@var{cpu_type}}
+switch and using the configure option @option{--with-cpu-@var{cpu_type}}.
+
+@html
+</p>
+<hr>
+@end html
+@heading @anchor{m32r-*-elf}m32r-*-elf
+Mitsubishi M32R processor.
+This configuration is intended for embedded systems.
+
+@html
+</p>
+<hr>
+@end html
+@heading @anchor{m68000-hp-bsd}m68000-hp-bsd
+HP 9000 series 200 running BSD@. Note that the C compiler that comes
+with this system cannot compile GCC; contact @email{law@@cygnus.com}
+to get binaries of GCC for bootstrapping.
+
+@html
+</p>
+<hr>
+@end html
+@heading @anchor{m6811-elf}m6811-elf
+Motorola 68HC11 family micro controllers. These are used in embedded
+applications. There are no standard Unix configurations.
+
+@html
+</p>
+<hr>
+@end html
+@heading @anchor{m6812-elf}m6812-elf
+Motorola 68HC12 family micro controllers. These are used in embedded
+applications. There are no standard Unix configurations.
+
+@html
+</p>
+<hr>
+@end html
+@heading @anchor{m68k-altos}m68k-altos
+Altos 3068. You must use the GNU assembler, linker and debugger.
+Also, you must fix a kernel bug.
+
+@html
+</p>
+<hr>
+@end html
+@heading @anchor{m68k-apple-aux}m68k-apple-aux
+Apple Macintosh running A/UX@.
+You may configure GCC to use either the system assembler and
+linker or the GNU assembler and linker. You should use the GNU configuration
+if you can, especially if you also want to use G++. You enable
+that configuration with the @option{--with-gnu-as} and @option{--with-gnu-ld}
+options to @code{configure}.
+
+Note the C compiler that comes
+with this system cannot compile GCC@. You can find binaries of GCC
+for bootstrapping on @code{jagubox.gsfc.nasa.gov}.
+You will also a patched version of @file{/bin/ld} there that
+raises some of the arbitrary limits found in the original.
+
+@html
+</p>
+<hr>
+@end html
+@heading @anchor{m68k-att-sysv}m68k-att-sysv
+AT&T 3b1, a.k.a.@: 7300 PC@. This version of GCC cannot
+be compiled with the system C compiler, which is too buggy.
+You will need to get a previous version of GCC and use it to
+bootstrap. Binaries are available from the OSU-CIS archive, at
+@uref{ftp://archive.cis.ohio-state.edu/pub/att7300/}.
+
+@html
+</p>
+<hr>
+@end html
+@heading @anchor{m68k-bull-sysv}m68k-bull-sysv
+Bull DPX/2 series 200 and 300 with BOS-2.00.45 up to BOS-2.01. GCC works
+either with native assembler or GNU assembler. You can use
+GNU assembler with native COFF generation by providing @option{--with-gnu-as} to
+the configure script or use GNU assembler with stabs-in-COFF encapsulation
+by providing @samp{--with-gnu-as --stabs}. For any problem with the native
+assembler or for availability of the DPX/2 port of GAS, contact
+@email{F.Pierresteguy@@frcl.bull.fr}.
+
+@html
+</p>
+<hr>
+@end html
+@heading @anchor{m68k-crds-unox}m68k-crds-unox
+Use @samp{configure unos} for building on Unos.
+
+The Unos assembler is named @code{casm} instead of @code{as}. For some
+strange reason linking @file{/bin/as} to @file{/bin/casm} changes the
+behavior, and does not work. So, when installing GCC, you should
+install the following script as @file{as} in the subdirectory where
+the passes of GCC are installed:
+
+@example
+#!/bin/sh
+casm $*
+@end example
+
+The default Unos library is named @file{libunos.a} instead of
+@file{libc.a}. To allow GCC to function, either change all
+references to @option{-lc} in @file{gcc.c} to @option{-lunos} or link
+@file{/lib/libc.a} to @file{/lib/libunos.a}.
+
+@cindex @code{alloca}, for Unos
+When compiling GCC with the standard compiler, to overcome bugs in
+the support of @code{alloca}, do not use @option{-O} when making stage 2.
+Then use the stage 2 compiler with @option{-O} to make the stage 3
+compiler. This compiler will have the same characteristics as the usual
+stage 2 compiler on other systems. Use it to make a stage 4 compiler
+and compare that with stage 3 to verify proper compilation.
+
+(Perhaps simply defining @code{ALLOCA} in @file{x-crds} as described in
+the comments there will make the above paragraph superfluous. Please
+inform us of whether this works.)
+
+Unos uses memory segmentation instead of demand paging, so you will need
+a lot of memory. 5 Mb is barely enough if no other tasks are running.
+If linking @file{cc1} fails, try putting the object files into a library
+and linking from that library.
+
+@html
+</p>
+<hr>
+@end html
+@heading @anchor{m68k-hp-hpux}m68k-hp-hpux
+HP 9000 series 300 or 400 running HP-UX@. HP-UX version 8.0 has a bug in
+the assembler that prevents compilation of GCC@. This
+bug manifests itself during the first stage of compilation, while
+building @file{libgcc2.a}:
+
+@smallexample
+_floatdisf
+cc1: warning: `-g' option not supported on this version of GCC
+cc1: warning: `-g1' option not supported on this version of GCC
+./xgcc: Internal compiler error: program as got fatal signal 11
+@end smallexample
+
+A patched version of the assembler is available as the file
+@uref{ftp://altdorf.ai.mit.edu/archive/cph/hpux-8.0-assembler}. If you
+have HP software support, the patch can also be obtained directly from
+HP, as described in the following note:
+
+@quotation
+This is the patched assembler, to patch SR#1653-010439, where the
+assembler aborts on floating point constants.
+
+The bug is not really in the assembler, but in the shared library
+version of the function ``cvtnum(3c)''. The bug on ``cvtnum(3c)'' is
+SR#4701-078451. Anyway, the attached assembler uses the archive
+library version of ``cvtnum(3c)'' and thus does not exhibit the bug.
+@end quotation
+
+This patch is also known as PHCO_4484.
+
+In addition, if you wish to use gas, you must use
+gas version 2.1 or later, and you must use the GNU linker version 2.1 or
+later. Earlier versions of gas relied upon a program which converted the
+gas output into the native HP-UX format, but that program has not been
+kept up to date. gdb does not understand that native HP-UX format, so
+you must use gas if you wish to use gdb.
+
+On HP-UX version 8.05, but not on 8.07 or more recent versions, the
+@code{fixproto} shell script triggers a bug in the system shell. If you
+encounter this problem, upgrade your operating system or use BASH (the
+GNU shell) to run @code{fixproto}. This bug will cause the fixproto
+program to report an error of the form:
+
+@example
+./fixproto: sh internal 1K buffer overflow
+@end example
+
+To fix this, you can also change the first line of the fixproto script
+to look like:
+
+@example
+#!/bin/ksh
+@end example
+
+
+@html
+</p>
+<hr>
+@end html
+@heading @anchor{m68k-*-nextstep*}m68k-*-nextstep*
+
+Current GCC versions probably do not work on version 2 of the NeXT
+operating system.
+
+On NeXTStep 3.0, the Objective-C compiler does not work, due,
+apparently, to a kernel bug that it happens to trigger. This problem
+does not happen on 3.1.
+
+You absolutely @strong{must} use GNU sed and GNU make on this platform.
+
+
+On NeXTSTEP 3.x where x < 3 the build of GCC will abort during
+stage1 with an error message like this:
+
+@example
+ _eh
+ /usr/tmp/ccbbsZ0U.s:987:Unknown pseudo-op: .section
+ /usr/tmp/ccbbsZ0U.s:987:Rest of line ignored. 1st junk character
+ valued 95 (_).
+@end example
+
+The reason for this is the fact that NeXT's assembler for these
+versions of the operating system does not support the @samp{.section}
+pseudo op that's needed for full C++ exception functionality.
+
+As NeXT's assembler is a derived work from GNU as, a free
+replacement that does can be obtained at
+@uref{ftp://ftp.next.peak.org:/next-ftp/next/apps/devtools/as.3.3.NIHS.s.tar.gz,,ftp://ftp.next.peak.org:/next-ftp/next/apps/devtools/as.3.3.NIHS.s.tar.gz}.
+
+If you try to build the integrated C++ & C++ runtime libraries on this system
+you will run into trouble with include files. The way to get around this is
+to use the following sequence. Note you must have write permission to
+the directory @var{prefix} you specified in the configuration process of GCC
+for this sequence to work.
+
+@example
+ cd bld-gcc
+ make all-texinfo all-bison all-byacc all-binutils all-gas all-ld
+ cd gcc
+ make bootstrap
+ make install-headers-tar
+ cd ..
+ make bootstrap3
+@end example
+
+@html
+</p>
+<hr>
+@end html
+@heading @anchor{m68k-ncr-*}m68k-ncr-*
+On the Tower models 4@var{n}0 and 6@var{n}0, by default a process is not
+allowed to have more than one megabyte of memory. GCC cannot compile
+itself (or many other programs) with @option{-O} in that much memory.
+
+To solve this problem, reconfigure the kernel adding the following line
+to the configuration file:
+
+@smallexample
+MAXUMEM = 4096
+@end smallexample
+
+
+@html
+</p>
+<hr>
+@end html
+@heading @anchor{m68k-sun}m68k-sun
+Sun 3. We do not provide a configuration file to use the Sun FPA by
+default, because programs that establish signal handlers for floating
+point traps inherently cannot work with the FPA@.
+
+@html
+</p>
+<hr>
+@end html
+@heading @anchor{m68k-sun-sunos4.1.1}m68k-sun-sunos4.1.1
+
+It is reported that you may need the GNU assembler on this platform.
+
+
+@html
+</p>
+<hr>
+@end html
+@heading @anchor{m88k-*-svr3}m88k-*-svr3
+Motorola m88k running the AT&T/Unisoft/Motorola V.3 reference port.
+These systems tend to use the Green Hills C, revision 1.8.5, as the
+standard C compiler. There are apparently bugs in this compiler that
+result in object files differences between stage 2 and stage 3. If this
+happens, make the stage 4 compiler and compare it to the stage 3
+compiler. If the stage 3 and stage 4 object files are identical, this
+suggests you encountered a problem with the standard C compiler; the
+stage 3 and 4 compilers may be usable.
+
+It is best, however, to use an older version of GCC for bootstrapping
+if you have one.
+
+@html
+</p>
+<hr>
+@end html
+@heading @anchor{m88k-*-dgux}m88k-*-dgux
+Motorola m88k running DG/UX@. To build 88open BCS native or cross
+compilers on DG/UX, specify the configuration name as
+@samp{m88k-*-dguxbcs} and build in the 88open BCS software development
+environment. To build ELF native or cross compilers on DG/UX, specify
+@samp{m88k-*-dgux} and build in the DG/UX ELF development environment.
+You set the software development environment by issuing
+@samp{sde-target} command and specifying either @samp{m88kbcs} or
+@samp{m88kdguxelf} as the operand.
+
+If you do not specify a configuration name, @file{configure} guesses the
+configuration based on the current software development environment.
+
+@html
+</p>
+<hr>
+@end html
+@heading @anchor{m88k-tektronix-sysv3}m88k-tektronix-sysv3
+Tektronix XD88 running UTekV 3.2e. Do not turn on
+optimization while building stage1 if you bootstrap with
+the buggy Green Hills compiler. Also, the bundled LAI
+System V NFS is buggy so if you build in an NFS mounted
+directory, start from a fresh reboot, or avoid NFS all together.
+Otherwise you may have trouble getting clean comparisons
+between stages.
+
+@html
+</p>
+<hr>
+@end html
+@heading @anchor{mips-*-*}mips-*-*
+If you use the 1.31 version of the MIPS assembler (such as was shipped
+with Ultrix 3.1), you will need to use the @option{-fno-delayed-branch} switch
+when optimizing floating point code. Otherwise, the assembler will
+complain when the GCC compiler fills a branch delay slot with a
+floating point instruction, such as @code{add.d}.
+
+If on a MIPS system you get an error message saying ``does not have gp
+sections for all it's [sic] sectons [sic]'', don't worry about it. This
+happens whenever you use GAS with the MIPS linker, but there is not
+really anything wrong, and it is okay to use the output file. You can
+stop such warnings by installing the GNU linker.
+
+It would be nice to extend GAS to produce the gp tables, but they are
+optional, and there should not be a warning about their absence.
+
+Users have reported some problems with version 2.0 of the MIPS
+compiler tools that were shipped with Ultrix 4.1. Version 2.10
+which came with Ultrix 4.2 seems to work fine.
+
+Users have also reported some problems with version 2.20 of the
+MIPS compiler tools that were shipped with RISC/os 4.x. The earlier
+version 2.11 seems to work fine.
+
+Some versions of the MIPS linker will issue an assertion failure
+when linking code that uses @code{alloca} against shared
+libraries on RISC-OS 5.0, and DEC's OSF/1 systems. This is a bug
+in the linker, that is supposed to be fixed in future revisions.
+To protect against this, GCC passes @option{-non_shared} to the
+linker unless you pass an explicit @option{-shared} or
+@option{-call_shared} switch.
+
+@heading @anchor{mips-mips-bsd}mips-mips-bsd
+MIPS machines running the MIPS operating system in BSD mode. It's
+possible that some old versions of the system lack the functions
+@code{memcpy}, @code{memmove}, @code{memcmp}, and @code{memset}. If your
+system lacks these, you must remove or undo the definition of
+@code{TARGET_MEM_FUNCTIONS} in @file{mips-bsd.h}.
+
+If you use the MIPS C compiler to bootstrap, it may be necessary
+to increase its table size for switch statements with the
+@option{-Wf,-XNg1500} option. If you use the @option{-O2}
+optimization option, you also need to use @option{-Olimit 3000}.
+Both of these options are automatically generated in the
+@file{Makefile} that the shell script @file{configure} builds.
+If you override the @code{CC} make variable and use the MIPS
+compilers, you may need to add @option{-Wf,-XNg1500 -Olimit 3000}.
+
+@html
+</p>
+<hr>
+@end html
+@heading @anchor{mips-dec-*}mips-dec-*
+MIPS-based DECstations can support three different personalities:
+Ultrix, DEC OSF/1, and OSF/rose. (Alpha-based DECstation products have
+a configuration name beginning with @samp{alpha*-dec}.) To configure GCC
+for these platforms use the following configurations:
+
+@table @samp
+@item mips-dec-ultrix
+Ultrix configuration.
+
+@item mips-dec-osf1
+DEC's version of OSF/1.
+
+@item mips-dec-osfrose
+Open Software Foundation reference port of OSF/1 which uses the
+OSF/rose object file format instead of ECOFF@. Normally, you
+would not select this configuration.
+@end table
+
+If you use the MIPS C compiler to bootstrap, it may be necessary
+to increase its table size for switch statements with the
+@option{-Wf,-XNg1500} option. If you use the @option{-O2}
+optimization option, you also need to use @option{-Olimit 3000}.
+Both of these options are automatically generated in the
+@file{Makefile} that the shell script @file{configure} builds.
+If you override the @code{CC} make variable and use the MIPS
+compilers, you may need to add @option{-Wf,-XNg1500 -Olimit 3000}.
+
+@html
+</p>
+<hr>
+@end html
+@heading @anchor{mips-mips-riscos*}mips-mips-riscos*
+If you use the MIPS C compiler to bootstrap, it may be necessary
+to increase its table size for switch statements with the
+@option{-Wf,-XNg1500} option. If you use the @option{-O2}
+optimization option, you also need to use @option{-Olimit 3000}.
+Both of these options are automatically generated in the
+@file{Makefile} that the shell script @file{configure} builds.
+If you override the @code{CC} make variable and use the MIPS
+compilers, you may need to add @samp{-Wf,-XNg1500 -Olimit 3000}.
+
+MIPS computers running RISC-OS can support four different
+personalities: default, BSD 4.3, System V.3, and System V.4
+(older versions of RISC-OS don't support V.4). To configure GCC
+for these platforms use the following configurations:
+
+@table @samp
+@item mips-mips-riscos@var{rev}
+Default configuration for RISC-OS, revision @var{rev}.
+
+@item mips-mips-riscos@var{rev}bsd
+BSD 4.3 configuration for RISC-OS, revision @var{rev}.
+
+@item mips-mips-riscos@var{rev}sysv4
+System V.4 configuration for RISC-OS, revision @var{rev}.
+
+@html
+</p>
+<hr>
+@end html
+@item mips-mips-riscos@var{rev}sysv
+System V.3 configuration for RISC-OS, revision @var{rev}.
+@end table
+
+The revision @code{rev} mentioned above is the revision of
+RISC-OS to use. You must reconfigure GCC when going from a
+RISC-OS revision 4 to RISC-OS revision 5. This has the effect of
+avoiding a linker bug.
+
+@html
+</p>
+<hr>
+@end html
+@heading @anchor{mips-sgi-irix4}mips-sgi-irix4
+
+In order to compile GCC on an SGI running IRIX 4, the ``c.hdr.lib''
+option must be installed from the CD-ROM supplied from Silicon Graphics.
+This is found on the 2nd CD in release 4.0.1.
+
+On IRIX version 4.0.5F, and perhaps on some other versions as well,
+there is an assembler bug that reorders instructions incorrectly. To
+work around it, specify the target configuration
+@samp{mips-sgi-irix4loser}. This configuration inhibits assembler
+optimization.
+
+In a compiler configured with target @samp{mips-sgi-irix4}, you can turn
+off assembler optimization by using the @option{-noasmopt} option. This
+compiler option passes the option @option{-O0} to the assembler, to
+inhibit reordering.
+
+The @option{-noasmopt} option can be useful for testing whether a problem
+is due to erroneous assembler reordering. Even if a problem does not go
+away with @option{-noasmopt}, it may still be due to assembler
+reordering---perhaps GCC itself was miscompiled as a result.
+
+You may get the following warning on IRIX 4 platforms, it can be safely
+ignored.
+@example
+ warning: foo.o does not have gp tables for all its sections.
+@end example
+
+@html
+</p>
+<hr>
+@end html
+@heading @anchor{mips-sgi-irix5}mips-sgi-irix5
+
+This configuration has considerable problems, which will be fixed in a
+future release.
+
+In order to compile GCC on an SGI running IRIX 5, the ``compiler_dev.hdr''
+subsystem must be installed from the IDO CD-ROM supplied by Silicon
+Graphics. It is also available for download from
+@uref{http://www.sgi.com/developers/devtools/apis/ido.html,,http://www.sgi.com/developers/devtools/apis/ido.html}.
+
+@code{make compare} may fail on version 5 of IRIX unless you add
+@option{-save-temps} to @code{CFLAGS}. On these systems, the name of the
+assembler input file is stored in the object file, and that makes
+comparison fail if it differs between the @code{stage1} and
+@code{stage2} compilations. The option @option{-save-temps} forces a
+fixed name to be used for the assembler input file, instead of a
+randomly chosen name in @file{/tmp}. Do not add @option{-save-temps}
+unless the comparisons fail without that option. If you do you
+@option{-save-temps}, you will have to manually delete the @samp{.i} and
+@samp{.s} files after each series of compilations.
+
+If you use the MIPS C compiler to bootstrap, it may be necessary
+to increase its table size for switch statements with the
+@option{-Wf,-XNg1500} option. If you use the @option{-O2}
+optimization option, you also need to use @option{-Olimit 3000}.
+
+To enable debugging under IRIX 5, you must use GNU @command{as} 2.11.2
+or later,
+and use the @option{--with-gnu-as} configure option when configuring GCC.
+GNU @command{as} is distributed as part of the binutils package.
+When using release 2.11.2, you need to apply a patch
+@uref{http://sources.redhat.com/ml/binutils/2001-07/msg00352.html,,http://sources.redhat.com/ml/binutils/2001-07/msg00352.html}
+which will be included in the next release of binutils.
+
+When building GCC, the build process loops rebuilding @command{cc1} over
+and over again. This happens on @samp{mips-sgi-irix5.2}, and possibly
+other platforms. It has been reported that this is a known bug in the
+@command{make} shipped with IRIX 5.2. We recommend you use GNU
+@command{make} instead of the vendor supplied @command{make} program;
+however, you may have success with @command{smake} on IRIX 5.2 if you do
+not have GNU @command{make} available.
+
+@html
+</p>
+<hr>
+@end html
+@heading @anchor{mips-sgi-irix6}mips-sgi-irix6
+
+If you are using IRIX @command{cc} as your bootstrap compiler, you must
+ensure that the N32 ABI is in use. To test this, compile a simple C
+file with @command{cc} and then run @command{file} on the
+resulting object file. The output should look like:
+
+@example
+test.o: ELF N32 MSB @dots{}
+@end example
+
+If you see:
+
+@example
+test.o: ELF 32-bit MSB @dots{}
+@end example
+
+or
+
+@example
+test.o: ELF 64-bit MSB @dots{}
+@end example
+
+then your version of @command{cc} uses the O32 or N64 ABI by default. You
+should set the environment variable @env{CC} to @samp{cc -n32}
+before configuring GCC@.
+
+GCC on IRIX 6 is usually built to support both the N32 and N64 ABIs. If
+you build GCC on a system that doesn't have the N64 libraries installed,
+you need to configure with @option{--disable-multilib} so GCC doesn't
+try to use them. Look for @file{/usr/lib64/libc.so.1} to see if you
+have the 64-bit libraries installed.
+
+You must @emph{not} use GNU @command{as} (which isn't built anyway as of
+binutils 2.11.2) on IRIX 6 platforms; doing so will only cause problems.
+
+GCC does not currently support generating O32 ABI binaries in the
+@samp{mips-sgi-irix6} configurations. It is possible to create a GCC
+with O32 ABI only support by configuring it for the @samp{mips-sgi-irix5}
+target and using a patched GNU @command{as} 2.11.2 as documented in the
+@uref{#mips-sgi-irix5,,@samp{mips-sgi-irix5}} section above. Using the
+native assembler requires patches to GCC which will be included in a
+future release. It is
+expected that O32 ABI support will be available again in a future release.
+
+The @option{--enable-threads} option doesn't currently work, a patch is
+in preparation for a future release. The @option{--enable-libgcj}
+option is disabled by default: IRIX 6 uses a very low default limit
+(20480) for the command line length. Although libtool contains a
+workaround for this problem, at least the N64 @samp{libgcj} is known not
+to build despite this, running into an internal error of the native
+@command{ld}. A sure fix is to increase this limit (@samp{ncargs}) to
+its maximum of 262144 bytes. If you have root access, you can use the
+@command{systune} command to do this.
+
+GCC does not correctly pass/return structures which are
+smaller than 16 bytes and which are not 8 bytes. The problem is very
+involved and difficult to fix. It affects a number of other targets also,
+but IRIX 6 is affected the most, because it is a 64 bit target, and 4 byte
+structures are common. The exact problem is that structures are being padded
+at the wrong end, e.g.@: a 4 byte structure is loaded into the lower 4 bytes
+of the register when it should be loaded into the upper 4 bytes of the
+register.
+
+GCC is consistent with itself, but not consistent with the SGI C compiler
+(and the SGI supplied runtime libraries), so the only failures that can
+happen are when there are library functions that take/return such
+structures. There are very few such library functions. Currently this
+is known to affect @code{inet_ntoa}, @code{inet_lnaof},
+@code{inet_netof}, @code{inet_makeaddr}, and @code{semctl}. Until the
+bug is fixed, GCC contains workarounds for the known affected functions.
+
+See @uref{http://freeware.sgi.com/,,http://freeware.sgi.com/} for more
+information about using GCC on IRIX platforms.
+
+@html
+</p>
+<hr>
+@end html
+@heading @anchor{mips-sony-sysv}mips-sony-sysv
+Sony MIPS NEWS@. This works in NEWSOS 5.0.1, but not in 5.0.2 (which
+uses ELF instead of COFF)@. Support for 5.0.2 will probably be provided
+soon by volunteers. In particular, the linker does not like the
+code generated by GCC when shared libraries are linked in.
+
+
+@html
+</p>
+<hr>
+@end html
+@heading @anchor{ns32k-encore}ns32k-encore
+Encore ns32000 system. Encore systems are supported only under BSD@.
+
+@html
+</p>
+<hr>
+@end html
+@heading @anchor{ns32k-*-genix}ns32k-*-genix
+National Semiconductor ns32000 system. Genix has bugs in @code{alloca}
+and @code{malloc}; you must get the compiled versions of these from GNU
+Emacs.
+
+@html
+</p>
+<hr>
+@end html
+@heading @anchor{ns32k-sequent}ns32k-sequent
+Go to the Berkeley universe before compiling.
+
+@html
+</p>
+<hr>
+@end html
+@heading @anchor{ns32k-utek}ns32k-utek
+UTEK ns32000 system (``merlin''). The C compiler that comes with this
+system cannot compile GCC; contact @samp{tektronix!reed!mason} to get
+binaries of GCC for bootstrapping.
+
+
+@html
+</p>
+<hr>
+@end html
+@heading @anchor{powerpc*-*-*}powerpc-*-*
+
+You can specify a default version for the @option{-mcpu=@var{cpu_type}}
+switch by using the configure option @option{--with-cpu-@var{cpu_type}}.
+
+@html
+</p>
+<hr>
+@end html
+@heading @anchor{powerpc-*-elf}powerpc-*-elf, powerpc-*-sysv4
+PowerPC system in big endian mode, running System V.4.
+
+@html
+</p>
+<hr>
+@end html
+@heading @anchor{powerpc-*-linux-gnu*}powerpc-*-linux-gnu*
+
+You will need
+@uref{ftp://ftp.varesearch.com/pub/support/hjl/binutils,,binutils 2.9.4.0.8}
+or newer for a working GCC@. It is strongly recommended to recompile binutils
+if you initially built it with gcc-2.7.2.x.
+
+@html
+</p>
+<hr>
+@end html
+@heading @anchor{powerpc-*-netbsd*}powerpc-*-netbsd*
+PowerPC system in big endian mode running NetBSD@. To build the
+documentation you will need Texinfo version 4.0 (NetBSD 1.5.1 included
+Texinfo version 3.12).
+
+@html
+</p>
+<hr>
+@end html
+@heading @anchor{powerpc-*-eabiaix}powerpc-*-eabiaix
+Embedded PowerPC system in big endian mode with @option{-mcall-aix} selected as
+the default.
+
+@html
+</p>
+<hr>
+@end html
+@heading @anchor{powerpc-*-eabisim}powerpc-*-eabisim
+Embedded PowerPC system in big endian mode for use in running under the
+PSIM simulator.
+
+@html
+</p>
+<hr>
+@end html
+@heading @anchor{powerpc-*-eabi}powerpc-*-eabi
+Embedded PowerPC system in big endian mode.
+
+@html
+</p>
+<hr>
+@end html
+@heading @anchor{powerpcle-*-elf}powerpcle-*-elf, powerpcle-*-sysv4
+PowerPC system in little endian mode, running System V.4.
+
+@html
+</p>
+<hr>
+@end html
+@heading @anchor{powerpcle-*-eabisim}powerpcle-*-eabisim
+Embedded PowerPC system in little endian mode for use in running under
+the PSIM simulator.
+
+@html
+</p>
+<hr>
+@end html
+@heading @anchor{powerpcle-*-eabi}powerpcle-*-eabi
+Embedded PowerPC system in little endian mode.
+
+@html
+</p>
+<hr>
+@end html
+@heading @anchor{powerpcle-*-winnt}powerpcle-*-winnt, powerpcle-*-pe
+PowerPC system in little endian mode running Windows NT@.
+
+@html
+</p>
+<hr>
+@end html
+@heading @anchor{romp-*-aos}romp-*-aos, romp-*-mach
+The only operating systems supported for the IBM RT PC are AOS and
+MACH@. GCC does not support AIX running on the RT@. We recommend you
+compile GCC with an earlier version of itself; if you compile GCC
+with @command{hc}, the Metaware compiler, it will work, but you will get
+mismatches between the stage 2 and stage 3 compilers in various files.
+These errors are minor differences in some floating-point constants and
+can be safely ignored; the stage 3 compiler is correct.
+
+@html
+</p>
+<hr>
+@end html
+@heading @anchor{s390-*-linux*}s390-*-linux*
+IBM S/390 system running Linux for S/390.
+
+@html
+</p>
+<hr>
+@end html
+@heading @anchor{s390x-*-linux*}s390x-*-linux*
+IBM zSeries system (64 bit) running Linux for zSeries.
+
+@html
+</p>
+<hr>
+@end html
+@c Please use Solaris 2 to refer to all release of Solaris, starting
+@c with 2.0 until 2.6, 7, and 8. Solaris 1 was a marketing name for
+@c SunOS 4 releases which we don't use to avoid confusion. Solaris
+@c alone is too unspecific and must be avoided.
+@heading @anchor{*-*-solaris2*}*-*-solaris2*
+
+Sun does not ship a C compiler with Solaris 2. To bootstrap and install
+GCC you first have to install a pre-built compiler, see our
+@uref{binaries.html,,binaries page} for details.
+
+The Solaris 2 @command{/bin/sh} will often fail to configure
+@file{libstdc++-v3}, @file{boehm-gc} or
+@file{libjava}. If you encounter this problem, set @env{CONFIG_SHELL} to
+@command{/bin/ksh} in your environment and run @command{make bootstrap} again.
+Another possibility that sometimes helps is to remove
+@file{*-*-solaris2*/config.cache}.
+
+Solaris 2 comes with a number of optional OS packages. Some of these
+packages are needed to use GCC fully, namely @code{SUNWarc},
+@code{SUNWbtool}, @code{SUNWesu}, @code{SUNWhea}, @code{SUNWlibm},
+@code{SUNWsprot}, and @code{SUNWtoo}. If you did not install all
+optional packages when installing Solaris 2, you will need to verify that
+the packages that GCC needs are installed.
+
+To check whether an optional package is installed, use
+the @command{pkginfo} command. To add an optional package, use the
+@command{pkgadd} command. For further details, see the Solaris 2
+documentation.
+
+Trying to use the linker and other tools in
+@file{/usr/ucb} to install GCC has been observed to cause trouble.
+For example, the linker may hang indefinitely. The fix is to remove
+@file{/usr/ucb} from your @env{PATH}.
+
+All releases of GNU binutils prior to 2.11.2 have known bugs on this
+platform. We recommend the use of GNU binutils 2.11.2 or the vendor
+tools (Sun @command{as}, Sun @command{ld}).
+
+Sun bug 4296832 turns up when compiling X11 headers with GCC 2.95 or
+newer: @command{g++} will complain that types are missing. These headers assume
+that omitting the type means @code{int}; this assumption worked for C89 but
+is wrong for C++, and is now wrong for C99 also.
+
+@command{g++} accepts such (invalid) constructs with the option
+@option{-fpermissive}; it
+will assume that any missing type is @code{int} (as defined by C89).
+
+There are patches for Solaris 2.6 (105633-56 or newer for SPARC,
+106248-42 or newer for Intel), Solaris 7 (108376-21 or newer for SPARC,
+108377-20 for Intel), and Solaris 8 (108652-24 or newer for SPARC,
+108653-22 for Intel) that fix this bug.
+
+@html
+</p>
+<hr>
+@end html
+@heading @anchor{sparc-sun-solaris2*}sparc-sun-solaris2*
+
+Sun @command{as} 4.x is broken in that it cannot cope with long symbol names.
+A typical error message might look similar to the following:
+
+@samp{/usr/ccs/bin/as: "/var/tmp/ccMsw135.s", line 11041:
+error: can't compute value of an expression involving an external symbol.}
+
+This is Sun bug 4237974. This is fixed with patch 108908-02 for Solaris
+2.6 and has been fixed in later (5.x) versions of the assembler,
+starting with Solaris 7.
+
+Starting with Solaris 7, the operating system is capable of executing
+64-bit SPARC V9 binaries. GCC 3.0 doesn't properly support this yet.
+Although some patches or recipes to enable this support have been posted
+to various newsgroups and mailing lists, we recommend against using
+them, since the compiler may either crash or, worse, silently generate
+bad code. If you really need this capability now, you might try a CVS
+version of GCC 3.1, which will fully support this. If all you want is
+code tuned for the UltraSPARC CPU, you should try the
+@option{-mtune=ultrasparc} option instead, which should be safe from
+those bugs and produce code that, unlike full 64-bit code, can still run
+on non-UltraSPARC machines.
+
+@html
+</p>
+<hr>
+@end html
+@heading @anchor{sparc-sun-solaris2.7}sparc-sun-solaris2.7
+
+Sun patch 107058-01 (1999-01-13) for Solaris 7/SPARC triggers a bug in
+the dynamic linker. This problem (Sun bug 4210064) affects GCC 2.8
+and later, including all EGCS releases. Sun formerly recommended
+107058-01 for all Solaris 7 users, but around 1999-09-01 it started to
+recommend it only for people who use Sun's compilers.
+
+Here are some workarounds to this problem:
+@itemize @bullet
+@item
+Do not install Sun patch 107058-01 until after Sun releases a
+complete patch for bug 4210064. This is the simplest course to take,
+unless you must also use Sun's C compiler. Unfortunately 107058-01
+is preinstalled on some new Solaris 7-based hosts, so you may have to
+back it out.
+
+@item
+Copy the original, unpatched Solaris 7
+@command{/usr/ccs/bin/as} into
+@command{/usr/local/lib/gcc-lib/sparc-sun-solaris2.7/3.0/as},
+adjusting the latter name to fit your local conventions and software
+version numbers.
+
+@item
+Install Sun patch 106950-03 (1999-05-25) or later. Nobody with
+both 107058-01 and 106950-03 installed has reported the bug with GCC
+and Sun's dynamic linker. This last course of action is riskiest,
+for two reasons. First, you must install 106950 on all hosts that
+run code generated by GCC; it doesn't suffice to install it only on
+the hosts that run GCC itself. Second, Sun says that 106950-03 is
+only a partial fix for bug 4210064, but Sun doesn't know whether the
+partial fix is adequate for GCC@. Revision -08 or later should fix
+the bug. The current (as of 2001-09-24) revision is -14, and is included in
+the Solaris 7 Recommended Patch Cluster.
+@end itemize
+
+
+@html
+<p>
+<hr>
+@end html
+@heading @anchor{*-*-solaris2.8}*-*-solaris2.8
+
+The Solaris 8 linker fails to link some @samp{libjava} programs if
+previously-installed GCC java libraries already exist in the configured
+prefix. For this reason, @samp{libgcj} is disabled by default on Solaris 8.
+If you use GNU @command{ld}, or if you don't have a previously-installed @samp{libgcj} in
+the same prefix, use @option{--enable-libgcj} to build and install the
+Java libraries.
+
+@html
+<p>
+<hr>
+@end html
+@heading @anchor{sparc-sun-sunos4*}sparc-sun-sunos4*
+
+A bug in the SunOS 4 linker will cause it to crash when linking
+@option{-fPIC} compiled objects (and will therefore not allow you to build
+shared libraries).
+
+To fix this problem you can either use the most recent version of
+binutils or get the latest SunOS 4 linker patch (patch ID 100170-10)
+from Sun's patch site.
+
+Sometimes on a Sun 4 you may observe a crash in the program
+@command{genflags} or @command{genoutput} while building GCC. This is said to
+be due to a bug in @command{sh}. You can probably get around it by running
+@command{genflags} or @command{genoutput} manually and then retrying the
+@command{make}.
+
+@html
+</p>
+<hr>
+@end html
+@heading @anchor{sparc-unknown-linux-gnulibc1}sparc-unknown-linux-gnulibc1
+
+It has been reported that you might need
+@uref{ftp://ftp.yggdrasil.com/private/hjl,,binutils 2.8.1.0.23}
+for this platform, too.
+
+
+@html
+</p>
+<hr>
+@end html
+@heading @anchor{sparc-*-linux*}sparc-*-linux*
+
+GCC versions 3.0 and higher require binutils 2.11.2 and glibc 2.2.4
+or newer on this platform. All earlier binutils and glibc
+releases mishandled unaligned relocations on @code{sparc-*-*} targets.
+
+
+@html
+</p>
+<hr>
+@end html
+@heading @anchor{sparc64-*-*}sparc64-*-*
+
+GCC version 2.95 is not able to compile code correctly for
+@code{sparc64} targets. Users of the Linux kernel, at least,
+can use the @code{sparc32} program to start up a new shell
+invocation with an environment that causes @command{configure} to
+recognize (via @samp{uname -a}) the system as @samp{sparc-*-*} instead.
+
+
+@html
+</p>
+<hr>
+@end html
+@heading @anchor{#*-*-sysv*}*-*-sysv*
+On System V release 3, you may get this error message
+while linking:
+
+@smallexample
+ld fatal: failed to write symbol name @var{something}
+ in strings table for file @var{whatever}
+@end smallexample
+
+This probably indicates that the disk is full or your ulimit won't allow
+the file to be as large as it needs to be.
+
+This problem can also result because the kernel parameter @code{MAXUMEM}
+is too small. If so, you must regenerate the kernel and make the value
+much larger. The default value is reported to be 1024; a value of 32768
+is said to work. Smaller values may also work.
+
+On System V, if you get an error like this,
+
+@example
+/usr/local/lib/bison.simple: In function `yyparse':
+/usr/local/lib/bison.simple:625: virtual memory exhausted
+@end example
+
+@noindent
+that too indicates a problem with disk space, ulimit, or @code{MAXUMEM}.
+
+On a System V release 4 system, make sure @file{/usr/bin} precedes
+@file{/usr/ucb} in @code{PATH}. The @code{cc} command in
+@file{/usr/ucb} uses libraries which have bugs.
+
+@html
+</p>
+<hr>
+@end html
+@heading @anchor{vax-dec-ultrix}vax-dec-ultrix
+Don't try compiling with VAX C (@code{vcc}). It produces incorrect code
+in some cases (for example, when @code{alloca} is used).
+
+@html
+</p>
+<hr>
+@end html
+@heading @anchor{we32k-*-*}we32k-*-*
+These computers are also known as the 3b2, 3b5, 3b20 and other similar
+names. (However, the 3b1 is actually a 68000.)
+
+Don't use @option{-g} when compiling with the system's compiler. The
+system's linker seems to be unable to handle such a large program with
+debugging information.
+
+The system's compiler runs out of capacity when compiling @file{stmt.c}
+in GCC@. You can work around this by building @file{cpp} in GCC
+first, then use that instead of the system's preprocessor with the
+system's C compiler to compile @file{stmt.c}. Here is how:
+
+@smallexample
+mv /lib/cpp /lib/cpp.att
+cp cpp /lib/cpp.gnu
+echo '/lib/cpp.gnu -traditional $@{1+"$@@"@}' > /lib/cpp
+chmod +x /lib/cpp
+@end smallexample
+
+The system's compiler produces bad code for some of the GCC
+optimization files. So you must build the stage 2 compiler without
+optimization. Then build a stage 3 compiler with optimization.
+That executable should work. Here are the necessary commands:
+
+@smallexample
+make LANGUAGES=c CC=stage1/xgcc CFLAGS="-Bstage1/ -g"
+make stage2
+make CC=stage2/xgcc CFLAGS="-Bstage2/ -g -O"
+@end smallexample
+
+You may need to raise the ULIMIT setting to build a C++ compiler,
+as the file @file{cc1plus} is larger than one megabyte.
+
+@html
+</p>
+<hr>
+@end html
+@heading @anchor{xtensa-*-elf}xtensa-*-elf
+
+This target is intended for embedded Xtensa systems using the
+@samp{newlib} C library. It uses ELF but does not support shared
+objects. Designed-defined instructions specified via the
+Tensilica Instruction Extension (TIE) language are only supported
+through inline assembly.
+
+The Xtensa configuration information must be specified prior to
+building GCC@. The @file{gcc/config/xtensa/xtensa-config.h} header
+file contains the configuration information. If you created your
+own Xtensa configuration with the Xtensa Processor Generator, the
+downloaded files include a customized copy of this header file,
+which you can use to replace the default header file.
+
+@html
+</p>
+<hr>
+@end html
+@heading @anchor{xtensa-*-linux*}xtensa-*-linux*
+
+This target is for Xtensa systems running GNU/Linux. It supports ELF
+shared objects and the GNU C library (glibc). It also generates
+position-independent code (PIC) regardless of whether the
+@option{-fpic} or @option{-fPIC} options are used. In other
+respects, this target is the same as the
+@uref{#xtensa-*-elf,,@samp{xtensa-*-elf}} target.
+
+@html
+</p>
+<hr>
+@end html
+@heading @anchor{windows}Microsoft Windows (32 bit)
+
+A port of GCC 2.95.x is included with the
+@uref{http://www.cygwin.com/,,Cygwin environment}.
+
+Current (as of early 2001) snapshots of GCC will build under Cygwin
+without modification.
+
+@html
+</p>
+<hr>
+@end html
+@heading @anchor{os2}OS/2
+
+GCC does not currently support OS/2. However, Andrew Zabolotny has been
+working on a generic OS/2 port with pgcc. The current code can be found
+at @uref{http://www.goof.com/pcg/os2/,,http://www.goof.com/pcg/os2/}.
+
+An older copy of GCC 2.8.1 is included with the EMX tools available at
+@uref{ftp://ftp.leo.org/pub/comp/os/os2/leo/devtools/emx+gcc/,,
+ftp://ftp.leo.org/pub/comp/os/os2/leo/devtools/emx+gcc/}.
+
+@html
+</p>
+<hr>
+@end html
+@heading @anchor{older}Older systems
+
+GCC contains support files for many older (1980s and early
+1990s) Unix variants. For the most part, support for these systems
+has not been deliberately removed, but it has not been maintained for
+several years and may suffer from bitrot. Support from some systems
+has been removed from GCC 3: fx80, ns32-ns-genix, pyramid, tahoe,
+gmicro, spur; most of these targets had not been updated since GCC
+version 1.
+
+Support for older systems as targets for cross-compilation is less
+problematic than support for them as hosts for GCC; if an enthusiast
+wishes to make such a target work again (including resurrecting any
+of the targets that never worked with GCC 2, starting from the last
+CVS version before they were removed), patches
+@uref{../contribute.html,,following the usual requirements}
+would be likely to be accepted, since they should not affect the
+support for more modern targets.
+
+Support for old systems as hosts for GCC can cause problems if the
+workarounds for compiler, library and operating system bugs affect the
+cleanliness or maintainability of the rest of GCC@. In some cases, to
+bring GCC up on such a system, if still possible with current GCC, may
+require first installing an old version of GCC which did work on that
+system, and using it to compile a more recent GCC, to avoid bugs in
+the vendor compiler. Old releases of GCC 1 and GCC 2 are available in
+the @file{old-releases} directory on the
+@uref{../mirrors.html,,GCC mirror sites}. Header bugs may generally
+be avoided using @command{fixincludes}, but bugs or deficiencies in
+libraries and the operating system may still cause problems.
+
+For some systems, old versions of GNU binutils may also be useful,
+and are available from @file{pub/binutils/old-releases} on
+@uref{http://sources.redhat.com/mirrors.html,,sources.redhat.com mirror sites}.
+
+Some of the information on specific systems above relates to
+such older systems, but much of the information
+about GCC on such systems (which may no longer be applicable to
+current GCC) is to be found in the GCC texinfo manual.
+
+@html
+</p>
+<hr>
+@end html
+@heading @anchor{elf_targets}all ELF targets (SVR4, Solaris 2, etc.)
+
+C++ support is significantly better on ELF targets if you use the
+@uref{./configure.html#with-gnu-ld,,GNU linker}; duplicate copies of
+inlines, vtables and template instantiations will be discarded
+automatically.
+
+
+@html
+</p>
+<hr>
+<p>
+@end html
+@ifhtml
+@uref{./index.html,,Return to the GCC Installation page}
+@end ifhtml
+@end ifset
+
+@c ***GFDL********************************************************************
+@ifset gfdlhtml
+@include fdl.texi
+@html
+</p>
+<hr>
+<p>
+@end html
+@ifhtml
+@uref{./index.html,,Return to the GCC Installation page}
+@end ifhtml
+@end ifset
+
+@c ***************************************************************************
+@c Part 6 The End of the Document
+@ifinfo
+@comment node-name, next, previous, up
+@node Concept Index, , GNU Free Documentation License, Top
+@end ifinfo
+
+@ifinfo
+@unnumbered Concept Index
+
+@printindex cp
+
+@contents
+@end ifinfo
+@bye
diff --git a/gcc/doc/install.texi2html b/gcc/doc/install.texi2html
new file mode 100755
index 00000000000..946a45a0b53
--- /dev/null
+++ b/gcc/doc/install.texi2html
@@ -0,0 +1,30 @@
+#!/bin/sh
+#
+# Convert the GCC install documentation from texinfo format to HTML.
+#
+# $SOURCEDIR and $DESTDIR, resp., refer to the directory containing
+# the texinfo source and the directory to put the HTML version in.
+#
+# (C) 2001 Free Software Foundation
+# Originally by Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>, June 2001.
+#
+# This script is Free Software, and it can be copied, distributed and
+# modified as defined in the GNU General Public License. A copy of
+# its license can be downloaded from http://www.gnu.org/copyleft/gpl.html
+
+SOURCEDIR=${SOURCEDIR-.}
+DESTDIR=${DESTDIR-HTML}
+
+MAKEINFO=${MAKEINFO-makeinfo}
+
+if [ ! -d $DESTDIR ]; then
+ mkdir -p $DESTDIR
+fi
+
+for x in index.html specific.html download.html configure.html \
+ build.html test.html finalinstall.html binaries.html gfdl.html
+do
+ define=`echo $x | sed -e 's/\.//g'`
+ echo "define = $define"
+ $MAKEINFO -I $SOURCEDIR/include $SOURCEDIR/install.texi --html --no-split -D$define -o$DESTDIR/$x
+done
diff --git a/gcc/invoke.texi b/gcc/doc/invoke.texi
index 8052be177ec..437acacfd92 100644
--- a/gcc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -1,4 +1,5 @@
-@c Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+@c Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+@c 2000, 2001 Free Software Foundation, Inc.
@c This is part of the GCC manual.
@c For copying conditions, see the file gcc.texi.
@@ -7,37 +8,41 @@
Copyright @copyright{} 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997,
1998, 1999, 2000, 2001 Free Software Foundation, Inc.
-Permission is granted to make and distribute verbatim copies of this
-manual provided the copyright notice and this permission notice are
-preserved on all copies.
+Permission is granted to copy, distribute and/or modify this document
+under the terms of the GNU Free Documentation License, Version 1.1 or
+any later version published by the Free Software Foundation; with the
+Invariant Sections being ``GNU General Public License'' and ``Funding
+Free Software'', the Front-Cover texts being (a) (see below), and with
+the Back-Cover Texts being (b) (see below). A copy of the license is
+included in the gfdl(7) man page.
-Permission is granted to copy and distribute modified versions of this
-manual under the conditions for verbatim copying, provided also that the
-entire resulting derived work is distributed under the terms of a
-permission notice identical to this one.
+(a) The FSF's Front-Cover Text is:
-Permission is granted to copy and distribute translations of this manual
-into another language, under the above conditions for modified versions,
-except that this permission notice may be included in translations
-approved by the Free Software Foundation instead of in the original
-English.
+ A GNU Manual
+
+(b) The FSF's Back-Cover Text is:
+
+ You have freedom to copy and modify this GNU Manual, like GNU
+ software. Copies published by the Free Software Foundation raise
+ funds for GNU development.
@c man end
@c Set file name and title for the man page.
@setfilename gcc
@settitle GNU project C and C++ compiler
@c man begin SYNOPSIS
-gcc [@samp{-c}|@samp{-S}|@samp{-E}] [@samp{-std=}@var{standard}]
- [@samp{-g}] [@samp{-pg}] [@samp{-O}@var{level}]
- [@samp{-W}@var{warn}...] [@samp{-pedantic}]
- [@samp{-I}@var{dir}...] [@samp{-L}@var{dir}...]
- [@samp{-D}@var{macro}[=@var{defn}]...] [@samp{-U}@var{macro}]
- [@samp{-f}@var{option}...] [@samp{-m}@var{machine-option}...]
- [@samp{-o} @var{outfile}] @var{infile}...
+gcc [@option{-c}|@option{-S}|@option{-E}] [@option{-std=}@var{standard}]
+ [@option{-g}] [@option{-pg}] [@option{-O}@var{level}]
+ [@option{-W}@var{warn}@dots{}] [@option{-pedantic}]
+ [@option{-I}@var{dir}@dots{}] [@option{-L}@var{dir}@dots{}]
+ [@option{-D}@var{macro}[=@var{defn}]@dots{}] [@option{-U}@var{macro}]
+ [@option{-f}@var{option}@dots{}] [@option{-m}@var{machine-option}@dots{}]
+ [@option{-o} @var{outfile}] @var{infile}@dots{}
Only the most useful options are listed here; see below for the
remainder. @samp{g++} accepts mostly the same options as @samp{gcc}.
@c man end
@c man begin SEEALSO
+gpl(7), gfdl(7), fsf-funding(7),
cpp(1), gcov(1), g77(1), as(1), ld(1), gdb(1), adb(1), dbx(1), sdb(1)
and the Info entries for @file{gcc}, @file{cpp}, @file{g77}, @file{as},
@file{ld}, @file{binutils} and @file{gdb}.
@@ -48,8 +53,9 @@ For instructions on reporting bugs, see
script to report bugs is recommended.
@c man end
@c man begin AUTHOR
-See the Info entry for @file{gcc}, or
-@w{@uref{http://gcc.gnu.org/thanks.html}}, for contributors to GCC.
+See the Info entry for @command{gcc}, or
+@w{@uref{http://gcc.gnu.org/onlinedocs/gcc/Contributors.html}},
+for contributors to GCC@.
@c man end
@end ignore
@@ -63,7 +69,7 @@ See the Info entry for @file{gcc}, or
When you invoke GCC, it normally does preprocessing, compilation,
assembly and linking. The ``overall options'' allow you to stop this
-process at an intermediate stage. For example, the @samp{-c} option
+process at an intermediate stage. For example, the @option{-c} option
says not to run the linker. Then the output consists of object files
output by the assembler.
@@ -87,25 +93,27 @@ options for compiling C++ programs.
@cindex options, grouping
The @command{gcc} program accepts options and file names as operands. Many
options have multi-letter names; therefore multiple single-letter options
-may @emph{not} be grouped: @samp{-dr} is very different from @w{@samp{-d
+may @emph{not} be grouped: @option{-dr} is very different from @w{@samp{-d
-r}}.
@cindex order of options
@cindex options, order
You can mix options and other arguments. For the most part, the order
you use doesn't matter. Order does matter when you use several options
-of the same kind; for example, if you specify @samp{-L} more than once,
+of the same kind; for example, if you specify @option{-L} more than once,
the directories are searched in the order specified.
Many options have long names starting with @samp{-f} or with
-@samp{-W}---for example, @samp{-fforce-mem},
-@samp{-fstrength-reduce}, @samp{-Wformat} and so on. Most of
+@samp{-W}---for example, @option{-fforce-mem},
+@option{-fstrength-reduce}, @option{-Wformat} and so on. Most of
these have both positive and negative forms; the negative form of
-@samp{-ffoo} would be @samp{-fno-foo}. This manual documents
+@option{-ffoo} would be @option{-fno-foo}. This manual documents
only one of these two forms, whichever one is not the default.
@c man end
+@xref{Option Index}, for an index to GCC's options.
+
@menu
* Option Summary:: Brief list of all options, without explanations.
* Overall Options:: Controlling the kind of output:
@@ -114,8 +122,9 @@ only one of these two forms, whichever one is not the default.
* Invoking G++:: Compiling C++ programs.
* C Dialect Options:: Controlling the variant of C language compiled.
* C++ Dialect Options:: Variations on C++.
+* Objective-C Dialect Options:: Variations on Objective-C.
* Language Independent Options:: Controlling how diagnostics should be
- formatted.
+ formatted.
* Warning Options:: How picky should the compiler be?
* Debugging Options:: Symbol tables, measurements, and debugging dumps.
* Optimize Options:: How much optimization?
@@ -153,7 +162,8 @@ in the following sections.
@item C Language Options
@xref{C Dialect Options,,Options Controlling C Dialect}.
@gccoptlist{
--ansi -std=@var{standard} -fno-asm -fno-builtin @gol
+-ansi -std=@var{standard} -aux-info @var{filename} @gol
+-fno-asm -fno-builtin @gol
-fhosted -ffreestanding @gol
-trigraphs -traditional -traditional-cpp @gol
-fallow-single-precision -fcond-mismatch @gol
@@ -165,17 +175,18 @@ in the following sections.
@xref{C++ Dialect Options,,Options Controlling C++ Dialect}.
@gccoptlist{
-fno-access-control -fcheck-new -fconserve-space @gol
--fdollars-in-identifiers -fno-elide-constructors @gol
+-fno-const-strings -fdollars-in-identifiers @gol
+-fno-elide-constructors @gol
-fno-enforce-eh-specs -fexternal-templates @gol
-falt-external-templates @gol
--ffor-scope -fno-for-scope -fno-gnu-keywords -fhonor-std @gol
--fhuge-objects -fno-implicit-templates @gol
+-ffor-scope -fno-for-scope -fno-gnu-keywords @gol
+-fno-implicit-templates @gol
-fno-implicit-inline-templates @gol
-fno-implement-inlines -fms-extensions @gol
--fname-mangling-version-@var{n} -fno-operator-names @gol
+-fno-nonansi-builtins -fno-operator-names @gol
-fno-optional-diags -fpermissive @gol
--frepo -fno-rtti -fsquangle -ftemplate-depth-@var{n} @gol
--fuse-cxa-atexit -fvtable-thunks -nostdinc++ @gol
+-frepo -fno-rtti -fstats -ftemplate-depth-@var{n} @gol
+-fuse-cxa-atexit -fno-weak -nostdinc++ @gol
-fno-default-inline -Wctor-dtor-privacy @gol
-Wnon-virtual-dtor -Wreorder @gol
-Weffc++ -Wno-deprecated @gol
@@ -183,6 +194,13 @@ in the following sections.
-Woverloaded-virtual -Wno-pmf-conversions @gol
-Wsign-promo -Wsynth}
+@item Objective-C Language Options
+@xref{Objective-C Dialect Options,,Options Controlling Objective-C Dialect}.
+@gccoptlist{
+-fconstant-string-class=@var{class-name} @gol
+-fgnu-runtime -fnext-runtime -gen-decls @gol
+-Wno-protocol -Wselector}
+
@item Language Independent Options
@xref{Language Independent Options,,Options to Control Diagnostic Messages Formatting}.
@gccoptlist{
@@ -197,17 +215,17 @@ in the following sections.
-Wcast-align -Wcast-qual -Wchar-subscripts -Wcomment @gol
-Wconversion -Wdisabled-optimization -Werror @gol
-Wfloat-equal -Wformat -Wformat=2 @gol
--Wformat-nonliteral -Wformat-security @gol
--Wid-clash-@var{len} -Wimplicit -Wimplicit-int @gol
+-Wformat-nonliteral -Wformat-security @gol
+-Wid-clash-@var{len} -Wimplicit -Wimplicit-int @gol
-Wimplicit-function-declaration @gol
-Werror-implicit-function-declaration @gol
-Wimport -Winline @gol
-Wlarger-than-@var{len} -Wlong-long @gol
--Wmain -Wmissing-declarations @gol
+-Wmain -Wmissing-braces -Wmissing-declarations @gol
-Wmissing-format-attribute -Wmissing-noreturn @gol
-Wmultichar -Wno-format-extra-args -Wno-format-y2k @gol
-Wno-import -Wpacked -Wpadded @gol
--Wparentheses -Wpointer-arith -Wredundant-decls @gol
+-Wparentheses -Wpointer-arith -Wredundant-decls @gol
-Wreturn-type -Wsequence-point -Wshadow @gol
-Wsign-compare -Wswitch -Wsystem-headers @gol
-Wtrigraphs -Wundef -Wuninitialized @gol
@@ -217,17 +235,22 @@ in the following sections.
@item C-only Warning Options
@gccoptlist{
--Wbad-function-cast -Wmissing-prototypes -Wnested-externs @gol
--Wstrict-prototypes -Wtraditional}
+-Wbad-function-cast -Wmissing-prototypes -Wnested-externs @gol
+-Wstrict-prototypes -Wtraditional}
@item Debugging Options
@xref{Debugging Options,,Options for Debugging Your Program or GCC}.
@gccoptlist{
--a -ax -d@var{letters} -fdump-unnumbered -fdump-translation-unit=@var{file} @gol
--fdump-class-layout=@var{file} -fpretend-float -fprofile-arcs -ftest-coverage @gol
+-a -ax -d@var{letters} -dumpspecs -dumpmachine -dumpversion @gol
+-fdump-unnumbered -fdump-translation-unit@r{[}-@var{n}@r{]} @gol
+-fdump-class-hierarchy@r{[}-@var{n}@r{]} @gol
+-fdump-ast-original@r{[}-@var{n}@r{]} -fdump-ast-optimized@r{[}-@var{n}@r{]} @gol
+-fmem-report -fpretend-float @gol
+-fprofile-arcs -ftest-coverage -ftime-report @gol
-g -g@var{level} -gcoff -gdwarf -gdwarf-1 -gdwarf-1+ -gdwarf-2 @gol
-ggdb -gstabs -gstabs+ -gxcoff -gxcoff+ @gol
-p -pg -print-file-name=@var{library} -print-libgcc-file-name @gol
+-print-multi-directory -print-multi-lib @gol
-print-prog-name=@var{program} -print-search-dirs -Q @gol
-save-temps -time}
@@ -244,8 +267,8 @@ in the following sections.
-finline-functions -finline-limit=@var{n} -fkeep-inline-functions @gol
-fkeep-static-consts -fmove-all-movables @gol
-fno-default-inline -fno-defer-pop @gol
--fno-function-cse -fno-guess-branch-probability
--fno-inline -fno-math-errno -fno-peephole @gol
+-fno-function-cse -fno-guess-branch-probability @gol
+-fno-inline -fno-math-errno -fno-peephole -fno-peephole2 @gol
-fomit-frame-pointer -foptimize-register-move @gol
-foptimize-sibling-calls -freduce-all-givs @gol
-fregmove -frename-registers @gol
@@ -254,6 +277,7 @@ in the following sections.
-fsingle-precision-constant -fssa @gol
-fstrength-reduce -fstrict-aliasing -fthread-jumps -ftrapv @gol
-funroll-all-loops -funroll-loops @gol
+--param @var{name}=@var{value}
-O -O0 -O1 -O2 -O3 -Os}
@item Preprocessor Options
@@ -265,14 +289,14 @@ in the following sections.
-idirafter @var{dir} @gol
-include @var{file} -imacros @var{file} @gol
-iprefix @var{file} -iwithprefix @var{dir} @gol
--iwithprefixbefore @var{dir} -isystem @var{dir} -isystem-c++ @var{dir} @gol
+-iwithprefixbefore @var{dir} -isystem @var{dir} @gol
-M -MM -MF -MG -MP -MQ -MT -nostdinc -P -remap @gol
--trigraphs -undef -U@var{macro} -Wp\,@var{option}}
+-trigraphs -undef -U@var{macro} -Wp,@var{option}}
@item Assembler Option
@xref{Assembler Options,,Passing Options to the Assembler}.
@gccoptlist{
--Wa\,@var{option}}
+-Wa,@var{option}}
@item Linker Options
@xref{Link Options,,Options for Linking}.
@@ -280,7 +304,7 @@ in the following sections.
@var{object-file-name} -l@var{library} @gol
-nostartfiles -nodefaultlibs -nostdlib @gol
-s -static -static-libgcc -shared -shared-libgcc -symbolic @gol
--Wl\,@var{option} -Xlinker @var{option} @gol
+-Wl,@var{option} -Xlinker @var{option} @gol
-u @var{symbol}}
@item Directory Options
@@ -300,8 +324,8 @@ in the following sections.
@gccoptlist{
-m68000 -m68020 -m68020-40 -m68020-60 -m68030 -m68040 @gol
-m68060 -mcpu32 -m5200 -m68881 -mbitfield -mc68000 -mc68020 @gol
--mfpa -mnobitfield -mrtd -mshort -msoft-float -mpcrel @gol
--malign-int -mstrict-align}
+-mfpa -mnobitfield -mrtd -mshort -msoft-float -mpcrel @gol
+-malign-int -mstrict-align}
@emph{M68hc1x Options}
@gccoptlist{
@@ -314,16 +338,16 @@ in the following sections.
@emph{SPARC Options}
@gccoptlist{
--mcpu=@var{cpu type} @gol
--mtune=@var{cpu type} @gol
--mcmodel=@var{code model} @gol
+-mcpu=@var{cpu-type} @gol
+-mtune=@var{cpu-type} @gol
+-mcmodel=@var{code-model} @gol
-m32 -m64 @gol
-mapp-regs -mbroken-saverestore -mcypress @gol
--mepilogue -mfaster-structs -mflat @gol
+-mepilogue -mfaster-structs -mflat @gol
-mfpu -mhard-float -mhard-quad-float @gol
-mimpure-text -mlive-g0 -mno-app-regs @gol
--mno-epilogue -mno-faster-structs -mno-flat -mno-fpu @gol
--mno-impure-text -mno-stack-bias -mno-unaligned-doubles @gol
+-mno-epilogue -mno-faster-structs -mno-flat -mno-fpu @gol
+-mno-impure-text -mno-stack-bias -mno-unaligned-doubles @gol
-msoft-float -msoft-quad-float -msparclite -mstack-bias @gol
-msupersparc -munaligned-doubles -mv8}
@@ -345,37 +369,28 @@ in the following sections.
@emph{ARM Options}
@gccoptlist{
--mapcs-frame -mno-apcs-frame @gol
--mapcs-26 -mapcs-32 @gol
--mapcs-stack-check -mno-apcs-stack-check @gol
--mapcs-float -mno-apcs-float @gol
--mapcs-reentrant -mno-apcs-reentrant @gol
--msched-prolog -mno-sched-prolog @gol
--mlittle-endian -mbig-endian -mwords-little-endian @gol
--malignment-traps -mno-alignment-traps @gol
--msoft-float -mhard-float -mfpe @gol
--mthumb-interwork -mno-thumb-interwork @gol
--mcpu= -march= -mfpe= @gol
--mstructure-size-boundary= @gol
--mbsd -mxopen -mno-symrename @gol
+-mapcs-frame -mno-apcs-frame @gol
+-mapcs-26 -mapcs-32 @gol
+-mapcs-stack-check -mno-apcs-stack-check @gol
+-mapcs-float -mno-apcs-float @gol
+-mapcs-reentrant -mno-apcs-reentrant @gol
+-msched-prolog -mno-sched-prolog @gol
+-mlittle-endian -mbig-endian -mwords-little-endian @gol
+-malignment-traps -mno-alignment-traps @gol
+-msoft-float -mhard-float -mfpe @gol
+-mthumb-interwork -mno-thumb-interwork @gol
+-mcpu=@var{name} -march=@var{name} -mfpe=@var{name} @gol
+-mstructure-size-boundary=@var{n} @gol
+-mbsd -mxopen -mno-symrename @gol
-mabort-on-noreturn @gol
--mlong-calls -mno-long-calls @gol
--mnop-fun-dllimport -mno-nop-fun-dllimport @gol
--msingle-pic-base -mno-single-pic-base @gol
--mpic-register=}
-
-@emph{Thumb Options}
-@gccoptlist{
--mtpcs-frame -mno-tpcs-frame @gol
--mtpcs-leaf-frame -mno-tpcs-leaf-frame @gol
--mlittle-endian -mbig-endian @gol
--mthumb-interwork -mno-thumb-interwork @gol
--mstructure-size-boundary= @gol
--mnop-fun-dllimport -mno-nop-fun-dllimport @gol
--mcallee-super-interworking -mno-callee-super-interworking @gol
--mcaller-super-interworking -mno-caller-super-interworking @gol
--msingle-pic-base -mno-single-pic-base @gol
--mpic-register=}
+-mlong-calls -mno-long-calls @gol
+-msingle-pic-base -mno-single-pic-base @gol
+-mpic-register=@var{reg} @gol
+-mnop-fun-dllimport @gol
+-mpoke-function-name @gol
+-mthumb -marm @gol
+-mtpcs-frame -mtpcs-leaf-frame @gol
+-mcaller-super-interworking -mcallee-super-interworking }
@emph{MN10200 Options}
@gccoptlist{
@@ -383,15 +398,13 @@ in the following sections.
@emph{MN10300 Options}
@gccoptlist{
--mmult-bug @gol
--mno-mult-bug @gol
--mam33 @gol
--mno-am33 @gol
--mrelax}
+-mmult-bug -mno-mult-bug @gol
+-mam33 -mno-am33 @gol
+-mno-crt0 -mrelax}
@emph{M32R/D Options}
@gccoptlist{
--mcode-model=@var{model type} -msdata=@var{sdata type} @gol
+-mcode-model=@var{model-type} -msdata=@var{sdata-type} @gol
-G @var{num}}
@emph{M88K Options}
@@ -409,8 +422,8 @@ in the following sections.
@emph{RS/6000 and PowerPC Options}
@gccoptlist{
--mcpu=@var{cpu type} @gol
--mtune=@var{cpu type} @gol
+-mcpu=@var{cpu-type} @gol
+-mtune=@var{cpu-type} @gol
-mpower -mno-power -mpower2 -mno-power2 @gol
-mpowerpc -mpowerpc64 -mno-powerpc @gol
-mpowerpc-gpopt -mno-powerpc-gpopt @gol
@@ -424,7 +437,7 @@ in the following sections.
-mstrict-align -mno-strict-align -mrelocatable @gol
-mno-relocatable -mrelocatable-lib -mno-relocatable-lib @gol
-mtoc -mno-toc -mlittle -mlittle-endian -mbig -mbig-endian @gol
--mcall-aix -mcall-sysv -mprototype -mno-prototype @gol
+-mcall-aix -mcall-sysv -mcall-netbsd -mprototype -mno-prototype @gol
-msim -mmvme -mads -myellowknife -memb -msdata @gol
-msdata=@var{opt} -mvxworks -G @var{num}}
@@ -436,50 +449,50 @@ in the following sections.
@emph{MIPS Options}
@gccoptlist{
--mabicalls -mcpu=@var{cpu type}
+-mabicalls -mcpu=@var{cpu-type} @gol
-membedded-data -muninit-const-in-rodata @gol
-membedded-pic -mfp32 -mfp64 -mgas -mgp32 -mgp64 @gol
-mgpopt -mhalf-pic -mhard-float -mint64 -mips1 @gol
--mips2 -mips3 -mips4 -mlong64 -mlong32 -mlong-calls -mmemcpy @gol
+-mips2 -mips3 -mips4 -mlong64 -mlong32 -mlong-calls -mmemcpy @gol
-mmips-as -mmips-tfile -mno-abicalls @gol
--mno-embedded-data -mno-uninit-const-in-rodata -mno-embedded-pic @gol
--mno-gpopt -mno-long-calls @gol
+-mno-embedded-data -mno-uninit-const-in-rodata @gol
+-mno-embedded-pic -mno-gpopt -mno-long-calls @gol
-mno-memcpy -mno-mips-tfile -mno-rnames -mno-stats @gol
-mrnames -msoft-float @gol
-m4650 -msingle-float -mmad @gol
-mstats -EL -EB -G @var{num} -nocpp @gol
--mabi=32 -mabi=n32 -mabi=64 -mabi=eabi @gol
--mfix7000 -mno-crt0}
+-mabi=32 -mabi=n32 -mabi=64 -mabi=eabi @gol
+-mfix7000 -mno-crt0}
@emph{i386 Options}
@gccoptlist{
--mcpu=@var{cpu type} -march=@var{cpu type} @gol
+-mcpu=@var{cpu-type} -march=@var{cpu-type} @gol
-mintel-syntax -mieee-fp -mno-fancy-math-387 @gol
-mno-fp-ret-in-387 -msoft-float -msvr3-shlib @gol
-mno-wide-multiply -mrtd -malign-double @gol
-mreg-alloc=@var{list} -mregparm=@var{num} @gol
-malign-jumps=@var{num} -malign-loops=@var{num} @gol
--malign-functions=@var{num} -mpreferred-stack-boundary=@var{num} @gol
--mthreads -mno-align-stringops -minline-all-stringops @gol
--mpush-args -maccumulate-outgoing-args -m128bit-long-double @gol
--m96bit-long-double}
+-malign-functions=@var{num} -mpreferred-stack-boundary=@var{num} @gol
+-mthreads -mno-align-stringops -minline-all-stringops @gol
+-mpush-args -maccumulate-outgoing-args -m128bit-long-double @gol
+-m96bit-long-double -momit-leaf-frame-pointer}
@emph{HPPA Options}
@gccoptlist{
--march=@var{architecture type} @gol
--mbig-switch -mdisable-fpregs -mdisable-indexing @gol
--mfast-indirect-calls -mgas -mjump-in-delay @gol
+-march=@var{architecture-type} @gol
+-mbig-switch -mdisable-fpregs -mdisable-indexing @gol
+-mfast-indirect-calls -mgas -mjump-in-delay @gol
-mlong-load-store -mno-big-switch -mno-disable-fpregs @gol
-mno-disable-indexing -mno-fast-indirect-calls -mno-gas @gol
--mno-jump-in-delay -mno-long-load-store @gol
+-mno-jump-in-delay -mno-long-load-store @gol
-mno-portable-runtime -mno-soft-float @gol
--mno-space-regs -msoft-float -mpa-risc-1-0 @gol
+-mno-space-regs -msoft-float -mpa-risc-1-0 @gol
-mpa-risc-1-1 -mpa-risc-2-0 -mportable-runtime @gol
--mschedule=@var{cpu type} -mspace-regs}
+-mschedule=@var{cpu-type} -mspace-regs}
@emph{Intel 960 Options}
@gccoptlist{
--m@var{cpu type} -masm-compat -mclean-linkage @gol
+-m@var{cpu-type} -masm-compat -mclean-linkage @gol
-mcode-align -mcomplex-addr -mleaf-procedures @gol
-mic-compat -mic2.0-compat -mic3.0-compat @gol
-mintel-asm -mno-clean-linkage -mno-code-align @gol
@@ -490,13 +503,13 @@ in the following sections.
@emph{DEC Alpha Options}
@gccoptlist{
--mfp-regs -mno-fp-regs -mno-soft-float -msoft-float @gol
--malpha-as -mgas @gol
+-mfp-regs -mno-fp-regs -mno-soft-float -msoft-float @gol
+-malpha-as -mgas @gol
-mieee -mieee-with-inexact -mieee-conformant @gol
-mfp-trap-mode=@var{mode} -mfp-rounding-mode=@var{mode} @gol
-mtrap-precision=@var{mode} -mbuild-constants @gol
--mcpu=@var{cpu type} @gol
--mbwx -mno-bwx -mcix -mno-cix -mmax -mno-max @gol
+-mcpu=@var{cpu-type} @gol
+-mbwx -mno-bwx -mcix -mno-cix -mmax -mno-max @gol
-mmemory-latency=@var{time}}
@emph{Clipper Options}
@@ -505,7 +518,7 @@ in the following sections.
@emph{H8/300 Options}
@gccoptlist{
--mrelax -mh -ms -mint32 -malign-300}
+-mrelax -mh -ms -mint32 -malign-300}
@emph{SH Options}
@gccoptlist{
@@ -513,77 +526,102 @@ in the following sections.
-m4-nofpu -m4-single-only -m4-single -m4 @gol
-mb -ml -mdalign -mrelax @gol
-mbigtable -mfmovd -mhitachi -mnomacsave @gol
--misize -mpadstruct -mspace @gol
--mprefergot
--musermode}
+-mieee -misize -mpadstruct -mspace @gol
+-mprefergot -musermode}
@emph{System V Options}
@gccoptlist{
--Qy -Qn -YP\,@var{paths} -Ym\,@var{dir}}
+-Qy -Qn -YP,@var{paths} -Ym,@var{dir}}
@emph{ARC Options}
@gccoptlist{
-EB -EL @gol
--mmangle-cpu -mcpu=@var{cpu} -mtext=@var{text section} @gol
--mdata=@var{data section} -mrodata=@var{readonly data section}}
+-mmangle-cpu -mcpu=@var{cpu} -mtext=@var{text-section} @gol
+-mdata=@var{data-section} -mrodata=@var{readonly-data-section}}
@emph{TMS320C3x/C4x Options}
@gccoptlist{
--mcpu=@var{cpu} -mbig -msmall -mregparm -mmemparm @gol
--mfast-fix -mmpyi -mbk -mti -mdp-isr-reload @gol
--mrpts=@var{count} -mrptb -mdb -mloop-unsigned @gol
--mparallel-insns -mparallel-mpy -mpreserve-float}
+-mcpu=@var{cpu} -mbig -msmall -mregparm -mmemparm @gol
+-mfast-fix -mmpyi -mbk -mti -mdp-isr-reload @gol
+-mrpts=@var{count} -mrptb -mdb -mloop-unsigned @gol
+-mparallel-insns -mparallel-mpy -mpreserve-float}
@emph{V850 Options}
@gccoptlist{
--mlong-calls -mno-long-calls -mep -mno-ep @gol
--mprolog-function -mno-prolog-function -mspace @gol
--mtda=@var{n} -msda=@var{n} -mzda=@var{n} @gol
--mv850 -mbig-switch}
+-mlong-calls -mno-long-calls -mep -mno-ep @gol
+-mprolog-function -mno-prolog-function -mspace @gol
+-mtda=@var{n} -msda=@var{n} -mzda=@var{n} @gol
+-mv850 -mbig-switch}
@emph{NS32K Options}
@gccoptlist{
--m32032 -m32332 -m32532 -m32081 -m32381 -mmult-add -mnomult-add @gol
--msoft-float -mrtd -mnortd -mregparam -mnoregparam -msb -mnosb @gol
--mbitfield -mnobitfield -mhimem -mnohimem}
+-m32032 -m32332 -m32532 -m32081 -m32381 @gol
+-mmult-add -mnomult-add -msoft-float -mrtd -mnortd @gol
+-mregparam -mnoregparam -msb -mnosb @gol
+-mbitfield -mnobitfield -mhimem -mnohimem}
@emph{AVR Options}
@gccoptlist{
--mmcu=@var{mcu} -msize -minit-stack=@var{n} -mno-interrupts @gol
--mcall-prologues -mno-tablejump -mtiny-stack}
+-mmcu=@var{mcu} -msize -minit-stack=@var{n} -mno-interrupts @gol
+-mcall-prologues -mno-tablejump -mtiny-stack}
@emph{MCore Options}
@gccoptlist{
--mhardlit -mno-hardlit -mdiv -mno-div -mrelax-immediates @gol
--mno-relax-immediates -mwide-bitfields -mno-wide-bitfields @gol
--m4byte-functions -mno-4byte-functions -mcallgraph-data @gol
--mno-callgraph-data -mslow-bytes -mno-slow-bytes -mno-lsim @gol
--mlittle-endian -mbig-endian -m210 -m340 -mstack-increment}
+-mhardlit -mno-hardlit -mdiv -mno-div -mrelax-immediates @gol
+-mno-relax-immediates -mwide-bitfields -mno-wide-bitfields @gol
+-m4byte-functions -mno-4byte-functions -mcallgraph-data @gol
+-mno-callgraph-data -mslow-bytes -mno-slow-bytes -mno-lsim @gol
+-mlittle-endian -mbig-endian -m210 -m340 -mstack-increment}
@emph{IA-64 Options}
@gccoptlist{
--mbig-endian -mlittle-endian -mgnu-as -mgnu-ld -mno-pic @gol
--mvolatile-asm-stop -mb-step -mregister-names -mno-sdata @gol
--mconstant-gp -mauto-pic -minline-divide-min-latency @gol
--minline-divide-max-throughput -mno-dwarf2-asm @gol
--mfixed-range=@var{register range}}
+-mbig-endian -mlittle-endian -mgnu-as -mgnu-ld -mno-pic @gol
+-mvolatile-asm-stop -mb-step -mregister-names -mno-sdata @gol
+-mconstant-gp -mauto-pic -minline-divide-min-latency @gol
+-minline-divide-max-throughput -mno-dwarf2-asm @gol
+-mfixed-range=@var{register-range}}
+
+@emph{S/390 and zSeries Options}
+@gccoptlist{
+-mhard-float -msoft-float -mbackchain -mno-backchain @gol
+-msmall-exec -mno-small-exec -mmvcle -mno-mvcle @gol
+-m64 -m31 -mdebug -mno-debug}
+
+@emph{Xtensa Options}
+@gccoptlist{
+-mbig-endian -mlittle-endian @gol
+-mdensity -mno-density @gol
+-mmac16 -mno-mac16 @gol
+-mmul16 -mno-mul16 @gol
+-mmul32 -mno-mul32 @gol
+-mnsa -mno-nsa @gol
+-mminmax -mno-minmax @gol
+-msext -mno-sext @gol
+-mbooleans -mno-booleans @gol
+-mhard-float -msoft-float @gol
+-mfused-madd -mno-fused-madd @gol
+-mserialize-volatile -mno-serialize-volatile @gol
+-mtext-section-literals -mno-text-section-literals @gol
+-mtarget-align -mno-target-align @gol
+-mlongcalls -mno-longcalls}
@item Code Generation Options
@xref{Code Gen Options,,Options for Code Generation Conventions}.
@gccoptlist{
-fcall-saved-@var{reg} -fcall-used-@var{reg} @gol
--fexceptions -funwind-tables -ffixed-@var{reg} @gol
+-ffixed-@var{reg} -fexceptions @gol
+-fnon-call-exceptions -funwind-tables @gol
-finhibit-size-directive -finstrument-functions @gol
-fcheck-memory-usage -fprefix-function-name @gol
-fno-common -fno-ident -fno-gnu-linker @gol
-fpcc-struct-return -fpic -fPIC @gol
-freg-struct-return -fshared-data -fshort-enums @gol
--fshort-double -fvolatile -fvolatile-global -fvolatile-static @gol
+-fshort-double -fvolatile @gol
+-fvolatile-global -fvolatile-static @gol
-fverbose-asm -fpack-struct -fstack-check @gol
-fstack-limit-register=@var{reg} -fstack-limit-symbol=@var{sym} @gol
-fargument-alias -fargument-noalias @gol
--fargument-noalias-global @gol
--fleading-underscore}
+-fargument-noalias-global -fleading-underscore}
@end table
@menu
@@ -592,8 +630,9 @@ in the following sections.
or preprocessed source.
* C Dialect Options:: Controlling the variant of C language compiled.
* C++ Dialect Options:: Variations on C++.
+* Objective-C Dialect Options:: Variations on Objective-C.
* Language Independent Options:: Controlling how diagnostics should be
- formatted.
+ formatted.
* Warning Options:: How picky should the compiler be?
* Debugging Options:: Symbol tables, measurements, and debugging dumps.
* Optimize Options:: How much optimization?
@@ -648,7 +687,7 @@ C header file (not to be compiled or linked).
@itemx @var{file}.C
C++ source code which must be preprocessed. Note that in @samp{.cxx},
the last two letters must both be literally @samp{x}. Likewise,
-@samp{.C} refers to a literal capital C.
+@samp{.C} refers to a literal capital C@.
@item @var{file}.f
@itemx @var{file}.for
@@ -663,7 +702,7 @@ preprocessor).
@item @var{file}.r
Fortran source code which must be preprocessed with a RATFOR
-preprocessor (not included with GCC).
+preprocessor (not included with GCC)@.
@xref{Overall Options,,Options Controlling the Kind of Output, g77,
Using and Porting GNU Fortran}, for more details of the handling of
@@ -684,10 +723,6 @@ Fortran input files.
@c @var{file}.p
@c @var{file}.pas
-@item @var{file}.ch
-@itemx @var{file}.chi
-CHILL source code (preprocessed with the traditional preprocessor).
-
@item @var{file}.s
Assembler code.
@@ -699,45 +734,48 @@ An object file to be fed straight into linking.
Any file name with no recognized suffix is treated this way.
@end table
-You can specify the input language explicitly with the @samp{-x} option:
+@opindex x
+You can specify the input language explicitly with the @option{-x} option:
@table @gcctabopt
@item -x @var{language}
Specify explicitly the @var{language} for the following input files
(rather than letting the compiler choose a default based on the file
name suffix). This option applies to all following input files until
-the next @samp{-x} option. Possible values for @var{language} are:
+the next @option{-x} option. Possible values for @var{language} are:
@example
c c-header cpp-output
c++ c++-cpp-output
objective-c objc-cpp-output
assembler assembler-with-cpp
f77 f77-cpp-input ratfor
-java chill
+java
@end example
@c Also f77-version, for internal use only.
@item -x none
Turn off any specification of a language, so that subsequent files are
-handled according to their file name suffixes (as they are if @samp{-x}
+handled according to their file name suffixes (as they are if @option{-x}
has not been used at all).
@item -pass-exit-codes
+@opindex pass-exit-codes
Normally the @command{gcc} program will exit with the code of 1 if any
phase of the compiler returns a non-success return code. If you specify
-@samp{-pass-exit-codes}, the @command{gcc} program will instead return with
+@option{-pass-exit-codes}, the @command{gcc} program will instead return with
numerically highest error produced by any phase that returned an error
indication.
@end table
If you only want some of the stages of compilation, you can use
-@samp{-x} (or filename suffixes) to tell @command{gcc} where to start, and
-one of the options @samp{-c}, @samp{-S}, or @samp{-E} to say where
+@option{-x} (or filename suffixes) to tell @command{gcc} where to start, and
+one of the options @option{-c}, @option{-S}, or @option{-E} to say where
@command{gcc} is to stop. Note that some combinations (for example,
@samp{-x cpp-output -E}) instruct @command{gcc} to do nothing at all.
@table @gcctabopt
@item -c
+@opindex c
Compile or assemble the source files, but do not link. The linking
stage simply is not done. The ultimate output is in the form of an
object file for each source file.
@@ -749,6 +787,7 @@ Unrecognized input files, not requiring compilation or assembly, are
ignored.
@item -S
+@opindex S
Stop after the stage of compilation proper; do not assemble. The output
is in the form of an assembler code file for each non-assembler input
file specified.
@@ -759,6 +798,7 @@ replacing the suffix @samp{.c}, @samp{.i}, etc., with @samp{.s}.
Input files that don't require compilation are ignored.
@item -E
+@opindex E
Stop after the preprocessing stage; do not run the compiler proper. The
output is in the form of preprocessed source code, which is sent to the
standard output.
@@ -767,31 +807,35 @@ Input files which don't require preprocessing are ignored.
@cindex output file option
@item -o @var{file}
+@opindex o
Place output in file @var{file}. This applies regardless to whatever
sort of output is being produced, whether it be an executable file,
an object file, an assembler file or preprocessed C code.
Since only one output file can be specified, it does not make sense to
-use @samp{-o} when compiling more than one input file, unless you are
+use @option{-o} when compiling more than one input file, unless you are
producing an executable file as output.
-If @samp{-o} is not specified, the default is to put an executable file
+If @option{-o} is not specified, the default is to put an executable file
in @file{a.out}, the object file for @file{@var{source}.@var{suffix}} in
@file{@var{source}.o}, its assembler file in @file{@var{source}.s}, and
-all preprocessed C source on standard output.@refill
+all preprocessed C source on standard output.
@item -v
+@opindex v
Print (on standard error output) the commands executed to run the stages
of compilation. Also print the version number of the compiler driver
program and of the preprocessor and the compiler proper.
@item -pipe
+@opindex pipe
Use pipes rather than temporary files for communication between the
various stages of compilation. This fails to work on some systems where
the assembler is unable to read from a pipe; but the GNU assembler has
no trouble.
@item --help
+@opindex help
Print (on the standard output) a description of the command line options
understood by @command{gcc}. If the @option{-v} option is also specified
then @option{--help} will also be passed on to the various processes
@@ -801,6 +845,7 @@ line options which have no documentation associated with them will also
be displayed.
@item --target-help
+@opindex target-help
Print (on the standard output) a description of target specific command
line options for each tool.
@end table
@@ -834,7 +879,7 @@ command-line options that you use for compiling programs in any
language; or command-line options meaningful for C and related
languages; or options that are meaningful only for C++ programs.
@xref{C Dialect Options,,Options Controlling C Dialect}, for
-explanations of options for languages related to C.
+explanations of options for languages related to C@.
@xref{C++ Dialect Options,,Options Controlling C++ Dialect}, for
explanations of options that are meaningful only for C++ programs.
@@ -851,77 +896,72 @@ from C, such as C++ and Objective C) that the compiler accepts:
@cindex ANSI support
@cindex ISO support
@item -ansi
+@opindex ansi
In C mode, support all ISO C89 programs. In C++ mode,
remove GNU extensions that conflict with ISO C++.
This turns off certain features of GCC that are incompatible with ISO
-C (when compiling C code), or of standard C++ (when compiling C++ code),
+C89 (when compiling C code), or of standard C++ (when compiling C++ code),
such as the @code{asm} and @code{typeof} keywords, and
predefined macros such as @code{unix} and @code{vax} that identify the
type of system you are using. It also enables the undesirable and
-rarely used ISO trigraph feature. For the C compiler,
+rarely used ISO trigraph feature. For the C compiler,
it disables recognition of C++ style @samp{//} comments as well as
the @code{inline} keyword.
The alternate keywords @code{__asm__}, @code{__extension__},
@code{__inline__} and @code{__typeof__} continue to work despite
-@samp{-ansi}. You would not want to use them in an ISO C program, of
+@option{-ansi}. You would not want to use them in an ISO C program, of
course, but it is useful to put them in header files that might be included
-in compilations done with @samp{-ansi}. Alternate predefined macros
+in compilations done with @option{-ansi}. Alternate predefined macros
such as @code{__unix__} and @code{__vax__} are also available, with or
-without @samp{-ansi}.
+without @option{-ansi}.
-The @samp{-ansi} option does not cause non-ISO programs to be
-rejected gratuitously. For that, @samp{-pedantic} is required in
-addition to @samp{-ansi}. @xref{Warning Options}.
+The @option{-ansi} option does not cause non-ISO programs to be
+rejected gratuitously. For that, @option{-pedantic} is required in
+addition to @option{-ansi}. @xref{Warning Options}.
-The macro @code{__STRICT_ANSI__} is predefined when the @samp{-ansi}
+The macro @code{__STRICT_ANSI__} is predefined when the @option{-ansi}
option is used. Some header files may notice this macro and refrain
from declaring certain functions or defining certain macros that the
ISO standard doesn't call for; this is to avoid interfering with any
programs that might use these names for other things.
-Functions which would normally be builtin but do not have semantics
-defined by ISO C (such as @code{alloca} and @code{ffs}) are not builtin
-functions with @samp{-ansi} is used. @xref{Other Builtins,,Other
-built-in functions provided by GNU CC}, for details of the functions
+Functions which would normally be built in but do not have semantics
+defined by ISO C (such as @code{alloca} and @code{ffs}) are not built-in
+functions with @option{-ansi} is used. @xref{Other Builtins,,Other
+built-in functions provided by GCC}, for details of the functions
affected.
@item -std=
-Determine the language standard. A value for this option must be provided;
-possible values are
+@opindex std
+Determine the language standard. This option is currently only
+supported when compiling C@. A value for this option must be provided;
+possible values are
@table @samp
-@item iso9899:1990
-Same as @option{-ansi}
+@item c89
+@itemx iso9899:1990
+ISO C89 (same as @option{-ansi}).
@item iso9899:199409
-ISO C as modified in amend. 1
-
-@item iso9899:1999
-ISO C99. Note that this standard is not yet fully supported; see
-@w{@uref{http://gcc.gnu.org/c99status.html}} for more information.
-
-@item c89
-same as @option{-std=iso9899:1990}
+ISO C89 as modified in amendment 1.
@item c99
-same as @option{-std=iso9899:1999}
+@itemx c9x
+@itemx iso9899:1999
+@itemx iso9899:199x
+ISO C99. Note that this standard is not yet fully supported; see
+@w{@uref{http://gcc.gnu.org/c99status.html}} for more information. The
+names @samp{c9x} and @samp{iso9899:199x} are deprecated.
@item gnu89
-default, iso9899:1990 + gnu extensions
+Default, ISO C89 plus GNU extensions (including some C99 features).
@item gnu99
-iso9899:1999 + gnu extensions
-
-@item iso9899:199x
-same as @option{-std=iso9899:1999}, deprecated
-
-@item c9x
-same as @option{-std=iso9899:1999}, deprecated
-
-@item gnu9x
-same as @option{-std=gnu99}, deprecated
+@itemx gnu9x
+ISO C99 plus GNU extensions. When ISO C99 is fully implemented in GCC,
+this will become the default. The name @samp{gnu9x} is deprecated.
@end table
@@ -938,29 +978,47 @@ the @code{inline} keyword in ISO C99) are not disabled.
@xref{Standards,,Language Standards Supported by GCC}, for details of
these standard versions.
+@item -aux-info @var{filename}
+@opindex aux-info
+Output to the given filename prototyped declarations for all functions
+declared and/or defined in a translation unit, including those in header
+files. This option is silently ignored in any language other than C@.
+
+Besides declarations, the file indicates, in comments, the origin of
+each declaration (source file and line), whether the declaration was
+implicit, prototyped or unprototyped (@samp{I}, @samp{N} for new or
+@samp{O} for old, respectively, in the first character after the line
+number and the colon), and whether it came from a declaration or a
+definition (@samp{C} or @samp{F}, respectively, in the following
+character). In the case of function definitions, a K&R-style list of
+arguments followed by their declarations is also provided, inside
+comments, after the declaration.
+
@item -fno-asm
+@opindex fno-asm
Do not recognize @code{asm}, @code{inline} or @code{typeof} as a
keyword, so that code can use these words as identifiers. You can use
the keywords @code{__asm__}, @code{__inline__} and @code{__typeof__}
-instead. @samp{-ansi} implies @samp{-fno-asm}.
+instead. @option{-ansi} implies @option{-fno-asm}.
In C++, this switch only affects the @code{typeof} keyword, since
@code{asm} and @code{inline} are standard keywords. You may want to
-use the @samp{-fno-gnu-keywords} flag instead, which has the same
+use the @option{-fno-gnu-keywords} flag instead, which has the same
effect. In C99 mode (@option{-std=c99} or @option{-std=gnu99}), this
switch only affects the @code{asm} and @code{typeof} keywords, since
@code{inline} is a standard keyword in ISO C99.
@item -fno-builtin
-@cindex builtin functions
-Don't recognize builtin functions that do not begin with
+@opindex fno-builtin
+@cindex built-in functions
+Don't recognize built-in functions that do not begin with
@samp{__builtin_} as prefix. @xref{Other Builtins,,Other built-in
-functions provided by GNU CC}, for details of the functions affected,
-including those which are not builtin functions when @option{-ansi} or
+functions provided by GCC}, for details of the functions affected,
+including those which are not built-in functions when @option{-ansi} or
@option{-std} options for strict ISO C conformance are used because they
do not have an ISO standard meaning.
-GCC normally generates special code to handle certain builtin functions
+GCC normally generates special code to handle certain built-in functions
more efficiently; for instance, calls to @code{alloca} may become single
instructions that adjust the stack directly, and calls to @code{memcpy}
may become inline copy loops. The resulting code is often both smaller
@@ -968,35 +1026,45 @@ and faster, but since the function calls no longer appear as such, you
cannot set a breakpoint on those calls, nor can you change the behavior
of the functions by linking with a different library.
+In C++, @option{-fno-builtin} is always in effect. The @option{-fbuiltin}
+option has no effect. Therefore, in C++, the only way to get the
+optimization benefits of built-in functions is to call the function
+using the @samp{__builtin_} prefix. The GNU C++ Standard Library uses
+built-in functions to implement many functions (like
+@code{std::strchr}), so that you automatically get efficient code.
+
@item -fhosted
+@opindex fhosted
@cindex hosted environment
Assert that compilation takes place in a hosted environment. This implies
-@samp{-fbuiltin}. A hosted environment is one in which the
+@option{-fbuiltin}. A hosted environment is one in which the
entire standard library is available, and in which @code{main} has a return
type of @code{int}. Examples are nearly everything except a kernel.
-This is equivalent to @samp{-fno-freestanding}.
+This is equivalent to @option{-fno-freestanding}.
@item -ffreestanding
+@opindex ffreestanding
@cindex hosted environment
Assert that compilation takes place in a freestanding environment. This
-implies @samp{-fno-builtin}. A freestanding environment
+implies @option{-fno-builtin}. A freestanding environment
is one in which the standard library may not exist, and program startup may
not necessarily be at @code{main}. The most obvious example is an OS kernel.
-This is equivalent to @samp{-fno-hosted}.
+This is equivalent to @option{-fno-hosted}.
@xref{Standards,,Language Standards Supported by GCC}, for details of
freestanding and hosted environments.
@item -trigraphs
-Support ISO C trigraphs. You don't want to know about this
-brain-damage. The @option{-ansi} option (and @option{-std} options for
-strict ISO C conformance) implies @option{-trigraphs}.
+@opindex trigraphs
+Support ISO C trigraphs. The @option{-ansi} option (and @option{-std}
+options for strict ISO C conformance) implies @option{-trigraphs}.
@cindex traditional C language
@cindex C language, traditional
@item -traditional
+@opindex traditional
Attempt to support some aspects of traditional C compilers.
Specifically:
@@ -1030,7 +1098,7 @@ number, such as @samp{0xe-0xd}, are treated as expressions instead.
String ``constants'' are not necessarily constant; they are stored in
writable space, and identical looking constants are allocated
separately. (This is the same as the effect of
-@samp{-fwritable-strings}.)
+@option{-fwritable-strings}.)
@cindex @code{longjmp} and automatic variables
@item
@@ -1039,28 +1107,29 @@ All automatic variables not declared @code{register} are preserved by
not declared @code{volatile} may be clobbered.
@item
-@kindex \x
-@kindex \a
+@cindex @samp{\x}
+@cindex @samp{\a}
@cindex escape sequences, traditional
The character escape sequences @samp{\x} and @samp{\a} evaluate as the
literal characters @samp{x} and @samp{a} respectively. Without
-@w{@samp{-traditional}}, @samp{\x} is a prefix for the hexadecimal
+@w{@option{-traditional}}, @samp{\x} is a prefix for the hexadecimal
representation of a character, and @samp{\a} produces a bell.
@end itemize
-You may wish to use @samp{-fno-builtin} as well as @samp{-traditional}
-if your program uses names that are normally GNU C builtin functions for
+You may wish to use @option{-fno-builtin} as well as @option{-traditional}
+if your program uses names that are normally GNU C built-in functions for
other purposes of its own.
-You cannot use @samp{-traditional} if you include any header files that
+You cannot use @option{-traditional} if you include any header files that
rely on ISO C features. Some vendors are starting to ship systems with
-ISO C header files and you cannot use @samp{-traditional} on such
+ISO C header files and you cannot use @option{-traditional} on such
systems to compile files that include any system headers.
-The @samp{-traditional} option also enables @samp{-traditional-cpp},
+The @option{-traditional} option also enables @option{-traditional-cpp},
which is described next.
@item -traditional-cpp
+@opindex traditional-cpp
Attempt to support some aspects of traditional C preprocessors.
Specifically:
@@ -1080,16 +1149,16 @@ quote marks, when they appear in such a context). The preprocessor
always considers a string constant to end at a newline.
@item
-@cindex detecting @w{@samp{-traditional}}
+@cindex detecting @w{@option{-traditional}}
The predefined macro @code{__STDC__} is not defined when you use
-@samp{-traditional}, but @code{__GNUC__} is (since the GNU extensions
+@option{-traditional}, but @code{__GNUC__} is (since the GNU extensions
which @code{__GNUC__} indicates are not affected by
-@samp{-traditional}). If you need to write header files that work
-differently depending on whether @samp{-traditional} is in use, by
+@option{-traditional}). If you need to write header files that work
+differently depending on whether @option{-traditional} is in use, by
testing both of these predefined macros you can distinguish four
situations: GNU C, traditional GNU C, other ISO C compilers, and other
old C compilers. The predefined macro @code{__STDC_VERSION__} is also
-not defined when you use @samp{-traditional}. @xref{Standard
+not defined when you use @option{-traditional}. @xref{Standard
Predefined,,Standard Predefined Macros,cpp.info,The C Preprocessor},
for more discussion of these and other predefined macros.
@@ -1097,16 +1166,18 @@ for more discussion of these and other predefined macros.
@cindex string constants vs newline
@cindex newline vs string constants
The preprocessor considers a string constant to end at a newline (unless
-the newline is escaped with @samp{\}). (Without @w{@samp{-traditional}},
+the newline is escaped with @samp{\}). (Without @w{@option{-traditional}},
string constants can contain the newline character as typed.)
@end itemize
@item -fcond-mismatch
+@opindex fcond-mismatch
Allow conditional expressions with mismatched types in the second and
third arguments. The value of such an expression is void. This option
is not supported for C++.
@item -funsigned-char
+@opindex funsigned-char
Let the type @code{char} be unsigned, like @code{unsigned char}.
Each kind of machine has a default for what @code{char} should
@@ -1125,58 +1196,57 @@ The type @code{char} is always a distinct type from each of
is always just like one of those two.
@item -fsigned-char
+@opindex fsigned-char
Let the type @code{char} be signed, like @code{signed char}.
-Note that this is equivalent to @samp{-fno-unsigned-char}, which is
-the negative form of @samp{-funsigned-char}. Likewise, the option
-@samp{-fno-signed-char} is equivalent to @samp{-funsigned-char}.
-
-You may wish to use @samp{-fno-builtin} as well as @samp{-traditional}
-if your program uses names that are normally GNU C builtin functions for
-other purposes of its own.
-
-You cannot use @samp{-traditional} if you include any header files that
-rely on ISO C features. Some vendors are starting to ship systems with
-ISO C header files and you cannot use @samp{-traditional} on such
-systems to compile files that include any system headers.
+Note that this is equivalent to @option{-fno-unsigned-char}, which is
+the negative form of @option{-funsigned-char}. Likewise, the option
+@option{-fno-signed-char} is equivalent to @option{-funsigned-char}.
@item -fsigned-bitfields
@itemx -funsigned-bitfields
@itemx -fno-signed-bitfields
@itemx -fno-unsigned-bitfields
-These options control whether a bitfield is signed or unsigned, when the
+@opindex fsigned-bitfields
+@opindex funsigned-bitfields
+@opindex fno-signed-bitfields
+@opindex fno-unsigned-bitfields
+These options control whether a bit-field is signed or unsigned, when the
declaration does not use either @code{signed} or @code{unsigned}. By
-default, such a bitfield is signed, because this is consistent: the
+default, such a bit-field is signed, because this is consistent: the
basic integer types such as @code{int} are signed types.
-However, when @samp{-traditional} is used, bitfields are all unsigned
+However, when @option{-traditional} is used, bit-fields are all unsigned
no matter what.
@item -fwritable-strings
+@opindex fwritable-strings
Store string constants in the writable data segment and don't uniquize
them. This is for compatibility with old programs which assume they can
-write into string constants. The option @samp{-traditional} also has
+write into string constants. The option @option{-traditional} also has
this effect.
Writing into string constants is a very bad idea; ``constants'' should
be constant.
@item -fallow-single-precision
+@opindex fallow-single-precision
Do not promote single precision math operations to double precision,
-even when compiling with @samp{-traditional}.
+even when compiling with @option{-traditional}.
Traditional K&R C promotes all floating point operations to double
precision, regardless of the sizes of the operands. On the
architecture for which you are compiling, single precision may be faster
-than double precision. If you must use @samp{-traditional}, but want
+than double precision. If you must use @option{-traditional}, but want
to use single precision operations when the operands are single
precision, use this option. This option has no effect when compiling
with ISO or GNU C conventions (the default).
@item -fshort-wchar
+@opindex fshort-wchar
Override the underlying type for @samp{wchar_t} to be @samp{short
unsigned int} instead of the default for the target. This option is
-useful for building programs to run under WINE.
+useful for building programs to run under WINE@.
@end table
@node C++ Dialect Options
@@ -1195,18 +1265,20 @@ g++ -g -frepo -O -c firstClass.C
@end example
@noindent
-In this example, only @samp{-frepo} is an option meant
+In this example, only @option{-frepo} is an option meant
only for C++ programs; you can use the other options with any
-language supported by GCC.
+language supported by GCC@.
Here is a list of options that are @emph{only} for compiling C++ programs:
@table @gcctabopt
@item -fno-access-control
+@opindex fno-access-control
Turn off all access checking. This switch is mainly useful for working
around bugs in the access control code.
@item -fcheck-new
+@opindex fcheck-new
Check that the pointer returned by @code{operator new} is non-null
before attempting to modify the storage allocated. The current Working
Paper requires that @code{operator new} never return a null pointer, so
@@ -1214,10 +1286,11 @@ this check is normally unnecessary.
An alternative to using this option is to specify that your
@code{operator new} does not throw any exceptions; if you declare it
-@samp{throw()}, g++ will check the return value. See also @samp{new
+@samp{throw()}, G++ will check the return value. See also @samp{new
(nothrow)}.
@item -fconserve-space
+@opindex fconserve-space
Put uninitialized or runtime-initialized global variables into the
common segment, as C does. This saves space in the executable at the
cost of not diagnosing duplicate definitions. If you compile with this
@@ -1228,26 +1301,42 @@ two definitions were merged.
This option is no longer useful on most targets, now that support has
been added for putting variables into BSS without making them common.
+@item -fno-const-strings
+@opindex fno-const-strings
+Give string constants type @code{char *} instead of type @code{const
+char *}. By default, G++ uses type @code{const char *} as required by
+the standard. Even if you use @option{-fno-const-strings}, you cannot
+actually modify the value of a string constant, unless you also use
+@option{-fwritable-strings}.
+
+This option might be removed in a future release of G++. For maximum
+portability, you should structure your code so that it works with
+string constants that have type @code{const char *}.
+
@item -fdollars-in-identifiers
+@opindex fdollars-in-identifiers
Accept @samp{$} in identifiers. You can also explicitly prohibit use of
-@samp{$} with the option @samp{-fno-dollars-in-identifiers}. (GNU C allows
+@samp{$} with the option @option{-fno-dollars-in-identifiers}. (GNU C allows
@samp{$} by default on most target systems, but there are a few exceptions.)
Traditional C allowed the character @samp{$} to form part of
identifiers. However, ISO C and C++ forbid @samp{$} in identifiers.
@item -fno-elide-constructors
+@opindex fno-elide-constructors
The C++ standard allows an implementation to omit creating a temporary
which is only used to initialize another object of the same type.
-Specifying this option disables that optimization, and forces g++ to
+Specifying this option disables that optimization, and forces G++ to
call the copy constructor in all cases.
@item -fno-enforce-eh-specs
+@opindex fno-enforce-eh-specs
Don't check for violation of exception specifications at runtime. This
option violates the C++ standard, but may be useful for reducing code
size in production builds, much like defining @samp{NDEBUG}. The compiler
will still optimize based on the exception specifications.
@item -fexternal-templates
+@opindex fexternal-templates
Cause template instantiations to obey @samp{#pragma interface} and
@samp{implementation}; template instances are emitted or not according
to the location of the template definition. @xref{Template
@@ -1256,7 +1345,8 @@ Instantiation}, for more information.
This option is deprecated.
@item -falt-external-templates
-Similar to -fexternal-templates, but template instances are emitted or
+@opindex falt-external-templates
+Similar to @option{-fexternal-templates}, but template instances are emitted or
not according to the place where they are first instantiated.
@xref{Template Instantiation}, for more information.
@@ -1264,12 +1354,14 @@ This option is deprecated.
@item -ffor-scope
@itemx -fno-for-scope
-If -ffor-scope is specified, the scope of variables declared in
+@opindex ffor-scope
+@opindex fno-for-scope
+If @option{-ffor-scope} is specified, the scope of variables declared in
a @i{for-init-statement} is limited to the @samp{for} loop itself,
as specified by the C++ standard.
-If -fno-for-scope is specified, the scope of variables declared in
+If @option{-fno-for-scope} is specified, the scope of variables declared in
a @i{for-init-statement} extends to the end of the enclosing scope,
-as was the case in old versions of gcc, and other (traditional)
+as was the case in old versions of G++, and other (traditional)
implementations of C++.
The default if neither flag is given to follow the standard,
@@ -1277,82 +1369,67 @@ but to allow and give a warning for old-style code that would
otherwise be invalid, or have different behavior.
@item -fno-gnu-keywords
+@opindex fno-gnu-keywords
Do not recognize @code{typeof} as a keyword, so that code can use this
-word as an identifier. You can use the keyword @code{__typeof__} instead.
-@samp{-ansi} implies @samp{-fno-gnu-keywords}.
-
-@item -fhonor-std
-Treat the @code{namespace std} as a namespace, instead of ignoring
-it. For compatibility with earlier versions of g++, the compiler will,
-by default, ignore @code{namespace-declarations},
-@code{using-declarations}, @code{using-directives}, and
-@code{namespace-names}, if they involve @code{std}.
-
-@item -fhuge-objects
-Support virtual function calls for objects that exceed the size
-representable by a @samp{short int}. Users should not use this flag by
-default; if you need to use it, the compiler will tell you so.
-
-This flag is not useful when compiling with -fvtable-thunks.
-
-Like all options that change the ABI, all C++ code, @emph{including
-libgcc} must be built with the same setting of this option.
+word as an identifier. You can use the keyword @code{__typeof__} instead.
+@option{-ansi} implies @option{-fno-gnu-keywords}.
@item -fno-implicit-templates
+@opindex fno-implicit-templates
Never emit code for non-inline templates which are instantiated
-implicitly (i.e. by use); only emit code for explicit instantiations.
+implicitly (i.e.@: by use); only emit code for explicit instantiations.
@xref{Template Instantiation}, for more information.
@item -fno-implicit-inline-templates
+@opindex fno-implicit-inline-templates
Don't emit code for implicit instantiations of inline templates, either.
The default is to handle inlines differently so that compiles with and
without optimization will need the same set of explicit instantiations.
@item -fno-implement-inlines
+@opindex fno-implement-inlines
To save space, do not emit out-of-line copies of inline functions
controlled by @samp{#pragma implementation}. This will cause linker
errors if these functions are not inlined everywhere they are called.
@item -fms-extensions
+@opindex fms-extensions
Disable pedantic warnings about constructs used in MFC, such as implicit
int and getting a pointer to member function via non-standard syntax.
-@item -fname-mangling-version-@var{n}
-Control the way in which names are mangled. Version 0 is compatible
-with versions of g++ before 2.8. Version 1 is the default. Version 1
-will allow correct mangling of function templates. For example,
-version 0 mangling does not mangle foo<int, double> and foo<int, char>
-given this declaration:
-
-@example
-template <class T, class U> void foo(T t);
-@end example
-
-Like all options that change the ABI, all C++ code, @emph{including
-libgcc} must be built with the same setting of this option.
+@item -fno-nonansi-builtins
+@opindex fno-nonansi-builtins
+Disable built-in declarations of functions that are not mandated by
+ANSI/ISO C@. These include @code{ffs}, @code{alloca}, @code{_exit},
+@code{index}, @code{bzero}, @code{conjf}, and other related functions.
@item -fno-operator-names
+@opindex fno-operator-names
Do not treat the operator name keywords @code{and}, @code{bitand},
@code{bitor}, @code{compl}, @code{not}, @code{or} and @code{xor} as
synonyms as keywords.
@item -fno-optional-diags
+@opindex fno-optional-diags
Disable diagnostics that the standard says a compiler does not need to
-issue. Currently, the only such diagnostic issued by g++ is the one for
+issue. Currently, the only such diagnostic issued by G++ is the one for
a name having multiple meanings within a class.
@item -fpermissive
+@opindex fpermissive
Downgrade messages about nonconformant code from errors to warnings. By
-default, g++ effectively sets @samp{-pedantic-errors} without
-@samp{-pedantic}; this option reverses that. This behavior and this
-option are superseded by @samp{-pedantic}, which works as it does for GNU C.
+default, G++ effectively sets @option{-pedantic-errors} without
+@option{-pedantic}; this option reverses that. This behavior and this
+option are superseded by @option{-pedantic}, which works as it does for GNU C@.
@item -frepo
+@opindex frepo
Enable automatic template instantiation. This option also implies
-@samp{-fno-implicit-templates}. @xref{Template Instantiation}, for more
+@option{-fno-implicit-templates}. @xref{Template Instantiation}, for more
information.
@item -fno-rtti
+@opindex fno-rtti
Disable generation of information about every class with virtual
functions for use by the C++ runtime type identification features
(@samp{dynamic_cast} and @samp{typeid}). If you don't use those parts
@@ -1360,48 +1437,36 @@ of the language, you can save some space by using this flag. Note that
exception handling uses the same information, but it will generate it as
needed.
-@item -fsquangle
-@itemx -fno-squangle
-@samp{-fsquangle} will enable a compressed form of name mangling for
-identifiers. In particular, it helps to shorten very long names by recognizing
-types and class names which occur more than once, replacing them with special
-short ID codes. This option also requires any C++ libraries being used to
-be compiled with this option as well. The compiler has this disabled (the
-equivalent of @samp{-fno-squangle}) by default.
-
-Like all options that change the ABI, all C++ code, @emph{including
-libgcc.a} must be built with the same setting of this option.
+@item -fstats
+@opindex fstats
+Emit statistics about front-end processing at the end of the compilation.
+This information is generally only useful to the G++ development team.
@item -ftemplate-depth-@var{n}
+@opindex ftemplate-depth
Set the maximum instantiation depth for template classes to @var{n}.
A limit on the template instantiation depth is needed to detect
-endless recursions during template class instantiation. ANSI/ISO C++
+endless recursions during template class instantiation. ANSI/ISO C++
conforming programs must not rely on a maximum depth greater than 17.
@item -fuse-cxa-atexit
+@opindex fuse-cxa-atexit
Register destructors for objects with static storage duration with the
@code{__cxa_atexit} function rather than the @code{atexit} function.
This option is required for fully standards-compliant handling of static
destructors, but will only work if your C library supports
@code{__cxa_atexit}.
-@item -fvtable-thunks
-Use @samp{thunks} to implement the virtual function dispatch table
-(@samp{vtable}). The traditional (cfront-style) approach to
-implementing vtables was to store a pointer to the function and two
-offsets for adjusting the @samp{this} pointer at the call site. Newer
-implementations store a single pointer to a @samp{thunk} function which
-does any necessary adjustment and then calls the target function.
-
-This option also enables a heuristic for controlling emission of
-vtables; if a class has any non-inline virtual functions, the vtable
-will be emitted in the translation unit containing the first one of
-those.
-
-Like all options that change the ABI, all C++ code, @emph{including
-libgcc.a} must be built with the same setting of this option.
+@item -fno-weak
+@opindex fno-weak
+Do not use weak symbol support, even if it is provided by the linker.
+By default, G++ will use weak symbols if they are available. This
+option exists only for testing, and should not be used by end-users;
+it will result in inferior code and has no benefits. This option may
+be removed in a future release of G++.
@item -nostdinc++
+@opindex nostdinc++
Do not search for header files in the standard directories specific to
C++, but do still search the other standard directories. (This option
is used when building the C++ library.)
@@ -1412,21 +1477,25 @@ have meanings only for C++ programs:
@table @gcctabopt
@item -fno-default-inline
+@opindex fno-default-inline
Do not assume @samp{inline} for functions defined inside a class scope.
@xref{Optimize Options,,Options That Control Optimization}. Note that these
functions will have linkage like inline functions; they just won't be
inlined by default.
-@item -Wctor-dtor-privacy (C++ only)
+@item -Wctor-dtor-privacy @r{(C++ only)}
+@opindex Wctor-dtor-privacy
Warn when a class seems unusable, because all the constructors or
destructors in a class are private and the class has no friends or
public static member functions.
-@item -Wnon-virtual-dtor (C++ only)
+@item -Wnon-virtual-dtor @r{(C++ only)}
+@opindex Wnon-virtual-dtor
Warn when a class declares a non-virtual destructor that should probably
be virtual, because it looks like the class will be used polymorphically.
-@item -Wreorder (C++ only)
+@item -Wreorder @r{(C++ only)}
+@opindex Wreorder
@cindex reordering, warning
@cindex warning for reordering of member initializers
Warn when the order of member initializers given in the code does not
@@ -1445,39 +1514,45 @@ and @samp{j} will be rearranged to match the declaration order of the
members.
@end table
-The following @samp{-W@dots{}} options are not affected by @samp{-Wall}.
+The following @option{-W@dots{}} options are not affected by @option{-Wall}.
@table @gcctabopt
-@item -Weffc++ (C++ only)
+@item -Weffc++ @r{(C++ only)}
+@opindex Weffc++
Warn about violations of various style guidelines from Scott Meyers'
@cite{Effective C++} books. If you use this option, you should be aware
that the standard library headers do not obey all of these guidelines;
you can use @samp{grep -v} to filter out those warnings.
-@item -Wno-deprecated (C++ only)
-Do not warn about usage of deprecated features. @xref{Deprecated Features}.
+@item -Wno-deprecated @r{(C++ only)}
+@opindex Wno-deprecated
+Do not warn about usage of deprecated features. @xref{Deprecated Features}.
-@item -Wno-non-template-friend (C++ only)
+@item -Wno-non-template-friend @r{(C++ only)}
+@opindex Wno-non-template-friend
Disable warnings when non-templatized friend functions are declared
-within a template. With the advent of explicit template specification
-support in g++, if the name of the friend is an unqualified-id (ie,
+within a template. With the advent of explicit template specification
+support in G++, if the name of the friend is an unqualified-id (i.e.,
@samp{friend foo(int)}), the C++ language specification demands that the
-friend declare or define an ordinary, nontemplate function. (Section
-14.5.3). Before g++ implemented explicit specification, unqualified-ids
+friend declare or define an ordinary, nontemplate function. (Section
+14.5.3). Before G++ implemented explicit specification, unqualified-ids
could be interpreted as a particular specialization of a templatized
-function. Because this non-conforming behavior is no longer the default
-behavior for g++, @samp{-Wnon-template-friend} allows the compiler to
+function. Because this non-conforming behavior is no longer the default
+behavior for G++, @option{-Wnon-template-friend} allows the compiler to
check existing code for potential trouble spots, and is on by default.
This new compiler behavior can be turned off with
-@samp{-Wno-non-template-friend} which keeps the conformant compiler code
+@option{-Wno-non-template-friend} which keeps the conformant compiler code
but disables the helpful warning.
-@item -Wold-style-cast (C++ only)
+@item -Wold-style-cast @r{(C++ only)}
+@opindex Wold-style-cast
Warn if an old-style (C-style) cast is used within a C++ program. The
new-style casts (@samp{static_cast}, @samp{reinterpret_cast}, and
-@samp{const_cast}) are less vulnerable to unintended effects.
+@samp{const_cast}) are less vulnerable to unintended effects, and much
+easier to grep for.
-@item -Woverloaded-virtual (C++ only)
+@item -Woverloaded-virtual @r{(C++ only)}
+@opindex Woverloaded-virtual
@cindex overloaded virtual fn, warning
@cindex warning for overloaded virtual fn
Warn when a derived class function declaration may be an error in
@@ -1488,20 +1563,23 @@ compiler warns when you define a function with the same name as a
virtual function, but with a type signature that does not match any
declarations from the base class.
-@item -Wno-pmf-conversions (C++ only)
+@item -Wno-pmf-conversions @r{(C++ only)}
+@opindex Wno-pmf-conversions
Disable the diagnostic for converting a bound pointer to member function
to a plain pointer.
-@item -Wsign-promo (C++ only)
+@item -Wsign-promo @r{(C++ only)}
+@opindex Wsign-promo
Warn when overload resolution chooses a promotion from unsigned or
enumeral type to a signed type over a conversion to an unsigned type of
-the same size. Previous versions of g++ would try to preserve
+the same size. Previous versions of G++ would try to preserve
unsignedness, but the standard mandates the current behavior.
-@item -Wsynth (C++ only)
+@item -Wsynth @r{(C++ only)}
+@opindex Wsynth
@cindex warning for synthesized methods
@cindex synthesized methods, warning
-Warn when g++'s synthesis behavior does not match that of cfront. For
+Warn when G++'s synthesis behavior does not match that of cfront. For
instance:
@smallexample
@@ -1517,10 +1595,69 @@ main ()
@}
@end smallexample
-In this example, g++ will synthesize a default @samp{A& operator =
+In this example, G++ will synthesize a default @samp{A& operator =
(const A&);}, while cfront will use the user-defined @samp{operator =}.
@end table
+@node Objective-C Dialect Options
+@section Options Controlling Objective-C Dialect
+
+@cindex compiler options, Objective-C
+@cindex Objective-C options, command line
+@cindex options, Objective-C
+This section describes the command-line options that are only meaningful
+for Objective-C programs; but you can also use most of the GNU compiler
+options regardless of what language your program is in. For example,
+you might compile a file @code{some_class.m} like this:
+
+@example
+gcc -g -fgnu-runtime -O -c some_class.m
+@end example
+
+@noindent
+In this example, only @option{-fgnu-runtime} is an option meant only for
+Objective-C programs; you can use the other options with any language
+supported by GCC@.
+
+Here is a list of options that are @emph{only} for compiling Objective-C
+programs:
+
+@table @gcctabopt
+@item -fconstant-string-class=@var{class-name}
+@opindex fconstant-string-class
+Use @var{class-name} as the name of the class to instantiate for each
+literal string specified with the syntax @code{@@"@dots{}"}. The default
+class name is @code{NXConstantString}.
+
+@item -fgnu-runtime
+@opindex fgnu-runtime
+Generate object code compatible with the standard GNU Objective-C
+runtime. This is the default for most types of systems.
+
+@item -fnext-runtime
+@opindex fnext-runtime
+Generate output compatible with the NeXT runtime. This is the default
+for NeXT-based systems, including Darwin and Mac OS X@.
+
+@item -gen-decls
+@opindex gen-decls
+Dump interface declarations for all classes seen in the source file to a
+file named @file{@var{sourcename}.decl}.
+
+@item -Wno-protocol
+@opindex Wno-protocol
+Do not warn if methods required by a protocol are not implemented
+in the class adopting it.
+
+@item -Wselector
+@opindex Wselector
+Warn if a selector has multiple methods of different types defined.
+
+@c not documented because only avail via -Wp
+@c @item -print-objc-runtime-info
+
+@end table
+
@node Language Independent Options
@section Options to Control Diagnostic Messages Formatting
@cindex options to control diagnostics formatting
@@ -1528,33 +1665,35 @@ In this example, g++ will synthesize a default @samp{A& operator =
@cindex message formatting
Traditionally, diagnostic messages have been formatted irrespective of
-the output device's aspect (e.g. its width, ...). The options described
+the output device's aspect (e.g.@: its width, @dots{}). The options described
below can be used to control the diagnostic messages formatting
-algorithm, e.g. how many characters per line, how often source location
-information should be reported. Right now, only the C++ front-end can
+algorithm, e.g.@: how many characters per line, how often source location
+information should be reported. Right now, only the C++ front end can
honor these options. However it is expected, in the near future, that
-the remaining front-ends would be able to digest them correctly.
+the remaining front ends would be able to digest them correctly.
@table @gcctabopt
@item -fmessage-length=@var{n}
+@opindex fmessage-length
Try to format error messages so that they fit on lines of about @var{n}
-characters. The default is 72 characters for g++ and 0 for the rest of
-the front-ends supported by GCC. If @var{n} is zero, then no
-line-wrapping will be done; each error message will appear on a single
+characters. The default is 72 characters for @command{g++} and 0 for the rest of
+the front ends supported by GCC@. If @var{n} is zero, then no
+line-wrapping will be done; each error message will appear on a single
line.
+@opindex fdiagnostics-show-location
@item -fdiagnostics-show-location=once
Only meaningful in line-wrapping mode. Instructs the diagnostic messages
reporter to emit @emph{once} source location information; that is, in
case the message is too long to fit on a single physical line and has to
be wrapped, the source location won't be emitted (as prefix) again,
over and over, in subsequent continuation lines. This is the default
-behaviour.
+behaviour.
@item -fdiagnostics-show-location=every-line
Only meaningful in line-wrapping mode. Instructs the diagnostic
messages reporter to emit the same source location information (as
-prefix) for physical lines that result from the process of breaking a
+prefix) for physical lines that result from the process of breaking
a message which is too long to fit on a single line.
@end table
@@ -1571,10 +1710,10 @@ are not inherently erroneous but which are risky or suggest there
may have been an error.
You can request many specific warnings with options beginning @samp{-W},
-for example @samp{-Wimplicit} to request warnings on implicit
+for example @option{-Wimplicit} to request warnings on implicit
declarations. Each of these specific warning options also has a
negative form beginning @samp{-Wno-} to turn off warnings;
-for example, @samp{-Wno-implicit}. This manual lists only one of the
+for example, @option{-Wno-implicit}. This manual lists only one of the
two forms, whichever is not the default.
These options control the amount and kinds of warnings produced by GCC:
@@ -1582,28 +1721,30 @@ These options control the amount and kinds of warnings produced by GCC:
@table @gcctabopt
@cindex syntax checking
@item -fsyntax-only
+@opindex fsyntax-only
Check the code for syntax errors, but don't do anything beyond that.
@item -pedantic
+@opindex pedantic
Issue all the warnings demanded by strict ISO C and ISO C++;
reject all programs that use forbidden extensions, and some other
programs that do not follow ISO C and ISO C++. For ISO C, follows the
-version of the ISO C standard specified by any @samp{-std} option used.
+version of the ISO C standard specified by any @option{-std} option used.
Valid ISO C and ISO C++ programs should compile properly with or without
this option (though a rare few will require @option{-ansi} or a
-@option{-std} option specifying the required version of ISO C). However,
+@option{-std} option specifying the required version of ISO C)@. However,
without this option, certain GNU extensions and traditional C and C++
features are supported as well. With this option, they are rejected.
-@samp{-pedantic} does not cause warning messages for use of the
+@option{-pedantic} does not cause warning messages for use of the
alternate keywords whose names begin and end with @samp{__}. Pedantic
warnings are also disabled in the expression that follows
@code{__extension__}. However, only system header files should use
these escape routes; application programs should avoid them.
@xref{Alternate Keywords}.
-Some users try to use @samp{-pedantic} to check programs for strict ISO
+Some users try to use @option{-pedantic} to check programs for strict ISO
C conformance. They soon find that it does not do quite what they want:
it finds some non-ISO practices, but not all---only those for which
ISO C @emph{requires} a diagnostic, and some others for which
@@ -1611,29 +1752,45 @@ diagnostics have been added.
A feature to report any failure to conform to ISO C might be useful in
some instances, but would require considerable additional work and would
-be quite different from @samp{-pedantic}. We don't have plans to
+be quite different from @option{-pedantic}. We don't have plans to
support such a feature in the near future.
+Where the standard specified with @option{-std} represents a GNU
+extended dialect of C, such as @samp{gnu89} or @samp{gnu99}, there is a
+corresponding @dfn{base standard}, the version of ISO C on which the GNU
+extended dialect is based. Warnings from @option{-pedantic} are given
+where they are required by the base standard. (It would not make sense
+for such warnings to be given only for features not in the specified GNU
+C dialect, since by definition the GNU dialects of C include all
+features the compiler supports with the given option, and there would be
+nothing to warn about.)
+
@item -pedantic-errors
-Like @samp{-pedantic}, except that errors are produced rather than
+@opindex pedantic-errors
+Like @option{-pedantic}, except that errors are produced rather than
warnings.
@item -w
+@opindex w
Inhibit all warning messages.
@item -Wno-import
+@opindex Wno-import
Inhibit warning messages about the use of @samp{#import}.
@item -Wchar-subscripts
+@opindex Wchar-subscripts
Warn if an array subscript has type @code{char}. This is a common cause
of error, as programmers often forget that this type is signed on some
machines.
@item -Wcomment
+@opindex Wcomment
Warn whenever a comment-start sequence @samp{/*} appears in a @samp{/*}
comment, or whenever a Backslash-Newline appears in a @samp{//} comment.
@item -Wformat
+@opindex Wformat
Check calls to @code{printf} and @code{scanf}, etc., to make sure that
the arguments supplied have types appropriate to the format string
specified, and that the conversions specified in the format string make
@@ -1647,71 +1804,93 @@ libc version 2.2. These include all ISO C89 and C99 features, as well
as features from the Single Unix Specification and some BSD and GNU
extensions. Other library implementations may not support all these
features; GCC does not support warning about features that go beyond a
-particular library's limitations. However, if @samp{-pedantic} is used
-with @samp{-Wformat}, warnings will be given about format features not
+particular library's limitations. However, if @option{-pedantic} is used
+with @option{-Wformat}, warnings will be given about format features not
in the selected standard version (but not for @code{strfmon} formats,
since those are not in any version of the C standard). @xref{C Dialect
Options,,Options Controlling C Dialect}.
-@samp{-Wformat} is included in @samp{-Wall}. For more control over some
-aspects of format checking, the options @samp{-Wno-format-y2k},
-@samp{-Wno-format-extra-args}, @samp{-Wformat-nonliteral},
-@samp{-Wformat-security} and @samp{-Wformat=2} are available, but are
-not included in @samp{-Wall}.
+@option{-Wformat} is included in @option{-Wall}. For more control over some
+aspects of format checking, the options @option{-Wno-format-y2k},
+@option{-Wno-format-extra-args}, @option{-Wformat-nonliteral},
+@option{-Wformat-security} and @option{-Wformat=2} are available, but are
+not included in @option{-Wall}.
@item -Wno-format-y2k
-If @samp{-Wformat} is specified, do not warn about @code{strftime}
+@opindex Wno-format-y2k
+If @option{-Wformat} is specified, do not warn about @code{strftime}
formats which may yield only a two-digit year.
@item -Wno-format-extra-args
-If @samp{-Wformat} is specified, do not warn about excess arguments to a
+@opindex Wno-format-extra-args
+If @option{-Wformat} is specified, do not warn about excess arguments to a
@code{printf} or @code{scanf} format function. The C standard specifies
that such arguments are ignored.
@item -Wformat-nonliteral
-If @samp{-Wformat} is specified, also warn if the format string is not a
+@opindex Wformat-nonliteral
+If @option{-Wformat} is specified, also warn if the format string is not a
string literal and so cannot be checked, unless the format function
takes its format arguments as a @code{va_list}.
@item -Wformat-security
-If @samp{-Wformat} is specified, also warn about uses of format
+@opindex Wformat-security
+If @option{-Wformat} is specified, also warn about uses of format
functions that represent possible security problems. At present, this
warns about calls to @code{printf} and @code{scanf} functions where the
format string is not a string literal and there are no format arguments,
as in @code{printf (foo);}. This may be a security hole if the format
string came from untrusted input and contains @samp{%n}. (This is
-currently a subset of what @samp{-Wformat-nonliteral} warns about, but
-in future warnings may be added to @samp{-Wformat-security} that are not
-included in @samp{-Wformat-nonliteral}.)
+currently a subset of what @option{-Wformat-nonliteral} warns about, but
+in future warnings may be added to @option{-Wformat-security} that are not
+included in @option{-Wformat-nonliteral}.)
@item -Wformat=2
-Enable @samp{-Wformat} plus format checks not included in
-@samp{-Wformat}. Currently equivalent to @samp{-Wformat
+@opindex Wformat=2
+Enable @option{-Wformat} plus format checks not included in
+@option{-Wformat}. Currently equivalent to @samp{-Wformat
-Wformat-nonliteral -Wformat-security}.
@item -Wimplicit-int
+@opindex Wimplicit-int
Warn when a declaration does not specify a type.
@item -Wimplicit-function-declaration
@itemx -Werror-implicit-function-declaration
+@opindex Wimplicit-function-declaration
+@opindex Werror-implicit-function-declaration
Give a warning (or error) whenever a function is used before being
declared.
@item -Wimplicit
-Same as @samp{-Wimplicit-int} and @samp{-Wimplicit-function-}@*
-@samp{declaration}.
+@opindex Wimplicit
+Same as @option{-Wimplicit-int} and @option{-Wimplicit-function-declaration}.
@item -Wmain
+@opindex Wmain
Warn if the type of @samp{main} is suspicious. @samp{main} should be a
function with external linkage, returning int, taking either zero
arguments, two, or three arguments of appropriate types.
+@item -Wmissing-braces
+@opindex Wmissing-braces
+Warn if an aggregate or union initializer is not fully bracketed. In
+the following example, the initializer for @samp{a} is not fully
+bracketed, but that for @samp{b} is fully bracketed.
+
+@smallexample
+int a[2][2] = @{ 0, 1, 2, 3 @};
+int b[2][2] = @{ @{ 0, 1 @}, @{ 2, 3 @} @};
+@end smallexample
+
@item -Wmultichar
+@opindex Wmultichar
Warn if a multicharacter constant (@samp{'FOOF'}) is used. Usually they
indicate a typo in the user's code, as they have implementation-defined
values, and should not be used in portable code.
@item -Wparentheses
+@opindex Wparentheses
Warn if parentheses are omitted in certain contexts, such
as when there is an assignment in a context where a truth value
is expected, or when operators are nested whose precedence people
@@ -1722,6 +1901,7 @@ Also warn about constructions where there may be confusion to which
such a case:
@smallexample
+@group
@{
if (a)
if (b)
@@ -1729,18 +1909,20 @@ such a case:
else
bar ();
@}
+@end group
@end smallexample
In C, every @code{else} branch belongs to the innermost possible @code{if}
statement, which in this example is @code{if (b)}. This is often not
what the programmer expected, as illustrated in the above example by
indentation the programmer chose. When there is the potential for this
-confusion, GNU C will issue a warning when this flag is specified.
+confusion, GCC will issue a warning when this flag is specified.
To eliminate the warning, add explicit braces around the innermost
@code{if} statement so there is no way the @code{else} could belong to
the enclosing @code{if}. The resulting code would look like this:
@smallexample
+@group
@{
if (a)
@{
@@ -1750,9 +1932,11 @@ the enclosing @code{if}. The resulting code would look like this:
bar ();
@}
@}
+@end group
@end smallexample
@item -Wsequence-point
+@opindex Wsequence-point
Warn about code that may have undefined semantics because of violations
of sequence point rules in the C standard.
@@ -1792,26 +1976,22 @@ The present implementation of this option only works for C programs. A
future implementation may also work for C++ programs.
There is some controversy over the precise meaning of the sequence point
-rules in subtle cases. Alternative formal definitions may be found in
-Clive Feather's ``Annex S''
-@w{@uref{http://wwwold.dkuug.dk/JTC1/SC22/WG14/www/docs/n925.htm}} and in
-Michael Norrish's thesis
-@w{@uref{http://www.cl.cam.ac.uk/users/mn200/PhD/thesis-report.ps.gz}}.
-Other discussions are by Raymond Mak
-@w{@uref{http://wwwold.dkuug.dk/JTC1/SC22/WG14/www/docs/n926.htm}} and
-D. Hugh Redelmeier
-@w{@uref{http://wwwold.dkuug.dk/JTC1/SC22/WG14/www/docs/n927.htm}}.
+rules in subtle cases. Links to papers with alternative formal definitions
+and other related discussions may be found on our readings page
+@w{@uref{http://gcc.gnu.org/readings.html}}.
@item -Wreturn-type
+@opindex Wreturn-type
Warn whenever a function is defined with a return-type that defaults to
@code{int}. Also warn about any @code{return} statement with no
-return-value in a function whose return-type is not @code{void}.
+return-value in a function whose return-type is not @code{void}.
For C++, a function without return type always produces a diagnostic
-message, even when @samp{-Wno-return-type} is specified. The only
+message, even when @option{-Wno-return-type} is specified. The only
exceptions are @samp{main} and functions defined in system headers.
@item -Wswitch
+@opindex Wswitch
Warn whenever a @code{switch} statement has an index of enumeral type
and lacks a @code{case} for one or more of the named codes of that
enumeration. (The presence of a @code{default} label prevents this
@@ -1819,26 +1999,31 @@ warning.) @code{case} labels outside the enumeration range also
provoke warnings when this option is used.
@item -Wtrigraphs
+@opindex Wtrigraphs
Warn if any trigraphs are encountered that might change the meaning of
the program (trigraphs within comments are not warned about).
@item -Wunused-function
+@opindex Wunused-function
Warn whenever a static function is declared but not defined or a
non\-inline static function is unused.
@item -Wunused-label
+@opindex Wunused-label
Warn whenever a label is declared but not used.
To suppress this warning use the @samp{unused} attribute
(@pxref{Variable Attributes}).
@item -Wunused-parameter
+@opindex Wunused-parameter
Warn whenever a function parameter is unused aside from its declaration.
To suppress this warning use the @samp{unused} attribute
(@pxref{Variable Attributes}).
@item -Wunused-variable
+@opindex Wunused-variable
Warn whenever a local variable or non-constant static variable is unused
aside from its declaration
@@ -1846,24 +2031,27 @@ To suppress this warning use the @samp{unused} attribute
(@pxref{Variable Attributes}).
@item -Wunused-value
+@opindex Wunused-value
Warn whenever a statement computes a result that is explicitly not used.
To suppress this warning cast the expression to @samp{void}.
@item -Wunused
-All all the above @samp{-Wunused} options combined.
+@opindex Wunused
+All all the above @option{-Wunused} options combined.
In order to get a warning about an unused function parameter, you must
either specify @samp{-W -Wunused} or separately specify
-@samp{-Wunused-parameter}.
+@option{-Wunused-parameter}.
@item -Wuninitialized
+@opindex Wuninitialized
Warn if an automatic variable is used without first being initialized or
if a variable may be clobbered by a @code{setjmp} call.
These warnings are possible only in optimizing compilation,
because they require data flow information that is computed only
-when optimizing. If you don't specify @samp{-O}, you simply won't
+when optimizing. If you don't specify @option{-O}, you simply won't
get these warnings.
These warnings occur only for variables that are candidates for
@@ -1883,6 +2071,7 @@ despite appearing to have an error. Here is one example of how
this can happen:
@smallexample
+@group
@{
int x;
switch (y)
@@ -1895,6 +2084,7 @@ this can happen:
@}
foo (x);
@}
+@end group
@end smallexample
@noindent
@@ -1929,28 +2119,32 @@ Some spurious warnings can be avoided if you declare all the functions
you use that never return as @code{noreturn}. @xref{Function
Attributes}.
-@item -Wreorder (C++ only)
+@item -Wreorder @r{(C++ only)}
+@opindex Wreorder
@cindex reordering, warning
@cindex warning for reordering of member initializers
Warn when the order of member initializers given in the code does not
match the order in which they must be executed. For instance:
@item -Wunknown-pragmas
+@opindex Wunknown-pragmas
@cindex warning for unknown pragmas
@cindex unknown pragmas, warning
@cindex pragmas, warning of unknown
Warn when a #pragma directive is encountered which is not understood by
-GCC. If this command line option is used, warnings will even be issued
+GCC@. If this command line option is used, warnings will even be issued
for unknown pragmas in system header files. This is not the case if
-the warnings were only enabled by the @samp{-Wall} command line option.
+the warnings were only enabled by the @option{-Wall} command line option.
@item -Wall
+@opindex Wall
All of the above @samp{-W} options combined. This enables all the
warnings about constructions that some users consider questionable, and
that are easy to avoid (or modify to prevent the warning), even in
conjunction with macros.
@item -Wsystem-headers
+@opindex Wsystem-headers
@cindex warnings from system headers
@cindex system headers, warnings from
Print warning messages for constructs found in system header files.
@@ -1958,12 +2152,12 @@ Warnings from system headers are normally suppressed, on the assumption
that they usually do not indicate real problems and would only make the
compiler output harder to read. Using this command line option tells
GCC to emit warnings from system headers as if they occurred in user
-code. However, note that using @samp{-Wall} in conjunction with this
+code. However, note that using @option{-Wall} in conjunction with this
option will @emph{not} warn about unknown pragmas in system
-headers---for that, @samp{-Wunknown-pragmas} must also be used.
+headers---for that, @option{-Wunknown-pragmas} must also be used.
@end table
-The following @samp{-W@dots{}} options are not implied by @samp{-Wall}.
+The following @option{-W@dots{}} options are not implied by @option{-Wall}.
Some of them warn about constructions that users generally do not
consider questionable, but which occasionally you might wish to check
for; others warn about constructions that are necessary or hard to avoid
@@ -1972,6 +2166,7 @@ the warning.
@table @gcctabopt
@item -W
+@opindex W
Print extra warning messages for these events:
@itemize @bullet
@@ -2015,16 +2210,16 @@ The return type of a function has a type qualifier such as @code{const}.
Such a type qualifier has no effect, since the value returned by a
function is not an lvalue. (But don't warn about the GNU extension of
@code{volatile void} return types. That extension will be warned about
-if @samp{-pedantic} is specified.)
+if @option{-pedantic} is specified.)
@item
-If @samp{-Wall} or @samp{-Wunused} is also specified, warn about unused
+If @option{-Wall} or @option{-Wunused} is also specified, warn about unused
arguments.
@item
A comparison between signed and unsigned values could produce an
incorrect result when the signed value is converted to unsigned.
-(But don't warn if @samp{-Wno-sign-compare} is also specified.)
+(But don't warn if @option{-Wno-sign-compare} is also specified.)
@item
An aggregate has a partly bracketed initializer.
@@ -2049,6 +2244,7 @@ struct s x = @{ 3, 4 @};
@end itemize
@item -Wfloat-equal
+@opindex Wfloat-equal
Warn if floating point values are used in equality comparisons.
The idea behind this is that sometimes it is convenient (for the
@@ -2062,21 +2258,23 @@ would check to see whether the two values have ranges that overlap; and
this is done with the relational operators, so equality comparisons are
probably mistaken.
-@item -Wtraditional (C only)
+@item -Wtraditional @r{(C only)}
+@opindex Wtraditional
Warn about certain constructs that behave differently in traditional and
-ISO C.
+ISO C@. Also warn about ISO C constructs that have no traditional C
+equivalent, and/or problematic constructs which should be avoided.
@itemize @bullet
@item
Macro parameters that appear within string literals in the macro body.
In traditional C macro replacement takes place within string literals,
-but does not in ISO C.
+but does not in ISO C@.
@item
In traditional C, some preprocessor directives did not exist.
Traditional preprocessors would only consider a line to be a directive
if the @samp{#} appeared in column 1 on the line. Therefore
-@samp{-Wtraditional} warns about directives that traditional C
+@option{-Wtraditional} warns about directives that traditional C
understands but would ignore because the @samp{#} does not appear as the
first character on the line. It also suggests you hide directives like
@samp{#pragma} not understood by traditional C by indenting them. Some
@@ -2090,13 +2288,13 @@ A function-like macro that appears without arguments.
The unary plus operator.
@item
-The `U' integer constant suffix, or the `F' or `L' floating point
-constant suffixes. (Traditonal C does support the `L' suffix on integer
+The @samp{U} integer constant suffix, or the @samp{F} or @samp{L} floating point
+constant suffixes. (Traditional C does support the @samp{L} suffix on integer
constants.) Note, these suffixes appear in macros defined in the system
-headers of most modern systems, e.g. the _MIN/_MAX macros in limits.h.
-Use of these macros can lead to spurious warnings as they do not
-necessarily reflect whether the code in question is any less portable to
-traditional C given that suitable backup definitions are provided.
+headers of most modern systems, e.g.@: the @samp{_MIN}/@samp{_MAX} macros in @code{<limits.h>}.
+Use of these macros in user code might normally lead to spurious
+warnings, however gcc's integrated preprocessor has enough context to
+avoid warning in these cases.
@item
A function declared external in one block and then used after the end of
@@ -2112,7 +2310,7 @@ This construct is not accepted by some traditional C compilers.
@item
The ISO type of an integer constant has a different width or
signedness from its traditional type. This warning is only issued if
-the base of the constant is ten. I.e. hexadecimal or octal values, which
+the base of the constant is ten. I.e.@: hexadecimal or octal values, which
typically represent bit patterns, are not warned about.
@item
@@ -2128,56 +2326,76 @@ namespace for labels.
@item
Initialization of unions. If the initializer is zero, the warning is
omitted. This is done under the assumption that the zero initializer in
-user code appears conditioned on e.g. @code{__STDC__} to avoid missing
+user code appears conditioned on e.g.@: @code{__STDC__} to avoid missing
initializer warnings and relies on default initialization to zero in the
traditional C case.
+
+@item
+Conversions by prototypes between fixed/floating point values and vice
+versa. The absence of these prototypes when compiling with traditional
+C would cause serious problems. This is a subset of the possible
+conversion warnings, for the full set use @option{-Wconversion}.
@end itemize
@item -Wundef
+@opindex Wundef
Warn if an undefined identifier is evaluated in an @samp{#if} directive.
@item -Wshadow
-Warn whenever a local variable shadows another local variable.
+@opindex Wshadow
+Warn whenever a local variable shadows another local variable, parameter or
+global variable or whenever a built-in function is shadowed.
@item -Wid-clash-@var{len}
+@opindex Wid-clash
Warn whenever two distinct identifiers match in the first @var{len}
characters. This may help you prepare a program that will compile
with certain obsolete, brain-damaged compilers.
@item -Wlarger-than-@var{len}
+@opindex Wlarger-than
Warn whenever an object of larger than @var{len} bytes is defined.
@item -Wpointer-arith
+@opindex Wpointer-arith
Warn about anything that depends on the ``size of'' a function type or
of @code{void}. GNU C assigns these types a size of 1, for
convenience in calculations with @code{void *} pointers and pointers
to functions.
-@item -Wbad-function-cast (C only)
+@item -Wbad-function-cast @r{(C only)}
+@opindex Wbad-function-cast
Warn whenever a function call is cast to a non-matching type.
For example, warn if @code{int malloc()} is cast to @code{anything *}.
@item -Wcast-qual
+@opindex Wcast-qual
Warn whenever a pointer is cast so as to remove a type qualifier from
the target type. For example, warn if a @code{const char *} is cast
to an ordinary @code{char *}.
@item -Wcast-align
+@opindex Wcast-align
Warn whenever a pointer is cast such that the required alignment of the
target is increased. For example, warn if a @code{char *} is cast to
an @code{int *} on machines where integers can only be accessed at
two- or four-byte boundaries.
@item -Wwrite-strings
-Give string constants the type @code{const char[@var{length}]} so that
+@opindex Wwrite-strings
+When compiling C, give string constants the type @code{const
+char[@var{length}]} so that
copying the address of one into a non-@code{const} @code{char *}
-pointer will get a warning. These warnings will help you find at
+pointer will get a warning; when compiling C++, warn about the
+deprecated conversion from string constants to @code{char *}.
+These warnings will help you find at
compile time code that can try to write into a string constant, but
only if you have been very careful about using @code{const} in
declarations and prototypes. Otherwise, it will just be a nuisance;
-this is why we did not make @samp{-Wall} request these warnings.
+this is why we did not make @option{-Wall} request these warnings.
@item -Wconversion
+@opindex Wconversion
Warn if a prototype causes a type conversion that is different from what
would happen to the same argument in the absence of a prototype. This
includes conversions of fixed point to floating and vice versa, and
@@ -2190,38 +2408,44 @@ converted to an unsigned type. For example, warn about the assignment
casts like @code{(unsigned) -1}.
@item -Wsign-compare
+@opindex Wsign-compare
@cindex warning for comparison of signed and unsigned values
@cindex comparison of signed and unsigned values, warning
@cindex signed and unsigned values, comparison warning
Warn when a comparison between signed and unsigned values could produce
an incorrect result when the signed value is converted to unsigned.
-This warning is also enabled by @samp{-W}; to get the other warnings
-of @samp{-W} without this warning, use @samp{-W -Wno-sign-compare}.
+This warning is also enabled by @option{-W}; to get the other warnings
+of @option{-W} without this warning, use @samp{-W -Wno-sign-compare}.
@item -Waggregate-return
+@opindex Waggregate-return
Warn if any functions that return structures or unions are defined or
called. (In languages where you can return an array, this also elicits
a warning.)
-@item -Wstrict-prototypes (C only)
+@item -Wstrict-prototypes @r{(C only)}
+@opindex Wstrict-prototypes
Warn if a function is declared or defined without specifying the
argument types. (An old-style function definition is permitted without
a warning if preceded by a declaration which specifies the argument
types.)
-@item -Wmissing-prototypes (C only)
+@item -Wmissing-prototypes @r{(C only)}
+@opindex Wmissing-prototypes
Warn if a global function is defined without a previous prototype
declaration. This warning is issued even if the definition itself
provides a prototype. The aim is to detect global functions that fail
to be declared in header files.
@item -Wmissing-declarations
+@opindex Wmissing-declarations
Warn if a global function is defined without a previous declaration.
Do so even if the definition itself provides a prototype.
Use this option to detect global functions that are not declared in
header files.
@item -Wmissing-noreturn
+@opindex Wmissing-noreturn
Warn about functions which might be candidates for attribute @code{noreturn}.
Note these are only possible candidates, not absolute ones. Care should
be taken to manually verify functions actually do not ever return before
@@ -2230,18 +2454,21 @@ bugs could be introduced. You will not get a warning for @code{main} in
hosted C environments.
@item -Wmissing-format-attribute
-If @samp{-Wformat} is enabled, also warn about functions which might be
+@opindex Wmissing-format-attribute
+@opindex Wformat
+If @option{-Wformat} is enabled, also warn about functions which might be
candidates for @code{format} attributes. Note these are only possible
candidates, not absolute ones. GCC will guess that @code{format}
attributes might be appropriate for any function that calls a function
like @code{vprintf} or @code{vscanf}, but this might not always be the
case, and some functions for which @code{format} attributes are
appropriate may not be detected. This option has no effect unless
-@samp{-Wformat} is enabled (possibly by @samp{-Wall}).
+@option{-Wformat} is enabled (possibly by @option{-Wall}).
@item -Wpacked
+@opindex Wpacked
Warn if a structure is given the packed attribute, but the packed
-attribute has no effect on the layout or size of the structure.
+attribute has no effect on the layout or size of the structure.
Such structures may be mis-aligned for little benefit. For
instance, in this code, the variable @code{f.x} in @code{struct bar}
will be misaligned even though @code{struct bar} does not itself
@@ -2261,19 +2488,23 @@ struct bar @{
@end smallexample
@item -Wpadded
+@opindex Wpadded
Warn if padding is included in a structure, either to align an element
of the structure or to align the whole structure. Sometimes when this
happens it is possible to rearrange the fields of the structure to
reduce the padding and so make the structure smaller.
@item -Wredundant-decls
+@opindex Wredundant-decls
Warn if anything is declared more than once in the same scope, even in
cases where multiple declaration is valid and changes nothing.
-@item -Wnested-externs (C only)
+@item -Wnested-externs @r{(C only)}
+@opindex Wnested-externs
Warn if an @code{extern} declaration is encountered within a function.
@item -Wunreachable-code
+@opindex Wunreachable-code
Warn if the compiler detects that code will never be executed.
This option is intended to warn when the compiler detects that at
@@ -2286,24 +2517,28 @@ are circumstances under which part of the affected line can be executed,
so care should be taken when removing apparently-unreachable code.
For instance, when a function is inlined, a warning may mean that the
-line is unreachable in only one inlined copy of the function.
+line is unreachable in only one inlined copy of the function.
-This option is not made part of @samp{-Wall} because in a debugging
+This option is not made part of @option{-Wall} because in a debugging
version of a program there is often substantial code which checks
correct functioning of the program and is, hopefully, unreachable
because the program does work. Another common use of unreachable
code is to provide behaviour which is selectable at compile-time.
@item -Winline
+@opindex Winline
Warn if a function can not be inlined and it was declared as inline.
@item -Wlong-long
+@opindex Wlong-long
+@opindex Wno-long-long
Warn if @samp{long long} type is used. This is default. To inhibit
-the warning messages, use @samp{-Wno-long-long}. Flags
-@samp{-Wlong-long} and @samp{-Wno-long-long} are taken into account
-only when @samp{-pedantic} flag is used.
+the warning messages, use @option{-Wno-long-long}. Flags
+@option{-Wlong-long} and @option{-Wno-long-long} are taken into account
+only when @option{-pedantic} flag is used.
@item -Wdisabled-optimization
+@opindex Wdisabled-optimization
Warn if a requested optimization pass is disabled. This warning does
not generally indicate that there is anything wrong with your code; it
merely indicates that GCC's optimizers were unable to handle the code
@@ -2312,6 +2547,7 @@ complex; GCC will refuse to optimize programs when the optimization
itself is likely to take inordinate amounts of time.
@item -Werror
+@opindex Werror
Make all warnings into errors.
@end table
@@ -2325,21 +2561,22 @@ either your program or GCC:
@table @gcctabopt
@item -g
+@opindex g
Produce debugging information in the operating system's native format
-(stabs, COFF, XCOFF, or DWARF). GDB can work with this debugging
+(stabs, COFF, XCOFF, or DWARF)@. GDB can work with this debugging
information.
-On most systems that use stabs format, @samp{-g} enables use of extra
+On most systems that use stabs format, @option{-g} enables use of extra
debugging information that only GDB can use; this extra information
makes debugging work better in GDB but will probably make other debuggers
crash or
refuse to read the program. If you want to control for certain whether
-to generate the extra information, use @samp{-gstabs+}, @samp{-gstabs},
-@samp{-gxcoff+}, @samp{-gxcoff}, @samp{-gdwarf-1+}, or @samp{-gdwarf-1}
+to generate the extra information, use @option{-gstabs+}, @option{-gstabs},
+@option{-gxcoff+}, @option{-gxcoff}, @option{-gdwarf-1+}, or @option{-gdwarf-1}
(see below).
-Unlike most other C compilers, GCC allows you to use @samp{-g} with
-@samp{-O}. The shortcuts taken by optimized code may occasionally
+Unlike most other C compilers, GCC allows you to use @option{-g} with
+@option{-O}. The shortcuts taken by optimized code may occasionally
produce surprising results: some variables you declared may not exist
at all; flow of control may briefly move where you did not expect it;
some statements may not be executed because they compute constant
@@ -2353,52 +2590,61 @@ The following options are useful when GCC is generated with the
capability for more than one debugging format.
@item -ggdb
-Produce debugging information for use by GDB. This means to use the
+@opindex ggdb
+Produce debugging information for use by GDB@. This means to use the
most expressive format available (DWARF 2, stabs, or the native format
if neither of those are supported), including GDB extensions if at all
possible.
@item -gstabs
+@opindex gstabs
Produce debugging information in stabs format (if that is supported),
without GDB extensions. This is the format used by DBX on most BSD
systems. On MIPS, Alpha and System V Release 4 systems this option
-produces stabs debugging output which is not understood by DBX or SDB.
+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 -gstabs+
+@opindex gstabs+
Produce debugging information in stabs format (if that is supported),
-using GNU extensions understood only by the GNU debugger (GDB). The
+using GNU extensions understood only by the GNU debugger (GDB)@. The
use of these extensions is likely to make other debuggers crash or
refuse to read the program.
@item -gcoff
+@opindex gcoff
Produce debugging information in COFF format (if that is supported).
This is the format used by SDB on most System V systems prior to
System V Release 4.
@item -gxcoff
+@opindex gxcoff
Produce debugging information in XCOFF format (if that is supported).
This is the format used by the DBX debugger on IBM RS/6000 systems.
@item -gxcoff+
+@opindex gxcoff+
Produce debugging information in XCOFF format (if that is supported),
-using GNU extensions understood only by the GNU debugger (GDB). The
+using GNU extensions understood only by the GNU debugger (GDB)@. The
use of these extensions is likely to make other debuggers crash or
refuse to read the program, and may cause assemblers other than the GNU
assembler (GAS) to fail with an error.
@item -gdwarf
+@opindex gdwarf
Produce debugging information in DWARF version 1 format (if that is
supported). This is the format used by SDB on most System V Release 4
systems.
@item -gdwarf+
+@opindex gdwarf+
Produce debugging information in DWARF version 1 format (if that is
supported), using GNU extensions understood only by the GNU debugger
-(GDB). The use of these extensions is likely to make other debuggers
+(GDB)@. The use of these extensions is likely to make other debuggers
crash or refuse to read the program.
@item -gdwarf-2
+@opindex gdwarf-2
Produce debugging information in DWARF version 2 format (if that is
supported). This is the format used by DBX on IRIX 6.
@@ -2419,10 +2665,11 @@ about local variables and no line numbers.
Level 3 includes extra information, such as all the macro definitions
present in the program. Some debuggers support macro expansion when
-you use @samp{-g3}.
+you use @option{-g3}.
@cindex @code{prof}
@item -p
+@opindex p
Generate extra code to write profile information suitable for the
analysis program @code{prof}. You must use this option when compiling
the source files you want data about, and you must also use it when
@@ -2430,6 +2677,7 @@ linking.
@cindex @code{gprof}
@item -pg
+@opindex pg
Generate extra code to write profile information suitable for the
analysis program @code{gprof}. You must use this option when compiling
the source files you want data about, and you must also use it when
@@ -2437,9 +2685,10 @@ linking.
@cindex @code{tcov}
@item -a
+@opindex a
Generate extra code to write profile information for basic blocks, which will
record the number of times each basic block is executed, the basic block start
-address, and the function name containing the basic block. If @samp{-g} is
+address, and the function name containing the basic block. If @option{-g} is
used, the line number and filename of the start of the basic block will also be
recorded. If not overridden by the machine description, the default action is
to append to the text file @file{bb.out}.
@@ -2449,12 +2698,24 @@ however, that the format of the data is not what @code{tcov} expects.
Eventually GNU @code{gprof} should be extended to process this data.
@item -Q
+@opindex Q
Makes the compiler print out each function name as it is compiled, and
print some statistics about each pass when it finishes.
+@item -ftime-report
+@opindex ftime-report
+Makes the compiler print some statistics about the time consumed by each
+pass when it finishes.
+
+@item -fmem-report
+@opindex fmem-report
+Makes the compiler print some statistics about permanent memory
+allocation when it finishes.
+
@item -ax
+@opindex ax
Generate extra code to profile basic blocks. Your executable will
-produce output that is a superset of that produced when @samp{-a} is
+produce output that is a superset of that produced when @option{-a} is
used. Additional output is the source and target address of the basic
blocks where a jump takes place, the number of times a jump is executed,
and (optionally) the complete sequence of basic blocks being executed.
@@ -2464,7 +2725,7 @@ You can examine different profiling aspects without recompilation. Your
executable will read a list of function names from file @file{bb.in}.
Profiling starts when a function on the list is entered and stops when
that invocation is exited. To exclude a function from profiling, prefix
-its name with `-'. If a function name is not unique, you can
+its name with @samp{-}. If a function name is not unique, you can
disambiguate it by writing it in the form
@samp{/path/filename.d:functionname}. Your executable will write the
available paths and filenames in file @file{bb.out}.
@@ -2526,6 +2787,7 @@ written to @file{bbtrace.gz}. It is solely used for counting jump
frequencies.
@item -fprofile-arcs
+@opindex fprofile-arcs
Instrument @dfn{arcs} during compilation. For each function of your
program, GCC creates a program flow graph, then finds a spanning tree
for the graph. Only arcs that are not on the spanning tree have to be
@@ -2536,26 +2798,27 @@ new basic block must be created to hold the instrumentation code.
Since not every arc in the program must be instrumented, programs
compiled with this option run faster than programs compiled with
-@samp{-a}, which adds instrumentation code to every basic block in the
+@option{-a}, which adds instrumentation code to every basic block in the
program. The tradeoff: since @code{gcov} does not have
execution counts for all branches, it must start with the execution
counts for the instrumented branches, and then iterate over the program
flow graph until the entire graph has been solved. Hence, @code{gcov}
runs a little more slowly than a program which uses information from
-@samp{-a}.
+@option{-a}.
-@samp{-fprofile-arcs} also makes it possible to estimate branch
+@option{-fprofile-arcs} also makes it possible to estimate branch
probabilities, and to calculate basic block execution counts. In
general, basic block execution counts do not give enough information to
estimate all branch probabilities. When the compiled program exits, it
saves the arc execution counts to a file called
@file{@var{sourcename}.da}. Use the compiler option
-@samp{-fbranch-probabilities} (@pxref{Optimize Options,,Options that
+@option{-fbranch-probabilities} (@pxref{Optimize Options,,Options that
Control Optimization}) when recompiling, to optimize using estimated
branch probabilities.
@need 2000
@item -ftest-coverage
+@opindex ftest-coverage
Create data files for the @code{gcov} code-coverage utility
(@pxref{Gcov,, @code{gcov}: a GCC Test Coverage Program}).
The data file names begin with the name of your source file:
@@ -2570,125 +2833,201 @@ A list of all arcs in the program flow graph. This allows @code{gcov}
to reconstruct the program flow graph, so that it can compute all basic
block and arc execution counts from the information in the
@code{@var{sourcename}.da} file (this last file is the output from
-@samp{-fprofile-arcs}).
+@option{-fprofile-arcs}).
@end table
@item -d@var{letters}
+@opindex d
Says to make debugging dumps during compilation at times specified by
@var{letters}. This is used for debugging the compiler. The file names
for most of the dumps are made by appending a pass number and a word to
-the source file name (e.g. @file{foo.c.00.rtl} or @file{foo.c.01.sibling}).
+the source file name (e.g. @file{foo.c.00.rtl} or @file{foo.c.01.sibling}).
Here are the possible letters for use in @var{letters}, and their meanings:
@table @samp
@item A
+@opindex dA
Annotate the assembler output with miscellaneous debugging information.
@item b
+@opindex db
Dump after computing branch probabilities, to @file{@var{file}.11.bp}.
@item B
+@opindex dB
Dump after block reordering, to @file{@var{file}.26.bbro}.
@item c
+@opindex dc
Dump after instruction combination, to the file @file{@var{file}.14.combine}.
@item C
+@opindex dC
Dump after the first if conversion, to the file @file{@var{file}.15.ce}.
@item d
+@opindex dd
Dump after delayed branch scheduling, to @file{@var{file}.29.dbr}.
@item D
+@opindex dD
Dump all macro definitions, at the end of preprocessing, in addition to
normal output.
@item e
+@opindex de
Dump after SSA optimizations, to @file{@var{file}.05.ssa} and
@file{@var{file}.06.ussa}.
@item E
+@opindex dE
Dump after the second if conversion, to @file{@var{file}.24.ce2}.
@item f
+@opindex df
Dump after life analysis, to @file{@var{file}.13.life}.
@item F
+@opindex dF
Dump after purging @code{ADDRESSOF} codes, to @file{@var{file}.04.addressof}.
@item g
+@opindex dg
Dump after global register allocation, to @file{@var{file}.19.greg}.
@item o
+@opindex do
Dump after post-reload CSE and other optimizations, to @file{@var{file}.20.postreload}.
-@item G
+@item G
+@opindex dG
Dump after GCSE, to @file{@var{file}.08.gcse}.
@item i
+@opindex di
Dump after sibling call optimizations, to @file{@var{file}.01.sibling}.
@item j
+@opindex dj
Dump after the first jump optimization, to @file{@var{file}.02.jump}.
@item J
+@opindex dJ
Dump after the last jump optimization, to @file{@var{file}.27.jump2}.
@item k
+@opindex dk
Dump after conversion from registers to stack, to @file{@var{file}.29.stack}.
@item l
+@opindex dl
Dump after local register allocation, to @file{@var{file}.18.lreg}.
@item L
+@opindex dL
Dump after loop optimization, to @file{@var{file}.09.loop}.
@item M
+@opindex dM
Dump after performing the machine dependent reorganisation pass, to
-@file{@var{file}.28.mach}.
+@file{@var{file}.28.mach}.
@item n
+@opindex dn
Dump after register renumbering, to @file{@var{file}.23.rnreg}.
@item N
+@opindex dN
Dump after the register move pass, to @file{@var{file}.16.regmove}.
@item r
+@opindex dr
Dump after RTL generation, to @file{@var{file}.00.rtl}.
@item R
+@opindex dR
Dump after the second instruction scheduling pass, to
@file{@var{file}.25.sched2}.
@item s
+@opindex ds
Dump after CSE (including the jump optimization that sometimes follows
-CSE), to @file{@var{file}.03.cse}.
+CSE), to @file{@var{file}.03.cse}.
@item S
+@opindex dS
Dump after the first instruction scheduling pass, to
@file{@var{file}.17.sched}.
@item t
+@opindex dt
Dump after the second CSE pass (including the jump optimization that
sometimes follows CSE), to @file{@var{file}.10.cse2}.
@item w
+@opindex dw
Dump after the second flow pass, to @file{@var{file}.21.flow2}.
@item X
+@opindex dX
Dump after dead code elimination, to @file{@var{file}.06.dce}.
@item z
+@opindex dz
Dump after the peephole pass, to @file{@var{file}.22.peephole2}.
@item a
+@opindex da
Produce all the dumps listed above.
@item m
+@opindex dm
Print statistics on memory usage, at the end of the run, to
standard error.
@item p
+@opindex dp
Annotate the assembler output with a comment indicating which
pattern and alternative was used. The length of each instruction is
also printed.
@item P
+@opindex dP
Dump the RTL in the assembler output as a comment before each instruction.
-Also turns on @samp{-dp} annotation.
+Also turns on @option{-dp} annotation.
@item v
+@opindex dv
For each of the other indicated dump files (except for
@file{@var{file}.00.rtl}), dump a representation of the control flow graph
suitable for viewing with VCG to @file{@var{file}.@var{pass}.vcg}.
@item x
+@opindex dx
Just generate RTL for a function instead of compiling it. Usually used
with @samp{r}.
@item y
+@opindex dy
Dump debugging information during parsing, to standard error.
@end table
@item -fdump-unnumbered
-When doing debugging dumps (see -d option above), suppress instruction
+@opindex fdump-unnumbered
+When doing debugging dumps (see @option{-d} option above), suppress instruction
numbers and line number note output. This makes it more feasible to
use diff on debugging dumps for compiler invocations with different
-options, in particular with and without -g.
+options, in particular with and without @option{-g}.
-@item -fdump-translation-unit=@var{file} (C and C++ only)
+@item -fdump-translation-unit @r{(C and C++ only)}
+@itemx -fdump-translation-unit-@var{number} @r{(C and C++ only)}
+@opindex fdump-translation-unit
Dump a representation of the tree structure for the entire translation
-unit to @var{file}.
+unit to a file. The file name is made by appending @file{.tu} to the
+source file name. If the @samp{-@var{number}} form is used, @var{number}
+controls the details of the dump as described for the @option{-fdump-tree} options.
+
+@item -fdump-class-hierarchy @r{(C++ only)}
+@itemx -fdump-class-hierarchy-@var{number} @r{(C++ only)}
+@opindex fdump-class-hierarchy
+Dump a representation of each class's hierarchy and virtual function
+table layout to a file. The file name is made by appending @file{.class}
+to the source file name. If the @samp{-@var{number}} form is used, @var{number}
+controls the details of the dump as described for the @option{-fdump-tree}
+options.
-@item -fdump-class_layout=@var{file} (C++ only)
-@item -fdump-class_layout (C++ only)
-Dump a representation of each class's heirarchy to @var{file}, or
-@code{stderr} if not specified.
+@item -fdump-ast-@var{switch} @r{(C++ only)}
+@itemx -fdump-ast-@var{switch}-@var{number} @r{(C++ only)}
+@opindex fdump-ast
+Control the dumping at various stages of processing the abstract syntax
+tree to a file. The file name is generated by appending a switch
+specific suffix to the source file name. If the @samp{-@var{number}} form is
+used, @var{number} is a bit mask which controls the details of the
+dump. The following bits are meaningful (these are not set symbolically,
+as the primary function of these dumps is for debugging gcc itself):
+
+@table @samp
+@item bit0 (1)
+Print the address of each node. Usually this is not meaningful as it
+changes according to the environment and source file.
+@item bit1 (2)
+Inhibit dumping of members of a scope or body of a function, unless they
+are reachable by some other path.
+@end table
+
+The following tree dumps are possible:
+@table @samp
+@item original
+Dump before any tree based optimization, to @file{@var{file}.original}.
+@item optimized
+Dump after all tree based optimization, to @file{@var{file}.optimized}.
+@end table
@item -fpretend-float
+@opindex fpretend-float
When running a cross-compiler, pretend that the target machine uses the
same floating point format as the host machine. This causes incorrect
output of the actual floating constants, but the actual instruction
@@ -2696,6 +3035,7 @@ sequence will probably be the same as GCC would make when running on
the target machine.
@item -save-temps
+@opindex save-temps
Store the usual ``temporary'' intermediate files permanently; place them
in the current directory and name them based on the source file. Thus,
compiling @file{foo.c} with @samp{-c -save-temps} would produce files
@@ -2704,6 +3044,7 @@ preprocessed @file{foo.i} output file even though the compiler now
normally uses an integrated preprocessor.
@item -time
+@opindex time
Report the CPU time taken by each subprocess in the compilation
sequence. For C source files, this is the compiler proper and assembler
(plus the linker if linking is done). The output looks like this:
@@ -2719,18 +3060,35 @@ time spent executing operating system routines on behalf of the program.
Both numbers are in seconds.
@item -print-file-name=@var{library}
+@opindex print-file-name
Print the full absolute name of the library file @var{library} that
would be used when linking---and don't do anything else. With this
option, GCC does not compile or link anything; it just prints the
file name.
+@item -print-multi-directory
+@opindex print-multi-directory
+Print the directory name corresponding to the multilib selected by any
+other switches present in the command line. This directory is supposed
+to exist in @env{GCC_EXEC_PREFIX}.
+
+@item -print-multi-lib
+@opindex print-multi-lib
+Print the mapping from multilib directory names to compiler switches
+that enable them. The directory name is separated from the switches by
+@samp{;}, and each switch starts with an @samp{@@} instead of the
+@samp{-}, without spaces between multiple switches. This is supposed to
+ease shell-processing.
+
@item -print-prog-name=@var{program}
-Like @samp{-print-file-name}, but searches for a program such as @samp{cpp}.
+@opindex print-prog-name
+Like @option{-print-file-name}, but searches for a program such as @samp{cpp}.
@item -print-libgcc-file-name
-Same as @samp{-print-file-name=libgcc.a}.
+@opindex print-libgcc-file-name
+Same as @option{-print-file-name=libgcc.a}.
-This is useful when you use @samp{-nostdlib} or @samp{-nodefaultlibs}
+This is useful when you use @option{-nostdlib} or @option{-nodefaultlibs}
but you do want to link with @file{libgcc.a}. You can do
@example
@@ -2738,6 +3096,7 @@ gcc -nostdlib @var{files}@dots{} `gcc -print-libgcc-file-name`
@end example
@item -print-search-dirs
+@opindex print-search-dirs
Print the name of the configured installation directory and a list of
program and library directories gcc will search---and don't do anything else.
@@ -2748,6 +3107,21 @@ components where gcc expects to find them, or you can set the environment
variable @env{GCC_EXEC_PREFIX} to the directory where you installed them.
Don't forget the trailing '/'.
@xref{Environment Variables}.
+
+@item -dumpmachine
+@opindex dumpmachine
+Print the compiler's target machine (for example,
+@samp{i686-pc-linux-gnu})---and don't do anything else.
+
+@item -dumpversion
+@opindex dumpversion
+Print the compiler version (for example, @samp{3.0})---and don't do
+anything else.
+
+@item -dumpspecs
+@opindex dumpspecs
+Print the compiler's built-in specs---and don't do anything else. (This
+is used when GCC itself is being built.) @xref{Spec Files}.
@end table
@node Optimize Options
@@ -2760,68 +3134,78 @@ These options control various sorts of optimizations:
@table @gcctabopt
@item -O
@itemx -O1
+@opindex O
+@opindex O1
Optimize. Optimizing compilation takes somewhat more time, and a lot
more memory for a large function.
-Without @samp{-O}, the compiler's goal is to reduce the cost of
+Without @option{-O}, the compiler's goal is to reduce the cost of
compilation and to make debugging produce the expected results.
Statements are independent: if you stop the program with a breakpoint
between statements, you can then assign a new value to any variable or
change the program counter to any other statement in the function and
get exactly the results you would expect from the source code.
-Without @samp{-O}, the compiler only allocates variables declared
+Without @option{-O}, the compiler only allocates variables declared
@code{register} in registers. The resulting compiled code is a little
-worse than produced by PCC without @samp{-O}.
+worse than produced by PCC without @option{-O}.
-With @samp{-O}, the compiler tries to reduce code size and execution
+With @option{-O}, the compiler tries to reduce code size and execution
time.
-When you specify @samp{-O}, the compiler turns on @samp{-fthread-jumps}
-and @samp{-fdefer-pop} on all machines. The compiler turns on
-@samp{-fdelayed-branch} on machines that have delay slots, and
-@samp{-fomit-frame-pointer} on machines that can support debugging even
+When you specify @option{-O}, the compiler turns on @option{-fthread-jumps}
+and @option{-fdefer-pop} on all machines. The compiler turns on
+@option{-fdelayed-branch} on machines that have delay slots, and
+@option{-fomit-frame-pointer} on machines that can support debugging even
without a frame pointer. On some machines the compiler also turns
-on other flags.@refill
+on other flags.
@item -O2
+@opindex O2
Optimize even more. GCC performs nearly all supported optimizations
that do not involve a space-speed tradeoff. The compiler does not
-perform loop unrolling or function inlining when you specify @samp{-O2}.
-As compared to @samp{-O}, this option increases both compilation time
+perform loop unrolling or function inlining when you specify @option{-O2}.
+As compared to @option{-O}, this option increases both compilation time
and the performance of the generated code.
-@samp{-O2} turns on all optional optimizations except for loop unrolling,
+@option{-O2} turns on all optional optimizations except for loop unrolling,
function inlining, and register renaming. It also turns on the
-@samp{-fforce-mem} option on all machines and frame pointer elimination
+@option{-fforce-mem} option on all machines and frame pointer elimination
on machines where doing so does not interfere with debugging.
+Please note the warning under @option{-fgcse} about
+invoking @option{-O2} on programs that use computed gotos.
+
@item -O3
-Optimize yet more. @samp{-O3} turns on all optimizations specified by
-@samp{-O2} and also turns on the @samp{-finline-functions} and
-@samp{-frename-registers} options.
+@opindex O3
+Optimize yet more. @option{-O3} turns on all optimizations specified by
+@option{-O2} and also turns on the @option{-finline-functions} and
+@option{-frename-registers} options.
@item -O0
+@opindex O0
Do not optimize.
@item -Os
-Optimize for size. @samp{-Os} enables all @samp{-O2} optimizations that
+@opindex Os
+Optimize for size. @option{-Os} enables all @option{-O2} optimizations that
do not typically increase code size. It also performs further
optimizations designed to reduce code size.
-If you use multiple @samp{-O} options, with or without level numbers,
+If you use multiple @option{-O} options, with or without level numbers,
the last such option is the one that is effective.
@end table
-Options of the form @samp{-f@var{flag}} specify machine-independent
+Options of the form @option{-f@var{flag}} specify machine-independent
flags. Most flags have both positive and negative forms; the negative
-form of @samp{-ffoo} would be @samp{-fno-foo}. In the table below,
+form of @option{-ffoo} would be @option{-fno-foo}. In the table below,
only one of the forms is listed---the one which is not the default.
You can figure out the other form by either removing @samp{no-} or
adding it.
@table @gcctabopt
@item -ffloat-store
+@opindex ffloat-store
Do not store floating point variables in registers, and inhibit other
options that might change whether a floating point value is taken from a
register or memory.
@@ -2832,35 +3216,40 @@ the 68000 where the floating registers (of the 68881) keep more
precision than a @code{double} is supposed to have. Similarly for the
x86 architecture. For most programs, the excess precision does only
good, but a few programs rely on the precise definition of IEEE floating
-point. Use @samp{-ffloat-store} for such programs, after modifying
+point. Use @option{-ffloat-store} for such programs, after modifying
them to store all pertinent intermediate computations into variables.
@item -fno-default-inline
+@opindex fno-default-inline
Do not make member functions inline by default merely because they are
defined inside the class scope (C++ only). Otherwise, when you specify
-@w{@samp{-O}}, member functions defined inside class scope are compiled
+@w{@option{-O}}, member functions defined inside class scope are compiled
inline by default; i.e., you don't need to add @samp{inline} in front of
the member function name.
@item -fno-defer-pop
+@opindex fno-defer-pop
Always pop the arguments to each function call as soon as that function
returns. For machines which must pop arguments after a function call,
the compiler normally lets arguments accumulate on the stack for several
function calls and pops them all at once.
@item -fforce-mem
+@opindex fforce-mem
Force memory operands to be copied into registers before doing
arithmetic on them. This produces better code by making all memory
references potential common subexpressions. When they are not common
subexpressions, instruction combination should eliminate the separate
-register-load. The @samp{-O2} option turns on this option.
+register-load. The @option{-O2} option turns on this option.
@item -fforce-addr
+@opindex fforce-addr
Force memory address constants to be copied into registers before
doing arithmetic on them. This may produce better code just as
-@samp{-fforce-mem} may.
+@option{-fforce-mem} may.
@item -fomit-frame-pointer
+@opindex fomit-frame-pointer
Don't keep the frame pointer in a register for functions that
don't need one. This avoids the instructions to save, set up and
restore frame pointers; it also makes an extra register available
@@ -2872,7 +3261,7 @@ On some machines, such as the Vax, this flag has no effect, because
the standard calling sequence automatically handles the frame pointer
and nothing is saved by pretending it doesn't exist. The
machine-description macro @code{FRAME_POINTER_REQUIRED} controls
-whether a target machine supports this flag. @xref{Registers}.@refill
+whether a target machine supports this flag. @xref{Registers}.
@end ifset
@ifclear INTERNALS
On some machines, such as the Vax, this flag has no effect, because
@@ -2880,22 +3269,26 @@ the standard calling sequence automatically handles the frame pointer
and nothing is saved by pretending it doesn't exist. The
machine-description macro @code{FRAME_POINTER_REQUIRED} controls
whether a target machine supports this flag. @xref{Registers,,Register
-Usage, gcc.info, Using and Porting GCC}.@refill
+Usage, gcc.info, Using and Porting GCC}.
@end ifclear
@item -foptimize-sibling-calls
+@opindex foptimize-sibling-calls
Optimize sibling and tail recursive calls.
@item -ftrapv
+@opindex ftrapv
This option generates traps for signed overflow on addition, subtraction,
multiplication operations.
@item -fno-inline
+@opindex fno-inline
Don't pay attention to the @code{inline} keyword. Normally this option
is used to keep the compiler from expanding any functions inline.
Note that if you are not optimizing, no functions can be expanded inline.
@item -finline-functions
+@opindex finline-functions
Integrate all simple functions into their callers. The compiler
heuristically decides which functions are simple enough to be worth
integrating in this way.
@@ -2905,16 +3298,18 @@ declared @code{static}, then the function is normally not output as
assembler code in its own right.
@item -finline-limit=@var{n}
+@opindex finline-limit
By default, gcc limits the size of functions that can be inlined. This flag
allows the control of this limit for functions that are explicitly marked as
-inline (ie marked with the inline keyword or defined within the class
-definition in c++). @var{n} is the size of functions that can be inlined in
+inline (ie marked with the inline keyword or defined within the class
+definition in c++). @var{n} is the size of functions that can be inlined in
number of pseudo instructions (not counting parameter handling). The default
-value of n is 10000. Increasing this value can result in more inlined code at
+value of @var{n} is 600.
+Increasing this value can result in more inlined code at
the cost of compilation time and memory consumption. Decreasing usually makes
-the compilation faster and less code will be inlined (which presumably
-means slower programs). This option is particularly useful for programs that
-use inlining heavily such as those based on recursive templates with c++.
+the compilation faster and less code will be inlined (which presumably
+means slower programs). This option is particularly useful for programs that
+use inlining heavily such as those based on recursive templates with C++.
@emph{Note:} pseudo instruction represents, in this particular context, an
abstract measurement of function's size. In no way, it represents a count
@@ -2922,20 +3317,23 @@ of assembly instructions and as such its exact meaning might change from one
release to an another.
@item -fkeep-inline-functions
+@opindex fkeep-inline-functions
Even if all calls to a given function are integrated, and the function
is declared @code{static}, nevertheless output a separate run-time
callable version of the function. This switch does not affect
@code{extern inline} functions.
@item -fkeep-static-consts
+@opindex fkeep-static-consts
Emit variables declared @code{static const} when optimization isn't turned
on, even if the variables aren't referenced.
GCC enables this option by default. If you want to force the compiler to
check if the variable was referenced, regardless of whether or not
-optimization is turned on, use the @samp{-fno-keep-static-consts} option.
+optimization is turned on, use the @option{-fno-keep-static-consts} option.
@item -fno-function-cse
+@opindex fno-function-cse
Do not put function addresses in registers; make each instruction that
calls a constant function contain the function's address explicitly.
@@ -2944,33 +3342,37 @@ that alter the assembler output may be confused by the optimizations
performed when this option is not used.
@item -ffast-math
+@opindex ffast-math
This option allows GCC to violate some ISO or IEEE rules and/or
specifications in the interest of optimizing code for speed. For
example, it allows the compiler to assume arguments to the @code{sqrt}
function are non-negative numbers and that no floating-point values
are NaNs.
-This option should never be turned on by any @samp{-O} option since
+This option causes the preprocessor macro @code{__FAST_MATH__} to be defined.
+
+This option should never be turned on by any @option{-O} option since
it can result in incorrect output for programs which depend on
an exact implementation of IEEE or ISO rules/specifications for
math functions.
@item -fno-math-errno
+@opindex fno-math-errno
Do not set ERRNO after calling math functions that are executed
with a single instruction, e.g., sqrt. A program that relies on
IEEE exceptions for math error handling may want to use this flag
for speed while maintaining IEEE arithmetic compatibility.
-The default is @samp{-fmath-errno}. The @samp{-ffast-math} option
-sets @samp{-fno-math-errno}.
+The default is @option{-fmath-errno}. The @option{-ffast-math} option
+sets @option{-fno-math-errno}.
@end table
@c following causes underfulls.. they don't look great, but we deal.
@c --mew 26jan93
-The following options control specific optimizations. The @samp{-O2}
-option turns on all of these optimizations except @samp{-funroll-loops}
-and @samp{-funroll-all-loops}. On most machines, the @samp{-O} option
-turns on the @samp{-fthread-jumps} and @samp{-fdelayed-branch} options,
+The following options control specific optimizations. The @option{-O2}
+option turns on all of these optimizations except @option{-funroll-loops}
+and @option{-funroll-all-loops}. On most machines, the @option{-O} option
+turns on the @option{-fthread-jumps} and @option{-fdelayed-branch} options,
but specific machines may handle it differently.
You can use the following flags in the rare cases when ``fine-tuning''
@@ -2978,10 +3380,12 @@ of optimizations to be performed is desired.
@table @gcctabopt
@item -fstrength-reduce
+@opindex fstrength-reduce
Perform the optimizations of loop strength reduction and
elimination of iteration variables.
@item -fthread-jumps
+@opindex fthread-jumps
Perform optimizations where we check to see if a jump branches to a
location where another comparison subsumed by the first is found. If
so, the first branch is redirected to either the destination of the
@@ -2989,6 +3393,7 @@ second branch or a point immediately following it, depending on whether
the condition is known to be true or false.
@item -fcse-follow-jumps
+@opindex fcse-follow-jumps
In common subexpression elimination, scan through jump instructions
when the target of the jump is not reached by any other path. For
example, when CSE encounters an @code{if} statement with an
@@ -2996,50 +3401,65 @@ example, when CSE encounters an @code{if} statement with an
tested is false.
@item -fcse-skip-blocks
-This is similar to @samp{-fcse-follow-jumps}, but causes CSE to
+@opindex fcse-skip-blocks
+This is similar to @option{-fcse-follow-jumps}, but causes CSE to
follow jumps which conditionally skip over blocks. When CSE
encounters a simple @code{if} statement with no else clause,
-@samp{-fcse-skip-blocks} causes CSE to follow the jump around the
+@option{-fcse-skip-blocks} causes CSE to follow the jump around the
body of the @code{if}.
@item -frerun-cse-after-loop
+@opindex frerun-cse-after-loop
Re-run common subexpression elimination after loop optimizations has been
performed.
@item -frerun-loop-opt
+@opindex frerun-loop-opt
Run the loop optimizer twice.
@item -fgcse
+@opindex fgcse
Perform a global common subexpression elimination pass.
This pass also performs global constant and copy propagation.
+@emph{Note:} When compiling a program using computed gotos, a GCC
+extension, you may get better runtime performance if you disable
+the global common subexpression elmination pass by adding
+@option{-fno-gcse} to the command line.
+
@item -fdelete-null-pointer-checks
+@opindex fdelete-null-pointer-checks
Use global dataflow analysis to identify and eliminate useless null
pointer checks. Programs which rely on NULL pointer dereferences @emph{not}
halting the program may not work properly with this option. Use
--fno-delete-null-pointer-checks to disable this optimizing for programs
+@option{-fno-delete-null-pointer-checks} to disable this optimizing for programs
which depend on that behavior.
@item -fexpensive-optimizations
+@opindex fexpensive-optimizations
Perform a number of minor optimizations that are relatively expensive.
@item -foptimize-register-move
@itemx -fregmove
+@opindex foptimize-register-move
+@opindex fregmove
Attempt to reassign register numbers in move instructions and as
operands of other simple instructions in order to maximize the amount of
register tying. This is especially helpful on machines with two-operand
-instructions. GCC enables this optimization by default with @samp{-O2}
+instructions. GCC enables this optimization by default with @option{-O2}
or higher.
Note @option{-fregmove} and @option{-foptimize-register-move} are the same
optimization.
@item -fdelayed-branch
+@opindex fdelayed-branch
If supported for the target machine, attempt to reorder instructions
to exploit instruction slots available after delayed branch
instructions.
@item -fschedule-insns
+@opindex fschedule-insns
If supported for the target machine, attempt to reorder instructions to
eliminate execution stalls due to required data being unavailable. This
helps machines that have slow floating point or memory load instructions
@@ -3047,13 +3467,16 @@ by allowing other instructions to be issued until the result of the load
or floating point instruction is required.
@item -fschedule-insns2
-Similar to @samp{-fschedule-insns}, but requests an additional pass of
+@opindex fschedule-insns2
+Similar to @option{-fschedule-insns}, but requests an additional pass of
instruction scheduling after register allocation has been done. This is
especially useful on machines with a relatively small number of
registers and where memory load instructions take more than one cycle.
@item -ffunction-sections
@itemx -fdata-sections
+@opindex ffunction-sections
+@opindex fdata-sections
Place each function or data item into its own section in the output
file if the target supports arbitrary sections. The name of the
function or the name of the data item determines the section's name
@@ -3070,9 +3493,10 @@ so. When you specify these options, the assembler and linker will
create larger object and executable files and will also be slower.
You will not be able to use @code{gprof} on all systems if you
specify this option and you may have problems with debugging if
-you specify both this option and @samp{-g}.
+you specify both this option and @option{-g}.
@item -fcaller-saves
+@opindex fcaller-saves
Enable values to be allocated in registers that will be clobbered by
function calls, by emitting extra instructions to save and restore the
registers around such calls. Such allocation is done only when it
@@ -3085,26 +3509,30 @@ For all machines, optimization level 2 and higher enables this flag by
default.
@item -funroll-loops
+@opindex funroll-loops
Perform the optimization of loop unrolling. This is only done for loops
whose number of iterations can be determined at compile time or run time.
-@samp{-funroll-loops} implies both @samp{-fstrength-reduce} and
-@samp{-frerun-cse-after-loop}.
+@option{-funroll-loops} implies both @option{-fstrength-reduce} and
+@option{-frerun-cse-after-loop}.
@item -funroll-all-loops
+@opindex funroll-all-loops
Perform the optimization of loop unrolling. This is done for all loops
-and usually makes programs run more slowly. @samp{-funroll-all-loops}
-implies @samp{-fstrength-reduce} as well as @samp{-frerun-cse-after-loop}.
+and usually makes programs run more slowly. @option{-funroll-all-loops}
+implies @option{-fstrength-reduce} as well as @option{-frerun-cse-after-loop}.
@item -fmove-all-movables
+@opindex fmove-all-movables
Forces all invariant computations in loops to be moved
outside the loop.
@item -freduce-all-givs
+@opindex freduce-all-givs
Forces all general-induction variables in loops to be
strength-reduced.
@emph{Note:} When compiling programs written in Fortran,
-@samp{-fmove-all-movables} and @samp{-freduce-all-givs} are enabled
+@option{-fmove-all-movables} and @option{-freduce-all-givs} are enabled
by default when you use the optimizer.
These options may generate better or worse code; results are highly
@@ -3121,17 +3549,24 @@ We're very interested in code that runs @emph{slower}
when these options are @emph{enabled}.
@item -fno-peephole
-Disable any machine-specific peephole optimizations.
+@itemx -fno-peephole2
+@opindex fno-peephole
+@opindex fno-peephole2
+Disable any machine-specific peephole optimizations. The difference
+between @option{-fno-peephole} and @option{-fno-peephole2} is in how they
+are implemented in the compiler; some targets use one, some use the
+other, a few use both.
@item -fbranch-probabilities
-After running a program compiled with @samp{-fprofile-arcs}
+@opindex fbranch-probabilities
+After running a program compiled with @option{-fprofile-arcs}
(@pxref{Debugging Options,, Options for Debugging Your Program or
@command{gcc}}), you can compile it a second time using
-@samp{-fbranch-probabilities}, to improve optimizations based on
+@option{-fbranch-probabilities}, to improve optimizations based on
guessing the path a branch might take.
@ifset INTERNALS
-With @samp{-fbranch-probabilities}, GCC puts a @samp{REG_EXEC_COUNT}
+With @option{-fbranch-probabilities}, GCC puts a @samp{REG_EXEC_COUNT}
note on the first instruction of each basic block, and a
@samp{REG_BR_PROB} note on each @samp{JUMP_INSN} and @samp{CALL_INSN}.
These can be used to improve optimization. Currently, they are only
@@ -3141,8 +3576,9 @@ exactly determine which path is taken more often.
@end ifset
@item -fno-guess-branch-probability
+@opindex fno-guess-branch-probability
Sometimes gcc will opt to guess branch probabilities when none are
-available from either profile directed feedback (@samp{-fprofile-arcs})
+available from either profile directed feedback (@option{-fprofile-arcs})
or @samp{__builtin_expect}. In a hard real-time system, people don't
want different runs of the compiler to produce code that has different
behavior; minimizing non-determinism is of paramount import. This
@@ -3150,6 +3586,7 @@ switch allows users to reduce non-determinism, possibly at the expense
of inferior optimization.
@item -fstrict-aliasing
+@opindex fstrict-aliasing
Allows the compiler to assume the strictest aliasing rules applicable to
the language being compiled. For C (and C++), this activates
optimizations based on the type of expressions. In particular, an
@@ -3157,11 +3594,11 @@ object of one type is assumed never to reside at the same address as an
object of a different type, unless the types are almost the same. For
example, an @code{unsigned int} can alias an @code{int}, but not a
@code{void*} or a @code{double}. A character type may alias any other
-type.
+type.
Pay special attention to code like this:
@example
-union a_union @{
+union a_union @{
int i;
double d;
@};
@@ -3174,11 +3611,11 @@ int f() @{
@end example
The practice of reading from a different union member than the one most
recently written to (called ``type-punning'') is common. Even with
-@samp{-fstrict-aliasing}, type-punning is allowed, provided the memory
+@option{-fstrict-aliasing}, type-punning is allowed, provided the memory
is accessed through the union type. So, the code above will work as
expected. However, this code might not:
@example
-int f() @{
+int f() @{
a_union t;
int* ip;
t.d = 3.0;
@@ -3197,13 +3634,14 @@ allowed to alias. For an example, see the C front-end function
@item -falign-functions
@itemx -falign-functions=@var{n}
+@opindex falign-functions
Align the start of functions to the next power-of-two greater than
@var{n}, skipping up to @var{n} bytes. For instance,
-@samp{-falign-functions=32} aligns functions to the next 32-byte
-boundary, but @samp{-falign-functions=24} would align to the next
+@option{-falign-functions=32} aligns functions to the next 32-byte
+boundary, but @option{-falign-functions=24} would align to the next
32-byte boundary only if this can be done by skipping 23 bytes or less.
-@samp{-fno-align-functions} and @samp{-falign-functions=1} are
+@option{-fno-align-functions} and @option{-falign-functions=1} are
equivalent and mean that functions will not be aligned.
Some assemblers only support this flag when @var{n} is a power of two;
@@ -3213,12 +3651,13 @@ If @var{n} is not specified, use a machine-dependent default.
@item -falign-labels
@itemx -falign-labels=@var{n}
+@opindex falign-labels
Align all branch targets to a power-of-two boundary, skipping up to
-@var{n} bytes like @samp{-falign-functions}. This option can easily
+@var{n} bytes like @option{-falign-functions}. This option can easily
make code slower, because it must insert dummy operations for when the
branch target is reached in the usual flow of the code.
-If @samp{-falign-loops} or @samp{-falign-jumps} are applicable and
+If @option{-falign-loops} or @option{-falign-jumps} are applicable and
are greater than this value, then their values are used instead.
If @var{n} is not specified, use a machine-dependent default which is
@@ -3226,8 +3665,9 @@ very likely to be @samp{1}, meaning no alignment.
@item -falign-loops
@itemx -falign-loops=@var{n}
+@opindex falign-loops
Align loops to a power-of-two boundary, skipping up to @var{n} bytes
-like @samp{-falign-functions}. The hope is that the loop will be
+like @option{-falign-functions}. The hope is that the loop will be
executed many times, which will make up for any execution of the dummy
operations.
@@ -3235,33 +3675,85 @@ If @var{n} is not specified, use a machine-dependent default.
@item -falign-jumps
@itemx -falign-jumps=@var{n}
+@opindex falign-jumps
Align branch targets to a power-of-two boundary, for branch targets
where the targets can only be reached by jumping, skipping up to @var{n}
-bytes like @samp{-falign-functions}. In this case, no dummy operations
+bytes like @option{-falign-functions}. In this case, no dummy operations
need be executed.
If @var{n} is not specified, use a machine-dependent default.
@item -fssa
+@opindex fssa
Perform optimizations in static single assignment form. Each function's
flow graph is translated into SSA form, optimizations are performed, and
-the flow graph is translated back from SSA form. User's should not
+the flow graph is translated back from SSA form. Users should not
specify this option, since it is not yet ready for production use.
@item -fdce
-Perform dead-code elimination in SSA form. Requires @samp{-fssa}. Like
-@samp{-fssa}, this is an experimental feature.
+@opindex fdce
+Perform dead-code elimination in SSA form. Requires @option{-fssa}. Like
+@option{-fssa}, this is an experimental feature.
@item -fsingle-precision-constant
+@opindex fsingle-precision-constant
Treat floating point constant as single precision constant instead of
implicitly converting it to double precision constant.
@item -frename-registers
-Attempt to avoid false dependancies in scheduled code by making use
+@opindex frename-registers
+Attempt to avoid false dependencies in scheduled code by making use
of registers left over after register allocation. This optimization
will most benefit processors with lots of registers. It can, however,
make debugging impossible, since variables will no longer stay in
a ``home register''.
+
+@item --param @var{name}=@var{value}
+@opindex param
+In some places, GCC uses various constants to control the amount of
+optimization that is done. For example, GCC will not inline functions
+that contain more that a certain number of instructions. You can
+control some of these constants on the command-line using the
+@option{--param} option.
+
+In each case, the @var{value} is an integer. The allowable choices for
+@var{name} are given in the following table:
+
+@table @gcctabopt
+@item max-delay-slot-insn-search
+The maximum number of instructions to consider when looking for an
+instruction to fill a delay slot. If more than this arbitrary number of
+instructions is searched, the time savings from filling the delay slot
+will be minimal so stop searching. Increasing values mean more
+aggressive optimization, making the compile time increase with probably
+small improvement in executable run time.
+
+@item max-delay-slot-live-search
+When trying to fill delay slots, the maximum number of instructions to
+consider when searching for a block with valid live register
+information. Increasing this arbitrarily chosen value means more
+aggressive optimization, increasing the compile time. This parameter
+should be removed when the delay slot code is rewritten to maintain the
+control-flow graph.
+
+@item max-gcse-memory
+The approximate maximum amount of memory that will be allocated in
+order to perform the global common subexpression elimination
+optimization. If more memory than specified is required, the
+optimization will not be done.
+
+@item max-pending-list-length
+The maximum number of pending dependencies scheduling will allow
+before flushing the current state and starting over. Large functions
+with few branches or calls can create excessively large lists which
+needlessly consume memory and resources.
+
+@item max-inline-insns
+If an function contains more than this many instructions, it
+will not be inlined. This option is precisely equivalent to
+@option{-finline-limit}.
+
+@end table
@end table
@node Preprocessor Options
@@ -3272,67 +3764,75 @@ a ``home register''.
These options control the C preprocessor, which is run on each C source
file before actual compilation.
-If you use the @samp{-E} option, nothing is done except preprocessing.
-Some of these options make sense only together with @samp{-E} because
+If you use the @option{-E} option, nothing is done except preprocessing.
+Some of these options make sense only together with @option{-E} because
they cause the preprocessor output to be unsuitable for actual
compilation.
@table @gcctabopt
@item -include @var{file}
+@opindex include
Process @var{file} as input before processing the regular input file.
-In effect, the contents of @var{file} are compiled first. Any @samp{-D}
-and @samp{-U} options on the command line are always processed before
-@samp{-include @var{file}}, regardless of the order in which they are
-written. All the @samp{-include} and @samp{-imacros} options are
+In effect, the contents of @var{file} are compiled first. Any @option{-D}
+and @option{-U} options on the command line are always processed before
+@option{-include @var{file}}, regardless of the order in which they are
+written. All the @option{-include} and @option{-imacros} options are
processed in the order in which they are written.
@item -imacros @var{file}
+@opindex imacros
Process @var{file} as input, discarding the resulting output, before
processing the regular input file. Because the output generated from
-@var{file} is discarded, the only effect of @samp{-imacros @var{file}}
+@var{file} is discarded, the only effect of @option{-imacros @var{file}}
is to make the macros defined in @var{file} available for use in the
-main input. All the @samp{-include} and @samp{-imacros} options are
+main input. All the @option{-include} and @option{-imacros} options are
processed in the order in which they are written.
@item -idirafter @var{dir}
+@opindex idirafter
@cindex second include path
Add the directory @var{dir} to the second include path. The directories
on the second include path are searched when a header file is not found
in any of the directories in the main include path (the one that
-@samp{-I} adds to).
+@option{-I} adds to).
@item -iprefix @var{prefix}
-Specify @var{prefix} as the prefix for subsequent @samp{-iwithprefix}
+@opindex iprefix
+Specify @var{prefix} as the prefix for subsequent @option{-iwithprefix}
options.
@item -iwithprefix @var{dir}
+@opindex iwithprefix
Add a directory to the second include path. The directory's name is
made by concatenating @var{prefix} and @var{dir}, where @var{prefix} was
-specified previously with @samp{-iprefix}. If you have not specified a
+specified previously with @option{-iprefix}. If you have not specified a
prefix yet, the directory containing the installed passes of the
compiler is used as the default.
@item -iwithprefixbefore @var{dir}
+@opindex iwithprefixbefore
Add a directory to the main include path. The directory's name is made
by concatenating @var{prefix} and @var{dir}, as in the case of
-@samp{-iwithprefix}.
+@option{-iwithprefix}.
@item -isystem @var{dir}
+@opindex isystem
Add a directory to the beginning of the second include path, marking it
as a system directory, so that it gets the same special treatment as
is applied to the standard system directories.
@item -nostdinc
+@opindex nostdinc
Do not search the standard system directories for header files. Only
-the directories you have specified with @samp{-I} options (and the
+the directories you have specified with @option{-I} options (and the
current directory, if appropriate) are searched. @xref{Directory
-Options}, for information on @samp{-I}.
+Options}, for information on @option{-I}.
-By using both @samp{-nostdinc} and @samp{-I-}, you can limit the include-file
+By using both @option{-nostdinc} and @option{-I-}, you can limit the include-file
search path to only those directories you specify explicitly.
@item -remap
-@findex -remap
+@opindex remap
When searching for a header file in a directory, remap file names if a
file named @file{header.gcc} exists in that directory. This can be used
to work around limitations of file systems with file name restrictions.
@@ -3341,64 +3841,70 @@ tokens on each line: the first token is the name to map, and the second
token is the actual name to use.
@item -undef
+@opindex undef
Do not predefine any nonstandard macros. (Including architecture flags).
@item -E
+@opindex E
Run only the C preprocessor. Preprocess all the C source files
specified and output the results to standard output or to the
specified output file.
@item -C
+@opindex C
Tell the preprocessor not to discard comments. Used with the
-@samp{-E} option.
+@option{-E} option.
@item -P
+@opindex P
Tell the preprocessor not to generate @samp{#line} directives.
-Used with the @samp{-E} option.
+Used with the @option{-E} option.
@cindex make
@cindex dependencies, make
@item -M
-@findex -M
+@opindex M
Instead of outputting the result of preprocessing, output a rule
suitable for @code{make} describing the dependencies of the main source
file. The preprocessor outputs one @code{make} rule containing the
object file name for that source file, a colon, and the names of all the
-included files. If there are many included files then the rule is split
-into several lines using @samp{\}-newline.
+included files. Unless overridden explicitly, the object file name
+consists of the basename of the source file with any suffix replaced with
+object file suffix. If there are many included files then the
+rule is split into several lines using @samp{\}-newline.
-@samp{-M} implies @samp{-E}.
+@option{-M} implies @option{-E}.
@item -MM
-@findex -MM
-Like @samp{-M}, but mention only the files included with @samp{#include
+@opindex MM
+Like @option{-M}, but mention only the files included with @samp{#include
"@var{file}"}. System header files included with @samp{#include
<@var{file}>} are omitted.
@item -MD
-@findex -MD
-Like @samp{-M} but the dependency information is written to a file
+@opindex MD
+Like @option{-M} but the dependency information is written to a file
rather than stdout. @code{gcc} will use the same file name and
-directory as the object file, but with the suffix ".d" instead.
+directory as the object file, but with the suffix @file{.d} instead.
-This is in addition to compiling the main file as specified ---
-@samp{-MD} does not inhibit ordinary compilation the way @samp{-M} does,
-unless you also specify @samp{-MG}.
+This is in addition to compiling the main file as specified---@option{-MD}
+does not inhibit ordinary compilation the way @option{-M} does,
+unless you also specify @option{-MG}.
With Mach, you can use the utility @code{md} to merge multiple
dependency files into a single dependency file suitable for using with
the @samp{make} command.
@item -MMD
-@findex -MMD
-Like @samp{-MD} except mention only user header files, not system
+@opindex MMD
+Like @option{-MD} except mention only user header files, not system
-header files.
@item -MF @var{file}
-@findex -MF
-When used with @samp{-M} or @samp{-MM}, specifies a file to write the
+@opindex MF
+When used with @option{-M} or @option{-MM}, specifies a file to write the
dependencies to. This allows the preprocessor to write the preprocessed
-file to stdout normally. If no @samp{-MF} switch is given, CPP sends
+file to stdout normally. If no @option{-MF} switch is given, CPP sends
the rules to stdout and suppresses normal preprocessed output.
Another way to specify output of a @code{make} rule is by setting
@@ -3406,8 +3912,8 @@ the environment variable @env{DEPENDENCIES_OUTPUT} (@pxref{Environment
Variables}).
@item -MG
-@findex -MG
-When used with @samp{-M} or @samp{-MM}, @samp{-MG} says to treat missing
+@opindex MG
+When used with @option{-M} or @option{-MM}, @option{-MG} says to treat missing
header files as generated files and assume they live in the same
directory as the source file. It suppresses preprocessed output, as a
missing header file is ordinarily an error.
@@ -3415,7 +3921,7 @@ missing header file is ordinarily an error.
This feature is used in automatic updating of makefiles.
@item -MP
-@findex -MP
+@opindex MP
This option instructs CPP to add a phony target for each dependency
other than the main file, causing each to depend on nothing. These
dummy rules work around errors @code{make} gives if you remove header
@@ -3431,119 +3937,138 @@ This is typical output:-
@item -MQ @var{target}
@item -MT @var{target}
-@findex -MQ
-@findex -MT
+@opindex MQ
+@opindex MT
By default CPP uses the main file name, including any path, and appends
the object suffix, normally ``.o'', to it to obtain the name of the
-target for dependency generation. With @samp{-MT} you can specify a
+target for dependency generation. With @option{-MT} you can specify a
target yourself, overriding the default one.
If you want multiple targets, you can specify them as a single argument
-to @samp{-MT}, or use multiple @samp{-MT} options.
+to @option{-MT}, or use multiple @option{-MT} options.
The targets you specify are output in the order they appear on the
-command line. @samp{-MQ} is identical to @samp{-MT}, except that the
-target name is quoted for Make, but with @samp{-MT} it isn't. For
-example, -MT '$(objpfx)foo.o' gives
+command line. @option{-MQ} is identical to @option{-MT}, except that the
+target name is quoted for Make, but with @option{-MT} it isn't. For
+example, @option{-MT '$(objpfx)foo.o'} gives
@smallexample
$(objpfx)foo.o: /tmp/foo.c
@end smallexample
-but -MQ '$(objpfx)foo.o' gives
+but @option{-MQ '$(objpfx)foo.o'} gives
@smallexample
$$(objpfx)foo.o: /tmp/foo.c
@end smallexample
The default target is automatically quoted, as if it were given with
-@samp{-MQ}.
+@option{-MQ}.
@item -H
+@opindex H
Print the name of each header file used, in addition to other normal
activities.
@item -A@var{question}(@var{answer})
+@opindex A
Assert the answer @var{answer} for @var{question}, in case it is tested
with a preprocessing conditional such as @samp{#if
-#@var{question}(@var{answer})}. @samp{-A-} disables the standard
+#@var{question}(@var{answer})}. @option{-A-} disables the standard
assertions that normally describe the target machine.
@item -D@var{macro}
+@opindex D
Define macro @var{macro} with the string @samp{1} as its definition.
@item -D@var{macro}=@var{defn}
-Define macro @var{macro} as @var{defn}. All instances of @samp{-D} on
-the command line are processed before any @samp{-U} options.
+Define macro @var{macro} as @var{defn}. All instances of @option{-D} on
+the command line are processed before any @option{-U} options.
-Any @samp{-D} and @samp{-U} options on the command line are processed in
-order, and always before @samp{-imacros @var{file}}, regardless of the
+Any @option{-D} and @option{-U} options on the command line are processed in
+order, and always before @option{-imacros @var{file}}, regardless of the
order in which they are written.
@item -U@var{macro}
-Undefine macro @var{macro}. @samp{-U} options are evaluated after all
-@samp{-D} options, but before any @samp{-include} and @samp{-imacros}
+@opindex U
+Undefine macro @var{macro}. @option{-U} options are evaluated after all
+@option{-D} options, but before any @option{-include} and @option{-imacros}
options.
-Any @samp{-D} and @samp{-U} options on the command line are processed in
-order, and always before @samp{-imacros @var{file}}, regardless of the
+Any @option{-D} and @option{-U} options on the command line are processed in
+order, and always before @option{-imacros @var{file}}, regardless of the
order in which they are written.
@item -dM
+@opindex dM
Tell the preprocessor to output only a list of the macro definitions
-that are in effect at the end of preprocessing. Used with the @samp{-E}
+that are in effect at the end of preprocessing. Used with the @option{-E}
option.
@item -dD
+@opindex dD
Tell the preprocessing to pass all macro definitions into the output, in
their proper sequence in the rest of the output.
@item -dN
-Like @samp{-dD} except that the macro arguments and contents are omitted.
+@opindex dN
+Like @option{-dD} except that the macro arguments and contents are omitted.
Only @samp{#define @var{name}} is included in the output.
@item -dI
-@findex -dI
+@opindex dI
Output @samp{#include} directives in addition to the result of
preprocessing.
+@item -fpreprocessed
+@opindex fpreprocessed
+Indicate to the preprocessor that the input file has already been
+preprocessed. This suppresses things like macro expansion, trigraph
+conversion, escaped newline splicing, and processing of most directives.
+In this mode the integrated preprocessor is little more than a tokenizer
+for the front ends.
+
+@option{-fpreprocessed} is implicit if the input file has one of the
+extensions @samp{i}, @samp{ii} or @samp{mi} indicating it has already
+been preprocessed.
+
@item -trigraphs
-@findex -trigraphs
+@opindex trigraphs
Process ISO standard trigraph sequences. These are three-character
sequences, all starting with @samp{??}, that are defined by ISO C to
stand for single characters. For example, @samp{??/} stands for
@samp{\}, so @samp{'??/n'} is a character constant for a newline. By
default, GCC ignores trigraphs, but in standard-conforming modes it
-converts them. See the @samp{-std} and @samp{-ansi} options.
+converts them. See the @option{-std} and @option{-ansi} options.
The nine trigraph sequences are
@table @samp
@item ??(
--> @samp{[}
+@expansion{} @samp{[}
@item ??)
--> @samp{]}
+@expansion{} @samp{]}
@item ??<
--> @samp{@{}
+@expansion{} @samp{@{}
@item ??>
--> @samp{@}}
+@expansion{} @samp{@}}
@item ??=
--> @samp{#}
+@expansion{} @samp{#}
@item ??/
--> @samp{\}
+@expansion{} @samp{\}
@item ??'
--> @samp{^}
+@expansion{} @samp{^}
@item ??!
--> @samp{|}
+@expansion{} @samp{|}
@item ??-
--> @samp{~}
+@expansion{} @samp{~}
@end table
@@ -3551,7 +4076,8 @@ Trigraph support is not popular, so many compilers do not implement it
properly. Portable code should not rely on trigraphs being either
converted or ignored.
-@item -Wp\,@var{option}
+@item -Wp,@var{option}
+@opindex Wp
Pass @var{option} as an option to the preprocessor. If @var{option}
contains commas, it is split into multiple options at the commas.
@end table
@@ -3563,7 +4089,8 @@ contains commas, it is split into multiple options at the commas.
You can pass options to the assembler.
@table @gcctabopt
-@item -Wa\,@var{option}
+@item -Wa,@var{option}
+@opindex Wa
Pass @var{option} as an option to the assembler. If @var{option}
contains commas, it is split into multiple options at the commas.
@end table
@@ -3589,12 +4116,16 @@ to the linker.
@item -c
@itemx -S
@itemx -E
+@opindex c
+@opindex S
+@opindex E
If any of these options is used, then the linker is not run, and
object file names should not be used as arguments. @xref{Overall
Options}.
@cindex Libraries
@item -l@var{library}
+@opindex l
Search the library named @var{library} when linking.
It makes a difference where in the command you write this option; the
@@ -3608,27 +4139,30 @@ which is actually a file named @file{lib@var{library}.a}. The linker
then uses this file as if it had been specified precisely by name.
The directories searched include several standard system directories
-plus any that you specify with @samp{-L}.
+plus any that you specify with @option{-L}.
Normally the files found this way are library files---archive files
whose members are object files. The linker handles an archive file by
scanning through it for members which define symbols that have so far
been referenced but not defined. But if the file that is found is an
ordinary object file, it is linked in the usual fashion. The only
-difference between using an @samp{-l} option and specifying a file name
-is that @samp{-l} surrounds @var{library} with @samp{lib} and @samp{.a}
+difference between using an @option{-l} option and specifying a file name
+is that @option{-l} surrounds @var{library} with @samp{lib} and @samp{.a}
and searches several directories.
@item -lobjc
-You need this special case of the @samp{-l} option in order to
+@opindex lobjc
+You need this special case of the @option{-l} option in order to
link an Objective C program.
@item -nostartfiles
+@opindex nostartfiles
Do not use the standard system startup files when linking.
The standard system libraries are used normally, unless @option{-nostdlib}
or @option{-nodefaultlibs} is used.
@item -nodefaultlibs
+@opindex nodefaultlibs
Do not use the standard system libraries when linking.
Only the libraries you specify will be passed to the linker.
The standard startup files are used normally, unless @option{-nostartfiles}
@@ -3639,22 +4173,23 @@ libc. These entry points should be supplied through some other
mechanism when this option is specified.
@item -nostdlib
+@opindex nostdlib
Do not use the standard system startup files or libraries when linking.
No startup files and only the libraries you specify will be passed to
-the linker. The compiler may generate calls to memcmp, memset, and memcpy
+the linker. The compiler may generate calls to memcmp, memset, and memcpy
for System V (and ISO C) environments or to bcopy and bzero for
BSD environments. These entries are usually resolved by entries in
libc. These entry points should be supplied through some other
mechanism when this option is specified.
-@cindex @code{-lgcc}, use with @code{-nostdlib}
-@cindex @code{-nostdlib} and unresolved references
-@cindex unresolved references and @code{-nostdlib}
-@cindex @code{-lgcc}, use with @code{-nodefaultlibs}
-@cindex @code{-nodefaultlibs} and unresolved references
-@cindex unresolved references and @code{-nodefaultlibs}
-One of the standard libraries bypassed by @samp{-nostdlib} and
-@samp{-nodefaultlibs} is @file{libgcc.a}, a library of internal subroutines
+@cindex @option{-lgcc}, use with @option{-nostdlib}
+@cindex @option{-nostdlib} and unresolved references
+@cindex unresolved references and @option{-nostdlib}
+@cindex @option{-lgcc}, use with @option{-nodefaultlibs}
+@cindex @option{-nodefaultlibs} and unresolved references
+@cindex unresolved references and @option{-nodefaultlibs}
+One of the standard libraries bypassed by @option{-nostdlib} and
+@option{-nodefaultlibs} is @file{libgcc.a}, a library of internal subroutines
that GCC uses to overcome shortcomings of particular machines, or special
needs for some languages.
@ifset INTERNALS
@@ -3666,33 +4201,38 @@ needs for some languages.
for more discussion of @file{libgcc.a}.)
@end ifclear
In most cases, you need @file{libgcc.a} even when you want to avoid
-other standard libraries. In other words, when you specify @samp{-nostdlib}
-or @samp{-nodefaultlibs} you should usually specify @samp{-lgcc} as well.
+other standard libraries. In other words, when you specify @option{-nostdlib}
+or @option{-nodefaultlibs} you should usually specify @option{-lgcc} as well.
This ensures that you have no unresolved references to internal GCC
library subroutines. (For example, @samp{__main}, used to ensure C++
constructors will be called; @pxref{Collect2,,@command{collect2}}.)
@item -s
+@opindex s
Remove all symbol table and relocation information from the executable.
@item -static
+@opindex static
On systems that support dynamic linking, this prevents linking with the shared
libraries. On other systems, this option has no effect.
@item -shared
+@opindex shared
Produce a shared object which can then be linked with other objects to
form an executable. Not all systems support this option. For predictable
-results, you must also specify the same set of options that were used to
-generate code (@samp{-fpic}, @samp{-fPIC}, or model suboptions)
+results, you must also specify the same set of options that were used to
+generate code (@option{-fpic}, @option{-fPIC}, or model suboptions)
when you specify this option.@footnote{On some systems, @samp{gcc -shared}
-needs to build supplementary stub code for constructors to work. On
+needs to build supplementary stub code for constructors to work. On
multi-libbed systems, @samp{gcc -shared} must select the correct support
libraries to link against. Failing to supply the correct flags may lead
-to subtle defects. Supplying them in cases where they are not necessary
+to subtle defects. Supplying them in cases where they are not necessary
is innocuous.}
@item -shared-libgcc
@itemx -static-libgcc
+@opindex shared-libgcc
+@opindex static-libgcc
On systems that provide @file{libgcc} as a shared library, these options
force the use of either the shared or static version respectively.
If no shared version of @file{libgcc} was built when the compiler was
@@ -3704,42 +4244,46 @@ of these is when the application wishes to throw and catch exceptions
across different shared libraries. In that case, each of the libraries
as well as the application itself should use the shared @file{libgcc}.
-Therefore, whenever you specify the @samp{-shared} option, the GCC
-driver automatically adds @samp{-shared-libgcc}, unless you explicitly
-specify @samp{-static-libgcc}. The G++ driver automatically adds
-@samp{-shared-libgcc} when you build a main executable as well because
+Therefore, whenever you specify the @option{-shared} option, the GCC
+driver automatically adds @option{-shared-libgcc}, unless you explicitly
+specify @option{-static-libgcc}. The G++ driver automatically adds
+@option{-shared-libgcc} when you build a main executable as well because
for C++ programs that is typically the right thing to do.
(Exception-handling will not work reliably otherwise.)
However, when linking a main executable written in C, you must
-explicitly say @samp{-shared-libgcc} if you want to use the shared
+explicitly say @option{-shared-libgcc} if you want to use the shared
@file{libgcc}.
@item -symbolic
+@opindex symbolic
Bind references to global symbols when building a shared object. Warn
about any unresolved references (unless overridden by the link editor
option @samp{-Xlinker -z -Xlinker defs}). Only a few systems support
this option.
@item -Xlinker @var{option}
+@opindex Xlinker
Pass @var{option} as an option to the linker. You can use this to
supply system-specific linker options which GCC does not know how to
recognize.
If you want to pass an option that takes an argument, you must use
-@samp{-Xlinker} twice, once for the option and once for the argument.
-For example, to pass @samp{-assert definitions}, you must write
+@option{-Xlinker} twice, once for the option and once for the argument.
+For example, to pass @option{-assert definitions}, you must write
@samp{-Xlinker -assert -Xlinker definitions}. It does not work to write
-@samp{-Xlinker "-assert definitions"}, because this passes the entire
+@option{-Xlinker "-assert definitions"}, because this passes the entire
string as a single argument, which is not what the linker expects.
-@item -Wl\,@var{option}
+@item -Wl,@var{option}
+@opindex Wl
Pass @var{option} as an option to the linker. If @var{option} contains
commas, it is split into multiple options at the commas.
@item -u @var{symbol}
+@opindex u
Pretend the symbol @var{symbol} is undefined, to force linking of
-library modules to define it. You can use @samp{-u} multiple times with
+library modules to define it. You can use @option{-u} multiple times with
different symbols to force loading of additional library modules.
@end table
@@ -3754,40 +4298,46 @@ libraries and for parts of the compiler:
@table @gcctabopt
@item -I@var{dir}
+@opindex I
Add the directory @var{dir} to the head of the list of directories to be
searched for header files. This can be used to override a system header
file, substituting your own version, since these directories are
-searched before the system header file directories. If you use more
-than one @samp{-I} option, the directories are scanned in left-to-right
+searched before the system header file directories. However, you should
+not use this option to add directories that contain vendor-supplied
+system header files (use @option{-isystem} for that). If you use more than
+one @option{-I} option, the directories are scanned in left-to-right
order; the standard system directories come after.
@item -I-
-Any directories you specify with @samp{-I} options before the @samp{-I-}
+@opindex I-
+Any directories you specify with @option{-I} options before the @option{-I-}
option are searched only for the case of @samp{#include "@var{file}"};
they are not searched for @samp{#include <@var{file}>}.
-If additional directories are specified with @samp{-I} options after
-the @samp{-I-}, these directories are searched for all @samp{#include}
-directives. (Ordinarily @emph{all} @samp{-I} directories are used
+If additional directories are specified with @option{-I} options after
+the @option{-I-}, these directories are searched for all @samp{#include}
+directives. (Ordinarily @emph{all} @option{-I} directories are used
this way.)
-In addition, the @samp{-I-} option inhibits the use of the current
+In addition, the @option{-I-} option inhibits the use of the current
directory (where the current input file came from) as the first search
directory for @samp{#include "@var{file}"}. There is no way to
-override this effect of @samp{-I-}. With @samp{-I.} you can specify
+override this effect of @option{-I-}. With @option{-I.} you can specify
searching the directory which was current when the compiler was
invoked. That is not exactly the same as what the preprocessor does
by default, but it is often satisfactory.
-@samp{-I-} does not inhibit the use of the standard system directories
-for header files. Thus, @samp{-I-} and @samp{-nostdinc} are
+@option{-I-} does not inhibit the use of the standard system directories
+for header files. Thus, @option{-I-} and @option{-nostdinc} are
independent.
@item -L@var{dir}
+@opindex L
Add directory @var{dir} to the list of directories to be searched
-for @samp{-l}.
+for @option{-l}.
@item -B@var{prefix}
+@opindex B
This option specifies where to find the executables, libraries,
include files, and data files of the compiler itself.
@@ -3797,35 +4347,36 @@ The compiler driver program runs one or more of the subprograms
without @samp{@var{machine}/@var{version}/} (@pxref{Target Options}).
For each subprogram to be run, the compiler driver first tries the
-@samp{-B} prefix, if any. If that name is not found, or if @samp{-B}
+@option{-B} prefix, if any. If that name is not found, or if @option{-B}
was not specified, the driver tries two standard prefixes, which are
@file{/usr/lib/gcc/} and @file{/usr/local/lib/gcc-lib/}. If neither of
those results in a file name that is found, the unmodified program
name is searched for using the directories specified in your
@env{PATH} environment variable.
-@samp{-B} prefixes that effectively specify directory names also apply
+@option{-B} prefixes that effectively specify directory names also apply
to libraries in the linker, because the compiler translates these
-options into @samp{-L} options for the linker. They also apply to
+options into @option{-L} options for the linker. They also apply to
includes files in the preprocessor, because the compiler translates these
-options into @samp{-isystem} options for the preprocessor. In this case,
+options into @option{-isystem} options for the preprocessor. In this case,
the compiler appends @samp{include} to the prefix.
The run-time support file @file{libgcc.a} can also be searched for using
-the @samp{-B} prefix, if needed. If it is not found there, the two
+the @option{-B} prefix, if needed. If it is not found there, the two
standard prefixes above are tried, and that is all. The file is left
out of the link if it is not found by those means.
-Another way to specify a prefix much like the @samp{-B} prefix is to use
+Another way to specify a prefix much like the @option{-B} prefix is to use
the environment variable @env{GCC_EXEC_PREFIX}. @xref{Environment
Variables}.
@item -specs=@var{file}
+@opindex specs
Process @var{file} after the compiler reads in the standard @file{specs}
file, in order to override the defaults that the @file{gcc} driver
program uses when determining what switches to pass to @file{cc1},
@file{cc1plus}, @file{as}, @file{ld}, etc. More than one
-@samp{-specs=}@var{file} can be specified on the command line, and they
+@option{-specs=@var{file}} can be specified on the command line, and they
are processed in order, from left to right.
@end table
@@ -3842,7 +4393,7 @@ it ought to place on their command lines. This behaviour is controlled
by @dfn{spec strings}. In most cases there is one spec string for each
program that GCC can invoke, but a few programs have multiple spec
strings to control their behaviour. The spec strings built into GCC can
-be overridden by using the @samp{-specs=} command-line switch to specify
+be overridden by using the @option{-specs=} command-line switch to specify
a spec file.
@dfn{Spec files} are plaintext files that are used to construct spec
@@ -3853,7 +4404,7 @@ character on the line and it can be one of the following:
@table @code
@item %@var{command}
Issues a @var{command} to the spec file processor. The commands that can
-appear here are:
+appear here are:
@table @code
@item %include <@var{file}>
@@ -3886,7 +4437,7 @@ character, in which case the text will be appended to the spec.
@item [@var{suffix}]:
Creates a new @samp{[@var{suffix}] spec} pair. All lines after this directive
and up to the next directive or blank line are considered to make up the
-spec string for the indicated suffix. When the compiler encounters an
+spec string for the indicated suffix. When the compiler encounters an
input file with the named suffix, it will processes the spec string in
order to work out how to compile that file. For example:
@@ -3897,7 +4448,7 @@ z-compile -input %i
This says that any input file whose name ends in @samp{.ZZ} should be
passed to the program @samp{z-compile}, which should be invoked with the
-command-line switch @samp{-input} and with the result of performing the
+command-line switch @option{-input} and with the result of performing the
@samp{%i} substitution. (See below.)
As an alternative to providing a spec string, the text that follows a
@@ -3933,7 +4484,7 @@ possible to override earlier entries using this technique.
GCC has the following spec strings built into it. Spec files can
override these strings or create their own. Note that individual
-targets can also add their own spec strings to this list.
+targets can also add their own spec strings to this list.
@smallexample
asm Options to pass to the assembler
@@ -3947,7 +4498,8 @@ lib Libraries to include on the command line to the linker
libgcc Decides which GCC support library to pass to the linker
linker Sets the name of the linker
predefines Defines to be passed to the C preprocessor
-signed_char Defines to pass to CPP to say whether @code{char} is signed by default
+signed_char Defines to pass to CPP to say whether @code{char} is signed
+ by default
startfile Object files to include at the start of the link
@end smallexample
@@ -3974,7 +4526,7 @@ it is possible to generate quite complex command lines.
Here is a table of all defined @samp{%}-sequences for spec
strings. Note that spaces are not generated automatically around the
results of expanding these sequences. Therefore you can concatenate them
-together or combine them with constant text in a single argument.
+together or combine them with constant text in a single argument.
@table @code
@item %%
@@ -3996,14 +4548,14 @@ the last period).
Marks the argument containing or following the @samp{%d} as a
temporary file name, so that that file will be deleted if GCC exits
successfully. Unlike @samp{%g}, this contributes no text to the
-argument.
+argument.
@item %g@var{suffix}
Substitute a file name that has suffix @var{suffix} and is chosen
once per compilation, and mark the argument in the same way as
@samp{%d}. To reduce exposure to denial-of-service attacks, the file
-name is now chosen in a way that is hard to predict even when previously
-chosen file names are known. For example, @samp{%g.s ... %g.o ... %g.s}
+name is now chosen in a way that is hard to predict even when previously
+chosen file names are known. For example, @samp{%g.s @dots{} %g.o @dots{} %g.s}
might turn into @samp{ccUVUUAU.s ccXYAXZ12.o ccUVUUAU.s}. @var{suffix} matches
the regexp @samp{[.A-Za-z]*} or the special string @samp{%O}, which is
treated exactly as if @samp{%O} had been preprocessed. Previously, @samp{%g}
@@ -4019,14 +4571,14 @@ Like @samp{%g}, but generates a new temporary file name even if
Substitutes the last file name generated with @samp{%u@var{suffix}}, generating a
new one if there is no such last file name. In the absence of any
@samp{%u@var{suffix}}, this is just like @samp{%g@var{suffix}}, except they don't share
-the same suffix @emph{space}, so @samp{%g.s ... %U.s ... %g.s ... %U.s}
+the same suffix @emph{space}, so @samp{%g.s @dots{} %U.s @dots{} %g.s @dots{} %U.s}
would involve the generation of two distinct file names, one
for each @samp{%g.s} and another for each @samp{%U.s}. Previously, @samp{%U} was
simply substituted with a file name chosen for the previous @samp{%u},
without regard to any appended suffix.
@item %j@var{SUFFIX}
-Substitutes the name of the HOST_BIT_BUCKET, if any, and if it is
+Substitutes the name of the @code{HOST_BIT_BUCKET}, if any, and if it is
writable, and if save-temps is off; otherwise, substitute the name
of a temporary file, just like @samp{%u}. This temporary file is not
meant for communication between processes, but rather as a junk
@@ -4034,7 +4586,7 @@ disposal mechanism.
@item %.@var{SUFFIX}
Substitutes @var{.SUFFIX} for the suffixes of a matched switch's args
-when it is subsequently output with @samp{%*}. @var{SUFFIX} is
+when it is subsequently output with @samp{%*}. @var{SUFFIX} is
terminated by the next space or %.
@item %w
@@ -4068,15 +4620,15 @@ current target machine. Use this when running @code{cpp}.
Like @samp{%p}, but puts @samp{__} before and after the name of each
predefined macro, except for macros that start with @samp{__} or with
@samp{_@var{L}}, where @var{L} is an uppercase letter. This is for ISO
-C.
+C@.
@item %I
-Substitute a @samp{-iprefix} option made from GCC_EXEC_PREFIX.
+Substitute a @option{-iprefix} option made from @env{GCC_EXEC_PREFIX}.
@item %s
Current argument is the name of a library or startup file of some sort.
Search for that file in a standard list of directories and substitute
-the full name found.
+the full name found.
@item %e@var{str}
Print @var{str} as an error message. @var{str} is terminated by a newline.
@@ -4089,31 +4641,31 @@ Output @samp{-} if the input for the current command is coming from a pipe.
Substitute the contents of spec string @var{name} at this point.
@item %[@var{name}]
-Like @samp{%(...)} but put @samp{__} around @samp{-D} arguments.
+Like @samp{%(@dots{})} but put @samp{__} around @option{-D} arguments.
@item %x@{@var{option}@}
Accumulate an option for @samp{%X}.
@item %X
-Output the accumulated linker options specified by @samp{-Wl} or a @samp{%x}
+Output the accumulated linker options specified by @option{-Wl} or a @samp{%x}
spec string.
@item %Y
-Output the accumulated assembler options specified by @samp{-Wa}.
+Output the accumulated assembler options specified by @option{-Wa}.
@item %Z
-Output the accumulated preprocessor options specified by @samp{-Wp}.
+Output the accumulated preprocessor options specified by @option{-Wp}.
@item %v1
-Substitute the major version number of GCC.
+Substitute the major version number of GCC@.
(For version 2.9.5, this is 2.)
@item %v2
-Substitute the minor version number of GCC.
+Substitute the minor version number of GCC@.
(For version 2.9.5, this is 9.)
@item %v3
-Substitute the patch level number of GCC.
+Substitute the patch level number of GCC@.
(For version 2.9.5, this is 5.)
@item %a
@@ -4131,31 +4683,31 @@ command line passed to the linker. Typically it will make use of the
@samp{%L %G %S %D and %E} sequences.
@item %D
-Dump out a @samp{-L} option for each directory that GCC believes might
+Dump out a @option{-L} option for each directory that GCC believes might
contain startup files. If the target supports multilibs then the
-current multilib directory will be prepended to each of these paths.
+current multilib directory will be prepended to each of these paths.
@item %M
-Output the multilib directory with directory seperators replaced with
-"_". If multilib directories are not set, or the multilib directory is
-"." then this option emits nothing.
+Output the multilib directory with directory separators replaced with
+@samp{_}. If multilib directories are not set, or the multilib directory is
+@file{.} then this option emits nothing.
@item %L
Process the @code{lib} spec. This is a spec string for deciding which
-libraries should be included on the command line to the linker.
+libraries should be included on the command line to the linker.
@item %G
Process the @code{libgcc} spec. This is a spec string for deciding
-which GCC support library should be included on the command line to the linker.
+which GCC support library should be included on the command line to the linker.
@item %S
Process the @code{startfile} spec. This is a spec for deciding which
object files should be the first ones passed to the linker. Typically
-this might be a file named @file{crt0.o}.
+this might be a file named @file{crt0.o}.
@item %E
Process the @code{endfile} spec. This is a spec string that specifies
-the last object files that will be passed to the linker.
+the last object files that will be passed to the linker.
@item %C
Process the @code{cpp} spec. This is used to construct the arguments
@@ -4163,7 +4715,7 @@ to be passed to the C preprocessor.
@item %c
Process the @code{signed_char} spec. This is intended to be used
-to tell cpp whether a char is signed. It typically has the definition:
+to tell cpp whether a char is signed. It typically has the definition:
@smallexample
%@{funsigned-char:-D__CHAR_UNSIGNED__@}
@end smallexample
@@ -4182,23 +4734,24 @@ Note that each comma in the substituted string is replaced by
a single space.
@item %@{@code{S}@}
-Substitutes the @code{-S} switch, if that switch was given to GCC.
+Substitutes the @code{-S} switch, if that switch was given to GCC@.
If that switch was not specified, this substitutes nothing. Note that
the leading dash is omitted when specifying this option, and it is
automatically inserted if the substitution is performed. Thus the spec
-string @samp{%@{foo@}} would match the command-line option @samp{-foo}
-and would output the command line option @samp{-foo}.
+string @samp{%@{foo@}} would match the command-line option @option{-foo}
+and would output the command line option @option{-foo}.
@item %W@{@code{S}@}
Like %@{@code{S}@} but mark last argument supplied within as a file to be
-deleted on failure.
+deleted on failure.
@item %@{@code{S}*@}
Substitutes all the switches specified to GCC whose names start
with @code{-S}, but which also take an argument. This is used for
-switches like @samp{-o, -D, -I}, etc. GCC considers @samp{-o foo} as being
+switches like @option{-o}, @option{-D}, @option{-I}, etc.
+GCC considers @option{-o foo} as being
one switch whose names starts with @samp{o}. %@{o*@} would substitute this
-text, including the space. Thus two arguments would be generated.
+text, including the space. Thus two arguments would be generated.
@item %@{^@code{S}*@}
Like %@{@code{S}*@}, but don't put a blank between a switch and its
@@ -4211,22 +4764,22 @@ There can be any number of ampersand-separated variables; for each the
wild card is optional. Useful for CPP as @samp{%@{D*&U*&A*@}}.
@item %@{<@code{S}@}
-Remove all occurrences of @code{-S} from the command line. Note - this
+Remove all occurrences of @code{-S} from the command line. Note---this
command is position dependent. @samp{%} commands in the spec string
before this option will see @code{-S}, @samp{%} commands in the spec
string after this option will not.
@item %@{@code{S}*:@code{X}@}
Substitutes @code{X} if one or more switches whose names start with
-@code{-S} are specified to GCC. Note that the tail part of the
-@code{-S} option (i.e. the part matched by the @samp{*}) will be substituted
-for each occurrence of @samp{%*} within @code{X}.
+@code{-S} are specified to GCC@. Note that the tail part of the
+@code{-S} option (i.e.@: the part matched by the @samp{*}) will be substituted
+for each occurrence of @samp{%*} within @code{X}.
@item %@{@code{S}:@code{X}@}
-Substitutes @code{X}, but only if the @samp{-S} switch was given to GCC.
+Substitutes @code{X}, but only if the @samp{-S} switch was given to GCC@.
@item %@{!@code{S}:@code{X}@}
-Substitutes @code{X}, but only if the @samp{-S} switch was @emph{not} given to GCC.
+Substitutes @code{X}, but only if the @samp{-S} switch was @emph{not} given to GCC@.
@item %@{|@code{S}:@code{X}@}
Like %@{@code{S}:@code{X}@}, but if no @code{S} switch, substitute @samp{-}.
@@ -4241,7 +4794,7 @@ Substitutes @code{X}, but only if processing a file with suffix @code{S}.
Substitutes @code{X}, but only if @emph{not} processing a file with suffix @code{S}.
@item %@{@code{S}|@code{P}:@code{X}@}
-Substitutes @code{X} if either @code{-S} or @code{-P} was given to GCC. This may be
+Substitutes @code{X} if either @code{-S} or @code{-P} was given to GCC@. This may be
combined with @samp{!} and @samp{.} sequences as well, although they
have a stronger binding than the @samp{|}. For example a spec string
like this:
@@ -4265,16 +4818,17 @@ jim.d -bar -boggle
The conditional text @code{X} in a %@{@code{S}:@code{X}@} or
%@{!@code{S}:@code{X}@} construct may contain other nested @samp{%} constructs
or spaces, or even newlines. They are processed as usual, as described
-above.
+above.
-The @samp{-O, -f, -m, and -W} switches are handled specifically in these
-constructs. If another value of @samp{-O} or the negated form of a @samp{-f, -m, or
--W} switch is found later in the command line, the earlier switch
+The @option{-O}, @option{-f}, @option{-m}, and @option{-W}
+switches are handled specifically in these
+constructs. If another value of @option{-O} or the negated form of a @option{-f}, @option{-m}, or
+@option{-W} switch is found later in the command line, the earlier switch
value is ignored, except with @{@code{S}*@} where @code{S} is just one
letter, which passes all matching options.
The character @samp{|} at the beginning of the predicate text is used to indicate
-that a command should be piped to the following command, but only if @samp{-pipe}
+that a command should be piped to the following command, but only if @option{-pipe}
is specified.
It is built into GCC which switches take arguments and which do not.
@@ -4283,9 +4837,9 @@ compiler's spec to say which switches take arguments. But this cannot
be done in a consistent fashion. GCC cannot even decide which input
files have been specified without knowing which switches take arguments,
and it must know which input files to compile in order to tell which
-compilers to run).
+compilers to run).
-GCC also knows implicitly that arguments starting in @samp{-l} are to be
+GCC also knows implicitly that arguments starting in @option{-l} are to be
treated as compiler output files, and passed to the linker in their
proper position among the other output files.
@@ -4305,7 +4859,7 @@ are using. However, it can also be installed as a cross-compiler, to
compile for some other type of machine. In fact, several different
configurations of GCC, for different target machines, can be
installed side by side. Then you specify which one to use with the
-@samp{-b} option.
+@option{-b} option.
In addition, older and newer versions of GCC can be installed side
by side. One of them (probably the newest) will be the default, but
@@ -4313,6 +4867,7 @@ you may sometimes wish to use another.
@table @gcctabopt
@item -b @var{machine}
+@opindex b
The argument @var{machine} specifies the target machine for compilation.
This is useful when you have installed GCC as a cross-compiler.
@@ -4320,32 +4875,33 @@ The value to use for @var{machine} is the same as was specified as the
machine type when configuring GCC as a cross-compiler. For
example, if a cross-compiler was configured with @samp{configure
i386v}, meaning to compile for an 80386 running System V, then you
-would specify @samp{-b i386v} to run that cross compiler.
+would specify @option{-b i386v} to run that cross compiler.
-When you do not specify @samp{-b}, it normally means to compile for
+When you do not specify @option{-b}, it normally means to compile for
the same type of machine that you are using.
@item -V @var{version}
+@opindex V
The argument @var{version} specifies which version of GCC to run.
This is useful when multiple versions are installed. For example,
@var{version} might be @samp{2.0}, meaning to run GCC version 2.0.
-The default version, when you do not specify @samp{-V}, is the last
+The default version, when you do not specify @option{-V}, is the last
version of GCC that you installed.
@end table
-The @samp{-b} and @samp{-V} options actually work by controlling part of
+The @option{-b} and @option{-V} options actually work by controlling part of
the file name used for the executable files and libraries used for
compilation. A given version of GCC, for a given target machine, is
-normally kept in the directory @file{/usr/local/lib/gcc-lib/@var{machine}/@var{version}}.@refill
+normally kept in the directory @file{/usr/local/lib/gcc-lib/@var{machine}/@var{version}}.
-Thus, sites can customize the effect of @samp{-b} or @samp{-V} either by
+Thus, sites can customize the effect of @option{-b} or @option{-V} either by
changing the names of these directories or adding alternate names (or
symbolic links). If in directory @file{/usr/local/lib/gcc-lib/} the
-file @file{80386} is a link to the file @file{i386v}, then @samp{-b
-80386} becomes an alias for @samp{-b i386v}.
+file @file{80386} is a link to the file @file{i386v}, then @option{-b
+80386} becomes an alias for @option{-b i386v}.
-In one respect, the @samp{-b} or @samp{-V} do not completely change
+In one respect, the @option{-b} or @option{-V} do not completely change
to a different compiler: the top-level driver program @command{gcc}
that you originally invoked continues to run and invoke the other
executables (preprocessor, compiler per se, assembler and linker)
@@ -4354,9 +4910,9 @@ driver program, it usually does not matter that the driver program
in use is not the one for the specified target. It is common for the
interface to the other executables to change incompatibly between
compiler versions, so unless the version specified is very close to that
-of the driver (for example, @samp{-V 3.0} with a driver program from GCC
-version 3.0.1), use of @samp{-V} may not work; for example, using
-@samp{-V 2.95.2} will not work with a driver program from GCC 3.0.
+of the driver (for example, @option{-V 3.0} with a driver program from GCC
+version 3.0.1), use of @option{-V} may not work; for example, using
+@option{-V 2.95.2} will not work with a driver program from GCC 3.0.
The only way that the driver program depends on the target machine is
in the parsing and handling of special machine-specific options.
@@ -4375,7 +4931,7 @@ For example, if the driver for version 2.0 is installed as @command{ogcc}
and that for version 2.1 is installed as @command{gcc}, then the command
@command{gcc} will use version 2.1 by default, while @command{ogcc} will use
2.0 by default. However, you can choose either version with either
-command with the @samp{-V} option.
+command with the @option{-V} option.
@node Submodel Options
@section Hardware Models and Configurations
@@ -4384,9 +4940,9 @@ command with the @samp{-V} option.
@cindex hardware models and configurations, specifying
@cindex machine dependent options
-Earlier we discussed the standard option @samp{-b} which chooses among
+Earlier we discussed the standard option @option{-b} which chooses among
different installed compilers for completely different target
-machines, such as Vax vs. 68000 vs. 80386.
+machines, such as Vax vs.@: 68000 vs.@: 80386.
In addition, each of these target machine types can have its own
special options, starting with @samp{-m}, to choose among various
@@ -4413,7 +4969,6 @@ that macro, which enables you to change the defaults.
* Convex Options::
* AMD29K Options::
* ARM Options::
-* Thumb Options::
* MN10200 Options::
* MN10300 Options::
* M32R/D Options::
@@ -4437,6 +4992,8 @@ that macro, which enables you to change the defaults.
* MCore Options::
* IA-64 Options::
* D30V Options::
+* S/390 and zSeries Options::
+* Xtensa Options::
@end menu
@node M680x0 Options
@@ -4451,6 +5008,8 @@ given below.
@table @gcctabopt
@item -m68000
@itemx -mc68000
+@opindex m68000
+@opindex mc68000
Generate output for a 68000. This is the default
when the compiler is configured for 68000-based systems.
@@ -4459,19 +5018,24 @@ including the 68008, 68302, 68306, 68307, 68322, 68328 and 68356.
@item -m68020
@itemx -mc68020
+@opindex m68020
+@opindex mc68020
Generate output for a 68020. This is the default
when the compiler is configured for 68020-based systems.
@item -m68881
+@opindex m68881
Generate output containing 68881 instructions for floating point.
-This is the default for most 68020 systems unless @samp{-nfp} was
+This is the default for most 68020 systems unless @option{--nfp} was
specified when the compiler was configured.
@item -m68030
+@opindex m68030
Generate output for a 68030. This is the default when the compiler is
configured for 68030-based systems.
@item -m68040
+@opindex m68040
Generate output for a 68040. This is the default when the compiler is
configured for 68040-based systems.
@@ -4480,6 +5044,7 @@ emulated by software on the 68040. Use this option if your 68040 does not
have code to emulate those instructions.
@item -m68060
+@opindex m68060
Generate output for a 68060. This is the default when the compiler is
configured for 68060-based systems.
@@ -4488,7 +5053,8 @@ have to be emulated by software on the 68060. Use this option if your 68060
does not have code to emulate those instructions.
@item -mcpu32
-Generate output for a CPU32. This is the default
+@opindex mcpu32
+Generate output for a CPU32. This is the default
when the compiler is configured for CPU32-based systems.
Use this option for microcontrollers with a
@@ -4496,29 +5062,34 @@ CPU32 or CPU32+ core, including the 68330, 68331, 68332, 68333, 68334,
68336, 68340, 68341, 68349 and 68360.
@item -m5200
-Generate output for a 520X "coldfire" family cpu. This is the default
+@opindex m5200
+Generate output for a 520X ``coldfire'' family cpu. This is the default
when the compiler is configured for 520X-based systems.
-Use this option for microcontroller with a 5200 core, including
+Use this option for microcontroller with a 5200 core, including
the MCF5202, MCF5203, MCF5204 and MCF5202.
@item -m68020-40
+@opindex m68020-40
Generate output for a 68040, without using any of the new instructions.
This results in code which can run relatively efficiently on either a
68020/68881 or a 68030 or a 68040. The generated code does use the
68881 instructions that are emulated on the 68040.
@item -m68020-60
+@opindex m68020-60
Generate output for a 68060, without using any of the new instructions.
This results in code which can run relatively efficiently on either a
68020/68881 or a 68030 or a 68040. The generated code does use the
68881 instructions that are emulated on the 68060.
@item -mfpa
+@opindex mfpa
Generate output containing Sun FPA instructions for floating point.
@item -msoft-float
+@opindex msoft-float
Generate output containing library calls for floating point.
@strong{Warning:} the requisite libraries are not available for all m68k
targets. Normally the facilities of the machine's usual C compiler are
@@ -4528,18 +5099,22 @@ cross-compilation. The embedded targets @samp{m68k-*-aout} and
@samp{m68k-*-coff} do provide software floating point support.
@item -mshort
+@opindex mshort
Consider type @code{int} to be 16 bits wide, like @code{short int}.
@item -mnobitfield
-Do not use the bit-field instructions. The @samp{-m68000}, @samp{-mcpu32}
-and @samp{-m5200} options imply @w{@samp{-mnobitfield}}.
+@opindex mnobitfield
+Do not use the bit-field instructions. The @option{-m68000}, @option{-mcpu32}
+and @option{-m5200} options imply @w{@option{-mnobitfield}}.
@item -mbitfield
-Do use the bit-field instructions. The @samp{-m68020} option implies
-@samp{-mbitfield}. This is the default if you use a configuration
+@opindex mbitfield
+Do use the bit-field instructions. The @option{-m68020} option implies
+@option{-mbitfield}. This is the default if you use a configuration
designed for a 68020.
@item -mrtd
+@opindex mrtd
Use a different function-calling convention, in which functions
that take a fixed number of arguments return with the @code{rtd}
instruction, which pops their arguments while returning. This
@@ -4564,26 +5139,30 @@ The @code{rtd} instruction is supported by the 68010, 68020, 68030,
@item -malign-int
@itemx -mno-align-int
-Control whether GCC aligns @code{int}, @code{long}, @code{long long},
+@opindex malign-int
+@opindex mno-align-int
+Control whether GCC aligns @code{int}, @code{long}, @code{long long},
@code{float}, @code{double}, and @code{long double} variables on a 32-bit
-boundary (@samp{-malign-int}) or a 16-bit boundary (@samp{-mno-align-int}).
+boundary (@option{-malign-int}) or a 16-bit boundary (@option{-mno-align-int}).
Aligning variables on 32-bit boundaries produces code that runs somewhat
faster on processors with 32-bit busses at the expense of more memory.
-@strong{Warning:} if you use the @samp{-malign-int} switch, GCC will
+@strong{Warning:} if you use the @option{-malign-int} switch, GCC will
align structures containing the above types differently than
most published application binary interface specifications for the m68k.
@item -mpcrel
+@opindex mpcrel
Use the pc-relative addressing mode of the 68000 directly, instead of
-using a global offset table. At present, this option implies -fpic,
-allowing at most a 16-bit offset for pc-relative addressing. -fPIC is
-not presently supported with -mpcrel, though this could be supported for
+using a global offset table. At present, this option implies @option{-fpic},
+allowing at most a 16-bit offset for pc-relative addressing. @option{-fPIC} is
+not presently supported with @option{-mpcrel}, though this could be supported for
68020 and higher processors.
@item -mno-strict-align
@itemx -mstrict-align
-@kindex -mstrict-align
+@opindex mno-strict-align
+@opindex mstrict-align
Do not (do) assume that unaligned memory references will be handled by
the system.
@@ -4594,29 +5173,36 @@ the system.
@cindex M68hc1x options
These are the @samp{-m} options defined for the 68hc11 and 68hc12
-microcontrollers. The default values for these options depends on
+microcontrollers. The default values for these options depends on
which style of microcontroller was selected when the compiler was configured;
the defaults for the most common choices are given below.
@table @gcctabopt
@item -m6811
@itemx -m68hc11
+@opindex m6811
+@opindex m68hc11
Generate output for a 68HC11. This is the default
when the compiler is configured for 68HC11-based systems.
@item -m6812
@itemx -m68hc12
+@opindex m6812
+@opindex m68hc12
Generate output for a 68HC12. This is the default
when the compiler is configured for 68HC12-based systems.
@item -mauto-incdec
+@opindex mauto-incdec
Enable the use of 68HC12 pre and post auto-increment and auto-decrement
addressing modes.
@item -mshort
+@opindex mshort
Consider type @code{int} to be 16 bits wide, like @code{short int}.
@item -msoft-reg-count=@var{count}
+@opindex msoft-reg-count
Specify the number of pseudo-soft registers which are used for the
code generation. The maximum number is 32. Using more pseudo-soft
register may or may not result in better code depending on the program.
@@ -4632,15 +5218,18 @@ These @samp{-m} options are defined for the Vax:
@table @gcctabopt
@item -munix
+@opindex munix
Do not output certain jump instructions (@code{aobleq} and so on)
that the Unix assembler for the Vax cannot handle across long
ranges.
@item -mgnu
+@opindex mgnu
Do output those jump instructions, on the assumption that you
will assemble with the GNU assembler.
@item -mg
+@opindex mg
Output code for g-format floating point numbers instead of d-format.
@end table
@@ -4653,21 +5242,27 @@ These @samp{-m} switches are supported on the SPARC:
@table @gcctabopt
@item -mno-app-regs
@itemx -mapp-regs
-Specify @samp{-mapp-regs} to generate output using the global registers
+@opindex mno-app-regs
+@opindex mapp-regs
+Specify @option{-mapp-regs} to generate output using the global registers
2 through 4, which the SPARC SVR4 ABI reserves for applications. This
is the default.
To be fully SVR4 ABI compliant at the cost of some performance loss,
-specify @samp{-mno-app-regs}. You should compile libraries and system
+specify @option{-mno-app-regs}. You should compile libraries and system
software with this option.
@item -mfpu
@itemx -mhard-float
+@opindex mfpu
+@opindex mhard-float
Generate output containing floating point instructions. This is the
default.
@item -mno-fpu
@itemx -msoft-float
+@opindex mno-fpu
+@opindex msoft-float
Generate output containing library calls for floating point.
@strong{Warning:} the requisite libraries are not available for all SPARC
targets. Normally the facilities of the machine's usual C compiler are
@@ -4676,55 +5271,63 @@ your own arrangements to provide suitable library functions for
cross-compilation. The embedded targets @samp{sparc-*-aout} and
@samp{sparclite-*-*} do provide software floating point support.
-@samp{-msoft-float} changes the calling convention in the output file;
+@option{-msoft-float} changes the calling convention in the output file;
therefore, it is only useful if you compile @emph{all} of a program with
this option. In particular, you need to compile @file{libgcc.a}, the
-library that comes with GCC, with @samp{-msoft-float} in order for
+library that comes with GCC, with @option{-msoft-float} in order for
this to work.
@item -mhard-quad-float
+@opindex mhard-quad-float
Generate output containing quad-word (long double) floating point
instructions.
@item -msoft-quad-float
+@opindex msoft-quad-float
Generate output containing library calls for quad-word (long double)
floating point instructions. The functions called are those specified
-in the SPARC ABI. This is the default.
+in the SPARC ABI@. This is the default.
As of this writing, there are no sparc implementations that have hardware
support for the quad-word floating point instructions. They all invoke
a trap handler for one of these instructions, and then the trap handler
emulates the effect of the instruction. Because of the trap handler overhead,
this is much slower than calling the ABI library routines. Thus the
-@samp{-msoft-quad-float} option is the default.
+@option{-msoft-quad-float} option is the default.
@item -mno-epilogue
@itemx -mepilogue
-With @samp{-mepilogue} (the default), the compiler always emits code for
+@opindex mno-epilogue
+@opindex mepilogue
+With @option{-mepilogue} (the default), the compiler always emits code for
function exit at the end of each function. Any function exit in
the middle of the function (such as a return statement in C) will
generate a jump to the exit code at the end of the function.
-With @samp{-mno-epilogue}, the compiler tries to emit exit code inline
+With @option{-mno-epilogue}, the compiler tries to emit exit code inline
at every function exit.
@item -mno-flat
@itemx -mflat
-With @samp{-mflat}, the compiler does not generate save/restore instructions
-and will use a "flat" or single register window calling convention.
+@opindex mno-flat
+@opindex mflat
+With @option{-mflat}, the compiler does not generate save/restore instructions
+and will use a ``flat'' or single register window calling convention.
This model uses %i7 as the frame pointer and is compatible with the normal
register window model. Code from either may be intermixed.
-The local registers and the input registers (0-5) are still treated as
-"call saved" registers and will be saved on the stack as necessary.
+The local registers and the input registers (0--5) are still treated as
+``call saved'' registers and will be saved on the stack as necessary.
-With @samp{-mno-flat} (the default), the compiler emits save/restore
+With @option{-mno-flat} (the default), the compiler emits save/restore
instructions (except for leaf functions) and is the normal mode of operation.
@item -mno-unaligned-doubles
@itemx -munaligned-doubles
+@opindex mno-unaligned-doubles
+@opindex munaligned-doubles
Assume that doubles have 8 byte alignment. This is the default.
-With @samp{-munaligned-doubles}, GCC assumes that doubles have 8 byte
+With @option{-munaligned-doubles}, GCC assumes that doubles have 8 byte
alignment only if they are contained in another type, or if they have an
absolute address. Otherwise, it assumes they have 4 byte alignment.
Specifying this option avoids some rare compatibility problems with code
@@ -4733,49 +5336,56 @@ in a performance loss, especially for floating point code.
@item -mno-faster-structs
@itemx -mfaster-structs
-With @samp{-mfaster-structs}, the compiler assumes that structures
+@opindex mno-faster-structs
+@opindex mfaster-structs
+With @option{-mfaster-structs}, the compiler assumes that structures
should have 8 byte alignment. This enables the use of pairs of
@code{ldd} and @code{std} instructions for copies in structure
assignment, in place of twice as many @code{ld} and @code{st} pairs.
However, the use of this changed alignment directly violates the Sparc
-ABI. Thus, it's intended only for use on targets where the developer
+ABI@. Thus, it's intended only for use on targets where the developer
acknowledges that their resulting code will not be directly in line with
-the rules of the ABI.
+the rules of the ABI@.
@item -mv8
@itemx -msparclite
+@opindex mv8
+@opindex msparclite
These two options select variations on the SPARC architecture.
By default (unless specifically configured for the Fujitsu SPARClite),
GCC generates code for the v7 variant of the SPARC architecture.
-@samp{-mv8} will give you SPARC v8 code. The only difference from v7
+@option{-mv8} will give you SPARC v8 code. The only difference from v7
code is that the compiler emits the integer multiply and integer
divide instructions which exist in SPARC v8 but not in SPARC v7.
-@samp{-msparclite} will give you SPARClite code. This adds the integer
+@option{-msparclite} will give you SPARClite code. This adds the integer
multiply, integer divide step and scan (@code{ffs}) instructions which
exist in SPARClite but not in SPARC v7.
These options are deprecated and will be deleted in a future GCC release.
-They have been replaced with @samp{-mcpu=xxx}.
+They have been replaced with @option{-mcpu=xxx}.
@item -mcypress
@itemx -msupersparc
+@opindex mcypress
+@opindex msupersparc
These two options select the processor for which the code is optimised.
-With @samp{-mcypress} (the default), the compiler optimizes code for the
+With @option{-mcypress} (the default), the compiler optimizes code for the
Cypress CY7C602 chip, as used in the SparcStation/SparcServer 3xx series.
This is also appropriate for the older SparcStation 1, 2, IPX etc.
-With @samp{-msupersparc} the compiler optimizes code for the SuperSparc cpu, as
-used in the SparcStation 10, 1000 and 2000 series. This flag also enables use
+With @option{-msupersparc} the compiler optimizes code for the SuperSparc cpu, as
+used in the SparcStation 10, 1000 and 2000 series. This flag also enables use
of the full SPARC v8 instruction set.
These options are deprecated and will be deleted in a future GCC release.
-They have been replaced with @samp{-mcpu=xxx}.
+They have been replaced with @option{-mcpu=xxx}.
@item -mcpu=@var{cpu_type}
+@opindex mcpu
Set the instruction set, register set, and instruction scheduling parameters
for machine type @var{cpu_type}. Supported values for @var{cpu_type} are
@samp{v7}, @samp{cypress}, @samp{v8}, @samp{supersparc}, @samp{sparclite},
@@ -4798,12 +5408,13 @@ implementations.
@end smallexample
@item -mtune=@var{cpu_type}
+@opindex mtune
Set the instruction scheduling parameters for machine type
@var{cpu_type}, but do not set the instruction set or register set that the
-option @samp{-mcpu=}@var{cpu_type} would.
+option @option{-mcpu=@var{cpu_type}} would.
-The same values for @samp{-mcpu=}@var{cpu_type} are used for
-@samp{-mtune=}@*@var{cpu_type}, though the only useful values are those that
+The same values for @option{-mcpu=@var{cpu_type}} are used for
+@option{-mtune=@var{cpu_type}}, though the only useful values are those that
select a particular cpu implementation: @samp{cypress}, @samp{supersparc},
@samp{hypersparc}, @samp{f930}, @samp{f934}, @samp{sparclite86x},
@samp{tsc701}, @samp{ultrasparc}.
@@ -4815,14 +5426,17 @@ on the SPARCLET processor.
@table @gcctabopt
@item -mlittle-endian
+@opindex mlittle-endian
Generate code for a processor running in little-endian mode.
@item -mlive-g0
+@opindex mlive-g0
Treat register @code{%g0} as a normal register.
GCC will continue to clobber it as necessary but will not assume
it always reads as 0.
@item -mbroken-saverestore
+@opindex mbroken-saverestore
Generate code that does not use non-trivial forms of the @code{save} and
@code{restore} instructions. Early versions of the SPARCLET processor do
not correctly handle @code{save} and @code{restore} instructions used with
@@ -4834,47 +5448,56 @@ handlers.
@end table
These @samp{-m} switches are supported in addition to the above
-on SPARC V9 processors in 64 bit environments.
+on SPARC V9 processors in 64-bit environments.
@table @gcctabopt
@item -mlittle-endian
+@opindex mlittle-endian
Generate code for a processor running in little-endian mode.
@item -m32
@itemx -m64
-Generate code for a 32 bit or 64 bit environment.
-The 32 bit environment sets int, long and pointer to 32 bits.
-The 64 bit environment sets int to 32 bits and long and pointer
+@opindex m32
+@opindex m64
+Generate code for a 32-bit or 64-bit environment.
+The 32-bit environment sets int, long and pointer to 32 bits.
+The 64-bit environment sets int to 32 bits and long and pointer
to 64 bits.
@item -mcmodel=medlow
+@opindex mcmodel=medlow
Generate code for the Medium/Low code model: the program must be linked
in the low 32 bits of the address space. Pointers are 64 bits.
Programs can be statically or dynamically linked.
@item -mcmodel=medmid
+@opindex mcmodel=medmid
Generate code for the Medium/Middle code model: the program must be linked
in the low 44 bits of the address space, the text segment must be less than
2G bytes, and data segment must be within 2G of the text segment.
Pointers are 64 bits.
@item -mcmodel=medany
+@opindex mcmodel=medany
Generate code for the Medium/Anywhere code model: the program may be linked
anywhere in the address space, the text segment must be less than
2G bytes, and data segment must be within 2G of the text segment.
Pointers are 64 bits.
@item -mcmodel=embmedany
+@opindex mcmodel=embmedany
Generate code for the Medium/Anywhere code model for embedded systems:
-assume a 32 bit text and a 32 bit data segment, both starting anywhere
+assume a 32-bit text and a 32-bit data segment, both starting anywhere
(determined at link time). Register %g4 points to the base of the
-data segment. Pointers still 64 bits.
+data segment. Pointers are still 64 bits.
Programs are statically linked, PIC is not supported.
@item -mstack-bias
@itemx -mno-stack-bias
-With @samp{-mstack-bias}, GCC assumes that the stack pointer, and
-frame pointer if present, are offset by -2047 which must be added back
+@opindex mstack-bias
+@opindex mno-stack-bias
+With @option{-mstack-bias}, GCC assumes that the stack pointer, and
+frame pointer if present, are offset by @minus{}2047 which must be added back
when making stack frame references.
Otherwise, assume no such offset is present.
@end table
@@ -4887,51 +5510,62 @@ These @samp{-m} options are defined for Convex:
@table @gcctabopt
@item -mc1
+@opindex mc1
Generate output for C1. The code will run on any Convex machine.
The preprocessor symbol @code{__convex__c1__} is defined.
@item -mc2
+@opindex mc2
Generate output for C2. Uses instructions not available on C1.
Scheduling and other optimizations are chosen for max performance on C2.
The preprocessor symbol @code{__convex_c2__} is defined.
@item -mc32
+@opindex mc32
Generate output for C32xx. Uses instructions not available on C1.
Scheduling and other optimizations are chosen for max performance on C32.
The preprocessor symbol @code{__convex_c32__} is defined.
@item -mc34
+@opindex mc34
Generate output for C34xx. Uses instructions not available on C1.
Scheduling and other optimizations are chosen for max performance on C34.
The preprocessor symbol @code{__convex_c34__} is defined.
@item -mc38
+@opindex mc38
Generate output for C38xx. Uses instructions not available on C1.
Scheduling and other optimizations are chosen for max performance on C38.
The preprocessor symbol @code{__convex_c38__} is defined.
@item -margcount
+@opindex margcount
Generate code which puts an argument count in the word preceding each
argument list. This is compatible with regular CC, and a few programs
may need the argument count word. GDB and other source-level debuggers
do not need it; this info is in the symbol table.
@item -mnoargcount
+@opindex mnoargcount
Omit the argument count word. This is the default.
@item -mvolatile-cache
+@opindex mvolatile-cache
Allow volatile references to be cached. This is the default.
@item -mvolatile-nocache
+@opindex mvolatile-nocache
Volatile references bypass the data cache, going all the way to memory.
This is only needed for multi-processor code that does not use standard
synchronization instructions. Making non-volatile references to volatile
locations will not necessarily work.
@item -mlong32
+@opindex mlong32
Type long is 32 bits, the same as type int. This is the default.
@item -mlong64
+@opindex mlong64
Type long is 64 bits, the same as type long long. This option is useless,
because no library support exists for it.
@end table
@@ -4944,29 +5578,29 @@ These @samp{-m} options are defined for the AMD Am29000:
@table @gcctabopt
@item -mdw
-@kindex -mdw
+@opindex mdw
@cindex DW bit (29k)
Generate code that assumes the @code{DW} bit is set, i.e., that byte and
halfword operations are directly supported by the hardware. This is the
default.
@item -mndw
-@kindex -mndw
+@opindex mndw
Generate code that assumes the @code{DW} bit is not set.
@item -mbw
-@kindex -mbw
+@opindex mbw
@cindex byte writes (29k)
Generate code that assumes the system supports byte and halfword write
operations. This is the default.
@item -mnbw
-@kindex -mnbw
+@opindex mnbw
Generate code that assumes the systems does not support byte and
-halfword write operations. @samp{-mnbw} implies @samp{-mndw}.
+halfword write operations. @option{-mnbw} implies @option{-mndw}.
@item -msmall
-@kindex -msmall
+@opindex msmall
@cindex memory model (29k)
Use a small memory model that assumes that all function addresses are
either within a single 256 KB segment or at an absolute address of less
@@ -4974,27 +5608,28 @@ than 256k. This allows the @code{call} instruction to be used instead
of a @code{const}, @code{consth}, @code{calli} sequence.
@item -mnormal
-@kindex -mnormal
+@opindex mnormal
Use the normal memory model: Generate @code{call} instructions only when
calling functions in the same file and @code{calli} instructions
otherwise. This works if each file occupies less than 256 KB but allows
-the entire executable to be larger than 256 KB. This is the default.
+the entire executable to be larger than 256 KB@. This is the default.
@item -mlarge
+@opindex mlarge
Always use @code{calli} instructions. Specify this option if you expect
a single file to compile into more than 256 KB of code.
@item -m29050
-@kindex -m29050
+@opindex m29050
@cindex processor selection (29k)
Generate code for the Am29050.
@item -m29000
-@kindex -m29000
+@opindex m29000
Generate code for the Am29000. This is the default.
@item -mkernel-registers
-@kindex -mkernel-registers
+@opindex mkernel-registers
@cindex kernel and user registers (29k)
Generate references to registers @code{gr64-gr95} instead of to
registers @code{gr96-gr127}. This option can be used when compiling
@@ -5005,49 +5640,53 @@ Note that when this option is used, register names in @samp{-f} flags
must use the normal, user-mode, names.
@item -muser-registers
-@kindex -muser-registers
+@opindex muser-registers
Use the normal set of global registers, @code{gr96-gr127}. This is the
default.
@item -mstack-check
@itemx -mno-stack-check
-@kindex -mstack-check
+@opindex mstack-check
+@opindex mno-stack-check
@cindex stack checks (29k)
Insert (or do not insert) a call to @code{__msp_check} after each stack
adjustment. This is often used for kernel code.
@item -mstorem-bug
@itemx -mno-storem-bug
-@kindex -mstorem-bug
+@opindex mstorem-bug
+@opindex mno-storem-bug
@cindex storem bug (29k)
-@samp{-mstorem-bug} handles 29k processors which cannot handle the
+@option{-mstorem-bug} handles 29k processors which cannot handle the
separation of a mtsrim insn and a storem instruction (most 29000 chips
to date, but not the 29050).
@item -mno-reuse-arg-regs
@itemx -mreuse-arg-regs
-@kindex -mreuse-arg-regs
-@samp{-mno-reuse-arg-regs} tells the compiler to only use incoming argument
+@opindex mno-reuse-arg-regs
+@opindex mreuse-arg-regs
+@option{-mno-reuse-arg-regs} tells the compiler to only use incoming argument
registers for copying out arguments. This helps detect calling a function
with fewer arguments than it was declared with.
@item -mno-impure-text
@itemx -mimpure-text
-@kindex -mimpure-text
-@samp{-mimpure-text}, used in addition to @samp{-shared}, tells the compiler to
-not pass @samp{-assert pure-text} to the linker when linking a shared object.
+@opindex mno-impure-text
+@opindex mimpure-text
+@option{-mimpure-text}, used in addition to @option{-shared}, tells the compiler to
+not pass @option{-assert pure-text} to the linker when linking a shared object.
@item -msoft-float
-@kindex -msoft-float
+@opindex msoft-float
Generate output containing library calls for floating point.
-@strong{Warning:} the requisite libraries are not part of GCC.
+@strong{Warning:} the requisite libraries are not part of GCC@.
Normally the facilities of the machine's usual C compiler are used, but
this can't be done directly in cross-compilation. You must make your
own arrangements to provide suitable library functions for
cross-compilation.
@item -mno-multm
-@kindex -mno-multm
+@opindex mno-multm
Do not generate multm or multmu instructions. This is useful for some embedded
systems which do not have trap handlers for these instructions.
@end table
@@ -5061,84 +5700,85 @@ architectures:
@table @gcctabopt
@item -mapcs-frame
-@kindex -mapcs-frame
+@opindex mapcs-frame
Generate a stack frame that is compliant with the ARM Procedure Call
Standard for all functions, even if this is not strictly necessary for
-correct execution of the code. Specifying @samp{-fomit-frame-pointer}
+correct execution of the code. Specifying @option{-fomit-frame-pointer}
with this option will cause the stack frames not to be generated for
-leaf functions. The default is @samp{-mno-apcs-frame}.
+leaf functions. The default is @option{-mno-apcs-frame}.
@item -mapcs
-@kindex -mapcs
-This is a synonym for @samp{-mapcs-frame}.
+@opindex mapcs
+This is a synonym for @option{-mapcs-frame}.
@item -mapcs-26
-@kindex -mapcs-26
+@opindex mapcs-26
Generate code for a processor running with a 26-bit program counter,
and conforming to the function calling standards for the APCS 26-bit
-option. This option replaces the @samp{-m2} and @samp{-m3} options
+option. This option replaces the @option{-m2} and @option{-m3} options
of previous releases of the compiler.
@item -mapcs-32
-@kindex -mapcs-32
+@opindex mapcs-32
Generate code for a processor running with a 32-bit program counter,
and conforming to the function calling standards for the APCS 32-bit
-option. This option replaces the @samp{-m6} option of previous releases
+option. This option replaces the @option{-m6} option of previous releases
of the compiler.
+@ignore
+@c not currently implemented
@item -mapcs-stack-check
-@kindex -mapcs-stack-check
-@kindex -mno-apcs-stack-check
+@opindex mapcs-stack-check
Generate code to check the amount of stack space available upon entry to
every function (that actually uses some stack space). If there is
insufficient space available then either the function
@samp{__rt_stkovf_split_small} or @samp{__rt_stkovf_split_big} will be
called, depending upon the amount of stack space required. The run time
system is required to provide these functions. The default is
-@samp{-mno-apcs-stack-check}, since this produces smaller code.
+@option{-mno-apcs-stack-check}, since this produces smaller code.
+@c not currently implemented
@item -mapcs-float
-@kindex -mapcs-float
-@kindex -mno-apcs-float
+@opindex mapcs-float
Pass floating point arguments using the float point registers. This is
-one of the variants of the APCS. This option is recommended if the
+one of the variants of the APCS@. This option is recommended if the
target hardware has a floating point unit or if a lot of floating point
arithmetic is going to be performed by the code. The default is
-@samp{-mno-apcs-float}, since integer only code is slightly increased in
-size if @samp{-mapcs-float} is used.
+@option{-mno-apcs-float}, since integer only code is slightly increased in
+size if @option{-mapcs-float} is used.
+@c not currently implemented
@item -mapcs-reentrant
-@kindex -mapcs-reentrant
-@kindex -mno-apcs-reentrant
-Generate reentrant, position independent code. This is the equivalent
-to specifying the @samp{-fpic} option. The default is
-@samp{-mno-apcs-reentrant}.
+@opindex mapcs-reentrant
+Generate reentrant, position independent code. The default is
+@option{-mno-apcs-reentrant}.
+@end ignore
@item -mthumb-interwork
-@kindex -mthumb-interwork
-@kindex -mno-thumb-interwork
-Generate code which supports calling between the ARM and THUMB
+@opindex mthumb-interwork
+Generate code which supports calling between the ARM and Thumb
instruction sets. Without this option the two instruction sets cannot
be reliably used inside one program. The default is
-@samp{-mno-thumb-interwork}, since slightly larger code is generated
-when @samp{-mthumb-interwork} is specified.
+@option{-mno-thumb-interwork}, since slightly larger code is generated
+when @option{-mthumb-interwork} is specified.
@item -mno-sched-prolog
-@kindex -mno-sched-prolog
-@kindex -msched-prolog
+@opindex mno-sched-prolog
Prevent the reordering of instructions in the function prolog, or the
merging of those instruction with the instructions in the function's
body. This means that all functions will start with a recognizable set
of instructions (or in fact one of a choice from a small set of
different function prologues), and this information can be used to
locate the start if functions inside an executable piece of code. The
-default is @samp{-msched-prolog}.
+default is @option{-msched-prolog}.
@item -mhard-float
+@opindex mhard-float
Generate output containing floating point instructions. This is the
default.
@item -msoft-float
+@opindex msoft-float
Generate output containing library calls for floating point.
@strong{Warning:} the requisite libraries are not available for all ARM
targets. Normally the facilities of the machine's usual C compiler are
@@ -5146,21 +5786,24 @@ used, but this cannot be done directly in cross-compilation. You must make
your own arrangements to provide suitable library functions for
cross-compilation.
-@samp{-msoft-float} changes the calling convention in the output file;
+@option{-msoft-float} changes the calling convention in the output file;
therefore, it is only useful if you compile @emph{all} of a program with
this option. In particular, you need to compile @file{libgcc.a}, the
-library that comes with GCC, with @samp{-msoft-float} in order for
+library that comes with GCC, with @option{-msoft-float} in order for
this to work.
@item -mlittle-endian
+@opindex mlittle-endian
Generate code for a processor running in little-endian mode. This is
the default for all standard configurations.
@item -mbig-endian
+@opindex mbig-endian
Generate code for a processor running in big-endian mode; the default is
to compile code for a little-endian processor.
@item -mwords-little-endian
+@opindex mwords-little-endian
This option only applies when generating code for big-endian processors.
Generate code for a little-endian word order but a big-endian byte
order. That is, a byte order of the form @samp{32107654}. Note: this
@@ -5169,7 +5812,7 @@ big-endian ARM processors generated by versions of the compiler prior to
2.8.
@item -malignment-traps
-@kindex -malignment-traps
+@opindex malignment-traps
Generate code that will not trap if the MMU has alignment traps enabled.
On ARM architectures prior to ARMv4, there were no instructions to
access half-word objects stored in memory. However, when reading from
@@ -5183,97 +5826,99 @@ address is aligned to a word boundary.
This option is ignored when compiling for ARM architecture 4 or later,
since these processors have instructions to directly access half-word
-objects in memory.
-
+objects in memory.
+
@item -mno-alignment-traps
-@kindex -mno-alignment-traps
+@opindex mno-alignment-traps
Generate code that assumes that the MMU will not trap unaligned
accesses. This produces better code when the target instruction set
-does not have half-word memory operations (implementations prior to
-ARMv4).
+does not have half-word memory operations (i.e.@: implementations prior to
+ARMv4).
Note that you cannot use this option to access unaligned word objects,
since the processor will only fetch one 32-bit aligned object from
-memory.
+memory.
-The default setting for most targets is -mno-alignment-traps, since
+The default setting for most targets is @option{-mno-alignment-traps}, since
this produces better code when there are no half-word memory
-instructions available.
+instructions available.
@item -mshort-load-bytes
-@kindex -mshort-load-bytes
-This is a deprecated alias for @samp{-malignment-traps}.
+@itemx -mno-short-load-words
+@opindex mshort-load-bytes
+@opindex mno-short-load-words
+These are deprecated aliases for @option{-malignment-traps}.
@item -mno-short-load-bytes
-@kindex -mno-short-load-bytes
-This is a deprecated alias for @samp{-mno-alignment-traps}.
-
-@item -mshort-load-words
-@kindex -mshort-load-words
-This is a deprecated alias for @samp{-mno-alignment-traps}.
-
-@item -mno-short-load-words
-@kindex -mno-short-load-words
-This is a deprecated alias for @samp{-malignment-traps}.
+@itemx -mshort-load-words
+@opindex mno-short-load-bytes
+@opindex mshort-load-words
+This are deprecated aliases for @option{-mno-alignment-traps}.
@item -mbsd
-@kindex -mbsd
-This option only applies to RISC iX. Emulate the native BSD-mode
-compiler. This is the default if @samp{-ansi} is not specified.
+@opindex mbsd
+This option only applies to RISC iX@. Emulate the native BSD-mode
+compiler. This is the default if @option{-ansi} is not specified.
@item -mxopen
-@kindex -mxopen
-This option only applies to RISC iX. Emulate the native X/Open-mode
+@opindex mxopen
+This option only applies to RISC iX@. Emulate the native X/Open-mode
compiler.
@item -mno-symrename
-@kindex -mno-symrename
-This option only applies to RISC iX. Do not run the assembler
+@opindex mno-symrename
+This option only applies to RISC iX@. Do not run the assembler
post-processor, @samp{symrename}, after code has been assembled.
Normally it is necessary to modify some of the standard symbols in
preparation for linking with the RISC iX C library; this option
suppresses this pass. The post-processor is never run when the
compiler is built for cross-compilation.
-@item -mcpu=<name>
-@kindex -mcpu=
+@item -mcpu=@var{name}
+@opindex mcpu
This specifies the name of the target ARM processor. GCC uses this name
-to determine what kind of instructions it can use when generating
-assembly code. Permissible names are: arm2, arm250, arm3, arm6, arm60,
-arm600, arm610, arm620, arm7, arm7m, arm7d, arm7dm, arm7di, arm7dmi,
-arm70, arm700, arm700i, arm710, arm710c, arm7100, arm7500, arm7500fe,
-arm7tdmi, arm8, strongarm, strongarm110, strongarm1100, arm8, arm810,
-arm9, arm920, arm920t, arm9tdmi.
-
-@itemx -mtune=<name>
-@kindex -mtune=
-This option is very similar to the @samp{-mcpu=} option, except that
+to determine what kind of instructions it can emit when generating
+assembly code. Permissible names are: @samp{arm2}, @samp{arm250},
+@samp{arm3}, @samp{arm6}, @samp{arm60}, @samp{arm600}, @samp{arm610},
+@samp{arm620}, @samp{arm7}, @samp{arm7m}, @samp{arm7d}, @samp{arm7dm},
+@samp{arm7di}, @samp{arm7dmi}, @samp{arm70}, @samp{arm700},
+@samp{arm700i}, @samp{arm710}, @samp{arm710c}, @samp{arm7100},
+@samp{arm7500}, @samp{arm7500fe}, @samp{arm7tdmi}, @samp{arm8},
+@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}.
+
+@itemx -mtune=@var{name}
+@opindex mtune
+This option is very similar to the @option{-mcpu=} option, except that
instead of specifying the actual target processor type, and hence
restricting which instructions can be used, it specifies that GCC should
tune the performance of the code as if the target were of the type
specified in this option, but still choosing the instructions that it
-will generate based on the cpu specified by a @samp{-mcpu=} option.
-For some arm implementations better performance can be obtained by using
+will generate based on the cpu specified by a @option{-mcpu=} option.
+For some ARM implementations better performance can be obtained by using
this option.
-@item -march=<name>
-@kindex -march=
+@item -march=@var{name}
+@opindex march
This specifies the name of the target ARM architecture. GCC uses this
-name to determine what kind of instructions it can use when generating
+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 @samp{-mcpu=} option. Permissible names are: armv2, armv2a,
-armv3, armv3m, armv4, armv4t, armv5.
-
-@item -mfpe=<number>
-@itemx -mfp=<number>
-@kindex -mfpe=
-@kindex -mfp=
+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}.
+
+@item -mfpe=@var{number}
+@itemx -mfp=@var{number}
+@opindex mfpe
+@opindex mfp
This specifies the version of the floating point emulation available on
-the target. Permissible values are 2 and 3. @samp{-mfp=} is a synonym
-for @samp{-mfpe=} to support older versions of GCC.
+the target. Permissible values are 2 and 3. @option{-mfp=} is a synonym
+for @option{-mfpe=}, for compatibility with older versions of GCC@.
-@item -mstructure-size-boundary=<n>
-@kindex -mstructure-size-boundary
+@item -mstructure-size-boundary=@var{n}
+@opindex mstructure-size-boundary
The size of all structures and unions will be rounded up to a multiple
of the number of bits set by this option. Permissible values are 8 and
32. The default value varies for different toolchains. For the COFF
@@ -5282,22 +5927,23 @@ can produce faster, more efficient code, but can also increase the size
of the program. The two values are potentially incompatible. Code
compiled with one value cannot necessarily expect to work with code or
libraries compiled with the other value, if they exchange information
-using structures or unions. Programmers are encouraged to use the 32
-value as future versions of the toolchain may default to this value.
+using structures or unions.
@item -mabort-on-noreturn
-@kindex -mabort-on-noreturn
-@kindex -mnoabort-on-noreturn
-Generate a call to the function abort at the end of a noreturn function.
-It will be executed if the function tries to return.
+@opindex mabort-on-noreturn
+Generate a call to the function @code{abort} at the end of a
+@code{noreturn} function. It will be executed if the function tries to
+return.
@item -mlong-calls
@itemx -mno-long-calls
+@opindex mlong-calls
+@opindex mno-long-calls
Tells the compiler to perform function calls by first loading the
address of the function into a register and then performing a subroutine
call on this register. This switch is needed if the target function
will lie outside of the 64 megabyte addressing range of the offset based
-version of subroutine call instruction.
+version of subroutine call instruction.
Even if this switch is enabled, not all function calls will be turned
into long calls. The heuristic is that static functions, functions
@@ -5311,153 +5957,135 @@ the scope of a @samp{#pragma long_calls} directive, will always be
turned into long calls.
This feature is not enabled by default. Specifying
-@samp{--no-long-calls} will restore the default behaviour, as will
+@option{-mno-long-calls} will restore the default behaviour, as will
placing the function calls within the scope of a @samp{#pragma
long_calls_off} directive. Note these switches have no effect on how
the compiler generates code to handle function calls via function
-pointers.
+pointers.
@item -mnop-fun-dllimport
-@kindex -mnop-fun-dllimport
-Disable the support for the @emph{dllimport} attribute.
+@opindex mnop-fun-dllimport
+Disable support for the @code{dllimport} attribute.
@item -msingle-pic-base
-@kindex -msingle-pic-base
+@opindex msingle-pic-base
Treat the register used for PIC addressing as read-only, rather than
loading it in the prologue for each function. The run-time system is
responsible for initialising this register with an appropriate value
before execution begins.
-@item -mpic-register=<reg>
-@kindex -mpic-register=
+@item -mpic-register=@var{reg}
+@opindex mpic-register
Specify the register to be used for PIC addressing. The default is R10
unless stack-checking is enabled, when R9 is used.
-@end table
+@item -mpoke-function-name
+@opindex mpoke-function-name
+Write the name of each function into the text section, directly
+preceding the function prologue. The generated code is similar to this:
-@node Thumb Options
-@subsection Thumb Options
-@cindex Thumb Options
+@smallexample
+ t0
+ .ascii "arm_poke_function_name", 0
+ .align
+ t1
+ .word 0xff000000 + (t1 - t0)
+ arm_poke_function_name
+ mov ip, sp
+ stmfd sp!, @{fp, ip, lr, pc@}
+ sub fp, ip, #4
+@end smallexample
-@table @gcctabopt
+When performing a stack backtrace, code can inspect the value of
+@code{pc} stored at @code{fp + 0}. If the trace function then looks at
+location @code{pc - 12} and the top 8 bits are set, then we know that
+there is a function name embedded immediately preceding this location
+and has length @code{((pc[-3]) & 0xff000000)}.
-@item -mthumb-interwork
-@kindex -mthumb-interwork
-@kindex -mno-thumb-interwork
-Generate code which supports calling between the THUMB and ARM
-instruction sets. Without this option the two instruction sets cannot
-be reliably used inside one program. The default is
-@samp{-mno-thumb-interwork}, since slightly smaller code is generated
-with this option.
+@item -mthumb
+@opindex mthumb
+Generate code for the 16-bit Thumb instruction set. The default is to
+use the 32-bit ARM instruction set.
@item -mtpcs-frame
-@kindex -mtpcs-frame
-@kindex -mno-tpcs-frame
+@opindex mtpcs-frame
Generate a stack frame that is compliant with the Thumb Procedure Call
Standard for all non-leaf functions. (A leaf function is one that does
-not call any other functions). The default is @samp{-mno-apcs-frame}.
+not call any other functions.) The default is @option{-mno-tpcs-frame}.
@item -mtpcs-leaf-frame
-@kindex -mtpcs-leaf-frame
-@kindex -mno-tpcs-leaf-frame
+@opindex mtpcs-leaf-frame
Generate a stack frame that is compliant with the Thumb Procedure Call
Standard for all leaf functions. (A leaf function is one that does
-not call any other functions). The default is @samp{-mno-apcs-leaf-frame}.
-
-@item -mlittle-endian
-@kindex -mlittle-endian
-Generate code for a processor running in little-endian mode. This is
-the default for all standard configurations.
-
-@item -mbig-endian
-@kindex -mbig-endian
-Generate code for a processor running in big-endian mode.
-
-@item -mstructure-size-boundary=<n>
-@kindex -mstructure-size-boundary
-The size of all structures and unions will be rounded up to a multiple
-of the number of bits set by this option. Permissible values are 8 and
-32. The default value varies for different toolchains. For the COFF
-targeted toolchain the default value is 8. Specifying the larger number
-can produced faster, more efficient code, but can also increase the size
-of the program. The two values are potentially incompatible. Code
-compiled with one value cannot necessarily expect to work with code or
-libraries compiled with the other value, if they exchange information
-using structures or unions. Programmers are encouraged to use the 32
-value as future versions of the toolchain may default to this value.
-
-@item -mnop-fun-dllimport
-@kindex -mnop-fun-dllimport
-Disable the support for the @emph{dllimport} attribute.
+not call any other functions.) The default is @option{-mno-apcs-leaf-frame}.
@item -mcallee-super-interworking
-@kindex -mcallee-super-interworking
+@opindex mcallee-super-interworking
Gives all externally visible functions in the file being compiled an ARM
instruction set header which switches to Thumb mode before executing the
rest of the function. This allows these functions to be called from
non-interworking code.
@item -mcaller-super-interworking
-@kindex -mcaller-super-interworking
+@opindex mcaller-super-interworking
Allows calls via function pointers (including virtual functions) to
execute correctly regardless of whether the target code has been
compiled for interworking or not. There is a small overhead in the cost
of executing a function pointer if this option is enabled.
-@item -msingle-pic-base
-@kindex -msingle-pic-base
-Treat the register used for PIC addressing as read-only, rather than
-loading it in the prologue for each function. The run-time system is
-responsible for initialising this register with an appropriate value
-before execution begins.
-
-@item -mpic-register=<reg>
-@kindex -mpic-register=
-Specify the register to be used for PIC addressing. The default is R10.
-
@end table
@node MN10200 Options
@subsection MN10200 Options
@cindex MN10200 options
-These @samp{-m} options are defined for Matsushita MN10200 architectures:
+These @option{-m} options are defined for Matsushita MN10200 architectures:
@table @gcctabopt
@item -mrelax
+@opindex mrelax
Indicate to the linker that it should perform a relaxation optimization pass
to shorten branches, calls and absolute memory addresses. This option only
has an effect when used on the command line for the final link step.
-This option makes symbolic debugging impossible.
+This option makes symbolic debugging impossible.
@end table
@node MN10300 Options
@subsection MN10300 Options
@cindex MN10300 options
-These @samp{-m} options are defined for Matsushita MN10300 architectures:
+These @option{-m} options are defined for Matsushita MN10300 architectures:
@table @gcctabopt
@item -mmult-bug
+@opindex mmult-bug
Generate code to avoid bugs in the multiply instructions for the MN10300
processors. This is the default.
@item -mno-mult-bug
+@opindex mno-mult-bug
Do not generate code to avoid bugs in the multiply instructions for the
MN10300 processors.
@item -mam33
+@opindex mam33
Generate code which uses features specific to the AM33 processor.
@item -mno-am33
+@opindex mno-am33
Do not generate code which uses features specific to the AM33 processor. This
is the default.
+@item -mno-crt0
+@opindex mno-crt0
+Do not link in the C run-time initialization object file.
+
@item -mrelax
+@opindex mrelax
Indicate to the linker that it should perform a relaxation optimization pass
to shorten branches, calls and absolute memory addresses. This option only
has an effect when used on the command line for the final link step.
-This option makes symbolic debugging impossible.
+This option makes symbolic debugging impossible.
@end table
@@ -5465,10 +6093,11 @@ This option makes symbolic debugging impossible.
@subsection M32R/D Options
@cindex M32R/D options
-These @samp{-m} options are defined for Mitsubishi M32R/D architectures:
+These @option{-m} options are defined for Mitsubishi M32R/D architectures:
@table @gcctabopt
@item -mcode-model=small
+@opindex mcode-model=small
Assume all objects live in the lower 16MB of memory (so that their addresses
can be loaded with the @code{ld24} instruction), and assume all subroutines
are reachable with the @code{bl} instruction.
@@ -5478,18 +6107,21 @@ The addressability of a particular object can be set with the
@code{model} attribute.
@item -mcode-model=medium
-Assume objects may be anywhere in the 32 bit address space (the compiler
+@opindex mcode-model=medium
+Assume objects may be anywhere in the 32-bit address space (the compiler
will generate @code{seth/add3} instructions to load their addresses), and
assume all subroutines are reachable with the @code{bl} instruction.
@item -mcode-model=large
-Assume objects may be anywhere in the 32 bit address space (the compiler
+@opindex mcode-model=large
+Assume objects may be anywhere in the 32-bit address space (the compiler
will generate @code{seth/add3} instructions to load their addresses), and
assume subroutines may not be reachable with the @code{bl} instruction
(the compiler will generate the much slower @code{seth/add3/jl}
instruction sequence).
@item -msdata=none
+@opindex msdata=none
Disable use of the small data area. Variables will be put into
one of @samp{.data}, @samp{bss}, or @samp{.rodata} (unless the
@code{section} attribute has been specified).
@@ -5500,24 +6132,27 @@ Objects may be explicitly put in the small data area with the
@code{section} attribute using one of these sections.
@item -msdata=sdata
+@opindex msdata=sdata
Put small global and static data in the small data area, but do not
generate special code to reference them.
@item -msdata=use
+@opindex msdata=use
Put small global and static data in the small data area, and generate
special instructions to reference them.
@item -G @var{num}
+@opindex G
@cindex smaller data references
Put global and static objects less than or equal to @var{num} bytes
into the small data or bss sections instead of the normal data or bss
sections. The default value of @var{num} is 8.
-The @samp{-msdata} option must be set to one of @samp{sdata} or @samp{use}
+The @option{-msdata} option must be set to one of @samp{sdata} or @samp{use}
for this option to have any effect.
-All modules should be compiled with the same @samp{-G @var{num}} value.
+All modules should be compiled with the same @option{-G @var{num}} value.
Compiling with different values of @var{num} may or may not work; if it
-doesn't the linker will give an error message - incorrect code will not be
+doesn't the linker will give an error message---incorrect code will not be
generated.
@end table
@@ -5530,35 +6165,34 @@ These @samp{-m} options are defined for Motorola 88k architectures:
@table @gcctabopt
@item -m88000
-@kindex -m88000
+@opindex m88000
Generate code that works well on both the m88100 and the
m88110.
@item -m88100
-@kindex -m88100
+@opindex m88100
Generate code that works best for the m88100, but that also
runs on the m88110.
@item -m88110
-@kindex -m88110
+@opindex m88110
Generate code that works best for the m88110, and may not run
on the m88100.
@item -mbig-pic
-@kindex -mbig-pic
+@opindex mbig-pic
Obsolete option to be removed from the next revision.
-Use @samp{-fPIC}.
+Use @option{-fPIC}.
@item -midentify-revision
-@kindex -midentify-revision
-@kindex ident
+@opindex midentify-revision
@cindex identifying source, compiler (88k)
Include an @code{ident} directive in the assembler output recording the
source file name, compiler name and version, timestamp, and compilation
flags used.
@item -mno-underscores
-@kindex -mno-underscores
+@opindex mno-underscores
@cindex underscores, avoiding (88k)
In assembler output, emit symbol names without adding an underscore
character at the beginning of each name. The default is to use an
@@ -5566,29 +6200,29 @@ underscore as prefix on each name.
@item -mocs-debug-info
@itemx -mno-ocs-debug-info
-@kindex -mocs-debug-info
-@kindex -mno-ocs-debug-info
+@opindex mocs-debug-info
+@opindex mno-ocs-debug-info
@cindex OCS (88k)
@cindex debugging, 88k OCS
Include (or omit) additional debugging information (about registers used
in each stack frame) as specified in the 88open Object Compatibility
-Standard, ``OCS''. This extra information allows debugging of code that
+Standard, ``OCS''@. This extra information allows debugging of code that
has had the frame pointer eliminated. The default for DG/UX, SVr4, and
Delta 88 SVr3.2 is to include this information; other 88k configurations
omit this information by default.
@item -mocs-frame-position
-@kindex -mocs-frame-position
+@opindex mocs-frame-position
@cindex register positions in frame (88k)
When emitting COFF debugging information for automatic variables and
parameters stored on the stack, use the offset from the canonical frame
address, which is the stack pointer (register 31) on entry to the
function. The DG/UX, SVr4, Delta88 SVr3.2, and BCS configurations use
-@samp{-mocs-frame-position}; other 88k configurations have the default
-@samp{-mno-ocs-frame-position}.
+@option{-mocs-frame-position}; other 88k configurations have the default
+@option{-mno-ocs-frame-position}.
@item -mno-ocs-frame-position
-@kindex -mno-ocs-frame-position
+@opindex mno-ocs-frame-position
@cindex register positions in frame (88k)
When emitting COFF debugging information for automatic variables and
parameters stored on the stack, use the offset from the frame pointer
@@ -5598,32 +6232,32 @@ pointer is not eliminated when debugging information is selected by the
@item -moptimize-arg-area
@itemx -mno-optimize-arg-area
-@kindex -moptimize-arg-area
-@kindex -mno-optimize-arg-area
+@opindex moptimize-arg-area
+@opindex mno-optimize-arg-area
@cindex arguments in frame (88k)
Control how function arguments are stored in stack frames.
-@samp{-moptimize-arg-area} saves space by optimizing them, but this
+@option{-moptimize-arg-area} saves space by optimizing them, but this
conflicts with the 88open specifications. The opposite alternative,
-@samp{-mno-optimize-arg-area}, agrees with 88open standards. By default
+@option{-mno-optimize-arg-area}, agrees with 88open standards. By default
GCC does not optimize the argument area.
@item -mshort-data-@var{num}
-@kindex -mshort-data-@var{num}
+@opindex mshort-data
@cindex smaller data references (88k)
@cindex r0-relative references (88k)
Generate smaller data references by making them relative to @code{r0},
which allows loading a value using a single instruction (rather than the
usual two). You control which data references are affected by
specifying @var{num} with this option. For example, if you specify
-@samp{-mshort-data-512}, then the data references affected are those
+@option{-mshort-data-512}, then the data references affected are those
involving displacements of less than 512 bytes.
-@samp{-mshort-data-@var{num}} is not effective for @var{num} greater
+@option{-mshort-data-@var{num}} is not effective for @var{num} greater
than 64k.
@item -mserialize-volatile
-@kindex -mserialize-volatile
+@opindex mserialize-volatile
@itemx -mno-serialize-volatile
-@kindex -mno-serialize-volatile
+@opindex mno-serialize-volatile
@cindex sequential consistency on 88k
Do, or don't, generate code to guarantee sequential consistency
of volatile memory references. By default, consistency is
@@ -5635,73 +6269,73 @@ references. In particular, a load instruction may execute before
a preceding store instruction. Such reordering violates
sequential consistency of volatile memory references, when there
are multiple processors. When consistency must be guaranteed,
-GNU C generates special instructions, as needed, to force
+GCC generates special instructions, as needed, to force
execution in the proper order.
The MC88100 processor does not reorder memory references and so
-always provides sequential consistency. However, by default, GNU
-C generates the special instructions to guarantee consistency
-even when you use @samp{-m88100}, so that the code may be run on an
+always provides sequential consistency. However, by default, GCC
+generates the special instructions to guarantee consistency
+even when you use @option{-m88100}, so that the code may be run on an
MC88110 processor. If you intend to run your code only on the
-MC88100 processor, you may use @samp{-mno-serialize-volatile}.
+MC88100 processor, you may use @option{-mno-serialize-volatile}.
The extra code generated to guarantee consistency may affect the
performance of your application. If you know that you can safely
-forgo this guarantee, you may use @samp{-mno-serialize-volatile}.
+forgo this guarantee, you may use @option{-mno-serialize-volatile}.
@item -msvr4
@itemx -msvr3
-@kindex -msvr4
-@kindex -msvr3
+@opindex msvr4
+@opindex msvr3
@cindex assembler syntax, 88k
@cindex SVr4
-Turn on (@samp{-msvr4}) or off (@samp{-msvr3}) compiler extensions
+Turn on (@option{-msvr4}) or off (@option{-msvr3}) compiler extensions
related to System V release 4 (SVr4). This controls the following:
@enumerate
@item
Which variant of the assembler syntax to emit.
@item
-@samp{-msvr4} makes the C preprocessor recognize @samp{#pragma weak}
+@option{-msvr4} makes the C preprocessor recognize @samp{#pragma weak}
that is used on System V release 4.
@item
-@samp{-msvr4} makes GCC issue additional declaration directives used in
+@option{-msvr4} makes GCC issue additional declaration directives used in
SVr4.
@end enumerate
-@samp{-msvr4} is the default for the m88k-motorola-sysv4 and
-m88k-dg-dgux m88k configurations. @samp{-msvr3} is the default for all
+@option{-msvr4} is the default for the m88k-motorola-sysv4 and
+m88k-dg-dgux m88k configurations. @option{-msvr3} is the default for all
other m88k configurations.
@item -mversion-03.00
-@kindex -mversion-03.00
+@opindex mversion-03.00
This option is obsolete, and is ignored.
@c ??? which asm syntax better for GAS? option there too?
@item -mno-check-zero-division
@itemx -mcheck-zero-division
-@kindex -mno-check-zero-division
-@kindex -mcheck-zero-division
+@opindex mno-check-zero-division
+@opindex mcheck-zero-division
@cindex zero division on 88k
Do, or don't, generate code to guarantee that integer division by
zero will be detected. By default, detection is guaranteed.
Some models of the MC88100 processor fail to trap upon integer
division by zero under certain conditions. By default, when
-compiling code that might be run on such a processor, GNU C
+compiling code that might be run on such a processor, GCC
generates code that explicitly checks for zero-valued divisors
and traps with exception number 503 when one is detected. Use of
mno-check-zero-division suppresses such checking for code
generated to run on an MC88100 processor.
-GNU C assumes that the MC88110 processor correctly detects all
-instances of integer division by zero. When @samp{-m88110} is
-specified, both @samp{-mcheck-zero-division} and
-@samp{-mno-check-zero-division} are ignored, and no explicit checks for
+GCC assumes that the MC88110 processor correctly detects all
+instances of integer division by zero. When @option{-m88110} is
+specified, both @option{-mcheck-zero-division} and
+@option{-mno-check-zero-division} are ignored, and no explicit checks for
zero-valued divisors are generated.
@item -muse-div-instruction
-@kindex -muse-div-instruction
+@opindex muse-div-instruction
@cindex divide instruction, 88k
Use the div instruction for signed integer division on the
MC88100 processor. By default, the div instruction is not used.
@@ -5710,7 +6344,7 @@ On the MC88100 processor the signed integer division instruction
div) traps to the operating system on a negative operand. The
operating system transparently completes the operation, but at a
large cost in execution time. By default, when compiling code
-that might be run on an MC88100 processor, GNU C emulates signed
+that might be run on an MC88100 processor, GCC emulates signed
integer division using the unsigned integer division instruction
divu), thereby avoiding the large penalty of a trap to the
operating system. Such emulation has its own, smaller, execution
@@ -5721,18 +6355,18 @@ instruction directly.
On the MC88110 processor the div instruction (also known as the
divs instruction) processes negative operands without trapping to
-the operating system. When @samp{-m88110} is specified,
-@samp{-muse-div-instruction} is ignored, and the div instruction is used
+the operating system. When @option{-m88110} is specified,
+@option{-muse-div-instruction} is ignored, and the div instruction is used
for signed integer division.
-Note that the result of dividing INT_MIN by -1 is undefined. In
+Note that the result of dividing @code{INT_MIN} by @minus{}1 is undefined. In
particular, the behavior of such a division with and without
-@samp{-muse-div-instruction} may differ.
+@option{-muse-div-instruction} may differ.
@item -mtrap-large-shift
@itemx -mhandle-large-shift
-@kindex -mtrap-large-shift
-@kindex -mhandle-large-shift
+@opindex mtrap-large-shift
+@opindex mhandle-large-shift
@cindex bit shift overflow (88k)
@cindex large bit shifts (88k)
Include code to detect bit-shifts of more than 31 bits; respectively,
@@ -5740,7 +6374,7 @@ trap such shifts or emit code to handle them properly. By default GCC
makes no special provision for large bit shifts.
@item -mwarn-passed-structs
-@kindex -mwarn-passed-structs
+@opindex mwarn-passed-structs
@cindex structure passing (88k)
Warn when a function passes a struct as an argument or result.
Structure-passing conventions have changed during the evolution of the C
@@ -5767,14 +6401,20 @@ These @samp{-m} options are defined for the IBM RS/6000 and PowerPC:
@itemx -mno-powerpc-gfxopt
@itemx -mpowerpc64
@itemx -mno-powerpc64
-@kindex -mpower
-@kindex -mpower2
-@kindex -mpowerpc
-@kindex -mpowerpc-gpopt
-@kindex -mpowerpc-gfxopt
-@kindex -mpowerpc64
+@opindex mpower
+@opindex mno-power
+@opindex mpower2
+@opindex mno-power2
+@opindex mpowerpc
+@opindex mno-powerpc
+@opindex mpowerpc-gpopt
+@opindex mno-powerpc-gpopt
+@opindex mpowerpc-gfxopt
+@opindex mno-powerpc-gfxopt
+@opindex mpowerpc64
+@opindex mno-powerpc64
GCC supports two related instruction set architectures for the
-RS/6000 and PowerPC. The @dfn{POWER} instruction set are those
+RS/6000 and PowerPC@. The @dfn{POWER} instruction set are those
instructions supported by the @samp{rios} chip set used in the original
RS/6000 systems and the @dfn{PowerPC} instruction set is the
architecture of the Motorola MPC5xx, MPC6xx, MPC8xx microprocessors, and
@@ -5786,58 +6426,58 @@ register is included in processors supporting the POWER architecture.
You use these options to specify which instructions are available on the
processor you are using. The default value of these options is
-determined when configuring GCC. Specifying the
-@samp{-mcpu=@var{cpu_type}} overrides the specification of these
-options. We recommend you use the @samp{-mcpu=@var{cpu_type}} option
+determined when configuring GCC@. Specifying the
+@option{-mcpu=@var{cpu_type}} overrides the specification of these
+options. We recommend you use the @option{-mcpu=@var{cpu_type}} option
rather than the options listed above.
-The @samp{-mpower} option allows GCC to generate instructions that
+The @option{-mpower} option allows GCC to generate instructions that
are found only in the POWER architecture and to use the MQ register.
-Specifying @samp{-mpower2} implies @samp{-power} and also allows GCC
+Specifying @option{-mpower2} implies @option{-power} and also allows GCC
to generate instructions that are present in the POWER2 architecture but
not the original POWER architecture.
-The @samp{-mpowerpc} option allows GCC to generate instructions that
+The @option{-mpowerpc} option allows GCC to generate instructions that
are found only in the 32-bit subset of the PowerPC architecture.
-Specifying @samp{-mpowerpc-gpopt} implies @samp{-mpowerpc} and also allows
+Specifying @option{-mpowerpc-gpopt} implies @option{-mpowerpc} and also allows
GCC to use the optional PowerPC architecture instructions in the
General Purpose group, including floating-point square root. Specifying
-@samp{-mpowerpc-gfxopt} implies @samp{-mpowerpc} and also allows GCC to
+@option{-mpowerpc-gfxopt} implies @option{-mpowerpc} and also allows GCC to
use the optional PowerPC architecture instructions in the Graphics
group, including floating-point select.
-The @samp{-mpowerpc64} option allows GCC to generate the additional
+The @option{-mpowerpc64} option allows GCC to generate the additional
64-bit instructions that are found in the full PowerPC64 architecture
and to treat GPRs as 64-bit, doubleword quantities. GCC defaults to
-@samp{-mno-powerpc64}.
+@option{-mno-powerpc64}.
-If you specify both @samp{-mno-power} and @samp{-mno-powerpc}, GCC
+If you specify both @option{-mno-power} and @option{-mno-powerpc}, GCC
will use only the instructions in the common subset of both
architectures plus some special AIX common-mode calls, and will not use
-the MQ register. Specifying both @samp{-mpower} and @samp{-mpowerpc}
+the MQ register. Specifying both @option{-mpower} and @option{-mpowerpc}
permits GCC to use any instruction from either architecture and to
allow use of the MQ register; specify this for the Motorola MPC601.
@item -mnew-mnemonics
@itemx -mold-mnemonics
-@kindex -mnew-mnemonics
-@kindex -mold-mnemonics
+@opindex mnew-mnemonics
+@opindex mold-mnemonics
Select which mnemonics to use in the generated assembler code.
-@samp{-mnew-mnemonics} requests output that uses the assembler mnemonics
-defined for the PowerPC architecture, while @samp{-mold-mnemonics}
+@option{-mnew-mnemonics} requests output that uses the assembler mnemonics
+defined for the PowerPC architecture, while @option{-mold-mnemonics}
requests the assembler mnemonics defined for the POWER architecture.
Instructions defined in only one architecture have only one mnemonic;
GCC uses that mnemonic irrespective of which of these options is
specified.
GCC defaults to the mnemonics appropriate for the architecture in
-use. Specifying @samp{-mcpu=@var{cpu_type}} sometimes overrides the
+use. Specifying @option{-mcpu=@var{cpu_type}} sometimes overrides the
value of these option. Unless you are building a cross-compiler, you
-should normally not specify either @samp{-mnew-mnemonics} or
-@samp{-mold-mnemonics}, but should instead accept the default.
+should normally not specify either @option{-mnew-mnemonics} or
+@option{-mold-mnemonics}, but should instead accept the default.
@item -mcpu=@var{cpu_type}
-@kindex -mcpu
+@opindex mcpu
Set architecture type, register usage, choice of mnemonics, and
instruction scheduling parameters for machine type @var{cpu_type}.
Supported values for @var{cpu_type} are @samp{rios}, @samp{rios1},
@@ -5845,96 +6485,101 @@ Supported values for @var{cpu_type} are @samp{rios}, @samp{rios1},
@samp{603}, @samp{603e}, @samp{604}, @samp{604e}, @samp{620},
@samp{630}, @samp{740}, @samp{750}, @samp{power}, @samp{power2},
@samp{powerpc}, @samp{403}, @samp{505}, @samp{801}, @samp{821},
-@samp{823}, and @samp{860} and @samp{common}. @samp{-mcpu=power},
-@samp{-mcpu=power2}, @samp{-mcpu=powerpc}, and @samp{-mcpu=powerpc64}
+@samp{823}, and @samp{860} and @samp{common}. @option{-mcpu=power},
+@option{-mcpu=power2}, @option{-mcpu=powerpc}, and @option{-mcpu=powerpc64}
specify generic POWER, POWER2, pure 32-bit PowerPC (i.e., not MPC601),
and 64-bit PowerPC architecture machine types, with an appropriate,
-generic processor model assumed for scheduling purposes.@refill
-
-Specifying any of the following options:
-@samp{-mcpu=rios1}, @samp{-mcpu=rios2}, @samp{-mcpu=rsc},
-@samp{-mcpu=power}, or @samp{-mcpu=power2}
-enables the @samp{-mpower} option and disables the @samp{-mpowerpc} option;
-@samp{-mcpu=601} enables both the @samp{-mpower} and @samp{-mpowerpc} options.
-All of @samp{-mcpu=rs64a}, @samp{-mcpu=602}, @samp{-mcpu=603},
-@samp{-mcpu=603e}, @samp{-mcpu=604}, @samp{-mcpu=620}, @samp{-mcpu=630},
-@samp{-mcpu=740}, and @samp{-mcpu=750}
-enable the @samp{-mpowerpc} option and disable the @samp{-mpower} option.
-Exactly similarly, all of @samp{-mcpu=403},
-@samp{-mcpu=505}, @samp{-mcpu=821}, @samp{-mcpu=860} and @samp{-mcpu=powerpc}
-enable the @samp{-mpowerpc} option and disable the @samp{-mpower} option.
-@samp{-mcpu=common} disables both the
-@samp{-mpower} and @samp{-mpowerpc} options.@refill
-
-AIX versions 4 or greater selects @samp{-mcpu=common} by default, so
+generic processor model assumed for scheduling purposes.
+
+Specifying any of the following options:
+@option{-mcpu=rios1}, @option{-mcpu=rios2}, @option{-mcpu=rsc},
+@option{-mcpu=power}, or @option{-mcpu=power2}
+enables the @option{-mpower} option and disables the @option{-mpowerpc} option;
+@option{-mcpu=601} enables both the @option{-mpower} and @option{-mpowerpc} options.
+All of @option{-mcpu=rs64a}, @option{-mcpu=602}, @option{-mcpu=603},
+@option{-mcpu=603e}, @option{-mcpu=604}, @option{-mcpu=620}, @option{-mcpu=630},
+@option{-mcpu=740}, and @option{-mcpu=750}
+enable the @option{-mpowerpc} option and disable the @option{-mpower} option.
+Exactly similarly, all of @option{-mcpu=403},
+@option{-mcpu=505}, @option{-mcpu=821}, @option{-mcpu=860} and @option{-mcpu=powerpc}
+enable the @option{-mpowerpc} option and disable the @option{-mpower} option.
+@option{-mcpu=common} disables both the
+@option{-mpower} and @option{-mpowerpc} options.
+
+AIX versions 4 or greater selects @option{-mcpu=common} by default, so
that code will operate on all members of the RS/6000 POWER and PowerPC
families. In that case, GCC will use only the instructions in the
common subset of both architectures plus some special AIX common-mode
calls, and will not use the MQ register. GCC assumes a generic
processor model for scheduling purposes.
-Specifying any of the options @samp{-mcpu=rios1}, @samp{-mcpu=rios2},
-@samp{-mcpu=rsc}, @samp{-mcpu=power}, or @samp{-mcpu=power2} also
-disables the @samp{new-mnemonics} option. Specifying @samp{-mcpu=601},
-@samp{-mcpu=602}, @samp{-mcpu=603}, @samp{-mcpu=603e}, @samp{-mcpu=604},
-@samp{-mcpu=620}, @samp{-mcpu=630}, @samp{-mcpu=403}, @samp{-mcpu=505},
-@samp{-mcpu=821}, @samp{-mcpu=860} or @samp{-mcpu=powerpc} also enables
-the @samp{new-mnemonics} option.@refill
+Specifying any of the options @option{-mcpu=rios1}, @option{-mcpu=rios2},
+@option{-mcpu=rsc}, @option{-mcpu=power}, or @option{-mcpu=power2} also
+disables the @samp{new-mnemonics} option. Specifying @option{-mcpu=601},
+@option{-mcpu=602}, @option{-mcpu=603}, @option{-mcpu=603e}, @option{-mcpu=604},
+@option{-mcpu=620}, @option{-mcpu=630}, @option{-mcpu=403}, @option{-mcpu=505},
+@option{-mcpu=821}, @option{-mcpu=860} or @option{-mcpu=powerpc} also enables
+the @samp{new-mnemonics} option.
-Specifying @samp{-mcpu=403}, @samp{-mcpu=821}, or @samp{-mcpu=860} also
-enables the @samp{-msoft-float} option.
+Specifying @option{-mcpu=403}, @option{-mcpu=821}, or @option{-mcpu=860} also
+enables the @option{-msoft-float} option.
@item -mtune=@var{cpu_type}
+@opindex mtune
Set the instruction scheduling parameters for machine type
@var{cpu_type}, but do not set the architecture type, register usage,
-choice of mnemonics like @samp{-mcpu=}@var{cpu_type} would. The same
-values for @var{cpu_type} are used for @samp{-mtune=}@var{cpu_type} as
-for @samp{-mcpu=}@var{cpu_type}. The @samp{-mtune=}@var{cpu_type}
-option overrides the @samp{-mcpu=}@var{cpu_type} option in terms of
+choice of mnemonics like @option{-mcpu=@var{cpu_type}} would. The same
+values for @var{cpu_type} are used for @option{-mtune=@var{cpu_type}} as
+for @option{-mcpu=@var{cpu_type}}. The @option{-mtune=@var{cpu_type}}
+option overrides the @option{-mcpu=@var{cpu_type}} option in terms of
instruction scheduling parameters.
@item -mfull-toc
@itemx -mno-fp-in-toc
@itemx -mno-sum-in-toc
@itemx -mminimal-toc
-@kindex -mminimal-toc
+@opindex mfull-toc
+@opindex mno-fp-in-toc
+@opindex mno-sum-in-toc
+@opindex mminimal-toc
Modify generation of the TOC (Table Of Contents), which is created for
-every executable file. The @samp{-mfull-toc} option is selected by
+every executable file. The @option{-mfull-toc} option is selected by
default. In that case, GCC will allocate at least one TOC entry for
each unique non-automatic variable reference in your program. GCC
-will also place floating-point constants in the TOC. However, only
-16,384 entries are available in the TOC.
+will also place floating-point constants in the TOC@. However, only
+16,384 entries are available in the TOC@.
If you receive a linker error message that saying you have overflowed
the available TOC space, you can reduce the amount of TOC space used
-with the @samp{-mno-fp-in-toc} and @samp{-mno-sum-in-toc} options.
-@samp{-mno-fp-in-toc} prevents GCC from putting floating-point
-constants in the TOC and @samp{-mno-sum-in-toc} forces GCC to
+with the @option{-mno-fp-in-toc} and @option{-mno-sum-in-toc} options.
+@option{-mno-fp-in-toc} prevents GCC from putting floating-point
+constants in the TOC and @option{-mno-sum-in-toc} forces GCC to
generate code to calculate the sum of an address and a constant at
-run-time instead of putting that sum into the TOC. You may specify one
+run-time instead of putting that sum into the TOC@. You may specify one
or both of these options. Each causes GCC to produce very slightly
slower and larger code at the expense of conserving TOC space.
If you still run out of space in the TOC even when you specify both of
-these options, specify @samp{-mminimal-toc} instead. This option causes
+these options, specify @option{-mminimal-toc} instead. This option causes
GCC to make only one TOC entry for every file. When you specify this
option, GCC will produce code that is slower and larger but which
uses extremely little TOC space. You may wish to use this option
-only on files that contain less frequently executed code. @refill
+only on files that contain less frequently executed code.
@item -maix64
@itemx -maix32
-@kindex -maix64
-@kindex -maix32
+@opindex maix64
+@opindex maix32
Enable 64-bit AIX ABI and calling convention: 64-bit pointers, 64-bit
@code{long} type, and the infrastructure needed to support them.
-Specifying @samp{-maix64} implies @samp{-mpowerpc64} and
-@samp{-mpowerpc}, while @samp{-maix32} disables the 64-bit ABI and
-implies @samp{-mno-powerpc64}. GCC defaults to @samp{-maix32}.
+Specifying @option{-maix64} implies @option{-mpowerpc64} and
+@option{-mpowerpc}, while @option{-maix32} disables the 64-bit ABI and
+implies @option{-mno-powerpc64}. GCC defaults to @option{-maix32}.
@item -mxl-call
@itemx -mno-xl-call
-@kindex -mxl-call
+@opindex mxl-call
+@opindex mno-xl-call
On AIX, pass floating-point arguments to prototyped functions beyond the
register save area (RSA) on the stack in addition to argument FPRs. The
AIX calling convention was extended but not initially documented to
@@ -5948,251 +6593,299 @@ default and only is necessary when calling subroutines compiled by AIX
XL compilers without optimization.
@item -mthreads
-@kindex -mthreads
+@opindex mthreads
Support @dfn{AIX Threads}. Link an application written to use
@dfn{pthreads} with special libraries and startup code to enable the
application to run.
@item -mpe
-@kindex -mpe
-Support @dfn{IBM RS/6000 SP} @dfn{Parallel Environment} (PE). Link an
+@opindex mpe
+Support @dfn{IBM RS/6000 SP} @dfn{Parallel Environment} (PE)@. Link an
application written to use message passing with special startup code to
enable the application to run. The system must have PE installed in the
standard location (@file{/usr/lpp/ppe.poe/}), or the @file{specs} file
-must be overridden with the @samp{-specs=} option to specify the
+must be overridden with the @option{-specs=} option to specify the
appropriate directory location. The Parallel Environment does not
-support threads, so the @samp{-mpe} option and the @samp{-mthreads}
+support threads, so the @option{-mpe} option and the @option{-mthreads}
option are incompatible.
@item -msoft-float
@itemx -mhard-float
-@kindex -msoft-float
+@opindex msoft-float
+@opindex mhard-float
Generate code that does not use (uses) the floating-point register set.
Software floating point emulation is provided if you use the
-@samp{-msoft-float} option, and pass the option to GCC when linking.
+@option{-msoft-float} option, and pass the option to GCC when linking.
@item -mmultiple
@itemx -mno-multiple
+@opindex mmultiple
+@opindex mno-multiple
Generate code that uses (does not use) the load multiple word
instructions and the store multiple word instructions. These
instructions are generated by default on POWER systems, and not
-generated on PowerPC systems. Do not use @samp{-mmultiple} on little
+generated on PowerPC systems. Do not use @option{-mmultiple} on little
endian PowerPC systems, since those instructions do not work when the
processor is in little endian mode. The exceptions are PPC740 and
PPC750 which permit the instructions usage in little endian mode.
@item -mstring
@itemx -mno-string
-@kindex -mstring
+@opindex mstring
+@opindex mno-string
Generate code that uses (does not use) the load string instructions
and the store string word instructions to save multiple registers and
do small block moves. These instructions are generated by default on
POWER systems, and not generated on PowerPC systems. Do not use
-@samp{-mstring} on little endian PowerPC systems, since those
+@option{-mstring} on little endian PowerPC systems, since those
instructions do not work when the processor is in little endian mode.
The exceptions are PPC740 and PPC750 which permit the instructions
usage in little endian mode.
@item -mupdate
@itemx -mno-update
-@kindex -mupdate
+@opindex mupdate
+@opindex mno-update
Generate code that uses (does not use) the load or store instructions
that update the base register to the address of the calculated memory
location. These instructions are generated by default. If you use
-@samp{-mno-update}, there is a small window between the time that the
+@option{-mno-update}, there is a small window between the time that the
stack pointer is updated and the address of the previous frame is
stored, which means code that walks the stack frame across interrupts or
signals may get corrupted data.
@item -mfused-madd
@itemx -mno-fused-madd
-@kindex -mfused-madd
+@opindex mfused-madd
+@opindex mno-fused-madd
Generate code that uses (does not use) the floating point multiply and
accumulate instructions. These instructions are generated by default if
hardware floating is used.
@item -mno-bit-align
@itemx -mbit-align
-@kindex -mbit-align
+@opindex mno-bit-align
+@opindex mbit-align
On System V.4 and embedded PowerPC systems do not (do) force structures
-and unions that contain bit fields to be aligned to the base type of the
-bit field.
+and unions that contain bit-fields to be aligned to the base type of the
+bit-field.
For example, by default a structure containing nothing but 8
-@code{unsigned} bitfields of length 1 would be aligned to a 4 byte
-boundary and have a size of 4 bytes. By using @samp{-mno-bit-align},
+@code{unsigned} bit-fields of length 1 would be aligned to a 4 byte
+boundary and have a size of 4 bytes. By using @option{-mno-bit-align},
the structure would be aligned to a 1 byte boundary and be one byte in
size.
@item -mno-strict-align
@itemx -mstrict-align
-@kindex -mstrict-align
+@opindex mno-strict-align
+@opindex mstrict-align
On System V.4 and embedded PowerPC systems do not (do) assume that
unaligned memory references will be handled by the system.
@item -mrelocatable
@itemx -mno-relocatable
-@kindex -mrelocatable
+@opindex mrelocatable
+@opindex mno-relocatable
On embedded PowerPC systems generate code that allows (does not allow)
the program to be relocated to a different address at runtime. If you
-use @samp{-mrelocatable} on any module, all objects linked together must
-be compiled with @samp{-mrelocatable} or @samp{-mrelocatable-lib}.
+use @option{-mrelocatable} on any module, all objects linked together must
+be compiled with @option{-mrelocatable} or @option{-mrelocatable-lib}.
@item -mrelocatable-lib
@itemx -mno-relocatable-lib
+@opindex mrelocatable-lib
+@opindex mno-relocatable-lib
On embedded PowerPC systems generate code that allows (does not allow)
the program to be relocated to a different address at runtime. Modules
-compiled with @samp{-mrelocatable-lib} can be linked with either modules
-compiled without @samp{-mrelocatable} and @samp{-mrelocatable-lib} or
-with modules compiled with the @samp{-mrelocatable} options.
+compiled with @option{-mrelocatable-lib} can be linked with either modules
+compiled without @option{-mrelocatable} and @option{-mrelocatable-lib} or
+with modules compiled with the @option{-mrelocatable} options.
@item -mno-toc
@itemx -mtoc
+@opindex mno-toc
+@opindex mtoc
On System V.4 and embedded PowerPC systems do not (do) assume that
register 2 contains a pointer to a global area pointing to the addresses
used in the program.
@item -mlittle
@itemx -mlittle-endian
+@opindex mlittle
+@opindex mlittle-endian
On System V.4 and embedded PowerPC systems compile code for the
-processor in little endian mode. The @samp{-mlittle-endian} option is
-the same as @samp{-mlittle}.
+processor in little endian mode. The @option{-mlittle-endian} option is
+the same as @option{-mlittle}.
@item -mbig
@itemx -mbig-endian
+@opindex mbig
+@opindex mbig-endian
On System V.4 and embedded PowerPC systems compile code for the
-processor in big endian mode. The @samp{-mbig-endian} option is
-the same as @samp{-mbig}.
+processor in big endian mode. The @option{-mbig-endian} option is
+the same as @option{-mbig}.
@item -mcall-sysv
+@opindex mcall-sysv
On System V.4 and embedded PowerPC systems compile code using calling
conventions that adheres to the March 1995 draft of the System V
Application Binary Interface, PowerPC processor supplement. This is the
default unless you configured GCC using @samp{powerpc-*-eabiaix}.
@item -mcall-sysv-eabi
-Specify both @samp{-mcall-sysv} and @samp{-meabi} options.
+@opindex mcall-sysv-eabi
+Specify both @option{-mcall-sysv} and @option{-meabi} options.
@item -mcall-sysv-noeabi
-Specify both @samp{-mcall-sysv} and @samp{-mno-eabi} options.
+@opindex mcall-sysv-noeabi
+Specify both @option{-mcall-sysv} and @option{-mno-eabi} options.
@item -mcall-aix
+@opindex mcall-aix
On System V.4 and embedded PowerPC systems compile code using calling
-conventions that are similar to those used on AIX. This is the
+conventions that are similar to those used on AIX@. This is the
default if you configured GCC using @samp{powerpc-*-eabiaix}.
@item -mcall-solaris
+@opindex mcall-solaris
On System V.4 and embedded PowerPC systems compile code for the Solaris
operating system.
@item -mcall-linux
+@opindex mcall-linux
On System V.4 and embedded PowerPC systems compile code for the
Linux-based GNU system.
+@item -mcall-netbsd
+@opindex mcall-netbsd
+On System V.4 and embedded PowerPC systems compile code for the
+NetBSD operating system.
+
@item -mprototype
@itemx -mno-prototype
+@opindex mprototype
+@opindex mno-prototype
On System V.4 and embedded PowerPC systems assume that all calls to
variable argument functions are properly prototyped. Otherwise, the
compiler must insert an instruction before every non prototyped call to
set or clear bit 6 of the condition code register (@var{CR}) to
indicate whether floating point values were passed in the floating point
registers in case the function takes a variable arguments. With
-@samp{-mprototype}, only calls to prototyped variable argument functions
+@option{-mprototype}, only calls to prototyped variable argument functions
will set or clear the bit.
@item -msim
+@opindex msim
On embedded PowerPC systems, assume that the startup module is called
@file{sim-crt0.o} and that the standard C libraries are @file{libsim.a} and
@file{libc.a}. This is the default for @samp{powerpc-*-eabisim}.
configurations.
@item -mmvme
+@opindex mmvme
On embedded PowerPC systems, assume that the startup module is called
@file{crt0.o} and the standard C libraries are @file{libmvme.a} and
@file{libc.a}.
@item -mads
+@opindex mads
On embedded PowerPC systems, assume that the startup module is called
@file{crt0.o} and the standard C libraries are @file{libads.a} and
@file{libc.a}.
@item -myellowknife
+@opindex myellowknife
On embedded PowerPC systems, assume that the startup module is called
@file{crt0.o} and the standard C libraries are @file{libyk.a} and
@file{libc.a}.
@item -mvxworks
+@opindex mvxworks
On System V.4 and embedded PowerPC systems, specify that you are
compiling for a VxWorks system.
@item -memb
+@opindex memb
On embedded PowerPC systems, set the @var{PPC_EMB} bit in the ELF flags
header to indicate that @samp{eabi} extended relocations are used.
@item -meabi
@itemx -mno-eabi
+@opindex meabi
+@opindex mno-eabi
On System V.4 and embedded PowerPC systems do (do not) adhere to the
Embedded Applications Binary Interface (eabi) which is a set of
modifications to the System V.4 specifications. Selecting @option{-meabi}
means that the stack is aligned to an 8 byte boundary, a function
@code{__eabi} is called to from @code{main} to set up the eabi
-environment, and the @samp{-msdata} option can use both @code{r2} and
+environment, and the @option{-msdata} option can use both @code{r2} and
@code{r13} to point to two separate small data areas. Selecting
@option{-mno-eabi} means that the stack is aligned to a 16 byte boundary,
do not call an initialization function from @code{main}, and the
-@samp{-msdata} option will only use @code{r13} to point to a single
-small data area. The @samp{-meabi} option is on by default if you
+@option{-msdata} option will only use @code{r13} to point to a single
+small data area. The @option{-meabi} option is on by default if you
configured GCC using one of the @samp{powerpc*-*-eabi*} options.
@item -msdata=eabi
+@opindex msdata=eabi
On System V.4 and embedded PowerPC systems, put small initialized
@code{const} global and static data in the @samp{.sdata2} section, which
is pointed to by register @code{r2}. Put small initialized
non-@code{const} global and static data in the @samp{.sdata} section,
which is pointed to by register @code{r13}. Put small uninitialized
global and static data in the @samp{.sbss} section, which is adjacent to
-the @samp{.sdata} section. The @samp{-msdata=eabi} option is
-incompatible with the @samp{-mrelocatable} option. The
-@samp{-msdata=eabi} option also sets the @samp{-memb} option.
+the @samp{.sdata} section. The @option{-msdata=eabi} option is
+incompatible with the @option{-mrelocatable} option. The
+@option{-msdata=eabi} option also sets the @option{-memb} option.
@item -msdata=sysv
+@opindex msdata=sysv
On System V.4 and embedded PowerPC systems, put small global and static
data in the @samp{.sdata} section, which is pointed to by register
@code{r13}. Put small uninitialized global and static data in the
@samp{.sbss} section, which is adjacent to the @samp{.sdata} section.
-The @samp{-msdata=sysv} option is incompatible with the
-@samp{-mrelocatable} option.
+The @option{-msdata=sysv} option is incompatible with the
+@option{-mrelocatable} option.
@item -msdata=default
@itemx -msdata
-On System V.4 and embedded PowerPC systems, if @samp{-meabi} is used,
-compile code the same as @samp{-msdata=eabi}, otherwise compile code the
-same as @samp{-msdata=sysv}.
+@opindex msdata=default
+@opindex msdata
+On System V.4 and embedded PowerPC systems, if @option{-meabi} is used,
+compile code the same as @option{-msdata=eabi}, otherwise compile code the
+same as @option{-msdata=sysv}.
@item -msdata-data
+@opindex msdata-data
On System V.4 and embedded PowerPC systems, put small global and static
data in the @samp{.sdata} section. Put small uninitialized global and
static data in the @samp{.sbss} section. Do not use register @code{r13}
to address small data however. This is the default behavior unless
-other @samp{-msdata} options are used.
+other @option{-msdata} options are used.
@item -msdata=none
@itemx -mno-sdata
+@opindex msdata=none
+@opindex mno-sdata
On embedded PowerPC systems, put all initialized global and static data
in the @samp{.data} section, and all uninitialized data in the
@samp{.bss} section.
@item -G @var{num}
+@opindex G
@cindex smaller data references (PowerPC)
@cindex .sdata/.sdata2 references (PowerPC)
On embedded PowerPC systems, put global and static items less than or
equal to @var{num} bytes into the small data or bss sections instead of
the normal data or bss section. By default, @var{num} is 8. The
-@samp{-G @var{num}} switch is also passed to the linker.
-All modules should be compiled with the same @samp{-G @var{num}} value.
+@option{-G @var{num}} switch is also passed to the linker.
+All modules should be compiled with the same @option{-G @var{num}} value.
@item -mregnames
@itemx -mno-regnames
+@opindex mregnames
+@opindex mno-regnames
On System V.4 and embedded PowerPC systems do (do not) emit register
names in the assembly language output using symbolic forms.
@@ -6207,17 +6900,21 @@ These @samp{-m} options are defined for the IBM RT PC:
@table @gcctabopt
@item -min-line-mul
+@opindex min-line-mul
Use an in-line code sequence for integer multiplies. This is the
default.
@item -mcall-lib-mul
+@opindex mcall-lib-mul
Call @code{lmul$$} for integer multiples.
@item -mfull-fp-blocks
+@opindex mfull-fp-blocks
Generate full-size floating point data blocks, including the minimum
-amount of scratch space recommended by IBM. This is the default.
+amount of scratch space recommended by IBM@. This is the default.
@item -mminimum-fp-blocks
+@opindex mminimum-fp-blocks
Do not include extra scratch space in floating point data blocks. This
results in smaller code, but slower execution, since scratch space must
be allocated dynamically.
@@ -6225,26 +6922,30 @@ be allocated dynamically.
@cindex @file{varargs.h} and RT PC
@cindex @file{stdarg.h} and RT PC
@item -mfp-arg-in-fpregs
+@opindex mfp-arg-in-fpregs
Use a calling sequence incompatible with the IBM calling convention in
which floating point arguments are passed in floating point registers.
-Note that @code{varargs.h} and @code{stdargs.h} will not work with
+Note that @code{varargs.h} and @code{stdarg.h} will not work with
floating point operands if this option is specified.
@item -mfp-arg-in-gregs
+@opindex mfp-arg-in-gregs
Use the normal calling convention for floating point arguments. This is
the default.
@item -mhc-struct-return
+@opindex mhc-struct-return
Return structures of more than one word in memory, rather than in a
register. This provides compatibility with the MetaWare HighC (hc)
-compiler. Use the option @samp{-fpcc-struct-return} for compatibility
+compiler. Use the option @option{-fpcc-struct-return} for compatibility
with the Portable C Compiler (pcc).
@item -mnohc-struct-return
+@opindex mnohc-struct-return
Return some structures of more than one word in registers, when
convenient. This is the default. For compatibility with the
-IBM-supplied compilers, use the option @samp{-fpcc-struct-return} or the
-option @samp{-mhc-struct-return}.
+IBM-supplied compilers, use the option @option{-fpcc-struct-return} or the
+option @option{-mhc-struct-return}.
@end table
@node MIPS Options
@@ -6254,116 +6955,141 @@ option @samp{-mhc-struct-return}.
These @samp{-m} options are defined for the MIPS family of computers:
@table @gcctabopt
-@item -mcpu=@var{cpu type}
-Assume the defaults for the machine type @var{cpu type} when scheduling
-instructions. The choices for @var{cpu type} are @samp{r2000}, @samp{r3000},
+@item -mcpu=@var{cpu-type}
+@opindex mcpu
+Assume the defaults for the machine type @var{cpu-type} when scheduling
+instructions. The choices for @var{cpu-type} are @samp{r2000}, @samp{r3000},
@samp{r3900}, @samp{r4000}, @samp{r4100}, @samp{r4300}, @samp{r4400},
@samp{r4600}, @samp{r4650}, @samp{r5000}, @samp{r6000}, @samp{r8000},
and @samp{orion}. Additionally, the @samp{r2000}, @samp{r3000},
@samp{r4000}, @samp{r5000}, and @samp{r6000} can be abbreviated as
@samp{r2k} (or @samp{r2K}), @samp{r3k}, etc. While picking a specific
-@var{cpu type} will schedule things appropriately for that particular
+@var{cpu-type} will schedule things appropriately for that particular
chip, the compiler will not generate any code that does not meet level 1
-of the MIPS ISA (instruction set architecture) without a @samp{-mipsX}
-or @samp{-mabi} switch being used.
+of the MIPS ISA (instruction set architecture) without a @option{-mipsX}
+or @option{-mabi} switch being used.
@item -mips1
-Issue instructions from level 1 of the MIPS ISA. This is the default.
-@samp{r3000} is the default @var{cpu type} at this ISA level.
+@opindex mips1
+Issue instructions from level 1 of the MIPS ISA@. This is the default.
+@samp{r3000} is the default @var{cpu-type} at this ISA level.
@item -mips2
+@opindex mips2
Issue instructions from level 2 of the MIPS ISA (branch likely, square
-root instructions). @samp{r6000} is the default @var{cpu type} at this
+root instructions). @samp{r6000} is the default @var{cpu-type} at this
ISA level.
@item -mips3
-Issue instructions from level 3 of the MIPS ISA (64 bit instructions).
-@samp{r4000} is the default @var{cpu type} at this ISA level.
+@opindex mips3
+Issue instructions from level 3 of the MIPS ISA (64-bit instructions).
+@samp{r4000} is the default @var{cpu-type} at this ISA level.
@item -mips4
+@opindex mips4
Issue instructions from level 4 of the MIPS ISA (conditional move,
prefetch, enhanced FPU instructions). @samp{r8000} is the default
-@var{cpu type} at this ISA level.
+@var{cpu-type} at this ISA level.
@item -mfp32
+@opindex mfp32
Assume that 32 32-bit floating point registers are available. This is
the default.
@item -mfp64
+@opindex mfp64
Assume that 32 64-bit floating point registers are available. This is
-the default when the @samp{-mips3} option is used.
+the default when the @option{-mips3} option is used.
@item -mgp32
+@opindex mgp32
Assume that 32 32-bit general purpose registers are available. This is
the default.
@item -mgp64
+@opindex mgp64
Assume that 32 64-bit general purpose registers are available. This is
-the default when the @samp{-mips3} option is used.
+the default when the @option{-mips3} option is used.
@item -mint64
-Force int and long types to be 64 bits wide. See @samp{-mlong32} for an
+@opindex mint64
+Force int and long types to be 64 bits wide. See @option{-mlong32} for an
explanation of the default, and the width of pointers.
@item -mlong64
-Force long types to be 64 bits wide. See @samp{-mlong32} for an
+@opindex mlong64
+Force long types to be 64 bits wide. See @option{-mlong32} for an
explanation of the default, and the width of pointers.
@item -mlong32
+@opindex mlong32
Force long, int, and pointer types to be 32 bits wide.
-If none of @samp{-mlong32}, @samp{-mlong64}, or @samp{-mint64} are set,
+If none of @option{-mlong32}, @option{-mlong64}, or @option{-mint64} are set,
the size of ints, longs, and pointers depends on the ABI and ISA chosen.
-For @samp{-mabi=32}, and @samp{-mabi=n32}, ints and longs are 32 bits
-wide. For @samp{-mabi=64}, ints are 32 bits, and longs are 64 bits wide.
-For @samp{-mabi=eabi} and either @samp{-mips1} or @samp{-mips2}, ints
-and longs are 32 bits wide. For @samp{-mabi=eabi} and higher ISAs, ints
+For @option{-mabi=32}, and @option{-mabi=n32}, ints and longs are 32 bits
+wide. For @option{-mabi=64}, ints are 32 bits, and longs are 64 bits wide.
+For @option{-mabi=eabi} and either @option{-mips1} or @option{-mips2}, ints
+and longs are 32 bits wide. For @option{-mabi=eabi} and higher ISAs, ints
are 32 bits, and longs are 64 bits wide. The width of pointer types is
the smaller of the width of longs or the width of general purpose
-registers (which in turn depends on the ISA).
+registers (which in turn depends on the ISA)@.
@item -mabi=32
@itemx -mabi=o64
@itemx -mabi=n32
@itemx -mabi=64
@itemx -mabi=eabi
-Generate code for the indicated ABI. The default instruction level is
-@samp{-mips1} for @samp{32}, @samp{-mips3} for @samp{n32}, and
-@samp{-mips4} otherwise. Conversely, with @samp{-mips1} or
-@samp{-mips2}, the default ABI is @samp{32}; otherwise, the default ABI
+@opindex mabi=32
+@opindex mabi=o64
+@opindex mabi=n32
+@opindex mabi=64
+@opindex mabi=eabi
+Generate code for the indicated ABI@. The default instruction level is
+@option{-mips1} for @samp{32}, @option{-mips3} for @samp{n32}, and
+@option{-mips4} otherwise. Conversely, with @option{-mips1} or
+@option{-mips2}, the default ABI is @samp{32}; otherwise, the default ABI
is @samp{64}.
@item -mmips-as
+@opindex mmips-as
Generate code for the MIPS assembler, and invoke @file{mips-tfile} to
add normal debug information. This is the default for all
platforms except for the OSF/1 reference platform, using the OSF/rose
-object format. If the either of the @samp{-gstabs} or @samp{-gstabs+}
+object format. If the either of the @option{-gstabs} or @option{-gstabs+}
switches are used, the @file{mips-tfile} program will encapsulate the
-stabs within MIPS ECOFF.
+stabs within MIPS ECOFF@.
@item -mgas
+@opindex mgas
Generate code for the GNU assembler. This is the default on the OSF/1
reference platform, using the OSF/rose object format. Also, this is
-the default if the configure option @samp{--with-gnu-as} is used.
+the default if the configure option @option{--with-gnu-as} is used.
@item -msplit-addresses
@itemx -mno-split-addresses
+@opindex msplit-addresses
+@opindex mno-split-addresses
Generate code to load the high and low parts of address constants separately.
-This allows @code{gcc} to optimize away redundant loads of the high order
+This allows GCC to optimize away redundant loads of the high order
bits of addresses. This optimization requires GNU as and GNU ld.
This optimization is enabled by default for some embedded targets where
GNU as and GNU ld are standard.
@item -mrnames
@itemx -mno-rnames
-The @samp{-mrnames} switch says to output code using the MIPS software
+@opindex mrnames
+@opindex mno-rnames
+The @option{-mrnames} switch says to output code using the MIPS software
names for the registers, instead of the hardware names (ie, @var{a0}
instead of @var{$4}). The only known assembler that supports this option
is the Algorithmics assembler.
@item -mgpopt
@itemx -mno-gpopt
-The @samp{-mgpopt} switch says to write all of the data declarations
+@opindex mgpopt
+@opindex mno-gpopt
+The @option{-mgpopt} switch says to write all of the data declarations
before the instructions in the text section, this allows the MIPS
assembler to generate one word memory references instead of using two
words for short global or static data items. This is on by default if
@@ -6371,50 +7097,62 @@ optimization is selected.
@item -mstats
@itemx -mno-stats
-For each non-inline function processed, the @samp{-mstats} switch
+@opindex mstats
+@opindex mno-stats
+For each non-inline function processed, the @option{-mstats} switch
causes the compiler to emit one line to the standard error file to
print statistics about the program (number of registers saved, stack
size, etc.).
@item -mmemcpy
@itemx -mno-memcpy
-The @samp{-mmemcpy} switch makes all block moves call the appropriate
+@opindex mmemcpy
+@opindex mno-memcpy
+The @option{-mmemcpy} switch makes all block moves call the appropriate
string function (@samp{memcpy} or @samp{bcopy}) instead of possibly
generating inline code.
@item -mmips-tfile
@itemx -mno-mips-tfile
-The @samp{-mno-mips-tfile} switch causes the compiler not
+@opindex mmips-tfile
+@opindex mno-mips-tfile
+The @option{-mno-mips-tfile} switch causes the compiler not
postprocess the object file with the @file{mips-tfile} program,
after the MIPS assembler has generated it to add debug support. If
@file{mips-tfile} is not run, then no local variables will be
available to the debugger. In addition, @file{stage2} and
@file{stage3} objects will have the temporary file names passed to the
assembler embedded in the object file, which means the objects will
-not compare the same. The @samp{-mno-mips-tfile} switch should only
+not compare the same. The @option{-mno-mips-tfile} switch should only
be used when there are bugs in the @file{mips-tfile} program that
prevents compilation.
@item -msoft-float
+@opindex msoft-float
Generate output containing library calls for floating point.
-@strong{Warning:} the requisite libraries are not part of GCC.
+@strong{Warning:} the requisite libraries are not part of GCC@.
Normally the facilities of the machine's usual C compiler are used, but
this can't be done directly in cross-compilation. You must make your
own arrangements to provide suitable library functions for
cross-compilation.
@item -mhard-float
+@opindex mhard-float
Generate output containing floating point instructions. This is the
default if you use the unmodified sources.
@item -mabicalls
@itemx -mno-abicalls
+@opindex mabicalls
+@opindex mno-abicalls
Emit (or do not emit) the pseudo operations @samp{.abicalls},
@samp{.cpload}, and @samp{.cprestore} that some System V.4 ports use for
position independent code.
@item -mlong-calls
@itemx -mno-long-calls
+@opindex mlong-calls
+@opindex mno-long-calls
Do all calls with the @samp{JALR} instruction, which requires
loading up a function's address into a register before the call.
You need to use this switch, if you call outside of the current
@@ -6422,19 +7160,25 @@ You need to use this switch, if you call outside of the current
@item -mhalf-pic
@itemx -mno-half-pic
+@opindex mhalf-pic
+@opindex mno-half-pic
Put pointers to extern references into the data section and load them
up, rather than put the references in the text section.
@item -membedded-pic
@itemx -mno-embedded-pic
+@opindex membedded-pic
+@opindex mno-embedded-pic
Generate PIC code suitable for some embedded systems. All calls are
made using PC relative address, and all data is addressed using the $gp
register. No more than 65536 bytes of global data may be used. This
requires GNU as and GNU ld which do most of the work. This currently
-only works on targets which use ECOFF; it does not work with ELF.
+only works on targets which use ECOFF; it does not work with ELF@.
@item -membedded-data
@itemx -mno-embedded-data
+@opindex membedded-data
+@opindex mno-embedded-data
Allocate variables to the read-only data section first if possible, then
next in the small data section if possible, otherwise in data. This gives
slightly slower code than the default, but reduces the amount of RAM required
@@ -6442,42 +7186,55 @@ when executing, and thus may be preferred for some embedded systems.
@item -muninit-const-in-rodata
@itemx -mno-uninit-const-in-rodata
-When used together with -membedded-data, it will always store uninitialized
+@opindex muninit-const-in-rodata
+@opindex mno-uninit-const-in-rodata
+When used together with @option{-membedded-data}, it will always store uninitialized
const variables in the read-only data section.
-
+
@item -msingle-float
@itemx -mdouble-float
-The @samp{-msingle-float} switch tells gcc to assume that the floating
+@opindex msingle-float
+@opindex mdouble-float
+The @option{-msingle-float} switch tells gcc to assume that the floating
point coprocessor only supports single precision operations, as on the
-@samp{r4650} chip. The @samp{-mdouble-float} switch permits gcc to use
+@samp{r4650} chip. The @option{-mdouble-float} switch permits gcc to use
double precision operations. This is the default.
@item -mmad
@itemx -mno-mad
+@opindex mmad
+@opindex mno-mad
Permit use of the @samp{mad}, @samp{madu} and @samp{mul} instructions,
as on the @samp{r4650} chip.
@item -m4650
-Turns on @samp{-msingle-float}, @samp{-mmad}, and, at least for now,
-@samp{-mcpu=r4650}.
+@opindex m4650
+Turns on @option{-msingle-float}, @option{-mmad}, and, at least for now,
+@option{-mcpu=r4650}.
@item -mips16
@itemx -mno-mips16
+@opindex mips16
+@opindex mno-mips16
Enable 16-bit instructions.
@item -mentry
+@opindex mentry
Use the entry and exit pseudo ops. This option can only be used with
-@samp{-mips16}.
+@option{-mips16}.
@item -EL
+@opindex EL
Compile code for the processor in little endian mode.
The requisite libraries are assumed to exist.
@item -EB
+@opindex EB
Compile code for the processor in big endian mode.
The requisite libraries are assumed to exist.
@item -G @var{num}
+@opindex G
@cindex smaller data references (MIPS)
@cindex gp-relative references (MIPS)
Put global and static items less than or equal to @var{num} bytes into
@@ -6486,20 +7243,23 @@ section. This allows the assembler to emit one word memory reference
instructions based on the global pointer (@var{gp} or @var{$28}),
instead of the normal two words used. By default, @var{num} is 8 when
the MIPS assembler is used, and 0 when the GNU assembler is used. The
-@samp{-G @var{num}} switch is also passed to the assembler and linker.
-All modules should be compiled with the same @samp{-G @var{num}}
+@option{-G @var{num}} switch is also passed to the assembler and linker.
+All modules should be compiled with the same @option{-G @var{num}}
value.
@item -nocpp
+@opindex nocpp
Tell the MIPS assembler to not run its preprocessor over user
assembler files (with a @samp{.s} suffix) when assembling them.
@item -mfix7000
+@opindex mfix7000
Pass an option to gas which will cause nops to be inserted if
the read of the destination register of an mfhi or mflo instruction
occurs in the following two instructions.
@item -no-crt0
+@opindex no-crt0
Do not include the default crt0.
@end table
@@ -6518,43 +7278,53 @@ defaults.
These @samp{-m} options are defined for the i386 family of computers:
@table @gcctabopt
-@item -mcpu=@var{cpu type}
-Assume the defaults for the machine type @var{cpu type} when scheduling
-instructions. The choices for @var{cpu type} are @samp{i386},
+@item -mcpu=@var{cpu-type}
+@opindex mcpu
+Assume the defaults for the machine type @var{cpu-type} when scheduling
+instructions. The choices for @var{cpu-type} are @samp{i386},
@samp{i486}, @samp{i586}, @samp{i686}, @samp{pentium},
@samp{pentiumpro}, @samp{k6}, and @samp{athlon}
-While picking a specific @var{cpu type} will schedule things appropriately
+While picking a specific @var{cpu-type} will schedule things appropriately
for that particular chip, the compiler will not generate any code that
-does not run on the i386 without the @samp{-march=@var{cpu type}} option
+does not run on the i386 without the @option{-march=@var{cpu-type}} option
being used. @samp{i586} is equivalent to @samp{pentium} and @samp{i686}
is equivalent to @samp{pentiumpro}. @samp{k6} is the AMD chip as
opposed to the Intel ones.
-@item -march=@var{cpu type}
-Generate instructions for the machine type @var{cpu type}. The choices
-for @var{cpu type} are the same as for @samp{-mcpu}. Moreover,
-specifying @samp{-march=@var{cpu type}} implies @samp{-mcpu=@var{cpu type}}.
+@item -march=@var{cpu-type}
+@opindex march
+Generate instructions for the machine type @var{cpu-type}. The choices
+for @var{cpu-type} are the same as for @option{-mcpu}. Moreover,
+specifying @option{-march=@var{cpu-type}} implies @option{-mcpu=@var{cpu-type}}.
@item -m386
@itemx -m486
@itemx -mpentium
@itemx -mpentiumpro
-Synonyms for -mcpu=i386, -mcpu=i486, -mcpu=pentium, and -mcpu=pentiumpro
+@opindex m386
+@opindex m486
+@opindex mpentium
+@opindex mpentiumpro
+Synonyms for @option{-mcpu=i386}, @option{-mcpu=i486}, @option{-mcpu=pentium}, and @option{-mcpu=pentiumpro}
respectively. These synonyms are deprecated.
@item -mintel-syntax
+@opindex mintel-syntax
Emit assembly using Intel syntax opcodes instead of AT&T syntax.
@item -mieee-fp
@itemx -mno-ieee-fp
+@opindex mieee-fp
+@opindex mno-ieee-fp
Control whether or not the compiler uses IEEE floating point
comparisons. These handle correctly the case where the result of a
comparison is unordered.
@item -msoft-float
+@opindex msoft-float
Generate output containing library calls for floating point.
-@strong{Warning:} the requisite libraries are not part of GCC.
+@strong{Warning:} the requisite libraries are not part of GCC@.
Normally the facilities of the machine's usual C compiler are used, but
this can't be done directly in cross-compilation. You must make your
own arrangements to provide suitable library functions for
@@ -6562,28 +7332,32 @@ cross-compilation.
On machines where a function returns floating point results in the 80387
register stack, some floating point opcodes may be emitted even if
-@samp{-msoft-float} is used.
+@option{-msoft-float} is used.
@item -mno-fp-ret-in-387
+@opindex mno-fp-ret-in-387
Do not use the FPU registers for return values of functions.
The usual calling convention has functions return values of types
@code{float} and @code{double} in an FPU register, even if there
-is no FPU. The idea is that the operating system should emulate
-an FPU.
+is no FPU@. The idea is that the operating system should emulate
+an FPU@.
-The option @samp{-mno-fp-ret-in-387} causes such values to be returned
+The option @option{-mno-fp-ret-in-387} causes such values to be returned
in ordinary CPU registers instead.
@item -mno-fancy-math-387
+@opindex mno-fancy-math-387
Some 387 emulators do not support the @code{sin}, @code{cos} and
@code{sqrt} instructions for the 387. Specify this option to avoid
-generating those instructions. This option is the default on FreeBSD.
+generating those instructions. This option is the default on FreeBSD@.
As of revision 2.6.1, these instructions are not generated unless you
-also use the @samp{-ffast-math} switch.
+also use the @option{-ffast-math} switch.
@item -malign-double
@itemx -mno-align-double
+@opindex malign-double
+@opindex mno-align-double
Control whether GCC aligns @code{double}, @code{long double}, and
@code{long long} variables on a two word boundary or a one word
boundary. Aligning @code{double} variables on a two word boundary will
@@ -6591,35 +7365,32 @@ produce code that runs somewhat faster on a @samp{Pentium} at the
expense of more memory.
@item -m128bit-long-double
-@itemx -m128bit-long-double
+@opindex m128bit-long-double
Control the size of @code{long double} type. i386 application binary interface
specify the size to be 12 bytes, while modern architectures (Pentium and newer)
-preffer @code{long double} aligned to 8 or 16 byte boundary. This is
+prefer @code{long double} aligned to 8 or 16 byte boundary. This is
impossible to reach with 12 byte long doubles in the array accesses.
-@strong{Warning:} if you use the @samp{-m128bit-long-double} switch, the
+@strong{Warning:} if you use the @option{-m128bit-long-double} switch, the
structures and arrays containing @code{long double} will change their size as
well as function calling convention for function taking @code{long double}
-will be modified.
+will be modified.
@item -m96bit-long-double
-@itemx -m96bit-long-double
+@opindex m96bit-long-double
Set the size of @code{long double} to 96 bits as required by the i386
application binary interface. This is the default.
@item -msvr3-shlib
@itemx -mno-svr3-shlib
+@opindex msvr3-shlib
+@opindex mno-svr3-shlib
Control whether GCC places uninitialized locals into @code{bss} or
-@code{data}. @samp{-msvr3-shlib} places these locals into @code{bss}.
+@code{data}. @option{-msvr3-shlib} places these locals into @code{bss}.
These options are meaningful only on System V Release 3.
-@item -mno-wide-multiply
-@itemx -mwide-multiply
-Control whether GCC uses the @code{mul} and @code{imul} that produce
-64 bit results in @code{eax:edx} from 32 bit operands to do @code{long
-long} multiplies and 32-bit division by constants.
-
@item -mrtd
+@opindex mrtd
Use a different function-calling convention, in which functions that
take a fixed number of arguments return with the @code{ret} @var{num}
instruction, which pops their arguments while returning. This saves one
@@ -6628,7 +7399,7 @@ there.
You can specify that an individual function is called with this calling
sequence with the function attribute @samp{stdcall}. You can also
-override the @samp{-mrtd} option by using the function attribute
+override the @option{-mrtd} option by using the function attribute
@samp{cdecl}. @xref{Function Attributes}.
@strong{Warning:} this calling convention is incompatible with the one
@@ -6645,13 +7416,17 @@ function with too many arguments. (Normally, extra arguments are
harmlessly ignored.)
@item -mreg-alloc=@var{regs}
+@opindex mreg-alloc
Control the default allocation order of integer registers. The
string @var{regs} is a series of letters specifying a register. The
supported letters are: @code{a} allocate EAX; @code{b} allocate EBX;
@code{c} allocate ECX; @code{d} allocate EDX; @code{S} allocate ESI;
@code{D} allocate EDI; @code{B} allocate EBP.
+This option is deprecated and will not be supported by future releases
+of gcc.
@item -mregparm=@var{num}
+@opindex mregparm
Control how many registers are used to pass integer arguments. By
default, no registers are used to pass arguments, and at most 3
registers can be used. You can control this behavior for a specific
@@ -6664,39 +7439,43 @@ value, including any libraries. This includes the system libraries and
startup modules.
@item -malign-loops=@var{num}
+@opindex malign-loops
Align loops to a 2 raised to a @var{num} byte boundary. If
-@samp{-malign-loops} is not specified, the default is 2 unless
+@option{-malign-loops} is not specified, the default is 2 unless
gas 2.8 (or later) is being used in which case the default is
to align the loop on a 16 byte boundary if it is less than 8
bytes away.
@item -malign-jumps=@var{num}
+@opindex malign-jumps
Align instructions that are only jumped to to a 2 raised to a @var{num}
-byte boundary. If @samp{-malign-jumps} is not specified, the default is
+byte boundary. If @option{-malign-jumps} is not specified, the default is
2 if optimizing for a 386, and 4 if optimizing for a 486 unless
gas 2.8 (or later) is being used in which case the default is
to align the instruction on a 16 byte boundary if it is less
than 8 bytes away.
@item -malign-functions=@var{num}
+@opindex malign-functions
Align the start of functions to a 2 raised to @var{num} byte boundary.
-If @samp{-malign-functions} is not specified, the default is 2 if optimizing
+If @option{-malign-functions} is not specified, the default is 2 if optimizing
for a 386, and 4 if optimizing for a 486.
@item -mpreferred-stack-boundary=@var{num}
+@opindex mpreferred-stack-boundary
Attempt to keep the stack boundary aligned to a 2 raised to @var{num}
-byte boundary. If @samp{-mpreferred-stack-boundary} is not specified,
+byte boundary. If @option{-mpreferred-stack-boundary} is not specified,
the default is 4 (16 bytes or 128 bits).
The stack is required to be aligned on a 4 byte boundary. On Pentium
and PentiumPro, @code{double} and @code{long double} values should be
-aligned to an 8 byte boundary (see @samp{-malign-double}) or suffer
+aligned to an 8 byte boundary (see @option{-malign-double}) or suffer
significant run time performance penalties. On Pentium III, the
Streaming SIMD Extension (SSE) data type @code{__m128} suffers similar
penalties if it is not 16 byte aligned.
To ensure proper alignment of this values on the stack, the stack boundary
-must be as aligned as that required by any value stored on the stack.
+must be as aligned as that required by any value stored on the stack.
Further, every function must be generated such that it keeps the stack
aligned. Thus calling a function compiled with a higher preferred
stack boundary from a function compiled with a lower preferred stack
@@ -6706,43 +7485,53 @@ libraries that use callbacks always use the default setting.
This extra alignment does consume extra stack space. Code that is sensitive
to stack space usage, such as embedded systems and operating system kernels,
may want to reduce the preferred alignment to
-@samp{-mpreferred-stack-boundary=2}.
+@option{-mpreferred-stack-boundary=2}.
@item -mpush-args
-@kindex -mpush-args
-Use PUSH operations to store outgoing parameters. This method is shorter
+@itemx -mno-push-args
+@opindex mpush-args
+@opindex mno-push-args
+Use PUSH operations to store outgoing parameters. This method is shorter
and usually equally fast as method using SUB/MOV operations and is enabled
-by default. In some cases disabling it may improve performance because of
+by default. In some cases disabling it may improve performance because of
improved scheduling and reduced dependencies.
@item -maccumulate-outgoing-args
-@kindex -maccumulate-outgoing-args
+@opindex maccumulate-outgoing-args
If enabled, the maximum amount of space required for outgoing arguments will be
-computed in the function prologue. This in faster on most modern CPUs
+computed in the function prologue. This is faster on most modern CPUs
because of reduced dependencies, improved scheduling and reduced stack usage
when preferred stack boundary is not equal to 2. The drawback is a notable
-increase in code size. This switch implies -mno-push-args.
+increase in code size. This switch implies @option{-mno-push-args}.
@item -mthreads
-@kindex -mthreads
-Support thread-safe exception handling on @samp{Mingw32}. Code that relies
-on thread-safe exception handling must compile and link all code with the
-@samp{-mthreads} option. When compiling, @samp{-mthreads} defines
-@samp{-D_MT}; when linking, it links in a special thread helper library
-@samp{-lmingwthrd} which cleans up per thread exception handling data.
+@opindex mthreads
+Support thread-safe exception handling on @samp{Mingw32}. Code that relies
+on thread-safe exception handling must compile and link all code with the
+@option{-mthreads} option. When compiling, @option{-mthreads} defines
+@option{-D_MT}; when linking, it links in a special thread helper library
+@option{-lmingwthrd} which cleans up per thread exception handling data.
@item -mno-align-stringops
-@kindex -mno-align-stringops
-Do not align destination of inlined string operations. This switch reduces
+@opindex mno-align-stringops
+Do not align destination of inlined string operations. This switch reduces
code size and improves performance in case the destination is already aligned,
but gcc don't know about it.
@item -minline-all-stringops
-@kindex -minline-all-stringops
+@opindex minline-all-stringops
By default GCC inlines string operations only when destination is known to be
-aligned at least to 4 byte boundary. This enables more inlining, increase code
+aligned at least to 4 byte boundary. This enables more inlining, increase code
size, but may improve performance of code that depends on fast memcpy, strlen
and memset for short lengths.
+
+@item -momit-leaf-frame-pointer
+@opindex momit-leaf-frame-pointer
+Don't keep the frame pointer in a register for leaf functions. This
+avoids the instructions to save, set up and restore frame pointers and
+makes an extra register available in leaf functions. The option
+@option{-fomit-frame-pointer} removes the frame pointer for all functions
+which might make debugging harder.
@end table
@node HPPA Options
@@ -6752,9 +7541,10 @@ and memset for short lengths.
These @samp{-m} options are defined for the HPPA family of computers:
@table @gcctabopt
-@item -march=@var{architecture type}
+@item -march=@var{architecture-type}
+@opindex march
Generate code for the specified architecture. The choices for
-@var{architecture type} are @samp{1.0} for PA 1.0, @samp{1.1} for PA
+@var{architecture-type} are @samp{1.0} for PA 1.0, @samp{1.1} for PA
1.1, and @samp{2.0} for PA 2.0 processors. Refer to
@file{/usr/lib/sched.models} on an HP-UX system to determine the proper
architecture option for your machine. Code compiled for lower numbered
@@ -6763,40 +7553,49 @@ other way around.
PA 2.0 support currently requires gas snapshot 19990413 or later. The
next release of binutils (current is 2.9.1) will probably contain PA 2.0
-support.
+support.
@item -mpa-risc-1-0
@itemx -mpa-risc-1-1
@itemx -mpa-risc-2-0
-Synonyms for -march=1.0, -march=1.1, and -march=2.0 respectively.
+@opindex mpa-risc-1-0
+@opindex mpa-risc-1-1
+@opindex mpa-risc-2-0
+Synonyms for @option{-march=1.0}, @option{-march=1.1}, and @option{-march=2.0} respectively.
@item -mbig-switch
+@opindex mbig-switch
Generate code suitable for big switch tables. Use this option only if
the assembler/linker complain about out of range branches within a switch
table.
@item -mjump-in-delay
+@opindex mjump-in-delay
Fill delay slots of function calls with unconditional jump instructions
by modifying the return pointer for the function call to be the target
of the conditional jump.
@item -mdisable-fpregs
+@opindex mdisable-fpregs
Prevent floating point registers from being used in any manner. This is
necessary for compiling kernels which perform lazy context switching of
floating point registers. If you use this option and attempt to perform
floating point operations, the compiler will abort.
@item -mdisable-indexing
+@opindex mdisable-indexing
Prevent the compiler from using indexing address modes. This avoids some
-rather obscure problems when compiling MIG generated code under MACH.
+rather obscure problems when compiling MIG generated code under MACH@.
@item -mno-space-regs
+@opindex mno-space-regs
Generate code that assumes the target has no space registers. This allows
GCC to generate faster indirect calls and use unscaled index address modes.
Such code is suitable for level 0 PA systems and kernels.
@item -mfast-indirect-calls
+@opindex mfast-indirect-calls
Generate code that assumes calls never cross space boundaries. This
allows GCC to emit code which performs faster indirect calls.
@@ -6804,29 +7603,35 @@ This option will not work in the presence of shared libraries or nested
functions.
@item -mlong-load-store
+@opindex mlong-load-store
Generate 3-instruction load and store sequences as sometimes required by
the HP-UX 10 linker. This is equivalent to the @samp{+k} option to
the HP compilers.
@item -mportable-runtime
+@opindex mportable-runtime
Use the portable calling conventions proposed by HP for ELF systems.
@item -mgas
+@opindex mgas
Enable the use of assembler directives only GAS understands.
-@item -mschedule=@var{cpu type}
+@item -mschedule=@var{cpu-type}
+@opindex mschedule
Schedule code according to the constraints for the machine type
-@var{cpu type}. The choices for @var{cpu type} are @samp{700}
-@samp{7100}, @samp{7100LC}, @samp{7200}, and @samp{8000}. Refer to
+@var{cpu-type}. The choices for @var{cpu-type} are @samp{700}
+@samp{7100}, @samp{7100LC}, @samp{7200}, and @samp{8000}. Refer to
@file{/usr/lib/sched.models} on an HP-UX system to determine the
proper scheduling option for your machine.
@item -mlinker-opt
+@opindex mlinker-opt
Enable the optimization pass in the HPUX linker. Note this makes symbolic
debugging impossible. It also triggers a bug in the HPUX 8 and HPUX 9 linkers
in which they give bogus error messages when linking some programs.
@item -msoft-float
+@opindex msoft-float
Generate output containing library calls for floating point.
@strong{Warning:} the requisite libraries are not available for all HPPA
targets. Normally the facilities of the machine's usual C compiler are
@@ -6835,10 +7640,10 @@ your own arrangements to provide suitable library functions for
cross-compilation. The embedded target @samp{hppa1.1-*-pro}
does provide software floating point support.
-@samp{-msoft-float} changes the calling convention in the output file;
+@option{-msoft-float} changes the calling convention in the output file;
therefore, it is only useful if you compile @emph{all} of a program with
this option. In particular, you need to compile @file{libgcc.a}, the
-library that comes with GCC, with @samp{-msoft-float} in order for
+library that comes with GCC, with @option{-msoft-float} in order for
this to work.
@end table
@@ -6848,10 +7653,17 @@ this to work.
These @samp{-m} options are defined for the Intel 960 implementations:
@table @gcctabopt
-@item -m@var{cpu type}
-Assume the defaults for the machine type @var{cpu type} for some of
+@item -m@var{cpu-type}
+@opindex mka
+@opindex mkb
+@opindex mmc
+@opindex mca
+@opindex mcf
+@opindex msa
+@opindex msb
+Assume the defaults for the machine type @var{cpu-type} for some of
the other options, including instruction scheduling, floating point
-support, and addressing modes. The choices for @var{cpu type} are
+support, and addressing modes. The choices for @var{cpu-type} are
@samp{ka}, @samp{kb}, @samp{mc}, @samp{ca}, @samp{cf},
@samp{sa}, and @samp{sb}.
The default is
@@ -6859,12 +7671,16 @@ The default is
@item -mnumerics
@itemx -msoft-float
-The @samp{-mnumerics} option indicates that the processor does support
-floating-point instructions. The @samp{-msoft-float} option indicates
+@opindex mnumerics
+@opindex msoft-float
+The @option{-mnumerics} option indicates that the processor does support
+floating-point instructions. The @option{-msoft-float} option indicates
that floating-point support should not be assumed.
@item -mleaf-procedures
@itemx -mno-leaf-procedures
+@opindex mleaf-procedures
+@opindex mno-leaf-procedures
Do (or do not) attempt to alter leaf procedures to be callable with the
@code{bal} instruction as well as @code{call}. This will result in more
efficient code for explicit calls when the @code{bal} instruction can be
@@ -6874,49 +7690,66 @@ support this optimization.
@item -mtail-call
@itemx -mno-tail-call
+@opindex mtail-call
+@opindex mno-tail-call
Do (or do not) make additional attempts (beyond those of the
machine-independent portions of the compiler) to optimize tail-recursive
calls into branches. You may not want to do this because the detection of
cases where this is not valid is not totally complete. The default is
-@samp{-mno-tail-call}.
+@option{-mno-tail-call}.
@item -mcomplex-addr
@itemx -mno-complex-addr
+@opindex mcomplex-addr
+@opindex mno-complex-addr
Assume (or do not assume) that the use of a complex addressing mode is a
win on this implementation of the i960. Complex addressing modes may not
be worthwhile on the K-series, but they definitely are on the C-series.
-The default is currently @samp{-mcomplex-addr} for all processors except
-the CB and CC.
+The default is currently @option{-mcomplex-addr} for all processors except
+the CB and CC@.
@item -mcode-align
@itemx -mno-code-align
+@opindex mcode-align
+@opindex mno-code-align
Align code to 8-byte boundaries for faster fetching (or don't bother).
Currently turned on by default for C-series implementations only.
@ignore
@item -mclean-linkage
@itemx -mno-clean-linkage
+@opindex mclean-linkage
+@opindex mno-clean-linkage
These options are not fully implemented.
@end ignore
@item -mic-compat
@itemx -mic2.0-compat
@itemx -mic3.0-compat
+@opindex mic-compat
+@opindex mic2.0-compat
+@opindex mic3.0-compat
Enable compatibility with iC960 v2.0 or v3.0.
@item -masm-compat
@itemx -mintel-asm
+@opindex masm-compat
+@opindex mintel-asm
Enable compatibility with the iC960 assembler.
@item -mstrict-align
@itemx -mno-strict-align
+@opindex mstrict-align
+@opindex mno-strict-align
Do not permit (do permit) unaligned accesses.
@item -mold-align
+@opindex mold-align
Enable structure-alignment compatibility with Intel's gcc release version
-1.3 (based on gcc 1.37). This option implies @samp{-mstrict-align}.
+1.3 (based on gcc 1.37). This option implies @option{-mstrict-align}.
@item -mlong-double-64
+@opindex mlong-double-64
Implement type @samp{long double} as 64-bit floating point numbers.
Without the option @samp{long double} is implemented by 80-bit
floating point numbers. The only reason we have it because there is
@@ -6934,6 +7767,8 @@ These @samp{-m} options are defined for the DEC Alpha implementations:
@table @gcctabopt
@item -mno-soft-float
@itemx -msoft-float
+@opindex mno-soft-float
+@opindex msoft-float
Use (do not use) the hardware floating-point instructions for
floating-point operations. When @option{-msoft-float} is specified,
functions in @file{libgcc1.c} will be used to perform floating-point
@@ -6949,6 +7784,8 @@ required to have floating-point registers.
@item -mfp-reg
@itemx -mno-fp-regs
+@opindex mfp-reg
+@opindex mno-fp-regs
Generate code that uses (does not use) the floating-point register set.
@option{-mno-fp-regs} implies @option{-msoft-float}. If the floating-point
register set is not used, floating point operands are passed in integer
@@ -6962,13 +7799,14 @@ A typical use of this option is building a kernel that does not use,
and hence need not save and restore, any floating-point registers.
@item -mieee
+@opindex mieee
The Alpha architecture implements floating-point hardware optimized for
maximum performance. It is mostly compliant with the IEEE floating
point standard. However, for full compliance, software assistance is
required. This option generates code fully IEEE compliant code
-@emph{except} that the @var{inexact flag} is not maintained (see below).
+@emph{except} that the @var{inexact-flag} is not maintained (see below).
If this option is turned on, the CPP macro @code{_IEEE_FP} is defined
-during compilation. The option is a shorthand for: @samp{-D_IEEE_FP
+during compilation. The option is a shorthand for: @option{-D_IEEE_FP
-mfp-trap-mode=su -mtrap-precision=i -mieee-conformant}. The resulting
code is less efficient but is able to correctly support denormalized
numbers and exceptional IEEE values such as not-a-number and plus/minus
@@ -6976,38 +7814,40 @@ infinity. Other Alpha compilers call this option
@option{-ieee_with_no_inexact}.
@item -mieee-with-inexact
+@opindex mieee-with-inexact
@c overfull hbox here --bob 22 jul96
@c original text between ignore ... end ignore
@ignore
-This is like @samp{-mieee} except the generated code also maintains the
-IEEE @var{inexact flag}. Turning on this option causes the generated
+This is like @option{-mieee} except the generated code also maintains the
+IEEE @var{inexact-flag}. Turning on this option causes the generated
code to implement fully-compliant IEEE math. The option is a shorthand
-for @samp{-D_IEEE_FP -D_IEEE_FP_INEXACT} plus @samp{-mieee-conformant},
-@samp{-mfp-trap-mode=sui}, and @samp{-mtrap-precision=i}. On some Alpha
+for @option{-D_IEEE_FP -D_IEEE_FP_INEXACT} plus @option{-mieee-conformant},
+@option{-mfp-trap-mode=sui}, and @option{-mtrap-precision=i}. On some Alpha
implementations the resulting code may execute significantly slower than
the code generated by default. Since there is very little code that
-depends on the @var{inexact flag}, you should normally not specify this
+depends on the @var{inexact-flag}, you should normally not specify this
option. Other Alpha compilers call this option
-@samp{-ieee_with_inexact}.
+@option{-ieee_with_inexact}.
@end ignore
@c changed paragraph
-This is like @samp{-mieee} except the generated code also maintains the
-IEEE @var{inexact flag}. Turning on this option causes the generated
+This is like @option{-mieee} except the generated code also maintains the
+IEEE @var{inexact-flag}. Turning on this option causes the generated
code to implement fully-compliant IEEE math. The option is a shorthand
-for @samp{-D_IEEE_FP -D_IEEE_FP_INEXACT} plus the three following:
-@samp{-mieee-conformant},
-@samp{-mfp-trap-mode=sui},
-and @samp{-mtrap-precision=i}.
+for @option{-D_IEEE_FP -D_IEEE_FP_INEXACT} plus the three following:
+@option{-mieee-conformant},
+@option{-mfp-trap-mode=sui},
+and @option{-mtrap-precision=i}.
On some Alpha implementations the resulting code may execute
significantly slower than the code generated by default. Since there
-is very little code that depends on the @var{inexact flag}, you should
+is very little code that depends on the @var{inexact-flag}, you should
normally not specify this option. Other Alpha compilers call this
-option @samp{-ieee_with_inexact}.
+option @option{-ieee_with_inexact}.
@c end changes to prevent overfull hboxes
-@item -mfp-trap-mode=@var{trap mode}
+@item -mfp-trap-mode=@var{trap-mode}
+@opindex mfp-trap-mode
This option controls what floating-point related traps are enabled.
-Other Alpha compilers call this option @samp{-fptm }@var{trap mode}.
+Other Alpha compilers call this option @option{-fptm @var{trap-mode}}.
The trap mode can be set to one of four values:
@table @samp
@@ -7028,9 +7868,10 @@ completion (see Alpha architecture manual for details).
Like @samp{su}, but inexact traps are enabled as well.
@end table
-@item -mfp-rounding-mode=@var{rounding mode}
+@item -mfp-rounding-mode=@var{rounding-mode}
+@opindex mfp-rounding-mode
Selects the IEEE rounding mode. Other Alpha compilers call this option
-@samp{-fprm }@var{rounding mode}. The @var{rounding mode} can be one
+@option{-fprm @var{rounding-mode}}. The @var{rounding-mode} can be one
of:
@table @samp
@@ -7053,7 +7894,8 @@ rounding towards plus infinity. Thus, unless your program modifies the
@var{fpcr}, @samp{d} corresponds to round towards plus infinity.
@end table
-@item -mtrap-precision=@var{trap precision}
+@item -mtrap-precision=@var{trap-precision}
+@opindex mtrap-precision
In the Alpha architecture, floating point traps are imprecise. This
means without software assistance it is impossible to recover from a
floating trap and program execution normally needs to be terminated.
@@ -7077,17 +7919,19 @@ instruction that caused a floating point exception.
@end table
Other Alpha compilers provide the equivalent options called
-@samp{-scope_safe} and @samp{-resumption_safe}.
+@option{-scope_safe} and @option{-resumption_safe}.
@item -mieee-conformant
+@opindex mieee-conformant
This option marks the generated code as IEEE conformant. You must not
-use this option unless you also specify @samp{-mtrap-precision=i} and either
-@samp{-mfp-trap-mode=su} or @samp{-mfp-trap-mode=sui}. Its only effect
+use this option unless you also specify @option{-mtrap-precision=i} and either
+@option{-mfp-trap-mode=su} or @option{-mfp-trap-mode=sui}. Its only effect
is to emit the line @samp{.eflag 48} in the function prologue of the
generated assembly file. Under DEC Unix, this has the effect that
IEEE-conformant math library routines will be linked in.
@item -mbuild-constants
+@opindex mbuild-constants
Normally GCC examines a 32- or 64-bit integer constant to
see if it can construct it from smaller constants in two or three
instructions. If it cannot, it will output the constant as a literal and
@@ -7102,8 +7946,10 @@ before it can find the variables and constants in its own data segment.
@item -malpha-as
@itemx -mgas
+@opindex malpha-as
+@opindex mgas
Select whether to generate code to be assembled by the vendor-supplied
-assembler (@samp{-malpha-as}) or by the GNU assembler @samp{-mgas}.
+assembler (@option{-malpha-as}) or by the GNU assembler @option{-mgas}.
@item -mbwx
@itemx -mno-bwx
@@ -7111,12 +7957,19 @@ assembler (@samp{-malpha-as}) or by the GNU assembler @samp{-mgas}.
@itemx -mno-cix
@itemx -mmax
@itemx -mno-max
+@opindex mbwx
+@opindex mno-bwx
+@opindex mcix
+@opindex mno-cix
+@opindex mmax
+@opindex mno-max
Indicate whether GCC should generate code to use the optional BWX,
CIX, and MAX instruction sets. The default is to use the instruction sets
-supported by the CPU type specified via @samp{-mcpu=} option or that
+supported by the CPU type specified via @option{-mcpu=} option or that
of the CPU on which GCC was built if none was specified.
@item -mcpu=@var{cpu_type}
+@opindex mcpu
Set the instruction set, register set, and instruction scheduling
parameters for machine type @var{cpu_type}. You can specify either the
@samp{EV} style name or the corresponding chip number. GCC
@@ -7152,6 +8005,7 @@ for the EV6) and supports the BWX, CIX, and MAX extensions.
@end table
@item -mmemory-latency=@var{time}
+@opindex mmemory-latency
Sets the latency the scheduler should assume for typical memory
references as seen by the application. This number is highly
dependent on the memory access patterns used by the application
@@ -7182,11 +8036,13 @@ These @samp{-m} options are defined for the Clipper implementations:
@table @gcctabopt
@item -mc300
-Produce code for a C300 Clipper processor. This is the default.
+@opindex mc300
+Produce code for a C300 Clipper processor. This is the default.
@item -mc400
-Produce code for a C400 Clipper processor i.e. use floating point
-registers f8..f15.
+@opindex mc400
+Produce code for a C400 Clipper processor i.e.@: use floating point
+registers f8---f15.
@end table
@node H8/300 Options
@@ -7196,27 +8052,33 @@ These @samp{-m} options are defined for the H8/300 implementations:
@table @gcctabopt
@item -mrelax
+@opindex mrelax
Shorten some address references at link time, when possible; uses the
-linker option @samp{-relax}. @xref{H8/300,, @code{ld} and the H8/300,
+linker option @option{-relax}. @xref{H8/300,, @code{ld} and the H8/300,
ld.info, Using ld}, for a fuller description.
@item -mh
-Generate code for the H8/300H.
+@opindex mh
+Generate code for the H8/300H@.
@item -ms
-Generate code for the H8/S.
+@opindex ms
+Generate code for the H8/S@.
@item -ms2600
-Generate code for the H8/S2600. This switch must be used with -ms.
+@opindex ms2600
+Generate code for the H8/S2600. This switch must be used with @option{-ms}.
@item -mint32
+@opindex mint32
Make @code{int} data 32 bits by default.
@item -malign-300
+@opindex malign-300
On the H8/300H and H8/S, use the same alignment rules as for the H8/300.
The default for the H8/300H and H8/S is to align longs and floats on 4
byte boundaries.
-@samp{-malign-300} causes them to be aligned on 2 byte boundaries.
+@option{-malign-300} causes them to be aligned on 2 byte boundaries.
This option has no effect on the H8/300.
@end table
@@ -7227,75 +8089,100 @@ These @samp{-m} options are defined for the SH implementations:
@table @gcctabopt
@item -m1
+@opindex m1
Generate code for the SH1.
@item -m2
+@opindex m2
Generate code for the SH2.
@item -m3
+@opindex m3
Generate code for the SH3.
@item -m3e
+@opindex m3e
Generate code for the SH3e.
@item -m4-nofpu
+@opindex m4-nofpu
Generate code for the SH4 without a floating-point unit.
@item -m4-single-only
+@opindex m4-single-only
Generate code for the SH4 with a floating-point unit that only
-supports single-precision arithmentic.
+supports single-precision arithmetic.
@item -m4-single
+@opindex m4-single
Generate code for the SH4 assuming the floating-point unit is in
single-precision mode by default.
@item -m4
+@opindex m4
Generate code for the SH4.
@item -mb
+@opindex mb
Compile code for the processor in big endian mode.
@item -ml
+@opindex ml
Compile code for the processor in little endian mode.
@item -mdalign
-Align doubles at 64 bit boundaries. Note that this changes the calling
+@opindex mdalign
+Align doubles at 64-bit boundaries. Note that this changes the calling
conventions, and thus some functions from the standard C library will
-not work unless you recompile it first with -mdalign.
+not work unless you recompile it first with @option{-mdalign}.
@item -mrelax
+@opindex mrelax
Shorten some address references at link time, when possible; uses the
-linker option @samp{-relax}.
+linker option @option{-relax}.
@item -mbigtable
+@opindex mbigtable
Use 32-bit offsets in @code{switch} tables. The default is to use
16-bit offsets.
@item -mfmovd
+@opindex mfmovd
Enable the use of the instruction @code{fmovd}.
@item -mhitachi
+@opindex mhitachi
Comply with the calling conventions defined by Hitachi.
@item -mnomacsave
+@opindex mnomacsave
Mark the @code{MAC} register as call-clobbered, even if
@option{-mhitachi} is given.
+@item -mieee
+@opindex mieee
+Increase IEEE-compliance of floating-point code.
+
@item -misize
+@opindex misize
Dump instruction size and location in the assembly code.
@item -mpadstruct
+@opindex mpadstruct
This option is deprecated. It pads structures to multiple of 4 bytes,
-which is incompatible with the SH ABI.
+which is incompatible with the SH ABI@.
@item -mspace
+@opindex mspace
Optimize for space instead of speed. Implied by @option{-Os}.
@item -mprefergot
+@opindex mprefergot
When generating position-independent code, emit function calls using
the Global Offset Table instead of the Procedure Linkage Table.
@item -musermode
+@opindex musermode
Generate a library function call to invalidate instruction cache
entries, after fixing up a trampoline. This library function call
doesn't assume it can write to the whole memory address space. This
@@ -7310,22 +8197,27 @@ compatibility with other compilers on those systems:
@table @gcctabopt
@item -G
+@opindex G
Create a shared object.
-It is recommended that @samp{-symbolic} or @samp{-shared} be used instead.
+It is recommended that @option{-symbolic} or @option{-shared} be used instead.
@item -Qy
+@opindex Qy
Identify the versions of each tool used by the compiler, in a
@code{.ident} assembler directive in the output.
@item -Qn
+@opindex Qn
Refrain from adding @code{.ident} directives to the output file (this is
the default).
-@item -YP\,@var{dirs}
+@item -YP,@var{dirs}
+@opindex YP
Search the directories @var{dirs}, and no others, for libraries
-specified with @samp{-l}.
+specified with @option{-l}.
-@item -Ym\,@var{dir}
+@item -Ym,@var{dir}
+@opindex Ym
Look in the directory @var{dir} to find the M4 preprocessor.
The assembler uses this option.
@c This is supposed to go with a -Yd for predefined M4 macro files, but
@@ -7341,6 +8233,7 @@ These @samp{-m} options are defined for TMS320C3x/C4x implementations:
@table @gcctabopt
@item -mcpu=@var{cpu_type}
+@opindex mcpu
Set the instruction set, register set, and instruction scheduling
parameters for machine type @var{cpu_type}. Supported values for
@var{cpu_type} are @samp{c30}, @samp{c31}, @samp{c32}, @samp{c40}, and
@@ -7351,6 +8244,10 @@ TMS320C40.
@item -mbig
@itemx -msmall-memory
@itemx -msmall
+@opindex mbig-memory
+@opindex mbig
+@opindex msmall-memory
+@opindex msmall
Generates code for the big or small memory model. The small memory
model assumed that all data fits into one 64K word page. At run-time
the data page (DP) register must be set to point to the 64K page
@@ -7360,16 +8257,20 @@ memory access.
@item -mbk
@itemx -mno-bk
+@opindex mbk
+@opindex mno-bk
Allow (disallow) allocation of general integer operands into the block
-count register BK.
+count register BK@.
@item -mdb
@itemx -mno-db
+@opindex mdb
+@opindex mno-db
Enable (disable) generation of code using decrement and branch,
DBcond(D), instructions. This is enabled by default for the C4x. To be
on the safe side, this is disabled for the C3x, since the maximum
-iteration count on the C3x is 2^23 + 1 (but who iterates loops more than
-2^23 times on the C3x?). Note that GCC will try to reverse a loop so
+iteration count on the C3x is @math{2^23 + 1} (but who iterates loops more than
+@math{2^23} times on the C3x?). Note that GCC will try to reverse a loop so
that it can utilise the decrement and branch instruction, but will give
up if there is more than one memory reference in the loop. Thus a loop
where the loop counter is decremented can generate slightly more
@@ -7377,22 +8278,28 @@ efficient code, in cases where the RPTB instruction cannot be utilised.
@item -mdp-isr-reload
@itemx -mparanoid
+@opindex mdp-isr-reload
+@opindex mparanoid
Force the DP register to be saved on entry to an interrupt service
routine (ISR), reloaded to point to the data section, and restored on
-exit from the ISR. This should not be required unless someone has
+exit from the ISR@. This should not be required unless someone has
violated the small memory model by modifying the DP register, say within
an object library.
@item -mmpyi
@itemx -mno-mpyi
+@opindex mmpyi
+@opindex mno-mpyi
For the C3x use the 24-bit MPYI instruction for integer multiplies
instead of a library call to guarantee 32-bit results. Note that if one
of the operands is a constant, then the multiplication will be performed
-using shifts and adds. If the -mmpyi option is not specified for the C3x,
+using shifts and adds. If the @option{-mmpyi} option is not specified for the C3x,
then squaring operations are performed inline instead of a library call.
@item -mfast-fix
@itemx -mno-fast-fix
+@opindex mfast-fix
+@opindex mno-fast-fix
The C3x/C4x FIX instruction to convert a floating point value to an
integer value chooses the nearest integer less than or equal to the
floating point value rather than to the nearest integer. Thus if the
@@ -7403,19 +8310,23 @@ code required to correct the result.
@item -mrptb
@itemx -mno-rptb
+@opindex mrptb
+@opindex mno-rptb
Enable (disable) generation of repeat block sequences using the RPTB
instruction for zero overhead looping. The RPTB construct is only used
for innermost loops that do not call functions or jump across the loop
boundaries. There is no advantage having nested RPTB loops due to the
overhead required to save and restore the RC, RS, and RE registers.
-This is enabled by default with -O2.
+This is enabled by default with @option{-O2}.
@item -mrpts=@var{count}
@itemx -mno-rpts
+@opindex mrpts
+@opindex mno-rpts
Enable (disable) the use of the single instruction repeat instruction
-RPTS. If a repeat block contains a single instruction, and the loop
+RPTS@. If a repeat block contains a single instruction, and the loop
count can be guaranteed to be less than the value @var{count}, GCC will
-emit a RPTS instruction instead of a RPTB. If no value is specified,
+emit a RPTS instruction instead of a RPTB@. If no value is specified,
then a RPTS will be emitted even if the loop count cannot be determined
at compile time. Note that the repeated instruction following RPTS does
not have to be reloaded from memory each iteration, thus freeing up the
@@ -7424,13 +8335,16 @@ instruction, it is disabled by default.
@item -mloop-unsigned
@itemx -mno-loop-unsigned
+@opindex mloop-unsigned
+@opindex mno-loop-unsigned
The maximum iteration count when using RPTS and RPTB (and DB on the C40)
-is 2^31 + 1 since these instructions test if the iteration count is
+is @math{2^31 + 1} since these instructions test if the iteration count is
negative to terminate the loop. If the iteration count is unsigned
-there is a possibility than the 2^31 + 1 maximum iteration count may be
+there is a possibility than the @math{2^31 + 1} maximum iteration count may be
exceeded. This switch allows an unsigned iteration count.
@item -mti
+@opindex mti
Try to emit an assembler syntax that the TI assembler (asm30) is happy
with. This also enforces compatibility with the API employed by the TI
C3x C compiler. For example, long doubles are passed as structures
@@ -7438,19 +8352,25 @@ rather than in floating point registers.
@item -mregparm
@itemx -mmemparm
+@opindex mregparm
+@opindex mmemparm
Generate code that uses registers (stack) for passing arguments to functions.
By default, arguments are passed in registers where possible rather
than by pushing arguments on to the stack.
@item -mparallel-insns
@itemx -mno-parallel-insns
+@opindex mparallel-insns
+@opindex mno-parallel-insns
Allow the generation of parallel instructions. This is enabled by
-default with -O2.
+default with @option{-O2}.
@item -mparallel-mpy
@itemx -mno-parallel-mpy
+@opindex mparallel-mpy
+@opindex mno-parallel-mpy
Allow the generation of MPY||ADD and MPY||SUB parallel instructions,
-provided -mparallel-insns is also specified. These instructions have
+provided @option{-mparallel-insns} is also specified. These instructions have
tight register constraints which can pessimize the code generation
of large functions.
@@ -7465,47 +8385,59 @@ These @samp{-m} options are defined for V850 implementations:
@table @gcctabopt
@item -mlong-calls
@itemx -mno-long-calls
+@opindex mlong-calls
+@opindex mno-long-calls
Treat all calls as being far away (near). If calls are assumed to be
far away, the compiler will always load the functions address up into a
register, and call indirect through the pointer.
@item -mno-ep
@itemx -mep
+@opindex mno-ep
+@opindex mep
Do not optimize (do optimize) basic blocks that use the same index
pointer 4 or more times to copy pointer into the @code{ep} register, and
-use the shorter @code{sld} and @code{sst} instructions. The @samp{-mep}
+use the shorter @code{sld} and @code{sst} instructions. The @option{-mep}
option is on by default if you optimize.
@item -mno-prolog-function
@itemx -mprolog-function
+@opindex mno-prolog-function
+@opindex mprolog-function
Do not use (do use) external functions to save and restore registers at
the prolog and epilog of a function. The external functions are slower,
but use less code space if more than one function saves the same number
-of registers. The @samp{-mprolog-function} option is on by default if
+of registers. The @option{-mprolog-function} option is on by default if
you optimize.
@item -mspace
+@opindex mspace
Try to make the code as small as possible. At present, this just turns
-on the @samp{-mep} and @samp{-mprolog-function} options.
+on the @option{-mep} and @option{-mprolog-function} options.
@item -mtda=@var{n}
+@opindex mtda
Put static or global variables whose size is @var{n} bytes or less into
the tiny data area that register @code{ep} points to. The tiny data
area can hold up to 256 bytes in total (128 bytes for byte references).
@item -msda=@var{n}
+@opindex msda
Put static or global variables whose size is @var{n} bytes or less into
the small data area that register @code{gp} points to. The small data
area can hold up to 64 kilobytes.
@item -mzda=@var{n}
+@opindex mzda
Put static or global variables whose size is @var{n} bytes or less into
the first 32 kilobytes of memory.
-
+
@item -mv850
+@opindex mv850
Specify that the target processor is the V850.
@item -mbig-switch
+@opindex mbig-switch
Generate code suitable for big switch tables. Use this option only if
the assembler/linker complain about out of range branches within a switch
table.
@@ -7519,29 +8451,36 @@ These options are defined for ARC implementations:
@table @gcctabopt
@item -EL
+@opindex EL
Compile code for little endian mode. This is the default.
@item -EB
+@opindex EB
Compile code for big endian mode.
@item -mmangle-cpu
+@opindex mmangle-cpu
Prepend the name of the cpu to all public symbol names.
In multiple-processor systems, there are many ARC variants with different
instruction and register set characteristics. This flag prevents code
compiled for one cpu to be linked with code compiled for another.
-No facility exists for handling variants that are "almost identical".
+No facility exists for handling variants that are ``almost identical''.
This is an all or nothing option.
@item -mcpu=@var{cpu}
+@opindex mcpu
Compile code for ARC variant @var{cpu}.
Which variants are supported depend on the configuration.
-All variants support @samp{-mcpu=base}, this is the default.
-
-@item -mtext=@var{text section}
-@itemx -mdata=@var{data section}
-@itemx -mrodata=@var{readonly data section}
-Put functions, data, and readonly data in @var{text section},
-@var{data section}, and @var{readonly data section} respectively
+All variants support @option{-mcpu=base}, this is the default.
+
+@item -mtext=@var{text-section}
+@itemx -mdata=@var{data-section}
+@itemx -mrodata=@var{readonly-data-section}
+@opindex mtext
+@opindex mdata
+@opindex mrodata
+Put functions, data, and readonly data in @var{text-section},
+@var{data-section}, and @var{readonly-data-section} respectively
by default. This can be overridden with the @code{section} attribute.
@xref{Variable Attributes}.
@@ -7559,53 +8498,67 @@ given below.
@table @gcctabopt
@item -m32032
@itemx -m32032
+@opindex m32032
+@opindex m32032
Generate output for a 32032. This is the default
when the compiler is configured for 32032 and 32016 based systems.
@item -m32332
@itemx -m32332
+@opindex m32332
+@opindex m32332
Generate output for a 32332. This is the default
when the compiler is configured for 32332-based systems.
@item -m32532
@itemx -m32532
+@opindex m32532
+@opindex m32532
Generate output for a 32532. This is the default
when the compiler is configured for 32532-based systems.
@item -m32081
+@opindex m32081
Generate output containing 32081 instructions for floating point.
This is the default for all systems.
@item -m32381
+@opindex m32381
Generate output containing 32381 instructions for floating point. This
-also implies @samp{-m32081}. The 32381 is only compatible with the 32332
-and 32532 cpus. This is the default for the pc532-netbsd configuration.
+also implies @option{-m32081}. The 32381 is only compatible with the 32332
+and 32532 cpus. This is the default for the pc532-netbsd configuration.
@item -mmulti-add
+@opindex mmulti-add
Try and generate multiply-add floating point instructions @code{polyF}
-and @code{dotF}. This option is only available if the @samp{-m32381}
-option is in effect. Using these instructions requires changes to to
+and @code{dotF}. This option is only available if the @option{-m32381}
+option is in effect. Using these instructions requires changes to
register allocation which generally has a negative impact on
performance. This option should only be enabled when compiling code
particularly likely to make heavy use of multiply-add instructions.
@item -mnomulti-add
+@opindex mnomulti-add
Do not try and generate multiply-add floating point instructions
-@code{polyF} and @code{dotF}. This is the default on all platforms.
+@code{polyF} and @code{dotF}. This is the default on all platforms.
@item -msoft-float
+@opindex msoft-float
Generate output containing library calls for floating point.
@strong{Warning:} the requisite libraries may not be available.
@item -mnobitfield
-Do not use the bit-field instructions. On some machines it is faster to
-use shifting and masking operations. This is the default for the pc532.
+@opindex mnobitfield
+Do not use the bit-field instructions. On some machines it is faster to
+use shifting and masking operations. This is the default for the pc532.
@item -mbitfield
-Do use the bit-field instructions. This is the default for all platforms
+@opindex mbitfield
+Do use the bit-field instructions. This is the default for all platforms
except the pc532.
@item -mrtd
+@opindex mrtd
Use a different function-calling convention, in which functions
that take a fixed number of arguments return pop their
arguments on return with the @code{ret} instruction.
@@ -7627,6 +8580,7 @@ This option takes its name from the 680x0 @code{rtd} instruction.
@item -mregparam
+@opindex mregparam
Use a different function-calling convention where the first two arguments
are passed in registers.
@@ -7635,26 +8589,31 @@ used on Unix, so you cannot use it if you need to call libraries
compiled with the Unix compiler.
@item -mnoregparam
-Do not pass any arguments in registers. This is the default for all
+@opindex mnoregparam
+Do not pass any arguments in registers. This is the default for all
targets.
@item -msb
+@opindex msb
It is OK to use the sb as an index register which is always loaded with
-zero. This is the default for the pc532-netbsd target.
+zero. This is the default for the pc532-netbsd target.
@item -mnosb
+@opindex mnosb
The sb register is not available for use or has not been initialized to
-zero by the run time system. This is the default for all targets except
-the pc532-netbsd. It is also implied whenever @samp{-mhimem} or
-@samp{-fpic} is set.
+zero by the run time system. This is the default for all targets except
+the pc532-netbsd. It is also implied whenever @option{-mhimem} or
+@option{-fpic} is set.
@item -mhimem
-Many ns32000 series addressing modes use displacements of up to 512MB.
+@opindex mhimem
+Many ns32000 series addressing modes use displacements of up to 512MB@.
If an address is above 512MB then displacements from zero can not be used.
-This option causes code to be generated which can be loaded above 512MB.
+This option causes code to be generated which can be loaded above 512MB@.
This may be useful for operating systems or ROM code.
@item -mnohimem
+@opindex mnohimem
Assume code will be loaded in the first 512MB of virtual address space.
This is the default for all platforms.
@@ -7669,6 +8628,7 @@ These options are defined for AVR implementations:
@table @gcctabopt
@item -mmcu=@var{mcu}
+@opindex mmcu
Specify ATMEL AVR instruction set or MCU type.
Instruction set avr1 is for the minimal AVR core, not supported by the C
@@ -7690,24 +8650,30 @@ Instruction set avr5 is for the enhanced AVR core with up to 128K program
memory space (MCU types: atmega161, atmega163, atmega32, at94k).
@item -msize
+@opindex msize
Output instruction sizes to the asm file.
@item -minit-stack=@var{N}
+@opindex minit-stack
Specify the initial stack address, which may be a symbol or numeric value,
-__stack is the default.
+@samp{__stack} is the default.
@item -mno-interrupts
+@opindex mno-interrupts
Generated code is not compatible with hardware interrupts.
Code size will be smaller.
@item -mcall-prologues
+@opindex mcall-prologues
Functions prologues/epilogues expanded as call to appropriate
-subroutines. Code size will be smaller.
+subroutines. Code size will be smaller.
@item -mno-tablejump
+@opindex mno-tablejump
Do not generate tablejump insns which sometimes increase code size.
@item -mtiny-stack
+@opindex mtiny-stack
Change only the low 8 bits of the stack pointer.
@end table
@@ -7716,54 +8682,81 @@ Change only the low 8 bits of the stack pointer.
@cindex MCore options
These are the @samp{-m} options defined for the Motorola M*Core
-processors.
+processors.
@table @gcctabopt
@item -mhardlit
@itemx -mhardlit
@itemx -mno-hardlit
+@opindex mhardlit
+@opindex mhardlit
+@opindex mno-hardlit
Inline constants into the code stream if it can be done in two
instructions or less.
@item -mdiv
@itemx -mdiv
@itemx -mno-div
+@opindex mdiv
+@opindex mdiv
+@opindex mno-div
Use the divide instruction. (Enabled by default).
@item -mrelax-immediate
@itemx -mrelax-immediate
@itemx -mno-relax-immediate
+@opindex mrelax-immediate
+@opindex mrelax-immediate
+@opindex mno-relax-immediate
Allow arbitrary sized immediates in bit operations.
@item -mwide-bitfields
@itemx -mwide-bitfields
@itemx -mno-wide-bitfields
-Always treat bitfields as int-sized.
+@opindex mwide-bitfields
+@opindex mwide-bitfields
+@opindex mno-wide-bitfields
+Always treat bit-fields as int-sized.
@item -m4byte-functions
@itemx -m4byte-functions
@itemx -mno-4byte-functions
+@opindex m4byte-functions
+@opindex m4byte-functions
+@opindex mno-4byte-functions
Force all functions to be aligned to a four byte boundary.
@item -mcallgraph-data
@itemx -mcallgraph-data
@itemx -mno-callgraph-data
+@opindex mcallgraph-data
+@opindex mcallgraph-data
+@opindex mno-callgraph-data
Emit callgraph information.
@item -mslow-bytes
@itemx -mslow-bytes
@itemx -mno-slow-bytes
+@opindex mslow-bytes
+@opindex mslow-bytes
+@opindex mno-slow-bytes
Prefer word access when reading byte quantities.
@item -mlittle-endian
@itemx -mlittle-endian
@itemx -mbig-endian
+@opindex mlittle-endian
+@opindex mlittle-endian
+@opindex mbig-endian
Generate code for a little endian target.
@item -m210
@itemx -m210
@itemx -m340
+@opindex m210
+@opindex m210
+@opindex m340
Generate code for the 210 processor.
@end table
@@ -7775,66 +8768,87 @@ These are the @samp{-m} options defined for the Intel IA-64 architecture.
@table @gcctabopt
@item -mbig-endian
-Generate code for a big endian target. This is the default for HPUX.
+@opindex mbig-endian
+Generate code for a big endian target. This is the default for HPUX@.
@item -mlittle-endian
+@opindex mlittle-endian
Generate code for a little endian target. This is the default for AIX5
and Linux.
@item -mgnu-as
@itemx -mno-gnu-as
+@opindex mgnu-as
+@opindex mno-gnu-as
Generate (or don't) code for the GNU assembler. This is the default.
-@c Also, this is the default if the configure option @samp{--with-gnu-as}
+@c Also, this is the default if the configure option @option{--with-gnu-as}
@c is used.
@item -mgnu-ld
@itemx -mno-gnu-ld
+@opindex mgnu-ld
+@opindex mno-gnu-ld
Generate (or don't) code for the GNU linker. This is the default.
-@c Also, this is the default if the configure option @samp{--with-gnu-ld}
+@c Also, this is the default if the configure option @option{--with-gnu-ld}
@c is used.
@item -mno-pic
+@opindex mno-pic
Generate code that does not use a global pointer register. The result
-is not position independent code, and violates the IA-64 ABI.
+is not position independent code, and violates the IA-64 ABI@.
@item -mvolatile-asm-stop
@itemx -mno-volatile-asm-stop
+@opindex mvolatile-asm-stop
+@opindex mno-volatile-asm-stop
Generate (or don't) a stop bit immediately before and after volatile asm
statements.
@item -mb-step
+@opindex mb-step
Generate code that works around Itanium B step errata.
@item -mregister-names
@itemx -mno-register-names
+@opindex mregister-names
+@opindex mno-register-names
Generate (or don't) @samp{in}, @samp{loc}, and @samp{out} register names for
the stacked registers. This may make assembler output more readable.
@item -mno-sdata
@itemx -msdata
+@opindex mno-sdata
+@opindex msdata
Disable (or enable) optimizations that use the small data section. This may
be useful for working around optimizer bugs.
@item -mconstant-gp
+@opindex mconstant-gp
Generate code that uses a single constant global pointer value. This is
useful when compiling kernel code.
@item -mauto-pic
-Generate code that is self-relocatable. This implies @samp{-mconstant-gp}.
+@opindex mauto-pic
+Generate code that is self-relocatable. This implies @option{-mconstant-gp}.
This is useful when compiling firmware code.
@item -minline-divide-min-latency
+@opindex minline-divide-min-latency
Generate code for inline divides using the minimum latency algorithm.
@item -minline-divide-max-throughput
+@opindex minline-divide-max-throughput
Generate code for inline divides using the maximum throughput algorithm.
@item -mno-dwarf2-asm
@itemx -mdwarf2-asm
+@opindex mno-dwarf2-asm
+@opindex mdwarf2-asm
Don't (or do) generate assembler code for the DWARF2 line number debugging
info. This may be useful when not using the GNU assembler.
-@item -mfixed-range=@var{register range}
+@item -mfixed-range=@var{register-range}
+@opindex mfixed-range
Generate code treating the given register range as fixed registers.
A fixed register is one that the register allocator can not use. This is
useful when compiling kernel code. A register range is specified as
@@ -7850,14 +8864,17 @@ These @samp{-m} options are defined for D30V implementations:
@table @gcctabopt
@item -mextmem
+@opindex mextmem
Link the @samp{.text}, @samp{.data}, @samp{.bss}, @samp{.strings},
@samp{.rodata}, @samp{.rodata1}, @samp{.data1} sections into external
memory, which starts at location @code{0x80000000}.
@item -mextmemory
-Same as the @samp{-mextmem} switch.
+@opindex mextmemory
+Same as the @option{-mextmem} switch.
@item -monchip
+@opindex monchip
Link the @samp{.text} section into onchip text memory, which starts at
location @code{0x0}. Also link @samp{.data}, @samp{.bss},
@samp{.strings}, @samp{.rodata}, @samp{.rodata1}, @samp{.data1} sections
@@ -7865,20 +8882,261 @@ into onchip data memory, which starts at location @code{0x20000000}.
@item -mno-asm-optimize
@itemx -masm-optimize
-Disable (enable) passing @samp{-O} to the assembler when optimizing.
-The assembler uses the @samp{-O} option to automatically parallelize
+@opindex mno-asm-optimize
+@opindex masm-optimize
+Disable (enable) passing @option{-O} to the assembler when optimizing.
+The assembler uses the @option{-O} option to automatically parallelize
adjacent short instructions where possible.
@item -mbranch-cost=@var{n}
+@opindex mbranch-cost
Increase the internal costs of branches to @var{n}. Higher costs means
that the compiler will issue more instructions to avoid doing a branch.
The default is 2.
@item -mcond-exec=@var{n}
+@opindex mcond-exec
Specify the maximum number of conditionally executed instructions that
replace a branch. The default is 4.
@end table
+@node S/390 and zSeries Options
+@subsection S/390 and zSeries Options
+@cindex S/390 and zSeries Options
+
+These are the @samp{-m} options defined for the S/390 and zSeries architecture.
+
+@table @gcctabopt
+@item -mhard-float
+@itemx -msoft-float
+@opindex mhard-float
+@opindex msoft-float
+Use (do not use) the hardware floating-point instructions and registers
+for floating-point operations. When @option{-msoft-float} is specified,
+functions in @file{libgcc.a} will be used to perform floating-point
+operations. When @option{-mhard-float} is specified, the compiler
+generates IEEE floating-point instructions. This is the default.
+
+@item -mbackchain
+@itemx -mno-backchain
+@opindex mbackchain
+@opindex mno-backchain
+Generate (or do not generate) code which maintains an explicit
+backchain within the stack frame that points to the caller's frame.
+This is currently needed to allow debugging. The default is to
+generate the backchain.
+
+@item -msmall-exec
+@itemx -mno-small-exec
+@opindex msmall-exec
+@opindex mno-small-exec
+Generate (or do not generate) code using the @code{bras} instruction
+to do subroutine calls.
+This only works reliably if the total executable size does not
+exceed 64k. The default is to use the @code{basr} instruction instead,
+which does not have this limitation.
+
+@item -m64
+@itemx -m31
+@opindex m64
+@opindex m31
+When @option{-m31} is specified, generate code compliant to the
+Linux for S/390 ABI@. When @option{-m64} is specified, generate
+code compliant to the Linux for zSeries ABI@. This allows GCC in
+particular to generate 64-bit instructions. For the @samp{s390}
+targets, the default is @option{-m31}, while the @samp{s390x}
+targets default to @option{-m64}.
+
+@item -mmvcle
+@itemx -mno-mvcle
+@opindex mmvcle
+@opindex mno-mvcle
+Generate (or do not generate) code using the @code{mvcle} instruction
+to perform block moves. When @option{-mno-mvcle} is specifed,
+use a @code{mvc} loop instead. This is the default.
+
+@item -mdebug
+@itemx -mno-debug
+@opindex mdebug
+@opindex mno-debug
+Print (or do not print) additional debug information when compiling.
+The default is to not print debug information.
+
+@end table
+
+@node Xtensa Options
+@subsection Xtensa Options
+@cindex Xtensa Options
+
+The Xtensa architecture is designed to support many different
+configurations. The compiler's default options can be set to match a
+particular Xtensa configuration by copying a configuration file into the
+GCC sources when building GCC@. The options below may be used to
+override the default options.
+
+@table @gcctabopt
+@item -mbig-endian
+@itemx -mlittle-endian
+@opindex mbig-endian
+@opindex mlittle-endian
+Specify big-endian or little-endian byte ordering for the target Xtensa
+processor.
+
+@item -mdensity
+@itemx -mno-density
+@opindex mdensity
+@opindex mno-density
+Enable or disable use of the optional Xtensa code density instructions.
+
+@item -mmac16
+@itemx -mno-mac16
+@opindex mmac16
+@opindex mno-mac16
+Enable or disable use of the Xtensa MAC16 option. When enabled, GCC
+will generate MAC16 instructions from standard C code, with the
+limitation that it will use neither the MR register file nor any
+instruction that operates on the MR registers. When this option is
+disabled, GCC will translate 16-bit multiply/accumulate operations to a
+combination of core instructions and library calls, depending on whether
+any other multiplier options are enabled.
+
+@item -mmul16
+@itemx -mno-mul16
+@opindex mmul16
+@opindex mno-mul16
+Enable or disable use of the 16-bit integer multiplier option. When
+enabled, the compiler will generate 16-bit multiply instructions for
+multiplications of 16 bits or smaller in standard C code. When this
+option is disabled, the compiler will either use 32-bit multiply or
+MAC16 instructions if they are available or generate library calls to
+perform the multiply operations using shifts and adds.
+
+@item -mmul32
+@itemx -mno-mul32
+@opindex mmul32
+@opindex mno-mul32
+Enable or disable use of the 32-bit integer multiplier option. When
+enabled, the compiler will generate 32-bit multiply instructions for
+multiplications of 32 bits or smaller in standard C code. When this
+option is disabled, the compiler will generate library calls to perform
+the multiply operations using either shifts and adds or 16-bit multiply
+instructions if they are available.
+
+@item -mnsa
+@itemx -mno-nsa
+@opindex mnsa
+@opindex mno-nsa
+Enable or disable use of the optional normalization shift amount
+(@code{NSA}) instructions to implement the built-in @code{ffs} function.
+
+@item -mminmax
+@itemx -mno-minmax
+@opindex mminmax
+@opindex mno-minmax
+Enable or disable use of the optional minimum and maximum value
+instructions.
+
+@item -msext
+@itemx -mno-sext
+@opindex msext
+@opindex mno-sext
+Enable or disable use of the optional sign extend (@code{SEXT})
+instruction.
+
+@item -mbooleans
+@itemx -mno-booleans
+@opindex mbooleans
+@opindex mno-booleans
+Enable or disable support for the boolean register file used by Xtensa
+coprocessors. This is not typically useful by itself but may be
+required for other options that make use of the boolean registers (e.g.,
+the floating-point option).
+
+@item -mhard-float
+@itemx -msoft-float
+@opindex mhard-float
+@opindex msoft-float
+Enable or disable use of the floating-point option. When enabled, GCC
+generates floating-point instructions for 32-bit @code{float}
+operations. When this option is disabled, GCC generates library calls
+to emulate 32-bit floating-point operations using integer instructions.
+Regardless of this option, 64-bit @code{double} operations are always
+emulated with calls to library functions.
+
+@item -mfused-madd
+@itemx -mno-fused-madd
+@opindex mfused-madd
+@opindex mno-fused-madd
+Enable or disable use of fused multiply/add and multiply/subtract
+instructions in the floating-point option. This has no effect if the
+floating-point option is not also enabled. Disabling fused multiply/add
+and multiply/subtract instructions forces the compiler to use separate
+instructions for the multiply and add/subtract operations. This may be
+desirable in some cases where strict IEEE 754-compliant results are
+required: the fused multiply add/subtract instructions do not round the
+intermediate result, thereby producing results with @emph{more} bits of
+precision than specified by the IEEE standard. Disabling fused multiply
+add/subtract instructions also ensures that the program output is not
+sensitive to the compiler's ability to combine multiply and add/subtract
+operations.
+
+@item -mserialize-volatile
+@itemx -mno-serialize-volatile
+@opindex mserialize-volatile
+@opindex mno-serialize-volatile
+When this option is enabled, GCC inserts @code{MEMW} instructions before
+@code{volatile} memory references to guarantee sequential consistency.
+The default is @option{-mserialize-volatile}. Use
+@option{-mno-serialize-volatile} to omit the @code{MEMW} instructions.
+
+@item -mtext-section-literals
+@itemx -mno-text-section-literals
+@opindex mtext-section-literals
+@opindex mno-text-section-literals
+Control the treatment of literal pools. The default is
+@option{-mno-text-section-literals}, which places literals in a separate
+section in the output file. This allows the literal pool to be placed
+in a data RAM/ROM, and it also allows the linker to combine literal
+pools from separate object files to remove redundant literals and
+improve code size. With @option{-mtext-section-literals}, the literals
+are interspersed in the text section in order to keep them as close as
+possible to their references. This may be necessary for large assembly
+files.
+
+@item -mtarget-align
+@itemx -mno-target-align
+@opindex mtarget-align
+@opindex mno-target-align
+When this option is enabled, GCC instructs the assembler to
+automatically align instructions to reduce branch penalties at the
+expense of some code density. The assembler attempts to widen density
+instructions to align branch targets and the instructions following call
+instructions. If there are not enough preceding safe density
+instructions to align a target, no widening will be performed. The
+default is @option{-mtarget-align}. These options do not affect the
+treatment of auto-aligned instructions like @code{LOOP}, which the
+assembler will always align, either by widening density instructions or
+by inserting no-op instructions.
+
+@item -mlongcalls
+@itemx -mno-longcalls
+@opindex mlongcalls
+@opindex mno-longcalls
+When this option is enabled, GCC instructs the assembler to translate
+direct calls to indirect calls unless it can determine that the target
+of a direct call is in the range allowed by the call instruction. This
+translation typically occurs for calls to functions in other source
+files. Specifically, the assembler translates a direct @code{CALL}
+instruction into an @code{L32R} followed by a @code{CALLX} instruction.
+The default is @option{-mno-longcalls}. This option should be used in
+programs where the call target can potentially be out of range. This
+option is implemented in the assembler, not the compiler, so the
+assembly code generated by GCC will still show direct call
+instructions---look at the disassembled object code to see the actual
+instructions. Note that the assembler will use an indirect call for
+every cross-file call, not just those that really will be out of range.
+@end table
+
@node Code Gen Options
@section Options for Code Generation Conventions
@cindex code generation conventions
@@ -7889,32 +9147,44 @@ These machine-independent options control the interface conventions
used in code generation.
Most of them have both positive and negative forms; the negative form
-of @samp{-ffoo} would be @samp{-fno-foo}. In the table below, only
+of @option{-ffoo} would be @option{-fno-foo}. In the table below, only
one of the forms is listed---the one which is not the default. You
can figure out the other form by either removing @samp{no-} or adding
it.
@table @gcctabopt
@item -fexceptions
-Enable exception handling. Generates extra code needed to propagate
-exceptions. For some targets, this implies GNU CC will generate frame
+@opindex fexceptions
+Enable exception handling. Generates extra code needed to propagate
+exceptions. For some targets, this implies GCC will generate frame
unwind information for all functions, which can produce significant data
size overhead, although it does not affect execution. If you do not
-specify this option, GNU CC will enable it by default for languages like
-C++ which normally require exception handling, and disable itfor
+specify this option, GCC will enable it by default for languages like
+C++ which normally require exception handling, and disable it for
languages like C that do not normally require it. However, you may need
to enable this option when compiling C code that needs to interoperate
properly with exception handlers written in C++. You may also wish to
disable this option if you are compiling older C++ programs that don't
use exception handling.
+@item -fnon-call-exceptions
+@opindex fnon-call-exceptions
+Generate code that allows trapping instructions to throw exceptions.
+Note that this requires platform-specific runtime support that does
+not exist everywhere. Moreover, it only allows @emph{trapping}
+instructions to throw exceptions, i.e.@: memory references or floating
+point instructions. It does not allow exceptions to be thrown from
+arbitrary signal handlers such as @code{SIGALRM}.
+
@item -funwind-tables
+@opindex funwind-tables
Similar to @option{-fexceptions}, except that it will just generate any needed
static data, but will not affect the generated code in any other way.
You will normally not enable this option; instead, a language processor
that needs this handling would enable it on your behalf.
@item -fpcc-struct-return
+@opindex fpcc-struct-return
Return ``short'' @code{struct} and @code{union} values in memory like
longer ones, rather than in registers. This convention is less
efficient, but it has the advantage of allowing intercallability between
@@ -7927,26 +9197,30 @@ Short structures and unions are those whose size and alignment match
that of some integer type.
@item -freg-struct-return
+@opindex freg-struct-return
Use the convention that @code{struct} and @code{union} values are
returned in registers when possible. This is more efficient for small
-structures than @samp{-fpcc-struct-return}.
+structures than @option{-fpcc-struct-return}.
-If you specify neither @samp{-fpcc-struct-return} nor its contrary
-@samp{-freg-struct-return}, GCC defaults to whichever convention is
+If you specify neither @option{-fpcc-struct-return} nor its contrary
+@option{-freg-struct-return}, GCC defaults to whichever convention is
standard for the target. If there is no standard convention, GCC
-defaults to @samp{-fpcc-struct-return}, except on targets where GCC
+defaults to @option{-fpcc-struct-return}, except on targets where GCC
is the principal compiler. In those cases, we can choose the standard,
and we chose the more efficient register return alternative.
@item -fshort-enums
+@opindex fshort-enums
Allocate to an @code{enum} type only as many bytes as it needs for the
declared range of possible values. Specifically, the @code{enum} type
will be equivalent to the smallest integer type which has enough room.
@item -fshort-double
+@opindex fshort-double
Use the same size for @code{double} as for @code{float}.
@item -fshared-data
+@opindex fshared-data
Requests that the data and non-@code{const} variables of this
compilation be shared data rather than private data. The distinction
makes sense only on certain operating systems, where shared data is
@@ -7954,7 +9228,8 @@ shared between processes running the same program, while private data
exists in one copy per process.
@item -fno-common
-Allocate even uninitialized global variables in the data section of the
+@opindex fno-common
+In C, allocate even uninitialized global variables in the data section of the
object file, rather than generating them as common blocks. This has the
effect that if the same variable is declared (without @code{extern}) in
two different compilations, you will get an error when you link them.
@@ -7962,9 +9237,11 @@ The only reason this might be useful is if you wish to verify that the
program will work on other systems which always work this way.
@item -fno-ident
+@opindex fno-ident
Ignore the @samp{#ident} directive.
@item -fno-gnu-linker
+@opindex fno-gnu-linker
Do not output global initializations (such as C++ constructors and
destructors) in the form used by the GNU linker (on systems where the GNU
linker is the standard method of handling them). Use this option when
@@ -7975,6 +9252,7 @@ distribution.) For systems which @emph{must} use @command{collect2}, the
compiler driver @command{gcc} is configured to do this automatically.
@item -finhibit-size-directive
+@opindex finhibit-size-directive
Don't output a @code{.size} assembler directive, or anything else that
would cause trouble if the function is split in the middle, and the
two halves are placed at locations far apart in memory. This option is
@@ -7982,37 +9260,42 @@ used when compiling @file{crtstuff.c}; you should not need to use it
for anything else.
@item -fverbose-asm
+@opindex fverbose-asm
Put extra commentary information in the generated assembly code to
make it more readable. This option is generally only of use to those
who actually need to read the generated assembly code (perhaps while
debugging the compiler itself).
-@samp{-fno-verbose-asm}, the default, causes the
+@option{-fno-verbose-asm}, the default, causes the
extra information to be omitted and is useful when comparing two assembler
files.
@item -fvolatile
+@opindex fvolatile
Consider all memory references through pointers to be volatile.
@item -fvolatile-global
+@opindex fvolatile-global
Consider all memory references to extern and global data items to
be volatile. GCC does not consider static data items to be volatile
because of this switch.
@item -fvolatile-static
+@opindex fvolatile-static
Consider all memory references to static data to be volatile.
@item -fpic
+@opindex fpic
@cindex global offset table
@cindex PIC
Generate position-independent code (PIC) suitable for use in a shared
library, if supported for the target machine. Such code accesses all
-constant addresses through a global offset table (GOT). The dynamic
+constant addresses through a global offset table (GOT)@. The dynamic
loader resolves the GOT entries when the program starts (the dynamic
loader is not part of GCC; it is part of the operating system). If
the GOT size for the linked executable exceeds a machine-specific
maximum size, you get an error message from the linker indicating that
-@samp{-fpic} does not work; in that case, recompile with @samp{-fPIC}
+@option{-fpic} does not work; in that case, recompile with @option{-fPIC}
instead. (These maximums are 16k on the m88k, 8k on the Sparc, and 32k
on the m68k and RS/6000. The 386 has no such limit.)
@@ -8022,6 +9305,7 @@ but not for the Sun 386i. Code generated for the IBM RS/6000 is always
position-independent.
@item -fPIC
+@opindex fPIC
If supported for the target machine, emit position-independent code,
suitable for dynamic linking and avoiding any limit on the size of the
global offset table. This option makes a difference on the m68k, m88k,
@@ -8031,6 +9315,7 @@ Position-independent code requires special support, and therefore works
only on certain machines.
@item -ffixed-@var{reg}
+@opindex ffixed
Treat the register named @var{reg} as a fixed register; generated code
should never refer to it (except perhaps as a stack pointer, frame
pointer or in some other fixed role).
@@ -8043,6 +9328,7 @@ This flag does not have a negative form, because it specifies a
three-way choice.
@item -fcall-used-@var{reg}
+@opindex fcall-used
Treat the register named @var{reg} as an allocable register that is
clobbered by function calls. It may be allocated for temporaries or
variables that do not live across a call. Functions compiled this way
@@ -8056,6 +9342,7 @@ This flag does not have a negative form, because it specifies a
three-way choice.
@item -fcall-saved-@var{reg}
+@opindex fcall-saved
Treat the register named @var{reg} as an allocable register saved by
functions. It may be allocated even for temporaries or variables that
live across a call. Functions compiled this way will save and restore
@@ -8072,11 +9359,13 @@ This flag does not have a negative form, because it specifies a
three-way choice.
@item -fpack-struct
+@opindex fpack-struct
Pack all structure members together without holes. Usually you would
not want to use this option, since it makes the code suboptimal, and
the offsets of structure members won't agree with system libraries.
@item -fcheck-memory-usage
+@opindex fcheck-memory-usage
Generate extra code to check each memory access. GCC will generate
code that is suitable for a detector of bad memory accesses such as
@file{Checker}.
@@ -8092,22 +9381,22 @@ If you do not, you might get erroneous messages from the detector.
If you use functions from a library that have side-effects (such as
@code{read}), you might not be able to recompile the library and
specify this option. In that case, you can enable the
-@samp{-fprefix-function-name} option, which requests GCC to encapsulate
+@option{-fprefix-function-name} option, which requests GCC to encapsulate
your code and make other functions look as if they were compiled with
-@samp{-fcheck-memory-usage}. This is done by calling ``stubs'',
+@option{-fcheck-memory-usage}. This is done by calling ``stubs'',
which are provided by the detector. If you cannot find or build
stubs for every function you call, you might have to specify
-@samp{-fcheck-memory-usage} without @samp{-fprefix-function-name}.
+@option{-fcheck-memory-usage} without @option{-fprefix-function-name}.
If you specify this option, you can not use the @code{asm} or
-@code{__asm__} keywords in functions with memory checking enabled. GNU
-CC cannot understand what the @code{asm} statement may do, and therefore
+@code{__asm__} keywords in functions with memory checking enabled. GCC
+cannot understand what the @code{asm} statement may do, and therefore
cannot generate the appropriate code, so it will reject it. However, if
you specify the function attribute @code{no_check_memory_usage}
-(@pxref{Function Attributes}), GNU CC will disable memory checking within a
+(@pxref{Function Attributes}), GCC will disable memory checking within a
function; you may use @code{asm} statements inside such functions. You
may have an inline expansion of a non-checked function within a checked
-function; in that case GNU CC will not generate checks for the inlined
+function; in that case GCC will not generate checks for the inlined
function's memory accesses.
If you move your @code{asm} statements to non-checked inline functions
@@ -8116,12 +9405,13 @@ inline function, to indicate any reads, writes, or copies being done.
These calls would be similar to those done in the stubs described above.
@item -fprefix-function-name
+@opindex fprefix-function-name
Request GCC to add a prefix to the symbols generated for function names.
GCC adds a prefix to the names of functions defined as well as
functions called. Code compiled with this option and code compiled
without the option can't be linked together, unless stubs are used.
-If you compile the following code with @samp{-fprefix-function-name}
+If you compile the following code with @option{-fprefix-function-name}
@example
extern void bar (int);
void
@@ -8141,9 +9431,10 @@ prefix_foo (int a)
return prefix_bar (a + 5);
@}
@end example
-This option is designed to be used with @samp{-fcheck-memory-usage}.
+This option is designed to be used with @option{-fcheck-memory-usage}.
@item -finstrument-functions
+@opindex finstrument-functions
Generate instrumentation calls for entry and exit to functions. Just
after function entry and just before function exit, the following
profiling functions will be called with the address of the current
@@ -8153,8 +9444,10 @@ function, so the call site information may not be available to the
profiling functions otherwise.)
@example
-void __cyg_profile_func_enter (void *this_fn, void *call_site);
-void __cyg_profile_func_exit (void *this_fn, void *call_site);
+void __cyg_profile_func_enter (void *this_fn,
+ void *call_site);
+void __cyg_profile_func_exit (void *this_fn,
+ void *call_site);
@end example
The first argument is the address of the start of the current function,
@@ -8179,6 +9472,7 @@ cannot safely be called (perhaps signal handlers, if the profiling
routines generate output or allocate memory).
@item -fstack-check
+@opindex fstack-check
Generate code to verify that you do not go beyond the boundary of the
stack. You should specify this flag if you are running in an
environment with multiple threads, but only rarely need to specify it in
@@ -8192,6 +9486,9 @@ to ensure that the operating system sees the stack being extended.
@item -fstack-limit-register=@var{reg}
@itemx -fstack-limit-symbol=@var{sym}
@itemx -fno-stack-limit
+@opindex fstack-limit-register
+@opindex fstack-limit-symbol
+@opindex fno-stack-limit
Generate code to ensure that the stack does not grow beyond a certain value,
either the value of a register or the address of a symbol. If the stack
would grow beyond the value, a signal is raised. For most targets,
@@ -8200,30 +9497,34 @@ it is possible to catch the signal without taking special precautions.
For instance, if the stack starts at address @samp{0x80000000} and grows
downwards you can use the flags
-@samp{-fstack-limit-symbol=__stack_limit}
-@samp{-Wl,--defsym,__stack_limit=0x7ffe0000} which will enforce a stack
-limit of 128K.
+@samp{-fstack-limit-symbol=__stack_limit
+-Wl,--defsym,__stack_limit=0x7ffe0000} which will enforce a stack
+limit of 128K@.
@cindex aliasing of parameters
@cindex parameters, aliased
@item -fargument-alias
@itemx -fargument-noalias
@itemx -fargument-noalias-global
+@opindex fargument-alias
+@opindex fargument-noalias
+@opindex fargument-noalias-global
Specify the possible relationships among parameters and between
parameters and global data.
-@samp{-fargument-alias} specifies that arguments (parameters) may
+@option{-fargument-alias} specifies that arguments (parameters) may
alias each other and may alias global storage.
-@samp{-fargument-noalias} specifies that arguments do not alias
+@option{-fargument-noalias} specifies that arguments do not alias
each other, but may alias global storage.
-@samp{-fargument-noalias-global} specifies that arguments do not
+@option{-fargument-noalias-global} specifies that arguments do not
alias each other and do not alias global storage.
Each language will automatically use whatever option is required by
the language standard. You should not need to use these options yourself.
@item -fleading-underscore
-This option and its counterpart, -fno-leading-underscore, forcibly
+@opindex fleading-underscore
+This option and its counterpart, @option{-fno-leading-underscore}, forcibly
change the way C symbols are represented in the object file. One use
is to help link with legacy assembly code.
@@ -8241,21 +9542,21 @@ option, and that not all targets provide complete support for it.
This section describes several environment variables that affect how GCC
operates. Some of them work by specifying directories or prefixes to use
-when searching for various kinds of files. Some are used to specify other
+when searching for various kinds of files. Some are used to specify other
aspects of the compilation environment.
@ifclear INTERNALS
Note that you can also specify places to search using options such as
-@samp{-B}, @samp{-I} and @samp{-L} (@pxref{Directory Options}). These
+@option{-B}, @option{-I} and @option{-L} (@pxref{Directory Options}). These
take precedence over places specified using environment variables, which
-in turn take precedence over those specified by the configuration of GCC.
+in turn take precedence over those specified by the configuration of GCC@.
@end ifclear
@ifset INTERNALS
Note that you can also specify places to search using options such as
-@samp{-B}, @samp{-I} and @samp{-L} (@pxref{Directory Options}). These
+@option{-B}, @option{-I} and @option{-L} (@pxref{Directory Options}). These
take precedence over places specified using environment variables, which
-in turn take precedence over those specified by the configuration of GCC.
+in turn take precedence over those specified by the configuration of GCC@.
@xref{Driver}.
@end ifset
@@ -8315,7 +9616,7 @@ names of the subprograms executed by the compiler. No slash is added
when this prefix is combined with the name of a subprogram, but you can
specify a prefix that ends with a slash if you wish.
-If @env{GCC_EXEC_PREFIX} is not set, GNU CC will attempt to figure out
+If @env{GCC_EXEC_PREFIX} is not set, GCC will attempt to figure out
an appropriate prefix to use based on the pathname it was invoked with.
If GCC cannot find the subprogram using the specified prefix, it
@@ -8325,7 +9626,7 @@ The default value of @env{GCC_EXEC_PREFIX} is
@file{@var{prefix}/lib/gcc-lib/} where @var{prefix} is the value
of @code{prefix} when you ran the @file{configure} script.
-Other prefixes specified with @samp{-B} take precedence over this prefix.
+Other prefixes specified with @option{-B} take precedence over this prefix.
This prefix is also used for finding files such as @file{crt0.o} that are
used for linking.
@@ -8335,7 +9636,7 @@ directories to search for header files. For each of the standard
directories whose name normally begins with @samp{/usr/local/lib/gcc-lib}
(more precisely, with the value of @env{GCC_INCLUDE_DIR}), GCC tries
replacing that beginning with the specified prefix to produce an
-alternate directory name. Thus, with @samp{-Bfoo/}, GCC will search
+alternate directory name. Thus, with @option{-Bfoo/}, GCC will search
@file{foo/bar} where it would normally search @file{/usr/local/lib/bar}.
These alternate directories are searched first; the standard directories
come next.
@@ -8354,8 +9655,8 @@ directories, much like @env{PATH}. When configured as a native compiler,
GCC tries the directories thus specified when searching for special
linker files, if it can't find them using @env{GCC_EXEC_PREFIX}. Linking
using GCC also uses these directories when searching for ordinary
-libraries for the @samp{-l} option (but directories specified with
-@samp{-L} come first).
+libraries for the @option{-l} option (but directories specified with
+@option{-L} come first).
@item C_INCLUDE_PATH
@itemx CPLUS_INCLUDE_PATH
@@ -8368,7 +9669,7 @@ These environment variables pertain to particular languages. Each
variable's value is a colon-separated list of directories, much like
@env{PATH}. When GCC searches for header files, it tries the
directories listed in the variable for the language you are using, after
-the directories specified with @samp{-I} but before the standard header
+the directories specified with @option{-I} but before the standard header
file directories.
@item DEPENDENCIES_OUTPUT
@@ -8376,7 +9677,7 @@ file directories.
@cindex dependencies for make as output
If this variable is set, its value specifies how to output dependencies
for Make based on the header files processed by the compiler. This
-output looks much like the output from the @samp{-M} option
+output looks much like the output from the @option{-M} option
(@pxref{Preprocessor Options}), but it goes to a separate file, and is
in addition to the usual results of compilation.
@@ -8389,7 +9690,7 @@ file @var{file} using @var{target} as the target name.
@item LANG
@findex LANG
@cindex locale definition
-This variable is used to pass locale information to the compiler. One way in
+This variable is used to pass locale information to the compiler. One way in
which this information is used is to determine the character set to be used
when character literals, string literals and comments are parsed in C and C++.
When the compiler is configured to allow multibyte characters,
@@ -8414,7 +9715,7 @@ recognize and translate multibyte characters.
@node Running Protoize
@section Running Protoize
-The program @code{protoize} is an optional part of GNU C. You can use
+The program @code{protoize} is an optional part of GCC@. You can use
it to add prototypes to a program, thus converting the program to ISO
C in one respect. The companion program @code{unprotoize} does the
reverse: it removes argument types from any prototypes that are found.
@@ -8431,9 +9732,9 @@ just headers) are eligible as well.
But not all the eligible files are converted. By default,
@code{protoize} and @code{unprotoize} convert only source and header
files in the current directory. You can specify additional directories
-whose files should be converted with the @samp{-d @var{directory}}
+whose files should be converted with the @option{-d @var{directory}}
option. You can also specify particular files to exclude with the
-@samp{-x @var{file}} option. A file is converted if it is eligible, its
+@option{-x @var{file}} option. A file is converted if it is eligible, its
directory name matches one of the specified directory names, and its
name within the directory has not been excluded.
@@ -8454,11 +9755,11 @@ function definitions to the old-style pre-ISO form.
Both conversion programs print a warning for any function declaration or
definition that they can't convert. You can suppress these warnings
-with @samp{-q}.
+with @option{-q}.
The output from @code{protoize} or @code{unprotoize} replaces the
original source file. The original file is renamed to a name ending
-with @samp{.save} (for DOS, the saved filename ends in @samp{.sav}
+with @samp{.save} (for DOS, the saved filename ends in @samp{.sav}
without the original @samp{.c} suffix). If the @samp{.save} (@samp{.sav}
for DOS) file already exists, then the source file is simply discarded.
@@ -8479,7 +9780,7 @@ applies only to @code{protoize}.
@item -c @var{compilation-options}
Use @var{compilation-options} as the options when running @code{gcc} to
-produce the @samp{.X} files. The special option @samp{-aux-info} is
+produce the @samp{.X} files. The special option @option{-aux-info} is
always passed in addition, to tell @code{gcc} to write a @samp{.X} file.
Note that the compilation options must be given as a single argument to
@@ -8488,13 +9789,13 @@ Note that the compilation options must be given as a single argument to
to make them a single word in the shell.
There are certain @code{gcc} arguments that you cannot use, because they
-would produce the wrong kind of output. These include @samp{-g},
-@samp{-O}, @samp{-c}, @samp{-S}, and @samp{-o} If you include these in
+would produce the wrong kind of output. These include @option{-g},
+@option{-O}, @option{-c}, @option{-S}, and @option{-o} If you include these in
the @var{compilation-options}, they are ignored.
@item -C
Rename files to end in @samp{.C} (@samp{.cc} for DOS-based file
-systems) instead of @samp{.c}. This is convenient if you are converting
+systems) instead of @samp{.c}. This is convenient if you are converting
a C program to C++. This option applies only to @code{protoize}.
@item -g
@@ -8512,21 +9813,21 @@ This option applies only to @code{protoize}.
function definitions, where the arguments are declared between the
argument list and the initial @samp{@{}. By default, @code{unprotoize}
uses five spaces as the indentation. If you want to indent with just
-one space instead, use @samp{-i " "}.
+one space instead, use @option{-i " "}.
@item -k
Keep the @samp{.X} files. Normally, they are deleted after conversion
is finished.
@item -l
-Add explicit local declarations. @code{protoize} with @samp{-l} inserts
+Add explicit local declarations. @code{protoize} with @option{-l} inserts
a prototype declaration for each function in each block which calls the
function without any declaration. This option applies only to
@code{protoize}.
@item -n
Make no real changes. This mode just prints information about the conversions
-that would have been done without @samp{-n}.
+that would have been done without @option{-n}.
@item -N
Make no @samp{.save} files. The original files are simply deleted.
@@ -8540,19 +9841,19 @@ Use the program @var{program} as the compiler. Normally, the name
Work quietly. Most warnings are suppressed.
@item -v
-Print the version number, just like @samp{-v} for @code{gcc}.
+Print the version number, just like @option{-v} for @code{gcc}.
@end table
If you need special compiler options to compile one of your program's
source files, then you should generate that file's @samp{.X} file
specially, by running @code{gcc} on that source file with the
-appropriate options and the option @samp{-aux-info}. Then run
+appropriate options and the option @option{-aux-info}. Then run
@code{protoize} on the entire set of files. @code{protoize} will use
the existing @samp{.X} file because it is newer than the source file.
For example:
@example
-gcc -Dfoo=bar file1.c -aux-info
+gcc -Dfoo=bar file1.c -aux-info file1.X
protoize *.c
@end example
@@ -8563,4 +9864,3 @@ exist, because otherwise they won't get converted.
@xref{Protoize Caveats}, for more information on how to use
@code{protoize} successfully.
-
diff --git a/gcc/md.texi b/gcc/doc/md.texi
index b87b87797a7..65f2e57bc9a 100644
--- a/gcc/md.texi
+++ b/gcc/doc/md.texi
@@ -1,4 +1,5 @@
-@c Copyright (C) 1988, 89, 92, 93, 94, 96, 1998, 2000, 2001 Free Software Foundation, Inc.
+@c Copyright (C) 1988, 1989, 1992, 1993, 1994, 1996, 1998, 2000, 2001
+@c Free Software Foundation, Inc.
@c This is part of the GCC manual.
@c For copying conditions, see the file gcc.texi.
@@ -70,7 +71,7 @@ named @code{define_insn} or a @code{define_expand}. The compiler will
choose the pattern with the right name and apply the operands according
to the documentation later in this chapter, without regard for the RTL
template or operand constraints. Note that the names the compiler looks
-for are hard-coded in the compiler - it will ignore unnamed patterns and
+for are hard-coded in the compiler---it will ignore unnamed patterns and
patterns with names it doesn't know about, but if you don't provide a
named pattern it needs, it will abort.
@@ -78,7 +79,7 @@ If a @code{define_insn} is used, the template given is inserted into the
insn list. If a @code{define_expand} is used, one of three things
happens, based on the condition logic. The condition logic may manually
create new insns for the insn list, say via @code{emit_insn()}, and
-invoke DONE. For certain named patterns, it may invoke FAIL to tell the
+invoke @code{DONE}. For certain named patterns, it may invoke @code{FAIL} to tell the
compiler to use an alternate way of performing that task. If it invokes
neither @code{DONE} nor @code{FAIL}, the template given in the pattern
is inserted, as if the @code{define_expand} were a @code{define_insn}.
@@ -270,7 +271,7 @@ it is valid for mode @var{m}.
For an operand that must be a register, @var{predicate} should be
@code{"register_operand"}. Using @code{"general_operand"} would be
valid, since the reload pass would copy any non-register operands
-through registers, but this would make GNU CC do extra work, it would
+through registers, but this would make GCC do extra work, it would
prevent invariant operands (such as constant) from being removed from
loops, and it would prevent the register allocator from doing the best
possible job. On RISC machines, it is usually most efficient to allow
@@ -382,7 +383,7 @@ predicate function, and that function is solely responsible for
deciding whether the expression to be matched ``has'' that mode.
When constructing an insn, argument 3 of the gen-function will specify
-the operation (i.e. the expression code) for the expression to be
+the operation (i.e.@: the expression code) for the expression to be
made. It should be an RTL expression, whose expression code is copied
into a new expression whose operands are arguments 1 and 2 of the
gen-function. The subexpressions of argument 3 are not used;
@@ -425,7 +426,7 @@ vector of @var{subpat} expressions in the @code{match_parallel}, if each
@emph{and} the function @var{predicate} returns nonzero on the
@code{parallel} that is the body of the insn. It is the responsibility
of the predicate to validate elements of the @code{parallel} beyond
-those listed in the @code{match_parallel}.@refill
+those listed in the @code{match_parallel}.
A typical use of @code{match_parallel} is to match load and store
multiple expressions, which can contain a variable number of elements
@@ -841,12 +842,12 @@ value. So why use @samp{s} instead of @samp{i}? Sometimes it allows
better code to be generated.
For example, on the 68000 in a fullword instruction it is possible to
-use an immediate operand; but if the immediate value is between -128
+use an immediate operand; but if the immediate value is between @minus{}128
and 127, better code results from loading the value into a register and
using the register. This is because the load into the register can be
done with a @samp{moveq} instruction. We arrange for this to happen
by defining the letter @samp{K} to mean ``any integer outside the
-range -128 to 127'', and then specifying @samp{Ks} in the operand
+range @minus{}128 to 127'', and then specifying @samp{Ks} in the operand
constraints.
@cindex @samp{g} in constraint
@@ -923,7 +924,7 @@ reference for which the address would be valid.
@cindex other register constraints
@cindex extensible constraints
-@item @var{other letters}
+@item @var{other-letters}
Other letters can be defined in machine-dependent fashion to stand for
particular classes of registers or other arbitrary operand types.
@samp{d}, @samp{a} and @samp{f} are defined on the 68000/68020 to stand
@@ -1197,11 +1198,11 @@ constraints with multiple alternatives, sometimes one alternative
requires @samp{&} while others do not. See, for example, the
@samp{movdf} insn of the 68000.
-An input operand can be tied to an earlyclobber operand if its only
+An input operand can be tied to an earlyclobber operand if its only
use as an input occurs before the early result is written. Adding
alternatives of this form often allows GCC to produce better code
-when only some of the inputs can be affected by the earlyclobber.
-See, for example, the @samp{mulsi3} insn of the ARM.
+when only some of the inputs can be affected by the earlyclobber.
+See, for example, the @samp{mulsi3} insn of the ARM@.
@samp{&} does not obviate the need to write @samp{=}.
@@ -1321,7 +1322,7 @@ instruction. That is, an integer in the range 0 to 255 rotated by a
multiple of 2
@item J
-Integer in the range -4095 to 4095
+Integer in the range @minus{}4095 to 4095
@item K
Integer that satisfies constraint @samp{I} when inverted (ones complement)
@@ -1376,20 +1377,20 @@ Constant greater than 0, less than 0x10000
Constant whose high 24 bits are on (1)
@item L
-16 bit constant whose high 8 bits are on (1)
+16-bit constant whose high 8 bits are on (1)
@item M
-32 bit constant whose high 16 bits are on (1)
+32-bit constant whose high 16 bits are on (1)
@item N
-32 bit negative constant that fits in 8 bits
+32-bit negative constant that fits in 8 bits
@item O
-The constant 0x80000000 or, on the 29050, any 32 bit constant
+The constant 0x80000000 or, on the 29050, any 32-bit constant
whose low 16 bits are 0.
@item P
-16 bit negative constant that fits in 8 bits
+16-bit negative constant that fits in 8 bits
@item G
@itemx H
@@ -1412,10 +1413,10 @@ Registers from r16 to r31
Registers from r24 to r31. These registers can be used in @samp{adiw} command
@item e
-Pointer register (r26 - r31)
+Pointer register (r26--r31)
@item b
-Base pointer register (r28 - r31)
+Base pointer register (r28--r31)
@item q
Stack pointer register (SPH:SPL)
@@ -1433,10 +1434,10 @@ Register pair Y (r29:r28)
Register pair Z (r31:r30)
@item I
-Constant greater than -1, less than 64
+Constant greater than @minus{}1, less than 64
@item J
-Constant greater than -64, less than 1
+Constant greater than @minus{}64, less than 1
@item K
Constant integer 2
@@ -1448,7 +1449,7 @@ Constant integer 0
Constant that fits in 8 bits
@item N
-Constant integer -1
+Constant integer @minus{}1
@item O
Constant integer 8, 16, or 24
@@ -1490,17 +1491,17 @@ Floating point register
@samp{FPMEM} stack memory for FPR-GPR transfers
@item I
-Signed 16 bit constant
+Signed 16-bit constant
@item J
-Unsigned 16 bit constant shifted left 16 bits (use @samp{L} instead for
+Unsigned 16-bit constant shifted left 16 bits (use @samp{L} instead for
@code{SImode} constants)
@item K
-Unsigned 16 bit constant
+Unsigned 16-bit constant
@item L
-Signed 16 bit constant shifted left 16 bits
+Signed 16-bit constant shifted left 16 bits
@item M
Constant larger than 31
@@ -1512,7 +1513,7 @@ Exact power of 2
Zero
@item P
-Constant whose negation is a signed 16 bit constant
+Constant whose negation is a signed 16-bit constant
@item G
Floating point constant that can be loaded into a register with one
@@ -1541,7 +1542,10 @@ System V Release 4 small data area reference
@samp{a}, @code{b}, @code{c}, or @code{d} register
@item A
-@samp{a}, or @code{d} register (for 64-bit ints)
+Specifies the @samp{a} or @samp{d} registers. This is primarily useful
+for 64-bit integer values intended to be returned with the @samp{d}
+register holding the most significant bits and the @samp{a} register
+holding the least significant bits.
@item f
Floating point register
@@ -1571,10 +1575,10 @@ Second floating point register
@samp{si} register
@item I
-Constant in range 0 to 31 (for 32 bit shifts)
+Constant in range 0 to 31 (for 32-bit shifts)
@item J
-Constant in range 0 to 63 (for 64 bit shifts)
+Constant in range 0 to 63 (for 64-bit shifts)
@item K
@samp{0xff}
@@ -1613,7 +1617,7 @@ Integers from 0 to 31
0
@item K
-Integers from -31 to 0
+Integers from @minus{}31 to 0
@item G
Floating point 0
@@ -1646,7 +1650,7 @@ General-purpose integer register
Floating-point status register
@item I
-Signed 16 bit constant (for arithmetic instructions)
+Signed 16-bit constant (for arithmetic instructions)
@item J
Zero
@@ -1658,17 +1662,17 @@ Zero-extended 16-bit constant (for logic instructions)
Constant with low 16 bits zero (can be loaded with @code{lui})
@item M
-32 bit constant which requires two instructions to load (a constant
+32-bit constant which requires two instructions to load (a constant
which is not @samp{I}, @samp{K}, or @samp{L})
@item N
-Negative 16 bit constant
+Negative 16-bit constant
@item O
Exact power of two
@item P
-Positive 16 bit constant
+Positive 16-bit constant
@item G
Floating point zero
@@ -1707,13 +1711,13 @@ First 16 Sun FPA registers, if available
Integer in the range 1 to 8
@item J
-16 bit signed number
+16-bit signed number
@item K
Signed number whose magnitude is greater than 0x80
@item L
-Integer in the range -8 to -1
+Integer in the range @minus{}8 to @minus{}1
@item M
Signed number whose magnitude is greater than 0x100
@@ -1767,19 +1771,19 @@ An address register: x or y
Register pair (x:d) to form a 32-bit value
@item L
-Constants in the range -65536 to 65535
+Constants in the range @minus{}65536 to 65535
@item M
Constants whose 16-bit low part is zero
@item N
-Constant integer 1 or -1
+Constant integer 1 or @minus{}1
@item O
Constant integer 16
@item P
-Constants in the range -8 to 2
+Constants in the range @minus{}8 to 2
@end table
@@ -1787,26 +1791,26 @@ Constants in the range -8 to 2
@item SPARC---@file{sparc.h}
@table @code
@item f
-Floating-point register that can hold 32 or 64 bit values.
+Floating-point register that can hold 32- or 64-bit values.
@item e
-Floating-point register that can hold 64 or 128 bit values.
+Floating-point register that can hold 64- or 128-bit values.
@item I
-Signed 13 bit constant
+Signed 13-bit constant
@item J
Zero
@item K
-32 bit constant with the low 12 bits clear (a constant that can be
+32-bit constant with the low 12 bits clear (a constant that can be
loaded with the @code{sethi} instruction)
@item G
Floating-point zero
@item H
-Signed 13 bit constant, sign-extended to 32 or 64 bits
+Signed 13-bit constant, sign-extended to 32 or 64 bits
@item Q
Floating-point constant whose integral representation can
@@ -1840,22 +1844,22 @@ Auxiliary (address) register (ar0-ar7)
Stack pointer register (sp)
@item c
-Standard (32 bit) precision integer register
+Standard (32-bit) precision integer register
@item f
-Extended (40 bit) precision register (r0-r11)
+Extended (40-bit) precision register (r0-r11)
@item k
Block count register (bk)
@item q
-Extended (40 bit) precision low register (r0-r7)
+Extended (40-bit) precision low register (r0-r7)
@item t
-Extended (40 bit) precision register (r0-r1)
+Extended (40-bit) precision register (r0-r1)
@item u
-Extended (40 bit) precision register (r2-r3)
+Extended (40-bit) precision register (r2-r3)
@item v
Repeat count register (rc)
@@ -1873,37 +1877,37 @@ Data page register (dp)
Floating-point zero
@item H
-Immediate 16 bit floating-point constant
+Immediate 16-bit floating-point constant
@item I
-Signed 16 bit constant
+Signed 16-bit constant
@item J
-Signed 8 bit constant
+Signed 8-bit constant
@item K
-Signed 5 bit constant
+Signed 5-bit constant
@item L
-Unsigned 16 bit constant
+Unsigned 16-bit constant
@item M
-Unsigned 8 bit constant
+Unsigned 8-bit constant
@item N
-Ones complement of unsigned 16 bit constant
+Ones complement of unsigned 16-bit constant
@item O
-High 16 bit constant (32 bit constant with 16 LSBs zero)
+High 16-bit constant (32-bit constant with 16 LSBs zero)
@item Q
-Indirect memory reference with signed 8 bit or index register displacement
+Indirect memory reference with signed 8-bit or index register displacement
@item R
-Indirect memory reference with unsigned 5 bit displacement
+Indirect memory reference with unsigned 5-bit displacement
@item S
-Indirect memory reference with 1 bit or index register displacement
+Indirect memory reference with 1 bit or index register displacement
@item T
Direct memory reference
@@ -1912,6 +1916,63 @@ Direct memory reference
Symbolic address
@end table
+
+@item S/390 and zSeries---@file{s390.h}
+@table @code
+@item a
+Address register (general purpose register except r0)
+
+@item d
+Data register (arbitrary general purpose register)
+
+@item f
+Floating-point register
+
+@item I
+Unsigned 8-bit constant (0--255)
+
+@item J
+Unsigned 12-bit constant (0--4095)
+
+@item K
+Signed 16-bit constant (@minus{}32768--32767)
+
+@item L
+Unsigned 16-bit constant (0--65535)
+
+@item Q
+Memory reference without index register
+
+@item S
+Symbolic constant suitable for use with the @code{larl} instruction
+
+@end table
+
+@item Xtensa---@file{xtensa.h}
+@table @code
+@item a
+General-purpose 32-bit register
+
+@item b
+One-bit boolean register
+
+@item A
+MAC16 40-bit accumulator register
+
+@item I
+Signed 12-bit integer constant, for use in MOVI instructions
+
+@item J
+Signed 8-bit integer constant, for use in ADDI instructions
+
+@item K
+Integer constant valid for BccI instructions
+
+@item L
+Unsigned constant valid for BccUI instructions
+
+@end table
+
@end table
@ifset INTERNALS
@@ -2328,7 +2389,7 @@ point.
@cindex @code{extv} instruction pattern
@item @samp{extv}
-Extract a bit field from operand 1 (a register or memory operand), where
+Extract a bit-field from operand 1 (a register or memory operand), where
operand 2 specifies the width in bits and operand 3 the starting bit,
and store it in operand 0. Operand 0 must have mode @code{word_mode}.
Operand 1 may have mode @code{byte_mode} or @code{word_mode}; often
@@ -2347,8 +2408,8 @@ Like @samp{extv} except that the bit-field value is zero-extended.
@cindex @code{insv} instruction pattern
@item @samp{insv}
-Store operand 3 (which must be valid for @code{word_mode}) into a bit
-field in operand 0, where operand 1 specifies the width in bits and
+Store operand 3 (which must be valid for @code{word_mode}) into a
+bit-field in operand 0, where operand 1 specifies the width in bits and
operand 2 the starting bit. Operand 0 may have mode @code{byte_mode} or
@code{word_mode}; often @code{word_mode} is allowed only for registers.
Operands 1 and 2 must be valid for @code{word_mode}.
@@ -2463,11 +2524,11 @@ insn.
@cindex @code{call_value_pop} instruction pattern
@item @samp{call_pop}, @samp{call_value_pop}
Similar to @samp{call} and @samp{call_value}, except used if defined and
-if @code{RETURN_POPS_ARGS} is non-zero. They should emit a @code{parallel}
+if @code{RETURN_POPS_ARGS} is nonzero. They should emit a @code{parallel}
that contains both the function call and a @code{set} to indicate the
adjustment made to the frame pointer.
-For machines where @code{RETURN_POPS_ARGS} can be non-zero, the use of these
+For machines where @code{RETURN_POPS_ARGS} can be nonzero, the use of these
patterns increases the number of functions for which the frame pointer
can be eliminated, if desired.
@@ -2483,8 +2544,8 @@ This instruction pattern should be defined to support
@code{__builtin_apply} on machines where special instructions are needed
to call a subroutine with arbitrary arguments or to save the value
returned. This instruction pattern is required on machines that have
-multiple registers that can hold a return value (i.e.
-@code{FUNCTION_VALUE_REGNO_P} is true for more than one register).
+multiple registers that can hold a return value
+(i.e.@: @code{FUNCTION_VALUE_REGNO_P} is true for more than one register).
@cindex @code{return} instruction pattern
@item @samp{return}
@@ -2502,7 +2563,7 @@ to save any registers or allocate stack space.
@findex reload_completed
@findex leaf_function_p
For such machines, the condition specified in this pattern should only
-be true when @code{reload_completed} is non-zero and the function's
+be true when @code{reload_completed} is nonzero and the function's
epilogue would only be a single instruction. For machines with register
windows, the routine @code{leaf_function_p} may be used to determine if
a register window push is required.
@@ -2601,9 +2662,9 @@ that the jump optimizer will not delete the table as unreachable code.
@cindex @code{decrement_and_branch_until_zero} instruction pattern
@item @samp{decrement_and_branch_until_zero}
Conditional branch instruction that decrements a register and
-jumps if the register is non-zero. Operand 0 is the register to
+jumps if the register is nonzero. Operand 0 is the register to
decrement and test; operand 1 is the label to jump to if the
-register is non-zero. @xref{Looping Patterns}.
+register is nonzero. @xref{Looping Patterns}.
This optional instruction pattern is only used by the combiner,
typically for loops reversed by the loop optimizer when strength
@@ -2612,13 +2673,13 @@ reduction is enabled.
@cindex @code{doloop_end} instruction pattern
@item @samp{doloop_end}
Conditional branch instruction that decrements a register and jumps if
-the register is non-zero. This instruction takes five operands: Operand
+the register is nonzero. This instruction takes five operands: Operand
0 is the register to decrement and test; operand 1 is the number of loop
iterations as a @code{const_int} or @code{const0_rtx} if this cannot be
determined until run-time; operand 2 is the actual or estimated maximum
number of iterations as a @code{const_int}; operand 3 is the number of
enclosed loops as a @code{const_int} (an innermost loop has a value of
-1); operand 4 is the label to jump to if the register is non-zero.
+1); operand 4 is the label to jump to if the register is nonzero.
@xref{Looping Patterns}.
This optional instruction pattern should be defined for machines with
@@ -2767,7 +2828,7 @@ the third is the address of a location where the stack is saved,
and the last is the address of the label, to be placed in the
location for the incoming static chain.
-On most machines you need not define this pattern, since GNU CC will
+On most machines you need not define this pattern, since GCC will
already generate the correct code, which is to load the frame pointer
and static chain, restore the stack (using the
@samp{restore_stack_nonlocal} pattern, if defined), and jump indirectly
@@ -2777,7 +2838,7 @@ not work on your machine.
@cindex @code{nonlocal_goto_receiver} instruction pattern
@item @samp{nonlocal_goto_receiver}
This pattern, if defined, contains code needed at the target of a
-nonlocal goto after the code already generated by GNU CC. You will not
+nonlocal goto after the code already generated by GCC@. You will not
normally need to define this pattern. A typical reason why you might
need this pattern is if some value, such as a pointer to a global table,
must be restored when the frame pointer is restored. Note that a nonlocal
@@ -2808,7 +2869,7 @@ the first three are normally used by the generic mechanism.
@cindex @code{builtin_setjmp_receiver} instruction pattern
@item @samp{builtin_setjmp_receiver}
This pattern, if defined, contains code needed at the site of an
-builtin setjmp that isn't needed at the site of a nonlocal goto. You
+built-in setjmp that isn't needed at the site of a nonlocal goto. You
will not normally need to define this pattern. A typical reason why you
might need this pattern is if some value, such as a pointer to a global
table, must be restored. It takes one argument, which is the label
@@ -2822,26 +2883,24 @@ You will not normally need to define this pattern unless you also define
@code{builtin_setjmp_setup}. The single argument is a pointer to the
@code{jmp_buf}.
-@cindex @code{eh_epilogue} instruction pattern
-@item @samp{eh_epilogue}
+@cindex @code{eh_return} instruction pattern
+@item @samp{eh_return}
This pattern, if defined, affects the way @code{__builtin_eh_return},
-and thence @code{__throw} are built. It is intended to allow communication
-between the exception handling machinery and the normal epilogue code
-for the target.
-
-The pattern takes three arguments. The first is the exception context
-pointer. This will have already been copied to the function return
-register appropriate for a pointer; normally this can be ignored. The
-second argument is an offset to be added to the stack pointer. It will
-have been copied to some arbitrary call-clobbered hard reg so that it
-will survive until after reload to when the normal epilogue is generated.
-The final argument is the address of the exception handler to which
+and thence the call frame exception handling library routines, are
+built. It is intended to handle non-trivial actions needed along
+the abnormal return path.
+
+The pattern takes two arguments. The first is an offset to be applied
+to the stack pointer. It will have been copied to some appropriate
+location (typically @code{EH_RETURN_STACKADJ_RTX}) which will survive
+until after reload to when the normal epilogue is generated.
+The second argument is the address of the exception handler to which
the function should return. This will normally need to copied by the
-pattern to some special register.
+pattern to some special register or memory location.
-This pattern must be defined if @code{RETURN_ADDR_RTX} does not yield
-something that can be reliably and permanently modified, i.e. a fixed
-hard register or a stack memory reference.
+This pattern only needs to be defined if call frame exception handling
+is to be used, and simple moves to @code{EH_RETURN_STACKADJ_RTX} and
+@code{EH_RETURN_HANDLER_RTX} are not sufficient.
@cindex @code{prologue} instruction pattern
@item @samp{prologue}
@@ -2875,13 +2934,13 @@ sibling call (aka tail call) sites.
The @code{sibcall_epilogue} pattern must not clobber any arguments used for
parameter passing or any stack slots for arguments passed to the current
-function.
+function.
@cindex @code{trap} instruction pattern
@item @samp{trap}
This pattern, if defined, signals an error, typically by causing some
kind of signal to be raised. Among other places, it is used by the Java
-frontend to signal `invalid array index' exceptions.
+front end to signal `invalid array index' exceptions.
@cindex @code{conditional_trap} instruction pattern
@item @samp{conditional_trap}
@@ -2892,7 +2951,7 @@ A typical @code{conditional_trap} pattern looks like
@smallexample
(define_insn "conditional_trap"
- [(trap_if (match_operator 0 "trap_operator"
+ [(trap_if (match_operator 0 "trap_operator"
[(cc0) (const_int 0)])
(match_operand 1 "const_int_operand" "i"))]
""
@@ -3017,7 +3076,7 @@ generating the appropriate machine instruction.
@cindex jump instruction patterns
@cindex defining jump instruction patterns
-For most machines, GNU CC assumes that the machine has a condition code.
+For most machines, GCC assumes that the machine has a condition code.
A comparison insn sets the condition code, recording the results of both
signed and unsigned comparison of the given operands. A separate branch
insn tests the condition code and branches or not according its value.
@@ -3036,7 +3095,7 @@ the RTL says that is an unsigned branch, output an unsigned compare;
otherwise output a signed compare. When the branch itself is output, you
can treat signed and unsigned branches identically.
-The reason you can do this is that GNU CC always generates a pair of
+The reason you can do this is that GCC always generates a pair of
consecutive RTL insns, possibly separated by @code{note} insns, one to
set the condition code and one to test it, and keeps the pair inviolate
until the end.
@@ -3139,10 +3198,10 @@ provide low-overhead loop support. For example, the TI TMS320C3x/C4x
DSPs have a block repeat instruction that loads special registers to
mark the top and end of a loop and to count the number of loop
iterations. This avoids the need for fetching and executing a
-@samp{dbra}-like instruction and avoids pipeline stalls asociated with
+@samp{dbra}-like instruction and avoids pipeline stalls associated with
the jump.
-GNU CC has three special named patterns to support low overhead looping,
+GCC has three special named patterns to support low overhead looping,
@samp{decrement_and_branch_until_zero}, @samp{doloop_begin}, and
@samp{doloop_end}. The first pattern,
@samp{decrement_and_branch_until_zero}, is not emitted during RTL
@@ -3169,7 +3228,7 @@ following for its @code{dbra} instruction:
(plus:SI (match_dup 0)
(const_int -1)))]
"find_reg_note (insn, REG_NONNEG, 0)"
- "...")
+ "@dots{}")
@end group
@end smallexample
@@ -3178,7 +3237,7 @@ deal with its own reloads, hence the `m' constraints. Also note that
since this insn is generated by the instruction combination phase
combining two sequential insns together into an implicit parallel insn,
the iteration counter needs to be biased by the same amount as the
-decrement operation, in this case -1. Note that the following similar
+decrement operation, in this case @minus{}1. Note that the following similar
pattern will not be matched by the combiner.
@smallexample
@@ -3194,14 +3253,14 @@ pattern will not be matched by the combiner.
(plus:SI (match_dup 0)
(const_int -1)))]
"find_reg_note (insn, REG_NONNEG, 0)"
- "...")
+ "@dots{}")
@end group
@end smallexample
The other two special looping patterns, @samp{doloop_begin} and
@samp{doloop_end}, are emitted by the loop optimiser for certain
well-behaved loops with a finite number of loop iterations using
-information collected during strength reduction.
+information collected during strength reduction.
The @samp{doloop_end} pattern describes the actual looping instruction
(or the implicit looping operation) and the @samp{doloop_begin} pattern
@@ -3323,7 +3382,7 @@ logically equivalent RTL expressions.
@item
The only possible RTL expressions involving both bitwise exclusive-or
and bitwise negation are @code{(xor:@var{m} @var{x} @var{y})}
-and @code{(not:@var{m} (xor:@var{m} @var{x} @var{y}))}.@refill
+and @code{(not:@var{m} (xor:@var{m} @var{x} @var{y}))}.
@item
The sum of three items, one of which is a constant, will only appear in
@@ -3336,7 +3395,7 @@ the form
@item
On machines that do not use @code{cc0},
@code{(compare @var{x} (const_int 0))} will be converted to
-@var{x}.@refill
+@var{x}.
@cindex @code{zero_extract}, canonicalization of
@cindex @code{sign_extract}, canonicalization of
@@ -3356,7 +3415,7 @@ will be written using @code{zero_extract} rather than the equivalent
On some target machines, some standard pattern names for RTL generation
cannot be handled with single insn, but a sequence of RTL insns can
represent them. For these target machines, you can write a
-@code{define_expand} to specify how to generate the sequence of RTL.
+@code{define_expand} to specify how to generate the sequence of RTL@.
@findex define_expand
A @code{define_expand} is an RTL expression that looks almost like a
@@ -3378,8 +3437,8 @@ is no implicit surrounding @code{PARALLEL}.
@item
The condition, a string containing a C expression. This expression is
used to express how the availability of this pattern depends on
-subclasses of target machine, selected by command-line options when GNU
-CC is run. This is just like the condition of a @code{define_insn} that
+subclasses of target machine, selected by command-line options when GCC
+is run. This is just like the condition of a @code{define_insn} that
has a standard name. Therefore, the condition (if present) may not
depend on the data in the insn being matched, but only the
target-machine-type flags. The compiler needs to test these conditions
@@ -3409,7 +3468,7 @@ is used. In particular, it gives a predicate for each operand.
A true operand, which needs to be specified in order to generate RTL from
the pattern, should be described with a @code{match_operand} in its first
occurrence in the RTL template. This enters information on the operand's
-predicate into the tables that record such things. GNU CC uses the
+predicate into the tables that record such things. GCC uses the
information to preload the operand into a register if that is required for
valid RTL code. If the operand is referred to more than once, subsequent
references should use @code{match_dup}.
@@ -3444,7 +3503,7 @@ that the pattern was not truly available. The calling routines in the
compiler will try other strategies for code generation using other patterns.
Failure is currently supported only for binary (addition, multiplication,
-shifting, etc.) and bitfield (@code{extv}, @code{extzv}, and @code{insv})
+shifting, etc.) and bit-field (@code{extv}, @code{extzv}, and @code{insv})
operations.
@end table
@@ -3556,13 +3615,13 @@ on this machine. So it must be copied into a register with
@end smallexample
@strong{Note:} If the @code{define_expand} is used to serve a
-standard binary or unary arithmetic operation or a bitfield operation,
+standard binary or unary arithmetic operation or a bit-field operation,
then the last insn it generates must not be a @code{code_label},
@code{barrier} or @code{note}. It must be an @code{insn},
@code{jump_insn} or @code{call_insn}. If you don't need a real insn
at the end, emit an insn to copy the result of the operation into
itself. Such an insn will generate no code, but it can avoid problems
-in the compiler.@refill
+in the compiler.
@node Insn Splitting
@section Defining How to Split Instructions
@@ -3606,7 +3665,7 @@ complex insn into several simpler insns. It looks like this:
[@var{new-insn-pattern-1}
@var{new-insn-pattern-2}
@dots{}]
- "@var{preparation statements}")
+ "@var{preparation-statements}")
@end smallexample
@var{insn-pattern} is a pattern that needs to be split and
@@ -3616,7 +3675,7 @@ satisfying @var{condition} is found, it is replaced in the insn list
with the insns given by @var{new-insn-pattern-1},
@var{new-insn-pattern-2}, etc.
-The @var{preparation statements} are similar to those statements that
+The @var{preparation-statements} are similar to those statements that
are specified for @code{define_expand} (@pxref{Expander Definitions})
and are executed before the new RTL is generated to prepare for the
generated code or emit some insns whose pattern is not fixed. Unlike
@@ -3628,10 +3687,10 @@ Patterns are matched against @var{insn-pattern} in two different
circumstances. If an insn needs to be split for delay slot scheduling
or insn scheduling, the insn is already known to be valid, which means
that it must have been matched by some @code{define_insn} and, if
-@code{reload_completed} is non-zero, is known to satisfy the constraints
+@code{reload_completed} is nonzero, is known to satisfy the constraints
of that @code{define_insn}. In that case, the new insn patterns must
also be insns that are matched by some @code{define_insn} and, if
-@code{reload_completed} is non-zero, must also satisfy the constraints
+@code{reload_completed} is nonzero, must also satisfy the constraints
of those definitions.
As an example of this usage of @code{define_split}, consider the following
@@ -3741,7 +3800,7 @@ this:
[@var{new-insn-pattern-1}
@var{new-insn-pattern-2}
@dots{}]
- "@var{preparation statements}"
+ "@var{preparation-statements}"
[@var{insn-attributes}])
@end smallexample
@@ -3752,7 +3811,7 @@ this:
in a @code{define_split}. The @var{split-condition} is also used as in
@code{define_split}, with the additional behavior that if the condition starts
with @samp{&&}, the condition used for the split will be the constructed as a
-logical "and" of the split condition with the insn condition. For example,
+logical ``and'' of the split condition with the insn condition. For example,
from i386.md:
@smallexample
@@ -3770,8 +3829,8 @@ from i386.md:
@end smallexample
-In this case, the actual split condition will be
-"TARGET_ZERO_EXTEND_WITH_AND && !optimize_size && reload_completed."
+In this case, the actual split condition will be
+@samp{TARGET_ZERO_EXTEND_WITH_AND && !optimize_size && reload_completed}.
The @code{define_insn_and_split} construction provides exactly the same
functionality as two separate @code{define_insn} and @code{define_split}
@@ -3800,7 +3859,7 @@ is deprecated.
A newer @code{define_peephole2} matches insns and substitutes new
insns. The @code{peephole2} pass is run after register allocation
-but before scheduling, which may result in much better code for
+but before scheduling, which may result in much better code for
targets that do scheduling.
@menu
@@ -3822,7 +3881,7 @@ A definition looks like this:
@dots{}]
"@var{condition}"
"@var{template}"
- "@var{optional insn-attributes}")
+ "@var{optional-insn-attributes}")
@end smallexample
@noindent
@@ -3833,7 +3892,7 @@ it must obey the same rules as in a @code{define_insn}.
In this skeleton, @var{insn-pattern-1} and so on are patterns to match
consecutive insns. The optimization applies to a sequence of insns when
@var{insn-pattern-1} matches the first one, @var{insn-pattern-2} matches
-the next, and so on.@refill
+the next, and so on.
Each of the insns matched by a peephole must also match a
@code{define_insn}. Peepholes are checked only at the last stage just
@@ -3885,7 +3944,7 @@ elsewhere. Use the C expression @code{dead_or_set_p (@var{insn},
@var{op})}, where @var{insn} is the insn in which you expect the value
to be used for the last time (from the value of @code{insn}, together
with use of @code{prev_nonnote_insn}), and @var{op} is the intermediate
-value (from @code{operands[@var{i}]}).@refill
+value (from @code{operands[@var{i}]}).
Applying the optimization means replacing the sequence of insns with one
new insn. The @var{template} controls ultimate output of assembler code
@@ -4006,7 +4065,7 @@ then the way to mention this insn in a peephole is as follows:
@findex define_peephole2
The @code{define_peephole2} definition tells the compiler how to
-substitute one sequence of instructions for another sequence,
+substitute one sequence of instructions for another sequence,
what additional scratch registers may be needed and what their
lifetimes must be.
@@ -4019,7 +4078,7 @@ lifetimes must be.
[@var{new-insn-pattern-1}
@var{new-insn-pattern-2}
@dots{}]
- "@var{preparation statements}")
+ "@var{preparation-statements}")
@end smallexample
The definition is almost identical to @code{define_split}
@@ -4073,7 +4132,7 @@ so here's a silly made-up example:
(set (match_operand:SI 2 "" "") (match_dup 1))
(match_dup 4)
(set (match_operand:SI 3 "" "") (match_dup 1))]
- "@var{determine 1 does not overlap 0 and 2}"
+ "/* @r{determine 1 does not overlap 0 and 2} */"
[(set (match_dup 4) (match_dup 1))
(set (match_dup 0) (match_dup 4))
(set (match_dup 2) (match_dup 4))]
@@ -4199,7 +4258,7 @@ The string @var{value} specifies a constant attribute value.
If @var{value} is specified as @samp{"*"}, it means that the default value of
the attribute is to be used for the insn containing this expression.
@samp{"*"} obviously cannot be used in the @var{default} expression
-of a @code{define_attr}.@refill
+of a @code{define_attr}.
If the attribute whose value is being specified is numeric, @var{value}
must be a string containing a non-negative integer (normally
@@ -4227,7 +4286,7 @@ expression is that of the @var{default} expression.
@table @code
@cindex @code{const_int} and attribute tests
@item (const_int @var{i})
-This test is true if @var{i} is non-zero and false otherwise.
+This test is true if @var{i} is nonzero and false otherwise.
@cindex @code{not} and attributes
@cindex @code{ior} and attributes
@@ -4242,7 +4301,7 @@ These tests are true if the indicated logical function is true.
This test is true if operand @var{n} of the insn whose attribute value
is being determined has mode @var{m} (this part of the test is ignored
if @var{m} is @code{VOIDmode}) and the function specified by the string
-@var{pred} returns a non-zero value when passed operand @var{n} and mode
+@var{pred} returns a nonzero value when passed operand @var{n} and mode
@var{m} (this part of the test is ignored if @var{pred} is the null
string).
@@ -4281,14 +4340,14 @@ These tests are true if the indicated comparison of the two arithmetic
expressions is true. Arithmetic expressions are formed with
@code{plus}, @code{minus}, @code{mult}, @code{div}, @code{mod},
@code{abs}, @code{neg}, @code{and}, @code{ior}, @code{xor}, @code{not},
-@code{ashift}, @code{lshiftrt}, and @code{ashiftrt} expressions.@refill
+@code{ashift}, @code{lshiftrt}, and @code{ashiftrt} expressions.
@findex get_attr
@code{const_int} and @code{symbol_ref} are always valid terms (@pxref{Insn
Lengths},for additional forms). @code{symbol_ref} is a string
denoting a C expression that yields an @code{int} when evaluated by the
@samp{get_attr_@dots{}} routine. It should normally be a global
-variable.@refill
+variable.
@findex eq_attr
@item (eq_attr @var{name} @var{value})
@@ -4318,7 +4377,7 @@ is equivalent to
If @var{name} specifies an attribute of @samp{alternative}, it refers to the
value of the compiler variable @code{which_alternative}
(@pxref{Output Statement}) and the values must be small integers. For
-example,@refill
+example,
@smallexample
(eq_attr "alternative" "2,3")
@@ -4334,7 +4393,7 @@ is equivalent to
Note that, for most attributes, an @code{eq_attr} test is simplified in cases
where the value of the attribute being tested is known for all insns matching
-a particular pattern. This is by far the most common case.@refill
+a particular pattern. This is by far the most common case.
@findex attr_flag
@item (attr_flag @var{name})
@@ -4396,7 +4455,7 @@ insn is set to the default value for that attribute, as specified in its
@code{define_attr}. Extensive use of default values for attributes
permits the specification of the values for only one or two attributes
in the definition of most insn patterns, as seen in the example in the
-next section.@refill
+next section.
The optional last argument of @code{define_insn} and
@code{define_peephole} is a vector of expressions, each of which defines
@@ -4404,7 +4463,7 @@ the value for a single attribute. The most general way of assigning an
attribute's value is to use a @code{set} expression whose first operand is an
@code{attr} expression giving the name of the attribute being set. The
second operand of the @code{set} is an attribute expression
-(@pxref{Expressions}) giving the value of the attribute.@refill
+(@pxref{Expressions}) giving the value of the attribute.
When the attribute value depends on the @samp{alternative} attribute
(i.e., which is the applicable alternative in the constraint of the
@@ -4597,7 +4656,7 @@ that contains the initially computed length of the insn and should be
updated with the correct length of the insn.
This macro will normally not be required. A case in which it is
-required is the ROMP. On this machine, the size of an @code{addr_vec}
+required is the ROMP@. On this machine, the size of an @code{addr_vec}
insn must be increased by two to compensate for the fact that alignment
may be required.
@end table
@@ -4703,7 +4762,7 @@ satisfy attribute test @var{delay-n}. @var{annul-true-n} is an
attribute test that specifies which insns may be annulled if the branch
is true. Similarly, @var{annul-false-n} specifies which insns in the
delay slot may be annulled if the branch is false. If annulling is not
-supported for that delay slot, @code{(nil)} should be coded.@refill
+supported for that delay slot, @code{(nil)} should be coded.
For example, in the common case where branch and call insns require
a single delay slot, which may contain any insn other than a branch or
@@ -4873,7 +4932,7 @@ can be quite tedious to describe these forms directly in the
(define_cond_exec
[@var{predicate-pattern}]
"@var{condition}"
- "@var{output template}")
+ "@var{output-template}")
@end smallexample
@var{predicate-pattern} is the condition that must be true for the
@@ -4886,7 +4945,7 @@ alternative.
pattern to match.
@findex current_insn_predicate
-@var{output template} is a string similar to the @code{define_insn}
+@var{output-template} is a string similar to the @code{define_insn}
output template (@pxref{Output Template}), except that the @samp{*}
and @samp{@@} special cases do not apply. This is only useful if the
assembly text for the predicate is a simple prefix to the main insn.
@@ -4894,15 +4953,15 @@ In order to handle the general case, there is a global variable
@code{current_insn_predicate} that will contain the entire predicate
if the current insn is predicated, and will otherwise be @code{NULL}.
-When @code{define_cond_exec} is used, an implicit reference to
-the @code{predicable} instruction attribute is made.
-@xref{Insn Attributes}. This attribute must be boolean (i.e. have
+When @code{define_cond_exec} is used, an implicit reference to
+the @code{predicable} instruction attribute is made.
+@xref{Insn Attributes}. This attribute must be boolean (i.e.@: have
exactly two elements in its @var{list-of-values}). Further, it must
not be used with complex expressions. That is, the default and all
-uses in the insns must be a simple constant, not dependent on the
+uses in the insns must be a simple constant, not dependent on the
alternative or anything else.
-For each @code{define_insn} for which the @code{predicable}
+For each @code{define_insn} for which the @code{predicable}
attribute is true, a new @code{define_insn} pattern will be
generated that matches a predicated version of the instruction.
For example,
diff --git a/libobjc/objc-features.texi b/gcc/doc/objc.texi
index 9575e55b906..e4cd2e3106d 100644
--- a/libobjc/objc-features.texi
+++ b/gcc/doc/objc.texi
@@ -1,40 +1,39 @@
-\input texinfo @c -*-texinfo-*-
-@c %**start of header
-@setfilename objc-features.info
-@settitle GNU Objective-C runtime features
-@setchapternewpage odd
-@c %**end of header
-
-@node Top, Executing code before main, (dir), (dir)
+@c Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
+@c 1999, 2000, 2001 Free Software Foundation, Inc.
+@c This is part of the GCC manual.
+@c For copying conditions, see the file gcc.texi.
+
+@node Objective C
@comment node-name, next, previous, up
@chapter GNU Objective-C runtime features
This document is meant to describe some of the GNU Objective-C runtime
-features. It is not intended to teach you Objective-C, there are several
+features. It is not intended to teach you Objective-C, there are several
resources on the Internet that present the language. Questions and
comments about this document to Ovidiu Predescu
@email{ovidiu@@cup.hp.com}.
@menu
-* Executing code before main::
-* Type encoding::
-* Garbage Collection::
-* Constant string objects::
+* Executing code before main::
+* Type encoding::
+* Garbage Collection::
+* Constant string objects::
+* compatibility_alias::
@end menu
-@node Executing code before main, Type encoding, Top, Top
+@node Executing code before main, Type encoding, Objective C, Objective C
@section @code{+load}: Executing code before main
The GNU Objective-C runtime provides a way that allows you to execute
code before the execution of the program enters the @code{main}
-function. The code is executed on a per-class and a per-category basis,
+function. The code is executed on a per-class and a per-category basis,
through a special class method @code{+load}.
This facility is very useful if you want to initialize global variables
which can be accessed by the program directly, without sending a message
-to the class first. The usual way to initialize global variables, in the
+to the class first. The usual way to initialize global variables, in the
@code{+initialize} method, might not be useful because
@code{+initialize} is only called when the first message is sent to a
class object, which in some cases could be too late.
@@ -44,32 +43,32 @@ Suppose for example you have a @code{FileStream} class that declares
below:
@example
-
-FileStream *Stdin = nil;
-FileStream *Stdout = nil;
-FileStream *Stderr = nil;
-
-@@implementation FileStream
-
-+ (void)initialize
+
+FileStream *Stdin = nil;
+FileStream *Stdout = nil;
+FileStream *Stderr = nil;
+
+@@implementation FileStream
+
++ (void)initialize
@{
- Stdin = [[FileStream new] initWithFd:0];
- Stdout = [[FileStream new] initWithFd:1];
+ Stdin = [[FileStream new] initWithFd:0];
+ Stdout = [[FileStream new] initWithFd:1];
Stderr = [[FileStream new] initWithFd:2];
@}
-
+
/* Other methods here */
@@end
@end example
In this example, the initialization of @code{Stdin}, @code{Stdout} and
-@code{Stderr} in @code{+initialize} occurs too late. The programmer can
+@code{Stderr} in @code{+initialize} occurs too late. The programmer can
send a message to one of these objects before the variables are actually
-initialized, thus sending messages to the @code{nil} object. The
+initialized, thus sending messages to the @code{nil} object. The
@code{+initialize} method which actually initializes the global
variables is not invoked until the first message is sent to the class
-object. The solution would require these variables to be initialized
+object. The solution would require these variables to be initialized
just before entering @code{main}.
The correct solution of the above problem is to use the @code{+load}
@@ -77,31 +76,31 @@ method instead of @code{+initialize}:
@example
-@@implementation FileStream
-
-+ (void)load
+@@implementation FileStream
+
++ (void)load
@{
Stdin = [[FileStream new] initWithFd:0];
Stdout = [[FileStream new] initWithFd:1];
Stderr = [[FileStream new] initWithFd:2];
@}
-
-/* Other methods here */
+
+/* Other methods here */
@@end
@end example
-
-The @code{+load} is a method that is not overridden by categories. If a
+
+The @code{+load} is a method that is not overridden by categories. If a
class and a category of it both implement @code{+load}, both methods are
invoked. This allows some additional initializations to be performed in
a category.
-
+
This mechanism is not intended to be a replacement for @code{+initialize}.
You should be aware of its limitations when you decide to use it
instead of @code{+initialize}.
@menu
-* What you can and what you cannot do in +load::
+* What you can and what you cannot do in +load::
@end menu
@@ -117,8 +116,8 @@ things:
you can write whatever C code you like;
@item
-you can send messages to Objective-C constant strings (@@"this is a
-constant string");
+you can send messages to Objective-C constant strings (@code{@@"this is a
+constant string"});
@item
you can allocate and send messages to objects whose class is implemented
@@ -148,32 +147,32 @@ category implemented in the same file;
@end itemize
You should make no assumptions about receiving @code{+load} in sibling
-classes when you write @code{+load} of a class. The order in which
+classes when you write @code{+load} of a class. The order in which
sibling classes receive @code{+load} is not guaranteed.
-
+
The order in which @code{+load} and @code{+initialize} are called could
-be problematic if this matters. If you don't allocate objects inside
+be problematic if this matters. If you don't allocate objects inside
@code{+load}, it is guaranteed that @code{+load} is called before
-@code{+initialize}. If you create an object inside @code{+load} the
+@code{+initialize}. If you create an object inside @code{+load} the
@code{+initialize} method of object's class is invoked even if
-@code{+load} was not invoked. Note if you explicitly call @code{+load}
-on a class, @code{+initialize} will be called first. To avoid possible
+@code{+load} was not invoked. Note if you explicitly call @code{+load}
+on a class, @code{+initialize} will be called first. To avoid possible
problems try to implement only one of these methods.
The @code{+load} method is also invoked when a bundle is dynamically
-loaded into your running program. This happens automatically without any
-intervening operation from you. When you write bundles and you need to
+loaded into your running program. This happens automatically without any
+intervening operation from you. When you write bundles and you need to
write @code{+load} you can safely create and send messages to objects whose
-classes already exist in the running program. The same restrictions as
+classes already exist in the running program. The same restrictions as
above apply to classes defined in bundle.
-@node Type encoding, Garbage Collection, Executing code before main, Top
+@node Type encoding, Garbage Collection, Executing code before main, Objective C
@section Type encoding
The Objective-C compiler generates type encodings for all the
-types. These type encodings are used at runtime to find out information
+types. These type encodings are used at runtime to find out information
about selectors and methods and about objects and classes.
The types are encoded in the following way:
@@ -181,59 +180,59 @@ The types are encoded in the following way:
@c @sp 1
@multitable @columnfractions .25 .75
-@item @code{char}
+@item @code{char}
@tab @code{c}
-@item @code{unsigned char}
+@item @code{unsigned char}
@tab @code{C}
-@item @code{short}
+@item @code{short}
@tab @code{s}
-@item @code{unsigned short}
+@item @code{unsigned short}
@tab @code{S}
-@item @code{int}
+@item @code{int}
@tab @code{i}
-@item @code{unsigned int}
+@item @code{unsigned int}
@tab @code{I}
-@item @code{long}
+@item @code{long}
@tab @code{l}
-@item @code{unsigned long}
+@item @code{unsigned long}
@tab @code{L}
-@item @code{long long}
+@item @code{long long}
@tab @code{q}
-@item @code{unsigned long long}
+@item @code{unsigned long long}
@tab @code{Q}
-@item @code{float}
+@item @code{float}
@tab @code{f}
-@item @code{double}
+@item @code{double}
@tab @code{d}
-@item @code{void}
+@item @code{void}
@tab @code{v}
-@item @code{id}
+@item @code{id}
@tab @code{@@}
-@item @code{Class}
+@item @code{Class}
@tab @code{#}
-@item @code{SEL}
+@item @code{SEL}
@tab @code{:}
-@item @code{char*}
+@item @code{char*}
@tab @code{*}
-@item unknown type
+@item unknown type
@tab @code{?}
-@item bitfields
-@tab @code{b} followed by the starting position of the bitfield, the type of the bitfield and the size of the bitfield (the bitfields encoding was changed from the NeXT's compiler encoding, see below)
+@item bit-fields
+@tab @code{b} followed by the starting position of the bit-field, the type of the bit-field and the size of the bit-field (the bit-fields encoding was changed from the NeXT's compiler encoding, see below)
@end multitable
@c @sp 1
-The encoding of bitfields has changed to allow bitfields to be properly
+The encoding of bit-fields has changed to allow bit-fields to be properly
handled by the runtime functions that compute sizes and alignments of
-types that contain bitfields. The previous encoding contained only the
-size of the bitfield. Using only this information it is not possible to
-reliably compute the size occupied by the bitfield. This is very
+types that contain bit-fields. The previous encoding contained only the
+size of the bit-field. Using only this information it is not possible to
+reliably compute the size occupied by the bit-field. This is very
important in the presence of the Boehm's garbage collector because the
objects are allocated using the typed memory facility available in this
-collector. The typed memory allocation requires information about where
+collector. The typed memory allocation requires information about where
the pointers are located inside the object.
-The position in the bitfield is the position, counting in bits, of the
+The position in the bit-field is the position, counting in bits, of the
bit closest to the beginning of the structure.
The non-atomic types are encoded as follows:
@@ -241,18 +240,18 @@ The non-atomic types are encoded as follows:
@c @sp 1
@multitable @columnfractions .2 .8
-@item pointers
-@tab @code{'^'} followed by the pointed type.
+@item pointers
+@tab @samp{^} followed by the pointed type.
@item arrays
-@tab @code{'['} followed by the number of elements in the array followed by the type of the elements followed by @code{']'}
+@tab @samp{[} followed by the number of elements in the array followed by the type of the elements followed by @samp{]}
@item structures
-@tab @code{'@{'} followed by the name of the structure (or '?' if the structure is unnamed), the '=' sign, the type of the members and by @code{'@}'}
+@tab @samp{@{} followed by the name of the structure (or @samp{?} if the structure is unnamed), the @samp{=} sign, the type of the members and by @samp{@}}
@item unions
-@tab @code{'('} followed by the name of the structure (or '?' if the union is unnamed), the '=' sign, the type of the members followed by @code{')'}
+@tab @samp{(} followed by the name of the structure (or @samp{?} if the union is unnamed), the @samp{=} sign, the type of the members followed by @samp{)}
@end multitable
Here are some types and their encodings, as they are generated by the
-compiler on a i386 machine:
+compiler on an i386 machine:
@sp 1
@@ -280,7 +279,7 @@ struct @{
@sp 1
In addition to the types the compiler also encodes the type
-specifiers. The table below describes the encoding of the current
+specifiers. The table below describes the encoding of the current
Objective-C type specifiers:
@sp 1
@@ -288,60 +287,60 @@ Objective-C type specifiers:
@multitable @columnfractions .25 .75
@item Specifier
@tab Encoding
-@item @code{const}
+@item @code{const}
@tab @code{r}
-@item @code{in}
+@item @code{in}
@tab @code{n}
-@item @code{inout}
+@item @code{inout}
@tab @code{N}
-@item @code{out}
+@item @code{out}
@tab @code{o}
-@item @code{bycopy}
+@item @code{bycopy}
@tab @code{O}
-@item @code{oneway}
+@item @code{oneway}
@tab @code{V}
@end multitable
@sp 1
-The type specifiers are encoded just before the type. Unlike types
+The type specifiers are encoded just before the type. Unlike types
however, the type specifiers are only encoded when they appear in method
argument types.
-@node Garbage Collection, Constant string objects, Type encoding, Top
+@node Garbage Collection, Constant string objects, Type encoding, Objective C
@section Garbage Collection
Support for a new memory management policy has been added by using a
powerful conservative garbage collector, known as the
-Boehm-Demers-Weiser conservative garbage collector. It is available from
+Boehm-Demers-Weiser conservative garbage collector. It is available from
@w{@uref{http://www.hpl.hp.com/personal/Hans_Boehm/gc/}}.
To enable the support for it you have to configure the compiler using an
-additional argument, @w{@kbd{--enable-objc-gc}}. You need to have
-garbage collector installed before building the compiler. This will
+additional argument, @w{@option{--enable-objc-gc}}. You need to have
+garbage collector installed before building the compiler. This will
build an additional runtime library which has several enhancements to
-support the garbage collector. The new library has a new name,
-@kbd{libobjc_gc.a} to not conflict with the non-garbage-collected
+support the garbage collector. The new library has a new name,
+@file{libobjc_gc.a} to not conflict with the non-garbage-collected
library.
When the garbage collector is used, the objects are allocated using the
so-called typed memory allocation mechanism available in the
-Boehm-Demers-Weiser collector. This mode requires precise information on
-where pointers are located inside objects. This information is computed
+Boehm-Demers-Weiser collector. This mode requires precise information on
+where pointers are located inside objects. This information is computed
once per class, immediately after the class has been initialized.
There is a new runtime function @code{class_ivar_set_gcinvisible()}
-which can be used to declare a so-called @strong{weak pointer}
-reference. Such a pointer is basically hidden for the garbage collector;
+which can be used to declare a so-called @dfn{weak pointer}
+reference. Such a pointer is basically hidden for the garbage collector;
this can be useful in certain situations, especially when you want to
keep track of the allocated objects, yet allow them to be
-collected. This kind of pointers can only be members of objects, you
-cannot declare a global pointer as a weak reference. Every type which is
+collected. This kind of pointers can only be members of objects, you
+cannot declare a global pointer as a weak reference. Every type which is
a pointer type can be declared a weak pointer, including @code{id},
@code{Class} and @code{SEL}.
-Here is an example of how to use this feature. Suppose you want to
+Here is an example of how to use this feature. Suppose you want to
implement a class whose instances hold a weak pointer reference; the
following class does this:
@@ -380,19 +379,18 @@ following class does this:
@end example
Weak pointers are supported through a new type character specifier
-represented by the @code{'!'} character. The
+represented by the @samp{!} character. The
@code{class_ivar_set_gcinvisible()} function adds or removes this
specifier to the string type description of the instance variable named
as argument.
@c =========================================================================
-@node Constant string objects, , Garbage Collection, Top
-@comment node-name, next, previous, up
+@node Constant string objects
@section Constant string objects
GNU Objective-C provides constant string objects that are generated
-directly by the compiler. You declare a constant string object by
-prefixing a C constant string with the character @code{@@}:
+directly by the compiler. You declare a constant string object by
+prefixing a C constant string with the character @samp{@@}:
@example
id myString = @@"this is a constant string object";
@@ -400,13 +398,13 @@ prefixing a C constant string with the character @code{@@}:
The constant string objects are usually instances of the
@code{NXConstantString} class which is provided by the GNU Objective-C
-runtime. To get the definition of this class you must include the
+runtime. To get the definition of this class you must include the
@file{objc/NXConstStr.h} header file.
User defined libraries may want to implement their own constant string
-class. To be able to support them, the GNU Objective-C compiler provides
-a new command line options @code{-fconstant-string-class=<class
-name>}. The provided class should adhere to a strict structure, the same
+class. To be able to support them, the GNU Objective-C compiler provides
+a new command line options @option{-fconstant-string-class=@var{class-name}}.
+The provided class should adhere to a strict structure, the same
as @code{NXConstantString}'s structure:
@example
@@ -421,14 +419,40 @@ as @code{NXConstantString}'s structure:
@end example
User class libraries may choose to inherit the customized constant
-string class from a different class than @code{Object}. There is no
+string class from a different class than @code{Object}. There is no
requirement in the methods the constant string class has to implement.
-When a file is compiled with the @code{-fconstant-string-class} option,
+When a file is compiled with the @option{-fconstant-string-class} option,
all the constant string objects will be instances of the class specified
-as argument to this option. It is possible to have multiple compilation
+as argument to this option. It is possible to have multiple compilation
units referring to different constant string classes, neither the
compiler nor the linker impose any restrictions in doing this.
-@bye
+@c =========================================================================
+@node compatibility_alias
+@section compatibility_alias
+
+This is a feature of the Objective-C compiler rather than of the
+runtime, anyway since it is documented nowhere and its existence was
+forgotten, we are documenting it here.
+
+The keyword @code{@@compatibility_alias} allows you to define a class name
+as equivalent to another class name. For example:
+
+@example
+@@compatibility_alias WOApplication GSWApplication;
+@end example
+
+tells the compiler that each time it encounters @code{WOApplication} as
+a class name, it should replace it with @code{GSWApplication} (that is,
+@code{WOApplication} is just an alias for @code{GSWApplication}).
+
+There are some constraints on how this can be used---
+
+@itemize @bullet
+@item @code{WOApplication} (the alias) must not be an existing class;
+
+@item @code{GSWApplication} (the real class) must be an existing class.
+
+@end itemize
diff --git a/gcc/rtl.texi b/gcc/doc/rtl.texi
index f75ffcf1e72..13c663de254 100644
--- a/gcc/rtl.texi
+++ b/gcc/doc/rtl.texi
@@ -21,7 +21,7 @@ form uses nested parentheses to indicate the pointers in the internal form.
@menu
* RTL Objects:: Expressions vs vectors vs strings vs integers.
-* RTL Classes:: Categories of RTL expresion objects, and their structure.
+* RTL Classes:: Categories of RTL expression objects, and their structure.
* Accessors:: Macros to access expression operands or vector elts.
* Flags:: Other flags in an RTL expression.
* Machine Modes:: Describing the size and format of a datum.
@@ -29,7 +29,7 @@ form uses nested parentheses to indicate the pointers in the internal form.
* Regs and Memory:: Expressions representing register contents or memory.
* Arithmetic:: Expressions representing arithmetic on other expressions.
* Comparisons:: Expressions representing comparison of expressions.
-* Bit Fields:: Expressions representing bitfields in memory or reg.
+* Bit-Fields:: Expressions representing bit-fields in memory or reg.
* Vector Operations:: Expressions involving vector datatypes.
* Conversions:: Extending, truncating, floating or fixing.
* RTL Declarations:: Declaring volatility, constancy, etc.
@@ -68,7 +68,7 @@ a machine description, it is represented in core as a null pointer rather
than as a pointer to a null character. In certain contexts, these null
pointers instead of strings are valid. Within RTL code, strings are most
commonly found inside @code{symbol_ref} expressions, but they appear in
-other contexts in the RTL expressions that make up machine descriptions.
+other contexts in the RTL expressions that make up machine descriptions.
A vector contains an arbitrary number of pointers to expressions. The
number of elements in the vector is explicitly present in the vector.
@@ -149,10 +149,10 @@ An RTX code for a non-commutative binary operation, such as @code{MINUS},
@code{DIV}, or @code{ASHIFTRT}.
@item b
-An RTX code for a bitfield operation. Currently only
+An RTX code for a bit-field operation. Currently only
@code{ZERO_EXTRACT} and @code{SIGN_EXTRACT}. These have three inputs
-and are lvalues (so they can be used for insertion as well). @xref{Bit
-Fields}.
+and are lvalues (so they can be used for insertion as well).
+@xref{Bit-Fields}.
@item 3
An RTX code for other three input operations. Currently only
@@ -160,7 +160,7 @@ An RTX code for other three input operations. Currently only
@item i
An RTX code for an entire instruction: @code{INSN}, @code{JUMP_INSN}, and
-@code{CALL_INSN}. @xref{Insns}.
+@code{CALL_INSN}. @xref{Insns}.
@item m
An RTX code for something that matches in insns, such as
@@ -185,7 +185,7 @@ expression (actually a pointer to an expression), @samp{i} for integer,
@samp{w} for wide integer, @samp{s} for string, and @samp{E} for vector
of expressions. The sequence of letters for an expression code is
called its @dfn{format}. For example, the format of @code{subreg} is
-@samp{ei}.@refill
+@samp{ei}.
@cindex RTL format characters
A few other format characters are used occasionally:
@@ -271,7 +271,7 @@ You can make no assumptions about the format of these codes.
Operands of expressions are accessed using the macros @code{XEXP},
@code{XINT}, @code{XWINT} and @code{XSTR}. Each of these macros takes
two arguments: an expression-pointer (RTX) and an operand number
-(counting from zero). Thus,@refill
+(counting from zero). Thus,
@example
XEXP (@var{x}, 2)
@@ -304,7 +304,7 @@ compile without error, and would return the second, integer operand cast as
an expression pointer, which would probably result in a crash when
accessed. Nothing stops you from writing @code{XEXP (@var{x}, 28)} either,
but this will access memory past the end of the expression with
-unpredictable results.@refill
+unpredictable results.
Access to operands which are vectors is more complicated. You can use the
macro @code{XVEC} to get the vector-pointer itself, or the macros
@@ -324,7 +324,7 @@ in operand number @var{idx} in @var{exp}. This value is an @code{int}.
@findex XVECEXP
@item XVECEXP (@var{exp}, @var{idx}, @var{eltnum})
Access element number @var{eltnum} in the vector which is
-in operand number @var{idx} in @var{exp}. This value is an RTX.
+in operand number @var{idx} in @var{exp}. This value is an RTX@.
It is up to you to make sure that @var{eltnum} is not negative
and is less than @code{XVECLEN (@var{exp}, @var{idx})}.
@@ -338,7 +338,7 @@ to access them.
@section Flags in an RTL Expression
@cindex flags in RTL expression
-RTL expressions contain several flags (one-bit bitfields) and other
+RTL expressions contain several flags (one-bit bit-fields) and other
values that are used in certain types of expression. Most often they
are accessed with the following macros:
@@ -380,7 +380,7 @@ never be simultaneously set.
In @code{mem} expressions, the alias set to which @var{x} belongs. If
zero, @var{x} is not in any alias set, and may alias anything. If
nonzero, @var{x} may only alias objects in the same alias set. This
-value is set (in a language-specific manner) by the front-end. This
+value is set (in a language-specific manner) by the front end. This
field is not a bit-field; it is in an integer, found as the second
argument to the @code{mem}.
@@ -392,7 +392,7 @@ In @code{reg} expressions, nonzero if this register's entire life is
contained in the exit test code for some loop. Stored in the
@code{in_struct} field and printed as @samp{/s}.
-@findex REG_USERVAR_P
+@findex REG_USERVAR_P
@cindex @code{reg} and @samp{/v}
@cindex @code{volatil}, in @code{reg}
@item REG_USERVAR_P (@var{x})
@@ -402,7 +402,7 @@ the compiler. Stored in the @code{volatil} field and printed as
@samp{/v}.
@cindex @samp{/i} in RTL dump
-@findex REG_FUNCTION_VALUE_P
+@findex REG_FUNCTION_VALUE_P
@cindex @code{reg} and @samp{/i}
@cindex @code{integrated}, in @code{reg}
@item REG_FUNCTION_VALUE_P (@var{x})
@@ -437,7 +437,7 @@ if the object being referenced is kept zero-extended and zero if it
is kept sign-extended. Stored in the @code{unchanging} field and
printed as @samp{/u}.
-@findex RTX_UNCHANGING_P
+@findex RTX_UNCHANGING_P
@cindex @code{reg} and @samp{/u}
@cindex @code{mem} and @samp{/u}
@cindex @code{unchanging}, in @code{reg} and @code{mem}
@@ -450,7 +450,7 @@ explicitly by the current function. The object might be changed by
other functions or by aliasing.) Stored in the
@code{unchanging} field and printed as @samp{/u}.
-@findex RTX_INTEGRATED_P
+@findex RTX_INTEGRATED_P
@cindex @code{integrated}, in @code{insn}
@item RTX_INTEGRATED_P (@var{insn})
Nonzero in an insn if it resulted from an in-line function call.
@@ -496,6 +496,13 @@ once. Stored in the @code{used} field.
In a @code{symbol_ref}, this is used as a flag for machine-specific purposes.
Stored in the @code{volatil} field and printed as @samp{/v}.
+@findex SYMBOL_REF_WEAK
+@cindex @code{symbol_ref} and @samp{/i}
+@cindex @code{integrated}, in @code{symbol_ref}
+@item SYMBOL_REF_WEAK (@var{x})
+In a @code{symbol_ref}, indicates that @var{x} has been declared weak.
+Stored in the @code{integrated} field and printed as @samp{/i}.
+
@findex LABEL_OUTSIDE_LOOP_P
@cindex @code{label_ref} and @samp{/s}
@cindex @code{in_struct}, in @code{label_ref}
@@ -504,7 +511,7 @@ In @code{label_ref} expressions, nonzero if this is a reference to a
label that is outside the innermost loop containing the reference to the
label. Stored in the @code{in_struct} field and printed as @samp{/s}.
-@findex INSN_DELETED_P
+@findex INSN_DELETED_P
@cindex @code{volatil}, in @code{insn}
@item INSN_DELETED_P (@var{insn})
In an insn, nonzero if the insn has been deleted. Stored in the
@@ -533,13 +540,13 @@ branch is not taken. When @code{INSN_ANNULLED_BRANCH_P} is not set,
this insn will always be executed. Stored in the @code{in_struct}
field and printed as @samp{/s}.
-@findex CONSTANT_POOL_ADDRESS_P
+@findex CONSTANT_POOL_ADDRESS_P
@cindex @code{symbol_ref} and @samp{/u}
@cindex @code{unchanging}, in @code{symbol_ref}
@item CONSTANT_POOL_ADDRESS_P (@var{x})
Nonzero in a @code{symbol_ref} if it refers to part of the current
function's ``constants pool''. These are addresses close to the
-beginning of the function, and GNU CC assumes they can be addressed
+beginning of the function, and GCC assumes they can be addressed
directly (perhaps with the help of base registers). Stored in the
@code{unchanging} field and printed as @samp{/u}.
@@ -596,7 +603,7 @@ expressions and in insns. In RTL dump files, it is printed as
In a @code{mem} expression, it is 1 if the memory reference is volatile.
Volatile memory references may not be deleted, reordered or combined.
-In a @code{symbol_ref} expression, it is used for machine-specific
+In a @code{symbol_ref} expression, it is used for machine-specific
purposes.
In a @code{reg} expression, it is 1 if the value is a user-level variable.
@@ -760,7 +767,7 @@ the condition code. These modes are not used on machines that use
``Block'' mode represents values that are aggregates to which none of
the other modes apply. In RTL, only memory references can have this mode,
and only if they appear in string-move or vector instructions. On machines
-which have no such instructions, @code{BLKmode} will not appear in RTL.
+which have no such instructions, @code{BLKmode} will not appear in RTL@.
@findex VOIDmode
@item VOIDmode
@@ -952,21 +959,21 @@ only expression for integer value negative one is found in
@code{constm1_rtx}. Any attempt to create an expression of code
@code{const_int} and value zero, one, two or negative one will return
@code{const0_rtx}, @code{const1_rtx}, @code{const2_rtx} or
-@code{constm1_rtx} as appropriate.@refill
+@code{constm1_rtx} as appropriate.
@findex const_true_rtx
Similarly, there is only one object for the integer whose value is
@code{STORE_FLAG_VALUE}. It is found in @code{const_true_rtx}. If
@code{STORE_FLAG_VALUE} is one, @code{const_true_rtx} and
@code{const1_rtx} will point to the same object. If
-@code{STORE_FLAG_VALUE} is -1, @code{const_true_rtx} and
-@code{constm1_rtx} will point to the same object.@refill
+@code{STORE_FLAG_VALUE} is @minus{}1, @code{const_true_rtx} and
+@code{constm1_rtx} will point to the same object.
@findex const_double
@item (const_double:@var{m} @var{addr} @var{i0} @var{i1} @dots{})
Represents either a floating-point constant of mode @var{m} or an
integer constant too large to fit into @code{HOST_BITS_PER_WIDE_INT}
-bits but small enough to fit within twice that number of bits (GNU CC
+bits but small enough to fit within twice that number of bits (GCC
does not provide a mechanism to represent even larger constants). In
the latter case, @var{m} will be @code{VOIDmode}.
@@ -979,7 +986,7 @@ it has not been allocated a memory location, but is on the chain of all
undisplayed field), @var{addr} contains @code{const0_rtx}. If it is not
on the chain, @var{addr} contains @code{cc0_rtx}. @var{addr} is
customarily accessed with the macro @code{CONST_DOUBLE_MEM} and the
-chain field via @code{CONST_DOUBLE_CHAIN}.@refill
+chain field via @code{CONST_DOUBLE_CHAIN}.
@findex CONST_DOUBLE_LOW
If @var{m} is @code{VOIDmode}, the bits of the value are stored in
@@ -1240,7 +1247,7 @@ expressions such as these from being formed.
@findex SUBREG_REG
@findex SUBREG_WORD
-The first operand of a @code{subreg} expression is customarily accessed
+The first operand of a @code{subreg} expression is customarily accessed
with the @code{SUBREG_REG} macro and the second operand is customarily
accessed with the @code{SUBREG_WORD} macro.
@@ -1323,14 +1330,14 @@ of the variable @code{pc_rtx}. Any attempt to create an expression of
code @code{pc} will return @code{pc_rtx}.
All instructions that do not jump alter the program counter implicitly
-by incrementing it, but there is no need to mention this in the RTL.
+by incrementing it, but there is no need to mention this in the RTL@.
@findex mem
@item (mem:@var{m} @var{addr} @var{alias})
This RTX represents a reference to main memory at an address
represented by the expression @var{addr}. @var{m} specifies how large
-a unit of memory is accessed. @var{alias} specifies an alias set for the
-reference. In general two items are in different alias sets if they cannot
+a unit of memory is accessed. @var{alias} specifies an alias set for the
+reference. In general two items are in different alias sets if they cannot
reference the same memory address.
@findex addressof
@@ -1362,7 +1369,7 @@ second operand.
@cindex RTL sum
@item (plus:@var{m} @var{x} @var{y})
Represents the sum of the values represented by @var{x} and @var{y}
-carried out in machine mode @var{m}.
+carried out in machine mode @var{m}.
@findex lo_sum
@item (lo_sum:@var{m} @var{x} @var{y})
@@ -1430,7 +1437,7 @@ determines what mode the comparison is to be done in; thus it must not
be @code{VOIDmode}.
If one of the operands is a constant, it should be placed in the
-second operand and the comparison code adjusted as appropriate.
+second operand and the comparison code adjusted as appropriate.
A @code{compare} specifying two @code{VOIDmode} constants is not valid
since there is no way to know in what mode the comparison is to be
@@ -1474,7 +1481,7 @@ mode, it represents the exact quotient; otherwise, the integerized
quotient.
Some machines have division instructions in which the operands and
-quotient widths are not all the same; you should represent
+quotient widths are not all the same; you should represent
such instructions using @code{truncate} and @code{sign_extend} as in,
@example
@@ -1565,7 +1572,7 @@ Like @code{ashift} but for right shift. Unlike the case for left shift,
these two operations are distinct.
@findex rotate
-@cindex rotate
+@cindex rotate
@cindex left rotate
@findex rotatert
@cindex right rotate
@@ -1636,8 +1643,8 @@ in case it exists in the context of the particular insn involved.
Inequality comparisons come in two flavors, signed and unsigned. Thus,
there are distinct expression codes @code{gt} and @code{gtu} for signed and
unsigned greater-than. These can produce different results for the same
-pair of integer values: for example, 1 is signed greater-than -1 but not
-unsigned greater-than, because -1 when regarded as unsigned is actually
+pair of integer values: for example, 1 is signed greater-than @minus{}1 but not
+unsigned greater-than, because @minus{}1 when regarded as unsigned is actually
@code{0xffffffff} which is greater than 1.
The signed comparisons are also used for floating point values. Floating
@@ -1707,28 +1714,28 @@ to express conditional jumps.
@item (cond [@var{test1} @var{value1} @var{test2} @var{value2} @dots{}] @var{default})
Similar to @code{if_then_else}, but more general. Each of @var{test1},
@var{test2}, @dots{} is performed in turn. The result of this expression is
-the @var{value} corresponding to the first non-zero test, or @var{default} if
-none of the tests are non-zero expressions.
+the @var{value} corresponding to the first nonzero test, or @var{default} if
+none of the tests are nonzero expressions.
This is currently not valid for instruction patterns and is supported only
for insn attributes. @xref{Insn Attributes}.
@end table
-@node Bit Fields
-@section Bit Fields
-@cindex bit fields
+@node Bit-Fields
+@section Bit-Fields
+@cindex bit-fields
-Special expression codes exist to represent bitfield instructions.
+Special expression codes exist to represent bit-field instructions.
These types of expressions are lvalues in RTL; they may appear
on the left side of an assignment, indicating insertion of a value
-into the specified bit field.
+into the specified bit-field.
@table @code
@findex sign_extract
@cindex @code{BITS_BIG_ENDIAN}, effect on @code{sign_extract}
@item (sign_extract:@var{m} @var{loc} @var{size} @var{pos})
-This represents a reference to a sign-extended bit field contained or
-starting in @var{loc} (a memory or register reference). The bit field
+This represents a reference to a sign-extended bit-field contained or
+starting in @var{loc} (a memory or register reference). The bit-field
is @var{size} bits wide and starts at bit @var{pos}. The compilation
option @code{BITS_BIG_ENDIAN} says which end of the memory unit
@var{pos} counts from.
@@ -1748,7 +1755,7 @@ The mode @var{m} is the same as the mode that would be used for
@findex zero_extract
@item (zero_extract:@var{m} @var{loc} @var{size} @var{pos})
Like @code{sign_extract} but refers to an unsigned or zero-extended
-bit field. The same sequence of bits are extracted, but they
+bit-field. The same sequence of bits are extracted, but they
are filled to an entire word with zeros instead of by sign-extension.
@end table
@@ -1756,7 +1763,7 @@ are filled to an entire word with zeros instead of by sign-extension.
@section Vector Operations
@cindex vector operations
-All normal rtl expressions can be used with vector modes; they are
+All normal RTL expressions can be used with vector modes; they are
interpreted as operating on each part of the vector independently.
Additionally, there are a few new expressions to describe specific vector
operations.
@@ -1944,10 +1951,10 @@ Represents the action of storing the value of @var{x} into the place
represented by @var{lval}. @var{lval} must be an expression
representing a place that can be stored in: @code{reg} (or @code{subreg}
or @code{strict_low_part}), @code{mem}, @code{pc}, @code{parallel}, or
-@code{cc0}.@refill
+@code{cc0}.
If @var{lval} is a @code{reg}, @code{subreg} or @code{mem}, it has a
-machine mode; then @var{x} must be valid for that mode.@refill
+machine mode; then @var{x} must be valid for that mode.
If @var{lval} is a @code{reg} whose machine mode is less than the full
width of the register, then it means that the part of the register
@@ -1960,7 +1967,7 @@ an undefined way.
If @var{lval} is a @code{strict_low_part} of a @code{subreg}, then the
part of the register specified by the machine mode of the
@code{subreg} is given the value @var{x} and the rest of the register
-is not changed.@refill
+is not changed.
If @var{lval} is @code{(cc0)}, it has no machine mode, and @var{x} may
be either a @code{compare} expression or a value that may have any mode.
@@ -1971,7 +1978,7 @@ Use the former expression to save space during the compilation.
If @var{lval} is a @code{parallel}, it is used to represent the case of
a function returning a structure in multiple registers. Each element
-of the @code{paralllel} is an @code{expr_list} whose first operand is a
+of the @code{parallel} is an @code{expr_list} whose first operand is a
@code{reg} and whose second operand is a @code{const_int} representing the
offset (in bytes) into the structure at which the data in that register
corresponds. The first element may be null to indicate that the structure
@@ -1988,7 +1995,7 @@ does not jump) and the other of the two must be a @code{label_ref}
(for the case which does jump). @var{x} may also be a @code{mem} or
@code{(plus:SI (pc) @var{y})}, where @var{y} may be a @code{reg} or a
@code{mem}; these unusual patterns are used to represent jumps through
-branch tables.@refill
+branch tables.
If @var{lval} is neither @code{(cc0)} nor @code{(pc)}, the mode of
@var{lval} must not be @code{VOIDmode} and the mode of @var{x} must be
@@ -1996,7 +2003,7 @@ valid for the mode of @var{lval}.
@findex SET_DEST
@findex SET_SRC
-@var{lval} is customarily accessed with the @code{SET_DEST} macro and
+@var{lval} is customarily accessed with the @code{SET_DEST} macro and
@var{x} with the @code{SET_SRC} macro.
@findex return
@@ -2071,7 +2078,7 @@ insn. However, the reload phase may allocate a register used for one of
the inputs unless the @samp{&} constraint is specified for the selected
alternative (@pxref{Modifiers}). You can clobber either a specific hard
register, a pseudo register, or a @code{scratch} expression; in the
-latter two cases, GNU CC will allocate a hard register that is available
+latter two cases, GCC will allocate a hard register that is available
there for use as a temporary.
For instructions that require a temporary register, you should use
@@ -2079,7 +2086,7 @@ For instructions that require a temporary register, you should use
combiner phase to add the @code{clobber} when required. You do this by
coding (@code{clobber} (@code{match_scratch} @dots{})). If you do
clobber a pseudo register, use one which appears nowhere else---generate
-a new one each time. Otherwise, you may confuse CSE.
+a new one each time. Otherwise, you may confuse CSE@.
There is one other known use for clobbering a pseudo register in a
@code{parallel}: when one of the input operands of the insn is also
@@ -2138,7 +2145,7 @@ Represents several side effects performed in parallel. The square
brackets stand for a vector; the operand of @code{parallel} is a
vector of expressions. @var{x0}, @var{x1} and so on are individual
side effect expressions---expressions of code @code{set}, @code{call},
-@code{return}, @code{clobber} or @code{use}.@refill
+@code{return}, @code{clobber} or @code{use}.
``In parallel'' means that first all the values used in the individual
side-effects are computed, and second all the actual side-effects are
@@ -2248,7 +2255,7 @@ space is given to each address-difference. @var{min} and @var{max}
are set up by branch shortening and hold a label with a minimum and a
maximum address, respectively. @var{flags} indicates the relative
position of @var{base}, @var{min} and @var{max} to the containing insn
-and of @var{min} and @var{max} to @var{base}. See rtl.def for details.@refill
+and of @var{min} and @var{max} to @var{base}. See rtl.def for details.
@end table
@node Incdec
@@ -2270,7 +2277,7 @@ machines allow only a @code{reg}. @var{m} must be the machine mode
for pointers on the machine in use. The amount @var{x} is decremented
by is the length in bytes of the machine mode of the containing memory
reference of which this expression serves as the address. Here is an
-example of its use:@refill
+example of its use:
@example
(mem:DF (pre_dec:SI (reg:SI 39)))
@@ -2313,10 +2320,11 @@ The expression @var{y} must be one of three forms:
@end table
where @var{z} is an index register and @var{i} is a constant.
-Here is an example of its use:@refill
+Here is an example of its use:
@example
-(mem:SF (post_modify:SI (reg:SI 42) (plus (reg:SI 42) (reg:SI 48))))
+(mem:SF (post_modify:SI (reg:SI 42) (plus (reg:SI 42)
+ (reg:SI 48))))
@end example
This says to modify pseudo register 42 by adding the contents of pseudo
@@ -2463,7 +2471,7 @@ first insn in a @code{sequence}, @code{NEXT_INSN (PREV_INSN (@var{insn}))}
is the insn containing the @code{sequence} expression, as is the value
of @code{PREV_INSN (NEXT_INSN (@var{insn}))} is @var{insn} is the last
insn in the @code{sequence} expression. You can use these expressions
-to find the containing @code{sequence} expression.@refill
+to find the containing @code{sequence} expression.
Every insn has one of the following six expression codes:
@@ -2490,14 +2498,15 @@ recorded as a @code{jump_insn}.
accessed in the same way and in addition contain a field
@code{JUMP_LABEL} which is defined once jump optimization has completed.
-For simple conditional and unconditional jumps, this field contains the
-@code{code_label} to which this insn will (possibly conditionally)
+For simple conditional and unconditional jumps, this field contains
+the @code{code_label} to which this insn will (possibly conditionally)
branch. In a more complex jump, @code{JUMP_LABEL} records one of the
-labels that the insn refers to; the only way to find the others
-is to scan the entire body of the insn.
+labels that the insn refers to; the only way to find the others is to
+scan the entire body of the insn. In an @code{addr_vec},
+@code{JUMP_LABEL} is @code{NULL_RTX}.
-Return insns count as jumps, but since they do not refer to any labels,
-they have zero in the @code{JUMP_LABEL} field.
+Return insns count as jumps, but since they do not refer to any
+labels, their @code{JUMP_LABEL} is @code{NULL_RTX}.
@findex call_insn
@item call_insn
@@ -2511,12 +2520,25 @@ unpredictably.
accessed in the same way and in addition contain a field
@code{CALL_INSN_FUNCTION_USAGE}, which contains a list (chain of
@code{expr_list} expressions) containing @code{use} and @code{clobber}
-expressions that denote hard registers used or clobbered by the called
-function. A register specified in a @code{clobber} in this list is
-modified @emph{after} the execution of the @code{call_insn}, while a
-register in a @code{clobber} in the body of the @code{call_insn} is
-clobbered before the insn completes execution. @code{clobber}
-expressions in this list augment registers specified in
+expressions that denote hard registers and @code{MEM}s used or
+clobbered by the called function.
+
+A @code{MEM} generally points to a stack slots in which arguments passed
+to the libcall by reference (@pxref{Register Arguments,
+FUNCTION_ARG_PASS_BY_REFERENCE}) are stored. If the argument is
+caller-copied (@pxref{Register Arguments, FUNCTION_ARG_CALLEE_COPIES}),
+the stack slot will be mentioned in @code{CLOBBER} and @code{USE}
+entries; if it's callee-copied, only a @code{USE} will appear, and the
+@code{MEM} may point to addresses that are not stack slots. These
+@code{MEM}s are used only in libcalls, because, unlike regular function
+calls, @code{CONST_CALL}s (which libcalls generally are, @pxref{Flags,
+CONST_CALL_P}) aren't assumed to read and write all memory, so flow
+would consider the stores dead and remove them. Note that, since a
+libcall must never return values in memory (@pxref{Aggregate Return,
+RETURN_IN_MEMORY}), there will never be a @code{CLOBBER} for a memory
+address holding a return value.
+
+@code{CLOBBER}ed registers in this list augment registers specified in
@code{CALL_USED_REGISTERS} (@pxref{Register Basics}).
@findex code_label
@@ -2610,7 +2632,7 @@ Appears at the place in a loop that @code{continue} statements jump to.
This note indicates the place in a loop where the exit test begins for
those loops in which the exit test has been duplicated. This position
becomes another virtual start of the loop when considering loop
-invariants.
+invariants.
@findex NOTE_INSN_FUNCTION_END
@item NOTE_INSN_FUNCTION_END
@@ -2631,7 +2653,7 @@ These codes are printed symbolically when they appear in debugging dumps.
@cindex @code{HImode}, in @code{insn}
@cindex @code{QImode}, in @code{insn}
The machine mode of an insn is normally @code{VOIDmode}, but some
-phases use the mode for various purposes.
+phases use the mode for various purposes.
The common subexpression elimination pass sets the mode of an insn to
@code{QImode} when it is the first insn in a block that has already
@@ -2639,9 +2661,9 @@ been processed.
The second Haifa scheduling pass, for targets that can multiple issue,
sets the mode of an insn to @code{TImode} when it is believed that the
-instruction begins an issue group. That is, when the instruction
+instruction begins an issue group. That is, when the instruction
cannot issue simultaneously with the previous. This may be relied on
-by later passes, in particular machine-dependant reorg.
+by later passes, in particular machine-dependent reorg.
Here is a table of the extra fields of @code{insn}, @code{jump_insn}
and @code{call_insn} insns:
@@ -2661,9 +2683,9 @@ each element of the @code{parallel} must be one these codes, except that
@findex INSN_CODE
@item INSN_CODE (@var{i})
An integer that says which pattern in the machine description matches
-this insn, or -1 if the matching has not yet been attempted.
+this insn, or @minus{}1 if the matching has not yet been attempted.
-Such matching is never attempted and this field remains -1 on an insn
+Such matching is never attempted and this field remains @minus{}1 on an insn
whose pattern consists of a single @code{use}, @code{clobber},
@code{asm_input}, @code{addr_vec} or @code{addr_diff_vec} expression.
@@ -2733,11 +2755,11 @@ of values that are only used in @code{LOG_LINKS}.
These register notes annotate inputs to an insn:
@table @code
-@findex REG_DEAD
+@findex REG_DEAD
@item REG_DEAD
The value in @var{op} dies in this insn; that is to say, altering the
value immediately after this insn would not affect the future behavior
-of the program.
+of the program.
This does not necessarily mean that the register @var{op} has no useful
value after this insn since it may also be an output of the insn. In
@@ -2802,7 +2824,7 @@ different from @var{op}, but they will be equal at run time. If the
output of the single @code{set} is a @code{strict_low_part} expression,
the note refers to the register that is contained in @code{SUBREG_REG}
of the @code{subreg} expression.
-
+
For @code{REG_EQUIV}, the register is equivalent to @var{op} throughout
the entire function, and could validly be replaced in all its
occurrences by @var{op}. (``Validly'' here refers to the data flow of
@@ -2890,7 +2912,7 @@ Loop optimization uses this note to treat such a sequence as a single
operation for code motion purposes and flow analysis uses this note to
delete such sequences whose results are dead.
-A @code{REG_EQUAL} note will also usually be attached to this insn to
+A @code{REG_EQUAL} note will also usually be attached to this insn to
provide the expression being computed by the sequence.
These notes will be deleted after reload, since they are no longer
@@ -2901,7 +2923,7 @@ accurate or useful.
This is the inverse of @code{REG_RETVAL}: it is placed on the first
insn of a multi-insn sequence, and it points to the last one.
-These notes are deleted after reload, since they are no longer useful or
+These notes are deleted after reload, since they are no longer useful or
accurate.
@findex REG_CC_SETTER
@@ -2914,7 +2936,7 @@ filling is done, this may no longer be true. In this case a
@code{REG_CC_USER} note will be placed on the insn setting @code{cc0} to
point to the insn using @code{cc0} and a @code{REG_CC_SETTER} note will
be placed on the insn using @code{cc0} to point to the insn setting
-@code{cc0}.@refill
+@code{cc0}.
@end table
These values are only used in the @code{LOG_LINKS} field, and indicate
@@ -2955,7 +2977,7 @@ probability that the branch will be taken.
@item REG_BR_PRED
These notes are found in JUMP insns after delayed branch scheduling
has taken place. They indicate both the direction and the likelihood
-of the JUMP. The format is a bitmask of ATTR_FLAG_* values.
+of the JUMP@. The format is a bitmask of ATTR_FLAG_* values.
@findex REG_FRAME_RELATED_EXPR
@item REG_FRAME_RELATED_EXPR
@@ -3146,14 +3168,14 @@ problem since reading RTL occurs only as part of building the
compiler.
People frequently have the idea of using RTL stored as text in a file as
-an interface between a language front end and the bulk of GNU CC. This
+an interface between a language front end and the bulk of GCC@. This
idea is not feasible.
-GNU CC was designed to use RTL internally only. Correct RTL for a given
+GCC was designed to use RTL internally only. Correct RTL for a given
program is very dependent on the particular target machine. And the RTL
does not contain all the information about the program.
-The proper way to interface GNU CC to a new language front end is with
-the ``tree'' data structure. There is no manual for this data
-structure, but it is described in the files @file{tree.h} and
-@file{tree.def}.
+The proper way to interface GCC to a new language front end is with
+the ``tree'' data structure, described in the files @file{tree.h} and
+@file{tree.def}. The documentation for this structure (@pxref{Trees})
+is incomplete.
diff --git a/gcc/tm.texi b/gcc/doc/tm.texi
index d6557b861f8..4daa739eb8b 100644
--- a/gcc/tm.texi
+++ b/gcc/doc/tm.texi
@@ -21,7 +21,7 @@ includes @file{tm.h} and most compiler source files include
@menu
* Driver:: Controlling how the driver runs the compilation passes.
-* Run-time Target:: Defining @samp{-m} options like @samp{-m68000} and @samp{-m68020}.
+* Run-time Target:: Defining @samp{-m} options like @option{-m68000} and @option{-m68020}.
* Per-Function Data:: Defining data structures for per-function information.
* Storage Layout:: Defining sizes and alignments of data.
* Type Layout:: Defining sizes and properties of basic user data types.
@@ -54,7 +54,7 @@ You can control the compilation driver.
@table @code
@findex SWITCH_TAKES_ARG
@item SWITCH_TAKES_ARG (@var{char})
-A C expression which determines whether the option @samp{-@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.
@@ -67,7 +67,7 @@ additional options.
@findex WORD_SWITCH_TAKES_ARG
@item WORD_SWITCH_TAKES_ARG (@var{name})
-A C expression which determines whether the option @samp{-@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
@code{SWITCH_TAKES_ARG} is used for multi-character option names.
@@ -81,9 +81,9 @@ additional options.
@findex SWITCH_CURTAILS_COMPILATION
@item SWITCH_CURTAILS_COMPILATION (@var{char})
-A C expression which determines whether the option @samp{-@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, non-zero if the option does stop an executable from being
+boolean, nonzero if the option does stop an executable from being
generated, zero otherwise.
By default, this macro is defined as
@@ -104,20 +104,20 @@ If this macro is not defined, the default value is @code{""}.
@findex CPP_SPEC
@item 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.
+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.
@findex CPLUSPLUS_CPP_SPEC
@item 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
+than C@. If you do not define this macro, then the value of
@code{CPP_SPEC} (if any) will be used instead.
@findex NO_BUILTIN_SIZE_TYPE
@item NO_BUILTIN_SIZE_TYPE
-If this macro is defined, the preprocessor will not define the builtin macro
+If this macro is defined, the preprocessor will not define the built-in macro
@code{__SIZE_TYPE__}. The macro @code{__SIZE_TYPE__} must then be defined
by @code{CPP_SPEC} instead.
@@ -127,7 +127,7 @@ be defined.
@findex NO_BUILTIN_PTRDIFF_TYPE
@item NO_BUILTIN_PTRDIFF_TYPE
-If this macro is defined, the preprocessor will not define the builtin macro
+If this macro is defined, the preprocessor will not define the built-in macro
@code{__PTRDIFF_TYPE__}. The macro @code{__PTRDIFF_TYPE__} must then be
defined by @code{CPP_SPEC} instead.
@@ -137,7 +137,7 @@ be defined.
@findex NO_BUILTIN_WCHAR_TYPE
@item NO_BUILTIN_WCHAR_TYPE
-If this macro is defined, the preprocessor will not define the builtin macro
+If this macro is defined, the preprocessor will not define the built-in macro
@code{__WCHAR_TYPE__}. The macro @code{__WCHAR_TYPE__} must then be
defined by @code{CPP_SPEC} instead.
@@ -147,7 +147,7 @@ be defined.
@findex NO_BUILTIN_WINT_TYPE
@item NO_BUILTIN_WINT_TYPE
-If this macro is defined, the preprocessor will not define the builtin macro
+If this macro is defined, the preprocessor will not define the built-in macro
@code{__WINT_TYPE__}. The macro @code{__WINT_TYPE__} must then be
defined by @code{CPP_SPEC} instead.
@@ -158,8 +158,8 @@ be defined.
@findex SIGNED_CHAR_SPEC
@item SIGNED_CHAR_SPEC
A C string constant that tells the GCC driver program options to
-pass to CPP. By default, this macro is defined to pass the option
-@samp{-D__CHAR_UNSIGNED__} to CPP if @code{char} will be treated as
+pass to CPP@. By default, this macro is defined to pass the option
+@option{-D__CHAR_UNSIGNED__} to CPP if @code{char} will be treated as
@code{unsigned char} by @code{cc1}.
Do not define this macro unless you need to override the default
@@ -171,7 +171,7 @@ 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.
It can also specify how to translate options you give to GCC into options
-for GCC to pass to front ends..
+for GCC to pass to front ends.
Do not define this macro if it does not need to do anything.
@@ -184,7 +184,7 @@ give to GCC into options for GCC to pass to the @code{cc1plus}.
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.
+CC1_SPEC in CC1PLUS_SPEC@.
@findex ASM_SPEC
@item ASM_SPEC
@@ -229,7 +229,7 @@ linker command line. This constant is placed both before and after
the value of @code{LIB_SPEC}.
If this macro is not defined, the GCC driver provides a default that
-passes the string @samp{-lgcc} to the linker.
+passes the string @option{-lgcc} to the linker.
@findex STARTFILE_SPEC
@item STARTFILE_SPEC
@@ -248,6 +248,16 @@ the very end of the command given to the linker.
Do not define this macro if it does not need to do anything.
+@findex THREAD_MODEL_SPEC
+@item 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
+@code{THREAD_MODEL_SPEC} such that it evaluates to a string without
+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}.
+
@findex EXTRA_SPECS
@item EXTRA_SPECS
Define this macro to provide additional specifications to put in the
@@ -261,7 +271,7 @@ string constant that provides the specification.
Do not define this macro if it does not need to do anything.
@code{EXTRA_SPECS} is useful when an architecture contains several
-related targets, which have various @code{..._SPECS} which are similar
+related targets, which have various @code{@dots{}_SPECS} which are similar
to each other, and the maintainer would like one central place to keep
these definitions.
@@ -303,18 +313,18 @@ while the @file{config/rs6000/eabiaix.h} target file defines
@findex LINK_LIBGCC_SPECIAL
@item LINK_LIBGCC_SPECIAL
Define this macro if the driver program should find the library
-@file{libgcc.a} itself and should not pass @samp{-L} options to the
+@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 @samp{-lgcc} to tell the linker to do the search and will
-pass @samp{-L} options to it.
+the argument @option{-lgcc} to tell the linker to do the search and will
+pass @option{-L} options to it.
@findex LINK_LIBGCC_SPECIAL_1
@item 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 @samp{-lgcc} to tell the linker to do the search.
+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 @samp{-L} options.
+not affect @option{-L} options.
@findex LINK_COMMAND_SPEC
@item LINK_COMMAND_SPEC
@@ -325,6 +335,12 @@ 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.
+@findex LINK_ELIMINATE_DUPLICATE_LDIRECTORIES
+@item LINK_ELIMINATE_DUPLICATE_LDIRECTORIES
+A nonzero value causes 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.
+
@findex MULTILIB_DEFAULTS
@item MULTILIB_DEFAULTS
Define this macro as a C expression for the initializer of an array of
@@ -340,7 +356,7 @@ the target makefile fragment or if none of the options listed in
@findex RELATIVE_PREFIX_NOT_LINKDIR
@item RELATIVE_PREFIX_NOT_LINKDIR
Define this macro to tell @code{gcc} that it should only translate
-a @samp{-B} prefix into a @samp{-L} linker option if the prefix
+a @option{-B} prefix into a @option{-L} linker option if the prefix
indicates an absolute file name.
@findex STANDARD_EXEC_PREFIX
@@ -353,7 +369,7 @@ try when searching for the executable files of the compiler.
@item 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 @samp{-b} option is used, or the compiler is built as a cross
+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}.
@@ -367,13 +383,13 @@ try when searching for startup files such as @file{crt0.o}.
@item 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
-@samp{-b} option is used, or when the compiler is built as a cross
+@option{-b} option is used, or when the compiler is built as a cross
compiler.
@findex MD_STARTFILE_PREFIX_1
@item MD_STARTFILE_PREFIX_1
If defined, this macro supplies yet another prefix to try after the
-standard prefixes. It is not searched when the @samp{-b} option is
+standard prefixes. It is not searched when the @option{-b} option is
used, or when the compiler is built as a cross compiler.
@findex INIT_ENVIRONMENT
@@ -408,8 +424,8 @@ indicate whether the string should be inserted or deleted, and the string
to be inserted or deleted (a string constant).
For example, on a machine where @samp{64} at the end of the
-configuration name denotes a 64-bit target and you want the @samp{-32}
-and @samp{-64} switches to select between 32- and 64-bit targets, you would
+configuration name denotes a 64-bit target and you want the @option{-32}
+and @option{-64} switches to select between 32- and 64-bit targets, you would
code
@smallexample
@@ -452,7 +468,7 @@ usually consists of @code{GCC_INCLUDE_DIR}, @code{LOCAL_INCLUDE_DIR},
@code{SYSTEM_INCLUDE_DIR}, @code{GPLUSPLUS_INCLUDE_DIR}, and
@code{STANDARD_INCLUDE_DIR}. In addition, @code{GPLUSPLUS_INCLUDE_DIR}
and @code{GCC_INCLUDE_DIR} are defined automatically by @file{Makefile},
-and specify private search areas for GCC. The directory
+and specify private search areas for GCC@. The directory
@code{GPLUSPLUS_INCLUDE_DIR} is used only for C++ programs.
The definition should be an initializer for an array of structures.
@@ -486,7 +502,7 @@ Here is the order of prefixes tried for exec files:
@enumerate
@item
-Any prefixes specified by the user with @samp{-B}.
+Any prefixes specified by the user with @option{-B}.
@item
The environment variable @code{GCC_EXEC_PREFIX}, if any.
@@ -508,7 +524,7 @@ Here is the order of prefixes tried for startfiles:
@enumerate
@item
-Any prefixes specified by the user with @samp{-B}.
+Any prefixes specified by the user with @option{-B}.
@item
The environment variable @code{GCC_EXEC_PREFIX}, if any.
@@ -551,7 +567,7 @@ Here are run-time target specifications.
@table @code
@findex CPP_PREDEFINES
@item CPP_PREDEFINES
-Define this to be a string constant containing @samp{-D} options to
+Define this to be a string constant containing @option{-D} options to
define the predefined macros that identify this machine and system.
These macros will be predefined unless the @option{-ansi} option (or a
@option{-std} option for strict ISO C conformance) is specified.
@@ -570,7 +586,7 @@ For example, on the Sun, one can use the following value:
The result is to define the macros @code{__mc68000__}, @code{__sun__}
and @code{__unix__} unconditionally, and the macros @code{mc68000},
-@code{sun} and @code{unix} provided @samp{-ansi} is not specified.
+@code{sun} and @code{unix} provided @option{-ansi} is not specified.
@findex extern int target_flags
@item extern int target_flags;
@@ -614,23 +630,28 @@ with a subgrouping for each command option.
Each subgrouping contains a string constant, that defines the option
name, a number, which contains the bits to set in
@code{target_flags}, and a second string which is the description
-displayed by --help. If the number is negative then the bits specified
+displayed by @option{--help}. If the number is negative then the bits specified
by the number are cleared instead of being set. If the description
string is present but empty, then no help information will be displayed
for that option, but it will not count as an undocumented option. The
actual option name is made by appending @samp{-m} to the specified name.
+Non-empty description strings should be marked with @code{N_(@dots{})} for
+@command{xgettext}. In addition to the description for @option{--help},
+more detailed documentation for each option should be added to
+@file{invoke.texi}.
One of the subgroupings should have a null string. The number in
this grouping is the default value for @code{target_flags}. Any
target options act starting with that value.
-Here is an example which defines @samp{-m68000} and @samp{-m68020}
+Here is an example which defines @option{-m68000} and @option{-m68020}
with opposite meanings, and picks the latter as the default:
@smallexample
#define TARGET_SWITCHES \
@{ @{ "68020", TARGET_MASK_68020, "" @}, \
- @{ "68000", -TARGET_MASK_68020, "Compile for the 68000" @}, \
+ @{ "68000", -TARGET_MASK_68020, \
+ N_("Compile for the 68000") @}, \
@{ "", TARGET_MASK_68020, "" @}@}
@end smallexample
@@ -641,19 +662,22 @@ 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, the address of a variable, and a description string.
+of the option name, the address of a variable, and a description string
+(which should again be marked with @code{N_(@dots{})}).
The variable, type @code{char *}, is set to the variable part of the
given option if the fixed part matches. The actual option name is made
-by appending @samp{-m} to the specified name.
+by appending @samp{-m} to the specified name. Again, each option should
+also be documented in @file{invoke.texi}.
-Here is an example which defines @samp{-mshort-data-@var{number}}. If the
-given option is @samp{-mshort-data-512}, the variable @code{m88k_short_data}
+Here is an example which defines @option{-mshort-data-@var{number}}. If the
+given option is @option{-mshort-data-512}, the variable @code{m88k_short_data}
will be set to the string @code{"512"}.
@smallexample
extern char *m88k_short_data;
#define TARGET_OPTIONS \
- @{ @{ "short-data-", &m88k_short_data, "Specify the size of the short data section" @} @}
+ @{ @{ "short-data-", &m88k_short_data, \
+ N_("Specify the size of the short data section") @} @}
@end smallexample
@findex TARGET_VERSION
@@ -681,7 +705,7 @@ 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
-@samp{-O}. That is what @code{OPTIMIZATION_OPTIONS} is for.
+@option{-O}. That is what @code{OPTIMIZATION_OPTIONS} is for.
@findex OPTIMIZATION_OPTIONS
@item OPTIMIZATION_OPTIONS (@var{level}, @var{size})
@@ -691,10 +715,10 @@ just after the optimization level is determined and before the remainder
of the command options have been parsed. Values set in this macro are
used as the default values for the other command line options.
-@var{level} is the optimization level specified; 2 if @samp{-O2} is
-specified, 1 if @samp{-O} is specified, and 0 if neither is specified.
+@var{level} is the optimization level specified; 2 if @option{-O2} is
+specified, 1 if @option{-O} is specified, and 0 if neither is specified.
-@var{size} is non-zero if @samp{-Os} is specified and zero otherwise.
+@var{size} is nonzero if @option{-Os} is specified and zero otherwise.
You should not use this macro to change options that are not
machine-specific. These should uniformly selected by the same
@@ -709,7 +733,7 @@ generated code.
@item 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
-@samp{-fomit-frame-pointer} option whenever @samp{-O} is specified.
+@option{-fomit-frame-pointer} option whenever @option{-O} is specified.
@end table
@node Per-Function Data
@@ -734,19 +758,19 @@ If a target needs per-function specific data it should define the type
@code{INIT_EXPANDERS}. This macro should be used to initialise some or
all of the function pointers @code{init_machine_status},
@code{free_machine_status} and @code{mark_machine_status}. These
-pointers are explained below.
+pointers are explained below.
One typical use of per-function, target specific data is to create an
RTX to hold the register containing the function's return address. This
RTX can then be used to implement the @code{__builtin_return_address}
function, for level 0.
-Note - earlier implementations of GCC used a single data area to hold
+Note---earlier implementations of GCC used a single data area to hold
all of the per-function information. Thus when processing of a nested
function began the old per-function data had to be pushed onto a
stack, and when the processing was finished, it had to be popped off the
stack. GCC used to provide function pointers called
-@code{save_machine_status} and @code{restore_machine_status} to handle
+@code{save_machine_status} and @code{restore_machine_status} to handle
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.
@@ -764,23 +788,23 @@ function pointers below.
@findex init_machine_status
@item init_machine_status
This is a @code{void (*)(struct function *)} function pointer. If this
-pointer is non-NULL it will be called once per function, before 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 initialisation of the @code{struct function} structure. It is
intended that this would be used to initialise the @code{machine} of
-that struture.
+that structure.
@findex free_machine_status
@item free_machine_status
This is a @code{void (*)(struct function *)} function pointer. If this
-pointer is non-NULL it will be called once per function, after the
+pointer is non-@code{NULL} it will be called once per function, after the
function has been compiled, in order to allow any memory allocated
during the @code{init_machine_status} function call to be freed.
@findex mark_machine_status
@item mark_machine_status
This is a @code{void (*)(struct function *)} function pointer. If this
-pointer is non-NULL it will be called once per function in order to mark
+pointer is non-@code{NULL} it will be called once per function in order to mark
any data items in the @code{struct machine_function} structure which
need garbage collection.
@@ -823,9 +847,9 @@ macro need not be a constant.
@findex LIBGCC2_WORDS_BIG_ENDIAN
@item LIBGCC2_WORDS_BIG_ENDIAN
-Define this macro if WORDS_BIG_ENDIAN is not constant. This must be a
-constant value with the same meaning as WORDS_BIG_ENDIAN, which will be
-used only when compiling libgcc2.c. Typically the value will be set
+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.
@findex FLOAT_WORDS_BIG_ENDIAN
@@ -933,15 +957,21 @@ size of an integer.
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.
+default if @code{PREFERRED_STACK_BOUNDARY} is not defined.
@findex PREFERRED_STACK_BOUNDARY
@item PREFERRED_STACK_BOUNDARY
Define this macro if you wish to preserve a certain alignment for
the stack pointer. The definition is a C expression
-for the desired alignment (measured in bits). If STACK_BOUNDARY is
+for the desired alignment (measured in bits). If @code{STACK_BOUNDARY} is
also defined, this macro must evaluate to a value equal to or larger
-than STACK_BOUNDARY.
+than @code{STACK_BOUNDARY}.
+
+@findex FORCE_PREFERRED_STACK_BOUNDARY_IN_MAIN
+@item 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}.
@cindex @code{PUSH_ROUNDING}, interaction with @code{PREFERRED_STACK_BOUNDARY}
If @code{PUSH_ROUNDING} is not defined, the stack will always be aligned
@@ -1028,7 +1058,7 @@ make it all fit in fewer cache lines.
@findex EMPTY_FIELD_BOUNDARY
@item EMPTY_FIELD_BOUNDARY
-Alignment in bits to be given to a structure bit field that follows an
+Alignment in bits to be given to a structure bit-field that follows an
empty field such as @code{int : 0;}.
Note that @code{PCC_BITFIELD_TYPE_MATTERS} also affects the alignment
@@ -1051,16 +1081,16 @@ go slower in that case, define this macro as 0.
@findex PCC_BITFIELD_TYPE_MATTERS
@item PCC_BITFIELD_TYPE_MATTERS
Define this if you wish to imitate the way many other C compilers handle
-alignment of bitfields and the structures that contain them.
+alignment of bit-fields and the structures that contain them.
-The behavior is that the type written for a bitfield (@code{int},
+The behavior is that the type written for a bit-field (@code{int},
@code{short}, or other integer type) imposes an alignment for the
entire structure, as if the structure really did contain an ordinary
-field of that type. In addition, the bitfield is placed within the
+field of that type. In addition, the bit-field is placed within the
structure so that it would fit within such a field, not crossing a
boundary for it.
-Thus, on most machines, a bitfield whose type is written as @code{int}
+Thus, on most machines, a bit-field whose type is written as @code{int}
would not cross a four-byte boundary, and would force four-byte
alignment for the whole structure. (The alignment used may not be four
bytes; it is controlled by the other alignment parameters.)
@@ -1069,20 +1099,20 @@ If the macro is defined, its definition should be a C expression;
a nonzero value for the expression enables this behavior.
Note that if this macro is not defined, or its value is zero, some
-bitfields may cross more than one alignment boundary. The compiler can
+bit-fields may cross more than one alignment boundary. The compiler can
support such references if there are @samp{insv}, @samp{extv}, and
@samp{extzv} insns that can directly reference memory.
-The other known way of making bitfields work is to define
+The other known way of making bit-fields work is to define
@code{STRUCTURE_SIZE_BOUNDARY} as large as @code{BIGGEST_ALIGNMENT}.
Then every structure can be accessed with fullwords.
-Unless the machine has bitfield instructions or you define
+Unless the machine has bit-field instructions or you define
@code{STRUCTURE_SIZE_BOUNDARY} that way, you must define
@code{PCC_BITFIELD_TYPE_MATTERS} to have a nonzero value.
If your aim is to make GCC use the same conventions for laying out
-bitfields as are used by another compiler, here is how to investigate
+bit-fields as are used by another compiler, here is how to investigate
what the other compiler does. Compile and run this program:
@example
@@ -1116,7 +1146,7 @@ get from @code{PCC_BITFIELD_TYPE_MATTERS}.
@findex BITFIELD_NBYTES_LIMITED
@item BITFIELD_NBYTES_LIMITED
Like PCC_BITFIELD_TYPE_MATTERS except that its effect is limited to
-aligning a bitfield within the structure.
+aligning a bit-field within the structure.
@findex STRUCT_FORCE_BLK
@item STRUCT_FORCE_BLK (@var{field})
@@ -1209,18 +1239,26 @@ This macro need not be defined if there is no work for it to do.
@findex TARGET_FLOAT_FORMAT
@item TARGET_FLOAT_FORMAT
A code distinguishing the floating point format of the target machine.
-There are three defined values:
+There are five defined values:
@table @code
@findex IEEE_FLOAT_FORMAT
@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 this macro when the format is IEEE@.
@findex VAX_FLOAT_FORMAT
@item VAX_FLOAT_FORMAT
This code indicates the peculiar format used on the Vax.
+@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.
+
@findex UNKNOWN_FLOAT_FORMAT
@item UNKNOWN_FLOAT_FORMAT
This code indicates any other format.
@@ -1238,16 +1276,16 @@ machine and @code{HOST_FLOAT_WORDS_BIG_ENDIAN} for the host.
@findex DEFAULT_VTABLE_THUNKS
@item DEFAULT_VTABLE_THUNKS
GCC supports two ways of implementing C++ vtables: traditional or with
-so-called ``thunks''. The flag @samp{-fvtable-thunk} chooses between them.
+so-called ``thunks''. The flag @option{-fvtable-thunk} chooses between them.
Define this macro to be a C expression for the default value of that flag.
If @code{DEFAULT_VTABLE_THUNKS} is 0, GCC uses the traditional
implementation by default. The ``thunk'' implementation is more efficient
(especially if you have provided an implementation of
@code{ASM_OUTPUT_MI_THUNK}, see @ref{Function Entry}), but is not binary
-compatible with code compiled using the traditional implementation.
+compatible with code compiled using the traditional implementation.
If you are writing a new port, define @code{DEFAULT_VTABLE_THUNKS} to 1.
-If you do not define this macro, the default for @samp{-fvtable-thunk} is 0.
+If you do not define this macro, the default for @option{-fvtable-thunk} is 0.
@end table
@node Type Layout
@@ -1312,6 +1350,12 @@ target machine. If this is undefined, the default is
largest value that @code{CHAR_TYPE_SIZE} can have at run-time. This is
used in @code{cpp}.
+@findex BOOL_TYPE_SIZE
+@item BOOL_TYPE_SIZE
+A C expression for the size in bits of the C++ type @code{bool} on the
+target machine. If you don't define this, the default is
+@code{CHAR_TYPE_SIZE}.
+
@findex FLOAT_TYPE_SIZE
@item FLOAT_TYPE_SIZE
A C expression for the size in bits of the type @code{float} on the
@@ -1341,8 +1385,8 @@ is the default.
@item 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 @samp{-fsigned-char}
-and @samp{-funsigned-char}.
+always override this default with the options @option{-fsigned-char}
+and @option{-funsigned-char}.
@findex DEFAULT_SHORT_ENUMS
@item DEFAULT_SHORT_ENUMS
@@ -1453,6 +1497,45 @@ label.
On certain machines, it is important to have a separate label for each
selector because this enables the linker to eliminate duplicate selectors.
+@findex TARGET_PTRMEMFUNC_VBIT_LOCATION
+@item TARGET_PTRMEMFUNC_VBIT_LOCATION
+The C++ compiler represents a pointer-to-member-function with a struct
+that looks like:
+
+@example
+ struct @{
+ union @{
+ void (*fn)();
+ ptrdiff_t vtable_index;
+ @};
+ ptrdiff_t delta;
+ @};
+@end example
+
+@noindent
+The C++ compiler must use one bit to indicate whether the function that
+will be called through a pointer-to-member-function is virtual.
+Normally, we assume that the low-order bit of a function pointer must
+always be zero. Then, by ensuring that the vtable_index is odd, we can
+distinguish which variant of the union is in use. But, on some
+platforms function pointers can be odd, and so this doesn't work. In
+that case, we use the low-order bit of the @code{delta} field, and shift
+the remainder of the @code{delta} field to the left.
+
+GCC will automatically make the right selection about where to store
+this bit using the @code{FUNCTION_BOUNDARY} setting for your platform.
+However, some platforms such as ARM/Thumb have @code{FUNCTION_BOUNDARY}
+set such that functions always start at even addresses, but the lowest
+bit of pointers to functions indicate whether the function at that
+address is in ARM or Thumb mode. If this is the case of your
+architecture, you should define this macro to
+@code{ptrmemfunc_vbit_in_delta}.
+
+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}.
+
@findex TARGET_BELL
@item TARGET_BELL
A C constant expression for the integer value for escape sequence
@@ -1530,8 +1613,8 @@ register @var{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 @code{CONDITIONAL_REGISTER_USAGE}, or by
-the user with the command options @samp{-ffixed-@var{reg}},
-@samp{-fcall-used-@var{reg}} and @samp{-fcall-saved-@var{reg}}.
+the user with the command options @option{-ffixed-@var{reg}},
+@option{-fcall-used-@var{reg}} and @option{-fcall-saved-@var{reg}}.
@findex CALL_USED_REGISTERS
@item CALL_USED_REGISTERS
@@ -1553,7 +1636,7 @@ exit, if the register is used within the function.
@cindex call-used register
@cindex call-clobbered register
@cindex call-saved register
-A C expression that is non-zero if it is not permissible to store a
+A C expression that is nonzero if it is not permissible to store a
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
@@ -1571,9 +1654,9 @@ Zero or more C statements that may conditionally modify five variables
Before the macro is called @code{fixed_regs}, @code{call_used_regs}
@code{reg_class_contents} and @code{reg_names} have been initialized
from @code{FIXED_REGISTERS}, @code{CALL_USED_REGISTERS},
-@code{REG_CLASS_CONTENTS} and @code{REGISTER_NAMES}, respectively,
-@code{global_regs} has been cleared, and any @samp{-ffixed-@var{reg}},
-@samp{-fcall-used-@var{reg}} and @samp{-fcall-saved-@var{reg}} command
+@code{REG_CLASS_CONTENTS} and @code{REGISTER_NAMES}, respectively,
+@code{global_regs} has been cleared, and any @option{-ffixed-@var{reg}},
+@option{-fcall-used-@var{reg}} and @option{-fcall-saved-@var{reg}} command
options have been applied.
This is necessary in case the fixed or call-clobbered registers depend
@@ -1586,7 +1669,7 @@ You need not define this macro if it has no work to do.
If the usage of an entire class of registers depends on the target
flags, you may indicate this to GCC by using this macro to modify
@code{fixed_regs} and @code{call_used_regs} to 1 for each of the
-registers in the classes which should not be used by GCC. Also define
+registers in the classes which should not be used by GCC@. Also define
the macro @code{REG_CLASS_FROM_LETTER} to return @code{NO_REGS} if it
is called with a letter for a class that shouldn't be used.
@@ -1699,7 +1782,7 @@ definition of this macro is
@findex ALTER_HARD_SUBREG
@item ALTER_HARD_SUBREG (@var{tgt_mode}, @var{word}, @var{src_mode}, @var{regno})
-A C expression that returns an adjusted hard register number for
+A C expression that returns an adjusted hard register number for
@smallexample
(subreg:@var{tgt_mode} (reg:@var{src_mode} @var{regno}) @var{word})
@@ -1837,7 +1920,7 @@ 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.
If @var{regno} is a register number which should not appear in a leaf
-function before renumbering, then the expression should yield -1, which
+function before renumbering, then the expression should yield @minus{}1, which
will cause the compiler to abort.
Define this macro only if the target machine offers a way to optimize the
@@ -2109,7 +2192,7 @@ 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
+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
@@ -2150,7 +2233,7 @@ Their classes are obtained from the constraints in the insn pattern.
@var{x} might be a pseudo-register or a @code{subreg} of a
pseudo-register, which could either be in a hard register or in memory.
-Use @code{true_regnum} to find out; it will return -1 if the pseudo is
+Use @code{true_regnum} to find out; it will return @minus{}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
@@ -2165,7 +2248,7 @@ general registers.
@item 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 non-zero if objects of mode
+those machines to be a C expression that is nonzero if objects of mode
@var{m} in registers of @var{class1} can only be copied to registers of
class @var{class2} by storing a register of @var{class1} into memory
and loading that memory location into a register of @var{class2}.
@@ -2214,14 +2297,14 @@ to be in specific registers (like an accumulator), and reload will fail
if the required hard register is used for another purpose across such an
insn.
-Define @code{SMALL_REGISTER_CLASSES} to be an expression with a non-zero
-value on these machines. When this macro has a non-zero value, the
+Define @code{SMALL_REGISTER_CLASSES} to be an expression with a nonzero
+value on these machines. When this macro has a nonzero value, the
compiler will try to minimize the lifetime of hard registers.
-It is always safe to define this macro with a non-zero value, but if you
+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 non-zero value when it is required, the compiler will run out of
+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.
@@ -2262,7 +2345,7 @@ which the compiler may not change modes arbitrarily.
@item CLASS_CANNOT_CHANGE_MODE_P(@var{from}, @var{to})
A C expression that is true if, for a register in
-@code{CLASS_CANNOT_CHANGE_MODE}, the requested mode punning is illegal.
+@code{CLASS_CANNOT_CHANGE_MODE}, the requested mode punning is invalid.
For the example, loading 32-bit integer or floating-point objects into
floating-point registers on the Alpha extends them to 64-bits.
@@ -2474,7 +2557,7 @@ You only need to define this macro if you want to support call frame
debugging information like that provided by DWARF 2.
If this RTL is a @code{REG}, you should also define
-DWARF_FRAME_RETURN_COLUMN to @code{DWARF_FRAME_REGNUM (REGNO)}.
+@code{DWARF_FRAME_RETURN_COLUMN} to @code{DWARF_FRAME_REGNUM (REGNO)}.
@findex INCOMING_FRAME_SP_OFFSET
@item INCOMING_FRAME_SP_OFFSET
@@ -2491,7 +2574,7 @@ debugging information like that provided by DWARF 2.
@item 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
+final value should coincide with that calculated by
@code{INCOMING_FRAME_SP_OFFSET}. Which is unfortunately not usable
during virtual register instantiation.
@@ -2505,10 +2588,85 @@ 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.
+@findex EH_RETURN_DATA_REGNO
+@item 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.
+
+The exception handling library routines communicate with the exception
+handlers via a set of agreed upon registers. Ideally these registers
+should be call-clobbered; it is possible to use call-saved registers,
+but may negatively impact code size. The target must support at least
+2 data registers, but should define 4 if there are enough free registers.
+
+You must define this macro if you want to support call frame exception
+handling like that provided by DWARF 2.
+
+@findex EH_RETURN_STACKADJ_RTX
+@item 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.
+It will be assigned zero on code paths that return normally.
+
+Typically this is a call-clobbered hard register that is otherwise
+untouched by the epilogue, but could also be a stack slot.
+
+You must define this macro if you want to support call frame exception
+handling like that provided by DWARF 2.
+
+@findex EH_RETURN_HANDLER_RTX
+@item 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.
+
+Typically this is the location in the call frame at which the normal
+return address is stored. For targets that return by popping an
+address off the stack, this might be a memory address just below
+the @emph{target} call frame rather than inside the current call
+frame. @code{EH_RETURN_STACKADJ_RTX} will have already been assigned,
+so it may be used to calculate the location of the target call frame.
+
+Some targets have more complex requirements than storing to an
+address calculable during initial code generation. In that case
+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.
+
+@findex ASM_PREFERRED_EH_DATA_FORMAT
+@item 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,
+and so may be read-only.
+
+@var{code} is 0 for data, 1 for code labels, 2 for function pointers.
+@var{global} is true if the symbol may be affected by dynamic relocations.
+The macro should return a combination of the @code{DW_EH_PE_*} defines
+as found in @file{dwarf2.h}.
+
+If this macro is not defined, pointers will not be encoded but
+represented directly.
+
+@findex ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX
+@item 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
+be defined if the target uses text-relative or data-relative encodings.
+
+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.
+
@findex SMALL_STACK
@item SMALL_STACK
Define this macro if the stack size for the target is very small. This
-has the effect of disabling gcc's builtin @samp{alloca}, though
+has the effect of disabling gcc's built-in @samp{alloca}, though
@samp{__builtin_alloca} is not affected.
@end table
@@ -2516,7 +2674,7 @@ has the effect of disabling gcc's builtin @samp{alloca}, though
@subsection Specifying How Stack Checking is Done
GCC will check that stack references are within the boundaries of
-the stack, if the @samp{-fstack-check} is specified, in one of three ways:
+the stack, if the @option{-fstack-check} is specified, in one of three ways:
@enumerate
@item
@@ -2544,8 +2702,8 @@ will use the third approach.
@findex STACK_CHECK_BUILTIN
@item 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
+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.
@@ -2558,7 +2716,7 @@ default value of 4096 is suitable for most systems.
@findex STACK_CHECK_PROBE_LOAD
@item STACK_CHECK_PROBE_LOAD
-A integer which is nonzero if GCC should perform the stack probe
+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.
@@ -2589,7 +2747,7 @@ use the default of four words.
@item 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
-@samp{-fstack-check}.
+@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
@@ -2669,7 +2827,7 @@ register windows are used, the register number as seen by the called
function is @code{STATIC_CHAIN_INCOMING_REGNUM}, while the register
number as seen by the calling function is @code{STATIC_CHAIN_REGNUM}. If
these registers are the same, @code{STATIC_CHAIN_INCOMING_REGNUM} need
-not be defined.@refill
+not be defined.
The static chain register need not be a fixed register.
@@ -2685,7 +2843,7 @@ If the static chain is passed in memory, these macros provide rtx giving
@code{STATIC_CHAIN} and @code{STATIC_CHAIN_INCOMING} give the locations
as seen by the calling and called functions, respectively. Often the former
will be at an offset from the stack pointer and the latter at an offset from
-the frame pointer.@refill
+the frame pointer.
@findex stack_pointer_rtx
@findex frame_pointer_rtx
@@ -2721,7 +2879,7 @@ 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
@code{FRAME_POINTER_REQUIRED} says. You don't need to worry about
-them.@refill
+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
@@ -2770,7 +2928,7 @@ specified first since that is the preferred elimination.
@findex CAN_ELIMINATE
@item CAN_ELIMINATE (@var{from-reg}, @var{to-reg})
-A C expression that returns non-zero if the compiler is allowed to try
+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
@@ -2813,12 +2971,12 @@ header files, it defaults to 0.
@findex PUSH_ARGS
@item PUSH_ARGS
-A C expression. If nonzero, push insns will be used to pass
+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 PUSH_ARGS is nonzero, PUSH_ROUNDING must be defined too.
+it. When @code{PUSH_ARGS} is nonzero, @code{PUSH_ROUNDING} must be defined too.
On some machines, the definition
@findex PUSH_ROUNDING
@@ -2844,7 +3002,7 @@ alignment. Then the definition should be
@findex ACCUMULATE_OUTGOING_ARGS
@findex current_function_outgoing_args_size
@item ACCUMULATE_OUTGOING_ARGS
-A C expression. If nonzero, the maximum amount of space required for outgoing arguments
+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
onto the stack for each call; instead, the function prologue should
@@ -2928,7 +3086,7 @@ after the function returns.
@var{fundecl} is a C variable whose value is a tree node that describes
the function in question. Normally it is a node of type
@code{FUNCTION_DECL} that describes the declaration of the function.
-From this you can obtain the DECL_MACHINE_ATTRIBUTES of the function.
+From this you can obtain the @code{DECL_MACHINE_ATTRIBUTES} of the function.
@var{funtype} is a C variable whose value is a tree node that
describes the function in question. Normally it is a node of type
@@ -2989,7 +3147,7 @@ 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 @code{parallel} RTX. This is
+The value of the expression can also be a @code{parallel} RTX@. This is
used when an argument is passed in multiple locations. The mode of the
of the @code{parallel} should be the mode of the entire argument. The
@code{parallel} holds any number of @code{expr_list} pairs; each one
@@ -2999,7 +3157,7 @@ register in which to pass this part of the argument, and the mode of the
register RTX indicates how large this part of the argument is. The
second operand of the @code{expr_list} is a @code{const_int} which gives
the offset in bytes into the entire argument of where this part starts.
-As a special exception the first @code{expr_list} in the @code{parallel}
+As a special exception the first @code{expr_list} in the @code{parallel}
RTX may have a first operand of zero. This indicates that the entire
argument is also stored on the stack.
@@ -3014,7 +3172,7 @@ by making @code{FUNCTION_ARG} return 0 whenever @var{named} is 0.
You may use the macro @code{MUST_PASS_IN_STACK (@var{mode}, @var{type})}
in the definition of this macro to determine if this argument is of a
type that must be passed in the stack. If @code{REG_PARM_STACK_SPACE}
-is not defined and @code{FUNCTION_ARG} returns non-zero for such an
+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.
@@ -3039,7 +3197,7 @@ be defined in a similar fashion to tell the function being called
where the arguments will arrive.
If @code{FUNCTION_INCOMING_ARG} is not defined, @code{FUNCTION_ARG}
-serves both purposes.@refill
+serves both purposes.
@findex FUNCTION_ARG_PARTIAL_NREGS
@item FUNCTION_ARG_PARTIAL_NREGS (@var{cum}, @var{mode}, @var{type}, @var{named})
@@ -3083,7 +3241,7 @@ definition of this macro might be
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
-routine being called. When FUNCTION_ARG_CALLEE_COPIES is defined and is
+routine being called. When @code{FUNCTION_ARG_CALLEE_COPIES} is defined and is
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;
@@ -3138,7 +3296,7 @@ finding the arguments for the function being compiled. If this macro is
undefined, @code{INIT_CUMULATIVE_ARGS} is used instead.
The value passed for @var{libname} is always 0, since library routines
-with special calling conventions are never compiled with GCC. The
+with special calling conventions are never compiled with GCC@. The
argument @var{libname} exists for symmetry with
@code{INIT_CUMULATIVE_ARGS}.
@c could use "this macro" in place of @code{INIT_CUMULATIVE_ARGS}, maybe.
@@ -3150,7 +3308,7 @@ 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.
Once this is done, the variable @var{cum} is suitable for analyzing
-the @emph{following} argument with @code{FUNCTION_ARG}, etc.@refill
+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
@@ -3174,8 +3332,8 @@ constant size shorter than an @code{int}, and upward otherwise.
@findex PAD_VARARGS_DOWN
@item 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
+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.
@@ -3198,7 +3356,7 @@ stack.
@findex LOAD_ARGS_REVERSED
@item LOAD_ARGS_REVERSED
If defined, the order in which arguments are loaded into their
-respective argument registers is reversed so that the last
+respective argument registers is reversed so that the last
argument is loaded first. This macro only affects arguments
passed in registers.
@@ -3216,7 +3374,7 @@ values---values that can fit in registers.
@table @code
@findex TRADITIONAL_RETURN_FLOAT
@item TRADITIONAL_RETURN_FLOAT
-Define this macro if @samp{-traditional} should not cause functions
+Define this macro if @option{-traditional} should not cause functions
declared to return @code{float} to convert the value to @code{double}.
@findex FUNCTION_VALUE
@@ -3227,7 +3385,7 @@ a tree node representing a data type. Write @code{TYPE_MODE
(@var{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).@refill
+mode).
The value of the expression is usually a @code{reg} RTX for the hard
register where the return value is stored. The value can also be a
@@ -3242,7 +3400,7 @@ If the precise function being called is known, @var{func} is a tree
node (@code{FUNCTION_DECL}) for it; otherwise, @var{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.@refill
+known.
@code{FUNCTION_VALUE} is not used for return vales with aggregate data
types, because these are returned in another way. See
@@ -3257,10 +3415,10 @@ the same as the one in which the caller sees the value.
For such machines, @code{FUNCTION_VALUE} computes the register in which
the caller will see the value. @code{FUNCTION_OUTGOING_VALUE} should be
defined in a similar fashion to tell the function where to put the
-value.@refill
+value.
If @code{FUNCTION_OUTGOING_VALUE} is not defined,
-@code{FUNCTION_VALUE} serves both purposes.@refill
+@code{FUNCTION_VALUE} serves both purposes.
@code{FUNCTION_OUTGOING_VALUE} is not used for return vales with
aggregate data types, because these are returned in another way. See
@@ -3274,7 +3432,7 @@ being called is known, @var{func} is a tree node
(@code{FUNCTION_DECL}) for it; otherwise, @var{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.@refill
+known.
Note that ``library function'' in this context means a compiler
support routine, used to perform arithmetic, whose name is known
@@ -3335,7 +3493,7 @@ always returned. Here @var{type} will be a C expression of type
@code{tree}, representing the data type of the value.
Note that values of mode @code{BLKmode} must be explicitly handled
-by this macro. Also, the option @samp{-fpcc-struct-return}
+by this macro. Also, the option @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 @code{BLKmode}
@@ -3349,7 +3507,7 @@ to indicate this.
@item 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.
+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 @code{RETURN_IN_MEMORY} macro.
@@ -3395,8 +3553,8 @@ the address of a static variable containing the value.
Do not define this if the usual system convention is for the caller to
pass an address to the subroutine.
-This macro has effect in @samp{-fpcc-struct-return} mode, but it does
-nothing when you use @samp{-freg-struct-return} mode.
+This macro has effect in @option{-fpcc-struct-return} mode, but it does
+nothing when you use @option{-freg-struct-return} mode.
@end table
@node Caller Saves
@@ -3411,9 +3569,9 @@ must live across calls.
@item DEFAULT_CALLER_SAVES
Define this macro if function calls on the target machine do not preserve
any registers; in other words, if @code{CALL_USED_REGISTERS} has 1
-for all registers. When defined, this macro enables @samp{-fcaller-saves}
+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 @samp{-fcaller-saves} is the default.
+levels 2 and higher, where @option{-fcaller-saves} is the default.
@findex CALLER_SAVE_PROFITABLE
@item CALLER_SAVE_PROFITABLE (@var{refs}, @var{calls})
@@ -3500,7 +3658,7 @@ arguments. But usually, on such machines, nothing else has been pushed
yet, because the function prologue itself does all the pushing.) This
region is used on machines where an argument may be passed partly in
registers and partly in memory, and, in some cases to support the
-features in @file{varargs.h} and @file{stdargs.h}.
+features in @code{<varargs.h>} and @code{<stdarg.h>}.
@item
An area of memory used to save certain registers used by the function.
@@ -3580,7 +3738,7 @@ is nonzero for such a function. @xref{Leaf Functions}.
On some machines, some functions pop their arguments on exit while
others leave that for the caller to do. For example, the 68020 when
-given @samp{-mrtd} pops arguments in functions that take a fixed
+given @option{-mrtd} pops arguments in functions that take a fixed
number of arguments.
@findex current_function_pops_args
@@ -3637,7 +3795,7 @@ First, emit code to add the integer @var{delta} to the location that
contains the incoming first argument. Assume that this argument
contains a pointer, and is the one used to pass the @code{this} pointer
in C++. This is the incoming argument @emph{before} the function prologue,
-e.g. @samp{%o0} on a sparc. The addition must preserve the values of
+e.g.@: @samp{%o0} on a sparc. The addition must preserve the values of
all other incoming arguments.
After the addition, emit code to jump to @var{function}, which is a
@@ -3655,7 +3813,7 @@ have already been extracted from it.) It might possibly be useful on
some targets, but probably not.
If you do not define this macro, the target-independent code in the C++
-frontend will generate a less efficient heavyweight thunk that calls
+front end will generate a less efficient heavyweight thunk that calls
@var{function} instead of jumping to it. The generic approach does
not support varargs.
@end table
@@ -3674,7 +3832,7 @@ assembler code to call the profiling subroutine @code{mcount}.
@findex mcount
The details of how @code{mcount} expects to be called are determined by
-your operating system environment, not by GCC. To figure them out,
+your operating system environment, not by GCC@. To figure them out,
compile a small program for profiling using the system's installed C
compiler and look at the assembler code that results.
@@ -3730,7 +3888,7 @@ that you know will result.
The first word of this block is a flag which will be nonzero if the
object module has already been initialized. So test this word first,
and do not call @code{__bb_init_func} if the flag is
-nonzero. BLOCK_OR_LABEL contains a unique number which may be used to
+nonzero. @var{labelno} contains a unique number which may be used to
generate a label as a branch destination when @code{__bb_init_func}
will not be called.
@@ -3749,14 +3907,14 @@ local_label:
Output code to call the subroutine @code{__bb_init_trace_func}
and pass two parameters to it. The first parameter is the same as
for @code{__bb_init_func}. The second parameter is the number of the
-first basic block of the function as given by BLOCK_OR_LABEL. Note
+first basic block of the function as given by @var{labelno}. Note
that @code{__bb_init_trace_func} has to be called, even if the object
module has been initialized already.
Described in assembler language, the code to be output looks like:
@example
parameter1 <- LPBX0
-parameter2 <- BLOCK_OR_LABEL
+parameter2 <- @var{labelno}
call __bb_init_trace_func
@end example
@end table
@@ -3791,7 +3949,7 @@ that you know will result.
Described in assembler language, the code to be output looks like:
@smallexample
-inc (LPBX2+4*BLOCKNO)
+inc (LPBX2+4*@var{blockno})
@end smallexample
@vindex __bb
@@ -3802,7 +3960,7 @@ call the function @code{__bb_trace_func}, which will increment the
counter.
@code{__bb} consists of two words. In the first word, the current
-basic block number, as given by BLOCKNO, has to be stored. In
+basic block number, as given by @var{blockno}, has to be stored. In
the second word, the address of a block allocated in the object
module has to be stored. The address is given by the label created
with this statement:
@@ -3813,7 +3971,7 @@ ASM_GENERATE_INTERNAL_LABEL (@var{buffer}, "LPBX", 0);
Described in assembler language, the code to be output looks like:
@example
-move BLOCKNO -> (__bb)
+move @var{blockno} -> (__bb)
move LPBX0 -> (__bb+4)
call __bb_trace_func
@end example
@@ -3828,7 +3986,7 @@ assembler code to call function @code{__bb_trace_ret}. The
assembler code should only be output
if the global compile flag @code{profile_block_flag} == 2. This
macro has to be used at every place where code for returning from
-a function is generated (e.g. @code{FUNCTION_EPILOGUE}). Although
+a function is generated (e.g.@: @code{FUNCTION_EPILOGUE}). Although
you have to write the definition of @code{FUNCTION_EPILOGUE}
as well, you have to define this macro to tell the compiler, that
the proper call to @code{__bb_trace_ret} is produced.
@@ -3868,6 +4026,21 @@ Registers or condition codes clobbered by @code{FUNCTION_PROLOGUE} or
@item BLOCK_PROFILER_CODE
A C function or functions which are needed in the library to
support block profiling.
+
+@findex TARGET_ALLOWS_PROFILING_WITHOUT_FRAME_POINTER
+@item TARGET_ALLOWS_PROFILING_WITHOUT_FRAME_POINTER
+On some targets, it is impossible to use profiling when the frame
+pointer has been omitted. For example, on x86 GNU/Linux systems,
+the @code{mcount} routine provided by the GNU C Library finds the
+address of the routine that called the routine that called @code{mcount}
+by looking in the immediate caller's stack frame. If the immediate
+caller has no frame pointer, this lookup will fail.
+
+By default, GCC assumes that the target does allow profiling when the
+frame pointer is omitted. This macro should be defined to a C
+expression that evaluates to @code{false} if the target does not allow
+profiling when the frame pointer is omitted.
+
@end table
@node Inlining
@@ -3878,7 +4051,7 @@ By default if a function has a target specific attribute attached to it,
it will not be inlined. This behaviour can be overridden if the target
defines the @samp{FUNCTION_ATTRIBUTE_INLINABLE_P} macro. This macro
takes one argument, a @samp{DECL} describing the function. It should
-return non-zero if the function can be inlined, otherwise it should
+return nonzero if the function can be inlined, otherwise it should
return 0.
@node Tail Calling
@@ -3890,12 +4063,12 @@ return 0.
@findex FUNCTION_OK_FOR_SIBCALL
@item FUNCTION_OK_FOR_SIBCALL (@var{decl})
A C expression that evaluates to true if it is ok to perform a sibling
-call to @var{decl}.
+call to @var{decl}.
It is not uncommon for limitations of calling conventions to prevent
tail calls to functions outside the current unit of translation, or
during PIC compilation. Use this macro to enforce these restrictions,
-as the @code{sibcall} md pattern can not fail, or fall over to a
+as the @code{sibcall} md pattern can not fail, or fall over to a
``normal'' call.
@end table
@@ -3903,13 +4076,13 @@ as the @code{sibcall} md pattern can not fail, or fall over to a
@section Implementing the Varargs Macros
@cindex varargs implementation
-GCC comes with an implementation of @file{varargs.h} and
-@file{stdarg.h} that work without change on machines that pass arguments
+GCC comes with an implementation of @code{<varargs.h>} and
+@code{<stdarg.h>} that work without change on machines that pass arguments
on the stack. Other machines require their own implementations of
varargs, and the two machine independent header files must have
conditionals to include it.
-ISO @file{stdarg.h} differs from traditional @file{varargs.h} mainly in
+ISO @code{<stdarg.h>} differs from traditional @code{<varargs.h>} mainly in
the calling convention for @code{va_start}. The traditional
implementation takes just one argument, which is the variable in which
to store the argument pointer. The ISO implementation of
@@ -3969,7 +4142,7 @@ values accessed by @code{__builtin_args_info}.
@item __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
+argument, as type @code{void *}. If @code{ARGS_GROW_DOWNWARD}, it
returns the address of the location above the first anonymous stack
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
@@ -4200,12 +4373,12 @@ the instruction cache directly, you can define the following macro.
@table @code
@findex CLEAR_INSN_CACHE
-@item CLEAR_INSN_CACHE (@var{BEG}, @var{END})
+@item CLEAR_INSN_CACHE (@var{beg}, @var{end})
If defined, expands to a C expression clearing the @emph{instruction
cache} in the specified interval. If it is not defined, and the macro
-INSN_CACHE_SIZE is defined, some generic code is generated to clear the
+@code{INSN_CACHE_SIZE} is defined, some generic code is generated to clear the
cache. The definition of this macro would typically be a series of
-@code{asm} statements. Both @var{BEG} and @var{END} are both pointer
+@code{asm} statements. Both @var{beg} and @var{end} are both pointer
expressions.
@end table
@@ -4220,7 +4393,7 @@ its cache line. Look in @file{m68k.h} as a guide.
@item 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
+which will be compiled with GCC@. They go in a library function named
@code{__transfer_from_trampoline}.
If you need to avoid executing the ordinary prologue code of a compiled
@@ -4313,7 +4486,7 @@ not define this macro, the default name is used, which is
@findex INIT_TARGET_OPTABS
@item 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
+routines renames existing ones. @code{init_optabs} calls this macro after
initializing all the normal library routines.
@findex FLOAT_LIB_COMPARE_RETURNS_BOOL (@var{mode}, @var{comparison})
@@ -4351,12 +4524,13 @@ macro, a reasonable default is used.
@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
Define this macro if GCC should generate calls to the ISO C
-(and System V) library functions @code{memcpy} and @code{memset}
-rather than the BSD functions @code{bcopy} and @code{bzero}.
+(and System V) library functions @code{memcpy}, @code{memmove} and
+@code{memset} rather than the BSD functions @code{bcopy} and @code{bzero}.
@findex LIBGCC_NEEDS_DOUBLE
@item LIBGCC_NEEDS_DOUBLE
@@ -4470,14 +4644,14 @@ This is about addressing modes.
@itemx HAVE_PRE_DECREMENT
@itemx HAVE_POST_INCREMENT
@itemx HAVE_POST_DECREMENT
-A C expression that is non-zero if the machine supports pre-increment,
+A C expression that is nonzero if the machine supports pre-increment,
pre-decrement, post-increment, or post-decrement addressing respectively.
@findex HAVE_POST_MODIFY_DISP
@findex HAVE_PRE_MODIFY_DISP
@item HAVE_PRE_MODIFY_DISP
@itemx HAVE_POST_MODIFY_DISP
-A C expression that is non-zero if the machine supports pre- or
+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.
@@ -4485,7 +4659,7 @@ the size of the memory operand.
@findex HAVE_PRE_MODIFY_REG
@item HAVE_PRE_MODIFY_REG
@itemx HAVE_POST_MODIFY_REG
-A C expression that is non-zero if the machine supports pre- or
+A C expression that is nonzero if the machine supports pre- or
post-address side-effect generation involving a register displacement.
@findex CONSTANT_ADDRESS_P
@@ -4539,7 +4713,7 @@ 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 @code{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.@refill
+levels of macros may be the same whether strict or not.
Normally, constant addresses which are the sum of a @code{symbol_ref}
and an integer are stored inside a @code{const} RTX to mark them as
@@ -4616,7 +4790,7 @@ It is always safe for this macro to not be defined. It exists so
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.
+a label_ref or symbol_ref within an UNSPEC@.
@findex LEGITIMIZE_ADDRESS
@item LEGITIMIZE_ADDRESS (@var{x}, @var{oldx}, @var{mode}, @var{win})
@@ -4651,14 +4825,14 @@ 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.
It is not necessary to define this macro, but it might be useful for
-performance reasons.
+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
+@code{LEGITIMIZE_RELOAD_ADDRESS} appropriately, the intermediate addresses
generated for adjacent some stack slots can be made identical, and thus
be shared.
@@ -4690,7 +4864,7 @@ the address has become legitimate.
If you want to change only a part of @var{x}, one standard way of doing
this is to use @code{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
+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.
@@ -4715,7 +4889,7 @@ 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.@refill
+anything @code{CONSTANT_P} is valid.
@end table
@node Condition Code
@@ -4792,7 +4966,7 @@ two places, the @file{md} file and in @code{NOTICE_UPDATE_CC}.
@findex EXTRA_CC_MODES
@item EXTRA_CC_MODES
-A list of additional modes for condition code values in registers
+A list of additional modes for condition code values in registers
(@pxref{Jump Patterns}). This macro should expand to a sequence of
calls of the macro @code{CC} separated by white space. @code{CC} takes
two arguments. The first is the enumeration name of the mode, which
@@ -4876,7 +5050,7 @@ like:
@smallexample
#define REVERSE_CONDITION(CODE, MODE) \
- ((MODE) != CCFPmode ? reverse_condtion (CODE) \
+ ((MODE) != CCFPmode ? reverse_condition (CODE) \
: reverse_condition_maybe_unordered (CODE))
@end smallexample
@@ -4933,7 +5107,7 @@ calculation is used for any RTL for which this macro does not return a
value.
This macro is optional; do not define it if the default cost assumptions
-are adequate for the target machine.
+are adequate for the target machine.
@findex ADDRESS_COST
@item ADDRESS_COST (@var{address})
@@ -5000,7 +5174,7 @@ if the @samp{mov@var{m}} pattern's constraints do not allow such copying.
@item 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, non-zero if it is to be read in. This cost
+is to be written to memory, nonzero if it is to be read in. This cost
is relative to those in @code{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.
@@ -5034,7 +5208,7 @@ ordinarily expect.
@findex SLOW_BYTE_ACCESS
@item 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
+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
require more than one instruction or if there is no difference in cost
between byte and (aligned) word loads.
@@ -5069,15 +5243,15 @@ Define this macro to be the value 1 if memory accesses described by the
than aligned accesses, for example if they are emulated in a trap
handler.
-When this macro is non-zero, the compiler will act as if
-@code{STRICT_ALIGNMENT} were non-zero when generating code for block
+When this macro is nonzero, the compiler will act as if
+@code{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 non-zero if unaligned accesses only add a
+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. If
-this macro is defined, it should produce a non-zero value when
-@code{STRICT_ALIGNMENT} is non-zero.
+this macro is defined, it should produce a nonzero value when
+@code{STRICT_ALIGNMENT} is nonzero.
@findex DONT_REDUCE_ADDR
@item DONT_REDUCE_ADDR
@@ -5142,7 +5316,7 @@ thing to use for a given mode. Defaults to the value of
@findex USE_STORE_POST_DECREMENT
@item USE_STORE_POST_DECREMENT (@var{mode})
-A C expression used to determine whether a store postdeccrement is a good
+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}.
@@ -5229,7 +5403,7 @@ containing the assembler operation to identify the following data as
uninitialized global data. If not defined, and neither
@code{ASM_OUTPUT_BSS} nor @code{ASM_OUTPUT_ALIGNED_BSS} are defined,
uninitialized global data will be output in the data section if
-@samp{-fno-common} is passed, otherwise @code{ASM_OUTPUT_COMMON} will be
+@option{-fno-common} is passed, otherwise @code{ASM_OUTPUT_COMMON} will be
used.
@findex SHARED_BSS_SECTION_ASM_OP
@@ -5259,7 +5433,7 @@ If defined, a C statement that calls the function named as the sole
argument of this macro. This is used in @file{crtstuff.c} if
@code{INIT_SECTION_ASM_OP} or @code{FINI_SECTION_ASM_OP} to calls to
initialization and finalization functions from the init and fini
-sections. By default, this macro is a simple function call. Some
+sections. By default, this macro is 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.
@@ -5308,7 +5482,7 @@ constants in the read-only data section (usually the text section).
@item SELECT_RTX_SECTION (@var{mode}, @var{rtx})
A C statement or statements to switch to the appropriate section for
output of @var{rtx} in mode @var{mode}. You can assume that @var{rtx}
-is some kind of constant in RTL. The argument @var{mode} is redundant
+is some kind of constant in RTL@. The argument @var{mode} is redundant
except in the case of a @code{const_int} rtx. Select the section by
calling @code{text_section} or one of the alternatives for other
sections.
@@ -5318,7 +5492,7 @@ data section.
@findex JUMP_TABLES_IN_TEXT_SECTION
@item JUMP_TABLES_IN_TEXT_SECTION
-Define this macro to be an expression with a non-zero value if jump
+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.
@@ -5353,17 +5527,17 @@ the characters that encode section info. Define this macro if
A C expression which evaluates to true if @var{decl} should be placed
into a unique section for some target-specific reason. If you do not
define this macro, the default is @samp{0}. Note that the flag
-@samp{-ffunction-sections} will also cause functions to be placed into
+@option{-ffunction-sections} will also cause functions to be placed into
unique sections.
@findex UNIQUE_SECTION
@item UNIQUE_SECTION (@var{decl}, @var{reloc})
A C statement to build up a unique section name, expressed as a
-STRING_CST node, and assign it to @samp{DECL_SECTION_NAME (@var{decl})}.
+@code{STRING_CST} node, and assign it to @samp{DECL_SECTION_NAME (@var{decl})}.
@var{reloc} indicates whether the initial value of @var{exp} requires
link-time relocations. If you do not define this macro, GCC will use
the symbol name prefixed by @samp{.} as the section name. Note - this
-macro can now be called for unitialised data items as well as
+macro can now be called for uninitialised data items as well as
initialised data and functions.
@end table
@@ -5388,7 +5562,7 @@ switch statements so that they use relative addresses.
@item 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
+processor's ``application binary interface'' (ABI)@. When this macro
is defined, RTL is generated for this register once, as with the stack
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
@@ -5431,7 +5605,7 @@ position independent code.
@section Defining the Output Assembler Language
This section describes macros whose principal purpose is to describe how
-to write instructions in assembler language--rather than what the
+to write instructions in assembler language---rather than what the
instructions do.
@menu
@@ -5484,22 +5658,6 @@ definition.
On systems that use SDB, it is necessary to output certain commands;
see @file{attasm.h}.
-@findex ASM_IDENTIFY_GCC
-@item ASM_IDENTIFY_GCC (@var{file})
-A C statement to output assembler commands which will identify
-the object file as having been compiled with GCC (or another
-GNU compiler).
-
-If you don't define this macro, the string @samp{gcc_compiled.:}
-is output. This string is calculated to define a symbol which,
-on BSD systems, will never be defined for any other reason.
-GDB checks for the presence of this symbol when reading the
-symbol table of an executable.
-
-On non-BSD systems, you must arrange communication with GDB in
-some other fashion. If GDB is not used on your system, you can
-define this macro with an empty body.
-
@findex ASM_COMMENT_START
@item ASM_COMMENT_START
A C string constant describing how to begin a comment in the target
@@ -5616,7 +5774,7 @@ instruction to assemble an integer of 16, 8, 4, 2 or 1 bytes,
respectively, whose value is @var{value}. The argument @var{exp} will
be an RTL expression which represents a constant value. Use
@samp{output_addr_const (@var{stream}, @var{exp})} to output this value
-as an assembler expression.@refill
+as an assembler expression.
For sizes larger than @code{UNITS_PER_WORD}, if the action of a macro
would be identical to repeatedly calling the macro corresponding to
@@ -5660,7 +5818,7 @@ Berkeley Unix assembler, do not define the macro
@findex CONSTANT_POOL_BEFORE_FUNCTION
@item CONSTANT_POOL_BEFORE_FUNCTION
You may define this macro as a C expression. You should define the
-expression to have a non-zero value if GCC should output the constant
+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
@@ -5711,7 +5869,7 @@ You need not define this macro if it would do nothing.
Define this macro as a C expression which is nonzero if the constant
@var{exp}, of type @code{tree}, should be output after the code for a
function. The compiler will normally output all constants before the
-function; you need not define this macro if this is OK.
+function; you need not define this macro if this is OK@.
@findex ASM_OUTPUT_POOL_EPILOGUE
@item ASM_OUTPUT_POOL_EPILOGUE (@var{file} @var{funname} @var{fundecl} @var{size})
@@ -5839,7 +5997,7 @@ the name, and a newline.
This macro controls how the assembler definitions of uninitialized global
variables are output. This macro exists to properly support languages like
-@code{c++} which do not have @code{common} data. However, this macro currently
+C++ which do not have @code{common} data. However, this macro currently
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
@@ -5999,7 +6157,7 @@ If you don't define this macro, @file{defaults.h} provides a default
definition. If @code{ASM_WEAKEN_LABEL} 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
-@samp{-melf}.
+@option{-melf}.
@findex MAKE_DECL_ONE_ONLY (@var{decl})
@item MAKE_DECL_ONE_ONLY
@@ -6154,7 +6312,7 @@ 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 SET_ASM_OP is defined, a default definition is provided which is
+If @code{SET_ASM_OP} is defined, a default definition is provided which is
correct for most systems.
@findex ASM_OUTPUT_DEF_FROM_DECLS
@@ -6169,23 +6327,24 @@ the tree nodes are available.
@item ASM_OUTPUT_DEFINE_LABEL_DIFFERENCE_SYMBOL (@var{stream}, @var{symbol}, @var{high}, @var{low})
A C statement to output to the stdio stream @var{stream} assembler code
which defines (equates) the symbol @var{symbol} to have a value equal to
-the difference of the two symbols @var{high} and @var{low}, i.e.
-@var{high} minus @var{low}. GCC guarantees that the symbols @var{high}
+the difference of the two symbols @var{high} and @var{low},
+i.e.@: @var{high} minus @var{low}. GCC guarantees that the symbols @var{high}
and @var{low} are already known by the assembler so that the difference
resolves into a constant.
@findex SET_ASM_OP
-If SET_ASM_OP is defined, a default definition is provided which is
+If @code{SET_ASM_OP} is defined, a default definition is provided which is
correct for most systems.
@findex ASM_OUTPUT_WEAK_ALIAS
@item 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}.
+@var{value}. If @var{value} is @code{NULL}, it defines @var{name} as
+an undefined weak symbol.
Define this macro if the target only supports weak aliases; define
-ASM_OUTPUT_DEF instead if possible.
+@code{ASM_OUTPUT_DEF} instead if possible.
@findex OBJC_GEN_METHOD_LABEL
@item OBJC_GEN_METHOD_LABEL (@var{buf}, @var{is_inst}, @var{class_name}, @var{cat_name}, @var{sel_name})
@@ -6208,7 +6367,7 @@ buffer in which to store the name; its length is as long as
The argument @var{is_inst} specifies whether the method is an instance
method or a class method; @var{class_name} is the name of the class;
-@var{cat_name} is the name of the category (or NULL if the method is not
+@var{cat_name} is the name of the category (or @code{NULL} if the method is not
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
@@ -6316,7 +6475,7 @@ the initialization process.
The last variant uses neither arbitrary sections nor the GNU linker.
This is preferable when you want to do dynamic linking and when using
-file formats which the GNU linker does not support, such as `ECOFF'. In
+file formats which the GNU linker does not support, such as `ECOFF'@. In
this case, @code{ASM_OUTPUT_CONSTRUCTOR} does not produce an
@code{N_SETT} symbol; initialization and termination functions are
recognized simply by their names. This requires an extra program in the
@@ -6472,13 +6631,13 @@ Define this macro to a C string constant containing the name of the
program which lists dynamic dependencies, like @code{"ldd"} under SunOS 4.
@findex PARSE_LDD_OUTPUT
-@item PARSE_LDD_OUTPUT (@var{PTR})
+@item 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 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}.
+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
@@ -6613,12 +6772,12 @@ 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).
+explicit (e.g.@: with white space).
@findex final_sequence
Note that output routines for instructions with delay slots must be
-prepared to deal with not being output as part of a sequence (i.e.
-when the scheduling pass is not run, or when no slot fillers could be
+prepared to deal with not being output as part of a sequence
+(i.e.@: when the scheduling pass is not run, or when no slot fillers could be
found.) The variable @code{final_sequence} is null when not
processing a sequence, otherwise it contains the @code{sequence} rtx
being output.
@@ -6715,9 +6874,9 @@ fprintf (@var{stream}, "\t.word L%d-L%d\n",
@end example
You must provide this macro on machines where the addresses in a
-dispatch table are relative to the table's own address. If defined, GNU
-CC will also use this macro on all machines when producing PIC.
-@var{body} is the body of the ADDR_DIFF_VEC; it is provided so that the
+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.
@findex ASM_OUTPUT_ADDR_VEC_ELT
@@ -6762,7 +6921,7 @@ If this macro is not defined, nothing special is output at the end of
the jump-table.
@end table
-@node Exception Region Output
+@node Exception Region Output
@subsection Assembler Commands for Exception Regions
@c prevent bad page break with this line
@@ -6788,8 +6947,8 @@ This macro need not be defined on most platforms.
A C expression to switch to the section in which the main
exception table is to be placed (@pxref{Sections}). The default is a
section named @code{.gcc_except_table} on machines that support named
-sections via @code{ASM_OUTPUT_SECTION_NAME}, otherwise if @samp{-fpic}
-or @samp{-fPIC} is in effect, the @code{data_section}, otherwise the
+sections via @code{ASM_OUTPUT_SECTION_NAME}, otherwise if @option{-fpic}
+or @option{-fPIC} is in effect, the @code{data_section}, otherwise the
@code{readonly_data_section}.
@findex EH_FRAME_SECTION_ASM_OP
@@ -6820,12 +6979,12 @@ This macro need not be defined on most platforms.
@findex DOESNT_NEED_UNWINDER
@item DOESNT_NEED_UNWINDER
A C expression that decides whether or not the current function needs to
-have a function unwinder generated for it. See the file @code{except.c}
+have a function unwinder generated for it. See the file @file{except.c}
for details on when to define this, and how.
@findex MASK_RETURN_ADDR
@item MASK_RETURN_ADDR
-An rtx used to mask the return address found via RETURN_ADDR_RTX, so
+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.
@findex DWARF2_UNWIND_INFO
@@ -6838,11 +6997,11 @@ or @samp{OBJECT_FORMAT_ELF}), GCC will provide a default definition of
1.
If this macro is defined to 1, the DWARF 2 unwinder will be the default
-exception handling mechanism; otherwise, setjmp/longjmp will be used by
+exception handling mechanism; otherwise, @code{setjmp}/@code{longjmp} will be used by
default.
If this macro is defined to anything, the DWARF 2 unwinder will be used
-instead of inline unwinders and __unwind_function in the non-setjmp case.
+instead of inline unwinders and @code{__unwind_function} in the non-@code{setjmp} case.
@findex DWARF_CIE_DATA_ALIGNMENT
@item DWARF_CIE_DATA_ALIGNMENT
@@ -6865,7 +7024,7 @@ This describes commands for alignment.
@findex LABEL_ALIGN_AFTER_BARRIER
@item LABEL_ALIGN_AFTER_BARRIER (@var{label})
The alignment (log base 2) to put in front of @var{label}, which follows
-a BARRIER.
+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
@@ -6879,23 +7038,23 @@ implementation.
@findex LABEL_ALIGN_AFTER_BARRIER_MAX_SKIP
@item LABEL_ALIGN_AFTER_BARRIER_MAX_SKIP
-The maximum number of bytes to skip when applying
+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.
@findex LOOP_ALIGN
@item LOOP_ALIGN (@var{label})
The alignment (log base 2) to put in front of @var{label}, which follows
-a NOTE_INSN_LOOP_BEG note.
+a @code{NOTE_INSN_LOOP_BEG} note.
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.
Unless it's necessary to inspect the @var{label} parameter, it is better
-to set the variable @var{align_loops} in the target's
+to set the variable @code{align_loops} in the target's
@code{OVERRIDE_OPTIONS}. Otherwise, you should try to honour the user's
-selection in @var{align_loops} in a @code{LOOP_ALIGN} implementation.
+selection in @code{align_loops} in a @code{LOOP_ALIGN} implementation.
@findex LOOP_ALIGN_MAX_SKIP
@item LOOP_ALIGN_MAX_SKIP
@@ -6905,13 +7064,13 @@ This works only if @code{ASM_OUTPUT_MAX_SKIP_ALIGN} is defined.
@findex LABEL_ALIGN
@item LABEL_ALIGN (@var{label})
The alignment (log base 2) to put in front of @var{label}.
-If LABEL_ALIGN_AFTER_BARRIER / LOOP_ALIGN specify a different alignment,
+If @code{LABEL_ALIGN_AFTER_BARRIER} / @code{LOOP_ALIGN} specify a different alignment,
the maximum of the specified values is used.
Unless it's necessary to inspect the @var{label} parameter, it is better
-to set the variable @var{align_labels} in the target's
+to set the variable @code{align_labels} in the target's
@code{OVERRIDE_OPTIONS}. Otherwise, you should try to honour the user's
-selection in @var{align_labels} in a @code{LABEL_ALIGN} implementation.
+selection in @code{align_labels} in a @code{LABEL_ALIGN} implementation.
@findex LABEL_ALIGN_MAX_SKIP
@item LABEL_ALIGN_MAX_SKIP
@@ -6977,7 +7136,7 @@ register number @var{regno}. In simple cases, the value of this
expression may be @var{regno} itself. But sometimes there are some
registers that the compiler knows about and DBX does not, or vice
versa. In such cases, some register may need to have one number in
-the compiler and another for DBX.
+the compiler and another for DBX@.
If two registers have consecutive numbers inside GCC, and they can be
used as a pair to hold a multiword value, then they @emph{must} have
@@ -6997,7 +7156,7 @@ computation assumes that @var{x} is based on the frame-pointer and
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
-@samp{-g} options is used.
+@option{-g} options is used.
@findex DEBUGGER_ARG_OFFSET
@item DEBUGGER_ARG_OFFSET (@var{offset}, @var{x})
@@ -7008,13 +7167,13 @@ having address @var{x} (an RTL expression). The nominal offset is
@findex PREFERRED_DEBUGGING_TYPE
@item PREFERRED_DEBUGGING_TYPE
A C expression that returns the type of debugging output GCC should
-produce when the user specifies just @samp{-g}. Define
+produce when the user specifies just @option{-g}. Define
this if you have arranged for GCC to support more than one format of
debugging output. Currently, the allowable values are @code{DBX_DEBUG},
@code{SDB_DEBUG}, @code{DWARF_DEBUG}, @code{DWARF2_DEBUG}, and
@code{XCOFF_DEBUG}.
-When the user specifies @samp{-ggdb}, GCC normally also uses the
+When the user specifies @option{-ggdb}, GCC normally also uses the
value of this macro to select the debugging output format, but with two
exceptions. If @code{DWARF2_DEBUGGING_INFO} is defined and
@code{LINKER_DOES_NOT_WORK_WITH_DWARF2} is not defined, GCC uses the
@@ -7022,8 +7181,8 @@ value @code{DWARF2_DEBUG}. Otherwise, if @code{DBX_DEBUGGING_INFO} is
defined, GCC uses @code{DBX_DEBUG}.
The value of this macro only affects the default debugging output; the
-user can always get a specific type of output by using @samp{-gstabs},
-@samp{-gcoff}, @samp{-gdwarf-1}, @samp{-gdwarf-2}, or @samp{-gxcoff}.
+user can always get a specific type of output by using @option{-gstabs},
+@option{-gcoff}, @option{-gdwarf-1}, @option{-gdwarf-2}, or @option{-gxcoff}.
@end table
@node DBX Options
@@ -7036,12 +7195,12 @@ These are specific options for DBX output.
@findex DBX_DEBUGGING_INFO
@item DBX_DEBUGGING_INFO
Define this macro if GCC should produce debugging output for DBX
-in response to the @samp{-g} option.
+in response to the @option{-g} option.
@findex XCOFF_DEBUGGING_INFO
@item XCOFF_DEBUGGING_INFO
Define this macro if GCC should produce XCOFF format debugging output
-in response to the @samp{-g} option. This is a variant of DBX format.
+in response to the @option{-g} option. This is a variant of DBX format.
@findex DEFAULT_GDB_EXTENSIONS
@item DEFAULT_GDB_EXTENSIONS
@@ -7155,14 +7314,14 @@ first.
@item 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, GNU C uses an absolute address.
+of the enclosing function. Normally, GCC uses an absolute address.
@findex DBX_USE_BINCL
@item DBX_USE_BINCL
-Define this macro if GNU C should generate @code{N_BINCL} and
+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 GNU C to output a type number as a pair of a file
-number and a type number within the file. Normally, GNU C does not
+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
@@ -7216,7 +7375,7 @@ first. To do this, define @code{DBX_OUTPUT_STANDARD_TYPES} to output
those symbols in the necessary order. Any predefined types that you
don't explicitly output will be output afterward in no particular order.
-Be careful not to define this macro so that it works only for C. There
+Be careful not to define this macro so that it works only for C@. There
are no global variables to access most of the built-in types, because
another language may have another set of types. The way to output a
particular type is to look through @var{syms} to see if you can find it.
@@ -7262,7 +7421,7 @@ Here is another way of finding a particular type:
@findex NO_DBX_FUNCTION_END
@item 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 extention construct.
+@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.
@@ -7333,17 +7492,17 @@ Here are macros for SDB and DWARF output.
@findex SDB_DEBUGGING_INFO
@item SDB_DEBUGGING_INFO
Define this macro if GCC should produce COFF-style debugging output
-for SDB in response to the @samp{-g} option.
+for SDB in response to the @option{-g} option.
@findex DWARF_DEBUGGING_INFO
@item DWARF_DEBUGGING_INFO
Define this macro if GCC should produce dwarf format debugging output
-in response to the @samp{-g} option.
+in response to the @option{-g} option.
@findex DWARF2_DEBUGGING_INFO
@item DWARF2_DEBUGGING_INFO
Define this macro if GCC should produce dwarf version 2 format
-debugging output in response to the @samp{-g} option.
+debugging output in response to the @option{-g} option.
To support optional call frame debugging information, you must also
define @code{INCOMING_RETURN_ADDR_RTX} and either set
@@ -7361,7 +7520,7 @@ information not matter how you define @code{DWARF2_FRAME_INFO}.
@findex LINKER_DOES_NOT_WORK_WITH_DWARF2
@item 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 @samp{-ggdb} GCC will use Dwarf
+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.
@@ -7542,7 +7701,7 @@ in @var{output} (which will be a variable).
The operation to be performed is specified by @var{code}, a tree code
which will always be one of the following: @code{PLUS_EXPR},
@code{MINUS_EXPR}, @code{MULT_EXPR}, @code{RDIV_EXPR},
-@code{MAX_EXPR}, @code{MIN_EXPR}.@refill
+@code{MAX_EXPR}, @code{MIN_EXPR}.
@cindex overflow while constant folding
The expansion of this macro is responsible for checking for overflow.
@@ -7604,12 +7763,12 @@ floating point operations, but to perform a single precision operation,
the FPSCR PR bit has to be cleared, while for a double precision
operation, this bit has to be set. Changing the PR bit requires a general
purpose register as a scratch register, hence these FPSCR sets have to
-be inserted before reload, i.e. you can't put this into instruction emitting
-or MACHINE_DEPENDENT_REORG.
+be inserted before reload, i.e.@: you can't put this into instruction emitting
+or @code{MACHINE_DEPENDENT_REORG}.
You can have multiple entities that are mode-switched, and select at run time
which entities actually need it. @code{OPTIMIZE_MODE_SWITCHING} should
-return non-zero for any @var{entity} that that needs mode-switching.
+return nonzero for any @var{entity} that needs mode-switching.
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}.
@@ -7625,7 +7784,7 @@ The position of the initializer in the initializer - starting counting at
zero - determines the integer that is used to refer to the mode-switched
entity in question.
In macros that take mode arguments / yield a mode result, modes are
-represented as numbers 0 .. N - 1. N is used to specify that no mode
+represented as numbers 0 @dots{} N @minus{} 1. N is used to specify that no mode
switch is needed / supplied.
@findex MODE_NEEDED
@@ -7633,10 +7792,10 @@ switch is needed / supplied.
@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
-NUM_MODES_FOR_MODE_SWITCHING, to denote the mode that @var{entity} must
-be switched into prior to the execution of INSN.
+@code{NUM_MODES_FOR_MODE_SWITCHING}, to denote the mode that @var{entity} must
+be switched into prior to the execution of @var{insn}.
-@findex NORMAL_MODE
+@findex NORMAL_MODE
@item 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
@@ -7644,12 +7803,12 @@ mode switching. It should evaluate to an integer, which is a mode that
@findex MODE_PRIORITY_TO_MODE
@item MODE_PRIORITY_TO_MODE (@var{entity}, @var{n})
-This macro specifies the order in which modes for ENTITY are processed.
-0 is the highest priority, NUM_MODES_FOR_MODE_SWITCHING[ENTITY] - 1 the
+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 ENTITY. For any fixed @var{entity}, @code{mode_priority_to_mode}
-(@var{entity}, @var{n}) shall be a bijection in 0 ..
-@code{num_modes_for_mode_switching}[@var{entity}] - 1 .
+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}.
@findex EMIT_MODE_SET
@item EMIT_MODE_SET (@var{entity}, @var{mode}, @var{hard_regs_live})
@@ -7690,15 +7849,15 @@ thus speeding up the compiler. The most important predicates to include
in the list specified by this macro are those used in the most insn
patterns.
-For each predicate function named in @var{PREDICATE_CODES}, a
+For each predicate function named in @code{PREDICATE_CODES}, a
declaration will be generated in @file{insn-codes.h}.
@item SPECIAL_MODE_PREDICATES
@findex SPECIAL_MODE_PREDICATES
Define this if you have special predicates that know special things
-about modes. Genrecog will warn about certain forms of
+about modes. Genrecog will warn about certain forms of
@code{match_operand} without a mode; if the operand predicate is
-listed in @code{SPECIAL_MODE_PREDICATES}, the warning will be
+listed in @code{SPECIAL_MODE_PREDICATES}, the warning will be
suppressed.
Here is an example from the IA-32 port (@code{ext_register_operand}
@@ -7720,7 +7879,7 @@ elements of a jump-table should have.
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}.
-To make this work, you also have to define INSN_ALIGN and
+To make this work, you also have to define 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.
@@ -7775,7 +7934,7 @@ extends.
@item IMPLICIT_FIX_EXPR
An alias for a tree code that should be used by default for conversion
of floating point values to fixed point. Normally,
-@code{FIX_ROUND_EXPR} is used.@refill
+@code{FIX_ROUND_EXPR} is used.
@findex FIXUNS_TRUNC_LIKE_FIX_TRUNC
@item FIXUNS_TRUNC_LIKE_FIX_TRUNC
@@ -7791,7 +7950,7 @@ compile code for in the general case. It may be
@code{ROUND_DIV_EXPR}. These four division operators differ in how
they round the result to an integer. @code{EASY_DIV_EXPR} is used
when it is permissible to use any of those kinds of division and the
-choice should be made on the basis of efficiency.@refill
+choice should be made on the basis of efficiency.
@findex MOVE_MAX
@item MOVE_MAX
@@ -7811,21 +7970,21 @@ at run-time.
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
-this macro is non-zero, the compiler will assume that it is safe to omit
+this macro is nonzero, the compiler will assume that it is safe to omit
a sign-extend, zero-extend, and certain bitwise `and' instructions that
truncates the count of a shift operation. On machines that have
-instructions that act on bitfields at variable positions, which may
+instructions that act on bit-fields at variable positions, which may
include `bit test' instructions, a nonzero @code{SHIFT_COUNT_TRUNCATED}
also enables deletion of truncations of the values that serve as
-arguments to bitfield instructions.
+arguments to bit-field instructions.
If both types of instructions truncate the count (for shifts) and
-position (for bitfield operations), or if no variable-position bitfield
+position (for bit-field operations), or if no variable-position bit-field
instructions exist, you should define this macro.
However, on some machines, such as the 80386 and the 680x0, truncation
only applies to shift operations and not the (real or pretended)
-bitfield operations. Define @code{SHIFT_COUNT_TRUNCATED} to be zero on
+bit-field operations. Define @code{SHIFT_COUNT_TRUNCATED} to be zero on
such machines. Instead, add patterns to the @file{md} file that include
the implied truncation of the shift instructions.
@@ -7855,8 +8014,8 @@ with an integral mode and stored by a store-flag instruction
apply to @emph{all} the @samp{s@var{cond}} patterns and all the
comparison operators whose results have a @code{MODE_INT} mode.
-A value of 1 or -1 means that the instruction implementing the
-comparison operator returns exactly 1 or -1 when the comparison is true
+A value of 1 or @minus{}1 means that the instruction implementing the
+comparison operator returns exactly 1 or @minus{}1 when the comparison is true
and 0 when the comparison is false. Otherwise, the value indicates
which bits of the result are guaranteed to be 1 when the comparison is
true. This value is interpreted in the mode of the comparison
@@ -7865,7 +8024,7 @@ operation, which is given by the mode of the first operand in the
@code{STORE_FLAG_VALUE} be on. Presently, only those bits are used by
the compiler.
-If @code{STORE_FLAG_VALUE} is neither 1 or -1, the compiler will
+If @code{STORE_FLAG_VALUE} is neither 1 or @minus{}1, the compiler will
generate code that depends only on the specified bits. It can also
replace comparison operators with equivalent operations if they cause
the required bits to be set, even if the remaining bits are undefined.
@@ -7916,7 +8075,7 @@ comparison operators to do so because there may be opportunities to
combine the normalization with other operations.
@item
-For equal-length sequences, use a value of 1 or -1, with -1 being
+For equal-length sequences, use a value of 1 or @minus{}1, with @minus{}1 being
slightly preferred on machines with expensive jumps and 1 preferred on
other machines.
@@ -7952,7 +8111,7 @@ instructions.
@findex FLOAT_STORE_FLAG_VALUE
@item FLOAT_STORE_FLAG_VALUE (@var{mode})
-A C expression that gives a non-zero @code{REAL_VALUE_TYPE} value that is
+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
@@ -7994,7 +8153,7 @@ and print no error message.
@findex NO_IMPLICIT_EXTERN_C
@item NO_IMPLICIT_EXTERN_C
-Define this macro if the system header files support C++ as well as 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{}@}}.
@@ -8016,14 +8175,14 @@ these functions. The macro may also do setup required for the pragmas.
The primary reason to define this macro is to provide compatibility with
other compilers for the same target. In general, we discourage
-definition of target-specific pragmas for GCC.
+definition of target-specific pragmas for GCC@.
If the pragma can be implemented by attributes then the macro
@samp{INSERT_ATTRIBUTES} might be a useful one to define 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 @samp{-Wunknown-pragmas}.
+silently ignored, unless the user specifies @option{-Wunknown-pragmas}.
@deftypefun void cpp_register_pragma (cpp_reader *@var{pfile}, const char *@var{space}, const char *@var{name}, void (*@var{callback}) (cpp_reader *))
@@ -8051,9 +8210,9 @@ Note that the use of @code{c_lex} is specific to the C and C++
compilers. It will not work in the Java or Fortran compilers, or any
other language compilers for that matter. Thus if @code{c_lex} is going
to be called from target-specific code, it must only be done so when
-building hte C and C++ compilers. This can be done by defining the
+building the C and C++ compilers. This can be done by defining the
variables @code{c_target_objs} and @code{cxx_target_objs} in the
-target entry in the @code{config.gcc} file. These variables should name
+target entry in the @file{config.gcc} file. These variables should name
the target-specific, language-specific object file which contains the
code that uses @code{c_lex}. Note it will also be necessary to add a
rule to the makefile fragment pointed to by @code{tmake_file} that shows
@@ -8091,8 +8250,8 @@ of specifically named weak labels, optionally with a value.
@findex pragma
@item 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,<n>)} and @samp{#pragma
-pack(pop)}. The pack(push,<n>) pragma specifies the maximum alignment
+style pragmas @samp{#pragma pack(push,@var{n})} and @samp{#pragma
+pack(pop)}. The @samp{pack(push,@var{n})} pragma specifies the maximum alignment
(in bytes) of fields within a structure, in much the same way as the
@samp{__aligned__} and @samp{__packed__} @code{__attribute__}s do. A
pack value of zero resets the behaviour to the default. Successive
@@ -8143,7 +8302,7 @@ definition.
@findex INSERT_ATTRIBUTES
@item INSERT_ATTRIBUTES (@var{node}, @var{attr_ptr}, @var{prefix_ptr})
Define this macro if you want to be able to add attributes to a decl
-when it is being created. This is normally useful for backends which
+when it is being created. This is normally useful for back ends which
wish to implement a pragma by using the attributes which correspond to
the pragma's effect. The @var{node} argument is the decl which is being
created. The @var{attr_ptr} argument is a pointer to the attribute list
@@ -8252,8 +8411,8 @@ without user intervention. For instance, under Microsoft Windows
symbols must be explicitly imported from shared libraries (DLLs).
@findex MD_ASM_CLOBBERS
-@item MD_ASM_CLOBBERS
-A C statement that adds to @var{CLOBBERS} @code{STRING_CST} trees for
+@item 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.
@findex ISSUE_RATE
@@ -8267,7 +8426,7 @@ A C statement which is executed by the scheduler at the
beginning of each block of instructions that are to be scheduled.
@var{file} is either a null pointer, or a stdio stream to write any
debug output to. @var{verbose} is the verbose level provided by
-@samp{-fsched-verbose-}@var{n}. @var{max_ready} is the maximum number
+@option{-fsched-verbose-@var{n}}. @var{max_ready} is the maximum number
of insns in the current scheduling region that can be live at the same
time. This can be used to allocate scratch space if it is needed.
@@ -8278,7 +8437,7 @@ of instructions that are to be scheduled. It can be used to perform
cleanup of any actions done by the other scheduling macros.
@var{file} is either a null pointer, or a stdio stream to write any
debug output to. @var{verbose} is the verbose level provided by
-@samp{-fsched-verbose-}@var{n}.
+@option{-fsched-verbose-@var{n}}.
@findex MD_SCHED_REORDER
@item MD_SCHED_REORDER (@var{file}, @var{verbose}, @var{ready}, @var{n_ready}, @var{clock}, @var{can_issue_more})
@@ -8287,7 +8446,7 @@ has scheduled the ready list to allow the machine description to reorder
it (for example to combine two small instructions together on
@samp{VLIW} machines). @var{file} is either a null pointer, or a stdio
stream to write any debug output to. @var{verbose} is the verbose level
-provided by @samp{-fsched-verbose-}@var{n}. @var{ready} is a pointer to
+provided by @option{-fsched-verbose-@var{n}}. @var{ready} is a pointer to
the ready list of instructions that are ready to be scheduled.
@var{n_ready} is the number of elements in the ready list. The
scheduler reads the ready list in reverse order, starting with
@@ -8312,11 +8471,11 @@ these other insns can then be taken into account properly.
A C statement which is executed by the scheduler after it
has scheduled an insn from the ready list. @var{file} is either a null
pointer, or a stdio stream to write any debug output to. @var{verbose}
-is the verbose level provided by @samp{-fsched-verbose-}@var{n}.
+is the verbose level provided by @option{-fsched-verbose-@var{n}}.
@var{insn} is the instruction that was scheduled. @var{more} is the
number of instructions that can be issued in the current cycle. The
@samp{MD_SCHED_VARIABLE_ISSUE} macro is responsible for updating the
-value of @var{more} (typically by @var{more}--).
+value of @var{more} (typically by @samp{@var{more}--}).
@findex MAX_INTEGER_COMPUTATION_MODE
@item MAX_INTEGER_COMPUTATION_MODE
@@ -8345,8 +8504,8 @@ is wrong.
@findex TARGET_HAS_F_SETLKW
@item 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.
+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.
@@ -8362,7 +8521,7 @@ conditional execution instructions instead of a branch. A value of
@findex IFCVT_MODIFY_TESTS
@item IFCVT_MODIFY_TESTS
A C expression to modify the tests in @code{TRUE_EXPR}, and
-@code{FALSE_EXPPR} for use in converting insns in @code{TEST_BB},
+@code{FALSE_EXPR} for use in converting insns in @code{TEST_BB},
@code{THEN_BB}, @code{ELSE_BB}, and @code{JOIN_BB} basic blocks to
conditional execution. Set either @code{TRUE_EXPR} or @code{FALSE_EXPR}
to a null pointer if the tests cannot be converted.
@@ -8386,30 +8545,30 @@ converting code to conditional execution in the basic blocks
@findex MD_INIT_BUILTINS
@item MD_INIT_BUILTINS
-Define this macro if you have any machine-specific builtin functions that
+Define this macro if you have any machine-specific built-in functions that
need to be defined. It should be a C expression that performs the
necessary setup.
-Machine specific builtins can be useful to expand special machine
+Machine specific built-in functions can be useful to expand special machine
instructions that would otherwise not normally be generated because
they have no equivalent in the source language (for example, SIMD vector
instructions or prefetch instructions).
-To create a builtin function, call the function @code{builtin_function}
-which is defined by the language frontend. You can use any type nodes set
+To create a built-in function, call the function @code{builtin_function}
+which is defined by the language front end. You can use any type nodes set
up by @code{build_common_tree_nodes} and @code{build_common_tree_nodes_2};
-only language frontends that use these two functions will use
+only language front ends that use these two functions will use
@samp{MD_INIT_BUILTINS}.
@findex MD_EXPAND_BUILTIN
@item MD_EXPAND_BUILTIN(@var{exp}, @var{target}, @var{subtarget}, @var{mode}, @var{ignore})
-Expand a call to a machine specific builtin that was set up by
+Expand a call to a machine specific built-in function that was set up by
@samp{MD_INIT_BUILTINS}. @var{exp} is the expression for the function call;
the result should go to @var{target} if that is convenient, and have mode
@var{mode} if that is convenient. @var{subtarget} may be used as the target
-for computing one of @var{exp}'s operands. @var{ignore} is nonzero if the value
+for computing one of @var{exp}'s operands. @var{ignore} is nonzero if the value
is to be ignored.
-This macro should return the result of the call to the builtin.
+This macro should return the result of the call to the built-in function.
@end table
diff --git a/gcc/doloop.c b/gcc/doloop.c
index 191cdf0cf37..f16eb2f764d 100644
--- a/gcc/doloop.c
+++ b/gcc/doloop.c
@@ -22,7 +22,6 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
#include "rtl.h"
-#include "insn-flags.h"
#include "flags.h"
#include "expr.h"
#include "loop.h"
@@ -353,23 +352,38 @@ doloop_valid_p (loop, jump_insn)
&& ((loop_info->comparison_code == LEU
&& INTVAL (loop_info->increment) > 0)
|| (loop_info->comparison_code == GEU
- && INTVAL (loop_info->increment) < 0)))
+ && INTVAL (loop_info->increment) < 0)
+ || (loop_info->comparison_code == LTU
+ && INTVAL (loop_info->increment) > 1)
+ || (loop_info->comparison_code == GTU
+ && INTVAL (loop_info->increment) < -1)))
{
/* If the comparison is LEU and the comparison value is UINT_MAX
then the loop will not terminate. Similarly, if the
comparison code is GEU and the initial value is 0, the loop
will not terminate.
- Note that with LE and GE, the loop behaviour can be
- implementation dependent if an overflow occurs, say between
- INT_MAX and INT_MAX + 1. We thus don't have to worry about
- these two cases.
+ If the absolute increment is not 1, the loop can be infinite
+ even with LTU/GTU, e.g. for (i = 3; i > 0; i -= 2)
+
+ Note that with LE and GE, the loop behaviour is undefined
+ (C++ standard section 5 clause 5) if an overflow occurs, say
+ between INT_MAX and INT_MAX + 1. We thus don't have to worry
+ about these two cases.
??? We could compute these conditions at run-time and have a
additional jump around the loop to ensure an infinite loop.
However, it is very unlikely that this is the intended
behaviour of the loop and checking for these rare boundary
- conditions would pessimize all other code. */
+ conditions would pessimize all other code.
+
+ If the loop is executed only a few times an extra check to
+ restart the loop could use up most of the benefits of using a
+ count register loop. Note however, that normally, this
+ restart branch would never execute, so it could be predicted
+ well by the CPU. We should generate the pessimistic code by
+ default, and have an option, e.g. -funsafe-loops that would
+ enable count-register loops in this case. */
if (loop_dump_stream)
fprintf (loop_dump_stream,
"Doloop: Possible infinite iteration case ignored.\n");
@@ -569,15 +583,10 @@ doloop_modify_runtime (loop, iterations_max,
/* The number of iterations (prior to any loop unrolling) is given by:
(abs (final - initial) + abs_inc - 1) / abs_inc.
- However, it is possible for the summation to overflow, and a
- safer method is:
-
- abs (final - initial) / abs_inc + (abs (final - initial) % abs_inc) != 0
-
If the loop has been unrolled, then the loop body has been
preconditioned to iterate a multiple of unroll_number times.
The number of iterations of the loop body is simply:
- abs (final - initial) / (abs_inc * unroll_number).
+ (abs (final - initial) + abs_inc - 1) / (abs_inc * unroll_number).
The division and modulo operations can be avoided by requiring
that the increment is a power of 2 (precondition_loop_p enforces
@@ -591,67 +600,40 @@ doloop_modify_runtime (loop, iterations_max,
copy_rtx (neg_inc ? final_value : initial_value),
NULL_RTX, unsigned_p, OPTAB_LIB_WIDEN);
- if (loop_info->unroll_number == 1)
+ if (abs_inc * loop_info->unroll_number != 1)
{
- if (abs_inc != 1)
- {
- int shift_count;
- rtx extra;
- rtx label;
+ int shift_count;
- shift_count = exact_log2 (abs_inc);
- if (shift_count < 0)
- abort ();
+ shift_count = exact_log2 (abs_inc * loop_info->unroll_number);
+ if (shift_count < 0)
+ abort ();
- /* abs (final - initial) / abs_inc */
- iterations = expand_binop (GET_MODE (diff), lshr_optab,
- diff, GEN_INT (shift_count),
+ if (abs_inc != 1)
+ {
+ /* abs (final - initial + abs_inc - 1) / abs_inc / unroll_number
+ If we get an overflow, the loop is infinite, and
+ the loop count is set to zero. That is not really
+ infinite but it will run UINT_MAX+1 times. */
+ iterations = expand_binop (GET_MODE (diff), add_optab,
+ diff, GEN_INT (abs_inc - 1),
NULL_RTX, 1,
OPTAB_LIB_WIDEN);
-
- /* abs (final - initial) % abs_inc */
- extra = expand_binop (GET_MODE (iterations), and_optab,
- diff, GEN_INT (abs_inc - 1),
- NULL_RTX, 1,
- OPTAB_LIB_WIDEN);
-
- /* If (abs (final - initial) % abs_inc == 0) jump past
- following increment instruction. */
- label = gen_label_rtx();
- emit_cmp_and_jump_insns (extra, const0_rtx, EQ, NULL_RTX,
- GET_MODE (extra), 0, 0, label);
- JUMP_LABEL (get_last_insn ()) = label;
- LABEL_NUSES (label)++;
-
- /* Increment the iteration count by one. */
- iterations = expand_binop (GET_MODE (iterations), add_optab,
- iterations, GEN_INT (1),
+ iterations = expand_binop (GET_MODE (iterations), lshr_optab,
+ iterations, GEN_INT (shift_count),
iterations, 1,
OPTAB_LIB_WIDEN);
-
- emit_label (label);
}
else
- iterations = diff;
+ {
+ /* abs (final - initial) / abs_inc. */
+ iterations = expand_binop (GET_MODE (diff), lshr_optab,
+ diff, GEN_INT (shift_count),
+ NULL_RTX, 1,
+ OPTAB_LIB_WIDEN);
+ }
}
else
- {
- int shift_count;
-
- /* precondition_loop_p has preconditioned the loop so that the
- iteration count of the loop body is always a power of 2.
- Since we won't get an overflow calculating the loop count,
- the code we emit is simpler. */
- shift_count = exact_log2 (loop_info->unroll_number * abs_inc);
- if (shift_count < 0)
- abort ();
-
- iterations = expand_binop (GET_MODE (diff), lshr_optab,
- diff, GEN_INT (shift_count),
- NULL_RTX, 1,
- OPTAB_LIB_WIDEN);
- }
-
+ iterations = diff;
/* If there is a NOTE_INSN_LOOP_VTOP, we have a `for' or `while'
style loop, with a loop exit test at the start. Thus, we can
@@ -662,7 +644,7 @@ doloop_modify_runtime (loop, iterations_max,
not executed before the start of the loop. We need to determine
if the loop will terminate after the first pass and to limit the
iteration count to one if necessary. */
- if (! loop->vtop)
+ if (! loop->vtop && comparison_code != NE)
{
rtx label;
@@ -675,13 +657,18 @@ doloop_modify_runtime (loop, iterations_max,
is guaranteed to execute at least once. */
if (loop_info->unroll_number == 1)
{
+ rtx incremented_initval;
/* Emit insns to test if the loop will immediately
terminate and to set the iteration count to 1 if true. */
label = gen_label_rtx();
- emit_cmp_and_jump_insns (copy_rtx (initial_value),
+ incremented_initval = expand_binop (mode, add_optab,
+ copy_rtx (initial_value),
+ increment, NULL_RTX, 0,
+ OPTAB_LIB_WIDEN);
+ emit_cmp_and_jump_insns (incremented_initval,
copy_rtx (loop_info->comparison_value),
- comparison_code, NULL_RTX, mode, 0, 0,
- label);
+ comparison_code, NULL_RTX, mode,
+ unsigned_p, 0, label);
JUMP_LABEL (get_last_insn ()) = label;
LABEL_NUSES (label)++;
emit_move_insn (iterations, const1_rtx);
diff --git a/gcc/dwarf2.h b/gcc/dwarf2.h
index 5b608284547..800bda2dc01 100644
--- a/gcc/dwarf2.h
+++ b/gcc/dwarf2.h
@@ -501,9 +501,14 @@ enum dwarf_call_frame_info
DW_CFA_def_cfa_offset = 0x0e,
DW_CFA_def_cfa_expression = 0x0f,
DW_CFA_expression = 0x10,
+ /* Dwarf 2.1 */
+ DW_CFA_offset_extended_sf = 0x11,
+ DW_CFA_def_cfa_sf = 0x12,
+ DW_CFA_def_cfa_offset_sf = 0x13,
+
/* SGI/MIPS specific */
DW_CFA_MIPS_advance_loc8 = 0x1d,
-
+
/* GNU extensions */
DW_CFA_GNU_window_save = 0x2d,
DW_CFA_GNU_args_size = 0x2e,
@@ -554,3 +559,27 @@ enum dwarf_macinfo_record_type
DW_MACINFO_end_file = 4,
DW_MACINFO_vendor_ext = 255
};
+
+
+/* @@@ For use with GNU frame unwind information. */
+
+#define DW_EH_PE_absptr 0x00
+#define DW_EH_PE_omit 0xff
+
+#define DW_EH_PE_uleb128 0x01
+#define DW_EH_PE_udata2 0x02
+#define DW_EH_PE_udata4 0x03
+#define DW_EH_PE_udata8 0x04
+#define DW_EH_PE_sleb128 0x09
+#define DW_EH_PE_sdata2 0x0A
+#define DW_EH_PE_sdata4 0x0B
+#define DW_EH_PE_sdata8 0x0C
+#define DW_EH_PE_signed 0x08
+
+#define DW_EH_PE_pcrel 0x10
+#define DW_EH_PE_textrel 0x20
+#define DW_EH_PE_datarel 0x30
+#define DW_EH_PE_funcrel 0x40
+#define DW_EH_PE_aligned 0x50
+
+#define DW_EH_PE_indirect 0x80
diff --git a/gcc/dwarf2asm.c b/gcc/dwarf2asm.c
new file mode 100644
index 00000000000..15ae68dd212
--- /dev/null
+++ b/gcc/dwarf2asm.c
@@ -0,0 +1,1032 @@
+/* Dwarf2 assembler output helper routines.
+ Copyright (C) 2001 Free Software Foundation, Inc.
+
+This file is part of GNU CC.
+
+GNU CC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU CC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU CC; see the file COPYING. If not, write to
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA. */
+
+
+#include "config.h"
+#include "system.h"
+#include "flags.h"
+#include "tree.h"
+#include "rtl.h"
+#include "output.h"
+#include "dwarf2asm.h"
+#include "dwarf2.h"
+#include "splay-tree.h"
+#include "ggc.h"
+#include "tm_p.h"
+
+
+/* How to start an assembler comment. */
+#ifndef ASM_COMMENT_START
+#define ASM_COMMENT_START ";#"
+#endif
+
+/* Definitions of defaults for assembler-dependent names of various
+ pseudo-ops and section names. These may be overridden in the tm.h
+ file (if necessary) for a particular assembler. */
+
+#ifdef OBJECT_FORMAT_ELF
+#ifndef UNALIGNED_SHORT_ASM_OP
+#define UNALIGNED_SHORT_ASM_OP "\t.2byte\t"
+#endif
+#ifndef UNALIGNED_INT_ASM_OP
+#define UNALIGNED_INT_ASM_OP "\t.4byte\t"
+#endif
+#ifndef UNALIGNED_DOUBLE_INT_ASM_OP
+#define UNALIGNED_DOUBLE_INT_ASM_OP "\t.8byte\t"
+#endif
+#endif /* OBJECT_FORMAT_ELF */
+
+#ifndef ASM_BYTE_OP
+#define ASM_BYTE_OP "\t.byte\t"
+#endif
+
+/* We don't have unaligned support, let's hope the normal output works for
+ .debug_frame. But we know it won't work for .debug_info. */
+#if !defined(UNALIGNED_INT_ASM_OP) && defined(DWARF2_DEBUGGING_INFO)
+ #error DWARF2_DEBUGGING_INFO requires UNALIGNED_INT_ASM_OP.
+#endif
+
+
+#ifdef UNALIGNED_INT_ASM_OP
+static const char * unaligned_integer_asm_op PARAMS ((int));
+
+static inline const char *
+unaligned_integer_asm_op (size)
+ int size;
+{
+ const char *op;
+ switch (size)
+ {
+ case 1:
+ op = ASM_BYTE_OP;
+ break;
+ case 2:
+ op = UNALIGNED_SHORT_ASM_OP;
+ break;
+ case 4:
+ op = UNALIGNED_INT_ASM_OP;
+ break;
+ case 8:
+#ifdef UNALIGNED_DOUBLE_INT_ASM_OP
+ op = UNALIGNED_DOUBLE_INT_ASM_OP;
+ break;
+#endif
+ default:
+ abort ();
+ }
+ return op;
+}
+#endif /* UNALIGNED_INT_ASM_OP */
+
+/* Output an immediate constant in a given size. */
+
+void
+dw2_asm_output_data VPARAMS ((int size, unsigned HOST_WIDE_INT value,
+ const char *comment, ...))
+{
+#ifndef ANSI_PROTOTYPES
+ int size;
+ unsigned HOST_WIDE_INT value;
+ const char *comment;
+#endif
+ va_list ap;
+
+ VA_START (ap, comment);
+
+#ifndef ANSI_PROTOTYPES
+ size = va_arg (ap, int);
+ value = va_arg (ap, unsigned HOST_WIDE_INT);
+ comment = va_arg (ap, const char *);
+#endif
+
+ if (size * 8 < HOST_BITS_PER_WIDE_INT)
+ value &= ~(~(unsigned HOST_WIDE_INT)0 << (size * 8));
+
+#ifdef UNALIGNED_INT_ASM_OP
+ fputs (unaligned_integer_asm_op (size), asm_out_file);
+ fprintf (asm_out_file, HOST_WIDE_INT_PRINT_HEX, value);
+#else
+ assemble_integer (GEN_INT (value), size, 1);
+#endif
+
+ if (flag_debug_asm && comment)
+ {
+ fprintf (asm_out_file, "\t%s ", ASM_COMMENT_START);
+ vfprintf (asm_out_file, comment, ap);
+ }
+ fputc ('\n', asm_out_file);
+
+ va_end (ap);
+}
+
+/* Output the difference between two symbols in a given size. */
+/* ??? There appear to be assemblers that do not like such
+ subtraction, but do support ASM_SET_OP. It's unfortunately
+ impossible to do here, since the ASM_SET_OP for the difference
+ symbol must appear after both symbols are defined. */
+
+void
+dw2_asm_output_delta VPARAMS ((int size, const char *lab1, const char *lab2,
+ const char *comment, ...))
+{
+#ifndef ANSI_PROTOTYPES
+ int size;
+ const char *lab1, *lab2;
+ const char *comment;
+#endif
+ va_list ap;
+
+ VA_START (ap, comment);
+
+#ifndef ANSI_PROTOTYPES
+ size = va_arg (ap, int);
+ lab1 = va_arg (ap, const char *);
+ lab2 = va_arg (ap, const char *);
+ comment = va_arg (ap, const char *);
+#endif
+
+#ifdef UNALIGNED_INT_ASM_OP
+ fputs (unaligned_integer_asm_op (size), asm_out_file);
+ assemble_name (asm_out_file, lab1);
+ fputc ('-', asm_out_file);
+ assemble_name (asm_out_file, lab2);
+#else
+ assemble_integer (gen_rtx_MINUS (smallest_mode_for_size (size, MODE_INT),
+ gen_rtx_SYMBOL_REF (Pmode, lab1),
+ gen_rtx_SYMBOL_REF (Pmode, lab2)),
+ size, 1);
+#endif
+
+ if (flag_debug_asm && comment)
+ {
+ fprintf (asm_out_file, "\t%s ", ASM_COMMENT_START);
+ vfprintf (asm_out_file, comment, ap);
+ }
+ fputc ('\n', asm_out_file);
+
+ va_end (ap);
+}
+
+/* Output a section-relative reference to a label. In general this
+ can only be done for debugging symbols. E.g. on most targets with
+ the GNU linker, this is accomplished with a direct reference and
+ the knowledge that the debugging section will be placed at VMA 0.
+ Some targets have special relocations for this that we must use. */
+
+void
+dw2_asm_output_offset VPARAMS ((int size, const char *label,
+ const char *comment, ...))
+{
+#ifndef ANSI_PROTOTYPES
+ int size;
+ const char *label;
+ const char *comment;
+#endif
+ va_list ap;
+
+ VA_START (ap, comment);
+
+#ifndef ANSI_PROTOTYPES
+ size = va_arg (ap, int);
+ label = va_arg (ap, const char *);
+ comment = va_arg (ap, const char *);
+#endif
+
+#ifdef ASM_OUTPUT_DWARF_OFFSET
+ ASM_OUTPUT_DWARF_OFFSET (asm_out_file, size, label);
+#else
+#ifdef UNALIGNED_INT_ASM_OP
+ fputs (unaligned_integer_asm_op (size), asm_out_file);
+ assemble_name (asm_out_file, label);
+#else
+ assemble_integer (gen_rtx_SYMBOL_REF (Pmode, label), size, 1);
+#endif
+#endif
+
+ if (flag_debug_asm && comment)
+ {
+ fprintf (asm_out_file, "\t%s ", ASM_COMMENT_START);
+ vfprintf (asm_out_file, comment, ap);
+ }
+ fputc ('\n', asm_out_file);
+
+ va_end (ap);
+}
+
+/* Output a self-relative reference to a label, possibly in a
+ different section or object file. */
+
+void
+dw2_asm_output_pcrel VPARAMS ((int size, const char *label,
+ const char *comment, ...))
+{
+#ifndef ANSI_PROTOTYPES
+ int size;
+ const char *label;
+ const char *comment;
+#endif
+ va_list ap;
+
+ VA_START (ap, comment);
+
+#ifndef ANSI_PROTOTYPES
+ size = va_arg (ap, int);
+ label = va_arg (ap, const char *);
+ comment = va_arg (ap, const char *);
+#endif
+
+#ifdef ASM_OUTPUT_DWARF_PCREL
+ ASM_OUTPUT_DWARF_PCREL (asm_out_file, size, label);
+#else
+#ifdef UNALIGNED_INT_ASM_OP
+ fputs (unaligned_integer_asm_op (size), asm_out_file);
+ assemble_name (asm_out_file, label);
+ fputc ('-', asm_out_file);
+ fputc ('.', asm_out_file);
+#else
+ abort ();
+#endif
+#endif
+
+ if (flag_debug_asm && comment)
+ {
+ fprintf (asm_out_file, "\t%s ", ASM_COMMENT_START);
+ vfprintf (asm_out_file, comment, ap);
+ }
+ fputc ('\n', asm_out_file);
+
+ va_end (ap);
+}
+
+/* Output an absolute reference to a label. */
+
+void
+dw2_asm_output_addr VPARAMS ((int size, const char *label,
+ const char *comment, ...))
+{
+#ifndef ANSI_PROTOTYPES
+ int size;
+ const char *label;
+ const char *comment;
+#endif
+ va_list ap;
+
+ VA_START (ap, comment);
+
+#ifndef ANSI_PROTOTYPES
+ size = va_arg (ap, int);
+ label = va_arg (ap, const char *);
+ comment = va_arg (ap, const char *);
+#endif
+
+#ifdef UNALIGNED_INT_ASM_OP
+ fputs (unaligned_integer_asm_op (size), asm_out_file);
+ assemble_name (asm_out_file, label);
+#else
+ assemble_integer (gen_rtx_SYMBOL_REF (Pmode, label), size, 1);
+#endif
+
+ if (flag_debug_asm && comment)
+ {
+ fprintf (asm_out_file, "\t%s ", ASM_COMMENT_START);
+ vfprintf (asm_out_file, comment, ap);
+ }
+ fputc ('\n', asm_out_file);
+
+ va_end (ap);
+}
+
+/* Similar, but use an RTX expression instead of a text label. */
+
+void
+dw2_asm_output_addr_rtx VPARAMS ((int size, rtx addr,
+ const char *comment, ...))
+{
+#ifndef ANSI_PROTOTYPES
+ int size;
+ rtx addr;
+ const char *comment;
+#endif
+ va_list ap;
+
+ VA_START (ap, comment);
+
+#ifndef ANSI_PROTOTYPES
+ size = va_arg (ap, int);
+ addr = va_arg (ap, rtx);
+ comment = va_arg (ap, const char *);
+#endif
+
+#ifdef UNALIGNED_INT_ASM_OP
+ fputs (unaligned_integer_asm_op (size), asm_out_file);
+ output_addr_const (asm_out_file, addr);
+#else
+ assemble_integer (addr, size, 1);
+#endif
+
+ if (flag_debug_asm && comment)
+ {
+ fprintf (asm_out_file, "\t%s ", ASM_COMMENT_START);
+ vfprintf (asm_out_file, comment, ap);
+ }
+ fputc ('\n', asm_out_file);
+
+ va_end (ap);
+}
+
+void
+dw2_asm_output_nstring VPARAMS ((const char *str, size_t orig_len,
+ const char *comment, ...))
+{
+#ifndef ANSI_PROTOTYPES
+ const char *str;
+ size_t orig_len;
+ const char *comment;
+#endif
+ va_list ap;
+ size_t i, len = orig_len;
+
+ VA_START (ap, comment);
+
+#ifndef ANSI_PROTOTYPES
+ str = va_arg (ap, const char *);
+ len = va_arg (ap, size_t);
+ comment = va_arg (ap, const char *);
+#endif
+
+ if (len == (size_t) -1)
+ len = strlen (str);
+
+ if (flag_debug_asm && comment)
+ {
+ fputs ("\t.ascii \"", asm_out_file);
+ for (i = 0; i < len; i++)
+ {
+ int c = str[i];
+ if (c == '\"' || c == '\\')
+ fputc ('\\', asm_out_file);
+ if (ISPRINT(c))
+ fputc (c, asm_out_file);
+ else
+ fprintf (asm_out_file, "\\%o", c);
+ }
+ fprintf (asm_out_file, "\\0\"\t%s ", ASM_COMMENT_START);
+ vfprintf (asm_out_file, comment, ap);
+ fputc ('\n', asm_out_file);
+ }
+ else
+ {
+ /* If an explicit length was given, we can't assume there
+ is a null termination in the string buffer. */
+ if (orig_len == (size_t) -1)
+ len += 1;
+ ASM_OUTPUT_ASCII (asm_out_file, str, len);
+ if (orig_len != (size_t) -1)
+ fprintf (asm_out_file, "%s0\n", ASM_BYTE_OP);
+ }
+
+ va_end (ap);
+}
+
+
+/* Return the size of an unsigned LEB128 quantity. */
+
+int
+size_of_uleb128 (value)
+ unsigned HOST_WIDE_INT value;
+{
+ int size = 0, byte;
+
+ do
+ {
+ byte = (value & 0x7f);
+ value >>= 7;
+ size += 1;
+ }
+ while (value != 0);
+
+ return size;
+}
+
+/* Return the size of a signed LEB128 quantity. */
+
+int
+size_of_sleb128 (value)
+ HOST_WIDE_INT value;
+{
+ int size = 0, byte;
+
+ do
+ {
+ byte = (value & 0x7f);
+ value >>= 7;
+ size += 1;
+ }
+ while (!((value == 0 && (byte & 0x40) == 0)
+ || (value == -1 && (byte & 0x40) != 0)));
+
+ return size;
+}
+
+/* Given an encoding, return the number of bytes the format occupies.
+ This is only defined for fixed-size encodings, and so does not
+ include leb128. */
+
+int
+size_of_encoded_value (encoding)
+ int encoding;
+{
+ if (encoding == DW_EH_PE_omit)
+ return 0;
+
+ switch (encoding & 0x07)
+ {
+ case DW_EH_PE_absptr:
+ return POINTER_SIZE / BITS_PER_UNIT;
+ case DW_EH_PE_udata2:
+ return 2;
+ case DW_EH_PE_udata4:
+ return 4;
+ case DW_EH_PE_udata8:
+ return 8;
+ }
+ abort ();
+}
+
+/* Yield a name for a given pointer encoding. */
+
+const char *
+eh_data_format_name (format)
+ int format;
+{
+#if HAVE_DESIGNATED_INITIALIZERS
+#define S(p, v) [p] = v,
+#else
+#define S(p, v) case p: return v;
+#endif
+
+#if HAVE_DESIGNATED_INITIALIZERS
+ __extension__ static const char * const format_names[256] = {
+#else
+ switch (format) {
+#endif
+
+ S(DW_EH_PE_absptr, "absolute")
+ S(DW_EH_PE_omit, "omit")
+ S(DW_EH_PE_aligned, "aligned absolute")
+
+ S(DW_EH_PE_uleb128, "uleb128")
+ S(DW_EH_PE_udata2, "udata2")
+ S(DW_EH_PE_udata4, "udata4")
+ S(DW_EH_PE_udata8, "udata8")
+ S(DW_EH_PE_sleb128, "sleb128")
+ S(DW_EH_PE_sdata2, "sdata2")
+ S(DW_EH_PE_sdata4, "sdata4")
+ S(DW_EH_PE_sdata8, "sdata8")
+
+ S(DW_EH_PE_absptr | DW_EH_PE_pcrel, "pcrel")
+ S(DW_EH_PE_uleb128 | DW_EH_PE_pcrel, "pcrel uleb128")
+ S(DW_EH_PE_udata2 | DW_EH_PE_pcrel, "pcrel udata2")
+ S(DW_EH_PE_udata4 | DW_EH_PE_pcrel, "pcrel udata4")
+ S(DW_EH_PE_udata8 | DW_EH_PE_pcrel, "pcrel udata8")
+ S(DW_EH_PE_sleb128 | DW_EH_PE_pcrel, "pcrel sleb128")
+ S(DW_EH_PE_sdata2 | DW_EH_PE_pcrel, "pcrel sdata2")
+ S(DW_EH_PE_sdata4 | DW_EH_PE_pcrel, "pcrel sdata4")
+ S(DW_EH_PE_sdata8 | DW_EH_PE_pcrel, "pcrel sdata8")
+
+ S(DW_EH_PE_absptr | DW_EH_PE_textrel, "textrel")
+ S(DW_EH_PE_uleb128 | DW_EH_PE_textrel, "textrel uleb128")
+ S(DW_EH_PE_udata2 | DW_EH_PE_textrel, "textrel udata2")
+ S(DW_EH_PE_udata4 | DW_EH_PE_textrel, "textrel udata4")
+ S(DW_EH_PE_udata8 | DW_EH_PE_textrel, "textrel udata8")
+ S(DW_EH_PE_sleb128 | DW_EH_PE_textrel, "textrel sleb128")
+ S(DW_EH_PE_sdata2 | DW_EH_PE_textrel, "textrel sdata2")
+ S(DW_EH_PE_sdata4 | DW_EH_PE_textrel, "textrel sdata4")
+ S(DW_EH_PE_sdata8 | DW_EH_PE_textrel, "textrel sdata8")
+
+ S(DW_EH_PE_absptr | DW_EH_PE_datarel, "datarel")
+ S(DW_EH_PE_uleb128 | DW_EH_PE_datarel, "datarel uleb128")
+ S(DW_EH_PE_udata2 | DW_EH_PE_datarel, "datarel udata2")
+ S(DW_EH_PE_udata4 | DW_EH_PE_datarel, "datarel udata4")
+ S(DW_EH_PE_udata8 | DW_EH_PE_datarel, "datarel udata8")
+ S(DW_EH_PE_sleb128 | DW_EH_PE_datarel, "datarel sleb128")
+ S(DW_EH_PE_sdata2 | DW_EH_PE_datarel, "datarel sdata2")
+ S(DW_EH_PE_sdata4 | DW_EH_PE_datarel, "datarel sdata4")
+ S(DW_EH_PE_sdata8 | DW_EH_PE_datarel, "datarel sdata8")
+
+ S(DW_EH_PE_absptr | DW_EH_PE_funcrel, "funcrel")
+ S(DW_EH_PE_uleb128 | DW_EH_PE_funcrel, "funcrel uleb128")
+ S(DW_EH_PE_udata2 | DW_EH_PE_funcrel, "funcrel udata2")
+ S(DW_EH_PE_udata4 | DW_EH_PE_funcrel, "funcrel udata4")
+ S(DW_EH_PE_udata8 | DW_EH_PE_funcrel, "funcrel udata8")
+ S(DW_EH_PE_sleb128 | DW_EH_PE_funcrel, "funcrel sleb128")
+ S(DW_EH_PE_sdata2 | DW_EH_PE_funcrel, "funcrel sdata2")
+ S(DW_EH_PE_sdata4 | DW_EH_PE_funcrel, "funcrel sdata4")
+ S(DW_EH_PE_sdata8 | DW_EH_PE_funcrel, "funcrel sdata8")
+
+ S(DW_EH_PE_indirect | DW_EH_PE_absptr | DW_EH_PE_pcrel,
+ "indirect pcrel")
+ S(DW_EH_PE_indirect | DW_EH_PE_uleb128 | DW_EH_PE_pcrel,
+ "indirect pcrel uleb128")
+ S(DW_EH_PE_indirect | DW_EH_PE_udata2 | DW_EH_PE_pcrel,
+ "indirect pcrel udata2")
+ S(DW_EH_PE_indirect | DW_EH_PE_udata4 | DW_EH_PE_pcrel,
+ "indirect pcrel udata4")
+ S(DW_EH_PE_indirect | DW_EH_PE_udata8 | DW_EH_PE_pcrel,
+ "indirect pcrel udata8")
+ S(DW_EH_PE_indirect | DW_EH_PE_sleb128 | DW_EH_PE_pcrel,
+ "indirect pcrel sleb128")
+ S(DW_EH_PE_indirect | DW_EH_PE_sdata2 | DW_EH_PE_pcrel,
+ "indirect pcrel sdata2")
+ S(DW_EH_PE_indirect | DW_EH_PE_sdata4 | DW_EH_PE_pcrel,
+ "indirect pcrel sdata4")
+ S(DW_EH_PE_indirect | DW_EH_PE_sdata8 | DW_EH_PE_pcrel,
+ "indirect pcrel sdata8")
+
+ S(DW_EH_PE_indirect | DW_EH_PE_absptr | DW_EH_PE_textrel,
+ "indirect textrel")
+ S(DW_EH_PE_indirect | DW_EH_PE_uleb128 | DW_EH_PE_textrel,
+ "indirect textrel uleb128")
+ S(DW_EH_PE_indirect | DW_EH_PE_udata2 | DW_EH_PE_textrel,
+ "indirect textrel udata2")
+ S(DW_EH_PE_indirect | DW_EH_PE_udata4 | DW_EH_PE_textrel,
+ "indirect textrel udata4")
+ S(DW_EH_PE_indirect | DW_EH_PE_udata8 | DW_EH_PE_textrel,
+ "indirect textrel udata8")
+ S(DW_EH_PE_indirect | DW_EH_PE_sleb128 | DW_EH_PE_textrel,
+ "indirect textrel sleb128")
+ S(DW_EH_PE_indirect | DW_EH_PE_sdata2 | DW_EH_PE_textrel,
+ "indirect textrel sdata2")
+ S(DW_EH_PE_indirect | DW_EH_PE_sdata4 | DW_EH_PE_textrel,
+ "indirect textrel sdata4")
+ S(DW_EH_PE_indirect | DW_EH_PE_sdata8 | DW_EH_PE_textrel,
+ "indirect textrel sdata8")
+
+ S(DW_EH_PE_indirect | DW_EH_PE_absptr | DW_EH_PE_datarel,
+ "indirect datarel")
+ S(DW_EH_PE_indirect | DW_EH_PE_uleb128 | DW_EH_PE_datarel,
+ "indirect datarel uleb128")
+ S(DW_EH_PE_indirect | DW_EH_PE_udata2 | DW_EH_PE_datarel,
+ "indirect datarel udata2")
+ S(DW_EH_PE_indirect | DW_EH_PE_udata4 | DW_EH_PE_datarel,
+ "indirect datarel udata4")
+ S(DW_EH_PE_indirect | DW_EH_PE_udata8 | DW_EH_PE_datarel,
+ "indirect datarel udata8")
+ S(DW_EH_PE_indirect | DW_EH_PE_sleb128 | DW_EH_PE_datarel,
+ "indirect datarel sleb128")
+ S(DW_EH_PE_indirect | DW_EH_PE_sdata2 | DW_EH_PE_datarel,
+ "indirect datarel sdata2")
+ S(DW_EH_PE_indirect | DW_EH_PE_sdata4 | DW_EH_PE_datarel,
+ "indirect datarel sdata4")
+ S(DW_EH_PE_indirect | DW_EH_PE_sdata8 | DW_EH_PE_datarel,
+ "indirect datarel sdata8")
+
+ S(DW_EH_PE_indirect | DW_EH_PE_absptr | DW_EH_PE_funcrel,
+ "indirect funcrel")
+ S(DW_EH_PE_indirect | DW_EH_PE_uleb128 | DW_EH_PE_funcrel,
+ "indirect funcrel uleb128")
+ S(DW_EH_PE_indirect | DW_EH_PE_udata2 | DW_EH_PE_funcrel,
+ "indirect funcrel udata2")
+ S(DW_EH_PE_indirect | DW_EH_PE_udata4 | DW_EH_PE_funcrel,
+ "indirect funcrel udata4")
+ S(DW_EH_PE_indirect | DW_EH_PE_udata8 | DW_EH_PE_funcrel,
+ "indirect funcrel udata8")
+ S(DW_EH_PE_indirect | DW_EH_PE_sleb128 | DW_EH_PE_funcrel,
+ "indirect funcrel sleb128")
+ S(DW_EH_PE_indirect | DW_EH_PE_sdata2 | DW_EH_PE_funcrel,
+ "indirect funcrel sdata2")
+ S(DW_EH_PE_indirect | DW_EH_PE_sdata4 | DW_EH_PE_funcrel,
+ "indirect funcrel sdata4")
+ S(DW_EH_PE_indirect | DW_EH_PE_sdata8 | DW_EH_PE_funcrel,
+ "indirect funcrel sdata8")
+
+#if HAVE_DESIGNATED_INITIALIZERS
+ };
+
+ if (format < 0 || format > 0xff || format_names[format] == NULL)
+ abort ();
+ return format_names[format];
+#else
+ }
+ abort ();
+#endif
+}
+
+/* Output an unsigned LEB128 quantity. */
+
+void
+dw2_asm_output_data_uleb128 VPARAMS ((unsigned HOST_WIDE_INT value,
+ const char *comment, ...))
+{
+#ifndef ANSI_PROTOTYPES
+ unsigned HOST_WIDE_INT value;
+ const char *comment;
+#endif
+ va_list ap;
+
+ VA_START (ap, comment);
+
+#ifndef ANSI_PROTOTYPES
+ value = va_arg (ap, unsigned HOST_WIDE_INT);
+ comment = va_arg (ap, const char *);
+#endif
+
+#ifdef HAVE_AS_LEB128
+ fputs ("\t.uleb128 ", asm_out_file);
+ fprintf (asm_out_file, HOST_WIDE_INT_PRINT_HEX, value);
+
+ if (flag_debug_asm && comment)
+ {
+ fprintf (asm_out_file, "\t%s ", ASM_COMMENT_START);
+ vfprintf (asm_out_file, comment, ap);
+ }
+#else
+ {
+ unsigned HOST_WIDE_INT work = value;
+
+ fputs (ASM_BYTE_OP, asm_out_file);
+ do
+ {
+ int byte = (work & 0x7f);
+ work >>= 7;
+ if (work != 0)
+ /* More bytes to follow. */
+ byte |= 0x80;
+
+ fprintf (asm_out_file, "0x%x", byte);
+ if (work != 0)
+ fputc (',', asm_out_file);
+ }
+ while (work != 0);
+
+ if (flag_debug_asm)
+ {
+ fprintf (asm_out_file, "\t%s uleb128 ", ASM_COMMENT_START);
+ fprintf (asm_out_file, HOST_WIDE_INT_PRINT_HEX, value);
+ if (comment)
+ {
+ fputs ("; ", asm_out_file);
+ vfprintf (asm_out_file, comment, ap);
+ }
+ }
+ }
+#endif
+ fputc ('\n', asm_out_file);
+
+ va_end (ap);
+}
+
+/* Output an signed LEB128 quantity. */
+
+void
+dw2_asm_output_data_sleb128 VPARAMS ((HOST_WIDE_INT value,
+ const char *comment, ...))
+{
+#ifndef ANSI_PROTOTYPES
+ HOST_WIDE_INT value;
+ const char *comment;
+#endif
+ va_list ap;
+
+ VA_START (ap, comment);
+
+#ifndef ANSI_PROTOTYPES
+ value = va_arg (ap, HOST_WIDE_INT);
+ comment = va_arg (ap, const char *);
+#endif
+
+#ifdef HAVE_AS_LEB128
+ fputs ("\t.sleb128 ", asm_out_file);
+ fprintf (asm_out_file, HOST_WIDE_INT_PRINT_DEC, value);
+
+ if (flag_debug_asm && comment)
+ {
+ fprintf (asm_out_file, "\t%s ", ASM_COMMENT_START);
+ vfprintf (asm_out_file, comment, ap);
+ }
+#else
+ {
+ HOST_WIDE_INT work = value;
+ int more, byte;
+
+ fputs (ASM_BYTE_OP, asm_out_file);
+ do
+ {
+ byte = (work & 0x7f);
+ /* arithmetic shift */
+ work >>= 7;
+ more = !((work == 0 && (byte & 0x40) == 0)
+ || (work == -1 && (byte & 0x40) != 0));
+ if (more)
+ byte |= 0x80;
+
+ fprintf (asm_out_file, "0x%x", byte);
+ if (more)
+ fputc (',', asm_out_file);
+ }
+ while (more);
+
+ if (flag_debug_asm)
+ {
+ fprintf (asm_out_file, "\t%s sleb128 ", ASM_COMMENT_START);
+ fprintf (asm_out_file, HOST_WIDE_INT_PRINT_DEC, value);
+ if (comment)
+ {
+ fputs ("; ", asm_out_file);
+ vfprintf (asm_out_file, comment, ap);
+ }
+ }
+ }
+#endif
+ fputc ('\n', asm_out_file);
+
+ va_end (ap);
+}
+
+void
+dw2_asm_output_delta_uleb128 VPARAMS ((const char *lab1 ATTRIBUTE_UNUSED,
+ const char *lab2 ATTRIBUTE_UNUSED,
+ const char *comment, ...))
+{
+#ifndef ANSI_PROTOTYPES
+ const char *lab1, *lab2;
+ const char *comment;
+#endif
+ va_list ap;
+
+ VA_START (ap, comment);
+
+#ifndef ANSI_PROTOTYPES
+ lab1 = va_arg (ap, const char *);
+ lab2 = va_arg (ap, const char *);
+ comment = va_arg (ap, const char *);
+#endif
+
+#ifdef HAVE_AS_LEB128
+ fputs ("\t.uleb128 ", asm_out_file);
+ assemble_name (asm_out_file, lab1);
+ fputc ('-', asm_out_file);
+ assemble_name (asm_out_file, lab2);
+#else
+ abort ();
+#endif
+
+ if (flag_debug_asm && comment)
+ {
+ fprintf (asm_out_file, "\t%s ", ASM_COMMENT_START);
+ vfprintf (asm_out_file, comment, ap);
+ }
+ fputc ('\n', asm_out_file);
+
+ va_end (ap);
+}
+
+void
+dw2_asm_output_delta_sleb128 VPARAMS ((const char *lab1 ATTRIBUTE_UNUSED,
+ const char *lab2 ATTRIBUTE_UNUSED,
+ const char *comment, ...))
+{
+#ifndef ANSI_PROTOTYPES
+ const char *lab1, *lab2;
+ const char *comment;
+#endif
+ va_list ap;
+
+ VA_START (ap, comment);
+
+#ifndef ANSI_PROTOTYPES
+ lab1 = va_arg (ap, const char *);
+ lab2 = va_arg (ap, const char *);
+ comment = va_arg (ap, const char *);
+#endif
+
+#ifdef HAVE_AS_LEB128
+ fputs ("\t.sleb128 ", asm_out_file);
+ assemble_name (asm_out_file, lab1);
+ fputc ('-', asm_out_file);
+ assemble_name (asm_out_file, lab2);
+#else
+ abort ();
+#endif
+
+ if (flag_debug_asm && comment)
+ {
+ fprintf (asm_out_file, "\t%s ", ASM_COMMENT_START);
+ vfprintf (asm_out_file, comment, ap);
+ }
+ fputc ('\n', asm_out_file);
+
+ va_end (ap);
+}
+
+static rtx dw2_force_const_mem PARAMS ((rtx));
+static int dw2_output_indirect_constant_1 PARAMS ((splay_tree_node, void *));
+
+static splay_tree indirect_pool;
+
+/* Put X, a SYMBOL_REF, in memory. Return a SYMBOL_REF to the allocated
+ memory. Differs from force_const_mem in that a single pool is used for
+ the entire unit of translation, and the memory is not guaranteed to be
+ "near" the function in any interesting sense. */
+
+static rtx
+dw2_force_const_mem (x)
+ rtx x;
+{
+ splay_tree_node node;
+ const char *const_sym;
+
+ if (! indirect_pool)
+ indirect_pool = splay_tree_new (splay_tree_compare_pointers, NULL, NULL);
+
+ if (GET_CODE (x) != SYMBOL_REF)
+ abort ();
+ node = splay_tree_lookup (indirect_pool, (splay_tree_key) XSTR (x, 0));
+ if (node)
+ const_sym = (const char *) node->value;
+ else
+ {
+ extern int const_labelno;
+ char label[32];
+ tree id;
+
+ ASM_GENERATE_INTERNAL_LABEL (label, "LC", const_labelno);
+ ++const_labelno;
+ const_sym = ggc_strdup (label);
+
+ id = maybe_get_identifier (XSTR (x, 0));
+ if (id)
+ TREE_SYMBOL_REFERENCED (id) = 1;
+
+ splay_tree_insert (indirect_pool, (splay_tree_key) XSTR (x, 0),
+ (splay_tree_value) const_sym);
+ }
+
+ return gen_rtx_SYMBOL_REF (Pmode, const_sym);
+}
+
+/* A helper function for dw2_output_indirect_constants called through
+ splay_tree_foreach. Emit one queued constant to memory. */
+
+static int
+dw2_output_indirect_constant_1 (node, data)
+ splay_tree_node node;
+ void* data ATTRIBUTE_UNUSED;
+{
+ const char *label, *sym;
+ rtx sym_ref;
+
+ label = (const char *) node->value;
+ sym = (const char *) node->key;
+ sym_ref = gen_rtx_SYMBOL_REF (Pmode, sym);
+
+ ASM_OUTPUT_LABEL (asm_out_file, label);
+ assemble_integer (sym_ref, POINTER_SIZE / BITS_PER_UNIT, 1);
+
+ return 0;
+}
+
+/* Emit the constants queued through dw2_force_const_mem. */
+
+void
+dw2_output_indirect_constants ()
+{
+ if (! indirect_pool)
+ return;
+
+ /* Assume that the whole reason we're emitting these symbol references
+ indirectly is that they contain dynamic relocations, and are thus
+ read-write. If there was no possibility of a dynamic relocation, we
+ might as well have used a direct relocation. */
+ data_section ();
+
+ /* Everything we're emitting is a pointer. Align appropriately. */
+ assemble_align (POINTER_SIZE);
+
+ splay_tree_foreach (indirect_pool, dw2_output_indirect_constant_1, NULL);
+}
+
+/* Like dw2_asm_output_addr_rtx, but encode the pointer as directed. */
+
+void
+dw2_asm_output_encoded_addr_rtx VPARAMS ((int encoding,
+ rtx addr,
+ const char *comment, ...))
+{
+#ifndef ANSI_PROTOTYPES
+ int encoding;
+ rtx addr;
+ const char *comment;
+#endif
+ va_list ap;
+ int size;
+
+ VA_START (ap, comment);
+
+#ifndef ANSI_PROTOTYPES
+ encoding = va_arg (ap, int);
+ addr = va_arg (ap, rtx);
+ comment = va_arg (ap, const char *);
+#endif
+
+ size = size_of_encoded_value (encoding);
+
+ if (encoding == DW_EH_PE_aligned)
+ {
+ assemble_align (POINTER_SIZE);
+ encoding = DW_EH_PE_absptr;
+ }
+
+ /* NULL is _always_ represented as a plain zero. */
+ if (addr == const0_rtx)
+ assemble_integer (addr, size, 1);
+ else
+ {
+ restart:
+ /* Allow the target first crack at emitting this. Some of the
+ special relocations require special directives instead of
+ just ".4byte" or whatever. */
+#ifdef ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX
+ ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX (asm_out_file, encoding, size,
+ addr, done);
+#endif
+
+ /* Indirection is used to get dynamic relocations out of a
+ read-only section. */
+ if (encoding & DW_EH_PE_indirect)
+ {
+ /* It is very tempting to use force_const_mem so that we share data
+ with the normal constant pool. However, we've already emitted
+ the constant pool for this function. Moreover, we'd like to
+ share these constants across the entire unit of translation,
+ or better, across the entire application (or DSO). */
+ addr = dw2_force_const_mem (addr);
+ encoding &= ~DW_EH_PE_indirect;
+ goto restart;
+ }
+
+ switch (encoding & 0xF0)
+ {
+ case DW_EH_PE_absptr:
+#ifdef UNALIGNED_INT_ASM_OP
+ fputs (unaligned_integer_asm_op (size), asm_out_file);
+ output_addr_const (asm_out_file, addr);
+#else
+ assemble_integer (addr, size, 1);
+#endif
+ break;
+
+ case DW_EH_PE_pcrel:
+ if (GET_CODE (addr) != SYMBOL_REF)
+ abort ();
+#ifdef ASM_OUTPUT_DWARF_PCREL
+ ASM_OUTPUT_DWARF_PCREL (asm_out_file, size, XSTR (addr, 0));
+#else
+#ifdef UNALIGNED_INT_ASM_OP
+ fputs (unaligned_integer_asm_op (size), asm_out_file);
+ assemble_name (asm_out_file, XSTR (addr, 0));
+ fputc ('-', asm_out_file);
+ fputc ('.', asm_out_file);
+#else
+ abort ();
+#endif
+#endif
+ break;
+
+ default:
+ /* Other encodings should have been handled by
+ ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX. */
+ abort ();
+ }
+
+#ifdef ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX
+ done:;
+#endif
+ }
+
+ if (flag_debug_asm && comment)
+ {
+ fprintf (asm_out_file, "\t%s ", ASM_COMMENT_START);
+ vfprintf (asm_out_file, comment, ap);
+ }
+ fputc ('\n', asm_out_file);
+
+ va_end (ap);
+}
diff --git a/gcc/dwarf2asm.h b/gcc/dwarf2asm.h
new file mode 100644
index 00000000000..fb548b2cb89
--- /dev/null
+++ b/gcc/dwarf2asm.h
@@ -0,0 +1,80 @@
+/* Dwarf2 assembler output helper routines.
+ Copyright (C) 2001 Free Software Foundation, Inc.
+
+This file is part of GNU CC.
+
+GNU CC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU CC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU CC; see the file COPYING. If not, write to
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA. */
+
+
+/* ??? Format checking yields "null format string" warnings, which is
+ the way these routines are signaled that there is no associated
+ debug information. So the attributes are commented out. */
+
+extern void dw2_asm_output_data PARAMS ((int, unsigned HOST_WIDE_INT,
+ const char *, ...))
+ /* ATTRIBUTE_PRINTF_3 */;
+
+extern void dw2_asm_output_delta PARAMS ((int, const char *,
+ const char *,
+ const char *, ...))
+ /* ATTRIBUTE_PRINTF_4 */;
+
+extern void dw2_asm_output_offset PARAMS ((int, const char *,
+ const char *, ...))
+ /* ATTRIBUTE_PRINTF_3 */;
+
+extern void dw2_asm_output_pcrel PARAMS ((int, const char *,
+ const char *, ...))
+ /* ATTRIBUTE_PRINTF_3 */;
+
+extern void dw2_asm_output_addr PARAMS ((int, const char *,
+ const char *, ...))
+ /* ATTRIBUTE_PRINTF_3 */;
+
+extern void dw2_asm_output_addr_rtx PARAMS ((int, rtx,
+ const char *, ...))
+ /* ATTRIBUTE_PRINTF_3 */;
+
+extern void dw2_asm_output_encoded_addr_rtx PARAMS ((int, rtx,
+ const char *, ...))
+ /* ATTRIBUTE_PRINTF_3 */;
+
+extern void dw2_asm_output_nstring PARAMS ((const char *, size_t,
+ const char *, ...))
+ /* ATTRIBUTE_PRINTF_3 */;
+
+extern void dw2_asm_output_data_uleb128 PARAMS ((unsigned HOST_WIDE_INT,
+ const char *, ...))
+ /* ATTRIBUTE_PRINTF_2 */;
+
+extern void dw2_asm_output_data_sleb128 PARAMS ((HOST_WIDE_INT,
+ const char *, ...))
+ /* ATTRIBUTE_PRINTF_2 */;
+
+extern void dw2_asm_output_delta_uleb128 PARAMS ((const char *, const char *,
+ const char *, ...))
+ /* ATTRIBUTE_PRINTF_3 */;
+
+extern void dw2_asm_output_delta_sleb128 PARAMS ((const char *, const char *,
+ const char *, ...))
+ /* ATTRIBUTE_PRINTF_3 */;
+
+extern int size_of_uleb128 PARAMS ((unsigned HOST_WIDE_INT));
+extern int size_of_sleb128 PARAMS ((HOST_WIDE_INT));
+extern int size_of_encoded_value PARAMS ((int));
+extern const char *eh_data_format_name PARAMS ((int));
+
+extern void dw2_output_indirect_constants PARAMS ((void));
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index fa62101ef6f..ee1e736c0e9 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -44,11 +44,13 @@ Boston, MA 02111-1307, USA. */
#include "regs.h"
#include "insn-config.h"
#include "reload.h"
+#include "function.h"
#include "output.h"
#include "expr.h"
#include "except.h"
#include "dwarf2.h"
#include "dwarf2out.h"
+#include "dwarf2asm.h"
#include "toplev.h"
#include "varray.h"
#include "ggc.h"
@@ -85,11 +87,18 @@ dwarf2out_do_frame ()
#endif
#ifdef DWARF2_UNWIND_INFO
|| flag_unwind_tables
- || (flag_exceptions && ! exceptions_via_longjmp)
+ || (flag_exceptions && ! USING_SJLJ_EXCEPTIONS)
#endif
);
}
+/* The number of the current function definition for which debugging
+ information is being generated. These numbers range from 1 up to the
+ maximum number of function definitions contained within the current
+ compilation unit. These numbers are used to create unique label id's
+ unique to each function definition. */
+unsigned current_funcdef_number = 0;
+
#if defined (DWARF2_DEBUGGING_INFO) || defined (DWARF2_UNWIND_INFO)
/* How to start an assembler comment. */
@@ -149,7 +158,9 @@ typedef struct dw_fde_struct
const char *dw_fde_current_label;
const char *dw_fde_end;
dw_cfi_ref dw_fde_cfi;
- int nothrow;
+ unsigned funcdef_number;
+ unsigned nothrow : 1;
+ unsigned uses_eh_lsda : 1;
}
dw_fde_node;
@@ -211,13 +222,6 @@ static unsigned fde_table_in_use;
/* A list of call frame insns for the CIE. */
static dw_cfi_ref cie_cfi_head;
-/* The number of the current function definition for which debugging
- information is being generated. These numbers range from 1 up to the
- maximum number of function definitions contained within the current
- compilation unit. These numbers are used to create unique label id's
- unique to each function definition. */
-static unsigned current_funcdef_number = 0;
-
/* Some DWARF extensions (e.g., MIPS/SGI) implement a subprogram
attribute that accelerates the lookup of the FDE associated
with the subprogram. This variable holds the table index of the FDE
@@ -230,10 +234,6 @@ static char *stripattributes PARAMS ((const char *));
static const char *dwarf_cfi_name PARAMS ((unsigned));
static dw_cfi_ref new_cfi PARAMS ((void));
static void add_cfi PARAMS ((dw_cfi_ref *, dw_cfi_ref));
-static unsigned long size_of_uleb128 PARAMS ((unsigned long));
-static unsigned long size_of_sleb128 PARAMS ((long));
-static void output_uleb128 PARAMS ((unsigned long));
-static void output_sleb128 PARAMS ((long));
static void add_fde_cfi PARAMS ((const char *, dw_cfi_ref));
static void lookup_cfa_1 PARAMS ((dw_cfi_ref, dw_cfa_location *));
static void lookup_cfa PARAMS ((dw_cfa_location *));
@@ -241,9 +241,12 @@ static void reg_save PARAMS ((const char *, unsigned,
unsigned, long));
static void initial_return_save PARAMS ((rtx));
static long stack_adjust_offset PARAMS ((rtx));
-static void output_cfi PARAMS ((dw_cfi_ref, dw_fde_ref));
+static void output_cfi PARAMS ((dw_cfi_ref, dw_fde_ref, int));
static void output_call_frame_info PARAMS ((int));
static void dwarf2out_stack_adjust PARAMS ((rtx));
+static void queue_reg_save PARAMS ((const char *, rtx, long));
+static void flush_queued_reg_saves PARAMS ((void));
+static bool clobbers_queued_reg_save PARAMS ((rtx));
static void dwarf2out_frame_debug_expr PARAMS ((rtx, const char *));
/* Support for complex CFA locations. */
@@ -254,25 +257,9 @@ static struct dw_loc_descr_struct *build_cfa_loc
PARAMS ((dw_cfa_location *));
static void def_cfa_1 PARAMS ((const char *, dw_cfa_location *));
-/* Definitions of defaults for assembler-dependent names of various
- pseudo-ops and section names.
- Theses may be overridden in the tm.h file (if necessary) for a particular
- assembler. */
-
-#ifdef OBJECT_FORMAT_ELF
-#ifndef UNALIGNED_SHORT_ASM_OP
-#define UNALIGNED_SHORT_ASM_OP "\t.2byte\t"
-#endif
-#ifndef UNALIGNED_INT_ASM_OP
-#define UNALIGNED_INT_ASM_OP "\t.4byte\t"
-#endif
-#ifndef UNALIGNED_DOUBLE_INT_ASM_OP
-#define UNALIGNED_DOUBLE_INT_ASM_OP "\t.8byte\t"
-#endif
-#endif /* OBJECT_FORMAT_ELF */
-
-#ifndef ASM_BYTE_OP
-#define ASM_BYTE_OP "\t.byte\t"
+/* How to start an assembler comment. */
+#ifndef ASM_COMMENT_START
+#define ASM_COMMENT_START ";#"
#endif
/* Data and reference forms for relocatable data. */
@@ -306,12 +293,18 @@ static void def_cfa_1 PARAMS ((const char *, dw_cfa_location *));
#ifndef FUNC_END_LABEL
#define FUNC_END_LABEL "LFE"
#endif
+#define FRAME_BEGIN_LABEL "Lframe"
#define CIE_AFTER_SIZE_LABEL "LSCIE"
#define CIE_END_LABEL "LECIE"
#define CIE_LENGTH_LABEL "LLCIE"
-#define FDE_AFTER_SIZE_LABEL "LSFDE"
+#define FDE_LABEL "LSFDE"
+#define FDE_AFTER_SIZE_LABEL "LASFDE"
#define FDE_END_LABEL "LEFDE"
#define FDE_LENGTH_LABEL "LLFDE"
+#define LINE_NUMBER_BEGIN_LABEL "LSLT"
+#define LINE_NUMBER_END_LABEL "LELT"
+#define LN_PROLOG_AS_LABEL "LASLTP"
+#define LN_PROLOG_END_LABEL "LELTP"
#define DIE_LABEL_PREFIX "DW"
/* Definitions of defaults for various types of primitive assembly language
@@ -323,212 +316,6 @@ static void def_cfa_1 PARAMS ((const char *, dw_cfa_location *));
fprintf ((FILE), SECTION_FORMAT, SECTION_ASM_OP, SECTION)
#endif
-#ifndef ASM_OUTPUT_DWARF_DATA1
-#define ASM_OUTPUT_DWARF_DATA1(FILE,VALUE) \
- fprintf ((FILE), "%s0x%x", ASM_BYTE_OP, (unsigned) (VALUE))
-#endif
-
-#ifndef ASM_OUTPUT_DWARF_DELTA1
-#define ASM_OUTPUT_DWARF_DELTA1(FILE,LABEL1,LABEL2) \
- do { fprintf ((FILE), "%s", ASM_BYTE_OP); \
- assemble_name (FILE, LABEL1); \
- fprintf (FILE, "-"); \
- assemble_name (FILE, LABEL2); \
- } while (0)
-#endif
-
-#ifdef UNALIGNED_INT_ASM_OP
-
-#ifndef UNALIGNED_OFFSET_ASM_OP
-#define UNALIGNED_OFFSET_ASM_OP \
- (DWARF_OFFSET_SIZE == 8 ? UNALIGNED_DOUBLE_INT_ASM_OP : UNALIGNED_INT_ASM_OP)
-#endif
-
-#ifndef UNALIGNED_WORD_ASM_OP
-#define UNALIGNED_WORD_ASM_OP \
- ((DWARF2_ADDR_SIZE) == 8 ? UNALIGNED_DOUBLE_INT_ASM_OP \
- : (DWARF2_ADDR_SIZE) == 2 ? UNALIGNED_SHORT_ASM_OP \
- : UNALIGNED_INT_ASM_OP)
-#endif
-
-#ifndef ASM_OUTPUT_DWARF_DELTA2
-#define ASM_OUTPUT_DWARF_DELTA2(FILE,LABEL1,LABEL2) \
- do { fprintf ((FILE), "%s", UNALIGNED_SHORT_ASM_OP); \
- assemble_name (FILE, LABEL1); \
- fprintf (FILE, "-"); \
- assemble_name (FILE, LABEL2); \
- } while (0)
-#endif
-
-#ifndef ASM_OUTPUT_DWARF_DELTA4
-#define ASM_OUTPUT_DWARF_DELTA4(FILE,LABEL1,LABEL2) \
- do { fprintf ((FILE), "%s", UNALIGNED_INT_ASM_OP); \
- assemble_name (FILE, LABEL1); \
- fprintf (FILE, "-"); \
- assemble_name (FILE, LABEL2); \
- } while (0)
-#endif
-
-#ifndef ASM_OUTPUT_DWARF_DELTA
-#define ASM_OUTPUT_DWARF_DELTA(FILE,LABEL1,LABEL2) \
- do { fprintf ((FILE), "%s", UNALIGNED_OFFSET_ASM_OP); \
- assemble_name (FILE, LABEL1); \
- fprintf (FILE, "-"); \
- assemble_name (FILE, LABEL2); \
- } while (0)
-#endif
-
-#ifndef ASM_OUTPUT_DWARF_ADDR_DELTA
-#define ASM_OUTPUT_DWARF_ADDR_DELTA(FILE,LABEL1,LABEL2) \
- do { fprintf ((FILE), "%s", UNALIGNED_WORD_ASM_OP); \
- assemble_name (FILE, LABEL1); \
- fprintf (FILE, "-"); \
- assemble_name (FILE, LABEL2); \
- } while (0)
-#endif
-
-#ifndef ASM_OUTPUT_DWARF_ADDR
-#define ASM_OUTPUT_DWARF_ADDR(FILE,LABEL) \
- do { fprintf ((FILE), "%s", UNALIGNED_WORD_ASM_OP); \
- assemble_name (FILE, LABEL); \
- } while (0)
-#endif
-
-#ifndef ASM_OUTPUT_DWARF_ADDR_CONST
-#define ASM_OUTPUT_DWARF_ADDR_CONST(FILE,RTX) \
- do { \
- fprintf ((FILE), "%s", UNALIGNED_WORD_ASM_OP); \
- output_addr_const ((FILE), (RTX)); \
- } while (0)
-#endif
-
-#ifndef ASM_OUTPUT_DWARF_OFFSET4
-#define ASM_OUTPUT_DWARF_OFFSET4(FILE,LABEL) \
- do { fprintf ((FILE), "%s", UNALIGNED_INT_ASM_OP); \
- assemble_name (FILE, LABEL); \
- } while (0)
-#endif
-
-#ifndef ASM_OUTPUT_DWARF_OFFSET
-#define ASM_OUTPUT_DWARF_OFFSET(FILE,LABEL) \
- do { fprintf ((FILE), "%s", UNALIGNED_OFFSET_ASM_OP); \
- assemble_name (FILE, LABEL); \
- } while (0)
-#endif
-
-#ifndef ASM_OUTPUT_DWARF_DATA2
-#define ASM_OUTPUT_DWARF_DATA2(FILE,VALUE) \
- fprintf ((FILE), "%s0x%x", UNALIGNED_SHORT_ASM_OP, (unsigned) (VALUE))
-#endif
-
-#ifndef ASM_OUTPUT_DWARF_DATA4
-#define ASM_OUTPUT_DWARF_DATA4(FILE,VALUE) \
- fprintf ((FILE), "%s0x%x", UNALIGNED_INT_ASM_OP, (unsigned) (VALUE))
-#endif
-
-#ifndef ASM_OUTPUT_DWARF_DATA8
-#define ASM_OUTPUT_DWARF_DATA8(FILE,VALUE) \
- fprintf ((FILE), "%s0x%lx", UNALIGNED_DOUBLE_INT_ASM_OP, \
- (unsigned long) (VALUE))
-#endif
-
-#ifndef ASM_OUTPUT_DWARF_DATA
-#define ASM_OUTPUT_DWARF_DATA(FILE,VALUE) \
- fprintf ((FILE), "%s0x%lx", UNALIGNED_OFFSET_ASM_OP, \
- (unsigned long) (VALUE))
-#endif
-
-#ifndef ASM_OUTPUT_DWARF_ADDR_DATA
-#define ASM_OUTPUT_DWARF_ADDR_DATA(FILE,VALUE) \
- fprintf ((FILE), "%s0x%lx", UNALIGNED_WORD_ASM_OP, \
- (unsigned long) (VALUE))
-#endif
-
-#ifndef ASM_OUTPUT_DWARF_CONST_DOUBLE
-#define ASM_OUTPUT_DWARF_CONST_DOUBLE(FILE,HIGH_VALUE,LOW_VALUE) \
- do { \
- if (WORDS_BIG_ENDIAN) \
- { \
- fprintf ((FILE), "%s0x%lx\n", UNALIGNED_INT_ASM_OP, (HIGH_VALUE));\
- fprintf ((FILE), "%s0x%lx", UNALIGNED_INT_ASM_OP, (LOW_VALUE));\
- } \
- else \
- { \
- fprintf ((FILE), "%s0x%lx\n", UNALIGNED_INT_ASM_OP, (LOW_VALUE)); \
- fprintf ((FILE), "%s0x%lx", UNALIGNED_INT_ASM_OP, (HIGH_VALUE)); \
- } \
- } while (0)
-#endif
-
-#else /* UNALIGNED_INT_ASM_OP */
-
-/* We don't have unaligned support, let's hope the normal output works for
- .debug_frame. But we know it won't work for .debug_info. */
-
-#ifdef DWARF2_DEBUGGING_INFO
- #error DWARF2_DEBUGGING_INFO requires UNALIGNED_INT_ASM_OP.
-#endif
-
-#ifndef ASM_OUTPUT_DWARF_ADDR
-#define ASM_OUTPUT_DWARF_ADDR(FILE,LABEL) \
- assemble_integer (gen_rtx_SYMBOL_REF (Pmode, LABEL), DWARF2_ADDR_SIZE, 1)
-#endif
-
-#ifndef ASM_OUTPUT_DWARF_ADDR_CONST
-#define ASM_OUTPUT_DWARF_ADDR_CONST(FILE,RTX) ASM_OUTPUT_DWARF_ADDR (FILE,RTX)
-#endif
-
-#ifndef ASM_OUTPUT_DWARF_OFFSET4
-#define ASM_OUTPUT_DWARF_OFFSET4(FILE,LABEL) \
- assemble_integer (gen_rtx_SYMBOL_REF (SImode, LABEL), 4, 1)
-#endif
-
-#ifndef ASM_OUTPUT_DWARF_OFFSET
-#define ASM_OUTPUT_DWARF_OFFSET(FILE,LABEL) \
- assemble_integer (gen_rtx_SYMBOL_REF (SImode, LABEL), 4, 1)
-#endif
-
-#ifndef ASM_OUTPUT_DWARF_DELTA2
-#define ASM_OUTPUT_DWARF_DELTA2(FILE,LABEL1,LABEL2) \
- assemble_integer (gen_rtx_MINUS (HImode, \
- gen_rtx_SYMBOL_REF (Pmode, LABEL1), \
- gen_rtx_SYMBOL_REF (Pmode, LABEL2)), \
- 2, 1)
-#endif
-
-#ifndef ASM_OUTPUT_DWARF_DELTA4
-#define ASM_OUTPUT_DWARF_DELTA4(FILE,LABEL1,LABEL2) \
- assemble_integer (gen_rtx_MINUS (SImode, \
- gen_rtx_SYMBOL_REF (Pmode, LABEL1), \
- gen_rtx_SYMBOL_REF (Pmode, LABEL2)), \
- 4, 1)
-#endif
-
-#ifndef ASM_OUTPUT_DWARF_ADDR_DELTA
-#define ASM_OUTPUT_DWARF_ADDR_DELTA(FILE,LABEL1,LABEL2) \
- assemble_integer (gen_rtx_MINUS (Pmode, \
- gen_rtx_SYMBOL_REF (Pmode, LABEL1), \
- gen_rtx_SYMBOL_REF (Pmode, LABEL2)), \
- DWARF2_ADDR_SIZE, 1)
-#endif
-
-#ifndef ASM_OUTPUT_DWARF_DELTA
-#define ASM_OUTPUT_DWARF_DELTA(FILE,LABEL1,LABEL2) \
- ASM_OUTPUT_DWARF_DELTA4 (FILE,LABEL1,LABEL2)
-#endif
-
-#ifndef ASM_OUTPUT_DWARF_DATA2
-#define ASM_OUTPUT_DWARF_DATA2(FILE,VALUE) \
- assemble_integer (GEN_INT (VALUE), 2, 1)
-#endif
-
-#ifndef ASM_OUTPUT_DWARF_DATA4
-#define ASM_OUTPUT_DWARF_DATA4(FILE,VALUE) \
- assemble_integer (GEN_INT (VALUE), 4, 1)
-#endif
-
-#endif /* UNALIGNED_INT_ASM_OP */
-
#ifdef SET_ASM_OP
#ifndef ASM_OUTPUT_DEFINE_LABEL_DIFFERENCE_SYMBOL
#define ASM_OUTPUT_DEFINE_LABEL_DIFFERENCE_SYMBOL(FILE, SY, HI, LO) \
@@ -543,35 +330,6 @@ static void def_cfa_1 PARAMS ((const char *, dw_cfa_location *));
#endif
#endif /* SET_ASM_OP */
-/* This is similar to the default ASM_OUTPUT_ASCII, except that no trailing
- newline is produced. When flag_debug_asm is asserted, we add commentary
- at the end of the line, so we must avoid output of a newline here. */
-#ifndef ASM_OUTPUT_DWARF_NSTRING
-#define ASM_OUTPUT_DWARF_NSTRING(FILE,P,SLEN) \
- do { \
- register int slen = (SLEN); \
- register const char *p = (P); \
- register int i; \
- fprintf (FILE, "\t.ascii \""); \
- for (i = 0; i < slen; i++) \
- { \
- register int c = p[i]; \
- if (c == '\"' || c == '\\') \
- putc ('\\', FILE); \
- if (ISPRINT(c)) \
- putc (c, FILE); \
- else \
- { \
- fprintf (FILE, "\\%o", c); \
- } \
- } \
- fprintf (FILE, "\\0\""); \
- } \
- while (0)
-#endif
-#define ASM_OUTPUT_DWARF_STRING(FILE,P) \
- ASM_OUTPUT_DWARF_NSTRING (FILE, P, strlen (P))
-
/* The DWARF 2 CFA column which tracks the return address. Normally this
is the column for PC, or the first column after all of the hard
registers. */
@@ -843,11 +601,11 @@ lookup_cfa (loc)
}
/* The current rule for calculating the DWARF2 canonical frame address. */
-dw_cfa_location cfa;
+static dw_cfa_location cfa;
/* The register used for saving registers to the stack, and its offset
from the CFA. */
-dw_cfa_location cfa_store;
+static dw_cfa_location cfa_store;
/* The running total of the size of arguments pushed onto the stack. */
static long args_size;
@@ -1197,7 +955,7 @@ dwarf2out_stack_adjust (insn)
long offset;
const char *label;
- if (! asynchronous_exceptions && GET_CODE (insn) == CALL_INSN)
+ if (! flag_non_call_exceptions && GET_CODE (insn) == CALL_INSN)
{
/* Extract the size of the args from the CALL rtx itself. */
@@ -1214,7 +972,7 @@ dwarf2out_stack_adjust (insn)
/* If only calls can throw, and we have a frame pointer,
save up adjustments until we see the CALL_INSN. */
- else if (! asynchronous_exceptions
+ else if (! flag_non_call_exceptions
&& cfa.reg != STACK_POINTER_REGNUM)
return;
@@ -1269,10 +1027,70 @@ dwarf2out_stack_adjust (insn)
dwarf2out_args_size (label, args_size);
}
+/* We delay emitting a register save until either (a) we reach the end
+ of the prologue or (b) the register is clobbered. This clusters
+ register saves so that there are fewer pc advances. */
+
+struct queued_reg_save
+{
+ struct queued_reg_save *next;
+ rtx reg;
+ long cfa_offset;
+};
+
+static struct queued_reg_save *queued_reg_saves;
+static const char *last_reg_save_label;
+
+static void
+queue_reg_save (label, reg, offset)
+ const char *label;
+ rtx reg;
+ long offset;
+{
+ struct queued_reg_save *q = (struct queued_reg_save *) xmalloc (sizeof (*q));
+
+ q->next = queued_reg_saves;
+ q->reg = reg;
+ q->cfa_offset = offset;
+ queued_reg_saves = q;
+
+ last_reg_save_label = label;
+}
+
+static void
+flush_queued_reg_saves ()
+{
+ struct queued_reg_save *q, *next;
+
+ for (q = queued_reg_saves; q ; q = next)
+ {
+ dwarf2out_reg_save (last_reg_save_label, REGNO (q->reg), q->cfa_offset);
+ next = q->next;
+ free (q);
+ }
+
+ queued_reg_saves = NULL;
+ last_reg_save_label = NULL;
+}
+
+static bool
+clobbers_queued_reg_save (insn)
+ rtx insn;
+{
+ struct queued_reg_save *q;
+
+ for (q = queued_reg_saves; q ; q = q->next)
+ if (modified_in_p (q->reg, insn))
+ return true;
+
+ return false;
+}
+
+
/* A temporary register holding an integral value used in adjusting SP
or setting up the store_reg. The "offset" field holds the integer
value, not an offset. */
-dw_cfa_location cfa_temp;
+static dw_cfa_location cfa_temp;
/* Record call frame debugging information for an expression EXPR,
which either sets SP or FP (adjusting how we calculate the frame
@@ -1316,11 +1134,13 @@ dw_cfa_location cfa_temp;
cfa_store.reg to the actual CFA
cfa_temp register holding an integral value. cfa_temp.offset
stores the value, which will be used to adjust the
- stack pointer.
+ stack pointer. cfa_temp is also used like cfa_store,
+ to track stores to the stack via fp or a temp reg.
Rules 1- 4: Setting a register's value to cfa.reg or an expression
with cfa.reg as the first operand changes the cfa.reg and its
- cfa.offset.
+ cfa.offset. Rule 1 and 4 also set cfa_temp.reg and
+ cfa_temp.offset.
Rules 6- 9: Set a non-cfa.reg register value to a constant or an
expression yielding a constant. This sets cfa_temp.reg
@@ -1329,9 +1149,9 @@ dw_cfa_location cfa_temp;
Rule 5: Create a new register cfa_store used to save items to the
stack.
- Rules 10-13: Save a register to the stack. Define offset as the
+ Rules 10-14: Save a register to the stack. Define offset as the
difference of the original location and cfa_store's
- location.
+ location (or cfa_temp's location if cfa_temp is used).
The Rules
@@ -1340,26 +1160,30 @@ dw_cfa_location cfa_temp;
Rule 1:
(set <reg1> <reg2>:cfa.reg)
- effects: cfa.reg = <REG1>
+ effects: cfa.reg = <reg1>
cfa.offset unchanged
+ cfa_temp.reg = <reg1>
+ cfa_temp.offset = cfa.offset
Rule 2:
- (set sp ({minus,plus} {sp,fp}:cfa.reg {<const_int>,<reg>:cfa_temp.reg}))
+ (set sp ({minus,plus,losum} {sp,fp}:cfa.reg {<const_int>,<reg>:cfa_temp.reg}))
effects: cfa.reg = sp if fp used
cfa.offset += {+/- <const_int>, cfa_temp.offset} if cfa.reg==sp
cfa_store.offset += {+/- <const_int>, cfa_temp.offset}
if cfa_store.reg==sp
Rule 3:
- (set fp ({minus,plus} <reg>:cfa.reg <const_int>))
+ (set fp ({minus,plus,losum} <reg>:cfa.reg <const_int>))
effects: cfa.reg = fp
cfa_offset += +/- <const_int>
Rule 4:
- (set <reg1> (plus <reg2>:cfa.reg <const_int>))
+ (set <reg1> ({plus,losum} <reg2>:cfa.reg <const_int>))
constraints: <reg1> != fp
<reg1> != sp
effects: cfa.reg = <reg1>
+ cfa_temp.reg = <reg1>
+ cfa_temp.offset = cfa.offset
Rule 5:
(set <reg1> (plus <reg2>:cfa_temp.reg sp:cfa.reg))
@@ -1391,30 +1215,31 @@ dw_cfa_location cfa_temp;
(set (mem (pre_modify sp:cfa_store (???? <reg1> <const_int>))) <reg2>)
effects: cfa_store.offset -= <const_int>
cfa.offset = cfa_store.offset if cfa.reg == sp
- offset = -cfa_store.offset
cfa.reg = sp
- cfa.base_offset = offset
+ cfa.base_offset = -cfa_store.offset
Rule 11:
(set (mem ({pre_inc,pre_dec} sp:cfa_store.reg)) <reg>)
effects: cfa_store.offset += -/+ mode_size(mem)
cfa.offset = cfa_store.offset if cfa.reg == sp
- offset = -cfa_store.offset
cfa.reg = sp
- cfa.base_offset = offset
+ cfa.base_offset = -cfa_store.offset
Rule 12:
- (set (mem ({minus,plus} <reg1>:cfa_store <const_int>)) <reg2>)
- effects: cfa_store.offset += -/+ <const_int>
- offset = -cfa_store.offset
- cfa.reg = <reg1
- cfa.base_offset = offset
+ (set (mem ({minus,plus,losum} <reg1>:{cfa_store,cfa_temp} <const_int>)) <reg2>)
+ effects: cfa.reg = <reg1>
+ cfa.base_offset = -/+ <const_int> - {cfa_store,cfa_temp}.offset
Rule 13:
- (set (mem <reg1>:cfa_store) <reg2>)
- effects: offset = -cfa_store.offset
- cfa.reg = <reg1>
- cfa.base_offset = offset */
+ (set (mem <reg1>:{cfa_store,cfa_temp}) <reg2>)
+ effects: cfa.reg = <reg1>
+ cfa.base_offset = -{cfa_store,cfa_temp}.offset
+
+ Rule 14:
+ (set (mem (postinc <reg1>:cfa_temp <const_int>)) <reg2>)
+ effects: cfa.reg = <reg1>
+ cfa.base_offset = -cfa_temp.offset
+ cfa_temp.offset -= mode_size(mem) */
static void
dwarf2out_frame_debug_expr (expr, label)
@@ -1474,10 +1299,13 @@ dwarf2out_frame_debug_expr (expr, label)
FP. So we just rely on the backends to only set
RTX_FRAME_RELATED_P on appropriate insns. */
cfa.reg = REGNO (dest);
+ cfa_temp.reg = cfa.reg;
+ cfa_temp.offset = cfa.offset;
break;
case PLUS:
case MINUS:
+ case LO_SUM:
if (dest == stack_pointer_rtx)
{
/* Rule 2 */
@@ -1503,10 +1331,13 @@ dwarf2out_frame_debug_expr (expr, label)
abort ();
cfa.reg = STACK_POINTER_REGNUM;
}
+ else if (GET_CODE (src) == LO_SUM)
+ /* Assume we've set the source reg of the LO_SUM from sp. */
+ ;
else if (XEXP (src, 0) != stack_pointer_rtx)
abort ();
- if (GET_CODE (src) == PLUS)
+ if (GET_CODE (src) != MINUS)
offset = -offset;
if (cfa.reg == STACK_POINTER_REGNUM)
cfa.offset += offset;
@@ -1526,7 +1357,7 @@ dwarf2out_frame_debug_expr (expr, label)
&& GET_CODE (XEXP (src, 1)) == CONST_INT)
{
offset = INTVAL (XEXP (src, 1));
- if (GET_CODE (src) == PLUS)
+ if (GET_CODE (src) != MINUS)
offset = -offset;
cfa.offset += offset;
cfa.reg = HARD_FRAME_POINTER_REGNUM;
@@ -1536,7 +1367,7 @@ dwarf2out_frame_debug_expr (expr, label)
}
else
{
- if (GET_CODE (src) != PLUS)
+ if (GET_CODE (src) == MINUS)
abort ();
/* Rule 4 */
@@ -1546,27 +1377,34 @@ dwarf2out_frame_debug_expr (expr, label)
{
/* Setting a temporary CFA register that will be copied
into the FP later on. */
- offset = INTVAL (XEXP (src, 1));
- if (GET_CODE (src) == PLUS)
- offset = -offset;
+ offset = - INTVAL (XEXP (src, 1));
cfa.offset += offset;
cfa.reg = REGNO (dest);
+ /* Or used to save regs to the stack. */
+ cfa_temp.reg = cfa.reg;
+ cfa_temp.offset = cfa.offset;
}
/* Rule 5 */
- else
+ else if (GET_CODE (XEXP (src, 0)) == REG
+ && REGNO (XEXP (src, 0)) == cfa_temp.reg
+ && XEXP (src, 1) == stack_pointer_rtx)
{
/* Setting a scratch register that we will use instead
of SP for saving registers to the stack. */
- if (XEXP (src, 1) != stack_pointer_rtx)
- abort ();
- if (GET_CODE (XEXP (src, 0)) != REG
- || (unsigned) REGNO (XEXP (src, 0)) != cfa_temp.reg)
- abort ();
if (cfa.reg != STACK_POINTER_REGNUM)
abort ();
cfa_store.reg = REGNO (dest);
cfa_store.offset = cfa.offset - cfa_temp.offset;
}
+ /* Rule 9 */
+ else if (GET_CODE (src) == LO_SUM
+ && GET_CODE (XEXP (src, 1)) == CONST_INT)
+ {
+ cfa_temp.reg = REGNO (dest);
+ cfa_temp.offset = INTVAL (XEXP (src, 1));
+ }
+ else
+ abort ();
}
break;
@@ -1587,26 +1425,18 @@ dwarf2out_frame_debug_expr (expr, label)
cfa_temp.offset |= INTVAL (XEXP (src, 1));
break;
+ /* Skip over HIGH, assuming it will be followed by a LO_SUM,
+ which will fill in all of the bits. */
+ /* Rule 8 */
+ case HIGH:
+ break;
+
default:
abort ();
}
def_cfa_1 (label, &cfa);
break;
- /* Skip over HIGH, assuming it will be followed by a LO_SUM, which
- will fill in all of the bits. */
- /* Rule 8 */
- case HIGH:
- break;
-
- /* Rule 9 */
- case LO_SUM:
- if (GET_CODE (XEXP (src, 1)) != CONST_INT)
- abort ();
- cfa_temp.reg = REGNO (dest);
- cfa_temp.offset = INTVAL (XEXP (src, 1));
- break;
-
case MEM:
if (GET_CODE (src) != REG)
abort ();
@@ -1653,23 +1483,38 @@ dwarf2out_frame_debug_expr (expr, label)
/* With an offset. */
case PLUS:
case MINUS:
+ case LO_SUM:
if (GET_CODE (XEXP (XEXP (dest, 0), 1)) != CONST_INT)
abort ();
offset = INTVAL (XEXP (XEXP (dest, 0), 1));
if (GET_CODE (XEXP (dest, 0)) == MINUS)
offset = -offset;
- if (cfa_store.reg != (unsigned) REGNO (XEXP (XEXP (dest, 0), 0)))
+ if (cfa_store.reg == (unsigned) REGNO (XEXP (XEXP (dest, 0), 0)))
+ offset -= cfa_store.offset;
+ else if (cfa_temp.reg == (unsigned) REGNO (XEXP (XEXP (dest, 0), 0)))
+ offset -= cfa_temp.offset;
+ else
abort ();
- offset -= cfa_store.offset;
break;
/* Rule 13 */
/* Without an offset. */
case REG:
- if (cfa_store.reg != (unsigned) REGNO (XEXP (dest, 0)))
+ if (cfa_store.reg == (unsigned) REGNO (XEXP (dest, 0)))
+ offset = -cfa_store.offset;
+ else if (cfa_temp.reg == (unsigned) REGNO (XEXP (dest, 0)))
+ offset = -cfa_temp.offset;
+ else
abort ();
- offset = -cfa_store.offset;
+ break;
+
+ /* Rule 14 */
+ case POST_INC:
+ if (cfa_temp.reg != (unsigned) REGNO (XEXP (XEXP (dest, 0), 0)))
+ abort ();
+ offset = -cfa_temp.offset;
+ cfa_temp.offset -= GET_MODE_SIZE (GET_MODE (dest));
break;
default:
@@ -1689,7 +1534,7 @@ dwarf2out_frame_debug_expr (expr, label)
on the ARM. */
def_cfa_1 (label, &cfa);
- dwarf2out_reg_save (label, STACK_POINTER_REGNUM, offset);
+ queue_reg_save (label, stack_pointer_rtx, offset);
break;
}
else
@@ -1711,7 +1556,7 @@ dwarf2out_frame_debug_expr (expr, label)
}
def_cfa_1 (label, &cfa);
- dwarf2out_reg_save (label, REGNO (src), offset);
+ queue_reg_save (label, src, offset);
break;
default:
@@ -1732,6 +1577,9 @@ dwarf2out_frame_debug (insn)
if (insn == NULL_RTX)
{
+ /* Flush any queued register saves. */
+ flush_queued_reg_saves ();
+
/* Set up state for generating call frame debug info. */
lookup_cfa (&cfa);
if (cfa.reg != (unsigned long) DWARF_FRAME_REGNUM (STACK_POINTER_REGNUM))
@@ -1743,9 +1591,13 @@ dwarf2out_frame_debug (insn)
return;
}
+ if (GET_CODE (insn) != INSN || clobbers_queued_reg_save (insn))
+ flush_queued_reg_saves ();
+
if (! RTX_FRAME_RELATED_P (insn))
{
- dwarf2out_stack_adjust (insn);
+ if (!ACCUMULATE_OUTGOING_ARGS)
+ dwarf2out_stack_adjust (insn);
return;
}
@@ -1760,222 +1612,95 @@ dwarf2out_frame_debug (insn)
dwarf2out_frame_debug_expr (insn, label);
}
-/* Return the size of an unsigned LEB128 quantity. */
-
-static inline unsigned long
-size_of_uleb128 (value)
- register unsigned long value;
-{
- register unsigned long size = 0;
- register unsigned byte;
-
- do
- {
- byte = (value & 0x7f);
- value >>= 7;
- size += 1;
- }
- while (value != 0);
-
- return size;
-}
-
-/* Return the size of a signed LEB128 quantity. */
-
-static inline unsigned long
-size_of_sleb128 (value)
- register long value;
-{
- register unsigned long size = 0;
- register unsigned byte;
-
- do
- {
- byte = (value & 0x7f);
- value >>= 7;
- size += 1;
- }
- while (!(((value == 0) && ((byte & 0x40) == 0))
- || ((value == -1) && ((byte & 0x40) != 0))));
-
- return size;
-}
-
-/* Output an unsigned LEB128 quantity. */
-
-static void
-output_uleb128 (value)
- register unsigned long value;
-{
- unsigned long save_value = value;
-
- fprintf (asm_out_file, "%s", ASM_BYTE_OP);
- do
- {
- register unsigned byte = (value & 0x7f);
- value >>= 7;
- if (value != 0)
- /* More bytes to follow. */
- byte |= 0x80;
-
- fprintf (asm_out_file, "0x%x", byte);
- if (value != 0)
- fprintf (asm_out_file, ",");
- }
- while (value != 0);
-
- if (flag_debug_asm)
- fprintf (asm_out_file, "\t%s ULEB128 0x%lx", ASM_COMMENT_START, save_value);
-}
-
-/* Output an signed LEB128 quantity. */
-
-static void
-output_sleb128 (value)
- register long value;
-{
- register int more;
- register unsigned byte;
- long save_value = value;
-
- fprintf (asm_out_file, "%s", ASM_BYTE_OP);
- do
- {
- byte = (value & 0x7f);
- /* arithmetic shift */
- value >>= 7;
- more = !((((value == 0) && ((byte & 0x40) == 0))
- || ((value == -1) && ((byte & 0x40) != 0))));
- if (more)
- byte |= 0x80;
-
- fprintf (asm_out_file, "0x%x", byte);
- if (more)
- fprintf (asm_out_file, ",");
- }
-
- while (more);
- if (flag_debug_asm)
- fprintf (asm_out_file, "\t%s SLEB128 %ld", ASM_COMMENT_START, save_value);
-}
-
/* Output a Call Frame Information opcode and its operand(s). */
static void
-output_cfi (cfi, fde)
+output_cfi (cfi, fde, for_eh)
register dw_cfi_ref cfi;
register dw_fde_ref fde;
+ int for_eh;
{
if (cfi->dw_cfi_opc == DW_CFA_advance_loc)
{
- ASM_OUTPUT_DWARF_DATA1 (asm_out_file,
- cfi->dw_cfi_opc
- | (cfi->dw_cfi_oprnd1.dw_cfi_offset & 0x3f));
- if (flag_debug_asm)
- fprintf (asm_out_file, "\t%s DW_CFA_advance_loc 0x%lx",
- ASM_COMMENT_START, cfi->dw_cfi_oprnd1.dw_cfi_offset);
- fputc ('\n', asm_out_file);
+ dw2_asm_output_data (1, (cfi->dw_cfi_opc
+ | (cfi->dw_cfi_oprnd1.dw_cfi_offset & 0x3f)),
+ "DW_CFA_advance_loc 0x%lx",
+ cfi->dw_cfi_oprnd1.dw_cfi_offset);
}
-
else if (cfi->dw_cfi_opc == DW_CFA_offset)
{
- ASM_OUTPUT_DWARF_DATA1 (asm_out_file,
- cfi->dw_cfi_opc
- | (cfi->dw_cfi_oprnd1.dw_cfi_reg_num & 0x3f));
- if (flag_debug_asm)
- fprintf (asm_out_file, "\t%s DW_CFA_offset, column 0x%lx",
- ASM_COMMENT_START, cfi->dw_cfi_oprnd1.dw_cfi_reg_num);
-
- fputc ('\n', asm_out_file);
- output_uleb128 (cfi->dw_cfi_oprnd2.dw_cfi_offset);
- fputc ('\n', asm_out_file);
+ dw2_asm_output_data (1, (cfi->dw_cfi_opc
+ | (cfi->dw_cfi_oprnd1.dw_cfi_reg_num & 0x3f)),
+ "DW_CFA_offset, column 0x%lx",
+ cfi->dw_cfi_oprnd1.dw_cfi_reg_num);
+ dw2_asm_output_data_uleb128 (cfi->dw_cfi_oprnd2.dw_cfi_offset, NULL);
}
else if (cfi->dw_cfi_opc == DW_CFA_restore)
{
- ASM_OUTPUT_DWARF_DATA1 (asm_out_file,
- cfi->dw_cfi_opc
- | (cfi->dw_cfi_oprnd1.dw_cfi_reg_num & 0x3f));
- if (flag_debug_asm)
- fprintf (asm_out_file, "\t%s DW_CFA_restore, column 0x%lx",
- ASM_COMMENT_START, cfi->dw_cfi_oprnd1.dw_cfi_reg_num);
-
- fputc ('\n', asm_out_file);
+ dw2_asm_output_data (1, (cfi->dw_cfi_opc
+ | (cfi->dw_cfi_oprnd1.dw_cfi_reg_num & 0x3f)),
+ "DW_CFA_restore, column 0x%lx",
+ cfi->dw_cfi_oprnd1.dw_cfi_reg_num);
}
else
{
- ASM_OUTPUT_DWARF_DATA1 (asm_out_file, cfi->dw_cfi_opc);
- if (flag_debug_asm)
- fprintf (asm_out_file, "\t%s %s", ASM_COMMENT_START,
- dwarf_cfi_name (cfi->dw_cfi_opc));
+ dw2_asm_output_data (1, cfi->dw_cfi_opc,
+ "%s", dwarf_cfi_name (cfi->dw_cfi_opc));
- fputc ('\n', asm_out_file);
switch (cfi->dw_cfi_opc)
{
case DW_CFA_set_loc:
- ASM_OUTPUT_DWARF_ADDR (asm_out_file, cfi->dw_cfi_oprnd1.dw_cfi_addr);
- fputc ('\n', asm_out_file);
+ if (for_eh)
+ dw2_asm_output_encoded_addr_rtx (
+ ASM_PREFERRED_EH_DATA_FORMAT (/*code=*/1, /*global=*/0),
+ gen_rtx_SYMBOL_REF (Pmode, cfi->dw_cfi_oprnd1.dw_cfi_addr),
+ NULL);
+ else
+ dw2_asm_output_addr (DWARF2_ADDR_SIZE,
+ cfi->dw_cfi_oprnd1.dw_cfi_addr, NULL);
break;
case DW_CFA_advance_loc1:
- ASM_OUTPUT_DWARF_DELTA1 (asm_out_file,
- cfi->dw_cfi_oprnd1.dw_cfi_addr,
- fde->dw_fde_current_label);
- fputc ('\n', asm_out_file);
+ dw2_asm_output_delta (1, cfi->dw_cfi_oprnd1.dw_cfi_addr,
+ fde->dw_fde_current_label, NULL);
fde->dw_fde_current_label = cfi->dw_cfi_oprnd1.dw_cfi_addr;
break;
case DW_CFA_advance_loc2:
- ASM_OUTPUT_DWARF_DELTA2 (asm_out_file,
- cfi->dw_cfi_oprnd1.dw_cfi_addr,
- fde->dw_fde_current_label);
- fputc ('\n', asm_out_file);
+ dw2_asm_output_delta (2, cfi->dw_cfi_oprnd1.dw_cfi_addr,
+ fde->dw_fde_current_label, NULL);
fde->dw_fde_current_label = cfi->dw_cfi_oprnd1.dw_cfi_addr;
break;
case DW_CFA_advance_loc4:
- ASM_OUTPUT_DWARF_DELTA4 (asm_out_file,
- cfi->dw_cfi_oprnd1.dw_cfi_addr,
- fde->dw_fde_current_label);
- fputc ('\n', asm_out_file);
+ dw2_asm_output_delta (4, cfi->dw_cfi_oprnd1.dw_cfi_addr,
+ fde->dw_fde_current_label, NULL);
fde->dw_fde_current_label = cfi->dw_cfi_oprnd1.dw_cfi_addr;
break;
-#ifdef MIPS_DEBUGGING_INFO
case DW_CFA_MIPS_advance_loc8:
- /* TODO: not currently implemented. */
- abort ();
+ dw2_asm_output_delta (8, cfi->dw_cfi_oprnd1.dw_cfi_addr,
+ fde->dw_fde_current_label, NULL);
+ fde->dw_fde_current_label = cfi->dw_cfi_oprnd1.dw_cfi_addr;
break;
-#endif
case DW_CFA_offset_extended:
case DW_CFA_GNU_negative_offset_extended:
case DW_CFA_def_cfa:
- output_uleb128 (cfi->dw_cfi_oprnd1.dw_cfi_reg_num);
- fputc ('\n', asm_out_file);
- output_uleb128 (cfi->dw_cfi_oprnd2.dw_cfi_offset);
- fputc ('\n', asm_out_file);
+ dw2_asm_output_data_uleb128 (cfi->dw_cfi_oprnd1.dw_cfi_reg_num, NULL);
+ dw2_asm_output_data_uleb128 (cfi->dw_cfi_oprnd2.dw_cfi_offset, NULL);
break;
case DW_CFA_restore_extended:
case DW_CFA_undefined:
- output_uleb128 (cfi->dw_cfi_oprnd1.dw_cfi_reg_num);
- fputc ('\n', asm_out_file);
- break;
case DW_CFA_same_value:
case DW_CFA_def_cfa_register:
- output_uleb128 (cfi->dw_cfi_oprnd1.dw_cfi_reg_num);
- fputc ('\n', asm_out_file);
+ dw2_asm_output_data_uleb128 (cfi->dw_cfi_oprnd1.dw_cfi_reg_num, NULL);
break;
case DW_CFA_register:
- output_uleb128 (cfi->dw_cfi_oprnd1.dw_cfi_reg_num);
- fputc ('\n', asm_out_file);
- output_uleb128 (cfi->dw_cfi_oprnd2.dw_cfi_reg_num);
- fputc ('\n', asm_out_file);
+ dw2_asm_output_data_uleb128 (cfi->dw_cfi_oprnd1.dw_cfi_reg_num, NULL);
+ dw2_asm_output_data_uleb128 (cfi->dw_cfi_oprnd2.dw_cfi_reg_num, NULL);
break;
case DW_CFA_def_cfa_offset:
- output_uleb128 (cfi->dw_cfi_oprnd1.dw_cfi_offset);
- fputc ('\n', asm_out_file);
+ case DW_CFA_GNU_args_size:
+ dw2_asm_output_data_uleb128 (cfi->dw_cfi_oprnd1.dw_cfi_offset, NULL);
break;
case DW_CFA_GNU_window_save:
break;
- case DW_CFA_GNU_args_size:
- output_uleb128 (cfi->dw_cfi_oprnd1.dw_cfi_offset);
- fputc ('\n', asm_out_file);
- break;
case DW_CFA_def_cfa_expression:
output_cfa_loc (cfi);
break;
@@ -1996,26 +1721,28 @@ output_call_frame_info (for_eh)
register unsigned long i;
register dw_fde_ref fde;
register dw_cfi_ref cfi;
- char l1[20], l2[20];
-#ifdef ASM_OUTPUT_DEFINE_LABEL_DIFFERENCE_SYMBOL
- char ld[20];
-#endif
-
- /* Do we want to include a pointer to the exception table? */
- int eh_ptr = for_eh && exception_table_p ();
+ char l1[20], l2[20], section_start_label[20];
+ int any_lsda_needed = 0;
+ char augmentation[6];
+ int augmentation_size;
+ int fde_encoding = DW_EH_PE_absptr;
+ int per_encoding = DW_EH_PE_absptr;
+ int lsda_encoding = DW_EH_PE_absptr;
/* If we don't have any functions we'll want to unwind out of, don't
emit any EH unwind information. */
if (for_eh)
{
+ int any_eh_needed = 0;
for (i = 0; i < fde_table_in_use; ++i)
- if (! fde_table[i].nothrow)
- goto found;
- return;
- found:;
- }
+ if (fde_table[i].uses_eh_lsda)
+ any_eh_needed = any_lsda_needed = 1;
+ else if (! fde_table[i].nothrow)
+ any_eh_needed = 1;
- fputc ('\n', asm_out_file);
+ if (! any_eh_needed)
+ return;
+ }
/* We're going to be generating comments, so turn on app. */
if (flag_debug_asm)
@@ -2029,198 +1756,227 @@ output_call_frame_info (for_eh)
tree label = get_file_function_name ('F');
force_data_section ();
- ASM_OUTPUT_ALIGN (asm_out_file, floor_log2 (DWARF2_ADDR_SIZE));
+ ASM_OUTPUT_ALIGN (asm_out_file, floor_log2 (PTR_SIZE));
ASM_GLOBALIZE_LABEL (asm_out_file, IDENTIFIER_POINTER (label));
ASM_OUTPUT_LABEL (asm_out_file, IDENTIFIER_POINTER (label));
#endif
- assemble_label ("__FRAME_BEGIN__");
}
else
ASM_OUTPUT_SECTION (asm_out_file, FRAME_SECTION);
+ ASM_GENERATE_INTERNAL_LABEL (section_start_label, FRAME_BEGIN_LABEL, for_eh);
+ ASM_OUTPUT_LABEL (asm_out_file, section_start_label);
+
/* Output the CIE. */
ASM_GENERATE_INTERNAL_LABEL (l1, CIE_AFTER_SIZE_LABEL, for_eh);
ASM_GENERATE_INTERNAL_LABEL (l2, CIE_END_LABEL, for_eh);
-#ifdef ASM_OUTPUT_DEFINE_LABEL_DIFFERENCE_SYMBOL
- ASM_GENERATE_INTERNAL_LABEL (ld, CIE_LENGTH_LABEL, for_eh);
- if (for_eh)
- ASM_OUTPUT_DWARF_OFFSET4 (asm_out_file, ld);
- else
- ASM_OUTPUT_DWARF_OFFSET (asm_out_file, ld);
-#else
- if (for_eh)
- ASM_OUTPUT_DWARF_DELTA4 (asm_out_file, l2, l1);
- else
- ASM_OUTPUT_DWARF_DELTA (asm_out_file, l2, l1);
-#endif
- if (flag_debug_asm)
- fprintf (asm_out_file, "\t%s Length of Common Information Entry",
- ASM_COMMENT_START);
-
- fputc ('\n', asm_out_file);
+ dw2_asm_output_delta (for_eh ? 4 : DWARF_OFFSET_SIZE, l2, l1,
+ "Length of Common Information Entry");
ASM_OUTPUT_LABEL (asm_out_file, l1);
- if (for_eh)
- /* Now that the CIE pointer is PC-relative for EH,
- use 0 to identify the CIE. */
- ASM_OUTPUT_DWARF_DATA4 (asm_out_file, 0);
- else
- ASM_OUTPUT_DWARF_DATA4 (asm_out_file, DW_CIE_ID);
+ /* Now that the CIE pointer is PC-relative for EH,
+ use 0 to identify the CIE. */
+ dw2_asm_output_data ((for_eh ? 4 : DWARF_OFFSET_SIZE),
+ (for_eh ? 0 : DW_CIE_ID),
+ "CIE Identifier Tag");
- if (flag_debug_asm)
- fprintf (asm_out_file, "\t%s CIE Identifier Tag", ASM_COMMENT_START);
+ dw2_asm_output_data (1, DW_CIE_VERSION, "CIE Version");
- fputc ('\n', asm_out_file);
- if (! for_eh && DWARF_OFFSET_SIZE == 8)
+ augmentation[0] = 0;
+ augmentation_size = 0;
+ if (for_eh)
{
- ASM_OUTPUT_DWARF_DATA4 (asm_out_file, DW_CIE_ID);
- fputc ('\n', asm_out_file);
- }
+ char *p;
- ASM_OUTPUT_DWARF_DATA1 (asm_out_file, DW_CIE_VERSION);
- if (flag_debug_asm)
- fprintf (asm_out_file, "\t%s CIE Version", ASM_COMMENT_START);
+ /* Augmentation:
+ z Indicates that a uleb128 is present to size the
+ augmentation section.
+ L Indicates the encoding (and thus presence) of
+ an LSDA pointer in the FDE augmentation.
+ R Indicates a non-default pointer encoding for
+ FDE code pointers.
+ P Indicates the presence of an encoding + language
+ personality routine in the CIE augmentation. */
- fputc ('\n', asm_out_file);
- if (eh_ptr)
- {
- /* The CIE contains a pointer to the exception region info for the
- frame. Make the augmentation string three bytes (including the
- trailing null) so the pointer is 4-byte aligned. The Solaris ld
- can't handle unaligned relocs. */
- if (flag_debug_asm)
+ fde_encoding = ASM_PREFERRED_EH_DATA_FORMAT (/*code=*/1, /*global=*/0);
+ per_encoding = ASM_PREFERRED_EH_DATA_FORMAT (/*code=*/2, /*global=*/1);
+ lsda_encoding = ASM_PREFERRED_EH_DATA_FORMAT (/*code=*/0, /*global=*/0);
+
+ p = augmentation + 1;
+ if (eh_personality_libfunc)
{
- ASM_OUTPUT_DWARF_STRING (asm_out_file, "eh");
- fprintf (asm_out_file, "\t%s CIE Augmentation", ASM_COMMENT_START);
+ *p++ = 'P';
+ augmentation_size += 1 + size_of_encoded_value (per_encoding);
}
- else
+ if (any_lsda_needed)
+ {
+ *p++ = 'L';
+ augmentation_size += 1;
+ }
+ if (fde_encoding != DW_EH_PE_absptr)
+ {
+ *p++ = 'R';
+ augmentation_size += 1;
+ }
+ if (p > augmentation + 1)
{
- ASM_OUTPUT_ASCII (asm_out_file, "eh", 3);
+ augmentation[0] = 'z';
+ *p = '\0';
}
- fputc ('\n', asm_out_file);
- ASM_OUTPUT_DWARF_ADDR (asm_out_file, "__EXCEPTION_TABLE__");
- if (flag_debug_asm)
- fprintf (asm_out_file, "\t%s pointer to exception region info",
- ASM_COMMENT_START);
- }
- else
- {
- ASM_OUTPUT_DWARF_DATA1 (asm_out_file, 0);
- if (flag_debug_asm)
- fprintf (asm_out_file, "\t%s CIE Augmentation (none)",
- ASM_COMMENT_START);
+ /* Ug. Some platforms can't do unaligned dynamic relocations at all. */
+ if (eh_personality_libfunc && per_encoding == DW_EH_PE_aligned)
+ {
+ int offset = ( 4 /* Length */
+ + 4 /* CIE Id */
+ + 1 /* CIE version */
+ + strlen (augmentation) + 1 /* Augmentation */
+ + size_of_uleb128 (1) /* Code alignment */
+ + size_of_sleb128 (DWARF_CIE_DATA_ALIGNMENT)
+ + 1 /* RA column */
+ + 1 /* Augmentation size */
+ + 1 /* Personality encoding */ );
+ int pad = -offset & (PTR_SIZE - 1);
+
+ augmentation_size += pad;
+
+ /* Augmentations should be small, so there's scarce need to
+ iterate for a solution. Die if we exceed one uleb128 byte. */
+ if (size_of_uleb128 (augmentation_size) != 1)
+ abort ();
+ }
}
+ dw2_asm_output_nstring (augmentation, -1, "CIE Augmentation");
- fputc ('\n', asm_out_file);
- output_uleb128 (1);
- if (flag_debug_asm)
- fprintf (asm_out_file, " (CIE Code Alignment Factor)");
+ dw2_asm_output_data_uleb128 (1, "CIE Code Alignment Factor");
- fputc ('\n', asm_out_file);
- output_sleb128 (DWARF_CIE_DATA_ALIGNMENT);
- if (flag_debug_asm)
- fprintf (asm_out_file, " (CIE Data Alignment Factor)");
+ dw2_asm_output_data_sleb128 (DWARF_CIE_DATA_ALIGNMENT,
+ "CIE Data Alignment Factor");
- fputc ('\n', asm_out_file);
- ASM_OUTPUT_DWARF_DATA1 (asm_out_file, DWARF_FRAME_RETURN_COLUMN);
- if (flag_debug_asm)
- fprintf (asm_out_file, "\t%s CIE RA Column", ASM_COMMENT_START);
+ dw2_asm_output_data (1, DWARF_FRAME_RETURN_COLUMN, "CIE RA Column");
- fputc ('\n', asm_out_file);
+ if (augmentation[0])
+ {
+ dw2_asm_output_data_uleb128 (augmentation_size, "Augmentation size");
+ if (eh_personality_libfunc)
+ {
+ dw2_asm_output_data (1, per_encoding, "Personality (%s)",
+ eh_data_format_name (per_encoding));
+ dw2_asm_output_encoded_addr_rtx (per_encoding,
+ eh_personality_libfunc, NULL);
+ }
+ if (any_lsda_needed)
+ dw2_asm_output_data (1, lsda_encoding, "LSDA Encoding (%s)",
+ eh_data_format_name (lsda_encoding));
+ if (fde_encoding != DW_EH_PE_absptr)
+ dw2_asm_output_data (1, fde_encoding, "FDE Encoding (%s)",
+ eh_data_format_name (fde_encoding));
+ }
for (cfi = cie_cfi_head; cfi != NULL; cfi = cfi->dw_cfi_next)
- output_cfi (cfi, NULL);
+ output_cfi (cfi, NULL, for_eh);
/* Pad the CIE out to an address sized boundary. */
- ASM_OUTPUT_ALIGN (asm_out_file, floor_log2 (DWARF2_ADDR_SIZE));
+ ASM_OUTPUT_ALIGN (asm_out_file,
+ floor_log2 (for_eh ? PTR_SIZE : DWARF2_ADDR_SIZE));
ASM_OUTPUT_LABEL (asm_out_file, l2);
-#ifdef ASM_OUTPUT_DEFINE_LABEL_DIFFERENCE_SYMBOL
- ASM_OUTPUT_DEFINE_LABEL_DIFFERENCE_SYMBOL (asm_out_file, ld, l2, l1);
- if (flag_debug_asm)
- fprintf (asm_out_file, "\t%s CIE Length Symbol", ASM_COMMENT_START);
- fputc ('\n', asm_out_file);
-#endif
/* Loop through all of the FDE's. */
for (i = 0; i < fde_table_in_use; ++i)
{
fde = &fde_table[i];
- /* Don't emit EH unwind info for leaf functions. */
- if (for_eh && fde->nothrow)
+ /* Don't emit EH unwind info for leaf functions that don't need it. */
+ if (for_eh && fde->nothrow && ! fde->uses_eh_lsda)
continue;
+ ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, FDE_LABEL, for_eh + i * 2);
ASM_GENERATE_INTERNAL_LABEL (l1, FDE_AFTER_SIZE_LABEL, for_eh + i * 2);
ASM_GENERATE_INTERNAL_LABEL (l2, FDE_END_LABEL, for_eh + i * 2);
-#ifdef ASM_OUTPUT_DEFINE_LABEL_DIFFERENCE_SYMBOL
- ASM_GENERATE_INTERNAL_LABEL (ld, FDE_LENGTH_LABEL, for_eh + i * 2);
- if (for_eh)
- ASM_OUTPUT_DWARF_OFFSET4 (asm_out_file, ld);
- else
- ASM_OUTPUT_DWARF_OFFSET (asm_out_file, ld);
-#else
+ dw2_asm_output_delta (for_eh ? 4 : DWARF_OFFSET_SIZE, l2, l1,
+ "FDE Length");
+ ASM_OUTPUT_LABEL (asm_out_file, l1);
+
if (for_eh)
- ASM_OUTPUT_DWARF_DELTA4 (asm_out_file, l2, l1);
+ dw2_asm_output_delta (4, l1, section_start_label, "FDE CIE offset");
else
- ASM_OUTPUT_DWARF_DELTA (asm_out_file, l2, l1);
-#endif
- if (flag_debug_asm)
- fprintf (asm_out_file, "\t%s FDE Length", ASM_COMMENT_START);
- fputc ('\n', asm_out_file);
- ASM_OUTPUT_LABEL (asm_out_file, l1);
+ dw2_asm_output_offset (DWARF_OFFSET_SIZE, section_start_label,
+ "FDE CIE offset");
- /* ??? This always emits a 4 byte offset when for_eh is true, but it
- emits a target dependent sized offset when for_eh is not true.
- This inconsistency may confuse gdb. The only case where we need a
- non-4 byte offset is for the Irix6 N64 ABI, so we may lose SGI
- compatibility if we emit a 4 byte offset. We need a 4 byte offset
- though in order to be compatible with the dwarf_fde struct in frame.c.
- If the for_eh case is changed, then the struct in frame.c has
- to be adjusted appropriately. */
if (for_eh)
- ASM_OUTPUT_DWARF_DELTA4 (asm_out_file, l1, "__FRAME_BEGIN__");
+ {
+ dw2_asm_output_encoded_addr_rtx (fde_encoding,
+ gen_rtx_SYMBOL_REF (Pmode, fde->dw_fde_begin),
+ "FDE initial location");
+ dw2_asm_output_delta (size_of_encoded_value (fde_encoding),
+ fde->dw_fde_end, fde->dw_fde_begin,
+ "FDE address range");
+ }
else
- ASM_OUTPUT_DWARF_OFFSET (asm_out_file, stripattributes (FRAME_SECTION));
- if (flag_debug_asm)
- fprintf (asm_out_file, "\t%s FDE CIE offset", ASM_COMMENT_START);
+ {
+ dw2_asm_output_addr (DWARF2_ADDR_SIZE, fde->dw_fde_begin,
+ "FDE initial location");
+ dw2_asm_output_delta (DWARF2_ADDR_SIZE,
+ fde->dw_fde_end, fde->dw_fde_begin,
+ "FDE address range");
+ }
- fputc ('\n', asm_out_file);
- ASM_OUTPUT_DWARF_ADDR (asm_out_file, fde->dw_fde_begin);
- if (flag_debug_asm)
- fprintf (asm_out_file, "\t%s FDE initial location", ASM_COMMENT_START);
+ if (augmentation[0])
+ {
+ if (any_lsda_needed)
+ {
+ int size = size_of_encoded_value (lsda_encoding);
+
+ if (lsda_encoding == DW_EH_PE_aligned)
+ {
+ int offset = ( 4 /* Length */
+ + 4 /* CIE offset */
+ + 2 * size_of_encoded_value (fde_encoding)
+ + 1 /* Augmentation size */ );
+ int pad = -offset & (PTR_SIZE - 1);
+
+ size += pad;
+ if (size_of_uleb128 (size) != 1)
+ abort ();
+ }
- fputc ('\n', asm_out_file);
- ASM_OUTPUT_DWARF_ADDR_DELTA (asm_out_file,
- fde->dw_fde_end, fde->dw_fde_begin);
- if (flag_debug_asm)
- fprintf (asm_out_file, "\t%s FDE address range", ASM_COMMENT_START);
+ dw2_asm_output_data_uleb128 (size, "Augmentation size");
- fputc ('\n', asm_out_file);
+ if (fde->uses_eh_lsda)
+ {
+ ASM_GENERATE_INTERNAL_LABEL (l1, "LLSDA",
+ fde->funcdef_number);
+ dw2_asm_output_encoded_addr_rtx (
+ lsda_encoding, gen_rtx_SYMBOL_REF (Pmode, l1),
+ "Language Specific Data Area");
+ }
+ else
+ {
+ if (lsda_encoding == DW_EH_PE_aligned)
+ ASM_OUTPUT_ALIGN (asm_out_file, floor_log2 (PTR_SIZE));
+ dw2_asm_output_data (size_of_encoded_value (lsda_encoding),
+ 0, "Language Specific Data Area (none)");
+ }
+ }
+ else
+ dw2_asm_output_data_uleb128 (0, "Augmentation size");
+ }
/* Loop through the Call Frame Instructions associated with
this FDE. */
fde->dw_fde_current_label = fde->dw_fde_begin;
for (cfi = fde->dw_fde_cfi; cfi != NULL; cfi = cfi->dw_cfi_next)
- output_cfi (cfi, fde);
+ output_cfi (cfi, fde, for_eh);
/* Pad the FDE out to an address sized boundary. */
- ASM_OUTPUT_ALIGN (asm_out_file, floor_log2 (DWARF2_ADDR_SIZE));
+ ASM_OUTPUT_ALIGN (asm_out_file,
+ floor_log2 ((for_eh ? PTR_SIZE : DWARF2_ADDR_SIZE)));
ASM_OUTPUT_LABEL (asm_out_file, l2);
-#ifdef ASM_OUTPUT_DEFINE_LABEL_DIFFERENCE_SYMBOL
- ASM_OUTPUT_DEFINE_LABEL_DIFFERENCE_SYMBOL (asm_out_file, ld, l2, l1);
- if (flag_debug_asm)
- fprintf (asm_out_file, "\t%s FDE Length Symbol", ASM_COMMENT_START);
- fputc ('\n', asm_out_file);
-#endif
}
+
#ifndef EH_FRAME_SECTION
if (for_eh)
- {
- /* Emit terminating zero for table. */
- ASM_OUTPUT_DWARF_DATA4 (asm_out_file, 0);
- fputc ('\n', asm_out_file);
- }
+ dw2_asm_output_data (4, 0, "End of Table");
#endif
#ifdef MIPS_DEBUGGING_INFO
/* Work around Irix 6 assembler bug whereby labels at the end of a section
@@ -2242,14 +1998,35 @@ dwarf2out_begin_prologue ()
char label[MAX_ARTIFICIAL_LABEL_BYTES];
register dw_fde_ref fde;
+ current_function_func_begin_label = 0;
+
+#ifdef IA64_UNWIND_INFO
+ /* ??? current_function_func_begin_label is also used by except.c
+ for call-site information. We must emit this label if it might
+ be used. */
+ if ((! flag_exceptions || USING_SJLJ_EXCEPTIONS)
+ && ! dwarf2out_do_frame ())
+ return;
+#else
+ if (! dwarf2out_do_frame ())
+ return;
+#endif
+
++current_funcdef_number;
function_section (current_function_decl);
ASM_GENERATE_INTERNAL_LABEL (label, FUNC_BEGIN_LABEL,
current_funcdef_number);
- ASM_OUTPUT_LABEL (asm_out_file, label);
+ ASM_OUTPUT_DEBUG_LABEL (asm_out_file, FUNC_BEGIN_LABEL,
+ current_funcdef_number);
current_function_func_begin_label = get_identifier (label);
+#ifdef IA64_UNWIND_INFO
+ /* We can elide the fde allocation if we're not emitting debug info. */
+ if (! dwarf2out_do_frame ())
+ return;
+#endif
+
/* Expand the fde table if necessary. */
if (fde_table_in_use == fde_table_allocated)
{
@@ -2268,7 +2045,9 @@ dwarf2out_begin_prologue ()
fde->dw_fde_current_label = NULL;
fde->dw_fde_end = NULL;
fde->dw_fde_cfi = NULL;
+ fde->funcdef_number = current_funcdef_number;
fde->nothrow = current_function_nothrow;
+ fde->uses_eh_lsda = cfun->uses_eh_lsda;
args_size = old_args_size = 0;
}
@@ -2313,16 +2092,10 @@ void
dwarf2out_frame_finish ()
{
/* Output call frame information. */
-#ifdef MIPS_DEBUGGING_INFO
if (write_symbols == DWARF2_DEBUG)
output_call_frame_info (0);
- if (flag_unwind_tables || (flag_exceptions && ! exceptions_via_longjmp))
- output_call_frame_info (1);
-#else
- if (write_symbols == DWARF2_DEBUG
- || flag_unwind_tables || (flag_exceptions && ! exceptions_via_longjmp))
+ if (! USING_SJLJ_EXCEPTIONS && (flag_unwind_tables || flag_exceptions))
output_call_frame_info (1);
-#endif
}
/* And now, the subset of the debugging information support code necessary
@@ -2899,23 +2672,21 @@ output_loc_operands (loc)
{
#ifdef DWARF2_DEBUGGING_INFO
case DW_OP_addr:
- ASM_OUTPUT_DWARF_ADDR_CONST (asm_out_file, val1->v.val_addr);
- fputc ('\n', asm_out_file);
+ dw2_asm_output_addr_rtx (DWARF2_ADDR_SIZE, val1->v.val_addr, NULL);
break;
case DW_OP_const2u:
case DW_OP_const2s:
- ASM_OUTPUT_DWARF_DATA2 (asm_out_file, val1->v.val_int);
- fputc ('\n', asm_out_file);
+ dw2_asm_output_data (2, val1->v.val_int, NULL);
break;
case DW_OP_const4u:
case DW_OP_const4s:
- ASM_OUTPUT_DWARF_DATA4 (asm_out_file, val1->v.val_int);
- fputc ('\n', asm_out_file);
+ dw2_asm_output_data (4, val1->v.val_int, NULL);
break;
case DW_OP_const8u:
case DW_OP_const8s:
- abort ();
- fputc ('\n', asm_out_file);
+ if (HOST_BITS_PER_LONG < 64)
+ abort ();
+ dw2_asm_output_data (8, val1->v.val_int, NULL);
break;
case DW_OP_skip:
case DW_OP_bra:
@@ -2927,8 +2698,7 @@ output_loc_operands (loc)
else
abort ();
- ASM_OUTPUT_DWARF_DATA2 (asm_out_file, offset);
- fputc ('\n', asm_out_file);
+ dw2_asm_output_data (2, offset, NULL);
}
break;
#else
@@ -2949,24 +2719,19 @@ output_loc_operands (loc)
#endif
case DW_OP_const1u:
case DW_OP_const1s:
- ASM_OUTPUT_DWARF_DATA1 (asm_out_file, val1->v.val_flag);
- fputc ('\n', asm_out_file);
+ dw2_asm_output_data (1, val1->v.val_int, NULL);
break;
case DW_OP_constu:
- output_uleb128 (val1->v.val_unsigned);
- fputc ('\n', asm_out_file);
+ dw2_asm_output_data_uleb128 (val1->v.val_unsigned, NULL);
break;
case DW_OP_consts:
- output_sleb128 (val1->v.val_int);
- fputc ('\n', asm_out_file);
+ dw2_asm_output_data_sleb128 (val1->v.val_int, NULL);
break;
case DW_OP_pick:
- ASM_OUTPUT_DWARF_DATA1 (asm_out_file, val1->v.val_int);
- fputc ('\n', asm_out_file);
+ dw2_asm_output_data (1, val1->v.val_int, NULL);
break;
case DW_OP_plus_uconst:
- output_uleb128 (val1->v.val_unsigned);
- fputc ('\n', asm_out_file);
+ dw2_asm_output_data_uleb128 (val1->v.val_unsigned, NULL);
break;
case DW_OP_breg0:
case DW_OP_breg1:
@@ -3000,31 +2765,24 @@ output_loc_operands (loc)
case DW_OP_breg29:
case DW_OP_breg30:
case DW_OP_breg31:
- output_sleb128 (val1->v.val_int);
- fputc ('\n', asm_out_file);
+ dw2_asm_output_data_sleb128 (val1->v.val_int, NULL);
break;
case DW_OP_regx:
- output_uleb128 (val1->v.val_unsigned);
- fputc ('\n', asm_out_file);
+ dw2_asm_output_data_uleb128 (val1->v.val_unsigned, NULL);
break;
case DW_OP_fbreg:
- output_sleb128 (val1->v.val_int);
- fputc ('\n', asm_out_file);
+ dw2_asm_output_data_sleb128 (val1->v.val_int, NULL);
break;
case DW_OP_bregx:
- output_uleb128 (val1->v.val_unsigned);
- fputc ('\n', asm_out_file);
- output_sleb128 (val2->v.val_int);
- fputc ('\n', asm_out_file);
+ dw2_asm_output_data_uleb128 (val1->v.val_unsigned, NULL);
+ dw2_asm_output_data_sleb128 (val2->v.val_int, NULL);
break;
case DW_OP_piece:
- output_uleb128 (val1->v.val_unsigned);
- fputc ('\n', asm_out_file);
+ dw2_asm_output_data_uleb128 (val1->v.val_unsigned, NULL);
break;
case DW_OP_deref_size:
case DW_OP_xderef_size:
- ASM_OUTPUT_DWARF_DATA1 (asm_out_file, val1->v.val_flag);
- fputc ('\n', asm_out_file);
+ dw2_asm_output_data (1, val1->v.val_int, NULL);
break;
default:
/* Other codes have no operands. */
@@ -3041,12 +2799,8 @@ output_loc_sequence (loc)
for (; loc != NULL; loc = loc->dw_loc_next)
{
/* Output the opcode. */
- ASM_OUTPUT_DWARF_DATA1 (asm_out_file, loc->dw_loc_opc);
- if (flag_debug_asm)
- fprintf (asm_out_file, "\t%s %s", ASM_COMMENT_START,
- dwarf_stack_op_name (loc->dw_loc_opc));
-
- fputc ('\n', asm_out_file);
+ dw2_asm_output_data (1, loc->dw_loc_opc,
+ "%s", dwarf_stack_op_name (loc->dw_loc_opc));
/* Output the operand(s) (if any). */
output_loc_operands (loc);
@@ -3066,8 +2820,7 @@ output_cfa_loc (cfi)
/* Output the size of the block. */
loc = cfi->dw_cfi_oprnd1.dw_cfi_loc;
size = size_of_locs (loc);
- output_uleb128 (size);
- fputc ('\n', asm_out_file);
+ dw2_asm_output_data_uleb128 (size, NULL);
/* Now output the operations themselves. */
output_loc_sequence (loc);
@@ -3418,11 +3171,8 @@ struct file_table
table. */
#define FILE_TABLE_INCREMENT 64
-/* Filenames referenced by declarations this compilation unit. */
-static struct file_table decl_file_table;
-
-/* Filenames referenced by line numbers in this compilation unit. */
-static struct file_table line_file_table;
+/* Filenames referenced by this compilation unit. */
+static struct file_table file_table;
/* Local pointer to the name of the main input file. Initialized in
dwarf2out_init. */
@@ -3448,17 +3198,7 @@ static unsigned decl_die_table_in_use;
of declaration scopes at the current scope and containing
scopes. This table is used to find the proper place to
define type declaration DIE's. */
-static tree *decl_scope_table;
-
-/* Number of elements currently allocated for the decl_scope_table. */
-static int decl_scope_table_allocated;
-
-/* Current level of nesting of declaration scopes. */
-static int decl_scope_depth;
-
-/* Size (in elements) of increments by which we may expand the
- decl_scope_table. */
-#define DECL_SCOPE_TABLE_INCREMENT 64
+varray_type decl_scope_table;
/* A pointer to the base of a list of references to DIE's that
are uniquely identified by their tag, presence/absence of
@@ -3528,20 +3268,11 @@ static unsigned arange_table_in_use;
#define ARANGE_TABLE_INCREMENT 64
/* A pointer to the base of a list of incomplete types which might be
- completed at some later time. */
-
-static tree *incomplete_types_list;
-
-/* Number of elements currently allocated for the incomplete_types_list. */
-static unsigned incomplete_types_allocated;
-
-/* Number of elements of incomplete_types_list currently in use. */
-static unsigned incomplete_types;
-
-/* Size (in elements) of increments by which we may expand the incomplete
- types list. Actually, a single hunk of space of this size should
- be enough for most typical programs. */
-#define INCOMPLETE_TYPES_INCREMENT 64
+ completed at some later time. incomplete_types_list needs to be a VARRAY
+ because we want to tell the garbage collector about it. If we don't tell
+ the garbage collector about it, we can garbage collect live data.
+ Bug 4215.*/
+varray_type incomplete_types;
/* Record whether the function being analyzed contains inlined functions. */
static int current_function_has_inlines;
@@ -3655,14 +3386,12 @@ static unsigned long size_of_die PARAMS ((dw_die_ref));
static void calc_die_sizes PARAMS ((dw_die_ref));
static void mark_dies PARAMS ((dw_die_ref));
static void unmark_dies PARAMS ((dw_die_ref));
-static unsigned long size_of_line_prolog PARAMS ((void));
static unsigned long size_of_pubnames PARAMS ((void));
static unsigned long size_of_aranges PARAMS ((void));
static enum dwarf_form value_format PARAMS ((dw_attr_ref));
static void output_value_format PARAMS ((dw_attr_ref));
static void output_abbrev_section PARAMS ((void));
static void output_die_symbol PARAMS ((dw_die_ref));
-static void output_symbolic_ref PARAMS ((dw_die_ref));
static void output_die PARAMS ((dw_die_ref));
static void output_compilation_unit_header PARAMS ((void));
static void output_comp_unit PARAMS ((dw_die_ref));
@@ -3754,13 +3483,11 @@ static void gen_block_die PARAMS ((tree, dw_die_ref, int));
static void decls_for_scope PARAMS ((tree, dw_die_ref, int));
static int is_redundant_typedef PARAMS ((tree));
static void gen_decl_die PARAMS ((tree, dw_die_ref));
-static unsigned lookup_filename PARAMS ((struct file_table *,
- const char *));
-static void init_file_table PARAMS ((struct file_table *));
+static unsigned lookup_filename PARAMS ((const char *));
+static void init_file_table PARAMS ((void));
static void add_incomplete_type PARAMS ((tree));
static void retry_incomplete_types PARAMS ((void));
static void gen_type_die_for_member PARAMS ((tree, tree, dw_die_ref));
-static void gen_abstract_function PARAMS ((tree));
static rtx save_rtx PARAMS ((rtx));
static void splice_child_die PARAMS ((dw_die_ref, dw_die_ref));
static int file_info_cmp PARAMS ((const void *, const void *));
@@ -3891,7 +3618,7 @@ is_pseudo_reg (rtl)
{
return ((GET_CODE (rtl) == REG && REGNO (rtl) >= FIRST_PSEUDO_REGISTER)
|| (GET_CODE (rtl) == SUBREG
- && REGNO (XEXP (rtl, 0)) >= FIRST_PSEUDO_REGISTER));
+ && REGNO (SUBREG_REG (rtl)) >= FIRST_PSEUDO_REGISTER));
}
/* Return a reference to a type, with its const and volatile qualifiers
@@ -4847,6 +4574,13 @@ is_c_family ()
}
static inline int
+is_cxx ()
+{
+ return (get_AT_unsigned (comp_unit_die, DW_AT_language)
+ == DW_LANG_C_plus_plus);
+}
+
+static inline int
is_fortran ()
{
register unsigned lang = get_AT_unsigned (comp_unit_die, DW_AT_language);
@@ -5212,7 +4946,7 @@ print_dwarf_line_table (outfile)
{
line_info = &line_info_table[i];
fprintf (outfile, "%5d: ", i);
- fprintf (outfile, "%-20s", line_file_table.table[line_info->dw_file_num]);
+ fprintf (outfile, "%-20s", file_table.table[line_info->dw_file_num]);
fprintf (outfile, "%6ld", line_info->dw_line_num);
fprintf (outfile, "\n");
}
@@ -5446,7 +5180,7 @@ compute_section_prefix (unit_die)
die_checksum (unit_die, &ctx);
md5_finish_ctx (&ctx, checksum);
- p = file_name_nondirectory (get_AT_string (unit_die, DW_AT_name));
+ p = lbasename (get_AT_string (unit_die, DW_AT_name));
name = (char *) alloca (strlen (p) + 64);
sprintf (name, "%s.", p);
@@ -5797,7 +5531,7 @@ size_of_die (die)
size += constant_size (AT_unsigned (a));
break;
case dw_val_class_long_long:
- size += 1 + 8; /* block */
+ size += 1 + 2*HOST_BITS_PER_LONG/HOST_BITS_PER_CHAR; /* block */
break;
case dw_val_class_float:
size += 1 + a->dw_attr_val.v.val_float.length * 4; /* block */
@@ -5877,45 +5611,6 @@ unmark_dies (die)
unmark_dies (c);
}
-/* Return the size of the line information prolog generated for the
- compilation unit. */
-
-static unsigned long
-size_of_line_prolog ()
-{
- register unsigned long size;
- register unsigned long ft_index;
-
- size = DWARF_LINE_PROLOG_HEADER_SIZE;
-
- /* Count the size of the table giving number of args for each
- standard opcode. */
- size += DWARF_LINE_OPCODE_BASE - 1;
-
- /* Include directory table is empty (at present). Count only the
- null byte used to terminate the table. */
- size += 1;
-
- for (ft_index = 1; ft_index < decl_file_table.in_use; ++ft_index)
- {
- /* File name entry. */
- size += size_of_string (decl_file_table.table[ft_index]);
-
- /* Include directory index. */
- size += size_of_uleb128 (0);
-
- /* Modification time. */
- size += size_of_uleb128 (0);
-
- /* File length in bytes. */
- size += size_of_uleb128 (0);
- }
-
- /* Count the file table terminator. */
- size += 1;
- return size;
-}
-
/* Return the size of the .debug_pubnames table generated for the
compilation unit. */
@@ -6021,12 +5716,7 @@ output_value_format (a)
dw_attr_ref a;
{
enum dwarf_form form = value_format (a);
-
- output_uleb128 (form);
- if (flag_debug_asm)
- fprintf (asm_out_file, " (%s)", dwarf_form_name (form));
-
- fputc ('\n', asm_out_file);
+ dw2_asm_output_data_uleb128 (form, "(%s)", dwarf_form_name (form));
}
/* Output the .debug_abbrev section which defines the DIE abbreviation
@@ -6042,45 +5732,30 @@ output_abbrev_section ()
{
register dw_die_ref abbrev = abbrev_die_table[abbrev_id];
- output_uleb128 (abbrev_id);
- if (flag_debug_asm)
- fprintf (asm_out_file, " (abbrev code)");
-
- fputc ('\n', asm_out_file);
- output_uleb128 (abbrev->die_tag);
- if (flag_debug_asm)
- fprintf (asm_out_file, " (TAG: %s)",
- dwarf_tag_name (abbrev->die_tag));
+ dw2_asm_output_data_uleb128 (abbrev_id, "(abbrev code)");
- fputc ('\n', asm_out_file);
- fprintf (asm_out_file, "%s0x%x", ASM_BYTE_OP,
- abbrev->die_child != NULL ? DW_children_yes : DW_children_no);
+ dw2_asm_output_data_uleb128 (abbrev->die_tag, "(TAG: %s)",
+ dwarf_tag_name (abbrev->die_tag));
- if (flag_debug_asm)
- fprintf (asm_out_file, "\t%s %s",
- ASM_COMMENT_START,
- (abbrev->die_child != NULL
- ? "DW_children_yes" : "DW_children_no"));
-
- fputc ('\n', asm_out_file);
+ if (abbrev->die_child != NULL)
+ dw2_asm_output_data (1, DW_children_yes, "DW_children_yes");
+ else
+ dw2_asm_output_data (1, DW_children_no, "DW_children_no");
for (a_attr = abbrev->die_attr; a_attr != NULL;
a_attr = a_attr->dw_attr_next)
{
- output_uleb128 (a_attr->dw_attr);
- if (flag_debug_asm)
- fprintf (asm_out_file, " (%s)",
- dwarf_attr_name (a_attr->dw_attr));
-
- fputc ('\n', asm_out_file);
+ dw2_asm_output_data_uleb128 (a_attr->dw_attr, "(%s)",
+ dwarf_attr_name (a_attr->dw_attr));
output_value_format (a_attr);
}
- fprintf (asm_out_file, "%s0,0\n", ASM_BYTE_OP);
+ dw2_asm_output_data (1, 0, NULL);
+ dw2_asm_output_data (1, 0, NULL);
}
/* Terminate the table. */
- fprintf (asm_out_file, "%s0\n", ASM_BYTE_OP);
+ dw2_asm_output_data (1, 0, NULL);
}
/* Output a symbol we can use to refer to this DIE from another CU. */
@@ -6102,20 +5777,6 @@ output_die_symbol (die)
ASM_OUTPUT_LABEL (asm_out_file, sym);
}
-/* Output a symbolic (i.e. FORM_ref_addr) reference to TARGET_DIE. */
-
-static inline void
-output_symbolic_ref (target_die)
- dw_die_ref target_die;
-{
- char *sym = target_die->die_symbol;
-
- if (sym == 0)
- abort ();
-
- ASM_OUTPUT_DWARF_OFFSET (asm_out_file, sym);
-}
-
/* Output the DIE and its attributes. Called recursively to generate
the definitions of each child DIE. */
@@ -6132,42 +5793,24 @@ output_die (die)
if (die->die_symbol)
output_die_symbol (die);
- output_uleb128 (die->die_abbrev);
- if (flag_debug_asm)
- fprintf (asm_out_file, " (DIE (0x%lx) %s)",
- die->die_offset, dwarf_tag_name (die->die_tag));
-
- fputc ('\n', asm_out_file);
+ dw2_asm_output_data_uleb128 (die->die_abbrev, "(DIE (0x%lx) %s)",
+ die->die_offset, dwarf_tag_name (die->die_tag));
for (a = die->die_attr; a != NULL; a = a->dw_attr_next)
{
+ const char *name = dwarf_attr_name (a->dw_attr);
+
switch (AT_class (a))
{
case dw_val_class_addr:
- ASM_OUTPUT_DWARF_ADDR_CONST (asm_out_file, AT_addr (a));
+ dw2_asm_output_addr_rtx (DWARF2_ADDR_SIZE, AT_addr (a), "%s", name);
break;
case dw_val_class_loc:
size = size_of_locs (AT_loc (a));
/* Output the block length for this list of location operations. */
- switch (constant_size (size))
- {
- case 1:
- ASM_OUTPUT_DWARF_DATA1 (asm_out_file, size);
- break;
- case 2:
- ASM_OUTPUT_DWARF_DATA2 (asm_out_file, size);
- break;
- default:
- abort ();
- }
-
- if (flag_debug_asm)
- fprintf (asm_out_file, "\t%s %s",
- ASM_COMMENT_START, dwarf_attr_name (a->dw_attr));
-
- fputc ('\n', asm_out_file);
+ dw2_asm_output_data (constant_size (size), size, "%s", name);
output_loc_sequence (AT_loc (a));
break;
@@ -6176,123 +5819,94 @@ output_die (die)
/* ??? It would be slightly more efficient to use a scheme like is
used for unsigned constants below, but gdb 4.x does not sign
extend. Gdb 5.x does sign extend. */
- output_sleb128 (AT_int (a));
+ dw2_asm_output_data_sleb128 (AT_int (a), "%s", name);
break;
case dw_val_class_unsigned_const:
- switch (constant_size (AT_unsigned (a)))
- {
- case 1:
- ASM_OUTPUT_DWARF_DATA1 (asm_out_file, AT_unsigned (a));
- break;
- case 2:
- ASM_OUTPUT_DWARF_DATA2 (asm_out_file, AT_unsigned (a));
- break;
- case 4:
- ASM_OUTPUT_DWARF_DATA4 (asm_out_file, AT_unsigned (a));
- break;
- case 8:
- ASM_OUTPUT_DWARF_DATA8 (asm_out_file, AT_unsigned (a));
- break;
- default:
- abort ();
- }
+ dw2_asm_output_data (constant_size (AT_unsigned (a)),
+ AT_unsigned (a), "%s", name);
break;
case dw_val_class_long_long:
- ASM_OUTPUT_DWARF_DATA1 (asm_out_file, 8);
- if (flag_debug_asm)
- fprintf (asm_out_file, "\t%s %s",
- ASM_COMMENT_START, dwarf_attr_name (a->dw_attr));
-
- fputc ('\n', asm_out_file);
- ASM_OUTPUT_DWARF_CONST_DOUBLE (asm_out_file,
- a->dw_attr_val.v.val_long_long.hi,
- a->dw_attr_val.v.val_long_long.low);
+ {
+ unsigned HOST_WIDE_INT first, second;
- if (flag_debug_asm)
- fprintf (asm_out_file,
- "\t%s long long constant", ASM_COMMENT_START);
+ dw2_asm_output_data (1, 2*HOST_BITS_PER_LONG/HOST_BITS_PER_CHAR,
+ "%s", name);
- fputc ('\n', asm_out_file);
+ if (WORDS_BIG_ENDIAN)
+ {
+ first = a->dw_attr_val.v.val_long_long.hi;
+ second = a->dw_attr_val.v.val_long_long.low;
+ }
+ else
+ {
+ first = a->dw_attr_val.v.val_long_long.low;
+ second = a->dw_attr_val.v.val_long_long.hi;
+ }
+ dw2_asm_output_data (HOST_BITS_PER_LONG/HOST_BITS_PER_CHAR,
+ first, "long long constant");
+ dw2_asm_output_data (HOST_BITS_PER_LONG/HOST_BITS_PER_CHAR,
+ second, NULL);
+ }
break;
case dw_val_class_float:
{
register unsigned int i;
- ASM_OUTPUT_DWARF_DATA1 (asm_out_file,
- a->dw_attr_val.v.val_float.length * 4);
- if (flag_debug_asm)
- fprintf (asm_out_file, "\t%s %s",
- ASM_COMMENT_START, dwarf_attr_name (a->dw_attr));
- fputc ('\n', asm_out_file);
- for (i = 0; i < a->dw_attr_val.v.val_float.length; ++i)
- {
- ASM_OUTPUT_DWARF_DATA4 (asm_out_file,
- a->dw_attr_val.v.val_float.array[i]);
- if (flag_debug_asm)
- fprintf (asm_out_file, "\t%s fp constant word %u",
- ASM_COMMENT_START, i);
+ dw2_asm_output_data (1, a->dw_attr_val.v.val_float.length * 4,
+ "%s", name);
- fputc ('\n', asm_out_file);
- }
+ for (i = 0; i < a->dw_attr_val.v.val_float.length; ++i)
+ dw2_asm_output_data (4, a->dw_attr_val.v.val_float.array[i],
+ "fp constant word %u", i);
break;
}
case dw_val_class_flag:
- ASM_OUTPUT_DWARF_DATA1 (asm_out_file, AT_flag (a));
+ dw2_asm_output_data (1, AT_flag (a), "%s", name);
break;
case dw_val_class_die_ref:
if (AT_ref_external (a))
- output_symbolic_ref (AT_ref (a));
+ {
+ char *sym = AT_ref (a)->die_symbol;
+ if (sym == 0)
+ abort ();
+ dw2_asm_output_offset (DWARF2_ADDR_SIZE, sym, "%s", name);
+ }
else if (AT_ref (a)->die_offset == 0)
abort ();
else
- ASM_OUTPUT_DWARF_DATA (asm_out_file, AT_ref (a)->die_offset);
+ dw2_asm_output_data (DWARF_OFFSET_SIZE, AT_ref (a)->die_offset,
+ "%s", name);
break;
case dw_val_class_fde_ref:
{
char l1[20];
- ASM_GENERATE_INTERNAL_LABEL
- (l1, FDE_AFTER_SIZE_LABEL, a->dw_attr_val.v.val_fde_index * 2);
- ASM_OUTPUT_DWARF_OFFSET (asm_out_file, l1);
- fprintf (asm_out_file, " - %d", DWARF_OFFSET_SIZE);
+ ASM_GENERATE_INTERNAL_LABEL (l1, FDE_LABEL,
+ a->dw_attr_val.v.val_fde_index * 2);
+ dw2_asm_output_offset (DWARF_OFFSET_SIZE, l1, "%s", name);
}
break;
case dw_val_class_lbl_id:
- ASM_OUTPUT_DWARF_ADDR (asm_out_file, AT_lbl (a));
+ dw2_asm_output_addr (DWARF2_ADDR_SIZE, AT_lbl (a), "%s", name);
break;
case dw_val_class_lbl_offset:
- ASM_OUTPUT_DWARF_OFFSET (asm_out_file, AT_lbl (a));
+ dw2_asm_output_offset (DWARF_OFFSET_SIZE, AT_lbl (a), "%s", name);
break;
case dw_val_class_str:
- if (flag_debug_asm)
- ASM_OUTPUT_DWARF_STRING (asm_out_file, AT_string (a));
- else
- ASM_OUTPUT_ASCII (asm_out_file, AT_string (a),
- (int) strlen (AT_string (a)) + 1);
+ dw2_asm_output_nstring (AT_string (a), -1, "%s", name);
break;
default:
abort ();
}
-
- if (AT_class (a) != dw_val_class_loc
- && AT_class (a) != dw_val_class_long_long
- && AT_class (a) != dw_val_class_float)
- {
- if (flag_debug_asm)
- fprintf (asm_out_file, "\t%s %s",
- ASM_COMMENT_START, dwarf_attr_name (a->dw_attr));
-
- fputc ('\n', asm_out_file);
- }
}
for (c = die->die_child; c != NULL; c = c->die_sib)
@@ -6301,12 +5915,8 @@ output_die (die)
if (die->die_child != NULL)
{
/* Add null byte to terminate sibling list. */
- ASM_OUTPUT_DWARF_DATA1 (asm_out_file, 0);
- if (flag_debug_asm)
- fprintf (asm_out_file, "\t%s end of children of DIE 0x%lx",
- ASM_COMMENT_START, die->die_offset);
-
- fputc ('\n', asm_out_file);
+ dw2_asm_output_data (1, 0, "end of children of DIE 0x%lx",
+ die->die_offset);
}
}
@@ -6316,28 +5926,15 @@ output_die (die)
static void
output_compilation_unit_header ()
{
- ASM_OUTPUT_DWARF_DATA (asm_out_file, next_die_offset - DWARF_OFFSET_SIZE);
- if (flag_debug_asm)
- fprintf (asm_out_file, "\t%s Length of Compilation Unit Info.",
- ASM_COMMENT_START);
+ dw2_asm_output_data (DWARF_OFFSET_SIZE, next_die_offset - DWARF_OFFSET_SIZE,
+ "Length of Compilation Unit Info");
- fputc ('\n', asm_out_file);
- ASM_OUTPUT_DWARF_DATA2 (asm_out_file, DWARF_VERSION);
- if (flag_debug_asm)
- fprintf (asm_out_file, "\t%s DWARF version number", ASM_COMMENT_START);
+ dw2_asm_output_data (2, DWARF_VERSION, "DWARF version number");
- fputc ('\n', asm_out_file);
- ASM_OUTPUT_DWARF_OFFSET (asm_out_file, abbrev_section_label);
- if (flag_debug_asm)
- fprintf (asm_out_file, "\t%s Offset Into Abbrev. Section",
- ASM_COMMENT_START);
-
- fputc ('\n', asm_out_file);
- ASM_OUTPUT_DWARF_DATA1 (asm_out_file, DWARF2_ADDR_SIZE);
- if (flag_debug_asm)
- fprintf (asm_out_file, "\t%s Pointer Size (in bytes)", ASM_COMMENT_START);
+ dw2_asm_output_offset (DWARF_OFFSET_SIZE, abbrev_section_label,
+ "Offset Into Abbrev. Section");
- fputc ('\n', asm_out_file);
+ dw2_asm_output_data (1, DWARF2_ADDR_SIZE, "Pointer Size (in bytes)");
}
/* Output the compilation unit DIE and its children. */
@@ -6348,10 +5945,13 @@ output_comp_unit (die)
{
const char *secname;
- if (die->die_child == 0)
- return;
-
- /* Mark all the DIEs in this CU so we know which get local refs. */
+ /* Even if there are no children of this DIE, we must output the
+ information about the compilation unit. Otherwise, on an empty
+ translation unit, we will generate a present, but empty,
+ .debug_info section. IRIX 6.5 `nm' will then complain when
+ examining the file.
+
+ Mark all the DIEs in this CU so we know which get local refs. */
mark_dies (die);
build_abbrev_table (die);
@@ -6371,7 +5971,6 @@ output_comp_unit (die)
secname = (const char *) DEBUG_INFO_SECTION;
/* Output debugging information. */
- fputc ('\n', asm_out_file);
ASM_OUTPUT_SECTION (asm_out_file, secname);
output_compilation_unit_header ();
output_die (die);
@@ -6429,30 +6028,17 @@ output_pubnames ()
register unsigned i;
register unsigned long pubnames_length = size_of_pubnames ();
- ASM_OUTPUT_DWARF_DATA (asm_out_file, pubnames_length);
+ dw2_asm_output_data (DWARF_OFFSET_SIZE, pubnames_length,
+ "Length of Public Names Info");
- if (flag_debug_asm)
- fprintf (asm_out_file, "\t%s Length of Public Names Info.",
- ASM_COMMENT_START);
+ dw2_asm_output_data (2, DWARF_VERSION, "DWARF Version");
- fputc ('\n', asm_out_file);
- ASM_OUTPUT_DWARF_DATA2 (asm_out_file, DWARF_VERSION);
+ dw2_asm_output_offset (DWARF_OFFSET_SIZE, debug_info_section_label,
+ "Offset of Compilation Unit Info");
- if (flag_debug_asm)
- fprintf (asm_out_file, "\t%s DWARF Version", ASM_COMMENT_START);
+ dw2_asm_output_data (DWARF_OFFSET_SIZE, next_die_offset,
+ "Compilation Unit Length");
- fputc ('\n', asm_out_file);
- ASM_OUTPUT_DWARF_OFFSET (asm_out_file, debug_info_section_label);
- if (flag_debug_asm)
- fprintf (asm_out_file, "\t%s Offset of Compilation Unit Info.",
- ASM_COMMENT_START);
-
- fputc ('\n', asm_out_file);
- ASM_OUTPUT_DWARF_DATA (asm_out_file, next_die_offset);
- if (flag_debug_asm)
- fprintf (asm_out_file, "\t%s Compilation Unit Length", ASM_COMMENT_START);
-
- fputc ('\n', asm_out_file);
for (i = 0; i < pubname_table_in_use; ++i)
{
register pubname_ref pub = &pubname_table[i];
@@ -6461,28 +6047,13 @@ output_pubnames ()
if (pub->die->die_mark == 0)
abort ();
- ASM_OUTPUT_DWARF_DATA (asm_out_file, pub->die->die_offset);
- if (flag_debug_asm)
- fprintf (asm_out_file, "\t%s DIE offset", ASM_COMMENT_START);
-
- fputc ('\n', asm_out_file);
-
- if (flag_debug_asm)
- {
- ASM_OUTPUT_DWARF_STRING (asm_out_file, pub->name);
- fprintf (asm_out_file, "%s external name", ASM_COMMENT_START);
- }
- else
- {
- ASM_OUTPUT_ASCII (asm_out_file, pub->name,
- (int) strlen (pub->name) + 1);
- }
+ dw2_asm_output_data (DWARF_OFFSET_SIZE, pub->die->die_offset,
+ "DIE offset");
- fputc ('\n', asm_out_file);
+ dw2_asm_output_nstring (pub->name, -1, "external name");
}
- ASM_OUTPUT_DWARF_DATA (asm_out_file, 0);
- fputc ('\n', asm_out_file);
+ dw2_asm_output_data (DWARF_OFFSET_SIZE, 0, NULL);
}
/* Add a new entry to .debug_aranges if appropriate. */
@@ -6516,60 +6087,33 @@ output_aranges ()
register unsigned i;
register unsigned long aranges_length = size_of_aranges ();
- ASM_OUTPUT_DWARF_DATA (asm_out_file, aranges_length);
- if (flag_debug_asm)
- fprintf (asm_out_file, "\t%s Length of Address Ranges Info.",
- ASM_COMMENT_START);
+ dw2_asm_output_data (DWARF_OFFSET_SIZE, aranges_length,
+ "Length of Address Ranges Info");
- fputc ('\n', asm_out_file);
- ASM_OUTPUT_DWARF_DATA2 (asm_out_file, DWARF_VERSION);
- if (flag_debug_asm)
- fprintf (asm_out_file, "\t%s DWARF Version", ASM_COMMENT_START);
+ dw2_asm_output_data (2, DWARF_VERSION, "DWARF Version");
- fputc ('\n', asm_out_file);
- ASM_OUTPUT_DWARF_OFFSET (asm_out_file, debug_info_section_label);
- if (flag_debug_asm)
- fprintf (asm_out_file, "\t%s Offset of Compilation Unit Info.",
- ASM_COMMENT_START);
+ dw2_asm_output_offset (DWARF_OFFSET_SIZE, debug_info_section_label,
+ "Offset of Compilation Unit Info");
- fputc ('\n', asm_out_file);
- ASM_OUTPUT_DWARF_DATA1 (asm_out_file, DWARF2_ADDR_SIZE);
- if (flag_debug_asm)
- fprintf (asm_out_file, "\t%s Size of Address", ASM_COMMENT_START);
-
- fputc ('\n', asm_out_file);
- ASM_OUTPUT_DWARF_DATA1 (asm_out_file, 0);
- if (flag_debug_asm)
- fprintf (asm_out_file, "\t%s Size of Segment Descriptor",
- ASM_COMMENT_START);
+ dw2_asm_output_data (1, DWARF2_ADDR_SIZE, "Size of Address");
- fputc ('\n', asm_out_file);
+ dw2_asm_output_data (1, 0, "Size of Segment Descriptor");
/* We need to align to twice the pointer size here. */
if (DWARF_ARANGES_PAD_SIZE)
{
- /* Pad using a 2 bytes word so that padding is correct
- for any pointer size. */
- ASM_OUTPUT_DWARF_DATA2 (asm_out_file, 0);
+ /* Pad using a 2 byte words so that padding is correct for any
+ pointer size. */
+ dw2_asm_output_data (2, 0, "Pad to %d byte boundary",
+ 2 * DWARF2_ADDR_SIZE);
for (i = 2; i < (unsigned) DWARF_ARANGES_PAD_SIZE; i += 2)
- fprintf (asm_out_file, ",0");
- if (flag_debug_asm)
- fprintf (asm_out_file, "\t%s Pad to %d byte boundary",
- ASM_COMMENT_START, 2 * DWARF2_ADDR_SIZE);
+ dw2_asm_output_data (2, 0, NULL);
}
- fputc ('\n', asm_out_file);
- ASM_OUTPUT_DWARF_ADDR (asm_out_file, text_section_label);
- if (flag_debug_asm)
- fprintf (asm_out_file, "\t%s Address", ASM_COMMENT_START);
-
- fputc ('\n', asm_out_file);
- ASM_OUTPUT_DWARF_ADDR_DELTA (asm_out_file, text_end_label,
- text_section_label);
- if (flag_debug_asm)
- fprintf (asm_out_file, "%s Length", ASM_COMMENT_START);
+ dw2_asm_output_addr (DWARF2_ADDR_SIZE, text_section_label, "Address");
+ dw2_asm_output_delta (DWARF2_ADDR_SIZE, text_end_label,
+ text_section_label, "Length");
- fputc ('\n', asm_out_file);
for (i = 0; i < arange_table_in_use; ++i)
{
dw_die_ref die = arange_table[i];
@@ -6579,7 +6123,12 @@ output_aranges ()
abort ();
if (die->die_tag == DW_TAG_subprogram)
- ASM_OUTPUT_DWARF_ADDR (asm_out_file, get_AT_low_pc (die));
+ {
+ dw2_asm_output_addr (DWARF2_ADDR_SIZE, get_AT_low_pc (die),
+ "Address");
+ dw2_asm_output_delta (DWARF2_ADDR_SIZE, get_AT_hi_pc (die),
+ get_AT_low_pc (die), "Length");
+ }
else
{
/* A static variable; extract the symbol from DW_AT_location.
@@ -6595,32 +6144,17 @@ output_aranges ()
if (loc->dw_loc_opc != DW_OP_addr)
abort ();
- ASM_OUTPUT_DWARF_ADDR_CONST (asm_out_file,
- loc->dw_loc_oprnd1.v.val_addr);
+ dw2_asm_output_addr_rtx (DWARF2_ADDR_SIZE,
+ loc->dw_loc_oprnd1.v.val_addr, "Address");
+ dw2_asm_output_data (DWARF2_ADDR_SIZE,
+ get_AT_unsigned (die, DW_AT_byte_size),
+ "Length");
}
-
- if (flag_debug_asm)
- fprintf (asm_out_file, "\t%s Address", ASM_COMMENT_START);
-
- fputc ('\n', asm_out_file);
- if (die->die_tag == DW_TAG_subprogram)
- ASM_OUTPUT_DWARF_ADDR_DELTA (asm_out_file, get_AT_hi_pc (die),
- get_AT_low_pc (die));
- else
- ASM_OUTPUT_DWARF_ADDR_DATA (asm_out_file,
- get_AT_unsigned (die, DW_AT_byte_size));
-
- if (flag_debug_asm)
- fprintf (asm_out_file, "%s Length", ASM_COMMENT_START);
-
- fputc ('\n', asm_out_file);
}
/* Output the terminator words. */
- ASM_OUTPUT_DWARF_ADDR_DATA (asm_out_file, 0);
- fputc ('\n', asm_out_file);
- ASM_OUTPUT_DWARF_ADDR_DATA (asm_out_file, 0);
- fputc ('\n', asm_out_file);
+ dw2_asm_output_data (DWARF2_ADDR_SIZE, 0, NULL);
+ dw2_asm_output_data (DWARF2_ADDR_SIZE, 0, NULL);
}
@@ -6641,8 +6175,6 @@ struct dir_info
char *path; /* Path including directory name. */
int length; /* Path length. */
int prefix; /* Index of directory entry which is a prefix. */
- int nbytes; /* Total number of bytes in all file names excluding
- paths. */
int count; /* Number of files in this directory. */
int dir_idx; /* Index of directory used as base. */
int used; /* Used in the end? */
@@ -6688,33 +6220,6 @@ file_info_cmp (p1, p2)
}
}
-/* Compute the maximum prefix of P2 appearing also in P1. Entire
- directory names must match. */
-static int prefix_of PARAMS ((struct dir_info *, struct dir_info *));
-static int
-prefix_of (p1, p2)
- struct dir_info *p1;
- struct dir_info *p2;
-{
- char *s1 = p1->path;
- char *s2 = p2->path;
- int len = p1->length < p2->length ? p1->length : p2->length;
-
- while (*s1 == *s2 && s1 < p1->path + len)
- ++s1, ++s2;
-
- if (*s1 == '/' && *s2 == '/')
- /* The whole of P1 is the prefix. */
- return p1->length;
-
- /* Go back to the last directory component. */
- while (s1 > p1->path)
- if (*--s1 == '/')
- return s1 - p1->path + 1;
-
- return 0;
-}
-
/* Output the directory table and the file name table. We try to minimize
the total amount of memory needed. A heuristic is used to avoid large
slowdowns with many input files. */
@@ -6732,18 +6237,18 @@ output_file_names ()
int idx;
/* Allocate the various arrays we need. */
- files = (struct file_info *) alloca (line_file_table.in_use
+ files = (struct file_info *) alloca (file_table.in_use
* sizeof (struct file_info));
- dirs = (struct dir_info *) alloca (line_file_table.in_use * 2
+ dirs = (struct dir_info *) alloca (file_table.in_use
* sizeof (struct dir_info));
/* Sort the file names. */
- for (i = 1; i < (int) line_file_table.in_use; ++i)
+ for (i = 1; i < (int) file_table.in_use; ++i)
{
char *f;
/* Skip all leading "./". */
- f = line_file_table.table[i];
+ f = file_table.table[i];
while (f[0] == '.' && f[1] == '/')
f += 2;
@@ -6756,86 +6261,48 @@ output_file_names ()
f = strrchr (f, '/');
files[i].fname = f == NULL ? files[i].path : f + 1;
}
- qsort (files + 1, line_file_table.in_use - 1, sizeof (files[0]),
- file_info_cmp);
+ qsort (files + 1, file_table.in_use - 1, sizeof (files[0]), file_info_cmp);
/* Find all the different directories used. */
dirs[0].path = files[1].path;
dirs[0].length = files[1].fname - files[1].path;
dirs[0].prefix = -1;
- dirs[0].nbytes = files[1].length - dirs[1].length + 1;
dirs[0].count = 1;
dirs[0].dir_idx = 0;
dirs[0].used = 0;
files[1].dir_idx = 0;
ndirs = 1;
- for (i = 2; i < (int) line_file_table.in_use; ++i)
+ for (i = 2; i < (int) file_table.in_use; ++i)
if (files[i].fname - files[i].path == dirs[ndirs - 1].length
&& memcmp (dirs[ndirs - 1].path, files[i].path,
dirs[ndirs - 1].length) == 0)
{
/* Same directory as last entry. */
files[i].dir_idx = ndirs - 1;
- dirs[ndirs - 1].nbytes += files[i].length - dirs[ndirs - 1].length + 1;
++dirs[ndirs - 1].count;
}
else
{
int j;
- int max_idx;
- int max_len;
/* This is a new directory. */
dirs[ndirs].path = files[i].path;
dirs[ndirs].length = files[i].fname - files[i].path;
- dirs[ndirs].nbytes = files[i].length - dirs[i].length + 1;
dirs[ndirs].count = 1;
dirs[ndirs].dir_idx = ndirs;
dirs[ndirs].used = 0;
files[i].dir_idx = ndirs;
/* Search for a prefix. */
- max_len = 0;
- max_idx = 0;
+ dirs[ndirs].prefix = -1;
for (j = 0; j < ndirs; ++j)
- if (dirs[j].length > max_len)
- {
- int this_len = prefix_of (&dirs[j], &dirs[ndirs]);
-
- if (this_len > max_len)
- {
- max_len = this_len;
- max_idx = j;
- }
- }
-
- /* Remember the prefix. If this is a known prefix simply
- remember the index. Otherwise we will have to create an
- artificial entry. */
- if (max_len == dirs[max_idx].length)
- /* This is our prefix. */
- dirs[ndirs].prefix = max_idx;
- else if (max_len > 0)
- {
- /* Create an entry without associated file. Since we have
- to keep the dirs array sorted (means, entries with paths
- which come first) we have to move the new entry in the
- place of the old one. */
- dirs[++ndirs] = dirs[max_idx];
-
- /* We don't have to set .path. */
- dirs[max_idx].length = max_len;
- dirs[max_idx].nbytes = 0;
- dirs[max_idx].count = 0;
- dirs[max_idx].dir_idx = ndirs;
- dirs[max_idx].used = 0;
- dirs[max_idx].prefix = dirs[ndirs].prefix;
-
- dirs[ndirs - 1].prefix = dirs[ndirs].prefix = max_idx;
- }
- else
- dirs[ndirs].prefix = -1;
+ if (dirs[j].length < dirs[ndirs].length
+ && dirs[j].length > 1
+ && (dirs[ndirs].prefix == -1
+ || dirs[j].length > dirs[dirs[ndirs].prefix].length)
+ && memcmp (dirs[j].path, dirs[ndirs].path, dirs[j].length) == 0)
+ dirs[ndirs].prefix = j;
++ndirs;
}
@@ -6856,7 +6323,7 @@ output_file_names ()
int j;
int total;
- /* We can always safe some space for the current directory. But
+ /* We can always save some space for the current directory. But
this does not mean it will be enough to justify adding the
directory. */
savehere[i] = dirs[i].length;
@@ -6872,18 +6339,18 @@ output_file_names ()
dirs[j] path. */
int k;
- k = dirs[j].prefix;
- while (k != -1 && k != i)
- k = dirs[k].prefix;
-
- if (k == i)
- {
- /* Yes it is. We can possibly safe some memory but
- writing the filenames in dirs[j] relative to
- dirs[i]. */
- savehere[j] = dirs[i].length;
- total += (savehere[j] - saved[j]) * dirs[j].count;
- }
+ k = dirs[j].prefix;
+ while (k != -1 && k != i)
+ k = dirs[k].prefix;
+
+ if (k == i)
+ {
+ /* Yes it is. We can possibly safe some memory but
+ writing the filenames in dirs[j] relative to
+ dirs[i]. */
+ savehere[j] = dirs[i].length;
+ total += (savehere[j] - saved[j]) * dirs[j].count;
+ }
}
}
@@ -6891,7 +6358,7 @@ output_file_names ()
directory. */
if (total > dirs[i].length + 1)
{
- /* It's worthwhile adding. */
+ /* It's worthwhile adding. */
for (j = i; j < ndirs; ++j)
if (savehere[j] > 0)
{
@@ -6904,12 +6371,12 @@ output_file_names ()
}
}
- /* We have to emit them in the order they appear in the line_file_table
+ /* We have to emit them in the order they appear in the file_table
array since the index is used in the debug info generation. To
do this efficiently we generate a back-mapping of the indices
first. */
- backmap = (int *) alloca (line_file_table.in_use * sizeof (int));
- for (i = 1; i < (int) line_file_table.in_use; ++i)
+ backmap = (int *) alloca (file_table.in_use * sizeof (int));
+ for (i = 1; i < (int) file_table.in_use; ++i)
{
backmap[files[i].file_idx] = i;
/* Mark this directory as used. */
@@ -6928,69 +6395,35 @@ output_file_names ()
if (dirs[i].used != 0)
{
dirs[i].used = idx++;
-
- if (flag_debug_asm)
- {
- ASM_OUTPUT_DWARF_NSTRING (asm_out_file,
- dirs[i].path, dirs[i].length - 1);
- fprintf (asm_out_file, "%s Directory Entry: 0x%x\n",
- ASM_COMMENT_START, dirs[i].used);
- }
- else
- {
- ASM_OUTPUT_ASCII (asm_out_file, dirs[i].path, dirs[i].length - 1);
- ASM_OUTPUT_DWARF_DATA1 (asm_out_file, 0);
- fputc ('\n', asm_out_file);
- }
+ dw2_asm_output_nstring (dirs[i].path, dirs[i].length - 1,
+ "Directory Entry: 0x%x", dirs[i].used);
}
+ dw2_asm_output_data (1, 0, "End directory table");
+
/* Correct the index for the current working directory entry if it
exists. */
if (idx_offset == 0)
dirs[0].used = 0;
- /* Terminate the directory name array. */
- ASM_OUTPUT_DWARF_DATA1 (asm_out_file, 0);
- if (flag_debug_asm)
- fprintf (asm_out_file, "\t%s End directory table", ASM_COMMENT_START);
- fputc ('\n', asm_out_file);
/* Now write all the file names. */
- for (i = 1; i < (int) line_file_table.in_use; ++i)
+ for (i = 1; i < (int) file_table.in_use; ++i)
{
int file_idx = backmap[i];
int dir_idx = dirs[files[file_idx].dir_idx].dir_idx;
- if (flag_debug_asm)
- {
- ASM_OUTPUT_DWARF_STRING (asm_out_file,
- files[file_idx].path
- + dirs[dir_idx].length);
- fprintf (asm_out_file, "%s File Entry: 0x%x\n",
- ASM_COMMENT_START, i);
- }
- else
- ASM_OUTPUT_ASCII (asm_out_file,
- files[file_idx].path + dirs[dir_idx].length,
- (files[file_idx].length
- - dirs[dir_idx].length) + 1);
+ dw2_asm_output_nstring (files[file_idx].path + dirs[dir_idx].length, -1,
+ "File Entry: 0x%x", i);
/* Include directory index. */
- output_uleb128 (dirs[dir_idx].used);
- fputc ('\n', asm_out_file);
+ dw2_asm_output_data_uleb128 (dirs[dir_idx].used, NULL);
/* Modification time. */
- output_uleb128 (0);
- fputc ('\n', asm_out_file);
+ dw2_asm_output_data_uleb128 (0, NULL);
/* File length in bytes. */
- output_uleb128 (0);
- fputc ('\n', asm_out_file);
+ dw2_asm_output_data_uleb128 (0, NULL);
}
-
- /* Terminate the file name table */
- ASM_OUTPUT_DWARF_DATA1 (asm_out_file, 0);
- if (flag_debug_asm)
- fprintf (asm_out_file, "\t%s End file name table", ASM_COMMENT_START);
- fputc ('\n', asm_out_file);
+ dw2_asm_output_data (1, 0, "End file name table");
}
@@ -7000,6 +6433,7 @@ output_file_names ()
static void
output_line_info ()
{
+ char l1[20], l2[20], p1[20], p2[20];
char line_label[MAX_ARTIFICIAL_LABEL_BYTES];
char prev_line_label[MAX_ARTIFICIAL_LABEL_BYTES];
register unsigned opc;
@@ -7011,52 +6445,35 @@ output_line_info ()
register unsigned long current_file;
register unsigned long function;
- ASM_OUTPUT_DWARF_DELTA (asm_out_file, ".LTEND", ".LTSTART");
- if (flag_debug_asm)
- fprintf (asm_out_file, "\t%s Length of Source Line Info.",
- ASM_COMMENT_START);
+ ASM_GENERATE_INTERNAL_LABEL (l1, LINE_NUMBER_BEGIN_LABEL, 0);
+ ASM_GENERATE_INTERNAL_LABEL (l2, LINE_NUMBER_END_LABEL, 0);
+ ASM_GENERATE_INTERNAL_LABEL (p1, LN_PROLOG_AS_LABEL, 0);
+ ASM_GENERATE_INTERNAL_LABEL (p2, LN_PROLOG_END_LABEL, 0);
- fputc ('\n', asm_out_file);
- ASM_OUTPUT_LABEL (asm_out_file, ".LTSTART");
- ASM_OUTPUT_DWARF_DATA2 (asm_out_file, DWARF_VERSION);
- if (flag_debug_asm)
- fprintf (asm_out_file, "\t%s DWARF Version", ASM_COMMENT_START);
+ dw2_asm_output_delta (DWARF_OFFSET_SIZE, l2, l1,
+ "Length of Source Line Info");
+ ASM_OUTPUT_LABEL (asm_out_file, l1);
- fputc ('\n', asm_out_file);
- ASM_OUTPUT_DWARF_DATA (asm_out_file, size_of_line_prolog ());
- if (flag_debug_asm)
- fprintf (asm_out_file, "\t%s Prolog Length", ASM_COMMENT_START);
+ dw2_asm_output_data (2, DWARF_VERSION, "DWARF Version");
- fputc ('\n', asm_out_file);
- ASM_OUTPUT_DWARF_DATA1 (asm_out_file, DWARF_LINE_MIN_INSTR_LENGTH);
- if (flag_debug_asm)
- fprintf (asm_out_file, "\t%s Minimum Instruction Length",
- ASM_COMMENT_START);
+ dw2_asm_output_delta (DWARF_OFFSET_SIZE, p2, p1, "Prolog Length");
+ ASM_OUTPUT_LABEL (asm_out_file, p1);
- fputc ('\n', asm_out_file);
- ASM_OUTPUT_DWARF_DATA1 (asm_out_file, DWARF_LINE_DEFAULT_IS_STMT_START);
- if (flag_debug_asm)
- fprintf (asm_out_file, "\t%s Default is_stmt_start flag",
- ASM_COMMENT_START);
+ dw2_asm_output_data (1, DWARF_LINE_MIN_INSTR_LENGTH,
+ "Minimum Instruction Length");
- fputc ('\n', asm_out_file);
- fprintf (asm_out_file, "%s%d", ASM_BYTE_OP, DWARF_LINE_BASE);
- if (flag_debug_asm)
- fprintf (asm_out_file, "\t%s Line Base Value (Special Opcodes)",
- ASM_COMMENT_START);
+ dw2_asm_output_data (1, DWARF_LINE_DEFAULT_IS_STMT_START,
+ "Default is_stmt_start flag");
- fputc ('\n', asm_out_file);
- fprintf (asm_out_file, "%s%u", ASM_BYTE_OP, DWARF_LINE_RANGE);
- if (flag_debug_asm)
- fprintf (asm_out_file, "\t%s Line Range Value (Special Opcodes)",
- ASM_COMMENT_START);
+ dw2_asm_output_data (1, DWARF_LINE_BASE,
+ "Line Base Value (Special Opcodes)");
- fputc ('\n', asm_out_file);
- fprintf (asm_out_file, "%s%u", ASM_BYTE_OP, DWARF_LINE_OPCODE_BASE);
- if (flag_debug_asm)
- fprintf (asm_out_file, "\t%s Special Opcode Base", ASM_COMMENT_START);
+ dw2_asm_output_data (1, DWARF_LINE_RANGE,
+ "Line Range Value (Special Opcodes)");
+
+ dw2_asm_output_data (1, DWARF_LINE_OPCODE_BASE,
+ "Special Opcode Base");
- fputc ('\n', asm_out_file);
for (opc = 1; opc < DWARF_LINE_OPCODE_BASE; ++opc)
{
switch (opc)
@@ -7072,15 +6489,14 @@ output_line_info ()
n_op_args = 0;
break;
}
- ASM_OUTPUT_DWARF_DATA1 (asm_out_file, n_op_args);
- if (flag_debug_asm)
- fprintf (asm_out_file, "\t%s opcode: 0x%x has %d args",
- ASM_COMMENT_START, opc, n_op_args);
- fputc ('\n', asm_out_file);
+
+ dw2_asm_output_data (1, n_op_args, "opcode: 0x%x has %d args",
+ opc, n_op_args);
}
/* Write out the information about the files we use. */
output_file_names ();
+ ASM_OUTPUT_LABEL (asm_out_file, p2);
/* We used to set the address register to the first location in the text
section here, but that didn't accomplish anything since we already
@@ -7108,44 +6524,31 @@ output_line_info ()
continue;
#endif
- /* Emit debug info for the address of the current line, choosing
- the encoding that uses the least amount of space. */
- /* ??? Unfortunately, we have little choice here currently, and must
- always use the most general form. Gcc does not know the address
- delta itself, so we can't use DW_LNS_advance_pc. There are no known
- dwarf2 aware assemblers at this time, so we can't use any special
- pseudo ops that would allow the assembler to optimally encode this for
- us. Many ports do have length attributes which will give an upper
- bound on the address range. We could perhaps use length attributes
- to determine when it is safe to use DW_LNS_fixed_advance_pc. */
+ /* Emit debug info for the address of the current line.
+
+ Unfortunately, we have little choice here currently, and must always
+ use the most general form. Gcc does not know the address delta
+ itself, so we can't use DW_LNS_advance_pc. Many ports do have length
+ attributes which will give an upper bound on the address range. We
+ could perhaps use length attributes to determine when it is safe to
+ use DW_LNS_fixed_advance_pc. */
+
ASM_GENERATE_INTERNAL_LABEL (line_label, LINE_CODE_LABEL, lt_index);
if (0)
{
/* This can handle deltas up to 0xffff. This takes 3 bytes. */
- ASM_OUTPUT_DWARF_DATA1 (asm_out_file, DW_LNS_fixed_advance_pc);
- if (flag_debug_asm)
- fprintf (asm_out_file, "\t%s DW_LNS_fixed_advance_pc",
- ASM_COMMENT_START);
-
- fputc ('\n', asm_out_file);
- ASM_OUTPUT_DWARF_DELTA2 (asm_out_file, line_label, prev_line_label);
- fputc ('\n', asm_out_file);
+ dw2_asm_output_data (1, DW_LNS_fixed_advance_pc,
+ "DW_LNS_fixed_advance_pc");
+ dw2_asm_output_delta (2, line_label, prev_line_label, NULL);
}
else
{
/* This can handle any delta. This takes
4+DWARF2_ADDR_SIZE bytes. */
- ASM_OUTPUT_DWARF_DATA1 (asm_out_file, 0);
- if (flag_debug_asm)
- fprintf (asm_out_file, "\t%s DW_LNE_set_address",
- ASM_COMMENT_START);
- fputc ('\n', asm_out_file);
- output_uleb128 (1 + DWARF2_ADDR_SIZE);
- fputc ('\n', asm_out_file);
- ASM_OUTPUT_DWARF_DATA1 (asm_out_file, DW_LNE_set_address);
- fputc ('\n', asm_out_file);
- ASM_OUTPUT_DWARF_ADDR (asm_out_file, line_label);
- fputc ('\n', asm_out_file);
+ dw2_asm_output_data (1, 0, "DW_LNE_set_address");
+ dw2_asm_output_data_uleb128 (1 + DWARF2_ADDR_SIZE, NULL);
+ dw2_asm_output_data (1, DW_LNE_set_address, NULL);
+ dw2_asm_output_addr (DWARF2_ADDR_SIZE, line_label, NULL);
}
strcpy (prev_line_label, line_label);
@@ -7154,17 +6557,9 @@ output_line_info ()
if (line_info->dw_file_num != current_file)
{
current_file = line_info->dw_file_num;
- ASM_OUTPUT_DWARF_DATA1 (asm_out_file, DW_LNS_set_file);
- if (flag_debug_asm)
- fprintf (asm_out_file, "\t%s DW_LNS_set_file", ASM_COMMENT_START);
-
- fputc ('\n', asm_out_file);
- output_uleb128 (current_file);
- if (flag_debug_asm)
- fprintf (asm_out_file, " (\"%s\")",
- line_file_table.table[current_file]);
-
- fputc ('\n', asm_out_file);
+ dw2_asm_output_data (1, DW_LNS_set_file, "DW_LNS_set_file");
+ dw2_asm_output_data_uleb128 (current_file, "(\"%s\")",
+ file_table.table[current_file]);
}
/* Emit debug info for the current line number, choosing the encoding
@@ -7179,77 +6574,44 @@ output_line_info ()
/* This can handle deltas from -10 to 234, using the current
definitions of DWARF_LINE_BASE and DWARF_LINE_RANGE. This
takes 1 byte. */
- ASM_OUTPUT_DWARF_DATA1 (asm_out_file,
- DWARF_LINE_OPCODE_BASE + line_delta);
- if (flag_debug_asm)
- fprintf (asm_out_file,
- "\t%s line %ld", ASM_COMMENT_START, current_line);
-
- fputc ('\n', asm_out_file);
+ dw2_asm_output_data (1, DWARF_LINE_OPCODE_BASE + line_delta,
+ "line %lu", current_line);
}
else
{
/* This can handle any delta. This takes at least 4 bytes,
depending on the value being encoded. */
- ASM_OUTPUT_DWARF_DATA1 (asm_out_file, DW_LNS_advance_line);
- if (flag_debug_asm)
- fprintf (asm_out_file, "\t%s advance to line %ld",
- ASM_COMMENT_START, current_line);
-
- fputc ('\n', asm_out_file);
- output_sleb128 (line_offset);
- fputc ('\n', asm_out_file);
- ASM_OUTPUT_DWARF_DATA1 (asm_out_file, DW_LNS_copy);
- if (flag_debug_asm)
- fprintf (asm_out_file, "\t%s DW_LNS_copy", ASM_COMMENT_START);
- fputc ('\n', asm_out_file);
+ dw2_asm_output_data (1, DW_LNS_advance_line,
+ "advance to line %lu", current_line);
+ dw2_asm_output_data_sleb128 (line_offset, NULL);
+ dw2_asm_output_data (1, DW_LNS_copy, "DW_LNS_copy");
}
}
else
{
/* We still need to start a new row, so output a copy insn. */
- ASM_OUTPUT_DWARF_DATA1 (asm_out_file, DW_LNS_copy);
- if (flag_debug_asm)
- fprintf (asm_out_file, "\t%s DW_LNS_copy", ASM_COMMENT_START);
- fputc ('\n', asm_out_file);
+ dw2_asm_output_data (1, DW_LNS_copy, "DW_LNS_copy");
}
}
/* Emit debug info for the address of the end of the function. */
if (0)
{
- ASM_OUTPUT_DWARF_DATA1 (asm_out_file, DW_LNS_fixed_advance_pc);
- if (flag_debug_asm)
- fprintf (asm_out_file, "\t%s DW_LNS_fixed_advance_pc",
- ASM_COMMENT_START);
-
- fputc ('\n', asm_out_file);
- ASM_OUTPUT_DWARF_DELTA2 (asm_out_file, text_end_label, prev_line_label);
- fputc ('\n', asm_out_file);
+ dw2_asm_output_data (1, DW_LNS_fixed_advance_pc,
+ "DW_LNS_fixed_advance_pc");
+ dw2_asm_output_delta (2, text_end_label, prev_line_label, NULL);
}
else
{
- ASM_OUTPUT_DWARF_DATA1 (asm_out_file, 0);
- if (flag_debug_asm)
- fprintf (asm_out_file, "\t%s DW_LNE_set_address", ASM_COMMENT_START);
- fputc ('\n', asm_out_file);
- output_uleb128 (1 + DWARF2_ADDR_SIZE);
- fputc ('\n', asm_out_file);
- ASM_OUTPUT_DWARF_DATA1 (asm_out_file, DW_LNE_set_address);
- fputc ('\n', asm_out_file);
- ASM_OUTPUT_DWARF_ADDR (asm_out_file, text_end_label);
- fputc ('\n', asm_out_file);
+ dw2_asm_output_data (1, 0, "DW_LNE_set_address");
+ dw2_asm_output_data_uleb128 (1 + DWARF2_ADDR_SIZE, NULL);
+ dw2_asm_output_data (1, DW_LNE_set_address, NULL);
+ dw2_asm_output_addr (DWARF2_ADDR_SIZE, text_end_label, NULL);
}
- ASM_OUTPUT_DWARF_DATA1 (asm_out_file, 0);
- if (flag_debug_asm)
- fprintf (asm_out_file, "\t%s DW_LNE_end_sequence", ASM_COMMENT_START);
-
- fputc ('\n', asm_out_file);
- output_uleb128 (1);
- fputc ('\n', asm_out_file);
- ASM_OUTPUT_DWARF_DATA1 (asm_out_file, DW_LNE_end_sequence);
- fputc ('\n', asm_out_file);
+ dw2_asm_output_data (1, 0, "DW_LNE_end_sequence");
+ dw2_asm_output_data_uleb128 (1, NULL);
+ dw2_asm_output_data (1, DW_LNE_end_sequence, NULL);
function = 0;
current_file = 1;
@@ -7277,47 +6639,26 @@ output_line_info ()
function = line_info->function;
/* Set the address register to the first line in the function */
- ASM_OUTPUT_DWARF_DATA1 (asm_out_file, 0);
- if (flag_debug_asm)
- fprintf (asm_out_file, "\t%s DW_LNE_set_address",
- ASM_COMMENT_START);
-
- fputc ('\n', asm_out_file);
- output_uleb128 (1 + DWARF2_ADDR_SIZE);
- fputc ('\n', asm_out_file);
- ASM_OUTPUT_DWARF_DATA1 (asm_out_file, DW_LNE_set_address);
- fputc ('\n', asm_out_file);
- ASM_OUTPUT_DWARF_ADDR (asm_out_file, line_label);
- fputc ('\n', asm_out_file);
+ dw2_asm_output_data (1, 0, "DW_LNE_set_address");
+ dw2_asm_output_data_uleb128 (1 + DWARF2_ADDR_SIZE, NULL);
+ dw2_asm_output_data (1, DW_LNE_set_address, NULL);
+ dw2_asm_output_addr (DWARF2_ADDR_SIZE, line_label, NULL);
}
else
{
/* ??? See the DW_LNS_advance_pc comment above. */
if (0)
{
- ASM_OUTPUT_DWARF_DATA1 (asm_out_file, DW_LNS_fixed_advance_pc);
- if (flag_debug_asm)
- fprintf (asm_out_file, "\t%s DW_LNS_fixed_advance_pc",
- ASM_COMMENT_START);
-
- fputc ('\n', asm_out_file);
- ASM_OUTPUT_DWARF_DELTA2 (asm_out_file, line_label,
- prev_line_label);
- fputc ('\n', asm_out_file);
+ dw2_asm_output_data (1, DW_LNS_fixed_advance_pc,
+ "DW_LNS_fixed_advance_pc");
+ dw2_asm_output_delta (2, line_label, prev_line_label, NULL);
}
else
{
- ASM_OUTPUT_DWARF_DATA1 (asm_out_file, 0);
- if (flag_debug_asm)
- fprintf (asm_out_file, "\t%s DW_LNE_set_address",
- ASM_COMMENT_START);
- fputc ('\n', asm_out_file);
- output_uleb128 (1 + DWARF2_ADDR_SIZE);
- fputc ('\n', asm_out_file);
- ASM_OUTPUT_DWARF_DATA1 (asm_out_file, DW_LNE_set_address);
- fputc ('\n', asm_out_file);
- ASM_OUTPUT_DWARF_ADDR (asm_out_file, line_label);
- fputc ('\n', asm_out_file);
+ dw2_asm_output_data (1, 0, "DW_LNE_set_address");
+ dw2_asm_output_data_uleb128 (1 + DWARF2_ADDR_SIZE, NULL);
+ dw2_asm_output_data (1, DW_LNE_set_address, NULL);
+ dw2_asm_output_addr (DWARF2_ADDR_SIZE, line_label, NULL);
}
}
strcpy (prev_line_label, line_label);
@@ -7327,17 +6668,9 @@ output_line_info ()
if (line_info->dw_file_num != current_file)
{
current_file = line_info->dw_file_num;
- ASM_OUTPUT_DWARF_DATA1 (asm_out_file, DW_LNS_set_file);
- if (flag_debug_asm)
- fprintf (asm_out_file, "\t%s DW_LNS_set_file", ASM_COMMENT_START);
-
- fputc ('\n', asm_out_file);
- output_uleb128 (current_file);
- if (flag_debug_asm)
- fprintf (asm_out_file, " (\"%s\")",
- line_file_table.table[current_file]);
-
- fputc ('\n', asm_out_file);
+ dw2_asm_output_data (1, DW_LNS_set_file, "DW_LNS_set_file");
+ dw2_asm_output_data_uleb128 (current_file, "(\"%s\")",
+ file_table.table[current_file]);
}
/* Emit debug info for the current line number, choosing the encoding
@@ -7348,39 +6681,18 @@ output_line_info ()
line_delta = line_offset - DWARF_LINE_BASE;
current_line = line_info->dw_line_num;
if (line_delta >= 0 && line_delta < (DWARF_LINE_RANGE - 1))
- {
- ASM_OUTPUT_DWARF_DATA1 (asm_out_file,
- DWARF_LINE_OPCODE_BASE + line_delta);
- if (flag_debug_asm)
- fprintf (asm_out_file,
- "\t%s line %ld", ASM_COMMENT_START, current_line);
-
- fputc ('\n', asm_out_file);
- }
+ dw2_asm_output_data (1, DWARF_LINE_OPCODE_BASE + line_delta,
+ "line %lu", current_line);
else
{
- ASM_OUTPUT_DWARF_DATA1 (asm_out_file, DW_LNS_advance_line);
- if (flag_debug_asm)
- fprintf (asm_out_file, "\t%s advance to line %ld",
- ASM_COMMENT_START, current_line);
-
- fputc ('\n', asm_out_file);
- output_sleb128 (line_offset);
- fputc ('\n', asm_out_file);
- ASM_OUTPUT_DWARF_DATA1 (asm_out_file, DW_LNS_copy);
- if (flag_debug_asm)
- fprintf (asm_out_file, "\t%s DW_LNS_copy", ASM_COMMENT_START);
- fputc ('\n', asm_out_file);
+ dw2_asm_output_data (1, DW_LNS_advance_line,
+ "advance to line %lu", current_line);
+ dw2_asm_output_data_sleb128 (line_offset, NULL);
+ dw2_asm_output_data (1, DW_LNS_copy, "DW_LNS_copy");
}
}
else
- {
- /* We still need to start a new row, so output a copy insn. */
- ASM_OUTPUT_DWARF_DATA1 (asm_out_file, DW_LNS_copy);
- if (flag_debug_asm)
- fprintf (asm_out_file, "\t%s DW_LNS_copy", ASM_COMMENT_START);
- fputc ('\n', asm_out_file);
- }
+ dw2_asm_output_data (1, DW_LNS_copy, "DW_LNS_copy");
#if 0
cont:
@@ -7398,47 +6710,27 @@ output_line_info ()
ASM_GENERATE_INTERNAL_LABEL (line_label, FUNC_END_LABEL, function);
if (0)
{
- ASM_OUTPUT_DWARF_DATA1 (asm_out_file, DW_LNS_fixed_advance_pc);
- if (flag_debug_asm)
- fprintf (asm_out_file, "\t%s DW_LNS_fixed_advance_pc",
- ASM_COMMENT_START);
-
- fputc ('\n', asm_out_file);
- ASM_OUTPUT_DWARF_DELTA2 (asm_out_file, line_label,
- prev_line_label);
- fputc ('\n', asm_out_file);
+ dw2_asm_output_data (1, DW_LNS_fixed_advance_pc,
+ "DW_LNS_fixed_advance_pc");
+ dw2_asm_output_delta (2, line_label, prev_line_label, NULL);
}
else
{
- ASM_OUTPUT_DWARF_DATA1 (asm_out_file, 0);
- if (flag_debug_asm)
- fprintf (asm_out_file, "\t%s DW_LNE_set_address",
- ASM_COMMENT_START);
- fputc ('\n', asm_out_file);
- output_uleb128 (1 + DWARF2_ADDR_SIZE);
- fputc ('\n', asm_out_file);
- ASM_OUTPUT_DWARF_DATA1 (asm_out_file, DW_LNE_set_address);
- fputc ('\n', asm_out_file);
- ASM_OUTPUT_DWARF_ADDR (asm_out_file, line_label);
- fputc ('\n', asm_out_file);
+ dw2_asm_output_data (1, 0, "DW_LNE_set_address");
+ dw2_asm_output_data_uleb128 (1 + DWARF2_ADDR_SIZE, NULL);
+ dw2_asm_output_data (1, DW_LNE_set_address, NULL);
+ dw2_asm_output_addr (DWARF2_ADDR_SIZE, line_label, NULL);
}
/* Output the marker for the end of this sequence. */
- ASM_OUTPUT_DWARF_DATA1 (asm_out_file, 0);
- if (flag_debug_asm)
- fprintf (asm_out_file, "\t%s DW_LNE_end_sequence",
- ASM_COMMENT_START);
-
- fputc ('\n', asm_out_file);
- output_uleb128 (1);
- fputc ('\n', asm_out_file);
- ASM_OUTPUT_DWARF_DATA1 (asm_out_file, DW_LNE_end_sequence);
- fputc ('\n', asm_out_file);
+ dw2_asm_output_data (1, 0, "DW_LNE_end_sequence");
+ dw2_asm_output_data_uleb128 (1, NULL);
+ dw2_asm_output_data (1, DW_LNE_end_sequence, NULL);
}
}
/* Output the marker for the end of the line number info. */
- ASM_OUTPUT_LABEL (asm_out_file, ".LTEND");
+ ASM_OUTPUT_LABEL (asm_out_file, l2);
}
/* Given a pointer to a tree node for some base type, return a pointer to
@@ -7620,22 +6912,35 @@ modified_type_die (type, is_const_type, is_volatile_type, context_die)
if (code != ERROR_MARK)
{
- type = build_type_variant (type, is_const_type, is_volatile_type);
-
- mod_type_die = lookup_type_die (type);
- if (mod_type_die)
- return mod_type_die;
+ tree qualified_type;
+
+ /* See if we already have the appropriately qualified variant of
+ this type. */
+ qualified_type
+ = get_qualified_type (type,
+ ((is_const_type ? TYPE_QUAL_CONST : 0)
+ | (is_volatile_type
+ ? TYPE_QUAL_VOLATILE : 0)));
+ /* If we do, then we can just use its DIE, if it exists. */
+ if (qualified_type)
+ {
+ mod_type_die = lookup_type_die (qualified_type);
+ if (mod_type_die)
+ return mod_type_die;
+ }
/* Handle C typedef types. */
- if (TYPE_NAME (type) && TREE_CODE (TYPE_NAME (type)) == TYPE_DECL
- && DECL_ORIGINAL_TYPE (TYPE_NAME (type)))
+ if (qualified_type && TYPE_NAME (qualified_type)
+ && TREE_CODE (TYPE_NAME (qualified_type)) == TYPE_DECL
+ && DECL_ORIGINAL_TYPE (TYPE_NAME (qualified_type)))
{
- tree dtype = TREE_TYPE (TYPE_NAME (type));
- if (type == dtype)
+ tree type_name = TYPE_NAME (qualified_type);
+ tree dtype = TREE_TYPE (type_name);
+ if (qualified_type == dtype)
{
/* For a named type, use the typedef. */
- gen_type_die (type, context_die);
- mod_type_die = lookup_type_die (type);
+ gen_type_die (qualified_type, context_die);
+ mod_type_die = lookup_type_die (qualified_type);
}
else if (is_const_type < TYPE_READONLY (dtype)
@@ -7643,7 +6948,7 @@ modified_type_die (type, is_const_type, is_volatile_type, context_die)
/* cv-unqualified version of named type. Just use the unnamed
type to which it refers. */
mod_type_die
- = modified_type_die (DECL_ORIGINAL_TYPE (TYPE_NAME (type)),
+ = modified_type_die (DECL_ORIGINAL_TYPE (type_name),
is_const_type, is_volatile_type,
context_die);
/* Else cv-qualified version of named type; fall through. */
@@ -7696,6 +7001,10 @@ modified_type_die (type, is_const_type, is_volatile_type, context_die)
if (mod_type_die == NULL)
abort ();
}
+
+ /* We want to equate the qualified type to the die below. */
+ if (qualified_type)
+ type = qualified_type;
}
equate_type_number_to_die (type, mod_type_die);
@@ -7880,7 +7189,7 @@ mem_loc_descriptor (rtl, mode)
up an entire register. For now, just assume that it is
legitimate to make the Dwarf info refer to the whole register which
contains the given subreg. */
- rtl = XEXP (rtl, 0);
+ rtl = SUBREG_REG (rtl);
/* Fall through. */
@@ -7912,6 +7221,18 @@ mem_loc_descriptor (rtl, mode)
pool. */
case CONST:
case SYMBOL_REF:
+ /* Alternatively, the symbol in the constant pool can be referenced
+ by a different symbol. */
+ if (GET_CODE (rtl) == SYMBOL_REF
+ && CONSTANT_POOL_ADDRESS_P (rtl))
+ {
+ rtx tmp = get_pool_constant (rtl);
+ /* Doesn't work for floating point constants. */
+ if (! (GET_CODE (tmp) == CONST_DOUBLE && GET_MODE (tmp) != VOIDmode))
+ rtl = tmp;
+ }
+
+
mem_loc_result = new_loc_descr (DW_OP_addr, 0, 0);
mem_loc_result->dw_loc_oprnd1.val_class = dw_val_class_addr;
mem_loc_result->dw_loc_oprnd1.v.val_addr = save_rtx (rtl);
@@ -7919,7 +7240,7 @@ mem_loc_descriptor (rtl, mode)
case PRE_MODIFY:
/* Extract the PLUS expression nested inside and fall into
- PLUS code bellow. */
+ PLUS code below. */
rtl = XEXP (rtl, 1);
goto plus;
@@ -8024,7 +7345,7 @@ loc_descriptor (rtl)
up an entire register. For now, just assume that it is
legitimate to make the Dwarf info refer to the whole register which
contains the given subreg. */
- rtl = XEXP (rtl, 0);
+ rtl = SUBREG_REG (rtl);
/* Fall through. */
@@ -8576,28 +7897,70 @@ add_data_member_location_attribute (die, decl)
register dw_die_ref die;
register tree decl;
{
- register unsigned long offset;
- register dw_loc_descr_ref loc_descr;
- register enum dwarf_location_atom op;
+ long offset;
+ dw_loc_descr_ref loc_descr = 0;
if (TREE_CODE (decl) == TREE_VEC)
- offset = tree_low_cst (BINFO_OFFSET (decl), 0);
+ {
+ /* We're working on the TAG_inheritance for a base class. */
+
+ if (TREE_VIA_VIRTUAL (decl) && is_cxx ())
+ {
+ /* For C++ virtual bases we can't just use BINFO_OFFSET, as they
+ aren't at a fixed offset from all (sub)objects of the same
+ type. We need to extract the appropriate offset from our
+ vtable. The following dwarf expression means
+
+ BaseAddr = ObAddr + *((*ObAddr) - Offset)
+
+ This is specific to the V3 ABI, of course. */
+
+ dw_loc_descr_ref tmp;
+ /* Make a copy of the object address. */
+ tmp = new_loc_descr (DW_OP_dup, 0, 0);
+ add_loc_descr (&loc_descr, tmp);
+ /* Extract the vtable address. */
+ tmp = new_loc_descr (DW_OP_deref, 0, 0);
+ add_loc_descr (&loc_descr, tmp);
+ /* Calculate the address of the offset. */
+ offset = tree_low_cst (BINFO_VPTR_FIELD (decl), 0);
+ if (offset >= 0)
+ abort ();
+ tmp = int_loc_descriptor (-offset);
+ add_loc_descr (&loc_descr, tmp);
+ tmp = new_loc_descr (DW_OP_minus, 0, 0);
+ add_loc_descr (&loc_descr, tmp);
+ /* Extract the offset. */
+ tmp = new_loc_descr (DW_OP_deref, 0, 0);
+ add_loc_descr (&loc_descr, tmp);
+ /* Add it to the object address. */
+ tmp = new_loc_descr (DW_OP_plus, 0, 0);
+ add_loc_descr (&loc_descr, tmp);
+ }
+ else
+ offset = tree_low_cst (BINFO_OFFSET (decl), 0);
+ }
else
offset = field_byte_offset (decl);
- /* The DWARF2 standard says that we should assume that the structure address
- is already on the stack, so we can specify a structure field address
- by using DW_OP_plus_uconst. */
+ if (! loc_descr)
+ {
+ enum dwarf_location_atom op;
+
+ /* The DWARF2 standard says that we should assume that the structure address
+ is already on the stack, so we can specify a structure field address
+ by using DW_OP_plus_uconst. */
#ifdef MIPS_DEBUGGING_INFO
- /* ??? The SGI dwarf reader does not handle the DW_OP_plus_uconst operator
- correctly. It works only if we leave the offset on the stack. */
- op = DW_OP_constu;
+ /* ??? The SGI dwarf reader does not handle the DW_OP_plus_uconst operator
+ correctly. It works only if we leave the offset on the stack. */
+ op = DW_OP_constu;
#else
- op = DW_OP_plus_uconst;
+ op = DW_OP_plus_uconst;
#endif
- loc_descr = new_loc_descr (op, offset, 0);
+ loc_descr = new_loc_descr (op, offset, 0);
+ }
add_AT_loc (die, DW_AT_data_member_location, loc_descr);
}
@@ -8615,12 +7978,28 @@ add_const_value_attribute (die, rtl)
switch (GET_CODE (rtl))
{
case CONST_INT:
- /* Note that a CONST_INT rtx could represent either an integer or a
- floating-point constant. A CONST_INT is used whenever the constant
- will fit into a single word. In all such cases, the original mode
- of the constant value is wiped out, and the CONST_INT rtx is
- assigned VOIDmode. */
- add_AT_unsigned (die, DW_AT_const_value, (unsigned) INTVAL (rtl));
+ /* Note that a CONST_INT rtx could represent either an integer
+ or a floating-point constant. A CONST_INT is used whenever
+ the constant will fit into a single word. In all such
+ cases, the original mode of the constant value is wiped
+ out, and the CONST_INT rtx is assigned VOIDmode. */
+ {
+ HOST_WIDE_INT val = INTVAL (rtl);
+
+ /* ??? We really should be using HOST_WIDE_INT throughout. */
+ if (val < 0)
+ {
+ if ((long) val != val)
+ abort ();
+ add_AT_int (die, DW_AT_const_value, (long) val);
+ }
+ else
+ {
+ if ((unsigned long) val != (unsigned HOST_WIDE_INT) val)
+ abort ();
+ add_AT_int (die, DW_AT_const_value, (unsigned long) val);
+ }
+ }
break;
case CONST_DOUBLE:
@@ -8660,8 +8039,13 @@ add_const_value_attribute (die, rtl)
add_AT_float (die, DW_AT_const_value, length, array);
}
else
- add_AT_long_long (die, DW_AT_const_value,
- CONST_DOUBLE_HIGH (rtl), CONST_DOUBLE_LOW (rtl));
+ {
+ /* ??? We really should be using HOST_WIDE_INT throughout. */
+ if (HOST_BITS_PER_LONG != HOST_BITS_PER_WIDE_INT)
+ abort ();
+ add_AT_long_long (die, DW_AT_const_value,
+ CONST_DOUBLE_HIGH (rtl), CONST_DOUBLE_LOW (rtl));
+ }
}
break;
@@ -8696,12 +8080,22 @@ add_const_value_attribute (die, rtl)
}
+/* Returns RTL for DECL indicating the location the debugger should
+ use to find the value of DECL at runtime. Returns NULL_RTX if
+ there is no such location, or if a satisfactory location could not
+ be determined. */
+
static rtx
rtl_for_decl_location (decl)
tree decl;
{
register rtx rtl;
+ /* This function should not be called with an abstract declaration,
+ since such things have no location. */
+ if (DECL_ABSTRACT (decl))
+ abort ();
+
/* Here we have to decide where we are going to say the parameter "lives"
(as far as the debugger is concerned). We only have a couple of
choices. GCC provides us with DECL_RTL and with DECL_INCOMING_RTL.
@@ -8778,7 +8172,7 @@ rtl_for_decl_location (decl)
gets fixed). */
/* Use DECL_RTL as the "location" unless we find something better. */
- rtl = DECL_RTL (decl);
+ rtl = DECL_RTL_IF_SET (decl);
if (TREE_CODE (decl) == PARM_DECL)
{
@@ -9014,8 +8408,8 @@ add_bound_info (subrange_die, bound_attr, bound)
We assume that a MEM rtx is safe because gcc wouldn't put the
value there unless it was going to be used repeatedly in the
function, i.e. for cleanups. */
- if (! optimize || (SAVE_EXPR_RTL (bound)
- && GET_CODE (SAVE_EXPR_RTL (bound)) == MEM))
+ if (SAVE_EXPR_RTL (bound)
+ && (! optimize || GET_CODE (SAVE_EXPR_RTL (bound)) == MEM))
{
register dw_die_ref ctx = lookup_decl_die (current_function_decl);
register dw_die_ref decl_die = new_die (DW_TAG_variable, ctx);
@@ -9064,6 +8458,16 @@ add_bound_info (subrange_die, bound_attr, bound)
dw_die_ref ctx, decl_die;
dw_loc_descr_ref loc;
+ /* If the CURRENT_FUNCTION_DECL is abstract, then we cannot
+ compute the array bound based on the location of the BOUND,
+ since the BOUND does not really exist. Therefore, we
+ simply omit the bound information.
+
+ Ideally, we would do better, and express the computation in
+ some other way. */
+ if (DECL_ABSTRACT (current_function_decl))
+ break;
+
loc = loc_descriptor_from_tree (bound, 0);
if (loc == NULL)
break;
@@ -9320,7 +8724,7 @@ add_abstract_origin_attribute (die, origin)
fn = TYPE_STUB_DECL (fn);
fn = decl_function_context (fn);
if (fn)
- gen_abstract_function (fn);
+ dwarf2out_abstract_function (fn);
}
if (DECL_P (origin))
@@ -9365,8 +8769,7 @@ add_src_coords_attributes (die, decl)
register dw_die_ref die;
register tree decl;
{
- register unsigned file_index = lookup_filename (&decl_file_table,
- DECL_SOURCE_FILE (decl));
+ register unsigned file_index = lookup_filename (DECL_SOURCE_FILE (decl));
add_AT_unsigned (die, DW_AT_decl_file, file_index);
add_AT_unsigned (die, DW_AT_decl_line, DECL_SOURCE_LINE (decl));
@@ -9391,7 +8794,8 @@ add_name_and_src_coords_attributes (die, decl)
if ((TREE_CODE (decl) == FUNCTION_DECL || TREE_CODE (decl) == VAR_DECL)
&& TREE_PUBLIC (decl)
- && DECL_ASSEMBLER_NAME (decl) != DECL_NAME (decl))
+ && DECL_ASSEMBLER_NAME (decl) != DECL_NAME (decl)
+ && !DECL_ABSTRACT (decl))
add_AT_string (die, DW_AT_MIPS_linkage_name,
IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)));
}
@@ -9403,26 +8807,16 @@ static void
push_decl_scope (scope)
tree scope;
{
- /* Make room in the decl_scope_table, if necessary. */
- if (decl_scope_table_allocated == decl_scope_depth)
- {
- decl_scope_table_allocated += DECL_SCOPE_TABLE_INCREMENT;
- decl_scope_table
- = (tree *) xrealloc (decl_scope_table,
- decl_scope_table_allocated * sizeof (tree));
- }
-
- decl_scope_table[decl_scope_depth] = scope;
- decl_scope_depth++;
+ VARRAY_PUSH_TREE (decl_scope_table, scope);
}
/* Pop a declaration scope. */
static inline void
pop_decl_scope ()
{
- if (decl_scope_depth <= 0)
+ if (VARRAY_ACTIVE_SIZE (decl_scope_table) <= 0)
abort ();
- --decl_scope_depth;
+ VARRAY_POP (decl_scope_table);
}
/* Return the DIE for the scope that immediately contains this type.
@@ -9464,8 +8858,8 @@ scope_die_for (t, context_die)
first we check to see if we're in the middle of emitting it
so we know where the new DIE should go. */
- for (i = decl_scope_depth - 1; i >= 0; --i)
- if (decl_scope_table[i] == containing_scope)
+ for (i = VARRAY_ACTIVE_SIZE (decl_scope_table) - 1; i >= 0; --i)
+ if (VARRAY_TREE (decl_scope_table, i) == containing_scope)
break;
if (i < 0)
@@ -9719,20 +9113,11 @@ gen_entry_point_die (decl, context_die)
#endif
/* Remember a type in the incomplete_types_list. */
-
static void
add_incomplete_type (type)
tree type;
{
- if (incomplete_types == incomplete_types_allocated)
- {
- incomplete_types_allocated += INCOMPLETE_TYPES_INCREMENT;
- incomplete_types_list
- = (tree *) xrealloc (incomplete_types_list,
- sizeof (tree) * incomplete_types_allocated);
- }
-
- incomplete_types_list[incomplete_types++] = type;
+ VARRAY_PUSH_TREE (incomplete_types, type);
}
/* Walk through the list of incomplete types again, trying once more to
@@ -9741,13 +9126,10 @@ add_incomplete_type (type)
static void
retry_incomplete_types ()
{
- register tree type;
-
- while (incomplete_types)
+ int i;
+ for (i = VARRAY_ACTIVE_SIZE (incomplete_types) - 1; i >= 0; i--)
{
- --incomplete_types;
- type = incomplete_types_list[incomplete_types];
- gen_type_die (type, comp_unit_die);
+ gen_type_die (VARRAY_TREE (incomplete_types, i), comp_unit_die);
}
}
@@ -9937,24 +9319,22 @@ gen_formal_types_die (function_or_method_type, context_die)
{
register tree link;
register tree formal_type = NULL;
- register tree first_parm_type = TYPE_ARG_TYPES (function_or_method_type);
+ register tree first_parm_type;
+ tree arg;
-#if 0
- /* In the case where we are generating a formal types list for a C++
- non-static member function type, skip over the first thing on the
- TYPE_ARG_TYPES list because it only represents the type of the hidden
- `this pointer'. The debugger should be able to figure out (without
- being explicitly told) that this non-static member function type takes a
- `this pointer' and should be able to figure what the type of that hidden
- parameter is from the DW_AT_member attribute of the parent
- DW_TAG_subroutine_type DIE. */
- if (TREE_CODE (function_or_method_type) == METHOD_TYPE)
- first_parm_type = TREE_CHAIN (first_parm_type);
-#endif
+ if (TREE_CODE (function_or_method_type) == FUNCTION_DECL)
+ {
+ arg = DECL_ARGUMENTS (function_or_method_type);
+ function_or_method_type = TREE_TYPE (function_or_method_type);
+ }
+ else
+ arg = NULL_TREE;
+
+ first_parm_type = TYPE_ARG_TYPES (function_or_method_type);
/* Make our first pass over the list of formal parameter types and output a
DW_TAG_formal_parameter DIE for each one. */
- for (link = first_parm_type; link; link = TREE_CHAIN (link))
+ for (link = first_parm_type; link; )
{
register dw_die_ref parm_die;
@@ -9964,9 +9344,14 @@ gen_formal_types_die (function_or_method_type, context_die)
/* Output a (nameless) DIE to represent the formal parameter itself. */
parm_die = gen_formal_parameter_die (formal_type, context_die);
- if (TREE_CODE (function_or_method_type) == METHOD_TYPE
- && link == first_parm_type)
+ if ((TREE_CODE (function_or_method_type) == METHOD_TYPE
+ && link == first_parm_type)
+ || (arg && DECL_ARTIFICIAL (arg)))
add_AT_flag (parm_die, DW_AT_artificial, 1);
+
+ link = TREE_CHAIN (link);
+ if (arg)
+ arg = TREE_CHAIN (arg);
}
/* If this function type has an ellipsis, add a
@@ -10022,23 +9407,41 @@ gen_type_die_for_member (type, member, context_die)
of a function which we may later generate inlined and/or
out-of-line instances of. */
-static void
-gen_abstract_function (decl)
+void
+dwarf2out_abstract_function (decl)
tree decl;
{
- register dw_die_ref old_die = lookup_decl_die (decl);
+ register dw_die_ref old_die;
tree save_fn;
+ tree context;
+ int was_abstract = DECL_ABSTRACT (decl);
+
+ /* Make sure we have the actual abstract inline, not a clone. */
+ decl = DECL_ORIGIN (decl);
+ old_die = lookup_decl_die (decl);
if (old_die && get_AT_unsigned (old_die, DW_AT_inline))
/* We've already generated the abstract instance. */
return;
+ /* Be sure we've emitted the in-class declaration DIE (if any) first, so
+ we don't get confused by DECL_ABSTRACT. */
+ if (debug_info_level > DINFO_LEVEL_TERSE)
+ {
+ context = decl_class_context (decl);
+ if (context)
+ gen_type_die_for_member
+ (context, decl, decl_function_context (decl) ? NULL : comp_unit_die);
+ }
+
+ /* Pretend we've just finished compiling this function. */
save_fn = current_function_decl;
current_function_decl = decl;
set_decl_abstract_flags (decl, 1);
dwarf2out_decl (decl);
- set_decl_abstract_flags (decl, 0);
+ if (! was_abstract)
+ set_decl_abstract_flags (decl, 0);
current_function_decl = save_fn;
}
@@ -10089,23 +9492,15 @@ gen_subprogram_die (decl, context_die)
subr_die = new_die (DW_TAG_subprogram, context_die);
add_abstract_origin_attribute (subr_die, origin);
}
- else if (old_die && DECL_ABSTRACT (decl)
- && get_AT_unsigned (old_die, DW_AT_inline))
- {
- /* This must be a redefinition of an extern inline function.
- We can just reuse the old die here. */
- subr_die = old_die;
-
- /* Clear out the inlined attribute and parm types. */
- remove_AT (subr_die, DW_AT_inline);
- remove_children (subr_die);
- }
else if (old_die)
{
- register unsigned file_index
- = lookup_filename (&decl_file_table, DECL_SOURCE_FILE (decl));
+ unsigned file_index = lookup_filename (DECL_SOURCE_FILE (decl));
- if (get_AT_flag (old_die, DW_AT_declaration) != 1)
+ if (!get_AT_flag (old_die, DW_AT_declaration)
+ /* We can have a normal definition following an inline one in the
+ case of redefinition of GNU C extern inlines.
+ It seems reasonable to use AT_specification in this case. */
+ && !get_AT_unsigned (old_die, DW_AT_inline))
{
/* ??? This can happen if there is a bug in the program, for
instance, if it has duplicate function definitions. Ideally,
@@ -10175,15 +9570,17 @@ gen_subprogram_die (decl, context_die)
if (declaration)
{
- if (! origin)
- add_AT_flag (subr_die, DW_AT_declaration, 1);
-
- /* The first time we see a member function, it is in the context of
- the class to which it belongs. We make sure of this by emitting
- the class first. The next time is the definition, which is
- handled above. The two may come from the same source text. */
- if (DECL_CONTEXT (decl) || DECL_ABSTRACT (decl))
- equate_decl_number_to_die (decl, subr_die);
+ if (!(old_die && get_AT_unsigned (old_die, DW_AT_inline)))
+ {
+ add_AT_flag (subr_die, DW_AT_declaration, 1);
+
+ /* The first time we see a member function, it is in the context of
+ the class to which it belongs. We make sure of this by emitting
+ the class first. The next time is the definition, which is
+ handled above. The two may come from the same source text. */
+ if (DECL_CONTEXT (decl) || DECL_ABSTRACT (decl))
+ equate_decl_number_to_die (decl, subr_die);
+ }
}
else if (DECL_ABSTRACT (decl))
{
@@ -10206,7 +9603,7 @@ gen_subprogram_die (decl, context_die)
}
else if (!DECL_EXTERNAL (decl))
{
- if (origin == NULL_TREE)
+ if (!(old_die && get_AT_unsigned (old_die, DW_AT_inline)))
equate_decl_number_to_die (decl, subr_die);
ASM_GENERATE_INTERNAL_LABEL (label_id, FUNC_BEGIN_LABEL,
@@ -10256,7 +9653,7 @@ gen_subprogram_die (decl, context_die)
if (debug_info_level <= DINFO_LEVEL_TERSE)
;
else if (declaration)
- gen_formal_types_die (TREE_TYPE (decl), subr_die);
+ gen_formal_types_die (decl, subr_die);
else
{
/* Generate DIEs to represent all known formal parameters */
@@ -10358,8 +9755,7 @@ gen_variable_die (decl, context_die)
add_AT_die_ref (var_die, DW_AT_specification, old_die);
if (DECL_NAME (decl))
{
- register unsigned file_index
- = lookup_filename (&decl_file_table, DECL_SOURCE_FILE (decl));
+ unsigned file_index = lookup_filename (DECL_SOURCE_FILE (decl));
if (get_AT_unsigned (old_die, DW_AT_decl_file) != file_index)
add_AT_unsigned (var_die, DW_AT_decl_file, file_index);
@@ -10490,7 +9886,7 @@ gen_inlined_subroutine_die (stmt, context_die, depth)
char label[MAX_ARTIFICIAL_LABEL_BYTES];
/* Emit info for the abstract instance first, if we haven't yet. */
- gen_abstract_function (decl);
+ dwarf2out_abstract_function (decl);
add_abstract_origin_attribute (subr_die, decl);
ASM_GENERATE_INTERNAL_LABEL (label, BLOCK_BEGIN_LABEL,
@@ -10733,6 +10129,10 @@ gen_member_die (type, context_die)
/* Now output info about the function members (if any). */
for (member = TYPE_METHODS (type); member; member = TREE_CHAIN (member))
{
+ /* Don't include clones in the member list. */
+ if (DECL_ABSTRACT_ORIGIN (member))
+ continue;
+
child = lookup_decl_die (member);
if (child)
splice_child_die (context_die, child);
@@ -11261,20 +10661,23 @@ gen_decl_die (decl, context_die)
&& (current_function_decl == NULL_TREE || DECL_ARTIFICIAL (decl)))
break;
+ /* If we're emitting a clone, emit info for the abstract instance. */
+ if (DECL_ORIGIN (decl) != decl)
+ dwarf2out_abstract_function (DECL_ABSTRACT_ORIGIN (decl));
/* If we're emitting an out-of-line copy of an inline function,
emit info for the abstract instance and set up to refer to it. */
- if (DECL_INLINE (decl) && ! DECL_ABSTRACT (decl)
- && ! class_scope_p (context_die)
- /* gen_abstract_function won't emit a die if this is just a
- declaration. We must avoid setting DECL_ABSTRACT_ORIGIN in
- that case, because that works only if we have a die. */
- && DECL_INITIAL (decl) != NULL_TREE)
+ else if (DECL_INLINE (decl) && ! DECL_ABSTRACT (decl)
+ && ! class_scope_p (context_die)
+ /* dwarf2out_abstract_function won't emit a die if this is just
+ a declaration. We must avoid setting DECL_ABSTRACT_ORIGIN in
+ that case, because that works only if we have a die. */
+ && DECL_INITIAL (decl) != NULL_TREE)
{
- gen_abstract_function (decl);
+ dwarf2out_abstract_function (decl);
set_decl_origin_self (decl);
}
-
- if (debug_info_level > DINFO_LEVEL_TERSE)
+ /* Otherwise we're emitting the primary DIE for this decl. */
+ else if (debug_info_level > DINFO_LEVEL_TERSE)
{
/* Before we describe the FUNCTION_DECL itself, make sure that we
have described its return type. */
@@ -11394,7 +10797,7 @@ dwarf2out_add_library_unit_info (filename, context_list)
TREE_PUBLIC (context_list_decl) = TRUE;
add_name_attribute (unit_die, context_list);
- file_index = lookup_filename (&decl_file_table, filename);
+ file_index = lookup_filename (filename);
add_AT_unsigned (unit_die, DW_AT_decl_file, file_index);
add_pubname (context_list_decl, unit_die);
}
@@ -11568,54 +10971,60 @@ dwarf2out_ignore_block (block)
was looked up last. This handles the majority of all searches. */
static unsigned
-lookup_filename (t, file_name)
- struct file_table *t;
+lookup_filename (file_name)
const char *file_name;
{
register unsigned i;
+ /* ??? Why isn't DECL_SOURCE_FILE left null instead. */
+ if (strcmp (file_name, "<internal>") == 0
+ || strcmp (file_name, "<built-in>") == 0)
+ return 0;
+
/* Check to see if the file name that was searched on the previous
call matches this file name. If so, return the index. */
- if (t->last_lookup_index != 0)
- if (strcmp (file_name, t->table[t->last_lookup_index]) == 0)
- return t->last_lookup_index;
+ if (file_table.last_lookup_index != 0)
+ if (strcmp (file_name, file_table.table[file_table.last_lookup_index]) == 0)
+ return file_table.last_lookup_index;
/* Didn't match the previous lookup, search the table */
- for (i = 1; i < t->in_use; ++i)
- if (strcmp (file_name, t->table[i]) == 0)
+ for (i = 1; i < file_table.in_use; ++i)
+ if (strcmp (file_name, file_table.table[i]) == 0)
{
- t->last_lookup_index = i;
+ file_table.last_lookup_index = i;
return i;
}
/* Prepare to add a new table entry by making sure there is enough space in
the table to do so. If not, expand the current table. */
- if (i == t->allocated)
+ if (i == file_table.allocated)
{
- t->allocated = i + FILE_TABLE_INCREMENT;
- t->table = (char **)
- xrealloc (t->table, t->allocated * sizeof (char *));
+ file_table.allocated = i + FILE_TABLE_INCREMENT;
+ file_table.table = (char **)
+ xrealloc (file_table.table, file_table.allocated * sizeof (char *));
}
/* Add the new entry to the end of the filename table. */
- t->table[i] = xstrdup (file_name);
- t->in_use = i + 1;
- t->last_lookup_index = i;
+ file_table.table[i] = xstrdup (file_name);
+ file_table.in_use = i + 1;
+ file_table.last_lookup_index = i;
+
+ if (DWARF2_ASM_LINE_DEBUG_INFO)
+ fprintf (asm_out_file, "\t.file %u \"%s\"\n", i, file_name);
return i;
}
static void
-init_file_table (t)
- struct file_table *t;
+init_file_table ()
{
/* Allocate the initial hunk of the file_table. */
- t->table = (char **) xcalloc (FILE_TABLE_INCREMENT, sizeof (char *));
- t->allocated = FILE_TABLE_INCREMENT;
+ file_table.table = (char **) xcalloc (FILE_TABLE_INCREMENT, sizeof (char *));
+ file_table.allocated = FILE_TABLE_INCREMENT;
/* Skip the first entry - file numbers begin at 1. */
- t->in_use = 1;
- t->last_lookup_index = 0;
+ file_table.in_use = 1;
+ file_table.last_lookup_index = 0;
}
/* Output a label to mark the beginning of a source code line entry
@@ -11633,28 +11042,10 @@ dwarf2out_line (filename, line)
if (DWARF2_ASM_LINE_DEBUG_INFO)
{
-#if 0
- unsigned old_in_use = line_file_table.in_use;
-#endif
- unsigned file_num = lookup_filename (&line_file_table, filename);
+ unsigned file_num = lookup_filename (filename);
- /* Emit the .file and .loc directives understood by GNU as. */
-#if 0
- /* ??? As of 2000-11-25, gas has a bug in which it doesn't
- actually use the file number argument. It merely remembers
- the last .file directive emitted. */
- if (file_num >= old_in_use)
- fprintf (asm_out_file, "\t.file %d \"%s\"\n", file_num, filename);
+ /* Emit the .loc directive understood by GNU as. */
fprintf (asm_out_file, "\t.loc %d %d 0\n", file_num, line);
-#else
- static unsigned int last_file_num;
- if (file_num != last_file_num)
- {
- last_file_num = file_num;
- fprintf (asm_out_file, "\t.file 0 \"%s\"\n", filename);
- }
- fprintf (asm_out_file, "\t.loc 0 %d 0\n", line);
-#endif
/* Indicate that line number info exists. */
++line_info_table_in_use;
@@ -11669,9 +11060,8 @@ dwarf2out_line (filename, line)
ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, SEPARATE_LINE_CODE_LABEL,
separate_line_info_table_in_use);
if (flag_debug_asm)
- fprintf (asm_out_file, "\t%s %s:%d", ASM_COMMENT_START,
+ fprintf (asm_out_file, "\t%s %s:%d\n", ASM_COMMENT_START,
filename, line);
- fputc ('\n', asm_out_file);
/* expand the line info table if necessary */
if (separate_line_info_table_in_use
@@ -11688,7 +11078,7 @@ dwarf2out_line (filename, line)
/* Add the new entry at the end of the line_info_table. */
line_info
= &separate_line_info_table[separate_line_info_table_in_use++];
- line_info->dw_file_num = lookup_filename (&line_file_table, filename);
+ line_info->dw_file_num = lookup_filename (filename);
line_info->dw_line_num = line;
line_info->function = current_funcdef_number;
}
@@ -11699,9 +11089,8 @@ dwarf2out_line (filename, line)
ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, LINE_CODE_LABEL,
line_info_table_in_use);
if (flag_debug_asm)
- fprintf (asm_out_file, "\t%s %s:%d", ASM_COMMENT_START,
+ fprintf (asm_out_file, "\t%s %s:%d\n", ASM_COMMENT_START,
filename, line);
- fputc ('\n', asm_out_file);
/* Expand the line info table if necessary. */
if (line_info_table_in_use == line_info_table_allocated)
@@ -11716,7 +11105,7 @@ dwarf2out_line (filename, line)
/* Add the new entry at the end of the line_info_table. */
line_info = &line_info_table[line_info_table_in_use++];
- line_info->dw_file_num = lookup_filename (&line_file_table, filename);
+ line_info->dw_file_num = lookup_filename (filename);
line_info->dw_line_num = line;
}
}
@@ -11785,11 +11174,15 @@ dwarf2out_init (asm_out_file, main_input_filename)
register FILE *asm_out_file;
register const char *main_input_filename;
{
+ init_file_table ();
+
/* Remember the name of the primary input file. */
primary_filename = main_input_filename;
- init_file_table (&decl_file_table);
- init_file_table (&line_file_table);
+ /* Add it to the file table first, under the assumption that we'll
+ be emitting line number data for it first, which avoids having
+ to add an initial DW_LNS_set_file. */
+ lookup_filename (main_input_filename);
/* Allocate the initial hunk of the decl_die_table. */
decl_die_table
@@ -11798,10 +11191,8 @@ dwarf2out_init (asm_out_file, main_input_filename)
decl_die_table_in_use = 0;
/* Allocate the initial hunk of the decl_scope_table. */
- decl_scope_table
- = (tree *) xcalloc (DECL_SCOPE_TABLE_INCREMENT, sizeof (tree));
- decl_scope_table_allocated = DECL_SCOPE_TABLE_INCREMENT;
- decl_scope_depth = 0;
+ VARRAY_TREE_INIT (decl_scope_table, 256, "decl_scope_table");
+ ggc_add_tree_varray_root (&decl_scope_table, 1);
/* Allocate the initial hunk of the abbrev_die_table. */
abbrev_die_table
@@ -11826,6 +11217,9 @@ dwarf2out_init (asm_out_file, main_input_filename)
invoked when the given (base) source file was compiled. */
comp_unit_die = gen_compile_unit_die (main_input_filename);
+ VARRAY_TREE_INIT (incomplete_types, 64, "incomplete_types");
+ ggc_add_tree_varray_root (&incomplete_types, 1);
+
VARRAY_RTX_INIT (used_rtx_varray, 32, "used_rtx_varray");
ggc_add_rtx_varray_root (&used_rtx_varray, 1);
@@ -11906,44 +11300,42 @@ dwarf2out_finish ()
add_sibling_attributes (node->die);
/* Output a terminator label for the .text section. */
- fputc ('\n', asm_out_file);
ASM_OUTPUT_SECTION (asm_out_file, TEXT_SECTION);
ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, TEXT_END_LABEL, 0);
#if 0
/* Output a terminator label for the .data section. */
- fputc ('\n', asm_out_file);
ASM_OUTPUT_SECTION (asm_out_file, DATA_SECTION);
ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, DATA_END_LABEL, 0);
/* Output a terminator label for the .bss section. */
- fputc ('\n', asm_out_file);
ASM_OUTPUT_SECTION (asm_out_file, BSS_SECTION);
ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, BSS_END_LABEL, 0);
#endif
- /* Output the source line correspondence table. */
- if (line_info_table_in_use > 1 || separate_line_info_table_in_use)
+ /* Output the source line correspondence table. We must do this
+ even if there is no line information. Otherwise, on an empty
+ translation unit, we will generate a present, but empty,
+ .debug_info section. IRIX 6.5 `nm' will then complain when
+ examining the file. */
+ if (! DWARF2_ASM_LINE_DEBUG_INFO)
{
- if (! DWARF2_ASM_LINE_DEBUG_INFO)
- {
- fputc ('\n', asm_out_file);
- ASM_OUTPUT_SECTION (asm_out_file, DEBUG_LINE_SECTION);
- output_line_info ();
- }
-
- /* We can only use the low/high_pc attributes if all of the code
- was in .text. */
- if (separate_line_info_table_in_use == 0)
- {
- add_AT_lbl_id (comp_unit_die, DW_AT_low_pc, text_section_label);
- add_AT_lbl_id (comp_unit_die, DW_AT_high_pc, text_end_label);
- }
+ ASM_OUTPUT_SECTION (asm_out_file, DEBUG_LINE_SECTION);
+ output_line_info ();
+ }
- add_AT_lbl_offset (comp_unit_die, DW_AT_stmt_list,
- debug_line_section_label);
+ /* We can only use the low/high_pc attributes if all of the code was
+ in .text. */
+ if (separate_line_info_table_in_use == 0)
+ {
+ add_AT_lbl_id (comp_unit_die, DW_AT_low_pc, text_section_label);
+ add_AT_lbl_id (comp_unit_die, DW_AT_high_pc, text_end_label);
}
+ if (debug_info_level >= DINFO_LEVEL_NORMAL)
+ add_AT_lbl_offset (comp_unit_die, DW_AT_stmt_list,
+ debug_line_section_label);
+
#if 0 /* unimplemented */
if (debug_info_level >= DINFO_LEVEL_VERBOSE && primary)
add_AT_unsigned (die, DW_AT_macro_info, 0);
@@ -11956,14 +11348,12 @@ dwarf2out_finish ()
output_comp_unit (comp_unit_die);
/* Output the abbreviation table. */
- fputc ('\n', asm_out_file);
ASM_OUTPUT_SECTION (asm_out_file, ABBREV_SECTION);
output_abbrev_section ();
if (pubname_table_in_use)
{
/* Output public names table. */
- fputc ('\n', asm_out_file);
ASM_OUTPUT_SECTION (asm_out_file, PUBNAMES_SECTION);
output_pubnames ();
}
@@ -11973,9 +11363,22 @@ dwarf2out_finish ()
if (fde_table_in_use)
{
/* Output the address range information. */
- fputc ('\n', asm_out_file);
ASM_OUTPUT_SECTION (asm_out_file, ARANGES_SECTION);
output_aranges ();
}
+
+ /* At this point, we've switched sections like mad, but we've done
+ so behind the back of varasm.c. Unfortunately, used
+ named_section to switch sections doesn't work either; GAS 2.9.5
+ is not pleased by:
+
+ .section debug_aranges,"a",@progbits
+
+ on i686-pc-linux-gnu.
+
+ By calling force_data_section, we get varasm.c synched back up
+ with reality. That makes subsequent calls to text_section and
+ such make sense. */
+ force_data_section ();
}
#endif /* DWARF2_DEBUGGING_INFO */
diff --git a/gcc/dwarf2out.h b/gcc/dwarf2out.h
index bced6a6a8a4..1f42626a066 100644
--- a/gcc/dwarf2out.h
+++ b/gcc/dwarf2out.h
@@ -39,4 +39,7 @@ extern void debug_dwarf PARAMS ((void));
struct die_struct;
extern void debug_dwarf_die PARAMS ((struct die_struct *));
extern void dwarf2out_set_demangle_name_func PARAMS ((const char *(*) (const char *)));
+extern void dwarf2out_abstract_function PARAMS ((tree));
extern void dwarf2out_add_library_unit_info PARAMS ((const char *, const char *));
+
+extern unsigned current_funcdef_number;
diff --git a/gcc/dwarfout.c b/gcc/dwarfout.c
index 9c7cb47dbb4..c1546f5dcf1 100644
--- a/gcc/dwarfout.c
+++ b/gcc/dwarfout.c
@@ -20,6 +20,548 @@ 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. */
+/*
+
+ Notes on the GNU Implementation of DWARF Debugging Information
+ --------------------------------------------------------------
+ Last Major Update: Sun Jul 17 08:17:42 PDT 1994 by rfg@segfault.us.com
+ ------------------------------------------------------------
+
+ This file describes special and unique aspects of the GNU implementation of
+ the DWARF Version 1 debugging information language, as provided in the GNU
+ version 2.x compiler(s).
+
+ For general information about the DWARF debugging information language,
+ you should obtain the DWARF version 1.1 specification document (and perhaps
+ also the DWARF version 2 draft specification document) developed by the
+ (now defunct) UNIX International Programming Languages Special Interest Group.
+
+ To obtain a copy of the DWARF Version 1 and/or DWARF Version 2
+ specification, visit the web page for the DWARF Version 2 committee, at
+
+ http://www.eagercon.com/dwarf/dwarf2std.htm
+
+ The generation of DWARF debugging information by the GNU version 2.x C
+ compiler has now been tested rather extensively for m88k, i386, i860, and
+ Sparc targets. The DWARF output of the GNU C compiler appears to inter-
+ operate well with the standard SVR4 SDB debugger on these kinds of target
+ systems (but of course, there are no guarantees).
+
+ DWARF 1 generation for the GNU g++ compiler is implemented, but limited.
+ C++ users should definitely use DWARF 2 instead.
+
+ Future plans for the dwarfout.c module of the GNU compiler(s) includes the
+ addition of full support for GNU FORTRAN. (This should, in theory, be a
+ lot simpler to add than adding support for g++... but we'll see.)
+
+ Many features of the DWARF version 2 specification have been adapted to
+ (and used in) the GNU implementation of DWARF (version 1). In most of
+ these cases, a DWARF version 2 approach is used in place of (or in addition
+ to) DWARF version 1 stuff simply because it is apparent that DWARF version
+ 1 is not sufficiently expressive to provide the kinds of information which
+ may be necessary to support really robust debugging. In all of these cases
+ however, the use of DWARF version 2 features should not interfere in any
+ way with the interoperability (of GNU compilers) with generally available
+ "classic" (pre version 1) DWARF consumer tools (e.g. SVR4 SDB).
+
+ The DWARF generation enhancement for the GNU compiler(s) was initially
+ donated to the Free Software Foundation by Network Computing Devices.
+ (Thanks NCD!) Additional development and maintenance of dwarfout.c has
+ been largely supported (i.e. funded) by Intel Corporation. (Thanks Intel!)
+
+ If you have questions or comments about the DWARF generation feature, please
+ send mail to me <rfg@netcom.com>. I will be happy to investigate any bugs
+ reported and I may even provide fixes (but of course, I can make no promises).
+
+ The DWARF debugging information produced by GCC may deviate in a few minor
+ (but perhaps significant) respects from the DWARF debugging information
+ currently produced by other C compilers. A serious attempt has been made
+ however to conform to the published specifications, to existing practice,
+ and to generally accepted norms in the GNU implementation of DWARF.
+
+ ** IMPORTANT NOTE ** ** IMPORTANT NOTE ** ** IMPORTANT NOTE **
+
+ Under normal circumstances, the DWARF information generated by the GNU
+ compilers (in an assembly language file) is essentially impossible for
+ a human being to read. This fact can make it very difficult to debug
+ certain DWARF-related problems. In order to overcome this difficulty,
+ a feature has been added to dwarfout.c (enabled by the -dA
+ option) which causes additional comments to be placed into the assembly
+ language output file, out to the right-hand side of most bits of DWARF
+ material. The comments indicate (far more clearly that the obscure
+ DWARF hex codes do) what is actually being encoded in DWARF. Thus, the
+ -dA option can be highly useful for those who must study the
+ DWARF output from the GNU compilers in detail.
+
+ ---------
+
+ (Footnote: Within this file, the term `Debugging Information Entry' will
+ be abbreviated as `DIE'.)
+
+
+ Release Notes (aka known bugs)
+ -------------------------------
+
+ In one very obscure case involving dynamically sized arrays, the DWARF
+ "location information" for such an array may make it appear that the
+ array has been totally optimized out of existence, when in fact it
+ *must* actually exist. (This only happens when you are using *both* -g
+ *and* -O.) This is due to aggressive dead store elimination in the
+ compiler, and to the fact that the DECL_RTL expressions associated with
+ variables are not always updated to correctly reflect the effects of
+ GCC's aggressive dead store elimination.
+
+ -------------------------------
+
+ When attempting to set a breakpoint at the "start" of a function compiled
+ with -g1, the debugger currently has no way of knowing exactly where the
+ end of the prologue code for the function is. Thus, for most targets,
+ all the debugger can do is to set the breakpoint at the AT_low_pc address
+ for the function. But if you stop there and then try to look at one or
+ more of the formal parameter values, they may not have been "homed" yet,
+ so you may get inaccurate answers (or perhaps even addressing errors).
+
+ Some people may consider this simply a non-feature, but I consider it a
+ bug, and I hope to provide some GNU-specific attributes (on function
+ DIEs) which will specify the address of the end of the prologue and the
+ address of the beginning of the epilogue in a future release.
+
+ -------------------------------
+
+ It is believed at this time that old bugs relating to the AT_bit_offset
+ values for bit-fields have been fixed.
+
+ There may still be some very obscure bugs relating to the DWARF description
+ of type `long long' bit-fields for target machines (e.g. 80x86 machines)
+ where the alignment of type `long long' data objects is different from
+ (and less than) the size of a type `long long' data object.
+
+ Please report any problems with the DWARF description of bit-fields as you
+ would any other GCC bug. (Procedures for bug reporting are given in the
+ GNU C compiler manual.)
+
+ --------------------------------
+
+ At this time, GCC does not know how to handle the GNU C "nested functions"
+ extension. (See the GCC manual for more info on this extension to ANSI C.)
+
+ --------------------------------
+
+ The GNU compilers now represent inline functions (and inlined instances
+ thereof) in exactly the manner described by the current DWARF version 2
+ (draft) specification. The version 1 specification for handling inline
+ functions (and inlined instances) was known to be brain-damaged (by the
+ PLSIG) when the version 1 spec was finalized, but it was simply too late
+ in the cycle to get it removed before the version 1 spec was formally
+ released to the public (by UI).
+
+ --------------------------------
+
+ At this time, GCC does not generate the kind of really precise information
+ about the exact declared types of entities with signed integral types which
+ is required by the current DWARF draft specification.
+
+ Specifically, the current DWARF draft specification seems to require that
+ the type of an non-unsigned integral bit-field member of a struct or union
+ type be represented as either a "signed" type or as a "plain" type,
+ depending upon the exact set of keywords that were used in the
+ type specification for the given bit-field member. It was felt (by the
+ UI/PLSIG) that this distinction between "plain" and "signed" integral types
+ could have some significance (in the case of bit-fields) because ANSI C
+ does not constrain the signedness of a plain bit-field, whereas it does
+ constrain the signedness of an explicitly "signed" bit-field. For this
+ reason, the current DWARF specification calls for compilers to produce
+ type information (for *all* integral typed entities... not just bit-fields)
+ which explicitly indicates the signedness of the relevant type to be
+ "signed" or "plain" or "unsigned".
+
+ Unfortunately, the GNU DWARF implementation is currently incapable of making
+ such distinctions.
+
+ --------------------------------
+
+
+ Known Interoperability Problems
+ -------------------------------
+
+ Although the GNU implementation of DWARF conforms (for the most part) with
+ the current UI/PLSIG DWARF version 1 specification (with many compatible
+ version 2 features added in as "vendor specific extensions" just for good
+ measure) there are a few known cases where GCC's DWARF output can cause
+ some confusion for "classic" (pre version 1) DWARF consumers such as the
+ System V Release 4 SDB debugger. These cases are described in this section.
+
+ --------------------------------
+
+ The DWARF version 1 specification includes the fundamental type codes
+ FT_ext_prec_float, FT_complex, FT_dbl_prec_complex, and FT_ext_prec_complex.
+ Since GNU C is only a C compiler (and since C doesn't provide any "complex"
+ data types) the only one of these fundamental type codes which GCC ever
+ generates is FT_ext_prec_float. This fundamental type code is generated
+ by GCC for the `long double' data type. Unfortunately, due to an apparent
+ bug in the SVR4 SDB debugger, SDB can become very confused wherever any
+ attempt is made to print a variable, parameter, or field whose type was
+ given in terms of FT_ext_prec_float.
+
+ (Actually, SVR4 SDB fails to understand *any* of the four fundamental type
+ codes mentioned here. This will fact will cause additional problems when
+ there is a GNU FORTRAN front-end.)
+
+ --------------------------------
+
+ In general, it appears that SVR4 SDB is not able to effectively ignore
+ fundamental type codes in the "implementation defined" range. This can
+ cause problems when a program being debugged uses the `long long' data
+ type (or the signed or unsigned varieties thereof) because these types
+ are not defined by ANSI C, and thus, GCC must use its own private fundamental
+ type codes (from the implementation-defined range) to represent these types.
+
+ --------------------------------
+
+
+ General GNU DWARF extensions
+ ----------------------------
+
+ In the current DWARF version 1 specification, no mechanism is specified by
+ which accurate information about executable code from include files can be
+ properly (and fully) described. (The DWARF version 2 specification *does*
+ specify such a mechanism, but it is about 10 times more complicated than
+ it needs to be so I'm not terribly anxious to try to implement it right
+ away.)
+
+ In the GNU implementation of DWARF version 1, a fully downward-compatible
+ extension has been implemented which permits the GNU compilers to specify
+ which executable lines come from which files. This extension places
+ additional information (about source file names) in GNU-specific sections
+ (which should be totally ignored by all non-GNU DWARF consumers) so that
+ this extended information can be provided (to GNU DWARF consumers) in a way
+ which is totally transparent (and invisible) to non-GNU DWARF consumers
+ (e.g. the SVR4 SDB debugger). The additional information is placed *only*
+ in specialized GNU-specific sections, where it should never even be seen
+ by non-GNU DWARF consumers.
+
+ To understand this GNU DWARF extension, imagine that the sequence of entries
+ in the .lines section is broken up into several subsections. Each contiguous
+ sequence of .line entries which relates to a sequence of lines (or statements)
+ from one particular file (either a `base' file or an `include' file) could
+ be called a `line entries chunk' (LEC).
+
+ For each LEC there is one entry in the .debug_srcinfo section.
+
+ Each normal entry in the .debug_srcinfo section consists of two 4-byte
+ words of data as follows:
+
+ (1) The starting address (relative to the entire .line section)
+ of the first .line entry in the relevant LEC.
+
+ (2) The starting address (relative to the entire .debug_sfnames
+ section) of a NUL terminated string representing the
+ relevant filename. (This filename name be either a
+ relative or an absolute filename, depending upon how the
+ given source file was located during compilation.)
+
+ Obviously, each .debug_srcinfo entry allows you to find the relevant filename,
+ and it also points you to the first .line entry that was generated as a result
+ of having compiled a given source line from the given source file.
+
+ Each subsequent .line entry should also be assumed to have been produced
+ as a result of compiling yet more lines from the same file. The end of
+ any given LEC is easily found by looking at the first 4-byte pointer in
+ the *next* .debug_srcinfo entry. That next .debug_srcinfo entry points
+ to a new and different LEC, so the preceding LEC (implicitly) must have
+ ended with the last .line section entry which occurs at the 2 1/2 words
+ just before the address given in the first pointer of the new .debug_srcinfo
+ entry.
+
+ The following picture may help to clarify this feature. Let's assume that
+ `LE' stands for `.line entry'. Also, assume that `* 'stands for a pointer.
+
+
+ .line section .debug_srcinfo section .debug_sfnames section
+ ----------------------------------------------------------------
+
+ LE <---------------------- *
+ LE * -----------------> "foobar.c" <---
+ LE |
+ LE |
+ LE <---------------------- * |
+ LE * -----------------> "foobar.h" <| |
+ LE | |
+ LE | |
+ LE <---------------------- * | |
+ LE * -----------------> "inner.h" | |
+ LE | |
+ LE <---------------------- * | |
+ LE * ------------------------------- |
+ LE |
+ LE |
+ LE |
+ LE |
+ LE <---------------------- * |
+ LE * -----------------------------------
+ LE
+ LE
+ LE
+
+ In effect, each entry in the .debug_srcinfo section points to *both* a
+ filename (in the .debug_sfnames section) and to the start of a block of
+ consecutive LEs (in the .line section).
+
+ Note that just like in the .line section, there are specialized first and
+ last entries in the .debug_srcinfo section for each object file. These
+ special first and last entries for the .debug_srcinfo section are very
+ different from the normal .debug_srcinfo section entries. They provide
+ additional information which may be helpful to a debugger when it is
+ interpreting the data in the .debug_srcinfo, .debug_sfnames, and .line
+ sections.
+
+ The first entry in the .debug_srcinfo section for each compilation unit
+ consists of five 4-byte words of data. The contents of these five words
+ should be interpreted (by debuggers) as follows:
+
+ (1) The starting address (relative to the entire .line section)
+ of the .line section for this compilation unit.
+
+ (2) The starting address (relative to the entire .debug_sfnames
+ section) of the .debug_sfnames section for this compilation
+ unit.
+
+ (3) The starting address (in the execution virtual address space)
+ of the .text section for this compilation unit.
+
+ (4) The ending address plus one (in the execution virtual address
+ space) of the .text section for this compilation unit.
+
+ (5) The date/time (in seconds since midnight 1/1/70) at which the
+ compilation of this compilation unit occurred. This value
+ should be interpreted as an unsigned quantity because gcc
+ might be configured to generate a default value of 0xffffffff
+ in this field (in cases where it is desired to have object
+ files created at different times from identical source files
+ be byte-for-byte identical). By default, these timestamps
+ are *not* generated by dwarfout.c (so that object files
+ compiled at different times will be byte-for-byte identical).
+ If you wish to enable this "timestamp" feature however, you
+ can simply place a #define for the symbol `DWARF_TIMESTAMPS'
+ in your target configuration file and then rebuild the GNU
+ compiler(s).
+
+ Note that the first string placed into the .debug_sfnames section for each
+ compilation unit is the name of the directory in which compilation occurred.
+ This string ends with a `/' (to help indicate that it is the pathname of a
+ directory). Thus, the second word of each specialized initial .debug_srcinfo
+ entry for each compilation unit may be used as a pointer to the (string)
+ name of the compilation directory, and that string may in turn be used to
+ "absolutize" any relative pathnames which may appear later on in the
+ .debug_sfnames section entries for the same compilation unit.
+
+ The fifth and last word of each specialized starting entry for a compilation
+ unit in the .debug_srcinfo section may (depending upon your configuration)
+ indicate the date/time of compilation, and this may be used (by a debugger)
+ to determine if any of the source files which contributed code to this
+ compilation unit are newer than the object code for the compilation unit
+ itself. If so, the debugger may wish to print an "out-of-date" warning
+ about the compilation unit.
+
+ The .debug_srcinfo section associated with each compilation will also have
+ a specialized terminating entry. This terminating .debug_srcinfo section
+ entry will consist of the following two 4-byte words of data:
+
+ (1) The offset, measured from the start of the .line section to
+ the beginning of the terminating entry for the .line section.
+
+ (2) A word containing the value 0xffffffff.
+
+ --------------------------------
+
+ In the current DWARF version 1 specification, no mechanism is specified by
+ which information about macro definitions and un-definitions may be provided
+ to the DWARF consumer.
+
+ The DWARF version 2 (draft) specification does specify such a mechanism.
+ That specification was based on the GNU ("vendor specific extension")
+ which provided some support for macro definitions and un-definitions,
+ but the "official" DWARF version 2 (draft) specification mechanism for
+ handling macros and the GNU implementation have diverged somewhat. I
+ plan to update the GNU implementation to conform to the "official"
+ DWARF version 2 (draft) specification as soon as I get time to do that.
+
+ Note that in the GNU implementation, additional information about macro
+ definitions and un-definitions is *only* provided when the -g3 level of
+ debug-info production is selected. (The default level is -g2 and the
+ plain old -g option is considered to be identical to -g2.)
+
+ GCC records information about macro definitions and undefinitions primarily
+ in a section called the .debug_macinfo section. Normal entries in the
+ .debug_macinfo section consist of the following three parts:
+
+ (1) A special "type" byte.
+
+ (2) A 3-byte line-number/filename-offset field.
+
+ (3) A NUL terminated string.
+
+ The interpretation of the second and third parts is dependent upon the
+ value of the leading (type) byte.
+
+ The type byte may have one of four values depending upon the type of the
+ .debug_macinfo entry which follows. The 1-byte MACINFO type codes presently
+ used, and their meanings are as follows:
+
+ MACINFO_start A base file or an include file starts here.
+ MACINFO_resume The current base or include file ends here.
+ MACINFO_define A #define directive occurs here.
+ MACINFO_undef A #undef directive occur here.
+
+ (Note that the MACINFO_... codes mentioned here are simply symbolic names
+ for constants which are defined in the GNU dwarf.h file.)
+
+ For MACINFO_define and MACINFO_undef entries, the second (3-byte) field
+ contains the number of the source line (relative to the start of the current
+ base source file or the current include files) when the #define or #undef
+ directive appears. For a MACINFO_define entry, the following string field
+ contains the name of the macro which is defined, followed by its definition.
+ Note that the definition is always separated from the name of the macro
+ by at least one whitespace character. For a MACINFO_undef entry, the
+ string which follows the 3-byte line number field contains just the name
+ of the macro which is being undef'ed.
+
+ For a MACINFO_start entry, the 3-byte field following the type byte contains
+ the offset, relative to the start of the .debug_sfnames section for the
+ current compilation unit, of a string which names the new source file which
+ is beginning its inclusion at this point. Following that 3-byte field,
+ each MACINFO_start entry always contains a zero length NUL terminated
+ string.
+
+ For a MACINFO_resume entry, the 3-byte field following the type byte contains
+ the line number WITHIN THE INCLUDING FILE at which the inclusion of the
+ current file (whose inclusion ends here) was initiated. Following that
+ 3-byte field, each MACINFO_resume entry always contains a zero length NUL
+ terminated string.
+
+ Each set of .debug_macinfo entries for each compilation unit is terminated
+ by a special .debug_macinfo entry consisting of a 4-byte zero value followed
+ by a single NUL byte.
+
+ --------------------------------
+
+ In the current DWARF draft specification, no provision is made for providing
+ a separate level of (limited) debugging information necessary to support
+ tracebacks (only) through fully-debugged code (e.g. code in system libraries).
+
+ A proposal to define such a level was submitted (by me) to the UI/PLSIG.
+ This proposal was rejected by the UI/PLSIG for inclusion into the DWARF
+ version 1 specification for two reasons. First, it was felt (by the PLSIG)
+ that the issues involved in supporting a "traceback only" subset of DWARF
+ were not well understood. Second, and perhaps more importantly, the PLSIG
+ is already having enough trouble agreeing on what it means to be "conforming"
+ to the DWARF specification, and it was felt that trying to specify multiple
+ different *levels* of conformance would only complicate our discussions of
+ this already divisive issue. Nonetheless, the GNU implementation of DWARF
+ provides an abbreviated "traceback only" level of debug-info production for
+ use with fully-debugged "system library" code. This level should only be
+ used for fully debugged system library code, and even then, it should only
+ be used where there is a very strong need to conserve disk space. This
+ abbreviated level of debug-info production can be used by specifying the
+ -g1 option on the compilation command line.
+
+ --------------------------------
+
+ As mentioned above, the GNU implementation of DWARF currently uses the DWARF
+ version 2 (draft) approach for inline functions (and inlined instances
+ thereof). This is used in preference to the version 1 approach because
+ (quite simply) the version 1 approach is highly brain-damaged and probably
+ unworkable.
+
+ --------------------------------
+
+
+ GNU DWARF Representation of GNU C Extensions to ANSI C
+ ------------------------------------------------------
+
+ The file dwarfout.c has been designed and implemented so as to provide
+ some reasonable DWARF representation for each and every declarative
+ construct which is accepted by the GNU C compiler. Since the GNU C
+ compiler accepts a superset of ANSI C, this means that there are some
+ cases in which the DWARF information produced by GCC must take some
+ liberties in improvising DWARF representations for declarations which
+ are only valid in (extended) GNU C.
+
+ In particular, GNU C provides at least three significant extensions to
+ ANSI C when it comes to declarations. These are (1) inline functions,
+ and (2) dynamic arrays, and (3) incomplete enum types. (See the GCC
+ manual for more information on these GNU extensions to ANSI C.) When
+ used, these GNU C extensions are represented (in the generated DWARF
+ output of GCC) in the most natural and intuitively obvious ways.
+
+ In the case of inline functions, the DWARF representation is exactly as
+ called for in the DWARF version 2 (draft) specification for an identical
+ function written in C++; i.e. we "reuse" the representation of inline
+ functions which has been defined for C++ to support this GNU C extension.
+
+ In the case of dynamic arrays, we use the most obvious representational
+ mechanism available; i.e. an array type in which the upper bound of
+ some dimension (usually the first and only dimension) is a variable
+ rather than a constant. (See the DWARF version 1 specification for more
+ details.)
+
+ In the case of incomplete enum types, such types are represented simply
+ as TAG_enumeration_type DIEs which DO NOT contain either AT_byte_size
+ attributes or AT_element_list attributes.
+
+ --------------------------------
+
+
+ Future Directions
+ -----------------
+
+ The codes, formats, and other paraphernalia necessary to provide proper
+ support for symbolic debugging for the C++ language are still being worked
+ on by the UI/PLSIG. The vast majority of the additions to DWARF which will
+ be needed to completely support C++ have already been hashed out and agreed
+ upon, but a few small issues (e.g. anonymous unions, access declarations)
+ are still being discussed. Also, we in the PLSIG are still discussing
+ whether or not we need to do anything special for C++ templates. (At this
+ time it is not yet clear whether we even need to do anything special for
+ these.)
+
+ With regard to FORTRAN, the UI/PLSIG has defined what is believed to be a
+ complete and sufficient set of codes and rules for adequately representing
+ all of FORTRAN 77, and most of Fortran 90 in DWARF. While some support for
+ this has been implemented in dwarfout.c, further implementation and testing
+ is needed.
+
+ GNU DWARF support for other languages (i.e. Pascal and Modula) is a moot
+ issue until there are GNU front-ends for these other languages.
+
+ As currently defined, DWARF only describes a (binary) language which can
+ be used to communicate symbolic debugging information from a compiler
+ through an assembler and a linker, to a debugger. There is no clear
+ specification of what processing should be (or must be) done by the
+ assembler and/or the linker. Fortunately, the role of the assembler
+ is easily inferred (by anyone knowledgeable about assemblers) just by
+ looking at examples of assembly-level DWARF code. Sadly though, the
+ allowable (or required) processing steps performed by a linker are
+ harder to infer and (perhaps) even harder to agree upon. There are
+ several forms of very useful `post-processing' steps which intelligent
+ linkers *could* (in theory) perform on object files containing DWARF,
+ but any and all such link-time transformations are currently both disallowed
+ and unspecified.
+
+ In particular, possible link-time transformations of DWARF code which could
+ provide significant benefits include (but are not limited to):
+
+ Commonization of duplicate DIEs obtained from multiple input
+ (object) files.
+
+ Cross-compilation type checking based upon DWARF type information
+ for objects and functions.
+
+ Other possible `compacting' transformations designed to save disk
+ space and to reduce linker & debugger I/O activity.
+
+*/
+
#include "config.h"
#ifdef DWARF_DEBUGGING_INFO
@@ -36,9 +578,6 @@ Boston, MA 02111-1307, USA. */
#include "toplev.h"
#include "tm_p.h"
-/* IMPORTANT NOTE: Please see the file README.DWARF for important details
- regarding the GNU implementation of Dwarf. */
-
/* NOTE: In the comments in this file, many references are made to
so called "Debugging Information Entries". For the sake of brevity,
this term is abbreviated to `DIE' throughout the remainder of this
@@ -811,7 +1350,7 @@ static void retry_incomplete_types PARAMS ((void));
/************************ general utility functions **************************/
-inline static int
+static inline int
is_pseudo_reg (rtl)
register rtx rtl;
{
@@ -820,7 +1359,7 @@ is_pseudo_reg (rtl)
&& (REGNO (XEXP (rtl, 0)) >= FIRST_PSEUDO_REGISTER)));
}
-inline static tree
+static inline tree
type_main_variant (type)
register tree type;
{
@@ -842,7 +1381,7 @@ type_main_variant (type)
/* Return non-zero if the given type node represents a tagged type. */
-inline static int
+static inline int
is_tagged_type (type)
register tree type;
{
@@ -4444,7 +4983,13 @@ output_type (type, containing_scope)
for (func_member = TYPE_METHODS (type);
func_member;
func_member = TREE_CHAIN (func_member))
- output_decl (func_member, type);
+ {
+ /* Don't include clones in the member list. */
+ if (DECL_ABSTRACT_ORIGIN (func_member))
+ continue;
+
+ output_decl (func_member, type);
+ }
}
--in_class;
@@ -4654,7 +5199,7 @@ output_decls_for_scope (stmt, depth)
/* Is this a typedef we can avoid emitting? */
-inline static int
+static inline int
is_redundant_typedef (decl)
register tree decl;
{
diff --git a/gcc/eh-common.h b/gcc/eh-common.h
deleted file mode 100644
index dffe682a05b..00000000000
--- a/gcc/eh-common.h
+++ /dev/null
@@ -1,162 +0,0 @@
-/* EH stuff
- Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
-
-This file is part of GNU CC.
-
-This program is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License as published by the
-Free Software Foundation; either version 2, or (at your option) any
-later version.
-
-This program 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 program; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-
-/* This file contains the structures required for the language
- independent exception handling model. Both the static compiler and
- the runtime library share this file. */
-
-/* The runtime flag flag_new_exceptions is used to determine whether the
- compiler supports the new runtime typechecking mechanism or not. Under
- the new model, runtime info is contained in the exception table, and
- the __throw() library routine determines which handler to call based
- on the results of a call to a matching function provided by the expcetion
- thrower. Otherwise the old scheme of calling any handler which matches
- an exception range is used, and the handler is responsible for all
- checking of runtime conditions. If the handler wasn't suppose to
- get the exception, it performs a re-throw. */
-
-
-/* The handler_label field MUST be the first field in this structure. The
- __throw() library routine expects uses __eh_stub() from except.c, which
- simply dereferences the context pointer to get the handler.
- The routine get_dynamic_handler_chain() also has a dependancy on
- the location of 'dynamic_handler_chain'. If its location is changed,
- that routine must be modified as well. */
-#ifndef EH_ALLOC_SIZE
-/* 192 bytes means the entire eh_context plus malloc overhead fits in 256
- bytes (assuming 8 byte pointers). 192 bytes gives an eh_info and object
- size limit of 96 bytes. This should be sufficient for throwing bad_alloc. */
-#define EH_ALLOC_SIZE 192
-#endif
-#ifndef EH_ALLOC_ALIGN
-/* We can't use BIGGEST_ALIGNMENT, because on some systems, that expands to
- a check on a compile time switch like
- 'target_flags & MASK_ALIGN_DOUBLE ? 64 : 32'. There's no macro for
- 'largest alignment for any code this compiler can build for', which is
- really what is needed. */
-#define EH_ALLOC_ALIGN 16
-#endif
-
-struct eh_context
-{
- void *handler_label;
- void **dynamic_handler_chain;
- /* This is language dependent part of the eh context. */
- void *info;
- /* This is used to remember where we threw for re-throws */
- void *table_index; /* address of exception table entry to rethrow from */
- /* emergency fallback space, if malloc fails during handling */
- char alloc_buffer[EH_ALLOC_SIZE]
- __attribute__((__aligned__(EH_ALLOC_ALIGN)));
- unsigned alloc_mask;
-};
-
-#ifndef EH_TABLE_LOOKUP
-
-typedef struct old_exception_table
-{
- void *start_region;
- void *end_region;
- void *exception_handler;
-} old_exception_table;
-
-typedef struct exception_table
-{
- void *start_region;
- void *end_region;
- void *exception_handler;
- void *match_info; /* runtime type info */
-} exception_table;
-
-
-/* The language identifying portion of an exception table */
-
-typedef struct exception_lang_info
-{
- short language;
- short version;
-} exception_lang_info;
-
-/* This value in the first field of the exception descriptor
- identifies the descriptor as the new model format. This value would never
- be present in this location under the old model */
-
-#define NEW_EH_RUNTIME ((void *) -2)
-
-/* Each function has an exception_descriptor which contains the
- language info, and a table of exception ranges and handlers */
-
-typedef struct exception_descriptor
-{
- void *runtime_id_field;
- exception_lang_info lang;
- exception_table table[1];
-} exception_descriptor;
-
-struct __eh_info; /* forward declaration */
-
-/* A pointer to a matching function is initialized at runtime by the
- specific language if run-time exceptions are supported.
- The function takes 3 parameters
- 1 - runtime exception that has been thrown info. (__eh_info *)
- 2 - Match info pointer from the region being considered (void *)
- 3 - exception table region is in (exception descriptor *)
-*/
-
-typedef void * (*__eh_matcher) PARAMS ((struct __eh_info *, void *,
- struct exception_descriptor *));
-
-/* This value is to be checked as a 'match all' case in the runtime field. */
-
-#define CATCH_ALL_TYPE ((void *) -1)
-
-/* This is the runtime exception information. This forms the minimum required
- information for an exception info pointer in an eh_context structure. */
-
-
-typedef struct __eh_info
-{
- __eh_matcher match_function;
- short language;
- short version;
-} __eh_info;
-
-/* Convienient language codes for ID the originating language. Similar
- to the codes in dwarf2.h. */
-
-enum exception_source_language
- {
- EH_LANG_C89 = 0x0001,
- EH_LANG_C = 0x0002,
- EH_LANG_Ada83 = 0x0003,
- EH_LANG_C_plus_plus = 0x0004,
- EH_LANG_Cobol74 = 0x0005,
- EH_LANG_Cobol85 = 0x0006,
- EH_LANG_Fortran77 = 0x0007,
- EH_LANG_Fortran90 = 0x0008,
- EH_LANG_Pascal83 = 0x0009,
- EH_LANG_Modula2 = 0x000a,
- EH_LANG_Java = 0x000b,
- EH_LANG_Mips_Assembler = 0x8001
- };
-
-#endif /* EH_TABLE_LOOKUP */
-
-
diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c
index 0b9e4aa9e51..4a1d8714b50 100644
--- a/gcc/emit-rtl.c
+++ b/gcc/emit-rtl.c
@@ -177,6 +177,7 @@ static void mark_sequence_stack PARAMS ((struct sequence_stack *));
static void unshare_all_rtl_1 PARAMS ((rtx));
static void unshare_all_decls PARAMS ((tree));
static void reset_used_decls PARAMS ((tree));
+static void mark_label_nuses PARAMS ((rtx));
static hashval_t const_int_htab_hash PARAMS ((const void *));
static int const_int_htab_eq PARAMS ((const void *,
const void *));
@@ -1741,7 +1742,7 @@ unshare_all_rtl (fndecl, insn)
/* Make sure that virtual parameters are not shared. */
for (decl = DECL_ARGUMENTS (fndecl); decl; decl = TREE_CHAIN (decl))
- DECL_RTL (decl) = copy_rtx_if_shared (DECL_RTL (decl));
+ SET_DECL_RTL (decl, copy_rtx_if_shared (DECL_RTL (decl)));
/* Make sure that virtual stack slots are not shared. */
unshare_all_decls (DECL_INITIAL (fndecl));
@@ -1816,7 +1817,8 @@ unshare_all_decls (blk)
/* Copy shared decls. */
for (t = BLOCK_VARS (blk); t; t = TREE_CHAIN (t))
- DECL_RTL (t) = copy_rtx_if_shared (DECL_RTL (t));
+ if (DECL_RTL_SET_P (t))
+ SET_DECL_RTL (t, copy_rtx_if_shared (DECL_RTL (t)));
/* Now process sub-blocks. */
for (t = BLOCK_SUBBLOCKS (blk); t; t = TREE_CHAIN (t))
@@ -1833,7 +1835,8 @@ reset_used_decls (blk)
/* Mark decls. */
for (t = BLOCK_VARS (blk); t; t = TREE_CHAIN (t))
- reset_used_flags (DECL_RTL (t));
+ if (DECL_RTL_SET_P (t))
+ reset_used_flags (DECL_RTL (t));
/* Now process sub-blocks. */
for (t = BLOCK_SUBBLOCKS (blk); t; t = TREE_CHAIN (t))
@@ -2389,6 +2392,32 @@ prev_cc0_setter (insn)
return insn;
}
#endif
+
+/* Increment the label uses for all labels present in rtx. */
+
+static void
+mark_label_nuses (x)
+ rtx x;
+{
+ register enum rtx_code code;
+ register int i, j;
+ register const char *fmt;
+
+ code = GET_CODE (x);
+ if (code == LABEL_REF)
+ LABEL_NUSES (XEXP (x, 0))++;
+
+ fmt = GET_RTX_FORMAT (code);
+ for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--)
+ {
+ if (fmt[i] == 'e')
+ mark_label_nuses (XEXP (x, i));
+ else if (fmt[i] == 'E')
+ for (j = XVECLEN (x, i) - 1; j >= 0; j--)
+ mark_label_nuses (XVECEXP (x, i, j));
+ }
+}
+
/* Try splitting insns that can be split for better scheduling.
PAT is the pattern which might split.
@@ -2426,6 +2455,7 @@ try_split (pat, trial, last)
if (GET_CODE (seq) == SEQUENCE)
{
int i;
+ rtx eh_note;
/* Avoid infinite loop if any insn of the result matches
the original pattern. */
@@ -2448,6 +2478,26 @@ try_split (pat, trial, last)
CALL_INSN_FUNCTION_USAGE (XVECEXP (seq, 0, i))
= CALL_INSN_FUNCTION_USAGE (trial);
+ /* Copy EH notes. */
+ if ((eh_note = find_reg_note (trial, REG_EH_REGION, NULL_RTX)))
+ for (i = 0; i < XVECLEN (seq, 0); i++)
+ {
+ rtx insn = XVECEXP (seq, 0, i);
+ if (GET_CODE (insn) == CALL_INSN
+ || (flag_non_call_exceptions
+ && may_trap_p (PATTERN (insn))))
+ REG_NOTES (insn)
+ = gen_rtx_EXPR_LIST (REG_EH_REGION, XEXP (eh_note, 0),
+ REG_NOTES (insn));
+ }
+
+ /* If there are LABELS inside the split insns increment the
+ usage count so we don't delete the label. */
+ if (GET_CODE (trial) == INSN)
+ for (i = XVECLEN (seq, 0) - 1; i >= 0; i--)
+ if (GET_CODE (XVECEXP (seq, 0, i)) == INSN)
+ mark_label_nuses (PATTERN (XVECEXP (seq, 0, i)));
+
tem = emit_insn_after (seq, before);
delete_insn (trial);
@@ -2847,7 +2897,8 @@ remove_unnecessary_notes ()
abort ();
/* Remove NOTE_INSN_DELETED notes. */
- if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_DELETED)
+ if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_DELETED
+ || NOTE_LINE_NUMBER (insn) == NOTE_INSN_LOOP_END_TOP_COND)
remove_insn (insn);
else if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_BLOCK_END)
{
@@ -4139,9 +4190,9 @@ init_emit_once (line_numbers)
const_tiny_rtx[i][(int) mode] = GEN_INT (i);
}
- for (mode = CCmode; mode < MAX_MACHINE_MODE; ++mode)
- if (GET_MODE_CLASS (mode) == MODE_CC)
- const_tiny_rtx[0][(int) mode] = const0_rtx;
+ for (i = (int) CCmode; i < (int) MAX_MACHINE_MODE; ++i)
+ if (GET_MODE_CLASS ((enum machine_mode) i) == MODE_CC)
+ const_tiny_rtx[0][i] = const0_rtx;
const_tiny_rtx[0][(int) BImode] = const0_rtx;
if (STORE_FLAG_VALUE == 1)
diff --git a/gcc/errors.c b/gcc/errors.c
index 8ccd7d0b2e0..e1a3f13a8fd 100644
--- a/gcc/errors.c
+++ b/gcc/errors.c
@@ -1,5 +1,5 @@
/* Basic error reporting routines.
- Copyright (C) 1999, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -105,6 +105,57 @@ fatal VPARAMS ((const char *format, ...))
exit (FATAL_EXIT_CODE);
}
+/* Similar, but say we got an internal error. */
+
+void
+internal_error VPARAMS ((const char *format, ...))
+{
+#ifndef ANSI_PROTOTYPES
+ const char *format;
+#endif
+ va_list ap;
+
+ VA_START (ap, format);
+
+#ifndef ANSI_PROTOTYPES
+ format = va_arg (ap, const char *);
+#endif
+
+ fprintf (stderr, "%s: Internal error", progname);
+ vfprintf (stderr, format, ap);
+ va_end (ap);
+ fputc ('\n', stderr);
+ exit (FATAL_EXIT_CODE);
+}
+
+/* Given a partial pathname as input, return another pathname that
+ shares no directory elements with the pathname of __FILE__. This
+ is used by fancy_abort() to print `Internal compiler error in expr.c'
+ instead of `Internal compiler error in ../../GCC/gcc/expr.c'. This
+ version if for the gen* programs and so neededn't handle subdirectories. */
+
+const char *
+trim_filename (name)
+ const char *name;
+{
+ static const char this_file[] = __FILE__;
+ const char *p = name, *q = this_file;
+
+ /* Skip any parts the two filenames have in common. */
+ while (*p == *q && *p != 0 && *q != 0)
+ p++, q++;
+
+ /* Now go backwards until the previous directory separator. */
+ while (p > name && p[-1] != DIR_SEPARATOR
+#ifdef DIR_SEPARATOR_2
+ && p[-1] != DIR_SEPARATOR_2
+#endif
+ )
+ p--;
+
+ return p;
+}
+
/* "Fancy" abort. Reports where in the compiler someone gave up.
This file is used only by build programs, so we're not as polite as
the version in diagnostic.c. */
@@ -114,5 +165,5 @@ fancy_abort (file, line, func)
int line;
const char *func;
{
- fatal ("ICE in %s, at %s:%d", func, file, line);
+ internal_error ("abort in %s, at %s:%d", func, file, line);
}
diff --git a/gcc/errors.h b/gcc/errors.h
index e782d2012af..d9988f65256 100644
--- a/gcc/errors.h
+++ b/gcc/errors.h
@@ -1,5 +1,5 @@
/* Basic error reporting routines.
- Copyright (C) 1999, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -25,11 +25,14 @@ Boston, MA 02111-1307, USA. */
#ifndef __GCC_ERRORS_H__
#define __GCC_ERRORS_H__
-extern void warning PARAMS ((const char *format, ...)) ATTRIBUTE_PRINTF_1;
-extern void error PARAMS ((const char *format, ...)) ATTRIBUTE_PRINTF_1;
-extern void fatal PARAMS ((const char *format, ...))
+extern void warning PARAMS ((const char *, ...)) ATTRIBUTE_PRINTF_1;
+extern void error PARAMS ((const char *, ...)) ATTRIBUTE_PRINTF_1;
+extern void fatal PARAMS ((const char *, ...))
ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN;
-extern void fancy_abort PARAMS ((const char *file, int line, const char *func))
+extern void internal_error PARAMS ((const char *, ...))
+ ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN;
+extern const char *trim_filename PARAMS ((const char *));
+extern void fancy_abort PARAMS ((const char *, int, const char *))
ATTRIBUTE_NORETURN;
extern int have_error;
diff --git a/gcc/except.c b/gcc/except.c
index 4770031220a..8307a2572f1 100644
--- a/gcc/except.c
+++ b/gcc/except.c
@@ -1,6 +1,6 @@
/* Implements exception handling.
Copyright (C) 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001 Free Software Foundation, Inc.
+ 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
Contributed by Mike Stump <mrs@cygnus.com>.
This file is part of GNU CC.
@@ -44,1070 +44,954 @@ Boston, MA 02111-1307, USA. */
exception, and thus there is the concept of "throwing" the
exception up the call stack.
- There are two major codegen options for exception handling. The
- flag -fsjlj-exceptions can be used to select the setjmp/longjmp
- approach, which is the default. -fno-sjlj-exceptions can be used to
- get the PC range table approach. While this is a compile time
- flag, an entire application must be compiled with the same codegen
- option. The first is a PC range table approach, the second is a
- setjmp/longjmp based scheme. We will first discuss the PC range
- table approach, after that, we will discuss the setjmp/longjmp
- based approach.
-
- It is appropriate to speak of the "context of a throw". This
- context refers to the address where the exception is thrown from,
- and is used to determine which exception region will handle the
- exception.
-
- Regions of code within a function can be marked such that if it
- contains the context of a throw, control will be passed to a
- designated "exception handler". These areas are known as "exception
- regions". Exception regions cannot overlap, but they can be nested
- to any arbitrary depth. Also, exception regions cannot cross
- function boundaries.
-
- Exception handlers can either be specified by the user (which we
- will call a "user-defined handler") or generated by the compiler
- (which we will designate as a "cleanup"). Cleanups are used to
- perform tasks such as destruction of objects allocated on the
- stack.
-
- In the current implementation, cleanups are handled by allocating an
- exception region for the area that the cleanup is designated for,
- and the handler for the region performs the cleanup and then
- rethrows the exception to the outer exception region. From the
- standpoint of the current implementation, there is little
- distinction made between a cleanup and a user-defined handler, and
- the phrase "exception handler" can be used to refer to either one
- equally well. (The section "Future Directions" below discusses how
- this will change).
-
- Each object file that is compiled with exception handling contains
- a static array of exception handlers named __EXCEPTION_TABLE__.
- Each entry contains the starting and ending addresses of the
- exception region, and the address of the handler designated for
- that region.
-
- If the target does not use the DWARF 2 frame unwind information, at
- program startup each object file invokes a function named
- __register_exceptions with the address of its local
- __EXCEPTION_TABLE__. __register_exceptions is defined in libgcc2.c, and
- is responsible for recording all of the exception regions into one list
- (which is kept in a static variable named exception_table_list).
-
- On targets that support crtstuff.c, the unwind information
- is stored in a section named .eh_frame and the information for the
- entire shared object or program is registered with a call to
- __register_frame_info. On other targets, the information for each
- translation unit is registered from the file generated by collect2.
- __register_frame_info is defined in frame.c, and is responsible for
- recording all of the unwind regions into one list (which is kept in a
- static variable named unwind_table_list).
-
- The function __throw is actually responsible for doing the
- throw. On machines that have unwind info support, __throw is generated
- by code in libgcc2.c, otherwise __throw is generated on a
- per-object-file basis for each source file compiled with
- -fexceptions by the C++ frontend. Before __throw is invoked,
- the current context of the throw needs to be placed in the global
- variable __eh_pc.
-
- __throw attempts to find the appropriate exception handler for the
- PC value stored in __eh_pc by calling __find_first_exception_table_match
- (which is defined in libgcc2.c). If __find_first_exception_table_match
- finds a relevant handler, __throw transfers control directly to it.
-
- If a handler for the context being thrown from can't be found, __throw
- walks (see Walking the stack below) the stack up the dynamic call chain to
- continue searching for an appropriate exception handler based upon the
- caller of the function it last sought a exception handler for. It stops
- then either an exception handler is found, or when the top of the
- call chain is reached.
-
- If no handler is found, an external library function named
- __terminate is called. If a handler is found, then we restart
- our search for a handler at the end of the call chain, and repeat
- the search process, but instead of just walking up the call chain,
- we unwind the call chain as we walk up it.
-
- Internal implementation details:
-
- To associate a user-defined handler with a block of statements, the
- function expand_start_try_stmts is used to mark the start of the
- block of statements with which the handler is to be associated
- (which is known as a "try block"). All statements that appear
- afterwards will be associated with the try block.
-
- A call to expand_start_all_catch marks the end of the try block,
- and also marks the start of the "catch block" (the user-defined
- handler) associated with the try block.
-
- This user-defined handler will be invoked for *every* exception
- thrown with the context of the try block. It is up to the handler
- to decide whether or not it wishes to handle any given exception,
- as there is currently no mechanism in this implementation for doing
- this. (There are plans for conditionally processing an exception
- based on its "type", which will provide a language-independent
- mechanism).
-
- If the handler chooses not to process the exception (perhaps by
- looking at an "exception type" or some other additional data
- supplied with the exception), it can fall through to the end of the
- handler. expand_end_all_catch and expand_leftover_cleanups
- add additional code to the end of each handler to take care of
- rethrowing to the outer exception handler.
-
- The handler also has the option to continue with "normal flow of
- code", or in other words to resume executing at the statement
- immediately after the end of the exception region. The variable
- caught_return_label_stack contains a stack of labels, and jumping
- to the topmost entry's label via expand_goto will resume normal
- flow to the statement immediately after the end of the exception
- region. If the handler falls through to the end, the exception will
- be rethrown to the outer exception region.
-
- The instructions for the catch block are kept as a separate
- sequence, and will be emitted at the end of the function along with
- the handlers specified via expand_eh_region_end. The end of the
- catch block is marked with expand_end_all_catch.
-
- Any data associated with the exception must currently be handled by
- some external mechanism maintained in the frontend. For example,
- the C++ exception mechanism passes an arbitrary value along with
- the exception, and this is handled in the C++ frontend by using a
- global variable to hold the value. (This will be changing in the
- future.)
-
- The mechanism in C++ for handling data associated with the
- exception is clearly not thread-safe. For a thread-based
- environment, another mechanism must be used (possibly using a
- per-thread allocation mechanism if the size of the area that needs
- to be allocated isn't known at compile time.)
-
- Internally-generated exception regions (cleanups) are marked by
- calling expand_eh_region_start to mark the start of the region,
- and expand_eh_region_end (handler) is used to both designate the
- end of the region and to associate a specified handler/cleanup with
- the region. The rtl code in HANDLER will be invoked whenever an
- exception occurs in the region between the calls to
- expand_eh_region_start and expand_eh_region_end. After HANDLER is
- executed, additional code is emitted to handle rethrowing the
- exception to the outer exception handler. The code for HANDLER will
- be emitted at the end of the function.
-
- TARGET_EXPRs can also be used to designate exception regions. A
- TARGET_EXPR gives an unwind-protect style interface commonly used
- in functional languages such as LISP. The associated expression is
- evaluated, and whether or not it (or any of the functions that it
- calls) throws an exception, the protect expression is always
- invoked. This implementation takes care of the details of
- associating an exception table entry with the expression and
- generating the necessary code (it actually emits the protect
- expression twice, once for normal flow and once for the exception
- case). As for the other handlers, the code for the exception case
- will be emitted at the end of the function.
-
- Cleanups can also be specified by using add_partial_entry (handler)
- and end_protect_partials. add_partial_entry creates the start of
- a new exception region; HANDLER will be invoked if an exception is
- thrown with the context of the region between the calls to
- add_partial_entry and end_protect_partials. end_protect_partials is
- used to mark the end of these regions. add_partial_entry can be
- called as many times as needed before calling end_protect_partials.
- However, end_protect_partials should only be invoked once for each
- group of calls to add_partial_entry as the entries are queued
- and all of the outstanding entries are processed simultaneously
- when end_protect_partials is invoked. Similarly to the other
- handlers, the code for HANDLER will be emitted at the end of the
- function.
-
- The generated RTL for an exception region includes
- NOTE_INSN_EH_REGION_BEG and NOTE_INSN_EH_REGION_END notes that mark
- the start and end of the exception region. A unique label is also
- generated at the start of the exception region, which is available
- by looking at the ehstack variable. The topmost entry corresponds
- to the current region.
-
- In the current implementation, an exception can only be thrown from
- a function call (since the mechanism used to actually throw an
- exception involves calling __throw). If an exception region is
- created but no function calls occur within that region, the region
- can be safely optimized away (along with its exception handlers)
- since no exceptions can ever be caught in that region. This
- optimization is performed unless -fasynchronous-exceptions is
- given. If the user wishes to throw from a signal handler, or other
- asynchronous place, -fasynchronous-exceptions should be used when
- compiling for maximally correct code, at the cost of additional
- exception regions. Using -fasynchronous-exceptions only produces
- code that is reasonably safe in such situations, but a correct
- program cannot rely upon this working. It can be used in failsafe
- code, where trying to continue on, and proceeding with potentially
- incorrect results is better than halting the program.
-
-
- Walking the stack:
-
- The stack is walked by starting with a pointer to the current
- frame, and finding the pointer to the callers frame. The unwind info
- tells __throw how to find it.
-
- Unwinding the stack:
-
- When we use the term unwinding the stack, we mean undoing the
- effects of the function prologue in a controlled fashion so that we
- still have the flow of control. Otherwise, we could just return
- (jump to the normal end of function epilogue).
-
- This is done in __throw in libgcc2.c when we know that a handler exists
- in a frame higher up the call stack than its immediate caller.
-
- To unwind, we find the unwind data associated with the frame, if any.
- If we don't find any, we call the library routine __terminate. If we do
- find it, we use the information to copy the saved register values from
- that frame into the register save area in the frame for __throw, return
- into a stub which updates the stack pointer, and jump to the handler.
- The normal function epilogue for __throw handles restoring the saved
- values into registers.
-
- When unwinding, we use this method if we know it will
- work (if DWARF2_UNWIND_INFO is defined). Otherwise, we know that
- an inline unwinder will have been emitted for any function that
- __unwind_function cannot unwind. The inline unwinder appears as a
- normal exception handler for the entire function, for any function
- that we know cannot be unwound by __unwind_function. We inform the
- compiler of whether a function can be unwound with
- __unwind_function by having DOESNT_NEED_UNWINDER evaluate to true
- when the unwinder isn't needed. __unwind_function is used as an
- action of last resort. If no other method can be used for
- unwinding, __unwind_function is used. If it cannot unwind, it
- should call __terminate.
-
- By default, if the target-specific backend doesn't supply a definition
- for __unwind_function and doesn't support DWARF2_UNWIND_INFO, inlined
- unwinders will be used instead. The main tradeoff here is in text space
- utilization. Obviously, if inline unwinders have to be generated
- repeatedly, this uses much more space than if a single routine is used.
-
- However, it is simply not possible on some platforms to write a
- generalized routine for doing stack unwinding without having some
- form of additional data associated with each function. The current
- implementation can encode this data in the form of additional
- machine instructions or as static data in tabular form. The later
- is called the unwind data.
-
- The backend macro DOESNT_NEED_UNWINDER is used to conditionalize whether
- or not per-function unwinders are needed. If DOESNT_NEED_UNWINDER is
- defined and has a non-zero value, a per-function unwinder is not emitted
- for the current function. If the static unwind data is supported, then
- a per-function unwinder is not emitted.
-
- On some platforms it is possible that neither __unwind_function
- nor inlined unwinders are available. For these platforms it is not
- possible to throw through a function call, and abort will be
- invoked instead of performing the throw.
-
- The reason the unwind data may be needed is that on some platforms
- the order and types of data stored on the stack can vary depending
- on the type of function, its arguments and returned values, and the
- compilation options used (optimization versus non-optimization,
- -fomit-frame-pointer, processor variations, etc).
-
- Unfortunately, this also means that throwing through functions that
- aren't compiled with exception handling support will still not be
- possible on some platforms. This problem is currently being
- investigated, but no solutions have been found that do not imply
- some unacceptable performance penalties.
-
- Future directions:
-
- Currently __throw makes no differentiation between cleanups and
- user-defined exception regions. While this makes the implementation
- simple, it also implies that it is impossible to determine if a
- user-defined exception handler exists for a given exception without
- completely unwinding the stack in the process. This is undesirable
- from the standpoint of debugging, as ideally it would be possible
- to trap unhandled exceptions in the debugger before the process of
- unwinding has even started.
-
- This problem can be solved by marking user-defined handlers in a
- special way (probably by adding additional bits to exception_table_list).
- A two-pass scheme could then be used by __throw to iterate
- through the table. The first pass would search for a relevant
- user-defined handler for the current context of the throw, and if
- one is found, the second pass would then invoke all needed cleanups
- before jumping to the user-defined handler.
-
- Many languages (including C++ and Ada) make execution of a
- user-defined handler conditional on the "type" of the exception
- thrown. (The type of the exception is actually the type of the data
- that is thrown with the exception.) It will thus be necessary for
- __throw to be able to determine if a given user-defined
- exception handler will actually be executed, given the type of
- exception.
-
- One scheme is to add additional information to exception_table_list
- as to the types of exceptions accepted by each handler. __throw
- can do the type comparisons and then determine if the handler is
- actually going to be executed.
-
- There is currently no significant level of debugging support
- available, other than to place a breakpoint on __throw. While
- this is sufficient in most cases, it would be helpful to be able to
- know where a given exception was going to be thrown to before it is
- actually thrown, and to be able to choose between stopping before
- every exception region (including cleanups), or just user-defined
- exception regions. This should be possible to do in the two-pass
- scheme by adding additional labels to __throw for appropriate
- breakpoints, and additional debugger commands could be added to
- query various state variables to determine what actions are to be
- performed next.
-
- Another major problem that is being worked on is the issue with stack
- unwinding on various platforms. Currently the only platforms that have
- support for the generation of a generic unwinder are the SPARC and MIPS.
- All other ports require per-function unwinders, which produce large
- amounts of code bloat.
-
- For setjmp/longjmp based exception handling, some of the details
- are as above, but there are some additional details. This section
- discusses the details.
-
- We don't use NOTE_INSN_EH_REGION_{BEG,END} pairs. We don't
- optimize EH regions yet. We don't have to worry about machine
- specific issues with unwinding the stack, as we rely upon longjmp
- for all the machine specific details. There is no variable context
- of a throw, just the one implied by the dynamic handler stack
- pointed to by the dynamic handler chain. There is no exception
- table, and no calls to __register_exceptions. __sjthrow is used
- instead of __throw, and it works by using the dynamic handler
- chain, and longjmp. -fasynchronous-exceptions has no effect, as
- the elimination of trivial exception regions is not yet performed.
-
- A frontend can set protect_cleanup_actions_with_terminate when all
- the cleanup actions should be protected with an EH region that
- calls terminate when an unhandled exception is throw. C++ does
- this, Ada does not. */
+ [ Add updated documentation on how to use this. ] */
#include "config.h"
-#include "eh-common.h"
#include "system.h"
#include "rtl.h"
#include "tree.h"
#include "flags.h"
-#include "except.h"
#include "function.h"
-#include "insn-flags.h"
#include "expr.h"
-#include "insn-codes.h"
-#include "regs.h"
-#include "hard-reg-set.h"
#include "insn-config.h"
-#include "recog.h"
+#include "except.h"
+#include "integrate.h"
+#include "hard-reg-set.h"
+#include "basic-block.h"
#include "output.h"
+#include "dwarf2asm.h"
+#include "dwarf2out.h"
+#include "dwarf2.h"
#include "toplev.h"
+#include "hashtab.h"
#include "intl.h"
-#include "obstack.h"
#include "ggc.h"
#include "tm_p.h"
-/* One to use setjmp/longjmp method of generating code for exception
- handling. */
-int exceptions_via_longjmp = 2;
+/* Provide defaults for stuff that may not be defined when using
+ sjlj exceptions. */
+#ifndef EH_RETURN_STACKADJ_RTX
+#define EH_RETURN_STACKADJ_RTX 0
+#endif
+#ifndef EH_RETURN_HANDLER_RTX
+#define EH_RETURN_HANDLER_RTX 0
+#endif
+#ifndef EH_RETURN_DATA_REGNO
+#define EH_RETURN_DATA_REGNO(N) INVALID_REGNUM
+#endif
-/* One to enable asynchronous exception support. */
-int asynchronous_exceptions = 0;
+/* Nonzero means enable synchronous exceptions for non-call instructions. */
+int flag_non_call_exceptions;
-/* One to protect cleanup actions with a handler that calls
- __terminate, zero otherwise. */
+/* Protect cleanup actions with must-not-throw regions, with a call
+ to the given failure handler. */
+tree (*lang_protect_cleanup_actions) PARAMS ((void));
-int protect_cleanup_actions_with_terminate;
+/* Return true if type A catches type B. */
+int (*lang_eh_type_covers) PARAMS ((tree a, tree b));
-/* A list of labels used for exception handlers. Created by
- find_exception_handler_labels for the optimization passes. */
+/* Map a type to a runtime object to match type. */
+tree (*lang_eh_runtime_type) PARAMS ((tree));
+/* A list of labels used for exception handlers. */
rtx exception_handler_labels;
-/* Keeps track of the label used as the context of a throw to rethrow an
- exception to the outer exception region. */
-
-struct label_node *outer_context_label_stack = NULL;
-
-/* Pseudos used to hold exception return data in the interim between
- __builtin_eh_return and the end of the function. */
+static int call_site_base;
+static int sjlj_funcdef_number;
+static htab_t type_to_runtime_map;
+
+/* Describe the SjLj_Function_Context structure. */
+static tree sjlj_fc_type_node;
+static int sjlj_fc_call_site_ofs;
+static int sjlj_fc_data_ofs;
+static int sjlj_fc_personality_ofs;
+static int sjlj_fc_lsda_ofs;
+static int sjlj_fc_jbuf_ofs;
+
+/* Describes one exception region. */
+struct eh_region
+{
+ /* The immediately surrounding region. */
+ struct eh_region *outer;
-static rtx eh_return_context;
-static rtx eh_return_stack_adjust;
-static rtx eh_return_handler;
+ /* The list of immediately contained regions. */
+ struct eh_region *inner;
+ struct eh_region *next_peer;
-/* This is used for targets which can call rethrow with an offset instead
- of an address. This is subtracted from the rethrow label we are
- interested in. */
+ /* An identifier for this region. */
+ int region_number;
-static rtx first_rethrow_symbol = NULL_RTX;
-static rtx final_rethrow = NULL_RTX;
-static rtx last_rethrow_symbol = NULL_RTX;
+ /* Each region does exactly one thing. */
+ enum eh_region_type
+ {
+ ERT_CLEANUP = 1,
+ ERT_TRY,
+ ERT_CATCH,
+ ERT_ALLOWED_EXCEPTIONS,
+ ERT_MUST_NOT_THROW,
+ ERT_THROW,
+ ERT_FIXUP
+ } type;
+
+ /* Holds the action to perform based on the preceeding type. */
+ union {
+ /* A list of catch blocks, a surrounding try block,
+ and the label for continuing after a catch. */
+ struct {
+ struct eh_region *catch;
+ struct eh_region *last_catch;
+ struct eh_region *prev_try;
+ rtx continue_label;
+ } try;
+
+ /* The list through the catch handlers, the type object
+ matched, and a pointer to the generated code. */
+ struct {
+ struct eh_region *next_catch;
+ struct eh_region *prev_catch;
+ tree type;
+ int filter;
+ } catch;
+
+ /* A tree_list of allowed types. */
+ struct {
+ tree type_list;
+ int filter;
+ } allowed;
+
+ /* The type given by a call to "throw foo();", or discovered
+ for a throw. */
+ struct {
+ tree type;
+ } throw;
+
+ /* Retain the cleanup expression even after expansion so that
+ we can match up fixup regions. */
+ struct {
+ tree exp;
+ } cleanup;
+
+ /* The real region (by expression and by pointer) that fixup code
+ should live in. */
+ struct {
+ tree cleanup_exp;
+ struct eh_region *real_region;
+ } fixup;
+ } u;
+
+ /* Entry point for this region's handler before landing pads are built. */
+ rtx label;
+ /* Entry point for this region's handler from the runtime eh library. */
+ rtx landing_pad;
-/* Prototypes for local functions. */
+ /* Entry point for this region's handler from an inner region. */
+ rtx post_landing_pad;
-static void push_eh_entry PARAMS ((struct eh_stack *));
-static struct eh_entry * pop_eh_entry PARAMS ((struct eh_stack *));
-static void enqueue_eh_entry PARAMS ((struct eh_queue *, struct eh_entry *));
-static struct eh_entry * dequeue_eh_entry PARAMS ((struct eh_queue *));
-static rtx call_get_eh_context PARAMS ((void));
-static void start_dynamic_cleanup PARAMS ((tree, tree));
-static void start_dynamic_handler PARAMS ((void));
-static void expand_rethrow PARAMS ((rtx));
-static void output_exception_table_entry PARAMS ((FILE *, int));
-static rtx scan_region PARAMS ((rtx, int, int *));
-static void eh_regs PARAMS ((rtx *, rtx *, rtx *, int));
-static void set_insn_eh_region PARAMS ((rtx *, int));
-#ifdef DONT_USE_BUILTIN_SETJMP
-static void jumpif_rtx PARAMS ((rtx, rtx));
-#endif
-static void find_exception_handler_labels_1 PARAMS ((rtx));
-static void mark_eh_node PARAMS ((struct eh_node *));
-static void mark_eh_stack PARAMS ((struct eh_stack *));
-static void mark_eh_queue PARAMS ((struct eh_queue *));
-static void mark_tree_label_node PARAMS ((struct label_node *));
-static void mark_func_eh_entry PARAMS ((void *));
-static rtx create_rethrow_ref PARAMS ((int));
-static void push_entry PARAMS ((struct eh_stack *, struct eh_entry*));
-static void receive_exception_label PARAMS ((rtx));
-static int new_eh_region_entry PARAMS ((int, rtx));
-static int find_func_region PARAMS ((int));
-static int find_func_region_from_symbol PARAMS ((rtx));
-static void clear_function_eh_region PARAMS ((void));
-static void process_nestinfo PARAMS ((int, eh_nesting_info *, int *));
-rtx expand_builtin_return_addr PARAMS ((enum built_in_function, int, rtx));
-static void emit_cleanup_handler PARAMS ((struct eh_entry *));
-static int eh_region_from_symbol PARAMS ((rtx));
+ /* The RESX insn for handing off control to the next outermost handler,
+ if appropriate. */
+ rtx resume;
+};
-
-/* Various support routines to manipulate the various data structures
- used by the exception handling code. */
+/* Used to save exception status for each function. */
+struct eh_status
+{
+ /* The tree of all regions for this function. */
+ struct eh_region *region_tree;
-extern struct obstack permanent_obstack;
+ /* The same information as an indexable array. */
+ struct eh_region **region_array;
-/* Generate a SYMBOL_REF for rethrow to use */
+ /* The most recently open region. */
+ struct eh_region *cur_region;
-static rtx
-create_rethrow_ref (region_num)
- int region_num;
-{
- rtx def;
- const char *ptr;
- char buf[60];
+ /* This is the region for which we are processing catch blocks. */
+ struct eh_region *try_region;
- ASM_GENERATE_INTERNAL_LABEL (buf, "LRTH", region_num);
- ptr = ggc_strdup (buf);
- def = gen_rtx_SYMBOL_REF (Pmode, ptr);
- SYMBOL_REF_NEED_ADJUST (def) = 1;
+ /* A stack (TREE_LIST) of lists of handlers. The TREE_VALUE of each
+ node is itself a TREE_CHAINed list of handlers for regions that
+ are not yet closed. The TREE_VALUE of each entry contains the
+ handler for the corresponding entry on the ehstack. */
+ tree protect_list;
- return def;
-}
+ rtx filter;
+ rtx exc_ptr;
-/* Push a label entry onto the given STACK. */
+ int built_landing_pads;
+ int last_region_number;
-void
-push_label_entry (stack, rlabel, tlabel)
- struct label_node **stack;
- rtx rlabel;
- tree tlabel;
-{
- struct label_node *newnode
- = (struct label_node *) xmalloc (sizeof (struct label_node));
+ varray_type ttype_data;
+ varray_type ehspec_data;
+ varray_type action_record_data;
- if (rlabel)
- newnode->u.rlabel = rlabel;
- else
- newnode->u.tlabel = tlabel;
- newnode->chain = *stack;
- *stack = newnode;
-}
+ struct call_site_record
+ {
+ rtx landing_pad;
+ int action;
+ } *call_site_data;
+ int call_site_data_used;
+ int call_site_data_size;
+
+ rtx ehr_stackadj;
+ rtx ehr_handler;
+ rtx ehr_label;
+
+ rtx sjlj_fc;
+ rtx sjlj_exit_after;
+};
-/* Pop a label entry from the given STACK. */
+
+static void mark_eh_region PARAMS ((struct eh_region *));
+
+static int t2r_eq PARAMS ((const PTR,
+ const PTR));
+static hashval_t t2r_hash PARAMS ((const PTR));
+static int t2r_mark_1 PARAMS ((PTR *, PTR));
+static void t2r_mark PARAMS ((PTR));
+static void add_type_for_runtime PARAMS ((tree));
+static tree lookup_type_for_runtime PARAMS ((tree));
+
+static struct eh_region *expand_eh_region_end PARAMS ((void));
+
+static rtx get_exception_filter PARAMS ((struct function *));
+
+static void collect_eh_region_array PARAMS ((void));
+static void resolve_fixup_regions PARAMS ((void));
+static void remove_fixup_regions PARAMS ((void));
+static void convert_from_eh_region_ranges_1 PARAMS ((rtx *, int *, int));
+
+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 add_ttypes_entry PARAMS ((htab_t, tree));
+static int add_ehspec_entry PARAMS ((htab_t, htab_t,
+ tree));
+static void assign_filter_values PARAMS ((void));
+static void build_post_landing_pads PARAMS ((void));
+static void connect_post_landing_pads PARAMS ((void));
+static void dw2_build_landing_pads PARAMS ((void));
+
+struct sjlj_lp_info;
+static bool sjlj_find_directly_reachable_regions
+ PARAMS ((struct sjlj_lp_info *));
+static void sjlj_assign_call_site_values
+ PARAMS ((rtx, struct sjlj_lp_info *));
+static void sjlj_mark_call_sites
+ PARAMS ((struct sjlj_lp_info *));
+static void sjlj_emit_function_enter PARAMS ((rtx));
+static void sjlj_emit_function_exit PARAMS ((void));
+static void sjlj_emit_dispatch_table
+ PARAMS ((rtx, struct sjlj_lp_info *));
+static void sjlj_build_landing_pads PARAMS ((void));
+
+static void remove_exception_handler_label PARAMS ((rtx));
+static void remove_eh_handler PARAMS ((struct eh_region *));
+
+struct reachable_info;
+
+/* The return value of reachable_next_level. */
+enum reachable_code
+{
+ /* The given exception is not processed by the given region. */
+ RNL_NOT_CAUGHT,
+ /* The given exception may need processing by the given region. */
+ RNL_MAYBE_CAUGHT,
+ /* The given exception is completely processed by the given region. */
+ RNL_CAUGHT,
+ /* The given exception is completely processed by the runtime. */
+ RNL_BLOCKED
+};
-rtx
-pop_label_entry (stack)
- struct label_node **stack;
-{
- rtx label;
- struct label_node *tempnode;
+static int check_handled PARAMS ((tree, tree));
+static void add_reachable_handler
+ PARAMS ((struct reachable_info *, struct eh_region *,
+ struct eh_region *));
+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 add_action_record PARAMS ((htab_t, int, int));
+static int collect_one_action_chain PARAMS ((htab_t,
+ struct eh_region *));
+static int add_call_site PARAMS ((rtx, int));
+
+static void push_uleb128 PARAMS ((varray_type *,
+ unsigned int));
+static void push_sleb128 PARAMS ((varray_type *, int));
+#ifndef HAVE_AS_LEB128
+static int dw2_size_of_call_site_table PARAMS ((void));
+static int sjlj_size_of_call_site_table PARAMS ((void));
+#endif
+static void dw2_output_call_site_table PARAMS ((void));
+static void sjlj_output_call_site_table PARAMS ((void));
- if (! *stack)
- return NULL_RTX;
+
+/* Routine to see if exception handling is turned on.
+ DO_WARN is non-zero if we want to inform the user that exception
+ handling is turned off.
- tempnode = *stack;
- label = tempnode->u.rlabel;
- *stack = (*stack)->chain;
- free (tempnode);
+ This is used to ensure that -fexceptions has been specified if the
+ compiler tries to use any exception-specific functions. */
- return label;
+int
+doing_eh (do_warn)
+ int do_warn;
+{
+ if (! flag_exceptions)
+ {
+ static int warned = 0;
+ if (! warned && do_warn)
+ {
+ error ("exception handling disabled, use -fexceptions to enable");
+ warned = 1;
+ }
+ return 0;
+ }
+ return 1;
}
-/* Return the top element of the given STACK. */
-
-tree
-top_label_entry (stack)
- struct label_node **stack;
+
+void
+init_eh ()
{
- if (! *stack)
- return NULL_TREE;
+ ggc_add_rtx_root (&exception_handler_labels, 1);
- return (*stack)->u.tlabel;
-}
+ if (! flag_exceptions)
+ return;
-/* Get an exception label. */
+ type_to_runtime_map = htab_create (31, t2r_hash, t2r_eq, NULL);
+ ggc_add_root (&type_to_runtime_map, 1, sizeof (htab_t), t2r_mark);
-rtx
-gen_exception_label ()
-{
- rtx lab;
- lab = gen_label_rtx ();
- return lab;
-}
+ /* Create the SjLj_Function_Context structure. This should match
+ the definition in unwind-sjlj.c. */
+ if (USING_SJLJ_EXCEPTIONS)
+ {
+ tree f_jbuf, f_per, f_lsda, f_prev, f_cs, f_data, tmp;
-/* Push a new eh_node entry onto STACK. */
+ sjlj_fc_type_node = make_lang_type (RECORD_TYPE);
+ ggc_add_tree_root (&sjlj_fc_type_node, 1);
-static void
-push_eh_entry (stack)
- struct eh_stack *stack;
-{
- struct eh_node *node = (struct eh_node *) xmalloc (sizeof (struct eh_node));
- struct eh_entry *entry = (struct eh_entry *) xmalloc (sizeof (struct eh_entry));
-
- rtx rlab = gen_exception_label ();
- entry->finalization = NULL_TREE;
- entry->label_used = 0;
- entry->exception_handler_label = rlab;
- entry->false_label = NULL_RTX;
- if (! flag_new_exceptions)
- entry->outer_context = gen_label_rtx ();
- else
- entry->outer_context = create_rethrow_ref (CODE_LABEL_NUMBER (rlab));
- entry->rethrow_label = entry->outer_context;
- entry->goto_entry_p = 0;
+ f_prev = build_decl (FIELD_DECL, get_identifier ("__prev"),
+ build_pointer_type (sjlj_fc_type_node));
+ DECL_FIELD_CONTEXT (f_prev) = sjlj_fc_type_node;
- node->entry = entry;
- node->chain = stack->top;
- stack->top = node;
-}
+ f_cs = build_decl (FIELD_DECL, get_identifier ("__call_site"),
+ integer_type_node);
+ DECL_FIELD_CONTEXT (f_cs) = sjlj_fc_type_node;
-/* Push an existing entry onto a stack. */
+ tmp = build_index_type (build_int_2 (4 - 1, 0));
+ tmp = build_array_type (type_for_mode (word_mode, 1), tmp);
+ f_data = build_decl (FIELD_DECL, get_identifier ("__data"), tmp);
+ DECL_FIELD_CONTEXT (f_data) = sjlj_fc_type_node;
-static void
-push_entry (stack, entry)
- struct eh_stack *stack;
- struct eh_entry *entry;
-{
- struct eh_node *node = (struct eh_node *) xmalloc (sizeof (struct eh_node));
- node->entry = entry;
- node->chain = stack->top;
- stack->top = node;
-}
+ f_per = build_decl (FIELD_DECL, get_identifier ("__personality"),
+ ptr_type_node);
+ DECL_FIELD_CONTEXT (f_per) = sjlj_fc_type_node;
-/* Pop an entry from the given STACK. */
+ f_lsda = build_decl (FIELD_DECL, get_identifier ("__lsda"),
+ ptr_type_node);
+ DECL_FIELD_CONTEXT (f_lsda) = sjlj_fc_type_node;
-static struct eh_entry *
-pop_eh_entry (stack)
- struct eh_stack *stack;
-{
- struct eh_node *tempnode;
- struct eh_entry *tempentry;
-
- tempnode = stack->top;
- tempentry = tempnode->entry;
- stack->top = stack->top->chain;
- free (tempnode);
+#ifdef DONT_USE_BUILTIN_SETJMP
+#ifdef JMP_BUF_SIZE
+ tmp = build_int_2 (JMP_BUF_SIZE - 1, 0);
+#else
+ /* Should be large enough for most systems, if it is not,
+ JMP_BUF_SIZE should be defined with the proper value. It will
+ also tend to be larger than necessary for most systems, a more
+ optimal port will define JMP_BUF_SIZE. */
+ tmp = build_int_2 (FIRST_PSEUDO_REGISTER + 2 - 1, 0);
+#endif
+#else
+ /* This is 2 for builtin_setjmp, plus whatever the target requires
+ via STACK_SAVEAREA_MODE (SAVE_NONLOCAL). */
+ tmp = build_int_2 ((GET_MODE_SIZE (STACK_SAVEAREA_MODE (SAVE_NONLOCAL))
+ / GET_MODE_SIZE (Pmode)) + 2 - 1, 0);
+#endif
+ tmp = build_index_type (tmp);
+ tmp = build_array_type (ptr_type_node, tmp);
+ f_jbuf = build_decl (FIELD_DECL, get_identifier ("__jbuf"), tmp);
+#ifdef DONT_USE_BUILTIN_SETJMP
+ /* We don't know what the alignment requirements of the
+ runtime's jmp_buf has. Overestimate. */
+ DECL_ALIGN (f_jbuf) = BIGGEST_ALIGNMENT;
+ DECL_USER_ALIGN (f_jbuf) = 1;
+#endif
+ DECL_FIELD_CONTEXT (f_jbuf) = sjlj_fc_type_node;
+
+ TYPE_FIELDS (sjlj_fc_type_node) = f_prev;
+ TREE_CHAIN (f_prev) = f_cs;
+ TREE_CHAIN (f_cs) = f_data;
+ TREE_CHAIN (f_data) = f_per;
+ TREE_CHAIN (f_per) = f_lsda;
+ TREE_CHAIN (f_lsda) = f_jbuf;
+
+ layout_type (sjlj_fc_type_node);
+
+ /* Cache the interesting field offsets so that we have
+ easy access from rtl. */
+ sjlj_fc_call_site_ofs
+ = (tree_low_cst (DECL_FIELD_OFFSET (f_cs), 1)
+ + tree_low_cst (DECL_FIELD_BIT_OFFSET (f_cs), 1) / BITS_PER_UNIT);
+ sjlj_fc_data_ofs
+ = (tree_low_cst (DECL_FIELD_OFFSET (f_data), 1)
+ + tree_low_cst (DECL_FIELD_BIT_OFFSET (f_data), 1) / BITS_PER_UNIT);
+ sjlj_fc_personality_ofs
+ = (tree_low_cst (DECL_FIELD_OFFSET (f_per), 1)
+ + tree_low_cst (DECL_FIELD_BIT_OFFSET (f_per), 1) / BITS_PER_UNIT);
+ sjlj_fc_lsda_ofs
+ = (tree_low_cst (DECL_FIELD_OFFSET (f_lsda), 1)
+ + tree_low_cst (DECL_FIELD_BIT_OFFSET (f_lsda), 1) / BITS_PER_UNIT);
+ sjlj_fc_jbuf_ofs
+ = (tree_low_cst (DECL_FIELD_OFFSET (f_jbuf), 1)
+ + tree_low_cst (DECL_FIELD_BIT_OFFSET (f_jbuf), 1) / BITS_PER_UNIT);
+ }
+}
- return tempentry;
+void
+init_eh_for_function ()
+{
+ cfun->eh = (struct eh_status *) xcalloc (1, sizeof (struct eh_status));
}
-/* Enqueue an ENTRY onto the given QUEUE. */
+/* Mark EH for GC. */
static void
-enqueue_eh_entry (queue, entry)
- struct eh_queue *queue;
- struct eh_entry *entry;
+mark_eh_region (region)
+ struct eh_region *region;
{
- struct eh_node *node = (struct eh_node *) xmalloc (sizeof (struct eh_node));
+ if (! region)
+ return;
- node->entry = entry;
- node->chain = NULL;
+ switch (region->type)
+ {
+ case ERT_CLEANUP:
+ ggc_mark_tree (region->u.cleanup.exp);
+ break;
+ case ERT_TRY:
+ ggc_mark_rtx (region->u.try.continue_label);
+ break;
+ case ERT_CATCH:
+ ggc_mark_tree (region->u.catch.type);
+ break;
+ case ERT_ALLOWED_EXCEPTIONS:
+ ggc_mark_tree (region->u.allowed.type_list);
+ break;
+ case ERT_MUST_NOT_THROW:
+ break;
+ case ERT_THROW:
+ ggc_mark_tree (region->u.throw.type);
+ break;
+ case ERT_FIXUP:
+ ggc_mark_tree (region->u.fixup.cleanup_exp);
+ break;
+ default:
+ abort ();
+ }
- if (queue->head == NULL)
- queue->head = node;
- else
- queue->tail->chain = node;
- queue->tail = node;
+ ggc_mark_rtx (region->label);
+ ggc_mark_rtx (region->resume);
+ ggc_mark_rtx (region->landing_pad);
+ ggc_mark_rtx (region->post_landing_pad);
}
-/* Dequeue an entry from the given QUEUE. */
-
-static struct eh_entry *
-dequeue_eh_entry (queue)
- struct eh_queue *queue;
+void
+mark_eh_status (eh)
+ struct eh_status *eh;
{
- struct eh_node *tempnode;
- struct eh_entry *tempentry;
+ int i;
- if (queue->head == NULL)
- return NULL;
+ if (eh == 0)
+ return;
- tempnode = queue->head;
- queue->head = queue->head->chain;
+ /* If we've called collect_eh_region_array, use it. Otherwise walk
+ the tree non-recursively. */
+ if (eh->region_array)
+ {
+ for (i = eh->last_region_number; i > 0; --i)
+ {
+ struct eh_region *r = eh->region_array[i];
+ if (r && r->region_number == i)
+ mark_eh_region (r);
+ }
+ }
+ else if (eh->region_tree)
+ {
+ struct eh_region *r = eh->region_tree;
+ while (1)
+ {
+ mark_eh_region (r);
+ if (r->inner)
+ r = r->inner;
+ else if (r->next_peer)
+ r = r->next_peer;
+ else
+ {
+ do {
+ r = r->outer;
+ if (r == NULL)
+ goto tree_done;
+ } while (r->next_peer == NULL);
+ r = r->next_peer;
+ }
+ }
+ tree_done:;
+ }
+
+ ggc_mark_tree (eh->protect_list);
+ ggc_mark_rtx (eh->filter);
+ ggc_mark_rtx (eh->exc_ptr);
+ ggc_mark_tree_varray (eh->ttype_data);
- tempentry = tempnode->entry;
- free (tempnode);
+ if (eh->call_site_data)
+ {
+ for (i = eh->call_site_data_used - 1; i >= 0; --i)
+ ggc_mark_rtx (eh->call_site_data[i].landing_pad);
+ }
+
+ ggc_mark_rtx (eh->ehr_stackadj);
+ ggc_mark_rtx (eh->ehr_handler);
+ ggc_mark_rtx (eh->ehr_label);
- return tempentry;
+ ggc_mark_rtx (eh->sjlj_fc);
+ ggc_mark_rtx (eh->sjlj_exit_after);
}
-static void
-receive_exception_label (handler_label)
- rtx handler_label;
+void
+free_eh_status (f)
+ struct function *f;
{
- rtx around_label = NULL_RTX;
+ struct eh_status *eh = f->eh;
- if (! flag_new_exceptions || exceptions_via_longjmp)
+ if (eh->region_array)
{
- around_label = gen_label_rtx ();
- emit_jump (around_label);
- emit_barrier ();
+ int i;
+ for (i = eh->last_region_number; i > 0; --i)
+ {
+ struct eh_region *r = eh->region_array[i];
+ /* Mind we don't free a region struct more than once. */
+ if (r && r->region_number == i)
+ free (r);
+ }
+ free (eh->region_array);
+ }
+ else if (eh->region_tree)
+ {
+ struct eh_region *next, *r = eh->region_tree;
+ while (1)
+ {
+ if (r->inner)
+ r = r->inner;
+ else if (r->next_peer)
+ {
+ next = r->next_peer;
+ free (r);
+ r = next;
+ }
+ else
+ {
+ do {
+ next = r->outer;
+ free (r);
+ r = next;
+ if (r == NULL)
+ goto tree_done;
+ } while (r->next_peer == NULL);
+ next = r->next_peer;
+ free (r);
+ r = next;
+ }
+ }
+ tree_done:;
}
- emit_label (handler_label);
-
- if (! exceptions_via_longjmp)
+ VARRAY_FREE (eh->ttype_data);
+ VARRAY_FREE (eh->ehspec_data);
+ VARRAY_FREE (eh->action_record_data);
+ if (eh->call_site_data)
+ free (eh->call_site_data);
+
+ free (eh);
+ f->eh = NULL;
+}
+
+
+/* Start an exception handling region. All instructions emitted
+ after this point are considered to be part of the region until
+ expand_eh_region_end is invoked. */
+
+void
+expand_eh_region_start ()
+{
+ struct eh_region *new_region;
+ struct eh_region *cur_region;
+ rtx note;
+
+ if (! doing_eh (0))
+ return;
+
+ /* Insert a new blank region as a leaf in the tree. */
+ new_region = (struct eh_region *) xcalloc (1, sizeof (*new_region));
+ cur_region = cfun->eh->cur_region;
+ new_region->outer = cur_region;
+ if (cur_region)
{
-#ifdef HAVE_exception_receiver
- if (HAVE_exception_receiver)
- emit_insn (gen_exception_receiver ());
- else
-#endif
-#ifdef HAVE_nonlocal_goto_receiver
- if (HAVE_nonlocal_goto_receiver)
- emit_insn (gen_nonlocal_goto_receiver ());
- else
-#endif
- { /* Nothing */ }
+ new_region->next_peer = cur_region->inner;
+ cur_region->inner = new_region;
}
else
{
-#ifndef DONT_USE_BUILTIN_SETJMP
- expand_builtin_setjmp_receiver (handler_label);
-#endif
+ new_region->next_peer = cfun->eh->region_tree;
+ cfun->eh->region_tree = new_region;
}
+ cfun->eh->cur_region = new_region;
- if (around_label)
- emit_label (around_label);
+ /* 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_EH_HANDLER (note) = new_region->region_number;
}
+/* Common code to end a region. Returns the region just ended. */
-struct func_eh_entry
+static struct eh_region *
+expand_eh_region_end ()
{
- int range_number; /* EH region number from EH NOTE insn's. */
- rtx rethrow_label; /* Label for rethrow. */
- int rethrow_ref; /* Is rethrow_label referenced? */
- int emitted; /* 1 if this entry has been emitted in assembly file. */
- struct handler_info *handlers;
-};
+ struct eh_region *cur_region = cfun->eh->cur_region;
+ rtx note;
+ /* Create a nute marking the end of this region. */
+ note = emit_note (NULL, NOTE_INSN_EH_REGION_END);
+ NOTE_EH_HANDLER (note) = cur_region->region_number;
-/* table of function eh regions */
-static struct func_eh_entry *function_eh_regions = NULL;
-static int num_func_eh_entries = 0;
-static int current_func_eh_entry = 0;
+ /* Pop. */
+ cfun->eh->cur_region = cur_region->outer;
-#define SIZE_FUNC_EH(X) (sizeof (struct func_eh_entry) * X)
+ return cur_region;
+}
-/* Add a new eh_entry for this function. The number returned is an
- number which uniquely identifies this exception range. */
+/* End an exception handling region for a cleanup. HANDLER is an
+ expression to expand for the cleanup. */
-static int
-new_eh_region_entry (note_eh_region, rethrow)
- int note_eh_region;
- rtx rethrow;
+void
+expand_eh_region_end_cleanup (handler)
+ tree handler;
{
- if (current_func_eh_entry == num_func_eh_entries)
- {
- if (num_func_eh_entries == 0)
- {
- function_eh_regions =
- (struct func_eh_entry *) xmalloc (SIZE_FUNC_EH (50));
- num_func_eh_entries = 50;
- }
- else
- {
- num_func_eh_entries = num_func_eh_entries * 3 / 2;
- function_eh_regions = (struct func_eh_entry *)
- xrealloc (function_eh_regions, SIZE_FUNC_EH (num_func_eh_entries));
- }
- }
- function_eh_regions[current_func_eh_entry].range_number = note_eh_region;
- if (rethrow == NULL_RTX)
- function_eh_regions[current_func_eh_entry].rethrow_label =
- create_rethrow_ref (note_eh_region);
- else
- function_eh_regions[current_func_eh_entry].rethrow_label = rethrow;
- function_eh_regions[current_func_eh_entry].handlers = NULL;
- function_eh_regions[current_func_eh_entry].emitted = 0;
-
- return current_func_eh_entry++;
-}
-
-/* Add new handler information to an exception range. The first parameter
- specifies the range number (returned from new_eh_entry()). The second
- parameter specifies the handler. By default the handler is inserted at
- the end of the list. A handler list may contain only ONE NULL_TREE
- typeinfo entry. Regardless where it is positioned, a NULL_TREE entry
- is always output as the LAST handler in the exception table for a region. */
-
-void
-add_new_handler (region, newhandler)
- int region;
- struct handler_info *newhandler;
-{
- struct handler_info *last;
-
- /* If find_func_region returns -1, callers might attempt to pass us
- this region number. If that happens, something has gone wrong;
- -1 is never a valid region. */
- if (region == -1)
- abort ();
+ struct eh_region *region;
+ tree protect_cleanup_actions;
+ rtx around_label;
+ rtx data_save[2];
- newhandler->next = NULL;
- last = function_eh_regions[region].handlers;
- if (last == NULL)
- function_eh_regions[region].handlers = newhandler;
- else
- {
- for ( ; ; last = last->next)
- {
- if (last->type_info == CATCH_ALL_TYPE)
- pedwarn ("additional handler after ...");
- if (last->next == NULL)
- break;
- }
- last->next = newhandler;
- }
-}
+ if (! doing_eh (0))
+ return;
-/* Remove a handler label. The handler label is being deleted, so all
- regions which reference this handler should have it removed from their
- list of possible handlers. Any region which has the final handler
- removed can be deleted. */
+ region = expand_eh_region_end ();
+ region->type = ERT_CLEANUP;
+ region->label = gen_label_rtx ();
+ region->u.cleanup.exp = handler;
-void remove_handler (removing_label)
- rtx removing_label;
-{
- struct handler_info *handler, *last;
- int x;
- for (x = 0 ; x < current_func_eh_entry; ++x)
- {
- last = NULL;
- handler = function_eh_regions[x].handlers;
- for ( ; handler; last = handler, handler = handler->next)
- if (handler->handler_label == removing_label)
- {
- if (last)
- {
- last->next = handler->next;
- handler = last;
- }
- else
- function_eh_regions[x].handlers = handler->next;
- }
- }
-}
+ around_label = gen_label_rtx ();
+ emit_jump (around_label);
-/* This function will return a malloc'd pointer to an array of
- void pointer representing the runtime match values that
- currently exist in all regions. */
+ emit_label (region->label);
-int
-find_all_handler_type_matches (array)
- void ***array;
-{
- struct handler_info *handler, *last;
- int x,y;
- void *val;
- void **ptr;
- int max_ptr;
- int n_ptr = 0;
+ /* Give the language a chance to specify an action to be taken if an
+ exception is thrown that would propogate out of the HANDLER. */
+ protect_cleanup_actions
+ = (lang_protect_cleanup_actions
+ ? (*lang_protect_cleanup_actions) ()
+ : NULL_TREE);
- *array = NULL;
+ if (protect_cleanup_actions)
+ expand_eh_region_start ();
- if (!doing_eh (0) || ! flag_new_exceptions)
- return 0;
+ /* In case this cleanup involves an inline destructor with a try block in
+ it, we need to save the EH return data registers around it. */
+ data_save[0] = gen_reg_rtx (Pmode);
+ emit_move_insn (data_save[0], get_exception_pointer (cfun));
+ data_save[1] = gen_reg_rtx (word_mode);
+ emit_move_insn (data_save[1], get_exception_filter (cfun));
- max_ptr = 100;
- ptr = (void **) xmalloc (max_ptr * sizeof (void *));
+ expand_expr (handler, const0_rtx, VOIDmode, 0);
- for (x = 0 ; x < current_func_eh_entry; x++)
- {
- last = NULL;
- handler = function_eh_regions[x].handlers;
- for ( ; handler; last = handler, handler = handler->next)
- {
- val = handler->type_info;
- if (val != NULL && val != CATCH_ALL_TYPE)
- {
- /* See if this match value has already been found. */
- for (y = 0; y < n_ptr; y++)
- if (ptr[y] == val)
- break;
+ emit_move_insn (cfun->eh->exc_ptr, data_save[0]);
+ emit_move_insn (cfun->eh->filter, data_save[1]);
- /* If we break early, we already found this value. */
- if (y < n_ptr)
- continue;
+ if (protect_cleanup_actions)
+ expand_eh_region_end_must_not_throw (protect_cleanup_actions);
- /* Do we need to allocate more space? */
- if (n_ptr >= max_ptr)
- {
- max_ptr += max_ptr / 2;
- ptr = (void **) xrealloc (ptr, max_ptr * sizeof (void *));
- }
- ptr[n_ptr] = val;
- n_ptr++;
- }
- }
- }
+ /* We need any stack adjustment complete before the around_label. */
+ do_pending_stack_adjust ();
- if (n_ptr == 0)
- {
- free (ptr);
- ptr = NULL;
- }
- *array = ptr;
- return n_ptr;
+ /* We delay the generation of the _Unwind_Resume until we generate
+ landing pads. We emit a marker here so as to get good control
+ flow data in the meantime. */
+ region->resume
+ = emit_jump_insn (gen_rtx_RESX (VOIDmode, region->region_number));
+ emit_barrier ();
+
+ emit_label (around_label);
}
-/* Create a new handler structure initialized with the handler label and
- typeinfo fields passed in. */
+/* End an exception handling region for a try block, and prepares
+ for subsequent calls to expand_start_catch. */
-struct handler_info *
-get_new_handler (handler, typeinfo)
- rtx handler;
- void *typeinfo;
+void
+expand_start_all_catch ()
{
- struct handler_info* ptr;
- ptr = (struct handler_info *) xmalloc (sizeof (struct handler_info));
- ptr->handler_label = handler;
- ptr->handler_number = CODE_LABEL_NUMBER (handler);
- ptr->type_info = typeinfo;
- ptr->next = NULL;
+ struct eh_region *region;
- return ptr;
-}
+ if (! doing_eh (1))
+ return;
+ region = expand_eh_region_end ();
+ region->type = ERT_TRY;
+ region->u.try.prev_try = cfun->eh->try_region;
+ region->u.try.continue_label = gen_label_rtx ();
+ cfun->eh->try_region = region;
+
+ emit_jump (region->u.try.continue_label);
+}
-/* Find the index in function_eh_regions associated with a NOTE region. If
- the region cannot be found, a -1 is returned. */
+/* Begin a catch clause. TYPE is the type caught, or null if this is
+ a catch-all clause. */
-static int
-find_func_region (insn_region)
- int insn_region;
+void
+expand_start_catch (type)
+ tree type;
{
- int x;
- for (x = 0; x < current_func_eh_entry; x++)
- if (function_eh_regions[x].range_number == insn_region)
- return x;
+ struct eh_region *t, *c, *l;
+
+ if (! doing_eh (0))
+ return;
+
+ if (type)
+ add_type_for_runtime (type);
+ expand_eh_region_start ();
+
+ t = cfun->eh->try_region;
+ c = cfun->eh->cur_region;
+ c->type = ERT_CATCH;
+ c->u.catch.type = type;
+ c->label = gen_label_rtx ();
+
+ l = t->u.try.last_catch;
+ c->u.catch.prev_catch = l;
+ if (l)
+ l->u.catch.next_catch = c;
+ else
+ t->u.try.catch = c;
+ t->u.try.last_catch = c;
- return -1;
+ emit_label (c->label);
}
-/* Get a pointer to the first handler in an exception region's list. */
+/* End a catch clause. Control will resume after the try/catch block. */
-struct handler_info *
-get_first_handler (region)
- int region;
+void
+expand_end_catch ()
{
- int r = find_func_region (region);
- if (r == -1)
- abort ();
- return function_eh_regions[r].handlers;
+ struct eh_region *try_region, *catch_region;
+
+ if (! doing_eh (0))
+ return;
+
+ catch_region = expand_eh_region_end ();
+ try_region = cfun->eh->try_region;
+
+ emit_jump (try_region->u.try.continue_label);
}
-/* Clean out the function_eh_region table and free all memory */
+/* End a sequence of catch handlers for a try block. */
-static void
-clear_function_eh_region ()
+void
+expand_end_all_catch ()
{
- int x;
- struct handler_info *ptr, *next;
- for (x = 0; x < current_func_eh_entry; x++)
- for (ptr = function_eh_regions[x].handlers; ptr != NULL; ptr = next)
- {
- next = ptr->next;
- free (ptr);
- }
- if (function_eh_regions)
- free (function_eh_regions);
- num_func_eh_entries = 0;
- current_func_eh_entry = 0;
+ struct eh_region *try_region;
+
+ if (! doing_eh (0))
+ return;
+
+ try_region = cfun->eh->try_region;
+ cfun->eh->try_region = try_region->u.try.prev_try;
+
+ emit_label (try_region->u.try.continue_label);
}
-/* Make a duplicate of an exception region by copying all the handlers
- for an exception region. Return the new handler index. The final
- parameter is a routine which maps old labels to new ones. */
+/* End an exception region for an exception type filter. ALLOWED is a
+ TREE_LIST of types to be matched by the runtime. FAILURE is an
+ expression to invoke if a mismatch ocurrs. */
-int
-duplicate_eh_handlers (old_note_eh_region, new_note_eh_region, map)
- int old_note_eh_region, new_note_eh_region;
- rtx (*map) PARAMS ((rtx));
+void
+expand_eh_region_end_allowed (allowed, failure)
+ tree allowed, failure;
{
- struct handler_info *ptr, *new_ptr;
- int new_region, region;
+ struct eh_region *region;
+ rtx around_label;
- region = find_func_region (old_note_eh_region);
- if (region == -1)
- /* Cannot duplicate non-existant exception region. */
- abort ();
+ if (! doing_eh (0))
+ return;
- /* duplicate_eh_handlers may have been called during a symbol remap. */
- new_region = find_func_region (new_note_eh_region);
- if (new_region != -1)
- return (new_region);
+ region = expand_eh_region_end ();
+ region->type = ERT_ALLOWED_EXCEPTIONS;
+ region->u.allowed.type_list = allowed;
+ region->label = gen_label_rtx ();
- new_region = new_eh_region_entry (new_note_eh_region, NULL_RTX);
+ for (; allowed ; allowed = TREE_CHAIN (allowed))
+ add_type_for_runtime (TREE_VALUE (allowed));
- ptr = function_eh_regions[region].handlers;
+ /* We must emit the call to FAILURE here, so that if this function
+ throws a different exception, that it will be processed by the
+ correct region. */
- for ( ; ptr; ptr = ptr->next)
- {
- new_ptr = get_new_handler (map (ptr->handler_label), ptr->type_info);
- add_new_handler (new_region, new_ptr);
- }
+ /* If there are any pending stack adjustments, we must emit them
+ before we branch -- otherwise, we won't know how much adjustment
+ is required later. */
+ do_pending_stack_adjust ();
+ around_label = gen_label_rtx ();
+ emit_jump (around_label);
+
+ emit_label (region->label);
+ expand_expr (failure, const0_rtx, VOIDmode, EXPAND_NORMAL);
+ /* We must adjust the stack before we reach the AROUND_LABEL because
+ the call to FAILURE does not occur on all paths to the
+ AROUND_LABEL. */
+ do_pending_stack_adjust ();
- return new_region;
+ emit_label (around_label);
}
+/* End an exception region for a must-not-throw filter. FAILURE is an
+ expression invoke if an uncaught exception propagates this far.
-/* Given a rethrow symbol, find the EH region number this is for. */
+ This is conceptually identical to expand_eh_region_end_allowed with
+ an empty allowed list (if you passed "std::terminate" instead of
+ "__cxa_call_unexpected"), but they are represented differently in
+ the C++ LSDA. */
-static int
-eh_region_from_symbol (sym)
- rtx sym;
+void
+expand_eh_region_end_must_not_throw (failure)
+ tree failure;
{
- int x;
- if (sym == last_rethrow_symbol)
- return 1;
- for (x = 0; x < current_func_eh_entry; x++)
- if (function_eh_regions[x].rethrow_label == sym)
- return function_eh_regions[x].range_number;
- return -1;
+ struct eh_region *region;
+ rtx around_label;
+
+ if (! doing_eh (0))
+ return;
+
+ region = expand_eh_region_end ();
+ region->type = ERT_MUST_NOT_THROW;
+ region->label = gen_label_rtx ();
+
+ /* We must emit the call to FAILURE here, so that if this function
+ throws a different exception, that it will be processed by the
+ correct region. */
+
+ around_label = gen_label_rtx ();
+ emit_jump (around_label);
+
+ emit_label (region->label);
+ expand_expr (failure, const0_rtx, VOIDmode, EXPAND_NORMAL);
+
+ emit_label (around_label);
}
-/* Like find_func_region, but using the rethrow symbol for the region
- rather than the region number itself. */
+/* End an exception region for a throw. No handling goes on here,
+ but it's the easiest way for the front-end to indicate what type
+ is being thrown. */
-static int
-find_func_region_from_symbol (sym)
- rtx sym;
+void
+expand_eh_region_end_throw (type)
+ tree type;
{
- return find_func_region (eh_region_from_symbol (sym));
+ struct eh_region *region;
+
+ if (! doing_eh (0))
+ return;
+
+ region = expand_eh_region_end ();
+ region->type = ERT_THROW;
+ region->u.throw.type = type;
}
-/* When inlining/unrolling, we have to map the symbols passed to
- __rethrow as well. This performs the remap. If a symbol isn't foiund,
- the original one is returned. This is not an efficient routine,
- so don't call it on everything!! */
+/* End a fixup region. Within this region the cleanups for the immediately
+ enclosing region are _not_ run. This is used for goto cleanup to avoid
+ destroying an object twice.
+
+ This would be an extraordinarily simple prospect, were it not for the
+ fact that we don't actually know what the immediately enclosing region
+ is. This surprising fact is because expand_cleanups is currently
+ generating a sequence that it will insert somewhere else. We collect
+ the proper notion of "enclosing" in convert_from_eh_region_ranges. */
-rtx
-rethrow_symbol_map (sym, map)
- rtx sym;
- rtx (*map) PARAMS ((rtx));
+void
+expand_eh_region_end_fixup (handler)
+ tree handler;
{
- int x, y;
+ struct eh_region *fixup;
- if (! flag_new_exceptions)
- return sym;
+ if (! doing_eh (0))
+ return;
- for (x = 0; x < current_func_eh_entry; x++)
- if (function_eh_regions[x].rethrow_label == sym)
- {
- /* We've found the original region, now lets determine which region
- this now maps to. */
- rtx l1 = function_eh_regions[x].handlers->handler_label;
- rtx l2 = map (l1);
- y = CODE_LABEL_NUMBER (l2); /* This is the new region number */
- x = find_func_region (y); /* Get the new permanent region */
- if (x == -1) /* Hmm, Doesn't exist yet */
- {
- x = duplicate_eh_handlers (CODE_LABEL_NUMBER (l1), y, map);
- /* Since we're mapping it, it must be used. */
- function_eh_regions[x].rethrow_ref = 1;
- }
- return function_eh_regions[x].rethrow_label;
- }
- return sym;
+ fixup = expand_eh_region_end ();
+ fixup->type = ERT_FIXUP;
+ fixup->u.fixup.cleanup_exp = handler;
}
-/* Returns nonzero if the rethrow label for REGION is referenced
- somewhere (i.e. we rethrow out of REGION or some other region
- masquerading as REGION). */
+/* Return an rtl expression for a pointer to the exception object
+ within a handler. */
-int
-rethrow_used (region)
- int region;
+rtx
+get_exception_pointer (fun)
+ struct function *fun;
{
- if (flag_new_exceptions)
+ rtx exc_ptr = fun->eh->exc_ptr;
+ if (fun == cfun && ! exc_ptr)
{
- int ret = function_eh_regions[find_func_region (region)].rethrow_ref;
- return ret;
+ exc_ptr = gen_reg_rtx (Pmode);
+ fun->eh->exc_ptr = exc_ptr;
}
- return 0;
+ return exc_ptr;
}
-
-/* Routine to see if exception handling is turned on.
- DO_WARN is non-zero if we want to inform the user that exception
- handling is turned off.
+/* Return an rtl expression for the exception dispatch filter
+ within a handler. */
- This is used to ensure that -fexceptions has been specified if the
- compiler tries to use any exception-specific functions. */
-
-int
-doing_eh (do_warn)
- int do_warn;
+static rtx
+get_exception_filter (fun)
+ struct function *fun;
{
- if (! flag_exceptions)
+ rtx filter = fun->eh->filter;
+ if (fun == cfun && ! filter)
{
- static int warned = 0;
- if (! warned && do_warn)
- {
- error ("exception handling disabled, use -fexceptions to enable");
- warned = 1;
- }
- return 0;
+ filter = gen_reg_rtx (word_mode);
+ fun->eh->filter = filter;
}
- return 1;
+ return filter;
}
+
+/* Begin a region that will contain entries created with
+ add_partial_entry. */
-/* Given a return address in ADDR, determine the address we should use
- to find the corresponding EH region. */
-
-rtx
-eh_outer_context (addr)
- rtx addr;
+void
+begin_protect_partials ()
{
- /* First mask out any unwanted bits. */
-#ifdef MASK_RETURN_ADDR
- expand_and (addr, MASK_RETURN_ADDR, addr);
-#endif
-
- /* Then adjust to find the real return address. */
-#if defined (RETURN_ADDR_OFFSET)
- addr = plus_constant (addr, RETURN_ADDR_OFFSET);
-#endif
-
- return addr;
+ /* Push room for a new list. */
+ cfun->eh->protect_list
+ = tree_cons (NULL_TREE, NULL_TREE, cfun->eh->protect_list);
}
/* Start a new exception region for a region of code that has a
@@ -1121,1819 +1005,1874 @@ add_partial_entry (handler)
{
expand_eh_region_start ();
- /* Because this is a cleanup action, we may have to protect the handler
- with __terminate. */
- handler = protect_with_terminate (handler);
-
+ /* ??? This comment was old before the most recent rewrite. We
+ really ought to fix the callers at some point. */
/* For backwards compatibility, we allow callers to omit calls to
begin_protect_partials for the outermost region. So, we must
explicitly do so here. */
- if (!protect_list)
+ if (!cfun->eh->protect_list)
begin_protect_partials ();
/* Add this entry to the front of the list. */
- TREE_VALUE (protect_list)
- = tree_cons (NULL_TREE, handler, TREE_VALUE (protect_list));
+ TREE_VALUE (cfun->eh->protect_list)
+ = tree_cons (NULL_TREE, handler, TREE_VALUE (cfun->eh->protect_list));
}
-/* Emit code to get EH context to current function. */
+/* End all the pending exception regions on protect_list. */
-static rtx
-call_get_eh_context ()
+void
+end_protect_partials ()
{
- static tree fn;
- tree expr;
-
- if (fn == NULL_TREE)
- {
- tree fntype;
- fn = get_identifier ("__get_eh_context");
- fntype = build_pointer_type (build_pointer_type
- (build_pointer_type (void_type_node)));
- fntype = build_function_type (fntype, NULL_TREE);
- fn = build_decl (FUNCTION_DECL, fn, fntype);
- DECL_EXTERNAL (fn) = 1;
- TREE_PUBLIC (fn) = 1;
- DECL_ARTIFICIAL (fn) = 1;
- TREE_READONLY (fn) = 1;
- make_decl_rtl (fn, NULL_PTR);
- assemble_external (fn);
+ tree t;
- ggc_add_tree_root (&fn, 1);
- }
+ /* ??? This comment was old before the most recent rewrite. We
+ really ought to fix the callers at some point. */
+ /* For backwards compatibility, we allow callers to omit the call to
+ begin_protect_partials for the outermost region. So,
+ PROTECT_LIST may be NULL. */
+ if (!cfun->eh->protect_list)
+ return;
- expr = build1 (ADDR_EXPR, build_pointer_type (TREE_TYPE (fn)), fn);
- expr = build (CALL_EXPR, TREE_TYPE (TREE_TYPE (fn)),
- expr, NULL_TREE, NULL_TREE);
- TREE_SIDE_EFFECTS (expr) = 1;
+ /* Pop the topmost entry. */
+ t = TREE_VALUE (cfun->eh->protect_list);
+ cfun->eh->protect_list = TREE_CHAIN (cfun->eh->protect_list);
- return copy_to_reg (expand_expr (expr, NULL_RTX, VOIDmode, 0));
+ /* End all the exception regions. */
+ for (; t; t = TREE_CHAIN (t))
+ expand_eh_region_end_cleanup (TREE_VALUE (t));
}
-/* Get a reference to the EH context.
- We will only generate a register for the current function EH context here,
- and emit a USE insn to mark that this is a EH context register.
+
+/* This section is for the exception handling specific optimization pass. */
- Later, emit_eh_context will emit needed call to __get_eh_context
- in libgcc2, and copy the value to the register we have generated. */
+/* Random access the exception region tree. It's just as simple to
+ collect the regions this way as in expand_eh_region_start, but
+ without having to realloc memory. */
-rtx
-get_eh_context ()
+static void
+collect_eh_region_array ()
{
- if (current_function_ehc == 0)
- {
- rtx insn;
+ struct eh_region **array, *i;
- current_function_ehc = gen_reg_rtx (Pmode);
-
- insn = gen_rtx_USE (GET_MODE (current_function_ehc),
- current_function_ehc);
- insn = emit_insn_before (insn, get_first_nonparm_insn ());
-
- REG_NOTES (insn)
- = gen_rtx_EXPR_LIST (REG_EH_CONTEXT, current_function_ehc,
- REG_NOTES (insn));
- }
- return current_function_ehc;
-}
-
-/* Get a reference to the dynamic handler chain. It points to the
- pointer to the next element in the dynamic handler chain. It ends
- when there are no more elements in the dynamic handler chain, when
- the value is &top_elt from libgcc2.c. Immediately after the
- pointer, is an area suitable for setjmp/longjmp when
- DONT_USE_BUILTIN_SETJMP is defined, and an area suitable for
- __builtin_setjmp/__builtin_longjmp when DONT_USE_BUILTIN_SETJMP
- isn't defined. */
+ i = cfun->eh->region_tree;
+ if (! i)
+ return;
-rtx
-get_dynamic_handler_chain ()
+ array = xcalloc (cfun->eh->last_region_number + 1, sizeof (*array));
+ cfun->eh->region_array = array;
+
+ while (1)
+ {
+ array[i->region_number] = i;
+
+ /* If there are sub-regions, process them. */
+ if (i->inner)
+ i = i->inner;
+ /* If there are peers, process them. */
+ else if (i->next_peer)
+ i = i->next_peer;
+ /* Otherwise, step back up the tree to the next peer. */
+ else
+ {
+ do {
+ i = i->outer;
+ if (i == NULL)
+ return;
+ } while (i->next_peer == NULL);
+ i = i->next_peer;
+ }
+ }
+}
+
+static void
+resolve_fixup_regions ()
{
- rtx ehc, dhc, result;
+ int i, j, n = cfun->eh->last_region_number;
- ehc = get_eh_context ();
+ for (i = 1; i <= n; ++i)
+ {
+ struct eh_region *fixup = cfun->eh->region_array[i];
+ struct eh_region *cleanup;
- /* This is the offset of dynamic_handler_chain in the eh_context struct
- declared in eh-common.h. If its location is change, change this offset */
- dhc = plus_constant (ehc, POINTER_SIZE / BITS_PER_UNIT);
+ if (! fixup || fixup->type != ERT_FIXUP)
+ continue;
- result = copy_to_reg (dhc);
+ for (j = 1; j <= n; ++j)
+ {
+ cleanup = cfun->eh->region_array[j];
+ if (cleanup->type == ERT_CLEANUP
+ && cleanup->u.cleanup.exp == fixup->u.fixup.cleanup_exp)
+ break;
+ }
+ if (j > n)
+ abort ();
- /* We don't want a copy of the dcc, but rather, the single dcc. */
- return gen_rtx_MEM (Pmode, result);
+ fixup->u.fixup.real_region = cleanup->outer;
+ }
}
-/* Get a reference to the dynamic cleanup chain. It points to the
- pointer to the next element in the dynamic cleanup chain.
- Immediately after the pointer, are two Pmode variables, one for a
- pointer to a function that performs the cleanup action, and the
- second, the argument to pass to that function. */
+/* Now that we've discovered what region actually encloses a fixup,
+ we can shuffle pointers and remove them from the tree. */
-rtx
-get_dynamic_cleanup_chain ()
+static void
+remove_fixup_regions ()
{
- rtx dhc, dcc, result;
+ int i;
+ rtx insn, note;
+ struct eh_region *fixup;
+
+ /* Walk the insn chain and adjust the REG_EH_REGION numbers
+ for instructions referencing fixup regions. This is only
+ strictly necessary for fixup regions with no parent, but
+ doesn't hurt to do it for all regions. */
+ for (insn = get_insns(); insn ; insn = NEXT_INSN (insn))
+ if (INSN_P (insn)
+ && (note = find_reg_note (insn, REG_EH_REGION, NULL))
+ && INTVAL (XEXP (note, 0)) > 0
+ && (fixup = cfun->eh->region_array[INTVAL (XEXP (note, 0))])
+ && fixup->type == ERT_FIXUP)
+ {
+ if (fixup->u.fixup.real_region)
+ XEXP (note, 0) = GEN_INT (fixup->u.fixup.real_region->region_number);
+ else
+ remove_note (insn, note);
+ }
+
+ /* Remove the fixup regions from the tree. */
+ for (i = cfun->eh->last_region_number; i > 0; --i)
+ {
+ fixup = cfun->eh->region_array[i];
+ if (! fixup)
+ continue;
+
+ /* Allow GC to maybe free some memory. */
+ if (fixup->type == ERT_CLEANUP)
+ fixup->u.cleanup.exp = NULL_TREE;
- dhc = get_dynamic_handler_chain ();
- dcc = plus_constant (dhc, POINTER_SIZE / BITS_PER_UNIT);
+ if (fixup->type != ERT_FIXUP)
+ continue;
- result = copy_to_reg (dcc);
+ if (fixup->inner)
+ {
+ struct eh_region *parent, *p, **pp;
+
+ parent = fixup->u.fixup.real_region;
+
+ /* Fix up the children's parent pointers; find the end of
+ the list. */
+ for (p = fixup->inner; ; p = p->next_peer)
+ {
+ p->outer = parent;
+ if (! p->next_peer)
+ break;
+ }
- /* We don't want a copy of the dcc, but rather, the single dcc. */
- return gen_rtx_MEM (Pmode, result);
+ /* In the tree of cleanups, only outer-inner ordering matters.
+ So link the children back in anywhere at the correct level. */
+ if (parent)
+ pp = &parent->inner;
+ else
+ pp = &cfun->eh->region_tree;
+ p->next_peer = *pp;
+ *pp = fixup->inner;
+ fixup->inner = NULL;
+ }
+
+ remove_eh_handler (fixup);
+ }
}
-#ifdef DONT_USE_BUILTIN_SETJMP
-/* Generate code to evaluate X and jump to LABEL if the value is nonzero.
- LABEL is an rtx of code CODE_LABEL, in this function. */
+/* Turn NOTE_INSN_EH_REGION notes into REG_EH_REGION notes for each
+ can_throw instruction in the region. */
static void
-jumpif_rtx (x, label)
- rtx x;
- rtx label;
+convert_from_eh_region_ranges_1 (pinsns, orig_sp, cur)
+ rtx *pinsns;
+ int *orig_sp;
+ int cur;
{
- jumpif (make_tree (type_for_mode (GET_MODE (x), 0), x), label);
-}
-#endif
+ int *sp = orig_sp;
+ rtx insn, next;
-/* Start a dynamic cleanup on the EH runtime dynamic cleanup stack.
- We just need to create an element for the cleanup list, and push it
- into the chain.
+ for (insn = *pinsns; insn ; insn = next)
+ {
+ next = NEXT_INSN (insn);
+ if (GET_CODE (insn) == NOTE)
+ {
+ int kind = NOTE_LINE_NUMBER (insn);
+ if (kind == NOTE_INSN_EH_REGION_BEG
+ || kind == NOTE_INSN_EH_REGION_END)
+ {
+ if (kind == NOTE_INSN_EH_REGION_BEG)
+ {
+ struct eh_region *r;
- A dynamic cleanup is a cleanup action implied by the presence of an
- element on the EH runtime dynamic cleanup stack that is to be
- performed when an exception is thrown. The cleanup action is
- performed by __sjthrow when an exception is thrown. Only certain
- actions can be optimized into dynamic cleanup actions. For the
- restrictions on what actions can be performed using this routine,
- see expand_eh_region_start_tree. */
+ *sp++ = cur;
+ cur = NOTE_EH_HANDLER (insn);
-static void
-start_dynamic_cleanup (func, arg)
- tree func;
- tree arg;
+ r = cfun->eh->region_array[cur];
+ if (r->type == ERT_FIXUP)
+ {
+ r = r->u.fixup.real_region;
+ cur = r ? r->region_number : 0;
+ }
+ else if (r->type == ERT_CATCH)
+ {
+ r = r->outer;
+ cur = r ? r->region_number : 0;
+ }
+ }
+ else
+ cur = *--sp;
+
+ /* Removing the first insn of a CALL_PLACEHOLDER sequence
+ requires extra care to adjust sequence start. */
+ if (insn == *pinsns)
+ *pinsns = next;
+ remove_insn (insn);
+ continue;
+ }
+ }
+ else if (INSN_P (insn))
+ {
+ if (cur > 0
+ && ! find_reg_note (insn, REG_EH_REGION, NULL_RTX)
+ /* Calls can always potentially throw exceptions, unless
+ they have a REG_EH_REGION note with a value of 0 or less.
+ Which should be the only possible kind so far. */
+ && (GET_CODE (insn) == CALL_INSN
+ /* If we wanted exceptions for non-call insns, then
+ any may_trap_p instruction could throw. */
+ || (flag_non_call_exceptions
+ && may_trap_p (PATTERN (insn)))))
+ {
+ REG_NOTES (insn) = alloc_EXPR_LIST (REG_EH_REGION, GEN_INT (cur),
+ REG_NOTES (insn));
+ }
+
+ if (GET_CODE (insn) == CALL_INSN
+ && GET_CODE (PATTERN (insn)) == CALL_PLACEHOLDER)
+ {
+ convert_from_eh_region_ranges_1 (&XEXP (PATTERN (insn), 0),
+ sp, cur);
+ convert_from_eh_region_ranges_1 (&XEXP (PATTERN (insn), 1),
+ sp, cur);
+ convert_from_eh_region_ranges_1 (&XEXP (PATTERN (insn), 2),
+ sp, cur);
+ }
+ }
+ }
+
+ if (sp != orig_sp)
+ abort ();
+}
+
+void
+convert_from_eh_region_ranges ()
{
- rtx dcc;
- rtx new_func, new_arg;
- rtx x, buf;
- int size;
+ int *stack;
+ rtx insns;
- /* We allocate enough room for a pointer to the function, and
- one argument. */
- size = 2;
+ collect_eh_region_array ();
+ resolve_fixup_regions ();
- /* XXX, FIXME: The stack space allocated this way is too long lived,
- but there is no allocation routine that allocates at the level of
- the last binding contour. */
- buf = assign_stack_local (BLKmode,
- GET_MODE_SIZE (Pmode)*(size+1),
- 0);
+ stack = xmalloc (sizeof (int) * (cfun->eh->last_region_number + 1));
+ insns = get_insns ();
+ convert_from_eh_region_ranges_1 (&insns, stack, 0);
+ free (stack);
- buf = change_address (buf, Pmode, NULL_RTX);
+ remove_fixup_regions ();
+}
- /* Store dcc into the first word of the newly allocated buffer. */
+void
+find_exception_handler_labels ()
+{
+ rtx list = NULL_RTX;
+ int i;
- dcc = get_dynamic_cleanup_chain ();
- emit_move_insn (buf, dcc);
+ free_EXPR_LIST_list (&exception_handler_labels);
- /* Store func and arg into the cleanup list element. */
+ if (cfun->eh->region_tree == NULL)
+ return;
- new_func = gen_rtx_MEM (Pmode, plus_constant (XEXP (buf, 0),
- GET_MODE_SIZE (Pmode)));
- new_arg = gen_rtx_MEM (Pmode, plus_constant (XEXP (buf, 0),
- GET_MODE_SIZE (Pmode)*2));
- x = expand_expr (func, new_func, Pmode, 0);
- if (x != new_func)
- emit_move_insn (new_func, x);
+ for (i = cfun->eh->last_region_number; i > 0; --i)
+ {
+ struct eh_region *region = cfun->eh->region_array[i];
+ rtx lab;
- x = expand_expr (arg, new_arg, Pmode, 0);
- if (x != new_arg)
- emit_move_insn (new_arg, x);
+ if (! region)
+ continue;
+ if (cfun->eh->built_landing_pads)
+ lab = region->landing_pad;
+ else
+ lab = region->label;
- /* Update the cleanup chain. */
+ if (lab)
+ list = alloc_EXPR_LIST (0, lab, list);
+ }
- x = force_operand (XEXP (buf, 0), dcc);
- if (x != dcc)
- emit_move_insn (dcc, x);
-}
+ /* For sjlj exceptions, need the return label to remain live until
+ after landing pad generation. */
+ if (USING_SJLJ_EXCEPTIONS && ! cfun->eh->built_landing_pads)
+ list = alloc_EXPR_LIST (0, return_label, list);
-/* Emit RTL to start a dynamic handler on the EH runtime dynamic
- handler stack. This should only be used by expand_eh_region_start
- or expand_eh_region_start_tree. */
+ exception_handler_labels = list;
+}
-static void
-start_dynamic_handler ()
+
+static struct eh_region *
+duplicate_eh_region_1 (o, map)
+ struct eh_region *o;
+ struct inline_remap *map;
{
- rtx dhc, dcc;
- rtx arg, buf;
- int size;
-
-#ifndef DONT_USE_BUILTIN_SETJMP
- /* The number of Pmode words for the setjmp buffer, when using the
- builtin setjmp/longjmp, see expand_builtin, case BUILT_IN_LONGJMP. */
- /* We use 2 words here before calling expand_builtin_setjmp.
- expand_builtin_setjmp uses 2 words, and then calls emit_stack_save.
- emit_stack_save needs space of size STACK_SAVEAREA_MODE (SAVE_NONLOCAL).
- Subtract one, because the assign_stack_local call below adds 1. */
- size = (2 + 2 + (GET_MODE_SIZE (STACK_SAVEAREA_MODE (SAVE_NONLOCAL))
- / GET_MODE_SIZE (Pmode))
- - 1);
-#else
-#ifdef JMP_BUF_SIZE
- size = JMP_BUF_SIZE;
-#else
- /* Should be large enough for most systems, if it is not,
- JMP_BUF_SIZE should be defined with the proper value. It will
- also tend to be larger than necessary for most systems, a more
- optimal port will define JMP_BUF_SIZE. */
- size = FIRST_PSEUDO_REGISTER+2;
-#endif
-#endif
- /* XXX, FIXME: The stack space allocated this way is too long lived,
- but there is no allocation routine that allocates at the level of
- the last binding contour. */
- arg = assign_stack_local (BLKmode,
- GET_MODE_SIZE (Pmode)*(size+1),
- 0);
+ struct eh_region *n
+ = (struct eh_region *) xcalloc (1, sizeof (struct eh_region));
- arg = change_address (arg, Pmode, NULL_RTX);
+ n->region_number = o->region_number + cfun->eh->last_region_number;
+ n->type = o->type;
- /* Store dhc into the first word of the newly allocated buffer. */
+ switch (n->type)
+ {
+ case ERT_CLEANUP:
+ case ERT_MUST_NOT_THROW:
+ break;
- dhc = get_dynamic_handler_chain ();
- dcc = gen_rtx_MEM (Pmode, plus_constant (XEXP (arg, 0),
- GET_MODE_SIZE (Pmode)));
- emit_move_insn (arg, dhc);
+ case ERT_TRY:
+ if (o->u.try.continue_label)
+ n->u.try.continue_label
+ = get_label_from_map (map,
+ CODE_LABEL_NUMBER (o->u.try.continue_label));
+ break;
- /* Zero out the start of the cleanup chain. */
- emit_move_insn (dcc, const0_rtx);
+ case ERT_CATCH:
+ n->u.catch.type = o->u.catch.type;
+ break;
- /* The jmpbuf starts two words into the area allocated. */
- buf = plus_constant (XEXP (arg, 0), GET_MODE_SIZE (Pmode)*2);
+ case ERT_ALLOWED_EXCEPTIONS:
+ n->u.allowed.type_list = o->u.allowed.type_list;
+ break;
-#ifdef DONT_USE_BUILTIN_SETJMP
- {
- rtx x;
- x = emit_library_call_value (setjmp_libfunc, NULL_RTX, LCT_CONST,
- TYPE_MODE (integer_type_node), 1,
- buf, Pmode);
- /* If we come back here for a catch, transfer control to the handler. */
- jumpif_rtx (x, ehstack.top->entry->exception_handler_label);
- }
-#else
- expand_builtin_setjmp_setup (buf,
- ehstack.top->entry->exception_handler_label);
-#endif
+ case ERT_THROW:
+ n->u.throw.type = o->u.throw.type;
+
+ default:
+ abort ();
+ }
- /* We are committed to this, so update the handler chain. */
+ if (o->label)
+ n->label = get_label_from_map (map, CODE_LABEL_NUMBER (o->label));
+ if (o->resume)
+ {
+ n->resume = map->insn_map[INSN_UID (o->resume)];
+ if (n->resume == NULL)
+ abort ();
+ }
- emit_move_insn (dhc, force_operand (XEXP (arg, 0), NULL_RTX));
+ return n;
}
-/* Start an exception handling region for the given cleanup action.
- All instructions emitted after this point are considered to be part
- of the region until expand_eh_region_end is invoked. CLEANUP is
- the cleanup action to perform. The return value is true if the
- exception region was optimized away. If that case,
- expand_eh_region_end does not need to be called for this cleanup,
- nor should it be.
+static void
+duplicate_eh_region_2 (o, n_array)
+ struct eh_region *o;
+ struct eh_region **n_array;
+{
+ struct eh_region *n = n_array[o->region_number];
- This routine notices one particular common case in C++ code
- generation, and optimizes it so as to not need the exception
- region. It works by creating a dynamic cleanup action, instead of
- a using an exception region. */
+ switch (n->type)
+ {
+ case ERT_TRY:
+ n->u.try.catch = n_array[o->u.try.catch->region_number];
+ n->u.try.last_catch = n_array[o->u.try.last_catch->region_number];
+ break;
+
+ case ERT_CATCH:
+ if (o->u.catch.next_catch)
+ n->u.catch.next_catch = n_array[o->u.catch.next_catch->region_number];
+ if (o->u.catch.prev_catch)
+ n->u.catch.prev_catch = n_array[o->u.catch.prev_catch->region_number];
+ break;
+
+ default:
+ break;
+ }
+
+ if (o->outer)
+ n->outer = n_array[o->outer->region_number];
+ if (o->inner)
+ n->inner = n_array[o->inner->region_number];
+ if (o->next_peer)
+ n->next_peer = n_array[o->next_peer->region_number];
+}
int
-expand_eh_region_start_tree (decl, cleanup)
- tree decl;
- tree cleanup;
+duplicate_eh_regions (ifun, map)
+ struct function *ifun;
+ struct inline_remap *map;
{
- /* This is the old code. */
- if (! doing_eh (0))
- return 0;
+ int ifun_last_region_number = ifun->eh->last_region_number;
+ struct eh_region **n_array, *root, *cur;
+ int i;
- /* The optimization only applies to actions protected with
- terminate, and only applies if we are using the setjmp/longjmp
- codegen method. */
- if (exceptions_via_longjmp
- && protect_cleanup_actions_with_terminate)
- {
- tree func, arg;
- tree args;
+ if (ifun_last_region_number == 0)
+ return 0;
- /* Ignore any UNSAVE_EXPR. */
- if (TREE_CODE (cleanup) == UNSAVE_EXPR)
- cleanup = TREE_OPERAND (cleanup, 0);
-
- /* Further, it only applies if the action is a call, if there
- are 2 arguments, and if the second argument is 2. */
+ n_array = xcalloc (ifun_last_region_number + 1, sizeof (*n_array));
- if (TREE_CODE (cleanup) == CALL_EXPR
- && (args = TREE_OPERAND (cleanup, 1))
- && (func = TREE_OPERAND (cleanup, 0))
- && (arg = TREE_VALUE (args))
- && (args = TREE_CHAIN (args))
+ for (i = 1; i <= ifun_last_region_number; ++i)
+ {
+ cur = ifun->eh->region_array[i];
+ if (!cur || cur->region_number != i)
+ continue;
+ n_array[i] = duplicate_eh_region_1 (cur, map);
+ }
+ for (i = 1; i <= ifun_last_region_number; ++i)
+ {
+ cur = ifun->eh->region_array[i];
+ if (!cur || cur->region_number != i)
+ continue;
+ duplicate_eh_region_2 (cur, n_array);
+ }
- /* is the second argument 2? */
- && TREE_CODE (TREE_VALUE (args)) == INTEGER_CST
- && compare_tree_int (TREE_VALUE (args), 2) == 0
+ root = n_array[ifun->eh->region_tree->region_number];
+ cur = cfun->eh->cur_region;
+ if (cur)
+ {
+ struct eh_region *p = cur->inner;
+ if (p)
+ {
+ while (p->next_peer)
+ p = p->next_peer;
+ p->next_peer = root;
+ }
+ else
+ cur->inner = root;
- /* Make sure there are no other arguments. */
- && TREE_CHAIN (args) == NULL_TREE)
+ for (i = 1; i <= ifun_last_region_number; ++i)
+ if (n_array[i] && n_array[i]->outer == NULL)
+ n_array[i]->outer = cur;
+ }
+ else
+ {
+ struct eh_region *p = cfun->eh->region_tree;
+ if (p)
{
- /* Arrange for returns and gotos to pop the entry we make on the
- dynamic cleanup stack. */
- expand_dcc_cleanup (decl);
- start_dynamic_cleanup (func, arg);
- return 1;
+ while (p->next_peer)
+ p = p->next_peer;
+ p->next_peer = root;
}
+ else
+ cfun->eh->region_tree = root;
}
- expand_eh_region_start_for_decl (decl);
- ehstack.top->entry->finalization = cleanup;
+ free (n_array);
- return 0;
+ i = cfun->eh->last_region_number;
+ cfun->eh->last_region_number = i + ifun_last_region_number;
+ return i;
}
-/* Just like expand_eh_region_start, except if a cleanup action is
- entered on the cleanup chain, the TREE_PURPOSE of the element put
- on the chain is DECL. DECL should be the associated VAR_DECL, if
- any, otherwise it should be NULL_TREE. */
+
+/* ??? Move from tree.c to tree.h. */
+#define TYPE_HASH(TYPE) ((HOST_WIDE_INT) (TYPE) & 0777777)
-void
-expand_eh_region_start_for_decl (decl)
- tree decl;
+static int
+t2r_eq (pentry, pdata)
+ const PTR pentry;
+ const PTR pdata;
{
- rtx note;
+ tree entry = (tree) pentry;
+ tree data = (tree) pdata;
- /* This is the old code. */
- if (! doing_eh (0))
- return;
+ return TREE_PURPOSE (entry) == data;
+}
+
+static hashval_t
+t2r_hash (pentry)
+ const PTR pentry;
+{
+ tree entry = (tree) pentry;
+ return TYPE_HASH (TREE_PURPOSE (entry));
+}
- /* We need a new block to record the start and end of the
- dynamic handler chain. We also want to prevent jumping into
- a try block. */
- expand_start_bindings (2);
+static int
+t2r_mark_1 (slot, data)
+ PTR *slot;
+ PTR data ATTRIBUTE_UNUSED;
+{
+ tree contents = (tree) *slot;
+ ggc_mark_tree (contents);
+ return 1;
+}
- /* But we don't need or want a new temporary level. */
- pop_temp_slots ();
+static void
+t2r_mark (addr)
+ PTR addr;
+{
+ htab_traverse (*(htab_t *)addr, t2r_mark_1, NULL);
+}
- /* Mark this block as created by expand_eh_region_start. This
- is so that we can pop the block with expand_end_bindings
- automatically. */
- mark_block_as_eh_region ();
+static void
+add_type_for_runtime (type)
+ tree type;
+{
+ tree *slot;
- if (exceptions_via_longjmp)
+ slot = (tree *) htab_find_slot_with_hash (type_to_runtime_map, type,
+ TYPE_HASH (type), INSERT);
+ if (*slot == NULL)
{
- /* Arrange for returns and gotos to pop the entry we make on the
- dynamic handler stack. */
- expand_dhc_cleanup (decl);
+ tree runtime = (*lang_eh_runtime_type) (type);
+ *slot = tree_cons (type, runtime, NULL_TREE);
}
-
- push_eh_entry (&ehstack);
- note = emit_note (NULL_PTR, NOTE_INSN_EH_REGION_BEG);
- NOTE_EH_HANDLER (note)
- = CODE_LABEL_NUMBER (ehstack.top->entry->exception_handler_label);
- if (exceptions_via_longjmp)
- start_dynamic_handler ();
}
+
+static tree
+lookup_type_for_runtime (type)
+ tree type;
+{
+ tree *slot;
-/* Start an exception handling region. All instructions emitted after
- this point are considered to be part of the region until
- expand_eh_region_end is invoked. */
+ slot = (tree *) htab_find_slot_with_hash (type_to_runtime_map, type,
+ TYPE_HASH (type), NO_INSERT);
-void
-expand_eh_region_start ()
-{
- expand_eh_region_start_for_decl (NULL_TREE);
+ /* We should have always inserrted the data earlier. */
+ return TREE_VALUE (*slot);
}
-/* End an exception handling region. The information about the region
- is found on the top of ehstack.
+
+/* Represent an entry in @TTypes for either catch actions
+ or exception filter actions. */
+struct ttypes_filter
+{
+ tree t;
+ int filter;
+};
+
+/* Compare ENTRY (a ttypes_filter entry in the hash table) with DATA
+ (a tree) for a @TTypes type node we are thinking about adding. */
- HANDLER is either the cleanup for the exception region, or if we're
- marking the end of a try block, HANDLER is integer_zero_node.
+static int
+ttypes_filter_eq (pentry, pdata)
+ const PTR pentry;
+ const PTR pdata;
+{
+ const struct ttypes_filter *entry = (const struct ttypes_filter *) pentry;
+ tree data = (tree) pdata;
- HANDLER will be transformed to rtl when expand_leftover_cleanups
- is invoked. */
+ return entry->t == data;
+}
-void
-expand_eh_region_end (handler)
- tree handler;
+static hashval_t
+ttypes_filter_hash (pentry)
+ const PTR pentry;
{
- struct eh_entry *entry;
- struct eh_node *node;
- rtx note;
- int ret, r;
+ const struct ttypes_filter *entry = (const struct ttypes_filter *) pentry;
+ return TYPE_HASH (entry->t);
+}
- if (! doing_eh (0))
- return;
+/* Compare ENTRY with DATA (both struct ttypes_filter) for a @TTypes
+ exception specification list we are thinking about adding. */
+/* ??? Currently we use the type lists in the order given. Someone
+ should put these in some canonical order. */
- entry = pop_eh_entry (&ehstack);
+static int
+ehspec_filter_eq (pentry, pdata)
+ const PTR pentry;
+ const PTR pdata;
+{
+ const struct ttypes_filter *entry = (const struct ttypes_filter *) pentry;
+ const struct ttypes_filter *data = (const struct ttypes_filter *) pdata;
- note = emit_note (NULL_PTR, NOTE_INSN_EH_REGION_END);
- ret = NOTE_EH_HANDLER (note)
- = CODE_LABEL_NUMBER (entry->exception_handler_label);
- if (exceptions_via_longjmp == 0 && ! flag_new_exceptions
- /* We share outer_context between regions; only emit it once. */
- && INSN_UID (entry->outer_context) == 0)
- {
- rtx label;
+ return type_list_equal (entry->t, data->t);
+}
- label = gen_label_rtx ();
- emit_jump (label);
+/* Hash function for exception specification lists. */
- /* Emit a label marking the end of this exception region that
- is used for rethrowing into the outer context. */
- emit_label (entry->outer_context);
- expand_internal_throw ();
+static hashval_t
+ehspec_filter_hash (pentry)
+ const PTR pentry;
+{
+ const struct ttypes_filter *entry = (const struct ttypes_filter *) pentry;
+ hashval_t h = 0;
+ tree list;
- emit_label (label);
- }
+ for (list = entry->t; list ; list = TREE_CHAIN (list))
+ h = (h << 5) + (h >> 27) + TYPE_HASH (TREE_VALUE (list));
+ return h;
+}
- entry->finalization = handler;
+/* Add TYPE to cfun->eh->ttype_data, using TYPES_HASH to speed
+ up the search. Return the filter value to be used. */
- /* create region entry in final exception table */
- r = new_eh_region_entry (NOTE_EH_HANDLER (note), entry->rethrow_label);
+static int
+add_ttypes_entry (ttypes_hash, type)
+ htab_t ttypes_hash;
+ tree type;
+{
+ struct ttypes_filter **slot, *n;
- enqueue_eh_entry (ehqueue, entry);
+ slot = (struct ttypes_filter **)
+ htab_find_slot_with_hash (ttypes_hash, type, TYPE_HASH (type), INSERT);
- /* If we have already started ending the bindings, don't recurse. */
- if (is_eh_region ())
+ if ((n = *slot) == NULL)
{
- /* Because we don't need or want a new temporary level and
- because we didn't create one in expand_eh_region_start,
- create a fake one now to avoid removing one in
- expand_end_bindings. */
- push_temp_slots ();
+ /* Filter value is a 1 based table index. */
- mark_block_as_not_eh_region ();
+ n = (struct ttypes_filter *) xmalloc (sizeof (*n));
+ n->t = type;
+ n->filter = VARRAY_ACTIVE_SIZE (cfun->eh->ttype_data) + 1;
+ *slot = n;
- expand_end_bindings (NULL_TREE, 0, 0);
+ VARRAY_PUSH_TREE (cfun->eh->ttype_data, type);
}
- /* Go through the goto handlers in the queue, emitting their
- handlers if we now have enough information to do so. */
- for (node = ehqueue->head; node; node = node->chain)
- if (node->entry->goto_entry_p
- && node->entry->outer_context == entry->rethrow_label)
- emit_cleanup_handler (node->entry);
-
- /* We can't emit handlers for goto entries until their scopes are
- complete because we don't know where they need to rethrow to,
- yet. */
- if (entry->finalization != integer_zero_node
- && (!entry->goto_entry_p
- || find_func_region_from_symbol (entry->outer_context) != -1))
- emit_cleanup_handler (entry);
+ return n->filter;
}
-/* End the EH region for a goto fixup. We only need them in the region-based
- EH scheme. */
+/* Add LIST to cfun->eh->ehspec_data, using EHSPEC_HASH and TYPES_HASH
+ to speed up the search. Return the filter value to be used. */
-void
-expand_fixup_region_start ()
+static int
+add_ehspec_entry (ehspec_hash, ttypes_hash, list)
+ htab_t ehspec_hash;
+ htab_t ttypes_hash;
+ tree list;
{
- if (! doing_eh (0) || exceptions_via_longjmp)
- return;
+ struct ttypes_filter **slot, *n;
+ struct ttypes_filter dummy;
- expand_eh_region_start ();
- /* Mark this entry as the entry for a goto. */
- ehstack.top->entry->goto_entry_p = 1;
+ dummy.t = list;
+ slot = (struct ttypes_filter **)
+ htab_find_slot (ehspec_hash, &dummy, INSERT);
+
+ if ((n = *slot) == NULL)
+ {
+ /* Filter value is a -1 based byte index into a uleb128 buffer. */
+
+ n = (struct ttypes_filter *) xmalloc (sizeof (*n));
+ n->t = list;
+ n->filter = -(VARRAY_ACTIVE_SIZE (cfun->eh->ehspec_data) + 1);
+ *slot = n;
+
+ /* Look up each type in the list and encode its filter
+ value as a uleb128. Terminate the list with 0. */
+ for (; list ; list = TREE_CHAIN (list))
+ push_uleb128 (&cfun->eh->ehspec_data,
+ add_ttypes_entry (ttypes_hash, TREE_VALUE (list)));
+ VARRAY_PUSH_UCHAR (cfun->eh->ehspec_data, 0);
+ }
+
+ return n->filter;
}
-/* End the EH region for a goto fixup. CLEANUP is the cleanup we just
- expanded; to avoid running it twice if it throws, we look through the
- ehqueue for a matching region and rethrow from its outer_context. */
+/* Generate the action filter values to be used for CATCH and
+ ALLOWED_EXCEPTIONS regions. When using dwarf2 exception regions,
+ we use lots of landing pads, and so every type or list can share
+ the same filter value, which saves table space. */
-void
-expand_fixup_region_end (cleanup)
- tree cleanup;
+static void
+assign_filter_values ()
{
- struct eh_node *node;
- int dont_issue;
-
- if (! doing_eh (0) || exceptions_via_longjmp)
- return;
+ int i;
+ htab_t ttypes, ehspec;
- for (node = ehstack.top; node && node->entry->finalization != cleanup; )
- node = node->chain;
- if (node == 0)
- for (node = ehqueue->head; node && node->entry->finalization != cleanup; )
- node = node->chain;
- if (node == 0)
- abort ();
+ VARRAY_TREE_INIT (cfun->eh->ttype_data, 16, "ttype_data");
+ VARRAY_UCHAR_INIT (cfun->eh->ehspec_data, 64, "ehspec_data");
- /* If the outer context label has not been issued yet, we don't want
- to issue it as a part of this region, unless this is the
- correct region for the outer context. If we did, then the label for
- the outer context will be WITHIN the begin/end labels,
- and we could get an infinte loop when it tried to rethrow, or just
- generally incorrect execution following a throw. */
+ ttypes = htab_create (31, ttypes_filter_hash, ttypes_filter_eq, free);
+ ehspec = htab_create (31, ehspec_filter_hash, ehspec_filter_eq, free);
- if (flag_new_exceptions)
- dont_issue = 0;
- else
- dont_issue = ((INSN_UID (node->entry->outer_context) == 0)
- && (ehstack.top->entry != node->entry));
+ for (i = cfun->eh->last_region_number; i > 0; --i)
+ {
+ struct eh_region *r = cfun->eh->region_array[i];
- ehstack.top->entry->outer_context = node->entry->outer_context;
+ /* Mind we don't process a region more than once. */
+ if (!r || r->region_number != i)
+ continue;
- /* Since we are rethrowing to the OUTER region, we know we don't need
- a jump around sequence for this region, so we'll pretend the outer
- context label has been issued by setting INSN_UID to 1, then clearing
- it again afterwards. */
+ switch (r->type)
+ {
+ case ERT_CATCH:
+ r->u.catch.filter = add_ttypes_entry (ttypes, r->u.catch.type);
+ break;
- if (dont_issue)
- INSN_UID (node->entry->outer_context) = 1;
+ case ERT_ALLOWED_EXCEPTIONS:
+ r->u.allowed.filter
+ = add_ehspec_entry (ehspec, ttypes, r->u.allowed.type_list);
+ break;
- /* Just rethrow. size_zero_node is just a NOP. */
- expand_eh_region_end (size_zero_node);
+ default:
+ break;
+ }
+ }
- if (dont_issue)
- INSN_UID (node->entry->outer_context) = 0;
+ htab_delete (ttypes);
+ htab_delete (ehspec);
}
-/* If we are using the setjmp/longjmp EH codegen method, we emit a
- call to __sjthrow. Otherwise, we emit a call to __throw. */
-
-void
-emit_throw ()
+static void
+build_post_landing_pads ()
{
- if (exceptions_via_longjmp)
- {
- emit_library_call (sjthrow_libfunc, 0, VOIDmode, 0);
- }
- else
+ int i;
+
+ for (i = cfun->eh->last_region_number; i > 0; --i)
{
-#ifdef JUMP_TO_THROW
- emit_indirect_jump (throw_libfunc);
-#else
- emit_library_call (throw_libfunc, 0, VOIDmode, 0);
-#endif
- }
- emit_barrier ();
-}
+ struct eh_region *region = cfun->eh->region_array[i];
+ rtx seq;
-/* Throw the current exception. If appropriate, this is done by jumping
- to the next handler. */
+ /* Mind we don't process a region more than once. */
+ if (!region || region->region_number != i)
+ continue;
-void
-expand_internal_throw ()
-{
- emit_throw ();
-}
+ switch (region->type)
+ {
+ case ERT_TRY:
+ /* ??? Collect the set of all non-overlapping catch handlers
+ all the way up the chain until blocked by a cleanup. */
+ /* ??? Outer try regions can share landing pads with inner
+ try regions if the types are completely non-overlapping,
+ and there are no interveaning cleanups. */
-/* Called from expand_exception_blocks and expand_end_catch_block to
- emit any pending handlers/cleanups queued from expand_eh_region_end. */
+ region->post_landing_pad = gen_label_rtx ();
-void
-expand_leftover_cleanups ()
-{
- struct eh_entry *entry;
+ start_sequence ();
- for (entry = dequeue_eh_entry (ehqueue);
- entry;
- entry = dequeue_eh_entry (ehqueue))
- {
- /* A leftover try block. Shouldn't be one here. */
- if (entry->finalization == integer_zero_node)
- abort ();
+ emit_label (region->post_landing_pad);
- free (entry);
- }
-}
+ /* ??? It is mighty inconvenient to call back into the
+ switch statement generation code in expand_end_case.
+ Rapid prototyping sez a sequence of ifs. */
+ {
+ struct eh_region *c;
+ for (c = region->u.try.catch; c ; c = c->u.catch.next_catch)
+ {
+ /* ??? _Unwind_ForcedUnwind wants no match here. */
+ if (c->u.catch.type == NULL)
+ emit_jump (c->label);
+ else
+ emit_cmp_and_jump_insns (cfun->eh->filter,
+ GEN_INT (c->u.catch.filter),
+ EQ, NULL_RTX, word_mode,
+ 0, 0, c->label);
+ }
+ }
-/* Called at the start of a block of try statements. */
-void
-expand_start_try_stmts ()
-{
- if (! doing_eh (1))
- return;
+ /* We delay the generation of the _Unwind_Resume until we generate
+ landing pads. We emit a marker here so as to get good control
+ flow data in the meantime. */
+ region->resume
+ = emit_jump_insn (gen_rtx_RESX (VOIDmode, region->region_number));
+ emit_barrier ();
- expand_eh_region_start ();
-}
+ seq = get_insns ();
+ end_sequence ();
-/* Called to begin a catch clause. The parameter is the object which
- will be passed to the runtime type check routine. */
-void
-start_catch_handler (rtime)
- tree rtime;
-{
- rtx handler_label;
- int insn_region_num;
- int eh_region_entry;
+ emit_insns_before (seq, region->u.try.catch->label);
+ break;
- if (! doing_eh (1))
- return;
+ case ERT_ALLOWED_EXCEPTIONS:
+ region->post_landing_pad = gen_label_rtx ();
- handler_label = catchstack.top->entry->exception_handler_label;
- insn_region_num = CODE_LABEL_NUMBER (handler_label);
- eh_region_entry = find_func_region (insn_region_num);
+ start_sequence ();
- /* If we've already issued this label, pick a new one */
- if (catchstack.top->entry->label_used)
- handler_label = gen_exception_label ();
- else
- catchstack.top->entry->label_used = 1;
+ emit_label (region->post_landing_pad);
- receive_exception_label (handler_label);
+ emit_cmp_and_jump_insns (cfun->eh->filter,
+ GEN_INT (region->u.allowed.filter),
+ EQ, NULL_RTX, word_mode, 0, 0,
+ region->label);
- add_new_handler (eh_region_entry, get_new_handler (handler_label, rtime));
+ /* We delay the generation of the _Unwind_Resume until we generate
+ landing pads. We emit a marker here so as to get good control
+ flow data in the meantime. */
+ region->resume
+ = emit_jump_insn (gen_rtx_RESX (VOIDmode, region->region_number));
+ emit_barrier ();
- if (flag_new_exceptions && ! exceptions_via_longjmp)
- return;
+ seq = get_insns ();
+ end_sequence ();
- /* Under the old mechanism, as well as setjmp/longjmp, we need to
- issue code to compare 'rtime' to the value in eh_info, via the
- matching function in eh_info. If its is false, we branch around
- the handler we are about to issue. */
+ emit_insns_before (seq, region->label);
+ break;
- if (rtime != NULL_TREE && rtime != CATCH_ALL_TYPE)
- {
- rtx call_rtx, rtime_address;
+ case ERT_CLEANUP:
+ case ERT_MUST_NOT_THROW:
+ region->post_landing_pad = region->label;
+ break;
- if (catchstack.top->entry->false_label != NULL_RTX)
- {
- error ("Never issued previous false_label");
+ case ERT_CATCH:
+ case ERT_THROW:
+ /* Nothing to do. */
+ break;
+
+ default:
abort ();
}
- catchstack.top->entry->false_label = gen_exception_label ();
-
- rtime_address = expand_expr (rtime, NULL_RTX, Pmode, EXPAND_INITIALIZER);
-#ifdef POINTERS_EXTEND_UNSIGNED
- rtime_address = convert_memory_address (Pmode, rtime_address);
-#endif
- rtime_address = force_reg (Pmode, rtime_address);
-
- /* Now issue the call, and branch around handler if needed */
- call_rtx = emit_library_call_value (eh_rtime_match_libfunc, NULL_RTX,
- LCT_NORMAL,
- TYPE_MODE (integer_type_node),
- 1, rtime_address, Pmode);
-
- /* Did the function return true? */
- emit_cmp_and_jump_insns (call_rtx, const0_rtx, EQ, NULL_RTX,
- GET_MODE (call_rtx), 0, 0,
- catchstack.top->entry->false_label);
}
}
-/* Called to end a catch clause. If we aren't using the new exception
- model tabel mechanism, we need to issue the branch-around label
- for the end of the catch block. */
+/* Replace RESX patterns with jumps to the next handler if any, or calls to
+ _Unwind_Resume otherwise. */
-void
-end_catch_handler ()
+static void
+connect_post_landing_pads ()
{
- if (! doing_eh (1))
- return;
+ int i;
- if (flag_new_exceptions && ! exceptions_via_longjmp)
+ for (i = cfun->eh->last_region_number; i > 0; --i)
{
- emit_barrier ();
- return;
- }
-
- /* A NULL label implies the catch clause was a catch all or cleanup */
- if (catchstack.top->entry->false_label == NULL_RTX)
- return;
-
- emit_label (catchstack.top->entry->false_label);
- catchstack.top->entry->false_label = NULL_RTX;
-}
+ struct eh_region *region = cfun->eh->region_array[i];
+ struct eh_region *outer;
+ rtx seq;
+
+ /* Mind we don't process a region more than once. */
+ if (!region || region->region_number != i)
+ continue;
+
+ /* If there is no RESX, or it has been deleted by flow, there's
+ nothing to fix up. */
+ if (! region->resume || INSN_DELETED_P (region->resume))
+ continue;
+
+ /* Search for another landing pad in this function. */
+ for (outer = region->outer; outer ; outer = outer->outer)
+ if (outer->post_landing_pad)
+ break;
-/* Save away the current ehqueue. */
+ start_sequence ();
-void
-push_ehqueue ()
-{
- struct eh_queue *q;
- q = (struct eh_queue *) xcalloc (1, sizeof (struct eh_queue));
- q->next = ehqueue;
- ehqueue = q;
-}
+ if (outer)
+ emit_jump (outer->post_landing_pad);
+ else
+ emit_library_call (unwind_resume_libfunc, LCT_THROW,
+ VOIDmode, 1, cfun->eh->exc_ptr, Pmode);
-/* Restore a previously pushed ehqueue. */
+ seq = get_insns ();
+ end_sequence ();
+ emit_insns_before (seq, region->resume);
-void
-pop_ehqueue ()
-{
- struct eh_queue *q;
- expand_leftover_cleanups ();
- q = ehqueue->next;
- free (ehqueue);
- ehqueue = q;
+ /* Leave the RESX to be deleted by flow. */
+ }
}
-/* Emit the handler specified by ENTRY. */
-
+
static void
-emit_cleanup_handler (entry)
- struct eh_entry *entry;
+dw2_build_landing_pads ()
{
- rtx prev;
- rtx handler_insns;
+ int i, j;
- /* Since the cleanup could itself contain try-catch blocks, we
- squirrel away the current queue and replace it when we are done
- with this function. */
- push_ehqueue ();
+ for (i = cfun->eh->last_region_number; i > 0; --i)
+ {
+ struct eh_region *region = cfun->eh->region_array[i];
+ rtx seq;
+ bool clobbers_hard_regs = false;
- /* Put these handler instructions in a sequence. */
- do_pending_stack_adjust ();
- start_sequence ();
+ /* Mind we don't process a region more than once. */
+ if (!region || region->region_number != i)
+ continue;
- /* Emit the label for the cleanup handler for this region, and
- expand the code for the handler.
-
- Note that a catch region is handled as a side-effect here; for a
- try block, entry->finalization will contain integer_zero_node, so
- no code will be generated in the expand_expr call below. But, the
- label for the handler will still be emitted, so any code emitted
- after this point will end up being the handler. */
-
- receive_exception_label (entry->exception_handler_label);
+ if (region->type != ERT_CLEANUP
+ && region->type != ERT_TRY
+ && region->type != ERT_ALLOWED_EXCEPTIONS)
+ continue;
- /* register a handler for this cleanup region */
- add_new_handler (find_func_region (CODE_LABEL_NUMBER (entry->exception_handler_label)),
- get_new_handler (entry->exception_handler_label, NULL));
+ start_sequence ();
- /* And now generate the insns for the cleanup handler. */
- expand_expr (entry->finalization, const0_rtx, VOIDmode, 0);
+ region->landing_pad = gen_label_rtx ();
+ emit_label (region->landing_pad);
- prev = get_last_insn ();
- if (prev == NULL || GET_CODE (prev) != BARRIER)
- /* Code to throw out to outer context when we fall off end of the
- handler. We can't do this here for catch blocks, so it's done
- in expand_end_all_catch instead. */
- expand_rethrow (entry->outer_context);
+#ifdef HAVE_exception_receiver
+ if (HAVE_exception_receiver)
+ emit_insn (gen_exception_receiver ());
+ else
+#endif
+#ifdef HAVE_nonlocal_goto_receiver
+ if (HAVE_nonlocal_goto_receiver)
+ emit_insn (gen_nonlocal_goto_receiver ());
+ else
+#endif
+ { /* Nothing */ }
- /* Finish this sequence. */
- do_pending_stack_adjust ();
- handler_insns = get_insns ();
- end_sequence ();
+ /* If the eh_return data registers are call-saved, then we
+ won't have considered them clobbered from the call that
+ threw. Kill them now. */
+ for (j = 0; ; ++j)
+ {
+ unsigned r = EH_RETURN_DATA_REGNO (j);
+ if (r == INVALID_REGNUM)
+ break;
+ if (! call_used_regs[r])
+ {
+ emit_insn (gen_rtx_CLOBBER (VOIDmode, gen_rtx_REG (Pmode, r)));
+ clobbers_hard_regs = true;
+ }
+ }
- /* And add it to the CATCH_CLAUSES. */
- push_to_full_sequence (catch_clauses, catch_clauses_last);
- emit_insns (handler_insns);
- end_full_sequence (&catch_clauses, &catch_clauses_last);
+ if (clobbers_hard_regs)
+ {
+ /* @@@ This is a kludge. Not all machine descriptions define a
+ blockage insn, but we must not allow the code we just generated
+ to be reordered by scheduling. So emit an ASM_INPUT to act as
+ blockage insn. */
+ emit_insn (gen_rtx_ASM_INPUT (VOIDmode, ""));
+ }
- /* Now we've left the handler. */
- pop_ehqueue ();
-}
+ emit_move_insn (cfun->eh->exc_ptr,
+ gen_rtx_REG (Pmode, EH_RETURN_DATA_REGNO (0)));
+ emit_move_insn (cfun->eh->filter,
+ gen_rtx_REG (word_mode, EH_RETURN_DATA_REGNO (1)));
-/* Generate RTL for the start of a group of catch clauses.
+ seq = get_insns ();
+ end_sequence ();
- It is responsible for starting a new instruction sequence for the
- instructions in the catch block, and expanding the handlers for the
- internally-generated exception regions nested within the try block
- corresponding to this catch block. */
+ emit_insns_before (seq, region->post_landing_pad);
+ }
+}
-void
-expand_start_all_catch ()
+
+struct sjlj_lp_info
{
- struct eh_entry *entry;
- tree label;
- rtx outer_context;
-
- if (! doing_eh (1))
- return;
+ int directly_reachable;
+ int action_index;
+ int dispatch_index;
+ int call_site_index;
+};
- outer_context = ehstack.top->entry->outer_context;
+static bool
+sjlj_find_directly_reachable_regions (lp_info)
+ struct sjlj_lp_info *lp_info;
+{
+ rtx insn;
+ bool found_one = false;
- /* End the try block. */
- expand_eh_region_end (integer_zero_node);
+ for (insn = get_insns (); insn ; insn = NEXT_INSN (insn))
+ {
+ struct eh_region *region;
+ enum reachable_code rc;
+ tree type_thrown;
+ rtx note;
- emit_line_note (input_filename, lineno);
- label = build_decl (LABEL_DECL, NULL_TREE, NULL_TREE);
+ if (! INSN_P (insn))
+ continue;
- /* The label for the exception handling block that we will save.
- This is Lresume in the documentation. */
- expand_label (label);
-
- /* Push the label that points to where normal flow is resumed onto
- the top of the label stack. */
- push_label_entry (&caught_return_label_stack, NULL_RTX, label);
+ note = find_reg_note (insn, REG_EH_REGION, NULL_RTX);
+ if (!note || INTVAL (XEXP (note, 0)) <= 0)
+ continue;
- /* Start a new sequence for all the catch blocks. We will add this
- to the global sequence catch_clauses when we have completed all
- the handlers in this handler-seq. */
- start_sequence ();
-
- /* Throw away entries in the queue that we won't need anymore. We
- need entries for regions that have ended but to which there might
- still be gotos pending. */
- for (entry = dequeue_eh_entry (ehqueue);
- entry->finalization != integer_zero_node;
- entry = dequeue_eh_entry (ehqueue))
- free (entry);
+ region = cfun->eh->region_array[INTVAL (XEXP (note, 0))];
- /* At this point, all the cleanups are done, and the ehqueue now has
- the current exception region at its head. We dequeue it, and put it
- on the catch stack. */
- push_entry (&catchstack, entry);
+ type_thrown = NULL_TREE;
+ if (region->type == ERT_THROW)
+ {
+ type_thrown = region->u.throw.type;
+ region = region->outer;
+ }
- /* If we are not doing setjmp/longjmp EH, because we are reordered
- out of line, we arrange to rethrow in the outer context. We need to
- do this because we are not physically within the region, if any, that
- logically contains this catch block. */
- if (! exceptions_via_longjmp)
- {
- expand_eh_region_start ();
- ehstack.top->entry->outer_context = outer_context;
+ /* Find the first containing region that might handle the exception.
+ That's the landing pad to which we will transfer control. */
+ rc = RNL_NOT_CAUGHT;
+ for (; region; region = region->outer)
+ {
+ rc = reachable_next_level (region, type_thrown, 0);
+ if (rc != RNL_NOT_CAUGHT)
+ break;
+ }
+ if (rc == RNL_MAYBE_CAUGHT || rc == RNL_CAUGHT)
+ {
+ lp_info[region->region_number].directly_reachable = 1;
+ found_one = true;
+ }
}
+ return found_one;
}
-/* Finish up the catch block. At this point all the insns for the
- catch clauses have already been generated, so we only have to add
- them to the catch_clauses list. We also want to make sure that if
- we fall off the end of the catch clauses that we rethrow to the
- outer EH region. */
-
-void
-expand_end_all_catch ()
+static void
+sjlj_assign_call_site_values (dispatch_label, lp_info)
+ rtx dispatch_label;
+ struct sjlj_lp_info *lp_info;
{
- rtx new_catch_clause;
- struct eh_entry *entry;
+ htab_t ar_hash;
+ int i, index;
- if (! doing_eh (1))
- return;
+ /* First task: build the action table. */
- /* Dequeue the current catch clause region. */
- entry = pop_eh_entry (&catchstack);
- free (entry);
+ VARRAY_UCHAR_INIT (cfun->eh->action_record_data, 64, "action_record_data");
+ ar_hash = htab_create (31, action_record_hash, action_record_eq, free);
- if (! exceptions_via_longjmp)
- {
- rtx outer_context = ehstack.top->entry->outer_context;
+ for (i = cfun->eh->last_region_number; i > 0; --i)
+ if (lp_info[i].directly_reachable)
+ {
+ struct eh_region *r = cfun->eh->region_array[i];
+ r->landing_pad = dispatch_label;
+ lp_info[i].action_index = collect_one_action_chain (ar_hash, r);
+ if (lp_info[i].action_index != -1)
+ cfun->uses_eh_lsda = 1;
+ }
- /* Finish the rethrow region. size_zero_node is just a NOP. */
- expand_eh_region_end (size_zero_node);
- /* New exceptions handling models will never have a fall through
- of a catch clause */
- if (!flag_new_exceptions)
- expand_rethrow (outer_context);
- }
- else
- expand_rethrow (NULL_RTX);
+ htab_delete (ar_hash);
- /* Code to throw out to outer context, if we fall off end of catch
- handlers. This is rethrow (Lresume, same id, same obj) in the
- documentation. We use Lresume because we know that it will throw
- to the correct context.
+ /* Next: assign dispatch values. In dwarf2 terms, this would be the
+ landing pad label for the region. For sjlj though, there is one
+ common landing pad from which we dispatch to the post-landing pads.
- In other words, if the catch handler doesn't exit or return, we
- do a "throw" (using the address of Lresume as the point being
- thrown from) so that the outer EH region can then try to process
- the exception. */
+ A region receives a dispatch index if it is directly reachable
+ and requires in-function processing. Regions that share post-landing
+ pads may share dispatch indicies. */
+ /* ??? Post-landing pad sharing doesn't actually happen at the moment
+ (see build_post_landing_pads) so we don't bother checking for it. */
- /* Now we have the complete catch sequence. */
- new_catch_clause = get_insns ();
- end_sequence ();
-
- /* This level of catch blocks is done, so set up the successful
- catch jump label for the next layer of catch blocks. */
- pop_label_entry (&caught_return_label_stack);
- pop_label_entry (&outer_context_label_stack);
-
- /* Add the new sequence of catches to the main one for this function. */
- push_to_full_sequence (catch_clauses, catch_clauses_last);
- emit_insns (new_catch_clause);
- end_full_sequence (&catch_clauses, &catch_clauses_last);
-
- /* Here we fall through into the continuation code. */
-}
+ index = 0;
+ for (i = cfun->eh->last_region_number; i > 0; --i)
+ if (lp_info[i].directly_reachable)
+ lp_info[i].dispatch_index = index++;
-/* Rethrow from the outer context LABEL. */
+ /* Finally: assign call-site values. If dwarf2 terms, this would be
+ the region number assigned by convert_to_eh_region_ranges, but
+ handles no-action and must-not-throw differently. */
-static void
-expand_rethrow (label)
- rtx label;
-{
- if (exceptions_via_longjmp)
- emit_throw ();
- else
- if (flag_new_exceptions)
+ call_site_base = 1;
+ for (i = cfun->eh->last_region_number; i > 0; --i)
+ if (lp_info[i].directly_reachable)
{
- rtx insn;
- int region;
- if (label == NULL_RTX)
- label = last_rethrow_symbol;
- emit_library_call (rethrow_libfunc, 0, VOIDmode, 1, label, Pmode);
- region = find_func_region (eh_region_from_symbol (label));
- /* If the region is -1, it doesn't exist yet. We shouldn't be
- trying to rethrow there yet. */
- if (region == -1)
- abort ();
- function_eh_regions[region].rethrow_ref = 1;
-
- /* Search backwards for the actual call insn. */
- insn = get_last_insn ();
- while (GET_CODE (insn) != CALL_INSN)
- insn = PREV_INSN (insn);
- delete_insns_since (insn);
-
- /* Mark the label/symbol on the call. */
- REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_EH_RETHROW, label,
- REG_NOTES (insn));
- emit_barrier ();
+ int action = lp_info[i].action_index;
+
+ /* Map must-not-throw to otherwise unused call-site index 0. */
+ if (action == -2)
+ index = 0;
+ /* Map no-action to otherwise unused call-site index -1. */
+ else if (action == -1)
+ index = -1;
+ /* Otherwise, look it up in the table. */
+ else
+ index = add_call_site (GEN_INT (lp_info[i].dispatch_index), action);
+
+ lp_info[i].call_site_index = index;
}
- else
- emit_jump (label);
}
-/* Begin a region that will contain entries created with
- add_partial_entry. */
-
-void
-begin_protect_partials ()
+static void
+sjlj_mark_call_sites (lp_info)
+ struct sjlj_lp_info *lp_info;
{
- /* Push room for a new list. */
- protect_list = tree_cons (NULL_TREE, NULL_TREE, protect_list);
-}
-
-/* End all the pending exception regions on protect_list. The handlers
- will be emitted when expand_leftover_cleanups is invoked. */
+ int last_call_site = -2;
+ rtx insn, mem;
-void
-end_protect_partials ()
-{
- tree t;
-
- /* For backwards compatibility, we allow callers to omit the call to
- begin_protect_partials for the outermost region. So,
- PROTECT_LIST may be NULL. */
- if (!protect_list)
- return;
+ for (insn = get_insns (); insn ; insn = NEXT_INSN (insn))
+ {
+ struct eh_region *region;
+ int this_call_site;
+ rtx note, before, p;
- /* End all the exception regions. */
- for (t = TREE_VALUE (protect_list); t; t = TREE_CHAIN (t))
- expand_eh_region_end (TREE_VALUE (t));
+ /* Reset value tracking at extended basic block boundaries. */
+ if (GET_CODE (insn) == CODE_LABEL)
+ last_call_site = -2;
- /* Pop the topmost entry. */
- protect_list = TREE_CHAIN (protect_list);
-
-}
+ if (! INSN_P (insn))
+ continue;
-/* Arrange for __terminate to be called if there is an unhandled throw
- from within E. */
+ note = find_reg_note (insn, REG_EH_REGION, NULL_RTX);
+ if (!note)
+ {
+ /* Calls (and trapping insns) without notes are outside any
+ exception handling region in this function. Mark them as
+ no action. */
+ if (GET_CODE (insn) == CALL_INSN
+ || (flag_non_call_exceptions
+ && may_trap_p (PATTERN (insn))))
+ this_call_site = -1;
+ else
+ continue;
+ }
+ else
+ {
+ /* Calls that are known to not throw need not be marked. */
+ if (INTVAL (XEXP (note, 0)) <= 0)
+ continue;
-tree
-protect_with_terminate (e)
- tree e;
-{
- /* We only need to do this when using setjmp/longjmp EH and the
- language requires it, as otherwise we protect all of the handlers
- at once, if we need to. */
- if (exceptions_via_longjmp && protect_cleanup_actions_with_terminate)
- {
- tree handler, result;
+ region = cfun->eh->region_array[INTVAL (XEXP (note, 0))];
+ this_call_site = lp_info[region->region_number].call_site_index;
+ }
- handler = make_node (RTL_EXPR);
- TREE_TYPE (handler) = void_type_node;
- RTL_EXPR_RTL (handler) = const0_rtx;
- TREE_SIDE_EFFECTS (handler) = 1;
- start_sequence_for_rtl_expr (handler);
+ if (this_call_site == last_call_site)
+ continue;
- emit_library_call (terminate_libfunc, 0, VOIDmode, 0);
- emit_barrier ();
+ /* Don't separate a call from it's argument loads. */
+ before = insn;
+ if (GET_CODE (insn) == CALL_INSN)
+ before = find_first_parameter_load (insn, NULL_RTX);
- RTL_EXPR_SEQUENCE (handler) = get_insns ();
+ start_sequence ();
+ mem = change_address (cfun->eh->sjlj_fc, TYPE_MODE (integer_type_node),
+ plus_constant (XEXP (cfun->eh->sjlj_fc, 0),
+ sjlj_fc_call_site_ofs));
+ emit_move_insn (mem, GEN_INT (this_call_site));
+ p = get_insns ();
end_sequence ();
-
- result = build (TRY_CATCH_EXPR, TREE_TYPE (e), e, handler);
- TREE_SIDE_EFFECTS (result) = TREE_SIDE_EFFECTS (e);
- TREE_THIS_VOLATILE (result) = TREE_THIS_VOLATILE (e);
- TREE_READONLY (result) = TREE_READONLY (e);
- e = result;
+ emit_insns_before (p, before);
+ last_call_site = this_call_site;
}
-
- return e;
}
-
-/* The exception table that we build that is used for looking up and
- dispatching exceptions, the current number of entries, and its
- maximum size before we have to extend it.
- The number in eh_table is the code label number of the exception
- handler for the region. This is added by add_eh_table_entry and
- used by output_exception_table_entry. */
+/* Construct the SjLj_Function_Context. */
-static int *eh_table = NULL;
-static int eh_table_size = 0;
-static int eh_table_max_size = 0;
+static void
+sjlj_emit_function_enter (dispatch_label)
+ rtx dispatch_label;
+{
+ rtx fn_begin, fc, mem, seq;
-/* Note the need for an exception table entry for region N. If we
- don't need to output an explicit exception table, avoid all of the
- extra work.
+ fc = cfun->eh->sjlj_fc;
- Called from final_scan_insn when a NOTE_INSN_EH_REGION_BEG is seen.
- (Or NOTE_INSN_EH_REGION_END sometimes)
- N is the NOTE_EH_HANDLER of the note, which comes from the code
- label number of the exception handler for the region. */
+ start_sequence ();
-void
-add_eh_table_entry (n)
- int n;
-{
-#ifndef OMIT_EH_TABLE
- if (eh_table_size >= eh_table_max_size)
+ /* We're storing this libcall's address into memory instead of
+ calling it directly. Thus, we must call assemble_external_libcall
+ here, as we can not depend on emit_library_call to do it for us. */
+ assemble_external_libcall (eh_personality_libfunc);
+ mem = change_address (fc, Pmode,
+ plus_constant (XEXP (fc, 0), sjlj_fc_personality_ofs));
+ emit_move_insn (mem, eh_personality_libfunc);
+
+ mem = change_address (fc, Pmode,
+ plus_constant (XEXP (fc, 0), sjlj_fc_lsda_ofs));
+ if (cfun->uses_eh_lsda)
{
- if (eh_table)
- {
- eh_table_max_size += eh_table_max_size>>1;
-
- if (eh_table_max_size < 0)
- abort ();
-
- eh_table = (int *) xrealloc (eh_table,
- eh_table_max_size * sizeof (int));
- }
- else
- {
- eh_table_max_size = 252;
- eh_table = (int *) xmalloc (eh_table_max_size * sizeof (int));
- }
+ char buf[20];
+ ASM_GENERATE_INTERNAL_LABEL (buf, "LLSDA", sjlj_funcdef_number);
+ emit_move_insn (mem, gen_rtx_SYMBOL_REF (Pmode, ggc_strdup (buf)));
}
- eh_table[eh_table_size++] = n;
+ else
+ emit_move_insn (mem, const0_rtx);
- if (flag_new_exceptions)
- {
- /* We will output the exception table late in the compilation. That
- references type_info objects which should have already been output
- by that time. We explicitly mark those objects as being
- referenced now so we know to emit them. */
- struct handler_info *handler = get_first_handler (n);
-
- for (; handler; handler = handler->next)
- if (handler->type_info && handler->type_info != CATCH_ALL_TYPE)
- {
- tree tinfo = (tree)handler->type_info;
-
- tinfo = TREE_OPERAND (tinfo, 0);
- TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (tinfo)) = 1;
- }
- }
+#ifdef DONT_USE_BUILTIN_SETJMP
+ {
+ rtx x, note;
+ x = emit_library_call_value (setjmp_libfunc, NULL_RTX, LCT_NORMAL,
+ TYPE_MODE (integer_type_node), 1,
+ plus_constant (XEXP (fc, 0),
+ sjlj_fc_jbuf_ofs), Pmode);
+
+ note = emit_note (NULL, 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,
+ TYPE_MODE (integer_type_node), 0, 0,
+ dispatch_label);
+ }
+#else
+ expand_builtin_setjmp_setup (plus_constant (XEXP (fc, 0), sjlj_fc_jbuf_ofs),
+ dispatch_label);
#endif
-}
-/* Return a non-zero value if we need to output an exception table.
+ emit_library_call (unwind_sjlj_register_libfunc, LCT_NORMAL, VOIDmode,
+ 1, XEXP (fc, 0), Pmode);
- On some platforms, we don't have to output a table explicitly.
- This routine doesn't mean we don't have one. */
+ seq = get_insns ();
+ end_sequence ();
-int
-exception_table_p ()
-{
- if (eh_table)
- return 1;
+ /* ??? Instead of doing this at the beginning of the function,
+ do this in a block that is at loop level 0 and dominates all
+ can_throw_internal instructions. */
- return 0;
+ for (fn_begin = get_insns (); ; fn_begin = NEXT_INSN (fn_begin))
+ if (GET_CODE (fn_begin) == NOTE
+ && NOTE_LINE_NUMBER (fn_begin) == NOTE_INSN_FUNCTION_BEG)
+ break;
+ emit_insns_after (seq, fn_begin);
}
-/* Output the entry of the exception table corresponding to the
- exception region numbered N to file FILE.
+/* Call back from expand_function_end to know where we should put
+ the call to unwind_sjlj_unregister_libfunc if needed. */
- N is the code label number corresponding to the handler of the
- region. */
+void
+sjlj_emit_function_exit_after (after)
+ rtx after;
+{
+ cfun->eh->sjlj_exit_after = after;
+}
static void
-output_exception_table_entry (file, n)
- FILE *file;
- int n;
-{
- char buf[256];
- rtx sym;
- struct handler_info *handler = get_first_handler (n);
- int index = find_func_region (n);
- rtx rethrow;
-
- /* Form and emit the rethrow label, if needed */
- if (flag_new_exceptions
- && (handler || function_eh_regions[index].rethrow_ref))
- rethrow = function_eh_regions[index].rethrow_label;
- else
- rethrow = NULL_RTX;
+sjlj_emit_function_exit ()
+{
+ rtx seq;
- if (function_eh_regions[index].emitted)
- return;
- function_eh_regions[index].emitted = 1;
+ start_sequence ();
- for ( ; handler != NULL || rethrow != NULL_RTX; handler = handler->next)
- {
- /* rethrow label should indicate the LAST entry for a region */
- if (rethrow != NULL_RTX && (handler == NULL || handler->next == NULL))
- {
- ASM_GENERATE_INTERNAL_LABEL (buf, "LRTH", n);
- assemble_eh_label(buf);
- rethrow = NULL_RTX;
- }
+ emit_library_call (unwind_sjlj_unregister_libfunc, LCT_NORMAL, VOIDmode,
+ 1, XEXP (cfun->eh->sjlj_fc, 0), Pmode);
- ASM_GENERATE_INTERNAL_LABEL (buf, "LEHB", n);
- sym = gen_rtx_SYMBOL_REF (Pmode, buf);
- assemble_eh_integer (sym, POINTER_SIZE / BITS_PER_UNIT, 1);
+ seq = get_insns ();
+ end_sequence ();
- ASM_GENERATE_INTERNAL_LABEL (buf, "LEHE", n);
- sym = gen_rtx_SYMBOL_REF (Pmode, buf);
- assemble_eh_integer (sym, POINTER_SIZE / BITS_PER_UNIT, 1);
-
- if (handler == NULL)
- assemble_eh_integer (GEN_INT (0), POINTER_SIZE / BITS_PER_UNIT, 1);
- else
- {
- ASM_GENERATE_INTERNAL_LABEL (buf, "L", handler->handler_number);
- sym = gen_rtx_SYMBOL_REF (Pmode, buf);
- assemble_eh_integer (sym, POINTER_SIZE / BITS_PER_UNIT, 1);
- }
-
- if (flag_new_exceptions)
- {
- if (handler == NULL || handler->type_info == NULL)
- assemble_eh_integer (const0_rtx, POINTER_SIZE / BITS_PER_UNIT, 1);
- else
- if (handler->type_info == CATCH_ALL_TYPE)
- assemble_eh_integer (GEN_INT (CATCH_ALL_TYPE),
- POINTER_SIZE / BITS_PER_UNIT, 1);
- else
- output_constant ((tree)(handler->type_info),
- POINTER_SIZE / BITS_PER_UNIT);
- }
- putc ('\n', file); /* blank line */
- /* We only output the first label under the old scheme */
- if (! flag_new_exceptions || handler == NULL)
- break;
- }
-}
-
-/* Output the exception table if we have and need one. */
-
-static short language_code = 0;
-static short version_code = 0;
-
-/* This routine will set the language code for exceptions. */
-void
-set_exception_lang_code (code)
- int code;
-{
- language_code = code;
-}
+ /* ??? Really this can be done in any block at loop level 0 that
+ post-dominates all can_throw_internal instructions. This is
+ the last possible moment. */
-/* This routine will set the language version code for exceptions. */
-void
-set_exception_version_code (code)
- int code;
-{
- version_code = code;
+ emit_insns_after (seq, cfun->eh->sjlj_exit_after);
}
-/* Free the EH table structures. */
-void
-free_exception_table ()
+static void
+sjlj_emit_dispatch_table (dispatch_label, lp_info)
+ rtx dispatch_label;
+ struct sjlj_lp_info *lp_info;
{
- if (eh_table)
- free (eh_table);
- clear_function_eh_region ();
-}
+ int i, first_reachable;
+ rtx mem, dispatch, seq, fc;
+
+ fc = cfun->eh->sjlj_fc;
+
+ start_sequence ();
+
+ emit_label (dispatch_label);
-/* Output the common content of an exception table. */
-void
-output_exception_table_data ()
-{
- int i;
- char buf[256];
- extern FILE *asm_out_file;
+#ifndef DONT_USE_BUILTIN_SETJMP
+ expand_builtin_setjmp_receiver (dispatch_label);
+#endif
+
+ /* Load up dispatch index, exc_ptr and filter values from the
+ function context. */
+ mem = change_address (fc, TYPE_MODE (integer_type_node),
+ plus_constant (XEXP (fc, 0), sjlj_fc_call_site_ofs));
+ dispatch = copy_to_reg (mem);
- if (flag_new_exceptions)
+ mem = change_address (fc, word_mode,
+ plus_constant (XEXP (fc, 0), sjlj_fc_data_ofs));
+ if (word_mode != Pmode)
{
- assemble_eh_integer (GEN_INT (NEW_EH_RUNTIME),
- POINTER_SIZE / BITS_PER_UNIT, 1);
- assemble_eh_integer (GEN_INT (language_code), 2 , 1);
- assemble_eh_integer (GEN_INT (version_code), 2 , 1);
+#ifdef POINTERS_EXTEND_UNSIGNED
+ mem = convert_memory_address (Pmode, mem);
+#else
+ mem = convert_to_mode (Pmode, mem, 0);
+#endif
+ }
+ emit_move_insn (cfun->eh->exc_ptr, mem);
+
+ mem = change_address (fc, word_mode,
+ plus_constant (XEXP (fc, 0),
+ sjlj_fc_data_ofs + UNITS_PER_WORD));
+ emit_move_insn (cfun->eh->filter, mem);
- /* Add enough padding to make sure table aligns on a pointer boundry. */
- i = GET_MODE_ALIGNMENT (ptr_mode) / BITS_PER_UNIT - 4;
- for ( ; i < 0; i = i + GET_MODE_ALIGNMENT (ptr_mode) / BITS_PER_UNIT)
- ;
- if (i != 0)
- assemble_eh_integer (const0_rtx, i , 1);
+ /* Jump to one of the directly reachable regions. */
+ /* ??? This really ought to be using a switch statement. */
+
+ first_reachable = 0;
+ for (i = cfun->eh->last_region_number; i > 0; --i)
+ {
+ if (! lp_info[i].directly_reachable)
+ continue;
+
+ if (! first_reachable)
+ {
+ first_reachable = i;
+ continue;
+ }
- /* Generate the label for offset calculations on rethrows. */
- ASM_GENERATE_INTERNAL_LABEL (buf, "LRTH", 0);
- assemble_eh_label(buf);
+ emit_cmp_and_jump_insns (dispatch,
+ GEN_INT (lp_info[i].dispatch_index), EQ,
+ NULL_RTX, TYPE_MODE (integer_type_node), 0, 0,
+ cfun->eh->region_array[i]->post_landing_pad);
}
- for (i = 0; i < eh_table_size; ++i)
- output_exception_table_entry (asm_out_file, eh_table[i]);
+ seq = get_insns ();
+ end_sequence ();
+ emit_insns_before (seq, (cfun->eh->region_array[first_reachable]
+ ->post_landing_pad));
}
-/* Output an exception table for the entire compilation unit. */
-void
-output_exception_table ()
+static void
+sjlj_build_landing_pads ()
{
- char buf[256];
- extern FILE *asm_out_file;
+ struct sjlj_lp_info *lp_info;
- if (! doing_eh (0) || ! eh_table)
- return;
+ lp_info = (struct sjlj_lp_info *) xcalloc (cfun->eh->last_region_number + 1,
+ sizeof (struct sjlj_lp_info));
- exception_section ();
-
- /* Beginning marker for table. */
- assemble_eh_align (GET_MODE_ALIGNMENT (ptr_mode));
- assemble_eh_label ("__EXCEPTION_TABLE__");
+ if (sjlj_find_directly_reachable_regions (lp_info))
+ {
+ rtx dispatch_label = gen_label_rtx ();
- output_exception_table_data ();
+ cfun->eh->sjlj_fc
+ = assign_stack_local (TYPE_MODE (sjlj_fc_type_node),
+ int_size_in_bytes (sjlj_fc_type_node),
+ TYPE_ALIGN (sjlj_fc_type_node));
- /* Ending marker for table. */
- /* Generate the label for end of table. */
- ASM_GENERATE_INTERNAL_LABEL (buf, "LRTH", CODE_LABEL_NUMBER (final_rethrow));
- assemble_eh_label(buf);
- assemble_eh_integer (constm1_rtx, POINTER_SIZE / BITS_PER_UNIT, 1);
+ sjlj_assign_call_site_values (dispatch_label, lp_info);
+ sjlj_mark_call_sites (lp_info);
- /* For binary compatibility, the old __throw checked the second
- position for a -1, so we should output at least 2 -1's */
- if (! flag_new_exceptions)
- assemble_eh_integer (constm1_rtx, POINTER_SIZE / BITS_PER_UNIT, 1);
+ sjlj_emit_function_enter (dispatch_label);
+ sjlj_emit_dispatch_table (dispatch_label, lp_info);
+ sjlj_emit_function_exit ();
+ }
- putc ('\n', asm_out_file); /* blank line */
+ free (lp_info);
}
-/* Used by the ia64 unwind format to output data for an individual
- function. */
void
-output_function_exception_table ()
+finish_eh_generation ()
{
- extern FILE *asm_out_file;
-
- if (! doing_eh (0) || ! eh_table)
+ /* Nothing to do if no regions created. */
+ if (cfun->eh->region_tree == NULL)
return;
-#ifdef HANDLER_SECTION
- HANDLER_SECTION;
-#endif
-
- output_exception_table_data ();
+ /* The object here is to provide find_basic_blocks with detailed
+ information (via reachable_handlers) on how exception control
+ flows within the function. In this first pass, we can include
+ type information garnered from ERT_THROW and ERT_ALLOWED_EXCEPTIONS
+ regions, and hope that it will be useful in deleting unreachable
+ handlers. Subsequently, we will generate landing pads which will
+ connect many of the handlers, and then type information will not
+ be effective. Still, this is a win over previous implementations. */
+
+ jump_optimize_minimal (get_insns ());
+ find_basic_blocks (get_insns (), max_reg_num (), 0);
+ cleanup_cfg ();
+
+ /* These registers are used by the landing pads. Make sure they
+ have been generated. */
+ get_exception_pointer (cfun);
+ get_exception_filter (cfun);
+
+ /* Construct the landing pads. */
+
+ assign_filter_values ();
+ build_post_landing_pads ();
+ connect_post_landing_pads ();
+ if (USING_SJLJ_EXCEPTIONS)
+ sjlj_build_landing_pads ();
+ else
+ dw2_build_landing_pads ();
- /* Ending marker for table. */
- assemble_eh_integer (constm1_rtx, POINTER_SIZE / BITS_PER_UNIT, 1);
+ cfun->eh->built_landing_pads = 1;
- putc ('\n', asm_out_file); /* blank line */
+ /* We've totally changed the CFG. Start over. */
+ find_exception_handler_labels ();
+ jump_optimize_minimal (get_insns ());
+ find_basic_blocks (get_insns (), max_reg_num (), 0);
+ cleanup_cfg ();
}
-
-/* Emit code to get EH context.
-
- We have to scan thru the code to find possible EH context registers.
- Inlined functions may use it too, and thus we'll have to be able
- to change them too.
+/* This section handles removing dead code for flow. */
- This is done only if using exceptions_via_longjmp. */
+/* Remove LABEL from the exception_handler_labels list. */
-void
-emit_eh_context ()
+static void
+remove_exception_handler_label (label)
+ rtx label;
{
- rtx insn;
- rtx ehc = 0;
-
- if (! doing_eh (0))
- return;
-
- for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
- if (GET_CODE (insn) == INSN
- && GET_CODE (PATTERN (insn)) == USE)
- {
- rtx reg = find_reg_note (insn, REG_EH_CONTEXT, 0);
- if (reg)
- {
- rtx insns;
-
- start_sequence ();
-
- /* If this is the first use insn, emit the call here. This
- will always be at the top of our function, because if
- expand_inline_function notices a REG_EH_CONTEXT note, it
- adds a use insn to this function as well. */
- if (ehc == 0)
- ehc = call_get_eh_context ();
+ rtx *pl, l;
- emit_move_insn (XEXP (reg, 0), ehc);
- insns = get_insns ();
- end_sequence ();
+ for (pl = &exception_handler_labels, l = *pl;
+ XEXP (l, 0) != label;
+ pl = &XEXP (l, 1), l = *pl)
+ continue;
- emit_insns_before (insns, insn);
- }
- }
+ *pl = XEXP (l, 1);
+ free_EXPR_LIST_node (l);
}
-/* Scan the insn chain F and build a list of handler labels. The
- resulting list is placed in the global variable exception_handler_labels. */
+/* Splice REGION from the region tree etc. */
static void
-find_exception_handler_labels_1 (f)
- rtx f;
+remove_eh_handler (region)
+ struct eh_region *region;
{
- rtx insn;
+ struct eh_region **pp, *p;
+ rtx lab;
+ int i;
- /* For each start of a region, add its label to the list. */
+ /* For the benefit of efficiently handling REG_EH_REGION notes,
+ replace this region in the region array with its containing
+ region. Note that previous region deletions may result in
+ multiple copies of this region in the array, so we have to
+ search the whole thing. */
+ for (i = cfun->eh->last_region_number; i > 0; --i)
+ if (cfun->eh->region_array[i] == region)
+ cfun->eh->region_array[i] = region->outer;
+
+ if (cfun->eh->built_landing_pads)
+ lab = region->landing_pad;
+ else
+ lab = region->label;
+ if (lab)
+ remove_exception_handler_label (lab);
+
+ if (region->outer)
+ pp = &region->outer->inner;
+ else
+ pp = &cfun->eh->region_tree;
+ for (p = *pp; p != region; pp = &p->next_peer, p = *pp)
+ continue;
- for (insn = f; insn; insn = NEXT_INSN (insn))
+ if (region->inner)
{
- struct handler_info* ptr;
- if (GET_CODE (insn) == NOTE
- && NOTE_LINE_NUMBER (insn) == NOTE_INSN_EH_REGION_BEG)
- {
- ptr = get_first_handler (NOTE_EH_HANDLER (insn));
- for ( ; ptr; ptr = ptr->next)
- {
- /* make sure label isn't in the list already */
- rtx x;
- for (x = exception_handler_labels; x; x = XEXP (x, 1))
- if (XEXP (x, 0) == ptr->handler_label)
- break;
- if (! x)
- exception_handler_labels = gen_rtx_EXPR_LIST (VOIDmode,
- ptr->handler_label, exception_handler_labels);
- }
- }
- else if (GET_CODE (insn) == CALL_INSN
- && GET_CODE (PATTERN (insn)) == CALL_PLACEHOLDER)
- {
- find_exception_handler_labels_1 (XEXP (PATTERN (insn), 0));
- find_exception_handler_labels_1 (XEXP (PATTERN (insn), 1));
- find_exception_handler_labels_1 (XEXP (PATTERN (insn), 2));
- }
+ for (p = region->inner; p->next_peer ; p = p->next_peer)
+ p->outer = region->outer;
+ p->next_peer = region->next_peer;
+ p->outer = region->outer;
+ *pp = region->inner;
}
-}
-
-/* Scan the current insns and build a list of handler labels. The
- resulting list is placed in the global variable exception_handler_labels.
+ else
+ *pp = region->next_peer;
- It is called after the last exception handling region is added to
- the current function (when the rtl is almost all built for the
- current function) and before the jump optimization pass. */
-void
-find_exception_handler_labels ()
-{
- exception_handler_labels = NULL_RTX;
+ if (region->type == ERT_CATCH)
+ {
+ struct eh_region *try, *next, *prev;
- /* If we aren't doing exception handling, there isn't much to check. */
- if (! doing_eh (0))
- return;
+ for (try = region->next_peer;
+ try->type == ERT_CATCH;
+ try = try->next_peer)
+ continue;
+ if (try->type != ERT_TRY)
+ abort ();
- find_exception_handler_labels_1 (get_insns ());
-}
+ next = region->u.catch.next_catch;
+ prev = region->u.catch.prev_catch;
-/* Return a value of 1 if the parameter label number is an exception handler
- label. Return 0 otherwise. */
+ if (next)
+ next->u.catch.prev_catch = prev;
+ else
+ try->u.try.last_catch = prev;
+ if (prev)
+ prev->u.catch.next_catch = next;
+ else
+ {
+ try->u.try.catch = next;
+ if (! next)
+ remove_eh_handler (try);
+ }
+ }
-int
-is_exception_handler_label (lab)
- int lab;
-{
- rtx x;
- for (x = exception_handler_labels ; x ; x = XEXP (x, 1))
- if (lab == CODE_LABEL_NUMBER (XEXP (x, 0)))
- return 1;
- return 0;
+ free (region);
}
-/* Perform sanity checking on the exception_handler_labels list.
-
- Can be called after find_exception_handler_labels is called to
- build the list of exception handlers for the current function and
- before we finish processing the current function. */
+/* LABEL heads a basic block that is about to be deleted. If this
+ label corresponds to an exception region, we may be able to
+ delete the region. */
void
-check_exception_handler_labels ()
+maybe_remove_eh_handler (label)
+ rtx label;
{
- rtx insn, insn2;
+ int i;
- /* If we aren't doing exception handling, there isn't much to check. */
- if (! doing_eh (0))
+ /* ??? After generating landing pads, it's not so simple to determine
+ if the region data is completely unused. One must examine the
+ landing pad and the post landing pad, and whether an inner try block
+ is referencing the catch handlers directly. */
+ if (cfun->eh->built_landing_pads)
return;
- /* Make sure there is no more than 1 copy of a label */
- for (insn = exception_handler_labels; insn; insn = XEXP (insn, 1))
- {
- int count = 0;
- for (insn2 = exception_handler_labels; insn2; insn2 = XEXP (insn2, 1))
- if (XEXP (insn, 0) == XEXP (insn2, 0))
- count++;
- if (count != 1)
- warning ("Counted %d copies of EH region %d in list.\n", count,
- CODE_LABEL_NUMBER (insn));
- }
-
-}
-
-/* Mark the children of NODE for GC. */
-
-static void
-mark_eh_node (node)
- struct eh_node *node;
-{
- while (node)
+ for (i = cfun->eh->last_region_number; i > 0; --i)
{
- if (node->entry)
+ struct eh_region *region = cfun->eh->region_array[i];
+ if (region && region->label == label)
{
- ggc_mark_rtx (node->entry->outer_context);
- ggc_mark_rtx (node->entry->exception_handler_label);
- ggc_mark_tree (node->entry->finalization);
- ggc_mark_rtx (node->entry->false_label);
- ggc_mark_rtx (node->entry->rethrow_label);
+ /* Flow will want to remove MUST_NOT_THROW regions as unreachable
+ because there is no path to the fallback call to terminate.
+ But the region continues to affect call-site data until there
+ are no more contained calls, which we don't see here. */
+ if (region->type == ERT_MUST_NOT_THROW)
+ {
+ remove_exception_handler_label (region->label);
+ region->label = NULL_RTX;
+ }
+ else
+ remove_eh_handler (region);
+ break;
}
- node = node ->chain;
}
}
-/* Mark S for GC. */
+
+/* This section describes CFG exception edges for flow. */
-static void
-mark_eh_stack (s)
- struct eh_stack *s;
+/* For communicating between calls to reachable_next_level. */
+struct reachable_info
{
- if (s)
- mark_eh_node (s->top);
-}
+ tree types_caught;
+ tree types_allowed;
+ rtx handlers;
+};
-/* Mark Q for GC. */
+/* A subroutine of reachable_next_level. Return true if TYPE, or a
+ base class of TYPE, is in HANDLED. */
-static void
-mark_eh_queue (q)
- struct eh_queue *q;
+static int
+check_handled (handled, type)
+ tree handled, type;
{
- while (q)
+ tree t;
+
+ /* We can check for exact matches without front-end help. */
+ if (! lang_eh_type_covers)
{
- mark_eh_node (q->head);
- q = q->next;
+ for (t = handled; t ; t = TREE_CHAIN (t))
+ if (TREE_VALUE (t) == type)
+ return 1;
}
+ else
+ {
+ for (t = handled; t ; t = TREE_CHAIN (t))
+ if ((*lang_eh_type_covers) (TREE_VALUE (t), type))
+ return 1;
+ }
+
+ return 0;
}
-/* Mark NODE for GC. A label_node contains a union containing either
- a tree or an rtx. This label_node will contain a tree. */
+/* A subroutine of reachable_next_level. If we are collecting a list
+ of handlers, add one. After landing pad generation, reference
+ it instead of the handlers themselves. Further, the handlers are
+ all wired together, so by referencing one, we've got them all.
+ Before landing pad generation we reference each handler individually.
+
+ LP_REGION contains the landing pad; REGION is the handler. */
static void
-mark_tree_label_node (node)
- struct label_node *node;
+add_reachable_handler (info, lp_region, region)
+ struct reachable_info *info;
+ struct eh_region *lp_region;
+ struct eh_region *region;
{
- while (node)
+ if (! info)
+ return;
+
+ if (cfun->eh->built_landing_pads)
{
- ggc_mark_tree (node->u.tlabel);
- node = node->chain;
+ if (! info->handlers)
+ info->handlers = alloc_INSN_LIST (lp_region->landing_pad, NULL_RTX);
}
+ else
+ info->handlers = alloc_INSN_LIST (region->label, info->handlers);
}
-/* Mark EH for GC. */
+/* Process one level of exception regions for reachability.
+ If TYPE_THROWN is non-null, then it is the *exact* type being
+ propagated. If INFO is non-null, then collect handler labels
+ and caught/allowed type information between invocations. */
-void
-mark_eh_status (eh)
- struct eh_status *eh;
+static enum reachable_code
+reachable_next_level (region, type_thrown, info)
+ struct eh_region *region;
+ tree type_thrown;
+ struct reachable_info *info;
{
- if (eh == 0)
- return;
+ switch (region->type)
+ {
+ case ERT_CLEANUP:
+ /* Before landing-pad generation, we model control flow
+ directly to the individual handlers. In this way we can
+ see that catch handler types may shadow one another. */
+ add_reachable_handler (info, region, region);
+ return RNL_MAYBE_CAUGHT;
+
+ case ERT_TRY:
+ {
+ struct eh_region *c;
+ enum reachable_code ret = RNL_NOT_CAUGHT;
- mark_eh_stack (&eh->x_ehstack);
- mark_eh_stack (&eh->x_catchstack);
- mark_eh_queue (eh->x_ehqueue);
- ggc_mark_rtx (eh->x_catch_clauses);
+ for (c = region->u.try.catch; c ; c = c->u.catch.next_catch)
+ {
+ /* A catch-all handler ends the search. */
+ /* ??? _Unwind_ForcedUnwind will want outer cleanups
+ to be run as well. */
+ if (c->u.catch.type == NULL)
+ {
+ add_reachable_handler (info, region, c);
+ return RNL_CAUGHT;
+ }
+
+ if (type_thrown)
+ {
+ /* If we have a type match, end the search. */
+ if (c->u.catch.type == type_thrown
+ || (lang_eh_type_covers
+ && (*lang_eh_type_covers) (c->u.catch.type,
+ type_thrown)))
+ {
+ add_reachable_handler (info, region, c);
+ return RNL_CAUGHT;
+ }
+
+ /* If we have definitive information of a match failure,
+ the catch won't trigger. */
+ if (lang_eh_type_covers)
+ return RNL_NOT_CAUGHT;
+ }
+
+ if (! info)
+ ret = RNL_MAYBE_CAUGHT;
+
+ /* A type must not have been previously caught. */
+ else if (! check_handled (info->types_caught, c->u.catch.type))
+ {
+ add_reachable_handler (info, region, c);
+ info->types_caught = tree_cons (NULL, c->u.catch.type,
+ info->types_caught);
+
+ /* ??? If the catch type is a base class of every allowed
+ type, then we know we can stop the search. */
+ ret = RNL_MAYBE_CAUGHT;
+ }
+ }
- if (lang_mark_false_label_stack)
- (*lang_mark_false_label_stack) (eh->x_false_label_stack);
- mark_tree_label_node (eh->x_caught_return_label_stack);
+ return ret;
+ }
- ggc_mark_tree (eh->x_protect_list);
- ggc_mark_rtx (eh->ehc);
- ggc_mark_rtx (eh->x_eh_return_stub_label);
-}
+ case ERT_ALLOWED_EXCEPTIONS:
+ /* An empty list of types definitely ends the search. */
+ if (region->u.allowed.type_list == NULL_TREE)
+ {
+ add_reachable_handler (info, region, region);
+ return RNL_CAUGHT;
+ }
-/* Mark ARG (which is really a struct func_eh_entry**) for GC. */
+ /* Collect a list of lists of allowed types for use in detecting
+ when a catch may be transformed into a catch-all. */
+ if (info)
+ info->types_allowed = tree_cons (NULL_TREE,
+ region->u.allowed.type_list,
+ info->types_allowed);
+
+ /* If we have definitive information about the type heirarchy,
+ then we can tell if the thrown type will pass through the
+ filter. */
+ if (type_thrown && lang_eh_type_covers)
+ {
+ if (check_handled (region->u.allowed.type_list, type_thrown))
+ return RNL_NOT_CAUGHT;
+ else
+ {
+ add_reachable_handler (info, region, region);
+ return RNL_CAUGHT;
+ }
+ }
-static void
-mark_func_eh_entry (arg)
- void *arg;
-{
- struct func_eh_entry *fee;
- struct handler_info *h;
- int i;
+ add_reachable_handler (info, region, region);
+ return RNL_MAYBE_CAUGHT;
- fee = *((struct func_eh_entry **) arg);
+ case ERT_CATCH:
+ /* Catch regions are handled by their controling try region. */
+ return RNL_NOT_CAUGHT;
- for (i = 0; i < current_func_eh_entry; ++i)
- {
- ggc_mark_rtx (fee->rethrow_label);
- for (h = fee->handlers; h; h = h->next)
+ case ERT_MUST_NOT_THROW:
+ /* Here we end our search, since no exceptions may propagate.
+ If we've touched down at some landing pad previous, then the
+ explicit function call we generated may be used. Otherwise
+ the call is made by the runtime. */
+ if (info && info->handlers)
{
- ggc_mark_rtx (h->handler_label);
- if (h->type_info != CATCH_ALL_TYPE)
- ggc_mark_tree ((tree) h->type_info);
+ add_reachable_handler (info, region, region);
+ return RNL_CAUGHT;
}
+ else
+ return RNL_BLOCKED;
- /* Skip to the next entry in the array. */
- ++fee;
+ case ERT_THROW:
+ case ERT_FIXUP:
+ /* Shouldn't see these here. */
+ break;
}
-}
-
-/* This group of functions initializes the exception handling data
- structures at the start of the compilation, initializes the data
- structures at the start of a function, and saves and restores the
- exception handling data structures for the start/end of a nested
- function. */
-
-/* Toplevel initialization for EH things. */
-
-void
-init_eh ()
-{
- first_rethrow_symbol = create_rethrow_ref (0);
- final_rethrow = gen_exception_label ();
- last_rethrow_symbol = create_rethrow_ref (CODE_LABEL_NUMBER (final_rethrow));
- ggc_add_rtx_root (&exception_handler_labels, 1);
- ggc_add_rtx_root (&eh_return_context, 1);
- ggc_add_rtx_root (&eh_return_stack_adjust, 1);
- ggc_add_rtx_root (&eh_return_handler, 1);
- ggc_add_rtx_root (&first_rethrow_symbol, 1);
- ggc_add_rtx_root (&final_rethrow, 1);
- ggc_add_rtx_root (&last_rethrow_symbol, 1);
- ggc_add_root (&function_eh_regions, 1, sizeof (function_eh_regions),
- mark_func_eh_entry);
+ abort ();
}
-
-/* Initialize the per-function EH information. */
-void
-init_eh_for_function ()
-{
- cfun->eh = (struct eh_status *) xcalloc (1, sizeof (struct eh_status));
- ehqueue = (struct eh_queue *) xcalloc (1, sizeof (struct eh_queue));
- eh_return_context = NULL_RTX;
- eh_return_stack_adjust = NULL_RTX;
- eh_return_handler = NULL_RTX;
-}
+/* Retrieve a list of labels of exception handlers which can be
+ reached by a given insn. */
-void
-free_eh_status (f)
- struct function *f;
-{
- free (f->eh->x_ehqueue);
- free (f->eh);
- f->eh = NULL;
-}
-
-/* This section is for the exception handling specific optimization
- pass. */
-
-/* Determine if the given INSN can throw an exception. */
-
-int
-can_throw (insn)
+rtx
+reachable_handlers (insn)
rtx insn;
{
- if (GET_CODE (insn) == INSN
- && GET_CODE (PATTERN (insn)) == SEQUENCE)
- insn = XVECEXP (PATTERN (insn), 0, 0);
+ struct reachable_info info;
+ struct eh_region *region;
+ tree type_thrown;
+ int region_number;
- /* Calls can always potentially throw exceptions, unless they have
- a REG_EH_REGION note with a value of 0 or less. */
- if (GET_CODE (insn) == CALL_INSN)
+ if (GET_CODE (insn) == JUMP_INSN
+ && GET_CODE (PATTERN (insn)) == RESX)
+ region_number = XINT (PATTERN (insn), 0);
+ else
{
rtx note = find_reg_note (insn, REG_EH_REGION, NULL_RTX);
- if (!note || INTVAL (XEXP (note, 0)) > 0)
- return 1;
+ if (!note || INTVAL (XEXP (note, 0)) <= 0)
+ return NULL;
+ region_number = INTVAL (XEXP (note, 0));
}
- if (asynchronous_exceptions)
+ memset (&info, 0, sizeof (info));
+
+ region = cfun->eh->region_array[region_number];
+
+ type_thrown = NULL_TREE;
+ if (region->type == ERT_THROW)
{
- /* If we wanted asynchronous exceptions, then everything but NOTEs
- and CODE_LABELs could throw. */
- if (GET_CODE (insn) != NOTE && GET_CODE (insn) != CODE_LABEL)
- return 1;
+ type_thrown = region->u.throw.type;
+ region = region->outer;
}
+ else if (GET_CODE (insn) == JUMP_INSN
+ && GET_CODE (PATTERN (insn)) == RESX)
+ region = region->outer;
- return 0;
+ for (; region; region = region->outer)
+ if (reachable_next_level (region, type_thrown, &info) >= RNL_CAUGHT)
+ break;
+
+ return info.handlers;
}
-/* Return nonzero if nothing in this function can throw. */
+/* Determine if the given INSN can throw an exception that is caught
+ within the function. */
-int
-nothrow_function_p ()
+bool
+can_throw_internal (insn)
+ rtx insn;
{
- rtx insn;
+ struct eh_region *region;
+ tree type_thrown;
+ rtx note;
- if (! flag_exceptions)
- return 1;
+ if (! INSN_P (insn))
+ return false;
- for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
- if (can_throw (insn))
- return 0;
- for (insn = current_function_epilogue_delay_list; insn;
- insn = XEXP (insn, 1))
- if (can_throw (insn))
- return 0;
+ if (GET_CODE (insn) == INSN
+ && GET_CODE (PATTERN (insn)) == SEQUENCE)
+ insn = XVECEXP (PATTERN (insn), 0, 0);
- return 1;
-}
+ if (GET_CODE (insn) == CALL_INSN
+ && GET_CODE (PATTERN (insn)) == CALL_PLACEHOLDER)
+ {
+ int i;
+ for (i = 0; i < 3; ++i)
+ {
+ rtx sub = XEXP (PATTERN (insn), i);
+ for (; sub ; sub = NEXT_INSN (sub))
+ if (can_throw_internal (sub))
+ return true;
+ }
+ return false;
+ }
-/* Scan a exception region looking for the matching end and then
- remove it if possible. INSN is the start of the region, N is the
- region number, and DELETE_OUTER is to note if anything in this
- region can throw.
+ /* Every insn that might throw has an EH_REGION note. */
+ note = find_reg_note (insn, REG_EH_REGION, NULL_RTX);
+ if (!note || INTVAL (XEXP (note, 0)) <= 0)
+ return false;
- Regions are removed if they cannot possibly catch an exception.
- This is determined by invoking can_throw on each insn within the
- region; if can_throw returns true for any of the instructions, the
- region can catch an exception, since there is an insn within the
- region that is capable of throwing an exception.
+ region = cfun->eh->region_array[INTVAL (XEXP (note, 0))];
- Returns the NOTE_INSN_EH_REGION_END corresponding to this region, or
- calls abort if it can't find one.
+ type_thrown = NULL_TREE;
+ if (region->type == ERT_THROW)
+ {
+ type_thrown = region->u.throw.type;
+ region = region->outer;
+ }
- Can abort if INSN is not a NOTE_INSN_EH_REGION_BEGIN, or if N doesn't
- correspond to the region number, or if DELETE_OUTER is NULL. */
+ /* If this exception is ignored by each and every containing region,
+ then control passes straight out. The runtime may handle some
+ regions, which also do not require processing internally. */
+ for (; region; region = region->outer)
+ {
+ enum reachable_code how = reachable_next_level (region, type_thrown, 0);
+ if (how == RNL_BLOCKED)
+ return false;
+ if (how != RNL_NOT_CAUGHT)
+ return true;
+ }
-static rtx
-scan_region (insn, n, delete_outer)
- rtx insn;
- int n;
- int *delete_outer;
-{
- rtx start = insn;
+ return false;
+}
- /* Assume we can delete the region. */
- int delete = 1;
+/* Determine if the given INSN can throw an exception that is
+ visible outside the function. */
- /* Can't delete something which is rethrown from. */
- if (rethrow_used (n))
- delete = 0;
+bool
+can_throw_external (insn)
+ rtx insn;
+{
+ struct eh_region *region;
+ tree type_thrown;
+ rtx note;
- if (insn == NULL_RTX
- || GET_CODE (insn) != NOTE
- || NOTE_LINE_NUMBER (insn) != NOTE_INSN_EH_REGION_BEG
- || NOTE_EH_HANDLER (insn) != n
- || delete_outer == NULL)
- abort ();
+ if (! INSN_P (insn))
+ return false;
- insn = NEXT_INSN (insn);
+ if (GET_CODE (insn) == INSN
+ && GET_CODE (PATTERN (insn)) == SEQUENCE)
+ insn = XVECEXP (PATTERN (insn), 0, 0);
- /* Look for the matching end. */
- while (! (GET_CODE (insn) == NOTE
- && NOTE_LINE_NUMBER (insn) == NOTE_INSN_EH_REGION_END))
+ if (GET_CODE (insn) == CALL_INSN
+ && GET_CODE (PATTERN (insn)) == CALL_PLACEHOLDER)
{
- /* If anything can throw, we can't remove the region. */
- if (delete && can_throw (insn))
+ int i;
+ for (i = 0; i < 3; ++i)
{
- delete = 0;
+ rtx sub = XEXP (PATTERN (insn), i);
+ for (; sub ; sub = NEXT_INSN (sub))
+ if (can_throw_external (sub))
+ return true;
}
-
- /* Watch out for and handle nested regions. */
- if (GET_CODE (insn) == NOTE
- && NOTE_LINE_NUMBER (insn) == NOTE_INSN_EH_REGION_BEG)
- {
- insn = scan_region (insn, NOTE_EH_HANDLER (insn), &delete);
- }
-
- insn = NEXT_INSN (insn);
+ return false;
}
- /* The _BEG/_END NOTEs must match and nest. */
- if (NOTE_EH_HANDLER (insn) != n)
- abort ();
-
- /* If anything in this exception region can throw, we can throw. */
- if (! delete)
- *delete_outer = 0;
- else
+ note = find_reg_note (insn, REG_EH_REGION, NULL_RTX);
+ if (!note)
{
- /* Delete the start and end of the region. */
- delete_insn (start);
- delete_insn (insn);
-
-/* We no longer removed labels here, since flow will now remove any
- handler which cannot be called any more. */
-
-#if 0
- /* Only do this part if we have built the exception handler
- labels. */
- if (exception_handler_labels)
- {
- rtx x, *prev = &exception_handler_labels;
-
- /* Find it in the list of handlers. */
- for (x = exception_handler_labels; x; x = XEXP (x, 1))
- {
- rtx label = XEXP (x, 0);
- if (CODE_LABEL_NUMBER (label) == n)
- {
- /* If we are the last reference to the handler,
- delete it. */
- if (--LABEL_NUSES (label) == 0)
- delete_insn (label);
-
- if (optimize)
- {
- /* Remove it from the list of exception handler
- labels, if we are optimizing. If we are not, then
- leave it in the list, as we are not really going to
- remove the region. */
- *prev = XEXP (x, 1);
- XEXP (x, 1) = 0;
- XEXP (x, 0) = 0;
- }
-
- break;
- }
- prev = &XEXP (x, 1);
- }
- }
-#endif
+ /* Calls (and trapping insns) without notes are outside any
+ exception handling region in this function. We have to
+ assume it might throw. Given that the front end and middle
+ ends mark known NOTHROW functions, this isn't so wildly
+ inaccurate. */
+ return (GET_CODE (insn) == CALL_INSN
+ || (flag_non_call_exceptions
+ && may_trap_p (PATTERN (insn))));
}
- return insn;
-}
-
-/* Perform various interesting optimizations for exception handling
- code.
+ if (INTVAL (XEXP (note, 0)) <= 0)
+ return false;
- We look for empty exception regions and make them go (away). The
- jump optimization code will remove the handler if nothing else uses
- it. */
+ region = cfun->eh->region_array[INTVAL (XEXP (note, 0))];
-void
-exception_optimize ()
-{
- rtx insn;
- int n;
-
- /* Remove empty regions. */
- for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
+ type_thrown = NULL_TREE;
+ if (region->type == ERT_THROW)
{
- if (GET_CODE (insn) == NOTE
- && NOTE_LINE_NUMBER (insn) == NOTE_INSN_EH_REGION_BEG)
- {
- /* Since scan_region will return the NOTE_INSN_EH_REGION_END
- insn, we will indirectly skip through all the insns
- inbetween. We are also guaranteed that the value of insn
- returned will be valid, as otherwise scan_region won't
- return. */
- insn = scan_region (insn, NOTE_EH_HANDLER (insn), &n);
- }
+ type_thrown = region->u.throw.type;
+ region = region->outer;
}
+
+ /* If the exception is caught or blocked by any containing region,
+ then it is not seen by any calling function. */
+ for (; region ; region = region->outer)
+ if (reachable_next_level (region, type_thrown, NULL) >= RNL_CAUGHT)
+ return false;
+
+ return true;
}
-/* This function determines whether the rethrow labels for any of the
- exception regions in the current function are used or not, and set
- the reference flag according. */
+/* True if nothing in this function can throw outside this function. */
-void
-update_rethrow_references ()
+bool
+nothrow_function_p ()
{
rtx insn;
- int x, region;
- int *saw_region, *saw_rethrow;
- if (!flag_new_exceptions)
- return;
-
- saw_region = (int *) xcalloc (current_func_eh_entry, sizeof (int));
- saw_rethrow = (int *) xcalloc (current_func_eh_entry, sizeof (int));
+ if (! flag_exceptions)
+ return true;
- /* Determine what regions exist, and whether there are any rethrows
- from those regions or not. */
for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
- if (GET_CODE (insn) == CALL_INSN)
- {
- rtx note = find_reg_note (insn, REG_EH_RETHROW, NULL_RTX);
- if (note)
- {
- region = eh_region_from_symbol (XEXP (note, 0));
- region = find_func_region (region);
- saw_rethrow[region] = 1;
- }
- }
- else
- if (GET_CODE (insn) == NOTE)
- {
- if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_EH_REGION_BEG)
- {
- region = find_func_region (NOTE_EH_HANDLER (insn));
- saw_region[region] = 1;
- }
- }
-
- /* For any regions we did see, set the referenced flag. */
- for (x = 0; x < current_func_eh_entry; x++)
- if (saw_region[x])
- function_eh_regions[x].rethrow_ref = saw_rethrow[x];
+ if (can_throw_external (insn))
+ return false;
+ for (insn = current_function_epilogue_delay_list; insn;
+ insn = XEXP (insn, 1))
+ if (can_throw_external (insn))
+ return false;
- /* Clean up. */
- free (saw_region);
- free (saw_rethrow);
+ return true;
}
+
-/* Various hooks for the DWARF 2 __throw routine. */
+/* Various hooks for unwind library. */
/* Do any necessary initialization to access arbitrary stack frames.
On the SPARC, this means flushing the register windows. */
@@ -2950,6 +2889,33 @@ expand_builtin_unwind_init ()
#endif
}
+rtx
+expand_builtin_eh_return_data_regno (arglist)
+ tree arglist;
+{
+ tree which = TREE_VALUE (arglist);
+ unsigned HOST_WIDE_INT iwhich;
+
+ if (TREE_CODE (which) != INTEGER_CST)
+ {
+ error ("argument of `__builtin_eh_return_regno' must be constant");
+ return constm1_rtx;
+ }
+
+ iwhich = tree_low_cst (which, 1);
+ iwhich = EH_RETURN_DATA_REGNO (iwhich);
+ if (iwhich == INVALID_REGNUM)
+ return constm1_rtx;
+
+#ifdef DWARF_FRAME_REGNUM
+ iwhich = DWARF_FRAME_REGNUM (iwhich);
+#else
+ iwhich = DBX_REGISTER_NUMBER (iwhich);
+#endif
+
+ return GEN_INT (iwhich);
+}
+
/* Given a value extracted from the return address register or stack slot,
return the actual address encoded in that value. */
@@ -2958,7 +2924,18 @@ expand_builtin_extract_return_addr (addr_tree)
tree addr_tree;
{
rtx addr = expand_expr (addr_tree, NULL_RTX, Pmode, 0);
- return eh_outer_context (addr);
+
+ /* First mask out any unwanted bits. */
+#ifdef MASK_RETURN_ADDR
+ expand_and (addr, MASK_RETURN_ADDR, addr);
+#endif
+
+ /* Then adjust to find the real return address. */
+#if defined (RETURN_ADDR_OFFSET)
+ addr = plus_constant (addr, RETURN_ADDR_OFFSET);
+#endif
+
+ return addr;
}
/* Given an actual address in addr_tree, do any necessary encoding
@@ -2970,540 +2947,737 @@ expand_builtin_frob_return_addr (addr_tree)
tree addr_tree;
{
rtx addr = expand_expr (addr_tree, NULL_RTX, Pmode, 0);
+
#ifdef RETURN_ADDR_OFFSET
+ addr = force_reg (Pmode, addr);
addr = plus_constant (addr, -RETURN_ADDR_OFFSET);
#endif
+
return addr;
}
-/* Choose three registers for communication between the main body of
- __throw and the epilogue (or eh stub) and the exception handler.
- We must do this with hard registers because the epilogue itself
- will be generated after reload, at which point we may not reference
- pseudos at all.
-
- The first passes the exception context to the handler. For this
- we use the return value register for a void*.
-
- The second holds the stack pointer value to be restored. For this
- we use the static chain register if it exists, is different from
- the previous, and is call-clobbered; otherwise some arbitrary
- call-clobbered register.
-
- The third holds the address of the handler itself. Here we use
- some arbitrary call-clobbered register. */
+/* Set up the epilogue with the magic bits we'll need to return to the
+ exception handler. */
-static void
-eh_regs (pcontext, psp, pra, outgoing)
- rtx *pcontext, *psp, *pra;
- int outgoing ATTRIBUTE_UNUSED;
+void
+expand_builtin_eh_return (stackadj_tree, handler_tree)
+ tree stackadj_tree, handler_tree;
{
- rtx rcontext, rsp, rra;
- unsigned int i;
+ rtx stackadj, handler;
-#ifdef FUNCTION_OUTGOING_VALUE
- if (outgoing)
- rcontext = FUNCTION_OUTGOING_VALUE (build_pointer_type (void_type_node),
- current_function_decl);
- else
-#endif
- rcontext = FUNCTION_VALUE (build_pointer_type (void_type_node),
- current_function_decl);
+ stackadj = expand_expr (stackadj_tree, cfun->eh->ehr_stackadj, VOIDmode, 0);
+ handler = expand_expr (handler_tree, cfun->eh->ehr_handler, VOIDmode, 0);
-#ifdef STATIC_CHAIN_REGNUM
- if (outgoing)
- rsp = static_chain_incoming_rtx;
+ if (! cfun->eh->ehr_label)
+ {
+ cfun->eh->ehr_stackadj = copy_to_reg (stackadj);
+ cfun->eh->ehr_handler = copy_to_reg (handler);
+ cfun->eh->ehr_label = gen_label_rtx ();
+ }
else
- rsp = static_chain_rtx;
- if (REGNO (rsp) == REGNO (rcontext)
- || ! call_used_regs [REGNO (rsp)])
-#endif /* STATIC_CHAIN_REGNUM */
- rsp = NULL_RTX;
-
- if (rsp == NULL_RTX)
{
- for (i = 0; i < FIRST_PSEUDO_REGISTER; ++i)
- if (call_used_regs[i] && ! fixed_regs[i] && i != REGNO (rcontext))
- break;
- if (i == FIRST_PSEUDO_REGISTER)
- abort();
-
- rsp = gen_rtx_REG (Pmode, i);
+ if (stackadj != cfun->eh->ehr_stackadj)
+ emit_move_insn (cfun->eh->ehr_stackadj, stackadj);
+ if (handler != cfun->eh->ehr_handler)
+ emit_move_insn (cfun->eh->ehr_handler, handler);
}
- for (i = 0; i < FIRST_PSEUDO_REGISTER; ++i)
- if (call_used_regs[i] && ! fixed_regs[i]
- && i != REGNO (rcontext) && i != REGNO (rsp))
- break;
- if (i == FIRST_PSEUDO_REGISTER)
- abort();
-
- rra = gen_rtx_REG (Pmode, i);
-
- *pcontext = rcontext;
- *psp = rsp;
- *pra = rra;
-}
-
-/* Retrieve the register which contains the pointer to the eh_context
- structure set the __throw. */
-
-#if 0
-rtx
-get_reg_for_handler ()
-{
- rtx reg1;
- reg1 = FUNCTION_VALUE (build_pointer_type (void_type_node),
- current_function_decl);
- return reg1;
-}
-#endif
-
-/* Set up the epilogue with the magic bits we'll need to return to the
- exception handler. */
-
-void
-expand_builtin_eh_return (context, stack, handler)
- tree context, stack, handler;
-{
- if (eh_return_context)
- error("Duplicate call to __builtin_eh_return");
-
- eh_return_context
- = copy_to_reg (expand_expr (context, NULL_RTX, VOIDmode, 0));
- eh_return_stack_adjust
- = copy_to_reg (expand_expr (stack, NULL_RTX, VOIDmode, 0));
- eh_return_handler
- = copy_to_reg (expand_expr (handler, NULL_RTX, VOIDmode, 0));
+ emit_jump (cfun->eh->ehr_label);
}
void
expand_eh_return ()
{
- rtx reg1, reg2, reg3;
- rtx stub_start, after_stub;
- rtx ra, tmp;
+ rtx sa, ra, around_label;
- if (!eh_return_context)
+ if (! cfun->eh->ehr_label)
return;
- current_function_cannot_inline = N_("function uses __builtin_eh_return");
-
- eh_regs (&reg1, &reg2, &reg3, 1);
-#ifdef POINTERS_EXTEND_UNSIGNED
- eh_return_context = convert_memory_address (Pmode, eh_return_context);
- eh_return_stack_adjust =
- convert_memory_address (Pmode, eh_return_stack_adjust);
- eh_return_handler = convert_memory_address (Pmode, eh_return_handler);
-#endif
- emit_move_insn (reg1, eh_return_context);
- emit_move_insn (reg2, eh_return_stack_adjust);
- emit_move_insn (reg3, eh_return_handler);
-
- /* Talk directly to the target's epilogue code when possible. */
-
-#ifdef HAVE_eh_epilogue
- if (HAVE_eh_epilogue)
+ sa = EH_RETURN_STACKADJ_RTX;
+ if (! sa)
{
- emit_insn (gen_eh_epilogue (reg1, reg2, reg3));
+ error ("__builtin_eh_return not supported on this target");
return;
}
-#endif
-
- /* Otherwise, use the same stub technique we had before. */
- eh_return_stub_label = stub_start = gen_label_rtx ();
- after_stub = gen_label_rtx ();
+ current_function_calls_eh_return = 1;
- /* Set the return address to the stub label. */
+ around_label = gen_label_rtx ();
+ emit_move_insn (sa, const0_rtx);
+ emit_jump (around_label);
- ra = expand_builtin_return_addr (BUILT_IN_RETURN_ADDRESS,
- 0, hard_frame_pointer_rtx);
- if (GET_CODE (ra) == REG && REGNO (ra) >= FIRST_PSEUDO_REGISTER)
- abort();
+ emit_label (cfun->eh->ehr_label);
+ clobber_return_register ();
- tmp = memory_address (Pmode, gen_rtx_LABEL_REF (Pmode, stub_start));
-#ifdef RETURN_ADDR_OFFSET
- tmp = plus_constant (tmp, -RETURN_ADDR_OFFSET);
+#ifdef HAVE_eh_return
+ if (HAVE_eh_return)
+ emit_insn (gen_eh_return (cfun->eh->ehr_stackadj, cfun->eh->ehr_handler));
+ else
#endif
- tmp = force_operand (tmp, ra);
- if (tmp != ra)
- emit_move_insn (ra, tmp);
-
- /* Indicate that the registers are in fact used. */
- emit_insn (gen_rtx_USE (VOIDmode, reg1));
- emit_insn (gen_rtx_USE (VOIDmode, reg2));
- emit_insn (gen_rtx_USE (VOIDmode, reg3));
- if (GET_CODE (ra) == REG)
- emit_insn (gen_rtx_USE (VOIDmode, ra));
+ {
+ rtx handler;
- /* Generate the stub. */
+ ra = EH_RETURN_HANDLER_RTX;
+ if (! ra)
+ {
+ error ("__builtin_eh_return not supported on this target");
+ ra = gen_reg_rtx (Pmode);
+ }
- emit_jump (after_stub);
- emit_label (stub_start);
+ emit_move_insn (sa, cfun->eh->ehr_stackadj);
- eh_regs (&reg1, &reg2, &reg3, 0);
- adjust_stack (reg2);
- emit_indirect_jump (reg3);
+ handler = cfun->eh->ehr_handler;
+ if (GET_MODE (ra) != Pmode)
+ {
+#ifdef POINTERS_EXTEND_UNSIGNED
+ handler = convert_memory_address (GET_MODE (ra), handler);
+#else
+ handler = convert_to_mode (GET_MODE (ra), handler, 0);
+#endif
+ }
+ emit_move_insn (ra, handler);
+ }
- emit_label (after_stub);
+ emit_label (around_label);
}
+/* In the following functions, we represent entries in the action table
+ as 1-based indicies. Special cases are:
-/* This contains the code required to verify whether arbitrary instructions
- are in the same exception region. */
+ 0: null action record, non-null landing pad; implies cleanups
+ -1: null action record, null landing pad; implies no action
+ -2: no call-site entry; implies must_not_throw
+ -3: we have yet to process outer regions
-static int *insn_eh_region = (int *)0;
-static int maximum_uid;
+ Further, no special cases apply to the "next" field of the record.
+ For next, 0 means end of list. */
-static void
-set_insn_eh_region (first, region_num)
- rtx *first;
- int region_num;
+struct action_record
{
- rtx insn;
- int rnum;
+ int offset;
+ int filter;
+ int next;
+};
- for (insn = *first; insn; insn = NEXT_INSN (insn))
- {
- if ((GET_CODE (insn) == NOTE)
- && (NOTE_LINE_NUMBER (insn) == NOTE_INSN_EH_REGION_BEG))
- {
- rnum = NOTE_EH_HANDLER (insn);
- insn_eh_region[INSN_UID (insn)] = rnum;
- insn = NEXT_INSN (insn);
- set_insn_eh_region (&insn, rnum);
- /* Upon return, insn points to the EH_REGION_END of nested region */
- continue;
- }
- insn_eh_region[INSN_UID (insn)] = region_num;
- if ((GET_CODE (insn) == NOTE) &&
- (NOTE_LINE_NUMBER (insn) == NOTE_INSN_EH_REGION_END))
- break;
- }
- *first = insn;
+static int
+action_record_eq (pentry, pdata)
+ const PTR pentry;
+ const PTR pdata;
+{
+ const struct action_record *entry = (const struct action_record *) pentry;
+ const struct action_record *data = (const struct action_record *) pdata;
+ return entry->filter == data->filter && entry->next == data->next;
}
-/* Free the insn table, an make sure it cannot be used again. */
+static hashval_t
+action_record_hash (pentry)
+ const PTR pentry;
+{
+ const struct action_record *entry = (const struct action_record *) pentry;
+ return entry->next * 1009 + entry->filter;
+}
-void
-free_insn_eh_region ()
+static int
+add_action_record (ar_hash, filter, next)
+ htab_t ar_hash;
+ int filter, next;
{
- if (!doing_eh (0))
- return;
+ struct action_record **slot, *new, tmp;
+
+ tmp.filter = filter;
+ tmp.next = next;
+ slot = (struct action_record **) htab_find_slot (ar_hash, &tmp, INSERT);
- if (insn_eh_region)
+ if ((new = *slot) == NULL)
{
- free (insn_eh_region);
- insn_eh_region = (int *)0;
+ new = (struct action_record *) xmalloc (sizeof (*new));
+ new->offset = VARRAY_ACTIVE_SIZE (cfun->eh->action_record_data) + 1;
+ new->filter = filter;
+ new->next = next;
+ *slot = new;
+
+ /* The filter value goes in untouched. The link to the next
+ record is a "self-relative" byte offset, or zero to indicate
+ that there is no next record. So convert the absolute 1 based
+ indicies we've been carrying around into a displacement. */
+
+ push_sleb128 (&cfun->eh->action_record_data, filter);
+ if (next)
+ next -= VARRAY_ACTIVE_SIZE (cfun->eh->action_record_data) + 1;
+ push_sleb128 (&cfun->eh->action_record_data, next);
}
+
+ return new->offset;
}
-/* Initialize the table. max_uid must be calculated and handed into
- this routine. If it is unavailable, passing a value of 0 will
- cause this routine to calculate it as well. */
+static int
+collect_one_action_chain (ar_hash, region)
+ htab_t ar_hash;
+ struct eh_region *region;
+{
+ struct eh_region *c;
+ int next;
+
+ /* If we've reached the top of the region chain, then we have
+ no actions, and require no landing pad. */
+ if (region == NULL)
+ return -1;
+
+ switch (region->type)
+ {
+ case ERT_CLEANUP:
+ /* A cleanup adds a zero filter to the beginning of the chain, but
+ there are special cases to look out for. If there are *only*
+ cleanups along a path, then it compresses to a zero action.
+ Further, if there are multiple cleanups along a path, we only
+ need to represent one of them, as that is enough to trigger
+ entry to the landing pad at runtime. */
+ next = collect_one_action_chain (ar_hash, region->outer);
+ if (next <= 0)
+ return 0;
+ for (c = region->outer; c ; c = c->outer)
+ if (c->type == ERT_CLEANUP)
+ return next;
+ return add_action_record (ar_hash, 0, next);
+
+ case ERT_TRY:
+ /* Process the associated catch regions in reverse order.
+ If there's a catch-all handler, then we don't need to
+ search outer regions. Use a magic -3 value to record
+ that we havn't done the outer search. */
+ next = -3;
+ for (c = region->u.try.last_catch; c ; c = c->u.catch.prev_catch)
+ {
+ if (c->u.catch.type == NULL)
+ next = add_action_record (ar_hash, c->u.catch.filter, 0);
+ else
+ {
+ if (next == -3)
+ {
+ next = collect_one_action_chain (ar_hash, region->outer);
+
+ /* If there is no next action, terminate the chain. */
+ if (next == -1)
+ next = 0;
+ /* If all outer actions are cleanups or must_not_throw,
+ we'll have no action record for it, since we had wanted
+ to encode these states in the call-site record directly.
+ Add a cleanup action to the chain to catch these. */
+ else if (next <= 0)
+ next = add_action_record (ar_hash, 0, 0);
+ }
+ next = add_action_record (ar_hash, c->u.catch.filter, next);
+ }
+ }
+ return next;
+
+ case ERT_ALLOWED_EXCEPTIONS:
+ /* An exception specification adds its filter to the
+ beginning of the chain. */
+ next = collect_one_action_chain (ar_hash, region->outer);
+ return add_action_record (ar_hash, region->u.allowed.filter,
+ next < 0 ? 0 : next);
+
+ case ERT_MUST_NOT_THROW:
+ /* A must-not-throw region with no inner handlers or cleanups
+ requires no call-site entry. Note that this differs from
+ the no handler or cleanup case in that we do require an lsda
+ to be generated. Return a magic -2 value to record this. */
+ return -2;
+
+ case ERT_CATCH:
+ case ERT_THROW:
+ /* CATCH regions are handled in TRY above. THROW regions are
+ for optimization information only and produce no output. */
+ return collect_one_action_chain (ar_hash, region->outer);
+
+ default:
+ abort ();
+ }
+}
-void
-init_insn_eh_region (first, max_uid)
- rtx first;
- int max_uid;
+static int
+add_call_site (landing_pad, action)
+ rtx landing_pad;
+ int action;
{
- rtx insn;
+ struct call_site_record *data = cfun->eh->call_site_data;
+ int used = cfun->eh->call_site_data_used;
+ int size = cfun->eh->call_site_data_size;
- if (!doing_eh (0))
- return;
+ if (used >= size)
+ {
+ size = (size ? size * 2 : 64);
+ data = (struct call_site_record *)
+ xrealloc (data, sizeof (*data) * size);
+ cfun->eh->call_site_data = data;
+ cfun->eh->call_site_data_size = size;
+ }
- if (insn_eh_region)
- free_insn_eh_region();
+ data[used].landing_pad = landing_pad;
+ data[used].action = action;
- if (max_uid == 0)
- for (insn = first; insn; insn = NEXT_INSN (insn))
- if (INSN_UID (insn) > max_uid) /* find largest UID */
- max_uid = INSN_UID (insn);
+ cfun->eh->call_site_data_used = used + 1;
- maximum_uid = max_uid;
- insn_eh_region = (int *) xmalloc ((max_uid + 1) * sizeof (int));
- insn = first;
- set_insn_eh_region (&insn, 0);
+ return used + call_site_base;
}
+/* Turn REG_EH_REGION notes back into NOTE_INSN_EH_REGION notes.
+ The new note numbers will not refer to region numbers, but
+ instead to call site entries. */
-/* Check whether 2 instructions are within the same region. */
-
-int
-in_same_eh_region (insn1, insn2)
- rtx insn1, insn2;
+void
+convert_to_eh_region_ranges ()
{
- int ret, uid1, uid2;
+ rtx insn, iter, note;
+ htab_t ar_hash;
+ int last_action = -3;
+ rtx last_action_insn = NULL_RTX;
+ rtx last_landing_pad = NULL_RTX;
+ rtx first_no_action_insn = NULL_RTX;
+ int call_site;
- /* If no exceptions, instructions are always in same region. */
- if (!doing_eh (0))
- return 1;
+ if (USING_SJLJ_EXCEPTIONS || cfun->eh->region_tree == NULL)
+ return;
- /* If the table isn't allocated, assume the worst. */
- if (!insn_eh_region)
- return 0;
+ VARRAY_UCHAR_INIT (cfun->eh->action_record_data, 64, "action_record_data");
- uid1 = INSN_UID (insn1);
- uid2 = INSN_UID (insn2);
+ ar_hash = htab_create (31, action_record_hash, action_record_eq, free);
- /* if instructions have been allocated beyond the end, either
- the table is out of date, or this is a late addition, or
- something... Assume the worst. */
- if (uid1 > maximum_uid || uid2 > maximum_uid)
- return 0;
+ for (iter = get_insns (); iter ; iter = NEXT_INSN (iter))
+ if (INSN_P (iter))
+ {
+ struct eh_region *region;
+ int this_action;
+ rtx this_landing_pad;
- ret = (insn_eh_region[uid1] == insn_eh_region[uid2]);
- return ret;
-}
-
+ insn = iter;
+ if (GET_CODE (insn) == INSN
+ && GET_CODE (PATTERN (insn)) == SEQUENCE)
+ insn = XVECEXP (PATTERN (insn), 0, 0);
-/* This function will initialize the handler list for a specified block.
- It may recursively call itself if the outer block hasn't been processed
- yet. At some point in the future we can trim out handlers which we
- know cannot be called. (ie, if a block has an INT type handler,
- control will never be passed to an outer INT type handler). */
-
-static void
-process_nestinfo (block, info, nested_eh_region)
- int block;
- eh_nesting_info *info;
- int *nested_eh_region;
-{
- handler_info *ptr, *last_ptr = NULL;
- int x, y, count = 0;
- int extra = 0;
- handler_info **extra_handlers = 0;
- int index = info->region_index[block];
-
- /* If we've already processed this block, simply return. */
- if (info->num_handlers[index] > 0)
- return;
+ note = find_reg_note (insn, REG_EH_REGION, NULL_RTX);
+ if (!note)
+ {
+ if (! (GET_CODE (insn) == CALL_INSN
+ || (flag_non_call_exceptions
+ && may_trap_p (PATTERN (insn)))))
+ continue;
+ this_action = -1;
+ region = NULL;
+ }
+ else
+ {
+ if (INTVAL (XEXP (note, 0)) <= 0)
+ continue;
+ region = cfun->eh->region_array[INTVAL (XEXP (note, 0))];
+ this_action = collect_one_action_chain (ar_hash, region);
+ }
+
+ /* Existence of catch handlers, or must-not-throw regions
+ implies that an lsda is needed (even if empty). */
+ if (this_action != -1)
+ cfun->uses_eh_lsda = 1;
- for (ptr = get_first_handler (block); ptr; last_ptr = ptr, ptr = ptr->next)
- count++;
+ /* Delay creation of region notes for no-action regions
+ until we're sure that an lsda will be required. */
+ else if (last_action == -3)
+ {
+ first_no_action_insn = iter;
+ last_action = -1;
+ }
- /* pick up any information from the next outer region. It will already
- contain a summary of itself and all outer regions to it. */
+ /* Cleanups and handlers may share action chains but not
+ landing pads. Collect the landing pad for this region. */
+ if (this_action >= 0)
+ {
+ struct eh_region *o;
+ for (o = region; ! o->landing_pad ; o = o->outer)
+ continue;
+ this_landing_pad = o->landing_pad;
+ }
+ else
+ this_landing_pad = NULL_RTX;
- if (nested_eh_region [block] != 0)
+ /* Differing actions or landing pads implies a change in call-site
+ info, which implies some EH_REGION note should be emitted. */
+ if (last_action != this_action
+ || last_landing_pad != this_landing_pad)
+ {
+ /* If we'd not seen a previous action (-3) or the previous
+ action was must-not-throw (-2), then we do not need an
+ end note. */
+ if (last_action >= -1)
+ {
+ /* If we delayed the creation of the begin, do it now. */
+ if (first_no_action_insn)
+ {
+ call_site = add_call_site (NULL_RTX, 0);
+ note = emit_note_before (NOTE_INSN_EH_REGION_BEG,
+ first_no_action_insn);
+ NOTE_EH_HANDLER (note) = call_site;
+ first_no_action_insn = NULL_RTX;
+ }
+
+ note = emit_note_after (NOTE_INSN_EH_REGION_END,
+ last_action_insn);
+ NOTE_EH_HANDLER (note) = call_site;
+ }
+
+ /* If the new action is must-not-throw, then no region notes
+ are created. */
+ if (this_action >= -1)
+ {
+ call_site = add_call_site (this_landing_pad,
+ this_action < 0 ? 0 : this_action);
+ note = emit_note_before (NOTE_INSN_EH_REGION_BEG, iter);
+ NOTE_EH_HANDLER (note) = call_site;
+ }
+
+ last_action = this_action;
+ last_landing_pad = this_landing_pad;
+ }
+ last_action_insn = iter;
+ }
+
+ if (last_action >= -1 && ! first_no_action_insn)
{
- int nested_index = info->region_index[nested_eh_region[block]];
- process_nestinfo (nested_eh_region[block], info, nested_eh_region);
- extra = info->num_handlers[nested_index];
- extra_handlers = info->handlers[nested_index];
- info->outer_index[index] = nested_index;
+ note = emit_note_after (NOTE_INSN_EH_REGION_END, last_action_insn);
+ NOTE_EH_HANDLER (note) = call_site;
}
- /* If the last handler is either a CATCH_ALL or a cleanup, then we
- won't use the outer ones since we know control will not go past the
- catch-all or cleanup. */
+ htab_delete (ar_hash);
+}
- if (last_ptr != NULL && (last_ptr->type_info == NULL
- || last_ptr->type_info == CATCH_ALL_TYPE))
- extra = 0;
+
+static void
+push_uleb128 (data_area, value)
+ varray_type *data_area;
+ unsigned int value;
+{
+ do
+ {
+ unsigned char byte = value & 0x7f;
+ value >>= 7;
+ if (value)
+ byte |= 0x80;
+ VARRAY_PUSH_UCHAR (*data_area, byte);
+ }
+ while (value);
+}
- info->num_handlers[index] = count + extra;
- info->handlers[index] = (handler_info **) xmalloc ((count + extra)
- * sizeof (handler_info **));
+static void
+push_sleb128 (data_area, value)
+ varray_type *data_area;
+ int value;
+{
+ unsigned char byte;
+ int more;
- /* First put all our handlers into the list. */
- ptr = get_first_handler (block);
- for (x = 0; x < count; x++)
+ do
{
- info->handlers[index][x] = ptr;
- ptr = ptr->next;
+ byte = value & 0x7f;
+ value >>= 7;
+ more = ! ((value == 0 && (byte & 0x40) == 0)
+ || (value == -1 && (byte & 0x40) != 0));
+ if (more)
+ byte |= 0x80;
+ VARRAY_PUSH_UCHAR (*data_area, byte);
}
+ while (more);
+}
+
+
+#ifndef HAVE_AS_LEB128
+static int
+dw2_size_of_call_site_table ()
+{
+ int n = cfun->eh->call_site_data_used;
+ int size = n * (4 + 4 + 4);
+ int i;
- /* Now add all the outer region handlers, if they aren't they same as
- one of the types in the current block. We won't worry about
- derived types yet, we'll just look for the exact type. */
- for (y =0, x = 0; x < extra ; x++)
+ for (i = 0; i < n; ++i)
{
- int i, ok;
- ok = 1;
- /* Check to see if we have a type duplication. */
- for (i = 0; i < count; i++)
- if (info->handlers[index][i]->type_info == extra_handlers[x]->type_info)
- {
- ok = 0;
- /* Record one less handler. */
- (info->num_handlers[index])--;
- break;
- }
- if (ok)
- {
- info->handlers[index][y + count] = extra_handlers[x];
- y++;
- }
+ struct call_site_record *cs = &cfun->eh->call_site_data[i];
+ size += size_of_uleb128 (cs->action);
}
-}
-/* This function will allocate and initialize an eh_nesting_info structure.
- It returns a pointer to the completed data structure. If there are
- no exception regions, a NULL value is returned. */
+ return size;
+}
-eh_nesting_info *
-init_eh_nesting_info ()
+static int
+sjlj_size_of_call_site_table ()
{
- int *nested_eh_region;
- int region_count = 0;
- rtx eh_note = NULL_RTX;
- eh_nesting_info *info;
- rtx insn;
- int x;
+ int n = cfun->eh->call_site_data_used;
+ int size = 0;
+ int i;
- if (! flag_exceptions)
- return 0;
+ for (i = 0; i < n; ++i)
+ {
+ struct call_site_record *cs = &cfun->eh->call_site_data[i];
+ size += size_of_uleb128 (INTVAL (cs->landing_pad));
+ size += size_of_uleb128 (cs->action);
+ }
- info = (eh_nesting_info *) xmalloc (sizeof (eh_nesting_info));
- info->region_index = (int *) xcalloc ((max_label_num () + 1), sizeof (int));
- nested_eh_region = (int *) xcalloc (max_label_num () + 1, sizeof (int));
+ return size;
+}
+#endif
+
+static void
+dw2_output_call_site_table ()
+{
+ const char *function_start_lab
+ = IDENTIFIER_POINTER (current_function_func_begin_label);
+ int n = cfun->eh->call_site_data_used;
+ int i;
- /* Create the nested_eh_region list. If indexed with a block number, it
- returns the block number of the next outermost region, if any.
- We can count the number of regions and initialize the region_index
- vector at the same time. */
- for (insn = get_insns(); insn; insn = NEXT_INSN (insn))
+ for (i = 0; i < n; ++i)
{
- if (GET_CODE (insn) == NOTE)
- {
- if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_EH_REGION_BEG)
- {
- int block = NOTE_EH_HANDLER (insn);
- region_count++;
- info->region_index[block] = region_count;
- if (eh_note)
- nested_eh_region [block] =
- NOTE_EH_HANDLER (XEXP (eh_note, 0));
- else
- nested_eh_region [block] = 0;
- eh_note = gen_rtx_EXPR_LIST (VOIDmode, insn, eh_note);
- }
- else if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_EH_REGION_END)
- eh_note = XEXP (eh_note, 1);
- }
+ struct call_site_record *cs = &cfun->eh->call_site_data[i];
+ char reg_start_lab[32];
+ char reg_end_lab[32];
+ char landing_pad_lab[32];
+
+ ASM_GENERATE_INTERNAL_LABEL (reg_start_lab, "LEHB", call_site_base + i);
+ ASM_GENERATE_INTERNAL_LABEL (reg_end_lab, "LEHE", call_site_base + i);
+
+ if (cs->landing_pad)
+ ASM_GENERATE_INTERNAL_LABEL (landing_pad_lab, "L",
+ CODE_LABEL_NUMBER (cs->landing_pad));
+
+ /* ??? Perhaps use insn length scaling if the assembler supports
+ generic arithmetic. */
+ /* ??? Perhaps use attr_length to choose data1 or data2 instead of
+ data4 if the function is small enough. */
+#ifdef HAVE_AS_LEB128
+ dw2_asm_output_delta_uleb128 (reg_start_lab, function_start_lab,
+ "region %d start", i);
+ dw2_asm_output_delta_uleb128 (reg_end_lab, reg_start_lab,
+ "length");
+ if (cs->landing_pad)
+ dw2_asm_output_delta_uleb128 (landing_pad_lab, function_start_lab,
+ "landing pad");
+ else
+ dw2_asm_output_data_uleb128 (0, "landing pad");
+#else
+ dw2_asm_output_delta (4, reg_start_lab, function_start_lab,
+ "region %d start", i);
+ dw2_asm_output_delta (4, reg_end_lab, reg_start_lab, "length");
+ if (cs->landing_pad)
+ dw2_asm_output_delta (4, landing_pad_lab, function_start_lab,
+ "landing pad");
+ else
+ dw2_asm_output_data (4, 0, "landing pad");
+#endif
+ dw2_asm_output_data_uleb128 (cs->action, "action");
}
-
- /* If there are no regions, wrap it up now. */
- if (region_count == 0)
+
+ call_site_base += n;
+}
+
+static void
+sjlj_output_call_site_table ()
+{
+ int n = cfun->eh->call_site_data_used;
+ int i;
+
+ for (i = 0; i < n; ++i)
{
- free (info->region_index);
- free (info);
- free (nested_eh_region);
- return NULL;
+ struct call_site_record *cs = &cfun->eh->call_site_data[i];
+
+ dw2_asm_output_data_uleb128 (INTVAL (cs->landing_pad),
+ "region %d landing pad", i);
+ dw2_asm_output_data_uleb128 (cs->action, "action");
}
- region_count++;
- info->handlers = (handler_info ***) xcalloc (region_count,
- sizeof (handler_info ***));
- info->num_handlers = (int *) xcalloc (region_count, sizeof (int));
- info->outer_index = (int *) xcalloc (region_count, sizeof (int));
+ call_site_base += n;
+}
+
+void
+output_function_exception_table ()
+{
+ int tt_format, cs_format, lp_format, i, n;
+#ifdef HAVE_AS_LEB128
+ char ttype_label[32];
+ char cs_after_size_label[32];
+ char cs_end_label[32];
+#else
+ int call_site_len;
+#endif
+ int have_tt_data;
+ int funcdef_number;
+ int tt_format_size;
- /* Now initialize the handler lists for all exception blocks. */
- for (x = 0; x <= max_label_num (); x++)
+ /* Not all functions need anything. */
+ if (! cfun->uses_eh_lsda)
+ return;
+
+ funcdef_number = (USING_SJLJ_EXCEPTIONS
+ ? sjlj_funcdef_number
+ : current_funcdef_number);
+
+#ifdef IA64_UNWIND_INFO
+ fputs ("\t.personality\t", asm_out_file);
+ output_addr_const (asm_out_file, eh_personality_libfunc);
+ fputs ("\n\t.handlerdata\n", asm_out_file);
+ /* Note that varasm still thinks we're in the function's code section.
+ The ".endp" directive that will immediately follow will take us back. */
+#else
+ exception_section ();
+#endif
+
+ have_tt_data = (VARRAY_ACTIVE_SIZE (cfun->eh->ttype_data) > 0
+ || VARRAY_ACTIVE_SIZE (cfun->eh->ehspec_data) > 0);
+
+ /* Indicate the format of the @TType entries. */
+ if (! have_tt_data)
+ tt_format = DW_EH_PE_omit;
+ else
{
- if (info->region_index[x] != 0)
- process_nestinfo (x, info, nested_eh_region);
+ tt_format = ASM_PREFERRED_EH_DATA_FORMAT (/*code=*/0, /*global=*/1);
+#ifdef HAVE_AS_LEB128
+ ASM_GENERATE_INTERNAL_LABEL (ttype_label, "LLSDATT", funcdef_number);
+#endif
+ tt_format_size = size_of_encoded_value (tt_format);
+
+ assemble_eh_align (tt_format_size * BITS_PER_UNIT);
}
- info->region_count = region_count;
- /* Clean up. */
- free (nested_eh_region);
+ ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "LLSDA", funcdef_number);
- return info;
-}
+ /* The LSDA header. */
+ /* Indicate the format of the landing pad start pointer. An omitted
+ field implies @LPStart == @Start. */
+ /* Currently we always put @LPStart == @Start. This field would
+ be most useful in moving the landing pads completely out of
+ line to another section, but it could also be used to minimize
+ the size of uleb128 landing pad offsets. */
+ lp_format = DW_EH_PE_omit;
+ dw2_asm_output_data (1, lp_format, "@LPStart format (%s)",
+ eh_data_format_name (lp_format));
-/* This function is used to retreive the vector of handlers which
- can be reached by a given insn in a given exception region.
- BLOCK is the exception block the insn is in.
- INFO is the eh_nesting_info structure.
- INSN is the (optional) insn within the block. If insn is not NULL_RTX,
- it may contain reg notes which modify its throwing behavior, and
- these will be obeyed. If NULL_RTX is passed, then we simply return the
- handlers for block.
- HANDLERS is the address of a pointer to a vector of handler_info pointers.
- Upon return, this will have the handlers which can be reached by block.
- This function returns the number of elements in the handlers vector. */
+ /* @LPStart pointer would go here. */
-int
-reachable_handlers (block, info, insn, handlers)
- int block;
- eh_nesting_info *info;
- rtx insn ;
- handler_info ***handlers;
-{
- int index = 0;
- *handlers = NULL;
+ dw2_asm_output_data (1, tt_format, "@TType format (%s)",
+ eh_data_format_name (tt_format));
- if (info == NULL)
- return 0;
- if (block > 0)
- index = info->region_index[block];
-
- if (insn && GET_CODE (insn) == CALL_INSN)
- {
- /* RETHROWs specify a region number from which we are going to rethrow.
- This means we won't pass control to handlers in the specified
- region, but rather any region OUTSIDE the specified region.
- We accomplish this by setting block to the outer_index of the
- specified region. */
- rtx note = find_reg_note (insn, REG_EH_RETHROW, NULL_RTX);
- if (note)
+#ifndef HAVE_AS_LEB128
+ if (USING_SJLJ_EXCEPTIONS)
+ call_site_len = sjlj_size_of_call_site_table ();
+ else
+ call_site_len = dw2_size_of_call_site_table ();
+#endif
+
+ /* A pc-relative 4-byte displacement to the @TType data. */
+ if (have_tt_data)
+ {
+#ifdef HAVE_AS_LEB128
+ char ttype_after_disp_label[32];
+ ASM_GENERATE_INTERNAL_LABEL (ttype_after_disp_label, "LLSDATTD",
+ funcdef_number);
+ dw2_asm_output_delta_uleb128 (ttype_label, ttype_after_disp_label,
+ "@TType base offset");
+ ASM_OUTPUT_LABEL (asm_out_file, ttype_after_disp_label);
+#else
+ /* Ug. Alignment queers things. */
+ unsigned int before_disp, after_disp, last_disp, disp;
+
+ before_disp = 1 + 1;
+ after_disp = (1 + size_of_uleb128 (call_site_len)
+ + call_site_len
+ + VARRAY_ACTIVE_SIZE (cfun->eh->action_record_data)
+ + (VARRAY_ACTIVE_SIZE (cfun->eh->ttype_data)
+ * tt_format_size));
+
+ disp = after_disp;
+ do
{
- index = eh_region_from_symbol (XEXP (note, 0));
- index = info->region_index[index];
- if (index)
- index = info->outer_index[index];
- }
- else
- {
- /* If there is no rethrow, we look for a REG_EH_REGION, and
- we'll throw from that block. A value of 0 or less
- indicates that this insn cannot throw. */
- note = find_reg_note (insn, REG_EH_REGION, NULL_RTX);
- if (note)
- {
- int b = INTVAL (XEXP (note, 0));
- if (b <= 0)
- index = 0;
- else
- index = info->region_index[b];
- }
+ unsigned int disp_size, pad;
+
+ last_disp = disp;
+ disp_size = size_of_uleb128 (disp);
+ pad = before_disp + disp_size + after_disp;
+ if (pad % tt_format_size)
+ pad = tt_format_size - (pad % tt_format_size);
+ else
+ pad = 0;
+ disp = after_disp + pad;
}
+ while (disp != last_disp);
+
+ dw2_asm_output_data_uleb128 (disp, "@TType base offset");
+#endif
}
- /* If we reach this point, and index is 0, there is no throw. */
- if (index == 0)
- return 0;
-
- *handlers = info->handlers[index];
- return info->num_handlers[index];
-}
+ /* Indicate the format of the call-site offsets. */
+#ifdef HAVE_AS_LEB128
+ cs_format = DW_EH_PE_uleb128;
+#else
+ cs_format = DW_EH_PE_udata4;
+#endif
+ dw2_asm_output_data (1, cs_format, "call-site format (%s)",
+ eh_data_format_name (cs_format));
+
+#ifdef HAVE_AS_LEB128
+ ASM_GENERATE_INTERNAL_LABEL (cs_after_size_label, "LLSDACSB",
+ funcdef_number);
+ ASM_GENERATE_INTERNAL_LABEL (cs_end_label, "LLSDACSE",
+ funcdef_number);
+ dw2_asm_output_delta_uleb128 (cs_end_label, cs_after_size_label,
+ "Call-site table length");
+ ASM_OUTPUT_LABEL (asm_out_file, cs_after_size_label);
+ if (USING_SJLJ_EXCEPTIONS)
+ sjlj_output_call_site_table ();
+ else
+ dw2_output_call_site_table ();
+ ASM_OUTPUT_LABEL (asm_out_file, cs_end_label);
+#else
+ dw2_asm_output_data_uleb128 (call_site_len,"Call-site table length");
+ if (USING_SJLJ_EXCEPTIONS)
+ sjlj_output_call_site_table ();
+ else
+ dw2_output_call_site_table ();
+#endif
-/* This function will free all memory associated with the eh_nesting info. */
+ /* ??? Decode and interpret the data for flag_debug_asm. */
+ n = VARRAY_ACTIVE_SIZE (cfun->eh->action_record_data);
+ for (i = 0; i < n; ++i)
+ dw2_asm_output_data (1, VARRAY_UCHAR (cfun->eh->action_record_data, i),
+ (i ? NULL : "Action record table"));
-void
-free_eh_nesting_info (info)
- eh_nesting_info *info;
-{
- int x;
- if (info != NULL)
+ if (have_tt_data)
+ assemble_eh_align (tt_format_size * BITS_PER_UNIT);
+
+ i = VARRAY_ACTIVE_SIZE (cfun->eh->ttype_data);
+ while (i-- > 0)
{
- if (info->region_index)
- free (info->region_index);
- if (info->num_handlers)
- free (info->num_handlers);
- if (info->outer_index)
- free (info->outer_index);
- if (info->handlers)
- {
- for (x = 0; x < info->region_count; x++)
- if (info->handlers[x])
- free (info->handlers[x]);
- free (info->handlers);
- }
- free (info);
+ tree type = VARRAY_TREE (cfun->eh->ttype_data, i);
+
+ if (type == NULL_TREE)
+ type = integer_zero_node;
+ else
+ type = lookup_type_for_runtime (type);
+
+ dw2_asm_output_encoded_addr_rtx (tt_format,
+ expand_expr (type, NULL_RTX, VOIDmode,
+ EXPAND_INITIALIZER),
+ NULL);
}
+
+#ifdef HAVE_AS_LEB128
+ if (have_tt_data)
+ ASM_OUTPUT_LABEL (asm_out_file, ttype_label);
+#endif
+
+ /* ??? Decode and interpret the data for flag_debug_asm. */
+ n = VARRAY_ACTIVE_SIZE (cfun->eh->ehspec_data);
+ for (i = 0; i < n; ++i)
+ dw2_asm_output_data (1, VARRAY_UCHAR (cfun->eh->ehspec_data, i),
+ (i ? NULL : "Exception specification table"));
+
+ function_section (current_function_decl);
+
+ if (USING_SJLJ_EXCEPTIONS)
+ sjlj_funcdef_number += 1;
}
diff --git a/gcc/except.h b/gcc/except.h
index b6450d3535e..63660c8a89f 100644
--- a/gcc/except.h
+++ b/gcc/except.h
@@ -1,5 +1,6 @@
/* Exception Handling interface routines.
- Copyright (C) 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
+ Free Software Foundation, Inc.
Contributed by Mike Stump <mrs@cygnus.com>.
This file is part of GNU CC.
@@ -19,500 +20,194 @@ 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. */
-#if !defined(NULL_RTX) && !defined(rtx)
-typedef struct rtx_def *_except_rtx;
-#define rtx _except_rtx
-#endif
-
-#ifdef TREE_CODE
-
-/* A stack of labels. CHAIN points to the next entry in the stack. */
-
-struct label_node {
- union {
- rtx rlabel;
- tree tlabel;
- } u;
- struct label_node *chain;
-};
-
-/* An eh_entry is used to describe one exception handling region.
-
- OUTER_CONTEXT is the label used for rethrowing into the outer context.
-
- EXCEPTION_HANDLER_LABEL is the label corresponding to the handler
- for this region.
-
- LABEL_USED indicates whether a CATCH block has already used this
- label or not. New ones are needed for additional catch blocks if
- it has.
- FALSE_LABEL is used when either setjmp/longjmp exceptions are in
- use, or old style table exceptions. It contains the label for
- branching to the next runtime type check as handlers are processed.
-
- FINALIZATION is the tree codes for the handler, or is NULL_TREE if
- one hasn't been generated yet, or is integer_zero_node to mark the
- end of a group of try blocks. */
-
-struct eh_entry {
- rtx outer_context;
- rtx exception_handler_label;
- tree finalization;
- int label_used;
- rtx false_label;
- rtx rethrow_label;
- /* If non-zero, this entry is for a handler created when we left an
- exception-region via goto. */
- unsigned goto_entry_p : 1;
-};
-#else
-struct label_node;
-struct eh_entry;
+#ifndef TREE_CODE
+union tree_node;
+#define tree union tree_node *
#endif
-/* A list of EH_ENTRYs. ENTRY is the entry; CHAIN points to the next
- entry in the list, or is NULL if this is the last entry. */
-
-struct eh_node {
- struct eh_entry *entry;
- struct eh_node *chain;
-};
-
-/* A stack of EH_ENTRYs. TOP is the topmost entry on the stack. TOP is
- NULL if the stack is empty. */
-
-struct eh_stack {
- struct eh_node *top;
-};
-
-/* A queue of EH_ENTRYs. HEAD is the front of the queue; TAIL is the
- end (the latest entry). HEAD and TAIL are NULL if the queue is
- empty. */
-
-struct eh_queue {
- struct eh_node *head;
- struct eh_node *tail;
- struct eh_queue *next;
-};
-
-/* Used to save exception handling status for each function. */
-struct eh_status
-{
- /* A stack used for keeping track of the currently active exception
- handling region. As each exception region is started, an entry
- describing the region is pushed onto this stack. The current
- region can be found by looking at the top of the stack, and as we
- exit regions, the corresponding entries are popped.
-
- Entries cannot overlap; they can be nested. So there is only one
- entry at most that corresponds to the current instruction, and that
- is the entry on the top of the stack. */
- struct eh_stack x_ehstack;
- /* This stack is used to represent what the current eh region is
- for the catch blocks beings processed */
- struct eh_stack x_catchstack;
- /* A queue used for tracking which exception regions have closed.
- As we exit a region, we enqueue a new entry. The entries are then
- dequeued during expand_leftover_cleanups and
- expand_start_all_catch. */
- struct eh_queue *x_ehqueue;
- /* Insns for all of the exception handlers for the current function.
- They are currently emitted by the frontend code. */
- rtx x_catch_clauses;
- /* End of exception handler insn sequence. */
- rtx x_catch_clauses_last;
- /* A random data area for the front end's own use. */
- struct label_node *x_false_label_stack;
- /* Keeps track of the label to resume to should one want to resume
- normal control flow out of a handler (instead of, say, returning to
- the caller of the current function or exiting the program). */
- struct label_node *x_caught_return_label_stack;
- /* A stack (TREE_LIST) of lists of handlers. The TREE_VALUE of each
- node is itself a TREE_CHAINed list of handlers for regions that
- are not yet closed. The TREE_VALUE of each entry contains the
- handler for the corresponding entry on the ehstack. */
- union tree_node *x_protect_list;
- /* The EH context. Nonzero if the function has already
- fetched a pointer to the EH context for exception handling. */
- rtx ehc;
- /* The label generated by expand_builtin_eh_return. */
- rtx x_eh_return_stub_label;
-};
-
-#define ehstack (cfun->eh->x_ehstack)
-#define catchstack (cfun->eh->x_catchstack)
-#define ehqueue (cfun->eh->x_ehqueue)
-#define catch_clauses (cfun->eh->x_catch_clauses)
-#define catch_clauses_last (cfun->eh->x_catch_clauses_last)
-#define false_label_stack (cfun->eh->x_false_label_stack)
-#define caught_return_label_stack (cfun->eh->x_caught_return_label_stack)
-#define protect_list (cfun->eh->x_protect_list)
-#define current_function_ehc (cfun->eh->ehc)
-#define eh_return_stub_label (cfun->eh->x_eh_return_stub_label)
-
-#ifdef TREE_CODE
-/* Start an exception handling region. All instructions emitted after
- this point are considered to be part of the region until
- expand_eh_region_end () is invoked. */
-
-extern void expand_eh_region_start PARAMS ((void));
-
-/* Just like expand_eh_region_start, except if a cleanup action is
- entered on the cleanup chain, the TREE_PURPOSE of the element put
- on the chain is DECL. DECL should be the associated VAR_DECL, if
- any, otherwise it should be NULL_TREE. */
-
-extern void expand_eh_region_start_for_decl PARAMS ((tree));
-
-/* Start an exception handling region for the given cleanup action.
- All instructions emitted after this point are considered to be part
- of the region until expand_eh_region_end () is invoked. CLEANUP is
- the cleanup action to perform. The return value is true if the
- exception region was optimized away. If that case,
- expand_eh_region_end does not need to be called for this cleanup,
- nor should it be.
-
- This routine notices one particular common case in C++ code
- generation, and optimizes it so as to not need the exception
- region. */
-
-extern int expand_eh_region_start_tree PARAMS ((tree, tree));
-
-/* End an exception handling region. The information about the region
- is found on the top of ehstack.
-
- HANDLER is either the cleanup for the exception region, or if we're
- marking the end of a try block, HANDLER is integer_zero_node.
-
- HANDLER will be transformed to rtl when expand_leftover_cleanups ()
- is invoked. */
-
-extern void expand_eh_region_end PARAMS ((tree));
-
-/* Push RLABEL or TLABEL onto LABELSTACK. Only one of RLABEL or TLABEL
- should be set; the other must be NULL. */
-
-extern void push_label_entry PARAMS ((struct label_node **labelstack,
- rtx rlabel, tree tlabel));
-
-/* Pop the topmost entry from LABELSTACK and return its value as an
- rtx node. If LABELSTACK is empty, return NULL. */
-
-extern rtx pop_label_entry PARAMS ((struct label_node **labelstack));
-
-/* Return the topmost entry of LABELSTACK as a tree node, or return
- NULL_TREE if LABELSTACK is empty. */
-
-extern tree top_label_entry PARAMS ((struct label_node **labelstack));
-
+#ifndef RTX_CODE
+struct rtx_def;
+#define rtx struct rtx_def *
#endif
-/* Test: is exception handling turned on? */
-
-extern int doing_eh PARAMS ((int));
-
-/* Toplevel initialization for EH. */
-
-void set_exception_lang_code PARAMS ((int));
-void set_exception_version_code PARAMS ((int));
-
-/* A list of handlers asocciated with an exception region. HANDLER_LABEL
- is the the label that control should be transfered to if the data
- in TYPE_INFO matches an exception. a value of NULL_TREE for TYPE_INFO
- means This is a cleanup, and must always be called. A value of
- CATCH_ALL_TYPE works like a cleanup, but a call to the runtime matcher
- is still performed to avoid being caught by a different language
- exception. NEXT is a pointer to the next handler for this region.
- NULL means there are no more. */
-
-typedef struct handler_info
-{
- rtx handler_label;
- int handler_number;
- void *type_info;
- struct handler_info *next;
-} handler_info;
-
-
-/* Add new handler information to an exception range. The first parameter
- specifies the range number (returned from new_eh_entry()). The second
- parameter specifies the handler. By default the handler is inserted at
- the end of the list. A handler list may contain only ONE NULL_TREE
- typeinfo entry. Regardless where it is positioned, a NULL_TREE entry
- is always output as the LAST handler in the exception table for a region. */
-
-void add_new_handler PARAMS ((int, struct handler_info *));
-
-/* Remove a handler label. The handler label is being deleted, so all
- regions which reference this handler should have it removed from their
- list of possible handlers. Any region which has the final handler
- removed can be deleted. */
-
-void remove_handler PARAMS ((rtx));
-
-/* Create a new handler structure initialized with the handler label and
- typeinfo fields passed in. */
-
-struct handler_info *get_new_handler PARAMS ((rtx, void *));
-
-/* Make a duplicate of an exception region by copying all the handlers
- for an exception region. Return the new handler index. */
-
-int duplicate_eh_handlers PARAMS ((int, int, rtx (*)(rtx)));
-
-/* map symbol refs for rethrow */
-
-rtx rethrow_symbol_map PARAMS ((rtx, rtx (*)(rtx)));
-
-/* Is the rethrow label for a region used? */
-
-int rethrow_used PARAMS ((int));
-
-/* Update the rethrow references to reflect rethrows which have been
- optimized away. */
-
-void update_rethrow_references PARAMS ((void));
-
-/* Get a pointer to the first handler in an exception region's list. */
-
-struct handler_info *get_first_handler PARAMS ((int));
-
-/* Find all the runtime handlers type matches currently referenced */
-
-int find_all_handler_type_matches PARAMS ((void ***));
-
-/* The eh_nesting_info structure is used to find a list of valid handlers
- for any arbitrary exception region. When init_eh_nesting_info is called,
- the information is all pre-calculated and entered in this structure.
- REGION_INDEX is a vector over all possible region numbers. Since the
- number of regions is typically much smaller than the range of block
- numbers, this is a sparse vector and the other data structures are
- represented as dense vectors. Indexed with an exception region number, this
- returns the index to use in the other data structures to retreive the
- correct information.
- HANDLERS is an array of vectors which point to handler_info structures.
- when indexed, it gives the list of all possible handlers which can
- be reached by a throw from this exception region.
- NUM_HANDLERS is the equivilent array indicating how many handler
- pointers there are in the HANDLERS vector.
- OUTER_INDEX indicates which index represents the information for the
- outer block. 0 indicates there is no outer context.
- REGION_COUNT is the number of regions. */
-
-typedef struct eh_nesting
-{
- int *region_index;
- handler_info ***handlers;
- int *num_handlers;
- int *outer_index;
- int region_count;
-} eh_nesting_info;
-
-/* Initialize the eh_nesting_info structure. */
-
-eh_nesting_info *init_eh_nesting_info PARAMS ((void));
-
-/* Get a list of handlers reachable from a an exception region/insn. */
-
-int reachable_handlers PARAMS ((int, eh_nesting_info *, rtx,
- handler_info ***handlers));
-
-/* Free the eh_nesting_info structure. */
-
-void free_eh_nesting_info PARAMS ((eh_nesting_info *));
-
-extern void init_eh PARAMS ((void));
-
-/* Initialization for the per-function EH data. */
-
-extern void init_eh_for_function PARAMS ((void));
-
-/* Generate an exception label. Use instead of gen_label_rtx */
-
-extern rtx gen_exception_label PARAMS ((void));
-
-/* Adds an EH table entry for EH entry number N. Called from
- final_scan_insn for NOTE_INSN_EH_REGION_BEG. */
-
-extern void add_eh_table_entry PARAMS ((int n));
-
-/* Start a catch clause, triggered by runtime value paramter. */
-
-#ifdef TREE_CODE
-extern void start_catch_handler PARAMS ((tree));
+#ifndef _VARRAY_H_
+struct varray_head_tag;
+#define varray_type struct varray_head_tag *
#endif
-/* End an individual catch clause. */
-
-extern void end_catch_handler PARAMS ((void));
-/* Returns a non-zero value if we need to output an exception table. */
+/* Per-function EH data. Used only in except.c, but GC and others
+ manipulate pointers to the opaque type. */
+struct eh_status;
-extern int exception_table_p PARAMS ((void));
+/* Internal structure describing a region. */
+struct eh_region;
-/* Outputs the exception table if we have one. */
-
-extern void output_exception_table PARAMS ((void));
-extern void output_exception_table_data PARAMS ((void));
-
-/* Free the exception table. */
+/* Test: is exception handling turned on? */
+extern int doing_eh PARAMS ((int));
-extern void free_exception_table PARAMS((void));
+/* Start an exception handling region. All instructions emitted after
+ this point are considered to be part of the region until an
+ expand_eh_region_end variant is invoked. */
+extern void expand_eh_region_start PARAMS ((void));
-/* Used by the ia64 unwind format to output data for an individual
- function. */
+/* End an exception handling region for a cleanup. HANDLER is an
+ expression to expand for the cleanup. */
+extern void expand_eh_region_end_cleanup PARAMS ((tree));
-extern void output_function_exception_table PARAMS((void));
+/* End an exception handling region for a try block, and prepares
+ for subsequent calls to expand_start_catch. */
+extern void expand_start_all_catch PARAMS ((void));
-/* Given a return address in ADDR, determine the address we should use
- to find the corresponding EH region. */
+/* Begin a catch clause. TYPE is an object to be matched by the
+ runtime, or null if this is a catch-all clause. */
+extern void expand_start_catch PARAMS ((tree));
-extern rtx eh_outer_context PARAMS ((rtx addr));
+/* End a catch clause. Control will resume after the try/catch block. */
+extern void expand_end_catch PARAMS ((void));
-/* Called at the start of a block of try statements for which there is
- a supplied catch handler. */
+/* End a sequence of catch handlers for a try block. */
+extern void expand_end_all_catch PARAMS ((void));
-extern void expand_start_try_stmts PARAMS ((void));
+/* End an exception region for an exception type filter. ALLOWED is a
+ TREE_LIST of TREE_VALUE objects to be matched by the runtime.
+ FAILURE is a function to invoke if a mismatch ocurrs. */
+extern void expand_eh_region_end_allowed PARAMS ((tree, tree));
-/* Called at the start of a block of catch statements. It terminates the
- previous set of try statements. */
+/* End an exception region for a must-not-throw filter. FAILURE is a
+ function to invoke if an uncaught exception propagates this far. */
+extern void expand_eh_region_end_must_not_throw PARAMS ((tree));
-extern void expand_start_all_catch PARAMS ((void));
+/* End an exception region for a throw. No handling goes on here,
+ but it's the easiest way for the front-end to indicate what type
+ is being thrown. */
+extern void expand_eh_region_end_throw PARAMS ((tree));
-/* Called at the end of a block of catch statements. */
-
-extern void expand_end_all_catch PARAMS ((void));
+/* End a fixup region. Within this region the cleanups for the immediately
+ enclosing region are _not_ run. This is used for goto cleanup to avoid
+ destroying an object twice. */
+extern void expand_eh_region_end_fixup PARAMS ((tree));
/* Begin a region that will contain entries created with
add_partial_entry. */
-
extern void begin_protect_partials PARAMS ((void));
-#ifdef TREE_CODE
/* Create a new exception region and add the handler for the region
- onto a list. These regions will be ended (and their handlers
- emitted) when end_protect_partials is invoked. */
-
-extern void add_partial_entry PARAMS ((tree handler));
-#endif
+ onto a list. These regions will be ended (and their handlers emitted)
+ when end_protect_partials is invoked. */
+extern void add_partial_entry PARAMS ((tree));
/* End all of the pending exception regions that have handlers added with
- push_protect_entry (). */
-
+ add_partial_entry. */
extern void end_protect_partials PARAMS ((void));
-/* An internal throw. */
-
-extern void expand_internal_throw PARAMS ((void));
-
-/* Called from expand_exception_blocks and expand_end_catch_block to
- expand and pending handlers. */
-
-extern void expand_leftover_cleanups PARAMS ((void));
-
-/* If necessary, emit insns to get EH context for the current
- function. */
-
-extern void emit_eh_context PARAMS ((void));
-
-/* Builds a list of handler labels and puts them in the global
- variable exception_handler_labels. */
-
-extern void find_exception_handler_labels PARAMS ((void));
-
-/* Determine if an arbitrary label is an exception label */
-
-extern int is_exception_handler_label PARAMS ((int));
-
-/* Performs sanity checking on the check_exception_handler_labels
- list. */
-
-extern void check_exception_handler_labels PARAMS ((void));
-
-/* Keeps track of the label used as the context of a throw to rethrow an
- exception to the outer exception region. */
-
-extern struct label_node *outer_context_label_stack;
-
-/* A list of labels used for exception handlers. It is created by
- find_exception_handler_labels for the optimization passes. */
+/* A list of labels used for exception handlers. */
extern rtx exception_handler_labels;
/* Determine if the given INSN can throw an exception. */
-
-extern int can_throw PARAMS ((rtx));
+extern bool can_throw_internal PARAMS ((rtx));
+extern bool can_throw_external PARAMS ((rtx));
/* Return nonzero if nothing in this function can throw. */
+extern bool nothrow_function_p PARAMS ((void));
-extern int nothrow_function_p PARAMS ((void));
-
-/* Performs optimizations for exception handling, such as removing
- unnecessary exception regions. Invoked from jump_optimize (). */
-
-extern void exception_optimize PARAMS ((void));
-
-/* Return EH context (and set it up once per fn). */
-extern rtx get_eh_context PARAMS ((void));
+/* After initial rtl generation, call back to finish generating
+ exception support code. */
+extern void finish_eh_generation PARAMS ((void));
-/* Get the dynamic handler chain. */
-extern rtx get_dynamic_handler_chain PARAMS ((void));
-
-/* Get the dynamic cleanup chain. */
-extern rtx get_dynamic_cleanup_chain PARAMS ((void));
+extern void init_eh PARAMS ((void));
+extern void init_eh_for_function PARAMS ((void));
-/* Throw an exception. */
+extern rtx reachable_handlers PARAMS ((rtx));
+extern void maybe_remove_eh_handler PARAMS ((rtx));
-extern void emit_throw PARAMS ((void));
+extern void convert_from_eh_region_ranges PARAMS ((void));
+extern void convert_to_eh_region_ranges PARAMS ((void));
+extern void find_exception_handler_labels PARAMS ((void));
+extern void output_function_exception_table PARAMS ((void));
-/* Save away the current ehqueue. */
-extern void push_ehqueue PARAMS ((void));
+extern void expand_builtin_unwind_init PARAMS ((void));
+extern rtx expand_builtin_eh_return_data_regno PARAMS ((tree));
+extern rtx expand_builtin_extract_return_addr PARAMS ((tree));
+extern void expand_builtin_init_dwarf_reg_sizes PARAMS ((tree));
+extern rtx expand_builtin_frob_return_addr PARAMS ((tree));
+extern rtx expand_builtin_dwarf_fp_regnum PARAMS ((void));
+extern void expand_builtin_eh_return PARAMS ((tree, tree));
+extern void expand_eh_return PARAMS ((void));
-/* Restore a previously pushed ehqueue. */
-extern void pop_ehqueue PARAMS ((void));
+extern rtx get_exception_pointer PARAMS ((struct function *));
-/* One to use setjmp/longjmp method of generating code. */
+struct function;
+struct inline_remap;
+extern int duplicate_eh_regions PARAMS ((struct function *,
+ struct inline_remap *));
-extern int exceptions_via_longjmp;
+extern void sjlj_emit_function_exit_after PARAMS ((rtx));
-/* One to enable asynchronous exception support. */
-extern int asynchronous_exceptions;
+/* If non-NULL, this is a function that returns an expression to be
+ executed if an unhandled exception is propogated out of a cleanup
+ region. For example, in C++, an exception thrown by a destructor
+ during stack unwinding is required to result in a call to
+ `std::terminate', so the C++ version of this function returns a
+ CALL_EXPR for `std::terminate'. */
+extern tree (*lang_protect_cleanup_actions) PARAMS ((void));
-/* One to protect cleanup actions with a handler that calls
- __terminate, zero otherwise. */
+/* Return true if type A catches type B. */
+extern int (*lang_eh_type_covers) PARAMS ((tree a, tree b));
-extern int protect_cleanup_actions_with_terminate;
+/* Map a type to a runtime object to match type. */
+extern tree (*lang_eh_runtime_type) PARAMS ((tree));
-#ifdef TREE_CODE
-extern tree protect_with_terminate PARAMS ((tree));
+#ifndef TREE_CODE
+#undef tree
#endif
-extern void expand_fixup_region_start PARAMS ((void));
-#ifdef TREE_CODE
-extern void expand_fixup_region_end PARAMS ((tree));
+#ifndef RTX_CODE
+#undef rtx
#endif
-/* Various hooks for the DWARF 2 __throw routine. */
-
-void expand_builtin_unwind_init PARAMS ((void));
-rtx expand_builtin_dwarf_fp_regnum PARAMS ((void));
-#ifdef TREE_CODE
-rtx expand_builtin_frob_return_addr PARAMS ((tree));
-rtx expand_builtin_extract_return_addr PARAMS ((tree));
-void expand_builtin_init_dwarf_reg_sizes PARAMS ((tree));
-void expand_builtin_eh_return PARAMS ((tree, tree, tree));
+#ifndef _VARRAY_H_
+#undef varray_type
#endif
-void expand_eh_return PARAMS ((void));
-/* Checking whether 2 instructions are within the same exception region. */
+/* Just because the user configured --with-sjlj-exceptions=no doesn't
+ mean that we can use call frame exceptions. Detect that the target
+ has appropriate support. */
-int in_same_eh_region PARAMS ((rtx, rtx));
-void free_insn_eh_region PARAMS ((void));
-void init_insn_eh_region PARAMS ((rtx, int));
+#if ! (defined (EH_RETURN_DATA_REGNO) \
+ && (defined (IA64_UNWIND_INFO) \
+ || (DWARF2_UNWIND_INFO \
+ && defined (EH_RETURN_STACKADJ_RTX) \
+ && (defined (EH_RETURN_HANDLER_RTX) \
+ || defined (HAVE_eh_return)))))
+#define MUST_USE_SJLJ_EXCEPTIONS 1
+#else
+#define MUST_USE_SJLJ_EXCEPTIONS 0
+#endif
-#ifdef rtx
-#undef rtx
+#ifdef CONFIG_SJLJ_EXCEPTIONS
+# if CONFIG_SJLJ_EXCEPTIONS == 1
+# define USING_SJLJ_EXCEPTIONS 1
+# endif
+# if CONFIG_SJLJ_EXCEPTIONS == 0
+# define USING_SJLJ_EXCEPTIONS 0
+# ifndef EH_RETURN_DATA_REGNO
+ #error "EH_RETURN_DATA_REGNO required"
+# endif
+# ifndef EH_RETURN_STACKADJ_RTX
+ #error "EH_RETURN_STACKADJ_RTX required"
+# endif
+# if !defined(EH_RETURN_HANDLER_RTX) && !defined(HAVE_eh_return)
+ #error "EH_RETURN_HANDLER_RTX or eh_return required"
+# endif
+# if !defined(DWARF2_UNWIND_INFO) && !defined(IA64_UNWIND_INFO)
+ #error "{DWARF2,IA64}_UNWIND_INFO required"
+# endif
+# endif
+#else
+# define USING_SJLJ_EXCEPTIONS MUST_USE_SJLJ_EXCEPTIONS
#endif
diff --git a/gcc/explow.c b/gcc/explow.c
index b7c0bb9f6d9..376c62c2189 100644
--- a/gcc/explow.c
+++ b/gcc/explow.c
@@ -32,8 +32,6 @@ Boston, MA 02111-1307, USA. */
#include "hard-reg-set.h"
#include "insn-config.h"
#include "recog.h"
-#include "insn-flags.h"
-#include "insn-codes.h"
#if !defined PREFERRED_STACK_BOUNDARY && defined STACK_BOUNDARY
#define PREFERRED_STACK_BOUNDARY STACK_BOUNDARY
diff --git a/gcc/expmed.c b/gcc/expmed.c
index 6eb5f9ebfee..f575937ba52 100644
--- a/gcc/expmed.c
+++ b/gcc/expmed.c
@@ -28,8 +28,6 @@ Boston, MA 02111-1307, USA. */
#include "tree.h"
#include "tm_p.h"
#include "flags.h"
-#include "insn-flags.h"
-#include "insn-codes.h"
#include "insn-config.h"
#include "expr.h"
#include "real.h"
@@ -3286,7 +3284,16 @@ expand_divmod (rem_flag, code, mode, op0, op1, target, unsignedp)
goto fail1;
}
else if (EXACT_POWER_OF_2_OR_ZERO_P (d)
- && (rem_flag ? smod_pow2_cheap : sdiv_pow2_cheap))
+ && (rem_flag ? smod_pow2_cheap : sdiv_pow2_cheap)
+ /* ??? The cheap metric is computed only for
+ word_mode. If this operation is wider, this may
+ not be so. Assume true if the optab has an
+ expander for this mode. */
+ && (((rem_flag ? smod_optab : sdiv_optab)
+ ->handlers[(int) compute_mode].insn_code
+ != CODE_FOR_nothing)
+ || (sdivmod_optab->handlers[(int) compute_mode]
+ .insn_code != CODE_FOR_nothing)))
;
else if (EXACT_POWER_OF_2_OR_ZERO_P (abs_d))
{
diff --git a/gcc/expr.c b/gcc/expr.c
index f4ff9b2d743..033eb702007 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -30,8 +30,6 @@ Boston, MA 02111-1307, USA. */
#include "hard-reg-set.h"
#include "except.h"
#include "function.h"
-#include "insn-flags.h"
-#include "insn-codes.h"
#include "insn-config.h"
/* Include expr.h after insn-config.h so we get HAVE_conditional_move. */
#include "expr.h"
@@ -44,19 +42,6 @@ Boston, MA 02111-1307, USA. */
#include "intl.h"
#include "tm_p.h"
-#ifndef ACCUMULATE_OUTGOING_ARGS
-#define ACCUMULATE_OUTGOING_ARGS 0
-#endif
-
-/* Supply a default definition for PUSH_ARGS. */
-#ifndef PUSH_ARGS
-#ifdef PUSH_ROUNDING
-#define PUSH_ARGS !ACCUMULATE_OUTGOING_ARGS
-#else
-#define PUSH_ARGS 0
-#endif
-#endif
-
/* Decide whether a function's arguments should be processed
from first to last or from last to first.
@@ -410,6 +395,9 @@ protect_from_queue (x, modify)
QUEUED_INSN (y));
return temp;
}
+ /* Copy the address into a pseudo, so that the returned value
+ remains correct across calls to emit_queue. */
+ XEXP (new, 0) = copy_to_reg (XEXP (new, 0));
return new;
}
/* Otherwise, recursively protect the subexpressions of all
@@ -436,9 +424,11 @@ protect_from_queue (x, modify)
}
return x;
}
- /* If the increment has not happened, use the variable itself. */
+ /* If the increment has not happened, use the variable itself. Copy it
+ into a new pseudo so that the value remains correct across calls to
+ emit_queue. */
if (QUEUED_INSN (x) == 0)
- return QUEUED_VAR (x);
+ return copy_to_reg (QUEUED_VAR (x));
/* If the increment has happened and a pre-increment copy exists,
use that copy. */
if (QUEUED_COPY (x) != 0)
@@ -1506,7 +1496,7 @@ move_by_pieces (to, from, len, align)
}
/* Return number of insns required to move L bytes by pieces.
- ALIGN (in bytes) is maximum alignment we can assume. */
+ ALIGN (in bits) is maximum alignment we can assume. */
static unsigned HOST_WIDE_INT
move_by_pieces_ninsns (l, align)
@@ -1757,6 +1747,7 @@ emit_block_move (x, y, size, align)
DECL_EXTERNAL (fn) = 1;
TREE_PUBLIC (fn) = 1;
DECL_ARTIFICIAL (fn) = 1;
+ TREE_NOTHROW (fn) = 1;
make_decl_rtl (fn, NULL_PTR);
assemble_external (fn);
}
@@ -1948,18 +1939,6 @@ emit_group_load (dst, orig_src, ssize, align)
tmps = (rtx *) alloca (sizeof (rtx) * XVECLEN (dst, 0));
- /* If we won't be loading directly from memory, protect the real source
- from strange tricks we might play. */
- src = orig_src;
- if (GET_CODE (src) != MEM && ! CONSTANT_P (src))
- {
- if (GET_MODE (src) == VOIDmode)
- src = gen_reg_rtx (GET_MODE (dst));
- else
- src = gen_reg_rtx (GET_MODE (orig_src));
- emit_move_insn (src, orig_src);
- }
-
/* Process the pieces. */
for (i = start; i < XVECLEN (dst, 0); i++)
{
@@ -1977,6 +1956,22 @@ emit_group_load (dst, orig_src, ssize, align)
abort ();
}
+ /* If we won't be loading directly from memory, protect the real source
+ from strange tricks we might play; but make sure that the source can
+ be loaded directly into the destination. */
+ src = orig_src;
+ if (GET_CODE (orig_src) != MEM
+ && (!CONSTANT_P (orig_src)
+ || (GET_MODE (orig_src) != mode
+ && GET_MODE (orig_src) != VOIDmode)))
+ {
+ if (GET_MODE (orig_src) == VOIDmode)
+ src = gen_reg_rtx (mode);
+ else
+ src = gen_reg_rtx (GET_MODE (orig_src));
+ emit_move_insn (src, orig_src);
+ }
+
/* Optimize the access just a bit. */
if (GET_CODE (src) == MEM
&& align >= GET_MODE_ALIGNMENT (mode)
@@ -2000,8 +1995,7 @@ emit_group_load (dst, orig_src, ssize, align)
else
abort ();
}
- else if ((CONSTANT_P (src)
- && (GET_MODE (src) == VOIDmode || GET_MODE (src) == mode))
+ else if (CONSTANT_P (src)
|| (GET_CODE (src) == REG && GET_MODE (src) == mode))
tmps[i] = src;
else
@@ -2639,7 +2633,7 @@ clear_storage (object, size, align)
For targets where libcalls and normal calls have different
conventions for returning pointers, we could end up generating
- incorrect code.
+ incorrect code.
So instead of using a libcall sequence we build up a suitable
CALL_EXPR and expand the call in the normal fashion. */
@@ -2657,6 +2651,7 @@ clear_storage (object, size, align)
DECL_EXTERNAL (fn) = 1;
TREE_PUBLIC (fn) = 1;
DECL_ARTIFICIAL (fn) = 1;
+ TREE_NOTHROW (fn) = 1;
make_decl_rtl (fn, NULL_PTR);
assemble_external (fn);
}
@@ -2766,7 +2761,7 @@ emit_move_insn_1 (x, y)
enum mode_class class = GET_MODE_CLASS (mode);
unsigned int i;
- if (mode >= MAX_MACHINE_MODE)
+ if ((unsigned int) mode >= (unsigned int) MAX_MACHINE_MODE)
abort ();
if (mov_optab->handlers[(int) mode].insn_code != CODE_FOR_nothing)
@@ -3077,7 +3072,7 @@ get_push_address (size)
SIZE is an rtx for the size of data to be copied (in bytes),
needed only if X is BLKmode.
- ALIGN is maximum alignment we can assume.
+ ALIGN (in bits) is maximum alignment we can assume.
If PARTIAL and REG are both nonzero, then copy that many of the first
words of X into registers starting with REG, and push the rest of X.
@@ -3180,7 +3175,8 @@ emit_push_insn (x, mode, type, size, align, partial, reg, extra,
and such small pushes do rounding that causes trouble. */
&& ((! SLOW_UNALIGNED_ACCESS (word_mode, align))
|| align >= BIGGEST_ALIGNMENT
- || PUSH_ROUNDING (align) == align)
+ || (PUSH_ROUNDING (align / BITS_PER_UNIT)
+ == (align / BITS_PER_UNIT)))
&& PUSH_ROUNDING (INTVAL (size)) == INTVAL (size))
{
/* Push padding now if padding above and stack grows down,
@@ -3843,7 +3839,7 @@ expand_assignment (to, from, want_value, suggest_reg)
TYPE_MODE (sizetype));
#ifdef TARGET_MEM_FUNCTIONS
- emit_library_call (memcpy_libfunc, LCT_NORMAL,
+ emit_library_call (memmove_libfunc, LCT_NORMAL,
VOIDmode, 3, XEXP (to_rtx, 0), Pmode,
XEXP (from_rtx, 0), Pmode,
convert_to_mode (TYPE_MODE (sizetype),
@@ -4435,7 +4431,7 @@ store_constructor (exp, target, align, cleared, size)
/* If the constructor has fewer fields than the structure
or if we are initializing the structure to mostly zeros,
- clear the whole structure first. Don't do this is TARGET is
+ clear the whole structure first. Don't do this if TARGET is a
register whose mode size isn't equal to SIZE since clear_storage
can't handle this case. */
else if (size > 0
@@ -4578,7 +4574,9 @@ store_constructor (exp, target, align, cleared, size)
int need_to_clear;
tree domain = TYPE_DOMAIN (type);
tree elttype = TREE_TYPE (type);
- int const_bounds_p = (host_integerp (TYPE_MIN_VALUE (domain), 0)
+ int const_bounds_p = (TYPE_MIN_VALUE (domain)
+ && TYPE_MAX_VALUE (domain)
+ && host_integerp (TYPE_MIN_VALUE (domain), 0)
&& host_integerp (TYPE_MAX_VALUE (domain), 0));
HOST_WIDE_INT minelt;
HOST_WIDE_INT maxelt;
@@ -4721,10 +4719,10 @@ store_constructor (exp, target, align, cleared, size)
index = build_decl (VAR_DECL, NULL_TREE, domain);
- DECL_RTL (index) = index_r
+ index_r
= gen_reg_rtx (promote_mode (domain, DECL_MODE (index),
&unsignedp, 0));
-
+ SET_DECL_RTL (index, index_r);
if (TREE_CODE (value) == SAVE_EXPR
&& SAVE_EXPR_RTL (value) == 0)
{
@@ -5029,6 +5027,11 @@ store_field (target, bitsize, bitpos, mode, exp, value_mode,
if (TREE_CODE (exp) == ERROR_MARK)
return const0_rtx;
+ /* If we have nothing to store, do nothing unless the expression has
+ side-effects. */
+ if (bitsize == 0)
+ return expand_expr (exp, const0_rtx, VOIDmode, 0);
+
if (bitsize < HOST_BITS_PER_WIDE_INT)
width_mask = ((HOST_WIDE_INT) 1 << bitsize) - 1;
@@ -5204,7 +5207,16 @@ store_field (target, bitsize, bitpos, mode, exp, value_mode,
(bitpos
/ BITS_PER_UNIT))));
MEM_SET_IN_STRUCT_P (to_rtx, 1);
- MEM_ALIAS_SET (to_rtx) = alias_set;
+ /* If the address of the structure varies, then it might be on
+ the stack. And, stack slots may be shared across scopes.
+ So, two different structures, of different types, can end up
+ at the same location. We will give the structures alias set
+ zero; here we must be careful not to give non-zero alias sets
+ to their fields. */
+ if (!rtx_varies_p (addr, /*for_alias=*/0))
+ MEM_ALIAS_SET (to_rtx) = alias_set;
+ else
+ MEM_ALIAS_SET (to_rtx) = 0;
return store_expr (exp, to_rtx, value_mode != VOIDmode);
}
@@ -5649,7 +5661,7 @@ safe_from_p (x, exp, top_p)
switch (TREE_CODE_CLASS (TREE_CODE (exp)))
{
case 'd':
- exp_rtl = DECL_RTL (exp);
+ exp_rtl = DECL_RTL_SET_P (exp) ? DECL_RTL (exp) : NULL_RTX;
break;
case 'c':
@@ -5766,7 +5778,8 @@ safe_from_p (x, exp, top_p)
/* If this is a language-specific tree code, it may require
special handling. */
- if (TREE_CODE (exp) >= LAST_AND_UNUSED_TREE_CODE
+ if ((unsigned int) TREE_CODE (exp)
+ >= (unsigned int) LAST_AND_UNUSED_TREE_CODE
&& lang_safe_from_p
&& !(*lang_safe_from_p) (x, exp))
return 0;
@@ -6221,7 +6234,7 @@ expand_expr (exp, target, tmode, modifier)
copy_rtx (XEXP (DECL_RTL (exp), 0)));
/* If we got something, return it. But first, set the alignment
- the address is a register. */
+ if the address is a register. */
if (temp != 0)
{
if (GET_CODE (temp) == MEM && GET_CODE (XEXP (temp, 0)) == REG)
@@ -6494,6 +6507,8 @@ expand_expr (exp, target, tmode, modifier)
case LABELED_BLOCK_EXPR:
if (LABELED_BLOCK_BODY (exp))
expand_expr_stmt (LABELED_BLOCK_BODY (exp));
+ /* Should perhaps use expand_label, but this is simpler and safer. */
+ do_pending_stack_adjust ();
emit_label (label_rtx (LABELED_BLOCK_LABEL (exp)));
return const0_rtx;
@@ -6529,7 +6544,7 @@ expand_expr (exp, target, tmode, modifier)
/* If VARS have not yet been expanded, expand them now. */
while (vars)
{
- if (DECL_RTL (vars) == 0)
+ if (!DECL_RTL_SET_P (vars))
{
vars_need_expansion = 1;
expand_decl (vars);
@@ -6753,7 +6768,7 @@ expand_expr (exp, target, tmode, modifier)
elem = TREE_CHAIN (elem))
;
- if (elem)
+ if (elem && !TREE_SIDE_EFFECTS (TREE_VALUE (elem)))
return expand_expr (fold (TREE_VALUE (elem)), target,
tmode, ro_modifier);
}
@@ -7956,21 +7971,21 @@ expand_expr (exp, target, tmode, modifier)
&& (TREE_TYPE (TREE_OPERAND (TREE_OPERAND (exp, 1), 0))
== TREE_TYPE (TREE_OPERAND (TREE_OPERAND (exp, 2), 0))))
{
- tree true = TREE_OPERAND (TREE_OPERAND (exp, 1), 0);
- tree false = TREE_OPERAND (TREE_OPERAND (exp, 2), 0);
-
- if ((TREE_CODE_CLASS (TREE_CODE (true)) == '2'
- && operand_equal_p (false, TREE_OPERAND (true, 0), 0))
- || (TREE_CODE_CLASS (TREE_CODE (false)) == '2'
- && operand_equal_p (true, TREE_OPERAND (false, 0), 0))
- || (TREE_CODE_CLASS (TREE_CODE (true)) == '1'
- && operand_equal_p (false, TREE_OPERAND (true, 0), 0))
- || (TREE_CODE_CLASS (TREE_CODE (false)) == '1'
- && operand_equal_p (true, TREE_OPERAND (false, 0), 0)))
+ tree iftrue = TREE_OPERAND (TREE_OPERAND (exp, 1), 0);
+ tree iffalse = TREE_OPERAND (TREE_OPERAND (exp, 2), 0);
+
+ if ((TREE_CODE_CLASS (TREE_CODE (iftrue)) == '2'
+ && operand_equal_p (iffalse, TREE_OPERAND (iftrue, 0), 0))
+ || (TREE_CODE_CLASS (TREE_CODE (iffalse)) == '2'
+ && operand_equal_p (iftrue, TREE_OPERAND (iffalse, 0), 0))
+ || (TREE_CODE_CLASS (TREE_CODE (iftrue)) == '1'
+ && operand_equal_p (iffalse, TREE_OPERAND (iftrue, 0), 0))
+ || (TREE_CODE_CLASS (TREE_CODE (iffalse)) == '1'
+ && operand_equal_p (iftrue, TREE_OPERAND (iffalse, 0), 0)))
return expand_expr (build1 (NOP_EXPR, type,
- build (COND_EXPR, TREE_TYPE (true),
+ build (COND_EXPR, TREE_TYPE (iftrue),
TREE_OPERAND (exp, 0),
- true, false)),
+ iftrue, iffalse)),
target, tmode, modifier);
}
@@ -8268,7 +8283,7 @@ expand_expr (exp, target, tmode, modifier)
if (target == 0)
{
- if (DECL_RTL (slot) != 0)
+ if (DECL_RTL_SET_P (slot))
{
target = DECL_RTL (slot);
/* If we have already expanded the slot, so don't do
@@ -8281,7 +8296,7 @@ expand_expr (exp, target, tmode, modifier)
target = assign_temp (type, 2, 0, 1);
/* All temp slots at this level must not conflict. */
preserve_temp_slots (target);
- DECL_RTL (slot) = target;
+ SET_DECL_RTL (slot, target);
if (TREE_ADDRESSABLE (slot))
put_var_into_stack (slot);
@@ -8307,7 +8322,7 @@ expand_expr (exp, target, tmode, modifier)
/* If we have already assigned it space, use that space,
not target that we were passed in, as our target
parameter is only a hint. */
- if (DECL_RTL (slot) != 0)
+ if (DECL_RTL_SET_P (slot))
{
target = DECL_RTL (slot);
/* If we have already expanded the slot, so don't do
@@ -8317,7 +8332,7 @@ expand_expr (exp, target, tmode, modifier)
}
else
{
- DECL_RTL (slot) = target;
+ SET_DECL_RTL (slot, target);
/* If we must have an addressable slot, then make sure that
the RTL that we just stored in slot is OK. */
if (TREE_ADDRESSABLE (slot))
@@ -8372,12 +8387,6 @@ expand_expr (exp, target, tmode, modifier)
temp = 0;
- if (TREE_CODE (lhs) != VAR_DECL
- && TREE_CODE (lhs) != RESULT_DECL
- && TREE_CODE (lhs) != PARM_DECL
- && ! (TREE_CODE (lhs) == INDIRECT_REF
- && TYPE_READONLY (TREE_TYPE (TREE_OPERAND (lhs, 0)))))
-
/* Check for |= or &= of a bitfield of size one into another bitfield
of size 1. In this case, (unless we need the result of the
assignment) we can do this more efficiently with a
@@ -8474,7 +8483,9 @@ expand_expr (exp, target, tmode, modifier)
if (ignore)
return op0;
- op0 = protect_from_queue (op0, 0);
+ /* Pass 1 for MODIFY, so that protect_from_queue doesn't get
+ clever and returns a REG when given a MEM. */
+ op0 = protect_from_queue (op0, 1);
/* We would like the object in memory. If it is a constant, we can
have it be statically allocated into memory. For a non-constant,
@@ -8644,7 +8655,7 @@ expand_expr (exp, target, tmode, modifier)
op0 = expand_expr (TREE_OPERAND (exp, 0), 0, VOIDmode, 0);
- expand_eh_region_end (handler);
+ expand_eh_region_end_cleanup (handler);
return op0;
}
@@ -8691,23 +8702,17 @@ expand_expr (exp, target, tmode, modifier)
return const0_rtx;
}
- case POPDCC_EXPR:
- {
- rtx dcc = get_dynamic_cleanup_chain ();
- emit_move_insn (dcc, validize_mem (gen_rtx_MEM (Pmode, dcc)));
- return const0_rtx;
- }
-
- case POPDHC_EXPR:
- {
- rtx dhc = get_dynamic_handler_chain ();
- emit_move_insn (dhc, validize_mem (gen_rtx_MEM (Pmode, dhc)));
- return const0_rtx;
- }
-
case VA_ARG_EXPR:
return expand_builtin_va_arg (TREE_OPERAND (exp, 0), type);
+ case EXC_PTR_EXPR:
+ return get_exception_pointer (cfun);
+
+ case FDESC_EXPR:
+ /* Function descriptors are not valid except for as
+ initialization constants, and should not be expanded. */
+ abort ();
+
default:
return (*lang_expand_expr) (exp, original_target, tmode, modifier);
}
diff --git a/gcc/expr.h b/gcc/expr.h
index eea9b97f08a..8bbf1407587 100644
--- a/gcc/expr.h
+++ b/gcc/expr.h
@@ -268,10 +268,6 @@ enum direction {none, upward, downward}; /* Value has this type. */
A few optabs, such as move_optab and cmp_optab, are used
by special code. */
-/* Everything that uses expr.h needs to define enum insn_code
- but we don't list it in the Makefile dependencies just for that. */
-#include "insn-codes.h"
-
typedef struct optab
{
enum rtx_code code;
@@ -493,20 +489,19 @@ enum libfunc_index
LTI_trunctfdf2,
LTI_memcpy,
+ LTI_memmove,
LTI_bcopy,
LTI_memcmp,
LTI_bcmp,
LTI_memset,
LTI_bzero,
- LTI_throw,
- LTI_rethrow,
- LTI_sjthrow,
- LTI_sjpopnthrow,
- LTI_terminate,
+ LTI_unwind_resume,
+ LTI_eh_personality,
LTI_setjmp,
LTI_longjmp,
- LTI_eh_rtime_match,
+ LTI_unwind_sjlj_register,
+ LTI_unwind_sjlj_unregister,
LTI_eqhf2,
LTI_nehf2,
@@ -626,20 +621,20 @@ extern rtx libfunc_table[LTI_MAX];
#define trunctfdf2_libfunc (libfunc_table[LTI_trunctfdf2])
#define memcpy_libfunc (libfunc_table[LTI_memcpy])
+#define memmove_libfunc (libfunc_table[LTI_memmove])
#define bcopy_libfunc (libfunc_table[LTI_bcopy])
#define memcmp_libfunc (libfunc_table[LTI_memcmp])
#define bcmp_libfunc (libfunc_table[LTI_bcmp])
#define memset_libfunc (libfunc_table[LTI_memset])
#define bzero_libfunc (libfunc_table[LTI_bzero])
-#define throw_libfunc (libfunc_table[LTI_throw])
-#define rethrow_libfunc (libfunc_table[LTI_rethrow])
-#define sjthrow_libfunc (libfunc_table[LTI_sjthrow])
-#define sjpopnthrow_libfunc (libfunc_table[LTI_sjpopnthrow])
-#define terminate_libfunc (libfunc_table[LTI_terminate])
+#define unwind_resume_libfunc (libfunc_table[LTI_unwind_resume])
+#define eh_personality_libfunc (libfunc_table[LTI_eh_personality])
#define setjmp_libfunc (libfunc_table[LTI_setjmp])
#define longjmp_libfunc (libfunc_table[LTI_longjmp])
-#define eh_rtime_match_libfunc (libfunc_table[LTI_eh_rtime_match])
+#define unwind_sjlj_register_libfunc (libfunc_table[LTI_unwind_sjlj_register])
+#define unwind_sjlj_unregister_libfunc \
+ (libfunc_table[LTI_unwind_sjlj_unregister])
#define eqhf2_libfunc (libfunc_table[LTI_eqhf2])
#define nehf2_libfunc (libfunc_table[LTI_nehf2])
diff --git a/gcc/f/BUGS b/gcc/f/BUGS
deleted file mode 100644
index 36166fb3e28..00000000000
--- a/gcc/f/BUGS
+++ /dev/null
@@ -1,158 +0,0 @@
-_Note:_ This file is automatically generated from the files
-`bugs0.texi' and `bugs.texi'. `BUGS' is _not_ a source file, although
-it is normally included within source distributions.
-
- This file lists known bugs in the GCC-2.97 version of the GNU
-Fortran compiler. Copyright (C) 1995,1996,1997,1998,1999,2000 Free
-Software Foundation, Inc. You may copy, distribute, and modify it
-freely as long as you preserve this copyright notice and permission
-notice.
-
-Known Bugs In GNU Fortran
-*************************
-
- This section identifies bugs that `g77' _users_ might run into in
-the GCC-2.97 version of `g77'. This includes bugs that are actually in
-the `gcc' back end (GBE) or in `libf2c', because those sets of code are
-at least somewhat under the control of (and necessarily intertwined
-with) `g77', so it isn't worth separating them out.
-
- For information on bugs in _other_ versions of `g77', see
-`gcc/gcc/f/NEWS'. There, lists of bugs fixed in various versions of
-`g77' can help determine what bugs existed in prior versions.
-
- _Warning:_ The information below is still under development, and
-might not accurately reflect the `g77' code base of which it is a part.
-Efforts are made to keep it somewhat up-to-date, but they are
-particularly concentrated on any version of this information that is
-distributed as part of a _released_ `g77'.
-
- In particular, while this information is intended to apply to the
-GCC-2.97 version of `g77', only an official _release_ of that version
-is expected to contain documentation that is most consistent with the
-`g77' product in that version.
-
- An online, "live" version of this document (derived directly from
-the mainline, development version of `g77' within `gcc') is available
-via `http://www.gnu.org/software/gcc/onlinedocs/g77_bugs.html'. Follow
-the "Known Bugs" link.
-
- For information on bugs that might afflict people who configure,
-port, build, and install `g77', see "Problems Installing" in
-`gcc/gcc/f/INSTALL'.
-
- The following information was last updated on 2000-11-05:
-
- * `g77' fails to warn about use of a "live" iterative-DO variable as
- an implied-DO variable in a `WRITE' or `PRINT' statement (although
- it does warn about this in a `READ' statement).
-
- * Something about `g77''s straightforward handling of label
- references and definitions sometimes prevents the GBE from
- unrolling loops. Until this is solved, try inserting or removing
- `CONTINUE' statements as the terminal statement, using the `END DO'
- form instead, and so on.
-
- * Some confusion in diagnostics concerning failing `INCLUDE'
- statements from within `INCLUDE''d or `#include''d files.
-
- * `g77' assumes that `INTEGER(KIND=1)' constants range from `-2**31'
- to `2**31-1' (the range for two's-complement 32-bit values),
- instead of determining their range from the actual range of the
- type for the configuration (and, someday, for the constant).
-
- Further, it generally doesn't implement the handling of constants
- very well in that it makes assumptions about the configuration
- that it no longer makes regarding variables (types).
-
- Included with this item is the fact that `g77' doesn't recognize
- that, on IEEE-754/854-compliant systems, `0./0.' should produce a
- NaN and no warning instead of the value `0.' and a warning. This
- is to be fixed in version 0.6, when `g77' will use the `gcc' back
- end's constant-handling mechanisms to replace its own.
-
- * `g77' uses way too much memory and CPU time to process large
- aggregate areas having any initialized elements.
-
- For example, `REAL A(1000000)' followed by `DATA A(1)/1/' takes up
- way too much time and space, including the size of the generated
- assembler file. This is to be mitigated somewhat in version 0.6.
-
- Version 0.5.18 improves cases like this--specifically, cases of
- _sparse_ initialization that leave large, contiguous areas
- uninitialized--significantly. However, even with the
- improvements, these cases still require too much memory and CPU
- time.
-
- (Version 0.5.18 also improves cases where the initial values are
- zero to a much greater degree, so if the above example ends with
- `DATA A(1)/0/', the compile-time performance will be about as good
- as it will ever get, aside from unrelated improvements to the
- compiler.)
-
- Note that `g77' does display a warning message to notify the user
- before the compiler appears to hang.
-
- * Previous versions of `g77' didn't emit information on variable and
- array members of common blocks and equivalences for use with a
- debugger (the `-g' command-line option). As of the version of
- `g77' shipped with version 3.0 of `GCC', this is corrected.
-
- As of Version 0.5.19, a temporary kludge solution is provided
- whereby some rudimentary information on a member is written as a
- string that is the member's value as a character string.
-
- * When debugging, after starting up the debugger but before being
- able to see the source code for the main program unit, the user
- must currently set a breakpoint at `MAIN__' (or `MAIN___' or
- `MAIN_' if `MAIN__' doesn't exist) and run the program until it
- hits the breakpoint. At that point, the main program unit is
- activated and about to execute its first executable statement, but
- that's the state in which the debugger should start up, as is the
- case for languages like C.
-
- * Debugging `g77'-compiled code using debuggers other than `gdb' is
- likely not to work.
-
- Getting `g77' and `gdb' to work together is a known
- problem--getting `g77' to work properly with other debuggers, for
- which source code often is unavailable to `g77' developers, seems
- like a much larger, unknown problem, and is a lower priority than
- making `g77' and `gdb' work together properly.
-
- On the other hand, information about problems other debuggers have
- with `g77' output might make it easier to properly fix `g77', and
- perhaps even improve `gdb', so it is definitely welcome. Such
- information might even lead to all relevant products working
- together properly sooner.
-
- * `g77' doesn't work perfectly on 64-bit configurations such as the
- Digital Semiconductor ("DEC") Alpha.
-
- This problem is largely resolved as of version 0.5.23. Version
- 0.6 should solve most or all remaining problems (such as
- cross-compiling involving 64-bit machines).
-
- * `g77' currently inserts needless padding for things like `COMMON
- A,IPAD' where `A' is `CHARACTER*1' and `IPAD' is `INTEGER(KIND=1)'
- on machines like x86, because the back end insists that `IPAD' be
- aligned to a 4-byte boundary, but the processor has no such
- requirement (though it is usually good for performance).
-
- The `gcc' back end needs to provide a wider array of
- specifications of alignment requirements and preferences for
- targets, and front ends like `g77' should take advantage of this
- when it becomes available.
-
- * The `libf2c' routines that perform some run-time arithmetic on
- `COMPLEX' operands were modified circa version 0.5.20 of `g77' to
- work properly even in the presence of aliased operands.
-
- While the `g77' and `netlib' versions of `libf2c' differ on how
- this is accomplished, the main differences are that we believe the
- `g77' version works properly even in the presence of _partially_
- aliased operands.
-
- However, these modifications have reduced performance on targets
- such as x86, due to the extra copies of operands involved.
-
diff --git a/gcc/f/ChangeLog b/gcc/f/ChangeLog
index 745890cfdf3..2affc688227 100644
--- a/gcc/f/ChangeLog
+++ b/gcc/f/ChangeLog
@@ -1,3 +1,194 @@
+2002-02-20 Release Manager
+
+ * GCC 3.0.4 Released.
+
+2002-02-20 Release Manager
+
+ * GCC 3.0.4 Released.
+
+2002-02-02 Richard Henderson <rth@redhat.com>
+
+ * ste.c (ffeste_begin_iterdo_): Use expand_exit_loop_top_cond.
+ (ffeste_R819B): Likewise.
+
+2001-12-20 Release Manager
+
+ * GCC 3.0.3 Released.
+
+2001-11-25 Toon Moene <toon@moene.indiv.nluug.nl>
+
+ PR fortran/3957
+ * lang-specs.h: Correct !pipe conditional in tradcpp0 invocation.
+
+2001-11-15 Craig Prescott <prescott@phys.ufl.edu>
+
+ * target.h (FFETARGET_32bit_longs): Don't define
+ for 64-bit hppa.
+
+2001-11-14 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * Make-lang.in: Change all uses of $(manext) to $(man1ext).
+
+2001-10-23 Release Manager
+
+ * GCC 3.0.2 Released.
+
+2001-10-23 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * g77.texi (Sending Patches): Remove.
+
+2001-08-19 Release Manager
+
+ * GCC 3.0.1 Released.
+
+2001-08-19 Release Manager
+
+ * GCC 3.0.1 Released.
+
+2000-08-14 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * target.h (FFETARGET_32bit_longs): Don't define
+ for 64-bit S/390.
+
+2001-07-19 Jakub Jelinek <jakub@redhat.com>
+
+ * top.c (ffe_decode_option): Disallow lang-independent processing
+ for -ffixed-form.
+
+2001-07-04 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * g77.texi: Use gpl.texi and funding.texi. Remove Look and Feel
+ section. Add Funding Free Software to invariant sections.
+ * Make-lang.in ($(srcdir)/f/g77.info, f/g77.dvi): Update
+ dependencies and use doc/include in search path.
+
+20010617 Release Manager
+
+ * GCC 3.0 Released.
+
+Wed Jun 13 11:22:39 2001 Mark Mitchell <mark@codesourcery.com>
+
+ * BUGS: Remove.
+ * NEWS: Likewise.
+
+2001-06-10 Toon Moene <toon@moene.indiv.nluug.nl>
+
+ * g77install.texi: Remove all documentation here. Point
+ to the GCC installation procedures.
+ * g77.texi: Add documentation on how to get output always
+ flushed and how to increase the maximum unit number.
+ * bugs.texi: Add documentation on how to change the threshold
+ for putting local arrays on the stack.
+
+2001-06-07 Theodore Papadopoulo <Theodore.Papadopoulo@sophia.inria.fr>
+
+ * Make-lang.in ($(srcdir)/f/g77.info): Added dependencies on
+ fdl.texi.
+ (f/g77.dvi): Use TEXI2DVI instead of custom tex calls. Create the
+ dvi file in the f directory.
+
+2001-06-03 Toon Moene <toon@moene.indiv.nluug.nl>
+
+ * root.texi: Fix typo in patches e-mail address.
+
+2001-06-03 Toon Moene <toon@moene.indiv.nluug.nl>
+ Jan van Male <jan.vanmale@fenk.wau.nl>
+
+ * root.texi: Define `help' and `patches' mailing list
+ addresses.
+ * news.texi: Remove `prerelease' from 0.5.26
+ * g77.texi: Use two spaces between command options, eliminate
+ some 'overfull hboxes'. Use help and patches mailing list
+ addresses where appropriate.
+
+2001-06-02 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * g77.texi: Move contents to just after title page.
+
+2001-06-02 Toon Moene <toon@moene.indiv.nluug.nl>
+
+ * com.c (ffecom_init_0): Make CHARACTER*1 unsigned.
+
+2001-05-22 Toon Moene <toon@moene.indiv.nluug.nl>
+
+ * g77.texi: Update last-changed date.
+ * news.texi: Update copyright years, last-changed date.
+
+2001-05-22 Toon Moene <toon@moene.indiv.nluug.nl>
+
+ * g77.texi: Update maintenance information for
+ GNU Fortran.
+ * news.texi: Make more news in 0.5.26 `user visible
+ changes'. Acknowledge work by important contributors.
+
+2001-05-20 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * Make-lang.in (f/g77.dvi): Include $(srcdir) in TEXINPUTS.
+
+2001-05-19 Toon Moene <toon@moene.indiv.nluug.nl>
+
+ * Make-lang.in: Have $(MAKEINFO) look into the parent
+ directory for includes.
+ * g77.texi: Use the GFDL.
+
+Sun May 13 12:25:06 2001 Mark Mitchell <mark@codesourcery.com>
+
+ * Make-lang.in: Replace all uses of `touch' with $(STAMP).
+
+2001-04-21 Toon Moene <toon@moene.indiv.nluug.nl>
+
+ * news.texi: Update release information for 0.5.26.
+
+Thu Apr 19 12:49:24 2001 Mark Mitchell <mark@codesourcery.com>
+
+ * top.c (ffe_decode_option): Do not permit language-independent
+ processing for -ffixed-line-length.
+
+2001-04-02 Jakub Jelinek <jakub@redhat.com>
+
+ * lex.c (ffelex_hash_): Avoid eating one whole line after
+ #line.
+
+Mon Apr 2 22:38:09 2001 Toon Moene <toon@moene.indiv.nluug.nl>
+
+ * com.c (duplicate_decls): Fix thinko in lazy DECL_RTL patch
+ of 2001-03-04.
+
+Mon Mar 26 18:13:30 2001 Mark Mitchell <mark@codesourcery.com>
+
+ * com.c (duplicate_decls): Don't copy DECL_FRAME_SIZE.
+
+2001-03-22 Zack Weinberg <zackw@stanford.edu>
+
+ * lang-specs.h: Add zero initializer for cpp_spec field to
+ all array elements.
+
+Mon Mar 19 15:05:39 2001 Mark Mitchell <mark@codesourcery.com>
+
+ * com.c (builtin_function): Use SET_DECL_ASSEMBLER_NAME.
+
+2001-03-15 Zack Weinberg <zackw@stanford.edu>
+
+ * proj.h, intdoc.c: Delete 'bool' type. Don't include
+ stddef.h here.
+ * com.c: Rename variables named 'true' and/or 'false'.
+
+Wed Mar 14 09:29:27 2001 Mark Mitchell <mark@codesourcery.com>
+
+ * com.c (ffecom_member_phase_2): Use COPY_DECL_RTL,
+ DECL_RTL_SET_P, etc.
+ (duplicate_decls): Likewise.
+ (start_decl): Likewise.
+
+Fri Feb 23 15:28:39 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
+
+ * com.c (set_block): Set NAMES and BLOCKS from BLOCK.
+
+2001-02-19 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * root.texi: Clear DEVELOPMENT. Update GCC version number to 3.0.
+ * BUGS, NEWS: Regenerate.
+
Sun Feb 4 15:52:44 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* com.c (ffecom_init_0): Call fatal_error instead of fatal.
diff --git a/gcc/f/Make-lang.in b/gcc/f/Make-lang.in
index 15488af9d64..62f05a09061 100644
--- a/gcc/f/Make-lang.in
+++ b/gcc/f/Make-lang.in
@@ -43,6 +43,12 @@ G77_INSTALL_NAME = `t='$(program_transform_name)'; echo g77 | sed $$t`
# Actual name to use when installing a cross-compiler.
G77_CROSS_NAME = `t='$(program_transform_cross_name)'; echo g77 | sed $$t`
+
+# Some versions of `touch' (such as the version on Solaris 2.8)
+# do not correctly set the timestamp due to buggy versions of `utime'
+# in the kernel. So, we use `echo' instead.
+STAMP = echo timestamp >
+
#
# Define the names for selecting f77 in LANGUAGES.
# Note that it would be nice to move the dependency on g77
@@ -62,7 +68,7 @@ F77 f77: f771$(exeext)
g77spec.o: $(srcdir)/f/g77spec.c $(srcdir)/f/version.h system.h $(GCC_H) \
$(CONFIG_H)
case "$(LANGUAGES)" in \
- *[fF]77*) touch lang-f77;; \
+ *[fF]77*) $(STAMP) lang-f77;; \
*) rm -f lang-f77;; \
esac
if [ -f lang-f77 ]; then \
@@ -72,7 +78,7 @@ g77spec.o: $(srcdir)/f/g77spec.c $(srcdir)/f/version.h system.h $(GCC_H) \
g77version.o: $(srcdir)/f/version.c
case "$(LANGUAGES)" in \
- *[fF]77*) touch lang-f77;; \
+ *[fF]77*) $(STAMP) lang-f77;; \
*) rm -f lang-f77;; \
esac
if [ -f lang-f77 ]; then \
@@ -114,7 +120,7 @@ f771$(exeext): $(F77_OBJS) $(BACKEND) $(LIBDEPS)
f/stamp-str: f/str-1t.h f/str-1t.j f/str-2t.h f/str-2t.j \
f/str-fo.h f/str-fo.j f/str-io.h f/str-io.j f/str-nq.h f/str-nq.j \
f/str-op.h f/str-op.j f/str-ot.h f/str-ot.j
- touch f/stamp-str
+ $(STAMP) f/stamp-str
f/str-1t.h f/str-1t.j: f/fini$(build_exeext) f/str-1t.fin
./f/fini$(build_exeext) $(srcdir)/f/str-1t.fin f/str-1t.j f/str-1t.h
@@ -141,7 +147,7 @@ f/fini$(build_exeext): f/fini.o f/proj-h.o safe-ctype.o
$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o f/fini$(build_exeext) \
f/fini.o f/proj-h.o safe-ctype.o
-f/fini.o:
+f/fini.o: $(HCONFIG_H)
$(HOST_CC) $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) \
-c $(srcdir)/f/fini.c $(OUTPUT_OPTION)
@@ -164,35 +170,33 @@ f77.dvi: f/g77.dvi
# g77 documentation.
$(srcdir)/f/g77.info: $(srcdir)/f/g77.texi $(srcdir)/f/bugs.texi \
- $(srcdir)/f/ffe.texi \
- $(srcdir)/f/g77install.texi $(srcdir)/f/news.texi \
- $(srcdir)/f/intdoc.texi $(srcdir)/f/root.texi
+ $(srcdir)/f/ffe.texi $(srcdir)/f/g77install.texi \
+ $(srcdir)/f/news.texi $(srcdir)/f/intdoc.texi \
+ $(srcdir)/f/root.texi $(srcdir)/doc/include/fdl.texi \
+ $(srcdir)/doc/include/gpl.texi \
+ $(srcdir)/doc/include/funding.texi
case "$(LANGUAGES)" in \
- *[fF]77*) touch lang-f77;; \
+ *[fF]77*) $(STAMP) lang-f77;; \
*) rm -f lang-f77;; \
esac
if [ -f lang-f77 ] && [ x$(BUILD_INFO) = xinfo ]; then \
rm -f $(srcdir)/f/g77.info-*; \
- cd $(srcdir)/f && $(MAKEINFO) -o g77.info g77.texi; \
+ cd $(srcdir)/f && $(MAKEINFO) -I../doc/include -o g77.info g77.texi; \
else true; fi
f/g77.dvi: $(srcdir)/f/g77.texi $(srcdir)/f/bugs.texi \
- $(srcdir)/f/ffe.texi \
- $(srcdir)/f/g77install.texi $(srcdir)/f/news.texi \
- $(srcdir)/f/intdoc.texi $(srcdir)/f/root.texi
+ $(srcdir)/f/ffe.texi $(srcdir)/f/g77install.texi \
+ $(srcdir)/f/news.texi $(srcdir)/f/intdoc.texi \
+ $(srcdir)/f/root.texi $(srcdir)/doc/include/fdl.texi \
+ $(srcdir)/doc/include/gpl.texi \
+ $(srcdir)/doc/include/funding.texi
case "$(LANGUAGES)" in \
- *[fF]77*) touch lang-f77;; \
+ *[fF]77*) $(STAMP) lang-f77;; \
*) rm -f lang-f77;; \
esac
-# `tex2dvi' was used below, but the Texinfo 3.12 one won't work properly
-# with the include files from $(srcdir). This use of TEXINPUTS may not
-# be universally valid. `$(TEX)' should be used if it gets defined in
-# gcc/Makefile.in.
if [ -f lang-f77 ]; then \
- TEXINPUTS=$(srcdir)/f:$$TEXINPUTS tex $(srcdir)/f/g77.texi; \
- texindex g77.??; \
- TEXINPUTS=$(srcdir)/f:$$TEXINPUTS tex $(srcdir)/f/g77.texi; \
- mv g77.dvi f; \
+ s=`cd $(srcdir); pwd`; export s; \
+ cd f && $(TEXI2DVI) -I $$s/doc/include $$s/f/g77.texi; \
else true; fi
# This dance is all about producing accurate documentation for g77's
@@ -264,7 +268,7 @@ f77.install-normal:
# run, since we use libsubdir to store our `flag' file, lang-f77.
f77.install-common: installdirs
case "$(LANGUAGES)" in \
- *[fF]77*) touch $(libsubdir)/lang-f77.com;; \
+ *[fF]77*) $(STAMP) $(libsubdir)/lang-f77.com;; \
*) rm -f $(libsubdir)/lang-f77.com;; \
esac
-if [ -f $(libsubdir)/lang-f77.com -a -f f771$(exeext) ] ; then \
@@ -295,7 +299,7 @@ f77.install-common: installdirs
# run, since we use libsubdir to store our `flag' file, lang-f77.
f77.install-info: f77.info installdirs
case "$(LANGUAGES)" in \
- *[fF]77*) touch $(libsubdir)/lang-f77.info;; \
+ *[fF]77*) $(STAMP) $(libsubdir)/lang-f77.info;; \
*) rm -f $(libsubdir)/lang-f77.info;; \
esac
if [ -f $(libsubdir)/lang-f77.info -a -f $(srcdir)/f/g77.info ] ; then \
@@ -318,18 +322,18 @@ f77.install-info: f77.info installdirs
# run, since we use libsubdir to store our `flag' file, lang-f77.
f77.install-man: $(srcdir)/f/g77.1 installdirs
case "$(LANGUAGES)" in \
- *[fF]77*) touch $(libsubdir)/lang-f77.man;; \
+ *[fF]77*) $(STAMP) $(libsubdir)/lang-f77.man;; \
*) rm -f $(libsubdir)/lang-f77.man;; \
esac
-if [ -f $(libsubdir)/lang-f77.man -a -f f771$(exeext) ] ; then \
if [ -f g77-cross$(exeext) ] ; then \
- rm -f $(man1dir)/$(G77_CROSS_NAME)$(manext); \
- $(INSTALL_DATA) $(srcdir)/f/g77.1 $(man1dir)/$(G77_CROSS_NAME)$(manext); \
- chmod a-x $(man1dir)/$(G77_CROSS_NAME)$(manext); \
+ rm -f $(man1dir)/$(G77_CROSS_NAME)$(man1ext); \
+ $(INSTALL_DATA) $(srcdir)/f/g77.1 $(man1dir)/$(G77_CROSS_NAME)$(man1ext); \
+ chmod a-x $(man1dir)/$(G77_CROSS_NAME)$(man1ext); \
else \
- rm -f $(man1dir)/$(G77_INSTALL_NAME)$(manext); \
- $(INSTALL_DATA) $(srcdir)/f/g77.1 $(man1dir)/$(G77_INSTALL_NAME)$(manext); \
- chmod a-x $(man1dir)/$(G77_INSTALL_NAME)$(manext); \
+ rm -f $(man1dir)/$(G77_INSTALL_NAME)$(man1ext); \
+ $(INSTALL_DATA) $(srcdir)/f/g77.1 $(man1dir)/$(G77_INSTALL_NAME)$(man1ext); \
+ chmod a-x $(man1dir)/$(G77_INSTALL_NAME)$(man1ext); \
fi; \
else true; fi
rm -f $(libsubdir)/lang-f77.man
@@ -338,7 +342,7 @@ f77.install-man: $(srcdir)/f/g77.1 installdirs
# run, since we use libsubdir to store our `flag' file, lang-f77.
f77.uninstall: installdirs
case "$(LANGUAGES)" in \
- *[fF]77*) touch $(libsubdir)/lang-f77.un;; \
+ *[fF]77*) $(STAMP) $(libsubdir)/lang-f77.un;; \
*) rm -f $(libsubdir)/lang-f77.un;; \
esac
@if [ -f $(libsubdir)/lang-f77.un ] ; then \
@@ -350,8 +354,8 @@ f77.uninstall: installdirs
-if [ -f $(libsubdir)/lang-f77.un ]; then \
rm -rf $(bindir)/$(G77_INSTALL_NAME)$(exeext); \
rm -rf $(bindir)/$(G77_CROSS_NAME)$(exeext); \
- rm -rf $(man1dir)/$(G77_INSTALL_NAME)$(manext); \
- rm -rf $(man1dir)/$(G77_CROSS_NAME)$(manext); \
+ rm -rf $(man1dir)/$(G77_INSTALL_NAME)$(man1ext); \
+ rm -rf $(man1dir)/$(G77_CROSS_NAME)$(man1ext); \
rm -rf $(infodir)/g77.info*; \
fi
rm -f $(libsubdir)/lang-f77.un
diff --git a/gcc/f/NEWS b/gcc/f/NEWS
deleted file mode 100644
index 602efe48539..00000000000
--- a/gcc/f/NEWS
+++ /dev/null
@@ -1,432 +0,0 @@
-_Note:_ This file is automatically generated from the files
-`news0.texi' and `news.texi'. `NEWS' is _not_ a source file, although
-it is normally included within source distributions.
-
- This file lists news about the GCC-2.97 version (and some other
-versions) of the GNU Fortran compiler. Copyright (C)
-1995,1996,1997,1998,1999,2000 Free Software Foundation, Inc. You may
-copy, distribute, and modify it freely as long as you preserve this
-copyright notice and permission notice.
-
-News About GNU Fortran
-**********************
-
- Changes made to recent versions of GNU Fortran are listed below,
-with the most recent version first.
-
- The changes are generally listed in order:
-
- 1. Code-generation and run-time-library bug-fixes
-
- 2. Compiler and run-time-library crashes involving valid code that
- have been fixed
-
- 3. New features
-
- 4. Fixes and enhancements to existing features
-
- 5. New diagnostics
-
- 6. Internal improvements
-
- 7. Miscellany
-
- This order is not strict--for example, some items involve a
-combination of these elements.
-
- Note that two variants of `g77' are tracked below. The `egcs'
-variant is described vis-a-vis previous versions of `egcs' and/or an
-official FSF version, as appropriate. Note that all such variants are
-now obsolete - the information is retained here only for its historical
-value.
-
- Therefore, `egcs' versions sometimes have multiple listings to help
-clarify how they differ from other versions, though this can make
-getting a complete picture of what a particular `egcs' version contains
-somewhat more difficult.
-
- _Warning:_ The information below is still under development, and
-might not accurately reflect the `g77' code base of which it is a part.
-Efforts are made to keep it somewhat up-to-date, but they are
-particularly concentrated on any version of this information that is
-distributed as part of a _released_ `g77'.
-
- In particular, while this information is intended to apply to the
-GCC-2.97 version of `g77', only an official _release_ of that version
-is expected to contain documentation that is most consistent with the
-`g77' product in that version.
-
- Nevertheless, information on _previous_ releases of `g77', below, is
-likely to be more up-to-date and accurate than the equivalent
-information that accompanied those releases, assuming the last-updated
-date of the information below is later than the dates of those releases.
-
- That's due to attempts to keep this development version of news
-about previous `g77' versions up-to-date.
-
- An online, "live" version of this document (derived directly from
-the mainline, development version of `g77' within `gcc') is available at
-`http://www.gnu.org/software/gcc/onlinedocs/g77_news.html'.
-
- The following information was last updated on 2000-11-05:
-
-In development:
-===============
-
- * Using options `-g', `-ggdb' or `-gdwarf[-2]' (where appropriate
- for your target) now also enables debugging information for COMMON
- BLOCK and EQUIVALENCE items to be emitted.
-
- * The `TtyNam' intrinsics now set NAME to all spaces (at run time)
- if the system has no `ttyname' implementation available.
-
- * Upgrade to `libf2c' as of 1999-06-28.
-
- This fixes a bug whereby input to a `NAMELIST' read involving a
- repeat count, such as `K(5)=10*3', was not properly handled by
- `libf2c'. The first item was written to `K(5)', but the remaining
- nine were written elsewhere (still within the array), not
- necessarily starting at `K(6)'.
-
-In 0.5.25, `GCC' 2.95 (`EGCS' 1.2) versus `EGCS' 1.1.2:
-=======================================================
-
- * `g77' no longer generates bad code for assignments, or other
- conversions, of `REAL' or `COMPLEX' constant expressions to type
- `INTEGER(KIND=2)' (often referred to as `INTEGER*8').
-
- For example, `INTEGER*8 J; J = 4E10' now works as documented.
-
- * `g77' no longer truncates `INTEGER(KIND=2)' (usually `INTEGER*8')
- subscript expressions when evaluating array references on systems
- with pointers widers than `INTEGER(KIND=1)' (such as Alphas).
-
- * `g77' no longer generates bad code for an assignment to a
- `COMPLEX' variable or array that partially overlaps one or more of
- the sources of the same assignment (a very rare construction). It
- now assigns through a temporary, in cases where such partial
- overlap is deemed possible.
-
- * `libg2c' (`libf2c') no longer loses track of the file being worked
- on during a `BACKSPACE' operation.
-
- * `libg2c' (`libf2c') fixes a bug whereby input to a `NAMELIST' read
- involving a repeat count, such as `K(5)=10*3', was not properly
- handled by `libf2c'. The first item was written to `K(5)', but
- the remaining nine were written elsewhere (still within the array),
- not necessarily starting at `K(6)'.
-
- * Automatic arrays now seem to be working on HP-UX systems.
-
- * The `Date' intrinsic now returns the correct result on big-endian
- systems.
-
- * Fix `g77' so it no longer crashes when compiling I/O statements
- using keywords that define `INTEGER' values, such as `IOSTAT=J',
- where J is other than default `INTEGER' (such as `INTEGER*2').
- Instead, it issues a diagnostic.
-
- * Fix `g77' so it properly handles `DATA A/RPT*VAL/', where RPT is
- not default `INTEGER', such as `INTEGER*2', instead of producing a
- spurious diagnostic. Also fix `DATA (A(I),I=1,N)', where `N' is
- not default `INTEGER' to work instead of crashing `g77'.
-
- * The `-ax' option is now obeyed when compiling Fortran programs.
- (It is passed to the `f771' driver.)
-
- * The new `-fbounds-check' option causes `g77' to compile run-time
- bounds checks of array subscripts, as well as of substring start
- and end points.
-
- * `libg2c' now supports building as multilibbed library, which
- provides better support for systems that require options such as
- `-mieee' to work properly.
-
- * Source file names with the suffixes `.FOR' and `.FPP' now are
- recognized by `g77' as if they ended in `.for' and `.fpp',
- respectively.
-
- * The order of arguments to the _subroutine_ forms of the `CTime',
- `DTime', `ETime', and `TtyNam' intrinsics has been swapped. The
- argument serving as the returned value for the corresponding
- function forms now is the _second_ argument, making these
- consistent with the other subroutine forms of `libU77' intrinsics.
-
- * `g77' now warns about a reference to an intrinsic that has an
- interface that is not Year 2000 (Y2K) compliant. Also, `libg2c'
- has been changed to increase the likelihood of catching references
- to the implementations of these intrinsics using the `EXTERNAL'
- mechanism (which would avoid the new warnings).
-
- * `g77' now warns about a reference to a function when the
- corresponding _subsequent_ function program unit disagrees with
- the reference concerning the type of the function.
-
- * `-fno-emulate-complex' is now the default option. This should
- result in improved performance of code that uses the `COMPLEX'
- data type.
-
- * The `-malign-double' option now reliably aligns _all_
- double-precision variables and arrays on Intel x86 targets.
-
- * Even without the `-malign-double' option, `g77' reliably aligns
- local double-precision variables that are not in `EQUIVALENCE'
- areas and not `SAVE''d.
-
- * `g77' now open-codes ("inlines") division of `COMPLEX' operands
- instead of generating a run-time call to the `libf2c' routines
- `c_div' or `z_div', unless the `-Os' option is specified.
-
- * `g77' no longer generates code to maintain `errno', a C-language
- concept, when performing operations such as the `SqRt' intrinsic.
-
- * `g77' developers can temporarily use the `-fflatten-arrays' option
- to compare how the compiler handles code generation using C-like
- constructs as compared to the Fortran-like method constructs
- normally used.
-
- * A substantial portion of the `g77' front end's code-generation
- component was rewritten. It now generates code using facilities
- more robustly supported by the `gcc' back end. One effect of this
- rewrite is that some codes no longer produce a spurious "label LAB
- used before containing binding contour" message.
-
- * Support for the `-fugly' option has been removed.
-
- * Improve documentation and indexing, including information on Year
- 2000 (Y2K) compliance, and providing more information on internals
- of the front end.
-
- * Upgrade to `libf2c' as of 1999-05-10.
-
-In 0.5.24 versus 0.5.23:
-========================
-
- There is no `g77' version 0.5.24 at this time, or planned. 0.5.24
-is the version number designated for bug fixes and, perhaps, some new
-features added, to 0.5.23. Version 0.5.23 requires `gcc' 2.8.1, as
-0.5.24 was planned to require.
-
- Due to `EGCS' becoming `GCC' (which is now an acronym for "GNU
-Compiler Collection"), and `EGCS' 1.2 becoming officially designated
-`GCC' 2.95, there seems to be no need for an actual 0.5.24 release.
-
- To reduce the confusion already resulting from use of 0.5.24 to
-designate `g77' versions within `EGCS' versions 1.0 and 1.1, as well as
-in versions of `g77' documentation and notices during that period,
-"mainline" `g77' version numbering resumes at 0.5.25 with `GCC' 2.95
-(`EGCS' 1.2), skipping over 0.5.24 as a placeholder version number.
-
- To repeat, there is no `g77' 0.5.24, but there is now a 0.5.25.
-Please remain calm and return to your keypunch units.
-
-In `EGCS' 1.1.2 versus `EGCS' 1.1.1:
-====================================
-
- * Fix the `IDate' intrinsic (VXT) (in `libg2c') so the returned year
- is in the documented, non-Y2K-compliant range of 0-99, instead of
- being returned as 100 in the year 2000.
-
- * Fix the `Date_and_Time' intrinsic (in `libg2c') to return the
- milliseconds value properly in VALUES(8).
-
- * Fix the `LStat' intrinsic (in `libg2c') to return device-ID
- information properly in SARRAY(7).
-
- * Improve documentation.
-
-In `EGCS' 1.1.1 versus `EGCS' 1.1:
-==================================
-
- * Fix `libg2c' so it performs an implicit `ENDFILE' operation (as
- appropriate) whenever a `REWIND' is done.
-
- (This bug was introduced in 0.5.23 and `egcs' 1.1 in `g77''s
- version of `libf2c'.)
-
- * Fix `libg2c' so it no longer crashes with a spurious diagnostic
- upon doing any I/O following a direct formatted write.
-
- (This bug was introduced in 0.5.23 and `egcs' 1.1 in `g77''s
- version of `libf2c'.)
-
- * Fix `g77' so it no longer crashes compiling references to the
- `Rand' intrinsic on some systems.
-
- * Fix `g77' portion of installation process so it works better on
- some systems (those with shells requiring `else true' clauses on
- `if' constructs for the completion code to be set properly).
-
-In `EGCS' 1.1 versus `EGCS' 1.0.3:
-==================================
-
- * Fix bugs in the `libU77' intrinsic `HostNm' that wrote one byte
- beyond the end of its `CHARACTER' argument, and in the `libU77'
- intrinsics `GMTime' and `LTime' that overwrote their arguments.
-
- * Assumed arrays with negative bounds (such as `REAL A(-1:*)') no
- longer elicit spurious diagnostics from `g77', even on systems
- with pointers having different sizes than integers.
-
- This bug is not known to have existed in any recent version of
- `gcc'. It was introduced in an early release of `egcs'.
-
- * Valid combinations of `EXTERNAL', passing that external as a dummy
- argument without explicitly giving it a type, and, in a subsequent
- program unit, referencing that external as an external function
- with a different type no longer crash `g77'.
-
- * `CASE DEFAULT' no longer crashes `g77'.
-
- * The `-Wunused' option no longer issues a spurious warning about
- the "master" procedure generated by `g77' for procedures
- containing `ENTRY' statements.
-
- * Support `FORMAT(I<EXPR>)' when EXPR is a compile-time constant
- `INTEGER' expression.
-
- * Fix `g77' `-g' option so procedures that use `ENTRY' can be
- stepped through, line by line, in `gdb'.
-
- * Allow any `REAL' argument to intrinsics `Second' and `CPU_Time'.
-
- * Use `tempnam', if available, to open scratch files (as in
- `OPEN(STATUS='SCRATCH')') so that the `TMPDIR' environment
- variable, if present, is used.
-
- * `g77''s version of `libf2c' separates out the setting of global
- state (such as command-line arguments and signal handling) from
- `main.o' into distinct, new library archive members.
-
- This should make it easier to write portable applications that
- have their own (non-Fortran) `main()' routine properly set up the
- `libf2c' environment, even when `libf2c' (now `libg2c') is a
- shared library.
-
- * `g77' no longer installs the `f77' command and `f77.1' man page in
- the `/usr' or `/usr/local' heirarchy, even if the `f77-install-ok'
- file exists in the source or build directory. See the
- installation documentation for more information.
-
- * `g77' no longer installs the `libf2c.a' library and `f2c.h'
- include file in the `/usr' or `/usr/local' heirarchy, even if the
- `f2c-install-ok' or `f2c-exists-ok' files exist in the source or
- build directory. See the installation documentation for more
- information.
-
- * The `libf2c.a' library produced by `g77' has been renamed to
- `libg2c.a'. It is installed only in the `gcc' "private" directory
- heirarchy, `gcc-lib'. This allows system administrators and users
- to choose which version of the `libf2c' library from `netlib' they
- wish to use on a case-by-case basis. See the installation
- documentation for more information.
-
- * The `f2c.h' include (header) file produced by `g77' has been
- renamed to `g2c.h'. It is installed only in the `gcc' "private"
- directory heirarchy, `gcc-lib'. This allows system administrators
- and users to choose which version of the include file from
- `netlib' they wish to use on a case-by-case basis. See the
- installation documentation for more information.
-
- * The `g77' command now expects the run-time library to be named
- `libg2c.a' instead of `libf2c.a', to ensure that a version other
- than the one built and installed as part of the same `g77' version
- is picked up.
-
- * During the configuration and build process, `g77' creates
- subdirectories it needs only as it needs them. Other cleaning up
- of the configuration and build process has been performed as well.
-
- * `install-info' now used to update the directory of Info
- documentation to contain an entry for `g77' (during installation).
-
- * Some diagnostics have been changed from warnings to errors, to
- prevent inadvertent use of the resulting, probably buggy, programs.
- These mostly include diagnostics about use of unsupported features
- in the `OPEN', `INQUIRE', `READ', and `WRITE' statements, and
- about truncations of various sorts of constants.
-
- * Improve compilation of `FORMAT' expressions so that a null byte is
- appended to the last operand if it is a constant. This provides a
- cleaner run-time diagnostic as provided by `libf2c' for statements
- like `PRINT '(I1', 42'.
-
- * Improve documentation and indexing.
-
- * The upgrade to `libf2c' as of 1998-06-18 should fix a variety of
- problems, including those involving some uses of the `T' format
- specifier, and perhaps some build (porting) problems as well.
-
-In `EGCS' 1.1 versus `g77' 0.5.23:
-==================================
-
- * Fix a code-generation bug that afflicted Intel x86 targets when
- `-O2' was specified compiling, for example, an old version of the
- `DNRM2' routine.
-
- The x87 coprocessor stack was being mismanaged in cases involving
- assigned `GOTO' and `ASSIGN'.
-
- * `g77' no longer produces incorrect code and initial values for
- `EQUIVALENCE' and `COMMON' aggregates that, due to "unnatural"
- ordering of members vis-a-vis their types, require initial padding.
-
- * Fix `g77' crash compiling code containing the construct
- `CMPLX(0.)' or similar.
-
- * `g77' no longer crashes when compiling code containing
- specification statements such as `INTEGER(KIND=7) PTR'.
-
- * `g77' no longer crashes when compiling code such as `J = SIGNAL(1,
- 2)'.
-
- * `g77' now treats `%LOC(EXPR)' and `LOC(EXPR)' as "ordinary"
- expressions when they are used as arguments in procedure calls.
- This change applies only to global (filewide) analysis, making it
- consistent with how `g77' actually generates code for these cases.
-
- Previously, `g77' treated these expressions as denoting special
- "pointer" arguments for the purposes of filewide analysis.
-
- * Fix `g77' crash (or apparently infinite run-time) when compiling
- certain complicated expressions involving `COMPLEX' arithmetic
- (especially multiplication).
-
- * Align static double-precision variables and arrays on Intel x86
- targets regardless of whether `-malign-double' is specified.
-
- Generally, this affects only local variables and arrays having the
- `SAVE' attribute or given initial values via `DATA'.
-
- * The `g77' driver now ensures that `-lg2c' is specified in the link
- phase prior to any occurrence of `-lm'. This prevents
- accidentally linking to a routine in the SunOS4 `-lm' library when
- the generated code wants to link to the one in `libf2c' (`libg2c').
-
- * `g77' emits more debugging information when `-g' is used.
-
- This new information allows, for example, `which __g77_length_a'
- to be used in `gdb' to determine the type of the phantom length
- argument supplied with `CHARACTER' variables.
-
- This information pertains to internally-generated type, variable,
- and other information, not to the longstanding deficiencies
- vis-a-vis `COMMON' and `EQUIVALENCE'.
-
- * The F90 `Date_and_Time' intrinsic now is supported.
-
- * The F90 `System_Clock' intrinsic allows the optional arguments
- (except for the `Count' argument) to be omitted.
-
- * Upgrade to `libf2c' as of 1998-06-18.
-
- * Improve documentation and indexing.
-
-In previous versions:
-=====================
-
- Information on previous versions is not provided in this
-`gcc/gcc/f/NEWS' file, to keep it short. See `gcc/gcc/f/news.texi', or
-any of its other derivations (Info, HTML, dvi forms) for such
-information.
-
diff --git a/gcc/f/bugs.texi b/gcc/f/bugs.texi
index 73e31d5861c..172a0f1dcf0 100644
--- a/gcc/f/bugs.texi
+++ b/gcc/f/bugs.texi
@@ -1,4 +1,4 @@
-@c Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+@c Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
@c This is part of the G77 manual.
@c For copying conditions, see the file g77.texi.
@@ -7,9 +7,9 @@
@c Keep this the same as the dates above, since it's used
@c in the standalone derivations of this file (e.g. BUGS).
-@set copyrights-bugs 1995,1996,1997,1998,1999,2000
+@set copyrights-bugs 1995,1996,1997,1998,1999,2000,2001
-@set last-update-bugs 2000-11-05
+@set last-update-bugs 2001-06-10
@include root.texi
@@ -82,18 +82,6 @@ is available via
@uref{http://www.gnu.org/software/gcc/onlinedocs/g77_bugs.html}.
Follow the ``Known Bugs'' link.
-@ifset DOC-G77
-For information on bugs that might afflict people who
-configure, port, build, and install @code{g77},
-see @ref{Problems Installing}.
-@end ifset
-
-@ifset DOC-BUGS
-For information on bugs that might afflict people who
-configure, port, build, and install @code{g77},
-see "Problems Installing" in @file{@value{path-g77}/INSTALL}.
-@end ifset
-
The following information was last updated on @value{last-update-bugs}:
@itemize @bullet
@@ -167,9 +155,40 @@ improvements to the compiler.)
Note that @code{g77} does display a warning message to
notify the user before the compiler appears to hang.
@ifset DOC-G77
-@xref{Large Initialization,,Initialization of Large Aggregate Areas},
-for information on how to change the point at which
-@code{g77} decides to issue this warning.
+A warning message is issued when @code{g77} sees code that provides
+initial values (e.g. via @code{DATA}) to an aggregate area (@code{COMMON}
+or @code{EQUIVALENCE}, or even a large enough array or @code{CHARACTER}
+variable)
+that is large enough to increase @code{g77}'s compile time by roughly
+a factor of 10.
+
+This size currently is quite small, since @code{g77}
+currently has a known bug requiring too much memory
+and time to handle such cases.
+In @file{@value{path-g77}/data.c}, the macro
+@code{FFEDATA_sizeTOO_BIG_INIT_} is defined
+to the minimum size for the warning to appear.
+The size is specified in storage units,
+which can be bytes, words, or whatever, on a case-by-case basis.
+
+After changing this macro definition, you must
+(of course) rebuild and reinstall @code{g77} for
+the change to take effect.
+
+Note that, as of version 0.5.18, improvements have
+reduced the scope of the problem for @emph{sparse}
+initialization of large arrays, especially those
+with large, contiguous uninitialized areas.
+However, the warning is issued at a point prior to
+when @code{g77} knows whether the initialization is sparse,
+and delaying the warning could mean it is produced
+too late to be helpful.
+
+Therefore, the macro definition should not be adjusted to
+reflect sparse cases.
+Instead, adjust it to generate the warning when densely
+initialized arrays begin to cause responses noticeably slower
+than linear performance would suggest.
@end ifset
@cindex debugging
diff --git a/gcc/f/com.c b/gcc/f/com.c
index 198a1f719d2..58b6a2f1de6 100644
--- a/gcc/f/com.c
+++ b/gcc/f/com.c
@@ -4519,21 +4519,21 @@ ffecom_expr_intrinsic_ (ffebld expr, tree dest_tree,
case FFEINTRIN_impBTEST:
{
- ffetargetLogical1 true;
- ffetargetLogical1 false;
+ ffetargetLogical1 target_true;
+ ffetargetLogical1 target_false;
tree true_tree;
tree false_tree;
- ffetarget_logical1 (&true, TRUE);
- ffetarget_logical1 (&false, FALSE);
- if (true == 1)
+ ffetarget_logical1 (&target_true, TRUE);
+ ffetarget_logical1 (&target_false, FALSE);
+ if (target_true == 1)
true_tree = convert (tree_type, integer_one_node);
else
- true_tree = convert (tree_type, build_int_2 (true, 0));
- if (false == 0)
+ true_tree = convert (tree_type, build_int_2 (target_true, 0));
+ if (target_false == 0)
false_tree = convert (tree_type, integer_zero_node);
else
- false_tree = convert (tree_type, build_int_2 (false, 0));
+ false_tree = convert (tree_type, build_int_2 (target_false, 0));
return
ffecom_3 (COND_EXPR, tree_type,
@@ -7096,12 +7096,12 @@ ffecom_member_phase2_ (ffestorag mst, ffestorag st)
TREE_ASM_WRITTEN (t) = 1;
TREE_USED (t) = 1;
- DECL_RTL (t)
- = gen_rtx (MEM, TYPE_MODE (type),
- plus_constant (XEXP (DECL_RTL (mt), 0),
- ffestorag_modulo (mst)
- + ffestorag_offset (st)
- - ffestorag_offset (mst)));
+ SET_DECL_RTL (t,
+ gen_rtx (MEM, TYPE_MODE (type),
+ plus_constant (XEXP (DECL_RTL (mt), 0),
+ ffestorag_modulo (mst)
+ + ffestorag_offset (st)
+ - ffestorag_offset (mst))));
t = start_decl (t, FALSE);
@@ -11473,6 +11473,8 @@ ffecom_init_0 ()
/* Define `int' and `char' first so that dbx will output them first. */
pushdecl (build_decl (TYPE_DECL, get_identifier ("int"),
integer_type_node));
+ /* CHARACTER*1 is unsigned in ICHAR contexts. */
+ char_type_node = make_unsigned_type (CHAR_TYPE_SIZE);
pushdecl (build_decl (TYPE_DECL, get_identifier ("char"),
char_type_node));
pushdecl (build_decl (TYPE_DECL, get_identifier ("long int"),
@@ -13554,7 +13556,7 @@ builtin_function (const char *name, tree type, int function_code,
DECL_EXTERNAL (decl) = 1;
TREE_PUBLIC (decl) = 1;
if (library_name)
- DECL_ASSEMBLER_NAME (decl) = get_identifier (library_name);
+ SET_DECL_ASSEMBLER_NAME (decl, get_identifier (library_name));
make_decl_rtl (decl, NULL_PTR);
pushdecl (decl);
DECL_BUILT_IN_CLASS (decl) = class;
@@ -13686,7 +13688,7 @@ duplicate_decls (tree newdecl, tree olddecl)
}
/* Keep the old rtl since we can safely use it. */
- DECL_RTL (newdecl) = DECL_RTL (olddecl);
+ COPY_DECL_RTL (olddecl, newdecl);
/* Merge the type qualifiers. */
if (DECL_BUILT_IN_NONANSI (olddecl) && TREE_THIS_VOLATILE (olddecl)
@@ -13800,8 +13802,6 @@ duplicate_decls (tree newdecl, tree olddecl)
DECL_BUILT_IN_CLASS (newdecl) = DECL_BUILT_IN_CLASS (olddecl);
DECL_FUNCTION_CODE (newdecl) = DECL_FUNCTION_CODE (olddecl);
}
- else
- DECL_FRAME_SIZE (newdecl) = DECL_FRAME_SIZE (olddecl);
DECL_RESULT (newdecl) = DECL_RESULT (olddecl);
DECL_INITIAL (newdecl) = DECL_INITIAL (olddecl);
@@ -14330,7 +14330,7 @@ start_decl (tree decl, bool is_top_level)
if (!top_level
/* But not if this is a duplicate decl and we preserved the rtl from the
previous one (which may or may not happen). */
- && DECL_RTL (tem) == 0)
+ && !DECL_RTL_SET_P (tem))
{
if (TYPE_SIZE (TREE_TYPE (tem)) != 0)
expand_decl (tem);
@@ -15174,6 +15174,10 @@ set_block (block)
register tree block;
{
current_binding_level->this_block = block;
+ current_binding_level->names = chainon (current_binding_level->names,
+ BLOCK_VARS (block));
+ current_binding_level->blocks = chainon (current_binding_level->blocks,
+ BLOCK_SUBBLOCKS (block));
}
/* ~~gcc/tree.h *should* declare this, because toplev.c references it. */
diff --git a/gcc/f/g77.texi b/gcc/f/g77.texi
index 93d1eab0771..3fe2fb0e728 100644
--- a/gcc/f/g77.texi
+++ b/gcc/f/g77.texi
@@ -2,8 +2,8 @@
@c %**start of header
@setfilename g77.info
-@set last-update 2000-12-21
-@set copyrights-g77 1995,1996,1997,1998,1999,2000
+@set last-update 2001-06-10
+@set copyrights-g77 1995,1996,1997,1998,1999,2000,2001
@include root.texi
@@ -97,32 +97,25 @@ Boston, MA 02111-1307 USA
Copyright (C) @value{copyrights-g77} Free Software Foundation, Inc.
-Permission is granted to make and distribute verbatim copies of
-this manual provided the copyright notice and this permission notice
-are preserved on all copies.
-
-@ignore
-Permission is granted to process this file through Tex and print the
-results, provided the printed document carries copying permission
-notice identical to this one except for the removal of this paragraph
-(this paragraph not being relevant to the printed manual).
-
-@end ignore
-Permission is granted to copy and distribute modified versions of this
-manual under the conditions for verbatim copying, provided also that the
-sections entitled ``GNU General Public License,'' ``Funding for Free
-Software,'' and ``Protect Your Freedom---Fight `Look And Feel'@w{}'' are
-included exactly as in the original, and provided that the entire
-resulting derived work is distributed under the terms of a permission
-notice identical to this one.
-
-Permission is granted to copy and distribute translations of this manual
-into another language, under the above conditions for modified versions,
-except that the sections entitled ``GNU General Public License,''
-``Funding for Free Software,'' and ``Protect Your Freedom---Fight `Look
-And Feel'@w{}'', and this permission notice, may be included in
-translations approved by the Free Software Foundation instead of in the
-original English.
+
+Permission is granted to copy, distribute and/or modify this document
+under the terms of the GNU Free Documentation License, Version 1.1 or
+any later version published by the Free Software Foundation; with the
+Invariant Sections being ``GNU General Public License'' and ``Funding
+Free Software'', the Front-Cover
+texts being (a) (see below), and with the Back-Cover Texts being (b)
+(see below). A copy of the license is included in the section entitled
+``GNU Free Documentation License''.
+
+(a) The FSF's Front-Cover Text is:
+
+ A GNU Manual
+
+(b) The FSF's Back-Cover Text is:
+
+ You have freedom to copy and modify this GNU Manual, like GNU
+ software. Copies published by the Free Software Foundation raise
+ funds for GNU development.
@end ifinfo
Contributed by James Craig Burley (@email{@value{email-burley}}).
@@ -163,26 +156,27 @@ Boston, MA 02111-1307, USA@*
@c Printed copies are available for $? each.@*
@c ISBN ???
@sp 1
-Permission is granted to make and distribute verbatim copies of
-this manual provided the copyright notice and this permission notice
-are preserved on all copies.
-
-Permission is granted to copy and distribute modified versions of this
-manual under the conditions for verbatim copying, provided also that the
-sections entitled ``GNU General Public License,'' ``Funding for Free
-Software,'' and ``Protect Your Freedom---Fight `Look And Feel'@w{}'' are
-included exactly as in the original, and provided that the entire
-resulting derived work is distributed under the terms of a permission
-notice identical to this one.
-
-Permission is granted to copy and distribute translations of this manual
-into another language, under the above conditions for modified versions,
-except that the sections entitled ``GNU General Public License,''
-``Funding for Free Software,'' and ``Protect Your Freedom---Fight `Look
-And Feel'@w{}'', and this permission notice, may be included in
-translations approved by the Free Software Foundation instead of in the
-original English.
+Permission is granted to copy, distribute and/or modify this document
+under the terms of the GNU Free Documentation License, Version 1.1 or
+any later version published by the Free Software Foundation; with the
+Invariant Sections being ``GNU General Public License'' and ``Funding
+Free Software'', the Front-Cover
+texts being (a) (see below), and with the Back-Cover Texts being (b)
+(see below). A copy of the license is included in the section entitled
+``GNU Free Documentation License''.
+
+(a) The FSF's Front-Cover Text is:
+
+ A GNU Manual
+
+(b) The FSF's Back-Cover Text is:
+
+ You have freedom to copy and modify this GNU Manual, like GNU
+ software. Copies published by the Free Software Foundation raise
+ funds for GNU development.
@end titlepage
+@summarycontents
+@contents
@page
@ifinfo
@@ -234,10 +228,11 @@ most consistent with the @code{g77} product in that version.
@menu
* Copying:: GNU General Public License says
how you can copy and share GNU Fortran.
+* GNU Free Documentation License::
+ How you can copy and share this manual.
* Contributors:: People who have contributed to GNU Fortran.
* Funding:: How to help assure continued work for free software.
* Funding GNU Fortran:: How to help assure continued work on GNU Fortran.
-* Look and Feel:: Protect your freedom---fight ``look and feel''.
@ifset USING
* Getting Started:: Finding your way around this manual.
* What is GNU Fortran?:: How @code{g77} fits into the universe.
@@ -270,397 +265,9 @@ most consistent with the @code{g77} product in that version.
@end menu
@c yes, the "M: " @emph{is} intentional -- bad.def references it (CMPAMBIG)!
-@node Copying
-@unnumbered GNU GENERAL PUBLIC LICENSE
-@center Version 2, June 1991
-
-@display
-Copyright @copyright{} 1989, 1991 Free Software Foundation, Inc.
-59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
-
-Everyone is permitted to copy and distribute verbatim copies
-of this license document, but changing it is not allowed.
-@end display
-
-@unnumberedsec Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software---to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.) You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary. To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
-@iftex
-@unnumberedsec TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-@end iftex
-@ifinfo
-@center TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-@end ifinfo
-
-@enumerate 0
-@item
-This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License. The ``Program'', below,
-refers to any such program or work, and a ``work based on the Program''
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language. (Hereinafter, translation is included without limitation in
-the term ``modification''.) Each licensee is addressed as ``you''.
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
-@item
-You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
-@item
-You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
-@enumerate a
-@item
-You must cause the modified files to carry prominent notices
-stating that you changed the files and the date of any change.
-
-@item
-You must cause any work that you distribute or publish, that in
-whole or in part contains or is derived from the Program or any
-part thereof, to be licensed as a whole at no charge to all third
-parties under the terms of this License.
-
-@item
-If the modified program normally reads commands interactively
-when run, you must cause it, when started running for such
-interactive use in the most ordinary way, to print or display an
-announcement including an appropriate copyright notice and a
-notice that there is no warranty (or else, saying that you provide
-a warranty) and that users may redistribute the program under
-these conditions, and telling the user how to view a copy of this
-License. (Exception: if the Program itself is interactive but
-does not normally print such an announcement, your work based on
-the Program is not required to print an announcement.)
-@end enumerate
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
-@item
-You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
+@include gpl.texi
-@enumerate a
-@item
-Accompany it with the complete corresponding machine-readable
-source code, which must be distributed under the terms of Sections
-1 and 2 above on a medium customarily used for software interchange; or,
-
-@item
-Accompany it with a written offer, valid for at least three
-years, to give any third party, for a charge no more than your
-cost of physically performing source distribution, a complete
-machine-readable copy of the corresponding source code, to be
-distributed under the terms of Sections 1 and 2 above on a medium
-customarily used for software interchange; or,
-
-@item
-Accompany it with the information you received as to the offer
-to distribute corresponding source code. (This alternative is
-allowed only for noncommercial distribution and only if you
-received the program in object code or executable form with such
-an offer, in accord with Subsection b above.)
-@end enumerate
-
-The source code for a work means the preferred form of the work for
-making modifications to it. For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable. However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
-@item
-You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License. Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
-@item
-You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Program or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
-@item
-Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
-@item
-If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all. For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
-@item
-If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded. In such case, this License incorporates
-the limitation as if written in the body of this License.
-
-@item
-The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and ``any
-later version'', you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation. If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
-@item
-If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission. For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this. Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
-@iftex
-@heading NO WARRANTY
-@end iftex
-@ifinfo
-@center NO WARRANTY
-@end ifinfo
-
-@item
-BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM ``AS IS'' WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
-@item
-IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-@end enumerate
-
-@iftex
-@heading END OF TERMS AND CONDITIONS
-@end iftex
-@ifinfo
-@center END OF TERMS AND CONDITIONS
-@end ifinfo
-
-@page
-@unnumberedsec How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the ``copyright'' line and a pointer to where the full notice is found.
-
-@smallexample
-@var{one line to give the program's name and a brief idea of what it does.}
-Copyright (C) @var{year} @var{name of author}
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-This program 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 program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-@end smallexample
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
-@smallexample
-Gnomovision version 69, Copyright (C) @var{year} @var{name of author}
-Gnomovision comes with ABSOLUTELY NO WARRANTY; for details
-type `show w'.
-This is free software, and you are welcome to redistribute it
-under certain conditions; type `show c' for details.
-@end smallexample
-
-The hypothetical commands @samp{show w} and @samp{show c} should show
-the appropriate parts of the General Public License. Of course, the
-commands you use may be called something other than @samp{show w} and
-@samp{show c}; they could even be mouse-clicks or menu items---whatever
-suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a ``copyright disclaimer'' for the program, if
-necessary. Here is a sample; alter the names:
-
-@smallexample
-Yoyodyne, Inc., hereby disclaims all copyright interest in the program
-`Gnomovision' (which makes passes at compilers) written by James Hacker.
-
-@var{signature of Ty Coon}, 1 April 1989
-Ty Coon, President of Vice
-@end smallexample
-
-This General Public License does not permit incorporating your program into
-proprietary programs. If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Library General
-Public License instead of this License.
+@include fdl.texi
@node Contributors
@unnumbered Contributors to GNU Fortran
@@ -772,65 +379,21 @@ to see your name listed in the above list, please ask!
The default is that people wish to remain anonymous.
@end itemize
-@node Funding
-@chapter Funding Free Software
-
-If you want to have more free software a few years from now, it makes
-sense for you to help encourage people to contribute funds for its
-development. The most effective approach known is to encourage
-commercial redistributors to donate.
-
-Users of free software systems can boost the pace of development by
-encouraging for-a-fee distributors to donate part of their selling price
-to free software developers---the Free Software Foundation, and others.
-
-The way to convince distributors to do this is to demand it and expect
-it from them. So when you compare distributors, judge them partly by
-how much they give to free software development. Show distributors
-they must compete to be the one who gives the most.
-
-To make this approach work, you must insist on numbers that you can
-compare, such as, ``We will donate ten dollars to the Frobnitz project
-for each disk sold.'' Don't be satisfied with a vague promise, such as
-``A portion of the profits are donated,'' since it doesn't give a basis
-for comparison.
-
-Even a precise fraction ``of the profits from this disk'' is not very
-meaningful, since creative accounting and unrelated business decisions
-can greatly alter what fraction of the sales price counts as profit.
-If the price you pay is $50, ten percent of the profit is probably
-less than a dollar; it might be a few cents, or nothing at all.
-
-Some redistributors do development work themselves. This is useful too;
-but to keep everyone honest, you need to inquire how much they do, and
-what kind. Some kinds of development make much more long-term
-difference than others. For example, maintaining a separate version of
-a program contributes very little; maintaining the standard version of a
-program for the whole community contributes much. Easy new ports
-contribute little, since someone else would surely do them; difficult
-ports such as adding a new CPU to the GNU C compiler contribute more;
-major new features or packages contribute the most.
-
-By establishing the idea that supporting further development is ``the
-proper thing to do'' when distributing free software for a fee, we can
-assure a steady flow of resources into making more free software.
-
-@display
-Copyright (C) 1994 Free Software Foundation, Inc.
-Verbatim copying and redistribution of this section is permitted
-without royalty; alteration is not permitted.
-@end display
+@include funding.texi
@node Funding GNU Fortran
@chapter Funding GNU Fortran
@cindex funding improvements
@cindex improvements, funding
-Work on GNU Fortran is still being done mostly by its author,
-James Craig Burley (@email{@value{email-burley}}), who is a volunteer
-for, not an employee of, the Free Software Foundation (FSF).
+James Craig Burley (@email{@value{email-burley}}), the original author
+of g77, stopped working on it in September 1999
(He has a web page at @uref{@value{www-burley}}.)
+GNU Fortran is currently maintained by Toon Moene
+(@email{toon@@moene.indiv.nluug.nl}), with the help of countless other
+volunteers.
+
As with other GNU software, funding is important because it can pay for
needed equipment, personnel, and so on.
@@ -841,36 +404,6 @@ development of GNU software (such as GNU Fortran) in documents
such as the ``GNUS Bulletin''.
Email @email{gnu@@gnu.org} for information on funding the FSF.
-To fund specific GNU Fortran work in particular, the FSF might
-provide a means for that, but the FSF does not provide direct funding
-to the author of GNU Fortran to continue his work. The FSF has
-employee salary restrictions that can be incompatible with the
-financial needs of some volunteers, who therefore choose to
-remain volunteers and thus be able to be free to do contract work
-and otherwise make their own schedules for doing GNU work.
-
-Still, funding the FSF at least indirectly benefits work
-on specific projects like GNU Fortran because it ensures the
-continuing operation of the FSF offices, their workstations, their
-network connections, and so on, which are invaluable to volunteers.
-(Similarly, hiring Cygnus Support can help a project like GNU
-Fortran---Cygnus has been a long-time donor of equipment usage to the author
-of GNU Fortran, and this too has been invaluable---see @ref{Contributors}.)
-
-Currently, the only way to directly fund the author of GNU Fortran
-in his work on that project is to hire him for the work you want
-him to do, or donate money to him.
-Several people have done this
-already, with the result that he has not needed to immediately find
-contract work on a few occasions.
-If more people did this, he
-would be able to plan on not doing contract work for many months and
-could thus devote that time to work on projects (such as the planned
-changes for 0.6) that require longer timeframes to complete.
-For the latest information on the status of the author, do
-@kbd{finger -l burley@@gnu.org} on a UNIX system
-(or any system with a command like UNIX @code{finger}).
-
Another important way to support work on GNU Fortran is to volunteer
to help out.
Work is needed on documentation, testing, porting
@@ -881,18 +414,6 @@ Email @email{@value{email-general}} to volunteer for this work.
@xref{Funding,,Funding Free Software}, for more information.
-@node Look and Feel
-@chapter Protect Your Freedom---Fight ``Look And Feel''
-@c the above chapter heading overflows onto the next line. --mew 1/26/93
-
-To preserve the ability to write free software, including replacements
-for proprietary software, authors must be free to replicate the
-user interface to which users of existing software have become
-accustomed.
-
-@xref{Look and Feel,,Protect Your Freedom---Fight ``Look And Feel'',
-gcc,Using and Porting GNU CC}, for more information.
-
@node Getting Started
@chapter Getting Started
@cindex getting started
@@ -1403,7 +924,8 @@ by type. Explanations are in the following sections.
-fintrin-case-lower -fintrin-case-any
-fmatch-case-initcap -fmatch-case-upper
-fmatch-case-lower -fmatch-case-any
--fsource-case-upper -fsource-case-lower -fsource-case-preserve
+-fsource-case-upper -fsource-case-lower
+-fsource-case-preserve
-fsymbol-case-initcap -fsymbol-case-upper
-fsymbol-case-lower -fsymbol-case-any
-fcase-strict-upper -fcase-strict-lower
@@ -1429,7 +951,7 @@ by type. Explanations are in the following sections.
@xref{Warning Options,,Options to Request or Suppress Warnings}.
@smallexample
-fsyntax-only -pedantic -pedantic-errors -fpedantic
--w -Wno-globals -Wimplicit -Wunused -Wuninitialized
+-w -Wno-globals -Wimplicit -Wunused -Wuninitialized
-Wall -Wsurprising
-Werror -W
@end smallexample
@@ -10417,9 +9939,46 @@ that a compile-time option to @code{g77} or @code{f2c} could
result in generating the appropriate calls to flushing or
non-flushing library routines.)
-@xref{Always Flush Output}, for information on how to modify
-the @code{g77} source tree so that a version of @code{libg2c}
-can be built and installed with the @code{ALWAYS_FLUSH} macro defined.
+Some Fortran programs require output
+(writes) to be flushed to the operating system (under UNIX,
+via the @code{fflush()} library call) so that errors,
+such as disk full, are immediately flagged via the relevant
+@code{ERR=} and @code{IOSTAT=} mechanism, instead of such
+errors being flagged later as subsequent writes occur, forcing
+the previously written data to disk, or when the file is
+closed.
+
+Essentially, the difference can be viewed as synchronous error
+reporting (immediate flagging of errors during writes) versus
+asynchronous, or, more precisely, buffered error reporting
+(detection of errors might be delayed).
+
+@code{libg2c} supports flagging write errors immediately when
+it is built with the @code{ALWAYS_FLUSH} macro defined.
+This results in a @code{libg2c} that runs slower, sometimes
+quite a bit slower, under certain circumstances---for example,
+accessing files via the networked file system NFS---but the
+effect can be more reliable, robust file I/O.
+
+If you know that Fortran programs requiring this level of precision
+of error reporting are to be compiled using the
+version of @code{g77} you are building, you might wish to
+modify the @code{g77} source tree so that the version of
+@code{libg2c} is built with the @code{ALWAYS_FLUSH} macro
+defined, enabling this behavior.
+
+To do this, find this line in @file{@value{path-libf2c}/f2c.h} in
+your @code{g77} source tree:
+
+@example
+/* #define ALWAYS_FLUSH */
+@end example
+
+Remove the leading @samp{/*@w{ }},
+so the line begins with @samp{#define},
+and the trailing @samp{@w{ }*/}.
+
+Then build or rebuild @code{g77} as appropriate.
@node Large File Unit Numbers
@subsection Large File Unit Numbers
@@ -10443,17 +10002,41 @@ macro named @code{MXUNIT}.
If you can easily change your program to use unit numbers
in the range 0 through 99, you should do so.
-Otherwise, see @ref{Larger File Unit Numbers}, for information on how
-to change @code{MXUNIT} in @code{libg2c} so you can build and
-install a new version of @code{libg2c} that supports the larger
-unit numbers you need.
+As distributed, whether as part of @code{f2c} or @code{g77},
+@code{libf2c} accepts file unit numbers only in the range
+0 through 99.
+For example, a statement such as @samp{WRITE (UNIT=100)} causes
+a run-time crash in @code{libf2c}, because the unit number,
+100, is out of range.
-@emph{Note:} While @code{libg2c} places a limit on the range
-of Fortran file-unit numbers, the underlying library and operating
-system might impose different kinds of limits.
-For example, some systems limit the number of files simultaneously
-open by a running program.
-Information on how to increase these limits should be found
+If you know that Fortran programs at your installation require
+the use of unit numbers higher than 99, you can change the
+value of the @code{MXUNIT} macro, which represents the maximum unit
+number, to an appropriately higher value.
+
+To do this, edit the file @file{@value{path-libf2c}/libI77/fio.h} in your
+@code{g77} source tree, changing the following line:
+
+@example
+#define MXUNIT 100
+@end example
+
+Change the line so that the value of @code{MXUNIT} is defined to be
+at least one @emph{greater} than the maximum unit number used by
+the Fortran programs on your system.
+
+(For example, a program that does @samp{WRITE (UNIT=255)} would require
+@code{MXUNIT} set to at least 256 to avoid crashing.)
+
+Then build or rebuild @code{g77} as appropriate.
+
+@emph{Note:} Changing this macro has @emph{no} effect on other limits
+your system might place on the number of files open at the same time.
+That is, the macro might allow a program to do @samp{WRITE (UNIT=100)},
+but the library and operating system underlying @code{libf2c} might
+disallow it if many other files have already been opened (via @code{OPEN} or
+implicitly via @code{READ}, @code{WRITE}, and so on).
+Information on how to increase these other limits should be found
in your system's documentation.
@node Floating-point precision
@@ -10823,10 +10406,6 @@ Some of these problems are due to bugs in other software, some are
missing features that are too much work to add, and some are places
where people's opinions differ as to what is best.
-Information on bugs that show up when configuring, porting, building,
-or installing @code{g77} is not provided here.
-@xref{Problems Installing}.
-
To find out about major bugs discovered in the current release and
possible workarounds for them, see
@uref{ftp://alpha.gnu.org/g77.plan}.
@@ -11090,9 +10669,26 @@ You might be able to work around the problem by compiling with the
@samp{-fno-automatic} option to reduce stack usage, probably at the
expense of speed.
-@xref{Maximum Stackable Size}, for information on patching
-@code{g77} to use different criteria for placing local
-non-automatic variables and arrays on the stack.
+@code{g77}, on most machines, puts many variables and arrays on the stack
+where possible, and can be configured (by changing
+@code{FFECOM_sizeMAXSTACKITEM} in @file{@value{path-g77}/com.c}) to force
+smaller-sized entities into static storage (saving
+on stack space) or permit larger-sized entities to be put on the
+stack (which can improve run-time performance, as it presents
+more opportunities for the GBE to optimize the generated code).
+
+@emph{Note:} Putting more variables and arrays on the stack
+might cause problems due to system-dependent limits on stack size.
+Also, the value of @code{FFECOM_sizeMAXSTACKITEM} has no
+effect on automatic variables and arrays.
+@xref{But-bugs}, for more information.
+@emph{Note:} While @code{libg2c} places a limit on the range
+of Fortran file-unit numbers, the underlying library and operating
+system might impose different kinds of limits.
+For example, some systems limit the number of files simultaneously
+open by a running program.
+Information on how to increase these limits should be found
+in your system's documentation.
@cindex automatic arrays
@cindex arrays, automatic
@@ -13192,7 +12788,6 @@ information that makes for fixing the bug.
* Criteria: Bug Criteria. Have you really found a bug?
* Where: Bug Lists. Where to send your bug report.
* Reporting: Bug Reporting. How to report a bug effectively.
-* Patches: Sending Patches. How to send a patch for GNU Fortran.
@end menu
@xref{Trouble,,Known Causes of Trouble with GNU Fortran},
@@ -13707,7 +13302,8 @@ And if we can't understand what bug you are trying to fix, or why your
patch should be an improvement, we won't install it. A test case will
help us to understand.
-@xref{Sending Patches}, for guidelines on how to make it easy for us to
+See @uref{http://gcc.gnu.org/contribute.html}
+for guidelines on how to make it easy for us to
understand and install your patches.
@item
@@ -13724,124 +13320,6 @@ unless we have an identical system---and if we do have one,
we should be able to reproduce the crash ourselves.
@end itemize
-@node Sending Patches
-@section Sending Patches for GNU Fortran
-
-If you would like to write bug fixes or improvements for the GNU Fortran
-compiler, that is very helpful.
-Send suggested fixes to the bug report
-mailing list, @email{@value{email-bugs}}.
-
-Please follow these guidelines so we can study your patches efficiently.
-If you don't follow these guidelines, your information might still be
-useful, but using it will take extra work. Maintaining GNU Fortran is a lot
-of work in the best of circumstances, and we can't keep up unless you do
-your best to help.
-
-@itemize @bullet
-@item
-Send an explanation with your changes of what problem they fix or what
-improvement they bring about. For a bug fix, just include a copy of the
-bug report, and explain why the change fixes the bug.
-
-(Referring to a bug report is not as good as including it, because then
-we will have to look it up, and we have probably already deleted it if
-we've already fixed the bug.)
-
-@item
-Always include a proper bug report for the problem you think you have
-fixed. We need to convince ourselves that the change is right before
-installing it. Even if it is right, we might have trouble judging it if
-we don't have a way to reproduce the problem.
-
-@item
-Include all the comments that are appropriate to help people reading the
-source in the future understand why this change was needed.
-
-@item
-Don't mix together changes made for different reasons.
-Send them @emph{individually}.
-
-If you make two changes for separate reasons, then we might not want to
-install them both. We might want to install just one. If you send them
-all jumbled together in a single set of diffs, we have to do extra work
-to disentangle them---to figure out which parts of the change serve
-which purpose. If we don't have time for this, we might have to ignore
-your changes entirely.
-
-If you send each change as soon as you have written it, with its own
-explanation, then the two changes never get tangled up, and we can
-consider each one properly without any extra work to disentangle them.
-
-Ideally, each change you send should be impossible to subdivide into
-parts that we might want to consider separately, because each of its
-parts gets its motivation from the other parts.
-
-@item
-Send each change as soon as that change is finished. Sometimes people
-think they are helping us by accumulating many changes to send them all
-together. As explained above, this is absolutely the worst thing you
-could do.
-
-Since you should send each change separately, you might as well send it
-right away. That gives us the option of installing it immediately if it
-is important.
-
-@item
-Use @samp{diff -c} to make your diffs. Diffs without context are hard
-for us to install reliably. More than that, they make it hard for us to
-study the diffs to decide whether we want to install them. Unidiff
-format is better than contextless diffs, but not as easy to read as
-@samp{-c} format.
-
-If you have GNU @code{diff}, use @samp{diff -cp}, which shows the name of the
-function that each change occurs in.
-(The maintainer of GNU Fortran currently uses @samp{diff -rcp2N}.)
-
-@item
-Write the change log entries for your changes. We get lots of changes,
-and we don't have time to do all the change log writing ourselves.
-
-Read the @file{ChangeLog} file to see what sorts of information to put
-in, and to learn the style that we use. The purpose of the change log
-is to show people where to find what was changed. So you need to be
-specific about what functions you changed; in large functions, it's
-often helpful to indicate where within the function the change was.
-
-On the other hand, once you have shown people where to find the change,
-you need not explain its purpose. Thus, if you add a new function, all
-you need to say about it is that it is new. If you feel that the
-purpose needs explaining, it probably does---but the explanation will be
-much more useful if you put it in comments in the code.
-
-If you would like your name to appear in the header line for who made
-the change, send us the header line.
-
-@item
-When you write the fix, keep in mind that we can't install a change that
-would break other systems.
-
-People often suggest fixing a problem by changing machine-independent
-files such as @file{toplev.c} to do something special that a particular
-system needs. Sometimes it is totally obvious that such changes would
-break GNU Fortran for almost all users. We can't possibly make a change like
-that. At best it might tell us how to write another patch that would
-solve the problem acceptably.
-
-Sometimes people send fixes that @emph{might} be an improvement in
-general---but it is hard to be sure of this. It's hard to install
-such changes because we have to study them very carefully. Of course,
-a good explanation of the reasoning by which you concluded the change
-was correct can help convince us.
-
-The safest changes are changes to the configuration files for a
-particular machine. These are safe because they can't create new bugs
-on other machines.
-
-Please help us keep up with the workload by designing the patch in a
-form that is good to install.
-@end itemize
-
@node Service
@chapter How To Get Help with GNU Fortran
@@ -13855,7 +13333,7 @@ The service directory is found in the file named @file{SERVICE} in the
GNU CC distribution.
@item
-Send a message to @email{@value{email-general}}.
+Send a message to @email{@value{email-help}}.
@end itemize
@end ifset
@@ -15051,20 +14529,6 @@ without exhibiting any other outward manifestations of the bugs.
@section @code{LINKFAIL}
@noindent
-@smallexample
-If the above command failed due to an unresolved reference
-to strtoul, _strtoul, bsearch, _bsearch, or similar, see
-[info -f g77 M LINKFAIL] (a node in the g77 documentation)
-for information on what causes this, how to work around
-the problem by editing $@{srcdir@}/proj.c, and what else to do.
-@end smallexample
-
-@xref{Missing strtoul or bsearch}, for more information on
-this problem,
-which occurs only in releases of @code{g77}
-based on @code{gcc}.
-(It did not occur in @code{egcs}.)
-
On AIX 4.1, @code{g77} might not build with the native (non-GNU) tools
due to a linker bug in coping with the @samp{-bbigtoc} option which
leads to a @samp{Relocation overflow} error. The GNU linker is not
@@ -15102,6 +14566,4 @@ that is not Year-2000 (Y2K) compliant.
@unnumbered Index
@printindex cp
-@summarycontents
-@contents
@bye
diff --git a/gcc/f/g77install.texi b/gcc/f/g77install.texi
index 3161aee4e9a..b347d7c3bfc 100644
--- a/gcc/f/g77install.texi
+++ b/gcc/f/g77install.texi
@@ -1,8 +1,8 @@
-@c Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+@c Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
@c This is part of the G77 manual.
@c For copying conditions, see the file g77.texi.
-@set last-update-install 2000-12-21
+@set last-update-install 2001-06-10
@include root.texi
@@ -10,502 +10,5 @@
@chapter Installing GNU Fortran
@cindex installing, GNU Fortran
-The following information describes how to install @code{g77}.
-
-Note that, for users of the @value{which-g77} version of @code{g77},
-much of the information is obsolete,
-and is superseded by the
-@value{which-gcc} installation procedures.
-Such information is accordingly omitted and flagged as such.
-
-@ifset DEVELOPMENT
-@emph{Warning:} The information below is still under development,
-and might not accurately reflect the @code{g77} code base
-of which it is a part.
-Efforts are made to keep it somewhat up-to-date,
-but they are particularly concentrated
-on any version of this information
-that is distributed as part of a @emph{released} @code{g77}.
-
-In particular, while this information is intended to apply to
-the @value{which-g77} version of @code{g77},
-only an official @emph{release} of that version
-is expected to contain documentation that is
-most consistent with the @code{g77} product in that version.
-@end ifset
-
-The following information was last updated on @value{last-update-install}:
-
-@menu
-* Prerequisites:: Make sure your system is ready for @code{g77}.
-* Problems Installing:: Known trouble areas.
-* Settings:: Changing @code{g77} internals before building.
-* Quick Start:: The easier procedure for non-experts.
-* Complete Installation:: For experts, or those who want to be: the details.
-* Distributing Binaries:: If you plan on distributing your @code{g77}.
-@end menu
-
-@node Prerequisites
-@section Prerequisites
-@cindex prerequisites
-
-For users of the @value{which-g77} version of @code{g77},
-this information is superseded by the
-@value{which-gcc} installation instructions.
-
-@node Problems Installing
-@section Problems Installing
-@cindex problems installing
-@cindex installation problems
-
-This is a list of problems (and some apparent problems which don't
-really mean anything is wrong) that show up when configuring,
-building, installing, or porting GNU Fortran.
-
-@xref{Installation Problems,,,gcc,Using and Porting GNU CC},
-for more information on installation problems that can afflict
-either @code{gcc} or @code{g77}.
-
-@menu
-* General Problems:: Problems afflicting most or all systems.
-* System-specific Problems:: Problems afflicting particular systems.
-* Cross-compiler Problems:: Problems afflicting cross-compilation setups.
-@end menu
-
-@node General Problems
-@subsection General Problems
-
-These problems can occur on most or all systems.
-
-@menu
-* GNU C Required:: Why even ANSI C is not enough.
-* Patching GNU CC:: Why @code{gcc} needn't be patched.
-* Building GNU CC Necessary:: Why you can't build @emph{just} Fortran.
-* Missing strtoul or bsearch:: When linking @code{f771} fails.
-* Cleanup Kills Stage Directories:: For @code{g77} developers.
-* LANGUAGES Macro Ignored:: Sometimes @code{LANGUAGES} is ignored.
-@end menu
-
-@node GNU C Required
-@subsubsection GNU C Required
-@cindex GNU C required
-@cindex requirements, GNU C
-
-Compiling @code{g77} requires GNU C, not just ANSI C.
-Fixing this wouldn't
-be very hard (just tedious), but the code using GNU extensions to
-the C language is expected to be rewritten for 0.6 anyway,
-so there are no plans for an interim fix.
-
-This requirement does not mean you must already have @code{gcc}
-installed to build @code{g77}.
-As long as you have a working C compiler, you can use a
-``bootstrap'' build to automate the process of first building
-@code{gcc} using the working C compiler you have, then building
-@code{g77} and rebuilding @code{gcc} using that just-built @code{gcc},
-and so on.
-
-@node Patching GNU CC
-@subsubsection Patching GNU CC
-@cindex patch files
-@cindex GBE
-
-@code{g77} no longer requires application of a patch file
-to the @code{gcc} compiler tree.
-In fact, no such patch file is distributed with @code{g77}.
-This is as of version 0.5.23
-and @code{egcs} version 1.0.
-
-@node Building GNU CC Necessary
-@subsubsection Building GNU CC Necessary
-@cindex @code{gcc}, building
-@cindex building gcc
-
-It should be possible to build the runtime without building @code{cc1}
-and other non-Fortran items, but, for now, an easy way to do that
-is not yet established.
-
-@node Missing strtoul or bsearch
-@subsubsection Missing strtoul or bsearch
-@cindex bsearch
-@cindex _bsearch
-@cindex strtoul
-@cindex _strtoul
-@cindex undefined reference (_bsearch)
-@cindex undefined reference (_strtoul)
-@cindex f771, linking error for
-@cindex linking error for f771
-@cindex @code{ld}, error linking f771
-@cindex @code{ld}, can't find _bsearch
-@cindex @code{ld}, can't find _strtoul
-@cindex SunOS4
-
-This information does not apply to
-the @value{which-g77} version of @code{g77},
-
-@node Cleanup Kills Stage Directories
-@subsubsection Cleanup Kills Stage Directories
-@cindex stage directories
-@cindex make clean
-
-It'd be helpful if @code{g77}'s @file{Makefile.in} or @file{Make-lang.in}
-would create the various @file{stage@var{n}} directories and their
-subdirectories, so developers and expert installers wouldn't have to
-reconfigure after cleaning up.
-
-That help has arrived as of version 0.5.23 of @code{g77}
-and version 1.1 of @code{egcs}.
-Configuration itself no longer creates any particular directories
-that are unique to @code{g77}.
-The build procedures in @file{Make-lang.in} take care of
-that, on demand.
-
-@node LANGUAGES Macro Ignored
-@subsubsection LANGUAGES Macro Ignored
-@cindex @code{LANGUAGES} macro ignored
-@cindex ignoring @code{LANGUAGES} macro
-
-Prior to version 0.5.23 of @code{g77}
-and version 1.1 of @code{egcs},
-@code{g77} would sometimes ignore
-the absence of @code{f77} and @code{F77} in the
-@code{LANGUAGES} macro definition used for the
-@code{make} command being processed.
-
-As of @code{g77} version 0.5.23
-and @code{egcs} version 1.1,
-@code{g77} now obeys this macro
-in all relevant situations.
-
-However, in versions of @code{gcc} through 2.8.1,
-non-@code{g77} portions of @code{gcc},
-such as @code{g++},
-are known to go ahead and perform various
-language-specific activities when their
-respective language strings do not appear
-in the @code{LANGUAGES} macro in effect
-during that invocation of @code{make}.
-
-It is expected that these remaining problems will
-be fixed in a future version of @code{gcc}.
-
-@node System-specific Problems
-@subsection System-specific Problems
-
-@cindex AIX
-A linker bug on some versions of AIX 4.1 might prevent building
-when @code{g77} is built within @code{gcc}.
-@xref{LINKFAIL}.
-
-@node Cross-compiler Problems
-@subsection Cross-compiler Problems
-@cindex cross-compiler, problems
-
-@code{g77} has been in alpha testing since September of
-1992, and in public beta testing since February of 1995.
-Alpha testing was done by a small number of people worldwide on a fairly
-wide variety of machines, involving self-compilation in most or
-all cases.
-Beta testing has been done primarily via self-compilation,
-but in more and more cases, cross-compilation (and ``criss-cross
-compilation'', where a version of a compiler is built on one machine
-to run on a second and generate code that runs on a third) has
-been tried and has succeeded, to varying extents.
-
-Generally, @code{g77} can be ported to any configuration to which
-@code{gcc}, @code{f2c}, and @code{libf2c} can be ported and made
-to work together, aside from the known problems described in this
-manual.
-If you want to port @code{g77} to a particular configuration,
-you should first make sure @code{gcc} and @code{libf2c} can be
-ported to that configuration before focusing on @code{g77}, because
-@code{g77} is so dependent on them.
-
-Even for cases where @code{gcc} and @code{libf2c} work,
-you might run into problems with cross-compilation on certain machines,
-for several reasons.
-
-@itemize @bullet
-@item
-There is one known bug
-(a design bug to be fixed in 0.6) that prevents configuration of
-@code{g77} as a cross-compiler in some cases,
-though there are assumptions made during
-configuration that probably make doing non-self-hosting builds
-a hassle, requiring manual intervention.
-
-@item
-@code{gcc} might still have some trouble being configured
-for certain combinations of machines.
-For example, it might not know how to handle floating-point
-constants.
-
-@item
-Improvements to the way @code{libg2c} is built could make
-building @code{g77} as a cross-compiler easier---for example,
-passing and using @samp{$(LD)} and @samp{$(AR)} in the appropriate
-ways.
-(This was improved in the @code{egcs} version of @code{g77},
-especially as of version 1.1.)
-
-@item
-There are still some challenges putting together the right
-run-time libraries (needed by @code{libg2c}) for a target
-system, depending on the systems involved in the configuration.
-(This is a general problem with cross-compilation, and with
-@code{gcc} in particular.)
-@end itemize
-
-@node Settings
-@section Changing Settings Before Building
-
-Here are some internal @code{g77} settings that can be changed
-by editing source files in @file{@value{path-g77}/} before building.
-
-This information, and perhaps even these settings, represent
-stop-gap solutions to problems people doing various ports
-of @code{g77} have encountered.
-As such, none of the following information is expected to
-be pertinent in future versions of @code{g77}.
-
-@menu
-* Larger File Unit Numbers:: Raising @code{MXUNIT}.
-* Always Flush Output:: Synchronizing write errors.
-* Maximum Stackable Size:: Large arrays forced off the stack.
-* Floating-point Bit Patterns:: Possible programs building @code{g77}
- as a cross-compiler.
-* Large Initialization:: Large arrays with @code{DATA}
- initialization.
-* Alpha Problems Fixed:: Problems with 64-bit systems like
- Alphas now fixed?
-@end menu
-
-@node Larger File Unit Numbers
-@subsection Larger File Unit Numbers
-@cindex MXUNIT
-@cindex unit numbers
-@cindex maximum unit number
-@cindex illegal unit number
-@cindex increasing maximum unit number
-
-As distributed, whether as part of @code{f2c} or @code{g77},
-@code{libf2c} accepts file unit numbers only in the range
-0 through 99.
-For example, a statement such as @samp{WRITE (UNIT=100)} causes
-a run-time crash in @code{libf2c}, because the unit number,
-100, is out of range.
-
-If you know that Fortran programs at your installation require
-the use of unit numbers higher than 99, you can change the
-value of the @code{MXUNIT} macro, which represents the maximum unit
-number, to an appropriately higher value.
-
-To do this, edit the file @file{@value{path-libf2c}/libI77/fio.h} in your
-@code{g77} source tree, changing the following line:
-
-@example
-#define MXUNIT 100
-@end example
-
-Change the line so that the value of @code{MXUNIT} is defined to be
-at least one @emph{greater} than the maximum unit number used by
-the Fortran programs on your system.
-
-(For example, a program that does @samp{WRITE (UNIT=255)} would require
-@code{MXUNIT} set to at least 256 to avoid crashing.)
-
-Then build or rebuild @code{g77} as appropriate.
-
-@emph{Note:} Changing this macro has @emph{no} effect on other limits
-your system might place on the number of files open at the same time.
-That is, the macro might allow a program to do @samp{WRITE (UNIT=100)},
-but the library and operating system underlying @code{libf2c} might
-disallow it if many other files have already been opened (via @code{OPEN} or
-implicitly via @code{READ}, @code{WRITE}, and so on).
-Information on how to increase these other limits should be found
-in your system's documentation.
-
-@node Always Flush Output
-@subsection Always Flush Output
-@cindex ALWAYS_FLUSH
-@cindex synchronous write errors
-@cindex disk full
-@cindex flushing output
-@cindex fflush()
-@cindex I/O, flushing
-@cindex output, flushing
-@cindex writes, flushing
-@cindex NFS
-@cindex network file system
-
-Some Fortran programs require output
-(writes) to be flushed to the operating system (under UNIX,
-via the @code{fflush()} library call) so that errors,
-such as disk full, are immediately flagged via the relevant
-@code{ERR=} and @code{IOSTAT=} mechanism, instead of such
-errors being flagged later as subsequent writes occur, forcing
-the previously written data to disk, or when the file is
-closed.
-
-Essentially, the difference can be viewed as synchronous error
-reporting (immediate flagging of errors during writes) versus
-asynchronous, or, more precisely, buffered error reporting
-(detection of errors might be delayed).
-
-@code{libg2c} supports flagging write errors immediately when
-it is built with the @code{ALWAYS_FLUSH} macro defined.
-This results in a @code{libg2c} that runs slower, sometimes
-quite a bit slower, under certain circumstances---for example,
-accessing files via the networked file system NFS---but the
-effect can be more reliable, robust file I/O.
-
-If you know that Fortran programs requiring this level of precision
-of error reporting are to be compiled using the
-version of @code{g77} you are building, you might wish to
-modify the @code{g77} source tree so that the version of
-@code{libg2c} is built with the @code{ALWAYS_FLUSH} macro
-defined, enabling this behavior.
-
-To do this, find this line in @file{@value{path-libf2c}/f2c.h} in
-your @code{g77} source tree:
-
-@example
-/* #define ALWAYS_FLUSH */
-@end example
-
-Remove the leading @samp{/*@w{ }},
-so the line begins with @samp{#define},
-and the trailing @samp{@w{ }*/}.
-
-Then build or rebuild @code{g77} as appropriate.
-
-@node Maximum Stackable Size
-@subsection Maximum Stackable Size
-@vindex FFECOM_sizeMAXSTACKITEM
-@cindex code, stack variables
-@cindex maximum stackable size
-@cindex stack, allocation
-@cindex segmentation violation
-@code{g77}, on most machines, puts many variables and arrays on the stack
-where possible, and can be configured (by changing
-@code{FFECOM_sizeMAXSTACKITEM} in @file{@value{path-g77}/com.c}) to force
-smaller-sized entities into static storage (saving
-on stack space) or permit larger-sized entities to be put on the
-stack (which can improve run-time performance, as it presents
-more opportunities for the GBE to optimize the generated code).
-
-@emph{Note:} Putting more variables and arrays on the stack
-might cause problems due to system-dependent limits on stack size.
-Also, the value of @code{FFECOM_sizeMAXSTACKITEM} has no
-effect on automatic variables and arrays.
-@xref{But-bugs}, for more information.
-
-@node Floating-point Bit Patterns
-@subsection Floating-point Bit Patterns
-
-@cindex cross-compiler, building
-@cindex floating-point bit patterns
-@cindex bit patterns
-The @code{g77} build will crash if an attempt is made to build
-it as a cross-compiler
-for a target when @code{g77} cannot reliably determine the bit pattern of
-floating-point constants for the target.
-Planned improvements for version 0.6 of @code{g77}
-will give it the capabilities it needs to not have to crash the build
-but rather generate correct code for the target.
-(Currently, @code{g77}
-would generate bad code under such circumstances if it didn't crash
-during the build, e.g. when compiling a source file that does
-something like @samp{EQUIVALENCE (I,R)} and @samp{DATA R/9.43578/}.)
-
-@node Large Initialization
-@subsection Initialization of Large Aggregate Areas
-
-@cindex speed, of compiler
-@cindex slow compiler
-@cindex memory utilization
-@cindex large initialization
-@cindex aggregate initialization
-A warning message is issued when @code{g77} sees code that provides
-initial values (e.g. via @code{DATA}) to an aggregate area (@code{COMMON}
-or @code{EQUIVALENCE}, or even a large enough array or @code{CHARACTER}
-variable)
-that is large enough to increase @code{g77}'s compile time by roughly
-a factor of 10.
-
-This size currently is quite small, since @code{g77}
-currently has a known bug requiring too much memory
-and time to handle such cases.
-In @file{@value{path-g77}/data.c}, the macro
-@code{FFEDATA_sizeTOO_BIG_INIT_} is defined
-to the minimum size for the warning to appear.
-The size is specified in storage units,
-which can be bytes, words, or whatever, on a case-by-case basis.
-
-After changing this macro definition, you must
-(of course) rebuild and reinstall @code{g77} for
-the change to take effect.
-
-Note that, as of version 0.5.18, improvements have
-reduced the scope of the problem for @emph{sparse}
-initialization of large arrays, especially those
-with large, contiguous uninitialized areas.
-However, the warning is issued at a point prior to
-when @code{g77} knows whether the initialization is sparse,
-and delaying the warning could mean it is produced
-too late to be helpful.
-
-Therefore, the macro definition should not be adjusted to
-reflect sparse cases.
-Instead, adjust it to generate the warning when densely
-initialized arrays begin to cause responses noticeably slower
-than linear performance would suggest.
-
-@node Alpha Problems Fixed
-@subsection Alpha Problems Fixed
-
-@cindex Alpha, support
-@cindex 64-bit systems
-@code{g77} used to warn when it was used to compile Fortran code
-for a target configuration that is not basically a 32-bit
-machine (such as an Alpha, which is a 64-bit machine, especially
-if it has a 64-bit operating system running on it).
-That was because @code{g77} was known to not work
-properly on such configurations.
-
-As of version 0.5.20, @code{g77} is believed to work well
-enough on such systems.
-So, the warning is no longer needed or provided.
-
-However, support for 64-bit systems, especially in
-areas such as cross-compilation and handling of
-intrinsics, is still incomplete.
-The symptoms
-are believed to be compile-time diagnostics rather
-than the generation of bad code.
-It is hoped that version 0.6 will completely support 64-bit
-systems.
-
-@node Quick Start
-@section Quick Start
-@cindex quick start
-
-For users of the @value{which-g77} version of @code{g77},
-this information is superseded by the
-@value{which-gcc} installation instructions.
-
-@node Complete Installation
-@section Complete Installation
-
-For users of the @value{which-g77} version of @code{g77},
-this information is superseded by the
-@value{which-gcc} installation instructions.
-
-@node Distributing Binaries
-@section Distributing Binaries
-@cindex binaries, distributing
-@cindex code, distributing
-
-For users of the @value{which-g77} version of @code{g77},
-this information is superseded by the
-@value{which-gcc} installation instructions.
+The information describing how to install @code{g77} is contained
+in the @value{which-gcc} installation procedures.
diff --git a/gcc/f/intdoc.c b/gcc/f/intdoc.c
index cc18f03cdb4..4c6dcb6108d 100644
--- a/gcc/f/intdoc.c
+++ b/gcc/f/intdoc.c
@@ -26,17 +26,6 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "system.h"
#include "assert.h"
-typedef enum
- {
-#if !defined(false) || !defined(true)
- false = 0, true = 1,
-#endif
-#if !defined(FALSE) || !defined(TRUE)
- FALSE = 0, TRUE = 1,
-#endif
- Doggone_Trailing_Comma_Dont_Work = 1
- } bool;
-
/* Pull in the intrinsics info, but only the doc parts. */
#define FFEINTRIN_DOC 1
#include "intrin.h"
diff --git a/gcc/f/lang-options.h b/gcc/f/lang-options.h
index 7d501938d7f..a74028342bf 100644
--- a/gcc/f/lang-options.h
+++ b/gcc/f/lang-options.h
@@ -29,135 +29,212 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
DEFINE_LANG_NAME ("Fortran")
- { "-fversion", "Print g77-specific compiler version info, run internal tests" },
+ { "-fversion",
+ N_("Print g77-specific compiler version info, run internal tests") },
{ "-fnull-version", "" },
/*"-fident",*/
/*"-fno-ident",*/
- { "-ff66", "Program is written in typical FORTRAN 66 dialect" },
+ { "-ff66",
+ N_("Program is written in typical FORTRAN 66 dialect") },
{ "-fno-f66", "" },
- { "-ff77", "Program is written in typical Unix f77 dialect" },
- { "-fno-f77", "Program does not use Unix-f77 dialectal features" },
- { "-ff90", "Program is written in Fortran-90-ish dialect" },
+ { "-ff77",
+ N_("Program is written in typical Unix f77 dialect") },
+ { "-fno-f77",
+ N_("Program does not use Unix-f77 dialectal features") },
+ { "-ff90",
+ N_("Program is written in Fortran-90-ish dialect") },
{ "-fno-f90", "" },
{ "-fautomatic", "" },
- { "-fno-automatic", "Treat local vars and COMMON blocks as if they were named in SAVE statements" },
- { "-fdollar-ok", "Allow $ in symbol names" },
+ { "-fno-automatic",
+ N_("Treat local vars and COMMON blocks as if they were named in SAVE statements") },
+ { "-fdollar-ok",
+ N_("Allow $ in symbol names") },
{ "-fno-dollar-ok", "" },
{ "-ff2c", "" },
- { "-fno-f2c", "f2c-compatible code need not be generated" },
+ { "-fno-f2c",
+ N_("f2c-compatible code need not be generated") },
{ "-ff2c-library", "" },
- { "-fno-f2c-library", "Unsupported; do not generate libf2c-calling code" },
- { "-fflatten-arrays", "Unsupported; affects code-generation of arrays" },
+ { "-fno-f2c-library",
+ N_("Unsupported; do not generate libf2c-calling code") },
+ { "-fflatten-arrays",
+ N_("Unsupported; affects code-generation of arrays") },
{ "-fno-flatten-arrays", "" },
- { "-ffree-form", "Program is written in Fortran-90-ish free form" },
+ { "-ffree-form",
+ N_("Program is written in Fortran-90-ish free form") },
{ "-fno-free-form", "" },
{ "-ffixed-form", "" },
{ "-fno-fixed-form", "" },
- { "-fpedantic", "Warn about use of (only a few for now) Fortran extensions" },
+ { "-fpedantic",
+ N_("Warn about use of (only a few for now) Fortran extensions") },
{ "-fno-pedantic", "" },
- { "-fvxt", "Program is written in VXT (Digital-like) FORTRAN" },
+ { "-fvxt",
+ N_("Program is written in VXT (Digital-like) FORTRAN") },
{ "-fno-vxt", "" },
- { "-fno-ugly", "Disallow all ugly features" },
+ { "-fno-ugly",
+ N_("Disallow all ugly features") },
{ "-fugly-args", "" },
- { "-fno-ugly-args", "Hollerith and typeless constants not passed as arguments" },
- { "-fugly-assign", "Allow ordinary copying of ASSIGN'ed vars" },
+ { "-fno-ugly-args",
+ N_("Hollerith and typeless constants not passed as arguments") },
+ { "-fugly-assign",
+ N_("Allow ordinary copying of ASSIGN'ed vars") },
{ "-fno-ugly-assign", "" },
- { "-fugly-assumed", "Dummy array dimensioned to (1) is assumed-size" },
+ { "-fugly-assumed",
+ N_("Dummy array dimensioned to (1) is assumed-size") },
{ "-fno-ugly-assumed", "" },
- { "-fugly-comma", "Trailing comma in procedure call denotes null argument" },
+ { "-fugly-comma",
+ N_("Trailing comma in procedure call denotes null argument") },
{ "-fno-ugly-comma", "" },
- { "-fugly-complex", "Allow REAL(Z) and AIMAG(Z) given DOUBLE COMPLEX Z" },
+ { "-fugly-complex",
+ N_("Allow REAL(Z) and AIMAG(Z) given DOUBLE COMPLEX Z") },
{ "-fno-ugly-complex", "" },
{ "-fugly-init", "" },
- { "-fno-ugly-init", "Initialization via DATA and PARAMETER is type-compatible" },
- { "-fugly-logint", "Allow INTEGER and LOGICAL interchangeability" },
+ { "-fno-ugly-init",
+ N_("Initialization via DATA and PARAMETER is type-compatible") },
+ { "-fugly-logint",
+ N_("Allow INTEGER and LOGICAL interchangeability") },
{ "-fno-ugly-logint", "" },
- { "-fxyzzy", "Print internal debugging-related info" },
+ { "-fxyzzy",
+ N_("Print internal debugging-related info") },
{ "-fno-xyzzy", "" },
- { "-finit-local-zero", "Initialize local vars and arrays to zero" },
+ { "-finit-local-zero",
+ N_("Initialize local vars and arrays to zero") },
{ "-fno-init-local-zero", "" },
{ "-fbackslash", "" },
- { "-fno-backslash", "Backslashes in character/hollerith constants not special (C-style)" },
- { "-femulate-complex", "Have front end emulate COMPLEX arithmetic to avoid bugs" },
+ { "-fno-backslash",
+ N_("Backslashes in character/hollerith constants not special (C-style)") },
+ { "-femulate-complex",
+ N_("Have front end emulate COMPLEX arithmetic to avoid bugs") },
{ "-fno-emulate-complex", "" },
{ "-funderscoring", "" },
- { "-fno-underscoring", "Disable the appending of underscores to externals" },
+ { "-fno-underscoring",
+ N_("Disable the appending of underscores to externals") },
{ "-fsecond-underscore", "" },
- { "-fno-second-underscore", "Never append a second underscore to externals" },
- { "-fintrin-case-initcap", "Intrinsics spelled as e.g. SqRt" },
- { "-fintrin-case-upper", "Intrinsics in uppercase" },
+ { "-fno-second-underscore",
+ N_("Never append a second underscore to externals") },
+ { "-fintrin-case-initcap",
+ N_("Intrinsics spelled as e.g. SqRt") },
+ { "-fintrin-case-upper",
+ N_("Intrinsics in uppercase") },
{ "-fintrin-case-lower", "" },
- { "-fintrin-case-any", "Intrinsics letters in arbitrary cases" },
- { "-fmatch-case-initcap", "Language keywords spelled as e.g. IOStat" },
- { "-fmatch-case-upper", "Language keywords in uppercase" },
+ { "-fintrin-case-any",
+ N_("Intrinsics letters in arbitrary cases") },
+ { "-fmatch-case-initcap",
+ N_("Language keywords spelled as e.g. IOStat") },
+ { "-fmatch-case-upper",
+ N_("Language keywords in uppercase") },
{ "-fmatch-case-lower", "" },
- { "-fmatch-case-any", "Language keyword letters in arbitrary cases" },
- { "-fsource-case-upper", "Internally convert most source to uppercase" },
+ { "-fmatch-case-any",
+ N_("Language keyword letters in arbitrary cases") },
+ { "-fsource-case-upper",
+ N_("Internally convert most source to uppercase") },
{ "-fsource-case-lower", "" },
- { "-fsource-case-preserve", "Internally preserve source case" },
- { "-fsymbol-case-initcap", "Symbol names spelled in mixed case" },
- { "-fsymbol-case-upper", "Symbol names in uppercase" },
- { "-fsymbol-case-lower", "Symbol names in lowercase" },
+ { "-fsource-case-preserve",
+ N_("Internally preserve source case") },
+ { "-fsymbol-case-initcap",
+ N_("Symbol names spelled in mixed case") },
+ { "-fsymbol-case-upper",
+ N_("Symbol names in uppercase") },
+ { "-fsymbol-case-lower",
+ N_("Symbol names in lowercase") },
{ "-fsymbol-case-any", "" },
- { "-fcase-strict-upper", "Program written in uppercase" },
- { "-fcase-strict-lower", "Program written in lowercase" },
- { "-fcase-initcap", "Program written in strict mixed-case" },
- { "-fcase-upper", "Compile as if program written in uppercase" },
- { "-fcase-lower", "Compile as if program written in lowercase" },
- { "-fcase-preserve", "Preserve all spelling (case) used in program" },
- { "-fbadu77-intrinsics-delete", "Delete libU77 intrinsics with bad interfaces" },
- { "-fbadu77-intrinsics-disable", "Disable libU77 intrinsics with bad interfaces" },
+ { "-fcase-strict-upper",
+ N_("Program written in uppercase") },
+ { "-fcase-strict-lower",
+ N_("Program written in lowercase") },
+ { "-fcase-initcap",
+ N_("Program written in strict mixed-case") },
+ { "-fcase-upper",
+ N_("Compile as if program written in uppercase") },
+ { "-fcase-lower",
+ N_("Compile as if program written in lowercase") },
+ { "-fcase-preserve",
+ N_("Preserve all spelling (case) used in program") },
+ { "-fbadu77-intrinsics-delete",
+ N_("Delete libU77 intrinsics with bad interfaces") },
+ { "-fbadu77-intrinsics-disable",
+ N_("Disable libU77 intrinsics with bad interfaces") },
{ "-fbadu77-intrinsics-enable", "" },
- { "-fbadu77-intrinsics-hide", "Hide libU77 intrinsics with bad interfaces" },
- { "-ff2c-intrinsics-delete", "Delete non-FORTRAN-77 intrinsics f2c supports" },
- { "-ff2c-intrinsics-disable", "Disable non-FORTRAN-77 intrinsics f2c supports" },
+ { "-fbadu77-intrinsics-hide",
+ N_("Hide libU77 intrinsics with bad interfaces") },
+ { "-ff2c-intrinsics-delete",
+ N_("Delete non-FORTRAN-77 intrinsics f2c supports") },
+ { "-ff2c-intrinsics-disable",
+ N_("Disable non-FORTRAN-77 intrinsics f2c supports") },
{ "-ff2c-intrinsics-enable", "" },
- { "-ff2c-intrinsics-hide", "Hide non-FORTRAN-77 intrinsics f2c supports" },
- { "-ff90-intrinsics-delete", "Delete non-FORTRAN-77 intrinsics F90 supports" },
- { "-ff90-intrinsics-disable", "Disable non-FORTRAN-77 intrinsics F90 supports" },
+ { "-ff2c-intrinsics-hide",
+ N_("Hide non-FORTRAN-77 intrinsics f2c supports") },
+ { "-ff90-intrinsics-delete",
+ N_("Delete non-FORTRAN-77 intrinsics F90 supports") },
+ { "-ff90-intrinsics-disable",
+ N_("Disable non-FORTRAN-77 intrinsics F90 supports") },
{ "-ff90-intrinsics-enable", "" },
- { "-ff90-intrinsics-hide", "Hide non-FORTRAN-77 intrinsics F90 supports" },
- { "-fgnu-intrinsics-delete", "Delete non-FORTRAN-77 intrinsics g77 supports" },
- { "-fgnu-intrinsics-disable", "Disable non-FORTRAN 77 intrinsics F90 supports" },
+ { "-ff90-intrinsics-hide",
+ N_("Hide non-FORTRAN-77 intrinsics F90 supports") },
+ { "-fgnu-intrinsics-delete",
+ N_("Delete non-FORTRAN-77 intrinsics g77 supports") },
+ { "-fgnu-intrinsics-disable",
+ N_("Disable non-FORTRAN 77 intrinsics F90 supports") },
{ "-fgnu-intrinsics-enable", "" },
- { "-fgnu-intrinsics-hide", "Hide non-FORTRAN 77 intrinsics F90 supports" },
- { "-fmil-intrinsics-delete", "Delete MIL-STD 1753 intrinsics" },
- { "-fmil-intrinsics-disable", "Disable MIL-STD 1753 intrinsics" },
+ { "-fgnu-intrinsics-hide",
+ N_("Hide non-FORTRAN 77 intrinsics F90 supports") },
+ { "-fmil-intrinsics-delete",
+ N_("Delete MIL-STD 1753 intrinsics") },
+ { "-fmil-intrinsics-disable",
+ N_("Disable MIL-STD 1753 intrinsics") },
{ "-fmil-intrinsics-enable", "" },
- { "-fmil-intrinsics-hide", "Hide MIL-STD 1753 intrinsics" },
- { "-funix-intrinsics-delete", "Delete libU77 intrinsics" },
- { "-funix-intrinsics-disable", "Disable libU77 intrinsics" },
+ { "-fmil-intrinsics-hide",
+ N_("Hide MIL-STD 1753 intrinsics") },
+ { "-funix-intrinsics-delete",
+ N_("Delete libU77 intrinsics") },
+ { "-funix-intrinsics-disable",
+ N_("Disable libU77 intrinsics") },
{ "-funix-intrinsics-enable", "" },
- { "-funix-intrinsics-hide", "Hide libU77 intrinsics" },
- { "-fvxt-intrinsics-delete", "Delete non-FORTRAN-77 intrinsics VXT FORTRAN supports" },
- { "-fvxt-intrinsics-disable", "Disable non-FORTRAN-77 intrinsics VXT FORTRAN supports" },
+ { "-funix-intrinsics-hide",
+ N_("Hide libU77 intrinsics") },
+ { "-fvxt-intrinsics-delete",
+ N_("Delete non-FORTRAN-77 intrinsics VXT FORTRAN supports") },
+ { "-fvxt-intrinsics-disable",
+ N_("Disable non-FORTRAN-77 intrinsics VXT FORTRAN supports") },
{ "-fvxt-intrinsics-enable", "" },
- { "-fvxt-intrinsics-hide", "Hide non-FORTRAN-77 intrinsics VXT FORTRAN supports" },
- { "-fzeros", "Treat initial values of 0 like non-zero values" },
+ { "-fvxt-intrinsics-hide",
+ N_("Hide non-FORTRAN-77 intrinsics VXT FORTRAN supports") },
+ { "-fzeros",
+ N_("Treat initial values of 0 like non-zero values") },
{ "-fno-zeros", "" },
- { "-fdebug-kludge", "Emit special debugging information for COMMON and EQUIVALENCE (disabled)" },
+ { "-fdebug-kludge",
+ N_("Emit special debugging information for COMMON and EQUIVALENCE (disabled)") },
{ "-fno-debug-kludge", "" },
- { "-fonetrip", "Take at least one trip through each iterative DO loop" },
+ { "-fonetrip",
+ N_("Take at least one trip through each iterative DO loop") },
{ "-fno-onetrip", "" },
{ "-fsilent", "" },
- { "-fno-silent", "Print names of program units as they are compiled" },
+ { "-fno-silent",
+ N_("Print names of program units as they are compiled") },
{ "-fglobals", "" },
- { "-fno-globals", "Disable fatal diagnostics about inter-procedural problems" },
- { "-ftypeless-boz", "Make prefix-radix non-decimal constants be typeless" },
+ { "-fno-globals",
+ N_("Disable fatal diagnostics about inter-procedural problems") },
+ { "-ftypeless-boz",
+ N_("Make prefix-radix non-decimal constants be typeless") },
{ "-fno-typeless-boz", "" },
- { "-fbounds-check", "Generate code to check subscript and substring bounds" },
+ { "-fbounds-check",
+ N_("Generate code to check subscript and substring bounds") },
{ "-fno-bounds-check", "" },
-{ "-ffortran-bounds-check", "Fortran-specific form of -fbounds-check" },
+ { "-ffortran-bounds-check",
+ N_("Fortran-specific form of -fbounds-check") },
{ "-fno-fortran-bounds-check", "" },
{ "-Wglobals", "" },
- { "-Wno-globals", "Disable warnings about inter-procedural problems" },
+ { "-Wno-globals",
+ N_("Disable warnings about inter-procedural problems") },
/*"-Wimplicit",*/
/*"-Wno-implicit",*/
- { "-Wsurprising", "Warn about constructs with surprising meanings" },
+ { "-Wsurprising",
+ N_("Warn about constructs with surprising meanings") },
{ "-Wno-surprising", "" },
/*"-Wall",*/
/* Prefix options. */
- { "-I", "Add a directory for INCLUDE searching" },
- { "-ffixed-line-length-", "Set the maximum line length" },
+ { "-I",
+ N_("Add a directory for INCLUDE searching") },
+ { "-ffixed-line-length-",
+ N_("Set the maximum line length") },
#endif
diff --git a/gcc/f/lang-specs.h b/gcc/f/lang-specs.h
index 46f54e33b31..1ff70ad0071 100644
--- a/gcc/f/lang-specs.h
+++ b/gcc/f/lang-specs.h
@@ -24,23 +24,23 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
/* This is the contribution to the `default_compilers' array in gcc.c for
g77. */
- {".F", "@f77-cpp-input"},
- {".fpp", "@f77-cpp-input"},
- {".FPP", "@f77-cpp-input"},
+ {".F", "@f77-cpp-input", 0},
+ {".fpp", "@f77-cpp-input", 0},
+ {".FPP", "@f77-cpp-input", 0},
{"@f77-cpp-input",
- "tradcpp0 -lang-fortran %(cpp_options) %{!M:%{!MM:%{!E:%{!pipe:%g.f |\n\
- f771 %{!pipe:%g.f} %(cc1_options) %{I*} %{!fsyntax-only:%(invoke_as)}}}}}"},
- {".r", "@ratfor"},
+ "tradcpp0 -lang-fortran %(cpp_options) %{!M:%{!MM:%{!E:%{!pipe:%g.f} |\n\
+ f771 %{!pipe:%g.f} %(cc1_options) %{I*} %{!fsyntax-only:%(invoke_as)}}}}", 0},
+ {".r", "@ratfor", 0},
{"@ratfor",
"%{C:%{!E:%eGNU C does not support -C without using -E}}\
ratfor %{C} %{v} %i %{E:%W{o*}} %{!E: %{!pipe:-o %g.f} |\n\
- f771 %{!pipe:%g.f} %(cc1_options) %{I*} %{!fsyntax-only:%(invoke_as)}}"},
- {".f", "@f77"},
- {".for", "@f77"},
- {".FOR", "@f77"},
+ f771 %{!pipe:%g.f} %(cc1_options) %{I*} %{!fsyntax-only:%(invoke_as)}}", 0},
+ {".f", "@f77", 0},
+ {".for", "@f77", 0},
+ {".FOR", "@f77", 0},
{"@f77",
"%{!M:%{!MM:%{!E:f771 %i %(cc1_options) %{I*}\
- %{!fsyntax-only:%(invoke_as)}}}}"},
+ %{!fsyntax-only:%(invoke_as)}}}}", 0},
/* XXX This is perverse and should not be necessary. */
{"@f77-version",
"tradcpp0 -lang-fortran %(cpp_options) %j \n\
@@ -56,4 +56,4 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
%{!nostdlib:%{!nodefaultlibs:%G %L %G}} \
%{!A:%{!nostdlib:%{!nostartfiles:%E}}} \
%{T*} \n\
- %g \n"},
+ %g \n", 0},
diff --git a/gcc/f/lex.c b/gcc/f/lex.c
index ea0ef059b76..d5aaa1589ed 100644
--- a/gcc/f/lex.c
+++ b/gcc/f/lex.c
@@ -1412,6 +1412,12 @@ ffelex_hash_ (FILE *finput)
input_filename = old_input_filename;
error ("Use `#line ...' instead of `# ...' in first line");
}
+ if (c == '\n' || c == EOF)
+ {
+ if (token != NULL && !ffelex_kludge_flag_)
+ ffelex_token_kill (token);
+ return c;
+ }
}
else
error ("invalid #-line");
diff --git a/gcc/f/news.texi b/gcc/f/news.texi
index cb28d0d75e8..e2bbfd086d9 100644
--- a/gcc/f/news.texi
+++ b/gcc/f/news.texi
@@ -7,9 +7,9 @@
@c Keep this the same as the dates above, since it's used
@c in the standalone derivations of this file (e.g. NEWS).
-@set copyrights-news 1995,1996,1997,1998,1999,2000
+@set copyrights-news 1995,1996,1997,1998,1999,2000,2001
-@set last-update-news 2000-11-05
+@set last-update-news 2001-06-03
@include root.texi
@@ -96,10 +96,9 @@ involve a combination of these elements.
Note that two variants of @code{g77} are tracked below.
The @code{egcs} variant is described vis-a-vis
previous versions of @code{egcs} and/or
-an official FSF version,
-as appropriate. Note that all such variants are now
-obsolete - the information is retained here only for
-its historical value.
+an official FSF version, as appropriate.
+Note that all such variants are obsolete @emph{as of July 1999} -
+the information is retained here only for its historical value.
Therefore, @code{egcs} versions sometimes have multiple listings
to help clarify how they differ from other versions,
@@ -153,22 +152,45 @@ is available at
The following information was last updated on @value{last-update-news}:
-@heading In development:
+@heading In 0.5.26, @code{GCC} 3.0 versus @code{GCC} 2.95:
@itemize @bullet
-@ifclear USERVISONLY
+@item
+When a REWIND was issued after a WRITE statement on an unformatted
+file, the implicit truncation was performed by copying the truncated
+file to /tmp and copying the result back. This has been fixed by using
+the @code{ftruncate} OS function. Thanks go to the GAMESS developers
+for bringing this to our attention.
+
@item
Using options @code{-g}, @code{-ggdb} or @code{-gdwarf[-2]} (where
appropriate for your target) now also enables debugging information
for COMMON BLOCK and EQUIVALENCE items to be emitted.
-@end ifclear
+Thanks go to Andrew Vaught (@email{andy@@xena.eas.asu.edu}) and
+George Helffrich (@email{george@@geology.bristol.ac.uk}) for
+fixing this longstanding problem.
+
+@item
+It is not necessary anymore to use the option @code{-femulate-complex}
+to compile Fortran code using COMPLEX arithmetic, even on 64-bit machines
+(like the Alpha). This will improve code generation.
+
+@item
+INTRINSIC arithmetic functions are now treated as routines that do not
+depend on anything but their argument(s). This enables further instruction
+scheduling, because it is known that they cannot read or modify arbitrary
+locations.
@ifclear USERVISONLY
@item
+Upgrade to @code{libf2c} as of 2000-12-05.
+
+This fixes a bug where a namelist containing initialization of LOGICAL
+items and a variable starting with T or F would be read incorrectly.
+
+@item
The @code{TtyNam} intrinsics now set @var{Name} to all spaces (at run time)
if the system has no @code{ttyname} implementation available.
-@end ifclear
-@ifclear USERVISONLY
@item
Upgrade to @code{libf2c} as of 1999-06-28.
diff --git a/gcc/f/proj.h b/gcc/f/proj.h
index 0a180d39933..f7fd1e70765 100644
--- a/gcc/f/proj.h
+++ b/gcc/f/proj.h
@@ -35,29 +35,10 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#error "You have to use gcc 2.x to build g77 (might be fixed in g77-0.6)."
#endif
-/* Include files everyone gets. <assert.h> is needed for assert().
- <stddef.h> is needed for offsetof, but technically also NULL,
- size_t, ptrdiff_t, and so on. */
+/* Include files everyone gets. <assert.h> is needed for assert(). */
#include "assert.h"
-#if HAVE_STDDEF_H
-#include <stddef.h>
-#endif
-
-/* Generally useful definitions. */
-
-typedef enum
- {
-#if !defined(false) || !defined(true)
- false = 0, true = 1,
-#endif
-#if !defined(FALSE) || !defined(TRUE)
- FALSE = 0, TRUE = 1,
-#endif
- Doggone_Trailing_Comma_Dont_Work = 1
- } bool;
-
#ifndef UNUSED /* Compile with -DUNUSED= if cc doesn't support this. */
#define UNUSED ATTRIBUTE_UNUSED
#endif /* !defined (UNUSED) */
diff --git a/gcc/f/root.texi b/gcc/f/root.texi
index e38d0b37ec8..9952bf58402 100644
--- a/gcc/f/root.texi
+++ b/gcc/f/root.texi
@@ -2,12 +2,14 @@
@c as compared to a release version. When making a release
@c (e.g. a release branch in the CVS repository for gcc),
@c clear this and set the version information correctly.
-@set DEVELOPMENT
+@clear DEVELOPMENT
@set version-g77 0.5.26
-@set version-gcc 2.97
+@set version-gcc 3.0
@set email-general gcc@@gcc.gnu.org
+@set email-help gcc-help@@gcc.gnu.org
@set email-bugs gcc-bugs@@gcc.gnu.org or bug-gcc@@gnu.org
+@set email-patch gcc-patches@@gcc.gnu.org
@set path-g77 gcc/gcc/f
@set path-libf2c gcc/libf2c
diff --git a/gcc/f/ste.c b/gcc/f/ste.c
index 5b4c68eb2d1..4a771c8e854 100644
--- a/gcc/f/ste.c
+++ b/gcc/f/ste.c
@@ -721,7 +721,7 @@ ffeste_begin_iterdo_ (ffestw block, tree *xtvar, tree *xtincr,
convert (TREE_TYPE (niters),
ffecom_integer_zero_node)));
- expand_exit_loop_if_false (0, expr);
+ expand_exit_loop_top_cond (0, expr);
}
if (block)
@@ -3057,7 +3057,7 @@ ffeste_R819B (ffestw block, ffelab label UNUSED, ffebld expr)
ffeste_end_stmt_ ();
ffestw_set_do_hook (block, loop);
- expand_exit_loop_if_false (0, result);
+ expand_exit_loop_top_cond (0, result);
}
else
ffestw_set_do_hook (block, expand_start_loop (1));
diff --git a/gcc/f/target.h b/gcc/f/target.h
index 7eab1067ca7..a1818228ed3 100644
--- a/gcc/f/target.h
+++ b/gcc/f/target.h
@@ -234,7 +234,7 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#define FFETARGET_f2cTYLOGICAL2 13
#define FFETARGET_f2cTYQUAD 14
-#if !defined(__alpha__) && (!defined (_ARCH_PPC) || !defined (__64BIT__)) && (!defined(__sparc__) || (!defined(__sparcv9) && !defined(__arch64__))) && (!defined(__ia64__) || !defined(__LP64__))
+#if !defined(__alpha__) && (!defined (_ARCH_PPC) || !defined (__64BIT__)) && (!defined(__sparc__) || (!defined(__sparcv9) && !defined(__arch64__))) && (!defined(__ia64__) || !defined(__LP64__)) && (!defined(__hppa__) || !defined(__LP64__)) && !defined(__s390x__)
#define FFETARGET_32bit_longs
#endif
diff --git a/gcc/f/top.c b/gcc/f/top.c
index 6eba5c98bb4..f446768f14d 100644
--- a/gcc/f/top.c
+++ b/gcc/f/top.c
@@ -1,5 +1,5 @@
/* top.c -- Implementation File (module.c template V1.0)
- Copyright (C) 1995, 1996, 1997, 1999 Free Software Foundation, Inc.
+ Copyright (C) 1995, 1996, 1997, 1999, 2001 Free Software Foundation, Inc.
Contributed by James Craig Burley.
This file is part of GNU Fortran.
@@ -225,7 +225,10 @@ ffe_decode_option (argc, argv)
else if (strcmp (&opt[2], "no-free-form") == 0)
ffe_set_is_free_form (FALSE);
else if (strcmp (&opt[2], "fixed-form") == 0)
- ffe_set_is_free_form (FALSE);
+ {
+ ffe_set_is_free_form (FALSE);
+ return -1;
+ }
else if (strcmp (&opt[2], "no-fixed-form") == 0)
ffe_set_is_free_form (TRUE);
else if (strcmp (&opt[2], "pedantic") == 0)
@@ -464,9 +467,15 @@ ffe_decode_option (argc, argv)
char *len = &opt[2] + strlen ("fixed-line-length-");
if (strcmp (len, "none") == 0)
- ffe_set_fixed_line_length (0);
+ {
+ ffe_set_fixed_line_length (0);
+ return -1;
+ }
else if (ffe_is_digit_string_ (len))
- ffe_set_fixed_line_length (atol (len));
+ {
+ ffe_set_fixed_line_length (atol (len));
+ return -1;
+ }
else
return 0;
}
diff --git a/gcc/f/version.c b/gcc/f/version.c
index aa1eb26c695..a2cec373ad1 100644
--- a/gcc/f/version.c
+++ b/gcc/f/version.c
@@ -1 +1 @@
-const char *ffe_version_string = "0.5.26 20010211 (experimental)";
+const char *ffe_version_string = "0.5.26 20020220 (release)";
diff --git a/gcc/final.c b/gcc/final.c
index 1fd30c2847d..307dc445384 100644
--- a/gcc/final.c
+++ b/gcc/final.c
@@ -52,9 +52,7 @@ Boston, MA 02111-1307, USA. */
#include "tm_p.h"
#include "regs.h"
#include "insn-config.h"
-#include "insn-flags.h"
#include "insn-attr.h"
-#include "insn-codes.h"
#include "recog.h"
#include "conditions.h"
#include "flags.h"
@@ -79,10 +77,6 @@ Boston, MA 02111-1307, USA. */
#endif /* DBX_DEBUGGING_INFO || XCOFF_DEBUGGING_INFO */
-#ifndef ACCUMULATE_OUTGOING_ARGS
-#define ACCUMULATE_OUTGOING_ARGS 0
-#endif
-
#ifdef XCOFF_DEBUGGING_INFO
#include "xcoffout.h"
#endif
@@ -603,7 +597,7 @@ dbr_sequence_length ()
/* Arrays for insn lengths, and addresses. The latter is referenced by
`insn_current_length'. */
-static short *insn_lengths;
+static int *insn_lengths;
#ifdef HAVE_ATTR_length
varray_type insn_addresses_;
@@ -1135,7 +1129,7 @@ shorten_branches (first)
#ifdef HAVE_ATTR_length
/* Allocate the rest of the arrays. */
- insn_lengths = (short *) xmalloc (max_uid * sizeof (short));
+ insn_lengths = (int *) xmalloc (max_uid * sizeof (*insn_lengths));
insn_lengths_max_uid = max_uid;
/* Syntax errors can lead to labels being outside of the main insn stream.
Initialize insn_addresses, so that we get reproducible results. */
@@ -1607,12 +1601,9 @@ final_start_function (first, file, optimize)
last_linenum = high_block_linenum = high_function_linenum
= NOTE_LINE_NUMBER (first);
-#if defined (DWARF2_UNWIND_INFO) || defined (DWARF2_DEBUGGING_INFO)
- /* Output DWARF definition of the function. */
- if (dwarf2out_do_frame ())
- dwarf2out_begin_prologue ();
- else
- current_function_func_begin_label = 0;
+#if defined (DWARF2_UNWIND_INFO) || defined (IA64_UNWIND_INFO) \
+ || defined (DWARF2_DEBUGGING_INFO)
+ dwarf2out_begin_prologue ();
#endif
/* For SDB and XCOFF, the function beginning must be marked between
@@ -1835,10 +1826,6 @@ final_end_function (first, file, optimize)
bb_func_label_num = -1; /* not in function, nuke label # */
-#ifdef IA64_UNWIND_INFO
- output_function_exception_table ();
-#endif
-
/* If FUNCTION_EPILOGUE is not defined, then the function body
itself contains return instructions wherever needed. */
}
@@ -1951,8 +1938,6 @@ final (first, file, optimize, prescan)
last_ignored_compare = 0;
new_block = 1;
- check_exception_handler_labels ();
-
/* Make a map indicating which line numbers appear in this function.
When producing SDB debugging info, delete troublesome line number
notes from inlined functions in other files as well as duplicate
@@ -2009,10 +1994,6 @@ final (first, file, optimize, prescan)
#endif
}
- /* Initialize insn_eh_region table if eh is being used. */
-
- init_insn_eh_region (first, max_uid);
-
init_recog ();
CC_STATUS_INIT;
@@ -2046,7 +2027,6 @@ final (first, file, optimize, prescan)
if (profile_block_flag && new_block)
add_bb (file);
- free_insn_eh_region ();
free (line_note_exists);
line_note_exists = NULL;
}
@@ -2123,33 +2103,22 @@ final_scan_insn (insn, file, optimize, prescan, nopeepholes)
break;
case NOTE_INSN_BASIC_BLOCK:
+#ifdef IA64_UNWIND_INFO
+ IA64_UNWIND_EMIT (asm_out_file, insn);
+#endif
if (flag_debug_asm)
fprintf (asm_out_file, "\t%s basic block %d\n",
ASM_COMMENT_START, NOTE_BASIC_BLOCK (insn)->index);
break;
case NOTE_INSN_EH_REGION_BEG:
- if (! exceptions_via_longjmp)
- {
- ASM_OUTPUT_INTERNAL_LABEL (file, "LEHB", NOTE_EH_HANDLER (insn));
- if (! flag_new_exceptions)
- add_eh_table_entry (NOTE_EH_HANDLER (insn));
-#ifdef ASM_OUTPUT_EH_REGION_BEG
- ASM_OUTPUT_EH_REGION_BEG (file, NOTE_EH_HANDLER (insn));
-#endif
- }
+ ASM_OUTPUT_DEBUG_LABEL (asm_out_file, "LEHB",
+ NOTE_EH_HANDLER (insn));
break;
case NOTE_INSN_EH_REGION_END:
- if (! exceptions_via_longjmp)
- {
- ASM_OUTPUT_INTERNAL_LABEL (file, "LEHE", NOTE_EH_HANDLER (insn));
- if (flag_new_exceptions)
- add_eh_table_entry (NOTE_EH_HANDLER (insn));
-#ifdef ASM_OUTPUT_EH_REGION_END
- ASM_OUTPUT_EH_REGION_END (file, NOTE_EH_HANDLER (insn));
-#endif
- }
+ ASM_OUTPUT_DEBUG_LABEL (asm_out_file, "LEHE",
+ NOTE_EH_HANDLER (insn));
break;
case NOTE_INSN_PROLOGUE_END:
@@ -2324,9 +2293,7 @@ final_scan_insn (insn, file, optimize, prescan, nopeepholes)
case BARRIER:
#if defined (DWARF2_UNWIND_INFO)
- /* If we push arguments, we need to check all insns for stack
- adjustments. */
- if (!ACCUMULATE_OUTGOING_ARGS && dwarf2out_do_frame ())
+ if (dwarf2out_do_frame ())
dwarf2out_frame_debug (insn);
#endif
break;
@@ -2936,9 +2903,7 @@ final_scan_insn (insn, file, optimize, prescan, nopeepholes)
current_output_insn = debug_insn = insn;
#if defined (DWARF2_UNWIND_INFO)
- /* If we push arguments, we want to know where the calls are. */
- if (!ACCUMULATE_OUTGOING_ARGS && GET_CODE (insn) == CALL_INSN
- && dwarf2out_do_frame ())
+ if (GET_CODE (insn) == CALL_INSN && dwarf2out_do_frame ())
dwarf2out_frame_debug (insn);
#endif
@@ -3006,22 +2971,15 @@ final_scan_insn (insn, file, optimize, prescan, nopeepholes)
output_asm_insn (template, recog_data.operand);
#if defined (DWARF2_UNWIND_INFO)
- /* If we push arguments, we need to check all insns for stack
- adjustments. */
- if (!ACCUMULATE_OUTGOING_ARGS)
- {
- if (GET_CODE (insn) == INSN && dwarf2out_do_frame ())
- dwarf2out_frame_debug (insn);
- }
- else
- {
#if defined (HAVE_prologue)
- /* If this insn is part of the prologue, emit DWARF v2
- call frame info. */
- if (RTX_FRAME_RELATED_P (insn) && dwarf2out_do_frame ())
- dwarf2out_frame_debug (insn);
+ if (GET_CODE (insn) == INSN && dwarf2out_do_frame ())
+ dwarf2out_frame_debug (insn);
+#else
+ if (!ACCUMULATE_OUTGOING_ARGS
+ && GET_CODE (insn) == INSN
+ && dwarf2out_do_frame ())
+ dwarf2out_frame_debug (insn);
#endif
- }
#endif
#if 0
diff --git a/gcc/fixinc/Makefile.in b/gcc/fixinc/Makefile.in
index 88f615da36e..d0dfb0c2f4b 100644
--- a/gcc/fixinc/Makefile.in
+++ b/gcc/fixinc/Makefile.in
@@ -1,6 +1,6 @@
# Makefile for GNU compilers.
#
-# Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
+# Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
#This file is part of GNU CC.
@@ -22,8 +22,15 @@
# The makefile built from this file lives in the fixinc subdirectory.
# Its purpose is to build the any-platforms fixinc.sh script.
+SHELL=/bin/sh
+
+# Some versions of `touch' (such as the version on Solaris 2.8)
+# do not correctly set the timestamp due to buggy versions of `utime'
+# in the kernel. So, we use `echo' instead.
+STAMP = echo timestamp >
+
FL_LIST = $(CFLAGS) $(CPPFLAGS) $(WARN_CFLAGS)
-FIXINC_DEFS = -DIN_GCC $(FL_LIST) $(INCLUDES)
+FIXINC_DEFS = -DIN_GCC -DHAVE_CONFIG_H $(FL_LIST) $(INCLUDES)
# Directory where sources are, from where we are.
srcdir = @srcdir@
@@ -78,11 +85,11 @@ twoprocess : test-stamp $(AF)
full-stamp : $(ALLOBJ) $(LIBERTY)
$(CC) $(FIXINC_DEFS) $(LDFLAGS) -o $(FI) $(ALLOBJ) $(LIBERTY)
- touch $@
+ $(STAMP) $@
test-stamp : $(TESTOBJ) $(LIBERTY)
$(CC) $(FIXINC_DEFS) $(LDFLAGS) -o $(FI) $(TESTOBJ) $(LIBERTY)
- touch $@
+ $(STAMP) $@
$(AF): $(FIXOBJ) $(LIBERTY)
$(CC) $(FIXINC_DEFS) $(LDFLAGS) -o $@ $(FIXOBJ) $(LIBERTY)
@@ -115,7 +122,7 @@ maintainer-clean : clean
# We still copy the script because we still have alternative scripts.
#
install-bin : $(TARGETS)
- ./fixincl -v
+ ./fixincl -v < /dev/null
@if [ -f ../fixinc.sh ] ; then rm -f ../fixinc.sh || \
mv -f ../fixinc.sh ../fixinc.sh.$$ || exit 1 ; else : ; fi
@cp $(srcdir)/fixincl.sh ../fixinc.sh
diff --git a/gcc/fixinc/README b/gcc/fixinc/README
index c04b3fdda9e..06fe879245e 100644
--- a/gcc/fixinc/README
+++ b/gcc/fixinc/README
@@ -36,6 +36,9 @@ please, to me: bkorb@gnu.org.
Here are the rules for making fixes in the inclhack.def file:
+0. If you are not the fixincludes maintainer, please send that
+ person email about any changes you may want to make. Thanks!
+
1. Every fix must have a "hackname" that is compatible with C syntax
for variable names and is unique without regard to alphabetic case.
Please keep them alphabetical by this name. :-)
@@ -181,6 +184,25 @@ Here are the rules for making fixes in the inclhack.def file:
replaced. You may delete text by supplying an empty string for
the format (the first "c_fix_arg").
+ Note: In general, a format c_fix may be used in place of one
+ sed expression. However, it will need to be rewritten by
+ hand. For example:
+
+ sed = 's@^#if __GNUC__ == 2 && __GNUC_MINOR__ >= 7$'
+ '@& || __GNUC__ >= 3@';
+
+ may be rewritten using a format c_fix as:
+
+ c_fix = format;
+ c_fix_arg = '%0 || __GNUC__ >= 3';
+ c_fix_arg = '^#if __GNUC__ == 2 && __GNUC_MINOR__ >= 7$';
+
+ Multiple sed substitution expressions probably ought to remain sed
+ expressions in order to maintain clarity. Also note that if the
+ second sed expression is the same as the first select expression,
+ then you may omit the second c_fix_arg. The select expression will
+ be picked up and used in its absence.
+
EXAMPLES OF FIXES:
==================
diff --git a/gcc/fixinc/check.tpl b/gcc/fixinc/check.tpl
index de415110863..fd03b3ea609 100644
--- a/gcc/fixinc/check.tpl
+++ b/gcc/fixinc/check.tpl
@@ -1,4 +1,4 @@
-[= autogen template sh=check.sh =]
+[= autogen5 template sh=check.sh =]
[=
#
# This file contanes the shell template to run tests on the fixes
@@ -25,86 +25,84 @@ export TARGET_MACHINE DESTDIR SRCDIR FIND_BASE VERBOSE INPUT ORIGDIR
rm -rf ${DESTDIR} ${SRCDIR}
mkdir ${DESTDIR} ${SRCDIR}
-
-( cd ${SRCDIR}
- set +e
- for f in [=
-
- _EVAL fix.files _stack _join "echo `
-
- for f in %s
- do case $f in
- */* ) echo $f | sed 's;/[^/]*$;;' ;;
- esac
- done | sort -u
-
- ` " _printf _shell =]
- do
- mkdir $f || mkdir -p $f
- done ) > /dev/null 2>&1
-
+(
+[=
+ (shellf
+ "for f in %s
+ do case $f in
+ */* ) echo $f | sed 's;/[^/]*$;;' ;;
+ esac
+ done | sort -u | \
+ while read g
+ do echo \" mkdir \\${SRCDIR}/$g || mkdir -p \\${SRCDIR}/$g || exit 1\"
+ done" (join " " (stack "fix.files")) ) =]
+) 2> /dev/null[= # suppress 'No such file or directory' messages =]
cd inc
[=
+(define sfile "")
+(define HACK "")
+(define dfile "") =][=
-_FOR fix =][=
+FOR fix =][=
- _IF test_text _count 1 > =]
-#
-# [=hackname=] has [=_EVAL test_text _count=] tests
-#
-sfile=[=
- _IF files _exist =][=
- files[0] =][=
- _ELSE =]testing.h[=
- _ENDIF =][=
- _FOR test_text FROM 1 =]
-dfile=`dirname $sfile`/[=hackname "#_A-Z" "#-a-z" _tr=]-[=_EVAL _index=].h
-cat >> $sfile <<_HACK_EOF_
+ IF (> (count "test_text") 1) =][=
+ (set! HACK (string-upcase! (get "hackname")))
+ (set! sfile (if (exist? "files") (get "files[]") "testing.h"))
+ (set! dfile (string-append
+ (if (*==* sfile "/")
+ (shellf "echo \"%s\"|sed 's,/[^/]*,/,'" sfile )
+ "" )
+ (string-tr! (get "hackname") "_A-Z" "-a-z")
+ ) ) =][=
+
+ FOR test_text (for-from 1) =]
+cat >> [=(. sfile)=] <<_HACK_EOF_
-#if defined( [=hackname _up=]_CHECK_[=_EVAL _index=] )
+#if defined( [=(. HACK)=]_CHECK_[=(for-index)=] )
[=test_text=]
-#endif /* [=hackname _up=]_CHECK_[=_EVAL _index=] */
+#endif /* [=(. HACK)=]_CHECK_[=(for-index)=] */
_HACK_EOF_
-echo $sfile | ../../fixincl
-mv -f $sfile $dfile
-[ -f ${DESTDIR}/$sfile ] && mv ${DESTDIR}/$sfile ${DESTDIR}/$dfile[=
- /test_text =][=
- _ENDIF =][=
+echo [=(. sfile)=] | ../../fixincl
+mv -f [=(. sfile)=] [=(. dfile)=]-[=(for-index)=].h
+[ -f ${DESTDIR}/[=(. sfile)=] ] && [=#
+ =]mv ${DESTDIR}/[=(. sfile)=] ${DESTDIR}/[=(. dfile)=]-[=(for-index)=].h[=
-/fix
+ ENDFOR test_text =][=
+
+ ENDIF multi-test =][=
+
+ENDFOR fix
=][=
-_FOR fix =][=
-
- _IF test_text _exist ! =][=
- _IF replace _exist ! =]
-echo No test for [=hackname=] in inc/[=
- _IF files _exist =][=
- files[0] =][=
- _ELSE =]testing.h[=
- _ENDIF =][=
- _ENDIF =][=
- _ELSE =]
+FOR fix =][=
+ (set! HACK (string-upcase! (get "hackname"))) =][=
+
+ IF (not (exist? "test_text")) =][=
+ (if (not (exist? "replace"))
+ (error (sprintf "include fix '%s' has no test text"
+ (get "hackname") )) )
+ =][=
+ ELSE =]
cat >> [=
- _IF files _exist =][=
+ IF (exist? "files") =][=
files[0] =][=
- _ELSE =]testing.h[=
- _ENDIF =] <<_HACK_EOF_
+ ELSE =]testing.h[=
+ ENDIF =] <<_HACK_EOF_
-#if defined( [=hackname _up=]_CHECK )
+#if defined( [=(. HACK)=]_CHECK )
[=test_text=]
-#endif /* [=hackname _up=]_CHECK */
+#endif /* [=(. HACK)=]_CHECK */
_HACK_EOF_
-[=_ENDIF =][=
+[=ENDIF =][=
-/fix
+ENDFOR fix
=]
-find . -type f | sed 's;\./;;' | sort | ../../fixincl
+find . -type f | sed 's;^\./;;' | sort | ../../fixincl
cd ${DESTDIR}
exitok=true
@@ -137,7 +135,7 @@ do
:
else
- diff -c $f ${TESTBASE}/$f >&2 || :
+ diff -u $f ${TESTBASE}/$f >&2 || :
exitok=false
fi
done
@@ -173,6 +171,6 @@ else
fi
$exitok[=
-_eval _outfile "chmod +x %s" _printf _shell
+(set-writable)
=]
diff --git a/gcc/fixinc/fixfixes.c b/gcc/fixinc/fixfixes.c
index 56b9f5493c7..afdecfc9e08 100644
--- a/gcc/fixinc/fixfixes.c
+++ b/gcc/fixinc/fixfixes.c
@@ -30,14 +30,6 @@ Here are the rules:
This may be useful, for example, if there are interesting strings
or pre-compiled regular expressions stored there.
- It is also possible to access fix descriptions by using the
- index of a known fix, "my_fix_name" for example:
-
- tFixDesc* p_desc = fixDescList + MY_FIX_NAME_FIXIDX;
- tTestDesc* p_tlist = p_desc->p_test_desc;
-
- regexec (p_tlist->p_test_regex, ...)
-
= = = = = = = = = = = = = = = = = = = = = = = = =
This file is part of GNU CC.
diff --git a/gcc/fixinc/fixinc.dgux b/gcc/fixinc/fixinc.dgux
index 23f63da0860..d73d4e85a00 100755
--- a/gcc/fixinc/fixinc.dgux
+++ b/gcc/fixinc/fixinc.dgux
@@ -221,12 +221,4 @@ fi
done
-if [ x${INSTALL_ASSERT_H} != x ]
-then
- cd ${ORIG_DIR}
- rm -f include/assert.h
- cp ${srcdir}/assert.h include/assert.h || exit 1
- chmod a+r include/assert.h
-fi
-
exit 0
diff --git a/gcc/fixinc/fixinc.interix b/gcc/fixinc/fixinc.interix
index 42bde423cbe..d0fe4cfba78 100644
--- a/gcc/fixinc/fixinc.interix
+++ b/gcc/fixinc/fixinc.interix
@@ -162,12 +162,4 @@ done
done # for include directory list
-if [ x${INSTALL_ASSERT_H} != x ]
-then
- cd ${ORIG_DIR}
- rm -f include/assert.h
- cp ${srcdir}/assert.h include/assert.h || exit 1
- chmod a+r include/assert.h
-fi
-
exit 0
diff --git a/gcc/fixinc/fixinc.ptx b/gcc/fixinc/fixinc.ptx
index 700a725bd35..b4f92689981 100644
--- a/gcc/fixinc/fixinc.ptx
+++ b/gcc/fixinc/fixinc.ptx
@@ -263,12 +263,4 @@ fi
done
-if [ x${INSTALL_ASSERT_H} != x ]
-then
- cd ${ORIG_DIR}
- rm -f include/assert.h
- cp ${srcdir}/assert.h include/assert.h || exit 1
- chmod a+r include/assert.h
-fi
-
exit 0
diff --git a/gcc/fixinc/fixinc.svr4 b/gcc/fixinc/fixinc.svr4
index bc2eab1f45c..4bb69fc523a 100755
--- a/gcc/fixinc/fixinc.svr4
+++ b/gcc/fixinc/fixinc.svr4
@@ -1806,12 +1806,4 @@ chmod a+r ${LIB}/sys/byteorder.h
done
-if [ x${INSTALL_ASSERT_H} != x ]
-then
- cd ${ORIG_DIR}
- rm -f include/assert.h
- cp ${srcdir}/assert.h include/assert.h || exit 1
- chmod a+r include/assert.h
-fi
-
exit 0
diff --git a/gcc/fixinc/fixinc.winnt b/gcc/fixinc/fixinc.winnt
index 323b79a93b8..8fd6e53331f 100644
--- a/gcc/fixinc/fixinc.winnt
+++ b/gcc/fixinc/fixinc.winnt
@@ -229,12 +229,4 @@ for file in $files; do
rmdir $LIB/$file > NUL 2>&1
done
-if [ x${INSTALL_ASSERT_H} != x ]
-then
- cd ${ORIG_DIR}
- rm -f include/assert.h
- cp ${srcdir}/assert.h include/assert.h || exit 1
- chmod a+r include/assert.h
-fi
-
exit 0
diff --git a/gcc/fixinc/fixinc.wrap b/gcc/fixinc/fixinc.wrap
index 46318967c70..e242d5aa5cf 100755
--- a/gcc/fixinc/fixinc.wrap
+++ b/gcc/fixinc/fixinc.wrap
@@ -133,12 +133,4 @@ fi
done
-if [ x${INSTALL_ASSERT_H} != x ]
-then
- cd ${ORIG_DIR}
- rm -f include/assert.h
- cp ${srcdir}/assert.h include/assert.h || exit 1
- chmod a+r include/assert.h
-fi
-
exit 0
diff --git a/gcc/fixinc/fixincl.c b/gcc/fixinc/fixincl.c
index bd134255b8f..ddc2f957780 100644
--- a/gcc/fixinc/fixincl.c
+++ b/gcc/fixinc/fixincl.c
@@ -29,6 +29,9 @@ Boston, MA 02111-1307, USA. */
#endif
#include <signal.h>
+#if ! defined( SIGCHLD ) && defined( SIGCLD )
+# define SIGCHLD SIGCLD
+#endif
#ifndef SEPARATE_FIX_PROC
#include "server.h"
#endif
@@ -67,7 +70,7 @@ typedef enum {
te_verbose verbose_level = VERB_PROGRESS;
int have_tty = 0;
-#define VLEVEL(l) (verbose_level >= l)
+#define VLEVEL(l) ((unsigned int) verbose_level >= (unsigned int) l)
#define NOT_SILENT VLEVEL(VERB_FIXES)
pid_t process_chain_head = (pid_t) -1;
@@ -217,12 +220,14 @@ initialize ( argc, argv )
char** argv;
{
static const char var_not_found[] =
+#ifndef __STDC__
+ "fixincl ERROR: %s environment variable not defined\n"
+#else
"fixincl ERROR: %s environment variable not defined\n"
-#ifdef __STDC__
"each of these must be defined:\n"
-#define _ENV_(v,m,n,t) "\t" n " - " t "\n"
-ENV_TABLE
-#undef _ENV_
+# define _ENV_(vv,mm,nn,tt) "\t" nn " - " tt "\n"
+ ENV_TABLE
+# undef _ENV_
#endif
;
@@ -249,6 +254,12 @@ ENV_TABLE
exit (EXIT_FAILURE);
}
+#ifdef SIGCHLD
+ /* We *MUST* set SIGCHLD to SIG_DFL so that the wait4() call will
+ receive the signal. A different setting is inheritable */
+ signal (SIGCHLD, SIG_DFL);
+#endif
+
#define _ENV_(v,m,n,t) { tSCC var[] = n; \
v = getenv (var); if (m && (v == NULL)) { \
fprintf (stderr, var_not_found, var); \
@@ -908,7 +919,7 @@ fix_with_system (p_fixd, pz_fix_file, pz_file_source, pz_temp_file)
/*
* Now add the fix number and file names that may be needed
*/
- sprintf (pz_scan, "%ld %s %s %s", p_fixd - fixDescList,
+ sprintf (pz_scan, "%ld \'%s\' \'%s\' \'%s\'", p_fixd - fixDescList,
pz_fix_file, pz_file_source, pz_temp_file);
}
else /* NOT an "internal" fix: */
@@ -927,7 +938,7 @@ fix_with_system (p_fixd, pz_fix_file, pz_file_source, pz_temp_file)
the following bizarre use of 'cat' only works on DOS boxes.
It causes the file to be dropped into a temporary file for
'cat' to read (pipes do not work on DOS). */
- tSCC z_cmd_fmt[] = " %s | cat > %s";
+ tSCC z_cmd_fmt[] = " \'%s\' | cat > \'%s\'";
#else
/* Don't use positional formatting arguments because some lame-o
implementations cannot cope :-(. */
@@ -1250,7 +1261,7 @@ test_for_changes (read_fd)
{
FILE *in_fp = fdopen (read_fd, "r");
FILE *out_fp = (FILE *) NULL;
- char *pz_cmp = pz_curr_data;
+ unsigned char *pz_cmp = (unsigned char*)pz_curr_data;
#ifdef DO_STATS
fixed_ct++;
@@ -1262,6 +1273,7 @@ test_for_changes (read_fd)
ch = getc (in_fp);
if (ch == EOF)
break;
+ ch &= 0xFF; /* all bytes are 8 bits */
/* IF we are emitting the output
THEN emit this character, too.
@@ -1280,8 +1292,9 @@ test_for_changes (read_fd)
altered_ct++;
#endif
/* IF there are matched data, write the matched part now. */
- if (pz_cmp != pz_curr_data)
- fwrite (pz_curr_data, (size_t)(pz_cmp - pz_curr_data), 1, out_fp);
+ if ((char*)pz_cmp != pz_curr_data)
+ fwrite (pz_curr_data, (size_t)((char*)pz_cmp - pz_curr_data),
+ 1, out_fp);
/* Emit the current unmatching character */
putc (ch, out_fp);
diff --git a/gcc/fixinc/fixincl.sh b/gcc/fixinc/fixincl.sh
index 18b5fb24651..b84d7014d97 100755
--- a/gcc/fixinc/fixincl.sh
+++ b/gcc/fixinc/fixincl.sh
@@ -97,6 +97,13 @@ esac
ORIGDIR=`${PWDCMD}`
export ORIGDIR
FIXINCL=${ORIGDIR}/fixinc/fixincl
+if [ ! -x $FIXINCL ] ; then
+ FIXINCL=${ORIGDIR}/fixincl
+ if [ ! -x $FIXINCL ] ; then
+ echo "Cannot find working fixincl" >&2
+ exit 1
+ fi
+fi
export FIXINCL
# Make LIB absolute only if needed to avoid problems with the amd.
@@ -470,11 +477,3 @@ then echo fixincludes is done ; fi
done
#
# # # # # # # # # # # # # # # # # # # # #
-
-if [ x${INSTALL_ASSERT_H} != x ] && [ -f ${srcdir}/assert.h ]
-then
- cd $ORIGDIR
- rm -f include/assert.h
- cp ${srcdir}/assert.h include/assert.h || exit 1
- chmod a+r include/assert.h
-fi
diff --git a/gcc/fixinc/fixincl.tpl b/gcc/fixinc/fixincl.tpl
index 780bdb8d2cb..e8aefd05dfe 100644
--- a/gcc/fixinc/fixincl.tpl
+++ b/gcc/fixinc/fixincl.tpl
@@ -1,4 +1,4 @@
-[= autogen template -*- Mode: C -*-
+[= AutoGen5 Template -*- Mode: C -*-
x=fixincl.x =]
/*
* DO NOT EDIT THIS FILE - it has been generated
@@ -7,171 +7,168 @@ x=fixincl.x =]
* files which are fixed to work correctly with ANSI C and placed in a
* directory that GNU C will search.
*
- * This file contains [=_eval fix _count =] fixup descriptions.
+ * This file contains [=(count "fix")=] fixup descriptions.
*
* See README for more information.
*
* inclhack copyright (c) 1998, 1999, 2000, 2001
* The Free Software Foundation, Inc.
*
-[=_eval inclhack "# * " _gpl=]
+ [=(define re-ct 0) (define max-mach 0) (define ct 0)
+ (define HACK "") (define Hack "") (define tmp "")
+ (gpl "inclhack" " * ")=]
*/
-[= _SETENV re_ct 0 =][= _SETENV max_mach 0 =][=
+[=
-_FOR fix =]
+FOR fix =]
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
- * Description of [=hackname _cap=] fix
+ * Description of [=
+ (set! Hack (string-capitalize! (get "hackname")))
+ (set! HACK (string-upcase! (get "hackname")))
+ (if (and (not (exist? "test_text")) (not (exist? "replace")))
+ (error (sprintf "include fix '%s' has no test text" Hack )) )
+ (. Hack)=] fix
*/[=
# Note that this is not just for debugging purposes, but in case
some C fix wishes to refer to the regexps it is paired with.
See commentary at the top of fixfixes.c.
=]
-#define [=hackname _up #_FIXIDX + #%-32s _printf=] [=_eval _index=]
-tSCC z[=hackname _cap=]Name[] =
- [=hackname _krstr=];
+tSCC z[=(. Hack)=]Name[] =
+ "[=hackname=]";
/*
* File name selection pattern
*/[=
- _IF files _exist=]
-tSCC z[=hackname _cap=]List[] =
- "[=_FOR files =]|[=files=][=/files=]|";[=
+ IF (exist? "files")=]
+tSCC z[=(. Hack)=]List[] =
+ "[=FOR files =]|[=files=][=ENDFOR=]|";[=
- _ELSE =]
-#define z[=hackname _cap=]List (char*)NULL[=
- _ENDIF "files _exist" =]
+ ELSE =]
+#define z[=(. Hack)=]List (char*)NULL[=
+ ENDIF (exist? "files") =]
/*
* Machine/OS name selection pattern
*/[=
- _IF mach _exist=]
-tSCC* apz[=hackname _cap=]Machs[] = {[=
- _SETENV this_mach 0 =][=
+ IF (exist? "mach")=]
+tSCC* apz[=(. Hack)=]Machs[] = {[=
+ (set! ct 0) =][=
- _FOR mach =]
- [=mach _krstr=],[=
- _SETENV this_mach mach _len this_mach _env _val 5 + +
- =][= /mach=]
+ FOR mach =]
+ [=
+ (set! tmp (get "mach"))
+ (set! ct (+ ct (string-length tmp) 5))
+ (kr-string tmp)=],[=
+ ENDFOR=]
(const char*)NULL };[=
- _SETENV max_mach _mark this_mach _env _val max_mach _env _val _max =][=
+ (if (> ct max-mach) (set! max-mach ct)) =][=
- _ELSE =]
-#define apz[=hackname _cap=]Machs (const char**)NULL[=
- _ENDIF "files _exist" =][=
+ ELSE =]
+#define apz[=(. Hack)=]Machs (const char**)NULL[=
+ ENDIF (exist? "files") =][=
- _IF select _exist=]
+ IF (exist? "select")=]
/*
* content selection pattern - do fix if pattern found
*/[=
- _FOR select =]
-tSCC z[=hackname _cap=]Select[=_eval _index=][] =
- [=select _krstr=];[=
- /select =][=
- _ENDIF =][=
+ FOR select =]
+tSCC z[=(. Hack)=]Select[=(for-index)=][] =
+ [=(kr-string (get "select"))=];[=
+ ENDFOR select =][=
+ ENDIF =][=
- _IF bypass _exist=]
+ IF (exist? "bypass")=]
/*
* content bypass pattern - skip fix if pattern found
*/[=
- _FOR bypass =]
-tSCC z[=hackname _cap=]Bypass[=_eval _index=][] =
- [=bypass _krstr=];[=
- /bypass =][=
- _ENDIF =][=
+ FOR bypass =]
+tSCC z[=(. Hack)=]Bypass[=(for-index)=][] =
+ [=(kr-string (get "bypass"))=];[=
+ ENDFOR bypass =][=
+ ENDIF =][=
- _IF test _exist=]
+ IF (exist? "test")=]
/*
* perform the 'test' shell command - do fix on success
*/[=
- _FOR test =]
-tSCC z[=hackname _cap=]Test[=_eval _index=][] =
- [=test _krstr=];[=
- /test =][=
- _ENDIF =][=
+ FOR test =]
+tSCC z[=(. Hack)=]Test[=(for-index)=][] =
+ [=(kr-string (get "test"))=];[=
+ ENDFOR =][=
+ ENDIF =][=
- _IF c_test _exist=]
+ IF (exist? "c_test")=]
/*
* perform the C function call test
*/[=
- _FOR c_test =]
-tSCC z[=hackname _cap=]FTst[=_eval _index=][] = "[=c_test=]";[=
- /c_test =][=
- _ENDIF =][=
+ FOR c_test =]
+tSCC z[=(. Hack)=]FTst[=(for-index)=][] = "[=c_test=]";[=
+ ENDFOR c_test =][=
+ ENDIF =][=
+ IF (set! ct (+ (count "select") (count "bypass")
+ (count "test") (count "c_test")))
-# Build the array of test descriptions for this fix: =][=
-
- _IF select _exist
- bypass _exist |
- test _exist |
- c_test _exist |
+ (= ct 0)
=]
+#define [=(. HACK)=]_TEST_CT 0
+#define a[=(. Hack)=]Tests (tTestDesc*)NULL[=
+ ELSE =]
+
+#define [=(. HACK)=]_TEST_CT [=(. ct)=][=
+ (set! re-ct (+ re-ct (count "select") (count "bypass"))) =]
+static tTestDesc a[=(. Hack)=]Tests[] = {[=
+
+ FOR test =]
+ { TT_TEST, z[=(. Hack)=]Test[=(for-index)=], 0 /* unused */ },[=
+ ENDFOR test =][=
-#define [=hackname _up =]_TEST_CT [=
- _eval select _count
- bypass _count +
- test _count +
- c_test _count + =][=
-_SETENV re_ct
- re_ct _env _val
- select _count +
- bypass _count + =]
-static tTestDesc a[=hackname _cap=]Tests[] = {[=
-
- _FOR test =]
- { TT_TEST, z[=hackname _cap=]Test[=_eval _index=], 0 /* unused */ },[=
- /test =][=
-
- _FOR c_test =]
- { TT_FUNCTION, z[=hackname _cap=]FTst[=_eval _index=], 0 /* unused */ },[=
- /c_test =][=
-
- _FOR bypass =]
- { TT_NEGREP, z[=hackname _cap=]Bypass[=_eval _index=], (regex_t*)NULL },[=
- /bypass =][=
-
- _FOR select =]
- { TT_EGREP, z[=hackname _cap=]Select[=_eval _index=], (regex_t*)NULL },[=
- /select =] };[=
- _ELSE =]
-#define [=hackname _up=]_TEST_CT 0
-#define a[=hackname _cap=]Tests (tTestDesc*)NULL[=
- _ENDIF =]
+ FOR c_test =]
+ { TT_FUNCTION, z[=(. Hack)=]FTst[=(for-index)=], 0 /* unused */ },[=
+ ENDFOR c_test =][=
+
+ FOR bypass =]
+ { TT_NEGREP, z[=(. Hack)=]Bypass[=(for-index)=], (regex_t*)NULL },[=
+ ENDFOR bypass =][=
+
+ FOR select =]
+ { TT_EGREP, z[=(. Hack)=]Select[=(for-index)=], (regex_t*)NULL },[=
+ ENDFOR select =] };[=
+ ENDIF =]
/*
- * Fix Command Arguments for [=hackname _cap=]
+ * Fix Command Arguments for [=(. Hack)=]
*/
-static const char* apz[=hackname _cap=]Patch[] = {[=
- _IF sed _exist =] "sed"[=
- _FOR sed=],
- "-e", [=sed _krstr=][=
- /sed=],[=
+static const char* apz[=(. Hack)=]Patch[] = {[=
+ IF (exist? "sed")=] "sed"[=
+ FOR sed=],
+ "-e", [=(kr-string (get "sed"))=][=
+ ENDFOR sed=],[=
- _ELIF shell _exist =] "sh", "-c",
- [=shell _krstr=],[=
+ ELIF (exist? "shell")=] "sh", "-c",
+ [=(kr-string (get "shell"))=],[=
- _ELIF c_fix _exist =]
- [=
- c_fix _krstr=],[=
+ ELIF (exist? "c_fix")=]
+ [=(kr-string (get "c_fix"))=],[=
- _FOR c_fix_arg =]
- [=c_fix_arg _krstr=],[=
- /c_fix_arg =][=
+ FOR c_fix_arg =]
+ [=(kr-string (get "c_fix_arg"))=],[=
+ ENDFOR c_fix_arg =][=
- _ELIF replace _len =]
-[=replace _krstr=],[=
+ ELIF (> (len "replace") 0) =]
+[=(kr-string (get "replace"))=],[=
- _ENDIF=]
+ ENDIF=]
(char*)NULL };
-[=/fix=]
+[=ENDFOR fix=]
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
@@ -181,25 +178,39 @@ static const char* apz[=hackname _cap=]Patch[] = {[=
We also must allow for the size of the target machine machine name.
This allows for a 79 byte machine name. Better be enough.
=]
-#define REGEX_COUNT [= _eval re_ct _env =]
-#define MACH_LIST_SIZE_LIMIT [= _eval max_mach _env _val 128 + =]
-#define FIX_COUNT [= _eval fix _count =]
+#define REGEX_COUNT [= (. re-ct) =]
+#define MACH_LIST_SIZE_LIMIT [= (+ 128 max-mach) =]
+#define FIX_COUNT [= (count "fix") =]
+
+/*
+ * Enumerate the fixes[= # in a way that minimizes diffs :-) =]
+ */
+typedef enum {[=
+
+FOR fix "," =]
+ [=(string-upcase! (get "hackname"))=]_FIXIDX[=
+ENDFOR
+
+=]
+} t_fixinc_idx;
tFixDesc fixDescList[ FIX_COUNT ] = {[=
-_FOR fix ",\n" =]
- { z[=hackname _cap=]Name, z[=hackname _cap=]List,
- apz[=hackname _cap=]Machs,
- [=hackname _up=]_TEST_CT, [=
- _IF not_machine _exist =]FD_MACH_IFNOT[=
- _ELSE =]FD_MACH_ONLY[=
- _ENDIF =][=
- _IF shell _exist =] | FD_SHELL_SCRIPT[=
- _ELIF c_fix _exist =] | FD_SUBROUTINE[=
- _ELIF replace _exist =] | FD_REPLACEMENT[=
- _ENDIF =],
- a[=hackname _cap=]Tests, apz[=hackname _cap=]Patch, 0 }[=
-
-/fix=]
+FOR fix ",\n" =][=
+ (set! Hack (string-capitalize! (get "hackname")))
+ (set! HACK (string-upcase! (get "hackname"))) =]
+ { z[=(. Hack)=]Name, z[=(. Hack)=]List,
+ apz[=(. Hack)=]Machs,
+ [=(. HACK)=]_TEST_CT, [=
+ IF (exist? "not_machine") =]FD_MACH_IFNOT[=
+ ELSE =]FD_MACH_ONLY[=
+ ENDIF =][=
+ IF (exist? "shell") =] | FD_SHELL_SCRIPT[=
+ ELIF (exist? "c_fix") =] | FD_SUBROUTINE[=
+ ELIF (exist? "replace") =] | FD_REPLACEMENT[=
+ ENDIF =],
+ a[=(. Hack)=]Tests, apz[=(. Hack)=]Patch, 0 }[=
+
+ENDFOR =]
};
diff --git a/gcc/fixinc/fixincl.x b/gcc/fixinc/fixincl.x
index f0d2ce47abd..dcd99015401 100644
--- a/gcc/fixinc/fixincl.x
+++ b/gcc/fixinc/fixincl.x
@@ -5,14 +5,14 @@
* files which are fixed to work correctly with ANSI C and placed in a
* directory that GNU C will search.
*
- * This file contains 131 fixup descriptions.
+ * This file contains 144 fixup descriptions.
*
* See README for more information.
*
* inclhack copyright (c) 1998, 1999, 2000, 2001
* The Free Software Foundation, Inc.
*
- * inclhack is free software.
+ * inclhack is free software.
*
* You may redistribute it and/or modify it under the terms of the
* GNU General Public License, as published by the Free Software
@@ -32,43 +32,33 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
- * Description of Aaa_Ki_Iface fix
+ * Description of Aaa_Bad_Fixes fix
*/
-#define AAA_KI_IFACE_FIXIDX 0
-tSCC zAaa_Ki_IfaceName[] =
- "AAA_ki_iface";
+tSCC zAaa_Bad_FixesName[] =
+ "AAA_bad_fixes";
/*
* File name selection pattern
*/
-tSCC zAaa_Ki_IfaceList[] =
- "|sys/ki_iface.h|";
+tSCC zAaa_Bad_FixesList[] =
+ "|sundev/ipi_error.h|";
/*
* Machine/OS name selection pattern
*/
-#define apzAaa_Ki_IfaceMachs (const char**)NULL
-
-/*
- * content selection pattern - do fix if pattern found
- */
-tSCC zAaa_Ki_IfaceSelect0[] =
- "These definitions are for HP Internal developers";
-
-#define AAA_KI_IFACE_TEST_CT 1
-static tTestDesc aAaa_Ki_IfaceTests[] = {
- { TT_EGREP, zAaa_Ki_IfaceSelect0, (regex_t*)NULL }, };
+#define apzAaa_Bad_FixesMachs (const char**)NULL
+#define AAA_BAD_FIXES_TEST_CT 0
+#define aAaa_Bad_FixesTests (tTestDesc*)NULL
/*
- * Fix Command Arguments for Aaa_Ki_Iface
+ * Fix Command Arguments for Aaa_Bad_Fixes
*/
-static const char* apzAaa_Ki_IfacePatch[] = {
+static const char* apzAaa_Bad_FixesPatch[] = {
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
* Description of Aaa_Ki fix
*/
-#define AAA_KI_FIXIDX 1
tSCC zAaa_KiName[] =
"AAA_ki";
@@ -102,7 +92,6 @@ static const char* apzAaa_KiPatch[] = {
*
* Description of Aaa_Ki_Calls fix
*/
-#define AAA_KI_CALLS_FIXIDX 2
tSCC zAaa_Ki_CallsName[] =
"AAA_ki_calls";
@@ -136,7 +125,6 @@ static const char* apzAaa_Ki_CallsPatch[] = {
*
* Description of Aaa_Ki_Defs fix
*/
-#define AAA_KI_DEFS_FIXIDX 3
tSCC zAaa_Ki_DefsName[] =
"AAA_ki_defs";
@@ -168,69 +156,74 @@ static const char* apzAaa_Ki_DefsPatch[] = {
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
- * Description of Aaa_Bad_Fixes fix
+ * Description of Aaa_Ki_Iface fix
*/
-#define AAA_BAD_FIXES_FIXIDX 4
-tSCC zAaa_Bad_FixesName[] =
- "AAA_bad_fixes";
+tSCC zAaa_Ki_IfaceName[] =
+ "AAA_ki_iface";
/*
* File name selection pattern
*/
-tSCC zAaa_Bad_FixesList[] =
- "|sundev/ipi_error.h|";
+tSCC zAaa_Ki_IfaceList[] =
+ "|sys/ki_iface.h|";
/*
* Machine/OS name selection pattern
*/
-#define apzAaa_Bad_FixesMachs (const char**)NULL
-#define AAA_BAD_FIXES_TEST_CT 0
-#define aAaa_Bad_FixesTests (tTestDesc*)NULL
+#define apzAaa_Ki_IfaceMachs (const char**)NULL
/*
- * Fix Command Arguments for Aaa_Bad_Fixes
+ * content selection pattern - do fix if pattern found
*/
-static const char* apzAaa_Bad_FixesPatch[] = {
+tSCC zAaa_Ki_IfaceSelect0[] =
+ "These definitions are for HP Internal developers";
+
+#define AAA_KI_IFACE_TEST_CT 1
+static tTestDesc aAaa_Ki_IfaceTests[] = {
+ { TT_EGREP, zAaa_Ki_IfaceSelect0, (regex_t*)NULL }, };
+
+/*
+ * Fix Command Arguments for Aaa_Ki_Iface
+ */
+static const char* apzAaa_Ki_IfacePatch[] = {
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
- * Description of Aaa_Time fix
+ * Description of Aaa_Standards fix
*/
-#define AAA_TIME_FIXIDX 5
-tSCC zAaa_TimeName[] =
- "AAA_time";
+tSCC zAaa_StandardsName[] =
+ "AAA_standards";
/*
* File name selection pattern
*/
-tSCC zAaa_TimeList[] =
- "|sys/time.h|";
+tSCC zAaa_StandardsList[] =
+ "|standards.h|";
/*
* Machine/OS name selection pattern
*/
-#define apzAaa_TimeMachs (const char**)NULL
+#define apzAaa_StandardsMachs (const char**)NULL
/*
* content selection pattern - do fix if pattern found
*/
-tSCC zAaa_TimeSelect0[] =
- "11.0 and later representation of ki time";
+tSCC zAaa_StandardsSelect0[] =
+ "GNU and MIPS C compilers define __STDC__ differently";
-#define AAA_TIME_TEST_CT 1
-static tTestDesc aAaa_TimeTests[] = {
- { TT_EGREP, zAaa_TimeSelect0, (regex_t*)NULL }, };
+#define AAA_STANDARDS_TEST_CT 1
+static tTestDesc aAaa_StandardsTests[] = {
+ { TT_EGREP, zAaa_StandardsSelect0, (regex_t*)NULL }, };
/*
- * Fix Command Arguments for Aaa_Time
+ * Fix Command Arguments for Aaa_Standards
*/
-static const char* apzAaa_TimePatch[] = {
+static const char* apzAaa_StandardsPatch[] = {
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
* Description of Aab_Dgux_Int_Varargs fix
*/
-#define AAB_DGUX_INT_VARARGS_FIXIDX 6
tSCC zAab_Dgux_Int_VarargsName[] =
"AAB_dgux_int_varargs";
@@ -251,64 +244,48 @@ tSCC zAab_Dgux_Int_VarargsList[] =
*/
static const char* apzAab_Dgux_Int_VarargsPatch[] = {
"#ifndef __INT_VARARGS_H\n\
-#define __INT_VARARGS_H\n\
-\n\
+#define __INT_VARARGS_H\n\n\
/************************************************************************/\n\
/* _INT_VARARGS.H - Define the common stuff for varargs/stdarg/stdio. */\n\
-/************************************************************************/\n\
-\n\
+/************************************************************************/\n\n\
/*\n\
** This file is a DG internal header. Never include this\n\
** file directly.\n\
-*/\n\
-\n\
+*/\n\n\
#ifndef ___int_features_h\n\
-#include &lt;sys/_int_features.h&gt;\n\
-#endif\n\
-\n\
+#include <sys/_int_features.h>\n\
+#endif\n\n\
#if !(defined(_VA_LIST) || defined(_VA_LIST_))\n\
#define _VA_LIST\n\
-#define _VA_LIST_\n\
-\n\
-#ifdef __LINT__\n\
-\n\
+#define _VA_LIST_\n\n\
+#ifdef __LINT__\n\n\
#ifdef __STDC__\n\
typedef void * va_list;\n\
#else\n\
typedef char * va_list;\n\
-#endif\n\
-\n\
+#endif\n\n\
#else\n\
-#if _M88K_ANY\n\
-\n\
-#if defined(__DCC__)\n\
-\n\
+#if _M88K_ANY\n\n\
+#if defined(__DCC__)\n\n\
typedef struct {\n\
int next_arg;\n\
int *mem_ptr;\n\
int *reg_ptr;\n\
-} va_list;\n\
-\n\
-#else /* ! defined(__DCC__) */\n\
-\n\
+} va_list;\n\n\
+#else /* ! defined(__DCC__) */\n\n\
typedef struct {\n\
int __va_arg; /* argument number */\n\
int *__va_stk; /* start of args passed on stack */\n\
int *__va_reg; /* start of args passed in regs */\n\
-} va_list;\n\
-\n\
-#endif /* ! defined(__DCC__) */\n\
-\n\
-#elif _IX86_ANY\n\
-\n\
+} va_list;\n\n\
+#endif /* ! defined(__DCC__) */\n\n\
+#elif _IX86_ANY\n\n\
#if defined(__GNUC__) || defined(__STDC__)\n\
typedef void * va_list;\n\
#else\n\
typedef char * va_list;\n\
-#endif\n\
-\n\
-#endif /* _IX86_ANY */\n\
-\n\
+#endif\n\n\
+#endif /* _IX86_ANY */\n\n\
#endif /* __LINT__ */\n\
#endif /* !(defined(_VA_LIST) || defined(_VA_LIST_)) */\n\
#endif /* #ifndef __INT_VARARGS_H */\n",
@@ -318,7 +295,6 @@ typedef char * va_list;\n\
*
* Description of Aab_Fd_Zero_Asm_Posix_Types_H fix
*/
-#define AAB_FD_ZERO_ASM_POSIX_TYPES_H_FIXIDX 7
tSCC zAab_Fd_Zero_Asm_Posix_Types_HName[] =
"AAB_fd_zero_asm_posix_types_h";
@@ -352,8 +328,7 @@ static const char* apzAab_Fd_Zero_Asm_Posix_Types_HPatch[] = {
for older versions of the Linux kernel. */\n\
#ifndef _POSIX_TYPES_H_WRAPPER\n\
#include <features.h>\n\
- #include_next <asm/posix_types.h>\n\
-\n\
+ #include_next <asm/posix_types.h>\n\n\
#if defined(__FD_ZERO) && !defined(__GLIBC__)\n\
#undef __FD_ZERO\n\
#define __FD_ZERO(fdsetp) \\\n\
@@ -364,8 +339,7 @@ static const char* apzAab_Fd_Zero_Asm_Posix_Types_HPatch[] = {
\t\t\t: \"a\" (0), \"0\" (__FDSET_LONGS), \\\n\
\t\t\t \"1\" ((__kernel_fd_set *) (fdsetp)) :\"memory\"); \\\n\
} while (0)\n\
-#endif\n\
-\n\
+#endif\n\n\
#define _POSIX_TYPES_H_WRAPPER\n\
#endif /* _POSIX_TYPES_H_WRAPPER */\n",
(char*)NULL };
@@ -374,7 +348,6 @@ static const char* apzAab_Fd_Zero_Asm_Posix_Types_HPatch[] = {
*
* Description of Aab_Fd_Zero_Gnu_Types_H fix
*/
-#define AAB_FD_ZERO_GNU_TYPES_H_FIXIDX 8
tSCC zAab_Fd_Zero_Gnu_Types_HName[] =
"AAB_fd_zero_gnu_types_h";
@@ -399,8 +372,7 @@ static const char* apzAab_Fd_Zero_Gnu_Types_HPatch[] = {
"/* This file fixes a bug in the __FD_ZERO macro present in glibc 1.x. */\n\
#ifndef _TYPES_H_WRAPPER\n\
#include <features.h>\n\
- #include_next <gnu/types.h>\n\
-\n\
+ #include_next <gnu/types.h>\n\n\
#if defined(__FD_ZERO) && !defined(__GLIBC__)\n\
#undef __FD_ZERO\n\
# define __FD_ZERO(fdsetp) \\\n\
@@ -411,8 +383,7 @@ static const char* apzAab_Fd_Zero_Gnu_Types_HPatch[] = {
\t: \"a\" (0), \"0\" (__FDSET_LONGS), \\\n\
\t\t \"1\" ((__fd_set *) (fdsetp)) :\"memory\"); \\\n\
} while (0)\n\
-#endif\n\
-\n\
+#endif\n\n\
#define _TYPES_H_WRAPPER\n\
#endif /* _TYPES_H_WRAPPER */\n",
(char*)NULL };
@@ -421,7 +392,6 @@ static const char* apzAab_Fd_Zero_Gnu_Types_HPatch[] = {
*
* Description of Aab_Fd_Zero_Selectbits_H fix
*/
-#define AAB_FD_ZERO_SELECTBITS_H_FIXIDX 9
tSCC zAab_Fd_Zero_Selectbits_HName[] =
"AAB_fd_zero_selectbits_h";
@@ -446,8 +416,7 @@ static const char* apzAab_Fd_Zero_Selectbits_HPatch[] = {
"/* This file fixes a bug in the __FD_ZERO macro present in glibc 2.0.x. */\n\
#ifndef _SELECTBITS_H_WRAPPER\n\
#include <features.h>\n\
- #include_next <selectbits.h>\n\
-\n\
+ #include_next <selectbits.h>\n\n\
#if defined(__FD_ZERO) && defined(__GLIBC__) \\\n\
\t&& defined(__GLIBC_MINOR__) && __GLIBC__ == 2 \\\n\
\t&& __GLIBC_MINOR__ == 0\n\
@@ -462,8 +431,7 @@ static const char* apzAab_Fd_Zero_Selectbits_HPatch[] = {
\"1\" ((__fd_mask *) (fdsetp)) \\\n\
: \"memory\"); \\\n\
} while (0)\n\
-#endif\n\
-\n\
+#endif\n\n\
#define _SELECTBITS_H_WRAPPER\n\
#endif /* _SELECTBITS_H_WRAPPER */\n",
(char*)NULL };
@@ -472,7 +440,6 @@ static const char* apzAab_Fd_Zero_Selectbits_HPatch[] = {
*
* Description of Aab_Sun_Memcpy fix
*/
-#define AAB_SUN_MEMCPY_FIXIDX 10
tSCC zAab_Sun_MemcpyName[] =
"AAB_sun_memcpy";
@@ -502,8 +469,7 @@ static tTestDesc aAab_Sun_MemcpyTests[] = {
static const char* apzAab_Sun_MemcpyPatch[] = {
"/* This file was generated by fixincludes */\n\
#ifndef __memory_h__\n\
-#define __memory_h__\n\
-\n\
+#define __memory_h__\n\n\
#ifdef __STDC__\n\
extern void *memccpy();\n\
extern void *memchr();\n\
@@ -514,10 +480,8 @@ extern char *memccpy();\n\
extern char *memchr();\n\
extern char *memcpy();\n\
extern char *memset();\n\
-#endif /* __STDC__ */\n\
-\n\
-extern int memcmp();\n\
-\n\
+#endif /* __STDC__ */\n\n\
+extern int memcmp();\n\n\
#endif /* __memory_h__ */\n",
(char*)NULL };
@@ -525,7 +489,6 @@ extern int memcmp();\n\
*
* Description of Aab_Svr4_Replace_Byteorder fix
*/
-#define AAB_SVR4_REPLACE_BYTEORDER_FIXIDX 11
tSCC zAab_Svr4_Replace_ByteorderName[] =
"AAB_svr4_replace_byteorder";
@@ -553,142 +516,106 @@ tSCC* apzAab_Svr4_Replace_ByteorderMachs[] = {
*/
static const char* apzAab_Svr4_Replace_ByteorderPatch[] = {
"#ifndef _SYS_BYTEORDER_H\n\
-#define _SYS_BYTEORDER_H\n\
-\n\
+#define _SYS_BYTEORDER_H\n\n\
/* Functions to convert `short' and `long' quantities from host byte order\n\
- to (internet) network byte order (i.e. big-endian).\n\
-\n\
- Written by Ron Guilmette (rfg@ncd.com).\n\
-\n\
- This isn't actually used by GCC. It is installed by fixinc.svr4.\n\
-\n\
- For big-endian machines these functions are essentially no-ops.\n\
-\n\
+ to (internet) network byte order (i.e. big-endian).\n\n\
+ Written by Ron Guilmette (rfg@ncd.com).\n\n\
+ This isn't actually used by GCC. It is installed by fixinc.svr4.\n\n\
+ For big-endian machines these functions are essentially no-ops.\n\n\
For little-endian machines, we define the functions using specialized\n\
- asm sequences in cases where doing so yields better code (e.g. i386). */\n\
-\n\
+ asm sequences in cases where doing so yields better code (e.g. i386). */\n\n\
#if !defined (__GNUC__) && !defined (__GNUG__)\n\
#error You lose! This file is only useful with GNU compilers.\n\
-#endif\n\
-\n\
+#endif\n\n\
#ifndef __BYTE_ORDER__\n\
/* Byte order defines. These are as defined on UnixWare 1.1, but with\n\
double underscores added at the front and back. */\n\
#define __LITTLE_ENDIAN__ 1234\n\
#define __BIG_ENDIAN__ 4321\n\
#define __PDP_ENDIAN__ 3412\n\
-#endif\n\
-\n\
+#endif\n\n\
#ifdef __STDC__\n\
static __inline__ unsigned long htonl (unsigned long);\n\
static __inline__ unsigned short htons (unsigned int);\n\
static __inline__ unsigned long ntohl (unsigned long);\n\
static __inline__ unsigned short ntohs (unsigned int);\n\
-#endif /* defined (__STDC__) */\n\
-\n\
-#if defined (__i386__)\n\
-\n\
+#endif /* defined (__STDC__) */\n\n\
+#if defined (__i386__)\n\n\
#ifndef __BYTE_ORDER__\n\
#define __BYTE_ORDER__ __LITTLE_ENDIAN__\n\
-#endif\n\
-\n\
-/* Convert a host long to a network long. */\n\
-\n\
+#endif\n\n\
+/* Convert a host long to a network long. */\n\n\
/* We must use a new-style function definition, so that this will also\n\
be valid for C++. */\n\
static __inline__ unsigned long\n\
htonl (unsigned long __arg)\n\
{\n\
- register unsigned long __result;\n\
-\n\
+ register unsigned long __result;\n\n\
__asm__ (\"xchg%B0 %b0,%h0\n\
\tror%L0 $16,%0\n\
\txchg%B0 %b0,%h0\" : \"=q\" (__result) : \"0\" (__arg));\n\
return __result;\n\
-}\n\
-\n\
-/* Convert a host short to a network short. */\n\
-\n\
+}\n\n\
+/* Convert a host short to a network short. */\n\n\
static __inline__ unsigned short\n\
htons (unsigned int __arg)\n\
{\n\
- register unsigned short __result;\n\
-\n\
+ register unsigned short __result;\n\n\
__asm__ (\"xchg%B0 %b0,%h0\" : \"=q\" (__result) : \"0\" (__arg));\n\
return __result;\n\
-}\n\
-\n\
+}\n\n\
#elif ((defined (__i860__) && !defined (__i860_big_endian__))\t\\\n\
|| defined (__ns32k__) || defined (__vax__)\t\t\\\n\
- || defined (__spur__) || defined (__arm__))\n\
-\n\
+ || defined (__spur__) || defined (__arm__))\n\n\
#ifndef __BYTE_ORDER__\n\
#define __BYTE_ORDER__ __LITTLE_ENDIAN__\n\
-#endif\n\
-\n\
+#endif\n\n\
/* For other little-endian machines, using C code is just as efficient as\n\
- using assembly code. */\n\
-\n\
-/* Convert a host long to a network long. */\n\
-\n\
+ using assembly code. */\n\n\
+/* Convert a host long to a network long. */\n\n\
static __inline__ unsigned long\n\
htonl (unsigned long __arg)\n\
{\n\
- register unsigned long __result;\n\
-\n\
+ register unsigned long __result;\n\n\
__result = (__arg >> 24) & 0x000000ff;\n\
__result |= (__arg >> 8) & 0x0000ff00;\n\
__result |= (__arg << 8) & 0x00ff0000;\n\
__result |= (__arg << 24) & 0xff000000;\n\
return __result;\n\
-}\n\
-\n\
-/* Convert a host short to a network short. */\n\
-\n\
+}\n\n\
+/* Convert a host short to a network short. */\n\n\
static __inline__ unsigned short\n\
htons (unsigned int __arg)\n\
{\n\
- register unsigned short __result;\n\
-\n\
+ register unsigned short __result;\n\n\
__result = (__arg << 8) & 0xff00;\n\
__result |= (__arg >> 8) & 0x00ff;\n\
return __result;\n\
-}\n\
-\n\
-#else /* must be a big-endian machine */\n\
-\n\
+}\n\n\
+#else /* must be a big-endian machine */\n\n\
#ifndef __BYTE_ORDER__\n\
#define __BYTE_ORDER__ __BIG_ENDIAN__\n\
-#endif\n\
-\n\
-/* Convert a host long to a network long. */\n\
-\n\
+#endif\n\n\
+/* Convert a host long to a network long. */\n\n\
static __inline__ unsigned long\n\
htonl (unsigned long __arg)\n\
{\n\
return __arg;\n\
-}\n\
-\n\
-/* Convert a host short to a network short. */\n\
-\n\
+}\n\n\
+/* Convert a host short to a network short. */\n\n\
static __inline__ unsigned short\n\
htons (unsigned int __arg)\n\
{\n\
return __arg;\n\
-}\n\
-\n\
-#endif /* big-endian */\n\
-\n\
-/* Convert a network long to a host long. */\n\
-\n\
+}\n\n\
+#endif /* big-endian */\n\n\
+/* Convert a network long to a host long. */\n\n\
static __inline__ unsigned long\n\
ntohl (unsigned long __arg)\n\
{\n\
return htonl (__arg);\n\
-}\n\
-\n\
-/* Convert a network short to a host short. */\n\
-\n\
+}\n\n\
+/* Convert a network short to a host short. */\n\n\
static __inline__ unsigned short\n\
ntohs (unsigned int __arg)\n\
{\n\
@@ -701,7 +628,6 @@ ntohs (unsigned int __arg)\n\
*
* Description of Aab_Ultrix_Ansi_Compat fix
*/
-#define AAB_ULTRIX_ANSI_COMPAT_FIXIDX 12
tSCC zAab_Ultrix_Ansi_CompatName[] =
"AAB_ultrix_ansi_compat";
@@ -736,7 +662,6 @@ static const char* apzAab_Ultrix_Ansi_CompatPatch[] = {
*
* Description of Aab_Ultrix_Limits fix
*/
-#define AAB_ULTRIX_LIMITS_FIXIDX 13
tSCC zAab_Ultrix_LimitsName[] =
"AAB_ultrix_limits";
@@ -758,9 +683,7 @@ tSCC* apzAab_Ultrix_LimitsMachs[] = {
* Fix Command Arguments for Aab_Ultrix_Limits
*/
static const char* apzAab_Ultrix_LimitsPatch[] = {
-"/*\t@(#)limits.h\t\t\t\t*/\n\
-/* This file was generated by fixincludes\t*/\n\
-#ifndef _LIMITS_INCLUDED\n\
+"#ifndef _LIMITS_INCLUDED\n\
#define _LIMITS_INCLUDED\n\
#include <sys/limits.h>\n\
#endif /* _LIMITS_INCLUDED */\n",
@@ -770,7 +693,6 @@ static const char* apzAab_Ultrix_LimitsPatch[] = {
*
* Description of Aab_Ultrix_Memory fix
*/
-#define AAB_ULTRIX_MEMORY_FIXIDX 14
tSCC zAab_Ultrix_MemoryName[] =
"AAB_ultrix_memory";
@@ -792,9 +714,7 @@ tSCC* apzAab_Ultrix_MemoryMachs[] = {
* Fix Command Arguments for Aab_Ultrix_Memory
*/
static const char* apzAab_Ultrix_MemoryPatch[] = {
-"/*\t@(#)memory.h\t\t\t\t*/\n\
-/* This file was generated by fixincludes\t*/\n\
-#ifndef _MEMORY_INCLUDED\n\
+"#ifndef _MEMORY_INCLUDED\n\
#define _MEMORY_INCLUDED\n\
#include <strings.h>\n\
#endif /* _MEMORY_INCLUDED */\n",
@@ -804,7 +724,6 @@ static const char* apzAab_Ultrix_MemoryPatch[] = {
*
* Description of Aab_Ultrix_String fix
*/
-#define AAB_ULTRIX_STRING_FIXIDX 15
tSCC zAab_Ultrix_StringName[] =
"AAB_ultrix_string";
@@ -826,9 +745,7 @@ tSCC* apzAab_Ultrix_StringMachs[] = {
* Fix Command Arguments for Aab_Ultrix_String
*/
static const char* apzAab_Ultrix_StringPatch[] = {
-"/*\t@(#)string.h\t\t\t\t*/\n\
-/* This file was generated by fixincludes\t*/\n\
-#ifndef _STRING_INCLUDED\n\
+"#ifndef _STRING_INCLUDED\n\
#define _STRING_INCLUDED\n\
#include <strings.h>\n\
#endif /* _STRING_INCLUDED */\n",
@@ -838,7 +755,6 @@ static const char* apzAab_Ultrix_StringPatch[] = {
*
* Description of Aix_Pthread fix
*/
-#define AIX_PTHREAD_FIXIDX 16
tSCC zAix_PthreadName[] =
"aix_pthread";
@@ -876,7 +792,6 @@ static const char* apzAix_PthreadPatch[] = {
*
* Description of Aix_Sysmachine fix
*/
-#define AIX_SYSMACHINE_FIXIDX 17
tSCC zAix_SysmachineName[] =
"aix_sysmachine";
@@ -912,7 +827,6 @@ static const char* apzAix_SysmachinePatch[] = {
*
* Description of Aix_Syswait fix
*/
-#define AIX_SYSWAIT_FIXIDX 18
tSCC zAix_SyswaitName[] =
"aix_syswait";
@@ -952,7 +866,6 @@ static const char* apzAix_SyswaitPatch[] = {
*
* Description of Aix_Volatile fix
*/
-#define AIX_VOLATILE_FIXIDX 19
tSCC zAix_VolatileName[] =
"aix_volatile";
@@ -986,9 +899,43 @@ static const char* apzAix_VolatilePatch[] = {
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
+ * Description of Alpha___Assert fix
+ */
+tSCC zAlpha___AssertName[] =
+ "alpha___assert";
+
+/*
+ * File name selection pattern
+ */
+tSCC zAlpha___AssertList[] =
+ "|assert.h|";
+/*
+ * Machine/OS name selection pattern
+ */
+#define apzAlpha___AssertMachs (const char**)NULL
+
+/*
+ * content selection pattern - do fix if pattern found
+ */
+tSCC zAlpha___AssertSelect0[] =
+ "__assert\\(char \\*, char \\*, int\\)";
+
+#define ALPHA___ASSERT_TEST_CT 1
+static tTestDesc aAlpha___AssertTests[] = {
+ { TT_EGREP, zAlpha___AssertSelect0, (regex_t*)NULL }, };
+
+/*
+ * Fix Command Arguments for Alpha___Assert
+ */
+static const char* apzAlpha___AssertPatch[] = {
+ "format",
+ "__assert(const char *, const char *, int)",
+ (char*)NULL };
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
* Description of Alpha_Getopt fix
*/
-#define ALPHA_GETOPT_FIXIDX 20
tSCC zAlpha_GetoptName[] =
"alpha_getopt";
@@ -1024,7 +971,6 @@ static const char* apzAlpha_GetoptPatch[] = {
*
* Description of Alpha_Parens fix
*/
-#define ALPHA_PARENS_FIXIDX 21
tSCC zAlpha_ParensName[] =
"alpha_parens";
@@ -1060,7 +1006,6 @@ static const char* apzAlpha_ParensPatch[] = {
*
* Description of Alpha_Sbrk fix
*/
-#define ALPHA_SBRK_FIXIDX 22
tSCC zAlpha_SbrkName[] =
"alpha_sbrk";
@@ -1096,7 +1041,6 @@ static const char* apzAlpha_SbrkPatch[] = {
*
* Description of Arm_Norcroft_Hint fix
*/
-#define ARM_NORCROFT_HINT_FIXIDX 23
tSCC zArm_Norcroft_HintName[] =
"arm_norcroft_hint";
@@ -1132,7 +1076,6 @@ static const char* apzArm_Norcroft_HintPatch[] = {
*
* Description of Arm_Wchar fix
*/
-#define ARM_WCHAR_FIXIDX 24
tSCC zArm_WcharName[] =
"arm_wchar";
@@ -1169,7 +1112,6 @@ static const char* apzArm_WcharPatch[] = {
*
* Description of Aux_Asm fix
*/
-#define AUX_ASM_FIXIDX 25
tSCC zAux_AsmName[] =
"aux_asm";
@@ -1205,7 +1147,6 @@ static const char* apzAux_AsmPatch[] = {
*
* Description of Avoid_Bool_Define fix
*/
-#define AVOID_BOOL_DEFINE_FIXIDX 26
tSCC zAvoid_Bool_DefineName[] =
"avoid_bool_define";
@@ -1251,7 +1192,6 @@ static const char* apzAvoid_Bool_DefinePatch[] = {
*
* Description of Avoid_Bool_Type fix
*/
-#define AVOID_BOOL_TYPE_FIXIDX 27
tSCC zAvoid_Bool_TypeName[] =
"avoid_bool_type";
@@ -1296,7 +1236,6 @@ static const char* apzAvoid_Bool_TypePatch[] = {
*
* Description of Avoid_Wchar_T_Type fix
*/
-#define AVOID_WCHAR_T_TYPE_FIXIDX 28
tSCC zAvoid_Wchar_T_TypeName[] =
"avoid_wchar_t_type";
@@ -1333,7 +1272,6 @@ static const char* apzAvoid_Wchar_T_TypePatch[] = {
*
* Description of Bad_Lval fix
*/
-#define BAD_LVAL_FIXIDX 29
tSCC zBad_LvalName[] =
"bad_lval";
@@ -1368,7 +1306,6 @@ static const char* apzBad_LvalPatch[] = { "sed",
*
* Description of Bad_Struct_Term fix
*/
-#define BAD_STRUCT_TERM_FIXIDX 30
tSCC zBad_Struct_TermName[] =
"bad_struct_term";
@@ -1404,7 +1341,6 @@ static const char* apzBad_Struct_TermPatch[] = {
*
* Description of Badquote fix
*/
-#define BADQUOTE_FIXIDX 31
tSCC zBadquoteName[] =
"badquote";
@@ -1440,7 +1376,6 @@ static const char* apzBadquotePatch[] = {
*
* Description of Broken_Assert_Stdio fix
*/
-#define BROKEN_ASSERT_STDIO_FIXIDX 32
tSCC zBroken_Assert_StdioName[] =
"broken_assert_stdio";
@@ -1483,7 +1418,6 @@ static const char* apzBroken_Assert_StdioPatch[] = {
*
* Description of Broken_Assert_Stdlib fix
*/
-#define BROKEN_ASSERT_STDLIB_FIXIDX 33
tSCC zBroken_Assert_StdlibName[] =
"broken_assert_stdlib";
@@ -1528,7 +1462,6 @@ static const char* apzBroken_Assert_StdlibPatch[] = {
*
* Description of Broken_Cabs fix
*/
-#define BROKEN_CABS_FIXIDX 34
tSCC zBroken_CabsName[] =
"broken_cabs";
@@ -1565,7 +1498,6 @@ static const char* apzBroken_CabsPatch[] = {
*
* Description of Ctrl_Quotes_Def fix
*/
-#define CTRL_QUOTES_DEF_FIXIDX 35
tSCC zCtrl_Quotes_DefName[] =
"ctrl_quotes_def";
@@ -1600,7 +1532,6 @@ static const char* apzCtrl_Quotes_DefPatch[] = {
*
* Description of Ctrl_Quotes_Use fix
*/
-#define CTRL_QUOTES_USE_FIXIDX 36
tSCC zCtrl_Quotes_UseName[] =
"ctrl_quotes_use";
@@ -1635,7 +1566,6 @@ static const char* apzCtrl_Quotes_UsePatch[] = {
*
* Description of Cxx_Unready fix
*/
-#define CXX_UNREADY_FIXIDX 37
tSCC zCxx_UnreadyName[] =
"cxx_unready";
@@ -1683,7 +1613,6 @@ extern \"C\" {\n\
*
* Description of Dec_Intern_Asm fix
*/
-#define DEC_INTERN_ASM_FIXIDX 38
tSCC zDec_Intern_AsmName[] =
"dec_intern_asm";
@@ -1711,9 +1640,51 @@ static const char* apzDec_Intern_AsmPatch[] = { "sed",
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
+ * Description of Djgpp_Wchar_H fix
+ */
+tSCC zDjgpp_Wchar_HName[] =
+ "djgpp_wchar_h";
+
+/*
+ * File name selection pattern
+ */
+#define zDjgpp_Wchar_HList (char*)NULL
+/*
+ * Machine/OS name selection pattern
+ */
+#define apzDjgpp_Wchar_HMachs (const char**)NULL
+
+/*
+ * content selection pattern - do fix if pattern found
+ */
+tSCC zDjgpp_Wchar_HSelect0[] =
+ "__DJ_wint_t";
+
+/*
+ * content bypass pattern - skip fix if pattern found
+ */
+tSCC zDjgpp_Wchar_HBypass0[] =
+ "sys/djtypes.h";
+
+#define DJGPP_WCHAR_H_TEST_CT 2
+static tTestDesc aDjgpp_Wchar_HTests[] = {
+ { TT_NEGREP, zDjgpp_Wchar_HBypass0, (regex_t*)NULL },
+ { TT_EGREP, zDjgpp_Wchar_HSelect0, (regex_t*)NULL }, };
+
+/*
+ * Fix Command Arguments for Djgpp_Wchar_H
+ */
+static const char* apzDjgpp_Wchar_HPatch[] = {
+ "format",
+ "%0\n\
+#include <sys/djtypes.h>",
+ "#include <stddef.h>",
+ (char*)NULL };
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
* Description of Ecd_Cursor fix
*/
-#define ECD_CURSOR_FIXIDX 39
tSCC zEcd_CursorName[] =
"ecd_cursor";
@@ -1749,7 +1720,6 @@ static const char* apzEcd_CursorPatch[] = {
*
* Description of Fix_Header_Breakage fix
*/
-#define FIX_HEADER_BREAKAGE_FIXIDX 40
tSCC zFix_Header_BreakageName[] =
"fix_header_breakage";
@@ -1785,9 +1755,93 @@ static const char* apzFix_Header_BreakagePatch[] = {
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
+ * Description of Freebsd_Gcc3_Breakage fix
+ */
+tSCC zFreebsd_Gcc3_BreakageName[] =
+ "freebsd_gcc3_breakage";
+
+/*
+ * File name selection pattern
+ */
+tSCC zFreebsd_Gcc3_BreakageList[] =
+ "|sys/cdefs.h|";
+/*
+ * Machine/OS name selection pattern
+ */
+tSCC* apzFreebsd_Gcc3_BreakageMachs[] = {
+ "*-*-freebsd*",
+ (const char*)NULL };
+
+/*
+ * content selection pattern - do fix if pattern found
+ */
+tSCC zFreebsd_Gcc3_BreakageSelect0[] =
+ "^#if __GNUC__ == 2 && __GNUC_MINOR__ >= 7$";
+
+/*
+ * content bypass pattern - skip fix if pattern found
+ */
+tSCC zFreebsd_Gcc3_BreakageBypass0[] =
+ "__GNUC__[ \\t]*([>=]=[ \\t]*[3-9]|>[ \\t]*2)";
+
+#define FREEBSD_GCC3_BREAKAGE_TEST_CT 2
+static tTestDesc aFreebsd_Gcc3_BreakageTests[] = {
+ { TT_NEGREP, zFreebsd_Gcc3_BreakageBypass0, (regex_t*)NULL },
+ { TT_EGREP, zFreebsd_Gcc3_BreakageSelect0, (regex_t*)NULL }, };
+
+/*
+ * Fix Command Arguments for Freebsd_Gcc3_Breakage
+ */
+static const char* apzFreebsd_Gcc3_BreakagePatch[] = {
+ "format",
+ "%0 || __GNUC__ >= 3",
+ (char*)NULL };
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
+ * Description of Gnu_Types fix
+ */
+tSCC zGnu_TypesName[] =
+ "gnu_types";
+
+/*
+ * File name selection pattern
+ */
+tSCC zGnu_TypesList[] =
+ "|sys/types.h|stdlib.h|sys/stdtypes.h|stddef.h|memory.h|unistd.h|";
+/*
+ * Machine/OS name selection pattern
+ */
+#define apzGnu_TypesMachs (const char**)NULL
+
+/*
+ * content selection pattern - do fix if pattern found
+ */
+tSCC zGnu_TypesSelect0[] =
+ "^[ \t]*typedef[ \t]+.*[ \t](ptrdiff|size|wchar)_t;";
+
+/*
+ * content bypass pattern - skip fix if pattern found
+ */
+tSCC zGnu_TypesBypass0[] =
+ "_GCC_(PTRDIFF|SIZE|WCHAR)_T";
+
+#define GNU_TYPES_TEST_CT 2
+static tTestDesc aGnu_TypesTests[] = {
+ { TT_NEGREP, zGnu_TypesBypass0, (regex_t*)NULL },
+ { TT_EGREP, zGnu_TypesSelect0, (regex_t*)NULL }, };
+
+/*
+ * Fix Command Arguments for Gnu_Types
+ */
+static const char* apzGnu_TypesPatch[] = {
+ "gnu_type",
+ (char*)NULL };
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
* Description of Hp_Inline fix
*/
-#define HP_INLINE_FIXIDX 41
tSCC zHp_InlineName[] =
"hp_inline";
@@ -1824,7 +1878,6 @@ static const char* apzHp_InlinePatch[] = {
*
* Description of Hp_Sysfile fix
*/
-#define HP_SYSFILE_FIXIDX 42
tSCC zHp_SysfileName[] =
"hp_sysfile";
@@ -1859,270 +1912,274 @@ static const char* apzHp_SysfilePatch[] = {
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
- * Description of Hpux11_Fabsf fix
+ * Description of Hpux10_Cpp_Pow_Inline fix
*/
-#define HPUX11_FABSF_FIXIDX 43
-tSCC zHpux11_FabsfName[] =
- "hpux11_fabsf";
+tSCC zHpux10_Cpp_Pow_InlineName[] =
+ "hpux10_cpp_pow_inline";
/*
* File name selection pattern
*/
-tSCC zHpux11_FabsfList[] =
- "|math.h|";
+tSCC zHpux10_Cpp_Pow_InlineList[] =
+ "|fixinc-test-limits.h|math.h|";
/*
* Machine/OS name selection pattern
*/
-#define apzHpux11_FabsfMachs (const char**)NULL
+#define apzHpux10_Cpp_Pow_InlineMachs (const char**)NULL
/*
* content selection pattern - do fix if pattern found
*/
-tSCC zHpux11_FabsfSelect0[] =
- "^[ \t]*#[ \t]*define[ \t]+fabsf\\(.*";
-
-/*
- * content bypass pattern - skip fix if pattern found
- */
-tSCC zHpux11_FabsfBypass0[] =
- "__cplusplus";
+tSCC zHpux10_Cpp_Pow_InlineSelect0[] =
+ "^# +ifdef +__cplusplus\n\
+ +}\n\
+ +inline +double +pow\\(double +__d,int +__expon\\) +{\n\
+[ \t]+return +pow\\(__d,\\(double\\)__expon\\);\n\
+ +}\n\
+ +extern +\"C\" +{\n\
+#else\n\
+# +endif";
-#define HPUX11_FABSF_TEST_CT 2
-static tTestDesc aHpux11_FabsfTests[] = {
- { TT_NEGREP, zHpux11_FabsfBypass0, (regex_t*)NULL },
- { TT_EGREP, zHpux11_FabsfSelect0, (regex_t*)NULL }, };
+#define HPUX10_CPP_POW_INLINE_TEST_CT 1
+static tTestDesc aHpux10_Cpp_Pow_InlineTests[] = {
+ { TT_EGREP, zHpux10_Cpp_Pow_InlineSelect0, (regex_t*)NULL }, };
/*
- * Fix Command Arguments for Hpux11_Fabsf
+ * Fix Command Arguments for Hpux10_Cpp_Pow_Inline
*/
-static const char* apzHpux11_FabsfPatch[] = {
+static const char* apzHpux10_Cpp_Pow_InlinePatch[] = {
"format",
- "#ifndef __cplusplus\n\
-%0\n\
-#endif",
+ "",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
- * Description of Hpux11_Uint32_C fix
+ * Description of Hpux11_Cpp_Pow_Inline fix
*/
-#define HPUX11_UINT32_C_FIXIDX 44
-tSCC zHpux11_Uint32_CName[] =
- "hpux11_uint32_c";
+tSCC zHpux11_Cpp_Pow_InlineName[] =
+ "hpux11_cpp_pow_inline";
/*
* File name selection pattern
*/
-tSCC zHpux11_Uint32_CList[] =
- "|inttypes.h|";
+tSCC zHpux11_Cpp_Pow_InlineList[] =
+ "|math.h|";
/*
* Machine/OS name selection pattern
*/
-#define apzHpux11_Uint32_CMachs (const char**)NULL
+#define apzHpux11_Cpp_Pow_InlineMachs (const char**)NULL
/*
* content selection pattern - do fix if pattern found
*/
-tSCC zHpux11_Uint32_CSelect0[] =
- "^#define UINT32_C\\(__c\\)[ \t]*__CONCAT__\\(__CONCAT_U__\\(__c\\),l\\)";
+tSCC zHpux11_Cpp_Pow_InlineSelect0[] =
+ " +inline double pow\\(double d,int expon\\) {\n\
+ +return pow\\(d, \\(double\\)expon\\);\n\
+ +}\n";
-#define HPUX11_UINT32_C_TEST_CT 1
-static tTestDesc aHpux11_Uint32_CTests[] = {
- { TT_EGREP, zHpux11_Uint32_CSelect0, (regex_t*)NULL }, };
+#define HPUX11_CPP_POW_INLINE_TEST_CT 1
+static tTestDesc aHpux11_Cpp_Pow_InlineTests[] = {
+ { TT_EGREP, zHpux11_Cpp_Pow_InlineSelect0, (regex_t*)NULL }, };
/*
- * Fix Command Arguments for Hpux11_Uint32_C
+ * Fix Command Arguments for Hpux11_Cpp_Pow_Inline
*/
-static const char* apzHpux11_Uint32_CPatch[] = {
+static const char* apzHpux11_Cpp_Pow_InlinePatch[] = {
"format",
- "#define UINT32_C(__c) __CONCAT__(__c,ul)",
+ "",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
- * Description of Hpux8_Bogus_Inlines fix
+ * Description of Hpux11_Fabsf fix
*/
-#define HPUX8_BOGUS_INLINES_FIXIDX 45
-tSCC zHpux8_Bogus_InlinesName[] =
- "hpux8_bogus_inlines";
+tSCC zHpux11_FabsfName[] =
+ "hpux11_fabsf";
/*
* File name selection pattern
*/
-tSCC zHpux8_Bogus_InlinesList[] =
+tSCC zHpux11_FabsfList[] =
"|math.h|";
/*
* Machine/OS name selection pattern
*/
-#define apzHpux8_Bogus_InlinesMachs (const char**)NULL
+#define apzHpux11_FabsfMachs (const char**)NULL
/*
* content selection pattern - do fix if pattern found
*/
-tSCC zHpux8_Bogus_InlinesSelect0[] =
- "inline";
+tSCC zHpux11_FabsfSelect0[] =
+ "^[ \t]*#[ \t]*define[ \t]+fabsf\\(.*";
-#define HPUX8_BOGUS_INLINES_TEST_CT 1
-static tTestDesc aHpux8_Bogus_InlinesTests[] = {
- { TT_EGREP, zHpux8_Bogus_InlinesSelect0, (regex_t*)NULL }, };
+/*
+ * content bypass pattern - skip fix if pattern found
+ */
+tSCC zHpux11_FabsfBypass0[] =
+ "__cplusplus";
+
+#define HPUX11_FABSF_TEST_CT 2
+static tTestDesc aHpux11_FabsfTests[] = {
+ { TT_NEGREP, zHpux11_FabsfBypass0, (regex_t*)NULL },
+ { TT_EGREP, zHpux11_FabsfSelect0, (regex_t*)NULL }, };
/*
- * Fix Command Arguments for Hpux8_Bogus_Inlines
+ * Fix Command Arguments for Hpux11_Fabsf
*/
-static const char* apzHpux8_Bogus_InlinesPatch[] = { "sed",
- "-e", "s@inline int abs(int [a-z][a-z]*) {.*}@extern \"C\" int abs(int);@",
- "-e", "s@inline double abs(double [a-z][a-z]*) {.*}@@",
- "-e", "s@inline int sqr(int [a-z][a-z]*) {.*}@@",
- "-e", "s@inline double sqr(double [a-z][a-z]*) {.*}@@",
+static const char* apzHpux11_FabsfPatch[] = {
+ "format",
+ "#ifndef __cplusplus\n\
+%0\n\
+#endif",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
- * Description of Int_Abort_Free_And_Exit fix
+ * Description of Hpux11_Size_T fix
*/
-#define INT_ABORT_FREE_AND_EXIT_FIXIDX 46
-tSCC zInt_Abort_Free_And_ExitName[] =
- "int_abort_free_and_exit";
+tSCC zHpux11_Size_TName[] =
+ "hpux11_size_t";
/*
* File name selection pattern
*/
-tSCC zInt_Abort_Free_And_ExitList[] =
- "|stdlib.h|";
+#define zHpux11_Size_TList (char*)NULL
/*
* Machine/OS name selection pattern
*/
-#define apzInt_Abort_Free_And_ExitMachs (const char**)NULL
+tSCC* apzHpux11_Size_TMachs[] = {
+ "*-hp-hpux11*",
+ (const char*)NULL };
/*
* content selection pattern - do fix if pattern found
*/
-tSCC zInt_Abort_Free_And_ExitSelect0[] =
- "int[ \t]+(abort|free|exit)[ \t]*\\(";
+tSCC zHpux11_Size_TSelect0[] =
+ "__size_t";
-#define INT_ABORT_FREE_AND_EXIT_TEST_CT 1
-static tTestDesc aInt_Abort_Free_And_ExitTests[] = {
- { TT_EGREP, zInt_Abort_Free_And_ExitSelect0, (regex_t*)NULL }, };
+#define HPUX11_SIZE_T_TEST_CT 1
+static tTestDesc aHpux11_Size_TTests[] = {
+ { TT_EGREP, zHpux11_Size_TSelect0, (regex_t*)NULL }, };
/*
- * Fix Command Arguments for Int_Abort_Free_And_Exit
+ * Fix Command Arguments for Hpux11_Size_T
*/
-static const char* apzInt_Abort_Free_And_ExitPatch[] = {
+static const char* apzHpux11_Size_TPatch[] = {
"format",
- "void\t%1(",
+ "_hpux_size_t",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
- * Description of Isc_Omits_With_Stdc fix
+ * Description of Hpux11_Uint32_C fix
*/
-#define ISC_OMITS_WITH_STDC_FIXIDX 47
-tSCC zIsc_Omits_With_StdcName[] =
- "isc_omits_with_stdc";
+tSCC zHpux11_Uint32_CName[] =
+ "hpux11_uint32_c";
/*
* File name selection pattern
*/
-tSCC zIsc_Omits_With_StdcList[] =
- "|stdio.h|math.h|ctype.h|sys/limits.h|sys/fcntl.h|sys/dirent.h|";
+tSCC zHpux11_Uint32_CList[] =
+ "|inttypes.h|";
/*
* Machine/OS name selection pattern
*/
-#define apzIsc_Omits_With_StdcMachs (const char**)NULL
+#define apzHpux11_Uint32_CMachs (const char**)NULL
/*
* content selection pattern - do fix if pattern found
*/
-tSCC zIsc_Omits_With_StdcSelect0[] =
- "!defined\\(__STDC__\\) && !defined\\(_POSIX_SOURCE\\)";
+tSCC zHpux11_Uint32_CSelect0[] =
+ "^#define UINT32_C\\(__c\\)[ \t]*__CONCAT__\\(__CONCAT_U__\\(__c\\),l\\)";
-#define ISC_OMITS_WITH_STDC_TEST_CT 1
-static tTestDesc aIsc_Omits_With_StdcTests[] = {
- { TT_EGREP, zIsc_Omits_With_StdcSelect0, (regex_t*)NULL }, };
+#define HPUX11_UINT32_C_TEST_CT 1
+static tTestDesc aHpux11_Uint32_CTests[] = {
+ { TT_EGREP, zHpux11_Uint32_CSelect0, (regex_t*)NULL }, };
/*
- * Fix Command Arguments for Isc_Omits_With_Stdc
+ * Fix Command Arguments for Hpux11_Uint32_C
*/
-static const char* apzIsc_Omits_With_StdcPatch[] = {
+static const char* apzHpux11_Uint32_CPatch[] = {
"format",
- "!defined(_POSIX_SOURCE)",
+ "#define UINT32_C(__c) __CONCAT__(__c,ul)",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
- * Description of Io_Quotes_Def fix
+ * Description of Hpux11_Vsnprintf fix
*/
-#define IO_QUOTES_DEF_FIXIDX 48
-tSCC zIo_Quotes_DefName[] =
- "io_quotes_def";
+tSCC zHpux11_VsnprintfName[] =
+ "hpux11_vsnprintf";
/*
* File name selection pattern
*/
-#define zIo_Quotes_DefList (char*)NULL
+tSCC zHpux11_VsnprintfList[] =
+ "|stdio.h|";
/*
* Machine/OS name selection pattern
*/
-#define apzIo_Quotes_DefMachs (const char**)NULL
+#define apzHpux11_VsnprintfMachs (const char**)NULL
/*
* content selection pattern - do fix if pattern found
*/
-tSCC zIo_Quotes_DefSelect0[] =
- "define[ \t]+[A-Z0-9_]+IO[A-Z]*\\([a-zA-Z][,)]";
+tSCC zHpux11_VsnprintfSelect0[] =
+ "(extern int vsnprintf\\(char \\*, _[hpux]*_size_t, const char \\*,) __va__list\\);";
-#define IO_QUOTES_DEF_TEST_CT 1
-static tTestDesc aIo_Quotes_DefTests[] = {
- { TT_EGREP, zIo_Quotes_DefSelect0, (regex_t*)NULL }, };
+#define HPUX11_VSNPRINTF_TEST_CT 1
+static tTestDesc aHpux11_VsnprintfTests[] = {
+ { TT_EGREP, zHpux11_VsnprintfSelect0, (regex_t*)NULL }, };
/*
- * Fix Command Arguments for Io_Quotes_Def
+ * Fix Command Arguments for Hpux11_Vsnprintf
*/
-static const char* apzIo_Quotes_DefPatch[] = {
- "char_macro_def",
- "IO",
+static const char* apzHpux11_VsnprintfPatch[] = {
+ "format",
+ "%1 __va_list);",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
- * Description of Io_Quotes_Use fix
+ * Description of Hpux8_Bogus_Inlines fix
*/
-#define IO_QUOTES_USE_FIXIDX 49
-tSCC zIo_Quotes_UseName[] =
- "io_quotes_use";
+tSCC zHpux8_Bogus_InlinesName[] =
+ "hpux8_bogus_inlines";
/*
* File name selection pattern
*/
-#define zIo_Quotes_UseList (char*)NULL
+tSCC zHpux8_Bogus_InlinesList[] =
+ "|math.h|";
/*
* Machine/OS name selection pattern
*/
-#define apzIo_Quotes_UseMachs (const char**)NULL
+#define apzHpux8_Bogus_InlinesMachs (const char**)NULL
/*
* content selection pattern - do fix if pattern found
*/
-tSCC zIo_Quotes_UseSelect0[] =
- "define[ \t]+[A-Z0-9_]+[ \t]+[A-Z0-9_]+IO[A-Z]*[ \t]*\\( *[^,']";
+tSCC zHpux8_Bogus_InlinesSelect0[] =
+ "inline";
-#define IO_QUOTES_USE_TEST_CT 1
-static tTestDesc aIo_Quotes_UseTests[] = {
- { TT_EGREP, zIo_Quotes_UseSelect0, (regex_t*)NULL }, };
+#define HPUX8_BOGUS_INLINES_TEST_CT 1
+static tTestDesc aHpux8_Bogus_InlinesTests[] = {
+ { TT_EGREP, zHpux8_Bogus_InlinesSelect0, (regex_t*)NULL }, };
/*
- * Fix Command Arguments for Io_Quotes_Use
+ * Fix Command Arguments for Hpux8_Bogus_Inlines
*/
-static const char* apzIo_Quotes_UsePatch[] = {
- "char_macro_use",
- "IO",
+static const char* apzHpux8_Bogus_InlinesPatch[] = { "sed",
+ "-e", "s@inline int abs(int [a-z][a-z]*) {.*}@extern \"C\" int abs(int);@",
+ "-e", "s@inline double abs(double [a-z][a-z]*) {.*}@@",
+ "-e", "s@inline int sqr(int [a-z][a-z]*) {.*}@@",
+ "-e", "s@inline double sqr(double [a-z][a-z]*) {.*}@@",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
* Description of Hpux_Maxint fix
*/
-#define HPUX_MAXINT_FIXIDX 50
tSCC zHpux_MaxintName[] =
"hpux_maxint";
@@ -2175,7 +2232,6 @@ static const char* apzHpux_MaxintPatch[] = {
*
* Description of Hpux_Systime fix
*/
-#define HPUX_SYSTIME_FIXIDX 51
tSCC zHpux_SystimeName[] =
"hpux_systime";
@@ -2209,9 +2265,111 @@ static const char* apzHpux_SystimePatch[] = {
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
+ * Description of Int_Abort_Free_And_Exit fix
+ */
+tSCC zInt_Abort_Free_And_ExitName[] =
+ "int_abort_free_and_exit";
+
+/*
+ * File name selection pattern
+ */
+tSCC zInt_Abort_Free_And_ExitList[] =
+ "|stdlib.h|";
+/*
+ * Machine/OS name selection pattern
+ */
+#define apzInt_Abort_Free_And_ExitMachs (const char**)NULL
+
+/*
+ * content selection pattern - do fix if pattern found
+ */
+tSCC zInt_Abort_Free_And_ExitSelect0[] =
+ "int[ \t]+(abort|free|exit)[ \t]*\\(";
+
+#define INT_ABORT_FREE_AND_EXIT_TEST_CT 1
+static tTestDesc aInt_Abort_Free_And_ExitTests[] = {
+ { TT_EGREP, zInt_Abort_Free_And_ExitSelect0, (regex_t*)NULL }, };
+
+/*
+ * Fix Command Arguments for Int_Abort_Free_And_Exit
+ */
+static const char* apzInt_Abort_Free_And_ExitPatch[] = {
+ "format",
+ "void\t%1(",
+ (char*)NULL };
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
+ * Description of Io_Quotes_Def fix
+ */
+tSCC zIo_Quotes_DefName[] =
+ "io_quotes_def";
+
+/*
+ * File name selection pattern
+ */
+#define zIo_Quotes_DefList (char*)NULL
+/*
+ * Machine/OS name selection pattern
+ */
+#define apzIo_Quotes_DefMachs (const char**)NULL
+
+/*
+ * content selection pattern - do fix if pattern found
+ */
+tSCC zIo_Quotes_DefSelect0[] =
+ "define[ \t]+[A-Z0-9_]+IO[A-Z]*\\([a-zA-Z][,)]";
+
+#define IO_QUOTES_DEF_TEST_CT 1
+static tTestDesc aIo_Quotes_DefTests[] = {
+ { TT_EGREP, zIo_Quotes_DefSelect0, (regex_t*)NULL }, };
+
+/*
+ * Fix Command Arguments for Io_Quotes_Def
+ */
+static const char* apzIo_Quotes_DefPatch[] = {
+ "char_macro_def",
+ "IO",
+ (char*)NULL };
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
+ * Description of Io_Quotes_Use fix
+ */
+tSCC zIo_Quotes_UseName[] =
+ "io_quotes_use";
+
+/*
+ * File name selection pattern
+ */
+#define zIo_Quotes_UseList (char*)NULL
+/*
+ * Machine/OS name selection pattern
+ */
+#define apzIo_Quotes_UseMachs (const char**)NULL
+
+/*
+ * content selection pattern - do fix if pattern found
+ */
+tSCC zIo_Quotes_UseSelect0[] =
+ "define[ \t]+[A-Z0-9_]+[ \t]+[A-Z0-9_]+IO[A-Z]*[ \t]*\\( *[^,']";
+
+#define IO_QUOTES_USE_TEST_CT 1
+static tTestDesc aIo_Quotes_UseTests[] = {
+ { TT_EGREP, zIo_Quotes_UseSelect0, (regex_t*)NULL }, };
+
+/*
+ * Fix Command Arguments for Io_Quotes_Use
+ */
+static const char* apzIo_Quotes_UsePatch[] = {
+ "char_macro_use",
+ "IO",
+ (char*)NULL };
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
* Description of Ip_Missing_Semi fix
*/
-#define IP_MISSING_SEMI_FIXIDX 52
tSCC zIp_Missing_SemiName[] =
"ip_missing_semi";
@@ -2246,7 +2404,6 @@ static const char* apzIp_Missing_SemiPatch[] = { "sed",
*
* Description of Irix_Asm_Apostrophe fix
*/
-#define IRIX_ASM_APOSTROPHE_FIXIDX 53
tSCC zIrix_Asm_ApostropheName[] =
"irix_asm_apostrophe";
@@ -2283,7 +2440,6 @@ static const char* apzIrix_Asm_ApostrophePatch[] = {
*
* Description of Irix_Limits_Const fix
*/
-#define IRIX_LIMITS_CONST_FIXIDX 54
tSCC zIrix_Limits_ConstName[] =
"irix_limits_const";
@@ -2291,7 +2447,7 @@ tSCC zIrix_Limits_ConstName[] =
* File name selection pattern
*/
tSCC zIrix_Limits_ConstList[] =
- "|limits.h|";
+ "|fixinc-test-limits.h|limits.h|";
/*
* Machine/OS name selection pattern
*/
@@ -2317,9 +2473,43 @@ static const char* apzIrix_Limits_ConstPatch[] = {
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
+ * Description of Irix_Stdio_Va_List fix
+ */
+tSCC zIrix_Stdio_Va_ListName[] =
+ "irix_stdio_va_list";
+
+/*
+ * File name selection pattern
+ */
+tSCC zIrix_Stdio_Va_ListList[] =
+ "|stdio.h|";
+/*
+ * Machine/OS name selection pattern
+ */
+#define apzIrix_Stdio_Va_ListMachs (const char**)NULL
+
+/*
+ * content selection pattern - do fix if pattern found
+ */
+tSCC zIrix_Stdio_Va_ListSelect0[] =
+ "(printf\\(.*), /\\* va_list \\*/ char \\*";
+
+#define IRIX_STDIO_VA_LIST_TEST_CT 1
+static tTestDesc aIrix_Stdio_Va_ListTests[] = {
+ { TT_EGREP, zIrix_Stdio_Va_ListSelect0, (regex_t*)NULL }, };
+
+/*
+ * Fix Command Arguments for Irix_Stdio_Va_List
+ */
+static const char* apzIrix_Stdio_Va_ListPatch[] = {
+ "format",
+ "%1, __gnuc_va_list",
+ (char*)NULL };
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
* Description of Isc_Fmod fix
*/
-#define ISC_FMOD_FIXIDX 55
tSCC zIsc_FmodName[] =
"isc_fmod";
@@ -2353,9 +2543,43 @@ static const char* apzIsc_FmodPatch[] = {
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
+ * Description of Isc_Omits_With_Stdc fix
+ */
+tSCC zIsc_Omits_With_StdcName[] =
+ "isc_omits_with_stdc";
+
+/*
+ * File name selection pattern
+ */
+tSCC zIsc_Omits_With_StdcList[] =
+ "|stdio.h|math.h|ctype.h|sys/limits.h|sys/fcntl.h|sys/dirent.h|";
+/*
+ * Machine/OS name selection pattern
+ */
+#define apzIsc_Omits_With_StdcMachs (const char**)NULL
+
+/*
+ * content selection pattern - do fix if pattern found
+ */
+tSCC zIsc_Omits_With_StdcSelect0[] =
+ "!defined\\(__STDC__\\) && !defined\\(_POSIX_SOURCE\\)";
+
+#define ISC_OMITS_WITH_STDC_TEST_CT 1
+static tTestDesc aIsc_Omits_With_StdcTests[] = {
+ { TT_EGREP, zIsc_Omits_With_StdcSelect0, (regex_t*)NULL }, };
+
+/*
+ * Fix Command Arguments for Isc_Omits_With_Stdc
+ */
+static const char* apzIsc_Omits_With_StdcPatch[] = {
+ "format",
+ "!defined(_POSIX_SOURCE)",
+ (char*)NULL };
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
* Description of Kandr_Concat fix
*/
-#define KANDR_CONCAT_FIXIDX 56
tSCC zKandr_ConcatName[] =
"kandr_concat";
@@ -2391,7 +2615,6 @@ static const char* apzKandr_ConcatPatch[] = {
*
* Description of Libc1_Ifdefd_Memx fix
*/
-#define LIBC1_IFDEFD_MEMX_FIXIDX 57
tSCC zLibc1_Ifdefd_MemxName[] =
"libc1_ifdefd_memx";
@@ -2440,7 +2663,6 @@ extern [a-z_]+ mem.*(\n\
*
* Description of Limits_Ifndefs fix
*/
-#define LIMITS_IFNDEFS_FIXIDX 58
tSCC zLimits_IfndefsName[] =
"limits_ifndefs";
@@ -2479,7 +2701,6 @@ static const char* apzLimits_IfndefsPatch[] = {
*
* Description of Lynx_Void_Int fix
*/
-#define LYNX_VOID_INT_FIXIDX 59
tSCC zLynx_Void_IntName[] =
"lynx_void_int";
@@ -2515,7 +2736,6 @@ static const char* apzLynx_Void_IntPatch[] = {
*
* Description of Lynxos_Fcntl_Proto fix
*/
-#define LYNXOS_FCNTL_PROTO_FIXIDX 60
tSCC zLynxos_Fcntl_ProtoName[] =
"lynxos_fcntl_proto";
@@ -2552,7 +2772,6 @@ static const char* apzLynxos_Fcntl_ProtoPatch[] = {
*
* Description of M88k_Bad_Hypot_Opt fix
*/
-#define M88K_BAD_HYPOT_OPT_FIXIDX 61
tSCC zM88k_Bad_Hypot_OptName[] =
"m88k_bad_hypot_opt";
@@ -2601,7 +2820,6 @@ static __inline__ double fake_hypot (x, y)\n\
*
* Description of M88k_Bad_S_If fix
*/
-#define M88K_BAD_S_IF_FIXIDX 62
tSCC zM88k_Bad_S_IfName[] =
"m88k_bad_s_if";
@@ -2640,7 +2858,6 @@ static const char* apzM88k_Bad_S_IfPatch[] = {
*
* Description of M88k_Multi_Incl fix
*/
-#define M88K_MULTI_INCL_FIXIDX 63
tSCC zM88k_Multi_InclName[] =
"m88k_multi_incl";
@@ -2677,7 +2894,6 @@ static const char* apzM88k_Multi_InclPatch[] = {
*
* Description of Machine_Ansi_H_Va_List fix
*/
-#define MACHINE_ANSI_H_VA_LIST_FIXIDX 64
tSCC zMachine_Ansi_H_Va_ListName[] =
"machine_ansi_h_va_list";
@@ -2720,7 +2936,6 @@ static const char* apzMachine_Ansi_H_Va_ListPatch[] = {
*
* Description of Machine_Name fix
*/
-#define MACHINE_NAME_FIXIDX 65
tSCC zMachine_NameName[] =
"machine_name";
@@ -2753,7 +2968,6 @@ static const char* apzMachine_NamePatch[] = {
*
* Description of Math_Exception fix
*/
-#define MATH_EXCEPTION_FIXIDX 66
tSCC zMath_ExceptionName[] =
"math_exception";
@@ -2801,7 +3015,6 @@ static const char* apzMath_ExceptionPatch[] = {
*
* Description of Math_Huge_Val_From_Dbl_Max fix
*/
-#define MATH_HUGE_VAL_FROM_DBL_MAX_FIXIDX 67
tSCC zMath_Huge_Val_From_Dbl_MaxName[] =
"math_huge_val_from_dbl_max";
@@ -2836,8 +3049,7 @@ static tTestDesc aMath_Huge_Val_From_Dbl_MaxTests[] = {
* Fix Command Arguments for Math_Huge_Val_From_Dbl_Max
*/
static const char* apzMath_Huge_Val_From_Dbl_MaxPatch[] = { "sh", "-c",
- "\tdbl_max_def=`egrep 'define[ \t]+DBL_MAX[ \t]+.*' float.h | sed 's/.*DBL_MAX[ \t]*//' 2>/dev/null`\n\
-\n\
+ "\tdbl_max_def=`egrep 'define[ \t]+DBL_MAX[ \t]+.*' float.h | sed 's/.*DBL_MAX[ \t]*//' 2>/dev/null`\n\n\
\tif ( test -n \"${dbl_max_def}\" ) > /dev/null 2>&1\n\
\tthen sed -e '/define[ \t]*HUGE_VAL[ \t]*DBL_MAX/s@DBL_MAX@'\"$dbl_max_def@\"\n\
\telse cat\n\
@@ -2848,7 +3060,6 @@ static const char* apzMath_Huge_Val_From_Dbl_MaxPatch[] = { "sh", "-c",
*
* Description of Math_Huge_Val_Ifndef fix
*/
-#define MATH_HUGE_VAL_IFNDEF_FIXIDX 68
tSCC zMath_Huge_Val_IfndefName[] =
"math_huge_val_ifndef";
@@ -2885,9 +3096,43 @@ static const char* apzMath_Huge_Val_IfndefPatch[] = {
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
+ * Description of Nested_Auth_Des fix
+ */
+tSCC zNested_Auth_DesName[] =
+ "nested_auth_des";
+
+/*
+ * File name selection pattern
+ */
+tSCC zNested_Auth_DesList[] =
+ "|rpc/rpc.h|";
+/*
+ * Machine/OS name selection pattern
+ */
+#define apzNested_Auth_DesMachs (const char**)NULL
+
+/*
+ * content selection pattern - do fix if pattern found
+ */
+tSCC zNested_Auth_DesSelect0[] =
+ "(/\\*.*rpc/auth_des\\.h>.*)/\\*";
+
+#define NESTED_AUTH_DES_TEST_CT 1
+static tTestDesc aNested_Auth_DesTests[] = {
+ { TT_EGREP, zNested_Auth_DesSelect0, (regex_t*)NULL }, };
+
+/*
+ * Fix Command Arguments for Nested_Auth_Des
+ */
+static const char* apzNested_Auth_DesPatch[] = {
+ "format",
+ "%1*/ /*",
+ (char*)NULL };
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
* Description of Nested_Motorola fix
*/
-#define NESTED_MOTOROLA_FIXIDX 69
tSCC zNested_MotorolaName[] =
"nested_motorola";
@@ -2925,7 +3170,6 @@ static const char* apzNested_MotorolaPatch[] = { "sed",
*
* Description of Nested_Sys_Limits fix
*/
-#define NESTED_SYS_LIMITS_FIXIDX 70
tSCC zNested_Sys_LimitsName[] =
"nested_sys_limits";
@@ -2959,45 +3203,8 @@ static const char* apzNested_Sys_LimitsPatch[] = { "sed",
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
- * Description of Nested_Auth_Des fix
- */
-#define NESTED_AUTH_DES_FIXIDX 71
-tSCC zNested_Auth_DesName[] =
- "nested_auth_des";
-
-/*
- * File name selection pattern
- */
-tSCC zNested_Auth_DesList[] =
- "|rpc/rpc.h|";
-/*
- * Machine/OS name selection pattern
- */
-#define apzNested_Auth_DesMachs (const char**)NULL
-
-/*
- * content selection pattern - do fix if pattern found
- */
-tSCC zNested_Auth_DesSelect0[] =
- "(/\\*.*rpc/auth_des\\.h>.*)/\\*";
-
-#define NESTED_AUTH_DES_TEST_CT 1
-static tTestDesc aNested_Auth_DesTests[] = {
- { TT_EGREP, zNested_Auth_DesSelect0, (regex_t*)NULL }, };
-
-/*
- * Fix Command Arguments for Nested_Auth_Des
- */
-static const char* apzNested_Auth_DesPatch[] = {
- "format",
- "%1*/ /*",
- (char*)NULL };
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * *
- *
* Description of News_Os_Recursion fix
*/
-#define NEWS_OS_RECURSION_FIXIDX 72
tSCC zNews_Os_RecursionName[] =
"news_os_recursion";
@@ -3035,7 +3242,6 @@ static const char* apzNews_Os_RecursionPatch[] = {
*
* Description of Next_Math_Prefix fix
*/
-#define NEXT_MATH_PREFIX_FIXIDX 73
tSCC zNext_Math_PrefixName[] =
"next_math_prefix";
@@ -3072,7 +3278,6 @@ static const char* apzNext_Math_PrefixPatch[] = {
*
* Description of Next_Template fix
*/
-#define NEXT_TEMPLATE_FIXIDX 74
tSCC zNext_TemplateName[] =
"next_template";
@@ -3109,7 +3314,6 @@ static const char* apzNext_TemplatePatch[] = {
*
* Description of Next_Volitile fix
*/
-#define NEXT_VOLITILE_FIXIDX 75
tSCC zNext_VolitileName[] =
"next_volitile";
@@ -3146,7 +3350,6 @@ static const char* apzNext_VolitilePatch[] = {
*
* Description of Next_Wait_Union fix
*/
-#define NEXT_WAIT_UNION_FIXIDX 76
tSCC zNext_Wait_UnionName[] =
"next_wait_union";
@@ -3182,7 +3385,6 @@ static const char* apzNext_Wait_UnionPatch[] = {
*
* Description of Nodeent_Syntax fix
*/
-#define NODEENT_SYNTAX_FIXIDX 77
tSCC zNodeent_SyntaxName[] =
"nodeent_syntax";
@@ -3218,7 +3420,6 @@ static const char* apzNodeent_SyntaxPatch[] = {
*
* Description of Osf_Namespace_A fix
*/
-#define OSF_NAMESPACE_A_FIXIDX 78
tSCC zOsf_Namespace_AName[] =
"osf_namespace_a";
@@ -3264,7 +3465,6 @@ static const char* apzOsf_Namespace_APatch[] = {
*
* Description of Osf_Namespace_C fix
*/
-#define OSF_NAMESPACE_C_FIXIDX 79
tSCC zOsf_Namespace_CName[] =
"osf_namespace_c";
@@ -3319,7 +3519,6 @@ typedef __regmatch_t\tregmatch_t;",
*
* Description of Pthread_Page_Size fix
*/
-#define PTHREAD_PAGE_SIZE_FIXIDX 80
tSCC zPthread_Page_SizeName[] =
"pthread_page_size";
@@ -3355,7 +3554,6 @@ static const char* apzPthread_Page_SizePatch[] = {
*
* Description of Read_Ret_Type fix
*/
-#define READ_RET_TYPE_FIXIDX 81
tSCC zRead_Ret_TypeName[] =
"read_ret_type";
@@ -3393,7 +3591,6 @@ static const char* apzRead_Ret_TypePatch[] = {
*
* Description of Rs6000_Double fix
*/
-#define RS6000_DOUBLE_FIXIDX 82
tSCC zRs6000_DoubleName[] =
"rs6000_double";
@@ -3432,7 +3629,6 @@ static const char* apzRs6000_DoublePatch[] = {
*
* Description of Rs6000_Fchmod fix
*/
-#define RS6000_FCHMOD_FIXIDX 83
tSCC zRs6000_FchmodName[] =
"rs6000_fchmod";
@@ -3468,7 +3664,6 @@ static const char* apzRs6000_FchmodPatch[] = {
*
* Description of Rs6000_Param fix
*/
-#define RS6000_PARAM_FIXIDX 84
tSCC zRs6000_ParamName[] =
"rs6000_param";
@@ -3504,7 +3699,6 @@ static const char* apzRs6000_ParamPatch[] = {
*
* Description of Sco_Static_Func fix
*/
-#define SCO_STATIC_FUNC_FIXIDX 85
tSCC zSco_Static_FuncName[] =
"sco_static_func";
@@ -3546,85 +3740,85 @@ extern \"C\" {\\\n\
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
- * Description of Sco_Strict_Ansi fix
+ * Description of Sco_Utime fix
*/
-#define SCO_STRICT_ANSI_FIXIDX 86
-tSCC zSco_Strict_AnsiName[] =
- "sco_strict_ansi";
+tSCC zSco_UtimeName[] =
+ "sco_utime";
/*
* File name selection pattern
*/
-#define zSco_Strict_AnsiList (char*)NULL
+tSCC zSco_UtimeList[] =
+ "|sys/times.h|";
/*
* Machine/OS name selection pattern
*/
-tSCC* apzSco_Strict_AnsiMachs[] = {
- "i?86-*-sco3.2*",
+tSCC* apzSco_UtimeMachs[] = {
+ "i?86-*-sco3.2v4*",
(const char*)NULL };
/*
* content selection pattern - do fix if pattern found
*/
-tSCC zSco_Strict_AnsiSelect0[] =
- "^[ \t]*#[ \t]*if.*!__STDC__";
+tSCC zSco_UtimeSelect0[] =
+ "\\(const char \\*, struct utimbuf \\*\\);";
-#define SCO_STRICT_ANSI_TEST_CT 1
-static tTestDesc aSco_Strict_AnsiTests[] = {
- { TT_EGREP, zSco_Strict_AnsiSelect0, (regex_t*)NULL }, };
+#define SCO_UTIME_TEST_CT 1
+static tTestDesc aSco_UtimeTests[] = {
+ { TT_EGREP, zSco_UtimeSelect0, (regex_t*)NULL }, };
/*
- * Fix Command Arguments for Sco_Strict_Ansi
+ * Fix Command Arguments for Sco_Utime
*/
-static const char* apzSco_Strict_AnsiPatch[] = {
+static const char* apzSco_UtimePatch[] = {
"format",
- "%1defined(__STRICT_ANSI__)%2",
- "^([ \t]*#[ \t]*if[ \t].*!)__STDC__(.*)",
+ "(const char *, const struct utimbuf *);",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
- * Description of Sco_Utime fix
+ * Description of Solaris_Mutex_Init fix
*/
-#define SCO_UTIME_FIXIDX 87
-tSCC zSco_UtimeName[] =
- "sco_utime";
+tSCC zSolaris_Mutex_InitName[] =
+ "solaris_mutex_init";
/*
* File name selection pattern
*/
-tSCC zSco_UtimeList[] =
- "|sys/times.h|";
+tSCC zSolaris_Mutex_InitList[] =
+ "|pthread.h|";
/*
* Machine/OS name selection pattern
*/
-tSCC* apzSco_UtimeMachs[] = {
- "i?86-*-sco3.2v4*",
- (const char*)NULL };
+#define apzSolaris_Mutex_InitMachs (const char**)NULL
/*
* content selection pattern - do fix if pattern found
*/
-tSCC zSco_UtimeSelect0[] =
- "\\(const char \\*, struct utimbuf \\*\\);";
+tSCC zSolaris_Mutex_InitSelect0[] =
+ "@\\(#\\)pthread.h[ \t]+1.[0-9]+[ \t]+[0-9/]+ SMI";
-#define SCO_UTIME_TEST_CT 1
-static tTestDesc aSco_UtimeTests[] = {
- { TT_EGREP, zSco_UtimeSelect0, (regex_t*)NULL }, };
+#define SOLARIS_MUTEX_INIT_TEST_CT 1
+static tTestDesc aSolaris_Mutex_InitTests[] = {
+ { TT_EGREP, zSolaris_Mutex_InitSelect0, (regex_t*)NULL }, };
/*
- * Fix Command Arguments for Sco_Utime
+ * Fix Command Arguments for Solaris_Mutex_Init
*/
-static const char* apzSco_UtimePatch[] = {
+static const char* apzSolaris_Mutex_InitPatch[] = {
"format",
- "(const char *, const struct utimbuf *);",
+ "#if __STDC__ - 0 == 0 && !defined(_NO_LONGLONG)\n\
+%0\n\
+#else\n\
+%1, {0}}%3\n\
+#endif",
+ "(^#define[ \t]+PTHREAD_(MUTEX|COND)_INITIALIZER[ \t]+{.*),[ \t]*0}(|[ \t].*)$",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
* Description of Statsswtch fix
*/
-#define STATSSWTCH_FIXIDX 88
tSCC zStatsswtchName[] =
"statsswtch";
@@ -3660,7 +3854,6 @@ static const char* apzStatsswtchPatch[] = {
*
* Description of Stdio_Stdarg_H fix
*/
-#define STDIO_STDARG_H_FIXIDX 89
tSCC zStdio_Stdarg_HName[] =
"stdio_stdarg_h";
@@ -3697,7 +3890,6 @@ static const char* apzStdio_Stdarg_HPatch[] = {
*
* Description of Stdio_Va_List fix
*/
-#define STDIO_VA_LIST_FIXIDX 90
tSCC zStdio_Va_ListName[] =
"stdio_va_list";
@@ -3728,6 +3920,7 @@ static const char* apzStdio_Va_ListPatch[] = { "sed",
"-e", "s@ va_list @ __gnuc_va_list @\n\
s@ va_list)@ __gnuc_va_list)@\n\
s@ _VA_LIST_));@ __gnuc_va_list));@\n\
+s@ __VA_LIST__));@ __gnuc_va_list));@\n\
s@ va_list@ __not_va_list__@\n\
s@\\*va_list@*__not_va_list__@\n\
s@ __va_list)@ __gnuc_va_list)@\n\
@@ -3740,9 +3933,129 @@ s@_Va_LIST@_VA_LIST@",
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
+ * Description of Strict_Ansi_Not fix
+ */
+tSCC zStrict_Ansi_NotName[] =
+ "strict_ansi_not";
+
+/*
+ * File name selection pattern
+ */
+#define zStrict_Ansi_NotList (char*)NULL
+/*
+ * Machine/OS name selection pattern
+ */
+#define apzStrict_Ansi_NotMachs (const char**)NULL
+
+/*
+ * content selection pattern - do fix if pattern found
+ */
+tSCC zStrict_Ansi_NotSelect0[] =
+ "^([ \t]*#[ \t]*if.*)(!__STDC__|__STDC__[ \t]*==[ \t]*0|__STDC__[ \t]*!=[ \t]*1|__STDC__[ \t]*-[ \t]*0[ \t]*==[ \t]*0)";
+
+/*
+ * perform the C function call test
+ */
+tSCC zStrict_Ansi_NotFTst0[] = "stdc_0_in_system_headers";
+
+#define STRICT_ANSI_NOT_TEST_CT 2
+static tTestDesc aStrict_Ansi_NotTests[] = {
+ { TT_FUNCTION, zStrict_Ansi_NotFTst0, 0 /* unused */ },
+ { TT_EGREP, zStrict_Ansi_NotSelect0, (regex_t*)NULL }, };
+
+/*
+ * Fix Command Arguments for Strict_Ansi_Not
+ */
+static const char* apzStrict_Ansi_NotPatch[] = {
+ "format",
+ "%1 !defined(__STRICT_ANSI__)",
+ (char*)NULL };
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
+ * Description of Strict_Ansi_Not_Ctd fix
+ */
+tSCC zStrict_Ansi_Not_CtdName[] =
+ "strict_ansi_not_ctd";
+
+/*
+ * File name selection pattern
+ */
+tSCC zStrict_Ansi_Not_CtdList[] =
+ "|math.h|limits.h|stdio.h|signal.h|stdlib.h|sys/signal.h|time.h|";
+/*
+ * Machine/OS name selection pattern
+ */
+#define apzStrict_Ansi_Not_CtdMachs (const char**)NULL
+
+/*
+ * content selection pattern - do fix if pattern found
+ */
+tSCC zStrict_Ansi_Not_CtdSelect0[] =
+ "^([ \t]*(\\(|&&|\\|\\|)([ \t(]*!*[ \t]*defined\\([a-zA-Z_0-9]+\\)[ \t]*[|&][|&])*[ \t(]*)(__STDC__[ \t]*(|-[ \t]*0[ \t]*)==[ \t]*0)";
+
+/*
+ * perform the C function call test
+ */
+tSCC zStrict_Ansi_Not_CtdFTst0[] = "stdc_0_in_system_headers";
+
+#define STRICT_ANSI_NOT_CTD_TEST_CT 2
+static tTestDesc aStrict_Ansi_Not_CtdTests[] = {
+ { TT_FUNCTION, zStrict_Ansi_Not_CtdFTst0, 0 /* unused */ },
+ { TT_EGREP, zStrict_Ansi_Not_CtdSelect0, (regex_t*)NULL }, };
+
+/*
+ * Fix Command Arguments for Strict_Ansi_Not_Ctd
+ */
+static const char* apzStrict_Ansi_Not_CtdPatch[] = {
+ "format",
+ "%1 !defined(__STRICT_ANSI__)",
+ (char*)NULL };
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
+ * Description of Strict_Ansi_Only fix
+ */
+tSCC zStrict_Ansi_OnlyName[] =
+ "strict_ansi_only";
+
+/*
+ * File name selection pattern
+ */
+#define zStrict_Ansi_OnlyList (char*)NULL
+/*
+ * Machine/OS name selection pattern
+ */
+#define apzStrict_Ansi_OnlyMachs (const char**)NULL
+
+/*
+ * content selection pattern - do fix if pattern found
+ */
+tSCC zStrict_Ansi_OnlySelect0[] =
+ "^([ \t]*#[ \t]*if.*)(__STDC__[ \t]*!=[ \t]*0|__STDC__[ \t]*==[ \t]*1|__STDC__[ \t]*-[ \t]*0[ \t]*==[ \t]*1|__STDC__[ \t]*-[ \t]*0[ \t]*!=[ \t]*0)";
+
+/*
+ * perform the C function call test
+ */
+tSCC zStrict_Ansi_OnlyFTst0[] = "stdc_0_in_system_headers";
+
+#define STRICT_ANSI_ONLY_TEST_CT 2
+static tTestDesc aStrict_Ansi_OnlyTests[] = {
+ { TT_FUNCTION, zStrict_Ansi_OnlyFTst0, 0 /* unused */ },
+ { TT_EGREP, zStrict_Ansi_OnlySelect0, (regex_t*)NULL }, };
+
+/*
+ * Fix Command Arguments for Strict_Ansi_Only
+ */
+static const char* apzStrict_Ansi_OnlyPatch[] = {
+ "format",
+ "%1 defined(__STRICT_ANSI__)",
+ (char*)NULL };
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
* Description of Struct_File fix
*/
-#define STRUCT_FILE_FIXIDX 91
tSCC zStruct_FileName[] =
"struct_file";
@@ -3779,7 +4092,6 @@ static const char* apzStruct_FilePatch[] = {
*
* Description of Struct_Sockaddr fix
*/
-#define STRUCT_SOCKADDR_FIXIDX 92
tSCC zStruct_SockaddrName[] =
"struct_sockaddr";
@@ -3823,7 +4135,6 @@ static const char* apzStruct_SockaddrPatch[] = {
*
* Description of Sun_Auth_Proto fix
*/
-#define SUN_AUTH_PROTO_FIXIDX 93
tSCC zSun_Auth_ProtoName[] =
"sun_auth_proto";
@@ -3864,7 +4175,6 @@ static const char* apzSun_Auth_ProtoPatch[] = {
*
* Description of Sun_Bogus_Ifdef fix
*/
-#define SUN_BOGUS_IFDEF_FIXIDX 94
tSCC zSun_Bogus_IfdefName[] =
"sun_bogus_ifdef";
@@ -3900,7 +4210,6 @@ static const char* apzSun_Bogus_IfdefPatch[] = {
*
* Description of Sun_Catmacro fix
*/
-#define SUN_CATMACRO_FIXIDX 95
tSCC zSun_CatmacroName[] =
"sun_catmacro";
@@ -3940,7 +4249,6 @@ static const char* apzSun_CatmacroPatch[] = {
*
* Description of Sun_Malloc fix
*/
-#define SUN_MALLOC_FIXIDX 96
tSCC zSun_MallocName[] =
"sun_malloc";
@@ -3971,7 +4279,6 @@ static const char* apzSun_MallocPatch[] = { "sed",
*
* Description of Sun_Rusers_Semi fix
*/
-#define SUN_RUSERS_SEMI_FIXIDX 97
tSCC zSun_Rusers_SemiName[] =
"sun_rusers_semi";
@@ -4006,7 +4313,6 @@ static const char* apzSun_Rusers_SemiPatch[] = { "sed",
*
* Description of Sun_Signal fix
*/
-#define SUN_SIGNAL_FIXIDX 98
tSCC zSun_SignalName[] =
"sun_signal";
@@ -4046,7 +4352,6 @@ void\t(*signal(...))(...);\n\
*
* Description of Sunos_Matherr_Decl fix
*/
-#define SUNOS_MATHERR_DECL_FIXIDX 99
tSCC zSunos_Matherr_DeclName[] =
"sunos_matherr_decl";
@@ -4089,7 +4394,6 @@ static const char* apzSunos_Matherr_DeclPatch[] = {
*
* Description of Sunos_Strlen fix
*/
-#define SUNOS_STRLEN_FIXIDX 100
tSCC zSunos_StrlenName[] =
"sunos_strlen";
@@ -4125,7 +4429,6 @@ static const char* apzSunos_StrlenPatch[] = {
*
* Description of Svr4__P fix
*/
-#define SVR4__P_FIXIDX 101
tSCC zSvr4__PName[] =
"svr4__p";
@@ -4163,7 +4466,6 @@ static const char* apzSvr4__PPatch[] = {
*
* Description of Svr4_Getcwd fix
*/
-#define SVR4_GETCWD_FIXIDX 102
tSCC zSvr4_GetcwdName[] =
"svr4_getcwd";
@@ -4199,7 +4501,6 @@ static const char* apzSvr4_GetcwdPatch[] = {
*
* Description of Svr4_Profil fix
*/
-#define SVR4_PROFIL_FIXIDX 103
tSCC zSvr4_ProfilName[] =
"svr4_profil";
@@ -4233,51 +4534,8 @@ static const char* apzSvr4_ProfilPatch[] = {
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
- * Description of Gnu_Types fix
- */
-#define GNU_TYPES_FIXIDX 104
-tSCC zGnu_TypesName[] =
- "gnu_types";
-
-/*
- * File name selection pattern
- */
-tSCC zGnu_TypesList[] =
- "|sys/types.h|stdlib.h|sys/stdtypes.h|stddef.h|memory.h|unistd.h|";
-/*
- * Machine/OS name selection pattern
- */
-#define apzGnu_TypesMachs (const char**)NULL
-
-/*
- * content selection pattern - do fix if pattern found
- */
-tSCC zGnu_TypesSelect0[] =
- "^[ \t]*typedef[ \t]+.*[ \t](ptrdiff|size|wchar)_t;";
-
-/*
- * content bypass pattern - skip fix if pattern found
- */
-tSCC zGnu_TypesBypass0[] =
- "_GCC_(PTRDIFF|SIZE|WCHAR)_T";
-
-#define GNU_TYPES_TEST_CT 2
-static tTestDesc aGnu_TypesTests[] = {
- { TT_NEGREP, zGnu_TypesBypass0, (regex_t*)NULL },
- { TT_EGREP, zGnu_TypesSelect0, (regex_t*)NULL }, };
-
-/*
- * Fix Command Arguments for Gnu_Types
- */
-static const char* apzGnu_TypesPatch[] = {
- "gnu_type",
- (char*)NULL };
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * *
- *
* Description of Sysv68_String fix
*/
-#define SYSV68_STRING_FIXIDX 105
tSCC zSysv68_StringName[] =
"sysv68_string";
@@ -4314,7 +4572,6 @@ extern unsigned int\\\n\
*
* Description of Sysz_Stdlib_For_Sun fix
*/
-#define SYSZ_STDLIB_FOR_SUN_FIXIDX 106
tSCC zSysz_Stdlib_For_SunName[] =
"sysz_stdlib_for_sun";
@@ -4350,7 +4607,6 @@ static const char* apzSysz_Stdlib_For_SunPatch[] = {
*
* Description of Tinfo_Cplusplus fix
*/
-#define TINFO_CPLUSPLUS_FIXIDX 107
tSCC zTinfo_CplusplusName[] =
"tinfo_cplusplus";
@@ -4384,9 +4640,43 @@ static const char* apzTinfo_CplusplusPatch[] = {
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
+ * Description of Ultrix_Atexit_Param fix
+ */
+tSCC zUltrix_Atexit_ParamName[] =
+ "ultrix_atexit_param";
+
+/*
+ * File name selection pattern
+ */
+tSCC zUltrix_Atexit_ParamList[] =
+ "|stdlib.h|";
+/*
+ * Machine/OS name selection pattern
+ */
+#define apzUltrix_Atexit_ParamMachs (const char**)NULL
+
+/*
+ * content selection pattern - do fix if pattern found
+ */
+tSCC zUltrix_Atexit_ParamSelect0[] =
+ "atexit\\(.*\\(\\)";
+
+#define ULTRIX_ATEXIT_PARAM_TEST_CT 1
+static tTestDesc aUltrix_Atexit_ParamTests[] = {
+ { TT_EGREP, zUltrix_Atexit_ParamSelect0, (regex_t*)NULL }, };
+
+/*
+ * Fix Command Arguments for Ultrix_Atexit_Param
+ */
+static const char* apzUltrix_Atexit_ParamPatch[] = {
+ "format",
+ "atexit( void (*__func)( void )",
+ (char*)NULL };
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
* Description of Ultrix_Atof_Param fix
*/
-#define ULTRIX_ATOF_PARAM_FIXIDX 108
tSCC zUltrix_Atof_ParamName[] =
"ultrix_atof_param";
@@ -4422,7 +4712,6 @@ static const char* apzUltrix_Atof_ParamPatch[] = {
*
* Description of Ultrix_Const fix
*/
-#define ULTRIX_CONST_FIXIDX 109
tSCC zUltrix_ConstName[] =
"ultrix_const";
@@ -4459,7 +4748,6 @@ static const char* apzUltrix_ConstPatch[] = {
*
* Description of Ultrix_Const2 fix
*/
-#define ULTRIX_CONST2_FIXIDX 110
tSCC zUltrix_Const2Name[] =
"ultrix_const2";
@@ -4496,7 +4784,6 @@ static const char* apzUltrix_Const2Patch[] = {
*
* Description of Ultrix_Fix_Fixproto fix
*/
-#define ULTRIX_FIX_FIXPROTO_FIXIDX 111
tSCC zUltrix_Fix_FixprotoName[] =
"ultrix_fix_fixproto";
@@ -4534,7 +4821,6 @@ static const char* apzUltrix_Fix_FixprotoPatch[] = {
*
* Description of Ultrix_Ifdef fix
*/
-#define ULTRIX_IFDEF_FIXIDX 112
tSCC zUltrix_IfdefName[] =
"ultrix_ifdef";
@@ -4570,7 +4856,6 @@ static const char* apzUltrix_IfdefPatch[] = {
*
* Description of Ultrix_Math_Ifdef fix
*/
-#define ULTRIX_MATH_IFDEF_FIXIDX 113
tSCC zUltrix_Math_IfdefName[] =
"ultrix_math_ifdef";
@@ -4606,7 +4891,6 @@ static const char* apzUltrix_Math_IfdefPatch[] = {
*
* Description of Ultrix_Nested_Ioctl fix
*/
-#define ULTRIX_NESTED_IOCTL_FIXIDX 114
tSCC zUltrix_Nested_IoctlName[] =
"ultrix_nested_ioctl";
@@ -4641,7 +4925,6 @@ static const char* apzUltrix_Nested_IoctlPatch[] = { "sed",
*
* Description of Ultrix_Nested_Svc fix
*/
-#define ULTRIX_NESTED_SVC_FIXIDX 115
tSCC zUltrix_Nested_SvcName[] =
"ultrix_nested_svc";
@@ -4676,7 +4959,6 @@ static const char* apzUltrix_Nested_SvcPatch[] = { "sed",
*
* Description of Ultrix_Stat fix
*/
-#define ULTRIX_STAT_FIXIDX 116
tSCC zUltrix_StatName[] =
"ultrix_stat";
@@ -4707,8 +4989,7 @@ static const char* apzUltrix_StatPatch[] = { "sed",
"-e", "/^#define[ \t]S_IFPORT[ \t]*S_IFIFO$/a\\\n\
\\\n\
/* macro to test for symbolic link */\\\n\
-#define S_ISLNK(mode) (((mode) & S_IFMT) == S_IFLNK)\\\n\
-\n",
+#define S_ISLNK(mode) (((mode) & S_IFMT) == S_IFLNK)\\\n\n",
"-e", "/^[ \t]*fstat(),$/a\\\n\
\tlstat(),\n",
(char*)NULL };
@@ -4717,7 +4998,6 @@ static const char* apzUltrix_StatPatch[] = { "sed",
*
* Description of Ultrix_Static fix
*/
-#define ULTRIX_STATIC_FIXIDX 117
tSCC zUltrix_StaticName[] =
"ultrix_static";
@@ -4754,7 +5034,6 @@ static const char* apzUltrix_StaticPatch[] = { "sed",
*
* Description of Ultrix_Strings fix
*/
-#define ULTRIX_STRINGS_FIXIDX 118
tSCC zUltrix_StringsName[] =
"ultrix_strings";
@@ -4789,7 +5068,6 @@ static const char* apzUltrix_StringsPatch[] = {
*
* Description of Undefine_Null fix
*/
-#define UNDEFINE_NULL_FIXIDX 119
tSCC zUndefine_NullName[] =
"undefine_null";
@@ -4833,9 +5111,45 @@ static const char* apzUndefine_NullPatch[] = {
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
+ * Description of Unicosmk_Restrict fix
+ */
+tSCC zUnicosmk_RestrictName[] =
+ "unicosmk_restrict";
+
+/*
+ * File name selection pattern
+ */
+tSCC zUnicosmk_RestrictList[] =
+ "|stdio.h|stdlib.h|wchar.h|";
+/*
+ * Machine/OS name selection pattern
+ */
+tSCC* apzUnicosmk_RestrictMachs[] = {
+ "*-*-unicosmk*",
+ (const char*)NULL };
+
+/*
+ * content selection pattern - do fix if pattern found
+ */
+tSCC zUnicosmk_RestrictSelect0[] =
+ "(\\*[ \t]*)restrict([ \t]+)";
+
+#define UNICOSMK_RESTRICT_TEST_CT 1
+static tTestDesc aUnicosmk_RestrictTests[] = {
+ { TT_EGREP, zUnicosmk_RestrictSelect0, (regex_t*)NULL }, };
+
+/*
+ * Fix Command Arguments for Unicosmk_Restrict
+ */
+static const char* apzUnicosmk_RestrictPatch[] = {
+ "format",
+ "%1__restrict__%2",
+ (char*)NULL };
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
* Description of Uw7_Byteorder_Fix fix
*/
-#define UW7_BYTEORDER_FIX_FIXIDX 120
tSCC zUw7_Byteorder_FixName[] =
"uw7_byteorder_fix";
@@ -4866,7 +5180,7 @@ tSCC zUw7_Byteorder_FixSelect0[] =
* perform the 'test' shell command - do fix on success
*/
tSCC zUw7_Byteorder_FixTest0[] =
- "-f $DESTDIR/sys/byteorder.h";
+ "-f sys/byteorder.h";
#define UW7_BYTEORDER_FIX_TEST_CT 2
static tTestDesc aUw7_Byteorder_FixTests[] = {
@@ -4879,14 +5193,13 @@ static tTestDesc aUw7_Byteorder_FixTests[] = {
static const char* apzUw7_Byteorder_FixPatch[] = {
"format",
"",
- "^extern.*(htons|ntohs).*\\(in_port_t\\).*\n",
+ "^extern.*[ \t](htons|ntohs).*\\(in_port_t\\).*;",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
* Description of Va_I960_Macro fix
*/
-#define VA_I960_MACRO_FIXIDX 121
tSCC zVa_I960_MacroName[] =
"va_i960_macro";
@@ -4922,7 +5235,6 @@ static const char* apzVa_I960_MacroPatch[] = {
*
* Description of Void_Null fix
*/
-#define VOID_NULL_FIXIDX 122
tSCC zVoid_NullName[] =
"void_null";
@@ -4958,7 +5270,6 @@ static const char* apzVoid_NullPatch[] = {
*
* Description of Vxworks_Gcc_Problem fix
*/
-#define VXWORKS_GCC_PROBLEM_FIXIDX 123
tSCC zVxworks_Gcc_ProblemName[] =
"vxworks_gcc_problem";
@@ -5008,7 +5319,6 @@ static const char* apzVxworks_Gcc_ProblemPatch[] = { "sed",
*
* Description of Vxworks_Needs_Vxtypes fix
*/
-#define VXWORKS_NEEDS_VXTYPES_FIXIDX 124
tSCC zVxworks_Needs_VxtypesName[] =
"vxworks_needs_vxtypes";
@@ -5044,7 +5354,6 @@ static const char* apzVxworks_Needs_VxtypesPatch[] = {
*
* Description of Vxworks_Needs_Vxworks fix
*/
-#define VXWORKS_NEEDS_VXWORKS_FIXIDX 125
tSCC zVxworks_Needs_VxworksName[] =
"vxworks_needs_vxworks";
@@ -5093,7 +5402,6 @@ static const char* apzVxworks_Needs_VxworksPatch[] = { "sed",
*
* Description of Vxworks_Time fix
*/
-#define VXWORKS_TIME_FIXIDX 126
tSCC zVxworks_TimeName[] =
"vxworks_time";
@@ -5144,7 +5452,6 @@ typedef void (*__gcc_VOIDFUNCPTR) ();\n\
*
* Description of X11_Class fix
*/
-#define X11_CLASS_FIXIDX 127
tSCC zX11_ClassName[] =
"x11_class";
@@ -5191,7 +5498,6 @@ static const char* apzX11_ClassPatch[] = {
*
* Description of X11_Class_Usage fix
*/
-#define X11_CLASS_USAGE_FIXIDX 128
tSCC zX11_Class_UsageName[] =
"x11_class_usage";
@@ -5234,7 +5540,6 @@ static const char* apzX11_Class_UsagePatch[] = {
*
* Description of X11_New fix
*/
-#define X11_NEW_FIXIDX 129
tSCC zX11_NewName[] =
"x11_new";
@@ -5275,7 +5580,6 @@ static const char* apzX11_NewPatch[] = { "sed",
*
* Description of X11_Sprintf fix
*/
-#define X11_SPRINTF_FIXIDX 130
tSCC zX11_SprintfName[] =
"x11_sprintf";
@@ -5314,15 +5618,165 @@ static const char* apzX11_SprintfPatch[] = {
*
* List of all fixes
*/
-#define REGEX_COUNT 136
+#define REGEX_COUNT 151
#define MACH_LIST_SIZE_LIMIT 279
-#define FIX_COUNT 131
+#define FIX_COUNT 144
+
+/*
+ * Enumerate the fixes
+ */
+typedef enum {
+ AAA_BAD_FIXES_FIXIDX,
+ AAA_KI_FIXIDX,
+ AAA_KI_CALLS_FIXIDX,
+ AAA_KI_DEFS_FIXIDX,
+ AAA_KI_IFACE_FIXIDX,
+ AAA_STANDARDS_FIXIDX,
+ AAB_DGUX_INT_VARARGS_FIXIDX,
+ AAB_FD_ZERO_ASM_POSIX_TYPES_H_FIXIDX,
+ AAB_FD_ZERO_GNU_TYPES_H_FIXIDX,
+ AAB_FD_ZERO_SELECTBITS_H_FIXIDX,
+ AAB_SUN_MEMCPY_FIXIDX,
+ AAB_SVR4_REPLACE_BYTEORDER_FIXIDX,
+ AAB_ULTRIX_ANSI_COMPAT_FIXIDX,
+ AAB_ULTRIX_LIMITS_FIXIDX,
+ AAB_ULTRIX_MEMORY_FIXIDX,
+ AAB_ULTRIX_STRING_FIXIDX,
+ AIX_PTHREAD_FIXIDX,
+ AIX_SYSMACHINE_FIXIDX,
+ AIX_SYSWAIT_FIXIDX,
+ AIX_VOLATILE_FIXIDX,
+ ALPHA___ASSERT_FIXIDX,
+ ALPHA_GETOPT_FIXIDX,
+ ALPHA_PARENS_FIXIDX,
+ ALPHA_SBRK_FIXIDX,
+ ARM_NORCROFT_HINT_FIXIDX,
+ ARM_WCHAR_FIXIDX,
+ AUX_ASM_FIXIDX,
+ AVOID_BOOL_DEFINE_FIXIDX,
+ AVOID_BOOL_TYPE_FIXIDX,
+ AVOID_WCHAR_T_TYPE_FIXIDX,
+ BAD_LVAL_FIXIDX,
+ BAD_STRUCT_TERM_FIXIDX,
+ BADQUOTE_FIXIDX,
+ BROKEN_ASSERT_STDIO_FIXIDX,
+ BROKEN_ASSERT_STDLIB_FIXIDX,
+ BROKEN_CABS_FIXIDX,
+ CTRL_QUOTES_DEF_FIXIDX,
+ CTRL_QUOTES_USE_FIXIDX,
+ CXX_UNREADY_FIXIDX,
+ DEC_INTERN_ASM_FIXIDX,
+ DJGPP_WCHAR_H_FIXIDX,
+ ECD_CURSOR_FIXIDX,
+ FIX_HEADER_BREAKAGE_FIXIDX,
+ FREEBSD_GCC3_BREAKAGE_FIXIDX,
+ GNU_TYPES_FIXIDX,
+ HP_INLINE_FIXIDX,
+ HP_SYSFILE_FIXIDX,
+ HPUX10_CPP_POW_INLINE_FIXIDX,
+ HPUX11_CPP_POW_INLINE_FIXIDX,
+ HPUX11_FABSF_FIXIDX,
+ HPUX11_SIZE_T_FIXIDX,
+ HPUX11_UINT32_C_FIXIDX,
+ HPUX11_VSNPRINTF_FIXIDX,
+ HPUX8_BOGUS_INLINES_FIXIDX,
+ HPUX_MAXINT_FIXIDX,
+ HPUX_SYSTIME_FIXIDX,
+ INT_ABORT_FREE_AND_EXIT_FIXIDX,
+ IO_QUOTES_DEF_FIXIDX,
+ IO_QUOTES_USE_FIXIDX,
+ IP_MISSING_SEMI_FIXIDX,
+ IRIX_ASM_APOSTROPHE_FIXIDX,
+ IRIX_LIMITS_CONST_FIXIDX,
+ IRIX_STDIO_VA_LIST_FIXIDX,
+ ISC_FMOD_FIXIDX,
+ ISC_OMITS_WITH_STDC_FIXIDX,
+ KANDR_CONCAT_FIXIDX,
+ LIBC1_IFDEFD_MEMX_FIXIDX,
+ LIMITS_IFNDEFS_FIXIDX,
+ LYNX_VOID_INT_FIXIDX,
+ LYNXOS_FCNTL_PROTO_FIXIDX,
+ M88K_BAD_HYPOT_OPT_FIXIDX,
+ M88K_BAD_S_IF_FIXIDX,
+ M88K_MULTI_INCL_FIXIDX,
+ MACHINE_ANSI_H_VA_LIST_FIXIDX,
+ MACHINE_NAME_FIXIDX,
+ MATH_EXCEPTION_FIXIDX,
+ MATH_HUGE_VAL_FROM_DBL_MAX_FIXIDX,
+ MATH_HUGE_VAL_IFNDEF_FIXIDX,
+ NESTED_AUTH_DES_FIXIDX,
+ NESTED_MOTOROLA_FIXIDX,
+ NESTED_SYS_LIMITS_FIXIDX,
+ NEWS_OS_RECURSION_FIXIDX,
+ NEXT_MATH_PREFIX_FIXIDX,
+ NEXT_TEMPLATE_FIXIDX,
+ NEXT_VOLITILE_FIXIDX,
+ NEXT_WAIT_UNION_FIXIDX,
+ NODEENT_SYNTAX_FIXIDX,
+ OSF_NAMESPACE_A_FIXIDX,
+ OSF_NAMESPACE_C_FIXIDX,
+ PTHREAD_PAGE_SIZE_FIXIDX,
+ READ_RET_TYPE_FIXIDX,
+ RS6000_DOUBLE_FIXIDX,
+ RS6000_FCHMOD_FIXIDX,
+ RS6000_PARAM_FIXIDX,
+ SCO_STATIC_FUNC_FIXIDX,
+ SCO_UTIME_FIXIDX,
+ SOLARIS_MUTEX_INIT_FIXIDX,
+ STATSSWTCH_FIXIDX,
+ STDIO_STDARG_H_FIXIDX,
+ STDIO_VA_LIST_FIXIDX,
+ STRICT_ANSI_NOT_FIXIDX,
+ STRICT_ANSI_NOT_CTD_FIXIDX,
+ STRICT_ANSI_ONLY_FIXIDX,
+ STRUCT_FILE_FIXIDX,
+ STRUCT_SOCKADDR_FIXIDX,
+ SUN_AUTH_PROTO_FIXIDX,
+ SUN_BOGUS_IFDEF_FIXIDX,
+ SUN_CATMACRO_FIXIDX,
+ SUN_MALLOC_FIXIDX,
+ SUN_RUSERS_SEMI_FIXIDX,
+ SUN_SIGNAL_FIXIDX,
+ SUNOS_MATHERR_DECL_FIXIDX,
+ SUNOS_STRLEN_FIXIDX,
+ SVR4__P_FIXIDX,
+ SVR4_GETCWD_FIXIDX,
+ SVR4_PROFIL_FIXIDX,
+ SYSV68_STRING_FIXIDX,
+ SYSZ_STDLIB_FOR_SUN_FIXIDX,
+ TINFO_CPLUSPLUS_FIXIDX,
+ ULTRIX_ATEXIT_PARAM_FIXIDX,
+ ULTRIX_ATOF_PARAM_FIXIDX,
+ ULTRIX_CONST_FIXIDX,
+ ULTRIX_CONST2_FIXIDX,
+ ULTRIX_FIX_FIXPROTO_FIXIDX,
+ ULTRIX_IFDEF_FIXIDX,
+ ULTRIX_MATH_IFDEF_FIXIDX,
+ ULTRIX_NESTED_IOCTL_FIXIDX,
+ ULTRIX_NESTED_SVC_FIXIDX,
+ ULTRIX_STAT_FIXIDX,
+ ULTRIX_STATIC_FIXIDX,
+ ULTRIX_STRINGS_FIXIDX,
+ UNDEFINE_NULL_FIXIDX,
+ UNICOSMK_RESTRICT_FIXIDX,
+ UW7_BYTEORDER_FIX_FIXIDX,
+ VA_I960_MACRO_FIXIDX,
+ VOID_NULL_FIXIDX,
+ VXWORKS_GCC_PROBLEM_FIXIDX,
+ VXWORKS_NEEDS_VXTYPES_FIXIDX,
+ VXWORKS_NEEDS_VXWORKS_FIXIDX,
+ VXWORKS_TIME_FIXIDX,
+ X11_CLASS_FIXIDX,
+ X11_CLASS_USAGE_FIXIDX,
+ X11_NEW_FIXIDX,
+ X11_SPRINTF_FIXIDX
+} t_fixinc_idx;
tFixDesc fixDescList[ FIX_COUNT ] = {
- { zAaa_Ki_IfaceName, zAaa_Ki_IfaceList,
- apzAaa_Ki_IfaceMachs,
- AAA_KI_IFACE_TEST_CT, FD_MACH_ONLY | FD_REPLACEMENT,
- aAaa_Ki_IfaceTests, apzAaa_Ki_IfacePatch, 0 },
+ { zAaa_Bad_FixesName, zAaa_Bad_FixesList,
+ apzAaa_Bad_FixesMachs,
+ AAA_BAD_FIXES_TEST_CT, FD_MACH_ONLY | FD_REPLACEMENT,
+ aAaa_Bad_FixesTests, apzAaa_Bad_FixesPatch, 0 },
{ zAaa_KiName, zAaa_KiList,
apzAaa_KiMachs,
@@ -5339,15 +5793,15 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
AAA_KI_DEFS_TEST_CT, FD_MACH_ONLY | FD_REPLACEMENT,
aAaa_Ki_DefsTests, apzAaa_Ki_DefsPatch, 0 },
- { zAaa_Bad_FixesName, zAaa_Bad_FixesList,
- apzAaa_Bad_FixesMachs,
- AAA_BAD_FIXES_TEST_CT, FD_MACH_ONLY | FD_REPLACEMENT,
- aAaa_Bad_FixesTests, apzAaa_Bad_FixesPatch, 0 },
+ { zAaa_Ki_IfaceName, zAaa_Ki_IfaceList,
+ apzAaa_Ki_IfaceMachs,
+ AAA_KI_IFACE_TEST_CT, FD_MACH_ONLY | FD_REPLACEMENT,
+ aAaa_Ki_IfaceTests, apzAaa_Ki_IfacePatch, 0 },
- { zAaa_TimeName, zAaa_TimeList,
- apzAaa_TimeMachs,
- AAA_TIME_TEST_CT, FD_MACH_ONLY | FD_REPLACEMENT,
- aAaa_TimeTests, apzAaa_TimePatch, 0 },
+ { zAaa_StandardsName, zAaa_StandardsList,
+ apzAaa_StandardsMachs,
+ AAA_STANDARDS_TEST_CT, FD_MACH_ONLY | FD_REPLACEMENT,
+ aAaa_StandardsTests, apzAaa_StandardsPatch, 0 },
{ zAab_Dgux_Int_VarargsName, zAab_Dgux_Int_VarargsList,
apzAab_Dgux_Int_VarargsMachs,
@@ -5419,6 +5873,11 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
AIX_VOLATILE_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aAix_VolatileTests, apzAix_VolatilePatch, 0 },
+ { zAlpha___AssertName, zAlpha___AssertList,
+ apzAlpha___AssertMachs,
+ ALPHA___ASSERT_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+ aAlpha___AssertTests, apzAlpha___AssertPatch, 0 },
+
{ zAlpha_GetoptName, zAlpha_GetoptList,
apzAlpha_GetoptMachs,
ALPHA_GETOPT_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
@@ -5514,6 +5973,11 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
DEC_INTERN_ASM_TEST_CT, FD_MACH_ONLY,
aDec_Intern_AsmTests, apzDec_Intern_AsmPatch, 0 },
+ { zDjgpp_Wchar_HName, zDjgpp_Wchar_HList,
+ apzDjgpp_Wchar_HMachs,
+ DJGPP_WCHAR_H_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+ aDjgpp_Wchar_HTests, apzDjgpp_Wchar_HPatch, 0 },
+
{ zEcd_CursorName, zEcd_CursorList,
apzEcd_CursorMachs,
ECD_CURSOR_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
@@ -5524,6 +5988,16 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
FIX_HEADER_BREAKAGE_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aFix_Header_BreakageTests, apzFix_Header_BreakagePatch, 0 },
+ { zFreebsd_Gcc3_BreakageName, zFreebsd_Gcc3_BreakageList,
+ apzFreebsd_Gcc3_BreakageMachs,
+ FREEBSD_GCC3_BREAKAGE_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+ aFreebsd_Gcc3_BreakageTests, apzFreebsd_Gcc3_BreakagePatch, 0 },
+
+ { zGnu_TypesName, zGnu_TypesList,
+ apzGnu_TypesMachs,
+ GNU_TYPES_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+ aGnu_TypesTests, apzGnu_TypesPatch, 0 },
+
{ zHp_InlineName, zHp_InlineList,
apzHp_InlineMachs,
HP_INLINE_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
@@ -5534,31 +6008,56 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
HP_SYSFILE_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aHp_SysfileTests, apzHp_SysfilePatch, 0 },
+ { zHpux10_Cpp_Pow_InlineName, zHpux10_Cpp_Pow_InlineList,
+ apzHpux10_Cpp_Pow_InlineMachs,
+ HPUX10_CPP_POW_INLINE_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+ aHpux10_Cpp_Pow_InlineTests, apzHpux10_Cpp_Pow_InlinePatch, 0 },
+
+ { zHpux11_Cpp_Pow_InlineName, zHpux11_Cpp_Pow_InlineList,
+ apzHpux11_Cpp_Pow_InlineMachs,
+ HPUX11_CPP_POW_INLINE_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+ aHpux11_Cpp_Pow_InlineTests, apzHpux11_Cpp_Pow_InlinePatch, 0 },
+
{ zHpux11_FabsfName, zHpux11_FabsfList,
apzHpux11_FabsfMachs,
HPUX11_FABSF_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aHpux11_FabsfTests, apzHpux11_FabsfPatch, 0 },
+ { zHpux11_Size_TName, zHpux11_Size_TList,
+ apzHpux11_Size_TMachs,
+ HPUX11_SIZE_T_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+ aHpux11_Size_TTests, apzHpux11_Size_TPatch, 0 },
+
{ zHpux11_Uint32_CName, zHpux11_Uint32_CList,
apzHpux11_Uint32_CMachs,
HPUX11_UINT32_C_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aHpux11_Uint32_CTests, apzHpux11_Uint32_CPatch, 0 },
+ { zHpux11_VsnprintfName, zHpux11_VsnprintfList,
+ apzHpux11_VsnprintfMachs,
+ HPUX11_VSNPRINTF_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+ aHpux11_VsnprintfTests, apzHpux11_VsnprintfPatch, 0 },
+
{ zHpux8_Bogus_InlinesName, zHpux8_Bogus_InlinesList,
apzHpux8_Bogus_InlinesMachs,
HPUX8_BOGUS_INLINES_TEST_CT, FD_MACH_ONLY,
aHpux8_Bogus_InlinesTests, apzHpux8_Bogus_InlinesPatch, 0 },
+ { zHpux_MaxintName, zHpux_MaxintList,
+ apzHpux_MaxintMachs,
+ HPUX_MAXINT_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+ aHpux_MaxintTests, apzHpux_MaxintPatch, 0 },
+
+ { zHpux_SystimeName, zHpux_SystimeList,
+ apzHpux_SystimeMachs,
+ HPUX_SYSTIME_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+ aHpux_SystimeTests, apzHpux_SystimePatch, 0 },
+
{ zInt_Abort_Free_And_ExitName, zInt_Abort_Free_And_ExitList,
apzInt_Abort_Free_And_ExitMachs,
INT_ABORT_FREE_AND_EXIT_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aInt_Abort_Free_And_ExitTests, apzInt_Abort_Free_And_ExitPatch, 0 },
- { zIsc_Omits_With_StdcName, zIsc_Omits_With_StdcList,
- apzIsc_Omits_With_StdcMachs,
- ISC_OMITS_WITH_STDC_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
- aIsc_Omits_With_StdcTests, apzIsc_Omits_With_StdcPatch, 0 },
-
{ zIo_Quotes_DefName, zIo_Quotes_DefList,
apzIo_Quotes_DefMachs,
IO_QUOTES_DEF_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
@@ -5569,16 +6068,6 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
IO_QUOTES_USE_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aIo_Quotes_UseTests, apzIo_Quotes_UsePatch, 0 },
- { zHpux_MaxintName, zHpux_MaxintList,
- apzHpux_MaxintMachs,
- HPUX_MAXINT_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
- aHpux_MaxintTests, apzHpux_MaxintPatch, 0 },
-
- { zHpux_SystimeName, zHpux_SystimeList,
- apzHpux_SystimeMachs,
- HPUX_SYSTIME_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
- aHpux_SystimeTests, apzHpux_SystimePatch, 0 },
-
{ zIp_Missing_SemiName, zIp_Missing_SemiList,
apzIp_Missing_SemiMachs,
IP_MISSING_SEMI_TEST_CT, FD_MACH_ONLY,
@@ -5594,11 +6083,21 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
IRIX_LIMITS_CONST_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aIrix_Limits_ConstTests, apzIrix_Limits_ConstPatch, 0 },
+ { zIrix_Stdio_Va_ListName, zIrix_Stdio_Va_ListList,
+ apzIrix_Stdio_Va_ListMachs,
+ IRIX_STDIO_VA_LIST_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+ aIrix_Stdio_Va_ListTests, apzIrix_Stdio_Va_ListPatch, 0 },
+
{ zIsc_FmodName, zIsc_FmodList,
apzIsc_FmodMachs,
ISC_FMOD_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aIsc_FmodTests, apzIsc_FmodPatch, 0 },
+ { zIsc_Omits_With_StdcName, zIsc_Omits_With_StdcList,
+ apzIsc_Omits_With_StdcMachs,
+ ISC_OMITS_WITH_STDC_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+ aIsc_Omits_With_StdcTests, apzIsc_Omits_With_StdcPatch, 0 },
+
{ zKandr_ConcatName, zKandr_ConcatList,
apzKandr_ConcatMachs,
KANDR_CONCAT_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
@@ -5664,6 +6163,11 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
MATH_HUGE_VAL_IFNDEF_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aMath_Huge_Val_IfndefTests, apzMath_Huge_Val_IfndefPatch, 0 },
+ { zNested_Auth_DesName, zNested_Auth_DesList,
+ apzNested_Auth_DesMachs,
+ NESTED_AUTH_DES_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+ aNested_Auth_DesTests, apzNested_Auth_DesPatch, 0 },
+
{ zNested_MotorolaName, zNested_MotorolaList,
apzNested_MotorolaMachs,
NESTED_MOTOROLA_TEST_CT, FD_MACH_ONLY,
@@ -5674,11 +6178,6 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
NESTED_SYS_LIMITS_TEST_CT, FD_MACH_ONLY,
aNested_Sys_LimitsTests, apzNested_Sys_LimitsPatch, 0 },
- { zNested_Auth_DesName, zNested_Auth_DesList,
- apzNested_Auth_DesMachs,
- NESTED_AUTH_DES_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
- aNested_Auth_DesTests, apzNested_Auth_DesPatch, 0 },
-
{ zNews_Os_RecursionName, zNews_Os_RecursionList,
apzNews_Os_RecursionMachs,
NEWS_OS_RECURSION_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
@@ -5749,16 +6248,16 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
SCO_STATIC_FUNC_TEST_CT, FD_MACH_ONLY,
aSco_Static_FuncTests, apzSco_Static_FuncPatch, 0 },
- { zSco_Strict_AnsiName, zSco_Strict_AnsiList,
- apzSco_Strict_AnsiMachs,
- SCO_STRICT_ANSI_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
- aSco_Strict_AnsiTests, apzSco_Strict_AnsiPatch, 0 },
-
{ zSco_UtimeName, zSco_UtimeList,
apzSco_UtimeMachs,
SCO_UTIME_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aSco_UtimeTests, apzSco_UtimePatch, 0 },
+ { zSolaris_Mutex_InitName, zSolaris_Mutex_InitList,
+ apzSolaris_Mutex_InitMachs,
+ SOLARIS_MUTEX_INIT_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+ aSolaris_Mutex_InitTests, apzSolaris_Mutex_InitPatch, 0 },
+
{ zStatsswtchName, zStatsswtchList,
apzStatsswtchMachs,
STATSSWTCH_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
@@ -5774,6 +6273,21 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
STDIO_VA_LIST_TEST_CT, FD_MACH_ONLY,
aStdio_Va_ListTests, apzStdio_Va_ListPatch, 0 },
+ { zStrict_Ansi_NotName, zStrict_Ansi_NotList,
+ apzStrict_Ansi_NotMachs,
+ STRICT_ANSI_NOT_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+ aStrict_Ansi_NotTests, apzStrict_Ansi_NotPatch, 0 },
+
+ { zStrict_Ansi_Not_CtdName, zStrict_Ansi_Not_CtdList,
+ apzStrict_Ansi_Not_CtdMachs,
+ STRICT_ANSI_NOT_CTD_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+ aStrict_Ansi_Not_CtdTests, apzStrict_Ansi_Not_CtdPatch, 0 },
+
+ { zStrict_Ansi_OnlyName, zStrict_Ansi_OnlyList,
+ apzStrict_Ansi_OnlyMachs,
+ STRICT_ANSI_ONLY_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+ aStrict_Ansi_OnlyTests, apzStrict_Ansi_OnlyPatch, 0 },
+
{ zStruct_FileName, zStruct_FileList,
apzStruct_FileMachs,
STRUCT_FILE_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
@@ -5839,11 +6353,6 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
SVR4_PROFIL_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aSvr4_ProfilTests, apzSvr4_ProfilPatch, 0 },
- { zGnu_TypesName, zGnu_TypesList,
- apzGnu_TypesMachs,
- GNU_TYPES_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
- aGnu_TypesTests, apzGnu_TypesPatch, 0 },
-
{ zSysv68_StringName, zSysv68_StringList,
apzSysv68_StringMachs,
SYSV68_STRING_TEST_CT, FD_MACH_ONLY,
@@ -5859,6 +6368,11 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
TINFO_CPLUSPLUS_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aTinfo_CplusplusTests, apzTinfo_CplusplusPatch, 0 },
+ { zUltrix_Atexit_ParamName, zUltrix_Atexit_ParamList,
+ apzUltrix_Atexit_ParamMachs,
+ ULTRIX_ATEXIT_PARAM_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+ aUltrix_Atexit_ParamTests, apzUltrix_Atexit_ParamPatch, 0 },
+
{ zUltrix_Atof_ParamName, zUltrix_Atof_ParamList,
apzUltrix_Atof_ParamMachs,
ULTRIX_ATOF_PARAM_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
@@ -5919,6 +6433,11 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
UNDEFINE_NULL_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aUndefine_NullTests, apzUndefine_NullPatch, 0 },
+ { zUnicosmk_RestrictName, zUnicosmk_RestrictList,
+ apzUnicosmk_RestrictMachs,
+ UNICOSMK_RESTRICT_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+ aUnicosmk_RestrictTests, apzUnicosmk_RestrictPatch, 0 },
+
{ zUw7_Byteorder_FixName, zUw7_Byteorder_FixList,
apzUw7_Byteorder_FixMachs,
UW7_BYTEORDER_FIX_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
diff --git a/gcc/fixinc/fixlib.h b/gcc/fixinc/fixlib.h
index 4490d2086ea..6bcc6e2c666 100644
--- a/gcc/fixinc/fixlib.h
+++ b/gcc/fixinc/fixlib.h
@@ -3,7 +3,7 @@
files which are fixed to work correctly with ANSI C and placed in a
directory that GNU C will search.
- Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -22,11 +22,12 @@ along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#ifndef FIXINCLUDES_FIXLIB_H
-#define FIXINCLUDES_FIXLIB_H
+#ifndef GCC_FIXLIB_H
+#define GCC_FIXLIB_H
#include "auto-host.h"
-#include "gansidecl.h"
+#include "ansidecl.h"
+#include "config.h"
#include "system.h"
#include "gnu-regex.h"
@@ -88,7 +89,7 @@ typedef int t_success;
#define IGNORE_ARG(a) ((void)(a))
-typedef enum
+typedef enum t_bool
{
BOOL_FALSE, BOOL_TRUE
} t_bool;
@@ -223,4 +224,4 @@ void mn_get_regexps
PARAMS(( regex_t** label_re, regex_t** name_re,
tCC *who ));
#endif
-#endif /* FIXINCLUDES_FIXLIB_H */
+#endif /* ! GCC_FIXLIB_H */
diff --git a/gcc/fixinc/fixtests.c b/gcc/fixinc/fixtests.c
index e3da35b8c36..40687cfc755 100644
--- a/gcc/fixinc/fixtests.c
+++ b/gcc/fixinc/fixtests.c
@@ -47,6 +47,10 @@ Boston, MA 02111-1307, USA. */
#include "fixlib.h"
+#define _ENV_(v,m,n,t) extern tCC* v;
+ENV_TABLE
+#undef _ENV_
+
typedef apply_fix_p_t t_test_proc PARAMS(( tCC* file, tCC* text ));
typedef struct {
@@ -55,7 +59,8 @@ typedef struct {
} test_entry_t;
#define FIX_TEST_TABLE \
- _FT_( "machine_name", machine_name_test )
+ _FT_( "machine_name", machine_name_test ) \
+ _FT_( "stdc_0_in_system_headers", stdc_0_in_system_headers_test )
#define TEST_FOR_FIX_PROC_HEAD( test ) \
static apply_fix_p_t test PARAMS(( tCC* file, tCC* text )); \
@@ -116,6 +121,16 @@ TEST_FOR_FIX_PROC_HEAD( machine_name_test )
}
+TEST_FOR_FIX_PROC_HEAD( stdc_0_in_system_headers_test )
+{
+#ifdef STDC_0_IN_SYSTEM_HEADERS
+ return (pz_machine == NULL) ? APPLY_FIX : SKIP_FIX;
+#else
+ return APPLY_FIX;
+#endif
+}
+
+
/* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
test for fix selector
diff --git a/gcc/fixinc/genfixes b/gcc/fixinc/genfixes
index c0ae1e5f22f..a47e091db7a 100755
--- a/gcc/fixinc/genfixes
+++ b/gcc/fixinc/genfixes
@@ -68,15 +68,15 @@ set -e
case "$1" in
fixincl.x | */fixincl.x )
- if (${AG} --help > /dev/null 2>&1)
+ if [ -z "`${AG} -v | fgrep 'Ver. 5.'`" ]
then
- echo AutoGen-ing fixincl.x
- $AG inclhack.def
- else
- echo "AutoGen does not appear to be correctly installed."
+ echo "AutoGen appears to be out of date or not correctly installed."
echo "Please download and install:"
echo " ftp://gcc.gnu.org/pub/gcc/infrastructure/autogen.tar.gz"
touch fixincl.x
+ else
+ echo AutoGen-ing fixincl.x
+ $AG inclhack.def
fi
;;
diff --git a/gcc/fixinc/gnu-regex.c b/gcc/fixinc/gnu-regex.c
index a6ebd96e832..99786e2d49d 100644
--- a/gcc/fixinc/gnu-regex.c
+++ b/gcc/fixinc/gnu-regex.c
@@ -22,10 +22,6 @@
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-#include "auto-host.h"
-/* GCC LOCAL: we don't need NLS here. */
-#undef ENABLE_NLS
-
#undef _GNU_SOURCE
#define _GNU_SOURCE
@@ -33,6 +29,11 @@
# include <config.h>
#endif
+/* GCC LOCAL: we don't need NLS here. */
+#undef ENABLE_NLS
+/* GCC LOCAL: to handle defining alloca. */
+#include "libiberty.h"
+
/* Do not use a C alloca, we will leak memory and crash. */
#ifdef C_ALLOCA
# define REGEX_MALLOC
diff --git a/gcc/fixinc/inclhack.def b/gcc/fixinc/inclhack.def
index 40332750c1d..6ff8f138317 100644
--- a/gcc/fixinc/inclhack.def
+++ b/gcc/fixinc/inclhack.def
@@ -6,6 +6,15 @@ autogen definitions fixincl;
/* Define all the fixes we know about for repairing damaged headers.
Please see the README before adding or changing entries in this file.
+ This is the sort command:
+
+ blocksort output=XXX \
+ pattern='^/\*$' \
+ start='DO +NOT +DO +BROKEN +FIXES' \
+ trailer='^/\*EOF\*[/]' \
+ input=inclhack.def \
+ key='hackname[ ]*=[ ]*(.*);'
+
Set up a debug test so we can make the templates emit special
code while debugging these fixes: */
@@ -16,12 +25,15 @@ FIXINC_DEBUG = yes;
/* DO NOT DO BROKEN FIXES (empty replacement fixes) */
/*
- * Purge some HP-UX 11 files that are only broken after they are "fixed".
+ * This file on SunOS 4 has a very large macro. When the sed loop
+ * tries pull it in, it overflows the pattern space size of the SunOS
+ * sed (GNU sed does not have this problem). Since the file does not
+ * require fixing, we remove it from the fixed directory.
*/
fix = {
- hackname = AAA_ki_iface;
- files = sys/ki_iface.h;
- select = 'These definitions are for HP Internal developers';
+ hackname = AAA_bad_fixes;
+ files = sundev/ipi_error.h;
+ /* shouldn't there be a select expression here??? */
replace; /* empty replacement -> no fixing the file */
};
@@ -60,52 +72,51 @@ fix = {
/*
- * This file on SunOS 4 has a very large macro. When the sed loop
- * tries pull it in, it overflows the pattern space size of the SunOS
- * sed (GNU sed does not have this problem). Since the file does not
- * require fixing, we remove it from the fixed directory.
+ * Purge some HP-UX 11 files that are only broken after they are "fixed".
*/
fix = {
- hackname = AAA_bad_fixes;
- files = sundev/ipi_error.h;
- /* shouldn't there be a select expression here??? */
+ hackname = AAA_ki_iface;
+ files = sys/ki_iface.h;
+ select = 'These definitions are for HP Internal developers';
replace; /* empty replacement -> no fixing the file */
};
/*
- * Purge some HP-UX 11 files that are only broken after they are "fixed".
+ * Tru64 UNIX V4.0F/V5.1 <standards.h> defines _NO_PROTO and _NONSTD_TYPES
+ * correctly for GCC, but strict_ansi_not breaks it.
*/
fix = {
- hackname = AAA_time;
- files = sys/time.h;
- select = '11.0 and later representation of ki time';
+ hackname = AAA_standards;
+ files = standards.h;
+ select = 'GNU and MIPS C compilers define __STDC__ differently';
replace; /* empty replacement -> no fixing the file */
};
/* And now, the real fixes, replacement text fixes first: */
/*
- * Completely replace &lt;_int_varargs.h&gt; with a file that includes gcc's
+ * Completely replace <_int_varargs.h> with a file that includes gcc's
* stdarg.h or varargs.h files as appropriate on DG/UX
*/
fix = {
hackname = AAB_dgux_int_varargs;
files = _int_varargs.h;
- replace = "#ifndef __INT_VARARGS_H
+ replace =
+"#ifndef __INT_VARARGS_H
\#define __INT_VARARGS_H
/************************************************************************/
/* _INT_VARARGS.H - Define the common stuff for varargs/stdarg/stdio. */
/************************************************************************/
-/*
+/*" "
** This file is a DG internal header. Never include this
** file directly.
*/
\#ifndef ___int_features_h
-\#include &lt;sys/_int_features.h&gt;
+\#include <sys/_int_features.h>
\#endif
\#if !(defined(_VA_LIST) || defined(_VA_LIST_))
@@ -320,6 +331,29 @@ extern int memcmp();
/*
+ * Completely replace <sys/varargs.h> with a file that includes gcc's
+ * stdarg.h or varargs.h files as appropriate.
+ */
+#ifdef SVR4
+fix = {
+ hackname = AAB_svr4_no_varargs;
+ files = sys/varargs.h;
+ replace = "/* This file was generated by fixincludes. */\n"
+ "#ifndef _SYS_VARARGS_H\n"
+ "#define _SYS_VARARGS_H\n\n"
+
+ "#ifdef __STDC__\n"
+ "#include <stdarg.h>\n"
+ "#else\n"
+ "#include <varargs.h>\n"
+ "#endif\n\n"
+
+ "#endif /* _SYS_VARARGS_H */\n";
+};
+#endif
+
+
+/*
* Completely replace <sys/byteorder.h>; with a file that implements gcc's
* optimized byteswapping. Restricted to "SVR4" machines until either
* it is shown to be safe to replace this file always, or we get bolder ;-)
@@ -483,29 +517,6 @@ ntohs (unsigned int __arg)
/*
- * Completely replace <sys/varargs.h> with a file that includes gcc's
- * stdarg.h or varargs.h files as appropriate.
- */
-#ifdef SVR4
-fix = {
- hackname = AAB_svr4_no_varargs;
- files = sys/varargs.h;
- replace = "/* This file was generated by fixincludes. */\n"
- "#ifndef _SYS_VARARGS_H\n"
- "#define _SYS_VARARGS_H\n\n"
-
- "#ifdef __STDC__\n"
- "#include <stdarg.h>\n"
- "#else\n"
- "#include <varargs.h>\n"
- "#endif\n\n"
-
- "#endif /* _SYS_VARARGS_H */\n";
-};
-#endif
-
-
-/*
* Cancel out ansi_compat.h on Ultrix. Replace it with an empty file.
*/
fix = {
@@ -525,9 +536,7 @@ fix = {
files = limits.h;
mach = "*-*-ultrix4.3";
replace =
-'/* @(#)limits.h */
-/* This file was generated by fixincludes */
-\#ifndef _LIMITS_INCLUDED
+'#ifndef _LIMITS_INCLUDED
\#define _LIMITS_INCLUDED
\#include <sys/limits.h>
\#endif /* _LIMITS_INCLUDED */
@@ -545,9 +554,7 @@ fix = {
files = memory.h;
mach = "*-*-ultrix4.3";
replace =
-'/* @(#)memory.h */
-/* This file was generated by fixincludes */
-\#ifndef _MEMORY_INCLUDED
+'#ifndef _MEMORY_INCLUDED
\#define _MEMORY_INCLUDED
\#include <strings.h>
\#endif /* _MEMORY_INCLUDED */
@@ -565,9 +572,7 @@ fix = {
files = string.h;
mach = "*-*-ultrix4.3";
replace =
-'/* @(#)string.h */
-/* This file was generated by fixincludes */
-\#ifndef _STRING_INCLUDED
+'#ifndef _STRING_INCLUDED
\#define _STRING_INCLUDED
\#include <strings.h>
\#endif /* _STRING_INCLUDED */
@@ -639,6 +644,19 @@ fix = {
/*
+ * Fix __assert declaration in assert.h on Alpha OSF/1.
+ */
+fix = {
+ hackname = alpha___assert;
+ files = "assert.h";
+ select = '__assert\(char \*, char \*, int\)';
+ c_fix = format;
+ c_fix_arg = "__assert(const char *, const char *, int)";
+ test_text = 'extern void __assert(char *, char *, int);';
+};
+
+
+/*
* Fix getopt declarations in stdio.h and stdlib.h on Alpha OSF/1 and AIX.
*/
fix = {
@@ -1000,6 +1018,21 @@ fix = {
/*
+ * Fix typo in <wchar.h> on DJGPP 2.03.
+ */
+fix = {
+ hackname = djgpp_wchar_h;
+ file = wchar.h;
+ select = "__DJ_wint_t";
+ bypass = "sys/djtypes.h";
+ c_fix = format;
+ c_fix_arg = "%0\n#include <sys/djtypes.h>";
+ c_fix_arg = "#include <stddef.h>";
+ test_text = "#include <stddef.h>\n"
+ "extern __DJ_wint_t x;\n";
+};
+
+/*
* Fix these Sun OS files to avoid an invalid identifier in an #ifdef.
*/
fix = {
@@ -1031,6 +1064,44 @@ fix = {
/*
+ * Between 8/24/1998 and 2/17/2001, FreeBSD system headers presume
+ * neither the existence of GCC 3 nor its exact feature set yet break
+ * (by design?) when __GNUC__ is set beyond 2.
+ */
+fix = {
+ hackname = freebsd_gcc3_breakage;
+ mach = *-*-freebsd*;
+ files = sys/cdefs.h;
+ select = '^#if __GNUC__ == 2 && __GNUC_MINOR__ >= 7$';
+ bypass = '__GNUC__[ \t]*([>=]=[ \t]*[3-9]|>[ \t]*2)';
+ c_fix = format;
+ c_fix_arg = '%0 || __GNUC__ >= 3';
+ test_text = '#if __GNUC__ == 2 && __GNUC_MINOR__ >= 7';
+};
+
+
+/*
+ * Fix these files to use the same types that we think they should.
+ */
+fix = {
+ hackname = gnu_types;
+ files = "sys/types.h";
+ files = "stdlib.h";
+ files = "sys/stdtypes.h";
+ files = "stddef.h";
+ files = "memory.h";
+ files = "unistd.h";
+ bypass = '_GCC_(PTRDIFF|SIZE|WCHAR)_T';
+ select = "^[ \t]*typedef[ \t]+.*[ \t](ptrdiff|size|wchar)_t;";
+ c_fix = gnu_type;
+
+ test_text = "typedef long int ptrdiff_t; /* long int */\n"
+ "typedef uint_t size_t; /* uint_t */\n"
+ "typedef ushort_t wchar_t; /* ushort_t */";
+};
+
+
+/*
* Fix HP & Sony's use of "../machine/xxx.h"
* to refer to: <machine/xxx.h>
*/
@@ -1067,6 +1138,54 @@ fix = {
/*
+ * Delete C++ double pow (double, int) inline function from HP-UX 10 & 11
+ * math.h to prevent clash with define in c_std/bits/std_cmath.h.
+ */
+fix = {
+ hackname = hpux10_cpp_pow_inline;
+ files = fixinc-test-limits.h, math.h;
+ select = <<- END_POW_INLINE
+ ^# +ifdef +__cplusplus
+ +}
+ +inline +double +pow\(double +__d,int +__expon\) +{
+ [ ]+return +pow\(__d,\(double\)__expon\);
+ +}
+ +extern +"C" +{
+ #else
+ # +endif
+ END_POW_INLINE;
+
+ c_fix = format;
+ c_fix_arg = "";
+
+ test_text =
+ "# ifdef __cplusplus\n"
+ " }\n"
+ " inline double pow(double __d,int __expon) {\n"
+ "\t return pow(__d,(double)__expon);\n"
+ " }\n"
+ ' extern "C"' " {\n"
+ "#else\n"
+ "# endif";
+};
+
+fix = {
+ hackname = hpux11_cpp_pow_inline;
+ files = math.h;
+ select = " +inline double pow\\(double d,int expon\\) {\n"
+ " +return pow\\(d, \\(double\\)expon\\);\n"
+ " +}\n";
+ c_fix = format;
+ c_fix_arg = "";
+
+ test_text =
+ " inline double pow(double d,int expon) {\n"
+ " return pow(d, (double)expon);\n"
+ " }\n";
+};
+
+
+/*
* Keep HP-UX 11 from stomping on C++ math namespace
* with defines for fabsf.
*/
@@ -1087,7 +1206,25 @@ fix = {
/*
- * In inttypes.h on HPUX 11, the use of __CONCAT__ in the definition
+ * Prevent HP-UX 11 from defining __size_t and preventing size_t from
+ * being defined by having it define _hpux_size_t instead.
+ */
+fix = {
+ hackname = hpux11_size_t;
+ mach = "*-hp-hpux11*";
+ select = "__size_t";
+
+ c_fix = format;
+ c_fix_arg = "_hpux_size_t";
+
+ test_text =
+ "#define __size_t size_t\n"
+ " extern int getpwuid_r( char *, __size_t, struct passwd **);\n";
+};
+
+
+/*
+ * In inttypes.h on HPUX 11, the use of __CONCAT__ in the definition
* of UINT32_C has undefined behavior according to ISO/ANSI:
* the arguments to __CONCAT__ are not macro expanded before the
* concatination happens so the trailing ')' in the first argument
@@ -1095,7 +1232,7 @@ fix = {
* invalid pp token. The behavior of invalid pp tokens is undefined.
* GCC does not handle these invalid tokens the way the HP compiler does.
* This problem will potentially occur anytime macros are used in the
- * arguments to __CONCAT__. A general solution to this problem would be to
+ * arguments to __CONCAT__. A general solution to this problem would be to
* insert another layer of macro between __CONCAT__ and its use
* in UINT32_C. An example of this solution can be found in the C standard.
* A more specific solution, the one used here, is to change the UINT32_C
@@ -1115,6 +1252,22 @@ fix = {
/*
+ * Fix hpux 11.00 broken vsnprintf declaration
+ */
+fix = {
+ hackname = hpux11_vsnprintf;
+ files = stdio.h;
+ select = '(extern int vsnprintf\(char \*, _[hpux]*_size_t, '
+ 'const char \*,) __va__list\);';
+ c_fix = format;
+ c_fix_arg = "%1 __va_list);";
+
+ test_text = 'extern int vsnprintf(char *, _hpux_size_t, const char *,'
+ ' __va__list);';
+};
+
+
+/*
* get rid of bogus inline definitions in HP-UX 8.0
*/
fix = {
@@ -1132,43 +1285,54 @@ fix = {
/*
- * Fix return type of abort and free
+ * HPUX 10.x sys/param.h defines MAXINT which clashes with values.h
*/
fix = {
- hackname = int_abort_free_and_exit;
- files = stdlib.h;
- select = "int[ \t]+(abort|free|exit)[ \t]*\\(";
+ hackname = hpux_maxint;
+ files = sys/param.h;
+ files = values.h;
+ select = "^#[ \t]*define[ \t]+MAXINT[ \t]";
+ bypass = "^#[ \t]*ifndef[ \t]+MAXINT";
+ test =
+ "-n \"`egrep '#[ \t]*define[ \t]+MAXINT[ \t]' sys/param.h`\"";
c_fix = format;
- c_fix_arg = "void\t%1(";
+ c_fix_arg = "#ifndef MAXINT\n%0\n#endif";
+ c_fix_arg = "^#[ \t]*define[ \t]+MAXINT[ \t].*";
- test_text = "extern int abort(int);\n"
- "extern int free(void*);\n"
- "extern int exit(void*);";
+ test_text = '#define MAXINT 0x7FFFFFFF';
};
/*
- * On Interactive Unix 2.2, certain traditional Unix definitions
- * (notably getc and putc in stdio.h) are omitted if __STDC__ is
- * defined, not just if _POSIX_SOURCE is defined. This makes it
- * impossible to compile any nontrivial program except with -posix.
+ * Fix hpux10.20 <sys/time.h> to avoid invalid forward decl
*/
fix = {
- hackname = isc_omits_with_stdc;
+ hackname = hpux_systime;
+ files = sys/time.h;
+ select = "^extern struct sigevent;";
- files = "stdio.h";
- files = "math.h";
- files = "ctype.h";
- files = "sys/limits.h";
- files = "sys/fcntl.h";
- files = "sys/dirent.h";
+ c_fix = format;
+ c_fix_arg = "struct sigevent;";
+
+ test_text = 'extern struct sigevent;';
+};
+
+
+/*
+ * Fix return type of abort and free
+ */
+fix = {
+ hackname = int_abort_free_and_exit;
+ files = stdlib.h;
+ select = "int[ \t]+(abort|free|exit)[ \t]*\\(";
- select = '!defined\(__STDC__\) && !defined\(_POSIX_SOURCE\)';
c_fix = format;
- c_fix_arg = '!defined(_POSIX_SOURCE)';
- test_text = "#if !defined(__STDC__) && !defined(_POSIX_SOURCE) /* ? ! */"
- "\nint foo;\n#endif";
+ c_fix_arg = "void\t%1(";
+
+ test_text = "extern int abort(int);\n"
+ "extern int free(void*);\n"
+ "extern int exit(void*);";
};
@@ -1215,41 +1379,6 @@ fix = {
/*
- * HPUX 10.x sys/param.h defines MAXINT which clashes with values.h
- */
-fix = {
- hackname = hpux_maxint;
- files = sys/param.h;
- files = values.h;
- select = "^#[ \t]*define[ \t]+MAXINT[ \t]";
- bypass = "^#[ \t]*ifndef[ \t]+MAXINT";
- test =
- "-n \"`egrep '#[ \t]*define[ \t]+MAXINT[ \t]' sys/param.h`\"";
-
- c_fix = format;
- c_fix_arg = "#ifndef MAXINT\n%0\n#endif";
- c_fix_arg = "^#[ \t]*define[ \t]+MAXINT[ \t].*";
-
- test_text = '#define MAXINT 0x7FFFFFFF';
-};
-
-
-/*
- * Fix hpux10.20 <sys/time.h> to avoid invalid forward decl
- */
-fix = {
- hackname = hpux_systime;
- files = sys/time.h;
- select = "^extern struct sigevent;";
-
- c_fix = format;
- c_fix_arg = "struct sigevent;";
-
- test_text = 'extern struct sigevent;';
-};
-
-
-/*
* Check for missing ';' in struct
*/
fix = {
@@ -1287,12 +1416,28 @@ fix = {
* Non-traditional "const" declaration in Irix's limits.h.
*/
fix = {
- hackname = irix_limits_const;
- files = limits.h;
- select = "^extern const ";
- c_fix = format;
- c_fix_arg = "extern __const ";
- test_text = "extern const char limit; /* test\n\tlimits */";
+ hackname = irix_limits_const;
+ files = fixinc-test-limits.h, limits.h;
+ select = "^extern const ";
+ c_fix = format;
+ c_fix_arg = "extern __const ";
+ test_text = "extern const char limit; /* test limits */";
+};
+
+
+/*
+ * IRIX 5.x's stdio.h declares some functions that take a va_list as
+ * taking char *. However, GCC uses void * for va_list, so
+ * calling vfprintf with a va_list fails in C++. */
+fix = {
+ hackname = irix_stdio_va_list;
+ files = stdio.h;
+
+ select = '(printf\(.*), /\* va_list \*/ char \*';
+ c_fix = format;
+ c_fix_arg = "%1, __gnuc_va_list";
+ test_text =
+ "extern int printf( const char *, /* va_list */ char * );";
};
@@ -1310,6 +1455,30 @@ fix = {
/*
+ * On Interactive Unix 2.2, certain traditional Unix definitions
+ * (notably getc and putc in stdio.h) are omitted if __STDC__ is
+ * defined, not just if _POSIX_SOURCE is defined. This makes it
+ * impossible to compile any nontrivial program except with -posix.
+ */
+fix = {
+ hackname = isc_omits_with_stdc;
+
+ files = "stdio.h";
+ files = "math.h";
+ files = "ctype.h";
+ files = "sys/limits.h";
+ files = "sys/fcntl.h";
+ files = "sys/dirent.h";
+
+ select = '!defined\(__STDC__\) && !defined\(_POSIX_SOURCE\)';
+ c_fix = format;
+ c_fix_arg = '!defined(_POSIX_SOURCE)';
+ test_text = "#if !defined(__STDC__) && !defined(_POSIX_SOURCE) /* ? ! */"
+ "\nint foo;\n#endif";
+};
+
+
+/*
* These files in Sun OS 4.x and ARM/RISCiX and BSD4.3
* use / * * / to concatenate tokens.
*/
@@ -1488,7 +1657,7 @@ fix = {
/*
* Fix BSD machine/ansi.h to use __builtin_va_list to define _BSD_VA_LIST_.
- *
+ *
* On NetBSD, machine is a symbolic link to an architecture specific
* directory name, so we can't match a specific file name here.
*/
@@ -1603,6 +1772,19 @@ fix = {
/*
+ * nested comment
+ */
+fix = {
+ hackname = nested_auth_des;
+ files = rpc/rpc.h;
+ select = '(/\*.*rpc/auth_des\.h>.*)/\*';
+ c_fix = format;
+ c_fix_arg = "%1*/ /*";
+ test_text = "/*#include <rpc/auth_des.h> /* skip this */";
+};
+
+
+/*
* Fix nested comments in Motorola's <limits.h> and <sys/limits.h>
*/
fix = {
@@ -1638,19 +1820,6 @@ fix = {
};
/*
- * nested comment
- */
-fix = {
- hackname = nested_auth_des;
- files = rpc/rpc.h;
- select = '(/\*.*rpc/auth_des\.h>.*)/\*';
- c_fix = format;
- c_fix_arg = "%1*/ /*";
- test_text = "/*#include <rpc/auth_des.h> /* skip this */";
-};
-
-
-/*
* fix bogus recursive stdlib.h in NEWS-OS 4.0C
*/
fix = {
@@ -1820,7 +1989,7 @@ fix = {
/*
- * function class(double x) conflicts with C++ keyword on rs/6000
+ * function class(double x) conflicts with C++ keyword on rs/6000
*/
fix = {
hackname = rs6000_double;
@@ -1849,7 +2018,7 @@ fix = {
/*
- * parameters conflict with C++ new on rs/6000
+ * parameters conflict with C++ new on rs/6000
*/
fix = {
hackname = rs6000_param;
@@ -1865,7 +2034,7 @@ fix = {
/*
- * The static functions lstat() and fchmod() in <sys/stat.h>
+ * The static functions lstat() and fchmod() in <sys/stat.h>
* cause G++ grief since they're not wrapped in "if __cplusplus".
*
* On SCO OpenServer 5.0.0 through (at least) 5.0.5 <sys/stat.h> contains
@@ -1904,22 +2073,6 @@ fix = {
/*
- * "!__STDC__" is "!defined( __STRICT_ANSI__ )"
- */
-fix = {
- hackname = sco_strict_ansi;
- mach = "i?86-*-sco3.2*";
- select = "^[ \t]*#[ \t]*if.*!__STDC__";
-
- c_fix = format;
- c_fix_arg = "%1defined(__STRICT_ANSI__)%2";
- c_fix_arg = "^([ \t]*#[ \t]*if[ \t].*!)__STDC__(.*)";
-
- test_text = "#if !__STDC__ /* not standard C */\nint foo;\n#endif";
-};
-
-
-/*
* Fix prototype declaration of utime in sys/times.h.
* In 3.2v4.0 the const is missing.
*/
@@ -1937,6 +2090,34 @@ fix = {
/*
+ * Sun Solaris defines PTHREAD_MUTEX_INITIALIZER with a trailing
+ * "0" for the last field of the pthread_mutex_t structure, which is
+ * of type upad64_t, which itself is typedef'd to int64_t, but with
+ * __STDC__ defined (e.g. by -ansi) it is a union. So change the
+ * initializer to "{0}" instead
+ */
+fix = {
+ hackname = solaris_mutex_init;
+ select = '@\(#\)pthread.h' "[ \t]+1.[0-9]+[ \t]+[0-9/]+ SMI";
+ files = pthread.h;
+ c_fix = format;
+ c_fix_arg = "#if __STDC__ - 0 == 0 && !defined(_NO_LONGLONG)\n"
+ "%0\n"
+ "#else\n"
+ "%1, {0}}%3\n"
+ "#endif";
+ c_fix_arg = "(^#define[ \t]+PTHREAD_(MUTEX|COND)_INITIALIZER[ \t]+{.*)"
+ ",[ \t]*0}" "(|[ \t].*)$";
+ test_text =
+ '#ident "@(#)pthread.h 1.26 98/04/12 SMI"'"\n"
+ "#define PTHREAD_MUTEX_INITIALIZER\t{{{0},0}, {{{0}}}, 0}\n"
+ "#define PTHREAD_COND_INITIALIZER\t{{{0}, 0}, 0}\t/* DEFAULTCV */\n"
+ "#define PTHREAD_RWLOCK_INITIALIZER\t"
+ "{0, 0, 0, {0, 0, 0}, {0, 0}, {0, 0}}";
+};
+
+
+/*
* Sony NEWSOS 5.0 does not support the complete ANSI C standard.
*/
#ifdef SONY
@@ -2028,7 +2209,8 @@ fix = {
/*
* Use __gnuc_va_list in arg types in place of va_list.
- * On 386BSD use __gnuc_va_list instead of _VA_LIST_. We're hoping the
+ * On 386BSD use __gnuc_va_list instead of _VA_LIST_. On Tru64 UNIX V5.1A
+ * use __gnuc_va_list instead of __VA_LIST__. We're hoping the
* trailing parentheses and semicolon save all other systems from this.
* Define __not_va_list__ (something harmless and unused)
* instead of va_list.
@@ -2037,6 +2219,7 @@ fix = {
sed = "s@ va_list @ __gnuc_va_list @\n"
"s@ va_list)@ __gnuc_va_list)@\n"
"s@ _VA_LIST_));@ __gnuc_va_list));@\n"
+ "s@ __VA_LIST__));@ __gnuc_va_list));@\n"
"s@ va_list@ __not_va_list__@\n"
"s@\\*va_list@*__not_va_list__@\n"
"s@ __va_list)@ __gnuc_va_list)@\n"
@@ -2051,18 +2234,81 @@ fix = {
/*
- * Check for strict ansi compliance
+ * "!__STDC__" or "__STDC__==0" or "__STDC__!=1" or "__STDC__-0==0"
+ * is "!defined( __STRICT_ANSI__ )"
*/
-#ifdef STRICT_ANSI
fix = {
- hackname = strict_ansi;
- select = "__STDC__[ \t]*[=!]=[ \t]*[01]";
- sed = "s/__STDC__[ \t]*==[ \t]*0/!defined (__STRICT_ANSI__)/g";
- sed = "s/__STDC__[ \t]*!=[ \t]*0/defined (__STRICT_ANSI__)/g";
- sed = "s/__STDC__[ \t]*==[ \t]*1/defined (__STRICT_ANSI__)/g";
- sed = "s/__STDC__[ \t]*!=[ \t]*1/!defined (__STRICT_ANSI__)/g";
+ hackname = strict_ansi_not;
+ select = "^([ \t]*#[ \t]*if.*)"
+ "(!__STDC__"
+ "|__STDC__[ \t]*==[ \t]*0"
+ "|__STDC__[ \t]*!=[ \t]*1"
+ "|__STDC__[ \t]*-[ \t]*0[ \t]*==[ \t]*0)";
+ c_test = stdc_0_in_system_headers;
+
+ c_fix = format;
+ c_fix_arg = "%1 !defined(__STRICT_ANSI__)";
+
+ test_text = "#if !__STDC__ \n"
+ "#if __STDC__ == 0\n"
+ "#if __STDC__ != 1\n"
+ "#if __STDC__ - 0 == 0"
+ "/* not std C */\nint foo;\n"
+ "\n#end-end-end-end-if :-)";
+};
+
+/*
+ * "__STDC__-0==0"
+ * is "!defined( __STRICT_ANSI__ )" on continued #if-s
+ */
+fix = {
+ hackname = strict_ansi_not_ctd;
+ files = math.h, limits.h, stdio.h, signal.h,
+ stdlib.h, sys/signal.h, time.h;
+ /*
+ * Starting at the beginning of a line, skip white space and
+ * a leading "(" or "&&" or "||". One of those must be found.
+ * Then, zero, one or more copies of a "defined(_FOO_BAR_) &&"
+ * expression. If these are nested, then they must accumulate
+ * because we won't match any closing parentheses. Finally,
+ * after skipping over all that, we must then match our suspect
+ * phrase: "__STDC__-0==0" with or without white space.
+ */
+ select = "^([ \t]*" '(\(|&&|\|\|)'
+ "([ \t(]*!*[ \t]*defined\\([a-zA-Z_0-9]+\\)[ \t]*[|&][|&])*"
+ "[ \t(]*)"
+ "(__STDC__[ \t]*(|-[ \t]*0[ \t]*)==[ \t]*0)";
+ c_test = stdc_0_in_system_headers;
+
+ c_fix = format;
+ c_fix_arg = "%1 !defined(__STRICT_ANSI__)";
+
+ test_text = "#if 1 && \\\\\n"
+ "&& defined(mumbling) |& (__STDC__ - 0 == 0) \\\\\n"
+ "( __STDC__ == 0 && !defined(_XOPEN_SOURCE) \\\\\n"
+ "|| __STDC__ - 0 == 0 ) /* not std C */\n"
+ "int foo;\n#endif";
+};
+
+
+/*
+ * "__STDC__!=0" or "__STDC__==1" or "__STDC__-0==1"
+ * is "defined( __STRICT_ANSI__ )"
+ */
+fix = {
+ hackname = strict_ansi_only;
+ select = "^([ \t]*#[ \t]*if.*)"
+ "(__STDC__[ \t]*!=[ \t]*0"
+ "|__STDC__[ \t]*==[ \t]*1"
+ "|__STDC__[ \t]*-[ \t]*0[ \t]*==[ \t]*1"
+ "|__STDC__[ \t]*-[ \t]*0[ \t]*!=[ \t]*0)";
+ c_test = stdc_0_in_system_headers;
+
+ c_fix = format;
+ c_fix_arg = "%1 defined(__STRICT_ANSI__)";
+
+ test_text = "#if __STDC__ == 1 /* is std C\n */\nint foo;\n#endif";
};
-#endif
/*
@@ -2566,7 +2812,7 @@ fix = {
#endif
-/*
+/*
* Like svr4_mach_defines, but with newfangled syntax.
* Source lines are of #define __i386 #machine(i386). Delete them.
*/
@@ -2581,27 +2827,6 @@ fix = {
/*
- * Fix these files to use the same types that we think they should.
- */
-fix = {
- hackname = gnu_types;
- files = "sys/types.h";
- files = "stdlib.h";
- files = "sys/stdtypes.h";
- files = "stddef.h";
- files = "memory.h";
- files = "unistd.h";
- bypass = '_GCC_(PTRDIFF|SIZE|WCHAR)_T';
- select = "^[ \t]*typedef[ \t]+.*[ \t](ptrdiff|size|wchar)_t;";
- c_fix = gnu_type;
-
- test_text = "typedef long int ptrdiff_t; /* long int */\n"
- "typedef uint_t size_t; /* uint_t */\n"
- "typedef ushort_t wchar_t; /* ushort_t */";
-};
-
-
-/*
* Fix return value of mem{ccpy,chr,cpy,set} and str{len,spn,cspn}
* in string.h on sysV68
* Correct the return type for strlen in string.h on Lynx.
@@ -2683,6 +2908,21 @@ fix = {
/*
+ * function parameter to atexit is missing "void" on VAX Ultrix 4.3.
+ */
+fix = {
+ hackname = ultrix_atexit_param;
+ files = stdlib.h;
+ select = 'atexit\(.*\(\)';
+
+ c_fix = format;
+ c_fix_arg = "atexit( void (*__func)( void )";
+
+ test_text = "int atexit( void (*__func)() );\n";
+};
+
+
+/*
* parameter to atof not const on DECstation Ultrix V4.0 and NEWS-OS 4.2R.
*/
fix = {
@@ -2883,6 +3123,23 @@ fix = {
test_text = "#define NULL 0UL\r\n#define NULL\t((void*)0)\n";
};
+/*
+ * On Cray Unicos/Mk some standard headers use the C99 keyword "restrict"
+ * which must be replaced by __restrict__ for GCC.
+ */
+fix = {
+ hackname = unicosmk_restrict;
+ files = stdio.h;
+ files = stdlib.h;
+ files = wchar.h;
+ mach = "*-*-unicosmk*";
+ select = "(\\*[ \t]*)restrict([ \t]+)";
+
+ c_fix = format;
+ c_fix_arg = "%1__restrict__%2";
+
+ test_text = "void f (char * restrict x);";
+};
/*
* If arpa/inet.h prototypes are incompatible with the ones we just
@@ -2894,7 +3151,7 @@ fix = {
hackname = uw7_byteorder_fix;
files = arpa/inet.h;
select = "in_port_t";
- test = "-f $DESTDIR/sys/byteorder.h";
+ test = "-f sys/byteorder.h";
#ifndef SVR5
mach = "*-*-sysv4*";
mach = "i?86-*-sysv5*";
@@ -2906,12 +3163,12 @@ fix = {
c_fix = format;
c_fix_arg = "";
- c_fix_arg = "^extern.*(htons|ntohs).*\\(in_port_t\\).*\n";
+ c_fix_arg = "^extern.*[ \t](htons|ntohs).*\\(in_port_t\\).*;";
- test_text = "extern htons(in_port_t);"
+ test_text = "extern in_port_t\thtons __P((in_port_t));\n"
+ "extern in_port_t\tntohs __P((in_port_t));"
"`[ ! -d $DESTDIR/sys ] && mkdir $DESTDIR/sys\n"
- "echo '/* DUMMY */' >> sys/byteorder.h\n"
- "touch $DESTDIR/sys/byteorder.h`";
+ "echo '/* DUMMY */' >> sys/byteorder.h`";
};
diff --git a/gcc/fixinc/mkfixinc.sh b/gcc/fixinc/mkfixinc.sh
index f353d5e8be3..6a74bba5dc9 100755
--- a/gcc/fixinc/mkfixinc.sh
+++ b/gcc/fixinc/mkfixinc.sh
@@ -14,7 +14,7 @@ echo constructing ${target} for $machine to run on $build
fixincludes="${machine}"
# Choose one or two-process fix methodology. Systems that cannot handle
-# bi-directional pipes must use the twoprocess method.
+# bi-directional pipes must use the two process method.
#
case $build in
i?86-*-msdosdjgpp* | \
@@ -35,57 +35,66 @@ esac
# Check for special fix rules for particular targets
case $machine in
- *-*-sysv4* | \
- i?86-*-sysv5* | \
- i?86-*-udk*)
- fixincludes=fixinc.svr4
- ;;
-
- i?86-*-interix* | \
- alpha-*-interix*)
- fixincludes=fixinc.interix
- ;;
-
- i?86-*-openbsd*)
- fixincludes=fixinc.wrap
- ;;
-
- alpha*-*-winnt* | \
- i?86-*-winnt3*)
- fixincludes=fixinc.winnt
- ;;
-
- i?86-sequent-ptx* | i?86-sequent-sysv[34]*)
- fixincludes=fixinc.ptx
- ;;
-
- alpha*-dec-vms* | \
- arm-semi-aout | armel-semi-aout | \
- arm-semi-aof | armel-semi-aof | \
- c*-convex-* | \
- hppa1.1-*-osf* | \
- hppa1.0-*-osf* | \
- hppa1.1-*-bsd* | \
- hppa1.0-*-bsd* | \
- hppa*-*-lites* | \
- i?86-moss-msdos* | i?86-*-moss* | \
- i?86-*-osf1* | \
- i?86-*-win32 | \
- i?86-*-pe | i?86-*-cygwin* | \
- i?86-*-mingw32* | \
- i?86-*-uwin* | \
- mips-sgi-irix5cross64 | \
- powerpc-*-eabiaix* | \
- powerpc-*-eabisim* | \
- powerpc-*-eabi* | \
- powerpc-*-rtems* | \
- powerpcle-*-eabisim* | \
- powerpcle-*-eabi* | \
- powerpcle-*-winnt* | \
- powerpcle-*-pe | powerpcle-*-cygwin* | \
- thumb-*-coff* | thumbel-*-coff* )
- fixincludes=
- ;;
+ i?86-*-sysv4.2uw2* )
+ ;;
+
+ *-*-sysv4* )
+ fixincludes=fixinc.svr4
+ ;;
+
+ i?86-*-interix* | \
+ alpha-*-interix*)
+ fixincludes=fixinc.interix
+ ;;
+
+ i?86-*-openbsd*)
+ fixincludes=fixinc.wrap
+ ;;
+
+ alpha*-*-winnt* | \
+ i?86-*-winnt3*)
+ fixincludes=fixinc.winnt
+ ;;
+
+ i?86-sequent-ptx* | i?86-sequent-sysv[34]*)
+ fixincludes=fixinc.ptx
+ ;;
+
+ alpha*-dec-vms* | \
+ arm-semi-aout | \
+ armel-semi-aout | \
+ arm-semi-aof | \
+ armel-semi-aof | \
+ c*-convex-* | \
+ hppa1.1-*-osf* | \
+ hppa1.0-*-osf* | \
+ hppa1.1-*-bsd* | \
+ hppa1.0-*-bsd* | \
+ hppa*-*-lites* | \
+ i?86-moss-msdos* | \
+ i?86-*-moss* | \
+ i?86-*-osf1* | \
+ i?86-*-win32 | \
+ i?86-*-pe | \
+ i?86-*-cygwin* | \
+ i?86-*-mingw32* | \
+ i?86-*-uwin* | \
+ mips-sgi-irix5cross64 | \
+ powerpc-*-eabiaix* | \
+ powerpc-*-eabisim* | \
+ powerpc-*-eabi* | \
+ powerpc-*-rtems* | \
+ powerpcle-*-eabisim* | \
+ powerpcle-*-eabi* | \
+ powerpcle-*-winnt* | \
+ powerpcle-*-pe | \
+ powerpcle-*-cygwin* | \
+ thumb-*-coff* | \
+ thumbel-*-coff* )
+ # Don't do any fixing.
+ #
+ fixincludes=
+ ;;
esac
# IF there is no include fixing,
diff --git a/gcc/fixinc/server.c b/gcc/fixinc/server.c
index e32576fca51..e58a09fa3ab 100644
--- a/gcc/fixinc/server.c
+++ b/gcc/fixinc/server.c
@@ -2,7 +2,7 @@
/*
* server.c Set up and handle communications with a server process.
*
- * Server Handling copyright 1992-1999 The Free Software Foundation
+ * Server Handling copyright 1992-1999, 2001 The Free Software Foundation
*
* Server Handling is free software.
* You may redistribute it and/or modify it under the terms of the
@@ -47,7 +47,7 @@
*/
#include "auto-host.h"
-#include "gansidecl.h"
+#include "ansidecl.h"
#include "system.h"
#include <signal.h>
@@ -57,7 +57,7 @@
# define volatile
#endif
-STATIC volatile t_bool read_pipe_timeout;
+STATIC volatile enum t_bool read_pipe_timeout;
STATIC pid_t server_master_pid = NOPROCESS;
tSCC* def_args[] =
@@ -93,10 +93,7 @@ load_data (fp)
t_bool got_done = BOOL_FALSE;
text_size = sizeof (z_line) * 2;
- pz_scan = pz_text = malloc (text_size);
-
- if (pz_text == (char *) NULL)
- return (char *) NULL;
+ pz_scan = pz_text = xmalloc (text_size);
for (;;)
{
@@ -120,18 +117,9 @@ load_data (fp)
if (text_size - used_ct < sizeof (z_line))
{
size_t off = (size_t) (pz_scan - pz_text);
- void *p;
text_size += 4096;
- p = realloc ((void *) pz_text, text_size);
- if (p == (void *) NULL)
- {
- fprintf (stderr, "Failed to get 0x%08lX bytes\n",
- (long) text_size);
- free ((void *) pz_text);
- return (char *) NULL;
- }
- pz_text = (char *) p;
+ pz_text = xrealloc ((void *) pz_text, text_size);
pz_scan = pz_text + off;
}
}
@@ -146,7 +134,7 @@ load_data (fp)
while ((pz_scan > pz_text) && ISSPACE (pz_scan[-1]))
pz_scan--;
*pz_scan = NUL;
- return realloc ((void *) pz_text, strlen (pz_text) + 1);
+ return xrealloc ((void *) pz_text, strlen (pz_text) + 1);
}
@@ -284,11 +272,8 @@ run_shell (pz_cmd)
/* IF it is still not running, THEN return the nil string. */
if (server_id <= 0)
{
- char *pz = (char *) malloc (1);
fprintf (stderr, zNoServer, pz_cmd);
- if (pz != (char *) NULL)
- *pz = '\0';
- return pz;
+ return xcalloc (1, 1);
}
/* Make sure the process will pay attention to us, send the
@@ -302,11 +287,8 @@ run_shell (pz_cmd)
THEN return an empty string. */
if (server_id == NULLPROCESS)
{
- char *pz = (char *) malloc (1);
fprintf (stderr, zNoServer, pz_cmd);
- if (pz != (char *) NULL)
- *pz = '\0';
- return pz;
+ return xcalloc (1, 1);
}
/* Now try to read back all the data. If we fail due to either a
@@ -326,9 +308,7 @@ run_shell (pz_cmd)
fprintf (stderr, "CLOSING SHELL SERVER - command failure:\n\t%s\n",
pz_cmd);
- pz = (char *) malloc (1);
- if (pz != (char *) NULL)
- *pz = '\0';
+ pz = xcalloc (1, 1);
}
#ifdef DEBUG
fprintf( stderr, "run_shell command success: %s\n", pz );
diff --git a/gcc/fixinc/tests/base/arpa/inet.h b/gcc/fixinc/tests/base/arpa/inet.h
index 90c240f106d..acd8ed54577 100644
--- a/gcc/fixinc/tests/base/arpa/inet.h
+++ b/gcc/fixinc/tests/base/arpa/inet.h
@@ -10,4 +10,6 @@
#if defined( UW7_BYTEORDER_FIX_CHECK )
+
+
#endif /* UW7_BYTEORDER_FIX_CHECK */
diff --git a/gcc/fixinc/tests/base/assert.h b/gcc/fixinc/tests/base/assert.h
index 490496ffbd7..45716a3b303 100644
--- a/gcc/fixinc/tests/base/assert.h
+++ b/gcc/fixinc/tests/base/assert.h
@@ -19,6 +19,11 @@
#include <stdio.h>
+#if defined( ALPHA___ASSERT_CHECK )
+extern void __assert(const char *, const char *, int);
+#endif /* ALPHA___ASSERT_CHECK */
+
+
#if defined( BROKEN_ASSERT_STDIO_CHECK )
extern FILE* stderr;
#endif /* BROKEN_ASSERT_STDIO_CHECK */
diff --git a/gcc/fixinc/tests/base/curses.h b/gcc/fixinc/tests/base/curses.h
index 676718020ea..ba2db2448a0 100644
--- a/gcc/fixinc/tests/base/curses.h
+++ b/gcc/fixinc/tests/base/curses.h
@@ -19,8 +19,9 @@
#if defined( AVOID_BOOL_TYPE_CHECK )
#ifndef __cplusplus
-typedef unsigned int bool ; /* bool type */
-#endif
+typedef unsigned int bool ;
+#endif /* bool
+ type */
#endif /* AVOID_BOOL_TYPE_CHECK */
diff --git a/gcc/fixinc/tests/base/fixinc-test-limits.h b/gcc/fixinc/tests/base/fixinc-test-limits.h
new file mode 100644
index 00000000000..0422d0901a9
--- /dev/null
+++ b/gcc/fixinc/tests/base/fixinc-test-limits.h
@@ -0,0 +1,19 @@
+/* DO NOT EDIT THIS FILE.
+
+ It has been auto-edited by fixincludes from:
+
+ "fixinc/tests/inc/fixinc-test-limits.h"
+
+ This had to be done to correct non-standard usages in the
+ original, manufacturer supplied header file. */
+
+
+
+#if defined( HPUX10_CPP_POW_INLINE_CHECK )
+
+#endif /* HPUX10_CPP_POW_INLINE_CHECK */
+
+
+#if defined( IRIX_LIMITS_CONST_CHECK )
+extern __const char limit; /* test limits */
+#endif /* IRIX_LIMITS_CONST_CHECK */
diff --git a/gcc/fixinc/tests/base/math.h b/gcc/fixinc/tests/base/math.h
index 93722c97350..8cd8c224da4 100644
--- a/gcc/fixinc/tests/base/math.h
+++ b/gcc/fixinc/tests/base/math.h
@@ -35,6 +35,11 @@ extern double floor(), ceil(), fmod(), fabs _PARAMS((double));
#endif /* FIX_HEADER_BREAKAGE_CHECK */
+#if defined( HPUX11_CPP_POW_INLINE_CHECK )
+
+#endif /* HPUX11_CPP_POW_INLINE_CHECK */
+
+
#if defined( HPUX11_FABSF_CHECK )
#ifdef _PA_RISC
#ifndef __cplusplus
@@ -99,6 +104,16 @@ extern int class();
#endif /* RS6000_DOUBLE_CHECK */
+#if defined( STRICT_ANSI_NOT_CTD_CHECK )
+#if 1 && \
+&& defined(mumbling) |& ( !defined(__STRICT_ANSI__)) \
+( !defined(__STRICT_ANSI__) && !defined(_XOPEN_SOURCE) \
+|| !defined(__STRICT_ANSI__) ) /* not std C */
+int foo;
+#endif
+#endif /* STRICT_ANSI_NOT_CTD_CHECK */
+
+
#if defined( SUNOS_MATHERR_DECL_CHECK )
extern int matherr();
#endif /* SUNOS_MATHERR_DECL_CHECK */
diff --git a/gcc/fixinc/tests/base/pthread.h b/gcc/fixinc/tests/base/pthread.h
index ccd662a34e6..5f7c724e758 100644
--- a/gcc/fixinc/tests/base/pthread.h
+++ b/gcc/fixinc/tests/base/pthread.h
@@ -18,3 +18,19 @@
#if defined( PTHREAD_PAGE_SIZE_CHECK )
extern int __page_size;
#endif /* PTHREAD_PAGE_SIZE_CHECK */
+
+
+#if defined( SOLARIS_MUTEX_INIT_CHECK )
+#ident "@(#)pthread.h 1.26 98/04/12 SMI"
+#if __STDC__ - 0 == 0 && !defined(_NO_LONGLONG)
+#define PTHREAD_MUTEX_INITIALIZER {{{0},0}, {{{0}}}, 0}
+#else
+#define PTHREAD_MUTEX_INITIALIZER {{{0},0}, {{{0}}}, {0}}
+#endif
+#if __STDC__ - 0 == 0 && !defined(_NO_LONGLONG)
+#define PTHREAD_COND_INITIALIZER {{{0}, 0}, 0} /* DEFAULTCV */
+#else
+#define PTHREAD_COND_INITIALIZER {{{0}, 0}, {0}} /* DEFAULTCV */
+#endif
+#define PTHREAD_RWLOCK_INITIALIZER {0, 0, 0, {0, 0, 0}, {0, 0}, {0, 0}}
+#endif /* SOLARIS_MUTEX_INIT_CHECK */
diff --git a/gcc/fixinc/tests/base/stdio.h b/gcc/fixinc/tests/base/stdio.h
index c2e82a134fe..00d3c836ff4 100644
--- a/gcc/fixinc/tests/base/stdio.h
+++ b/gcc/fixinc/tests/base/stdio.h
@@ -19,6 +19,16 @@ extern int getopt(int, char *const[], const char *);
#endif /* ALPHA_GETOPT_CHECK */
+#if defined( HPUX11_VSNPRINTF_CHECK )
+extern int vsnprintf(char *, _hpux_size_t, const char *, __gnuc_va_list);
+#endif /* HPUX11_VSNPRINTF_CHECK */
+
+
+#if defined( IRIX_STDIO_DUMMY_VA_LIST_CHECK )
+extern int printf( const char *, __gnuc_va_list );
+#endif /* IRIX_STDIO_DUMMY_VA_LIST_CHECK */
+
+
#if defined( ISC_OMITS_WITH_STDC_CHECK )
#if !defined(_POSIX_SOURCE) /* ? ! */
int foo;
@@ -65,4 +75,9 @@ extern char *tempnam( const char *, const char *);
#endif /* ULTRIX_CONST2_CHECK */
+
+#if defined( UNICOSMK_RESTRICT_CHECK )
+void f (char * __restrict__ x);
+#endif /* UNICOSMK_RESTRICT_CHECK */
+
#endif /* FIXINC_STDIO_STDARG_H_CHECK */
diff --git a/gcc/fixinc/tests/base/stdlib.h b/gcc/fixinc/tests/base/stdlib.h
index 1f58af4cb37..9e43d13270f 100644
--- a/gcc/fixinc/tests/base/stdlib.h
+++ b/gcc/fixinc/tests/base/stdlib.h
@@ -47,3 +47,9 @@ extern void * realloc(void*,size_t);
extern void * bsearch(void*,size_t,size_t);
#endif /* SYSZ_STDLIB_FOR_SUN_CHECK */
+
+
+#if defined( ULTRIX_ATEXIT_PARAM_CHECK )
+int atexit( void (*__func)( void ) );
+
+#endif /* ULTRIX_ATEXIT_PARAM_CHECK */
diff --git a/gcc/fixinc/tests/base/machine/ansi.h b/gcc/fixinc/tests/base/sys/cdefs.h
index cf9f6d569e7..0b345a48ee4 100644
--- a/gcc/fixinc/tests/base/machine/ansi.h
+++ b/gcc/fixinc/tests/base/sys/cdefs.h
@@ -2,13 +2,13 @@
It has been auto-edited by fixincludes from:
- "fixinc/tests/inc/machine/ansi.h"
+ "fixinc/tests/inc/sys/cdefs.h"
This had to be done to correct non-standard usages in the
original, manufacturer supplied header file. */
-#if defined( MACHINE_ANSI_H_VA_LIST_CHECK )
- # define _BSD_VA_LIST_ __builtin_va_list
-#endif /* MACHINE_ANSI_H_VA_LIST_CHECK */
+#if defined( FREEBSD_GCC3_BREAKAGE_CHECK )
+#if __GNUC__ == 2 && __GNUC_MINOR__ >= 7 || __GNUC__ >= 3
+#endif /* FREEBSD_GCC3_BREAKAGE_CHECK */
diff --git a/gcc/fixinc/tests/base/sys/types.h b/gcc/fixinc/tests/base/sys/types.h
index daf5c659fe0..683b5e93ecd 100644
--- a/gcc/fixinc/tests/base/sys/types.h
+++ b/gcc/fixinc/tests/base/sys/types.h
@@ -20,9 +20,11 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t;
typedef __SIZE_TYPE__ size_t;
#endif
/* uint_t */
+#ifndef __cplusplus
#if !defined(_GCC_WCHAR_T) && ! defined(__cplusplus)
#define _GCC_WCHAR_T
typedef __WCHAR_TYPE__ wchar_t;
#endif
- /* ushort_t */
+
+#endif /* ushort_t */
#endif /* GNU_TYPES_CHECK */
diff --git a/gcc/fixinc/tests/base/testing.h b/gcc/fixinc/tests/base/testing.h
index 687531e5ce7..d58d61117dd 100644
--- a/gcc/fixinc/tests/base/testing.h
+++ b/gcc/fixinc/tests/base/testing.h
@@ -9,8 +9,17 @@
+#if defined( AVOID_WCHAR_T_TYPE_CHECK )
+#ifndef __cplusplus
+typedef unsigned short wchar_t ;
+#endif /* wchar_t
+ type */
+#endif /* AVOID_WCHAR_T_TYPE_CHECK */
+
+
#if defined( CTRL_QUOTES_DEF_CHECK )
-#define _CTRL(c) (c&037)
+#define BSD43_CTRL(n, x) ((n<<8)+x)
+
#endif /* CTRL_QUOTES_DEF_CHECK */
@@ -19,8 +28,25 @@
#endif /* CTRL_QUOTES_USE_CHECK */
+#if defined( DJGPP_WCHAR_H_CHECK )
+#include <stddef.h>
+#include <sys/djtypes.h>
+extern __DJ_wint_t x;
+
+#endif /* DJGPP_WCHAR_H_CHECK */
+
+
+#if defined( HPUX11_SIZE_T_CHECK )
+#define _hpux_size_t size_t
+ extern int getpwuid_r( char *, _hpux_size_t, struct passwd **);
+
+#endif /* HPUX11_SIZE_T_CHECK */
+
+
#if defined( IO_QUOTES_DEF_CHECK )
-#define XX_IO(x) (x<<8|256)
+#define BSD43__IOWR(n, x) ((n<<8)+x)
+#define _IOWN(x,y,t) (_IOC_IN|(((t)&_IOCPARM_MASK)<<16)|(x<<8)|y)
+#define _IO(x,y) (x<<8|y)
#endif /* IO_QUOTES_DEF_CHECK */
@@ -38,6 +64,11 @@ extern __ptr_t memcpy __P ((__ptr_t __dest, __const __ptr_t __src,
#endif /* LIBC1_IFDEFD_MEMX_CHECK */
+#if defined( MACHINE_ANSI_H_VA_LIST_CHECK )
+ # define _BSD_VA_LIST_ __builtin_va_list
+#endif /* MACHINE_ANSI_H_VA_LIST_CHECK */
+
+
#if defined( MACHINE_NAME_CHECK )
/* MACH_DIFF: */
#if defined( __i386__ ) || defined( sparc ) || defined( vax )
@@ -45,11 +76,23 @@ extern __ptr_t memcpy __P ((__ptr_t __dest, __const __ptr_t __src,
#endif /* MACHINE_NAME_CHECK */
-#if defined( SCO_STRICT_ANSI_CHECK )
-#if !defined(__STRICT_ANSI__) /* not standard C */
+#if defined( STRICT_ANSI_NOT_CHECK )
+#if !defined(__STRICT_ANSI__)
+#if !defined(__STRICT_ANSI__)
+#if !defined(__STRICT_ANSI__)
+#if !defined(__STRICT_ANSI__)/* not std C */
+int foo;
+
+#end-end-end-end-if :-)
+#endif /* STRICT_ANSI_NOT_CHECK */
+
+
+#if defined( STRICT_ANSI_ONLY_CHECK )
+#if defined(__STRICT_ANSI__) /* is std C
+ */
int foo;
#endif
-#endif /* SCO_STRICT_ANSI_CHECK */
+#endif /* STRICT_ANSI_ONLY_CHECK */
#if defined( SYSV68_STRING_CHECK )
diff --git a/gcc/fixinc/tests/base/types/vxTypesBase.h b/gcc/fixinc/tests/base/types/vxTypesBase.h
index 7d7a434c8f7..76a9338d970 100644
--- a/gcc/fixinc/tests/base/types/vxTypesBase.h
+++ b/gcc/fixinc/tests/base/types/vxTypesBase.h
@@ -19,10 +19,12 @@ typedef unsigned int size_t;
#define _GCC_PTRDIFF_T
typedef long ptrdiff_t;
#endif
+#ifndef __cplusplus
#ifndef _GCC_WCHAR_T
#define _GCC_WCHAR_T
typedef unsigned short wchar_t;
#endif
+#endif
#endif /* __GNUC_TYPEOF_FEATURE_BROKEN_USE_DEFAULT_UNTIL_FIXED__ */
#endif /* VXWORKS_GCC_PROBLEM_CHECK */
diff --git a/gcc/flags.h b/gcc/flags.h
index 99678ba5755..a9c72f2b617 100644
--- a/gcc/flags.h
+++ b/gcc/flags.h
@@ -447,11 +447,6 @@ extern int flag_pic;
extern int flag_exceptions;
-/* Nonzero means use the new model for exception handling. Replaces
- -DNEW_EH_MODEL as a compile option. */
-
-extern int flag_new_exceptions;
-
/* Nonzero means generate frame unwind info table when supported */
extern int flag_unwind_tables;
@@ -579,10 +574,6 @@ extern int flag_prefix_function_name;
extern int g_switch_value;
extern int g_switch_set;
-/* Value of the -finline-limit flag. */
-
-extern int inline_max_insns;
-
/* Values of the -falign-* flags: how much to align labels in code.
0 means `use default', 1 means `don't align'.
For each variable, there is an _log variant which is the power
@@ -622,4 +613,7 @@ extern int flag_eliminate_dwarf2_dups;
and to print them when we are done. */
extern int flag_detailed_statistics;
+/* Nonzero means enable synchronous exceptions for non-call instructions. */
+extern int flag_non_call_exceptions;
+
#endif /* GCC_FLAGS_H */
diff --git a/gcc/flow.c b/gcc/flow.c
index aff84451e8d..71a685e7b82 100644
--- a/gcc/flow.c
+++ b/gcc/flow.c
@@ -133,7 +133,6 @@ Boston, MA 02111-1307, USA. */
#include "except.h"
#include "toplev.h"
#include "recog.h"
-#include "insn-flags.h"
#include "expr.h"
#include "ssa.h"
@@ -199,7 +198,6 @@ struct basic_block_def entry_exit_blocks[2]
NULL, /* aux */
ENTRY_BLOCK, /* index */
0, /* loop_depth */
- -1, -1, /* eh_beg, eh_end */
0 /* count */
},
{
@@ -214,7 +212,6 @@ struct basic_block_def entry_exit_blocks[2]
NULL, /* aux */
EXIT_BLOCK, /* index */
0, /* loop_depth */
- -1, -1, /* eh_beg, eh_end */
0 /* count */
}
};
@@ -270,8 +267,14 @@ static rtx tail_recursion_label_list;
/* Holds information for tracking conditional register life information. */
struct reg_cond_life_info
{
- /* An EXPR_LIST of conditions under which a register is dead. */
+ /* A boolean expression of conditions under which a register is dead. */
rtx condition;
+ /* Conditions under which a register is dead at the basic block end. */
+ rtx orig_condition;
+
+ /* A boolean expression of conditions under which a register has been
+ stored into. */
+ rtx stores;
/* ??? Could store mask of bytes that are dead, so that we could finally
track lifetimes of multi-word registers accessed via subregs. */
@@ -352,16 +355,12 @@ static void clear_edges PARAMS ((void));
static void make_edges PARAMS ((rtx));
static void make_label_edge PARAMS ((sbitmap *, basic_block,
rtx, int));
-static void make_eh_edge PARAMS ((sbitmap *, eh_nesting_info *,
- basic_block, rtx, int));
+static void make_eh_edge PARAMS ((sbitmap *, basic_block, rtx));
static void mark_critical_edges PARAMS ((void));
-static void move_stray_eh_region_notes PARAMS ((void));
-static void record_active_eh_regions PARAMS ((rtx));
static void commit_one_edge_insertion PARAMS ((edge));
static void delete_unreachable_blocks PARAMS ((void));
-static void delete_eh_regions PARAMS ((void));
static int can_delete_note_p PARAMS ((rtx));
static void expunge_block PARAMS ((basic_block));
static int can_delete_label_p PARAMS ((rtx));
@@ -518,7 +517,6 @@ find_basic_blocks (f, nregs, file)
compute_bb_for_insn (max_uid);
/* Discover the edges of our cfg. */
- record_active_eh_regions (f);
make_edges (label_value_list);
/* Do very simple cleanup now, for the benefit of code that runs between
@@ -580,46 +578,45 @@ count_basic_blocks (f)
register rtx insn;
register RTX_CODE prev_code;
register int count = 0;
- int eh_region = 0;
- int call_had_abnormal_edge = 0;
+ int saw_abnormal_edge = 0;
prev_code = JUMP_INSN;
for (insn = f; insn; insn = NEXT_INSN (insn))
{
- register RTX_CODE code = GET_CODE (insn);
+ enum rtx_code code = GET_CODE (insn);
if (code == CODE_LABEL
|| (GET_RTX_CLASS (code) == 'i'
&& (prev_code == JUMP_INSN
|| prev_code == BARRIER
- || (prev_code == CALL_INSN && call_had_abnormal_edge))))
- count++;
+ || saw_abnormal_edge)))
+ {
+ saw_abnormal_edge = 0;
+ count++;
+ }
- /* Record whether this call created an edge. */
+ /* Record whether this insn created an edge. */
if (code == CALL_INSN)
{
- rtx note = find_reg_note (insn, REG_EH_REGION, NULL_RTX);
- int region = (note ? INTVAL (XEXP (note, 0)) : 1);
-
- call_had_abnormal_edge = 0;
-
- /* If there is an EH region or rethrow, we have an edge. */
- if ((eh_region && region > 0)
- || find_reg_note (insn, REG_EH_RETHROW, NULL_RTX))
- call_had_abnormal_edge = 1;
- else if (nonlocal_goto_handler_labels && region >= 0)
- /* If there is a nonlocal goto label and the specified
- region number isn't -1, we have an edge. (0 means
- no throw, but might have a nonlocal goto). */
- call_had_abnormal_edge = 1;
+ rtx note;
+
+ /* If there is a nonlocal goto label and the specified
+ region number isn't -1, we have an edge. */
+ if (nonlocal_goto_handler_labels
+ && ((note = find_reg_note (insn, REG_EH_REGION, NULL_RTX)) == 0
+ || INTVAL (XEXP (note, 0)) >= 0))
+ saw_abnormal_edge = 1;
+
+ else if (can_throw_internal (insn))
+ saw_abnormal_edge = 1;
}
+ else if (flag_non_call_exceptions
+ && code == INSN
+ && can_throw_internal (insn))
+ saw_abnormal_edge = 1;
if (code != NOTE)
prev_code = code;
- else if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_EH_REGION_BEG)
- ++eh_region;
- else if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_EH_REGION_END)
- --eh_region;
}
/* The rest of the compiler works a bit smoother when we don't have to
@@ -653,9 +650,6 @@ find_label_refs (f, lvl)
Make a special exception for labels followed by an ADDR*VEC,
as this would be a part of the tablejump setup code.
- Make a special exception for the eh_return_stub_label, which
- we know isn't part of any otherwise visible control flow.
-
Make a special exception to registers loaded with label
values just before jump insns that use them. */
@@ -664,9 +658,7 @@ find_label_refs (f, lvl)
{
rtx lab = XEXP (note, 0), next;
- if (lab == eh_return_stub_label)
- ;
- else if ((next = next_nonnote_insn (lab)) != NULL
+ if ((next = next_nonnote_insn (lab)) != NULL
&& GET_CODE (next) == JUMP_INSN
&& (GET_CODE (PATTERN (next)) == ADDR_VEC
|| GET_CODE (PATTERN (next)) == ADDR_DIFF_VEC))
@@ -696,7 +688,6 @@ find_basic_blocks_1 (f)
register rtx insn, next;
int i = 0;
rtx bb_note = NULL_RTX;
- rtx eh_list = NULL_RTX;
rtx lvl = NULL_RTX;
rtx trll = NULL_RTX;
rtx head = NULL_RTX;
@@ -720,22 +711,11 @@ find_basic_blocks_1 (f)
{
int kind = NOTE_LINE_NUMBER (insn);
- /* Keep a LIFO list of the currently active exception notes. */
- if (kind == NOTE_INSN_EH_REGION_BEG)
- eh_list = alloc_INSN_LIST (insn, eh_list);
- else if (kind == NOTE_INSN_EH_REGION_END)
- {
- rtx t = eh_list;
-
- eh_list = XEXP (eh_list, 1);
- free_INSN_LIST_node (t);
- }
-
/* Look for basic block notes with which to keep the
basic_block_info pointers stable. Unthread the note now;
we'll put it back at the right place in create_basic_block.
Or not at all if we've already found a note in this block. */
- else if (kind == NOTE_INSN_BASIC_BLOCK)
+ if (kind == NOTE_INSN_BASIC_BLOCK)
{
if (bb_note == NULL_RTX)
bb_note = insn;
@@ -819,8 +799,7 @@ find_basic_blocks_1 (f)
{
/* Record whether this call created an edge. */
rtx note = find_reg_note (insn, REG_EH_REGION, NULL_RTX);
- int region = (note ? INTVAL (XEXP (note, 0)) : 1);
- int call_has_abnormal_edge = 0;
+ int region = (note ? INTVAL (XEXP (note, 0)) : 0);
if (GET_CODE (PATTERN (insn)) == CALL_PLACEHOLDER)
{
@@ -833,19 +812,10 @@ find_basic_blocks_1 (f)
trll = alloc_EXPR_LIST (0, XEXP (PATTERN (insn), 3), trll);
}
- /* If there is an EH region or rethrow, we have an edge. */
- if ((eh_list && region > 0)
- || find_reg_note (insn, REG_EH_RETHROW, NULL_RTX))
- call_has_abnormal_edge = 1;
- else if (nonlocal_goto_handler_labels && region >= 0)
- /* If there is a nonlocal goto label and the specified
- region number isn't -1, we have an edge. (0 means
- no throw, but might have a nonlocal goto). */
- call_has_abnormal_edge = 1;
-
/* A basic block ends at a call that can either throw or
do a non-local goto. */
- if (call_has_abnormal_edge)
+ if ((nonlocal_goto_handler_labels && region >= 0)
+ || can_throw_internal (insn))
{
new_bb_inclusive:
if (head == NULL_RTX)
@@ -861,18 +831,21 @@ find_basic_blocks_1 (f)
}
/* Fall through. */
- default:
- if (GET_RTX_CLASS (code) == 'i')
- {
- if (head == NULL_RTX)
- head = insn;
- end = insn;
- }
+ case INSN:
+ /* Non-call exceptions generate new blocks just like calls. */
+ if (flag_non_call_exceptions && can_throw_internal (insn))
+ goto new_bb_inclusive;
+
+ if (head == NULL_RTX)
+ head = insn;
+ end = insn;
break;
+
+ default:
+ abort ();
}
- if (GET_RTX_CLASS (code) == 'i'
- && GET_CODE (insn) != JUMP_INSN)
+ if (GET_CODE (insn) == INSN || GET_CODE (insn) == CALL_INSN)
{
rtx note;
@@ -881,9 +854,6 @@ find_basic_blocks_1 (f)
Make a special exception for labels followed by an ADDR*VEC,
as this would be a part of the tablejump setup code.
- Make a special exception for the eh_return_stub_label, which
- we know isn't part of any otherwise visible control flow.
-
Make a special exception to registers loaded with label
values just before jump insns that use them. */
@@ -892,9 +862,7 @@ find_basic_blocks_1 (f)
{
rtx lab = XEXP (note, 0), next;
- if (lab == eh_return_stub_label)
- ;
- else if ((next = next_nonnote_insn (lab)) != NULL
+ if ((next = next_nonnote_insn (lab)) != NULL
&& GET_CODE (next) == JUMP_INSN
&& (GET_CODE (PATTERN (next)) == ADDR_VEC
|| GET_CODE (PATTERN (next)) == ADDR_DIFF_VEC))
@@ -925,12 +893,9 @@ find_basic_blocks_1 (f)
/* Tidy the CFG by deleting unreachable code and whatnot. */
void
-cleanup_cfg (f)
- rtx f;
+cleanup_cfg ()
{
delete_unreachable_blocks ();
- move_stray_eh_region_notes ();
- record_active_eh_regions (f);
try_merge_blocks ();
mark_critical_edges ();
@@ -1083,7 +1048,6 @@ make_edges (label_value_list)
rtx label_value_list;
{
int i;
- eh_nesting_info *eh_nest_info = init_eh_nesting_info ();
sbitmap *edge_cache = NULL;
/* Assume no computed jump; revise as we create edges. */
@@ -1119,9 +1083,13 @@ make_edges (label_value_list)
{
rtx tmp;
+ /* Recognize exception handling placeholders. */
+ if (GET_CODE (PATTERN (insn)) == RESX)
+ make_eh_edge (edge_cache, bb, insn);
+
/* Recognize a non-local goto as a branch outside the
current function. */
- if (find_reg_note (insn, REG_NON_LOCAL_GOTO, NULL_RTX))
+ else if (find_reg_note (insn, REG_NON_LOCAL_GOTO, NULL_RTX))
;
/* ??? Recognize a tablejump and do the right thing. */
@@ -1196,37 +1164,15 @@ make_edges (label_value_list)
EDGE_ABNORMAL | EDGE_ABNORMAL_CALL);
/* If this is a CALL_INSN, then mark it as reaching the active EH
- handler for this CALL_INSN. If we're handling asynchronous
+ handler for this CALL_INSN. If we're handling non-call
exceptions then any insn can reach any of the active handlers.
Also mark the CALL_INSN as reaching any nonlocal goto handler. */
- else if (code == CALL_INSN || asynchronous_exceptions)
+ else if (code == CALL_INSN || flag_non_call_exceptions)
{
- /* Add any appropriate EH edges. We do this unconditionally
- since there may be a REG_EH_REGION or REG_EH_RETHROW note
- on the call, and this needn't be within an EH region. */
- make_eh_edge (edge_cache, eh_nest_info, bb, insn, bb->eh_end);
-
- /* If we have asynchronous exceptions, do the same for *all*
- exception regions active in the block. */
- if (asynchronous_exceptions
- && bb->eh_beg != bb->eh_end)
- {
- if (bb->eh_beg >= 0)
- make_eh_edge (edge_cache, eh_nest_info, bb,
- NULL_RTX, bb->eh_beg);
-
- for (x = bb->head; x != bb->end; x = NEXT_INSN (x))
- if (GET_CODE (x) == NOTE
- && (NOTE_LINE_NUMBER (x) == NOTE_INSN_EH_REGION_BEG
- || NOTE_LINE_NUMBER (x) == NOTE_INSN_EH_REGION_END))
- {
- int region = NOTE_EH_HANDLER (x);
- make_eh_edge (edge_cache, eh_nest_info, bb,
- NULL_RTX, region);
- }
- }
+ /* Add any appropriate EH edges. */
+ make_eh_edge (edge_cache, bb, insn);
if (code == CALL_INSN && nonlocal_goto_handler_labels)
{
@@ -1247,14 +1193,6 @@ make_edges (label_value_list)
}
}
- /* We know something about the structure of the function __throw in
- libgcc2.c. It is the only function that ever contains eh_stub
- labels. It modifies its return address so that the last block
- returns to one of the eh_stub labels within it. So we have to
- make additional edges in the flow graph. */
- if (i + 1 == n_basic_blocks && eh_return_stub_label != 0)
- make_label_edge (edge_cache, bb, eh_return_stub_label, EDGE_EH);
-
/* Find out if we can drop through to the next block. */
insn = next_nonnote_insn (insn);
if (!insn || (i + 1 == n_basic_blocks && force_fallthru))
@@ -1269,7 +1207,6 @@ make_edges (label_value_list)
}
}
- free_eh_nesting_info (eh_nest_info);
if (edge_cache)
sbitmap_vector_free (edge_cache);
}
@@ -1357,115 +1294,21 @@ make_label_edge (edge_cache, src, label, flags)
/* Create the edges generated by INSN in REGION. */
static void
-make_eh_edge (edge_cache, eh_nest_info, src, insn, region)
+make_eh_edge (edge_cache, src, insn)
sbitmap *edge_cache;
- eh_nesting_info *eh_nest_info;
basic_block src;
rtx insn;
- int region;
-{
- handler_info **handler_list;
- int num, is_call;
-
- is_call = (insn && GET_CODE (insn) == CALL_INSN ? EDGE_ABNORMAL_CALL : 0);
- num = reachable_handlers (region, eh_nest_info, insn, &handler_list);
- while (--num >= 0)
- {
- make_label_edge (edge_cache, src, handler_list[num]->handler_label,
- EDGE_ABNORMAL | EDGE_EH | is_call);
- }
-}
-
-/* EH_REGION notes appearing between basic blocks is ambiguous, and even
- dangerous if we intend to move basic blocks around. Move such notes
- into the following block. */
-
-static void
-move_stray_eh_region_notes ()
{
- int i;
- basic_block b1, b2;
+ int is_call = (GET_CODE (insn) == CALL_INSN ? EDGE_ABNORMAL_CALL : 0);
+ rtx handlers, i;
- if (n_basic_blocks < 2)
- return;
+ handlers = reachable_handlers (insn);
- b2 = BASIC_BLOCK (n_basic_blocks - 1);
- for (i = n_basic_blocks - 2; i >= 0; --i, b2 = b1)
- {
- rtx insn, next, list = NULL_RTX;
+ for (i = handlers; i; i = XEXP (i, 1))
+ make_label_edge (edge_cache, src, XEXP (i, 0),
+ EDGE_ABNORMAL | EDGE_EH | is_call);
- b1 = BASIC_BLOCK (i);
- for (insn = NEXT_INSN (b1->end); insn != b2->head; insn = next)
- {
- next = NEXT_INSN (insn);
- if (GET_CODE (insn) == NOTE
- && (NOTE_LINE_NUMBER (insn) == NOTE_INSN_EH_REGION_BEG
- || NOTE_LINE_NUMBER (insn) == NOTE_INSN_EH_REGION_END))
- {
- /* Unlink from the insn chain. */
- NEXT_INSN (PREV_INSN (insn)) = next;
- PREV_INSN (next) = PREV_INSN (insn);
-
- /* Queue it. */
- NEXT_INSN (insn) = list;
- list = insn;
- }
- }
-
- if (list == NULL_RTX)
- continue;
-
- /* Find where to insert these things. */
- insn = b2->head;
- if (GET_CODE (insn) == CODE_LABEL)
- insn = NEXT_INSN (insn);
-
- while (list)
- {
- next = NEXT_INSN (list);
- add_insn_after (list, insn);
- list = next;
- }
- }
-}
-
-/* Recompute eh_beg/eh_end for each basic block. */
-
-static void
-record_active_eh_regions (f)
- rtx f;
-{
- rtx insn, eh_list = NULL_RTX;
- int i = 0;
- basic_block bb = BASIC_BLOCK (0);
-
- for (insn = f; insn; insn = NEXT_INSN (insn))
- {
- if (bb->head == insn)
- bb->eh_beg = (eh_list ? NOTE_EH_HANDLER (XEXP (eh_list, 0)) : -1);
-
- if (GET_CODE (insn) == NOTE)
- {
- int kind = NOTE_LINE_NUMBER (insn);
- if (kind == NOTE_INSN_EH_REGION_BEG)
- eh_list = alloc_INSN_LIST (insn, eh_list);
- else if (kind == NOTE_INSN_EH_REGION_END)
- {
- rtx t = XEXP (eh_list, 1);
- free_INSN_LIST_node (eh_list);
- eh_list = t;
- }
- }
-
- if (bb->end == insn)
- {
- bb->eh_end = (eh_list ? NOTE_EH_HANDLER (XEXP (eh_list, 0)) : -1);
- i += 1;
- if (i == n_basic_blocks)
- break;
- bb = BASIC_BLOCK (i);
- }
- }
+ free_INSN_LIST_list (&handlers);
}
/* Identify critical edges and set the bits appropriately. */
@@ -2090,7 +1933,6 @@ static void
delete_unreachable_blocks ()
{
basic_block *worklist, *tos;
- int deleted_handler;
edge e;
int i, n;
@@ -2128,10 +1970,9 @@ delete_unreachable_blocks ()
}
}
- /* Delete all unreachable basic blocks. Count down so that we don't
- interfere with the block renumbering that happens in flow_delete_block. */
-
- deleted_handler = 0;
+ /* Delete all unreachable basic blocks. Count down so that we
+ don't interfere with the block renumbering that happens in
+ flow_delete_block. */
for (i = n - 1; i >= 0; --i)
{
@@ -2141,46 +1982,14 @@ delete_unreachable_blocks ()
/* This block was found. Tidy up the mark. */
b->aux = NULL;
else
- deleted_handler |= flow_delete_block (b);
+ flow_delete_block (b);
}
tidy_fallthru_edges ();
- /* If we deleted an exception handler, we may have EH region begin/end
- blocks to remove as well. */
- if (deleted_handler)
- delete_eh_regions ();
-
free (worklist);
}
-/* Find EH regions for which there is no longer a handler, and delete them. */
-
-static void
-delete_eh_regions ()
-{
- rtx insn;
-
- update_rethrow_references ();
-
- for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
- if (GET_CODE (insn) == NOTE)
- {
- if ((NOTE_LINE_NUMBER (insn) == NOTE_INSN_EH_REGION_BEG)
- || (NOTE_LINE_NUMBER (insn) == NOTE_INSN_EH_REGION_END))
- {
- int num = NOTE_EH_HANDLER (insn);
- /* A NULL handler indicates a region is no longer needed,
- as long as its rethrow label isn't used. */
- if (get_first_handler (num) == NULL && ! rethrow_used (num))
- {
- NOTE_LINE_NUMBER (insn) = NOTE_INSN_DELETED;
- NOTE_SOURCE_FILE (insn) = 0;
- }
- }
- }
-}
-
/* Return true if NOTE is not one of the ones that must be kept paired,
so that we may simply delete them. */
@@ -2254,26 +2063,7 @@ flow_delete_block (b)
never_reached_warning (insn);
if (GET_CODE (insn) == CODE_LABEL)
- {
- rtx x, *prev = &exception_handler_labels;
-
- for (x = exception_handler_labels; x; x = XEXP (x, 1))
- {
- if (XEXP (x, 0) == insn)
- {
- /* Found a match, splice this label out of the EH label list. */
- *prev = XEXP (x, 1);
- XEXP (x, 1) = NULL_RTX;
- XEXP (x, 0) = NULL_RTX;
-
- /* Remove the handler from all regions */
- remove_handler (insn);
- deleted_handler = 1;
- break;
- }
- prev = &XEXP (x, 1);
- }
- }
+ maybe_remove_eh_handler (insn);
/* Include any jump table following the basic block. */
end = b->end;
@@ -2647,13 +2437,22 @@ merge_blocks (e, b, c)
edge e;
basic_block b, c;
{
- /* If C has a tail recursion label, do not merge. There is no
- edge recorded from the call_placeholder back to this label, as
- that would make optimize_sibling_and_tail_recursive_calls more
- complex for no gain. */
- if (GET_CODE (c->head) == CODE_LABEL
- && tail_recursion_label_p (c->head))
- return 0;
+ if (GET_CODE (c->head) == CODE_LABEL)
+ {
+ rtx x;
+
+ /* If C has a tail recursion label, do not merge. There is no
+ edge recorded from the call_placeholder back to this label, as
+ that would make optimize_sibling_and_tail_recursive_calls more
+ complex for no gain. */
+ if (tail_recursion_label_p (c->head))
+ return 0;
+
+ /* If C has a nonlocal goto label, do not merge either. */
+ for (x = nonlocal_goto_handler_labels; x; x = XEXP (x, 1))
+ if (XEXP (x, 0) == c->head)
+ return 0;
+ }
/* If B has a fallthru edge to C, no need to move anything. */
if (e->flags & EDGE_FALLTHRU)
@@ -2671,7 +2470,6 @@ merge_blocks (e, b, c)
else
{
edge tmp_edge;
- basic_block d;
int c_has_outgoing_fallthru;
int b_has_incoming_fallthru;
@@ -2699,37 +2497,22 @@ merge_blocks (e, b, c)
break;
b_has_incoming_fallthru = (tmp_edge != NULL);
- /* If B does not have an incoming fallthru, and the exception regions
- match, then it can be moved immediately before C without introducing
- or modifying jumps.
-
- C can not be the first block, so we do not have to worry about
+ /* If B does not have an incoming fallthru, then it can be moved
+ immediately before C without introducing or modifying jumps.
+ C cannot be the first block, so we do not have to worry about
accessing a non-existent block. */
- d = BASIC_BLOCK (c->index - 1);
- if (! b_has_incoming_fallthru
- && d->eh_end == b->eh_beg
- && b->eh_end == c->eh_beg)
+ if (! b_has_incoming_fallthru)
return merge_blocks_move_predecessor_nojumps (b, c);
- /* Otherwise, we're going to try to move C after B. Make sure the
- exception regions match.
+ /* Otherwise, we're going to try to move C after B. If C does
+ not have an outgoing fallthru, then it can be moved
+ immediately after B without introducing or modifying jumps. */
+ if (! c_has_outgoing_fallthru)
+ return merge_blocks_move_successor_nojumps (b, c);
- If B is the last basic block, then we must not try to access the
- block structure for block B + 1. Luckily in that case we do not
- need to worry about matching exception regions. */
- d = (b->index + 1 < n_basic_blocks ? BASIC_BLOCK (b->index + 1) : NULL);
- if (b->eh_end == c->eh_beg
- && (d == NULL || c->eh_end == d->eh_beg))
- {
- /* If C does not have an outgoing fallthru, then it can be moved
- immediately after B without introducing or modifying jumps. */
- if (! c_has_outgoing_fallthru)
- return merge_blocks_move_successor_nojumps (b, c);
-
- /* Otherwise, we'll need to insert an extra jump, and possibly
- a new block to contain it. */
- /* ??? Not implemented yet. */
- }
+ /* Otherwise, we'll need to insert an extra jump, and possibly
+ a new block to contain it. */
+ /* ??? Not implemented yet. */
return 0;
}
@@ -2814,7 +2597,14 @@ tidy_fallthru_edge (e, b, c)
NOTE_SOURCE_FILE (q) = 0;
}
else
- q = PREV_INSN (q);
+ {
+ q = PREV_INSN (q);
+
+ /* We don't want a block to end on a line-number note since that has
+ the potential of changing the code between -g and not -g. */
+ while (GET_CODE (q) == NOTE && NOTE_LINE_NUMBER (q) >= 0)
+ q = PREV_INSN (q);
+ }
b->end = q;
}
@@ -2854,6 +2644,7 @@ tidy_fallthru_edges ()
merge the flags for the duplicate edges. So we do not want to
check that the edge is not a FALLTHRU edge. */
if ((s = b->succ) != NULL
+ && ! (s->flags & EDGE_COMPLEX)
&& s->succ_next == NULL
&& s->dest == c
/* If the jump insn has side effects, we can't tidy the edge. */
@@ -2944,6 +2735,21 @@ life_analysis (f, file, flags)
dump_flow_info (file);
free_basic_block_vars (1);
+
+#ifdef ENABLE_CHECKING
+ {
+ rtx insn;
+
+ /* Search for any REG_LABEL notes whih reference deleted labels. */
+ for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
+ {
+ rtx inote = find_reg_note (insn, REG_LABEL, NULL_RTX);
+
+ if (inote && GET_CODE (inote) == NOTE_INSN_DELETED_LABEL)
+ abort ();
+ }
+ }
+#endif
}
/* A subroutine of verify_wide_reg, called through for_each_rtx.
@@ -3362,14 +3168,44 @@ mark_regs_live_at_end (set)
if (global_regs[i] || EPILOGUE_USES (i))
SET_REGNO_REG_SET (set, i);
- /* Mark all call-saved registers that we actaully used. */
if (HAVE_epilogue && reload_completed)
{
+ /* Mark all call-saved registers that we actually used. */
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
if (regs_ever_live[i] && ! call_used_regs[i] && ! LOCAL_REGNO (i))
SET_REGNO_REG_SET (set, i);
}
+#ifdef EH_RETURN_DATA_REGNO
+ /* Mark the registers that will contain data for the handler. */
+ if (reload_completed && current_function_calls_eh_return)
+ for (i = 0; ; ++i)
+ {
+ unsigned regno = EH_RETURN_DATA_REGNO(i);
+ if (regno == INVALID_REGNUM)
+ break;
+ SET_REGNO_REG_SET (set, regno);
+ }
+#endif
+#ifdef EH_RETURN_STACKADJ_RTX
+ if ((! HAVE_epilogue || ! reload_completed)
+ && current_function_calls_eh_return)
+ {
+ rtx tmp = EH_RETURN_STACKADJ_RTX;
+ if (tmp && REG_P (tmp))
+ mark_reg (tmp, set);
+ }
+#endif
+#ifdef EH_RETURN_HANDLER_RTX
+ if ((! HAVE_epilogue || ! reload_completed)
+ && current_function_calls_eh_return)
+ {
+ rtx tmp = EH_RETURN_HANDLER_RTX;
+ if (tmp && REG_P (tmp))
+ mark_reg (tmp, set);
+ }
+#endif
+
/* Mark function return value. */
diddle_return_value (mark_reg, set);
}
@@ -3402,13 +3238,19 @@ calculate_global_regs_live (blocks_in, blocks_out, flags)
int flags;
{
basic_block *queue, *qhead, *qtail, *qend;
- regset tmp, new_live_at_end;
- regset_head tmp_head;
+ regset tmp, new_live_at_end, call_used;
+ regset_head tmp_head, call_used_head;
regset_head new_live_at_end_head;
int i;
tmp = INITIALIZE_REG_SET (tmp_head);
new_live_at_end = INITIALIZE_REG_SET (new_live_at_end_head);
+ call_used = INITIALIZE_REG_SET (call_used_head);
+
+ /* Inconveniently, this is only redily available in hard reg set form. */
+ for (i = 0; i < FIRST_PSEUDO_REGISTER; ++i)
+ if (call_used_regs[i])
+ SET_REGNO_REG_SET (call_used, i);
/* Create a worklist. Allocate an extra slot for ENTRY_BLOCK, and one
because the `head == tail' style test for an empty queue doesn't
@@ -3462,7 +3304,18 @@ calculate_global_regs_live (blocks_in, blocks_out, flags)
for (e = bb->succ; e; e = e->succ_next)
{
basic_block sb = e->dest;
- IOR_REG_SET (new_live_at_end, sb->global_live_at_start);
+
+ /* Call-clobbered registers die across exception and call edges. */
+ /* ??? Abnormal call edges ignored for the moment, as this gets
+ confused by sibling call edges, which crashes reg-stack. */
+ if (e->flags & EDGE_EH)
+ {
+ bitmap_operation (tmp, sb->global_live_at_start,
+ call_used, BITMAP_AND_COMPL);
+ IOR_REG_SET (new_live_at_end, tmp);
+ }
+ else
+ IOR_REG_SET (new_live_at_end, sb->global_live_at_start);
}
/* The all-important stack pointer must always be live. */
@@ -3611,6 +3464,7 @@ calculate_global_regs_live (blocks_in, blocks_out, flags)
FREE_REG_SET (tmp);
FREE_REG_SET (new_live_at_end);
+ FREE_REG_SET (call_used);
if (blocks_out)
{
@@ -3696,14 +3550,26 @@ propagate_block_delete_insn (bb, insn)
/* If the insn referred to a label, and that label was attached to
an ADDR_VEC, it's safe to delete the ADDR_VEC. In fact, it's
pretty much mandatory to delete it, because the ADDR_VEC may be
- referencing labels that no longer exist. */
+ referencing labels that no longer exist.
+
+ INSN may reference a deleted label, particularly when a jump
+ table has been optimized into a direct jump. There's no
+ real good way to fix up the reference to the deleted label
+ when the label is deleted, so we just allow it here.
- if (inote)
+ After dead code elimination is complete, we do search for
+ any REG_LABEL notes which reference deleted labels as a
+ sanity check. */
+
+ if (inote && GET_CODE (inote) == CODE_LABEL)
{
rtx label = XEXP (inote, 0);
rtx next;
- if (LABEL_NUSES (label) == 1
+ /* The label may be forced if it has been put in the constant
+ pool. If that is the only use we must discard the table
+ jump following it, but not the label itself. */
+ if (LABEL_NUSES (label) == 1 + LABEL_PRESERVE_P (label)
&& (next = next_nonnote_insn (label)) != NULL
&& GET_CODE (next) == JUMP_INSN
&& (GET_CODE (PATTERN (next)) == ADDR_VEC
@@ -3799,10 +3665,7 @@ propagate_one_insn (pbi, insn)
pbi->cc0_live = 0;
if (libcall_is_dead)
- {
- prev = propagate_block_delete_libcall (pbi->bb, insn, note);
- insn = NEXT_INSN (prev);
- }
+ prev = propagate_block_delete_libcall (pbi->bb, insn, note);
else
propagate_block_delete_insn (pbi->bb, insn);
@@ -4069,6 +3932,8 @@ init_propagate_block_info (bb, live, local_set, cond_local_set, flags)
else
cond = cond_true;
rcli->condition = cond;
+ rcli->stores = const0_rtx;
+ rcli->orig_condition = cond;
splay_tree_insert (pbi->reg_cond_dead, i,
(splay_tree_value) rcli);
@@ -4090,7 +3955,8 @@ init_propagate_block_info (bb, live, local_set, cond_local_set, flags)
&& (flags & PROP_SCAN_DEAD_CODE)
&& (bb->succ == NULL
|| (bb->succ->succ_next == NULL
- && bb->succ->dest == EXIT_BLOCK_PTR)))
+ && bb->succ->dest == EXIT_BLOCK_PTR
+ && ! current_function_calls_eh_return)))
{
rtx insn;
for (insn = bb->end; insn != bb->head; insn = PREV_INSN (insn))
@@ -4285,27 +4151,28 @@ insn_dead_p (pbi, x, call_ok, notes)
/* Walk the set of memory locations we are currently tracking
and see if one is an identical match to this memory location.
If so, this memory write is dead (remember, we're walking
- backwards from the end of the block to the start). */
- temp = pbi->mem_set_list;
- while (temp)
- {
- rtx mem = XEXP (temp, 0);
+ backwards from the end of the block to the start). Since
+ rtx_equal_p does not check the alias set or flags, we also
+ must have the potential for them to conflict (anti_dependence). */
+ for (temp = pbi->mem_set_list; temp != 0; temp = XEXP (temp, 1))
+ if (anti_dependence (r, XEXP (temp, 0)))
+ {
+ rtx mem = XEXP (temp, 0);
- if (rtx_equal_p (mem, r))
- return 1;
+ if (rtx_equal_p (mem, r))
+ return 1;
#ifdef AUTO_INC_DEC
- /* Check if memory reference matches an auto increment. Only
- post increment/decrement or modify are valid. */
- if (GET_MODE (mem) == GET_MODE (r)
- && (GET_CODE (XEXP (mem, 0)) == POST_DEC
- || GET_CODE (XEXP (mem, 0)) == POST_INC
- || GET_CODE (XEXP (mem, 0)) == POST_MODIFY)
- && GET_MODE (XEXP (mem, 0)) == GET_MODE (r)
- && rtx_equal_p (XEXP (XEXP (mem, 0), 0), XEXP (r, 0)))
- return 1;
+ /* Check if memory reference matches an auto increment. Only
+ post increment/decrement or modify are valid. */
+ if (GET_MODE (mem) == GET_MODE (r)
+ && (GET_CODE (XEXP (mem, 0)) == POST_DEC
+ || GET_CODE (XEXP (mem, 0)) == POST_INC
+ || GET_CODE (XEXP (mem, 0)) == POST_MODIFY)
+ && GET_MODE (XEXP (mem, 0)) == GET_MODE (r)
+ && rtx_equal_p (XEXP (XEXP (mem, 0), 0), XEXP (r, 0)))
+ return 1;
#endif
- temp = XEXP (temp, 1);
- }
+ }
}
else
{
@@ -4655,7 +4522,7 @@ mark_set_1 (pbi, code, reg, cond, insn, flags)
int flags;
{
int regno_first = -1, regno_last = -1;
- int not_dead = 0;
+ unsigned long not_dead = 0;
int i;
/* Modifying just one hardware register of a multi-reg value or just a
@@ -4686,7 +4553,7 @@ mark_set_1 (pbi, code, reg, cond, insn, flags)
|| GET_CODE (reg) == STRICT_LOW_PART);
if (GET_CODE (reg) == MEM)
break;
- not_dead = REGNO_REG_SET_P (pbi->reg_live, REGNO (reg));
+ not_dead = (unsigned long) REGNO_REG_SET_P (pbi->reg_live, REGNO (reg));
/* Fall through. */
case REG:
@@ -4734,7 +4601,8 @@ mark_set_1 (pbi, code, reg, cond, insn, flags)
+ UNITS_PER_WORD - 1) / UNITS_PER_WORD)
< ((GET_MODE_SIZE (inner_mode)
+ UNITS_PER_WORD - 1) / UNITS_PER_WORD))
- not_dead = REGNO_REG_SET_P (pbi->reg_live, regno_first);
+ not_dead = (unsigned long) REGNO_REG_SET_P (pbi->reg_live,
+ regno_first);
reg = SUBREG_REG (reg);
}
@@ -4830,7 +4698,7 @@ mark_set_1 (pbi, code, reg, cond, insn, flags)
{
for (i = regno_first; i <= regno_last; ++i)
if (! mark_regno_cond_dead (pbi, i, cond))
- not_dead = 1;
+ not_dead |= ((unsigned long) 1) << (i - regno_first);
}
#endif
@@ -4943,7 +4811,6 @@ mark_set_1 (pbi, code, reg, cond, insn, flags)
/* Mark the register as being dead. */
if (some_was_live
- && ! not_dead
/* The stack pointer is never dead. Well, not strictly true,
but it's very difficult to tell from here. Hopefully
combine_stack_adjustments will fix up the most egregious
@@ -4951,7 +4818,8 @@ mark_set_1 (pbi, code, reg, cond, insn, flags)
&& regno_first != STACK_POINTER_REGNUM)
{
for (i = regno_first; i <= regno_last; ++i)
- CLEAR_REGNO_REG_SET (pbi->reg_live, i);
+ if (!(not_dead & (((unsigned long) 1) << (i - regno_first))))
+ CLEAR_REGNO_REG_SET (pbi->reg_live, i);
}
}
else if (GET_CODE (reg) == REG)
@@ -5010,6 +4878,8 @@ mark_regno_cond_dead (pbi, regno, cond)
which it is dead. */
rcli = (struct reg_cond_life_info *) xmalloc (sizeof (*rcli));
rcli->condition = cond;
+ rcli->stores = cond;
+ rcli->orig_condition = const0_rtx;
splay_tree_insert (pbi->reg_cond_dead, regno,
(splay_tree_value) rcli);
@@ -5025,10 +4895,21 @@ mark_regno_cond_dead (pbi, regno, cond)
rcli = (struct reg_cond_life_info *) node->value;
ncond = rcli->condition;
ncond = ior_reg_cond (ncond, cond, 1);
-
- /* If the register is now unconditionally dead,
- remove the entry in the splay_tree. */
- if (ncond == const1_rtx)
+ if (rcli->stores == const0_rtx)
+ rcli->stores = cond;
+ else if (rcli->stores != const1_rtx)
+ rcli->stores = ior_reg_cond (rcli->stores, cond, 1);
+
+ /* If the register is now unconditionally dead, remove the entry
+ in the splay_tree. A register is unconditionally dead if the
+ dead condition ncond is true. A register is also unconditionally
+ dead if the sum of all conditional stores is an unconditional
+ store (stores is true), and the dead condition is identically the
+ same as the original dead condition initialized at the end of
+ the block. This is a pointer compare, not an rtx_equal_p
+ compare. */
+ if (ncond == const1_rtx
+ || (ncond == rcli->orig_condition && rcli->stores == const1_rtx))
splay_tree_remove (pbi->reg_cond_dead, regno);
else
{
@@ -5074,6 +4955,8 @@ flush_reg_cond_reg_1 (node, data)
/* Splice out portions of the expression that refer to regno. */
rcli = (struct reg_cond_life_info *) node->value;
rcli->condition = elim_reg_cond (rcli->condition, regno);
+ if (rcli->stores != const0_rtx && rcli->stores != const1_rtx)
+ rcli->stores = elim_reg_cond (rcli->stores, regno);
/* If the entire condition is now false, signal the node to be removed. */
if (rcli->condition == const0_rtx)
@@ -5280,6 +5163,17 @@ and_reg_cond (old, x, add)
}
if (! add)
return old;
+
+ /* If X is identical to one of the existing terms of the AND,
+ then just return what we already have. */
+ /* ??? There really should be some sort of recursive check here in
+ case there are nested ANDs. */
+ if ((GET_CODE (XEXP (old, 0)) == GET_CODE (x)
+ && REGNO (XEXP (XEXP (old, 0), 0)) == REGNO (XEXP (x, 0)))
+ || (GET_CODE (XEXP (old, 1)) == GET_CODE (x)
+ && REGNO (XEXP (XEXP (old, 1), 0)) == REGNO (XEXP (x, 0))))
+ return old;
+
return gen_rtx_AND (0, old, x);
case NOT:
@@ -5460,6 +5354,9 @@ attempt_auto_inc (pbi, inc, insn, mem, incr, incr_reg)
for (temp = insn; temp != incr; temp = NEXT_INSN (temp))
if (GET_CODE (temp) == CALL_INSN)
REG_N_CALLS_CROSSED (regno)++;
+
+ /* Invalidate alias info for Q since we just changed its value. */
+ clear_reg_alias_info (q);
}
else
return;
@@ -5604,35 +5501,37 @@ mark_used_reg (pbi, reg, cond, insn)
rtx cond ATTRIBUTE_UNUSED;
rtx insn;
{
- int regno = REGNO (reg);
- int some_was_live = REGNO_REG_SET_P (pbi->reg_live, regno);
- int some_was_dead = ! some_was_live;
- int some_not_set;
- int n;
+ unsigned int regno_first, regno_last, i;
+ int some_was_live, some_was_dead, some_not_set;
- /* A hard reg in a wide mode may really be multiple registers.
- If so, mark all of them just like the first. */
- if (regno < FIRST_PSEUDO_REGISTER)
+ regno_last = regno_first = REGNO (reg);
+ if (regno_first < FIRST_PSEUDO_REGISTER)
+ regno_last += HARD_REGNO_NREGS (regno_first, GET_MODE (reg)) - 1;
+
+ /* Find out if any of this register is live after this instruction. */
+ some_was_live = some_was_dead = 0;
+ for (i = regno_first; i <= regno_last; ++i)
{
- n = HARD_REGNO_NREGS (regno, GET_MODE (reg));
- while (--n > 0)
- {
- int needed_regno = REGNO_REG_SET_P (pbi->reg_live, regno + n);
- some_was_live |= needed_regno;
- some_was_dead |= ! needed_regno;
- }
+ int needed_regno = REGNO_REG_SET_P (pbi->reg_live, i);
+ some_was_live |= needed_regno;
+ some_was_dead |= ! needed_regno;
}
+ /* Find out if any of the register was set this insn. */
+ some_not_set = 0;
+ for (i = regno_first; i <= regno_last; ++i)
+ some_not_set |= ! REGNO_REG_SET_P (pbi->new_set, i);
+
if (pbi->flags & (PROP_LOG_LINKS | PROP_AUTOINC))
{
/* Record where each reg is used, so when the reg is set we know
the next insn that uses it. */
- pbi->reg_next_use[regno] = insn;
+ pbi->reg_next_use[regno_first] = insn;
}
if (pbi->flags & PROP_REG_INFO)
{
- if (regno < FIRST_PSEUDO_REGISTER)
+ if (regno_first < FIRST_PSEUDO_REGISTER)
{
/* If this is a register we are going to try to eliminate,
don't mark it live here. If we are successful in
@@ -5646,41 +5545,28 @@ mark_used_reg (pbi, reg, cond, insn)
register to itself. This should be fixed. In the mean
time, hack around it. */
- if (! (TEST_HARD_REG_BIT (elim_reg_set, regno)
- && (regno == FRAME_POINTER_REGNUM
- || regno == ARG_POINTER_REGNUM)))
- {
- int n = HARD_REGNO_NREGS (regno, GET_MODE (reg));
- do
- regs_ever_live[regno + --n] = 1;
- while (n > 0);
- }
+ if (! (TEST_HARD_REG_BIT (elim_reg_set, regno_first)
+ && (regno_first == FRAME_POINTER_REGNUM
+ || regno_first == ARG_POINTER_REGNUM)))
+ for (i = regno_first; i <= regno_last; ++i)
+ regs_ever_live[i] = 1;
}
else
{
/* Keep track of which basic block each reg appears in. */
register int blocknum = pbi->bb->index;
- if (REG_BASIC_BLOCK (regno) == REG_BLOCK_UNKNOWN)
- REG_BASIC_BLOCK (regno) = blocknum;
- else if (REG_BASIC_BLOCK (regno) != blocknum)
- REG_BASIC_BLOCK (regno) = REG_BLOCK_GLOBAL;
+ if (REG_BASIC_BLOCK (regno_first) == REG_BLOCK_UNKNOWN)
+ REG_BASIC_BLOCK (regno_first) = blocknum;
+ else if (REG_BASIC_BLOCK (regno_first) != blocknum)
+ REG_BASIC_BLOCK (regno_first) = REG_BLOCK_GLOBAL;
/* Count (weighted) number of uses of each reg. */
- REG_N_REFS (regno) += (optimize_size ? 1
- : pbi->bb->loop_depth + 1);
+ REG_N_REFS (regno_first)
+ += (optimize_size ? 1 : pbi->bb->loop_depth + 1);
}
}
- /* Find out if any of the register was set this insn. */
- some_not_set = ! REGNO_REG_SET_P (pbi->new_set, regno);
- if (regno < FIRST_PSEUDO_REGISTER)
- {
- n = HARD_REGNO_NREGS (regno, GET_MODE (reg));
- while (--n > 0)
- some_not_set |= ! REGNO_REG_SET_P (pbi->new_set, regno + n);
- }
-
/* Record and count the insns in which a reg dies. If it is used in
this insn and was dead below the insn then it dies in this insn.
If it was set in this insn, we do not make a REG_DEAD note;
@@ -5691,120 +5577,102 @@ mark_used_reg (pbi, reg, cond, insn)
{
/* Check for the case where the register dying partially
overlaps the register set by this insn. */
- if (regno < FIRST_PSEUDO_REGISTER
- && HARD_REGNO_NREGS (regno, GET_MODE (reg)) > 1)
- {
- n = HARD_REGNO_NREGS (regno, GET_MODE (reg));
- while (--n >= 0)
- some_was_live |= REGNO_REG_SET_P (pbi->new_set, regno + n);
- }
+ if (regno_first != regno_last)
+ for (i = regno_first; i <= regno_last; ++i)
+ some_was_live |= REGNO_REG_SET_P (pbi->new_set, i);
/* If none of the words in X is needed, make a REG_DEAD note.
Otherwise, we must make partial REG_DEAD notes. */
if (! some_was_live)
{
if ((pbi->flags & PROP_DEATH_NOTES)
- && ! find_regno_note (insn, REG_DEAD, regno))
+ && ! find_regno_note (insn, REG_DEAD, regno_first))
REG_NOTES (insn)
= alloc_EXPR_LIST (REG_DEAD, reg, REG_NOTES (insn));
if (pbi->flags & PROP_REG_INFO)
- REG_N_DEATHS (regno)++;
+ REG_N_DEATHS (regno_first)++;
}
else
{
/* Don't make a REG_DEAD note for a part of a register
that is set in the insn. */
-
- n = regno + HARD_REGNO_NREGS (regno, GET_MODE (reg)) - 1;
- for (; n >= regno; n--)
- if (! REGNO_REG_SET_P (pbi->reg_live, n)
- && ! dead_or_set_regno_p (insn, n))
+ for (i = regno_first; i <= regno_last; ++i)
+ if (! REGNO_REG_SET_P (pbi->reg_live, i)
+ && ! dead_or_set_regno_p (insn, i))
REG_NOTES (insn)
= alloc_EXPR_LIST (REG_DEAD,
- gen_rtx_REG (reg_raw_mode[n], n),
+ gen_rtx_REG (reg_raw_mode[i], i),
REG_NOTES (insn));
}
}
- SET_REGNO_REG_SET (pbi->reg_live, regno);
- if (regno < FIRST_PSEUDO_REGISTER)
+ /* Mark the register as being live. */
+ for (i = regno_first; i <= regno_last; ++i)
{
- n = HARD_REGNO_NREGS (regno, GET_MODE (reg));
- while (--n > 0)
- SET_REGNO_REG_SET (pbi->reg_live, regno + n);
- }
+ SET_REGNO_REG_SET (pbi->reg_live, i);
#ifdef HAVE_conditional_execution
- /* If this is a conditional use, record that fact. If it is later
- conditionally set, we'll know to kill the register. */
- if (cond != NULL_RTX)
- {
- splay_tree_node node;
- struct reg_cond_life_info *rcli;
- rtx ncond;
-
- if (some_was_live)
+ /* If this is a conditional use, record that fact. If it is later
+ conditionally set, we'll know to kill the register. */
+ if (cond != NULL_RTX)
{
- node = splay_tree_lookup (pbi->reg_cond_dead, regno);
- if (node == NULL)
- {
- /* The register was unconditionally live previously.
- No need to do anything. */
- }
- else
+ splay_tree_node node;
+ struct reg_cond_life_info *rcli;
+ rtx ncond;
+
+ if (some_was_live)
{
- /* The register was conditionally live previously.
- Subtract the new life cond from the old death cond. */
- rcli = (struct reg_cond_life_info *) node->value;
- ncond = rcli->condition;
- ncond = and_reg_cond (ncond, not_reg_cond (cond), 1);
-
- /* If the register is now unconditionally live, remove the
- entry in the splay_tree. */
- if (ncond == const0_rtx)
+ node = splay_tree_lookup (pbi->reg_cond_dead, i);
+ if (node == NULL)
{
- rcli->condition = NULL_RTX;
- splay_tree_remove (pbi->reg_cond_dead, regno);
+ /* The register was unconditionally live previously.
+ No need to do anything. */
}
else
{
- rcli->condition = ncond;
- SET_REGNO_REG_SET (pbi->reg_cond_reg, REGNO (XEXP (cond, 0)));
+ /* The register was conditionally live previously.
+ Subtract the new life cond from the old death cond. */
+ rcli = (struct reg_cond_life_info *) node->value;
+ ncond = rcli->condition;
+ ncond = and_reg_cond (ncond, not_reg_cond (cond), 1);
+
+ /* If the register is now unconditionally live,
+ remove the entry in the splay_tree. */
+ if (ncond == const0_rtx)
+ splay_tree_remove (pbi->reg_cond_dead, i);
+ else
+ {
+ rcli->condition = ncond;
+ SET_REGNO_REG_SET (pbi->reg_cond_reg,
+ REGNO (XEXP (cond, 0)));
+ }
}
}
- }
- else
- {
- /* The register was not previously live at all. Record
- the condition under which it is still dead. */
- rcli = (struct reg_cond_life_info *) xmalloc (sizeof (*rcli));
- rcli->condition = not_reg_cond (cond);
- splay_tree_insert (pbi->reg_cond_dead, regno,
- (splay_tree_value) rcli);
+ else
+ {
+ /* The register was not previously live at all. Record
+ the condition under which it is still dead. */
+ rcli = (struct reg_cond_life_info *) xmalloc (sizeof (*rcli));
+ rcli->condition = not_reg_cond (cond);
+ rcli->stores = const0_rtx;
+ rcli->orig_condition = const0_rtx;
+ splay_tree_insert (pbi->reg_cond_dead, i,
+ (splay_tree_value) rcli);
- SET_REGNO_REG_SET (pbi->reg_cond_reg, REGNO (XEXP (cond, 0)));
+ SET_REGNO_REG_SET (pbi->reg_cond_reg, REGNO (XEXP (cond, 0)));
+ }
}
- }
- else if (some_was_live)
- {
- splay_tree_node node;
- struct reg_cond_life_info *rcli;
-
- node = splay_tree_lookup (pbi->reg_cond_dead, regno);
- if (node != NULL)
+ else if (some_was_live)
{
- /* The register was conditionally live previously, but is now
- unconditionally so. Remove it from the conditionally dead
- list, so that a conditional set won't cause us to think
+ /* The register may have been conditionally live previously, but
+ is now unconditionally live. Remove it from the conditionally
+ dead list, so that a conditional set won't cause us to think
it dead. */
- rcli = (struct reg_cond_life_info *) node->value;
- rcli->condition = NULL_RTX;
- splay_tree_remove (pbi->reg_cond_dead, regno);
+ splay_tree_remove (pbi->reg_cond_dead, i);
}
- }
-
#endif
+ }
}
/* Scan expression X and store a 1-bit in NEW_LIVE for each reg it uses.
@@ -6447,8 +6315,6 @@ dump_bb (bb, outf)
fprintf (outf, ";; Basic block %d, loop depth %d, count %d",
bb->index, bb->loop_depth, bb->count);
- if (bb->eh_beg != -1 || bb->eh_end != -1)
- fprintf (outf, ", eh regions %d/%d", bb->eh_beg, bb->eh_end);
putc ('\n', outf);
fputs (";; Predecessors: ", outf);
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index 3cb1869981b..1f1d63f5db2 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -101,7 +101,9 @@ static tree strip_compound_expr PARAMS ((tree, tree));
static int multiple_of_p PARAMS ((tree, tree, tree));
static tree constant_boolean_node PARAMS ((int, tree));
static int count_cond PARAMS ((tree, int));
-
+static tree fold_binary_op_with_conditional_arg
+ PARAMS ((enum tree_code, tree, tree, tree, int));
+
#ifndef BRANCH_COST
#define BRANCH_COST 1
#endif
@@ -2020,6 +2022,7 @@ fold_convert (t, arg1)
/* If we are trying to make a sizetype for a small integer, use
size_int to pick up cached types to reduce duplicate nodes. */
if (TREE_CODE (type) == INTEGER_TYPE && TYPE_IS_SIZETYPE (type)
+ && !TREE_CONSTANT_OVERFLOW (arg1)
&& compare_tree_int (arg1, 10000) < 0)
return size_int_type_wide (TREE_INT_CST_LOW (arg1), type);
@@ -4478,7 +4481,12 @@ extract_muldiv (t, c, code, wide_type)
constant. */
t1 = extract_muldiv (op0, c, code, wide_type);
t2 = extract_muldiv (op1, c, code, wide_type);
- if (t1 != 0 && t2 != 0)
+ if (t1 != 0 && t2 != 0
+ && (code == MULT_EXPR
+ /* If not multiplication, we can only do this if either operand
+ is divisible by c. */
+ || multiple_of_p (ctype, op0, c)
+ || multiple_of_p (ctype, op1, c)))
return fold (build (tcode, ctype, convert (ctype, t1),
convert (ctype, t2)));
@@ -4680,17 +4688,146 @@ count_cond (expr, lim)
tree expr;
int lim;
{
- int true, false;
+ int ctrue, cfalse;
if (TREE_CODE (expr) != COND_EXPR)
return 0;
else if (lim <= 0)
return 0;
- true = count_cond (TREE_OPERAND (expr, 1), lim - 1);
- false = count_cond (TREE_OPERAND (expr, 2), lim - 1 - true);
- return MIN (lim, 1 + true + false);
+ ctrue = count_cond (TREE_OPERAND (expr, 1), lim - 1);
+ cfalse = count_cond (TREE_OPERAND (expr, 2), lim - 1 - ctrue);
+ return MIN (lim, 1 + ctrue + cfalse);
}
+
+/* Transform `a + (b ? x : y)' into `x ? (a + b) : (a + y)'.
+ Transform, `a + (x < y)' into `(x < y) ? (a + 1) : (a + 0)'. Here
+ CODE corresponds to the `+', COND to the `(b ? x : y)' or `(x < y)'
+ expression, and ARG to `a'. If COND_FIRST_P is non-zero, then the
+ COND is the first argument to CODE; otherwise (as in the example
+ given here), it is the second argument. TYPE is the type of the
+ original expression. */
+
+static tree
+fold_binary_op_with_conditional_arg (code, type, cond, arg, cond_first_p)
+ enum tree_code code;
+ tree type;
+ tree cond;
+ tree arg;
+ int cond_first_p;
+{
+ tree test, true_value, false_value;
+ tree lhs = NULL_TREE;
+ tree rhs = NULL_TREE;
+ /* In the end, we'll produce a COND_EXPR. Both arms of the
+ conditional expression will be binary operations. The left-hand
+ side of the expression to be executed if the condition is true
+ will be pointed to by TRUE_LHS. Similarly, the right-hand side
+ of the expression to be executed if the condition is true will be
+ pointed to by TRUE_RHS. FALSE_LHS and FALSE_RHS are analagous --
+ but apply to the expression to be executed if the conditional is
+ false. */
+ tree *true_lhs;
+ tree *true_rhs;
+ tree *false_lhs;
+ tree *false_rhs;
+ /* These are the codes to use for the left-hand side and right-hand
+ side of the COND_EXPR. Normally, they are the same as CODE. */
+ enum tree_code lhs_code = code;
+ enum tree_code rhs_code = code;
+ /* And these are the types of the expressions. */
+ tree lhs_type = type;
+ tree rhs_type = type;
+
+ if (cond_first_p)
+ {
+ true_rhs = false_rhs = &arg;
+ true_lhs = &true_value;
+ false_lhs = &false_value;
+ }
+ else
+ {
+ true_lhs = false_lhs = &arg;
+ true_rhs = &true_value;
+ false_rhs = &false_value;
+ }
+
+ if (TREE_CODE (cond) == COND_EXPR)
+ {
+ test = TREE_OPERAND (cond, 0);
+ true_value = TREE_OPERAND (cond, 1);
+ false_value = TREE_OPERAND (cond, 2);
+ /* If this operand throws an expression, then it does not make
+ sense to try to perform a logical or arithmetic operation
+ involving it. Instead of building `a + throw 3' for example,
+ we simply build `a, throw 3'. */
+ if (VOID_TYPE_P (TREE_TYPE (true_value)))
+ {
+ lhs_code = COMPOUND_EXPR;
+ if (!cond_first_p)
+ lhs_type = void_type_node;
+ }
+ if (VOID_TYPE_P (TREE_TYPE (false_value)))
+ {
+ rhs_code = COMPOUND_EXPR;
+ if (!cond_first_p)
+ rhs_type = void_type_node;
+ }
+ }
+ else
+ {
+ tree testtype = TREE_TYPE (cond);
+ test = cond;
+ true_value = convert (testtype, integer_one_node);
+ false_value = convert (testtype, integer_zero_node);
+ }
+
+ /* If ARG is complex we want to make sure we only evaluate
+ it once. Though this is only required if it is volatile, it
+ might be more efficient even if it is not. However, if we
+ succeed in folding one part to a constant, we do not need
+ to make this SAVE_EXPR. Since we do this optimization
+ primarily to see if we do end up with constant and this
+ SAVE_EXPR interferes with later optimizations, suppressing
+ it when we can is important.
+
+ If we are not in a function, we can't make a SAVE_EXPR, so don't
+ try to do so. Don't try to see if the result is a constant
+ if an arm is a COND_EXPR since we get exponential behavior
+ in that case. */
+
+ if (TREE_CODE (arg) != SAVE_EXPR && ! TREE_CONSTANT (arg)
+ && global_bindings_p () == 0
+ && ((TREE_CODE (arg) != VAR_DECL
+ && TREE_CODE (arg) != PARM_DECL)
+ || TREE_SIDE_EFFECTS (arg)))
+ {
+ if (TREE_CODE (true_value) != COND_EXPR)
+ lhs = fold (build (lhs_code, lhs_type, *true_lhs, *true_rhs));
+
+ if (TREE_CODE (false_value) != COND_EXPR)
+ rhs = fold (build (rhs_code, rhs_type, *false_lhs, *false_rhs));
+
+ if ((lhs == 0 || ! TREE_CONSTANT (lhs))
+ && (rhs == 0 || !TREE_CONSTANT (rhs)))
+ arg = save_expr (arg), lhs = rhs = 0;
+ }
+
+ if (lhs == 0)
+ lhs = fold (build (lhs_code, lhs_type, *true_lhs, *true_rhs));
+ if (rhs == 0)
+ rhs = fold (build (rhs_code, rhs_type, *false_lhs, *false_rhs));
+
+ test = fold (build (COND_EXPR, type, test, lhs, rhs));
+
+ if (TREE_CODE (arg) == SAVE_EXPR)
+ return build (COMPOUND_EXPR, type,
+ convert (void_type_node, arg),
+ strip_compound_expr (test, arg));
+ else
+ return convert (type, test);
+}
+
/* Perform constant folding and related simplification of EXPR.
The related simplifications include x*1 => x, x*0 => 0, etc.,
@@ -4912,70 +5049,9 @@ fold (expr)
&& (! TREE_SIDE_EFFECTS (arg0)
|| (global_bindings_p () == 0
&& ! contains_placeholder_p (arg0))))
- {
- tree test, true_value, false_value;
- tree lhs = 0, rhs = 0;
-
- if (TREE_CODE (arg1) == COND_EXPR)
- {
- test = TREE_OPERAND (arg1, 0);
- true_value = TREE_OPERAND (arg1, 1);
- false_value = TREE_OPERAND (arg1, 2);
- }
- else
- {
- tree testtype = TREE_TYPE (arg1);
- test = arg1;
- true_value = convert (testtype, integer_one_node);
- false_value = convert (testtype, integer_zero_node);
- }
-
- /* If ARG0 is complex we want to make sure we only evaluate
- it once. Though this is only required if it is volatile, it
- might be more efficient even if it is not. However, if we
- succeed in folding one part to a constant, we do not need
- to make this SAVE_EXPR. Since we do this optimization
- primarily to see if we do end up with constant and this
- SAVE_EXPR interferes with later optimizations, suppressing
- it when we can is important.
-
- If we are not in a function, we can't make a SAVE_EXPR, so don't
- try to do so. Don't try to see if the result is a constant
- if an arm is a COND_EXPR since we get exponential behavior
- in that case. */
-
- if (TREE_CODE (arg0) != SAVE_EXPR && ! TREE_CONSTANT (arg0)
- && global_bindings_p () == 0
- && ((TREE_CODE (arg0) != VAR_DECL
- && TREE_CODE (arg0) != PARM_DECL)
- || TREE_SIDE_EFFECTS (arg0)))
- {
- if (TREE_CODE (true_value) != COND_EXPR)
- lhs = fold (build (code, type, arg0, true_value));
-
- if (TREE_CODE (false_value) != COND_EXPR)
- rhs = fold (build (code, type, arg0, false_value));
-
- if ((lhs == 0 || ! TREE_CONSTANT (lhs))
- && (rhs == 0 || !TREE_CONSTANT (rhs)))
- arg0 = save_expr (arg0), lhs = rhs = 0;
- }
-
- if (lhs == 0)
- lhs = fold (build (code, type, arg0, true_value));
- if (rhs == 0)
- rhs = fold (build (code, type, arg0, false_value));
-
- test = fold (build (COND_EXPR, type, test, lhs, rhs));
-
- if (TREE_CODE (arg0) == SAVE_EXPR)
- return build (COMPOUND_EXPR, type,
- convert (void_type_node, arg0),
- strip_compound_expr (test, arg0));
- else
- return convert (type, test);
- }
-
+ return
+ fold_binary_op_with_conditional_arg (code, type, arg1, arg0,
+ /*cond_first_p=*/0);
else if (TREE_CODE (arg0) == COMPOUND_EXPR)
return build (COMPOUND_EXPR, type, TREE_OPERAND (arg0, 0),
fold (build (code, type, TREE_OPERAND (arg0, 1), arg1)));
@@ -4987,55 +5063,9 @@ fold (expr)
&& (! TREE_SIDE_EFFECTS (arg1)
|| (global_bindings_p () == 0
&& ! contains_placeholder_p (arg1))))
- {
- tree test, true_value, false_value;
- tree lhs = 0, rhs = 0;
-
- if (TREE_CODE (arg0) == COND_EXPR)
- {
- test = TREE_OPERAND (arg0, 0);
- true_value = TREE_OPERAND (arg0, 1);
- false_value = TREE_OPERAND (arg0, 2);
- }
- else
- {
- tree testtype = TREE_TYPE (arg0);
- test = arg0;
- true_value = convert (testtype, integer_one_node);
- false_value = convert (testtype, integer_zero_node);
- }
-
- if (TREE_CODE (arg1) != SAVE_EXPR && ! TREE_CONSTANT (arg0)
- && global_bindings_p () == 0
- && ((TREE_CODE (arg1) != VAR_DECL
- && TREE_CODE (arg1) != PARM_DECL)
- || TREE_SIDE_EFFECTS (arg1)))
- {
- if (TREE_CODE (true_value) != COND_EXPR)
- lhs = fold (build (code, type, true_value, arg1));
-
- if (TREE_CODE (false_value) != COND_EXPR)
- rhs = fold (build (code, type, false_value, arg1));
-
- if ((lhs == 0 || ! TREE_CONSTANT (lhs))
- && (rhs == 0 || !TREE_CONSTANT (rhs)))
- arg1 = save_expr (arg1), lhs = rhs = 0;
- }
-
- if (lhs == 0)
- lhs = fold (build (code, type, true_value, arg1));
-
- if (rhs == 0)
- rhs = fold (build (code, type, false_value, arg1));
-
- test = fold (build (COND_EXPR, type, test, lhs, rhs));
- if (TREE_CODE (arg1) == SAVE_EXPR)
- return build (COMPOUND_EXPR, type,
- convert (void_type_node, arg1),
- strip_compound_expr (test, arg1));
- else
- return convert (type, test);
- }
+ return
+ fold_binary_op_with_conditional_arg (code, type, arg0, arg1,
+ /*cond_first_p=*/1);
}
else if (TREE_CODE_CLASS (code) == '<'
&& TREE_CODE (arg0) == COMPOUND_EXPR)
@@ -5236,8 +5266,16 @@ fold (expr)
{
if (TREE_CODE (arg0) == INTEGER_CST)
{
- if (! TREE_UNSIGNED (type)
- && TREE_INT_CST_HIGH (arg0) < 0)
+ /* If the value is unsigned, then the absolute value is
+ the same as the ordinary value. */
+ if (TREE_UNSIGNED (type))
+ return arg0;
+ /* Similarly, if the value is non-negative. */
+ else if (INT_CST_LT (integer_minus_one_node, arg0))
+ return arg0;
+ /* If the value is negative, then the absolute value is
+ its negation. */
+ else
{
unsigned HOST_WIDE_INT low;
HOST_WIDE_INT high;
@@ -6566,7 +6604,9 @@ fold (expr)
else if (TREE_INT_CST_HIGH (arg1) == 0
&& (TREE_INT_CST_LOW (arg1)
== ((unsigned HOST_WIDE_INT) 1 << (width - 1)) - 1)
- && TREE_UNSIGNED (TREE_TYPE (arg1)))
+ && TREE_UNSIGNED (TREE_TYPE (arg1))
+ /* signed_type does not work on pointer types. */
+ && INTEGRAL_TYPE_P (TREE_TYPE (arg0)))
switch (TREE_CODE (t))
{
@@ -7249,6 +7289,25 @@ multiple_of_p (type, top, bottom)
return (multiple_of_p (type, TREE_OPERAND (top, 0), bottom)
&& multiple_of_p (type, TREE_OPERAND (top, 1), bottom));
+ case LSHIFT_EXPR:
+ if (TREE_CODE (TREE_OPERAND (top, 1)) == INTEGER_CST)
+ {
+ tree op1, t1;
+
+ op1 = TREE_OPERAND (top, 1);
+ /* const_binop may not detect overflow correctly,
+ so check for it explicitly here. */
+ if (TYPE_PRECISION (TREE_TYPE (size_one_node))
+ > TREE_INT_CST_LOW (op1)
+ && TREE_INT_CST_HIGH (op1) == 0
+ && 0 != (t1 = convert (type,
+ const_binop (LSHIFT_EXPR, size_one_node,
+ op1, 0)))
+ && ! TREE_OVERFLOW (t1))
+ return multiple_of_p (type, t1, bottom);
+ }
+ return 0;
+
case NOP_EXPR:
/* Can't handle conversions from non-integral or wider integral type. */
if ((TREE_CODE (TREE_TYPE (TREE_OPERAND (top, 0))) != INTEGER_TYPE)
@@ -7262,9 +7321,10 @@ multiple_of_p (type, top, bottom)
return multiple_of_p (type, TREE_OPERAND (top, 0), bottom);
case INTEGER_CST:
- if ((TREE_CODE (bottom) != INTEGER_CST)
- || (tree_int_cst_sgn (top) < 0)
- || (tree_int_cst_sgn (bottom) < 0))
+ if (TREE_CODE (bottom) != INTEGER_CST
+ || (TREE_UNSIGNED (type)
+ && (tree_int_cst_sgn (top) < 0
+ || tree_int_cst_sgn (bottom) < 0)))
return 0;
return integer_zerop (const_binop (TRUNC_MOD_EXPR,
top, bottom, 0));
diff --git a/gcc/frame-dwarf2.c b/gcc/frame-dwarf2.c
deleted file mode 100644
index 7fbcf87c6c8..00000000000
--- a/gcc/frame-dwarf2.c
+++ /dev/null
@@ -1,778 +0,0 @@
-/* Subroutines needed for unwinding DWARF 2 format stack frame info
- for exception handling. */
-/* Compile this one with gcc. */
-/* Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
- Contributed by Jason Merrill <jason@cygnus.com>.
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-In addition to the permissions in the GNU General Public License, the
-Free Software Foundation gives you unlimited permission to link the
-compiled version of this file into combinations with other programs,
-and to distribute those combinations without any restriction coming
-from the use of this file. (The General Public License restrictions
-do apply in other respects; for example, they cover modification of
-the file, and distribution when not linked into a combine
-executable.)
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* It is incorrect to include config.h here, because this file is being
- compiled for the target, and hence definitions concerning only the host
- do not apply. */
-
-#include "tconfig.h"
-#include "tsystem.h"
-
-#ifdef DWARF2_UNWIND_INFO
-#include "dwarf2.h"
-#include "frame.h"
-#include "gthr.h"
-
-#ifdef __GTHREAD_MUTEX_INIT
-static __gthread_mutex_t object_mutex = __GTHREAD_MUTEX_INIT;
-#else
-static __gthread_mutex_t object_mutex;
-#endif
-
-/* Don't use `fancy_abort' here even if config.h says to use it. */
-#ifdef abort
-#undef abort
-#endif
-
-/* Some types used by the DWARF 2 spec. */
-
-typedef int sword __attribute__ ((mode (SI)));
-typedef unsigned int uword __attribute__ ((mode (SI)));
-typedef unsigned int uaddr __attribute__ ((mode (pointer)));
-typedef int saddr __attribute__ ((mode (pointer)));
-typedef unsigned char ubyte;
-
-/* Terminology:
- CIE - Common Information Element
- FDE - Frame Descriptor Element
-
- There is one per function, and it describes where the function code
- is located, and what the register lifetimes and stack layout are
- within the function.
-
- The data structures are defined in the DWARF specfication, although
- not in a very readable way (see LITERATURE).
-
- Every time an exception is thrown, the code needs to locate the FDE
- for the current function, and starts to look for exception regions
- from that FDE. This works in a two-level search:
- a) in a linear search, find the shared image (i.e. DLL) containing
- the PC
- b) using the FDE table for that shared object, locate the FDE using
- binary search (which requires the sorting). */
-
-/* The first few fields of a CIE. The CIE_id field is 0 for a CIE,
- to distinguish it from a valid FDE. FDEs are aligned to an addressing
- unit boundary, but the fields within are unaligned. */
-
-struct dwarf_cie {
- uword length;
- sword CIE_id;
- ubyte version;
- char augmentation[0];
-} __attribute__ ((packed, aligned (__alignof__ (void *))));
-
-/* The first few fields of an FDE. */
-
-struct dwarf_fde {
- uword length;
- sword CIE_delta;
- void* pc_begin;
- uaddr pc_range;
-} __attribute__ ((packed, aligned (__alignof__ (void *))));
-
-typedef struct dwarf_fde fde;
-
-/* Objects to be searched for frame unwind info. */
-
-static struct object *objects;
-
-/* The information we care about from a CIE. */
-
-struct cie_info {
- char *augmentation;
- void *eh_ptr;
- int code_align;
- int data_align;
- unsigned ra_regno;
-};
-
-/* The current unwind state, plus a saved copy for DW_CFA_remember_state. */
-
-struct frame_state_internal
-{
- struct frame_state s;
- struct frame_state_internal *saved_state;
-};
-
-/* This is undefined below if we need it to be an actual function. */
-#define init_object_mutex_once()
-
-#if __GTHREADS
-#ifdef __GTHREAD_MUTEX_INIT_FUNCTION
-
-/* Helper for init_object_mutex_once. */
-
-static void
-init_object_mutex (void)
-{
- __GTHREAD_MUTEX_INIT_FUNCTION (&object_mutex);
-}
-
-/* Call this to arrange to initialize the object mutex. */
-
-#undef init_object_mutex_once
-static void
-init_object_mutex_once (void)
-{
- static __gthread_once_t once = __GTHREAD_ONCE_INIT;
- __gthread_once (&once, init_object_mutex);
-}
-
-#endif /* __GTHREAD_MUTEX_INIT_FUNCTION */
-#endif /* __GTHREADS */
-
-/* Decode the unsigned LEB128 constant at BUF into the variable pointed to
- by R, and return the new value of BUF. */
-
-static void *
-decode_uleb128 (unsigned char *buf, unsigned *r)
-{
- unsigned shift = 0;
- unsigned result = 0;
-
- while (1)
- {
- unsigned byte = *buf++;
- result |= (byte & 0x7f) << shift;
- if ((byte & 0x80) == 0)
- break;
- shift += 7;
- }
- *r = result;
- return buf;
-}
-
-/* Decode the signed LEB128 constant at BUF into the variable pointed to
- by R, and return the new value of BUF. */
-
-static void *
-decode_sleb128 (unsigned char *buf, int *r)
-{
- unsigned shift = 0;
- unsigned result = 0;
- unsigned byte;
-
- while (1)
- {
- byte = *buf++;
- result |= (byte & 0x7f) << shift;
- shift += 7;
- if ((byte & 0x80) == 0)
- break;
- }
- if (shift < (sizeof (*r) * 8) && (byte & 0x40) != 0)
- result |= - (1 << shift);
-
- *r = result;
- return buf;
-}
-
-/* Read unaligned data from the instruction buffer. */
-
-union unaligned {
- void *p;
- unsigned b2 __attribute__ ((mode (HI)));
- unsigned b4 __attribute__ ((mode (SI)));
- unsigned b8 __attribute__ ((mode (DI)));
-} __attribute__ ((packed));
-static inline void *
-read_pointer (void *p)
-{ union unaligned *up = p; return up->p; }
-static inline unsigned
-read_1byte (void *p)
-{ return *(unsigned char *)p; }
-static inline unsigned
-read_2byte (void *p)
-{ union unaligned *up = p; return up->b2; }
-static inline unsigned
-read_4byte (void *p)
-{ union unaligned *up = p; return up->b4; }
-static inline unsigned long
-read_8byte (void *p)
-{ union unaligned *up = p; return up->b8; }
-
-/* Ordering function for FDEs. Functions can't overlap, so we just compare
- their starting addresses. */
-
-static inline saddr
-fde_compare (fde *x, fde *y)
-{
- return (saddr)x->pc_begin - (saddr)y->pc_begin;
-}
-
-/* Return the address of the FDE after P. */
-
-static inline fde *
-next_fde (fde *p)
-{
- return (fde *)(((char *)p) + p->length + sizeof (p->length));
-}
-
-#include "frame.c"
-
-static size_t
-count_fdes (fde *this_fde)
-{
- size_t count;
-
- for (count = 0; this_fde->length != 0; this_fde = next_fde (this_fde))
- {
- /* Skip CIEs and linked once FDE entries. */
- if (this_fde->CIE_delta == 0 || this_fde->pc_begin == 0)
- continue;
-
- ++count;
- }
-
- return count;
-}
-
-static void
-add_fdes (fde *this_fde, fde_accumulator *accu, void **beg_ptr, void **end_ptr)
-{
- void *pc_begin = *beg_ptr;
- void *pc_end = *end_ptr;
-
- for (; this_fde->length != 0; this_fde = next_fde (this_fde))
- {
- /* Skip CIEs and linked once FDE entries. */
- if (this_fde->CIE_delta == 0 || this_fde->pc_begin == 0)
- continue;
-
- fde_insert (accu, this_fde);
-
- if (this_fde->pc_begin < pc_begin)
- pc_begin = this_fde->pc_begin;
- if (this_fde->pc_begin + this_fde->pc_range > pc_end)
- pc_end = this_fde->pc_begin + this_fde->pc_range;
- }
-
- *beg_ptr = pc_begin;
- *end_ptr = pc_end;
-}
-
-/* search this fde table for the one containing the pc */
-static fde *
-search_fdes (fde *this_fde, void *pc)
-{
- for (; this_fde->length != 0; this_fde = next_fde (this_fde))
- {
- /* Skip CIEs and linked once FDE entries. */
- if (this_fde->CIE_delta == 0 || this_fde->pc_begin == 0)
- continue;
-
- if ((uaddr)((char *)pc - (char *)this_fde->pc_begin) < this_fde->pc_range)
- return this_fde;
- }
- return NULL;
-}
-
-/* Set up a sorted array of pointers to FDEs for a loaded object. We
- count up the entries before allocating the array because it's likely to
- be faster. We can be called multiple times, should we have failed to
- allocate a sorted fde array on a previous occasion. */
-
-static void
-frame_init (struct object* ob)
-{
- size_t count;
- fde_accumulator accu;
- void *pc_begin, *pc_end;
- fde **array;
-
- if (ob->pc_begin)
- count = ob->count;
- else if (ob->fde_array)
- {
- fde **p = ob->fde_array;
- for (count = 0; *p; ++p)
- count += count_fdes (*p);
- }
- else
- count = count_fdes (ob->fde_begin);
- ob->count = count;
-
- if (!start_fde_sort (&accu, count) && ob->pc_begin)
- return;
-
- pc_begin = (void*)(uaddr)-1;
- pc_end = 0;
-
- if (ob->fde_array)
- {
- fde **p = ob->fde_array;
- for (; *p; ++p)
- add_fdes (*p, &accu, &pc_begin, &pc_end);
- }
- else
- add_fdes (ob->fde_begin, &accu, &pc_begin, &pc_end);
-
- array = end_fde_sort (&accu, count);
- if (array)
- ob->fde_array = array;
- ob->pc_begin = pc_begin;
- ob->pc_end = pc_end;
-}
-
-/* Return a pointer to the FDE for the function containing PC. */
-
-static fde *
-find_fde (void *pc)
-{
- struct object *ob;
- size_t lo, hi;
-
- init_object_mutex_once ();
- __gthread_mutex_lock (&object_mutex);
-
- /* Linear search through the objects, to find the one containing the pc. */
- for (ob = objects; ob; ob = ob->next)
- {
- if (ob->pc_begin == 0)
- frame_init (ob);
- if (pc >= ob->pc_begin && pc < ob->pc_end)
- break;
- }
-
- if (ob == 0)
- {
- __gthread_mutex_unlock (&object_mutex);
- return 0;
- }
-
- if (!ob->fde_array || (void *)ob->fde_array == (void *)ob->fde_begin)
- frame_init (ob);
-
- if (ob->fde_array && (void *)ob->fde_array != (void *)ob->fde_begin)
- {
- __gthread_mutex_unlock (&object_mutex);
-
- /* Standard binary search algorithm. */
- for (lo = 0, hi = ob->count; lo < hi; )
- {
- size_t i = (lo + hi) / 2;
- fde *f = ob->fde_array[i];
-
- if (pc < f->pc_begin)
- hi = i;
- else if (pc >= f->pc_begin + f->pc_range)
- lo = i + 1;
- else
- return f;
- }
- }
- else
- {
- /* Long slow labourious linear search, cos we've no memory. */
- fde *f;
-
- if (ob->fde_array)
- {
- fde **p = ob->fde_array;
-
- do
- {
- f = search_fdes (*p, pc);
- if (f)
- break;
- p++;
- }
- while (*p);
- }
- else
- f = search_fdes (ob->fde_begin, pc);
- __gthread_mutex_unlock (&object_mutex);
- return f;
- }
- return 0;
-}
-
-static inline struct dwarf_cie *
-get_cie (fde *f)
-{
- return ((void *)&f->CIE_delta) - f->CIE_delta;
-}
-
-/* Extract any interesting information from the CIE for the translation
- unit F belongs to. */
-
-static void *
-extract_cie_info (fde *f, struct cie_info *c)
-{
- void *p;
- int i;
-
- c->augmentation = get_cie (f)->augmentation;
-
- if (strcmp (c->augmentation, "") != 0
- && strcmp (c->augmentation, "eh") != 0
- && c->augmentation[0] != 'z')
- return 0;
-
- p = c->augmentation + strlen (c->augmentation) + 1;
-
- if (strcmp (c->augmentation, "eh") == 0)
- {
- c->eh_ptr = read_pointer (p);
- p += sizeof (void *);
- }
- else
- c->eh_ptr = 0;
-
- p = decode_uleb128 (p, &c->code_align);
- p = decode_sleb128 (p, &c->data_align);
- c->ra_regno = *(unsigned char *)p++;
-
- /* If the augmentation starts with 'z', we now see the length of the
- augmentation fields. */
- if (c->augmentation[0] == 'z')
- {
- p = decode_uleb128 (p, &i);
- p += i;
- }
-
- return p;
-}
-
-/* Decode a DW_OP stack operation. */
-
-static void *
-decode_stack_op (unsigned char *buf, struct frame_state *state)
-{
- enum dwarf_location_atom op;
- int offset;
-
- op = *buf++;
- switch (op)
- {
- case DW_OP_reg0:
- case DW_OP_reg1:
- case DW_OP_reg2:
- case DW_OP_reg3:
- case DW_OP_reg4:
- case DW_OP_reg5:
- case DW_OP_reg6:
- case DW_OP_reg7:
- case DW_OP_reg8:
- case DW_OP_reg9:
- case DW_OP_reg10:
- case DW_OP_reg11:
- case DW_OP_reg12:
- case DW_OP_reg13:
- case DW_OP_reg14:
- case DW_OP_reg15:
- case DW_OP_reg16:
- case DW_OP_reg17:
- case DW_OP_reg18:
- case DW_OP_reg19:
- case DW_OP_reg20:
- case DW_OP_reg21:
- case DW_OP_reg22:
- case DW_OP_reg23:
- case DW_OP_reg24:
- case DW_OP_reg25:
- case DW_OP_reg26:
- case DW_OP_reg27:
- case DW_OP_reg28:
- case DW_OP_reg29:
- case DW_OP_reg30:
- case DW_OP_reg31:
- state->cfa_reg = op - DW_OP_reg0;
- break;
- case DW_OP_regx:
- buf = decode_sleb128 (buf, &offset);
- state->cfa_reg = offset;
- break;
- case DW_OP_breg0:
- case DW_OP_breg1:
- case DW_OP_breg2:
- case DW_OP_breg3:
- case DW_OP_breg4:
- case DW_OP_breg5:
- case DW_OP_breg6:
- case DW_OP_breg7:
- case DW_OP_breg8:
- case DW_OP_breg9:
- case DW_OP_breg10:
- case DW_OP_breg11:
- case DW_OP_breg12:
- case DW_OP_breg13:
- case DW_OP_breg14:
- case DW_OP_breg15:
- case DW_OP_breg16:
- case DW_OP_breg17:
- case DW_OP_breg18:
- case DW_OP_breg19:
- case DW_OP_breg20:
- case DW_OP_breg21:
- case DW_OP_breg22:
- case DW_OP_breg23:
- case DW_OP_breg24:
- case DW_OP_breg25:
- case DW_OP_breg26:
- case DW_OP_breg27:
- case DW_OP_breg28:
- case DW_OP_breg29:
- case DW_OP_breg30:
- case DW_OP_breg31:
- state->cfa_reg = op - DW_OP_breg0;
- buf = decode_sleb128 (buf, &offset);
- state->base_offset = offset;
- break;
- case DW_OP_bregx:
- buf = decode_sleb128 (buf, &offset);
- state->cfa_reg = offset;
- buf = decode_sleb128 (buf, &offset);
- state->base_offset = offset;
- break;
- case DW_OP_deref:
- state->indirect = 1;
- break;
- case DW_OP_plus_uconst:
- buf = decode_uleb128 (buf, &offset);
- state->cfa_offset = offset;
- break;
- default:
- abort ();
- }
- return buf;
-}
-/* Decode one instruction's worth of DWARF 2 call frame information.
- Used by __frame_state_for. Takes pointers P to the instruction to
- decode, STATE to the current register unwind information, INFO to the
- current CIE information, and PC to the current PC value. Returns a
- pointer to the next instruction. */
-
-static void *
-execute_cfa_insn (void *p, struct frame_state_internal *state,
- struct cie_info *info, void **pc)
-{
- unsigned insn = *(unsigned char *)p++;
- unsigned reg;
- int offset;
-
- if (insn & DW_CFA_advance_loc)
- *pc += ((insn & 0x3f) * info->code_align);
- else if (insn & DW_CFA_offset)
- {
- reg = (insn & 0x3f);
- p = decode_uleb128 (p, &offset);
- if (reg == state->s.cfa_reg)
- /* Don't record anything about this register; it's only used to
- reload SP in the epilogue. We don't want to copy in SP
- values for outer frames; we handle restoring SP specially. */;
- else
- {
- offset *= info->data_align;
- state->s.saved[reg] = REG_SAVED_OFFSET;
- state->s.reg_or_offset[reg] = offset;
- }
- }
- else if (insn & DW_CFA_restore)
- {
- reg = (insn & 0x3f);
- state->s.saved[reg] = REG_UNSAVED;
- }
- else switch (insn)
- {
- case DW_CFA_set_loc:
- *pc = read_pointer (p);
- p += sizeof (void *);
- break;
- case DW_CFA_advance_loc1:
- *pc += read_1byte (p);
- p += 1;
- break;
- case DW_CFA_advance_loc2:
- *pc += read_2byte (p);
- p += 2;
- break;
- case DW_CFA_advance_loc4:
- *pc += read_4byte (p);
- p += 4;
- break;
-
- case DW_CFA_offset_extended:
- p = decode_uleb128 (p, &reg);
- p = decode_uleb128 (p, &offset);
- if (reg == state->s.cfa_reg)
- /* Don't record anything; see above. */;
- else
- {
- offset *= info->data_align;
- state->s.saved[reg] = REG_SAVED_OFFSET;
- state->s.reg_or_offset[reg] = offset;
- }
- break;
- case DW_CFA_restore_extended:
- p = decode_uleb128 (p, &reg);
- state->s.saved[reg] = REG_UNSAVED;
- break;
-
- case DW_CFA_undefined:
- case DW_CFA_same_value:
- case DW_CFA_nop:
- break;
-
- case DW_CFA_register:
- {
- unsigned reg2;
- p = decode_uleb128 (p, &reg);
- p = decode_uleb128 (p, &reg2);
- state->s.saved[reg] = REG_SAVED_REG;
- state->s.reg_or_offset[reg] = reg2;
- }
- break;
-
- case DW_CFA_def_cfa:
- p = decode_uleb128 (p, &reg);
- p = decode_uleb128 (p, &offset);
- state->s.cfa_reg = reg;
- state->s.cfa_offset = offset;
- break;
- case DW_CFA_def_cfa_register:
- p = decode_uleb128 (p, &reg);
- state->s.cfa_reg = reg;
- break;
- case DW_CFA_def_cfa_offset:
- p = decode_uleb128 (p, &offset);
- state->s.cfa_offset = offset;
- break;
- case DW_CFA_def_cfa_expression:
- {
- void *end;
- state->s.cfa_reg = 0;
- state->s.cfa_offset = 0;
- state->s.base_offset = 0;
- state->s.indirect = 0;
-
- p = decode_uleb128 (p, &offset);
- end = p + offset;
- while (p < end)
- p = decode_stack_op (p, &(state->s));
- break;
- }
-
- case DW_CFA_remember_state:
- {
- struct frame_state_internal *save =
- (struct frame_state_internal *)
- malloc (sizeof (struct frame_state_internal));
- memcpy (save, state, sizeof (struct frame_state_internal));
- state->saved_state = save;
- }
- break;
- case DW_CFA_restore_state:
- {
- struct frame_state_internal *save = state->saved_state;
- memcpy (state, save, sizeof (struct frame_state_internal));
- free (save);
- }
- break;
-
- /* FIXME: Hardcoded for SPARC register window configuration. */
- case DW_CFA_GNU_window_save:
- for (reg = 16; reg < 32; ++reg)
- {
- state->s.saved[reg] = REG_SAVED_OFFSET;
- state->s.reg_or_offset[reg] = (reg - 16) * sizeof (void *);
- }
- break;
-
- case DW_CFA_GNU_args_size:
- p = decode_uleb128 (p, &offset);
- state->s.args_size = offset;
- break;
-
- case DW_CFA_GNU_negative_offset_extended:
- p = decode_uleb128 (p, &reg);
- p = decode_uleb128 (p, &offset);
- offset *= info->data_align;
- state->s.saved[reg] = REG_SAVED_OFFSET;
- state->s.reg_or_offset[reg] = -offset;
- break;
-
- default:
- abort ();
- }
- return p;
-}
-
-/* Called from __throw to find the registers to restore for a given
- PC_TARGET. The caller should allocate a local variable of `struct
- frame_state' (declared in frame.h) and pass its address to STATE_IN. */
-
-struct frame_state *
-__frame_state_for (void *pc_target, struct frame_state *state_in)
-{
- fde *f;
- void *insn, *end, *pc;
- struct cie_info info;
- struct frame_state_internal state;
-
- f = find_fde (pc_target);
- if (f == 0)
- return 0;
-
- insn = extract_cie_info (f, &info);
- if (insn == 0)
- return 0;
-
- memset (&state, 0, sizeof (state));
- state.s.retaddr_column = info.ra_regno;
- state.s.eh_ptr = info.eh_ptr;
-
- /* First decode all the insns in the CIE. */
- end = next_fde ((fde*) get_cie (f));
- while (insn < end)
- insn = execute_cfa_insn (insn, &state, &info, 0);
-
- insn = ((fde *)f) + 1;
-
- if (info.augmentation[0] == 'z')
- {
- int i;
- insn = decode_uleb128 (insn, &i);
- insn += i;
- }
-
- /* Then the insns in the FDE up to our target PC. */
- end = next_fde (f);
- pc = f->pc_begin;
- while (insn < end && pc <= pc_target)
- insn = execute_cfa_insn (insn, &state, &info, &pc);
-
- memcpy (state_in, &state.s, sizeof (state.s));
- return state_in;
-}
-#endif /* DWARF2_UNWIND_INFO */
diff --git a/gcc/frame.c b/gcc/frame.c
deleted file mode 100644
index 399df577ff0..00000000000
--- a/gcc/frame.c
+++ /dev/null
@@ -1,337 +0,0 @@
-/* Subroutines needed for unwinding stack frames for exception handling. */
-/* Compile this one with gcc. */
-/* Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
- Contributed by Jason Merrill <jason@cygnus.com>.
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-In addition to the permissions in the GNU General Public License, the
-Free Software Foundation gives you unlimited permission to link the
-compiled version of this file into combinations with other programs,
-and to distribute those combinations without any restriction coming
-from the use of this file. (The General Public License restrictions
-do apply in other respects; for example, they cover modification of
-the file, and distribution when not linked into a combine
-executable.)
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* Sorting an array of FDEs by address.
- (Ideally we would have the linker sort the FDEs so we don't have to do
- it at run time. But the linkers are not yet prepared for this.) */
-
-/* This is a special mix of insertion sort and heap sort, optimized for
- the data sets that actually occur. They look like
- 101 102 103 127 128 105 108 110 190 111 115 119 125 160 126 129 130.
- I.e. a linearly increasing sequence (coming from functions in the text
- section), with additionally a few unordered elements (coming from functions
- in gnu_linkonce sections) whose values are higher than the values in the
- surrounding linear sequence (but not necessarily higher than the values
- at the end of the linear sequence!).
- The worst-case total run time is O(N) + O(n log (n)), where N is the
- total number of FDEs and n is the number of erratic ones. */
-
-typedef struct fde_vector
-{
- fde **array;
- size_t count;
-} fde_vector;
-
-typedef struct fde_accumulator
-{
- fde_vector linear;
- fde_vector erratic;
-} fde_accumulator;
-
-static inline int
-start_fde_sort (fde_accumulator *accu, size_t count)
-{
- accu->linear.array = count ? (fde **) malloc (sizeof (fde *) * count) : NULL;
- accu->erratic.array = accu->linear.array ?
- (fde **) malloc (sizeof (fde *) * count) : NULL;
- accu->linear.count = 0;
- accu->erratic.count = 0;
-
- return accu->linear.array != NULL;
-}
-
-static inline void
-fde_insert (fde_accumulator *accu, fde *this_fde)
-{
- if (accu->linear.array)
- accu->linear.array[accu->linear.count++] = this_fde;
-}
-
-/* Split LINEAR into a linear sequence with low values and an erratic
- sequence with high values, put the linear one (of longest possible
- length) into LINEAR and the erratic one into ERRATIC. This is O(N).
-
- Because the longest linear sequence we are trying to locate within the
- incoming LINEAR array can be interspersed with (high valued) erratic
- entries. We construct a chain indicating the sequenced entries.
- To avoid having to allocate this chain, we overlay it onto the space of
- the ERRATIC array during construction. A final pass iterates over the
- chain to determine what should be placed in the ERRATIC array, and
- what is the linear sequence. This overlay is safe from aliasing. */
-static inline void
-fde_split (fde_vector *linear, fde_vector *erratic)
-{
- static fde *marker;
- size_t count = linear->count;
- fde **chain_end = &marker;
- size_t i, j, k;
-
- /* This should optimize out, but it is wise to make sure this assumption
- is correct. Should these have different sizes, we cannot cast between
- them and the overlaying onto ERRATIC will not work. */
- if (sizeof (fde *) != sizeof (fde **))
- abort ();
-
- for (i = 0; i < count; i++)
- {
- fde **probe;
-
- for (probe = chain_end;
- probe != &marker && fde_compare (linear->array[i], *probe) < 0;
- probe = chain_end)
- {
- chain_end = (fde **)erratic->array[probe - linear->array];
- erratic->array[probe - linear->array] = NULL;
- }
- erratic->array[i] = (fde *)chain_end;
- chain_end = &linear->array[i];
- }
-
- /* Each entry in LINEAR which is part of the linear sequence we have
- discovered will correspond to a non-NULL entry in the chain we built in
- the ERRATIC array. */
- for (i = j = k = 0; i < count; i++)
- if (erratic->array[i])
- linear->array[j++] = linear->array[i];
- else
- erratic->array[k++] = linear->array[i];
- linear->count = j;
- erratic->count = k;
-}
-
-/* This is O(n log(n)). BSD/OS defines heapsort in stdlib.h, so we must
- use a name that does not conflict. */
-static inline void
-frame_heapsort (fde_vector *erratic)
-{
- /* For a description of this algorithm, see:
- Samuel P. Harbison, Guy L. Steele Jr.: C, a reference manual, 2nd ed.,
- p. 60-61. */
- fde ** a = erratic->array;
- /* A portion of the array is called a "heap" if for all i>=0:
- If i and 2i+1 are valid indices, then a[i] >= a[2i+1].
- If i and 2i+2 are valid indices, then a[i] >= a[2i+2]. */
-#define SWAP(x,y) do { fde * tmp = x; x = y; y = tmp; } while (0)
- size_t n = erratic->count;
- size_t m = n;
- size_t i;
-
- while (m > 0)
- {
- /* Invariant: a[m..n-1] is a heap. */
- m--;
- for (i = m; 2*i+1 < n; )
- {
- if (2*i+2 < n
- && fde_compare (a[2*i+2], a[2*i+1]) > 0
- && fde_compare (a[2*i+2], a[i]) > 0)
- {
- SWAP (a[i], a[2*i+2]);
- i = 2*i+2;
- }
- else if (fde_compare (a[2*i+1], a[i]) > 0)
- {
- SWAP (a[i], a[2*i+1]);
- i = 2*i+1;
- }
- else
- break;
- }
- }
- while (n > 1)
- {
- /* Invariant: a[0..n-1] is a heap. */
- n--;
- SWAP (a[0], a[n]);
- for (i = 0; 2*i+1 < n; )
- {
- if (2*i+2 < n
- && fde_compare (a[2*i+2], a[2*i+1]) > 0
- && fde_compare (a[2*i+2], a[i]) > 0)
- {
- SWAP (a[i], a[2*i+2]);
- i = 2*i+2;
- }
- else if (fde_compare (a[2*i+1], a[i]) > 0)
- {
- SWAP (a[i], a[2*i+1]);
- i = 2*i+1;
- }
- else
- break;
- }
- }
-#undef SWAP
-}
-
-/* Merge V1 and V2, both sorted, and put the result into V1. */
-static void
-fde_merge (fde_vector *v1, const fde_vector *v2)
-{
- size_t i1, i2;
- fde * fde2;
-
- i2 = v2->count;
- if (i2 > 0)
- {
- i1 = v1->count;
- do {
- i2--;
- fde2 = v2->array[i2];
- while (i1 > 0 && fde_compare (v1->array[i1-1], fde2) > 0)
- {
- v1->array[i1+i2] = v1->array[i1-1];
- i1--;
- }
- v1->array[i1+i2] = fde2;
- } while (i2 > 0);
- v1->count += v2->count;
- }
-}
-
-static fde **
-end_fde_sort (fde_accumulator *accu, size_t count)
-{
- if (accu->linear.array && accu->linear.count != count)
- abort ();
-
- if (accu->erratic.array)
- {
- fde_split (&accu->linear, &accu->erratic);
- if (accu->linear.count + accu->erratic.count != count)
- abort ();
- frame_heapsort (&accu->erratic);
- fde_merge (&accu->linear, &accu->erratic);
- free (accu->erratic.array);
- }
- else
- {
- /* We've not managed to malloc an erratic array, so heap sort in the
- linear one. */
- frame_heapsort (&accu->linear);
- }
- return accu->linear.array;
-}
-
-/* Called from crtbegin.o to register the unwind info for an object. */
-
-void
-__register_frame_info (void *begin, struct object *ob)
-{
- ob->fde_begin = begin;
-
- ob->pc_begin = ob->pc_end = 0;
- ob->fde_array = 0;
- ob->count = 0;
-
- init_object_mutex_once ();
- __gthread_mutex_lock (&object_mutex);
-
- ob->next = objects;
- objects = ob;
-
- __gthread_mutex_unlock (&object_mutex);
-}
-
-void
-__register_frame (void *begin)
-{
- struct object *ob = (struct object *) malloc (sizeof (struct object));
- __register_frame_info (begin, ob);
-}
-
-/* Similar, but BEGIN is actually a pointer to a table of unwind entries
- for different translation units. Called from the file generated by
- collect2. */
-
-void
-__register_frame_info_table (void *begin, struct object *ob)
-{
- ob->fde_begin = begin;
- ob->fde_array = begin;
-
- ob->pc_begin = ob->pc_end = 0;
- ob->count = 0;
-
- init_object_mutex_once ();
- __gthread_mutex_lock (&object_mutex);
-
- ob->next = objects;
- objects = ob;
-
- __gthread_mutex_unlock (&object_mutex);
-}
-
-void
-__register_frame_table (void *begin)
-{
- struct object *ob = (struct object *) malloc (sizeof (struct object));
- __register_frame_info_table (begin, ob);
-}
-
-/* Called from crtbegin.o to deregister the unwind info for an object. */
-
-void *
-__deregister_frame_info (void *begin)
-{
- struct object **p;
-
- init_object_mutex_once ();
- __gthread_mutex_lock (&object_mutex);
-
- p = &objects;
- while (*p)
- {
- if ((*p)->fde_begin == begin)
- {
- struct object *ob = *p;
- *p = (*p)->next;
-
- /* If we've run init_frame for this object, free the FDE array. */
- if (ob->fde_array && ob->fde_array != begin)
- free (ob->fde_array);
-
- __gthread_mutex_unlock (&object_mutex);
- return (void *) ob;
- }
- p = &((*p)->next);
- }
-
- __gthread_mutex_unlock (&object_mutex);
- abort ();
-}
-
-void
-__deregister_frame (void *begin)
-{
- free (__deregister_frame_info (begin));
-}
-
diff --git a/gcc/frame.h b/gcc/frame.h
deleted file mode 100644
index 2257d5256c5..00000000000
--- a/gcc/frame.h
+++ /dev/null
@@ -1,287 +0,0 @@
-/* Header file for unwinding stack frames for exception handling. */
-/* Compile this one with gcc. */
-/* Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
- Contributed by Jason Merrill <jason@cygnus.com>.
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-
-#ifndef DWARF_FRAME_REGISTERS
-#define DWARF_FRAME_REGISTERS FIRST_PSEUDO_REGISTER
-#endif
-
-typedef struct frame_state
-{
- void *cfa;
- void *eh_ptr;
- long cfa_offset;
- long args_size;
- long reg_or_offset[DWARF_FRAME_REGISTERS+1];
- unsigned short cfa_reg;
- unsigned short retaddr_column;
- char saved[DWARF_FRAME_REGISTERS+1];
- long base_offset;
- char indirect;
-} frame_state;
-
-/* Values for 'saved' above. */
-#define REG_UNSAVED 0
-#define REG_SAVED_OFFSET 1
-#define REG_SAVED_REG 2
-
-/* The representation for an "object" to be searched for frame unwind info.
- For targets with named sections, one object is an executable or shared
- library; for other targets, one object is one translation unit.
-
- A copy of this structure declaration is printed by collect2.c;
- keep the copies synchronized! */
-
-struct object {
-#ifdef IA64_UNWIND_INFO
- void *pc_base; /* This field will be set by find_fde. */
-#endif
- void *pc_begin;
- void *pc_end;
- struct dwarf_fde *fde_begin;
-#ifdef IA64_UNWIND_INFO
- struct dwarf_fde *fde_end;
-#endif
- struct dwarf_fde **fde_array;
- size_t count;
- struct object *next;
-};
-
-/* Note the following routines are exported interfaces from libgcc; do not
- change these interfaces. Instead create new interfaces. Also note
- references to these functions may be made weak in files where they
- are referenced. */
-
-extern void __register_frame (void * );
-extern void __register_frame_table (void *);
-extern void __deregister_frame (void *);
-
-/* Called either from crtbegin.o or a static constructor to register the
- unwind info for an object or translation unit, respectively. */
-
-extern void __register_frame_info (void *, struct object *);
-
-/* Similar, but BEGIN is actually a pointer to a table of unwind entries
- for different translation units. Called from the file generated by
- collect2. */
-extern void __register_frame_info_table (void *, struct object *);
-
-/* Called from crtend.o to deregister the unwind info for an object. */
-
-extern void *__deregister_frame_info (void *);
-
-/* Called from __throw to find the registers to restore for a given
- PC_TARGET. The caller should allocate a local variable of `struct
- frame_state' (declared in frame.h) and pass its address to STATE_IN.
- Returns NULL on failure, otherwise returns STATE_IN. */
-
-extern struct frame_state *__frame_state_for (void *, struct frame_state *);
-
-#ifdef IA64_UNWIND_INFO
-
-/* This is the information required for unwind records in an ia64
- object file. This is required by GAS and the compiler runtime. */
-
-/* These are the starting point masks for the various types of
- unwind records. To create a record of type R3 for instance, one
- starts by using the value UNW_R3 and or-ing in any other required values.
- These values are also unique (in context), so they can be used to identify
- the various record types as well. UNW_Bx and some UNW_Px do have the
- same value, but Px can only occur in a prologue context, and Bx in
- a body context. */
-
-#define UNW_R1 0x00
-#define UNW_R2 0x40
-#define UNW_R3 0x60
-#define UNW_P1 0x80
-#define UNW_P2 0xA0
-#define UNW_P3 0xB0
-#define UNW_P4 0xB8
-#define UNW_P5 0xB9
-#define UNW_P6 0xC0
-#define UNW_P7 0xE0
-#define UNW_P8 0xF0
-#define UNW_P9 0xF1
-#define UNW_P10 0xFF
-#define UNW_X1 0xF9
-#define UNW_X2 0xFA
-#define UNW_X3 0xFB
-#define UNW_X4 0xFC
-#define UNW_B1 0x80
-#define UNW_B2 0xC0
-#define UNW_B3 0xE0
-#define UNW_B4 0xF0
-
-/* These are all the various types of unwind records. */
-
-typedef enum
-{
- prologue, prologue_gr, body, mem_stack_f, mem_stack_v, psp_gr, psp_sprel,
- rp_when, rp_gr, rp_br, rp_psprel, rp_sprel, pfs_when, pfs_gr, pfs_psprel,
- pfs_sprel, preds_when, preds_gr, preds_psprel, preds_sprel,
- fr_mem, frgr_mem, gr_gr, gr_mem, br_mem, br_gr, spill_base, spill_mask,
- unat_when, unat_gr, unat_psprel, unat_sprel, lc_when, lc_gr, lc_psprel,
- lc_sprel, fpsr_when, fpsr_gr, fpsr_psprel, fpsr_sprel,
- priunat_when_gr, priunat_when_mem, priunat_gr, priunat_psprel,
- priunat_sprel, bsp_when, bsp_gr, bsp_psprel, bsp_sprel, bspstore_when,
- bspstore_gr, bspstore_psprel, bspstore_sprel, rnat_when, rnat_gr,
- rnat_psprel, rnat_sprel, epilogue, label_state, copy_state,
- spill_psprel, spill_sprel, spill_reg, spill_psprel_p, spill_sprel_p,
- spill_reg_p
-} unw_record_type;
-
-
-/* These structures declare the fields that can be used in each of the
- 4 record formats, R, P, B and X. */
-
-typedef struct unw_r_record
-{
- unsigned long rlen;
- unsigned short mask;
- unsigned short grsave;
-} unw_r_record;
-
-typedef struct unw_p_record
-{
- void *imask;
- unsigned long t;
- unsigned long size;
- unsigned long spoff;
- unsigned long br;
- unsigned long pspoff;
- unsigned short gr;
- unsigned short rmask;
- unsigned short grmask;
- unsigned long frmask;
- unsigned short brmask;
-} unw_p_record;
-
-typedef struct unw_b_record
-{
- unsigned long t;
- unsigned long label;
- unsigned short ecount;
-} unw_b_record;
-
-typedef struct unw_x_record
-{
- unsigned long t;
- unsigned long spoff;
- unsigned long pspoff;
- unsigned short reg;
- unsigned short treg;
- unsigned short qp;
- unsigned short xy; /* Value of the XY field.. */
-} unw_x_record;
-
-/* This structure is used to determine the specific record type and
- its fields. */
-typedef struct unwind_record
-{
- unw_record_type type;
- union {
- unw_r_record r;
- unw_p_record p;
- unw_b_record b;
- unw_x_record x;
- } record;
-} unwind_record;
-
-#define IA64_UNW_LOC_TYPE_NONE 0
-#define IA64_UNW_LOC_TYPE_MEM 1
-#define IA64_UNW_LOC_TYPE_GR 2
-#define IA64_UNW_LOC_TYPE_FR 3
-#define IA64_UNW_LOC_TYPE_BR 4
-#define IA64_UNW_LOC_TYPE_SPOFF 5
-#define IA64_UNW_LOC_TYPE_PSPOFF 6
-#define IA64_UNW_LOC_TYPE_OFFSET 7
-#define IA64_UNW_LOC_TYPE_SPILLBASE 8
-
-typedef struct ia64_reg_loc
-{
- long when; /* PC relative offset from start of function. */
- union { /* In memory or another register? */
- void *mem;
- int regno;
- int offset;
- } l;
- short loc_type; /* Where to find value. */
- short reg_size;
-} ia64_reg_loc;
-
-/* Frame information record. */
-
-typedef struct ia64_frame_state
-{
- ia64_reg_loc gr[4]; /* gr4 to gr7. */
- ia64_reg_loc fr[20]; /* fr2 to fr5, fr16 to fr31. */
- ia64_reg_loc br[5]; /* br1 to br5. */
- ia64_reg_loc rp;
- ia64_reg_loc fpsr;
- ia64_reg_loc bsp;
- ia64_reg_loc bspstore;
- ia64_reg_loc rnat;
- ia64_reg_loc pfs;
- ia64_reg_loc unat;
- ia64_reg_loc lc;
- ia64_reg_loc pr;
- ia64_reg_loc priunat;
- ia64_reg_loc sp;
- ia64_reg_loc psp;
- ia64_reg_loc spill_base;
- void *my_psp;
- void *my_sp;
- void *my_bsp;
-} ia64_frame_state;
-
-/* This structure represents the start of an unwind information pointer.
- 'unwind_descriptors' is the beginninng of the unwind descriptors, which
- use up 'length' bytes of storage. */
-
-typedef struct unwind_info_ptr
-{
- unsigned long header; /* version, flags, & length */
- unsigned char unwind_descriptors[1];
-} unwind_info_ptr;
-
-#define IA64_UNW_HDR_LENGTH(x) ((x) & 0x00000000ffffffffUL)
-#define IA64_UNW_HDR_FLAGS(x) (((x) >> 32) & 0xffffUL)
-#define IA64_UNW_HDR_VERSION(x) (((x) >> 48) & 0xffffUL)
-
-/* Header flag bits, after extraction by IA64_UNW_HDR_FLAGS. */
-#define IA64_UNW_EHANDLER 0x1
-#define IA64_UNW_UHANDLER 0x2
-
-extern void * __ia64_personality_v1 (void *pc, old_exception_table *table);
-
-extern unwind_info_ptr *__build_ia64_frame_state (unsigned char *,
- ia64_frame_state *,
- void *, void *,
- void **);
-extern void *__get_real_reg_value (ia64_reg_loc *);
-extern void *__get_personality (unwind_info_ptr *);
-extern void *__get_except_table (unwind_info_ptr *);
-extern void __set_real_reg_value (ia64_reg_loc *, void *);
-void *__calc_caller_bsp (long, unsigned char *);
-void __copy_saved_reg_state (ia64_frame_state *, ia64_frame_state *);
-#endif /* IA64_UNWIND_INFO */
-
diff --git a/gcc/function.c b/gcc/function.c
index 259ccca4fb0..a842ef18aaa 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -45,9 +45,7 @@ Boston, MA 02111-1307, USA. */
#include "flags.h"
#include "except.h"
#include "function.h"
-#include "insn-flags.h"
#include "expr.h"
-#include "insn-codes.h"
#include "regs.h"
#include "hard-reg-set.h"
#include "insn-config.h"
@@ -60,10 +58,6 @@ Boston, MA 02111-1307, USA. */
#include "ggc.h"
#include "tm_p.h"
-#ifndef ACCUMULATE_OUTGOING_ARGS
-#define ACCUMULATE_OUTGOING_ARGS 0
-#endif
-
#ifndef TRAMPOLINE_ALIGNMENT
#define TRAMPOLINE_ALIGNMENT FUNCTION_BOUNDARY
#endif
@@ -294,8 +288,8 @@ static int contains PARAMS ((rtx, varray_type));
static void emit_return_into_block PARAMS ((basic_block, rtx));
#endif
static void put_addressof_into_stack PARAMS ((rtx, struct hash_table *));
-static boolean purge_addressof_1 PARAMS ((rtx *, rtx, int, int,
- struct hash_table *));
+static bool purge_addressof_1 PARAMS ((rtx *, rtx, int, int,
+ struct hash_table *));
static void purge_single_hard_subreg_set PARAMS ((rtx));
#ifdef HAVE_epilogue
static void keep_stack_depressed PARAMS ((rtx));
@@ -305,7 +299,7 @@ static struct hash_entry *insns_for_mem_newfunc PARAMS ((struct hash_entry *,
struct hash_table *,
hash_table_key));
static unsigned long insns_for_mem_hash PARAMS ((hash_table_key));
-static boolean insns_for_mem_comp PARAMS ((hash_table_key, hash_table_key));
+static bool insns_for_mem_comp PARAMS ((hash_table_key, hash_table_key));
static int insns_for_mem_walk PARAMS ((rtx *, void *));
static void compute_insns_for_mem PARAMS ((rtx, rtx, struct hash_table *));
static void mark_temp_slot PARAMS ((struct temp_slot *));
@@ -1338,7 +1332,9 @@ put_var_into_stack (decl)
context = decl_function_context (decl);
/* Get the current rtl used for this object and its original mode. */
- reg = TREE_CODE (decl) == SAVE_EXPR ? SAVE_EXPR_RTL (decl) : DECL_RTL (decl);
+ reg = (TREE_CODE (decl) == SAVE_EXPR
+ ? SAVE_EXPR_RTL (decl)
+ : DECL_RTL_IF_SET (decl));
/* No need to do anything if decl has no rtx yet
since in that case caller is setting TREE_ADDRESSABLE
@@ -1584,11 +1580,6 @@ fixup_var_refs (var, promoted_mode, unsignedp, ht)
end_sequence ();
}
}
-
- /* Scan the catch clauses for exception handling too. */
- push_to_full_sequence (catch_clauses, catch_clauses_last);
- fixup_var_refs_insns (catch_clauses, var, promoted_mode, unsignedp, 0);
- end_full_sequence (&catch_clauses, &catch_clauses_last);
}
/* REPLACEMENTS is a pointer to a list of the struct fixup_replacement and X is
@@ -1689,7 +1680,7 @@ fixup_var_refs_insns_with_hash (ht, var, promoted_mode, unsignedp)
rtx insn = XEXP (insn_list, 0);
if (INSN_P (insn))
- fixup_var_refs_insn (insn, var, promoted_mode, unsignedp, 0);
+ fixup_var_refs_insn (insn, var, promoted_mode, unsignedp, 1);
insn_list = XEXP (insn_list, 1);
}
@@ -2151,7 +2142,7 @@ fixup_var_refs_1 (var, promoted_mode, loc, insn, replacements)
{
replacement = find_fixup_replacement (replacements, var);
if (replacement->new == 0)
- replacement->new = gen_reg_rtx (GET_MODE (var));
+ replacement->new = gen_reg_rtx (promoted_mode);
SUBREG_REG (x) = replacement->new;
return;
}
@@ -2969,7 +2960,7 @@ static rtx purge_addressof_replacements;
the stack. If the function returns FALSE then the replacement could not
be made. */
-static boolean
+static bool
purge_addressof_1 (loc, insn, force, store, ht)
rtx *loc;
rtx insn;
@@ -2980,7 +2971,7 @@ purge_addressof_1 (loc, insn, force, store, ht)
RTX_CODE code;
int i, j;
const char *fmt;
- boolean result = true;
+ bool result = true;
/* Re-start here to avoid recursion in common cases. */
restart:
@@ -3280,7 +3271,7 @@ insns_for_mem_hash (k)
/* Return non-zero if K1 and K2 (two REGs) are the same. */
-static boolean
+static bool
insns_for_mem_comp (k1, k2)
hash_table_key k1;
hash_table_key k2;
@@ -3606,8 +3597,10 @@ instantiate_decls_1 (let, valid_only)
tree t;
for (t = BLOCK_VARS (let); t; t = TREE_CHAIN (t))
- instantiate_decl (DECL_RTL (t), int_size_in_bytes (TREE_TYPE (t)),
- valid_only);
+ if (DECL_RTL_SET_P (t))
+ instantiate_decl (DECL_RTL (t),
+ int_size_in_bytes (TREE_TYPE (t)),
+ valid_only);
/* Process all subblocks. */
for (t = BLOCK_SUBBLOCKS (let); t; t = TREE_CHAIN (t))
@@ -4353,8 +4346,8 @@ assign_parms (fndecl)
|| TREE_CODE (parm) != PARM_DECL
|| passed_type == NULL)
{
- DECL_INCOMING_RTL (parm) = DECL_RTL (parm)
- = gen_rtx_MEM (BLKmode, const0_rtx);
+ SET_DECL_RTL (parm, gen_rtx_MEM (BLKmode, const0_rtx));
+ DECL_INCOMING_RTL (parm) = DECL_RTL (parm);
TREE_USED (parm) = 1;
continue;
}
@@ -4373,7 +4366,8 @@ assign_parms (fndecl)
and avoid the usual things like emit_move_insn that could crash. */
if (nominal_mode == VOIDmode)
{
- DECL_INCOMING_RTL (parm) = DECL_RTL (parm) = const0_rtx;
+ SET_DECL_RTL (parm, const0_rtx);
+ DECL_INCOMING_RTL (parm) = DECL_RTL (parm);
continue;
}
@@ -4669,7 +4663,7 @@ assign_parms (fndecl)
size_stored / UNITS_PER_WORD,
int_size_in_bytes (TREE_TYPE (parm)));
}
- DECL_RTL (parm) = stack_parm;
+ SET_DECL_RTL (parm, stack_parm);
}
else if (! ((! optimize
&& ! DECL_REGISTER (parm)
@@ -4701,13 +4695,17 @@ assign_parms (fndecl)
appropriately. */
if (passed_pointer)
{
- DECL_RTL (parm)
- = gen_rtx_MEM (TYPE_MODE (TREE_TYPE (passed_type)), parmreg);
+ SET_DECL_RTL (parm,
+ gen_rtx_MEM (TYPE_MODE (TREE_TYPE (passed_type)),
+ parmreg));
set_mem_attributes (DECL_RTL (parm), parm, 1);
}
else
- DECL_RTL (parm) = parmreg;
-
+ {
+ SET_DECL_RTL (parm, parmreg);
+ maybe_set_unchanging (DECL_RTL (parm), parm);
+ }
+
/* Copy the value into the register. */
if (nominal_mode != passed_mode
|| promoted_nominal_mode != promoted_mode)
@@ -4770,12 +4768,13 @@ assign_parms (fndecl)
if (GET_MODE (parmreg) != GET_MODE (DECL_RTL (parm)))
{
rtx tempreg = gen_reg_rtx (GET_MODE (DECL_RTL (parm)));
-
+ int unsigned_p = TREE_UNSIGNED (TREE_TYPE (parm));
push_to_sequence (conversion_insns);
emit_move_insn (tempreg, DECL_RTL (parm));
- DECL_RTL (parm)
- = convert_to_mode (GET_MODE (parmreg), tempreg,
- TREE_UNSIGNED (TREE_TYPE (parm)));
+ SET_DECL_RTL (parm,
+ convert_to_mode (GET_MODE (parmreg),
+ tempreg,
+ unsigned_p));
emit_move_insn (parmreg, DECL_RTL (parm));
conversion_insns = get_insns();
did_conversion = 1;
@@ -4783,7 +4782,7 @@ assign_parms (fndecl)
}
else
emit_move_insn (parmreg, DECL_RTL (parm));
- DECL_RTL (parm) = parmreg;
+ SET_DECL_RTL (parm, parmreg);
/* STACK_PARM is the pointer, not the parm, and PARMREG is
now the parm. */
stack_parm = 0;
@@ -5018,7 +5017,7 @@ assign_parms (fndecl)
conversion_insns = get_insns ();
end_sequence ();
}
- DECL_RTL (parm) = stack_parm;
+ SET_DECL_RTL (parm, stack_parm);
}
/* If this "parameter" was the place where we are receiving the
@@ -5027,8 +5026,8 @@ assign_parms (fndecl)
{
tree result = DECL_RESULT (fndecl);
- DECL_RTL (result)
- = gen_rtx_MEM (DECL_MODE (result), DECL_RTL (parm));
+ SET_DECL_RTL (result,
+ gen_rtx_MEM (DECL_MODE (result), DECL_RTL (parm)));
set_mem_attributes (DECL_RTL (result), result, 1);
}
@@ -5087,7 +5086,9 @@ assign_parms (fndecl)
to include tree.h. Do this here so it gets done when an inlined
function gets output. */
- current_function_return_rtx = DECL_RTL (DECL_RESULT (fndecl));
+ current_function_return_rtx
+ = (DECL_RTL_SET_P (DECL_RESULT (fndecl))
+ ? DECL_RTL (DECL_RESULT (fndecl)) : NULL_RTX);
}
/* Indicate whether REGNO is an incoming argument to the current function
@@ -6250,14 +6251,62 @@ mark_varargs ()
void
expand_main_function ()
{
-#if !defined (HAS_INIT_SECTION)
+#ifdef FORCE_PREFERRED_STACK_BOUNDARY_IN_MAIN
+ if (FORCE_PREFERRED_STACK_BOUNDARY_IN_MAIN)
+ {
+ int align = PREFERRED_STACK_BOUNDARY / BITS_PER_UNIT;
+ rtx tmp;
+
+ /* Forcably align the stack. */
+#ifdef STACK_GROWS_DOWNWARD
+ tmp = expand_binop (Pmode, and_optab, stack_pointer_rtx,
+ GEN_INT (-align), stack_pointer_rtx, 1, OPTAB_WIDEN);
+#else
+ tmp = expand_binop (Pmode, add_optab, stack_pointer_rtx,
+ GEN_INT (align - 1), NULL_RTX, 1, OPTAB_WIDEN);
+ tmp = expand_binop (Pmode, and_optab, tmp, GEN_INT (-align),
+ stack_pointer_rtx, 1, OPTAB_WIDEN);
+#endif
+ if (tmp != stack_pointer_rtx)
+ emit_move_insn (stack_pointer_rtx, tmp);
+
+ /* Enlist allocate_dynamic_stack_space to pick up the pieces. */
+ tmp = force_reg (Pmode, const0_rtx);
+ allocate_dynamic_stack_space (tmp, NULL_RTX, BIGGEST_ALIGNMENT);
+ }
+#endif
+
+#ifndef HAS_INIT_SECTION
emit_library_call (gen_rtx_SYMBOL_REF (Pmode, NAME__MAIN), 0,
VOIDmode, 0);
-#endif /* not HAS_INIT_SECTION */
+#endif
}
extern struct obstack permanent_obstack;
+/* The PENDING_SIZES represent the sizes of variable-sized types.
+ Create RTL for the various sizes now (using temporary variables),
+ so that we can refer to the sizes from the RTL we are generating
+ for the current function. The PENDING_SIZES are a TREE_LIST. The
+ TREE_VALUE of each node is a SAVE_EXPR. */
+
+void
+expand_pending_sizes (pending_sizes)
+ tree pending_sizes;
+{
+ tree tem;
+
+ /* Evaluate now the sizes of any types declared among the arguments. */
+ for (tem = pending_sizes; tem; tem = TREE_CHAIN (tem))
+ {
+ expand_expr (TREE_VALUE (tem), const0_rtx, VOIDmode,
+ EXPAND_MEMORY_USE_BAD);
+ /* Flush the queue in case this parameter declaration has
+ side-effects. */
+ emit_queue ();
+ }
+}
+
/* Start the RTL for a new function, and set variables used for
emitting RTL.
SUBR is the FUNCTION_DECL node.
@@ -6309,20 +6358,10 @@ expand_function_start (subr, parms_have_cleanups)
else
cleanup_label = 0;
- /* Make the label for return statements to jump to, if this machine
- does not have a one-instruction return and uses an epilogue,
- or if it returns a structure, or if it has parm cleanups. */
-#ifdef HAVE_return
- if (cleanup_label == 0 && HAVE_return
- && ! current_function_instrument_entry_exit
- && ! current_function_returns_pcc_struct
- && ! (current_function_returns_struct && ! optimize))
- return_label = 0;
- else
- return_label = gen_label_rtx ();
-#else
+ /* Make the label for return statements to jump to. Do not special
+ case machines with special return instructions -- they will be
+ handled later during jump, ifcvt, or epilogue creation. */
return_label = gen_label_rtx ();
-#endif
/* Initialize rtx used to return the value. */
/* Do this before assign_parms so that we copy the struct value address
@@ -6354,38 +6393,49 @@ expand_function_start (subr, parms_have_cleanups)
}
if (value_address)
{
- DECL_RTL (DECL_RESULT (subr))
- = gen_rtx_MEM (DECL_MODE (DECL_RESULT (subr)), value_address);
+ SET_DECL_RTL (DECL_RESULT (subr),
+ gen_rtx_MEM (DECL_MODE (DECL_RESULT (subr)),
+ value_address));
set_mem_attributes (DECL_RTL (DECL_RESULT (subr)),
DECL_RESULT (subr), 1);
}
}
else if (DECL_MODE (DECL_RESULT (subr)) == VOIDmode)
/* If return mode is void, this decl rtl should not be used. */
- DECL_RTL (DECL_RESULT (subr)) = 0;
- else if (parms_have_cleanups || current_function_instrument_entry_exit)
+ SET_DECL_RTL (DECL_RESULT (subr), NULL_RTX);
+ else if (parms_have_cleanups
+ || current_function_instrument_entry_exit
+ || (flag_exceptions && USING_SJLJ_EXCEPTIONS))
{
- /* If function will end with cleanup code for parms,
- compute the return values into a pseudo reg,
- which we will copy into the true return register
- after the cleanups are done. */
-
- enum machine_mode mode = DECL_MODE (DECL_RESULT (subr));
-
-#ifdef PROMOTE_FUNCTION_RETURN
- tree type = TREE_TYPE (DECL_RESULT (subr));
- int unsignedp = TREE_UNSIGNED (type);
-
- mode = promote_mode (type, mode, &unsignedp, 1);
-#endif
+ /* If function will end with cleanup code for parms, compute the
+ return values into a pseudo reg, which we will copy into the
+ true return register after the cleanups are done. */
+
+ /* In order to figure out what mode to use for the pseudo, we
+ figure out what the mode of the eventual return register will
+ actually be, and use that. */
+ rtx hard_reg
+ = hard_function_value (TREE_TYPE (DECL_RESULT (subr)),
+ subr, 1);
+
+ /* Since we know the return value is not an aggregate, we should
+ have a REG here. */
+ if (!REG_P (hard_reg))
+ abort ();
- DECL_RTL (DECL_RESULT (subr)) = gen_reg_rtx (mode);
+ /* Create the pseudo. */
+ SET_DECL_RTL (DECL_RESULT (subr),
+ gen_reg_rtx (GET_MODE (hard_reg)));
+ /* Needed because we may need to move this to memory
+ in case it's a named return value whose address is taken. */
+ DECL_REGISTER (DECL_RESULT (subr)) = 1;
}
else
- /* Scalar, returned in a register. */
{
- DECL_RTL (DECL_RESULT (subr))
- = hard_function_value (TREE_TYPE (DECL_RESULT (subr)), subr, 1);
+ /* Scalar, returned in a register. */
+ SET_DECL_RTL (DECL_RESULT (subr),
+ hard_function_value (TREE_TYPE (DECL_RESULT (subr)),
+ subr, 1));
/* Mark this reg as the function's return value. */
if (GET_CODE (DECL_RTL (DECL_RESULT (subr))) == REG)
@@ -6491,14 +6541,7 @@ expand_function_start (subr, parms_have_cleanups)
tail_recursion_reentry = emit_note (NULL_PTR, NOTE_INSN_DELETED);
/* Evaluate now the sizes of any types declared among the arguments. */
- for (tem = nreverse (get_pending_sizes ()); tem; tem = TREE_CHAIN (tem))
- {
- expand_expr (TREE_VALUE (tem), const0_rtx, VOIDmode,
- EXPAND_MEMORY_USE_BAD);
- /* Flush the queue in case this parameter declaration has
- side-effects. */
- emit_queue ();
- }
+ expand_pending_sizes (nreverse (get_pending_sizes ()));
/* Make sure there is a line number after the function entry setup code. */
force_next_line_note ();
@@ -6790,27 +6833,6 @@ expand_function_end (filename, line, end_bindings)
if (end_bindings)
expand_end_bindings (0, 0, 0);
- /* Now handle any leftover exception regions that may have been
- created for the parameters. */
- {
- rtx last = get_last_insn ();
- rtx label;
-
- expand_leftover_cleanups ();
-
- /* If there are any catch_clauses remaining, output them now. */
- emit_insns (catch_clauses);
- catch_clauses = catch_clauses_last = NULL_RTX;
- /* If the above emitted any code, may sure we jump around it. */
- if (last != get_last_insn ())
- {
- label = gen_label_rtx ();
- last = emit_jump_insn_after (gen_jump (label), last);
- last = emit_barrier_after (last);
- emit_label (label);
- }
- }
-
if (current_function_instrument_entry_exit)
{
rtx fun = DECL_RTL (current_function_decl);
@@ -6826,6 +6848,11 @@ expand_function_end (filename, line, end_bindings)
Pmode);
}
+ /* Let except.c know where it should emit the call to unregister
+ the function context for sjlj exceptions. */
+ if (flag_exceptions && USING_SJLJ_EXCEPTIONS)
+ sjlj_emit_function_exit_after (get_last_insn ());
+
/* If we had calls to alloca, and this machine needs
an accurate stack pointer to exit the function,
insert some code to save and restore the stack pointer. */
@@ -6843,7 +6870,7 @@ expand_function_end (filename, line, end_bindings)
/* If scalar return value was computed in a pseudo-reg, or was a named
return value that got dumped to the stack, copy that to the hard
return register. */
- if (DECL_RTL (DECL_RESULT (current_function_decl)) != 0)
+ if (DECL_RTL_SET_P (DECL_RESULT (current_function_decl)))
{
tree decl_result = DECL_RESULT (current_function_decl);
rtx decl_rtl = DECL_RTL (decl_result);
@@ -6884,6 +6911,10 @@ expand_function_end (filename, line, end_bindings)
convert_move (real_decl_rtl, decl_rtl, unsignedp);
}
+ else if (GET_CODE (real_decl_rtl) == PARALLEL)
+ emit_group_load (real_decl_rtl, decl_rtl,
+ int_size_in_bytes (TREE_TYPE (decl_result)),
+ TYPE_ALIGN (TREE_TYPE (decl_result)));
else
emit_move_insn (real_decl_rtl, decl_rtl);
@@ -6933,16 +6964,16 @@ expand_function_end (filename, line, end_bindings)
current_function_return_rtx = outgoing;
}
+ /* If this is an implementation of throw, do what's necessary to
+ communicate between __builtin_eh_return and the epilogue. */
+ expand_eh_return ();
+
/* ??? This should no longer be necessary since stupid is no longer with
us, but there are some parts of the compiler (eg reload_combine, and
sh mach_dep_reorg) that still try and compute their own lifetime info
instead of using the general framework. */
use_return_register ();
- /* If this is an implementation of __throw, do what's necessary to
- communicate between __builtin_eh_return and the epilogue. */
- expand_eh_return ();
-
/* Output a return insn if we are using one.
Otherwise, let the rtl chain end here, to drop through
into the epilogue. */
diff --git a/gcc/function.h b/gcc/function.h
index c0aa0db1e93..5621c6b581d 100644
--- a/gcc/function.h
+++ b/gcc/function.h
@@ -191,6 +191,7 @@ struct function
/* Name of this function. */
const char *name;
+
/* Points to the FUNCTION_DECL of this function. */
tree decl;
@@ -199,50 +200,6 @@ struct function
May affect compilation of return insn or of function epilogue. */
int pops_args;
- /* Nonzero if function being compiled needs to be given an address
- where the value should be stored. */
- int returns_struct;
-
- /* Nonzero if function being compiled needs to
- return the address of where it has put a structure value. */
- int returns_pcc_struct;
-
- /* Nonzero if the current function returns a pointer type. */
- int returns_pointer;
-
- /* Nonzero if function being compiled needs to be passed a static chain. */
- int needs_context;
-
- /* Nonzero if function being compiled can call setjmp. */
- int calls_setjmp;
-
- /* Nonzero if function being compiled can call longjmp. */
- int calls_longjmp;
-
- /* Nonzero if function being compiled can call alloca,
- either as a subroutine or builtin. */
- int calls_alloca;
-
- /* Nonzero if function being compiled receives nonlocal gotos
- from nested functions. */
-
- int has_nonlocal_label;
-
- /* Nonzero if function being compiled has nonlocal gotos to parent
- function. */
- int has_nonlocal_goto;
-
- /* Nonzero if function being compiled contains nested functions. */
- int contains_functions;
-
- /* Nonzero if the function being compiled issues a computed jump. */
- int has_computed_jump;
-
- /* Nonzero if the current function is a thunk (a lightweight function that
- just adjusts one of its arguments and forwards to another function), so
- we should try to cut corners where we can. */
- int is_thunk;
-
/* If function's args have a fixed size, this is that size, in bytes.
Otherwise, it is -1.
May affect compilation of return insn or of function epilogue. */
@@ -261,14 +218,6 @@ struct function
anonymous arg can be found, if there is one. */
rtx arg_offset_rtx;
- /* Nonzero if current function uses varargs.h or equivalent.
- Zero for functions that use stdarg.h. */
- int varargs;
-
- /* Nonzero if current function uses stdarg.h or equivalent.
- Zero for functions that use varargs.h. */
- int stdarg;
-
/* Quantities of various kinds of registers
used for the current function's args. */
CUMULATIVE_ARGS args_info;
@@ -286,35 +235,9 @@ struct function
inline. */
const char *cannot_inline;
- /* Nonzero if instrumentation calls for function entry and exit should be
- generated. */
- int instrument_entry_exit;
-
- /* Nonzero if memory access checking be enabled in the current function. */
- int check_memory_usage;
-
- /* Nonzero if stack limit checking should be enabled in the current
- function. */
- int limit_stack;
-
/* Number of function calls seen so far in current function. */
int x_function_call_count;
- /* Nonzero if this function is being processed in function-at-a-time
- mode. In other words, if all tree structure for this function,
- including the BLOCK tree, is created before RTL generation
- commences. */
- int x_whole_function_mode_p;
-
- /* Nonzero if the back-end should not keep track of expressions that
- determine the size of variable-sized objects. Normally, such
- expressions are saved away, and then expanded when the next
- function is started. For example, if a parameter has a
- variable-sized type, then the size of the parameter is computed
- when the function body is entered. However, some front-ends do
- not desire this behavior. */
- int x_dont_save_pending_sizes_p;
-
/* List (chain of TREE_LIST) of LABEL_DECLs for all nonlocal labels
(labels to which there can be nonlocal gotos from nested functions)
in this function. */
@@ -442,13 +365,8 @@ struct function
/* Highest label number in current function. */
int inl_max_label_num;
- /* Nonzero if the current function uses the constant pool. */
- int uses_const_pool;
-
/* For md files. */
- /* Nonzero if the current function uses pic_offset_table_rtx. */
- int uses_pic_offset_table;
/* tm.h can use this to store whatever it likes. */
struct machine_function *machine;
/* The largest alignment of slot allocated on the stack. */
@@ -464,6 +382,97 @@ struct function
/* If some insns can be deferred to the delay slots of the epilogue, the
delay list for them is recorded here. */
rtx epilogue_delay_list;
+
+ /* Collected bit flags. */
+
+ /* Nonzero if function being compiled needs to be given an address
+ where the value should be stored. */
+ unsigned int returns_struct : 1;
+
+ /* Nonzero if function being compiled needs to
+ return the address of where it has put a structure value. */
+ unsigned int returns_pcc_struct : 1;
+
+ /* Nonzero if the current function returns a pointer type. */
+ unsigned int returns_pointer : 1;
+
+ /* Nonzero if function being compiled needs to be passed a static chain. */
+ unsigned int needs_context : 1;
+
+ /* Nonzero if function being compiled can call setjmp. */
+ unsigned int calls_setjmp : 1;
+
+ /* Nonzero if function being compiled can call longjmp. */
+ unsigned int calls_longjmp : 1;
+
+ /* Nonzero if function being compiled can call alloca,
+ either as a subroutine or builtin. */
+ unsigned int calls_alloca : 1;
+
+ /* Nonzero if the function calls __builtin_eh_return. */
+ unsigned int calls_eh_return : 1;
+
+ /* Nonzero if function being compiled receives nonlocal gotos
+ from nested functions. */
+ unsigned int has_nonlocal_label : 1;
+
+ /* Nonzero if function being compiled has nonlocal gotos to parent
+ function. */
+ unsigned int has_nonlocal_goto : 1;
+
+ /* Nonzero if function being compiled contains nested functions. */
+ unsigned int contains_functions : 1;
+
+ /* Nonzero if the function being compiled issues a computed jump. */
+ unsigned int has_computed_jump : 1;
+
+ /* Nonzero if the current function is a thunk (a lightweight function that
+ just adjusts one of its arguments and forwards to another function), so
+ we should try to cut corners where we can. */
+ unsigned int is_thunk : 1;
+
+ /* Nonzero if instrumentation calls for function entry and exit should be
+ generated. */
+ unsigned int instrument_entry_exit : 1;
+
+ /* Nonzero if memory access checking be enabled in the current function. */
+ unsigned int check_memory_usage : 1;
+
+ /* Nonzero if stack limit checking should be enabled in the current
+ function. */
+ unsigned int limit_stack : 1;
+
+ /* Nonzero if current function uses varargs.h or equivalent.
+ Zero for functions that use stdarg.h. */
+ unsigned int varargs : 1;
+
+ /* Nonzero if current function uses stdarg.h or equivalent.
+ Zero for functions that use varargs.h. */
+ unsigned int stdarg : 1;
+
+ /* Nonzero if this function is being processed in function-at-a-time
+ mode. In other words, if all tree structure for this function,
+ including the BLOCK tree, is created before RTL generation
+ commences. */
+ unsigned int x_whole_function_mode_p : 1;
+
+ /* Nonzero if the back-end should not keep track of expressions that
+ determine the size of variable-sized objects. Normally, such
+ expressions are saved away, and then expanded when the next
+ function is started. For example, if a parameter has a
+ variable-sized type, then the size of the parameter is computed
+ when the function body is entered. However, some front-ends do
+ not desire this behavior. */
+ unsigned int x_dont_save_pending_sizes_p : 1;
+
+ /* Nonzero if the current function uses the constant pool. */
+ unsigned int uses_const_pool : 1;
+
+ /* Nonzero if the current function uses pic_offset_table_rtx. */
+ unsigned int uses_pic_offset_table : 1;
+
+ /* Nonzero if the current function needs an lsda for exception handling. */
+ unsigned int uses_eh_lsda : 1;
};
/* The function currently being compiled. */
@@ -482,6 +491,7 @@ extern struct function *all_functions;
#define current_function_calls_setjmp (cfun->calls_setjmp)
#define current_function_calls_alloca (cfun->calls_alloca)
#define current_function_calls_longjmp (cfun->calls_longjmp)
+#define current_function_calls_eh_return (cfun->calls_eh_return)
#define current_function_has_computed_jump (cfun->has_computed_jump)
#define current_function_contains_functions (cfun->contains_functions)
#define current_function_is_thunk (cfun->is_thunk)
diff --git a/gcc/gcc.c b/gcc/gcc.c
index 3c7d0c199c1..5c73af4b2c5 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -35,6 +35,9 @@ compilation is specified by a string called a "spec". */
#include "config.h"
#include "system.h"
#include <signal.h>
+#if ! defined( SIGCHLD ) && defined( SIGCLD )
+# define SIGCHLD SIGCLD
+#endif
#include "obstack.h"
#include "intl.h"
#include "prefix.h"
@@ -96,6 +99,9 @@ static char dir_separator_str[] = { DIR_SEPARATOR, 0 };
#define MIN_FATAL_STATUS 1
+/* Flag set by cppspec.c to 1. */
+int is_cpp_driver;
+
/* Flag saying to pass the greatest exit code returned by a sub-process
to the calling program. */
static int pass_exit_codes;
@@ -233,7 +239,6 @@ static void add_prefix PARAMS ((struct path_prefix *, const char *,
const char *, int, int, int *));
static void translate_options PARAMS ((int *, const char *const **));
static char *skip_whitespace PARAMS ((char *));
-static void record_temp_file PARAMS ((const char *, int, int));
static void delete_if_ordinary PARAMS ((const char *));
static void delete_temp_files PARAMS ((void));
static void delete_failure_queue PARAMS ((void));
@@ -241,6 +246,7 @@ static void clear_failure_queue PARAMS ((void));
static int check_live_switch PARAMS ((int, int));
static const char *handle_braces PARAMS ((const char *));
static char *save_string PARAMS ((const char *, int));
+static void set_collect_gcc_options PARAMS ((void));
static int do_spec_1 PARAMS ((const char *, int, const char *));
static const char *find_file PARAMS ((const char *));
static int is_directory PARAMS ((const char *, const char *, int));
@@ -251,12 +257,9 @@ static int used_arg PARAMS ((const char *, int));
static int default_arg PARAMS ((const char *, int));
static void set_multilib_dir PARAMS ((void));
static void print_multilib_info PARAMS ((void));
-static void pfatal_with_name PARAMS ((const char *)) ATTRIBUTE_NORETURN;
static void perror_with_name PARAMS ((const char *));
static void pfatal_pexecute PARAMS ((const char *, const char *))
ATTRIBUTE_NORETURN;
-static void error PARAMS ((const char *, ...))
- ATTRIBUTE_PRINTF_1;
static void notice PARAMS ((const char *, ...))
ATTRIBUTE_PRINTF_1;
static void display_help PARAMS ((void));
@@ -267,7 +270,6 @@ static void process_command PARAMS ((int, const char *const *));
static int execute PARAMS ((void));
static void clear_args PARAMS ((void));
static void fatal_error PARAMS ((int));
-static void set_input PARAMS ((const char *));
static void init_gcc_specs PARAMS ((struct obstack *,
const char *,
const char *));
@@ -360,6 +362,7 @@ or with constant text in a single argument.
and substitute the full name found.
%eSTR Print STR as an error message. STR is terminated by a newline.
Use this when inconsistent options are detected.
+ %nSTR Print STR as an notice. STR is terminated by a newline.
%x{OPTION} Accumulate an option for %X.
%X Output the accumulated linker options specified by compilations.
%Y Output the accumulated assembler options specified by compilations.
@@ -599,7 +602,7 @@ static const char *cpp_options =
%{!no-gcc:-D__GNUC__=%v1 -D__GNUC_MINOR__=%v2 -D__GNUC_PATCHLEVEL__=%v3}\
%{!undef:%{!ansi:%{!std=*:%p}%{std=gnu*:%p}} %P} %{trigraphs}\
%c %{Os:-D__OPTIMIZE_SIZE__} %{O*:%{!O0:-D__OPTIMIZE__}}\
- %{ffast-math:-D__FAST_MATH__}\
+ %{fno-inline|O0|!O*:-D__NO_INLINE__} %{ffast-math:-D__FAST_MATH__}\
%{fshort-wchar:-U__WCHAR_TYPE__ -D__WCHAR_TYPE__=short\\ unsigned\\ int}\
%{ffreestanding:-D__STDC_HOSTED__=0} %{fno-hosted:-D__STDC_HOSTED__=0}\
%{!ffreestanding:%{!fno-hosted:-D__STDC_HOSTED__=1}}\
@@ -615,10 +618,10 @@ static const char *cc1_options =
%1 %{!Q:-quiet} -dumpbase %B %{d*} %{m*} %{a*}\
%{g*} %{O*} %{W*} %{w} %{pedantic*} %{std*} %{ansi}\
%{traditional} %{v:-version} %{pg:-p} %{p} %{f*}\
- %{aux-info*} %{Qn:-fno-ident} %{--help:--help}\
+ %{Qn:-fno-ident} %{--help:--help}\
%{--target-help:--target-help}\
%{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
- %{fsyntax-only:-o %j}";
+ %{fsyntax-only:-o %j} %{-param*}";
static const char *asm_options =
"%a %Y %{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o %d%w%u%O}";
@@ -673,7 +676,8 @@ static struct user_specs *user_specs_head, *user_specs_tail;
|| !strcmp (STR, "imacros") || !strcmp (STR, "aux-info") \
|| !strcmp (STR, "idirafter") || !strcmp (STR, "iprefix") \
|| !strcmp (STR, "iwithprefix") || !strcmp (STR, "iwithprefixbefore") \
- || !strcmp (STR, "isystem") || !strcmp (STR, "specs") \
+ || !strcmp (STR, "isystem") || !strcmp (STR, "-param") \
+ || !strcmp (STR, "specs") \
|| !strcmp (STR, "MF") || !strcmp (STR, "MT") || !strcmp (STR, "MQ"))
#ifndef WORD_SWITCH_TAKES_ARG
@@ -728,19 +732,20 @@ static struct compiler default_compilers[] =
were not present when we built the driver, we will hit these copies
and be given a more meaningful error than "file not used since
linking is not done". */
- {".m", "#Objective-C"}, {".mi", "#Objective-C"},
- {".cc", "#C++"}, {".cxx", "#C++"}, {".cpp", "#C++"}, {".cp", "#C++"},
- {".c++", "#C++"}, {".C", "#C++"}, {".ii", "#C++"},
- {".ads", "#Ada"}, {".adb", "#Ada"}, {".ada", "#Ada"},
- {".f", "#Fortran"}, {".for", "#Fortran"}, {".fpp", "#Fortran"},
- {".F", "#Fortran"}, {".FOR", "#Fortran"}, {".FPP", "#Fortran"},
- {".r", "#Ratfor"},
- {".p", "#Pascal"}, {".pas", "#Pascal"},
- {".ch", "#Chill"}, {".chi", "#Chill"},
- {".java", "#Java"}, {".class", "#Java"},
- {".zip", "#Java"}, {".jar", "#Java"},
+ {".m", "#Objective-C", 0}, {".mi", "#Objective-C", 0},
+ {".cc", "#C++", 0}, {".cxx", "#C++", 0}, {".cpp", "#C++", 0},
+ {".cp", "#C++", 0}, {".c++", "#C++", 0}, {".C", "#C++", 0},
+ {".ii", "#C++", 0},
+ {".ads", "#Ada", 0}, {".adb", "#Ada", 0}, {".ada", "#Ada", 0},
+ {".f", "#Fortran", 0}, {".for", "#Fortran", 0}, {".fpp", "#Fortran", 0},
+ {".F", "#Fortran", 0}, {".FOR", "#Fortran", 0}, {".FPP", "#Fortran", 0},
+ {".r", "#Ratfor", 0},
+ {".p", "#Pascal", 0}, {".pas", "#Pascal", 0},
+ {".ch", "#Chill", 0}, {".chi", "#Chill", 0},
+ {".java", "#Java", 0}, {".class", "#Java", 0},
+ {".zip", "#Java", 0}, {".jar", "#Java", 0},
/* Next come the entries for C. */
- {".c", "@c"},
+ {".c", "@c", 0},
{"@c",
/* cc1 has an integrated ISO C preprocessor. We should invoke the
external preprocessor if -save-temps or -traditional is given. */
@@ -755,27 +760,27 @@ static struct compiler default_compilers[] =
cc1 -fpreprocessed %{!pipe:%g.i} %(cc1_options)}\
%{!traditional:%{!ftraditional:%{!traditional-cpp:\
cc1 -lang-c %{ansi:-std=c89} %(cpp_options) %(cc1_options)}}}}\
- %{!fsyntax-only:%(invoke_as)}}}}"},
+ %{!fsyntax-only:%(invoke_as)}}}}", 0},
{"-",
"%{!E:%e-E required when input is from standard input}\
- %(trad_capable_cpp) -lang-c %{ansi:-std=c89} %(cpp_options)"},
- {".h", "@c-header"},
+ %(trad_capable_cpp) -lang-c %{ansi:-std=c89} %(cpp_options)", 0},
+ {".h", "@c-header", 0},
{"@c-header",
"%{!E:%eCompilation of header file requested} \
- %(trad_capable_cpp) -lang-c %{ansi:-std=c89} %(cpp_options)"},
- {".i", "@cpp-output"},
+ %(trad_capable_cpp) -lang-c %{ansi:-std=c89} %(cpp_options)", 0},
+ {".i", "@cpp-output", 0},
{"@cpp-output",
- "%{!M:%{!MM:%{!E:cc1 -fpreprocessed %i %(cc1_options) %{!fsyntax-only:%(invoke_as)}}}}"},
- {".s", "@assembler"},
+ "%{!M:%{!MM:%{!E:cc1 -fpreprocessed %i %(cc1_options) %{!fsyntax-only:%(invoke_as)}}}}", 0},
+ {".s", "@assembler", 0},
{"@assembler",
- "%{!M:%{!MM:%{!E:%{!S:as %(asm_options) %i %A }}}}"},
- {".S", "@assembler-with-cpp"},
+ "%{!M:%{!MM:%{!E:%{!S:as %(asm_options) %i %A }}}}", 0},
+ {".S", "@assembler-with-cpp", 0},
{"@assembler-with-cpp",
"%(trad_capable_cpp) -lang-asm %(cpp_options)\
- %{!M:%{!MM:%{!E:%(invoke_as)}}}"},
+ %{!M:%{!MM:%{!E:%(invoke_as)}}}", 0},
#include "specs.h"
/* Mark end of table */
- {0, 0}
+ {0, 0, 0}
};
/* Number of elements in default_compilers, not counting the terminator. */
@@ -862,6 +867,7 @@ struct option_map option_map[] =
{"--optimize", "-O", "oj"},
{"--output", "-o", "a"},
{"--output-class-directory", "-foutput-class-dir=", "ja"},
+ {"--param", "--param", "a"},
{"--pedantic", "-pedantic", 0},
{"--pedantic-errors", "-pedantic-errors", 0},
{"--pipe", "-pipe", 0},
@@ -1272,9 +1278,9 @@ init_gcc_specs (obstack, shared_name, static_name)
char buffer[128];
/* If we see -shared-libgcc, then use the shared version. */
- sprintf (buffer, "%%{shared-libgcc:%s}", shared_name);
+ sprintf (buffer, "%%{shared-libgcc:%s %s}", shared_name, static_name);
obstack_grow (obstack, buffer, strlen (buffer));
- /* If we see -static-libgcc, then use the shared version. */
+ /* If we see -static-libgcc, then use the static version. */
sprintf (buffer, "%%{static-libgcc:%s}", static_name);
obstack_grow (obstack, buffer, strlen (buffer));
/* Otherwise, if we see -shared, then use the shared version. */
@@ -1403,6 +1409,15 @@ init_spec ()
libgcc_spec = obstack_finish (&obstack);
}
#endif
+#ifdef USE_AS_TRADITIONAL_FORMAT
+ /* Prepend "--traditional-format" to whatever asm_spec we had before. */
+ {
+ static char tf[] = "--traditional-format ";
+ obstack_grow (&obstack, tf, sizeof(tf) - 1);
+ obstack_grow0 (&obstack, asm_spec, strlen (asm_spec));
+ asm_spec = obstack_finish (&obstack);
+ }
+#endif
specs = sl;
}
@@ -1875,7 +1890,7 @@ static struct temp_file *failure_delete_queue;
FAIL_DELETE nonzero means delete it if a compilation step fails;
otherwise delete it in any case. */
-static void
+void
record_temp_file (filename, always_delete, fail_delete)
const char *filename;
int always_delete;
@@ -2798,7 +2813,7 @@ struct infile
static struct infile *infiles;
-static int n_infiles;
+int n_infiles;
/* This counts the number of libraries added by lang_specific_driver, so that
we can tell if there were any user supplied any files or libraries. */
@@ -2807,7 +2822,7 @@ static int added_libraries;
/* And a vector of corresponding output files is made up later. */
-static const char **outfiles;
+const char **outfiles;
/* Used to track if none of the -B paths are used. */
static int warn_B;
@@ -2848,7 +2863,7 @@ convert_filename (name, do_exe)
}
#endif
-#ifdef HAVE_EXECUTABLE_SUFFIX
+#if defined(HAVE_EXECUTABLE_SUFFIX) && !defined(NO_AUTO_EXE_SUFFIX)
/* If there is no filetype, make it the executable suffix (which includes
the "."). But don't get confused if we have just "-o". */
if (! do_exe || EXECUTABLE_SUFFIX[0] == 0 || (len == 2 && name[0] == '-'))
@@ -2919,9 +2934,9 @@ display_help ()
"), stdout);
printf (_("\
-\nOptions starting with -g, -f, -m, -O or -W are automatically passed on to\n\
-the various sub-processes invoked by %s. In order to pass other options\n\
-on to these processes the -W<letter> options must be used.\n\
+\nOptions starting with -g, -f, -m, -O, -W, or --param are automatically\n\
+ passed on to the various sub-processes invoked by %s. In order to pass\n\
+ other options on to these processes the -W<letter> options must be used.\n\
"), programname);
/* The rest of the options are displayed by invocations of the various
@@ -3204,7 +3219,9 @@ process_command (argc, argv)
n_infiles++;
n_switches++;
- add_preprocessor_option ("--help", 6);
+ /* CPP driver cannot obtain switch from cc1_options. */
+ if (is_cpp_driver)
+ add_preprocessor_option ("--help", 6);
add_assembler_option ("--help", 6);
add_linker_option ("--help", 6);
}
@@ -3217,7 +3234,9 @@ process_command (argc, argv)
n_infiles++;
n_switches++;
- add_preprocessor_option ("--target-help", 13);
+ /* CPP driver cannot obtain switch from cc1_options. */
+ if (is_cpp_driver)
+ add_preprocessor_option ("--target-help", 13);
add_assembler_option ("--target-help", 13);
add_linker_option ("--target-help", 13);
}
@@ -3661,41 +3680,10 @@ process_command (argc, argv)
;
else if (! strcmp (argv[i], "-print-multi-directory"))
;
- else if (strcmp (argv[i], "-ftarget-help") == 0)
- {
- /* Create a dummy input file, so that we can pass --target-help on to
- the various sub-processes. */
- infiles[n_infiles].language = "c";
- infiles[n_infiles++].name = "target-dummy";
-
- /* Preserve the --target-help switch so that it can be caught by
- the cc1 spec string. */
- switches[n_switches].part1 = "--target-help";
- switches[n_switches].args = 0;
- switches[n_switches].live_cond = SWITCH_OK;
- switches[n_switches].validated = 0;
-
- n_switches++;
- }
- else if (strcmp (argv[i], "-fhelp") == 0)
- {
- if (verbose_flag)
- {
- /* Create a dummy input file, so that we can pass --help on to
- the various sub-processes. */
- infiles[n_infiles].language = "c";
- infiles[n_infiles++].name = "help-dummy";
-
- /* Preserve the --help switch so that it can be caught by the
- cc1 spec string. */
- switches[n_switches].part1 = "--help";
- switches[n_switches].args = 0;
- switches[n_switches].live_cond = SWITCH_OK;
- switches[n_switches].validated = 0;
-
- n_switches++;
- }
- }
+ else if (! strcmp (argv[i], "-ftarget-help"))
+ ;
+ else if (! strcmp (argv[i], "-fhelp"))
+ ;
else if (argv[i][0] == '+' && argv[i][1] == 'e')
{
/* Compensate for the +e options to the C++ front-end;
@@ -3854,9 +3842,97 @@ process_command (argc, argv)
if (n_infiles == last_language_n_infiles && spec_lang != 0)
error ("Warning: `-x %s' after last input file has no effect", spec_lang);
+ /* Ensure we only invoke each subprocess once. */
+ if (target_help_flag || print_help_list)
+ {
+ n_infiles = 1;
+
+ /* Create a dummy input file, so that we can pass --target-help on to
+ the various sub-processes. */
+ infiles[0].language = "c";
+ infiles[0].name = "help-dummy";
+
+ if (target_help_flag)
+ {
+ switches[n_switches].part1 = "--target-help";
+ switches[n_switches].args = 0;
+ switches[n_switches].live_cond = SWITCH_OK;
+ switches[n_switches].validated = 0;
+
+ n_switches++;
+ }
+
+ if (print_help_list)
+ {
+ switches[n_switches].part1 = "--help";
+ switches[n_switches].args = 0;
+ switches[n_switches].live_cond = SWITCH_OK;
+ switches[n_switches].validated = 0;
+
+ n_switches++;
+ }
+ }
+
switches[n_switches].part1 = 0;
infiles[n_infiles].name = 0;
}
+
+/* Store switches not filtered out by %{<S} in spec in COLLECT_GCC_OPTIONS
+ and place that in the environment. */
+
+static void
+set_collect_gcc_options ()
+{
+ int i;
+ int first_time;
+
+ /* Build COLLECT_GCC_OPTIONS to have all of the options specified to
+ the compiler. */
+ obstack_grow (&collect_obstack, "COLLECT_GCC_OPTIONS=",
+ sizeof ("COLLECT_GCC_OPTIONS=") - 1);
+
+ first_time = TRUE;
+ for (i = 0; (int) i < n_switches; i++)
+ {
+ const char *const *args;
+ const char *p, *q;
+ if (!first_time)
+ obstack_grow (&collect_obstack, " ", 1);
+
+ first_time = FALSE;
+
+ /* Ignore elided switches. */
+ if (switches[i].live_cond == SWITCH_IGNORE)
+ continue;
+
+ obstack_grow (&collect_obstack, "'-", 2);
+ q = switches[i].part1;
+ while ((p = strchr (q, '\'')))
+ {
+ obstack_grow (&collect_obstack, q, p - q);
+ obstack_grow (&collect_obstack, "'\\''", 4);
+ q = ++p;
+ }
+ obstack_grow (&collect_obstack, q, strlen (q));
+ obstack_grow (&collect_obstack, "'", 1);
+
+ for (args = switches[i].args; args && *args; args++)
+ {
+ obstack_grow (&collect_obstack, " '", 2);
+ q = *args;
+ while ((p = strchr (q, '\'')))
+ {
+ obstack_grow (&collect_obstack, q, p - q);
+ obstack_grow (&collect_obstack, "'\\''", 4);
+ q = ++p;
+ }
+ obstack_grow (&collect_obstack, q, strlen (q));
+ obstack_grow (&collect_obstack, "'", 1);
+ }
+ }
+ obstack_grow (&collect_obstack, "\0", 1);
+ putenv (obstack_finish (&collect_obstack));
+}
/* Process a spec string, accumulating and running commands. */
@@ -3930,6 +4006,8 @@ do_spec (spec)
if (argbuf_index > 0 && !strcmp (argbuf[argbuf_index - 1], "|"))
argbuf_index--;
+ set_collect_gcc_options ();
+
if (argbuf_index > 0)
value = execute ();
}
@@ -4000,6 +4078,8 @@ do_spec_1 (spec, inswitch, soft_matched_part)
argbuf_index--;
}
+ set_collect_gcc_options ();
+
if (argbuf_index > 0)
{
value = execute ();
@@ -4196,6 +4276,21 @@ do_spec_1 (spec, inswitch, soft_matched_part)
return -1;
}
break;
+ case 'n':
+ /* %nfoo means report an notice with `foo' on stderr. */
+ {
+ const char *q = p;
+ char *buf;
+ while (*p != 0 && *p != '\n')
+ p++;
+ buf = (char *) alloca (p - q + 1);
+ strncpy (buf, q, p - q);
+ buf[p - q] = 0;
+ notice ("%s\n", buf);
+ if (*p)
+ p++;
+ }
+ break;
case 'j':
{
@@ -4263,7 +4358,8 @@ do_spec_1 (spec, inswitch, soft_matched_part)
&& t->unique == (c != 'g'))
break;
- /* Make a new association if needed. %u and %j require one. */
+ /* Make a new association if needed. %u and %j
+ require one. */
if (t == 0 || c == 'u' || c == 'j')
{
if (t == 0)
@@ -4273,7 +4369,13 @@ do_spec_1 (spec, inswitch, soft_matched_part)
temp_names = t;
}
t->length = suffix_length;
- t->suffix = save_string (suffix, suffix_length);
+ if (saved_suffix)
+ {
+ t->suffix = saved_suffix;
+ saved_suffix = NULL;
+ }
+ else
+ t->suffix = save_string (suffix, suffix_length);
t->unique = (c != 'g');
temp_filename = make_temp_file (t->suffix);
temp_filename_length = strlen (temp_filename);
@@ -4493,7 +4595,7 @@ do_spec_1 (spec, inswitch, soft_matched_part)
len = strlen (multilib_dir);
obstack_blank (&obstack, len + 1);
- p = obstack_next_free (&obstack) - len;
+ p = obstack_next_free (&obstack) - (len + 1);
*p++ = '_';
for (q = multilib_dir; *q ; ++q, ++p)
@@ -5256,19 +5358,19 @@ give_switch (switchnum, omit_first_word, include_blanks)
if (suffix_subst)
{
unsigned length = strlen (arg);
+ int dot = 0;
while (length-- && !IS_DIR_SEPARATOR (arg[length]))
if (arg[length] == '.')
{
((char *)arg)[length] = 0;
+ dot = 1;
break;
}
do_spec_1 (arg, 1, NULL_PTR);
- if (!arg[length])
- {
- ((char *)arg)[length] = '.';
- do_spec_1 (suffix_subst, 1, NULL_PTR);
- }
+ if (dot)
+ ((char *)arg)[length] = '.';
+ do_spec_1 (suffix_subst, 1, NULL_PTR);
}
else
do_spec_1 (arg, 1, NULL_PTR);
@@ -5361,7 +5463,7 @@ is_directory (path1, path2, linker)
/* Set up the various global variables to indicate that we're processing
the input file named FILENAME. */
-static void
+void
set_input (filename)
const char *filename;
{
@@ -5462,6 +5564,11 @@ main (argc, argv)
if (signal (SIGPIPE, SIG_IGN) != SIG_IGN)
signal (SIGPIPE, fatal_error);
#endif
+#ifdef SIGCHLD
+ /* We *MUST* set SIGCHLD to SIG_DFL so that the wait4() call will
+ receive the signal. A different setting is inheritable */
+ signal (SIGCHLD, SIG_DFL);
+#endif
argbuf_length = 10;
argbuf = (const char **) xmalloc (argbuf_length * sizeof (const char *));
@@ -5529,52 +5636,6 @@ main (argc, argv)
process_command (argc, argv);
- {
- int first_time;
-
- /* Build COLLECT_GCC_OPTIONS to have all of the options specified to
- the compiler. */
- obstack_grow (&collect_obstack, "COLLECT_GCC_OPTIONS=",
- sizeof ("COLLECT_GCC_OPTIONS=") - 1);
-
- first_time = TRUE;
- for (i = 0; (int) i < n_switches; i++)
- {
- const char *const *args;
- const char *p, *q;
- if (!first_time)
- obstack_grow (&collect_obstack, " ", 1);
-
- first_time = FALSE;
- obstack_grow (&collect_obstack, "'-", 2);
- q = switches[i].part1;
- while ((p = strchr (q, '\'')))
- {
- obstack_grow (&collect_obstack, q, p - q);
- obstack_grow (&collect_obstack, "'\\''", 4);
- q = ++p;
- }
- obstack_grow (&collect_obstack, q, strlen (q));
- obstack_grow (&collect_obstack, "'", 1);
-
- for (args = switches[i].args; args && *args; args++)
- {
- obstack_grow (&collect_obstack, " '", 2);
- q = *args;
- while ((p = strchr (q, '\'')))
- {
- obstack_grow (&collect_obstack, q, p - q);
- obstack_grow (&collect_obstack, "'\\''", 4);
- q = ++p;
- }
- obstack_grow (&collect_obstack, q, strlen (q));
- obstack_grow (&collect_obstack, "'", 1);
- }
- }
- obstack_grow (&collect_obstack, "\0", 1);
- putenv (obstack_finish (&collect_obstack));
- }
-
/* Initialize the vector of specs to just the default.
This means one element containing 0s, as a terminator. */
@@ -5772,9 +5833,24 @@ main (argc, argv)
if (verbose_flag)
{
int n;
+ const char *thrmod;
notice ("Configured with: %s\n", configuration_arguments);
+#ifdef THREAD_MODEL_SPEC
+ /* We could have defined THREAD_MODEL_SPEC to "%*" by default,
+ but there's no point in doing all this processing just to get
+ thread_model back. */
+ obstack_init (&obstack);
+ do_spec_1 (THREAD_MODEL_SPEC, 0, thread_model);
+ obstack_1grow (&obstack, '\0');
+ thrmod = obstack_finish (&obstack);
+#else
+ thrmod = thread_model;
+#endif
+
+ notice ("Thread model: %s\n", thrmod);
+
/* compiler_version is truncated at the first space when initialized
from version string, so truncate version_string at the first space
before comparing. */
@@ -5831,11 +5907,17 @@ main (argc, argv)
/* Ok, we found an applicable compiler. Run its spec. */
if (input_file_compiler->spec[0] == '#')
- error ("%s: %s compiler not installed on this system",
- input_filename, &input_file_compiler->spec[1]);
- value = do_spec (input_file_compiler->spec);
- if (value < 0)
- this_file_error = 1;
+ {
+ error ("%s: %s compiler not installed on this system",
+ input_filename, &input_file_compiler->spec[1]);
+ this_file_error = 1;
+ }
+ else
+ {
+ value = do_spec (input_file_compiler->spec);
+ if (value < 0)
+ this_file_error = 1;
+ }
}
/* If this file's name does not contain a recognized suffix,
@@ -6006,7 +6088,7 @@ save_string (s, len)
return result;
}
-static void
+void
pfatal_with_name (name)
const char *name;
{
@@ -6074,7 +6156,7 @@ fatal VPARAMS ((const char *msgid, ...))
exit (1);
}
-static void
+void
error VPARAMS ((const char *msgid, ...))
{
#ifndef ANSI_PROTOTYPES
diff --git a/gcc/gcc.h b/gcc/gcc.h
index 9a9beb0e25a..1d12a4b88f2 100644
--- a/gcc/gcc.h
+++ b/gcc/gcc.h
@@ -1,5 +1,5 @@
/* Header file for modules that link with gcc.c
- Copyright (C) 1999 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -25,11 +25,15 @@ Boston, MA 02111-1307, USA. */
/* These are exported by gcc.c. */
extern int do_spec PARAMS ((const char *));
+extern void record_temp_file PARAMS ((const char *, int, int));
extern void fancy_abort PARAMS ((void)) ATTRIBUTE_NORETURN;
extern const char *input_filename;
extern size_t input_filename_length;
extern void fatal PARAMS ((const char *, ...))
ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN;
+extern void error PARAMS ((const char *, ...)) ATTRIBUTE_PRINTF_1;
+extern void pfatal_with_name PARAMS ((const char *)) ATTRIBUTE_NORETURN;
+extern void set_input PARAMS ((const char *));
/* Spec files linked with gcc.c must provide definitions for these. */
@@ -39,7 +43,13 @@ extern void lang_specific_driver PARAMS ((int *, const char *const **, int *));
/* Called before linking. Returns 0 on success and -1 on failure. */
extern int lang_specific_pre_link PARAMS ((void));
+extern int n_infiles;
+
/* Number of extra output files that lang_specific_pre_link may generate. */
extern int lang_specific_extra_outfiles;
+/* A vector of corresponding output files is made up later. */
+
+extern const char **outfiles;
+
#endif /* ! __GCC_H__ */
diff --git a/gcc/gccbug.in b/gcc/gccbug.in
index 774548cec0f..6bb390896f8 100755
--- a/gcc/gccbug.in
+++ b/gcc/gccbug.in
@@ -82,25 +82,16 @@ if [ @have_mktemp_command@ = yes ]; then
TEMP=`mktemp $TMPDIR/pXXXXXX` || exit 1
BAD=`mktemp $TMPDIR/pbadXXXXXX` || exit 1
REF=`mktemp $TMPDIR/pfXXXXXX` || exit 1
+ REMOVE_TEMP="rm -f $TEMP0 $TEMP $BAD $REF"
else
- TEMP0=$TMPDIR/po$$
- TEMP=$TMPDIR/p$$
- BAD=$TMPDIR/pbad$$
- REF=$TMPDIR/pf$$
- # set -C _may_ use O_EXCL, but it need not.
- set -C
- bad_temp=0
- : > $TEMP0 || bad_temp=1
- : > $TEMP || bad_temp=1
- : > $BAD || bad_temp=1
- : > $REF || bad_temp=1
- if [ $bad_temp = 1 ]; then
- rm -f $TEMP0 $TEMP $BAD $REF
- exit 1;
- fi
- set +C
+ TEMPD=$TMPDIR/pd$$
+ TEMP0=$TEMPD/po$$
+ TEMP=$TEMPD/p$$
+ BAD=$TEMPD/pbad$$
+ REF=$TEMPD/pf$$
+ mkdir $TEMPD || exit 1
+ REMOVE_TEMP="rm -rf $TEMPD"
fi
-REMOVE_TEMP="rm -f $TEMP0 $TEMP $BAD $REF"
# find a user name
if [ "$LOGNAME" = "" ]; then
@@ -199,7 +190,7 @@ while [ $# -gt 0 ]; do
done
# spam does not need to be listed here
-CATEGORIES="c++ c debug fortran java libf2c libgcj libobjc libstdc++ middle-end objc optimization other preprocessor target web"
+CATEGORIES="bootstrap c++ c debug fortran java libf2c libgcj libobjc libstdc++ middle-end objc optimization other preprocessor target web"
case "$FORMAT" in
lisp) echo "$CATEGORIES" | \
@@ -227,7 +218,7 @@ SYNOPSIS_C='<synopsis of the problem (one line)>'
if [ -z "$SEVERITY_C" ]; then
SEVERITY_C='<[ non-critical | serious | critical ] (one line)>'
fi
-PRIORITY_C='<[ low | medium | high ] (one line)>'
+PRIORITY_C='<[ low | medium ] (one line)>'
CATEGORY_C='<choose from the top of this file (one line)>'
RELEASE_C='<release number or tag (one line)>'
ENVIRONMENT_C='<machine, os, target, libraries (multiple lines)>'
@@ -321,12 +312,11 @@ SEND-PR: critical GCC is completely not operational; no work-around known.
SEND-PR: serious GCC is not working properly; a work-around is possible.
SEND-PR: non-critical Report indicates minor problem.
>Priority: $PRIORITY_C
-SEND-PR: high A solution is necessary as soon as possible.
SEND-PR: medium The problem should be solved in the next release.
SEND-PR: low The problem should be solve in a future release.
>Category: $CATEGORY_C
>Class: <[ doc-bug | accepts-illegal | rejects-legal | wrong-code | ice-on-legal-code| ice-on-illegal-code | pessimizes-code | sw-bug | change-request | support ] (one line)>
-SEND-PR: doc-bug The doumentation is incorrect.
+SEND-PR: doc-bug The documentation is incorrect.
SEND-PR: accepts-illegal GCC fails to reject erroneous code.
SEND-PR: rejects-legal GCC gives an error message for correct code.
SEND-PR: wrong-code The machine code generated by gcc is incorrect.
@@ -423,7 +413,8 @@ while [ -z "$REQUEST_ID" ]; do
PATTERN=">Priority:"
PRIORITY=`eval sed -n -e "\"$SED_CMD\"" $TEMP`
case "$PRIORITY" in
- ""|low|medium|high) CNT=`expr $CNT + 1` ;;
+ ""|low|medium) CNT=`expr $CNT + 1` ;;
+ high) echo "$COMMAND: \`Priority: high' is reserved for GCC maintainers." ;;
*) echo "$COMMAND: \`$PRIORITY' is not a valid value for \`Priority'."
esac
#
diff --git a/gcc/gccspec.c b/gcc/gccspec.c
index fcad38d9b52..8576ee0d603 100644
--- a/gcc/gccspec.c
+++ b/gcc/gccspec.c
@@ -1,5 +1,5 @@
/* Specific flags and argument handling of the C front-end.
- Copyright (C) 1999 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2001 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -29,7 +29,67 @@ lang_specific_driver (in_argc, in_argv, in_added_libraries)
const char *const **in_argv ATTRIBUTE_UNUSED;
int *in_added_libraries ATTRIBUTE_UNUSED;
{
- return; /* Not used for C. */
+#ifdef ENABLE_SHARED_LIBGCC
+ int i;
+
+ /* The new argument list will be contained in this. */
+ const char **arglist;
+
+ /* True if we should add -shared-libgcc to the command-line. */
+ int shared_libgcc = 0;
+
+ /* The total number of arguments with the new stuff. */
+ int argc;
+
+ /* The argument list. */
+ const char *const *argv;
+
+ argc = *in_argc;
+ argv = *in_argv;
+
+ for (i = 1; i < argc; i++)
+ {
+ if (argv[i][0] == '-')
+ {
+ if (strcmp (argv[i], "-static-libgcc") == 0
+ || strcmp (argv[i], "-static") == 0)
+ return;
+ }
+ else
+ {
+ int len;
+
+ /* If the filename ends in .m or .mi, we are compiling ObjC
+ and want to pass -shared-libgcc. */
+ len = strlen (argv[i]);
+ if ((len > 2 && argv[i][len - 2] == '.' && argv[i][len - 1] == 'm')
+ || (len > 3 && argv[i][len - 3] == '.' && argv[i][len - 2] == 'm'
+ && argv[i][len - 1] == 'i'))
+ shared_libgcc = 1;
+ }
+ }
+
+ if (shared_libgcc)
+ {
+ /* Make sure to have room for the trailing NULL argument. */
+ arglist = (const char **) xmalloc ((argc+2) * sizeof (char *));
+
+ i = 0;
+ do
+ {
+ arglist[i] = argv[i];
+ i++;
+ }
+ while (i < argc);
+
+ arglist[i++] = "-shared-libgcc";
+
+ arglist[i] = NULL;
+
+ *in_argc = i;
+ *in_argv = arglist;
+ }
+#endif
}
/* Called before linking. Returns 0 on success and -1 on failure. */
diff --git a/gcc/gcse.c b/gcc/gcse.c
index f423c5ec27d..e4372de4cdb 100644
--- a/gcc/gcse.c
+++ b/gcc/gcse.c
@@ -159,6 +159,7 @@ Boston, MA 02111-1307, USA. */
#include "output.h"
#include "function.h"
#include "expr.h"
+#include "params.h"
#include "obstack.h"
#define obstack_chunk_alloc gmalloc
@@ -627,8 +628,8 @@ static int handle_avail_expr PARAMS ((rtx, struct expr *));
static int classic_gcse PARAMS ((void));
static int one_classic_gcse_pass PARAMS ((int));
static void invalidate_nonnull_info PARAMS ((rtx, rtx, void *));
-static void delete_null_pointer_checks_1 PARAMS ((unsigned int *, sbitmap *,
- sbitmap *,
+static void delete_null_pointer_checks_1 PARAMS ((varray_type *, unsigned int *,
+ sbitmap *, sbitmap *,
struct null_pointer_info *));
static rtx process_insert_insn PARAMS ((struct expr *));
static int pre_edge_insert PARAMS ((struct edge_list *, struct expr **));
@@ -680,7 +681,7 @@ gcse_main (f, file)
a high connectivity will take a long time and is unlikely to be
particularly useful.
- In normal circumstances a cfg should have about twice has many edges
+ In normal circumstances a cfg should have about twice as many edges
as blocks. But we do not want to punish small functions which have
a couple switch statements. So we require a relatively large number
of basic blocks and the ratio of edges to blocks to be high. */
@@ -692,6 +693,19 @@ gcse_main (f, file)
return 0;
}
+ /* If allocating memory for the cprop bitmap would take up too much
+ storage it's better just to disable the optimization. */
+ if ((n_basic_blocks
+ * SBITMAP_SET_SIZE (max_gcse_regno)
+ * sizeof (SBITMAP_ELT_TYPE)) > MAX_GCSE_MEMORY)
+ {
+ if (warn_disabled_optimization)
+ warning ("GCSE disabled: %d basic blocks and %d registers",
+ n_basic_blocks, max_gcse_regno);
+
+ return 0;
+ }
+
/* See what modes support reg/reg copy operations. */
if (! can_copy_init_p)
{
@@ -1917,7 +1931,7 @@ hash_scan_set (pat, insn, set_p)
if (GET_CODE (dest) == REG)
{
int regno = REGNO (dest);
- rtx tmp;
+ rtx tmp, note;
/* Only record sets of pseudo-regs in the hash table. */
if (! set_p
@@ -1925,7 +1939,14 @@ hash_scan_set (pat, insn, set_p)
/* Don't GCSE something if we can't do a reg/reg copy. */
&& can_copy_p [GET_MODE (dest)]
/* Is SET_SRC something we want to gcse? */
- && want_to_gcse_p (src))
+ && want_to_gcse_p (src)
+ /* Don't GCSE if it has attached REG_EQUIV note.
+ At this point this only function parameters should have
+ REG_EQUIV notes and if the argument slot is used somewhere
+ explicitely, it means address of parameter has been taken,
+ so we should not extend the lifetime of the pseudo. */
+ && ((note = find_reg_note (insn, REG_EQUIV, NULL_RTX)) == 0
+ || GET_CODE (XEXP (note, 0)) != MEM))
{
/* An expression is not anticipatable if its operands are
modified before this insn. */
@@ -4967,7 +4988,9 @@ invalidate_nonnull_info (x, setter, data)
they are not our responsibility to free. */
static void
-delete_null_pointer_checks_1 (block_reg, nonnull_avin, nonnull_avout, npi)
+delete_null_pointer_checks_1 (delete_list, block_reg, nonnull_avin,
+ nonnull_avout, npi)
+ varray_type *delete_list;
unsigned int *block_reg;
sbitmap *nonnull_avin;
sbitmap *nonnull_avout;
@@ -5097,9 +5120,12 @@ delete_null_pointer_checks_1 (block_reg, nonnull_avin, nonnull_avout, npi)
LABEL_NUSES (JUMP_LABEL (new_jump))++;
emit_barrier_after (new_jump);
}
- delete_insn (last_insn);
+ if (!*delete_list)
+ VARRAY_RTX_INIT (*delete_list, 10, "delete_list");
+
+ VARRAY_PUSH_RTX (*delete_list, last_insn);
if (compare_and_branch == 2)
- delete_insn (earliest);
+ VARRAY_PUSH_RTX (*delete_list, earliest);
/* Don't check this block again. (Note that BLOCK_END is
invalid here; we deleted the last instruction in the
@@ -5138,10 +5164,12 @@ delete_null_pointer_checks (f)
{
sbitmap *nonnull_avin, *nonnull_avout;
unsigned int *block_reg;
+ varray_type delete_list = NULL;
int bb;
int reg;
int regs_per_pass;
int max_reg;
+ unsigned int i;
struct null_pointer_info npi;
/* If we have only a single block, then there's nothing to do. */
@@ -5152,7 +5180,7 @@ delete_null_pointer_checks (f)
a high connectivity will take a long time and is unlikely to be
particularly useful.
- In normal circumstances a cfg should have about twice has many edges
+ In normal circumstances a cfg should have about twice as many edges
as blocks. But we do not want to punish small functions which have
a couple switch statements. So we require a relatively large number
of basic blocks and the ratio of edges to blocks to be high. */
@@ -5210,10 +5238,18 @@ delete_null_pointer_checks (f)
{
npi.min_reg = reg;
npi.max_reg = MIN (reg + regs_per_pass, max_reg);
- delete_null_pointer_checks_1 (block_reg, nonnull_avin,
+ delete_null_pointer_checks_1 (&delete_list, block_reg, nonnull_avin,
nonnull_avout, &npi);
}
+ /* Now delete the instructions all at once. This breaks the CFG. */
+ if (delete_list)
+ {
+ for (i = 0; i < VARRAY_ACTIVE_SIZE (delete_list); i++)
+ delete_insn (VARRAY_RTX (delete_list, i));
+ VARRAY_FREE (delete_list);
+ }
+
/* Free the table of registers compared at the end of every block. */
free (block_reg);
diff --git a/gcc/genemit.c b/gcc/genemit.c
index 2b3c5da0215..eec35ea9566 100644
--- a/gcc/genemit.c
+++ b/gcc/genemit.c
@@ -768,8 +768,6 @@ from the machine description file `md'. */\n\n");
printf ("#include \"flags.h\"\n");
printf ("#include \"output.h\"\n");
printf ("#include \"insn-config.h\"\n");
- printf ("#include \"insn-flags.h\"\n");
- printf ("#include \"insn-codes.h\"\n");
printf ("#include \"hard-reg-set.h\"\n");
printf ("#include \"recog.h\"\n");
printf ("#include \"resource.h\"\n");
diff --git a/gcc/genflags.c b/gcc/genflags.c
index 2e18585edbb..2153b48b8b2 100644
--- a/gcc/genflags.c
+++ b/gcc/genflags.c
@@ -156,16 +156,16 @@ gen_proto (insn)
gen_macro (name, num, 5);
}
- printf ("extern rtx gen_%-*s PARAMS ((", max_id_len, name);
+ printf ("extern struct rtx_def * gen_%-*s PARAMS ((", max_id_len, name);
if (num == 0)
printf ("void");
else
{
while (num-- > 1)
- printf ("rtx, ");
+ printf ("struct rtx_def *, ");
- printf ("rtx");
+ printf ("struct rtx_def *");
}
printf ("));\n");
@@ -254,6 +254,7 @@ from the machine description file `md'. */\n\n");
obstack_grow (&obstack, &dummy, sizeof (rtx));
insns = (rtx *) obstack_finish (&obstack);
+ printf ("struct rtx_def;\n");
for (insn_ptr = insns; *insn_ptr; insn_ptr++)
gen_proto (*insn_ptr);
diff --git a/gcc/genopinit.c b/gcc/genopinit.c
index 9aeaee7baac..e8b12112865 100644
--- a/gcc/genopinit.c
+++ b/gcc/genopinit.c
@@ -326,8 +326,6 @@ from the machine description file `md'. */\n\n");
printf ("#include \"system.h\"\n");
printf ("#include \"rtl.h\"\n");
printf ("#include \"flags.h\"\n");
- printf ("#include \"insn-flags.h\"\n");
- printf ("#include \"insn-codes.h\"\n");
printf ("#include \"insn-config.h\"\n");
printf ("#include \"recog.h\"\n");
printf ("#include \"expr.h\"\n");
diff --git a/gcc/genoutput.c b/gcc/genoutput.c
index dc36d465dd6..34624306e62 100644
--- a/gcc/genoutput.c
+++ b/gcc/genoutput.c
@@ -229,9 +229,7 @@ output_prologue ()
printf ("#include \"real.h\"\n");
printf ("#include \"insn-config.h\"\n\n");
printf ("#include \"conditions.h\"\n");
- printf ("#include \"insn-flags.h\"\n");
printf ("#include \"insn-attr.h\"\n\n");
- printf ("#include \"insn-codes.h\"\n\n");
printf ("#include \"recog.h\"\n\n");
printf ("#include \"toplev.h\"\n");
printf ("#include \"output.h\"\n");
diff --git a/gcc/genrecog.c b/gcc/genrecog.c
index cbca47b8e2d..2856fe67d8a 100644
--- a/gcc/genrecog.c
+++ b/gcc/genrecog.c
@@ -1432,7 +1432,7 @@ merge_trees (oldh, addh)
how expensive/important the test is. Given that the tests
are also ordered within the list, examining the first is
sufficient. */
- if (add->tests->type < old->tests->type)
+ if ((int) add->tests->type < (int) old->tests->type)
insert_before = old;
}
diff --git a/gcc/gensupport.c b/gcc/gensupport.c
index cde2a220b4e..e6efd8ffb87 100644
--- a/gcc/gensupport.c
+++ b/gcc/gensupport.c
@@ -321,7 +321,7 @@ static void
identify_predicable_attribute ()
{
struct queue_elem *elem;
- char *true, *false;
+ char *p_true, *p_false;
const char *value;
size_t len;
@@ -338,21 +338,21 @@ identify_predicable_attribute ()
found:
value = XSTR (elem->data, 1);
len = strlen (value);
- false = (char *) xmalloc (len + 1);
- memcpy (false, value, len + 1);
+ p_false = (char *) xmalloc (len + 1);
+ memcpy (p_false, value, len + 1);
- true = strchr (false, ',');
- if (true == NULL || strchr (++true, ',') != NULL)
+ p_true = strchr (p_false, ',');
+ if (p_true == NULL || strchr (++p_true, ',') != NULL)
{
message_with_line (elem->lineno,
"Attribute `predicable' is not a boolean");
errors = 1;
return;
}
- true[-1] = '\0';
+ p_true[-1] = '\0';
- predicable_true = true;
- predicable_false = false;
+ predicable_true = p_true;
+ predicable_false = p_false;
switch (GET_CODE (XEXP (elem->data, 2)))
{
@@ -373,9 +373,9 @@ identify_predicable_attribute ()
return;
}
- if (strcmp (value, true) == 0)
+ if (strcmp (value, p_true) == 0)
predicable_default = 1;
- else if (strcmp (value, false) == 0)
+ else if (strcmp (value, p_false) == 0)
predicable_default = 0;
else
{
diff --git a/gcc/ggc-common.c b/gcc/ggc-common.c
index 44f8cc2a1c7..b82eb5b8df6 100644
--- a/gcc/ggc-common.c
+++ b/gcc/ggc-common.c
@@ -1,5 +1,5 @@
/* Simple garbage collection for the GNU compiler.
- Copyright (C) 1999, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -48,7 +48,7 @@ static void ggc_mark_rtx_varray_ptr PARAMS ((void *));
static void ggc_mark_tree_varray_ptr PARAMS ((void *));
static void ggc_mark_tree_hash_table_ptr PARAMS ((void *));
static void ggc_mark_trees PARAMS ((void));
-static boolean ggc_mark_tree_hash_table_entry PARAMS ((struct hash_entry *,
+static bool ggc_mark_tree_hash_table_entry PARAMS ((struct hash_entry *,
hash_table_key));
/* Maintain global roots that are preserved during GC. */
@@ -277,9 +277,6 @@ ggc_mark_rtx_children (r)
case 'V': case 'E':
ggc_mark_rtvec (XVEC (r, i));
break;
- case 'S': case 's':
- ggc_mark_if_gcable (XSTR (r, i));
- break;
}
}
}
@@ -376,12 +373,14 @@ ggc_mark_trees ()
ggc_mark_tree (DECL_RESULT_FLD (t));
ggc_mark_tree (DECL_INITIAL (t));
ggc_mark_tree (DECL_ABSTRACT_ORIGIN (t));
- ggc_mark_tree (DECL_ASSEMBLER_NAME (t));
ggc_mark_tree (DECL_SECTION_NAME (t));
ggc_mark_tree (DECL_MACHINE_ATTRIBUTES (t));
- ggc_mark_rtx (DECL_RTL (t));
+ if (DECL_RTL_SET_P (t))
+ ggc_mark_rtx (DECL_RTL (t));
ggc_mark_rtx (DECL_LIVE_RANGE_RTL (t));
ggc_mark_tree (DECL_VINDEX (t));
+ if (DECL_ASSEMBLER_NAME_SET_P (t))
+ ggc_mark_tree (DECL_ASSEMBLER_NAME (t));
lang_mark_tree (t);
break;
@@ -465,7 +464,7 @@ ggc_mark_tree_varray (v)
/* Mark the hash table-entry HE. It's key field is really a tree. */
-static boolean
+static bool
ggc_mark_tree_hash_table_entry (he, k)
struct hash_entry *he;
hash_table_key k ATTRIBUTE_UNUSED;
diff --git a/gcc/ggc-none.c b/gcc/ggc-none.c
index e75ff4a687d..01399d26d20 100644
--- a/gcc/ggc-none.c
+++ b/gcc/ggc-none.c
@@ -22,14 +22,8 @@
need GC at all. This prevents problems with pulling in all the
tree stuff. */
-/* We are used by gengenrtl, before genrtl.h exists. But we don't
- need it either. */
-#define NO_GENRTL_H
-
#include "config.h"
#include "system.h"
-#include "rtl.h"
-#include "tm_p.h"
#include "ggc.h"
void *
diff --git a/gcc/ggc-page.c b/gcc/ggc-page.c
index 4738ed248dd..559183e2d34 100644
--- a/gcc/ggc-page.c
+++ b/gcc/ggc-page.c
@@ -1001,16 +1001,6 @@ ggc_set_mark (p)
return 0;
}
-/* Mark P, but check first that it was allocated by the collector. */
-
-void
-ggc_mark_if_gcable (p)
- const void *p;
-{
- if (p && ggc_allocated_p (p))
- ggc_set_mark (p);
-}
-
/* Return the size of the gc-able object P. */
size_t
diff --git a/gcc/ggc-simple.c b/gcc/ggc-simple.c
index b5cab1bcb23..457b420f260 100644
--- a/gcc/ggc-simple.c
+++ b/gcc/ggc-simple.c
@@ -1,5 +1,5 @@
/* Simple garbage collection for the GNU compiler.
- Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -228,29 +228,6 @@ ggc_set_mark (p)
return 0;
}
-/* Mark a node, but check first to see that it's really gc-able memory. */
-
-void
-ggc_mark_if_gcable (p)
- const void *p;
-{
- struct ggc_mem *x;
-
- if (p == NULL)
- return;
-
- x = (struct ggc_mem *) ((const char *)p - offsetof (struct ggc_mem, u));
- if (! tree_lookup (x))
- return;
-
- if (x->mark)
- return;
-
- x->mark = 1;
- G.allocated += x->size;
- G.objects += 1;
-}
-
/* Return the size of the gc-able object P. */
size_t
diff --git a/gcc/ggc.h b/gcc/ggc.h
index e222916a5a6..3decec35615 100644
--- a/gcc/ggc.h
+++ b/gcc/ggc.h
@@ -1,5 +1,5 @@
/* Garbage collection for the GNU compiler.
- Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -99,9 +99,6 @@ extern void ggc_mark_rtvec_children PARAMS ((struct rtvec_def *));
ggc_set_mark (a__); \
} while (0)
-/* Mark, but only if it was allocated in collectable memory. */
-extern void ggc_mark_if_gcable PARAMS ((const void *));
-
/* A GC implementation must provide these functions. */
/* Initialize the garbage collector. */
@@ -141,8 +138,8 @@ const char *ggc_alloc_string PARAMS ((const char *contents, int length));
/* Make a copy of S, in GC-able memory. */
#define ggc_strdup(S) ggc_alloc_string((S), -1)
-/* Invoke the collector. This is really just a hint, but in the case of
- the simple collector, the only time it will happen. */
+/* Invoke the collector. Garbage collection occurs only when this
+ function is called, not during allocations. */
void ggc_collect PARAMS ((void));
/* Actually set the mark on a particular region of memory, but don't
diff --git a/gcc/ginclude/ppc-asm.h b/gcc/ginclude/ppc-asm.h
index af17dfa8f5e..f5dc595f137 100644
--- a/gcc/ginclude/ppc-asm.h
+++ b/gcc/ginclude/ppc-asm.h
@@ -105,6 +105,7 @@
#if defined(_CALL_AIXDESC)
#define FUNC_NAME(name) GLUE(.,name)
+#define JUMP_TARGET(name) FUNC_NAME(name)
#define FUNC_START(name) \
.section DESC_SECTION,"aw"; \
name: \
@@ -123,6 +124,7 @@ GLUE(.L,name): \
#elif defined(__WINNT__)
#define FUNC_NAME(name) GLUE(..,name)
+#define JUMP_TARGET(name) FUNC_NAME(name)
#define FUNC_START(name) \
.pdata; \
.align 2; \
@@ -141,6 +143,7 @@ GLUE(FE_MOT_RESVD..,name):
#elif defined(_CALL_NT)
#define FUNC_NAME(name) GLUE(..,name)
+#define JUMP_TARGET(name) FUNC_NAME(name)
#define FUNC_START(name) \
.section DESC_SECTION,"aw"; \
name: \
@@ -158,6 +161,11 @@ GLUE(.L,name): \
#else
#define FUNC_NAME(name) GLUE(__USER_LABEL_PREFIX__,name)
+#if defined __PIC__ || defined __pic__
+#define JUMP_TARGET(name) FUNC_NAME(name@plt)
+#else
+#define JUMP_TARGET(name) FUNC_NAME(name)
+#endif
#define FUNC_START(name) \
.type FUNC_NAME(name),@function; \
.globl FUNC_NAME(name); \
diff --git a/gcc/glimits.h b/gcc/glimits.h
index 979e7155803..2d5119d7ad5 100644
--- a/gcc/glimits.h
+++ b/gcc/glimits.h
@@ -1,9 +1,5 @@
#ifndef _LIMITS_H___
-#ifndef _MACH_MACHLIMITS_H_
-
-/* _MACH_MACHLIMITS_H_ is used on OSF/1. */
#define _LIMITS_H___
-#define _MACH_MACHLIMITS_H_
/* Number of bits in a `char'. */
#undef CHAR_BIT
@@ -64,7 +60,7 @@
/* Minimum and maximum values a `signed long int' can hold.
(Same as `int'). */
#ifndef __LONG_MAX__
-#if defined (__alpha__) || (defined (__sparc__) && defined(__arch64__)) || defined (__sparcv9)
+#if defined (__alpha__) || (defined (__sparc__) && defined(__arch64__)) || defined (__sparcv9) || defined (__s390x__)
#define __LONG_MAX__ 9223372036854775807L
#else
#define __LONG_MAX__ 2147483647L
@@ -107,5 +103,4 @@
#define ULONG_LONG_MAX (LONG_LONG_MAX * 2ULL + 1)
#endif
-#endif /* _MACH_MACHLIMITS_H_ */
#endif /* _LIMITS_H___ */
diff --git a/gcc/gsyslimits.h b/gcc/gsyslimits.h
index cc7b3fb877a..a3628025e8a 100644
--- a/gcc/gsyslimits.h
+++ b/gcc/gsyslimits.h
@@ -4,5 +4,5 @@
instead of this text. */
#define _GCC_NEXT_LIMITS_H /* tell gcc's limits.h to recurse */
- #include_next <limits.h>
+#include_next <limits.h>
#undef _GCC_NEXT_LIMITS_H
diff --git a/gcc/gthr-dce.h b/gcc/gthr-dce.h
index 761b9482c63..a49db8fa990 100644
--- a/gcc/gthr-dce.h
+++ b/gcc/gthr-dce.h
@@ -1,6 +1,6 @@
/* Compile this one with gcc. */
-/* Copyright (C) 1997, 1999, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1999, 2000, 2001 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -37,12 +37,21 @@ Boston, MA 02111-1307, USA. */
#include <pthread.h>
+#ifdef __cplusplus
+#define UNUSED(x) x
+#else
+#define UNUSED(x) x __attribute__((unused))
+#endif
+
typedef pthread_key_t __gthread_key_t;
typedef pthread_once_t __gthread_once_t;
typedef pthread_mutex_t __gthread_mutex_t;
#define __GTHREAD_ONCE_INIT pthread_once_init
-/* Howto define __GTHREAD_MUTEX_INIT? */
+
+#define __GTHREAD_MUTEX_INIT_FUNCTION __gthread_mutex_init_function
+
+#define __GTHREAD_MUTEX_INIT_DEFAULT pthread_once_init
#if SUPPORTS_WEAK && GTHREAD_USE_WEAK
@@ -53,7 +62,7 @@ typedef pthread_mutex_t __gthread_mutex_t;
#pragma weak pthread_getspecific
#pragma weak pthread_setspecific
#pragma weak pthread_create
-
+#pragma weak pthread_mutex_init
#pragma weak pthread_mutex_lock
#pragma weak pthread_mutex_trylock
#pragma weak pthread_mutex_unlock
@@ -67,13 +76,12 @@ typedef pthread_mutex_t __gthread_mutex_t;
#pragma weak pthread_cond_wait
#pragma weak pthread_exit
#pragma weak pthread_getunique_np
-#pragma weak pthread_mutex_init
#pragma weak pthread_mutex_destroy
#pragma weak pthread_self
#pragma weak pthread_yield
#endif
-static void *__gthread_active_ptr = &pthread_create;
+static void *__gthread_active_ptr = (void *) &pthread_create;
static inline int
__gthread_active_p (void)
@@ -412,16 +420,17 @@ __gthread_key_create (__gthread_key_t *key, void (*dtor) (void *))
}
static inline int
-__gthread_key_dtor (__gthread_key_t key, void *ptr)
+__gthread_key_dtor (UNUSED (__gthread_key_t key), UNUSED (void *ptr))
{
/* Nothing needed. */
return 0;
}
static inline int
-__gthread_key_delete (__gthread_key_t key)
+__gthread_key_delete (UNUSED (__gthread_key_t key))
{
- return pthread_key_delete (key);
+ /* Operation is not supported. */
+ return -1;
}
static inline void *
@@ -440,6 +449,13 @@ __gthread_setspecific (__gthread_key_t key, const void *ptr)
return pthread_setspecific (key, (void *) ptr);
}
+static inline void
+__gthread_mutex_init_function (__gthread_mutex_t *mutex)
+{
+ if (__gthread_active_p ())
+ pthread_mutex_init (mutex, pthread_mutexattr_default);
+}
+
static inline int
__gthread_mutex_lock (__gthread_mutex_t *mutex)
{
@@ -469,4 +485,6 @@ __gthread_mutex_unlock (__gthread_mutex_t *mutex)
#endif /* _LIBOBJC */
+#undef UNUSED
+
#endif /* not __gthr_dce_h */
diff --git a/gcc/gthr-posix.h b/gcc/gthr-posix.h
index 7b92316055a..5b055ae3d1b 100644
--- a/gcc/gthr-posix.h
+++ b/gcc/gthr-posix.h
@@ -1,6 +1,6 @@
/* Threads compatibility routines for libgcc2 and libobjc. */
/* Compile this one with gcc. */
-/* Copyright (C) 1997, 1999, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1999, 2000, 2001 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -67,10 +67,17 @@ typedef pthread_mutex_t __gthread_mutex_t;
#pragma weak pthread_mutex_init
#pragma weak pthread_mutex_destroy
#pragma weak pthread_self
+#pragma weak sched_get_priority_max
+#pragma weak sched_get_priority_min
#pragma weak sched_yield
+#pragma weak pthread_attr_destroy
+#pragma weak pthread_attr_init
+#pragma weak pthread_attr_setdetachstate
+#pragma weak pthread_getschedparam
+#pragma weak pthread_setschedparam
#endif
-static void *__gthread_active_ptr = &pthread_create;
+static void *__gthread_active_ptr = (void *) &pthread_create;
static inline int
__gthread_active_p (void)
@@ -124,8 +131,8 @@ __gthread_objc_init_thread_system(void)
return 0;
}
}
- else
- return -1;
+
+ return -1;
}
/* Close the threads subsystem. */
@@ -153,7 +160,7 @@ __gthread_objc_thread_detach(void (*func)(void *), void *arg)
return NULL;
if ( !(pthread_create(&new_thread_handle, NULL, (void *)func, arg)) )
- thread_id = *(objc_thread_t *)&new_thread_handle;
+ thread_id = (objc_thread_t) new_thread_handle;
else
thread_id = NULL;
@@ -241,13 +248,9 @@ static inline objc_thread_t
__gthread_objc_thread_id(void)
{
if (__gthread_active_p ())
- {
- pthread_t self = pthread_self();
-
- return *(objc_thread_t *)&self;
- }
+ return (objc_thread_t) pthread_self();
else
- return (objc_thread_t)1;
+ return (objc_thread_t) 1;
}
/* Sets the thread's local storage pointer. */
@@ -328,30 +331,39 @@ __gthread_objc_mutex_deallocate(objc_mutex_t mutex)
static inline int
__gthread_objc_mutex_lock(objc_mutex_t mutex)
{
- if (__gthread_active_p ())
- return pthread_mutex_lock((pthread_mutex_t *)mutex->backend);
- else
- return 0;
+ if (__gthread_active_p ()
+ && pthread_mutex_lock((pthread_mutex_t *)mutex->backend) != 0)
+ {
+ return -1;
+ }
+
+ return 0;
}
/* Try to grab a lock on a mutex. */
static inline int
__gthread_objc_mutex_trylock(objc_mutex_t mutex)
{
- if (__gthread_active_p ())
- return pthread_mutex_trylock((pthread_mutex_t *)mutex->backend);
- else
- return 0;
+ if (__gthread_active_p ()
+ && pthread_mutex_trylock((pthread_mutex_t *)mutex->backend) != 0)
+ {
+ return -1;
+ }
+
+ return 0;
}
/* Unlock the mutex */
static inline int
__gthread_objc_mutex_unlock(objc_mutex_t mutex)
{
- if (__gthread_active_p ())
- return pthread_mutex_unlock((pthread_mutex_t *)mutex->backend);
- else
- return 0;
+ if (__gthread_active_p ()
+ && pthread_mutex_unlock((pthread_mutex_t *)mutex->backend) != 0)
+ {
+ return -1;
+ }
+
+ return 0;
}
/* Backend condition mutex functions */
diff --git a/gcc/gthr-rtems.h b/gcc/gthr-rtems.h
index 05400c57a3c..036f76a9e5b 100644
--- a/gcc/gthr-rtems.h
+++ b/gcc/gthr-rtems.h
@@ -1,7 +1,7 @@
/* RTEMS threads compatibily routines for libgcc2 and libobjc.
by: Rosimildo da Silva( rdasilva@connecttel.com ) */
/* Compile this one with gcc. */
-/* Copyright (C) 1997, 1999, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1999, 2000, 2002 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -30,6 +30,9 @@ Boston, MA 02111-1307, USA. */
#ifndef __gthr_rtems_h
#define __gthr_rtems_h
+#ifdef __cplusplus
+extern "C" {
+#endif
#define __GTHREADS 1
@@ -62,6 +65,13 @@ extern int rtems_gxx_mutex_trylock (__gthread_mutex_t *mutex);
extern int rtems_gxx_mutex_unlock (__gthread_mutex_t *mutex);
+/* RTEMS threading is always active */
+static inline int
+__gthread_active_p (void)
+{
+ return 1;
+}
+
/* Wrapper calls */
static inline int
__gthread_once (__gthread_once_t *once, void (*func) ())
@@ -117,4 +127,9 @@ __gthread_mutex_unlock (__gthread_mutex_t *mutex)
return rtems_gxx_mutex_unlock( mutex );
}
+#ifdef __cplusplus
+}
+#endif
+
+
#endif /* __gthr_rtems_h */
diff --git a/gcc/gthr-single.h b/gcc/gthr-single.h
index 4bfea5e3087..fa773717190 100644
--- a/gcc/gthr-single.h
+++ b/gcc/gthr-single.h
@@ -35,6 +35,12 @@ typedef int __gthread_mutex_t;
#define __GTHREAD_MUTEX_INIT 0
+#ifdef __cplusplus
+#define UNUSED(x)
+#else
+#define UNUSED(x) x __attribute__((unused))
+#endif
+
#ifdef _LIBOBJC
/* Thread local storage for a single thread */
@@ -62,7 +68,7 @@ __gthread_objc_close_thread_system(void)
/* Create a new thread of execution. */
static inline objc_thread_t
-__gthread_objc_thread_detach(void (*func)(void *arg), void *arg)
+__gthread_objc_thread_detach(void (* func)(void *), void * UNUSED(arg))
{
/* No thread support available */
return NULL;
@@ -70,7 +76,7 @@ __gthread_objc_thread_detach(void (*func)(void *arg), void *arg)
/* Set the current thread's priority. */
static inline int
-__gthread_objc_thread_set_priority(int priority)
+__gthread_objc_thread_set_priority(int UNUSED(priority))
{
/* No thread support available */
return -1;
@@ -127,21 +133,21 @@ __gthread_objc_thread_get_data(void)
/* Allocate a mutex. */
static inline int
-__gthread_objc_mutex_allocate(objc_mutex_t mutex)
+__gthread_objc_mutex_allocate(objc_mutex_t UNUSED(mutex))
{
return 0;
}
/* Deallocate a mutex. */
static inline int
-__gthread_objc_mutex_deallocate(objc_mutex_t mutex)
+__gthread_objc_mutex_deallocate(objc_mutex_t UNUSED(mutex))
{
return 0;
}
/* Grab a lock on a mutex. */
static inline int
-__gthread_objc_mutex_lock(objc_mutex_t mutex)
+__gthread_objc_mutex_lock(objc_mutex_t UNUSED(mutex))
{
/* There can only be one thread, so we always get the lock */
return 0;
@@ -149,7 +155,7 @@ __gthread_objc_mutex_lock(objc_mutex_t mutex)
/* Try to grab a lock on a mutex. */
static inline int
-__gthread_objc_mutex_trylock(objc_mutex_t mutex)
+__gthread_objc_mutex_trylock(objc_mutex_t UNUSED(mutex))
{
/* There can only be one thread, so we always get the lock */
return 0;
@@ -157,7 +163,7 @@ __gthread_objc_mutex_trylock(objc_mutex_t mutex)
/* Unlock the mutex */
static inline int
-__gthread_objc_mutex_unlock(objc_mutex_t mutex)
+__gthread_objc_mutex_unlock(objc_mutex_t UNUSED(mutex))
{
return 0;
}
@@ -166,35 +172,36 @@ __gthread_objc_mutex_unlock(objc_mutex_t mutex)
/* Allocate a condition. */
static inline int
-__gthread_objc_condition_allocate(objc_condition_t condition)
+__gthread_objc_condition_allocate(objc_condition_t UNUSED(condition))
{
return 0;
}
/* Deallocate a condition. */
static inline int
-__gthread_objc_condition_deallocate(objc_condition_t condition)
+__gthread_objc_condition_deallocate(objc_condition_t UNUSED(condition))
{
return 0;
}
/* Wait on the condition */
static inline int
-__gthread_objc_condition_wait(objc_condition_t condition, objc_mutex_t mutex)
+__gthread_objc_condition_wait(objc_condition_t UNUSED(condition),
+ objc_mutex_t UNUSED(mutex))
{
return 0;
}
/* Wake up all threads waiting on this condition. */
static inline int
-__gthread_objc_condition_broadcast(objc_condition_t condition)
+__gthread_objc_condition_broadcast(objc_condition_t UNUSED(condition))
{
return 0;
}
/* Wake up one thread waiting on this condition. */
static inline int
-__gthread_objc_condition_signal(objc_condition_t condition)
+__gthread_objc_condition_signal(objc_condition_t UNUSED(condition))
{
return 0;
}
@@ -208,23 +215,25 @@ __gthread_active_p (void)
}
static inline int
-__gthread_mutex_lock (__gthread_mutex_t *mutex __attribute__ ((__unused__)))
+__gthread_mutex_lock (__gthread_mutex_t * UNUSED(mutex))
{
return 0;
}
static inline int
-__gthread_mutex_trylock (__gthread_mutex_t *mutex __attribute__ ((__unused__)))
+__gthread_mutex_trylock (__gthread_mutex_t * UNUSED(mutex))
{
return 0;
}
static inline int
-__gthread_mutex_unlock (__gthread_mutex_t *mutex __attribute__ ((__unused__)))
+__gthread_mutex_unlock (__gthread_mutex_t * UNUSED(mutex))
{
return 0;
}
#endif /* _LIBOBJC */
+#undef UNUSED
+
#endif /* not __gthr_single_h */
diff --git a/gcc/gthr-solaris.h b/gcc/gthr-solaris.h
index fca3084f9a7..ed25cfdcbc6 100644
--- a/gcc/gthr-solaris.h
+++ b/gcc/gthr-solaris.h
@@ -81,7 +81,7 @@ typedef mutex_t __gthread_mutex_t;
/* This will not actually work in Solaris 2.5, since libc contains
dummy symbols of all thr_* routines. */
-static void *__gthread_active_ptr = &thr_create;
+static void *__gthread_active_ptr = (void *) &thr_create;
static inline int
__gthread_active_p (void)
diff --git a/gcc/gthr-win32.h b/gcc/gthr-win32.h
index 7b991385c81..2ad1dca1fe7 100644
--- a/gcc/gthr-win32.h
+++ b/gcc/gthr-win32.h
@@ -181,7 +181,7 @@ int
__gthread_objc_thread_exit(void)
{
/* exit the thread */
- ExitThread(__gthread_objc_thread_exit_status);
+ ExitThread(__objc_thread_exit_status);
/* Failed if we reached here */
return -1;
diff --git a/gcc/haifa-sched.c b/gcc/haifa-sched.c
index b4053b5e90c..d795c2d86d1 100644
--- a/gcc/haifa-sched.c
+++ b/gcc/haifa-sched.c
@@ -144,7 +144,6 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "flags.h"
#include "insn-config.h"
#include "insn-attr.h"
-#include "insn-flags.h"
#include "except.h"
#include "toplev.h"
#include "recog.h"
@@ -719,38 +718,43 @@ static int
priority (insn)
rtx insn;
{
- int this_priority;
rtx link;
if (! INSN_P (insn))
return 0;
- if ((this_priority = INSN_PRIORITY (insn)) == 0)
+ if (! INSN_PRIORITY_KNOWN (insn))
{
+ int this_priority = 0;
+
if (INSN_DEPEND (insn) == 0)
this_priority = insn_cost (insn, 0, 0);
else
- for (link = INSN_DEPEND (insn); link; link = XEXP (link, 1))
- {
- rtx next;
- int next_priority;
+ {
+ for (link = INSN_DEPEND (insn); link; link = XEXP (link, 1))
+ {
+ rtx next;
+ int next_priority;
- if (RTX_INTEGRATED_P (link))
- continue;
+ if (RTX_INTEGRATED_P (link))
+ continue;
- next = XEXP (link, 0);
+ next = XEXP (link, 0);
- /* Critical path is meaningful in block boundaries only. */
- if (! (*current_sched_info->contributes_to_priority) (next, insn))
- continue;
+ /* Critical path is meaningful in block boundaries only. */
+ if (! (*current_sched_info->contributes_to_priority) (next, insn))
+ continue;
- next_priority = insn_cost (insn, link, next) + priority (next);
- if (next_priority > this_priority)
- this_priority = next_priority;
- }
+ next_priority = insn_cost (insn, link, next) + priority (next);
+ if (next_priority > this_priority)
+ this_priority = next_priority;
+ }
+ }
INSN_PRIORITY (insn) = this_priority;
+ INSN_PRIORITY_KNOWN (insn) = 1;
}
- return this_priority;
+
+ return INSN_PRIORITY (insn);
}
/* Macros and functions for keeping the priority queue sorted, and
diff --git a/gcc/hash.c b/gcc/hash.c
index 1f7e49e4085..1cf6b685c64 100644
--- a/gcc/hash.c
+++ b/gcc/hash.c
@@ -41,7 +41,7 @@ hash_table_init_n (table, newfunc, hash, comp, size)
struct hash_table *,
hash_table_key));
unsigned long (*hash) PARAMS ((hash_table_key));
- boolean (*comp) PARAMS ((hash_table_key, hash_table_key));
+ bool (*comp) PARAMS ((hash_table_key, hash_table_key));
unsigned int size;
{
unsigned int alloc;
@@ -66,7 +66,7 @@ hash_table_init (table, newfunc, hash, comp)
struct hash_table *,
hash_table_key));
unsigned long (*hash) PARAMS ((hash_table_key));
- boolean (*comp) PARAMS ((hash_table_key, hash_table_key));
+ bool (*comp) PARAMS ((hash_table_key, hash_table_key));
{
hash_table_init_n (table, newfunc, hash, comp, DEFAULT_SIZE);
}
@@ -87,7 +87,7 @@ struct hash_entry *
hash_lookup (table, key, create, copy)
struct hash_table *table;
hash_table_key key;
- boolean create;
+ int create;
hash_table_key (*copy) PARAMS ((struct obstack* memory,
hash_table_key key));
{
@@ -150,7 +150,7 @@ hash_allocate (table, size)
void
hash_traverse (table, func, info)
struct hash_table *table;
- boolean (*func) PARAMS ((struct hash_entry *, hash_table_key));
+ bool (*func) PARAMS ((struct hash_entry *, hash_table_key));
PTR info;
{
unsigned int i;
@@ -193,7 +193,7 @@ string_hash (k)
/* Compare two strings. Return non-zero iff the two strings are
the same. */
-boolean
+bool
string_compare (k1, k2)
hash_table_key k1;
hash_table_key k2;
diff --git a/gcc/hash.h b/gcc/hash.h
index d79bc08dee1..bd75f94c6f9 100644
--- a/gcc/hash.h
+++ b/gcc/hash.h
@@ -25,12 +25,6 @@ Boston, MA 02111-1307, USA. */
#include "obstack.h"
-#undef false
-#undef true
-#undef boolean
-
-typedef enum {false, true} boolean;
-
typedef PTR hash_table_key;
/* Hash table routines. There is no way to free up a hash table. */
@@ -70,7 +64,7 @@ struct hash_table
/* A function to compute the hash code for a key in the hash table. */
unsigned long (*hash) PARAMS ((hash_table_key));
/* A function to compare two keys. */
- boolean (*comp) PARAMS ((hash_table_key, hash_table_key));
+ bool (*comp) PARAMS ((hash_table_key, hash_table_key));
/* An obstack for this hash table. */
struct obstack memory;
};
@@ -82,7 +76,7 @@ extern void hash_table_init
struct hash_table *,
hash_table_key),
unsigned long (*hash) (hash_table_key),
- boolean (*comp) (hash_table_key, hash_table_key)));
+ bool (*comp) (hash_table_key, hash_table_key)));
/* Initialize a hash table specifying a size. */
extern void hash_table_init_n
@@ -91,7 +85,7 @@ extern void hash_table_init_n
struct hash_table *,
hash_table_key),
unsigned long (*hash) (hash_table_key),
- boolean (*comp) (hash_table_key, hash_table_key),
+ bool (*comp) (hash_table_key, hash_table_key),
unsigned int size));
/* Free up a hash table. */
@@ -102,7 +96,7 @@ extern void hash_table_free PARAMS ((struct hash_table *));
COPY is non-NULL, it is used to copy the KEY before storing it in
the hash table. */
extern struct hash_entry *hash_lookup
- PARAMS ((struct hash_table *, hash_table_key key, boolean create,
+ PARAMS ((struct hash_table *, hash_table_key key, int create,
hash_table_key (*copy)(struct obstack*, hash_table_key)));
/* Base method for creating a hash table entry. */
@@ -118,7 +112,7 @@ extern PTR hash_allocate PARAMS ((struct hash_table *,
element. If the function returns false, the traversal stops. The
INFO argument is passed to the function. */
extern void hash_traverse PARAMS ((struct hash_table *,
- boolean (*) (struct hash_entry *,
+ bool (*) (struct hash_entry *,
hash_table_key),
hash_table_key info));
@@ -126,7 +120,7 @@ extern void hash_traverse PARAMS ((struct hash_table *,
extern unsigned long string_hash PARAMS ((hash_table_key k));
/* Compare two strings K1, K2 which are really of type `char*'. */
-extern boolean string_compare PARAMS ((hash_table_key k1,
+extern bool string_compare PARAMS ((hash_table_key k1,
hash_table_key k2));
/* Copy a string K, which is really of type `char*'. */
diff --git a/gcc/ifcvt.c b/gcc/ifcvt.c
index 652814e4b39..aeeb0b5ba06 100644
--- a/gcc/ifcvt.c
+++ b/gcc/ifcvt.c
@@ -64,6 +64,9 @@ static int num_updated_if_blocks;
/* # of basic blocks that were removed. */
static int num_removed_blocks;
+/* True if life data ok at present. */
+static bool life_data_ok;
+
/* The post-dominator relation on the original block numbers. */
static sbitmap *post_dominators;
@@ -94,6 +97,7 @@ static int find_if_case_2 PARAMS ((basic_block, edge, edge));
static int find_memory PARAMS ((rtx *, void *));
static int dead_or_predicable PARAMS ((basic_block, basic_block,
basic_block, rtx, int));
+static void noce_emit_move_insn PARAMS ((rtx, rtx));
/* Abuse the basic_block AUX field to store the original block index,
as well as a flag indicating that the block should be rescaned for
@@ -284,9 +288,14 @@ cond_exec_get_condition (jump)
reverse the condition. */
if (GET_CODE (XEXP (test_if, 2)) == LABEL_REF
&& XEXP (XEXP (test_if, 2), 0) == JUMP_LABEL (jump))
- cond = gen_rtx_fmt_ee (reverse_condition (GET_CODE (cond)),
- GET_MODE (cond), XEXP (cond, 0),
- XEXP (cond, 1));
+ {
+ enum rtx_code rev = reversed_comparison_code (cond, jump);
+ if (rev == UNKNOWN)
+ return NULL_RTX;
+
+ cond = gen_rtx_fmt_ee (rev, GET_MODE (cond), XEXP (cond, 0),
+ XEXP (cond, 1));
+ }
return cond;
}
@@ -314,6 +323,7 @@ cond_exec_process_if_block (test_bb, then_bb, else_bb, join_bb)
rtx true_prob_val; /* probability of else block */
rtx false_prob_val; /* probability of then block */
int n_insns;
+ enum rtx_code false_code;
/* Find the conditional jump to the ELSE or JOIN part, and isolate
the test. */
@@ -375,9 +385,13 @@ cond_exec_process_if_block (test_bb, then_bb, else_bb, join_bb)
the conditionally executed code. */
true_expr = test_expr;
- false_expr = gen_rtx_fmt_ee (reverse_condition (GET_CODE (true_expr)),
- GET_MODE (true_expr), XEXP (true_expr, 0),
- XEXP (true_expr, 1));
+
+ false_code = reversed_comparison_code (true_expr, test_bb->end);
+ if (false_code != UNKNOWN)
+ false_expr = gen_rtx_fmt_ee (false_code, GET_MODE (true_expr),
+ XEXP (true_expr, 0), XEXP (true_expr, 1));
+ else
+ false_expr = NULL_RTX;
#ifdef IFCVT_MODIFY_TESTS
/* If the machine description needs to modify the tests, such as setting a
@@ -407,8 +421,9 @@ cond_exec_process_if_block (test_bb, then_bb, else_bb, join_bb)
to conditional execution. */
if (then_end
- && ! cond_exec_process_insns (then_start, then_end,
- false_expr, false_prob_val, then_mod_ok))
+ && (! false_expr
+ || ! cond_exec_process_insns (then_start, then_end, false_expr,
+ false_prob_val, then_mod_ok)))
goto fail;
if (else_bb
@@ -533,6 +548,34 @@ noce_emit_store_flag (if_info, x, reversep, normalize)
|| code == GEU || code == GTU), normalize);
}
+/* Emit instruction to move a rtx into STRICT_LOW_PART. */
+static void
+noce_emit_move_insn (x, y)
+ rtx x, y;
+{
+ enum machine_mode outmode, inmode;
+ rtx outer, inner;
+ int bitpos;
+
+ if (GET_CODE (x) != STRICT_LOW_PART)
+ {
+ emit_move_insn (x, y);
+ return;
+ }
+
+ outer = XEXP (x, 0);
+ inner = XEXP (outer, 0);
+ outmode = GET_MODE (outer);
+ inmode = GET_MODE (inner);
+ bitpos = SUBREG_WORD (outer) * BITS_PER_WORD;
+ if (BYTES_BIG_ENDIAN)
+ bitpos += (GET_MODE_BITSIZE (inmode) - GET_MODE_BITSIZE (outmode))
+ % BITS_PER_WORD;
+ store_bit_field (inner, GET_MODE_BITSIZE (outmode),
+ bitpos, outmode, y, GET_MODE_BITSIZE (inmode),
+ GET_MODE_BITSIZE (inmode));
+}
+
/* Convert "if (test) x = 1; else x = 0".
Only try 0 and STORE_FLAG_VALUE here. Other combinations will be
@@ -564,7 +607,7 @@ noce_try_store_flag (if_info)
if (target)
{
if (target != if_info->x)
- emit_move_insn (if_info->x, target);
+ noce_emit_move_insn (if_info->x, target);
seq = get_insns ();
end_sequence ();
@@ -598,6 +641,11 @@ noce_try_store_flag_constants (if_info)
itrue = INTVAL (if_info->b);
diff = itrue - ifalse;
+ /* Make sure we can represent the difference between the two values. */
+ if ((itrue - ifalse > 0)
+ != ((ifalse < 0) != (itrue < 0) ? ifalse < 0 : ifalse < itrue))
+ return FALSE;
+
can_reverse = can_reverse_comparison_p (if_info->cond, if_info->jump);
reversep = 0;
@@ -686,7 +734,7 @@ noce_try_store_flag_constants (if_info)
}
if (target != if_info->x)
- emit_move_insn (if_info->x, target);
+ noce_emit_move_insn (if_info->x, target);
seq = get_insns ();
end_sequence ();
@@ -744,7 +792,7 @@ noce_try_store_flag_inc (if_info)
if (target)
{
if (target != if_info->x)
- emit_move_insn (if_info->x, target);
+ noce_emit_move_insn (if_info->x, target);
seq = get_insns ();
end_sequence ();
@@ -795,7 +843,7 @@ noce_try_store_flag_mask (if_info)
if (target)
{
if (target != if_info->x)
- emit_move_insn (if_info->x, target);
+ noce_emit_move_insn (if_info->x, target);
seq = get_insns ();
end_sequence ();
@@ -894,7 +942,7 @@ noce_try_cmove (if_info)
if (target)
{
if (target != if_info->x)
- emit_move_insn (if_info->x, target);
+ noce_emit_move_insn (if_info->x, target);
seq = get_insns ();
end_sequence ();
@@ -1051,10 +1099,10 @@ noce_try_cmove_arith (if_info)
if (MEM_ALIAS_SET (if_info->a) == MEM_ALIAS_SET (if_info->b))
MEM_ALIAS_SET (tmp) = MEM_ALIAS_SET (if_info->a);
- emit_move_insn (if_info->x, tmp);
+ noce_emit_move_insn (if_info->x, tmp);
}
else if (target != x)
- emit_move_insn (x, target);
+ noce_emit_move_insn (x, target);
tmp = get_insns ();
end_sequence ();
@@ -1210,7 +1258,8 @@ noce_process_if_block (test_bb, then_bb, else_bb, join_bb)
{
if (no_new_pseudos)
return FALSE;
- x = gen_reg_rtx (GET_MODE (x));
+ x = gen_reg_rtx (GET_MODE (GET_CODE (x) == STRICT_LOW_PART
+ ? XEXP (x, 0) : x));
}
/* Don't operate on sources that may trap or are volatile. */
@@ -1242,9 +1291,17 @@ noce_process_if_block (test_bb, then_bb, else_bb, join_bb)
that case don't do anything and let the code below delete INSN_A. */
if (insn_b && else_bb)
{
+ rtx note;
+
if (else_bb && insn_b == else_bb->end)
else_bb->end = PREV_INSN (insn_b);
reorder_insns (insn_b, insn_b, PREV_INSN (if_info.cond_earliest));
+
+ /* If there was a REG_EQUAL note, delete it since it may have been
+ true due to this insn being after a jump. */
+ if ((note = find_reg_note (insn_b, REG_EQUAL, NULL_RTX)) != 0)
+ remove_note (insn_b, note);
+
insn_b = NULL_RTX;
}
/* If we have "x = b; if (...) x = a;", and x has side-effects, then
@@ -1305,7 +1362,7 @@ noce_process_if_block (test_bb, then_bb, else_bb, join_bb)
if (orig_x != x)
{
start_sequence ();
- emit_move_insn (orig_x, x);
+ noce_emit_move_insn (orig_x, x);
insn_b = gen_sequence ();
end_sequence ();
@@ -1358,7 +1415,7 @@ merge_if_block (test_bb, then_bb, else_bb, join_bb)
/* First merge TEST block into THEN block. This is a no-brainer since
the THEN block did not have a code label to begin with. */
- if (combo_bb->global_live_at_end)
+ if (life_data_ok)
COPY_REG_SET (combo_bb->global_live_at_end, then_bb->global_live_at_end);
merge_blocks_nomove (combo_bb, then_bb);
num_removed_blocks++;
@@ -1398,7 +1455,7 @@ merge_if_block (test_bb, then_bb, else_bb, join_bb)
else if (join_bb->pred == NULL || join_bb->pred->pred_next == NULL)
{
/* We can merge the JOIN. */
- if (combo_bb->global_live_at_end)
+ if (life_data_ok)
COPY_REG_SET (combo_bb->global_live_at_end,
join_bb->global_live_at_end);
merge_blocks_nomove (combo_bb, join_bb);
@@ -1572,7 +1629,7 @@ find_if_block (test_bb, then_edge, else_edge)
/* Make sure IF, THEN, and ELSE, blocks are adjacent. Actually, we
get the first condition for free, since we've already asserted that
there's a fallthru edge from IF to THEN. */
- /* ??? As an enhancement, move the ELSE block. Have to deal with EH and
+ /* ??? As an enhancement, move the ELSE block. Have to deal with
BLOCK notes, if by no other means than aborting the merge if they
exist. Sticky enough I don't want to think about it now. */
next_index = then_bb->index;
@@ -1897,6 +1954,8 @@ dead_or_predicable (test_bb, merge_bb, other_bb, new_dest, reversep)
rtx cond, prob_val;
cond = cond_exec_get_condition (jump);
+ if (! cond)
+ return FALSE;
prob_val = find_reg_note (jump, REG_BR_PROB, NULL_RTX);
if (prob_val)
@@ -1904,8 +1963,10 @@ dead_or_predicable (test_bb, merge_bb, other_bb, new_dest, reversep)
if (reversep)
{
- cond = gen_rtx_fmt_ee (reverse_condition (GET_CODE (cond)),
- GET_MODE (cond), XEXP (cond, 0),
+ enum rtx_code rev = reversed_comparison_code (cond, jump);
+ if (rev == UNKNOWN)
+ return FALSE;
+ cond = gen_rtx_fmt_ee (rev, GET_MODE (cond), XEXP (cond, 0),
XEXP (cond, 1));
if (prob_val)
prob_val = GEN_INT (REG_BR_PROB_BASE - INTVAL (prob_val));
@@ -2087,14 +2148,15 @@ dead_or_predicable (test_bb, merge_bb, other_bb, new_dest, reversep)
/* Main entry point for all if-conversion. */
void
-if_convert (life_data_ok)
- int life_data_ok;
+if_convert (x_life_data_ok)
+ int x_life_data_ok;
{
int block_num;
num_possible_if_blocks = 0;
num_updated_if_blocks = 0;
num_removed_blocks = 0;
+ life_data_ok = (x_life_data_ok != 0);
/* Free up basic_block_for_insn so that we don't have to keep it
up to date, either here or in merge_blocks_nomove. */
diff --git a/gcc/install.texi b/gcc/install.texi
deleted file mode 100644
index 65397a4df6b..00000000000
--- a/gcc/install.texi
+++ /dev/null
@@ -1,2288 +0,0 @@
-@c Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
-@c This is part of the GCC manual.
-@c For copying conditions, see the file gcc.texi.
-
-@c The text of this file appears in the file INSTALL
-@c in the GCC distribution, as well as in the GCC manual.
-
-Note most of this information is out of date and superseded by the
-online GCC install procedures @uref{http://gcc.gnu.org/install/}. It is
-provided for historical reference only.
-
-@ifclear INSTALLONLY
-@node Installation
-@chapter Installing GNU CC
-@end ifclear
-@cindex installing GNU CC
-
-@menu
-* Configuration Files:: Files created by running @code{configure}.
-* Configurations:: Configurations Supported by GNU CC.
-* Other Dir:: Compiling in a separate directory (not where the source is).
-* Cross-Compiler:: Building and installing a cross-compiler.
-* Sun Install:: See below for installation on the Sun.
-* VMS Install:: See below for installation on VMS.
-* Collect2:: How @code{collect2} works; how it finds @code{ld}.
-* Header Dirs:: Understanding the standard header file directories.
-@end menu
-
-Here is the procedure for installing GNU CC on a GNU or Unix system.
-See @ref{VMS Install}, for VMS systems. In this section we assume you
-compile in the same directory that contains the source files; see
-@ref{Other Dir}, to find out how to compile in a separate directory on
-Unix systems.
-
-You cannot install GNU C by itself on MSDOS; it will not compile under
-any MSDOS compiler except itself. You need to get the complete
-compilation package DJGPP, which includes binaries as well as sources,
-and includes all the necessary compilation tools and libraries.
-
-@enumerate
-@item
-If you have built GNU CC previously in the same directory for a
-different target machine, do @samp{make distclean} to delete all files
-that might be invalid. One of the files this deletes is
-@file{Makefile}; if @samp{make distclean} complains that @file{Makefile}
-does not exist, it probably means that the directory is already suitably
-clean.
-
-@item
-On a System V release 4 system, make sure @file{/usr/bin} precedes
-@file{/usr/ucb} in @code{PATH}. The @code{cc} command in
-@file{/usr/ucb} uses libraries which have bugs.
-
-@cindex Bison parser generator
-@cindex parser generator, Bison
-@item
-Make sure the Bison parser generator is installed. (This is unnecessary
-if the Bison output file @file{c-parse.c} is more recent than
-@file{c-parse.y},and you do not plan to change the @samp{.y} file.)
-
-Bison versions older than Sept 8, 1988 will produce incorrect output
-for @file{c-parse.c}.
-
-@item
-If you have chosen a configuration for GNU CC which requires other GNU
-tools (such as GAS or the GNU linker) instead of the standard system
-tools, install the required tools in the build directory under the names
-@file{as}, @file{ld} or whatever is appropriate. This will enable the
-compiler to find the proper tools for compilation of the program
-@file{enquire}.
-
-Alternatively, you can do subsequent compilation using a value of the
-@code{PATH} environment variable such that the necessary GNU tools come
-before the standard system tools.
-
-@item
-Specify the host, build and target machine configurations. You do this
-when you run the @file{configure} script.
-
-The @dfn{build} machine is the system which you are using, the
-@dfn{host} machine is the system where you want to run the resulting
-compiler (normally the build machine), and the @dfn{target} machine is
-the system for which you want the compiler to generate code.
-
-If you are building a compiler to produce code for the machine it runs
-on (a native compiler), you normally do not need to specify any operands
-to @file{configure}; it will try to guess the type of machine you are on
-and use that as the build, host and target machines. So you don't need
-to specify a configuration when building a native compiler unless
-@file{configure} cannot figure out what your configuration is or guesses
-wrong.
-
-In those cases, specify the build machine's @dfn{configuration name}
-with the @samp{--host} option; the host and target will default to be
-the same as the host machine. (If you are building a cross-compiler,
-see @ref{Cross-Compiler}.)
-
-Here is an example:
-
-@smallexample
-./configure --host=sparc-sun-sunos4.1
-@end smallexample
-
-A configuration name may be canonical or it may be more or less
-abbreviated.
-
-A canonical configuration name has three parts, separated by dashes.
-It looks like this: @samp{@var{cpu}-@var{company}-@var{system}}.
-(The three parts may themselves contain dashes; @file{configure}
-can figure out which dashes serve which purpose.) For example,
-@samp{m68k-sun-sunos4.1} specifies a Sun 3.
-
-You can also replace parts of the configuration by nicknames or aliases.
-For example, @samp{sun3} stands for @samp{m68k-sun}, so
-@samp{sun3-sunos4.1} is another way to specify a Sun 3. You can also
-use simply @samp{sun3-sunos}, since the version of SunOS is assumed by
-default to be version 4.
-
-You can specify a version number after any of the system types, and some
-of the CPU types. In most cases, the version is irrelevant, and will be
-ignored. So you might as well specify the version if you know it.
-
-See @ref{Configurations}, for a list of supported configuration names and
-notes on many of the configurations. You should check the notes in that
-section before proceeding any further with the installation of GNU CC.
-
-@item
-When running @code{configure}, you may also need to specify certain
-additional options that describe variant hardware and software
-configurations. These are @samp{--with-gnu-as}, @samp{--with-gnu-ld},
-@samp{--with-stabs} and @samp{--nfp}.
-
-@table @samp
-@item --with-gnu-as
-If you will use GNU CC with the GNU assembler (GAS), you should declare
-this by using the @samp{--with-gnu-as} option when you run
-@file{configure}.
-
-Using this option does not install GAS. It only modifies the output of
-GNU CC to work with GAS. Building and installing GAS is up to you.
-
-Conversely, if you @emph{do not} wish to use GAS and do not specify
-@samp{--with-gnu-as} when building GNU CC, it is up to you to make sure
-that GAS is not installed. GNU CC searches for a program named
-@code{as} in various directories; if the program it finds is GAS, then
-it runs GAS. If you are not sure where GNU CC finds the assembler it is
-using, try specifying @samp{-v} when you run it.
-
-The systems where it makes a difference whether you use GAS are@*
-@samp{hppa1.0-@var{any}-@var{any}}, @samp{hppa1.1-@var{any}-@var{any}},
-@samp{i386-@var{any}-sysv}, @samp{i386-@var{any}-isc},@*
-@samp{i860-@var{any}-bsd}, @samp{m68k-bull-sysv},@*
-@samp{m68k-hp-hpux}, @samp{m68k-sony-bsd},@*
-@samp{m68k-altos-sysv}, @samp{m68000-hp-hpux},@*
-@samp{m68000-att-sysv}, @samp{@var{any}-lynx-lynxos},
-and @samp{mips-@var{any}}).
-On any other system, @samp{--with-gnu-as} has no effect.
-
-On the systems listed above (except for the HP-PA, for ISC on the
-386, and for @samp{mips-sgi-irix5.*}), if you use GAS, you should also
-use the GNU linker (and specify @samp{--with-gnu-ld}).
-
-@item --with-gnu-ld
-Specify the option @samp{--with-gnu-ld} if you plan to use the GNU
-linker with GNU CC.
-
-This option does not cause the GNU linker to be installed; it just
-modifies the behavior of GNU CC to work with the GNU linker.
-@c Specifically, it inhibits the installation of @code{collect2}, a program
-@c which otherwise serves as a front-end for the system's linker on most
-@c configurations.
-
-@item --with-stabs
-On MIPS based systems and on Alphas, you must specify whether you want
-GNU CC to create the normal ECOFF debugging format, or to use BSD-style
-stabs passed through the ECOFF symbol table. The normal ECOFF debug
-format cannot fully handle languages other than C. BSD stabs format can
-handle other languages, but it only works with the GNU debugger GDB.
-
-Normally, GNU CC uses the ECOFF debugging format by default; if you
-prefer BSD stabs, specify @samp{--with-stabs} when you configure GNU
-CC.
-
-No matter which default you choose when you configure GNU CC, the user
-can use the @samp{-gcoff} and @samp{-gstabs+} options to specify explicitly
-the debug format for a particular compilation.
-
-@samp{--with-stabs} is meaningful on the ISC system on the 386, also, if
-@samp{--with-gas} is used. It selects use of stabs debugging
-information embedded in COFF output. This kind of debugging information
-supports C++ well; ordinary COFF debugging information does not.
-
-@samp{--with-stabs} is also meaningful on 386 systems running SVR4. It
-selects use of stabs debugging information embedded in ELF output. The
-C++ compiler currently (2.6.0) does not support the DWARF debugging
-information normally used on 386 SVR4 platforms; stabs provide a
-workable alternative. This requires gas and gdb, as the normal SVR4
-tools can not generate or interpret stabs.
-
-@item --nfp
-On certain systems, you must specify whether the machine has a floating
-point unit. These systems include @samp{m68k-sun-sunos@var{n}} and
-@samp{m68k-isi-bsd}. On any other system, @samp{--nfp} currently has no
-effect, though perhaps there are other systems where it could usefully
-make a difference.
-
-@cindex Haifa scheduler
-@cindex scheduler, experimental
-@item --enable-haifa
-@itemx --disable-haifa
-Use @samp{--enable-haifa} to enable use of an experimental instruction
-scheduler (from IBM Haifa). This may or may not produce better code.
-Some targets on which it is known to be a win enable it by default; use
-@samp{--disable-haifa} to disable it in these cases. @code{configure}
-will print out whether the Haifa scheduler is enabled when it is run.
-
-@cindex Objective C threads
-@cindex threads, Objective C
-@item --enable-threads=@var{type}
-Certain systems, notably Linux-based GNU systems, can't be relied on to
-supply a threads facility for the Objective C runtime and so will
-default to single-threaded runtime. They may, however, have a library
-threads implementation available, in which case threads can be enabled
-with this option by supplying a suitable @var{type}, probably
-@samp{posix}. The possibilities for @var{type} are @samp{single},
-@samp{posix}, @samp{win32}, @samp{solaris}, @samp{irix} and @samp{mach}.
-
-@cindex Internal Compiler Checking
-@item --enable-checking
-When you specify this option, the compiler is built to perform checking
-of tree node types when referencing fields of that node. This does not
-change the generated code, but adds error checking within the compiler.
-This will slow down the compiler and may only work properly if you
-are building the compiler with GNU C.
-
-@cindex Native Language Support
-@cindex NLS
-@item --enable-nls
-@itemx --disable-nls
-The @samp{--enable-nls} option enables Native Language Support (NLS),
-which lets GCC output diagnostics in languages other than American
-English. Native Language Support is enabled by default if not doing a
-canadian cross build. The @samp{--disable-nls} option disables NLS.
-
-@cindex @code{gettext}
-@item --with-included-gettext
-If NLS is enbled, the @samp{--with-included-gettext} option causes the build
-procedure to prefer its copy of GNU @code{gettext}. This is the default. If
-you want the GCC build procedure to prefer the host's @code{gettext}
-libraries, use @samp{--without-included-gettext}.
-
-@cindex @code{catgets}
-@item --with-catgets
-If NLS is enabled, and if the host lacks @code{gettext} but has the
-inferior @code{catgets} interface, the GCC build procedure normally
-ignores @code{catgets} and instead uses GCC's copy of the GNU
-@code{gettext} library. The @samp{--with-catgets} option causes the
-build procedure to use the host's @code{catgets} in this situation.
-
-@cindex @code{maintainer-mode}
-@item --enable-maintainer-mode
-The build rules that regenerate the GCC master message catalog
-@code{gcc.pot} are normally disabled. This is because it can only be rebuilt
-if the complete source tree is present. If you have changed the sources and
-want to rebuild the catalog, configuring with
-@samp{--enable-maintainer-mode} will enable this. Note that you need a
-special version of the @code{gettext} tools to do so.
-
-@cindex Windows32 Registry support
-@item --enable-win32-registry
-@itemx --enable-win32-registry=@var{KEY}
-@itemx --disable-win32-registry
-The @samp{--enable-win32-registry} option enables Windows-hosted GCC
-to look up installations paths in the registry using the following key:
-
-@smallexample
-@code{HKEY_LOCAL_MACHINE\SOFTWARE\Free Software Foundation\<KEY>}
-@end smallexample
-
-<KEY> defaults to GCC version number, and can be overridden by the
-@code{--enable-win32-registry=KEY} option. Vendors and distributors
-who use custom installers are encouraged to provide a different key,
-perhaps one comprised of vendor name and GCC version number, to
-avoid conflict with existing installations. This feature is enabled
-by default, and can be disabled by @code{--disable-win32-registry}
-option. This option has no effect on the other hosts.
-@end table
-
-@item
-In certain cases, you should specify certain other options when you run
-@code{configure}.
-
-@itemize @bullet
-@item
-The standard directory for installing GNU CC is @file{/usr/local/lib}.
-If you want to install its files somewhere else, specify
-@samp{--prefix=@var{dir}} when you run @file{configure}. Here @var{dir}
-is a directory name to use instead of @file{/usr/local} for all purposes
-with one exception: the directory @file{/usr/local/include} is searched
-for header files no matter where you install the compiler. To override
-this name, use the @code{--with-local-prefix} option below. The directory
-you specify need not exist, but its parent directory must exist.
-
-@item
-Specify @samp{--with-local-prefix=@var{dir}} if you want the compiler to
-search directory @file{@var{dir}/include} for locally installed header
-files @emph{instead} of @file{/usr/local/include}.
-
-You should specify @samp{--with-local-prefix} @strong{only} if your site has
-a different convention (not @file{/usr/local}) for where to put
-site-specific files.
-
-The default value for @samp{--with-local-prefix} is @file{/usr/local}
-regardless of the value of @samp{--prefix}. Specifying @samp{--prefix}
-has no effect on which directory GNU CC searches for local header files.
-This may seem counterintuitive, but actually it is logical.
-
-The purpose of @samp{--prefix} is to specify where to @emph{install GNU
-CC}. The local header files in @file{/usr/local/include}---if you put
-any in that directory---are not part of GNU CC. They are part of other
-programs---perhaps many others. (GNU CC installs its own header files
-in another directory which is based on the @samp{--prefix} value.)
-
-@strong{Do not} specify @file{/usr} as the @samp{--with-local-prefix}! The
-directory you use for @samp{--with-local-prefix} @strong{must not} contain
-any of the system's standard header files. If it did contain them,
-certain programs would be miscompiled (including GNU Emacs, on certain
-targets), because this would override and nullify the header file
-corrections made by the @code{fixincludes} script.
-
-Indications are that people who use this option use it based on
-mistaken ideas of what it is for. People use it as if it specified
-where to install part of GNU CC. Perhaps they make this assumption
-because installing GNU CC creates the directory.
-@end itemize
-
-@item
-Build the compiler. Just type @samp{make LANGUAGES=c} in the compiler
-directory.
-
-@samp{LANGUAGES=c} specifies that only the C compiler should be
-compiled. The makefile normally builds compilers for all the supported
-languages; currently, C, C++, Objective C, Java, FORTRAN, and CHILL.
-However, C is the only language that is sure to work when you build with
-other non-GNU C compilers. In addition, building anything but C at this
-stage is a waste of time.
-
-In general, you can specify the languages to build by typing the
-argument @samp{LANGUAGES="@var{list}"}, where @var{list} is one or more
-words from the list @samp{c}, @samp{c++}, @samp{objective-c},
-@samp{java}, @samp{f77}, and @samp{CHILL}. If you have any additional
-GNU compilers as subdirectories of the GNU CC source directory, you may
-also specify their names in this list.
-
-Ignore any warnings you may see about ``statement not reached'' in
-@file{insn-emit.c}; they are normal. Also, warnings about ``unknown
-escape sequence'' are normal in @file{genopinit.c} and perhaps some
-other files. Likewise, you should ignore warnings about ``constant is
-so large that it is unsigned'' in @file{insn-emit.c} and
-@file{insn-recog.c}, and a warning about a comparison always being zero
-in @file{enquire.o}. Any other compilation errors may represent bugs in
-the port to your machine or operating system, and
-@ifclear INSTALLONLY
-should be investigated and reported (@pxref{Bugs}).
-@end ifclear
-@ifset INSTALLONLY
-should be investigated and reported.
-@end ifset
-
-Some compilers fail to compile GNU CC because they have bugs or
-limitations. For example, the Microsoft compiler is said to run out of
-macro space. Some Ultrix compilers run out of expression space; then
-you need to break up the statement where the problem happens.
-
-@item
-If you are building a cross-compiler, stop here. @xref{Cross-Compiler}.
-
-@cindex stage1
-@item
-Move the first-stage object files and executables into a subdirectory
-with this command:
-
-@smallexample
-make stage1
-@end smallexample
-
-The files are moved into a subdirectory named @file{stage1}.
-Once installation is complete, you may wish to delete these files
-with @code{rm -r stage1}.
-
-@item
-If you have chosen a configuration for GNU CC which requires other GNU
-tools (such as GAS or the GNU linker) instead of the standard system
-tools, install the required tools in the @file{stage1} subdirectory
-under the names @file{as}, @file{ld} or whatever is appropriate. This
-will enable the stage 1 compiler to find the proper tools in the
-following stage.
-
-Alternatively, you can do subsequent compilation using a value of the
-@code{PATH} environment variable such that the necessary GNU tools come
-before the standard system tools.
-
-@item
-Recompile the compiler with itself, with this command:
-
-@smallexample
-make CC="stage1/xgcc -Bstage1/" CFLAGS="-g -O2"
-@end smallexample
-
-This is called making the stage 2 compiler.
-
-The command shown above builds compilers for all the supported
-languages. If you don't want them all, you can specify the languages to
-build by typing the argument @samp{LANGUAGES="@var{list}"}. @var{list}
-should contain one or more words from the list @samp{c}, @samp{c++},
-@samp{objective-c}, and @samp{proto}. Separate the words with spaces.
-@samp{proto} stands for the programs @code{protoize} and
-@code{unprotoize}; they are not a separate language, but you use
-@code{LANGUAGES} to enable or disable their installation.
-
-If you are going to build the stage 3 compiler, then you might want to
-build only the C language in stage 2.
-
-Once you have built the stage 2 compiler, if you are short of disk
-space, you can delete the subdirectory @file{stage1}.
-
-On a 68000 or 68020 system lacking floating point hardware,
-unless you have selected a @file{tm.h} file that expects by default
-that there is no such hardware, do this instead:
-
-@smallexample
-make CC="stage1/xgcc -Bstage1/" CFLAGS="-g -O2 -msoft-float"
-@end smallexample
-
-@item
-If you wish to test the compiler by compiling it with itself one more
-time, install any other necessary GNU tools (such as GAS or the GNU
-linker) in the @file{stage2} subdirectory as you did in the
-@file{stage1} subdirectory, then do this:
-
-@smallexample
-make stage2
-make CC="stage2/xgcc -Bstage2/" CFLAGS="-g -O2"
-@end smallexample
-
-@noindent
-This is called making the stage 3 compiler. Aside from the @samp{-B}
-option, the compiler options should be the same as when you made the
-stage 2 compiler. But the @code{LANGUAGES} option need not be the
-same. The command shown above builds compilers for all the supported
-languages; if you don't want them all, you can specify the languages to
-build by typing the argument @samp{LANGUAGES="@var{list}"}, as described
-above.
-
-If you do not have to install any additional GNU tools, you may use the
-command
-
-@smallexample
-make bootstrap LANGUAGES=@var{language-list} BOOT_CFLAGS=@var{option-list}
-@end smallexample
-
-@noindent
-instead of making @file{stage1}, @file{stage2}, and performing
-the two compiler builds.
-
-@item
-Compare the latest object files with the stage 2 object files---they
-ought to be identical, aside from time stamps (if any).
-
-On some systems, meaningful comparison of object files is impossible;
-they always appear ``different.'' This is currently true on Solaris and
-some systems that use ELF object file format. On some versions of Irix
-on SGI machines and DEC Unix (OSF/1) on Alpha systems, you will not be
-able to compare the files without specifying @file{-save-temps}; see the
-description of individual systems above to see if you get comparison
-failures. You may have similar problems on other systems.
-
-Use this command to compare the files:
-
-@smallexample
-make compare
-@end smallexample
-
-This will mention any object files that differ between stage 2 and stage
-3. Any difference, no matter how innocuous, indicates that the stage 2
-compiler has compiled GNU CC incorrectly, and is therefore a potentially
-@ifclear INSTALLONLY
-serious bug which you should investigate and report (@pxref{Bugs}).
-@end ifclear
-@ifset INSTALLONLY
-serious bug which you should investigate and report.
-@end ifset
-
-If your system does not put time stamps in the object files, then this
-is a faster way to compare them (using the Bourne shell):
-
-@smallexample
-for file in *.o; do
-cmp $file stage2/$file
-done
-@end smallexample
-
-If you have built the compiler with the @samp{-mno-mips-tfile} option on
-MIPS machines, you will not be able to compare the files.
-
-@item
-Install the compiler driver, the compiler's passes and run-time support
-with @samp{make install}. Use the same value for @code{CC},
-@code{CFLAGS} and @code{LANGUAGES} that you used when compiling the
-files that are being installed. One reason this is necessary is that
-some versions of Make have bugs and recompile files gratuitously when
-you do this step. If you use the same variable values, those files will
-be recompiled properly.
-
-For example, if you have built the stage 2 compiler, you can use the
-following command:
-
-@smallexample
-make install CC="stage2/xgcc -Bstage2/" CFLAGS="-g -O" LANGUAGES="@var{list}"
-@end smallexample
-
-@noindent
-This copies the files @file{cc1}, @file{cpp} and @file{libgcc.a} to
-files @file{cc1}, @file{cpp} and @file{libgcc.a} in the directory
-@file{/usr/local/lib/gcc-lib/@var{target}/@var{version}}, which is where
-the compiler driver program looks for them. Here @var{target} is the
-canonicalized form of target machine type specified when you ran
-@file{configure}, and @var{version} is the version number of GNU CC.
-This naming scheme permits various versions and/or cross-compilers to
-coexist. It also copies the executables for compilers for other
-languages (e.g., @file{cc1plus} for C++) to the same directory.
-
-This also copies the driver program @file{xgcc} into
-@file{/usr/local/bin/gcc}, so that it appears in typical execution
-search paths. It also copies @file{gcc.1} into
-@file{/usr/local/man/man1} and info pages into @file{/usr/local/info}.
-
-On some systems, this command causes recompilation of some files. This
-is usually due to bugs in @code{make}. You should either ignore this
-problem, or use GNU Make.
-
-@cindex @code{alloca} and SunOS
-@strong{Warning: there is a bug in @code{alloca} in the Sun library. To
-avoid this bug, be sure to install the executables of GNU CC that were
-compiled by GNU CC. (That is, the executables from stage 2 or 3, not
-stage 1.) They use @code{alloca} as a built-in function and never the
-one in the library.}
-
-(It is usually better to install GNU CC executables from stage 2 or 3,
-since they usually run faster than the ones compiled with some other
-compiler.)
-
-@item
-GNU CC includes a runtime library for Objective-C because it is an
-integral part of the language. You can find the files associated with
-the library in the subdirectory @file{objc}. The GNU Objective-C
-Runtime Library requires header files for the target's C library in
-order to be compiled,and also requires the header files for the target's
-thread library if you want thread support. @xref{Cross Headers,
-Cross-Compilers and Header Files, Cross-Compilers and Header Files}, for
-discussion about header files issues for cross-compilation.
-
-When you run @file{configure}, it picks the appropriate Objective-C
-thread implementation file for the target platform. In some situations,
-you may wish to choose a different back-end as some platforms support
-multiple thread implementations or you may wish to disable thread
-support completely. You do this by specifying a value for the
-@var{OBJC_THREAD_FILE} makefile variable on the command line when you
-run make, for example:
-
-@smallexample
-make CC="stage2/xgcc -Bstage2/" CFLAGS="-g -O2" OBJC_THREAD_FILE=thr-single
-@end smallexample
-
-@noindent
-Below is a list of the currently available back-ends.
-
-@itemize @bullet
-@item thr-single
-Disable thread support, should work for all platforms.
-@item thr-decosf1
-DEC OSF/1 thread support.
-@item thr-irix
-SGI IRIX thread support.
-@item thr-mach
-Generic MACH thread support, known to work on NEXTSTEP.
-@item thr-os2
-IBM OS/2 thread support.
-@item thr-posix
-Generix POSIX thread support.
-@item thr-pthreads
-PCThreads on Linux-based GNU systems.
-@item thr-solaris
-SUN Solaris thread support.
-@item thr-win32
-Microsoft Win32 API thread support.
-@end itemize
-@end enumerate
-
-@node Configuration Files
-@section Files Created by @code{configure}
-
-Here we spell out what files will be set up by @code{configure}. Normally
-you need not be concerned with these files.
-
-@itemize @bullet
-@item
-@ifset INTERNALS
-A file named @file{config.h} is created that contains a @samp{#include}
-of the top-level config file for the machine you will run the compiler
-on (@pxref{Config}). This file is responsible for defining information
-about the host machine. It includes @file{tm.h}.
-@end ifset
-@ifclear INTERNALS
-A file named @file{config.h} is created that contains a @samp{#include}
-of the top-level config file for the machine you will run the compiler
-on (@pxref{Config,,The Configuration File, gcc.info, Using and Porting
-GCC}). This file is responsible for defining information about the host
-machine. It includes @file{tm.h}.
-@end ifclear
-
-The top-level config file is located in the subdirectory @file{config}.
-Its name is always @file{xm-@var{something}.h}; usually
-@file{xm-@var{machine}.h}, but there are some exceptions.
-
-If your system does not support symbolic links, you might want to
-set up @file{config.h} to contain a @samp{#include} command which
-refers to the appropriate file.
-
-@item
-A file named @file{tconfig.h} is created which includes the top-level config
-file for your target machine. This is used for compiling certain
-programs to run on that machine.
-
-@item
-A file named @file{tm.h} is created which includes the
-machine-description macro file for your target machine. It should be in
-the subdirectory @file{config} and its name is often
-@file{@var{machine}.h}.
-
-@item
-The command file @file{configure} also constructs the file
-@file{Makefile} by adding some text to the template file
-@file{Makefile.in}. The additional text comes from files in the
-@file{config} directory, named @file{t-@var{target}} and
-@file{x-@var{host}}. If these files do not exist, it means nothing
-needs to be added for a given target or host.
-@end itemize
-
-@node Configurations
-@section Configurations Supported by GNU CC
-@cindex configurations supported by GNU CC
-
-Here are the possible CPU types:
-
-@quotation
-@c gmicro, fx80, spur and tahoe omitted since they don't work.
-1750a, a29k, alpha, arm, avr, c@var{n}, clipper, dsp16xx, elxsi, fr30, h8300,
-hppa1.0, hppa1.1, i370, i386, i486, i586, i686, i786, i860, i960, m32r,
-m68000, m68k, m6811, m6812, m88k, mcore, mips, mipsel, mips64, mips64el,
-mn10200, mn10300, ns32k, pdp11, powerpc, powerpcle, romp, rs6000, sh, sparc,
-sparclite, sparc64, v850, vax, we32k.
-@end quotation
-
-Here are the recognized company names. As you can see, customary
-abbreviations are used rather than the longer official names.
-
-@c What should be done about merlin, tek*, dolphin?
-@quotation
-acorn, alliant, altos, apollo, apple, att, bull,
-cbm, convergent, convex, crds, dec, dg, dolphin,
-elxsi, encore, harris, hitachi, hp, ibm, intergraph, isi,
-mips, motorola, ncr, next, ns, omron, plexus,
-sequent, sgi, sony, sun, tti, unicom, wrs.
-@end quotation
-
-The company name is meaningful only to disambiguate when the rest of
-the information supplied is insufficient. You can omit it, writing
-just @samp{@var{cpu}-@var{system}}, if it is not needed. For example,
-@samp{vax-ultrix4.2} is equivalent to @samp{vax-dec-ultrix4.2}.
-
-Here is a list of system types:
-
-@quotation
-386bsd, aix, acis, amigaos, aos, aout, aux, bosx, bsd, clix, coff, ctix, cxux,
-dgux, dynix, ebmon, ecoff, elf, esix, freebsd, hms, genix, gnu, linux,
-linux-gnu, hiux, hpux, iris, irix, isc, luna, lynxos, mach, minix, msdos, mvs,
-netbsd, newsos, nindy, ns, osf, osfrose, ptx, riscix, riscos, rtu, sco, sim,
-solaris, sunos, sym, sysv, udi, ultrix, unicos, uniplus, unos, vms, vsta,
-vxworks, winnt, xenix.
-@end quotation
-
-@noindent
-You can omit the system type; then @file{configure} guesses the
-operating system from the CPU and company.
-
-You can add a version number to the system type; this may or may not
-make a difference. For example, you can write @samp{bsd4.3} or
-@samp{bsd4.4} to distinguish versions of BSD. In practice, the version
-number is most needed for @samp{sysv3} and @samp{sysv4}, which are often
-treated differently.
-
-@samp{linux-gnu} is the canonical name for the GNU/Linux target; however
-GNU CC will also accept @samp{linux}. The version of the kernel in use is
-not relevant on these systems. A suffix such as @samp{libc1} or @samp{aout}
-distinguishes major versions of the C library; all of the suffixed versions
-are obsolete.
-
-If you specify an impossible combination such as @samp{i860-dg-vms},
-then you may get an error message from @file{configure}, or it may
-ignore part of the information and do the best it can with the rest.
-@file{configure} always prints the canonical name for the alternative
-that it used. GNU CC does not support all possible alternatives.
-
-Often a particular model of machine has a name. Many machine names are
-recognized as aliases for CPU/company combinations. Thus, the machine
-name @samp{sun3}, mentioned above, is an alias for @samp{m68k-sun}.
-Sometimes we accept a company name as a machine name, when the name is
-popularly used for a particular machine. Here is a table of the known
-machine names:
-
-@quotation
-3300, 3b1, 3b@var{n}, 7300, altos3068, altos,
-apollo68, att-7300, balance,
-convex-c@var{n}, crds, decstation-3100,
-decstation, delta, encore,
-fx2800, gmicro, hp7@var{nn}, hp8@var{nn},
-hp9k2@var{nn}, hp9k3@var{nn}, hp9k7@var{nn},
-hp9k8@var{nn}, iris4d, iris, isi68,
-m3230, magnum, merlin, miniframe,
-mmax, news-3600, news800, news, next,
-pbd, pc532, pmax, powerpc, powerpcle, ps2, risc-news,
-rtpc, sun2, sun386i, sun386, sun3,
-sun4, symmetry, tower-32, tower.
-@end quotation
-
-@noindent
-Remember that a machine name specifies both the cpu type and the company
-name.
-If you want to install your own homemade configuration files, you can
-use @samp{local} as the company name to access them. If you use
-configuration @samp{@var{cpu}-local}, the configuration name
-without the cpu prefix
-is used to form the configuration file names.
-
-Thus, if you specify @samp{m68k-local}, configuration uses
-files @file{m68k.md}, @file{local.h}, @file{m68k.c},
-@file{xm-local.h}, @file{t-local}, and @file{x-local}, all in the
-directory @file{config/m68k}.
-
-Here is a list of configurations that have special treatment or special
-things you must know:
-
-@table @samp
-@item 1750a-*-*
-MIL-STD-1750A processors.
-
-The MIL-STD-1750A cross configuration produces output for
-@code{as1750}, an assembler/linker available under the GNU Public
-License for the 1750A. @code{as1750} can be obtained at
-@uref{ftp://ftp.fta-berlin.de/pub/crossgcc/1750gals/}.
-A similarly licensed simulator for
-the 1750A is available from same address.
-
-You should ignore a fatal error during the building of libgcc (libgcc is
-not yet implemented for the 1750A.)
-
-The @code{as1750} assembler requires the file @file{ms1750.inc}, which is
-found in the directory @file{config/1750a}.
-
-GNU CC produced the same sections as the Fairchild F9450 C Compiler,
-namely:
-
-@table @code
-@item Normal
-The program code section.
-
-@item Static
-The read/write (RAM) data section.
-
-@item Konst
-The read-only (ROM) constants section.
-
-@item Init
-Initialization section (code to copy KREL to SREL).
-@end table
-
-The smallest addressable unit is 16 bits (BITS_PER_UNIT is 16). This
-means that type `char' is represented with a 16-bit word per character.
-The 1750A's "Load/Store Upper/Lower Byte" instructions are not used by
-GNU CC.
-
-@item alpha-*-osf1
-Systems using processors that implement the DEC Alpha architecture and
-are running the DEC Unix (OSF/1) operating system, for example the DEC
-Alpha AXP systems.CC.)
-
-GNU CC writes a @samp{.verstamp} directive to the assembler output file
-unless it is built as a cross-compiler. It gets the version to use from
-the system header file @file{/usr/include/stamp.h}. If you install a
-new version of DEC Unix, you should rebuild GCC to pick up the new version
-stamp.
-
-Note that since the Alpha is a 64-bit architecture, cross-compilers from
-32-bit machines will not generate code as efficient as that generated
-when the compiler is running on a 64-bit machine because many
-optimizations that depend on being able to represent a word on the
-target in an integral value on the host cannot be performed. Building
-cross-compilers on the Alpha for 32-bit machines has only been tested in
-a few cases and may not work properly.
-
-@code{make compare} may fail on old versions of DEC Unix unless you add
-@samp{-save-temps} to @code{CFLAGS}. On these systems, the name of the
-assembler input file is stored in the object file, and that makes
-comparison fail if it differs between the @code{stage1} and
-@code{stage2} compilations. The option @samp{-save-temps} forces a
-fixed name to be used for the assembler input file, instead of a
-randomly chosen name in @file{/tmp}. Do not add @samp{-save-temps}
-unless the comparisons fail without that option. If you add
-@samp{-save-temps}, you will have to manually delete the @samp{.i} and
-@samp{.s} files after each series of compilations.
-
-GNU CC now supports both the native (ECOFF) debugging format used by DBX
-and GDB and an encapsulated STABS format for use only with GDB. See the
-discussion of the @samp{--with-stabs} option of @file{configure} above
-for more information on these formats and how to select them.
-
-There is a bug in DEC's assembler that produces incorrect line numbers
-for ECOFF format when the @samp{.align} directive is used. To work
-around this problem, GNU CC will not emit such alignment directives
-while writing ECOFF format debugging information even if optimization is
-being performed. Unfortunately, this has the very undesirable
-side-effect that code addresses when @samp{-O} is specified are
-different depending on whether or not @samp{-g} is also specified.
-
-To avoid this behavior, specify @samp{-gstabs+} and use GDB instead of
-DBX. DEC is now aware of this problem with the assembler and hopes to
-provide a fix shortly.
-
-@item arc-*-elf
-Argonaut ARC processor.
-This configuration is intended for embedded systems.
-
-@item arm-*-aout
-Advanced RISC Machines ARM-family processors. These are often used in
-embedded applications. There are no standard Unix configurations.
-This configuration corresponds to the basic instruction sequences and will
-produce @file{a.out} format object modules.
-
-You may need to make a variant of the file @file{arm.h} for your particular
-configuration.
-
-@item arm-*-elf
-This configuration is intended for embedded systems.
-
-@item arm-*-linux*aout
-Any of the ARM-family processors running the Linux-based GNU system with
-the @file{a.out} binary format. This is an obsolete configuration.
-
-@item arm-*-linux
-@itemx arm-*-linux-gnu
-@itemx arm-*-linux*oldld
-Any of the ARM-family processors running the Linux-based GNU system with
-the @file{ELF} binary format. You must use version 2.9.1.0.22 or later
-of the GNU/Linux binutils, which you can download from
-@uref{ftp://ftp.varesearch.com/pub/support/hjl/binutils/}.
-
-These two configurations differ only in the required version of GNU
-binutils. For binutils 2.9.1.0.x, use @samp{arm-*-linux-gnuoldld}. For
-newer versions of binutils, use @samp{arm-*-linux-gnu}.
-
-@item arm-*-riscix
-The ARM2 or ARM3 processor running RISC iX, Acorn's port of BSD Unix.
-If you are running a version of RISC iX prior to 1.2 then you must
-specify the version number during configuration. Note that the
-assembler shipped with RISC iX does not support stabs debugging
-information; a new version of the assembler, with stabs support
-included, is now available from Acorn and via ftp
-@uref{ftp://ftp.acorn.com/pub/riscix/as+xterm.tar.Z}. To enable stabs
-debugging, pass @samp{--with-gnu-as} to configure.
-
-You will need to install GNU @file{sed} before you can run configure.
-
-@item a29k
-AMD Am29k-family processors. These are normally used in embedded
-applications. There are no standard Unix configurations.
-This configuration
-corresponds to AMD's standard calling sequence and binary interface
-and is compatible with other 29k tools.
-
-You may need to make a variant of the file @file{a29k.h} for your
-particular configuration.
-
-@item a29k-*-bsd
-AMD Am29050 used in a system running a variant of BSD Unix.
-
-@item avr
-ATMEL AVR-family micro controllers. These are used in embedded
-applications. There are no standard Unix configurations.
-@xref{AVR Options}, for the list of supported MCU types.
-
-@item decstation-*
-MIPS-based DECstations can support three different personalities:
-Ultrix, DEC OSF/1, and OSF/rose. (Alpha-based DECstation products have
-a configuration name beginning with @samp{alpha-dec}.) To configure GCC
-for these platforms use the following configurations:
-
-@table @samp
-@item decstation-ultrix
-Ultrix configuration.
-
-@item decstation-osf1
-Dec's version of OSF/1.
-
-@item decstation-osfrose
-Open Software Foundation reference port of OSF/1 which uses the
-OSF/rose object file format instead of ECOFF. Normally, you
-would not select this configuration.
-@end table
-
-The MIPS C compiler needs to be told to increase its table size
-for switch statements with the @samp{-Wf,-XNg1500} option in
-order to compile @file{cp/parse.c}. If you use the @samp{-O2}
-optimization option, you also need to use @samp{-Olimit 3000}.
-Both of these options are automatically generated in the
-@file{Makefile} that the shell script @file{configure} builds.
-If you override the @code{CC} make variable and use the MIPS
-compilers, you may need to add @samp{-Wf,-XNg1500 -Olimit 3000}.
-
-@item elxsi-elxsi-bsd
-The Elxsi's C compiler has known limitations that prevent it from
-compiling GNU C. Please contact @email{mrs@@cygnus.com} for more details.
-
-@item dsp16xx
-A port to the AT&T DSP1610 family of processors.
-
-@ignore
-@item fx80
-Alliant FX/8 computer. Note that the standard installed C compiler in
-Concentrix 5.0 has a bug which prevent it from compiling GNU CC
-correctly. You can patch the compiler bug as follows:
-
-@smallexample
-cp /bin/pcc ./pcc
-adb -w ./pcc - << EOF
-15f6?w 6610
-EOF
-@end smallexample
-
-Then you must use the @samp{-ip12} option when compiling GNU CC
-with the patched compiler, as shown here:
-
-@smallexample
-make CC="./pcc -ip12" CFLAGS=-w
-@end smallexample
-
-Note also that Alliant's version of DBX does not manage to work with the
-output from GNU CC.
-@end ignore
-
-@item h8300-*-*
-Hitachi H8/300 series of processors.
-
-The calling convention and structure layout has changed in release 2.6.
-All code must be recompiled. The calling convention now passes the
-first three arguments in function calls in registers. Structures are no
-longer a multiple of 2 bytes.
-
-@item i370-*-*
-This port is very preliminary and has many known bugs. We hope to
-have a higher-quality port for this machine soon.
-
-@item i386-*-linux*oldld
-Use this configuration to generate @file{a.out} binaries on Linux-based
-GNU systems if you do not have gas/binutils version 2.5.2 or later
-installed. This is an obsolete configuration.
-
-@item i386-*-linux*aout
-Use this configuration to generate @file{a.out} binaries on Linux-based
-GNU systems. This configuration is being superseded. You must use
-gas/binutils version 2.5.2 or later.
-
-@item i386-*-linux
-@itemx i386-*-linux-gnu
-Use this configuration to generate ELF binaries on Linux-based GNU
-systems. You must use gas/binutils version 2.5.2 or later.
-
-@item i386-*-sco
-Compilation with RCC is recommended. Also, it may be a good idea to
-link with GNU malloc instead of the malloc that comes with the system.
-
-@item i386-*-sco3.2v4
-Use this configuration for SCO release 3.2 version 4.
-
-@item i386-*-sco3.2v5*
-Use this for the SCO OpenServer Release 5 family of operating systems.
-
-@item i386-*-isc
-It may be a good idea to link with GNU malloc instead of the malloc that
-comes with the system.
-
-In ISC version 4.1, @file{sed} core dumps when building
-@file{deduced.h}. Use the version of @file{sed} from version 4.0.
-
-@item i386-*-esix
-It may be good idea to link with GNU malloc instead of the malloc that
-comes with the system.
-
-@item i386-ibm-aix
-You need to use GAS version 2.1 or later, and LD from
-GNU binutils version 2.2 or later.
-
-@item i386-sequent-bsd
-Go to the Berkeley universe before compiling.
-
-@item i386-sequent-ptx1*
-@itemx i386-sequent-ptx2*
-You must install GNU @file{sed} before running @file{configure}.
-
-@item i386-sun-sunos4
-You may find that you need another version of GNU CC to begin
-bootstrapping with, since the current version when built with the
-system's own compiler seems to get an infinite loop compiling part of
-@file{libgcc2.c}. GNU CC version 2 compiled with GNU CC (any version)
-seems not to have this problem.
-
-See @ref{Sun Install}, for information on installing GNU CC on Sun
-systems.
-
-@item i860-intel-osf1
-This is the Paragon.
-@ifset INSTALLONLY
-If you have version 1.0 of the operating system, you need to take
-special steps to build GNU CC due to peculiarities of the system. Newer
-system versions have no problem. See the section `Installation Problems'
-in the GNU CC Manual.
-@end ifset
-@ifclear INSTALLONLY
-If you have version 1.0 of the operating system,
-see @ref{Installation Problems}, for special things you need to do to
-compensate for peculiarities in the system.
-@end ifclear
-
-@item *-lynx-lynxos
-LynxOS 2.2 and earlier comes with GNU CC 1.x already installed as
-@file{/bin/gcc}. You should compile with this instead of @file{/bin/cc}.
-You can tell GNU CC to use the GNU assembler and linker, by specifying
-@samp{--with-gnu-as --with-gnu-ld} when configuring. These will produce
-COFF format object files and executables; otherwise GNU CC will use the
-installed tools, which produce @file{a.out} format executables.
-
-@item m32r-*-elf
-Mitsubishi M32R processor.
-This configuration is intended for embedded systems.
-
-@item m68000-hp-bsd
-HP 9000 series 200 running BSD. Note that the C compiler that comes
-with this system cannot compile GNU CC; contact @email{law@@cygnus.com}
-to get binaries of GNU CC for bootstrapping.
-
-@item m68k-altos
-Altos 3068. You must use the GNU assembler, linker and debugger.
-Also, you must fix a kernel bug. Details in the file @file{README.ALTOS}.
-
-@item m68k-apple-aux
-Apple Macintosh running A/UX.
-You may configure GCC to use either the system assembler and
-linker or the GNU assembler and linker. You should use the GNU configuration
-if you can, especially if you also want to use GNU C++. You enabled
-that configuration with + the @samp{--with-gnu-as} and @samp{--with-gnu-ld}
-options to @code{configure}.
-
-Note the C compiler that comes
-with this system cannot compile GNU CC. You can find binaries of GNU CC
-for bootstrapping on @code{jagubox.gsfc.nasa.gov}.
-You will also a patched version of @file{/bin/ld} there that
-raises some of the arbitrary limits found in the original.
-
-@item m68k-att-sysv
-AT&T 3b1, a.k.a. 7300 PC. This version of GNU CC cannot
-be compiled with the system C compiler, which is too buggy.
-You will need to get a previous version of GCC and use it to
-bootstrap. Binaries are available from the OSU-CIS archive, at
-@uref{ftp://archive.cis.ohio-state.edu/pub/att7300/}.
-
-@item m68k-bull-sysv
-Bull DPX/2 series 200 and 300 with BOS-2.00.45 up to BOS-2.01. GNU CC works
-either with native assembler or GNU assembler. You can use
-GNU assembler with native coff generation by providing @samp{--with-gnu-as} to
-the configure script or use GNU assembler with dbx-in-coff encapsulation
-by providing @samp{--with-gnu-as --stabs}. For any problem with native
-assembler or for availability of the DPX/2 port of GAS, contact
-@email{F.Pierresteguy@@frcl.bull.fr}.
-
-@item m68k-crds-unox
-Use @samp{configure unos} for building on Unos.
-
-The Unos assembler is named @code{casm} instead of @code{as}. For some
-strange reason linking @file{/bin/as} to @file{/bin/casm} changes the
-behavior, and does not work. So, when installing GNU CC, you should
-install the following script as @file{as} in the subdirectory where
-the passes of GCC are installed:
-
-@example
-#!/bin/sh
-casm $*
-@end example
-
-The default Unos library is named @file{libunos.a} instead of
-@file{libc.a}. To allow GNU CC to function, either change all
-references to @samp{-lc} in @file{gcc.c} to @samp{-lunos} or link
-@file{/lib/libc.a} to @file{/lib/libunos.a}.
-
-@cindex @code{alloca}, for Unos
-When compiling GNU CC with the standard compiler, to overcome bugs in
-the support of @code{alloca}, do not use @samp{-O} when making stage 2.
-Then use the stage 2 compiler with @samp{-O} to make the stage 3
-compiler. This compiler will have the same characteristics as the usual
-stage 2 compiler on other systems. Use it to make a stage 4 compiler
-and compare that with stage 3 to verify proper compilation.
-
-(Perhaps simply defining @code{ALLOCA} in @file{x-crds} as described in
-the comments there will make the above paragraph superfluous. Please
-inform us of whether this works.)
-
-Unos uses memory segmentation instead of demand paging, so you will need
-a lot of memory. 5 Mb is barely enough if no other tasks are running.
-If linking @file{cc1} fails, try putting the object files into a library
-and linking from that library.
-
-@item m68k-hp-hpux
-HP 9000 series 300 or 400 running HP-UX. HP-UX version 8.0 has a bug in
-the assembler that prevents compilation of GNU CC. To fix it, get patch
-PHCO_4484 from HP.
-
-In addition, if you wish to use gas @samp{--with-gnu-as} you must use
-gas version 2.1 or later, and you must use the GNU linker version 2.1 or
-later. Earlier versions of gas relied upon a program which converted the
-gas output into the native HP-UX format, but that program has not been
-kept up to date. gdb does not understand that native HP-UX format, so
-you must use gas if you wish to use gdb.
-
-@item m68k-sun
-Sun 3. We do not provide a configuration file to use the Sun FPA by
-default, because programs that establish signal handlers for floating
-point traps inherently cannot work with the FPA.
-
-See @ref{Sun Install}, for information on installing GNU CC on Sun
-systems.
-
-@item m6811-elf
-Motorola 68HC11 family micro controllers. These are used in embedded
-applications. There are no standard Unix configurations.
-
-@item m6812-elf
-Motorola 68HC12 family micro controllers. These are used in embedded
-applications. There are no standard Unix configurations.
-
-@item m88k-*-svr3
-Motorola m88k running the AT&T/Unisoft/Motorola V.3 reference port.
-These systems tend to use the Green Hills C, revision 1.8.5, as the
-standard C compiler. There are apparently bugs in this compiler that
-result in object files differences between stage 2 and stage 3. If this
-happens, make the stage 4 compiler and compare it to the stage 3
-compiler. If the stage 3 and stage 4 object files are identical, this
-suggests you encountered a problem with the standard C compiler; the
-stage 3 and 4 compilers may be usable.
-
-It is best, however, to use an older version of GNU CC for bootstrapping
-if you have one.
-
-@item m88k-*-dgux
-Motorola m88k running DG/UX. To build 88open BCS native or cross
-compilers on DG/UX, specify the configuration name as
-@samp{m88k-*-dguxbcs} and build in the 88open BCS software development
-environment. To build ELF native or cross compilers on DG/UX, specify
-@samp{m88k-*-dgux} and build in the DG/UX ELF development environment.
-You set the software development environment by issuing
-@samp{sde-target} command and specifying either @samp{m88kbcs} or
-@samp{m88kdguxelf} as the operand.
-
-If you do not specify a configuration name, @file{configure} guesses the
-configuration based on the current software development environment.
-
-@item m88k-tektronix-sysv3
-Tektronix XD88 running UTekV 3.2e. Do not turn on
-optimization while building stage1 if you bootstrap with
-the buggy Green Hills compiler. Also, The bundled LAI
-System V NFS is buggy so if you build in an NFS mounted
-directory, start from a fresh reboot, or avoid NFS all together.
-Otherwise you may have trouble getting clean comparisons
-between stages.
-
-@item mips-mips-bsd
-MIPS machines running the MIPS operating system in BSD mode. It's
-possible that some old versions of the system lack the functions
-@code{memcpy}, @code{memcmp}, and @code{memset}. If your system lacks
-these, you must remove or undo the definition of
-@code{TARGET_MEM_FUNCTIONS} in @file{mips-bsd.h}.
-
-The MIPS C compiler needs to be told to increase its table size
-for switch statements with the @samp{-Wf,-XNg1500} option in
-order to compile @file{cp/parse.c}. If you use the @samp{-O2}
-optimization option, you also need to use @samp{-Olimit 3000}.
-Both of these options are automatically generated in the
-@file{Makefile} that the shell script @file{configure} builds.
-If you override the @code{CC} make variable and use the MIPS
-compilers, you may need to add @samp{-Wf,-XNg1500 -Olimit 3000}.
-
-@item mips-mips-riscos*
-The MIPS C compiler needs to be told to increase its table size
-for switch statements with the @samp{-Wf,-XNg1500} option in
-order to compile @file{cp/parse.c}. If you use the @samp{-O2}
-optimization option, you also need to use @samp{-Olimit 3000}.
-Both of these options are automatically generated in the
-@file{Makefile} that the shell script @file{configure} builds.
-If you override the @code{CC} make variable and use the MIPS
-compilers, you may need to add @samp{-Wf,-XNg1500 -Olimit 3000}.
-
-MIPS computers running RISC-OS can support four different
-personalities: default, BSD 4.3, System V.3, and System V.4
-(older versions of RISC-OS don't support V.4). To configure GCC
-for these platforms use the following configurations:
-
-@table @samp
-@item mips-mips-riscos@code{rev}
-Default configuration for RISC-OS, revision @code{rev}.
-
-@item mips-mips-riscos@code{rev}bsd
-BSD 4.3 configuration for RISC-OS, revision @code{rev}.
-
-@item mips-mips-riscos@code{rev}sysv4
-System V.4 configuration for RISC-OS, revision @code{rev}.
-
-@item mips-mips-riscos@code{rev}sysv
-System V.3 configuration for RISC-OS, revision @code{rev}.
-@end table
-
-The revision @code{rev} mentioned above is the revision of
-RISC-OS to use. You must reconfigure GCC when going from a
-RISC-OS revision 4 to RISC-OS revision 5. This has the effect of
-avoiding a linker
-@ifclear INSTALLONLY
-bug (see @ref{Installation Problems}, for more details).
-@end ifclear
-@ifset INSTALLONLY
-bug.
-@end ifset
-
-@item mips-sgi-*
-In order to compile GCC on an SGI running IRIX 4, the "c.hdr.lib"
-option must be installed from the CD-ROM supplied from Silicon Graphics.
-This is found on the 2nd CD in release 4.0.1.
-
-In order to compile GCC on an SGI running IRIX 5, the "compiler_dev.hdr"
-subsystem must be installed from the IDO CD-ROM supplied by Silicon
-Graphics.
-
-@code{make compare} may fail on version 5 of IRIX unless you add
-@samp{-save-temps} to @code{CFLAGS}. On these systems, the name of the
-assembler input file is stored in the object file, and that makes
-comparison fail if it differs between the @code{stage1} and
-@code{stage2} compilations. The option @samp{-save-temps} forces a
-fixed name to be used for the assembler input file, instead of a
-randomly chosen name in @file{/tmp}. Do not add @samp{-save-temps}
-unless the comparisons fail without that option. If you do you
-@samp{-save-temps}, you will have to manually delete the @samp{.i} and
-@samp{.s} files after each series of compilations.
-
-The MIPS C compiler needs to be told to increase its table size
-for switch statements with the @samp{-Wf,-XNg1500} option in
-order to compile @file{cp/parse.c}. If you use the @samp{-O2}
-optimization option, you also need to use @samp{-Olimit 3000}.
-Both of these options are automatically generated in the
-@file{Makefile} that the shell script @file{configure} builds.
-If you override the @code{CC} make variable and use the MIPS
-compilers, you may need to add @samp{-Wf,-XNg1500 -Olimit 3000}.
-
-On Irix version 4.0.5F, and perhaps on some other versions as well,
-there is an assembler bug that reorders instructions incorrectly. To
-work around it, specify the target configuration
-@samp{mips-sgi-irix4loser}. This configuration inhibits assembler
-optimization.
-
-In a compiler configured with target @samp{mips-sgi-irix4}, you can turn
-off assembler optimization by using the @samp{-noasmopt} option. This
-compiler option passes the option @samp{-O0} to the assembler, to
-inhibit reordering.
-
-The @samp{-noasmopt} option can be useful for testing whether a problem
-is due to erroneous assembler reordering. Even if a problem does not go
-away with @samp{-noasmopt}, it may still be due to assembler
-reordering---perhaps GNU CC itself was miscompiled as a result.
-
-To enable debugging under Irix 5, you must use GNU as 2.5 or later,
-and use the @samp{--with-gnu-as} configure option when configuring gcc.
-GNU as is distributed as part of the binutils package.
-
-@item mips-sony-sysv
-Sony MIPS NEWS. This works in NEWSOS 5.0.1, but not in 5.0.2 (which
-uses ELF instead of COFF). Support for 5.0.2 will probably be provided
-soon by volunteers. In particular, the linker does not like the
-code generated by GCC when shared libraries are linked in.
-
-@item ns32k-encore
-Encore ns32000 system. Encore systems are supported only under BSD.
-
-@item ns32k-*-genix
-National Semiconductor ns32000 system. Genix has bugs in @code{alloca}
-and @code{malloc}; you must get the compiled versions of these from GNU
-Emacs.
-
-@item ns32k-sequent
-Go to the Berkeley universe before compiling.
-
-@item ns32k-utek
-UTEK ns32000 system (``merlin''). The C compiler that comes with this
-system cannot compile GNU CC; contact @samp{tektronix!reed!mason} to get
-binaries of GNU CC for bootstrapping.
-
-@item romp-*-aos
-@itemx romp-*-mach
-The only operating systems supported for the IBM RT PC are AOS and
-MACH. GNU CC does not support AIX running on the RT. We recommend you
-compile GNU CC with an earlier version of itself; if you compile GNU CC
-with @code{hc}, the Metaware compiler, it will work, but you will get
-mismatches between the stage 2 and stage 3 compilers in various files.
-These errors are minor differences in some floating-point constants and
-can be safely ignored; the stage 3 compiler is correct.
-
-@item rs6000-*-aix
-@itemx powerpc-*-aix
-Various early versions of each release of the IBM XLC compiler will not
-bootstrap GNU CC. Symptoms include differences between the stage2 and
-stage3 object files, and errors when compiling @file{libgcc.a} or
-@file{enquire}. Known problematic releases include: xlc-1.2.1.8,
-xlc-1.3.0.0 (distributed with AIX 3.2.5), and xlc-1.3.0.19. Both
-xlc-1.2.1.28 and xlc-1.3.0.24 (PTF 432238) are known to produce working
-versions of GNU CC, but most other recent releases correctly bootstrap
-GNU CC.
-
-Release 4.3.0 of AIX and ones prior to AIX 3.2.4 include a version of
-the IBM assembler which does not accept debugging directives: assembler
-updates are available as PTFs. Also, if you are using AIX 3.2.5 or
-greater and the GNU assembler, you must have a version modified after
-October 16th, 1995 in order for the GNU C compiler to build. See the
-file @file{README.RS6000} for more details on any of these problems.
-
-GNU CC does not yet support the 64-bit PowerPC instructions.
-
-Objective C does not work on this architecture because it makes assumptions
-that are incompatible with the calling conventions.
-
-AIX on the RS/6000 provides support (NLS) for environments outside of
-the United States. Compilers and assemblers use NLS to support
-locale-specific representations of various objects including
-floating-point numbers ("." vs "," for separating decimal fractions).
-There have been problems reported where the library linked with GNU CC
-does not produce the same floating-point formats that the assembler
-accepts. If you have this problem, set the LANG environment variable to
-"C" or "En_US".
-
-Due to changes in the way that GNU CC invokes the binder (linker) for AIX
-4.1, you may now receive warnings of duplicate symbols from the link step
-that were not reported before. The assembly files generated by GNU CC for
-AIX have always included multiple symbol definitions for certain global
-variable and function declarations in the original program. The warnings
-should not prevent the linker from producing a correct library or runnable
-executable.
-
-By default, AIX 4.1 produces code that can be used on either Power or
-PowerPC processors.
-
-You can specify a default version for the @samp{-mcpu=}@var{cpu_type}
-switch by using the configure option @samp{--with-cpu-}@var{cpu_type}.
-
-@item powerpc-*-elf
-@itemx powerpc-*-sysv4
-PowerPC system in big endian mode, running System V.4.
-
-You can specify a default version for the @samp{-mcpu=}@var{cpu_type}
-switch by using the configure option @samp{--with-cpu-}@var{cpu_type}.
-
-@item powerpc-*-linux
-@itemx powerpc-*-linux-gnu
-PowerPC system in big endian mode, running the Linux-based GNU system.
-
-You can specify a default version for the @samp{-mcpu=}@var{cpu_type}
-switch by using the configure option @samp{--with-cpu-}@var{cpu_type}.
-
-@item powerpc-*-eabiaix
-Embedded PowerPC system in big endian mode with -mcall-aix selected as
-the default.
-
-You can specify a default version for the @samp{-mcpu=}@var{cpu_type}
-switch by using the configure option @samp{--with-cpu-}@var{cpu_type}.
-
-@item powerpc-*-eabisim
-Embedded PowerPC system in big endian mode for use in running under the
-PSIM simulator.
-
-You can specify a default version for the @samp{-mcpu=}@var{cpu_type}
-switch by using the configure option @samp{--with-cpu-}@var{cpu_type}.
-
-@item powerpc-*-eabi
-Embedded PowerPC system in big endian mode.
-
-You can specify a default version for the @samp{-mcpu=}@var{cpu_type}
-switch by using the configure option @samp{--with-cpu-}@var{cpu_type}.
-
-@item powerpcle-*-elf
-@itemx powerpcle-*-sysv4
-PowerPC system in little endian mode, running System V.4.
-
-You can specify a default version for the @samp{-mcpu=}@var{cpu_type}
-switch by using the configure option @samp{--with-cpu-}@var{cpu_type}.
-
-@item powerpcle-*-solaris2*
-PowerPC system in little endian mode, running Solaris 2.5.1 or higher.
-
-You can specify a default version for the @samp{-mcpu=}@var{cpu_type}
-switch by using the configure option @samp{--with-cpu-}@var{cpu_type}.
-Beta versions of the Sun 4.0 compiler do not seem to be able to build
-GNU CC correctly. There are also problems with the host assembler and
-linker that are fixed by using the GNU versions of these tools.
-
-@item powerpcle-*-eabisim
-Embedded PowerPC system in little endian mode for use in running under
-the PSIM simulator.
-
-@itemx powerpcle-*-eabi
-Embedded PowerPC system in little endian mode.
-
-You can specify a default version for the @samp{-mcpu=}@var{cpu_type}
-switch by using the configure option @samp{--with-cpu-}@var{cpu_type}.
-
-@item powerpcle-*-winnt
-@itemx powerpcle-*-pe
-PowerPC system in little endian mode running Windows NT.
-
-You can specify a default version for the @samp{-mcpu=}@var{cpu_type}
-switch by using the configure option @samp{--with-cpu-}@var{cpu_type}.
-
-@item vax-dec-ultrix
-Don't try compiling with Vax C (@code{vcc}). It produces incorrect code
-in some cases (for example, when @code{alloca} is used).
-
-Meanwhile, compiling @file{cp/parse.c} with pcc does not work because of
-an internal table size limitation in that compiler. To avoid this
-problem, compile just the GNU C compiler first, and use it to recompile
-building all the languages that you want to run.
-
-@item sparc-sun-*
-See @ref{Sun Install}, for information on installing GNU CC on Sun
-systems.
-
-@item vax-dec-vms
-See @ref{VMS Install}, for details on how to install GNU CC on VMS.
-
-@item we32k-*-*
-These computers are also known as the 3b2, 3b5, 3b20 and other similar
-names. (However, the 3b1 is actually a 68000; see
-@ref{Configurations}.)
-
-Don't use @samp{-g} when compiling with the system's compiler. The
-system's linker seems to be unable to handle such a large program with
-debugging information.
-
-The system's compiler runs out of capacity when compiling @file{stmt.c}
-in GNU CC. You can work around this by building @file{cpp} in GNU CC
-first, then use that instead of the system's preprocessor with the
-system's C compiler to compile @file{stmt.c}. Here is how:
-
-@smallexample
-mv /lib/cpp /lib/cpp.att
-cp cpp /lib/cpp.gnu
-echo '/lib/cpp.gnu -traditional $@{1+"$@@"@}' > /lib/cpp
-chmod +x /lib/cpp
-@end smallexample
-
-The system's compiler produces bad code for some of the GNU CC
-optimization files. So you must build the stage 2 compiler without
-optimization. Then build a stage 3 compiler with optimization.
-That executable should work. Here are the necessary commands:
-
-@smallexample
-make LANGUAGES=c CC=stage1/xgcc CFLAGS="-Bstage1/ -g"
-make stage2
-make CC=stage2/xgcc CFLAGS="-Bstage2/ -g -O"
-@end smallexample
-
-You may need to raise the ULIMIT setting to build a C++ compiler,
-as the file @file{cc1plus} is larger than one megabyte.
-@end table
-
-@node Other Dir
-@section Compilation in a Separate Directory
-@cindex other directory, compilation in
-@cindex compilation in a separate directory
-@cindex separate directory, compilation in
-
-If you wish to build the object files and executables in a directory
-other than the one containing the source files, here is what you must
-do differently:
-
-@enumerate
-@item
-Make sure you have a version of Make that supports the @code{VPATH}
-feature. (GNU Make supports it, as do Make versions on most BSD
-systems.)
-
-@item
-If you have ever run @file{configure} in the source directory, you must undo
-the configuration. Do this by running:
-
-@example
-make distclean
-@end example
-
-@item
-Go to the directory in which you want to build the compiler before
-running @file{configure}:
-
-@example
-mkdir gcc-sun3
-cd gcc-sun3
-@end example
-
-On systems that do not support symbolic links, this directory must be
-on the same file system as the source code directory.
-
-@item
-Specify where to find @file{configure} when you run it:
-
-@example
-../gcc/configure @dots{}
-@end example
-
-This also tells @code{configure} where to find the compiler sources;
-@code{configure} takes the directory from the file name that was used to
-invoke it. But if you want to be sure, you can specify the source
-directory with the @samp{--srcdir} option, like this:
-
-@example
-../gcc/configure --srcdir=../gcc @var{other options}
-@end example
-
-The directory you specify with @samp{--srcdir} need not be the same
-as the one that @code{configure} is found in.
-@end enumerate
-
-Now, you can run @code{make} in that directory. You need not repeat the
-configuration steps shown above, when ordinary source files change. You
-must, however, run @code{configure} again when the configuration files
-change, if your system does not support symbolic links.
-
-@node Cross-Compiler
-@section Building and Installing a Cross-Compiler
-@cindex cross-compiler, installation
-
-GNU CC can function as a cross-compiler for many machines, but not all.
-
-@itemize @bullet
-@item
-Cross-compilers for the Mips as target using the Mips assembler
-currently do not work, because the auxiliary programs
-@file{mips-tdump.c} and @file{mips-tfile.c} can't be compiled on
-anything but a Mips. It does work to cross compile for a Mips
-if you use the GNU assembler and linker.
-
-@item
-Cross-compilers between machines with different floating point formats
-have not all been made to work. GNU CC now has a floating point
-emulator with which these can work, but each target machine description
-needs to be updated to take advantage of it.
-
-@item
-Cross-compilation between machines of different word sizes is
-somewhat problematic and sometimes does not work.
-@end itemize
-
-Since GNU CC generates assembler code, you probably need a
-cross-assembler that GNU CC can run, in order to produce object files.
-If you want to link on other than the target machine, you need a
-cross-linker as well. You also need header files and libraries suitable
-for the target machine that you can install on the host machine.
-
-@menu
-* Steps of Cross:: Using a cross-compiler involves several steps
- that may be carried out on different machines.
-* Configure Cross:: Configuring a cross-compiler.
-* Tools and Libraries:: Where to put the linker and assembler, and the C library.
-* Cross Headers:: Finding and installing header files
- for a cross-compiler.
-* Cross Runtime:: Supplying arithmetic runtime routines (@file{libgcc1.a}).
-* Build Cross:: Actually compiling the cross-compiler.
-@end menu
-
-@node Steps of Cross
-@subsection Steps of Cross-Compilation
-
-To compile and run a program using a cross-compiler involves several
-steps:
-
-@itemize @bullet
-@item
-Run the cross-compiler on the host machine to produce assembler files
-for the target machine. This requires header files for the target
-machine.
-
-@item
-Assemble the files produced by the cross-compiler. You can do this
-either with an assembler on the target machine, or with a
-cross-assembler on the host machine.
-
-@item
-Link those files to make an executable. You can do this either with a
-linker on the target machine, or with a cross-linker on the host
-machine. Whichever machine you use, you need libraries and certain
-startup files (typically @file{crt@dots{}.o}) for the target machine.
-@end itemize
-
-It is most convenient to do all of these steps on the same host machine,
-since then you can do it all with a single invocation of GNU CC. This
-requires a suitable cross-assembler and cross-linker. For some targets,
-the GNU assembler and linker are available.
-
-@node Configure Cross
-@subsection Configuring a Cross-Compiler
-
-To build GNU CC as a cross-compiler, you start out by running
-@file{configure}. Use the @samp{--target=@var{target}} to specify the
-target type. If @file{configure} was unable to correctly identify the
-system you are running on, also specify the @samp{--build=@var{build}}
-option. For example, here is how to configure for a cross-compiler that
-produces code for an HP 68030 system running BSD on a system that
-@file{configure} can correctly identify:
-
-@smallexample
-./configure --target=m68k-hp-bsd4.3
-@end smallexample
-
-@node Tools and Libraries
-@subsection Tools and Libraries for a Cross-Compiler
-
-If you have a cross-assembler and cross-linker available, you should
-install them now. Put them in the directory
-@file{/usr/local/@var{target}/bin}. Here is a table of the tools
-you should put in this directory:
-
-@table @file
-@item as
-This should be the cross-assembler.
-
-@item ld
-This should be the cross-linker.
-
-@item ar
-This should be the cross-archiver: a program which can manipulate
-archive files (linker libraries) in the target machine's format.
-
-@item ranlib
-This should be a program to construct a symbol table in an archive file.
-@end table
-
-The installation of GNU CC will find these programs in that directory,
-and copy or link them to the proper place to for the cross-compiler to
-find them when run later.
-
-The easiest way to provide these files is to build the Binutils package
-and GAS. Configure them with the same @samp{--host} and @samp{--target}
-options that you use for configuring GNU CC, then build and install
-them. They install their executables automatically into the proper
-directory. Alas, they do not support all the targets that GNU CC
-supports.
-
-If you want to install libraries to use with the cross-compiler, such as
-a standard C library, put them in the directory
-@file{/usr/local/@var{target}/lib}; installation of GNU CC copies
-all the files in that subdirectory into the proper place for GNU CC to
-find them and link with them. Here's an example of copying some
-libraries from a target machine:
-
-@example
-ftp @var{target-machine}
-lcd /usr/local/@var{target}/lib
-cd /lib
-get libc.a
-cd /usr/lib
-get libg.a
-get libm.a
-quit
-@end example
-
-@noindent
-The precise set of libraries you'll need, and their locations on
-the target machine, vary depending on its operating system.
-
-@cindex start files
-Many targets require ``start files'' such as @file{crt0.o} and
-@file{crtn.o} which are linked into each executable; these too should be
-placed in @file{/usr/local/@var{target}/lib}. There may be several
-alternatives for @file{crt0.o}, for use with profiling or other
-compilation options. Check your target's definition of
-@code{STARTFILE_SPEC} to find out what start files it uses.
-Here's an example of copying these files from a target machine:
-
-@example
-ftp @var{target-machine}
-lcd /usr/local/@var{target}/lib
-prompt
-cd /lib
-mget *crt*.o
-cd /usr/lib
-mget *crt*.o
-quit
-@end example
-
-@node Cross Runtime
-@subsection @file{libgcc.a} and Cross-Compilers
-
-Code compiled by GNU CC uses certain runtime support functions
-implicitly. Some of these functions can be compiled successfully with
-GNU CC itself, but a few cannot be. These problem functions are in the
-source file @file{libgcc1.c}; the library made from them is called
-@file{libgcc1.a}.
-
-When you build a native compiler, these functions are compiled with some
-other compiler--the one that you use for bootstrapping GNU CC.
-Presumably it knows how to open code these operations, or else knows how
-to call the run-time emulation facilities that the machine comes with.
-But this approach doesn't work for building a cross-compiler. The
-compiler that you use for building knows about the host system, not the
-target system.
-
-So, when you build a cross-compiler you have to supply a suitable
-library @file{libgcc1.a} that does the job it is expected to do.
-
-To compile @file{libgcc1.c} with the cross-compiler itself does not
-work. The functions in this file are supposed to implement arithmetic
-operations that GNU CC does not know how to open code for your target
-machine. If these functions are compiled with GNU CC itself, they
-will compile into infinite recursion.
-
-On any given target, most of these functions are not needed. If GNU CC
-can open code an arithmetic operation, it will not call these functions
-to perform the operation. It is possible that on your target machine,
-none of these functions is needed. If so, you can supply an empty
-library as @file{libgcc1.a}.
-
-Many targets need library support only for multiplication and division.
-If you are linking with a library that contains functions for
-multiplication and division, you can tell GNU CC to call them directly
-by defining the macros @code{MULSI3_LIBCALL}, and the like. These
-macros need to be defined in the target description macro file. For
-some targets, they are defined already. This may be sufficient to
-avoid the need for libgcc1.a; if so, you can supply an empty library.
-
-Some targets do not have floating point instructions; they need other
-functions in @file{libgcc1.a}, which do floating arithmetic.
-Recent versions of GNU CC have a file which emulates floating point.
-With a certain amount of work, you should be able to construct a
-floating point emulator that can be used as @file{libgcc1.a}. Perhaps
-future versions will contain code to do this automatically and
-conveniently. That depends on whether someone wants to implement it.
-
-Some embedded targets come with all the necessary @file{libgcc1.a}
-routines written in C or assembler. These targets build
-@file{libgcc1.a} automatically and you do not need to do anything
-special for them. Other embedded targets do not need any
-@file{libgcc1.a} routines since all the necessary operations are
-supported by the hardware.
-
-If your target system has another C compiler, you can configure GNU CC
-as a native compiler on that machine, build just @file{libgcc1.a} with
-@samp{make libgcc1.a} on that machine, and use the resulting file with
-the cross-compiler. To do this, execute the following on the target
-machine:
-
-@example
-cd @var{target-build-dir}
-./configure --host=sparc --target=sun3
-make libgcc1.a
-@end example
-
-@noindent
-And then this on the host machine:
-
-@example
-ftp @var{target-machine}
-binary
-cd @var{target-build-dir}
-get libgcc1.a
-quit
-@end example
-
-Another way to provide the functions you need in @file{libgcc1.a} is to
-define the appropriate @code{perform_@dots{}} macros for those
-functions. If these definitions do not use the C arithmetic operators
-that they are meant to implement, you should be able to compile them
-with the cross-compiler you are building. (If these definitions already
-exist for your target file, then you are all set.)
-
-To build @file{libgcc1.a} using the perform macros, use
-@samp{LIBGCC1=libgcc1.a OLDCC=./xgcc} when building the compiler.
-Otherwise, you should place your replacement library under the name
-@file{libgcc1.a} in the directory in which you will build the
-cross-compiler, before you run @code{make}.
-
-@node Cross Headers
-@subsection Cross-Compilers and Header Files
-
-If you are cross-compiling a standalone program or a program for an
-embedded system, then you may not need any header files except the few
-that are part of GNU CC (and those of your program). However, if you
-intend to link your program with a standard C library such as
-@file{libc.a}, then you probably need to compile with the header files
-that go with the library you use.
-
-The GNU C compiler does not come with these files, because (1) they are
-system-specific, and (2) they belong in a C library, not in a compiler.
-
-If the GNU C library supports your target machine, then you can get the
-header files from there (assuming you actually use the GNU library when
-you link your program).
-
-If your target machine comes with a C compiler, it probably comes with
-suitable header files also. If you make these files accessible from the host
-machine, the cross-compiler can use them also.
-
-Otherwise, you're on your own in finding header files to use when
-cross-compiling.
-
-When you have found suitable header files, put them in the directory
-@file{/usr/local/@var{target}/include}, before building the cross
-compiler. Then installation will run fixincludes properly and install
-the corrected versions of the header files where the compiler will use
-them.
-
-Provide the header files before you build the cross-compiler, because
-the build stage actually runs the cross-compiler to produce parts of
-@file{libgcc.a}. (These are the parts that @emph{can} be compiled with
-GNU CC.) Some of them need suitable header files.
-
-Here's an example showing how to copy the header files from a target
-machine. On the target machine, do this:
-
-@example
-(cd /usr/include; tar cf - .) > tarfile
-@end example
-
-Then, on the host machine, do this:
-
-@example
-ftp @var{target-machine}
-lcd /usr/local/@var{target}/include
-get tarfile
-quit
-tar xf tarfile
-@end example
-
-@node Build Cross
-@subsection Actually Building the Cross-Compiler
-
-Now you can proceed just as for compiling a single-machine compiler
-through the step of building stage 1. If you have not provided some
-sort of @file{libgcc1.a}, then compilation will give up at the point
-where it needs that file, printing a suitable error message. If you
-do provide @file{libgcc1.a}, then building the compiler will automatically
-compile and link a test program called @file{libgcc1-test}; if you get
-errors in the linking, it means that not all of the necessary routines
-in @file{libgcc1.a} are available.
-
-You must provide the header file @file{float.h}. One way to do this is
-to compile @file{enquire} and run it on your target machine. The job of
-@file{enquire} is to run on the target machine and figure out by
-experiment the nature of its floating point representation.
-@file{enquire} records its findings in the header file @file{float.h}.
-If you can't produce this file by running @file{enquire} on the target
-machine, then you will need to come up with a suitable @file{float.h} in
-some other way (or else, avoid using it in your programs).
-
-Do not try to build stage 2 for a cross-compiler. It doesn't work to
-rebuild GNU CC as a cross-compiler using the cross-compiler, because
-that would produce a program that runs on the target machine, not on the
-host. For example, if you compile a 386-to-68030 cross-compiler with
-itself, the result will not be right either for the 386 (because it was
-compiled into 68030 code) or for the 68030 (because it was configured
-for a 386 as the host). If you want to compile GNU CC into 68030 code,
-whether you compile it on a 68030 or with a cross-compiler on a 386, you
-must specify a 68030 as the host when you configure it.
-
-To install the cross-compiler, use @samp{make install}, as usual.
-
-@node Sun Install
-@section Installing GNU CC on the Sun
-@cindex Sun installation
-@cindex installing GNU CC on the Sun
-
-On Solaris, do not use the linker or other tools in
-@file{/usr/ucb} to build GNU CC. Use @code{/usr/ccs/bin}.
-
-If the assembler reports @samp{Error: misaligned data} when bootstrapping,
-you are probably using an obsolete version of the GNU assembler. Upgrade
-to the latest version of GNU @code{binutils}, or use the Solaris assembler.
-
-Make sure the environment variable @code{FLOAT_OPTION} is not set when
-you compile @file{libgcc.a}. If this option were set to @code{f68881}
-when @file{libgcc.a} is compiled, the resulting code would demand to be
-linked with a special startup file and would not link properly without
-special pains.
-
-@cindex @code{alloca}, for SunOS
-There is a bug in @code{alloca} in certain versions of the Sun library.
-To avoid this bug, install the binaries of GNU CC that were compiled by
-GNU CC. They use @code{alloca} as a built-in function and never the one
-in the library.
-
-Some versions of the Sun compiler crash when compiling GNU CC. The
-problem is a segmentation fault in cpp. This problem seems to be due to
-the bulk of data in the environment variables. You may be able to avoid
-it by using the following command to compile GNU CC with Sun CC:
-
-@example
-make CC="TERMCAP=x OBJS=x LIBFUNCS=x STAGESTUFF=x cc"
-@end example
-
-SunOS 4.1.3 and 4.1.3_U1 have bugs that can cause intermittent core
-dumps when compiling GNU CC. A common symptom is an
-internal compiler error which does not recur if you run it again.
-To fix the problem, install Sun recommended patch 100726 (for SunOS 4.1.3)
-or 101508 (for SunOS 4.1.3_U1), or upgrade to a later SunOS release.
-
-@node VMS Install
-@section Installing GNU CC on VMS
-@cindex VMS installation
-@cindex installing GNU CC on VMS
-
-The VMS version of GNU CC is distributed in a backup saveset containing
-both source code and precompiled binaries.
-
-To install the @file{gcc} command so you can use the compiler easily, in
-the same manner as you use the VMS C compiler, you must install the VMS CLD
-file for GNU CC as follows:
-
-@enumerate
-@item
-Define the VMS logical names @samp{GNU_CC} and @samp{GNU_CC_INCLUDE}
-to point to the directories where the GNU CC executables
-(@file{gcc-cpp.exe}, @file{gcc-cc1.exe}, etc.) and the C include files are
-kept respectively. This should be done with the commands:@refill
-
-@smallexample
-$ assign /system /translation=concealed -
- disk:[gcc.] gnu_cc
-$ assign /system /translation=concealed -
- disk:[gcc.include.] gnu_cc_include
-@end smallexample
-
-@noindent
-with the appropriate disk and directory names. These commands can be
-placed in your system startup file so they will be executed whenever
-the machine is rebooted. You may, if you choose, do this via the
-@file{GCC_INSTALL.COM} script in the @file{[GCC]} directory.
-
-@item
-Install the @file{GCC} command with the command line:
-
-@smallexample
-$ set command /table=sys$common:[syslib]dcltables -
- /output=sys$common:[syslib]dcltables gnu_cc:[000000]gcc
-$ install replace sys$common:[syslib]dcltables
-@end smallexample
-
-@item
-To install the help file, do the following:
-
-@smallexample
-$ library/help sys$library:helplib.hlb gcc.hlp
-@end smallexample
-
-@noindent
-Now you can invoke the compiler with a command like @samp{gcc /verbose
-file.c}, which is equivalent to the command @samp{gcc -v -c file.c} in
-Unix.
-@end enumerate
-
-If you wish to use GNU C++ you must first install GNU CC, and then
-perform the following steps:
-
-@enumerate
-@item
-Define the VMS logical name @samp{GNU_GXX_INCLUDE} to point to the
-directory where the preprocessor will search for the C++ header files.
-This can be done with the command:@refill
-
-@smallexample
-$ assign /system /translation=concealed -
- disk:[gcc.gxx_include.] gnu_gxx_include
-@end smallexample
-
-@noindent
-with the appropriate disk and directory name. If you are going to be
-using a C++ runtime library, this is where its install procedure will install
-its header files.
-
-@item
-Obtain the file @file{gcc-cc1plus.exe}, and place this in the same
-directory that @file{gcc-cc1.exe} is kept.
-
-The GNU C++ compiler can be invoked with a command like @samp{gcc /plus
-/verbose file.cc}, which is equivalent to the command @samp{g++ -v -c
-file.cc} in Unix.
-@end enumerate
-
-We try to put corresponding binaries and sources on the VMS distribution
-tape. But sometimes the binaries will be from an older version than the
-sources, because we don't always have time to update them. (Use the
-@samp{/version} option to determine the version number of the binaries and
-compare it with the source file @file{version.c} to tell whether this is
-so.) In this case, you should use the binaries you get to recompile the
-sources. If you must recompile, here is how:
-
-@enumerate
-@item
-Execute the command procedure @file{vmsconfig.com} to set up the files
-@file{tm.h}, @file{config.h}, @file{aux-output.c}, and @file{md.}, and
-to create files @file{tconfig.h} and @file{hconfig.h}. This procedure
-also creates several linker option files used by @file{make-cc1.com} and
-a data file used by @file{make-l2.com}.@refill
-
-@smallexample
-$ @@vmsconfig.com
-@end smallexample
-
-@item
-Setup the logical names and command tables as defined above. In
-addition, define the VMS logical name @samp{GNU_BISON} to point at the
-to the directories where the Bison executable is kept. This should be
-done with the command:@refill
-
-@smallexample
-$ assign /system /translation=concealed -
- disk:[bison.] gnu_bison
-@end smallexample
-
-You may, if you choose, use the @file{INSTALL_BISON.COM} script in the
-@file{[BISON]} directory.
-
-@item
-Install the @samp{BISON} command with the command line:@refill
-
-@smallexample
-$ set command /table=sys$common:[syslib]dcltables -
- /output=sys$common:[syslib]dcltables -
- gnu_bison:[000000]bison
-$ install replace sys$common:[syslib]dcltables
-@end smallexample
-
-@item
-Type @samp{@@make-gcc} to recompile everything (alternatively, submit
-the file @file{make-gcc.com} to a batch queue). If you wish to build
-the GNU C++ compiler as well as the GNU CC compiler, you must first edit
-@file{make-gcc.com} and follow the instructions that appear in the
-comments.@refill
-
-@item
-In order to use GCC, you need a library of functions which GCC compiled code
-will call to perform certain tasks, and these functions are defined in the
-file @file{libgcc2.c}. To compile this you should use the command procedure
-@file{make-l2.com}, which will generate the library @file{libgcc2.olb}.
-@file{libgcc2.olb} should be built using the compiler built from
-the same distribution that @file{libgcc2.c} came from, and
-@file{make-gcc.com} will automatically do all of this for you.
-
-To install the library, use the following commands:@refill
-
-@smallexample
-$ library gnu_cc:[000000]gcclib/delete=(new,eprintf)
-$ library gnu_cc:[000000]gcclib/delete=L_*
-$ library libgcc2/extract=*/output=libgcc2.obj
-$ library gnu_cc:[000000]gcclib libgcc2.obj
-@end smallexample
-
-The first command simply removes old modules that will be replaced with
-modules from @file{libgcc2} under different module names. The modules
-@code{new} and @code{eprintf} may not actually be present in your
-@file{gcclib.olb}---if the VMS librarian complains about those modules
-not being present, simply ignore the message and continue on with the
-next command. The second command removes the modules that came from the
-previous version of the library @file{libgcc2.c}.
-
-Whenever you update the compiler on your system, you should also update the
-library with the above procedure.
-
-@item
-You may wish to build GCC in such a way that no files are written to the
-directory where the source files reside. An example would be the when
-the source files are on a read-only disk. In these cases, execute the
-following DCL commands (substituting your actual path names):
-
-@smallexample
-$ assign dua0:[gcc.build_dir.]/translation=concealed, -
- dua1:[gcc.source_dir.]/translation=concealed gcc_build
-$ set default gcc_build:[000000]
-@end smallexample
-
-@noindent
-where the directory @file{dua1:[gcc.source_dir]} contains the source
-code, and the directory @file{dua0:[gcc.build_dir]} is meant to contain
-all of the generated object files and executables. Once you have done
-this, you can proceed building GCC as described above. (Keep in mind
-that @file{gcc_build} is a rooted logical name, and thus the device
-names in each element of the search list must be an actual physical
-device name rather than another rooted logical name).
-
-@item
-@strong{If you are building GNU CC with a previous version of GNU CC,
-you also should check to see that you have the newest version of the
-assembler}. In particular, GNU CC version 2 treats global constant
-variables slightly differently from GNU CC version 1, and GAS version
-1.38.1 does not have the patches required to work with GCC version 2.
-If you use GAS 1.38.1, then @code{extern const} variables will not have
-the read-only bit set, and the linker will generate warning messages
-about mismatched psect attributes for these variables. These warning
-messages are merely a nuisance, and can safely be ignored.
-
-If you are compiling with a version of GNU CC older than 1.33, specify
-@samp{/DEFINE=("inline=")} as an option in all the compilations. This
-requires editing all the @code{gcc} commands in @file{make-cc1.com}.
-(The older versions had problems supporting @code{inline}.) Once you
-have a working 1.33 or newer GNU CC, you can change this file back.
-
-@item
-If you want to build GNU CC with the VAX C compiler, you will need to
-make minor changes in @file{make-cccp.com} and @file{make-cc1.com}
-to choose alternate definitions of @code{CC}, @code{CFLAGS}, and
-@code{LIBS}. See comments in those files. However, you must
-also have a working version of the GNU assembler (GNU as, aka GAS) as
-it is used as the back-end for GNU CC to produce binary object modules
-and is not included in the GNU CC sources. GAS is also needed to
-compile @file{libgcc2} in order to build @file{gcclib} (see above);
-@file{make-l2.com} expects to be able to find it operational in
-@file{gnu_cc:[000000]gnu-as.exe}.
-
-To use GNU CC on VMS, you need the VMS driver programs
-@file{gcc.exe}, @file{gcc.com}, and @file{gcc.cld}. They are
-distributed with the VMS binaries (@file{gcc-vms}) rather than the
-GNU CC sources. GAS is also included in @file{gcc-vms}, as is Bison.
-
-Once you have successfully built GNU CC with VAX C, you should use the
-resulting compiler to rebuild itself. Before doing this, be sure to
-restore the @code{CC}, @code{CFLAGS}, and @code{LIBS} definitions in
-@file{make-cccp.com} and @file{make-cc1.com}. The second generation
-compiler will be able to take advantage of many optimizations that must
-be suppressed when building with other compilers.
-@end enumerate
-
-Under previous versions of GNU CC, the generated code would occasionally
-give strange results when linked with the sharable @file{VAXCRTL} library.
-Now this should work.
-
-Even with this version, however, GNU CC itself should not be linked with
-the sharable @file{VAXCRTL}. The version of @code{qsort} in
-@file{VAXCRTL} has a bug (known to be present in VMS versions V4.6
-through V5.5) which causes the compiler to fail.
-
-The executables are generated by @file{make-cc1.com} and
-@file{make-cccp.com} use the object library version of @file{VAXCRTL} in
-order to make use of the @code{qsort} routine in @file{gcclib.olb}. If
-you wish to link the compiler executables with the shareable image
-version of @file{VAXCRTL}, you should edit the file @file{tm.h} (created
-by @file{vmsconfig.com}) to define the macro @code{QSORT_WORKAROUND}.
-
-@code{QSORT_WORKAROUND} is always defined when GNU CC is compiled with
-VAX C, to avoid a problem in case @file{gcclib.olb} is not yet
-available.
-
-@node Collect2
-@section @code{collect2}
-
-GNU CC uses a utility called @code{collect2} on nearly all systems to arrange
-to call various initialization functions at start time.
-
-The program @code{collect2} works by linking the program once and
-looking through the linker output file for symbols with particular names
-indicating they are constructor functions. If it finds any, it
-creates a new temporary @samp{.c} file containing a table of them,
-compiles it, and links the program a second time including that file.
-
-@findex __main
-@cindex constructors, automatic calls
-The actual calls to the constructors are carried out by a subroutine
-called @code{__main}, which is called (automatically) at the beginning
-of the body of @code{main} (provided @code{main} was compiled with GNU
-CC). Calling @code{__main} is necessary, even when compiling C code, to
-allow linking C and C++ object code together. (If you use
-@samp{-nostdlib}, you get an unresolved reference to @code{__main},
-since it's defined in the standard GCC library. Include @samp{-lgcc} at
-the end of your compiler command line to resolve this reference.)
-
-The program @code{collect2} is installed as @code{ld} in the directory
-where the passes of the compiler are installed. When @code{collect2}
-needs to find the @emph{real} @code{ld}, it tries the following file
-names:
-
-@itemize @bullet
-@item
-@file{real-ld} in the directories listed in the compiler's search
-directories.
-
-@item
-@file{real-ld} in the directories listed in the environment variable
-@code{PATH}.
-
-@item
-The file specified in the @code{REAL_LD_FILE_NAME} configuration macro,
-if specified.
-
-@item
-@file{ld} in the compiler's search directories, except that
-@code{collect2} will not execute itself recursively.
-
-@item
-@file{ld} in @code{PATH}.
-@end itemize
-
-``The compiler's search directories'' means all the directories where
-@code{gcc} searches for passes of the compiler. This includes
-directories that you specify with @samp{-B}.
-
-Cross-compilers search a little differently:
-
-@itemize @bullet
-@item
-@file{real-ld} in the compiler's search directories.
-
-@item
-@file{@var{target}-real-ld} in @code{PATH}.
-
-@item
-The file specified in the @code{REAL_LD_FILE_NAME} configuration macro,
-if specified.
-
-@item
-@file{ld} in the compiler's search directories.
-
-@item
-@file{@var{target}-ld} in @code{PATH}.
-@end itemize
-
-@code{collect2} explicitly avoids running @code{ld} using the file name
-under which @code{collect2} itself was invoked. In fact, it remembers
-up a list of such names---in case one copy of @code{collect2} finds
-another copy (or version) of @code{collect2} installed as @code{ld} in a
-second place in the search path.
-
-@code{collect2} searches for the utilities @code{nm} and @code{strip}
-using the same algorithm as above for @code{ld}.
-
-@node Header Dirs
-@section Standard Header File Directories
-
-@code{GCC_INCLUDE_DIR} means the same thing for native and cross. It is
-where GNU CC stores its private include files, and also where GNU CC
-stores the fixed include files. A cross compiled GNU CC runs
-@code{fixincludes} on the header files in @file{$(tooldir)/include}.
-(If the cross compilation header files need to be fixed, they must be
-installed before GNU CC is built. If the cross compilation header files
-are already suitable for ISO C and GNU CC, nothing special need be
-done).
-
-@code{GPLUSPLUS_INCLUDE_DIR} means the same thing for native and cross. It
-is where @code{g++} looks first for header files. The C++ library
-installs only target independent header files in that directory.
-
-@code{LOCAL_INCLUDE_DIR} is used only for a native compiler. It is
-normally @file{/usr/local/include}. GNU CC searches this directory so
-that users can install header files in @file{/usr/local/include}.
-
-@code{CROSS_INCLUDE_DIR} is used only for a cross compiler. GNU CC
-doesn't install anything there.
-
-@code{TOOL_INCLUDE_DIR} is used for both native and cross compilers. It
-is the place for other packages to install header files that GNU CC will
-use. For a cross-compiler, this is the equivalent of
-@file{/usr/include}. When you build a cross-compiler,
-@code{fixincludes} processes any header files in this directory.
diff --git a/gcc/integrate.c b/gcc/integrate.c
index bfcd85bb39a..8640b528271 100644
--- a/gcc/integrate.c
+++ b/gcc/integrate.c
@@ -29,7 +29,6 @@ Boston, MA 02111-1307, USA. */
#include "regs.h"
#include "flags.h"
#include "insn-config.h"
-#include "insn-flags.h"
#include "expr.h"
#include "output.h"
#include "recog.h"
@@ -40,6 +39,7 @@ Boston, MA 02111-1307, USA. */
#include "toplev.h"
#include "intl.h"
#include "loop.h"
+#include "params.h"
#include "obstack.h"
#define obstack_chunk_alloc xmalloc
@@ -81,23 +81,15 @@ 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 rtx expand_inline_function_eh_labelmap PARAMS ((rtx));
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));
-/* The maximum number of instructions accepted for inlining a
- function. Increasing values mean more agressive inlining.
- This affects currently only functions explicitly marked as
- inline (or methods defined within the class definition for C++).
- The default value of 10000 is arbitrary but high to match the
- previously unlimited gcc capabilities. */
-
-int inline_max_insns = 10000;
-
/* 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
unrolling). This affects how constant pool references are handled.
@@ -135,17 +127,19 @@ function_cannot_inline_p (fndecl)
tree last = tree_last (TYPE_ARG_TYPES (TREE_TYPE (fndecl)));
/* For functions marked as inline increase the maximum size to
- inline_max_insns (-finline-limit-<n>). For regular functions
+ MAX_INLINE_INSNS (-finline-limit-<n>). For regular functions
use the limit given by INTEGRATE_THRESHOLD. */
int max_insns = (DECL_INLINE (fndecl))
- ? (inline_max_insns
+ ? (MAX_INLINE_INSNS
+ 8 * list_length (DECL_ARGUMENTS (fndecl)))
: INTEGRATE_THRESHOLD (fndecl);
register int ninsns = 0;
register tree parms;
- rtx result;
+
+ if (DECL_UNINLINABLE (fndecl))
+ return N_("function cannot be inline");
/* No inlines with varargs. */
if ((last && TREE_VALUE (last) != void_type_node)
@@ -158,6 +152,9 @@ function_cannot_inline_p (fndecl)
if (current_function_calls_setjmp)
return N_("function using setjmp cannot be inline");
+ if (current_function_calls_eh_return)
+ return N_("function uses __builtin_eh_return");
+
if (current_function_contains_functions)
return N_("function with nested functions cannot be inline");
@@ -227,24 +224,14 @@ function_cannot_inline_p (fndecl)
if (current_function_has_nonlocal_goto)
return N_("function with nonlocal goto cannot be inline");
- /* This is a hack, until the inliner is taught about eh regions at
- the start of the function. */
- for (insn = get_insns ();
- insn
- && ! (GET_CODE (insn) == NOTE
- && NOTE_LINE_NUMBER (insn) == NOTE_INSN_FUNCTION_BEG);
- insn = NEXT_INSN (insn))
+ /* We can't inline functions that return a PARALLEL rtx. */
+ if (DECL_RTL_SET_P (DECL_RESULT (fndecl)))
{
- if (insn && GET_CODE (insn) == NOTE
- && NOTE_LINE_NUMBER (insn) == NOTE_INSN_EH_REGION_BEG)
- return N_("function with complex parameters cannot be inline");
+ rtx result = DECL_RTL (DECL_RESULT (fndecl));
+ if (GET_CODE (result) == PARALLEL)
+ return N_("inline functions not supported for this return value type");
}
- /* We can't inline functions that return a PARALLEL rtx. */
- result = DECL_RTL (DECL_RESULT (fndecl));
- if (result && GET_CODE (result) == PARALLEL)
- return N_("inline functions not supported for this return value type");
-
/* If the function has a target specific attribute attached to it,
then we assume that we should not inline it. This can be overriden
by the target if it defines FUNCTION_ATTRIBUTE_INLINABLE_P. */
@@ -354,7 +341,7 @@ copy_decl_for_inlining (decl, from_fn, to_fn)
DECL_ABSTRACT_ORIGIN (copy) = DECL_ORIGIN (decl);
/* The new variable/label has no RTL, yet. */
- DECL_RTL (copy) = NULL_RTX;
+ SET_DECL_RTL (copy, NULL_RTX);
/* These args would always appear unused, if not for this. */
TREE_USED (copy) = 1;
@@ -551,17 +538,6 @@ process_reg_param (map, loc, copy)
map->reg_map[REGNO (loc)] = copy;
}
-/* Used by duplicate_eh_handlers to map labels for the exception table */
-static struct inline_remap *eif_eh_map;
-
-static rtx
-expand_inline_function_eh_labelmap (label)
- rtx label;
-{
- int index = CODE_LABEL_NUMBER (label);
- return get_label_from_map (eif_eh_map, index);
-}
-
/* Compare two BLOCKs for qsort. The key we sort on is the
BLOCK_ABSTRACT_ORIGIN of the blocks. */
@@ -637,6 +613,7 @@ expand_inline_function (fndecl, parms, target, ignore, type,
rtvec arg_vector = (rtvec) inl_f->original_arg_vector;
rtx static_chain_value = 0;
int inl_max_uid;
+ int eh_region_offset;
/* The pointer used to track the true location of the memory used
for MAP->LABEL_MAP. */
@@ -769,7 +746,7 @@ expand_inline_function (fndecl, parms, target, ignore, type,
/* Allocate the structures we use to remap things. */
- map = (struct inline_remap *) xmalloc (sizeof (struct inline_remap));
+ map = (struct inline_remap *) xcalloc (1, sizeof (struct inline_remap));
map->fndecl = fndecl;
VARRAY_TREE_INIT (map->block_map, 10, "block_map");
@@ -781,6 +758,7 @@ expand_inline_function (fndecl, parms, target, ignore, type,
real_label_map
= (rtx *) xmalloc ((max_labelno) * sizeof (rtx));
map->label_map = real_label_map;
+ map->local_return_label = NULL_RTX;
inl_max_uid = (inl_f->emit->x_cur_insn_uid + 1);
map->insn_map = (rtx *) xcalloc (inl_max_uid, sizeof (rtx));
@@ -894,9 +872,6 @@ expand_inline_function (fndecl, parms, target, ignore, type,
incoming arg rtx values are expanded now so that we can be
sure we have enough slots in the const equiv map since the
store_expr call can easily blow the size estimate. */
- if (DECL_FRAME_SIZE (fndecl) != 0)
- copy_rtx_and_substitute (virtual_stack_vars_rtx, map, 0);
-
if (DECL_SAVED_INSNS (fndecl)->args_size != 0)
copy_rtx_and_substitute (virtual_incoming_args_rtx, map, 0);
}
@@ -957,7 +932,8 @@ expand_inline_function (fndecl, parms, target, ignore, type,
REG_FUNCTION_RETURN_VALUE_P. */
map->inline_target = 0;
- loc = DECL_RTL (DECL_RESULT (fndecl));
+ loc = (DECL_RTL_SET_P (DECL_RESULT (fndecl))
+ ? DECL_RTL (DECL_RESULT (fndecl)) : NULL_RTX);
if (TYPE_MODE (type) == VOIDmode)
/* There is no return value to worry about. */
@@ -1098,6 +1074,11 @@ expand_inline_function (fndecl, parms, target, ignore, type,
else
abort ();
+ /* Remap the exception handler data pointer from one to the other. */
+ temp = get_exception_pointer (inl_f);
+ if (temp)
+ map->reg_map[REGNO (temp)] = get_exception_pointer (cfun);
+
/* Initialize label_map. get_label_from_map will actually make
the labels. */
memset ((char *) &map->label_map[min_labelno], 0,
@@ -1144,6 +1125,19 @@ expand_inline_function (fndecl, parms, target, ignore, type,
/* Now copy the insns one by one. */
copy_insn_list (insns, map, static_chain_value);
+ /* Duplicate the EH regions. This will create an offset from the
+ region numbers in the function we're inlining to the region
+ numbers in the calling function. This must wait until after
+ copy_insn_list, as we need the insn map to be complete. */
+ eh_region_offset = duplicate_eh_regions (inl_f, map);
+
+ /* Now copy the REG_NOTES for those insns. */
+ copy_insn_notes (insns, map, eh_region_offset);
+
+ /* If the insn sequence required one, emit the return label. */
+ if (map->local_return_label)
+ emit_label (map->local_return_label);
+
/* Restore the stack pointer if we saved it above. */
if (inl_f->calls_alloca)
emit_stack_restore (SAVE_BLOCK, stack_save, NULL_RTX);
@@ -1228,10 +1222,10 @@ copy_insn_list (insns, map, static_chain_value)
register int i;
rtx insn;
rtx temp;
- rtx local_return_label = NULL_RTX;
#ifdef HAVE_cc0
rtx cc0_insn = 0;
#endif
+ rtx static_chain_mem = 0;
/* Copy the insns one by one. Do this in two passes, first the insns and
then their REG_NOTES. */
@@ -1258,12 +1252,6 @@ copy_insn_list (insns, map, static_chain_value)
inline_target. */
break;
- /* If the inline fn needs eh context, make sure that
- the current fn has one. */
- if (GET_CODE (pattern) == USE
- && find_reg_note (insn, REG_EH_CONTEXT, 0) != 0)
- get_eh_context ();
-
/* Ignore setting a function value that we don't want to use. */
if (map->inline_target == 0
&& set != 0
@@ -1301,25 +1289,62 @@ copy_insn_list (insns, map, static_chain_value)
&& REG_FUNCTION_VALUE_P (XEXP (pattern, 0)))
break;
- /* If this is setting the static chain rtx, omit it. */
+ /* Look for the address of the static chain slot. The
+ rtx_equal_p comparisons against the
+ static_chain_incoming_rtx below may fail if the static
+ chain is in memory and the address specified is not
+ "legitimate". This happens on Xtensa where the static
+ chain is at a negative offset from argp and where only
+ positive offsets are legitimate. When the RTL is
+ generated, the address is "legitimized" by copying it
+ into a register, causing the rtx_equal_p comparisons to
+ fail. This workaround looks for code that sets a
+ register to the address of the static chain. Subsequent
+ memory references via that register can then be
+ identified as static chain references. We assume that
+ the register is only assigned once, and that the static
+ chain address is only live in one register at a time. */
+
else if (static_chain_value != 0
&& set != 0
+ && GET_CODE (static_chain_incoming_rtx) == MEM
&& GET_CODE (SET_DEST (set)) == REG
- && rtx_equal_p (SET_DEST (set),
- static_chain_incoming_rtx))
+ && rtx_equal_p (SET_SRC (set),
+ XEXP (static_chain_incoming_rtx, 0)))
+ {
+ static_chain_mem =
+ gen_rtx_MEM (GET_MODE (static_chain_incoming_rtx),
+ SET_DEST (set));
+
+ /* emit the instruction in case it is used for something
+ other than setting the static chain; if it's not used,
+ it can always be removed as dead code */
+ copy = emit_insn (copy_rtx_and_substitute (pattern, map, 0));
+ }
+
+ /* If this is setting the static chain rtx, omit it. */
+ else if (static_chain_value != 0
+ && set != 0
+ && (rtx_equal_p (SET_DEST (set),
+ static_chain_incoming_rtx)
+ || (static_chain_mem
+ && rtx_equal_p (SET_DEST (set), static_chain_mem))))
break;
/* If this is setting the static chain pseudo, set it from
the value we want to give it instead. */
else if (static_chain_value != 0
&& set != 0
- && rtx_equal_p (SET_SRC (set),
- static_chain_incoming_rtx))
+ && (rtx_equal_p (SET_SRC (set),
+ static_chain_incoming_rtx)
+ || (static_chain_mem
+ && rtx_equal_p (SET_SRC (set), static_chain_mem))))
{
rtx newdest = copy_rtx_and_substitute (SET_DEST (set), map, 1);
copy = emit_move_insn (newdest, static_chain_value);
- static_chain_value = 0;
+ if (GET_CODE (static_chain_incoming_rtx) != MEM)
+ static_chain_value = 0;
}
/* If this is setting the virtual stack vars register, this must
@@ -1389,13 +1414,11 @@ copy_insn_list (insns, map, static_chain_value)
break;
case JUMP_INSN:
- if (GET_CODE (PATTERN (insn)) == RETURN
- || (GET_CODE (PATTERN (insn)) == PARALLEL
- && GET_CODE (XVECEXP (PATTERN (insn), 0, 0)) == RETURN))
+ if (map->integrating && returnjump_p (insn))
{
- if (local_return_label == 0)
- local_return_label = gen_label_rtx ();
- pattern = gen_jump (local_return_label);
+ if (map->local_return_label == 0)
+ map->local_return_label = gen_label_rtx ();
+ pattern = gen_jump (map->local_return_label);
}
else
pattern = copy_rtx_and_substitute (PATTERN (insn), map, 0);
@@ -1526,31 +1549,9 @@ copy_insn_list (insns, map, static_chain_value)
copy = emit_note (NOTE_SOURCE_FILE (insn),
NOTE_LINE_NUMBER (insn));
if (copy
- && (NOTE_LINE_NUMBER (copy) == NOTE_INSN_EH_REGION_BEG
- || NOTE_LINE_NUMBER (copy) == NOTE_INSN_EH_REGION_END))
- {
- rtx label
- = get_label_from_map (map, NOTE_EH_HANDLER (copy));
-
- /* We have to duplicate the handlers for the original. */
- if (NOTE_LINE_NUMBER (copy) == NOTE_INSN_EH_REGION_BEG)
- {
- /* We need to duplicate the handlers for the EH region
- and we need to indicate where the label map is */
- eif_eh_map = map;
- duplicate_eh_handlers (NOTE_EH_HANDLER (copy),
- CODE_LABEL_NUMBER (label),
- expand_inline_function_eh_labelmap);
- }
-
- /* We have to forward these both to match the new exception
- region. */
- NOTE_EH_HANDLER (copy) = CODE_LABEL_NUMBER (label);
- }
- else if (copy
- && (NOTE_LINE_NUMBER (copy) == NOTE_INSN_BLOCK_BEG
- || NOTE_LINE_NUMBER (copy) == NOTE_INSN_BLOCK_END)
- && NOTE_BLOCK (insn))
+ && (NOTE_LINE_NUMBER (copy) == NOTE_INSN_BLOCK_BEG
+ || NOTE_LINE_NUMBER (copy) == NOTE_INSN_BLOCK_END)
+ && NOTE_BLOCK (insn))
{
tree *mapped_block_p;
@@ -1566,6 +1567,11 @@ 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)
+ NOTE_EXPECTED_VALUE (copy)
+ = copy_rtx_and_substitute (NOTE_EXPECTED_VALUE (insn),
+ map, 0);
}
else
copy = 0;
@@ -1580,35 +1586,65 @@ copy_insn_list (insns, map, static_chain_value)
map->insn_map[INSN_UID (insn)] = copy;
}
+}
+
+/* Copy the REG_NOTES. Increment const_age, so that only constants
+ from parameters can be substituted in. These are the only ones
+ that are valid across the entire function. */
+
+static void
+copy_insn_notes (insns, map, eh_region_offset)
+ rtx insns;
+ struct inline_remap *map;
+ int eh_region_offset;
+{
+ rtx insn, new_insn;
- /* Now copy the REG_NOTES. Increment const_age, so that only constants
- from parameters can be substituted in. These are the only ones that
- are valid across the entire function. */
map->const_age++;
for (insn = insns; insn; insn = NEXT_INSN (insn))
- if (INSN_P (insn)
- && map->insn_map[INSN_UID (insn)]
- && REG_NOTES (insn))
- {
- rtx next, note = copy_rtx_and_substitute (REG_NOTES (insn), map, 0);
+ {
+ if (! INSN_P (insn))
+ continue;
- /* We must also do subst_constants, in case one of our parameters
- has const type and constant value. */
- subst_constants (&note, NULL_RTX, map, 0);
- apply_change_group ();
- REG_NOTES (map->insn_map[INSN_UID (insn)]) = note;
+ new_insn = map->insn_map[INSN_UID (insn)];
+ if (! new_insn)
+ continue;
- /* Finally, delete any REG_LABEL notes from the chain. */
- for (; note; note = next)
- {
- next = XEXP (note, 1);
- if (REG_NOTE_KIND (note) == REG_LABEL)
- remove_note (map->insn_map[INSN_UID (insn)], note);
- }
- }
+ if (REG_NOTES (insn))
+ {
+ rtx next, note = copy_rtx_and_substitute (REG_NOTES (insn), map, 0);
+
+ /* We must also do subst_constants, in case one of our parameters
+ has const type and constant value. */
+ subst_constants (&note, NULL_RTX, map, 0);
+ apply_change_group ();
+ REG_NOTES (new_insn) = note;
+
+ /* Delete any REG_LABEL notes from the chain. Remap any
+ REG_EH_REGION notes. */
+ for (; note; note = next)
+ {
+ next = XEXP (note, 1);
+ if (REG_NOTE_KIND (note) == REG_LABEL)
+ remove_note (new_insn, note);
+ else if (REG_NOTE_KIND (note) == REG_EH_REGION)
+ XEXP (note, 0) = GEN_INT (INTVAL (XEXP (note, 0))
+ + eh_region_offset);
+ }
+ }
- if (local_return_label)
- emit_label (local_return_label);
+ if (GET_CODE (insn) == CALL_INSN
+ && GET_CODE (PATTERN (insn)) == CALL_PLACEHOLDER)
+ {
+ int i;
+ for (i = 0; i < 3; i++)
+ copy_insn_notes (XEXP (PATTERN (insn), i), map, eh_region_offset);
+ }
+
+ if (GET_CODE (insn) == JUMP_INSN
+ && GET_CODE (PATTERN (insn)) == RESX)
+ XINT (PATTERN (new_insn), 0) += eh_region_offset;
+ }
}
/* Given a chain of PARM_DECLs, ARGS, copy each decl into a VAR_DECL,
@@ -1639,7 +1675,7 @@ integrate_parm_decls (args, map, arg_vector)
subst_constants. */
subst_constants (&new_decl_rtl, NULL_RTX, map, 1);
apply_change_group ();
- DECL_RTL (decl) = new_decl_rtl;
+ SET_DECL_RTL (decl, new_decl_rtl);
}
}
@@ -1669,15 +1705,19 @@ integrate_decl_tree (let, map)
d = copy_decl_for_inlining (t, map->fndecl, current_function_decl);
- if (DECL_RTL (t) != 0)
+ if (DECL_RTL_SET_P (t))
{
- DECL_RTL (d) = copy_rtx_and_substitute (DECL_RTL (t), map, 1);
+ rtx r;
+
+ SET_DECL_RTL (d, copy_rtx_and_substitute (DECL_RTL (t), map, 1));
/* Fully instantiate the address with the equivalent form so that the
debugging information contains the actual register, instead of the
virtual register. Do this by not passing an insn to
subst_constants. */
- subst_constants (&DECL_RTL (d), NULL_RTX, map, 1);
+ r = DECL_RTL (d);
+ subst_constants (&r, NULL_RTX, map, 1);
+ SET_DECL_RTL (d, r);
apply_change_group ();
}
@@ -1749,15 +1789,7 @@ copy_rtx_and_substitute (orig, map, for_lhs)
{
/* Some hard registers are also mapped,
but others are not translated. */
- if (map->reg_map[regno] != 0
- /* We shouldn't usually have reg_map set for return
- register, but it may happen if we have leaf-register
- remapping and the return register is used in one of
- the calling sequences of a call_placeholer. In this
- case, we'll end up with a reg_map set for this
- register, but we don't want to use for registers
- marked as return values. */
- && ! REG_FUNCTION_VALUE_P (orig))
+ if (map->reg_map[regno] != 0)
return map->reg_map[regno];
/* If this is the virtual frame pointer, make space in current
@@ -1875,9 +1907,9 @@ copy_rtx_and_substitute (orig, map, for_lhs)
if (map->integrating && regno < FIRST_PSEUDO_REGISTER
&& LEAF_REGISTERS[regno] && LEAF_REG_REMAP (regno) != regno)
{
- temp = gen_rtx_REG (mode, regno);
- map->reg_map[regno] = temp;
- return temp;
+ if (!map->leaf_reg_map[regno][mode])
+ map->leaf_reg_map[regno][mode] = gen_rtx_REG (mode, regno);
+ return map->leaf_reg_map[regno][mode];
}
#endif
else
@@ -2045,12 +2077,6 @@ copy_rtx_and_substitute (orig, map, for_lhs)
copy_rtx_and_substitute (constant, map, for_lhs)),
0);
}
- else if (SYMBOL_REF_NEED_ADJUST (orig))
- {
- eif_eh_map = map;
- return rethrow_symbol_map (orig,
- expand_inline_function_eh_labelmap);
- }
return orig;
@@ -2854,6 +2880,10 @@ output_inline_function (fndecl)
if (f->no_debugging_symbols)
write_symbols = NO_DEBUG;
+ /* Do any preparation, such as emitting abstract debug info for the inline
+ before it gets mangled by optimization. */
+ note_outlining_of_inline_function (fndecl);
+
/* Compile this function all the way down to assembly code. */
rest_of_compilation (fndecl);
diff --git a/gcc/integrate.h b/gcc/integrate.h
index 51fced4d87e..52c300424fa 100644
--- a/gcc/integrate.h
+++ b/gcc/integrate.h
@@ -1,5 +1,5 @@
/* Function integration definitions for GNU C-Compiler
- Copyright (C) 1990, 1995, 1998, 1999, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1990, 1995, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -47,6 +47,10 @@ struct inline_remap
/* Mapping from old registers to new registers.
It is allocated and deallocated in `expand_inline_function' */
rtx *reg_map;
+#if defined (LEAF_REGISTERS) && defined (LEAF_REG_REMAP)
+ /* Mapping from old leaf registers to new leaf registers. */
+ rtx leaf_reg_map[FIRST_PSEUDO_REGISTER][NUM_MACHINE_MODES];
+#endif
/* Mapping from old code-labels to new code-labels.
The first element of this map is label_map[min_labelno]. */
rtx *label_map;
@@ -93,6 +97,9 @@ struct inline_remap
/* Likewise, this is the copied constraints vector. */
rtvec copy_asm_constraints_vector;
+ /* Target of a return insn, if needed and inlining. */
+ rtx local_return_label;
+
/* Indications for regs being pointers and their alignment. */
unsigned char *regno_pointer_align;
rtx *x_regno_reg_rtx;
diff --git a/gcc/intl/ChangeLog b/gcc/intl/ChangeLog
index 56efee29c53..fe8064f8a47 100644
--- a/gcc/intl/ChangeLog
+++ b/gcc/intl/ChangeLog
@@ -1,3 +1,35 @@
+2002-02-20 Release Manager
+
+ * GCC 3.0.4 Released.
+
+2002-02-20 Release Manager
+
+ * GCC 3.0.4 Released.
+
+2001-12-20 Release Manager
+
+ * GCC 3.0.3 Released.
+
+2001-10-23 Release Manager
+
+ * GCC 3.0.2 Released.
+
+2001-08-19 Release Manager
+
+ * GCC 3.0.1 Released.
+
+2001-08-19 Release Manager
+
+ * GCC 3.0.1 Released.
+
+20010617 Release Manager
+
+ * GCC 3.0 Released.
+
+2001-05-25 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * po2tbl.sed.in: Fixed typo.
+
2000-09-18 Bruno Haible <haible@clisp.cons.org>
* intl/dcgettext.c: Outside libc, use local variable names that don't
diff --git a/gcc/intl/po2tbl.sed.in b/gcc/intl/po2tbl.sed.in
index b3bcca4d730..04562863576 100755
--- a/gcc/intl/po2tbl.sed.in
+++ b/gcc/intl/po2tbl.sed.in
@@ -18,7 +18,7 @@
#
1 {
i\
-/* Automatically generated by po2tbl.sed from @PACKAGE NAME@.pot. */\
+/* Automatically generated by po2tbl.sed from @PACKAGE@.pot. */\
\
#if HAVE_CONFIG_H\
# include <config.h>\
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index 95126e454da..63ac5a8a97b 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -1,3 +1,714 @@
+2002-02-20 Release Manager
+
+ * GCC 3.0.4 Released.
+
+2002-02-20 Release Manager
+
+ * GCC 3.0.4 Released.
+
+2001-12-20 Release Manager
+
+ * GCC 3.0.3 Released.
+
+2001-11-30 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
+
+ * class.c (add_interface_do): Set BINFO_VPTR_FIELD.
+
+2001-11-27 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * jvspec.c (jvgenmain_spec): Cannot use %umain, breaks
+ ASM_FINAL_SPEC.
+ (lang_specific_pre_link): Use set_input to set input_filename.
+ Append `main' here.
+ * jvgenmain.c (usage): Append literal `main' to CLASSNAME.
+ (main): Fix definition.
+ Strip `main' from classname.
+ Fixes PR java/227.
+
+2001-10-23 Release Manager
+
+ * GCC 3.0.2 Released.
+
+2001-09-21 Richard Henderson <rth@redhat.com>
+
+ * class.c (get_dispatch_table): Handle function descriptors.
+ (build_dtable_decl): Likewise.
+ * expr.c (build_invokevirtual): Likewise.
+
+2001-08-19 Release Manager
+
+ * GCC 3.0.1 Released.
+
+2001-08-19 Release Manager
+
+ * GCC 3.0.1 Released.
+
+2001-08-12 David Edelsohn <edelsohn@gnu.org>
+
+ Revert previous patch.
+
+2001-08-02 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * jvspec.c (jvgenmain_spec): Cannot use %umain, breaks
+ ASM_FINAL_SPEC.
+ (lang_specific_pre_link): Use set_input to set input_filename.
+ Append `main' here.
+ * jvgenmain.c (usage): Append literal `main' to CLASSNAME.
+ (main): Fix definition.
+ Strip `main' from classname.
+ Fixes PR java/227.
+
+2001-07-18 Tom Tromey <tromey@redhat.com>
+
+ For PR java/2812:
+ * lex.h: Use HAVE_ICONV, not HAVE_ICONV_H.
+ * lex.c (java_new_lexer): Use ICONV_CONST.
+ (java_read_char): Likewise.
+ * Make-lang.in (jc1$(exeext)): Link against LIBICONV.
+ (jv-scan$(exeext)): Likewise.
+
+2001-07-13 Tom Tromey <tromey@redhat.com>
+
+ * jvspec.c (jvgenmain_spec): Remove -ffilelist-file from cc1
+ invocation.
+
+2001-07-04 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * gcj.texi: Use gpl.texi.
+ * Make-lang.in ($(srcdir)/java/gcj.info, java/gcj.dvi): Update
+ dependencies and use doc/include in search path.
+
+2001-07-04 Jeffrey Oldham <oldham@codesourcery.com>
+
+ * jvgenmain.c (do_mangle_classname): End string constant with '\0'.
+
+20010617 Release Manager
+
+ * GCC 3.0 Released.
+
+2001-06-07 Theodore Papadopoulo <Theodore.Papadopoulo@sophia.inria.fr>
+
+ * Make-lang.in ($(srcdir)/java/gcj.info): Added dependencies on
+ fdl.texi.
+ (java/gcj.dvi): Use TEXI2DVI instead of custom tex calls. Create
+ the dvi file in the java directory.
+
+2001-06-04 Alexandre Petit-Bianco <apbianco@redhat.com>
+
+ * expr.c (force_evaluation_order): Match wrapped ctor calls, locate
+ arguments accordingly.
+
+2001-06-02 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * gcj.texi: Move contents to just after title page.
+
+2001-06-01 Alexandre Petit-Bianco <apbianco@redhat.com>
+
+ * parse.y (type_literals:): Use `build_incomplete_class_ref' with
+ builtin type.
+ (patch_incomplete_class_ref): Build the class ref, build the class
+ init if necessary, complete the tree.
+ Fixes PR java/2605
+
+2001-05-31 Alexandre Petit-Bianco <apbianco@redhat.com>
+
+ * parse.y (lookup_field_wrapper): Test `name' code.
+ (resolve_qualified_expression_name): Test `qual_wfl' code.
+ (qualify_ambiguous_name): Handle `CONVERT_EXPR', fixe indentation,
+ handle `qual_wfl' by code.
+ (maybe_build_primttype_type_ref): Test `wfl' code.
+
+2001-05-23 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * jv-scan.c (version): Update copyright year.
+
+2001-05-21 Per Bothner <per@bothner.com>
+
+ * jcf-parse.c (read_class): If class is from .class or .zip file
+ and it's already been read, don't push/pop parser context.
+
+2001-05-17 Per Bothner <per@bothner.com>
+
+ * jvspec.c (lang_specific_pre_link): Re-arrange the linker
+ command line so the jvgenmain-generated main program comes first.
+
+2001-05-15 Tom Tromey <tromey@redhat.com>
+
+ * class.c (build_utf8_ref): Don't generate identifier based on
+ utf8const contents.
+
+2001-05-12 Richard Henderson <rth@redhat.com>
+
+ * java-tree.def (JAVA_EXC_OBJ_EXPR): New.
+ * expr.c (java_lang_expand_expr): Expand it.
+ (process_jvm_instruction): Build JAVA_EXC_OBJ_EXPR instead of
+ calling build_exception_object_ref.
+ * parse.y (catch_clause_parameter): Likewise.
+ (build_dot_class_method): Likewise.
+ (try_reference_assignconv): Likewise.
+ * check-init.c (check_init): Check JAVA_EXC_OBJ_EXPR not EXC_PTR_EXPR.
+ * jcf-write.c (generate_bytecode_insns): Likewise.
+
+2001-05-12 Richard Henderson <rth@redhat.com>
+
+ EH merge from mainline:
+ * java-tree.h (throw_node): Define as a single member of
+ java_global_trees instead of a separate array.
+ (JTI_THROW_NODE): New.
+ * decl.c (throw_node): Don't declare.
+ (init_decl_processing): Init a scalar throw_node.
+ Don't register it for gc.
+ * check-init.c (check_init): Reference scalar throw_node.
+ * expr.c (build_java_athrow): Likewise.
+ * jcf-write.c (generate_bytecode_insns): Likewise.
+ * parse.h (BUILD_THROW): Likewise.
+
+ * decl.c (end_java_method): Do not save and restore
+ flag_non_call_exceptions.
+ * parse.y (source_end_java_method): Likewise.
+ * lang.c (flag_exceptions): Don't declare.
+ (java_init_options): Set flag_non_call_exceptions. Set
+ flag_exceptions here ...
+ (java_init): ... not here.
+
+ * lang.c (flag_new_exceptions): Don't declare it.
+ (java_init_options): Or set it.
+
+ * expr.c, parse.h: Use USING_SJLJ_EXCEPTIONS instead of
+ exceptions_via_longjmp.
+
+2001-05-12 Richard Henderson <rth@redhat.com>
+
+ * decl.c (end_java_method): Rename asynchronous_exceptions to
+ flag_non_call_exceptions.
+ * parse.y (source_end_java_method): Likewise.
+
+2001-05-07 Alexandre Petit-Bianco <apbianco@redhat.com>
+
+ * parse.y (build_unresolved_array_type): Set
+ EXPR_WFL_QUALIFICATION on the newly created wfl.
+ Fixes PR java/2538. Fixes PR java/2535.
+
+2001-05-07 Alexandre Petit-Bianco <apbianco@redhat.com>
+
+ * parse.y (fix_constructors): Removed unecessary assignment to
+ local. Moved assignment to `this$<n>', fixed comments and
+ indentation.
+ (build_wfl_wrap): Fixed indentation.
+ Fixes PR java/2598, java/2579 and java/2658.
+
+2000-05-02 Jeff Sturm <jsturm@one-point.com>
+
+ * expr.c (build_class_init): Move MODIFY_EXPR
+ outside of COND_EXPR. Remove variable `call'.
+
+2001-05-03 Mo DeJong <mdejong@redhat.com>
+
+ * lex.c (java_new_lexer): Call iconv_close on temp handle used to
+ check for byte swap.
+
+2001-05-01 Tom Tromey <tromey@redhat.com>
+
+ * Make-lang.in ($(srcdir)/java/gcj.info): Added `-I..'.
+ (java/gcj.dvi): Added $(srcdir) to TEXINPUTS.
+ * gcj.texi: Updated copyright text. Include fdl.texi.
+ (Top): Link to new node.
+
+2001-05-01 Per Bothner <per@bothner.com>
+
+ * parse.y (java_pop_parser_context): The TREE_VALUE of a link in the
+ import_list contains the name, not the TREE_PURPOSE.
+
+2001-04-29 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * jcf-io.c (read_zip_member): Cast to long in comparison with
+ signed value.
+
+ * jvspec.c (lang_specific_driver): Initialize variables.
+
+ * mangle.c (find_compression_record_match): Likewise.
+
+ * typeck.c (build_null_signature): Provide static prototype. Mark
+ parameter with ATTRIBUTE_UNUSED.
+
+ * verify.c (verify_jvm_instructions): Initialize variable.
+
+2001-04-27 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
+
+ * parse.y (do_resolve_class): Check for cyclic inheritance during
+ inner class resolution.
+
+2001-04-27 Per Bothner <per@bothner.com>
+
+ * parse.y (java_expand_classes): Don't change ctxp_for_generation
+ while iterating, since that could cause gc to lose stuff.
+
+2001-04-26 Per Bothner <per@bothner.com>
+
+ Fix method search wrt scope of inner classes to match JLS2.
+ * typeck.c (build_null_signature): New static function.
+ (has_method): New function. Uses build_null_signature and lookup_do.
+ * java-tree.h (has_method): New declaration.
+ * parse.y (find_applicable_accessible_methods_list): Do not search
+ context of inner classes here.
+ (patch_method_invocation): Search scope, ie. current and outer clases,
+ for method matching simple name, to find class.
+
+2001-04-26 Per Bothner <per@bothner.com>
+
+ * jcf-write.c (generate_bytecode_insns case SWITCH_EXPR):
+ Fix thinko: If a single case, use if_icmpeq, not ifeq.
+
+ * constants.c (find_methodref_with_class_index): New function.
+ (find_methodref_index): Use find_methodref_with_class_index.
+ * java-tree.h (find_methodref_with_class_index): New declaration.
+ * jcf-write.c (generate_bytecode_insns case CALL_EXPR): Don't change
+ DECL_CONTEXT, instead use new find_methodref_with_class_index function.
+ If context changed from interface to class, don't use invokeinterface.
+
+2001-04-25 Alexandre Oliva <aoliva@redhat.com>
+
+ * config-lang.in (target_libs): Copy from $libgcj_saved.
+
+2001-04-23 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * jvspec.c (lang_specific_driver): Use concat in lieu of
+ xmalloc/sprintf.
+
+2001-04-20 Per Bothner <per@bothner.com>
+
+ Fixes to compile multiple .class files at once.
+ * decl.c (init_decl_processing): Don't set CLASS_LOADED_P.
+ * java-tree.h (CLASS_PARSED_P): New macro.
+ (CLASS_LOADED_P): Re-define to use TYPE_SIZE and CLASS_PARSED_P.
+ * jcf-parse.c (jcf_parse_source): Inline into read_class.
+ (read_class): Avoid some code duplication.
+ Don't call JCF_FINISH for a .class file - might be needed later.
+ (jcf_parse): Don't call layout_class here. Check/set CLASS_PARSED_P
+ rather than CLASS_LOADED_P, since latter implies class laid out.
+ (yyparse): Do layout_class and JCF_FINISh here instead, in pass 2.
+ * parse.y: Don't need to set CLASS_LOADED_P for array types.
+
+2001-04-06 Tom Tromey <tromey@redhat.com>
+ Alexandre Petit-Bianco <apbianco@redhat.com>
+
+ Fix for PR gcj/1404 and PR gcj/2332:
+ * parse.y (build_array_from_name): If we use the type_wfl then
+ accumulate dimensions from the original type as well.
+ (build_unresolved_array_type): Don't modify TYPE_OR_WFL in place.
+
+2001-04-06 Tom Tromey <tromey@redhat.com>
+
+ * parse.y (analyze_clinit_body): Return true if the second operand
+ of a METHOD_EXPR is nonzero.
+
+2001-04-06 Tom Tromey <tromey@redhat.com>
+
+ * Make-lang.in ($(srcdir)/java/parse-scan.c): Run bison from build
+ directory.
+ ($(srcdir)/java/parse.c): Likewise.
+
+2001-04-05 Alexandre Petit-Bianco <apbianco@redhat.com>
+
+ * gcj.texi: Use `which-gcj' instead of `which-g77.'
+ (version-gcc): Initialized.
+ (which-gcj): Likewise.
+
+2001-04-04 Alexandre Petit-Bianco <apbianco@redhat.com>
+
+ * java-tree.h (struct lang_decl): New macro
+ `DECL_FIXED_CONSTRUCTOR_P.' New field `fixed_ctor.'
+ * parse.y (build_instance_initializer): New function.
+ (add_instance_initializer): Use it.
+ (java_fix_constructors): Set `current_class' before fix pass.
+ (fix_constructors): Just return if already fixed. Move `super()'
+ invokation ahead. Use `build_instance_initializer.'
+ Fixes PR java/1315.
+
+2001-04-04 Alexandre Petit-Bianco <apbianco@redhat.com>
+
+ * parse.y (resolve_qualified_expression_name): Pass field's
+ DECL_CONTEXT to `not_accessible_p.'
+ (not_accessible_p): Changed parameters order in `inherits_from_p'
+ invokation.
+
+2001-04-04 Per Bothner <per@bothner.com>
+
+ * java-tree.h (CONSTANT_VALUE_P): New macro.
+ * jcf-write.c (generate_classfile): Use CONSTANT_VALUE_P.
+ * parse.y (maybe_build_class_init_for_field): New static function.
+ (resolve_expression_name, resolve_field_access): Use
+ maybe_build_class_init_for_field instead of build_class_init
+ This does not do the init if the field is compile-time-constant.
+ (resolve_field_access): Simplify.
+
+ * parse.y (fold_constant_for_init): Merge test into switch.
+
+2001-03-30 Alexandre Petit-Bianco <apbianco@redhat.com>
+
+ * parse-scan.y (array_type:): Rewritten.
+ (type_declaration:): `empty_statement' replaces `SC_TK.'
+ (class_member_declaration:): `empty statement' added.
+ (method_body:): Simplified.
+ (static_initializer:): Likewise.
+ (primary_no_new_array:): Use `type_literals.'
+ (type_literals:): New rule.
+ (dims:): Set and update `bracket_count.'
+ Fixes PR java/1074. Fixes PR java/2412.
+
+2001-03-28 Hans Boehm <boehm@acm.org>
+
+ * boehm.c (PROCEDURE_OBJECT_DESCRIPTOR): Set to use `build_int_2.'
+ (get_boehm_type_descriptor): Set type on returned value to be a
+ pointer length integer.
+
+2001-03-26 Mark Mitchell <mark@codesourcery.com>
+
+ * parse.h (DECL_END_SOURCE_LINE): Don't rely on DECL_FRAME_SIZE.
+
+2001-03-26 Alexandre Petit-Bianco <apbianco@redhat.com>
+
+ * parse.y (find_as_inner_class): Follow current package
+ indications not to mistakingly load an unrelated class.
+
+2001-03-23 Per Bothner <per@bothner.com>
+
+ * verify.c (verify_jvm_instructions): Replace 3 pop_type by POP_TYPE
+ macro for better error pin-pointing.
+ * java-tree.h: Fix typo in comment.
+
+ * jcf-write.c (generate_bytecode_insns): Changes to TRY_FINALLY_EXPR.
+ Don't include jsr/goto in exception range.
+ Check if start and end of exception range are the same (also TRY_EXPR).
+ Don't emit jsr after try_block if CAN_COMPLETE_NORMALLY is false.
+ However, do emit the following goto even if try_block is empty.
+ Defer freeing exception_decl until after the finalizer, to make
+ sure the local isn't reused in the finalizer. Fixes PR java/1208.
+ * parse.y (java_complete_lhs): If the try-clause is empty, just
+ return the finally-clause and vice versa.
+
+2001-03-23 Alexandre Petit-Bianco <apbianco@redhat.com>
+
+ * gcj.texi (Input Options): documented the check for attribute
+ `gnu.gcc.gccj-compiled' and the `-fforce-classes-archive-check' flag.
+ * java-tree.h (flag_force_classes_archive_check): Declared extern.
+ * jcf-parse.c (HANDLE_GCJCOMPILED_ATTRIBUTE): New macro.
+ (jcf_parse): Check for the right classes archive if necessary.
+ * jcf-reader.c (get_attribute): Define `MATCH_ATTRIBUTE' and use it.
+ (jcf_parse_fields): Fixed indentation.
+ * jcf-write.c (append_gcj_attribute): New function.
+ (generate_classfile): Compute the attribute count, invoke
+ `append_gcj_attribute'.
+ * jcf.h (typedef struct JCF): `seen_in_zip' and `java_source'
+ turned into bit fields. New bit field `right_zip.'
+ (JCF_ZERO): Set `right_zip' to zero.
+ * lang-options.h (-fforce-classes-archive-check): Added flag.
+ * lang.c (flag_force_classes_archive_check): New flag.
+ (lang_f_options): New entry `force-classes-archive-check.'
+ Fixes PR java/1213.
+
+2001-03-23 Bryce McKinlay <bryce@albatross.co.nz>
+
+ * gjavah.c (cxx_keywords): Update from the definitive list in cp/lex.c.
+ * lex.c (cxx_keywords): Likewise.
+
+2001-03-21 Alexandre Petit-Bianco <apbianco@redhat.com>
+
+ * parse.y (qualify_ambiguous_name): Broaden `length'
+ recognition. Help MODIFY_EXPR be resolved as expression names.
+ Fixes PR java/2066. Fixes PR java/2400.
+
+2001-03-21 Bryce McKinlay <bryce@albatross.co.nz>
+
+ * gjavah.c (process_file): Mark interface definitions with
+ "__attribute__ ((java_interface))".
+
+2001-03-22 Zack Weinberg <zackw@stanford.edu>
+
+ * lang-specs.h: Add zero initializer for cpp_spec field to
+ all array elements.
+
+2001-03-21 Alexandre Petit-Bianco <apbianco@redhat.com>
+
+ * class.c (layout_class): Fixed push_super_field's second
+ argument. Fixes PR java/2333.
+ (jdep_resolve_class): Reset TYPE_SIZE if `error_mark_node', it's
+ too early to lay innerclasses out.
+
+2001-03-20 Tom Tromey <tromey@redhat.com>
+ Alexandre Petit-Bianco <apbianco@redhat.com>
+
+ * parse.y (patch_assignment): Handle the case of a SAVE_EXPR
+ inside an array reference. Insertion of the array store check
+ rewritten. Fixes PR java/2299.
+
+2001-03-20 Tom Tromey <tromey@redhat.com>
+
+ * lex.c (java_read_unicode): Only accept leading `u's.
+
+2001-03-20 Tom Tromey <tromey@redhat.com>
+
+ * jcf-parse.c (read_class): Initialize `class'.
+
+2001-03-20 Matt Kraai <kraai@alumni.carnegiemellon.edu>
+
+ * jcf_parse.c (jcf_parse): Eliminate unused variable.
+
+2001-03-19 Mark Mitchell <mark@codesourcery.com>
+
+ * class.c (build_class_ref): Use SET_DECL_ASSEMBLER_NAME.
+ (layout_class): Likewise.
+ (layout_class_method): Likewise.
+ (emit_register_classes): Likewise.
+ * decl.c (builtin_function): Likewise.
+ (give_name_to_locals): Likewise.
+
+2001-03-19 Per Bothner <per@bothner.com>
+
+ * jcf-parse.c (load_inner_classes): Check CLASS_LOADED_P
+ before trying to load an inner class.
+
+ Fixes to process to command-line .class files in two passes.
+ * java-tree.h (JAVA_FILE_P, CLASS_FILE_P, ZIP_FILE_P): New flags.
+ (CLASS_FROM_CURRENTLY_COMPILED_SOURCE_P): Rename to ..
+ (CLASS_FROM_CURRENTLY_COMPILED_P): ... because it is more general now.
+ * class.c (is_compiled_class): Fix for renamed flag.
+ * parse.y (maybe_create_class_interface_decl): Likewise.
+ * jcf-parse.c (yyparse): Also set if compiling .class files.
+ * jcf-parse.c (read_class); Read current_class.
+ (jcf_parse): Make static.
+ (load_inner_classes): New function, with code moved from jcf_parse,
+ because we need to inner classes after the command-line files are read.
+ (yyparse): Set finput to NULL when it doesn't need to be closed.
+ Reduce use of main_jcf (basically only for archive) and
+ use finput instead of main_jcf->read_state.
+ Inline jcf_figure_file_type into yyparse.
+ Set JAVA_FILE_P, CLASS_FILE_P, or ZIP_FILE_P on filename list name.
+ Defer load_inner_classes and parse_class_file to a second pass,
+ after we've correctly mapped command-line .clas fiels to classes.
+ (jcf_figure_file_type): Removed.
+ * jcf.h (JCF_ZIP, JCF_CLASS, JCF_SOURCE): Removed flags.
+ (JCF_ZERO): Also clear zipd field.
+ * zipfile.h: Conditionalize on JCF_H insread of JCF_ZIP.
+
+2001-03-18 Matt Kraai <kraai@alumni.carnegiemellon.edu>
+
+ * jcf-parse.c (yyparse): Change ch from char * to char.
+
+2001-03-19 Per Bothner <per@bothner.com>
+
+ * jvspec.c (lang_specific_driver): Check for .zip and .jar files.
+ Add constructed filelist-file at end, following -xjava. Thus any .o
+ and library files are not affected by the -xjava. Also wrap
+ explicit @FILE with -xjava and -xnone.
+
+2001-03-19 Andrew Haley <aph@cambridge.redhat.com>
+
+ * class.c (build_static_field_ref): Call make_decl_rtl() after
+ setting the DECL_EXTERNAL flag.
+
+2001-03-17 Per Bothner <per@bothner.com>
+
+ * decl.c (clear_binding_level): Fix initializer (broke 03-15).
+
+ * jcf-write.c (generate_bytecode_insns): Handle emitting iinc
+ when result is is needed (target is STACK_TARGET).
+
+ * parse.h (JDEP_SOLV): Removed.
+ * parse.y (register_incomplete_type): Use JDEP_TO_RESOLVE instead.
+
+ * parse.y (incomplete_class_list): Removed.
+ (obtain_incomplete_type): Don't use or set incomplete_class_list.
+ It doesn't work if resolve_class changes the name of an array type
+ that is on the list and then someone else looks for the modified name.
+ Also, seems liable to break when compiling multiple source files at
+ once. So the simplest is to just remove incomplete_class_list -
+ it is only a minor space win and it is not even clear it saves time.
+
+ * parse.y (resolve_class): Remove unneeded promote_type.
+
+2001-03-15 Per Bothner <per@bothner.com>
+
+ * java-tree.h (BLOCK_IS_IMPLICIT): New flag.
+ * parse.h (BLOCK_EXPR_ORIGIN): Removed macro.
+ * parse.y (declare_local_variables, maybe_absorb_scoping_blocks):
+ Use BLOCK_IS_IMPLICIT rather than BLOCK_EXPR_ORIGIN.
+
+ * jcf-parse.c (yyparse): Set/reset input_filename for source file.
+ * parse.y (java_expand_classes): Likewise.
+
+ * parse.y (expand_start_java_method): Was only called once and had a
+ misleading name, so inline in caller java_complete_expand_method.
+ (enter_a_block): Likewise inline in enter_block and remove.
+
+ Remove junk from when gcc/java was created (by copying from C/C++).
+ * decl.c (keep_next_level_flag, keep_next_if_subblocks): Remove.
+ (struct binding_level): Remove fields keep, keep_if_subblocks,
+ more_cleanups_ok, have_cleanups (which have never been used).
+ (pushlevel, poplevel): Remove related useless code.
+
+ * class.c (make_class_data): The class_dtable_decl (i.e. the
+ vtable for Class) should be external, except when compiling Class.
+
+ * jvspec.c (lang_specific_driver): Fix -C handling.
+ Check -save-temps to see if temp @FILE should be deleted.
+ Follow-up to/fix for February 16 patch.
+
+ * verify.c (verify_jvm_instructions): Better error msgs for dup.
+ (type_stack_dup): Remove no-longer neded error check.
+
+2001-03-15 Bryce McKinlay <bryce@albatross.co.nz>
+
+ * mangle.c (mangle_record_type): Rename 'from_pointer' argument
+ to 'for_pointer'. If this type is for a pointer (argument) mangling,
+ don't surround the element with 'N..E' if the type name is
+ unqualified.
+
+2001-03-15 Zack Weinberg <zackw@stanford.edu>
+
+ * class.c, decl.c, java-tree.h: Replace all uses of 'boolean' with
+ 'bool'.
+
+2001-03-14 Mark Mitchell <mark@codesourcery.com>
+
+ * class.c (build_static_field_ref): Likewise.
+ (make_method_value): Likewise.
+ (get_dispatch_table): Likewise.
+
+2001-03-14 Mark Mitchell <mark@codesourcery.com>
+
+ * decl.c (push_jvm_slot): Use COPY_DECL_RTL, DECL_RTL_SET_P, etc.
+
+2001-03-07 Tom Tromey <tromey@redhat.com>
+
+ * config-lang.in (lang_requires): Define.
+
+2001-03-05 Per Bothner <per@bothner.com>
+
+ Fix a problem where rest_of_decl_compilation applied to
+ class_dtable_decl causes problems because it was done too early,
+ before output file was opened.
+ * decl.c (init_decl_processing): Remove init of class_dtable_decl.
+ * class.c (class_dtable_decl): Add macro - element of class_roots.
+ (make_class_data): Define class_dtable_decl.
+ * java-tree.h (JTI_CLASS_DTABLE_DECL, class_dtable_decl): Removed.
+
+2001-02-16 Per Bothner <per@bothner.com>
+
+ Handle compiling multiple input files at once, and @FILE syntax.
+ * gcj.texi: Updated documentation to match.
+ * java-tree.h (flag_filelist_file, init_src_parse): New declarations.
+ * jcf-parse.c (parse_source_file): Split into ...
+ (parse_source_file_1): New function - and:
+ (parse_source_file_2): New function.
+ (yyparse): On -ffilelist-file, open and scan named file.
+ On first pass over files, only do parse_source_file_1.
+ A new second pass calls parse_source_file_2 for each file to compile.
+ (init_jcf_parse): Call init_src_parse.
+ * jvspec.c (INDIRECT_FILE_ARG): New flag.
+ (lang_specific_driver): Support @FILELIST-FILE syntax, as well
+ as multiple input file combined in one compilation.
+ * lang-options.h: Add -ffilelist-file
+ * lang.c (flag_filelist_file): New flag variable.
+ (lang_f_options): Handle -ffilelist-file.
+ * lex.c (java_init_lex): Don't clear ctxp->incomplete_class.
+ * parse.h (struct parse_ctxt): Remove fields incomplete_class and
+ gclass_list - use global fields of src_parse_roots instead.
+ * parse.y (src_parse_roots): New array.
+ (incomplete_class_list, gclass_list): New macros.
+ (push_parser_context, java_pop_parser_context,
+ java_parser_context_resume): Don't fiddle with deleted fields.
+ (various): Use incomplete_class gclass_list and global macros
+ instead of parse_ctxt fields - the lists are global.
+ (init_src_parse): New function.
+
+Fri Feb 23 15:28:39 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
+
+ * decl.c (set_block): Set NAMES and BLOCKS from BLOCK.
+
+2001-02-20 Alexandre Petit-Bianco <apbianco@redhat.com>
+
+ * parse.y (check_inner_class_access): Moved declaration of local
+ `enclosing_decl_type' to the right location.
+
+2001-02-19 Bryce McKinlay <bryce@albatross.co.nz>
+
+ * parse.y (parser_check_super_interface): Don't call
+ check_pkg_class_access for an inner interface.
+ (parser_check_super): Don't call check_pkg_class_access for inner
+ class.
+ (do_resolve_class): Simplify enclosing type loop. Don't call
+ check_pkg_class_access if CL and DECL are not set.
+ (find_in_imports_on_demand): Set DECL if class_type needed to be
+ loaded. Don't call check_pkg_class_access for an inner class.
+ (check_inner_class_access): Rewritten to implement member access
+ rules as per spec 6.6.1.
+ (check_pkg_class_access): Handle the empty package correctly.
+ (in_same_package): New function. Determine if two classes are in the
+ same package.
+
+2001-02-18 Bryce McKinlay <bryce@albatross.co.nz>
+
+ * typeck.c (build_java_array_type): Don't try to poke a public `clone'
+ method into array types.
+ * parse.y (patch_method_invocation): Bypass access check on clone call
+ to array instance.
+
+2001-02-15 Alexandre Petit-Bianco <apbianco@redhat.com>
+
+ * expr.c (build_instanceof): Check for arrays when trying fold to
+ false.
+
+2001-02-15 Bryce McKinlay <bryce@albatross.co.nz>
+
+ * Make-lang.in (jvspec.o): Modify rule to match that of cp/g++spec.o.
+
+2001-02-14 Tom Tromey <tromey@redhat.com>
+ Alexandre Petit-Bianco <apbianco@redhat.com>
+
+ Fix for PR java/1261.
+ * typeck.c (build_java_array_type): Add public `clone' method to
+ arrays.
+ * parse.y (resolve_qualified_expression_name): Use current_class
+ when checking for inaccessibility.
+ (patch_method_invocation): Fixed error message when accessibility
+ denied. Added `from_super' argument.
+
+2001-02-14 Alexandre Petit-Bianco <apbianco@redhat.com>
+
+ * parse.y (resolve_class): Don't build a fake decl. Use the one
+ already built.
+ * typeck.c (build_java_array_type): Build and assign decl to array
+ type.
+
+2001-02-14 Alexandre Petit-Bianco <apbianco@redhat.com>
+
+ * parse.y (not_accessible_p): Changed leading comment. Added extra
+ `where' argument. Use it to enforce protected access rules.
+ (resolve_qualified_expression_name): Added extra argument to
+ not_accessible_p.
+ (patch_method_invocation): Use argument `primary' to provide
+ not_accessible_p with an extra argument.
+ (lookup_method_invoke): Added extra argument to not_accessible_p.
+ (search_applicable_method_list): Likewise.
+
+2001-02-13 Alexandre Petit-Bianco <apbianco@redhat.com>
+
+ * parse.y (resolve_qualified_expression_name): Try to resolve as
+ an inner class access only if `decl' is a TYPE_DECL.
+
+2001-02-13 Alexandre Petit-Bianco <apbianco@cygnus.com>
+
+ * decl.c (classdollar_identifier_node): Initialize.
+ * java-tree.h (enum java_tree_index): New entry
+ `JTI_CLASSDOLLAR_IDENTIFIER_NODE.'
+ (classdollar_identifier_node): New macro.
+ (ID_CLASSDOLLAR_P): Likewise.
+ * parse.y (build_dot_class_method): Use `classdollar_identifier_node.'
+ (build_dot_class_method_invocation): Likewise.
+ (find_applicable_accessible_methods_list): `class$' can't be
+ inherited.
+
2001-02-09 Raja R Harinath <harinath@cs.umn.edu>
* Make-lang.in (java/mangle_name.o): Add 'make' prereqs.
@@ -580,7 +1291,7 @@ Sun Feb 4 15:52:44 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* gen-table.pl: new file.
2000-11-20 Tom Tromey <tromey@cygnus.com>
- Alexandre Petit-Bianco <apbianco@cygnus.com>
+ Alexandre Petit-Bianco <apbianco@cygnus.com>
* parse.y (java_complete_lhs): Only allow compound assignment of
reference type if type is String.
diff --git a/gcc/java/Make-lang.in b/gcc/java/Make-lang.in
index 2cecf582f88..485d3a51dcf 100644
--- a/gcc/java/Make-lang.in
+++ b/gcc/java/Make-lang.in
@@ -61,8 +61,10 @@ JAVA_TARGET_INDEPENDENT_BIN_TOOLS = gcjh jv-scan jcf-dump
.PHONY: java
jvspec.o: $(srcdir)/java/jvspec.c system.h $(GCC_H) $(CONFIG_H)
+ (SHLIB_LINK='$(SHLIB_LINK)' \
+ SHLIB_MULTILIB='$(SHLIB_MULTILIB)'; \
$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(DRIVER_DEFINES) \
- $(INCLUDES) $(srcdir)/java/jvspec.c $(OUTPUT_OPTION)
+ $(INCLUDES) $(srcdir)/java/jvspec.c)
# Create the compiler driver for $(GCJ).
$(GCJ)$(exeext): gcc.o jvspec.o version.o \
@@ -78,14 +80,13 @@ $(GCJ)-cross$(exeext): $(GCJ)$(exeext)
$(INTL_TARGETS): $(srcdir)/java/parse.c $(srcdir)/java/parse-scan.c
$(srcdir)/java/parse.c: $(srcdir)/java/parse.y
- (cd $(srcdir)/java && \
- $(BISON) -t --name-prefix=java_ $(BISONFLAGS) -o p$$$$.c parse.y && \
- mv -f p$$$$.c parse.c)
+ $(BISON) -t --name-prefix=java_ $(BISONFLAGS) \
+ -o p$$$$.c $(srcdir)/java/parse.y && \
+ mv -f p$$$$.c $(srcdir)/java/parse.c
$(srcdir)/java/parse-scan.c: $(srcdir)/java/parse-scan.y
- (cd $(srcdir)/java && \
- $(BISON) -t $(BISONFLAGS) -o ps$$$$.c parse-scan.y && \
- mv -f ps$$$$.c parse-scan.c)
+ $(BISON) -t $(BISONFLAGS) -o ps$$$$.c $(srcdir)/java/parse-scan.y && \
+ mv -f ps$$$$.c $(srcdir)/java/parse-scan.c
$(srcdir)/java/keyword.h: $(srcdir)/java/keyword.gperf
(cd $(srcdir)/java || exit 1; \
@@ -120,7 +121,7 @@ java-warn =
jc1$(exeext): $(JAVA_OBJS) $(BACKEND) $(LIBDEPS)
rm -f $@
$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ \
- $(JAVA_OBJS) $(BACKEND) $(ZLIB) $(LIBS)
+ $(JAVA_OBJS) $(BACKEND) $(ZLIB) $(LIBICONV) $(LIBS)
gcjh$(exeext): $(GCJH_OBJS) $(LIBDEPS)
rm -f $@
@@ -128,7 +129,7 @@ gcjh$(exeext): $(GCJH_OBJS) $(LIBDEPS)
jv-scan$(exeext): $(JVSCAN_OBJS) $(LIBDEPS)
rm -f $@
- $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(JVSCAN_OBJS) $(LIBS)
+ $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(JVSCAN_OBJS) $(LIBICONV) $(LIBS)
jcf-dump$(exeext): $(JCFDUMP_OBJS) $(LIBDEPS)
rm -f $@
@@ -252,7 +253,7 @@ java/decl.o: java/decl.c $(CONFIG_H) $(JAVA_TREE_H) java/jcf.h \
toplev.h system.h function.h gcc.h
java/except.o: java/except.c $(CONFIG_H) $(JAVA_TREE_H) java/jcf.h real.h \
$(RTL_H) java/javaop.h java/java-opcodes.h except.h java/java-except.h \
- eh-common.h toplev.h system.h function.h
+ toplev.h system.h function.h
java/expr.o: java/expr.c $(CONFIG_H) $(JAVA_TREE_H) java/jcf.h real.h \
$(RTL_H) $(EXPR_H) java/javaop.h java/java-opcodes.h except.h \
java/java-except.h java/java-except.h java/parse.h toplev.h \
@@ -293,13 +294,14 @@ java/jcf-path.o: java/jcf-path.c $(CONFIG_H) system.h java/jcf.h
$(srcdir)/java/jcf-path.c $(OUTPUT_OPTION)
# Documentation
-$(srcdir)/java/gcj.info: $(srcdir)/java/gcj.texi
+$(srcdir)/java/gcj.info: $(srcdir)/java/gcj.texi \
+ $(srcdir)/doc/include/fdl.texi $(srcdir)/doc/include/gpl.texi
if test "x$(BUILD_INFO)" = xinfo; then \
rm -f $(srcdir)/java/gcc.info*; \
- cd $(srcdir)/java && $(MAKEINFO) -o gcj.info gcj.texi; \
+ cd $(srcdir)/java && $(MAKEINFO) -I../doc/include -o gcj.info gcj.texi; \
else true; fi
-java/gcj.dvi: $(srcdir)/java/gcj.texi
- TEXINPUTS=${texidir}:$(srcdir)/java:$$TEXINPUTS tex gcj.texi
- texindex gcj.??
- TEXINPUTS=${texidir}:$(srcdir)/java:$$TEXINPUTS tex gcj.texi
+java/gcj.dvi: $(srcdir)/java/gcj.texi $(srcdir)/doc/include/fdl.texi \
+ $(srcdir)/doc/include/gpl.texi
+ s=`cd $(srcdir); pwd`; export s; \
+ cd java && $(TEXI2DVI) -I $$s/doc/include $$s/java/gcj.texi
diff --git a/gcc/java/boehm.c b/gcc/java/boehm.c
index 650d51645bf..c76cad3475f 100644
--- a/gcc/java/boehm.c
+++ b/gcc/java/boehm.c
@@ -48,7 +48,7 @@ static void set_bit PARAMS ((unsigned HOST_WIDE_INT *,
(((((env) << LOG_MAX_MARK_PROCS) | (proc_index)) << DS_TAG_BITS) \
| DS_PROC)
Here DS_PROC == 2. */
-#define PROCEDURE_OBJECT_DESCRIPTOR integer_two_node
+#define PROCEDURE_OBJECT_DESCRIPTOR build_int_2 (2, 0)
/* Treat two HOST_WIDE_INT's as a contiguous bitmap, with bit 0 being
the least significant. This function sets bit N in the bitmap. */
@@ -228,5 +228,6 @@ get_boehm_type_descriptor (tree type)
else
value = PROCEDURE_OBJECT_DESCRIPTOR;
+ TREE_TYPE (value) = type_for_mode (ptr_mode, 1);
return value;
}
diff --git a/gcc/java/check-init.c b/gcc/java/check-init.c
index 49df07291d5..19764439e0e 100644
--- a/gcc/java/check-init.c
+++ b/gcc/java/check-init.c
@@ -681,6 +681,7 @@ check_init (exp, before)
case INTEGER_CST:
case REAL_CST:
case STRING_CST:
+ case JAVA_EXC_OBJ_EXPR:
break;
case NEW_CLASS_EXPR:
@@ -694,8 +695,7 @@ check_init (exp, before)
for ( ; x != NULL_TREE; x = TREE_CHAIN (x))
check_init (TREE_VALUE (x), before);
- if (func == throw_node[0]
- || func == throw_node[1])
+ if (func == throw_node)
goto never_continues;
}
break;
diff --git a/gcc/java/class.c b/gcc/java/class.c
index 615c0754e60..55332a68b93 100644
--- a/gcc/java/class.c
+++ b/gcc/java/class.c
@@ -84,11 +84,13 @@ static assume_compiled_node *find_assume_compiled_node
static assume_compiled_node *assume_compiled_tree;
-static tree class_roots[4] = { NULL_TREE, NULL_TREE, NULL_TREE, NULL_TREE };
+static tree class_roots[5]
+= { NULL_TREE, NULL_TREE, NULL_TREE, NULL_TREE, NULL_TREE };
#define registered_class class_roots[0]
#define fields_ident class_roots[1] /* get_identifier ("fields") */
#define info_ident class_roots[2] /* get_identifier ("info") */
#define class_list class_roots[3]
+#define class_dtable_decl class_roots[4]
/* Return the node that most closely represents the class whose name
is IDENT. Start the search from NODE. Return NULL if an
@@ -518,6 +520,7 @@ add_interface_do (basetype_vec, interface_class, i)
tree interface_binfo = make_tree_vec (6);
BINFO_TYPE (interface_binfo) = interface_class;
BINFO_OFFSET (interface_binfo) = integer_zero_node;
+ BINFO_VPTR_FIELD (interface_binfo) = integer_zero_node;
TREE_VIA_VIRTUAL (interface_binfo) = 1;
TREE_VIA_PUBLIC (interface_binfo) = 1;
TREE_VEC_ELT (basetype_vec, i) = interface_binfo;
@@ -627,7 +630,7 @@ java_hash_hash_tree_node (k)
return (long) k;
}
-boolean
+bool
java_hash_compare_tree_node (k1, k2)
hash_table_key k1;
hash_table_key k2;
@@ -805,7 +808,6 @@ build_utf8_ref (name)
const char * name_ptr = IDENTIFIER_POINTER(name);
int name_len = IDENTIFIER_LENGTH(name);
char buf[60];
- char *buf_ptr;
tree ctype, field = NULL_TREE, str_type, cinit, string;
static int utf8_count = 0;
int name_hash;
@@ -831,23 +833,8 @@ build_utf8_ref (name)
FINISH_RECORD_CONSTRUCTOR (cinit);
TREE_CONSTANT (cinit) = 1;
- /* Build a unique identifier based on buf. */
+ /* Generate a unique-enough identifier. */
sprintf(buf, "_Utf%d", ++utf8_count);
- buf_ptr = &buf[strlen (buf)];
- if (name_len > 0 && name_ptr[0] >= '0' && name_ptr[0] <= '9')
- *buf_ptr++ = '_';
- while (--name_len >= 0)
- {
- unsigned char c = *name_ptr++;
- if (c & 0x80)
- continue;
- if (!ISALPHA(c) && !ISDIGIT(c))
- c = '_';
- *buf_ptr++ = c;
- if (buf_ptr >= buf + 50)
- break;
- }
- *buf_ptr = '\0';
decl = build_decl (VAR_DECL, get_identifier (buf), utf8const_type);
/* FIXME get some way to force this into .text, not .data. */
@@ -897,8 +884,9 @@ build_class_ref (type)
TREE_PUBLIC (decl) = 1;
DECL_IGNORED_P (decl) = 1;
DECL_ARTIFICIAL (decl) = 1;
- DECL_ASSEMBLER_NAME (decl) =
- java_mangle_class_field (&temporary_obstack, type);
+ SET_DECL_ASSEMBLER_NAME (decl,
+ java_mangle_class_field
+ (&temporary_obstack, type));
make_decl_rtl (decl, NULL);
pushdecl_top_level (decl);
if (is_compiled == 1)
@@ -981,11 +969,11 @@ build_static_field_ref (fdecl)
int is_compiled = is_compiled_class (fclass);
if (is_compiled)
{
- if (DECL_RTL (fdecl) == 0)
+ if (!DECL_RTL_SET_P (fdecl))
{
- make_decl_rtl (fdecl, NULL);
if (is_compiled == 1)
DECL_EXTERNAL (fdecl) = 1;
+ make_decl_rtl (fdecl, NULL);
}
return fdecl;
}
@@ -1144,7 +1132,7 @@ make_method_value (mdecl)
#define ACC_TRANSLATED 0x4000
int accflags = get_access_flags_from_decl (mdecl) | ACC_TRANSLATED;
code = null_pointer_node;
- if (DECL_RTL (mdecl))
+ if (DECL_RTL_SET_P (mdecl))
code = build1 (ADDR_EXPR, nativecode_ptr_type_node, mdecl);
START_RECORD_CONSTRUCTOR (minit, method_type_node);
PUSH_FIELD_VALUE (minit, "name",
@@ -1203,9 +1191,11 @@ get_dispatch_table (type, this_class_addr)
{
int abstract_p = CLASS_ABSTRACT (TYPE_NAME (type));
tree vtable = get_dispatch_vector (type);
- int i;
+ int i, j;
tree list = NULL_TREE;
int nvirtuals = TREE_VEC_LENGTH (vtable);
+ int arraysize;
+
for (i = nvirtuals; --i >= 0; )
{
tree method = TREE_VEC_ELT (vtable, i);
@@ -1214,27 +1204,52 @@ get_dispatch_table (type, this_class_addr)
if (! abstract_p)
warning_with_decl (method,
"abstract method in non-abstract class");
- method = null_pointer_node;
+
+ if (TARGET_VTABLE_USES_DESCRIPTORS)
+ for (j = 0; j < TARGET_VTABLE_USES_DESCRIPTORS; ++j)
+ list = tree_cons (NULL_TREE, null_pointer_node, list);
+ else
+ list = tree_cons (NULL_TREE, null_pointer_node, list);
}
else
{
- if (DECL_RTL (method) == 0)
+ if (!DECL_RTL_SET_P (method))
make_decl_rtl (method, NULL);
- method = build1 (ADDR_EXPR, nativecode_ptr_type_node, method);
+
+ if (TARGET_VTABLE_USES_DESCRIPTORS)
+ for (j = 0; j < TARGET_VTABLE_USES_DESCRIPTORS; ++j)
+ {
+ tree fdesc = build (FDESC_EXPR, nativecode_ptr_type_node,
+ method, build_int_2 (j, 0));
+ TREE_CONSTANT (fdesc) = 1;
+ list = tree_cons (NULL_TREE, fdesc, list);
+ }
+ else
+ list = tree_cons (NULL_TREE,
+ build1 (ADDR_EXPR, nativecode_ptr_type_node,
+ method),
+ list);
}
- list = tree_cons (NULL_TREE /*DECL_VINDEX (method) + 2*/,
- method, list);
}
+
/* Dummy entry for compatibility with G++ -fvtable-thunks. When
using the Boehm GC we sometimes stash a GC type descriptor
there. We set the PURPOSE to NULL_TREE not to interfere (reset)
the emitted byte count during the output to the assembly file. */
- list = tree_cons (NULL_TREE, get_boehm_type_descriptor (type),
- list);
+ for (j = 1; j < TARGET_VTABLE_USES_DESCRIPTORS; ++j)
+ list = tree_cons (NULL_TREE, null_pointer_node, list);
+ list = tree_cons (NULL_TREE, get_boehm_type_descriptor (type), list);
+
+ for (j = 1; j < TARGET_VTABLE_USES_DESCRIPTORS; ++j)
+ list = tree_cons (NULL_TREE, null_pointer_node, list);
list = tree_cons (integer_zero_node, this_class_addr, list);
- return build (CONSTRUCTOR, build_prim_array_type (nativecode_ptr_type_node,
- nvirtuals + 2),
- NULL_TREE, list);
+
+ arraysize = nvirtuals + 2;
+ if (TARGET_VTABLE_USES_DESCRIPTORS)
+ arraysize *= TARGET_VTABLE_USES_DESCRIPTORS;
+ return build (CONSTRUCTOR,
+ build_prim_array_type (nativecode_ptr_type_node, arraysize),
+ NULL_TREE, list);
}
void
@@ -1347,6 +1362,19 @@ make_class_data (type)
DECL_IGNORED_P (dtable_decl) = 1;
TREE_PUBLIC (dtable_decl) = 1;
rest_of_decl_compilation (dtable_decl, (char*) 0, 1, 0);
+ if (type == class_type_node)
+ class_dtable_decl = dtable_decl;
+ }
+
+ if (class_dtable_decl == NULL_TREE)
+ {
+ class_dtable_decl = build_dtable_decl (class_type_node);
+ TREE_STATIC (class_dtable_decl) = 1;
+ DECL_ARTIFICIAL (class_dtable_decl) = 1;
+ DECL_IGNORED_P (class_dtable_decl) = 1;
+ if (is_compiled_class (class_type_node) != 2)
+ DECL_EXTERNAL (class_dtable_decl) = 1;
+ rest_of_decl_compilation (class_dtable_decl, (char*) 0, 1, 0);
}
super = CLASSTYPE_SUPER (type);
@@ -1512,7 +1540,7 @@ is_compiled_class (class)
return 2;
seen_in_zip = (TYPE_JCF (class) && JCF_SEEN_IN_ZIP (TYPE_JCF (class)));
- if (CLASS_FROM_CURRENTLY_COMPILED_SOURCE_P (class) || seen_in_zip)
+ if (CLASS_FROM_CURRENTLY_COMPILED_P (class) || seen_in_zip)
{
/* The class was seen in the current ZIP file and will be
available as a compiled class in the future but may not have
@@ -1557,13 +1585,37 @@ build_dtable_decl (type)
TYPE. */
if (current_class == type)
{
- tree dummy = NULL_TREE, aomt, n;
+ tree dummy = NULL_TREE;
+ int n;
dtype = make_node (RECORD_TYPE);
+
PUSH_FIELD (dtype, dummy, "class", class_ptr_type);
- n = build_int_2 (TREE_VEC_LENGTH (get_dispatch_vector (type)), 0);
- aomt = build_array_type (ptr_type_node, build_index_type (n));
- PUSH_FIELD (dtype, dummy, "methods", aomt);
+ for (n = 1; n < TARGET_VTABLE_USES_DESCRIPTORS; ++n)
+ {
+ tree tmp_field = build_decl (FIELD_DECL, NULL_TREE, ptr_type_node);
+ TREE_CHAIN (dummy) = tmp_field;
+ DECL_CONTEXT (tmp_field) = dtype;
+ DECL_ARTIFICIAL (tmp_field) = 1;
+ dummy = tmp_field;
+ }
+
+ PUSH_FIELD (dtype, dummy, "gc_descr", ptr_type_node);
+ for (n = 1; n < TARGET_VTABLE_USES_DESCRIPTORS; ++n)
+ {
+ tree tmp_field = build_decl (FIELD_DECL, NULL_TREE, ptr_type_node);
+ TREE_CHAIN (dummy) = tmp_field;
+ DECL_CONTEXT (tmp_field) = dtype;
+ DECL_ARTIFICIAL (tmp_field) = 1;
+ dummy = tmp_field;
+ }
+
+ n = TREE_VEC_LENGTH (get_dispatch_vector (type));
+ if (TARGET_VTABLE_USES_DESCRIPTORS)
+ n *= TARGET_VTABLE_USES_DESCRIPTORS;
+
+ PUSH_FIELD (dtype, dummy, "methods",
+ build_prim_array_type (nativecode_ptr_type_node, n));
layout_type (dtype);
}
else
@@ -1677,7 +1729,7 @@ layout_class (this_class)
return;
}
if (TYPE_SIZE (this_class) == NULL_TREE)
- push_super_field (this_class, super_class);
+ push_super_field (this_class, maybe_super_class);
}
for (field = TYPE_FIELDS (this_class);
@@ -1686,8 +1738,9 @@ layout_class (this_class)
if (FIELD_STATIC (field))
{
/* Set DECL_ASSEMBLER_NAME to something suitably mangled. */
- DECL_ASSEMBLER_NAME (field) =
- java_mangle_decl (&temporary_obstack, field);
+ SET_DECL_ASSEMBLER_NAME (field,
+ java_mangle_decl
+ (&temporary_obstack, field));
}
}
@@ -1782,8 +1835,9 @@ layout_class_method (this_class, super_class, method_decl, dtable_count)
TREE_PUBLIC (method_decl) = 1;
/* This is a good occasion to mangle the method's name */
- DECL_ASSEMBLER_NAME (method_decl) =
- java_mangle_decl (&temporary_obstack, method_decl);
+ SET_DECL_ASSEMBLER_NAME (method_decl,
+ java_mangle_decl (&temporary_obstack,
+ method_decl));
/* We don't generate a RTL for the method if it's abstract, or if
it's an interface method that isn't clinit. */
if (! METHOD_ABSTRACT (method_decl)
@@ -1863,7 +1917,7 @@ emit_register_classes ()
tree t;
init_decl = build_decl (FUNCTION_DECL, init_name, init_type);
- DECL_ASSEMBLER_NAME (init_decl) = init_name;
+ SET_DECL_ASSEMBLER_NAME (init_decl, init_name);
TREE_STATIC (init_decl) = 1;
current_function_decl = init_decl;
DECL_RESULT (init_decl) = build_decl(RESULT_DECL, NULL_TREE, void_type_node);
diff --git a/gcc/java/config-lang.in b/gcc/java/config-lang.in
index 3a1d19585d3..19b7dee1ab1 100644
--- a/gcc/java/config-lang.in
+++ b/gcc/java/config-lang.in
@@ -1,6 +1,6 @@
# Top level configure fragment for the GNU compiler for the Java(TM)
# language.
-# Copyright (C) 1994, 1995, 2000 Free Software Foundation, Inc.
+# Copyright (C) 1994, 1995, 2000, 2001 Free Software Foundation, Inc.
#This file is part of GNU CC.
@@ -37,6 +37,7 @@ compilers="jc1\$(exeext) jvgenmain\$(exeext)"
stagestuff="jc1\$(exeext) gcj\$(exeext) jvgenmain\$(exeext) gcjh\$(exeext) jv-scan\$(exeext) jcf-dump\$(exeext)"
-target_libs=${libgcj}
-lang_dirs=fastjar
-build_by_default=no
+target_libs=${libgcj_saved}
+lang_dirs="zlib fastjar"
+#build_by_default=no
+lang_requires=c++
diff --git a/gcc/java/constants.c b/gcc/java/constants.c
index 0dcd715b2d9..592de137050 100644
--- a/gcc/java/constants.c
+++ b/gcc/java/constants.c
@@ -197,7 +197,15 @@ find_methodref_index (cpool, decl)
CPool *cpool;
tree decl;
{
- tree mclass = DECL_CONTEXT (decl);
+ return find_methodref_with_class_index (cpool, decl, DECL_CONTEXT (decl));
+}
+
+int
+find_methodref_with_class_index (cpool, decl, mclass)
+ CPool *cpool;
+ tree decl;
+ tree mclass;
+{
int class_index = find_class_constant (cpool, mclass);
tree name = DECL_CONSTRUCTOR_P (decl) ? init_identifier_node
: DECL_NAME (decl);
diff --git a/gcc/java/decl.c b/gcc/java/decl.c
index f59605906a3..8a862d09f8a 100644
--- a/gcc/java/decl.c
+++ b/gcc/java/decl.c
@@ -29,12 +29,14 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */
#include "config.h"
#include "system.h"
#include "tree.h"
+#include "rtl.h"
#include "toplev.h"
#include "flags.h"
#include "java-tree.h"
#include "jcf.h"
#include "toplev.h"
#include "function.h"
+#include "expr.h"
#include "except.h"
#include "java-except.h"
#include "ggc.h"
@@ -47,7 +49,7 @@ static tree push_jvm_slot PARAMS ((int, tree));
static tree lookup_name_current_level PARAMS ((tree));
static tree push_promoted_type PARAMS ((const char *, tree));
static struct binding_level *make_binding_level PARAMS ((void));
-static boolean emit_init_test_initialization PARAMS ((struct hash_entry *,
+static bool emit_init_test_initialization PARAMS ((struct hash_entry *,
hash_table_key));
static tree create_primitive_vtable PARAMS ((const char *));
static tree check_local_named_variable PARAMS ((tree, tree, int, int *));
@@ -72,8 +74,6 @@ tree decl_map;
static tree pending_local_decls = NULL_TREE;
-tree throw_node [2];
-
/* Push a local variable or stack slot into the decl_map,
and assign it an rtl. */
@@ -116,7 +116,7 @@ push_jvm_slot (index, decl)
tmp = DECL_LOCAL_SLOT_CHAIN (tmp);
}
if (rtl != NULL)
- DECL_RTL (decl) = rtl;
+ SET_DECL_RTL (decl, rtl);
else
{
if (index >= DECL_MAX_LOCALS (current_function_decl))
@@ -276,18 +276,6 @@ struct binding_level
/* The binding level which this one is contained in (inherits from). */
struct binding_level *level_chain;
- /* 1 means make a BLOCK for this level regardless of all else.
- 2 for temporary binding contours created by the compiler. */
- char keep;
-
- /* Nonzero means make a BLOCK if this level has any subblocks. */
- char keep_if_subblocks;
-
- /* Nonzero if this level can safely have additional
- cleanup-needing variables added to it. */
- char more_cleanups_ok;
- char have_cleanups;
-
/* The bytecode PC that marks the end of this level. */
int end_pc;
/* The bytecode PC that marks the start of this level. */
@@ -323,7 +311,7 @@ static struct binding_level *global_binding_level;
static struct binding_level clear_binding_level
= {NULL_TREE, NULL_TREE, NULL_TREE, NULL_TREE,
- NULL_BINDING_LEVEL, 0, 0, 0, 0, LARGEST_PC, 0};
+ NULL_BINDING_LEVEL, LARGEST_PC, 0};
#if 0
/* A list (chain of TREE_LIST nodes) of all LABEL_DECLs in the function
@@ -339,15 +327,6 @@ static tree shadowed_labels;
int flag_traditional;
-/* Nonzero means unconditionally make a BLOCK for the next level pushed. */
-
-static int keep_next_level_flag;
-
-/* Nonzero means make a BLOCK for the next level pushed
- if it has subblocks. */
-
-static int keep_next_if_subblocks;
-
tree java_global_trees[JTI_MAX];
tree predef_filenames[PREDEF_FILENAMES_SIZE];
@@ -398,7 +377,7 @@ builtin_function (name, type, function_code, class, library_name)
DECL_EXTERNAL (decl) = 1;
TREE_PUBLIC (decl) = 1;
if (library_name)
- DECL_ASSEMBLER_NAME (decl) = get_identifier (library_name);
+ SET_DECL_ASSEMBLER_NAME (decl, get_identifier (library_name));
make_decl_rtl (decl, NULL_PTR);
pushdecl (decl);
DECL_BUILT_IN_CLASS (decl) = class;
@@ -602,6 +581,7 @@ init_decl_processing ()
super_identifier_node = get_identifier ("super");
continue_identifier_node = get_identifier ("continue");
access0_identifier_node = get_identifier ("access$0");
+ classdollar_identifier_node = get_identifier ("class$");
/* for lack of a better place to put this stub call */
init_expr_processing();
@@ -635,12 +615,6 @@ init_decl_processing ()
FIELD_PRIVATE (t) = 1;
FINISH_RECORD (object_type_node);
- class_dtable_decl = build_dtable_decl (class_type_node);
- TREE_STATIC (class_dtable_decl) = 1;
- DECL_ARTIFICIAL (class_dtable_decl) = 1;
- DECL_IGNORED_P (class_dtable_decl) = 1;
- rest_of_decl_compilation (class_dtable_decl, (char*) 0, 1, 0);
-
field_type_node = make_node (RECORD_TYPE);
field_ptr_type_node = build_pointer_type (field_type_node);
method_type_node = make_node (RECORD_TYPE);
@@ -693,7 +667,6 @@ init_decl_processing ()
PUSH_FIELD (field_type_node, field, "bsize", unsigned_short_type_node);
PUSH_FIELD (field_type_node, field, "info", field_info_union_node);
FINISH_RECORD (field_type_node);
- CLASS_LOADED_P (field_type_node) = 1;
build_decl (TYPE_DECL, get_identifier ("Field"), field_type_node);
one_elt_array_domain_type = build_index_type (integer_one_node);
@@ -735,7 +708,6 @@ init_decl_processing ()
PUSH_FIELD (method_type_node, field, "accflags", access_flags_type_node);
PUSH_FIELD (method_type_node, field, "ncode", nativecode_ptr_type_node);
FINISH_RECORD (method_type_node);
- CLASS_LOADED_P (method_type_node) = 1;
build_decl (TYPE_DECL, get_identifier ("Method"), method_type_node);
endlink = end_params_node = tree_cons (NULL_TREE, void_type_node, NULL_TREE);
@@ -753,18 +725,14 @@ init_decl_processing ()
t),
0, NOT_BUILT_IN,
NULL_PTR);
- throw_node[0] = builtin_function ("_Jv_Throw",
- build_function_type (ptr_type_node, t),
- 0, NOT_BUILT_IN, NULL_PTR);
+
+ throw_node = builtin_function ("_Jv_Throw",
+ build_function_type (ptr_type_node, t),
+ 0, NOT_BUILT_IN, NULL_PTR);
/* Mark throw_nodes as `noreturn' functions with side effects. */
- TREE_THIS_VOLATILE (throw_node[0]) = 1;
- TREE_SIDE_EFFECTS (throw_node[0]) = 1;
- t = tree_cons (NULL_TREE, ptr_type_node, endlink);
- throw_node[1] = builtin_function ("_Jv_Sjlj_Throw",
- build_function_type (ptr_type_node, t),
- 0, NOT_BUILT_IN, NULL_PTR);
- TREE_THIS_VOLATILE (throw_node[1]) = 1;
- TREE_SIDE_EFFECTS (throw_node[1]) = 1;
+ TREE_THIS_VOLATILE (throw_node) = 1;
+ TREE_SIDE_EFFECTS (throw_node) = 1;
+
t = build_function_type (int_type_node, endlink);
soft_monitorenter_node
= builtin_function ("_Jv_MonitorEnter", t, 0, NOT_BUILT_IN,
@@ -867,15 +835,6 @@ init_decl_processing ()
build_function_type (double_type_node, t),
BUILT_IN_FMOD, BUILT_IN_NORMAL, "fmod");
- soft_exceptioninfo_call_node
- = build (CALL_EXPR,
- ptr_type_node,
- build_address_of
- (builtin_function ("_Jv_exception_info",
- build_function_type (ptr_type_node, endlink),
- 0, NOT_BUILT_IN, NULL_PTR)),
- NULL_TREE, NULL_TREE);
- TREE_SIDE_EFFECTS (soft_exceptioninfo_call_node) = 1;
#if 0
t = tree_cons (NULL_TREE, float_type_node,
tree_cons (NULL_TREE, float_type_node, endlink));
@@ -905,13 +864,17 @@ init_decl_processing ()
build_function_type (long_type_node, t),
0, NOT_BUILT_IN, NULL_PTR);
+ /* Initialize variables for except.c. */
+ eh_personality_libfunc = init_one_libfunc (USING_SJLJ_EXCEPTIONS
+ ? "__gcj_personality_sj0"
+ : "__gcj_personality_v0");
+ lang_eh_runtime_type = prepare_eh_table_type;
+
init_jcf_parse ();
/* Register nodes with the garbage collector. */
ggc_add_tree_root (java_global_trees,
sizeof (java_global_trees) / sizeof (tree));
- ggc_add_tree_root (throw_node,
- sizeof (throw_node) / sizeof (tree));
ggc_add_tree_root (predef_filenames,
sizeof (predef_filenames) / sizeof (tree));
ggc_add_tree_root (&decl_map, 1);
@@ -1204,10 +1167,6 @@ pushlevel (unused)
*newlevel = clear_binding_level;
newlevel->level_chain = current_binding_level;
current_binding_level = newlevel;
- newlevel->keep = keep_next_level_flag;
- keep_next_level_flag = 0;
- newlevel->keep_if_subblocks = keep_next_if_subblocks;
- keep_next_if_subblocks = 0;
#if defined(DEBUG_JAVA_BINDING_LEVELS)
newlevel->binding_depth = binding_depth;
indent ();
@@ -1268,8 +1227,6 @@ poplevel (keep, reverse, functionbody)
#endif
#endif /* defined(DEBUG_JAVA_BINDING_LEVELS) */
- keep |= current_binding_level->keep;
-
/* Get the decls in the order they were written.
Usually current_binding_level->names is in reverse order.
But parameter decls were previously put in forward order. */
@@ -1314,8 +1271,7 @@ poplevel (keep, reverse, functionbody)
block_previously_created = (current_binding_level->this_block != 0);
if (block_previously_created)
block = current_binding_level->this_block;
- else if (keep || functionbody
- || (current_binding_level->keep_if_subblocks && subblocks != 0))
+ else if (keep || functionbody)
block = make_node (BLOCK);
if (block != 0)
{
@@ -1544,6 +1500,10 @@ set_block (block)
register tree block;
{
current_binding_level->this_block = block;
+ current_binding_level->names = chainon (current_binding_level->names,
+ BLOCK_VARS (block));
+ current_binding_level->blocks = chainon (current_binding_level->blocks,
+ BLOCK_SUBBLOCKS (block));
}
/* integrate_decl_tree calls this function. */
@@ -1598,7 +1558,7 @@ give_name_to_locals (jcf)
{
tree decl = TREE_VEC_ELT (decl_map, slot);
DECL_NAME (decl) = name;
- DECL_ASSEMBLER_NAME (decl) = name;
+ SET_DECL_ASSEMBLER_NAME (decl, name);
if (TREE_CODE (decl) != PARM_DECL || TREE_TYPE (decl) != type)
warning ("bad type in parameter debug info");
}
@@ -1665,7 +1625,7 @@ give_name_to_locals (jcf)
sprintf (buffer, "ARG_%d", arg_i);
DECL_NAME (parm) = get_identifier (buffer);
}
- DECL_ASSEMBLER_NAME (parm) = DECL_NAME (parm);
+ SET_DECL_ASSEMBLER_NAME (parm, DECL_NAME (parm));
}
}
}
@@ -1685,7 +1645,7 @@ build_result_decl (fndecl)
/* Called for every element in DECL_FUNCTION_INIT_TEST_TABLE in order
to emit initialization code for each test flag. */
-static boolean
+static bool
emit_init_test_initialization (entry, key)
struct hash_entry *entry;
hash_table_key key ATTRIBUTE_UNUSED;
@@ -1856,7 +1816,6 @@ void
end_java_method ()
{
tree fndecl = current_function_decl;
- int flag_asynchronous_exceptions = asynchronous_exceptions;
expand_end_bindings (getdecls (), 1, 0);
/* pop out of function */
@@ -1867,23 +1826,13 @@ end_java_method ()
BLOCK_SUPERCONTEXT (DECL_INITIAL (fndecl)) = fndecl;
- emit_handlers ();
-
/* Generate rtl for function exit. */
expand_function_end (input_filename, lineno, 0);
- /* FIXME: If the current method contains any exception handlers,
- force asynchronous_exceptions: this is necessary because signal
- handlers in libjava may throw exceptions. This is far from being
- a perfect solution, but it's better than doing nothing at all.*/
- if (catch_clauses)
- asynchronous_exceptions = 1;
-
/* Run the optimizers and output assembler code for this function. */
rest_of_compilation (fndecl);
current_function_decl = NULL_TREE;
- asynchronous_exceptions = flag_asynchronous_exceptions;
}
/* Mark language-specific parts of T for garbage-collection. */
diff --git a/gcc/java/except.c b/gcc/java/except.c
index f14d9437871..184f7e5a88b 100644
--- a/gcc/java/except.c
+++ b/gcc/java/except.c
@@ -34,7 +34,6 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */
#include "function.h"
#include "except.h"
#include "java-except.h"
-#include "eh-common.h"
#include "toplev.h"
static void expand_start_java_handler PARAMS ((struct eh_range *));
@@ -250,14 +249,6 @@ method_init_exceptions ()
whole_range.first_child = NULL;
whole_range.next_sibling = NULL;
cache_range_start = 0xFFFFFF;
- java_set_exception_lang_code ();
-}
-
-void
-java_set_exception_lang_code ()
-{
- set_exception_lang_code (EH_LANG_Java);
- set_exception_version_code (1);
}
/* Add an exception range. If we already have an exception range
@@ -339,7 +330,7 @@ prepare_eh_table_type (type)
* (which yields a value with low-order bit 1). */
if (type == NULL_TREE)
- exp = CATCH_ALL_TYPE;
+ exp = NULL_TREE;
else if (is_compiled_class (type))
exp = build_class_ref (type);
else
@@ -350,7 +341,27 @@ prepare_eh_table_type (type)
return exp;
}
-/* if there are any handlers for this range, isssue end of range,
+
+/* Build a reference to the jthrowable object being carried in the
+ exception header. */
+
+tree
+build_exception_object_ref (type)
+ tree type;
+{
+ tree obj;
+
+ /* Java only passes object via pointer and doesn't require adjusting.
+ The java object is immediately before the generic exception header. */
+ obj = build (EXC_PTR_EXPR, build_pointer_type (type));
+ obj = build (MINUS_EXPR, TREE_TYPE (obj), obj,
+ TYPE_SIZE_UNIT (TREE_TYPE (obj)));
+ obj = build1 (INDIRECT_REF, type, obj);
+
+ return obj;
+}
+
+/* If there are any handlers for this range, isssue end of range,
and then all handler blocks */
static void
expand_end_java_handler (range)
@@ -361,11 +372,9 @@ expand_end_java_handler (range)
expand_start_all_catch ();
for ( ; handler != NULL_TREE; handler = TREE_CHAIN (handler))
{
- start_catch_handler (prepare_eh_table_type (TREE_PURPOSE (handler)));
- /* Push the thrown object on the top of the stack */
+ expand_start_catch (TREE_PURPOSE (handler));
expand_goto (TREE_VALUE (handler));
- expand_resume_after_catch ();
- end_catch_handler ();
+ expand_end_catch ();
}
expand_end_all_catch ();
#if defined(DEBUG_JAVA_BINDING_LEVELS)
@@ -432,30 +441,3 @@ maybe_end_try (start_pc, end_pc)
current_range = current_range->outer;
}
}
-
-/* Emit the handler labels and their code */
-
-void
-emit_handlers ()
-{
- if (catch_clauses)
- {
- rtx funcend = gen_label_rtx ();
- emit_jump (funcend);
-
- emit_insns (catch_clauses);
- catch_clauses = catch_clauses_last = NULL_RTX;
- expand_leftover_cleanups ();
-
- emit_label (funcend);
- }
-}
-
-/* Resume executing at the statement immediately after the end of an
- exception region. */
-
-void
-expand_resume_after_catch ()
-{
- expand_goto (top_label_entry (&caught_return_label_stack));
-}
diff --git a/gcc/java/expr.c b/gcc/java/expr.c
index 70a2fe91276..76407f06abe 100644
--- a/gcc/java/expr.c
+++ b/gcc/java/expr.c
@@ -600,7 +600,7 @@ build_java_athrow (node)
call = build (CALL_EXPR,
void_type_node,
- build_address_of (throw_node[exceptions_via_longjmp ? 1 : 0]),
+ build_address_of (throw_node),
build_tree_list (NULL_TREE, node),
NULL_TREE);
TREE_SIDE_EFFECTS (call) = 1;
@@ -1157,7 +1157,9 @@ build_instanceof (value, type)
value,
boolean_true_node, boolean_false_node);
}
- else if (DECL_P (klass) && DECL_P (valclass)
+ else if (! TYPE_ARRAY_P (type)
+ && ! TYPE_ARRAY_P (valtype)
+ && DECL_P (klass) && DECL_P (valclass)
&& ! CLASS_INTERFACE (valclass)
&& ! CLASS_INTERFACE (klass)
&& ! inherits_from_p (type, valtype)
@@ -1656,7 +1658,7 @@ tree
build_class_init (clas, expr)
tree clas, expr;
{
- tree init, call;
+ tree init;
struct init_test_hash_entry *ite;
if (inherits_from_p (current_class, clas))
return expr;
@@ -1687,14 +1689,14 @@ build_class_init (clas, expr)
build_tree_list (NULL_TREE, build_class_ref (clas)),
NULL_TREE);
TREE_SIDE_EFFECTS (init) = 1;
- call = build (COMPOUND_EXPR, TREE_TYPE (expr), init,
- build (MODIFY_EXPR, boolean_type_node,
- ite->init_test_decl, boolean_true_node));
- TREE_SIDE_EFFECTS (call) = 1;
init = build (COND_EXPR, void_type_node,
build (EQ_EXPR, boolean_type_node,
ite->init_test_decl, boolean_false_node),
- call, integer_zero_node);
+ init, integer_zero_node);
+ TREE_SIDE_EFFECTS (init) = 1;
+ init = build (COMPOUND_EXPR, TREE_TYPE (expr), init,
+ build (MODIFY_EXPR, boolean_type_node,
+ ite->init_test_decl, boolean_true_node));
TREE_SIDE_EFFECTS (init) = 1;
}
@@ -1799,9 +1801,18 @@ build_invokevirtual (dtable, method)
method_index = size_binop (PLUS_EXPR, method_index, size_int (2));
method_index = size_binop (MULT_EXPR, method_index,
TYPE_SIZE_UNIT (nativecode_ptr_ptr_type_node));
+
+ if (TARGET_VTABLE_USES_DESCRIPTORS)
+ method_index = size_binop (MULT_EXPR, method_index,
+ size_int (TARGET_VTABLE_USES_DESCRIPTORS));
+
func = fold (build (PLUS_EXPR, nativecode_ptr_ptr_type_node, dtable,
convert (nativecode_ptr_ptr_type_node, method_index)));
- func = build1 (INDIRECT_REF, nativecode_ptr_type_node, func);
+
+ if (TARGET_VTABLE_USES_DESCRIPTORS)
+ func = build1 (NOP_EXPR, nativecode_ptr_type_node, func);
+ else
+ func = build1 (INDIRECT_REF, nativecode_ptr_type_node, func);
return func;
}
@@ -2355,9 +2366,9 @@ get_primitive_array_vtable (tree elt)
struct rtx_def *
java_lang_expand_expr (exp, target, tmode, modifier)
register tree exp;
- rtx target ATTRIBUTE_UNUSED;
- enum machine_mode tmode ATTRIBUTE_UNUSED;
- enum expand_modifier modifier ATTRIBUTE_UNUSED;
+ rtx target;
+ enum machine_mode tmode;
+ enum expand_modifier modifier;
{
tree current;
@@ -2498,19 +2509,21 @@ java_lang_expand_expr (exp, target, tmode, modifier)
for (current = TREE_OPERAND (exp, 1); current;
current = TREE_CHAIN (current))
{
- tree type;
tree catch = TREE_OPERAND (current, 0);
tree decl = BLOCK_EXPR_DECLS (catch);
- type = (decl ? TREE_TYPE (TREE_TYPE (decl)) : NULL_TREE);
- start_catch_handler (prepare_eh_table_type (type));
- expand_expr_stmt (TREE_OPERAND (current, 0));
+ tree type = (decl ? TREE_TYPE (TREE_TYPE (decl)) : NULL_TREE);
- expand_resume_after_catch ();
- end_catch_handler ();
+ expand_start_catch (type);
+ expand_expr_stmt (TREE_OPERAND (current, 0));
+ expand_end_catch ();
}
expand_end_all_catch ();
return const0_rtx;
+ case JAVA_EXC_OBJ_EXPR:
+ return expand_expr (build_exception_object_ref (TREE_TYPE (exp)),
+ target, tmode, modifier);
+
default:
internal_error ("Can't expand %s", tree_code_name [TREE_CODE (exp)]);
}
@@ -2808,7 +2821,7 @@ process_jvm_instruction (PC, byte_ops, length)
if (instruction_bits [PC] & BCODE_EXCEPTION_TARGET)
{
tree type = pop_type (ptr_type_node);
- push_value (build1 (NOP_EXPR, type, soft_exceptioninfo_call_node));
+ push_value (build (JAVA_EXC_OBJ_EXPR, type));
}
switch (byte_ops[PC++])
@@ -3264,16 +3277,31 @@ force_evaluation_order (node)
if (TREE_SIDE_EFFECTS (TREE_OPERAND (node, 1)))
TREE_OPERAND (node, 0) = save_expr (TREE_OPERAND (node, 0));
}
- else if (TREE_CODE (node) == CALL_EXPR || TREE_CODE (node) == NEW_CLASS_EXPR)
+ else if (TREE_CODE (node) == CALL_EXPR
+ || TREE_CODE (node) == NEW_CLASS_EXPR
+ || (TREE_CODE (node) == COMPOUND_EXPR
+ && TREE_CODE (TREE_OPERAND (node, 0)) == CALL_EXPR
+ && TREE_CODE (TREE_OPERAND (node, 1)) == SAVE_EXPR))
{
tree arg, cmp;
if (!TREE_OPERAND (node, 1))
return node;
+ arg = node;
+
+ /* Position arg properly, account for wrapped around ctors. */
+ if (TREE_CODE (node) == COMPOUND_EXPR)
+ arg = TREE_OPERAND (node, 0);
+
+ arg = TREE_OPERAND (arg, 1);
+
+ /* Not having a list of argument here is an error. */
+ if (TREE_CODE (arg) != TREE_LIST)
+ abort ();
+
/* This reverses the evaluation order. This is a desired effect. */
- for (cmp = NULL_TREE, arg = TREE_OPERAND (node, 1);
- arg; arg = TREE_CHAIN (arg))
+ for (cmp = NULL_TREE; arg; arg = TREE_CHAIN (arg))
{
tree saved = save_expr (force_evaluation_order (TREE_VALUE (arg)));
cmp = (cmp == NULL_TREE ? saved :
diff --git a/gcc/java/gcj.texi b/gcc/java/gcj.texi
index baa6281d4a0..5933b3fec29 100644
--- a/gcc/java/gcj.texi
+++ b/gcc/java/gcj.texi
@@ -10,6 +10,10 @@
@c When this manual is copyrighted.
@set copyrights-gcj 2001
+@c Versions
+@set version-gcc 3.0
+@set which-gcj GCC-@value{version-gcc}
+
@ifinfo
@format
@dircategory Programming
@@ -31,29 +35,23 @@
Copyright (C) @value{copyrights-gcj} Free Software Foundation, Inc.
-Permission is granted to make and distribute verbatim copies of
-this manual provided the copyright notice and this permission notice
-are preserved on all copies.
-
-@ignore
-Permission is granted to process this file through Tex and print the
-results, provided the printed document carries copying permission
-notice identical to this one except for the removal of this paragraph
-(this paragraph not being relevant to the printed manual).
-
-@end ignore
-Permission is granted to copy and distribute modified versions of this
-manual under the conditions for verbatim copying, provided also that the
-sections entitled ``GNU General Public License'' and ``Funding for Free
-Software'' are included exactly as in the original, and provided that
-the entire resulting derived work is distributed under the terms of a
-permission notice identical to this one.
-
-Permission is granted to copy and distribute translations of this manual
-into another language, under the above conditions for modified versions,
-except that the sections entitled ``GNU General Public License'', and
-this permission notice, may be included in translations approved by the
-Free Software Foundation instead of in the original English.
+Permission is granted to copy, distribute and/or modify this document
+under the terms of the GNU Free Documentation License, Version 1.1 or
+any later version published by the Free Software Foundation; with the
+Invariant Sections being ``GNU General Public License'', the Front-Cover
+texts being (a) (see below), and with the Back-Cover Texts being (b)
+(see below). A copy of the license is included in the section entitled
+``GNU Free Documentation License''.
+
+(a) The FSF's Front-Cover Text is:
+
+ A GNU Manual
+
+(b) The FSF's Back-Cover Text is:
+
+ You have freedom to copy and modify this GNU Manual, like GNU
+ software. Copies published by the Free Software Foundation raise
+ funds for GNU development.
@end ifinfo
@titlepage
@@ -64,30 +62,31 @@ Free Software Foundation instead of in the original English.
@vskip 0pt plus 1filll
Copyright @copyright{} @value{copyrights-gcj} Free Software Foundation, Inc.
@sp 2
-For the @value{which-g77} Version*
+For the @value{which-gcj} Version*
@sp 1
Published by the Free Software Foundation @*
59 Temple Place - Suite 330@*
Boston, MA 02111-1307, USA@*
@sp 1
-Permission is granted to make and distribute verbatim copies of
-this manual provided the copyright notice and this permission notice
-are preserved on all copies.
-
-Permission is granted to copy and distribute modified versions of this
-manual under the conditions for verbatim copying, provided also that the
-sections entitled ``GNU General Public License,'' ``Funding for Free
-Software,'' and ``Protect Your Freedom---Fight `Look And Feel'@w{}'' are
-included exactly as in the original, and provided that the entire
-resulting derived work is distributed under the terms of a permission
-notice identical to this one.
-
-Permission is granted to copy and distribute translations of this manual
-into another language, under the above conditions for modified versions,
-except that the section entitled ``GNU General Public License,'' and
-this permission notice, may be included in translations approved by the
-Free Software Foundation instead of in the original English.
+Permission is granted to copy, distribute and/or modify this document
+under the terms of the GNU Free Documentation License, Version 1.1 or
+any later version published by the Free Software Foundation; with the
+Invariant Sections being ``GNU General Public License'', the Front-Cover
+texts being (a) (see below), and with the Back-Cover Texts being (b)
+(see below). A copy of the license is included in the section entitled
+``GNU Free Documentation License''.
+
+(a) The FSF's Front-Cover Text is:
+
+ A GNU Manual
+
+(b) The FSF's Back-Cover Text is:
+
+ You have freedom to copy and modify this GNU Manual, like GNU
+ software. Copies published by the Free Software Foundation raise
+ funds for GNU development.
@end titlepage
+@contents
@page
@@ -101,6 +100,8 @@ files and object files, and it can read both Java source code and
@menu
* Copying:: The GNU General Public License
+* GNU Free Documentation License::
+ How you can share and copy this manual
* Invoking gcj:: Compiler options supported by @code{gcj}
* Compatibility:: Compatibility between gcj and other tools for Java
* Invoking gcjh:: Generate header files from class files
@@ -111,397 +112,9 @@ files and object files, and it can read both Java source code and
@end menu
-@node Copying
-@unnumbered GNU GENERAL PUBLIC LICENSE
-@center Version 2, June 1991
-
-@display
-Copyright @copyright{} 1989, 1991 Free Software Foundation, Inc.
-59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
-
-Everyone is permitted to copy and distribute verbatim copies
-of this license document, but changing it is not allowed.
-@end display
-
-@unnumberedsec Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software---to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.) You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary. To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
-@iftex
-@unnumberedsec TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-@end iftex
-@ifinfo
-@center TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-@end ifinfo
-
-@enumerate 0
-@item
-This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License. The ``Program'', below,
-refers to any such program or work, and a ``work based on the Program''
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language. (Hereinafter, translation is included without limitation in
-the term ``modification''.) Each licensee is addressed as ``you''.
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
-@item
-You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
+@include gpl.texi
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
-@item
-You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
-@enumerate a
-@item
-You must cause the modified files to carry prominent notices
-stating that you changed the files and the date of any change.
-
-@item
-You must cause any work that you distribute or publish, that in
-whole or in part contains or is derived from the Program or any
-part thereof, to be licensed as a whole at no charge to all third
-parties under the terms of this License.
-
-@item
-If the modified program normally reads commands interactively
-when run, you must cause it, when started running for such
-interactive use in the most ordinary way, to print or display an
-announcement including an appropriate copyright notice and a
-notice that there is no warranty (or else, saying that you provide
-a warranty) and that users may redistribute the program under
-these conditions, and telling the user how to view a copy of this
-License. (Exception: if the Program itself is interactive but
-does not normally print such an announcement, your work based on
-the Program is not required to print an announcement.)
-@end enumerate
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
-@item
-You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
-@enumerate a
-@item
-Accompany it with the complete corresponding machine-readable
-source code, which must be distributed under the terms of Sections
-1 and 2 above on a medium customarily used for software interchange; or,
-
-@item
-Accompany it with a written offer, valid for at least three
-years, to give any third party, for a charge no more than your
-cost of physically performing source distribution, a complete
-machine-readable copy of the corresponding source code, to be
-distributed under the terms of Sections 1 and 2 above on a medium
-customarily used for software interchange; or,
-
-@item
-Accompany it with the information you received as to the offer
-to distribute corresponding source code. (This alternative is
-allowed only for noncommercial distribution and only if you
-received the program in object code or executable form with such
-an offer, in accord with Subsection b above.)
-@end enumerate
-
-The source code for a work means the preferred form of the work for
-making modifications to it. For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable. However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
-@item
-You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License. Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
-@item
-You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Program or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
-@item
-Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
-@item
-If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all. For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
-@item
-If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded. In such case, this License incorporates
-the limitation as if written in the body of this License.
-
-@item
-The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and ``any
-later version'', you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation. If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
-@item
-If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission. For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this. Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
-@iftex
-@heading NO WARRANTY
-@end iftex
-@ifinfo
-@center NO WARRANTY
-@end ifinfo
-
-@item
-BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM ``AS IS'' WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
-@item
-IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-@end enumerate
-
-@iftex
-@heading END OF TERMS AND CONDITIONS
-@end iftex
-@ifinfo
-@center END OF TERMS AND CONDITIONS
-@end ifinfo
-
-@page
-@unnumberedsec How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the ``copyright'' line and a pointer to where the full notice is found.
-
-@smallexample
-@var{one line to give the program's name and a brief idea of what it does.}
-Copyright (C) @var{year} @var{name of author}
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-This program 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 program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-@end smallexample
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
-@smallexample
-Gnomovision version 69, Copyright (C) @var{year} @var{name of author}
-Gnomovision comes with ABSOLUTELY NO WARRANTY; for details
-type `show w'.
-This is free software, and you are welcome to redistribute it
-under certain conditions; type `show c' for details.
-@end smallexample
-
-The hypothetical commands @samp{show w} and @samp{show c} should show
-the appropriate parts of the General Public License. Of course, the
-commands you use may be called something other than @samp{show w} and
-@samp{show c}; they could even be mouse-clicks or menu items---whatever
-suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a ``copyright disclaimer'' for the program, if
-necessary. Here is a sample; alter the names:
-
-@smallexample
-Yoyodyne, Inc., hereby disclaims all copyright interest in the program
-`Gnomovision' (which makes passes at compilers) written by James Hacker.
-
-@var{signature of Ty Coon}, 1 April 1989
-Ty Coon, President of Vice
-@end smallexample
-
-This General Public License does not permit incorporating your program into
-proprietary programs. If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Library General
-Public License instead of this License.
+@include fdl.texi
@node Invoking gcj
@@ -513,6 +126,7 @@ gcc, Using the GNU Compiler Collection}. This manual only documents the
options specific to @code{gcj}.
@menu
+* Input and output files::
* Input Options:: How gcj finds files
* Encodings:: Options controlling source file encoding
* Warnings:: Options controlling warnings specific to gcj
@@ -520,6 +134,43 @@ options specific to @code{gcj}.
* Configure-time Options:: Options you won't use
@end menu
+@node Input and output files
+@section Input and output files
+
+A @code{gcj} command is like a @code{gcc} command, in that it
+consists of a number of options and file names. The following kinds
+of input file names are supported:
+
+@table @code
+@item @var{file}.java
+Java source files.
+@item @var{file}.class
+Java bytecode files.
+@item @var{file}.zip
+@itemx @var{file}.jar
+An archive containing one or more @code{.class} files, all of
+which are compiled. The archive may be compressed.
+@item @@@var{file}
+A file containing a whitespace-separated list of input file names.
+(Currently, these must all be @code{.java} source files, but that
+may change.)
+Each named file is compiled, just as if it had been on the command line.
+@item @var{library}.a
+@itemx @var{library}.so
+@itemx -l@var{libname}
+Libraries to use when linking. See the @code{gcc} manual.
+@end table
+
+You can specify more than one input file on the @code{gcj} command line,
+in which case they will all be compiled. If you specify a
+@code{-o @var{FILENAME}}
+option, all the input files will be compiled together, producing a
+single output file, named @var{FILENAME}.
+This is allowed even when using @code{-S} or @code{-c},
+but not when using @code{-C}.
+(This is an extension beyond the what plain @code{gcc} allows.)
+(If more than one input file is specified, all must currently
+be @code{.java} files, though we hope to fix this.)
@node Input Options
@section Input Options
@@ -586,6 +237,20 @@ suppressed by @code{--CLASSPATH}), then its value is appended.
Finally, the built-in system directory, @file{libgcj.jar}, is appended.
@end itemize
+The classfile built by @code{gcj} for the class @code{java.lang.Object}
+(and placed in @code{libgcj.jar}) contains a special zero length
+attribute @code{gnu.gcj.gcj-compiled}. The compiler looks for this
+attribute when loading @code{java.lang.Object} and will report an error
+if it isn't found, unless it compiles to bytecode (the option
+@code{-fforce-classes-archive-check} can be used to overide this
+behavior in this particular case.)
+
+@table @code
+@item -fforce-classes-archive-check
+This forces the compiler to always check for the special zero length
+attribute @code{gnu.gcj.gcj-compiled} in @code{java.lang.Object} and
+issue an error if it isn't found.
+@end table
@node Encodings
@section Encodings
@@ -936,5 +601,4 @@ a free software Java class library test suite which is being written
because the JCK is not free. See
@uref{http://sources.redhat.com/mauve/} for more information.
-@contents
@bye
diff --git a/gcc/java/gjavah.c b/gcc/java/gjavah.c
index 809ccf4bd2a..b56c0a61d83 100644
--- a/gcc/java/gjavah.c
+++ b/gcc/java/gjavah.c
@@ -392,37 +392,110 @@ utf8_cmp (str, length, name)
static const char *cxx_keywords[] =
{
+ "_Complex",
+ "__alignof",
+ "__alignof__",
+ "__asm",
+ "__asm__",
+ "__attribute",
+ "__attribute__",
+ "__builtin_va_arg",
+ "__complex",
+ "__complex__",
+ "__const",
+ "__const__",
+ "__extension__",
+ "__imag",
+ "__imag__",
+ "__inline",
+ "__inline__",
+ "__label__",
+ "__null",
+ "__real",
+ "__real__",
+ "__restrict",
+ "__restrict__",
+ "__signed",
+ "__signed__",
+ "__typeof",
+ "__typeof__",
+ "__volatile",
+ "__volatile__",
"asm",
+ "and",
+ "and_eq",
"auto",
+ "bitand",
+ "bitor",
"bool",
+ "break",
+ "case",
+ "catch",
+ "char",
+ "class",
+ "compl",
+ "const",
"const_cast",
+ "continue",
+ "default",
"delete",
+ "do",
+ "double",
"dynamic_cast",
+ "else",
"enum",
"explicit",
+ "export",
"extern",
+ "false",
+ "float",
+ "for",
"friend",
+ "goto",
+ "if",
"inline",
+ "int",
+ "long",
"mutable",
"namespace",
- "overload",
+ "new",
+ "not",
+ "not_eq",
+ "operator",
+ "or",
+ "or_eq",
+ "private",
+ "protected",
+ "public",
"register",
"reinterpret_cast",
+ "return",
+ "short",
"signed",
"sizeof",
+ "static",
"static_cast",
"struct",
+ "switch",
"template",
+ "this",
+ "throw",
+ "true",
+ "try",
"typedef",
- "typeid",
"typename",
- "typenameopt",
+ "typeid",
+ "typeof",
"union",
"unsigned",
"using",
"virtual",
+ "void",
"volatile",
- "wchar_t"
+ "wchar_t",
+ "while",
+ "xor",
+ "xor_eq"
};
@@ -1857,7 +1930,12 @@ DEFUN(process_file, (jcf, out),
generate_access (out, ACC_PUBLIC);
fprintf (out, "\n static ::java::lang::Class class$;\n");
- fputs ("};\n", out);
+ fputs ("}", out);
+
+ if (jcf->access_flags & ACC_INTERFACE)
+ fputs (" __attribute__ ((java_interface))", out);
+
+ fputs (";\n", out);
if (append_count > 0)
fputc ('\n', out);
diff --git a/gcc/java/java-tree.def b/gcc/java/java-tree.def
index 930979b5b24..c2e926f910b 100644
--- a/gcc/java/java-tree.def
+++ b/gcc/java/java-tree.def
@@ -93,6 +93,10 @@ DEFTREECODE (CLASS_LITERAL, "class_literal", '1', 1)
is used for context detection, so that special rules can be
enforced. */
DEFTREECODE (INSTANCE_INITIALIZERS_EXPR, "instance_initializers_expr", '1', 1)
+
+/* The Java object within the exception object from the runtime. */
+DEFTREECODE (JAVA_EXC_OBJ_EXPR, "java_exc_obj_expr", 'e', 0)
+
/*
Local variables:
mode:c
diff --git a/gcc/java/java-tree.h b/gcc/java/java-tree.h
index e1a0347d0e8..83dcc2c23bf 100644
--- a/gcc/java/java-tree.h
+++ b/gcc/java/java-tree.h
@@ -48,14 +48,18 @@ struct JCF;
IS_A_CLASSFILE_NAME (in IDENTIFIER_NODE)
COMPOUND_ASSIGN_P (in EXPR (binop_*))
LOCAL_CLASS_P (in RECORD_TYPE)
+ BLOCK_IS_IMPLICIT (in BLOCK)
+ JAVA_FILE_P (in TREE_LIST in current_file_list)
2: RETURN_MAP_ADJUSTED (in TREE_VEC).
QUALIFIED_P (in IDENTIFIER_NODE)
PRIMARY_P (in EXPR_WITH_FILE_LOCATION)
MODIFY_EXPR_FROM_INITIALIZATION_P (in MODIFY_EXPR)
CLASS_METHOD_CHECKED_P (in RECORD_TYPE)
+ CLASS_FILE_P (in TREE_LIST in current_file_list)
3: IS_AN_IMPORT_ON_DEMAND_P (in IDENTIFIER_NODE)
RESOLVE_PACKAGE_NAME_P (in EXPR_WITH_FILE_LOCATION)
SWITCH_HAS_DEFAULT (in SWITCH_EXPR)
+ ZIP_FILE_P (in TREE_LIST in current_file_list)
4: IS_A_COMMAND_LINE_FILENAME_P (in IDENTIFIER_NODE)
RESOLVE_TYPE_NAME_P (in EXPR_WITH_FILE_LOCATION)
CALL_USING_SUPER (in CALL_EXPR)
@@ -69,7 +73,7 @@ struct JCF;
Usage of TYPE_LANG_FLAG_?:
0: CLASS_ACCESS0_GENERATED_P (in RECORD_TYPE)
1: TYPE_ARRAY_P (in RECORD_TYPE).
- 2: CLASS_LOADED_P (in RECORD_TYPE).
+ 2: CLASS_PARSED_P (in RECORD_TYPE).
3: CLASS_FROM_SOURCE_P (in RECORD_TYPE).
4: CLASS_P (in RECORD_TYPE).
5: CLASS_FROM_CURRENTLY_COMPILED_SOURCE_P (in RECORD_TYPE)
@@ -138,6 +142,8 @@ extern int flag_assume_compiled;
extern int flag_emit_class_files;
+extern int flag_filelist_file;
+
/* When non zero, assume all native functions are implemented with
JNI, not CNI. */
@@ -147,6 +153,10 @@ extern int flag_jni;
extern int flag_extraneous_semicolon;
+/* When non zero, always check for a non gcj generated classes archive. */
+
+extern int flag_force_classes_archive_check;
+
/* When non zero, we emit xref strings. Values of the flag for xref
backends are defined in xref.h. */
@@ -270,6 +280,7 @@ enum java_tree_index
JTI_SUPER_IDENTIFIER_NODE,
JTI_CONTINUE_IDENTIFIER_NODE,
JTI_ACCESS0_IDENTIFIER_NODE,
+ JTI_CLASSDOLLAR_IDENTIFIER_NODE,
JTI_ONE_ELT_ARRAY_DOMAIN_TYPE,
JTI_RETURN_ADDRESS_TYPE_NODE,
@@ -307,6 +318,7 @@ enum java_tree_index
JTI_END_PARAMS_NODE,
+ JTI_THROW_NODE,
JTI_ALLOC_OBJECT_NODE,
JTI_SOFT_INSTANCEOF_NODE,
JTI_SOFT_CHECKCAST_NODE,
@@ -324,7 +336,6 @@ enum java_tree_index
JTI_SOFT_GETJNIENVNEWFRAME_NODE,
JTI_SOFT_JNIPOPSYSTEMFRAME_NODE,
JTI_SOFT_FMOD_NODE,
- JTI_SOFT_EXCEPTIONINFO_CALL_NODE,
JTI_SOFT_IDIV_NODE,
JTI_SOFT_IREM_NODE,
JTI_SOFT_LDIV_NODE,
@@ -332,8 +343,6 @@ enum java_tree_index
JTI_ACCESS_FLAGS_TYPE_NODE,
- JTI_CLASS_DTABLE_DECL,
-
JTI_NATIVECODE_PTR_ARRAY_TYPE_NODE,
JTI_WFL_OPERATOR,
@@ -460,6 +469,8 @@ extern tree java_global_trees[JTI_MAX];
java_global_trees[JTI_CONTINUE_IDENTIFIER_NODE] /* "continue" */
#define access0_identifier_node \
java_global_trees[JTI_ACCESS0_IDENTIFIER_NODE] /* "access$0" */
+#define classdollar_identifier_node \
+ java_global_trees[JTI_CLASSDOLLAR_IDENTIFIER_NODE] /* "class$" */
#define one_elt_array_domain_type \
java_global_trees[JTI_ONE_ELT_ARRAY_DOMAIN_TYPE]
/* The type of the return address of a subroutine. */
@@ -530,6 +541,8 @@ extern tree java_global_trees[JTI_MAX];
java_global_trees[JTI_END_PARAMS_NODE]
/* References to internal libjava functions we use. */
+#define throw_node \
+ java_global_trees[JTI_THROW_NODE]
#define alloc_object_node \
java_global_trees[JTI_ALLOC_OBJECT_NODE]
#define soft_instanceof_node \
@@ -548,7 +561,6 @@ extern tree java_global_trees[JTI_MAX];
java_global_trees[JTI_SOFT_BADARRAYINDEX_NODE]
#define soft_nullpointer_node \
java_global_trees[JTI_SOFT_NULLPOINTER_NODE]
-extern tree throw_node[];
#define soft_checkarraystore_node \
java_global_trees[JTI_SOFT_CHECKARRAYSTORE_NODE]
#define soft_monitorenter_node \
@@ -565,8 +577,6 @@ extern tree throw_node[];
java_global_trees[JTI_SOFT_JNIPOPSYSTEMFRAME_NODE]
#define soft_fmod_node \
java_global_trees[JTI_SOFT_FMOD_NODE]
-#define soft_exceptioninfo_call_node \
- java_global_trees[JTI_SOFT_EXCEPTIONINFO_CALL_NODE]
#define soft_idiv_node \
java_global_trees[JTI_SOFT_IDIV_NODE]
#define soft_irem_node \
@@ -579,9 +589,6 @@ extern tree throw_node[];
#define access_flags_type_node \
java_global_trees[JTI_ACCESS_FLAGS_TYPE_NODE]
-#define class_dtable_decl \
- java_global_trees[JTI_CLASS_DTABLE_DECL]
-
#define nativecode_ptr_array_type_node \
java_global_trees[JTI_NATIVECODE_PTR_ARRAY_TYPE_NODE]
@@ -705,6 +712,7 @@ struct lang_identifier
/* True if DECL initializes all its finals */
#define DECL_FUNCTION_ALL_FINAL_INITIALIZED(DECL) \
(DECL_LANG_SPECIFIC(DECL)->init_final)
+#define DECL_FIXED_CONSTRUCTOR_P(DECL) (DECL_LANG_SPECIFIC(DECL)->fixed_ctor)
/* True when DECL aliases an outer context local variable. */
#define FIELD_LOCAL_ALIAS(DECL) DECL_LANG_FLAG_6 (DECL)
@@ -732,7 +740,7 @@ struct lang_identifier
#define LABEL_RETURN_TYPE_STATE(NODE) LABEL_TYPE_STATE (LABEL_RETURN_LABEL (NODE))
/* In a TREE_VEC for a LABEL_RETURN_TYPE_STATE, notes that
- TREE_VEC_LENGTH has been adjust to the correct stack size. */
+ TREE_VEC_LENGTH has been adjusted to the correct stack size. */
#define RETURN_MAP_ADJUSTED(NODE) TREE_LANG_FLAG_2(NODE)
/* In the label of a sub-routine, a chain of the return location labels. */
@@ -819,6 +827,13 @@ struct lang_identifier
ggc_alloc_cleared (sizeof (struct lang_decl_var))); \
}
+/* A ConstantExpression, after folding and name resolution. */
+#define CONSTANT_VALUE_P(NODE) \
+ (TREE_CODE (NODE) == STRING_CST \
+ || (TREE_CODE (NODE) == INTEGER_CST \
+ && TREE_CODE (TREE_TYPE (NODE)) != POINTER_TYPE) \
+ || TREE_CODE (NODE) == REAL_CST)
+
/* For a local VAR_DECL, holds the index into a words bitstring that
specifies if this decl is definitively assigned.
A DECL_BIT_INDEX of -1 means we no longer care. */
@@ -847,6 +862,7 @@ struct lang_decl
int native : 1; /* Nonzero if this is a native method */
int synthetic_ctor : 1; /* Nonzero if this is a synthetic ctor */
int init_final : 1; /* Nonzero all finals are initialized */
+ int fixed_ctor : 1;
};
/* init_test_table hash table entry structure. */
@@ -941,12 +957,12 @@ extern tree lookup_java_constructor PARAMS ((tree, tree));
extern tree lookup_java_method PARAMS ((tree, tree, tree));
extern tree lookup_argument_method PARAMS ((tree, tree, tree));
extern tree lookup_argument_method2 PARAMS ((tree, tree, tree));
+extern int has_method PARAMS ((tree, tree));
extern tree promote_type PARAMS ((tree));
extern tree get_constant PARAMS ((struct JCF*, int));
extern tree get_name_constant PARAMS ((struct JCF*, int));
extern tree get_class_constant PARAMS ((struct JCF*, int));
extern tree parse_signature PARAMS ((struct JCF *jcf, int sig_index));
-extern void jcf_parse PARAMS ((struct JCF*));
extern tree add_field PARAMS ((tree, tree, tree, int));
extern tree add_method PARAMS ((tree, int, tree, tree));
extern tree add_method_1 PARAMS ((tree, int, tree, tree));
@@ -1012,6 +1028,7 @@ extern tree build_instanceof PARAMS ((tree, tree));
extern tree create_label_decl PARAMS ((tree));
extern void push_labeled_block PARAMS ((tree));
extern tree prepare_eh_table_type PARAMS ((tree));
+extern tree build_exception_object_ref PARAMS ((tree));
extern void java_set_exception_lang_code PARAMS ((void));
extern tree generate_name PARAMS ((void));
extern void pop_labeled_block PARAMS ((void));
@@ -1078,6 +1095,7 @@ extern int find_string_constant PARAMS ((struct CPool *, tree));
extern int find_class_constant PARAMS ((struct CPool *, tree));
extern int find_fieldref_index PARAMS ((struct CPool *, tree));
extern int find_methodref_index PARAMS ((struct CPool *, tree));
+extern int find_methodref_with_class_index PARAMS ((struct CPool *, tree, tree));
extern void write_constant_pool PARAMS ((struct CPool *, unsigned char *, int));
extern int count_constant_pool_bytes PARAMS ((struct CPool *));
extern int encode_newarray_type PARAMS ((tree));
@@ -1104,10 +1122,11 @@ extern void safe_layout_class PARAMS ((tree));
extern tree get_boehm_type_descriptor PARAMS ((tree));
extern unsigned long java_hash_hash_tree_node PARAMS ((hash_table_key));
-extern boolean java_hash_compare_tree_node PARAMS ((hash_table_key,
+extern bool java_hash_compare_tree_node PARAMS ((hash_table_key,
hash_table_key));
extern void java_check_methods PARAMS ((tree));
extern void init_jcf_parse PARAMS((void));
+extern void init_src_parse PARAMS((void));
extern int cxx_keyword_p PARAMS ((const char *, int));
extern tree java_mangle_decl PARAMS ((struct obstack *, tree));
@@ -1136,6 +1155,10 @@ struct rtx_def * java_lang_expand_expr PARAMS ((tree, rtx, enum machine_mode,
#define METHOD_ABSTRACT(DECL) DECL_LANG_FLAG_5 (DECL)
#define METHOD_TRANSIENT(DECL) DECL_LANG_FLAG_6 (DECL)
+#define JAVA_FILE_P(NODE) TREE_LANG_FLAG_2 (NODE)
+#define CLASS_FILE_P(NODE) TREE_LANG_FLAG_3 (NODE)
+#define ZIP_FILE_P(NODE) TREE_LANG_FLAG_4 (NODE)
+
/* Other predicates on method decls */
#define DECL_CONSTRUCTOR_P(DECL) DECL_LANG_FLAG_7(DECL)
@@ -1154,6 +1177,7 @@ struct rtx_def * java_lang_expand_expr PARAMS ((tree, rtx, enum machine_mode,
#define ID_FINIT_P(ID) ((ID) == finit_identifier_node \
|| (ID) == finit_leg_identifier_node)
#define ID_CLINIT_P(ID) ((ID) == clinit_identifier_node)
+#define ID_CLASSDOLLAR_P(ID) ((ID) == classdollar_identifier_node)
/* Access flags etc for a variable/field (a FIELD_DECL): */
@@ -1279,8 +1303,13 @@ extern tree *type_map;
/* FIXME this use of TREE_TYPE conflicts with something or other. */
#define TYPE_ARRAY_ELEMENT(ATYPE) TREE_TYPE(ATYPE)
-/* True if class TYPE has been loaded. */
-#define CLASS_LOADED_P(TYPE) TYPE_LANG_FLAG_2 (TYPE)
+/* True if class TYPE has been loaded (i.e. parsed plus laid out).
+ (The check for CLASS_PARSED_P is needed because of Object and Class.) */
+#define CLASS_LOADED_P(TYPE) (TYPE_SIZE (TYPE) != NULL_TREE \
+ && (CLASS_PARSED_P(TYPE) || TYPE_ARRAY_P(TYPE)))
+
+/* True if class TYPE has been parsed (first pass). */
+#define CLASS_PARSED_P(TYPE) TYPE_LANG_FLAG_2 (TYPE)
/* True if class TYPE was defined in Java source code. */
#define CLASS_FROM_SOURCE_P(TYPE) TYPE_LANG_FLAG_3 (TYPE)
@@ -1288,8 +1317,8 @@ extern tree *type_map;
/* True of a RECORD_TYPE of a class/interface type (not array type) */
#define CLASS_P(TYPE) TYPE_LANG_FLAG_4 (TYPE)
-/* True if class TYPE was defined in a Java source file compiled. */
-#define CLASS_FROM_CURRENTLY_COMPILED_SOURCE_P(TYPE) \
+/* True if class TYPE was requested (on command line) to be compiled.*/
+#define CLASS_FROM_CURRENTLY_COMPILED_P(TYPE) \
TYPE_LANG_FLAG_5 (TYPE)
/* True if class TYPE is currently being laid out. Helps in detection
@@ -1499,6 +1528,8 @@ extern tree *type_map;
#define BLOCK_EXPR_DECLS(NODE) BLOCK_VARS(NODE)
#define BLOCK_EXPR_BODY(NODE) BLOCK_SUBBLOCKS(NODE)
+/* True for an implicit block surrounding declaration not at start of {...}. */
+#define BLOCK_IS_IMPLICIT(NODE) TREE_LANG_FLAG_1 (NODE)
#define BUILD_MONITOR_ENTER(WHERE, ARG) \
{ \
diff --git a/gcc/java/jcf-io.c b/gcc/java/jcf-io.c
index 655e3812006..f2544380506 100644
--- a/gcc/java/jcf-io.c
+++ b/gcc/java/jcf-io.c
@@ -192,7 +192,7 @@ DEFUN(read_zip_member, (jcf, zipd, zipf),
jcf->read_ptr = jcf->buffer;
jcf->read_end = jcf->buffer_end;
if (lseek (zipf->fd, zipd->filestart, 0) < 0
- || read (zipf->fd, jcf->buffer, zipd->size) != zipd->size)
+ || read (zipf->fd, jcf->buffer, zipd->size) != (long) zipd->size)
return -2;
}
else
@@ -213,7 +213,7 @@ DEFUN(read_zip_member, (jcf, zipd, zipf),
d_stream.next_in = buffer;
d_stream.avail_in = zipd->size;
if (lseek (zipf->fd, zipd->filestart, 0) < 0
- || read (zipf->fd, buffer, zipd->size) != zipd->size)
+ || read (zipf->fd, buffer, zipd->size) != (long) zipd->size)
return -2;
/* Handle NO_HEADER using undocumented zlib feature.
This is a very common hack. */
diff --git a/gcc/java/jcf-parse.c b/gcc/java/jcf-parse.c
index e8eacc5dee7..6127d9d64ac 100644
--- a/gcc/java/jcf-parse.c
+++ b/gcc/java/jcf-parse.c
@@ -81,21 +81,24 @@ static tree parse_roots[3] = { NULL_TREE, NULL_TREE, NULL_TREE };
/* A list of file names. */
#define current_file_list parse_roots[2]
-/* The Java .class file that provides main_class; the main input file. */
+/* The Java archive that provides main_class; the main input file. */
static struct JCF main_jcf[1];
+static struct ZipFile *localToFile;
+
/* Declarations of some functions used here. */
static void handle_innerclass_attribute PARAMS ((int count, JCF *));
static tree give_name_to_class PARAMS ((JCF *jcf, int index));
static void parse_zip_file_entries PARAMS ((void));
static void process_zip_dir PARAMS ((FILE *));
-static void parse_source_file PARAMS ((tree, FILE *));
-static void jcf_parse_source PARAMS ((void));
-static int jcf_figure_file_type PARAMS ((JCF *));
+static void parse_source_file_1 PARAMS ((tree, FILE *));
+static void parse_source_file_2 PARAMS ((void));
static void parse_class_file PARAMS ((void));
static void set_source_filename PARAMS ((JCF *, int));
static int predefined_filename_p PARAMS ((tree));
static void ggc_mark_jcf PARAMS ((void**));
+static void jcf_parse PARAMS ((struct JCF*));
+static void load_inner_classes PARAMS ((tree));
/* Mark (for garbage collection) all the tree nodes that are
referenced from JCF's constant pool table. */
@@ -232,6 +235,12 @@ set_source_filename (jcf, index)
DECL_ARTIFICIAL (current_method) = 1; \
}
+#define HANDLE_GCJCOMPILED_ATTRIBUTE() \
+{ \
+ if (current_class == object_type_node) \
+ jcf->right_zip = 1; \
+}
+
#include "jcf-reader.c"
static int yydebug;
@@ -545,7 +554,7 @@ read_class (name)
tree name;
{
JCF this_jcf, *jcf;
- tree icv, class;
+ tree icv, class = NULL_TREE;
tree save_current_class = current_class;
const char *save_input_filename = input_filename;
JCF *save_current_jcf = current_jcf;
@@ -570,20 +579,54 @@ read_class (name)
current_jcf = jcf;
if (current_jcf->java_source)
- jcf_parse_source ();
- else {
- java_parser_context_save_global ();
- java_push_parser_context ();
- input_filename = current_jcf->filename;
- if (JCF_SEEN_IN_ZIP (current_jcf))
- read_zip_member(current_jcf, current_jcf->zipd, current_jcf->zipd->zipf);
- jcf_parse (current_jcf);
- java_pop_parser_context (0);
- java_parser_context_restore_global ();
- }
-
- if (! JCF_SEEN_IN_ZIP (current_jcf))
- JCF_FINISH (current_jcf);
+ {
+ const char *filename = current_jcf->filename;
+ tree file;
+ FILE *finput;
+ int generate;
+
+ java_parser_context_save_global ();
+ java_push_parser_context ();
+ BUILD_FILENAME_IDENTIFIER_NODE (file, filename);
+ generate = IS_A_COMMAND_LINE_FILENAME_P (file);
+ if (wfl_operator == NULL_TREE)
+ wfl_operator = build_expr_wfl (NULL_TREE, NULL, 0, 0);
+ EXPR_WFL_FILENAME_NODE (wfl_operator) = file;
+ input_filename = ggc_strdup (filename);
+ current_class = NULL_TREE;
+ current_function_decl = NULL_TREE;
+ if (!HAS_BEEN_ALREADY_PARSED_P (file))
+ {
+ if (!(finput = fopen (input_filename, "r")))
+ fatal_io_error ("can't reopen %s", input_filename);
+ parse_source_file_1 (file, finput);
+ parse_source_file_2 ();
+ if (fclose (finput))
+ fatal_io_error ("can't close %s", input_filename);
+ }
+ JCF_FINISH (current_jcf);
+ java_pop_parser_context (generate);
+ java_parser_context_restore_global ();
+ }
+ else
+ {
+ if (class == NULL_TREE || ! CLASS_PARSED_P (class))
+ {
+ java_parser_context_save_global ();
+ java_push_parser_context ();
+ current_class = class;
+ input_filename = current_jcf->filename;
+ if (JCF_SEEN_IN_ZIP (current_jcf))
+ read_zip_member(current_jcf,
+ current_jcf->zipd, current_jcf->zipd->zipf);
+ jcf_parse (current_jcf);
+ class = current_class;
+ java_pop_parser_context (0);
+ java_parser_context_restore_global ();
+ }
+ layout_class (class);
+ load_inner_classes (class);
+ }
current_class = save_current_class;
input_filename = save_input_filename;
@@ -620,35 +663,6 @@ load_class (class_or_name, verbose)
error ("Cannot find file for class %s.", IDENTIFIER_POINTER (name));
}
-/* Parse a source file when JCF refers to a source file. */
-
-static void
-jcf_parse_source ()
-{
- tree file;
- FILE *finput;
-
- java_parser_context_save_global ();
- java_push_parser_context ();
- BUILD_FILENAME_IDENTIFIER_NODE (file, current_jcf->filename);
- if (wfl_operator == NULL_TREE)
- wfl_operator = build_expr_wfl (NULL_TREE, NULL, 0, 0);
- EXPR_WFL_FILENAME_NODE (wfl_operator) = file;
- input_filename = ggc_strdup (current_jcf->filename);
- current_class = NULL_TREE;
- current_function_decl = NULL_TREE;
- if (!HAS_BEEN_ALREADY_PARSED_P (file))
- {
- if (!(finput = fopen (input_filename, "r")))
- fatal_io_error ("can't reopen %s", input_filename);
- parse_source_file (file, finput);
- if (fclose (finput))
- fatal_io_error ("can't close %s", input_filename);
- }
- java_pop_parser_context (IS_A_COMMAND_LINE_FILENAME_P (file));
- java_parser_context_restore_global ();
-}
-
/* Parse the .class file JCF. */
void
@@ -656,7 +670,6 @@ jcf_parse (jcf)
JCF* jcf;
{
int i, code;
- tree current;
if (jcf_parse_preamble (jcf) != 0)
fatal_error ("not a valid Java .class file");
@@ -674,9 +687,14 @@ jcf_parse (jcf)
fprintf (stderr, " %s %s",
(jcf->access_flags & ACC_INTERFACE) ? "interface" : "class",
IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (current_class))));
- if (CLASS_LOADED_P (current_class))
- return;
- CLASS_LOADED_P (current_class) = 1;
+ if (CLASS_PARSED_P (current_class))
+ {
+ /* FIXME - where was first time */
+ fatal_error ("reading class %s for the second time from %s",
+ IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (current_class))),
+ jcf->filename);
+ }
+ CLASS_PARSED_P (current_class) = 1;
for (i = 1; i < JPOOL_SIZE(jcf); i++)
{
@@ -702,20 +720,34 @@ jcf_parse (jcf)
if (current_class != class_type_node && current_class != object_type_node)
TYPE_FIELDS (current_class) = nreverse (TYPE_FIELDS (current_class));
- layout_class (current_class);
if (current_class == object_type_node)
- layout_class_methods (object_type_node);
+ {
+ layout_class_methods (object_type_node);
+ /* If we don't have the right archive, emit a verbose warning.
+ If we're generating bytecode, emit the warning only if
+ -fforce-classes-archive-check was specified. */
+ if (!jcf->right_zip
+ && (!flag_emit_class_files || flag_force_classes_archive_check))
+ fatal_error ("The `java.lang.Object' that was found in `%s' didn't have the special zero-length `gnu.gcj.gcj-compiled' attribute. This generally means that your classpath is incorrect set. Use `info gcj \"Input Options\"' to see the info page describing how to set the classpath.", jcf->filename);
+ }
else
- all_class_list = tree_cons (NULL_TREE,
+ all_class_list = tree_cons (NULL_TREE,
TYPE_NAME (current_class), all_class_list );
+}
- /* And if we came across inner classes, load them now. */
- for (current = DECL_INNER_CLASS_LIST (TYPE_NAME (current_class)); current;
+/* If we came across inner classes, load them now. */
+static void
+load_inner_classes (cur_class)
+ tree cur_class;
+{
+ tree current;
+ for (current = DECL_INNER_CLASS_LIST (TYPE_NAME (cur_class)); current;
current = TREE_CHAIN (current))
{
tree name = DECL_NAME (TREE_PURPOSE (current));
tree decl = IDENTIFIER_GLOBAL_VALUE (name);
- if (decl && !CLASS_BEING_LAIDOUT (TREE_TYPE (decl)))
+ if (decl && ! CLASS_LOADED_P (TREE_TYPE (decl))
+ && !CLASS_BEING_LAIDOUT (TREE_TYPE (decl)))
load_class (name, 1);
}
}
@@ -822,7 +854,7 @@ parse_class_file ()
/* Parse a source file, as pointed by the current value of INPUT_FILENAME. */
static void
-parse_source_file (file, finput)
+parse_source_file_1 (file, finput)
tree file;
FILE *finput;
{
@@ -853,6 +885,14 @@ parse_source_file (file, finput)
java_parse (); /* Parse and build partial tree nodes. */
java_parse_abort_on_error ();
+}
+
+/* Process a parsed source file, resolving names etc. */
+
+static void
+parse_source_file_2 ()
+{
+ int save_error_count = java_error_count;
java_complete_class (); /* Parse unsatisfied class decl. */
java_parse_abort_on_error ();
java_check_circular_reference (); /* Check on circular references */
@@ -876,18 +916,74 @@ predefined_filename_p (node)
int
yyparse ()
{
- int several_files = 0;
- char *list = xstrdup (input_filename), *next;
+ int filename_count = 0;
+ char *list, *next;
tree node;
- FILE *finput;
+ FILE *finput = NULL;
+
+ if (flag_filelist_file)
+ {
+ int avail = 2000;
+ finput = fopen (input_filename, "r");
+ if (finput == NULL)
+ fatal_io_error ("can't open %s", input_filename);
+ list = xmalloc(avail);
+ next = list;
+ for (;;)
+ {
+ int count;
+ if (avail < 500)
+ {
+ count = next - list;
+ avail = 2 * (count + avail);
+ list = xrealloc (list, avail);
+ next = list + count;
+ avail = avail - count;
+ }
+ /* Subtract to to guarantee space for final '\0'. */
+ count = fread (next, 1, avail - 1, finput);
+ if (count == 0)
+ {
+ if (! feof (finput))
+ fatal_io_error ("error closing %s", input_filename);
+ *next = '\0';
+ break;
+ }
+ avail -= count;
+ next += count;
+ }
+ fclose (finput);
+ finput = NULL;
+ }
+ else
+ list = xstrdup (input_filename);
do
{
- next = strchr (list, '&');
- if (next)
+ for (next = list; ; )
{
- *next++ = '\0';
- several_files = 1;
+ char ch = *next;
+ if (ch == '\n' || ch == '\r' || ch == '\t' || ch == ' '
+ || ch == '&' /* FIXME */)
+ {
+ if (next == list)
+ {
+ next++;
+ list = next;
+ continue;
+ }
+ else
+ {
+ *next++ = '\0';
+ break;
+ }
+ }
+ if (ch == '\0')
+ {
+ next = NULL;
+ break;
+ }
+ next++;
}
if (list[0])
@@ -898,12 +994,14 @@ yyparse ()
int len = strlen (list);
- if (*list != '/' && several_files)
+ if (*list != '/' && filename_count > 0)
obstack_grow (&temporary_obstack, "./", 2);
obstack_grow0 (&temporary_obstack, list, len);
value = obstack_finish (&temporary_obstack);
+ filename_count++;
+
/* Exclude file that we see twice on the command line. For
all files except {Class,Error,Object,RuntimeException,String,
Throwable}.java we can rely on maybe_get_identifier. For
@@ -943,10 +1041,15 @@ yyparse ()
}
while (next);
+ if (filename_count == 0)
+ warning ("no input file specified");
+
current_jcf = main_jcf;
current_file_list = nreverse (current_file_list);
for (node = current_file_list; node; node = TREE_CHAIN (node))
{
+ unsigned char magic_string[4];
+ uint32 magic;
tree name = TREE_VALUE (node);
/* Skip already parsed files */
@@ -954,52 +1057,91 @@ yyparse ()
continue;
/* Close previous descriptor, if any */
- if (main_jcf->read_state && fclose (main_jcf->read_state))
- fatal_io_error ("can't close %s",
- main_jcf->filename ? main_jcf->filename : "<unknown>");
+ if (finput && fclose (finput))
+ fatal_io_error ("can't close input file %s", main_input_filename);
- /* Set jcf up and open a new file */
- JCF_ZERO (main_jcf);
- main_jcf->read_state = fopen (IDENTIFIER_POINTER (name), "rb");
- if (main_jcf->read_state == NULL)
+ finput = fopen (IDENTIFIER_POINTER (name), "rb");
+ if (finput == NULL)
fatal_io_error ("can't open %s", IDENTIFIER_POINTER (name));
- /* Set new input_filename and finput */
- finput = main_jcf->read_state;
#ifdef IO_BUFFER_SIZE
setvbuf (finput, (char *) xmalloc (IO_BUFFER_SIZE),
_IOFBF, IO_BUFFER_SIZE);
#endif
input_filename = IDENTIFIER_POINTER (name);
- main_jcf->filbuf = jcf_filbuf_from_stdio;
- switch (jcf_figure_file_type (current_jcf))
+ /* Figure what kind of file we're dealing with */
+ if (fread (magic_string, 1, 4, finput) != 4)
+ fatal_io_error ("Premature end of input file %s",
+ IDENTIFIER_POINTER (name));
+ fseek (finput, 0L, SEEK_SET);
+ magic = GET_u4 (magic_string);
+ if (magic == 0xcafebabe)
{
- case JCF_ZIP:
- parse_zip_file_entries ();
- break;
- case JCF_CLASS:
+ CLASS_FILE_P (node) = 1;
+ current_jcf = ALLOC (sizeof (JCF));
+ JCF_ZERO (current_jcf);
+ current_jcf->read_state = finput;
+ current_jcf->filbuf = jcf_filbuf_from_stdio;
jcf_parse (current_jcf);
- parse_class_file ();
- break;
- case JCF_SOURCE:
+ TYPE_JCF (current_class) = current_jcf;
+ CLASS_FROM_CURRENTLY_COMPILED_P (current_class) = 1;
+ TREE_PURPOSE (node) = current_class;
+ }
+ else if (magic == (JCF_u4)ZIPMAGIC)
+ {
+ ZIP_FILE_P (node) = 1;
+ JCF_ZERO (main_jcf);
+ main_jcf->read_state = finput;
+ main_jcf->filbuf = jcf_filbuf_from_stdio;
+ if (open_in_zip (main_jcf, input_filename, NULL, 0) < 0)
+ fatal_error ("bad zip/jar file %s", IDENTIFIER_POINTER (name));
+ localToFile = SeenZipFiles;
+ /* Register all the class defined there. */
+ process_zip_dir (main_jcf->read_state);
+ parse_zip_file_entries ();
+ /*
+ for (each entry)
+ CLASS_FROM_CURRENTLY_COMPILED_P (current_class) = 1;
+ */
+ }
+ else
+ {
+ JAVA_FILE_P (node) = 1;
java_push_parser_context ();
java_parser_context_save_global ();
- parse_source_file (name, finput);
+ parse_source_file_1 (name, finput);
java_parser_context_restore_global ();
java_pop_parser_context (1);
- break;
}
}
+ for (ctxp = ctxp_for_generation; ctxp; ctxp = ctxp->next)
+ {
+ input_filename = ctxp->filename;
+ parse_source_file_2 ();
+ }
+ for (node = current_file_list; node; node = TREE_CHAIN (node))
+ {
+ input_filename = IDENTIFIER_POINTER (TREE_VALUE (node));
+ if (CLASS_FILE_P (node))
+ {
+ current_class = TREE_PURPOSE (node);
+ current_jcf = TYPE_JCF (current_class);
+ layout_class (current_class);
+ load_inner_classes (current_class);
+ parse_class_file ();
+ JCF_FINISH (current_jcf);
+ }
+ }
+ input_filename = main_input_filename;
+
java_expand_classes ();
if (!java_report_errors () && !flag_syntax_only)
emit_register_classes ();
return 0;
}
-static struct ZipFile *localToFile;
-
/* Process all class entries found in the zip file. */
static void
parse_zip_file_entries (void)
@@ -1022,8 +1164,13 @@ parse_zip_file_entries (void)
if ( !CLASS_LOADED_P (class))
{
- read_zip_member(current_jcf, zdir, localToFile);
- jcf_parse (current_jcf);
+ if (! CLASS_PARSED_P (class))
+ {
+ read_zip_member(current_jcf, zdir, localToFile);
+ jcf_parse (current_jcf);
+ }
+ layout_class (current_class);
+ load_inner_classes (current_class);
}
if (TYPE_SIZE (current_class) != error_mark_node)
@@ -1098,36 +1245,6 @@ process_zip_dir (FILE *finput)
}
}
-/* Figure what kind of file we're dealing with */
-static int
-DEFUN(jcf_figure_file_type, (jcf),
- JCF *jcf)
-{
- unsigned char magic_string[4];
- uint32 magic;
-
- if (fread (magic_string, 1, 4, jcf->read_state) != 4)
- jcf_unexpected_eof (jcf, 4);
-
- fseek (jcf->read_state, 0L, SEEK_SET);
- magic = GET_u4 (magic_string);
-
- if (magic == 0xcafebabe)
- return JCF_CLASS;
-
- /* FIXME: is it a system file? */
- if (magic == (JCF_u4)ZIPMAGIC
- && !open_in_zip (jcf, input_filename, NULL, 0))
- {
- localToFile = SeenZipFiles;
- /* Register all the class defined there. */
- process_zip_dir (jcf->read_state);
- return JCF_ZIP;
- }
-
- return JCF_SOURCE;
-}
-
/* Initialization. */
void
@@ -1137,4 +1254,6 @@ init_jcf_parse ()
ggc_add_tree_root (parse_roots, sizeof (parse_roots) / sizeof(tree));
ggc_add_root (&current_jcf, 1, sizeof (JCF), (void (*)(void *))ggc_mark_jcf);
+
+ init_src_parse ();
}
diff --git a/gcc/java/jcf-reader.c b/gcc/java/jcf-reader.c
index f34bddb6e75..5df7a2e6353 100644
--- a/gcc/java/jcf-reader.c
+++ b/gcc/java/jcf-reader.c
@@ -120,6 +120,9 @@ DEFUN(get_attribute, (jcf),
name_length = JPOOL_UTF_LENGTH (jcf, attribute_name);
name_data = JPOOL_UTF_DATA (jcf, attribute_name);
+#define MATCH_ATTRIBUTE(S) \
+ (name_length == sizeof (S)-1 && memcmp (name_data, S, sizeof (S)-1) == 0)
+
#ifdef IGNORE_ATTRIBUTE
if (IGNORE_ATTRIBUTE (jcf, attribute_name, attribute_length))
{
@@ -128,7 +131,7 @@ DEFUN(get_attribute, (jcf),
else
#endif
#ifdef HANDLE_SOURCEFILE
- if (name_length == 10 && memcmp (name_data, "SourceFile", 10) == 0)
+ if (MATCH_ATTRIBUTE ("SourceFile"))
{
uint16 sourcefile_index = JCF_readu2 (jcf);
HANDLE_SOURCEFILE(sourcefile_index);
@@ -136,7 +139,7 @@ DEFUN(get_attribute, (jcf),
else
#endif
#ifdef HANDLE_CONSTANTVALUE
- if (name_length == 13 && memcmp (name_data, "ConstantValue", 13) == 0)
+ if (MATCH_ATTRIBUTE ("ConstantValue"))
{
uint16 constantvalue_index = JCF_readu2 (jcf);
if (constantvalue_index <= 0 || constantvalue_index >= JPOOL_SIZE(jcf))
@@ -146,7 +149,7 @@ DEFUN(get_attribute, (jcf),
else
#endif
#ifdef HANDLE_CODE_ATTRIBUTE
- if (name_length == 4 && memcmp (name_data, "Code", 4) == 0)
+ if (MATCH_ATTRIBUTE ("Code"))
{
uint16 j;
uint16 max_stack ATTRIBUTE_UNUSED = JCF_readu2 (jcf);
@@ -175,7 +178,7 @@ DEFUN(get_attribute, (jcf),
else
#endif /* HANDLE_CODE_ATTRIBUTE */
#ifdef HANDLE_EXCEPTIONS_ATTRIBUTE
- if (name_length == 10 && memcmp (name_data, "Exceptions", 10) == 0)
+ if (MATCH_ATTRIBUTE ("Exceptions"))
{
uint16 count = JCF_readu2 (jcf);
HANDLE_EXCEPTIONS_ATTRIBUTE (count);
@@ -183,7 +186,7 @@ DEFUN(get_attribute, (jcf),
else
#endif
#ifdef HANDLE_LINENUMBERTABLE_ATTRIBUTE
- if (name_length == 15 && memcmp (name_data, "LineNumberTable", 15) == 0)
+ if (MATCH_ATTRIBUTE ("LineNumberTable"))
{
uint16 count = JCF_readu2 (jcf);
HANDLE_LINENUMBERTABLE_ATTRIBUTE (count);
@@ -191,7 +194,7 @@ DEFUN(get_attribute, (jcf),
else
#endif
#ifdef HANDLE_LOCALVARIABLETABLE_ATTRIBUTE
- if (name_length == 18 && memcmp (name_data, "LocalVariableTable", 18) == 0)
+ if (MATCH_ATTRIBUTE ("LocalVariableTable"))
{
uint16 count = JCF_readu2 (jcf);
HANDLE_LOCALVARIABLETABLE_ATTRIBUTE (count);
@@ -199,7 +202,7 @@ DEFUN(get_attribute, (jcf),
else
#endif
#ifdef HANDLE_INNERCLASSES_ATTRIBUTE
- if (name_length == 12 && memcmp (name_data, "InnerClasses", 12) == 0)
+ if (MATCH_ATTRIBUTE ("InnerClasses"))
{
uint16 count = JCF_readu2 (jcf);
HANDLE_INNERCLASSES_ATTRIBUTE (count);
@@ -207,12 +210,19 @@ DEFUN(get_attribute, (jcf),
else
#endif
#ifdef HANDLE_SYNTHETIC_ATTRIBUTE
- if (name_length == 9 && memcmp (name_data, "Synthetic", 9) == 0)
+ if (MATCH_ATTRIBUTE ("Synthetic"))
{
HANDLE_SYNTHETIC_ATTRIBUTE ();
}
else
#endif
+#ifdef HANDLE_GCJCOMPILED_ATTRIBUTE
+ if (MATCH_ATTRIBUTE ("gnu.gcj.gcj-compiled"))
+ {
+ HANDLE_GCJCOMPILED_ATTRIBUTE ();
+ }
+ else
+#endif
{
#ifdef PROCESS_OTHER_ATTRIBUTE
PROCESS_OTHER_ATTRIBUTE(jcf, attribute_name, attribute_length);
@@ -362,7 +372,7 @@ DEFUN(jcf_parse_fields, (jcf),
uint16 attribute_count = JCF_readu2 (jcf);
#ifdef HANDLE_START_FIELD
HANDLE_START_FIELD (access_flags, name_index, signature_index,
- attribute_count);
+ attribute_count);
#endif
for (j = 0; j < attribute_count; j++)
{
diff --git a/gcc/java/jcf-write.c b/gcc/java/jcf-write.c
index 5cb4fb368a2..261f0d9edb0 100644
--- a/gcc/java/jcf-write.c
+++ b/gcc/java/jcf-write.c
@@ -111,7 +111,7 @@ struct chunk
struct jcf_block
{
/* For blocks that that are defined, the next block (in pc order).
- For blocks that are the not-yet-defined end label of a LABELED_BLOCK_EXPR
+ For blocks that are not-yet-defined the end label of a LABELED_BLOCK_EXPR
or a cleanup expression (from a WITH_CLEANUP_EXPR),
this is the next (outer) such end label, in a stack headed by
labeled_blocks in jcf_partial. */
@@ -131,8 +131,8 @@ struct jcf_block
int linenumber;
- /* After finish_jcf_block is called, The actual instructions
- contained in this block. Before than NULL, and the instructions
+ /* After finish_jcf_block is called, the actual instructions
+ contained in this block. Before that NULL, and the instructions
are in state->bytecode. */
union {
struct chunk *chunk;
@@ -346,10 +346,11 @@ static char *make_class_file_name PARAMS ((tree));
static unsigned char *append_synthetic_attribute PARAMS ((struct jcf_partial *));
static void append_innerclasses_attribute PARAMS ((struct jcf_partial *, tree));
static void append_innerclasses_attribute_entry PARAMS ((struct jcf_partial *, tree, tree));
+static void append_gcj_attribute PARAMS ((struct jcf_partial *, tree));
/* Utility macros for appending (big-endian) data to a buffer.
We assume a local variable 'ptr' points into where we want to
- write next, and we assume enoygh space has been allocated. */
+ write next, and we assume enough space has been allocated. */
#ifdef ENABLE_JC1_CHECKING
static int CHECK_PUT PARAMS ((void *, struct jcf_partial *, int));
@@ -1720,7 +1721,7 @@ generate_bytecode_insns (exp, target, state)
{
push_int_const (sw_state.cases->offset, state);
emit_if (sw_state.cases->label,
- OPCODE_ifeq, OPCODE_ifne, state);
+ OPCODE_if_icmpeq, OPCODE_if_icmpne, state);
}
emit_goto (sw_state.default_label, state);
}
@@ -2009,6 +2010,8 @@ generate_bytecode_insns (exp, target, state)
if (TREE_CODE (rhs) == MINUS_EXPR)
value = -value;
emit_iinc (lhs, value, state);
+ if (target != IGNORE_TARGET)
+ emit_load (lhs, state);
break;
}
}
@@ -2308,6 +2311,8 @@ generate_bytecode_insns (exp, target, state)
abort ();
generate_bytecode_insns (try_clause, IGNORE_TARGET, state);
end_label = get_jcf_label_here (state);
+ if (end_label == start_label)
+ break;
if (CAN_COMPLETE_NORMALLY (try_clause))
emit_goto (finished_label, state);
while (clause != NULL_TREE)
@@ -2329,61 +2334,53 @@ generate_bytecode_insns (exp, target, state)
break;
case TRY_FINALLY_EXPR:
{
- struct jcf_block *finished_label, *finally_label, *start_label;
+ struct jcf_block *finished_label,
+ *finally_label, *start_label, *end_label;
struct jcf_handler *handler;
- int worthwhile_finally = 1;
tree try_block = TREE_OPERAND (exp, 0);
tree finally = TREE_OPERAND (exp, 1);
- tree return_link, exception_decl;
+ tree return_link = NULL_TREE, exception_decl = NULL_TREE;
- finally_label = start_label = NULL;
- return_link = exception_decl = NULL_TREE;
- finished_label = gen_jcf_label (state);
+ tree exception_type;
- /* If the finally clause happens to be empty, set a flag so we
- remember to just skip it. */
- if (BLOCK_EXPR_BODY (finally) == empty_stmt_node)
- worthwhile_finally = 0;
+ finally_label = gen_jcf_label (state);
+ start_label = get_jcf_label_here (state);
+ finally_label->pc = PENDING_CLEANUP_PC;
+ finally_label->next = state->labeled_blocks;
+ state->labeled_blocks = finally_label;
+ state->num_finalizers++;
- if (worthwhile_finally)
+ generate_bytecode_insns (try_block, target, state);
+ if (state->labeled_blocks != finally_label)
+ abort();
+ state->labeled_blocks = finally_label->next;
+ end_label = get_jcf_label_here (state);
+
+ if (end_label == start_label)
{
- tree exception_type;
- return_link = build_decl (VAR_DECL, NULL_TREE,
- return_address_type_node);
- exception_type = build_pointer_type (throwable_type_node);
- exception_decl = build_decl (VAR_DECL, NULL_TREE, exception_type);
-
- finally_label = gen_jcf_label (state);
- start_label = get_jcf_label_here (state);
- finally_label->pc = PENDING_CLEANUP_PC;
- finally_label->next = state->labeled_blocks;
- state->labeled_blocks = finally_label;
- state->num_finalizers++;
+ state->num_finalizers--;
+ define_jcf_label (finally_label, state);
+ generate_bytecode_insns (finally, IGNORE_TARGET, state);
+ break;
}
- generate_bytecode_insns (try_block, target, state);
+ return_link = build_decl (VAR_DECL, NULL_TREE,
+ return_address_type_node);
+ finished_label = gen_jcf_label (state);
+
- if (worthwhile_finally)
+ if (CAN_COMPLETE_NORMALLY (try_block))
{
- if (state->labeled_blocks != finally_label)
- abort();
- state->labeled_blocks = finally_label->next;
emit_jsr (finally_label, state);
+ emit_goto (finished_label, state);
}
- if (CAN_COMPLETE_NORMALLY (try_block)
- && TREE_CODE (try_block) == BLOCK
- && BLOCK_EXPR_BODY (try_block) != empty_stmt_node)
- emit_goto (finished_label, state);
-
/* Handle exceptions. */
- if (!worthwhile_finally)
- break;
-
+ exception_type = build_pointer_type (throwable_type_node);
+ exception_decl = build_decl (VAR_DECL, NULL_TREE, exception_type);
localvar_alloc (return_link, state);
- handler = alloc_handler (start_label, NULL_PTR, state);
- handler->end_label = handler->handler_label;
+ handler = alloc_handler (start_label, end_label, state);
handler->type = NULL_TREE;
localvar_alloc (exception_decl, state);
NOTE_PUSH (1);
@@ -2393,7 +2390,6 @@ generate_bytecode_insns (exp, target, state)
RESERVE (1);
OP1 (OPCODE_athrow);
NOTE_POP (1);
- localvar_free (exception_decl, state);
/* The finally block. First save return PC into return_link. */
define_jcf_label (finally_label, state);
@@ -2402,6 +2398,7 @@ generate_bytecode_insns (exp, target, state)
generate_bytecode_insns (finally, IGNORE_TARGET, state);
maybe_wide (OPCODE_ret, DECL_LOCAL_INDEX (return_link), state);
+ localvar_free (exception_decl, state);
localvar_free (return_link, state);
define_jcf_label (finished_label, state);
}
@@ -2454,6 +2451,9 @@ generate_bytecode_insns (exp, target, state)
}
}
break;
+ case JAVA_EXC_OBJ_EXPR:
+ NOTE_PUSH (1); /* Pushed by exception system. */
+ break;
case NEW_CLASS_EXPR:
{
tree class = TREE_TYPE (TREE_TYPE (exp));
@@ -2516,8 +2516,7 @@ generate_bytecode_insns (exp, target, state)
}
else if (f == soft_monitorenter_node
|| f == soft_monitorexit_node
- || f == throw_node[0]
- || f == throw_node[1])
+ || f == throw_node)
{
if (f == soft_monitorenter_node)
op = OPCODE_monitorenter;
@@ -2531,11 +2530,6 @@ generate_bytecode_insns (exp, target, state)
NOTE_POP (1);
break;
}
- else if (exp == soft_exceptioninfo_call_node)
- {
- NOTE_PUSH (1); /* Pushed by exception system. */
- break;
- }
for ( ; x != NULL_TREE; x = TREE_CHAIN (x))
{
generate_bytecode_insns (TREE_VALUE (x), STACK_TARGET, state);
@@ -2553,7 +2547,7 @@ generate_bytecode_insns (exp, target, state)
NOTE_POP (1); /* Pop implicit this. */
if (TREE_CODE (f) == FUNCTION_DECL && DECL_CONTEXT (f) != NULL_TREE)
{
- tree saved_context = NULL_TREE;
+ tree context = DECL_CONTEXT (f);
int index, interface = 0;
RESERVE (5);
if (METHOD_STATIC (f))
@@ -2561,24 +2555,24 @@ generate_bytecode_insns (exp, target, state)
else if (DECL_CONSTRUCTOR_P (f) || CALL_USING_SUPER (exp)
|| METHOD_PRIVATE (f))
OP1 (OPCODE_invokespecial);
- else if (CLASS_INTERFACE (TYPE_NAME (DECL_CONTEXT (f))))
- {
- OP1 (OPCODE_invokeinterface);
- interface = 1;
- }
else
- OP1 (OPCODE_invokevirtual);
- if (interface)
{
- saved_context = DECL_CONTEXT (f);
- DECL_CONTEXT (f) =
- TREE_TYPE (TREE_TYPE (TREE_VALUE (TREE_OPERAND (exp, 1))));
+ if (CLASS_INTERFACE (TYPE_NAME (context)))
+ {
+ tree arg1 = TREE_VALUE (TREE_OPERAND (exp, 1));
+ context = TREE_TYPE (TREE_TYPE (arg1));
+ if (CLASS_INTERFACE (TYPE_NAME (context)))
+ interface = 1;
+ }
+ if (interface)
+ OP1 (OPCODE_invokeinterface);
+ else
+ OP1 (OPCODE_invokevirtual);
}
- index = find_methodref_index (&state->cpool, f);
+ index = find_methodref_with_class_index (&state->cpool, f, context);
OP2 (index);
if (interface)
{
- DECL_CONTEXT (f) = saved_context;
if (nargs <= 0)
abort ();
@@ -2891,11 +2885,7 @@ generate_classfile (clas, state)
build_java_signature (TREE_TYPE (part)));
PUT2(i);
have_value = DECL_INITIAL (part) != NULL_TREE
- && FIELD_STATIC (part)
- && (TREE_CODE (DECL_INITIAL (part)) == STRING_CST
- || (TREE_CODE (DECL_INITIAL (part)) == INTEGER_CST
- && TREE_CODE (TREE_TYPE (DECL_INITIAL (part))) != POINTER_TYPE)
- || TREE_CODE (DECL_INITIAL (part)) == REAL_CST);
+ && FIELD_STATIC (part) && CONSTANT_VALUE_P (DECL_INITIAL (part));
if (have_value)
attr_count++;
@@ -3108,8 +3098,11 @@ generate_classfile (clas, state)
}
ptr = append_chunk (NULL, 10, state);
- i = ((INNER_CLASS_TYPE_P (clas)
- || DECL_INNER_CLASS_LIST (TYPE_NAME (clas))) ? 2 : 1);
+ i = 1; /* Source file always exists as an attribute */
+ if (INNER_CLASS_TYPE_P (clas) || DECL_INNER_CLASS_LIST (TYPE_NAME (clas)))
+ i++;
+ if (clas == object_type_node)
+ i++;
PUT2 (i); /* attributes_count */
/* generate the SourceFile attribute. */
@@ -3124,6 +3117,7 @@ generate_classfile (clas, state)
PUT4 (2);
i = find_utf8_constant (&state->cpool, get_identifier (source_file));
PUT2 (i);
+ append_gcj_attribute (state, clas);
append_innerclasses_attribute (state, clas);
/* New finally generate the contents of the constant pool chunk. */
@@ -3156,6 +3150,24 @@ append_synthetic_attribute (state)
}
static void
+append_gcj_attribute (state, class)
+ struct jcf_partial *state;
+ tree class;
+{
+ unsigned char *ptr;
+ int i;
+
+ if (class != object_type_node)
+ return;
+
+ ptr = append_chunk (NULL, 6, state); /* 2+4 */
+ i = find_utf8_constant (&state->cpool,
+ get_identifier ("gnu.gcj.gcj-compiled"));
+ PUT2 (i); /* Attribute string index */
+ PUT4 (0); /* Attribute length */
+}
+
+static void
append_innerclasses_attribute (state, class)
struct jcf_partial *state;
tree class;
diff --git a/gcc/java/jcf.h b/gcc/java/jcf.h
index 5bb53b05c46..4203ec0853d 100644
--- a/gcc/java/jcf.h
+++ b/gcc/java/jcf.h
@@ -63,10 +63,6 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */
#define JCF_word JCF_u4
#endif
-#define JCF_ZIP 1
-#define JCF_CLASS 2
-#define JCF_SOURCE 3
-
struct JCF;
typedef int (*jcf_filbuf_t) PARAMS ((struct JCF*, int needed));
@@ -92,7 +88,8 @@ typedef struct JCF {
unsigned char *buffer_end;
unsigned char *read_ptr;
unsigned char *read_end;
- int java_source;
+ int java_source : 1;
+ int right_zip : 1;
jcf_filbuf_t filbuf;
void *read_state;
const char *filename;
@@ -157,7 +154,7 @@ typedef struct JCF {
#define JCF_ZERO(JCF) \
((JCF)->buffer = (JCF)->buffer_end = (JCF)->read_ptr = (JCF)->read_end = 0,\
(JCF)->read_state = 0, (JCF)->filename = (JCF)->classname = 0, \
- CPOOL_INIT(&(JCF)->cpool), (JCF)->java_source = 0)
+ CPOOL_INIT(&(JCF)->cpool), (JCF)->java_source = 0, (JCF)->zipd = 0)
/* Given that PTR points to a 2-byte unsigned integer in network
(big-endian) byte-order, return that integer. */
diff --git a/gcc/java/jv-scan.c b/gcc/java/jv-scan.c
index d5b0d0a6783..e1844e69b1d 100644
--- a/gcc/java/jv-scan.c
+++ b/gcc/java/jv-scan.c
@@ -119,7 +119,7 @@ static void
version ()
{
printf ("jv-scan (%s)\n\n", version_string);
- printf ("Copyright (C) 2000 Free Software Foundation, Inc.\n");
+ printf ("Copyright (C) 2001 Free Software Foundation, Inc.\n");
printf ("This is free software; see the source for copying conditions. There is NO\n");
printf ("warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n");
exit (0);
diff --git a/gcc/java/jvgenmain.c b/gcc/java/jvgenmain.c
index 414ccded13a..615854bcdcb 100644
--- a/gcc/java/jvgenmain.c
+++ b/gcc/java/jvgenmain.c
@@ -62,14 +62,14 @@ static void usage (const char *) ATTRIBUTE_NORETURN;
static void
usage (const char *name)
{
- fprintf (stderr, "Usage: %s [OPTIONS]... CLASSNAME [OUTFILE]\n", name);
+ fprintf (stderr, "Usage: %s [OPTIONS]... CLASSNAMEmain [OUTFILE]\n", name);
exit (1);
}
int
-main (int argc, const char **argv)
+main (int argc, char **argv)
{
- const char *classname;
+ char *classname, *p;
FILE *stream;
const char *mangled_classname;
int i, last_arg;
@@ -93,6 +93,13 @@ main (int argc, const char **argv)
classname = argv[i];
+ /* gcj always appends `main' to classname. We need to strip this here. */
+ p = strrchr (classname, 'm');
+ if (p == NULL || p == classname || strcmp (p, "main") != 0)
+ usage (argv[0]);
+ else
+ *p = '\0';
+
gcc_obstack_init (mangle_obstack);
mangled_classname = do_mangle_classname (classname);
@@ -168,5 +175,6 @@ do_mangle_classname (string)
}
append_gpp_mangled_name (&ptr [-count], count);
obstack_grow (mangle_obstack, "6class$E", 8);
+ obstack_1grow (mangle_obstack, '\0');
return obstack_finish (mangle_obstack);
}
diff --git a/gcc/java/jvspec.c b/gcc/java/jvspec.c
index 749fd133b0b..055aa823c32 100644
--- a/gcc/java/jvspec.c
+++ b/gcc/java/jvspec.c
@@ -38,6 +38,10 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */
#define JAVA_FILE_ARG (1<<3)
/* True if this arg is a .class input file name. */
#define CLASS_FILE_ARG (1<<4)
+/* True if this arg is a .zip or .jar input file name. */
+#define ZIP_FILE_ARG (1<<5)
+/* True if this arg is @FILE - where FILE contains a list of filenames. */
+#define INDIRECT_FILE_ARG (1<<6)
static char *find_spec_file PARAMS ((const char *));
@@ -47,14 +51,9 @@ int lang_specific_extra_outfiles = 0;
/* True if we should add -shared-libgcc to the command-line. */
int shared_libgcc = 1;
-/* Once we have the proper support in jc1 (and gcc.c) working,
- set COMBINE_INPUTS to one. This enables combining multiple *.java
- and *.class input files to be passed to a single jc1 invocation. */
-#define COMBINE_INPUTS 0
-
const char jvgenmain_spec[] =
- "jvgenmain %{D*} %i %{!pipe:%umain.i} |\n\
- cc1 %{!pipe:%Umain.i} %1 \
+ "jvgenmain %{D*} %b %{!pipe:%u.i} |\n\
+ cc1 %{!pipe:%U.i} %1 \
%{!Q:-quiet} -dumpbase %b.c %{d*} %{m*} %{a*}\
%{g*} %{O*} \
%{v:-version} %{pg:-p} %{p}\
@@ -64,11 +63,12 @@ const char jvgenmain_spec[] =
%{<fuse-boehm-gc} %{<fhash-synchronization} %{<fjni}\
%{<fclasspath*} %{<fCLASSPATH*} %{<foutput-class-dir}\
%{<fuse-divide-subroutine} %{<fno-use-divide-subroutine}\
+ %{<ffilelist-file}\
%{f*} -fdollars-in-identifiers\
%{aux-info*}\
%{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\
- %{S:%W{o*}%{!o*:-o %b.s}}%{!S:-o %{|!pipe:%Umain.s}} |\n\
- %{!S:as %a %Y -o %d%w%umain%O %{!pipe:%Umain.s} %A\n }";
+ %{S:%W{o*}%{!o*:-o %b.s}}%{!S:-o %{|!pipe:%g.s}} |\n\
+ %{!S:as %a %Y -o %d%w%u%O %{!pipe:%g.s} %A\n }";
/* Return full path name of spec file if it is in DIR, or NULL if
not. */
@@ -104,11 +104,12 @@ lang_specific_driver (in_argc, in_argv, in_added_libraries)
/* If non-zero, the user gave us the `-v' flag. */
int saw_verbose_flag = 0;
+ int saw_save_temps = 0;
+
/* This will be 0 if we encounter a situation where we should not
link in libgcj. */
int library = 1;
-#if COMBINE_INPUTS
/* This will be 1 if multiple input files (.class and/or .java)
should be passed to a single jc1 invocation. */
int combine_inputs = 0;
@@ -116,25 +117,21 @@ lang_specific_driver (in_argc, in_argv, in_added_libraries)
/* Index of last .java or .class argument. */
int last_input_index;
- /* A buffer containing the concatenation of the inputs files
- (e.g. "foo.java&bar.class&baz.class"). if combine_inputs. */
- char* combined_inputs_buffer;
-
- /* Next available location in combined_inputs_buffer. */
- int combined_inputs_pos;
-
/* Number of .java and .class source file arguments seen. */
int java_files_count = 0;
int class_files_count = 0;
+ /* Number of .zip or .jar file arguments seen. */
+ int zip_files_count = 0;
+ /* Number of '@FILES' arguments seen. */
+ int indirect_files_count = 0;
- /* Cumulative length of the .java and .class source file names. */
- int java_files_length = 0;
- int class_files_length = 0;
-#endif
+ /* Name of file containing list of files to compile. */
+ char *filelist_filename = 0;
+
+ FILE *filelist_file = 0;
/* The number of arguments being added to what's in argv, other than
- libraries. We use this to track the number of times we've inserted
- -xc++/-xnone. */
+ libraries. */
int added = 2;
/* Used to track options that take arguments, so we don't go wrapping
@@ -149,6 +146,7 @@ lang_specific_driver (in_argc, in_argv, in_added_libraries)
already gave a language for the file. */
int saw_speclang = 0;
+#if 0
/* "-lm" or "-lmath" if it appears on the command line. */
const char *saw_math ATTRIBUTE_UNUSED = 0;
@@ -163,6 +161,7 @@ lang_specific_driver (in_argc, in_argv, in_added_libraries)
/* Saw `-lgcj' on command line. */
int saw_libgcj ATTRIBUTE_UNUSED = 0;
+#endif
/* Saw -C or -o option, respectively. */
int saw_C = 0;
@@ -251,9 +250,6 @@ lang_specific_driver (in_argc, in_argv, in_added_libraries)
{
saw_C = 1;
want_spec_file = 0;
-#if COMBINE_INPUTS
- combine_inputs = 1;
-#endif
if (library != 0)
added -= 2;
library = 0;
@@ -308,6 +304,8 @@ lang_specific_driver (in_argc, in_argv, in_added_libraries)
will_link = 0;
continue;
}
+ else if (strcmp (argv[i], "-save-temps") == 0)
+ saw_save_temps = 1;
else if (strcmp (argv[i], "-static-libgcc") == 0
|| strcmp (argv[i], "-static") == 0)
shared_libgcc = 0;
@@ -317,9 +315,7 @@ lang_specific_driver (in_argc, in_argv, in_added_libraries)
}
else
{
-#if COMBINE_INPUTS
int len;
-#endif
if (saw_speclang)
{
@@ -327,23 +323,34 @@ lang_specific_driver (in_argc, in_argv, in_added_libraries)
continue;
}
-#if COMBINE_INPUTS
+ if (argv[i][0] == '@')
+ {
+ args[i] |= INDIRECT_FILE_ARG;
+ indirect_files_count++;
+ added += 2; /* for -xjava and -xnone */
+ }
+
len = strlen (argv[i]);
if (len > 5 && strcmp (argv[i] + len - 5, ".java") == 0)
{
args[i] |= JAVA_FILE_ARG;
java_files_count++;
- java_files_length += len;
last_input_index = i;
}
if (len > 6 && strcmp (argv[i] + len - 6, ".class") == 0)
{
args[i] |= CLASS_FILE_ARG;
class_files_count++;
- class_files_length += len;
last_input_index = i;
}
-#endif
+ if (len > 4
+ && (strcmp (argv[i] + len - 4, ".zip") == 0
+ || strcmp (argv[i] + len - 4, ".jar") == 0))
+ {
+ args[i] |= ZIP_FILE_ARG;
+ zip_files_count++;
+ last_input_index = i;
+ }
}
}
@@ -357,33 +364,36 @@ lang_specific_driver (in_argc, in_argv, in_added_libraries)
if (saw_C)
{
num_args += 3;
-#if COMBINE_INPUTS
- class_files_length = 0;
- num_args -= class_files_count;
+ if (class_files_count + zip_files_count > 0)
+ {
+ error ("Warning: already-compiled .class files ignored with -C");
+ num_args -= class_files_count + zip_files_count;
+ class_files_count = 0;
+ zip_files_count = 0;
+ }
num_args += 2; /* For -o NONE. */
-#endif
if (saw_o)
fatal ("cannot specify both -C and -o");
}
-#if COMBINE_INPUTS
- if (saw_o && java_files_count + (saw_C ? 0 : class_files_count) > 1)
+ if ((saw_o && java_files_count + class_files_count + zip_files_count > 1)
+ || (saw_C && java_files_count > 1)
+ || (indirect_files_count > 0
+ && java_files_count + class_files_count + zip_files_count > 0))
combine_inputs = 1;
if (combine_inputs)
{
- int len = java_files_length + java_files_count - 1;
- num_args -= java_files_count;
- num_args++; /* Add one for the combined arg. */
- if (class_files_length > 0)
- {
- len += class_files_length + class_files_count - 1;
- num_args -= class_files_count;
- }
- combined_inputs_buffer = (char*) xmalloc (len);
- combined_inputs_pos = 0;
+ filelist_filename = make_temp_file ("jx");
+ if (filelist_filename == NULL)
+ fatal ("cannot create temporary file");
+ record_temp_file (filelist_filename, ! saw_save_temps, 0);
+ filelist_file = fopen (filelist_filename, "w");
+ if (filelist_file == NULL)
+ pfatal_with_name (filelist_filename);
+ num_args -= java_files_count + class_files_count + zip_files_count;
+ num_args += 2; /* for the combined arg and "-xjava" */
}
/* If we know we don't have to do anything, bail now. */
-#endif
#if 0
if (! added && ! library && main_class_name == NULL && ! saw_C)
{
@@ -400,6 +410,11 @@ lang_specific_driver (in_argc, in_argv, in_added_libraries)
num_args++;
num_args++;
+ if (combine_inputs || indirect_files_count > 0)
+ num_args += 1; /* for "-ffilelist-file" */
+ if (combine_inputs && indirect_files_count > 0)
+ fatal("using both @FILE with multiple files not implemented");
+
/* There's no point adding -shared-libgcc if we don't have a shared
libgcc. */
#ifndef ENABLE_SHARED_LIBGCC
@@ -409,8 +424,9 @@ lang_specific_driver (in_argc, in_argv, in_added_libraries)
num_args += shared_libgcc;
arglist = (const char **) xmalloc ((num_args + 1) * sizeof (char *));
+ j = 0;
- for (i = 0, j = 0; i < argc; i++, j++)
+ for (i = 0; i < argc; i++, j++)
{
arglist[j] = argv[i];
@@ -420,20 +436,14 @@ lang_specific_driver (in_argc, in_argv, in_added_libraries)
if (strcmp (argv[i], "-classpath") == 0
|| strcmp (argv[i], "-CLASSPATH") == 0)
{
- char* patharg
- = (char*) xmalloc (strlen (argv[i]) + strlen (argv[i+1]) + 3);
- sprintf (patharg, "-f%s=%s", argv[i]+1, argv[i+1]);
- arglist[j] = patharg;
+ arglist[j] = concat ("-f", argv[i]+1, "=", argv[i+1], NULL);
i++;
continue;
}
if (strcmp (argv[i], "-d") == 0)
{
- char *patharg = (char *) xmalloc (sizeof ("-foutput-class-dir=")
- + strlen (argv[i + 1]) + 1);
- sprintf (patharg, "-foutput-class-dir=%s", argv[i + 1]);
- arglist[j] = patharg;
+ arglist[j] = concat ("-foutput-class-dir=", argv[i + 1], NULL);
++i;
continue;
}
@@ -449,35 +459,39 @@ lang_specific_driver (in_argc, in_argv, in_added_libraries)
continue;
}
- if ((args[i] & CLASS_FILE_ARG) && saw_C)
+ if ((args[i] & INDIRECT_FILE_ARG) != 0)
+ {
+ arglist[j++] = "-xjava";
+ arglist[j++] = argv[i]+1; /* Drop '@'. */
+ arglist[j] = "-xnone";
+ }
+
+ if ((args[i] & (CLASS_FILE_ARG|ZIP_FILE_ARG)) && saw_C)
{
--j;
continue;
}
-#if COMBINE_INPUTS
- if (combine_inputs && (args[i] & (CLASS_FILE_ARG|JAVA_FILE_ARG)) != 0)
+ if (combine_inputs
+ && (args[i] & (CLASS_FILE_ARG|JAVA_FILE_ARG|ZIP_FILE_ARG)) != 0)
{
- if (combined_inputs_pos > 0)
- combined_inputs_buffer[combined_inputs_pos++] = '&';
- strcpy (&combined_inputs_buffer[combined_inputs_pos], argv[i]);
- combined_inputs_pos += strlen (argv[i]);
+ fputs (argv[i], filelist_file);
+ fputc ('\n', filelist_file);
--j;
continue;
}
-#endif
}
-#if COMBINE_INPUTS
+ if (combine_inputs || indirect_files_count > 0)
+ arglist[j++] = "-ffilelist-file";
+
if (combine_inputs)
{
- combined_inputs_buffer[combined_inputs_pos] = '\0';
-#if 0
- if (! saw_C)
-#endif
- arglist[j++] = combined_inputs_buffer;
+ if (fclose (filelist_file))
+ pfatal_with_name (filelist_filename);
+ arglist[j++] = "-xjava";
+ arglist[j++] = filelist_filename;
}
-#endif
/* If we saw no -O or -g option, default to -g1, for javac compatibility. */
if (saw_g + saw_O == 0)
@@ -494,10 +508,8 @@ lang_specific_driver (in_argc, in_argv, in_added_libraries)
arglist[j++] = "-fsyntax-only";
arglist[j++] = "-femit-class-files";
arglist[j++] = "-S";
-#if COMBINE_INPUTS
arglist[j++] = "-o";
arglist[j++] = "NONE";
-#endif
}
if (shared_libgcc)
@@ -513,9 +525,29 @@ lang_specific_driver (in_argc, in_argv, in_added_libraries)
int
lang_specific_pre_link ()
{
+ int err;
if (main_class_name == NULL)
return 0;
- input_filename = main_class_name;
- input_filename_length = strlen (main_class_name);
- return do_spec (jvgenmain_spec);
+ /* Append `main' to make the filename unique and allow
+
+ gcj --main=hello -save-temps hello.java
+
+ to work. jvgenmain needs to strip this `main' to arrive at the correct
+ class name. Append dummy `.c' that can be stripped by set_input so %b
+ is correct. */
+ set_input (concat (main_class_name, "main.c", NULL));
+ err = do_spec (jvgenmain_spec);
+ if (err == 0)
+ {
+ /* Shift the outfiles array so the generated main comes first.
+ This is important when linking against (non-shared) libraries,
+ since otherwise we risk (a) nothing getting linked or
+ (b) 'main' getting picked up from a library. */
+ int i = n_infiles;
+ const char *generated = outfiles[i];
+ while (--i >= 0)
+ outfiles[i + 1] = outfiles[i];
+ outfiles[0] = generated;
+ }
+ return err;
}
diff --git a/gcc/java/lang-options.h b/gcc/java/lang-options.h
index ce6289cd4d7..7e8b1930507 100644
--- a/gcc/java/lang-options.h
+++ b/gcc/java/lang-options.h
@@ -28,23 +28,42 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */
DEFINE_LANG_NAME ("Java")
{ "-fbounds-check", "" },
- { "-fno-bounds-check", "Disable automatic array bounds checking" },
- { "-fassume-compiled", "Make is_compiled_class return 1"},
+ { "-fno-bounds-check",
+ N_("Disable automatic array bounds checking") },
+ { "-fassume-compiled",
+ N_("Make is_compiled_class return 1") },
{ "-fno-assume-compiled", "" },
{ "-femit-class-file", "" },
- { "-femit-class-files", "Dump class files to <name>.class" },
- { "-fuse-boehm-gc", "Generate code for Boehm GC" },
- { "-fhash-synchronization", "Don't put synchronization structure in each object" },
- { "-fjni", "Assume native functions are implemented using JNI" },
- { "--classpath", "Set class path and suppress system path" },
- { "--CLASSPATH", "Set class path" },
- { "--main", "Choose class whose main method should be used" },
- { "--encoding", "Choose input encoding (default is UTF-8)" },
- { "-I", "Add directory to class path" },
- { "-foutput-class-dir", "Directory where class files should be written" },
+ { "-femit-class-files",
+ N_("Dump class files to <name>.class") },
+ { "-ffilelist-file",
+ N_("input file is list of file names to compile") },
+ { "-fuse-boehm-gc",
+ N_("Generate code for Boehm GC") },
+ { "-fhash-synchronization",
+ N_("Don't put synchronization structure in each object") },
+ { "-fjni",
+ N_("Assume native functions are implemented using JNI") },
+ { "--classpath",
+ N_("Set class path and suppress system path") },
+ { "--CLASSPATH",
+ N_("Set class path") },
+ { "--main",
+ N_("Choose class whose main method should be used") },
+ { "--encoding",
+ N_("Choose input encoding (default is UTF-8)") },
+ { "-I",
+ N_("Add directory to class path") },
+ { "-foutput-class-dir",
+ N_("Directory where class files should be written") },
{ "-fuse-divide-subroutine", "" },
- { "-fno-use-divide-subroutine", "Use built-in instructions for division" },
+ { "-fno-use-divide-subroutine",
+ N_("Use built-in instructions for division") },
{ "-Wredundant-modifiers",
- "Warn if modifiers are specified when not necessary"},
- { "-Wextraneous-semicolon", "Warn if deprecated empty statements are found"},
- { "-Wout-of-date", "Warn if .class files are out of date" },
+ N_("Warn if modifiers are specified when not necessary") },
+ { "-Wextraneous-semicolon",
+ N_("Warn if deprecated empty statements are found") },
+ { "-Wout-of-date",
+ N_("Warn if .class files are out of date") },
+ { "-fforce-classes-archive-check",
+ N_("Always check for non gcj generated classes archives") },
diff --git a/gcc/java/lang-specs.h b/gcc/java/lang-specs.h
index d7cc59b65d5..fa139aa24ec 100644
--- a/gcc/java/lang-specs.h
+++ b/gcc/java/lang-specs.h
@@ -25,14 +25,14 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */
/* This is the contribution to the `default_compilers' array in gcc.c for
Java. */
- {".java", "@java" },
- {".class", "@java" },
- {".zip", "@java" },
- {".jar", "@java" },
+ {".java", "@java" , 0},
+ {".class", "@java" , 0},
+ {".zip", "@java" , 0},
+ {".jar", "@java" , 0},
{"@java",
"%{fjni:%{femit-class-files:%e-fjni and -femit-class-files are incompatible}}\
%{fjni:%{femit-class-file:%e-fjni and -femit-class-file are incompatible}}\
%{!E:jc1 %i %(jc1) %(cc1_options) %{+e*} %{I*}\
%{MD} %{MMD} %{M} %{MM} %{MA} %{MT*} %{MF*}\
- %{!fsyntax-only:%(invoke_as)}}"},
+ %{!fsyntax-only:%(invoke_as)}}", 0},
diff --git a/gcc/java/lang.c b/gcc/java/lang.c
index e69151a2a3c..3a966365aba 100644
--- a/gcc/java/lang.c
+++ b/gcc/java/lang.c
@@ -105,6 +105,10 @@ int flag_assume_compiled = 1;
int flag_emit_class_files = 0;
+/* Nonzero if input file is a file with a list of filenames to compile. */
+
+int flag_filelist_file = 0;
+
/* When non zero, we emit xref strings. Values of the flag for xref
backends are defined in xref_flag_table, xref.c. */
@@ -140,10 +144,8 @@ const char *current_encoding = NULL;
/* When non zero, report the now deprecated empty statements. */
int flag_extraneous_semicolon;
-/* From gcc/flags.h, and indicates if exceptions are turned on or not. */
-
-extern int flag_new_exceptions;
-extern int flag_exceptions;
+/* When non zero, always check for a non gcj generated classes archive. */
+int flag_force_classes_archive_check;
/* Table of language-dependent -f options.
STRING is the option name. VARIABLE is the address of the variable.
@@ -156,10 +158,12 @@ lang_f_options[] =
{
{"emit-class-file", &flag_emit_class_files, 1},
{"emit-class-files", &flag_emit_class_files, 1},
+ {"filelist-file", &flag_filelist_file, 1},
{"use-divide-subroutine", &flag_use_divide_subroutine, 1},
{"use-boehm-gc", &flag_use_boehm_gc, 1},
{"hash-synchronization", &flag_hash_synchronization, 1},
- {"jni", &flag_jni, 1}
+ {"jni", &flag_jni, 1},
+ {"force-classes-archive-check", &flag_force_classes_archive_check, 1}
};
static struct string_option
@@ -643,8 +647,6 @@ java_init ()
print_error_function = lang_print_error;
lang_expand_expr = java_lang_expand_expr;
- flag_exceptions = 1;
-
/* Append to Gcc tree node definition arrays */
memcpy (tree_code_type + (int) LAST_AND_UNUSED_TREE_CODE,
@@ -691,8 +693,9 @@ void lang_init_source (level)
static void
java_init_options ()
{
- flag_new_exceptions = 1;
flag_bounds_check = 1;
+ flag_exceptions = 1;
+ flag_non_call_exceptions = 1;
}
const char *
diff --git a/gcc/java/lex.c b/gcc/java/lex.c
index 20e37d8183e..a16cf13c72a 100644
--- a/gcc/java/lex.c
+++ b/gcc/java/lex.c
@@ -120,7 +120,7 @@ java_init_lex (finput, encoding)
wfl_to_string = build_expr_wfl (get_identifier ("toString"), NULL, 0, 0);
CPC_INITIALIZER_LIST (ctxp) = CPC_STATIC_INITIALIZER_LIST (ctxp) =
- CPC_INSTANCE_INITIALIZER_LIST (ctxp) = ctxp->incomplete_class = NULL_TREE;
+ CPC_INSTANCE_INITIALIZER_LIST (ctxp) = NULL_TREE;
memset ((PTR) ctxp->modifier_ctx, 0, 11*sizeof (ctxp->modifier_ctx[0]));
memset ((PTR) current_jcf, 0, sizeof (JCF));
@@ -268,7 +268,9 @@ java_new_lexer (finput, encoding)
outp = (char *) &result;
outc = 2;
- r = iconv (handle, (const char **) &inp, &inc, &outp, &outc);
+ r = iconv (handle, (ICONV_CONST char **) &inp, &inc,
+ &outp, &outc);
+ iconv_close (handle);
/* Conversion must be complete for us to use the result. */
if (r != (size_t) -1 && inc == 0 && outc == 0)
need_byteswap = (result != 0xfeff);
@@ -369,8 +371,8 @@ java_read_char (lex)
out_save = out_count;
inp = &lex->buffer[lex->first];
outp = &lex->out_buffer[lex->out_last];
- ir = iconv (lex->handle, (const char **) &inp, &inbytesleft,
- &outp, &out_count);
+ ir = iconv (lex->handle, (ICONV_CONST char **) &inp,
+ &inbytesleft, &outp, &out_count);
/* If we haven't read any bytes, then look to see if we
have read a BOM. */
@@ -532,6 +534,16 @@ java_read_unicode (lex, unicode_escape_p)
{
unicode_t unicode = 0;
int shift = 12;
+
+ /* Recognize any number of `u's in \u. */
+ while ((c = java_read_char (lex)) == 'u')
+ ;
+
+ /* Unget the most recent character as it is not a `u'. */
+ if (c == UEOF)
+ return UEOF;
+ lex->unget_value = c;
+
/* Next should be 4 hex digits, otherwise it's an error.
The hex value is converted into the unicode, pushed into
the Unicode stream. */
@@ -543,11 +555,6 @@ java_read_unicode (lex, unicode_escape_p)
unicode |= (unicode_t)((c-'0') << shift);
else if ((c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F'))
unicode |= (unicode_t)((10+(c | 0x20)-'a') << shift);
- else if (c == 'u')
- {
- /* Recognize any number of u in \u. */
- shift += 4;
- }
else
java_lex_error ("Non hex digit in Unicode escape sequence", 0);
}
@@ -1797,37 +1804,110 @@ utf8_cmp (str, length, name)
static const char *cxx_keywords[] =
{
+ "_Complex",
+ "__alignof",
+ "__alignof__",
+ "__asm",
+ "__asm__",
+ "__attribute",
+ "__attribute__",
+ "__builtin_va_arg",
+ "__complex",
+ "__complex__",
+ "__const",
+ "__const__",
+ "__extension__",
+ "__imag",
+ "__imag__",
+ "__inline",
+ "__inline__",
+ "__label__",
+ "__null",
+ "__real",
+ "__real__",
+ "__restrict",
+ "__restrict__",
+ "__signed",
+ "__signed__",
+ "__typeof",
+ "__typeof__",
+ "__volatile",
+ "__volatile__",
"asm",
+ "and",
+ "and_eq",
"auto",
+ "bitand",
+ "bitor",
"bool",
+ "break",
+ "case",
+ "catch",
+ "char",
+ "class",
+ "compl",
+ "const",
"const_cast",
+ "continue",
+ "default",
"delete",
+ "do",
+ "double",
"dynamic_cast",
+ "else",
"enum",
"explicit",
+ "export",
"extern",
+ "false",
+ "float",
+ "for",
"friend",
+ "goto",
+ "if",
"inline",
+ "int",
+ "long",
"mutable",
"namespace",
- "overload",
+ "new",
+ "not",
+ "not_eq",
+ "operator",
+ "or",
+ "or_eq",
+ "private",
+ "protected",
+ "public",
"register",
"reinterpret_cast",
+ "return",
+ "short",
"signed",
"sizeof",
+ "static",
"static_cast",
"struct",
+ "switch",
"template",
+ "this",
+ "throw",
+ "true",
+ "try",
"typedef",
- "typeid",
"typename",
- "typenameopt",
+ "typeid",
+ "typeof",
"union",
"unsigned",
"using",
"virtual",
+ "void",
"volatile",
- "wchar_t"
+ "wchar_t",
+ "while",
+ "xor",
+ "xor_eq"
};
/* Return true if NAME is a C++ keyword. */
diff --git a/gcc/java/lex.h b/gcc/java/lex.h
index 7934b50f592..a2bc07ae228 100644
--- a/gcc/java/lex.h
+++ b/gcc/java/lex.h
@@ -1,5 +1,5 @@
/* Language lexer definitions for the GNU compiler for the Java(TM) language.
- Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
Contributed by Alexandre Petit-Bianco (apbianco@cygnus.com)
This file is part of GNU CC.
@@ -35,7 +35,7 @@ extern int lineno;
/* A Unicode character, as read from the input file */
typedef unsigned short unicode_t;
-#ifdef HAVE_ICONV_H
+#ifdef HAVE_ICONV
#include <iconv.h>
#endif /* HAVE_ICONV */
diff --git a/gcc/java/mangle.c b/gcc/java/mangle.c
index b78e242da18..027eb5d5bab 100644
--- a/gcc/java/mangle.c
+++ b/gcc/java/mangle.c
@@ -93,7 +93,7 @@ java_mangle_class_field (obstack, type)
tree type;
{
init_mangling (obstack);
- mangle_record_type (type, /* from_pointer = */ 0);
+ mangle_record_type (type, /* for_pointer = */ 0);
MANGLE_RAW_STRING ("6class$");
obstack_1grow (mangle_obstack, 'E');
return finish_mangling ();
@@ -106,7 +106,7 @@ java_mangle_vtable (obstack, type)
{
init_mangling (obstack);
MANGLE_RAW_STRING ("TV");
- mangle_record_type (type, /* from_pointer = */ 0);
+ mangle_record_type (type, /* for_pointer = */ 0);
obstack_1grow (mangle_obstack, 'E');
return finish_mangling ();
}
@@ -120,7 +120,7 @@ mangle_field_decl (decl)
tree decl;
{
/* Mangle the name of the this the field belongs to */
- mangle_record_type (DECL_CONTEXT (decl), /* from_pointer = */ 0);
+ mangle_record_type (DECL_CONTEXT (decl), /* for_pointer = */ 0);
/* Mangle the name of the field */
mangle_member_name (DECL_NAME (decl));
@@ -140,7 +140,7 @@ mangle_method_decl (mdecl)
tree arglist;
/* Mangle the name of the type that contains mdecl */
- mangle_record_type (DECL_CONTEXT (mdecl), /* from_pointer = */ 0);
+ mangle_record_type (DECL_CONTEXT (mdecl), /* for_pointer = */ 0);
/* Mangle the function name. There three cases
- mdecl is java.lang.Object.Object(), use `C2' for its name
@@ -314,7 +314,7 @@ find_compression_record_match (type, next_current)
tree *next_current;
{
int i, match;
- tree current, saved_current;
+ tree current, saved_current = NULL_TREE;
/* Search from the beginning for something that matches TYPE, even
partially. */
@@ -347,16 +347,21 @@ find_compression_record_match (type, next_current)
/* Mangle a record type. If a non zero value is returned, it means
that a 'N' was emitted (so that a matching 'E' can be emitted if
- necessary.) */
+ necessary.) FOR_POINTER indicates that this element is for a pointer
+ symbol, meaning it was preceded by a 'P'. */
static int
-mangle_record_type (type, from_pointer)
+mangle_record_type (type, for_pointer)
tree type;
- int from_pointer;
+ int for_pointer;
{
tree current;
int match;
int nadded_p = 0;
+ int qualified;
+
+ /* Does this name have a package qualifier? */
+ qualified = QUALIFIED_P (DECL_NAME (TYPE_NAME (type)));
#define ADD_N() \
do { obstack_1grow (mangle_obstack, 'N'); nadded_p = 1; } while (0)
@@ -371,8 +376,8 @@ mangle_record_type (type, from_pointer)
if (match >= 0)
{
/* If we had a pointer, and there's more, we need to emit
- 'N' after 'P' (from pointer tells us we already emitted it.) */
- if (from_pointer && current)
+ 'N' after 'P' (for_pointer tells us we already emitted it.) */
+ if (for_pointer && current)
ADD_N();
emit_compression_string (match);
}
@@ -380,8 +385,9 @@ mangle_record_type (type, from_pointer)
{
/* Add the new type to the table */
compression_table_add (TREE_PURPOSE (current));
- /* Add 'N' if we never got a chance to. */
- if (!nadded_p)
+ /* Add 'N' if we never got a chance to, but only if we have a qualified
+ name. For non-pointer elements, the name is always qualified. */
+ if ((qualified || !for_pointer) && !nadded_p)
ADD_N();
/* Use the bare type name for the mangle. */
append_gpp_mangled_name (IDENTIFIER_POINTER (TREE_VALUE (current)),
diff --git a/gcc/java/parse-scan.y b/gcc/java/parse-scan.y
index 20522da4e37..28d7946c11f 100644
--- a/gcc/java/parse-scan.y
+++ b/gcc/java/parse-scan.y
@@ -242,14 +242,15 @@ interface_type:
;
array_type:
- primitive_type OSB_TK CSB_TK
-| name OSB_TK CSB_TK
+ primitive_type dims
{
- $$ = concat ("[", $1, NULL);
+ while (bracket_count-- > 0)
+ $$ = concat ("[", $1, NULL);
}
-| array_type OSB_TK CSB_TK
- {
- $$ = concat ("[", $1, NULL);
+| name dims
+ {
+ while (bracket_count-- > 0)
+ $$ = concat ("[", $1, NULL);
}
;
@@ -316,7 +317,7 @@ type_import_on_demand_declaration:
type_declaration:
class_declaration
| interface_declaration
-| SC_TK
+| empty_statement
;
/* 19.7 Shortened from the original:
@@ -393,6 +394,7 @@ class_member_declaration:
| method_declaration
| class_declaration /* Added, JDK1.1 inner classes */
| interface_declaration /* Added, JDK1.1 inner classes */
+| empty_statement
;
/* 19.8.2 Productions from 8.3: Field Declarations */
@@ -513,14 +515,12 @@ class_type_list:
method_body:
block
-| block SC_TK
| SC_TK
;
/* 19.8.4 Productions from 8.5: Static Initializers */
static_initializer:
static block
-| static block SC_TK /* Shouldn't be here. FIXME */
;
static: /* Test lval.sub_token here */
@@ -892,14 +892,7 @@ primary_no_new_array:
| field_access
| method_invocation
| array_access
- /* type DOT_TK CLASS_TK doens't work. So we split the rule
- 'type' into its components. Missing is something for array,
- which will complete the reference_type part. FIXME */
-| name DOT_TK CLASS_TK /* Added, JDK1.1 class literals */
- { USE_ABSORBER; }
-| primitive_type DOT_TK CLASS_TK /* Added, JDK1.1 class literals */
- { USE_ABSORBER; }
-| VOID_TK DOT_TK CLASS_TK /* Added, JDK1.1 class literals */
+| type_literals
/* Added, JDK1.1 inner classes. Documentation is wrong
refering to a 'ClassName' (class_name) rule that doesn't
exist. Used name instead. */
@@ -907,6 +900,17 @@ primary_no_new_array:
{ USE_ABSORBER; }
;
+type_literals:
+ name DOT_TK CLASS_TK
+ { USE_ABSORBER; }
+| array_type DOT_TK CLASS_TK
+ { USE_ABSORBER; }
+| primitive_type DOT_TK CLASS_TK
+ { USE_ABSORBER; }
+| VOID_TK DOT_TK CLASS_TK
+ { USE_ABSORBER; }
+;
+
class_instance_creation_expression:
NEW_TK class_type OP_TK argument_list CP_TK
| NEW_TK class_type OP_TK CP_TK
@@ -960,7 +964,9 @@ dim_expr:
dims:
OSB_TK CSB_TK
+ { bracket_count = 1; }
| dims OSB_TK CSB_TK
+ { bracket_count++; }
;
field_access:
diff --git a/gcc/java/parse.h b/gcc/java/parse.h
index dc2590708ce..d17dbc0d1cb 100644
--- a/gcc/java/parse.h
+++ b/gcc/java/parse.h
@@ -494,7 +494,6 @@ typedef struct _jdep {
#define JDEP_DECL(J) ((J)->decl)
#define JDEP_DECL_WFL(J) ((J)->decl)
#define JDEP_KIND(J) ((J)->kind)
-#define JDEP_SOLV(J) ((J)->solv)
#define JDEP_WFL(J) ((J)->wfl)
#define JDEP_MISC(J) ((J)->misc)
#define JDEP_ENCLOSING(J) ((J)->enclosing)
@@ -603,10 +602,6 @@ typedef struct _jdeplist {
#define GET_CURRENT_BLOCK(F) ((F) ? DECL_FUNCTION_BODY ((F)) : \
current_static_block)
-/* For an artificial BLOCK (created to house a local variable declaration not
- at the start of an existing block), the parent block; otherwise NULL. */
-#define BLOCK_EXPR_ORIGIN(NODE) BLOCK_ABSTRACT_ORIGIN(NODE)
-
/* Merge an other line to the source line number of a decl. Used to
remember function's end. */
#define DECL_SOURCE_LINE_MERGE(DECL,NO) DECL_SOURCE_LINE(DECL) |= (NO << 16)
@@ -666,21 +661,13 @@ typedef struct _jdeplist {
build_new_invocation (wfl_string_buffer, \
(ARG ? build_tree_list (NULL, (ARG)) : NULL_TREE))
-/* For exception handling, build diverse function calls */
-#define BUILD_ASSIGN_EXCEPTION_INFO(WHERE, TO) \
- { \
- (WHERE) = build (MODIFY_EXPR, void_type_node, (TO), \
- soft_exceptioninfo_call_node); \
- TREE_SIDE_EFFECTS (WHERE) = 1; \
- }
-
-#define BUILD_THROW(WHERE, WHAT) \
- { \
- (WHERE) = \
- build (CALL_EXPR, void_type_node, \
- build_address_of (throw_node[exceptions_via_longjmp ? 1 : 0]), \
- build_tree_list (NULL_TREE, (WHAT)), NULL_TREE); \
- TREE_SIDE_EFFECTS ((WHERE)) = 1; \
+#define BUILD_THROW(WHERE, WHAT) \
+ { \
+ (WHERE) = \
+ build (CALL_EXPR, void_type_node, \
+ build_address_of (throw_node), \
+ build_tree_list (NULL_TREE, (WHAT)), NULL_TREE); \
+ TREE_SIDE_EFFECTS ((WHERE)) = 1; \
}
/* Set wfl_operator for the most accurate error location */
@@ -725,7 +712,7 @@ typedef struct _jdeplist {
#define CURRENT_OSB(C) (C)->osb_number [(C)->osb_depth]
/* Macro for the xreferencer */
-#define DECL_END_SOURCE_LINE(DECL) DECL_FRAME_SIZE (DECL)
+#define DECL_END_SOURCE_LINE(DECL) (DECL_CHECK (DECL)->decl.u1.i)
#define DECL_INHERITED_SOURCE_LINE(DECL) (DECL_CHECK (DECL)->decl.u2.i)
/* Parser context data structure. */
@@ -780,10 +767,6 @@ struct parser_ctxt {
tree package; /* Defined package ID */
- /* Those two list are saved accross file traversal */
- tree incomplete_class; /* List of non-complete classes */
- tree gclass_list; /* All classes seen from source code */
-
/* These two lists won't survive file traversal */
tree class_list; /* List of classes in a CU */
jdeplist *classd_list; /* Classe dependencies in a CU */
@@ -947,4 +930,7 @@ ATTRIBUTE_NORETURN
#endif
;
extern void java_expand_classes PARAMS ((void));
+
+extern struct parser_ctxt *ctxp;
+struct parser_ctxt *ctxp_for_generation;
#endif
diff --git a/gcc/java/parse.y b/gcc/java/parse.y
index 6ffa3357c77..782b6aa131f 100644
--- a/gcc/java/parse.y
+++ b/gcc/java/parse.y
@@ -116,7 +116,6 @@ static tree resolve_class PARAMS ((tree, tree, tree, tree));
static void declare_local_variables PARAMS ((int, tree, tree));
static void source_start_java_method PARAMS ((tree));
static void source_end_java_method PARAMS ((void));
-static void expand_start_java_method PARAMS ((tree));
static tree find_name_in_single_imports PARAMS ((tree));
static void check_abstract_method_header PARAMS ((tree));
static tree lookup_java_interface_method2 PARAMS ((tree, tree));
@@ -124,9 +123,10 @@ static tree resolve_expression_name PARAMS ((tree, tree *));
static tree maybe_create_class_interface_decl PARAMS ((tree, tree, tree, tree));
static int check_class_interface_creation PARAMS ((int, int, tree,
tree, tree, tree));
-static tree patch_method_invocation PARAMS ((tree, tree, tree,
+static tree patch_method_invocation PARAMS ((tree, tree, tree, int,
int *, tree *));
static int breakdown_qualified PARAMS ((tree *, tree *, tree));
+static int in_same_package PARAMS ((tree, tree));
static tree resolve_and_layout PARAMS ((tree, tree));
static tree qualify_and_find PARAMS ((tree, tree, tree));
static tree resolve_no_layout PARAMS ((tree, tree));
@@ -152,7 +152,6 @@ static int unresolved_type_p PARAMS ((tree, tree *));
static void create_jdep_list PARAMS ((struct parser_ctxt *));
static tree build_expr_block PARAMS ((tree, tree));
static tree enter_block PARAMS ((void));
-static tree enter_a_block PARAMS ((tree));
static tree exit_block PARAMS ((void));
static tree lookup_name_in_blocks PARAMS ((tree));
static void maybe_absorb_scoping_blocks PARAMS ((void));
@@ -197,7 +196,7 @@ static tree maybe_access_field PARAMS ((tree, tree, tree));
static int complete_function_arguments PARAMS ((tree));
static int check_for_static_method_reference PARAMS ((tree, tree, tree,
tree, tree));
-static int not_accessible_p PARAMS ((tree, tree, int));
+static int not_accessible_p PARAMS ((tree, tree, tree, int));
static void check_deprecation PARAMS ((tree, tree));
static int class_in_current_package PARAMS ((tree));
static tree build_if_else_statement PARAMS ((int, tree, tree, tree));
@@ -239,6 +238,7 @@ static const char *get_printable_method_name PARAMS ((tree));
static tree patch_conditional_expr PARAMS ((tree, tree, tree));
static tree generate_finit PARAMS ((tree));
static void add_instance_initializer PARAMS ((tree));
+static tree build_instance_initializer PARAMS ((tree));
static void fix_constructors PARAMS ((tree));
static tree build_alias_initializer_parameter_list PARAMS ((int, tree,
tree, int *));
@@ -330,6 +330,7 @@ static tree build_dot_class_method PARAMS ((tree));
static tree build_dot_class_method_invocation PARAMS ((tree));
static void create_new_parser_context PARAMS ((int));
static void mark_parser_ctxt PARAMS ((void *));
+static tree maybe_build_class_init_for_field PARAMS ((tree, tree));
/* Number of error found so far. */
int java_error_count;
@@ -347,7 +348,7 @@ static int in_instance_initializer;
struct parser_ctxt *ctxp;
/* List of things that were analyzed for which code will be generated */
-static struct parser_ctxt *ctxp_for_generation = NULL;
+struct parser_ctxt *ctxp_for_generation = NULL;
/* binop_lookup maps token to tree_code. It is used where binary
operations are involved and required by the parser. RDIV_EXPR
@@ -410,6 +411,11 @@ static tree current_this;
the list of the catch clauses of the currently analysed try block. */
static tree currently_caught_type_list;
+static tree src_parse_roots[1] = { NULL_TREE };
+
+/* All classes seen from source code */
+#define gclass_list src_parse_roots[0]
+
/* Check modifiers. If one doesn't fit, retrieve it in its declaration
line and point it out. */
/* Should point out the one that don't fit. ASCII/unicode, going
@@ -660,7 +666,6 @@ array_type:
{
int osb = pop_current_osb (ctxp);
tree t = build_java_array_type (($1), -1);
- CLASS_LOADED_P (t) = 1;
while (--osb)
t = build_unresolved_array_type (t);
$$ = t;
@@ -1881,9 +1886,9 @@ catch_clause_parameter:
declared initialized by the appropriate function
call */
tree ccpb = enter_block ();
- tree init = build_assignment (ASSIGN_TK, $2.location,
- TREE_PURPOSE ($3),
- soft_exceptioninfo_call_node);
+ tree init = build_assignment
+ (ASSIGN_TK, $2.location, TREE_PURPOSE ($3),
+ build (JAVA_EXC_OBJ_EXPR, ptr_type_node));
declare_local_variables (0, TREE_VALUE ($3),
build_tree_list (TREE_PURPOSE ($3),
init));
@@ -1949,9 +1954,12 @@ type_literals:
| array_type DOT_TK CLASS_TK
{ $$ = build_incomplete_class_ref ($2.location, $1); }
| primitive_type DOT_TK CLASS_TK
- { $$ = build_class_ref ($1); }
+ { $$ = build_incomplete_class_ref ($2.location, $1); }
| VOID_TK DOT_TK CLASS_TK
- { $$ = build_class_ref (void_type_node); }
+ {
+ $$ = build_incomplete_class_ref ($2.location,
+ void_type_node);
+ }
;
class_instance_creation_expression:
@@ -2639,11 +2647,6 @@ void
java_push_parser_context ()
{
create_new_parser_context (0);
- if (ctxp->next)
- {
- ctxp->incomplete_class = ctxp->next->incomplete_class;
- ctxp->gclass_list = ctxp->next->gclass_list;
- }
}
void
@@ -2660,8 +2663,6 @@ java_pop_parser_context (generate)
next = ctxp->next;
if (next)
{
- next->incomplete_class = ctxp->incomplete_class;
- next->gclass_list = ctxp->gclass_list;
lineno = ctxp->lineno;
current_class = ctxp->class_type;
}
@@ -2673,12 +2674,12 @@ java_pop_parser_context (generate)
/* Set the single import class file flag to 0 for the current list
of imported things */
for (current = ctxp->import_list; current; current = TREE_CHAIN (current))
- IS_A_SINGLE_IMPORT_CLASSFILE_NAME_P (TREE_PURPOSE (current)) = 0;
+ IS_A_SINGLE_IMPORT_CLASSFILE_NAME_P (TREE_VALUE (current)) = 0;
/* And restore those of the previous context */
if ((ctxp = next)) /* Assignment is really meant here */
for (current = ctxp->import_list; current; current = TREE_CHAIN (current))
- IS_A_SINGLE_IMPORT_CLASSFILE_NAME_P (TREE_PURPOSE (current)) = 1;
+ IS_A_SINGLE_IMPORT_CLASSFILE_NAME_P (TREE_VALUE (current)) = 1;
/* If we pushed a context to parse a class intended to be generated,
we keep it so we can remember the class. What we could actually
@@ -2775,8 +2776,6 @@ java_parser_context_resume ()
struct parser_ctxt *restored = saver->next; /* This one is the old current */
/* We need to inherit the list of classes to complete/generate */
- restored->incomplete_class = old->incomplete_class;
- restored->gclass_list = old->gclass_list;
restored->classd_list = old->classd_list;
restored->class_list = old->class_list;
@@ -3258,6 +3257,8 @@ build_array_from_name (type, type_wfl, name, ret_name)
/* If we have, then craft a new type for this variable */
if (more_dims)
{
+ tree save = type;
+
name = get_identifier (&string [more_dims]);
/* If we have a pointer, use its type */
@@ -3269,14 +3270,20 @@ build_array_from_name (type, type_wfl, name, ret_name)
if (JPRIMITIVE_TYPE_P (type))
{
type = build_java_array_type (type, -1);
- CLASS_LOADED_P (type) = 1;
more_dims--;
}
/* Otherwise, if we have a WFL for this type, use it (the type
is already an array on an unresolved type, and we just keep
on adding dimensions) */
else if (type_wfl)
- type = type_wfl;
+ {
+ int i = 0;
+ type = type_wfl;
+ string = IDENTIFIER_POINTER (TYPE_NAME (save));
+ while (string[i] == '[')
+ ++i;
+ more_dims += i;
+ }
/* Add all the dimensions */
while (more_dims--)
@@ -3301,23 +3308,26 @@ build_unresolved_array_type (type_or_wfl)
tree type_or_wfl;
{
const char *ptr;
+ tree wfl;
/* TYPE_OR_WFL might be an array on a resolved type. In this case,
just create a array type */
if (TREE_CODE (type_or_wfl) == RECORD_TYPE)
- {
- tree type = build_java_array_type (type_or_wfl, -1);
- CLASS_LOADED_P (type) = CLASS_LOADED_P (type_or_wfl);
- return type;
- }
+ return build_java_array_type (type_or_wfl, -1);
obstack_1grow (&temporary_obstack, '[');
obstack_grow0 (&temporary_obstack,
IDENTIFIER_POINTER (EXPR_WFL_NODE (type_or_wfl)),
IDENTIFIER_LENGTH (EXPR_WFL_NODE (type_or_wfl)));
ptr = obstack_finish (&temporary_obstack);
- EXPR_WFL_NODE (type_or_wfl) = get_identifier (ptr);
- return type_or_wfl;
+ wfl = build_expr_wfl (get_identifier (ptr),
+ EXPR_WFL_FILENAME (type_or_wfl),
+ EXPR_WFL_LINENO (type_or_wfl),
+ EXPR_WFL_COLNO (type_or_wfl));
+ /* Re-install the existing qualifications so that the type can be
+ resolved properly. */
+ EXPR_WFL_QUALIFICATION (wfl) = EXPR_WFL_QUALIFICATION (type_or_wfl);
+ return wfl;
}
static void
@@ -3526,7 +3536,18 @@ find_as_inner_class (enclosing, name, cl)
acc = merge_qualified_name (acc,
EXPR_WFL_NODE (TREE_PURPOSE (qual)));
BUILD_PTR_FROM_NAME (ptr, acc);
- decl = do_resolve_class (NULL_TREE, ptr, NULL_TREE, cl);
+
+ /* Don't try to resolve ACC as a class name if it follows
+ the current package name. We don't want to pick something
+ that's accidentally there: for example `a.b.c' in package
+ `a.b' shouldn't trigger loading `a' if it's there by
+ itself. */
+ if (ctxp->package
+ && strstr (IDENTIFIER_POINTER (ctxp->package),
+ IDENTIFIER_POINTER (acc)))
+ decl = NULL;
+ else
+ decl = do_resolve_class (NULL_TREE, ptr, NULL_TREE, cl);
}
/* A NULL qual and a decl means that the search ended
@@ -3640,7 +3661,8 @@ maybe_create_class_interface_decl (decl, raw_name, qualified_name, cl)
else
DECL_SOURCE_LINE (decl) = EXPR_WFL_LINENO (cl);
CLASS_FROM_SOURCE_P (TREE_TYPE (decl)) = 1;
- CLASS_FROM_CURRENTLY_COMPILED_SOURCE_P (TREE_TYPE (decl)) =
+ CLASS_PARSED_P (TREE_TYPE (decl)) = 1;
+ CLASS_FROM_CURRENTLY_COMPILED_P (TREE_TYPE (decl)) =
IS_A_COMMAND_LINE_FILENAME_P (EXPR_WFL_FILENAME_NODE (cl));
PUSH_CPC (decl, raw_name);
@@ -3651,7 +3673,7 @@ maybe_create_class_interface_decl (decl, raw_name, qualified_name, cl)
ctxp->class_list = decl;
/* Create a new nodes in the global lists */
- ctxp->gclass_list = tree_cons (NULL_TREE, decl, ctxp->gclass_list);
+ gclass_list = tree_cons (NULL_TREE, decl, gclass_list);
all_class_list = tree_cons (NULL_TREE, decl, all_class_list);
/* Install a new dependency list element */
@@ -4060,7 +4082,7 @@ lookup_field_wrapper (class, name)
/* Last chance: if we're within the context of an inner class, we
might be trying to access a local variable defined in an outer
context. We try to look for it now. */
- if (INNER_CLASS_TYPE_P (class))
+ if (INNER_CLASS_TYPE_P (class) && TREE_CODE (name) == IDENTIFIER_NODE)
{
tree new_name;
MANGLE_OUTER_LOCAL_VARIABLE_NAME (new_name, name);
@@ -4295,22 +4317,29 @@ generate_finit (class_type)
return mdecl;
}
-static void
-add_instance_initializer (mdecl)
+static tree
+build_instance_initializer (mdecl)
tree mdecl;
{
- tree current;
- tree stmt_list = TYPE_II_STMT_LIST (DECL_CONTEXT (mdecl));
tree compound = NULL_TREE;
+ tree stmt_list = TYPE_II_STMT_LIST (DECL_CONTEXT (mdecl));
+ tree current;
- if (stmt_list)
- {
- for (current = stmt_list; current; current = TREE_CHAIN (current))
- compound = add_stmt_to_compound (compound, NULL_TREE, current);
+ for (current = stmt_list; current; current = TREE_CHAIN (current))
+ compound = add_stmt_to_compound (compound, NULL_TREE, current);
- java_method_add_stmt (mdecl, build1 (INSTANCE_INITIALIZERS_EXPR,
- NULL_TREE, compound));
- }
+ return compound;
+}
+
+static void
+add_instance_initializer (mdecl)
+ tree mdecl;
+{
+ tree compound = build_instance_initializer (mdecl);
+
+ if (compound)
+ java_method_add_stmt (mdecl, build1 (INSTANCE_INITIALIZERS_EXPR,
+ NULL_TREE, compound));
}
/* Shared accros method_declarator and method_header to remember the
@@ -4895,8 +4924,10 @@ parser_check_super_interface (super_decl, this_decl, this_wfl)
return 1;
}
- /* Check scope: same package OK, other package: OK if public */
- if (check_pkg_class_access (DECL_NAME (super_decl), lookup_cl (this_decl)))
+ /* Check top-level interface access. Inner classes are subject to member
+ access rules (6.6.1). */
+ if (! INNER_CLASS_P (super_type)
+ && check_pkg_class_access (DECL_NAME (super_decl), lookup_cl (this_decl)))
return 1;
SOURCE_FRONTEND_DEBUG (("Completing interface %s with %s",
@@ -4932,8 +4963,10 @@ parser_check_super (super_decl, this_decl, wfl)
return 1;
}
- /* Check scope: same package OK, other package: OK if public */
- if (check_pkg_class_access (DECL_NAME (super_decl), wfl))
+ /* Check top-level class scope. Inner classes are subject to member access
+ rules (6.6.1). */
+ if (! INNER_CLASS_P (super_type)
+ && (check_pkg_class_access (DECL_NAME (super_decl), wfl)))
return 1;
SOURCE_FRONTEND_DEBUG (("Completing class %s with %s",
@@ -4977,7 +5010,7 @@ static tree
obtain_incomplete_type (type_name)
tree type_name;
{
- tree ptr, name;
+ tree ptr = NULL_TREE, name;
if (TREE_CODE (type_name) == EXPR_WITH_FILE_LOCATION)
name = EXPR_WFL_NODE (type_name);
@@ -4986,17 +5019,8 @@ obtain_incomplete_type (type_name)
else
abort ();
- for (ptr = ctxp->incomplete_class; ptr; ptr = TREE_CHAIN (ptr))
- if (TYPE_NAME (ptr) == name)
- break;
-
- if (!ptr)
- {
- BUILD_PTR_FROM_NAME (ptr, name);
- layout_type (ptr);
- TREE_CHAIN (ptr) = ctxp->incomplete_class;
- ctxp->incomplete_class = ptr;
- }
+ BUILD_PTR_FROM_NAME (ptr, name);
+ layout_type (ptr);
return ptr;
}
@@ -5018,7 +5042,7 @@ register_incomplete_type (kind, wfl, decl, ptr)
JDEP_KIND (new) = kind;
JDEP_DECL (new) = decl;
- JDEP_SOLV (new) = ptr;
+ JDEP_TO_RESOLVE (new) = ptr;
JDEP_WFL (new) = wfl;
JDEP_CHAIN (new) = NULL;
JDEP_MISC (new) = NULL_TREE;
@@ -5231,6 +5255,7 @@ java_fix_constructors ()
if (CLASS_INTERFACE (TYPE_NAME (class_type)))
continue;
+ current_class = class_type;
for (decl = TYPE_METHODS (class_type); decl; decl = TREE_CHAIN (decl))
{
if (DECL_CONSTRUCTOR_P (decl))
@@ -5263,7 +5288,6 @@ safe_layout_class (class)
current_class = save_current_class;
input_filename = save_input_filename;
lineno = save_lineno;
- CLASS_LOADED_P (class) = 1;
}
static tree
@@ -5284,7 +5308,16 @@ jdep_resolve_class (dep)
if (!decl)
complete_class_report_errors (dep);
else if (PURE_INNER_CLASS_DECL_P (decl))
- check_inner_class_access (decl, JDEP_ENCLOSING (dep), JDEP_WFL (dep));
+ {
+ tree inner = TREE_TYPE (decl);
+ if (! CLASS_LOADED_P (inner))
+ {
+ safe_layout_class (inner);
+ if (TYPE_SIZE (inner) == error_mark_node)
+ TYPE_SIZE (inner) = NULL_TREE;
+ }
+ check_inner_class_access (decl, JDEP_ENCLOSING (dep), JDEP_WFL (dep));
+ }
return decl;
}
@@ -5474,20 +5507,12 @@ resolve_class (enclosing, class_type, decl, cl)
{
while (base != name)
{
- if (TREE_CODE (resolved_type) == RECORD_TYPE)
- resolved_type = promote_type (resolved_type);
resolved_type = build_java_array_type (resolved_type, -1);
- CLASS_LOADED_P (resolved_type) = 1;
name--;
}
- /* Build a fake decl for this, since this is what is expected to
- be returned. */
- resolved_type_decl =
- build_decl (TYPE_DECL, TYPE_NAME (resolved_type), resolved_type);
- /* Figure how those two things are important for error report. FIXME */
- DECL_SOURCE_LINE (resolved_type_decl) = 0;
- DECL_SOURCE_FILE (resolved_type_decl) = input_filename;
- TYPE_NAME (class_type) = TYPE_NAME (resolved_type);
+ /* A TYPE_NAME that is a TYPE_DECL was set in
+ build_java_array_type, return it. */
+ resolved_type_decl = TYPE_NAME (resolved_type);
}
TREE_TYPE (class_type) = resolved_type;
return resolved_type_decl;
@@ -5500,20 +5525,20 @@ tree
do_resolve_class (enclosing, class_type, decl, cl)
tree enclosing, class_type, decl, cl;
{
- tree new_class_decl;
+ tree new_class_decl, super, start;
/* Do not try to replace TYPE_NAME (class_type) by a variable, since
it is changed by find_in_imports{_on_demand} and (but it doesn't
really matter) qualify_and_find */
/* 0- Search in the current class as an inner class */
+ start = enclosing;
/* Maybe some code here should be added to load the class or
something, at least if the class isn't an inner class and ended
being loaded from class file. FIXME. */
while (enclosing)
{
- tree name;
tree intermediate;
if ((new_class_decl = find_as_inner_class (enclosing, class_type, cl)))
@@ -5530,21 +5555,28 @@ do_resolve_class (enclosing, class_type, decl, cl)
}
/* Now go to the upper classes, bail out if necessary. */
- enclosing = CLASSTYPE_SUPER (TREE_TYPE (enclosing));
- if (!enclosing || enclosing == object_type_node)
- break;
-
- if (TREE_CODE (enclosing) == RECORD_TYPE)
- {
- enclosing = TYPE_NAME (enclosing);
- continue;
- }
+ super = CLASSTYPE_SUPER (TREE_TYPE (enclosing));
+ if (!super || super == object_type_node)
+ break;
- if (TREE_CODE (enclosing) == IDENTIFIER_NODE)
- BUILD_PTR_FROM_NAME (name, enclosing);
+ if (TREE_CODE (super) == POINTER_TYPE)
+ super = do_resolve_class (NULL, super, NULL, NULL);
else
- name = enclosing;
- enclosing = do_resolve_class (NULL, name, NULL, NULL);
+ super = TYPE_NAME (super);
+
+ /* We may not have checked for circular inheritance yet, so do so
+ here to prevent an infinite loop. */
+ if (super == start)
+ {
+ if (!cl)
+ cl = lookup_cl (decl);
+
+ parse_error_context
+ (cl, "Cyclic inheritance involving %s",
+ IDENTIFIER_POINTER (DECL_NAME (enclosing)));
+ break;
+ }
+ enclosing = super;
}
/* 1- Check for the type in single imports. This will change
@@ -5597,10 +5629,19 @@ do_resolve_class (enclosing, class_type, decl, cl)
/* 5- Check an other compilation unit that bears the name of type */
load_class (TYPE_NAME (class_type), 0);
- if (check_pkg_class_access (TYPE_NAME (class_type),
- (cl ? cl : lookup_cl (decl))))
- return NULL_TREE;
-
+
+ if (!cl)
+ cl = lookup_cl (decl);
+
+ /* If we don't have a value for CL, then we're being called recursively.
+ We can't check package access just yet, but it will be taken care of
+ by the caller. */
+ if (cl)
+ {
+ if (check_pkg_class_access (TYPE_NAME (class_type), cl))
+ return NULL_TREE;
+ }
+
/* 6- Last call for a resolution */
return IDENTIFIER_CLASS_VALUE (TYPE_NAME (class_type));
}
@@ -6676,9 +6717,16 @@ find_in_imports_on_demand (class_type)
loaded and not seen in source yet, the load */
if (!decl || (!CLASS_LOADED_P (TREE_TYPE (decl))
&& !CLASS_FROM_SOURCE_P (TREE_TYPE (decl))))
- load_class (node_to_use, 0);
+ {
+ load_class (node_to_use, 0);
+ decl = IDENTIFIER_CLASS_VALUE (TYPE_NAME (class_type));
+ }
lineno = saved_lineno;
- return check_pkg_class_access (TYPE_NAME (class_type), cl);
+ if (! INNER_CLASS_P (TREE_TYPE (decl)))
+ return check_pkg_class_access (TYPE_NAME (class_type), cl);
+ else
+ /* 6.6.1: Inner classes are subject to member access rules. */
+ return 0;
}
else
return (seen_once < 0 ? 0 : seen_once); /* It's ok not to have found */
@@ -6772,11 +6820,16 @@ lookup_package_type (name, from)
return get_identifier (subname);
}
+/* Check accessibility of inner classes according to member access rules.
+ DECL is the inner class, ENCLOSING_DECL is the class from which the
+ access is being attempted. */
+
static void
check_inner_class_access (decl, enclosing_decl, cl)
tree decl, enclosing_decl, cl;
{
- int access = 0;
+ const char *access;
+ tree enclosing_decl_type;
/* We don't issue an error message when CL is null. CL can be null
as a result of processing a JDEP crafted by source_start_java_method
@@ -6786,30 +6839,69 @@ check_inner_class_access (decl, enclosing_decl, cl)
if (!decl || !cl)
return;
- /* We grant access to private and protected inner classes if the
- location from where we're trying to access DECL is an enclosing
- context for DECL or if both have a common enclosing context. */
+ enclosing_decl_type = TREE_TYPE (enclosing_decl);
+
if (CLASS_PRIVATE (decl))
- access = 1;
- if (CLASS_PROTECTED (decl))
- access = 2;
- if (!access)
- return;
+ {
+ /* Access is permitted only within the body of the top-level
+ class in which DECL is declared. */
+ tree top_level = decl;
+ while (DECL_CONTEXT (top_level))
+ top_level = DECL_CONTEXT (top_level);
+ while (DECL_CONTEXT (enclosing_decl))
+ enclosing_decl = DECL_CONTEXT (enclosing_decl);
+ if (top_level == enclosing_decl)
+ return;
+ access = "private";
+ }
+ else if (CLASS_PROTECTED (decl))
+ {
+ tree decl_context;
+ /* Access is permitted from within the same package... */
+ if (in_same_package (decl, enclosing_decl))
+ return;
- if (common_enclosing_context_p (TREE_TYPE (enclosing_decl),
- TREE_TYPE (decl))
- || enclosing_context_p (TREE_TYPE (enclosing_decl),
- TREE_TYPE (decl)))
+ /* ... or from within the body of a subtype of the context in which
+ DECL is declared. */
+ decl_context = DECL_CONTEXT (decl);
+ while (enclosing_decl)
+ {
+ if (CLASS_INTERFACE (decl))
+ {
+ if (interface_of_p (TREE_TYPE (decl_context),
+ enclosing_decl_type))
+ return;
+ }
+ else
+ {
+ /* Eww. The order of the arguments is different!! */
+ if (inherits_from_p (enclosing_decl_type,
+ TREE_TYPE (decl_context)))
+ return;
+ }
+ enclosing_decl = DECL_CONTEXT (enclosing_decl);
+ }
+ access = "protected";
+ }
+ else if (! CLASS_PUBLIC (decl))
+ {
+ /* Access is permitted only from within the same package as DECL. */
+ if (in_same_package (decl, enclosing_decl))
+ return;
+ access = "non-public";
+ }
+ else
+ /* Class is public. */
return;
- parse_error_context (cl, "Can't access %s nested %s %s. Only public classes and interfaces in other packages can be accessed",
- (access == 1 ? "private" : "protected"),
+ parse_error_context (cl, "Nested %s %s is %s; cannot be accessed from here",
(CLASS_INTERFACE (decl) ? "interface" : "class"),
- lang_printable_name (decl, 0));
+ lang_printable_name (decl, 0), access);
}
-/* Check that CLASS_NAME refers to a PUBLIC class. Return 0 if no
- access violations were found, 1 otherwise. */
+/* Accessibility check for top-level classes. If CLASS_NAME is in a foreign
+ package, it must be PUBLIC. Return 0 if no access violations were found,
+ 1 otherwise. */
static int
check_pkg_class_access (class_name, cl)
@@ -6818,7 +6910,7 @@ check_pkg_class_access (class_name, cl)
{
tree type;
- if (!QUALIFIED_P (class_name) || !IDENTIFIER_CLASS_VALUE (class_name))
+ if (!IDENTIFIER_CLASS_VALUE (class_name))
return 0;
if (!(type = TREE_TYPE (IDENTIFIER_CLASS_VALUE (class_name))))
@@ -6830,7 +6922,11 @@ check_pkg_class_access (class_name, cl)
allowed. */
tree l, r;
breakdown_qualified (&l, &r, class_name);
+ if (!QUALIFIED_P (class_name) && !ctxp->package)
+ /* Both in the empty package. */
+ return 0;
if (l == ctxp->package)
+ /* Both in the same package. */
return 0;
parse_error_context
@@ -6856,12 +6952,11 @@ declare_local_variables (modifier, type, vlist)
int final_p = 0;
/* Push a new block if statements were seen between the last time we
- pushed a block and now. Keep a cound of block to close */
+ pushed a block and now. Keep a count of blocks to close */
if (BLOCK_EXPR_BODY (GET_CURRENT_BLOCK (current_function_decl)))
{
- tree body = GET_CURRENT_BLOCK (current_function_decl);
tree b = enter_block ();
- BLOCK_EXPR_ORIGIN (b) = body;
+ BLOCK_IS_IMPLICIT (b) = 1;
}
if (modifier)
@@ -7053,53 +7148,12 @@ end_artificial_method_body (mdecl)
exit_block ();
}
-/* Called during expansion. Push decls formerly built from argument
- list so they're usable during expansion. */
-
-static void
-expand_start_java_method (fndecl)
- tree fndecl;
-{
- tree tem, *ptr;
-
- current_function_decl = fndecl;
-
- if (! quiet_flag)
- fprintf (stderr, " [%s.", lang_printable_name (DECL_CONTEXT (fndecl), 0));
- announce_function (fndecl);
- if (! quiet_flag)
- fprintf (stderr, "]");
-
- pushlevel (1); /* Prepare for a parameter push */
- ptr = &DECL_ARGUMENTS (fndecl);
- tem = BLOCK_EXPR_DECLS (DECL_FUNCTION_BODY (current_function_decl));
- while (tem)
- {
- tree next = TREE_CHAIN (tem);
- tree type = TREE_TYPE (tem);
- if (PROMOTE_PROTOTYPES
- && TYPE_PRECISION (type) < TYPE_PRECISION (integer_type_node)
- && INTEGRAL_TYPE_P (type))
- type = integer_type_node;
- DECL_ARG_TYPE (tem) = type;
- layout_decl (tem, 0);
- pushdecl (tem);
- *ptr = tem;
- ptr = &TREE_CHAIN (tem);
- tem = next;
- }
- *ptr = NULL_TREE;
- pushdecl_force_head (DECL_ARGUMENTS (fndecl));
- lineno = DECL_SOURCE_LINE_FIRST (fndecl);
-}
-
/* Terminate a function and expand its body. */
static void
source_end_java_method ()
{
tree fndecl = current_function_decl;
- int flag_asynchronous_exceptions = asynchronous_exceptions;
if (!fndecl)
return;
@@ -7107,9 +7161,6 @@ source_end_java_method ()
java_parser_context_save_global ();
lineno = ctxp->last_ccb_indent1;
- /* Set EH language codes */
- java_set_exception_lang_code ();
-
/* Turn function bodies with only a NOP expr null, so they don't get
generated at all and we won't get warnings when using the -W
-Wall flags. */
@@ -7131,24 +7182,14 @@ source_end_java_method ()
if (! flag_emit_class_files && ! flag_emit_xref)
{
lineno = DECL_SOURCE_LINE_LAST (fndecl);
- /* Emit catch-finally clauses */
- emit_handlers ();
expand_function_end (input_filename, lineno, 0);
- /* FIXME: If the current method contains any exception handlers,
- force asynchronous_exceptions: this is necessary because signal
- handlers in libjava may throw exceptions. This is far from being
- a perfect solution, but it's better than doing nothing at all.*/
- if (catch_clauses)
- asynchronous_exceptions = 1;
-
/* Run the optimizers and output assembler code for this function. */
rest_of_compilation (fndecl);
}
current_function_decl = NULL_TREE;
java_parser_context_restore_global ();
- asynchronous_exceptions = flag_asynchronous_exceptions;
}
/* Record EXPR in the current function block. Complements compound
@@ -7229,7 +7270,7 @@ java_reorder_fields ()
initialized_p = 1;
}
- for (current = ctxp->gclass_list; current; current = TREE_CHAIN (current))
+ for (current = gclass_list; current; current = TREE_CHAIN (current))
{
current_class = TREE_TYPE (TREE_VALUE (current));
@@ -7259,11 +7300,11 @@ java_reorder_fields ()
}
}
}
- stop_reordering = TREE_TYPE (TREE_VALUE (ctxp->gclass_list));
+ stop_reordering = TREE_TYPE (TREE_VALUE (gclass_list));
}
-/* Layout the methods of all classes loaded in one way on an
- other. Check methods of source parsed classes. Then reorder the
+/* Layout the methods of all classes loaded in one way or another.
+ Check methods of source parsed classes. Then reorder the
fields and layout the classes or the type of all source parsed
classes */
@@ -7279,19 +7320,16 @@ java_layout_classes ()
all_class_list = NULL_TREE;
/* Then check the methods of all parsed classes */
- for (current = ctxp->gclass_list; current; current = TREE_CHAIN (current))
+ for (current = gclass_list; current; current = TREE_CHAIN (current))
if (CLASS_FROM_SOURCE_P (TREE_TYPE (TREE_VALUE (current))))
java_check_methods (TREE_VALUE (current));
java_parse_abort_on_error ();
- for (current = ctxp->gclass_list; current; current = TREE_CHAIN (current))
+ for (current = gclass_list; current; current = TREE_CHAIN (current))
{
current_class = TREE_TYPE (TREE_VALUE (current));
layout_class (current_class);
- /* From now on, the class is considered completely loaded */
- CLASS_LOADED_P (current_class) = 1;
-
/* Error reported by the caller */
if (java_error_count)
return;
@@ -7532,7 +7570,7 @@ maybe_generate_pre_expand_clinit (class_type)
}
/* Analyzes a method body and look for something that isn't a
- MODIFY_EXPR. */
+ MODIFY_EXPR with a constant value. */
static int
analyze_clinit_body (bbody)
@@ -7556,11 +7594,10 @@ analyze_clinit_body (bbody)
break;
case MODIFY_EXPR:
- bbody = NULL_TREE;
- break;
+ /* Return 0 if the operand is constant, 1 otherwise. */
+ return ! TREE_CONSTANT (TREE_OPERAND (bbody, 1));
default:
- bbody = NULL_TREE;
return 1;
}
return 0;
@@ -7673,7 +7710,39 @@ java_complete_expand_method (mdecl)
tree fbody = DECL_FUNCTION_BODY (mdecl);
tree block_body = BLOCK_EXPR_BODY (fbody);
tree exception_copy = NULL_TREE;
- expand_start_java_method (mdecl);
+ tree tem, *ptr;
+
+ current_function_decl = mdecl;
+
+ if (! quiet_flag)
+ fprintf (stderr, " [%s.",
+ lang_printable_name (DECL_CONTEXT (mdecl), 0));
+ announce_function (mdecl);
+ if (! quiet_flag)
+ fprintf (stderr, "]");
+
+ pushlevel (1); /* Prepare for a parameter push */
+ ptr = &DECL_ARGUMENTS (mdecl);
+ tem = BLOCK_EXPR_DECLS (DECL_FUNCTION_BODY (current_function_decl));
+ while (tem)
+ {
+ tree next = TREE_CHAIN (tem);
+ tree type = TREE_TYPE (tem);
+ if (PROMOTE_PROTOTYPES
+ && TYPE_PRECISION (type) < TYPE_PRECISION (integer_type_node)
+ && INTEGRAL_TYPE_P (type))
+ type = integer_type_node;
+ DECL_ARG_TYPE (tem) = type;
+ layout_decl (tem, 0);
+ pushdecl (tem);
+ *ptr = tem;
+ ptr = &TREE_CHAIN (tem);
+ tem = next;
+ }
+ *ptr = NULL_TREE;
+ pushdecl_force_head (DECL_ARGUMENTS (mdecl));
+ lineno = DECL_SOURCE_LINE_FIRST (mdecl);
+
build_result_decl (mdecl);
current_this
@@ -8327,7 +8396,7 @@ build_dot_class_method (class)
/* Create the "class$" function */
mdecl = create_artificial_method (class, ACC_STATIC,
build_pointer_type (class_type_node),
- get_identifier ("class$"), args);
+ classdollar_identifier_node, args);
DECL_FUNCTION_THROWS (mdecl) = build_tree_list (NULL_TREE,
no_class_def_found_error);
@@ -8364,7 +8433,7 @@ build_dot_class_method (class)
/* We initialize the variable with the exception handler. */
catch = build (MODIFY_EXPR, NULL_TREE, catch_clause_param,
- soft_exceptioninfo_call_node);
+ build (JAVA_EXC_OBJ_EXPR, ptr_type_node));
add_stmt_to_block (catch_block, NULL_TREE, catch);
/* We add the statement throwing the new exception */
@@ -8401,7 +8470,7 @@ build_dot_class_method_invocation (type)
s = build_string (IDENTIFIER_LENGTH (sig_id),
IDENTIFIER_POINTER (sig_id));
- return build_method_invocation (build_wfl_node (get_identifier ("class$")),
+ return build_method_invocation (build_wfl_node (classdollar_identifier_node),
build_tree_list (NULL_TREE, s));
}
@@ -8419,6 +8488,10 @@ fix_constructors (mdecl)
tree thisn_assign, compound = NULL_TREE;
tree class_type = DECL_CONTEXT (mdecl);
+ if (DECL_FIXED_CONSTRUCTOR_P (mdecl))
+ return;
+ DECL_FIXED_CONSTRUCTOR_P (mdecl) = 1;
+
if (!body)
{
/* It is an error for the compiler to generate a default
@@ -8450,7 +8523,7 @@ fix_constructors (mdecl)
/* We don't generate a super constructor invocation if we're
compiling java.lang.Object. build_super_invocation takes care
of that. */
- compound = java_method_add_stmt (mdecl, build_super_invocation (mdecl));
+ java_method_add_stmt (mdecl, build_super_invocation (mdecl));
/* Insert the instance initializer block right here, after the
super invocation. */
@@ -8462,7 +8535,9 @@ fix_constructors (mdecl)
else
{
int found = 0;
+ tree found_call = NULL_TREE;
tree main_block = BLOCK_EXPR_BODY (body);
+ tree ii; /* Instance Initializer */
while (body)
switch (TREE_CODE (body))
@@ -8473,27 +8548,38 @@ fix_constructors (mdecl)
break;
case COMPOUND_EXPR:
case EXPR_WITH_FILE_LOCATION:
+ found_call = body;
body = TREE_OPERAND (body, 0);
break;
case BLOCK:
+ found_call = body;
body = BLOCK_EXPR_BODY (body);
break;
default:
found = 0;
body = NULL_TREE;
}
+
+ /* Generate the assignment to this$<n>, if necessary */
+ if ((thisn_assign = build_thisn_assign ()))
+ compound = add_stmt_to_compound (compound, NULL_TREE, thisn_assign);
+
/* The constructor is missing an invocation of super() */
if (!found)
compound = add_stmt_to_compound (compound, NULL_TREE,
build_super_invocation (mdecl));
+ /* Explicit super() invokation should take place before the
+ instance initializer blocks. */
+ else
+ {
+ compound = add_stmt_to_compound (compound, NULL_TREE,
+ TREE_OPERAND (found_call, 0));
+ TREE_OPERAND (found_call, 0) = empty_stmt_node;
+ }
- /* Generate the assignment to this$<n>, if necessary */
- if ((thisn_assign = build_thisn_assign ()))
- compound = add_stmt_to_compound (compound, NULL_TREE, thisn_assign);
-
- /* Insert the instance initializer block right here, after the
- super invocation. */
- add_instance_initializer (mdecl);
+ /* Insert the instance initializer block right after. */
+ if ((ii = build_instance_initializer (mdecl)))
+ compound = add_stmt_to_compound (compound, NULL_TREE, ii);
/* Fix the constructor main block if we're adding extra stmts */
if (compound)
@@ -8564,7 +8650,7 @@ void
java_expand_classes ()
{
int save_error_count = 0;
- static struct parser_ctxt *saved_ctxp = NULL;
+ static struct parser_ctxt *cur_ctxp = NULL;
java_parse_abort_on_error ();
if (!(ctxp = ctxp_for_generation))
@@ -8572,22 +8658,23 @@ java_expand_classes ()
java_layout_classes ();
java_parse_abort_on_error ();
- saved_ctxp = ctxp_for_generation;
- for (; ctxp_for_generation; ctxp_for_generation = ctxp_for_generation->next)
+ cur_ctxp = ctxp_for_generation;
+ for (; cur_ctxp; cur_ctxp = cur_ctxp->next)
{
- ctxp = ctxp_for_generation;
+ ctxp = cur_ctxp;
+ input_filename = ctxp->filename;
lang_init_source (2); /* Error msgs have method prototypes */
java_complete_expand_classes (); /* Complete and expand classes */
java_parse_abort_on_error ();
}
+ input_filename = main_input_filename;
/* Find anonymous classes and expand their constructor, now they
have been fixed. */
- for (ctxp_for_generation = saved_ctxp;
- ctxp_for_generation; ctxp_for_generation = ctxp_for_generation->next)
+ for (cur_ctxp = ctxp_for_generation; cur_ctxp; cur_ctxp = cur_ctxp->next)
{
tree current;
- ctxp = ctxp_for_generation;
+ ctxp = cur_ctxp;
for (current = ctxp->class_list; current; current = TREE_CHAIN (current))
{
current_class = TREE_TYPE (current);
@@ -8617,11 +8704,10 @@ java_expand_classes ()
return;
/* Now things are stable, go for generation of the class data. */
- for (ctxp_for_generation = saved_ctxp;
- ctxp_for_generation; ctxp_for_generation = ctxp_for_generation->next)
+ for (cur_ctxp = ctxp_for_generation; cur_ctxp; cur_ctxp = cur_ctxp->next)
{
tree current;
- ctxp = ctxp_for_generation;
+ ctxp = cur_ctxp;
for (current = ctxp->class_list; current; current = TREE_CHAIN (current))
{
current_class = TREE_TYPE (current);
@@ -8817,8 +8903,8 @@ resolve_expression_name (id, orig)
/* Otherwise build what it takes to access the field */
access = build_field_ref ((fs ? NULL_TREE : current_this),
DECL_CONTEXT (decl), name);
- if (fs && !flag_emit_class_files && !flag_emit_xref)
- access = build_class_init (DECL_CONTEXT (access), access);
+ if (fs)
+ access = maybe_build_class_init_for_field (decl, access);
/* We may be asked to save the real field access node */
if (orig)
*orig = access;
@@ -8902,29 +8988,16 @@ resolve_field_access (qual_wfl, field_decl, field_type)
field_ref = decl;
else if (JDECL_P (decl))
{
- int static_final_found = 0;
if (!type_found)
type_found = DECL_CONTEXT (decl);
- is_static = JDECL_P (decl) && FIELD_STATIC (decl);
- if (CLASS_FINAL_VARIABLE_P (decl)
- && JPRIMITIVE_TYPE_P (TREE_TYPE (decl))
- && DECL_INITIAL (decl))
- {
- /* When called on a FIELD_DECL of the right (primitive)
- type, java_complete_tree will try to substitue the decl
- for it's initial value. */
- field_ref = java_complete_tree (decl);
- static_final_found = 1;
- }
- else
- field_ref = build_field_ref ((is_static && !flag_emit_xref?
- NULL_TREE : where_found),
- type_found, DECL_NAME (decl));
+ is_static = FIELD_STATIC (decl);
+ field_ref = build_field_ref ((is_static && !flag_emit_xref?
+ NULL_TREE : where_found),
+ type_found, DECL_NAME (decl));
if (field_ref == error_mark_node)
return error_mark_node;
- if (is_static && !static_final_found
- && !flag_emit_class_files && !flag_emit_xref)
- field_ref = build_class_init (DECL_CONTEXT (decl), field_ref);
+ if (is_static)
+ field_ref = maybe_build_class_init_for_field (decl, field_ref);
}
else
field_ref = decl;
@@ -9034,7 +9107,8 @@ resolve_qualified_expression_name (wfl, found_decl, where_found, type_found)
CALL_USING_SUPER (qual_wfl) = 1;
location = (TREE_CODE (qual_wfl) == CALL_EXPR ?
EXPR_WFL_LINECOL (TREE_OPERAND (qual_wfl, 0)) : 0);
- *where_found = patch_method_invocation (qual_wfl, decl, type,
+ *where_found = patch_method_invocation (qual_wfl, decl, type,
+ from_super,
&is_static, &ret_decl);
if (*where_found == error_mark_node)
{
@@ -9090,7 +9164,6 @@ resolve_qualified_expression_name (wfl, found_decl, where_found, type_found)
if (decl == error_mark_node)
return 1;
*type_found = type = QUAL_DECL_TYPE (decl);
- CLASS_LOADED_P (type) = 1;
continue;
case CONVERT_EXPR:
@@ -9152,7 +9225,8 @@ resolve_qualified_expression_name (wfl, found_decl, where_found, type_found)
previous_call_static = 0;
/* It can be the keyword THIS */
- if (EXPR_WFL_NODE (qual_wfl) == this_identifier_node)
+ if (TREE_CODE (qual_wfl) == EXPR_WITH_FILE_LOCATION
+ && EXPR_WFL_NODE (qual_wfl) == this_identifier_node)
{
if (!current_this)
{
@@ -9203,7 +9277,8 @@ resolve_qualified_expression_name (wfl, found_decl, where_found, type_found)
}
/* 15.10.2 Accessing Superclass Members using SUPER */
- if (EXPR_WFL_NODE (qual_wfl) == super_identifier_node)
+ if (TREE_CODE (qual_wfl) == EXPR_WITH_FILE_LOCATION
+ && EXPR_WFL_NODE (qual_wfl) == super_identifier_node)
{
tree node;
/* Check on the restricted use of SUPER */
@@ -9287,7 +9362,7 @@ resolve_qualified_expression_name (wfl, found_decl, where_found, type_found)
return 1;
}
- if (not_accessible_p (TREE_TYPE (decl), decl, 0))
+ if (not_accessible_p (TREE_TYPE (decl), decl, type, 0))
{
parse_error_context
(qual_wfl, "Can't access %s field `%s.%s' from `%s'",
@@ -9362,8 +9437,9 @@ resolve_qualified_expression_name (wfl, found_decl, where_found, type_found)
field_decl = lookup_field_wrapper (type,
EXPR_WFL_NODE (qual_wfl));
- /* Maybe what we're trying to access an inner class. */
- if (!field_decl)
+ /* Maybe what we're trying to access to is an inner
+ class, only if decl is a TYPE_DECL. */
+ if (!field_decl && TREE_CODE (decl) == TYPE_DECL)
{
tree ptr, inner_decl;
@@ -9402,11 +9478,10 @@ resolve_qualified_expression_name (wfl, found_decl, where_found, type_found)
&& !CLASS_LOADED_P (field_decl_type)
&& !TYPE_ARRAY_P (field_decl_type))
resolve_and_layout (field_decl_type, NULL_TREE);
- if (TYPE_ARRAY_P (field_decl_type))
- CLASS_LOADED_P (field_decl_type) = 1;
/* Check on accessibility here */
- if (not_accessible_p (type, field_decl, from_super))
+ if (not_accessible_p (current_class, field_decl,
+ DECL_CONTEXT (field_decl), from_super))
{
parse_error_context
(qual_wfl,
@@ -9493,12 +9568,16 @@ resolve_qualified_expression_name (wfl, found_decl, where_found, type_found)
}
/* 6.6 Qualified name and access control. Returns 1 if MEMBER (a decl)
- can't be accessed from REFERENCE (a record type). This should be
- used when decl is a field or a method.*/
+ can't be accessed from REFERENCE (a record type). If MEMBER
+ features a protected access, we then use WHERE which, if non null,
+ holds the type of MEMBER's access that is checked against
+ 6.6.2.1. This function should be used when decl is a field or a
+ method. */
static int
-not_accessible_p (reference, member, from_super)
+not_accessible_p (reference, member, where, from_super)
tree reference, member;
+ tree where;
int from_super;
{
int access_flag = get_access_flags_from_decl (member);
@@ -9524,6 +9603,12 @@ not_accessible_p (reference, member, from_super)
if (from_super)
return 0;
+ /* If where is active, access was made through a
+ qualifier. Access is granted if the type of the qualifier is
+ or is a sublass of the type the access made from (6.6.2.1.) */
+ if (where && !inherits_from_p (reference, where))
+ return 1;
+
/* Otherwise, access is granted if occuring from the class where
member is declared or a subclass of it. Find the right
context to perform the check */
@@ -9662,8 +9747,10 @@ maybe_access_field (decl, where, type)
used. IS_STATIC is set to 1 if the invoked function is static. */
static tree
-patch_method_invocation (patch, primary, where, is_static, ret_decl)
+patch_method_invocation (patch, primary, where, from_super,
+ is_static, ret_decl)
tree patch, primary, where;
+ int from_super;
int *is_static;
tree *ret_decl;
{
@@ -9674,6 +9761,7 @@ patch_method_invocation (patch, primary, where, is_static, ret_decl)
int is_static_flag = 0;
int is_super_init = 0;
tree this_arg = NULL_TREE;
+ int is_array_clone_call = 0;
/* Should be overriden if everything goes well. Otherwise, if
something fails, it should keep this value. It stop the
@@ -9748,6 +9836,9 @@ patch_method_invocation (patch, primary, where, is_static, ret_decl)
else
this_arg = primary = resolved;
+ if (TYPE_ARRAY_P (type) && identifier == get_identifier ("clone"))
+ is_array_clone_call = 1;
+
/* IDENTIFIER_WFL will be used to report any problem further */
wfl = identifier_wfl;
}
@@ -9815,7 +9906,29 @@ patch_method_invocation (patch, primary, where, is_static, ret_decl)
alternate class is specified. */
else
{
- class_to_search = (where ? where : current_class);
+ if (where != NULL_TREE)
+ class_to_search = where;
+ else if (QUALIFIED_P (name))
+ class_to_search = current_class;
+ else
+ {
+ class_to_search = current_class;
+
+ for (;;)
+ {
+ if (has_method (class_to_search, name))
+ break;
+ if (! INNER_CLASS_TYPE_P (class_to_search))
+ {
+ parse_error_context (wfl,
+ "No method named `%s' in scope",
+ IDENTIFIER_POINTER (name));
+ PATCH_METHOD_RETURN_ERROR ();
+ }
+ class_to_search
+ = TREE_TYPE (DECL_CONTEXT (TYPE_NAME (class_to_search)));
+ }
+ }
lc = 0;
}
@@ -9829,6 +9942,10 @@ patch_method_invocation (patch, primary, where, is_static, ret_decl)
can't be executed then. */
if (!list)
PATCH_METHOD_RETURN_ERROR ();
+
+ if (TYPE_ARRAY_P (class_to_search)
+ && DECL_NAME (list) == get_identifier ("clone"))
+ is_array_clone_call = 1;
/* Check for static reference if non static methods */
if (check_for_static_method_reference (wfl, patch, list,
@@ -9897,19 +10014,23 @@ patch_method_invocation (patch, primary, where, is_static, ret_decl)
/* Check accessibility, position the is_static flag, build and
return the call */
- if (not_accessible_p (DECL_CONTEXT (current_function_decl), list, 0))
- {
- char *fct_name = xstrdup (lang_printable_name (list, 0));
- int ctor_p = DECL_CONSTRUCTOR_P (list);
- parse_error_context
- (wfl, "Can't access %s %s `%s%s.%s' from `%s'",
- java_accstring_lookup (get_access_flags_from_decl (list)),
- (ctor_p ? "constructor" : "method"),
- (ctor_p ?
- "" : lang_printable_name_wls (TREE_TYPE (TREE_TYPE (list)), 0)),
- IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (DECL_CONTEXT (list)))),
- fct_name, IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (current_class))));
- free (fct_name);
+ if (not_accessible_p (DECL_CONTEXT (current_function_decl), list,
+ (primary ? TREE_TYPE (TREE_TYPE (primary)) :
+ NULL_TREE), from_super)
+ /* Calls to clone() on array types are permitted as a special-case. */
+ && !is_array_clone_call)
+ {
+ char *fct_name = (char *) IDENTIFIER_POINTER (DECL_NAME (list));
+ char *access = java_accstring_lookup (get_access_flags_from_decl (list));
+ char *klass = (char *) IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (DECL_CONTEXT (list))));
+ char *refklass = (char *) IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (current_class)));
+ char *what = (char *) (DECL_CONSTRUCTOR_P (list)
+ ? "constructor" : "method");
+ /* FIXME: WFL yields the wrong message here but I don't know
+ what else to use. */
+ parse_error_context (wfl,
+ "Can't access %s %s `%s.%s' from `%s'",
+ access, what, klass, fct_name, refklass);
PATCH_METHOD_RETURN_ERROR ();
}
check_deprecation (wfl, list);
@@ -10012,7 +10133,7 @@ patch_method_invocation (patch, primary, where, is_static, ret_decl)
/* Prepare to pass hidden parameters to finit$, if any. */
finit_parms = build_alias_initializer_parameter_list
(AIPL_FUNCTION_FINIT_INVOCATION, current_class, NULL_TREE, NULL);
-
+
finit_call =
build_method_invocation (build_wfl_node (finit_identifier_node),
finit_parms);
@@ -10337,7 +10458,7 @@ lookup_method_invoke (lc, cl, class, name, arg_list)
{
tree cm = TREE_VALUE (current);
char string [4096];
- if (!cm || not_accessible_p (class, cm, 0))
+ if (!cm || not_accessible_p (class, cm, NULL_TREE, 0))
continue;
sprintf
(string, " `%s' in `%s'%s",
@@ -10422,15 +10543,13 @@ find_applicable_accessible_methods_list (lc, class, name, arglist)
/* Search classes */
else
{
- tree sc = class;
- int seen_inner_class = 0;
search_applicable_methods_list (lc, TYPE_METHODS (class),
name, arglist, &list, &all_list);
- /* When looking finit$, we turn LC to 1 so that we only search
- in class. Note that we should have found something at
- this point. */
- if (ID_FINIT_P (name))
+ /* When looking finit$ or class$, we turn LC to 1 so that we
+ only search in class. Note that we should have found
+ something at this point. */
+ if (ID_FINIT_P (name) || ID_CLASSDOLLAR_P (name))
{
lc = 1;
if (!list)
@@ -10440,7 +10559,7 @@ find_applicable_accessible_methods_list (lc, class, name, arglist)
/* We must search all interfaces of this class */
if (!lc)
{
- tree basetype_vec = TYPE_BINFO_BASETYPES (sc);
+ tree basetype_vec = TYPE_BINFO_BASETYPES (class);
int n = TREE_VEC_LENGTH (basetype_vec), i;
for (i = 1; i < n; i++)
{
@@ -10455,24 +10574,6 @@ find_applicable_accessible_methods_list (lc, class, name, arglist)
}
}
- /* Search enclosing context of inner classes before looking
- ancestors up. */
- while (!lc && INNER_CLASS_TYPE_P (class))
- {
- tree rlist;
- seen_inner_class = 1;
- class = TREE_TYPE (DECL_CONTEXT (TYPE_NAME (class)));
- rlist = find_applicable_accessible_methods_list (lc, class,
- name, arglist);
- list = chainon (rlist, list);
- }
-
- if (!lc && seen_inner_class
- && TREE_TYPE (DECL_CONTEXT (TYPE_NAME (sc))) == CLASSTYPE_SUPER (sc))
- class = CLASSTYPE_SUPER (sc);
- else
- class = sc;
-
/* Search superclass */
if (!lc && CLASSTYPE_SUPER (class) != NULL_TREE)
{
@@ -10531,7 +10632,7 @@ search_applicable_methods_list (lc, method, name, arglist, list, all_list)
{
/* Retain accessible methods only */
if (!not_accessible_p (DECL_CONTEXT (current_function_decl),
- method, 0))
+ method, NULL_TREE, 0))
*list = tree_cons (NULL_TREE, method, *list);
else
/* Also retain all selected method here */
@@ -10758,6 +10859,10 @@ qualify_ambiguous_name (id)
else if (code == INTEGER_CST)
name = qual_wfl;
+ else if (code == CONVERT_EXPR &&
+ TREE_CODE (TREE_OPERAND (qual_wfl, 0)) == EXPR_WITH_FILE_LOCATION)
+ name = TREE_OPERAND (qual_wfl, 0);
+
else if ((code == ARRAY_REF || code == CALL_EXPR || code == MODIFY_EXPR) &&
TREE_CODE (TREE_OPERAND (qual_wfl, 0)) == EXPR_WITH_FILE_LOCATION)
name = EXPR_WFL_NODE (TREE_OPERAND (qual_wfl, 0));
@@ -10772,7 +10877,7 @@ qualify_ambiguous_name (id)
qual_wfl = QUAL_WFL (qual);
again = 1;
}
- else
+ else
{
name = EXPR_WFL_NODE (qual_wfl);
if (!name)
@@ -10800,8 +10905,10 @@ qualify_ambiguous_name (id)
qual_wfl = QUAL_WFL (qual);
if (TREE_CODE (qual_wfl) == CALL_EXPR)
again = 1;
- else
+ else if (TREE_CODE (qual_wfl) == EXPR_WITH_FILE_LOCATION)
name = EXPR_WFL_NODE (qual_wfl);
+ else if (TREE_CODE (qual_wfl) == NEW_CLASS_EXPR)
+ name = TREE_OPERAND (qual_wfl, 0);
this_found = 1;
}
/* If we have a SUPER, we set the context accordingly */
@@ -10839,7 +10946,7 @@ qualify_ambiguous_name (id)
expression name. If we saw a NEW_ARRAY_EXPR before and want to
address length, it is OK. */
else if ((decl = lookup_field_wrapper (ptr_type, name))
- || (new_array_found && name == length_identifier_node))
+ || name == length_identifier_node)
{
RESOLVE_EXPRESSION_NAME_P (qual_wfl) = 1;
QUAL_RESOLUTION (qual) = (new_array_found ? NULL_TREE : decl);
@@ -10864,7 +10971,8 @@ qualify_ambiguous_name (id)
/* Method call, array references and cast are expression name */
else if (TREE_CODE (QUAL_WFL (qual)) == CALL_EXPR
|| TREE_CODE (QUAL_WFL (qual)) == ARRAY_REF
- || TREE_CODE (QUAL_WFL (qual)) == CONVERT_EXPR)
+ || TREE_CODE (QUAL_WFL (qual)) == CONVERT_EXPR
+ || TREE_CODE (QUAL_WFL (qual)) == MODIFY_EXPR)
RESOLVE_EXPRESSION_NAME_P (qual_wfl) = 1;
/* Check here that NAME isn't declared by more than one
@@ -10926,6 +11034,35 @@ breakdown_qualified (left, right, source)
return 0;
}
+/* Return TRUE if two classes are from the same package. */
+
+static int
+in_same_package (name1, name2)
+ tree name1, name2;
+{
+ tree tmp;
+ tree pkg1;
+ tree pkg2;
+
+ if (TREE_CODE (name1) == TYPE_DECL)
+ name1 = DECL_NAME (name1);
+ if (TREE_CODE (name2) == TYPE_DECL)
+ name2 = DECL_NAME (name2);
+
+ if (QUALIFIED_P (name1) != QUALIFIED_P (name2))
+ /* One in empty package. */
+ return 0;
+
+ if (QUALIFIED_P (name1) == 0 && QUALIFIED_P (name2) == 0)
+ /* Both in empty package. */
+ return 1;
+
+ breakdown_qualified (&pkg1, &tmp, name1);
+ breakdown_qualified (&pkg2, &tmp, name2);
+
+ return (pkg1 == pkg2);
+}
+
/* Patch tree nodes in a function body. When a BLOCK is found, push
local variable decls if present.
Same as java_complete_lhs, but does resolve static finals to values. */
@@ -11101,6 +11238,10 @@ java_complete_lhs (node)
case TRY_FINALLY_EXPR:
COMPLETE_CHECK_OP_0 (node);
COMPLETE_CHECK_OP_1 (node);
+ if (TREE_OPERAND (node, 0) == empty_stmt_node)
+ return TREE_OPERAND (node, 1);
+ if (TREE_OPERAND (node, 1) == empty_stmt_node)
+ return TREE_OPERAND (node, 0);
CAN_COMPLETE_NORMALLY (node)
= (CAN_COMPLETE_NORMALLY (TREE_OPERAND (node, 0))
&& CAN_COMPLETE_NORMALLY (TREE_OPERAND (node, 1)));
@@ -11408,9 +11549,11 @@ java_complete_lhs (node)
{
tree decl, wfl = TREE_OPERAND (node, 0);
int in_this = CALL_THIS_CONSTRUCTOR_P (node);
+ int from_super = (EXPR_WFL_NODE (TREE_OPERAND (node, 0)) ==
+ super_identifier_node);
- node = patch_method_invocation (node, NULL_TREE,
- NULL_TREE, 0, &decl);
+ node = patch_method_invocation (node, NULL_TREE, NULL_TREE,
+ from_super, 0, &decl);
if (node == error_mark_node)
return error_mark_node;
@@ -11461,7 +11604,7 @@ java_complete_lhs (node)
class. TESTME, FIXME */
tree lvalue = java_stabilize_reference (TREE_OPERAND (node, 0));
- /* Hand stablize the lhs on both places */
+ /* Hand stabilize the lhs on both places */
TREE_OPERAND (node, 0) = lvalue;
TREE_OPERAND (TREE_OPERAND (node, 1), 0) =
(flag_emit_class_files ? lvalue : save_expr (lvalue));
@@ -11776,18 +11919,13 @@ build_expr_block (body, decls)
static tree
enter_block ()
{
- return (enter_a_block (build_expr_block (NULL_TREE, NULL_TREE)));
-}
+ tree b = build_expr_block (NULL_TREE, NULL_TREE);
-/* Link block B supercontext to the previous block. The current
- function DECL is used as supercontext when enter_a_block is called
- for the first time for a given function. The current function body
- (DECL_FUNCTION_BODY) is set to be block B. */
+ /* Link block B supercontext to the previous block. The current
+ function DECL is used as supercontext when enter_a_block is called
+ for the first time for a given function. The current function body
+ (DECL_FUNCTION_BODY) is set to be block B. */
-static tree
-enter_a_block (b)
- tree b;
-{
tree fndecl = current_function_decl;
if (!fndecl) {
@@ -11862,7 +12000,7 @@ lookup_name_in_blocks (name)
static void
maybe_absorb_scoping_blocks ()
{
- while (BLOCK_EXPR_ORIGIN (GET_CURRENT_BLOCK (current_function_decl)))
+ while (BLOCK_IS_IMPLICIT (GET_CURRENT_BLOCK (current_function_decl)))
{
tree b = exit_block ();
java_method_add_stmt (current_function_decl, b);
@@ -11876,6 +12014,7 @@ maybe_absorb_scoping_blocks ()
are completing them. */
/* Wrap a non WFL node around a WFL. */
+
static tree
build_wfl_wrap (node, location)
tree node;
@@ -11896,7 +12035,6 @@ build_wfl_wrap (node, location)
return wfl;
}
-
/* Build a super() constructor invocation. Returns empty_stmt_node if
we're currently dealing with the class java.lang.Object. */
@@ -12291,6 +12429,7 @@ maybe_build_primttype_type_ref (rhs, wfl)
if (TREE_CODE (n) == VAR_DECL
&& DECL_NAME (n) == TYPE_identifier_node
&& rhs_type == class_ptr_type
+ && TREE_CODE (wfl) == EXPR_WITH_FILE_LOCATION
&& TREE_CODE (EXPR_WFL_NODE (wfl)) == IDENTIFIER_NODE)
{
const char *self_name = IDENTIFIER_POINTER (EXPR_WFL_NODE (wfl));
@@ -12436,10 +12575,15 @@ patch_assignment (node, wfl_op1, wfl_op2)
base = TREE_OPERAND (lvalue, 0);
else
{
+ tree op = TREE_OPERAND (base, 0);
+
+ /* We can have a SAVE_EXPR here when doing String +=. */
+ if (TREE_CODE (op) == SAVE_EXPR)
+ op = TREE_OPERAND (op, 0);
if (flag_bounds_check)
- base = TREE_OPERAND (TREE_OPERAND (TREE_OPERAND (base, 0), 1), 0);
+ base = TREE_OPERAND (TREE_OPERAND (op, 1), 0);
else
- base = TREE_OPERAND (TREE_OPERAND (base, 0), 0);
+ base = TREE_OPERAND (op, 0);
}
/* Build the invocation of _Jv_CheckArrayStore */
@@ -12465,16 +12609,31 @@ patch_assignment (node, wfl_op1, wfl_op2)
TREE_OPERAND (lvalue, 1) = build (COMPOUND_EXPR, lhs_type,
check, TREE_OPERAND (lvalue, 1));
}
- else
+ else if (flag_bounds_check)
{
+ tree hook = lvalue;
+ tree compound = TREE_OPERAND (lvalue, 0);
+ tree bound_check, new_compound;
+
+ if (TREE_CODE (compound) == SAVE_EXPR)
+ {
+ compound = TREE_OPERAND (compound, 0);
+ hook = TREE_OPERAND (hook, 0);
+ }
+
+ /* Find the array bound check, hook the original array access. */
+ bound_check = TREE_OPERAND (compound, 0);
+ TREE_OPERAND (hook, 0) = TREE_OPERAND (compound, 1);
+
/* Make sure the bound check will happen before the store check */
- if (flag_bounds_check)
- TREE_OPERAND (TREE_OPERAND (lvalue, 0), 0) =
- build (COMPOUND_EXPR, void_type_node,
- TREE_OPERAND (TREE_OPERAND (lvalue, 0), 0), check);
- else
- lvalue = build (COMPOUND_EXPR, lhs_type, check, lvalue);
+ new_compound =
+ build (COMPOUND_EXPR, void_type_node, bound_check, check);
+
+ /* Re-assemble the augmented array access. */
+ lvalue = build (COMPOUND_EXPR, lhs_type, new_compound, lvalue);
}
+ else
+ lvalue = build (COMPOUND_EXPR, lhs_type, check, lvalue);
}
/* Final locals can be used as case values in switch
@@ -12517,7 +12676,7 @@ try_reference_assignconv (lhs_type, rhs)
else if (valid_ref_assignconv_cast_p (rhs_type, lhs_type, 0))
new_rhs = rhs;
/* This is a magic assignment that we process differently */
- else if (rhs == soft_exceptioninfo_call_node)
+ else if (TREE_CODE (rhs) == JAVA_EXC_OBJ_EXPR)
new_rhs = rhs;
}
return new_rhs;
@@ -13642,8 +13801,11 @@ patch_incomplete_class_ref (node)
if (!flag_emit_class_files || JPRIMITIVE_TYPE_P (ref_type))
{
+ tree dot = build_class_ref (ref_type);
/* A class referenced by `foo.class' is initialized. */
- return build_class_init (ref_type, build_class_ref (ref_type));
+ if (!flag_emit_class_files)
+ dot = build_class_init (ref_type, dot);
+ return java_complete_tree (dot);
}
/* If we're emitting class files and we have to deal with non
@@ -13874,11 +14036,7 @@ resolve_type_during_patch (type)
IDENTIFIER_POINTER (EXPR_WFL_NODE (type)));
return NULL_TREE;
}
- else
- {
- CLASS_LOADED_P (TREE_TYPE (type_decl)) = 1;
- return TREE_TYPE (type_decl);
- }
+ return TREE_TYPE (type_decl);
}
return type;
}
@@ -15398,6 +15556,29 @@ patch_conditional_expr (node, wfl_cond, wfl_op1)
return node;
}
+/* Wrap EXPR with code to initialize DECL's class, if appropriate. */
+
+static tree
+maybe_build_class_init_for_field (decl, expr)
+ tree decl, expr;
+{
+ tree clas = DECL_CONTEXT (decl);
+ if (flag_emit_class_files || flag_emit_xref)
+ return expr;
+
+ if (TREE_CODE (decl) == VAR_DECL && FIELD_STATIC (decl)
+ && FIELD_FINAL (decl))
+ {
+ tree init = DECL_INITIAL (decl);
+ if (init != NULL_TREE)
+ init = fold_constant_for_init (init, decl);
+ if (init != NULL_TREE && CONSTANT_VALUE_P (init))
+ return expr;
+ }
+
+ return build_class_init (clas, expr);
+}
+
/* Try to constant fold NODE.
If NODE is not a constant expression, return NULL_EXPR.
CONTEXT is a static final VAR_DECL whose initializer we are folding. */
@@ -15410,11 +15591,13 @@ fold_constant_for_init (node, context)
tree op0, op1, val;
enum tree_code code = TREE_CODE (node);
- if (code == STRING_CST || code == INTEGER_CST || code == REAL_CST)
- return node;
-
switch (code)
{
+ case STRING_CST:
+ case INTEGER_CST:
+ case REAL_CST:
+ return node;
+
case PLUS_EXPR:
case MINUS_EXPR:
case MULT_EXPR:
@@ -15574,8 +15757,6 @@ mark_parser_ctxt (p)
ggc_mark_tree (pc->class_type);
ggc_mark_tree (pc->function_decl);
ggc_mark_tree (pc->package);
- ggc_mark_tree (pc->incomplete_class);
- ggc_mark_tree (pc->gclass_list);
ggc_mark_tree (pc->class_list);
ggc_mark_tree (pc->current_parsed_class);
ggc_mark_tree (pc->current_parsed_class_un);
@@ -15591,3 +15772,10 @@ mark_parser_ctxt (p)
if (pc->next)
mark_parser_ctxt (&pc->next);
}
+
+void
+init_src_parse ()
+{
+ /* Register roots with the garbage collector. */
+ ggc_add_tree_root (src_parse_roots, sizeof (src_parse_roots) / sizeof(tree));
+}
diff --git a/gcc/java/typeck.c b/gcc/java/typeck.c
index eb3b5339963..df5ccedb56f 100644
--- a/gcc/java/typeck.c
+++ b/gcc/java/typeck.c
@@ -40,6 +40,7 @@ static tree convert_ieee_real_to_integer PARAMS ((tree, tree));
static tree parse_signature_type PARAMS ((const unsigned char **,
const unsigned char *));
static tree lookup_do PARAMS ((tree, tree, tree, tree, tree (*)(tree)));
+static tree build_null_signature PARAMS ((tree));
tree * type_map;
extern struct obstack permanent_obstack;
@@ -406,7 +407,9 @@ build_java_array_type (element_type, length)
el_name = TYPE_NAME (el_name);
if (TREE_CODE (el_name) == TYPE_DECL)
el_name = DECL_NAME (el_name);
- TYPE_NAME (t) = identifier_subst (el_name, "", '.', '.', "[]");
+ TYPE_NAME (t) = build_decl (TYPE_DECL,
+ identifier_subst (el_name, "", '.', '.', "[]"),
+ t);
set_java_signature (t, sig);
set_super_info (0, t, object_type_node, 0);
@@ -420,6 +423,7 @@ build_java_array_type (element_type, length)
DECL_CONTEXT (fld) = t;
FIELD_PUBLIC (fld) = 1;
FIELD_FINAL (fld) = 1;
+ TREE_READONLY (fld) = 1;
atype = build_prim_array_type (element_type, length);
arfld = build_decl (FIELD_DECL, get_identifier ("data"), atype);
@@ -576,6 +580,13 @@ get_type_from_signature (tree signature)
return type;
}
+static tree
+build_null_signature (type)
+ tree type ATTRIBUTE_UNUSED;
+{
+ return NULL_TREE;
+}
+
/* Return the signature string for the arguments of method type TYPE. */
tree
@@ -758,9 +769,20 @@ lookup_java_method (searched_class, method_name, method_signature)
method_signature, build_java_signature);
}
-/* Search in class SEARCHED_CLASS (an its superclasses) for a method
+/* Return true iff CLASS (or its ancestors) has a method METHOD_NAME. */
+
+int
+has_method (class, method_name)
+ tree class;
+ tree method_name;
+{
+ return lookup_do (class, class, method_name,
+ NULL_TREE, build_null_signature) != NULL_TREE;
+}
+
+/* Search in class SEARCHED_CLASS (and its superclasses) for a method
matching METHOD_NAME and signature SIGNATURE. Also search in
- SEARCHED_INTERFACE (an its superinterfaces) for a similar match.
+ SEARCHED_INTERFACE (and its superinterfaces) for a similar match.
Return the matched method DECL or NULL_TREE. SIGNATURE_BUILDER is
used on method candidates to build their (sometimes partial)
signature. */
diff --git a/gcc/java/verify.c b/gcc/java/verify.c
index 5ac1d057e5c..25d3b3a2377 100644
--- a/gcc/java/verify.c
+++ b/gcc/java/verify.c
@@ -294,8 +294,6 @@ type_stack_dup (size, offset)
{
tree type[4];
int index;
- if (size + offset > stack_pointer)
- error ("stack underflow - dup* operation");
for (index = 0; index < size + offset; index++)
{
type[index] = stack_type_map[stack_pointer - 1];
@@ -413,7 +411,7 @@ verify_jvm_instructions (jcf, byte_ops, length)
int PC;
int oldpc = 0; /* PC of start of instruction. */
int prevpc = 0; /* If >= 0, PC of previous instruction. */
- const char *message;
+ const char *message = 0;
char *pmessage;
int i;
int index;
@@ -923,12 +921,18 @@ verify_jvm_instructions (jcf, byte_ops, length)
case OPCODE_new:
PUSH_TYPE (get_class_constant (jcf, IMMEDIATE_u2));
break;
- case OPCODE_dup: type_stack_dup (1, 0); break;
- case OPCODE_dup_x1: type_stack_dup (1, 1); break;
- case OPCODE_dup_x2: type_stack_dup (1, 2); break;
- case OPCODE_dup2: type_stack_dup (2, 0); break;
- case OPCODE_dup2_x1: type_stack_dup (2, 1); break;
- case OPCODE_dup2_x2: type_stack_dup (2, 2); break;
+ case OPCODE_dup: wide = 1; index = 0; goto dup;
+ case OPCODE_dup_x1: wide = 1; index = 1; goto dup;
+ case OPCODE_dup_x2: wide = 1; index = 2; goto dup;
+ case OPCODE_dup2: wide = 2; index = 0; goto dup;
+ case OPCODE_dup2_x1: wide = 2; index = 1; goto dup;
+ case OPCODE_dup2_x2: wide = 2; index = 2; goto dup;
+ dup:
+ if (wide + index > stack_pointer)
+ VERIFICATION_ERROR ("stack underflow - dup* operation");
+ type_stack_dup (wide, index);
+ wide = 0;
+ break;
case OPCODE_pop: index = 1; goto pop;
case OPCODE_pop2: index = 2; goto pop;
pop:
@@ -1133,7 +1137,7 @@ verify_jvm_instructions (jcf, byte_ops, length)
case OPCODE_athrow:
/* FIXME: athrow also empties the stack. */
- pop_type (throwable_type_node);
+ POP_TYPE (throwable_type_node, "missing throwable at athrow" );
INVALIDATE_PC;
break;
@@ -1152,7 +1156,7 @@ verify_jvm_instructions (jcf, byte_ops, length)
{
jint low, high;
- pop_type (int_type_node);
+ POP_TYPE (int_type_node, "missing int for tableswitch");
while (PC%4)
{
if (byte_ops[PC++])
@@ -1175,7 +1179,7 @@ verify_jvm_instructions (jcf, byte_ops, length)
{
jint npairs, last = 0, not_registered = 1;
- pop_type (int_type_node);
+ POP_TYPE (int_type_node, "missing int for lookupswitch");
while (PC%4)
{
if (byte_ops[PC++])
diff --git a/gcc/java/zipfile.h b/gcc/java/zipfile.h
index f0be3cca4ec..e30fdda3832 100644
--- a/gcc/java/zipfile.h
+++ b/gcc/java/zipfile.h
@@ -60,7 +60,7 @@ extern struct ZipFile *SeenZipFiles;
extern ZipFile * opendir_in_zip PARAMS ((const char *, int));
extern int read_zip_archive PARAMS ((ZipFile *));
-#ifdef JCF_ZIP
+#ifdef JCF_H
extern int read_zip_member PARAMS ((JCF*, ZipDirectory*, ZipFile *));
extern int open_in_zip PARAMS ((struct JCF *, const char *,
const char *, int));
diff --git a/gcc/jump.c b/gcc/jump.c
index 978b2666a0e..67bde88e44b 100644
--- a/gcc/jump.c
+++ b/gcc/jump.c
@@ -59,7 +59,6 @@ Boston, MA 02111-1307, USA. */
#include "hard-reg-set.h"
#include "regs.h"
#include "insn-config.h"
-#include "insn-flags.h"
#include "insn-attr.h"
#include "recog.h"
#include "function.h"
@@ -212,15 +211,6 @@ jump_optimize_1 (f, cross_jump, noop_moves, after_regscan,
cross_jump_death_matters = (cross_jump == 2);
max_uid = init_label_info (f) + 1;
- /* If we are performing cross jump optimizations, then initialize
- tables mapping UIDs to EH regions to avoid incorrect movement
- of insns from one EH region to another. */
- if (flag_exceptions && cross_jump)
- init_insn_eh_region (f, max_uid);
-
- if (! mark_labels_only)
- delete_barrier_successors (f);
-
/* Leave some extra room for labels and duplicate exit test insns
we make. */
max_jump_chain = max_uid * 14 / 10;
@@ -236,8 +226,6 @@ jump_optimize_1 (f, cross_jump, noop_moves, after_regscan,
if (GET_CODE (XEXP (insn, 0)) == CODE_LABEL)
LABEL_NUSES (XEXP (insn, 0))++;
- check_exception_handler_labels ();
-
/* Keep track of labels used for marking handlers for exception
regions; they cannot usually be deleted. */
@@ -250,8 +238,7 @@ jump_optimize_1 (f, cross_jump, noop_moves, after_regscan,
if (mark_labels_only)
goto end;
- if (! minimal)
- exception_optimize ();
+ delete_barrier_successors (f);
last_insn = delete_unreferenced_labels (f);
@@ -420,6 +407,28 @@ jump_optimize_1 (f, cross_jump, noop_moves, after_regscan,
if (temp2 == temp)
{
+ /* Ensure that we jump to the later of the two labels.
+ Consider:
+
+ if (test) goto L2;
+ goto L1;
+ ...
+ L1:
+ (clobber return-reg)
+ L2:
+ (use return-reg)
+
+ If we leave the goto L1, we'll incorrectly leave
+ return-reg dead for TEST true. */
+
+ temp2 = next_active_insn (JUMP_LABEL (insn));
+ if (!temp2)
+ temp2 = get_last_insn ();
+ if (GET_CODE (temp2) != CODE_LABEL)
+ temp2 = prev_label (temp2);
+ if (temp2 != JUMP_LABEL (temp))
+ redirect_jump (temp, temp2, 1);
+
delete_jump (insn);
changed = 1;
continue;
@@ -808,7 +817,24 @@ delete_barrier_successors (f)
while (insn != 0 && GET_CODE (insn) != CODE_LABEL)
{
- if (GET_CODE (insn) == NOTE
+ if (GET_CODE (insn) == JUMP_INSN)
+ {
+ /* Detect when we're deleting a tablejump; get rid of
+ the jump table as well. */
+ rtx next1 = next_nonnote_insn (insn);
+ rtx next2 = next1 ? next_nonnote_insn (next1) : 0;
+ if (next2 && GET_CODE (next1) == CODE_LABEL
+ && GET_CODE (next2) == JUMP_INSN
+ && (GET_CODE (PATTERN (next2)) == ADDR_VEC
+ || GET_CODE (PATTERN (next2)) == ADDR_DIFF_VEC))
+ {
+ delete_insn (insn);
+ insn = next2;
+ }
+ else
+ insn = delete_insn (insn);
+ }
+ else if (GET_CODE (insn) == NOTE
&& NOTE_LINE_NUMBER (insn) != NOTE_INSN_FUNCTION_END)
insn = NEXT_INSN (insn);
else
@@ -859,6 +885,17 @@ mark_all_labels (f, cross_jump)
mark_all_labels (XEXP (PATTERN (insn), 0), cross_jump);
mark_all_labels (XEXP (PATTERN (insn), 1), cross_jump);
mark_all_labels (XEXP (PATTERN (insn), 2), cross_jump);
+
+ /* Canonicalize the tail recursion label attached to the
+ CALL_PLACEHOLDER insn. */
+ if (XEXP (PATTERN (insn), 3))
+ {
+ rtx label_ref = gen_rtx_LABEL_REF (VOIDmode,
+ XEXP (PATTERN (insn), 3));
+ mark_jump_label (label_ref, insn, cross_jump, 0);
+ XEXP (PATTERN (insn), 3) = XEXP (label_ref, 0);
+ }
+
continue;
}
@@ -1421,13 +1458,6 @@ find_cross_jump (e1, e2, minimum, f1, f2)
if (i2 == 0 || GET_CODE (i1) != GET_CODE (i2))
break;
- /* Avoid moving insns across EH regions if either of the insns
- can throw. */
- if (flag_exceptions
- && (asynchronous_exceptions || GET_CODE (i1) == CALL_INSN)
- && !in_same_eh_region (i1, i2))
- break;
-
p1 = PATTERN (i1);
p2 = PATTERN (i2);
@@ -1699,7 +1729,7 @@ jump_back_p (insn, target)
&& rtx_renumbered_equal_p (XEXP (cinsn, 1), XEXP (ctarget, 1)));
}
-/* Given a comparison (CODE ARG0 ARG1), inside a insn, INSN, return an code
+/* Given a comparison (CODE ARG0 ARG1), inside an insn, INSN, return a code
of reversed comparison if it is possible to do so. Otherwise return UNKNOWN.
UNKNOWN may be returned in case we are having CC_MODE compare and we don't
know whether it's source is floating point or integer comparison. Machine
@@ -1734,7 +1764,7 @@ reversed_comparison_code_parts (code, arg0, arg1, insn)
}
#endif
- /* Try few special cases based on the comparison code. */
+ /* Try a few special cases based on the comparison code. */
switch (code)
{
case GEU:
@@ -2542,7 +2572,6 @@ mark_jump_label (x, insn, cross_jump, in_mem)
{
rtx label = XEXP (x, 0);
rtx olabel = label;
- rtx note;
rtx next;
/* Ignore remaining references to unreachable labels that
@@ -2588,32 +2617,36 @@ mark_jump_label (x, insn, cross_jump, in_mem)
{
if (GET_CODE (insn) == JUMP_INSN)
JUMP_LABEL (insn) = label;
-
- /* If we've changed OLABEL and we had a REG_LABEL note
- for it, update it as well. */
- else if (label != olabel
- && (note = find_reg_note (insn, REG_LABEL, olabel)) != 0)
- XEXP (note, 0) = label;
-
- /* Otherwise, add a REG_LABEL note for LABEL unless there already
- is one. */
- else if (! find_reg_note (insn, REG_LABEL, label))
+ else
{
- /* This code used to ignore labels which refered to dispatch
- tables to avoid flow.c generating worse code.
-
- However, in the presense of global optimizations like
- gcse which call find_basic_blocks without calling
- life_analysis, not recording such labels will lead
- to compiler aborts because of inconsistencies in the
- flow graph. So we go ahead and record the label.
-
- It may also be the case that the optimization argument
- is no longer valid because of the more accurate cfg
- we build in find_basic_blocks -- it no longer pessimizes
- code when it finds a REG_LABEL note. */
- REG_NOTES (insn) = gen_rtx_INSN_LIST (REG_LABEL, label,
- REG_NOTES (insn));
+ /* If we've changed the label, update notes accordingly. */
+ if (label != olabel)
+ {
+ rtx note;
+
+ /* We may have a REG_LABEL note to indicate that this
+ instruction uses the label. */
+ note = find_reg_note (insn, REG_LABEL, olabel);
+ if (note)
+ XEXP (note, 0) = label;
+
+ /* We may also have a REG_EQUAL note to indicate that
+ a register is being set to the address of the
+ label. */
+ note = find_reg_note (insn, REG_EQUAL, NULL_RTX);
+ if (note
+ && GET_CODE (XEXP (note, 0)) == LABEL_REF
+ && XEXP (XEXP (note, 0), 0) == olabel)
+ XEXP (XEXP (note, 0), 0) = label;
+ }
+
+ /* Add a REG_LABEL note for LABEL unless there already
+ is one. All uses of a label, except for labels
+ that are the targets of jumps, must have a
+ REG_LABEL note. */
+ if (! find_reg_note (insn, REG_LABEL, label))
+ REG_NOTES (insn) = gen_rtx_INSN_LIST (REG_LABEL, label,
+ REG_NOTES (insn));
}
}
return;
@@ -2882,16 +2915,15 @@ delete_insn (insn)
to special NOTEs instead. When not optimizing, leave them alone. */
if (was_code_label && LABEL_NAME (insn) != 0)
{
- if (! optimize)
- dont_really_delete = 1;
- else if (! dont_really_delete)
+ if (optimize)
{
const char *name = LABEL_NAME (insn);
PUT_CODE (insn, NOTE);
NOTE_LINE_NUMBER (insn) = NOTE_INSN_DELETED_LABEL;
NOTE_SOURCE_FILE (insn) = name;
- dont_really_delete = 1;
}
+
+ dont_really_delete = 1;
}
else
/* Mark this insn as deleted. */
@@ -3800,7 +3832,7 @@ static int modified_mem;
static void
mark_modified_reg (dest, x, data)
rtx dest;
- rtx x ATTRIBUTE_UNUSED;
+ rtx x;
void *data ATTRIBUTE_UNUSED;
{
int regno;
@@ -3818,7 +3850,13 @@ mark_modified_reg (dest, x, data)
regno = REGNO (dest);
if (regno >= FIRST_PSEUDO_REGISTER)
modified_regs[regno] = 1;
- else
+ /* Don't consider a hard condition code register as modified,
+ if it is only being set. thread_jumps will check if it is set
+ to the same value. */
+ else if (GET_MODE_CLASS (GET_MODE (dest)) != MODE_CC
+ || GET_CODE (x) != SET
+ || ! rtx_equal_p (dest, SET_DEST (x))
+ || HARD_REGNO_NREGS (regno, GET_MODE (dest)) != 1)
for (i = 0; i < HARD_REGNO_NREGS (regno, GET_MODE (dest)); i++)
modified_regs[regno + i] = 1;
}
diff --git a/gcc/libgcc-std.ver b/gcc/libgcc-std.ver
index 87aac0dfaca..6bc42213291 100644
--- a/gcc/libgcc-std.ver
+++ b/gcc/libgcc-std.ver
@@ -1,47 +1,82 @@
GCC_3.0 {
- # libgcc1 symbols
+ # libgcc1 integer symbols
__absvsi2
- __adddf3
- __addsf3
__addvsi3
__ashlsi3
__ashrsi3
- __divdf3
- __divsf3
__divsi3
+ __lshrsi3
+ __modsi3
+ __mulsi3
+ __mulvsi3
+ __negvsi2
+ __subvsi3
+ __udivsi3
+ __umodsi3
+
+ # libgcc1 floating point symbols
+ __addsf3
+ __adddf3
+ __addxf3
+ __addtf3
+ __divsf3
+ __divdf3
+ __divxf3
__divtf3
- __eqdf2
__eqsf2
+ __eqdf2
+ __eqxf2
+ __eqtf2
+ __extenddfxf2
+ __extenddftf2
__extendsfdf2
- __fixdfsi
+ __extendsfxf2
+ __extendsftf2
__fixsfsi
- __floatsidf
+ __fixdfsi
+ __fixxfsi
+ __fixtfsi
__floatsisf
- __gedf2
+ __floatsidf
+ __floatsixf
+ __floatsitf
__gesf2
- __gtdf2
+ __gedf2
+ __gexf2
+ __getf2
__gtsf2
- __ledf2
+ __gtdf2
+ __gtxf2
+ __gttf2
__lesf2
- __lshrsi3
- __ltdf2
+ __ledf2
+ __lexf2
+ __letf2
__ltsf2
- __modsi3
- __muldf3
+ __ltdf2
+ __ltxf2
+ __lttf2
__mulsf3
- __mulsi3
- __mulvsi3
- __nedf2
- __negdf2
+ __muldf3
+ __mulxf3
+ __multf3
__negsf2
- __negvsi2
+ __negdf2
+ __negxf2
+ __negtf2
__nesf2
- __subdf3
+ __nedf2
+ __nexf2
+ __netf2
__subsf3
- __subvsi3
+ __subdf3
+ __subxf3
+ __subtf3
__truncdfsf2
- __udivsi3
- __umodsi3
+ __truncxfsf2
+ __trunctfsf2
+ __truncxfdf2
+ __trunctfdf2
# libgcc2 DImode arithmetic (for 32-bit targets).
__absvdi2
@@ -53,10 +88,20 @@ GCC_3.0 {
__ffsdi2
__fixdfdi
__fixsfdi
+ __fixtfdi
+ __fixxfdi
__fixunsdfdi
+ __fixunsdfsi
+ __fixunssfsi
__fixunssfdi
+ __fixunstfdi
+ __fixunstfsi
+ __fixunsxfdi
+ __fixunsxfsi
__floatdidf
__floatdisf
+ __floatdixf
+ __floatditf
__lshrdi3
__moddi3
__muldi3
@@ -77,6 +122,8 @@ GCC_3.0 {
__ffsti2
__fixdfti
__fixsfti
+ __fixtfti
+ __fixxfti
__lshrti3
__modti3
__multi3
@@ -87,53 +134,44 @@ GCC_3.0 {
__umodti3
__fixunsdfti
__fixunssfti
+ __fixunstfti
+ __fixunsxfti
__floattidf
__floattisf
- __fixtfti
- __fixunstfti
+ __floattixf
__floattitf
- # Basic block profile symbols.
- # ??? Some of these are for `-a', which ought to die.
- __bb
- __bb_exit_func
- __bb_fork_func
- __bb_init_func
- __bb_init_trace_func
- __bb_trace_func
- __bb_trace_ret
-
- # ??? Symbols that perhaps unused should be nuked.
- __builtin_saveregs
+ # Used to deal with trampoline initialization on some platforms
__clear_cache
- __dummy
- __empty
- __eprintf
- __gcc_bcmp
# EH symbols
- __default_terminate
+ _Unwind_DeleteException
+ _Unwind_Find_FDE
+ _Unwind_ForcedUnwind
+ _Unwind_GetGR
+ _Unwind_GetIP
+ _Unwind_GetLanguageSpecificData
+ _Unwind_GetRegionStart
+ _Unwind_GetTextRelBase
+ _Unwind_GetDataRelBase
+ _Unwind_RaiseException
+ _Unwind_Resume
+ _Unwind_SetGR
+ _Unwind_SetIP
__deregister_frame
__deregister_frame_info
- __eh_alloc
- __eh_free
- __eh_rtime_match
- __frame_state_for
- __get_dynamic_handler_chain
- __get_eh_context
- __get_eh_info
- __get_eh_table_language
- __get_eh_table_version
+ __deregister_frame_info_bases
__register_frame
__register_frame_info
+ __register_frame_info_bases
__register_frame_info_table
+ __register_frame_info_table_bases
__register_frame_table
- __rethrow
- __sjpopnthrow
- __sjthrow
- __terminate
- __terminate_set_func
- __throw
- __throw_type_match
- __unwinding_cleanup
+
+ # SjLj EH symbols
+ _Unwind_SjLj_Register
+ _Unwind_SjLj_Unregister
+ _Unwind_SjLj_RaiseException
+ _Unwind_SjLj_ForcedUnwind
+ _Unwind_SjLj_Resume
}
diff --git a/gcc/libgcc2.c b/gcc/libgcc2.c
index 9e7aa99ae94..3658ffeabae 100644
--- a/gcc/libgcc2.c
+++ b/gcc/libgcc2.c
@@ -35,6 +35,7 @@ Boston, MA 02111-1307, USA. */
#include "tconfig.h"
#include "tsystem.h"
+#include "hwint.h"
#include "machmode.h"
@@ -1238,241 +1239,17 @@ __gcc_bcmp (const unsigned char *s1, const unsigned char *s2, size_t size)
}
#endif
-
-#ifdef L__dummy
-void
-__dummy (void) {}
-#endif
-
-#ifdef L_varargs
-#ifdef __i860__
-#if defined(__svr4__) || defined(__alliant__)
- asm (" .text");
- asm (" .align 4");
-
-/* The Alliant needs the added underscore. */
- asm (".globl __builtin_saveregs");
-asm ("__builtin_saveregs:");
- asm (".globl ___builtin_saveregs");
-asm ("___builtin_saveregs:");
-
- asm (" andnot 0x0f,%sp,%sp"); /* round down to 16-byte boundary */
- asm (" adds -96,%sp,%sp"); /* allocate stack space for reg save
- area and also for a new va_list
- structure */
- /* Save all argument registers in the arg reg save area. The
- arg reg save area must have the following layout (according
- to the svr4 ABI):
-
- struct {
- union {
- float freg[8];
- double dreg[4];
- } float_regs;
- long ireg[12];
- };
- */
-
- asm (" fst.q %f8, 0(%sp)"); /* save floating regs (f8-f15) */
- asm (" fst.q %f12,16(%sp)");
-
- asm (" st.l %r16,32(%sp)"); /* save integer regs (r16-r27) */
- asm (" st.l %r17,36(%sp)");
- asm (" st.l %r18,40(%sp)");
- asm (" st.l %r19,44(%sp)");
- asm (" st.l %r20,48(%sp)");
- asm (" st.l %r21,52(%sp)");
- asm (" st.l %r22,56(%sp)");
- asm (" st.l %r23,60(%sp)");
- asm (" st.l %r24,64(%sp)");
- asm (" st.l %r25,68(%sp)");
- asm (" st.l %r26,72(%sp)");
- asm (" st.l %r27,76(%sp)");
-
- asm (" adds 80,%sp,%r16"); /* compute the address of the new
- va_list structure. Put in into
- r16 so that it will be returned
- to the caller. */
-
- /* Initialize all fields of the new va_list structure. This
- structure looks like:
-
- typedef struct {
- unsigned long ireg_used;
- unsigned long freg_used;
- long *reg_base;
- long *mem_ptr;
- } va_list;
- */
-
- asm (" st.l %r0, 0(%r16)"); /* nfixed */
- asm (" st.l %r0, 4(%r16)"); /* nfloating */
- asm (" st.l %sp, 8(%r16)"); /* __va_ctl points to __va_struct. */
- asm (" bri %r1"); /* delayed return */
- asm (" st.l %r28,12(%r16)"); /* pointer to overflow args */
-
-#else /* not __svr4__ */
-#if defined(__PARAGON__)
- /*
- * we'll use SVR4-ish varargs but need SVR3.2 assembler syntax,
- * and we stand a better chance of hooking into libraries
- * compiled by PGI. [andyp@ssd.intel.com]
- */
- asm (" .text");
- asm (" .align 4");
- asm (".globl __builtin_saveregs");
-asm ("__builtin_saveregs:");
- asm (".globl ___builtin_saveregs");
-asm ("___builtin_saveregs:");
-
- asm (" andnot 0x0f,sp,sp"); /* round down to 16-byte boundary */
- asm (" adds -96,sp,sp"); /* allocate stack space for reg save
- area and also for a new va_list
- structure */
- /* Save all argument registers in the arg reg save area. The
- arg reg save area must have the following layout (according
- to the svr4 ABI):
-
- struct {
- union {
- float freg[8];
- double dreg[4];
- } float_regs;
- long ireg[12];
- };
- */
-
- asm (" fst.q f8, 0(sp)");
- asm (" fst.q f12,16(sp)");
- asm (" st.l r16,32(sp)");
- asm (" st.l r17,36(sp)");
- asm (" st.l r18,40(sp)");
- asm (" st.l r19,44(sp)");
- asm (" st.l r20,48(sp)");
- asm (" st.l r21,52(sp)");
- asm (" st.l r22,56(sp)");
- asm (" st.l r23,60(sp)");
- asm (" st.l r24,64(sp)");
- asm (" st.l r25,68(sp)");
- asm (" st.l r26,72(sp)");
- asm (" st.l r27,76(sp)");
-
- asm (" adds 80,sp,r16"); /* compute the address of the new
- va_list structure. Put in into
- r16 so that it will be returned
- to the caller. */
-
- /* Initialize all fields of the new va_list structure. This
- structure looks like:
-
- typedef struct {
- unsigned long ireg_used;
- unsigned long freg_used;
- long *reg_base;
- long *mem_ptr;
- } va_list;
- */
-
- asm (" st.l r0, 0(r16)"); /* nfixed */
- asm (" st.l r0, 4(r16)"); /* nfloating */
- asm (" st.l sp, 8(r16)"); /* __va_ctl points to __va_struct. */
- asm (" bri r1"); /* delayed return */
- asm (" st.l r28,12(r16)"); /* pointer to overflow args */
-#else /* not __PARAGON__ */
- asm (" .text");
- asm (" .align 4");
-
- asm (".globl ___builtin_saveregs");
- asm ("___builtin_saveregs:");
- asm (" mov sp,r30");
- asm (" andnot 0x0f,sp,sp");
- asm (" adds -96,sp,sp"); /* allocate sufficient space on the stack */
-
-/* Fill in the __va_struct. */
- asm (" st.l r16, 0(sp)"); /* save integer regs (r16-r27) */
- asm (" st.l r17, 4(sp)"); /* int fixed[12] */
- asm (" st.l r18, 8(sp)");
- asm (" st.l r19,12(sp)");
- asm (" st.l r20,16(sp)");
- asm (" st.l r21,20(sp)");
- asm (" st.l r22,24(sp)");
- asm (" st.l r23,28(sp)");
- asm (" st.l r24,32(sp)");
- asm (" st.l r25,36(sp)");
- asm (" st.l r26,40(sp)");
- asm (" st.l r27,44(sp)");
-
- asm (" fst.q f8, 48(sp)"); /* save floating regs (f8-f15) */
- asm (" fst.q f12,64(sp)"); /* int floating[8] */
-
-/* Fill in the __va_ctl. */
- asm (" st.l sp, 80(sp)"); /* __va_ctl points to __va_struct. */
- asm (" st.l r28,84(sp)"); /* pointer to more args */
- asm (" st.l r0, 88(sp)"); /* nfixed */
- asm (" st.l r0, 92(sp)"); /* nfloating */
-
- asm (" adds 80,sp,r16"); /* return address of the __va_ctl. */
- asm (" bri r1");
- asm (" mov r30,sp");
- /* recover stack and pass address to start
- of data. */
-#endif /* not __PARAGON__ */
-#endif /* not __svr4__ */
-#else /* not __i860__ */
-#ifdef __sparc__
- asm (".global __builtin_saveregs");
- asm ("__builtin_saveregs:");
- asm (".global ___builtin_saveregs");
- asm ("___builtin_saveregs:");
-#ifdef NEED_PROC_COMMAND
- asm (".proc 020");
-#endif
- asm ("st %i0,[%fp+68]");
- asm ("st %i1,[%fp+72]");
- asm ("st %i2,[%fp+76]");
- asm ("st %i3,[%fp+80]");
- asm ("st %i4,[%fp+84]");
- asm ("retl");
- asm ("st %i5,[%fp+88]");
-#ifdef NEED_TYPE_COMMAND
- asm (".type __builtin_saveregs,#function");
- asm (".size __builtin_saveregs,.-__builtin_saveregs");
-#endif
-#else /* not __sparc__ */
-#if defined(__MIPSEL__) | defined(__R3000__) | defined(__R2000__) | defined(__mips__)
-
- asm (" .text");
-#ifdef __mips16
- asm (" .set nomips16");
-#endif
- asm (" .ent __builtin_saveregs");
- asm (" .globl __builtin_saveregs");
- asm ("__builtin_saveregs:");
- asm (" sw $4,0($30)");
- asm (" sw $5,4($30)");
- asm (" sw $6,8($30)");
- asm (" sw $7,12($30)");
- asm (" j $31");
- asm (" .end __builtin_saveregs");
-#else /* not __mips__, etc. */
-
-void * ATTRIBUTE_NORETURN
-__builtin_saveregs ()
-{
- abort ();
-}
-
-#endif /* not __mips__ */
-#endif /* not __sparc__ */
-#endif /* not __i860__ */
-#endif
+/* __eprintf used to be used by GCC's private version of <assert.h>.
+ We no longer provide that header, but this routine remains in libgcc.a
+ for binary backward compatibility. Note that it is not included in
+ the shared version of libgcc. */
#ifdef L_eprintf
#ifndef inhibit_libc
#undef NULL /* Avoid errors if stdio.h and our stddef.h mismatch. */
#include <stdio.h>
-/* This is used by the `assert' macro. */
+
void
__eprintf (const char *string, const char *expression,
unsigned int line, const char *filename)
@@ -2952,7 +2729,7 @@ cacheflush (char *beg, int size, int flag)
code to run constructors. In that case, we need to handle EH here, too. */
#ifdef EH_FRAME_SECTION
-#include "frame.h"
+#include "unwind-dw2-fde.h"
extern unsigned char __EH_FRAME_BEGIN__[];
#endif
@@ -3129,1221 +2906,3 @@ atexit (func_ptr func)
#endif /* NEED_ATEXIT */
#endif /* L_exit */
-
-#ifdef L_eh
-
-#include "gthr.h"
-
-/* Shared exception handling support routines. */
-
-void
-__default_terminate (void)
-{
- abort ();
-}
-
-static __terminate_func_ptr __terminate_func =
- __default_terminate;
-
-void __attribute__((__noreturn__))
-__terminate (void)
-{
- (*__terminate_func)();
-}
-
-__terminate_func_ptr
-__terminate_set_func (__terminate_func_ptr newfunc)
-{
- __terminate_func_ptr oldfunc = __terminate_func;
-
- __terminate_func = newfunc;
- return (oldfunc);
-}
-
-void *
-__throw_type_match (void *catch_type, void *throw_type, void *obj)
-{
-#if 0
- printf ("__throw_type_match (): catch_type = %s, throw_type = %s\n",
- catch_type, throw_type);
-#endif
- if (strcmp ((const char *)catch_type, (const char *)throw_type) == 0)
- return obj;
- return 0;
-}
-
-void
-__empty (void)
-{
-}
-
-
-/* Include definitions of EH context and table layout */
-
-#include "eh-common.h"
-#ifndef inhibit_libc
-#include <stdio.h>
-#endif
-
-/* Allocate and return a new EH context structure. */
-
-#if __GTHREADS
-static void *
-new_eh_context (void)
-{
- struct eh_full_context {
- struct eh_context c;
- void *top_elt[2];
- } *ehfc = (struct eh_full_context *) malloc (sizeof *ehfc);
-
- if (! ehfc)
- __terminate ();
-
- memset (ehfc, 0, sizeof *ehfc);
-
- ehfc->c.dynamic_handler_chain = (void **) ehfc->top_elt;
-
- /* This should optimize out entirely. This should always be true,
- but just in case it ever isn't, don't allow bogus code to be
- generated. */
-
- if ((void*)(&ehfc->c) != (void*)ehfc)
- __terminate ();
-
- return &ehfc->c;
-}
-
-static __gthread_key_t eh_context_key;
-
-/* Destructor for struct eh_context. */
-static void
-eh_context_free (void *ptr)
-{
- __gthread_key_dtor (eh_context_key, ptr);
- if (ptr)
- free (ptr);
-}
-#endif
-
-/* Pointer to function to return EH context. */
-
-static struct eh_context *eh_context_initialize (void);
-static struct eh_context *eh_context_static (void);
-#if __GTHREADS
-static struct eh_context *eh_context_specific (void);
-#endif
-
-static struct eh_context *(*get_eh_context) (void) = &eh_context_initialize;
-
-/* Routine to get EH context.
- This one will simply call the function pointer. */
-
-void *
-__get_eh_context (void)
-{
- return (void *) (*get_eh_context) ();
-}
-
-/* Get and set the language specific info pointer. */
-
-void **
-__get_eh_info (void)
-{
- struct eh_context *eh = (*get_eh_context) ();
- return &eh->info;
-}
-
-#ifdef DWARF2_UNWIND_INFO
-static int dwarf_reg_size_table_initialized = 0;
-static char dwarf_reg_size_table[DWARF_FRAME_REGISTERS];
-
-static void
-init_reg_size_table (void)
-{
- __builtin_init_dwarf_reg_size_table (dwarf_reg_size_table);
- dwarf_reg_size_table_initialized = 1;
-}
-#endif
-
-#if __GTHREADS
-static void
-eh_threads_initialize (void)
-{
- /* Try to create the key. If it fails, revert to static method,
- otherwise start using thread specific EH contexts. */
- if (__gthread_key_create (&eh_context_key, &eh_context_free) == 0)
- get_eh_context = &eh_context_specific;
- else
- get_eh_context = &eh_context_static;
-}
-#endif /* no __GTHREADS */
-
-/* Initialize EH context.
- This will be called only once, since we change GET_EH_CONTEXT
- pointer to another routine. */
-
-static struct eh_context *
-eh_context_initialize (void)
-{
-#if __GTHREADS
-
- static __gthread_once_t once = __GTHREAD_ONCE_INIT;
- /* Make sure that get_eh_context does not point to us anymore.
- Some systems have dummy thread routines in their libc that
- return a success (Solaris 2.6 for example). */
- if (__gthread_once (&once, eh_threads_initialize) != 0
- || get_eh_context == &eh_context_initialize)
- {
- /* Use static version of EH context. */
- get_eh_context = &eh_context_static;
- }
-#ifdef DWARF2_UNWIND_INFO
- {
- static __gthread_once_t once_regsizes = __GTHREAD_ONCE_INIT;
- if (__gthread_once (&once_regsizes, init_reg_size_table) != 0
- || ! dwarf_reg_size_table_initialized)
- init_reg_size_table ();
- }
-#endif
-
-#else /* no __GTHREADS */
-
- /* Use static version of EH context. */
- get_eh_context = &eh_context_static;
-
-#ifdef DWARF2_UNWIND_INFO
- init_reg_size_table ();
-#endif
-
-#endif /* no __GTHREADS */
-
- return (*get_eh_context) ();
-}
-
-/* Return a static EH context. */
-
-static struct eh_context *
-eh_context_static (void)
-{
- static struct eh_context eh;
- static int initialized;
- static void *top_elt[2];
-
- if (! initialized)
- {
- initialized = 1;
- memset (&eh, 0, sizeof eh);
- eh.dynamic_handler_chain = top_elt;
- }
- return &eh;
-}
-
-#if __GTHREADS
-/* Return a thread specific EH context. */
-
-static struct eh_context *
-eh_context_specific (void)
-{
- struct eh_context *eh;
- eh = (struct eh_context *) __gthread_getspecific (eh_context_key);
- if (! eh)
- {
- eh = new_eh_context ();
- if (__gthread_setspecific (eh_context_key, (void *) eh) != 0)
- __terminate ();
- }
-
- return eh;
-}
-#endif /* __GTHREADS */
-
-/* Support routines for alloc/free during exception handling */
-
-/* __eh_alloc and __eh_free attempt allocation using malloc, but fall back to
- the small arena in the eh_context. This is needed because throwing an
- out-of-memory exception would fail otherwise. The emergency space is
- allocated in blocks of size EH_ALLOC_ALIGN, the
- minimum allocation being two blocks. A bitmask indicates which blocks
- have been allocated. To indicate the size of an allocation, the bit for
- the final block is not set. Hence each allocation is a run of 1s followed
- by a zero. */
-void *
-__eh_alloc (size_t size)
-{
- void *p;
-
- if (!size)
- abort();
- p = malloc (size);
- if (p == 0)
- {
- struct eh_context *eh = __get_eh_context ();
- unsigned blocks = (size + EH_ALLOC_ALIGN - 1) / EH_ALLOC_ALIGN;
- unsigned real_mask = eh->alloc_mask | (eh->alloc_mask << 1);
- unsigned our_mask;
- unsigned ix;
-
- if (blocks > EH_ALLOC_SIZE / EH_ALLOC_ALIGN)
- __terminate ();
- blocks += blocks == 1;
- our_mask = (1 << blocks) - 1;
-
- for (ix = EH_ALLOC_SIZE / EH_ALLOC_ALIGN - blocks; ix; ix--)
- if (! ((real_mask >> ix) & our_mask))
- {
- /* found some space */
- p = &eh->alloc_buffer[ix * EH_ALLOC_ALIGN];
- eh->alloc_mask |= (our_mask >> 1) << ix;
- return p;
- }
- __terminate ();
- }
- return p;
-}
-
-/* Free the memory for an cp_eh_info and associated exception, given
- a pointer to the cp_eh_info. */
-void
-__eh_free (void *p)
-{
- struct eh_context *eh = __get_eh_context ();
-
- ptrdiff_t diff = (char *)p - &eh->alloc_buffer[0];
- if (diff >= 0 && diff < EH_ALLOC_SIZE)
- {
- unsigned mask = eh->alloc_mask;
- unsigned bit = 1 << (diff / EH_ALLOC_ALIGN);
-
- do
- {
- mask ^= bit;
- bit <<= 1;
- }
- while (mask & bit);
- eh->alloc_mask = mask;
- }
- else
- free (p);
-}
-
-/* Support routines for setjmp/longjmp exception handling. */
-
-/* Calls to __sjthrow are generated by the compiler when an exception
- is raised when using the setjmp/longjmp exception handling codegen
- method. */
-
-#ifdef DONT_USE_BUILTIN_SETJMP
-extern void longjmp (void *, int);
-#endif
-
-/* Routine to get the head of the current thread's dynamic handler chain
- use for exception handling. */
-
-void ***
-__get_dynamic_handler_chain (void)
-{
- struct eh_context *eh = (*get_eh_context) ();
- return &eh->dynamic_handler_chain;
-}
-
-/* This is used to throw an exception when the setjmp/longjmp codegen
- method is used for exception handling.
-
- We call __terminate if there are no handlers left. Otherwise we run the
- cleanup actions off the dynamic cleanup stack, and pop the top of the
- dynamic handler chain, and use longjmp to transfer back to the associated
- handler. */
-
-void
-__sjthrow (void)
-{
- struct eh_context *eh = (*get_eh_context) ();
- void ***dhc = &eh->dynamic_handler_chain;
- void *jmpbuf;
- void (*func)(void *, int);
- void *arg;
- /* The cleanup chain is one word into the buffer. Get the cleanup chain. */
- void ***cleanup = (void***)&(*dhc)[1];
-
- /* If there are any cleanups in the chain, run them now. */
- if (cleanup[0])
- {
- double store[200];
- void **buf = (void**)store;
- buf[1] = 0;
- buf[0] = (*dhc);
-
- /* try { */
-#ifdef DONT_USE_BUILTIN_SETJMP
- if (! setjmp (&buf[2]))
-#else
- if (! __builtin_setjmp (&buf[2]))
-#endif
- {
- *dhc = buf;
- while (cleanup[0])
- {
- func = (void(*)(void*, int))cleanup[0][1];
- arg = (void*)cleanup[0][2];
-
- /* Update this before running the cleanup. */
- cleanup[0] = (void **)cleanup[0][0];
-
- (*func)(arg, 2);
- }
- *dhc = buf[0];
- }
- /* catch (...) */
- else
- {
- __terminate ();
- }
- }
-
- /* We must call terminate if we try and rethrow an exception, when
- there is no exception currently active and when there are no
- handlers left. */
- if (! eh->info || (*dhc)[0] == 0)
- __terminate ();
-
- /* Find the jmpbuf associated with the top element of the dynamic
- handler chain. The jumpbuf starts two words into the buffer. */
- jmpbuf = &(*dhc)[2];
-
- /* Then we pop the top element off the dynamic handler chain. */
- *dhc = (void**)(*dhc)[0];
-
- /* And then we jump to the handler. */
-
-#ifdef DONT_USE_BUILTIN_SETJMP
- longjmp (jmpbuf, 1);
-#else
- __builtin_longjmp (jmpbuf, 1);
-#endif
-}
-
-/* Run cleanups on the dynamic cleanup stack for the current dynamic
- handler, then pop the handler off the dynamic handler stack, and
- then throw. This is used to skip the first handler, and transfer
- control to the next handler in the dynamic handler stack. */
-
-void
-__sjpopnthrow (void)
-{
- struct eh_context *eh = (*get_eh_context) ();
- void ***dhc = &eh->dynamic_handler_chain;
- void (*func)(void *, int);
- void *arg;
- /* The cleanup chain is one word into the buffer. Get the cleanup chain. */
- void ***cleanup = (void***)&(*dhc)[1];
-
- /* If there are any cleanups in the chain, run them now. */
- if (cleanup[0])
- {
- double store[200];
- void **buf = (void**)store;
- buf[1] = 0;
- buf[0] = (*dhc);
-
- /* try { */
-#ifdef DONT_USE_BUILTIN_SETJMP
- if (! setjmp (&buf[2]))
-#else
- if (! __builtin_setjmp (&buf[2]))
-#endif
- {
- *dhc = buf;
- while (cleanup[0])
- {
- func = (void(*)(void*, int))cleanup[0][1];
- arg = (void*)cleanup[0][2];
-
- /* Update this before running the cleanup. */
- cleanup[0] = (void **)cleanup[0][0];
-
- (*func)(arg, 2);
- }
- *dhc = buf[0];
- }
- /* catch (...) */
- else
- {
- __terminate ();
- }
- }
-
- /* Then we pop the top element off the dynamic handler chain. */
- *dhc = (void**)(*dhc)[0];
-
- __sjthrow ();
-}
-
-/* Support code for all exception region-based exception handling. */
-
-int
-__eh_rtime_match (void *rtime)
-{
- void *info;
- __eh_matcher matcher;
- void *ret;
-
- info = *(__get_eh_info ());
- matcher = ((__eh_info *)info)->match_function;
- if (! matcher)
- {
-#ifndef inhibit_libc
- fprintf (stderr, "Internal Compiler Bug: No runtime type matcher.");
-#endif
- return 0;
- }
- ret = (*matcher) (info, rtime, (void *)0);
- return (ret != NULL);
-}
-
-/* This value identifies the place from which an exception is being
- thrown. */
-
-#ifdef EH_TABLE_LOOKUP
-
-EH_TABLE_LOOKUP
-
-#else
-
-#ifdef DWARF2_UNWIND_INFO
-
-/* Return the table version of an exception descriptor */
-
-short
-__get_eh_table_version (exception_descriptor *table)
-{
- return table->lang.version;
-}
-
-/* Return the originating table language of an exception descriptor */
-
-short
-__get_eh_table_language (exception_descriptor *table)
-{
- return table->lang.language;
-}
-
-/* This routine takes a PC and a pointer to the exception region TABLE for
- its translation unit, and returns the address of the exception handler
- associated with the closest exception table handler entry associated
- with that PC, or 0 if there are no table entries the PC fits in.
-
- In the advent of a tie, we have to give the last entry, as it represents
- an inner block. */
-
-static void *
-old_find_exception_handler (void *pc, old_exception_table *table)
-{
- if (table)
- {
- int pos;
- int best = -1;
-
- /* We can't do a binary search because the table isn't guaranteed
- to be sorted from function to function. */
- for (pos = 0; table[pos].start_region != (void *) -1; ++pos)
- {
- if (table[pos].start_region <= pc && table[pos].end_region > pc)
- {
- /* This can apply. Make sure it is at least as small as
- the previous best. */
- if (best == -1 || (table[pos].end_region <= table[best].end_region
- && table[pos].start_region >= table[best].start_region))
- best = pos;
- }
- /* But it is sorted by starting PC within a function. */
- else if (best >= 0 && table[pos].start_region > pc)
- break;
- }
- if (best != -1)
- return table[best].exception_handler;
- }
-
- return (void *) 0;
-}
-
-/* find_exception_handler finds the correct handler, if there is one, to
- handle an exception.
- returns a pointer to the handler which controlled should be transferred
- to, or NULL if there is nothing left.
- Parameters:
- PC - pc where the exception originates. If this is a rethrow,
- then this starts out as a pointer to the exception table
- entry we wish to rethrow out of.
- TABLE - exception table for the current module.
- EH_INFO - eh info pointer for this exception.
- RETHROW - 1 if this is a rethrow. (see incoming value of PC).
- CLEANUP - returned flag indicating whether this is a cleanup handler.
-*/
-static void *
-find_exception_handler (void *pc, exception_descriptor *table,
- __eh_info *eh_info, int rethrow, int *cleanup)
-{
-
- void *retval = NULL;
- *cleanup = 1;
- if (table)
- {
- int pos = 0;
- /* The new model assumed the table is sorted inner-most out so the
- first region we find which matches is the correct one */
-
- exception_table *tab = &(table->table[0]);
-
- /* Subtract 1 from the PC to avoid hitting the next region */
- if (rethrow)
- {
- /* pc is actually the region table entry to rethrow out of */
- pos = ((exception_table *) pc) - tab;
- pc = ((exception_table *) pc)->end_region - 1;
-
- /* The label is always on the LAST handler entry for a region,
- so we know the next entry is a different region, even if the
- addresses are the same. Make sure its not end of table tho. */
- if (tab[pos].start_region != (void *) -1)
- pos++;
- }
- else
- pc--;
-
- /* We can't do a binary search because the table is in inner-most
- to outermost address ranges within functions */
- for ( ; tab[pos].start_region != (void *) -1; pos++)
- {
- if (tab[pos].start_region <= pc && tab[pos].end_region > pc)
- {
- if (tab[pos].match_info)
- {
- __eh_matcher matcher = eh_info->match_function;
- /* match info but no matcher is NOT a match */
- if (matcher)
- {
- void *ret = (*matcher)((void *) eh_info,
- tab[pos].match_info, table);
- if (ret)
- {
- if (retval == NULL)
- retval = tab[pos].exception_handler;
- *cleanup = 0;
- break;
- }
- }
- }
- else
- {
- if (retval == NULL)
- retval = tab[pos].exception_handler;
- }
- }
- }
- }
- return retval;
-}
-#endif /* DWARF2_UNWIND_INFO */
-#endif /* EH_TABLE_LOOKUP */
-
-#ifdef DWARF2_UNWIND_INFO
-/* Support code for exception handling using static unwind information. */
-
-#include "frame.h"
-
-/* This type is used in get_reg and put_reg to deal with ABIs where a void*
- is smaller than a word, such as the Irix 6 n32 ABI. We cast twice to
- avoid a warning about casting between int and pointer of different
- sizes. */
-
-typedef int ptr_type __attribute__ ((mode (pointer)));
-
-typedef struct
-{
- word_type *reg[DWARF_FRAME_REGISTERS];
-} saved_regs_t;
-
-#ifdef INCOMING_REGNO
-/* Is the saved value for register REG in frame UDATA stored in a register
- window in the previous frame? */
-
-/* ??? The Sparc INCOMING_REGNO references TARGET_FLAT. This allows us
- to use the macro here. One wonders, though, that perhaps TARGET_FLAT
- compiled functions won't work with the frame-unwind stuff here.
- Perhaps the entireity of in_reg_window should be conditional on having
- seen a DW_CFA_GNU_window_save? */
-#define target_flags 0
-
-static int
-in_reg_window (int reg, frame_state *udata)
-{
- if (udata->saved[reg] == REG_SAVED_REG)
- return INCOMING_REGNO (reg) == reg;
- if (udata->saved[reg] != REG_SAVED_OFFSET)
- return 0;
-
-#ifdef STACK_GROWS_DOWNWARD
- return udata->reg_or_offset[reg] > 0;
-#else
- return udata->reg_or_offset[reg] < 0;
-#endif
-}
-#else
-static inline int
-in_reg_window (int reg __attribute__ ((__unused__)),
- frame_state *udata __attribute__ ((__unused__)))
-{
- return 0;
-}
-#endif /* INCOMING_REGNO */
-
-/* Get the address of register REG as saved in UDATA, where SUB_UDATA is a
- frame called by UDATA or 0. */
-
-static word_type *
-get_reg_addr (unsigned reg, frame_state *udata, frame_state *sub_udata)
-{
- while (udata->saved[reg] == REG_SAVED_REG)
- {
- reg = udata->reg_or_offset[reg];
- if (in_reg_window (reg, udata))
- {
- udata = sub_udata;
- sub_udata = NULL;
- }
- }
- if (udata->saved[reg] == REG_SAVED_OFFSET)
- return (word_type *)(udata->cfa + udata->reg_or_offset[reg]);
- else
- /* We don't have a saved copy of this register. */
- return NULL;
-}
-
-/* Get the value of register REG as saved in UDATA, where SUB_UDATA is a
- frame called by UDATA or 0. */
-
-static inline void *
-get_reg (unsigned reg, frame_state *udata, frame_state *sub_udata)
-{
- return (void *)(ptr_type) *get_reg_addr (reg, udata, sub_udata);
-}
-
-/* Overwrite the saved value for register REG in frame UDATA with VAL. */
-
-static inline void
-put_reg (unsigned reg, void *val, frame_state *udata)
-{
- *get_reg_addr (reg, udata, NULL) = (word_type)(ptr_type) val;
-}
-
-/* Copy the saved value for register REG from PTREG to frame
- TARGET_UDATA. Unlike the previous two functions, this can handle
- registers that are not one word large. */
-
-static void
-copy_reg (unsigned reg, word_type *preg, frame_state *target_udata)
-{
- word_type *ptreg = get_reg_addr (reg, target_udata, NULL);
- memcpy (ptreg, preg, dwarf_reg_size_table [reg]);
-}
-
-/* Retrieve the return address for frame UDATA. */
-
-static inline void *
-get_return_addr (frame_state *udata, frame_state *sub_udata)
-{
- return __builtin_extract_return_addr
- (get_reg (udata->retaddr_column, udata, sub_udata));
-}
-
-/* Overwrite the return address for frame UDATA with VAL. */
-
-static inline void
-put_return_addr (void *val, frame_state *udata)
-{
- val = __builtin_frob_return_addr (val);
- put_reg (udata->retaddr_column, val, udata);
-}
-
-/* Given the current frame UDATA and its return address PC, return the
- information about the calling frame in CALLER_UDATA and update the
- register array in SAVED_REGS. */
-
-static void *
-next_stack_level (void *pc, frame_state *udata, frame_state *caller_udata,
- saved_regs_t *saved_regs)
-{
- int i;
- word_type *p;
-
- /* Collect all of the registers for the current frame. */
- for (i = 0; i < DWARF_FRAME_REGISTERS; i++)
- if (udata->saved[i])
- saved_regs->reg[i] = get_reg_addr (i, udata, caller_udata);
-
- caller_udata = __frame_state_for (pc, caller_udata);
- if (! caller_udata)
- return 0;
-
- /* Now go back to our caller's stack frame. If our caller's CFA was
- saved in a register in this stack frame or a previous one, restore it;
- otherwise, assume CFA register is SP and restore it to our CFA value
- (which is defined to be the value of SP in the caller's frame). */
-
- p = saved_regs->reg[caller_udata->cfa_reg];
- if (p)
- caller_udata->cfa = (void *)(ptr_type)*p;
- else
- caller_udata->cfa = udata->cfa;
-
- if (caller_udata->indirect)
- caller_udata->cfa = * (void **) ((unsigned char *)caller_udata->cfa
- + caller_udata->base_offset);
- caller_udata->cfa += caller_udata->cfa_offset;
-
- return caller_udata;
-}
-
-/* Hook to call before __terminate if only cleanup handlers remain. */
-void
-__unwinding_cleanup (void)
-{
-}
-
-/* throw_helper performs some of the common grunt work for a throw. This
- routine is called by throw and rethrows. This is pretty much split
- out from the old __throw routine. An addition has been added which allows
- for a dummy call to a routine __unwinding_cleanup() when there are nothing
- but cleanups remaining. This allows a debugger to examine the state
- at which the throw was executed, before any cleanups, rather than
- at the terminate point after the stack has been unwound.
-
- EH is the current eh_context structure.
- PC is the address of the call to __throw.
- MY_UDATA is the unwind information for __throw.
- OFFSET_P is where we return the SP adjustment offset. */
-
-static void *
-throw_helper (struct eh_context *eh, void *pc, frame_state *my_udata,
- long *offset_p)
-{
- frame_state ustruct2, *udata = &ustruct2;
- frame_state ustruct;
- frame_state *sub_udata = &ustruct;
- void *saved_pc = pc;
- void *handler;
- void *handler_p = 0;
- void *pc_p = 0;
- void *callee_cfa = 0;
- frame_state saved_ustruct;
- int new_eh_model;
- int cleanup = 0;
- int only_cleanup = 0;
- int rethrow = 0;
- int saved_state = 0;
- long args_size;
- saved_regs_t saved_regs, cleanup_regs;
- __eh_info *eh_info = (__eh_info *)eh->info;
- int i;
-
- memset (saved_regs.reg, 0, sizeof saved_regs.reg);
- memset (sub_udata->saved, REG_UNSAVED, sizeof sub_udata->saved);
-
- /* Do we find a handler based on a re-throw PC? */
- if (eh->table_index != (void *) 0)
- rethrow = 1;
-
- memcpy (udata, my_udata, sizeof (*udata));
-
- handler = (void *) 0;
- for (;;)
- {
- frame_state *p = udata;
-
- udata = next_stack_level (pc, udata, sub_udata, &saved_regs);
- sub_udata = p;
-
- /* If we couldn't find the next frame, we lose. */
- if (! udata)
- break;
-
- if (udata->eh_ptr == NULL)
- new_eh_model = 0;
- else
- new_eh_model = (((exception_descriptor *)(udata->eh_ptr))->
- runtime_id_field == NEW_EH_RUNTIME);
-
- if (rethrow)
- {
- rethrow = 0;
- handler = find_exception_handler (eh->table_index, udata->eh_ptr,
- eh_info, 1, &cleanup);
- eh->table_index = (void *)0;
- }
- else
- if (new_eh_model)
- handler = find_exception_handler (pc, udata->eh_ptr, eh_info,
- 0, &cleanup);
- else
- handler = old_find_exception_handler (pc, udata->eh_ptr);
-
- /* If we found one, we can stop searching, if its not a cleanup.
- for cleanups, we save the state, and keep looking. This allows
- us to call a debug hook if there are nothing but cleanups left. */
- if (handler)
- {
- /* sub_udata now refers to the frame called by the handler frame. */
-
- if (cleanup)
- {
- if (!saved_state)
- {
- saved_ustruct = *udata;
- cleanup_regs = saved_regs;
- handler_p = handler;
- pc_p = pc;
- saved_state = 1;
- only_cleanup = 1;
- /* Save the CFA of the frame called by the handler
- frame. */
- callee_cfa = sub_udata->cfa;
- }
- }
- else
- {
- only_cleanup = 0;
- if (!saved_state)
- callee_cfa = sub_udata->cfa;
- break;
- }
- }
-
- /* Otherwise, we continue searching. We subtract 1 from PC to avoid
- hitting the beginning of the next region. */
- pc = get_return_addr (udata, sub_udata) - 1;
- }
-
- if (saved_state)
- {
- udata = &saved_ustruct;
- saved_regs = cleanup_regs;
- handler = handler_p;
- pc = pc_p;
- if (only_cleanup)
- __unwinding_cleanup ();
- }
-
- /* If we haven't found a handler by now, this is an unhandled
- exception. */
- if (! handler)
- __terminate();
-
- eh->handler_label = handler;
-
- args_size = udata->args_size;
-
- /* We adjust SP by the difference between __throw's CFA and the CFA for
- the frame called by the handler frame, because those CFAs correspond
- to the SP values at the two call sites. We need to further adjust by
- the args_size of the handler frame itself to get the handler frame's
- SP from before the args were pushed for that call. */
-#ifdef STACK_GROWS_DOWNWARD
- *offset_p = callee_cfa - my_udata->cfa + args_size;
-#else
- *offset_p = my_udata->cfa - callee_cfa - args_size;
-#endif
-
- /* If we found a handler in the throw context there's no need to
- unwind. */
- if (pc != saved_pc)
- {
- /* Copy saved register values into our register save slots. */
- for (i = 0; i < DWARF_FRAME_REGISTERS; i++)
- if (i != udata->retaddr_column && saved_regs.reg[i])
- copy_reg (i, saved_regs.reg[i], my_udata);
- }
-
- return handler;
-}
-
-
-/* We first search for an exception handler, and if we don't find
- it, we call __terminate on the current stack frame so that we may
- use the debugger to walk the stack and understand why no handler
- was found.
-
- If we find one, then we unwind the frames down to the one that
- has the handler and transfer control into the handler. */
-
-/*extern void __throw(void) __attribute__ ((__noreturn__));*/
-
-void
-__throw (void)
-{
- struct eh_context *eh = (*get_eh_context) ();
- void *pc, *handler;
- long offset;
-
- /* XXX maybe make my_ustruct static so we don't have to look it up for
- each throw. */
- frame_state my_ustruct, *my_udata = &my_ustruct;
-
- /* This is required for C++ semantics. We must call terminate if we
- try and rethrow an exception, when there is no exception currently
- active. */
- if (! eh->info)
- __terminate ();
-
- /* Start at our stack frame. */
-label:
- my_udata = __frame_state_for (&&label, my_udata);
- if (! my_udata)
- __terminate ();
-
- /* We need to get the value from the CFA register. */
- my_udata->cfa = __builtin_dwarf_cfa ();
-
- /* Do any necessary initialization to access arbitrary stack frames.
- On the SPARC, this means flushing the register windows. */
- __builtin_unwind_init ();
-
- /* Now reset pc to the right throw point. The return address points to
- the instruction after the call to __throw; we subtract 1 so that pc
- points into the call insn itself. Since we work with PC ranges (as
- opposed to specific call sites), it isn't important for it to point to
- the very beginning of the call insn, and making it do so would be
- hard on targets with variable length call insns. */
- pc = __builtin_extract_return_addr (__builtin_return_address (0)) - 1;
-
- handler = throw_helper (eh, pc, my_udata, &offset);
-
- /* Now go! */
-
- __builtin_eh_return ((void *)eh, offset, handler);
-
- /* Epilogue: restore the handler frame's register values and return
- to the stub. */
-}
-
-/*extern void __rethrow(void *) __attribute__ ((__noreturn__));*/
-
-void
-__rethrow (void *index)
-{
- struct eh_context *eh = (*get_eh_context) ();
- void *pc, *handler;
- long offset;
-
- /* XXX maybe make my_ustruct static so we don't have to look it up for
- each throw. */
- frame_state my_ustruct, *my_udata = &my_ustruct;
-
- /* This is required for C++ semantics. We must call terminate if we
- try and rethrow an exception, when there is no exception currently
- active. */
- if (! eh->info)
- __terminate ();
-
- /* This is the table index we want to rethrow from. The value of
- the END_REGION label is used for the PC of the throw, and the
- search begins with the next table entry. */
- eh->table_index = index;
-
- /* Start at our stack frame. */
-label:
- my_udata = __frame_state_for (&&label, my_udata);
- if (! my_udata)
- __terminate ();
-
- /* We need to get the value from the CFA register. */
- my_udata->cfa = __builtin_dwarf_cfa ();
-
- /* Do any necessary initialization to access arbitrary stack frames.
- On the SPARC, this means flushing the register windows. */
- __builtin_unwind_init ();
-
- /* Now reset pc to the right throw point. The return address points to
- the instruction after the call to __throw; we subtract 1 so that pc
- points into the call insn itself. Since we work with PC ranges (as
- opposed to specific call sites), it isn't important for it to point to
- the very beginning of the call insn, and making it do so would be
- hard on targets with variable length call insns. */
- pc = __builtin_extract_return_addr (__builtin_return_address (0)) - 1;
-
- handler = throw_helper (eh, pc, my_udata, &offset);
-
- /* Now go! */
-
- __builtin_eh_return ((void *)eh, offset, handler);
-
- /* Epilogue: restore the handler frame's register values and return
- to the stub. */
-}
-#endif /* DWARF2_UNWIND_INFO */
-
-#ifdef IA64_UNWIND_INFO
-#include "frame.h"
-
-/* Return handler to which we want to transfer control, NULL if we don't
- intend to handle this exception here. */
-void *
-__ia64_personality_v1 (void *pc, old_exception_table *table)
-{
- if (table)
- {
- int pos;
- int best = -1;
-
- for (pos = 0; table[pos].start_region != (void *) -1; ++pos)
- {
- if (table[pos].start_region <= pc && table[pos].end_region > pc)
- {
- /* This can apply. Make sure it is at least as small as
- the previous best. */
- if (best == -1 || (table[pos].end_region <= table[best].end_region
- && table[pos].start_region >= table[best].start_region))
- best = pos;
- }
- /* It is sorted by starting PC within a function. */
- else if (best >= 0 && table[pos].start_region > pc)
- break;
- }
- if (best != -1)
- return table[best].exception_handler;
- }
- return (void *) 0;
-}
-
-static void
-ia64_throw_helper (ia64_frame_state *throw_frame, ia64_frame_state *caller,
- void *throw_bsp, void *throw_sp)
-{
- void *throw_pc = __builtin_return_address (0);
- unwind_info_ptr *info;
- void *pc, *handler = NULL;
- void *pc_base;
- int frame_count;
- void *bsp;
-
- __builtin_ia64_flushrs (); /* Make the local register stacks available. */
-
- /* Start at our stack frame, get our state. */
- __build_ia64_frame_state (throw_pc, throw_frame, throw_bsp, throw_sp,
- &pc_base);
-
- /* Now we have to find the proper frame for pc, and see if there
- is a handler for it. if not, we keep going back frames until
- we do find one. Otherwise we call uncaught (). */
-
- frame_count = 0;
- memcpy (caller, throw_frame, sizeof (*caller));
- while (!handler)
- {
- void *(*personality) (void *, old_exception_table *);
- void *eh_table;
-
- frame_count++;
- /* We only care about the RP right now, so we dont need to keep
- any other information about a call frame right now. */
- pc = __get_real_reg_value (&caller->rp) - 1;
- bsp = __calc_caller_bsp ((long)__get_real_reg_value (&caller->pfs),
- caller->my_bsp);
- info = __build_ia64_frame_state (pc, caller, bsp, caller->my_psp,
- &pc_base);
-
- /* If we couldn't find the next frame, we lose. */
- if (! info)
- break;
-
- personality = __get_personality (info);
- /* TODO Haven't figured out how to actually load the personality address
- yet, so just always default to the one we expect for now. */
- if (personality != 0)
- personality = __ia64_personality_v1;
- eh_table = __get_except_table (info);
- /* If there is no personality routine, we'll keep unwinding. */
- if (personality)
- /* Pass a segment relative PC address to the personality routine,
- because the unwind_info section uses segrel relocs. */
- handler = personality ((void *)(pc - pc_base), eh_table);
- }
-
- if (!handler)
- __terminate ();
-
- /* Handler is a segment relative address, so we must adjust it here. */
- handler += (long) pc_base;
-
- /* If we found a handler, we need to unwind the stack to that point.
- We do this by copying saved values from previous frames into the
- save slot for the throw_frame saved slots. when __throw returns,
- it'll pickup the correct values. */
-
- /* Start with where __throw saved things, and copy each saved register
- of each previous frame until we get to the one before we're
- throwing back to. */
- memcpy (caller, throw_frame, sizeof (*caller));
- for ( ; frame_count > 0; frame_count--)
- {
- pc = __get_real_reg_value (&caller->rp) - 1;
- bsp = __calc_caller_bsp ((long)__get_real_reg_value (&caller->pfs),
- caller->my_bsp);
- __build_ia64_frame_state (pc, caller, bsp, caller->my_psp, &pc_base);
- /* Any regs that were saved can be put in the throw frame now. */
- /* We don't want to copy any saved register from the
- target destination, but we do want to load up it's frame. */
- if (frame_count > 1)
- __copy_saved_reg_state (throw_frame, caller);
- }
-
- /* Set return address of the throw frame to the handler. */
- __set_real_reg_value (&throw_frame->rp, handler);
-
- /* TODO, do we need to do anything to make the values we wrote 'stick'? */
- /* DO we need to go through the whole loadrs seqeunce? */
-}
-
-
-void
-__throw ()
-{
- register void *stack_pointer __asm__("r12");
- struct eh_context *eh = (*get_eh_context) ();
- ia64_frame_state my_frame;
- ia64_frame_state originator; /* For the context handler is in. */
- void *bsp, *tmp_bsp;
- long offset;
-
- /* This is required for C++ semantics. We must call terminate if we
- try and rethrow an exception, when there is no exception currently
- active. */
- if (! eh->info)
- __terminate ();
-
- __builtin_unwind_init ();
-
- /* We have to call another routine to actually process the frame
- information, which will force all of __throw's local registers into
- backing store. */
-
- /* Get the value of ar.bsp while we're here. */
-
- bsp = __builtin_ia64_bsp ();
- ia64_throw_helper (&my_frame, &originator, bsp, stack_pointer);
-
- /* Now we have to fudge the bsp by the amount in our (__throw)
- frame marker, since the return is going to adjust it by that much. */
-
- tmp_bsp = __calc_caller_bsp ((long)__get_real_reg_value (&my_frame.pfs),
- my_frame.my_bsp);
- offset = (char *)my_frame.my_bsp - (char *)tmp_bsp;
- tmp_bsp = (char *)originator.my_bsp + offset;
-
- __builtin_eh_return (tmp_bsp, offset, originator.my_sp);
-
- /* The return address was already set by throw_helper. */
-}
-
-#endif /* IA64_UNWIND_INFO */
-
-#endif /* L_eh */
diff --git a/gcc/libgcc2.h b/gcc/libgcc2.h
index 7a26e33ea0b..864ecc05071 100644
--- a/gcc/libgcc2.h
+++ b/gcc/libgcc2.h
@@ -25,15 +25,12 @@ Boston, MA 02111-1307, USA. */
typedef void (*__terminate_func_ptr)(void) __attribute__ ((__noreturn__));
extern int __gcc_bcmp (const unsigned char *, const unsigned char *, size_t);
-extern void *__builtin_saveregs (void);
-extern void __dummy (void);
extern void __clear_cache (char *, char *);
extern void __pure_virtual (void) __attribute__ ((__noreturn__));
extern void __terminate (void) __attribute__ ((__noreturn__));
extern __terminate_func_ptr __terminate_set_func (__terminate_func_ptr);
extern void __default_terminate (void) __attribute__ ((__noreturn__));
extern void *__throw_type_match (void *, void *, void *);
-extern void __empty (void);
extern void *__get_eh_context (void);
extern void **__get_eh_info (void);
extern void ***__get_dynamic_handler_chain (void);
@@ -97,7 +94,9 @@ typedef unsigned int USItype __attribute__ ((mode (SI)));
/* These typedefs are usually forbidden on archs with UNITS_PER_WORD 2 */
typedef int DItype __attribute__ ((mode (DI)));
typedef unsigned int UDItype __attribute__ ((mode (DI)));
-#if MIN_UNITS_PER_WORD > 4
+/* We cannot represent a TItype constant on a machine with 32-bit
+ HOST_WIDE_INTs, so it doesn't make sense to define these types. */
+#if MIN_UNITS_PER_WORD > 4 && HOST_BITS_PER_WIDE_INT >= 64
/* These typedefs are usually forbidden on archs with UNITS_PER_WORD 4 */
typedef int TItype __attribute__ ((mode (TI)));
typedef unsigned int UTItype __attribute__ ((mode (TI)));
@@ -156,7 +155,9 @@ typedef int word_type __attribute__ ((mode (__word__)));
#define float bogus_type
#define double bogus_type
-#if MIN_UNITS_PER_WORD > 4
+/* We can only support a Wtype that fits within a HOST_WIDE_INT. Otherwise,
+ DWtype overflows the tree and RTL types. */
+#if MIN_UNITS_PER_WORD > 4 && HOST_BITS_PER_WIDE_INT >= 64
#define W_TYPE_SIZE (8 * BITS_PER_UNIT)
#define Wtype DItype
#define UWtype UDItype
diff --git a/gcc/limity.h b/gcc/limity.h
index b2831fc459b..8bb398f6786 100644
--- a/gcc/limity.h
+++ b/gcc/limity.h
@@ -4,7 +4,7 @@
#else /* not _GCC_LIMITS_H_ */
#ifdef _GCC_NEXT_LIMITS_H
- #include_next <limits.h> /* recurse down to the real one */
+#include_next <limits.h> /* recurse down to the real one */
#endif
#endif /* not _GCC_LIMITS_H_ */
diff --git a/gcc/listing b/gcc/listing
deleted file mode 100755
index dc989f6eaef..00000000000
--- a/gcc/listing
+++ /dev/null
@@ -1,227 +0,0 @@
-#!/bin/sh -f
-# Generate a source code listing for C or C++ code with assembler code. The
-# listing is always written to stdout.
-# Author: Igor Metz <metz@iam.unibe.ch>
-
-# Revision 1.4 94/08/26 13:58:27 coxs <coxs@dg-rtp.dg.com>
-# lister now guesses how to should be configured. Added elf and coff support.
-#
-# Revision 1.3 89/12/18 13:58:27 metz
-# lister must now be configured before it can be used. This is done in the
-# /bin/sh part of the code.
-#
-#
-# Revision 1.2 89/08/16 17:35:02 metz
-# Support for SPARC added.
-#
-# Revision 1.1 89/08/16 16:49:22 metz
-# Initial revision
-#
-
-# Requires: gawk (may be it works also with nawk)
-
-# usage: lister filename [compiler-options]
-
-# Method:
-# compile the source with -g option to assembler code, then merge the
-# generated assembler code with the source code. Compiler options
-# can be supplied on the command line (for example -O)
-
-# To install lister, assign one of the supported values to the variable MYSYS:
-# mc68020 for Motorola 68020 (Sun-3, ..)
-# mc68030 for Motorola 68030 (Sun-3, ..)
-# sparc for SPARC (SUN-4, ..)
-# i386 for i386 (Sun i386, ...)
-# i386-gnu-linux for i386 (GNU/Linux, ...)
-
-# Guess what kind of objects we are creating and thus what type of assembler
-# symbols to look for
-
-ex /tmp/$$.c <<END >/dev/null
-a
-main (){}
-.
-w
-q
-END
-WD=`pwd`
-cd /tmp
-gcc -c $$.c
-case "`file $$.o`" in
-*ELF*) MYSYS=elf ;;
-*COFF*|*BCS*) MYSYS=coff ;;
-*mc68k*|*M68000*) MYSYS=mc68030 ;;
-*SPARC*) MYSYS=sparc ;;
-*386*) MYSYS=i386 ;;
-esac
-rm $$.c $$.o
-cd $WD
-
-# uncomment the line you need if the above guesses incorrectly:
-# MYSYS=mc68020
-# MYSYS=mc68030
-# MYSYS=sparc
-# MYSYS=i386
-# MYSYS=i386-gnu-linux
-# MYSYS=`mach` # this will work on Suns with SunOS > 4.0.0
-# MYSYS=elf
-# MYSYS=coff
-
-WHOAMI=$0
-if [ $# -gt 0 ] ; then
-FILENAME=$1
-shift
-fi
-
-exec gawk -v whoami=$WHOAMI -vsys=$MYSYS -voptions="$*" '
-# commandline arguments:
-# ARGV[0] = "gawk"
-# ARGV[1] = processid
-# ARGV[2] = filename
-BEGIN {
- if (ARGC != 3) {
- usage()
- exit 1
- }
-
- # Declaration of global variables
- c_filename = ""
- asm_filename = ""
- cmdline = ""
- asm_code = ""
- c_code = ""
- c_lineno = 0
- oldlineno = 0
- newlineno = 0
- ignore_stabd = 0
- num_of_fields = 0
-
- # check processor architecture and set sourcecode line_hint accordingly
- if (sys == "sparc" || sys == "i386") {
- line_hint = "^[ \t]*\.stabn.*"
- line_field = 3;
- line_delimiter = ",";
- line_offset = 0;
- }
- else if (sys == "mc68020" || sys == "mc68030" || sys == "i386-gnu-linux") {
- line_hint = "^[ \t]*\.stabd.*"
- line_field = 3;
- line_delimiter = ",";
- line_offset = 0;
- }
- else if (sys == "elf") {
- line_hint = "section.*\.line"
- line_field = 3;
- line_delimiter = "\t";
- line_offset = 0;
- }
- else if (sys == "coff") {
- line_hint = "^[ \t]*ln"
- line_field = 3;
- line_delimiter = "\t";
- }
- else {
- error("Processor type " sys " is not supported yet, sorry")
- }
-
- parse_cmdline()
-
- printf("compiling %s to asm code\n", c_filename ) > "/dev/stderr"
-
- if (system(cmdline) != 0 ) {
- error("Compilation of " c_filename " failed")
- }
-
- printf("generating listing\n") > "/dev/stderr"
-
-
- while ( getline asm_code < asm_filename > 0 ) {
- if ( (ignore_stabd==0) && (asm_code ~ line_hint)) {
- while ( sys == "elf" && (asm_code !~ "word" && asm_code !~ "byte") &&
- getline asm_code < asm_filename > 0);
- # source line hint found. Split the line into fields separated by commas.
- # num_of_fields is 4 for sparc, 3 for m68k
- num_of_fields = split(asm_code, fields, line_delimiter)
- newlineno = fields[line_field] + line_offset;
-
- if (newlineno > oldlineno) {
- while ( newlineno > c_lineno && getline c_code < c_filename > 0) {
- c_lineno++
- printf("%4d %s\n", c_lineno, c_code)
- }
- oldlineno = newlineno
- }
- }
- else if ( asm_code ~ ".*Ltext[ \t]*$" ) {
- # filename hint found
- if ( match(asm_code, c_filename)) {
- ignore_stabd = 0
- }
- else {
- ignore_stabd = 1
- }
- }
- else if ( sys == "elf" && asm_code ~ "section.*\.debug" ) {
- while ( asm_code !~ "^[ \t]*[.]*previous" &&
- asm_code !~ "\.popsection" &&
- getline asm_code < asm_filename > 0 );
- if ( ! (getline asm_code < asm_filename > 0)) break;
- }
- else if ( sys == "coff" && asm_code ~ "^[ \t]*sdef" ) {
- if ( asm_code ~ "\.bf" ) {
- while ( asm_code !~ "^[ \t]*line" &&
- getline asm_code < asm_filename > 0 ) {
- num_of_fields = split(asm_code, fields, "\t")
- line_offset = fields[line_field] - 1;
- }
- }
- while ( asm_code !~ "^[ \t]*endef" &&
- getline asm_code < asm_filename > 0 ) {
- }
- if ( ! (getline asm_code < asm_filename > 0)) break;
- }
- printf("\t\t\t%s\n", asm_code)
- }
-
- # general cleanup
- system("/bin/rm " asm_filename)
-}
-
-function usage() {
- printf("usage: %s filename compiler-options\n", whoami) > "/dev/stderr"
-}
-
-function error(s) {
- printf("error: %s\n", s) > "/dev/stderr"
- exit 1
-}
-
-function parse_cmdline( i) {
- # construct filenames to use
- asm_filename = "/tmp/lister" ARGV[1] ".s"
- ARGV[1] = ""
- c_filename = ARGV[2]
- ARGV[2] = ""
-
- # construct commandline to use
- if ( match(c_filename, ".C") || match(c_filename, ".cc") ) {
- cmdline = "g++"
- }
- else if (match(c_filename, ".c") || match(c_filename, ".i")) {
- cmdline = "gcc"
- }
- else {
- error("unknown extension for file " c_filename)
- }
-
- cmdline = cmdline " -g -S -o " asm_filename
-
- # now we append the compiler options specified by the user
- cmdline = cmdline " " options
-
- # last but not least: the name of the file to compile
- cmdline = cmdline " " c_filename
-}
-
-' $$ $FILENAME
-
diff --git a/gcc/lists.c b/gcc/lists.c
index b13d171414a..cc5ea746024 100644
--- a/gcc/lists.c
+++ b/gcc/lists.c
@@ -118,15 +118,12 @@ zap_lists (dummy)
unused_insn_list = NULL;
}
+/* Register a ggc root which clears the unused lists at GC time. */
+
void
init_EXPR_INSN_LIST_cache ()
{
- static int initialized;
- if (!initialized)
- {
- initialized = 1;
- ggc_add_root (&unused_expr_list, 1, 1, zap_lists);
- }
+ ggc_add_root (&unused_expr_list, 1, 1, zap_lists);
}
/* This function will free up an entire list of EXPR_LIST nodes. */
diff --git a/gcc/longlong.h b/gcc/longlong.h
index e4d9629d20f..0d9838bf263 100644
--- a/gcc/longlong.h
+++ b/gcc/longlong.h
@@ -916,8 +916,7 @@ UDItype __umulsidi3 (USItype, USItype);
({union {UDItype __ll; \
struct {USItype __h, __l;} __i; \
} __xx; \
- __asm__ ("movw %1,%R0
- uemul %2,%0" \
+ __asm__ ("movw %1,%R0\n\tuemul %2,%0" \
: "=&r" (__xx.__ll) \
: "g" ((USItype) (u)), \
"g" ((USItype) (v))); \
diff --git a/gcc/loop.c b/gcc/loop.c
index eee79a31ae5..65b30d7095a 100644
--- a/gcc/loop.c
+++ b/gcc/loop.c
@@ -44,7 +44,6 @@ Boston, MA 02111-1307, USA. */
#include "hard-reg-set.h"
#include "basic-block.h"
#include "insn-config.h"
-#include "insn-flags.h"
#include "regs.h"
#include "recog.h"
#include "flags.h"
@@ -166,6 +165,7 @@ static void ignore_some_movables PARAMS ((struct loop_movables *));
static void force_movables PARAMS ((struct loop_movables *));
static void combine_movables PARAMS ((struct loop_movables *,
struct loop_regs *));
+static int num_unmoved_movables PARAMS ((const struct loop *));
static int regs_match_p PARAMS ((rtx, rtx, struct loop_movables *));
static int rtx_equal_for_loop_p PARAMS ((rtx, rtx, struct loop_movables *,
struct loop_regs *));
@@ -190,7 +190,7 @@ static void loop_givs_reduce PARAMS((struct loop *, struct iv_class *));
static void loop_givs_rescan PARAMS((struct loop *, struct iv_class *,
rtx *));
static void loop_ivs_free PARAMS((struct loop *));
-static void strength_reduce PARAMS ((struct loop *, int, int));
+static void strength_reduce PARAMS ((struct loop *, int));
static void find_single_use_in_loop PARAMS ((struct loop_regs *, rtx, rtx));
static int valid_initial_value_p PARAMS ((rtx, rtx, int, rtx));
static void find_mem_givs PARAMS ((const struct loop *, rtx, rtx, int, int));
@@ -233,7 +233,8 @@ static int last_use_this_basic_block PARAMS ((rtx, rtx));
static void record_initial PARAMS ((rtx, rtx, void *));
static void update_reg_last_use PARAMS ((rtx, rtx));
static rtx next_insn_in_loop PARAMS ((const struct loop *, rtx));
-static void loop_regs_scan PARAMS ((const struct loop*, int, int *));
+static void loop_regs_scan PARAMS ((const struct loop *, int));
+static int count_insns_in_loop PARAMS ((const struct loop *));
static void load_mems PARAMS ((const struct loop *));
static int insert_loop_mem PARAMS ((rtx *, void *));
static int replace_loop_mem PARAMS ((rtx *, void *));
@@ -259,6 +260,7 @@ static rtx loop_call_insn_hoist PARAMS((const struct loop *, rtx));
static rtx loop_insn_sink_or_swim PARAMS((const struct loop *, rtx));
static void loop_dump_aux PARAMS ((const struct loop *, FILE *, int));
+static void loop_delete_insns PARAMS ((rtx, rtx));
void debug_ivs PARAMS ((const struct loop *));
void debug_iv_class PARAMS ((const struct iv_class *));
void debug_biv PARAMS ((const struct induction *));
@@ -550,7 +552,6 @@ scan_loop (loop, flags)
movables->head = 0;
movables->last = 0;
- movables->num = 0;
/* Determine whether this loop starts with a jump down to a test at
the end. This will occur for a small number of loops with a test
@@ -637,7 +638,8 @@ scan_loop (loop, flags)
/* Allocate extra space for REGs that might be created by load_mems.
We allocate a little extra slop as well, in the hopes that we
won't have to reallocate the regs array. */
- loop_regs_scan (loop, loop_info->mems_idx + 16, &insn_count);
+ loop_regs_scan (loop, loop_info->mems_idx + 16);
+ insn_count = count_insns_in_loop (loop);
if (loop_dump_stream)
{
@@ -770,6 +772,7 @@ scan_loop (loop, flags)
&& (REGNO_LAST_UID (regno)
== INSN_UID (regs->array[regno].single_usage))
&& regs->array[regno].set_in_loop == 1
+ && GET_CODE (SET_SRC (set)) != ASM_OPERANDS
&& ! side_effects_p (SET_SRC (set))
&& ! find_reg_note (p, REG_RETVAL, NULL_RTX)
&& (! SMALL_REGISTER_CLASSES
@@ -1006,7 +1009,7 @@ scan_loop (loop, flags)
/* Recalculate regs->array if load_mems has created new registers. */
if (max_reg_num () > regs->num)
- loop_regs_scan (loop, 0, &insn_count);
+ loop_regs_scan (loop, 0);
for (update_start = loop_start;
PREV_INSN (update_start)
@@ -1024,7 +1027,7 @@ scan_loop (loop, flags)
/* Ensure our label doesn't go away. */
LABEL_NUSES (update_end)++;
- strength_reduce (loop, insn_count, flags);
+ strength_reduce (loop, flags);
reg_scan_update (update_start, update_end, loop_max_reg);
loop_max_reg = max_reg_num ();
@@ -1421,6 +1424,24 @@ combine_movables (movables, regs)
/* Clean up. */
free (matched_regs);
}
+
+/* Returns the number of movable instructions in LOOP that were not
+ moved outside the loop. */
+
+static int
+num_unmoved_movables (loop)
+ const struct loop *loop;
+{
+ int num = 0;
+ struct movable *m;
+
+ for (m = LOOP_MOVABLES (loop)->head; m; m = m->next)
+ if (!m->done)
+ ++num;
+
+ return num;
+}
+
/* Return 1 if regs X and Y will become the same if moved. */
@@ -1634,8 +1655,6 @@ move_movables (loop, movables, threshold, insn_count)
rtx *reg_map = (rtx *) xcalloc (nregs, sizeof (rtx));
char *already_moved = (char *) xcalloc (nregs, sizeof (char));
- movables->num = 0;
-
for (m = movables->head; m; m = m->next)
{
/* Describe this movable insn. */
@@ -1664,9 +1683,6 @@ move_movables (loop, movables, threshold, insn_count)
INSN_UID (m->forces->insn));
}
- /* Count movables. Value used in heuristics in strength_reduce. */
- movables->num++;
-
/* Ignore the insn if it's already done (it matched something else).
Otherwise, see if it is now safe to move. */
@@ -4200,9 +4216,8 @@ loop_ivs_free (loop)
must check regnos to make sure they are in bounds. */
static void
-strength_reduce (loop, insn_count, flags)
+strength_reduce (loop, flags)
struct loop *loop;
- int insn_count;
int flags;
{
struct loop_info *loop_info = LOOP_INFO (loop);
@@ -4222,6 +4237,7 @@ strength_reduce (loop, insn_count, flags)
int reg_map_size;
int unrolled_insn_copies = 0;
rtx test_reg = gen_rtx_REG (word_mode, LAST_VIRTUAL_REGISTER + 1);
+ int insn_count = count_insns_in_loop (loop);
addr_placeholder = gen_reg_rtx (Pmode);
@@ -4289,6 +4305,11 @@ strength_reduce (loop, insn_count, flags)
provided all givs are reduced. */
bl->eliminable = loop_biv_eliminable_p (loop, bl, threshold, insn_count);
+ /* This will be true at the end, if all givs which depend on this
+ biv have been strength reduced.
+ We can't (currently) eliminate the biv unless this is so. */
+ bl->all_reduced = 1;
+
/* Check each extension dependent giv in this class to see if its
root biv is safe from wrapping in the interior mode. */
check_ext_dependant_givs (bl, loop_info);
@@ -4296,11 +4317,6 @@ strength_reduce (loop, insn_count, flags)
/* Combine all giv's for this iv_class. */
combine_givs (regs, bl);
- /* This will be true at the end, if all givs which depend on this
- biv have been strength reduced.
- We can't (currently) eliminate the biv unless this is so. */
- bl->all_reduced = 1;
-
for (v = bl->giv; v; v = v->next_iv)
{
struct induction *tv;
@@ -6321,7 +6337,7 @@ express_from_1 (a, b, mult)
}
else if (CONSTANT_P (a))
{
- return simplify_gen_binary (MINUS, GET_MODE (b) != VOIDmode ? GET_MODE (b) : GET_MODE (a), const0_rtx, a);
+ return simplify_gen_binary (MINUS, GET_MODE (b) != VOIDmode ? GET_MODE (b) : GET_MODE (a), b, a);
}
else if (GET_CODE (b) == PLUS)
{
@@ -6631,6 +6647,7 @@ check_ext_dependant_givs (bl, loop_info)
INSN_UID (v->insn), why);
}
v->ignore = 1;
+ bl->all_reduced = 0;
}
}
}
@@ -7259,6 +7276,7 @@ check_dbra_loop (loop, insn_count)
if (bl->giv_count == 0 && ! loop->exit_count)
{
rtx bivreg = regno_reg_rtx[bl->regno];
+ struct iv_class *blt;
/* If there are no givs for this biv, and the only exit is the
fall through at the end of the loop, then
@@ -7295,6 +7313,14 @@ check_dbra_loop (loop, insn_count)
break;
}
}
+
+ /* A biv has uses besides counting if it is used to set another biv. */
+ for (blt = ivs->list; blt; blt = blt->next)
+ if (blt->init_set && reg_mentioned_p (bivreg, SET_SRC (blt->init_set)))
+ {
+ no_use_except_counting = 0;
+ break;
+ }
}
if (no_use_except_counting)
@@ -7316,12 +7342,11 @@ check_dbra_loop (loop, insn_count)
{
struct induction *v;
- reversible_mem_store
- = (! loop_info->unknown_address_altered
- && ! loop_info->unknown_constant_address_altered
- && ! loop_invariant_p (loop,
- XEXP (XEXP (loop_info->store_mems, 0),
- 0)));
+ /* If we could prove that each of the memory locations
+ written to was different, then we could reverse the
+ store -- but we don't presently have any way of
+ knowing that. */
+ reversible_mem_store = 0;
/* If the store depends on a register that is set after the
store, it depends on the initial value, and is thus not
@@ -7353,7 +7378,7 @@ check_dbra_loop (loop, insn_count)
&& ! loop_info->has_volatile
&& reversible_mem_store
&& (bl->giv_count + bl->biv_count + loop_info->num_mem_sets
- + LOOP_MOVABLES (loop)->num + compare_and_branch == insn_count)
+ + num_unmoved_movables (loop) + compare_and_branch == insn_count)
&& (bl == ivs->list && bl->next == 0))
|| no_use_except_counting)
{
@@ -8703,16 +8728,12 @@ insert_loop_mem (mem, data)
parameter may be zero, in which case this processing is not done.
Set REGS->ARRAY[I].MAY_NOT_OPTIMIZE nonzero if we should not
- optimize register I.
-
- Store in *COUNT_PTR the number of actual instructions
- in the loop. We use this to decide what is worth moving out. */
+ optimize register I. */
static void
-loop_regs_scan (loop, extra_size, count_ptr)
+loop_regs_scan (loop, extra_size)
const struct loop *loop;
int extra_size;
- int *count_ptr;
{
struct loop_regs *regs = LOOP_REGS (loop);
int old_nregs;
@@ -8720,7 +8741,6 @@ loop_regs_scan (loop, extra_size, count_ptr)
basic block. In that case, it is the insn that last set reg n. */
rtx *last_set;
rtx insn;
- int count = 0;
int i;
old_nregs = regs->num;
@@ -8755,8 +8775,6 @@ loop_regs_scan (loop, extra_size, count_ptr)
{
if (INSN_P (insn))
{
- ++count;
-
/* Record registers that have exactly one use. */
find_single_use_in_loop (regs, insn, PATTERN (insn));
@@ -8799,9 +8817,24 @@ loop_regs_scan (loop, extra_size, count_ptr)
regs->array[i].n_times_set = regs->array[i].set_in_loop;
free (last_set);
- *count_ptr = count;
}
+/* Returns the number of real INSNs in the LOOP. */
+
+static int
+count_insns_in_loop (loop)
+ const struct loop *loop;
+{
+ int count = 0;
+ rtx insn;
+
+ for (insn = loop->top ? loop->top : loop->start; insn != loop->end;
+ insn = NEXT_INSN (insn))
+ if (INSN_P (insn))
+ ++count;
+
+ return count;
+}
/* Move MEMs into registers for the duration of the loop. */
@@ -8813,7 +8846,7 @@ load_mems (loop)
struct loop_regs *regs = LOOP_REGS (loop);
int maybe_never = 0;
int i;
- rtx p;
+ rtx p, prev_ebb_head;
rtx label = NULL_RTX;
rtx end_label;
/* Nonzero if the next instruction may never be executed. */
@@ -8832,7 +8865,7 @@ load_mems (loop)
never executed. Also check if there is a goto out of the loop other
than right after the end of the loop. */
for (p = next_insn_in_loop (loop, loop->scan_start);
- p != NULL_RTX && ! maybe_never;
+ p != NULL_RTX;
p = next_insn_in_loop (loop, p))
{
if (GET_CODE (p) == CODE_LABEL)
@@ -8852,10 +8885,13 @@ load_mems (loop)
/* If this is a jump outside of the loop but not right
after the end of the loop, we would have to emit new fixup
sequences for each such label. */
- if (JUMP_LABEL (p) != end_label
- && (INSN_UID (JUMP_LABEL (p)) >= max_uid_for_loop
- || INSN_LUID (JUMP_LABEL (p)) < INSN_LUID (loop->start)
- || INSN_LUID (JUMP_LABEL (p)) > INSN_LUID (loop->end)))
+ if (/* If we can't tell where control might go when this
+ JUMP_INSN is executed, we must be conservative. */
+ !JUMP_LABEL (p)
+ || (JUMP_LABEL (p) != end_label
+ && (INSN_UID (JUMP_LABEL (p)) >= max_uid_for_loop
+ || INSN_LUID (JUMP_LABEL (p)) < INSN_LUID (loop->start)
+ || INSN_LUID (JUMP_LABEL (p)) > INSN_LUID (loop->end))))
return;
if (!any_condjump_p (p))
@@ -8875,6 +8911,7 @@ load_mems (loop)
PREV_INSN (p) && GET_CODE (p) != CODE_LABEL;
p = PREV_INSN (p))
;
+ prev_ebb_head = p;
cselib_init ();
@@ -8965,7 +9002,7 @@ load_mems (loop)
loop_info->mems[i].reg = reg;
/* Now, replace all references to the MEM with the
- corresponding pesudos. */
+ corresponding pseudos. */
maybe_never = 0;
for (p = next_insn_in_loop (loop, loop->scan_start);
p != NULL_RTX;
@@ -9036,7 +9073,7 @@ load_mems (loop)
if (CONSTANT_P (equiv->loc))
const_equiv = equiv;
else if (GET_CODE (equiv->loc) == REG
- /* Extending hard register lifetimes cuases crash
+ /* Extending hard register lifetimes causes crash
on SRC targets. Doing so on non-SRC is
probably also not good idea, since we most
probably have pseudoregister equivalence as
@@ -9062,8 +9099,19 @@ load_mems (loop)
if (best_equiv)
best = copy_rtx (best_equiv->loc);
}
+
set = gen_move_insn (reg, best);
set = loop_insn_hoist (loop, set);
+ if (REG_P (best))
+ {
+ for (p = prev_ebb_head; p != loop->start; p = NEXT_INSN (p))
+ if (REGNO_LAST_UID (REGNO (best)) == INSN_UID (p))
+ {
+ REGNO_LAST_UID (REGNO (best)) = INSN_UID (set);
+ break;
+ }
+ }
+
if (const_equiv)
REG_NOTES (set) = gen_rtx_EXPR_LIST (REG_EQUAL,
copy_rtx (const_equiv->loc),
@@ -9227,17 +9275,52 @@ try_copy_prop (loop, replacement, regno)
fprintf (loop_dump_stream, " Replaced reg %d", regno);
if (store_is_first && replaced_last)
{
- PUT_CODE (init_insn, NOTE);
- NOTE_LINE_NUMBER (init_insn) = NOTE_INSN_DELETED;
- if (loop_dump_stream)
- fprintf (loop_dump_stream, ", deleting init_insn (%d)",
- INSN_UID (init_insn));
+ rtx first;
+ rtx retval_note;
+
+ /* Assume we're just deleting INIT_INSN. */
+ first = init_insn;
+ /* Look for REG_RETVAL note. If we're deleting the end of
+ the libcall sequence, the whole sequence can go. */
+ retval_note = find_reg_note (init_insn, REG_RETVAL, NULL_RTX);
+ /* If we found a REG_RETVAL note, find the first instruction
+ in the sequence. */
+ if (retval_note)
+ first = XEXP (retval_note, 0);
+
+ /* Delete the instructions. */
+ loop_delete_insns (first, init_insn);
}
if (loop_dump_stream)
fprintf (loop_dump_stream, ".\n");
}
}
+/* Replace all the instructions from FIRST up to and including LAST
+ with NOTE_INSN_DELETED notes. */
+
+static void
+loop_delete_insns (first, last)
+ rtx first;
+ rtx last;
+{
+ while (1)
+ {
+ PUT_CODE (first, NOTE);
+ NOTE_LINE_NUMBER (first) = NOTE_INSN_DELETED;
+ if (loop_dump_stream)
+ fprintf (loop_dump_stream, ", deleting init_insn (%d)",
+ INSN_UID (first));
+
+ /* If this was the LAST instructions we're supposed to delete,
+ we're done. */
+ if (first == last)
+ break;
+
+ first = NEXT_INSN (first);
+ }
+}
+
/* Try to replace occurrences of pseudo REGNO with REPLACEMENT within
loop LOOP if the order of the sets of these registers can be
swapped. There must be exactly one insn within the loop that sets
@@ -9269,7 +9352,7 @@ try_swap_copy_prop (loop, replacement, regno)
break;
}
- if (set)
+ if (insn != NULL_RTX)
{
rtx prev_insn;
rtx prev_set;
diff --git a/gcc/loop.h b/gcc/loop.h
index cfec9934b20..1794730307d 100644
--- a/gcc/loop.h
+++ b/gcc/loop.h
@@ -289,8 +289,6 @@ struct loop_movables
struct movable *head;
/* Last movable in chain. */
struct movable *last;
- /* Number of movables in the loop. */
- int num;
};
diff --git a/gcc/mbchar.c b/gcc/mbchar.c
index 71cc99c230a..f5f7beca4c6 100644
--- a/gcc/mbchar.c
+++ b/gcc/mbchar.c
@@ -29,8 +29,8 @@ Boston, MA 02111-1307, USA. */
leaves the source character values unchanged (except for removing the
state shifting markers). */
-#ifdef MULTIBYTE_CHARS
#include "config.h"
+#ifdef MULTIBYTE_CHARS
#include "system.h"
#include "mbchar.h"
#include <locale.h>
diff --git a/gcc/mips-tfile.c b/gcc/mips-tfile.c
index ff24ce8e9af..2b99954b715 100644
--- a/gcc/mips-tfile.c
+++ b/gcc/mips-tfile.c
@@ -3,7 +3,7 @@
in the form of comments (the mips assembler does not support
assembly access to debug information).
Copyright (C) 1991, 1993, 1994, 1995, 1997, 1998,
- 1999, 2000 Free Software Foundation, Inc.
+ 1999, 2000, 2001 Free Software Foundation, Inc.
Contributed by Michael Meissner (meissner@cygnus.com).
This file is part of GNU CC.
@@ -1637,12 +1637,7 @@ STATIC symint_t add_local_symbol
symint_t,
symint_t));
-STATIC symint_t add_ext_symbol __proto((const char *,
- const char *,
- st_t,
- sc_t,
- long,
- symint_t,
+STATIC symint_t add_ext_symbol __proto((EXTR *,
int));
STATIC symint_t add_aux_sym_symint
@@ -2063,23 +2058,24 @@ add_local_symbol (str_start, str_end_p1, type, storage, value, indx)
/* Add an external symbol. */
STATIC symint_t
-add_ext_symbol (str_start, str_end_p1, type, storage, value, indx, ifd)
- const char *str_start; /* first byte in string */
- const char *str_end_p1; /* first byte after string */
- st_t type; /* symbol type */
- sc_t storage; /* storage class */
- long value; /* value of symbol */
- symint_t indx; /* index to local/aux. syms */
+add_ext_symbol (esym, ifd)
+ EXTR *esym; /* symbol pointer */
int ifd; /* file index */
{
+ const char *str_start; /* first byte in string */
+ const char *str_end_p1; /* first byte after string */
register EXTR *psym;
register varray_t *vp = &ext_symbols;
shash_t *hash_ptr = (shash_t *) 0;
+ str_start = ORIG_ESTRS (esym->asym.iss);
+ str_end_p1 = str_start + strlen(str_start);
+
if (debug > 1)
{
- const char *sc_str = sc_to_string (storage);
- const char *st_str = st_to_string (type);
+ long value = esym->asym.value;
+ const char *sc_str = sc_to_string (esym->asym.sc);
+ const char *st_str = st_to_string (esym->asym.st);
fprintf (stderr,
"\tesym\tv= %10ld, ifd= %2d, sc= %-12s",
@@ -2097,11 +2093,9 @@ add_ext_symbol (str_start, str_end_p1, type, storage, value, indx, ifd)
psym = &vp->last->datum->esym[ vp->objects_last_page++ ];
+ *psym = *esym;
psym->ifd = ifd;
- psym->asym.value = value;
- psym->asym.st = (unsigned) type;
- psym->asym.sc = (unsigned) storage;
- psym->asym.index = indx;
+ psym->asym.index = indexNil;
psym->asym.iss = (str_start == (const char *) 0)
? 0
: add_string (&ext_strings,
@@ -4648,18 +4642,10 @@ copy_object __proto((void))
for (es = 0; es < orig_sym_hdr.iextMax; es++)
{
register EXTR *eptr = orig_ext_syms + es;
- register char *ename = ORIG_ESTRS (eptr->asym.iss);
register unsigned ifd = eptr->ifd;
- (void) add_ext_symbol (ename,
- ename + strlen (ename),
- (st_t) eptr->asym.st,
- (sc_t) eptr->asym.sc,
- eptr->asym.value,
- (eptr->asym.index == indexNil
- ? (symint_t) indexNil : 0),
- ((long) ifd < orig_sym_hdr.ifdMax
- ? remap_file_number[ifd] : (int) ifd));
+ (void) add_ext_symbol (eptr, ((long) ifd < orig_sym_hdr.ifdMax)
+ ? remap_file_number[ ifd ] : ifd );
}
diff --git a/gcc/mkconfig.sh b/gcc/mkconfig.sh
new file mode 100644
index 00000000000..03c1d9d4ffc
--- /dev/null
+++ b/gcc/mkconfig.sh
@@ -0,0 +1,71 @@
+#! /bin/sh
+
+# Generate gcc's config.h, which is not your normal autoconf-generated
+# config.h (that's auto-(host|build).h). $1 is the file to generate.
+# HEADERS, DEFINES, and possibly TARGET_CPU_DEFAULT are expected to be
+# set in the environment.
+
+if [ -z "$1" ]; then
+ echo "Usage: HEADERS='list' DEFINES='list' mkconfig.sh FILE" >&2
+ exit 1
+fi
+
+output=$1
+rm -f $output.T
+
+# We used to exec > $output.T but apparently this has bugs.
+# Use a redirected subshell instead.
+(
+
+# Define TARGET_CPU_DEFAULT if the system wants one.
+# This substitutes for lots of *.h files.
+if [ "$TARGET_CPU_DEFAULT" != "" ]; then
+ echo "#define TARGET_CPU_DEFAULT ($TARGET_CPU_DEFAULT)"
+fi
+
+# The first entry in HEADERS may be auto-host.h or auto-build.h;
+# it wants to be included even when not -DIN_GCC.
+if [ -n "$HEADERS" ]; then
+ set $HEADERS; first=$1
+ case $first in auto-* )
+ echo "#include \"$first\""
+ shift
+ HEADERS=$*
+ ;;
+ esac
+fi
+
+if [ -n "$HEADERS" ]; then
+ echo '#ifdef IN_GCC'
+ for file in $HEADERS; do
+ echo "# include \"$file\""
+ done
+ echo '#endif'
+fi
+
+for def in $DEFINES; do
+ echo "#ifndef $def" | sed 's/=.*//'
+ echo "# define $def" | sed 's/=/ /'
+ echo "#endif"
+done
+
+# Include insn-codes.h last, because it includes machmode.h,
+# and we want EXTRA_CC_MODES to be taken into account.
+echo "#ifndef GENERATOR_FILE"
+echo "#include \"insn-codes.h\""
+echo "#include \"insn-flags.h\""
+echo "#endif"
+
+) > $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
+ rm -f $output.T
+else
+ mv -f $output.T $output
+fi
+
+# Touch a stamp file for Make's benefit.
+rm -f cs-$output
+echo timestamp > cs-$output
diff --git a/gcc/mkdeps.c b/gcc/mkdeps.c
index b0c62c5627c..8afd75e7416 100644
--- a/gcc/mkdeps.c
+++ b/gcc/mkdeps.c
@@ -180,8 +180,6 @@ deps_add_default_target (d, tgt)
struct deps *d;
const char *tgt;
{
- char *o, *suffix;
-
/* Only if we have no targets. */
if (d->ntargets)
return;
@@ -190,19 +188,20 @@ deps_add_default_target (d, tgt)
deps_add_target (d, "-", 1);
else
{
- o = (char *) alloca (strlen (tgt) + 8);
-
- strcpy (o, tgt);
- suffix = strrchr (o, '.');
-
#ifndef OBJECT_SUFFIX
# define OBJECT_SUFFIX ".o"
#endif
+ char *start = lbasename (tgt);
+ char *o = (char *) alloca (strlen (start) + strlen (OBJECT_SUFFIX) + 1);
+ char *suffix;
- if (suffix)
- strcpy (suffix, OBJECT_SUFFIX);
- else
- strcat (o, OBJECT_SUFFIX);
+ strcpy (o, start);
+
+ suffix = strrchr (o, '.');
+ if (!suffix)
+ suffix = o + strlen (o);
+ strcpy (suffix, OBJECT_SUFFIX);
+
deps_add_target (d, o, 1);
}
}
diff --git a/gcc/mklibgcc.in b/gcc/mklibgcc.in
index 6341b302b83..8a169451eb4 100644
--- a/gcc/mklibgcc.in
+++ b/gcc/mklibgcc.in
@@ -14,8 +14,11 @@
# LIB1ASMFUNCS
# LIB1FUNCS_EXTRA
# LIB2FUNCS
-# LIB2FUNCS_EH
+# LIB2FUNCS_ST
# LIB2ADD
+# LIB2ADDEH
+# LIB2ADDEHDEP
+# LIB2ADD_ST
# FPBIT
# FPBIT_FUNCS
# DPBIT
@@ -79,7 +82,7 @@ make_compile='$(MAKE) GCC_FOR_TARGET="$(GCC_FOR_TARGET)" \
libgcc1_c_dep='stmp-dirs $(srcdir)/libgcc1.c $(CONFIG_H)'
# Dependancies for libgcc2.c
-libgcc2_c_dep='stmp-dirs $(srcdir)/libgcc2.c $(CONFIG_H) $(MACHMODE_H) longlong.h frame.h gbl-ctors.h config.status stmp-int-hdrs tsystem.h'
+libgcc2_c_dep='stmp-dirs $(srcdir)/libgcc2.c $(CONFIG_H) $(MACHMODE_H) longlong.h gbl-ctors.h config.status stmp-int-hdrs tsystem.h'" $LIB2ADDEHDEP"
# Dependancies for fp-bit.c
fpbit_c_dep='stmp-dirs config.status tsystem.h'
@@ -166,6 +169,7 @@ esac
#
libgcc2_objs=""
+libgcc2_st_objs=""
for name in $LIB2FUNCS; do
for ml in $MULTILIBS; do
@@ -180,17 +184,17 @@ for name in $LIB2FUNCS; do
libgcc2_objs="$libgcc2_objs ${name}${objext}"
done
-for name in $LIB2FUNCS_EH; do
+for name in $LIB2FUNCS_ST; do
for ml in $MULTILIBS; do
dir=`echo ${ml} | sed -e 's/;.*$//' -e 's/=/$(EQ)/g'`
flags=`echo ${ml} | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`;
out="libgcc/${dir}/${name}${objext}"
echo $out: $libgcc2_c_dep
- echo " $gcc_compile" '$(MAYBE_USE_COLLECT2)' -fexceptions \
- $flags -DL$name -c '$(srcdir)/libgcc2.c' -o $out
+ echo " $gcc_compile" '$(MAYBE_USE_COLLECT2)' $flags -DL$name \
+ -c '$(srcdir)/libgcc2.c' -o $out
done
- libgcc2_objs="$libgcc2_objs ${name}${objext}"
+ libgcc2_st_objs="$libgcc2_st_objs ${name}${objext}"
done
if [ "$FPBIT" ]; then
@@ -241,6 +245,42 @@ for file in $LIB2ADD; do
libgcc2_objs="$libgcc2_objs ${oname}${objext}"
done
+for file in $LIB2ADDEH; do
+ name=`echo $file | sed -e 's/[.][cSo]$//' -e 's/[.]asm$//' -e 's/[.]txt$//'`
+ oname=`echo $name | sed -e 's,.*/,,'`
+
+ for ml in $MULTILIBS; do
+ dir=`echo ${ml} | sed -e 's/;.*$//' -e 's/=/$(EQ)/g'`
+ flags=`echo ${ml} | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`;
+ out="libgcc/${dir}/${oname}${objext}"
+ if [ ${name}.asm = ${file} ]; then
+ flags="$flags -xassembler-with-cpp"
+ fi
+
+ echo $out: stmp-dirs $file
+ echo " $gcc_compile" $flags -fexceptions -c $file -o $out
+ done
+ libgcc2_objs="$libgcc2_objs ${oname}${objext}"
+done
+
+for file in $LIB2ADD_ST; do
+ name=`echo $file | sed -e 's/[.][cSo]$//' -e 's/[.]asm$//' -e 's/[.]txt$//'`
+ oname=`echo $name | sed -e 's,.*/,,'`
+
+ for ml in $MULTILIBS; do
+ dir=`echo ${ml} | sed -e 's/;.*$//' -e 's/=/$(EQ)/g'`
+ flags=`echo ${ml} | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`;
+ out="libgcc/${dir}/${oname}${objext}"
+ if [ ${name}.asm = ${file} ]; then
+ flags="$flags -xassembler-with-cpp"
+ fi
+
+ echo $out: stmp-dirs $file
+ echo " $gcc_compile" $flags -c $file -o $out
+ done
+ libgcc2_st_objs="$libgcc2_st_objs ${oname}${objext}"
+done
+
# SHLIB_MKMAP
# SHLIB_MAPFILES
for ml in $MULTILIBS; do
@@ -260,6 +300,11 @@ for ml in $MULTILIBS; do
done
shlib_deps="$libgcc_objs"
+ libgcc_st_objs=""
+ for o in $libgcc2_st_objs; do
+ libgcc_st_objs="$libgcc_st_objs libgcc/${dir}/$o"
+ done
+
if [ "$SHLIB_LINK" -a "$SHLIB_MKMAP" -a -z "$mapfile" ]; then
mapfile="libgcc.map"
echo ""
@@ -276,9 +321,9 @@ for ml in $MULTILIBS; do
done
echo ""
- echo "${dir}/libgcc.a: $libgcc_objs"
+ echo "${dir}/libgcc.a: $libgcc_objs $libgcc_st_objs"
echo " -rm -rf ${dir}/libgcc.a"
- echo ' $(AR_CREATE_FOR_TARGET)' ${dir}/libgcc.a $libgcc_objs
+ echo ' $(AR_CREATE_FOR_TARGET)' ${dir}/libgcc.a $libgcc_objs $libgcc_st_objs
echo ' if $(RANLIB_TEST_FOR_TARGET) ; then' \\
echo ' $(RANLIB_FOR_TARGET)' ${dir}/libgcc.a ';' \\
echo ' else true; fi;'
@@ -354,7 +399,7 @@ done
echo 'stmp-dirs: force'
echo ' for d in '"$dirs"'; do \'
-echo ' if [ -d $$d ]; then true; else mkdir $$d; fi \'
+echo ' if [ -d $$d ]; then true; else mkdir $$d; fi; \'
echo ' done'
echo ' if [ -f stmp-dirs ]; then true; else touch stmp-dirs; fi'
diff --git a/gcc/objc/lang-options.h b/gcc/objc/lang-options.h
index 3d56b96bdcf..88e30e5b6cb 100644
--- a/gcc/objc/lang-options.h
+++ b/gcc/objc/lang-options.h
@@ -23,16 +23,21 @@ Boston, MA 02111-1307, USA. */
DEFINE_LANG_NAME ("Objective C")
- { "-gen-decls", "Dump decls to a .decl file" },
- { "-fgnu-runtime", "Generate code for GNU runtime environment" },
+ { "-gen-decls",
+ N_("Dump decls to a .decl file") },
+ { "-fgnu-runtime",
+ N_("Generate code for GNU runtime environment") },
{ "-fno-gnu-runtime", "" },
- { "-fnext-runtime", "Generate code for NeXT runtime environment" },
+ { "-fnext-runtime",
+ N_("Generate code for NeXT runtime environment") },
{ "-fno-next-runtime", "" },
- { "-Wselector", "Warn if a selector has multiple methods" },
+ { "-Wselector",
+ N_("Warn if a selector has multiple methods") },
{ "-Wno-selector", "" },
{ "-Wprotocol", "" },
- { "-Wno-protocol", "Do not warn if inherited methods are unimplemented"},
+ { "-Wno-protocol",
+ N_("Do not warn if inherited methods are unimplemented") },
{ "-print-objc-runtime-info",
- "Generate C header of platform specific features" },
+ N_("Generate C header of platform specific features") },
{ "-fconstant-string-class",
- "Specify the name of the class for constant strings" },
+ N_("Specify the name of the class for constant strings") },
diff --git a/gcc/objc/lang-specs.h b/gcc/objc/lang-specs.h
index e732d00fb8c..26f18f12886 100644
--- a/gcc/objc/lang-specs.h
+++ b/gcc/objc/lang-specs.h
@@ -21,7 +21,7 @@ Boston, MA 02111-1307, USA. */
/* This is the contribution to the `default_compilers' array in gcc.c for
objc. */
- {".m", "@objective-c"},
+ {".m", "@objective-c", 0},
{"@objective-c",
/* cc1obj has an integrated ISO C preprocessor. We should invoke the
external preprocessor if -save-temps or -traditional is given. */
@@ -36,8 +36,8 @@ Boston, MA 02111-1307, USA. */
cc1obj -fpreprocessed %{!pipe:%g.mi} %(cc1_options) %{gen-decls}}\
%{!traditional:%{!ftraditional:%{!traditional-cpp:\
cc1obj %{ansi:-std=c89} %(cpp_options) %(cc1_options) %{gen-decls}}}}}\
- %{!fsyntax-only:%(invoke_as)}}}}"},
- {".mi", "@objc-cpp-output"},
+ %{!fsyntax-only:%(invoke_as)}}}}", 0},
+ {".mi", "@objc-cpp-output", 0},
{"@objc-cpp-output",
"%{!M:%{!MM:%{!E:cc1obj -fpreprocessed %i %(cc1_options) %{gen-decls}\
- %{!fsyntax-only:%(invoke_as)}}}}"},
+ %{!fsyntax-only:%(invoke_as)}}}}", 0},
diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c
index 9856f34e5ca..b8cf262625b 100644
--- a/gcc/objc/objc-act.c
+++ b/gcc/objc/objc-act.c
@@ -1810,6 +1810,8 @@ build_module_descriptor ()
DECL_ARTIFICIAL (UOBJC_MODULES_decl) = 1;
DECL_IGNORED_P (UOBJC_MODULES_decl) = 1;
+ DECL_CONTEXT (UOBJC_MODULES_decl) = NULL_TREE;
+
finish_decl (UOBJC_MODULES_decl,
init_module_descriptor (TREE_TYPE (UOBJC_MODULES_decl)),
NULL_TREE);
@@ -1981,8 +1983,8 @@ generate_static_references ()
type = build_array_type (build_pointer_type (void_type_node), 0);
decl = build_decl (VAR_DECL, ident, type);
- make_decl_rtl (decl, 0);
TREE_USED (decl) = 1;
+ TREE_STATIC (decl) = 1;
decls
= tree_cons (NULL_TREE, build_unary_op (ADDR_EXPR, decl, 1), decls);
}
@@ -2021,6 +2023,7 @@ generate_strings ()
decl_specs = tree_cons (NULL_TREE, ridpointers[(int) RID_CHAR], sc_spec);
expr_decl = build_nt (ARRAY_REF, DECL_NAME (decl), NULL_TREE);
decl = start_decl (expr_decl, decl_specs, 1, NULL_TREE, NULL_TREE);
+ DECL_CONTEXT (decl) = NULL_TREE;
string_expr = my_build_string (IDENTIFIER_LENGTH (string) + 1,
IDENTIFIER_POINTER (string));
finish_decl (decl, string_expr, NULL_TREE);
@@ -2035,6 +2038,7 @@ generate_strings ()
decl_specs = tree_cons (NULL_TREE, ridpointers[(int) RID_CHAR], sc_spec);
expr_decl = build_nt (ARRAY_REF, DECL_NAME (decl), NULL_TREE);
decl = start_decl (expr_decl, decl_specs, 1, NULL_TREE, NULL_TREE);
+ DECL_CONTEXT (decl) = NULL_TREE;
string_expr = my_build_string (IDENTIFIER_LENGTH (string) + 1,
IDENTIFIER_POINTER (string));
finish_decl (decl, string_expr, NULL_TREE);
@@ -2049,6 +2053,7 @@ generate_strings ()
decl_specs = tree_cons (NULL_TREE, ridpointers[(int) RID_CHAR], sc_spec);
expr_decl = build_nt (ARRAY_REF, DECL_NAME (decl), NULL_TREE);
decl = start_decl (expr_decl, decl_specs, 1, NULL_TREE, NULL_TREE);
+ DECL_CONTEXT (decl) = NULL_TREE;
string_expr = my_build_string (IDENTIFIER_LENGTH (string) + 1,
IDENTIFIER_POINTER (string));
finish_decl (decl, string_expr, NULL_TREE);
@@ -2962,7 +2967,8 @@ generate_descriptor_table (type, name, size, list, proto)
decl_specs = tree_cons (NULL_TREE, type, sc_spec);
decl = start_decl (synth_id_with_class_suffix (name, proto),
- decl_specs, 1, NULL_TREE, NULL_TREE);
+ decl_specs, 1, NULL_TREE, NULL_TREE);
+ DECL_CONTEXT (decl) = NULL_TREE;
initlist = build_tree_list (NULL_TREE, build_int_2 (size, 0));
initlist = tree_cons (NULL_TREE, list, initlist);
@@ -3209,6 +3215,8 @@ generate_protocols ()
decl = start_decl (synth_id_with_class_suffix ("_OBJC_PROTOCOL", p),
decl_specs, 1, NULL_TREE, NULL_TREE);
+ DECL_CONTEXT (decl) = NULL_TREE;
+
protocol_name_expr = add_objc_string (PROTOCOL_NAME (p), class_names);
if (refs_decl)
@@ -4242,6 +4250,7 @@ generate_protocol_list (i_or_p)
expr_decl = build1 (INDIRECT_REF, NULL_TREE, expr_decl);
refs_decl = start_decl (expr_decl, decl_specs, 1, NULL_TREE, NULL_TREE);
+ DECL_CONTEXT (refs_decl) = NULL_TREE;
finish_decl (refs_decl, build_constructor (TREE_TYPE (refs_decl),
nreverse (initlist)),
@@ -6130,7 +6139,10 @@ start_class (code, class_name, super_name, protocol_list)
{
{
static tree implemented_classes = 0;
- tree chain = implemented_classes;
+ tree chain;
+
+ if (!implemented_classes)
+ ggc_add_tree_root (&implemented_classes, 1);
for (chain = implemented_classes; chain; chain = TREE_CHAIN (chain))
if (TREE_VALUE (chain) == class_name)
{
@@ -8158,6 +8170,9 @@ init_objc ()
synth_module_prologue ();
/* Change the default error function */
+ save_lang_status = &push_c_function_context;
+ restore_lang_status = &pop_c_function_context;
+ mark_lang_status = &mark_c_function_context;
decl_printable_name = objc_printable_name;
lang_expand_expr = c_expand_expr;
lang_expand_decl_stmt = c_expand_decl_stmt;
@@ -8320,6 +8335,7 @@ generate_classref_translation_entry (chain)
/* The decl that is returned from start_decl is the one that we
forward declared in build_class_reference. */
decl = start_decl (name, decl_specs, 1, NULL_TREE, NULL_TREE);
+ DECL_CONTEXT (decl) = NULL_TREE;
finish_decl (decl, expr, NULL_TREE);
return;
}
@@ -8346,8 +8362,8 @@ handle_class_ref (chain)
pushdecl (decl);
rest_of_decl_compilation (decl, 0, 0, 0);
- /* Make following constant read-only (why not)? */
- readonly_data_section ();
+ /* Put the decl in the variable section. It may need relocation. */
+ variable_section (decl, 1);
exp = build1 (ADDR_EXPR, string_type_node, decl);
@@ -8400,6 +8416,7 @@ handle_impent (impent)
{
sprintf (string, "%sobjc_class_name_%s",
(flag_next_runtime ? "." : "__"), class_name);
+ readonly_data_section ();
assemble_global (string);
assemble_label (string);
}
@@ -8434,6 +8451,7 @@ handle_impent (impent)
sprintf (string, "%sobjc_category_name_%s_%s",
(flag_next_runtime ? "." : "__"),
class_name, class_super_name);
+ readonly_data_section ();
assemble_global (string);
assemble_label (string);
}
@@ -8587,25 +8605,45 @@ lookup_objc_ivar (id)
return 0;
}
-/* Parser callbacks. */
+/* Parser callbacks.
+ Some ObjC keywords are reserved only in a particular context:
+ in out inout bycopy byref oneway.
+ We have to save and restore the IDENTIFIER_NODEs that describe
+ them as keywords, when appropriate. */
+
+#define N_PQ 6
+static tree saved_pq[N_PQ];
+static tree saved_not_pq[N_PQ];
+static const char *const pq_strings[N_PQ] = {
+ "bycopy", "byref", "in", "inout", "oneway", "out"
+};
+
+void
+save_and_forget_protocol_qualifiers ()
+{
+ int i;
+ for (i = 0; i < N_PQ; i++)
+ saved_pq[i] = set_identifier (pq_strings[i], NULL_TREE);
+
+ ggc_add_tree_root (saved_pq, N_PQ);
+ ggc_add_tree_root (saved_not_pq, N_PQ);
+}
+
void
forget_protocol_qualifiers ()
{
- C_IS_RESERVED_WORD (ridpointers[(int) RID_IN]) = 0;
- C_IS_RESERVED_WORD (ridpointers[(int) RID_OUT]) = 0;
- C_IS_RESERVED_WORD (ridpointers[(int) RID_INOUT]) = 0;
- C_IS_RESERVED_WORD (ridpointers[(int) RID_BYCOPY]) = 0;
- C_IS_RESERVED_WORD (ridpointers[(int) RID_BYREF]) = 0;
- C_IS_RESERVED_WORD (ridpointers[(int) RID_ONEWAY]) = 0;
+ int i;
+ for (i = 0; i < N_PQ; i++)
+ {
+ set_identifier (pq_strings[i], saved_not_pq[i]);
+ saved_not_pq[i] = NULL_TREE;
+ }
}
void
remember_protocol_qualifiers ()
{
- C_IS_RESERVED_WORD (ridpointers[(int) RID_IN]) = 1;
- C_IS_RESERVED_WORD (ridpointers[(int) RID_OUT]) = 1;
- C_IS_RESERVED_WORD (ridpointers[(int) RID_INOUT]) = 1;
- C_IS_RESERVED_WORD (ridpointers[(int) RID_BYCOPY]) = 1;
- C_IS_RESERVED_WORD (ridpointers[(int) RID_BYREF]) = 1;
- C_IS_RESERVED_WORD (ridpointers[(int) RID_ONEWAY]) = 1;
+ int i;
+ for (i = 0; i < N_PQ; i++)
+ saved_not_pq[i] = set_identifier (pq_strings[i], saved_pq[i]);
}
diff --git a/gcc/optabs.c b/gcc/optabs.c
index 38ff9910540..63ee5275bb9 100644
--- a/gcc/optabs.c
+++ b/gcc/optabs.c
@@ -31,9 +31,8 @@ Boston, MA 02111-1307, USA. */
#include "tree.h"
#include "tm_p.h"
#include "flags.h"
-#include "insn-flags.h"
-#include "insn-codes.h"
#include "function.h"
+#include "except.h"
#include "expr.h"
#include "recog.h"
#include "reload.h"
@@ -1975,12 +1974,10 @@ expand_twoval_binop (binoptab, op0, op1, targ0, targ1, unsignedp)
{
register rtx t0 = gen_reg_rtx (wider_mode);
register rtx t1 = gen_reg_rtx (wider_mode);
+ rtx cop0 = convert_modes (wider_mode, mode, op0, unsignedp);
+ rtx cop1 = convert_modes (wider_mode, mode, op1, unsignedp);
- if (expand_twoval_binop (binoptab,
- convert_modes (wider_mode, mode, op0,
- unsignedp),
- convert_modes (wider_mode, mode, op1,
- unsignedp),
+ if (expand_twoval_binop (binoptab, cop0, cop1,
t0, t1, unsignedp))
{
convert_move (targ0, t0, unsignedp);
@@ -2813,14 +2810,13 @@ emit_libcall_block (insns, target, result, equiv)
/* look for any CALL_INSNs in this sequence, and attach a REG_EH_REGION
reg note to indicate that this call cannot throw or execute a nonlocal
goto (unless there is already a REG_EH_REGION note, in which case
- we update it). Also set the CONST_CALL_P flag. */
+ we update it). */
for (insn = insns; insn; insn = NEXT_INSN (insn))
if (GET_CODE (insn) == CALL_INSN)
{
rtx note = find_reg_note (insn, REG_EH_REGION, NULL_RTX);
- CONST_CALL_P (insn) = 1;
if (note != 0)
XEXP (note, 0) = GEN_INT (-1);
else
@@ -4757,18 +4753,16 @@ init_optabs ()
trunctfdf2_libfunc = init_one_libfunc ("__trunctfdf2");
memcpy_libfunc = init_one_libfunc ("memcpy");
+ memmove_libfunc = init_one_libfunc ("memmove");
bcopy_libfunc = init_one_libfunc ("bcopy");
memcmp_libfunc = init_one_libfunc ("memcmp");
bcmp_libfunc = init_one_libfunc ("__gcc_bcmp");
memset_libfunc = init_one_libfunc ("memset");
bzero_libfunc = init_one_libfunc ("bzero");
- throw_libfunc = init_one_libfunc ("__throw");
- rethrow_libfunc = init_one_libfunc ("__rethrow");
- sjthrow_libfunc = init_one_libfunc ("__sjthrow");
- sjpopnthrow_libfunc = init_one_libfunc ("__sjpopnthrow");
- terminate_libfunc = init_one_libfunc ("__terminate");
- eh_rtime_match_libfunc = init_one_libfunc ("__eh_rtime_match");
+ unwind_resume_libfunc = init_one_libfunc (USING_SJLJ_EXCEPTIONS
+ ? "_Unwind_SjLj_Resume"
+ : "_Unwind_Resume");
#ifndef DONT_USE_BUILTIN_SETJMP
setjmp_libfunc = init_one_libfunc ("__builtin_setjmp");
longjmp_libfunc = init_one_libfunc ("__builtin_longjmp");
@@ -4776,6 +4770,9 @@ init_optabs ()
setjmp_libfunc = init_one_libfunc ("setjmp");
longjmp_libfunc = init_one_libfunc ("longjmp");
#endif
+ unwind_sjlj_register_libfunc = init_one_libfunc ("_Unwind_SjLj_Register");
+ unwind_sjlj_unregister_libfunc
+ = init_one_libfunc ("_Unwind_SjLj_Unregister");
eqhf2_libfunc = init_one_libfunc ("__eqhf2");
nehf2_libfunc = init_one_libfunc ("__nehf2");
diff --git a/gcc/output.h b/gcc/output.h
index d50b795c8c8..7a5f10e82c9 100644
--- a/gcc/output.h
+++ b/gcc/output.h
@@ -133,7 +133,7 @@ extern int regno_uninitialized PARAMS ((int));
extern int regno_clobbered_at_setjmp PARAMS ((int));
extern void dump_flow_info PARAMS ((FILE *));
extern void find_basic_blocks PARAMS ((rtx, int, FILE *));
-extern void cleanup_cfg PARAMS ((rtx));
+extern void cleanup_cfg PARAMS ((void));
extern void free_basic_block_vars PARAMS ((int));
extern void set_block_num PARAMS ((rtx, int));
extern void check_function_return_warnings PARAMS ((void));
diff --git a/gcc/params.c b/gcc/params.c
new file mode 100644
index 00000000000..9b1b09ccc42
--- /dev/null
+++ b/gcc/params.c
@@ -0,0 +1,84 @@
+/* params.c - Run-time parameters.
+ Copyright (C) 2001 Free Software Foundation, Inc.
+ Written by Mark Mitchell <mark@codesourcery.com>.
+
+This file is part of GNU CC.
+
+GNU CC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU CC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU CC; see the file COPYING. If not, write to
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.
+
+*/
+
+#include "config.h"
+#include "system.h"
+#include "params.h"
+#include "toplev.h"
+
+/* An array containing the compiler parameters and their current
+ values. */
+
+param_info *compiler_params;
+
+/* The number of entries in the table. */
+
+static size_t num_compiler_params;
+
+/* Add the N PARAMS to the current list of compiler parameters. */
+
+void
+add_params (params, n)
+ const param_info params[];
+ size_t n;
+{
+ /* Allocate enough space for the new parameters. */
+ compiler_params =
+ ((param_info *)
+ xrealloc (compiler_params,
+ (num_compiler_params + n) * sizeof (param_info)));
+ /* Copy them into the table. */
+ memcpy (compiler_params + num_compiler_params,
+ params,
+ n * sizeof (param_info));
+ /* Keep track of how many parameters we have. */
+ num_compiler_params += n;
+}
+
+/* Set the VALUE associated with the parameter given by NAME. */
+
+void
+set_param_value (name, value)
+ const char *name;
+ int value;
+{
+ size_t i;
+
+ /* Make sure nobody tries to set a parameter to an invalid value. */
+ if (value == INVALID_PARAM_VAL)
+ abort ();
+
+ /* Scan the parameter table to find a matching entry. */
+ for (i = 0; i < num_compiler_params; ++i)
+ if (strcmp (compiler_params[i].option, name) == 0)
+ {
+ compiler_params[i].value = value;
+ return;
+ }
+
+ /* If we didn't find this parameter, issue an error message. */
+ error ("invalid parameter `%s'", name);
+}
+
+
+
diff --git a/gcc/params.def b/gcc/params.def
new file mode 100644
index 00000000000..df9d64ffe8f
--- /dev/null
+++ b/gcc/params.def
@@ -0,0 +1,91 @@
+/* params.def - Run-time parameters.
+ Copyright (C) 2001 Free Software Foundation, Inc.
+ Written by Mark Mitchell <mark@codesourcery.com>.
+
+This file is part of GNU CC.
+
+GNU CC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU CC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU CC; see the file COPYING. If not, write to
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.
+
+*/
+
+/* This file contains definitions for language-independent
+ parameters. The DEFPARAM macro takes 4 arguments:
+
+ - The enumeral corresponding to this parameter.
+
+ - The name that can be used to set this parameter using the
+ command-line option `--param <name>=<value>'.
+
+ - A help string explaining how the parameter is used.
+
+ - A default value for the parameter.
+
+ Be sure to add an entry to invoke.texi summarizing the parameter. */
+
+/* The maximum number of instructions accepted for inlining a
+ function. Increasing values mean more agressive inlining.
+ This affects currently only functions explicitly marked as
+ inline (or methods defined within the class definition for C++).
+ The original default value of 10000 was arbitrary and caused
+ significant compile-time performance regressions. */
+DEFPARAM (PARAM_MAX_INLINE_INSNS,
+ "max-inline-insns",
+ "The maximum number of instructions in a function that is eligible for inlining",
+ 600)
+
+/* The maximum number of instructions to consider when looking for an
+ instruction to fill a delay slot. If more than this arbitrary
+ number of instructions is searched, the time savings from filling
+ the delay slot will be minimal so stop searching. Increasing
+ values mean more aggressive optimization, making the compile time
+ increase with probably small improvement in executable run time. */
+DEFPARAM (PARAM_MAX_DELAY_SLOT_INSN_SEARCH,
+ "max-delay-slot-insn-search",
+ "The maximum number of instructions to consider to fill a delay slot",
+ 100)
+
+/* When trying to fill delay slots, the maximum number of instructions
+ to consider when searching for a block with valid live register
+ information. Increasing this arbitrarily chosen value means more
+ aggressive optimization, increasing the compile time. This
+ parameter should be removed when the delay slot code is rewritten
+ to maintain the control-flow graph. */
+DEFPARAM(PARAM_MAX_DELAY_SLOT_LIVE_SEARCH,
+ "max-delay-slot-live-search",
+ "The maximum number of instructions to consider to find accurate live register information",
+ 333)
+
+/* The GCSE optimization will be disabled if it would require
+ significantly more memory than this value. */
+DEFPARAM(PARAM_MAX_GCSE_MEMORY,
+ "max-gcse-memory",
+ "The maximum amount of memory to be allocated by GCSE",
+ 50 * 1024 * 1024)
+
+/* This parameter limits the number of branch elements that the
+ scheduler will track anti-dependancies through without resetting
+ the tracking mechanism. Large functions with few calls or barriers
+ can generate lists containing many 1000's of dependancies. Generally
+ the compiler either uses all available memory, or runs for far too long. */
+DEFPARAM(PARAM_MAX_PENDING_LIST_LENGTH,
+ "max-pending-list-length",
+ "The maximum length of scheduling's pending operations list",
+ 32)
+
+/*
+Local variables:
+mode:c
+End: */
diff --git a/gcc/params.h b/gcc/params.h
new file mode 100644
index 00000000000..5a81fd53615
--- /dev/null
+++ b/gcc/params.h
@@ -0,0 +1,99 @@
+/* params.h - Run-time parameters.
+ Copyright (C) 2001 Free Software Foundation, Inc.
+ Written by Mark Mitchell <mark@codesourcery.com>.
+
+This file is part of GNU CC.
+
+GNU CC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU CC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU CC; see the file COPYING. If not, write to
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.
+
+*/
+
+/* This module provides a means for setting integral parameters
+ dynamically. Instead of encoding magic numbers in various places,
+ use this module to organize all the magic numbers in a single
+ place. The values of the parameters can be set on the
+ command-line, thereby providing a way to control the amount of
+ effort spent on particular optimization passes, or otherwise tune
+ the behavior of the compiler.
+
+ Since their values can be set on the command-line, these parameters
+ should not be used for non-dynamic memory allocation. */
+
+#ifndef PARAMS_H
+#define PARAMS_H
+
+/* No parameter shall have this value. */
+
+#define INVALID_PARAM_VAL (-1)
+
+/* The information associated with each parameter. */
+
+typedef struct param_info
+{
+ /* The name used with the `--param <name>=<value>' switch to set this
+ value. */
+ const char *option;
+ /* The associated value. */
+ int value;
+ /* A short description of the option. */
+ const char *help;
+} param_info;
+
+/* An array containing the compiler parameters and their current
+ values. */
+
+extern param_info *compiler_params;
+
+/* Add the N PARAMS to the current list of compiler parameters. */
+
+extern void add_params
+ PARAMS ((const param_info params[], size_t n));
+
+/* Set the VALUE associated with the parameter given by NAME. */
+
+extern void set_param_value
+ PARAMS ((const char *name, int value));
+
+
+/* The parameters in use by language-independent code. */
+
+typedef enum compiler_param
+{
+#define DEFPARAM(ENUM, OPTION, HELP, DEFAULT) \
+ ENUM,
+#include "params.def"
+#undef DEFPARAM
+ LAST_PARAM
+} compiler_param;
+
+/* The value of the parameter given by ENUM. */
+#define PARAM_VALUE(ENUM) \
+ (compiler_params[(int) ENUM].value)
+
+/* Macros for the various parameters. */
+#define MAX_INLINE_INSNS \
+ PARAM_VALUE (PARAM_MAX_INLINE_INSNS)
+#define MAX_DELAY_SLOT_INSN_SEARCH \
+ PARAM_VALUE (PARAM_MAX_DELAY_SLOT_INSN_SEARCH)
+#define MAX_DELAY_SLOT_LIVE_SEARCH \
+ PARAM_VALUE (PARAM_MAX_DELAY_SLOT_LIVE_SEARCH)
+#define MAX_GCSE_MEMORY \
+ ((size_t) PARAM_VALUE (PARAM_MAX_GCSE_MEMORY))
+#define MAX_PENDING_LIST_LENGTH \
+ PARAM_VALUE (PARAM_MAX_PENDING_LIST_LENGTH)
+
+
+#endif /* PARAMS_H */
diff --git a/gcc/po/ChangeLog b/gcc/po/ChangeLog
index a858d8d59ec..db43b9394ab 100644
--- a/gcc/po/ChangeLog
+++ b/gcc/po/ChangeLog
@@ -1,3 +1,62 @@
+2002-02-20 Release Manager
+
+ * GCC 3.0.4 Released.
+
+2002-02-20 Release Manager
+
+ * GCC 3.0.4 Released.
+
+2001-12-20 Release Manager
+
+ * GCC 3.0.3 Released.
+
+2001-11-05 Zack Weinberg <zack@codesourcery.com>
+
+ * POTFILES.in: Add config/rs6000/freebsd.h and the s390 directory.
+
+2001-11-03 David O'Brien <obrien@FreeBSD.org>
+
+ * POTFILES.in: Add config/ia64/freebsd.h.
+
+2001-10-23 Release Manager
+
+ * GCC 3.0.2 Released.
+
+2001-08-19 Release Manager
+
+ * GCC 3.0.1 Released.
+
+2001-08-19 Release Manager
+
+ * GCC 3.0.1 Released.
+
+20010617 Release Manager
+
+ * GCC 3.0 Released.
+
+2001-06-11 Zack Weinberg <zackw@stanford.edu>
+
+ * Makefile.in.in: Take --defines switch off of xgettext
+ command line.
+ * POTFILES.in: Massive update, removing all dead files and
+ adding approximately 300 files which had been left out.
+ Clarify comments on what should and should not appear here.
+
+ * gcc.pot, cat-id-tbl.c: Regenerate.
+
+2001-05-23 Zack Weinberg <zackw@stanford.edu>
+
+ * POTFILES.in: Remove frame-dwarf2.c, frame.c, and frame.h.
+
+2001-05-16 Zack Weinberg <zackw@stanford.edu>
+
+ * POTFILES.in: Remove assert.h.
+
+2001-05-13 Mark Mitchell <mark@codesourcery.com>
+
+ * Makefile.in.in (STAMP): New macro.
+ Replace all uses of `touch' with $(STAMP).
+
2001-01-30 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
* Makefile.in.in (distclean): Also remove *.gmo during `make
diff --git a/gcc/po/Makefile.in.in b/gcc/po/Makefile.in.in
index 14def49d14f..b9252d503be 100644
--- a/gcc/po/Makefile.in.in
+++ b/gcc/po/Makefile.in.in
@@ -10,6 +10,7 @@ PACKAGE = @PACKAGE@
VERSION = @VERSION@
SHELL = /bin/sh
+STAMP = echo timestamp >
@SET_MAKE@
srcdir = @srcdir@
@@ -83,14 +84,14 @@ all-yes: $(CATALOGS) @MAINT@ $(srcdir)/cat-id-tbl.c
all-no:
stamp-check-po: $(POTFILES)
- touch stamp-check-po
+ $(STAMP) stamp-check-po
check-po: stamp-check-po
$(srcdir)/$(PACKAGE).pot: $(POTFILES)
$(XGETTEXT) --default-domain=$(PACKAGE) --directory=$(top_srcdir) \
--add-comments --keyword=_ --keyword=N_ \
- --files-from=$(srcdir)/POTFILES.in --defines \
+ --files-from=$(srcdir)/POTFILES.in \
&& test ! -f $(PACKAGE).po \
|| ( rm -f $(srcdir)/$(PACKAGE).pot \
&& mv $(PACKAGE).po $(srcdir)/$(PACKAGE).pot )
diff --git a/gcc/po/POTFILES.in b/gcc/po/POTFILES.in
index 8d856d5d399..9179b0e7b58 100644
--- a/gcc/po/POTFILES.in
+++ b/gcc/po/POTFILES.in
@@ -19,7 +19,11 @@
# Boston MA 02111-1307, USA.
-# This should list all .c and .h files in this distribution.
+# This should list all .c and .h files in this distribution, except
+# those which are directly generated from .y files; in that case, the
+# .y file should be listed instead. Also, nothing in the intl, po,
+# testsuite, and ginclude directories should be listed.
+
# Files that are intentionally excluded should be commented out, not removed.
# To exclude a file, prepend a '#' to its name, and follow it by a space
# and a comment as to why it was excluded.
@@ -38,8 +42,6 @@
# It is part of the GCC library.
-# It is part of the translation machinery itself.
-
# It is meant to be executed only by GCC maintainers or installers.
# Such files do not need to be translated,
# as these people typically need to be able to read English anyway.
@@ -47,10 +49,8 @@
# It is not yet internationalized, because it contains many strings
# that require a lot of analysis, and the file is little-used.
-
acconfig.h
alias.c
-assert.h
basic-block.h
bb-reorder.c
bitmap.c
@@ -61,10 +61,14 @@ c-common.c
c-common.h
c-convert.c
c-decl.c
+c-dump.c
+c-dump.h
+c-errors.c
+c-format.c
c-lang.c
c-lex.c
c-lex.h
-c-parse.c
+c-parse.y
c-pragma.c
c-pragma.h
c-semantics.c
@@ -72,18 +76,25 @@ c-tree.h
c-typeck.c
caller-save.c
calls.c
-../libiberty/choose-temp.c
collect2.c
collect2.h
combine.c
conditions.h
+config/1750a/1750a-protos.h
+config/1750a/1750a.c
+config/1750a/1750a.h
+config/1750a/xm-1750a.h
+config/a29k/a29k-protos.h
config/a29k/a29k.c
config/a29k/a29k.h
+config/a29k/rtems.h
config/a29k/udi.h
config/a29k/unix.h
config/a29k/vx29k.h
config/a29k/xm-a29k.h
+config/a29k/xm-unix.h
config/alpha/alpha-interix.h
+config/alpha/alpha-protos.h
config/alpha/alpha.c
config/alpha/alpha.h
config/alpha/alpha32.h
@@ -98,7 +109,8 @@ config/alpha/openbsd.h
config/alpha/osf.h
config/alpha/osf12.h
config/alpha/osf2or3.h
-#config/alpha/vms-tramp.asm is part of the GCC library
+config/alpha/osf5.h
+config/alpha/va_list.h
config/alpha/vms.h
config/alpha/vxworks.h
config/alpha/win-nt.h
@@ -108,75 +120,145 @@ config/alpha/xm-openbsd.h
config/alpha/xm-vms.h
config/alpha/xm-winnt.h
config/aoutos.h
+config/arc/arc-protos.h
config/arc/arc.c
config/arc/arc.h
config/arc/initfini.c
config/arc/xm-arc.h
config/arm/aof.h
config/arm/aout.h
+config/arm/arm-protos.h
+config/arm/arm-wince-pe.h
config/arm/arm.c
config/arm/arm.h
config/arm/coff.h
+config/arm/conix-elf.h
+config/arm/ecos-elf.h
+config/arm/elf.h
+config/arm/linux-elf.h
config/arm/linux-gas.h
config/arm/netbsd.h
+config/arm/pe.c
+config/arm/pe.h
config/arm/riscix.h
config/arm/riscix1-1.h
config/arm/rix-gas.h
+config/arm/rtems-elf.h
config/arm/semi.h
config/arm/semiaof.h
+config/arm/strongarm-coff.h
+config/arm/strongarm-elf.h
+config/arm/strongarm-pe.h
+config/arm/uclinux-elf.h
+config/arm/unknown-elf-oabi.h
+config/arm/unknown-elf.h
+config/arm/vxarm.h
config/arm/xm-arm.h
+config/arm/xm-linux.h
+config/arm/xscale-coff.h
+config/arm/xscale-elf.h
+config/avr/avr-protos.h
+config/avr/avr.c
+config/avr/avr.h
+config/avr/xm-avr.h
+config/c4x/c4x-protos.h
+config/c4x/c4x.c
+config/c4x/c4x.h
+config/c4x/rtems.h
+config/c4x/xm-c4x.h
+config/clipper/clipper-protos.h
config/clipper/clipper.c
config/clipper/clipper.h
config/clipper/clix.h
config/clipper/xm-clix.h
+config/convex/convex-protos.h
config/convex/convex.c
config/convex/convex.h
config/convex/xm-convex.h
+config/d30v/d30v-protos.h
+config/d30v/d30v.c
+config/d30v/d30v.h
+config/d30v/xm-d30v.h
config/dbx.h
config/dbxcoff.h
+config/dbxelf.h
config/divmod.c
+config/dsp16xx/dsp16xx-protos.h
config/dsp16xx/dsp16xx.c
config/dsp16xx/dsp16xx.h
config/dsp16xx/xm-dsp16xx.h
+config/elfos.h
+config/elxsi/elxsi-protos.h
config/elxsi/elxsi.c
config/elxsi/elxsi.h
config/elxsi/xm-elxsi.h
-config/float-i128.h
-config/float-i32.h
-config/float-i64.h
-config/float-sh.h
-config/float-vax.h
+#config/float-c4x.h is part of the GCC library
+#config/float-i128.h is part of the GCC library
+#config/float-i32.h is part of the GCC library
+#config/float-i386.h is part of the GCC library
+#config/float-i64.h is part of the GCC library
+#config/float-m68k.h is part of the GCC library
+#config/float-sh.h is part of the GCC library
+#config/float-sparc.h is part of the GCC library
+#config/float-vax.h is part of the GCC library
config/fp-bit.c
+config/fp-bit.h
+config/fr30/fr30-protos.h
+config/fr30/fr30.c
+config/fr30/fr30.h
+config/fr30/xm-fr30.h
+config/freebsd-nthr.h
config/freebsd.h
+config/freebsd3.h
+config/freebsd4.h
+config/freebsd5.h
+config/freebsd6.h
config/gnu.h
config/gofast.h
+config/h8300/h8300-protos.h
config/h8300/h8300.c
config/h8300/h8300.h
+config/h8300/rtems.h
config/h8300/xm-h8300.h
+config/i370/i370-protos.h
config/i370/i370.c
config/i370/i370.h
+config/i370/linux.h
+config/i370/mvs.h
+config/i370/oe.h
config/i370/xm-i370.h
+config/i370/xm-linux.h
+config/i370/xm-mvs.h
+config/i370/xm-oe.h
+config/i386/386bsd.h
config/i386/aix386.h
config/i386/aix386ng.h
config/i386/att.h
+config/i386/beos-elf.h
+config/i386/beos-pe.h
config/i386/bsd.h
config/i386/bsd386.h
+config/i386/chorus.h
config/i386/crtdll.h
config/i386/cygwin.h
config/i386/dgux.c
config/i386/dgux.h
+config/i386/djgpp-rtems.h
+config/i386/djgpp.h
config/i386/freebsd-aout.h
config/i386/freebsd.h
config/i386/gas.h
config/i386/gmon-sol2.c
config/i386/gnu.h
-config/i386/djgpp-rtems.h
-config/i386/djgpp.h
config/i386/gstabs.h
config/i386/i386-aout.h
config/i386/i386-coff.h
+config/i386/i386-interix.h
+config/i386/i386-protos.h
config/i386/i386.c
config/i386/i386.h
+config/i386/i386elf.h
+config/i386/interix.c
config/i386/isc.h
config/i386/isccoff.h
config/i386/iscdbx.h
@@ -191,6 +273,7 @@ config/i386/moss.h
config/i386/netbsd.h
config/i386/netware.h
config/i386/next.h
+config/i386/openbsd.h
config/i386/os2.h
config/i386/osf1elf.h
config/i386/osf1elfgdb.h
@@ -217,53 +300,94 @@ config/i386/svr3dbx.h
config/i386/svr3gas.h
config/i386/sysv3.h
config/i386/sysv4.h
+config/i386/sysv5.h
+config/i386/udk.h
config/i386/unix.h
+config/i386/uwin.h
config/i386/v3gas.h
config/i386/vsta.h
+config/i386/vxi386.h
config/i386/win-nt.h
+config/i386/win32.h
config/i386/winnt.c
config/i386/xm-aix.h
+config/i386/xm-beos.h
+config/i386/xm-bsd386.h
config/i386/xm-cygwin.h
-config/i386/xm-dos.h
+config/i386/xm-dgux.h
config/i386/xm-djgpp.h
+config/i386/xm-dos.h
+config/i386/xm-freebsd.h
+config/i386/xm-gnu.h
+config/i386/xm-i386-interix.h
config/i386/xm-i386.h
config/i386/xm-isc.h
+config/i386/xm-linux.h
config/i386/xm-lynx.h
config/i386/xm-mingw32.h
config/i386/xm-next.h
+config/i386/xm-openbsd.h
config/i386/xm-os2.h
config/i386/xm-osf.h
config/i386/xm-osf1elf.h
config/i386/xm-sco.h
config/i386/xm-sco5.h
+config/i386/xm-sun.h
+config/i386/xm-sysv3.h
config/i386/xm-sysv4.h
config/i386/xm-vsta.h
+config/i386/xm-winnt.h
config/i860/bsd-gas.h
config/i860/bsd.h
config/i860/fx2800.h
+config/i860/i860-protos.h
config/i860/i860.c
config/i860/i860.h
config/i860/mach.h
config/i860/paragon.h
config/i860/sysv3.h
config/i860/sysv4.h
+config/i860/xm-fx2800.h
config/i860/xm-i860.h
config/i960/i960-coff.h
+config/i960/i960-protos.h
config/i960/i960.c
config/i960/i960.h
config/i960/rtems.h
config/i960/vx960-coff.h
config/i960/vx960.h
config/i960/xm-i960.h
+config/ia64/elf.h
+config/ia64/freebsd.h
+config/ia64/fde-glibc.c
+config/ia64/hpux.h
+config/ia64/ia64-protos.h
+config/ia64/ia64.c
+config/ia64/ia64.h
+config/ia64/ia64intrin.h
+config/ia64/linux.h
+config/ia64/sysv4.h
+config/ia64/unwind-ia64.c
+config/ia64/unwind-ia64.h
+config/ia64/xm-ia64.h
+config/interix.h
config/libgloss.h
config/linux-aout.h
config/linux.h
config/lynx-ng.h
config/lynx.h
config/m32r/initfini.c
+config/m32r/m32r-protos.h
config/m32r/m32r.c
config/m32r/m32r.h
config/m32r/xm-m32r.h
+config/m68hc11/m68hc11-protos.h
+config/m68hc11/m68hc11.c
+config/m68hc11/m68hc11.h
+config/m68hc11/m68hc12.h
+config/m68hc11/xm-m68hc11.h
+config/m68k/3b1.h
+config/m68k/3b1g.h
config/m68k/a-ux.h
config/m68k/altos3068.h
config/m68k/amix.h
@@ -298,12 +422,15 @@ config/m68k/linux-aout.h
config/m68k/linux.h
config/m68k/lynx-ng.h
config/m68k/lynx.h
+config/m68k/m68020-elf.h
config/m68k/m68k-aout.h
config/m68k/m68k-coff.h
config/m68k/m68k-none.h
+config/m68k/m68k-protos.h
config/m68k/m68k-psos.h
config/m68k/m68k.c
config/m68k/m68k.h
+config/m68k/m68kelf.h
config/m68k/m68kemb.h
config/m68k/m68kv4.h
config/m68k/mot3300.h
@@ -314,9 +441,11 @@ config/m68k/news3gas.h
config/m68k/newsgas.h
config/m68k/next.h
config/m68k/next21.h
+config/m68k/openbsd.h
config/m68k/pbb.h
config/m68k/plexus.h
config/m68k/rtems.h
+config/m68k/rtemself.h
config/m68k/sgs.h
config/m68k/sun2.h
config/m68k/sun2o4.h
@@ -329,26 +458,46 @@ config/m68k/tower-as.h
config/m68k/tower.h
config/m68k/vxm68k.h
config/m68k/xm-3b1.h
+config/m68k/xm-altos3068.h
+config/m68k/xm-amix.h
config/m68k/xm-atari.h
+config/m68k/xm-aux.h
config/m68k/xm-crds.h
+config/m68k/xm-hp320.h
+config/m68k/xm-linux.h
config/m68k/xm-lynx.h
config/m68k/xm-m68k.h
+config/m68k/xm-m68kv.h
config/m68k/xm-mot3300.h
config/m68k/xm-next.h
+config/m68k/xm-openbsd.h
config/m68k/xm-plexus.h
+config/m68k/xm-sun3.h
+config/m68k/xm-tower.h
+config/m88k/aout-dbx.h
config/m88k/dgux.h
config/m88k/dguxbcs.h
config/m88k/dolph.h
config/m88k/luna.h
config/m88k/m88k-aout.h
config/m88k/m88k-coff.h
+config/m88k/m88k-protos.h
config/m88k/m88k.c
config/m88k/m88k.h
+config/m88k/openbsd.h
config/m88k/sysv3.h
config/m88k/sysv4.h
config/m88k/tekXD88.h
config/m88k/xm-m88k.h
+config/m88k/xm-openbsd.h
config/m88k/xm-sysv3.h
+config/mcore/gfloat.h
+config/mcore/mcore-elf.h
+config/mcore/mcore-pe.h
+config/mcore/mcore-protos.h
+config/mcore/mcore.c
+config/mcore/mcore.h
+config/mcore/xm-mcore.h
config/mips/abi64.h
config/mips/bsd-4.h
config/mips/bsd-5.h
@@ -361,6 +510,7 @@ config/mips/elf.h
config/mips/elf64.h
config/mips/elfl.h
config/mips/elfl64.h
+config/mips/elflorion.h
config/mips/elforion.h
config/mips/gnu.h
config/mips/iris3.h
@@ -369,14 +519,21 @@ config/mips/iris4loser.h
config/mips/iris5.h
config/mips/iris5gas.h
config/mips/iris6.h
+config/mips/iris6gld.h
+config/mips/linux.h
config/mips/mips-5.h
+config/mips/mips-protos.h
config/mips/mips.c
config/mips/mips.h
config/mips/netbsd.h
config/mips/news4.h
config/mips/news5.h
+config/mips/nws3250v4.h
+config/mips/openbsd-be.h
+config/mips/openbsd.h
config/mips/osfrose.h
config/mips/r3900.h
+config/mips/rtems.h
config/mips/rtems64.h
config/mips/sni-gas.h
config/mips/sni-svr4.h
@@ -386,11 +543,20 @@ config/mips/svr4-4.h
config/mips/svr4-5.h
config/mips/svr4-t.h
config/mips/ultrix.h
+config/mips/vxworks.h
+config/mips/xm-iris3.h
+config/mips/xm-iris4.h
+config/mips/xm-iris5.h
config/mips/xm-iris6.h
config/mips/xm-mips.h
+config/mips/xm-nws3250v4.h
+config/mips/xm-openbsd.h
+config/mips/xm-sysv.h
+config/mn10200/mn10200-protos.h
config/mn10200/mn10200.c
config/mn10200/mn10200.h
config/mn10200/xm-mn10200.h
+config/mn10300/mn10300-protos.h
config/mn10300/mn10300.c
config/mn10300/mn10300.h
config/mn10300/xm-mn10300.h
@@ -402,6 +568,7 @@ config/nextstep21.h
config/ns32k/encore.h
config/ns32k/merlin.h
config/ns32k/netbsd.h
+config/ns32k/ns32k-protos.h
config/ns32k/ns32k.c
config/ns32k/ns32k.h
config/ns32k/pc532-mach.h
@@ -411,9 +578,13 @@ config/ns32k/sequent.h
config/ns32k/tek6000.h
config/ns32k/tek6100.h
config/ns32k/tek6200.h
+config/ns32k/xm-netbsd.h
config/ns32k/xm-ns32k.h
config/ns32k/xm-pc532-min.h
+config/openbsd.h
config/pa/elf.h
+config/pa/long_double.h
+config/pa/pa-64.h
config/pa/pa-gas.h
config/pa/pa-hiux.h
config/pa/pa-hpux.h
@@ -421,21 +592,38 @@ config/pa/pa-hpux10.h
config/pa/pa-hpux11.h
config/pa/pa-hpux7.h
config/pa/pa-hpux9.h
+config/pa/pa-linux.h
config/pa/pa-oldas.h
config/pa/pa-osf.h
config/pa/pa-pro-end.h
+config/pa/pa-protos.h
config/pa/pa.c
config/pa/pa.h
+config/pa/pa32-regs.h
+config/pa/pa64-regs.h
+config/pa/pa64-start.h
+config/pa/quadlib.c
config/pa/rtems.h
config/pa/som.h
+config/pa/xm-linux.h
config/pa/xm-pa.h
+config/pa/xm-pa64hpux.h
config/pa/xm-pahpux.h
config/pa/xm-papro.h
+config/pdp11/2bsd.h
+config/pdp11/pdp11-protos.h
config/pdp11/pdp11.c
config/pdp11/pdp11.h
config/pdp11/xm-pdp11.h
+config/pj/linux.h
+config/pj/pj-protos.h
+config/pj/pj.c
+config/pj/pj.h
+config/pj/pjl.h
+config/pj/xm-pj.h
config/psos.h
config/ptx4.h
+config/romp/romp-protos.h
config/romp/romp.c
config/romp/romp.h
config/romp/xm-romp.h
@@ -444,18 +632,21 @@ config/rs6000/aix31.h
config/rs6000/aix3newas.h
config/rs6000/aix41.h
config/rs6000/aix43.h
+config/rs6000/aix51.h
config/rs6000/beos.h
+config/rs6000/chorus.h
config/rs6000/eabi.h
config/rs6000/eabiaix.h
config/rs6000/eabisim.h
config/rs6000/linux.h
config/rs6000/lynx.h
config/rs6000/mach.h
+config/rs6000/netbsd.h
config/rs6000/rs6000-protos.h
config/rs6000/rs6000.c
config/rs6000/rs6000.h
config/rs6000/rtems.h
-#config/rs6000/sol-c0.c
+#config/rs6000/sol-c0.c is part of the GCC library
config/rs6000/sol2.h
config/rs6000/sysv4.h
config/rs6000/sysv4le.h
@@ -469,12 +660,23 @@ config/rs6000/xm-rs6000.h
config/rs6000/xm-sysv4.h
config/rtems.h
config/sh/elf.h
+config/sh/linux.h
config/sh/rtems.h
+config/sh/rtemself.h
+config/sh/sh-protos.h
config/sh/sh.c
config/sh/sh.h
config/sh/xm-sh.h
+config/s390/linux.h
+config/s390/linux64.h
+config/s390/s390-protos.h
+config/s390/s390.c
+config/s390/s390.h
+config/s390/xm-s390.h
+config/s390/xm-s390x.h
config/sparc/aout.h
config/sparc/bsd.h
+config/sparc/chorus.h
config/sparc/elf.h
config/sparc/gmon-sol2.c
config/sparc/hal.h
@@ -483,15 +685,23 @@ config/sparc/linux.h
config/sparc/linux64.h
config/sparc/lite.h
config/sparc/litecoff.h
+config/sparc/liteelf.h
config/sparc/lynx-ng.h
config/sparc/lynx.h
config/sparc/netbsd.h
+config/sparc/openbsd.h
config/sparc/pbd.h
config/sparc/rtems.h
+config/sparc/rtemself.h
+config/sparc/sol2-64.h
+config/sparc/sol2-sld-64.h
config/sparc/sol2-sld.h
config/sparc/sol2.h
config/sparc/sp64-aout.h
config/sparc/sp64-elf.h
+config/sparc/sp86x-aout.h
+config/sparc/sp86x-elf.h
+config/sparc/sparc-protos.h
config/sparc/sparc.c
config/sparc/sparc.h
config/sparc/splet.h
@@ -501,44 +711,66 @@ config/sparc/sunos4.h
config/sparc/sysv4.h
config/sparc/vxsim.h
config/sparc/vxsparc.h
+config/sparc/vxsparc64.h
config/sparc/xm-linux.h
config/sparc/xm-lynx.h
+config/sparc/xm-openbsd.h
+config/sparc/xm-pbd.h
config/sparc/xm-sol2.h
config/sparc/xm-sp64.h
config/sparc/xm-sparc.h
+config/sparc/xm-sysv4-64.h
config/sparc/xm-sysv4.h
config/svr3.h
config/svr4.h
+config/tm-dwarf2.h
config/udivmod.c
config/udivmodsi4.c
+config/usegas.h
+config/v850/rtems.h
+config/v850/v850-c.c
+config/v850/v850-protos.h
config/v850/v850.c
config/v850/v850.h
config/v850/xm-v850.h
config/vax/netbsd.h
+config/vax/openbsd.h
+config/vax/openbsd1.h
config/vax/ultrix.h
+config/vax/vax-protos.h
config/vax/vax.c
config/vax/vax.h
config/vax/vaxv.h
config/vax/vms.h
config/vax/xm-vax.h
+config/vax/xm-vaxv.h
config/vax/xm-vms.h
+config/we32k/we32k-protos.h
config/we32k/we32k.c
config/we32k/we32k.h
config/we32k/xm-we32k.h
config/xm-alloca.h
+config/xm-freebsd.h
config/xm-gnu.h
+config/xm-interix.h
+config/xm-linux.h
config/xm-lynx.h
+config/xm-openbsd.h
config/xm-std32.h
+config/xm-svr3.h
+config/xm-svr4.h
conflict.c
convert.c
convert.h
cp/call.c
+cp/cfns.h
cp/class.c
cp/cp-tree.h
cp/cvt.c
cp/decl.c
cp/decl.h
cp/decl2.c
+cp/dump.c
cp/errfn.c
cp/error.c
cp/except.c
@@ -550,20 +782,21 @@ cp/lang-options.h
cp/lang-specs.h
cp/lex.c
cp/lex.h
+cp/mangle.c
cp/method.c
-cp/parse.c
-cp/parse.h
+cp/optimize.c
+cp/parse.y
cp/pt.c
cp/ptree.c
cp/repo.c
cp/rtti.c
cp/search.c
+cp/semantics.c
cp/spew.c
cp/tree.c
cp/typeck.c
cp/typeck2.c
cp/xref.c
-../libiberty/cplus-dem.c
cppdefault.c
cppdefault.h
cpperror.c
@@ -575,6 +808,7 @@ cppinit.c
cpplex.c
cpplib.c
cpplib.h
+cppmacro.c
cppmain.c
cppspec.c
#crtstuff.c is part of the GCC library
@@ -583,30 +817,114 @@ cselib.h
dbxout.c
dbxout.h
dbxstclass.h
+dce.c
defaults.h
-../include/demangle.h
+dependence.c
diagnostic.c
diagnostic.h
doloop.c
dominance.c
-#doprint.c
+doprint.c
doschk.c
dwarf.h
dwarf2.h
+dwarf2asm.c
+dwarf2asm.h
dwarf2out.c
dwarf2out.h
dwarfout.c
dwarfout.h
-../libiberty/dyn-string.c
-../include/dyn-string.h
emit-rtl.c
#enquire.c is used only by GCC maintainers and installers
+errors.c
+errors.h
except.c
except.h
explow.c
expmed.c
expr.c
expr.h
+f/ansify.c
+f/bad.c
+f/bad.h
+f/bit.c
+f/bit.h
+f/bld.c
+f/bld.h
+f/com.c
+f/com.h
+f/data.c
+f/data.h
+f/equiv.c
+f/equiv.h
+f/expr.c
+f/expr.h
+f/fini.c
+f/g77spec.c
+f/global.c
+f/global.h
+f/implic.c
+f/implic.h
+f/info.c
+f/info.h
+f/intdoc.c
+f/intrin.c
+f/intrin.h
+f/lab.c
+f/lab.h
+f/lang-options.h
+f/lang-specs.h
+f/lex.c
+f/lex.h
+f/malloc.c
+f/malloc.h
+f/name.c
+f/name.h
+f/parse.c
+f/proj.c
+f/proj.h
+f/src.c
+f/src.h
+f/st.c
+f/st.h
+f/sta.c
+f/sta.h
+f/stb.c
+f/stb.h
+f/stc.c
+f/stc.h
+f/std.c
+f/std.h
+f/ste.c
+f/ste.h
+f/storag.c
+f/storag.h
+f/stp.c
+f/stp.h
+f/str.c
+f/str.h
+f/sts.c
+f/sts.h
+f/stt.c
+f/stt.h
+f/stu.c
+f/stu.h
+f/stv.c
+f/stv.h
+f/stw.c
+f/stw.h
+f/symbol.c
+f/symbol.h
+f/target.c
+f/target.h
+f/top.c
+f/top.h
+f/type.c
+f/type.h
+f/version.c
+f/version.h
+f/where.c
+f/where.h
final.c
#fix-header.c is used only by GCC maintainers and installers
flags.h
@@ -614,16 +932,17 @@ floatlib.c
flow.c
fold-const.c
fp-test.c
-frame-dwarf2.c
-frame.c
#frame.h is part of the GCC library
function.c
function.h
gansidecl.h
-#gbl-ctors.h is part of the GCC library
gcc.c
+gcc.h
+gccspec.c
gcov-io.h
gcov.c
+gcse.c
+#gbl-ctors.h is part of the GCC library
#gen-protos.c is used only by GCC maintainers and installers
#genattr.c is used only by GCC maintainers and installers
#genattrtab.c is used only by GCC maintainers and installers
@@ -640,25 +959,12 @@ gcov.c
#genrecog.c is used only by GCC maintainers and installers
#gensupport.c is used only by GCC maintainers and installers
#gensupport.h is used only by GCC maintainers and installers
-../libiberty/getopt.c
-../include/getopt.h
-../libiberty/getopt1.c
-../libiberty/getpwd.c
ggc-callbacks.c
ggc-common.c
ggc-none.c
ggc-page.c
ggc-simple.c
ggc.h
-ginclude/iso646.h
-ginclude/math-3300.h
-ginclude/math-68881.h
-ginclude/ppc-asm.h
-ginclude/proto.h
-ginclude/stdarg.h
-ginclude/stdbool.h
-ginclude/stddef.h
-ginclude/varargs.h
glimits.h
global.c
gmon.c
@@ -667,8 +973,10 @@ graph.h
gstab.h
gsyms.h
gsyslimits.h
+gthr-aix.h
gthr-dce.h
gthr-posix.h
+gthr-rtems.h
gthr-single.h
gthr-solaris.h
gthr-vxworks.h
@@ -683,34 +991,62 @@ hash.h
hwint.h
ifcvt.c
input.h
+insn-addr.h
integrate.c
integrate.h
intl.c
intl.h
-intl/bindtextdom.c
-intl/cat-compat.c
-intl/dcgettext.c
-intl/dgettext.c
-intl/explodename.c
-intl/finddomain.c
-intl/gettext.c
-intl/gettext.h
-intl/gettextP.h
-intl/hash-string.h
-intl/intl-compat.c
-intl/l10nflist.c
-intl/libgettext.h
-intl/loadinfo.h
-intl/loadmsgcat.c
-intl/localealias.c
-intl/textdomain.c
+java/boehm.c
+java/buffer.c
+java/buffer.h
+java/chartables.h
+java/check-init.c
+java/class.c
+java/constants.c
+java/convert.h
+java/decl.c
+java/except.c
+java/expr.c
+java/gjavah.c
+java/java-except.h
+java/java-opcodes.h
+java/java-tree.h
+java/javaop.h
+java/jcf-depend.c
+java/jcf-dump.c
+java/jcf-io.c
+java/jcf-parse.c
+java/jcf-path.c
+java/jcf-reader.c
+java/jcf-write.c
+java/jcf.h
+java/jv-scan.c
+java/jvgenmain.c
+java/jvspec.c
+java/keyword.h
+java/lang-options.h
+java/lang-specs.h
+java/lang.c
+java/lex.c
+java/lex.h
+java/mangle.c
+java/mangle_name.c
+java/parse-scan.y
+java/parse.y
+java/typeck.c
+java/verify.c
+java/xref.c
+java/xref.h
+java/zextract.c
+java/zipfile.h
jump.c
lcm.c
-#libgcc1-test.c is used only by GCC maintainers and installers
#libgcc1.c is part of the GCC library
+#libgcc1-test.c is part of the GCC library
#libgcc2.c is part of the GCC library
-limitx.h
-limity.h
+#libgcc2.h is part of the GCC library
+#limitx.h is part of the GCC library
+#limity.h is part of the GCC library
lists.c
local-alloc.c
#longlong.h is part of the GCC library
@@ -723,12 +1059,15 @@ mkdeps.c
mkdeps.h
#mips-tdump.c is not yet internationalized
#mips-tfile.c is not yet internationalized
+objc/lang-options.h
+objc/lang-specs.h
objc/objc-act.c
objc/objc-act.h
+objc/objc-parse.y
optabs.c
output.h
-../libiberty/pexecute.c
-#po/cat-id-tbl.c contains the translation tables themselves
+params.c
+params.h
predict.c
prefix.c
prefix.h
@@ -736,12 +1075,6 @@ print-rtl.c
print-tree.c
profile.c
protoize.c
-pself.c
-pself1.c
-pself2.c
-pself3.c
-pself4.c
-pself5.c
real.c
real.h
recog.c
@@ -760,17 +1093,26 @@ resource.h
rtl.c
rtl.h
rtlanal.c
+sbitmap.c
+sbitmap.h
#scan-decls.c is used only by GCC maintainers and installers
#scan.c is used only by GCC maintainers and installers
-scan.h
+#scan.h is used only by GCC maintainers and installers
+sched-deps.c
+sched-ebb.c
+sched-int.h
+sched-rgn.c
+sched-vis.c
sdbout.c
sdbout.h
sibcall.c
simplify-rtx.c
ssa.c
+ssa.h
stack.h
stmt.c
stor-layout.c
+stringpool.c
sys-protos.h
sys-types.h
system.h
@@ -779,13 +1121,21 @@ timevar.h
tlink.c
toplev.c
toplev.h
+tradcif.y
tradcpp.c
+tradcpp.h
tree.c
tree.h
tsystem.h
typeclass.h
unprotoize.c
unroll.c
+#unwind-dw2-fde.c is part of the GCC library
+#unwind-dw2-fde.h is part of the GCC library
+#unwind-dw2.c is part of the GCC library
+#unwind-pe.h is part of the GCC library
+#unwind-sjlj.c is part of the GCC library
+#unwind.h is part of the GCC library
varasm.c
varray.c
varray.h
diff --git a/gcc/po/cat-id-tbl.c b/gcc/po/cat-id-tbl.c
index ecc4ae2b3f6..22148f611be 100644
--- a/gcc/po/cat-id-tbl.c
+++ b/gcc/po/cat-id-tbl.c
@@ -1,4 +1,4 @@
-/* Automatically generated by po2tbl.sed from gcc.pot. */
+/* Automatically generated by po2tbl.sed from @PACKAGE@.pot. */
#if HAVE_CONFIG_H
# include <config.h>
@@ -29,7 +29,7 @@ const struct _msg_ent _msg_tbl[] = {
{"__builtin_trap not supported by this target", 20},
{"built-in function `%s' not currently supported", 21},
{"\
-string length `%d' is greater than the minimum length `%d' ISO C%d is \
+string length `%d' is greater than the length `%d' ISO C%d compilers are \
required to support", 22},
{"`%s' attribute directive ignored", 23},
{"`%s' attribute does not apply to types", 24},
@@ -37,1743 +37,1983 @@ required to support", 22},
{"`%s' attribute ignored", 26},
{"unknown machine mode `%s'", 27},
{"no data type for mode `%s'", 28},
- {"section attribute cannot be specified for local variables", 29},
- {"section of `%s' conflicts with previous declaration", 30},
- {"section attribute not allowed for `%s'", 31},
- {"section attributes are not supported for this target", 32},
- {"requested alignment is not a constant", 33},
- {"requested alignment is not a power of 2", 34},
- {"requested alignment is too large", 35},
- {"alignment may not be specified for `%s'", 36},
- {"argument format specified for non-function `%s'", 37},
- {"unrecognized format specifier", 38},
- {"`%s' is an unrecognized format function type", 39},
- {"format string has invalid operand number", 40},
- {"format string arg follows the args to be formatted", 41},
- {"format string arg not a string type", 42},
- {"args to be formatted is not '...'", 43},
- {"function does not return string type", 44},
- {"`%s' defined both normally and as an alias", 45},
- {"alias arg not a string", 46},
- {"`%s' attribute applies only to functions", 47},
- {"can't set `%s' attribute after definition", 48},
- {"too few arguments for format", 49},
- {"missing $ operand number in format", 50},
- {"ISO C does not support %%n$ operand number formats", 51},
- {"operand number out of range in format", 52},
- {"format argument %d unused before used argument %d in $-style format", 53},
- {"unused arguments in $-style format", 54},
- {"null format string", 55},
- {"format not a string literal, argument types not checked", 56},
- {"zero-length format string", 57},
- {"unterminated format string", 58},
- {"embedded `\\0' in format", 59},
- {"too many arguments for format", 60},
- {"spurious trailing `%%' in format", 61},
- {"zero width in scanf format", 62},
- {"ISO C does not support the strftime `%c' flag", 63},
- {"repeated `%c' flag in format", 64},
- {"ISO C does not support strftime format width", 65},
- {"multiple E/O modifiers in format", 66},
- {"use of both ` ' and `+' flags in format", 67},
- {"use of both `0' and `-' flags in format", 68},
- {"ISO C does not support the `'' format flag", 69},
- {"ISO C does not support the `I' format flag", 70},
- {"field width is not type int (arg %d)", 71},
- {"field precision is not type int (arg %d)", 72},
- {"ISO C does not support the `%s' %s length modifier", 73},
- {"ISO C89 does not support the `%s' %s length modifier", 74},
- {"use of `*' and `%s' together in format", 75},
- {"conversion lacks type at end of format", 76},
- {"unknown conversion type character `%c' in format", 77},
- {"unknown conversion type character 0x%x in format", 78},
- {"ISO C does not support the `%%%c' %s format", 79},
- {"ISO C89 does not support the `%%%c' %s format", 80},
- {"ISO C does not support `%%O%c'", 81},
- {"ISO C89 does not support `%%O%c'", 82},
- {"ISO C89 does not support `%%E%c'", 83},
- {"width used with `%c' format", 84},
- {"`%%%c' yields only last 2 digits of year in some locales", 85},
- {"`%%%c' yields only last 2 digits of year", 86},
- {"precision used with `%c' format", 87},
- {"`a' flag used with `%c' format", 88},
- {"ISO C does not support the `a' flag", 89},
- {"no closing `]' for `%%[' format", 90},
- {"suppression of `%c' conversion in format", 91},
- {"flag `%c' used with type `%c'", 92},
- {"`0' flag ignored with precision specifier and `%c' format", 93},
- {"use of `%s' length modifier with `%c' type character", 94},
- {"ISO C does not support the `%%%s%c' %s format", 95},
- {"ISO C89 does not support the `%%%s%c' %s format", 96},
- {"writing into constant object (arg %d)", 97},
- {"extra type qualifiers in format argument (arg %d)", 98},
- {"format argument is not a pointer (arg %d)", 99},
- {"format argument is not a pointer to a pointer (arg %d)", 100},
- {"%s format, %s arg (arg %d)", 101},
- {"overflow in constant expression", 102},
- {"integer overflow in expression", 103},
- {"floating point overflow in expression", 104},
- {"large integer implicitly truncated to unsigned type", 105},
- {"negative integer implicitly converted to unsigned type", 106},
- {"overflow in implicit constant conversion", 107},
- {"expression statement has incomplete type", 108},
- {"case label does not reduce to an integer constant", 109},
- {"invalid truth-value expression", 110},
- {"invalid operands to binary %s", 111},
- {"comparison is always false due to limited range of data type", 112},
- {"comparison is always true due to limited range of data type", 113},
- {"comparison of unsigned expression >= 0 is always true", 114},
- {"comparison of unsigned expression < 0 is always false", 115},
- {"struct type value used where scalar is required", 116},
- {"union type value used where scalar is required", 117},
- {"array type value used where scalar is required", 118},
- {"suggest parentheses around assignment used as truth value", 119},
- {"invalid use of `restrict'", 120},
- {"too few arguments to function `%s'", 121},
- {"too many arguments to function `%s'", 122},
- {"void value not ignored as it ought to be", 123},
- {"conversion to non-scalar type requested", 124},
- {"unknown C standard `%s'", 125},
- {"array `%s' assumed to have one element", 126},
- {"`struct %s' incomplete in scope ending here", 127},
- {"`union %s' incomplete in scope ending here", 128},
- {"`enum %s' incomplete in scope ending here", 129},
- {"label `%s' used but not defined", 130},
- {"label `%s' defined but not used", 131},
- {"shadowing built-in function `%s'", 132},
- {"shadowing library function `%s'", 133},
- {"library function `%s' declared as non-function", 134},
- {"built-in function `%s' declared as non-function", 135},
- {"`%s' redeclared as different kind of symbol", 136},
- {"previous declaration of `%s'", 137},
- {"conflicting types for built-in function `%s'", 138},
- {"conflicting types for `%s'", 139},
+ {"type with more precision than %s", 29},
+ {"section attribute cannot be specified for local variables", 30},
+ {"section of `%s' conflicts with previous declaration", 31},
+ {"section attribute not allowed for `%s'", 32},
+ {"section attributes are not supported for this target", 33},
+ {"requested alignment is not a constant", 34},
+ {"requested alignment is not a power of 2", 35},
+ {"requested alignment is too large", 36},
+ {"alignment may not be specified for `%s'", 37},
+ {"`%s' defined both normally and as an alias", 38},
+ {"alias arg not a string", 39},
+ {"`%s' attribute applies only to functions", 40},
+ {"can't set `%s' attribute after definition", 41},
+ {"overflow in constant expression", 42},
+ {"integer overflow in expression", 43},
+ {"floating point overflow in expression", 44},
+ {"large integer implicitly truncated to unsigned type", 45},
+ {"negative integer implicitly converted to unsigned type", 46},
+ {"overflow in implicit constant conversion", 47},
+ {"operation on `%s' may be undefined", 48},
+ {"expression statement has incomplete type", 49},
+ {"case label does not reduce to an integer constant", 50},
+ {"invalid truth-value expression", 51},
+ {"invalid operands to binary %s", 52},
+ {"comparison is always false due to limited range of data type", 53},
+ {"comparison is always true due to limited range of data type", 54},
+ {"comparison of unsigned expression >= 0 is always true", 55},
+ {"comparison of unsigned expression < 0 is always false", 56},
+ {"struct type value used where scalar is required", 57},
+ {"union type value used where scalar is required", 58},
+ {"array type value used where scalar is required", 59},
+ {"suggest parentheses around assignment used as truth value", 60},
+ {"invalid use of `restrict'", 61},
+ {"too few arguments to function `%s'", 62},
+ {"too many arguments to function `%s'", 63},
+ {"pointers are not permitted as case values", 64},
+ {"ISO C++ forbids range expressions in switch statements", 65},
+ {"ISO C forbids range expressions in switch statements", 66},
+ {"empty range specified", 67},
+ {"duplicate (or overlapping) case value", 68},
+ {"this is the first entry overlapping that value", 69},
+ {"duplicate case value", 70},
+ {"previously used here", 71},
+ {"multiple default labels in one switch", 72},
+ {"this is the first default label", 73},
+ {"-Wformat-y2k ignored without -Wformat", 74},
+ {"-Wformat-extra-args ignored without -Wformat", 75},
+ {"-Wformat-nonliteral ignored without -Wformat", 76},
+ {"-Wformat-security ignored without -Wformat", 77},
+ {"-Wmissing-format-attribute ignored without -Wformat", 78},
+ {"void value not ignored as it ought to be", 79},
+ {"conversion to non-scalar type requested", 80},
+ {"unknown C standard `%s'", 81},
+ {"array `%s' assumed to have one element", 82},
+ {"`struct %s' incomplete in scope ending here", 83},
+ {"`union %s' incomplete in scope ending here", 84},
+ {"`enum %s' incomplete in scope ending here", 85},
+ {"label `%s' used but not defined", 86},
+ {"label `%s' defined but not used", 87},
+ {"shadowing built-in function `%s'", 88},
+ {"shadowing library function `%s'", 89},
+ {"library function `%s' declared as non-function", 90},
+ {"built-in function `%s' declared as non-function", 91},
+ {"`%s' redeclared as different kind of symbol", 92},
+ {"previous declaration of `%s'", 93},
+ {"conflicting types for built-in function `%s'", 94},
+ {"conflicting types for `%s'", 95},
{"\
A parameter list with an ellipsis can't match an empty parameter name list \
-declaration.", 140},
+declaration.", 96},
{"\
An argument type that has a default promotion can't match an empty parameter \
-name list declaration.", 141},
- {"redefinition of `%s'", 142},
- {"redeclaration of `%s'", 143},
- {"conflicting declarations of `%s'", 144},
- {"`%s' previously defined here", 145},
- {"`%s' previously declared here", 146},
- {"prototype for `%s' follows", 147},
- {"non-prototype definition here", 148},
- {"prototype for `%s' follows and number of arguments doesn't match", 149},
- {"prototype for `%s' follows and argument %d doesn't match", 150},
- {"`%s' declared inline after being called", 151},
- {"`%s' declared inline after its definition", 152},
- {"static declaration for `%s' follows non-static", 153},
- {"non-static declaration for `%s' follows static", 154},
- {"const declaration for `%s' follows non-const", 155},
- {"type qualifiers for `%s' conflict with previous decl", 156},
- {"redundant redeclaration of `%s' in same scope", 157},
- {"nested extern declaration of `%s'", 158},
- {"`%s' used prior to declaration", 159},
- {"`%s' was declared implicitly `extern' and later `static'", 160},
- {"type mismatch with previous external decl", 161},
- {"previous external decl of `%s'", 162},
- {"type mismatch with previous implicit declaration", 163},
- {"previous implicit declaration of `%s'", 164},
- {"type of external `%s' is not global", 165},
- {"`%s' was previously implicitly declared to return `int'", 166},
- {"`%s' was declared `extern' and later `static'", 167},
- {"extern declaration of `%s' doesn't match global one", 168},
- {"`%s' locally external but globally static", 169},
- {"declaration of `%s' shadows a parameter", 170},
- {"declaration of `%s' shadows a symbol from the parameter list", 171},
- {"declaration of `%s' shadows previous local", 172},
- {"declaration of `%s' shadows global declaration", 173},
- {"function `%s' was previously declared within a block", 174},
- {"implicit declaration of function `%s'", 175},
- {"label %s referenced outside of any function", 176},
- {"duplicate label declaration `%s'", 177},
- {"this is a previous declaration", 178},
- {"unnamed struct/union that defines no instances", 179},
- {"useless keyword or type name in empty declaration", 180},
- {"two types specified in one empty declaration", 181},
- {"empty declaration", 182},
- {"`%s' is usually a function", 183},
- {"typedef `%s' is initialized", 184},
- {"function `%s' is initialized like a variable", 185},
- {"parameter `%s' is initialized", 186},
- {"variable-sized object may not be initialized", 187},
- {"variable `%s' has initializer but incomplete type", 188},
- {"elements of array `%s' have incomplete type", 189},
- {"declaration of `%s' has `extern' and is initialized", 190},
- {"initializer fails to determine size of `%s'", 191},
- {"array size missing in `%s'", 192},
- {"zero or negative size array `%s'", 193},
- {"storage size of `%s' isn't known", 194},
- {"storage size of `%s' isn't constant", 195},
- {"ANSI C forbids parameter `%s' shadowing typedef", 196},
- {"`long long long' is too long for GCC", 197},
- {"ISO C89 does not support `long long'", 198},
- {"duplicate `%s'", 199},
- {"two or more data types in declaration of `%s'", 200},
- {"`%s' fails to be a typedef or built in type", 201},
- {"both long and short specified for `%s'", 202},
- {"long or short specified with char for `%s'", 203},
- {"long or short specified with floating type for `%s'", 204},
- {"the only valid combination is `long double'", 205},
- {"both signed and unsigned specified for `%s'", 206},
- {"long, short, signed or unsigned invalid for `%s'", 207},
- {"long, short, signed or unsigned used invalidly for `%s'", 208},
- {"complex invalid for `%s'", 209},
- {"duplicate `const'", 210},
- {"duplicate `restrict'", 211},
- {"duplicate `volatile'", 212},
- {"multiple storage classes in declaration of `%s'", 213},
- {"function definition declared `auto'", 214},
- {"function definition declared `register'", 215},
- {"function definition declared `typedef'", 216},
- {"storage class specified for structure field `%s'", 217},
- {"storage class specified for parameter `%s'", 218},
- {"storage class specified for typename", 219},
- {"`%s' initialized and declared `extern'", 220},
- {"`%s' has both `extern' and initializer", 221},
- {"nested function `%s' declared `extern'", 222},
- {"top-level declaration of `%s' specifies `auto'", 223},
- {"declaration of `%s' as array of voids", 224},
- {"declaration of `%s' as array of functions", 225},
- {"size of array `%s' has non-integer type", 226},
- {"ISO C forbids zero-size array `%s'", 227},
- {"size of array `%s' is negative", 228},
- {"ISO C89 forbids array `%s' whose size can't be evaluated", 229},
- {"ISO C89 forbids variable-size array `%s'", 230},
- {"size of array `%s' is too large", 231},
- {"array type has incomplete element type", 232},
- {"ANSI C forbids const or volatile function types", 233},
- {"`%s' declared as function returning a function", 234},
- {"`%s' declared as function returning an array", 235},
- {"ISO C forbids qualified function types", 236},
- {"invalid type modifier within pointer declarator", 237},
- {"ISO C forbids const or volatile function types", 238},
- {"variable or field `%s' declared void", 239},
- {"field `%s' declared as a function", 240},
- {"field `%s' has incomplete type", 241},
- {"invalid storage class for function `%s'", 242},
- {"ISO C forbids qualified void function return type", 243},
- {"`noreturn' function returns non-void value", 244},
- {"cannot inline function `main'", 245},
- {"variable `%s' declared `inline'", 246},
- {"function declaration isn't a prototype", 247},
- {"parameter names (without types) in function declaration", 248},
- {"parameter `%s' has incomplete type", 249},
- {"parameter has incomplete type", 250},
- {"parameter `%s' points to incomplete type", 251},
- {"parameter points to incomplete type", 252},
- {"parameter `%s' has just a forward declaration", 253},
- {"`void' in parameter list must be the entire list", 254},
- {"`%s %s' declared inside parameter list", 255},
- {"anonymous struct declared inside parameter list", 256},
- {"anonymous union declared inside parameter list", 257},
- {"anonymous enum declared inside parameter list", 258},
+name list declaration.", 97},
+ {"redefinition of `%s'", 98},
+ {"redeclaration of `%s'", 99},
+ {"conflicting declarations of `%s'", 100},
+ {"`%s' previously defined here", 101},
+ {"`%s' previously declared here", 102},
+ {"prototype for `%s' follows", 103},
+ {"non-prototype definition here", 104},
+ {"prototype for `%s' follows and number of arguments doesn't match", 105},
+ {"prototype for `%s' follows and argument %d doesn't match", 106},
+ {"`%s' declared inline after being called", 107},
+ {"`%s' declared inline after its definition", 108},
+ {"static declaration for `%s' follows non-static", 109},
+ {"non-static declaration for `%s' follows static", 110},
+ {"const declaration for `%s' follows non-const", 111},
+ {"type qualifiers for `%s' conflict with previous decl", 112},
+ {"redundant redeclaration of `%s' in same scope", 113},
+ {"nested extern declaration of `%s'", 114},
+ {"`%s' used prior to declaration", 115},
+ {"`%s' was declared implicitly `extern' and later `static'", 116},
+ {"type mismatch with previous external decl", 117},
+ {"previous external decl of `%s'", 118},
+ {"type mismatch with previous implicit declaration", 119},
+ {"previous implicit declaration of `%s'", 120},
+ {"type of external `%s' is not global", 121},
+ {"`%s' was previously implicitly declared to return `int'", 122},
+ {"`%s' was declared `extern' and later `static'", 123},
+ {"extern declaration of `%s' doesn't match global one", 124},
+ {"`%s' locally external but globally static", 125},
+ {"declaration of `%s' shadows a parameter", 126},
+ {"declaration of `%s' shadows a symbol from the parameter list", 127},
+ {"declaration of `%s' shadows previous local", 128},
+ {"declaration of `%s' shadows global declaration", 129},
+ {"function `%s' was previously declared within a block", 130},
+ {"implicit declaration of function `%s'", 131},
+ {"label %s referenced outside of any function", 132},
+ {"duplicate label declaration `%s'", 133},
+ {"this is a previous declaration", 134},
+ {"unnamed struct/union that defines no instances", 135},
+ {"useless keyword or type name in empty declaration", 136},
+ {"two types specified in one empty declaration", 137},
+ {"empty declaration", 138},
+ {"`%s' is usually a function", 139},
+ {"typedef `%s' is initialized", 140},
+ {"function `%s' is initialized like a variable", 141},
+ {"parameter `%s' is initialized", 142},
+ {"variable-sized object may not be initialized", 143},
+ {"variable `%s' has initializer but incomplete type", 144},
+ {"elements of array `%s' have incomplete type", 145},
+ {"declaration of `%s' has `extern' and is initialized", 146},
+ {"initializer fails to determine size of `%s'", 147},
+ {"array size missing in `%s'", 148},
+ {"zero or negative size array `%s'", 149},
+ {"storage size of `%s' isn't known", 150},
+ {"storage size of `%s' isn't constant", 151},
+ {"ignoring asm-specifier for non-static local variable `%s'", 152},
+ {"ANSI C forbids parameter `%s' shadowing typedef", 153},
+ {"`long long long' is too long for GCC", 154},
+ {"ISO C89 does not support `long long'", 155},
+ {"duplicate `%s'", 156},
+ {"two or more data types in declaration of `%s'", 157},
+ {"`%s' fails to be a typedef or built in type", 158},
+ {"type defaults to `int' in declaration of `%s'", 159},
+ {"both long and short specified for `%s'", 160},
+ {"long or short specified with char for `%s'", 161},
+ {"long or short specified with floating type for `%s'", 162},
+ {"the only valid combination is `long double'", 163},
+ {"both signed and unsigned specified for `%s'", 164},
+ {"long, short, signed or unsigned invalid for `%s'", 165},
+ {"long, short, signed or unsigned used invalidly for `%s'", 166},
+ {"complex invalid for `%s'", 167},
+ {"ISO C89 does not support complex types", 168},
+ {"ISO C does not support plain `complex' meaning `double complex'", 169},
+ {"ISO C does not support complex integer types", 170},
+ {"duplicate `const'", 171},
+ {"duplicate `restrict'", 172},
+ {"duplicate `volatile'", 173},
+ {"multiple storage classes in declaration of `%s'", 174},
+ {"function definition declared `auto'", 175},
+ {"function definition declared `register'", 176},
+ {"function definition declared `typedef'", 177},
+ {"storage class specified for structure field `%s'", 178},
+ {"storage class specified for parameter `%s'", 179},
+ {"storage class specified for typename", 180},
+ {"`%s' initialized and declared `extern'", 181},
+ {"`%s' has both `extern' and initializer", 182},
+ {"nested function `%s' declared `extern'", 183},
+ {"top-level declaration of `%s' specifies `auto'", 184},
+ {"declaration of `%s' as array of voids", 185},
+ {"declaration of `%s' as array of functions", 186},
+ {"size of array `%s' has non-integer type", 187},
+ {"ISO C forbids zero-size array `%s'", 188},
+ {"size of array `%s' is negative", 189},
+ {"ISO C89 forbids array `%s' whose size can't be evaluated", 190},
+ {"ISO C89 forbids variable-size array `%s'", 191},
+ {"size of array `%s' is too large", 192},
+ {"ISO C89 does not support flexible array members", 193},
+ {"array type has incomplete element type", 194},
+ {"ANSI C forbids const or volatile function types", 195},
+ {"`%s' declared as function returning a function", 196},
+ {"`%s' declared as function returning an array", 197},
+ {"ISO C forbids qualified void function return type", 198},
+ {"type qualifiers ignored on function return type", 199},
+ {"ISO C forbids qualified function types", 200},
+ {"invalid type modifier within pointer declarator", 201},
+ {"ISO C forbids const or volatile function types", 202},
+ {"variable or field `%s' declared void", 203},
+ {"field `%s' declared as a function", 204},
+ {"field `%s' has incomplete type", 205},
+ {"invalid storage class for function `%s'", 206},
+ {"`noreturn' function returns non-void value", 207},
+ {"cannot inline function `main'", 208},
+ {"variable `%s' declared `inline'", 209},
+ {"function declaration isn't a prototype", 210},
+ {"parameter names (without types) in function declaration", 211},
+ {"parameter `%s' has incomplete type", 212},
+ {"parameter has incomplete type", 213},
+ {"parameter `%s' points to incomplete type", 214},
+ {"parameter points to incomplete type", 215},
+ {"parameter `%s' has just a forward declaration", 216},
+ {"`void' in parameter list must be the entire list", 217},
+ {"`%s %s' declared inside parameter list", 218},
+ {"anonymous struct declared inside parameter list", 219},
+ {"anonymous union declared inside parameter list", 220},
+ {"anonymous enum declared inside parameter list", 221},
{"\
its scope is only this definition or declaration, which is probably not what \
-you want.", 259},
- {"ISO C forbids forward references to `enum' types", 260},
- {"redefinition of `%s %s'", 261},
- {"%s defined inside parms", 262},
- {"union", 263},
- {"structure", 264},
- {"%s has no %s", 265},
- {"struct", 266},
- {"named members", 267},
- {"members", 268},
- {"nested redefinition of `%s'", 269},
- {"bit-field `%s' width not an integer constant", 270},
- {"bit-field `%s' has invalid type", 271},
- {"bit-field `%s' type invalid in ISO C", 272},
- {"negative width in bit-field `%s'", 273},
- {"width of `%s' exceeds its type", 274},
- {"zero width for bit-field `%s'", 275},
- {"`%s' is narrower than values of its type", 276},
- {"duplicate member `%s'", 277},
- {"union cannot be made transparent", 278},
- {"redeclaration of `enum %s'", 279},
- {"enum defined inside parms", 280},
- {"enumeration values exceed range of largest integer", 281},
- {"enumerator value for `%s' not integer constant", 282},
- {"overflow in enumeration values", 283},
- {"ISO C restricts enumerator values to range of `int'", 284},
- {"return type is an incomplete type", 285},
- {"no previous prototype for `%s'", 286},
- {"`%s' was used with no prototype before its definition", 287},
- {"no previous declaration for `%s'", 288},
- {"`%s' was used with no declaration before its definition", 289},
- {"return type of `%s' is not `int'", 290},
- {"first argument of `%s' should be `int'", 291},
- {"second argument of `%s' should be `char **'", 292},
- {"third argument of `%s' should probably be `char **'", 293},
- {"`%s' takes only zero or two arguments", 294},
- {"third argument of `%s' is deprecated", 295},
- {"`%s' is normally a non-static function", 296},
- {"parm types given both in parmlist and separately", 297},
- {"parameter name omitted", 298},
- {"parameter `%s' declared void", 299},
- {"parameter name missing from parameter list", 300},
- {"multiple parameters named `%s'", 301},
- {"type of `%s' defaults to `int'", 302},
- {"declaration for parameter `%s' but no such parameter", 303},
- {"number of arguments doesn't match prototype", 304},
- {"promoted argument `%s' doesn't match prototype", 305},
- {"argument `%s' doesn't match prototype", 306},
- {"type of parameter `%s' is not declared", 307},
- {"function might be possible candidate for attribute `noreturn'", 308},
- {"`noreturn' function does return", 309},
- {"control reaches end of non-void function", 310},
- {"this function may return with or without a value", 311},
- {"size of return value of `%s' is %u bytes", 312},
- {"size of return value of `%s' is larger than %d bytes", 313},
- {"ISO C forbids case ranges", 314},
- {"label must have integral type in ISO C", 315},
- {"default label not within a switch statement", 316},
- {"case label not within a switch statement", 317},
- {"multiple default labels in one switch", 318},
- {"this is the first default label", 319},
- {"duplicate case value", 320},
- {"this is the first entry for that value", 321},
- {"case value out of range", 322},
- {"case label within scope of cleanup or variable array", 323},
- {"stray '\\' in program", 324},
- {"invalid #-line", 325},
- {"undefined or invalid # directive `%s'", 326},
- {"invalid #line", 327},
- {"badly nested C headers from preprocessor", 328},
- {"#-lines for entering and leaving files don't match", 329},
- {"ignoring #pragma %s %s", 330},
- {"ignoring #pragma %s", 331},
- {"incomplete universal-character-name", 332},
- {"non hex digit '%c' in universal-character-name", 333},
- {"universal-character-name on EBCDIC target", 334},
- {"universal-character-name used for '%c'", 335},
- {"invalid universal-character-name", 336},
- {"the meaning of `\\x' varies with -traditional", 337},
- {"\\x used with no following hex digits", 338},
- {"hex escape out of range", 339},
- {"the meaning of '\\a' varies with -traditional", 340},
- {"the meaning of '\\%c' varies with -traditional", 341},
- {"non-ISO-standard escape sequence, '\\%c'", 342},
- {"unknown escape sequence '\\%c'", 343},
- {"unknown escape sequence: '\\' followed by char 0x%.2x", 344},
- {"universal-character-name '\\U%08x' not valid in identifier", 345},
- {"universal-character-name '\\u%04x' not valid in identifier", 346},
- {"both 'f' and 'l' suffixes on floating constant", 347},
- {"floating point number exceeds range of '%s'", 348},
- {"stray '%c' in program", 349},
- {"stray '\\%#o' in program", 350},
- {"'$' in identifier", 351},
- {"parse error at '..'", 352},
- {"floating constant may not be in radix 16", 353},
- {"traditional C rejects the 'f' suffix", 354},
- {"traditional C rejects the 'l' suffix", 355},
- {"ISO C forbids imaginary numeric constants", 356},
- {"floating point number exceeds range of 'double'", 357},
- {"two 'u' suffixes on integer constant", 358},
- {"traditional C rejects the 'u' suffix", 359},
- {"three 'l' suffixes on integer constant", 360},
- {"'lul' is not a valid integer suffix", 361},
- {"'Ll' and 'lL' are not valid integer suffixes", 362},
- {"ISO C89 forbids long long integer constants", 363},
- {"more than one 'i' or 'j' suffix on integer constant", 364},
+you want.", 222},
+ {"redefinition of `%s %s'", 223},
+ {"%s defined inside parms", 224},
+ {"union", 225},
+ {"structure", 226},
+ {"%s has no %s", 227},
+ {"struct", 228},
+ {"named members", 229},
+ {"members", 230},
+ {"nested redefinition of `%s'", 231},
+ {"bit-field `%s' width not an integer constant", 232},
+ {"bit-field `%s' has invalid type", 233},
+ {"bit-field `%s' type invalid in ISO C", 234},
+ {"negative width in bit-field `%s'", 235},
+ {"width of `%s' exceeds its type", 236},
+ {"zero width for bit-field `%s'", 237},
+ {"`%s' is narrower than values of its type", 238},
+ {"flexible array member in union", 239},
+ {"flexible array member not at end of struct", 240},
+ {"flexible array member in otherwise empty struct", 241},
+ {"duplicate member `%s'", 242},
+ {"union cannot be made transparent", 243},
+ {"redeclaration of `enum %s'", 244},
+ {"enum defined inside parms", 245},
+ {"enumeration values exceed range of largest integer", 246},
+ {"enumerator value for `%s' not integer constant", 247},
+ {"overflow in enumeration values", 248},
+ {"ISO C restricts enumerator values to range of `int'", 249},
+ {"return type is an incomplete type", 250},
+ {"return type defaults to `int'", 251},
+ {"no previous prototype for `%s'", 252},
+ {"`%s' was used with no prototype before its definition", 253},
+ {"no previous declaration for `%s'", 254},
+ {"`%s' was used with no declaration before its definition", 255},
+ {"return type of `%s' is not `int'", 256},
+ {"first argument of `%s' should be `int'", 257},
+ {"second argument of `%s' should be `char **'", 258},
+ {"third argument of `%s' should probably be `char **'", 259},
+ {"`%s' takes only zero or two arguments", 260},
+ {"`%s' is normally a non-static function", 261},
+ {"parm types given both in parmlist and separately", 262},
+ {"parameter name omitted", 263},
+ {"parameter `%s' declared void", 264},
+ {"parameter name missing from parameter list", 265},
+ {"multiple parameters named `%s'", 266},
+ {"type of `%s' defaults to `int'", 267},
+ {"declaration for parameter `%s' but no such parameter", 268},
+ {"number of arguments doesn't match prototype", 269},
+ {"promoted argument `%s' doesn't match prototype", 270},
+ {"argument `%s' doesn't match prototype", 271},
+ {"type of parameter `%s' is not declared", 272},
+ {"this function may return with or without a value", 273},
+ {"size of return value of `%s' is %u bytes", 274},
+ {"size of return value of `%s' is larger than %d bytes", 275},
+ {"`for' loop initial declaration used outside C99 mode", 276},
+ {"`%s %s' declared in `for' loop initial declaration", 277},
+ {"declaration of non-variable `%s' in `for' loop initial declaration", 278},
+ {"declaration of static variable `%s' in `for' loop initial declaration", 279},
+ {"declaration of `extern' variable `%s' in `for' loop initial declaration", 280},
+ {"could not open dump file `%s'", 281},
+ {"ignoring `%s' at end of `-f%s'", 282},
+ {"argument format specified for non-function `%s'", 283},
+ {"unrecognized format specifier", 284},
+ {"`%s' is an unrecognized format function type", 285},
+ {"format string has invalid operand number", 286},
+ {"format string arg follows the args to be formatted", 287},
+ {"format string arg not a string type", 288},
+ {"args to be formatted is not '...'", 289},
+ {"strftime formats cannot format arguments", 290},
+ {"function does not return string type", 291},
+ {"` ' flag", 292},
+ {"the ` ' printf flag", 293},
+ {"`+' flag", 294},
+ {"the `+' printf flag", 295},
+ {"`#' flag", 296},
+ {"the `#' printf flag", 297},
+ {"`0' flag", 298},
+ {"the `0' printf flag", 299},
+ {"`-' flag", 300},
+ {"the `-' printf flag", 301},
+ {"`'' flag", 302},
+ {"the `'' printf flag", 303},
+ {"`I' flag", 304},
+ {"the `I' printf flag", 305},
+ {"field width", 306},
+ {"field width in printf format", 307},
+ {"precision", 308},
+ {"precision in printf format", 309},
+ {"length modifier", 310},
+ {"length modifier in printf format", 311},
+ {"assignment suppression", 312},
+ {"`a' flag", 313},
+ {"the `a' scanf flag", 314},
+ {"field width in scanf format", 315},
+ {"length modifier in scanf format", 316},
+ {"the `'' scanf flag", 317},
+ {"the `I' scanf flag", 318},
+ {"`_' flag", 319},
+ {"the `_' strftime flag", 320},
+ {"the `-' strftime flag", 321},
+ {"the `0' strftime flag", 322},
+ {"`^' flag", 323},
+ {"the `^' strftime flag", 324},
+ {"the `#' strftime flag", 325},
+ {"field width in strftime format", 326},
+ {"`E' modifier", 327},
+ {"the `E' strftime modifier", 328},
+ {"`O' modifier", 329},
+ {"the `O' strftime modifier", 330},
+ {"the `O' modifier", 331},
+ {"fill character", 332},
+ {"fill character in strfmon format", 333},
+ {"the `^' strfmon flag", 334},
+ {"the `+' strfmon flag", 335},
+ {"`(' flag", 336},
+ {"the `(' strfmon flag", 337},
+ {"`!' flag", 338},
+ {"the `!' strfmon flag", 339},
+ {"the `-' strfmon flag", 340},
+ {"field width in strfmon format", 341},
+ {"left precision", 342},
+ {"left precision in strfmon format", 343},
+ {"right precision", 344},
+ {"right precision in strfmon format", 345},
+ {"length modifier in strfmon format", 346},
+ {"function might be possible candidate for `%s' format attribute", 347},
+ {"missing $ operand number in format", 348},
+ {"%s does not support %%n$ operand number formats", 349},
+ {"operand number out of range in format", 350},
+ {"format argument %d used more than once in %s format", 351},
+ {"format argument %d unused before used argument %d in $-style format", 352},
+ {"format not a string literal, format string not checked", 353},
+ {"format not a string literal and no format arguments", 354},
+ {"format not a string literal, argument types not checked", 355},
+ {"too many arguments for format", 356},
+ {"unused arguments in $-style format", 357},
+ {"zero-length format string", 358},
+ {"format is a wide character string", 359},
+ {"unterminated format string", 360},
+ {"null format string", 361},
+ {"embedded `\\0' in format", 362},
+ {"spurious trailing `%%' in format", 363},
+ {"repeated %s in format", 364},
+ {"missing fill character at end of strfmon format", 365},
+ {"too few arguments for format", 366},
+ {"zero width in %s format", 367},
+ {"empty left precision in %s format", 368},
+ {"field precision", 369},
+ {"empty precision in %s format", 370},
+ {"%s does not support the `%s' %s length modifier", 371},
+ {"conversion lacks type at end of format", 372},
+ {"unknown conversion type character `%c' in format", 373},
+ {"unknown conversion type character 0x%x in format", 374},
+ {"%s does not support the `%%%c' %s format", 375},
+ {"%s used with `%%%c' %s format", 376},
+ {"%s does not support %s", 377},
+ {"%s does not support %s with the `%%%c' %s format", 378},
+ {"%s ignored with %s and `%%%c' %s format", 379},
+ {"%s ignored with %s in %s format", 380},
+ {"use of %s and %s together with `%%%c' %s format", 381},
+ {"use of %s and %s together in %s format", 382},
+ {"`%%%c' yields only last 2 digits of year in some locales", 383},
+ {"`%%%c' yields only last 2 digits of year", 384},
+ {"no closing `]' for `%%[' format", 385},
+ {"use of `%s' length modifier with `%c' type character", 386},
+ {"%s does not support the `%%%s%c' %s format", 387},
+ {"operand number specified with suppressed assignment", 388},
+ {"operand number specified for format taking no argument", 389},
+ {"writing through null pointer (arg %d)", 390},
+ {"reading through null pointer (arg %d)", 391},
+ {"writing into constant object (arg %d)", 392},
+ {"extra type qualifiers in format argument (arg %d)", 393},
+ {"format argument is not a pointer (arg %d)", 394},
+ {"format argument is not a pointer to a pointer (arg %d)", 395},
+ {"%s is not type %s (arg %d)", 396},
+ {"%s format, %s arg (arg %d)", 397},
+ {"badly nested C headers from preprocessor", 398},
+ {"leaving more files than we entered", 399},
+ {"ignoring #pragma %s %s", 400},
+ {"ignoring #pragma %s", 401},
+ {"incomplete universal-character-name", 402},
+ {"non hex digit '%c' in universal-character-name", 403},
+ {"universal-character-name on EBCDIC target", 404},
+ {"universal-character-name used for '%c'", 405},
+ {"invalid universal-character-name", 406},
+ {"the meaning of `\\x' varies with -traditional", 407},
+ {"\\x used with no following hex digits", 408},
+ {"hex escape out of range", 409},
+ {"the meaning of '\\a' varies with -traditional", 410},
+ {"the meaning of '\\%c' varies with -traditional", 411},
+ {"non-ISO-standard escape sequence, '\\%c'", 412},
+ {"unknown escape sequence '\\%c'", 413},
+ {"unknown escape sequence: '\\' followed by char 0x%x", 414},
+ {"universal-character-name '\\U%08x' not valid in identifier", 415},
+ {"universal-character-name '\\u%04x' not valid in identifier", 416},
+ {"both 'f' and 'l' suffixes on floating constant", 417},
+ {"floating point number exceeds range of '%s'", 418},
+ {"stray '%c' in program", 419},
+ {"stray '\\%o' in program", 420},
+ {"floating constant may not be in radix 16", 421},
+ {"traditional C rejects the 'f' suffix", 422},
+ {"traditional C rejects the 'l' suffix", 423},
+ {"ISO C forbids imaginary numeric constants", 424},
+ {"floating point number exceeds range of 'double'", 425},
+ {"two 'u' suffixes on integer constant", 426},
+ {"traditional C rejects the 'u' suffix", 427},
+ {"three 'l' suffixes on integer constant", 428},
+ {"'lul' is not a valid integer suffix", 429},
+ {"'Ll' and 'lL' are not valid integer suffixes", 430},
+ {"ISO C89 forbids long long integer constants", 431},
+ {"more than one 'i' or 'j' suffix on integer constant", 432},
{"\
integer constant is too large for this configuration of the compiler - \
-truncated to %d bits", 365},
- {"width of integer constant changes with -traditional", 366},
- {"integer constant is unsigned in ISO C, signed with -traditional", 367},
- {"width of integer constant may change on other systems with -traditional", 368},
- {"integer constant larger than the maximum value of an unsigned long int", 369},
- {"decimal constant is so large that it is unsigned", 370},
- {"integer constant is larger than the maximum value for its type", 371},
- {"missing white space after number '%.*s'", 372},
- {"Ignoring invalid multibyte character", 373},
- {"escape sequence out of range for character", 374},
- {"empty character constant", 375},
- {"character constant too long", 376},
- {"multi-character character constant", 377},
- {"syntax error", 378},
- {"syntax error: cannot back up", 379},
- {"parser stack overflow", 380},
- {"ISO C forbids an empty source file", 381},
- {"argument of `asm' is not a constant string", 382},
- {"ISO C forbids data definition with no type or storage class", 383},
- {"data definition has no type or storage class", 384},
- {"ISO C does not allow extra `;' outside of a function", 385},
- {"traditional C rejects the unary plus operator", 386},
- {"ISO C forbids `&&'", 387},
- {"`sizeof' applied to a bit-field", 388},
- {"ISO C89 forbids constructor expressions", 389},
- {"ISO C forbids omitting the middle term of a ?: expression", 390},
- {"ISO C forbids braced-groups within expressions", 391},
- {"traditional C rejects string concatenation", 392},
- {"ISO C does not permit use of `varargs.h'", 393},
- {"`%s' is not at beginning of declaration", 394},
- {"ISO C forbids empty initializer braces", 395},
- {"ISO C forbids nested functions", 396},
- {"`[*]' in parameter declaration only allowed in ISO C 99", 397},
- {"comma at end of enumerator list", 398},
- {"no semicolon at end of struct or union", 399},
- {"extra semicolon in struct or union specified", 400},
- {"ISO C doesn't support unnamed structs/unions", 401},
- {"ISO C forbids member declarations with no members", 402},
- {"ISO C forbids label at end of compound statement", 403},
- {"ISO C forbids label declarations", 404},
- {"braced-group within expression allowed only inside a function", 405},
- {"empty body in an else-statement", 406},
- {"ISO C forbids `goto *expr;'", 407},
- {"ISO C forbids forward parameter declarations", 408},
- {"ISO C requires a named argument before `...'", 409},
- {"`...' in old-style identifier list", 410},
- {"parse error; also virtual memory exceeded", 411},
- {"parse error", 412},
- {"%s at end of input", 413},
- {"%s before %s'%c'", 414},
- {"%s before %s'\\x%x'", 415},
- {"%s before string constant", 416},
- {"%s before numeric constant", 417},
- {"%s before \"%s\"", 418},
- {"%s before '%s' token", 419},
- {"invalid identifier `%s'", 420},
- {"syntax error before '%s' token", 421},
- {"YYDEBUG not defined.", 422},
- {"\
-#pragma pack (pop) encountered without matching #pragma pack (push, <n>)", 423},
+truncated to %d bits", 433},
+ {"width of integer constant changes with -traditional", 434},
+ {"integer constant is unsigned in ISO C, signed with -traditional", 435},
+ {"width of integer constant may change on other systems with -traditional", 436},
+ {"integer constant larger than the maximum value of %s", 437},
+ {"decimal constant is so large that it is unsigned", 438},
+ {"integer constant is larger than the maximum value for its type", 439},
+ {"missing white space after number '%.*s'", 440},
+ {"Ignoring invalid multibyte character", 441},
+ {"escape sequence out of range for character", 442},
+ {"empty character constant", 443},
+ {"character constant too long", 444},
+ {"multi-character character constant", 445},
+ {"syntax error", 446},
+ {"ISO C forbids an empty source file", 447},
+ {"argument of `asm' is not a constant string", 448},
+ {"ISO C forbids data definition with no type or storage class", 449},
+ {"data definition has no type or storage class", 450},
+ {"ISO C does not allow extra `;' outside of a function", 451},
+ {"traditional C rejects the unary plus operator", 452},
+ {"ISO C forbids `&&'", 453},
+ {"`sizeof' applied to a bit-field", 454},
+ {"ISO C forbids omitting the middle term of a ?: expression", 455},
+ {"ISO C89 forbids compound literals", 456},
+ {"ISO C forbids braced-groups within expressions", 457},
+ {"traditional C rejects string concatenation", 458},
+ {"ISO C does not permit use of `varargs.h'", 459},
+ {"`%s' is not at beginning of declaration", 460},
+ {"ISO C forbids empty initializer braces", 461},
+ {"ISO C89 forbids specifying subobject to initialize", 462},
+ {"obsolete use of designated initializer without `='", 463},
+ {"obsolete use of designated initializer with `:'", 464},
+ {"ISO C forbids specifying range of elements to initialize", 465},
+ {"ISO C forbids nested functions", 466},
+ {"`[*]' in parameter declaration only allowed in ISO C 99", 467},
+ {"ISO C forbids forward references to `enum' types", 468},
+ {"comma at end of enumerator list", 469},
+ {"no semicolon at end of struct or union", 470},
+ {"extra semicolon in struct or union specified", 471},
+ {"ISO C doesn't support unnamed structs/unions", 472},
+ {"ISO C forbids member declarations with no members", 473},
+ {"deprecated use of label at end of compound statement", 474},
+ {"ISO C89 forbids mixed declarations and code", 475},
+ {"ISO C forbids label declarations", 476},
+ {"braced-group within expression allowed only inside a function", 477},
+ {"empty body in an else-statement", 478},
+ {"ISO C forbids `goto *expr;'", 479},
+ {"ISO C forbids forward parameter declarations", 480},
+ {"ISO C requires a named argument before `...'", 481},
+ {"`...' in old-style identifier list", 482},
+ {"%s at end of input", 483},
+ {"%s before %s'%c'", 484},
+ {"%s before %s'\\x%x'", 485},
+ {"%s before string constant", 486},
+ {"%s before numeric constant", 487},
+ {"%s before \"%s\"", 488},
+ {"%s before '%s' token", 489},
+ {"syntax error at '%s' token", 490},
+ {"YYDEBUG not defined.", 491},
+ {"\
+#pragma pack (pop) encountered without matching #pragma pack (push, <n>)", 492},
{"\
#pragma pack(pop, %s) encountered without matching #pragma pack(push, %s, \
-<n>)", 424},
- {"junk at end of '#pragma pack'", 425},
- {"junk at end of #pragma weak", 426},
- {"malformed #pragma directive", 427},
- {"break statement not within loop or switch", 428},
- {"continue statement not within a loop", 429},
- {"%s qualifier ignored on asm", 430},
- {"`%s' has an incomplete type", 431},
- {"invalid use of void expression", 432},
- {"invalid use of array with unspecified bounds", 433},
- {"invalid use of undefined type `%s %s'", 434},
- {"invalid use of incomplete typedef `%s'", 435},
- {"function types not truly compatible in ISO C", 436},
- {"types are not quite compatible", 437},
- {"sizeof applied to a function type", 438},
- {"sizeof applied to a void type", 439},
- {"sizeof applied to an incomplete type", 440},
- {"arithmetic on pointer to an incomplete type", 441},
- {"__alignof__ applied to an incomplete type", 442},
- {"`__alignof' applied to a bit-field", 443},
- {"invalid use of non-lvalue array", 444},
- {"%s has no member named `%s'", 445},
- {"request for member `%s' in something not a structure or union", 446},
- {"dereferencing pointer to incomplete type", 447},
- {"dereferencing `void *' pointer", 448},
- {"invalid type argument of `%s'", 449},
- {"subscript missing in array reference", 450},
- {"array subscript has type `char'", 451},
- {"array subscript is not an integer", 452},
- {"ISO C forbids subscripting `register' array", 453},
- {"ISO C89 forbids subscripting non-lvalue array", 454},
- {"subscript has type `char'", 455},
- {"subscripted value is neither array nor pointer", 456},
- {"`%s' undeclared here (not in a function)", 457},
- {"`%s' undeclared (first use in this function)", 458},
- {"(Each undeclared identifier is reported only once", 459},
- {"for each function it appears in.)", 460},
- {"local declaration of `%s' hides instance variable", 461},
- {"called object is not a function", 462},
- {"too many arguments to function", 463},
- {"type of formal parameter %d is incomplete", 464},
- {"%s as integer rather than floating due to prototype", 465},
- {"%s as complex rather than floating due to prototype", 466},
- {"%s as floating rather than integer due to prototype", 467},
- {"%s as floating rather than complex due to prototype", 468},
- {"%s as `float' rather than `double' due to prototype", 469},
- {"%s with different width due to prototype", 470},
- {"%s as unsigned due to prototype", 471},
- {"%s as signed due to prototype", 472},
- {"too few arguments to function", 473},
- {"suggest parentheses around + or - inside shift", 474},
- {"suggest parentheses around && within ||", 475},
- {"suggest parentheses around arithmetic in operand of |", 476},
- {"suggest parentheses around comparison in operand of |", 477},
- {"suggest parentheses around arithmetic in operand of ^", 478},
- {"suggest parentheses around comparison in operand of ^", 479},
- {"suggest parentheses around + or - in operand of &", 480},
- {"suggest parentheses around comparison in operand of &", 481},
- {"comparisons like X<=Y<=Z do not have their mathematical meaning", 482},
- {"right shift count is negative", 483},
- {"right shift count >= width of type", 484},
- {"left shift count is negative", 485},
- {"left shift count >= width of type", 486},
- {"shift count is negative", 487},
- {"shift count >= width of type", 488},
- {"comparing floating point with == or != is unsafe", 489},
- {"ISO C forbids comparison of `void *' with function pointer", 490},
- {"comparison of distinct pointer types lacks a cast", 491},
- {"comparison between pointer and integer", 492},
- {"ISO C forbids ordered comparisons of pointers to functions", 493},
- {"comparison of complete and incomplete pointers", 494},
- {"ordered comparison of pointer with integer zero", 495},
- {"unordered comparison on non-floating point argument", 496},
- {"comparison between signed and unsigned", 497},
- {"comparison of promoted ~unsigned with constant", 498},
- {"comparison of promoted ~unsigned with unsigned", 499},
- {"pointer of type `void *' used in arithmetic", 500},
- {"pointer to a function used in arithmetic", 501},
- {"pointer of type `void *' used in subtraction", 502},
- {"pointer to a function used in subtraction", 503},
- {"wrong type argument to unary plus", 504},
- {"wrong type argument to unary minus", 505},
- {"wrong type argument to bit-complement", 506},
- {"wrong type argument to abs", 507},
- {"wrong type argument to conjugation", 508},
- {"wrong type argument to unary exclamation mark", 509},
- {"wrong type argument to %s", 510},
- {"%s of pointer to unknown structure", 511},
- {"invalid lvalue in increment", 512},
- {"invalid lvalue in decrement", 513},
- {"increment", 514},
- {"decrement", 515},
- {"ISO C forbids the address of a cast expression", 516},
- {"invalid lvalue in unary `&'", 517},
- {"attempt to take address of bit-field structure member `%s'", 518},
- {"%s", 519},
- {"ISO C forbids use of conditional expressions as lvalues", 520},
- {"ISO C forbids use of compound expressions as lvalues", 521},
- {"ISO C forbids use of cast expressions as lvalues", 522},
- {"%s of read-only member `%s'", 523},
- {"%s of read-only variable `%s'", 524},
- {"%s of read-only location", 525},
- {"cannot take address of bitfield `%s'", 526},
- {"global register variable `%s' used in nested function", 527},
- {"register variable `%s' used in nested function", 528},
- {"address of global register variable `%s' requested", 529},
- {"cannot put object with volatile field into register", 530},
- {"address of register variable `%s' requested", 531},
- {"signed and unsigned type in conditional expression", 532},
- {"ISO C forbids conditional expr with only one void side", 533},
- {"ISO C forbids conditional expr between `void *' and function pointer", 534},
- {"pointer type mismatch in conditional expression", 535},
- {"pointer/integer type mismatch in conditional expression", 536},
- {"ANSI C forbids conditional expr between 0 and function pointer", 537},
- {"type mismatch in conditional expression", 538},
- {"left-hand operand of comma expression has no effect", 539},
- {"cast specifies array type", 540},
- {"cast specifies function type", 541},
- {"ISO C forbids casting nonscalar to the same type", 542},
- {"ISO C forbids casts to union type", 543},
- {"cast to union type from type not present in union", 544},
- {"cast discards qualifiers from pointer target type", 545},
- {"cast increases required alignment of target type", 546},
- {"cast from pointer to integer of different size", 547},
- {"cast does not match function type", 548},
- {"cast to pointer from integer of different size", 549},
- {"invalid lvalue in assignment", 550},
- {"assignment", 551},
- {"%s makes qualified function pointer from unqualified", 552},
- {"%s discards qualifiers from pointer target type", 553},
- {"ISO C prohibits argument conversion to union type", 554},
- {"ISO C forbids %s between function pointer and `void *'", 555},
- {"pointer targets in %s differ in signedness", 556},
- {"%s from incompatible pointer type", 557},
- {"%s makes pointer from integer without a cast", 558},
- {"%s makes integer from pointer without a cast", 559},
- {"incompatible type for argument %d of `%s'", 560},
- {"incompatible type for argument %d of indirect function call", 561},
- {"incompatible types in %s", 562},
- {"passing arg %d of `%s'", 563},
- {"passing arg %d of pointer to function", 564},
- {"initializer for static variable is not constant", 565},
- {"initializer for static variable uses complicated arithmetic", 566},
- {"aggregate initializer is not constant", 567},
- {"aggregate initializer uses complicated arithmetic", 568},
- {"traditional C rejects automatic aggregate initialization", 569},
- {"(near initialization for `%s')", 570},
- {"char-array initialized from wide string", 571},
- {"int-array initialized from non-wide string", 572},
- {"initializer-string for array of chars is too long", 573},
- {"array initialized from non-constant array expression", 574},
- {"initializer element is not constant", 575},
- {"initializer element is not computable at load time", 576},
- {"initialization", 577},
- {"invalid initializer", 578},
- {"extra brace group at end of initializer", 579},
- {"missing braces around initializer", 580},
- {"braces around scalar initializer", 581},
- {"missing initializer", 582},
- {"empty braces in initializer", 583},
- {"empty scalar initializer", 584},
- {"extra elements in scalar initializer", 585},
- {"zero or negative array size `%s'", 586},
- {"nonconstant array index in initializer", 587},
- {"array index in non-array initializer", 588},
- {"duplicate array index in initializer", 589},
- {"empty index range in initializer", 590},
- {"ISO C89 forbids specifying element to initialize", 591},
- {"unknown field `%s' specified in initializer", 592},
- {"field `%s' already initialized", 593},
- {"ISO C89 forbids specifying structure member to initialize", 594},
- {"duplicate initializer", 595},
- {"excess elements in char array initializer", 596},
- {"excess elements in struct initializer", 597},
- {"excess elements in union initializer", 598},
- {"traditional C rejects initialization of unions", 599},
- {"excess elements in array initializer", 600},
- {"excess elements in scalar initializer", 601},
- {"asm template is not a string constant", 602},
- {"invalid lvalue in asm statement", 603},
- {"modification by `asm'", 604},
- {"function declared `noreturn' has a `return' statement", 605},
- {"`return' with a value, in function returning void", 606},
- {"return", 607},
- {"function returns address of local variable", 608},
- {"switch quantity not an integer", 609},
- {"`long' switch expression not converted to `int' in ISO C", 610},
- {"inlining failed in call to `%s'", 611},
- {"called from here", 612},
- {"can't inline call to `%s'", 613},
- {"function call has aggregate value", 614},
- {"internal error", 615},
- {"no arguments", 616},
- {"fopen %s", 617},
- {"fclose %s", 618},
- {"collect2 version %s", 619},
- {"%d constructor(s) found\n", 620},
- {"%d destructor(s) found\n", 621},
- {"%d frame table(s) found\n", 622},
- {"%s terminated with signal %d [%s]%s", 623},
- {"%s returned %d exit status", 624},
- {"[cannot find %s]", 625},
- {"cannot find `%s'", 626},
- {"redirecting stdout: %s", 627},
- {"[Leaving %s]\n", 628},
+<n>)", 493},
+ {"junk at end of '#pragma pack'", 494},
+ {"junk at end of #pragma weak", 495},
+ {"break statement not within loop or switch", 496},
+ {"continue statement not within a loop", 497},
+ {"destructor needed for `%#D'", 498},
+ {"where case label appears here", 499},
+ {"\
+(enclose actions of previous case statements requiring destructors in their \
+own scope.)", 500},
+ {"%s qualifier ignored on asm", 501},
+ {"`%s' has an incomplete type", 502},
+ {"invalid use of void expression", 503},
+ {"invalid use of array with unspecified bounds", 504},
+ {"invalid use of undefined type `%s %s'", 505},
+ {"invalid use of incomplete typedef `%s'", 506},
+ {"function types not truly compatible in ISO C", 507},
+ {"types are not quite compatible", 508},
+ {"sizeof applied to a function type", 509},
+ {"sizeof applied to a void type", 510},
+ {"sizeof applied to an incomplete type", 511},
+ {"arithmetic on pointer to an incomplete type", 512},
+ {"__alignof__ applied to an incomplete type", 513},
+ {"`__alignof' applied to a bit-field", 514},
+ {"invalid use of non-lvalue array", 515},
+ {"%s has no member named `%s'", 516},
+ {"request for member `%s' in something not a structure or union", 517},
+ {"dereferencing pointer to incomplete type", 518},
+ {"dereferencing `void *' pointer", 519},
+ {"invalid type argument of `%s'", 520},
+ {"subscript missing in array reference", 521},
+ {"array subscript has type `char'", 522},
+ {"array subscript is not an integer", 523},
+ {"ISO C forbids subscripting `register' array", 524},
+ {"ISO C89 forbids subscripting non-lvalue array", 525},
+ {"subscript has type `char'", 526},
+ {"subscripted value is neither array nor pointer", 527},
+ {"`%s' undeclared here (not in a function)", 528},
+ {"`%s' undeclared (first use in this function)", 529},
+ {"(Each undeclared identifier is reported only once", 530},
+ {"for each function it appears in.)", 531},
+ {"local declaration of `%s' hides instance variable", 532},
+ {"called object is not a function", 533},
+ {"too many arguments to function", 534},
+ {"type of formal parameter %d is incomplete", 535},
+ {"%s as integer rather than floating due to prototype", 536},
+ {"%s as integer rather than complex due to prototype", 537},
+ {"%s as complex rather than floating due to prototype", 538},
+ {"%s as floating rather than integer due to prototype", 539},
+ {"%s as complex rather than integer due to prototype", 540},
+ {"%s as floating rather than complex due to prototype", 541},
+ {"%s as `float' rather than `double' due to prototype", 542},
+ {"%s with different width due to prototype", 543},
+ {"%s as unsigned due to prototype", 544},
+ {"%s as signed due to prototype", 545},
+ {"too few arguments to function", 546},
+ {"suggest parentheses around + or - inside shift", 547},
+ {"suggest parentheses around && within ||", 548},
+ {"suggest parentheses around arithmetic in operand of |", 549},
+ {"suggest parentheses around comparison in operand of |", 550},
+ {"suggest parentheses around arithmetic in operand of ^", 551},
+ {"suggest parentheses around comparison in operand of ^", 552},
+ {"suggest parentheses around + or - in operand of &", 553},
+ {"suggest parentheses around comparison in operand of &", 554},
+ {"comparisons like X<=Y<=Z do not have their mathematical meaning", 555},
+ {"right shift count is negative", 556},
+ {"right shift count >= width of type", 557},
+ {"left shift count is negative", 558},
+ {"left shift count >= width of type", 559},
+ {"shift count is negative", 560},
+ {"shift count >= width of type", 561},
+ {"comparing floating point with == or != is unsafe", 562},
+ {"ISO C forbids comparison of `void *' with function pointer", 563},
+ {"comparison of distinct pointer types lacks a cast", 564},
+ {"comparison between pointer and integer", 565},
+ {"ISO C forbids ordered comparisons of pointers to functions", 566},
+ {"comparison of complete and incomplete pointers", 567},
+ {"ordered comparison of pointer with integer zero", 568},
+ {"unordered comparison on non-floating point argument", 569},
+ {"comparison between signed and unsigned", 570},
+ {"comparison of promoted ~unsigned with constant", 571},
+ {"comparison of promoted ~unsigned with unsigned", 572},
+ {"pointer of type `void *' used in arithmetic", 573},
+ {"pointer to a function used in arithmetic", 574},
+ {"pointer of type `void *' used in subtraction", 575},
+ {"pointer to a function used in subtraction", 576},
+ {"wrong type argument to unary plus", 577},
+ {"wrong type argument to unary minus", 578},
+ {"ISO C does not support `~' for complex conjugation", 579},
+ {"wrong type argument to bit-complement", 580},
+ {"wrong type argument to abs", 581},
+ {"wrong type argument to conjugation", 582},
+ {"wrong type argument to unary exclamation mark", 583},
+ {"ISO C does not support `++' and `--' on complex types", 584},
+ {"wrong type argument to %s", 585},
+ {"%s of pointer to unknown structure", 586},
+ {"invalid lvalue in increment", 587},
+ {"invalid lvalue in decrement", 588},
+ {"increment", 589},
+ {"decrement", 590},
+ {"ISO C forbids the address of a cast expression", 591},
+ {"invalid lvalue in unary `&'", 592},
+ {"attempt to take address of bit-field structure member `%s'", 593},
+ {"%s", 594},
+ {"ISO C forbids use of conditional expressions as lvalues", 595},
+ {"ISO C forbids use of compound expressions as lvalues", 596},
+ {"ISO C forbids use of cast expressions as lvalues", 597},
+ {"%s of read-only member `%s'", 598},
+ {"%s of read-only variable `%s'", 599},
+ {"%s of read-only location", 600},
+ {"cannot take address of bitfield `%s'", 601},
+ {"global register variable `%s' used in nested function", 602},
+ {"register variable `%s' used in nested function", 603},
+ {"address of global register variable `%s' requested", 604},
+ {"cannot put object with volatile field into register", 605},
+ {"address of register variable `%s' requested", 606},
+ {"signed and unsigned type in conditional expression", 607},
+ {"ISO C forbids conditional expr with only one void side", 608},
+ {"ISO C forbids conditional expr between `void *' and function pointer", 609},
+ {"pointer type mismatch in conditional expression", 610},
+ {"pointer/integer type mismatch in conditional expression", 611},
+ {"type mismatch in conditional expression", 612},
+ {"left-hand operand of comma expression has no effect", 613},
+ {"cast specifies array type", 614},
+ {"cast specifies function type", 615},
+ {"ISO C forbids casting nonscalar to the same type", 616},
+ {"ISO C forbids casts to union type", 617},
+ {"cast to union type from type not present in union", 618},
+ {"cast discards qualifiers from pointer target type", 619},
+ {"cast increases required alignment of target type", 620},
+ {"cast from pointer to integer of different size", 621},
+ {"cast does not match function type", 622},
+ {"cast to pointer from integer of different size", 623},
+ {"invalid lvalue in assignment", 624},
+ {"assignment", 625},
+ {"%s makes qualified function pointer from unqualified", 626},
+ {"%s discards qualifiers from pointer target type", 627},
+ {"ISO C prohibits argument conversion to union type", 628},
+ {"ISO C forbids %s between function pointer and `void *'", 629},
+ {"pointer targets in %s differ in signedness", 630},
+ {"%s from incompatible pointer type", 631},
+ {"%s makes pointer from integer without a cast", 632},
+ {"%s makes integer from pointer without a cast", 633},
+ {"incompatible type for argument %d of `%s'", 634},
+ {"incompatible type for argument %d of indirect function call", 635},
+ {"incompatible types in %s", 636},
+ {"passing arg %d of `%s'", 637},
+ {"passing arg %d of pointer to function", 638},
+ {"initializer for static variable is not constant", 639},
+ {"initializer for static variable uses complicated arithmetic", 640},
+ {"aggregate initializer is not constant", 641},
+ {"aggregate initializer uses complicated arithmetic", 642},
+ {"traditional C rejects automatic aggregate initialization", 643},
+ {"(near initialization for `%s')", 644},
+ {"char-array initialized from wide string", 645},
+ {"int-array initialized from non-wide string", 646},
+ {"initializer-string for array of chars is too long", 647},
+ {"array initialized from non-constant array expression", 648},
+ {"initializer element is not constant", 649},
+ {"initialization", 650},
+ {"initializer element is not computable at load time", 651},
+ {"invalid initializer", 652},
+ {"extra brace group at end of initializer", 653},
+ {"missing braces around initializer", 654},
+ {"braces around scalar initializer", 655},
+ {"initialization of flexible array member in a nested context", 656},
+ {"initialization of a flexible array member", 657},
+ {"deprecated initialization of zero-length array", 658},
+ {"initialization of zero-length array before end of structure", 659},
+ {"initialization of zero-length array inside a nested context", 660},
+ {"missing initializer", 661},
+ {"empty scalar initializer", 662},
+ {"extra elements in scalar initializer", 663},
+ {"initialization designators may not nest", 664},
+ {"array index in non-array initializer", 665},
+ {"field name not in record or union initializer", 666},
+ {"nonconstant array index in initializer", 667},
+ {"array index in initializer exceeds array bounds", 668},
+ {"empty index range in initializer", 669},
+ {"array index range in initializer exceeds array bounds", 670},
+ {"unknown field `%s' specified in initializer", 671},
+ {"initialized field with side-effects overwritten", 672},
+ {"excess elements in char array initializer", 673},
+ {"excess elements in struct initializer", 674},
+ {"excess elements in union initializer", 675},
+ {"traditional C rejects initialization of unions", 676},
+ {"excess elements in array initializer", 677},
+ {"excess elements in scalar initializer", 678},
+ {"asm template is not a string constant", 679},
+ {"invalid lvalue in asm statement", 680},
+ {"modification by `asm'", 681},
+ {"function declared `noreturn' has a `return' statement", 682},
+ {"`return' with no value, in function returning non-void", 683},
+ {"`return' with a value, in function returning void", 684},
+ {"return", 685},
+ {"function returns address of local variable", 686},
+ {"switch quantity not an integer", 687},
+ {"`long' switch expression not converted to `int' in ISO C", 688},
+ {"case label not within a switch statement", 689},
+ {"`default' label not within a switch statement", 690},
+ {"inlining failed in call to `%s'", 691},
+ {"called from here", 692},
+ {"can't inline call to `%s'", 693},
+ {"function call has aggregate value", 694},
+ {"variable offset is passed paritially in stack and in reg", 695},
+ {"variable size is passed partially in stack and in reg", 696},
+ {"internal error", 697},
+ {"no arguments", 698},
+ {"fopen %s", 699},
+ {"fclose %s", 700},
+ {"collect2 version %s", 701},
+ {"%d constructor(s) found\n", 702},
+ {"%d destructor(s) found\n", 703},
+ {"%d frame table(s) found\n", 704},
+ {"%s terminated with signal %d [%s]%s", 705},
+ {"%s returned %d exit status", 706},
+ {"[cannot find %s]", 707},
+ {"cannot find `%s'", 708},
+ {"redirecting stdout: %s", 709},
+ {"[Leaving %s]\n", 710},
{"\
\n\
-write_c_file - output name is %s, prefix is %s\n", 629},
- {"cannot find `nm'", 630},
- {"pipe", 631},
- {"fdopen", 632},
- {"dup2 %d 1", 633},
- {"close %d", 634},
- {"execvp %s", 635},
- {"init function found in object %s", 636},
- {"fini function found in object %s", 637},
- {"fclose", 638},
- {"unable to open file '%s'", 639},
- {"unable to stat file '%s'", 640},
- {"unable to mmap file '%s'", 641},
- {"not found\n", 642},
- {"dynamic dependency %s not found", 643},
- {"bad magic number in file '%s'", 644},
- {"dynamic dependencies.\n", 645},
- {"cannot find `ldd'", 646},
- {"execv %s", 647},
+write_c_file - output name is %s, prefix is %s\n", 711},
+ {"cannot find `nm'", 712},
+ {"pipe", 713},
+ {"fdopen", 714},
+ {"dup2 %d 1", 715},
+ {"close %d", 716},
+ {"execvp %s", 717},
+ {"init function found in object %s", 718},
+ {"fini function found in object %s", 719},
+ {"fclose", 720},
+ {"unable to open file '%s'", 721},
+ {"unable to stat file '%s'", 722},
+ {"unable to mmap file '%s'", 723},
+ {"not found\n", 724},
+ {"dynamic dependency %s not found", 725},
+ {"bad magic number in file '%s'", 726},
+ {"dynamic dependencies.\n", 727},
+ {"cannot find `ldd'", 728},
+ {"execv %s", 729},
{"\
\n\
-ldd output with constructors/destructors.\n", 648},
- {"unable to open dynamic dependency '%s'", 649},
- {"%s: not a COFF file", 650},
- {"%s: cannot open as COFF file", 651},
- {"Library lib%s not found", 652},
- {"open %s", 653},
- {"incompatibilities between object file & expected values", 654},
+ldd output with constructors/destructors.\n", 730},
+ {"unable to open dynamic dependency '%s'", 731},
+ {"%s: not a COFF file", 732},
+ {"%s: cannot open as COFF file", 733},
+ {"Library lib%s not found", 734},
+ {"open %s", 735},
+ {"incompatibilities between object file & expected values", 736},
{"\
\n\
-Processing symbol table #%d, offset = 0x%.8lx, kind = %s\n", 655},
- {"string section missing", 656},
- {"section pointer missing", 657},
- {"no symbol table found", 658},
- {"no cmd_strings found", 659},
+Processing symbol table #%d, offset = 0x%.8lx, kind = %s\n", 737},
+ {"string section missing", 738},
+ {"section pointer missing", 739},
+ {"no symbol table found", 740},
+ {"no cmd_strings found", 741},
{"\
\n\
Updating header and load commands.\n\
-\n", 660},
- {"load command map, %d cmds, new size %ld.\n", 661},
+\n", 742},
+ {"load command map, %d cmds, new size %ld.\n", 743},
{"\
writing load commands.\n\
-\n", 662},
- {"close %s", 663},
- {"could not convert 0x%l.8x into a region", 664},
- {"%s function, region %d, offset = %ld (0x%.8lx)\n", 665},
- {"bad magic number", 666},
- {"bad header version", 667},
- {"bad raw header version", 668},
- {"raw header buffer too small", 669},
- {"old raw header file", 670},
- {"unsupported version", 671},
- {"unknown {de,en}code_mach_o_hdr return value %d", 672},
- {"fstat %s", 673},
- {"lseek %s 0", 674},
- {"read %s", 675},
- {"read %ld bytes, expected %ld, from %s", 676},
- {"msync %s", 677},
- {"munmap %s", 678},
- {"write %s", 679},
- {"wrote %ld bytes, expected %ld, to %s", 680},
+\n", 744},
+ {"close %s", 745},
+ {"could not convert 0x%l.8x into a region", 746},
+ {"%s function, region %d, offset = %ld (0x%.8lx)\n", 747},
+ {"bad magic number", 748},
+ {"bad header version", 749},
+ {"bad raw header version", 750},
+ {"raw header buffer too small", 751},
+ {"old raw header file", 752},
+ {"unsupported version", 753},
+ {"unknown {de,en}code_mach_o_hdr return value %d", 754},
+ {"fstat %s", 755},
+ {"lseek %s 0", 756},
+ {"read %s", 757},
+ {"read %ld bytes, expected %ld, from %s", 758},
+ {"msync %s", 759},
+ {"munmap %s", 760},
+ {"write %s", 761},
+ {"wrote %ld bytes, expected %ld, to %s", 762},
{"\
;; Combiner statistics: %d attempts, %d substitutions (%d requiring new \
space),\n\
;; %d successes.\n\
-\n", 681},
+\n", 763},
{"\
\n\
;; Combiner totals: %d attempts, %d substitutions (%d requiring new space),\n\
-;; %d successes.\n", 682},
- {"invalid %%Q value", 683},
- {"invalid %%C value", 684},
- {"invalid %%N value", 685},
- {"invalid %%M value", 686},
- {"invalid %%m value", 687},
- {"invalid %%L value", 688},
- {"invalid %%O value", 689},
- {"invalid %%P value", 690},
- {"invalid %%V value", 691},
- {"Generate code assuming DW bit is set", 692},
- {"Generate code assuming DW bit is not set", 693},
- {"Generate code using byte writes", 694},
- {"Do not generate byte writes", 695},
- {"Use small memory model", 696},
- {"Use normal memory model", 697},
- {"Use large memory model", 698},
- {"Generate 29050 code", 699},
- {"Generate 29000 code", 700},
- {"Use kernel global registers", 701},
- {"Use user global registers", 702},
- {"Emit stack checking code", 703},
- {"Do not emit stack checking code", 704},
- {"Work around storem hardware bug", 705},
- {"Do not work around storem hardware bug", 706},
- {"Store locals in argument registers", 707},
- {"Do not store locals in arg registers", 708},
- {"Use software floating point", 709},
- {"Do not generate multm instructions", 710},
- {"bad value `%s' for -mtrap-precision switch", 711},
- {"bad value `%s' for -mfp-rounding-mode switch", 712},
- {"bad value `%s' for -mfp-trap-mode switch", 713},
- {"bad value `%s' for -mcpu switch", 714},
- {"fp software completion requires -mtrap-precision=i", 715},
- {"rounding mode not supported for VAX floats", 716},
- {"trap mode not supported for VAX floats", 717},
- {"L%d cache latency unknown for %s", 718},
- {"bad value `%s' for -mmemory-latency", 719},
- {"invalid %%r value", 720},
- {"invalid %%R value", 721},
- {"invalid %%h value", 722},
- {"invalid %%U value", 723},
- {"invalid %%s value", 724},
- {"invalid %%E value", 725},
- {"invalid %%xn code", 726},
- {"Use hardware fp", 727},
- {"Do not use hardware fp", 728},
- {"Use fp registers", 729},
- {"Do not use fp registers", 730},
- {"Do not assume GAS", 731},
- {"Assume GAS", 732},
- {"Request IEEE-conformant math library routines (OSF/1)", 733},
- {"Emit IEEE-conformant code, without inexact exceptions", 734},
- {"Emit IEEE-conformant code, with inexact exceptions", 735},
- {"Do not emit complex integer constants to read-only memory", 736},
- {"Use VAX fp", 737},
- {"Do not use VAX fp", 738},
- {"Emit code for the byte/word ISA extension", 739},
- {"Emit code for the motion video ISA extension", 740},
- {"Emit code for the fp move and sqrt ISA extension", 741},
- {"Emit code for the counting ISA extension", 742},
- {"Generate code for a given CPU", 743},
- {"Control the generated fp rounding mode", 744},
- {"Control the IEEE trap mode", 745},
- {"Control the precision given to fp exceptions", 746},
- {"Tune expected memory latency", 747},
- {"bad value (%s) for -mcpu switch", 748},
- {"invalid operand to %R code", 749},
- {"invalid operand to %H/%L code", 750},
- {"invalid operand to %U code", 751},
- {"invalid operand to %V code", 752},
- {"invalid operand output code", 753},
- {"switch -mcpu=%s conflicts with -march= switch", 754},
- {"bad value (%s) for %s switch", 755},
- {"target CPU does not support APCS-32", 756},
- {"target CPU does not support APCS-26", 757},
- {"target CPU does not support interworking", 758},
- {"target CPU does not supoport THUMB instructions.", 759},
- {"\
-enabling backtrace support is only meaningful when compiling for the Thumb.", 760},
+;; %d successes.\n", 764},
+ {"Use VAX-C alignment", 765},
+ {"invalid %%Q value", 766},
+ {"invalid %%C value", 767},
+ {"invalid %%N value", 768},
+ {"invalid %%M value", 769},
+ {"invalid %%m value", 770},
+ {"invalid %%L value", 771},
+ {"invalid %%O value", 772},
+ {"invalid %%P value", 773},
+ {"invalid %%V value", 774},
+ {"Generate code assuming DW bit is set", 775},
+ {"Generate code assuming DW bit is not set", 776},
+ {"Generate code using byte writes", 777},
+ {"Do not generate byte writes", 778},
+ {"Use small memory model", 779},
+ {"Use normal memory model", 780},
+ {"Use large memory model", 781},
+ {"Generate 29050 code", 782},
+ {"Generate 29000 code", 783},
+ {"Use kernel global registers", 784},
+ {"Use user global registers", 785},
+ {"Emit stack checking code", 786},
+ {"Do not emit stack checking code", 787},
+ {"Work around storem hardware bug", 788},
+ {"Do not work around storem hardware bug", 789},
+ {"Store locals in argument registers", 790},
+ {"Do not store locals in arg registers", 791},
+ {"Use software floating point", 792},
+ {"Do not generate multm instructions", 793},
+ {"bad value `%s' for -mtrap-precision switch", 794},
+ {"bad value `%s' for -mfp-rounding-mode switch", 795},
+ {"bad value `%s' for -mfp-trap-mode switch", 796},
+ {"bad value `%s' for -mcpu switch", 797},
+ {"fp software completion requires -mtrap-precision=i", 798},
+ {"rounding mode not supported for VAX floats", 799},
+ {"trap mode not supported for VAX floats", 800},
+ {"L%d cache latency unknown for %s", 801},
+ {"bad value `%s' for -mmemory-latency", 802},
+ {"invalid %%r value", 803},
+ {"invalid %%R value", 804},
+ {"invalid %%h value", 805},
+ {"invalid %%U value", 806},
+ {"invalid %%s value", 807},
+ {"invalid %%E value", 808},
+ {"invalid %%xn code", 809},
+ {"Use hardware fp", 810},
+ {"Do not use hardware fp", 811},
+ {"Use fp registers", 812},
+ {"Do not use fp registers", 813},
+ {"Do not assume GAS", 814},
+ {"Assume GAS", 815},
+ {"Request IEEE-conformant math library routines (OSF/1)", 816},
+ {"Emit IEEE-conformant code, without inexact exceptions", 817},
+ {"Emit IEEE-conformant code, with inexact exceptions", 818},
+ {"Do not emit complex integer constants to read-only memory", 819},
+ {"Use VAX fp", 820},
+ {"Do not use VAX fp", 821},
+ {"Emit code for the byte/word ISA extension", 822},
+ {"Emit code for the motion video ISA extension", 823},
+ {"Emit code for the fp move and sqrt ISA extension", 824},
+ {"Emit code for the counting ISA extension", 825},
+ {"Use features of and schedule given CPU", 826},
+ {"Schedule given CPU", 827},
+ {"Control the generated fp rounding mode", 828},
+ {"Control the IEEE trap mode", 829},
+ {"Control the precision given to fp exceptions", 830},
+ {"Tune expected memory latency", 831},
+ {"%s causes a section type conflict", 832},
+ {"bad value (%s) for -mcpu switch", 833},
+ {"invalid operand to %R code", 834},
+ {"invalid operand to %H/%L code", 835},
+ {"invalid operand to %U code", 836},
+ {"invalid operand to %V code", 837},
+ {"invalid operand output code", 838},
+ {"switch -mcpu=%s conflicts with -march= switch", 839},
+ {"bad value (%s) for %s switch", 840},
+ {"target CPU does not support APCS-32", 841},
+ {"target CPU does not support APCS-26", 842},
+ {"target CPU does not support interworking", 843},
+ {"target CPU does not support THUMB instructions.", 844},
+ {"\
+enabling backtrace support is only meaningful when compiling for the Thumb.", 845},
{"\
enabling callee interworking support is only meaningful when compiling for \
-the Thumb.", 761},
+the Thumb.", 846},
{"\
enabling caller interworking support is only meaningful when compiling for \
-the Thumb.", 762},
- {"interworking forces APCS-32 to be used", 763},
- {"-mapcs-stack-check incompatible with -mno-apcs-frame", 764},
- {"-fpic and -mapcs-reent are incompatible", 765},
- {"APCS reentrant code not supported. Ignored", 766},
- {"-g with -mno-apcs-frame may not give sensible debugging", 767},
- {"Passing floating point arguments in fp regs not yet supported", 768},
- {"Invalid floating point emulation option: -mfpe-%s", 769},
- {"Structure size boundary can only be set to 8 or 32", 770},
- {"-mpic-register= is useless without -fpic", 771},
- {"Unable to use '%s' for PIC register", 772},
- {"Unable to compute real location of stacked parameter", 773},
- {"No low registers available for popping high registers", 774},
- {"thumb_load_double_from_address: destination is not a register", 775},
- {"thumb_load_double_from_address: source is not a computed memory address", 776},
- {"thumb_load_double_from_address: base is not a register", 777},
- {"thumb_load_double_from_address: Unhandled address calculation", 778},
- {"Generate APCS conformant stack frames", 779},
- {"Store function names in object code", 780},
- {"Use the 32bit version of the APCS", 781},
- {"Use the 26bit version of the APCS", 782},
- {"Pass FP arguments in FP registers", 783},
- {"Generate re-entrant, PIC code", 784},
- {"The MMU will trap on unaligned accesses", 785},
- {"Use library calls to perform FP operations", 786},
- {"Use hardware floating point instructions", 787},
- {"Assume target CPU is configured as big endian", 788},
- {"Assume target CPU is configured as little endian", 789},
- {"Assume big endian bytes, little endian words", 790},
- {"Support calls between THUMB and ARM instructions sets", 791},
- {"Generate a call to abort if a noreturn function returns", 792},
- {"Do not move instructions into a function's prologue", 793},
- {"Do not load the PIC register in function prologues", 794},
- {"Generate call insns as indirect calls, if necessary", 795},
- {"Compile for the Thumb not the ARM", 796},
- {"Thumb: Generate (non-leaf) stack frames even if not needed", 797},
- {"Thumb: Generate (leaf) stack frames even if not needed", 798},
- {"Thumb: Assume non-static functions may be called from ARM code", 799},
- {"Thumb: Assume function pointers may go to non-Thumb aware code", 800},
- {"Specify the name of the target CPU", 801},
- {"Specify the name of the target architecture", 802},
- {"Specify the version of the floating point emulator", 803},
- {"Specify the minimum bit alignment of structures", 804},
- {"Specify the register to be used for PIC addressing", 805},
- {"Do symbol renaming for BSD", 806},
- {"Do symbol renaming for X/OPEN", 807},
- {"Don't do symbol renaming", 808},
- {"Generate code for the C400", 809},
- {"Generate code for the C300", 810},
- {"Generate code for c1", 811},
- {"Generate code for c2", 812},
- {"Generate code for c32", 813},
- {"Generate code for c34", 814},
- {"Use standard calling sequence, with arg count word", 815},
- {"Place arg count in a nop instruction (faster than push)", 816},
- {"Don't push arg count, depend on symbol table", 817},
- {"Use data cache for volatile mem refs (default)", 818},
- {"Don't use data cache for volatile mem refs", 819},
- {"Bypass data cache for volatile mem refs", 820},
- {"Use 64-bit longs", 821},
- {"Use cc- and libc-compatible 32-bit longs", 822},
- {"Invalid register class letter %c", 823},
- {"ACCUM_HIGH_REGS class in limit_reload_class", 824},
- {"YH_OR_ACCUM_HIGH_REGS found in limit_reload_class", 825},
- {"YL found in limit_reload_class", 826},
- {"Stack size > 32k", 827},
- {"Invalid addressing mode", 828},
- {"Bad register extension code", 829},
- {"Invalid offset in ybase addressing", 830},
- {"Invalid register in ybase addressing", 831},
- {"inline float constants not supported on this host", 832},
- {"Invalid shift operator in emit_1600_core_shift", 833},
- {"Invalid mode for gen_tst_reg", 834},
- {"Invalid mode for integer comparison in gen_compare_reg", 835},
- {"Invalid register for compare", 836},
- {"Profiling not implemented yet.", 837},
- {"Trampolines not yet implemented", 838},
- {"Generate code the unix assembler can handle", 839},
- {"Generate code an embedded assembler can handle", 840},
- {"Generate code for a mc68020", 841},
- {"Use bitfield instructions", 842},
- {"Generate code for a mc68000", 843},
- {"Generate software FP code", 844},
- {"Do not generate bitfield insns", 845},
- {"Use 16bit integers", 846},
- {"Use 32bit integers", 847},
- {"Compile for Gmicro/300", 848},
- {"Compile for Gmicro/200", 849},
- {"Compile for Gmicro/100", 850},
- {"Use floating point co-processor", 851},
- {"Do not use floating point co-processor", 852},
- {"Alternate calling convention", 853},
- {"Use normal calling convention", 854},
- {"Do not use bitfield instructions", 855},
- {"Use alternative return sequence", 856},
- {"Use normal return sequence", 857},
- {"Always use string instruction", 858},
- {"Use string instruction when appropriate", 859},
- {"Only initialized variables can be placed into the 8-bit area.", 860},
- {"Generate H8/S code", 861},
- {"Do not generate H8/S code", 862},
- {"Make integers 32 bits wide", 863},
- {"Use registers for argument passing", 864},
- {"Do not use registers for argument passing", 865},
- {"Consider access to byte sized memory slow", 866},
- {"Enable linker relaxing", 867},
- {"Generate H8/300H code", 868},
- {"Do not generate H8/300H code", 869},
- {"Use H8/300 alignment rules", 870},
- {"real name is too long - alias ignored", 871},
- {"alias name is too long - alias ignored", 872},
- {"junk at end of #pragma map", 873},
- {"malformed #pragma map, ignored", 874},
- {"Generate char instructions", 875},
- {"Do not generate char instructions", 876},
- {"Use the Cygwin interface", 877},
- {"Use the Mingw32 interface", 878},
- {"Create GUI application", 879},
- {"Create console application", 880},
- {"Generate code for a DLL", 881},
- {"Ignore dllimport for functions", 882},
- {"Use Mingw-specific thread support", 883},
- {"-f%s ignored for target (all code is position independent)", 884},
- {"Internal gcc abort from %s:%d", 885},
- {"The local variable `insn' has the value:", 886},
- {"Retain standard MXDB information", 887},
- {"Retain legend information", 888},
- {"Generate external legend information", 889},
- {"Emit identifying info in .s file", 890},
- {"Warn when a function arg is a structure", 891},
- {"argument is a structure", 892},
- {"bad value (%s) for -march= switch", 893},
- {"bad value (%s) for -mcpu= switch", 894},
- {"Register '%c' is unknown", 895},
- {"Register '%c' already specified in allocation order", 896},
- {"-mregparm=%d is not between 0 and %d", 897},
- {"-malign-loops=%d is not between 0 and %d", 898},
- {"-malign-jumps=%d is not between 0 and %d", 899},
- {"-malign-functions=%d is not between 0 and %d", 900},
- {"-mpreferred-stack-boundary=%d is not between 2 and 31", 901},
- {"-mbranch-cost=%d is not between 0 and 5", 902},
- {"floating constant misused", 903},
- {"invalid UNSPEC as operand", 904},
- {"invalid expression as operand", 905},
- {"half-pic init called on systems that don't support it.", 906},
- {"Same as -mcpu=i386", 907},
- {"Same as -mcpu=i486", 908},
- {"Same as -mcpu=pentium", 909},
- {"Same as -mcpu=pentiumpro", 910},
- {"Align some doubles on dword boundary", 911},
- {"Align doubles on word boundary", 912},
- {"Uninitialized locals in .bss", 913},
- {"Uninitialized locals in .data", 914},
- {"Use IEEE math for fp comparisons", 915},
- {"Do not use IEEE math for fp comparisons", 916},
- {"Return values of functions in FPU registers", 917},
- {"Do not return values of functions in FPU registers", 918},
- {"Do not generate sin, cos, sqrt for FPU", 919},
- {"Generate sin, cos, sqrt for FPU", 920},
- {"Omit the frame pointer in leaf functions", 921},
- {"Enable stack probing", 922},
- {"Emit Intel syntax assembler opcodes", 923},
- {"Align destination of the string operations", 924},
- {"Do not align destination of the string operations", 925},
- {"Inline all known string operations", 926},
- {"Do not inline all known string operations", 927},
- {"Use push instructions to save outgoing arguments", 928},
- {"Do not use push instructions to save outgoing arguments", 929},
- {"Support MMX builtins", 930},
- {"Do not support MMX builtins", 931},
- {"Support MMX and SSE builtins", 932},
- {"Do not support MMX and SSE builtins", 933},
- {"Schedule code for given CPU", 934},
- {"Generate code for given CPU", 935},
- {"Control allocation order of integer registers", 936},
- {"Number of registers used to pass integer arguments", 937},
- {"Loop code aligned to this power of 2", 938},
- {"Jump targets are aligned to this power of 2", 939},
- {"Function starts are aligned to this power of 2", 940},
- {"Attempt to keep stack aligned to this power of 2", 941},
- {"Branches are this expensive (1-5, arbitrary units)", 942},
- {"Profiling uses mcount", 943},
- {"Emit half-PIC code", 944},
- {"Emit ELF object code", 945},
- {"Emit ROSE object code", 946},
- {"Symbols have a leading underscore", 947},
- {"Align to >word boundaries", 948},
- {"Use mcount for profiling", 949},
- {"Use mcount_ptr for profiling", 950},
- {"%s causes a section type conflict", 951},
- {"Generate COFF output", 952},
- {"Generate ELF output", 953},
- {"`%s' declared as both exported to and imported from a DLL.", 954},
- {"initialized variable `%s' is marked dllimport", 955},
- {"static variable `%s' is marked dllimport", 956},
- {"Environment variable DJGPP not defined.", 957},
- {"Environment variable DJGPP points to missing file '%s'.", 958},
- {"Environment variable DJGPP points to corrupt file '%s'.", 959},
- {"Generate code which uses the FPU", 960},
- {"Do not generate code which uses the FPU", 961},
- {"sorry, not implemented: #pragma align NAME=SIZE", 962},
- {"malformed #pragma align - ignored", 963},
- {"sorry, not implemented: #pragma noalign NAME", 964},
- {"stack limit expression is not supported", 965},
- {"Generate SA code", 966},
- {"Generate SB code", 967},
- {"Generate KA code", 968},
- {"Generate KB code", 969},
- {"Generate JA code", 970},
- {"Generate JD code", 971},
- {"Generate JF code", 972},
- {"generate RP code", 973},
- {"Generate MC code", 974},
- {"Generate CA code", 975},
- {"Generate CF code", 976},
- {"Use alternate leaf function entries", 977},
- {"Do not use alternate leaf function entries", 978},
- {"Perform tail call optimization", 979},
- {"Do not perform tail call optimization", 980},
- {"Use complex addressing modes", 981},
- {"Do not use complex addressing modes", 982},
- {"Align code to 8 byte boundary", 983},
- {"Do not align code to 8 byte boundary", 984},
- {"Enable compatibility with iC960 v2.0", 985},
- {"Enable compatibility with iC960 v3.0", 986},
- {"Enable compatibility with ic960 assembler", 987},
- {"Do not permit unaligned accesses", 988},
- {"Permit unaligned accesses", 989},
- {"Layout types like Intel's v1.3 gcc", 990},
- {"Do not layout types like Intel's v1.3 gcc", 991},
- {"Use 64 bit long doubles", 992},
- {"Enable linker relaxation", 993},
- {"Do not enable linker relaxation", 994},
- {"conflicting architectures defined - using C series", 995},
- {"conflicting architectures defined - using K series", 996},
- {"iC2.0 and iC3.0 are incompatible - using iC3.0", 997},
- {"The -mlong-double-64 option does not work yet.", 998},
- {"-msystem-v and -p are incompatible", 999},
- {"-msystem-v and -mthreads are incompatible", 1000},
- {"bad value (%s) for -mmodel switch", 1001},
- {"bad value (%s) for -msdata switch", 1002},
- {"const objects cannot go in .sdata/.sbss", 1003},
- {"invalid operand to %s code", 1004},
- {"invalid operand to %p code", 1005},
- {"invalid operand to %T/%B code", 1006},
- {"invalid operand to %N code", 1007},
- {"Display compile time statistics", 1008},
- {"Align all loops to 32 byte boundary", 1009},
- {"Only issue one instruction per cycle", 1010},
- {"Prefer branches over conditional execution", 1011},
- {"Code size: small, medium or large", 1012},
- {"Small data area: none, sdata, use", 1013},
- {"-malign-loops=%d is not between 1 and %d", 1014},
- {"-malign-jumps=%d is not between 1 and %d", 1015},
- {"-malign-functions=%d is not between 1 and %d", 1016},
- {"-fPIC is not currently supported on the 68000 or 68010\n", 1017},
- {"Internal gcc monitor: short-branch(%x)", 1018},
- {"Internal gcc error: Can't express symbolic location", 1019},
- {"argument #%d is a structure", 1020},
- {"%R not followed by %B/C/D/E", 1021},
- {"invalid %x/X value", 1022},
- {"invalid %H value", 1023},
- {"invalid %h value", 1024},
- {"invalid %Q value", 1025},
- {"invalid %q value", 1026},
- {"invalid %o value", 1027},
- {"invalid %p value", 1028},
- {"invalid %s/S value", 1029},
- {"invalid %P operand", 1030},
- {"invalid %B value", 1031},
- {"invalid %C value", 1032},
- {"invalid %D value", 1033},
- {"invalid %E value", 1034},
- {"`%d' operand isn't a register", 1035},
- {"invalid %r value", 1036},
- {"operand is r0", 1037},
- {"operand is const_double", 1038},
- {"invalid code", 1039},
- {"-mtrap-large-shift and -mhandle-large-shift are incompatible", 1040},
- {"Invalid option `-mshort-data-%s'", 1041},
- {"-mshort-data-%s is too large ", 1042},
- {"-mshort-data-%s and PIC are incompatible", 1043},
- {"-mips%d not supported", 1044},
- {"bad value (%s) for -mips switch", 1045},
- {"bad value (%s) for -mabi= switch", 1046},
- {"-mabi=%s does not support -mips%d", 1047},
- {"The -mabi=32 support does not work yet.", 1048},
- {"This target does not support the -mabi switch.", 1049},
- {"-mcpu=%s does not support -mips%d", 1050},
- {"-mips%d does not support 64 bit fp registers", 1051},
- {"-mips%d does not support 64 bit gp registers", 1052},
- {"-G is incompatible with PIC code which is the default", 1053},
- {"-membedded-pic and -mabicalls are incompatible", 1054},
- {"-G and -membedded-pic are incompatible", 1055},
- {"Invalid option `entry%s'", 1056},
- {"-mentry is only meaningful with -mips-16", 1057},
- {"internal error: %%) found without a %%( in assembler pattern", 1058},
- {"internal error: %%] found without a %%[ in assembler pattern", 1059},
- {"internal error: %%> found without a %%< in assembler pattern", 1060},
- {"internal error: %%} found without a %%{ in assembler pattern", 1061},
- {"PRINT_OPERAND: Unknown punctuation '%c'", 1062},
- {"PRINT_OPERAND null pointer", 1063},
- {"PRINT_OPERAND: letter %c was found & insn was not CONST_INT", 1064},
- {"PRINT_OPERAND_ADDRESS, null pointer", 1065},
+the Thumb.", 847},
+ {"interworking forces APCS-32 to be used", 848},
+ {"-mapcs-stack-check incompatible with -mno-apcs-frame", 849},
+ {"-fpic and -mapcs-reent are incompatible", 850},
+ {"APCS reentrant code not supported. Ignored", 851},
+ {"-g with -mno-apcs-frame may not give sensible debugging", 852},
+ {"Passing floating point arguments in fp regs not yet supported", 853},
+ {"Invalid floating point emulation option: -mfpe-%s", 854},
+ {"Structure size boundary can only be set to 8 or 32", 855},
+ {"-mpic-register= is useless without -fpic", 856},
+ {"Unable to use '%s' for PIC register", 857},
+ {"Unable to find a temporary location for static chain register", 858},
+ {"Unable to compute real location of stacked parameter", 859},
+ {"no low registers available for popping high registers", 860},
+ {"Interrupt Service Routines cannot be coded in Thumb mode.", 861},
+ {"Generate APCS conformant stack frames", 862},
+ {"Store function names in object code", 863},
+ {"Use the 32-bit version of the APCS", 864},
+ {"Use the 26-bit version of the APCS", 865},
+ {"Pass FP arguments in FP registers", 866},
+ {"Generate re-entrant, PIC code", 867},
+ {"The MMU will trap on unaligned accesses", 868},
+ {"Use library calls to perform FP operations", 869},
+ {"Use hardware floating point instructions", 870},
+ {"Assume target CPU is configured as big endian", 871},
+ {"Assume target CPU is configured as little endian", 872},
+ {"Assume big endian bytes, little endian words", 873},
+ {"Support calls between Thumb and ARM instruction sets", 874},
+ {"Generate a call to abort if a noreturn function returns", 875},
+ {"Do not move instructions into a function's prologue", 876},
+ {"Do not load the PIC register in function prologues", 877},
+ {"Generate call insns as indirect calls, if necessary", 878},
+ {"Compile for the Thumb not the ARM", 879},
+ {"Thumb: Generate (non-leaf) stack frames even if not needed", 880},
+ {"Thumb: Generate (leaf) stack frames even if not needed", 881},
+ {"Thumb: Assume non-static functions may be called from ARM code", 882},
+ {"Thumb: Assume function pointers may go to non-Thumb aware code", 883},
+ {"Specify the name of the target CPU", 884},
+ {"Specify the name of the target architecture", 885},
+ {"Specify the version of the floating point emulator", 886},
+ {"Specify the minimum bit alignment of structures", 887},
+ {"Specify the register to be used for PIC addressing", 888},
+ {"initialized variable `%s' is marked dllimport", 889},
+ {"static variable `%s' is marked dllimport", 890},
+ {"Ignore dllimport attribute for functions", 891},
+ {"Do symbol renaming for BSD", 892},
+ {"Do symbol renaming for X/OPEN", 893},
+ {"Don't do symbol renaming", 894},
+ {"MCU `%s' not supported", 895},
+ {"large frame pointer change (%d) with -mtiny-stack", 896},
+ {"Only initialized variables can be placed into program memory area.", 897},
+ {"Assume int to be 8 bit integer", 898},
+ {"Change the stack pointer without disabling interrupts", 899},
+ {"Use subroutines for function prologue/epilogue", 900},
+ {"Change only the low 8 bits of the stack pointer", 901},
+ {"Do not generate tablejump insns", 902},
+ {"Output instruction sizes to the asm file", 903},
+ {"Specify the initial stack address", 904},
+ {"Specify the MCU name", 905},
+ {"Trampolines not supported\n", 906},
+ {"Unknown CPU version %d, using 40.\n", 907},
+ {"ISR %s requires %d words of local vars, max is 32767.", 908},
+ {"junk at end of '#pragma %s'", 909},
+ {"Small memory model", 910},
+ {"Big memory model", 911},
+ {"Use MPYI instruction for C3x", 912},
+ {"Do not use MPYI instruction for C3x", 913},
+ {"Use fast but approximate float to integer conversion", 914},
+ {"Use slow but accurate float to integer conversion", 915},
+ {"Enable use of RTPS instruction", 916},
+ {"Disable use of RTPS instruction", 917},
+ {"Enable use of RTPB instruction", 918},
+ {"Disable use of RTPB instruction", 919},
+ {"Generate code for C30 CPU", 920},
+ {"Generate code for C31 CPU", 921},
+ {"Generate code for C32 CPU", 922},
+ {"Generate code for C33 CPU", 923},
+ {"Generate code for C40 CPU", 924},
+ {"Generate code for C44 CPU", 925},
+ {"Emit code compatible with TI tools", 926},
+ {"Emit code to use GAS extensions", 927},
+ {"Save DP across ISR in small memory model", 928},
+ {"Don't save DP across ISR in small memory model", 929},
+ {"Pass arguments on the stack", 930},
+ {"Pass arguments in registers", 931},
+ {"Enable new features under development", 932},
+ {"Disable new features under development", 933},
+ {"Use the BK register as a general purpose register", 934},
+ {"Do not allocate BK register", 935},
+ {"Enable use of DB instruction", 936},
+ {"Disable use of DB instruction", 937},
+ {"Enable debugging", 938},
+ {"Disable debugging", 939},
+ {"Force constants into registers to improve hoisting", 940},
+ {"Don't force constants into registers", 941},
+ {"Force RTL generation to emit valid 3 operand insns", 942},
+ {"Allow RTL generation to emit invalid 3 operand insns", 943},
+ {"Allow unsigned interation counts for RPTB/DB", 944},
+ {"Disallow unsigned iteration counts for RPTB/DB", 945},
+ {"Preserve all 40 bits of FP reg across call", 946},
+ {"Only preserve 32 bits of FP reg across call", 947},
+ {"Enable parallel instructions", 948},
+ {"Disable parallel instructions", 949},
+ {"Enable MPY||ADD and MPY||SUB instructions", 950},
+ {"Disable MPY||ADD and MPY||SUB instructions", 951},
+ {"Assume that pointers may be aliased", 952},
+ {"Assume that pointers not aliased", 953},
+ {"Specify maximum number of iterations for RPTS", 954},
+ {"Select CPU to generate code for", 955},
+ {"Generate code for the C400", 956},
+ {"Generate code for the C300", 957},
+ {"Generate code for c1", 958},
+ {"Generate code for c2", 959},
+ {"Generate code for c32", 960},
+ {"Generate code for c34", 961},
+ {"Use standard calling sequence, with arg count word", 962},
+ {"Place arg count in a nop instruction (faster than push)", 963},
+ {"Don't push arg count, depend on symbol table", 964},
+ {"Use data cache for volatile mem refs (default)", 965},
+ {"Don't use data cache for volatile mem refs", 966},
+ {"Bypass data cache for volatile mem refs", 967},
+ {"Use 64-bit longs", 968},
+ {"Use cc- and libc-compatible 32-bit longs", 969},
+ {"Bad modes_tieable_p for register %s, mode1 %s, mode2 %s", 970},
+ {"Enable use of conditional move instructions", 971},
+ {"Disable use of conditional move instructions", 972},
+ {"Debug argument support in compiler", 973},
+ {"Debug stack support in compiler", 974},
+ {"Debug memory address support in compiler", 975},
+ {"Make adjacent short instructions parallel if possible.", 976},
+ {"Do not make adjacent short instructions parallel.", 977},
+ {"Link programs/data to be in external memory by default", 978},
+ {"Link programs/data to be in onchip memory by default", 979},
+ {"Change the branch costs within the compiler", 980},
+ {"Change the threshold for conversion to conditional execution", 981},
+ {"Stack size > 32k", 982},
+ {"inline float constants not supported on this host", 983},
+ {"Profiling not implemented yet.", 984},
+ {"Trampolines not yet implemented", 985},
+ {"Generate code the unix assembler can handle", 986},
+ {"Generate code an embedded assembler can handle", 987},
+ {"fr30_print_operand_address: unhandled address", 988},
+ {"fr30_print_operand: unrecognised %p code", 989},
+ {"fr30_print_operand: unrecognised %b code", 990},
+ {"fr30_print_operand: unrecognised %B code", 991},
+ {"fr30_print_operand: invalid operand to %A code", 992},
+ {"fr30_print_operand: invalid %x code", 993},
+ {"fr30_print_operand: invalid %F code", 994},
+ {"fr30_print_operand: unknown code", 995},
+ {"fr30_print_operand: unhandled MEM", 996},
+ {"Assume small address space", 997},
+ {"-ms2600 is used without -ms.", 998},
+ {"Only initialized variables can be placed into the 8-bit area.", 999},
+ {"Generate H8/S code", 1000},
+ {"Do not generate H8/S code", 1001},
+ {"Generate H8/S2600 code", 1002},
+ {"Do not generate H8/S2600 code", 1003},
+ {"Make integers 32 bits wide", 1004},
+ {"Use registers for argument passing", 1005},
+ {"Do not use registers for argument passing", 1006},
+ {"Consider access to byte sized memory slow", 1007},
+ {"Enable linker relaxing", 1008},
+ {"Generate H8/300H code", 1009},
+ {"Do not generate H8/300H code", 1010},
+ {"Use H8/300 alignment rules", 1011},
+ {"real name is too long - alias ignored", 1012},
+ {"alias name is too long - alias ignored", 1013},
+ {"junk at end of #pragma map", 1014},
+ {"malformed #pragma map, ignored", 1015},
+ {"Generate char instructions", 1016},
+ {"Do not generate char instructions", 1017},
+ {"Use the Cygwin interface", 1018},
+ {"Use the Mingw32 interface", 1019},
+ {"Create GUI application", 1020},
+ {"Don't set Windows defines", 1021},
+ {"Set Windows defines", 1022},
+ {"Create console application", 1023},
+ {"Generate code for a DLL", 1024},
+ {"Ignore dllimport for functions", 1025},
+ {"Use Mingw-specific thread support", 1026},
+ {"-f%s ignored for target (all code is position independent)", 1027},
+ {"Internal gcc abort from %s:%d", 1028},
+ {"The local variable `insn' has the value:", 1029},
+ {"Retain standard MXDB information", 1030},
+ {"Retain legend information", 1031},
+ {"Generate external legend information", 1032},
+ {"Emit identifying info in .s file", 1033},
+ {"Warn when a function arg is a structure", 1034},
+ {"argument is a structure", 1035},
+ {"-mbnu210 is ignored (option is obsolete).", 1036},
+ {"bad value (%s) for -march= switch", 1037},
+ {"bad value (%s) for -mcpu= switch", 1038},
+ {"Register '%c' is unknown", 1039},
+ {"Register '%c' already specified in allocation order", 1040},
+ {"-mregparm=%d is not between 0 and %d", 1041},
+ {"-malign-loops=%d is not between 0 and %d", 1042},
+ {"-malign-jumps=%d is not between 0 and %d", 1043},
+ {"-malign-functions=%d is not between 0 and %d", 1044},
+ {"-mpreferred-stack-boundary=%d is not between 2 and 31", 1045},
+ {"-mbranch-cost=%d is not between 0 and 5", 1046},
+ {"floating constant misused", 1047},
+ {"invalid UNSPEC as operand", 1048},
+ {"invalid expression as operand", 1049},
+ {"selector must be an immediate", 1050},
+ {"mask must be an immediate", 1051},
+ {"half-pic init called on systems that don't support it.", 1052},
+ {"Same as -mcpu=i386", 1053},
+ {"Same as -mcpu=i486", 1054},
+ {"Same as -mcpu=pentium", 1055},
+ {"Same as -mcpu=pentiumpro", 1056},
+ {"Alternate calling convention", 1057},
+ {"Use normal calling convention", 1058},
+ {"Align some doubles on dword boundary", 1059},
+ {"Align doubles on word boundary", 1060},
+ {"Uninitialized locals in .bss", 1061},
+ {"Uninitialized locals in .data", 1062},
+ {"Use IEEE math for fp comparisons", 1063},
+ {"Do not use IEEE math for fp comparisons", 1064},
+ {"Return values of functions in FPU registers", 1065},
+ {"Do not return values of functions in FPU registers", 1066},
+ {"Do not generate sin, cos, sqrt for FPU", 1067},
+ {"Generate sin, cos, sqrt for FPU", 1068},
+ {"Omit the frame pointer in leaf functions", 1069},
+ {"Enable stack probing", 1070},
+ {"Emit Intel syntax assembler opcodes", 1071},
+ {"Align destination of the string operations", 1072},
+ {"Do not align destination of the string operations", 1073},
+ {"Inline all known string operations", 1074},
+ {"Do not inline all known string operations", 1075},
+ {"Use push instructions to save outgoing arguments", 1076},
+ {"Do not use push instructions to save outgoing arguments", 1077},
+ {"sizeof(long double) is 16.", 1078},
+ {"sizeof(long double) is 12.", 1079},
+ {"Schedule code for given CPU", 1080},
+ {"Generate code for given CPU", 1081},
+ {"Control allocation order of integer registers", 1082},
+ {"Number of registers used to pass integer arguments", 1083},
+ {"Loop code aligned to this power of 2", 1084},
+ {"Jump targets are aligned to this power of 2", 1085},
+ {"Function starts are aligned to this power of 2", 1086},
+ {"Attempt to keep stack aligned to this power of 2", 1087},
+ {"Branches are this expensive (1-5, arbitrary units)", 1088},
+ {"Profiling uses mcount", 1089},
+ {"Emit half-PIC code", 1090},
+ {"Emit ELF object code", 1091},
+ {"Emit ROSE object code", 1092},
+ {"Symbols have a leading underscore", 1093},
+ {"Align to >word boundaries", 1094},
+ {"Use mcount for profiling", 1095},
+ {"Use mcount_ptr for profiling", 1096},
+ {"Generate ELF output", 1097},
+ {"Use Mingw32 interface", 1098},
+ {"Use Cygwin interface", 1099},
+ {"Use bare Windows interface", 1100},
+ {"`%s' declared as both exported to and imported from a DLL.", 1101},
+ {"Environment variable DJGPP not defined.", 1102},
+ {"Environment variable DJGPP points to missing file '%s'.", 1103},
+ {"Environment variable DJGPP points to corrupt file '%s'.", 1104},
+ {"Generate code which uses the FPU", 1105},
+ {"Do not generate code which uses the FPU", 1106},
+ {"sorry, not implemented: #pragma align NAME=SIZE", 1107},
+ {"malformed #pragma align - ignored", 1108},
+ {"sorry, not implemented: #pragma noalign NAME", 1109},
+ {"stack limit expression is not supported", 1110},
+ {"Generate SA code", 1111},
+ {"Generate SB code", 1112},
+ {"Generate KA code", 1113},
+ {"Generate KB code", 1114},
+ {"Generate JA code", 1115},
+ {"Generate JD code", 1116},
+ {"Generate JF code", 1117},
+ {"generate RP code", 1118},
+ {"Generate MC code", 1119},
+ {"Generate CA code", 1120},
+ {"Generate CF code", 1121},
+ {"Use alternate leaf function entries", 1122},
+ {"Do not use alternate leaf function entries", 1123},
+ {"Perform tail call optimization", 1124},
+ {"Do not perform tail call optimization", 1125},
+ {"Use complex addressing modes", 1126},
+ {"Do not use complex addressing modes", 1127},
+ {"Align code to 8 byte boundary", 1128},
+ {"Do not align code to 8 byte boundary", 1129},
+ {"Enable compatibility with iC960 v2.0", 1130},
+ {"Enable compatibility with iC960 v3.0", 1131},
+ {"Enable compatibility with ic960 assembler", 1132},
+ {"Do not permit unaligned accesses", 1133},
+ {"Permit unaligned accesses", 1134},
+ {"Layout types like Intel's v1.3 gcc", 1135},
+ {"Do not layout types like Intel's v1.3 gcc", 1136},
+ {"Use 64 bit long doubles", 1137},
+ {"Enable linker relaxation", 1138},
+ {"Do not enable linker relaxation", 1139},
+ {"conflicting architectures defined - using C series", 1140},
+ {"conflicting architectures defined - using K series", 1141},
+ {"iC2.0 and iC3.0 are incompatible - using iC3.0", 1142},
+ {"The -mlong-double-64 option does not work yet.", 1143},
+ {"ia64_print_operand: unknown code", 1144},
+ {"value of -mfixed-range must have form REG1-REG2", 1145},
+ {"unknown register name: %s", 1146},
+ {"%s-%s is an empty range", 1147},
+ {"cannot optimize division for both latency and throughput", 1148},
+ {"Generate big endian code", 1149},
+ {"Generate little endian code", 1150},
+ {"Generate code for GNU as", 1151},
+ {"Generate code for Intel as", 1152},
+ {"Generate code for GNU ld", 1153},
+ {"Generate code for Intel ld", 1154},
+ {"Generate code without GP reg", 1155},
+ {"Emit stop bits before and after volatile extended asms", 1156},
+ {"Don't emit stop bits before and after volatile extended asms", 1157},
+ {"Emit code for Itanium (TM) processor B step", 1158},
+ {"Use in/loc/out register names", 1159},
+ {"Disable use of sdata/scommon/sbss", 1160},
+ {"Enable use of sdata/scommon/sbss", 1161},
+ {"gp is constant (but save/restore gp on indirect calls)", 1162},
+ {"Generate self-relocatable code", 1163},
+ {"Generate inline division, optimize for latency", 1164},
+ {"Generate inline division, optimize for throughput", 1165},
+ {"Enable Dwarf 2 line debug info via GNU as", 1166},
+ {"Disable Dwarf 2 line debug info via GNU as", 1167},
+ {"Specify range of registers to make fixed.", 1168},
+ {"-msystem-v and -p are incompatible", 1169},
+ {"-msystem-v and -mthreads are incompatible", 1170},
+ {"bad value (%s) for -mmodel switch", 1171},
+ {"bad value (%s) for -msdata switch", 1172},
+ {"const objects cannot go in .sdata/.sbss", 1173},
+ {"invalid operand to %s code", 1174},
+ {"invalid operand to %p code", 1175},
+ {"invalid operand to %T/%B code", 1176},
+ {"invalid operand to %N code", 1177},
+ {"Display compile time statistics", 1178},
+ {"Align all loops to 32 byte boundary", 1179},
+ {"Only issue one instruction per cycle", 1180},
+ {"Prefer branches over conditional execution", 1181},
+ {"Code size: small, medium or large", 1182},
+ {"Small data area: none, sdata, use", 1183},
+ {"-f%s ignored for 68HC11/68HC12 (not supported)", 1184},
+ {"Compile with 16-bit integer mode", 1185},
+ {"Compile with 32-bit integer mode", 1186},
+ {"Auto pre/post decrement increment allowed", 1187},
+ {"Auto pre/post decrement increment not allowed", 1188},
+ {"Compile for a 68HC11", 1189},
+ {"Compile for a 68HC12", 1190},
+ {"Specify the register allocation order", 1191},
+ {"Indicate the number of soft registers available", 1192},
+ {"-malign-loops=%d is not between 1 and %d", 1193},
+ {"-malign-jumps=%d is not between 1 and %d", 1194},
+ {"-malign-functions=%d is not between 1 and %d", 1195},
+ {"-fPIC is not currently supported on the 68000 or 68010\n", 1196},
+ {"Internal gcc monitor: short-branch(%x)", 1197},
+ {"Internal gcc error: Can't express symbolic location", 1198},
+ {"argument #%d is a structure", 1199},
+ {"%R not followed by %B/C/D/E", 1200},
+ {"invalid %x/X value", 1201},
+ {"invalid %H value", 1202},
+ {"invalid %h value", 1203},
+ {"invalid %Q value", 1204},
+ {"invalid %q value", 1205},
+ {"invalid %o value", 1206},
+ {"invalid %p value", 1207},
+ {"invalid %s/S value", 1208},
+ {"invalid %P operand", 1209},
+ {"invalid %B value", 1210},
+ {"invalid %C value", 1211},
+ {"invalid %D value", 1212},
+ {"invalid %E value", 1213},
+ {"`%d' operand isn't a register", 1214},
+ {"invalid %r value", 1215},
+ {"operand is r0", 1216},
+ {"operand is const_double", 1217},
+ {"invalid code", 1218},
+ {"-mtrap-large-shift and -mhandle-large-shift are incompatible", 1219},
+ {"Invalid option `-mshort-data-%s'", 1220},
+ {"-mshort-data-%s is too large ", 1221},
+ {"-mshort-data-%s and PIC are incompatible", 1222},
+ {"Invalid option `-mstack-increment=%s'", 1223},
+ {"Inline constants if it can be done in 2 insns or less", 1224},
+ {"inline constants if it only takes 1 instruction", 1225},
+ {"Set maximum alignment to 4", 1226},
+ {"Set maximum alignment to 8", 1227},
+ {"Do not use the divide instruction", 1228},
+ {"Do not arbitary sized immediates in bit operations", 1229},
+ {"Always treat bitfield as int-sized", 1230},
+ {"Force functions to be aligned to a 4 byte boundary", 1231},
+ {"Force functions to be aligned to a 2 byte boundary", 1232},
+ {"Emit call graph information", 1233},
+ {"Prefer word accesses over byte accesses", 1234},
+ {"Generate code for the M*Core M340", 1235},
+ {"Maximum amount for a single stack increment operation", 1236},
+ {"-mips%d not supported", 1237},
+ {"bad value (%s) for -mips switch", 1238},
+ {"bad value (%s) for -mabi= switch", 1239},
+ {"-mabi=%s does not support -mips%d", 1240},
+ {"The -mabi=32 support does not work yet.", 1241},
+ {"This target does not support the -mabi switch.", 1242},
+ {"-mcpu=%s does not support -mips%d", 1243},
+ {"-mips%d does not support 64 bit fp registers", 1244},
+ {"-mips%d does not support 64 bit gp registers", 1245},
+ {"-G is incompatible with PIC code which is the default", 1246},
+ {"-membedded-pic and -mabicalls are incompatible", 1247},
+ {"-G and -membedded-pic are incompatible", 1248},
+ {"Invalid option `entry%s'", 1249},
+ {"-mentry is only meaningful with -mips-16", 1250},
+ {"internal error: %%) found without a %%( in assembler pattern", 1251},
+ {"internal error: %%] found without a %%[ in assembler pattern", 1252},
+ {"internal error: %%> found without a %%< in assembler pattern", 1253},
+ {"internal error: %%} found without a %%{ in assembler pattern", 1254},
+ {"PRINT_OPERAND: Unknown punctuation '%c'", 1255},
+ {"PRINT_OPERAND null pointer", 1256},
+ {"invalid use of %%d, %%x, or %%X", 1257},
+ {"PRINT_OPERAND_ADDRESS, null pointer", 1258},
+ {"can't open %s", 1259},
{"\
MIPS ECOFF format does not allow changing filenames within functions with \
-#line", 1066},
- {"gp_offset (%ld) or end_offset (%ld) is less than zero.", 1067},
- {"fp_offset (%ld) or end_offset (%ld) is less than zero.", 1068},
- {"can not handle inconsistent calls to `%s'", 1069},
- {"No default crt0.o", 1070},
- {"Use 64-bit int type", 1071},
- {"Use 64-bit long type", 1072},
- {"Use 32-bit long type", 1073},
- {"Optimize lui/addiu address loads", 1074},
- {"Don't optimize lui/addiu address loads", 1075},
- {"Use MIPS as", 1076},
- {"Use GNU as", 1077},
- {"Use symbolic register names", 1078},
- {"Don't use symbolic register names", 1079},
- {"Use GP relative sdata/sbss sections", 1080},
- {"Don't use GP relative sdata/sbss sections", 1081},
- {"Output compiler statistics", 1082},
- {"Don't output compiler statistics", 1083},
- {"Don't optimize block moves", 1084},
- {"Optimize block moves", 1085},
- {"Use mips-tfile asm postpass", 1086},
- {"Don't use mips-tfile asm postpass", 1087},
- {"Use hardware floating point", 1088},
- {"Use 64-bit FP registers", 1089},
- {"Use 32-bit FP registers", 1090},
- {"Use 64-bit general registers", 1091},
- {"Use 32-bit general registers", 1092},
- {"Use Irix PIC", 1093},
- {"Don't use Irix PIC", 1094},
- {"Use OSF PIC", 1095},
- {"Don't use OSF PIC", 1096},
- {"Use indirect calls", 1097},
- {"Don't use indirect calls", 1098},
- {"Use embedded PIC", 1099},
- {"Don't use embedded PIC", 1100},
- {"Use ROM instead of RAM", 1101},
- {"Don't use ROM instead of RAM", 1102},
- {"Put uninitialized constants in ROM (needs -membedded-data)", 1103},
- {"Don't put uninitialized constants in ROM", 1104},
- {"Use big-endian byte order", 1105},
- {"Use little-endian byte order", 1106},
- {"Use single (32-bit) FP only", 1107},
- {"Don't use single (32-bit) FP only", 1108},
- {"Use multiply accumulate", 1109},
- {"Don't use multiply accumulate", 1110},
- {"Work around early 4300 hardware bug", 1111},
- {"Don't work around early 4300 hardware bug", 1112},
- {"Optimize for 4650", 1113},
- {"Optimize for 3900", 1114},
- {"Trap on integer divide by zero", 1115},
- {"Don't trap on integer divide by zero", 1116},
- {"Trap on integer divide overflow", 1117},
- {"Don't trap on integer divide overflow", 1118},
- {"Specify CPU for scheduling purposes", 1119},
- {"Specify MIPS ISA", 1120},
- {"Use mips16 entry/exit psuedo ops", 1121},
- {"Don't use MIPS16 instructions", 1122},
- {"mips16 function profiling", 1123},
- {"Work around hardware multiply bug", 1124},
- {"Do not work around hardware multiply bug", 1125},
- {"Target the AM33 processor", 1126},
- {"optimization turned on", 1127},
- {"optimization turned off", 1128},
- {"optimization level restored", 1129},
- {"Don't use hardware fp", 1130},
- {"Alternative calling convention", 1131},
- {"Pass some arguments in registers", 1132},
- {"Pass all arguments on stack", 1133},
- {"Optimize for 32532 cpu", 1134},
- {"Optimize for 32332 cpu", 1135},
- {"Optimize for 32032", 1136},
- {"Register sb is zero. Use for absolute addressing", 1137},
- {"Do not use register sb", 1138},
- {"Generate code for high memory", 1139},
- {"Generate code for low memory", 1140},
- {"32381 fpu", 1141},
- {"Use multiply-accumulate fp instructions", 1142},
- {"Do not use multiply-accumulate fp instructions", 1143},
- {"\"Small register classes\" kludge", 1144},
- {"No \"Small register classes\" kludge", 1145},
+#line", 1260},
+ {"can't rewind %s", 1261},
+ {"can't write to %s", 1262},
+ {"can't read from %s", 1263},
+ {"can't close %s", 1264},
+ {"gp_offset (%ld) or end_offset (%ld) is less than zero.", 1265},
+ {"fp_offset (%ld) or end_offset (%ld) is less than zero.", 1266},
+ {"can not handle inconsistent calls to `%s'", 1267},
+ {"No default crt0.o", 1268},
+ {"Use 64-bit int type", 1269},
+ {"Use 64-bit long type", 1270},
+ {"Use 32-bit long type", 1271},
+ {"Optimize lui/addiu address loads", 1272},
+ {"Don't optimize lui/addiu address loads", 1273},
+ {"Use MIPS as", 1274},
+ {"Use GNU as", 1275},
+ {"Use symbolic register names", 1276},
+ {"Don't use symbolic register names", 1277},
+ {"Use GP relative sdata/sbss sections", 1278},
+ {"Don't use GP relative sdata/sbss sections", 1279},
+ {"Output compiler statistics", 1280},
+ {"Don't output compiler statistics", 1281},
+ {"Don't optimize block moves", 1282},
+ {"Optimize block moves", 1283},
+ {"Use mips-tfile asm postpass", 1284},
+ {"Don't use mips-tfile asm postpass", 1285},
+ {"Use hardware floating point", 1286},
+ {"Use 64-bit FP registers", 1287},
+ {"Use 32-bit FP registers", 1288},
+ {"Use 64-bit general registers", 1289},
+ {"Use 32-bit general registers", 1290},
+ {"Use Irix PIC", 1291},
+ {"Don't use Irix PIC", 1292},
+ {"Use OSF PIC", 1293},
+ {"Don't use OSF PIC", 1294},
+ {"Use indirect calls", 1295},
+ {"Don't use indirect calls", 1296},
+ {"Use embedded PIC", 1297},
+ {"Don't use embedded PIC", 1298},
+ {"Use ROM instead of RAM", 1299},
+ {"Don't use ROM instead of RAM", 1300},
+ {"Put uninitialized constants in ROM (needs -membedded-data)", 1301},
+ {"Don't put uninitialized constants in ROM", 1302},
+ {"Use big-endian byte order", 1303},
+ {"Use little-endian byte order", 1304},
+ {"Use single (32-bit) FP only", 1305},
+ {"Don't use single (32-bit) FP only", 1306},
+ {"Use multiply accumulate", 1307},
+ {"Don't use multiply accumulate", 1308},
+ {"Work around early 4300 hardware bug", 1309},
+ {"Don't work around early 4300 hardware bug", 1310},
+ {"Optimize for 4650", 1311},
+ {"Optimize for 3900", 1312},
+ {"Trap on integer divide by zero", 1313},
+ {"Don't trap on integer divide by zero", 1314},
+ {"Trap on integer divide overflow", 1315},
+ {"Don't trap on integer divide overflow", 1316},
+ {"Specify CPU for scheduling purposes", 1317},
+ {"Specify MIPS ISA", 1318},
+ {"Use mips16 entry/exit psuedo ops", 1319},
+ {"Don't use MIPS16 instructions", 1320},
+ {"mips16 function profiling", 1321},
+ {"Work around hardware multiply bug", 1322},
+ {"Do not work around hardware multiply bug", 1323},
+ {"Target the AM33 processor", 1324},
+ {"optimization turned on", 1325},
+ {"optimization turned off", 1326},
+ {"optimization level restored", 1327},
+ {"Don't use hardware fp", 1328},
+ {"Alternative calling convention", 1329},
+ {"Pass some arguments in registers", 1330},
+ {"Pass all arguments on stack", 1331},
+ {"Optimize for 32532 cpu", 1332},
+ {"Optimize for 32332 cpu", 1333},
+ {"Optimize for 32032", 1334},
+ {"Register sb is zero. Use for absolute addressing", 1335},
+ {"Do not use register sb", 1336},
+ {"Do not use bitfield instructions", 1337},
+ {"Use bitfield instructions", 1338},
+ {"Generate code for high memory", 1339},
+ {"Generate code for low memory", 1340},
+ {"32381 fpu", 1341},
+ {"Use multiply-accumulate fp instructions", 1342},
+ {"Do not use multiply-accumulate fp instructions", 1343},
+ {"\"Small register classes\" kludge", 1344},
+ {"No \"Small register classes\" kludge", 1345},
{"\
Unknown -mschedule= option (%s).\n\
-Valid options are 700, 7100, 7100LC, 7200, and 8000\n", 1146},
+Valid options are 700, 7100, 7100LC, 7200, and 8000\n", 1346},
{"\
Unknown -march= option (%s).\n\
-Valid options are 1.0, 1.1, and 2.0\n", 1147},
- {"PIC code generation is not supported in the portable runtime model\n", 1148},
- {"PIC code generation is not compatible with fast indirect calls\n", 1149},
- {"PIC code generation is not compatible with profiling\n", 1150},
- {"-g is only supported when using GAS on this processor,", 1151},
- {"-g option disabled.", 1152},
- {"Do not use hardware floating point", 1153},
- {"Return floating point results in ac0", 1154},
- {"Return floating point results in memory", 1155},
- {"Generate code for an 11/40", 1156},
- {"Generate code for an 11/45", 1157},
- {"Generate code for an 11/10", 1158},
- {"Use 32 bit int", 1159},
- {"Use 16 bit int", 1160},
- {"Use 32 bit float", 1161},
- {"Use 64 bit float", 1162},
- {"Target has split I&D", 1163},
- {"Target does not have split I&D", 1164},
- {"Use UNIX assembler syntax", 1165},
- {"Use DEC assembler syntax", 1166},
- {"invalid %%B value", 1167},
- {"invalid %%S value", 1168},
- {"invalid %%b value", 1169},
- {"invalid %%H value", 1170},
- {"invalid %%z value", 1171},
- {"invalid %%Z value", 1172},
- {"invalid %%k value", 1173},
- {"invalid %%j value", 1174},
- {"can't have varargs with -mfp-arg-in-fp-regs", 1175},
- {"Always pass floating-point arguments in memory", 1176},
- {"Don't always pass floating-point arguments in memory", 1177},
- {"Support message passing with the Parallel Environment", 1178},
- {"Compile for 64-bit pointers", 1179},
- {"Compile for 32-bit pointers", 1180},
- {"-maix64 and POWER architecture are incompatible.", 1181},
- {"-maix64 requires PowerPC64 architecture remain enabled.", 1182},
+Valid options are 1.0, 1.1, and 2.0\n", 1347},
+ {"PIC code generation is not supported in the portable runtime model\n", 1348},
+ {"PIC code generation is not compatible with fast indirect calls\n", 1349},
+ {"PIC code generation is not compatible with profiling\n", 1350},
+ {"-g is only supported when using GAS on this processor,", 1351},
+ {"-g option disabled.", 1352},
+ {"Do not use hardware floating point", 1353},
+ {"Return floating point results in ac0", 1354},
+ {"Return floating point results in memory", 1355},
+ {"Generate code for an 11/40", 1356},
+ {"Generate code for an 11/45", 1357},
+ {"Generate code for an 11/10", 1358},
+ {"Use 32 bit int", 1359},
+ {"Use 16 bit int", 1360},
+ {"Use 32 bit float", 1361},
+ {"Use 64 bit float", 1362},
+ {"Target has split I&D", 1363},
+ {"Target does not have split I&D", 1364},
+ {"Use UNIX assembler syntax", 1365},
+ {"Use DEC assembler syntax", 1366},
+ {"Generate little endian data", 1367},
+ {"Generate big endian data", 1368},
+ {"Turn on maintainer testing code", 1369},
+ {"Enable Transmeta picoJava extensions", 1370},
+ {"Disable Transmeta picoJava extensions", 1371},
+ {"Disable reorganization pass", 1372},
+ {"invalid %%B value", 1373},
+ {"invalid %%S value", 1374},
+ {"invalid %%b value", 1375},
+ {"invalid %%H value", 1376},
+ {"invalid %%z value", 1377},
+ {"invalid %%Z value", 1378},
+ {"invalid %%k value", 1379},
+ {"invalid %%j value", 1380},
+ {"can't have varargs with -mfp-arg-in-fp-regs", 1381},
+ {"Always pass floating-point arguments in memory", 1382},
+ {"Don't always pass floating-point arguments in memory", 1383},
+ {"Support message passing with the Parallel Environment", 1384},
+ {"Compile for 64-bit pointers", 1385},
+ {"Compile for 32-bit pointers", 1386},
+ {"-maix64 and POWER architecture are incompatible.", 1387},
+ {"-maix64 requires PowerPC64 architecture remain enabled.", 1388},
{"\
-maix64 required: 64-bit computation with 32-bit addressing not yet \
-supported.", 1183},
- {"-mmultiple is not supported on little endian systems", 1184},
- {"-mstring is not supported on little endian systems", 1185},
- {"-f%s ignored for AIX (all code is position independent)", 1186},
- {"-ffunction-sections disabled on AIX when debugging", 1187},
- {"-fdata-sections not supported on AIX", 1188},
- {"Unknown -mdebug-%s switch", 1189},
- {"invalid %%f value", 1190},
- {"invalid %%F value", 1191},
- {"invalid %%G value", 1192},
- {"invalid %%j code", 1193},
- {"invalid %%J code", 1194},
- {"invalid %%K value", 1195},
- {"invalid %%p value", 1196},
- {"invalid %%q value", 1197},
- {"%%S computed all 1's mask", 1198},
- {"%%S computed all 0's mask", 1199},
- {"invalid %%T value", 1200},
- {"invalid %%u value", 1201},
- {"invalid %%v value", 1202},
- {"invalid %%W value", 1203},
- {"Use POWER instruction set", 1204},
- {"Use POWER2 instruction set", 1205},
- {"Do not use POWER2 instruction set", 1206},
- {"Do not use POWER instruction set", 1207},
- {"Use PowerPC instruction set", 1208},
- {"Do not use PowerPC instruction set", 1209},
- {"Use PowerPC General Purpose group optional instructions", 1210},
- {"Don't use PowerPC General Purpose group optional instructions", 1211},
- {"Use PowerPC Graphics group optional instructions", 1212},
- {"Don't use PowerPC Graphics group optional instructions", 1213},
- {"Use PowerPC-64 instruction set", 1214},
- {"Don't use PowerPC-64 instruction set", 1215},
- {"Use new mnemonics for PowerPC architecture", 1216},
- {"Use old mnemonics for PowerPC architecture", 1217},
- {"Put everything in the regular TOC", 1218},
- {"Place floating point constants in TOC", 1219},
- {"Don't place floating point constants in TOC", 1220},
- {"Place symbol+offset constants in TOC", 1221},
- {"Don't place symbol+offset constants in TOC", 1222},
- {"Place variable addresses in the regular TOC", 1223},
- {"Generate load/store multiple instructions", 1224},
- {"Do not generate load/store multiple instructions", 1225},
- {"Generate string instructions for block moves", 1226},
- {"Do not generate string instructions for block moves", 1227},
- {"Generate load/store with update instructions", 1228},
- {"Do not generate load/store with update instructions", 1229},
- {"Generate fused multiply/add instructions", 1230},
- {"Don't generate fused multiply/add instructions", 1231},
- {"Don't schedule the start and end of the procedure", 1232},
- {"Use features of and schedule code for given CPU", 1233},
- {"Enable debug output", 1234},
- {"RETURN_ADDRESS_OFFSET not supported", 1235},
- {"Select ABI calling convention.", 1236},
- {"Select method for sdata handling.", 1237},
- {"Align to the base type of the bitfield.", 1238},
- {"Don't align to the base type of the bitfield.", 1239},
- {"Don't assume that unaligned accesses are handled by the system", 1240},
- {"Assume that unaligned accesses are handled by the system", 1241},
- {"Produce code relocatable at runtime.", 1242},
- {"Don't produce code relocatable at runtime.", 1243},
- {"Produce little endian code.", 1244},
- {"Produce big endian code.", 1245},
- {"Use 128 bit long doubles", 1246},
- {"no description yet", 1247},
- {"Use EABI.", 1248},
- {"Don't use EABI.", 1249},
- {"Use alternate register names.", 1250},
- {"Don't use alternate register names.", 1251},
- {"Link with libsim.a, libc.a and sim-crt0.o.", 1252},
- {"Link with libads.a, libc.a and crt0.o.", 1253},
- {"Link with libyk.a, libc.a and crt0.o.", 1254},
- {"Link with libmvme.a, libc.a and crt0.o.", 1255},
- {"Set the PPC_EMB bit in the ELF flags header", 1256},
- {"Bad value for -mcall-%s", 1257},
- {"Bad value for -msdata=%s", 1258},
- {"-mrelocatable and -msdata=%s are incompatible.", 1259},
- {"-f%s and -msdata=%s are incompatible.", 1260},
- {"-msdata=%s and -mcall-%s are incompatible.", 1261},
- {"-mrelocatable and -mno-minimal-toc are incompatible.", 1262},
- {"-mrelocatable and -mcall-%s are incompatible.", 1263},
- {"-fPIC and -mcall-%s are incompatible.", 1264},
- {"-mcall-aixdesc must be big endian", 1265},
- {"Generate code for big endian", 1266},
- {"Generate code for little endian", 1267},
- {"%s is not supported by this configuration", 1268},
- {"-mptr%d not allowed on -m%d", 1269},
- {"-mlong-double-64 not allowed with -m64", 1270},
- {"bad value (%s) for -mcmodel= switch", 1271},
- {"-mcmodel= is not supported on 32 bit systems", 1272},
- {"profiling does not support code models other than medlow", 1273},
- {"Invalid %%Y operand", 1274},
- {"Invalid %%A operand", 1275},
- {"Invalid %%B operand", 1276},
- {"Invalid %%c operand", 1277},
- {"Invalid %%C operand", 1278},
- {"Invalid %%d operand", 1279},
- {"Invalid %%D operand", 1280},
- {"Invalid %%f operand", 1281},
- {"long long constant not a valid immediate operand", 1282},
- {"floating point constant not a valid immediate operand", 1283},
- {"%s and profiling conflict: disabling %s", 1284},
- {"Use FUNCTION_EPILOGUE", 1285},
- {"Do not use FUNCTION_EPILOGUE", 1286},
- {"Assume possible double misalignment", 1287},
- {"Assume all doubles are aligned", 1288},
- {"Pass -assert pure-text to linker", 1289},
- {"Do not pass -assert pure-text to linker", 1290},
- {"Use flat register window model", 1291},
- {"Do not use flat register window model", 1292},
- {"Use ABI reserved registers", 1293},
- {"Do not use ABI reserved registers", 1294},
- {"Use hardware quad fp instructions", 1295},
- {"Do not use hardware quad fp instructions", 1296},
- {"Compile for v8plus ABI", 1297},
- {"Do not compile for v8plus ABI", 1298},
- {"Utilize Visual Instruction Set", 1299},
- {"Do not utilize Visual Instruction Set", 1300},
- {"Optimize for Cypress processors", 1301},
- {"Optimize for SparcLite processors", 1302},
- {"Optimize for F930 processors", 1303},
- {"Optimize for F934 processors", 1304},
- {"Use V8 Sparc ISA", 1305},
- {"Optimize for SuperSparc processors", 1306},
- {"Pointers are 64-bit", 1307},
- {"Pointers are 32-bit", 1308},
- {"Use 32-bit ABI", 1309},
- {"Use 64-bit ABI", 1310},
- {"Use stack bias", 1311},
- {"Do not use stack bias", 1312},
- {"Use structs on stronger alignment for double-word copies", 1313},
- {"Do not use structs on stronger alignment for double-word copies", 1314},
- {"Optimize tail call instructions in assembler and linker", 1315},
- {"Do not optimize tail call instructions in assembler or linker", 1316},
- {"Use given Sparc code model", 1317},
- {"%s=%s is not numeric.", 1318},
- {"%s=%s is too large.", 1319},
- {"a data area attribute cannot be specified for local variables", 1320},
- {"data area of '%s' conflicts with previous declaration", 1321},
- {"Bogus JR construction: %d\n", 1322},
- {"Bad amount of stack space removal: %d", 1323},
- {"Bogus JARL construction: %d\n", 1324},
- {"#pragma GHS endXXXX found without previous startXXX", 1325},
- {"#pragma GHS endXXX does not match previous startXXX", 1326},
- {"Cannot set interrupt attribute: no current function", 1327},
- {"Cannot set interrupt attribute: no such identifier", 1328},
- {"junk at end of #pragma ghs section", 1329},
- {"unrecognised section name \"%s\"", 1330},
- {"malformed #pragma ghs section", 1331},
- {"junk at end of #pragma ghs interrupt", 1332},
- {"junk at end of #pragma ghs starttda", 1333},
- {"junk at end of #pragma ghs startsda", 1334},
- {"junk at end of #pragma ghs startzda", 1335},
- {"junk at end of #pragma ghs endtda", 1336},
- {"junk at end of #pragma ghs endsda", 1337},
- {"junk at end of #pragma ghs endzda", 1338},
- {"Support Green Hills ABI", 1339},
- {"Prohibit PC relative function calls", 1340},
- {"Reuse r30 on a per function basis", 1341},
- {"Use stubs for function prologues", 1342},
- {"Same as: -mep -mprolog-function", 1343},
- {"Enable backend debugging", 1344},
- {"Compile for the v850 processor", 1345},
- {"Use 4 byte entries in switch tables", 1346},
- {"Set the max size of data eligible for the TDA area", 1347},
- {"Set the max size of data eligible for the SDA area", 1348},
- {"Set the max size of data eligible for the ZDA area", 1349},
- {"cannot convert to a pointer type", 1350},
- {"pointer value used where a floating point value was expected", 1351},
- {"aggregate value used where a float was expected", 1352},
- {"conversion to incomplete type", 1353},
- {"can't convert between vector values of different size", 1354},
- {"aggregate value used where an integer was expected", 1355},
- {"pointer value used where a complex was expected", 1356},
- {"aggregate value used where a complex was expected", 1357},
- {"can't convert value to a vector", 1358},
- {"unable to call pointer to member function here", 1359},
- {"destructors take no parameters", 1360},
- {"ISO C++ forbids omitting the middle term of a ?: expression", 1361},
- {"internal inconsistency: binfo offset error for rtti", 1362},
- {"conflicting access specifications for field `%s', ignored", 1363},
- {"trying to finish struct, but kicked out due to previous parse errors.", 1364},
- {"language string `\"%s\"' not recognized", 1365},
- {"not enough type information", 1366},
- {"invalid operation on uninstantiated type", 1367},
- {"\
-object size exceeds built-in limit for virtual function table implementation", 1368},
+supported.", 1389},
+ {"-mmultiple is not supported on little endian systems", 1390},
+ {"-mstring is not supported on little endian systems", 1391},
+ {"-f%s ignored for AIX (all code is position independent)", 1392},
+ {"-ffunction-sections disabled on AIX when debugging", 1393},
+ {"-fdata-sections not supported on AIX", 1394},
+ {"Unknown -mdebug-%s switch", 1395},
+ {"invalid %%f value", 1396},
+ {"invalid %%F value", 1397},
+ {"invalid %%G value", 1398},
+ {"invalid %%j code", 1399},
+ {"invalid %%J code", 1400},
+ {"invalid %%K value", 1401},
+ {"invalid %%p value", 1402},
+ {"invalid %%q value", 1403},
+ {"%%S computed all 1's mask", 1404},
+ {"%%S computed all 0's mask", 1405},
+ {"invalid %%T value", 1406},
+ {"invalid %%u value", 1407},
+ {"invalid %%v value", 1408},
+ {"invalid %%W value", 1409},
+ {"Use POWER instruction set", 1410},
+ {"Use POWER2 instruction set", 1411},
+ {"Do not use POWER2 instruction set", 1412},
+ {"Do not use POWER instruction set", 1413},
+ {"Use PowerPC instruction set", 1414},
+ {"Do not use PowerPC instruction set", 1415},
+ {"Use PowerPC General Purpose group optional instructions", 1416},
+ {"Don't use PowerPC General Purpose group optional instructions", 1417},
+ {"Use PowerPC Graphics group optional instructions", 1418},
+ {"Don't use PowerPC Graphics group optional instructions", 1419},
+ {"Use PowerPC-64 instruction set", 1420},
+ {"Don't use PowerPC-64 instruction set", 1421},
+ {"Use new mnemonics for PowerPC architecture", 1422},
+ {"Use old mnemonics for PowerPC architecture", 1423},
+ {"Put everything in the regular TOC", 1424},
+ {"Place floating point constants in TOC", 1425},
+ {"Don't place floating point constants in TOC", 1426},
+ {"Place symbol+offset constants in TOC", 1427},
+ {"Don't place symbol+offset constants in TOC", 1428},
+ {"Place variable addresses in the regular TOC", 1429},
+ {"Generate load/store multiple instructions", 1430},
+ {"Do not generate load/store multiple instructions", 1431},
+ {"Generate string instructions for block moves", 1432},
+ {"Do not generate string instructions for block moves", 1433},
+ {"Generate load/store with update instructions", 1434},
+ {"Do not generate load/store with update instructions", 1435},
+ {"Generate fused multiply/add instructions", 1436},
+ {"Don't generate fused multiply/add instructions", 1437},
+ {"Don't schedule the start and end of the procedure", 1438},
+ {"Use features of and schedule code for given CPU", 1439},
+ {"Enable debug output", 1440},
+ {"RETURN_ADDRESS_OFFSET not supported", 1441},
+ {"Select ABI calling convention.", 1442},
+ {"Select method for sdata handling.", 1443},
+ {"Align to the base type of the bitfield.", 1444},
+ {"Don't align to the base type of the bitfield.", 1445},
+ {"Don't assume that unaligned accesses are handled by the system", 1446},
+ {"Assume that unaligned accesses are handled by the system", 1447},
+ {"Produce code relocatable at runtime.", 1448},
+ {"Don't produce code relocatable at runtime.", 1449},
+ {"Produce little endian code.", 1450},
+ {"Produce big endian code.", 1451},
+ {"Use 128 bit long doubles", 1452},
+ {"no description yet", 1453},
+ {"Use EABI.", 1454},
+ {"Don't use EABI.", 1455},
+ {"Use alternate register names.", 1456},
+ {"Don't use alternate register names.", 1457},
+ {"Link with libsim.a, libc.a and sim-crt0.o.", 1458},
+ {"Link with libads.a, libc.a and crt0.o.", 1459},
+ {"Link with libyk.a, libc.a and crt0.o.", 1460},
+ {"Link with libmvme.a, libc.a and crt0.o.", 1461},
+ {"Set the PPC_EMB bit in the ELF flags header", 1462},
+ {"Bad value for -mcall-%s", 1463},
+ {"Bad value for -msdata=%s", 1464},
+ {"-mrelocatable and -msdata=%s are incompatible.", 1465},
+ {"-f%s and -msdata=%s are incompatible.", 1466},
+ {"-msdata=%s and -mcall-%s are incompatible.", 1467},
+ {"-mrelocatable and -mno-minimal-toc are incompatible.", 1468},
+ {"-mrelocatable and -mcall-%s are incompatible.", 1469},
+ {"-fPIC and -mcall-%s are incompatible.", 1470},
+ {"-mcall-aixdesc must be big endian", 1471},
+ {"Generate code for big endian", 1472},
+ {"Generate code for little endian", 1473},
+ {"Use little-endian byte order for data", 1474},
+ {"%s is not supported by this configuration", 1475},
+ {"-mlong-double-64 not allowed with -m64", 1476},
+ {"bad value (%s) for -mcmodel= switch", 1477},
+ {"-mcmodel= is not supported on 32 bit systems", 1478},
+ {"profiling does not support code models other than medlow", 1479},
+ {"Invalid %%Y operand", 1480},
+ {"Invalid %%A operand", 1481},
+ {"Invalid %%B operand", 1482},
+ {"Invalid %%c operand", 1483},
+ {"Invalid %%C operand", 1484},
+ {"Invalid %%d operand", 1485},
+ {"Invalid %%D operand", 1486},
+ {"Invalid %%f operand", 1487},
+ {"long long constant not a valid immediate operand", 1488},
+ {"floating point constant not a valid immediate operand", 1489},
+ {"%s and profiling conflict: disabling %s", 1490},
+ {"Use FUNCTION_EPILOGUE", 1491},
+ {"Do not use FUNCTION_EPILOGUE", 1492},
+ {"Assume possible double misalignment", 1493},
+ {"Assume all doubles are aligned", 1494},
+ {"Pass -assert pure-text to linker", 1495},
+ {"Do not pass -assert pure-text to linker", 1496},
+ {"Use flat register window model", 1497},
+ {"Do not use flat register window model", 1498},
+ {"Use ABI reserved registers", 1499},
+ {"Do not use ABI reserved registers", 1500},
+ {"Use hardware quad fp instructions", 1501},
+ {"Do not use hardware quad fp instructions", 1502},
+ {"Compile for v8plus ABI", 1503},
+ {"Do not compile for v8plus ABI", 1504},
+ {"Utilize Visual Instruction Set", 1505},
+ {"Do not utilize Visual Instruction Set", 1506},
+ {"Optimize for Cypress processors", 1507},
+ {"Optimize for SparcLite processors", 1508},
+ {"Optimize for F930 processors", 1509},
+ {"Optimize for F934 processors", 1510},
+ {"Use V8 Sparc ISA", 1511},
+ {"Optimize for SuperSparc processors", 1512},
+ {"Pointers are 64-bit", 1513},
+ {"Pointers are 32-bit", 1514},
+ {"Use 32-bit ABI", 1515},
+ {"Use 64-bit ABI", 1516},
+ {"Use stack bias", 1517},
+ {"Do not use stack bias", 1518},
+ {"Use structs on stronger alignment for double-word copies", 1519},
+ {"Do not use structs on stronger alignment for double-word copies", 1520},
+ {"Optimize tail call instructions in assembler and linker", 1521},
+ {"Do not optimize tail call instructions in assembler or linker", 1522},
+ {"Use given Sparc code model", 1523},
+ {"#pragma GHS endXXXX found without previous startXXX", 1524},
+ {"#pragma GHS endXXX does not match previous startXXX", 1525},
+ {"Cannot set interrupt attribute: no current function", 1526},
+ {"Cannot set interrupt attribute: no such identifier", 1527},
+ {"junk at end of #pragma ghs section", 1528},
+ {"unrecognised section name \"%s\"", 1529},
+ {"malformed #pragma ghs section", 1530},
+ {"junk at end of #pragma ghs interrupt", 1531},
+ {"junk at end of #pragma ghs starttda", 1532},
+ {"junk at end of #pragma ghs startsda", 1533},
+ {"junk at end of #pragma ghs startzda", 1534},
+ {"junk at end of #pragma ghs endtda", 1535},
+ {"junk at end of #pragma ghs endsda", 1536},
+ {"junk at end of #pragma ghs endzda", 1537},
+ {"%s=%s is not numeric.", 1538},
+ {"%s=%s is too large.", 1539},
+ {"a data area attribute cannot be specified for local variables", 1540},
+ {"data area of '%s' conflicts with previous declaration", 1541},
+ {"Bogus JR construction: %d\n", 1542},
+ {"Bad amount of stack space removal: %d", 1543},
+ {"Bogus JARL construction: %d\n", 1544},
+ {"Support Green Hills ABI", 1545},
+ {"Prohibit PC relative function calls", 1546},
+ {"Reuse r30 on a per function basis", 1547},
+ {"Use stubs for function prologues", 1548},
+ {"Same as: -mep -mprolog-function", 1549},
+ {"Enable backend debugging", 1550},
+ {"Compile for the v850 processor", 1551},
+ {"Use 4 byte entries in switch tables", 1552},
+ {"Set the max size of data eligible for the TDA area", 1553},
+ {"Set the max size of data eligible for the SDA area", 1554},
+ {"Set the max size of data eligible for the ZDA area", 1555},
+ {"cannot convert to a pointer type", 1556},
+ {"pointer value used where a floating point value was expected", 1557},
+ {"aggregate value used where a float was expected", 1558},
+ {"conversion to incomplete type", 1559},
+ {"can't convert between vector values of different size", 1560},
+ {"aggregate value used where an integer was expected", 1561},
+ {"pointer value used where a complex was expected", 1562},
+ {"aggregate value used where a complex was expected", 1563},
+ {"can't convert value to a vector", 1564},
+ {"unable to call pointer to member function here", 1565},
+ {"destructors take no parameters", 1566},
+ {"ISO C++ forbids omitting the middle term of a ?: expression", 1567},
+ {"conflicting access specifications for field `%s', ignored", 1568},
+ {"trying to finish struct, but kicked out due to previous parse errors.", 1569},
+ {"language string `\"%s\"' not recognized", 1570},
+ {"not enough type information", 1571},
+ {"invalid operation on uninstantiated type", 1572},
+ {"\
+object size exceeds built-in limit for virtual function table implementation", 1573},
{"\
object size exceeds normal limit for virtual function table implementation, \
-recompile all source and use -fhuge-objects", 1369},
- {"internal compiler error: debugging info corrupted", 1370},
- {"parse errors have confused me too much", 1371},
- {"declaration of `%s' shadows a member of `this'", 1372},
- {"label `%s' referenced outside of any function", 1373},
- {"jump to case label", 1374},
- {" enters try block", 1375},
- {" from here", 1376},
- {"`default' label not within a switch statement", 1377},
- {"pointers are not permitted as case values", 1378},
- {"ISO C++ forbids range expressions in switch statement", 1379},
- {"empty range specified", 1380},
- {"duplicate (or overlapping) case value", 1381},
- {"where case label appears here", 1382},
- {"\
-(enclose actions of previous case statements requiring destructors in their \
-own scope.)", 1383},
- {"virtual memory exhausted", 1384},
- {"the new ABI requires vtable thunks", 1385},
- {"an anonymous union cannot have function members", 1386},
- {"multiple types in one declaration", 1387},
- {"declaration does not declare anything", 1388},
- {"ISO C++ prohibits anonymous structs", 1389},
- {"assignment (not initialization) in declaration", 1390},
- {"invalid catch parameter", 1391},
- {"cannot declare `::main' to be a template", 1392},
- {"cannot declare `::main' to be inline", 1393},
- {"cannot declare `::main' to be static", 1394},
- {"`main' must return `int'", 1395},
- {"overflow in array dimension", 1396},
- {"destructors must be member functions", 1397},
- {"`bool' is now a keyword", 1398},
- {"ISO C++ does not support `long long'", 1399},
- {"short, signed or unsigned invalid for `%s'", 1400},
- {"long and short specified together for `%s'", 1401},
- {"signed and unsigned given together for `%s'", 1402},
- {"storage class specifiers invalid in parameter declarations", 1403},
- {"typedef declaration invalid in parameter declaration", 1404},
- {"virtual outside class declaration", 1405},
- {"storage class specified for %s `%s'", 1406},
- {"storage class specifiers invalid in friend function declarations", 1407},
- {"destructor cannot be static member function", 1408},
- {"constructor cannot be static member function", 1409},
- {"constructors cannot be declared virtual", 1410},
- {"return value type specifier for constructor ignored", 1411},
- {"can't initialize friend function `%s'", 1412},
- {"virtual functions cannot be friends", 1413},
- {"friend declaration not in class definition", 1414},
- {"cannot declare %s to references", 1415},
- {"invalid type: `void &'", 1416},
- {"discarding `const' applied to a reference", 1417},
- {"discarding `volatile' applied to a reference", 1418},
- {"only declarations of constructors can be `explicit'", 1419},
- {"non-member `%s' cannot be declared `mutable'", 1420},
- {"non-object member `%s' cannot be declared `mutable'", 1421},
- {"function `%s' cannot be declared `mutable'", 1422},
- {"static `%s' cannot be declared `mutable'", 1423},
- {"const `%s' cannot be declared `mutable'", 1424},
- {"typedef declaration includes an initializer", 1425},
- {"unnamed variable or field declared void", 1426},
- {"variable or field declared void", 1427},
- {"cannot use `::' in parameter declaration", 1428},
- {"declaration of `%s' as void", 1429},
- {"`%s' is neither function nor member function; cannot be declared friend", 1430},
- {"member functions are implicitly friends of their class", 1431},
- {"storage class `auto' invalid for function `%s'", 1432},
- {"storage class `register' invalid for function `%s'", 1433},
- {"\
-storage class `static' invalid for function `%s' declared out of global scope", 1434},
- {"\
-storage class `inline' invalid for function `%s' declared out of global scope", 1435},
- {"virtual non-class function `%s'", 1436},
- {"cannot declare static function inside another function", 1437},
+recompile all source and use -fhuge-objects", 1574},
+ {"declaration of `%s' shadows a member of `this'", 1575},
+ {"label `%s' referenced outside of any function", 1576},
+ {"jump to case label", 1577},
+ {" enters try block", 1578},
+ {" enters catch block", 1579},
+ {" from here", 1580},
+ {"the ABI requires vtable thunks", 1581},
+ {"multiple types in one declaration", 1582},
+ {"declaration does not declare anything", 1583},
+ {"Missing type-name in typedef-declaration.", 1584},
+ {"ISO C++ prohibits anonymous structs", 1585},
+ {"assignment (not initialization) in declaration", 1586},
+ {"invalid catch parameter", 1587},
+ {"cannot declare `::main' to be a template", 1588},
+ {"cannot declare `::main' to be inline", 1589},
+ {"cannot declare `::main' to be static", 1590},
+ {"`main' must return `int'", 1591},
+ {"overflow in array dimension", 1592},
+ {"destructors must be member functions", 1593},
+ {"`bool' is now a keyword", 1594},
+ {"ISO C++ does not support `long long'", 1595},
+ {"short, signed or unsigned invalid for `%s'", 1596},
+ {"long and short specified together for `%s'", 1597},
+ {"signed and unsigned given together for `%s'", 1598},
+ {"storage class specifiers invalid in parameter declarations", 1599},
+ {"typedef declaration invalid in parameter declaration", 1600},
+ {"virtual outside class declaration", 1601},
+ {"storage class specified for %s `%s'", 1602},
+ {"storage class specifiers invalid in friend function declarations", 1603},
+ {"destructor cannot be static member function", 1604},
+ {"constructor cannot be static member function", 1605},
+ {"constructors cannot be declared virtual", 1606},
+ {"return value type specifier for constructor ignored", 1607},
+ {"can't initialize friend function `%s'", 1608},
+ {"virtual functions cannot be friends", 1609},
+ {"friend declaration not in class definition", 1610},
+ {"cannot declare %s to references", 1611},
+ {"invalid type: `void &'", 1612},
+ {"discarding `const' applied to a reference", 1613},
+ {"discarding `volatile' applied to a reference", 1614},
+ {"only declarations of constructors can be `explicit'", 1615},
+ {"non-member `%s' cannot be declared `mutable'", 1616},
+ {"non-object member `%s' cannot be declared `mutable'", 1617},
+ {"function `%s' cannot be declared `mutable'", 1618},
+ {"static `%s' cannot be declared `mutable'", 1619},
+ {"const `%s' cannot be declared `mutable'", 1620},
+ {"typedef declaration includes an initializer", 1621},
+ {"unnamed variable or field declared void", 1622},
+ {"variable or field declared void", 1623},
+ {"cannot use `::' in parameter declaration", 1624},
+ {"`%s' is neither function nor member function; cannot be declared friend", 1625},
+ {"member functions are implicitly friends of their class", 1626},
+ {"storage class `auto' invalid for function `%s'", 1627},
+ {"storage class `register' invalid for function `%s'", 1628},
+ {"\
+storage class `static' invalid for function `%s' declared out of global scope", 1629},
+ {"\
+storage class `inline' invalid for function `%s' declared out of global scope", 1630},
+ {"virtual non-class function `%s'", 1631},
+ {"cannot declare static function inside another function", 1632},
{"\
invalid integer constant in parameter list, did you forget to give parameter \
-name?", 1438},
- {"parameter invalidly declared method type", 1439},
- {"parameter invalidly declared offset type", 1440},
- {"`void' in parameter list must be entire list", 1441},
- {"conversion to %s%s will never use a type conversion operator", 1442},
- {"return type for `main' changed to `int'", 1443},
- {"no return statement in function returning non-void", 1444},
- {"-f%s is no longer supported", 1445},
+name?", 1633},
+ {"conversion to %s%s will never use a type conversion operator", 1634},
+ {"return type for `main' changed to `int'", 1635},
+ {"-f%s is no longer supported", 1636},
{"\
-fhandle-exceptions has been renamed to -fexceptions (and is now on by \
-default)", 1446},
- {"no file specified with -fdump-translation-unit", 1447},
- {"-Wno-strict-prototypes is not supported in C++", 1448},
- {"name missing for member function", 1449},
- {"`__alignof__' applied to a bit-field", 1450},
- {"parser may be lost: is there a '{' missing somewhere?", 1451},
- {"ambiguous conversion for array subscript", 1452},
- {"anachronistic use of array size in vector delete", 1453},
+default)", 1637},
+ {"-fname-mangling-version is no longer supported", 1638},
+ {"-Wno-strict-prototypes is not supported in C++", 1639},
+ {"name missing for member function", 1640},
+ {"`__alignof__' applied to a bit-field", 1641},
+ {"parser may be lost: is there a '{' missing somewhere?", 1642},
+ {"ambiguous conversion for array subscript", 1643},
+ {"anachronistic use of array size in vector delete", 1644},
{"\
cannot delete a function. Only pointer-to-objects are valid arguments to \
-`delete'", 1454},
- {"initializer invalid for static member with constructor", 1455},
- {"(an out of class initialization is required)", 1456},
- {"field initializer is not constant", 1457},
- {"anonymous struct not inside named type", 1458},
- {"namespace-scope anonymous aggregates must be static", 1459},
- {"anonymous aggregate with no members", 1460},
- {"`operator new' must return type `void *'", 1461},
- {"`operator new' takes type `size_t' parameter", 1462},
- {"`operator new' takes type `size_t' as first parameter", 1463},
- {"`operator delete' must return type `void'", 1464},
- {"`operator delete' takes type `void *' as first parameter", 1465},
- {"second argument to `operator delete' must be of type `size_t'", 1466},
- {"too many arguments in declaration of `operator delete'", 1467},
- {"`...' invalid in specification of `operator delete'", 1468},
- {"too many initialization functions required", 1469},
- {"use of old-style cast", 1470},
- {"`%s' not supported by dump_type", 1471},
- {"`%s' not supported by dump_type_prefix", 1472},
- {"`%s' not supported by dump_type_suffix", 1473},
- {"`%s' not supported by dump_decl", 1474},
- {"`%s' not supported by dump_expr", 1475},
- {"In %s `%s':", 1476},
- {"call to Java `catch' or `throw', while `jthrowable' undefined", 1477},
- {"mixing C++ and Java `catch'es in single translation unit", 1478},
- {" in thrown expression", 1479},
+`delete'", 1645},
+ {"initializer invalid for static member with constructor", 1646},
+ {"(an out of class initialization is required)", 1647},
+ {"field initializer is not constant", 1648},
+ {"anonymous struct not inside named type", 1649},
+ {"namespace-scope anonymous aggregates must be static", 1650},
+ {"anonymous aggregate with no members", 1651},
+ {"too many initialization functions required", 1652},
+ {"use of old-style cast", 1653},
+ {"`%s' not supported by %s", 1654},
+ {"<anonymous %s>", 1655},
+ {"(static %s for %s)", 1656},
+ {"In %s `%s':", 1657},
+ {"%s: In instantiation of `%s':\n", 1658},
+ {"%s:%d: instantiated from `%s'\n", 1659},
+ {"%s:%d: instantiated from here\n", 1660},
+ {"call to Java `catch' or `throw' with `jthrowable' undefined", 1661},
+ {"mixing C++ and Java catches in a single translation unit", 1662},
+ {" in thrown expression", 1663},
{"\
(if this is not what you intended, make sure the function template has \
-already been declared and add <> after the function name here) \
--Wno-non-template-friend disables this warning.", 1480},
- {"argument to `%s' missing\n", 1481},
- {"initializer list treated as compound expression", 1482},
- {" will be re-ordered to match declaration order", 1483},
- {" will be re-ordered to match inheritance order", 1484},
- {"base class initializer specified, but no base class to initialize", 1485},
- {"initializer for unnamed base class ambiguous", 1486},
- {"no base class to initialize", 1487},
- {"object missing in use of pointer-to-member construct", 1488},
- {"at this point in file", 1489},
- {"new of array type fails to specify size", 1490},
- {"size in array new must have integral type", 1491},
- {"zero size array reserves no space", 1492},
- {"new cannot be applied to a reference type", 1493},
- {"new cannot be applied to a function type", 1494},
- {"call to Java constructor, while `jclass' undefined", 1495},
- {"invalid type `void' for new", 1496},
- {"call to Java constructor, while `%s' undefined", 1497},
- {"initializer list being treated as compound expression", 1498},
- {"initializer list appears where operand should be used", 1499},
- {"initialization of array from dissimilar array type", 1500},
- {"initializer ends prematurely", 1501},
- {"cannot initialize multi-dimensional array with initializer", 1502},
- {"unknown array size in delete", 1503},
- {"type to vector delete is neither pointer or array type", 1504},
- {"type name expected before `*'", 1505},
- {"cannot declare references to references", 1506},
- {"cannot declare pointers to references", 1507},
- {"type name expected before `&'", 1508},
- {"semicolon missing after %s declaration", 1509},
- {"junk at end of #pragma %s", 1510},
- {"invalid #pragma %s", 1511},
- {"#pragma implementation for %s appears after file is included", 1512},
+already been declared and add <> after the function name here) -Wno-non-\
+template-friend disables this warning.", 1664},
+ {"argument to `%s' missing\n", 1665},
+ {"initializer list treated as compound expression", 1666},
+ {" will be re-ordered to match declaration order", 1667},
+ {" will be re-ordered to match inheritance order", 1668},
+ {"base class initializer specified, but no base class to initialize", 1669},
+ {"initializer for unnamed base class ambiguous", 1670},
+ {"no base class to initialize", 1671},
+ {"object missing in use of pointer-to-member construct", 1672},
+ {"at this point in file", 1673},
+ {"new of array type fails to specify size", 1674},
+ {"size in array new must have integral type", 1675},
+ {"zero size array reserves no space", 1676},
+ {"new cannot be applied to a reference type", 1677},
+ {"new cannot be applied to a function type", 1678},
+ {"call to Java constructor, while `jclass' undefined", 1679},
+ {"Can't find class$", 1680},
+ {"invalid type `void' for new", 1681},
+ {"call to Java constructor with `%s' undefined", 1682},
+ {"initializer list being treated as compound expression", 1683},
+ {"ISO C++ forbids aggregate initializer to new", 1684},
+ {"initializer ends prematurely", 1685},
+ {"cannot initialize multi-dimensional array with initializer", 1686},
+ {"unknown array size in delete", 1687},
+ {"type to vector delete is neither pointer or array type", 1688},
+ {"Do not obey access control semantics", 1689},
+ {"Change when template instances are emitted", 1690},
+ {"Check the return value of new", 1691},
+ {"Reduce size of object files", 1692},
+ {"Make string literals `char[]' instead of `const char[]'", 1693},
+ {"Dump the entire translation unit to a file", 1694},
+ {"Do not inline member functions by default", 1695},
+ {"Do not generate run time type descriptor information", 1696},
+ {"Do not generate code to check exception specifications", 1697},
+ {"Scope of for-init-statement vars extends outside", 1698},
+ {"Do not recognise GNU defined keywords", 1699},
+ {"Do not treat the namespace `std' as a normal namespace", 1700},
+ {"Enable support for huge objects", 1701},
+ {"Export functions even if they can be inlined", 1702},
+ {"Only emit explicit template instatiations", 1703},
+ {"Only emit explicit instatiations of inline templates", 1704},
+ {"Don't pedwarn about uses of Microsoft extensions", 1705},
+ {"Recognise and/bitand/bitor/compl/not/or/xor", 1706},
+ {"Disable optional diagnostics", 1707},
+ {"Downgrade conformance errors to warnings", 1708},
+ {"Enable automatic template instantiation", 1709},
+ {"Display statistics accumulated during compilation", 1710},
+ {"Specify maximum template instantiation depth", 1711},
+ {"Use __cxa_atexit to register destructors.", 1712},
+ {"Discard unused virtual functions", 1713},
+ {"Implement vtables using thunks", 1714},
+ {"Emit common-like symbols as weak symbols", 1715},
+ {"Emit cross referencing information", 1716},
+ {"Warn about inconsistent return types", 1717},
+ {"Warn about overloaded virtual function names", 1718},
+ {"Don't warn when all ctors/dtors are private", 1719},
+ {"Warn about non virtual destructors", 1720},
+ {"Warn when a function is declared extern, then inline", 1721},
+ {"Warn when the compiler reorders code", 1722},
+ {"Warn when synthesis behaviour differs from Cfront", 1723},
+ {"Don't warn when type converting pointers to member functions", 1724},
+ {"Warn about violations of Effective C++ style rules", 1725},
+ {"Warn when overload promotes from unsigned to signed", 1726},
+ {"Warn if a C style cast is used in a program", 1727},
+ {"\
+Don't warn when non-templatized friend functions are declared within a \
+template", 1728},
+ {"Don't announce deprecation of compiler features", 1729},
+ {"type name expected before `*'", 1730},
+ {"cannot declare references to references", 1731},
+ {"cannot declare pointers to references", 1732},
+ {"type name expected before `&'", 1733},
+ {"semicolon missing after %s declaration", 1734},
+ {"junk at end of #pragma %s", 1735},
+ {"invalid #pragma %s", 1736},
+ {"#pragma implementation for %s appears after file is included", 1737},
+ {"junk at end of #pragma GCC java_exceptions", 1738},
{"\
(Each undeclared identifier is reported only once for each function it \
-appears in.)", 1513},
- {"name lookup of `%s' changed", 1514},
- {"name lookup of `%s' changed for new ISO `for' scoping", 1515},
- {"conversion of %s as template parameter", 1516},
- {"methods cannot be converted to function pointers", 1517},
- {"ambiguous request for method pointer `%s'", 1518},
- {"request for member `%s' is ambiguous in multiple inheritance lattice", 1519},
- {"invalid default template argument", 1520},
- {"no base or member initializers given following ':'", 1521},
- {"base initializers not allowed for non-member functions", 1522},
- {"only constructors take base initializers", 1523},
- {"anachronistic old style base class initializer", 1524},
- {"`>>' should be `> >' in template class name", 1525},
- {"ISO C++ forbids an empty condition for `%s'", 1526},
- {"ISO C++ forbids `&&'", 1527},
- {"ISO C++ forbids initialization of new expression with `='", 1528},
- {"ISO C++ forbids constructor-expressions", 1529},
- {"ISO C++ forbids braced-groups within expressions", 1530},
- {"sigof type specifier", 1531},
- {"`sigof' applied to non-aggregate expression", 1532},
- {"`sigof' applied to non-aggregate type", 1533},
- {"storage class specifier `%s' not allowed after struct or class", 1534},
- {"type specifier `%s' not allowed after struct or class", 1535},
- {"type qualifier `%s' not allowed after struct or class", 1536},
- {"no body nor ';' separates two class, struct or union declarations", 1537},
- {"multiple access specifiers", 1538},
- {"multiple `virtual' specifiers", 1539},
- {"missing ';' before right brace", 1540},
- {"ISO C++ forbids array dimensions with parenthesized type in new", 1541},
- {"ISO C++ forbids label declarations", 1542},
- {"ISO C++ forbids computed gotos", 1543},
- {"label must be followed by statement", 1544},
- {"ISO C++ forbids compound statements inside for initializations", 1545},
- {"possibly missing ')'", 1546},
- {"type specifier omitted for parameter", 1547},
- {" a template type parameter must begin with `class' or `typename'", 1548},
- {"creating array with size zero", 1549},
- {"use of `%s' in template", 1550},
- {"incomplete type unification", 1551},
- {"use of `%s' in template type unification", 1552},
- {"-frepo must be used with -c", 1553},
- {"mysterious repository information in %s", 1554},
- {"can't create repository information file `%s'", 1555},
- {"taking dynamic typeid of object with -fno-rtti", 1556},
- {"cannot use typeid with -fno-rtti", 1557},
- {"must #include <typeinfo> before using typeid", 1558},
- {"adjusting pointers for covariant returns", 1559},
- {"recoverable compiler error, fixups for virtual function", 1560},
- {"identifier name `%s' conflicts with GNU C++ internal naming strategy", 1561},
- {"syntax error before '#' token", 1562},
- {"syntax error before '\\' token", 1563},
- {"keyword 'export' not implemented and will be ignored", 1564},
- {"parse error at end of saved function text", 1565},
- {"parse error in method specification", 1566},
- {"function body for constructor missing", 1567},
- {"non-lvalue in %s", 1568},
- {"`com_interface' only supported with -fvtable-thunks", 1569},
- {"`com_interface' attribute can only be applied to class definitions", 1570},
- {"requested init_priority is not an integer constant", 1571},
+appears in.)", 1739},
+ {"name lookup of `%s' changed", 1740},
+ {"name lookup of `%s' changed for new ISO `for' scoping", 1741},
+ {"real-valued template parameters when cross-compiling", 1742},
+ {"methods cannot be converted to function pointers", 1743},
+ {"ambiguous request for method pointer `%s'", 1744},
+ {"invalid default template argument", 1745},
+ {"no base or member initializers given following ':'", 1746},
+ {"base initializers not allowed for non-member functions", 1747},
+ {"only constructors take base initializers", 1748},
+ {"anachronistic old style base class initializer", 1749},
+ {"`>>' should be `> >' in template class name", 1750},
+ {"ISO C++ forbids an empty condition for `%s'", 1751},
+ {"ISO C++ forbids `&&'", 1752},
+ {"ISO C++ forbids initialization of new expression with `='", 1753},
+ {"ISO C++ forbids compound literals", 1754},
+ {"ISO C++ forbids braced-groups within expressions", 1755},
+ {"sigof type specifier", 1756},
+ {"`sigof' applied to non-aggregate expression", 1757},
+ {"`sigof' applied to non-aggregate type", 1758},
+ {"storage class specifier `%s' not allowed after struct or class", 1759},
+ {"type specifier `%s' not allowed after struct or class", 1760},
+ {"type qualifier `%s' not allowed after struct or class", 1761},
+ {"no body nor ';' separates two class, struct or union declarations", 1762},
+ {"multiple access specifiers", 1763},
+ {"multiple `virtual' specifiers", 1764},
+ {"missing ';' before right brace", 1765},
+ {"ISO C++ forbids array dimensions with parenthesized type in new", 1766},
+ {"ISO C++ forbids label declarations", 1767},
+ {"ISO C++ forbids computed gotos", 1768},
+ {"label must be followed by statement", 1769},
+ {"ISO C++ forbids compound statements inside for initializations", 1770},
+ {"possibly missing ')'", 1771},
+ {"type specifier omitted for parameter", 1772},
+ {"creating array with size zero", 1773},
+ {"use of `%s' in template", 1774},
+ {"incomplete type unification", 1775},
+ {"use of `%s' in template type unification", 1776},
+ {"-frepo must be used with -c", 1777},
+ {"mysterious repository information in %s", 1778},
+ {"can't create repository information file `%s'", 1779},
+ {"taking dynamic typeid of object with -fno-rtti", 1780},
+ {"cannot use typeid with -fno-rtti", 1781},
+ {"must #include <typeinfo> before using typeid", 1782},
+ {"adjusting pointers for covariant returns", 1783},
+ {"recoverable compiler error, fixups for virtual function", 1784},
+ {"ISO C++ does not permit named return values", 1785},
+ {"can't redefine default return value for constructors", 1786},
+ {" will be re-ordered to precede member initializations", 1787},
+ {"`this' is unavailable for static member functions", 1788},
+ {"invalid use of `this' in non-member function", 1789},
+ {"invalid use of `this' at top level", 1790},
+ {"template type parameters must use the keyword `class' or `typename'", 1791},
+ {"identifier name `%s' conflicts with GNU C++ internal naming strategy", 1792},
+ {"parse error", 1793},
+ {"parse error at end of saved function text", 1794},
+ {"parse error in method specification", 1795},
+ {"function body for constructor missing", 1796},
+ {"%s before `%s'", 1797},
+ {"%s before `%c'", 1798},
+ {"%s before `\\%o'", 1799},
+ {"%s before `%s' token", 1800},
+ {"non-lvalue in %s", 1801},
+ {"\
+`java_interface' attribute can only be applied to Java class definitions", 1802},
+ {"`com_interface' only supported with -fvtable-thunks", 1803},
+ {"`com_interface' attribute can only be applied to class definitions", 1804},
+ {"requested init_priority is not an integer constant", 1805},
{"\
can only use init_priority attribute on file-scope definitions of objects of \
-class type", 1572},
- {"requested init_priority is out of range", 1573},
- {"requested init_priority is reserved for internal use", 1574},
- {"\
-ISO C++ forbids %s between pointer of type `void *' and pointer-to-function", 1575},
- {"ISO C++ forbids applying `sizeof' to a function type", 1576},
- {"ISO C++ forbids applying `sizeof' to a member function", 1577},
- {"\
-ISO C++ forbids applying `sizeof' to type `void' which is an incomplete type", 1578},
- {"sizeof applied to a bit-field", 1579},
- {"ISO C++ forbids applying `sizeof' to an expression of function type", 1580},
- {"invalid reference to NULL ptr, use ptr-to-member instead", 1581},
- {"invalid use of `%s' on pointer to member", 1582},
- {"invalid type argument", 1583},
- {"ISO C++ forbids subscripting non-lvalue array", 1584},
- {"subscripting array declared `register'", 1585},
- {"pointer to member function called, but not in class scope", 1586},
+class type", 1806},
+ {"requested init_priority is out of range", 1807},
+ {"requested init_priority is reserved for internal use", 1808},
+ {"init_priority attribute is not supported on this platform", 1809},
+ {"\
+ISO C++ forbids %s between pointer of type `void *' and pointer-to-function", 1810},
+ {"ISO C++ forbids applying `sizeof' to a function type", 1811},
+ {"ISO C++ forbids applying `sizeof' to a member function", 1812},
+ {"\
+ISO C++ forbids applying `sizeof' to type `void' which is an incomplete type", 1813},
+ {"sizeof applied to a bit-field", 1814},
+ {"ISO C++ forbids applying `sizeof' to an expression of function type", 1815},
+ {"invalid reference to NULL ptr, use ptr-to-member instead", 1816},
+ {"invalid use of `%s' on pointer to member", 1817},
+ {"invalid type argument", 1818},
+ {"ISO C++ forbids subscripting non-lvalue array", 1819},
+ {"subscripting array declared `register'", 1820},
+ {"pointer to member function called, but not in class scope", 1821},
{"\
invalid call to member function needing `this' in static member function \
-scope", 1587},
- {"ISO C++ forbids calling `::main' from within program", 1588},
- {"parameter type of called function is incomplete", 1589},
- {"%s rotate count is negative", 1590},
- {"%s rotate count >= width of type", 1591},
- {"ISO C++ forbids comparison between pointer and integer", 1592},
- {"comparison between signed and unsigned integer expressions", 1593},
- {"ISO C++ forbids using pointer of type `void *' in pointer arithmetic", 1594},
- {"ISO C++ forbids using a pointer-to-function in pointer arithmetic", 1595},
- {"\
-ISO C++ forbids using a pointer to member function in pointer arithmetic", 1596},
- {"ISO C++ forbids using pointer to a member in pointer arithmetic", 1597},
- {"ISO C++ forbids using pointer of type `void *' in subtraction", 1598},
- {"ISO C++ forbids using pointer to a function in subtraction", 1599},
- {"ISO C++ forbids using pointer to a method in subtraction", 1600},
- {"ISO C++ forbids using pointer to a member in subtraction", 1601},
- {"invalid use of a pointer to an incomplete type in pointer arithmetic", 1602},
- {"taking address of temporary", 1603},
- {"ISO C++ forbids %sing an enum", 1604},
- {"cast to non-reference type used as lvalue", 1605},
- {"ISO C++ forbids taking address of function `::main'", 1606},
- {"ISO C++ forbids taking the address of a cast to a non-lvalue expression", 1607},
- {"unary `&'", 1608},
- {"cannot take the address of `this', which is an ravlue expression", 1609},
- {"\
-ISO C++ forbids casting between pointer-to-function and pointer-to-object", 1610},
- {"ISO C++ forbids casting to an array type", 1611},
- {"ISO C++ forbids cast to non-reference type used as lvalue", 1612},
- {"ISO C++ forbids assignment of arrays", 1613},
- {"return value from function receives multiple initializations", 1614},
- {" in pointer to member function conversion", 1615},
- {" in pointer to member conversion", 1616},
- {"returning reference to temporary", 1617},
- {"reference to non-lvalue returned", 1618},
- {"returning a value from a destructor", 1619},
- {"cannot return from a handler of a function-try-block of a constructor", 1620},
- {"returning a value from a constructor", 1621},
+scope", 1822},
+ {"ISO C++ forbids calling `::main' from within program", 1823},
+ {"parameter type of called function is incomplete", 1824},
+ {"%s rotate count is negative", 1825},
+ {"%s rotate count >= width of type", 1826},
+ {"ISO C++ forbids comparison between pointer and integer", 1827},
+ {"comparison between signed and unsigned integer expressions", 1828},
+ {"ISO C++ forbids using pointer of type `void *' in pointer arithmetic", 1829},
+ {"ISO C++ forbids using a pointer-to-function in pointer arithmetic", 1830},
+ {"\
+ISO C++ forbids using a pointer to member function in pointer arithmetic", 1831},
+ {"ISO C++ forbids using pointer to a member in pointer arithmetic", 1832},
+ {"ISO C++ forbids using pointer of type `void *' in subtraction", 1833},
+ {"ISO C++ forbids using pointer to a function in subtraction", 1834},
+ {"ISO C++ forbids using pointer to a method in subtraction", 1835},
+ {"ISO C++ forbids using pointer to a member in subtraction", 1836},
+ {"invalid use of a pointer to an incomplete type in pointer arithmetic", 1837},
+ {"taking address of temporary", 1838},
+ {"ISO C++ forbids %sing an enum", 1839},
+ {"cast to non-reference type used as lvalue", 1840},
+ {"ISO C++ forbids taking address of function `::main'", 1841},
+ {"ISO C++ forbids taking the address of a cast to a non-lvalue expression", 1842},
+ {"unary `&'", 1843},
+ {"cannot take the address of `this', which is an rvalue expression", 1844},
+ {"\
+ISO C++ forbids casting between pointer-to-function and pointer-to-object", 1845},
+ {"ISO C++ forbids cast to non-reference type used as lvalue", 1846},
+ {"ISO C++ forbids assignment of arrays", 1847},
+ {"return value from function receives multiple initializations", 1848},
+ {" in pointer to member function conversion", 1849},
+ {" in pointer to member conversion", 1850},
+ {"returning reference to temporary", 1851},
+ {"reference to non-lvalue returned", 1852},
+ {"returning a value from a destructor", 1853},
+ {"cannot return from a handler of a function-try-block of a constructor", 1854},
+ {"returning a value from a constructor", 1855},
{"\
return-statement with no value, in function declared with a non-void return \
-type", 1622},
- {"\
-return-statement with a value, in function declared with a void return type", 1623},
- {" since the following virtual functions are abstract:", 1624},
- {"Internal error #%d.", 1625},
- {"due to the presence of a constructor", 1626},
- {"comma expression used to initialize return value", 1627},
- {"cannot initialize arrays using this syntax", 1628},
- {"ANSI C++ forbids non-constant aggregate initializer expressions", 1629},
- {"initializing array with parameter list", 1630},
- {"initializer for scalar variable requires one element", 1631},
- {"aggregate has a partly bracketed initializer", 1632},
- {"non-trivial labeled initializers", 1633},
- {"non-empty initializer for array of empty elements", 1634},
- {"initializer list for object of class with virtual base classes", 1635},
- {"initializer list for object of class with base classes", 1636},
- {"initializer list for object using virtual functions", 1637},
- {"index value instead of field name in union initializer", 1638},
- {"excess elements in aggregate initializer", 1639},
- {"circular pointer delegation detected", 1640},
- {"result of `operator->()' yields non-pointer result", 1641},
- {"base operand of `->' is not a pointer", 1642},
- {"ISO C++ forbids defining types within %s", 1643},
- {"Can't create cross-reference file `%s'", 1644},
- {"Internal gcc abort.", 1645},
- {"In file included from %s:%u", 1646},
+type", 1856},
+ {"\
+return-statement with a value, in function declared with a void return type", 1857},
+ {" because the following virtual functions are abstract:", 1858},
+ {"Internal error #%d.", 1859},
+ {"due to the presence of a constructor", 1860},
+ {"comma expression used to initialize return value", 1861},
+ {"cannot initialize arrays using this syntax", 1862},
+ {"ANSI C++ forbids non-constant aggregate initializer expressions", 1863},
+ {"initializing array with parameter list", 1864},
+ {"initializer for scalar variable requires one element", 1865},
+ {"aggregate has a partly bracketed initializer", 1866},
+ {"non-trivial labeled initializers", 1867},
+ {"non-empty initializer for array of empty elements", 1868},
+ {"initializer list for object of class with virtual base classes", 1869},
+ {"initializer list for object of class with base classes", 1870},
+ {"initializer list for object using virtual functions", 1871},
+ {"index value instead of field name in union initializer", 1872},
+ {"excess elements in aggregate initializer", 1873},
+ {"circular pointer delegation detected", 1874},
+ {"result of `operator->()' yields non-pointer result", 1875},
+ {"base operand of `->' is not a pointer", 1876},
+ {"ISO C++ forbids defining types within %s", 1877},
+ {"Can't create cross-reference file `%s'", 1878},
+ {"In file included from %s:%u", 1879},
{"\
,\n\
- from %s:%u", 1647},
- {"internal error: ", 1648},
- {"warning: ", 1649},
- {"%s: %s", 1650},
- {"traditional C rejects the `U' suffix", 1651},
- {"integer constant contains digits beyond the radix", 1652},
- {"integer constant out of range", 1653},
- {"integer constant is so large that it is unsigned", 1654},
- {"invalid suffix '%.*s' on integer constant", 1655},
- {"\"%s\" is not defined", 1656},
- {"octal escape sequence out of range", 1657},
- {"hex escape sequence out of range", 1658},
- {"integer overflow in preprocessor expression", 1659},
- {"impossible operator type %s", 1660},
- {"comma operator in operand of #if", 1661},
- {"included file \"%s\" exists but is not readable", 1662},
- {"node for '%s' exists, open failed, error '%s', value %lx\n", 1663},
- {"cpp_make_system_header: bad flag %d\n", 1664},
- {"cpp_make_system_header called on non-file buffer", 1665},
- {"Multiple include guards may be useful for:\n", 1666},
- {"No include path in which to find %s", 1667},
- {"%s is too large", 1668},
- {"%s is shorter than expected\n", 1669},
- {"%s is a block device", 1670},
- {"%s is a directory", 1671},
- {"ignoring nonexistent directory \"%s\"\n", 1672},
- {"%s: Not a directory", 1673},
- {"ignoring duplicate directory \"%s\"\n", 1674},
- {"-MG must be specified with one of -M or -MM", 1675},
- {"#include \"...\" search starts here:\n", 1676},
- {"#include <...> search starts here:\n", 1677},
- {"End of search list.\n", 1678},
- {"buffers still stacked in cpp_finish", 1679},
- {"I/O error on output", 1680},
- {"Argument missing after %s", 1681},
- {"Assertion missing after %s", 1682},
- {"Directory name missing after %s", 1683},
- {"File name missing after %s", 1684},
- {"Macro name missing after %s", 1685},
- {"Path name missing after %s", 1686},
- {"Number missing after %s", 1687},
- {"Too many arguments. Type %s --help for usage info", 1688},
- {"GNU CPP version %s (cpplib)\n", 1689},
- {"Output filename specified twice", 1690},
- {"-I- specified twice", 1691},
- {"Usage: %s [switches] input output\n", 1692},
+ from %s:%u", 1880},
+ {"internal error: ", 1881},
+ {"warning: ", 1882},
+ {"%s: %s", 1883},
+ {"traditional C rejects the `U' suffix", 1884},
+ {"too many 'l' suffixes in integer constant", 1885},
+ {"integer constant contains digits beyond the radix", 1886},
+ {"integer constant out of range", 1887},
+ {"integer constant is so large that it is unsigned", 1888},
+ {"invalid suffix '%.*s' on integer constant", 1889},
+ {"missing ')' after \"defined\"", 1890},
+ {"operator \"defined\" requires an identifier", 1891},
+ {"(\"%s\" is an alternative token for \"%s\" in C++)", 1892},
+ {"\"defined\" operator appears during macro expansion", 1893},
+ {"ISO C++ does not permit \"%s\" in #if", 1894},
+ {"\"%s\" is not defined", 1895},
+ {"octal escape sequence out of range", 1896},
+ {"hex escape sequence out of range", 1897},
+ {"integer overflow in preprocessor expression", 1898},
+ {"impossible operator '%s'", 1899},
+ {"comma operator in operand of #if", 1900},
+ {"%s is too large", 1901},
+ {"%s is shorter than expected", 1902},
+ {"%s is a block device", 1903},
+ {"No include path in which to find %s", 1904},
+ {"Multiple include guards may be useful for:\n", 1905},
+ {"absolute file name in remap_filename", 1906},
+ {"ignoring nonexistent directory \"%s\"\n", 1907},
+ {"%s: Not a directory", 1908},
+ {"ignoring duplicate directory \"%s\"\n", 1909},
+ {"-include and -imacros cannot be used with -fpreprocessed", 1910},
+ {"#include \"...\" search starts here:\n", 1911},
+ {"#include <...> search starts here:\n", 1912},
+ {"End of search list.\n", 1913},
+ {"I/O error on output", 1914},
+ {"buffers still stacked in cpp_finish", 1915},
+ {"Argument missing after %s", 1916},
+ {"Assertion missing after %s", 1917},
+ {"Directory name missing after %s", 1918},
+ {"File name missing after %s", 1919},
+ {"Macro name missing after %s", 1920},
+ {"Path name missing after %s", 1921},
+ {"Number missing after %s", 1922},
+ {"Target missing after %s", 1923},
+ {"Too many filenames. Type %s --help for usage info", 1924},
+ {"Output filename specified twice", 1925},
+ {"-I- specified twice", 1926},
+ {"GNU CPP version %s (cpplib)", 1927},
+ {"you must additionally specify either -M or -MM", 1928},
+ {"Usage: %s [switches] input output\n", 1929},
{"\
Switches:\n\
-include <file> Include the contents of <file> before other \
@@ -1783,7 +2023,7 @@ files\n\
-iwithprefix <dir> Add <dir> to the end of the system include path\n\
-iwithprefixbefore <dir> Add <dir> to the end of the main include path\n\
-isystem <dir> Add <dir> to the start of the system include \
-path\n", 1693},
+path\n", 1930},
{"\
-idirafter <dir> Add <dir> to the end of the system include path\n\
-I <dir> Add <dir> to the end of the main include path\n\
@@ -1792,21 +2032,21 @@ docs\n\
-nostdinc Do not search system include directories\n\
(dirs specified with -isystem will still be \
used)\n\
- -nostdinc++ Do not search system include directories for \
-C++\n\
- -o <file> Put output into <file>\n", 1694},
+ -nostdinc++ Do not search system include directories for C+\
++\n\
+ -o <file> Put output into <file>\n", 1931},
{"\
-pedantic Issue all warnings demanded by strict ISO C\n\
-pedantic-errors Issue -pedantic warnings as errors instead\n\
-trigraphs Support ISO C trigraphs\n\
-lang-c Assume that the input sources are in C\n\
- -lang-c89 Assume that the input sources are in C89\n", 1695},
+ -lang-c89 Assume that the input sources are in C89\n", 1932},
{"\
-lang-c++ Assume that the input sources are in C++\n\
-lang-objc Assume that the input sources are in ObjectiveC\n\
- -lang-objc++ Assume that the input sources are in \
-ObjectiveC++\n\
- -lang-asm Assume that the input sources are in assembler\n", 1696},
+ -lang-objc++ Assume that the input sources are in ObjectiveC+\
++\n\
+ -lang-asm Assume that the input sources are in assembler\n", 1933},
{"\
-std=<std name> Specify the conformance standard; one of:\n\
gnu89, gnu99, c89, c99, iso9899:1990,\n\
@@ -1815,7 +2055,7 @@ ObjectiveC++\n\
-w Inhibit warning messages\n\
-Wtrigraphs Warn if trigraphs are encountered\n\
-Wno-trigraphs Do not warn about trigraphs\n\
- -Wcomment{s} Warn if one comment starts inside another\n", 1697},
+ -Wcomment{s} Warn if one comment starts inside another\n", 1934},
{"\
-Wno-comment{s} Do not warn about comments\n\
-Wtraditional Warn about features not present in traditional \
@@ -1823,284 +2063,415 @@ C\n\
-Wno-traditional Do not warn about traditional C\n\
-Wundef Warn if an undefined macro is used by #if\n\
-Wno-undef Do not warn about testing undefined macros\n\
- -Wimport Warn about the use of the #import directive\n", 1698},
+ -Wimport Warn about the use of the #import directive\n", 1935},
{"\
-Wno-import Do not warn about the use of #import\n\
-Werror Treat all warnings as errors\n\
-Wno-error Do not treat warnings as errors\n\
- -Wall Enable all preprocessor warnings\n\
+ -Wsystem-headers Do not suppress warnings from system headers\n\
+ -Wno-system-headers Suppress warnings from system headers\n\
+ -Wall Enable all preprocessor warnings\n", 1936},
+ {"\
-M Generate make dependencies\n\
- -MM As -M, but ignore system header files\n", 1699},
+ -MM As -M, but ignore system header files\n\
+ -MF <file> Write dependency output to the given file\n\
+ -MG Treat missing header file as generated files\n", 1937},
{"\
- -MD As -M, but put output in a .d file\n\
- -MMD As -MD, but ignore system header files\n\
- -MG Treat missing header file as generated files\n\
- -g3 Include #define and #undef directives in the \
-output\n\
- -D<macro> Define a <macro> with string '1' as its value\n\
- -D<macro>=<val> Define a <macro> with <val> as its value\n", 1700},
+ -MP\t\t\t Generate phony targets for all headers\n\
+ -MQ <target> Add a MAKE-quoted target\n\
+ -MT <target> Add an unquoted target\n", 1938},
{"\
+ -D<macro> Define a <macro> with string '1' as its value\n\
+ -D<macro>=<val> Define a <macro> with <val> as its value\n\
-A<question> (<answer>) Assert the <answer> to <question>\n\
-A-<question> (<answer>) Disable the <answer> to <question>\n\
-U<macro> Undefine <macro> \n\
- -v Display the version number\n\
- -H Print the name of header files as they are used\n\
- -C Do not discard comments\n", 1701},
+ -v Display the version number\n", 1939},
{"\
+ -H Print the name of header files as they are used\n\
+ -C Do not discard comments\n\
-dM Display a list of macro definitions active at \
end\n\
-dD Preserve macro definitions in output\n\
-dN As -dD except that only the names are preserved\n\
- -dI Include #include directives in the output\n\
+ -dI Include #include directives in the output\n", 1940},
+ {"\
+ -fpreprocessed Treat the input file as already preprocessed\n\
-ftabstop=<number> Distance between tab stops for column reporting\n\
-P Do not generate #line directives\n\
- -$ Do not allow '$' in identifiers\n", 1702},
- {"\
+ -$ Do not allow '$' in identifiers\n\
-remap Remap file names when including files.\n\
--version Display version information\n\
- -h or --help Display this information\n", 1703},
- {"missing terminating > character", 1704},
- {"trigraph ??%c converted to %c", 1705},
- {"trigraph ??%c ignored", 1706},
- {"'/*' within comment", 1707},
- {"embedded null character ignored", 1708},
- {"%s in preprocessing directive", 1709},
- {"'$' character in identifier", 1710},
- {"multi-line string constant", 1711},
- {"missing terminating %c character", 1712},
- {"possible start of unterminated string literal", 1713},
- {"null characters preserved", 1714},
- {"null character preserved", 1715},
- {"C++ style comments are not allowed in ISO C89", 1716},
- {"(this will be reported only once per input file)", 1717},
- {"comment start split across lines", 1718},
- {"multi-line comment", 1719},
- {"comment start '/*' split across lines", 1720},
- {"unterminated comment", 1721},
- {"comment end '*/' split across lines", 1722},
- {"backslash-newline at end of file", 1723},
- {"backslash and newline separated by space", 1724},
- {"K+R C ignores #\\n with the # indented", 1725},
- {"no newline at end of file", 1726},
- {"invalid preprocessing directive #%s", 1727},
- {"invalid preprocessing directive", 1728},
- {"Unspellable token %s", 1729},
- {"function macro %s must be used with arguments in traditional C", 1730},
- {"unterminated argument list for macro \"%s\"", 1731},
- {"ISO C99 requires rest arguments to be used", 1732},
- {"not enough arguments for macro \"%s\"", 1733},
- {"too many arguments for macro \"%s\"", 1734},
- {"pasting would not give a valid preprocessing token", 1735},
- {"invalid string literal, ignoring final '\\'", 1736},
- {"two tokens pushed in a row", 1737},
- {"directive begins with %s?!", 1738},
- {"macros nested too deep invoking '%s'", 1739},
- {"#%s may not be used inside a macro argument", 1740},
- {"attempt to use poisoned \"%s\"", 1741},
- {"invalid special hash type", 1742},
- {"<command line>", 1743},
- {"traditional C ignores #%s with the # indented", 1744},
- {"suggest hiding #%s from traditional C with an indented #", 1745},
- {"ISO C does not allow #%s", 1746},
- {"# followed by integer", 1747},
- {"\"defined\" cannot be used as a macro name", 1748},
- {"\"%s\" cannot be used as a macro name in C++", 1749},
- {"macro names must be identifiers", 1750},
- {"\"%s\" cannot be used as a macro name", 1751},
- {"junk on line after #undef", 1752},
- {"undefining \"%s\"", 1753},
- {"#%s expects \"FILENAME\" or <FILENAME>", 1754},
- {"empty file name in #%s", 1755},
- {"junk at end of #%s", 1756},
- {"#import is obsolete, use an #ifndef wrapper in the header file", 1757},
- {"#include_next in primary source file", 1758},
- {"invalid format #line", 1759},
- {"token after #line is not a positive integer", 1760},
- {"line number out of range", 1761},
- {"second token after #line is not a string", 1762},
- {"garbage at end of #line", 1763},
- {"invalid #ident", 1764},
- {"unknown #pragma namespace %s", 1765},
- {"#pragma once is obsolete", 1766},
- {"#pragma once outside include file", 1767},
- {"invalid #pragma poison directive", 1768},
- {"poisoning existing macro \"%s\"", 1769},
- {"#pragma system_header outside include file", 1770},
- {"cannot find source %c%s%c", 1771},
- {"current file is older than %c%.*s%c", 1772},
- {"#%s with no argument", 1773},
- {"#%s with invalid argument", 1774},
- {"garbage at end of #%s", 1775},
- {"attempt to use poisoned identifier \"%s\"", 1776},
- {"#else without #if", 1777},
- {"#else after #else", 1778},
- {"the conditional began here", 1779},
- {"#elif without #if", 1780},
- {"#elif after #else", 1781},
- {"#endif without #if", 1782},
- {"ISO C forbids text after #%s", 1783},
- {"unterminated #%s", 1784},
- {"assertion without predicate", 1785},
- {"predicate must be an identifier", 1786},
- {"missing '(' after predicate", 1787},
- {"missing ')' to complete answer", 1788},
- {"predicate's answer is empty", 1789},
- {"junk at end of assertion", 1790},
- {"\"%s\" re-asserted", 1791},
- {"<builtin>", 1792},
- {"#include nested too deep", 1793},
- {"buffer pushed with contexts stacked", 1794},
- {"Invalid option %s", 1795},
- {"malformed #pragma implementation", 1796},
- {"\"%s\" is not a valid option to the preprocessor", 1797},
- {"too many input files", 1798},
- {";; Processing block from %d to %d, %d sets.\n", 1799},
- {"%s:%d: warning: ", 1800},
- {"%s:%d: ", 1801},
- {"%s: warning: ", 1802},
- {"%s: ", 1803},
- {"((anonymous))", 1804},
- {"sorry, not implemented: ", 1805},
- {"In method `%s':", 1806},
- {"In function `%s':", 1807},
- {"Unrecognizable insn:", 1808},
- {"Insn does not satisfy its constraints:", 1809},
- {"\
-Internal compiler error in %s, at %s:%d\n\
-Please submit a full bug report.\n\
-See %s for instructions.", 1810},
- {"DW_LOC_OP %s not implememnted yet.\n", 1811},
- {"internal regno botch: regno = %d\n", 1812},
- {"getpwd", 1813},
- {"\
-Unable to access real part of complex value in a hard register on this target", 1814},
- {"\
-Unable to access imaginary part of complex value in a hard register on this \
-target", 1815},
- {"ICE: emit_insn used where emit_jump_insn needed:\n", 1816},
- {"additional handler after ...", 1817},
- {"Cannot duplicate non-existant exception region.", 1818},
- {"exception handling disabled, use -fexceptions to enable", 1819},
- {"Never issued previous false_label", 1820},
- {"Counted %d copies of EH region %d in list.\n", 1821},
- {"Duplicate call to __builtin_eh_return", 1822},
- {"function uses __builtin_eh_return", 1823},
- {"stack limits not supported on this target", 1824},
- {"function using short complex types cannot be inline", 1825},
- {"unsupported wide integer operation", 1826},
- {"prior parameter's size depends on `%s'", 1827},
- {"returned value in block_exit_expr", 1828},
- {"invalid `asm': %s", 1829},
- {"output_operand: %s", 1830},
- {"operand number missing after %-letter", 1831},
- {"operand number out of range", 1832},
- {"invalid %%-code", 1833},
- {"`%l' operand isn't a label", 1834},
- {"ICE: would have deleted prologue/epilogue insn", 1835},
- {"End insn %d for block %d not found in the insn stream.", 1836},
- {"Insn %d is in multiple basic blocks (%d and %d)", 1837},
- {"Head insn %d for block %d not found in the insn stream.", 1838},
- {"Basic block %i edge lists are corrupted", 1839},
- {"Basic block %d pred edge is corrupted", 1840},
- {"NOTE_INSN_BASIC_BLOCK is missing for block %d", 1841},
- {"NOTE_INSN_BASIC_BLOCK is missing for block %d\n", 1842},
- {"NOTE_INSN_BASIC_BLOCK %d in the middle of basic block %d", 1843},
- {"In basic block %d:", 1844},
- {"Basic blocks not numbered consecutively", 1845},
- {"number of bb notes in insn chain (%d) != n_basic_blocks (%d)", 1846},
- {"comparison is always %d due to width of bitfield", 1847},
- {"comparison is always %d", 1848},
- {"`or' of unmatched not-equal tests is always 1", 1849},
- {"`and' of mutually exclusive equal-tests is always 0", 1850},
- {"`%s' might be used uninitialized in this function", 1851},
- {"variable `%s' might be clobbered by `longjmp' or `vfork'", 1852},
- {"argument `%s' might be clobbered by `longjmp' or `vfork'", 1853},
- {"function returns an aggregate", 1854},
- {"unused parameter `%s'", 1855},
- {"Ambiguous abbreviation %s", 1856},
- {"Incomplete `%s' option", 1857},
- {"Missing argument to `%s' option", 1858},
- {"Extraneous argument to `%s' option", 1859},
- {"Using builtin specs.\n", 1860},
+ -h or --help Display this information\n", 1941},
+ {"trigraph ??%c converted to %c", 1942},
+ {"trigraph ??%c ignored", 1943},
+ {"backslash and newline separated by space", 1944},
+ {"backslash-newline at end of file", 1945},
+ {"\"/*\" within comment", 1946},
+ {"null character(s) ignored", 1947},
+ {"%s in preprocessing directive", 1948},
+ {"'$' character(s) in identifier", 1949},
+ {"attempt to use poisoned \"%s\"", 1950},
+ {"__VA_ARGS__ can only appear in the expansion of a C99 variadic macro", 1951},
+ {"missing terminating %c character", 1952},
+ {"possible start of unterminated string literal", 1953},
+ {"multi-line string literals are deprecated", 1954},
+ {"null character(s) preserved in literal", 1955},
+ {"no newline at end of file", 1956},
+ {"unterminated comment", 1957},
+ {"C++ style comments are not allowed in ISO C89", 1958},
+ {"(this will be reported only once per input file)", 1959},
+ {"multi-line comment", 1960},
+ {"directives may not be used inside a macro argument", 1961},
+ {"Unspellable token %s", 1962},
+ {"extra tokens at end of #%s directive", 1963},
+ {"# followed by integer", 1964},
+ {"suggest not using #elif in traditional C", 1965},
+ {"traditional C ignores #%s with the # indented", 1966},
+ {"suggest hiding #%s from traditional C with an indented #", 1967},
+ {"#%s is a GCC extension", 1968},
+ {"invalid preprocessing directive #%s", 1969},
+ {"no macro name given in #%s directive", 1970},
+ {"\"%s\" cannot be used as a macro name as it is an operator in C++", 1971},
+ {"macro names must be identifiers", 1972},
+ {"\"%s\" cannot be used as a macro name", 1973},
+ {"undefining \"%s\"", 1974},
+ {"missing terminating > character", 1975},
+ {"#%s expects \"FILENAME\" or <FILENAME>", 1976},
+ {"empty file name in #%s", 1977},
+ {"#include nested too deeply", 1978},
+ {"attempt to push file buffer with contexts stacked", 1979},
+ {"#include_next in primary source file", 1980},
+ {"#import is obsolete, use an #ifndef wrapper in the header file", 1981},
+ {"invalid flag \"%s\" in line directive", 1982},
+ {"\"%s\" after #line is not a positive integer", 1983},
+ {"line number out of range", 1984},
+ {"file \"%s\" left but not entered", 1985},
+ {"expected to return to file \"%s\"", 1986},
+ {"expected to return to line number %u", 1987},
+ {"header flags for \"%s\" have changed", 1988},
+ {"\"%s\" is not a valid filename", 1989},
+ {"invalid #ident", 1990},
+ {"unknown #pragma namespace %s", 1991},
+ {"#pragma once is obsolete", 1992},
+ {"#pragma once in main file", 1993},
+ {"invalid #pragma GCC poison directive", 1994},
+ {"poisoning existing macro \"%s\"", 1995},
+ {"#pragma system_header ignored outside include file", 1996},
+ {"cannot find source %s", 1997},
+ {"current file is older than %s", 1998},
+ {"_Pragma takes a parenthesized string literal", 1999},
+ {"#else without #if", 2000},
+ {"#else after #else", 2001},
+ {"the conditional began here", 2002},
+ {"#elif without #if", 2003},
+ {"#elif after #else", 2004},
+ {"#endif without #if", 2005},
+ {"missing '(' after predicate", 2006},
+ {"missing ')' to complete answer", 2007},
+ {"predicate's answer is empty", 2008},
+ {"assertion without predicate", 2009},
+ {"predicate must be an identifier", 2010},
+ {"\"%s\" re-asserted", 2011},
+ {"<builtin>", 2012},
+ {"<command line>", 2013},
+ {"<stdin>", 2014},
+ {"unterminated #%s", 2015},
+ {"file \"%s\" entered but not left", 2016},
+ {"invalid builtin macro \"%s\"", 2017},
+ {"invalid string literal, ignoring final '\\'", 2018},
+ {"pasting \"%s\" and \"%s\" does not give a valid preprocessing token", 2019},
+ {"unterminated argument list invoking macro \"%s\"", 2020},
+ {"ISO C99 requires rest arguments to be used", 2021},
+ {"macro \"%s\" requires %u arguments, but only %u given", 2022},
+ {"macro \"%s\" passed %u arguments, but takes just %u", 2023},
+ {"function-like macro \"%s\" must be used with arguments in traditional C", 2024},
+ {"duplicate macro parameter \"%s\"", 2025},
+ {"\"%s\" may not appear in macro parameter list", 2026},
+ {"macro parameters must be comma-separated", 2027},
+ {"parameter name missing", 2028},
+ {"anonymous variadic macros were introduced in C99", 2029},
+ {"ISO C does not permit named variadic macros", 2030},
+ {"missing ')' in macro parameter list", 2031},
+ {"ISO C requires whitespace after the macro name", 2032},
+ {"'#' is not followed by a macro parameter", 2033},
+ {"'##' cannot appear at either end of a macro expansion", 2034},
+ {"\"%s\" redefined", 2035},
+ {"this is the location of the previous definition", 2036},
+ {"macro argument \"%s\" would be stringified with -traditional.", 2037},
+ {"invalid hash type %d in dump_definition", 2038},
+ {"Invalid option %s", 2039},
+ {"\"%s\" is not a valid option to the preprocessor", 2040},
+ {"too many input files", 2041},
+ {";; Processing block from %d to %d, %d sets.\n", 2042},
+ {"%s:%d: warning: ", 2043},
+ {"%s: warning: ", 2044},
+ {"((anonymous))", 2045},
+ {"%s: warnings being treated as errors\n", 2046},
+ {"%s: %s: ", 2047},
+ {"sorry, not implemented: ", 2048},
+ {"%s ", 2049},
+ {" %s", 2050},
+ {"At top level:", 2051},
+ {"In method `%s':", 2052},
+ {"In function `%s':", 2053},
+ {"compilation terminated.\n", 2054},
+ {"%s:%d: confused by earlier errors, bailing out\n", 2055},
+ {"\
+Please submit a full bug report,\n\
+with preprocessed source if appropriate.\n\
+See %s for instructions.\n", 2056},
+ {"Unrecognizable insn:", 2057},
+ {"Insn does not satisfy its constraints:", 2058},
+ {"Internal compiler error: Error reporting routines re-entered.\n", 2059},
+ {"Internal compiler error in %s, at %s:%d", 2060},
+ {"In file included from %s:%d", 2061},
+ {"\
+,\n\
+ from %s:%d", 2062},
+ {":\n", 2063},
+ {"DW_LOC_OP %s not implememnted\n", 2064},
+ {"internal regno botch: regno = %d\n", 2065},
+ {"can't get current directory", 2066},
+ {"Can't access real part of complex value in hard register", 2067},
+ {"can't access imaginary part of complex value in hard register", 2068},
+ {"ICE: emit_insn used where emit_jump_insn needed:\n", 2069},
+ {"abort in %s, at %s:%d", 2070},
+ {"exception handling disabled, use -fexceptions to enable", 2071},
+ {"argument of `__builtin_eh_return_regno' must be constant", 2072},
+ {"__builtin_eh_return not supported on this target", 2073},
+ {"stack limits not supported on this target", 2074},
+ {"function using short complex types cannot be inline", 2075},
+ {"unsupported wide integer operation", 2076},
+ {"prior parameter's size depends on `%s'", 2077},
+ {"returned value in block_exit_expr", 2078},
+ {"no INTEGER type can hold a pointer on this configuration", 2079},
+ {"configuration: REAL, INTEGER, and LOGICAL are %d bits wide,", 2080},
+ {"and pointers are %d bits wide, but g77 doesn't yet work", 2081},
+ {"properly unless they all are 32 bits wide.", 2082},
+ {"Please keep this in mind before you report bugs. g77 should", 2083},
+ {"support non-32-bit machines better as of version 0.6.", 2084},
+ {"configuration: char * holds %d bits, but ftnlen only %d", 2085},
+ {"\
+configuration: char * holds %d bits, but INTEGER only %d --\n\
+ ASSIGN statement might fail", 2086},
+ {"Directory name must immediately follow -I", 2087},
+ {"overflowed output arg list for `%s'", 2088},
+ {"--driver no longer supported", 2089},
+ {"argument to `%s' missing", 2090},
+ {"No input files; unwilling to write output files", 2091},
+ {"Print g77-specific compiler version info, run internal tests", 2092},
+ {"Program is written in typical FORTRAN 66 dialect", 2093},
+ {"Program is written in typical Unix f77 dialect", 2094},
+ {"Program does not use Unix-f77 dialectal features", 2095},
+ {"Program is written in Fortran-90-ish dialect", 2096},
+ {"\
+Treat local vars and COMMON blocks as if they were named in SAVE statements", 2097},
+ {"Allow $ in symbol names", 2098},
+ {"f2c-compatible code need not be generated", 2099},
+ {"Unsupported; do not generate libf2c-calling code", 2100},
+ {"Unsupported; affects code-generation of arrays", 2101},
+ {"Program is written in Fortran-90-ish free form", 2102},
+ {"Warn about use of (only a few for now) Fortran extensions", 2103},
+ {"Program is written in VXT (Digital-like) FORTRAN", 2104},
+ {"Disallow all ugly features", 2105},
+ {"Hollerith and typeless constants not passed as arguments", 2106},
+ {"Allow ordinary copying of ASSIGN'ed vars", 2107},
+ {"Dummy array dimensioned to (1) is assumed-size", 2108},
+ {"Trailing comma in procedure call denotes null argument", 2109},
+ {"Allow REAL(Z) and AIMAG(Z) given DOUBLE COMPLEX Z", 2110},
+ {"Initialization via DATA and PARAMETER is type-compatible", 2111},
+ {"Allow INTEGER and LOGICAL interchangeability", 2112},
+ {"Print internal debugging-related info", 2113},
+ {"Initialize local vars and arrays to zero", 2114},
+ {"Backslashes in character/hollerith constants not special (C-style)", 2115},
+ {"Have front end emulate COMPLEX arithmetic to avoid bugs", 2116},
+ {"Disable the appending of underscores to externals", 2117},
+ {"Never append a second underscore to externals", 2118},
+ {"Intrinsics spelled as e.g. SqRt", 2119},
+ {"Intrinsics in uppercase", 2120},
+ {"Intrinsics letters in arbitrary cases", 2121},
+ {"Language keywords spelled as e.g. IOStat", 2122},
+ {"Language keywords in uppercase", 2123},
+ {"Language keyword letters in arbitrary cases", 2124},
+ {"Internally convert most source to uppercase", 2125},
+ {"Internally preserve source case", 2126},
+ {"Symbol names spelled in mixed case", 2127},
+ {"Symbol names in uppercase", 2128},
+ {"Symbol names in lowercase", 2129},
+ {"Program written in uppercase", 2130},
+ {"Program written in lowercase", 2131},
+ {"Program written in strict mixed-case", 2132},
+ {"Compile as if program written in uppercase", 2133},
+ {"Compile as if program written in lowercase", 2134},
+ {"Preserve all spelling (case) used in program", 2135},
+ {"Delete libU77 intrinsics with bad interfaces", 2136},
+ {"Disable libU77 intrinsics with bad interfaces", 2137},
+ {"Hide libU77 intrinsics with bad interfaces", 2138},
+ {"Delete non-FORTRAN-77 intrinsics f2c supports", 2139},
+ {"Disable non-FORTRAN-77 intrinsics f2c supports", 2140},
+ {"Hide non-FORTRAN-77 intrinsics f2c supports", 2141},
+ {"Delete non-FORTRAN-77 intrinsics F90 supports", 2142},
+ {"Disable non-FORTRAN-77 intrinsics F90 supports", 2143},
+ {"Hide non-FORTRAN-77 intrinsics F90 supports", 2144},
+ {"Delete non-FORTRAN-77 intrinsics g77 supports", 2145},
+ {"Disable non-FORTRAN 77 intrinsics F90 supports", 2146},
+ {"Hide non-FORTRAN 77 intrinsics F90 supports", 2147},
+ {"Delete MIL-STD 1753 intrinsics", 2148},
+ {"Disable MIL-STD 1753 intrinsics", 2149},
+ {"Hide MIL-STD 1753 intrinsics", 2150},
+ {"Delete libU77 intrinsics", 2151},
+ {"Disable libU77 intrinsics", 2152},
+ {"Hide libU77 intrinsics", 2153},
+ {"Delete non-FORTRAN-77 intrinsics VXT FORTRAN supports", 2154},
+ {"Disable non-FORTRAN-77 intrinsics VXT FORTRAN supports", 2155},
+ {"Hide non-FORTRAN-77 intrinsics VXT FORTRAN supports", 2156},
+ {"Treat initial values of 0 like non-zero values", 2157},
+ {"\
+Emit special debugging information for COMMON and EQUIVALENCE (disabled)", 2158},
+ {"Take at least one trip through each iterative DO loop", 2159},
+ {"Print names of program units as they are compiled", 2160},
+ {"Disable fatal diagnostics about inter-procedural problems", 2161},
+ {"Make prefix-radix non-decimal constants be typeless", 2162},
+ {"Generate code to check subscript and substring bounds", 2163},
+ {"Fortran-specific form of -fbounds-check", 2164},
+ {"Disable warnings about inter-procedural problems", 2165},
+ {"Warn about constructs with surprising meanings", 2166},
+ {"Add a directory for INCLUDE searching", 2167},
+ {"Set the maximum line length", 2168},
+ {"the meaning of `\\a' varies with -traditional", 2169},
+ {"non-ANSI-standard escape sequence, `\\%c'", 2170},
+ {"non-ANSI escape sequence `\\%c'", 2171},
+ {"unknown escape sequence `\\%c'", 2172},
+ {"unknown escape sequence: `\\' followed by char code 0x%x", 2173},
+ {"Badly formed directive -- no closing quote", 2174},
+ {"#-lines for entering and leaving files don't match", 2175},
+ {"Bad directive -- missing close-quote", 2176},
+ {"ignoring pragma: %s", 2177},
+ {"undefined or invalid # directive", 2178},
+ {"invalid #line", 2179},
+ {"Use `#line ...' instead of `# ...' in first line", 2180},
+ {"invalid #-line", 2181},
+ {"ASSIGNed FORMAT specifier is too small", 2182},
+ {"ASSIGN to variable that is too small", 2183},
+ {"ASSIGNed GOTO target variable is too small", 2184},
+ {"%s no longer supported -- try -fvxt", 2185},
+ {"%s no longer supported -- try -fno-vxt -ff90", 2186},
+ {"%s disabled, use normal debugging flags", 2187},
+ {"invalid `asm': %s", 2188},
+ {"output_operand: %s", 2189},
+ {"operand number missing after %-letter", 2190},
+ {"operand number out of range", 2191},
+ {"invalid %%-code", 2192},
+ {"`%l' operand isn't a label", 2193},
+ {"function might be possible candidate for attribute `noreturn'", 2194},
+ {"`noreturn' function does return", 2195},
+ {"control reaches end of non-void function", 2196},
+ {"End insn %d for block %d not found in the insn stream.", 2197},
+ {"Insn %d is in multiple basic blocks (%d and %d)", 2198},
+ {"Head insn %d for block %d not found in the insn stream.", 2199},
+ {"Basic block %i edge lists are corrupted", 2200},
+ {"Basic block %d pred edge is corrupted", 2201},
+ {"NOTE_INSN_BASIC_BLOCK is missing for block %d", 2202},
+ {"NOTE_INSN_BASIC_BLOCK is missing for block %d\n", 2203},
+ {"NOTE_INSN_BASIC_BLOCK %d in the middle of basic block %d", 2204},
+ {"In basic block %d:", 2205},
+ {"number of bb notes in insn chain (%d) != n_basic_blocks (%d)", 2206},
+ {"comparison is always %d due to width of bitfield", 2207},
+ {"comparison is always %d", 2208},
+ {"`or' of unmatched not-equal tests is always 1", 2209},
+ {"`and' of mutually exclusive equal-tests is always 0", 2210},
+ {"`%s' might be used uninitialized in this function", 2211},
+ {"variable `%s' might be clobbered by `longjmp' or `vfork'", 2212},
+ {"argument `%s' might be clobbered by `longjmp' or `vfork'", 2213},
+ {"function returns an aggregate", 2214},
+ {"unused parameter `%s'", 2215},
+ {"Ambiguous abbreviation %s", 2216},
+ {"Incomplete `%s' option", 2217},
+ {"Missing argument to `%s' option", 2218},
+ {"Extraneous argument to `%s' option", 2219},
+ {"Using builtin specs.\n", 2220},
{"\
Setting spec %s to '%s'\n\
-\n", 1861},
- {"Reading specs from %s\n", 1862},
- {"specs %%include syntax malformed after %ld characters", 1863},
- {"Could not find specs file %s\n", 1864},
- {"specs %%rename syntax malformed after %ld characters", 1865},
- {"specs %s spec was not found to be renamed", 1866},
- {"rename spec %s to %s\n", 1867},
+\n", 2221},
+ {"Reading specs from %s\n", 2222},
+ {"specs %%include syntax malformed after %ld characters", 2223},
+ {"Could not find specs file %s\n", 2224},
+ {"specs %%rename syntax malformed after %ld characters", 2225},
+ {"specs %s spec was not found to be renamed", 2226},
+ {"rename spec %s to %s\n", 2227},
{"\
spec is '%s'\n\
-\n", 1868},
- {"specs unknown %% command after %ld characters", 1869},
- {"specs file malformed after %ld characters", 1870},
- {"spec file has no spec for linking", 1871},
- {"-pipe not supported", 1872},
+\n", 2228},
+ {"specs unknown %% command after %ld characters", 2229},
+ {"specs file malformed after %ld characters", 2230},
+ {"spec file has no spec for linking", 2231},
+ {"-pipe not supported", 2232},
{"\
\n\
-Go ahead? (y or n) ", 1873},
+Go ahead? (y or n) ", 2233},
{"\
Internal error: %s (program %s)\n\
Please submit a full bug report.\n\
-See %s for instructions.", 1874},
- {"# %s %.2f %.2f\n", 1875},
- {"Usage: %s [options] file...\n", 1876},
- {"Options:\n", 1877},
- {" -pass-exit-codes Exit with highest error code from a phase\n", 1878},
- {" --help Display this information\n", 1879},
- {" (Use '-v --help' to display command line options of sub-processes)\n", 1880},
- {" -dumpspecs Display all of the built in spec strings\n", 1881},
- {" -dumpversion Display the version of the compiler\n", 1882},
- {" -dumpmachine Display the compiler's target processor\n", 1883},
+See %s for instructions.", 2234},
+ {"# %s %.2f %.2f\n", 2235},
+ {"Usage: %s [options] file...\n", 2236},
+ {"Options:\n", 2237},
+ {" -pass-exit-codes Exit with highest error code from a phase\n", 2238},
+ {" --help Display this information\n", 2239},
+ {"\
+ --target-help Display target specific command line options\n", 2240},
+ {" (Use '-v --help' to display command line options of sub-processes)\n", 2241},
+ {" -dumpspecs Display all of the built in spec strings\n", 2242},
+ {" -dumpversion Display the version of the compiler\n", 2243},
+ {" -dumpmachine Display the compiler's target processor\n", 2244},
{"\
-print-search-dirs Display the directories in the compiler's search \
-path\n", 1884},
+path\n", 2245},
{"\
-print-libgcc-file-name Display the name of the compiler's companion \
-library\n", 1885},
- {" -print-file-name=<lib> Display the full path to library <lib>\n", 1886},
+library\n", 2246},
+ {" -print-file-name=<lib> Display the full path to library <lib>\n", 2247},
{"\
-print-prog-name=<prog> Display the full path to compiler component \
-<prog>\n", 1887},
+<prog>\n", 2248},
{"\
-print-multi-directory Display the root directory for versions of \
-libgcc\n", 1888},
+libgcc\n", 2249},
{"\
-print-multi-lib Display the mapping between command line options \
and\n\
- multiple library search directories\n", 1889},
+ multiple library search directories\n", 2250},
{"\
-Wa,<options> Pass comma-separated <options> on to the \
-assembler\n", 1890},
+assembler\n", 2251},
{"\
-Wp,<options> Pass comma-separated <options> on to the \
-preprocessor\n", 1891},
+preprocessor\n", 2252},
{"\
- -Wl,<options> Pass comma-separated <options> on to the linker\n", 1892},
- {" -Xlinker <arg> Pass <arg> on to the linker\n", 1893},
- {" -save-temps Do not delete intermediate files\n", 1894},
- {" -pipe Use pipes rather than intermediate files\n", 1895},
- {" -time Time the execution of each subprocess\n", 1896},
+ -Wl,<options> Pass comma-separated <options> on to the linker\n", 2253},
+ {" -Xlinker <arg> Pass <arg> on to the linker\n", 2254},
+ {" -save-temps Do not delete intermediate files\n", 2255},
+ {" -pipe Use pipes rather than intermediate files\n", 2256},
+ {" -time Time the execution of each subprocess\n", 2257},
{"\
-specs=<file> Override builtin specs with the contents of \
-<file>\n", 1897},
+<file>\n", 2258},
{"\
- -std=<standard> Assume that the input sources are for <standard>\n", 1898},
+ -std=<standard> Assume that the input sources are for <standard>\n", 2259},
{"\
- -B <directory> Add <directory> to the compiler's search paths\n", 1899},
- {" -b <machine> Run gcc for target <machine>, if installed\n", 1900},
+ -B <directory> Add <directory> to the compiler's search paths\n", 2260},
+ {" -b <machine> Run gcc for target <machine>, if installed\n", 2261},
{"\
- -V <version> Run gcc version number <version>, if installed\n", 1901},
+ -V <version> Run gcc version number <version>, if installed\n", 2262},
{"\
- -v Display the programs invoked by the compiler\n", 1902},
+ -v Display the programs invoked by the compiler\n", 2263},
{"\
-E Preprocess only; do not compile, assemble or \
-link\n", 1903},
- {" -S Compile only; do not assemble or link\n", 1904},
- {" -c Compile and assemble, but do not link\n", 1905},
- {" -o <file> Place the output into <file>\n", 1906},
+link\n", 2264},
+ {" -S Compile only; do not assemble or link\n", 2265},
+ {" -c Compile and assemble, but do not link\n", 2266},
+ {" -o <file> Place the output into <file>\n", 2267},
{"\
-x <language> Specify the language of the following input \
files\n\
@@ -2108,512 +2479,867 @@ files\n\
none\n\
'none' means revert to the default behaviour of\n\
guessing the language based on the file's \
-extension\n", 1907},
+extension\n", 2268},
{"\
\n\
-Options starting with -g, -f, -m, -O or -W are automatically passed on to\n\
-the various sub-processes invoked by %s. In order to pass other options\n\
-on to these processes the -W<letter> options must be used.\n", 1908},
- {"argument to `-Xlinker' is missing", 1909},
- {"argument to `-specs' is missing", 1910},
- {"argument to `-specs=' is missing", 1911},
- {"argument to `-b' is missing", 1912},
- {"argument to `-B' is missing", 1913},
- {"argument to `-V' is missing", 1914},
- {"invalid version number format", 1915},
- {"cannot specify -o with -c or -S and multiple compilations", 1916},
- {"Warning: -pipe ignored since -save-temps specified", 1917},
- {"Warning: -pipe ignored since -time specified", 1918},
- {"argument to `-x' is missing", 1919},
- {"argument to `-%s' is missing", 1920},
- {"Warning: `-x %s' after last input file has no effect", 1921},
- {"Invalid specification! Bug in cc.", 1922},
- {"Spec failure: '%%*' has not been initialised by pattern match", 1923},
- {"Warning: use of obsolete %%[ operator in specs", 1924},
- {"Processing spec %c%s%c, which is '%s'\n", 1925},
- {"Spec failure: Unrecognised spec option '%c'", 1926},
- {"unrecognized option `-%s'", 1927},
- {"install: %s%s\n", 1928},
- {"programs: %s\n", 1929},
- {"libraries: %s\n", 1930},
+Options starting with -g, -f, -m, -O, -W, or --param are automatically\n\
+ passed on to the various sub-processes invoked by %s. In order to pass\n\
+ other options on to these processes the -W<letter> options must be used.\n", 2269},
+ {"argument to `-Xlinker' is missing", 2270},
+ {"argument to `-specs' is missing", 2271},
+ {"argument to `-specs=' is missing", 2272},
+ {"argument to `-b' is missing", 2273},
+ {"argument to `-B' is missing", 2274},
+ {"argument to `-V' is missing", 2275},
+ {"invalid version number format", 2276},
+ {"cannot specify -o with -c or -S and multiple compilations", 2277},
+ {"Warning: -pipe ignored because -save-temps specified", 2278},
+ {"Warning: -pipe ignored because -time specified", 2279},
+ {"argument to `-x' is missing", 2280},
+ {"argument to `-%s' is missing", 2281},
+ {"Warning: `-x %s' after last input file has no effect", 2282},
+ {"Invalid specification! Bug in cc.", 2283},
+ {"%s\n", 2284},
+ {"Spec failure: '%%*' has not been initialised by pattern match", 2285},
+ {"Warning: use of obsolete %%[ operator in specs", 2286},
+ {"Processing spec %c%s%c, which is '%s'\n", 2287},
+ {"Spec failure: Unrecognised spec option '%c'", 2288},
+ {"unrecognized option `-%s'", 2289},
+ {"install: %s%s\n", 2290},
+ {"programs: %s\n", 2291},
+ {"libraries: %s\n", 2292},
{"\
\n\
-For bug reporting instructions, please see:\n", 1931},
- {"gcc version %s\n", 1932},
- {"gcc driver version %s executing gcc version %s\n", 1933},
- {"No input files", 1934},
- {"%s: %s compiler not installed on this system", 1935},
- {"%s: linker input file unused since linking not done", 1936},
- {"language %s not recognized", 1937},
- {"Internal gcov abort.\n", 1938},
- {"gcov [-b] [-v] [-n] [-l] [-f] [-o OBJDIR] file\n", 1939},
- {"Could not open basic block file %s.\n", 1940},
- {"Could not open data file %s.\n", 1941},
- {"Assuming that all execution counts are zero.\n", 1942},
- {"Could not open program flow graph file %s.\n", 1943},
- {"No executable code associated with file %s.\n", 1944},
- {".da file contents exhausted too early\n", 1945},
- {".da file contents not exhausted\n", 1946},
- {"%6.2f%% of %d source lines executed in function %s\n", 1947},
- {"No executable source lines in function %s\n", 1948},
- {"%6.2f%% of %d branches executed in function %s\n", 1949},
- {"%6.2f%% of %d branches taken at least once in function %s\n", 1950},
- {"No branches in function %s\n", 1951},
- {"%6.2f%% of %d calls executed in function %s\n", 1952},
- {"No calls in function %s\n", 1953},
- {"didn't use all bb entries of graph, function %s\n", 1954},
- {"block_num = %ld, num_blocks = %d\n", 1955},
- {"ERROR: too many basic blocks in .bb file %s\n", 1956},
- {"%6.2f%% of %d source lines executed in file %s\n", 1957},
- {"No executable source lines in file %s\n", 1958},
- {"%6.2f%% of %d branches executed in file %s\n", 1959},
- {"%6.2f%% of %d branches taken at least once in file %s\n", 1960},
- {"No branches in file %s\n", 1961},
- {"%6.2f%% of %d calls executed in file %s\n", 1962},
- {"No calls in file %s\n", 1963},
- {"Could not open source file %s.\n", 1964},
- {"Could not open output file %s.\n", 1965},
- {"Creating %s.\n", 1966},
- {"call %d never executed\n", 1967},
- {"call %d returns = %d\n", 1968},
- {"call %d returns = %d%%\n", 1969},
- {"branch %d never executed\n", 1970},
- {"branch %d taken = %d\n", 1971},
- {"branch %d taken = %d%%\n", 1972},
- {"Unexpected EOF while reading source file %s.\n", 1973},
- {"%s: option `%s' is ambiguous\n", 1974},
- {"%s: option `--%s' doesn't allow an argument\n", 1975},
- {"%s: option `%c%s' doesn't allow an argument\n", 1976},
- {"%s: option `%s' requires an argument\n", 1977},
- {"%s: unrecognized option `--%s'\n", 1978},
- {"%s: unrecognized option `%c%s'\n", 1979},
- {"%s: illegal option -- %c\n", 1980},
- {"%s: invalid option -- %c\n", 1981},
- {"%s: option requires an argument -- %c\n", 1982},
- {"%s: option `-W %s' is ambiguous\n", 1983},
- {"%s: option `-W %s' doesn't allow an argument\n", 1984},
- {"fix_sched_param: unknown param: %s", 1985},
- {"no memory", 1986},
- {"varargs function cannot be inline", 1987},
- {"function using alloca cannot be inline", 1988},
- {"function using setjmp cannot be inline", 1989},
- {"function with nested functions cannot be inline", 1990},
- {"function with label addresses used in initializers cannot inline", 1991},
- {"function too large to be inline", 1992},
- {"no prototype, and parameter address used; cannot be inline", 1993},
- {"inline functions not supported for this return value type", 1994},
- {"function with varying-size return value cannot be inline", 1995},
- {"function with varying-size parameter cannot be inline", 1996},
- {"function with transparent unit parameter cannot be inline", 1997},
- {"function with computed jump cannot inline", 1998},
- {"function with nonlocal goto cannot be inline", 1999},
- {"function with complex parameters cannot be inline", 2000},
- {"function with target specific attribute(s) cannot be inlined", 2001},
- {"Objective-C text in C source file", 2002},
- {"no class name specified as argument to -fconstant-string-class", 2003},
- {"object does not conform to the `%s' protocol", 2004},
- {"class `%s' does not implement the `%s' protocol", 2005},
- {"`%s' cannot be statically allocated", 2006},
- {"statically allocated objects not supported", 2007},
- {"Unexpected type for `id' (%s)", 2008},
- {"Undefined type `id', please import <objc/objc.h>", 2009},
- {"Cannot find protocol declaration for `%s'", 2010},
- {"Cannot find interface declaration for `%s'", 2011},
- {"Cannot find class `%s'", 2012},
- {"Class `%s' already exists", 2013},
- {"Cannot find interface declaration for `%s', superclass of `%s'", 2014},
- {"Circular inheritance in interface declaration for `%s'", 2015},
- {"inconsistent instance variable specification", 2016},
- {"multiple declarations for method `%s'", 2017},
- {"invalid receiver type `%s'", 2018},
- {"`%s' does not respond to `%s'", 2019},
- {"no super class declared in interface for `%s'", 2020},
- {"cannot find class (factory) method.", 2021},
- {"return type for `%s' defaults to id", 2022},
- {"method `%s' not implemented by protocol.", 2023},
- {"return type defaults to id", 2024},
- {"cannot find method.", 2025},
- {"instance variable `%s' accessed in class method", 2026},
- {"duplicate definition of class method `%s'.", 2027},
- {"duplicate declaration of class method `%s'.", 2028},
- {"duplicate definition of instance method `%s'.", 2029},
- {"duplicate declaration of instance method `%s'.", 2030},
- {"duplicate interface declaration for category `%s(%s)'", 2031},
- {"instance variable `%s' is declared private", 2032},
- {"instance variable `%s' is declared %s", 2033},
- {"static access to object of type `id'", 2034},
- {"incomplete implementation of class `%s'", 2035},
- {"incomplete implementation of category `%s'", 2036},
- {"method definition for `%c%s' not found", 2037},
- {"%s `%s' does not fully implement the `%s' protocol", 2038},
- {"reimplementation of class `%s'", 2039},
- {"conflicting super class name `%s'", 2040},
- {"duplicate interface declaration for class `%s'", 2041},
- {"duplicate declaration for protocol `%s'", 2042},
- {"[super ...] must appear in a method context", 2043},
- {"potential selector conflict for method `%s'", 2044},
- {"`@end' must appear in an implementation context", 2045},
- {"method definition not in class context", 2046},
- {"Arc profiling: some edge counts were bad.", 2047},
- {"file %s not found, execution counts assumed to be zero.", 2048},
- {"%s: internal abort\n", 2049},
- {"%s: error writing file `%s': %s\n", 2050},
- {"%s: usage '%s [ -VqfnkN ] [ -i <istring> ] [ filename ... ]'\n", 2051},
- {"%s: usage '%s [ -VqfnkNlgC ] [ -B <dirname> ] [ filename ... ]'\n", 2052},
- {"%s: warning: no read access for file `%s'\n", 2053},
- {"%s: warning: no write access for file `%s'\n", 2054},
- {"%s: warning: no write access for dir containing `%s'\n", 2055},
- {"%s: invalid file name: %s\n", 2056},
- {"%s: %s: can't get status: %s\n", 2057},
+For bug reporting instructions, please see:\n", 2293},
+ {"Configured with: %s\n", 2294},
+ {"Thread model: %s\n", 2295},
+ {"gcc version %s\n", 2296},
+ {"gcc driver version %s executing gcc version %s\n", 2297},
+ {"No input files", 2298},
+ {"%s: %s compiler not installed on this system", 2299},
+ {"%s: linker input file unused because linking not done", 2300},
+ {"language %s not recognized", 2301},
+ {"Internal gcc abort.", 2302},
+ {"Internal gcov abort.\n", 2303},
+ {"gcov [-b] [-v] [-n] [-l] [-f] [-o OBJDIR] file\n", 2304},
+ {"Could not open basic block file %s.\n", 2305},
+ {"Could not open data file %s.\n", 2306},
+ {"Assuming that all execution counts are zero.\n", 2307},
+ {"Could not open program flow graph file %s.\n", 2308},
+ {"No executable code associated with file %s.\n", 2309},
+ {".da file contents exhausted too early\n", 2310},
+ {".da file contents not exhausted\n", 2311},
+ {"%6.2f%% of %d source lines executed in function %s\n", 2312},
+ {"No executable source lines in function %s\n", 2313},
+ {"%6.2f%% of %d branches executed in function %s\n", 2314},
+ {"%6.2f%% of %d branches taken at least once in function %s\n", 2315},
+ {"No branches in function %s\n", 2316},
+ {"%6.2f%% of %d calls executed in function %s\n", 2317},
+ {"No calls in function %s\n", 2318},
+ {"didn't use all bb entries of graph, function %s\n", 2319},
+ {"block_num = %ld, num_blocks = %d\n", 2320},
+ {"ERROR: too many basic blocks in .bb file %s\n", 2321},
+ {"%6.2f%% of %d source lines executed in file %s\n", 2322},
+ {"No executable source lines in file %s\n", 2323},
+ {"%6.2f%% of %d branches executed in file %s\n", 2324},
+ {"%6.2f%% of %d branches taken at least once in file %s\n", 2325},
+ {"No branches in file %s\n", 2326},
+ {"%6.2f%% of %d calls executed in file %s\n", 2327},
+ {"No calls in file %s\n", 2328},
+ {"Could not open source file %s.\n", 2329},
+ {"Could not open output file %s.\n", 2330},
+ {"Creating %s.\n", 2331},
+ {"call %d never executed\n", 2332},
+ {"call %d returns = %d\n", 2333},
+ {"call %d returns = %d%%\n", 2334},
+ {"branch %d never executed\n", 2335},
+ {"branch %d taken = %d\n", 2336},
+ {"branch %d taken = %d%%\n", 2337},
+ {"Unexpected EOF while reading source file %s.\n", 2338},
+ {"GCSE disabled: %d > 1000 basic blocks and %d >= 20 edges/basic block", 2339},
+ {"GCSE disabled: %d basic blocks and %d registers", 2340},
+ {"fix_sched_param: unknown param: %s", 2341},
+ {"function cannot be inline", 2342},
+ {"varargs function cannot be inline", 2343},
+ {"function using alloca cannot be inline", 2344},
+ {"function using setjmp cannot be inline", 2345},
+ {"function uses __builtin_eh_return", 2346},
+ {"function with nested functions cannot be inline", 2347},
+ {"function with label addresses used in initializers cannot inline", 2348},
+ {"function too large to be inline", 2349},
+ {"no prototype, and parameter address used; cannot be inline", 2350},
+ {"inline functions not supported for this return value type", 2351},
+ {"function with varying-size return value cannot be inline", 2352},
+ {"function with varying-size parameter cannot be inline", 2353},
+ {"function with transparent unit parameter cannot be inline", 2354},
+ {"function with computed jump cannot inline", 2355},
+ {"function with nonlocal goto cannot be inline", 2356},
+ {"function with target specific attribute(s) cannot be inlined", 2357},
+ {"internal error in check-init: tree code not implemented: %s", 2358},
+ {"internal error - too many interface type", 2359},
+ {"bad method signature", 2360},
+ {"misplaced ConstantValue attribute (not in any field)", 2361},
+ {"duplicate ConstanValue atribute for field '%s'", 2362},
+ {"field '%s' not found in class", 2363},
+ {"abstract method in non-abstract class", 2364},
+ {"non-static method '%s' overrides static method", 2365},
+ {"In %s: overlapped variable and exception ranges at %d", 2366},
+ {"bad type in parameter debug info", 2367},
+ {"bad PC range for debug info for local `%s'", 2368},
+ {"stack underflow - dup* operation", 2369},
+ {"\
+reference `%s' is ambiguous: appears in interface `%s' and interface `%s'", 2370},
+ {"field `%s' not found", 2371},
+ {"ret instruction not implemented", 2372},
+ {"method '%s' not found in class", 2373},
+ {"failed to find class '%s'", 2374},
+ {"Class '%s' has no method named '%s' matching signature '%s'", 2375},
+ {"invokestatic on non static method", 2376},
+ {"invokestatic on abstract method", 2377},
+ {"invoke[non-static] on static method", 2378},
+ {"Missing field '%s' in '%s'", 2379},
+ {"Mismatching signature for field '%s' in '%s'", 2380},
+ {"assignment to final field `%s' not in field's class", 2381},
+ {"assignment to final static field `%s' not in class initializer", 2382},
+ {"assignment to final field `%s' not in constructor", 2383},
+ {"Can't expand %s", 2384},
+ {"invalid PC in line number table", 2385},
+ {"Unreachable bytecode from %d to before %d.", 2386},
+ {"Unreachable bytecode from %d to the end of the method.", 2387},
+ {"unrecogized wide sub-instruction", 2388},
+ {"\
+Source file for class `%s' is newer than its matching class file. Source \
+file used instead", 2389},
+ {"bad string constant", 2390},
+ {"bad value constant type %d, index %d", 2391},
+ {"can't reopen %s", 2392},
+ {"Cannot find file for class %s.", 2393},
+ {"not a valid Java .class file", 2394},
+ {"error while parsing constant pool", 2395},
+ {"error in constant pool entry #%d\n", 2396},
+ {"reading class %s for the second time from %s", 2397},
+ {"error while parsing fields", 2398},
+ {"error while parsing methods", 2399},
+ {"error while parsing final attributes", 2400},
+ {"\
+The `java.lang.Object' that was found in `%s' didn't have the special zero-\
+length `gnu.gcj.gcj-compiled' attribute. This generally means that your \
+classpath is incorrect set. Use `info gcj \"Input Options\"' to see the info \
+page describing how to set the classpath.", 2401},
+ {"missing Code attribute", 2402},
+ {"error closing %s", 2403},
+ {"source file seen twice on command line and will be compiled only once.", 2404},
+ {"no input file specified", 2405},
+ {"can't close input file %s", 2406},
+ {"Premature end of input file %s", 2407},
+ {"bad zip/jar file %s", 2408},
+ {"\
+internal error in generate_bytecode_insn - tree code not implemented: %s", 2409},
+ {"can't create directory %s", 2410},
+ {"can't to open %s", 2411},
+ {"Only one of `--print-main', `--list-class', and `--complexity' allowed", 2412},
+ {"Can't open output file `%s'", 2413},
+ {"File not found `%s'", 2414},
+ {"can't specify `-D' without `--main'\n", 2415},
+ {"Warning: already-compiled .class files ignored with -C", 2416},
+ {"cannot specify both -C and -o", 2417},
+ {"cannot create temporary file", 2418},
+ {"using both @FILE with multiple files not implemented", 2419},
+ {"cannot specify `main' class when not linking", 2420},
+ {"Disable automatic array bounds checking", 2421},
+ {"Make is_compiled_class return 1", 2422},
+ {"Dump class files to <name>.class", 2423},
+ {"input file is list of file names to compile", 2424},
+ {"Generate code for Boehm GC", 2425},
+ {"Don't put synchronization structure in each object", 2426},
+ {"Assume native functions are implemented using JNI", 2427},
+ {"Set class path and suppress system path", 2428},
+ {"Set class path", 2429},
+ {"Choose class whose main method should be used", 2430},
+ {"Choose input encoding (default is UTF-8)", 2431},
+ {"Add directory to class path", 2432},
+ {"Directory where class files should be written", 2433},
+ {"Use built-in instructions for division", 2434},
+ {"Warn if modifiers are specified when not necessary", 2435},
+ {"Warn if deprecated empty statements are found", 2436},
+ {"Warn if .class files are out of date", 2437},
+ {"Always check for non gcj generated classes archives", 2438},
+ {"can't do dependency tracking with input from stdin", 2439},
+ {"couldn't determine target name for dependency tracking", 2440},
+ {"\
+unknown encoding: `%s'\n\
+This might mean that your locale's encoding is not supported\n\
+by your system's iconv(3) implementation. If you aren't trying\n\
+to use a particular encoding for your input file, try the\n\
+`--encoding=UTF-8' option.", 2441},
+ {"Can't mangle %s", 2442},
+ {"internal error - invalid Utf8 name", 2443},
+ {"Missing name", 2444},
+ {"';' expected", 2445},
+ {"'*' expected", 2446},
+ {"Class or interface declaration expected", 2447},
+ {"Missing class name", 2448},
+ {"'{' expected", 2449},
+ {"Missing super class name", 2450},
+ {"Missing interface name", 2451},
+ {"Missing term", 2452},
+ {"Missing variable initializer", 2453},
+ {"Invalid declaration", 2454},
+ {"Can't specify array dimension in a declaration", 2455},
+ {"']' expected", 2456},
+ {"Unbalanced ']'", 2457},
+ {"Invalid method declaration, method name required", 2458},
+ {"Identifier expected", 2459},
+ {"Invalid method declaration, return type required", 2460},
+ {"')' expected", 2461},
+ {"Missing formal parameter term", 2462},
+ {"Missing identifier", 2463},
+ {"Missing class type term", 2464},
+ {"Invalid interface type", 2465},
+ {"':' expected", 2466},
+ {"Invalid expression statement", 2467},
+ {"'(' expected", 2468},
+ {"Missing term or ')'", 2469},
+ {"Missing or invalid constant expression", 2470},
+ {"Missing term and ')' expected", 2471},
+ {"Invalid control expression", 2472},
+ {"Invalid update expression", 2473},
+ {"Invalid init statement", 2474},
+ {"Missing term or ')' expected", 2475},
+ {"'class' or 'this' expected", 2476},
+ {"'class' expected", 2477},
+ {"')' or term expected", 2478},
+ {"'[' expected", 2479},
+ {"Field expected", 2480},
+ {"Missing term and ']' expected", 2481},
+ {"']' expected, invalid type expression", 2482},
+ {"Invalid type expression", 2483},
+ {"Invalid reference type", 2484},
+ {"Constructor invocation must be first thing in a constructor", 2485},
+ {"Only constructors can invoke constructors", 2486},
+ {": `%s' JDK1.1(TM) feature", 2487},
+ {"\
+%s.\n\
+%s", 2488},
+ {"Can't use '$' as a separator for inner classes", 2489},
+ {"malformed .zip archive in CLASSPATH: %s", 2490},
+ {"\
+Can't find default package `%s'. Check the CLASSPATH environment variable \
+and the access to the archives.", 2491},
+ {"missing static field `%s'", 2492},
+ {"not a static field `%s'", 2493},
+ {"No case for %s", 2494},
+ {"unregistered operator %s", 2495},
+ {"internal error - use of undefined type", 2496},
+ {"junk at end of signature string", 2497},
+ {"bad pc in exception_table", 2498},
+ {"unknown opcode %d@pc=%d during verification", 2499},
+ {"verification error at PC=%d", 2500},
+ {"Dump decls to a .decl file", 2501},
+ {"Generate code for GNU runtime environment", 2502},
+ {"Generate code for NeXT runtime environment", 2503},
+ {"Warn if a selector has multiple methods", 2504},
+ {"Do not warn if inherited methods are unimplemented", 2505},
+ {"Generate C header of platform specific features", 2506},
+ {"Specify the name of the class for constant strings", 2507},
+ {"no class name specified as argument to -fconstant-string-class", 2508},
+ {"object does not conform to the `%s' protocol", 2509},
+ {"class `%s' does not implement the `%s' protocol", 2510},
+ {"`%s' cannot be statically allocated", 2511},
+ {"Unexpected type for `id' (%s)", 2512},
+ {"Undefined type `id', please import <objc/objc.h>", 2513},
+ {"Cannot find protocol declaration for `%s'", 2514},
+ {"Cannot find interface declaration for `%s'", 2515},
+ {"Cannot find class `%s'", 2516},
+ {"Class `%s' already exists", 2517},
+ {"Cannot find interface declaration for `%s', superclass of `%s'", 2518},
+ {"Circular inheritance in interface declaration for `%s'", 2519},
+ {"inconsistent instance variable specification", 2520},
+ {"multiple declarations for method `%s'", 2521},
+ {"invalid receiver type `%s'", 2522},
+ {"`%s' does not respond to `%s'", 2523},
+ {"no super class declared in interface for `%s'", 2524},
+ {"cannot find class (factory) method.", 2525},
+ {"return type for `%s' defaults to id", 2526},
+ {"method `%s' not implemented by protocol.", 2527},
+ {"return type defaults to id", 2528},
+ {"cannot find method.", 2529},
+ {"instance variable `%s' accessed in class method", 2530},
+ {"duplicate definition of class method `%s'.", 2531},
+ {"duplicate declaration of class method `%s'.", 2532},
+ {"duplicate definition of instance method `%s'.", 2533},
+ {"duplicate declaration of instance method `%s'.", 2534},
+ {"duplicate interface declaration for category `%s(%s)'", 2535},
+ {"instance variable `%s' is declared private", 2536},
+ {"instance variable `%s' is declared %s", 2537},
+ {"static access to object of type `id'", 2538},
+ {"incomplete implementation of class `%s'", 2539},
+ {"incomplete implementation of category `%s'", 2540},
+ {"method definition for `%c%s' not found", 2541},
+ {"%s `%s' does not fully implement the `%s' protocol", 2542},
+ {"reimplementation of class `%s'", 2543},
+ {"conflicting super class name `%s'", 2544},
+ {"duplicate interface declaration for class `%s'", 2545},
+ {"duplicate declaration for protocol `%s'", 2546},
+ {"[super ...] must appear in a method context", 2547},
+ {"potential selector conflict for method `%s'", 2548},
+ {"`@end' must appear in an implementation context", 2549},
+ {"method definition not in class context", 2550},
+ {"syntax error at '@' token", 2551},
+ {"invalid parameter `%s'", 2552},
+ {"Arc profiling: some edge counts were bad.", 2553},
+ {"file %s not found, execution counts assumed to be zero.", 2554},
+ {"%s: internal abort\n", 2555},
+ {"%s: error writing file `%s': %s\n", 2556},
+ {"%s: usage '%s [ -VqfnkN ] [ -i <istring> ] [ filename ... ]'\n", 2557},
+ {"%s: usage '%s [ -VqfnkNlgC ] [ -B <dirname> ] [ filename ... ]'\n", 2558},
+ {"%s: warning: no read access for file `%s'\n", 2559},
+ {"%s: warning: no write access for file `%s'\n", 2560},
+ {"%s: warning: no write access for dir containing `%s'\n", 2561},
+ {"%s: invalid file name: %s\n", 2562},
+ {"%s: %s: can't get status: %s\n", 2563},
{"\
\n\
-%s: fatal error: aux info file corrupted at line %d\n", 2058},
- {"%s:%d: declaration of function `%s' takes different forms\n", 2059},
- {"%s: compiling `%s'\n", 2060},
- {"%s: wait: %s\n", 2061},
- {"%s: subprocess got fatal signal %d\n", 2062},
- {"%s: %s exited with status %d\n", 2063},
- {"%s: warning: missing SYSCALLS file `%s'\n", 2064},
- {"%s: can't read aux info file `%s': %s\n", 2065},
- {"%s: can't get status of aux info file `%s': %s\n", 2066},
- {"%s: can't open aux info file `%s' for reading: %s\n", 2067},
- {"%s: error reading aux info file `%s': %s\n", 2068},
- {"%s: error closing aux info file `%s': %s\n", 2069},
- {"%s: can't delete aux info file `%s': %s\n", 2070},
- {"%s: can't delete file `%s': %s\n", 2071},
- {"%s: warning: can't rename file `%s' to `%s': %s\n", 2072},
- {"%s: conflicting extern definitions of '%s'\n", 2073},
- {"%s: declarations of '%s' will not be converted\n", 2074},
- {"%s: conflict list for '%s' follows:\n", 2075},
- {"%s: warning: using formals list from %s(%d) for function `%s'\n", 2076},
- {"%s: %d: `%s' used but missing from SYSCALLS\n", 2077},
- {"%s: %d: warning: no extern definition for `%s'\n", 2078},
- {"%s: warning: no static definition for `%s' in file `%s'\n", 2079},
- {"%s: multiple static defs of `%s' in file `%s'\n", 2080},
- {"%s: %d: warning: source too confusing\n", 2081},
- {"%s: %d: warning: varargs function declaration not converted\n", 2082},
- {"%s: declaration of function `%s' not converted\n", 2083},
- {"%s: warning: too many parameter lists in declaration of `%s'\n", 2084},
+%s: fatal error: aux info file corrupted at line %d\n", 2564},
+ {"%s:%d: declaration of function `%s' takes different forms\n", 2565},
+ {"%s: compiling `%s'\n", 2566},
+ {"%s: wait: %s\n", 2567},
+ {"%s: subprocess got fatal signal %d\n", 2568},
+ {"%s: %s exited with status %d\n", 2569},
+ {"%s: warning: missing SYSCALLS file `%s'\n", 2570},
+ {"%s: can't read aux info file `%s': %s\n", 2571},
+ {"%s: can't get status of aux info file `%s': %s\n", 2572},
+ {"%s: can't open aux info file `%s' for reading: %s\n", 2573},
+ {"%s: error reading aux info file `%s': %s\n", 2574},
+ {"%s: error closing aux info file `%s': %s\n", 2575},
+ {"%s: can't delete aux info file `%s': %s\n", 2576},
+ {"%s: can't delete file `%s': %s\n", 2577},
+ {"%s: warning: can't rename file `%s' to `%s': %s\n", 2578},
+ {"%s: conflicting extern definitions of '%s'\n", 2579},
+ {"%s: declarations of '%s' will not be converted\n", 2580},
+ {"%s: conflict list for '%s' follows:\n", 2581},
+ {"%s: warning: using formals list from %s(%d) for function `%s'\n", 2582},
+ {"%s: %d: `%s' used but missing from SYSCALLS\n", 2583},
+ {"%s: %d: warning: no extern definition for `%s'\n", 2584},
+ {"%s: warning: no static definition for `%s' in file `%s'\n", 2585},
+ {"%s: multiple static defs of `%s' in file `%s'\n", 2586},
+ {"%s: %d: warning: source too confusing\n", 2587},
+ {"%s: %d: warning: varargs function declaration not converted\n", 2588},
+ {"%s: declaration of function `%s' not converted\n", 2589},
+ {"%s: warning: too many parameter lists in declaration of `%s'\n", 2590},
{"\
\n\
-%s: warning: too few parameter lists in declaration of `%s'\n", 2085},
- {"%s: %d: warning: found `%s' but expected `%s'\n", 2086},
- {"%s: local declaration for function `%s' not inserted\n", 2087},
+%s: warning: too few parameter lists in declaration of `%s'\n", 2591},
+ {"%s: %d: warning: found `%s' but expected `%s'\n", 2592},
+ {"%s: local declaration for function `%s' not inserted\n", 2593},
{"\
\n\
-%s: %d: warning: can't add declaration of `%s' into macro call\n", 2088},
- {"%s: global declarations for file `%s' not inserted\n", 2089},
- {"%s: definition of function `%s' not converted\n", 2090},
- {"%s: %d: warning: definition of %s not converted\n", 2091},
- {"%s: found definition of `%s' at %s(%d)\n", 2092},
- {"%s: %d: warning: `%s' excluded by preprocessing\n", 2093},
- {"%s: function definition not converted\n", 2094},
- {"%s: `%s' not converted\n", 2095},
- {"%s: would convert file `%s'\n", 2096},
- {"%s: converting file `%s'\n", 2097},
- {"%s: can't get status for file `%s': %s\n", 2098},
- {"%s: can't open file `%s' for reading: %s\n", 2099},
+%s: %d: warning: can't add declaration of `%s' into macro call\n", 2594},
+ {"%s: global declarations for file `%s' not inserted\n", 2595},
+ {"%s: definition of function `%s' not converted\n", 2596},
+ {"%s: %d: warning: definition of %s not converted\n", 2597},
+ {"%s: found definition of `%s' at %s(%d)\n", 2598},
+ {"%s: %d: warning: `%s' excluded by preprocessing\n", 2599},
+ {"%s: function definition not converted\n", 2600},
+ {"%s: `%s' not converted\n", 2601},
+ {"%s: would convert file `%s'\n", 2602},
+ {"%s: converting file `%s'\n", 2603},
+ {"%s: can't get status for file `%s': %s\n", 2604},
+ {"%s: can't open file `%s' for reading: %s\n", 2605},
{"\
\n\
-%s: error reading input file `%s': %s\n", 2100},
- {"%s: can't create/open clean file `%s': %s\n", 2101},
- {"%s: warning: file `%s' already saved in `%s'\n", 2102},
- {"%s: can't link file `%s' to `%s': %s\n", 2103},
- {"%s: can't create/open output file `%s': %s\n", 2104},
- {"%s: can't change mode of file `%s': %s\n", 2105},
- {"%s: cannot get working directory: %s\n", 2106},
- {"%s: input file names must have .c suffixes: %s\n", 2107},
- {"conversion from NaN to int", 2108},
- {"conversion from NaN to unsigned int", 2109},
- {"floating point overflow", 2110},
- {"overflow on truncation to integer", 2111},
- {"overflow on truncation to unsigned integer", 2112},
- {"%s: argument domain error", 2113},
- {"%s: function singularity", 2114},
- {"%s: overflow range error", 2115},
- {"%s: underflow range error", 2116},
- {"%s: total loss of precision", 2117},
- {"%s: partial loss of precision", 2118},
- {"%s: NaN - producing operation", 2119},
- {"Output constraint %d must specify a single register", 2120},
- {"Output regs must be grouped at top of stack", 2121},
- {"Implicitly popped regs must be grouped at top of stack", 2122},
- {"Output operand %d must use `&' constraint", 2123},
- {"can't use '%s' as a %s register", 2124},
- {"unknown register name: %s", 2125},
- {"global register variable follows a function definition", 2126},
- {"register used for two global register variables", 2127},
- {"call-clobbered register used for global register variable", 2128},
- {"cannot reload integer constant operand in `asm'", 2129},
- {"impossible register constraint in `asm'", 2130},
- {"`&' constraint used with no register class", 2131},
- {"inconsistent operand constraints in an `asm'", 2132},
- {"frame size too large for reliable stack checking", 2133},
- {"try reducing the number of local variables", 2134},
- {"Can't find a register in class `%s' while reloading `asm'.", 2135},
- {"Unable to find a register to spill in class `%s'.", 2136},
- {"`asm' operand requires impossible reload", 2137},
- {"`asm' operand constraint incompatible with operand size", 2138},
- {"output operand is constant in `asm'", 2139},
- {"RTL check: access of elt %d of `%s' with last elt %d", 2140},
- {"RTL check: expected elt %d type '%c', have '%c' (rtx %s)", 2141},
- {"RTL check: expected elt %d type '%c' or '%c', have '%c' (rtx %s)", 2142},
- {"RTL check: expected code `%s', have `%s'", 2143},
- {"RTL check: expected code `%s' or `%s', have `%s'", 2144},
- {"RTL check: access of elt %d of vector with last elt %d", 2145},
- {"jump to `%s' invalidly jumps into binding contour", 2146},
- {"label `%s' used before containing binding contour", 2147},
- {"`asm' cannot be used in function where memory usage is checked", 2148},
- {"`asm' cannot be used with `-fcheck-memory-usage'", 2149},
- {"unknown register name `%s' in `asm'", 2150},
- {"too many alternatives in `asm'", 2151},
- {"operand constraints for `asm' differ in number of alternatives", 2152},
- {"output operand constraint lacks `='", 2153},
- {"output constraint `%c' for operand %d is not at the beginning", 2154},
- {"output operand constraint %d contains `+'", 2155},
- {"operand constraint contains '+' or '=' at illegal position.", 2156},
- {"`%%' constraint used with last operand", 2157},
- {"matching constraint not valid in output operand", 2158},
- {"invalid punctuation `%c' in constraint", 2159},
- {"output number %d not directly addressable", 2160},
- {"more than %d operands in `asm'", 2161},
- {"hard register `%s' listed as input operand to `asm'", 2162},
- {"input operand constraint contains `%c'", 2163},
- {"matching constraint references invalid operand number", 2164},
- {"asm operand %d probably doesn't match constraints", 2165},
- {"unused variable `%s'", 2166},
- {"enumeration value `%s' not handled in switch", 2167},
- {"case value `%ld' not in enumerated type", 2168},
- {"case value `%ld' not in enumerated type `%s'", 2169},
- {"type size can't be explicitly evaluated", 2170},
- {"variable-size type declared outside of any function", 2171},
- {"size of `%s' is %d bytes", 2172},
- {"size of `%s' is larger than %d bytes", 2173},
- {"packed attribute causes inefficient alignment for `%s'", 2174},
- {"packed attribute is unnecessary for `%s'", 2175},
- {"padding struct to align `%s'", 2176},
- {"padding struct size to alignment boundary", 2177},
- {"packed attribute causes inefficient alignment", 2178},
- {"packed attribute is unnecessary", 2179},
+%s: error reading input file `%s': %s\n", 2606},
+ {"%s: can't create/open clean file `%s': %s\n", 2607},
+ {"%s: warning: file `%s' already saved in `%s'\n", 2608},
+ {"%s: can't link file `%s' to `%s': %s\n", 2609},
+ {"%s: can't create/open output file `%s': %s\n", 2610},
+ {"%s: can't change mode of file `%s': %s\n", 2611},
+ {"%s: cannot get working directory: %s\n", 2612},
+ {"%s: input file names must have .c suffixes: %s\n", 2613},
+ {"conversion from NaN to int", 2614},
+ {"conversion from NaN to unsigned int", 2615},
+ {"floating point overflow", 2616},
+ {"overflow on truncation to integer", 2617},
+ {"overflow on truncation to unsigned integer", 2618},
+ {"%s: argument domain error", 2619},
+ {"%s: function singularity", 2620},
+ {"%s: overflow range error", 2621},
+ {"%s: underflow range error", 2622},
+ {"%s: total loss of precision", 2623},
+ {"%s: partial loss of precision", 2624},
+ {"%s: NaN - producing operation", 2625},
+ {"Output constraint %d must specify a single register", 2626},
+ {"Output regs must be grouped at top of stack", 2627},
+ {"Implicitly popped regs must be grouped at top of stack", 2628},
+ {"Output operand %d must use `&' constraint", 2629},
+ {"can't use '%s' as a %s register", 2630},
+ {"global register variable follows a function definition", 2631},
+ {"register used for two global register variables", 2632},
+ {"call-clobbered register used for global register variable", 2633},
+ {"cannot reload integer constant operand in `asm'", 2634},
+ {"impossible register constraint in `asm'", 2635},
+ {"`&' constraint used with no register class", 2636},
+ {"inconsistent operand constraints in an `asm'", 2637},
+ {"frame size too large for reliable stack checking", 2638},
+ {"try reducing the number of local variables", 2639},
+ {"Can't find a register in class `%s' while reloading `asm'.", 2640},
+ {"Unable to find a register to spill in class `%s'.", 2641},
+ {"`asm' operand requires impossible reload", 2642},
+ {"`asm' operand constraint incompatible with operand size", 2643},
+ {"output operand is constant in `asm'", 2644},
+ {"RTL check: access of elt %d of `%s' with last elt %d in %s, at %s:%d", 2645},
+ {"\
+RTL check: expected elt %d type '%c', have '%c' (rtx %s) in %s, at %s:%d", 2646},
+ {"\
+RTL check: expected elt %d type '%c' or '%c', have '%c' (rtx %s) in %s, at %\
+s:%d", 2647},
+ {"RTL check: expected code `%s', have `%s' in %s, at %s:%d", 2648},
+ {"RTL check: expected code `%s' or `%s', have `%s' in %s, at %s:%d", 2649},
+ {"RTL check: access of elt %d of vector with last elt %d in %s, at %s:%d", 2650},
+ {"jump to `%s' invalidly jumps into binding contour", 2651},
+ {"label `%s' used before containing binding contour", 2652},
+ {"`asm' cannot be used in function where memory usage is checked", 2653},
+ {"`asm' cannot be used with `-fcheck-memory-usage'", 2654},
+ {"unknown register name `%s' in `asm'", 2655},
+ {"too many alternatives in `asm'", 2656},
+ {"operand constraints for `asm' differ in number of alternatives", 2657},
+ {"output operand constraint lacks `='", 2658},
+ {"output constraint `%c' for operand %d is not at the beginning", 2659},
+ {"output operand constraint %d contains `+'", 2660},
+ {"operand constraint contains '+' or '=' at illegal position.", 2661},
+ {"`%%' constraint used with last operand", 2662},
+ {"matching constraint not valid in output operand", 2663},
+ {"invalid punctuation `%c' in constraint", 2664},
+ {"output number %d not directly addressable", 2665},
+ {"more than %d operands in `asm'", 2666},
+ {"hard register `%s' listed as input operand to `asm'", 2667},
+ {"input operand constraint contains `%c'", 2668},
+ {"matching constraint references invalid operand number", 2669},
+ {"asm operand %d probably doesn't match constraints", 2670},
+ {"unused variable `%s'", 2671},
+ {"enumeration value `%s' not handled in switch", 2672},
+ {"case value `%ld' not in enumerated type", 2673},
+ {"case value `%ld' not in enumerated type `%s'", 2674},
+ {"type size can't be explicitly evaluated", 2675},
+ {"variable-size type declared outside of any function", 2676},
+ {"size of `%s' is %d bytes", 2677},
+ {"size of `%s' is larger than %d bytes", 2678},
+ {"packed attribute causes inefficient alignment for `%s'", 2679},
+ {"packed attribute is unnecessary for `%s'", 2680},
+ {"padding struct to align `%s'", 2681},
+ {"padding struct size to alignment boundary", 2682},
+ {"packed attribute causes inefficient alignment", 2683},
+ {"packed attribute is unnecessary", 2684},
+ {"\"%s\" and \"%s\" identical in first %d characters", 2685},
{"\
\n\
-Execution times (seconds)\n", 2180},
- {" TOTAL :", 2181},
- {"time in %s: %ld.%06ld (%ld%%)\n", 2182},
- {"collect: reading %s\n", 2183},
- {"collect: recompiling %s\n", 2184},
- {"collect: tweaking %s in %s\n", 2185},
- {"collect: relinking\n", 2186},
- {"ld returned %d exit status", 2187},
- {"Invalid option `%s'", 2188},
- {"\
-Internal error: %s.\n\
-Please submit a full bug report.\n\
-See %s for instructions.", 2189},
- {"`%s' used but never defined", 2190},
- {"`%s' declared `static' but never defined", 2191},
- {"`%s' defined but not used", 2192},
- {"-ffunction-sections not supported for this target.", 2193},
- {"-fdata-sections not supported for this target.", 2194},
- {"-ffunction-sections disabled; it makes profiling impossible.", 2195},
- {"-ffunction-sections may affect debugging on some targets.", 2196},
- {"Errors detected in input file (your bison.simple is out of date)\n", 2197},
- {"invalid register name `%s' for register variable", 2198},
- {"Usage: %s input [switches]\n", 2199},
- {"Switches:\n", 2200},
+Execution times (seconds)\n", 2686},
+ {" TOTAL :", 2687},
+ {"time in %s: %ld.%06ld (%ld%%)\n", 2688},
+ {"collect: reading %s\n", 2689},
+ {"collect: recompiling %s\n", 2690},
+ {"collect: tweaking %s in %s\n", 2691},
+ {"collect: relinking\n", 2692},
+ {"ld returned %d exit status", 2693},
+ {"Generate debugging info in default format", 2694},
+ {"Generate debugging info in default extended format", 2695},
+ {"Generate STABS format debug info", 2696},
+ {"Generate extended STABS format debug info", 2697},
+ {"Generate DWARF-1 format debug info", 2698},
+ {"Generate extended DWARF-1 format debug info", 2699},
+ {"Generate DWARF-2 debug info", 2700},
+ {"Generate XCOFF format debug info", 2701},
+ {"Generate extended XCOFF format debug info", 2702},
+ {"Generate COFF format debug info", 2703},
+ {"Do not store floats in registers", 2704},
+ {"Consider all mem refs through pointers as volatile", 2705},
+ {"Consider all mem refs to global data to be volatile", 2706},
+ {"Consider all mem refs to static data to be volatile", 2707},
+ {"Defer popping functions args from stack until later", 2708},
+ {"When possible do not generate stack frames", 2709},
+ {"Optimize sibling and tail recursive calls", 2710},
+ {"When running CSE, follow jumps to their targets", 2711},
+ {"When running CSE, follow conditional jumps", 2712},
+ {"Perform a number of minor, expensive optimisations", 2713},
+ {"Perform jump threading optimisations", 2714},
+ {"Perform strength reduction optimisations", 2715},
+ {"Perform loop unrolling when iteration count is known", 2716},
+ {"Perform loop unrolling for all loops", 2717},
+ {"Force all loop invariant computations out of loops", 2718},
+ {"Strength reduce all loop general induction variables", 2719},
+ {"Store strings in writable data section", 2720},
+ {"Enable machine specific peephole optimisations", 2721},
+ {"Copy memory operands into registers before using", 2722},
+ {"Copy memory address constants into regs before using", 2723},
+ {"Allow function addresses to be held in registers", 2724},
+ {"Integrate simple functions into their callers", 2725},
+ {"Generate code for funcs even if they are fully inlined", 2726},
+ {"Pay attention to the 'inline' keyword", 2727},
+ {"Emit static const variables even if they are not used", 2728},
+ {"Check for syntax errors, then stop", 2729},
+ {"Mark data as shared rather than private", 2730},
+ {"Enable saving registers around function calls", 2731},
+ {"Return 'short' aggregates in memory, not registers", 2732},
+ {"Return 'short' aggregates in registers", 2733},
+ {"Attempt to fill delay slots of branch instructions", 2734},
+ {"Perform the global common subexpression elimination", 2735},
+ {"Run CSE pass after loop optimisations", 2736},
+ {"Run the loop optimiser twice", 2737},
+ {"Delete useless null pointer checks", 2738},
+ {"Pretend that host and target use the same FP format", 2739},
+ {"Reschedule instructions before register allocation", 2740},
+ {"Reschedule instructions after register allocation", 2741},
+ {"Enable scheduling across basic blocks", 2742},
+ {"Allow speculative motion of non-loads", 2743},
+ {"Allow speculative motion of some loads", 2744},
+ {"Allow speculative motion of more loads", 2745},
+ {"Replace add,compare,branch with branch on count reg", 2746},
+ {"Generate position independent code, if possible", 2747},
+ {"Enable exception handling", 2748},
+ {"Just generate unwind tables for exception handling", 2749},
+ {"Support synchronous non-call exceptions", 2750},
+ {"Insert arc based program profiling code", 2751},
+ {"Create data files needed by gcov", 2752},
+ {"Use profiling information for branch probabilities", 2753},
+ {"Reorder basic blocks to improve code placement", 2754},
+ {"Do the register renaming optimization pass", 2755},
+ {"Improve FP speed by violating ANSI & IEEE rules", 2756},
+ {"Do not put unitialised globals in the common section", 2757},
+ {"Do not generate .size directives", 2758},
+ {"place each function into its own section", 2759},
+ {"place data items into their own section", 2760},
+ {"Add extra commentry to assembler output", 2761},
+ {"Output GNU ld formatted global initialisers", 2762},
+ {"Enables a register move optimisation", 2763},
+ {"Do the full regmove optimization pass", 2764},
+ {"Pack structure members together without holes", 2765},
+ {"Insert stack checking code into the program", 2766},
+ {"Specify that arguments may alias each other & globals", 2767},
+ {"Assume arguments may alias globals but not each other", 2768},
+ {"Assume arguments do not alias each other or globals", 2769},
+ {"Assume strict aliasing rules apply", 2770},
+ {"Align the start of loops", 2771},
+ {"Align labels which are only reached by jumping", 2772},
+ {"Align all labels", 2773},
+ {"Align the start of functions", 2774},
+ {"Generate code to check every memory access", 2775},
+ {"Add a prefix to all function names", 2776},
+ {"\
+Suppress output of instruction numbers and line number notes in debugging \
+dumps", 2777},
+ {"Instrument function entry/exit with profiling calls", 2778},
+ {"Enable SSA optimizations", 2779},
+ {"Enable dead code elimination", 2780},
+ {"External symbols have a leading underscore", 2781},
+ {"Process #ident directives", 2782},
+ {"Enables an rtl peephole pass run before sched2", 2783},
+ {"Enables guessing of branch probabilities", 2784},
+ {"Set errno after built-in math functions", 2785},
+ {"Convert floating point constant to single precision constant", 2786},
+ {"Report time taken by each compiler pass at end of run", 2787},
+ {"Report on permanent memory allocation at end of run", 2788},
+ {"Trap for signed overflow in addition / subtraction / multiplication.", 2789},
+ {"Compile just for ISO C89", 2790},
+ {"Do not promote floats to double if using -traditional", 2791},
+ {"Determine language standard", 2792},
+ {"Make bitfields by unsigned by default", 2793},
+ {"Make 'char' be signed by default", 2794},
+ {"Make 'char' be unsigned by default", 2795},
+ {"Attempt to support traditional K&R style C", 2796},
+ {"Do not recognise the 'asm' keyword", 2797},
+ {"Do not recognise any built in functions", 2798},
+ {"Assume normal C execution environment", 2799},
+ {"Assume that standard libraries & main might not exist", 2800},
+ {"Allow different types as args of ? operator", 2801},
+ {"Allow the use of $ inside identifiers", 2802},
+ {"Use the same size for double as for float", 2803},
+ {"Use the smallest fitting integer to hold enums", 2804},
+ {"Override the underlying type for wchar_t to `unsigned short'", 2805},
+ {"Enable most warning messages", 2806},
+ {"Warn about casting functions to incompatible types", 2807},
+ {"Warn about functions which might be candidates for format attributes", 2808},
+ {"Warn about casts which discard qualifiers", 2809},
+ {"Warn about subscripts whose type is 'char'", 2810},
+ {"Warn if nested comments are detected", 2811},
+ {"Warn about possibly confusing type conversions", 2812},
+ {"Warn about printf/scanf/strftime/strfmon format anomalies", 2813},
+ {"Don't warn about strftime formats yielding 2 digit years", 2814},
+ {"Don't warn about too many arguments to format functions", 2815},
+ {"Warn about non-string-literal format strings", 2816},
+ {"Warn about possible security problems with format functions", 2817},
+ {"Warn about implicit function declarations", 2818},
+ {"Warn when a declaration does not specify a type", 2819},
+ {"Warn about the use of the #import directive", 2820},
+ {"Do not warn about using 'long long' when -pedantic", 2821},
+ {"Warn about suspicious declarations of main", 2822},
+ {"Warn about possibly missing braces around initialisers", 2823},
+ {"Warn about global funcs without previous declarations", 2824},
+ {"Warn about global funcs without prototypes", 2825},
+ {"Warn about use of multicharacter literals", 2826},
+ {"Warn about externs not at file scope level", 2827},
+ {"Warn about possible missing parentheses", 2828},
+ {"Warn about possible violations of sequence point rules", 2829},
+ {"Warn about function pointer arithmetic", 2830},
+ {"Warn about multiple declarations of the same object", 2831},
+ {"Warn about signed/unsigned comparisons", 2832},
+ {"Warn about testing equality of floating point numbers", 2833},
+ {"Warn about unrecognized pragmas", 2834},
+ {"Warn about non-prototyped function decls", 2835},
+ {"Warn about constructs whose meaning change in ISO C", 2836},
+ {"Warn when trigraphs are encountered", 2837},
+ {"Mark strings as 'const char *'", 2838},
+ {"Warn when a function is unused", 2839},
+ {"Warn when a label is unused", 2840},
+ {"Warn when a function parameter is unused", 2841},
+ {"Warn when a variable is unused", 2842},
+ {"Warn when an expression value is unused", 2843},
+ {"Do not suppress warnings from system headers", 2844},
+ {"Treat all warnings as errors", 2845},
+ {"Warn when one local variable shadows another", 2846},
+ {"Warn about enumerated switches missing a specific case", 2847},
+ {"Warn about returning structures, unions or arrays", 2848},
+ {"Warn about pointer casts which increase alignment", 2849},
+ {"Warn about code that will never be executed", 2850},
+ {"Warn about unitialized automatic variables", 2851},
+ {"Warn when an inlined function cannot be inlined", 2852},
+ {"Warn when the packed attribute has no effect on struct layout", 2853},
+ {"Warn when padding is required to align struct members", 2854},
+ {"Warn when an optimization pass is disabled", 2855},
+ {"Warn about functions which might be candidates for attribute noreturn", 2856},
+ {"Invalid option `%s'", 2857},
+ {"Internal error: %s", 2858},
+ {"`%s' used but never defined", 2859},
+ {"`%s' declared `static' but never defined", 2860},
+ {"`%s' defined but not used", 2861},
+ {"can't open %s for writing", 2862},
+ {"-ffunction-sections not supported for this target.", 2863},
+ {"-fdata-sections not supported for this target.", 2864},
+ {"-ffunction-sections disabled; it makes profiling impossible.", 2865},
+ {"-ffunction-sections may affect debugging on some targets.", 2866},
+ {"Errors detected in input file (your bison.simple is out of date)\n", 2867},
+ {"error writing to %s", 2868},
+ {"invalid register name `%s' for register variable", 2869},
{"\
-ffixed-<register> Mark <register> as being unavailable to the \
-compiler\n", 2201},
+compiler\n", 2870},
{"\
-fcall-used-<register> Mark <register> as being corrupted by function \
-calls\n", 2202},
+calls\n", 2871},
{"\
-fcall-saved-<register> Mark <register> as being preserved across \
-functions\n", 2203},
+functions\n", 2872},
{"\
- -finline-limit=<number> Limits the size of inlined functions to <number>\n", 2204},
+ -finline-limit=<number> Limits the size of inlined functions to <number>\n", 2873},
{"\
-fmessage-length=<number> Limits diagnostics messages lengths to <number> \
-characters per line. 0 suppresses line-wrapping\n", 2205},
+characters per line. 0 suppresses line-wrapping\n", 2874},
{"\
-fdiagnostics-show-location=[once | every-line] Indicates how often source \
location information should be emitted, as prefix, at the beginning of \
-diagnostics when line-wrapping\n", 2206},
- {" -O[number] Set optimisation level to [number]\n", 2207},
- {" -Os Optimise for space rather than speed\n", 2208},
+diagnostics when line-wrapping\n", 2875},
+ {" -O[number] Set optimisation level to [number]\n", 2876},
+ {" -Os Optimise for space rather than speed\n", 2877},
{"\
-pedantic Issue warnings needed by strict compliance to ISO \
-C\n", 2209},
+C\n", 2878},
{"\
- -pedantic-errors Like -pedantic except that errors are produced\n", 2210},
- {" -w Suppress warnings\n", 2211},
- {" -W Enable extra warnings\n", 2212},
- {" -Wunused Enable unused warnings\n", 2213},
+ -pedantic-errors Like -pedantic except that errors are produced\n", 2879},
+ {" -w Suppress warnings\n", 2880},
+ {" -W Enable extra warnings\n", 2881},
+ {" -Wunused Enable unused warnings\n", 2882},
{"\
-Wid-clash-<num> Warn if 2 identifiers have the same first <num> \
-chars\n", 2214},
+chars\n", 2883},
{"\
- -Wlarger-than-<number> Warn if an object is larger than <number> bytes\n", 2215},
- {" -p Enable function profiling\n", 2216},
- {" -a Enable block profiling \n", 2217},
- {" -ax Enable jump profiling \n", 2218},
- {" -o <file> Place output into <file> \n", 2219},
+ -Wlarger-than-<number> Warn if an object is larger than <number> bytes\n", 2884},
+ {" -p Enable function profiling\n", 2885},
+ {" -a Enable block profiling \n", 2886},
+ {" -ax Enable jump profiling \n", 2887},
+ {" -o <file> Place output into <file> \n", 2888},
{"\
-G <number> Put global and static data smaller than <number>\n\
- bytes into a special section (on some targets)\n", 2220},
- {" -aux-info <file> Emit declaration info into <file>.X\n", 2221},
+ bytes into a special section (on some targets)\n", 2889},
+ {" -aux-info <file> Emit declaration info into <file>\n", 2890},
{"\
- -quiet Do not display functions compiled or elapsed time\n", 2222},
- {" -version Display the compiler's version\n", 2223},
+ -quiet Do not display functions compiled or elapsed time\n", 2891},
+ {" -version Display the compiler's version\n", 2892},
{"\
- -d[letters] Enable dumps from specific passes of the compiler\n", 2224},
+ -d[letters] Enable dumps from specific passes of the compiler\n", 2893},
{"\
-dumpbase <file> Base name to be used for dumps from specific \
-passes\n", 2225},
- {" -fsched-verbose=<number> Set the verbosity level of the scheduler\n", 2226},
- {" --help Display this information\n", 2227},
+passes\n", 2894},
+ {" -fsched-verbose=<number> Set the verbosity level of the scheduler\n", 2895},
+ {" --help Display this information\n", 2896},
{"\
\n\
-Language specific options:\n", 2228},
- {" %-23.23s [undocumented]\n", 2229},
+Language specific options:\n", 2897},
+ {" %-23.23s [undocumented]\n", 2898},
{"\
\n\
-There are undocumented %s specific options as well.\n", 2230},
+There are undocumented %s specific options as well.\n", 2899},
{"\
\n\
- Options for %s:\n", 2231},
+ Options for %s:\n", 2900},
{"\
\n\
-Target specific options:\n", 2232},
- {" -m%-21.21s [undocumented]\n", 2233},
+Target specific options:\n", 2901},
+ {" -m%-23.23s [undocumented]\n", 2902},
{"\
\n\
-There are undocumented target specific options as well.\n", 2234},
- {" They exist, but they are not documented.\n", 2235},
- {"unrecognized gcc debugging option: %c", 2236},
- {"unrecognized register name `%s'", 2237},
- {"Unrecognized option `%s'", 2238},
- {"use -gdwarf -g%d for DWARF v1, level %d", 2239},
- {"use -gdwarf-2 for DWARF v2", 2240},
- {"ignoring option `%s' due to invalid debug level specification", 2241},
- {"`%s': unknown or unsupported -g option", 2242},
- {"`%s' ignored, conflicts with `-g%s'", 2243},
- {"`-a' option (basic block profile) not supported", 2244},
- {"`-ax' option (jump profiling) not supported", 2245},
- {"Ignoring command line option '%s'", 2246},
- {"(It is valid for %s but not the selected language)", 2247},
- {"-Wuninitialized is not supported without -O", 2248},
- {"`-ax' and `-a' are conflicting options. `-a' ignored.", 2249},
- {"instruction scheduling not supported on this target machine", 2250},
- {"this target machine does not have delayed branches", 2251},
- {"-f%sleading-underscore not supported on this target machine", 2252},
- {"Data size %ld.\n", 2253},
- {"\
-%s%s%s version %s (%s) compiled by GNU C version %s.\n\
-%s%s%s version %s (%s) compiled by CC.\n", 2254},
- {"options passed: ", 2255},
- {"options enabled: ", 2256},
- {"macro or #include recursion too deep", 2257},
- {"Usage: %s [switches] input output", 2258},
- {"-traditional is not supported in C++", 2259},
- {"-traditional and -ansi are mutually exclusive", 2260},
- {"Filename missing after -i option", 2261},
- {"Filename missing after -o option", 2262},
- {"Macro name missing after -D option", 2263},
- {"Macro name missing after -U option", 2264},
- {"-pedantic and -traditional are mutually exclusive", 2265},
- {"-trigraphs and -traditional are mutually exclusive", 2266},
- {"Directory name missing after -I option", 2267},
- {"`/*' within comment", 2268},
- {"unterminated #%s conditional", 2269},
- {"not in any file?!", 2270},
- {"`defined' must be followed by ident or (ident)", 2271},
- {"cccp error: invalid special hash type", 2272},
- {"#include expects \"fname\" or <fname>", 2273},
- {"nonexistent file <%.*s> omitted from dependency output", 2274},
- {"invalid macro name", 2275},
- {"invalid macro name `%s'", 2276},
- {"defining `defined' as a macro", 2277},
- {"parameter name starts with a digit in #define", 2278},
- {"badly punctuated parameter list in #define", 2279},
- {"unterminated parameter list in #define", 2280},
- {"\"%.*s\" redefined", 2281},
- {"# operator should be followed by a macro argument name", 2282},
- {"invalid format #line command", 2283},
- {"undefining `defined'", 2284},
- {"undefining `%s'", 2285},
- {"#elif not within a conditional", 2286},
- {"#%s not within a conditional", 2287},
- {"#else or #elif after #else", 2288},
- {"#else not within a conditional", 2289},
- {"unbalanced #endif", 2290},
- {"unterminated string or character constant", 2291},
- {"arguments given to macro `%s'", 2292},
- {"no args to macro `%s'", 2293},
- {"only 1 arg to macro `%s'", 2294},
- {"only %d args to macro `%s'", 2295},
- {"too many (%d) args to macro `%s'", 2296},
+There are undocumented target specific options as well.\n", 2903},
+ {" They exist, but they are not documented.\n", 2904},
+ {"unrecognized gcc debugging option: %c", 2905},
+ {"unrecognized register name `%s'", 2906},
+ {"Unrecognized option `%s'", 2907},
+ {"use -gdwarf -g%d for DWARF v1, level %d", 2908},
+ {"use -gdwarf-2 for DWARF v2", 2909},
+ {"ignoring option `%s' due to invalid debug level specification", 2910},
+ {"`%s': unknown or unsupported -g option", 2911},
+ {"`%s' ignored, conflicts with `-g%s'", 2912},
+ {"-param option missing argument", 2913},
+ {"invalid --param option: %s", 2914},
+ {"invalid parameter value `%s'", 2915},
+ {"`-a' option (basic block profile) not supported", 2916},
+ {"`-ax' option (jump profiling) not supported", 2917},
+ {"Ignoring command line option '%s'", 2918},
+ {"(It is valid for %s but not the selected language)", 2919},
+ {"-Wuninitialized is not supported without -O", 2920},
+ {"`-ax' and `-a' are conflicting options. `-a' ignored.", 2921},
+ {"instruction scheduling not supported on this target machine", 2922},
+ {"this target machine does not have delayed branches", 2923},
+ {"profiling does not work without a frame pointer", 2924},
+ {"-f%sleading-underscore not supported on this target machine", 2925},
+ {"Data size %ld.\n", 2926},
+ {"\
+%s%s%s version %s (%s)\n\
+%s\tcompiled by GNU C version %s.\n\
+%s%s%s version %s (%s) compiled by CC.\n", 2927},
+ {"options passed: ", 2928},
+ {"options enabled: ", 2929},
+ {"division by zero in #if", 2930},
+ {"floating point numbers not allowed in #if expressions", 2931},
+ {"Invalid number in #if expression", 2932},
+ {"Invalid character constant in #if", 2933},
+ {"double quoted strings not allowed in #if expressions", 2934},
+ {"Invalid token in expression", 2935},
+ {"octal character constant does not fit in a byte", 2936},
+ {"hex character constant does not fit in a byte", 2937},
+ {"empty #if expression", 2938},
+ {"Junk after end of expression.", 2939},
+ {"macro or #include recursion too deep", 2940},
+ {"Usage: %s [switches] input output", 2941},
+ {"-traditional is not supported in C++", 2942},
+ {"-traditional and -ansi are mutually exclusive", 2943},
+ {"Filename missing after -i option", 2944},
+ {"Filename missing after -o option", 2945},
+ {"Target missing after %s option", 2946},
+ {"Filename missing after %s option", 2947},
+ {"Macro name missing after -%c option", 2948},
+ {"-pedantic and -traditional are mutually exclusive", 2949},
+ {"-trigraphs and -traditional are mutually exclusive", 2950},
+ {"Directory name missing after -I option", 2951},
+ {"`/*' within comment", 2952},
+ {"unterminated #%s conditional", 2953},
+ {"not in any file?!", 2954},
+ {"`defined' must be followed by ident or (ident)", 2955},
+ {"cccp error: invalid special hash type", 2956},
+ {"#include expects \"fname\" or <fname>", 2957},
+ {"No include path in which to find %.*s", 2958},
+ {"invalid macro name", 2959},
+ {"invalid macro name `%s'", 2960},
+ {"\"defined\" cannot be used as a macro name", 2961},
+ {"parameter name starts with a digit in #define", 2962},
+ {"badly punctuated parameter list in #define", 2963},
+ {"unterminated parameter list in #define", 2964},
+ {"\"%.*s\" redefined", 2965},
+ {"# operator should be followed by a macro argument name", 2966},
+ {"invalid format #line command", 2967},
+ {"undefining `defined'", 2968},
+ {"undefining `%s'", 2969},
+ {"extra text at end of directive", 2970},
+ {"#error%.*s", 2971},
+ {"#warning%.*s", 2972},
+ {"#elif not within a conditional", 2973},
+ {"#%s not within a conditional", 2974},
+ {"#else or #elif after #else", 2975},
+ {"#else not within a conditional", 2976},
+ {"unbalanced #endif", 2977},
+ {"unterminated string or character constant", 2978},
+ {"arguments given to macro `%s'", 2979},
+ {"no args to macro `%s'", 2980},
+ {"only 1 arg to macro `%s'", 2981},
+ {"only %d args to macro `%s'", 2982},
+ {"too many (%d) args to macro `%s'", 2983},
{"\
Internal error in %s, at tradcpp.c:%d\n\
Please submit a full bug report.\n\
-See %s for instructions.", 2297},
- {"`%s' and `%s' identical in first %d characters", 2298},
- {"arrays of functions are not meaningful", 2299},
- {"function return type cannot be function", 2300},
- {"invalid initializer for bit string", 2301},
- {"Tree check: expected %s, have %s", 2302},
- {"Tree check: expected class '%c', have '%c' (%s)", 2303},
- {"register name not specified for `%s'", 2304},
- {"invalid register name for `%s'", 2305},
- {"data type of `%s' isn't suitable for a register", 2306},
- {"register specified for `%s' isn't suitable for data type", 2307},
- {"global register variable has initial value", 2308},
- {"volatile register variables don't work as you might wish", 2309},
- {"register name given for non-register variable `%s'", 2310},
- {"size of variable `%s' is too large", 2311},
- {"\
-alignment of `%s' is greater than maximum object file alignment. Using %d.", 2312},
- {"requested alignment for %s is greater than implemented alignment of %d.", 2313},
- {"floating point trap outputting a constant", 2314},
- {"initializer for integer value is too complicated", 2315},
- {"initializer for floating value is not a floating constant", 2316},
- {"unknown set constructor type", 2317},
- {"invalid initial value for member `%s'", 2318},
- {"weak declaration of `%s' must be public", 2319},
- {"weak declaration of `%s' must precede definition", 2320},
- {"only weak aliases are supported in this configuration", 2321},
- {"alias definitions not supported in this configuration; ignored", 2322},
- {"Virtual array %s[%lu]: element %lu out of bounds", 2323},
- {"Unknown stab %s: : 0x%x\n", 2324},
- {"may not use both -EB and -EL", 2325},
- {"-mapcs-26 and -mapcs-32 may not be used together", 2326},
- {"-msoft-float and -mhard_float may not be used together", 2327},
- {"-mbig-endian and -mlittle-endian may not be used together", 2328},
- {"Incompatible interworking options", 2329},
- {"-mbsd and -pedantic incompatible", 2330},
- {"-mbsd and -mxopen incompatible", 2331},
- {"-mxopen and -pedantic incompatible", 2332},
- {"A -ifile option requires a -map option", 2333},
- {"`-p' not supported; use `-pg' and gprof(1)", 2334},
- {"-static not valid with -mcoff", 2335},
- {"-shared not valid with -mcoff", 2336},
- {"-symbolic not valid with -mcoff", 2337},
- {"-fpic is not valid with -mcoff", 2338},
- {"-fPIC is not valid with -mcoff", 2339},
- {"-fpic not valid with -mcoff", 2340},
- {"-fPIC not valid with -mcoff", 2341},
- {"-p option not supported: use -pg instead", 2342},
- {"-pipe is not supported.", 2343},
- {"may not use both -mfp64 and -msingle-float", 2344},
- {"may not use both -mfp64 and -m4650", 2345},
- {"-mhard-float not supported.", 2346},
- {"-msingle-float and -msoft-float can not both be specified.", 2347},
- {"-p profiling is no longer supported. Use -pg instead.", 2348},
- {"profiling not supported with -mg\n", 2349},
- {"GNU C does not support -C without using -E", 2350},
- {"-pg and -fomit-frame-pointer are incompatible", 2351},
- {"-E required when input is from standard input", 2352},
- {"Compilation of header file requested", 2353},
+See %s for instructions.", 2984},
+ {"arrays of functions are not meaningful", 2985},
+ {"function return type cannot be function", 2986},
+ {"invalid initializer for bit string", 2987},
+ {"Tree check: expected %s, have %s in %s, at %s:%d", 2988},
+ {"Tree check: expected class '%c', have '%c' (%s) in %s, at %s:%d", 2989},
+ {"register name not specified for `%s'", 2990},
+ {"invalid register name for `%s'", 2991},
+ {"data type of `%s' isn't suitable for a register", 2992},
+ {"register specified for `%s' isn't suitable for data type", 2993},
+ {"global register variable has initial value", 2994},
+ {"volatile register variables don't work as you might wish", 2995},
+ {"register name given for non-register variable `%s'", 2996},
+ {"size of variable `%s' is too large", 2997},
+ {"\
+alignment of `%s' is greater than maximum object file alignment. Using %d.", 2998},
+ {"requested alignment for %s is greater than implemented alignment of %d.", 2999},
+ {"floating point trap outputting a constant", 3000},
+ {"initializer for integer value is too complicated", 3001},
+ {"initializer for floating value is not a floating constant", 3002},
+ {"unknown set constructor type", 3003},
+ {"invalid initial value for member `%s'", 3004},
+ {"weak declaration of `%s' must be public", 3005},
+ {"weak declaration of `%s' must precede definition", 3006},
+ {"only weak aliases are supported in this configuration", 3007},
+ {"alias definitions not supported in this configuration; ignored", 3008},
+ {"Virtual array %s[%lu]: element %lu out of bounds", 3009},
+ {"No sclass for %s stab (0x%x)\n", 3010},
+ {"`-p' not supported; use `-pg' and gprof(1)", 3011},
+ {"may not use both -EB and -EL", 3012},
+ {"-mapcs-26 and -mapcs-32 may not be used together", 3013},
+ {"-msoft-float and -mhard_float may not be used together", 3014},
+ {"-mbig-endian and -mlittle-endian may not be used together", 3015},
+ {"Incompatible interworking options", 3016},
+ {"-mbsd and -pedantic incompatible", 3017},
+ {"-mbsd and -mxopen incompatible", 3018},
+ {"-mxopen and -pedantic incompatible", 3019},
+ {"A -ifile option requires a -map option", 3020},
+ {"mno-cygwin and mno-win32 are not compatible", 3021},
+ {"shared and mdll are not compatible", 3022},
+ {"-static not valid with -mcoff", 3023},
+ {"-shared not valid with -mcoff", 3024},
+ {"-symbolic not valid with -mcoff", 3025},
+ {"-fpic is not valid with -mcoff", 3026},
+ {"-fPIC is not valid with -mcoff", 3027},
+ {"-fpic not valid with -mcoff", 3028},
+ {"-fPIC not valid with -mcoff", 3029},
+ {"bx]", 3030},
+ {"bx", 3031},
+ {"cx", 3032},
+ {"-p option not supported: use -pg instead", 3033},
+ {"choose either big or little endian, not both", 3034},
+ {"choose either m340 or m210 not both", 3035},
+ {"the m210 does not have little endian support", 3036},
+ {"-pipe is not supported.", 3037},
+ {"may not use both -mfp64 and -msingle-float", 3038},
+ {"may not use both -mfp64 and -m4650", 3039},
+ {"-mhard-float not supported.", 3040},
+ {"-msingle-float and -msoft-float can not both be specified.", 3041},
+ {"-p profiling is no longer supported. Use -pg instead.", 3042},
+ {"profiling not supported with -mg\n", 3043},
+ {"GNU C does not support -C without using -E", 3044},
+ {"-pg and -fomit-frame-pointer are incompatible", 3045},
+ {"-E required when input is from standard input", 3046},
+ {"Compilation of header file requested", 3047},
+ {"-fjni and -femit-class-files are incompatible", 3048},
+ {"-fjni and -femit-class-file are incompatible", 3049},
};
-int _msg_tbl_length = 2353;
+int _msg_tbl_length = 3049;
diff --git a/gcc/po/gcc.pot b/gcc/po/gcc.pot
index f517c5c51d9..c13121b9183 100644
--- a/gcc/po/gcc.pot
+++ b/gcc/po/gcc.pot
@@ -6,15 +6,15 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
-"POT-Creation-Date: 2000-09-12 04:07+0200\n"
+"POT-Creation-Date: 2001-06-11 15:08-0700\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
-"Content-Transfer-Encoding: ENCODING\n"
+"Content-Transfer-Encoding: 8bit\n"
-#: builtins.c:239
+#: builtins.c:280
msgid "offset outside bounds of constant string"
msgstr ""
@@ -25,1850 +25,2163 @@ msgstr ""
#. port (i860) that used this code, and I'm unconvinced it could actually
#. handle the general case. So we no longer try to handle anything
#. weird and make the backend absorb the evil.
-#: builtins.c:1803
+#: builtins.c:2634
msgid "__builtin_saveregs not supported by this target"
msgstr ""
-#: builtins.c:1846
+#: builtins.c:2677
msgid "argument of `__builtin_args_info' must be constant"
msgstr ""
-#: builtins.c:1852
+#: builtins.c:2683
msgid "argument of `__builtin_args_info' out of range"
msgstr ""
-#: builtins.c:1858
+#: builtins.c:2689
msgid "missing argument in `__builtin_args_info'"
msgstr ""
-#: builtins.c:1889
+#: builtins.c:2720
msgid "`va_start' used in function with fixed args"
msgstr ""
-#: builtins.c:1908
+#: builtins.c:2739
msgid "second parameter of `va_start' not last named argument"
msgstr ""
#. Evidently an out of date version of <stdarg.h>; can't validate
#. va_start's second argument, but can still work as intended.
-#: builtins.c:1913
+#: builtins.c:2744
msgid "`__builtin_next_arg' called without an argument"
msgstr ""
-#: builtins.c:2006
+#: builtins.c:2846
msgid "too many arguments to function `va_start'"
msgstr ""
-#: builtins.c:2092
+#: builtins.c:2932
msgid "first argument to `va_arg' not of type `va_list'"
msgstr ""
-#: builtins.c:2120
+#: builtins.c:2960
#, c-format
msgid "`%s' is promoted to `%s' when passed through `...'"
msgstr ""
-#: builtins.c:2124
+#: builtins.c:2964
#, c-format
msgid "(so you should pass `%s' not `%s' to `va_arg')"
msgstr ""
-#: builtins.c:2233
+#: builtins.c:3073
msgid "invalid arg to `__builtin_frame_address'"
msgstr ""
-#: builtins.c:2235
+#: builtins.c:3075
msgid "invalid arg to `__builtin_return_address'"
msgstr ""
-#: builtins.c:2248
+#: builtins.c:3088
msgid "unsupported arg to `__builtin_frame_address'"
msgstr ""
-#: builtins.c:2250
+#: builtins.c:3090
msgid "unsupported arg to `__builtin_return_address'"
msgstr ""
-#: builtins.c:2332
+#: builtins.c:3253
msgid "second arg to `__builtin_expect' must be a constant"
msgstr ""
-#: builtins.c:2581
+#: builtins.c:3564
msgid "__builtin_longjmp second argument must be 1"
msgstr ""
-#: builtins.c:2595
+#: builtins.c:3578
msgid "__builtin_trap not supported by this target"
msgstr ""
#. just do library call, if unknown builtin
-#: builtins.c:2633
+#: builtins.c:3630 c-common.c:4256
#, c-format
msgid "built-in function `%s' not currently supported"
msgstr ""
-#: c-common.c:387
+#: c-common.c:465
#, c-format
msgid ""
-"string length `%d' is greater than the minimum length `%d' ISO C%d is "
+"string length `%d' is greater than the length `%d' ISO C%d compilers are "
"required to support"
msgstr ""
-#: c-common.c:552
+#: c-common.c:630
#, c-format
msgid "`%s' attribute directive ignored"
msgstr ""
-#: c-common.c:560
+#: c-common.c:638
#, c-format
msgid "`%s' attribute does not apply to types"
msgstr ""
-#: c-common.c:567
+#: c-common.c:645
#, c-format
msgid "wrong number of arguments specified for `%s' attribute"
msgstr ""
-#: c-common.c:583 c-common.c:590 c-common.c:597 c-common.c:610 c-common.c:618
-#: c-common.c:633 c-common.c:646 c-common.c:654 c-common.c:670 c-common.c:682
-#: c-common.c:694 c-common.c:699 c-common.c:1033 c-common.c:1185
+#: c-common.c:661 c-common.c:668 c-common.c:675 c-common.c:688 c-common.c:696
+#: c-common.c:711 c-common.c:724 c-common.c:732 c-common.c:748 c-common.c:760
+#: c-common.c:772 c-common.c:777 c-common.c:951 c-common.c:1103
#, c-format
msgid "`%s' attribute ignored"
msgstr ""
-#: c-common.c:732
+#: c-common.c:810
#, c-format
msgid "unknown machine mode `%s'"
msgstr ""
-#: c-common.c:735
+#: c-common.c:813
#, c-format
msgid "no data type for mode `%s'"
msgstr ""
-#: c-common.c:755
+#: c-common.c:820
+#, c-format
+msgid "type with more precision than %s"
+msgstr ""
+
+#: c-common.c:839
msgid "section attribute cannot be specified for local variables"
msgstr ""
-#: c-common.c:762
+#: c-common.c:846
#, c-format
msgid "section of `%s' conflicts with previous declaration"
msgstr ""
-#: c-common.c:768
+#: c-common.c:852
#, c-format
msgid "section attribute not allowed for `%s'"
msgstr ""
-#: c-common.c:771
+#: c-common.c:855
msgid "section attributes are not supported for this target"
msgstr ""
-#: c-common.c:790
+#: c-common.c:874
msgid "requested alignment is not a constant"
msgstr ""
-#: c-common.c:795
+#: c-common.c:879
msgid "requested alignment is not a power of 2"
msgstr ""
-#: c-common.c:797
+#: c-common.c:881
msgid "requested alignment is too large"
msgstr ""
-#: c-common.c:820
+#: c-common.c:904
#, c-format
msgid "alignment may not be specified for `%s'"
msgstr ""
-#: c-common.c:843 c-common.c:949
-#, c-format
-msgid "argument format specified for non-function `%s'"
-msgstr ""
-
-#: c-common.c:849
-msgid "unrecognized format specifier"
-msgstr ""
-
-#: c-common.c:865
-#, c-format
-msgid "`%s' is an unrecognized format function type"
-msgstr ""
-
-#: c-common.c:887 c-common.c:963
-msgid "format string has invalid operand number"
-msgstr ""
-
-#: c-common.c:895
-msgid "format string arg follows the args to be formatted"
-msgstr ""
-
-#: c-common.c:914 c-common.c:984
-msgid "format string arg not a string type"
-msgstr ""
-
-#: c-common.c:927
-msgid "args to be formatted is not '...'"
-msgstr ""
-
-#: c-common.c:993
-msgid "function does not return string type"
-msgstr ""
-
-#: c-common.c:1011
+#: c-common.c:929
#, c-format
msgid "`%s' defined both normally and as an alias"
msgstr ""
-#: c-common.c:1019
+#: c-common.c:937
msgid "alias arg not a string"
msgstr ""
-#: c-common.c:1040 c-common.c:1057 c-common.c:1074
+#: c-common.c:958 c-common.c:975 c-common.c:992
#, c-format
msgid "`%s' attribute applies only to functions"
msgstr ""
-#: c-common.c:1046 c-common.c:1063 c-common.c:1080
+#: c-common.c:964 c-common.c:981 c-common.c:998
#, c-format
msgid "can't set `%s' attribute after definition"
msgstr ""
-#: c-common.c:1632
-msgid "too few arguments for format"
-msgstr ""
-
-#: c-common.c:1730 c-common.c:1751
-msgid "missing $ operand number in format"
-msgstr ""
-
-#: c-common.c:1760
-#, ycp-format
-msgid "ISO C does not support %%n$ operand number formats"
-msgstr ""
-
-#: c-common.c:1766
-msgid "operand number out of range in format"
-msgstr ""
-
-#: c-common.c:1818
-#, c-format
-msgid "format argument %d unused before used argument %d in $-style format"
-msgstr ""
-
-#: c-common.c:1822
-msgid "unused arguments in $-style format"
-msgstr ""
-
-#: c-common.c:1912
-msgid "null format string"
-msgstr ""
-
-#: c-common.c:1923 c-common.c:1935
-msgid "format not a string literal, argument types not checked"
-msgstr ""
-
-#: c-common.c:1941
-msgid "zero-length format string"
-msgstr ""
-
-#: c-common.c:1944
-msgid "unterminated format string"
-msgstr ""
-
-#: c-common.c:1967
-msgid "embedded `\\0' in format"
-msgstr ""
-
-#: c-common.c:1970
-msgid "too many arguments for format"
-msgstr ""
-
-#: c-common.c:1979
-#, ycp-format
-msgid "spurious trailing `%%' in format"
-msgstr ""
-
-#: c-common.c:2019
-msgid "zero width in scanf format"
-msgstr ""
-
-#: c-common.c:2026
-#, c-format
-msgid "ISO C does not support the strftime `%c' flag"
-msgstr ""
-
-#: c-common.c:2030 c-common.c:2083
-#, c-format
-msgid "repeated `%c' flag in format"
-msgstr ""
-
-#: c-common.c:2047
-msgid "ISO C does not support strftime format width"
-msgstr ""
-
-#: c-common.c:2055
-msgid "multiple E/O modifiers in format"
-msgstr ""
-
-#: c-common.c:2095
-msgid "use of both ` ' and `+' flags in format"
-msgstr ""
-
-#: c-common.c:2100
-msgid "use of both `0' and `-' flags in format"
-msgstr ""
-
-#: c-common.c:2102
-msgid "ISO C does not support the `'' format flag"
-msgstr ""
-
-#: c-common.c:2104
-msgid "ISO C does not support the `I' format flag"
-msgstr ""
-
-#: c-common.c:2144
-#, c-format
-msgid "field width is not type int (arg %d)"
-msgstr ""
-
-#: c-common.c:2193
-#, c-format
-msgid "field precision is not type int (arg %d)"
-msgstr ""
-
-#: c-common.c:2239
-#, c-format
-msgid "ISO C does not support the `%s' %s length modifier"
-msgstr ""
-
-#: c-common.c:2243
-#, c-format
-msgid "ISO C89 does not support the `%s' %s length modifier"
-msgstr ""
-
-#: c-common.c:2258
-#, c-format
-msgid "use of `*' and `%s' together in format"
-msgstr ""
-
-#: c-common.c:2264
-msgid "conversion lacks type at end of format"
-msgstr ""
-
-#: c-common.c:2275
-#, c-format
-msgid "unknown conversion type character `%c' in format"
-msgstr ""
-
-#: c-common.c:2278
-#, c-format
-msgid "unknown conversion type character 0x%x in format"
+#: c-common.c:1131
+msgid "overflow in constant expression"
msgstr ""
-#: c-common.c:2285
-msgid "ISO C does not support the `%%%c' %s format"
+#: c-common.c:1152
+msgid "integer overflow in expression"
msgstr ""
-#: c-common.c:2289
-msgid "ISO C89 does not support the `%%%c' %s format"
+#: c-common.c:1161
+msgid "floating point overflow in expression"
msgstr ""
-#: c-common.c:2294
-msgid "ISO C does not support `%%O%c'"
+#. This detects cases like converting -129 or 256 to unsigned char.
+#: c-common.c:1182
+msgid "large integer implicitly truncated to unsigned type"
msgstr ""
-#: c-common.c:2296
-msgid "ISO C89 does not support `%%O%c'"
+#: c-common.c:1184
+msgid "negative integer implicitly converted to unsigned type"
msgstr ""
-#: c-common.c:2299
-msgid "ISO C89 does not support `%%E%c'"
+#: c-common.c:1231
+msgid "overflow in implicit constant conversion"
msgstr ""
-#: c-common.c:2302
+#: c-common.c:1379
#, c-format
-msgid "width used with `%c' format"
+msgid "operation on `%s' may be undefined"
msgstr ""
-#: c-common.c:2305
-msgid "`%%%c' yields only last 2 digits of year in some locales"
+#: c-common.c:1664
+msgid "expression statement has incomplete type"
msgstr ""
-#: c-common.c:2308
-msgid "`%%%c' yields only last 2 digits of year"
+#: c-common.c:1697
+msgid "case label does not reduce to an integer constant"
msgstr ""
-#: c-common.c:2310
-#, c-format
-msgid "precision used with `%c' format"
+#: c-common.c:1967
+msgid "invalid truth-value expression"
msgstr ""
-#: c-common.c:2313
+#: c-common.c:2018
#, c-format
-msgid "`a' flag used with `%c' format"
-msgstr ""
-
-#: c-common.c:2319
-msgid "ISO C does not support the `a' flag"
-msgstr ""
-
-#. The end of the format string was reached.
-#: c-common.c:2333
-#, ycp-format
-msgid "no closing `]' for `%%[' format"
+msgid "invalid operands to binary %s"
msgstr ""
-#: c-common.c:2338
-#, c-format
-msgid "suppression of `%c' conversion in format"
+#: c-common.c:2253 c-common.c:2262
+msgid "comparison is always false due to limited range of data type"
msgstr ""
-#: c-common.c:2344
-#, c-format
-msgid "flag `%c' used with type `%c'"
+#: c-common.c:2255 c-common.c:2264
+msgid "comparison is always true due to limited range of data type"
msgstr ""
-#: c-common.c:2353
-#, c-format
-msgid "`0' flag ignored with precision specifier and `%c' format"
+#: c-common.c:2330
+msgid "comparison of unsigned expression >= 0 is always true"
msgstr ""
-#: c-common.c:2360
-#, c-format
-msgid "use of `%s' length modifier with `%c' type character"
+#: c-common.c:2339
+msgid "comparison of unsigned expression < 0 is always false"
msgstr ""
-#: c-common.c:2370
-msgid "ISO C does not support the `%%%s%c' %s format"
+#: c-common.c:2390 f/com.c:15291
+msgid "struct type value used where scalar is required"
msgstr ""
-#: c-common.c:2374
-msgid "ISO C89 does not support the `%%%s%c' %s format"
+#: c-common.c:2394 f/com.c:15295
+msgid "union type value used where scalar is required"
msgstr ""
-#: c-common.c:2428
-#, c-format
-msgid "writing into constant object (arg %d)"
+#: c-common.c:2398 f/com.c:15299
+msgid "array type value used where scalar is required"
msgstr ""
-#: c-common.c:2439
-#, c-format
-msgid "extra type qualifiers in format argument (arg %d)"
+#: c-common.c:2513 f/com.c:15425
+msgid "suggest parentheses around assignment used as truth value"
msgstr ""
-#: c-common.c:2447
-#, c-format
-msgid "format argument is not a pointer (arg %d)"
+#: c-common.c:2557 c-common.c:2589
+msgid "invalid use of `restrict'"
msgstr ""
-#: c-common.c:2449
+#: c-common.c:3724 c-typeck.c:1792
#, c-format
-msgid "format argument is not a pointer to a pointer (arg %d)"
+msgid "too few arguments to function `%s'"
msgstr ""
-#: c-common.c:2539
+#: c-common.c:3730 c-typeck.c:1644
#, c-format
-msgid "%s format, %s arg (arg %d)"
-msgstr ""
-
-#: c-common.c:2558
-msgid "overflow in constant expression"
-msgstr ""
-
-#: c-common.c:2579
-msgid "integer overflow in expression"
-msgstr ""
-
-#: c-common.c:2588
-msgid "floating point overflow in expression"
-msgstr ""
-
-#. This detects cases like converting -129 or 256 to unsigned char.
-#: c-common.c:2609
-msgid "large integer implicitly truncated to unsigned type"
-msgstr ""
-
-#: c-common.c:2611
-msgid "negative integer implicitly converted to unsigned type"
-msgstr ""
-
-#: c-common.c:2644
-msgid "overflow in implicit constant conversion"
+msgid "too many arguments to function `%s'"
msgstr ""
-#: c-common.c:2665
-msgid "expression statement has incomplete type"
+#: c-common.c:3917
+msgid "pointers are not permitted as case values"
msgstr ""
-#: c-common.c:2697
-msgid "case label does not reduce to an integer constant"
+#: c-common.c:3923
+msgid "ISO C++ forbids range expressions in switch statements"
msgstr ""
-#: c-common.c:2967
-msgid "invalid truth-value expression"
+#: c-common.c:3925
+msgid "ISO C forbids range expressions in switch statements"
msgstr ""
-#: c-common.c:3018
-#, c-format
-msgid "invalid operands to binary %s"
+#: c-common.c:3955
+msgid "empty range specified"
msgstr ""
-#: c-common.c:3253 c-common.c:3262
-msgid "comparison is always false due to limited range of data type"
+#: c-common.c:4006
+msgid "duplicate (or overlapping) case value"
msgstr ""
-#: c-common.c:3255 c-common.c:3264
-msgid "comparison is always true due to limited range of data type"
+#: c-common.c:4008
+msgid "this is the first entry overlapping that value"
msgstr ""
-#: c-common.c:3330
-msgid "comparison of unsigned expression >= 0 is always true"
+#: c-common.c:4012
+msgid "duplicate case value"
msgstr ""
-#: c-common.c:3339
-msgid "comparison of unsigned expression < 0 is always false"
+#: c-common.c:4013
+msgid "previously used here"
msgstr ""
-#: c-common.c:3390
-msgid "struct type value used where scalar is required"
+#: c-common.c:4017
+msgid "multiple default labels in one switch"
msgstr ""
-#: c-common.c:3394
-msgid "union type value used where scalar is required"
+#: c-common.c:4018
+msgid "this is the first default label"
msgstr ""
-#: c-common.c:3398
-msgid "array type value used where scalar is required"
+#: c-common.c:4526
+msgid "-Wformat-y2k ignored without -Wformat"
msgstr ""
-#: c-common.c:3513
-msgid "suggest parentheses around assignment used as truth value"
+#: c-common.c:4528
+msgid "-Wformat-extra-args ignored without -Wformat"
msgstr ""
-#: c-common.c:3638 c-common.c:3670
-msgid "invalid use of `restrict'"
+#: c-common.c:4530
+msgid "-Wformat-nonliteral ignored without -Wformat"
msgstr ""
-#: c-common.c:4372 c-typeck.c:1741
-#, c-format
-msgid "too few arguments to function `%s'"
+#: c-common.c:4532
+msgid "-Wformat-security ignored without -Wformat"
msgstr ""
-#: c-common.c:4378 c-typeck.c:1600
-#, c-format
-msgid "too many arguments to function `%s'"
+#: c-common.c:4534
+msgid "-Wmissing-format-attribute ignored without -Wformat"
msgstr ""
-#: c-convert.c:78 c-typeck.c:940 c-typeck.c:4037 cp/typeck.c:1729
-#: cp/typeck.c:6431
+#: c-convert.c:78 c-typeck.c:983 c-typeck.c:4098 cp/typeck.c:1754
+#: cp/typeck.c:6304
msgid "void value not ignored as it ought to be"
msgstr ""
-#: c-convert.c:100
+#: c-convert.c:110 java/typeck.c:150
msgid "conversion to non-scalar type requested"
msgstr ""
-#: c-decl.c:606
+#: c-decl.c:550
#, c-format
msgid "unknown C standard `%s'"
msgstr ""
-#: c-decl.c:875
+#: c-decl.c:844
#, c-format
msgid "array `%s' assumed to have one element"
msgstr ""
-#: c-decl.c:1051
+#: c-decl.c:1020
#, c-format
msgid "`struct %s' incomplete in scope ending here"
msgstr ""
-#: c-decl.c:1054
+#: c-decl.c:1023
#, c-format
msgid "`union %s' incomplete in scope ending here"
msgstr ""
-#: c-decl.c:1057
+#: c-decl.c:1026
#, c-format
msgid "`enum %s' incomplete in scope ending here"
msgstr ""
-#: c-decl.c:1171 c-decl.c:1331
+#: c-decl.c:1140 c-decl.c:1305 java/decl.c:1337
#, c-format
msgid "label `%s' used but not defined"
msgstr ""
-#: c-decl.c:1177 c-decl.c:1338
+#: c-decl.c:1146 c-decl.c:1312 java/decl.c:1343
#, c-format
msgid "label `%s' defined but not used"
msgstr ""
-#: c-decl.c:1460 c-decl.c:1513
+#: c-decl.c:1434 c-decl.c:1487
#, c-format
msgid "shadowing built-in function `%s'"
msgstr ""
-#: c-decl.c:1462
+#: c-decl.c:1436
#, c-format
msgid "shadowing library function `%s'"
msgstr ""
-#: c-decl.c:1468
+#: c-decl.c:1442
#, c-format
msgid "library function `%s' declared as non-function"
msgstr ""
-#: c-decl.c:1472 c-decl.c:1475
+#: c-decl.c:1446 c-decl.c:1449
#, c-format
msgid "built-in function `%s' declared as non-function"
msgstr ""
-#: c-decl.c:1479 objc/objc-act.c:2490 objc/objc-act.c:6161
+#: c-decl.c:1453 objc/objc-act.c:2480 objc/objc-act.c:6133
#, c-format
msgid "`%s' redeclared as different kind of symbol"
msgstr ""
-#: c-decl.c:1480 c-decl.c:1658 c-decl.c:1805 objc/objc-act.c:2492
-#: objc/objc-act.c:6163 objc/objc-act.c:6218
+#: c-decl.c:1454 c-decl.c:1632 c-decl.c:1779 objc/objc-act.c:2482
+#: objc/objc-act.c:6135 objc/objc-act.c:6193
#, c-format
msgid "previous declaration of `%s'"
msgstr ""
#. If types don't match for a built-in, throw away the built-in.
-#: c-decl.c:1562
+#: c-decl.c:1536
#, c-format
msgid "conflicting types for built-in function `%s'"
msgstr ""
-#: c-decl.c:1605 c-decl.c:1624
+#: c-decl.c:1579 c-decl.c:1598
#, c-format
msgid "conflicting types for `%s'"
msgstr ""
-#: c-decl.c:1647
+#: c-decl.c:1621
msgid ""
"A parameter list with an ellipsis can't match an empty parameter name list "
"declaration."
msgstr ""
-#: c-decl.c:1653
+#: c-decl.c:1627
msgid ""
"An argument type that has a default promotion can't match an empty parameter "
"name list declaration."
msgstr ""
-#: c-decl.c:1668 c-decl.c:1690
+#: c-decl.c:1642 c-decl.c:1664
#, c-format
msgid "redefinition of `%s'"
msgstr ""
-#: c-decl.c:1671
+#: c-decl.c:1645
#, c-format
msgid "redeclaration of `%s'"
msgstr ""
-#: c-decl.c:1674
+#: c-decl.c:1648
#, c-format
msgid "conflicting declarations of `%s'"
msgstr ""
-#: c-decl.c:1683 c-decl.c:1695
+#: c-decl.c:1657 c-decl.c:1669
#, c-format
msgid "`%s' previously defined here"
msgstr ""
-#: c-decl.c:1684 c-decl.c:1696
+#: c-decl.c:1658 c-decl.c:1670
#, c-format
msgid "`%s' previously declared here"
msgstr ""
-#: c-decl.c:1717
+#: c-decl.c:1691
#, c-format
msgid "prototype for `%s' follows"
msgstr ""
-#: c-decl.c:1718 c-decl.c:1726 c-decl.c:1742
+#: c-decl.c:1692 c-decl.c:1700 c-decl.c:1716
msgid "non-prototype definition here"
msgstr ""
-#: c-decl.c:1725
+#: c-decl.c:1699
#, c-format
msgid "prototype for `%s' follows and number of arguments doesn't match"
msgstr ""
-#: c-decl.c:1740
+#: c-decl.c:1714
#, c-format
msgid "prototype for `%s' follows and argument %d doesn't match"
msgstr ""
-#: c-decl.c:1757
+#: c-decl.c:1731
#, c-format
msgid "`%s' declared inline after being called"
msgstr ""
-#: c-decl.c:1762
+#: c-decl.c:1736
#, c-format
msgid "`%s' declared inline after its definition"
msgstr ""
-#: c-decl.c:1769
+#: c-decl.c:1743
#, c-format
msgid "static declaration for `%s' follows non-static"
msgstr ""
-#: c-decl.c:1777
+#: c-decl.c:1751
#, c-format
msgid "non-static declaration for `%s' follows static"
msgstr ""
-#: c-decl.c:1784
+#: c-decl.c:1758
#, c-format
msgid "const declaration for `%s' follows non-const"
msgstr ""
-#: c-decl.c:1791
+#: c-decl.c:1765
#, c-format
msgid "type qualifiers for `%s' conflict with previous decl"
msgstr ""
-#: c-decl.c:1804
+#: c-decl.c:1778
#, c-format
msgid "redundant redeclaration of `%s' in same scope"
msgstr ""
-#: c-decl.c:2074
+#: c-decl.c:2069
#, c-format
msgid "nested extern declaration of `%s'"
msgstr ""
-#: c-decl.c:2099
+#: c-decl.c:2094 java/decl.c:989
#, c-format
msgid "`%s' used prior to declaration"
msgstr ""
-#: c-decl.c:2120 c-decl.c:2335
+#: c-decl.c:2115 c-decl.c:2330
#, c-format
msgid "`%s' was declared implicitly `extern' and later `static'"
msgstr ""
-#: c-decl.c:2230
+#: c-decl.c:2225
msgid "type mismatch with previous external decl"
msgstr ""
-#: c-decl.c:2231
+#: c-decl.c:2226
#, c-format
msgid "previous external decl of `%s'"
msgstr ""
-#: c-decl.c:2244
+#: c-decl.c:2239
msgid "type mismatch with previous implicit declaration"
msgstr ""
-#: c-decl.c:2246
+#: c-decl.c:2241
#, c-format
msgid "previous implicit declaration of `%s'"
msgstr ""
-#: c-decl.c:2263
+#: c-decl.c:2258
#, c-format
msgid "type of external `%s' is not global"
msgstr ""
-#: c-decl.c:2314
+#: c-decl.c:2309
#, c-format
msgid "`%s' was previously implicitly declared to return `int'"
msgstr ""
-#: c-decl.c:2339
+#: c-decl.c:2334
#, c-format
msgid "`%s' was declared `extern' and later `static'"
msgstr ""
-#: c-decl.c:2362
+#: c-decl.c:2357
#, c-format
msgid "extern declaration of `%s' doesn't match global one"
msgstr ""
-#: c-decl.c:2402
+#: c-decl.c:2397
#, c-format
msgid "`%s' locally external but globally static"
msgstr ""
-#: c-decl.c:2438 c-decl.c:2463 cp/decl.c:4231
+#: c-decl.c:2433 c-decl.c:2458 cp/decl.c:4225 java/decl.c:1036
#, c-format
msgid "declaration of `%s' shadows a parameter"
msgstr ""
-#: c-decl.c:2441
+#: c-decl.c:2436 java/decl.c:1039
#, c-format
msgid "declaration of `%s' shadows a symbol from the parameter list"
msgstr ""
-#: c-decl.c:2465 cp/decl.c:4239
+#: c-decl.c:2460 cp/decl.c:4233
#, c-format
msgid "declaration of `%s' shadows previous local"
msgstr ""
#. XXX shadow warnings in outer-more namespaces
-#: c-decl.c:2468 cp/decl.c:4243
+#: c-decl.c:2463 cp/decl.c:4237
#, c-format
msgid "declaration of `%s' shadows global declaration"
msgstr ""
-#: c-decl.c:2558
+#: c-decl.c:2553
#, c-format
msgid "function `%s' was previously declared within a block"
msgstr ""
-#: c-decl.c:2575 c-decl.c:2577
+#: c-decl.c:2570 c-decl.c:2572
#, c-format
msgid "implicit declaration of function `%s'"
msgstr ""
-#: c-decl.c:2664
+#: c-decl.c:2659
#, c-format
msgid "label %s referenced outside of any function"
msgstr ""
-#: c-decl.c:2724
+#: c-decl.c:2716
#, c-format
msgid "duplicate label declaration `%s'"
msgstr ""
-#: c-decl.c:2727
+#: c-decl.c:2719
msgid "this is a previous declaration"
msgstr ""
-#: c-decl.c:3357
+#: c-decl.c:3246
msgid "unnamed struct/union that defines no instances"
msgstr ""
-#: c-decl.c:3376
+#: c-decl.c:3265
msgid "useless keyword or type name in empty declaration"
msgstr ""
-#: c-decl.c:3383
+#: c-decl.c:3272
msgid "two types specified in one empty declaration"
msgstr ""
-#: c-decl.c:3388 c-parse.y:300 c-parse.y:720 c-parse.y:722 c-parse.y:779
-#: objc-parse.y:329 objc-parse.y:772 objc-parse.y:774 objc-parse.y:831
-#: objc-parse.y:2510 parse.y:701 parse.y:1760
+#: c-decl.c:3277 c-parse.y:303 c-parse.y:722 c-parse.y:724 c-parse.y:774
+#: cp/parse.y:724 cp/parse.y:1781 objc/objc-parse.y:332 objc/objc-parse.y:774
+#: objc/objc-parse.y:776 objc/objc-parse.y:826 objc/objc-parse.y:2574
msgid "empty declaration"
msgstr ""
-#: c-decl.c:3445
+#: c-decl.c:3334
#, c-format
msgid "`%s' is usually a function"
msgstr ""
-#: c-decl.c:3459
+#: c-decl.c:3348
#, c-format
msgid "typedef `%s' is initialized"
msgstr ""
-#: c-decl.c:3466
+#: c-decl.c:3355
#, c-format
msgid "function `%s' is initialized like a variable"
msgstr ""
#. DECL_INITIAL in a PARM_DECL is really DECL_ARG_TYPE.
-#: c-decl.c:3473
+#: c-decl.c:3362
#, c-format
msgid "parameter `%s' is initialized"
msgstr ""
-#: c-decl.c:3488 c-typeck.c:4758
+#: c-decl.c:3382 c-typeck.c:4829
msgid "variable-sized object may not be initialized"
msgstr ""
-#: c-decl.c:3494
+#: c-decl.c:3388
#, c-format
msgid "variable `%s' has initializer but incomplete type"
msgstr ""
-#: c-decl.c:3500
+#: c-decl.c:3394
#, c-format
msgid "elements of array `%s' have incomplete type"
msgstr ""
-#: c-decl.c:3513
+#: c-decl.c:3407
#, c-format
msgid "declaration of `%s' has `extern' and is initialized"
msgstr ""
-#: c-decl.c:3625
+#: c-decl.c:3521
#, c-format
msgid "initializer fails to determine size of `%s'"
msgstr ""
-#: c-decl.c:3630
+#: c-decl.c:3526
#, c-format
msgid "array size missing in `%s'"
msgstr ""
-#: c-decl.c:3646
+#: c-decl.c:3542
#, c-format
msgid "zero or negative size array `%s'"
msgstr ""
-#: c-decl.c:3671
+#: c-decl.c:3570
#, c-format
msgid "storage size of `%s' isn't known"
msgstr ""
-#: c-decl.c:3681
+#: c-decl.c:3580
#, c-format
msgid "storage size of `%s' isn't constant"
msgstr ""
-#: c-decl.c:3781
+#: c-decl.c:3631
+#, c-format
+msgid "ignoring asm-specifier for non-static local variable `%s'"
+msgstr ""
+
+#: c-decl.c:3706
#, c-format
msgid "ANSI C forbids parameter `%s' shadowing typedef"
msgstr ""
-#: c-decl.c:4015 cp/decl.c:10230
+#: c-decl.c:3940 cp/decl.c:10013
msgid "`long long long' is too long for GCC"
msgstr ""
-#: c-decl.c:4020
+#: c-decl.c:3945
msgid "ISO C89 does not support `long long'"
msgstr ""
-#: c-decl.c:4025 cp/decl.c:10235
+#: c-decl.c:3950 cp/decl.c:10018
#, c-format
msgid "duplicate `%s'"
msgstr ""
-#: c-decl.c:4031 cp/decl.c:10255
+#: c-decl.c:3956 cp/decl.c:10038
#, c-format
msgid "two or more data types in declaration of `%s'"
msgstr ""
-#: c-decl.c:4046 cp/decl.c:10260
+#: c-decl.c:3971 cp/decl.c:10043
#, c-format
msgid "`%s' fails to be a typedef or built in type"
msgstr ""
-#: c-decl.c:4112
+#: c-decl.c:4009
+#, c-format
+msgid "type defaults to `int' in declaration of `%s'"
+msgstr ""
+
+#: c-decl.c:4038
#, c-format
msgid "both long and short specified for `%s'"
msgstr ""
-#: c-decl.c:4116 cp/decl.c:10360
+#: c-decl.c:4042 cp/decl.c:10142
#, c-format
msgid "long or short specified with char for `%s'"
msgstr ""
-#: c-decl.c:4123 cp/decl.c:10364
+#: c-decl.c:4049 cp/decl.c:10146
#, c-format
msgid "long or short specified with floating type for `%s'"
msgstr ""
-#: c-decl.c:4126
+#: c-decl.c:4052
msgid "the only valid combination is `long double'"
msgstr ""
-#: c-decl.c:4132
+#: c-decl.c:4058
#, c-format
msgid "both signed and unsigned specified for `%s'"
msgstr ""
-#: c-decl.c:4134 cp/decl.c:10353
+#: c-decl.c:4060 cp/decl.c:10135
#, c-format
msgid "long, short, signed or unsigned invalid for `%s'"
msgstr ""
-#: c-decl.c:4140 cp/decl.c:10373
+#: c-decl.c:4066 cp/decl.c:10155
#, c-format
msgid "long, short, signed or unsigned used invalidly for `%s'"
msgstr ""
-#: c-decl.c:4159 cp/decl.c:10394
+#: c-decl.c:4085 cp/decl.c:10176
#, c-format
msgid "complex invalid for `%s'"
msgstr ""
-#: c-decl.c:4235 c-decl.c:4591 cp/decl.c:10993
+#: c-decl.c:4130
+msgid "ISO C89 does not support complex types"
+msgstr ""
+
+#: c-decl.c:4142
+msgid "ISO C does not support plain `complex' meaning `double complex'"
+msgstr ""
+
+#: c-decl.c:4148 c-decl.c:4160
+msgid "ISO C does not support complex integer types"
+msgstr ""
+
+#: c-decl.c:4175 c-decl.c:4571 cp/decl.c:10775
msgid "duplicate `const'"
msgstr ""
-#: c-decl.c:4237 c-decl.c:4595 cp/decl.c:10997
+#: c-decl.c:4177 c-decl.c:4575 cp/decl.c:10779
msgid "duplicate `restrict'"
msgstr ""
-#: c-decl.c:4239 c-decl.c:4593 cp/decl.c:10995
+#: c-decl.c:4179 c-decl.c:4573 cp/decl.c:10777
msgid "duplicate `volatile'"
msgstr ""
-#: c-decl.c:4261 cp/decl.c:10543
+#: c-decl.c:4201 cp/decl.c:10325
#, c-format
msgid "multiple storage classes in declaration of `%s'"
msgstr ""
-#: c-decl.c:4270
+#: c-decl.c:4210
msgid "function definition declared `auto'"
msgstr ""
-#: c-decl.c:4272
+#: c-decl.c:4212
msgid "function definition declared `register'"
msgstr ""
-#: c-decl.c:4274
+#: c-decl.c:4214
msgid "function definition declared `typedef'"
msgstr ""
-#: c-decl.c:4287
+#: c-decl.c:4227
#, c-format
msgid "storage class specified for structure field `%s'"
msgstr ""
-#: c-decl.c:4291 cp/decl.c:10590
+#: c-decl.c:4231 cp/decl.c:10372
#, c-format
msgid "storage class specified for parameter `%s'"
msgstr ""
-#: c-decl.c:4294 cp/decl.c:10592
+#: c-decl.c:4234 cp/decl.c:10374
msgid "storage class specified for typename"
msgstr ""
-#: c-decl.c:4306 cp/decl.c:10606
+#: c-decl.c:4246 cp/decl.c:10388
#, c-format
msgid "`%s' initialized and declared `extern'"
msgstr ""
-#: c-decl.c:4308 cp/decl.c:10609
+#: c-decl.c:4248 cp/decl.c:10391
#, c-format
msgid "`%s' has both `extern' and initializer"
msgstr ""
-#: c-decl.c:4312 cp/decl.c:10613
+#: c-decl.c:4252 cp/decl.c:10395
#, c-format
msgid "nested function `%s' declared `extern'"
msgstr ""
-#: c-decl.c:4315 cp/decl.c:10617
+#: c-decl.c:4255 cp/decl.c:10399
#, c-format
msgid "top-level declaration of `%s' specifies `auto'"
msgstr ""
-#: c-decl.c:4357
+#: c-decl.c:4297
#, c-format
msgid "declaration of `%s' as array of voids"
msgstr ""
-#: c-decl.c:4363
+#: c-decl.c:4303
#, c-format
msgid "declaration of `%s' as array of functions"
msgstr ""
-#: c-decl.c:4385
+#: c-decl.c:4325
#, c-format
msgid "size of array `%s' has non-integer type"
msgstr ""
-#: c-decl.c:4390
+#: c-decl.c:4330
#, c-format
msgid "ISO C forbids zero-size array `%s'"
msgstr ""
-#: c-decl.c:4397
+#: c-decl.c:4337
#, c-format
msgid "size of array `%s' is negative"
msgstr ""
-#: c-decl.c:4410
+#: c-decl.c:4350
#, c-format
msgid "ISO C89 forbids array `%s' whose size can't be evaluated"
msgstr ""
-#: c-decl.c:4413
+#: c-decl.c:4353
#, c-format
msgid "ISO C89 forbids variable-size array `%s'"
msgstr ""
-#: c-decl.c:4431 c-decl.c:4616
+#: c-decl.c:4383 c-decl.c:4597
#, c-format
msgid "size of array `%s' is too large"
msgstr ""
-#: c-decl.c:4451
+#: c-decl.c:4400
+msgid "ISO C89 does not support flexible array members"
+msgstr ""
+
+#: c-decl.c:4410
msgid "array type has incomplete element type"
msgstr ""
-#: c-decl.c:4459
+#: c-decl.c:4417
msgid "ANSI C forbids const or volatile function types"
msgstr ""
-#: c-decl.c:4495 cp/decl.c:10753
+#: c-decl.c:4456 cp/decl.c:10535
#, c-format
msgid "`%s' declared as function returning a function"
msgstr ""
-#: c-decl.c:4500 cp/decl.c:10758
+#: c-decl.c:4461 cp/decl.c:10540
#, c-format
msgid "`%s' declared as function returning an array"
msgstr ""
-#: c-decl.c:4549 c-decl.c:4627 c-decl.c:4711 c-decl.c:4798
+#: c-decl.c:4496
+msgid "ISO C forbids qualified void function return type"
+msgstr ""
+
+#: c-decl.c:4500
+msgid "type qualifiers ignored on function return type"
+msgstr ""
+
+#: c-decl.c:4529 c-decl.c:4612 c-decl.c:4696 c-decl.c:4787
msgid "ISO C forbids qualified function types"
msgstr ""
-#: c-decl.c:4589 cp/decl.c:10989
+#: c-decl.c:4569 cp/decl.c:10771
msgid "invalid type modifier within pointer declarator"
msgstr ""
-#: c-decl.c:4661
+#: c-decl.c:4646
msgid "ISO C forbids const or volatile function types"
msgstr ""
-#: c-decl.c:4680 cp/decl.c:11476
+#: c-decl.c:4665 cp/decl.c:11247
#, c-format
msgid "variable or field `%s' declared void"
msgstr ""
-#: c-decl.c:4745
+#: c-decl.c:4734
#, c-format
msgid "field `%s' declared as a function"
msgstr ""
-#: c-decl.c:4751
+#: c-decl.c:4740
#, c-format
msgid "field `%s' has incomplete type"
msgstr ""
-#: c-decl.c:4783 c-decl.c:4785 c-decl.c:4792
+#: c-decl.c:4772 c-decl.c:4774 c-decl.c:4781
#, c-format
msgid "invalid storage class for function `%s'"
msgstr ""
-#: c-decl.c:4804
-msgid "ISO C forbids qualified void function return type"
-msgstr ""
-
-#: c-decl.c:4810
+#: c-decl.c:4793
msgid "`noreturn' function returns non-void value"
msgstr ""
-#: c-decl.c:4822
+#: c-decl.c:4805
msgid "cannot inline function `main'"
msgstr ""
-#: c-decl.c:4853
+#: c-decl.c:4840
#, c-format
msgid "variable `%s' declared `inline'"
msgstr ""
-#: c-decl.c:4924 c-decl.c:5878
+#: c-decl.c:4911 c-decl.c:5898
msgid "function declaration isn't a prototype"
msgstr ""
-#: c-decl.c:4930 cp/decl.c:12167
+#: c-decl.c:4917
msgid "parameter names (without types) in function declaration"
msgstr ""
-#: c-decl.c:4960 c-decl.c:6263 c-decl.c:6552 cp/decl.c:11986
+#: c-decl.c:4949 c-decl.c:6286 c-decl.c:6585
#, c-format
msgid "parameter `%s' has incomplete type"
msgstr ""
-#: c-decl.c:4963 cp/decl.c:11989
+#: c-decl.c:4952
msgid "parameter has incomplete type"
msgstr ""
-#: c-decl.c:4984
+#: c-decl.c:4973
#, c-format
msgid "parameter `%s' points to incomplete type"
msgstr ""
-#: c-decl.c:4987
+#: c-decl.c:4976
msgid "parameter points to incomplete type"
msgstr ""
-#: c-decl.c:5052
+#: c-decl.c:5041
#, c-format
msgid "parameter `%s' has just a forward declaration"
msgstr ""
-#: c-decl.c:5094
+#: c-decl.c:5082
msgid "`void' in parameter list must be the entire list"
msgstr ""
-#: c-decl.c:5123
+#: c-decl.c:5111
#, c-format
msgid "`%s %s' declared inside parameter list"
msgstr ""
-#: c-decl.c:5132
+#: c-decl.c:5120
msgid "anonymous struct declared inside parameter list"
msgstr ""
-#: c-decl.c:5134
+#: c-decl.c:5122
msgid "anonymous union declared inside parameter list"
msgstr ""
-#: c-decl.c:5136
+#: c-decl.c:5124
msgid "anonymous enum declared inside parameter list"
msgstr ""
-#: c-decl.c:5140
+#: c-decl.c:5128
msgid ""
"its scope is only this definition or declaration, which is probably not what "
"you want."
msgstr ""
-#: c-decl.c:5175
-msgid "ISO C forbids forward references to `enum' types"
-msgstr ""
-
-#: c-decl.c:5213
+#: c-decl.c:5198
#, c-format
msgid "redefinition of `%s %s'"
msgstr ""
-#: c-decl.c:5280 c-decl.c:5283
+#: c-decl.c:5266 c-decl.c:5269
#, c-format
msgid "%s defined inside parms"
msgstr ""
-#: c-decl.c:5281 c-decl.c:5284 c-decl.c:5295
+#: c-decl.c:5267 c-decl.c:5270 c-decl.c:5281
msgid "union"
msgstr ""
-#: c-decl.c:5281 c-decl.c:5284
+#: c-decl.c:5267 c-decl.c:5270
msgid "structure"
msgstr ""
-#: c-decl.c:5294
+#: c-decl.c:5280
#, c-format
msgid "%s has no %s"
msgstr ""
-#: c-decl.c:5295
+#: c-decl.c:5281
msgid "struct"
msgstr ""
-#: c-decl.c:5296
+#: c-decl.c:5282
msgid "named members"
msgstr ""
-#: c-decl.c:5296
+#: c-decl.c:5282
msgid "members"
msgstr ""
-#: c-decl.c:5334
+#: c-decl.c:5321
#, c-format
msgid "nested redefinition of `%s'"
msgstr ""
-#: c-decl.c:5347
+#: c-decl.c:5334
#, c-format
msgid "bit-field `%s' width not an integer constant"
msgstr ""
-#: c-decl.c:5357
+#: c-decl.c:5345
#, c-format
msgid "bit-field `%s' has invalid type"
msgstr ""
-#: c-decl.c:5368
+#: c-decl.c:5357
#, c-format
msgid "bit-field `%s' type invalid in ISO C"
msgstr ""
-#: c-decl.c:5375
+#: c-decl.c:5369
#, c-format
msgid "negative width in bit-field `%s'"
msgstr ""
-#: c-decl.c:5378
+#: c-decl.c:5371
#, c-format
msgid "width of `%s' exceeds its type"
msgstr ""
-#: c-decl.c:5380
+#: c-decl.c:5373
#, c-format
msgid "zero width for bit-field `%s'"
msgstr ""
-#: c-decl.c:5394
+#: c-decl.c:5387
#, c-format
msgid "`%s' is narrower than values of its type"
msgstr ""
-#: c-decl.c:5451
+#: c-decl.c:5432
+msgid "flexible array member in union"
+msgstr ""
+
+#: c-decl.c:5434
+msgid "flexible array member not at end of struct"
+msgstr ""
+
+#: c-decl.c:5436
+msgid "flexible array member in otherwise empty struct"
+msgstr ""
+
+#: c-decl.c:5461
#, c-format
msgid "duplicate member `%s'"
msgstr ""
-#: c-decl.c:5495
+#: c-decl.c:5505
msgid "union cannot be made transparent"
msgstr ""
#. This enum is a named one that has been declared already.
-#: c-decl.c:5576
+#: c-decl.c:5586
#, c-format
msgid "redeclaration of `enum %s'"
msgstr ""
-#: c-decl.c:5610
+#: c-decl.c:5620
msgid "enum defined inside parms"
msgstr ""
-#: c-decl.c:5642
+#: c-decl.c:5653
msgid "enumeration values exceed range of largest integer"
msgstr ""
-#: c-decl.c:5746
+#: c-decl.c:5762
#, c-format
msgid "enumerator value for `%s' not integer constant"
msgstr ""
-#: c-decl.c:5759
+#: c-decl.c:5775
msgid "overflow in enumeration values"
msgstr ""
-#: c-decl.c:5764
+#: c-decl.c:5780
msgid "ISO C restricts enumerator values to range of `int'"
msgstr ""
-#: c-decl.c:5835
+#: c-decl.c:5852
msgid "return type is an incomplete type"
msgstr ""
-#: c-decl.c:5884
+#: c-decl.c:5860
+msgid "return type defaults to `int'"
+msgstr ""
+
+#: c-decl.c:5907
#, c-format
msgid "no previous prototype for `%s'"
msgstr ""
-#: c-decl.c:5891
+#: c-decl.c:5914
#, c-format
msgid "`%s' was used with no prototype before its definition"
msgstr ""
-#: c-decl.c:5897
+#: c-decl.c:5920
#, c-format
msgid "no previous declaration for `%s'"
msgstr ""
-#: c-decl.c:5904
+#: c-decl.c:5927
#, c-format
msgid "`%s' was used with no declaration before its definition"
msgstr ""
-#: c-decl.c:5932 c-decl.c:6639
+#: c-decl.c:5955 c-decl.c:6672
#, c-format
msgid "return type of `%s' is not `int'"
msgstr ""
-#: c-decl.c:5948
+#: c-decl.c:5971
#, c-format
msgid "first argument of `%s' should be `int'"
msgstr ""
-#: c-decl.c:5957
+#: c-decl.c:5980
#, c-format
msgid "second argument of `%s' should be `char **'"
msgstr ""
-#: c-decl.c:5966
+#: c-decl.c:5989
#, c-format
msgid "third argument of `%s' should probably be `char **'"
msgstr ""
-#: c-decl.c:5975
+#: c-decl.c:5998
#, c-format
msgid "`%s' takes only zero or two arguments"
msgstr ""
-#: c-decl.c:5978
-#, c-format
-msgid "third argument of `%s' is deprecated"
-msgstr ""
-
-#: c-decl.c:5981
+#: c-decl.c:6001
#, c-format
msgid "`%s' is normally a non-static function"
msgstr ""
-#: c-decl.c:6081
+#: c-decl.c:6104
msgid "parm types given both in parmlist and separately"
msgstr ""
-#: c-decl.c:6102
+#: c-decl.c:6125
msgid "parameter name omitted"
msgstr ""
-#: c-decl.c:6106 c-decl.c:6208 c-decl.c:6509
+#: c-decl.c:6129 c-decl.c:6231 c-decl.c:6542
#, c-format
msgid "parameter `%s' declared void"
msgstr ""
-#: c-decl.c:6182
+#: c-decl.c:6205
msgid "parameter name missing from parameter list"
msgstr ""
-#: c-decl.c:6201 c-decl.c:6502
+#: c-decl.c:6224 c-decl.c:6535
#, c-format
msgid "multiple parameters named `%s'"
msgstr ""
-#: c-decl.c:6232 c-decl.c:6234
+#: c-decl.c:6255 c-decl.c:6257
#, c-format
msgid "type of `%s' defaults to `int'"
msgstr ""
-#: c-decl.c:6270 c-decl.c:6559
+#: c-decl.c:6293 c-decl.c:6592
#, c-format
msgid "declaration for parameter `%s' but no such parameter"
msgstr ""
-#: c-decl.c:6318
+#: c-decl.c:6341
msgid "number of arguments doesn't match prototype"
msgstr ""
-#: c-decl.c:6347
+#: c-decl.c:6371
#, c-format
msgid "promoted argument `%s' doesn't match prototype"
msgstr ""
-#: c-decl.c:6361
+#: c-decl.c:6385
#, c-format
msgid "argument `%s' doesn't match prototype"
msgstr ""
-#: c-decl.c:6532
+#: c-decl.c:6565
#, c-format
msgid "type of parameter `%s' is not declared"
msgstr ""
-#: c-decl.c:6677
-msgid "function might be possible candidate for attribute `noreturn'"
+#: c-decl.c:6793
+msgid "this function may return with or without a value"
msgstr ""
-#: c-decl.c:6680 cp/decl.c:14665
-msgid "`noreturn' function does return"
+#: c-decl.c:6813
+#, c-format
+msgid "size of return value of `%s' is %u bytes"
msgstr ""
-#. If this function returns non-void and control can drop through,
-#. complain.
-#: c-decl.c:6685 cp/decl.c:14675
-msgid "control reaches end of non-void function"
+#: c-decl.c:6817
+#, c-format
+msgid "size of return value of `%s' is larger than %d bytes"
msgstr ""
-#: c-decl.c:6690
-msgid "this function may return with or without a value"
+#. If we get here, declarations have been used in a for loop without
+#. the C99 for loop scope. This doesn't make much sense, so don't
+#. allow it.
+#: c-decl.c:6872
+msgid "`for' loop initial declaration used outside C99 mode"
msgstr ""
-#: c-decl.c:6709
+#: c-decl.c:6892
#, c-format
-msgid "size of return value of `%s' is %u bytes"
+msgid "`%s %s' declared in `for' loop initial declaration"
msgstr ""
-#: c-decl.c:6713
+#: c-decl.c:6901
#, c-format
-msgid "size of return value of `%s' is larger than %d bytes"
+msgid "declaration of non-variable `%s' in `for' loop initial declaration"
msgstr ""
-#: c-decl.c:6954
-msgid "ISO C forbids case ranges"
+#: c-decl.c:6903
+#, c-format
+msgid "declaration of static variable `%s' in `for' loop initial declaration"
msgstr ""
-#: c-decl.c:6963
-msgid "label must have integral type in ISO C"
+#: c-decl.c:6905
+#, c-format
+msgid "declaration of `extern' variable `%s' in `for' loop initial declaration"
msgstr ""
-#: c-decl.c:6976
-msgid "default label not within a switch statement"
+#: c-dump.c:826
+#, c-format
+msgid "could not open dump file `%s'"
msgstr ""
-#: c-decl.c:6978 cp/decl.c:5249
-msgid "case label not within a switch statement"
+#: c-dump.c:871
+#, c-format
+msgid "ignoring `%s' at end of `-f%s'"
msgstr ""
-#: c-decl.c:6984 cp/decl.c:5372
-msgid "multiple default labels in one switch"
+#: c-format.c:106 c-format.c:219
+#, c-format
+msgid "argument format specified for non-function `%s'"
msgstr ""
-#: c-decl.c:6985
-msgid "this is the first default label"
+#: c-format.c:112
+msgid "unrecognized format specifier"
msgstr ""
-#: c-decl.c:6988
-msgid "duplicate case value"
+#: c-format.c:123
+#, c-format
+msgid "`%s' is an unrecognized format function type"
+msgstr ""
+
+#: c-format.c:145 c-format.c:233
+msgid "format string has invalid operand number"
msgstr ""
-#: c-decl.c:6991
-msgid "this is the first entry for that value"
+#: c-format.c:153
+msgid "format string arg follows the args to be formatted"
msgstr ""
-#: c-decl.c:6996
-msgid "case value out of range"
+#: c-format.c:172 c-format.c:254
+msgid "format string arg not a string type"
msgstr ""
-#: c-decl.c:6998
-msgid "case label within scope of cleanup or variable array"
+#: c-format.c:185
+msgid "args to be formatted is not '...'"
msgstr ""
-#: c-lex.c:333
-msgid "stray '\\' in program"
+#: c-format.c:193
+msgid "strftime formats cannot format arguments"
msgstr ""
-#: c-lex.c:395 c-lex.c:514
-msgid "invalid #-line"
+#: c-format.c:263
+msgid "function does not return string type"
+msgstr ""
+
+#: c-format.c:757
+msgid "` ' flag"
+msgstr ""
+
+#: c-format.c:757
+msgid "the ` ' printf flag"
+msgstr ""
+
+#: c-format.c:758 c-format.c:829
+msgid "`+' flag"
+msgstr ""
+
+#: c-format.c:758
+msgid "the `+' printf flag"
+msgstr ""
+
+#: c-format.c:759 c-format.c:805
+msgid "`#' flag"
+msgstr ""
+
+#: c-format.c:759
+msgid "the `#' printf flag"
+msgstr ""
+
+#: c-format.c:760 c-format.c:803
+msgid "`0' flag"
+msgstr ""
+
+#: c-format.c:760
+msgid "the `0' printf flag"
+msgstr ""
+
+#: c-format.c:761 c-format.c:802 c-format.c:832
+msgid "`-' flag"
+msgstr ""
+
+#: c-format.c:761
+msgid "the `-' printf flag"
+msgstr ""
+
+#: c-format.c:762 c-format.c:786
+msgid "`'' flag"
+msgstr ""
+
+#: c-format.c:762
+msgid "the `'' printf flag"
+msgstr ""
+
+#: c-format.c:763 c-format.c:787
+msgid "`I' flag"
msgstr ""
-#: c-lex.c:499
+#: c-format.c:763
+msgid "the `I' printf flag"
+msgstr ""
+
+#: c-format.c:764 c-format.c:784 c-format.c:806 c-format.c:833 c-format.c:1846
+msgid "field width"
+msgstr ""
+
+#: c-format.c:764
+msgid "field width in printf format"
+msgstr ""
+
+#: c-format.c:765
+msgid "precision"
+msgstr ""
+
+#: c-format.c:765
+msgid "precision in printf format"
+msgstr ""
+
+#: c-format.c:766 c-format.c:785 c-format.c:836
+msgid "length modifier"
+msgstr ""
+
+#: c-format.c:766
+msgid "length modifier in printf format"
+msgstr ""
+
+#: c-format.c:782
+msgid "assignment suppression"
+msgstr ""
+
+#: c-format.c:783
+msgid "`a' flag"
+msgstr ""
+
+#: c-format.c:783
+msgid "the `a' scanf flag"
+msgstr ""
+
+#: c-format.c:784
+msgid "field width in scanf format"
+msgstr ""
+
+#: c-format.c:785
+msgid "length modifier in scanf format"
+msgstr ""
+
+#: c-format.c:786
+msgid "the `'' scanf flag"
+msgstr ""
+
+#: c-format.c:787
+msgid "the `I' scanf flag"
+msgstr ""
+
+#: c-format.c:801
+msgid "`_' flag"
+msgstr ""
+
+#: c-format.c:801
+msgid "the `_' strftime flag"
+msgstr ""
+
+#: c-format.c:802
+msgid "the `-' strftime flag"
+msgstr ""
+
+#: c-format.c:803
+msgid "the `0' strftime flag"
+msgstr ""
+
+#: c-format.c:804 c-format.c:828
+msgid "`^' flag"
+msgstr ""
+
+#: c-format.c:804
+msgid "the `^' strftime flag"
+msgstr ""
+
+#: c-format.c:805
+msgid "the `#' strftime flag"
+msgstr ""
+
+#: c-format.c:806
+msgid "field width in strftime format"
+msgstr ""
+
+#: c-format.c:807
+msgid "`E' modifier"
+msgstr ""
+
+#: c-format.c:807
+msgid "the `E' strftime modifier"
+msgstr ""
+
+#: c-format.c:808
+msgid "`O' modifier"
+msgstr ""
+
+#: c-format.c:808
+msgid "the `O' strftime modifier"
+msgstr ""
+
+#: c-format.c:809
+msgid "the `O' modifier"
+msgstr ""
+
+#: c-format.c:827
+msgid "fill character"
+msgstr ""
+
+#: c-format.c:827
+msgid "fill character in strfmon format"
+msgstr ""
+
+#: c-format.c:828
+msgid "the `^' strfmon flag"
+msgstr ""
+
+#: c-format.c:829
+msgid "the `+' strfmon flag"
+msgstr ""
+
+#: c-format.c:830
+msgid "`(' flag"
+msgstr ""
+
+#: c-format.c:830
+msgid "the `(' strfmon flag"
+msgstr ""
+
+#: c-format.c:831
+msgid "`!' flag"
+msgstr ""
+
+#: c-format.c:831
+msgid "the `!' strfmon flag"
+msgstr ""
+
+#: c-format.c:832
+msgid "the `-' strfmon flag"
+msgstr ""
+
+#: c-format.c:833
+msgid "field width in strfmon format"
+msgstr ""
+
+#: c-format.c:834
+msgid "left precision"
+msgstr ""
+
+#: c-format.c:834
+msgid "left precision in strfmon format"
+msgstr ""
+
+#: c-format.c:835
+msgid "right precision"
+msgstr ""
+
+#: c-format.c:835
+msgid "right precision in strfmon format"
+msgstr ""
+
+#: c-format.c:836
+msgid "length modifier in strfmon format"
+msgstr ""
+
+#: c-format.c:1135
#, c-format
-msgid "undefined or invalid # directive `%s'"
+msgid "function might be possible candidate for `%s' format attribute"
msgstr ""
-#: c-lex.c:550
-msgid "invalid #line"
+#: c-format.c:1248 c-format.c:1269 c-format.c:2256
+msgid "missing $ operand number in format"
msgstr ""
-#: c-lex.c:627 c-lex.c:743
+#: c-format.c:1279
+#, c-format
+msgid "%s does not support %%n$ operand number formats"
+msgstr ""
+
+#: c-format.c:1286
+msgid "operand number out of range in format"
+msgstr ""
+
+#: c-format.c:1307
+#, c-format
+msgid "format argument %d used more than once in %s format"
+msgstr ""
+
+#: c-format.c:1349
+#, c-format
+msgid "format argument %d unused before used argument %d in $-style format"
+msgstr ""
+
+#: c-format.c:1443
+msgid "format not a string literal, format string not checked"
+msgstr ""
+
+#: c-format.c:1457
+msgid "format not a string literal and no format arguments"
+msgstr ""
+
+#: c-format.c:1459
+msgid "format not a string literal, argument types not checked"
+msgstr ""
+
+#: c-format.c:1472
+msgid "too many arguments for format"
+msgstr ""
+
+#: c-format.c:1475
+msgid "unused arguments in $-style format"
+msgstr ""
+
+#: c-format.c:1478
+msgid "zero-length format string"
+msgstr ""
+
+#: c-format.c:1481
+msgid "format is a wide character string"
+msgstr ""
+
+#: c-format.c:1484
+msgid "unterminated format string"
+msgstr ""
+
+#. FIXME: this warning should go away once Marc Espie's
+#. __attribute__((nonnull)) patch is in. Instead, checking for
+#. nonnull attributes should probably change this function to act
+#. specially if info == NULL and add a res->number_null entry for
+#. that case, or maybe add a function pointer to be called at
+#. the end instead of hardcoding check_format_info_main.
+#: c-format.c:1572
+msgid "null format string"
+msgstr ""
+
+#: c-format.c:1725
+msgid "embedded `\\0' in format"
+msgstr ""
+
+#: c-format.c:1740
+#, c-format
+msgid "spurious trailing `%%' in format"
+msgstr ""
+
+#: c-format.c:1779 c-format.c:2016
+#, c-format
+msgid "repeated %s in format"
+msgstr ""
+
+#: c-format.c:1792
+msgid "missing fill character at end of strfmon format"
+msgstr ""
+
+#: c-format.c:1812 c-format.c:1930 c-format.c:2210 c-format.c:2263
+msgid "too few arguments for format"
+msgstr ""
+
+#: c-format.c:1872
+#, c-format
+msgid "zero width in %s format"
+msgstr ""
+
+#: c-format.c:1891
+#, c-format
+msgid "empty left precision in %s format"
+msgstr ""
+
+#: c-format.c:1945
+msgid "field precision"
+msgstr ""
+
+#: c-format.c:1960
+#, c-format
+msgid "empty precision in %s format"
+msgstr ""
+
+#: c-format.c:2000
+#, c-format
+msgid "%s does not support the `%s' %s length modifier"
+msgstr ""
+
+#: c-format.c:2050
+msgid "conversion lacks type at end of format"
+msgstr ""
+
+#: c-format.c:2061
+#, c-format
+msgid "unknown conversion type character `%c' in format"
+msgstr ""
+
+#: c-format.c:2064
+#, c-format
+msgid "unknown conversion type character 0x%x in format"
+msgstr ""
+
+#: c-format.c:2071
+#, c-format
+msgid "%s does not support the `%%%c' %s format"
+msgstr ""
+
+#: c-format.c:2087
+#, c-format
+msgid "%s used with `%%%c' %s format"
+msgstr ""
+
+#: c-format.c:2096
+#, c-format
+msgid "%s does not support %s"
+msgstr ""
+
+#: c-format.c:2105
+#, c-format
+msgid "%s does not support %s with the `%%%c' %s format"
+msgstr ""
+
+#: c-format.c:2138
+#, c-format
+msgid "%s ignored with %s and `%%%c' %s format"
+msgstr ""
+
+#: c-format.c:2142
+#, c-format
+msgid "%s ignored with %s in %s format"
+msgstr ""
+
+#: c-format.c:2148
+#, c-format
+msgid "use of %s and %s together with `%%%c' %s format"
+msgstr ""
+
+#: c-format.c:2152
+#, c-format
+msgid "use of %s and %s together in %s format"
+msgstr ""
+
+#: c-format.c:2171
+#, c-format
+msgid "`%%%c' yields only last 2 digits of year in some locales"
+msgstr ""
+
+#: c-format.c:2174
+#, c-format
+msgid "`%%%c' yields only last 2 digits of year"
+msgstr ""
+
+#. The end of the format string was reached.
+#: c-format.c:2190
+#, c-format
+msgid "no closing `]' for `%%[' format"
+msgstr ""
+
+#: c-format.c:2203
+#, c-format
+msgid "use of `%s' length modifier with `%c' type character"
+msgstr ""
+
+#: c-format.c:2224
+#, c-format
+msgid "%s does not support the `%%%s%c' %s format"
+msgstr ""
+
+#: c-format.c:2239
+msgid "operand number specified with suppressed assignment"
+msgstr ""
+
+#: c-format.c:2241
+msgid "operand number specified for format taking no argument"
+msgstr ""
+
+#: c-format.c:2360
+#, c-format
+msgid "writing through null pointer (arg %d)"
+msgstr ""
+
+#: c-format.c:2369
+#, c-format
+msgid "reading through null pointer (arg %d)"
+msgstr ""
+
+#: c-format.c:2389
+#, c-format
+msgid "writing into constant object (arg %d)"
+msgstr ""
+
+#: c-format.c:2399
+#, c-format
+msgid "extra type qualifiers in format argument (arg %d)"
+msgstr ""
+
+#: c-format.c:2406
+#, c-format
+msgid "format argument is not a pointer (arg %d)"
+msgstr ""
+
+#: c-format.c:2408
+#, c-format
+msgid "format argument is not a pointer to a pointer (arg %d)"
+msgstr ""
+
+#: c-format.c:2502
+#, c-format
+msgid "%s is not type %s (arg %d)"
+msgstr ""
+
+#: c-format.c:2505
+#, c-format
+msgid "%s format, %s arg (arg %d)"
+msgstr ""
+
+#: c-lex.c:279
msgid "badly nested C headers from preprocessor"
msgstr ""
-#: c-lex.c:645
-msgid "#-lines for entering and leaving files don't match"
+#: c-lex.c:297
+msgid "leaving more files than we entered"
msgstr ""
-#: c-lex.c:786 c-pragma.c:425
+#: c-lex.c:329
#, c-format
msgid "ignoring #pragma %s %s"
msgstr ""
-#: c-lex.c:788 c-pragma.c:427
+#: c-lex.c:331
#, c-format
msgid "ignoring #pragma %s"
msgstr ""
-#: c-lex.c:821
+#: c-lex.c:381
msgid "incomplete universal-character-name"
msgstr ""
-#: c-lex.c:828
+#: c-lex.c:388
#, c-format
msgid "non hex digit '%c' in universal-character-name"
msgstr ""
-#: c-lex.c:843
+#: c-lex.c:403
msgid "universal-character-name on EBCDIC target"
msgstr ""
-#: c-lex.c:856
+#: c-lex.c:416
#, c-format
msgid "universal-character-name used for '%c'"
msgstr ""
-#: c-lex.c:859
+#: c-lex.c:419
msgid "invalid universal-character-name"
msgstr ""
-#: c-lex.c:893
+#: c-lex.c:453 f/lex.c:601
msgid "the meaning of `\\x' varies with -traditional"
msgstr ""
-#: c-lex.c:929 cppexp.c:522
+#: c-lex.c:489 cppexp.c:579 f/lex.c:636
msgid "\\x used with no following hex digits"
msgstr ""
-#: c-lex.c:942
+#: c-lex.c:502 f/lex.c:646
msgid "hex escape out of range"
msgstr ""
-#: c-lex.c:980
+#: c-lex.c:540
msgid "the meaning of '\\a' varies with -traditional"
msgstr ""
-#: c-lex.c:990
+#: c-lex.c:550
#, c-format
msgid "the meaning of '\\%c' varies with -traditional"
msgstr ""
-#: c-lex.c:996 cppexp.c:470
+#: c-lex.c:556 cppexp.c:527
#, c-format
msgid "non-ISO-standard escape sequence, '\\%c'"
msgstr ""
-#: c-lex.c:1003 c-lex.c:1009
+#: c-lex.c:563 c-lex.c:569
#, c-format
msgid "unknown escape sequence '\\%c'"
msgstr ""
-#: c-lex.c:1011
+#: c-lex.c:571
#, c-format
-msgid "unknown escape sequence: '\\' followed by char 0x%.2x"
+msgid "unknown escape sequence: '\\' followed by char 0x%x"
msgstr ""
-#: c-lex.c:1041
+#: c-lex.c:601
#, c-format
msgid "universal-character-name '\\U%08x' not valid in identifier"
msgstr ""
-#: c-lex.c:1287
+#: c-lex.c:847
#, c-format
msgid "universal-character-name '\\u%04x' not valid in identifier"
msgstr ""
-#: c-lex.c:1377
+#: c-lex.c:937
msgid "both 'f' and 'l' suffixes on floating constant"
msgstr ""
-#: c-lex.c:1404
+#: c-lex.c:964
#, c-format
msgid "floating point number exceeds range of '%s'"
msgstr ""
-#: c-lex.c:1442 c-lex.c:1853
+#: c-lex.c:994
#, c-format
msgid "stray '%c' in program"
msgstr ""
-#: c-lex.c:1444 c-lex.c:1855
+#: c-lex.c:996
#, c-format
-msgid "stray '\\%#o' in program"
+msgid "stray '\\%o' in program"
msgstr ""
-#: c-lex.c:1578 c-lex.c:1580
-msgid "'$' in identifier"
-msgstr ""
-
-#: c-lex.c:1612
-msgid "parse error at '..'"
-msgstr ""
-
-#: c-lex.c:1927
+#: c-lex.c:1193
msgid "floating constant may not be in radix 16"
msgstr ""
-#: c-lex.c:2059
+#: c-lex.c:1230
msgid "traditional C rejects the 'f' suffix"
msgstr ""
-#: c-lex.c:2068
+#: c-lex.c:1239
msgid "traditional C rejects the 'l' suffix"
msgstr ""
-#: c-lex.c:2078 c-lex.c:2171
+#: c-lex.c:1249 c-lex.c:1342
msgid "ISO C forbids imaginary numeric constants"
msgstr ""
-#: c-lex.c:2112
+#: c-lex.c:1283
msgid "floating point number exceeds range of 'double'"
msgstr ""
-#: c-lex.c:2141
+#: c-lex.c:1312
msgid "two 'u' suffixes on integer constant"
msgstr ""
-#: c-lex.c:2143
+#: c-lex.c:1314
msgid "traditional C rejects the 'u' suffix"
msgstr ""
-#: c-lex.c:2154
+#: c-lex.c:1325
msgid "three 'l' suffixes on integer constant"
msgstr ""
-#: c-lex.c:2156
+#: c-lex.c:1327
msgid "'lul' is not a valid integer suffix"
msgstr ""
-#: c-lex.c:2158
+#: c-lex.c:1329
msgid "'Ll' and 'lL' are not valid integer suffixes"
msgstr ""
-#: c-lex.c:2161
+#: c-lex.c:1332
msgid "ISO C89 forbids long long integer constants"
msgstr ""
-#: c-lex.c:2169
+#: c-lex.c:1340
msgid "more than one 'i' or 'j' suffix on integer constant"
msgstr ""
-#: c-lex.c:2184
+#: c-lex.c:1355
#, c-format
msgid ""
"integer constant is too large for this configuration of the compiler - "
"truncated to %d bits"
msgstr ""
-#: c-lex.c:2274
+#: c-lex.c:1445
msgid "width of integer constant changes with -traditional"
msgstr ""
-#: c-lex.c:2276
+#: c-lex.c:1447
msgid "integer constant is unsigned in ISO C, signed with -traditional"
msgstr ""
-#: c-lex.c:2278
+#: c-lex.c:1449
msgid "width of integer constant may change on other systems with -traditional"
msgstr ""
-#: c-lex.c:2285
-msgid "integer constant larger than the maximum value of an unsigned long int"
+#: c-lex.c:1459
+#, c-format
+msgid "integer constant larger than the maximum value of %s"
msgstr ""
-#: c-lex.c:2289
+#: c-lex.c:1468
msgid "decimal constant is so large that it is unsigned"
msgstr ""
-#: c-lex.c:2318
+#: c-lex.c:1497
msgid "integer constant is larger than the maximum value for its type"
msgstr ""
-#: c-lex.c:2322
+#: c-lex.c:1501
#, c-format
msgid "missing white space after number '%.*s'"
msgstr ""
-#: c-lex.c:2358 c-lex.c:2462
+#: c-lex.c:1537 c-lex.c:1641
msgid "Ignoring invalid multibyte character"
msgstr ""
-#: c-lex.c:2376 c-lex.c:2481 cppexp.c:271
+#: c-lex.c:1555 c-lex.c:1660 cppexp.c:275
msgid "escape sequence out of range for character"
msgstr ""
-#: c-lex.c:2500
+#: c-lex.c:1679
msgid "empty character constant"
msgstr ""
-#: c-lex.c:2504
+#: c-lex.c:1683
msgid "character constant too long"
msgstr ""
-#: c-lex.c:2507 cppexp.c:289
+#: c-lex.c:1686 cppexp.c:293
msgid "multi-character character constant"
msgstr ""
#. Like YYERROR but do call yyerror.
-#: c-parse.y:64 objc-parse.y:65 parse.y:55
+#: c-parse.y:61 cp/parse.y:55 objc/objc-parse.y:62
msgid "syntax error"
msgstr ""
-#: /usr/share/bison.simple:107
-msgid "syntax error: cannot back up"
-msgstr ""
-
-#: /usr/share/bison.simple:362
-msgid "parser stack overflow"
-msgstr ""
-
-#: c-parse.y:244 objc-parse.y:272
+#: c-parse.y:247 objc/objc-parse.y:275
msgid "ISO C forbids an empty source file"
msgstr ""
-#: c-parse.y:276 c-parse.y:1758 objc-parse.y:305 objc-parse.y:1822
+#: c-parse.y:279 c-parse.y:1824 objc/objc-parse.y:308 objc/objc-parse.y:1888
msgid "argument of `asm' is not a constant string"
msgstr ""
-#: c-parse.y:284 objc-parse.y:313
+#: c-parse.y:287 objc/objc-parse.y:316
msgid "ISO C forbids data definition with no type or storage class"
msgstr ""
-#: c-parse.y:286 objc-parse.y:315
+#: c-parse.y:289 objc/objc-parse.y:318
msgid "data definition has no type or storage class"
msgstr ""
-#: c-parse.y:307 objc-parse.y:336
+#: c-parse.y:310 objc/objc-parse.y:339
msgid "ISO C does not allow extra `;' outside of a function"
msgstr ""
-#: c-parse.y:373 cppexp.c:842
+#: c-parse.y:382 cppexp.c:900
msgid "traditional C rejects the unary plus operator"
msgstr ""
-#: c-parse.y:417 objc-parse.y:446
+#: c-parse.y:426 objc/objc-parse.y:455
msgid "ISO C forbids `&&'"
msgstr ""
-#: c-parse.y:446 objc-parse.y:475
+#: c-parse.y:455 objc/objc-parse.y:484
msgid "`sizeof' applied to a bit-field"
msgstr ""
-#: c-parse.y:496 objc-parse.y:525
-msgid "ISO C89 forbids constructor expressions"
+#: c-parse.y:543 objc/objc-parse.y:572
+msgid "ISO C forbids omitting the middle term of a ?: expression"
msgstr ""
-#: c-parse.y:565 objc-parse.y:594
-msgid "ISO C forbids omitting the middle term of a ?: expression"
+#: c-parse.y:591 objc/objc-parse.y:620
+msgid "ISO C89 forbids compound literals"
msgstr ""
-#: c-parse.y:613 objc-parse.y:642
+#: c-parse.y:621 objc/objc-parse.y:650
msgid "ISO C forbids braced-groups within expressions"
msgstr ""
-#: c-parse.y:672
+#: c-parse.y:674
msgid "traditional C rejects string concatenation"
msgstr ""
-#: c-parse.y:687 objc-parse.y:739
+#: c-parse.y:689 objc/objc-parse.y:741
msgid "ISO C does not permit use of `varargs.h'"
msgstr ""
-#: c-parse.y:802 c-parse.y:823 c-parse.y:855 objc-parse.y:854 objc-parse.y:875
-#: objc-parse.y:907 parse.y:1840 parse.y:1847 parse.y:1886
+#: c-parse.y:797 c-parse.y:818 c-parse.y:850 cp/parse.y:1861 cp/parse.y:1868
+#: cp/parse.y:1907 objc/objc-parse.y:849 objc/objc-parse.y:870
+#: objc/objc-parse.y:902
#, c-format
msgid "`%s' is not at beginning of declaration"
msgstr ""
-#: c-parse.y:1019 objc-parse.y:1080
+#: c-parse.y:1014 objc/objc-parse.y:1075
msgid "ISO C forbids empty initializer braces"
msgstr ""
-#: c-parse.y:1069 c-parse.y:1095 objc-parse.y:1126 objc-parse.y:1152
+#: c-parse.y:1028 objc/objc-parse.y:1089
+msgid "ISO C89 forbids specifying subobject to initialize"
+msgstr ""
+
+#: c-parse.y:1031 objc/objc-parse.y:1092
+msgid "obsolete use of designated initializer without `='"
+msgstr ""
+
+#: c-parse.y:1035 objc/objc-parse.y:1096
+msgid "obsolete use of designated initializer with `:'"
+msgstr ""
+
+#: c-parse.y:1064
+msgid "ISO C forbids specifying range of elements to initialize"
+msgstr ""
+
+#: c-parse.y:1072 c-parse.y:1102 objc/objc-parse.y:1127 objc/objc-parse.y:1157
msgid "ISO C forbids nested functions"
msgstr ""
-#: c-parse.y:1166 c-parse.y:1200
+#: c-parse.y:1177 c-parse.y:1211
msgid "`[*]' in parameter declaration only allowed in ISO C 99"
msgstr ""
-#: c-parse.y:1283 objc-parse.y:1331 parse.y:2300
+#: c-parse.y:1286 objc/objc-parse.y:1332
+msgid "ISO C forbids forward references to `enum' types"
+msgstr ""
+
+#: c-parse.y:1298 cp/parse.y:2326 objc/objc-parse.y:1344
msgid "comma at end of enumerator list"
msgstr ""
-#: c-parse.y:1291 objc-parse.y:1339
+#: c-parse.y:1306 objc/objc-parse.y:1352
msgid "no semicolon at end of struct or union"
msgstr ""
-#: c-parse.y:1300 objc-parse.y:1348 objc-parse.y:2295
+#: c-parse.y:1315 objc/objc-parse.y:1361 objc/objc-parse.y:2359
msgid "extra semicolon in struct or union specified"
msgstr ""
-#: c-parse.y:1324 objc-parse.y:1386
+#: c-parse.y:1339 objc/objc-parse.y:1399
msgid "ISO C doesn't support unnamed structs/unions"
msgstr ""
-#: c-parse.y:1338 objc-parse.y:1400
+#: c-parse.y:1353 objc/objc-parse.y:1413
msgid "ISO C forbids member declarations with no members"
msgstr ""
-#: c-parse.y:1452 objc-parse.y:1514
-msgid "ISO C forbids label at end of compound statement"
+#: c-parse.y:1472 objc/objc-parse.y:1532
+msgid "deprecated use of label at end of compound statement"
msgstr ""
-#: c-parse.y:1486 objc-parse.y:1550
+#: c-parse.y:1489 objc/objc-parse.y:1549
+msgid "ISO C89 forbids mixed declarations and code"
+msgstr ""
+
+#: c-parse.y:1563 objc/objc-parse.y:1627
msgid "ISO C forbids label declarations"
msgstr ""
-#: c-parse.y:1536 objc-parse.y:1600 parse.y:1542
+#: c-parse.y:1612 cp/parse.y:1562 objc/objc-parse.y:1676
msgid "braced-group within expression allowed only inside a function"
msgstr ""
-#: c-parse.y:1650 objc-parse.y:1714
+#: c-parse.y:1727 objc/objc-parse.y:1791
msgid "empty body in an else-statement"
msgstr ""
-#: c-parse.y:1794 objc-parse.y:1858
+#: c-parse.y:1856 objc/objc-parse.y:1920
msgid "ISO C forbids `goto *expr;'"
msgstr ""
-#: c-parse.y:1884 objc-parse.y:1948
+#: c-parse.y:1948 objc/objc-parse.y:2012
msgid "ISO C forbids forward parameter declarations"
msgstr ""
@@ -1878,1222 +2191,1264 @@ msgstr ""
#. it caused problems with the code in expand_builtin which
#. tries to verify that BUILT_IN_NEXT_ARG is being used
#. correctly.
-#: c-parse.y:1907 objc-parse.y:1971
+#: c-parse.y:1971 objc/objc-parse.y:2035
msgid "ISO C requires a named argument before `...'"
msgstr ""
-#: c-parse.y:1987 objc-parse.y:2051
+#: c-parse.y:2051 objc/objc-parse.y:2115
msgid "`...' in old-style identifier list"
msgstr ""
-#: /usr/share/bison.simple:639
-msgid "parse error; also virtual memory exceeded"
-msgstr ""
-
-#: /usr/share/bison.simple:643
-msgid "parse error"
-msgstr ""
-
-#: c-parse.y:2331 cp/spew.c:1423 objc-parse.y:3051
+#: c-parse.y:2377 cp/spew.c:1480 objc/objc-parse.y:3109
#, c-format
msgid "%s at end of input"
msgstr ""
-#: c-parse.y:2337 cp/spew.c:1429 objc-parse.y:3057
+#: c-parse.y:2383 cp/spew.c:1486 objc/objc-parse.y:3115
#, c-format
msgid "%s before %s'%c'"
msgstr ""
-#: c-parse.y:2339 cp/spew.c:1431 objc-parse.y:3059
+#: c-parse.y:2385 cp/spew.c:1488 objc/objc-parse.y:3117
#, c-format
msgid "%s before %s'\\x%x'"
msgstr ""
-#: c-parse.y:2344 cp/spew.c:1436 objc-parse.y:3064
+#: c-parse.y:2389 cp/spew.c:1492 objc/objc-parse.y:3121
#, c-format
msgid "%s before string constant"
msgstr ""
-#: c-parse.y:2348 cp/spew.c:1440 objc-parse.y:3068
+#: c-parse.y:2393 cp/spew.c:1496 objc/objc-parse.y:3125
#, c-format
msgid "%s before numeric constant"
msgstr ""
-#: c-parse.y:2350 cp/spew.c:1443 objc-parse.y:3070
+#: c-parse.y:2395 objc/objc-parse.y:3127
#, c-format
msgid "%s before \"%s\""
msgstr ""
-#: c-parse.y:2352 cp/spew.c:1445 objc-parse.y:3072
+#: c-parse.y:2397 objc/objc-parse.y:3129
#, c-format
msgid "%s before '%s' token"
msgstr ""
-#: c-parse.y:2433 objc-parse.y:3153
-#, c-format
-msgid "invalid identifier `%s'"
-msgstr ""
-
-#: c-parse.y:2505 objc-parse.y:3225
+#: c-parse.y:2543 objc/objc-parse.y:3292
#, c-format
-msgid "syntax error before '%s' token"
+msgid "syntax error at '%s' token"
msgstr ""
-#: c-parse.y:2536 cp/lex.c:951 objc-parse.y:3256
+#: c-parse.y:2573 cp/lex.c:928 objc/objc-parse.y:3322
msgid "YYDEBUG not defined."
msgstr ""
-#: c-pragma.c:119
+#: c-pragma.c:108
msgid ""
"#pragma pack (pop) encountered without matching #pragma pack (push, <n>)"
msgstr ""
-#: c-pragma.c:137
+#: c-pragma.c:126
#, c-format
msgid ""
"#pragma pack(pop, %s) encountered without matching #pragma pack(push, %s, "
"<n>)"
msgstr ""
-#: c-pragma.c:243
+#: c-pragma.c:249
msgid "junk at end of '#pragma pack'"
msgstr ""
-#: c-pragma.c:291
+#: c-pragma.c:298
msgid "junk at end of #pragma weak"
msgstr ""
-#: c-pragma.c:394 cpplib.c:753
-msgid "malformed #pragma directive"
-msgstr ""
-
-#: c-semantics.c:505
+#: c-semantics.c:607
msgid "break statement not within loop or switch"
msgstr ""
-#: c-semantics.c:523
+#: c-semantics.c:625
msgid "continue statement not within a loop"
msgstr ""
-#: c-semantics.c:630
+#: c-semantics.c:720
+msgid "destructor needed for `%#D'"
+msgstr ""
+
+#: c-semantics.c:721
+msgid "where case label appears here"
+msgstr ""
+
+#: c-semantics.c:724
+msgid ""
+"(enclose actions of previous case statements requiring destructors in their "
+"own scope.)"
+msgstr ""
+
+#: c-semantics.c:757 c-typeck.c:6800
#, c-format
msgid "%s qualifier ignored on asm"
msgstr ""
-#: c-typeck.c:119
+#: c-typeck.c:122
#, c-format
msgid "`%s' has an incomplete type"
msgstr ""
-#: c-typeck.c:141 cp/call.c:2525
+#: c-typeck.c:144 cp/call.c:2553
msgid "invalid use of void expression"
msgstr ""
-#: c-typeck.c:150
+#: c-typeck.c:153
msgid "invalid use of array with unspecified bounds"
msgstr ""
-#: c-typeck.c:158
+#: c-typeck.c:161
#, c-format
msgid "invalid use of undefined type `%s %s'"
msgstr ""
#. If this type has a typedef-name, the TYPE_NAME is a TYPE_DECL.
-#: c-typeck.c:162
+#: c-typeck.c:165
#, c-format
msgid "invalid use of incomplete typedef `%s'"
msgstr ""
-#: c-typeck.c:390 c-typeck.c:404
+#: c-typeck.c:396 c-typeck.c:410
msgid "function types not truly compatible in ISO C"
msgstr ""
-#: c-typeck.c:553
+#: c-typeck.c:561
msgid "types are not quite compatible"
msgstr ""
-#: c-typeck.c:704
+#: c-typeck.c:714
msgid "sizeof applied to a function type"
msgstr ""
-#: c-typeck.c:710
+#: c-typeck.c:720
msgid "sizeof applied to a void type"
msgstr ""
-#: c-typeck.c:719
+#: c-typeck.c:727
msgid "sizeof applied to an incomplete type"
msgstr ""
-#: c-typeck.c:760 c-typeck.c:2742
+#: c-typeck.c:780 c-typeck.c:2793
msgid "arithmetic on pointer to an incomplete type"
msgstr ""
-#: c-typeck.c:787
+#: c-typeck.c:808
msgid "__alignof__ applied to an incomplete type"
msgstr ""
-#: c-typeck.c:809
+#: c-typeck.c:834
msgid "`__alignof' applied to a bit-field"
msgstr ""
-#: c-typeck.c:982 cp/typeck.c:1767
+#: c-typeck.c:1025 cp/typeck.c:1792
msgid "invalid use of non-lvalue array"
msgstr ""
-#: c-typeck.c:1157
+#: c-typeck.c:1200
#, c-format
msgid "%s has no member named `%s'"
msgstr ""
-#: c-typeck.c:1188
+#: c-typeck.c:1231
#, c-format
msgid "request for member `%s' in something not a structure or union"
msgstr ""
-#: c-typeck.c:1221
+#: c-typeck.c:1264
msgid "dereferencing pointer to incomplete type"
msgstr ""
-#: c-typeck.c:1225
+#: c-typeck.c:1268
msgid "dereferencing `void *' pointer"
msgstr ""
-#: c-typeck.c:1242 cp/typeck.c:2373
+#: c-typeck.c:1285 cp/typeck.c:2402
#, c-format
msgid "invalid type argument of `%s'"
msgstr ""
-#: c-typeck.c:1261 cp/typeck.c:2399
+#: c-typeck.c:1304 cp/typeck.c:2428
msgid "subscript missing in array reference"
msgstr ""
-#: c-typeck.c:1282 cp/typeck.c:2420
+#: c-typeck.c:1325 cp/typeck.c:2470
msgid "array subscript has type `char'"
msgstr ""
-#: c-typeck.c:1290 c-typeck.c:1379 cp/typeck.c:2427 cp/typeck.c:2505
+#: c-typeck.c:1333 c-typeck.c:1422 cp/typeck.c:2477 cp/typeck.c:2556
msgid "array subscript is not an integer"
msgstr ""
-#: c-typeck.c:1323
+#: c-typeck.c:1366
msgid "ISO C forbids subscripting `register' array"
msgstr ""
-#: c-typeck.c:1325
+#: c-typeck.c:1368
msgid "ISO C89 forbids subscripting non-lvalue array"
msgstr ""
-#: c-typeck.c:1358
+#: c-typeck.c:1401
msgid "subscript has type `char'"
msgstr ""
-#: c-typeck.c:1374 cp/typeck.c:2500
+#: c-typeck.c:1417 cp/typeck.c:2551
msgid "subscripted value is neither array nor pointer"
msgstr ""
-#: c-typeck.c:1425
+#: c-typeck.c:1468
#, c-format
msgid "`%s' undeclared here (not in a function)"
msgstr ""
-#: c-typeck.c:1432
+#: c-typeck.c:1475
#, c-format
msgid "`%s' undeclared (first use in this function)"
msgstr ""
-#: c-typeck.c:1437
+#: c-typeck.c:1480
msgid "(Each undeclared identifier is reported only once"
msgstr ""
-#: c-typeck.c:1438
+#: c-typeck.c:1481
msgid "for each function it appears in.)"
msgstr ""
-#: c-typeck.c:1455
+#: c-typeck.c:1498
#, c-format
msgid "local declaration of `%s' hides instance variable"
msgstr ""
-#: c-typeck.c:1520
+#: c-typeck.c:1563
msgid "called object is not a function"
msgstr ""
-#: c-typeck.c:1603 cp/typeck.c:3133
+#: c-typeck.c:1647 cp/typeck.c:3189
msgid "too many arguments to function"
msgstr ""
-#: c-typeck.c:1626
+#: c-typeck.c:1670
#, c-format
msgid "type of formal parameter %d is incomplete"
msgstr ""
-#: c-typeck.c:1639
+#: c-typeck.c:1683
#, c-format
msgid "%s as integer rather than floating due to prototype"
msgstr ""
-#: c-typeck.c:1642
+#: c-typeck.c:1686
+#, c-format
+msgid "%s as integer rather than complex due to prototype"
+msgstr ""
+
+#: c-typeck.c:1689
#, c-format
msgid "%s as complex rather than floating due to prototype"
msgstr ""
-#: c-typeck.c:1645
+#: c-typeck.c:1692
#, c-format
msgid "%s as floating rather than integer due to prototype"
msgstr ""
-#: c-typeck.c:1648
+#: c-typeck.c:1695
+#, c-format
+msgid "%s as complex rather than integer due to prototype"
+msgstr ""
+
+#: c-typeck.c:1698
#, c-format
msgid "%s as floating rather than complex due to prototype"
msgstr ""
-#: c-typeck.c:1658
+#: c-typeck.c:1708
#, c-format
msgid "%s as `float' rather than `double' due to prototype"
msgstr ""
-#: c-typeck.c:1673
+#: c-typeck.c:1725
#, c-format
msgid "%s with different width due to prototype"
msgstr ""
-#: c-typeck.c:1707
+#: c-typeck.c:1759
#, c-format
msgid "%s as unsigned due to prototype"
msgstr ""
-#: c-typeck.c:1709
+#: c-typeck.c:1761
#, c-format
msgid "%s as signed due to prototype"
msgstr ""
-#: c-typeck.c:1744 cp/typeck.c:3235
+#: c-typeck.c:1795 cp/typeck.c:3290
msgid "too few arguments to function"
msgstr ""
-#: c-typeck.c:1785
+#: c-typeck.c:1836
msgid "suggest parentheses around + or - inside shift"
msgstr ""
-#: c-typeck.c:1792
+#: c-typeck.c:1843
msgid "suggest parentheses around && within ||"
msgstr ""
-#: c-typeck.c:1801
+#: c-typeck.c:1852
msgid "suggest parentheses around arithmetic in operand of |"
msgstr ""
-#: c-typeck.c:1804
+#: c-typeck.c:1855
msgid "suggest parentheses around comparison in operand of |"
msgstr ""
-#: c-typeck.c:1813
+#: c-typeck.c:1864
msgid "suggest parentheses around arithmetic in operand of ^"
msgstr ""
-#: c-typeck.c:1816
+#: c-typeck.c:1867
msgid "suggest parentheses around comparison in operand of ^"
msgstr ""
-#: c-typeck.c:1823
+#: c-typeck.c:1874
msgid "suggest parentheses around + or - in operand of &"
msgstr ""
-#: c-typeck.c:1826
+#: c-typeck.c:1877
msgid "suggest parentheses around comparison in operand of &"
msgstr ""
-#: c-typeck.c:1833
+#: c-typeck.c:1884
msgid "comparisons like X<=Y<=Z do not have their mathematical meaning"
msgstr ""
-#: c-typeck.c:2087 cp/typeck.c:3514
+#: c-typeck.c:2138 cp/typeck.c:3569
msgid "right shift count is negative"
msgstr ""
-#: c-typeck.c:2094 cp/typeck.c:3520
+#: c-typeck.c:2145 cp/typeck.c:3575
msgid "right shift count >= width of type"
msgstr ""
-#: c-typeck.c:2119 cp/typeck.c:3539
+#: c-typeck.c:2170 cp/typeck.c:3594
msgid "left shift count is negative"
msgstr ""
-#: c-typeck.c:2122 cp/typeck.c:3541
+#: c-typeck.c:2173 cp/typeck.c:3596
msgid "left shift count >= width of type"
msgstr ""
-#: c-typeck.c:2147
+#: c-typeck.c:2198
msgid "shift count is negative"
msgstr ""
-#: c-typeck.c:2149
+#: c-typeck.c:2200
msgid "shift count >= width of type"
msgstr ""
-#: c-typeck.c:2170 cp/typeck.c:3576
+#: c-typeck.c:2221 cp/typeck.c:3631
msgid "comparing floating point with == or != is unsafe"
msgstr ""
-#: c-typeck.c:2194 c-typeck.c:2200
+#: c-typeck.c:2245 c-typeck.c:2251
msgid "ISO C forbids comparison of `void *' with function pointer"
msgstr ""
-#: c-typeck.c:2203 c-typeck.c:2245 c-typeck.c:2273
+#: c-typeck.c:2254 c-typeck.c:2296 c-typeck.c:2324
msgid "comparison of distinct pointer types lacks a cast"
msgstr ""
-#: c-typeck.c:2218 c-typeck.c:2224 c-typeck.c:2294 c-typeck.c:2300
+#: c-typeck.c:2269 c-typeck.c:2275 c-typeck.c:2345 c-typeck.c:2351
msgid "comparison between pointer and integer"
msgstr ""
-#: c-typeck.c:2240 c-typeck.c:2268
+#: c-typeck.c:2291 c-typeck.c:2319
msgid "ISO C forbids ordered comparisons of pointers to functions"
msgstr ""
-#: c-typeck.c:2265
+#: c-typeck.c:2316
msgid "comparison of complete and incomplete pointers"
msgstr ""
-#: c-typeck.c:2281 c-typeck.c:2288
+#: c-typeck.c:2332 c-typeck.c:2339
msgid "ordered comparison of pointer with integer zero"
msgstr ""
-#: c-typeck.c:2314 cp/typeck.c:3748
+#: c-typeck.c:2365 cp/typeck.c:3764
msgid "unordered comparison on non-floating point argument"
msgstr ""
-#: c-typeck.c:2528
+#: c-typeck.c:2579
msgid "comparison between signed and unsigned"
msgstr ""
-#: c-typeck.c:2574 cp/typeck.c:3993
+#: c-typeck.c:2625 cp/typeck.c:4010
msgid "comparison of promoted ~unsigned with constant"
msgstr ""
-#: c-typeck.c:2582 cp/typeck.c:4001
+#: c-typeck.c:2633 cp/typeck.c:4018
msgid "comparison of promoted ~unsigned with unsigned"
msgstr ""
-#: c-typeck.c:2644
+#: c-typeck.c:2695
msgid "pointer of type `void *' used in arithmetic"
msgstr ""
-#: c-typeck.c:2650
+#: c-typeck.c:2701
msgid "pointer to a function used in arithmetic"
msgstr ""
-#: c-typeck.c:2728
+#: c-typeck.c:2779
msgid "pointer of type `void *' used in subtraction"
msgstr ""
-#: c-typeck.c:2730
+#: c-typeck.c:2781
msgid "pointer to a function used in subtraction"
msgstr ""
-#: c-typeck.c:2788
+#: c-typeck.c:2839
msgid "wrong type argument to unary plus"
msgstr ""
-#: c-typeck.c:2799
+#: c-typeck.c:2850
msgid "wrong type argument to unary minus"
msgstr ""
-#: c-typeck.c:2815
+#: c-typeck.c:2862
+msgid "ISO C does not support `~' for complex conjugation"
+msgstr ""
+
+#: c-typeck.c:2868
msgid "wrong type argument to bit-complement"
msgstr ""
-#: c-typeck.c:2826
+#: c-typeck.c:2879
msgid "wrong type argument to abs"
msgstr ""
-#: c-typeck.c:2838
+#: c-typeck.c:2891
msgid "wrong type argument to conjugation"
msgstr ""
-#: c-typeck.c:2852
+#: c-typeck.c:2905
msgid "wrong type argument to unary exclamation mark"
msgstr ""
-#: c-typeck.c:2906 c-typeck.c:2932
+#: c-typeck.c:2948
+msgid "ISO C does not support `++' and `--' on complex types"
+msgstr ""
+
+#: c-typeck.c:2962 c-typeck.c:2988
#, c-format
msgid "wrong type argument to %s"
msgstr ""
-#: c-typeck.c:2926
+#: c-typeck.c:2982
#, c-format
msgid "%s of pointer to unknown structure"
msgstr ""
-#: c-typeck.c:2991
+#: c-typeck.c:3052
msgid "invalid lvalue in increment"
msgstr ""
-#: c-typeck.c:2992
+#: c-typeck.c:3053
msgid "invalid lvalue in decrement"
msgstr ""
-#: c-typeck.c:3000 cp/typeck.c:4556
+#: c-typeck.c:3061 cp/typeck.c:4587
msgid "increment"
msgstr ""
-#: c-typeck.c:3000 cp/typeck.c:4556
+#: c-typeck.c:3061 cp/typeck.c:4587
msgid "decrement"
msgstr ""
-#: c-typeck.c:3053
+#: c-typeck.c:3117
msgid "ISO C forbids the address of a cast expression"
msgstr ""
-#: c-typeck.c:3067
+#: c-typeck.c:3131
msgid "invalid lvalue in unary `&'"
msgstr ""
-#: c-typeck.c:3099
+#: c-typeck.c:3163
#, c-format
msgid "attempt to take address of bit-field structure member `%s'"
msgstr ""
-#: c-typeck.c:3207 c-typeck.c:4553 c-typeck.c:4569 c-typeck.c:4585
-#: cp/typeck.c:4744 diagnostic.c:1408 gcc.c:3934
+#: c-typeck.c:3271 c-typeck.c:4618 c-typeck.c:4634 c-typeck.c:4650
+#: cp/typeck.c:4780 diagnostic.c:1475 gcc.c:4207 java/verify.c:1416
+#: java/verify.c:1417 java/verify.c:1432
#, c-format
msgid "%s"
msgstr ""
-#: c-typeck.c:3264
+#: c-typeck.c:3328
msgid "ISO C forbids use of conditional expressions as lvalues"
msgstr ""
-#: c-typeck.c:3267
+#: c-typeck.c:3331
msgid "ISO C forbids use of compound expressions as lvalues"
msgstr ""
-#: c-typeck.c:3270
+#: c-typeck.c:3334
msgid "ISO C forbids use of cast expressions as lvalues"
msgstr ""
-#: c-typeck.c:3287
+#: c-typeck.c:3351
#, c-format
msgid "%s of read-only member `%s'"
msgstr ""
-#: c-typeck.c:3291
+#: c-typeck.c:3355
#, c-format
msgid "%s of read-only variable `%s'"
msgstr ""
-#: c-typeck.c:3294
+#: c-typeck.c:3358
#, c-format
msgid "%s of read-only location"
msgstr ""
-#: c-typeck.c:3312
+#: c-typeck.c:3376
#, c-format
msgid "cannot take address of bitfield `%s'"
msgstr ""
-#: c-typeck.c:3339
+#: c-typeck.c:3403
#, c-format
msgid "global register variable `%s' used in nested function"
msgstr ""
-#: c-typeck.c:3343
+#: c-typeck.c:3407
#, c-format
msgid "register variable `%s' used in nested function"
msgstr ""
-#: c-typeck.c:3350
+#: c-typeck.c:3414
#, c-format
msgid "address of global register variable `%s' requested"
msgstr ""
-#: c-typeck.c:3362
+#: c-typeck.c:3426
msgid "cannot put object with volatile field into register"
msgstr ""
-#: c-typeck.c:3366
+#: c-typeck.c:3430
#, c-format
msgid "address of register variable `%s' requested"
msgstr ""
-#: c-typeck.c:3474
+#: c-typeck.c:3538
msgid "signed and unsigned type in conditional expression"
msgstr ""
-#: c-typeck.c:3481
+#: c-typeck.c:3545
msgid "ISO C forbids conditional expr with only one void side"
msgstr ""
-#: c-typeck.c:3497 c-typeck.c:3503
+#: c-typeck.c:3561 c-typeck.c:3568
msgid "ISO C forbids conditional expr between `void *' and function pointer"
msgstr ""
-#: c-typeck.c:3508
+#: c-typeck.c:3574
msgid "pointer type mismatch in conditional expression"
msgstr ""
-#: c-typeck.c:3515 c-typeck.c:3529
+#: c-typeck.c:3581 c-typeck.c:3591
msgid "pointer/integer type mismatch in conditional expression"
msgstr ""
-#: c-typeck.c:3521 c-typeck.c:3535
-msgid "ANSI C forbids conditional expr between 0 and function pointer"
-msgstr ""
-
-#: c-typeck.c:3547
+#: c-typeck.c:3605
msgid "type mismatch in conditional expression"
msgstr ""
-#: c-typeck.c:3620 cp/typeck.c:5007
+#: c-typeck.c:3678 cp/typeck.c:5012
msgid "left-hand operand of comma expression has no effect"
msgstr ""
-#: c-typeck.c:3659
+#: c-typeck.c:3717
msgid "cast specifies array type"
msgstr ""
-#: c-typeck.c:3665
+#: c-typeck.c:3723
msgid "cast specifies function type"
msgstr ""
-#: c-typeck.c:3675
+#: c-typeck.c:3733
msgid "ISO C forbids casting nonscalar to the same type"
msgstr ""
-#: c-typeck.c:3696
+#: c-typeck.c:3754
msgid "ISO C forbids casts to union type"
msgstr ""
-#: c-typeck.c:3712
+#: c-typeck.c:3770
msgid "cast to union type from type not present in union"
msgstr ""
#. There are qualifiers present in IN_OTYPE that are not
#. present in IN_TYPE.
-#: c-typeck.c:3757
+#: c-typeck.c:3815
msgid "cast discards qualifiers from pointer target type"
msgstr ""
-#: c-typeck.c:3772
+#: c-typeck.c:3830
msgid "cast increases required alignment of target type"
msgstr ""
-#: c-typeck.c:3778 cp/typeck.c:5422
+#: c-typeck.c:3836 cp/typeck.c:5420
msgid "cast from pointer to integer of different size"
msgstr ""
-#: c-typeck.c:3783
+#: c-typeck.c:3841
msgid "cast does not match function type"
msgstr ""
-#: c-typeck.c:3790 cp/typeck.c:5429
+#: c-typeck.c:3848 cp/typeck.c:5427
msgid "cast to pointer from integer of different size"
msgstr ""
#. Now we have handled acceptable kinds of LHS that are not truly lvalues.
#. Reject anything strange now.
-#: c-typeck.c:3932
+#: c-typeck.c:3990
msgid "invalid lvalue in assignment"
msgstr ""
#. Convert new value to destination type.
-#: c-typeck.c:3941 c-typeck.c:3965 c-typeck.c:3980 cp/typeck.c:5544
-#: cp/typeck.c:5693
+#: c-typeck.c:3999 c-typeck.c:4024 c-typeck.c:4041 cp/typeck.c:5542
+#: cp/typeck.c:5699
msgid "assignment"
msgstr ""
-#: c-typeck.c:4145 c-typeck.c:4212
+#: c-typeck.c:4208 c-typeck.c:4275
#, c-format
msgid "%s makes qualified function pointer from unqualified"
msgstr ""
-#: c-typeck.c:4149 c-typeck.c:4192
+#: c-typeck.c:4212 c-typeck.c:4255
#, c-format
msgid "%s discards qualifiers from pointer target type"
msgstr ""
-#: c-typeck.c:4155
+#: c-typeck.c:4218
msgid "ISO C prohibits argument conversion to union type"
msgstr ""
-#: c-typeck.c:4184
+#: c-typeck.c:4247
#, c-format
msgid "ISO C forbids %s between function pointer and `void *'"
msgstr ""
-#: c-typeck.c:4201
+#: c-typeck.c:4264
#, c-format
msgid "pointer targets in %s differ in signedness"
msgstr ""
-#: c-typeck.c:4217
+#: c-typeck.c:4280
#, c-format
msgid "%s from incompatible pointer type"
msgstr ""
-#: c-typeck.c:4233
+#: c-typeck.c:4296
#, c-format
msgid "%s makes pointer from integer without a cast"
msgstr ""
-#: c-typeck.c:4241
+#: c-typeck.c:4304
#, c-format
msgid "%s makes integer from pointer without a cast"
msgstr ""
-#: c-typeck.c:4253 c-typeck.c:4256
+#: c-typeck.c:4318 c-typeck.c:4321
#, c-format
msgid "incompatible type for argument %d of `%s'"
msgstr ""
-#: c-typeck.c:4260
+#: c-typeck.c:4325
#, c-format
msgid "incompatible type for argument %d of indirect function call"
msgstr ""
-#: c-typeck.c:4264
+#: c-typeck.c:4329
#, c-format
msgid "incompatible types in %s"
msgstr ""
#. Function name is known; supply it.
-#: c-typeck.c:4295
+#: c-typeck.c:4360
#, c-format
msgid "passing arg %d of `%s'"
msgstr ""
#. Function name unknown (call through ptr); just give arg number.
-#: c-typeck.c:4305
+#: c-typeck.c:4370
#, c-format
msgid "passing arg %d of pointer to function"
msgstr ""
-#: c-typeck.c:4372
+#: c-typeck.c:4437
msgid "initializer for static variable is not constant"
msgstr ""
-#: c-typeck.c:4378
+#: c-typeck.c:4443
msgid "initializer for static variable uses complicated arithmetic"
msgstr ""
-#: c-typeck.c:4386
+#: c-typeck.c:4451
msgid "aggregate initializer is not constant"
msgstr ""
-#: c-typeck.c:4388
+#: c-typeck.c:4453
msgid "aggregate initializer uses complicated arithmetic"
msgstr ""
-#: c-typeck.c:4395
+#: c-typeck.c:4460
msgid "traditional C rejects automatic aggregate initialization"
msgstr ""
-#: c-typeck.c:4556 c-typeck.c:4572 c-typeck.c:4588
+#: c-typeck.c:4621 c-typeck.c:4637 c-typeck.c:4653
#, c-format
msgid "(near initialization for `%s')"
msgstr ""
-#: c-typeck.c:4638 cp/typeck2.c:506
+#: c-typeck.c:4705 cp/typeck2.c:518
msgid "char-array initialized from wide string"
msgstr ""
-#: c-typeck.c:4645 cp/typeck2.c:513
+#: c-typeck.c:4712 cp/typeck2.c:525
msgid "int-array initialized from non-wide string"
msgstr ""
-#: c-typeck.c:4662 cp/typeck2.c:529
+#: c-typeck.c:4729 cp/typeck2.c:541
msgid "initializer-string for array of chars is too long"
msgstr ""
-#: c-typeck.c:4689
+#: c-typeck.c:4756
msgid "array initialized from non-constant array expression"
msgstr ""
-#: c-typeck.c:4706 c-typeck.c:4708 c-typeck.c:4714 c-typeck.c:4741
-#: c-typeck.c:5927
+#: c-typeck.c:4773 c-typeck.c:4775 c-typeck.c:4791 c-typeck.c:4812
+#: c-typeck.c:6207
msgid "initializer element is not constant"
msgstr ""
-#: c-typeck.c:4720 c-typeck.c:4747 c-typeck.c:5933
-msgid "initializer element is not computable at load time"
+#: c-typeck.c:4807
+msgid "initialization"
msgstr ""
-#: c-typeck.c:4736
-msgid "initialization"
+#: c-typeck.c:4818 c-typeck.c:6212
+msgid "initializer element is not computable at load time"
msgstr ""
-#: c-typeck.c:4784 c-typeck.c:4800 cp/typeck2.c:605
+#: c-typeck.c:4855 c-typeck.c:4871 cp/typeck2.c:618
msgid "invalid initializer"
msgstr ""
-#: c-typeck.c:5264
+#: c-typeck.c:5339
msgid "extra brace group at end of initializer"
msgstr ""
-#: c-typeck.c:5276
+#: c-typeck.c:5359
msgid "missing braces around initializer"
msgstr ""
-#: c-typeck.c:5310
+#: c-typeck.c:5403
msgid "braces around scalar initializer"
msgstr ""
-#: c-typeck.c:5391
-msgid "missing initializer"
+#: c-typeck.c:5455
+msgid "initialization of flexible array member in a nested context"
msgstr ""
-#: c-typeck.c:5404
-msgid "empty braces in initializer"
+#: c-typeck.c:5457
+msgid "initialization of a flexible array member"
msgstr ""
-#: c-typeck.c:5454
-msgid "empty scalar initializer"
+#: c-typeck.c:5467
+msgid "deprecated initialization of zero-length array"
msgstr ""
-#: c-typeck.c:5459
-msgid "extra elements in scalar initializer"
+#: c-typeck.c:5472
+msgid "initialization of zero-length array before end of structure"
msgstr ""
-#: c-typeck.c:5511
-#, c-format
-msgid "zero or negative array size `%s'"
+#: c-typeck.c:5477
+msgid "initialization of zero-length array inside a nested context"
msgstr ""
-#: c-typeck.c:5584 c-typeck.c:5586
-msgid "nonconstant array index in initializer"
+#: c-typeck.c:5496
+msgid "missing initializer"
msgstr ""
-#: c-typeck.c:5588
+#: c-typeck.c:5521
+msgid "empty scalar initializer"
+msgstr ""
+
+#: c-typeck.c:5526
+msgid "extra elements in scalar initializer"
+msgstr ""
+
+#: c-typeck.c:5610
+msgid "initialization designators may not nest"
+msgstr ""
+
+#: c-typeck.c:5631 c-typeck.c:5701
msgid "array index in non-array initializer"
msgstr ""
-#: c-typeck.c:5590
-msgid "duplicate array index in initializer"
+#: c-typeck.c:5636 c-typeck.c:5753
+msgid "field name not in record or union initializer"
msgstr ""
-#: c-typeck.c:5596
-msgid "empty index range in initializer"
+#: c-typeck.c:5697 c-typeck.c:5699
+msgid "nonconstant array index in initializer"
msgstr ""
-#: c-typeck.c:5600
-msgid "ISO C89 forbids specifying element to initialize"
+#: c-typeck.c:5704
+msgid "array index in initializer exceeds array bounds"
msgstr ""
-#: c-typeck.c:5631
-#, c-format
-msgid "unknown field `%s' specified in initializer"
+#: c-typeck.c:5715
+msgid "empty index range in initializer"
msgstr ""
-#: c-typeck.c:5634
-#, c-format
-msgid "field `%s' already initialized"
+#: c-typeck.c:5724
+msgid "array index range in initializer exceeds array bounds"
msgstr ""
-#: c-typeck.c:5640
-msgid "ISO C89 forbids specifying structure member to initialize"
+#: c-typeck.c:5765
+#, c-format
+msgid "unknown field `%s' specified in initializer"
msgstr ""
-#: c-typeck.c:5949
-msgid "duplicate initializer"
+#: c-typeck.c:5802 c-typeck.c:5823 c-typeck.c:6277
+msgid "initialized field with side-effects overwritten"
msgstr ""
-#: c-typeck.c:6273
+#: c-typeck.c:6490
msgid "excess elements in char array initializer"
msgstr ""
-#: c-typeck.c:6280 c-typeck.c:6315
+#: c-typeck.c:6497 c-typeck.c:6536
msgid "excess elements in struct initializer"
msgstr ""
-#: c-typeck.c:6382
+#: c-typeck.c:6603
msgid "excess elements in union initializer"
msgstr ""
-#: c-typeck.c:6398
+#: c-typeck.c:6620
msgid "traditional C rejects initialization of unions"
msgstr ""
-#: c-typeck.c:6461 c-typeck.c:6472
+#: c-typeck.c:6683
msgid "excess elements in array initializer"
msgstr ""
-#: c-typeck.c:6511
+#: c-typeck.c:6709
msgid "excess elements in scalar initializer"
msgstr ""
-#: c-typeck.c:6545
+#: c-typeck.c:6793
msgid "asm template is not a string constant"
msgstr ""
-#: c-typeck.c:6569
+#: c-typeck.c:6825
msgid "invalid lvalue in asm statement"
msgstr ""
-#: c-typeck.c:6604
+#: c-typeck.c:6898
msgid "modification by `asm'"
msgstr ""
-#: c-typeck.c:6623 cp/typeck.c:6716
+#: c-typeck.c:6917 cp/typeck.c:6589
msgid "function declared `noreturn' has a `return' statement"
msgstr ""
-#: c-typeck.c:6636
+#: c-typeck.c:6924
+msgid "`return' with no value, in function returning non-void"
+msgstr ""
+
+#: c-typeck.c:6930
msgid "`return' with a value, in function returning void"
msgstr ""
-#: c-typeck.c:6640
+#: c-typeck.c:6934
msgid "return"
msgstr ""
-#: c-typeck.c:6691
+#: c-typeck.c:6985
msgid "function returns address of local variable"
msgstr ""
-#: c-typeck.c:6726
+#: c-typeck.c:7043 cp/semantics.c:533
msgid "switch quantity not an integer"
msgstr ""
-#: c-typeck.c:6737
+#: c-typeck.c:7054
msgid "`long' switch expression not converted to `int' in ISO C"
msgstr ""
-#: calls.c:1882
+#: c-typeck.c:7097 cp/decl.c:5228
+msgid "case label not within a switch statement"
+msgstr ""
+
+#: c-typeck.c:7099 cp/decl.c:5233
+msgid "`default' label not within a switch statement"
+msgstr ""
+
+#: calls.c:1877
#, c-format
msgid "inlining failed in call to `%s'"
msgstr ""
-#: calls.c:1883 calls.c:2196
+#: calls.c:1878 calls.c:2191
msgid "called from here"
msgstr ""
-#: calls.c:2195
+#: calls.c:2190
#, c-format
msgid "can't inline call to `%s'"
msgstr ""
-#: calls.c:2233
+#: calls.c:2228
msgid "function call has aggregate value"
msgstr ""
-#: collect2.c:448
+#: calls.c:4604
+msgid "variable offset is passed paritially in stack and in reg"
+msgstr ""
+
+#: calls.c:4606
+msgid "variable size is passed partially in stack and in reg"
+msgstr ""
+
+#: collect2.c:454
msgid "internal error"
msgstr ""
-#: collect2.c:929
+#: collect2.c:935
msgid "no arguments"
msgstr ""
-#: collect2.c:1267 collect2.c:1415 collect2.c:1459
+#: collect2.c:1290 collect2.c:1438 collect2.c:1482
#, c-format
msgid "fopen %s"
msgstr ""
-#: collect2.c:1270 collect2.c:1420 collect2.c:1462
+#: collect2.c:1293 collect2.c:1443 collect2.c:1485
#, c-format
msgid "fclose %s"
msgstr ""
-#: collect2.c:1279
+#: collect2.c:1302
#, c-format
msgid "collect2 version %s"
msgstr ""
-#: collect2.c:1369
+#: collect2.c:1392
#, c-format
msgid "%d constructor(s) found\n"
msgstr ""
-#: collect2.c:1370
+#: collect2.c:1393
#, c-format
msgid "%d destructor(s) found\n"
msgstr ""
-#: collect2.c:1371
+#: collect2.c:1394
#, c-format
msgid "%d frame table(s) found\n"
msgstr ""
-#: collect2.c:1523
+#: collect2.c:1546
#, c-format
msgid "%s terminated with signal %d [%s]%s"
msgstr ""
-#: collect2.c:1542
+#: collect2.c:1565
#, c-format
msgid "%s returned %d exit status"
msgstr ""
-#: collect2.c:1570
+#: collect2.c:1593
#, c-format
msgid "[cannot find %s]"
msgstr ""
-#: collect2.c:1585
+#: collect2.c:1608
#, c-format
msgid "cannot find `%s'"
msgstr ""
-#: collect2.c:1596 collect2.c:1599
+#: collect2.c:1619 collect2.c:1622
#, c-format
msgid "redirecting stdout: %s"
msgstr ""
-#: collect2.c:1642
+#: collect2.c:1665
#, c-format
msgid "[Leaving %s]\n"
msgstr ""
-#: collect2.c:1865
+#: collect2.c:1906
#, c-format
msgid ""
"\n"
"write_c_file - output name is %s, prefix is %s\n"
msgstr ""
-#: collect2.c:2083
+#: collect2.c:2124
msgid "cannot find `nm'"
msgstr ""
-#: collect2.c:2093 collect2.c:2535
+#: collect2.c:2134 collect2.c:2576
msgid "pipe"
msgstr ""
-#: collect2.c:2097 collect2.c:2539
+#: collect2.c:2138 collect2.c:2580
msgid "fdopen"
msgstr ""
-#: collect2.c:2123 collect2.c:2565
+#: collect2.c:2164 collect2.c:2606
#, c-format
msgid "dup2 %d 1"
msgstr ""
-#: collect2.c:2126 collect2.c:2129 collect2.c:2142 collect2.c:2568
-#: collect2.c:2571 collect2.c:2584
+#: collect2.c:2167 collect2.c:2170 collect2.c:2183 collect2.c:2609
+#: collect2.c:2612 collect2.c:2625
#, c-format
msgid "close %d"
msgstr ""
-#: collect2.c:2132
+#: collect2.c:2173
#, c-format
msgid "execvp %s"
msgstr ""
-#: collect2.c:2186
+#: collect2.c:2227
#, c-format
msgid "init function found in object %s"
msgstr ""
-#: collect2.c:2194
+#: collect2.c:2235
#, c-format
msgid "fini function found in object %s"
msgstr ""
-#: collect2.c:2217 collect2.c:2623
+#: collect2.c:2258 collect2.c:2664
msgid "fclose"
msgstr ""
-#: collect2.c:2262
+#: collect2.c:2303
#, c-format
msgid "unable to open file '%s'"
msgstr ""
-#: collect2.c:2264
+#: collect2.c:2305
#, c-format
msgid "unable to stat file '%s'"
msgstr ""
-#: collect2.c:2270
+#: collect2.c:2311
#, c-format
msgid "unable to mmap file '%s'"
msgstr ""
-#: collect2.c:2423
+#: collect2.c:2464
msgid "not found\n"
msgstr ""
-#: collect2.c:2425 collect2.c:2602
+#: collect2.c:2466 collect2.c:2643
#, c-format
msgid "dynamic dependency %s not found"
msgstr ""
-#: collect2.c:2445
+#: collect2.c:2486
#, c-format
msgid "bad magic number in file '%s'"
msgstr ""
-#: collect2.c:2467
+#: collect2.c:2508
msgid "dynamic dependencies.\n"
msgstr ""
-#: collect2.c:2526
+#: collect2.c:2567
msgid "cannot find `ldd'"
msgstr ""
-#: collect2.c:2574
+#: collect2.c:2615
#, c-format
msgid "execv %s"
msgstr ""
-#: collect2.c:2587
+#: collect2.c:2628
msgid ""
"\n"
"ldd output with constructors/destructors.\n"
msgstr ""
-#: collect2.c:2614
+#: collect2.c:2655
#, c-format
msgid "unable to open dynamic dependency '%s'"
msgstr ""
-#: collect2.c:2716
+#: collect2.c:2769
#, c-format
msgid "%s: not a COFF file"
msgstr ""
-#: collect2.c:2835
+#: collect2.c:2888
#, c-format
msgid "%s: cannot open as COFF file"
msgstr ""
-#: collect2.c:2891
+#: collect2.c:2944
#, c-format
msgid "Library lib%s not found"
msgstr ""
-#: collect2.c:3014
+#: collect2.c:3073
#, c-format
msgid "open %s"
msgstr ""
-#: collect2.c:3037
+#: collect2.c:3096
msgid "incompatibilities between object file & expected values"
msgstr ""
-#: collect2.c:3110
+#: collect2.c:3169
#, c-format
msgid ""
"\n"
"Processing symbol table #%d, offset = 0x%.8lx, kind = %s\n"
msgstr ""
-#: collect2.c:3119
+#: collect2.c:3178
msgid "string section missing"
msgstr ""
-#: collect2.c:3122
+#: collect2.c:3181
msgid "section pointer missing"
msgstr ""
-#: collect2.c:3170
+#: collect2.c:3229
msgid "no symbol table found"
msgstr ""
-#: collect2.c:3183
+#: collect2.c:3242
msgid "no cmd_strings found"
msgstr ""
-#: collect2.c:3195
+#: collect2.c:3254
msgid ""
"\n"
"Updating header and load commands.\n"
"\n"
msgstr ""
-#: collect2.c:3202
+#: collect2.c:3261
#, c-format
msgid "load command map, %d cmds, new size %ld.\n"
msgstr ""
-#: collect2.c:3233
+#: collect2.c:3292
msgid ""
"writing load commands.\n"
"\n"
msgstr ""
-#: collect2.c:3253
+#: collect2.c:3312
#, c-format
msgid "close %s"
msgstr ""
-#: collect2.c:3327
+#: collect2.c:3386
msgid "could not convert 0x%l.8x into a region"
msgstr ""
-#: collect2.c:3331
+#: collect2.c:3390
#, c-format
msgid "%s function, region %d, offset = %ld (0x%.8lx)\n"
msgstr ""
-#: collect2.c:3458
+#: collect2.c:3517
msgid "bad magic number"
msgstr ""
-#: collect2.c:3459
+#: collect2.c:3518
msgid "bad header version"
msgstr ""
-#: collect2.c:3460
+#: collect2.c:3519
msgid "bad raw header version"
msgstr ""
-#: collect2.c:3461
+#: collect2.c:3520
msgid "raw header buffer too small"
msgstr ""
-#: collect2.c:3462
+#: collect2.c:3521
msgid "old raw header file"
msgstr ""
-#: collect2.c:3463
+#: collect2.c:3522
msgid "unsupported version"
msgstr ""
-#: collect2.c:3465
+#: collect2.c:3524
#, c-format
msgid "unknown {de,en}code_mach_o_hdr return value %d"
msgstr ""
-#: collect2.c:3485
+#: collect2.c:3544
#, c-format
msgid "fstat %s"
msgstr ""
-#: collect2.c:3522 collect2.c:3570
+#: collect2.c:3581 collect2.c:3629
#, c-format
msgid "lseek %s 0"
msgstr ""
-#: collect2.c:3526
+#: collect2.c:3585
#, c-format
msgid "read %s"
msgstr ""
-#: collect2.c:3529
+#: collect2.c:3588
#, c-format
msgid "read %ld bytes, expected %ld, from %s"
msgstr ""
-#: collect2.c:3550
+#: collect2.c:3609
#, c-format
msgid "msync %s"
msgstr ""
-#: collect2.c:3557
+#: collect2.c:3616
#, c-format
msgid "munmap %s"
msgstr ""
-#: collect2.c:3574
+#: collect2.c:3633
#, c-format
msgid "write %s"
msgstr ""
-#: collect2.c:3577
+#: collect2.c:3636
#, c-format
msgid "wrote %ld bytes, expected %ld, to %s"
msgstr ""
-#: combine.c:12664
+#: combine.c:12818
#, c-format
msgid ""
";; Combiner statistics: %d attempts, %d substitutions (%d requiring new "
@@ -3102,7 +3457,7 @@ msgid ""
"\n"
msgstr ""
-#: combine.c:12674
+#: combine.c:12828
#, c-format
msgid ""
"\n"
@@ -3110,52 +3465,57 @@ msgid ""
";; %d successes.\n"
msgstr ""
-#: config/a29k/a29k.c:1007
-#, ycp-format
+#. Run-time compilation parameters selecting different hardware subsets.
+#: config/1750a/1750a.h:39
+msgid "Use VAX-C alignment"
+msgstr ""
+
+#: config/a29k/a29k.c:1006
+#, c-format
msgid "invalid %%Q value"
msgstr ""
-#: config/a29k/a29k.c:1013 config/alpha/alpha.c:3646
-#, ycp-format
+#: config/a29k/a29k.c:1012 config/alpha/alpha.c:4055
+#, c-format
msgid "invalid %%C value"
msgstr ""
-#: config/a29k/a29k.c:1019 config/alpha/alpha.c:3510
-#: config/rs6000/rs6000.c:3986
-#, ycp-format
+#: config/a29k/a29k.c:1018 config/alpha/alpha.c:3919
+#: config/rs6000/rs6000.c:4015
+#, c-format
msgid "invalid %%N value"
msgstr ""
-#: config/a29k/a29k.c:1025 config/alpha/alpha.c:3581
-#: config/rs6000/rs6000.c:3948
-#, ycp-format
+#: config/a29k/a29k.c:1024 config/alpha/alpha.c:3990
+#: config/rs6000/rs6000.c:3977
+#, c-format
msgid "invalid %%M value"
msgstr ""
-#: config/a29k/a29k.c:1031 config/alpha/alpha.c:3573
-#: config/rs6000/rs6000.c:3913
-#, ycp-format
+#: config/a29k/a29k.c:1030 config/alpha/alpha.c:3982
+#: config/rs6000/rs6000.c:3942
+#, c-format
msgid "invalid %%m value"
msgstr ""
-#: config/a29k/a29k.c:1131 config/alpha/alpha.c:3534 config/romp/romp.c:683
-#, ycp-format
+#: config/a29k/a29k.c:1130 config/alpha/alpha.c:3943 config/romp/romp.c:682
+#, c-format
msgid "invalid %%L value"
msgstr ""
-#: config/a29k/a29k.c:1136 config/rs6000/rs6000.c:3994
-#, ycp-format
+#: config/a29k/a29k.c:1135 config/rs6000/rs6000.c:4023
+#, c-format
msgid "invalid %%O value"
msgstr ""
-#: config/a29k/a29k.c:1142 config/alpha/alpha.c:3518
-#: config/rs6000/rs6000.c:4013
-#, ycp-format
+#: config/a29k/a29k.c:1141 config/alpha/alpha.c:3927
+#: config/rs6000/rs6000.c:4042
+#, c-format
msgid "invalid %%P value"
msgstr ""
-#: config/a29k/a29k.c:1152
-#, ycp-format
+#: config/a29k/a29k.c:1151
+#, c-format
msgid "invalid %%V value"
msgstr ""
@@ -3235,82 +3595,82 @@ msgstr ""
msgid "Do not generate multm instructions"
msgstr ""
-#: config/alpha/alpha.c:174
+#: config/alpha/alpha.c:201
#, c-format
msgid "bad value `%s' for -mtrap-precision switch"
msgstr ""
-#: config/alpha/alpha.c:188
+#: config/alpha/alpha.c:215
#, c-format
msgid "bad value `%s' for -mfp-rounding-mode switch"
msgstr ""
-#: config/alpha/alpha.c:203
+#: config/alpha/alpha.c:230
#, c-format
msgid "bad value `%s' for -mfp-trap-mode switch"
msgstr ""
-#: config/alpha/alpha.c:254
+#: config/alpha/alpha.c:249 config/alpha/alpha.c:261
#, c-format
msgid "bad value `%s' for -mcpu switch"
msgstr ""
-#: config/alpha/alpha.c:262
+#: config/alpha/alpha.c:269
msgid "fp software completion requires -mtrap-precision=i"
msgstr ""
-#: config/alpha/alpha.c:278
+#: config/alpha/alpha.c:285
msgid "rounding mode not supported for VAX floats"
msgstr ""
-#: config/alpha/alpha.c:283
+#: config/alpha/alpha.c:290
msgid "trap mode not supported for VAX floats"
msgstr ""
-#: config/alpha/alpha.c:312
+#: config/alpha/alpha.c:319
#, c-format
msgid "L%d cache latency unknown for %s"
msgstr ""
-#: config/alpha/alpha.c:327
+#: config/alpha/alpha.c:334
#, c-format
msgid "bad value `%s' for -mmemory-latency"
msgstr ""
-#: config/alpha/alpha.c:3492
-#, ycp-format
+#: config/alpha/alpha.c:3901 config/ia64/ia64.c:3368
+#, c-format
msgid "invalid %%r value"
msgstr ""
-#: config/alpha/alpha.c:3503 config/rs6000/rs6000.c:4059
-#, ycp-format
+#: config/alpha/alpha.c:3912 config/rs6000/rs6000.c:4088
+#, c-format
msgid "invalid %%R value"
msgstr ""
-#: config/alpha/alpha.c:3526 config/romp/romp.c:725 config/romp/romp.c:732
-#, ycp-format
+#: config/alpha/alpha.c:3935 config/romp/romp.c:724 config/romp/romp.c:731
+#, c-format
msgid "invalid %%h value"
msgstr ""
-#: config/alpha/alpha.c:3616
-#, ycp-format
+#: config/alpha/alpha.c:4025
+#, c-format
msgid "invalid %%U value"
msgstr ""
-#: config/alpha/alpha.c:3624 config/alpha/alpha.c:3635 config/romp/romp.c:691
-#: config/rs6000/rs6000.c:4067
-#, ycp-format
+#: config/alpha/alpha.c:4033 config/alpha/alpha.c:4044 config/romp/romp.c:690
+#: config/rs6000/rs6000.c:4096
+#, c-format
msgid "invalid %%s value"
msgstr ""
-#: config/alpha/alpha.c:3683 config/rs6000/rs6000.c:3777
-#, ycp-format
+#: config/alpha/alpha.c:4092 config/rs6000/rs6000.c:3806
+#, c-format
msgid "invalid %%E value"
msgstr ""
-#: config/alpha/alpha.c:3704 config/romp/romp.c:966
-#: config/rs6000/rs6000.c:4359
-#, ycp-format
+#: config/alpha/alpha.c:4113 config/romp/romp.c:965
+#: config/rs6000/rs6000.c:4388
+#, c-format
msgid "invalid %%xn code"
msgstr ""
@@ -3319,71 +3679,71 @@ msgstr ""
#. each pair being { "NAME", VALUE }
#. where VALUE is the bits to set or minus the bits to clear.
#. An empty string NAME is used to identify the default VALUE.
-#: config/alpha/alpha.h:199 config/i386/i386.h:227 config/i386/i386.h:229
-#: config/i386/i386.h:231 config/ns32k/ns32k.h:103 config/rs6000/rs6000.h:304
-#: config/sparc/sparc.h:578 config/sparc/sparc.h:583
+#: config/alpha/alpha.h:200 config/i386/i386.h:233 config/i386/i386.h:235
+#: config/i386/i386.h:237 config/ns32k/ns32k.h:103 config/rs6000/rs6000.h:301
+#: config/sparc/sparc.h:577 config/sparc/sparc.h:582
msgid "Use hardware fp"
msgstr ""
-#: config/alpha/alpha.h:200 config/i386/i386.h:228 config/i386/i386.h:230
-#: config/rs6000/rs6000.h:306 config/sparc/sparc.h:580
-#: config/sparc/sparc.h:585
+#: config/alpha/alpha.h:201 config/i386/i386.h:234 config/i386/i386.h:236
+#: config/rs6000/rs6000.h:303 config/sparc/sparc.h:579
+#: config/sparc/sparc.h:584
msgid "Do not use hardware fp"
msgstr ""
-#: config/alpha/alpha.h:201
+#: config/alpha/alpha.h:202
msgid "Use fp registers"
msgstr ""
-#: config/alpha/alpha.h:203
+#: config/alpha/alpha.h:204
msgid "Do not use fp registers"
msgstr ""
-#: config/alpha/alpha.h:204
+#: config/alpha/alpha.h:205
msgid "Do not assume GAS"
msgstr ""
-#: config/alpha/alpha.h:205
+#: config/alpha/alpha.h:206
msgid "Assume GAS"
msgstr ""
-#: config/alpha/alpha.h:207
+#: config/alpha/alpha.h:208
msgid "Request IEEE-conformant math library routines (OSF/1)"
msgstr ""
-#: config/alpha/alpha.h:209
+#: config/alpha/alpha.h:210
msgid "Emit IEEE-conformant code, without inexact exceptions"
msgstr ""
-#: config/alpha/alpha.h:211
+#: config/alpha/alpha.h:212
msgid "Emit IEEE-conformant code, with inexact exceptions"
msgstr ""
-#: config/alpha/alpha.h:213
+#: config/alpha/alpha.h:214
msgid "Do not emit complex integer constants to read-only memory"
msgstr ""
-#: config/alpha/alpha.h:214
+#: config/alpha/alpha.h:215
msgid "Use VAX fp"
msgstr ""
-#: config/alpha/alpha.h:215
+#: config/alpha/alpha.h:216
msgid "Do not use VAX fp"
msgstr ""
-#: config/alpha/alpha.h:216
+#: config/alpha/alpha.h:217
msgid "Emit code for the byte/word ISA extension"
msgstr ""
-#: config/alpha/alpha.h:219
+#: config/alpha/alpha.h:220
msgid "Emit code for the motion video ISA extension"
msgstr ""
-#: config/alpha/alpha.h:222
+#: config/alpha/alpha.h:223
msgid "Emit code for the fp move and sqrt ISA extension"
msgstr ""
-#: config/alpha/alpha.h:224
+#: config/alpha/alpha.h:225
msgid "Emit code for the counting ISA extension"
msgstr ""
@@ -3404,275 +3764,298 @@ msgstr ""
#. extern char *m88k_short_data;
#. #define TARGET_OPTIONS { { "short-data-", &m88k_short_data } }
#. For -mcpu=
+#. For -mtune=
#. For -mfp-rounding-mode=[n|m|c|d]
#. For -mfp-trap-mode=[n|u|su|sui]
#. For -mtrap-precision=[p|f|i]
#. For -mmemory-latency=
-#: config/alpha/alpha.h:260
-msgid "Generate code for a given CPU"
+#: config/alpha/alpha.h:262
+msgid "Use features of and schedule given CPU"
msgstr ""
-#: config/alpha/alpha.h:262
+#: config/alpha/alpha.h:264
+msgid "Schedule given CPU"
+msgstr ""
+
+#: config/alpha/alpha.h:266
msgid "Control the generated fp rounding mode"
msgstr ""
-#: config/alpha/alpha.h:264
+#: config/alpha/alpha.h:268
msgid "Control the IEEE trap mode"
msgstr ""
-#: config/alpha/alpha.h:266
+#: config/alpha/alpha.h:270
msgid "Control the precision given to fp exceptions"
msgstr ""
-#: config/alpha/alpha.h:268
+#: config/alpha/alpha.h:272
msgid "Tune expected memory latency"
msgstr ""
-#: config/arc/arc.c:109
+#. The names we put in the hashtable will always be the unique versions gived to us by the stringtable, so we can just use their addresses as the keys.
+#. See if we already have an entry for this section.
+#: config/alpha/elf.h:354 config/elfos.h:461 config/i386/sco5.h:492
+#: config/pa/pa-64.h:320 config/rs6000/sysv4.h:963
+#, c-format
+msgid "%s causes a section type conflict"
+msgstr ""
+
+#: config/arc/arc.c:108
#, c-format
msgid "bad value (%s) for -mcpu switch"
msgstr ""
-#: config/arc/arc.c:1667 config/m32r/m32r.c:2218
+#: config/arc/arc.c:1666 config/m32r/m32r.c:2217
msgid "invalid operand to %R code"
msgstr ""
-#: config/arc/arc.c:1699 config/m32r/m32r.c:2241
+#: config/arc/arc.c:1698 config/m32r/m32r.c:2240
msgid "invalid operand to %H/%L code"
msgstr ""
-#: config/arc/arc.c:1723 config/m32r/m32r.c:2318
+#: config/arc/arc.c:1722 config/m32r/m32r.c:2317
msgid "invalid operand to %U code"
msgstr ""
-#: config/arc/arc.c:1734
+#: config/arc/arc.c:1733
msgid "invalid operand to %V code"
msgstr ""
#. Unknown flag.
-#: config/arc/arc.c:1741 config/m32r/m32r.c:2357 config/sparc/sparc.c:5859
+#: config/arc/arc.c:1740 config/m32r/m32r.c:2356 config/sparc/sparc.c:5888
msgid "invalid operand output code"
msgstr ""
-#: config/arm/arm.c:340
+#: config/arm/arm.c:372
#, c-format
msgid "switch -mcpu=%s conflicts with -march= switch"
msgstr ""
-#: config/arm/arm.c:350 config/rs6000/rs6000.c:310 config/sparc/sparc.c:332
+#: config/arm/arm.c:382 config/rs6000/rs6000.c:311 config/sparc/sparc.c:317
#, c-format
msgid "bad value (%s) for %s switch"
msgstr ""
-#: config/arm/arm.c:485
+#: config/arm/arm.c:518
msgid "target CPU does not support APCS-32"
msgstr ""
-#: config/arm/arm.c:490
+#: config/arm/arm.c:523
msgid "target CPU does not support APCS-26"
msgstr ""
-#: config/arm/arm.c:496
+#: config/arm/arm.c:529
msgid "target CPU does not support interworking"
msgstr ""
-#: config/arm/arm.c:502
-msgid "target CPU does not supoport THUMB instructions."
+#: config/arm/arm.c:535
+msgid "target CPU does not support THUMB instructions."
msgstr ""
-#: config/arm/arm.c:516
+#: config/arm/arm.c:549
msgid ""
"enabling backtrace support is only meaningful when compiling for the Thumb."
msgstr ""
-#: config/arm/arm.c:519
+#: config/arm/arm.c:552
msgid ""
"enabling callee interworking support is only meaningful when compiling for "
"the Thumb."
msgstr ""
-#: config/arm/arm.c:522
+#: config/arm/arm.c:555
msgid ""
"enabling caller interworking support is only meaningful when compiling for "
"the Thumb."
msgstr ""
-#: config/arm/arm.c:528
+#: config/arm/arm.c:561
msgid "interworking forces APCS-32 to be used"
msgstr ""
-#: config/arm/arm.c:534
+#: config/arm/arm.c:567
msgid "-mapcs-stack-check incompatible with -mno-apcs-frame"
msgstr ""
-#: config/arm/arm.c:542
+#: config/arm/arm.c:575
msgid "-fpic and -mapcs-reent are incompatible"
msgstr ""
-#: config/arm/arm.c:545
+#: config/arm/arm.c:578
msgid "APCS reentrant code not supported. Ignored"
msgstr ""
-#: config/arm/arm.c:553
+#: config/arm/arm.c:586
msgid "-g with -mno-apcs-frame may not give sensible debugging"
msgstr ""
-#: config/arm/arm.c:561
+#: config/arm/arm.c:594
msgid "Passing floating point arguments in fp regs not yet supported"
msgstr ""
-#: config/arm/arm.c:588
+#: config/arm/arm.c:623
#, c-format
msgid "Invalid floating point emulation option: -mfpe-%s"
msgstr ""
-#: config/arm/arm.c:612
+#: config/arm/arm.c:647
msgid "Structure size boundary can only be set to 8 or 32"
msgstr ""
-#: config/arm/arm.c:620
+#: config/arm/arm.c:655
msgid "-mpic-register= is useless without -fpic"
msgstr ""
-#: config/arm/arm.c:629
+#: config/arm/arm.c:664
#, c-format
msgid "Unable to use '%s' for PIC register"
msgstr ""
-#: config/arm/arm.c:8246
-msgid "Unable to compute real location of stacked parameter"
-msgstr ""
-
-#. Oh dear! We have no low registers into which we can pop
-#. high registers!
-#: config/arm/arm.c:8844
-msgid "No low registers available for popping high registers"
-msgstr ""
-
-#: config/arm/arm.c:9406
-msgid "thumb_load_double_from_address: destination is not a register"
+#. FIXME - the way to handle this situation is to allow
+#. the pretend args to be dumped onto the stack, then
+#. reuse r3 to save IP. This would involve moving the
+#. copying of SP into IP until after the pretend args
+#. have been dumped, but this is not too hard.
+#. [See e.g. gcc.c-torture/execute/nest-stdar-1.c.]
+#: config/arm/arm.c:7844
+msgid "Unable to find a temporary location for static chain register"
msgstr ""
-#: config/arm/arm.c:9411
-msgid "thumb_load_double_from_address: source is not a computed memory address"
+#: config/arm/arm.c:8806
+msgid "Unable to compute real location of stacked parameter"
msgstr ""
-#: config/arm/arm.c:9455
-msgid "thumb_load_double_from_address: base is not a register"
+#: config/arm/arm.c:9500
+msgid "no low registers available for popping high registers"
msgstr ""
-#: config/arm/arm.c:9513
-msgid "thumb_load_double_from_address: Unhandled address calculation"
+#: config/arm/arm.c:9712
+msgid "Interrupt Service Routines cannot be coded in Thumb mode."
msgstr ""
-#: config/arm/arm.h:410
+#: config/arm/arm.h:421
msgid "Generate APCS conformant stack frames"
msgstr ""
-#: config/arm/arm.h:413
+#: config/arm/arm.h:424
msgid "Store function names in object code"
msgstr ""
-#: config/arm/arm.h:417
-msgid "Use the 32bit version of the APCS"
+#: config/arm/arm.h:428
+msgid "Use the 32-bit version of the APCS"
msgstr ""
-#: config/arm/arm.h:419
-msgid "Use the 26bit version of the APCS"
+#: config/arm/arm.h:430
+msgid "Use the 26-bit version of the APCS"
msgstr ""
-#: config/arm/arm.h:423
+#: config/arm/arm.h:434
msgid "Pass FP arguments in FP registers"
msgstr ""
-#: config/arm/arm.h:426
+#: config/arm/arm.h:437
msgid "Generate re-entrant, PIC code"
msgstr ""
-#: config/arm/arm.h:429
+#: config/arm/arm.h:440
msgid "The MMU will trap on unaligned accesses"
msgstr ""
-#: config/arm/arm.h:436
+#: config/arm/arm.h:447
msgid "Use library calls to perform FP operations"
msgstr ""
-#: config/arm/arm.h:438 config/i960/i960.h:282
+#: config/arm/arm.h:449 config/i960/i960.h:282
msgid "Use hardware floating point instructions"
msgstr ""
-#: config/arm/arm.h:440
+#: config/arm/arm.h:451
msgid "Assume target CPU is configured as big endian"
msgstr ""
-#: config/arm/arm.h:442
+#: config/arm/arm.h:453
msgid "Assume target CPU is configured as little endian"
msgstr ""
-#: config/arm/arm.h:444
+#: config/arm/arm.h:455
msgid "Assume big endian bytes, little endian words"
msgstr ""
-#: config/arm/arm.h:446
-msgid "Support calls between THUMB and ARM instructions sets"
+#: config/arm/arm.h:457
+msgid "Support calls between Thumb and ARM instruction sets"
msgstr ""
-#: config/arm/arm.h:449
+#: config/arm/arm.h:460
msgid "Generate a call to abort if a noreturn function returns"
msgstr ""
-#: config/arm/arm.h:452
+#: config/arm/arm.h:463
msgid "Do not move instructions into a function's prologue"
msgstr ""
-#: config/arm/arm.h:455
+#: config/arm/arm.h:466
msgid "Do not load the PIC register in function prologues"
msgstr ""
-#: config/arm/arm.h:458
+#: config/arm/arm.h:469
msgid "Generate call insns as indirect calls, if necessary"
msgstr ""
-#: config/arm/arm.h:461
+#: config/arm/arm.h:472
msgid "Compile for the Thumb not the ARM"
msgstr ""
-#: config/arm/arm.h:465
+#: config/arm/arm.h:476
msgid "Thumb: Generate (non-leaf) stack frames even if not needed"
msgstr ""
-#: config/arm/arm.h:468
+#: config/arm/arm.h:479
msgid "Thumb: Generate (leaf) stack frames even if not needed"
msgstr ""
-#: config/arm/arm.h:471
+#: config/arm/arm.h:482
msgid "Thumb: Assume non-static functions may be called from ARM code"
msgstr ""
-#: config/arm/arm.h:475
+#: config/arm/arm.h:486
msgid "Thumb: Assume function pointers may go to non-Thumb aware code"
msgstr ""
-#: config/arm/arm.h:485
+#: config/arm/arm.h:496
msgid "Specify the name of the target CPU"
msgstr ""
-#: config/arm/arm.h:487
+#: config/arm/arm.h:498
msgid "Specify the name of the target architecture"
msgstr ""
-#: config/arm/arm.h:491
+#: config/arm/arm.h:502
msgid "Specify the version of the floating point emulator"
msgstr ""
-#: config/arm/arm.h:493
+#: config/arm/arm.h:504
msgid "Specify the minimum bit alignment of structures"
msgstr ""
-#: config/arm/arm.h:495
+#: config/arm/arm.h:506
msgid "Specify the register to be used for PIC addressing"
msgstr ""
+#: config/arm/pe.c:255 config/i386/winnt.c:339 config/mcore/mcore.c:3400
+#, c-format
+msgid "initialized variable `%s' is marked dllimport"
+msgstr ""
+
+#: config/arm/pe.c:264 config/i386/winnt.c:348
+#, c-format
+msgid "static variable `%s' is marked dllimport"
+msgstr ""
+
+#: config/arm/pe.h:62
+msgid "Ignore dllimport attribute for functions"
+msgstr ""
+
#. None of these is actually used in cc1. If we don't define them in target
#. switches cc1 complains about them. For the sake of argument lets allocate
#. bit 31 of target flags for such options.
@@ -3688,6 +4071,314 @@ msgstr ""
msgid "Don't do symbol renaming"
msgstr ""
+#: config/avr/avr.c:190
+#, c-format
+msgid "MCU `%s' not supported"
+msgstr ""
+
+#: config/avr/avr.c:430
+#, c-format
+msgid "large frame pointer change (%d) with -mtiny-stack"
+msgstr ""
+
+#: config/avr/avr.c:4704
+msgid "Only initialized variables can be placed into program memory area."
+msgstr ""
+
+#. `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.
+#: config/avr/avr.h:99
+msgid "Assume int to be 8 bit integer"
+msgstr ""
+
+#: config/avr/avr.h:101
+msgid "Change the stack pointer without disabling interrupts"
+msgstr ""
+
+#: config/avr/avr.h:103
+msgid "Use subroutines for function prologue/epilogue"
+msgstr ""
+
+#: config/avr/avr.h:105
+msgid "Change only the low 8 bits of the stack pointer"
+msgstr ""
+
+#: config/avr/avr.h:107
+msgid "Do not generate tablejump insns"
+msgstr ""
+
+#: config/avr/avr.h:110
+msgid "Output instruction sizes to the asm file"
+msgstr ""
+
+#: config/avr/avr.h:144
+msgid "Specify the initial stack address"
+msgstr ""
+
+#: config/avr/avr.h:145
+msgid "Specify the MCU name"
+msgstr ""
+
+#: config/avr/avr.h:2899
+msgid "Trampolines not supported\n"
+msgstr ""
+
+#: config/c4x/c4x.c:268
+#, c-format
+msgid "Unknown CPU version %d, using 40.\n"
+msgstr ""
+
+#: config/c4x/c4x.c:859
+#, c-format
+msgid "ISR %s requires %d words of local vars, max is 32767."
+msgstr ""
+
+#: config/c4x/c4x.c:4525
+#, c-format
+msgid "junk at end of '#pragma %s'"
+msgstr ""
+
+#. Name of the c4x assembler.
+#. Name of the c4x linker.
+#. Define assembler options.
+#. Define linker options.
+#. Define C preprocessor options.
+#. Specify the end file to link with.
+#. Target compilation option flags.
+#. Small memory model.
+#. Use 24-bit MPYI for C3x.
+#. Fast fixing of floats.
+#. Allow use of RPTS.
+#. Emit C3x code.
+#. Be compatible with TI assembler.
+#. Be paranoid about DP reg. in ISRs.
+#. Pass arguments on stack.
+#. Enable features under development.
+#. Enable repeat block.
+#. Use BK as general register.
+#. Use decrement and branch for C3x.
+#. Enable debugging of GCC.
+#. Force constants into registers.
+#. Allow unsigned loop counters.
+#. Force op0 and op1 to be same.
+#. Save all 40 bits for floats.
+#. Allow parallel insns.
+#. Allow MPY||ADD, MPY||SUB insns.
+#. Assume mem refs possibly aliased.
+#. Emit C30 code.
+#. Emit C31 code.
+#. Emit C32 code.
+#. Emit C33 code.
+#. Emit C40 code.
+#. Emit C44 code.
+#. Run-time compilation parameters selecting different hardware subsets.
+#.
+#. Macro to define tables used to set the flags.
+#. This is a list in braces of triplets in braces,
+#. each pair being { "NAME", VALUE, "DESCRIPTION" }
+#. where VALUE is the bits to set or minus the bits to clear.
+#. An empty string NAME is used to identify the default VALUE.
+#: config/c4x/c4x.h:141
+msgid "Small memory model"
+msgstr ""
+
+#: config/c4x/c4x.h:143
+msgid "Big memory model"
+msgstr ""
+
+#: config/c4x/c4x.h:145
+msgid "Use MPYI instruction for C3x"
+msgstr ""
+
+#: config/c4x/c4x.h:147
+msgid "Do not use MPYI instruction for C3x"
+msgstr ""
+
+#: config/c4x/c4x.h:149
+msgid "Use fast but approximate float to integer conversion"
+msgstr ""
+
+#: config/c4x/c4x.h:151
+msgid "Use slow but accurate float to integer conversion"
+msgstr ""
+
+#: config/c4x/c4x.h:153
+msgid "Enable use of RTPS instruction"
+msgstr ""
+
+#: config/c4x/c4x.h:155
+msgid "Disable use of RTPS instruction"
+msgstr ""
+
+#: config/c4x/c4x.h:157
+msgid "Enable use of RTPB instruction"
+msgstr ""
+
+#: config/c4x/c4x.h:159
+msgid "Disable use of RTPB instruction"
+msgstr ""
+
+#: config/c4x/c4x.h:161
+msgid "Generate code for C30 CPU"
+msgstr ""
+
+#: config/c4x/c4x.h:163
+msgid "Generate code for C31 CPU"
+msgstr ""
+
+#: config/c4x/c4x.h:165
+msgid "Generate code for C32 CPU"
+msgstr ""
+
+#: config/c4x/c4x.h:167
+msgid "Generate code for C33 CPU"
+msgstr ""
+
+#: config/c4x/c4x.h:169
+msgid "Generate code for C40 CPU"
+msgstr ""
+
+#: config/c4x/c4x.h:171
+msgid "Generate code for C44 CPU"
+msgstr ""
+
+#: config/c4x/c4x.h:173
+msgid "Emit code compatible with TI tools"
+msgstr ""
+
+#: config/c4x/c4x.h:175
+msgid "Emit code to use GAS extensions"
+msgstr ""
+
+#: config/c4x/c4x.h:177 config/c4x/c4x.h:181
+msgid "Save DP across ISR in small memory model"
+msgstr ""
+
+#: config/c4x/c4x.h:179 config/c4x/c4x.h:183
+msgid "Don't save DP across ISR in small memory model"
+msgstr ""
+
+#: config/c4x/c4x.h:185
+msgid "Pass arguments on the stack"
+msgstr ""
+
+#: config/c4x/c4x.h:187
+msgid "Pass arguments in registers"
+msgstr ""
+
+#: config/c4x/c4x.h:189
+msgid "Enable new features under development"
+msgstr ""
+
+#: config/c4x/c4x.h:191
+msgid "Disable new features under development"
+msgstr ""
+
+#: config/c4x/c4x.h:193
+msgid "Use the BK register as a general purpose register"
+msgstr ""
+
+#: config/c4x/c4x.h:195
+msgid "Do not allocate BK register"
+msgstr ""
+
+#: config/c4x/c4x.h:197
+msgid "Enable use of DB instruction"
+msgstr ""
+
+#: config/c4x/c4x.h:199
+msgid "Disable use of DB instruction"
+msgstr ""
+
+#: config/c4x/c4x.h:201
+msgid "Enable debugging"
+msgstr ""
+
+#: config/c4x/c4x.h:203
+msgid "Disable debugging"
+msgstr ""
+
+#: config/c4x/c4x.h:205
+msgid "Force constants into registers to improve hoisting"
+msgstr ""
+
+#: config/c4x/c4x.h:207
+msgid "Don't force constants into registers"
+msgstr ""
+
+#: config/c4x/c4x.h:209
+msgid "Force RTL generation to emit valid 3 operand insns"
+msgstr ""
+
+#: config/c4x/c4x.h:211
+msgid "Allow RTL generation to emit invalid 3 operand insns"
+msgstr ""
+
+#: config/c4x/c4x.h:213
+msgid "Allow unsigned interation counts for RPTB/DB"
+msgstr ""
+
+#: config/c4x/c4x.h:215
+msgid "Disallow unsigned iteration counts for RPTB/DB"
+msgstr ""
+
+#: config/c4x/c4x.h:217
+msgid "Preserve all 40 bits of FP reg across call"
+msgstr ""
+
+#: config/c4x/c4x.h:219
+msgid "Only preserve 32 bits of FP reg across call"
+msgstr ""
+
+#: config/c4x/c4x.h:221
+msgid "Enable parallel instructions"
+msgstr ""
+
+#: config/c4x/c4x.h:223
+msgid "Disable parallel instructions"
+msgstr ""
+
+#: config/c4x/c4x.h:225
+msgid "Enable MPY||ADD and MPY||SUB instructions"
+msgstr ""
+
+#: config/c4x/c4x.h:227
+msgid "Disable MPY||ADD and MPY||SUB instructions"
+msgstr ""
+
+#: config/c4x/c4x.h:229
+msgid "Assume that pointers may be aliased"
+msgstr ""
+
+#: config/c4x/c4x.h:231
+msgid "Assume that pointers not aliased"
+msgstr ""
+
+#: config/c4x/c4x.h:321
+msgid "Specify maximum number of iterations for RPTS"
+msgstr ""
+
+#: config/c4x/c4x.h:323
+msgid "Select CPU to generate code for"
+msgstr ""
+
#. Macros used in the machine description to test the flags.
#. Macro to define tables used to set the flags.
#. This is a list in braces of pairs in braces,
@@ -3750,77 +4441,112 @@ msgstr ""
msgid "Use cc- and libc-compatible 32-bit longs"
msgstr ""
-#: config/dsp16xx/dsp16xx.c:271
+#: config/d30v/d30v.c:186
#, c-format
-msgid "Invalid register class letter %c"
+msgid "Bad modes_tieable_p for register %s, mode1 %s, mode2 %s"
msgstr ""
-#: config/dsp16xx/dsp16xx.c:374
-msgid "ACCUM_HIGH_REGS class in limit_reload_class"
+#. 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, a
+#. number, which contains the bits to set in `target_flags', and a second
+#. string which is the description displayed by `--help'. If the number is
+#. negative then the bits specified by the number are cleared instead of being
+#. set. If the description string is present but empty, then no help
+#. information will be displayed for that option, but it will not count as an
+#. undocumented option. 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", TARGET_MASK_68020, "" }, { "68000", -TARGET_MASK_68020, "Compile for the 68000" }, { "", TARGET_MASK_68020, "" }}
+#: config/d30v/d30v.h:447
+msgid "Enable use of conditional move instructions"
msgstr ""
-#: config/dsp16xx/dsp16xx.c:401
-msgid "YH_OR_ACCUM_HIGH_REGS found in limit_reload_class"
+#: config/d30v/d30v.h:450
+msgid "Disable use of conditional move instructions"
msgstr ""
-#. Register 'yl' is invalid for QImode, so we should never
-#. see it.
-#: config/dsp16xx/dsp16xx.c:410
-msgid "YL found in limit_reload_class"
+#: config/d30v/d30v.h:453
+msgid "Debug argument support in compiler"
msgstr ""
-#: config/dsp16xx/dsp16xx.c:1228 config/dsp16xx/dsp16xx.c:1255
-msgid "Stack size > 32k"
+#: config/d30v/d30v.h:456
+msgid "Debug stack support in compiler"
msgstr ""
-#: config/dsp16xx/dsp16xx.c:1485
-msgid "Invalid addressing mode"
+#: config/d30v/d30v.h:459
+msgid "Debug memory address support in compiler"
msgstr ""
-#: config/dsp16xx/dsp16xx.c:1671
-msgid "Bad register extension code"
+#: config/d30v/d30v.h:462
+msgid "Make adjacent short instructions parallel if possible."
msgstr ""
-#: config/dsp16xx/dsp16xx.c:1729
-msgid "Invalid offset in ybase addressing"
+#: config/d30v/d30v.h:465
+msgid "Do not make adjacent short instructions parallel."
msgstr ""
-#: config/dsp16xx/dsp16xx.c:1732
-msgid "Invalid register in ybase addressing"
+#: config/d30v/d30v.h:468 config/d30v/d30v.h:471
+msgid "Link programs/data to be in external memory by default"
msgstr ""
-#: config/dsp16xx/dsp16xx.c:1761 config/dsp16xx/dsp16xx.c:1999
-msgid "inline float constants not supported on this host"
+#: config/d30v/d30v.h:474
+msgid "Link programs/data to be in onchip memory by default"
msgstr ""
-#: config/dsp16xx/dsp16xx.c:1905
-msgid "Invalid shift operator in emit_1600_core_shift"
+#. 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, the address of a variable, and a description string. 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, "Specify the size of the short data section" } }
+#: config/d30v/d30v.h:501
+msgid "Change the branch costs within the compiler"
msgstr ""
-#: config/dsp16xx/dsp16xx.c:2184
-msgid "Invalid mode for gen_tst_reg"
+#: config/d30v/d30v.h:504
+msgid "Change the threshold for conversion to conditional execution"
msgstr ""
-#: config/dsp16xx/dsp16xx.c:2265
-msgid "Invalid mode for integer comparison in gen_compare_reg"
+#: config/dsp16xx/dsp16xx.c:1225 config/dsp16xx/dsp16xx.c:1250
+msgid "Stack size > 32k"
msgstr ""
-#: config/dsp16xx/dsp16xx.c:2293
-msgid "Invalid register for compare"
+#: config/dsp16xx/dsp16xx.c:1759 config/dsp16xx/dsp16xx.c:1999
+msgid "inline float constants not supported on this host"
msgstr ""
#. Output assembler code to FILE to increment profiler label # LABELNO
#. for profiling a function entry.
-#: config/dsp16xx/dsp16xx.h:1187 config/dsp16xx/dsp16xx.h:1191
-#: config/dsp16xx/dsp16xx.h:1195 config/dsp16xx/dsp16xx.h:1838
-#: config/dsp16xx/dsp16xx.h:1842
+#: config/dsp16xx/dsp16xx.h:1188 config/dsp16xx/dsp16xx.h:1193
+#: config/dsp16xx/dsp16xx.h:1198 config/dsp16xx/dsp16xx.h:1840
+#: config/dsp16xx/dsp16xx.h:1845
msgid "Profiling not implemented yet."
msgstr ""
#. 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.
-#: config/dsp16xx/dsp16xx.h:1205 config/dsp16xx/dsp16xx.h:1217
+#: config/dsp16xx/dsp16xx.h:1209 config/dsp16xx/dsp16xx.h:1221
msgid "Trampolines not yet implemented"
msgstr ""
@@ -3829,103 +4555,62 @@ msgstr ""
#. each pair being { "NAME", VALUE }
#. where VALUE is the bits to set or minus the bits to clear.
#. An empty string NAME is used to identify the default VALUE.
-#: config/elxsi/elxsi.h:50
+#: config/elxsi/elxsi.h:51
msgid "Generate code the unix assembler can handle"
msgstr ""
-#: config/elxsi/elxsi.h:51
+#: config/elxsi/elxsi.h:52
msgid "Generate code an embedded assembler can handle"
msgstr ""
-#. Macro to define tables used to set the flags.
-#. This is a list in braces of pairs in braces,
-#. each pair being { "NAME", VALUE }
-#. where VALUE is the bits to set or minus the bits to clear.
-#. An empty string NAME is used to identify the default VALUE.
-#: config/fx80/fx80.h:113 config/fx80/fx80.h:114
-msgid "Generate code for a mc68020"
-msgstr ""
-
-#. Since we don't define PCC_BITFIELD_TYPE_MATTERS or use a large
-#. STRUCTURE_SIZE_BOUNDARY, we must have bitfield instructions.
-#: config/fx80/fx80.h:115 config/gmicro/gmicro.h:101 config/ns32k/ns32k.h:117
-msgid "Use bitfield instructions"
-msgstr ""
-
-#: config/fx80/fx80.h:116 config/fx80/fx80.h:117
-msgid "Generate code for a mc68000"
-msgstr ""
-
-#: config/fx80/fx80.h:118
-msgid "Generate software FP code"
-msgstr ""
-
-#: config/fx80/fx80.h:119
-msgid "Do not generate bitfield insns"
-msgstr ""
-
-#: config/fx80/fx80.h:120
-msgid "Use 16bit integers"
-msgstr ""
-
-#: config/fx80/fx80.h:121
-msgid "Use 32bit integers"
-msgstr ""
-
-#. Macro to define tables used to set the flags.
-#. This is a list in braces of pairs in braces,
-#. each pair being { "NAME", VALUE }
-#. where VALUE is the bits to set or minus the bits to clear.
-#. An empty string NAME is used to identify the default VALUE.
-#: config/gmicro/gmicro.h:89
-msgid "Compile for Gmicro/300"
-msgstr ""
-
-#: config/gmicro/gmicro.h:90
-msgid "Compile for Gmicro/200"
+#: config/fr30/fr30.c:445
+msgid "fr30_print_operand_address: unhandled address"
msgstr ""
-#: config/gmicro/gmicro.h:91
-msgid "Compile for Gmicro/100"
+#: config/fr30/fr30.c:472
+#, c-format
+msgid "fr30_print_operand: unrecognised %p code"
msgstr ""
-#: config/gmicro/gmicro.h:92
-msgid "Use floating point co-processor"
+#: config/fr30/fr30.c:492
+msgid "fr30_print_operand: unrecognised %b code"
msgstr ""
-#: config/gmicro/gmicro.h:94
-msgid "Do not use floating point co-processor"
+#: config/fr30/fr30.c:513
+msgid "fr30_print_operand: unrecognised %B code"
msgstr ""
-#: config/gmicro/gmicro.h:95 config/i386/i386.h:237
-msgid "Alternate calling convention"
+#: config/fr30/fr30.c:521
+msgid "fr30_print_operand: invalid operand to %A code"
msgstr ""
-#: config/gmicro/gmicro.h:96 config/i386/i386.h:239 config/ns32k/ns32k.h:106
-msgid "Use normal calling convention"
+#: config/fr30/fr30.c:538
+#, c-format
+msgid "fr30_print_operand: invalid %x code"
msgstr ""
-#: config/gmicro/gmicro.h:103 config/ns32k/ns32k.h:116
-msgid "Do not use bitfield instructions"
+#: config/fr30/fr30.c:545
+msgid "fr30_print_operand: invalid %F code"
msgstr ""
-#: config/gmicro/gmicro.h:105
-msgid "Use alternative return sequence"
+#: config/fr30/fr30.c:561
+msgid "fr30_print_operand: unknown code"
msgstr ""
-#: config/gmicro/gmicro.h:106
-msgid "Use normal return sequence"
+#: config/fr30/fr30.c:590 config/fr30/fr30.c:599 config/fr30/fr30.c:610
+#: config/fr30/fr30.c:623
+msgid "fr30_print_operand: unhandled MEM"
msgstr ""
-#: config/gmicro/gmicro.h:107
-msgid "Always use string instruction"
+#: config/fr30/fr30.h:85
+msgid "Assume small address space"
msgstr ""
-#: config/gmicro/gmicro.h:109
-msgid "Use string instruction when appropriate"
+#: config/h8300/h8300.c:116
+msgid "-ms2600 is used without -ms."
msgstr ""
-#: config/h8300/h8300.c:3023 config/h8300/h8300.c:3035
+#: config/h8300/h8300.c:3047 config/h8300/h8300.c:3059
msgid "Only initialized variables can be placed into the 8-bit area."
msgstr ""
@@ -3934,59 +4619,67 @@ msgstr ""
#. each pair being { "NAME", VALUE }
#. where VALUE is the bits to set or minus the bits to clear.
#. An empty string NAME is used to identify the default VALUE.
-#: config/h8300/h8300.h:105
+#: config/h8300/h8300.h:108
msgid "Generate H8/S code"
msgstr ""
-#: config/h8300/h8300.h:106
+#: config/h8300/h8300.h:109
msgid "Do not generate H8/S code"
msgstr ""
-#: config/h8300/h8300.h:107
+#: config/h8300/h8300.h:110
+msgid "Generate H8/S2600 code"
+msgstr ""
+
+#: config/h8300/h8300.h:111
+msgid "Do not generate H8/S2600 code"
+msgstr ""
+
+#: config/h8300/h8300.h:112
msgid "Make integers 32 bits wide"
msgstr ""
-#: config/h8300/h8300.h:110
+#: config/h8300/h8300.h:115
msgid "Use registers for argument passing"
msgstr ""
-#: config/h8300/h8300.h:112
+#: config/h8300/h8300.h:117
msgid "Do not use registers for argument passing"
msgstr ""
-#: config/h8300/h8300.h:114
+#: config/h8300/h8300.h:119
msgid "Consider access to byte sized memory slow"
msgstr ""
-#: config/h8300/h8300.h:115
+#: config/h8300/h8300.h:120
msgid "Enable linker relaxing"
msgstr ""
-#: config/h8300/h8300.h:117
+#: config/h8300/h8300.h:122
msgid "Generate H8/300H code"
msgstr ""
-#: config/h8300/h8300.h:118
+#: config/h8300/h8300.h:123
msgid "Do not generate H8/300H code"
msgstr ""
-#: config/h8300/h8300.h:119
+#: config/h8300/h8300.h:124
msgid "Use H8/300 alignment rules"
msgstr ""
-#: config/i370/i370.c:870
+#: config/i370/i370.c:869
msgid "real name is too long - alias ignored"
msgstr ""
-#: config/i370/i370.c:875
+#: config/i370/i370.c:874
msgid "alias name is too long - alias ignored"
msgstr ""
-#: config/i370/i370.c:1040
+#: config/i370/i370.c:1039
msgid "junk at end of #pragma map"
msgstr ""
-#: config/i370/i370.c:1046
+#: config/i370/i370.c:1045
msgid "malformed #pragma map, ignored"
msgstr ""
@@ -4002,35 +4695,43 @@ msgstr ""
msgid "Do not generate char instructions"
msgstr ""
-#: config/i386/cygwin.h:50
+#: config/i386/cygwin.h:49
msgid "Use the Cygwin interface"
msgstr ""
-#: config/i386/cygwin.h:52
+#: config/i386/cygwin.h:51
msgid "Use the Mingw32 interface"
msgstr ""
-#: config/i386/cygwin.h:53
+#: config/i386/cygwin.h:52
msgid "Create GUI application"
msgstr ""
-#: config/i386/cygwin.h:55
-msgid "Create console application"
+#: config/i386/cygwin.h:53
+msgid "Don't set Windows defines"
+msgstr ""
+
+#: config/i386/cygwin.h:54
+msgid "Set Windows defines"
msgstr ""
#: config/i386/cygwin.h:56
+msgid "Create console application"
+msgstr ""
+
+#: config/i386/cygwin.h:57 config/i386/win32.h:59
msgid "Generate code for a DLL"
msgstr ""
-#: config/i386/cygwin.h:58
+#: config/i386/cygwin.h:59 config/i386/win32.h:61
msgid "Ignore dllimport for functions"
msgstr ""
-#: config/i386/cygwin.h:60
+#: config/i386/cygwin.h:61
msgid "Use Mingw-specific thread support"
msgstr ""
-#: config/i386/cygwin.h:265
+#: config/i386/cygwin.h:313
#, c-format
msgid "-f%s ignored for target (all code is position independent)"
msgstr ""
@@ -4068,133 +4769,153 @@ msgstr ""
msgid "argument is a structure"
msgstr ""
-#: config/i386/i386.c:503
+#: config/i386/djgpp.h:286
+msgid "-mbnu210 is ignored (option is obsolete)."
+msgstr ""
+
+#: config/i386/i386.c:558
#, c-format
msgid "bad value (%s) for -march= switch"
msgstr ""
-#: config/i386/i386.c:516 config/mips/mips.c:4865
+#: config/i386/i386.c:570 config/mips/mips.c:4935
#, c-format
msgid "bad value (%s) for -mcpu= switch"
msgstr ""
-#: config/i386/i386.c:545
+#: config/i386/i386.c:601
#, c-format
msgid "Register '%c' is unknown"
msgstr ""
-#: config/i386/i386.c:549
+#: config/i386/i386.c:607
#, c-format
msgid "Register '%c' already specified in allocation order"
msgstr ""
-#: config/i386/i386.c:560
+#: config/i386/i386.c:620
#, c-format
msgid "-mregparm=%d is not between 0 and %d"
msgstr ""
-#: config/i386/i386.c:570
+#: config/i386/i386.c:631
#, c-format
msgid "-malign-loops=%d is not between 0 and %d"
msgstr ""
-#: config/i386/i386.c:580
+#: config/i386/i386.c:642
#, c-format
msgid "-malign-jumps=%d is not between 0 and %d"
msgstr ""
-#: config/i386/i386.c:590
+#: config/i386/i386.c:653
#, c-format
msgid "-malign-functions=%d is not between 0 and %d"
msgstr ""
-#: config/i386/i386.c:601
+#: config/i386/i386.c:666
#, c-format
msgid "-mpreferred-stack-boundary=%d is not between 2 and 31"
msgstr ""
-#: config/i386/i386.c:611
+#: config/i386/i386.c:677
#, c-format
msgid "-mbranch-cost=%d is not between 0 and 5"
msgstr ""
#. We can't handle floating point constants;
#. PRINT_OPERAND must handle them.
-#: config/i386/i386.c:2973 config/pdp11/pdp11.c:1477 config/sh/sh.c:5397
-#: final.c:3731
+#: config/i386/i386.c:3124 config/pdp11/pdp11.c:1477 final.c:3676
msgid "floating constant misused"
msgstr ""
-#: config/i386/i386.c:3018 config/sh/sh.c:5451
+#: config/i386/i386.c:3169
msgid "invalid UNSPEC as operand"
msgstr ""
-#: config/i386/i386.c:3024 config/pdp11/pdp11.c:1524 config/sh/sh.c:5457
-#: final.c:3778
+#: config/i386/i386.c:3175 config/pdp11/pdp11.c:1524 final.c:3731
msgid "invalid expression as operand"
msgstr ""
+#. @@@ better error message
+#: config/i386/i386.c:8457 config/i386/i386.c:8490 config/i386/i386.c:8627
+msgid "selector must be an immediate"
+msgstr ""
+
+#. @@@ better error message
+#: config/i386/i386.c:8658 config/i386/i386.c:8686
+msgid "mask must be an immediate"
+msgstr ""
+
#: config/i386/i386.h:45 config/mips/mips.h:176
msgid "half-pic init called on systems that don't support it."
msgstr ""
-#: config/i386/i386.h:232
+#: config/i386/i386.h:238
msgid "Same as -mcpu=i386"
msgstr ""
-#: config/i386/i386.h:233
+#: config/i386/i386.h:239
msgid "Same as -mcpu=i486"
msgstr ""
-#: config/i386/i386.h:234
+#: config/i386/i386.h:240
msgid "Same as -mcpu=pentium"
msgstr ""
-#: config/i386/i386.h:235
+#: config/i386/i386.h:241
msgid "Same as -mcpu=pentiumpro"
msgstr ""
-#: config/i386/i386.h:241
+#: config/i386/i386.h:243
+msgid "Alternate calling convention"
+msgstr ""
+
+#: config/i386/i386.h:245 config/ns32k/ns32k.h:106
+msgid "Use normal calling convention"
+msgstr ""
+
+#: config/i386/i386.h:247
msgid "Align some doubles on dword boundary"
msgstr ""
-#: config/i386/i386.h:243
+#: config/i386/i386.h:249
msgid "Align doubles on word boundary"
msgstr ""
-#: config/i386/i386.h:245
+#: config/i386/i386.h:251
msgid "Uninitialized locals in .bss"
msgstr ""
-#: config/i386/i386.h:247
+#: config/i386/i386.h:253
msgid "Uninitialized locals in .data"
msgstr ""
-#: config/i386/i386.h:249
+#: config/i386/i386.h:255
msgid "Use IEEE math for fp comparisons"
msgstr ""
-#: config/i386/i386.h:251
+#: config/i386/i386.h:257
msgid "Do not use IEEE math for fp comparisons"
msgstr ""
-#: config/i386/i386.h:253
+#: config/i386/i386.h:259
msgid "Return values of functions in FPU registers"
msgstr ""
-#: config/i386/i386.h:255
+#: config/i386/i386.h:261
msgid "Do not return values of functions in FPU registers"
msgstr ""
-#: config/i386/i386.h:257
+#: config/i386/i386.h:263
msgid "Do not generate sin, cos, sqrt for FPU"
msgstr ""
-#: config/i386/i386.h:259
+#: config/i386/i386.h:265
msgid "Generate sin, cos, sqrt for FPU"
msgstr ""
-#: config/i386/i386.h:261
+#: config/i386/i386.h:267
msgid "Omit the frame pointer in leaf functions"
msgstr ""
@@ -4202,54 +4923,46 @@ msgstr ""
#. undocumented
#. undocumented
#. undocumented
-#: config/i386/i386.h:268
+#: config/i386/i386.h:274
msgid "Enable stack probing"
msgstr ""
#. undocumented
#. undocumented
-#: config/i386/i386.h:273
+#: config/i386/i386.h:279
msgid "Emit Intel syntax assembler opcodes"
msgstr ""
-#: config/i386/i386.h:276
+#: config/i386/i386.h:282
msgid "Align destination of the string operations"
msgstr ""
-#: config/i386/i386.h:278
+#: config/i386/i386.h:284
msgid "Do not align destination of the string operations"
msgstr ""
-#: config/i386/i386.h:280
+#: config/i386/i386.h:286
msgid "Inline all known string operations"
msgstr ""
-#: config/i386/i386.h:282
+#: config/i386/i386.h:288
msgid "Do not inline all known string operations"
msgstr ""
-#: config/i386/i386.h:284 config/i386/i386.h:288
+#: config/i386/i386.h:290 config/i386/i386.h:294
msgid "Use push instructions to save outgoing arguments"
msgstr ""
-#: config/i386/i386.h:286 config/i386/i386.h:290
+#: config/i386/i386.h:292 config/i386/i386.h:296
msgid "Do not use push instructions to save outgoing arguments"
msgstr ""
-#: config/i386/i386.h:291
-msgid "Support MMX builtins"
+#: config/i386/i386.h:298
+msgid "sizeof(long double) is 16."
msgstr ""
-#: config/i386/i386.h:293
-msgid "Do not support MMX builtins"
-msgstr ""
-
-#: config/i386/i386.h:295
-msgid "Support MMX and SSE builtins"
-msgstr ""
-
-#: config/i386/i386.h:297
-msgid "Do not support MMX and SSE builtins"
+#: config/i386/i386.h:300
+msgid "sizeof(long double) is 12."
msgstr ""
#. This macro is similar to `TARGET_SWITCHES' but defines names of
@@ -4261,43 +4974,43 @@ msgstr ""
#. 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.
-#: config/i386/i386.h:330 config/rs6000/rs6000.h:405 config/sparc/sparc.h:711
+#: config/i386/i386.h:333 config/rs6000/rs6000.h:402 config/sparc/sparc.h:710
msgid "Schedule code for given CPU"
msgstr ""
-#: config/i386/i386.h:332
+#: config/i386/i386.h:335
msgid "Generate code for given CPU"
msgstr ""
-#: config/i386/i386.h:334
+#: config/i386/i386.h:337
msgid "Control allocation order of integer registers"
msgstr ""
-#: config/i386/i386.h:336
+#: config/i386/i386.h:339
msgid "Number of registers used to pass integer arguments"
msgstr ""
-#: config/i386/i386.h:338
+#: config/i386/i386.h:341
msgid "Loop code aligned to this power of 2"
msgstr ""
-#: config/i386/i386.h:340
+#: config/i386/i386.h:343
msgid "Jump targets are aligned to this power of 2"
msgstr ""
-#: config/i386/i386.h:342
+#: config/i386/i386.h:345
msgid "Function starts are aligned to this power of 2"
msgstr ""
-#: config/i386/i386.h:345
+#: config/i386/i386.h:348
msgid "Attempt to keep stack aligned to this power of 2"
msgstr ""
-#: config/i386/i386.h:347
+#: config/i386/i386.h:350
msgid "Branches are this expensive (1-5, arbitrary units)"
msgstr ""
-#: config/i386/osf1elf.h:126
+#: config/i386/osf1elf.h:111
msgid "Profiling uses mcount"
msgstr ""
@@ -4331,32 +5044,25 @@ msgstr ""
msgid "Use mcount_ptr for profiling"
msgstr ""
-#: config/i386/sco5.h:503 config/rs6000/sysv4.h:997
-#, c-format
-msgid "%s causes a section type conflict"
-msgstr ""
-
-#: config/i386/sco5.h:898
-msgid "Generate COFF output"
+#: config/i386/sco5.h:887
+msgid "Generate ELF output"
msgstr ""
-#: config/i386/sco5.h:899
-msgid "Generate ELF output"
+#: config/i386/win32.h:53
+msgid "Use Mingw32 interface"
msgstr ""
-#: config/i386/winnt.c:300
-#, c-format
-msgid "`%s' declared as both exported to and imported from a DLL."
+#: config/i386/win32.h:55
+msgid "Use Cygwin interface"
msgstr ""
-#: config/i386/winnt.c:328
-#, c-format
-msgid "initialized variable `%s' is marked dllimport"
+#: config/i386/win32.h:57
+msgid "Use bare Windows interface"
msgstr ""
-#: config/i386/winnt.c:337
+#: config/i386/winnt.c:311
#, c-format
-msgid "static variable `%s' is marked dllimport"
+msgid "`%s' declared as both exported to and imported from a DLL."
msgstr ""
#. If the environment variable DJDIR is not defined, then DJGPP is not installed correctly and GCC will quickly become confused with the default prefix settings. Report the problem now so the user doesn't receive deceptive "file not found" error messages later.
@@ -4389,19 +5095,19 @@ msgstr ""
msgid "Do not generate code which uses the FPU"
msgstr ""
-#: config/i960/i960.c:124
+#: config/i960/i960.c:122
msgid "sorry, not implemented: #pragma align NAME=SIZE"
msgstr ""
-#: config/i960/i960.c:129
+#: config/i960/i960.c:127
msgid "malformed #pragma align - ignored"
msgstr ""
-#: config/i960/i960.c:167
+#: config/i960/i960.c:165
msgid "sorry, not implemented: #pragma noalign NAME"
msgstr ""
-#: config/i960/i960.c:1515 config/m68k/m68k.c:406 config/rs6000/rs6000.c:5410
+#: config/i960/i960.c:1513 config/m68k/m68k.c:407 config/rs6000/rs6000.c:5520
msgid "stack limit expression is not supported"
msgstr ""
@@ -4520,8 +5226,8 @@ msgstr ""
msgid "Do not layout types like Intel's v1.3 gcc"
msgstr ""
-#: config/i960/i960.h:324 config/rs6000/sysv4.h:132 config/sparc/linux.h:92
-#: config/sparc/linux64.h:148
+#: config/i960/i960.h:324 config/rs6000/sysv4.h:128 config/sparc/linux.h:83
+#: config/sparc/linux64.h:139
msgid "Use 64 bit long doubles"
msgstr ""
@@ -4553,6 +5259,111 @@ msgstr ""
msgid "The -mlong-double-64 option does not work yet."
msgstr ""
+#: config/ia64/ia64.c:3413
+msgid "ia64_print_operand: unknown code"
+msgstr ""
+
+#: config/ia64/ia64.c:3651
+msgid "value of -mfixed-range must have form REG1-REG2"
+msgstr ""
+
+#: config/ia64/ia64.c:3663 config/ia64/ia64.c:3670 regclass.c:714
+#, c-format
+msgid "unknown register name: %s"
+msgstr ""
+
+#: config/ia64/ia64.c:3678
+#, c-format
+msgid "%s-%s is an empty range"
+msgstr ""
+
+#: config/ia64/ia64.c:3743
+msgid "cannot optimize division for both latency and throughput"
+msgstr ""
+
+#. 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.
+#: config/ia64/ia64.h:110
+msgid "Generate big endian code"
+msgstr ""
+
+#: config/ia64/ia64.h:112 config/mcore/mcore.h:164
+msgid "Generate little endian code"
+msgstr ""
+
+#: config/ia64/ia64.h:114
+msgid "Generate code for GNU as"
+msgstr ""
+
+#: config/ia64/ia64.h:116
+msgid "Generate code for Intel as"
+msgstr ""
+
+#: config/ia64/ia64.h:118
+msgid "Generate code for GNU ld"
+msgstr ""
+
+#: config/ia64/ia64.h:120
+msgid "Generate code for Intel ld"
+msgstr ""
+
+#: config/ia64/ia64.h:122
+msgid "Generate code without GP reg"
+msgstr ""
+
+#: config/ia64/ia64.h:124
+msgid "Emit stop bits before and after volatile extended asms"
+msgstr ""
+
+#: config/ia64/ia64.h:126
+msgid "Don't emit stop bits before and after volatile extended asms"
+msgstr ""
+
+#: config/ia64/ia64.h:128
+msgid "Emit code for Itanium (TM) processor B step"
+msgstr ""
+
+#: config/ia64/ia64.h:130
+msgid "Use in/loc/out register names"
+msgstr ""
+
+#: config/ia64/ia64.h:132
+msgid "Disable use of sdata/scommon/sbss"
+msgstr ""
+
+#: config/ia64/ia64.h:134
+msgid "Enable use of sdata/scommon/sbss"
+msgstr ""
+
+#: config/ia64/ia64.h:136
+msgid "gp is constant (but save/restore gp on indirect calls)"
+msgstr ""
+
+#: config/ia64/ia64.h:138
+msgid "Generate self-relocatable code"
+msgstr ""
+
+#: config/ia64/ia64.h:140
+msgid "Generate inline division, optimize for latency"
+msgstr ""
+
+#: config/ia64/ia64.h:142
+msgid "Generate inline division, optimize for throughput"
+msgstr ""
+
+#: config/ia64/ia64.h:144
+msgid "Enable Dwarf 2 line debug info via GNU as"
+msgstr ""
+
+#: config/ia64/ia64.h:146
+msgid "Disable Dwarf 2 line debug info via GNU as"
+msgstr ""
+
+#: config/ia64/ia64.h:169
+msgid "Specify range of registers to make fixed."
+msgstr ""
+
#: config/lynx-ng.h:97 config/lynx.h:120 config/rs6000/lynx.h:88
msgid "-msystem-v and -p are incompatible"
msgstr ""
@@ -4561,74 +5372,124 @@ msgstr ""
msgid "-msystem-v and -mthreads are incompatible"
msgstr ""
-#: config/m32r/m32r.c:84
+#: config/m32r/m32r.c:83
#, c-format
msgid "bad value (%s) for -mmodel switch"
msgstr ""
-#: config/m32r/m32r.c:93
+#: config/m32r/m32r.c:92
#, c-format
msgid "bad value (%s) for -msdata switch"
msgstr ""
-#: config/m32r/m32r.c:381
+#: config/m32r/m32r.c:380
msgid "const objects cannot go in .sdata/.sbss"
msgstr ""
-#: config/m32r/m32r.c:2188
+#: config/m32r/m32r.c:2187
#, c-format
msgid "invalid operand to %s code"
msgstr ""
-#: config/m32r/m32r.c:2195
+#: config/m32r/m32r.c:2194
#, c-format
msgid "invalid operand to %p code"
msgstr ""
-#: config/m32r/m32r.c:2303
+#: config/m32r/m32r.c:2302
msgid "invalid operand to %T/%B code"
msgstr ""
-#: config/m32r/m32r.c:2326
+#: config/m32r/m32r.c:2325
msgid "invalid operand to %N code"
msgstr ""
#. { "relax", TARGET_RELAX_MASK, "" }, { "no-relax", -TARGET_RELAX_MASK, "" },
-#: config/m32r/m32r.h:185
+#: config/m32r/m32r.h:186
msgid "Display compile time statistics"
msgstr ""
-#: config/m32r/m32r.h:187
+#: config/m32r/m32r.h:188
msgid "Align all loops to 32 byte boundary"
msgstr ""
-#: config/m32r/m32r.h:190
+#: config/m32r/m32r.h:191
msgid "Only issue one instruction per cycle"
msgstr ""
-#: config/m32r/m32r.h:193
+#: config/m32r/m32r.h:194
msgid "Prefer branches over conditional execution"
msgstr ""
-#: config/m32r/m32r.h:209
+#: config/m32r/m32r.h:210
msgid "Code size: small, medium or large"
msgstr ""
-#: config/m32r/m32r.h:211
+#: config/m32r/m32r.h:212
msgid "Small data area: none, sdata, use"
msgstr ""
-#: config/m68k/m68k.c:101
+#: config/m68hc11/m68hc11.c:227
+#, c-format
+msgid "-f%s ignored for 68HC11/68HC12 (not supported)"
+msgstr ""
+
+#. Macro to define tables used to set the flags. This is a list in braces of
+#. pairs in braces, each pair being { "NAME", VALUE } where VALUE is the bits
+#. to set or minus the bits to clear. An empty string NAME is used to
+#. identify the default VALUE.
+#: config/m68hc11/m68hc11.h:179
+msgid "Compile with 16-bit integer mode"
+msgstr ""
+
+#: config/m68hc11/m68hc11.h:181
+msgid "Compile with 32-bit integer mode"
+msgstr ""
+
+#: config/m68hc11/m68hc11.h:183
+msgid "Auto pre/post decrement increment allowed"
+msgstr ""
+
+#: config/m68hc11/m68hc11.h:185
+msgid "Auto pre/post decrement increment not allowed"
+msgstr ""
+
+#: config/m68hc11/m68hc11.h:187 config/m68hc11/m68hc11.h:191
+msgid "Compile for a 68HC11"
+msgstr ""
+
+#: config/m68hc11/m68hc11.h:189 config/m68hc11/m68hc11.h:193
+msgid "Compile for a 68HC12"
+msgstr ""
+
+#. 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.
+#: config/m68hc11/m68hc11.h:207
+msgid "Specify the register allocation order"
+msgstr ""
+
+#: config/m68hc11/m68hc11.h:209
+msgid "Indicate the number of soft registers available"
+msgstr ""
+
+#: config/m68k/m68k.c:102
#, c-format
msgid "-malign-loops=%d is not between 1 and %d"
msgstr ""
-#: config/m68k/m68k.c:112
+#: config/m68k/m68k.c:113
#, c-format
msgid "-malign-jumps=%d is not between 1 and %d"
msgstr ""
-#: config/m68k/m68k.c:123
+#: config/m68k/m68k.c:124
#, c-format
msgid "-malign-functions=%d is not between 1 and %d"
msgstr ""
@@ -4641,103 +5502,103 @@ msgstr ""
#.
#. Don't use this macro to turn on various extra optimizations for
#. `-O'. That is what `OPTIMIZATION_OPTIONS' is for.
-#: config/m68k/m68k.h:237 config/m68k/m68kv4.h:312
+#: config/m68k/m68k.h:238 config/m68k/m68kelf.h:265 config/m68k/m68kv4.h:295
msgid "-fPIC is not currently supported on the 68000 or 68010\n"
msgstr ""
-#: config/m88k/m88k.c:861
+#: config/m88k/m88k.c:860
#, c-format
msgid "Internal gcc monitor: short-branch(%x)"
msgstr ""
-#: config/m88k/m88k.c:2268
+#: config/m88k/m88k.c:2266
msgid "Internal gcc error: Can't express symbolic location"
msgstr ""
-#: config/m88k/m88k.c:2549
+#: config/m88k/m88k.c:2547
#, c-format
msgid "argument #%d is a structure"
msgstr ""
-#: config/m88k/m88k.c:2864
+#: config/m88k/m88k.c:2862
msgid "%R not followed by %B/C/D/E"
msgstr ""
-#: config/m88k/m88k.c:2932
+#: config/m88k/m88k.c:2930
#, c-format
msgid "invalid %x/X value"
msgstr ""
-#: config/m88k/m88k.c:2937
+#: config/m88k/m88k.c:2935
msgid "invalid %H value"
msgstr ""
-#: config/m88k/m88k.c:2943
+#: config/m88k/m88k.c:2941
msgid "invalid %h value"
msgstr ""
-#: config/m88k/m88k.c:2949
+#: config/m88k/m88k.c:2947
msgid "invalid %Q value"
msgstr ""
-#: config/m88k/m88k.c:2955
+#: config/m88k/m88k.c:2953
msgid "invalid %q value"
msgstr ""
-#: config/m88k/m88k.c:2961
+#: config/m88k/m88k.c:2959
#, c-format
msgid "invalid %o value"
msgstr ""
-#: config/m88k/m88k.c:2968
+#: config/m88k/m88k.c:2966
#, c-format
msgid "invalid %p value"
msgstr ""
-#: config/m88k/m88k.c:2981 config/m88k/m88k.c:2986
+#: config/m88k/m88k.c:2979 config/m88k/m88k.c:2984
#, c-format
msgid "invalid %s/S value"
msgstr ""
-#: config/m88k/m88k.c:2997
+#: config/m88k/m88k.c:2995
msgid "invalid %P operand"
msgstr ""
-#: config/m88k/m88k.c:3028
+#: config/m88k/m88k.c:3026
msgid "invalid %B value"
msgstr ""
-#: config/m88k/m88k.c:3045
+#: config/m88k/m88k.c:3043
msgid "invalid %C value"
msgstr ""
-#: config/m88k/m88k.c:3058
+#: config/m88k/m88k.c:3056
msgid "invalid %D value"
msgstr ""
-#: config/m88k/m88k.c:3066
+#: config/m88k/m88k.c:3064
#, c-format
msgid "invalid %E value"
msgstr ""
-#: config/m88k/m88k.c:3071
+#: config/m88k/m88k.c:3069
#, c-format
msgid "`%d' operand isn't a register"
msgstr ""
-#: config/m88k/m88k.c:3082
+#: config/m88k/m88k.c:3080
msgid "invalid %r value"
msgstr ""
-#: config/m88k/m88k.c:3089
+#: config/m88k/m88k.c:3087
msgid "operand is r0"
msgstr ""
-#: config/m88k/m88k.c:3103
+#: config/m88k/m88k.c:3101
msgid "operand is const_double"
msgstr ""
-#: config/m88k/m88k.c:3122
+#: config/m88k/m88k.c:3120
msgid "invalid code"
msgstr ""
@@ -4761,125 +5622,209 @@ msgstr ""
msgid "-mshort-data-%s and PIC are incompatible"
msgstr ""
-#: config/mips/mips.c:4667
+#: config/mcore/mcore.c:3118
+#, c-format
+msgid "Invalid option `-mstack-increment=%s'"
+msgstr ""
+
+#: config/mcore/mcore.h:131
+msgid "Inline constants if it can be done in 2 insns or less"
+msgstr ""
+
+#: config/mcore/mcore.h:133
+msgid "inline constants if it only takes 1 instruction"
+msgstr ""
+
+#: config/mcore/mcore.h:135
+msgid "Set maximum alignment to 4"
+msgstr ""
+
+#: config/mcore/mcore.h:137
+msgid "Set maximum alignment to 8"
+msgstr ""
+
+#: config/mcore/mcore.h:141
+msgid "Do not use the divide instruction"
+msgstr ""
+
+#: config/mcore/mcore.h:145
+msgid "Do not arbitary sized immediates in bit operations"
+msgstr ""
+
+#: config/mcore/mcore.h:147
+msgid "Always treat bitfield as int-sized"
+msgstr ""
+
+#: config/mcore/mcore.h:151
+msgid "Force functions to be aligned to a 4 byte boundary"
+msgstr ""
+
+#: config/mcore/mcore.h:153
+msgid "Force functions to be aligned to a 2 byte boundary"
+msgstr ""
+
+#: config/mcore/mcore.h:155
+msgid "Emit call graph information"
+msgstr ""
+
+#: config/mcore/mcore.h:159
+msgid "Prefer word accesses over byte accesses"
+msgstr ""
+
+#: config/mcore/mcore.h:170
+msgid "Generate code for the M*Core M340"
+msgstr ""
+
+#: config/mcore/mcore.h:183
+msgid "Maximum amount for a single stack increment operation"
+msgstr ""
+
+#: config/mips/mips.c:4737
#, c-format
msgid "-mips%d not supported"
msgstr ""
-#: config/mips/mips.c:4674
+#: config/mips/mips.c:4744
#, c-format
msgid "bad value (%s) for -mips switch"
msgstr ""
-#: config/mips/mips.c:4693
+#: config/mips/mips.c:4763
#, c-format
msgid "bad value (%s) for -mabi= switch"
msgstr ""
-#: config/mips/mips.c:4723
+#: config/mips/mips.c:4793
#, c-format
msgid "-mabi=%s does not support -mips%d"
msgstr ""
-#: config/mips/mips.c:4740
+#: config/mips/mips.c:4810
msgid "The -mabi=32 support does not work yet."
msgstr ""
-#: config/mips/mips.c:4744
+#: config/mips/mips.c:4814
msgid "This target does not support the -mabi switch."
msgstr ""
-#: config/mips/mips.c:4878
+#: config/mips/mips.c:4948
#, c-format
msgid "-mcpu=%s does not support -mips%d"
msgstr ""
-#: config/mips/mips.c:4884
+#: config/mips/mips.c:4955
#, c-format
msgid "-mips%d does not support 64 bit fp registers"
msgstr ""
-#: config/mips/mips.c:4887
+#: config/mips/mips.c:4961
#, c-format
msgid "-mips%d does not support 64 bit gp registers"
msgstr ""
-#: config/mips/mips.c:4906
+#: config/mips/mips.c:4982
msgid "-G is incompatible with PIC code which is the default"
msgstr ""
-#: config/mips/mips.c:4922
+#: config/mips/mips.c:4998
msgid "-membedded-pic and -mabicalls are incompatible"
msgstr ""
-#: config/mips/mips.c:4925
+#: config/mips/mips.c:5001
msgid "-G and -membedded-pic are incompatible"
msgstr ""
-#: config/mips/mips.c:4977
+#: config/mips/mips.c:5052
#, c-format
msgid "Invalid option `entry%s'"
msgstr ""
-#: config/mips/mips.c:4980
+#: config/mips/mips.c:5055
msgid "-mentry is only meaningful with -mips-16"
msgstr ""
-#: config/mips/mips.c:5313
-#, ycp-format
+#: config/mips/mips.c:5388
+#, c-format
msgid "internal error: %%) found without a %%( in assembler pattern"
msgstr ""
-#: config/mips/mips.c:5327
-#, ycp-format
+#: config/mips/mips.c:5402
+#, c-format
msgid "internal error: %%] found without a %%[ in assembler pattern"
msgstr ""
-#: config/mips/mips.c:5340
-#, ycp-format
+#: config/mips/mips.c:5415
+#, c-format
msgid "internal error: %%> found without a %%< in assembler pattern"
msgstr ""
-#: config/mips/mips.c:5353
-#, ycp-format
+#: config/mips/mips.c:5428
+#, c-format
msgid "internal error: %%} found without a %%{ in assembler pattern"
msgstr ""
-#: config/mips/mips.c:5367
+#: config/mips/mips.c:5442
#, c-format
msgid "PRINT_OPERAND: Unknown punctuation '%c'"
msgstr ""
-#: config/mips/mips.c:5376
+#: config/mips/mips.c:5451
msgid "PRINT_OPERAND null pointer"
msgstr ""
-#: config/mips/mips.c:5504
+#: config/mips/mips.c:5579
#, c-format
-msgid "PRINT_OPERAND: letter %c was found & insn was not CONST_INT"
+msgid "invalid use of %%d, %%x, or %%X"
msgstr ""
-#: config/mips/mips.c:5548
+#: config/mips/mips.c:5622
msgid "PRINT_OPERAND_ADDRESS, null pointer"
msgstr ""
-#: config/mips/mips.c:5803
+#: config/mips/mips.c:5826 f/com.c:14611 graph.c:421 java/jcf-parse.c:929
+#: java/jcf-parse.c:1065 java/lex.c:1726 objc/objc-act.c:733 profile.c:906
+#: profile.c:914 toplev.c:1875 toplev.c:2234
+#, c-format
+msgid "can't open %s"
+msgstr ""
+
+#: config/mips/mips.c:5877
msgid ""
"MIPS ECOFF format does not allow changing filenames within functions with "
"#line"
msgstr ""
-#: config/mips/mips.c:6366
+#: config/mips/mips.c:6076
+#, c-format
+msgid "can't rewind %s"
+msgstr ""
+
+#: config/mips/mips.c:6080
+#, c-format
+msgid "can't write to %s"
+msgstr ""
+
+#: config/mips/mips.c:6083
+#, c-format
+msgid "can't read from %s"
+msgstr ""
+
+#: config/mips/mips.c:6086 java/jcf-parse.c:605 java/jcf-write.c:3341
+#, c-format
+msgid "can't close %s"
+msgstr ""
+
+#: config/mips/mips.c:6455
#, c-format
msgid "gp_offset (%ld) or end_offset (%ld) is less than zero."
msgstr ""
-#: config/mips/mips.c:6583
+#: config/mips/mips.c:6673
#, c-format
msgid "fp_offset (%ld) or end_offset (%ld) is less than zero."
msgstr ""
-#: config/mips/mips.c:8631
+#: config/mips/mips.c:8744
#, c-format
msgid "can not handle inconsistent calls to `%s'"
msgstr ""
@@ -4889,7 +5834,7 @@ msgstr ""
#. each pair being { "NAME", VALUE }
#. where VALUE is the bits to set or minus the bits to clear.
#. An empty string NAME is used to identify the default VALUE.
-#: config/mips/mips.h:335 config/mn10300/mn10300.h:62
+#: config/mips/mips.h:335 config/mn10300/mn10300.h:64
msgid "No default crt0.o"
msgstr ""
@@ -4967,7 +5912,7 @@ msgstr ""
#. where VALUE is the bits to set or minus the bits to clear and DOC
#. is the documentation for --help (NULL if intentionally undocumented).
#. An empty string NAME is used to identify the default VALUE.
-#: config/mips/mips.h:377 config/pdp11/pdp11.h:54
+#: config/mips/mips.h:377 config/pdp11/pdp11.h:55
msgid "Use hardware floating point"
msgstr ""
@@ -5107,37 +6052,37 @@ msgstr ""
#.
#. extern char *m88k_short_data;
#. #define TARGET_OPTIONS { { "short-data-", &m88k_short_data } }
-#: config/mips/mips.h:556
+#: config/mips/mips.h:562
msgid "Specify CPU for scheduling purposes"
msgstr ""
-#: config/mips/mips.h:558
+#: config/mips/mips.h:564
msgid "Specify MIPS ISA"
msgstr ""
-#: config/mips/mips.h:560
+#: config/mips/mips.h:566
msgid "Use mips16 entry/exit psuedo ops"
msgstr ""
-#: config/mips/mips.h:562
+#: config/mips/mips.h:568
msgid "Don't use MIPS16 instructions"
msgstr ""
#. Output assembler code to FILE to increment profiler label # LABELNO
#. for profiling a function entry.
-#: config/mips/mips.h:2579
+#: config/mips/mips.h:2592
msgid "mips16 function profiling"
msgstr ""
-#: config/mn10300/mn10300.h:57
+#: config/mn10300/mn10300.h:59
msgid "Work around hardware multiply bug"
msgstr ""
-#: config/mn10300/mn10300.h:58
+#: config/mn10300/mn10300.h:60
msgid "Do not work around hardware multiply bug"
msgstr ""
-#: config/mn10300/mn10300.h:59
+#: config/mn10300/mn10300.h:61
msgid "Target the AM33 processor"
msgstr ""
@@ -5189,6 +6134,14 @@ msgstr ""
msgid "Do not use register sb"
msgstr ""
+#: config/ns32k/ns32k.h:116
+msgid "Do not use bitfield instructions"
+msgstr ""
+
+#: config/ns32k/ns32k.h:117
+msgid "Use bitfield instructions"
+msgstr ""
+
#: config/ns32k/ns32k.h:118
msgid "Generate code for high memory"
msgstr ""
@@ -5217,84 +6170,84 @@ msgstr ""
msgid "No \"Small register classes\" kludge"
msgstr ""
-#: config/pa/pa.c:142
+#: config/pa/pa.c:135
#, c-format
msgid ""
"Unknown -mschedule= option (%s).\n"
"Valid options are 700, 7100, 7100LC, 7200, and 8000\n"
msgstr ""
-#: config/pa/pa.c:167
+#: config/pa/pa.c:160
#, c-format
msgid ""
"Unknown -march= option (%s).\n"
"Valid options are 1.0, 1.1, and 2.0\n"
msgstr ""
-#: config/pa/pa.c:172
+#: config/pa/pa.c:165
msgid "PIC code generation is not supported in the portable runtime model\n"
msgstr ""
-#: config/pa/pa.c:177
+#: config/pa/pa.c:170
msgid "PIC code generation is not compatible with fast indirect calls\n"
msgstr ""
-#: config/pa/pa.c:182
+#: config/pa/pa.c:175
msgid "PIC code generation is not compatible with profiling\n"
msgstr ""
-#: config/pa/pa.c:187
+#: config/pa/pa.c:180
msgid "-g is only supported when using GAS on this processor,"
msgstr ""
-#: config/pa/pa.c:188
+#: config/pa/pa.c:181
msgid "-g option disabled."
msgstr ""
-#: config/pdp11/pdp11.h:55
+#: config/pdp11/pdp11.h:56
msgid "Do not use hardware floating point"
msgstr ""
#. return float result in ac0
-#: config/pdp11/pdp11.h:57
+#: config/pdp11/pdp11.h:58
msgid "Return floating point results in ac0"
msgstr ""
-#: config/pdp11/pdp11.h:58
+#: config/pdp11/pdp11.h:59
msgid "Return floating point results in memory"
msgstr ""
#. is 11/40
-#: config/pdp11/pdp11.h:60
+#: config/pdp11/pdp11.h:61
msgid "Generate code for an 11/40"
msgstr ""
#. is 11/45
-#: config/pdp11/pdp11.h:63
+#: config/pdp11/pdp11.h:64
msgid "Generate code for an 11/45"
msgstr ""
#. is 11/10
-#: config/pdp11/pdp11.h:66
+#: config/pdp11/pdp11.h:67
msgid "Generate code for an 11/10"
msgstr ""
#. use movstrhi for bcopy
#. use 32 bit for int
-#: config/pdp11/pdp11.h:71 config/pdp11/pdp11.h:72
+#: config/pdp11/pdp11.h:72 config/pdp11/pdp11.h:73
msgid "Use 32 bit int"
msgstr ""
-#: config/pdp11/pdp11.h:73 config/pdp11/pdp11.h:74
+#: config/pdp11/pdp11.h:74 config/pdp11/pdp11.h:75
msgid "Use 16 bit int"
msgstr ""
#. use 32 bit for float
-#: config/pdp11/pdp11.h:76 config/pdp11/pdp11.h:77
+#: config/pdp11/pdp11.h:77 config/pdp11/pdp11.h:78
msgid "Use 32 bit float"
msgstr ""
-#: config/pdp11/pdp11.h:78 config/pdp11/pdp11.h:79
+#: config/pdp11/pdp11.h:79 config/pdp11/pdp11.h:80
msgid "Use 64 bit float"
msgstr ""
@@ -5302,61 +6255,85 @@ msgstr ""
#. is branching expensive - on a PDP, it's actually really cheap
#. this is just to play around and check what code gcc generates
#. split instruction and data memory?
-#: config/pdp11/pdp11.h:88
+#: config/pdp11/pdp11.h:89
msgid "Target has split I&D"
msgstr ""
-#: config/pdp11/pdp11.h:89
+#: config/pdp11/pdp11.h:90
msgid "Target does not have split I&D"
msgstr ""
#. UNIX assembler syntax?
-#: config/pdp11/pdp11.h:91
+#: config/pdp11/pdp11.h:92
msgid "Use UNIX assembler syntax"
msgstr ""
-#: config/pdp11/pdp11.h:92
+#: config/pdp11/pdp11.h:93
msgid "Use DEC assembler syntax"
msgstr ""
-#: config/romp/romp.c:675
-#, ycp-format
+#: config/pj/pj.h:73
+msgid "Generate little endian data"
+msgstr ""
+
+#: config/pj/pj.h:75
+msgid "Generate big endian data"
+msgstr ""
+
+#: config/pj/pj.h:77
+msgid "Turn on maintainer testing code"
+msgstr ""
+
+#: config/pj/pj.h:79
+msgid "Enable Transmeta picoJava extensions"
+msgstr ""
+
+#: config/pj/pj.h:81
+msgid "Disable Transmeta picoJava extensions"
+msgstr ""
+
+#: config/pj/pj.h:83
+msgid "Disable reorganization pass"
+msgstr ""
+
+#: config/romp/romp.c:674
+#, c-format
msgid "invalid %%B value"
msgstr ""
-#: config/romp/romp.c:702 config/rs6000/rs6000.c:4077
-#, ycp-format
+#: config/romp/romp.c:701 config/rs6000/rs6000.c:4106
+#, c-format
msgid "invalid %%S value"
msgstr ""
-#: config/romp/romp.c:711 config/romp/romp.c:718
-#, ycp-format
+#: config/romp/romp.c:710 config/romp/romp.c:717
+#, c-format
msgid "invalid %%b value"
msgstr ""
-#: config/romp/romp.c:739 config/romp/romp.c:746
-#, ycp-format
+#: config/romp/romp.c:738 config/romp/romp.c:745
+#, c-format
msgid "invalid %%H value"
msgstr ""
-#: config/romp/romp.c:758 config/romp/romp.c:769
-#, ycp-format
+#: config/romp/romp.c:757 config/romp/romp.c:768
+#, c-format
msgid "invalid %%z value"
msgstr ""
-#: config/romp/romp.c:777 config/romp/romp.c:785
-#, ycp-format
+#: config/romp/romp.c:776 config/romp/romp.c:784
+#, c-format
msgid "invalid %%Z value"
msgstr ""
-#: config/romp/romp.c:792 config/romp/romp.c:801 config/romp/romp.c:808
-#: config/rs6000/rs6000.c:3859
-#, ycp-format
+#: config/romp/romp.c:791 config/romp/romp.c:800 config/romp/romp.c:807
+#: config/rs6000/rs6000.c:3888
+#, c-format
msgid "invalid %%k value"
msgstr ""
-#: config/romp/romp.c:893 config/romp/romp.c:936
-#, ycp-format
+#: config/romp/romp.c:892 config/romp/romp.c:935
+#, c-format
msgid "invalid %%j value"
msgstr ""
@@ -5373,137 +6350,137 @@ msgstr ""
#.
#. Normally, this macro will push all remaining incoming registers on the
#. stack and set PRETEND_SIZE to the length of the registers pushed.
-#: config/romp/romp.h:660
+#: config/romp/romp.h:661
msgid "can't have varargs with -mfp-arg-in-fp-regs"
msgstr ""
-#: config/rs6000/aix.h:254 config/rs6000/beos.h:33
+#: config/rs6000/aix.h:303 config/rs6000/beos.h:30
msgid "Always pass floating-point arguments in memory"
msgstr ""
-#: config/rs6000/aix.h:256 config/rs6000/beos.h:35
+#: config/rs6000/aix.h:305 config/rs6000/beos.h:32
msgid "Don't always pass floating-point arguments in memory"
msgstr ""
-#: config/rs6000/aix41.h:31 config/rs6000/aix43.h:35
+#: config/rs6000/aix41.h:28 config/rs6000/aix43.h:32 config/rs6000/aix51.h:32
msgid "Support message passing with the Parallel Environment"
msgstr ""
-#: config/rs6000/aix43.h:31
+#: config/rs6000/aix43.h:28 config/rs6000/aix51.h:28
msgid "Compile for 64-bit pointers"
msgstr ""
-#: config/rs6000/aix43.h:33
+#: config/rs6000/aix43.h:30 config/rs6000/aix51.h:30
msgid "Compile for 32-bit pointers"
msgstr ""
-#: config/rs6000/aix43.h:52
+#: config/rs6000/aix43.h:49 config/rs6000/aix51.h:49
msgid "-maix64 and POWER architecture are incompatible."
msgstr ""
-#: config/rs6000/aix43.h:57
+#: config/rs6000/aix43.h:54 config/rs6000/aix51.h:54
msgid "-maix64 requires PowerPC64 architecture remain enabled."
msgstr ""
-#: config/rs6000/aix43.h:61
+#: config/rs6000/aix43.h:58 config/rs6000/aix51.h:58
msgid ""
"-maix64 required: 64-bit computation with 32-bit addressing not yet "
"supported."
msgstr ""
-#: config/rs6000/rs6000.c:340
+#: config/rs6000/rs6000.c:341
msgid "-mmultiple is not supported on little endian systems"
msgstr ""
-#: config/rs6000/rs6000.c:347
+#: config/rs6000/rs6000.c:348
msgid "-mstring is not supported on little endian systems"
msgstr ""
-#: config/rs6000/rs6000.c:353
+#: config/rs6000/rs6000.c:354
#, c-format
msgid "-f%s ignored for AIX (all code is position independent)"
msgstr ""
-#: config/rs6000/rs6000.c:361
+#: config/rs6000/rs6000.c:362
msgid "-ffunction-sections disabled on AIX when debugging"
msgstr ""
-#: config/rs6000/rs6000.c:367
+#: config/rs6000/rs6000.c:368
msgid "-fdata-sections not supported on AIX"
msgstr ""
-#: config/rs6000/rs6000.c:381
+#: config/rs6000/rs6000.c:382
#, c-format
msgid "Unknown -mdebug-%s switch"
msgstr ""
-#: config/rs6000/rs6000.c:3786
-#, ycp-format
+#: config/rs6000/rs6000.c:3815
+#, c-format
msgid "invalid %%f value"
msgstr ""
-#: config/rs6000/rs6000.c:3795
-#, ycp-format
+#: config/rs6000/rs6000.c:3824
+#, c-format
msgid "invalid %%F value"
msgstr ""
-#: config/rs6000/rs6000.c:3804
-#, ycp-format
+#: config/rs6000/rs6000.c:3833
+#, c-format
msgid "invalid %%G value"
msgstr ""
-#: config/rs6000/rs6000.c:3839
-#, ycp-format
+#: config/rs6000/rs6000.c:3868
+#, c-format
msgid "invalid %%j code"
msgstr ""
-#: config/rs6000/rs6000.c:3849
-#, ycp-format
+#: config/rs6000/rs6000.c:3878
+#, c-format
msgid "invalid %%J code"
msgstr ""
-#: config/rs6000/rs6000.c:3879
-#, ycp-format
+#: config/rs6000/rs6000.c:3908
+#, c-format
msgid "invalid %%K value"
msgstr ""
-#: config/rs6000/rs6000.c:4003
-#, ycp-format
+#: config/rs6000/rs6000.c:4032
+#, c-format
msgid "invalid %%p value"
msgstr ""
-#: config/rs6000/rs6000.c:4040
-#, ycp-format
+#: config/rs6000/rs6000.c:4069
+#, c-format
msgid "invalid %%q value"
msgstr ""
-#: config/rs6000/rs6000.c:4103
-#, ycp-format
+#: config/rs6000/rs6000.c:4132
+#, c-format
msgid "%%S computed all 1's mask"
msgstr ""
-#: config/rs6000/rs6000.c:4130
-#, ycp-format
+#: config/rs6000/rs6000.c:4159
+#, c-format
msgid "%%S computed all 0's mask"
msgstr ""
-#: config/rs6000/rs6000.c:4140
-#, ycp-format
+#: config/rs6000/rs6000.c:4169
+#, c-format
msgid "invalid %%T value"
msgstr ""
-#: config/rs6000/rs6000.c:4150
-#, ycp-format
+#: config/rs6000/rs6000.c:4179
+#, c-format
msgid "invalid %%u value"
msgstr ""
-#: config/rs6000/rs6000.c:4159
-#, ycp-format
+#: config/rs6000/rs6000.c:4188
+#, c-format
msgid "invalid %%v value"
msgstr ""
-#: config/rs6000/rs6000.c:4232
-#, ycp-format
+#: config/rs6000/rs6000.c:4261
+#, c-format
msgid "invalid %%W value"
msgstr ""
@@ -5514,119 +6491,119 @@ msgstr ""
#. each pair being { "NAME", VALUE }
#. where VALUE is the bits to set or minus the bits to clear.
#. An empty string NAME is used to identify the default VALUE.
-#: config/rs6000/rs6000.h:256
+#: config/rs6000/rs6000.h:253
msgid "Use POWER instruction set"
msgstr ""
-#: config/rs6000/rs6000.h:259
+#: config/rs6000/rs6000.h:256
msgid "Use POWER2 instruction set"
msgstr ""
-#: config/rs6000/rs6000.h:261
+#: config/rs6000/rs6000.h:258
msgid "Do not use POWER2 instruction set"
msgstr ""
-#: config/rs6000/rs6000.h:264
+#: config/rs6000/rs6000.h:261
msgid "Do not use POWER instruction set"
msgstr ""
-#: config/rs6000/rs6000.h:266
+#: config/rs6000/rs6000.h:263
msgid "Use PowerPC instruction set"
msgstr ""
-#: config/rs6000/rs6000.h:269
+#: config/rs6000/rs6000.h:266
msgid "Do not use PowerPC instruction set"
msgstr ""
-#: config/rs6000/rs6000.h:271
+#: config/rs6000/rs6000.h:268
msgid "Use PowerPC General Purpose group optional instructions"
msgstr ""
-#: config/rs6000/rs6000.h:273
+#: config/rs6000/rs6000.h:270
msgid "Don't use PowerPC General Purpose group optional instructions"
msgstr ""
-#: config/rs6000/rs6000.h:275
+#: config/rs6000/rs6000.h:272
msgid "Use PowerPC Graphics group optional instructions"
msgstr ""
-#: config/rs6000/rs6000.h:277
+#: config/rs6000/rs6000.h:274
msgid "Don't use PowerPC Graphics group optional instructions"
msgstr ""
-#: config/rs6000/rs6000.h:279
+#: config/rs6000/rs6000.h:276
msgid "Use PowerPC-64 instruction set"
msgstr ""
-#: config/rs6000/rs6000.h:281
+#: config/rs6000/rs6000.h:278
msgid "Don't use PowerPC-64 instruction set"
msgstr ""
-#: config/rs6000/rs6000.h:283
+#: config/rs6000/rs6000.h:280
msgid "Use new mnemonics for PowerPC architecture"
msgstr ""
-#: config/rs6000/rs6000.h:285
+#: config/rs6000/rs6000.h:282
msgid "Use old mnemonics for PowerPC architecture"
msgstr ""
-#: config/rs6000/rs6000.h:288
+#: config/rs6000/rs6000.h:285
msgid "Put everything in the regular TOC"
msgstr ""
-#: config/rs6000/rs6000.h:290
+#: config/rs6000/rs6000.h:287
msgid "Place floating point constants in TOC"
msgstr ""
-#: config/rs6000/rs6000.h:292
+#: config/rs6000/rs6000.h:289
msgid "Don't place floating point constants in TOC"
msgstr ""
-#: config/rs6000/rs6000.h:294
+#: config/rs6000/rs6000.h:291
msgid "Place symbol+offset constants in TOC"
msgstr ""
-#: config/rs6000/rs6000.h:296
+#: config/rs6000/rs6000.h:293
msgid "Don't place symbol+offset constants in TOC"
msgstr ""
-#: config/rs6000/rs6000.h:302
+#: config/rs6000/rs6000.h:299
msgid "Place variable addresses in the regular TOC"
msgstr ""
-#: config/rs6000/rs6000.h:308
+#: config/rs6000/rs6000.h:305
msgid "Generate load/store multiple instructions"
msgstr ""
-#: config/rs6000/rs6000.h:310
+#: config/rs6000/rs6000.h:307
msgid "Do not generate load/store multiple instructions"
msgstr ""
-#: config/rs6000/rs6000.h:314
+#: config/rs6000/rs6000.h:311
msgid "Generate string instructions for block moves"
msgstr ""
-#: config/rs6000/rs6000.h:316
+#: config/rs6000/rs6000.h:313
msgid "Do not generate string instructions for block moves"
msgstr ""
-#: config/rs6000/rs6000.h:320
+#: config/rs6000/rs6000.h:317
msgid "Generate load/store with update instructions"
msgstr ""
-#: config/rs6000/rs6000.h:322
+#: config/rs6000/rs6000.h:319
msgid "Do not generate load/store with update instructions"
msgstr ""
-#: config/rs6000/rs6000.h:324
+#: config/rs6000/rs6000.h:321
msgid "Generate fused multiply/add instructions"
msgstr ""
-#: config/rs6000/rs6000.h:326
+#: config/rs6000/rs6000.h:323
msgid "Don't generate fused multiply/add instructions"
msgstr ""
-#: config/rs6000/rs6000.h:330
+#: config/rs6000/rs6000.h:327
msgid "Don't schedule the start and end of the procedure"
msgstr ""
@@ -5646,11 +6623,11 @@ msgstr ""
#.
#. extern char *m88k_short_data;
#. #define TARGET_OPTIONS { { "short-data-", &m88k_short_data } }
-#: config/rs6000/rs6000.h:403 config/sparc/sparc.h:709
+#: config/rs6000/rs6000.h:400 config/sparc/sparc.h:708
msgid "Use features of and schedule code for given CPU"
msgstr ""
-#: config/rs6000/rs6000.h:406
+#: config/rs6000/rs6000.h:403
msgid "Enable debug output"
msgstr ""
@@ -5666,97 +6643,97 @@ msgstr ""
#. Number of bytes into the frame return addresses can be found. See
#. rs6000_stack_info in rs6000.c for more information on how the different
#. abi's store the return address.
-#: config/rs6000/rs6000.h:1637
+#: config/rs6000/rs6000.h:1654
msgid "RETURN_ADDRESS_OFFSET not supported"
msgstr ""
-#: config/rs6000/sysv4.h:92
+#: config/rs6000/sysv4.h:88
msgid "Select ABI calling convention."
msgstr ""
-#: config/rs6000/sysv4.h:93
+#: config/rs6000/sysv4.h:89
msgid "Select method for sdata handling."
msgstr ""
-#: config/rs6000/sysv4.h:108
+#: config/rs6000/sysv4.h:104
msgid "Align to the base type of the bitfield."
msgstr ""
-#: config/rs6000/sysv4.h:110
+#: config/rs6000/sysv4.h:106
msgid "Don't align to the base type of the bitfield."
msgstr ""
-#: config/rs6000/sysv4.h:112
+#: config/rs6000/sysv4.h:108
msgid "Don't assume that unaligned accesses are handled by the system"
msgstr ""
-#: config/rs6000/sysv4.h:114
+#: config/rs6000/sysv4.h:110
msgid "Assume that unaligned accesses are handled by the system"
msgstr ""
-#: config/rs6000/sysv4.h:116 config/rs6000/sysv4.h:120
+#: config/rs6000/sysv4.h:112 config/rs6000/sysv4.h:116
msgid "Produce code relocatable at runtime."
msgstr ""
-#: config/rs6000/sysv4.h:118 config/rs6000/sysv4.h:122
+#: config/rs6000/sysv4.h:114 config/rs6000/sysv4.h:118
msgid "Don't produce code relocatable at runtime."
msgstr ""
-#: config/rs6000/sysv4.h:124 config/rs6000/sysv4.h:126
+#: config/rs6000/sysv4.h:120 config/rs6000/sysv4.h:122
msgid "Produce little endian code."
msgstr ""
-#: config/rs6000/sysv4.h:128 config/rs6000/sysv4.h:130
+#: config/rs6000/sysv4.h:124 config/rs6000/sysv4.h:126
msgid "Produce big endian code."
msgstr ""
-#: config/rs6000/sysv4.h:134 config/sparc/linux.h:93
-#: config/sparc/linux64.h:149
+#: config/rs6000/sysv4.h:130 config/sparc/linux.h:84
+#: config/sparc/linux64.h:140
msgid "Use 128 bit long doubles"
msgstr ""
+#: config/rs6000/sysv4.h:131 config/rs6000/sysv4.h:132
+#: config/rs6000/sysv4.h:133 config/rs6000/sysv4.h:134
#: config/rs6000/sysv4.h:135 config/rs6000/sysv4.h:136
-#: config/rs6000/sysv4.h:137 config/rs6000/sysv4.h:138
-#: config/rs6000/sysv4.h:139 config/rs6000/sysv4.h:140
-#: config/rs6000/sysv4.h:147 config/rs6000/sysv4.h:148
-#: config/rs6000/sysv4.h:159 config/rs6000/sysv4.h:160
-#: config/rs6000/sysv4.h:161 config/rs6000/sysv4.h:163
+#: config/rs6000/sysv4.h:143 config/rs6000/sysv4.h:144
+#: config/rs6000/sysv4.h:155 config/rs6000/sysv4.h:156
+#: config/rs6000/sysv4.h:157 config/rs6000/sysv4.h:159
msgid "no description yet"
msgstr ""
-#: config/rs6000/sysv4.h:141
+#: config/rs6000/sysv4.h:137
msgid "Use EABI."
msgstr ""
-#: config/rs6000/sysv4.h:142
+#: config/rs6000/sysv4.h:138
msgid "Don't use EABI."
msgstr ""
-#: config/rs6000/sysv4.h:144
+#: config/rs6000/sysv4.h:140
msgid "Use alternate register names."
msgstr ""
-#: config/rs6000/sysv4.h:146
+#: config/rs6000/sysv4.h:142
msgid "Don't use alternate register names."
msgstr ""
-#: config/rs6000/sysv4.h:150
+#: config/rs6000/sysv4.h:146
msgid "Link with libsim.a, libc.a and sim-crt0.o."
msgstr ""
-#: config/rs6000/sysv4.h:152
+#: config/rs6000/sysv4.h:148
msgid "Link with libads.a, libc.a and crt0.o."
msgstr ""
-#: config/rs6000/sysv4.h:154
+#: config/rs6000/sysv4.h:150
msgid "Link with libyk.a, libc.a and crt0.o."
msgstr ""
-#: config/rs6000/sysv4.h:156
+#: config/rs6000/sysv4.h:152
msgid "Link with libmvme.a, libc.a and crt0.o."
msgstr ""
-#: config/rs6000/sysv4.h:158
+#: config/rs6000/sysv4.h:154
msgid "Set the PPC_EMB bit in the ELF flags header"
msgstr ""
@@ -5768,46 +6745,46 @@ msgstr ""
#.
#. The macro SUBTARGET_OVERRIDE_OPTIONS is provided for subtargets, to
#. get control.
-#: config/rs6000/sysv4.h:209
+#: config/rs6000/sysv4.h:205
#, c-format
msgid "Bad value for -mcall-%s"
msgstr ""
-#: config/rs6000/sysv4.h:225
+#: config/rs6000/sysv4.h:221
#, c-format
msgid "Bad value for -msdata=%s"
msgstr ""
-#: config/rs6000/sysv4.h:242
+#: config/rs6000/sysv4.h:238
#, c-format
msgid "-mrelocatable and -msdata=%s are incompatible."
msgstr ""
-#: config/rs6000/sysv4.h:250
+#: config/rs6000/sysv4.h:246
#, c-format
msgid "-f%s and -msdata=%s are incompatible."
msgstr ""
-#: config/rs6000/sysv4.h:259
+#: config/rs6000/sysv4.h:255
#, c-format
msgid "-msdata=%s and -mcall-%s are incompatible."
msgstr ""
-#: config/rs6000/sysv4.h:266
+#: config/rs6000/sysv4.h:262
msgid "-mrelocatable and -mno-minimal-toc are incompatible."
msgstr ""
-#: config/rs6000/sysv4.h:272
+#: config/rs6000/sysv4.h:268
#, c-format
msgid "-mrelocatable and -mcall-%s are incompatible."
msgstr ""
-#: config/rs6000/sysv4.h:279
+#: config/rs6000/sysv4.h:275
#, c-format
msgid "-fPIC and -mcall-%s are incompatible."
msgstr ""
-#: config/rs6000/sysv4.h:286
+#: config/rs6000/sysv4.h:282
msgid "-mcall-aixdesc must be big endian"
msgstr ""
@@ -5819,78 +6796,77 @@ msgstr ""
msgid "Generate code for little endian"
msgstr ""
-#: config/sparc/sparc.c:256
-#, c-format
-msgid "%s is not supported by this configuration"
+#: config/sparc/sp86x-aout.h:53 config/sparc/sp86x-elf.h:66
+msgid "Use little-endian byte order for data"
msgstr ""
-#: config/sparc/sparc.c:264
+#: config/sparc/sparc.c:253
#, c-format
-msgid "-mptr%d not allowed on -m%d"
+msgid "%s is not supported by this configuration"
msgstr ""
-#: config/sparc/sparc.c:275
+#: config/sparc/sparc.c:260
msgid "-mlong-double-64 not allowed with -m64"
msgstr ""
-#: config/sparc/sparc.c:295
+#: config/sparc/sparc.c:280
#, c-format
msgid "bad value (%s) for -mcmodel= switch"
msgstr ""
-#: config/sparc/sparc.c:300
+#: config/sparc/sparc.c:285
msgid "-mcmodel= is not supported on 32 bit systems"
msgstr ""
-#: config/sparc/sparc.c:381
+#: config/sparc/sparc.c:366
msgid "profiling does not support code models other than medlow"
msgstr ""
-#: config/sparc/sparc.c:5683 config/sparc/sparc.c:5689
-#, ycp-format
+#: config/sparc/sparc.c:5712 config/sparc/sparc.c:5718
+#, c-format
msgid "Invalid %%Y operand"
msgstr ""
-#: config/sparc/sparc.c:5759
-#, ycp-format
+#: config/sparc/sparc.c:5788
+#, c-format
msgid "Invalid %%A operand"
msgstr ""
-#: config/sparc/sparc.c:5769
-#, ycp-format
+#: config/sparc/sparc.c:5798
+#, c-format
msgid "Invalid %%B operand"
msgstr ""
-#: config/sparc/sparc.c:5808
-#, ycp-format
+#: config/sparc/sparc.c:5837
+#, c-format
msgid "Invalid %%c operand"
msgstr ""
-#: config/sparc/sparc.c:5809
-#, ycp-format
+#: config/sparc/sparc.c:5838
+#, c-format
msgid "Invalid %%C operand"
msgstr ""
-#: config/sparc/sparc.c:5830
-#, ycp-format
+#: config/sparc/sparc.c:5859
+#, c-format
msgid "Invalid %%d operand"
msgstr ""
-#: config/sparc/sparc.c:5831
-#, ycp-format
+#: config/sparc/sparc.c:5860
+#, c-format
msgid "Invalid %%D operand"
msgstr ""
-#: config/sparc/sparc.c:5849
-#, ycp-format
+#: config/sparc/sparc.c:5878
+#, c-format
msgid "Invalid %%f operand"
msgstr ""
-#: config/sparc/sparc.c:5899
+#: config/sparc/sparc.c:5928
msgid "long long constant not a valid immediate operand"
msgstr ""
-#: config/sparc/sparc.c:5902
+#: config/sparc/sparc.c:5931
msgid "floating point constant not a valid immediate operand"
msgstr ""
@@ -5902,231 +6878,231 @@ msgstr ""
msgid "%s and profiling conflict: disabling %s"
msgstr ""
-#: config/sparc/sparc.h:588
+#: config/sparc/sparc.h:587
msgid "Use FUNCTION_EPILOGUE"
msgstr ""
-#: config/sparc/sparc.h:590
+#: config/sparc/sparc.h:589
msgid "Do not use FUNCTION_EPILOGUE"
msgstr ""
-#: config/sparc/sparc.h:592
+#: config/sparc/sparc.h:591
msgid "Assume possible double misalignment"
msgstr ""
-#: config/sparc/sparc.h:594
+#: config/sparc/sparc.h:593
msgid "Assume all doubles are aligned"
msgstr ""
-#: config/sparc/sparc.h:596
+#: config/sparc/sparc.h:595
msgid "Pass -assert pure-text to linker"
msgstr ""
-#: config/sparc/sparc.h:598
+#: config/sparc/sparc.h:597
msgid "Do not pass -assert pure-text to linker"
msgstr ""
-#: config/sparc/sparc.h:600
+#: config/sparc/sparc.h:599
msgid "Use flat register window model"
msgstr ""
-#: config/sparc/sparc.h:602
+#: config/sparc/sparc.h:601
msgid "Do not use flat register window model"
msgstr ""
-#: config/sparc/sparc.h:604
+#: config/sparc/sparc.h:603
msgid "Use ABI reserved registers"
msgstr ""
-#: config/sparc/sparc.h:606
+#: config/sparc/sparc.h:605
msgid "Do not use ABI reserved registers"
msgstr ""
-#: config/sparc/sparc.h:608
+#: config/sparc/sparc.h:607
msgid "Use hardware quad fp instructions"
msgstr ""
-#: config/sparc/sparc.h:610
+#: config/sparc/sparc.h:609
msgid "Do not use hardware quad fp instructions"
msgstr ""
-#: config/sparc/sparc.h:612
+#: config/sparc/sparc.h:611
msgid "Compile for v8plus ABI"
msgstr ""
-#: config/sparc/sparc.h:614
+#: config/sparc/sparc.h:613
msgid "Do not compile for v8plus ABI"
msgstr ""
-#: config/sparc/sparc.h:616
+#: config/sparc/sparc.h:615
msgid "Utilize Visual Instruction Set"
msgstr ""
-#: config/sparc/sparc.h:618
+#: config/sparc/sparc.h:617
msgid "Do not utilize Visual Instruction Set"
msgstr ""
#. ??? These are deprecated, coerced to -mcpu=. Delete in 2.9.
-#: config/sparc/sparc.h:621
+#: config/sparc/sparc.h:620
msgid "Optimize for Cypress processors"
msgstr ""
-#: config/sparc/sparc.h:623
+#: config/sparc/sparc.h:622
msgid "Optimize for SparcLite processors"
msgstr ""
-#: config/sparc/sparc.h:625
+#: config/sparc/sparc.h:624
msgid "Optimize for F930 processors"
msgstr ""
-#: config/sparc/sparc.h:627
+#: config/sparc/sparc.h:626
msgid "Optimize for F934 processors"
msgstr ""
-#: config/sparc/sparc.h:629
+#: config/sparc/sparc.h:628
msgid "Use V8 Sparc ISA"
msgstr ""
-#: config/sparc/sparc.h:631
+#: config/sparc/sparc.h:630
msgid "Optimize for SuperSparc processors"
msgstr ""
#. End of deprecated options.
-#: config/sparc/sparc.h:634
+#: config/sparc/sparc.h:633
msgid "Pointers are 64-bit"
msgstr ""
-#: config/sparc/sparc.h:636
+#: config/sparc/sparc.h:635
msgid "Pointers are 32-bit"
msgstr ""
-#: config/sparc/sparc.h:638
+#: config/sparc/sparc.h:637
msgid "Use 32-bit ABI"
msgstr ""
-#: config/sparc/sparc.h:640
+#: config/sparc/sparc.h:639
msgid "Use 64-bit ABI"
msgstr ""
-#: config/sparc/sparc.h:642
+#: config/sparc/sparc.h:641
msgid "Use stack bias"
msgstr ""
-#: config/sparc/sparc.h:644
+#: config/sparc/sparc.h:643
msgid "Do not use stack bias"
msgstr ""
-#: config/sparc/sparc.h:646
+#: config/sparc/sparc.h:645
msgid "Use structs on stronger alignment for double-word copies"
msgstr ""
-#: config/sparc/sparc.h:648
+#: config/sparc/sparc.h:647
msgid "Do not use structs on stronger alignment for double-word copies"
msgstr ""
-#: config/sparc/sparc.h:650
+#: config/sparc/sparc.h:649
msgid "Optimize tail call instructions in assembler and linker"
msgstr ""
-#: config/sparc/sparc.h:652
+#: config/sparc/sparc.h:651
msgid "Do not optimize tail call instructions in assembler or linker"
msgstr ""
-#: config/sparc/sparc.h:713
+#: config/sparc/sparc.h:712
msgid "Use given Sparc code model"
msgstr ""
-#: config/v850/v850.c:101
-#, c-format
-msgid "%s=%s is not numeric."
-msgstr ""
-
-#: config/v850/v850.c:108
-#, c-format
-msgid "%s=%s is too large."
-msgstr ""
-
-#: config/v850/v850.c:2033
-msgid "a data area attribute cannot be specified for local variables"
-msgstr ""
-
-#: config/v850/v850.c:2041
-#, c-format
-msgid "data area of '%s' conflicts with previous declaration"
-msgstr ""
-
-#: config/v850/v850.c:2245
-#, c-format
-msgid "Bogus JR construction: %d\n"
-msgstr ""
-
-#: config/v850/v850.c:2266 config/v850/v850.c:2468
-#, c-format
-msgid "Bad amount of stack space removal: %d"
-msgstr ""
-
-#: config/v850/v850.c:2444
-#, c-format
-msgid "Bogus JARL construction: %d\n"
-msgstr ""
-
-#: config/v850/v850.c:2689
+#: config/v850/v850-c.c:68
msgid "#pragma GHS endXXXX found without previous startXXX"
msgstr ""
-#: config/v850/v850.c:2691
+#: config/v850/v850-c.c:70
msgid "#pragma GHS endXXX does not match previous startXXX"
msgstr ""
-#: config/v850/v850.c:2715
+#: config/v850/v850-c.c:95
msgid "Cannot set interrupt attribute: no current function"
msgstr ""
-#: config/v850/v850.c:2723
+#: config/v850/v850-c.c:103
msgid "Cannot set interrupt attribute: no such identifier"
msgstr ""
-#: config/v850/v850.c:2765
+#: config/v850/v850-c.c:149
msgid "junk at end of #pragma ghs section"
msgstr ""
-#: config/v850/v850.c:2782
+#: config/v850/v850-c.c:166
#, c-format
msgid "unrecognised section name \"%s\""
msgstr ""
-#: config/v850/v850.c:2796
+#: config/v850/v850-c.c:181
msgid "malformed #pragma ghs section"
msgstr ""
-#: config/v850/v850.c:2814
+#: config/v850/v850-c.c:201
msgid "junk at end of #pragma ghs interrupt"
msgstr ""
-#: config/v850/v850.c:2824
+#: config/v850/v850-c.c:213
msgid "junk at end of #pragma ghs starttda"
msgstr ""
-#: config/v850/v850.c:2834
+#: config/v850/v850-c.c:225
msgid "junk at end of #pragma ghs startsda"
msgstr ""
-#: config/v850/v850.c:2844
+#: config/v850/v850-c.c:237
msgid "junk at end of #pragma ghs startzda"
msgstr ""
-#: config/v850/v850.c:2854
+#: config/v850/v850-c.c:249
msgid "junk at end of #pragma ghs endtda"
msgstr ""
-#: config/v850/v850.c:2864
+#: config/v850/v850-c.c:261
msgid "junk at end of #pragma ghs endsda"
msgstr ""
-#: config/v850/v850.c:2874
+#: config/v850/v850-c.c:273
msgid "junk at end of #pragma ghs endzda"
msgstr ""
+#: config/v850/v850.c:107
+#, c-format
+msgid "%s=%s is not numeric."
+msgstr ""
+
+#: config/v850/v850.c:114
+#, c-format
+msgid "%s=%s is too large."
+msgstr ""
+
+#: config/v850/v850.c:2039
+msgid "a data area attribute cannot be specified for local variables"
+msgstr ""
+
+#: config/v850/v850.c:2047
+#, c-format
+msgid "data area of '%s' conflicts with previous declaration"
+msgstr ""
+
+#: config/v850/v850.c:2249
+#, c-format
+msgid "Bogus JR construction: %d\n"
+msgstr ""
+
+#: config/v850/v850.c:2270 config/v850/v850.c:2472
+#, c-format
+msgid "Bad amount of stack space removal: %d"
+msgstr ""
+
+#: config/v850/v850.c:2448
+#, c-format
+msgid "Bogus JARL construction: %d\n"
+msgstr ""
+
#. Macro to define tables used to set the flags.
#. This is a list in braces of pairs in braces,
#. each pair being { "NAME", VALUE }
@@ -6216,11 +7192,11 @@ msgstr ""
msgid "aggregate value used where an integer was expected"
msgstr ""
-#: convert.c:448
+#: convert.c:448 f/com.c:1132
msgid "pointer value used where a complex was expected"
msgstr ""
-#: convert.c:452
+#: convert.c:452 f/com.c:1134
msgid "aggregate value used where a complex was expected"
msgstr ""
@@ -6228,1246 +7204,1361 @@ msgstr ""
msgid "can't convert value to a vector"
msgstr ""
-#: cp/call.c:383
+#: cp/call.c:379
msgid "unable to call pointer to member function here"
msgstr ""
-#: cp/call.c:513
+#: cp/call.c:509
msgid "destructors take no parameters"
msgstr ""
-#: cp/call.c:2835
+#: cp/call.c:2867
msgid "ISO C++ forbids omitting the middle term of a ?: expression"
msgstr ""
-#: cp/class.c:892
-msgid "internal inconsistency: binfo offset error for rtti"
-msgstr ""
-
-#: cp/class.c:1481
+#: cp/class.c:1438
#, c-format
msgid "conflicting access specifications for field `%s', ignored"
msgstr ""
-#: cp/class.c:5262
+#: cp/class.c:5533
msgid "trying to finish struct, but kicked out due to previous parse errors."
msgstr ""
-#: cp/class.c:5712
+#: cp/class.c:5988
#, c-format
msgid "language string `\"%s\"' not recognized"
msgstr ""
-#: cp/class.c:6024 cp/class.c:6192 cp/class.c:6199
+#: cp/class.c:6303 cp/class.c:6471 cp/class.c:6478
msgid "not enough type information"
msgstr ""
-#: cp/class.c:6176
+#: cp/class.c:6455
msgid "invalid operation on uninstantiated type"
msgstr ""
-#: cp/class.c:7633
+#: cp/class.c:8256
msgid ""
"object size exceeds built-in limit for virtual function table implementation"
msgstr ""
-#: cp/class.c:7635
+#: cp/class.c:8258
msgid ""
"object size exceeds normal limit for virtual function table implementation, "
"recompile all source and use -fhuge-objects"
msgstr ""
-#: cp/decl.c:1411
-msgid "internal compiler error: debugging info corrupted"
-msgstr ""
-
-#: cp/decl.c:3938
-msgid "parse errors have confused me too much"
-msgstr ""
-
-#: cp/decl.c:4236
+#: cp/decl.c:4230
#, c-format
msgid "declaration of `%s' shadows a member of `this'"
msgstr ""
-#: cp/decl.c:4878
+#: cp/decl.c:4871
#, c-format
msgid "label `%s' referenced outside of any function"
msgstr ""
-#: cp/decl.c:4983 cp/decl.c:5010
+#: cp/decl.c:4976 cp/decl.c:5000
msgid "jump to case label"
msgstr ""
-#: cp/decl.c:5016 cp/decl.c:5117
+#: cp/decl.c:5007 cp/decl.c:5111
msgid " enters try block"
msgstr ""
-#: cp/decl.c:5098
-msgid " from here"
-msgstr ""
-
-#: cp/decl.c:5254
-msgid "`default' label not within a switch statement"
-msgstr ""
-
-#: cp/decl.c:5282
-msgid "pointers are not permitted as case values"
-msgstr ""
-
-#: cp/decl.c:5286
-msgid "ISO C++ forbids range expressions in switch statement"
-msgstr ""
-
-#: cp/decl.c:5310
-msgid "empty range specified"
-msgstr ""
-
-#: cp/decl.c:5361
-msgid "duplicate (or overlapping) case value"
-msgstr ""
-
-#: cp/decl.c:5383
-msgid "where case label appears here"
-msgstr ""
-
-#: cp/decl.c:5386
-msgid ""
-"(enclose actions of previous case statements requiring destructors in their "
-"own scope.)"
+#: cp/decl.c:5009 cp/decl.c:5113
+msgid " enters catch block"
msgstr ""
-#: ../libiberty/cplus-dem.c:5007 ../libiberty/cplus-dem.c:5018 cp/decl.c:5738
-msgid "virtual memory exhausted"
-msgstr ""
-
-#: cp/decl.c:6489
-msgid "the new ABI requires vtable thunks"
+#: cp/decl.c:5092
+msgid " from here"
msgstr ""
-#: cp/decl.c:7139
-msgid "an anonymous union cannot have function members"
+#: cp/decl.c:6355
+msgid "the ABI requires vtable thunks"
msgstr ""
-#: cp/decl.c:7196
+#: cp/decl.c:6996
msgid "multiple types in one declaration"
msgstr ""
-#: cp/decl.c:7199
+#: cp/decl.c:6999
msgid "declaration does not declare anything"
msgstr ""
-#: cp/decl.c:7212
+#: cp/decl.c:7023
+msgid "Missing type-name in typedef-declaration."
+msgstr ""
+
+#: cp/decl.c:7030
msgid "ISO C++ prohibits anonymous structs"
msgstr ""
-#: cp/decl.c:8216
+#: cp/decl.c:8018
msgid "assignment (not initialization) in declaration"
msgstr ""
-#: cp/decl.c:8778
+#: cp/decl.c:8580
msgid "invalid catch parameter"
msgstr ""
-#: cp/decl.c:9010
+#: cp/decl.c:8807
msgid "cannot declare `::main' to be a template"
msgstr ""
-#: cp/decl.c:9012
+#: cp/decl.c:8809
msgid "cannot declare `::main' to be inline"
msgstr ""
-#: cp/decl.c:9014
+#: cp/decl.c:8811
msgid "cannot declare `::main' to be static"
msgstr ""
-#: cp/decl.c:9017
+#: cp/decl.c:8814
msgid "`main' must return `int'"
msgstr ""
-#: cp/decl.c:9579
+#: cp/decl.c:9365
msgid "overflow in array dimension"
msgstr ""
-#: cp/decl.c:9868
+#: cp/decl.c:9651
msgid "destructors must be member functions"
msgstr ""
-#: cp/decl.c:10197
+#: cp/decl.c:9980
msgid "`bool' is now a keyword"
msgstr ""
-#: cp/decl.c:10228
+#: cp/decl.c:10011
msgid "ISO C++ does not support `long long'"
msgstr ""
-#: cp/decl.c:10351
+#: cp/decl.c:10133
#, c-format
msgid "short, signed or unsigned invalid for `%s'"
msgstr ""
-#: cp/decl.c:10356
+#: cp/decl.c:10138
#, c-format
msgid "long and short specified together for `%s'"
msgstr ""
-#: cp/decl.c:10367
+#: cp/decl.c:10149
#, c-format
msgid "signed and unsigned given together for `%s'"
msgstr ""
-#: cp/decl.c:10514
+#: cp/decl.c:10296
msgid "storage class specifiers invalid in parameter declarations"
msgstr ""
-#: cp/decl.c:10518
+#: cp/decl.c:10300
msgid "typedef declaration invalid in parameter declaration"
msgstr ""
-#: cp/decl.c:10529
+#: cp/decl.c:10311
msgid "virtual outside class declaration"
msgstr ""
-#: cp/decl.c:10583
+#: cp/decl.c:10365
#, c-format
msgid "storage class specified for %s `%s'"
msgstr ""
-#: cp/decl.c:10621
+#: cp/decl.c:10403
msgid "storage class specifiers invalid in friend function declarations"
msgstr ""
-#: cp/decl.c:10803
+#: cp/decl.c:10585
msgid "destructor cannot be static member function"
msgstr ""
-#: cp/decl.c:10827
+#: cp/decl.c:10609
msgid "constructor cannot be static member function"
msgstr ""
-#: cp/decl.c:10830
+#: cp/decl.c:10612
msgid "constructors cannot be declared virtual"
msgstr ""
-#: cp/decl.c:10845
+#: cp/decl.c:10627
msgid "return value type specifier for constructor ignored"
msgstr ""
-#: cp/decl.c:10864
+#: cp/decl.c:10646
#, c-format
msgid "can't initialize friend function `%s'"
msgstr ""
#. Cannot be both friend and virtual.
-#: cp/decl.c:10868
+#: cp/decl.c:10650
msgid "virtual functions cannot be friends"
msgstr ""
-#: cp/decl.c:10873
+#: cp/decl.c:10655
msgid "friend declaration not in class definition"
msgstr ""
-#: cp/decl.c:10929
+#: cp/decl.c:10711
#, c-format
msgid "cannot declare %s to references"
msgstr ""
-#: cp/decl.c:10955
+#: cp/decl.c:10737
msgid "invalid type: `void &'"
msgstr ""
-#: cp/decl.c:11006
+#: cp/decl.c:10788
msgid "discarding `const' applied to a reference"
msgstr ""
-#: cp/decl.c:11008
+#: cp/decl.c:10790
msgid "discarding `volatile' applied to a reference"
msgstr ""
#. [dcl.fct.spec] The explicit specifier shall only be used in
#. declarations of constructors within a class definition.
-#: cp/decl.c:11225
+#: cp/decl.c:10997
msgid "only declarations of constructors can be `explicit'"
msgstr ""
-#: cp/decl.c:11233
+#: cp/decl.c:11005
#, c-format
msgid "non-member `%s' cannot be declared `mutable'"
msgstr ""
-#: cp/decl.c:11238
+#: cp/decl.c:11010
#, c-format
msgid "non-object member `%s' cannot be declared `mutable'"
msgstr ""
-#: cp/decl.c:11244
+#: cp/decl.c:11016
#, c-format
msgid "function `%s' cannot be declared `mutable'"
msgstr ""
-#: cp/decl.c:11249
+#: cp/decl.c:11021
#, c-format
msgid "static `%s' cannot be declared `mutable'"
msgstr ""
-#: cp/decl.c:11254
+#: cp/decl.c:11026
#, c-format
msgid "const `%s' cannot be declared `mutable'"
msgstr ""
-#: cp/decl.c:11374
+#: cp/decl.c:11131
msgid "typedef declaration includes an initializer"
msgstr ""
-#: cp/decl.c:11470
+#: cp/decl.c:11241
msgid "unnamed variable or field declared void"
msgstr ""
-#: cp/decl.c:11479
+#: cp/decl.c:11250
msgid "variable or field declared void"
msgstr ""
-#: cp/decl.c:11489
+#: cp/decl.c:11260
msgid "cannot use `::' in parameter declaration"
msgstr ""
-#: cp/decl.c:11507
-#, c-format
-msgid "declaration of `%s' as void"
-msgstr ""
-
-#: cp/decl.c:11686
+#: cp/decl.c:11445
#, c-format
msgid "`%s' is neither function nor member function; cannot be declared friend"
msgstr ""
-#: cp/decl.c:11697
+#: cp/decl.c:11456
msgid "member functions are implicitly friends of their class"
msgstr ""
-#: cp/decl.c:11811
+#: cp/decl.c:11570
#, c-format
msgid "storage class `auto' invalid for function `%s'"
msgstr ""
-#: cp/decl.c:11813
+#: cp/decl.c:11572
#, c-format
msgid "storage class `register' invalid for function `%s'"
msgstr ""
-#: cp/decl.c:11824
+#: cp/decl.c:11583
#, c-format
msgid ""
"storage class `static' invalid for function `%s' declared out of global scope"
msgstr ""
-#: cp/decl.c:11826
+#: cp/decl.c:11585
#, c-format
msgid ""
"storage class `inline' invalid for function `%s' declared out of global scope"
msgstr ""
-#: cp/decl.c:11833
+#: cp/decl.c:11592
#, c-format
msgid "virtual non-class function `%s'"
msgstr ""
#. FIXME need arm citation
-#: cp/decl.c:11868
+#: cp/decl.c:11627
msgid "cannot declare static function inside another function"
msgstr ""
-#: cp/decl.c:12202
+#: cp/decl.c:11904
msgid ""
"invalid integer constant in parameter list, did you forget to give parameter "
"name?"
msgstr ""
-#: cp/decl.c:12229
-msgid "parameter invalidly declared method type"
-msgstr ""
-
-#: cp/decl.c:12239
-msgid "parameter invalidly declared offset type"
-msgstr ""
-
-#: cp/decl.c:12273
-msgid "`void' in parameter list must be entire list"
-msgstr ""
-
-#: cp/decl.c:12659
+#: cp/decl.c:12281
#, c-format
msgid "conversion to %s%s will never use a type conversion operator"
msgstr ""
-#: cp/decl.c:13739
+#: cp/decl.c:13365
msgid "return type for `main' changed to `int'"
msgstr ""
-#: cp/decl.c:14671
-msgid "no return statement in function returning non-void"
-msgstr ""
-
-#: cp/decl2.c:631
+#: cp/decl2.c:569
#, c-format
msgid "-f%s is no longer supported"
msgstr ""
-#: cp/decl2.c:637
+#: cp/decl2.c:575
msgid ""
"-fhandle-exceptions has been renamed to -fexceptions (and is now on by "
"default)"
msgstr ""
-#: cp/decl2.c:679
-msgid "no file specified with -fdump-translation-unit"
+#: cp/decl2.c:601
+msgid "-fname-mangling-version is no longer supported"
msgstr ""
-#: cp/decl2.c:741
+#: cp/decl2.c:664
msgid "-Wno-strict-prototypes is not supported in C++"
msgstr ""
-#: cp/decl2.c:1055
+#: cp/decl2.c:1000
msgid "name missing for member function"
msgstr ""
-#: cp/decl2.c:1121
+#: cp/decl2.c:1061
msgid "`__alignof__' applied to a bit-field"
msgstr ""
#. Something has gone very wrong. Assume we are mistakenly reducing
#. an expression instead of a declaration.
-#: cp/decl2.c:1163
+#: cp/decl2.c:1103
msgid "parser may be lost: is there a '{' missing somewhere?"
msgstr ""
-#: cp/decl2.c:1194 cp/decl2.c:1208
+#: cp/decl2.c:1134 cp/decl2.c:1148
msgid "ambiguous conversion for array subscript"
msgstr ""
-#: cp/decl2.c:1258
+#: cp/decl2.c:1198
msgid "anachronistic use of array size in vector delete"
msgstr ""
-#: cp/decl2.c:1268
+#: cp/decl2.c:1208
msgid ""
"cannot delete a function. Only pointer-to-objects are valid arguments to "
"`delete'"
msgstr ""
-#: cp/decl2.c:1592
+#: cp/decl2.c:1505
msgid "initializer invalid for static member with constructor"
msgstr ""
-#: cp/decl2.c:1595
+#: cp/decl2.c:1508
msgid "(an out of class initialization is required)"
msgstr ""
-#: cp/decl2.c:1780
+#: cp/decl2.c:1681
msgid "field initializer is not constant"
msgstr ""
-#: cp/decl2.c:2144
+#: cp/decl2.c:2020
msgid "anonymous struct not inside named type"
msgstr ""
-#: cp/decl2.c:2240
+#: cp/decl2.c:2119
msgid "namespace-scope anonymous aggregates must be static"
msgstr ""
-#: cp/decl2.c:2250
+#: cp/decl2.c:2129
msgid "anonymous aggregate with no members"
msgstr ""
-#: cp/decl2.c:2316
-msgid "`operator new' must return type `void *'"
-msgstr ""
-
-#: cp/decl2.c:2321
-msgid "`operator new' takes type `size_t' parameter"
-msgstr ""
-
-#: cp/decl2.c:2323
-msgid "`operator new' takes type `size_t' as first parameter"
-msgstr ""
-
-#: cp/decl2.c:2348
-msgid "`operator delete' must return type `void'"
-msgstr ""
-
-#: cp/decl2.c:2352
-msgid "`operator delete' takes type `void *' as first parameter"
-msgstr ""
-
-#: cp/decl2.c:2363
-msgid "second argument to `operator delete' must be of type `size_t'"
-msgstr ""
-
-#: cp/decl2.c:2368
-msgid "too many arguments in declaration of `operator delete'"
-msgstr ""
-
-#: cp/decl2.c:2370
-msgid "`...' invalid in specification of `operator delete'"
-msgstr ""
-
#. Overflow occurred. That means there are at least 4 billion
#. initialization functions.
-#: cp/decl2.c:3135
+#: cp/decl2.c:2997
msgid "too many initialization functions required"
msgstr ""
-#: cp/decl2.c:3947
+#: cp/decl2.c:3807
msgid "use of old-style cast"
msgstr ""
-#: cp/error.c:517
+#: cp/error.c:46
#, c-format
-msgid "`%s' not supported by dump_type"
+msgid "`%s' not supported by %s"
msgstr ""
-#: cp/error.c:737
+#: cp/error.c:630
#, c-format
-msgid "`%s' not supported by dump_type_prefix"
+msgid "<anonymous %s>"
msgstr ""
-#: cp/error.c:829
+#: cp/error.c:891
#, c-format
-msgid "`%s' not supported by dump_type_suffix"
+msgid "(static %s for %s)"
msgstr ""
-#: cp/error.c:1095
+#: cp/error.c:2528
#, c-format
-msgid "`%s' not supported by dump_decl"
+msgid "In %s `%s':"
msgstr ""
-#: cp/error.c:2122
+#: cp/error.c:2583
#, c-format
-msgid "`%s' not supported by dump_expr"
+msgid "%s: In instantiation of `%s':\n"
msgstr ""
-#: cp/error.c:2538
+#: cp/error.c:2607
#, c-format
-msgid "In %s `%s':"
+msgid "%s:%d: instantiated from `%s'\n"
+msgstr ""
+
+#: cp/error.c:2612
+#, c-format
+msgid "%s:%d: instantiated from here\n"
msgstr ""
-#: cp/except.c:503
-msgid "call to Java `catch' or `throw', while `jthrowable' undefined"
+#: cp/except.c:258
+msgid "call to Java `catch' or `throw' with `jthrowable' undefined"
msgstr ""
-#: cp/except.c:568
-msgid "mixing C++ and Java `catch'es in single translation unit"
+#: cp/except.c:329
+msgid "mixing C++ and Java catches in a single translation unit"
msgstr ""
-#: cp/except.c:949
+#: cp/except.c:685
msgid " in thrown expression"
msgstr ""
-#: cp/friend.c:405
+#: cp/friend.c:423
msgid ""
"(if this is not what you intended, make sure the function template has "
-"already been declared and add <> after the function name here) "
-"-Wno-non-template-friend disables this warning."
+"already been declared and add <> after the function name here) -Wno-non-"
+"template-friend disables this warning."
msgstr ""
-#: cp/g++spec.c:194
+#: cp/g++spec.c:197 java/jvspec.c:357
#, c-format
msgid "argument to `%s' missing\n"
msgstr ""
-#: cp/init.c:278
+#: cp/init.c:313
msgid "initializer list treated as compound expression"
msgstr ""
-#: cp/init.c:393
+#: cp/init.c:428
msgid " will be re-ordered to match declaration order"
msgstr ""
-#: cp/init.c:627
+#: cp/init.c:662
msgid " will be re-ordered to match inheritance order"
msgstr ""
-#: cp/init.c:1061
+#: cp/init.c:1105
msgid "base class initializer specified, but no base class to initialize"
msgstr ""
-#: cp/init.c:1067
+#: cp/init.c:1111
msgid "initializer for unnamed base class ambiguous"
msgstr ""
-#: cp/init.c:1092
+#: cp/init.c:1136
msgid "no base class to initialize"
msgstr ""
-#: cp/init.c:1816
+#: cp/init.c:1860
msgid "object missing in use of pointer-to-member construct"
msgstr ""
-#: cp/init.c:1858 cp/typeck.c:3130 cp/typeck.c:3232
+#: cp/init.c:1902 cp/typeck.c:3186 cp/typeck.c:3287
msgid "at this point in file"
msgstr ""
-#: cp/init.c:2040
+#: cp/init.c:2076
msgid "new of array type fails to specify size"
msgstr ""
-#: cp/init.c:2051
+#: cp/init.c:2087
msgid "size in array new must have integral type"
msgstr ""
-#: cp/init.c:2057
+#: cp/init.c:2093
msgid "zero size array reserves no space"
msgstr ""
-#: cp/init.c:2122
+#: cp/init.c:2158
msgid "new cannot be applied to a reference type"
msgstr ""
-#: cp/init.c:2128
+#: cp/init.c:2164
msgid "new cannot be applied to a function type"
msgstr ""
-#: cp/init.c:2175
+#: cp/init.c:2211
msgid "call to Java constructor, while `jclass' undefined"
msgstr ""
-#: cp/init.c:2292
+#: cp/init.c:2227
+msgid "Can't find class$"
+msgstr ""
+
+#: cp/init.c:2340
msgid "invalid type `void' for new"
msgstr ""
-#: cp/init.c:2348
+#: cp/init.c:2394
#, c-format
-msgid "call to Java constructor, while `%s' undefined"
+msgid "call to Java constructor with `%s' undefined"
msgstr ""
-#: cp/init.c:2484 cp/typeck2.c:369 cp/typeck2.c:1172
+#: cp/init.c:2522 cp/typeck2.c:381 cp/typeck2.c:1207
msgid "initializer list being treated as compound expression"
msgstr ""
-#: cp/init.c:2487
-msgid "initializer list appears where operand should be used"
-msgstr ""
-
-#: cp/init.c:2934
-msgid "initialization of array from dissimilar array type"
+#: cp/init.c:2528
+msgid "ISO C++ forbids aggregate initializer to new"
msgstr ""
-#: cp/init.c:2948
+#: cp/init.c:2967
msgid "initializer ends prematurely"
msgstr ""
-#: cp/init.c:3017
+#: cp/init.c:3037
msgid "cannot initialize multi-dimensional array with initializer"
msgstr ""
-#: cp/init.c:3211
+#: cp/init.c:3215
msgid "unknown array size in delete"
msgstr ""
-#: cp/init.c:3430
+#: cp/init.c:3440
msgid "type to vector delete is neither pointer or array type"
msgstr ""
-#: cp/lex.c:160
+#: cp/lang-options.h:29
+msgid "Do not obey access control semantics"
+msgstr ""
+
+#: cp/lang-options.h:31
+msgid "Change when template instances are emitted"
+msgstr ""
+
+#: cp/lang-options.h:36
+msgid "Check the return value of new"
+msgstr ""
+
+#: cp/lang-options.h:39
+msgid "Reduce size of object files"
+msgstr ""
+
+#: cp/lang-options.h:43
+msgid "Make string literals `char[]' instead of `const char[]'"
+msgstr ""
+
+#: cp/lang-options.h:46
+msgid "Dump the entire translation unit to a file"
+msgstr ""
+
+#: cp/lang-options.h:48
+msgid "Do not inline member functions by default"
+msgstr ""
+
+#: cp/lang-options.h:51
+msgid "Do not generate run time type descriptor information"
+msgstr ""
+
+#: cp/lang-options.h:56
+msgid "Do not generate code to check exception specifications"
+msgstr ""
+
+#: cp/lang-options.h:61
+msgid "Scope of for-init-statement vars extends outside"
+msgstr ""
+
+#: cp/lang-options.h:64
+msgid "Do not recognise GNU defined keywords"
+msgstr ""
+
+#: cp/lang-options.h:69
+msgid "Do not treat the namespace `std' as a normal namespace"
+msgstr ""
+
+#: cp/lang-options.h:71
+msgid "Enable support for huge objects"
+msgstr ""
+
+#: cp/lang-options.h:75
+msgid "Export functions even if they can be inlined"
+msgstr ""
+
+#: cp/lang-options.h:78
+msgid "Only emit explicit template instatiations"
+msgstr ""
+
+#: cp/lang-options.h:81
+msgid "Only emit explicit instatiations of inline templates"
+msgstr ""
+
+#: cp/lang-options.h:87
+msgid "Don't pedwarn about uses of Microsoft extensions"
+msgstr ""
+
+#: cp/lang-options.h:90
+msgid "Recognise and/bitand/bitor/compl/not/or/xor"
+msgstr ""
+
+#: cp/lang-options.h:94
+msgid "Disable optional diagnostics"
+msgstr ""
+
+#: cp/lang-options.h:96
+msgid "Downgrade conformance errors to warnings"
+msgstr ""
+
+#: cp/lang-options.h:99
+msgid "Enable automatic template instantiation"
+msgstr ""
+
+#: cp/lang-options.h:104
+msgid "Display statistics accumulated during compilation"
+msgstr ""
+
+#: cp/lang-options.h:107
+msgid "Specify maximum template instantiation depth"
+msgstr ""
+
+#: cp/lang-options.h:109
+msgid "Use __cxa_atexit to register destructors."
+msgstr ""
+
+#: cp/lang-options.h:112
+msgid "Discard unused virtual functions"
+msgstr ""
+
+#: cp/lang-options.h:115
+msgid "Implement vtables using thunks"
+msgstr ""
+
+#: cp/lang-options.h:118
+msgid "Emit common-like symbols as weak symbols"
+msgstr ""
+
+#: cp/lang-options.h:121
+msgid "Emit cross referencing information"
+msgstr ""
+
+#: cp/lang-options.h:125
+msgid "Warn about inconsistent return types"
+msgstr ""
+
+#: cp/lang-options.h:128
+msgid "Warn about overloaded virtual function names"
+msgstr ""
+
+#: cp/lang-options.h:132
+msgid "Don't warn when all ctors/dtors are private"
+msgstr ""
+
+#: cp/lang-options.h:134
+msgid "Warn about non virtual destructors"
+msgstr ""
+
+#: cp/lang-options.h:137
+msgid "Warn when a function is declared extern, then inline"
+msgstr ""
+
+#: cp/lang-options.h:140
+msgid "Warn when the compiler reorders code"
+msgstr ""
+
+#: cp/lang-options.h:143
+msgid "Warn when synthesis behaviour differs from Cfront"
+msgstr ""
+
+#: cp/lang-options.h:147
+msgid "Don't warn when type converting pointers to member functions"
+msgstr ""
+
+#: cp/lang-options.h:149
+msgid "Warn about violations of Effective C++ style rules"
+msgstr ""
+
+#: cp/lang-options.h:152
+msgid "Warn when overload promotes from unsigned to signed"
+msgstr ""
+
+#: cp/lang-options.h:155
+msgid "Warn if a C style cast is used in a program"
+msgstr ""
+
+#: cp/lang-options.h:159
+msgid ""
+"Don't warn when non-templatized friend functions are declared within a "
+"template"
+msgstr ""
+
+#: cp/lang-options.h:162
+msgid "Don't announce deprecation of compiler features"
+msgstr ""
+
+#: cp/lex.c:148
msgid "type name expected before `*'"
msgstr ""
-#: cp/lex.c:182
+#: cp/lex.c:170
msgid "cannot declare references to references"
msgstr ""
-#: cp/lex.c:187
+#: cp/lex.c:175
msgid "cannot declare pointers to references"
msgstr ""
-#: cp/lex.c:191
+#: cp/lex.c:179
msgid "type name expected before `&'"
msgstr ""
-#: cp/lex.c:1058
+#: cp/lex.c:1018
#, c-format
msgid "semicolon missing after %s declaration"
msgstr ""
-#: cp/lex.c:1109
+#: cp/lex.c:1069
#, c-format
msgid "junk at end of #pragma %s"
msgstr ""
-#: cp/lex.c:1116
+#: cp/lex.c:1076
#, c-format
msgid "invalid #pragma %s"
msgstr ""
-#: cp/lex.c:1208 cppmain.c:269
+#: cp/lex.c:1166
#, c-format
msgid "#pragma implementation for %s appears after file is included"
msgstr ""
-#: cp/lex.c:1323
+#: cp/lex.c:1191
+msgid "junk at end of #pragma GCC java_exceptions"
+msgstr ""
+
+#: cp/lex.c:1292
msgid ""
"(Each undeclared identifier is reported only once for each function it "
"appears in.)"
msgstr ""
-#: cp/lex.c:1346
+#: cp/lex.c:1315
#, c-format
msgid "name lookup of `%s' changed"
msgstr ""
-#: cp/lex.c:1360 cp/lex.c:1367
+#: cp/lex.c:1329 cp/lex.c:1336
#, c-format
msgid "name lookup of `%s' changed for new ISO `for' scoping"
msgstr ""
-#: cp/method.c:907
-#, c-format
-msgid "conversion of %s as template parameter"
+#: cp/mangle.c:1877
+msgid "real-valued template parameters when cross-compiling"
msgstr ""
-#: cp/method.c:1933
+#: cp/method.c:173
msgid "methods cannot be converted to function pointers"
msgstr ""
-#: cp/method.c:1938
+#: cp/method.c:178
#, c-format
msgid "ambiguous request for method pointer `%s'"
msgstr ""
-#: cp/method.c:2046
-#, c-format
-msgid "request for member `%s' is ambiguous in multiple inheritance lattice"
-msgstr ""
-
-#: parse.y:652
+#: cp/parse.y:670
msgid "invalid default template argument"
msgstr ""
-#: parse.y:857
+#: cp/parse.y:879
msgid "no base or member initializers given following ':'"
msgstr ""
-#: parse.y:873
+#: cp/parse.y:892
msgid "base initializers not allowed for non-member functions"
msgstr ""
-#: parse.y:875
+#: cp/parse.y:894
msgid "only constructors take base initializers"
msgstr ""
-#: parse.y:908 parse.y:914
+#: cp/parse.y:927 cp/parse.y:933
msgid "anachronistic old style base class initializer"
msgstr ""
#. Handle `Class<Class<Type>>' without space in the `>>'
-#: parse.y:1036
+#: cp/parse.y:1055
msgid "`>>' should be `> >' in template class name"
msgstr ""
-#: parse.y:1093 parse.y:1102
+#: cp/parse.y:1112 cp/parse.y:1121
#, c-format
msgid "ISO C++ forbids an empty condition for `%s'"
msgstr ""
-#: parse.y:1196
+#: cp/parse.y:1216
msgid "ISO C++ forbids `&&'"
msgstr ""
-#: parse.y:1281
+#: cp/parse.y:1300
msgid "ISO C++ forbids initialization of new expression with `='"
msgstr ""
-#: parse.y:1311
-msgid "ISO C++ forbids constructor-expressions"
+#: cp/parse.y:1331
+msgid "ISO C++ forbids compound literals"
msgstr ""
-#: parse.y:1546
+#: cp/parse.y:1566
msgid "ISO C++ forbids braced-groups within expressions"
msgstr ""
-#: parse.y:1951 parse.y:1966
+#: cp/parse.y:1972 cp/parse.y:1987
msgid "sigof type specifier"
msgstr ""
-#: parse.y:1956
+#: cp/parse.y:1977
msgid "`sigof' applied to non-aggregate expression"
msgstr ""
-#: parse.y:1971
+#: cp/parse.y:1992
msgid "`sigof' applied to non-aggregate type"
msgstr ""
-#: parse.y:2306
+#: cp/parse.y:2332
#, c-format
msgid "storage class specifier `%s' not allowed after struct or class"
msgstr ""
-#: parse.y:2308
+#: cp/parse.y:2334
#, c-format
msgid "type specifier `%s' not allowed after struct or class"
msgstr ""
-#: parse.y:2310
+#: cp/parse.y:2336
#, c-format
msgid "type qualifier `%s' not allowed after struct or class"
msgstr ""
-#: parse.y:2312
+#: cp/parse.y:2338
msgid "no body nor ';' separates two class, struct or union declarations"
msgstr ""
-#: parse.y:2480
+#: cp/parse.y:2503
msgid "multiple access specifiers"
msgstr ""
-#: parse.y:2498
+#: cp/parse.y:2521
msgid "multiple `virtual' specifiers"
msgstr ""
-#: parse.y:2533
+#: cp/parse.y:2556
msgid "missing ';' before right brace"
msgstr ""
-#: parse.y:2754
+#: cp/parse.y:2779
msgid "ISO C++ forbids array dimensions with parenthesized type in new"
msgstr ""
-#: parse.y:3259
+#: cp/parse.y:3288
msgid "ISO C++ forbids label declarations"
msgstr ""
-#: parse.y:3412
+#: cp/parse.y:3450
msgid "ISO C++ forbids computed gotos"
msgstr ""
-#: parse.y:3419
+#: cp/parse.y:3458
msgid "label must be followed by statement"
msgstr ""
-#: parse.y:3512
+#: cp/parse.y:3557
msgid "ISO C++ forbids compound statements inside for initializations"
msgstr ""
#. This helps us recover from really nasty
#. parse errors, for example, a missing right
#. parenthesis.
-#: parse.y:3595 parse.y:3605
+#: cp/parse.y:3640 cp/parse.y:3650
msgid "possibly missing ')'"
msgstr ""
-#: parse.y:3702 parse.y:3707
+#: cp/parse.y:3747 cp/parse.y:3752
msgid "type specifier omitted for parameter"
msgstr ""
-#: cp/pt.c:1829
-msgid " a template type parameter must begin with `class' or `typename'"
-msgstr ""
-
-#: cp/pt.c:6202
+#: cp/pt.c:6316
msgid "creating array with size zero"
msgstr ""
-#: cp/pt.c:6710
+#: cp/pt.c:6830
#, c-format
msgid "use of `%s' in template"
msgstr ""
-#: cp/pt.c:7851
+#: cp/pt.c:8036
msgid "incomplete type unification"
msgstr ""
-#: cp/pt.c:8702
+#: cp/pt.c:8966
#, c-format
msgid "use of `%s' in template type unification"
msgstr ""
-#: cp/repo.c:285
+#: cp/repo.c:272
msgid "-frepo must be used with -c"
msgstr ""
-#: cp/repo.c:378
+#: cp/repo.c:366
#, c-format
msgid "mysterious repository information in %s"
msgstr ""
-#: cp/repo.c:393
+#: cp/repo.c:381
#, c-format
msgid "can't create repository information file `%s'"
msgstr ""
-#: cp/rtti.c:247
+#: cp/rtti.c:224
msgid "taking dynamic typeid of object with -fno-rtti"
msgstr ""
-#: cp/rtti.c:289
+#: cp/rtti.c:260
msgid "cannot use typeid with -fno-rtti"
msgstr ""
-#: cp/rtti.c:295 cp/rtti.c:496
+#: cp/rtti.c:266 cp/rtti.c:415
msgid "must #include <typeinfo> before using typeid"
msgstr ""
-#: cp/search.c:2027
+#: cp/search.c:1961
msgid "adjusting pointers for covariant returns"
msgstr ""
#. This shouldn't happen, I don't want errors!
-#: cp/search.c:2545
+#: cp/search.c:2469
msgid "recoverable compiler error, fixups for virtual function"
msgstr ""
-#: cp/spew.c:245
-#, c-format
-msgid "identifier name `%s' conflicts with GNU C++ internal naming strategy"
+#: cp/semantics.c:1026
+msgid "ISO C++ does not permit named return values"
msgstr ""
-#: cp/spew.c:360
-msgid "syntax error before '#' token"
+#: cp/semantics.c:1043
+msgid "can't redefine default return value for constructors"
msgstr ""
-#: cp/spew.c:364
-msgid "syntax error before '\\' token"
+#: cp/semantics.c:1112
+msgid " will be re-ordered to precede member initializations"
msgstr ""
-#: cp/spew.c:847
-msgid "keyword 'export' not implemented and will be ignored"
+#: cp/semantics.c:1385
+msgid "`this' is unavailable for static member functions"
msgstr ""
-#: cp/spew.c:1055 cp/spew.c:1324
+#: cp/semantics.c:1391
+msgid "invalid use of `this' in non-member function"
+msgstr ""
+
+#: cp/semantics.c:1393
+msgid "invalid use of `this' at top level"
+msgstr ""
+
+#: cp/semantics.c:1678
+msgid "template type parameters must use the keyword `class' or `typename'"
+msgstr ""
+
+#: cp/spew.c:249
+#, c-format
+msgid "identifier name `%s' conflicts with GNU C++ internal naming strategy"
+msgstr ""
+
+#: cp/spew.c:357
+msgid "parse error"
+msgstr ""
+
+#: cp/spew.c:1023 cp/spew.c:1295
msgid "parse error at end of saved function text"
msgstr ""
-#: cp/spew.c:1097
+#: cp/spew.c:1065
msgid "parse error in method specification"
msgstr ""
-#: cp/spew.c:1139
+#: cp/spew.c:1107
msgid "function body for constructor missing"
msgstr ""
-#: cp/tree.c:217
+#: cp/spew.c:1500
+#, c-format
+msgid "%s before `%s'"
+msgstr ""
+
+#: cp/spew.c:1502
+#, c-format
+msgid "%s before `%c'"
+msgstr ""
+
+#: cp/spew.c:1504
+#, c-format
+msgid "%s before `\\%o'"
+msgstr ""
+
+#: cp/spew.c:1507
+#, c-format
+msgid "%s before `%s' token"
+msgstr ""
+
+#: cp/tree.c:216
#, c-format
msgid "non-lvalue in %s"
msgstr ""
-#: cp/tree.c:2290
+#: cp/tree.c:2232
+msgid ""
+"`java_interface' attribute can only be applied to Java class definitions"
+msgstr ""
+
+#: cp/tree.c:2242
msgid "`com_interface' only supported with -fvtable-thunks"
msgstr ""
-#: cp/tree.c:2299
+#: cp/tree.c:2251
msgid "`com_interface' attribute can only be applied to class definitions"
msgstr ""
-#: cp/tree.c:2316
+#: cp/tree.c:2267
msgid "requested init_priority is not an integer constant"
msgstr ""
-#: cp/tree.c:2337
+#: cp/tree.c:2287
msgid ""
"can only use init_priority attribute on file-scope definitions of objects of "
"class type"
msgstr ""
-#: cp/tree.c:2343
+#: cp/tree.c:2293
msgid "requested init_priority is out of range"
msgstr ""
-#: cp/tree.c:2352
+#: cp/tree.c:2302
msgid "requested init_priority is reserved for internal use"
msgstr ""
-#: cp/typeck.c:482 cp/typeck.c:488
+#: cp/tree.c:2312
+msgid "init_priority attribute is not supported on this platform"
+msgstr ""
+
+#: cp/typeck.c:483
#, c-format
msgid ""
"ISO C++ forbids %s between pointer of type `void *' and pointer-to-function"
msgstr ""
-#: cp/typeck.c:1557
+#: cp/typeck.c:1558
msgid "ISO C++ forbids applying `sizeof' to a function type"
msgstr ""
-#: cp/typeck.c:1563
+#: cp/typeck.c:1564
msgid "ISO C++ forbids applying `sizeof' to a member function"
msgstr ""
-#: cp/typeck.c:1569
+#: cp/typeck.c:1570
msgid ""
"ISO C++ forbids applying `sizeof' to type `void' which is an incomplete type"
msgstr ""
-#: cp/typeck.c:1607
+#: cp/typeck.c:1619
msgid "sizeof applied to a bit-field"
msgstr ""
-#: cp/typeck.c:1610
+#: cp/typeck.c:1622
msgid "ISO C++ forbids applying `sizeof' to an expression of function type"
msgstr ""
-#: cp/typeck.c:2205
+#: cp/typeck.c:2235
msgid "invalid reference to NULL ptr, use ptr-to-member instead"
msgstr ""
-#: cp/typeck.c:2369
+#: cp/typeck.c:2398
#, c-format
msgid "invalid use of `%s' on pointer to member"
msgstr ""
-#: cp/typeck.c:2375
+#: cp/typeck.c:2404
msgid "invalid type argument"
msgstr ""
-#: cp/typeck.c:2456
+#: cp/typeck.c:2507
msgid "ISO C++ forbids subscripting non-lvalue array"
msgstr ""
-#: cp/typeck.c:2467
+#: cp/typeck.c:2518
msgid "subscripting array declared `register'"
msgstr ""
-#: cp/typeck.c:2642 cp/typeck.c:2782
+#: cp/typeck.c:2693 cp/typeck.c:2833
msgid "pointer to member function called, but not in class scope"
msgstr ""
-#: cp/typeck.c:2780
+#: cp/typeck.c:2831
msgid ""
"invalid call to member function needing `this' in static member function "
"scope"
msgstr ""
-#: cp/typeck.c:2966
+#: cp/typeck.c:3021
msgid "ISO C++ forbids calling `::main' from within program"
msgstr ""
-#: cp/typeck.c:3169
+#: cp/typeck.c:3225
msgid "parameter type of called function is incomplete"
msgstr ""
-#: cp/typeck.c:3560
+#: cp/typeck.c:3615
#, c-format
msgid "%s rotate count is negative"
msgstr ""
-#: cp/typeck.c:3563
+#: cp/typeck.c:3618
#, c-format
msgid "%s rotate count >= width of type"
msgstr ""
-#: cp/typeck.c:3594 cp/typeck.c:3599 cp/typeck.c:3729 cp/typeck.c:3734
+#: cp/typeck.c:3649 cp/typeck.c:3654 cp/typeck.c:3745 cp/typeck.c:3750
msgid "ISO C++ forbids comparison between pointer and integer"
msgstr ""
-#: cp/typeck.c:3949
+#: cp/typeck.c:3966
msgid "comparison between signed and unsigned integer expressions"
msgstr ""
-#: cp/typeck.c:4088
+#: cp/typeck.c:4105
msgid "ISO C++ forbids using pointer of type `void *' in pointer arithmetic"
msgstr ""
-#: cp/typeck.c:4094
+#: cp/typeck.c:4111
msgid "ISO C++ forbids using a pointer-to-function in pointer arithmetic"
msgstr ""
-#: cp/typeck.c:4100
+#: cp/typeck.c:4117
msgid ""
"ISO C++ forbids using a pointer to member function in pointer arithmetic"
msgstr ""
-#: cp/typeck.c:4106
+#: cp/typeck.c:4123
msgid "ISO C++ forbids using pointer to a member in pointer arithmetic"
msgstr ""
-#: cp/typeck.c:4177
+#: cp/typeck.c:4194
msgid "ISO C++ forbids using pointer of type `void *' in subtraction"
msgstr ""
-#: cp/typeck.c:4179
+#: cp/typeck.c:4196
msgid "ISO C++ forbids using pointer to a function in subtraction"
msgstr ""
-#: cp/typeck.c:4181
+#: cp/typeck.c:4198
msgid "ISO C++ forbids using pointer to a method in subtraction"
msgstr ""
-#: cp/typeck.c:4183
+#: cp/typeck.c:4200
msgid "ISO C++ forbids using pointer to a member in subtraction"
msgstr ""
-#: cp/typeck.c:4195
+#: cp/typeck.c:4212
msgid "invalid use of a pointer to an incomplete type in pointer arithmetic"
msgstr ""
-#: cp/typeck.c:4300
+#: cp/typeck.c:4317
msgid "taking address of temporary"
msgstr ""
-#: cp/typeck.c:4486
+#: cp/typeck.c:4517
#, c-format
msgid "ISO C++ forbids %sing an enum"
msgstr ""
-#: cp/typeck.c:4530
+#: cp/typeck.c:4561
msgid "cast to non-reference type used as lvalue"
msgstr ""
#. ARM $3.4
-#: cp/typeck.c:4608
+#: cp/typeck.c:4628
msgid "ISO C++ forbids taking address of function `::main'"
msgstr ""
-#: cp/typeck.c:4685
+#: cp/typeck.c:4721
msgid "ISO C++ forbids taking the address of a cast to a non-lvalue expression"
msgstr ""
-#: cp/typeck.c:4701
+#: cp/typeck.c:4737
msgid "unary `&'"
msgstr ""
-#: cp/typeck.c:4923
-msgid "cannot take the address of `this', which is an ravlue expression"
+#: cp/typeck.c:4929
+msgid "cannot take the address of `this', which is an rvalue expression"
msgstr ""
-#: cp/typeck.c:5233
+#: cp/typeck.c:5232
msgid ""
"ISO C++ forbids casting between pointer-to-function and pointer-to-object"
msgstr ""
-#: cp/typeck.c:5344 cp/typeck.c:5349
-msgid "ISO C++ forbids casting to an array type"
-msgstr ""
-
-#: cp/typeck.c:5676
+#: cp/typeck.c:5682
msgid "ISO C++ forbids cast to non-reference type used as lvalue"
msgstr ""
-#: cp/typeck.c:5782
+#: cp/typeck.c:5788
msgid "ISO C++ forbids assignment of arrays"
msgstr ""
-#: cp/typeck.c:5799
+#: cp/typeck.c:5803
msgid "return value from function receives multiple initializations"
msgstr ""
-#: cp/typeck.c:5941
+#: cp/typeck.c:5946
msgid " in pointer to member function conversion"
msgstr ""
-#: cp/typeck.c:5949
+#: cp/typeck.c:5954
msgid " in pointer to member conversion"
msgstr ""
-#: cp/typeck.c:6669
+#: cp/typeck.c:6542
msgid "returning reference to temporary"
msgstr ""
-#: cp/typeck.c:6676
+#: cp/typeck.c:6549
msgid "reference to non-lvalue returned"
msgstr ""
-#: cp/typeck.c:6722
+#: cp/typeck.c:6595
msgid "returning a value from a destructor"
msgstr ""
#. If a return statement appears in a handler of the
#. function-try-block of a constructor, the program is ill-formed.
-#: cp/typeck.c:6730
+#: cp/typeck.c:6603
msgid "cannot return from a handler of a function-try-block of a constructor"
msgstr ""
#. You can't return a value from a constructor.
-#: cp/typeck.c:6733
+#: cp/typeck.c:6606
msgid "returning a value from a constructor"
msgstr ""
-#: cp/typeck.c:6755
+#: cp/typeck.c:6623
msgid ""
"return-statement with no value, in function declared with a non-void return "
"type"
msgstr ""
-#: cp/typeck.c:6771
+#: cp/typeck.c:6639
msgid ""
"return-statement with a value, in function declared with a void return type"
msgstr ""
#: cp/typeck2.c:171
-msgid " since the following virtual functions are abstract:"
+msgid " because the following virtual functions are abstract:"
msgstr ""
-#: cp/typeck2.c:260
+#: cp/typeck2.c:268
#, c-format
msgid "Internal error #%d."
msgstr ""
-#: cp/typeck2.c:327
+#: cp/typeck2.c:339
msgid "due to the presence of a constructor"
msgstr ""
-#: cp/typeck2.c:351
+#: cp/typeck2.c:363
msgid "comma expression used to initialize return value"
msgstr ""
-#: cp/typeck2.c:360
+#: cp/typeck2.c:372
msgid "cannot initialize arrays using this syntax"
msgstr ""
-#: cp/typeck2.c:416
+#: cp/typeck2.c:428
msgid "ANSI C++ forbids non-constant aggregate initializer expressions"
msgstr ""
-#: cp/typeck2.c:491
+#: cp/typeck2.c:503
msgid "initializing array with parameter list"
msgstr ""
-#: cp/typeck2.c:547
+#: cp/typeck2.c:559
msgid "initializer for scalar variable requires one element"
msgstr ""
-#: cp/typeck2.c:644
+#: cp/typeck2.c:657
msgid "aggregate has a partly bracketed initializer"
msgstr ""
-#: cp/typeck2.c:674 cp/typeck2.c:775
+#: cp/typeck2.c:687 cp/typeck2.c:788
msgid "non-trivial labeled initializers"
msgstr ""
-#: cp/typeck2.c:691
+#: cp/typeck2.c:704
msgid "non-empty initializer for array of empty elements"
msgstr ""
-#: cp/typeck2.c:741
+#: cp/typeck2.c:754
msgid "initializer list for object of class with virtual base classes"
msgstr ""
-#: cp/typeck2.c:747
+#: cp/typeck2.c:760
msgid "initializer list for object of class with base classes"
msgstr ""
-#: cp/typeck2.c:753
+#: cp/typeck2.c:766
msgid "initializer list for object using virtual functions"
msgstr ""
-#: cp/typeck2.c:863
+#: cp/typeck2.c:883
msgid "index value instead of field name in union initializer"
msgstr ""
-#: cp/typeck2.c:919
+#: cp/typeck2.c:939
msgid "excess elements in aggregate initializer"
msgstr ""
-#: cp/typeck2.c:1022
+#: cp/typeck2.c:1037
msgid "circular pointer delegation detected"
msgstr ""
-#: cp/typeck2.c:1049
+#: cp/typeck2.c:1064
msgid "result of `operator->()' yields non-pointer result"
msgstr ""
-#: cp/typeck2.c:1051
+#: cp/typeck2.c:1066
msgid "base operand of `->' is not a pointer"
msgstr ""
-#: cp/typeck2.c:1223
+#: cp/typeck2.c:1258
#, c-format
msgid "ISO C++ forbids defining types within %s"
msgstr ""
@@ -7477,14 +8568,9 @@ msgstr ""
msgid "Can't create cross-reference file `%s'"
msgstr ""
-#: ../libiberty/cplus-dem.c:4788 gcc.c:5681
-msgid "Internal gcc abort."
-msgstr ""
-
-#. N.B. The current line in each outer source file is one
-#. greater than the line of the #include, so we must
-#. subtract one to correct for that.
-#: cpperror.c:63
+#. The current line in each outer source file is now the
+#. same as the line of the #include.
+#: cpperror.c:55
#, c-format
msgid "In file included from %s:%u"
msgstr ""
@@ -7501,224 +8587,239 @@ msgstr ""
#. with all the "from"s lined up.
#. The trailing comma is at the beginning of this message,
#. and the trailing colon is not translated.
-#: cpperror.c:79
+#: cpperror.c:71
#, c-format
msgid ""
",\n"
" from %s:%u"
msgstr ""
-#: cpperror.c:165
+#: cpperror.c:188
msgid "internal error: "
msgstr ""
-#: cpperror.c:184
+#: cpperror.c:195
msgid "warning: "
msgstr ""
-#: cpperror.c:295 cpperror.c:457 gcc.c:5653 tradcpp.c:4206
+#: cpperror.c:309 cpperror.c:480 cppfiles.c:661 gcc.c:6076 tradcpp.c:4722
#, c-format
msgid "%s: %s"
msgstr ""
-#: cppexp.c:207
+#: cppexp.c:209
msgid "traditional C rejects the `U' suffix"
msgstr ""
-#: cppexp.c:213
-msgid "integer constant contains digits beyond the radix"
+#: cppexp.c:212
+msgid "too many 'l' suffixes in integer constant"
msgstr ""
#: cppexp.c:216
+msgid "integer constant contains digits beyond the radix"
+msgstr ""
+
+#: cppexp.c:219
msgid "integer constant out of range"
msgstr ""
-#: cppexp.c:222
+#: cppexp.c:225
msgid "integer constant is so large that it is unsigned"
msgstr ""
-#: cppexp.c:231
+#: cppexp.c:234
#, c-format
msgid "invalid suffix '%.*s' on integer constant"
msgstr ""
-#: cppexp.c:418
-#, c-format
-msgid "\"%s\" is not defined"
+#: cppexp.c:343
+msgid "missing ')' after \"defined\""
msgstr ""
-#: cppexp.c:493
-msgid "octal escape sequence out of range"
+#: cppexp.c:350
+msgid "operator \"defined\" requires an identifier"
msgstr ""
-#: cppexp.c:526
-msgid "hex escape sequence out of range"
-msgstr ""
-
-#: cppexp.c:541
-msgid "integer overflow in preprocessor expression"
-msgstr ""
-
-#: cppexp.c:811
+#: cppexp.c:358
#, c-format
-msgid "impossible operator type %s"
+msgid "(\"%s\" is an alternative token for \"%s\" in C++)"
msgstr ""
-#: cppexp.c:920
-msgid "comma operator in operand of #if"
+#: cppexp.c:427
+msgid "\"defined\" operator appears during macro expansion"
msgstr ""
-#: cppfiles.c:195
+#: cppexp.c:443
#, c-format
-msgid "included file \"%s\" exists but is not readable"
+msgid "ISO C++ does not permit \"%s\" in #if"
msgstr ""
-#: cppfiles.c:218
+#: cppexp.c:458
#, c-format
-msgid "node for '%s' exists, open failed, error '%s', value %lx\n"
+msgid "\"%s\" is not defined"
msgstr ""
-#: cppfiles.c:366
-#, c-format
-msgid "cpp_make_system_header: bad flag %d\n"
+#: cppexp.c:550
+msgid "octal escape sequence out of range"
msgstr ""
-#: cppfiles.c:368
-msgid "cpp_make_system_header called on non-file buffer"
+#: cppexp.c:583
+msgid "hex escape sequence out of range"
msgstr ""
-#: cppfiles.c:410
-msgid "Multiple include guards may be useful for:\n"
+#: cppexp.c:598
+msgid "integer overflow in preprocessor expression"
msgstr ""
-#: cppfiles.c:444 cppfiles.c:521
+#: cppexp.c:868
#, c-format
-msgid "No include path in which to find %s"
+msgid "impossible operator '%s'"
msgstr ""
-#: cppfiles.c:649
+#: cppexp.c:978
+msgid "comma operator in operand of #if"
+msgstr ""
+
+#: cppfiles.c:383
#, c-format
msgid "%s is too large"
msgstr ""
-#: cppfiles.c:657
+#: cppfiles.c:412
#, c-format
-msgid "%s is shorter than expected\n"
+msgid "%s is shorter than expected"
msgstr ""
-#: cppfiles.c:661
+#: cppfiles.c:421
#, c-format
msgid "%s is a block device"
msgstr ""
-#: cppfiles.c:666
+#: cppfiles.c:541
#, c-format
-msgid "%s is a directory"
+msgid "No include path in which to find %s"
+msgstr ""
+
+#: cppfiles.c:609
+msgid "Multiple include guards may be useful for:\n"
+msgstr ""
+
+#: cppfiles.c:999
+msgid "absolute file name in remap_filename"
msgstr ""
-#: cppinit.c:258
+#: cppinit.c:223
#, c-format
msgid "ignoring nonexistent directory \"%s\"\n"
msgstr ""
-#: cppinit.c:264
+#: cppinit.c:229
#, c-format
msgid "%s: Not a directory"
msgstr ""
-#: cppinit.c:305
+#: cppinit.c:275
#, c-format
msgid "ignoring duplicate directory \"%s\"\n"
msgstr ""
-#: cppinit.c:816
-msgid "-MG must be specified with one of -M or -MM"
+#: cppinit.c:889
+msgid "-include and -imacros cannot be used with -fpreprocessed"
msgstr ""
-#: cppinit.c:855
+#: cppinit.c:925
msgid "#include \"...\" search starts here:\n"
msgstr ""
-#: cppinit.c:859
+#: cppinit.c:929
msgid "#include <...> search starts here:\n"
msgstr ""
-#: cppinit.c:862
+#: cppinit.c:932
msgid "End of search list.\n"
msgstr ""
-#: cppinit.c:943
-msgid "buffers still stacked in cpp_finish"
+#: cppinit.c:1004 tradcpp.c:963 tradcpp.c:973 tradcpp.c:1064
+msgid "I/O error on output"
msgstr ""
-#: cppinit.c:969 tradcpp.c:945 tradcpp.c:954 tradcpp.c:959
-msgid "I/O error on output"
+#: cppinit.c:1018
+msgid "buffers still stacked in cpp_finish"
msgstr ""
#. Irix6 "cc -n32" and OSF4 cc have problems with char foo[] = ("string");
#. I.e. a const string initializer with parens around it. That is
#. what N_("string") resolves to, so we make no_* be macros instead.
-#: cppinit.c:1006
+#: cppinit.c:1050
#, c-format
msgid "Argument missing after %s"
msgstr ""
-#: cppinit.c:1007
+#: cppinit.c:1051
#, c-format
msgid "Assertion missing after %s"
msgstr ""
-#: cppinit.c:1008
+#: cppinit.c:1052
#, c-format
msgid "Directory name missing after %s"
msgstr ""
-#: cppinit.c:1009
+#: cppinit.c:1053
#, c-format
msgid "File name missing after %s"
msgstr ""
-#: cppinit.c:1010
+#: cppinit.c:1054
#, c-format
msgid "Macro name missing after %s"
msgstr ""
-#: cppinit.c:1011
+#: cppinit.c:1055
#, c-format
msgid "Path name missing after %s"
msgstr ""
-#: cppinit.c:1012
+#: cppinit.c:1056
#, c-format
msgid "Number missing after %s"
msgstr ""
-#: cppinit.c:1186
+#: cppinit.c:1057
#, c-format
-msgid "Too many arguments. Type %s --help for usage info"
+msgid "Target missing after %s"
msgstr ""
-#: cppinit.c:1268 cppinit.c:1406
+#: cppinit.c:1242
#, c-format
-msgid "GNU CPP version %s (cpplib)\n"
+msgid "Too many filenames. Type %s --help for usage info"
msgstr ""
-#: cppinit.c:1398 tradcpp.c:565
+#: cppinit.c:1426 tradcpp.c:598
msgid "Output filename specified twice"
msgstr ""
-#: cppinit.c:1531
+#: cppinit.c:1546
msgid "-I- specified twice"
msgstr ""
-#: cppinit.c:1682
+#: cppinit.c:1694
+#, c-format
+msgid "GNU CPP version %s (cpplib)"
+msgstr ""
+
+#: cppinit.c:1735 tradcpp.c:787
+msgid "you must additionally specify either -M or -MM"
+msgstr ""
+
+#: cppinit.c:1795
#, c-format
msgid "Usage: %s [switches] input output\n"
msgstr ""
#. To keep the lines from getting too long for some compilers, limit
#. to about 500 characters (6 lines) per chunk.
-#: cppinit.c:1685
+#: cppinit.c:1798
msgid ""
"Switches:\n"
" -include <file> Include the contents of <file> before other "
@@ -7731,7 +8832,7 @@ msgid ""
"path\n"
msgstr ""
-#: cppinit.c:1694
+#: cppinit.c:1807
msgid ""
" -idirafter <dir> Add <dir> to the end of the system include path\n"
" -I <dir> Add <dir> to the end of the main include path\n"
@@ -7740,12 +8841,12 @@ msgid ""
" -nostdinc Do not search system include directories\n"
" (dirs specified with -isystem will still be "
"used)\n"
-" -nostdinc++ Do not search system include directories for "
-"C++\n"
+" -nostdinc++ Do not search system include directories for C+"
+"+\n"
" -o <file> Put output into <file>\n"
msgstr ""
-#: cppinit.c:1703
+#: cppinit.c:1816
msgid ""
" -pedantic Issue all warnings demanded by strict ISO C\n"
" -pedantic-errors Issue -pedantic warnings as errors instead\n"
@@ -7754,16 +8855,16 @@ msgid ""
" -lang-c89 Assume that the input sources are in C89\n"
msgstr ""
-#: cppinit.c:1710
+#: cppinit.c:1823
msgid ""
" -lang-c++ Assume that the input sources are in C++\n"
" -lang-objc Assume that the input sources are in ObjectiveC\n"
-" -lang-objc++ Assume that the input sources are in "
-"ObjectiveC++\n"
+" -lang-objc++ Assume that the input sources are in ObjectiveC+"
+"+\n"
" -lang-asm Assume that the input sources are in assembler\n"
msgstr ""
-#: cppinit.c:1716
+#: cppinit.c:1829
msgid ""
" -std=<std name> Specify the conformance standard; one of:\n"
" gnu89, gnu99, c89, c99, iso9899:1990,\n"
@@ -7775,7 +8876,7 @@ msgid ""
" -Wcomment{s} Warn if one comment starts inside another\n"
msgstr ""
-#: cppinit.c:1726
+#: cppinit.c:1839
msgid ""
" -Wno-comment{s} Do not warn about comments\n"
" -Wtraditional Warn about features not present in traditional "
@@ -7786,828 +8887,1359 @@ msgid ""
" -Wimport Warn about the use of the #import directive\n"
msgstr ""
-#: cppinit.c:1734
+#: cppinit.c:1847
msgid ""
" -Wno-import Do not warn about the use of #import\n"
" -Werror Treat all warnings as errors\n"
" -Wno-error Do not treat warnings as errors\n"
+" -Wsystem-headers Do not suppress warnings from system headers\n"
+" -Wno-system-headers Suppress warnings from system headers\n"
" -Wall Enable all preprocessor warnings\n"
+msgstr ""
+
+#: cppinit.c:1855
+msgid ""
" -M Generate make dependencies\n"
" -MM As -M, but ignore system header files\n"
+" -MF <file> Write dependency output to the given file\n"
+" -MG Treat missing header file as generated files\n"
msgstr ""
-#: cppinit.c:1742
+#: cppinit.c:1861
msgid ""
-" -MD As -M, but put output in a .d file\n"
-" -MMD As -MD, but ignore system header files\n"
-" -MG Treat missing header file as generated files\n"
-" -g3 Include #define and #undef directives in the "
-"output\n"
-" -D<macro> Define a <macro> with string '1' as its value\n"
-" -D<macro>=<val> Define a <macro> with <val> as its value\n"
+" -MP\t\t\t Generate phony targets for all headers\n"
+" -MQ <target> Add a MAKE-quoted target\n"
+" -MT <target> Add an unquoted target\n"
msgstr ""
-#: cppinit.c:1750
+#: cppinit.c:1866
msgid ""
+" -D<macro> Define a <macro> with string '1' as its value\n"
+" -D<macro>=<val> Define a <macro> with <val> as its value\n"
" -A<question> (<answer>) Assert the <answer> to <question>\n"
" -A-<question> (<answer>) Disable the <answer> to <question>\n"
" -U<macro> Undefine <macro> \n"
" -v Display the version number\n"
-" -H Print the name of header files as they are used\n"
-" -C Do not discard comments\n"
msgstr ""
-#: cppinit.c:1758
+#: cppinit.c:1874
msgid ""
+" -H Print the name of header files as they are used\n"
+" -C Do not discard comments\n"
" -dM Display a list of macro definitions active at "
"end\n"
" -dD Preserve macro definitions in output\n"
" -dN As -dD except that only the names are preserved\n"
" -dI Include #include directives in the output\n"
-" -ftabstop=<number> Distance between tab stops for column reporting\n"
-" -P Do not generate #line directives\n"
-" -$ Do not allow '$' in identifiers\n"
msgstr ""
-#: cppinit.c:1767
+#: cppinit.c:1882
msgid ""
+" -fpreprocessed Treat the input file as already preprocessed\n"
+" -ftabstop=<number> Distance between tab stops for column reporting\n"
+" -P Do not generate #line directives\n"
+" -$ Do not allow '$' in identifiers\n"
" -remap Remap file names when including files.\n"
" --version Display version information\n"
" -h or --help Display this information\n"
msgstr ""
-#: cpplex.c:425
-msgid "missing terminating > character"
-msgstr ""
-
-#: cpplex.c:724
+#: cpplex.c:159
#, c-format
msgid "trigraph ??%c converted to %c"
msgstr ""
-#: cpplex.c:728
+#: cpplex.c:167
#, c-format
msgid "trigraph ??%c ignored"
msgstr ""
-#: cpplex.c:841
-msgid "'/*' within comment"
+#: cpplex.c:251
+msgid "backslash and newline separated by space"
+msgstr ""
+
+#: cpplex.c:255
+msgid "backslash-newline at end of file"
+msgstr ""
+
+#: cpplex.c:330
+msgid "\"/*\" within comment"
msgstr ""
-#: cpplex.c:941
-msgid "embedded null character ignored"
+#: cpplex.c:416
+msgid "null character(s) ignored"
msgstr ""
-#: cpplex.c:947
+#: cpplex.c:423
#, c-format
msgid "%s in preprocessing directive"
msgstr ""
-#: cpplex.c:977
-msgid "'$' character in identifier"
+#: cpplex.c:507
+msgid "'$' character(s) in identifier"
+msgstr ""
+
+#: cpplex.c:521
+#, c-format
+msgid "attempt to use poisoned \"%s\""
msgstr ""
-#: cpplex.c:1139
-msgid "multi-line string constant"
+#: cpplex.c:527
+msgid "__VA_ARGS__ can only appear in the expansion of a C99 variadic macro"
msgstr ""
-#: cpplex.c:1177
+#: cpplex.c:597
#, c-format
msgid "missing terminating %c character"
msgstr ""
-#: cpplex.c:1184
+#: cpplex.c:604
msgid "possible start of unterminated string literal"
msgstr ""
-#: cpplex.c:1194
-msgid "null characters preserved"
+#: cpplex.c:697
+msgid "multi-line string literals are deprecated"
msgstr ""
-#: cpplex.c:1195
-msgid "null character preserved"
+#: cpplex.c:708
+msgid "null character(s) preserved in literal"
msgstr ""
-#: cpplex.c:1436
+#: cpplex.c:881
+msgid "no newline at end of file"
+msgstr ""
+
+#: cpplex.c:1002 tradcpp.c:1447
+msgid "unterminated comment"
+msgstr ""
+
+#: cpplex.c:1016
msgid "C++ style comments are not allowed in ISO C89"
msgstr ""
-#: cpplex.c:1438
+#: cpplex.c:1018
msgid "(this will be reported only once per input file)"
msgstr ""
-#: cpplex.c:1446
-msgid "comment start split across lines"
+#: cpplex.c:1026
+msgid "multi-line comment"
msgstr ""
-#: cpplex.c:1449
-msgid "multi-line comment"
+#: cpplex.c:1188
+msgid "directives may not be used inside a macro argument"
msgstr ""
-#: cpplex.c:1479
-msgid "comment start '/*' split across lines"
+#: cpplex.c:1343
+#, c-format
+msgid "Unspellable token %s"
msgstr ""
-#: cpplex.c:1483 tradcpp.c:1348
-msgid "unterminated comment"
+#: cpplib.c:214
+#, c-format
+msgid "extra tokens at end of #%s directive"
msgstr ""
-#: cpplex.c:1487
-msgid "comment end '*/' split across lines"
+#: cpplib.c:303
+msgid "# followed by integer"
msgstr ""
-#: cpplex.c:1528
-msgid "backslash-newline at end of file"
+#: cpplib.c:352
+msgid "suggest not using #elif in traditional C"
msgstr ""
-#: cpplex.c:1548
-msgid "backslash and newline separated by space"
+#: cpplib.c:355
+#, c-format
+msgid "traditional C ignores #%s with the # indented"
msgstr ""
-#: cpplex.c:1561
-msgid "K+R C ignores #\\n with the # indented"
+#: cpplib.c:359
+#, c-format
+msgid "suggest hiding #%s from traditional C with an indented #"
msgstr ""
-#: cpplex.c:1781
-msgid "no newline at end of file"
+#: cpplib.c:369
+#, c-format
+msgid "#%s is a GCC extension"
msgstr ""
-#: cpplex.c:1797
+#: cpplib.c:393
#, c-format
msgid "invalid preprocessing directive #%s"
msgstr ""
-#: cpplex.c:1800
-msgid "invalid preprocessing directive"
+#: cpplib.c:454
+#, c-format
+msgid "no macro name given in #%s directive"
msgstr ""
-#: cpplex.c:2035
+#: cpplib.c:458
#, c-format
-msgid "Unspellable token %s"
+msgid "\"%s\" cannot be used as a macro name as it is an operator in C++"
msgstr ""
-#: cpplex.c:2284
-#, c-format
-msgid "function macro %s must be used with arguments in traditional C"
+#: cpplib.c:461
+msgid "macro names must be identifiers"
msgstr ""
-#: cpplex.c:2418
+#: cpplib.c:470
#, c-format
-msgid "unterminated argument list for macro \"%s\""
+msgid "\"%s\" cannot be used as a macro name"
msgstr ""
-#: cpplex.c:2439
-msgid "ISO C99 requires rest arguments to be used"
+#: cpplib.c:508
+#, c-format
+msgid "undefining \"%s\""
msgstr ""
-#: cpplex.c:2445
-#, c-format
-msgid "not enough arguments for macro \"%s\""
+#: cpplib.c:552
+msgid "missing terminating > character"
msgstr ""
-#: cpplex.c:2453
+#: cpplib.c:590
#, c-format
-msgid "too many arguments for macro \"%s\""
+msgid "#%s expects \"FILENAME\" or <FILENAME>"
msgstr ""
-#: cpplex.c:2780
-msgid "pasting would not give a valid preprocessing token"
+#: cpplib.c:599
+#, c-format
+msgid "empty file name in #%s"
msgstr ""
-#: cpplex.c:2910
-msgid "invalid string literal, ignoring final '\\'"
+#: cpplib.c:627
+msgid "#include nested too deeply"
msgstr ""
-#: cpplex.c:3060
-msgid "two tokens pushed in a row"
+#: cpplib.c:629
+msgid "attempt to push file buffer with contexts stacked"
msgstr ""
-#: cpplex.c:3082
-#, c-format
-msgid "directive begins with %s?!"
+#: cpplib.c:636
+msgid "#include_next in primary source file"
msgstr ""
-#: cpplex.c:3192
-#, c-format
-msgid "macros nested too deep invoking '%s'"
+#: cpplib.c:660
+msgid "#import is obsolete, use an #ifndef wrapper in the header file"
msgstr ""
-#: cpplex.c:3314
+#: cpplib.c:696
#, c-format
-msgid "#%s may not be used inside a macro argument"
+msgid "invalid flag \"%s\" in line directive"
msgstr ""
-#: cpplex.c:3501 cpplib.c:260 cpplib.c:1466
+#: cpplib.c:748
#, c-format
-msgid "attempt to use poisoned \"%s\""
+msgid "\"%s\" after #line is not a positive integer"
msgstr ""
-#: cpplex.c:3505
-msgid "invalid special hash type"
+#: cpplib.c:754
+msgid "line number out of range"
msgstr ""
-#: cpplex.c:3582
-msgid "<command line>"
+#: cpplib.c:798
+#, c-format
+msgid "file \"%s\" left but not entered"
msgstr ""
-#: cpplib.c:165 cpplib.c:210
+#: cpplib.c:806
#, c-format
-msgid "traditional C ignores #%s with the # indented"
+msgid "expected to return to file \"%s\""
msgstr ""
-#: cpplib.c:170
+#: cpplib.c:809
#, c-format
-msgid "suggest hiding #%s from traditional C with an indented #"
+msgid "expected to return to line number %u"
msgstr ""
-#: cpplib.c:181
+#: cpplib.c:812
#, c-format
-msgid "ISO C does not allow #%s"
+msgid "header flags for \"%s\" have changed"
msgstr ""
-#: cpplib.c:205
-msgid "# followed by integer"
+#: cpplib.c:823
+#, c-format
+msgid "\"%s\" is not a valid filename"
msgstr ""
-#: cpplib.c:235
-msgid "\"defined\" cannot be used as a macro name"
+#: cpplib.c:920 f/lex.c:1240
+msgid "invalid #ident"
msgstr ""
-#: cpplib.c:238
+#: cpplib.c:971
#, c-format
-msgid "\"%s\" cannot be used as a macro name in C++"
+msgid "unknown #pragma namespace %s"
msgstr ""
-#: cpplib.c:242
-msgid "macro names must be identifiers"
+#: cpplib.c:1083
+msgid "#pragma once is obsolete"
msgstr ""
-#: cpplib.c:251
-#, c-format
-msgid "\"%s\" cannot be used as a macro name"
+#: cpplib.c:1086
+msgid "#pragma once in main file"
msgstr ""
-#: cpplib.c:289
-msgid "junk on line after #undef"
+#: cpplib.c:1110
+msgid "invalid #pragma GCC poison directive"
msgstr ""
-#: cpplib.c:299
+#: cpplib.c:1119
#, c-format
-msgid "undefining \"%s\""
+msgid "poisoning existing macro \"%s\""
msgstr ""
-#: cpplib.c:325
-#, c-format
-msgid "#%s expects \"FILENAME\" or <FILENAME>"
+#: cpplib.c:1144
+msgid "#pragma system_header ignored outside include file"
msgstr ""
-#: cpplib.c:331
+#: cpplib.c:1166
#, c-format
-msgid "empty file name in #%s"
+msgid "cannot find source %s"
msgstr ""
-#: cpplib.c:336
+#: cpplib.c:1170
#, c-format
-msgid "junk at end of #%s"
+msgid "current file is older than %s"
msgstr ""
-#: cpplib.c:374
-msgid "#import is obsolete, use an #ifndef wrapper in the header file"
+#: cpplib.c:1233
+msgid "_Pragma takes a parenthesized string literal"
msgstr ""
-#: cpplib.c:411
-msgid "#include_next in primary source file"
+#: cpplib.c:1326
+msgid "#else without #if"
msgstr ""
-#: cpplib.c:439
-msgid "invalid format #line"
+#: cpplib.c:1331 tradcpp.c:3850
+msgid "#else after #else"
msgstr ""
-#: cpplib.c:494
-msgid "token after #line is not a positive integer"
+#: cpplib.c:1333 cpplib.c:1367
+msgid "the conditional began here"
msgstr ""
-#: cpplib.c:499
-msgid "line number out of range"
+#: cpplib.c:1360
+msgid "#elif without #if"
msgstr ""
-#: cpplib.c:512
-msgid "second token after #line is not a string"
+#: cpplib.c:1365 tradcpp.c:3545
+msgid "#elif after #else"
msgstr ""
-#: cpplib.c:534
-msgid "garbage at end of #line"
+#: cpplib.c:1397
+msgid "#endif without #if"
msgstr ""
-#: cpplib.c:618
-msgid "invalid #ident"
+#: cpplib.c:1482 tradcpp.c:3242
+msgid "missing '(' after predicate"
msgstr ""
-#: cpplib.c:670
-#, c-format
-msgid "unknown #pragma namespace %s"
+#: cpplib.c:1503 tradcpp.c:3256
+msgid "missing ')' to complete answer"
msgstr ""
-#: cpplib.c:791
-msgid "#pragma once is obsolete"
+#: cpplib.c:1511 tradcpp.c:3262
+msgid "predicate's answer is empty"
msgstr ""
-#: cpplib.c:794
-msgid "#pragma once outside include file"
+#: cpplib.c:1542 tradcpp.c:3310
+msgid "assertion without predicate"
msgstr ""
-#: cpplib.c:815
-msgid "invalid #pragma poison directive"
+#: cpplib.c:1544 tradcpp.c:3312
+msgid "predicate must be an identifier"
msgstr ""
-#: cpplib.c:825
+#: cpplib.c:1625 tradcpp.c:3409
#, c-format
-msgid "poisoning existing macro \"%s\""
+msgid "\"%s\" re-asserted"
msgstr ""
-#: cpplib.c:847
-msgid "#pragma system_header outside include file"
+#: cpplib.c:1821
+msgid "<builtin>"
msgstr ""
-#: cpplib.c:872
-#, c-format
-msgid "cannot find source %c%s%c"
+#: cpplib.c:1823
+msgid "<command line>"
msgstr ""
-#: cpplib.c:877
-#, c-format
-msgid "current file is older than %c%.*s%c"
+#: cpplib.c:1846
+msgid "<stdin>"
msgstr ""
-#: cpplib.c:959
+#: cpplib.c:1879
#, c-format
-msgid "#%s with no argument"
+msgid "unterminated #%s"
msgstr ""
-#: cpplib.c:961
+#: cpplib.c:1907
#, c-format
-msgid "#%s with invalid argument"
+msgid "file \"%s\" entered but not left"
msgstr ""
-#: cpplib.c:963
+#: cppmacro.c:213
#, c-format
-msgid "garbage at end of #%s"
+msgid "invalid builtin macro \"%s\""
msgstr ""
-#: cpplib.c:969
-#, c-format
-msgid "attempt to use poisoned identifier \"%s\""
+#: cppmacro.c:333
+msgid "invalid string literal, ignoring final '\\'"
msgstr ""
-#: cpplib.c:1043
-msgid "#else without #if"
+#: cppmacro.c:367
+#, c-format
+msgid "pasting \"%s\" and \"%s\" does not give a valid preprocessing token"
msgstr ""
-#: cpplib.c:1048 tradcpp.c:3335
-msgid "#else after #else"
+#: cppmacro.c:539
+#, c-format
+msgid "unterminated argument list invoking macro \"%s\""
msgstr ""
-#: cpplib.c:1050 cpplib.c:1086
-msgid "the conditional began here"
+#: cppmacro.c:556
+msgid "ISO C99 requires rest arguments to be used"
msgstr ""
-#: cpplib.c:1079
-msgid "#elif without #if"
+#: cppmacro.c:561
+#, c-format
+msgid "macro \"%s\" requires %u arguments, but only %u given"
msgstr ""
-#: cpplib.c:1084 tradcpp.c:3043
-msgid "#elif after #else"
+#: cppmacro.c:572
+#, c-format
+msgid "macro \"%s\" passed %u arguments, but takes just %u"
msgstr ""
-#: cpplib.c:1113
-msgid "#endif without #if"
+#: cppmacro.c:612
+#, c-format
+msgid "function-like macro \"%s\" must be used with arguments in traditional C"
msgstr ""
-#: cpplib.c:1159
+#: cppmacro.c:1236
#, c-format
-msgid "ISO C forbids text after #%s"
+msgid "duplicate macro parameter \"%s\""
msgstr ""
-#: cpplib.c:1174
+#: cppmacro.c:1271
#, c-format
-msgid "unterminated #%s"
+msgid "\"%s\" may not appear in macro parameter list"
msgstr ""
-#: cpplib.c:1203
-msgid "assertion without predicate"
+#: cppmacro.c:1278
+msgid "macro parameters must be comma-separated"
msgstr ""
-#: cpplib.c:1208
-msgid "predicate must be an identifier"
+#: cppmacro.c:1295
+msgid "parameter name missing"
msgstr ""
-#: cpplib.c:1226
-msgid "missing '(' after predicate"
+#: cppmacro.c:1309
+msgid "anonymous variadic macros were introduced in C99"
msgstr ""
-#: cpplib.c:1243
-msgid "missing ')' to complete answer"
+#: cppmacro.c:1312
+msgid "ISO C does not permit named variadic macros"
msgstr ""
-#: cpplib.c:1266
-msgid "predicate's answer is empty"
+#: cppmacro.c:1321
+msgid "missing ')' in macro parameter list"
msgstr ""
-#: cpplib.c:1276
-msgid "junk at end of assertion"
+#: cppmacro.c:1400
+msgid "ISO C requires whitespace after the macro name"
msgstr ""
-#: cpplib.c:1337
-#, c-format
-msgid "\"%s\" re-asserted"
+#: cppmacro.c:1423
+msgid "'#' is not followed by a macro parameter"
msgstr ""
-#: cpplib.c:1426
-msgid "<builtin>"
+#: cppmacro.c:1443
+msgid "'##' cannot appear at either end of a macro expansion"
msgstr ""
-#: cpplib.c:1487
-msgid "#include nested too deep"
+#: cppmacro.c:1478
+#, c-format
+msgid "\"%s\" redefined"
msgstr ""
-#: cpplib.c:1492
-msgid "buffer pushed with contexts stacked"
+#: cppmacro.c:1484
+msgid "this is the location of the previous definition"
msgstr ""
-#: cppmain.c:79
+#: cppmacro.c:1542
#, c-format
-msgid "Invalid option %s"
+msgid "macro argument \"%s\" would be stringified with -traditional."
msgstr ""
-#: cppmain.c:258
-msgid "malformed #pragma implementation"
+#: cppmacro.c:1566
+#, c-format
+msgid "invalid hash type %d in dump_definition"
+msgstr ""
+
+#: cppmain.c:128
+#, c-format
+msgid "Invalid option %s"
msgstr ""
-#: cppspec.c:127
+#: cppspec.c:128
#, c-format
msgid "\"%s\" is not a valid option to the preprocessor"
msgstr ""
-#: cppspec.c:151
+#: cppspec.c:152
msgid "too many input files"
msgstr ""
-#: cse.c:7039
+#: cse.c:7140
#, c-format
msgid ";; Processing block from %d to %d, %d sets.\n"
msgstr ""
-#: diagnostic.c:820
+#: diagnostic.c:844
#, c-format
msgid "%s:%d: warning: "
msgstr ""
-#: diagnostic.c:822
+#: diagnostic.c:851
#, c-format
-msgid "%s:%d: "
+msgid "%s: warning: "
msgstr ""
-#: diagnostic.c:827
-#, c-format
-msgid "%s: warning: "
+#: diagnostic.c:937
+msgid "((anonymous))"
msgstr ""
-#: diagnostic.c:829 diagnostic.c:838 diagnostic.c:1235
+#: diagnostic.c:1064
#, c-format
-msgid "%s: "
+msgid "%s: warnings being treated as errors\n"
msgstr ""
-#: diagnostic.c:923
-msgid "((anonymous))"
+#: diagnostic.c:1116
+#, c-format
+msgid "%s: %s: "
msgstr ""
-#: diagnostic.c:1198
+#: diagnostic.c:1224
msgid "sorry, not implemented: "
msgstr ""
-#: diagnostic.c:1247
+#: diagnostic.c:1243
+#, c-format
+msgid "%s "
+msgstr ""
+
+#: diagnostic.c:1245
+#, c-format
+msgid " %s"
+msgstr ""
+
+#: diagnostic.c:1268
+msgid "At top level:"
+msgstr ""
+
+#: diagnostic.c:1273
#, c-format
msgid "In method `%s':"
msgstr ""
-#: diagnostic.c:1251
+#: diagnostic.c:1277
#, c-format
msgid "In function `%s':"
msgstr ""
-#: diagnostic.c:1421
-msgid "Unrecognizable insn:"
+#: diagnostic.c:1412
+msgid "compilation terminated.\n"
msgstr ""
-#: diagnostic.c:1423
-msgid "Insn does not satisfy its constraints:"
+#: diagnostic.c:1447
+#, c-format
+msgid "%s:%d: confused by earlier errors, bailing out\n"
msgstr ""
-#: diagnostic.c:1658
+#: diagnostic.c:1461 diagnostic.c:1700
#, c-format
msgid ""
-"Internal compiler error in %s, at %s:%d\n"
-"Please submit a full bug report.\n"
-"See %s for instructions."
+"Please submit a full bug report,\n"
+"with preprocessed source if appropriate.\n"
+"See %s for instructions.\n"
msgstr ""
-#: dwarf2out.c:2946
-#, c-format
-msgid "DW_LOC_OP %s not implememnted yet.\n"
+#: diagnostic.c:1493
+msgid "Unrecognizable insn:"
msgstr ""
-#: dwarf2out.c:7115 dwarfout.c:1590
+#: diagnostic.c:1495
+msgid "Insn does not satisfy its constraints:"
+msgstr ""
+
+#: diagnostic.c:1698
+msgid "Internal compiler error: Error reporting routines re-entered.\n"
+msgstr ""
+
+#: diagnostic.c:1760
#, c-format
-msgid "internal regno botch: regno = %d\n"
+msgid "Internal compiler error in %s, at %s:%d"
msgstr ""
-#: dwarfout.c:5743
-msgid "getpwd"
+#: diagnostic.c:1805
+#, c-format
+msgid "In file included from %s:%d"
msgstr ""
-#: emit-rtl.c:1001
+#: diagnostic.c:1808
+#, c-format
msgid ""
-"Unable to access real part of complex value in a hard register on this target"
+",\n"
+" from %s:%d"
msgstr ""
-#: emit-rtl.c:1024
-msgid ""
-"Unable to access imaginary part of complex value in a hard register on this "
-"target"
+#: diagnostic.c:1809
+msgid ":\n"
msgstr ""
-#: emit-rtl.c:2512
-msgid "ICE: emit_insn used where emit_jump_insn needed:\n"
+#: dwarf2out.c:2977
+#, c-format
+msgid "DW_LOC_OP %s not implememnted\n"
msgstr ""
-#: except.c:776
-msgid "additional handler after ..."
+#: dwarf2out.c:7071 dwarfout.c:2128
+#, c-format
+msgid "internal regno botch: regno = %d\n"
msgstr ""
-#: except.c:954
-msgid "Cannot duplicate non-existant exception region."
+#: dwarfout.c:6262
+msgid "can't get current directory"
msgstr ""
-#: except.c:1068
-msgid "exception handling disabled, use -fexceptions to enable"
+#: emit-rtl.c:1006
+msgid "Can't access real part of complex value in hard register"
msgstr ""
-#: except.c:1751
-msgid "Never issued previous false_label"
+#: emit-rtl.c:1030
+msgid "can't access imaginary part of complex value in hard register"
msgstr ""
-#: except.c:2532
+#: emit-rtl.c:2560
+msgid "ICE: emit_insn used where emit_jump_insn needed:\n"
+msgstr ""
+
+#: errors.c:168
#, c-format
-msgid "Counted %d copies of EH region %d in list.\n"
+msgid "abort in %s, at %s:%d"
msgstr ""
-#: except.c:3074
-msgid "Duplicate call to __builtin_eh_return"
+#: except.c:357
+msgid "exception handling disabled, use -fexceptions to enable"
msgstr ""
-#: except.c:3094
-msgid "function uses __builtin_eh_return"
+#: except.c:2931
+msgid "argument of `__builtin_eh_return_regno' must be constant"
msgstr ""
-#: explow.c:1461
+#: except.c:3029 except.c:3053
+msgid "__builtin_eh_return not supported on this target"
+msgstr ""
+
+#: explow.c:1458
msgid "stack limits not supported on this target"
msgstr ""
-#: expr.c:2696
+#: expr.c:2842
msgid "function using short complex types cannot be inline"
msgstr ""
-#: expr.c:5684 expr.c:5693 expr.c:5702 expr.c:5707 expr.c:5885 expr.c:5900
+#: expr.c:5860 expr.c:5869 expr.c:5878 expr.c:5883 expr.c:6041 expr.c:6056
msgid "unsupported wide integer operation"
msgstr ""
-#: expr.c:5953
+#: expr.c:6103
#, c-format
msgid "prior parameter's size depends on `%s'"
msgstr ""
-#: expr.c:6351
+#: expr.c:6504
msgid "returned value in block_exit_expr"
msgstr ""
-#: final.c:3406
+#: f/com.c:11860
+msgid "no INTEGER type can hold a pointer on this configuration"
+msgstr ""
+
+#: f/com.c:12087
+#, c-format
+msgid "configuration: REAL, INTEGER, and LOGICAL are %d bits wide,"
+msgstr ""
+
+#: f/com.c:12089
+#, c-format
+msgid "and pointers are %d bits wide, but g77 doesn't yet work"
+msgstr ""
+
+#: f/com.c:12091
+msgid "properly unless they all are 32 bits wide."
+msgstr ""
+
+#: f/com.c:12092
+msgid "Please keep this in mind before you report bugs. g77 should"
+msgstr ""
+
+#: f/com.c:12093
+msgid "support non-32-bit machines better as of version 0.6."
+msgstr ""
+
+#. I/O will probably crash.
+#: f/com.c:12101
+#, c-format
+msgid "configuration: char * holds %d bits, but ftnlen only %d"
+msgstr ""
+
+#. ASSIGN 10 TO I will crash.
+#: f/com.c:12110
+#, c-format
+msgid ""
+"configuration: char * holds %d bits, but INTEGER only %d --\n"
+" ASSIGN statement might fail"
+msgstr ""
+
+#: f/com.c:16088
+msgid "Directory name must immediately follow -I"
+msgstr ""
+
+#: f/g77spec.c:250
+#, c-format
+msgid "overflowed output arg list for `%s'"
+msgstr ""
+
+#: f/g77spec.c:436
+msgid "--driver no longer supported"
+msgstr ""
+
+#: f/g77spec.c:450
+#, c-format
+msgid "argument to `%s' missing"
+msgstr ""
+
+#: f/g77spec.c:454
+msgid "No input files; unwilling to write output files"
+msgstr ""
+
+#: f/lang-options.h:33
+msgid "Print g77-specific compiler version info, run internal tests"
+msgstr ""
+
+#: f/lang-options.h:38
+msgid "Program is written in typical FORTRAN 66 dialect"
+msgstr ""
+
+#: f/lang-options.h:41
+msgid "Program is written in typical Unix f77 dialect"
+msgstr ""
+
+#: f/lang-options.h:43
+msgid "Program does not use Unix-f77 dialectal features"
+msgstr ""
+
+#: f/lang-options.h:45
+msgid "Program is written in Fortran-90-ish dialect"
+msgstr ""
+
+#: f/lang-options.h:49
+msgid ""
+"Treat local vars and COMMON blocks as if they were named in SAVE statements"
+msgstr ""
+
+#: f/lang-options.h:51
+msgid "Allow $ in symbol names"
+msgstr ""
+
+#: f/lang-options.h:55
+msgid "f2c-compatible code need not be generated"
+msgstr ""
+
+#: f/lang-options.h:58
+msgid "Unsupported; do not generate libf2c-calling code"
+msgstr ""
+
+#: f/lang-options.h:60
+msgid "Unsupported; affects code-generation of arrays"
+msgstr ""
+
+#: f/lang-options.h:63
+msgid "Program is written in Fortran-90-ish free form"
+msgstr ""
+
+#: f/lang-options.h:68
+msgid "Warn about use of (only a few for now) Fortran extensions"
+msgstr ""
+
+#: f/lang-options.h:71
+msgid "Program is written in VXT (Digital-like) FORTRAN"
+msgstr ""
+
+#: f/lang-options.h:74
+msgid "Disallow all ugly features"
+msgstr ""
+
+#: f/lang-options.h:77
+msgid "Hollerith and typeless constants not passed as arguments"
+msgstr ""
+
+#: f/lang-options.h:79
+msgid "Allow ordinary copying of ASSIGN'ed vars"
+msgstr ""
+
+#: f/lang-options.h:82
+msgid "Dummy array dimensioned to (1) is assumed-size"
+msgstr ""
+
+#: f/lang-options.h:85
+msgid "Trailing comma in procedure call denotes null argument"
+msgstr ""
+
+#: f/lang-options.h:88
+msgid "Allow REAL(Z) and AIMAG(Z) given DOUBLE COMPLEX Z"
+msgstr ""
+
+#: f/lang-options.h:92
+msgid "Initialization via DATA and PARAMETER is type-compatible"
+msgstr ""
+
+#: f/lang-options.h:94
+msgid "Allow INTEGER and LOGICAL interchangeability"
+msgstr ""
+
+#: f/lang-options.h:97
+msgid "Print internal debugging-related info"
+msgstr ""
+
+#: f/lang-options.h:100
+msgid "Initialize local vars and arrays to zero"
+msgstr ""
+
+#: f/lang-options.h:104
+msgid "Backslashes in character/hollerith constants not special (C-style)"
+msgstr ""
+
+#: f/lang-options.h:106
+msgid "Have front end emulate COMPLEX arithmetic to avoid bugs"
+msgstr ""
+
+#: f/lang-options.h:110
+msgid "Disable the appending of underscores to externals"
+msgstr ""
+
+#: f/lang-options.h:113
+msgid "Never append a second underscore to externals"
+msgstr ""
+
+#: f/lang-options.h:115
+msgid "Intrinsics spelled as e.g. SqRt"
+msgstr ""
+
+#: f/lang-options.h:117
+msgid "Intrinsics in uppercase"
+msgstr ""
+
+#: f/lang-options.h:120
+msgid "Intrinsics letters in arbitrary cases"
+msgstr ""
+
+#: f/lang-options.h:122
+msgid "Language keywords spelled as e.g. IOStat"
+msgstr ""
+
+#: f/lang-options.h:124
+msgid "Language keywords in uppercase"
+msgstr ""
+
+#: f/lang-options.h:127
+msgid "Language keyword letters in arbitrary cases"
+msgstr ""
+
+#: f/lang-options.h:129
+msgid "Internally convert most source to uppercase"
+msgstr ""
+
+#: f/lang-options.h:132
+msgid "Internally preserve source case"
+msgstr ""
+
+#: f/lang-options.h:134
+msgid "Symbol names spelled in mixed case"
+msgstr ""
+
+#: f/lang-options.h:136
+msgid "Symbol names in uppercase"
+msgstr ""
+
+#: f/lang-options.h:138
+msgid "Symbol names in lowercase"
+msgstr ""
+
+#: f/lang-options.h:141
+msgid "Program written in uppercase"
+msgstr ""
+
+#: f/lang-options.h:143
+msgid "Program written in lowercase"
+msgstr ""
+
+#: f/lang-options.h:145
+msgid "Program written in strict mixed-case"
+msgstr ""
+
+#: f/lang-options.h:147
+msgid "Compile as if program written in uppercase"
+msgstr ""
+
+#: f/lang-options.h:149
+msgid "Compile as if program written in lowercase"
+msgstr ""
+
+#: f/lang-options.h:151
+msgid "Preserve all spelling (case) used in program"
+msgstr ""
+
+#: f/lang-options.h:153
+msgid "Delete libU77 intrinsics with bad interfaces"
+msgstr ""
+
+#: f/lang-options.h:155
+msgid "Disable libU77 intrinsics with bad interfaces"
+msgstr ""
+
+#: f/lang-options.h:158
+msgid "Hide libU77 intrinsics with bad interfaces"
+msgstr ""
+
+#: f/lang-options.h:160
+msgid "Delete non-FORTRAN-77 intrinsics f2c supports"
+msgstr ""
+
+#: f/lang-options.h:162
+msgid "Disable non-FORTRAN-77 intrinsics f2c supports"
+msgstr ""
+
+#: f/lang-options.h:165
+msgid "Hide non-FORTRAN-77 intrinsics f2c supports"
+msgstr ""
+
+#: f/lang-options.h:167
+msgid "Delete non-FORTRAN-77 intrinsics F90 supports"
+msgstr ""
+
+#: f/lang-options.h:169
+msgid "Disable non-FORTRAN-77 intrinsics F90 supports"
+msgstr ""
+
+#: f/lang-options.h:172
+msgid "Hide non-FORTRAN-77 intrinsics F90 supports"
+msgstr ""
+
+#: f/lang-options.h:174
+msgid "Delete non-FORTRAN-77 intrinsics g77 supports"
+msgstr ""
+
+#: f/lang-options.h:176
+msgid "Disable non-FORTRAN 77 intrinsics F90 supports"
+msgstr ""
+
+#: f/lang-options.h:179
+msgid "Hide non-FORTRAN 77 intrinsics F90 supports"
+msgstr ""
+
+#: f/lang-options.h:181
+msgid "Delete MIL-STD 1753 intrinsics"
+msgstr ""
+
+#: f/lang-options.h:183
+msgid "Disable MIL-STD 1753 intrinsics"
+msgstr ""
+
+#: f/lang-options.h:186
+msgid "Hide MIL-STD 1753 intrinsics"
+msgstr ""
+
+#: f/lang-options.h:188
+msgid "Delete libU77 intrinsics"
+msgstr ""
+
+#: f/lang-options.h:190
+msgid "Disable libU77 intrinsics"
+msgstr ""
+
+#: f/lang-options.h:193
+msgid "Hide libU77 intrinsics"
+msgstr ""
+
+#: f/lang-options.h:195
+msgid "Delete non-FORTRAN-77 intrinsics VXT FORTRAN supports"
+msgstr ""
+
+#: f/lang-options.h:197
+msgid "Disable non-FORTRAN-77 intrinsics VXT FORTRAN supports"
+msgstr ""
+
+#: f/lang-options.h:200
+msgid "Hide non-FORTRAN-77 intrinsics VXT FORTRAN supports"
+msgstr ""
+
+#: f/lang-options.h:202
+msgid "Treat initial values of 0 like non-zero values"
+msgstr ""
+
+#: f/lang-options.h:205
+msgid ""
+"Emit special debugging information for COMMON and EQUIVALENCE (disabled)"
+msgstr ""
+
+#: f/lang-options.h:208
+msgid "Take at least one trip through each iterative DO loop"
+msgstr ""
+
+#: f/lang-options.h:212
+msgid "Print names of program units as they are compiled"
+msgstr ""
+
+#: f/lang-options.h:215
+msgid "Disable fatal diagnostics about inter-procedural problems"
+msgstr ""
+
+#: f/lang-options.h:217
+msgid "Make prefix-radix non-decimal constants be typeless"
+msgstr ""
+
+#: f/lang-options.h:220
+msgid "Generate code to check subscript and substring bounds"
+msgstr ""
+
+#: f/lang-options.h:223
+msgid "Fortran-specific form of -fbounds-check"
+msgstr ""
+
+#: f/lang-options.h:227
+msgid "Disable warnings about inter-procedural problems"
+msgstr ""
+
+#: f/lang-options.h:231
+msgid "Warn about constructs with surprising meanings"
+msgstr ""
+
+#: f/lang-options.h:236
+msgid "Add a directory for INCLUDE searching"
+msgstr ""
+
+#: f/lang-options.h:238
+msgid "Set the maximum line length"
+msgstr ""
+
+#: f/lex.c:692
+msgid "the meaning of `\\a' varies with -traditional"
+msgstr ""
+
+#: f/lex.c:708
+#, c-format
+msgid "non-ANSI-standard escape sequence, `\\%c'"
+msgstr ""
+
+#: f/lex.c:721
+#, c-format
+msgid "non-ANSI escape sequence `\\%c'"
+msgstr ""
+
+#: f/lex.c:725
+#, c-format
+msgid "unknown escape sequence `\\%c'"
+msgstr ""
+
+#: f/lex.c:727
+#, c-format
+msgid "unknown escape sequence: `\\' followed by char code 0x%x"
+msgstr ""
+
+#: f/lex.c:806
+msgid "Badly formed directive -- no closing quote"
+msgstr ""
+
+#: f/lex.c:870
+msgid "#-lines for entering and leaving files don't match"
+msgstr ""
+
+#: f/lex.c:1039
+msgid "Bad directive -- missing close-quote"
+msgstr ""
+
+#: f/lex.c:1156
+#, c-format
+msgid "ignoring pragma: %s"
+msgstr ""
+
+#: f/lex.c:1257
+msgid "undefined or invalid # directive"
+msgstr ""
+
+#: f/lex.c:1313
+msgid "invalid #line"
+msgstr ""
+
+#: f/lex.c:1369 f/lex.c:1413
+msgid "Use `#line ...' instead of `# ...' in first line"
+msgstr ""
+
+#: f/lex.c:1423
+msgid "invalid #-line"
+msgstr ""
+
+#: f/ste.c:1436 f/ste.c:1791
+msgid "ASSIGNed FORMAT specifier is too small"
+msgstr ""
+
+#: f/ste.c:3259
+msgid "ASSIGN to variable that is too small"
+msgstr ""
+
+#: f/ste.c:3297
+msgid "ASSIGNed GOTO target variable is too small"
+msgstr ""
+
+#: f/top.c:240
+#, c-format
+msgid "%s no longer supported -- try -fvxt"
+msgstr ""
+
+#: f/top.c:242
+#, c-format
+msgid "%s no longer supported -- try -fno-vxt -ff90"
+msgstr ""
+
+#: f/top.c:310 f/top.c:312
+#, c-format
+msgid "%s disabled, use normal debugging flags"
+msgstr ""
+
+#: final.c:3349
#, c-format
msgid "invalid `asm': %s"
msgstr ""
-#: final.c:3409
+#: final.c:3352
#, c-format
msgid "output_operand: %s"
msgstr ""
-#: final.c:3549
+#: final.c:3492
#, c-format
msgid "operand number missing after %-letter"
msgstr ""
-#: final.c:3551 final.c:3586
+#: final.c:3494 final.c:3529
msgid "operand number out of range"
msgstr ""
-#: final.c:3600
-#, ycp-format
+#: final.c:3543
+#, c-format
msgid "invalid %%-code"
msgstr ""
-#: final.c:3627
+#: final.c:3570
msgid "`%l' operand isn't a label"
msgstr ""
-#: flow.c:3575
-msgid "ICE: would have deleted prologue/epilogue insn"
+#: flow.c:541
+msgid "function might be possible candidate for attribute `noreturn'"
+msgstr ""
+
+#: flow.c:546
+msgid "`noreturn' function does return"
+msgstr ""
+
+#: flow.c:567
+msgid "control reaches end of non-void function"
msgstr ""
-#: flow.c:6620
+#: flow.c:6646
#, c-format
msgid "End insn %d for block %d not found in the insn stream."
msgstr ""
-#: flow.c:6634
+#: flow.c:6660
#, c-format
msgid "Insn %d is in multiple basic blocks (%d and %d)"
msgstr ""
-#: flow.c:6645
+#: flow.c:6671
#, c-format
msgid "Head insn %d for block %d not found in the insn stream."
msgstr ""
-#: flow.c:6682 flow.c:6709
+#: flow.c:6708 flow.c:6735
#, c-format
msgid "Basic block %i edge lists are corrupted"
msgstr ""
-#: flow.c:6694
+#: flow.c:6720
#, c-format
msgid "Basic block %d pred edge is corrupted"
msgstr ""
-#: flow.c:6724
+#: flow.c:6750
#, c-format
msgid "NOTE_INSN_BASIC_BLOCK is missing for block %d"
msgstr ""
-#: flow.c:6732
+#: flow.c:6758
#, c-format
msgid "NOTE_INSN_BASIC_BLOCK is missing for block %d\n"
msgstr ""
-#: flow.c:6748
+#: flow.c:6774
#, c-format
msgid "NOTE_INSN_BASIC_BLOCK %d in the middle of basic block %d"
msgstr ""
-#: flow.c:6760
+#: flow.c:6786
#, c-format
msgid "In basic block %d:"
msgstr ""
-#: flow.c:6779
-msgid "Basic blocks not numbered consecutively"
-msgstr ""
-
-#: flow.c:6819
+#: flow.c:6848
#, c-format
msgid "number of bb notes in insn chain (%d) != n_basic_blocks (%d)"
msgstr ""
-#: fold-const.c:3016 fold-const.c:3029
+#: fold-const.c:3013 fold-const.c:3026
#, c-format
msgid "comparison is always %d due to width of bitfield"
msgstr ""
-#: fold-const.c:4071 fold-const.c:4088
+#: fold-const.c:4069 fold-const.c:4086
#, c-format
msgid "comparison is always %d"
msgstr ""
-#: fold-const.c:4219
+#: fold-const.c:4217
msgid "`or' of unmatched not-equal tests is always 1"
msgstr ""
-#: fold-const.c:4224
+#: fold-const.c:4222
msgid "`and' of mutually exclusive equal-tests is always 0"
msgstr ""
-#: function.c:5223
+#: function.c:5390
#, c-format
msgid "`%s' might be used uninitialized in this function"
msgstr ""
-#: function.c:5230
+#: function.c:5397
#, c-format
msgid "variable `%s' might be clobbered by `longjmp' or `vfork'"
msgstr ""
-#: function.c:5249
+#: function.c:5416
#, c-format
msgid "argument `%s' might be clobbered by `longjmp' or `vfork'"
msgstr ""
-#: function.c:6009
+#: function.c:6216
msgid "function returns an aggregate"
msgstr ""
-#: function.c:6518
+#: function.c:6745
#, c-format
msgid "unused parameter `%s'"
msgstr ""
-#: gcc.c:901
+#: gcc.c:954
#, c-format
msgid "Ambiguous abbreviation %s"
msgstr ""
-#: gcc.c:928
+#: gcc.c:981
#, c-format
msgid "Incomplete `%s' option"
msgstr ""
-#: gcc.c:939
+#: gcc.c:992
#, c-format
msgid "Missing argument to `%s' option"
msgstr ""
-#: gcc.c:952
+#: gcc.c:1005
#, c-format
msgid "Extraneous argument to `%s' option"
msgstr ""
-#: gcc.c:1123
+#: gcc.c:1308
msgid "Using builtin specs.\n"
msgstr ""
-#: gcc.c:1203
+#: gcc.c:1474
#, c-format
msgid ""
"Setting spec %s to '%s'\n"
"\n"
msgstr ""
-#: gcc.c:1394
+#: gcc.c:1572
#, c-format
msgid "Reading specs from %s\n"
msgstr ""
-#: gcc.c:1491 gcc.c:1509
+#: gcc.c:1670 gcc.c:1689
+#, c-format
msgid "specs %%include syntax malformed after %ld characters"
msgstr ""
-#: gcc.c:1517
+#: gcc.c:1697
#, c-format
msgid "Could not find specs file %s\n"
msgstr ""
-#: gcc.c:1533 gcc.c:1541 gcc.c:1550 gcc.c:1559
+#: gcc.c:1713 gcc.c:1721 gcc.c:1730 gcc.c:1739
+#, c-format
msgid "specs %%rename syntax malformed after %ld characters"
msgstr ""
-#: gcc.c:1568
+#: gcc.c:1748
#, c-format
msgid "specs %s spec was not found to be renamed"
msgstr ""
-#: gcc.c:1575
+#: gcc.c:1755
#, c-format
msgid "rename spec %s to %s\n"
msgstr ""
-#: gcc.c:1577
+#: gcc.c:1757
#, c-format
msgid ""
"spec is '%s'\n"
"\n"
msgstr ""
-#: gcc.c:1590
+#: gcc.c:1770
+#, c-format
msgid "specs unknown %% command after %ld characters"
msgstr ""
-#: gcc.c:1601 gcc.c:1614
+#: gcc.c:1781 gcc.c:1794
#, c-format
msgid "specs file malformed after %ld characters"
msgstr ""
-#: gcc.c:1668
+#: gcc.c:1848
msgid "spec file has no spec for linking"
msgstr ""
-#: gcc.c:2436
+#: gcc.c:2609
msgid "-pipe not supported"
msgstr ""
-#: gcc.c:2472
+#: gcc.c:2645
msgid ""
"\n"
"Go ahead? (y or n) "
msgstr ""
-#: gcc.c:2571
+#: gcc.c:2744
#, c-format
msgid ""
"Internal error: %s (program %s)\n"
@@ -8615,161 +10247,166 @@ msgid ""
"See %s for instructions."
msgstr ""
-#: gcc.c:2589
+#: gcc.c:2762
#, c-format
msgid "# %s %.2f %.2f\n"
msgstr ""
-#: gcc.c:2716
+#: gcc.c:2890
#, c-format
msgid "Usage: %s [options] file...\n"
msgstr ""
-#: gcc.c:2717
+#: gcc.c:2891
msgid "Options:\n"
msgstr ""
-#: gcc.c:2719
+#: gcc.c:2893
msgid " -pass-exit-codes Exit with highest error code from a phase\n"
msgstr ""
-#: gcc.c:2720
+#: gcc.c:2894
msgid " --help Display this information\n"
msgstr ""
-#: gcc.c:2722
+#: gcc.c:2895
+msgid ""
+" --target-help Display target specific command line options\n"
+msgstr ""
+
+#: gcc.c:2897
msgid " (Use '-v --help' to display command line options of sub-processes)\n"
msgstr ""
-#: gcc.c:2723
+#: gcc.c:2898
msgid " -dumpspecs Display all of the built in spec strings\n"
msgstr ""
-#: gcc.c:2724
+#: gcc.c:2899
msgid " -dumpversion Display the version of the compiler\n"
msgstr ""
-#: gcc.c:2725
+#: gcc.c:2900
msgid " -dumpmachine Display the compiler's target processor\n"
msgstr ""
-#: gcc.c:2726
+#: gcc.c:2901
msgid ""
" -print-search-dirs Display the directories in the compiler's search "
"path\n"
msgstr ""
-#: gcc.c:2727
+#: gcc.c:2902
msgid ""
" -print-libgcc-file-name Display the name of the compiler's companion "
"library\n"
msgstr ""
-#: gcc.c:2728
+#: gcc.c:2903
msgid " -print-file-name=<lib> Display the full path to library <lib>\n"
msgstr ""
-#: gcc.c:2729
+#: gcc.c:2904
msgid ""
" -print-prog-name=<prog> Display the full path to compiler component "
"<prog>\n"
msgstr ""
-#: gcc.c:2730
+#: gcc.c:2905
msgid ""
" -print-multi-directory Display the root directory for versions of "
"libgcc\n"
msgstr ""
-#: gcc.c:2731
+#: gcc.c:2906
msgid ""
" -print-multi-lib Display the mapping between command line options "
"and\n"
" multiple library search directories\n"
msgstr ""
-#: gcc.c:2734
+#: gcc.c:2909
msgid ""
" -Wa,<options> Pass comma-separated <options> on to the "
"assembler\n"
msgstr ""
-#: gcc.c:2735
+#: gcc.c:2910
msgid ""
" -Wp,<options> Pass comma-separated <options> on to the "
"preprocessor\n"
msgstr ""
-#: gcc.c:2736
+#: gcc.c:2911
msgid ""
" -Wl,<options> Pass comma-separated <options> on to the linker\n"
msgstr ""
-#: gcc.c:2737
+#: gcc.c:2912
msgid " -Xlinker <arg> Pass <arg> on to the linker\n"
msgstr ""
-#: gcc.c:2738
+#: gcc.c:2913
msgid " -save-temps Do not delete intermediate files\n"
msgstr ""
-#: gcc.c:2739
+#: gcc.c:2914
msgid " -pipe Use pipes rather than intermediate files\n"
msgstr ""
-#: gcc.c:2740
+#: gcc.c:2915
msgid " -time Time the execution of each subprocess\n"
msgstr ""
-#: gcc.c:2741
+#: gcc.c:2916
msgid ""
" -specs=<file> Override builtin specs with the contents of "
"<file>\n"
msgstr ""
-#: gcc.c:2742
+#: gcc.c:2917
msgid ""
" -std=<standard> Assume that the input sources are for <standard>\n"
msgstr ""
-#: gcc.c:2743
+#: gcc.c:2918
msgid ""
" -B <directory> Add <directory> to the compiler's search paths\n"
msgstr ""
-#: gcc.c:2744
+#: gcc.c:2919
msgid " -b <machine> Run gcc for target <machine>, if installed\n"
msgstr ""
-#: gcc.c:2745
+#: gcc.c:2920
msgid ""
" -V <version> Run gcc version number <version>, if installed\n"
msgstr ""
-#: gcc.c:2746
+#: gcc.c:2921
msgid ""
" -v Display the programs invoked by the compiler\n"
msgstr ""
-#: gcc.c:2747
+#: gcc.c:2922
msgid ""
" -E Preprocess only; do not compile, assemble or "
"link\n"
msgstr ""
-#: gcc.c:2748
+#: gcc.c:2923
msgid " -S Compile only; do not assemble or link\n"
msgstr ""
-#: gcc.c:2749
+#: gcc.c:2924
msgid " -c Compile and assemble, but do not link\n"
msgstr ""
-#: gcc.c:2750
+#: gcc.c:2925
msgid " -o <file> Place the output into <file>\n"
msgstr ""
-#: gcc.c:2751
+#: gcc.c:2926
msgid ""
" -x <language> Specify the language of the following input "
"files\n"
@@ -8780,555 +10417,1216 @@ msgid ""
"extension\n"
msgstr ""
-#: gcc.c:2758
+#: gcc.c:2933
#, c-format
msgid ""
"\n"
-"Options starting with -g, -f, -m, -O or -W are automatically passed on to\n"
-"the various sub-processes invoked by %s. In order to pass other options\n"
-"on to these processes the -W<letter> options must be used.\n"
+"Options starting with -g, -f, -m, -O, -W, or --param are automatically\n"
+" passed on to the various sub-processes invoked by %s. In order to pass\n"
+" other options on to these processes the -W<letter> options must be used.\n"
msgstr ""
-#: gcc.c:3106
+#: gcc.c:3300
msgid "argument to `-Xlinker' is missing"
msgstr ""
-#: gcc.c:3123
+#: gcc.c:3317
msgid "argument to `-specs' is missing"
msgstr ""
-#: gcc.c:3138
+#: gcc.c:3332
msgid "argument to `-specs=' is missing"
msgstr ""
-#: gcc.c:3160
+#: gcc.c:3354
msgid "argument to `-b' is missing"
msgstr ""
-#: gcc.c:3173
+#: gcc.c:3367
msgid "argument to `-B' is missing"
msgstr ""
-#: gcc.c:3226
+#: gcc.c:3420
msgid "argument to `-V' is missing"
msgstr ""
-#: gcc.c:3247 gcc.c:3254 gcc.c:3261
+#: gcc.c:3441 gcc.c:3448 gcc.c:3455
msgid "invalid version number format"
msgstr ""
-#: gcc.c:3332
+#: gcc.c:3566
msgid "cannot specify -o with -c or -S and multiple compilations"
msgstr ""
-#: gcc.c:3501
-msgid "Warning: -pipe ignored since -save-temps specified"
+#: gcc.c:3762
+msgid "Warning: -pipe ignored because -save-temps specified"
msgstr ""
-#: gcc.c:3505
-msgid "Warning: -pipe ignored since -time specified"
+#: gcc.c:3766
+msgid "Warning: -pipe ignored because -time specified"
msgstr ""
-#: gcc.c:3515
+#: gcc.c:3776
msgid "argument to `-x' is missing"
msgstr ""
-#: gcc.c:3543
+#: gcc.c:3804
#, c-format
msgid "argument to `-%s' is missing"
msgstr ""
-#: gcc.c:3603
+#: gcc.c:3867
#, c-format
msgid "Warning: `-x %s' after last input file has no effect"
msgstr ""
-#: gcc.c:3800
+#: gcc.c:4072
msgid "Invalid specification! Bug in cc."
msgstr ""
+#: gcc.c:4221
+#, c-format
+msgid "%s\n"
+msgstr ""
+
#. Catch the case where a spec string contains something like
#. '%{foo:%*}'. ie there is no * in the pattern on the left
#. hand side of the :.
-#: gcc.c:4409
-#, ycp-format
+#: gcc.c:4738
+#, c-format
msgid "Spec failure: '%%*' has not been initialised by pattern match"
msgstr ""
-#: gcc.c:4418
-#, ycp-format
+#: gcc.c:4747
+#, c-format
msgid "Warning: use of obsolete %%[ operator in specs"
msgstr ""
-#: gcc.c:4436
+#: gcc.c:4765
#, c-format
msgid "Processing spec %c%s%c, which is '%s'\n"
msgstr ""
-#: gcc.c:4560
+#: gcc.c:4890
#, c-format
msgid "Spec failure: Unrecognised spec option '%c'"
msgstr ""
-#: gcc.c:5348
+#: gcc.c:5744
#, c-format
msgid "unrecognized option `-%s'"
msgstr ""
-#: gcc.c:5354
+#: gcc.c:5750
#, c-format
msgid "install: %s%s\n"
msgstr ""
-#: gcc.c:5355
+#: gcc.c:5751
#, c-format
msgid "programs: %s\n"
msgstr ""
-#: gcc.c:5356
+#: gcc.c:5752
#, c-format
msgid "libraries: %s\n"
msgstr ""
-#: gcc.c:5394
+#: gcc.c:5800
msgid ""
"\n"
"For bug reporting instructions, please see:\n"
msgstr ""
-#: gcc.c:5418
+#: gcc.c:5816
+#, c-format
+msgid "Configured with: %s\n"
+msgstr ""
+
+#: gcc.c:5830
+#, c-format
+msgid "Thread model: %s\n"
+msgstr ""
+
+#: gcc.c:5841
#, c-format
msgid "gcc version %s\n"
msgstr ""
-#: gcc.c:5420
+#: gcc.c:5843
#, c-format
msgid "gcc driver version %s executing gcc version %s\n"
msgstr ""
-#: gcc.c:5428
+#: gcc.c:5851
msgid "No input files"
msgstr ""
-#: gcc.c:5465
+#: gcc.c:5888
#, c-format
msgid "%s: %s compiler not installed on this system"
msgstr ""
-#: gcc.c:5535
+#: gcc.c:5958
#, c-format
-msgid "%s: linker input file unused since linking not done"
+msgid "%s: linker input file unused because linking not done"
msgstr ""
-#: gcc.c:5578
+#: gcc.c:6001
#, c-format
msgid "language %s not recognized"
msgstr ""
-#: gcov.c:292
+#: gcc.c:6104
+msgid "Internal gcc abort."
+msgstr ""
+
+#: gcov.c:299
msgid "Internal gcov abort.\n"
msgstr ""
-#: gcov.c:301
+#: gcov.c:308
msgid "gcov [-b] [-v] [-n] [-l] [-f] [-o OBJDIR] file\n"
msgstr ""
-#: gcov.c:421
+#: gcov.c:428
#, c-format
msgid "Could not open basic block file %s.\n"
msgstr ""
-#: gcov.c:430
+#: gcov.c:437
#, c-format
msgid "Could not open data file %s.\n"
msgstr ""
-#: gcov.c:431
+#: gcov.c:438
msgid "Assuming that all execution counts are zero.\n"
msgstr ""
-#: gcov.c:437
+#: gcov.c:444
#, c-format
msgid "Could not open program flow graph file %s.\n"
msgstr ""
-#: gcov.c:448
+#: gcov.c:455
#, c-format
msgid "No executable code associated with file %s.\n"
msgstr ""
-#: gcov.c:747 profile.c:978
+#: gcov.c:754 profile.c:977
msgid ".da file contents exhausted too early\n"
msgstr ""
-#: gcov.c:750 profile.c:981
+#: gcov.c:757 profile.c:980
msgid ".da file contents not exhausted\n"
msgstr ""
-#: gcov.c:931
+#: gcov.c:938
+#, c-format
msgid "%6.2f%% of %d source lines executed in function %s\n"
msgstr ""
-#: gcov.c:935
+#: gcov.c:942
#, c-format
msgid "No executable source lines in function %s\n"
msgstr ""
-#: gcov.c:942
+#: gcov.c:949
+#, c-format
msgid "%6.2f%% of %d branches executed in function %s\n"
msgstr ""
-#: gcov.c:946
+#: gcov.c:953
+#, c-format
msgid "%6.2f%% of %d branches taken at least once in function %s\n"
msgstr ""
-#: gcov.c:951
+#: gcov.c:958
#, c-format
msgid "No branches in function %s\n"
msgstr ""
-#: gcov.c:953
+#: gcov.c:960
+#, c-format
msgid "%6.2f%% of %d calls executed in function %s\n"
msgstr ""
-#: gcov.c:957
+#: gcov.c:964
#, c-format
msgid "No calls in function %s\n"
msgstr ""
-#: gcov.c:1089
+#: gcov.c:1096
#, c-format
msgid "didn't use all bb entries of graph, function %s\n"
msgstr ""
-#: gcov.c:1091
+#: gcov.c:1098
#, c-format
msgid "block_num = %ld, num_blocks = %d\n"
msgstr ""
-#: gcov.c:1129
+#: gcov.c:1136
#, c-format
msgid "ERROR: too many basic blocks in .bb file %s\n"
msgstr ""
-#: gcov.c:1206
+#: gcov.c:1213
+#, c-format
msgid "%6.2f%% of %d source lines executed in file %s\n"
msgstr ""
-#: gcov.c:1210
+#: gcov.c:1217
#, c-format
msgid "No executable source lines in file %s\n"
msgstr ""
-#: gcov.c:1217
+#: gcov.c:1224
+#, c-format
msgid "%6.2f%% of %d branches executed in file %s\n"
msgstr ""
-#: gcov.c:1221
+#: gcov.c:1228
+#, c-format
msgid "%6.2f%% of %d branches taken at least once in file %s\n"
msgstr ""
-#: gcov.c:1226
+#: gcov.c:1233
#, c-format
msgid "No branches in file %s\n"
msgstr ""
-#: gcov.c:1228
+#: gcov.c:1235
+#, c-format
msgid "%6.2f%% of %d calls executed in file %s\n"
msgstr ""
-#: gcov.c:1232
+#: gcov.c:1239
#, c-format
msgid "No calls in file %s\n"
msgstr ""
-#: gcov.c:1244
+#: gcov.c:1251
#, c-format
msgid "Could not open source file %s.\n"
msgstr ""
-#: gcov.c:1294
+#: gcov.c:1301
#, c-format
msgid "Could not open output file %s.\n"
msgstr ""
-#: gcov.c:1302
+#: gcov.c:1309
#, c-format
msgid "Creating %s.\n"
msgstr ""
-#: gcov.c:1346
+#: gcov.c:1353
#, c-format
msgid "call %d never executed\n"
msgstr ""
-#: gcov.c:1351
+#: gcov.c:1358
#, c-format
msgid "call %d returns = %d\n"
msgstr ""
-#: gcov.c:1355
+#: gcov.c:1362
+#, c-format
msgid "call %d returns = %d%%\n"
msgstr ""
-#: gcov.c:1363
+#: gcov.c:1370
#, c-format
msgid "branch %d never executed\n"
msgstr ""
-#: gcov.c:1369
+#: gcov.c:1376
#, c-format
msgid "branch %d taken = %d\n"
msgstr ""
-#: gcov.c:1373
+#: gcov.c:1380
+#, c-format
msgid "branch %d taken = %d%%\n"
msgstr ""
-#: gcov.c:1387
+#: gcov.c:1394
#, c-format
msgid "Unexpected EOF while reading source file %s.\n"
msgstr ""
-#: ../libiberty/getopt.c:682
+#: gcse.c:691
#, c-format
-msgid "%s: option `%s' is ambiguous\n"
+msgid "GCSE disabled: %d > 1000 basic blocks and %d >= 20 edges/basic block"
+msgstr ""
+
+#: gcse.c:703
+#, c-format
+msgid "GCSE disabled: %d basic blocks and %d registers"
+msgstr ""
+
+#: haifa-sched.c:193
+#, c-format
+msgid "fix_sched_param: unknown param: %s"
+msgstr ""
+
+#: integrate.c:142
+msgid "function cannot be inline"
+msgstr ""
+
+#: integrate.c:147
+msgid "varargs function cannot be inline"
+msgstr ""
+
+#: integrate.c:150
+msgid "function using alloca cannot be inline"
+msgstr ""
+
+#: integrate.c:153
+msgid "function using setjmp cannot be inline"
+msgstr ""
+
+#: integrate.c:156
+msgid "function uses __builtin_eh_return"
+msgstr ""
+
+#: integrate.c:159
+msgid "function with nested functions cannot be inline"
+msgstr ""
+
+#: integrate.c:163
+msgid "function with label addresses used in initializers cannot inline"
+msgstr ""
+
+#: integrate.c:170 integrate.c:214
+msgid "function too large to be inline"
+msgstr ""
+
+#: integrate.c:180
+msgid "no prototype, and parameter address used; cannot be inline"
+msgstr ""
+
+#: integrate.c:187 integrate.c:232
+msgid "inline functions not supported for this return value type"
+msgstr ""
+
+#: integrate.c:192
+msgid "function with varying-size return value cannot be inline"
msgstr ""
-#: ../libiberty/getopt.c:707
+#: integrate.c:199
+msgid "function with varying-size parameter cannot be inline"
+msgstr ""
+
+#: integrate.c:202
+msgid "function with transparent unit parameter cannot be inline"
+msgstr ""
+
+#: integrate.c:221
+msgid "function with computed jump cannot inline"
+msgstr ""
+
+#: integrate.c:225
+msgid "function with nonlocal goto cannot be inline"
+msgstr ""
+
+#: integrate.c:240
+msgid "function with target specific attribute(s) cannot be inlined"
+msgstr ""
+
+#: java/check-init.c:731
#, c-format
-msgid "%s: option `--%s' doesn't allow an argument\n"
+msgid "internal error in check-init: tree code not implemented: %s"
msgstr ""
-#: ../libiberty/getopt.c:712
+#: java/class.c:543 java/class.c:568
+msgid "internal error - too many interface type"
+msgstr ""
+
+#: java/class.c:702
+msgid "bad method signature"
+msgstr ""
+
+#: java/class.c:747
+msgid "misplaced ConstantValue attribute (not in any field)"
+msgstr ""
+
+#: java/class.c:749
#, c-format
-msgid "%s: option `%c%s' doesn't allow an argument\n"
+msgid "duplicate ConstanValue atribute for field '%s'"
msgstr ""
-#: ../libiberty/getopt.c:730 ../libiberty/getopt.c:903
+#: java/class.c:995
#, c-format
-msgid "%s: option `%s' requires an argument\n"
+msgid "field '%s' not found in class"
+msgstr ""
+
+#: java/class.c:1203
+msgid "abstract method in non-abstract class"
msgstr ""
-#. --option
-#: ../libiberty/getopt.c:759
+#: java/class.c:1820
#, c-format
-msgid "%s: unrecognized option `--%s'\n"
+msgid "non-static method '%s' overrides static method"
msgstr ""
-#. +option or -option
-#: ../libiberty/getopt.c:763
+#: java/decl.c:1475
#, c-format
-msgid "%s: unrecognized option `%c%s'\n"
+msgid "In %s: overlapped variable and exception ranges at %d"
+msgstr ""
+
+#: java/decl.c:1563
+msgid "bad type in parameter debug info"
msgstr ""
-#. 1003.2 specifies the format of this message.
-#: ../libiberty/getopt.c:789
+#: java/decl.c:1573
#, c-format
-msgid "%s: illegal option -- %c\n"
+msgid "bad PC range for debug info for local `%s'"
msgstr ""
-#: ../libiberty/getopt.c:792
+#: java/expr.c:553
+msgid "stack underflow - dup* operation"
+msgstr ""
+
+#: java/expr.c:1444
#, c-format
-msgid "%s: invalid option -- %c\n"
+msgid ""
+"reference `%s' is ambiguous: appears in interface `%s' and interface `%s'"
msgstr ""
-#. 1003.2 specifies the format of this message.
-#: ../libiberty/getopt.c:822 ../libiberty/getopt.c:952
+#: java/expr.c:1473
#, c-format
-msgid "%s: option requires an argument -- %c\n"
+msgid "field `%s' not found"
msgstr ""
-#: ../libiberty/getopt.c:869
+#: java/expr.c:1624
+msgid "ret instruction not implemented"
+msgstr ""
+
+#: java/expr.c:1750
#, c-format
-msgid "%s: option `-W %s' is ambiguous\n"
+msgid "method '%s' not found in class"
msgstr ""
-#: ../libiberty/getopt.c:887
+#: java/expr.c:1885
#, c-format
-msgid "%s: option `-W %s' doesn't allow an argument\n"
+msgid "failed to find class '%s'"
msgstr ""
-#: haifa-sched.c:232
+#: java/expr.c:1897
#, c-format
-msgid "fix_sched_param: unknown param: %s"
+msgid "Class '%s' has no method named '%s' matching signature '%s'"
msgstr ""
-#: hash.c:52 hash.c:59 hash.c:162 hash.c:239
-msgid "no memory"
+#: java/expr.c:1907
+msgid "invokestatic on non static method"
msgstr ""
-#: integrate.c:153
-msgid "varargs function cannot be inline"
+#: java/expr.c:1912
+msgid "invokestatic on abstract method"
msgstr ""
-#: integrate.c:156
-msgid "function using alloca cannot be inline"
+#: java/expr.c:1920
+msgid "invoke[non-static] on static method"
msgstr ""
-#: integrate.c:159
-msgid "function using setjmp cannot be inline"
+#: java/expr.c:2208
+#, c-format
+msgid "Missing field '%s' in '%s'"
msgstr ""
-#: integrate.c:162
-msgid "function with nested functions cannot be inline"
+#: java/expr.c:2214
+#, c-format
+msgid "Mismatching signature for field '%s' in '%s'"
msgstr ""
-#: integrate.c:166
-msgid "function with label addresses used in initializers cannot inline"
+#: java/expr.c:2253
+#, c-format
+msgid "assignment to final field `%s' not in field's class"
msgstr ""
-#: integrate.c:173 integrate.c:217
-msgid "function too large to be inline"
+#: java/expr.c:2258
+#, c-format
+msgid "assignment to final static field `%s' not in class initializer"
msgstr ""
-#: integrate.c:183
-msgid "no prototype, and parameter address used; cannot be inline"
+#: java/expr.c:2265
+#, c-format
+msgid "assignment to final field `%s' not in constructor"
msgstr ""
-#: integrate.c:190 integrate.c:246
-msgid "inline functions not supported for this return value type"
+#: java/expr.c:2519
+#, c-format
+msgid "Can't expand %s"
msgstr ""
-#: integrate.c:195
-msgid "function with varying-size return value cannot be inline"
+#: java/expr.c:2695
+msgid "invalid PC in line number table"
msgstr ""
-#: integrate.c:202
-msgid "function with varying-size parameter cannot be inline"
+#. We've just reached the end of a region of dead code.
+#: java/expr.c:2740
+#, c-format
+msgid "Unreachable bytecode from %d to before %d."
msgstr ""
-#: integrate.c:205
-msgid "function with transparent unit parameter cannot be inline"
+#. We've just reached the end of a region of dead code.
+#: java/expr.c:2777
+#, c-format
+msgid "Unreachable bytecode from %d to the end of the method."
msgstr ""
-#: integrate.c:224
-msgid "function with computed jump cannot inline"
+#. duplicate code from LOAD macro
+#: java/expr.c:3096
+msgid "unrecogized wide sub-instruction"
msgstr ""
-#: integrate.c:228
-msgid "function with nonlocal goto cannot be inline"
+#: java/jcf-io.c:416
+#, c-format
+msgid ""
+"Source file for class `%s' is newer than its matching class file. Source "
+"file used instead"
msgstr ""
-#: integrate.c:240
-msgid "function with complex parameters cannot be inline"
+#: java/jcf-parse.c:375
+msgid "bad string constant"
msgstr ""
-#: integrate.c:253
-msgid "function with target specific attribute(s) cannot be inlined"
+#: java/jcf-parse.c:431
+#, c-format
+msgid "bad value constant type %d, index %d"
+msgstr ""
+
+#: java/jcf-parse.c:601
+#, c-format
+msgid "can't reopen %s"
msgstr ""
-#: objc/objc-act.c:760
-msgid "Objective-C text in C source file"
+#: java/jcf-parse.c:663
+#, c-format
+msgid "Cannot find file for class %s."
msgstr ""
-#: objc/objc-act.c:814
+#: java/jcf-parse.c:675
+msgid "not a valid Java .class file"
+msgstr ""
+
+#: java/jcf-parse.c:678
+msgid "error while parsing constant pool"
+msgstr ""
+
+#: java/jcf-parse.c:681
+#, c-format
+msgid "error in constant pool entry #%d\n"
+msgstr ""
+
+#. FIXME - where was first time
+#: java/jcf-parse.c:693
+#, c-format
+msgid "reading class %s for the second time from %s"
+msgstr ""
+
+#: java/jcf-parse.c:711
+msgid "error while parsing fields"
+msgstr ""
+
+#: java/jcf-parse.c:714
+msgid "error while parsing methods"
+msgstr ""
+
+#: java/jcf-parse.c:717
+msgid "error while parsing final attributes"
+msgstr ""
+
+#: java/jcf-parse.c:731
+#, c-format
+msgid ""
+"The `java.lang.Object' that was found in `%s' didn't have the special zero-"
+"length `gnu.gcj.gcj-compiled' attribute. This generally means that your "
+"classpath is incorrect set. Use `info gcj \"Input Options\"' to see the info "
+"page describing how to set the classpath."
+msgstr ""
+
+#: java/jcf-parse.c:804
+msgid "missing Code attribute"
+msgstr ""
+
+#: java/jcf-parse.c:948 toplev.c:2511
+#, c-format
+msgid "error closing %s"
+msgstr ""
+
+#: java/jcf-parse.c:1029
+msgid "source file seen twice on command line and will be compiled only once."
+msgstr ""
+
+#: java/jcf-parse.c:1045
+msgid "no input file specified"
+msgstr ""
+
+#: java/jcf-parse.c:1061
+#, c-format
+msgid "can't close input file %s"
+msgstr ""
+
+#: java/jcf-parse.c:1075
+#, c-format
+msgid "Premature end of input file %s"
+msgstr ""
+
+#: java/jcf-parse.c:1098
+#, c-format
+msgid "bad zip/jar file %s"
+msgstr ""
+
+#: java/jcf-write.c:2597
+#, c-format
+msgid ""
+"internal error in generate_bytecode_insn - tree code not implemented: %s"
+msgstr ""
+
+#: java/jcf-write.c:3307
+#, c-format
+msgid "can't create directory %s"
+msgstr ""
+
+#: java/jcf-write.c:3334
+#, c-format
+msgid "can't to open %s"
+msgstr ""
+
+#: java/jv-scan.c:183
+msgid "Only one of `--print-main', `--list-class', and `--complexity' allowed"
+msgstr ""
+
+#: java/jv-scan.c:186
+#, c-format
+msgid "Can't open output file `%s'"
+msgstr ""
+
+#: java/jv-scan.c:222
+#, c-format
+msgid "File not found `%s'"
+msgstr ""
+
+#: java/jvspec.c:360
+msgid "can't specify `-D' without `--main'\n"
+msgstr ""
+
+#: java/jvspec.c:368
+msgid "Warning: already-compiled .class files ignored with -C"
+msgstr ""
+
+#: java/jvspec.c:375
+msgid "cannot specify both -C and -o"
+msgstr ""
+
+#: java/jvspec.c:387
+msgid "cannot create temporary file"
+msgstr ""
+
+#: java/jvspec.c:415
+msgid "using both @FILE with multiple files not implemented"
+msgstr ""
+
+#: java/jvspec.c:456
+msgid "cannot specify `main' class when not linking"
+msgstr ""
+
+#: java/lang-options.h:32
+msgid "Disable automatic array bounds checking"
+msgstr ""
+
+#: java/lang-options.h:34
+msgid "Make is_compiled_class return 1"
+msgstr ""
+
+#: java/lang-options.h:38
+msgid "Dump class files to <name>.class"
+msgstr ""
+
+#: java/lang-options.h:40
+msgid "input file is list of file names to compile"
+msgstr ""
+
+#: java/lang-options.h:42
+msgid "Generate code for Boehm GC"
+msgstr ""
+
+#: java/lang-options.h:44
+msgid "Don't put synchronization structure in each object"
+msgstr ""
+
+#: java/lang-options.h:46
+msgid "Assume native functions are implemented using JNI"
+msgstr ""
+
+#: java/lang-options.h:48
+msgid "Set class path and suppress system path"
+msgstr ""
+
+#: java/lang-options.h:50
+msgid "Set class path"
+msgstr ""
+
+#: java/lang-options.h:52
+msgid "Choose class whose main method should be used"
+msgstr ""
+
+#: java/lang-options.h:54
+msgid "Choose input encoding (default is UTF-8)"
+msgstr ""
+
+#: java/lang-options.h:56
+msgid "Add directory to class path"
+msgstr ""
+
+#: java/lang-options.h:58
+msgid "Directory where class files should be written"
+msgstr ""
+
+#: java/lang-options.h:61
+msgid "Use built-in instructions for division"
+msgstr ""
+
+#: java/lang-options.h:63
+msgid "Warn if modifiers are specified when not necessary"
+msgstr ""
+
+#: java/lang-options.h:65
+msgid "Warn if deprecated empty statements are found"
+msgstr ""
+
+#: java/lang-options.h:67
+msgid "Warn if .class files are out of date"
+msgstr ""
+
+#: java/lang-options.h:69
+msgid "Always check for non gcj generated classes archives"
+msgstr ""
+
+#: java/lang.c:387
+msgid "can't do dependency tracking with input from stdin"
+msgstr ""
+
+#: java/lang.c:403
+msgid "couldn't determine target name for dependency tracking"
+msgstr ""
+
+#: java/lex.c:297
+#, c-format
+msgid ""
+"unknown encoding: `%s'\n"
+"This might mean that your locale's encoding is not supported\n"
+"by your system's iconv(3) implementation. If you aren't trying\n"
+"to use a particular encoding for your input file, try the\n"
+"`--encoding=UTF-8' option."
+msgstr ""
+
+#: java/mangle.c:85
+#, c-format
+msgid "Can't mangle %s"
+msgstr ""
+
+#: java/mangle_name.c:151 java/mangle_name.c:228
+msgid "internal error - invalid Utf8 name"
+msgstr ""
+
+#: java/parse.y:737 java/parse.y:775
+msgid "Missing name"
+msgstr ""
+
+#: java/parse.y:739 java/parse.y:777 java/parse.y:796 java/parse.y:977
+#: java/parse.y:1324 java/parse.y:1527 java/parse.y:1529 java/parse.y:1758
+#: java/parse.y:1784 java/parse.y:1795 java/parse.y:1806 java/parse.y:1818
+msgid "';' expected"
+msgstr ""
+
+#: java/parse.y:794
+msgid "'*' expected"
+msgstr ""
+
+#: java/parse.y:808
+msgid "Class or interface declaration expected"
+msgstr ""
+
+#: java/parse.y:843 java/parse.y:845
+msgid "Missing class name"
+msgstr ""
+
+#: java/parse.y:848 java/parse.y:852 java/parse.y:860 java/parse.y:1022
+#: java/parse.y:1270 java/parse.y:1272 java/parse.y:1593 java/parse.y:1829
+#: java/parse.y:1861 java/parse.y:1913
+msgid "'{' expected"
+msgstr ""
+
+#: java/parse.y:862
+msgid "Missing super class name"
+msgstr ""
+
+#: java/parse.y:872 java/parse.y:888
+msgid "Missing interface name"
+msgstr ""
+
+#. That's for ()
+#: java/parse.y:956 java/parse.y:1289 java/parse.y:1348 java/parse.y:1551
+#: java/parse.y:1773 java/parse.y:1782 java/parse.y:1793 java/parse.y:1804
+#: java/parse.y:1816 java/parse.y:1833 java/parse.y:1835 java/parse.y:1906
+#: java/parse.y:2077 java/parse.y:2138 java/parse.y:2292 java/parse.y:2294
+#: java/parse.y:2301 java/parse.y:2308 java/parse.y:2319 java/parse.y:2321
+#: java/parse.y:2358 java/parse.y:2360 java/parse.y:2362 java/parse.y:2383
+#: java/parse.y:2385 java/parse.y:2387 java/parse.y:2403 java/parse.y:2405
+#: java/parse.y:2426 java/parse.y:2428 java/parse.y:2430 java/parse.y:2458
+#: java/parse.y:2460 java/parse.y:2462 java/parse.y:2464 java/parse.y:2482
+#: java/parse.y:2484 java/parse.y:2495 java/parse.y:2506 java/parse.y:2517
+#: java/parse.y:2528 java/parse.y:2539 java/parse.y:2552 java/parse.y:2556
+#: java/parse.y:2558 java/parse.y:2571
+msgid "Missing term"
+msgstr ""
+
+#: java/parse.y:971
+msgid "Missing variable initializer"
+msgstr ""
+
+#: java/parse.y:988
+msgid "Invalid declaration"
+msgstr ""
+
+#: java/parse.y:994
+msgid "Can't specify array dimension in a declaration"
+msgstr ""
+
+#: java/parse.y:996 java/parse.y:1072 java/parse.y:2113 java/parse.y:2135
+#: java/parse.y:2139 java/parse.y:2174 java/parse.y:2251 java/parse.y:2261
+msgid "']' expected"
+msgstr ""
+
+#: java/parse.y:1000
+msgid "Unbalanced ']'"
+msgstr ""
+
+#: java/parse.y:1036
+msgid "Invalid method declaration, method name required"
+msgstr ""
+
+#: java/parse.y:1042 java/parse.y:1044 java/parse.y:1997
+msgid "Identifier expected"
+msgstr ""
+
+#: java/parse.y:1047
+msgid "Invalid method declaration, return type required"
+msgstr ""
+
+#: java/parse.y:1070 java/parse.y:1507 java/parse.y:1514 java/parse.y:1523
+#: java/parse.y:1525 java/parse.y:1553 java/parse.y:1661 java/parse.y:1942
+#: java/parse.y:1995
+msgid "')' expected"
+msgstr ""
+
+#: java/parse.y:1086
+msgid "Missing formal parameter term"
+msgstr ""
+
+#: java/parse.y:1101 java/parse.y:1106
+msgid "Missing identifier"
+msgstr ""
+
+#: java/parse.y:1126 java/parse.y:1135
+msgid "Missing class type term"
+msgstr ""
+
+#: java/parse.y:1287
+msgid "Invalid interface type"
+msgstr ""
+
+#: java/parse.y:1471 java/parse.y:1640 java/parse.y:1642
+msgid "':' expected"
+msgstr ""
+
+#: java/parse.y:1493 java/parse.y:1498 java/parse.y:1503
+msgid "Invalid expression statement"
+msgstr ""
+
+#: java/parse.y:1521 java/parse.y:1549 java/parse.y:1589 java/parse.y:1657
+#: java/parse.y:1725 java/parse.y:1831 java/parse.y:1899 java/parse.y:1989
+#: java/parse.y:1991 java/parse.y:1999 java/parse.y:2234 java/parse.y:2236
+msgid "'(' expected"
+msgstr ""
+
+#: java/parse.y:1591
+msgid "Missing term or ')'"
+msgstr ""
+
+#: java/parse.y:1638
+msgid "Missing or invalid constant expression"
+msgstr ""
+
+#: java/parse.y:1659
+msgid "Missing term and ')' expected"
+msgstr ""
+
+#: java/parse.y:1698
+msgid "Invalid control expression"
+msgstr ""
+
+#: java/parse.y:1700 java/parse.y:1702
+msgid "Invalid update expression"
+msgstr ""
+
+#: java/parse.y:1727
+msgid "Invalid init statement"
+msgstr ""
+
+#: java/parse.y:1902
+msgid "Missing term or ')' expected"
+msgstr ""
+
+#: java/parse.y:1944
+msgid "'class' or 'this' expected"
+msgstr ""
+
+#: java/parse.y:1946 java/parse.y:1948
+msgid "'class' expected"
+msgstr ""
+
+#: java/parse.y:1993
+msgid "')' or term expected"
+msgstr ""
+
+#: java/parse.y:2111
+msgid "'[' expected"
+msgstr ""
+
+#: java/parse.y:2189
+msgid "Field expected"
+msgstr ""
+
+#: java/parse.y:2246 java/parse.y:2256
+msgid "Missing term and ']' expected"
+msgstr ""
+
+#: java/parse.y:2351
+msgid "']' expected, invalid type expression"
+msgstr ""
+
+#: java/parse.y:2354
+msgid "Invalid type expression"
+msgstr ""
+
+#: java/parse.y:2466
+msgid "Invalid reference type"
+msgstr ""
+
+#: java/parse.y:2944
+msgid "Constructor invocation must be first thing in a constructor"
+msgstr ""
+
+#: java/parse.y:2946
+msgid "Only constructors can invoke constructors"
+msgstr ""
+
+#: java/parse.y:2955
+#, c-format
+msgid ": `%s' JDK1.1(TM) feature"
+msgstr ""
+
+#: java/parse.y:3015 java/parse.y:3017
+#, c-format
+msgid ""
+"%s.\n"
+"%s"
+msgstr ""
+
+#: java/parse.y:3480
+msgid "Can't use '$' as a separator for inner classes"
+msgstr ""
+
+#: java/parse.y:6577
+#, c-format
+msgid "malformed .zip archive in CLASSPATH: %s"
+msgstr ""
+
+#: java/parse.y:6648
+#, c-format
+msgid ""
+"Can't find default package `%s'. Check the CLASSPATH environment variable "
+"and the access to the archives."
+msgstr ""
+
+#: java/parse.y:11787
+#, c-format
+msgid "missing static field `%s'"
+msgstr ""
+
+#: java/parse.y:11792
+#, c-format
+msgid "not a static field `%s'"
+msgstr ""
+
+#: java/parse.y:11845
+#, c-format
+msgid "No case for %s"
+msgstr ""
+
+#: java/parse.y:13030
+#, c-format
+msgid "unregistered operator %s"
+msgstr ""
+
+#: java/typeck.c:178
+msgid "internal error - use of undefined type"
+msgstr ""
+
+#: java/typeck.c:557
+msgid "junk at end of signature string"
+msgstr ""
+
+#: java/verify.c:464
+msgid "bad pc in exception_table"
+msgstr ""
+
+#: java/verify.c:1344
+#, c-format
+msgid "unknown opcode %d@pc=%d during verification"
+msgstr ""
+
+#: java/verify.c:1414 java/verify.c:1427 java/verify.c:1431
+#, c-format
+msgid "verification error at PC=%d"
+msgstr ""
+
+#: objc/lang-options.h:27
+msgid "Dump decls to a .decl file"
+msgstr ""
+
+#: objc/lang-options.h:29
+msgid "Generate code for GNU runtime environment"
+msgstr ""
+
+#: objc/lang-options.h:32
+msgid "Generate code for NeXT runtime environment"
+msgstr ""
+
+#: objc/lang-options.h:35
+msgid "Warn if a selector has multiple methods"
+msgstr ""
+
+#: objc/lang-options.h:39
+msgid "Do not warn if inherited methods are unimplemented"
+msgstr ""
+
+#: objc/lang-options.h:41
+msgid "Generate C header of platform specific features"
+msgstr ""
+
+#: objc/lang-options.h:43
+msgid "Specify the name of the class for constant strings"
+msgstr ""
+
+#: objc/objc-act.c:811
msgid "no class name specified as argument to -fconstant-string-class"
msgstr ""
-#: objc/objc-act.c:977
+#: objc/objc-act.c:972
#, c-format
msgid "object does not conform to the `%s' protocol"
msgstr ""
-#: objc/objc-act.c:1015
+#: objc/objc-act.c:1010
#, c-format
msgid "class `%s' does not implement the `%s' protocol"
msgstr ""
-#: objc/objc-act.c:1097
+#: objc/objc-act.c:1091
#, c-format
msgid "`%s' cannot be statically allocated"
msgstr ""
-#: objc/objc-act.c:1098
-msgid "statically allocated objects not supported"
-msgstr ""
-
-#: objc/objc-act.c:1156
+#: objc/objc-act.c:1147
#, c-format
msgid "Unexpected type for `id' (%s)"
msgstr ""
-#: objc/objc-act.c:1160
+#: objc/objc-act.c:1152
msgid "Undefined type `id', please import <objc/objc.h>"
msgstr ""
-#: objc/objc-act.c:1206 objc/objc-act.c:5375
+#: objc/objc-act.c:1200 objc/objc-act.c:5359
#, c-format
msgid "Cannot find protocol declaration for `%s'"
msgstr ""
-#: objc-parse.y:1358 objc/objc-act.c:1431 objc/objc-act.c:5901
-#: objc/objc-act.c:6202 objc/objc-act.c:6251 objc/objc-act.c:6287
+#: objc/objc-act.c:1422 objc/objc-act.c:5879 objc/objc-act.c:6177
+#: objc/objc-act.c:6226 objc/objc-act.c:6262 objc/objc-parse.y:1371
#, c-format
msgid "Cannot find interface declaration for `%s'"
msgstr ""
-#: objc/objc-act.c:2467
+#: objc/objc-act.c:2460
#, c-format
msgid "Cannot find class `%s'"
msgstr ""
-#: objc/objc-act.c:2469
+#: objc/objc-act.c:2462
#, c-format
msgid "Class `%s' already exists"
msgstr ""
#. fatal did not work with 2 args...should fix
-#: objc/objc-act.c:2596
+#: objc/objc-act.c:2586
#, c-format
msgid "Cannot find interface declaration for `%s', superclass of `%s'"
msgstr ""
-#: objc/objc-act.c:2604
+#: objc/objc-act.c:2593
#, c-format
msgid "Circular inheritance in interface declaration for `%s'"
msgstr ""
-#: objc/objc-act.c:3652 objc/objc-act.c:3669
+#: objc/objc-act.c:3643 objc/objc-act.c:3660
msgid "inconsistent instance variable specification"
msgstr ""
-#: objc/objc-act.c:4862
+#: objc/objc-act.c:4854
#, c-format
msgid "multiple declarations for method `%s'"
msgstr ""
-#: objc/objc-act.c:4979
+#: objc/objc-act.c:4968
#, c-format
msgid "invalid receiver type `%s'"
msgstr ""
-#: objc/objc-act.c:5047 objc/objc-act.c:5073 objc/objc-act.c:5121
+#: objc/objc-act.c:5036 objc/objc-act.c:5062 objc/objc-act.c:5110
#, c-format
msgid "`%s' does not respond to `%s'"
msgstr ""
-#: objc/objc-act.c:5053 objc/objc-act.c:7311
+#: objc/objc-act.c:5042 objc/objc-act.c:7283
#, c-format
msgid "no super class declared in interface for `%s'"
msgstr ""
-#: objc/objc-act.c:5151
+#: objc/objc-act.c:5140
msgid "cannot find class (factory) method."
msgstr ""
-#: objc/objc-act.c:5152 objc/objc-act.c:5196
+#: objc/objc-act.c:5141 objc/objc-act.c:5185
#, c-format
msgid "return type for `%s' defaults to id"
msgstr ""
-#: objc/objc-act.c:5169
+#: objc/objc-act.c:5158
#, c-format
msgid "method `%s' not implemented by protocol."
msgstr ""
-#: objc/objc-act.c:5178
+#: objc/objc-act.c:5167
msgid "return type defaults to id"
msgstr ""
-#: objc/objc-act.c:5195
+#: objc/objc-act.c:5184
msgid "cannot find method."
msgstr ""
@@ -9341,147 +11639,157 @@ msgstr ""
#. to an instance variable. It's better to catch the cases
#. where this is done unknowingly than to support the above
#. paradigm.
-#: objc/objc-act.c:5450
+#: objc/objc-act.c:5428
#, c-format
msgid "instance variable `%s' accessed in class method"
msgstr ""
-#: objc/objc-act.c:5702
+#: objc/objc-act.c:5680
#, c-format
msgid "duplicate definition of class method `%s'."
msgstr ""
-#: objc/objc-act.c:5708
+#: objc/objc-act.c:5686
#, c-format
msgid "duplicate declaration of class method `%s'."
msgstr ""
-#: objc/objc-act.c:5744
+#: objc/objc-act.c:5722
#, c-format
msgid "duplicate definition of instance method `%s'."
msgstr ""
-#: objc/objc-act.c:5750
+#: objc/objc-act.c:5728
#, c-format
msgid "duplicate declaration of instance method `%s'."
msgstr ""
-#: objc/objc-act.c:5790
+#: objc/objc-act.c:5768
#, c-format
msgid "duplicate interface declaration for category `%s(%s)'"
msgstr ""
-#: objc/objc-act.c:5876
+#: objc/objc-act.c:5854
#, c-format
msgid "instance variable `%s' is declared private"
msgstr ""
-#: objc/objc-act.c:5923
+#: objc/objc-act.c:5901
#, c-format
msgid "instance variable `%s' is declared %s"
msgstr ""
-#: objc/objc-act.c:5933
+#: objc/objc-act.c:5911
msgid "static access to object of type `id'"
msgstr ""
-#: objc/objc-act.c:5970 objc/objc-act.c:6064
+#: objc/objc-act.c:5945 objc/objc-act.c:6039
#, c-format
msgid "incomplete implementation of class `%s'"
msgstr ""
-#: objc/objc-act.c:5974 objc/objc-act.c:6069
+#: objc/objc-act.c:5949 objc/objc-act.c:6044
#, c-format
msgid "incomplete implementation of category `%s'"
msgstr ""
-#: objc/objc-act.c:5979 objc/objc-act.c:6074
+#: objc/objc-act.c:5954 objc/objc-act.c:6049
#, c-format
msgid "method definition for `%c%s' not found"
msgstr ""
-#: objc/objc-act.c:6115
+#: objc/objc-act.c:6090
#, c-format
msgid "%s `%s' does not fully implement the `%s' protocol"
msgstr ""
-#: objc/objc-act.c:6174
+#: objc/objc-act.c:6149
#, c-format
msgid "reimplementation of class `%s'"
msgstr ""
-#: objc/objc-act.c:6216
+#: objc/objc-act.c:6191
#, c-format
msgid "conflicting super class name `%s'"
msgstr ""
-#: objc/objc-act.c:6231
+#: objc/objc-act.c:6206
#, c-format
msgid "duplicate interface declaration for class `%s'"
msgstr ""
-#: objc/objc-act.c:6477
+#: objc/objc-act.c:6449
#, c-format
msgid "duplicate declaration for protocol `%s'"
msgstr ""
-#: objc/objc-act.c:7352
+#: objc/objc-act.c:7324
msgid "[super ...] must appear in a method context"
msgstr ""
-#: objc/objc-act.c:8304 objc/objc-act.c:8320
+#: objc/objc-act.c:8287 objc/objc-act.c:8303
#, c-format
msgid "potential selector conflict for method `%s'"
msgstr ""
-#: objc-parse.y:2095
+#: objc/objc-parse.y:2159
msgid "`@end' must appear in an implementation context"
msgstr ""
-#: objc-parse.y:2361 objc-parse.y:2386
+#: objc/objc-parse.y:2425 objc/objc-parse.y:2450
msgid "method definition not in class context"
msgstr ""
-#: profile.c:491
+#: objc/objc-parse.y:3278
+msgid "syntax error at '@' token"
+msgstr ""
+
+#. If we didn't find this parameter, issue an error message.
+#: params.c:80
+#, c-format
+msgid "invalid parameter `%s'"
+msgstr ""
+
+#: profile.c:490
msgid "Arc profiling: some edge counts were bad."
msgstr ""
-#: profile.c:932
+#: profile.c:931
#, c-format
msgid "file %s not found, execution counts assumed to be zero."
msgstr ""
-#: protoize.c:598
+#: protoize.c:601
#, c-format
msgid "%s: internal abort\n"
msgstr ""
-#: protoize.c:689
+#: protoize.c:692
#, c-format
msgid "%s: error writing file `%s': %s\n"
msgstr ""
-#: protoize.c:734
+#: protoize.c:737
#, c-format
msgid "%s: usage '%s [ -VqfnkN ] [ -i <istring> ] [ filename ... ]'\n"
msgstr ""
-#: protoize.c:737
+#: protoize.c:740
#, c-format
msgid "%s: usage '%s [ -VqfnkNlgC ] [ -B <dirname> ] [ filename ... ]'\n"
msgstr ""
-#: protoize.c:844
+#: protoize.c:847
#, c-format
msgid "%s: warning: no read access for file `%s'\n"
msgstr ""
-#: protoize.c:852
+#: protoize.c:855
#, c-format
msgid "%s: warning: no write access for file `%s'\n"
msgstr ""
-#: protoize.c:860
+#: protoize.c:863
#, c-format
msgid "%s: warning: no write access for dir containing `%s'\n"
msgstr ""
@@ -9489,368 +11797,363 @@ msgstr ""
#. Catch cases like /.. where we try to backup to a
#. point above the absolute root of the logical file
#. system.
-#: protoize.c:1278
+#: protoize.c:1281
#, c-format
msgid "%s: invalid file name: %s\n"
msgstr ""
-#: protoize.c:1430
+#: protoize.c:1433
#, c-format
msgid "%s: %s: can't get status: %s\n"
msgstr ""
-#: protoize.c:1451
+#: protoize.c:1454
#, c-format
msgid ""
"\n"
"%s: fatal error: aux info file corrupted at line %d\n"
msgstr ""
-#: protoize.c:1787
+#: protoize.c:1790
#, c-format
msgid "%s:%d: declaration of function `%s' takes different forms\n"
msgstr ""
-#: protoize.c:2045
+#: protoize.c:2048
#, c-format
msgid "%s: compiling `%s'\n"
msgstr ""
-#: protoize.c:2068
+#: protoize.c:2071
#, c-format
msgid "%s: wait: %s\n"
msgstr ""
-#: protoize.c:2073
+#: protoize.c:2076
#, c-format
msgid "%s: subprocess got fatal signal %d\n"
msgstr ""
-#: protoize.c:2081
+#: protoize.c:2084
#, c-format
msgid "%s: %s exited with status %d\n"
msgstr ""
-#: protoize.c:2133
+#: protoize.c:2136
#, c-format
msgid "%s: warning: missing SYSCALLS file `%s'\n"
msgstr ""
-#: protoize.c:2142 protoize.c:2171
+#: protoize.c:2145 protoize.c:2174
#, c-format
msgid "%s: can't read aux info file `%s': %s\n"
msgstr ""
-#: protoize.c:2187 protoize.c:2215
+#: protoize.c:2190 protoize.c:2218
#, c-format
msgid "%s: can't get status of aux info file `%s': %s\n"
msgstr ""
-#: protoize.c:2243
+#: protoize.c:2246
#, c-format
msgid "%s: can't open aux info file `%s' for reading: %s\n"
msgstr ""
-#: protoize.c:2261
+#: protoize.c:2264
#, c-format
msgid "%s: error reading aux info file `%s': %s\n"
msgstr ""
-#: protoize.c:2274
+#: protoize.c:2277
#, c-format
msgid "%s: error closing aux info file `%s': %s\n"
msgstr ""
-#: protoize.c:2290
+#: protoize.c:2293
#, c-format
msgid "%s: can't delete aux info file `%s': %s\n"
msgstr ""
-#: protoize.c:2372 protoize.c:4374
+#: protoize.c:2375 protoize.c:4377
#, c-format
msgid "%s: can't delete file `%s': %s\n"
msgstr ""
-#: protoize.c:2451
+#: protoize.c:2454
#, c-format
msgid "%s: warning: can't rename file `%s' to `%s': %s\n"
msgstr ""
-#: protoize.c:2576
+#: protoize.c:2579
#, c-format
msgid "%s: conflicting extern definitions of '%s'\n"
msgstr ""
-#: protoize.c:2580
+#: protoize.c:2583
#, c-format
msgid "%s: declarations of '%s' will not be converted\n"
msgstr ""
-#: protoize.c:2582
+#: protoize.c:2585
#, c-format
msgid "%s: conflict list for '%s' follows:\n"
msgstr ""
-#: protoize.c:2615
+#: protoize.c:2618
#, c-format
msgid "%s: warning: using formals list from %s(%d) for function `%s'\n"
msgstr ""
-#: protoize.c:2655
+#: protoize.c:2658
#, c-format
msgid "%s: %d: `%s' used but missing from SYSCALLS\n"
msgstr ""
-#: protoize.c:2661
+#: protoize.c:2664
#, c-format
msgid "%s: %d: warning: no extern definition for `%s'\n"
msgstr ""
-#: protoize.c:2692
+#: protoize.c:2695
#, c-format
msgid "%s: warning: no static definition for `%s' in file `%s'\n"
msgstr ""
-#: protoize.c:2698
+#: protoize.c:2701
#, c-format
msgid "%s: multiple static defs of `%s' in file `%s'\n"
msgstr ""
-#: protoize.c:2871 protoize.c:2874
+#: protoize.c:2874 protoize.c:2877
#, c-format
msgid "%s: %d: warning: source too confusing\n"
msgstr ""
-#: protoize.c:3080
+#: protoize.c:3083
#, c-format
msgid "%s: %d: warning: varargs function declaration not converted\n"
msgstr ""
-#: protoize.c:3095
+#: protoize.c:3098
#, c-format
msgid "%s: declaration of function `%s' not converted\n"
msgstr ""
-#: protoize.c:3218
+#: protoize.c:3221
#, c-format
msgid "%s: warning: too many parameter lists in declaration of `%s'\n"
msgstr ""
-#: protoize.c:3239
+#: protoize.c:3242
#, c-format
msgid ""
"\n"
"%s: warning: too few parameter lists in declaration of `%s'\n"
msgstr ""
-#: protoize.c:3337
+#: protoize.c:3340
#, c-format
msgid "%s: %d: warning: found `%s' but expected `%s'\n"
msgstr ""
-#: protoize.c:3515
+#: protoize.c:3518
#, c-format
msgid "%s: local declaration for function `%s' not inserted\n"
msgstr ""
-#: protoize.c:3542
+#: protoize.c:3545
#, c-format
msgid ""
"\n"
"%s: %d: warning: can't add declaration of `%s' into macro call\n"
msgstr ""
-#: protoize.c:3616
+#: protoize.c:3619
#, c-format
msgid "%s: global declarations for file `%s' not inserted\n"
msgstr ""
-#: protoize.c:3707 protoize.c:3737
+#: protoize.c:3710 protoize.c:3740
#, c-format
msgid "%s: definition of function `%s' not converted\n"
msgstr ""
-#: protoize.c:3726
+#: protoize.c:3729
#, c-format
msgid "%s: %d: warning: definition of %s not converted\n"
msgstr ""
-#: protoize.c:4056
+#: protoize.c:4059
#, c-format
msgid "%s: found definition of `%s' at %s(%d)\n"
msgstr ""
#. If we make it here, then we did not know about this
#. function definition.
-#: protoize.c:4072
+#: protoize.c:4075
#, c-format
msgid "%s: %d: warning: `%s' excluded by preprocessing\n"
msgstr ""
-#: protoize.c:4075
+#: protoize.c:4078
#, c-format
msgid "%s: function definition not converted\n"
msgstr ""
-#: protoize.c:4134
+#: protoize.c:4137
#, c-format
msgid "%s: `%s' not converted\n"
msgstr ""
-#: protoize.c:4142
+#: protoize.c:4145
#, c-format
msgid "%s: would convert file `%s'\n"
msgstr ""
-#: protoize.c:4145
+#: protoize.c:4148
#, c-format
msgid "%s: converting file `%s'\n"
msgstr ""
-#: protoize.c:4155
+#: protoize.c:4158
#, c-format
msgid "%s: can't get status for file `%s': %s\n"
msgstr ""
-#: protoize.c:4197
+#: protoize.c:4200
#, c-format
msgid "%s: can't open file `%s' for reading: %s\n"
msgstr ""
-#: protoize.c:4212
+#: protoize.c:4215
#, c-format
msgid ""
"\n"
"%s: error reading input file `%s': %s\n"
msgstr ""
-#: protoize.c:4246
+#: protoize.c:4249
#, c-format
msgid "%s: can't create/open clean file `%s': %s\n"
msgstr ""
-#: protoize.c:4351
+#: protoize.c:4354
#, c-format
msgid "%s: warning: file `%s' already saved in `%s'\n"
msgstr ""
-#: protoize.c:4359
+#: protoize.c:4362
#, c-format
msgid "%s: can't link file `%s' to `%s': %s\n"
msgstr ""
-#: protoize.c:4389
+#: protoize.c:4392
#, c-format
msgid "%s: can't create/open output file `%s': %s\n"
msgstr ""
-#: protoize.c:4422
+#: protoize.c:4425
#, c-format
msgid "%s: can't change mode of file `%s': %s\n"
msgstr ""
-#: protoize.c:4595
+#: protoize.c:4611
#, c-format
msgid "%s: cannot get working directory: %s\n"
msgstr ""
-#: protoize.c:4693
+#: protoize.c:4709
#, c-format
msgid "%s: input file names must have .c suffixes: %s\n"
msgstr ""
-#: real.c:798 real.c:975
+#: real.c:802 real.c:979
msgid "conversion from NaN to int"
msgstr ""
-#: real.c:821
+#: real.c:825
msgid "conversion from NaN to unsigned int"
msgstr ""
-#: real.c:2696
+#: real.c:2700
msgid "floating point overflow"
msgstr ""
-#: real.c:4334 real.c:6611 real.c:6692
+#: real.c:4340 real.c:6619 real.c:6700
msgid "overflow on truncation to integer"
msgstr ""
-#: real.c:4406
+#: real.c:4412
msgid "overflow on truncation to unsigned integer"
msgstr ""
-#: real.c:5752
+#: real.c:5760
#, c-format
msgid "%s: argument domain error"
msgstr ""
-#: real.c:5753
+#: real.c:5761
#, c-format
msgid "%s: function singularity"
msgstr ""
-#: real.c:5754
+#: real.c:5762
#, c-format
msgid "%s: overflow range error"
msgstr ""
-#: real.c:5755
+#: real.c:5763
#, c-format
msgid "%s: underflow range error"
msgstr ""
-#: real.c:5756
+#: real.c:5764
#, c-format
msgid "%s: total loss of precision"
msgstr ""
-#: real.c:5757
+#: real.c:5765
#, c-format
msgid "%s: partial loss of precision"
msgstr ""
-#: real.c:5758
+#: real.c:5766
#, c-format
msgid "%s: NaN - producing operation"
msgstr ""
-#: reg-stack.c:660
+#: reg-stack.c:655
#, c-format
msgid "Output constraint %d must specify a single register"
msgstr ""
-#: reg-stack.c:680
+#: reg-stack.c:675
msgid "Output regs must be grouped at top of stack"
msgstr ""
-#: reg-stack.c:717
+#: reg-stack.c:712
msgid "Implicitly popped regs must be grouped at top of stack"
msgstr ""
-#: reg-stack.c:736
+#: reg-stack.c:731
#, c-format
msgid "Output operand %d must use `&' constraint"
msgstr ""
-#: regclass.c:660
+#: regclass.c:703
#, c-format
msgid "can't use '%s' as a %s register"
msgstr ""
-#: regclass.c:671
-#, c-format
-msgid "unknown register name: %s"
-msgstr ""
-
-#: regclass.c:682
+#: regclass.c:725
msgid "global register variable follows a function definition"
msgstr ""
-#: regclass.c:686
+#: regclass.c:729
msgid "register used for two global register variables"
msgstr ""
-#: regclass.c:691
+#: regclass.c:734
msgid "call-clobbered register used for global register variable"
msgstr ""
@@ -9862,234 +12165,242 @@ msgstr ""
msgid "impossible register constraint in `asm'"
msgstr ""
-#: reload.c:3319
+#: reload.c:3330
msgid "`&' constraint used with no register class"
msgstr ""
-#: reload.c:3471 reload.c:3682
+#: reload.c:3487 reload.c:3701
msgid "inconsistent operand constraints in an `asm'"
msgstr ""
-#: reload1.c:1159
+#: reload1.c:1235
msgid "frame size too large for reliable stack checking"
msgstr ""
-#: reload1.c:1162
+#: reload1.c:1238
msgid "try reducing the number of local variables"
msgstr ""
-#: reload1.c:1806
+#: reload1.c:1893
#, c-format
msgid "Can't find a register in class `%s' while reloading `asm'."
msgstr ""
-#: reload1.c:1810
+#: reload1.c:1897
#, c-format
msgid "Unable to find a register to spill in class `%s'."
msgstr ""
-#: reload1.c:3825
+#: reload1.c:3922
msgid "`asm' operand requires impossible reload"
msgstr ""
-#: reload1.c:4877
+#: reload1.c:5033
msgid "`asm' operand constraint incompatible with operand size"
msgstr ""
-#: reload1.c:6443
+#: reload1.c:6620
msgid "output operand is constant in `asm'"
msgstr ""
-#: rtl.c:1147
+#: rtl.c:1289
#, c-format
-msgid "RTL check: access of elt %d of `%s' with last elt %d"
+msgid "RTL check: access of elt %d of `%s' with last elt %d in %s, at %s:%d"
msgstr ""
-#: rtl.c:1161
+#: rtl.c:1304
#, c-format
-msgid "RTL check: expected elt %d type '%c', have '%c' (rtx %s)"
+msgid ""
+"RTL check: expected elt %d type '%c', have '%c' (rtx %s) in %s, at %s:%d"
msgstr ""
-#: rtl.c:1176
+#: rtl.c:1320
#, c-format
-msgid "RTL check: expected elt %d type '%c' or '%c', have '%c' (rtx %s)"
+msgid ""
+"RTL check: expected elt %d type '%c' or '%c', have '%c' (rtx %s) in %s, at %"
+"s:%d"
msgstr ""
-#: rtl.c:1190
+#: rtl.c:1333
#, c-format
-msgid "RTL check: expected code `%s', have `%s'"
+msgid "RTL check: expected code `%s', have `%s' in %s, at %s:%d"
msgstr ""
-#: rtl.c:1203
+#: rtl.c:1347
#, c-format
-msgid "RTL check: expected code `%s' or `%s', have `%s'"
+msgid "RTL check: expected code `%s' or `%s', have `%s' in %s, at %s:%d"
msgstr ""
-#: rtl.c:1218
+#: rtl.c:1362
#, c-format
-msgid "RTL check: access of elt %d of vector with last elt %d"
+msgid "RTL check: access of elt %d of vector with last elt %d in %s, at %s:%d"
msgstr ""
-#: stmt.c:914
+#: stmt.c:917
#, c-format
msgid "jump to `%s' invalidly jumps into binding contour"
msgstr ""
-#: stmt.c:1150 stmt.c:3649
+#: stmt.c:1153 stmt.c:3641
#, c-format
msgid "label `%s' used before containing binding contour"
msgstr ""
-#: stmt.c:1280 stmt.c:1352
+#: stmt.c:1283 stmt.c:1357
msgid "`asm' cannot be used in function where memory usage is checked"
msgstr ""
-#: stmt.c:1338
+#: stmt.c:1343
msgid "`asm' cannot be used with `-fcheck-memory-usage'"
msgstr ""
-#: stmt.c:1367
+#: stmt.c:1372
#, c-format
msgid "unknown register name `%s' in `asm'"
msgstr ""
-#: stmt.c:1382
+#: stmt.c:1387
msgid "too many alternatives in `asm'"
msgstr ""
-#: stmt.c:1393
+#: stmt.c:1398
msgid "operand constraints for `asm' differ in number of alternatives"
msgstr ""
-#: stmt.c:1440
+#: stmt.c:1446
msgid "output operand constraint lacks `='"
msgstr ""
-#: stmt.c:1450
+#: stmt.c:1465
#, c-format
msgid "output constraint `%c' for operand %d is not at the beginning"
msgstr ""
-#: stmt.c:1459
+#: stmt.c:1472
#, c-format
msgid "output operand constraint %d contains `+'"
msgstr ""
-#: stmt.c:1468
+#: stmt.c:1481
msgid "operand constraint contains '+' or '=' at illegal position."
msgstr ""
-#: stmt.c:1474 stmt.c:1651
-#, ycp-format
+#: stmt.c:1487 stmt.c:1664
+#, c-format
msgid "`%%' constraint used with last operand"
msgstr ""
-#: stmt.c:1488
+#: stmt.c:1501
msgid "matching constraint not valid in output operand"
msgstr ""
-#: stmt.c:1514 stmt.c:1711
+#: stmt.c:1527 stmt.c:1724
#, c-format
msgid "invalid punctuation `%c' in constraint"
msgstr ""
-#: stmt.c:1558
+#: stmt.c:1571
#, c-format
msgid "output number %d not directly addressable"
msgstr ""
-#: stmt.c:1586
+#: stmt.c:1599
#, c-format
msgid "more than %d operands in `asm'"
msgstr ""
-#: stmt.c:1624
+#: stmt.c:1637
#, c-format
msgid "hard register `%s' listed as input operand to `asm'"
msgstr ""
-#: stmt.c:1641
+#: stmt.c:1654
#, c-format
msgid "input operand constraint contains `%c'"
msgstr ""
-#: stmt.c:1678
+#: stmt.c:1691
msgid "matching constraint references invalid operand number"
msgstr ""
#. ??? Leave this only until we have experience with what
#. happens in combine and elsewhere when constraints are
#. not satisfied.
-#: stmt.c:1745 stmt.c:1770
+#: stmt.c:1758 stmt.c:1786
#, c-format
msgid "asm operand %d probably doesn't match constraints"
msgstr ""
-#: stmt.c:3567
+#: stmt.c:3578
#, c-format
msgid "unused variable `%s'"
msgstr ""
-#: stmt.c:5160
+#: stmt.c:5026
#, c-format
msgid "enumeration value `%s' not handled in switch"
msgstr ""
-#: stmt.c:5186 stmt.c:5206
+#: stmt.c:5052 stmt.c:5072
#, c-format
msgid "case value `%ld' not in enumerated type"
msgstr ""
-#: stmt.c:5189 stmt.c:5209
+#: stmt.c:5055 stmt.c:5075
#, c-format
msgid "case value `%ld' not in enumerated type `%s'"
msgstr ""
-#: stor-layout.c:126
+#: stor-layout.c:140
msgid "type size can't be explicitly evaluated"
msgstr ""
-#: stor-layout.c:128
+#: stor-layout.c:142
msgid "variable-size type declared outside of any function"
msgstr ""
-#: stor-layout.c:399
+#: stor-layout.c:415
#, c-format
msgid "size of `%s' is %d bytes"
msgstr ""
-#: stor-layout.c:401
+#: stor-layout.c:417
#, c-format
msgid "size of `%s' is larger than %d bytes"
msgstr ""
-#: stor-layout.c:751 stor-layout.c:1002
+#: stor-layout.c:771 stor-layout.c:1023
#, c-format
msgid "packed attribute causes inefficient alignment for `%s'"
msgstr ""
-#: stor-layout.c:753 stor-layout.c:1004
+#: stor-layout.c:773 stor-layout.c:1025
#, c-format
msgid "packed attribute is unnecessary for `%s'"
msgstr ""
-#: stor-layout.c:768
+#: stor-layout.c:788
#, c-format
msgid "padding struct to align `%s'"
msgstr ""
-#: stor-layout.c:966
+#: stor-layout.c:987
msgid "padding struct size to alignment boundary"
msgstr ""
-#: stor-layout.c:1009
+#: stor-layout.c:1030
msgid "packed attribute causes inefficient alignment"
msgstr ""
-#: stor-layout.c:1011
+#: stor-layout.c:1032
msgid "packed attribute is unnecessary"
msgstr ""
+#: stringpool.c:307
+#, c-format
+msgid "\"%s\" and \"%s\" identical in first %d characters"
+msgstr ""
+
#: timevar.c:428
msgid ""
"\n"
@@ -10102,6 +12413,7 @@ msgid " TOTAL :"
msgstr ""
#: timevar.c:515
+#, c-format
msgid "time in %s: %ld.%06ld (%ld%%)\n"
msgstr ""
@@ -10129,518 +12441,1250 @@ msgstr ""
msgid "ld returned %d exit status"
msgstr ""
-#: toplev.c:1456 toplev.c:4878 tradcpp.c:699
+#: toplev.c:913
+msgid "Generate debugging info in default format"
+msgstr ""
+
+#: toplev.c:914
+msgid "Generate debugging info in default extended format"
+msgstr ""
+
+#: toplev.c:916
+msgid "Generate STABS format debug info"
+msgstr ""
+
+#: toplev.c:917
+msgid "Generate extended STABS format debug info"
+msgstr ""
+
+#: toplev.c:920
+msgid "Generate DWARF-1 format debug info"
+msgstr ""
+
+#: toplev.c:922
+msgid "Generate extended DWARF-1 format debug info"
+msgstr ""
+
+#: toplev.c:925
+msgid "Generate DWARF-2 debug info"
+msgstr ""
+
+#: toplev.c:928
+msgid "Generate XCOFF format debug info"
+msgstr ""
+
+#: toplev.c:929
+msgid "Generate extended XCOFF format debug info"
+msgstr ""
+
+#: toplev.c:932
+msgid "Generate COFF format debug info"
+msgstr ""
+
+#: toplev.c:976
+msgid "Do not store floats in registers"
+msgstr ""
+
+#: toplev.c:978
+msgid "Consider all mem refs through pointers as volatile"
+msgstr ""
+
+#: toplev.c:980
+msgid "Consider all mem refs to global data to be volatile"
+msgstr ""
+
+#: toplev.c:982
+msgid "Consider all mem refs to static data to be volatile"
+msgstr ""
+
+#: toplev.c:984
+msgid "Defer popping functions args from stack until later"
+msgstr ""
+
+#: toplev.c:986
+msgid "When possible do not generate stack frames"
+msgstr ""
+
+#: toplev.c:988
+msgid "Optimize sibling and tail recursive calls"
+msgstr ""
+
+#: toplev.c:990
+msgid "When running CSE, follow jumps to their targets"
+msgstr ""
+
+#: toplev.c:992
+msgid "When running CSE, follow conditional jumps"
+msgstr ""
+
+#: toplev.c:994
+msgid "Perform a number of minor, expensive optimisations"
+msgstr ""
+
+#: toplev.c:996
+msgid "Perform jump threading optimisations"
+msgstr ""
+
+#: toplev.c:998
+msgid "Perform strength reduction optimisations"
+msgstr ""
+
+#: toplev.c:1000
+msgid "Perform loop unrolling when iteration count is known"
+msgstr ""
+
+#: toplev.c:1002
+msgid "Perform loop unrolling for all loops"
+msgstr ""
+
+#: toplev.c:1004
+msgid "Force all loop invariant computations out of loops"
+msgstr ""
+
+#: toplev.c:1006
+msgid "Strength reduce all loop general induction variables"
+msgstr ""
+
+#: toplev.c:1008
+msgid "Store strings in writable data section"
+msgstr ""
+
+#: toplev.c:1010
+msgid "Enable machine specific peephole optimisations"
+msgstr ""
+
+#: toplev.c:1012
+msgid "Copy memory operands into registers before using"
+msgstr ""
+
+#: toplev.c:1014
+msgid "Copy memory address constants into regs before using"
+msgstr ""
+
+#: toplev.c:1016
+msgid "Allow function addresses to be held in registers"
+msgstr ""
+
+#: toplev.c:1018
+msgid "Integrate simple functions into their callers"
+msgstr ""
+
+#: toplev.c:1020
+msgid "Generate code for funcs even if they are fully inlined"
+msgstr ""
+
+#: toplev.c:1022
+msgid "Pay attention to the 'inline' keyword"
+msgstr ""
+
+#: toplev.c:1024
+msgid "Emit static const variables even if they are not used"
+msgstr ""
+
+#: toplev.c:1026
+msgid "Check for syntax errors, then stop"
+msgstr ""
+
+#: toplev.c:1028
+msgid "Mark data as shared rather than private"
+msgstr ""
+
+#: toplev.c:1030
+msgid "Enable saving registers around function calls"
+msgstr ""
+
+#: toplev.c:1032
+msgid "Return 'short' aggregates in memory, not registers"
+msgstr ""
+
+#: toplev.c:1034
+msgid "Return 'short' aggregates in registers"
+msgstr ""
+
+#: toplev.c:1036
+msgid "Attempt to fill delay slots of branch instructions"
+msgstr ""
+
+#: toplev.c:1038
+msgid "Perform the global common subexpression elimination"
+msgstr ""
+
+#: toplev.c:1040
+msgid "Run CSE pass after loop optimisations"
+msgstr ""
+
+#: toplev.c:1042
+msgid "Run the loop optimiser twice"
+msgstr ""
+
+#: toplev.c:1044
+msgid "Delete useless null pointer checks"
+msgstr ""
+
+#: toplev.c:1046
+msgid "Pretend that host and target use the same FP format"
+msgstr ""
+
+#: toplev.c:1048
+msgid "Reschedule instructions before register allocation"
+msgstr ""
+
+#: toplev.c:1050
+msgid "Reschedule instructions after register allocation"
+msgstr ""
+
+#: toplev.c:1052
+msgid "Enable scheduling across basic blocks"
+msgstr ""
+
+#: toplev.c:1054
+msgid "Allow speculative motion of non-loads"
+msgstr ""
+
+#: toplev.c:1056
+msgid "Allow speculative motion of some loads"
+msgstr ""
+
+#: toplev.c:1058
+msgid "Allow speculative motion of more loads"
+msgstr ""
+
+#: toplev.c:1060
+msgid "Replace add,compare,branch with branch on count reg"
+msgstr ""
+
+#: toplev.c:1062
+msgid "Generate position independent code, if possible"
+msgstr ""
+
+#: toplev.c:1065
+msgid "Enable exception handling"
+msgstr ""
+
+#: toplev.c:1067
+msgid "Just generate unwind tables for exception handling"
+msgstr ""
+
+#: toplev.c:1069
+msgid "Support synchronous non-call exceptions"
+msgstr ""
+
+#: toplev.c:1071
+msgid "Insert arc based program profiling code"
+msgstr ""
+
+#: toplev.c:1073
+msgid "Create data files needed by gcov"
+msgstr ""
+
+#: toplev.c:1075
+msgid "Use profiling information for branch probabilities"
+msgstr ""
+
+#: toplev.c:1077
+msgid "Reorder basic blocks to improve code placement"
+msgstr ""
+
+#: toplev.c:1079
+msgid "Do the register renaming optimization pass"
+msgstr ""
+
+#: toplev.c:1081
+msgid "Improve FP speed by violating ANSI & IEEE rules"
+msgstr ""
+
+#: toplev.c:1083
+msgid "Do not put unitialised globals in the common section"
+msgstr ""
+
+#: toplev.c:1085
+msgid "Do not generate .size directives"
+msgstr ""
+
+#: toplev.c:1087
+msgid "place each function into its own section"
+msgstr ""
+
+#: toplev.c:1089
+msgid "place data items into their own section"
+msgstr ""
+
+#: toplev.c:1091
+msgid "Add extra commentry to assembler output"
+msgstr ""
+
+#: toplev.c:1093
+msgid "Output GNU ld formatted global initialisers"
+msgstr ""
+
+#: toplev.c:1095
+msgid "Enables a register move optimisation"
+msgstr ""
+
+#: toplev.c:1097
+msgid "Do the full regmove optimization pass"
+msgstr ""
+
+#: toplev.c:1099
+msgid "Pack structure members together without holes"
+msgstr ""
+
+#: toplev.c:1101
+msgid "Insert stack checking code into the program"
+msgstr ""
+
+#: toplev.c:1103
+msgid "Specify that arguments may alias each other & globals"
+msgstr ""
+
+#: toplev.c:1105
+msgid "Assume arguments may alias globals but not each other"
+msgstr ""
+
+#: toplev.c:1107
+msgid "Assume arguments do not alias each other or globals"
+msgstr ""
+
+#: toplev.c:1109
+msgid "Assume strict aliasing rules apply"
+msgstr ""
+
+#: toplev.c:1111
+msgid "Align the start of loops"
+msgstr ""
+
+#: toplev.c:1113
+msgid "Align labels which are only reached by jumping"
+msgstr ""
+
+#: toplev.c:1115
+msgid "Align all labels"
+msgstr ""
+
+#: toplev.c:1117
+msgid "Align the start of functions"
+msgstr ""
+
+#: toplev.c:1119
+msgid "Generate code to check every memory access"
+msgstr ""
+
+#: toplev.c:1121
+msgid "Add a prefix to all function names"
+msgstr ""
+
+#: toplev.c:1123
+msgid ""
+"Suppress output of instruction numbers and line number notes in debugging "
+"dumps"
+msgstr ""
+
+#: toplev.c:1125
+msgid "Instrument function entry/exit with profiling calls"
+msgstr ""
+
+#: toplev.c:1127
+msgid "Enable SSA optimizations"
+msgstr ""
+
+#: toplev.c:1129
+msgid "Enable dead code elimination"
+msgstr ""
+
+#: toplev.c:1131
+msgid "External symbols have a leading underscore"
+msgstr ""
+
+#: toplev.c:1133
+msgid "Process #ident directives"
+msgstr ""
+
+#: toplev.c:1135
+msgid "Enables an rtl peephole pass run before sched2"
+msgstr ""
+
+#: toplev.c:1137
+msgid "Enables guessing of branch probabilities"
+msgstr ""
+
+#: toplev.c:1139
+msgid "Set errno after built-in math functions"
+msgstr ""
+
+#: toplev.c:1141
+msgid "Convert floating point constant to single precision constant"
+msgstr ""
+
+#: toplev.c:1143
+msgid "Report time taken by each compiler pass at end of run"
+msgstr ""
+
+#: toplev.c:1145
+msgid "Report on permanent memory allocation at end of run"
+msgstr ""
+
+#: toplev.c:1147
+msgid "Trap for signed overflow in addition / subtraction / multiplication."
+msgstr ""
+
+#: toplev.c:1164
+msgid "Compile just for ISO C89"
+msgstr ""
+
+#: toplev.c:1166
+msgid "Do not promote floats to double if using -traditional"
+msgstr ""
+
+#: toplev.c:1168
+msgid "Determine language standard"
+msgstr ""
+
+#: toplev.c:1172
+msgid "Make bitfields by unsigned by default"
+msgstr ""
+
+#: toplev.c:1176
+msgid "Make 'char' be signed by default"
+msgstr ""
+
+#: toplev.c:1178
+msgid "Make 'char' be unsigned by default"
+msgstr ""
+
+#: toplev.c:1184
+msgid "Attempt to support traditional K&R style C"
+msgstr ""
+
+#: toplev.c:1190
+msgid "Do not recognise the 'asm' keyword"
+msgstr ""
+
+#: toplev.c:1193
+msgid "Do not recognise any built in functions"
+msgstr ""
+
+#: toplev.c:1195
+msgid "Assume normal C execution environment"
+msgstr ""
+
+#: toplev.c:1198
+msgid "Assume that standard libraries & main might not exist"
+msgstr ""
+
+#: toplev.c:1201
+msgid "Allow different types as args of ? operator"
+msgstr ""
+
+#: toplev.c:1204
+msgid "Allow the use of $ inside identifiers"
+msgstr ""
+
+#: toplev.c:1209
+msgid "Use the same size for double as for float"
+msgstr ""
+
+#: toplev.c:1212
+msgid "Use the smallest fitting integer to hold enums"
+msgstr ""
+
+#: toplev.c:1215
+msgid "Override the underlying type for wchar_t to `unsigned short'"
+msgstr ""
+
+#: toplev.c:1219
+msgid "Enable most warning messages"
+msgstr ""
+
+#: toplev.c:1221
+msgid "Warn about casting functions to incompatible types"
+msgstr ""
+
+#: toplev.c:1225
+msgid "Warn about functions which might be candidates for format attributes"
+msgstr ""
+
+#: toplev.c:1228
+msgid "Warn about casts which discard qualifiers"
+msgstr ""
+
+#: toplev.c:1231
+msgid "Warn about subscripts whose type is 'char'"
+msgstr ""
+
+#: toplev.c:1234 toplev.c:1237
+msgid "Warn if nested comments are detected"
+msgstr ""
+
+#: toplev.c:1240
+msgid "Warn about possibly confusing type conversions"
+msgstr ""
+
+#: toplev.c:1243
+msgid "Warn about printf/scanf/strftime/strfmon format anomalies"
+msgstr ""
+
+#: toplev.c:1247
+msgid "Don't warn about strftime formats yielding 2 digit years"
+msgstr ""
+
+#: toplev.c:1250
+msgid "Don't warn about too many arguments to format functions"
+msgstr ""
+
+#: toplev.c:1252
+msgid "Warn about non-string-literal format strings"
+msgstr ""
+
+#: toplev.c:1255
+msgid "Warn about possible security problems with format functions"
+msgstr ""
+
+#: toplev.c:1258
+msgid "Warn about implicit function declarations"
+msgstr ""
+
+#: toplev.c:1262
+msgid "Warn when a declaration does not specify a type"
+msgstr ""
+
+#: toplev.c:1267
+msgid "Warn about the use of the #import directive"
+msgstr ""
+
+#: toplev.c:1271
+msgid "Do not warn about using 'long long' when -pedantic"
+msgstr ""
+
+#: toplev.c:1273
+msgid "Warn about suspicious declarations of main"
+msgstr ""
+
+#: toplev.c:1276
+msgid "Warn about possibly missing braces around initialisers"
+msgstr ""
+
+#: toplev.c:1279
+msgid "Warn about global funcs without previous declarations"
+msgstr ""
+
+#: toplev.c:1282
+msgid "Warn about global funcs without prototypes"
+msgstr ""
+
+#: toplev.c:1285
+msgid "Warn about use of multicharacter literals"
+msgstr ""
+
+#: toplev.c:1288
+msgid "Warn about externs not at file scope level"
+msgstr ""
+
+#: toplev.c:1291
+msgid "Warn about possible missing parentheses"
+msgstr ""
+
+#: toplev.c:1294
+msgid "Warn about possible violations of sequence point rules"
+msgstr ""
+
+#: toplev.c:1297
+msgid "Warn about function pointer arithmetic"
+msgstr ""
+
+#: toplev.c:1300
+msgid "Warn about multiple declarations of the same object"
+msgstr ""
+
+#: toplev.c:1303
+msgid "Warn about signed/unsigned comparisons"
+msgstr ""
+
+#: toplev.c:1306
+msgid "Warn about testing equality of floating point numbers"
+msgstr ""
+
+#: toplev.c:1309
+msgid "Warn about unrecognized pragmas"
+msgstr ""
+
+#: toplev.c:1312
+msgid "Warn about non-prototyped function decls"
+msgstr ""
+
+#: toplev.c:1315
+msgid "Warn about constructs whose meaning change in ISO C"
+msgstr ""
+
+#: toplev.c:1318
+msgid "Warn when trigraphs are encountered"
+msgstr ""
+
+#: toplev.c:1323
+msgid "Mark strings as 'const char *'"
+msgstr ""
+
+#: toplev.c:1471
+msgid "Warn when a function is unused"
+msgstr ""
+
+#: toplev.c:1473
+msgid "Warn when a label is unused"
+msgstr ""
+
+#: toplev.c:1475
+msgid "Warn when a function parameter is unused"
+msgstr ""
+
+#: toplev.c:1477
+msgid "Warn when a variable is unused"
+msgstr ""
+
+#: toplev.c:1479
+msgid "Warn when an expression value is unused"
+msgstr ""
+
+#: toplev.c:1481
+msgid "Do not suppress warnings from system headers"
+msgstr ""
+
+#: toplev.c:1483
+msgid "Treat all warnings as errors"
+msgstr ""
+
+#: toplev.c:1485
+msgid "Warn when one local variable shadows another"
+msgstr ""
+
+#: toplev.c:1487
+msgid "Warn about enumerated switches missing a specific case"
+msgstr ""
+
+#: toplev.c:1489
+msgid "Warn about returning structures, unions or arrays"
+msgstr ""
+
+#: toplev.c:1491
+msgid "Warn about pointer casts which increase alignment"
+msgstr ""
+
+#: toplev.c:1493
+msgid "Warn about code that will never be executed"
+msgstr ""
+
+#: toplev.c:1495
+msgid "Warn about unitialized automatic variables"
+msgstr ""
+
+#: toplev.c:1497
+msgid "Warn when an inlined function cannot be inlined"
+msgstr ""
+
+#: toplev.c:1499
+msgid "Warn when the packed attribute has no effect on struct layout"
+msgstr ""
+
+#: toplev.c:1501
+msgid "Warn when padding is required to align struct members"
+msgstr ""
+
+#: toplev.c:1503
+msgid "Warn when an optimization pass is disabled"
+msgstr ""
+
+#: toplev.c:1505
+msgid "Warn about functions which might be candidates for attribute noreturn"
+msgstr ""
+
+#: toplev.c:1539 toplev.c:5061 tradcpp.c:776
#, c-format
msgid "Invalid option `%s'"
msgstr ""
-#: toplev.c:1656
+#: toplev.c:1741
#, c-format
-msgid ""
-"Internal error: %s.\n"
-"Please submit a full bug report.\n"
-"See %s for instructions."
+msgid "Internal error: %s"
msgstr ""
-#: toplev.c:1988
+#: toplev.c:2056
#, c-format
msgid "`%s' used but never defined"
msgstr ""
-#: toplev.c:1991
+#: toplev.c:2059
#, c-format
msgid "`%s' declared `static' but never defined"
msgstr ""
-#: toplev.c:2013
+#: toplev.c:2081
#, c-format
msgid "`%s' defined but not used"
msgstr ""
-#: toplev.c:2255
+#: toplev.c:2259
+#, c-format
+msgid "can't open %s for writing"
+msgstr ""
+
+#: toplev.c:2312
msgid "-ffunction-sections not supported for this target."
msgstr ""
-#: toplev.c:2260
+#: toplev.c:2317
msgid "-fdata-sections not supported for this target."
msgstr ""
-#: toplev.c:2268
+#: toplev.c:2325
msgid "-ffunction-sections disabled; it makes profiling impossible."
msgstr ""
-#: toplev.c:2274
+#: toplev.c:2331
msgid "-ffunction-sections may affect debugging on some targets."
msgstr ""
-#: toplev.c:2334
+#: toplev.c:2372
msgid "Errors detected in input file (your bison.simple is out of date)\n"
msgstr ""
-#: toplev.c:2565
+#: toplev.c:2509
#, c-format
-msgid "invalid register name `%s' for register variable"
+msgid "error writing to %s"
msgstr ""
-#: toplev.c:3773
+#: toplev.c:2614
#, c-format
-msgid "Usage: %s input [switches]\n"
-msgstr ""
-
-#: toplev.c:3774
-msgid "Switches:\n"
+msgid "invalid register name `%s' for register variable"
msgstr ""
-#: toplev.c:3776
+#: toplev.c:3863
msgid ""
" -ffixed-<register> Mark <register> as being unavailable to the "
"compiler\n"
msgstr ""
-#: toplev.c:3777
+#: toplev.c:3864
msgid ""
" -fcall-used-<register> Mark <register> as being corrupted by function "
"calls\n"
msgstr ""
-#: toplev.c:3778
+#: toplev.c:3865
msgid ""
" -fcall-saved-<register> Mark <register> as being preserved across "
"functions\n"
msgstr ""
-#: toplev.c:3779
+#: toplev.c:3866
msgid ""
" -finline-limit=<number> Limits the size of inlined functions to <number>\n"
msgstr ""
-#: toplev.c:3780
+#: toplev.c:3867
msgid ""
" -fmessage-length=<number> Limits diagnostics messages lengths to <number> "
"characters per line. 0 suppresses line-wrapping\n"
msgstr ""
-#: toplev.c:3781
+#: toplev.c:3868
msgid ""
" -fdiagnostics-show-location=[once | every-line] Indicates how often source "
"location information should be emitted, as prefix, at the beginning of "
"diagnostics when line-wrapping\n"
msgstr ""
-#: toplev.c:3792
+#: toplev.c:3879
msgid " -O[number] Set optimisation level to [number]\n"
msgstr ""
-#: toplev.c:3793
+#: toplev.c:3880
msgid " -Os Optimise for space rather than speed\n"
msgstr ""
-#: toplev.c:3794
+#: toplev.c:3892
msgid ""
" -pedantic Issue warnings needed by strict compliance to ISO "
"C\n"
msgstr ""
-#: toplev.c:3795
+#: toplev.c:3893
msgid ""
" -pedantic-errors Like -pedantic except that errors are produced\n"
msgstr ""
-#: toplev.c:3796
+#: toplev.c:3894
msgid " -w Suppress warnings\n"
msgstr ""
-#: toplev.c:3797
+#: toplev.c:3895
msgid " -W Enable extra warnings\n"
msgstr ""
-#: toplev.c:3808
+#: toplev.c:3906
msgid " -Wunused Enable unused warnings\n"
msgstr ""
-#: toplev.c:3809
+#: toplev.c:3907
msgid ""
" -Wid-clash-<num> Warn if 2 identifiers have the same first <num> "
"chars\n"
msgstr ""
-#: toplev.c:3810
+#: toplev.c:3908
msgid ""
" -Wlarger-than-<number> Warn if an object is larger than <number> bytes\n"
msgstr ""
-#: toplev.c:3811
+#: toplev.c:3909
msgid " -p Enable function profiling\n"
msgstr ""
-#: toplev.c:3813
+#: toplev.c:3911
msgid " -a Enable block profiling \n"
msgstr ""
-#: toplev.c:3816
+#: toplev.c:3914
msgid " -ax Enable jump profiling \n"
msgstr ""
-#: toplev.c:3818
+#: toplev.c:3916
msgid " -o <file> Place output into <file> \n"
msgstr ""
-#: toplev.c:3819
+#: toplev.c:3917
msgid ""
" -G <number> Put global and static data smaller than <number>\n"
" bytes into a special section (on some targets)\n"
msgstr ""
-#: toplev.c:3830
-msgid " -aux-info <file> Emit declaration info into <file>.X\n"
+#: toplev.c:3928
+msgid " -aux-info <file> Emit declaration info into <file>\n"
msgstr ""
-#: toplev.c:3831
+#: toplev.c:3929
msgid ""
" -quiet Do not display functions compiled or elapsed time\n"
msgstr ""
-#: toplev.c:3832
+#: toplev.c:3930
msgid " -version Display the compiler's version\n"
msgstr ""
-#: toplev.c:3833
+#: toplev.c:3931
msgid ""
" -d[letters] Enable dumps from specific passes of the compiler\n"
msgstr ""
-#: toplev.c:3834
+#: toplev.c:3932
msgid ""
" -dumpbase <file> Base name to be used for dumps from specific "
"passes\n"
msgstr ""
-#: toplev.c:3836
+#: toplev.c:3934
msgid " -fsched-verbose=<number> Set the verbosity level of the scheduler\n"
msgstr ""
-#: toplev.c:3838
+#: toplev.c:3936
msgid " --help Display this information\n"
msgstr ""
-#: toplev.c:3853
+#: toplev.c:3951
msgid ""
"\n"
"Language specific options:\n"
msgstr ""
-#: toplev.c:3865
+#: toplev.c:3963
#, c-format
msgid " %-23.23s [undocumented]\n"
msgstr ""
-#: toplev.c:3873 toplev.c:3887
+#: toplev.c:3971 toplev.c:3985
#, c-format
msgid ""
"\n"
"There are undocumented %s specific options as well.\n"
msgstr ""
-#: toplev.c:3877
+#: toplev.c:3975
#, c-format
msgid ""
"\n"
" Options for %s:\n"
msgstr ""
-#: toplev.c:3900
+#: toplev.c:4006
msgid ""
"\n"
"Target specific options:\n"
msgstr ""
-#: toplev.c:3914 toplev.c:3933
+#: toplev.c:4020 toplev.c:4039
#, c-format
-msgid " -m%-21.21s [undocumented]\n"
+msgid " -m%-23.23s [undocumented]\n"
msgstr ""
-#: toplev.c:3942
+#: toplev.c:4048
msgid ""
"\n"
"There are undocumented target specific options as well.\n"
msgstr ""
-#: toplev.c:3944
+#: toplev.c:4050
msgid " They exist, but they are not documented.\n"
msgstr ""
-#: toplev.c:3996
+#: toplev.c:4106
#, c-format
msgid "unrecognized gcc debugging option: %c"
msgstr ""
-#: toplev.c:4058
+#: toplev.c:4172
#, c-format
msgid "unrecognized register name `%s'"
msgstr ""
-#: toplev.c:4085 toplev.c:4699
+#: toplev.c:4196 toplev.c:4880
#, c-format
msgid "Unrecognized option `%s'"
msgstr ""
-#: toplev.c:4212
+#: toplev.c:4322
#, c-format
msgid "use -gdwarf -g%d for DWARF v1, level %d"
msgstr ""
-#: toplev.c:4215
+#: toplev.c:4325
msgid "use -gdwarf-2 for DWARF v2"
msgstr ""
-#: toplev.c:4220
+#: toplev.c:4330
#, c-format
msgid "ignoring option `%s' due to invalid debug level specification"
msgstr ""
-#: toplev.c:4243 toplev.c:4697
+#: toplev.c:4353 toplev.c:4878
#, c-format
msgid "`%s': unknown or unsupported -g option"
msgstr ""
-#: toplev.c:4250
+#: toplev.c:4360
#, c-format
msgid "`%s' ignored, conflicts with `-g%s'"
msgstr ""
-#: toplev.c:4395
+#: toplev.c:4439
+msgid "-param option missing argument"
+msgstr ""
+
+#: toplev.c:4448
+#, c-format
+msgid "invalid --param option: %s"
+msgstr ""
+
+#: toplev.c:4460
+#, c-format
+msgid "invalid parameter value `%s'"
+msgstr ""
+
+#: toplev.c:4551
msgid "`-a' option (basic block profile) not supported"
msgstr ""
-#: toplev.c:4403
+#: toplev.c:4559
msgid "`-ax' option (jump profiling) not supported"
msgstr ""
-#: toplev.c:4689
+#: toplev.c:4870
#, c-format
msgid "Ignoring command line option '%s'"
msgstr ""
-#: toplev.c:4692
+#: toplev.c:4873
#, c-format
msgid "(It is valid for %s but not the selected language)"
msgstr ""
-#: toplev.c:4723
+#: toplev.c:4911
msgid "-Wuninitialized is not supported without -O"
msgstr ""
-#: toplev.c:4765
+#: toplev.c:4938
msgid "`-ax' and `-a' are conflicting options. `-a' ignored."
msgstr ""
-#: toplev.c:4786
+#: toplev.c:4959
msgid "instruction scheduling not supported on this target machine"
msgstr ""
-#: toplev.c:4790
+#: toplev.c:4963
msgid "this target machine does not have delayed branches"
msgstr ""
-#: toplev.c:4804
+#: toplev.c:4972
+msgid "profiling does not work without a frame pointer"
+msgstr ""
+
+#: toplev.c:4987
#, c-format
msgid "-f%sleading-underscore not supported on this target machine"
msgstr ""
-#: toplev.c:4824
+#: toplev.c:5007
#, c-format
msgid "Data size %ld.\n"
msgstr ""
-#: toplev.c:4895
+#: toplev.c:5078
#, c-format
msgid ""
-"%s%s%s version %s (%s) compiled by GNU C version %s.\n"
+"%s%s%s version %s (%s)\n"
+"%s\tcompiled by GNU C version %s.\n"
"%s%s%s version %s (%s) compiled by CC.\n"
msgstr ""
-#: toplev.c:4950
+#: toplev.c:5134
msgid "options passed: "
msgstr ""
-#: toplev.c:4979
+#: toplev.c:5163
msgid "options enabled: "
msgstr ""
-#: tradcpp.c:112
+#: tradcif.y:110 tradcif.y:121
+msgid "division by zero in #if"
+msgstr ""
+
+#. It's a float since it contains a point.
+#: tradcif.y:230
+msgid "floating point numbers not allowed in #if expressions"
+msgstr ""
+
+#: tradcif.y:276
+msgid "Invalid number in #if expression"
+msgstr ""
+
+#: tradcif.y:361
+msgid "Invalid character constant in #if"
+msgstr ""
+
+#: tradcif.y:398
+msgid "double quoted strings not allowed in #if expressions"
+msgstr ""
+
+#: tradcif.y:411
+msgid "Invalid token in expression"
+msgstr ""
+
+#: tradcif.y:502
+msgid "octal character constant does not fit in a byte"
+msgstr ""
+
+#: tradcif.y:527
+msgid "hex character constant does not fit in a byte"
+msgstr ""
+
+#: tradcif.y:558
+msgid "empty #if expression"
+msgstr ""
+
+#: tradcif.y:572
+msgid "Junk after end of expression."
+msgstr ""
+
+#: tradcpp.c:137
msgid "macro or #include recursion too deep"
msgstr ""
-#: tradcpp.c:517
+#: tradcpp.c:550
#, c-format
msgid "Usage: %s [switches] input output"
msgstr ""
-#: tradcpp.c:533
+#: tradcpp.c:566
msgid "-traditional is not supported in C++"
msgstr ""
-#: tradcpp.c:535
+#: tradcpp.c:568
msgid "-traditional and -ansi are mutually exclusive"
msgstr ""
-#: tradcpp.c:549
+#: tradcpp.c:582
msgid "Filename missing after -i option"
msgstr ""
-#: tradcpp.c:567
+#: tradcpp.c:600
msgid "Filename missing after -o option"
msgstr ""
-#: tradcpp.c:618
-msgid "Macro name missing after -D option"
+#: tradcpp.c:659
+#, c-format
+msgid "Target missing after %s option"
+msgstr ""
+
+#: tradcpp.c:673
+#, c-format
+msgid "Filename missing after %s option"
msgstr ""
-#: tradcpp.c:630
-msgid "Macro name missing after -U option"
+#: tradcpp.c:698
+#, c-format
+msgid "Macro name missing after -%c option"
msgstr ""
-#: tradcpp.c:641
+#: tradcpp.c:718
msgid "-pedantic and -traditional are mutually exclusive"
msgstr ""
-#: tradcpp.c:646
+#: tradcpp.c:723
msgid "-trigraphs and -traditional are mutually exclusive"
msgstr ""
-#: tradcpp.c:672
+#: tradcpp.c:749
msgid "Directory name missing after -I option"
msgstr ""
-#: tradcpp.c:1326 tradcpp.c:3402
+#: tradcpp.c:1425 tradcpp.c:3916
msgid "`/*' within comment"
msgstr ""
-#: tradcpp.c:1701
+#: tradcpp.c:1800
#, c-format
msgid "unterminated #%s conditional"
msgstr ""
-#: tradcpp.c:2060
+#: tradcpp.c:2159
msgid "not in any file?!"
msgstr ""
-#: tradcpp.c:2148
+#: tradcpp.c:2265
msgid "`defined' must be followed by ident or (ident)"
msgstr ""
-#: tradcpp.c:2152
+#: tradcpp.c:2269
msgid "cccp error: invalid special hash type"
msgstr ""
-#: tradcpp.c:2256
+#: tradcpp.c:2367 tradcpp.c:2437
msgid "#include expects \"fname\" or <fname>"
msgstr ""
-#: tradcpp.c:2305
+#: tradcpp.c:2522
#, c-format
-msgid "nonexistent file <%.*s> omitted from dependency output"
+msgid "No include path in which to find %.*s"
msgstr ""
-#: tradcpp.c:2485
+#: tradcpp.c:2700
msgid "invalid macro name"
msgstr ""
-#: tradcpp.c:2491
+#: tradcpp.c:2708
#, c-format
msgid "invalid macro name `%s'"
msgstr ""
-#: tradcpp.c:2494
-msgid "defining `defined' as a macro"
+#: tradcpp.c:2713
+msgid "\"defined\" cannot be used as a macro name"
msgstr ""
-#: tradcpp.c:2519
+#: tradcpp.c:2740
msgid "parameter name starts with a digit in #define"
msgstr ""
-#: tradcpp.c:2529
+#: tradcpp.c:2750
msgid "badly punctuated parameter list in #define"
msgstr ""
-#: tradcpp.c:2537
+#: tradcpp.c:2758
msgid "unterminated parameter list in #define"
msgstr ""
-#: tradcpp.c:2582
+#: tradcpp.c:2806
#, c-format
msgid "\"%.*s\" redefined"
msgstr ""
-#: tradcpp.c:2838
+#: tradcpp.c:3063
msgid "# operator should be followed by a macro argument name"
msgstr ""
-#: tradcpp.c:2886 tradcpp.c:2901 tradcpp.c:2919 tradcpp.c:2933 tradcpp.c:2940
-#: tradcpp.c:2965
+#: tradcpp.c:3110 tradcpp.c:3136 tradcpp.c:3150 tradcpp.c:3157 tradcpp.c:3182
msgid "invalid format #line command"
msgstr ""
-#: tradcpp.c:2991
+#: tradcpp.c:3208
msgid "undefining `defined'"
msgstr ""
-#: tradcpp.c:2995
+#: tradcpp.c:3212
#, c-format
msgid "undefining `%s'"
msgstr ""
-#: tradcpp.c:3039
+#: tradcpp.c:3268
+msgid "extra text at end of directive"
+msgstr ""
+
+#: tradcpp.c:3375
+#, c-format
+msgid "#error%.*s"
+msgstr ""
+
+#: tradcpp.c:3385
+#, c-format
+msgid "#warning%.*s"
+msgstr ""
+
+#: tradcpp.c:3541
msgid "#elif not within a conditional"
msgstr ""
-#: tradcpp.c:3282
+#: tradcpp.c:3798
#, c-format
msgid "#%s not within a conditional"
msgstr ""
-#: tradcpp.c:3290
+#: tradcpp.c:3806
msgid "#else or #elif after #else"
msgstr ""
-#: tradcpp.c:3331
+#: tradcpp.c:3846
msgid "#else not within a conditional"
msgstr ""
-#: tradcpp.c:3363
+#: tradcpp.c:3877
msgid "unbalanced #endif"
msgstr ""
-#: tradcpp.c:3457
+#: tradcpp.c:3971
msgid "unterminated string or character constant"
msgstr ""
-#: tradcpp.c:3613
+#: tradcpp.c:4129
#, c-format
msgid "arguments given to macro `%s'"
msgstr ""
-#: tradcpp.c:3619
+#: tradcpp.c:4135
#, c-format
msgid "no args to macro `%s'"
msgstr ""
-#: tradcpp.c:3621
+#: tradcpp.c:4137
#, c-format
msgid "only 1 arg to macro `%s'"
msgstr ""
-#: tradcpp.c:3623
+#: tradcpp.c:4139
#, c-format
msgid "only %d args to macro `%s'"
msgstr ""
-#: tradcpp.c:3625
+#: tradcpp.c:4141
#, c-format
msgid "too many (%d) args to macro `%s'"
msgstr ""
-#: tradcpp.c:4251
+#: tradcpp.c:4767
#, c-format
msgid ""
"Internal error in %s, at tradcpp.c:%d\n"
@@ -10648,118 +13692,113 @@ msgid ""
"See %s for instructions."
msgstr ""
-#: tree.c:1295
-#, c-format
-msgid "`%s' and `%s' identical in first %d characters"
-msgstr ""
-
-#: tree.c:4749
+#: tree.c:3879
msgid "arrays of functions are not meaningful"
msgstr ""
-#: tree.c:4806
+#: tree.c:3936
msgid "function return type cannot be function"
msgstr ""
-#: tree.c:5541
+#: tree.c:4673
msgid "invalid initializer for bit string"
msgstr ""
-#: tree.c:5600
+#: tree.c:4732
#, c-format
-msgid "Tree check: expected %s, have %s"
+msgid "Tree check: expected %s, have %s in %s, at %s:%d"
msgstr ""
-#: tree.c:5616
+#: tree.c:4749
#, c-format
-msgid "Tree check: expected class '%c', have '%c' (%s)"
+msgid "Tree check: expected class '%c', have '%c' (%s) in %s, at %s:%d"
msgstr ""
-#: varasm.c:726
+#: varasm.c:639
#, c-format
msgid "register name not specified for `%s'"
msgstr ""
-#: varasm.c:728
+#: varasm.c:641
#, c-format
msgid "invalid register name for `%s'"
msgstr ""
-#: varasm.c:731
+#: varasm.c:644
#, c-format
msgid "data type of `%s' isn't suitable for a register"
msgstr ""
-#: varasm.c:734
+#: varasm.c:647
#, c-format
msgid "register specified for `%s' isn't suitable for data type"
msgstr ""
-#: varasm.c:743
+#: varasm.c:656
msgid "global register variable has initial value"
msgstr ""
-#: varasm.c:746
+#: varasm.c:659
msgid "volatile register variables don't work as you might wish"
msgstr ""
-#: varasm.c:781
+#: varasm.c:695
#, c-format
msgid "register name given for non-register variable `%s'"
msgstr ""
-#: varasm.c:1417
+#: varasm.c:1333
#, c-format
msgid "size of variable `%s' is too large"
msgstr ""
-#: varasm.c:1457
+#: varasm.c:1373
#, c-format
msgid ""
"alignment of `%s' is greater than maximum object file alignment. Using %d."
msgstr ""
-#: varasm.c:1504
+#: varasm.c:1420
#, c-format
msgid "requested alignment for %s is greater than implemented alignment of %d."
msgstr ""
-#: varasm.c:1976
+#: varasm.c:1899
msgid "floating point trap outputting a constant"
msgstr ""
-#: varasm.c:4286
+#: varasm.c:4304
msgid "initializer for integer value is too complicated"
msgstr ""
-#: varasm.c:4292
+#: varasm.c:4310
msgid "initializer for floating value is not a floating constant"
msgstr ""
-#: varasm.c:4349
+#: varasm.c:4367
msgid "unknown set constructor type"
msgstr ""
-#: varasm.c:4494
+#: varasm.c:4572
#, c-format
msgid "invalid initial value for member `%s'"
msgstr ""
-#: varasm.c:4676
+#: varasm.c:4754
#, c-format
msgid "weak declaration of `%s' must be public"
msgstr ""
-#: varasm.c:4678
+#: varasm.c:4756
#, c-format
msgid "weak declaration of `%s' must precede definition"
msgstr ""
-#: varasm.c:4771
+#: varasm.c:4852
msgid "only weak aliases are supported in this configuration"
msgstr ""
-#: varasm.c:4776
+#: varasm.c:4857
msgid "alias definitions not supported in this configuration; ignored"
msgstr ""
@@ -10769,28 +13808,32 @@ msgid "Virtual array %s[%lu]: element %lu out of bounds"
msgstr ""
#. Print an error message for unrecognized stab codes.
-#: xcoffout.c:182
+#: xcoffout.c:176
#, c-format
-msgid "Unknown stab %s: : 0x%x\n"
+msgid "No sclass for %s stab (0x%x)\n"
+msgstr ""
+
+#: config/alpha/freebsd.h:35 config/i386/freebsd-aout.h:236
+msgid "`-p' not supported; use `-pg' and gprof(1)"
msgstr ""
-#: config/arc/arc.h:60 config/mips/mips.h:910
+#: config/arc/arc.h:61 config/mips/mips.h:918
msgid "may not use both -EB and -EL"
msgstr ""
-#: config/arm/arm.h:205
+#: config/arm/arm.h:216
msgid "-mapcs-26 and -mapcs-32 may not be used together"
msgstr ""
-#: config/arm/arm.h:217
+#: config/arm/arm.h:228
msgid "-msoft-float and -mhard_float may not be used together"
msgstr ""
-#: config/arm/arm.h:228
+#: config/arm/arm.h:239
msgid "-mbig-endian and -mlittle-endian may not be used together"
msgstr ""
-#: config/arm/arm.h:246
+#: config/arm/arm.h:257
msgid "Incompatible interworking options"
msgstr ""
@@ -10810,51 +13853,79 @@ msgstr ""
msgid "A -ifile option requires a -map option"
msgstr ""
-#: config/i386/freebsd-aout.h:236
-msgid "`-p' not supported; use `-pg' and gprof(1)"
+#: config/i386/cygwin.h:103
+msgid "mno-cygwin and mno-win32 are not compatible"
msgstr ""
-#: config/i386/sco5.h:788 config/i386/sco5.h:863
+#: config/i386/cygwin.h:158 config/i386/mingw32.h:63
+msgid "shared and mdll are not compatible"
+msgstr ""
+
+#: config/i386/sco5.h:777 config/i386/sco5.h:852
msgid "-static not valid with -mcoff"
msgstr ""
-#: config/i386/sco5.h:789 config/i386/sco5.h:864
+#: config/i386/sco5.h:778 config/i386/sco5.h:853
msgid "-shared not valid with -mcoff"
msgstr ""
-#: config/i386/sco5.h:790 config/i386/sco5.h:865
+#: config/i386/sco5.h:779 config/i386/sco5.h:854
msgid "-symbolic not valid with -mcoff"
msgstr ""
-#: config/i386/sco5.h:828
+#: config/i386/sco5.h:817
msgid "-fpic is not valid with -mcoff"
msgstr ""
-#: config/i386/sco5.h:829
+#: config/i386/sco5.h:818
msgid "-fPIC is not valid with -mcoff"
msgstr ""
-#: config/i386/sco5.h:866
+#: config/i386/sco5.h:855
msgid "-fpic not valid with -mcoff"
msgstr ""
-#: config/i386/sco5.h:867
+#: config/i386/sco5.h:856
msgid "-fPIC not valid with -mcoff"
msgstr ""
+#: config/i386/unix.h:122
+msgid "bx]"
+msgstr ""
+
+#: config/i386/unix.h:124
+msgid "bx"
+msgstr ""
+
+#: config/i386/unix.h:125
+msgid "cx"
+msgstr ""
+
#: config/i860/fx2800.h:305
msgid "-p option not supported: use -pg instead"
msgstr ""
-#: config/mips/mips.h:766
+#: config/mcore/mcore.h:65
+msgid "choose either big or little endian, not both"
+msgstr ""
+
+#: config/mcore/mcore.h:68
+msgid "choose either m340 or m210 not both"
+msgstr ""
+
+#: config/mcore/mcore.h:69
+msgid "the m210 does not have little endian support"
+msgstr ""
+
+#: config/mips/mips.h:774
msgid "-pipe is not supported."
msgstr ""
-#: config/mips/mips.h:905
+#: config/mips/mips.h:913
msgid "may not use both -mfp64 and -msingle-float"
msgstr ""
-#: config/mips/mips.h:906
+#: config/mips/mips.h:914
msgid "may not use both -mfp64 and -m4650"
msgstr ""
@@ -10874,18 +13945,26 @@ msgstr ""
msgid "profiling not supported with -mg\n"
msgstr ""
-#: gcc.c:558
+#: f/lang-specs.h:35 gcc.c:593
msgid "GNU C does not support -C without using -E"
msgstr ""
-#: gcc.c:573
+#: gcc.c:614 java/jvspec.c:68
msgid "-pg and -fomit-frame-pointer are incompatible"
msgstr ""
-#: gcc.c:707
+#: gcc.c:762
msgid "-E required when input is from standard input"
msgstr ""
-#: gcc.c:711
+#: gcc.c:766
msgid "Compilation of header file requested"
msgstr ""
+
+#: java/lang-specs.h:33
+msgid "-fjni and -femit-class-files are incompatible"
+msgstr ""
+
+#: java/lang-specs.h:34
+msgid "-fjni and -femit-class-file are incompatible"
+msgstr ""
diff --git a/gcc/predict.c b/gcc/predict.c
index d598ef92e6c..cb8aa5671ae 100644
--- a/gcc/predict.c
+++ b/gcc/predict.c
@@ -45,7 +45,6 @@
#include "except.h"
#include "toplev.h"
#include "recog.h"
-#include "insn-flags.h"
#include "expr.h"
@@ -296,7 +295,7 @@ expected_value_to_br_prob ()
cond = simplify_rtx (cond);
/* Turn the condition into a scaled branch probability. */
- if (cond == const1_rtx)
+ if (cond == const_true_rtx)
cond = GEN_INT (PROB_VERY_LIKELY);
else if (cond == const0_rtx)
cond = GEN_INT (PROB_VERY_UNLIKELY);
diff --git a/gcc/print-rtl.c b/gcc/print-rtl.c
index 23d889a873b..e2de3492070 100644
--- a/gcc/print-rtl.c
+++ b/gcc/print-rtl.c
@@ -47,8 +47,6 @@ const char * reg_names[] = REGISTER_NAMES;
static FILE *outfile;
-static const char xspaces[] = " ";
-
static int sawclose = 0;
static int indent;
@@ -91,9 +89,8 @@ print_rtx (in_rtx)
if (flag_simple)
fputc (' ', outfile);
else
- fprintf (outfile, "\n%s%s",
- print_rtx_head,
- (xspaces + (sizeof xspaces - 1 - indent * 2)));
+ fprintf (outfile, "\n%s%*s",
+ print_rtx_head, indent * 2, "");
sawclose = 0;
}
@@ -282,9 +279,8 @@ print_rtx (in_rtx)
indent += 2;
if (sawclose)
{
- fprintf (outfile, "\n%s%s",
- print_rtx_head,
- (xspaces + (sizeof xspaces - 1 - indent * 2)));
+ fprintf (outfile, "\n%s%*s",
+ print_rtx_head, indent * 2, "");
sawclose = 0;
}
fputs ("[ ", outfile);
@@ -300,9 +296,8 @@ print_rtx (in_rtx)
indent -= 2;
}
if (sawclose)
- fprintf (outfile, "\n%s%s",
- print_rtx_head,
- (xspaces + (sizeof xspaces - 1 - indent * 2)));
+ fprintf (outfile, "\n%s%*s",
+ print_rtx_head, indent * 2, "");
fputs ("] ", outfile);
sawclose = 1;
@@ -364,8 +359,8 @@ print_rtx (in_rtx)
/* Print NOTE_INSN names rather than integer codes. */
case 'n':
- if (XINT (in_rtx, i) >= NOTE_INSN_BIAS
- && XINT (in_rtx, i) < NOTE_INSN_MAX)
+ if (XINT (in_rtx, i) >= (int) NOTE_INSN_BIAS
+ && XINT (in_rtx, i) < (int) NOTE_INSN_MAX)
fprintf (outfile, " %s", GET_NOTE_INSN_NAME (XINT (in_rtx, i)));
else
fprintf (outfile, " %d", XINT (in_rtx, i));
diff --git a/gcc/print-tree.c b/gcc/print-tree.c
index a3674468f4f..9b138f56212 100644
--- a/gcc/print-tree.c
+++ b/gcc/print-tree.c
@@ -400,11 +400,6 @@ print_node (file, prefix, node, indent)
DECL_OFFSET_ALIGN (node));
}
}
- else if (DECL_INLINE (node))
- {
- fprintf (file, " frame_size ");
- fprintf (file, HOST_WIDE_INT_PRINT_DEC, DECL_FRAME_SIZE (node));
- }
else if (DECL_BUILT_IN (node))
{
if (DECL_BUILT_IN_CLASS (node) == BUILT_IN_MD)
@@ -441,7 +436,7 @@ print_node (file, prefix, node, indent)
print_lang_decl (file, node, indent);
- if (DECL_RTL (node) != 0)
+ if (DECL_RTL_SET_P (node))
{
indent_to (file, indent + 4);
print_rtl (file, DECL_RTL (node));
@@ -641,7 +636,7 @@ print_node (file, prefix, node, indent)
EXPR_WFL_FILENAME (node) : "(no file info)"),
EXPR_WFL_LINENO (node), EXPR_WFL_COLNO (node));
}
- print_node (file, "chain", BLOCK_CHAIN (node), indent + 4);
+ print_node (file, "chain", TREE_CHAIN (node), indent + 4);
break;
case 'c':
diff --git a/gcc/profile.c b/gcc/profile.c
index 3cdd34b130a..f26c8a95581 100644
--- a/gcc/profile.c
+++ b/gcc/profile.c
@@ -38,7 +38,6 @@ Boston, MA 02111-1307, USA. */
#include "rtl.h"
#include "tree.h"
#include "flags.h"
-#include "insn-flags.h"
#include "insn-config.h"
#include "output.h"
#include "regs.h"
@@ -101,6 +100,7 @@ int count_instrumented_edges;
static int total_num_blocks;
static int total_num_edges;
+static int total_num_edges_ignored;
static int total_num_edges_instrumented;
static int total_num_blocks_created;
static int total_num_passes;
@@ -533,7 +533,7 @@ void
branch_prob ()
{
int i;
- int num_edges;
+ int num_edges, ignored_edges;
struct edge_info *edge_infos;
struct edge_list *el;
@@ -620,6 +620,7 @@ branch_prob ()
edge_infos = (struct edge_info *)
xcalloc (num_edges, sizeof (struct edge_info));
+ ignored_edges = 0;
for (i = 0 ; i < num_edges ; i++)
{
edge e = INDEX_EDGE (el, i);
@@ -629,17 +630,12 @@ branch_prob ()
/* Mark edges we've replaced by fake edges above as ignored. */
if ((e->flags & (EDGE_ABNORMAL | EDGE_ABNORMAL_CALL))
&& e->src != ENTRY_BLOCK_PTR && e->dest != EXIT_BLOCK_PTR)
- EDGE_INFO (e)->ignore = 1;
+ {
+ EDGE_INFO (e)->ignore = 1;
+ ignored_edges++;
+ }
}
- total_num_blocks += n_basic_blocks + 2;
- if (rtl_dump_file)
- fprintf (rtl_dump_file, "%d basic blocks\n", n_basic_blocks);
-
- total_num_edges += num_edges;
- if (rtl_dump_file)
- fprintf (rtl_dump_file, "%d edges\n", num_edges);
-
#ifdef ENABLE_CHECKING
verify_flow_info ();
#endif
@@ -716,6 +712,31 @@ branch_prob ()
find_spanning_tree (el);
+ /* Fake edges that are not on the tree will not be instrumented, so
+ mark them ignored. */
+ for (i = 0; i < num_edges; i++)
+ {
+ edge e = INDEX_EDGE (el, i);
+ struct edge_info *inf = EDGE_INFO (e);
+ if ((e->flags & EDGE_FAKE) && !inf->ignore && !inf->on_tree)
+ {
+ inf->ignore = 1;
+ ignored_edges++;
+ }
+ }
+
+ total_num_blocks += n_basic_blocks + 2;
+ if (rtl_dump_file)
+ fprintf (rtl_dump_file, "%d basic blocks\n", n_basic_blocks);
+
+ total_num_edges += num_edges;
+ if (rtl_dump_file)
+ fprintf (rtl_dump_file, "%d edges\n", num_edges);
+
+ total_num_edges_ignored += ignored_edges;
+ if (rtl_dump_file)
+ fprintf (rtl_dump_file, "%d ignored edges\n", ignored_edges);
+
/* Create a .bbg file from which gcov can reconstruct the basic block
graph. First output the number of basic blocks, and then for every
edge output the source and target basic block numbers.
@@ -727,7 +748,7 @@ branch_prob ()
/* The plus 2 stands for entry and exit block. */
__write_long (n_basic_blocks + 2, bbg_file, 4);
- __write_long (num_edges + 1, bbg_file, 4);
+ __write_long (num_edges - ignored_edges + 1, bbg_file, 4);
for (i = 0; i < n_basic_blocks + 1; i++)
{
@@ -748,7 +769,7 @@ branch_prob ()
flag_bits = 0;
if (i->on_tree)
flag_bits |= 0x1;
- if (e->flags & EDGE_ABNORMAL)
+ if (e->flags & EDGE_FAKE)
flag_bits |= 0x2;
if (e->flags & EDGE_FALLTHRU)
flag_bits |= 0x4;
@@ -944,6 +965,7 @@ init_branch_prob (filename)
total_num_blocks = 0;
total_num_edges = 0;
+ total_num_edges_ignored = 0;
total_num_edges_instrumented = 0;
total_num_blocks_created = 0;
total_num_passes = 0;
@@ -989,6 +1011,8 @@ end_branch_prob ()
fprintf (rtl_dump_file, "Total number of blocks: %d\n",
total_num_blocks);
fprintf (rtl_dump_file, "Total number of edges: %d\n", total_num_edges);
+ fprintf (rtl_dump_file, "Total number of ignored edges: %d\n",
+ total_num_edges_ignored);
fprintf (rtl_dump_file, "Total number of instrumented edges: %d\n",
total_num_edges_instrumented);
fprintf (rtl_dump_file, "Total number of blocks created: %d\n",
@@ -1108,7 +1132,6 @@ output_func_start_profiler ()
TREE_PUBLIC (fndecl) = 1;
#endif
- DECL_ASSEMBLER_NAME (fndecl) = fnname;
DECL_RESULT (fndecl) = build_decl (RESULT_DECL, NULL_TREE, void_type_node);
fndecl = pushdecl (fndecl);
diff --git a/gcc/protoize.c b/gcc/protoize.c
index 6780b002161..aa03edf233f 100644
--- a/gcc/protoize.c
+++ b/gcc/protoize.c
@@ -25,6 +25,9 @@ Boston, MA 02111-1307, USA. */
#include <setjmp.h>
#include <signal.h>
+#if ! defined( SIGCHLD ) && defined( SIGCLD )
+# define SIGCHLD SIGCLD
+#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
@@ -4583,6 +4586,12 @@ main (argc, argv)
#endif
pname = pname ? pname+1 : argv[0];
+#ifdef SIGCHLD
+ /* We *MUST* set SIGCHLD to SIG_DFL so that the wait4() call will
+ receive the signal. A different setting is inheritable */
+ signal (SIGCHLD, SIG_DFL);
+#endif
+
/* LC_CTYPE determines the character set used by the terminal so it has be set
to output messages correctly. */
diff --git a/gcc/pself.c b/gcc/pself.c
deleted file mode 100644
index d8471daafea..00000000000
--- a/gcc/pself.c
+++ /dev/null
@@ -1 +0,0 @@
-main(){char*p="main(){char*p=%c%s%c;(void)printf(p,34,p,34,10);}%c";(void)printf(p,34,p,34,10);}
diff --git a/gcc/pself1.c b/gcc/pself1.c
deleted file mode 100644
index acdfc650583..00000000000
--- a/gcc/pself1.c
+++ /dev/null
@@ -1 +0,0 @@
-main(a){a="main(a){a=%c%s%c;printf(a,34,a,34);}";printf(a,34,a,34);} \ No newline at end of file
diff --git a/gcc/pself2.c b/gcc/pself2.c
deleted file mode 100644
index c88a8c1046d..00000000000
--- a/gcc/pself2.c
+++ /dev/null
@@ -1 +0,0 @@
-main(){char*a="main(){char*a=%c%s%c;int b='%c';printf(a,b,a,b,b);}";int b='"';printf(a,b,a,b,b);}
diff --git a/gcc/pself3.c b/gcc/pself3.c
deleted file mode 100644
index dbdeac6e410..00000000000
--- a/gcc/pself3.c
+++ /dev/null
@@ -1 +0,0 @@
-main(a){printf(a,34,a="main(a){printf(a,34,a=%c%s%c,34);}",34);}
diff --git a/gcc/pself4.c b/gcc/pself4.c
deleted file mode 100644
index 02a6f7cded6..00000000000
--- a/gcc/pself4.c
+++ /dev/null
@@ -1,2 +0,0 @@
-#include <stdio.h>
-int main(void){char*p="#include <stdio.h>%cint main(void){char*p=%c%s%c;(void)printf(p,10,34,p,34,10);return 0;}%c";(void)printf(p,10,34,p,34,10);return 0;}
diff --git a/gcc/pself5.c b/gcc/pself5.c
deleted file mode 100644
index 8f6f8e3b26f..00000000000
--- a/gcc/pself5.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <stdio.h>
-#define N '\n'
-#define Q '\"'
-#define B '\\'
-int main(void){char*p="#include <stdio.h>%c#define N '%cn'%c#define Q '%c%c'%c#define B '%c%c'%cint main(void){char*p=%c%s%c;(void)printf(p,N,B,N,B,Q,N,B,B,N,Q,p,Q,N);return 0;}%c";(void)printf(p,N,B,N,B,Q,N,B,B,N,Q,p,Q,N);return 0;}
diff --git a/gcc/recog.c b/gcc/recog.c
index 4dab907c848..f847b4f8142 100644
--- a/gcc/recog.c
+++ b/gcc/recog.c
@@ -26,8 +26,6 @@ Boston, MA 02111-1307, USA. */
#include "tm_p.h"
#include "insn-config.h"
#include "insn-attr.h"
-#include "insn-flags.h"
-#include "insn-codes.h"
#include "hard-reg-set.h"
#include "recog.h"
#include "regs.h"
@@ -183,7 +181,7 @@ static int changes_allocated;
static int num_changes = 0;
-/* Validate a proposed change to OBJECT. LOC is the location in the rtl for
+/* Validate a proposed change to OBJECT. LOC is the location in the rtl
at which NEW will be placed. If OBJECT is zero, no validation is done,
the change is simply made.
@@ -439,7 +437,15 @@ validate_replace_rtx_1 (loc, from, to, object)
validate_replace_rtx_1 (&XEXP (x, 0), from, to, object);
validate_replace_rtx_1 (&XEXP (x, 1), from, to, object);
- if (prev_changes != num_changes && CONSTANT_P (XEXP (x, 0)))
+ /* If nothing changed, we can exit now. In fact, continuing on
+ into the switch statement below can be wrong, eg. turning
+ (plus (symbol_ref) (const_int)) into
+ (const (plus (symbol_ref) (const_int))). This might not seem
+ so bad, but the first rtx is already enclosed in `const', so
+ we get a string of (const (const (const...))). */
+ if (prev_changes == num_changes)
+ return;
+ if (CONSTANT_P (XEXP (x, 0)))
{
validate_change (object, loc,
gen_rtx_fmt_ee (GET_RTX_CLASS (code) == 'c' ? code
diff --git a/gcc/reg-stack.c b/gcc/reg-stack.c
index 48dd3bd6966..820fc19dabd 100644
--- a/gcc/reg-stack.c
+++ b/gcc/reg-stack.c
@@ -161,7 +161,6 @@
#include "regs.h"
#include "hard-reg-set.h"
#include "flags.h"
-#include "insn-flags.h"
#include "toplev.h"
#include "recog.h"
#include "output.h"
@@ -334,22 +333,18 @@ next_flags_user (insn)
{
/* Search forward looking for the first use of this value.
Stop at block boundaries. */
- /* ??? This really cries for BLOCK_END! */
- while (1)
+ while (insn != current_block->end)
{
insn = NEXT_INSN (insn);
- if (!insn)
- return NULL_RTX;
if (INSN_P (insn) && reg_mentioned_p (ix86_flags_rtx, PATTERN (insn)))
return insn;
- if (GET_CODE (insn) == JUMP_INSN
- || GET_CODE (insn) == CODE_LABEL
- || GET_CODE (insn) == CALL_INSN)
+ if (GET_CODE (insn) == CALL_INSN)
return NULL_RTX;
}
+ return NULL_RTX;
}
/* Reorganise the stack into ascending numbers,
@@ -788,12 +783,8 @@ stack_result (decl)
if (aggregate_value_p (DECL_RESULT (decl)))
return 0;
- result = DECL_RTL (DECL_RESULT (decl));
- /* ?!? What is this code supposed to do? Can this code actually
- trigger if we kick out aggregates above? */
- if (result != 0
- && ! (GET_CODE (result) == REG
- && REGNO (result) < FIRST_PSEUDO_REGISTER))
+ result = DECL_RTL_IF_SET (DECL_RESULT (decl));
+ if (result != 0)
{
#ifdef FUNCTION_OUTGOING_VALUE
result
@@ -1122,7 +1113,8 @@ move_for_stack_reg (insn, regstack, pat)
regstack->top--;
CLEAR_HARD_REG_BIT (regstack->reg_set, REGNO (src));
}
- else if (GET_MODE (src) == XFmode && regstack->top < REG_STACK_SIZE - 1)
+ else if ((GET_MODE (src) == XFmode || GET_MODE (src) == TFmode)
+ && regstack->top < REG_STACK_SIZE - 1)
{
/* A 387 cannot write an XFmode value to a MEM without
clobbering the source reg. The output code can handle
@@ -1230,17 +1222,12 @@ swap_rtx_condition (insn)
/* Search forward looking for the first use of this value.
Stop at block boundaries. */
- /* ??? This really cries for BLOCK_END! */
- while (1)
+ while (insn != current_block->end)
{
insn = NEXT_INSN (insn);
- if (insn == NULL_RTX)
- return 0;
if (INSN_P (insn) && reg_mentioned_p (dest, insn))
break;
- if (GET_CODE (insn) == JUMP_INSN)
- return 0;
- if (GET_CODE (insn) == CODE_LABEL)
+ if (GET_CODE (insn) == CALL_INSN)
return 0;
}
@@ -1263,8 +1250,19 @@ swap_rtx_condition (insn)
if (swap_rtx_condition_1 (pat))
{
+ int fail = 0;
INSN_CODE (insn) = -1;
if (recog_memoized (insn) == -1)
+ fail = 1;
+ /* In case the flags don't die here, recurse to try fix
+ following user too. */
+ else if (! dead_or_set_p (insn, ix86_flags_rtx))
+ {
+ insn = next_flags_user (insn);
+ if (!insn || !swap_rtx_condition (insn))
+ fail = 1;
+ }
+ if (fail)
{
swap_rtx_condition_1 (pat);
return 0;
@@ -2554,10 +2552,15 @@ convert_regs_1 (file, block)
}
}
- /* Care for EH edges specially. The normal return path may return
- a value in st(0), but the EH path will not, and there's no need
- to add popping code to the edge. */
- if (e->flags & (EDGE_EH | EDGE_ABNORMAL_CALL))
+ /* Care for non-call EH edges specially. The normal return path have
+ values in registers. These will be popped en masse by the unwind
+ library. */
+ if ((e->flags & (EDGE_EH | EDGE_ABNORMAL_CALL)) == EDGE_EH)
+ target_stack->top = -1;
+
+ /* Other calls may appear to have values live in st(0), but the
+ abnormal return path will not have actually loaded the values. */
+ else if (e->flags & EDGE_ABNORMAL_CALL)
{
/* Assert that the lifetimes are as we expect -- one value
live at st(0) on the end of the source block, and no
diff --git a/gcc/regclass.c b/gcc/regclass.c
index 610de28f1b4..a9077e146b1 100644
--- a/gcc/regclass.c
+++ b/gcc/regclass.c
@@ -174,6 +174,10 @@ const char * reg_names[] = REGISTER_NAMES;
enum machine_mode reg_raw_mode[FIRST_PSEUDO_REGISTER];
+/* 1 if class does contain register of given mode. */
+
+static char contains_reg_of_mode [N_REG_CLASSES] [MAX_MACHINE_MODE];
+
/* Maximum cost of moving from a register in one class to a register in
another class. Based on REGISTER_MOVE_COST. */
@@ -288,6 +292,7 @@ init_reg_sets_1 ()
{
register unsigned int i, j;
register unsigned int /* enum machine_mode */ m;
+ char allocatable_regs_of_mode [MAX_MACHINE_MODE];
/* This macro allows the fixed or call-used registers
and the register classes to depend on target flags. */
@@ -423,44 +428,76 @@ init_reg_sets_1 ()
if (CLASS_LIKELY_SPILLED_P (REGNO_REG_CLASS (i)))
SET_HARD_REG_BIT (losing_caller_save_reg_set, i);
}
+ memset (contains_reg_of_mode, 0, sizeof (contains_reg_of_mode));
+ memset (allocatable_regs_of_mode, 0, sizeof (allocatable_regs_of_mode));
+ for (m = 0; m < (unsigned int) MAX_MACHINE_MODE; m++)
+ for (i = 0; i < N_REG_CLASSES; i++)
+ if (CLASS_MAX_NREGS (i, m) <= reg_class_size[i])
+ for (j = 0; j < FIRST_PSEUDO_REGISTER; j++)
+ if (!fixed_regs [j] && TEST_HARD_REG_BIT (reg_class_contents[i], j)
+ && HARD_REGNO_MODE_OK (j, m))
+ {
+ contains_reg_of_mode [i][m] = 1;
+ allocatable_regs_of_mode [m] = 1;
+ break;
+ }
/* Initialize the move cost table. Find every subset of each class
and take the maximum cost of moving any subset to any other. */
- for (m = 0; m < MAX_MACHINE_MODE; m++)
- for (i = 0; i < N_REG_CLASSES; i++)
- for (j = 0; j < N_REG_CLASSES; j++)
- {
- int cost = i == j ? 2 : REGISTER_MOVE_COST (m, i, j);
- enum reg_class *p1, *p2;
-
- for (p2 = &reg_class_subclasses[j][0]; *p2 != LIM_REG_CLASSES; p2++)
- if (*p2 != i)
- cost = MAX (cost, REGISTER_MOVE_COST (m, i, *p2));
-
- for (p1 = &reg_class_subclasses[i][0]; *p1 != LIM_REG_CLASSES; p1++)
- {
- if (*p1 != j)
- cost = MAX (cost, REGISTER_MOVE_COST (m, *p1, j));
-
- for (p2 = &reg_class_subclasses[j][0];
- *p2 != LIM_REG_CLASSES; p2++)
- if (*p1 != *p2)
- cost = MAX (cost, REGISTER_MOVE_COST (m, *p1, *p2));
- }
-
- move_cost[m][i][j] = cost;
-
- if (reg_class_subset_p (i, j))
- may_move_in_cost[m][i][j] = 0;
- else
- may_move_in_cost[m][i][j] = cost;
-
- if (reg_class_subset_p (j, i))
- may_move_out_cost[m][i][j] = 0;
+ for (m = 0; m < (unsigned int) MAX_MACHINE_MODE; m++)
+ if (allocatable_regs_of_mode [m])
+ {
+ for (i = 0; i < N_REG_CLASSES; i++)
+ if (contains_reg_of_mode [i][m])
+ for (j = 0; j < N_REG_CLASSES; j++)
+ {
+ int cost;
+ enum reg_class *p1, *p2;
+
+ if (!contains_reg_of_mode [j][m])
+ {
+ move_cost[m][i][j] = 65536;
+ may_move_in_cost[m][i][j] = 65536;
+ may_move_out_cost[m][i][j] = 65536;
+ }
+ else
+ {
+ cost = i == j ? 2 : REGISTER_MOVE_COST (m, i, j);
+
+ for (p2 = &reg_class_subclasses[j][0];
+ *p2 != LIM_REG_CLASSES;
+ p2++)
+ if (*p2 != i && contains_reg_of_mode [*p2][m])
+ cost = MAX (cost, move_cost [m][i][*p2]);
+
+ for (p1 = &reg_class_subclasses[i][0];
+ *p1 != LIM_REG_CLASSES;
+ p1++)
+ if (*p1 != j && contains_reg_of_mode [*p1][m])
+ cost = MAX (cost, move_cost [m][*p1][j]);
+
+ move_cost[m][i][j] = cost;
+
+ if (reg_class_subset_p (i, j))
+ may_move_in_cost[m][i][j] = 0;
+ else
+ may_move_in_cost[m][i][j] = cost;
+
+ if (reg_class_subset_p (j, i))
+ may_move_out_cost[m][i][j] = 0;
+ else
+ may_move_out_cost[m][i][j] = cost;
+ }
+ }
else
- may_move_out_cost[m][i][j] = cost;
- }
+ for (j = 0; j < N_REG_CLASSES; j++)
+ {
+ move_cost[m][i][j] = 65536;
+ may_move_in_cost[m][i][j] = 65536;
+ may_move_out_cost[m][i][j] = 65536;
+ }
+ }
#ifdef CLASS_CANNOT_CHANGE_MODE
{
@@ -594,6 +631,7 @@ choose_hard_reg_mode (regno, nregs)
unsigned int regno ATTRIBUTE_UNUSED;
unsigned int nregs;
{
+ unsigned int /* enum machine_mode */ m;
enum machine_mode found_mode = VOIDmode, mode;
/* We first look for the largest integer mode that can be validly
@@ -621,10 +659,13 @@ choose_hard_reg_mode (regno, nregs)
return found_mode;
/* Iterate over all of the CCmodes. */
- for (mode = CCmode; mode < NUM_MACHINE_MODES; ++mode)
- if (HARD_REGNO_NREGS (regno, mode) == nregs
- && HARD_REGNO_MODE_OK (regno, mode))
- return mode;
+ for (m = (unsigned int) CCmode; m < (unsigned int) NUM_MACHINE_MODES; ++m)
+ {
+ mode = (enum machine_mode) m;
+ if (HARD_REGNO_NREGS (regno, mode) == nregs
+ && HARD_REGNO_MODE_OK (regno, mode))
+ return mode;
+ }
/* We can't find a mode valid for this register. */
return VOIDmode;
@@ -822,13 +863,23 @@ dump_regclass (dump)
int i;
for (i = FIRST_PSEUDO_REGISTER; i < max_regno; i++)
{
- enum reg_class class;
+ int /* enum reg_class */ class;
if (REG_N_REFS (i))
{
fprintf (dump, " Register %i costs:", i);
- for (class = 0; class < N_REG_CLASSES; class++)
- fprintf (dump, " %s:%i", reg_class_names[(int) class],
- costs[i].cost[class]);
+ for (class = 0; class < (int) N_REG_CLASSES; class++)
+ if (contains_reg_of_mode [(enum reg_class) class][PSEUDO_REGNO_MODE (i)]
+#ifdef FORBIDDEN_INC_DEC_CLASSES
+ && (!in_inc_dec[i]
+ || !forbidden_inc_dec_class[(enum reg_class) class])
+#endif
+#ifdef CLASS_CANNOT_CHANGE_MODE
+ && (!REGNO_REG_SET_P (reg_changes_mode, i)
+ || class_can_change_mode [(enum reg_class) class])
+#endif
+ )
+ fprintf (dump, " %s:%i", reg_class_names[class],
+ costs[i].cost[(enum reg_class) class]);
fprintf (dump, " MEM:%i\n", costs[i].mem_cost);
}
}
@@ -1006,11 +1057,16 @@ scan_one_insn (insn, pass)
/* This makes one more setting of new insns's dest. */
REG_N_SETS (REGNO (recog_data.operand[0]))++;
+ REG_N_REFS (REGNO (recog_data.operand[0]))++;
*recog_data.operand_loc[1] = recog_data.operand[0];
+ REG_N_REFS (REGNO (recog_data.operand[0]))++;
for (i = recog_data.n_dups - 1; i >= 0; i--)
if (recog_data.dup_num[i] == 1)
- *recog_data.dup_loc[i] = recog_data.operand[0];
+ {
+ *recog_data.dup_loc[i] = recog_data.operand[0];
+ REG_N_REFS (REGNO (recog_data.operand[0]))++;
+ }
return PREV_INSN (newinsn);
}
@@ -1191,8 +1247,7 @@ regclass (f, nregs, dump)
{
/* Ignore classes that are too small for this operand or
invalid for a operand that was auto-incremented. */
- if (CLASS_MAX_NREGS (class, PSEUDO_REGNO_MODE (i))
- > reg_class_size[class]
+ if (!contains_reg_of_mode [class][PSEUDO_REGNO_MODE (i)]
#ifdef FORBIDDEN_INC_DEC_CLASSES
|| (in_inc_dec[i] && forbidden_inc_dec_class[class])
#endif
diff --git a/gcc/regmove.c b/gcc/regmove.c
index cbbeb835c7e..83cc3057344 100644
--- a/gcc/regmove.c
+++ b/gcc/regmove.c
@@ -37,10 +37,19 @@ Boston, MA 02111-1307, USA. */
#include "flags.h"
#include "function.h"
#include "expr.h"
-#include "insn-flags.h"
#include "basic-block.h"
+#include "except.h"
#include "toplev.h"
+
+/* Turn STACK_GROWS_DOWNWARD into a boolean. */
+#ifdef STACK_GROWS_DOWNWARD
+#undef STACK_GROWS_DOWNWARD
+#define STACK_GROWS_DOWNWARD 1
+#else
+#define STACK_GROWS_DOWNWARD 0
+#endif
+
static int perhaps_ends_bb_p PARAMS ((rtx));
static int optimize_reg_copy_1 PARAMS ((rtx, rtx, rtx));
static void optimize_reg_copy_2 PARAMS ((rtx, rtx, rtx));
@@ -396,11 +405,11 @@ static int perhaps_ends_bb_p (insn)
/* A CALL_INSN might be the last insn of a basic block, if it is inside
an EH region or if there are nonlocal gotos. Note that this test is
very conservative. */
- return flag_exceptions || nonlocal_goto_handler_labels;
-
+ if (nonlocal_goto_handler_labels)
+ return 1;
+ /* FALLTHRU */
default:
- /* All others never end a basic block. */
- return 0;
+ return can_throw_internal (insn);
}
}
@@ -693,6 +702,9 @@ optimize_reg_copy_3 (insn, dest, src)
if (! (set = single_set (p))
|| GET_CODE (SET_SRC (set)) != MEM
+ /* If there's a REG_EQUIV note, this must be an insn that loads an
+ argument. Prefer keeping the note over doing this optimization. */
+ || find_reg_note (p, REG_EQUIV, NULL_RTX)
|| SET_DEST (set) != src_reg)
return;
@@ -737,6 +749,12 @@ optimize_reg_copy_3 (insn, dest, src)
PUT_MODE (src_reg, old_mode);
XEXP (src, 0) = src_reg;
}
+ else
+ {
+ rtx note = find_reg_note (p, REG_EQUAL, NULL_RTX);
+ if (note)
+ remove_note (p, note);
+ }
}
@@ -1050,6 +1068,12 @@ fixup_match_2 (insn, dst, src, offset, regmove_dump_file)
return 0;
}
+/* Main entry for the register move optimization.
+ F is the first instruction.
+ NREGS is one plus the highest pseudo-reg number used in the instruction.
+ REGMOVE_DUMP_FILE is a stream for output of a trace of actions taken
+ (or 0 if none should be output). */
+
void
regmove_optimize (f, nregs, regmove_dump_file)
rtx f;
@@ -1063,6 +1087,11 @@ regmove_optimize (f, nregs, regmove_dump_file)
int i;
rtx copy_src, copy_dst;
+ /* ??? Hack. Regmove doesn't examine the CFG, and gets mightily
+ confused by non-call exceptions ending blocks. */
+ if (flag_non_call_exceptions)
+ return;
+
/* Find out where a potential flags register is live, and so that we
can supress some optimizations in those zones. */
mark_flags_life_zones (discover_flags_reg ());
@@ -1214,6 +1243,9 @@ regmove_optimize (f, nregs, regmove_dump_file)
if (! regclass_compatible_p (src_class, dst_class))
continue;
+ if (GET_MODE (src) != GET_MODE (dst))
+ continue;
+
if (fixup_match_1 (insn, set, src, src_subreg, dst, pass,
op_no, match_no,
regmove_dump_file))
@@ -1267,7 +1299,8 @@ regmove_optimize (f, nregs, regmove_dump_file)
if (GET_CODE (dst) != REG
|| REGNO (dst) < FIRST_PSEUDO_REGISTER
- || REG_LIVE_LENGTH (REGNO (dst)) < 0)
+ || REG_LIVE_LENGTH (REGNO (dst)) < 0
+ || RTX_UNCHANGING_P (dst))
continue;
/* If the operands already match, then there is nothing to do. */
@@ -1285,6 +1318,14 @@ regmove_optimize (f, nregs, regmove_dump_file)
if (! set)
continue;
+ /* Note that single_set ignores parts of a parallel set for
+ which one of the destinations is REG_UNUSED. We can't
+ handle that here, since we can wind up rewriting things
+ such that a single register is set twice within a single
+ parallel. */
+ if (reg_set_p (src, insn))
+ continue;
+
/* match_no/dst must be a write-only operand, and
operand_operand/src must be a read-only operand. */
if (match.use[op_no] != READ
@@ -2225,14 +2266,6 @@ try_apply_stack_adjustment (insn, memlist, new_adjust, delta)
struct csa_memlist *ml;
rtx set;
- /* We know INSN matches single_set_for_csa, because that's what we
- recognized earlier. However, if INSN is not single_set, it is
- doing double duty as a barrier for frame pointer memory accesses,
- which we are not recording. Therefore, an adjust insn that is not
- single_set may not have a positive delta applied. */
-
- if (delta > 0 && ! single_set (insn))
- return 0;
set = single_set_for_csa (insn);
validate_change (insn, &XEXP (SET_SRC (set), 1), GEN_INT (new_adjust), 1);
@@ -2242,13 +2275,6 @@ try_apply_stack_adjustment (insn, memlist, new_adjust, delta)
rtx new = gen_rtx_MEM (GET_MODE (*ml->mem),
plus_constant (stack_pointer_rtx, c));
- /* Don't reference memory below the stack pointer. */
- if (c < 0)
- {
- cancel_changes (0);
- return 0;
- }
-
MEM_COPY_ATTRIBUTES (new, *ml->mem);
validate_change (ml->insn, ml->mem, new, 1);
}
@@ -2297,11 +2323,16 @@ record_stack_memrefs (xp, data)
}
return 1;
case REG:
- /* ??? We want be able to handle non-memory stack pointer references
- later. For now just discard all insns refering to stack pointer
- outside mem expressions. We would probably want to teach
- validate_replace to simplify expressions first. */
- if (x == stack_pointer_rtx)
+ /* ??? We want be able to handle non-memory stack pointer
+ references later. For now just discard all insns refering to
+ stack pointer outside mem expressions. We would probably
+ want to teach validate_replace to simplify expressions first.
+
+ We can't just compare with STACK_POINTER_RTX because the
+ reference to the stack pointer might be in some other mode.
+ In particular, an explict clobber in an asm statement will
+ result in a QImode clober. */
+ if (REGNO (x) == STACK_POINTER_REGNUM)
return 1;
break;
default:
@@ -2358,35 +2389,63 @@ combine_stack_adjustments_for_block (bb)
/* If not all recorded memrefs can be adjusted, or the
adjustment is now too large for a constant addition,
- we cannot merge the two stack adjustments. */
- if (! try_apply_stack_adjustment (last_sp_set, memlist,
- last_sp_adjust + this_adjust,
- this_adjust))
+ we cannot merge the two stack adjustments.
+
+ Also we need to be carefull to not move stack pointer
+ such that we create stack accesses outside the allocated
+ area. We can combine an allocation into the first insn,
+ or a deallocation into the second insn. We can not
+ combine an allocation followed by a deallocation.
+
+ The only somewhat frequent ocurrence of the later is when
+ a function allocates a stack frame but does not use it.
+ For this case, we would need to analyze rtl stream to be
+ sure that allocated area is really unused. This means not
+ only checking the memory references, but also all registers
+ or global memory references possibly containing a stack
+ frame address.
+
+ Perhaps the best way to address this problem is to teach
+ gcc not to allocate stack for objects never used. */
+
+ /* Combine an allocation into the first instruction. */
+ if (STACK_GROWS_DOWNWARD ? this_adjust <= 0 : this_adjust >= 0)
{
- free_csa_memlist (memlist);
- memlist = NULL;
- last_sp_set = insn;
- last_sp_adjust = this_adjust;
- goto processed;
+ if (try_apply_stack_adjustment (last_sp_set, memlist,
+ last_sp_adjust + this_adjust,
+ this_adjust))
+ {
+ /* It worked! */
+ pending_delete = insn;
+ last_sp_adjust += this_adjust;
+ goto processed;
+ }
}
- /* It worked! */
- pending_delete = insn;
- last_sp_adjust += this_adjust;
-
- /* If, by some accident, the adjustments cancel out,
- delete both insns and start from scratch. */
- if (last_sp_adjust == 0)
+ /* Otherwise we have a deallocation. Do not combine with
+ a previous allocation. Combine into the second insn. */
+ else if (STACK_GROWS_DOWNWARD
+ ? last_sp_adjust >= 0 : last_sp_adjust <= 0)
{
- if (last_sp_set == bb->head)
- bb->head = NEXT_INSN (last_sp_set);
- flow_delete_insn (last_sp_set);
-
- free_csa_memlist (memlist);
- memlist = NULL;
- last_sp_set = NULL_RTX;
+ if (try_apply_stack_adjustment (insn, memlist,
+ last_sp_adjust + this_adjust,
+ -last_sp_adjust))
+ {
+ /* It worked! */
+ flow_delete_insn (last_sp_set);
+ last_sp_set = insn;
+ last_sp_adjust += this_adjust;
+ free_csa_memlist (memlist);
+ memlist = NULL;
+ goto processed;
+ }
}
+ /* Combination failed. Restart processing from here. */
+ free_csa_memlist (memlist);
+ memlist = NULL;
+ last_sp_set = insn;
+ last_sp_adjust = this_adjust;
goto processed;
}
diff --git a/gcc/regrename.c b/gcc/regrename.c
index ae25e2171fb..e142c39e940 100644
--- a/gcc/regrename.c
+++ b/gcc/regrename.c
@@ -1,5 +1,5 @@
/* Register renaming for the GNU compiler.
- Copyright (C) 2000 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2001 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -112,6 +112,11 @@ note_sets (x, set, data)
return;
regno = REGNO (x);
nregs = HARD_REGNO_NREGS (regno, GET_MODE (x));
+
+ /* There must not be pseudos at this point. */
+ if (regno + nregs > FIRST_PSEUDO_REGISTER)
+ abort ();
+
while (nregs-- > 0)
SET_HARD_REG_BIT (*pset, regno + nregs);
}
@@ -132,6 +137,11 @@ clear_dead_regs (pset, kind, notes)
rtx reg = XEXP (note, 0);
unsigned int regno = REGNO (reg);
int nregs = HARD_REGNO_NREGS (regno, GET_MODE (reg));
+
+ /* There must not be pseudos at this point. */
+ if (regno + nregs > FIRST_PSEUDO_REGISTER)
+ abort ();
+
while (nregs-- > 0)
CLEAR_HARD_REG_BIT (*pset, regno + nregs);
}
@@ -219,9 +229,14 @@ regrename_optimize ()
/* Don't clobber traceback for noreturn functions. */
if (frame_pointer_needed)
{
- SET_HARD_REG_BIT (unavailable, FRAME_POINTER_REGNUM);
+ int i;
+
+ for (i = HARD_REGNO_NREGS (FRAME_POINTER_REGNUM, Pmode); i--;)
+ SET_HARD_REG_BIT (unavailable, FRAME_POINTER_REGNUM + i);
+
#if FRAME_POINTER_REGNUM != HARD_FRAME_POINTER_REGNUM
- SET_HARD_REG_BIT (unavailable, HARD_FRAME_POINTER_REGNUM);
+ for (i = HARD_REGNO_NREGS (HARD_FRAME_POINTER_REGNUM, Pmode); i--;)
+ SET_HARD_REG_BIT (unavailable, HARD_FRAME_POINTER_REGNUM + i);
#endif
}
@@ -233,8 +248,7 @@ regrename_optimize ()
struct du_chain *this = all_chains;
struct du_chain *tmp, *last;
HARD_REG_SET this_unavailable;
- int reg = REGNO (*this->loc), treg;
- int nregs = HARD_REGNO_NREGS (reg, GET_MODE (*this->loc));
+ int reg = REGNO (*this->loc);
int i;
all_chains = this->next_chain;
@@ -282,9 +296,10 @@ regrename_optimize ()
/* Now potential_regs is a reasonable approximation, let's
have a closer look at each register still in there. */
- for (treg = 0; treg < FIRST_PSEUDO_REGISTER; treg++)
+ for (new_reg = 0; new_reg < FIRST_PSEUDO_REGISTER; new_reg++)
{
- new_reg = treg;
+ int nregs = HARD_REGNO_NREGS (new_reg, GET_MODE (*this->loc));
+
for (i = nregs - 1; i >= 0; --i)
if (TEST_HARD_REG_BIT (this_unavailable, new_reg + i)
|| fixed_regs[new_reg + i]
@@ -292,6 +307,12 @@ regrename_optimize ()
/* Can't use regs which aren't saved by the prologue. */
|| (! regs_ever_live[new_reg + i]
&& ! call_used_regs[new_reg + i])
+#ifdef LEAF_REGISTERS
+ /* We can't use a non-leaf register if we're in a
+ leaf function. */
+ || (current_function_is_leaf
+ && !LEAF_REGISTERS[new_reg + i])
+#endif
#ifdef HARD_REGNO_RENAME_OK
|| ! HARD_REGNO_RENAME_OK (reg + i, new_reg + i)
#endif
diff --git a/gcc/reload.c b/gcc/reload.c
index 5f27744057d..ffc48a5e58b 100644
--- a/gcc/reload.c
+++ b/gcc/reload.c
@@ -91,7 +91,6 @@ a register with any other reload. */
#include "rtl.h"
#include "tm_p.h"
#include "insn-config.h"
-#include "insn-codes.h"
#include "recog.h"
#include "reload.h"
#include "regs.h"
@@ -2750,7 +2749,7 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
register char *p = constraints[i];
register int win = 0;
int did_match = 0;
- /* 0 => this operand can be reloaded somehow for this alternative */
+ /* 0 => this operand can be reloaded somehow for this alternative. */
int badop = 1;
/* 0 => this operand can be reloaded if the alternative allows regs. */
int winreg = 0;
@@ -3143,7 +3142,7 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
|| (REGNO (operand) >= FIRST_PSEUDO_REGISTER
&& reg_renumber[REGNO (operand)] < 0)))
win = 1;
- /* Drop through into 'r' case */
+ /* Drop through into 'r' case. */
case 'r':
this_alternative[i]
@@ -3771,7 +3770,11 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
if (GET_CODE (operand) == REG)
{
if (modified[i] != RELOAD_WRITE)
- emit_insn_before (gen_rtx_USE (VOIDmode, operand), insn);
+ /* We mark the USE with QImode so that we recognize
+ it as one that can be safely deleted at the end
+ of reload. */
+ PUT_MODE (emit_insn_before (gen_rtx_USE (VOIDmode, operand),
+ insn), QImode);
if (modified[i] != RELOAD_READ)
emit_insn_after (gen_rtx_CLOBBER (VOIDmode, operand), insn);
}
@@ -4257,7 +4260,11 @@ find_reloads_toplev (x, opnum, type, ind_levels, is_set_dest, insn,
this substitution. We have to emit a USE of the pseudo so
that delete_output_reload can see it. */
if (replace_reloads && recog_data.operand[opnum] != x)
- emit_insn_before (gen_rtx_USE (VOIDmode, x), insn);
+ /* We mark the USE with QImode so that we recognize it
+ as one that can be safely deleted at the end of
+ reload. */
+ PUT_MODE (emit_insn_before (gen_rtx_USE (VOIDmode, x), insn),
+ QImode);
x = mem;
i = find_reloads_address (GET_MODE (x), &x, XEXP (x, 0), &XEXP (x, 0),
opnum, type, ind_levels, insn);
@@ -4488,7 +4495,7 @@ find_reloads_address (mode, memrefloc, ad, loc, opnum, type, ind_levels, insn)
regno = REGNO (ad);
/* If the register is equivalent to an invariant expression, substitute
- the invariant, and eliminate any eliminable register references. */
+ the invariant, and eliminate any eliminable register references. */
tem = reg_equiv_constant[regno];
if (tem != 0
&& (tem = eliminate_regs (tem, mode, insn))
@@ -4530,7 +4537,12 @@ find_reloads_address (mode, memrefloc, ad, loc, opnum, type, ind_levels, insn)
&& ! rtx_equal_p (tem, reg_equiv_mem[regno]))
{
*loc = tem;
- emit_insn_before (gen_rtx_USE (VOIDmode, ad), insn);
+ /* We mark the USE with QImode so that we
+ recognize it as one that can be safely
+ deleted at the end of reload. */
+ PUT_MODE (emit_insn_before (gen_rtx_USE (VOIDmode, ad),
+ insn), QImode);
+
/* This doesn't really count as replacing the address
as a whole, since it is still a memory access. */
}
@@ -4861,7 +4873,11 @@ subst_reg_equivs (ad, insn)
if (! rtx_equal_p (mem, reg_equiv_mem[regno]))
{
subst_reg_equivs_changed = 1;
- emit_insn_before (gen_rtx_USE (VOIDmode, ad), insn);
+ /* We mark the USE with QImode so that we recognize it
+ as one that can be safely deleted at the end of
+ reload. */
+ PUT_MODE (emit_insn_before (gen_rtx_USE (VOIDmode, ad), insn),
+ QImode);
return mem;
}
}
@@ -5688,7 +5704,12 @@ find_reloads_subreg_address (x, force_replace, opnum, type,
this substitution. We have to emit a USE of the pseudo so
that delete_output_reload can see it. */
if (replace_reloads && recog_data.operand[opnum] != x)
- emit_insn_before (gen_rtx_USE (VOIDmode, SUBREG_REG (x)), insn);
+ /* We mark the USE with QImode so that we recognize it
+ as one that can be safely deleted at the end of
+ reload. */
+ PUT_MODE (emit_insn_before (gen_rtx_USE (VOIDmode,
+ SUBREG_REG (x)),
+ insn), QImode);
x = tem;
}
}
diff --git a/gcc/reload1.c b/gcc/reload1.c
index 368cfb2d139..ce554658c6c 100644
--- a/gcc/reload1.c
+++ b/gcc/reload1.c
@@ -28,8 +28,6 @@ Boston, MA 02111-1307, USA. */
#include "tm_p.h"
#include "obstack.h"
#include "insn-config.h"
-#include "insn-flags.h"
-#include "insn-codes.h"
#include "flags.h"
#include "function.h"
#include "expr.h"
@@ -456,6 +454,7 @@ 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 HOST_WIDE_INT sext_for_mode PARAMS ((enum machine_mode,
HOST_WIDE_INT));
static void failed_reload PARAMS ((rtx, int));
@@ -761,6 +760,13 @@ reload (first, global)
{
rtx set = single_set (insn);
+ /* We may introduce USEs that we want to remove at the end, so
+ we'll mark them with QImode. Make sure there are no
+ previously-marked insns left by say regmove. */
+ if (INSN_P (insn) && GET_CODE (PATTERN (insn)) == USE
+ && GET_MODE (insn) != VOIDmode)
+ PUT_MODE (insn, VOIDmode);
+
if (GET_CODE (insn) == NOTE && CONST_CALL_P (insn)
&& NOTE_LINE_NUMBER (insn) == NOTE_INSN_SETJMP)
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
@@ -1188,7 +1194,9 @@ reload (first, global)
CALL_INSN_FUNCTION_USAGE (insn));
if ((GET_CODE (PATTERN (insn)) == USE
- && find_reg_note (insn, REG_EQUAL, NULL_RTX))
+ /* We mark with QImode USEs introduced by reload itself. */
+ && (GET_MODE (insn) == QImode
+ || find_reg_note (insn, REG_EQUAL, NULL_RTX)))
|| (GET_CODE (PATTERN (insn)) == CLOBBER
&& (GET_CODE (XEXP (PATTERN (insn), 0)) != REG
|| ! REG_FUNCTION_VALUE_P (XEXP (PATTERN (insn), 0)))))
@@ -2588,6 +2596,12 @@ eliminate_regs (x, mem_mode, insn)
return x;
case USE:
+ /* Handle insn_list USE that a call to a pure function may generate. */
+ new = eliminate_regs (XEXP (x, 0), 0, insn);
+ if (new != XEXP (x, 0))
+ return gen_rtx_USE (GET_MODE (x), new);
+ return x;
+
case CLOBBER:
case ASM_OPERANDS:
case SET:
@@ -2700,7 +2714,7 @@ elimination_effects (x, mem_mode)
}
else if (reg_renumber[regno] < 0 && reg_equiv_constant
&& reg_equiv_constant[regno]
- && ! CONSTANT_P (reg_equiv_constant[regno]))
+ && ! function_invariant_p (reg_equiv_constant[regno]))
elimination_effects (reg_equiv_constant[regno], mem_mode);
return;
@@ -3016,6 +3030,7 @@ eliminate_regs_in_insn (insn, replace)
currently support: a single set with the source being a PLUS of an
eliminable register and a constant. */
if (old_set
+ && GET_CODE (SET_DEST (old_set)) == REG
&& GET_CODE (SET_SRC (old_set)) == PLUS
&& GET_CODE (XEXP (SET_SRC (old_set), 0)) == REG
&& GET_CODE (XEXP (SET_SRC (old_set), 1)) == CONST_INT
@@ -3873,9 +3888,6 @@ reload_as_needed (live_known)
spill_reg_order);
}
- if (num_eliminable && chain->need_elim)
- update_eliminable_offsets ();
-
if (n_reloads > 0)
{
rtx next = NEXT_INSN (insn);
@@ -3922,6 +3934,10 @@ reload_as_needed (live_known)
NOTE_LINE_NUMBER (p) = NOTE_INSN_DELETED;
}
}
+
+ if (num_eliminable && chain->need_elim)
+ update_eliminable_offsets ();
+
/* Any previously reloaded spilled pseudo reg, stored in this insn,
is no longer validly lying around to save a future reload.
Note that this does not detect pseudos that were reloaded
@@ -6568,10 +6584,13 @@ emit_input_reload_insns (chain, rl, old, j)
rl->when_needed);
}
+ if (flag_non_call_exceptions)
+ copy_eh_notes (insn, get_insns ());
+
/* End this sequence. */
*where = get_insns ();
end_sequence ();
-
+
/* Update reload_override_in so that delete_address_reloads_1
can see the actual register usage. */
if (oldequiv_reg)
@@ -6665,7 +6684,7 @@ emit_output_reload_insns (chain, rl, j)
/* Copy primary reload reg to secondary reload reg.
(Note that these have been swapped above, then
- secondary reload reg to OLD using our insn. */
+ secondary reload reg to OLD using our insn.) */
/* If REAL_OLD is a paradoxical SUBREG, remove it
and try to put the opposite SUBREG on
@@ -6786,6 +6805,9 @@ emit_output_reload_insns (chain, rl, j)
else
output_reload_insns[rl->opnum] = get_insns ();
+ if (flag_non_call_exceptions)
+ copy_eh_notes (insn, get_insns ());
+
end_sequence ();
}
@@ -7589,7 +7611,9 @@ delete_output_reload (insn, j, last_reload_reg)
}
n_occurrences = count_occurrences (PATTERN (insn), reg, 0);
if (substed)
- n_occurrences += count_occurrences (PATTERN (insn), substed, 0);
+ n_occurrences += count_occurrences (PATTERN (insn),
+ eliminate_regs (substed, 0,
+ NULL_RTX), 0);
if (n_occurrences > n_inherited)
return;
@@ -8040,7 +8064,15 @@ reload_cse_simplify (insn)
if (GET_CODE (body) == SET)
{
int count = 0;
- if (reload_cse_noop_set_p (body))
+
+ /* 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_FUNCTION_VALUE_P (SET_DEST (body)))
@@ -8049,9 +8081,6 @@ reload_cse_simplify (insn)
return;
}
- /* It's not a no-op, but we can try to simplify it. */
- count += reload_cse_simplify_set (body, insn);
-
if (count > 0)
apply_change_group ();
else
@@ -8172,6 +8201,9 @@ reload_cse_simplify_set (set, insn)
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)
@@ -8183,6 +8215,18 @@ reload_cse_simplify_set (set, insn)
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);
@@ -8200,23 +8244,76 @@ reload_cse_simplify_set (set, insn)
return 0;
for (l = val->locs; l; l = l->next)
{
+ rtx this_rtx = l->loc;
int this_cost;
- if (CONSTANT_P (l->loc) && ! references_value_p (l->loc, 0))
- this_cost = rtx_cost (l->loc, SET);
- else if (GET_CODE (l->loc) == REG)
- this_cost = REGISTER_MOVE_COST (GET_MODE (l->loc),
- REGNO_REG_CLASS (REGNO (l->loc)),
- dclass);
+
+ 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 (l->loc) == REG
- && GET_CODE (SET_SRC (set)) != REG))
- && validate_change (insn, &SET_SRC (set), copy_rtx (l->loc), 1))
- old_cost = this_cost, did_change = 1;
+
+ /* 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)
+ {
+ 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;
@@ -8880,7 +8977,12 @@ reload_combine_note_use (xp, insn)
case CLOBBER:
if (GET_CODE (SET_DEST (x)) == REG)
- return;
+ {
+ /* No spurious CLOBBERs of pseudo registers may remain. */
+ if (REGNO (SET_DEST (x)) >= FIRST_PSEUDO_REGISTER)
+ abort ();
+ return;
+ }
break;
case PLUS:
@@ -8897,10 +8999,9 @@ reload_combine_note_use (xp, insn)
int use_index;
int nregs;
- /* Some spurious USEs of pseudo registers might remain.
- Just ignore them. */
+ /* No spurious USEs of pseudo registers may remain. */
if (regno >= FIRST_PSEUDO_REGISTER)
- return;
+ abort ();
nregs = HARD_REGNO_NREGS (regno, GET_MODE (x));
@@ -9355,3 +9456,23 @@ add_auto_inc_notes (insn, x)
}
}
#endif
+
+/* Copy EH notes from an insn to its reloads. */
+static void
+copy_eh_notes (insn, x)
+ rtx insn;
+ rtx x;
+{
+ rtx eh_note = find_reg_note (insn, REG_EH_REGION, NULL_RTX);
+ if (eh_note)
+ {
+ for (; x != 0; x = NEXT_INSN (x))
+ {
+ if (may_trap_p (PATTERN (x)))
+ REG_NOTES (x)
+ = gen_rtx_EXPR_LIST (REG_EH_REGION, XEXP (eh_note, 0),
+ REG_NOTES (x));
+ }
+ }
+}
+
diff --git a/gcc/reorg.c b/gcc/reorg.c
index 6d3b26a196f..a71db074ba4 100644
--- a/gcc/reorg.c
+++ b/gcc/reorg.c
@@ -132,13 +132,13 @@ Boston, MA 02111-1307, USA. */
#include "hard-reg-set.h"
#include "basic-block.h"
#include "regs.h"
-#include "insn-flags.h"
#include "recog.h"
#include "flags.h"
#include "output.h"
#include "obstack.h"
#include "insn-attr.h"
#include "resource.h"
+#include "params.h"
#ifdef DELAY_SLOTS
@@ -1635,6 +1635,7 @@ redundant_insn (insn, target, delay_list)
rtx trial, pat;
struct resources needed, set;
int i;
+ unsigned insns_to_search;
/* If INSN has any REG_UNUSED notes, it can't match anything since we
are allowed to not actually assign to such a register. */
@@ -1642,7 +1643,10 @@ redundant_insn (insn, target, delay_list)
return 0;
/* Scan backwards looking for a match. */
- for (trial = PREV_INSN (target); trial; trial = PREV_INSN (trial))
+ for (trial = PREV_INSN (target),
+ insns_to_search = MAX_DELAY_SLOT_INSN_SEARCH;
+ trial && insns_to_search > 0;
+ trial = PREV_INSN (trial), --insns_to_search)
{
if (GET_CODE (trial) == CODE_LABEL)
return 0;
@@ -1743,9 +1747,10 @@ redundant_insn (insn, target, delay_list)
/* Scan backwards until we reach a label or an insn that uses something
INSN sets or sets something insn uses or sets. */
- for (trial = PREV_INSN (target);
- trial && GET_CODE (trial) != CODE_LABEL;
- trial = PREV_INSN (trial))
+ for (trial = PREV_INSN (target),
+ insns_to_search = MAX_DELAY_SLOT_INSN_SEARCH;
+ trial && GET_CODE (trial) != CODE_LABEL && insns_to_search > 0;
+ trial = PREV_INSN (trial), --insns_to_search)
{
if (GET_CODE (trial) != INSN && GET_CODE (trial) != CALL_INSN
&& GET_CODE (trial) != JUMP_INSN)
@@ -2218,14 +2223,37 @@ fill_simple_delay_slots (non_jumps_p)
fill_eager_delay_slots anyways, it was just deleted. */
if (slots_filled != slots_to_fill
+ /* If this instruction could throw an exception which is
+ caught in the same function, then it's not safe to fill
+ the delay slot with an instruction from beyond this
+ point. For example, consider:
+
+ int i = 2;
+
+ try {
+ f();
+ i = 3;
+ } catch (...) {}
+
+ return i;
+
+ Even though `i' is a local variable, we must be sure not
+ to put `i = 3' in the delay slot if `f' might throw an
+ exception.
+
+ Presumably, we should also check to see if we could get
+ back to this function via `setjmp'. */
+ && !can_throw_internal (insn)
&& (GET_CODE (insn) != JUMP_INSN
|| ((condjump_p (insn) || condjump_in_parallel_p (insn))
&& ! simplejump_p (insn)
&& JUMP_LABEL (insn) != 0)))
{
+ /* Invariant: If insn is a JUMP_INSN, the insn's jump
+ label. Otherwise, zero. */
rtx target = 0;
int maybe_never = 0;
- struct resources needed_at_jump;
+ rtx pat, trial_delay;
CLEAR_RESOURCE (&needed);
CLEAR_RESOURCE (&set);
@@ -2244,92 +2272,73 @@ fill_simple_delay_slots (non_jumps_p)
target = JUMP_LABEL (insn);
}
- for (trial = next_nonnote_insn (insn); trial; trial = next_trial)
- {
- rtx pat, trial_delay;
-
- next_trial = next_nonnote_insn (trial);
-
- if (GET_CODE (trial) == CODE_LABEL
- || GET_CODE (trial) == BARRIER)
- break;
+ if (target == 0)
+ for (trial = next_nonnote_insn (insn); trial; trial = next_trial)
+ {
+ next_trial = next_nonnote_insn (trial);
- /* We must have an INSN, JUMP_INSN, or CALL_INSN. */
- pat = PATTERN (trial);
+ if (GET_CODE (trial) == CODE_LABEL
+ || GET_CODE (trial) == BARRIER)
+ break;
- /* Stand-alone USE and CLOBBER are just for flow. */
- if (GET_CODE (pat) == USE || GET_CODE (pat) == CLOBBER)
- continue;
+ /* We must have an INSN, JUMP_INSN, or CALL_INSN. */
+ pat = PATTERN (trial);
- /* If this already has filled delay slots, get the insn needing
- the delay slots. */
- if (GET_CODE (pat) == SEQUENCE)
- trial_delay = XVECEXP (pat, 0, 0);
- else
- trial_delay = trial;
-
- /* If this is a jump insn to our target, indicate that we have
- seen another jump to it. If we aren't handling a conditional
- jump, stop our search. Otherwise, compute the needs at its
- target and add them to NEEDED. */
- if (GET_CODE (trial_delay) == JUMP_INSN)
- {
- if (target == 0)
- break;
- else if (JUMP_LABEL (trial_delay) != target)
- {
- rtx ninsn =
- next_active_insn (JUMP_LABEL (trial_delay));
-
- mark_target_live_regs (get_insns (), ninsn,
- &needed_at_jump);
- needed.memory |= needed_at_jump.memory;
- needed.unch_memory |= needed_at_jump.unch_memory;
- IOR_HARD_REG_SET (needed.regs, needed_at_jump.regs);
- }
- }
+ /* Stand-alone USE and CLOBBER are just for flow. */
+ if (GET_CODE (pat) == USE || GET_CODE (pat) == CLOBBER)
+ continue;
- /* See if we have a resource problem before we try to
- split. */
- if (target == 0
- && GET_CODE (pat) != SEQUENCE
- && ! insn_references_resource_p (trial, &set, 1)
- && ! insn_sets_resource_p (trial, &set, 1)
- && ! insn_sets_resource_p (trial, &needed, 1)
+ /* If this already has filled delay slots, get the insn needing
+ the delay slots. */
+ if (GET_CODE (pat) == SEQUENCE)
+ trial_delay = XVECEXP (pat, 0, 0);
+ else
+ trial_delay = trial;
+
+ /* Stop our search when seeing an unconditional jump. */
+ if (GET_CODE (trial_delay) == JUMP_INSN)
+ break;
+
+ /* See if we have a resource problem before we try to
+ split. */
+ if (GET_CODE (pat) != SEQUENCE
+ && ! insn_references_resource_p (trial, &set, 1)
+ && ! insn_sets_resource_p (trial, &set, 1)
+ && ! insn_sets_resource_p (trial, &needed, 1)
#ifdef HAVE_cc0
- && ! (reg_mentioned_p (cc0_rtx, pat) && ! sets_cc0_p (pat))
+ && ! (reg_mentioned_p (cc0_rtx, pat) && ! sets_cc0_p (pat))
#endif
- && ! (maybe_never && may_trap_p (pat))
- && (trial = try_split (pat, trial, 0))
- && eligible_for_delay (insn, slots_filled, trial, flags))
- {
- next_trial = next_nonnote_insn (trial);
- delay_list = add_to_delay_list (trial, delay_list);
+ && ! (maybe_never && may_trap_p (pat))
+ && (trial = try_split (pat, trial, 0))
+ && eligible_for_delay (insn, slots_filled, trial, flags))
+ {
+ next_trial = next_nonnote_insn (trial);
+ delay_list = add_to_delay_list (trial, delay_list);
#ifdef HAVE_cc0
- if (reg_mentioned_p (cc0_rtx, pat))
- link_cc0_insns (trial);
+ if (reg_mentioned_p (cc0_rtx, pat))
+ link_cc0_insns (trial);
#endif
- delete_insn (trial);
- if (slots_to_fill == ++slots_filled)
- break;
- continue;
- }
+ delete_insn (trial);
+ if (slots_to_fill == ++slots_filled)
+ break;
+ continue;
+ }
- mark_set_resources (trial, &set, 0, MARK_SRC_DEST_CALL);
- mark_referenced_resources (trial, &needed, 1);
+ mark_set_resources (trial, &set, 0, MARK_SRC_DEST_CALL);
+ mark_referenced_resources (trial, &needed, 1);
- /* Ensure we don't put insns between the setting of cc and the
- comparison by moving a setting of cc into an earlier delay
- slot since these insns could clobber the condition code. */
- set.cc = 1;
+ /* Ensure we don't put insns between the setting of cc and the
+ comparison by moving a setting of cc into an earlier delay
+ slot since these insns could clobber the condition code. */
+ set.cc = 1;
- /* If this is a call or jump, we might not get here. */
- if (GET_CODE (trial_delay) == CALL_INSN
- || GET_CODE (trial_delay) == JUMP_INSN)
- maybe_never = 1;
- }
+ /* If this is a call or jump, we might not get here. */
+ if (GET_CODE (trial_delay) == CALL_INSN
+ || GET_CODE (trial_delay) == JUMP_INSN)
+ maybe_never = 1;
+ }
/* If there are slots left to fill and our search was stopped by an
unconditional branch, try the insn at the branch target. We can
@@ -2982,7 +2991,7 @@ fill_eager_delay_slots ()
}
/* If this insn is expected to branch, first try to get insns from our
- target, then our fallthrough insns. If it is not, expected to branch,
+ target, then our fallthrough insns. If it is not expected to branch,
try the other order. */
if (prediction > 0)
diff --git a/gcc/resource.c b/gcc/resource.c
index fa7e9573061..e5519222a66 100644
--- a/gcc/resource.c
+++ b/gcc/resource.c
@@ -1,5 +1,5 @@
/* Definitions for computing resource usage of specific insns.
- Copyright (C) 1999, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -32,6 +32,7 @@ Boston, MA 02111-1307, USA. */
#include "resource.h"
#include "except.h"
#include "insn-attr.h"
+#include "params.h"
/* This structure is used to record liveness information at the targets or
fallthrough insns of branches. We will most likely need the information
@@ -66,7 +67,7 @@ static struct target_info **target_hash_table = NULL;
static int *bb_ticks;
/* Marks registers possibly live at the current place being scanned by
- mark_target_live_regs. Used only by next two function. */
+ mark_target_live_regs. Also used by update_live_status. */
static HARD_REG_SET current_live_regs;
@@ -76,7 +77,7 @@ static HARD_REG_SET current_live_regs;
static HARD_REG_SET pending_dead_regs;
static void update_live_status PARAMS ((rtx, rtx, void *));
-static int find_basic_block PARAMS ((rtx));
+static int find_basic_block PARAMS ((rtx, int));
static rtx next_insn_no_annul PARAMS ((rtx));
static rtx find_dead_or_set_registers PARAMS ((rtx, struct resources*,
rtx*, int, struct resources,
@@ -115,25 +116,38 @@ update_live_status (dest, x, data)
CLEAR_HARD_REG_BIT (pending_dead_regs, i);
}
}
-/* Find the number of the basic block that starts closest to INSN. Return -1
- if we couldn't find such a basic block. */
+
+/* Find the number of the basic block with correct live register
+ information that starts closest to INSN. Return -1 if we couldn't
+ find such a basic block or the beginning is more than
+ SEARCH_LIMIT instructions before INSN. Use SEARCH_LIMIT = -1 for
+ an unlimited search.
+
+ The delay slot filling code destroys the control-flow graph so,
+ instead of finding the basic block containing INSN, we search
+ backwards toward a BARRIER where the live register information is
+ correct. */
static int
-find_basic_block (insn)
+find_basic_block (insn, search_limit)
rtx insn;
+ int search_limit;
{
int i;
/* Scan backwards to the previous BARRIER. Then see if we can find a
label that starts a basic block. Return the basic block number. */
-
for (insn = prev_nonnote_insn (insn);
- insn && GET_CODE (insn) != BARRIER;
- insn = prev_nonnote_insn (insn))
+ insn && GET_CODE (insn) != BARRIER && search_limit != 0;
+ insn = prev_nonnote_insn (insn), --search_limit)
;
+ /* The closest BARRIER is too far away. */
+ if (search_limit == 0)
+ return -1;
+
/* The start of the function is basic block zero. */
- if (insn == 0)
+ else if (insn == 0)
return 0;
/* See if any of the upcoming CODE_LABELs start a basic block. If we reach
@@ -438,7 +452,7 @@ find_dead_or_set_registers (target, res, jump_target, jump_count, set, needed)
know where we might end up next. That means that we have to
assume that whatever we have already marked as live really is
live. */
- if (can_throw (insn))
+ if (can_throw_internal (insn))
break;
switch (GET_CODE (insn))
@@ -925,7 +939,7 @@ mark_target_live_regs (insns, target, res)
}
if (b == -1)
- b = find_basic_block (target);
+ b = find_basic_block (target, MAX_DELAY_SLOT_LIVE_SEARCH);
if (target_hash_table != NULL)
{
@@ -1294,7 +1308,7 @@ void
incr_ticks_for_insn (insn)
rtx insn;
{
- int b = find_basic_block (insn);
+ int b = find_basic_block (insn, MAX_DELAY_SLOT_LIVE_SEARCH);
if (b != -1)
bb_ticks[b]++;
diff --git a/gcc/rtl.c b/gcc/rtl.c
index 02bb8cbb8e6..46e09c84be2 100644
--- a/gcc/rtl.c
+++ b/gcc/rtl.c
@@ -270,7 +270,7 @@ const char * const note_insn_name[NOTE_INSN_MAX - NOTE_INSN_BIAS] =
"", "NOTE_INSN_DELETED",
"NOTE_INSN_BLOCK_BEG", "NOTE_INSN_BLOCK_END",
"NOTE_INSN_LOOP_BEG", "NOTE_INSN_LOOP_END",
- "NOTE_INSN_LOOP_CONT", "NOTE_INSN_LOOP_VTOP",
+ "NOTE_INSN_LOOP_CONT", "NOTE_INSN_LOOP_VTOP", "NOTE_INSN_LOOP_END_TOP_COND",
"NOTE_INSN_FUNCTION_END", "NOTE_INSN_SETJMP",
"NOTE_INSN_PROLOGUE_END", "NOTE_INSN_EPILOGUE_BEG",
"NOTE_INSN_DELETED_LABEL", "NOTE_INSN_FUNCTION_BEG",
@@ -821,7 +821,7 @@ read_name (str, infile)
p = str;
while (1)
{
- if (c == ' ' || c == '\n' || c == '\t' || c == '\f')
+ if (c == ' ' || c == '\n' || c == '\t' || c == '\f' || c == '\r')
break;
if (c == ':' || c == ')' || c == ']' || c == '"' || c == '/'
|| c == '(' || c == '[')
@@ -1285,9 +1285,10 @@ rtl_check_failed_bounds (r, n, file, line, func)
int line;
const char *func;
{
- error ("RTL check: access of elt %d of `%s' with last elt %d",
- n, GET_RTX_NAME (GET_CODE (r)), GET_RTX_LENGTH (GET_CODE (r))-1);
- fancy_abort (file, line, func);
+ internal_error
+ ("RTL check: access of elt %d of `%s' with last elt %d in %s, at %s:%d",
+ n, GET_RTX_NAME (GET_CODE (r)), GET_RTX_LENGTH (GET_CODE (r)) - 1,
+ func, trim_filename (file), line);
}
void
@@ -1299,9 +1300,10 @@ rtl_check_failed_type1 (r, n, c1, file, line, func)
int line;
const char *func;
{
- error ("RTL check: expected elt %d type '%c', have '%c' (rtx %s)",
- n, c1, GET_RTX_FORMAT (GET_CODE (r))[n], GET_RTX_NAME (GET_CODE (r)));
- fancy_abort (file, line, func);
+ internal_error
+ ("RTL check: expected elt %d type '%c', have '%c' (rtx %s) in %s, at %s:%d",
+ n, c1, GET_RTX_FORMAT (GET_CODE (r))[n], GET_RTX_NAME (GET_CODE (r)),
+ func, trim_filename (file), line);
}
void
@@ -1314,10 +1316,10 @@ rtl_check_failed_type2 (r, n, c1, c2, file, line, func)
int line;
const char *func;
{
- error ("RTL check: expected elt %d type '%c' or '%c', have '%c' (rtx %s)",
- n, c1, c2,
- GET_RTX_FORMAT (GET_CODE (r))[n], GET_RTX_NAME (GET_CODE(r)));
- fancy_abort (file, line, func);
+ internal_error
+ ("RTL check: expected elt %d type '%c' or '%c', have '%c' (rtx %s) in %s, at %s:%d",
+ n, c1, c2, GET_RTX_FORMAT (GET_CODE (r))[n], GET_RTX_NAME (GET_CODE (r)),
+ func, trim_filename (file), line);
}
void
@@ -1328,9 +1330,9 @@ rtl_check_failed_code1 (r, code, file, line, func)
int line;
const char *func;
{
- error ("RTL check: expected code `%s', have `%s'",
- GET_RTX_NAME (code), GET_RTX_NAME (GET_CODE (r)));
- fancy_abort (file, line, func);
+ internal_error ("RTL check: expected code `%s', have `%s' in %s, at %s:%d",
+ GET_RTX_NAME (code), GET_RTX_NAME (GET_CODE (r)), func,
+ trim_filename (file), line);
}
void
@@ -1341,10 +1343,10 @@ rtl_check_failed_code2 (r, code1, code2, file, line, func)
int line;
const char *func;
{
- error ("RTL check: expected code `%s' or `%s', have `%s'",
- GET_RTX_NAME (code1), GET_RTX_NAME (code2),
- GET_RTX_NAME (GET_CODE (r)));
- fancy_abort (file, line, func);
+ internal_error
+ ("RTL check: expected code `%s' or `%s', have `%s' in %s, at %s:%d",
+ GET_RTX_NAME (code1), GET_RTX_NAME (code2), GET_RTX_NAME (GET_CODE (r)),
+ func, trim_filename (file), line);
}
/* XXX Maybe print the vector? */
@@ -1356,8 +1358,8 @@ rtvec_check_failed_bounds (r, n, file, line, func)
int line;
const char *func;
{
- error ("RTL check: access of elt %d of vector with last elt %d",
- n, GET_NUM_ELEM (r)-1);
- fancy_abort (file, line, func);
+ internal_error
+ ("RTL check: access of elt %d of vector with last elt %d in %s, at %s:%d",
+ n, GET_NUM_ELEM (r) - 1, func, trim_filename (file), line);
}
#endif /* ENABLE_RTL_CHECKING */
diff --git a/gcc/rtl.def b/gcc/rtl.def
index 6f0aec86b5a..906255d2dcd 100644
--- a/gcc/rtl.def
+++ b/gcc/rtl.def
@@ -547,6 +547,11 @@ DEF_RTL_EXPR(RETURN, "return", "", 'x')
For an unconditional trap, make the condition (const_int 1). */
DEF_RTL_EXPR(TRAP_IF, "trap_if", "ee", 'x')
+/* Placeholder for _Unwind_Resume before we know if a function call
+ or a branch is needed. Operand 1 is the exception region from
+ which control is flowing. */
+DEF_RTL_EXPR(RESX, "resx", "i", 'x')
+
/* ----------------------------------------------------------------------
Primitive values for use in expressions.
---------------------------------------------------------------------- */
diff --git a/gcc/rtl.h b/gcc/rtl.h
index 9db7a37183c..ad20003cdd4 100644
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -162,7 +162,8 @@ typedef struct rtx_def
unsigned int used : 1;
/* Nonzero if this rtx came from procedure integration.
In a REG, nonzero means this reg refers to the return value
- of the current function. */
+ of the current function.
+ 1 in a SYMBOL_REF if the symbol is weak. */
unsigned integrated : 1;
/* 1 in an INSN or a SET if this rtx is related to the call frame,
either changing how we compute the frame address or saving and
@@ -184,11 +185,11 @@ typedef struct rtx_def
/* Define macros to access the `code' field of the rtx. */
-#define GET_CODE(RTX) ((RTX)->code)
-#define PUT_CODE(RTX, CODE) ((RTX)->code = (CODE))
+#define GET_CODE(RTX) ((enum rtx_code) (RTX)->code)
+#define PUT_CODE(RTX, CODE) ((RTX)->code = (ENUM_BITFIELD(rtx_code)) (CODE))
-#define GET_MODE(RTX) ((RTX)->mode)
-#define PUT_MODE(RTX, MODE) ((RTX)->mode = (MODE))
+#define GET_MODE(RTX) ((enum machine_mode) (RTX)->mode)
+#define PUT_MODE(RTX, MODE) ((RTX)->mode = (ENUM_BITFIELD(machine_mode)) (MODE))
#define RTX_INTEGRATED_P(RTX) ((RTX)->integrated)
#define RTX_UNCHANGING_P(RTX) ((RTX)->unchanging)
@@ -645,6 +646,12 @@ enum insn_note
/* Generated at the start of a duplicated exit test. */
NOTE_INSN_LOOP_VTOP,
+ /* Generated at the end of a conditional at the top of the loop.
+ This is used to perform a lame form of loop rotation in lieu
+ of actually understanding the loop structure. The note is
+ discarded after rotation is complete. */
+ NOTE_INSN_LOOP_END_TOP_COND,
+
/* This kind of note is generated at the end of the function body,
just before the return insn or return label. In an optimizing
compilation it is deleted by the first jump optimization, after
@@ -702,7 +709,7 @@ enum insn_note
extern const char * const note_insn_name[NOTE_INSN_MAX - NOTE_INSN_BIAS];
#define GET_NOTE_INSN_NAME(NOTE_CODE) \
- (note_insn_name[(NOTE_CODE) - NOTE_INSN_BIAS])
+ (note_insn_name[(NOTE_CODE) - (int) NOTE_INSN_BIAS])
/* The name of a label, in case it corresponds to an explicit label
in the input source code. */
@@ -924,13 +931,12 @@ extern const char * const note_insn_name[NOTE_INSN_MAX - NOTE_INSN_BIAS];
/* Flag in a SYMBOL_REF for machine-specific purposes. */
#define SYMBOL_REF_FLAG(RTX) ((RTX)->volatil)
-/* 1 in a SYMBOL_REF if it represents a symbol which might have to change
- if its inlined or unrolled. */
-#define SYMBOL_REF_NEED_ADJUST(RTX) ((RTX)->in_struct)
-
/* 1 means a SYMBOL_REF has been the library function in emit_library_call. */
#define SYMBOL_REF_USED(RTX) ((RTX)->used)
+/* 1 means a SYMBOL_REF is weak. */
+#define SYMBOL_REF_WEAK(RTX) ((RTX)->integrated)
+
/* Define a macro to look for REG_INC notes,
but save time on machines where they never exist. */
@@ -1408,6 +1414,7 @@ extern int auto_inc_p PARAMS ((rtx));
extern void remove_node_from_expr_list PARAMS ((rtx, rtx *));
extern int insns_safe_to_move_p PARAMS ((rtx, rtx, rtx *));
extern int loc_mentioned_in_p PARAMS ((rtx *, rtx));
+extern rtx find_first_parameter_load PARAMS ((rtx, rtx));
/* flow.c */
@@ -1606,6 +1613,9 @@ extern rtx gen_rtx_MEM PARAMS ((enum machine_mode, rtx));
#define LAST_VIRTUAL_REGISTER ((FIRST_VIRTUAL_REGISTER) + 4)
+/* REGNUM never really appearing in the INSN stream. */
+#define INVALID_REGNUM (~(unsigned int)0)
+
extern rtx find_next_ref PARAMS ((rtx, rtx));
extern rtx *find_single_use PARAMS ((rtx, rtx, rtx *));
@@ -1947,7 +1957,9 @@ enum libcall_type
LCT_CONST = 1,
LCT_PURE = 2,
LCT_CONST_MAKE_BLOCK = 3,
- LCT_PURE_MAKE_BLOCK = 4
+ LCT_PURE_MAKE_BLOCK = 4,
+ LCT_NORETURN = 5,
+ LCT_THROW = 6
};
extern void emit_library_call PARAMS ((rtx, enum libcall_type,
@@ -1991,6 +2003,7 @@ extern void fancy_abort PARAMS ((const char *, int, const char *))
#define abort() fancy_abort (__FILE__, __LINE__, __FUNCTION__)
/* In alias.c */
+extern void clear_reg_alias_info PARAMS ((rtx));
extern rtx canon_rtx PARAMS ((rtx));
extern int true_dependence PARAMS ((rtx, enum machine_mode, rtx,
int (*)(rtx, int)));
diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c
index a738acb28a5..ab16f6ee267 100644
--- a/gcc/rtlanal.c
+++ b/gcc/rtlanal.c
@@ -24,6 +24,7 @@ Boston, MA 02111-1307, USA. */
#include "system.h"
#include "toplev.h"
#include "rtl.h"
+#include "hard-reg-set.h"
static void set_of_1 PARAMS ((rtx, rtx, void *));
static void insn_dependent_p_1 PARAMS ((rtx, rtx, void *));
@@ -68,7 +69,9 @@ rtx_unstable_p (x)
case REG:
/* As in rtx_varies_p, we have to use the actual rtx, not reg number. */
if (x == frame_pointer_rtx || x == hard_frame_pointer_rtx
- || x == arg_pointer_rtx || RTX_UNCHANGING_P (x))
+ /* The arg pointer varies if it is not a fixed register. */
+ || (x == arg_pointer_rtx && fixed_regs[ARG_POINTER_REGNUM])
+ || RTX_UNCHANGING_P (x))
return 0;
#ifndef PIC_OFFSET_TABLE_REG_CALL_CLOBBERED
/* ??? When call-clobbered, the value is stable modulo the restore
@@ -144,7 +147,8 @@ rtx_varies_p (x, for_alias)
eliminated the frame and/or arg pointer and are using it
for pseudos. */
if (x == frame_pointer_rtx || x == hard_frame_pointer_rtx
- || x == arg_pointer_rtx)
+ /* The arg pointer varies if it is not a fixed register. */
+ || (x == arg_pointer_rtx && fixed_regs[ARG_POINTER_REGNUM]))
return 0;
if (x == pic_offset_table_rtx
#ifdef PIC_OFFSET_TABLE_REG_CALL_CLOBBERED
@@ -160,8 +164,10 @@ rtx_varies_p (x, for_alias)
case LO_SUM:
/* The operand 0 of a LO_SUM is considered constant
- (in fact is it related specifically to operand 1). */
- return rtx_varies_p (XEXP (x, 1), for_alias);
+ (in fact it is related specifically to operand 1)
+ during alias analysis. */
+ return (! for_alias && rtx_varies_p (XEXP (x, 0), for_alias))
+ || rtx_varies_p (XEXP (x, 1), for_alias);
case ASM_OPERANDS:
if (MEM_VOLATILE_P (x))
@@ -202,17 +208,23 @@ rtx_addr_can_trap_p (x)
switch (code)
{
case SYMBOL_REF:
+ return SYMBOL_REF_WEAK (x);
+
case LABEL_REF:
- /* SYMBOL_REF is problematic due to the possible presence of
- a #pragma weak, but to say that loads from symbols can trap is
- *very* costly. It's not at all clear what's best here. For
- now, we ignore the impact of #pragma weak. */
return 0;
case REG:
/* As in rtx_varies_p, we have to use the actual rtx, not reg number. */
- return ! (x == frame_pointer_rtx || x == hard_frame_pointer_rtx
- || x == stack_pointer_rtx || x == arg_pointer_rtx);
+ if (x == frame_pointer_rtx || x == hard_frame_pointer_rtx
+ || x == stack_pointer_rtx
+ /* The arg pointer varies if it is not a fixed register. */
+ || (x == arg_pointer_rtx && fixed_regs[ARG_POINTER_REGNUM]))
+ return 0;
+ /* All of the virtual frame registers are stack references. */
+ if (REGNO (x) >= FIRST_VIRTUAL_REGISTER
+ && REGNO (x) <= LAST_VIRTUAL_REGISTER)
+ return 0;
+ return 1;
case CONST:
return rtx_addr_can_trap_p (XEXP (x, 0));
@@ -227,8 +239,16 @@ rtx_addr_can_trap_p (x)
&& CONSTANT_P (XEXP (x, 1))));
case LO_SUM:
+ case PRE_MODIFY:
return rtx_addr_can_trap_p (XEXP (x, 1));
-
+
+ case PRE_DEC:
+ case PRE_INC:
+ case POST_DEC:
+ case POST_INC:
+ case POST_MODIFY:
+ return rtx_addr_can_trap_p (XEXP (x, 0));
+
default:
break;
}
@@ -2487,3 +2507,82 @@ loc_mentioned_in_p (loc, in)
}
return 0;
}
+
+struct parms_set_data
+{
+ int nregs;
+ HARD_REG_SET regs;
+};
+
+/* Helper function for noticing stores to parameter registers. */
+static void
+parms_set (x, pat, data)
+ rtx x, pat ATTRIBUTE_UNUSED;
+ void *data;
+{
+ struct parms_set_data *d = data;
+ if (REG_P (x) && REGNO (x) < FIRST_PSEUDO_REGISTER
+ && TEST_HARD_REG_BIT (d->regs, REGNO (x)))
+ {
+ CLEAR_HARD_REG_BIT (d->regs, REGNO (x));
+ d->nregs--;
+ }
+}
+
+/* Look backward for first parameter to be loaded.
+ Do not skip BOUNDARY. */
+rtx
+find_first_parameter_load (call_insn, boundary)
+ rtx call_insn, boundary;
+{
+ struct parms_set_data parm;
+ rtx p, before;
+
+ /* Since different machines initialize their parameter registers
+ in different orders, assume nothing. Collect the set of all
+ parameter registers. */
+ CLEAR_HARD_REG_SET (parm.regs);
+ parm.nregs = 0;
+ for (p = CALL_INSN_FUNCTION_USAGE (call_insn); p; p = XEXP (p, 1))
+ if (GET_CODE (XEXP (p, 0)) == USE
+ && GET_CODE (XEXP (XEXP (p, 0), 0)) == REG)
+ {
+ if (REGNO (XEXP (XEXP (p, 0), 0)) >= FIRST_PSEUDO_REGISTER)
+ abort ();
+
+ /* We only care about registers which can hold function
+ arguments. */
+ if (!FUNCTION_ARG_REGNO_P (REGNO (XEXP (XEXP (p, 0), 0))))
+ continue;
+
+ SET_HARD_REG_BIT (parm.regs, REGNO (XEXP (XEXP (p, 0), 0)));
+ parm.nregs++;
+ }
+ before = call_insn;
+
+ /* Search backward for the first set of a register in this set. */
+ while (parm.nregs && before != boundary)
+ {
+ before = PREV_INSN (before);
+
+ /* It is possible that some loads got CSEed from one call to
+ another. Stop in that case. */
+ if (GET_CODE (before) == CALL_INSN)
+ break;
+
+ /* Our caller needs either ensure that we will find all sets
+ (in case code has not been optimized yet), or take care
+ for possible labels in a way by setting boundary to preceeding
+ CODE_LABEL. */
+ if (GET_CODE (before) == CODE_LABEL)
+ {
+ if (before != boundary)
+ abort ();
+ break;
+ }
+
+ if (INSN_P (before))
+ note_stores (PATTERN (before), parms_set, &parm);
+ }
+ return before;
+}
diff --git a/gcc/sched-deps.c b/gcc/sched-deps.c
index 904b37e1d4c..59f14d0f68e 100644
--- a/gcc/sched-deps.c
+++ b/gcc/sched-deps.c
@@ -38,6 +38,7 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "toplev.h"
#include "recog.h"
#include "sched-int.h"
+#include "params.h"
extern char *reg_known_equiv_p;
extern rtx *reg_known_value;
@@ -532,6 +533,7 @@ flush_pending_lists (deps, insn, only_write)
free_INSN_LIST_list (&deps->last_pending_memory_flush);
deps->last_pending_memory_flush = alloc_INSN_LIST (insn, NULL_RTX);
+ deps->pending_flush_length = 1;
}
/* Analyze a single SET, CLOBBER, PRE_DEC, POST_DEC, PRE_INC or POST_INC
@@ -671,14 +673,13 @@ sched_analyze_1 (deps, x, insn)
{
/* Writing memory. */
- if (deps->pending_lists_length > 32)
+ if (deps->pending_lists_length > MAX_PENDING_LIST_LENGTH)
{
/* Flush all pending reads and writes to prevent the pending lists
from getting any larger. Insn scheduling runs too slowly when
- these lists get long. The number 32 was chosen because it
- seems like a reasonable number. When compiling GCC with itself,
+ these lists get long. When compiling GCC with itself,
this flush occurs 8 times for sparc, and 10 times for m88k using
- the number 32. */
+ the default value of 32. */
flush_pending_lists (deps, insn, 0);
}
else
@@ -972,6 +973,7 @@ sched_analyze_insn (deps, x, insn, loop_notes)
rtx loop_notes;
{
register RTX_CODE code = GET_CODE (x);
+ int schedule_barrier_found = 0;
rtx link;
int i;
@@ -1021,24 +1023,13 @@ sched_analyze_insn (deps, x, insn, loop_notes)
if (GET_CODE (insn) == JUMP_INSN)
{
- rtx next, u, pending, pending_mem;
+ rtx next;
next = next_nonnote_insn (insn);
if (next && GET_CODE (next) == BARRIER)
- {
- for (i = 0; i < deps->max_reg; i++)
- {
- struct deps_reg *reg_last = &deps->reg_last[i];
-
- for (u = reg_last->uses; u; u = XEXP (u, 1))
- add_dependence (insn, XEXP (u, 0), REG_DEP_ANTI);
- for (u = reg_last->sets; u; u = XEXP (u, 1))
- add_dependence (insn, XEXP (u, 0), REG_DEP_ANTI);
- for (u = reg_last->clobbers; u; u = XEXP (u, 1))
- add_dependence (insn, XEXP (u, 0), REG_DEP_ANTI);
- }
- }
+ schedule_barrier_found = 1;
else
{
+ rtx pending, pending_mem, u;
regset_head tmp;
INIT_REG_SET (&tmp);
@@ -1053,34 +1044,46 @@ sched_analyze_insn (deps, x, insn, loop_notes)
});
CLEAR_REG_SET (&tmp);
- }
- pending = deps->pending_write_insns;
- pending_mem = deps->pending_write_mems;
- while (pending)
- {
- add_dependence (insn, XEXP (pending, 0), 0);
- pending = XEXP (pending, 1);
- pending_mem = XEXP (pending_mem, 1);
- }
+ /* All memory writes and volatile reads must happen before the
+ jump. Non-volatile reads must happen before the jump iff
+ the result is needed by the above register used mask. */
+
+ pending = deps->pending_write_insns;
+ pending_mem = deps->pending_write_mems;
+ while (pending)
+ {
+ add_dependence (insn, XEXP (pending, 0), REG_DEP_OUTPUT);
+ pending = XEXP (pending, 1);
+ pending_mem = XEXP (pending_mem, 1);
+ }
+
+ pending = deps->pending_read_insns;
+ pending_mem = deps->pending_read_mems;
+ while (pending)
+ {
+ if (MEM_VOLATILE_P (XEXP (pending_mem, 0)))
+ add_dependence (insn, XEXP (pending, 0), REG_DEP_OUTPUT);
+ pending = XEXP (pending, 1);
+ pending_mem = XEXP (pending_mem, 1);
+ }
- for (u = deps->last_pending_memory_flush; u; u = XEXP (u, 1))
- add_dependence (insn, XEXP (u, 0), REG_DEP_ANTI);
+ for (u = deps->last_pending_memory_flush; u; u = XEXP (u, 1))
+ add_dependence (insn, XEXP (u, 0), REG_DEP_ANTI);
+ }
}
/* If there is a {LOOP,EHREGION}_{BEG,END} note in the middle of a basic
block, then we must be sure that no instructions are scheduled across it.
Otherwise, the reg_n_refs info (which depends on loop_depth) would
become incorrect. */
-
if (loop_notes)
{
- int schedule_barrier_found = 0;
rtx link;
/* Update loop_notes with any notes from this insn. Also determine
if any of the notes on the list correspond to instruction scheduling
- barriers (loop, eh & setjmp notes, but not range notes. */
+ barriers (loop, eh & setjmp notes, but not range notes). */
link = loop_notes;
while (XEXP (link, 1))
{
@@ -1095,30 +1098,36 @@ sched_analyze_insn (deps, x, insn, loop_notes)
}
XEXP (link, 1) = REG_NOTES (insn);
REG_NOTES (insn) = loop_notes;
+ }
- /* Add dependencies if a scheduling barrier was found. */
- if (schedule_barrier_found)
- {
- for (i = 0; i < deps->max_reg; i++)
- {
- struct deps_reg *reg_last = &deps->reg_last[i];
- rtx u;
+ /* If this instruction can throw an exception, then moving it changes
+ where block boundaries fall. This is mighty confusing elsewhere.
+ Therefore, prevent such an instruction from being moved. */
+ if (flag_non_call_exceptions && can_throw_internal (insn))
+ schedule_barrier_found = 1;
- for (u = reg_last->uses; u; u = XEXP (u, 1))
- add_dependence (insn, XEXP (u, 0), REG_DEP_ANTI);
- for (u = reg_last->sets; u; u = XEXP (u, 1))
- add_dependence (insn, XEXP (u, 0), 0);
- for (u = reg_last->clobbers; u; u = XEXP (u, 1))
- add_dependence (insn, XEXP (u, 0), 0);
+ /* Add dependencies if a scheduling barrier was found. */
+ if (schedule_barrier_found)
+ {
+ rtx u;
- if (GET_CODE (PATTERN (insn)) != COND_EXEC)
- free_INSN_LIST_list (&reg_last->uses);
- }
- reg_pending_sets_all = 1;
+ for (i = 0; i < deps->max_reg; i++)
+ {
+ struct deps_reg *reg_last = &deps->reg_last[i];
- flush_pending_lists (deps, insn, 0);
+ for (u = reg_last->uses; u; u = XEXP (u, 1))
+ add_dependence (insn, XEXP (u, 0), REG_DEP_ANTI);
+ for (u = reg_last->sets; u; u = XEXP (u, 1))
+ add_dependence (insn, XEXP (u, 0), 0);
+ for (u = reg_last->clobbers; u; u = XEXP (u, 1))
+ add_dependence (insn, XEXP (u, 0), 0);
+
+ if (GET_CODE (PATTERN (insn)) != COND_EXEC)
+ free_INSN_LIST_list (&reg_last->uses);
}
+ flush_pending_lists (deps, insn, 0);
+ reg_pending_sets_all = 1;
}
/* Accumulate clobbers until the next set so that it will be output
@@ -1234,8 +1243,14 @@ sched_analyze (deps, head, tail)
/* Make each JUMP_INSN a scheduling barrier for memory
references. */
if (GET_CODE (insn) == JUMP_INSN)
- deps->last_pending_memory_flush
- = alloc_INSN_LIST (insn, deps->last_pending_memory_flush);
+ {
+ /* Keep the list a reasonable size. */
+ if (deps->pending_flush_length++ > MAX_PENDING_LIST_LENGTH)
+ flush_pending_lists (deps, insn, 0);
+ else
+ deps->last_pending_memory_flush
+ = alloc_INSN_LIST (insn, deps->last_pending_memory_flush);
+ }
sched_analyze_insn (deps, PATTERN (insn), insn, loop_notes);
loop_notes = 0;
}
@@ -1461,6 +1476,7 @@ init_deps (deps)
deps->pending_write_insns = 0;
deps->pending_write_mems = 0;
deps->pending_lists_length = 0;
+ deps->pending_flush_length = 0;
deps->last_pending_memory_flush = 0;
deps->last_function_call = 0;
deps->in_post_call_group_p = 0;
diff --git a/gcc/sched-int.h b/gcc/sched-int.h
index 2a7eb6a0384..0b7ebab08d7 100644
--- a/gcc/sched-int.h
+++ b/gcc/sched-int.h
@@ -53,6 +53,10 @@ struct deps
a function of the length of these pending lists. */
int pending_lists_length;
+ /* Length of the pending memory flush list. Large functions with no
+ calls may build up extremely large lists. */
+ int pending_flush_length;
+
/* The last insn upon which all memory references must depend.
This is an insn which flushed the pending lists, creating a dependency
between it and all previously pending memory references. This creates
@@ -198,6 +202,9 @@ struct haifa_insn_data
moved load insn and this one. */
unsigned int fed_by_spec_load : 1;
unsigned int is_load_insn : 1;
+
+ /* Nonzero if priority has been computed already. */
+ unsigned int priority_known : 1;
};
extern struct haifa_insn_data *h_i_d;
@@ -209,6 +216,7 @@ extern struct haifa_insn_data *h_i_d;
#define CANT_MOVE(insn) (h_i_d[INSN_UID (insn)].cant_move)
#define INSN_DEP_COUNT(INSN) (h_i_d[INSN_UID (INSN)].dep_count)
#define INSN_PRIORITY(INSN) (h_i_d[INSN_UID (INSN)].priority)
+#define INSN_PRIORITY_KNOWN(INSN) (h_i_d[INSN_UID (INSN)].priority_known)
#define INSN_COST(INSN) (h_i_d[INSN_UID (INSN)].cost)
#define INSN_UNIT(INSN) (h_i_d[INSN_UID (INSN)].units)
#define INSN_REG_WEIGHT(INSN) (h_i_d[INSN_UID (INSN)].reg_weight)
diff --git a/gcc/sdbout.c b/gcc/sdbout.c
index 944651f3ddd..649bc0aa67d 100644
--- a/gcc/sdbout.c
+++ b/gcc/sdbout.c
@@ -54,6 +54,7 @@ AT&T C compiler. From the example below I would conclude the following:
#include "reload.h"
#include "output.h"
#include "toplev.h"
+#include "ggc.h"
#include "tm_p.h"
/* Mips systems use the SDB functions to dump out symbols, but do not
@@ -301,28 +302,6 @@ static struct sdb_file *current_file;
#endif /* MIPS_DEBUGGING_INFO */
-/* Set up for SDB output at the start of compilation. */
-
-void
-sdbout_init (asm_file, input_file_name, syms)
- FILE *asm_file ATTRIBUTE_UNUSED;
- const char *input_file_name ATTRIBUTE_UNUSED;
- tree syms ATTRIBUTE_UNUSED;
-{
-#ifdef MIPS_DEBUGGING_INFO
- current_file = (struct sdb_file *) xmalloc (sizeof *current_file);
- current_file->next = NULL;
- current_file->name = input_file_name;
-#endif
-
-#ifdef RMS_QUICK_HACK_1
- tree t;
- for (t = syms; t; t = TREE_CHAIN (t))
- if (DECL_NAME (t) && IDENTIFIER_POINTER (DECL_NAME (t)) != 0
- && !strcmp (IDENTIFIER_POINTER (DECL_NAME (t)), "__vtbl_ptr_type"))
- sdbout_symbol (t, 0);
-#endif
-}
#if 0
@@ -771,10 +750,11 @@ sdbout_symbol (decl, local)
/* If there was an error in the declaration, don't dump core
if there is no RTL associated with the variable doesn't
exist. */
- if (DECL_RTL (decl) == 0)
+ if (!DECL_RTL_SET_P (decl))
return;
- DECL_RTL (decl) = eliminate_regs (DECL_RTL (decl), 0, NULL_RTX);
+ SET_DECL_RTL (decl,
+ eliminate_regs (DECL_RTL (decl), 0, NULL_RTX));
#ifdef LEAF_REG_REMAP
if (current_function_uses_only_leaf_regs)
leaf_renumber_regs_insn (DECL_RTL (decl));
@@ -843,7 +823,10 @@ sdbout_symbol (decl, local)
return;
/* Record the name for, starting a symtab entry. */
- name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
+ if (local)
+ name = IDENTIFIER_POINTER (DECL_NAME (decl));
+ else
+ name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
if (GET_CODE (value) == MEM
&& GET_CODE (XEXP (value, 0)) == SYMBOL_REF)
@@ -1246,7 +1229,7 @@ sdbout_one_type (type)
const char *name;
CONTIN;
- name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (tem));
+ name = IDENTIFIER_POINTER (DECL_NAME (tem));
PUT_SDB_DEF (name);
if (DECL_BIT_FIELD_TYPE (tem))
{
@@ -1308,7 +1291,8 @@ sdbout_parms (parms)
so that the debugging output will be accurate. */
DECL_INCOMING_RTL (parms)
= eliminate_regs (DECL_INCOMING_RTL (parms), 0, NULL_RTX);
- DECL_RTL (parms) = eliminate_regs (DECL_RTL (parms), 0, NULL_RTX);
+ SET_DECL_RTL (parms,
+ eliminate_regs (DECL_RTL (parms), 0, NULL_RTX));
if (PARM_PASSED_IN_MEMORY (parms))
{
@@ -1640,4 +1624,31 @@ sdbout_resume_previous_source_file ()
#endif
}
+/* Set up for SDB output at the start of compilation. */
+
+void
+sdbout_init (asm_file, input_file_name, syms)
+ FILE *asm_file ATTRIBUTE_UNUSED;
+ const char *input_file_name ATTRIBUTE_UNUSED;
+ tree syms ATTRIBUTE_UNUSED;
+{
+#ifdef MIPS_DEBUGGING_INFO
+ current_file = (struct sdb_file *) xmalloc (sizeof *current_file);
+ current_file->next = NULL;
+ current_file->name = input_file_name;
+#endif
+
+#ifdef RMS_QUICK_HACK_1
+ tree t;
+ for (t = syms; t; t = TREE_CHAIN (t))
+ if (DECL_NAME (t) && IDENTIFIER_POINTER (DECL_NAME (t)) != 0
+ && !strcmp (IDENTIFIER_POINTER (DECL_NAME (t)), "__vtbl_ptr_type"))
+ sdbout_symbol (t, 0);
+#endif
+
+#ifdef SDB_ALLOW_FORWARD_REFERENCES
+ ggc_add_tree_root (&anonymous_types, 1);
+#endif
+}
+
#endif /* SDB_DEBUGGING_INFO */
diff --git a/gcc/sibcall.c b/gcc/sibcall.c
index 730654ae946..541a97c6d85 100644
--- a/gcc/sibcall.c
+++ b/gcc/sibcall.c
@@ -466,7 +466,7 @@ optimize_sibling_and_tail_recursive_calls ()
/* We need cfg information to determine which blocks are succeeded
only by the epilogue. */
find_basic_blocks (insns, max_reg_num (), 0);
- cleanup_cfg (insns);
+ cleanup_cfg ();
/* If there are no basic blocks, then there is nothing to do. */
if (n_basic_blocks == 0)
@@ -543,6 +543,12 @@ optimize_sibling_and_tail_recursive_calls ()
if (frame_offset)
goto failure;
+ /* Any function that calls setjmp might have longjmp called from
+ any called function. ??? We really should represent this
+ properly in the CFG so that this needn't be special cased. */
+ if (current_function_calls_setjmp)
+ goto failure;
+
/* Taking the address of a local variable is fatal to tail
recursion if the address is used by the recursive call. */
if (current_function_uses_addressof)
@@ -657,12 +663,7 @@ success:
we actually write into. */
for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
{
- if (GET_CODE (insn) == NOTE)
- {
- if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_FUNCTION_BEG)
- break;
- }
- else if (INSN_P (insn))
+ if (INSN_P (insn))
purge_mem_unchanging_flag (PATTERN (insn));
}
}
diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c
index afd8d264b62..0bb071023fc 100644
--- a/gcc/simplify-rtx.c
+++ b/gcc/simplify-rtx.c
@@ -1377,25 +1377,33 @@ simplify_binary_operation (code, mode, op0, op1)
break;
case DIV:
- if (arg1s == 0)
+ if (arg1s == 0
+ || (arg0s == (HOST_WIDE_INT) 1 << (HOST_BITS_PER_WIDE_INT - 1)
+ && arg1s == -1))
return 0;
val = arg0s / arg1s;
break;
case MOD:
- if (arg1s == 0)
+ if (arg1s == 0
+ || (arg0s == (HOST_WIDE_INT) 1 << (HOST_BITS_PER_WIDE_INT - 1)
+ && arg1s == -1))
return 0;
val = arg0s % arg1s;
break;
case UDIV:
- if (arg1 == 0)
+ if (arg1 == 0
+ || (arg0s == (HOST_WIDE_INT) 1 << (HOST_BITS_PER_WIDE_INT - 1)
+ && arg1s == -1))
return 0;
val = (unsigned HOST_WIDE_INT) arg0 / arg1;
break;
case UMOD:
- if (arg1 == 0)
+ if (arg1 == 0
+ || (arg0s == (HOST_WIDE_INT) 1 << (HOST_BITS_PER_WIDE_INT - 1)
+ && arg1s == -1))
return 0;
val = (unsigned HOST_WIDE_INT) arg0 % arg1;
break;
@@ -2635,12 +2643,11 @@ hash_rtx (x, mode, create)
if (! e)
return 0;
- hash += e->value;
- return hash;
+ return e->value;
case CONST_INT:
hash += ((unsigned) CONST_INT << 7) + (unsigned) mode + INTVAL (x);
- return hash ? hash : CONST_INT;
+ return hash ? hash : (unsigned int) CONST_INT;
case CONST_DOUBLE:
/* This is like the general case, except that it only counts
@@ -2652,18 +2659,18 @@ hash_rtx (x, mode, create)
else
hash += ((unsigned) CONST_DOUBLE_LOW (x)
+ (unsigned) CONST_DOUBLE_HIGH (x));
- return hash ? hash : CONST_DOUBLE;
+ return hash ? hash : (unsigned int) CONST_DOUBLE;
/* Assume there is only one rtx object for any given label. */
case LABEL_REF:
hash
+= ((unsigned) LABEL_REF << 7) + (unsigned long) XEXP (x, 0);
- return hash ? hash : LABEL_REF;
+ return hash ? hash : (unsigned int) LABEL_REF;
case SYMBOL_REF:
hash
+= ((unsigned) SYMBOL_REF << 7) + (unsigned long) XSTR (x, 0);
- return hash ? hash : SYMBOL_REF;
+ return hash ? hash : (unsigned int) SYMBOL_REF;
case PRE_DEC:
case PRE_INC:
@@ -2737,7 +2744,7 @@ hash_rtx (x, mode, create)
abort ();
}
- return hash ? hash : 1 + GET_CODE (x);
+ return hash ? hash : 1 + (unsigned int) GET_CODE (x);
}
/* Create a new value structure for VALUE and initialize it. The mode of the
diff --git a/gcc/stmt.c b/gcc/stmt.c
index 8465df7221c..ec5b996ce90 100644
--- a/gcc/stmt.c
+++ b/gcc/stmt.c
@@ -42,9 +42,7 @@ Boston, MA 02111-1307, USA. */
#include "flags.h"
#include "except.h"
#include "function.h"
-#include "insn-flags.h"
#include "insn-config.h"
-#include "insn-codes.h"
#include "expr.h"
#include "hard-reg-set.h"
#include "obstack.h"
@@ -398,6 +396,8 @@ struct stmt_status
static int using_eh_for_cleanups_p = 0;
static int n_occurrences PARAMS ((int, const char *));
+static bool parse_input_constraint PARAMS ((const char **, int, int, int,
+ int, tree, bool *, bool *));
static void expand_goto_internal PARAMS ((tree, rtx, rtx));
static int expand_fixup PARAMS ((tree, rtx, rtx));
static rtx expand_nl_handler_label PARAMS ((rtx, rtx));
@@ -675,12 +675,13 @@ label_rtx (label)
if (TREE_CODE (label) != LABEL_DECL)
abort ();
- if (DECL_RTL (label))
- return DECL_RTL (label);
+ if (!DECL_RTL_SET_P (label))
+ SET_DECL_RTL (label, gen_label_rtx ());
- return DECL_RTL (label) = gen_label_rtx ();
+ return DECL_RTL (label);
}
+
/* Add an unconditional jump to LABEL as the next sequential instruction. */
void
@@ -843,12 +844,17 @@ expand_goto (label)
/* Search backwards to the jump insn and mark it as a
non-local goto. */
- for (insn = get_last_insn ();
- GET_CODE (insn) != JUMP_INSN;
- insn = PREV_INSN (insn))
- continue;
- REG_NOTES (insn) = alloc_EXPR_LIST (REG_NON_LOCAL_GOTO, const0_rtx,
- REG_NOTES (insn));
+ for (insn = get_last_insn (); insn; insn = PREV_INSN (insn))
+ {
+ if (GET_CODE (insn) == JUMP_INSN)
+ {
+ REG_NOTES (insn) = alloc_EXPR_LIST (REG_NON_LOCAL_GOTO,
+ const0_rtx, REG_NOTES (insn));
+ break;
+ }
+ else if (GET_CODE (insn) == CALL_INSN)
+ break;
+ }
}
else
expand_goto_internal (label, label_rtx (label), NULL_RTX);
@@ -1293,6 +1299,281 @@ expand_asm (body)
last_expr_type = 0;
}
+/* Parse the output constraint pointed to by *CONSTRAINT_P. It is the
+ OPERAND_NUMth output operand, indexed from zero. There are NINPUTS
+ inputs and NOUTPUTS outputs to this extended-asm. Upon return,
+ *ALLOWS_MEM will be TRUE iff the constraint allows the use of a
+ memory operand. Similarly, *ALLOWS_REG will be TRUE iff the
+ constraint allows the use of a register operand. And, *IS_INOUT
+ will be true if the operand is read-write, i.e., if it is used as
+ an input as well as an output. If *CONSTRAINT_P is not in
+ canonical form, it will be made canonical. (Note that `+' will be
+ rpelaced with `=' as part of this process.)
+
+ Returns TRUE if all went well; FALSE if an error occurred. */
+
+bool
+parse_output_constraint (constraint_p, operand_num, ninputs, noutputs,
+ allows_mem, allows_reg, is_inout)
+ const char **constraint_p;
+ int operand_num;
+ int ninputs;
+ int noutputs;
+ bool *allows_mem;
+ bool *allows_reg;
+ bool *is_inout;
+{
+ const char *constraint = *constraint_p;
+ const char *p;
+
+ /* Assume the constraint doesn't allow the use of either a register
+ or memory. */
+ *allows_mem = false;
+ *allows_reg = false;
+
+ /* Allow the `=' or `+' to not be at the beginning of the string,
+ since it wasn't explicitly documented that way, and there is a
+ large body of code that puts it last. Swap the character to
+ the front, so as not to uglify any place else. */
+ p = strchr (constraint, '=');
+ if (!p)
+ p = strchr (constraint, '+');
+
+ /* If the string doesn't contain an `=', issue an error
+ message. */
+ if (!p)
+ {
+ error ("output operand constraint lacks `='");
+ return false;
+ }
+
+ /* If the constraint begins with `+', then the operand is both read
+ from and written to. */
+ *is_inout = (*p == '+');
+
+ /* Make sure we can specify the matching operand. */
+ if (*is_inout && operand_num > 9)
+ {
+ error ("output operand constraint %d contains `+'",
+ operand_num);
+ return false;
+ }
+
+ /* Canonicalize the output constraint so that it begins with `='. */
+ if (p != constraint || is_inout)
+ {
+ char *buf;
+ size_t c_len = strlen (constraint);
+
+ if (p != constraint)
+ warning ("output constraint `%c' for operand %d is not at the beginning",
+ *p, operand_num);
+
+ /* Make a copy of the constraint. */
+ buf = alloca (c_len + 1);
+ strcpy (buf, constraint);
+ /* Swap the first character and the `=' or `+'. */
+ buf[p - constraint] = buf[0];
+ /* Make sure the first character is an `='. (Until we do this,
+ it might be a `+'.) */
+ buf[0] = '=';
+ /* Replace the constraint with the canonicalized string. */
+ *constraint_p = ggc_alloc_string (buf, c_len);
+ constraint = *constraint_p;
+ }
+
+ /* Loop through the constraint string. */
+ for (p = constraint + 1; *p; ++p)
+ switch (*p)
+ {
+ case '+':
+ case '=':
+ error ("operand constraint contains '+' or '=' at illegal position.");
+ return false;
+
+ case '%':
+ if (operand_num + 1 == ninputs + noutputs)
+ {
+ error ("`%%' constraint used with last operand");
+ return false;
+ }
+ break;
+
+ case 'V': case 'm': case 'o':
+ *allows_mem = true;
+ break;
+
+ case '?': case '!': case '*': case '&': case '#':
+ 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 ',':
+ break;
+
+ case '0': case '1': case '2': case '3': case '4':
+ case '5': case '6': case '7': case '8': case '9':
+ error ("matching constraint not valid in output operand");
+ return false;
+
+ case '<': case '>':
+ /* ??? Before flow, auto inc/dec insns are not supposed to exist,
+ excepting those that expand_call created. So match memory
+ and hope. */
+ *allows_mem = true;
+ break;
+
+ case 'g': case 'X':
+ *allows_reg = true;
+ *allows_mem = true;
+ break;
+
+ case 'p': case 'r':
+ *allows_reg = true;
+ break;
+
+ default:
+ if (!ISALPHA (*p))
+ break;
+ if (REG_CLASS_FROM_LETTER (*p) != NO_REGS)
+ *allows_reg = true;
+#ifdef EXTRA_CONSTRAINT
+ else
+ {
+ /* Otherwise we can't assume anything about the nature of
+ the constraint except that it isn't purely registers.
+ Treat it like "g" and hope for the best. */
+ *allows_reg = true;
+ *allows_mem = true;
+ }
+#endif
+ break;
+ }
+
+ return true;
+}
+
+/* Similar, but for input constraints. */
+
+static bool
+parse_input_constraint (constraint_p, input_num, ninputs, noutputs, ninout,
+ outputs, allows_mem, allows_reg)
+ const char **constraint_p;
+ int input_num;
+ int ninputs;
+ int noutputs;
+ int ninout;
+ tree outputs;
+ bool *allows_mem;
+ bool *allows_reg;
+{
+ const char *constraint = *constraint_p;
+ const char *orig_constraint = constraint;
+ size_t c_len = strlen (constraint);
+ size_t j;
+
+ /* Assume the constraint doesn't allow the use of either
+ a register or memory. */
+ *allows_mem = false;
+ *allows_reg = false;
+
+ /* Make sure constraint has neither `=', `+', nor '&'. */
+
+ for (j = 0; j < c_len; j++)
+ switch (constraint[j])
+ {
+ case '+': case '=': case '&':
+ if (constraint == orig_constraint)
+ {
+ error ("input operand constraint contains `%c'", constraint[j]);
+ return false;
+ }
+ break;
+
+ case '%':
+ if (constraint == orig_constraint
+ && input_num + 1 == ninputs - ninout)
+ {
+ error ("`%%' constraint used with last operand");
+ return false;
+ }
+ break;
+
+ case 'V': case 'm': case 'o':
+ *allows_mem = true;
+ break;
+
+ case '<': case '>':
+ case '?': case '!': case '*': case '#':
+ 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 ',':
+ break;
+
+ /* Whether or not a numeric constraint allows a register is
+ decided by the matching constraint, and so there is no need
+ to do anything special with them. We must handle them in
+ the default case, so that we don't unnecessarily force
+ operands to memory. */
+ case '0': case '1': case '2': case '3': case '4':
+ case '5': case '6': case '7': case '8': case '9':
+ if (constraint[j] >= '0' + noutputs)
+ {
+ error ("matching constraint references invalid operand number");
+ return false;
+ }
+
+ /* Try and find the real constraint for this dup. */
+ if ((j == 0 && c_len == 1)
+ || (j == 1 && c_len == 2 && constraint[0] == '%'))
+ {
+ tree o = outputs;
+
+ for (j = constraint[j] - '0'; j > 0; --j)
+ o = TREE_CHAIN (o);
+
+ constraint = TREE_STRING_POINTER (TREE_PURPOSE (o));
+ *constraint_p = constraint;
+ c_len = strlen (constraint);
+ j = 0;
+ break;
+ }
+
+ /* Fall through. */
+
+ case 'p': case 'r':
+ *allows_reg = true;
+ break;
+
+ case 'g': case 'X':
+ *allows_reg = true;
+ *allows_mem = true;
+ break;
+
+ default:
+ if (! ISALPHA (constraint[j]))
+ {
+ error ("invalid punctuation `%c' in constraint", constraint[j]);
+ return false;
+ }
+ if (REG_CLASS_FROM_LETTER (constraint[j]) != NO_REGS)
+ *allows_reg = true;
+#ifdef EXTRA_CONSTRAINT
+ else
+ {
+ /* Otherwise we can't assume anything about the nature of
+ the constraint except that it isn't purely registers.
+ Treat it like "g" and hope for the best. */
+ *allows_reg = true;
+ *allows_mem = true;
+ }
+#endif
+ break;
+ }
+
+ return true;
+}
+
/* Generate RTL for an asm statement with arguments.
STRING is the instruction template.
OUTPUTS is a list of output arguments (lvalues); INPUTS a list of inputs.
@@ -1319,7 +1600,7 @@ expand_asm_operands (string, outputs, inputs, clobbers, vol, filename, line)
rtx body;
int ninputs = list_length (inputs);
int noutputs = list_length (outputs);
- int ninout = 0;
+ int ninout;
int nclobbers;
tree tail;
register int i;
@@ -1329,6 +1610,8 @@ expand_asm_operands (string, outputs, inputs, clobbers, vol, filename, line)
rtx *real_output_rtx = (rtx *) alloca (noutputs * sizeof (rtx));
enum machine_mode *inout_mode
= (enum machine_mode *) alloca (noutputs * sizeof (enum machine_mode));
+ const char **output_constraints
+ = alloca (noutputs * sizeof (const char *));
/* The insn we have emitted. */
rtx insn;
int old_generating_concat_p = generating_concat_p;
@@ -1405,140 +1688,84 @@ expand_asm_operands (string, outputs, inputs, clobbers, vol, filename, line)
}
}
+ /* First pass over inputs and outputs checks validity and sets
+ mark_addressable if needed. */
+
+ ninout = 0;
for (i = 0, tail = outputs; tail; tail = TREE_CHAIN (tail), i++)
{
tree val = TREE_VALUE (tail);
tree type = TREE_TYPE (val);
const char *constraint;
- char *p;
- int c_len;
- int j;
- int is_inout = 0;
- int allows_reg = 0;
- int allows_mem = 0;
+ bool is_inout;
+ bool allows_reg;
+ bool allows_mem;
/* If there's an erroneous arg, emit no insn. */
- if (TREE_TYPE (val) == error_mark_node)
+ if (type == error_mark_node)
return;
- /* Make sure constraint has `=' and does not have `+'. Also, see
- if it allows any register. Be liberal on the latter test, since
- the worst that happens if we get it wrong is we issue an error
- message. */
-
+ /* Try to parse the output constraint. If that fails, there's
+ no point in going further. */
constraint = TREE_STRING_POINTER (TREE_PURPOSE (tail));
- c_len = strlen (constraint);
-
- /* Allow the `=' or `+' to not be at the beginning of the string,
- since it wasn't explicitly documented that way, and there is a
- large body of code that puts it last. Swap the character to
- the front, so as not to uglify any place else. */
- switch (c_len)
- {
- default:
- if ((p = strchr (constraint, '=')) != NULL)
- break;
- if ((p = strchr (constraint, '+')) != NULL)
- break;
- case 0:
- error ("output operand constraint lacks `='");
- return;
- }
- j = p - constraint;
- is_inout = *p == '+';
-
- if (j || is_inout)
- {
- /* Have to throw away this constraint string and get a new one. */
- char *buf = alloca (c_len + 1);
- buf[0] = '=';
- if (j)
- memcpy (buf + 1, constraint, j);
- memcpy (buf + 1 + j, p + 1, c_len - j); /* not -j-1 - copy null */
- constraint = ggc_alloc_string (buf, c_len);
-
- if (j)
- warning (
- "output constraint `%c' for operand %d is not at the beginning",
- *p, i);
- }
-
- /* Make sure we can specify the matching operand. */
- if (is_inout && i > 9)
- {
- error ("output operand constraint %d contains `+'", i);
- return;
- }
+ if (!parse_output_constraint (&constraint, i, ninputs, noutputs,
+ &allows_mem, &allows_reg, &is_inout))
+ return;
- for (j = 1; j < c_len; j++)
- switch (constraint[j])
- {
- case '+':
- case '=':
- error ("operand constraint contains '+' or '=' at illegal position.");
- return;
+ if (! allows_reg
+ && (allows_mem
+ || is_inout
+ || (DECL_P (val)
+ && GET_CODE (DECL_RTL (val)) == REG
+ && GET_MODE (DECL_RTL (val)) != TYPE_MODE (type))))
+ mark_addressable (val);
- case '%':
- if (i + 1 == ninputs + noutputs)
- {
- error ("`%%' constraint used with last operand");
- return;
- }
- break;
+ if (is_inout)
+ ninout++;
+ }
- case '?': case '!': case '*': case '&': case '#':
- 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 ',':
- break;
+ ninputs += ninout;
+ if (ninputs + noutputs > MAX_RECOG_OPERANDS)
+ {
+ error ("more than %d operands in `asm'", MAX_RECOG_OPERANDS);
+ return;
+ }
- case '0': case '1': case '2': case '3': case '4':
- case '5': case '6': case '7': case '8': case '9':
- error ("matching constraint not valid in output operand");
- break;
+ for (i = 0, tail = inputs; tail; i++, tail = TREE_CHAIN (tail))
+ {
+ bool allows_reg, allows_mem;
+ const char *constraint;
- case 'V': case 'm': case 'o':
- allows_mem = 1;
- break;
+ /* If there's an erroneous arg, emit no insn, because the ASM_INPUT
+ would get VOIDmode and that could cause a crash in reload. */
+ if (TREE_TYPE (TREE_VALUE (tail)) == error_mark_node)
+ return;
- case '<': case '>':
- /* ??? Before flow, auto inc/dec insns are not supposed to exist,
- excepting those that expand_call created. So match memory
- and hope. */
- allows_mem = 1;
- break;
+ constraint = TREE_STRING_POINTER (TREE_PURPOSE (tail));
+ if (! parse_input_constraint (&constraint, i, ninputs, noutputs, ninout,
+ outputs, &allows_mem, &allows_reg))
+ return;
- case 'g': case 'X':
- allows_reg = 1;
- allows_mem = 1;
- break;
+ if (! allows_reg && allows_mem)
+ mark_addressable (TREE_VALUE (tail));
+ }
- case 'p': case 'r':
- allows_reg = 1;
- break;
+ /* Second pass evaluates arguments. */
- default:
- if (! ISALPHA (constraint[j]))
- {
- error ("invalid punctuation `%c' in constraint",
- constraint[j]);
- return;
- }
- if (REG_CLASS_FROM_LETTER (constraint[j]) != NO_REGS)
- allows_reg = 1;
-#ifdef EXTRA_CONSTRAINT
- else
- {
- /* Otherwise we can't assume anything about the nature of
- the constraint except that it isn't purely registers.
- Treat it like "g" and hope for the best. */
- allows_reg = 1;
- allows_mem = 1;
- }
-#endif
- break;
- }
+ ninout = 0;
+ for (i = 0, tail = outputs; tail; tail = TREE_CHAIN (tail), i++)
+ {
+ tree val = TREE_VALUE (tail);
+ tree type = TREE_TYPE (val);
+ bool is_inout;
+ bool allows_reg;
+ bool allows_mem;
+
+ output_constraints[i] = TREE_STRING_POINTER (TREE_PURPOSE (tail));
+ if (!parse_output_constraint (&output_constraints[i], i, ninputs,
+ noutputs, &allows_mem, &allows_reg,
+ &is_inout))
+ abort ();
/* If an output operand is not a decl or indirect ref and our constraint
allows a register, make a temporary to act as an intermediate.
@@ -1557,12 +1784,8 @@ expand_asm_operands (string, outputs, inputs, clobbers, vol, filename, line)
|| ! allows_reg
|| is_inout)
{
- if (! allows_reg)
- mark_addressable (TREE_VALUE (tail));
-
output_rtx[i]
- = expand_expr (TREE_VALUE (tail), NULL_RTX, VOIDmode,
- EXPAND_MEMORY_USE_WO);
+ = expand_expr (val, NULL_RTX, VOIDmode, EXPAND_MEMORY_USE_WO);
if (! allows_reg && GET_CODE (output_rtx[i]) != MEM)
error ("output number %d not directly addressable", i);
@@ -1585,18 +1808,11 @@ expand_asm_operands (string, outputs, inputs, clobbers, vol, filename, line)
if (is_inout)
{
- inout_mode[ninout] = TYPE_MODE (TREE_TYPE (TREE_VALUE (tail)));
+ inout_mode[ninout] = TYPE_MODE (type);
inout_opnum[ninout++] = i;
}
}
- ninputs += ninout;
- if (ninputs + noutputs > MAX_RECOG_OPERANDS)
- {
- error ("more than %d operands in `asm'", MAX_RECOG_OPERANDS);
- return;
- }
-
/* Make vectors for the expression-rtx and constraint strings. */
argvec = rtvec_alloc (ninputs);
@@ -1613,154 +1829,40 @@ expand_asm_operands (string, outputs, inputs, clobbers, vol, filename, line)
/* Eval the inputs and put them into ARGVEC.
Put their constraints into ASM_INPUTs and store in CONSTRAINTS. */
- i = 0;
- for (tail = inputs; tail; tail = TREE_CHAIN (tail))
+ for (i = 0, tail = inputs; tail; i++, tail = TREE_CHAIN (tail))
{
- int j;
- int allows_reg = 0, allows_mem = 0;
- const char *constraint, *orig_constraint;
- int c_len;
+ bool allows_reg, allows_mem;
+ const char *constraint;
+ tree val, type;
rtx op;
- /* If there's an erroneous arg, emit no insn,
- because the ASM_INPUT would get VOIDmode
- and that could cause a crash in reload. */
- if (TREE_TYPE (TREE_VALUE (tail)) == error_mark_node)
- return;
-
- /* ??? Can this happen, and does the error message make any sense? */
- if (TREE_PURPOSE (tail) == NULL_TREE)
- {
- error ("hard register `%s' listed as input operand to `asm'",
- TREE_STRING_POINTER (TREE_VALUE (tail)) );
- return;
- }
-
constraint = TREE_STRING_POINTER (TREE_PURPOSE (tail));
- c_len = strlen (constraint);
- orig_constraint = constraint;
-
- /* Make sure constraint has neither `=', `+', nor '&'. */
-
- for (j = 0; j < c_len; j++)
- switch (constraint[j])
- {
- case '+': case '=': case '&':
- if (constraint == orig_constraint)
- {
- error ("input operand constraint contains `%c'",
- constraint[j]);
- return;
- }
- break;
-
- case '%':
- if (constraint == orig_constraint
- && i + 1 == ninputs - ninout)
- {
- error ("`%%' constraint used with last operand");
- return;
- }
- break;
-
- case 'V': case 'm': case 'o':
- allows_mem = 1;
- break;
-
- case '<': case '>':
- case '?': case '!': case '*': case '#':
- 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 ',':
- break;
-
- /* Whether or not a numeric constraint allows a register is
- decided by the matching constraint, and so there is no need
- to do anything special with them. We must handle them in
- the default case, so that we don't unnecessarily force
- operands to memory. */
- case '0': case '1': case '2': case '3': case '4':
- case '5': case '6': case '7': case '8': case '9':
- if (constraint[j] >= '0' + noutputs)
- {
- error
- ("matching constraint references invalid operand number");
- return;
- }
-
- /* Try and find the real constraint for this dup. */
- if ((j == 0 && c_len == 1)
- || (j == 1 && c_len == 2 && constraint[0] == '%'))
- {
- tree o = outputs;
-
- for (j = constraint[j] - '0'; j > 0; --j)
- o = TREE_CHAIN (o);
-
- constraint = TREE_STRING_POINTER (TREE_PURPOSE (o));
- c_len = strlen (constraint);
- j = 0;
- break;
- }
-
- /* Fall through. */
-
- case 'p': case 'r':
- allows_reg = 1;
- break;
-
- case 'g': case 'X':
- allows_reg = 1;
- allows_mem = 1;
- break;
-
- default:
- if (! ISALPHA (constraint[j]))
- {
- error ("invalid punctuation `%c' in constraint",
- constraint[j]);
- return;
- }
- if (REG_CLASS_FROM_LETTER (constraint[j]) != NO_REGS)
- allows_reg = 1;
-#ifdef EXTRA_CONSTRAINT
- else
- {
- /* Otherwise we can't assume anything about the nature of
- the constraint except that it isn't purely registers.
- Treat it like "g" and hope for the best. */
- allows_reg = 1;
- allows_mem = 1;
- }
-#endif
- break;
- }
+ if (! parse_input_constraint (&constraint, i, ninputs, noutputs, ninout,
+ outputs, &allows_mem, &allows_reg))
+ abort ();
- if (! allows_reg && allows_mem)
- mark_addressable (TREE_VALUE (tail));
+ generating_concat_p = 0;
- op = expand_expr (TREE_VALUE (tail), NULL_RTX, VOIDmode, 0);
+ val = TREE_VALUE (tail);
+ type = TREE_TYPE (val);
+ op = expand_expr (val, NULL_RTX, VOIDmode, 0);
/* Never pass a CONCAT to an ASM. */
- generating_concat_p = 0;
if (GET_CODE (op) == CONCAT)
op = force_reg (GET_MODE (op), op);
if (asm_operand_ok (op, constraint) <= 0)
{
if (allows_reg)
- op = force_reg (TYPE_MODE (TREE_TYPE (TREE_VALUE (tail))), op);
+ op = force_reg (TYPE_MODE (type), op);
else if (!allows_mem)
warning ("asm operand %d probably doesn't match constraints", i);
else if (CONSTANT_P (op))
- op = force_const_mem (TYPE_MODE (TREE_TYPE (TREE_VALUE (tail))),
- op);
+ op = force_const_mem (TYPE_MODE (type), op);
else if (GET_CODE (op) == REG
|| GET_CODE (op) == SUBREG
|| GET_CODE (op) == CONCAT)
{
- tree type = TREE_TYPE (TREE_VALUE (tail));
tree qual_type = build_qualified_type (type,
(TYPE_QUALS (type)
| TYPE_QUAL_CONST));
@@ -1769,11 +1871,11 @@ expand_asm_operands (string, outputs, inputs, clobbers, vol, filename, line)
emit_move_insn (memloc, op);
op = memloc;
}
-
else if (GET_CODE (op) == MEM && MEM_VOLATILE_P (op))
- /* We won't recognize volatile memory as available a
- memory_operand at this point. Ignore it. */
- ;
+ {
+ /* We won't recognize volatile memory as available a
+ memory_operand at this point. Ignore it. */
+ }
else if (queued_subexp_p (op))
;
else
@@ -1782,13 +1884,13 @@ expand_asm_operands (string, outputs, inputs, clobbers, vol, filename, line)
not satisfied. */
warning ("asm operand %d probably doesn't match constraints", i);
}
+
generating_concat_p = old_generating_concat_p;
ASM_OPERANDS_INPUT (body, i) = op;
ASM_OPERANDS_INPUT_CONSTRAINT_EXP (body, i)
- = gen_rtx_ASM_INPUT (TYPE_MODE (TREE_TYPE (TREE_VALUE (tail))),
- orig_constraint);
- i++;
+ = gen_rtx_ASM_INPUT (TYPE_MODE (type),
+ TREE_STRING_POINTER (TREE_PURPOSE (tail)));
}
/* Protect all the operands from the queue now that they have all been
@@ -1824,7 +1926,7 @@ expand_asm_operands (string, outputs, inputs, clobbers, vol, filename, line)
if (noutputs == 1 && nclobbers == 0)
{
ASM_OPERANDS_OUTPUT_CONSTRAINT (body)
- = TREE_STRING_POINTER (TREE_PURPOSE (outputs));
+ = output_constraints[0];
insn = emit_insn (gen_rtx_SET (VOIDmode, output_rtx[0], body));
}
@@ -1853,7 +1955,7 @@ expand_asm_operands (string, outputs, inputs, clobbers, vol, filename, line)
gen_rtx_ASM_OPERANDS
(GET_MODE (output_rtx[i]),
TREE_STRING_POINTER (string),
- TREE_STRING_POINTER (TREE_PURPOSE (tail)),
+ output_constraints[i],
i, argvec, constraints,
filename, line));
@@ -2349,8 +2451,8 @@ void
expand_end_loop ()
{
rtx start_label = loop_stack->data.loop.start_label;
- rtx insn = get_last_insn ();
- int needs_end_jump = 1;
+ rtx etc_note;
+ int eh_regions, debug_blocks;
/* Mark the continue-point at the top of the loop if none elsewhere. */
if (start_label == loop_stack->data.loop.continue_label)
@@ -2358,296 +2460,134 @@ expand_end_loop ()
do_pending_stack_adjust ();
- /* If optimizing, perhaps reorder the loop.
- First, try to use a condjump near the end.
- expand_exit_loop_if_false ends loops with unconditional jumps,
- like this:
-
- if (test) goto label;
- optional: cleanup
- goto loop_stack->data.loop.end_label
- barrier
- label:
-
- If we find such a pattern, we can end the loop earlier. */
-
- if (optimize
- && GET_CODE (insn) == CODE_LABEL
- && LABEL_NAME (insn) == NULL
- && GET_CODE (PREV_INSN (insn)) == BARRIER)
- {
- rtx label = insn;
- rtx jump = PREV_INSN (PREV_INSN (label));
-
- if (GET_CODE (jump) == JUMP_INSN
- && GET_CODE (PATTERN (jump)) == SET
- && SET_DEST (PATTERN (jump)) == pc_rtx
- && GET_CODE (SET_SRC (PATTERN (jump))) == LABEL_REF
- && (XEXP (SET_SRC (PATTERN (jump)), 0)
- == loop_stack->data.loop.end_label))
- {
- rtx prev;
-
- /* The test might be complex and reference LABEL multiple times,
- like the loop in loop_iterations to set vtop. To handle this,
- we move LABEL. */
- insn = PREV_INSN (label);
- reorder_insns (label, label, start_label);
-
- for (prev = PREV_INSN (jump);; prev = PREV_INSN (prev))
- {
- /* We ignore line number notes, but if we see any other note,
- in particular NOTE_INSN_BLOCK_*, NOTE_INSN_EH_REGION_*,
- NOTE_INSN_LOOP_*, we disable this optimization. */
- if (GET_CODE (prev) == NOTE)
- {
- if (NOTE_LINE_NUMBER (prev) < 0)
- break;
- continue;
- }
- if (GET_CODE (prev) == CODE_LABEL)
- break;
- if (GET_CODE (prev) == JUMP_INSN)
- {
- if (GET_CODE (PATTERN (prev)) == SET
- && SET_DEST (PATTERN (prev)) == pc_rtx
- && GET_CODE (SET_SRC (PATTERN (prev))) == IF_THEN_ELSE
- && (GET_CODE (XEXP (SET_SRC (PATTERN (prev)), 1))
- == LABEL_REF)
- && XEXP (XEXP (SET_SRC (PATTERN (prev)), 1), 0) == label)
- {
- XEXP (XEXP (SET_SRC (PATTERN (prev)), 1), 0)
- = start_label;
- emit_note_after (NOTE_INSN_LOOP_END, prev);
- needs_end_jump = 0;
- }
- break;
- }
- }
- }
- }
-
- /* If the loop starts with a loop exit, roll that to the end where
+ /* If the loop starts with a loop exit, roll that to the end where
it will optimize together with the jump back.
- We look for the conditional branch to the exit, except that once
- we find such a branch, we don't look past 30 instructions.
-
- In more detail, if the loop presently looks like this (in pseudo-C):
+ If the loop presently looks like this (in pseudo-C):
- start_label:
- if (test) goto end_label;
- body;
- goto start_label;
- end_label:
+ LOOP_BEG
+ start_label:
+ if (test) goto end_label;
+ LOOP_END_TOP_COND
+ body;
+ goto start_label;
+ end_label:
transform it to look like:
- goto start_label;
- newstart_label:
- body;
- start_label:
- if (test) goto end_label;
- goto newstart_label;
- end_label:
-
- Here, the `test' may actually consist of some reasonably complex
- code, terminating in a test. */
-
- if (optimize
- && needs_end_jump
- &&
- ! (GET_CODE (insn) == JUMP_INSN
- && GET_CODE (PATTERN (insn)) == SET
- && SET_DEST (PATTERN (insn)) == pc_rtx
- && GET_CODE (SET_SRC (PATTERN (insn))) == IF_THEN_ELSE))
- {
- int eh_regions = 0;
- int num_insns = 0;
- rtx last_test_insn = NULL_RTX;
-
- /* Scan insns from the top of the loop looking for a qualified
- conditional exit. */
- for (insn = NEXT_INSN (loop_stack->data.loop.start_label); insn;
- insn = NEXT_INSN (insn))
- {
- if (GET_CODE (insn) == NOTE)
- {
- if (optimize < 2
- && (NOTE_LINE_NUMBER (insn) == NOTE_INSN_BLOCK_BEG
- || NOTE_LINE_NUMBER (insn) == NOTE_INSN_BLOCK_END))
- /* The code that actually moves the exit test will
- carefully leave BLOCK notes in their original
- location. That means, however, that we can't debug
- the exit test itself. So, we refuse to move code
- containing BLOCK notes at low optimization levels. */
- break;
-
- if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_EH_REGION_BEG)
- ++eh_regions;
- else if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_EH_REGION_END)
- {
- --eh_regions;
- if (eh_regions < 0)
- /* We've come to the end of an EH region, but
- never saw the beginning of that region. That
- means that an EH region begins before the top
- of the loop, and ends in the middle of it. The
- existence of such a situation violates a basic
- assumption in this code, since that would imply
- that even when EH_REGIONS is zero, we might
- move code out of an exception region. */
- abort ();
- }
-
- /* We must not walk into a nested loop. */
- if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_LOOP_BEG)
- break;
-
- /* We already know this INSN is a NOTE, so there's no
- point in looking at it to see if it's a JUMP. */
- continue;
- }
-
- if (GET_CODE (insn) == JUMP_INSN || GET_CODE (insn) == INSN)
- num_insns++;
+ LOOP_BEG
+ goto start_label;
+ top_label:
+ body;
+ start_label:
+ if (test) goto end_label;
+ goto top_label;
+ end_label:
+
+ We rely on the presence of NOTE_INSN_LOOP_END_TOP_COND to mark
+ the end of the entry condtional. Without this, our lexical scan
+ can't tell the difference between an entry conditional and a
+ body conditional that exits the loop. Mistaking the two means
+ that we can misplace the NOTE_INSN_LOOP_CONT note, which can
+ screw up loop unrolling.
+
+ Things will be oh so much better when loop optimization is done
+ off of a proper control flow graph... */
+
+ /* Scan insns from the top of the loop looking for the END_TOP_COND note. */
+
+ eh_regions = debug_blocks = 0;
+ for (etc_note = start_label; etc_note ; etc_note = NEXT_INSN (etc_note))
+ if (GET_CODE (etc_note) == NOTE)
+ {
+ if (NOTE_LINE_NUMBER (etc_note) == NOTE_INSN_LOOP_END_TOP_COND)
+ break;
- if (last_test_insn && num_insns > 30)
+ /* We must not walk into a nested loop. */
+ else if (NOTE_LINE_NUMBER (etc_note) == NOTE_INSN_LOOP_BEG)
+ {
+ etc_note = NULL_RTX;
break;
+ }
- if (eh_regions > 0)
- /* We don't want to move a partial EH region. Consider:
-
- while ( ( { try {
- if (cond ()) 0;
- else {
- bar();
- 1;
- }
- } catch (...) {
- 1;
- } )) {
- body;
- }
-
- This isn't legal C++, but here's what it's supposed to
- mean: if cond() is true, stop looping. Otherwise,
- call bar, and keep looping. In addition, if cond
- throws an exception, catch it and keep looping. Such
- constructs are certainy legal in LISP.
-
- We should not move the `if (cond()) 0' test since then
- the EH-region for the try-block would be broken up.
- (In this case we would the EH_BEG note for the `try'
- and `if cond()' but not the call to bar() or the
- EH_END note.)
-
- So we don't look for tests within an EH region. */
- continue;
-
- if (GET_CODE (insn) == JUMP_INSN
- && GET_CODE (PATTERN (insn)) == SET
- && SET_DEST (PATTERN (insn)) == pc_rtx)
- {
- /* This is indeed a jump. */
- rtx dest1 = NULL_RTX;
- rtx dest2 = NULL_RTX;
- rtx potential_last_test;
- if (GET_CODE (SET_SRC (PATTERN (insn))) == IF_THEN_ELSE)
- {
- /* A conditional jump. */
- dest1 = XEXP (SET_SRC (PATTERN (insn)), 1);
- dest2 = XEXP (SET_SRC (PATTERN (insn)), 2);
- potential_last_test = insn;
- }
- else
- {
- /* An unconditional jump. */
- dest1 = SET_SRC (PATTERN (insn));
- /* Include the BARRIER after the JUMP. */
- potential_last_test = NEXT_INSN (insn);
- }
-
- do {
- if (dest1 && GET_CODE (dest1) == LABEL_REF
- && ((XEXP (dest1, 0)
- == loop_stack->data.loop.alt_end_label)
- || (XEXP (dest1, 0)
- == loop_stack->data.loop.end_label)))
- {
- last_test_insn = potential_last_test;
- break;
- }
+ /* At the same time, scan for EH region notes, as we don't want
+ to scrog region nesting. This shouldn't happen, but... */
+ else if (NOTE_LINE_NUMBER (etc_note) == NOTE_INSN_EH_REGION_BEG)
+ eh_regions++;
+ else if (NOTE_LINE_NUMBER (etc_note) == NOTE_INSN_EH_REGION_END)
+ {
+ if (--eh_regions < 0)
+ /* We've come to the end of an EH region, but never saw the
+ beginning of that region. That means that an EH region
+ begins before the top of the loop, and ends in the middle
+ of it. The existence of such a situation violates a basic
+ assumption in this code, since that would imply that even
+ when EH_REGIONS is zero, we might move code out of an
+ exception region. */
+ abort ();
+ }
- /* If this was a conditional jump, there may be
- another label at which we should look. */
- dest1 = dest2;
- dest2 = NULL_RTX;
- } while (dest1);
- }
- }
+ /* Likewise for debug scopes. In this case we'll either (1) move
+ all of the notes if they are properly nested or (2) leave the
+ notes alone and only rotate the loop at high optimization
+ levels when we expect to scrog debug info. */
+ else if (NOTE_LINE_NUMBER (etc_note) == NOTE_INSN_BLOCK_BEG)
+ debug_blocks++;
+ else if (NOTE_LINE_NUMBER (etc_note) == NOTE_INSN_BLOCK_END)
+ debug_blocks--;
+ }
- if (last_test_insn != 0 && last_test_insn != get_last_insn ())
+ if (etc_note
+ && optimize
+ && eh_regions == 0
+ && (debug_blocks == 0 || optimize >= 2)
+ && NEXT_INSN (etc_note) != NULL_RTX
+ && ! any_condjump_p (get_last_insn ()))
+ {
+ /* We found one. Move everything from START to ETC to the end
+ of the loop, and add a jump from the top of the loop. */
+ rtx top_label = gen_label_rtx ();
+ rtx start_move = start_label;
+
+ /* If the start label is preceded by a NOTE_INSN_LOOP_CONT note,
+ then we want to move this note also. */
+ if (GET_CODE (PREV_INSN (start_move)) == NOTE
+ && NOTE_LINE_NUMBER (PREV_INSN (start_move)) == NOTE_INSN_LOOP_CONT)
+ start_move = PREV_INSN (start_move);
+
+ emit_label_before (top_label, start_move);
+
+ /* Actually move the insns. If the debug scopes are nested, we
+ can move everything at once. Otherwise we have to move them
+ one by one and squeeze out the block notes. */
+ if (debug_blocks == 0)
+ reorder_insns (start_move, etc_note, get_last_insn ());
+ else
{
- /* We found one. Move everything from there up
- to the end of the loop, and add a jump into the loop
- to jump to there. */
- register rtx newstart_label = gen_label_rtx ();
- register rtx start_move = start_label;
- rtx next_insn;
-
- /* If the start label is preceded by a NOTE_INSN_LOOP_CONT note,
- then we want to move this note also. */
- if (GET_CODE (PREV_INSN (start_move)) == NOTE
- && (NOTE_LINE_NUMBER (PREV_INSN (start_move))
- == NOTE_INSN_LOOP_CONT))
- start_move = PREV_INSN (start_move);
-
- emit_label_after (newstart_label, PREV_INSN (start_move));
-
- /* Actually move the insns. Start at the beginning, and
- keep copying insns until we've copied the
- last_test_insn. */
+ rtx insn, next_insn;
for (insn = start_move; insn; insn = next_insn)
{
/* Figure out which insn comes after this one. We have
to do this before we move INSN. */
- if (insn == last_test_insn)
- /* We've moved all the insns. */
- next_insn = NULL_RTX;
- else
- next_insn = NEXT_INSN (insn);
+ next_insn = (insn == etc_note ? NULL : NEXT_INSN (insn));
if (GET_CODE (insn) == NOTE
&& (NOTE_LINE_NUMBER (insn) == NOTE_INSN_BLOCK_BEG
|| NOTE_LINE_NUMBER (insn) == NOTE_INSN_BLOCK_END))
- /* We don't want to move NOTE_INSN_BLOCK_BEGs or
- NOTE_INSN_BLOCK_ENDs because the correct generation
- of debugging information depends on these appearing
- in the same order in the RTL and in the tree
- structure, where they are represented as BLOCKs.
- So, we don't move block notes. Of course, moving
- the code inside the block is likely to make it
- impossible to debug the instructions in the exit
- test, but such is the price of optimization. */
continue;
- /* Move the INSN. */
reorder_insns (insn, insn, get_last_insn ());
}
-
- emit_jump_insn_after (gen_jump (start_label),
- PREV_INSN (newstart_label));
- emit_barrier_after (PREV_INSN (newstart_label));
- start_label = newstart_label;
}
- }
- if (needs_end_jump)
- {
- emit_jump (start_label);
- emit_note (NULL_PTR, NOTE_INSN_LOOP_END);
+ /* Add the jump from the top of the loop. */
+ emit_jump_insn_before (gen_jump (start_label), top_label);
+ emit_barrier_before (top_label);
+ start_label = top_label;
}
+
+ emit_jump (start_label);
+ emit_note (NULL, NOTE_INSN_LOOP_END);
emit_label (loop_stack->data.loop.end_label);
POPSTACK (loop_stack);
@@ -2735,6 +2675,22 @@ expand_exit_loop_if_false (whichloop, cond)
return 1;
}
+/* Like expand_exit_loop_if_false except also emit a note marking
+ the end of the conditional. Should only be used immediately
+ after expand_loop_start. */
+
+int
+expand_exit_loop_top_cond (whichloop, cond)
+ struct nesting *whichloop;
+ tree cond;
+{
+ if (! expand_exit_loop_if_false (whichloop, cond))
+ return 0;
+
+ emit_note (NULL, NOTE_INSN_LOOP_END_TOP_COND);
+ return 1;
+}
+
/* Return nonzero if the loop nest is empty. Else return zero. */
int
@@ -2920,10 +2876,9 @@ expand_return (retval)
run destructors on variables that might be used in the subsequent
computation of the return value. */
rtx last_insn = 0;
- rtx result_rtl = DECL_RTL (DECL_RESULT (current_function_decl));
+ rtx result_rtl;
register rtx val = 0;
tree retval_rhs;
- int cleanups;
/* If function wants no value, give it none. */
if (TREE_CODE (TREE_TYPE (TREE_TYPE (current_function_decl))) == VOID_TYPE)
@@ -2934,19 +2889,13 @@ expand_return (retval)
return;
}
- /* Are any cleanups needed? E.g. C++ destructors to be run? */
- /* This is not sufficient. We also need to watch for cleanups of the
- expression we are about to expand. Unfortunately, we cannot know
- if it has cleanups until we expand it, and we want to change how we
- expand it depending upon if we need cleanups. We can't win. */
-#if 0
- cleanups = any_pending_cleanups (1);
-#else
- cleanups = 1;
-#endif
-
if (retval == error_mark_node)
- retval_rhs = NULL_TREE;
+ {
+ /* Treat this like a return of no value from a function that
+ returns a value. */
+ expand_null_return ();
+ return;
+ }
else if (TREE_CODE (retval) == RESULT_DECL)
retval_rhs = retval;
else if ((TREE_CODE (retval) == MODIFY_EXPR || TREE_CODE (retval) == INIT_EXPR)
@@ -2958,9 +2907,7 @@ expand_return (retval)
else
retval_rhs = NULL_TREE;
- /* Only use `last_insn' if there are cleanups which must be run. */
- if (cleanups || cleanup_label != 0)
- last_insn = get_last_insn ();
+ last_insn = get_last_insn ();
/* Distribute return down conditional expr if either of the sides
may involve tail recursion (see test below). This enhances the number
@@ -2995,6 +2942,8 @@ expand_return (retval)
return;
}
+ result_rtl = DECL_RTL (DECL_RESULT (current_function_decl));
+
/* If the result is an aggregate that is being returned in one (or more)
registers, load the registers here. The compiler currently can't handle
copying a BLKmode value into registers. We could put this code in a
@@ -3102,11 +3051,10 @@ expand_return (retval)
expand_value_return (result_reg);
}
- else if (cleanups
- && retval_rhs != 0
- && !VOID_TYPE_P (TREE_TYPE (retval_rhs))
- && (GET_CODE (result_rtl) == REG
- || (GET_CODE (result_rtl) == PARALLEL)))
+ else if (retval_rhs != 0
+ && !VOID_TYPE_P (TREE_TYPE (retval_rhs))
+ && (GET_CODE (result_rtl) == REG
+ || (GET_CODE (result_rtl) == PARALLEL)))
{
/* Calculate the return value into a temporary (usually a pseudo
reg). */
@@ -3389,28 +3337,6 @@ is_body_block (stmt)
return 0;
}
-/* Mark top block of block_stack as an implicit binding for an
- exception region. This is used to prevent infinite recursion when
- ending a binding with expand_end_bindings. It is only ever called
- by expand_eh_region_start, as that it the only way to create a
- block stack for a exception region. */
-
-void
-mark_block_as_eh_region ()
-{
- block_stack->data.block.exception_region = 1;
- if (block_stack->next
- && block_stack->next->data.block.conditional_code)
- {
- block_stack->data.block.conditional_code
- = block_stack->next->data.block.conditional_code;
- block_stack->data.block.last_unconditional_cleanup
- = block_stack->next->data.block.last_unconditional_cleanup;
- block_stack->data.block.cleanup_ptr
- = block_stack->next->data.block.cleanup_ptr;
- }
-}
-
/* True if we are currently emitting insns in an area of output code
that is controlled by a conditional expression. This is used by
the cleanup handling code to generate conditional cleanup actions. */
@@ -3421,29 +3347,6 @@ conditional_context ()
return block_stack && block_stack->data.block.conditional_code;
}
-/* Mark top block of block_stack as not for an implicit binding for an
- exception region. This is only ever done by expand_eh_region_end
- to let expand_end_bindings know that it is being called explicitly
- to end the binding layer for just the binding layer associated with
- the exception region, otherwise expand_end_bindings would try and
- end all implicit binding layers for exceptions regions, and then
- one normal binding layer. */
-
-void
-mark_block_as_not_eh_region ()
-{
- block_stack->data.block.exception_region = 0;
-}
-
-/* True if the top block of block_stack was marked as for an exception
- region by mark_block_as_eh_region. */
-
-int
-is_eh_region ()
-{
- return cfun && block_stack && block_stack->data.block.exception_region;
-}
-
/* Emit a handler label for a nonlocal goto handler.
Also emit code to store the handler label in SLOT before BEFORE_INSN. */
@@ -3646,26 +3549,7 @@ expand_end_bindings (vars, mark_ends, dont_jump_in)
int mark_ends;
int dont_jump_in;
{
- register struct nesting *thisblock;
-
- while (block_stack->data.block.exception_region)
- {
- /* Because we don't need or want a new temporary level and
- because we didn't create one in expand_eh_region_start,
- create a fake one now to avoid removing one in
- expand_end_bindings. */
- push_temp_slots ();
-
- block_stack->data.block.exception_region = 0;
-
- expand_end_bindings (NULL_TREE, 0, 0);
- }
-
- /* Since expand_eh_region_start does an expand_start_bindings, we
- have to first end all the bindings that were created by
- expand_eh_region_start. */
-
- thisblock = block_stack;
+ register struct nesting *thisblock = block_stack;
/* If any of the variables in this scope were not used, warn the
user. */
@@ -3833,18 +3717,18 @@ expand_decl (decl)
/* Create the RTL representation for the variable. */
if (type == error_mark_node)
- DECL_RTL (decl) = gen_rtx_MEM (BLKmode, const0_rtx);
+ SET_DECL_RTL (decl, gen_rtx_MEM (BLKmode, const0_rtx));
else if (DECL_SIZE (decl) == 0)
/* Variable with incomplete type. */
{
if (DECL_INITIAL (decl) == 0)
/* Error message was already done; now avoid a crash. */
- DECL_RTL (decl) = gen_rtx_MEM (BLKmode, const0_rtx);
+ SET_DECL_RTL (decl, gen_rtx_MEM (BLKmode, const0_rtx));
else
/* An initializer is going to decide the size of this array.
Until we know the size, represent its address with a reg. */
- DECL_RTL (decl) = gen_rtx_MEM (BLKmode, gen_reg_rtx (Pmode));
+ SET_DECL_RTL (decl, gen_rtx_MEM (BLKmode, gen_reg_rtx (Pmode)));
set_mem_attributes (DECL_RTL (decl), decl, 1);
}
@@ -3863,7 +3747,7 @@ expand_decl (decl)
enum machine_mode reg_mode
= promote_mode (type, DECL_MODE (decl), &unsignedp, 0);
- DECL_RTL (decl) = gen_reg_rtx (reg_mode);
+ SET_DECL_RTL (decl, gen_reg_rtx (reg_mode));
mark_user_reg (DECL_RTL (decl));
if (POINTER_TYPE_P (type))
@@ -3890,7 +3774,7 @@ expand_decl (decl)
whose size was determined by the initializer.
The old address was a register; set that register now
to the proper address. */
- if (DECL_RTL (decl) != 0)
+ if (DECL_RTL_SET_P (decl))
{
if (GET_CODE (DECL_RTL (decl)) != MEM
|| GET_CODE (XEXP (DECL_RTL (decl), 0)) != REG)
@@ -3898,7 +3782,8 @@ expand_decl (decl)
oldaddr = XEXP (DECL_RTL (decl), 0);
}
- DECL_RTL (decl) = assign_temp (TREE_TYPE (decl), 1, 1, 1);
+ SET_DECL_RTL (decl,
+ assign_temp (TREE_TYPE (decl), 1, 1, 1));
/* Set alignment we actually gave this decl. */
DECL_ALIGN (decl) = (DECL_MODE (decl) == BLKmode ? BIGGEST_ALIGNMENT
@@ -3940,7 +3825,7 @@ expand_decl (decl)
TYPE_ALIGN (TREE_TYPE (decl)));
/* Reference the variable indirect through that rtx. */
- DECL_RTL (decl) = gen_rtx_MEM (DECL_MODE (decl), address);
+ SET_DECL_RTL (decl, gen_rtx_MEM (DECL_MODE (decl), address));
set_mem_attributes (DECL_RTL (decl), decl, 1);
@@ -4056,7 +3941,7 @@ expand_decl_cleanup (decl, cleanup)
emit_move_insn (flag, const1_rtx);
cond = build_decl (VAR_DECL, NULL_TREE, type_for_mode (word_mode, 1));
- DECL_RTL (cond) = flag;
+ SET_DECL_RTL (cond, flag);
/* Conditionalize the cleanup. */
cleanup = build (COND_EXPR, void_type_node,
@@ -4080,14 +3965,10 @@ expand_decl_cleanup (decl, cleanup)
start_sequence ();
}
- /* If this was optimized so that there is no exception region for the
- cleanup, then mark the TREE_LIST node, so that we can later tell
- if we need to call expand_eh_region_end. */
- if (! using_eh_for_cleanups_p
- || expand_eh_region_start_tree (decl, cleanup))
+ if (! using_eh_for_cleanups_p)
TREE_ADDRESSABLE (t) = 1;
- /* If that started a new EH region, we're in a new block. */
- thisblock = block_stack;
+ else
+ expand_eh_region_start ();
if (cond_context)
{
@@ -4114,101 +3995,6 @@ expand_decl_cleanup (decl, cleanup)
}
return 1;
}
-
-/* Like expand_decl_cleanup, but suppress generating an exception handler
- to perform the cleanup. */
-
-#if 0
-int
-expand_decl_cleanup_no_eh (decl, cleanup)
- tree decl, cleanup;
-{
- int save_eh = using_eh_for_cleanups_p;
- int result;
-
- using_eh_for_cleanups_p = 0;
- result = expand_decl_cleanup (decl, cleanup);
- using_eh_for_cleanups_p = save_eh;
-
- return result;
-}
-#endif
-
-/* Arrange for the top element of the dynamic cleanup chain to be
- popped if we exit the current binding contour. DECL is the
- associated declaration, if any, otherwise NULL_TREE. If the
- current contour is left via an exception, then __sjthrow will pop
- the top element off the dynamic cleanup chain. The code that
- avoids doing the action we push into the cleanup chain in the
- exceptional case is contained in expand_cleanups.
-
- This routine is only used by expand_eh_region_start, and that is
- the only way in which an exception region should be started. This
- routine is only used when using the setjmp/longjmp codegen method
- for exception handling. */
-
-int
-expand_dcc_cleanup (decl)
- tree decl;
-{
- struct nesting *thisblock;
- tree cleanup;
-
- /* Error if we are not in any block. */
- if (cfun == 0 || block_stack == 0)
- return 0;
- thisblock = block_stack;
-
- /* Record the cleanup for the dynamic handler chain. */
-
- cleanup = make_node (POPDCC_EXPR);
-
- /* Add the cleanup in a manner similar to expand_decl_cleanup. */
- thisblock->data.block.cleanups
- = tree_cons (decl, cleanup, thisblock->data.block.cleanups);
-
- /* If this block has a cleanup, it belongs in stack_block_stack. */
- stack_block_stack = thisblock;
- return 1;
-}
-
-/* Arrange for the top element of the dynamic handler chain to be
- popped if we exit the current binding contour. DECL is the
- associated declaration, if any, otherwise NULL_TREE. If the current
- contour is left via an exception, then __sjthrow will pop the top
- element off the dynamic handler chain. The code that avoids doing
- the action we push into the handler chain in the exceptional case
- is contained in expand_cleanups.
-
- This routine is only used by expand_eh_region_start, and that is
- the only way in which an exception region should be started. This
- routine is only used when using the setjmp/longjmp codegen method
- for exception handling. */
-
-int
-expand_dhc_cleanup (decl)
- tree decl;
-{
- struct nesting *thisblock;
- tree cleanup;
-
- /* Error if we are not in any block. */
- if (cfun == 0 || block_stack == 0)
- return 0;
- thisblock = block_stack;
-
- /* Record the cleanup for the dynamic handler chain. */
-
- cleanup = make_node (POPDHC_EXPR);
-
- /* Add the cleanup in a manner similar to expand_decl_cleanup. */
- thisblock->data.block.cleanups
- = tree_cons (decl, cleanup, thisblock->data.block.cleanups);
-
- /* If this block has a cleanup, it belongs in stack_block_stack. */
- stack_block_stack = thisblock;
- return 1;
-}
/* DECL is an anonymous union. CLEANUP is a cleanup for DECL.
DECL_ELTS is the list of elements that belong to DECL's type.
@@ -4257,19 +4043,20 @@ expand_anon_union_decl (decl, cleanup, decl_elts)
if (GET_CODE (x) == MEM)
{
if (mode == GET_MODE (x))
- DECL_RTL (decl_elt) = x;
+ SET_DECL_RTL (decl_elt, x);
else
{
- DECL_RTL (decl_elt) = gen_rtx_MEM (mode, copy_rtx (XEXP (x, 0)));
+ SET_DECL_RTL (decl_elt,
+ gen_rtx_MEM (mode, copy_rtx (XEXP (x, 0))));
MEM_COPY_ATTRIBUTES (DECL_RTL (decl_elt), x);
}
}
else if (GET_CODE (x) == REG)
{
if (mode == GET_MODE (x))
- DECL_RTL (decl_elt) = x;
+ SET_DECL_RTL (decl_elt, x);
else
- DECL_RTL (decl_elt) = gen_rtx_SUBREG (mode, x, 0);
+ SET_DECL_RTL (decl_elt, gen_rtx_SUBREG (mode, x, 0));
}
else
abort ();
@@ -4312,20 +4099,8 @@ expand_cleanups (list, dont_do, in_fixup, reachable)
expand_cleanups (TREE_VALUE (tail), dont_do, in_fixup, reachable);
else
{
- if (! in_fixup)
- {
- tree cleanup = TREE_VALUE (tail);
-
- /* See expand_d{h,c}c_cleanup for why we avoid this. */
- if (TREE_CODE (cleanup) != POPDHC_EXPR
- && TREE_CODE (cleanup) != POPDCC_EXPR
- /* See expand_eh_region_start_tree for this case. */
- && ! TREE_ADDRESSABLE (tail))
- {
- cleanup = protect_with_terminate (cleanup);
- expand_eh_region_end (cleanup);
- }
- }
+ if (! in_fixup && using_eh_for_cleanups_p)
+ expand_eh_region_end_cleanup (TREE_VALUE (tail));
if (reachable)
{
@@ -4338,19 +4113,18 @@ expand_cleanups (list, dont_do, in_fixup, reachable)
times, the control paths are non-overlapping so the
cleanups will not be executed twice. */
- /* We may need to protect fixups with rethrow regions. */
- int protect = (in_fixup && ! TREE_ADDRESSABLE (tail));
+ /* We may need to protect from outer cleanups. */
+ if (in_fixup && using_eh_for_cleanups_p)
+ {
+ expand_eh_region_start ();
+
+ expand_expr (TREE_VALUE (tail), const0_rtx, VOIDmode, 0);
- if (protect)
- expand_fixup_region_start ();
+ expand_eh_region_end_fixup (TREE_VALUE (tail));
+ }
+ else
+ expand_expr (TREE_VALUE (tail), const0_rtx, VOIDmode, 0);
- /* The cleanup might contain try-blocks, so we have to
- preserve our current queue. */
- push_ehqueue ();
- expand_expr (TREE_VALUE (tail), const0_rtx, VOIDmode, 0);
- pop_ehqueue ();
- if (protect)
- expand_fixup_region_end (TREE_VALUE (tail));
free_temp_slots ();
}
}
diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c
index 7bb5b4a2636..ba365808fee 100644
--- a/gcc/stor-layout.c
+++ b/gcc/stor-layout.c
@@ -613,6 +613,10 @@ place_union_field (rli, field)
MIN (desired_align, (unsigned) BIGGEST_FIELD_ALIGNMENT);
#endif
+#ifdef ADJUST_FIELD_ALIGN
+ desired_align = ADJUST_FIELD_ALIGN (field, desired_align);
+#endif
+
/* Union must be at least as aligned as any field requires. */
rli->record_align = MAX (rli->record_align, desired_align);
@@ -1408,6 +1412,7 @@ layout_type (type)
#else
TYPE_ALIGN (type) = MAX (TYPE_ALIGN (element), BITS_PER_UNIT);
#endif
+ TYPE_USER_ALIGN (type) = TYPE_USER_ALIGN (element);
#ifdef ROUND_TYPE_SIZE
if (TYPE_SIZE (type) != 0)
diff --git a/gcc/stringpool.c b/gcc/stringpool.c
index ceb454d9221..2b4fefa9525 100644
--- a/gcc/stringpool.c
+++ b/gcc/stringpool.c
@@ -1,5 +1,5 @@
/* String pool for GCC.
- Copyright (C) 2000 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2001 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -340,6 +340,25 @@ maybe_get_identifier (text)
return NULL_TREE;
}
+/* Look up an identifier with the name TEXT, replace its identifier
+ node with NODE, and return the old identifier node. This is used
+ by languages which need to enable and disable keywords based on
+ context; e.g. see remember_protocol_qualifiers in objc/objc-act.c. */
+tree
+set_identifier (text, node)
+ const char *text;
+ tree node;
+{
+ struct str_header *str;
+ tree old;
+ size_t length = strlen (text);
+
+ str = alloc_string (text, length, INSERT);
+ old = str->data; /* might be null */
+ str->data = node;
+ return old;
+}
+
/* Report some basic statistics about the string pool. */
void
diff --git a/gcc/sys-protos.h b/gcc/sys-protos.h
index b676ea27f53..3f06f274e15 100644
--- a/gcc/sys-protos.h
+++ b/gcc/sys-protos.h
@@ -16,7 +16,6 @@ extern int __aread(int, int, char *, uint, ecb_t *);
extern void __assert(const char *, const char *, int);
extern int __asyncio(int, aioop_t *, int);
extern int __awrite(int, int, char *, uint, ecb_t *);
-extern void __eprintf(const char *);
extern int __evcntl(evver_t, evcntlcmds_t, long int, long int);
extern int __evexit(evver_t, idtype_t, id_t, const ecb_t *);
extern int __evexitset(evver_t, const procset_t *, hostid_t, const ecb_t *);
diff --git a/gcc/system.h b/gcc/system.h
index ace7177047b..0ee1510aae0 100644
--- a/gcc/system.h
+++ b/gcc/system.h
@@ -43,6 +43,10 @@ Boston, MA 02111-1307, USA. */
# endif
#endif
+#ifdef HAVE_STDDEF_H
+# include <stddef.h>
+#endif
+
#include <stdio.h>
/* Define a generic NULL if one hasn't already been defined. */
@@ -355,6 +359,14 @@ extern void abort PARAMS ((void));
((GCC_VERSION >= 2007) || (__STDC_VERSION__ >= 199901L))
#endif
+/* 1 if we have _Bool. */
+#ifndef HAVE__BOOL
+# define HAVE__BOOL \
+ ((GCC_VERSION >= 3000) || (__STDC_VERSION__ >= 199901L))
+#endif
+
+
+
/* Define a STRINGIFY macro that's right for ANSI or traditional C.
Note: if the argument passed to STRINGIFY is itself a macro, eg
#define foo bar, STRINGIFY(foo) will produce "foo", not "bar".
@@ -533,4 +545,27 @@ extern void *alloca (__SIZE_TYPE__);
#endif /* ! __FUNCTION__ */
#endif
+/* Provide some sort of boolean type. We use stdbool.h if it's
+ available. This is dead last because various system headers might
+ mess us up. */
+#undef bool
+#undef true
+#undef false
+#undef TRUE
+#undef FALSE
+
+#ifdef HAVE_STDBOOL_H
+# include <stdbool.h>
+#else
+# if !HAVE__BOOL
+typedef char _Bool;
+# endif
+# define bool _Bool
+# define true 1
+# define false 0
+#endif
+
+#define TRUE true
+#define FALSE false
+
#endif /* __GCC_SYSTEM_H__ */
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index c8832787c32..b0d56f2aa70 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,981 @@
+2002-02-20 Release Manager
+
+ * GCC 3.0.4 Released.
+
+2002-02-20 Release Manager
+
+ * GCC 3.0.4 Released.
+
+2002-02-13 Richard Smith <richard@ex-parrot.com>
+
+ * g++.old-deja/g++.other/thunk1.C: New test.
+
+2002-01-31 Bob Wilson <bob.wilson@acm.org>
+
+ * gcc.c-torture/compile/20001226-1.x: xfail for Xtensa.
+
+2002-01-21 Zack Weinberg <zack@codesourcery.com>
+
+ * g77.f-torture/compile/cpp2.F: New test.
+
+2001-12-20 Release Manager
+
+ * GCC 3.0.3 Released.
+
+2001-12-11 Neil Booth <neil@daikokuya.demon.co.uk>
+
+ * gcc.dg/concat.c: New test.
+
+2001-12-06 Richard Henderson <rth@redhat.com>
+
+ * gcc.c-torture/compile/20011205-1.c: New test.
+
+2001-11-30 Jakub Jelinek <jakub@redhat.com>
+
+ * gcc.c-torture/compile/20011109-1.c: New test.
+
+2001-11-29 Mark Mitchell <mark@codesourcery.com>
+
+ * g++.old-deja/g++.pt/memtemp100.C: Remove non-standard
+ constructs.
+
+2001-11-24 Neil Booth <neil@daikokuya.demon.co.uk>
+
+ * gcc.dg/cpp/redef2.c: Update.
+
+2001-10-30 Jakub Jelinek <jakub@redhat.com>
+
+ * gcc.c-torture/compile/20011029-1.c: New test.
+
+2001-10-23 Release Manager
+
+ * GCC 3.0.2 Released.
+
+2001-10-10 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
+
+ * gcc.c-torture/compile/20011010-1.c: New.
+
+2001-10-08 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
+
+ * gcc.c-torture/execute/20011008-3.c: New.
+
+2001-09-21 Richard Henderson <rth@redhat.com>
+
+ * g++.old-deja/g++.abi/ptrmem.C: Update for ia64 c++ abi.
+ * g++.old-deja/g++.abi/vtable2.C: Likewise.
+
+2001-09-12 Jakub Jelinek <jakub@redhat.com>
+
+ * gcc.c-torture/execute/20010403-1.c: New test.
+ * gcc.dg/20010912-1.c: New test.
+
+2001-09-06 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/3986
+ * g++.old-deja/g++.abi/vbase9.C: New test.
+
+2001-09-05 Jakub Jelinek <jakub@redhat.com>
+
+ * gcc.c-torture/compile/20010903-1.c: New test.
+ * gcc.c-torture/execute/20010904-1.c: New test.
+ * gcc.c-torture/execute/20010904-2.c: New test.
+
+2001-09-04 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/4203
+ * g++.old-deja/g++.other/empty1.C: XFAIL. See PR c++/4222
+ * g++.old-deja/g++.other/empty3.C: New test.
+
+2001-08-29 Kazu Hirata <kazu@hxi.com>
+
+ * gcc.c-torture/compile/981006-1.x: Do not use -fpic on h8300.
+
+2001-08-23 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ * g++.dg/unify1.C: New test.
+
+2001-08-19 Release Manager
+
+ * GCC 3.0.1 Released.
+
+2001-08-19 Release Manager
+
+ * GCC 3.0.1 Released.
+
+2001-08-07 Nathan Sidwell <nathan@codesourcery.com>
+
+ * g++.old-deja/g++.abi/empty4.C: New test.
+
+2001-08-06 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
+
+ * gcc.c-torture/compile/20010408-1.c: New test.
+ * gcc.c-torture/execute/ieee/ieee.exp: Only use -ffloat-store on
+ i[34567]86-*-*.
+ Delete handling of ieee_multilib_flags.
+ Pass -mieee for alpha*-*-* and sh-*-*.
+ * gcc.c-torture/execute/20010114-2.c: Move into ieee subdir.
+ * gcc.c-torture/execute/20010114-2.x: Remove.
+
+2001-08-03 Zack Weinberg <zackw@stanford.edu>
+
+ * gcc.dg/bconstp-1.c: New test.
+
+2001-08-02 Nathan Sidwell <nathan@codesourcery.com>
+
+ Remove -fhonor-std.
+ * g++.old-deja/g++.ns/ns14.C: Remove special options.
+ * g++.old-deja/g++.other/std1.C: Likewise.
+ * g++.old-deja/g++.robertl/eb133.C: Likewise. Add using directive.
+
+2001-07-31 Nathan Sidwell <nathan@codesourcery.com>
+
+ * g++.old-deja/g++.abi/vthunk1.C: New test.
+
+2001-07-31 Nathan Sidwell <nathan@codesourcery.com>
+
+ * g++.old-deja/g++.abi/vbase8-22.C: New test.
+
+2001-07-30 Janis Johnson <janis@us.ibm.com>
+
+ * gcc.misc-tests/gcov-3.c: New test.
+
+2001-07-27 Peter Schmid <schmid@snake.iap.physik.tu-darmstadt.de>
+
+ Copied from mainline by ljrittle (to go along with 2001-07-26
+ libstdc++-v3 header staging configuration patch).
+ * g++.old-deja/g++.robertl/eb130.C: Include the correct header file.
+
+2001-07-27 Nathan Sidwell <nathan@codesourcery.com>
+
+ * g++.old-deja/g++.abi/vbase8-21.C: New test.
+
+2001-07-27 Nathan Sidwell <nathan@codesourcery.com>
+
+ * g++.old-deja/g++.abi/vbase8-10.C: New test.
+
+2001-07-27 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * lib/g++.exp (g++_set_ld_library_path): Renamed to
+ ${tool}_set_ld_library_path.
+ Changed caller.
+ * lib/objc.exp (${tool}_set_ld_library_path): New, copied from
+ g++.exp.
+
+2001-07-26 Nathan Sidwell <nathan@codesourcery.com>
+
+ * g++.old-deja/g++.other/lineno5.C: New test.
+
+2001-07-26 Nathan Sidwell <nathan@codesourcery.com>
+
+ * g++.old-deja/g++.pt/crash68.C: New test.
+
+2001-07-26 Nathan Sidwell <nathan@codesourcery.com>
+
+ * g++.old-deja/g++.other/crash42.C: New test.
+
+2001-07-25 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * gcc.c-torture/execute/20010724-1.c: New file.
+ * gcc.c-torture/execute/20010724-1.x: New file.
+
+2001-07-25 Nathan Sidwell <nathan@codesourcery.com>
+
+ * g++.old-deja/g++.other/cond7.C: New test.
+
+2001-07-25 Jason Merrill <jason_merrill@redhat.com>
+
+ Copied from mainline.
+ * g++.old-deja/g++.mike/p2846.C: Check correct copy ctor called.
+
+2001-07-25 Nathan Sidwell <nathan@codesourcery.com>
+
+ * g++.old-deja/g++.other/optimize4.C: New test.
+
+2001-07-25 Nathan Sidwell <nathan@codesourcery.com>
+
+ * g++.old-deja/g++.abi/vbase8-5.C: New test.
+
+2001-07-19 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * g++.old-deja/g++.pt/static3.C: Removed alpha*-*-osf* XFAIL.
+ g++.old-deja/g++.pt/static6.C: Likewise.
+ * lib/target-supports.exp (check_weak_available): alpha*-*-osf*
+ supports weak symbols.
+
+2001-07-16 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * gcc.c-torture/execute/20001229-1.c: Include <sys/proc.h> for
+ UAC_SIGBUS, UAC_NOPRINT definitions.
+
+Mon Jul 16 12:21:56 2001 Nicola Pero <n.pero@mi.flashnet.it>
+
+ * objc/execute/object_is_class.m: New test.
+ * objc/execute/object_is_meta_class.m: New test.
+
+2000-09-10 Michael Chamberlain <michael@chamberlain.net.au>
+
+ * gcc.misc-tests/mg.exp (compiler_output): Support tcl 8.3.1.
+
+2001-06-29 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * lib/objc.exp (objc_target_compile): Declare rootme. Append to
+ ld_library_path.
+
+2001-06-28 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * lib/objc.exp (objc_target_compile): Don't need -lposix4 on any
+ Solaris 2.[678] system.
+
+2001-06-22 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * gcc.dg/20010622-1.c: New test.
+
+20010617 Release Manager
+
+ * GCC 3.0 Released.
+
+2001-06-14 Nathan Sidwell <nathan@codesourcery.com>
+
+ * g++.old-deja/g++.abi/vbase8-9.C: New test.
+
+2001-06-12 Richard Henderson <rth@redhat.com>
+
+ * g++.old-deja/g++.other/crash27.C: Don't XFAIL.
+
+2001-06-12 Nathan Sidwell <nathan@codesourcery.com>
+
+ * g++.old-deja/g++.abi/vbase5.C: New test.
+ * g++.old-deja/g++.abi/vbase6.C: New test.
+ * g++.old-deja/g++.abi/vbase7.C: New test.
+
+2001-06-12 Bernd Schmidt <bernds@redhat.com>
+
+ * g++.old-deja/g++.other/stepanov_v1p2.C: Remove.
+
+2001-06-12 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * gcc.c-torture/compile/20010610-1.c: New test.
+
+2001-06-12 Nathan Sidwell <nathan@codesourcery.com>
+
+ * g++.old-deja/g++.abi/vbase4.C: New test.
+
+2001-06-11 Stephane Carrez <Stephane.Carrez@worldnet.fr>
+
+ * gcc.c-torture/execute/920501-8.x: New file, sprintf() does not
+ support %f for HC11/HC12 targets.
+ * gcc.c-torture/execute/930513-1.x: New file, likewise.
+ * gcc.c-torture/execute/980709-1.x: New file, pow() is not available
+ on HC11/HC12 targets.
+ * gcc.c-torture/execute/990826-0.x: New file, likewise for floor().
+
+2001-06-11 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * gcc.dg/wchar_t-1.c: New file.
+ * gcc.dg/wint_t-1.c: Likewise.
+
+2001-06-11 Richard Henderson <rth@redhat.com>
+
+ * g++.old-deja/g++.law/code-gen5.C: Don't send raw pointers to assert.
+
+2001-06-11 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * gcc.c-torture/compile/20010611-1.c: New test.
+
+2001-06-10 Alexandre Oliva <aoliva@redhat.com>
+
+ * g++.old-deja/g++.abi/ptrmem.C: Take into account different
+ representation on MN10300 and ARM/Thumb.
+
+2001-06-09 David Billinghurst <David.Billinghurst@riotinto.com>
+
+ * g++.dg/mangle1.C: Change regex to allow USER_LABEL_PREFIX == "_"
+ names.
+
+2001-06-09 Toon Moene <toon@moene.indiv.nluug.nl>
+
+ * g77.f-torture/compile/20000629-1.x: Remove; fixed.
+
+2001-06-09 Ovidiu Predescu <ovidiu@cup.hp.com>
+
+ * objc/execute/load-3.m: Added. Check sending +load to categories,
+ in addition to classes.
+
+2001-06-08 Stan Shebs <shebs@apple.com>
+
+ * objc/execute/load-2.m: New test. From Nicola Pero
+ <n.pero@mi.flashnet.it>.
+
+2001-06-08 Jakub Jelinek <jakub@redhat.com>
+
+ * gcc.c-torture/execute/20010605-2.c: New test.
+
+2001-06-08 Jakub Jelinek <jakub@redhat.com>
+
+ * g++.old-deja/g++.other/overload14.C: New test.
+
+2001-06-08 Jakub Jelinek <jakub@redhat.com>
+
+ * g++.old-deja/g++.other/lookup23.C: New test.
+
+2001-06-08 Jakub Jelinek <jakub@redhat.com>
+
+ * gcc.dg/cpp/tr-define.c: New test.
+
+2001-06-08 Jakub Jelinek <jakub@redhat.com>
+
+ * g++.old-deja/g++.eh/catch13.C: New test.
+ * g++.old-deja/g++.eh/catch14.C: New test.
+
+2001-06-08 Nathan Sidwell <nathan@codesourcery.com>
+
+ * g++.old-deja/g++.abi/vbase2.C: New test.
+ * g++.old-deja/g++.abi/vbase3.C: New test.
+
+2001-06-08 Nathan Sidwell <nathan@codesourcery.com>
+
+ * g++.old-deja/g++.pt/friend49.C: New test.
+
+2001-06-07 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * lib/objc.exp (objc_target_compile): Use -lposix4 on
+ sparcv9-sun-solaris2.[678] too.
+
+ * gcc.dg/c99-float-1.c (FLT_EVAL_METHOD, DECIMAL_DIG): xfail on
+ sparcv9-solaris-2.8 too.
+
+2001-06-07 Nathan Sidwell <nathan@codesourcery.com>
+
+ * g++.old-deja/g++.ext/anon3.C: New test.
+
+2001-06-05 Nathan Sidwell <nathan@codesourcery.com>
+
+ * g++.old-deja/g++.other/conv7.C: New test.
+
+2001-06-04 Loren J. Rittle <ljrittle@acm.org>
+
+ * gcc.c-torture/execute/ieee/rbug.x: XFAIL FreeBSD 5.x.
+
+2001-06-04 John David Anglin <dave@hiauly1.hia.nrc.ca>
+
+ * gcc.c-torture/execute/20010604-1.c: New test.
+
+2001-06-04 Jeffrey Oldham <oldham@codesourcery.com>
+
+ * lib/g++.exp (g++_include_flags): Change `args' to gccpath's value.
+ (g++_link_flags): Likewise.
+ (g++_init): Pass gccpath's value to two previous functions.
+
+2001-06-02 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * gcc.misc-tests/linkage.exp: Use wildcards when matching N32.
+ Ensure logfile entry matches exec command line.
+
+2001-05-31 Richard Henderson <rth@redhat.com>
+
+ * gcc.c-torture/execute/loop-2b.x: Tighten XFAIL to match
+ observed failures.
+
+ * gcc.c-torture/execute/memcheck/blkarg.x: Disable the test.
+ * g++.old-deja/g++.oliva/delete3.C: Pass.
+ * g++.dg/mangle1.C: Tweek expected mangling for 64-bit hosts.
+
+2001-05-30 David.Billinghurst <David.Billinghurst@riotinto.com>
+
+ * gcc.misc-tests/linkage.exp: Pass appropriate flags to native
+ compiler for irix6.2
+
+2001-05-30 Nathan Sidwell <nathan@codesourcery.com>
+
+ * g++.old-deja/g++.other/optimize3.C: New file.
+
+2001-05-26 Nathan Sidwell <nathan@codesourcery.com>
+
+ * g++.old-deja/g++.other/optimize2.C: New file.
+
+2001-05-24 Mark Mitchell <mark@codesourcery.com>
+
+ G++ no longer defines builtins that do not begin with __builtin.
+ * g++.old-deja/g++.abi/bitfields.C: Update accordingly.
+ * g++.old-deja/g++.brendand/misc13.C: Likewise.
+ * g++.old-deja/g++.law/builtin1.C: Likewise.
+ * g++.old-deja/g++.law/cvt2.C: Likewise.
+ * g++.old-deja/g++.mike/net5.C: Likewise.
+ * g++.old-deja/g++.other/builtins1.C: Likewise.
+ * g++.old-deja/g++.other/builtins2.C: Likewise.
+ * g++.old-deja/g++.other/builtins3.C: Likewise.
+ * g++.old-deja/g++.other/builtins4.C: Likewise.
+ * g++.old-deja/g++.other/inline8.C: Likewise.
+ * g++.old-deja/g++.robertl/eb39.C: Likewise.
+
+2001-05-24 Nathan Sidwell <nathan@codesourcery.com>
+
+ * g++.old-deja/g++.pt/using1.C: Adjust.
+ * g++.old-deja/g++.pt/using2.C: New test.
+
+2001-05-23 David.Billinghurst <David.Billinghurst@riotinto.com>
+
+ * gcc.misc-tests/linkage.exp: Pass appropriate flags to
+ native compiler for irix6.5.
+
+Wed May 23 2001 Jeffrey D. Oldham <oldham@codesourcery.com>
+
+ * lib/g++.exp (g++_include_flags): Use args to compute
+ get_multilibs.
+ (g++_link_flags): Likewise.
+ (g++_init): Pass TOOL_OPTIONS as arguments to two above functions.
+
+2001-05-22 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * gcc.dg/c90-hexfloat-1.c: Add more tests.
+
+2001-05-21 Stephane Carrez <Stephane.Carrez@worldnet.fr>
+
+ * gcc.c-torture/unsorted/msp.c (A_SIZE): Define according to
+ STACK_SIZE;
+ * gcc.c-torture/compile/991214-2.c (HISTO_SIZE): Define according
+ to STACK_SIZE; Use it to define size of add_histo array.
+ * gcc.c-torture/compile/920723-1.c (GITT_SIZE): Define according
+ to STACK_SIZE.
+ (f): Use GITT_SIZE to define size of gitt local table.
+ * gcc.c-torture/compile/930621-1.c (BYTEMEM_SIZE): Define according
+ to STACK_SIZE; Use it to define size of bytemem array.
+
+2001-05-21 Stephane Carrez <Stephane.Carrez@worldnet.fr>
+
+ * gcc.c-torture/compile/20000804-1.x: New file, this test fails
+ on 68HC11/HC12 due to the asm instruction.
+ * gcc.c-torture/compile/20001205-1.x: New file, ditto.
+ * gcc.c-torture/compile/920520-1.x: Likewise.
+ * gcc.c-torture/compile/20001226-1.x: New file, this test fails
+ on 68HC11/HC12 because the function is larger than 64K.
+ * gcc.c-torture/compile/961203-1.x: New file, this test fails
+ on 68HC11/HC12 because the structure is too large.
+
+2001-05-20 Nathan Sidwell <nathan@codesourcery.com>
+
+ * g++.old-deja/g++.other/optimize1.C: New test.
+
+Fri May 18 14:26:28 2001 Jeffrey A Law (law@cygnus.com)
+
+ * g++.old-deja/g++.ext/attrib5.C: XFAIL for hpux.
+ * g++.old-deja/g++.mike/eh33.C: No longer XFAIL for the PA.
+ * g++.old-deja/g++.mike/eh50.C: No longer XFAIL for the PA.
+
+2001-05-17 Mark Mitchell <mark@codesourcery.com>
+
+ * objc/execute/formal_protocol-6.cexp: XFAIL it.
+
+2001-05-16 Nathan Sidwell <nathan@codesourcery.com>
+
+ * g++.old-deja/g++.other/crash41.C: New test.
+
+2001-05-15 Mark Mitchell (admin) <mitchell@nunki.dbai.tuwien.ac.at>
+
+ * gcc.dg/ultrasp2.c: Don't run it with -m64 on sparc-*-*.
+
+2001-05-14 Mark Mitchell <mark@codesourcery.com>
+
+ * gcc.dg/c99-float-1.c: XFAIL portions on Solaris.
+
+Mon May 14 20:26:20 2001 Mark P Mitchell <mark@codesourcery.com>
+
+ * gcc.c-torture/execute/20010122-1.x: XFAIL on MIPS.
+
+2001-05-13 Benjamin Kosnik <bkoz@redhat.com>
+
+ * lib/g++.exp: Use testsuite_flags.
+
+2001-05-14 Mark Mitchell <mark@codesourcery.com>
+
+ * lib/objc.exp: Add -lposix4 on Solaris 2.6 and Solaris 2.7.
+
+2001-05-13 Mark Mitchell <mark@codesourcery.com>
+
+ * gcc.c-torture/execute/ieee/rbug.x: XFAIL FreeBSD 4.x.
+
+ * g++.old-deja/g++.abi/cxa_vec.C: Use <stdlib.h> instead
+ of <malloc.h>.
+
+2001-05-12 Richard Henderson <rth@redhat.com>
+
+ * g++.old-deja/g++.eh/crash3.C: Don't use -fsjlj-exceptions.
+ * g++.old-deja/g++.eh/vbase3.C: Likewise.
+
+2001-05-11 Mark Mitchell <mark@codesourcery.com>
+
+ * gcc.dg/sequence-pt-1.c: XFAIL warning on line 59.
+
+ * lib/objc.exp: Add -lposix4 on Solaris 2.8.
+
+2001-05-11 John David Anglin <dave@hiauly1.hia.nrc.ca>
+
+ * gcc.c-torture/execute/ieee/ieee.exp: Don't run ieee tests on VAX.
+
+2001-05-09 Zack Weinberg <zackw@stanford.edu>
+
+ * gcc.dg/cpp/direct2.c: New test.
+ * gcc.dg/cpp/direct2s.c: New test.
+
+ * gcc.c-torture/execute/920730-1t.c: #undef __GNUC__ at head.
+
+2001-05-07 Mark Mitchell <mark@codesourcery.com>
+
+ * g++.old-deja/g++.other/op2.C: Don't use `glob' as a variable.
+ * g++.old-deja/g++.other/op3.C: Likewise.
+
+2001-05-04 David Edelsohn <edelsohn@gnu.org>
+
+ * gcc.c-torture/execute/20001227-1.c: Remove duplicate of
+ gcc.c-torture/execute/20000412-3.c with no ChangeLog entry.
+
+2001-05-01 Nathan Sidwell <nathan@codesourcery.com>
+
+ * g++.old-deja/g++.ns/template17.C: New test.
+
+2001-05-01 Nathan Sidwell <nathan@codesourcery.com>
+
+ * g++.old-deja/g++.pt/ref4.C: New test.
+
+2001-04-30 Richard Henderson <rth@redhat.com>
+
+ * gcc.dg/20000724-1.c: Revert last change.
+
+2001-04-30 Mark Mitchell <mark@codesourcery.com>
+
+ * gcc.dg/20000724-1.c: Add a clobber of `esp'.
+
+ * gcc.c-torture/execute/20010114-2.x: XFAIL it.
+ * gcc.c-torture/execute/20010123-1.x: Likewise.
+ * gcc.c-torture/execute/loop-2b.x: Likewise.
+
+2001-04-29 Mark Mitchell <mark@codesourcery.com>
+
+ * g++.old-deja/g++.other/crash31.C: XFAIL it.
+
+2001-04-29 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * g++.old-deja/g++.other/crash14.C: Remove -fnew-abi.
+
+2001-04-27 Nathan Sidwell <nathan@codesourcery.com>
+
+ * g++.old-deja/g++.eh/crash6.C: New test.
+
+2001-04-27 Nathan Sidwell <nathan@codesourcery.com>
+
+ * g++.old-deja/g++.other/warn7.C: New test.
+
+2001-04-27 Nathan Sidwell <nathan@codesourcery.com>
+
+ * g++.old-deja/g++.other/defarg9.C: New test.
+
+2001-04-26 Mark Mitchell <mark@codesourcery.com>
+
+ * g++.dg/vtgc1.C: XFAIL.
+ * g++.old-deja/g++.other/crash18.C: Likewise.
+
+Thu Apr 26 11:13:27 2001 Jeffrey A Law (law@cygnus.com)
+
+ * g++.dg/special/initp1.C: Moved here from g++.old-deja/g++.ext.
+ Tweak slightly to work with g++.dg framework.
+ * g++.dg/special/ecos.exp: Run initp1.C test.
+ * g++.old-deja/g++.ext/initp1.C: Moved to g++.dg/special.
+
+ * g++.old-deja/g++.ext/instantiate2.C: XFAIL for HPUX too since
+ its linker doesn't give line numbers either.
+ * g++.old-deja/g++.ext/instantiate3.C: Similarly.
+
+2001-04-26 Nathan Sidwell <nathan@codesourcery.com>
+
+ * g++.old-deja/g++.other/lex1.C: New test.
+
+2001-04-26 Nathan Sidwell <nathan@codesourcery.com>
+
+ * g++.old-deja/g++.pt/mangle2.C: New test.
+
+2001-04-25 Jakub Jelinek <jakub@redhat.com>
+
+ * gcc.c-torture/execute/20010422-1.c: New test.
+
+2001-04-25 Nathan Sidwell <nathan@codesourcery.com>
+
+ * g++.old-deja/g++.ns/type2.C: New test.
+
+2001-04-24 Zack Weinberg <zackw@stanford.edu>
+
+ * g++.old-deja/g++.other/perf1.C: New test.
+
+2001-04-23 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * gcc.c-torture/compile/20010423-1.c: New test.
+
+2001-04-20 Nathan Sidwell <nathan@codesourcery.com>
+
+ * g++.old-deja/g++.pt/typename28.C: New test.
+
+2001-04-20 Nathan Sidwell <nathan@codesourcery.com>
+
+ * g++.old-deja/g++.abi/empty2.C: New test.
+ * g++.old-deja/g++.abi/empty3.C: New test.
+
+2001-04-19 David Billinghurst <David.Billinghurst@riotinto.com>
+ Mark Mitchell <mark@codesourcery.com>
+
+ * lib/old-dejagnu.exp: Don't delete output of executable.
+ Add .exe suffix to executables.
+
+2001-04-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * gcc.dg/wtr-conversion-1.c: Don't test for width changes.
+
+2001-04-12 Nathan Sidwell <nathan@codesourcery.com>
+
+ * g++.old-deja/g++.abi/primary3.C (main): Correct expected layout.
+ * g++.old-deja/g++.abi/crash1.C: New test.
+
+2001-04-12 Nathan Sidwell <nathan@codesourcery.com>
+
+ * g++.old-deja/g++.other/crash40.C: New test.
+
+2001-04-11 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * gcc.c-torture/execute/20010122-1.c: Fix declaration of alloca.
+
+2001-04-11 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * gcc.dg/wtr-conversion-1.c: New testcase.
+
+2001-04-11 Nathan Sidwell <nathan@codesourcery.com>
+
+ * g++.old-deja/g++.other/warn6.C: New test.
+
+2001-04-10 Richard Henderson <rth@redhat.com>
+
+ * g++.old-deja/g++.other/array4.C: New test.
+
+2001-04-08 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
+
+ * gcc.c-torture/compile/20010408-1.c: New test.
+
+2001-04-06 Benjamin Kosnik <bkoz@redhat.com>
+
+ * g++.old-deja/g++.benjamin/15071.C (main): Update to conformant
+ headers and constructs.
+ * g++.old-deja/g++.robertl/eb79.C: Same.
+ * g++.old-deja/g++.robertl/eb77.C (main): Same.
+ * g++.old-deja/g++.robertl/eb73.C: Same.
+ * g++.old-deja/g++.robertl/eb66.C (main): Same.
+ * g++.old-deja/g++.robertl/eb55.C (t): Same.
+ * g++.old-deja/g++.robertl/eb54.C (main): Same.
+ * g++.old-deja/g++.robertl/eb46.C (main): Same.
+ * g++.old-deja/g++.robertl/eb44.C: Same.
+ * g++.old-deja/g++.robertl/eb41.C (main): Same.
+ * g++.old-deja/g++.robertl/eb4.C (main): Same.
+ * g++.old-deja/g++.robertl/eb39.C: Same.
+ * g++.old-deja/g++.robertl/eb33.C (main): Same.
+ * g++.old-deja/g++.robertl/eb31.C (main): Same.
+ * g++.old-deja/g++.robertl/eb30.C: Same.
+ * g++.old-deja/g++.robertl/eb3.C: Same.
+ * g++.old-deja/g++.robertl/eb24.C (T>): Same.
+ * g++.old-deja/g++.robertl/eb21.C: Same.
+ * g++.old-deja/g++.robertl/eb15.C: Same.
+ * g++.old-deja/g++.robertl/eb118.C: Same.
+ * g++.old-deja/g++.robertl/eb115.C (main): Same.
+ * g++.old-deja/g++.robertl/eb113.C (streambuf): Same.
+ * g++.old-deja/g++.robertl/eb109.C: Same.
+ * g++.old-deja/g++.other/sibcall1.C (main): Same.
+ * g++.old-deja/g++.mike/rtti1.C: Same.
+ * g++.old-deja/g++.mike/p658.C: Same.
+ * g++.old-deja/g++.mike/net46.C: Same.
+ * g++.old-deja/g++.mike/net34.C: Same.
+ * g++.old-deja/g++.mike/memoize1.C: Same.
+ * g++.old-deja/g++.mike/eh2.C: Same.
+ * g++.old-deja/g++.law/weak.C: Same.
+ * g++.old-deja/g++.law/visibility7.C: Same.
+ * g++.old-deja/g++.law/visibility25.C: Same.
+ * g++.old-deja/g++.law/visibility22.C: Same.
+ * g++.old-deja/g++.law/visibility2.C: Same.
+ * g++.old-deja/g++.law/visibility17.C: Same.
+ * g++.old-deja/g++.law/visibility13.C: Same.
+ * g++.old-deja/g++.law/visibility10.C: Same.
+ * g++.old-deja/g++.law/visibility1.C: Same.
+ * g++.old-deja/g++.law/virtual3.C (eval): Same.
+ * g++.old-deja/g++.law/vbase1.C: Same.
+ * g++.old-deja/g++.law/operators32.C: Same.
+ * g++.old-deja/g++.law/nest3.C: Same.
+ * g++.old-deja/g++.law/missed-error2.C (foo): Same.
+ * g++.old-deja/g++.law/except5.C (main): Same.
+ * g++.old-deja/g++.law/cvt7.C (run): Same.
+ * g++.old-deja/g++.law/cvt2.C: Same.
+ * g++.old-deja/g++.law/cvt16.C: Same.
+ * g++.old-deja/g++.law/ctors6.C (bar): Same.
+ * g++.old-deja/g++.law/ctors17.C (main): Same.
+ * g++.old-deja/g++.law/ctors13.C: Same.
+ * g++.old-deja/g++.law/ctors12.C (main): Same.
+ * g++.old-deja/g++.law/ctors10.C: Same.
+ * g++.old-deja/g++.law/code-gen5.C: Same.
+ * g++.old-deja/g++.law/bad-error7.C: Same.
+ * g++.old-deja/g++.law/arm9.C: Same.
+ * g++.old-deja/g++.law/arm12.C: Same.
+ * g++.old-deja/g++.law/arg8.C: Same.
+ * g++.old-deja/g++.law/arg1.C: Same.
+ * g++.old-deja/g++.jason/typeid1.C (struct foo): Same.
+ * g++.old-deja/g++.jason/template31.C: Same.
+ * g++.old-deja/g++.jason/template24.C (main): Same.
+ * g++.old-deja/g++.jason/2371.C: Same.
+ * g++.old-deja/g++.eh/new2.C: Same.
+ * g++.old-deja/g++.eh/new1.C: Same.
+ * g++.old-deja/g++.brendan/ptolemy2.C: Same.
+ * g++.old-deja/g++.brendan/nest21.C (main): Same.
+ * g++.old-deja/g++.brendan/err-msg3.C: Same.
+ * g++.old-deja/g++.brendan/crash62.C: Same.
+ * g++.old-deja/g++.brendan/crash52.C: Same.
+ * g++.old-deja/g++.brendan/crash49.C (main): Same.
+ * g++.old-deja/g++.brendan/crash38.C: Same.
+ * g++.old-deja/g++.brendan/crash15.C (main): Same.
+ * g++.old-deja/g++.brendan/copy9.C: Same.
+
+2001-04-04 Diego Novillo <dnovillo@redhat.com>
+
+ * testsuite/gcc.c-torture/compile/20010404-1.c: New test.
+
+2001-04-03 Alexandre Oliva <aoliva@redhat.com>
+
+ * g++.old-deja/g++.ext/instantiate1.C: Adjust to accommodate
+ peculiarities of the SH.
+ * g++.old-deja/g++.ext/instantiate2.C: Likewise.
+
+2001-04-02 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * gcc.c-torture/execute/ieee/fp-cmp-1.c: Renamed nan to dnan.
+ * gcc.c-torture/execute/ieee/fp-cmp-3.c: Likewise.
+ * gcc.c-torture/execute/ieee/fp-cmp-2.c: Renamed nan to fnan.
+
+2001-04-02 Jakub Jelinek <jakub@redhat.com>
+
+ * g77.f-torture/compile/20010321-1.f: New test.
+
+2001-04-02 Jakub Jelinek <jakub@redhat.com>
+
+ * gcc.c-torture/compile/20010329-1.c: New test.
+
+2001-04-02 Jakub Jelinek <jakub@redhat.com>
+
+ * gcc.c-torture/execute/20010329-1.c: New test.
+
+2001-03-28 Philip Blundell <philb@gnu.org>
+
+ * gcc.c-torture/compile/20010328-1.c: New test.
+
+2001-03-28 Loren J. Rittle <ljrittle@acm.org>
+
+ * g++.old-deja/g++.other/eh4.C: Fix typo.
+
+2001-03-28 Loren J. Rittle <ljrittle@acm.org>
+
+ * g++.dg/special/ecos.exp (conpr-1.C): Do not write in $srcdir.
+
+2001-03-27 Alan Modra <alan@linuxcare.com.au>
+
+ * gcc.c-torture/compile/20010327-1.c: New test.
+
+2001-03-22 Jakub Jelinek <jakub@redhat.com>
+
+ * g++.old-deja/g++.other/mangle3.C: New test.
+
+2001-03-25 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * gcc.c-torture/execute/20010325-1.c: New test.
+
+2001-03-22 Jakub Jelinek <jakub@redhat.com>
+
+ * g++.old-deja/g++.other/anon8.C: New test.
+
+2001-03-17 Richard Henderson <rth@redhat.com>
+
+ * g++.old-deja/g++.other/eh4.C: Add expected error text.
+
+2001-03-15 Geoff Keating <geoff@redhat.com>
+
+ * gcc.c-torture/execute/memcheck/memcheck.exp: Don't try to run these
+ tests on AIX.
+
+2001-03-15 Gabriel Dos Reis <gdr@codesourcery.com>
+
+ * g++.old-deja/g++.other/eh4.C: New test.
+
+2001-03-14 Jakub Jelinek <jakub@redhat.com>
+
+ * g++.old-deja/g++.other/regstack.C: New test.
+
+2001-03-11 Nicola Pero <n.pero@mi.flashnet.it>
+
+ * objc/execute/va_method.m: Added.
+ * objc/execute/IMP.m: Added.
+ * objc/execute/_cmd.m: Added.
+ * objc/execute/accessing_ivars.m: Added.
+ * objc/execute/class-1.m: Added.
+ * objc/execute/class-10.m: Added.
+ * objc/execute/class-11.m: Added.
+ * objc/execute/class-12.m: Added.
+ * objc/execute/class-13.m: Added.
+ * objc/execute/class-14.m: Added.
+ * objc/execute/class-2.m: Added.
+ * objc/execute/class-3.m: Added.
+ * objc/execute/class-4.m: Added.
+ * objc/execute/class-5.m: Added.
+ * objc/execute/class-6.m: Added.
+ * objc/execute/class-7.m: Added.
+ * objc/execute/class-8.m: Added.
+ * objc/execute/class-9.m: Added.
+ * objc/execute/class-tests-1.h
+ * objc/execute/class-tests-2.h
+ * objc/execute/compatibility_alias.m: Added.
+ * objc/execute/encode-1.m: Added.
+ * objc/execute/formal_protocol-1.m: Added.
+ * objc/execute/formal_protocol-2.m: Added.
+ * objc/execute/formal_protocol-3.m: Added.
+ * objc/execute/formal_protocol-4.m: Added.
+ * objc/execute/formal_protocol-5.m: Added.
+ * objc/execute/formal_protocol-6.m: Added.
+ * objc/execute/formal_protocol-7.m: Added.
+ * objc/execute/informal_protocol.m: Added.
+ * objc/execute/initialize.m: Added.
+ * objc/execute/load.m: Added.
+ * objc/execute/many_args_method.m: Added.
+ * objc/execute/nested-3.m: Added.
+ * objc/execute/no_clash.m: Added.
+ * objc/execute/private.m: Added.
+ * objc/execute/redefining_self.m: Added.
+ * objc/execute/root_methods.m: Added.
+ * objc/execute/selector-1.m: Added.
+ * objc/execute/static-1.m: Added.
+ * objc/execute/static-2.m: Added.
+ * objc/execute/va_method.m: Added.
+
+2001-03-06 Ovidiu Predescu <ovidiu@cup.hp.com>
+
+ * objc/execute/nested-1.m: Added. New test from Nicola Pero.
+
+ * objc/execute/nested-2.m: Likewise.
+
+ * objc/execute/protocol.m (main): Added. Patch from Nicola Pero.
+
+2001-03-06 Zack Weinberg <zackw@stanford.edu>
+
+ * objc/execute/string1.m, objc/execute/string2.m: Compare the
+ result of -cString against what we expect it to be; don't just
+ print it out for no one to read.
+
+ * objc/execute/string3.m, objc/execute/string4.m: New tests.
+ Based on testcases provided by Nicola Pero.
+
+2001-03-06 Zack Weinberg <zackw@stanford.edu>
+
+ * gcc.dg/20000724-1.c: Don't use multiline strings.
+
+2001-03-03 Neil Booth <neil@daikokuya.demon.co.uk>
+
+ * gcc.dg/cpp/macro7.c: New test.
+
+2001-03-03 Neil Booth <neil@daikokuya.demon.co.uk>
+
+ * gcc.dg/cpp/multiline.c: Update.
+
+2001-03-03 Nathan Sidwell <nathan@codesourcery.com>
+
+ * g++.old-deja/g++.other/ref4.C: New test.
+
+2001-03-02 Nathan Sidwell <nathan@codesourcery.com>
+
+ * g++.old-deja/g++.other/pod1.C: New test.
+
+2001-03-02 Nathan Sidwell <nathan@codesourcery.com>
+
+ * g++.old-deja/g++.ext/overload1.C: New test.
+
+2001-03-01 Zack Weinberg <zackw@stanford.edu>
+
+ * objc/execute/bycopy-3.m: New test.
+
+2001-03-01 Nathan Sidwell <nathan@codesourcery.com>
+
+ * g++.old-deja/g++.other/using1.C: New test.
+
+2001-03-01 Nathan Sidwell <nathan@codesourcery.com>
+
+ * g++.old-deja/g++.other/using9.C: New test.
+
+2001-02-28 Nathan Sidwell <nathan@codesourcery.com>
+
+ * g++.old-deja/g++.ext/realpt1.C: Deprecate.
+
+2001-02-28 Geoffrey Keating <geoffk@redhat.com>
+
+ * g++.dg/vtgc1.C: Update for new ABI.
+
+2001-02-27 Nathan Sidwell <nathan@codesourcery.com>
+
+ * g++.old-deja/g++.abi/vtable3.h: Check vcall offsets too.
+
+2001-02-24 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
+
+ * gcc.c-torture/execute/20010224-1.c: New test.
+
+2001-02-23 Jakub Jelinek <jakub@redhat.com>
+
+ * gcc.c-torture/execute/20010222-1.c: New test.
+
+2001-02-22 Jakub Jelinek <jakub@redhat.com>
+
+ * g++.old-deja/g++.other/inline20.C: New test.
+
+2001-02-21 Gabriel Dos Reis <gdr@merlin.codesourcery.com>
+
+ * g++.old-deja/g++.other/lookup22.C: New test.
+
+2001-02-18 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ * g++.old-deja/g++.other/inline19.c: Remove XFAIL.
+
+2001-02-16 Zack Weinberg <zackw@stanford.edu>
+
+ * g77.dg: New directory.
+ * g77.dg/20010216-1.f: New test case.
+ * g77.dg/dg.exp: New driver.
+ * lib/g77-dg.exp: New driver library.
+
+2001-02-16 Jakub Jelinek <jakub@redhat.com>
+
+ * g++.old-deja/g++.other/init16.C: Update the test so that it does
+ not need <string> and also tests the initialization at runtime.
+
+2001-02-16 Gabriel Dos Reis <gdr@codesourcery.com>
+
+ * g++.old-deja/g++.other/decl9.C: New test.
+
+2001-02-14 Nathan Sidwell <nathan@codesourcery.com>
+
+ * g++.old-deja/g++.pt/deduct6.C: New test.
+
+2001-02-14 Nathan Sidwell <nathan@codesourcery.com>
+
+ * g++.old-deja/g++.pt/deduct5.C: New test.
+
+2001-02-14 Nathan Sidwell <nathan@codesourcery.com>
+
+ * g++.old-deja/g++.other/warn5.C: New test.
+
+2001-02-14 Nathan Sidwell <nathan@codesourcery.com>
+
+ * g++.old-deja/g++.robertl/eb63.C: Remove new initializer list
+ case.
+ * g++.old-deja/g++.ext/arrnew.C: Deprecate.
+
+2001-02-14 Nathan Sidwell <nathan@codesourcery.com>
+
+ * g++.old-deja/g++.pt/spec40.C: New test.
+
2001-02-12 Jakub Jelinek <jakub@redhat.com>
* gcc.c-torture/compile/20010209-1.c: New test.
@@ -51,7 +1029,7 @@ Wed Feb 7 09:54:47 2001 Ovidiu Predescu <ovidiu@cup.hp.com>
2001-02-06 Neil Booth <neil@daikokuya.demon.co.uk>
- * gcc.dg/cpp/avoidpaste1.c: Update.
+ * gcc.dg/cpp/avoidpaste1.c: Update.
Tue Feb 5 8:53:33 2001 Ovidiu Predescu <ovidiu@cup.hp.com>
@@ -93,7 +1071,7 @@ Tue Feb 5 8:53:33 2001 Ovidiu Predescu <ovidiu@cup.hp.com>
2001-02-01 Neil Booth <neil@daikokuya.demon.co.uk>
- * gcc.dg/cpp/avoidpaste2.c: New tests.
+ * gcc.dg/cpp/avoidpaste2.c: New tests.
2001-01-31 Jakub Jelinek <jakub@redhat.com>
@@ -114,12 +1092,12 @@ Wed Jan 31 12:23:32 2001 J"orn Rennecke <amylaar@redhat.com>
2001-01-31 Neil Booth <neil@daikokuya.demon.co.uk>
- * gcc.dg/cpp/tr-warn1.c: Add tests.
+ * gcc.dg/cpp/tr-warn1.c: Add tests.
2001-01-31 Neil Booth <neil@daikokuya.demon.co.uk>
- * gcc.dg/cpp/avoidpaste1.c: Update.
- * gcc.dg/cpp/paste4.c: Update.
+ * gcc.dg/cpp/avoidpaste1.c: Update.
+ * gcc.dg/cpp/paste4.c: Update.
2001-01-30 Jeffrey Oldham <oldham@codesourcery.com>
@@ -145,7 +1123,7 @@ Wed Jan 31 12:23:32 2001 J"orn Rennecke <amylaar@redhat.com>
2001-01-28 Neil Booth <neil@daikokuya.demon.co.uk>
- * gcc.dg/cpp/avoidpaste1.c: Test case.
+ * gcc.dg/cpp/avoidpaste1.c: Test case.
2001-01-28 Jakub Jelinek <jakub@redhat.com>
@@ -261,7 +1239,7 @@ Wed Jan 31 12:23:32 2001 J"orn Rennecke <amylaar@redhat.com>
2001-01-18 Neil Booth <neil@daikokuya.demon.co.uk>
- * gcc.dg/cpp/assembl2.S: New test case.
+ * gcc.dg/cpp/assembl2.S: New test case.
2001-01-17 Jeffrey Oldham <oldham@codesourcery.com>
@@ -301,9 +1279,9 @@ Wed Jan 31 12:23:32 2001 J"orn Rennecke <amylaar@redhat.com>
2001-01-15 Neil Booth <neil@daikokuya.demon.co.uk>
- * gcc.dg/cpp/if-2.c: Comment out occasionally bogus test; we
- have an equivalent working one below it.
-
+ * gcc.dg/cpp/if-2.c: Comment out occasionally bogus test; we
+ have an equivalent working one below it.
+
2001-01-14 Jeffrey Oldham <oldham@codesourcery.com>
* g++.old-deja/g++.ext/instantiate2.C: Add explanatory comment.
@@ -345,8 +1323,8 @@ Wed Jan 31 12:23:32 2001 J"orn Rennecke <amylaar@redhat.com>
2001-01-13 Neil Booth <neil@daikokuya.demon.co.uk>
- * gcc.dg/cpp/widestr1.c: Update.
- * gcc.dg/cpp/prag-imp.c: Remove.
+ * gcc.dg/cpp/widestr1.c: Update.
+ * gcc.dg/cpp/prag-imp.c: Remove.
2001-01-12 Jakub Jelinek <jakub@redhat.com>
@@ -393,7 +1371,7 @@ Wed Jan 31 12:23:32 2001 J"orn Rennecke <amylaar@redhat.com>
2001-01-10 Alan Lehotsky <lehotsky@tiac.net>
* gcc.dg/20000926-1.c: Parameterize for machines with 16-bit ints.
-
+
2001-01-10 Nathan Sidwell <nathan@codesourcery.com>
* g++.old-deja/g++.pt/error3.C: New test.
@@ -409,17 +1387,17 @@ Wed Jan 31 12:23:32 2001 J"orn Rennecke <amylaar@redhat.com>
2001-01-08 Jonathan Larmour <jlarmour@redhat.com>
* gcc.dg/20000419-2.c: Move to "special" subdirectory.
- * gcc.dg/special/20000419-2.c: New file. Identical to above.
- * gcc.dg/special/special.exp: New test driver which will check
- for alias support for the above test.
+ * gcc.dg/special/20000419-2.c: New file. Identical to above.
+ * gcc.dg/special/special.exp: New test driver which will check
+ for alias support for the above test.
2001-01-09 Alan Lehotsky <lehotsky@tiac.net>
* gcc.c-torture/execute/921202-1.c: Use STACK_SIZE to avoid
problems on small machines.
* gcc.c-torture/execute/920730-1.c: Use values from <limits.h> to
- parameterize.
-
+ parameterize.
+
2001-01-09 Jeffrey Oldham <oldham@codesourcery.com>
* g++.old-deja/g++.ext/instantiate2.C: ERROR line should fail for
@@ -604,7 +1582,7 @@ Thu Jan 4 13:54:11 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
2001-01-03 Jeffrey Oldham <oldham@codesourcery.com>
* lib/target-supports.exp (check_alias_available): Modified to
- indicate aliases not supported if only weak aliases are supported.
+ indicate aliases not supported if only weak aliases are supported.
2001-01-03 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
@@ -737,12 +1715,12 @@ Thu Dec 21 22:43:03 2000 J"orn Rennecke <amylaar@redhat.com>
2000-12-17 Neil Booth <neil@daikokuya.demon.co.uk>
- * gcc.dg/cpp/multiline.c: New test.
+ * gcc.dg/cpp/multiline.c: New test.
2000-12-17 Neil Booth <neil@daikokuya.demon.co.uk>
- * g++.old-deja/g++.other/syshdr1.C: Update.
- * gcc.dg/cpp/lineflags.c: Remove temporarily.
+ * g++.old-deja/g++.other/syshdr1.C: Update.
+ * gcc.dg/cpp/lineflags.c: Remove temporarily.
2000-12-15 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
@@ -790,7 +1768,7 @@ Thu Dec 21 22:43:03 2000 J"orn Rennecke <amylaar@redhat.com>
2000-12-11 Neil Booth <neilb@earthling.net>
- * gcc.dg/cpp/if-2.c: Separate tests so that which failed is obvious.
+ * gcc.dg/cpp/if-2.c: Separate tests so that which failed is obvious.
2000-12-09 Joseph S. Myers <jsm28@cam.ac.uk>
@@ -798,10 +1776,10 @@ Thu Dec 21 22:43:03 2000 J"orn Rennecke <amylaar@redhat.com>
2000-12-09 Neil Booth <neilb@earthling.net>
- * gcc.dg/cpp/lineflags.c: New tests.
- * gcc.dg/cpp/poison.c: Update.
- * gcc.dg/cpp/redef2.c: Update.
- * gcc.dg/cpp/skipping.c: New test.
+ * gcc.dg/cpp/lineflags.c: New tests.
+ * gcc.dg/cpp/poison.c: Update.
+ * gcc.dg/cpp/redef2.c: Update.
+ * gcc.dg/cpp/skipping.c: New test.
2000-12-07 Geoffrey Keating <geoffk@redhat.com>
@@ -809,12 +1787,12 @@ Thu Dec 21 22:43:03 2000 J"orn Rennecke <amylaar@redhat.com>
2000-12-07 Neil Booth <neilb@earthling.net>
- * gcc.dg/wtr-aggr-init-1.c, wtr-escape-1.c, wtr-int-type-1.c,
- wtr-label-1.c, wtr-static-1.c, wtr-strcat-1.c, wtr-suffix-1.c,
- wtr-switch-1.c, wtr-unary-plus-1.c, wtr-union-init-1.c
- wtr-union-init-2.c, wtr-union-init-3.c: Update.
- * gcc.dg/cpp/extratokens.c, tr-warn4.c, tr-warn5.c, tr-warn6.c:
- Update.
+ * gcc.dg/wtr-aggr-init-1.c, wtr-escape-1.c, wtr-int-type-1.c,
+ wtr-label-1.c, wtr-static-1.c, wtr-strcat-1.c, wtr-suffix-1.c,
+ wtr-switch-1.c, wtr-unary-plus-1.c, wtr-union-init-1.c
+ wtr-union-init-2.c, wtr-union-init-3.c: Update.
+ * gcc.dg/cpp/extratokens.c, tr-warn4.c, tr-warn5.c, tr-warn6.c:
+ Update.
2000-12-07 Joseph S. Myers <jsm28@cam.ac.uk>
@@ -889,8 +1867,8 @@ Thu Dec 21 22:43:03 2000 J"orn Rennecke <amylaar@redhat.com>
2000-12-04 Neil Booth <neilb@earthling.net>
- * gcc.dg/cpp/assert_trad1.c, assert_trad2.c, assert_trad3.c:
- New tests.
+ * gcc.dg/cpp/assert_trad1.c, assert_trad2.c, assert_trad3.c:
+ New tests.
2000-12-03 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
@@ -903,7 +1881,7 @@ Thu Dec 21 22:43:03 2000 J"orn Rennecke <amylaar@redhat.com>
2000-12-03 Neil Booth <neilb@earthling.net>
- * gcc.dg/cpp/macro6.c: New test cases.
+ * gcc.dg/cpp/macro6.c: New test cases.
2000-12-02 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
@@ -923,19 +1901,19 @@ Thu Dec 21 22:43:03 2000 J"orn Rennecke <amylaar@redhat.com>
2000-12-02 Neil Booth <neilb@earthling.net>
- * g++.old-deja/g++.other/externC4.C,
- g++.old-deja/g++.other/friend10.C: New tests.
+ * g++.old-deja/g++.other/externC4.C,
+ g++.old-deja/g++.other/friend10.C: New tests.
2000-12-02 Neil Booth <neilb@earthling.net>
- * g++.old-deja/g++.other/instan2.C
- * g++.old-deja/g++.other/instan3.C: New test.
+ * g++.old-deja/g++.other/instan2.C
+ * g++.old-deja/g++.other/instan3.C: New test.
2000-12-02 Neil Booth <neilb@earthling.net>
- * gcc.dg/cpp/c++98.c,c++98-pedantic.c,c89.c,c89-pedantic.c,
- c94.c,c94-pedantic.c,c99.c,c99-pedantic.c,gnuc89.c,gnuc89-pedantic.c,
- gnuc99.c,gnuc99-pedantic.c: New tests.
+ * gcc.dg/cpp/c++98.c,c++98-pedantic.c,c89.c,c89-pedantic.c,
+ c94.c,c94-pedantic.c,c99.c,c99-pedantic.c,gnuc89.c,gnuc89-pedantic.c,
+ gnuc99.c,gnuc99-pedantic.c: New tests.
2000-12-01 Joseph S. Myers <jsm28@cam.ac.uk>
@@ -944,9 +1922,9 @@ Thu Dec 21 22:43:03 2000 J"orn Rennecke <amylaar@redhat.com>
2000-12-01 Neil Booth <neilb@earthling.net>
- * gcc.dg/cpp/20000720-1.S: Remove duplicate testcase.
- * gcc.dg/cpp/poison.c: Update.
- * gcc.dg/cpp/spacing1.c: New testcase for all spacing issues.
+ * gcc.dg/cpp/20000720-1.S: Remove duplicate testcase.
+ * gcc.dg/cpp/poison.c: Update.
+ * gcc.dg/cpp/spacing1.c: New testcase for all spacing issues.
2000-12-01 Toon Moene <toon@moene.indiv.nluug.nl>
@@ -1102,7 +2080,7 @@ Thu Dec 21 22:43:03 2000 J"orn Rennecke <amylaar@redhat.com>
2000-11-22 Loren J. Rittle <ljrittle@acm.org>
- * g++.old-deja/g++.robertl/eb39.C: Don't include libio.h.
+ * g++.old-deja/g++.robertl/eb39.C: Don't include libio.h.
2000-11-22 Jakub Jelinek <jakub@redhat.com>
@@ -1122,7 +2100,7 @@ Thu Dec 21 22:43:03 2000 J"orn Rennecke <amylaar@redhat.com>
2000-11-21 Neil Booth <neilb@earthling.net>
- * gcc.dg/cpp/integrated1.c: Remove.
+ * gcc.dg/cpp/integrated1.c: Remove.
2000-11-21 Jakub Jelinek <jakub@redhat.com>
@@ -1148,8 +2126,8 @@ Thu Dec 21 22:43:03 2000 J"orn Rennecke <amylaar@redhat.com>
2000-11-20 Neil Booth <neilb@earthling.net>
- * gcc.dg/cpp/paste2.c: Update test.
- * objc/execute/paste.m: New test.
+ * gcc.dg/cpp/paste2.c: Update test.
+ * objc/execute/paste.m: New test.
2000-11-20 Joseph S. Myers <jsm28@cam.ac.uk>
@@ -1228,8 +2206,8 @@ Thu Dec 21 22:43:03 2000 J"orn Rennecke <amylaar@redhat.com>
2000-11-15 Neil Booth <neilb@earthling.net>
- gcc.dg/cpp/_Pragma1.c: Update.
- gcc.dg/cpp/_Pragma2.c: New test.
+ gcc.dg/cpp/_Pragma1.c: Update.
+ gcc.dg/cpp/_Pragma2.c: New test.
2000-11-15 Nathan Sidwell <nathan@codesourcery.com>
@@ -1413,7 +2391,7 @@ Thu Dec 21 22:43:03 2000 J"orn Rennecke <amylaar@redhat.com>
2000-11-04 Neil Booth <neilb@earthling.net>
- * gcc.dg/cpp/include2.c: New tests.
+ * gcc.dg/cpp/include2.c: New tests.
Fri Nov 3 13:32:14 2000 Mark P Mitchell <mark@codesourcery.com>
@@ -1467,7 +2445,7 @@ Fri Nov 3 13:32:14 2000 Mark P Mitchell <mark@codesourcery.com>
2000-10-29 Neil Booth <neilb@earthling.net>
- * gcc.dg/cpp/macro4.c, macro5.c: New tests.
+ * gcc.dg/cpp/macro4.c, macro5.c: New tests.
* mi1.c, mi1c.h: Add null directives to multiple-include test.
* mi5.c: Test multiple includes work with -C.
* trigraphs.c: Test ^= version.
@@ -1716,7 +2694,7 @@ Mon Oct 9 23:32:06 MET DST 2000 Jan Hubicka <jh@suse.cz>
2000-09-26 Jakub Jelinek <jakub@redhat.com>
- * gcc.c-torture/compile/20000923-1.c: New test.
+ * gcc.c-torture/compile/20000923-1.c: New test.
2000-09-25 Theodore Papadopoulo <Theodore.Papadopoulo@sophia.inria.fr>
@@ -1848,7 +2826,7 @@ Tue Sep 12 18:32:07 2000 J"orn Rennecke <amylaar@redhat.co.uk>
2000-09-07 Catherine Moore <clm@redhat.com>
- * gcc.c-torture/execute/unroll-1.c: New test.
+ * gcc.c-torture/execute/unroll-1.c: New test.
2000-09-06 Zack Weinberg <zack@wolery.cumb.org>
diff --git a/gcc/testsuite/g++.dg/mangle1.C b/gcc/testsuite/g++.dg/mangle1.C
new file mode 100644
index 00000000000..eb5d7840997
--- /dev/null
+++ b/gcc/testsuite/g++.dg/mangle1.C
@@ -0,0 +1,28 @@
+// Test for mangling of simple testcase involving construction vtables.
+
+// { dg-do compile }
+// { dg-options "-fno-inline" }
+
+struct A {
+ virtual void f () { }
+};
+
+struct B: public virtual A { };
+struct C: public B { };
+
+C c;
+
+// { dg-final { scan-assembler mangle1.C "\n_?_ZN1A1fEv:" } }
+// { dg-final { scan-assembler mangle1.C "\n_?_ZN1AC2Ev:" } }
+// { dg-final { scan-assembler mangle1.C "\n_?_ZN1BC2Ev:" } }
+// { dg-final { scan-assembler mangle1.C "\n_?_ZN1CC1Ev:" } }
+// { dg-final { scan-assembler mangle1.C "\n_?_ZTC1C0_1B:" } }
+// { dg-final { scan-assembler mangle1.C "\n_?_ZTI1A:" } }
+// { dg-final { scan-assembler mangle1.C "\n_?_ZTI1B:" } }
+// { dg-final { scan-assembler mangle1.C "\n_?_ZTI1C:" } }
+// { dg-final { scan-assembler mangle1.C "\n_?_ZTS1A:" } }
+// { dg-final { scan-assembler mangle1.C "\n_?_ZTS1B:" } }
+// { dg-final { scan-assembler mangle1.C "\n_?_ZTS1C:" } }
+// { dg-final { scan-assembler mangle1.C "\n_?_ZTT1C:" } }
+// { dg-final { scan-assembler mangle1.C "\n_?_ZTV1A:" } }
+// { dg-final { scan-assembler mangle1.C "\n_?_ZTV1C:" } }
diff --git a/gcc/testsuite/g++.dg/ref1.C b/gcc/testsuite/g++.dg/ref1.C
new file mode 100644
index 00000000000..aaf04cff684
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ref1.C
@@ -0,0 +1,47 @@
+// Origin: Peter Schmid <schmid@snake.iap.physik.tu-darmstadt.de>
+
+// { dg-do link }
+
+template <class T>
+class Ptr {
+protected:
+ T * ptr;
+
+public:
+
+ Ptr(void) : ptr(0) { };
+ Ptr(T * p) : ptr(p) { };
+
+ ~Ptr(void) { delete ptr; }
+
+ operator T & () { return *ptr; }
+};
+
+class base {
+public:
+ base(void) { }
+ ~base(void) { }
+};
+
+
+class foo : public base {
+private:
+ foo(const foo & rv);
+
+public:
+
+ foo(void) { }
+ ~foo(void) { }
+};
+
+void func2(base & b) {
+ // ...
+}
+
+int main () {
+ Ptr<foo> f = new foo;
+ /* This should not result in a copy; the result of the conversion
+ operator should be bound directly to the reference argument to
+ `func2'. */
+ func2(f);
+}
diff --git a/gcc/testsuite/g++.dg/sizeof1.C b/gcc/testsuite/g++.dg/sizeof1.C
new file mode 100644
index 00000000000..328d647473c
--- /dev/null
+++ b/gcc/testsuite/g++.dg/sizeof1.C
@@ -0,0 +1,15 @@
+// Test use of `sizeof' as a template parameter.
+// Origin: smacdonald@seimac.com
+
+// { dg-do compile }
+
+template <unsigned I> struct A {};
+
+template <typename SizeType>
+struct B
+{
+char * f() const
+{
+return (A<sizeof(void *)>::value);
+}
+};
diff --git a/gcc/testsuite/g++.dg/special/ecos.exp b/gcc/testsuite/g++.dg/special/ecos.exp
index af3d8c1b560..df94956c19e 100644
--- a/gcc/testsuite/g++.dg/special/ecos.exp
+++ b/gcc/testsuite/g++.dg/special/ecos.exp
@@ -29,15 +29,15 @@ load_lib g++-dg.exp
###########
dg-init
-set lines [g++_target_compile "$srcdir/$subdir/conpr-1.C" "$srcdir/$subdir/a.out" executable ""]
+set lines [g++_target_compile "$srcdir/$subdir/conpr-1.C" "$objdir/a.out" executable ""]
if [string match "*init_priority*" $lines] then {
xfail "conpr-1.C"
- file delete $srcdir/$subdir/a.out
+ file delete $objdir/a.out
} elseif ![string match "" $lines] then {
fail "conpr-1.C"
} else {
dg-runtest "$srcdir/$subdir/conpr-1.C" "" ""
- file delete $srcdir/$subdir/a.out
+ file delete $objdir/a.out
}
dg-finish
@@ -84,5 +84,22 @@ if [string match "*init_priority*" $lines] then {
}
dg-finish
+###########
+# initp1.C
+###########
+
+dg-init
+set lines [g++_target_compile "$srcdir/$subdir/initp1.C" "$objdir/a.out" executable ""]
+if [string match "*init_priority*" $lines] then {
+ xfail "initp1.C"
+ file delete $objdir/a.out
+} elseif ![string match "" $lines] then {
+ fail "initp1.C"
+} else {
+ dg-runtest "$srcdir/$subdir/conpr-1.C" "" ""
+ file delete $objdir/a.out
+}
+dg-finish
+
### EOF ecos.exp
diff --git a/gcc/testsuite/g++.old-deja/g++.ext/initp1.C b/gcc/testsuite/g++.dg/special/initp1.C
index 0e4c02c3c0d..74bcb5f764d 100644
--- a/gcc/testsuite/g++.old-deja/g++.ext/initp1.C
+++ b/gcc/testsuite/g++.dg/special/initp1.C
@@ -1,6 +1,5 @@
-// Test for proper handling of the init_priority attribute.
-// Contributed by Hugo Tyson <hmt@cygnus.co.uk>
-// excess errors test - XFAIL mips*-sgi-irix*
+/* { dg-do run } */
+#include <stdlib.h>
class Two {
private:
@@ -63,13 +62,13 @@ int main()
X( koo[0].kay() );
X( koo[1].kay() );
X( koo[2].kay() );
- if ( 0x3f != x ) return 1;
+ if ( 0x3f != x ) abort ();
X( foo.kay() );
- if ( 0x7f != x ) return 1;
+ if ( 0x7f != x ) abort ();
X( goo.kay() );
- if ( 0xff != x ) return 1;
+ if ( 0xff != x ) abort ();
X( xoo[0].kay() );
X( xoo[1].kay() );
@@ -77,7 +76,7 @@ int main()
X( zoo[0].kay() );
X( zoo[1].kay() );
X( zoo[2].kay() );
- if ( 0x3fff != x ) return 1;
+ if ( 0x3fff != x ) abort ();
X( doo[0].kay() );
X( doo[1].kay() );
@@ -85,7 +84,7 @@ int main()
X( hoo[0].kay() );
X( hoo[1].kay() );
X( hoo[2].kay() );
- if ( 0xfffff != x ) return 1;
+ if ( 0xfffff != x ) abort ();
- return 0;
+ exit (0);
}
diff --git a/gcc/testsuite/g++.dg/unify1.C b/gcc/testsuite/g++.dg/unify1.C
new file mode 100644
index 00000000000..2f0a18cf457
--- /dev/null
+++ b/gcc/testsuite/g++.dg/unify1.C
@@ -0,0 +1,26 @@
+// Test non-type template argument folding.
+// Origin: smacdonald@seimac.com
+
+// { dg-do compile }
+
+template < int I1, int I2 >
+class unit
+{
+public:
+ unit() {}
+ unit( const unit<I1,I2>& ) {}
+
+ template< int Q1, int Q2 >
+ unit< I1 - Q1, I2 - Q2 > operator / ( const unit< Q1, Q2 >& rhs ) const {
+ return unit< I1 - Q1, I2 - Q2 >();
+ }
+
+};
+
+int main()
+{
+ const unit<1,0> u1;
+ const unit<2,0> u2;
+
+ unit<-1,0> u3( u1 / u2 );
+}
diff --git a/gcc/testsuite/g++.dg/vtgc1.C b/gcc/testsuite/g++.dg/vtgc1.C
index 03d34fa30b9..7006ddeec38 100644
--- a/gcc/testsuite/g++.dg/vtgc1.C
+++ b/gcc/testsuite/g++.dg/vtgc1.C
@@ -1,5 +1,6 @@
// { dg-do compile }
-// { dg-options "-fvtable-gc -fno-new-abi" }
+// { dg-options "-fvtable-gc" }
+// { dg-excess-errors "-fvtable-gc unsupported" { xfail *-*-* } }
// Origin: Hans-Peter Nilsson <hp@bitrange.com>
class Base0
@@ -118,18 +119,29 @@ void x3 (Multivs1 *ii) { ii->f2();}
void x4 (Multiss2 *ii) { ii->f2();}
void x5 (Multivv3 *ii) { ii->f2();}
-// { dg-final { scan-assembler-dem vtgc1.C "\.vtable_inherit\[ \t\]*Multivv3 virtual table, 0" } }
-// { dg-final { scan-assembler-dem vtgc1.C "\.vtable_inherit\[ \t\]*Multivv3::Side0 virtual table, Side0 virtual table" } }
-// { dg-final { scan-assembler-dem vtgc1.C "\.vtable_inherit\[ \t\]*Multivv3::Base2 virtual table, Base2 virtual table" } }
-// { dg-final { scan-assembler-dem vtgc1.C "\.vtable_inherit\[ \t\]*Multiss2 virtual table, Base2 virtual table" } }
-// { dg-final { scan-assembler-dem vtgc1.C "\.vtable_inherit\[ \t\]*Multiss2::Side0 virtual table, Side0 virtual table" } }
-// { dg-final { scan-assembler-dem vtgc1.C "\.vtable_inherit\[ \t\]*Multivs1 virtual table, Base2 virtual table" } }
-// { dg-final { scan-assembler-dem vtgc1.C "\.vtable_inherit\[ \t\]*Multivs1::Side0 virtual table, Side0 virtual table" } }
-// { dg-final { scan-assembler-dem vtgc1.C "\.vtable_inherit\[ \t\]*Multisv0 virtual table, Side0 virtual table" } }
-// { dg-final { scan-assembler-dem vtgc1.C "\.vtable_inherit\[ \t\]*Multisv0::Base2 virtual table, Base2 virtual table" } }
-// { dg-final { scan-assembler-dem vtgc1.C "\.vtable_inherit\[ \t\]*Side0 virtual table, 0" } }
-// { dg-final { scan-assembler-dem vtgc1.C "\.vtable_inherit\[ \t\]*VbasedA virtual table, 0" } }
-// { dg-final { scan-assembler-dem vtgc1.C "\.vtable_inherit\[ \t\]*VbasedA::Base2 virtual table, Base2 virtual table" } }
-// { dg-final { scan-assembler-dem vtgc1.C "\.vtable_inherit\[ \t\]*Base2 virtual table, Base1 virtual table" } }
-// { dg-final { scan-assembler-dem vtgc1.C "\.vtable_inherit\[ \t\]*Base1 virtual table, Base0 virtual table" } }
-// { dg-final { scan-assembler-dem vtgc1.C "\.vtable_inherit\[ \t\]*Base0 virtual table, 0" } }
+// { dg-final { setup_xfail *-*-* } }
+// { dg-final { scan-assembler-dem vtgc1.C "\.vtable_inherit\[ \t\]*vtable for Multivv3, 0" } }
+// { dg-final { setup_xfail *-*-* } }
+// { dg-final { scan-assembler-dem vtgc1.C "\.vtable_inherit\[ \t\]*VTT for Multivv3, 0" } }
+// { dg-final { setup_xfail *-*-* } }
+// { dg-final { scan-assembler-dem vtgc1.C "\.vtable_inherit\[ \t\]*vtable for Multiss2, vtable for Base2" } }
+// { dg-final { setup_xfail *-*-* } }
+// { dg-final { scan-assembler-dem vtgc1.C "\.vtable_inherit\[ \t\]*vtable for Multivs1, vtable for Base2" } }
+// { dg-final { setup_xfail *-*-* } }
+// { dg-final { scan-assembler-dem vtgc1.C "\.vtable_inherit\[ \t\]*VTT for Multivs1, vtable for Base2" } }
+// { dg-final { setup_xfail *-*-* } }
+// { dg-final { scan-assembler-dem vtgc1.C "\.vtable_inherit\[ \t\]*vtable for Multisv0, vtable for Side0" } }
+// { dg-final { setup_xfail *-*-* } }
+// { dg-final { scan-assembler-dem vtgc1.C "\.vtable_inherit\[ \t\]*VTT for Multisv0, vtable for Side0" } }
+// { dg-final { setup_xfail *-*-* } }
+// { dg-final { scan-assembler-dem vtgc1.C "\.vtable_inherit\[ \t\]*vtable for Side0, 0" } }
+// { dg-final { setup_xfail *-*-* } }
+// { dg-final { scan-assembler-dem vtgc1.C "\.vtable_inherit\[ \t\]*vtable for VbasedA, 0" } }
+// { dg-final { setup_xfail *-*-* } }
+// { dg-final { scan-assembler-dem vtgc1.C "\.vtable_inherit\[ \t\]*VTT for VbasedA, 0" } }
+// { dg-final { setup_xfail *-*-* } }
+// { dg-final { scan-assembler-dem vtgc1.C "\.vtable_inherit\[ \t\]*vtable for Base2, vtable for Base1" } }
+// { dg-final { setup_xfail *-*-* } }
+// { dg-final { scan-assembler-dem vtgc1.C "\.vtable_inherit\[ \t\]*vtable for Base1, vtable for Base0" } }
+// { dg-final { setup_xfail *-*-* } }
+// { dg-final { scan-assembler-dem vtgc1.C "\.vtable_inherit\[ \t\]*vtable for Base0, 0" } }
diff --git a/gcc/testsuite/g++.old-deja/g++.abi/bitfields.C b/gcc/testsuite/g++.old-deja/g++.abi/bitfields.C
index 75b6571b1dc..57d06b36744 100644
--- a/gcc/testsuite/g++.old-deja/g++.abi/bitfields.C
+++ b/gcc/testsuite/g++.old-deja/g++.abi/bitfields.C
@@ -55,7 +55,7 @@ check_bits (char *buf,
#define CHECK_FIELD(AGGREGATE, FIELD, START_BIT, NUM_BITS, RVAL) \
do { \
AGGREGATE a__; \
- memset (& a__, 0, sizeof (a__)); \
+ std::memset (& a__, 0, sizeof (a__)); \
a__.FIELD = -1; \
if (! check_bits ((char *) & a__, sizeof (a__), START_BIT, NUM_BITS)) \
return RVAL; \
diff --git a/gcc/testsuite/g++.old-deja/g++.abi/crash1.C b/gcc/testsuite/g++.old-deja/g++.abi/crash1.C
new file mode 100644
index 00000000000..8526818c713
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.abi/crash1.C
@@ -0,0 +1,21 @@
+// Build don't link:
+//
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 11 Apr 2001 <nathan@codesourcery.com>
+
+// Bug 1944. We failed to calculate nearly emptiness properly, and
+// lost primary too.
+
+struct A1 {};
+struct A2 {};
+
+struct B1 : virtual A1 {};
+struct B2 : virtual A2 {};
+
+struct C1 : virtual B2 {};
+struct C2 : virtual B2 {};
+
+struct D1 : virtual C1, virtual C2 {};
+struct D2 : virtual C2, virtual B1 {};
+
+struct E : virtual D1, virtual D2 {};
diff --git a/gcc/testsuite/g++.old-deja/g++.abi/cxa_vec.C b/gcc/testsuite/g++.old-deja/g++.abi/cxa_vec.C
index c08ce75e961..117a760ef31 100644
--- a/gcc/testsuite/g++.old-deja/g++.abi/cxa_vec.C
+++ b/gcc/testsuite/g++.old-deja/g++.abi/cxa_vec.C
@@ -1,12 +1,12 @@
// Test __cxa_vec routines
-// Copyright (C) 2000 Free Software Foundation, Inc.
+// Copyright (C) 2000, 2001 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 7 Apr 2000 <nathan@nathan@codesourcery.com>
#if defined (__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100
#include <cxxabi.h>
#include <stdio.h>
#include <new>
-#include <malloc.h>
+#include <stdlib.h>
#include <setjmp.h>
static int ctor_count = 0;
diff --git a/gcc/testsuite/g++.old-deja/g++.abi/empty2.C b/gcc/testsuite/g++.old-deja/g++.abi/empty2.C
new file mode 100644
index 00000000000..411651701e3
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.abi/empty2.C
@@ -0,0 +1,136 @@
+// Build don't link:
+
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 12 Apr 2001 <nathan@codesourcery.com>
+
+// Check we deal with trailing empty base classes properly
+
+struct A {};
+struct B1 : A {};
+struct B2 : A {};
+struct B3 : A {};
+struct B4 : A {};
+struct B5 : A {};
+struct B6 : A {};
+struct B7 : A {};
+struct B8 : A {};
+
+struct C1 : B1
+{
+ virtual void Foo () {};
+};
+struct C2 : B1, B2
+{
+ virtual void Foo () {};
+};
+struct C3 : B1, B2, B3
+{
+ virtual void Foo () {};
+};
+struct C4 : B1, B2, B3, B4
+{
+ virtual void Foo () {};
+};
+struct C5 : B1, B2, B3, B4, B5
+{
+ virtual void Foo () {};
+};
+struct C6 : B1, B2, B3, B4, B5, B6
+{
+ virtual void Foo () {};
+};
+struct C7 : B1, B2, B3, B4, B5, B6, B7
+{
+ virtual void Foo () {};
+};
+struct C8 : B1, B2, B3, B4, B5, B6, B7, B8
+{
+ virtual void Foo () {};
+};
+
+struct D1 : virtual C1 {};
+struct D2 : virtual C2 {};
+struct D3 : virtual C3 {};
+struct D4 : virtual C4 {};
+struct D5 : virtual C5 {};
+struct D6 : virtual C6 {};
+struct D7 : virtual C7 {};
+struct D8 : virtual C8 {};
+
+unsigned const nearly_empty_size = sizeof (D1);
+
+template <typename Cn, typename Dn> int Check (Dn const &ref)
+{
+ if ((sizeof (Cn) <= nearly_empty_size)
+ != (static_cast <void const *> (&ref)
+ == static_cast <Cn const *> (&ref)))
+ return 1;
+ return 0;
+}
+
+template <typename Bn, typename Cn> int Check ()
+{
+ Cn c[2];
+
+ if (static_cast <A *> (static_cast <B1 *> (&c[1]))
+ == static_cast <A *> (static_cast <Bn *> (&c[0])))
+ return 1;
+ return 0;
+}
+
+
+int main ()
+{
+#if defined (__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100
+ if (Check<B1, C1> ())
+ return 1;
+ if (Check<B2, C2> ())
+ return 2;
+ if (Check<B3, C3> ())
+ return 3;
+ if (Check<B4, C4> ())
+ return 4;
+ if (Check<B5, C5> ())
+ return 5;
+ if (Check<B6, C6> ())
+ return 6;
+ if (Check<B7, C7> ())
+ return 7;
+ if (Check<B8, C8> ())
+ return 8;
+
+ if (Check<C1> (D1 ()))
+ return 11;
+ if (Check<C2> (D2 ()))
+ return 12;
+ if (Check<C3> (D3 ()))
+ return 13;
+ if (Check<C4> (D4 ()))
+ return 14;
+ if (Check<C5> (D5 ()))
+ return 15;
+ if (Check<C6> (D6 ()))
+ return 16;
+ if (Check<C7> (D7 ()))
+ return 17;
+ if (Check<C8> (D8 ()))
+ return 18;
+
+ if (sizeof (C2) == nearly_empty_size)
+ return 22;
+ if (sizeof (C3) == nearly_empty_size)
+ return 23;
+ if (sizeof (C4) == nearly_empty_size)
+ return 24;
+ if (sizeof (C5) == nearly_empty_size)
+ return 25;
+ if (sizeof (C6) == nearly_empty_size)
+ return 26;
+ if (sizeof (C7) == nearly_empty_size)
+ return 27;
+ if (sizeof (C8) == nearly_empty_size)
+ return 28;
+#endif
+ return 0;
+
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.abi/empty3.C b/gcc/testsuite/g++.old-deja/g++.abi/empty3.C
new file mode 100644
index 00000000000..93e9d9ffdf9
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.abi/empty3.C
@@ -0,0 +1,24 @@
+// Build don't link:
+
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 12 Apr 2001 <nathan@codesourcery.com>
+
+// Check we deal with aligning virtual bases after a trailing empty
+// base class properly
+
+struct A {};
+struct B1 : A {};
+struct B2 : A {};
+struct B3 : A {};
+
+struct C : B1, B2, virtual B3 {};
+
+int main ()
+{
+#if defined (__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100
+ C c;
+ if (((char *)static_cast <B3 *> (&c) - (char *)&c) % __alignof__ (C))
+ return 1;
+#endif
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.abi/empty4.C b/gcc/testsuite/g++.old-deja/g++.abi/empty4.C
new file mode 100644
index 00000000000..0d212cc9438
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.abi/empty4.C
@@ -0,0 +1,84 @@
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 31 Jul 2001 <nathan@codesourcery.com>
+
+// Bug 3820. We were bit copying empty bases including the
+// padding. Which clobbers whatever they overlay.
+
+struct Empty {};
+
+struct Inter : Empty {};
+
+int now = 0;
+
+struct NonPod
+{
+ int m;
+
+ NonPod () {m = 0x12345678;}
+ NonPod (int m_) {m = m_;}
+ NonPod &operator= (NonPod const &src) {now = m; m = src.m;}
+ NonPod (NonPod const &src) {m = src.m;}
+};
+
+struct A : Inter
+{
+ A (int c) {m = c;}
+
+ NonPod m;
+};
+
+struct B
+{
+ Inter empty;
+ NonPod m;
+
+ B (int c) {m = c;}
+};
+
+struct C : NonPod, Inter
+{
+ C (int c) : NonPod (c), Inter () {}
+};
+
+int main ()
+{
+ A a (0x12131415);
+
+ int was = a.m.m;
+
+ a = 0x22232425;
+
+ if (was != now)
+ return 1; // we copied the empty base which clobbered a.m.m's
+ // original value.
+
+ A b (0x32333435);
+ *(Inter *)&a = *(Inter *)&b;
+
+ if (a.m.m != 0x22232425)
+ return 2; // we copied padding, which clobbered a.m.m
+
+ A b2 (0x32333435);
+ (Inter &)b2 = Inter ();
+ if (b2.m.m != 0x32333435)
+ return 2; // we copied padding, which clobbered b2.m.m
+
+ B c (0x12131415);
+ was = c.m.m;
+ c = 0x22232425;
+ if (was != now)
+ return 3;
+
+ B d (0x32333435);
+ c.empty = d.empty;
+
+ if (c.m.m != 0x22232425)
+ return 4;
+
+ C e (0x32333435);
+
+ if (e.m != 0x32333435)
+ return 2; // we copied padding
+
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.abi/mangle1.C b/gcc/testsuite/g++.old-deja/g++.abi/mangle1.C
new file mode 100644
index 00000000000..70f0ccee0be
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.abi/mangle1.C
@@ -0,0 +1,7 @@
+// Build don't link:
+// Origin: Mark Mitchell <mark@codesourcery.com>
+
+struct S {};
+
+void f (void (S::*)()) {}
+void f (void (S::*)() const) {}
diff --git a/gcc/testsuite/g++.old-deja/g++.abi/primary3.C b/gcc/testsuite/g++.old-deja/g++.abi/primary3.C
index ef245ef789e..fbeb2b70b30 100644
--- a/gcc/testsuite/g++.old-deja/g++.abi/primary3.C
+++ b/gcc/testsuite/g++.old-deja/g++.abi/primary3.C
@@ -21,14 +21,24 @@ int main ()
A *apd = &d;
B1 *b1pd = &d;
B2 *b2pd = &d;
+ C *cpd = &d;
#if __GXX_ABI_VERSION >= 100
if (static_cast <void *> (apc) != static_cast <void *> (b1pc))
return 1;
- if (static_cast <void *> (apd) != static_cast <void *> (b1pd))
+ if (static_cast <void *> (&c) != static_cast <void *> (b2pc))
return 2;
- if (static_cast <void *> (apd) != static_cast <void *> (&d))
+ if (static_cast <void *> (b1pc) == static_cast <void *> (b2pc))
return 3;
+
+ if (static_cast <void *> (apd) != static_cast <void *> (b1pd))
+ return 11;
+ if (static_cast <void *> (b2pd) != static_cast <void *> (&d))
+ return 12;
+ if (static_cast <void *> (b2pd) != static_cast <void *> (cpd))
+ return 13;
+ if (static_cast <void *> (b1pd) == static_cast <void *> (b2pd))
+ return 14;
#endif
return 0;
}
diff --git a/gcc/testsuite/g++.old-deja/g++.abi/ptrmem.C b/gcc/testsuite/g++.old-deja/g++.abi/ptrmem.C
index 282fae609b5..38f8177a2a6 100644
--- a/gcc/testsuite/g++.old-deja/g++.abi/ptrmem.C
+++ b/gcc/testsuite/g++.old-deja/g++.abi/ptrmem.C
@@ -1,6 +1,29 @@
// Special g++ Options: -fno-strict-aliasing
// Origin: Mark Mitchell <mark@codesourcery.com>
+/* Generally, the lowest bit of the ptr is used to indicate whether a
+ ptr-to-mem-func points to a virtual or a non-virtual member
+ function. However, some platforms use all bits to encode a
+ function pointer. Such platforms use the lowest bit of the delta,
+ that is shifted left by one bit. */
+#if defined __MN10300__ || defined __arm__ || defined __thumb__
+#define ADJUST_PTRFN(func, virt) ((void (*)())(func))
+#define ADJUST_DELTA(delta, virt) (((delta) << 1) + !!(virt))
+#else
+#define ADJUST_PTRFN(func, virt) ((void (*)())((ptrdiff_t)(func) + !!(virt)))
+#define ADJUST_DELTA(delta, virt) (delta)
+#endif
+
+/* IA64 uses function descriptors instead of function pointers in its
+ vtables, which means that we can't meaningfully compare them directly. */
+#if defined __ia64__
+#define CMP_PTRFN(A, B) (*(void **)(A) == *(void **)(B))
+#define VPTE_SIZE (16)
+#else
+#define CMP_PTRFN(A, B) ((A) == (B))
+#define VPTE_SIZE sizeof(void *)
+#endif
+
#if defined (__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100
// Check that pointers-to-member functions are represented correctly.
@@ -72,28 +95,28 @@ main ()
// There should be no adjustment for the `T' version, and an
// appropriate adjustment for the `S' version.
y = &T::f;
- if (yp->ptr != &_ZN1T1fEv)
+ if (! CMP_PTRFN (yp->ptr, ADJUST_PTRFN (&_ZN1T1fEv, 0)))
return 5;
- if (yp->adj != 0)
+ if (yp->adj != ADJUST_DELTA (0, 0))
return 6;
x = (sp) y;
- if (xp->ptr != &_ZN1T1fEv)
+ if (! CMP_PTRFN (xp->ptr, ADJUST_PTRFN (&_ZN1T1fEv, 0)))
return 7;
- if (xp->adj != delta)
+ if (xp->adj != ADJUST_DELTA (delta, 0))
return 8;
// For a virtual function, we should see the vtable offset, plus
// one. `T::h' is in the second slot: the vtable pointer points to
// the first virtual function.
y = &T::h;
- if ((ptrdiff_t) yp->ptr != sizeof (void *) + 1)
+ if (yp->ptr != ADJUST_PTRFN (VPTE_SIZE, 1))
return 9;
- if (yp->adj != 0)
+ if (yp->adj != ADJUST_DELTA (0, 1))
return 10;
x = (sp) y;
- if ((ptrdiff_t) xp->ptr != sizeof (void *) + 1)
+ if (xp->ptr != ADJUST_PTRFN (VPTE_SIZE, 1))
return 11;
- if (xp->adj != delta)
+ if (xp->adj != ADJUST_DELTA (delta, 1))
return 12;
// Pointers-to-data-members should have the same size and alignment
diff --git a/gcc/testsuite/g++.old-deja/g++.abi/vbase2.C b/gcc/testsuite/g++.old-deja/g++.abi/vbase2.C
new file mode 100644
index 00000000000..f8877eb545f
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.abi/vbase2.C
@@ -0,0 +1,27 @@
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 5 Jun 2001 <nathan@codesourcery.com>
+
+// Bug 3006. Constructor vtables were wrong.
+
+struct A
+{
+ virtual ~A() {}
+};
+
+class B : public virtual A {};
+class C : public virtual B {};
+class D1 : public virtual C {};
+class D2 : public virtual C {};
+class E
+ : public virtual D1,
+ public virtual D2
+{
+};
+
+
+int
+main(int argc, char* argv[])
+{
+ new E;
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.abi/vbase3.C b/gcc/testsuite/g++.old-deja/g++.abi/vbase3.C
new file mode 100644
index 00000000000..9b0ed1c8778
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.abi/vbase3.C
@@ -0,0 +1,26 @@
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 5 Jun 2001 <nathan@codesourcery.com>
+
+// Bug 3061. Constructor vtables were wrong.
+
+class A_base {
+ public:
+ virtual void foo() { }
+};
+class A_skel : virtual public A_base { };
+
+class B_base : virtual public A_base { };
+class B_skel : virtual public B_base, virtual public A_skel { };
+
+class C_base : virtual public B_base { };
+class C_skel : virtual public C_base, virtual public B_skel { };
+
+class D_base : virtual public C_base { };
+class D_skel : virtual public D_base, virtual public C_skel { };
+
+class D_impl : virtual public D_skel { };
+
+int main()
+{
+ D_impl i;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.abi/vbase4.C b/gcc/testsuite/g++.old-deja/g++.abi/vbase4.C
new file mode 100644
index 00000000000..116d79bec65
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.abi/vbase4.C
@@ -0,0 +1,165 @@
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 9 Jun 2001 <nathan@codesourcery.com>
+
+// Bug 3089. We ICE'd in construction vtables.
+
+int failed;
+
+void fail (int val)
+{
+ if (!failed)
+ failed = val;
+}
+
+struct A
+{
+ virtual ~A();
+ A ();
+ virtual void check (void *whole, void *base);
+};
+
+A::A ()
+{
+ check (this, this);
+}
+A::~A ()
+{
+ check (this, this);
+}
+
+void A::check (void *whole, void *base)
+{
+ if (dynamic_cast <void *> (this) != whole)
+ fail (1);
+ else if (this != base)
+ fail (2);
+}
+
+struct B
+{
+ virtual ~B ();
+ B ();
+ virtual void check (void *whole, void *base);
+};
+
+B::B ()
+{
+ check (this, this);
+}
+B::~B ()
+{
+ check (this, this);
+}
+void B::check (void *whole, void *base)
+{
+ if (dynamic_cast <void *> (this) != whole)
+ fail (3);
+ else if (this != base)
+ fail (4);
+}
+
+struct C : virtual public B, virtual public A
+{
+ virtual ~C ();
+ C ();
+ virtual void check (void *whole, void *base);
+};
+C::C ()
+{
+ check (this, this);
+}
+C::~C ()
+{
+ check (this, this);
+}
+void C::check (void *whole, void *base)
+{
+ if (dynamic_cast <void *> (this) != whole)
+ fail (5);
+ else if (this != base)
+ fail (6);
+ A::check (whole, static_cast <A *> (this));
+ B::check (whole, static_cast <B *> (this));
+}
+
+struct D : virtual public A
+{
+ virtual ~D ();
+ D ();
+ virtual void check (void *whole, void *base);
+};
+D::D ()
+{
+ check (this, this);
+}
+D::~D ()
+{
+ check (this, this);
+}
+void D::check (void *whole, void *base)
+{
+ if (dynamic_cast <void *> (this) != whole)
+ fail (5);
+ else if (this != base)
+ fail (6);
+ A::check (whole, static_cast <A *> (this));
+}
+
+struct E : virtual public C, virtual public D
+{
+ virtual ~E ();
+ E ();
+ virtual void check (void *whole, void *base);
+};
+E::E ()
+{
+ check (this, this);
+}
+E::~E ()
+{
+ check (this, this);
+}
+void E::check (void *whole, void *base)
+{
+ if (dynamic_cast <void *> (this) != whole)
+ fail (5);
+ else if (this != base)
+ fail (6);
+ C::check (whole, static_cast <C *> (this));
+ D::check (whole, static_cast <D *> (this));
+}
+
+struct F : virtual public E
+{
+ virtual ~F ();
+ F ();
+ virtual void check (void *whole, void *base);
+};
+F::F ()
+{
+ check (this, this);
+}
+F::~F ()
+{
+ check (this, this);
+}
+void F::check (void *whole, void *base)
+{
+ if (dynamic_cast <void *> (this) != whole)
+ fail (5);
+ else if (this != base)
+ fail (6);
+ E::check (whole, static_cast <F *> (this));
+}
+
+int main ()
+{
+ A a;
+ B b;
+ C c;
+ D d;
+ E e;
+ F f;
+
+ return failed;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.abi/vbase5.C b/gcc/testsuite/g++.old-deja/g++.abi/vbase5.C
new file mode 100644
index 00000000000..6a3bbfbfb4b
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.abi/vbase5.C
@@ -0,0 +1,22 @@
+// Build don't link:
+//
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 12 Jun 2001 <nathan@codesourcery.com>
+
+// 3130. A virtual base can have canonical and non-canonical instances
+// of its primary. The canonical one should be first in dfs order.
+
+struct A
+{
+ virtual ~A ();
+};
+
+struct B
+{
+ virtual ~B ();
+};
+
+
+struct C : virtual public A, virtual public B {};
+class D : public virtual C {};
+class E : public virtual C, public virtual D {};
diff --git a/gcc/testsuite/g++.old-deja/g++.abi/vbase6.C b/gcc/testsuite/g++.old-deja/g++.abi/vbase6.C
new file mode 100644
index 00000000000..e8b959db32c
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.abi/vbase6.C
@@ -0,0 +1,22 @@
+// Build don't link:
+//
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 12 Jun 2001 <nathan@codesourcery.com>
+
+// 3131.
+
+struct A
+{
+ virtual ~A ();
+};
+
+struct B
+{
+ virtual ~B ();
+};
+
+
+struct C : virtual public B {};
+struct D : virtual public A, virtual public C {};
+struct E : public virtual C {};
+struct F : public virtual D, public virtual E {};
diff --git a/gcc/testsuite/g++.old-deja/g++.abi/vbase7.C b/gcc/testsuite/g++.old-deja/g++.abi/vbase7.C
new file mode 100644
index 00000000000..5a4a3b5fdba
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.abi/vbase7.C
@@ -0,0 +1,40 @@
+// Build don't run
+//
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 12 Jun 2001 <nathan@codesourcery.com>
+
+// 3132. A virtual thunk was missing.
+
+struct A
+{
+ int x;
+ virtual ~A() {}
+};
+
+struct B
+{
+ virtual ~B() { }
+};
+
+
+struct C
+{
+ virtual ~C () {}
+};
+
+
+struct D : public virtual A {};
+struct E : virtual public B, virtual public D {};
+struct F : virtual public C, virtual public E {};
+struct G : public virtual E {};
+
+struct H : public virtual F, public virtual G
+{
+ virtual ~H ();
+};
+H::~H() {}
+
+int main ()
+{
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.abi/vbase8-10.C b/gcc/testsuite/g++.old-deja/g++.abi/vbase8-10.C
new file mode 100644
index 00000000000..5275af97f47
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.abi/vbase8-10.C
@@ -0,0 +1,74 @@
+// Special g++ Options: -w
+
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 26 Jul 2001 <nathan@codesourcery.com>
+
+// Origin stefan@space.twc.de
+// Bug 3145 case 10. Horribly complicated class hierarchy
+
+class C0
+{};
+class C1
+ : public C0
+{};
+class C2
+ : public C1
+ , virtual public C0
+{};
+class C3
+ : public C1
+ , public C2
+ , virtual public C0
+{};
+class C4
+ : virtual public C1
+ , virtual public C0
+ , virtual public C3
+ , public C2
+{};
+class C5
+ : public C3
+ , virtual public C0
+ , virtual public C2
+{};
+class C6
+ : public C1
+ , public C2
+ , virtual public C5
+ , virtual public C3
+ , virtual public C0
+{};
+class C7
+ : public C1
+ , virtual public C5
+ , virtual public C4
+ , virtual public C2
+ , virtual public C0
+ , virtual public C6
+{};
+class C8
+ : virtual public C4
+ , public C3
+ , public C0
+ , virtual public C7
+ , virtual public C6
+{};
+class C9
+ : virtual public C0
+ , public C4
+ , public C8
+ , public C1
+ , public C6
+{};
+main() {
+ C0 c0;
+ C1 c1;
+ C2 c2;
+ C3 c3;
+ C4 c4;
+ C5 c5;
+ C6 c6;
+ C7 c7;
+ C8 c8;
+ C9 c9;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.abi/vbase8-21.C b/gcc/testsuite/g++.old-deja/g++.abi/vbase8-21.C
new file mode 100644
index 00000000000..91ef335e04d
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.abi/vbase8-21.C
@@ -0,0 +1,74 @@
+// Special g++ Options: -w
+
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 26 Jul 2001 <nathan@codesourcery.com>
+
+// Origin stefan@space.twc.de
+// Bug 3145 case 21. Horribly complicated class hierarchy
+
+class C0
+{};
+class C1
+ : virtual public C0
+{};
+class C2
+ : virtual public C1
+ , virtual public C0
+{};
+class C3
+ : virtual public C2
+ , virtual public C1
+{};
+class C4
+ : virtual public C2
+ , public C0
+ , public C1
+{};
+class C5
+ : virtual public C0
+ , public C2
+ , virtual public C1
+ , virtual public C3
+ , virtual public C4
+{};
+class C6
+ : virtual public C1
+ , virtual public C3
+ , public C0
+ , public C2
+ , virtual public C4
+{};
+class C7
+ : virtual public C5
+ , public C2
+ , public C6
+ , virtual public C0
+ , public C3
+{};
+class C8
+ : virtual public C5
+ , public C7
+ , virtual public C0
+ , virtual public C2
+ , virtual public C6
+{};
+class C9
+ : virtual public C2
+ , virtual public C4
+ , public C1
+ , virtual public C0
+ , public C7
+ , public C5
+{};
+main() {
+ C0 c0;
+ C1 c1;
+ C2 c2;
+ C3 c3;
+ C4 c4;
+ C5 c5;
+ C6 c6;
+ C7 c7;
+ C8 c8;
+ C9 c9;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.abi/vbase8-22.C b/gcc/testsuite/g++.old-deja/g++.abi/vbase8-22.C
new file mode 100644
index 00000000000..85c56099161
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.abi/vbase8-22.C
@@ -0,0 +1,79 @@
+// Special g++ Options: -w
+
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 27 Jul 2001 <nathan@codesourcery.com>
+
+// Origin stefan@space.twc.de
+// Bug 3145 case 22. Horribly complicated class hierarchy
+
+class C0
+{};
+class C1
+ : public C0
+{};
+class C2
+ : public C1
+ , virtual public C0
+{};
+class C3
+ : virtual public C0
+ , virtual public C2
+ , virtual public C1
+{};
+class C4
+ : virtual public C2
+ , public C1
+ , virtual public C3
+ , public C0
+{};
+class C5
+ : virtual public C0
+ , virtual public C4
+ , public C1
+ , virtual public C2
+ , virtual public C3
+{};
+class C6
+ : public C0
+ , virtual public C1
+ , public C5
+ , public C2
+ , virtual public C3
+ , virtual public C4
+{};
+class C7
+ : virtual public C1
+ , public C5
+ , virtual public C6
+ , virtual public C4
+ , virtual public C3
+ , virtual public C0
+{};
+class C8
+ : virtual public C6
+ , virtual public C1
+ , virtual public C2
+ , public C3
+ , virtual public C4
+{};
+class C9
+ : public C4
+ , virtual public C2
+ , virtual public C8
+ , public C3
+ , public C1
+ , public C6
+ , public C5
+{};
+main() {
+ C0 c0;
+ C1 c1;
+ C2 c2;
+ C3 c3;
+ C4 c4;
+ C5 c5;
+ C6 c6;
+ C7 c7;
+ C8 c8;
+ C9 c9;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.abi/vbase8-5.C b/gcc/testsuite/g++.old-deja/g++.abi/vbase8-5.C
new file mode 100644
index 00000000000..ea96e85c2dc
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.abi/vbase8-5.C
@@ -0,0 +1,79 @@
+// Special g++ Options: -w
+
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 24 Jul 2001 <nathan@codesourcery.com>
+
+// Origin stefan@space.twc.de
+// Bug 3145 case 5. Horribly complicated class hierarchy
+
+class C0
+{};
+class C1
+ : virtual public C0
+{};
+class C2
+ : public C0
+ , virtual public C1
+{};
+class C3
+ : virtual public C0
+ , virtual public C2
+ , public C1
+{};
+class C4
+ : virtual public C0
+ , virtual public C2
+ , virtual public C1
+ , virtual public C3
+{};
+class C5
+ : virtual public C3
+ , virtual public C2
+ , virtual public C0
+ , public C4
+ , virtual public C1
+{};
+class C6
+ : public C0
+ , virtual public C3
+ , public C4
+ , virtual public C5
+ , public C1
+{};
+class C7
+ : virtual public C3
+ , public C5
+ , public C2
+ , virtual public C4
+ , public C6
+ , public C0
+{};
+class C8
+ : virtual public C2
+ , public C5
+ , public C7
+ , public C1
+ , public C0
+ , public C4
+ , public C3
+{};
+class C9
+ : public C3
+ , public C2
+ , virtual public C6
+ , public C8
+ , virtual public C7
+ , public C5
+{};
+main() {
+ C0 c0;
+ C1 c1;
+ C2 c2;
+ C3 c3;
+ C4 c4;
+ C5 c5;
+ C6 c6;
+ C7 c7;
+ C8 c8;
+ C9 c9;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.abi/vbase8-9.C b/gcc/testsuite/g++.old-deja/g++.abi/vbase8-9.C
new file mode 100644
index 00000000000..43bd86a968c
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.abi/vbase8-9.C
@@ -0,0 +1,76 @@
+// Special g++ Options: -ansi -pedantic-errors -w
+
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 14 Jun 2001 <nathan@codesourcery.com>
+
+// Bug 3145, generated by script provided by stefan@space.twc.de
+// This is case number 9
+
+class C0
+{};
+class C1
+ : public C0
+{};
+class C2
+ : public C1
+ , public C0
+{};
+class C3
+ : virtual public C0
+ , public C2
+ , virtual public C1
+{};
+class C4
+ : virtual public C2
+ , public C0
+ , virtual public C3
+ , public C1
+{};
+class C5
+ : public C0
+ , public C1
+ , public C4
+ , virtual public C2
+ , public C3
+{};
+class C6
+ : public C1
+ , public C3
+ , virtual public C5
+ , virtual public C2
+ , public C0
+ , virtual public C4
+{};
+class C7
+ : virtual public C1
+ , virtual public C0
+ , public C6
+ , virtual public C2
+ , public C5
+{};
+class C8
+ : virtual public C1
+ , virtual public C4
+ , public C0
+ , virtual public C7
+ , virtual public C2
+{};
+class C9
+ : virtual public C1
+ , virtual public C6
+ , public C8
+ , virtual public C2
+ , public C0
+{};
+int main() {
+ C0 c0;
+ C1 c1;
+ C2 c2;
+ C3 c3;
+ C4 c4;
+ C5 c5;
+ C6 c6;
+ C7 c7;
+ C8 c8;
+ C9 c9;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.abi/vbase9.C b/gcc/testsuite/g++.old-deja/g++.abi/vbase9.C
new file mode 100644
index 00000000000..171607c7250
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.abi/vbase9.C
@@ -0,0 +1,60 @@
+// Build don't link:
+
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 5 Sept 2001 <nathan@codesourcery.com>
+
+// Bug 3986. Another indirect primary base problem.
+
+struct Consts
+{
+};
+
+struct MathLib :
+ virtual Consts
+{
+};
+
+struct Parallel :
+ virtual Consts
+{
+};
+
+struct Particles :
+ virtual MathLib,
+ virtual Parallel
+{
+};
+
+struct Ring :
+ virtual Particles
+{
+};
+
+struct Injection :
+ virtual Particles,
+ virtual Ring
+{
+};
+
+struct LSpaceCharge :
+ virtual Ring,
+ virtual Injection
+{
+};
+
+struct Bump :
+ virtual Consts
+{
+};
+
+struct Output :
+ virtual Injection,
+ virtual Bump
+{
+};
+
+struct Plots :
+ virtual LSpaceCharge,
+ virtual Output
+{
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.abi/vtable2.C b/gcc/testsuite/g++.old-deja/g++.abi/vtable2.C
index b719c70a533..9847a15a8b8 100644
--- a/gcc/testsuite/g++.old-deja/g++.abi/vtable2.C
+++ b/gcc/testsuite/g++.old-deja/g++.abi/vtable2.C
@@ -1,4 +1,5 @@
// Origin: Mark Mitchell <mark@codesourcery.com>
+// Special g++ Options: -fno-strict-aliasing
#if defined (__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100
@@ -126,6 +127,15 @@ void _ZN2S32s3Ev ();
void _ZN2S42s1Ev ();
}
+// IA-64 uses function descriptors not function pointers in its vtables.
+#if defined __ia64__
+#define CMP_VPTR(A, B) (*(void **)(A) == *(void **)(B))
+#define INC_VPTR(A) ((A) += 2)
+#else
+#define CMP_VPTR(A, B) (*(A) == (ptrdiff_t)(B))
+#define INC_VPTR(A) ((A) += 1)
+#endif
+
int main ()
{
S4 s4;
@@ -147,10 +157,12 @@ int main ()
return 4;
// Skip the RTTI entry.
vtbl++;
- if (*vtbl++ != (ptrdiff_t) &_ZN2S32s3Ev)
+ if (! CMP_VPTR (vtbl, &_ZN2S32s3Ev))
return 5;
- if (*vtbl++ != (ptrdiff_t) &_ZN2S42s1Ev)
+ INC_VPTR (vtbl);
+ if (! CMP_VPTR (vtbl, &_ZN2S42s1Ev))
return 6;
+ INC_VPTR (vtbl);
// The S1 vbase offset.
if (*vtbl++ != 0)
return 7;
@@ -168,8 +180,8 @@ int main ()
// Skip the RTTI entry.
vtbl++;
// Skip the remaining virtual functions -- they are thunks.
- vtbl++;
- vtbl++;
+ INC_VPTR (vtbl);
+ INC_VPTR (vtbl);
}
#else /* !(defined (__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100) */
diff --git a/gcc/testsuite/g++.old-deja/g++.abi/vtable3.h b/gcc/testsuite/g++.old-deja/g++.abi/vtable3.h
index 327d346db27..4327b5f5ac4 100644
--- a/gcc/testsuite/g++.old-deja/g++.abi/vtable3.h
+++ b/gcc/testsuite/g++.old-deja/g++.abi/vtable3.h
@@ -7,11 +7,8 @@
#include <typeinfo>
#include <stdio.h>
-// XXX. vcall offsets are still broken, remove this define to re-enable
-// testing when fixed.
-#define NO_VCALL_TEST
-
int fail;
+struct A;
template <typename BASE, typename DERIVED>
int Test (DERIVED *d, int expect)
@@ -19,6 +16,7 @@ int Test (DERIVED *d, int expect)
BASE *b = static_cast <BASE *> (d);
void *full_b = dynamic_cast <void *> (b);
void *full_d = dynamic_cast <void *> (d);
+ A *ap = static_cast <A *> (b);
if (full_b != full_d)
{
@@ -37,8 +35,8 @@ int Test (DERIVED *d, int expect)
typeid (BASE).name (), typeid (DERIVED).name ());
return 1;
}
-#ifndef NO_VCALL_TEST
- b->Baz (static_cast <void *> (b));
+
+ b->Baz (static_cast <void *> (ap));
int res = b->Foo (static_cast <void *> (d));
@@ -49,7 +47,7 @@ int Test (DERIVED *d, int expect)
typeid (BASE).name (), res, expect);
return 1;
}
-#endif
+
return 0;
}
diff --git a/gcc/testsuite/g++.old-deja/g++.abi/vthunk1.C b/gcc/testsuite/g++.old-deja/g++.abi/vthunk1.C
new file mode 100644
index 00000000000..662050e282a
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.abi/vthunk1.C
@@ -0,0 +1,45 @@
+// Build don't run:
+
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 29 Jul 2001 <nathan@codesourcery.com>
+
+// Origin snyder@fnal.gov
+// Bug 3631. We mis-calculated the non-virtual part of a virtual
+// thunk. Leading to a link failure, in this case.
+
+struct A { virtual ~A () {} };
+
+struct B : virtual public A
+{
+ virtual void destroy() {}
+};
+
+class C : virtual public B {};
+class D : virtual public C {};
+class E : public virtual A {};
+
+struct F : virtual public B, virtual public E
+{
+ virtual void destroy() = 0;
+};
+
+struct G : public virtual F
+{
+ virtual void destroy() {}
+};
+
+class H : virtual public C, virtual public F {};
+class I : virtual public D, virtual public H {};
+class J : public virtual G, public virtual H {};
+
+class K : public virtual I, public virtual J
+{
+ public:
+ virtual ~K();
+};
+K::~K() {}
+
+int main ()
+{
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.benjamin/15071.C b/gcc/testsuite/g++.old-deja/g++.benjamin/15071.C
index d05ba8c00dd..eaa8eeebd10 100644
--- a/gcc/testsuite/g++.old-deja/g++.benjamin/15071.C
+++ b/gcc/testsuite/g++.old-deja/g++.benjamin/15071.C
@@ -2,10 +2,10 @@
// g++/15071
// gcc invocation fails to link in libstdc++
-#include <iostream.h>
+#include <iostream>
int main() {
- cout<<"hi"<<endl;
+ std::cout << "hi" << std::endl;
return 0;
}
diff --git a/gcc/testsuite/g++.old-deja/g++.brendan/copy9.C b/gcc/testsuite/g++.old-deja/g++.brendan/copy9.C
index e1cfb426120..edaf99775de 100644
--- a/gcc/testsuite/g++.old-deja/g++.brendan/copy9.C
+++ b/gcc/testsuite/g++.old-deja/g++.brendan/copy9.C
@@ -1,5 +1,5 @@
// GROUPS passed copy-ctors
-#include <iostream.h>
+#include <iostream>
// token types: from state parser
const int T_EOF = 257;
@@ -35,10 +35,11 @@ main () {
ParseToken b(a);
if (b.doubleval == 23.2)
- cout << "PASS\n";
+ std::cout << "PASS\n";
else
{
- cout << "FAIL\n";
+ std::cout << "FAIL\n";
return 1;
}
}
+
diff --git a/gcc/testsuite/g++.old-deja/g++.brendan/crash15.C b/gcc/testsuite/g++.old-deja/g++.brendan/crash15.C
index 56a7e75b9ba..953144ac5ac 100644
--- a/gcc/testsuite/g++.old-deja/g++.brendan/crash15.C
+++ b/gcc/testsuite/g++.old-deja/g++.brendan/crash15.C
@@ -1,22 +1,22 @@
// Build don't link:
// GROUPS passed old-abort
-#include <iostream.h>
+#include <iostream>
class A {
public:
- virtual ~A() {cout << "executed ~A()\n";};
+ virtual ~A() {std::cout << "executed ~A()\n";};
};
class B : public A {
public:
- virtual ~B() {cout << "executed ~B()\n";};
+ virtual ~B() {std::cout << "executed ~B()\n";};
};
int
main() {
- cout << "starting\n";
+ std::cout << "starting\n";
B b;
b.~A();// ERROR - destructor
- cout << "done\n";
+ std::cout << "done\n";
};
diff --git a/gcc/testsuite/g++.old-deja/g++.brendan/crash38.C b/gcc/testsuite/g++.old-deja/g++.brendan/crash38.C
index eeb70e1c373..5f0cf9bd2c2 100644
--- a/gcc/testsuite/g++.old-deja/g++.brendan/crash38.C
+++ b/gcc/testsuite/g++.old-deja/g++.brendan/crash38.C
@@ -8,7 +8,7 @@
main.cc: Please report this to 'bug-g++@prep.ai.mit.edu'
*/
-#include <stream.h>
+#include <iostream>
class INTEGER {
int x;
@@ -16,7 +16,7 @@ public:
typedef int BASE;
INTEGER(int y) : x(y) {}
INTEGER() {}
- void encode() { cout << "Integer encoder";}
+ void encode() { std::cout << "Integer encoder";}
int operator=(int y) { x=y; return x; }
operator int() {return x; }
};
diff --git a/gcc/testsuite/g++.old-deja/g++.brendan/crash49.C b/gcc/testsuite/g++.old-deja/g++.brendan/crash49.C
index 98a580d3cb1..3f2e2256e35 100644
--- a/gcc/testsuite/g++.old-deja/g++.brendan/crash49.C
+++ b/gcc/testsuite/g++.old-deja/g++.brendan/crash49.C
@@ -1,12 +1,12 @@
// Build don't link:
// GROUPS passed old-abort
-#include<iostream.h>
+#include<iostream>
const int keys = 10;
const int key[keys] = {6, key[1], 2, keys, 1, 7, 6, key[2], key[8]};
void main()
{ // ERROR - return type for main
- for(int i = 0; i < keys;) cout << key[i++] << " ";
- endl(cout);
+ for(int i = 0; i < keys;) std::cout << key[i++] << " ";
+ std::endl(std::cout);
}
diff --git a/gcc/testsuite/g++.old-deja/g++.brendan/crash52.C b/gcc/testsuite/g++.old-deja/g++.brendan/crash52.C
index b4daa9de702..e8c51e8be2f 100644
--- a/gcc/testsuite/g++.old-deja/g++.brendan/crash52.C
+++ b/gcc/testsuite/g++.old-deja/g++.brendan/crash52.C
@@ -1,7 +1,7 @@
// Build don't link:
// GROUPS passed old-abort
// Special g++ Options: -Wreturn-type
-#include <iostream.h>
+#include <iostream>
class A {
public:
@@ -9,6 +9,6 @@ public:
};
A &f(A &a) {// ERROR - new decl.*
- cout << "Blah\n";
+ std::cout << "Blah\n";
} // ERROR - non-void function
diff --git a/gcc/testsuite/g++.old-deja/g++.brendan/crash62.C b/gcc/testsuite/g++.old-deja/g++.brendan/crash62.C
index 77b9fc84763..c86f9e6bb4a 100644
--- a/gcc/testsuite/g++.old-deja/g++.brendan/crash62.C
+++ b/gcc/testsuite/g++.old-deja/g++.brendan/crash62.C
@@ -1,11 +1,11 @@
// Build don't link:
// GROUPS passed old-abort
-#include <iostream.h>
+#include <iostream>
void
- fubar(ostream* out, const char* string)
+ fubar(std::ostream* out, const char* s)
{
- (*out) << string << endl;
+ (*out) << s << std::endl;
return;
}
@@ -14,8 +14,8 @@
{
// Declare a ref and a pointer to the same ostream.
//
- ostream* out = &cerr;
- ostream& die = cerr;
+ std::ostream* out = &std::cerr;
+ std::ostream& die = std::cerr;
// Valid call to fubar.
//
diff --git a/gcc/testsuite/g++.old-deja/g++.brendan/cvt1.C b/gcc/testsuite/g++.old-deja/g++.brendan/cvt1.C
index 57f3b426108..4574a367254 100644
--- a/gcc/testsuite/g++.old-deja/g++.brendan/cvt1.C
+++ b/gcc/testsuite/g++.old-deja/g++.brendan/cvt1.C
@@ -1,6 +1,6 @@
// Build don't link:
// GROUPS passed conversions
-#include <iostream.h>
+#include <iostream>
class Thing
{
@@ -39,6 +39,6 @@ main (int argc, char** argv)
Group g (Group::THIS_GROUP) ;
g += new Thing (Thing::GOOD_THING) ;
- cout << "Group type is " << (Group::GroupType) g << endl ;
+ std::cout << "Group type is " << (Group::GroupType) g << std::endl ;
return 0 ;
}
diff --git a/gcc/testsuite/g++.old-deja/g++.brendan/err-msg3.C b/gcc/testsuite/g++.old-deja/g++.brendan/err-msg3.C
index 1d115e6c46a..76a084090ae 100644
--- a/gcc/testsuite/g++.old-deja/g++.brendan/err-msg3.C
+++ b/gcc/testsuite/g++.old-deja/g++.brendan/err-msg3.C
@@ -1,7 +1,7 @@
// Build don't link:
// GROUPS passed error-messages
-#include <fstream.h>
-#include <iomanip.h>
+#include <fstream>
+#include <iomanip>
// This error should not appear:
// bug.C: In method `test::test(const class test &)':
diff --git a/gcc/testsuite/g++.old-deja/g++.brendan/misc13.C b/gcc/testsuite/g++.old-deja/g++.brendan/misc13.C
deleted file mode 100644
index c2c8bc5601b..00000000000
--- a/gcc/testsuite/g++.old-deja/g++.brendan/misc13.C
+++ /dev/null
@@ -1,11 +0,0 @@
-// Build don't link:
-// GROUPS passed miscellaneous-bugs
-// This should only give warnings from duplicate_decls; it should not get
-// errors from push_overloaded_decl as well.
-
-namespace std {
-extern "C"
-{
- long unsigned int strlen(char*);// ERROR - warning// ERROR - warning.*
-}
-}
diff --git a/gcc/testsuite/g++.old-deja/g++.brendan/nest21.C b/gcc/testsuite/g++.old-deja/g++.brendan/nest21.C
index cce10c44cbd..03d3f32ad74 100644
--- a/gcc/testsuite/g++.old-deja/g++.brendan/nest21.C
+++ b/gcc/testsuite/g++.old-deja/g++.brendan/nest21.C
@@ -1,7 +1,7 @@
// GROUPS passed nested-classes
-#include <iostream.h>
-#include <stdio.h>
-#include <string.h>
+#include <iostream>
+#include <cstdio>
+#include <cstring>
static char output[1024];
@@ -32,44 +32,44 @@ public:
BDDRetrace::Dump&
BDDRetrace::Dump1::operator<<(char c)
{ char tempout[1024];
- sprintf (tempout, "%s%s%c", output, "1-", c);
- strcpy (output, tempout);
+ std::sprintf(tempout, "%s%s%c", output, "1-", c);
+ std::strcpy(output, tempout);
return *this;
}
BDDRetrace::Dump&
BDDRetrace::Dump1::operator<<(int i)
{ char tempout[1024];
- sprintf (tempout, "%s%s%d", output, "1-", i);
- strcpy (output, tempout);
+ std::sprintf (tempout, "%s%s%d", output, "1-", i);
+ std::strcpy (output, tempout);
return *this; }
BDDRetrace::Dump&
BDDRetrace::Dump1::operator<<(double r)
{ char tempout[1024];
- sprintf (tempout, "%s%s%1.0f", output, "1-", r);
- strcpy (output, tempout);
+ std::sprintf (tempout, "%s%s%1.0f", output, "1-", r);
+ std::strcpy (output, tempout);
return *this; }
BDDRetrace::Dump&
Dump2::operator<<(char c)
{ char tempout[1024];
- sprintf (tempout, "%s%s%c", output, "2-", c);
- strcpy (output, tempout);
+ std::sprintf (tempout, "%s%s%c", output, "2-", c);
+ std::strcpy (output, tempout);
return *this; }
BDDRetrace::Dump&
Dump2::operator<<(int i)
{ char tempout[1024];
- sprintf (tempout, "%s%s%d", output, "2-", i);
- strcpy (output, tempout);
+ std::sprintf (tempout, "%s%s%d", output, "2-", i);
+ std::strcpy (output, tempout);
return *this; }
BDDRetrace::Dump&
Dump2::operator<<(double r)
{ char tempout[1024];
- sprintf (tempout, "%s%s%1.0f", output, "2-", r);
- strcpy (output, tempout);
+ std::sprintf (tempout, "%s%s%1.0f", output, "2-", r);
+ std::strcpy (output, tempout);
return *this; }
int main()
@@ -77,7 +77,7 @@ int main()
BDDRetrace::Dump1 d1;
Dump2 d2;
- sprintf (output, " ");
+ std::sprintf (output, " ");
d1 << 'a';
d1 << 1;
@@ -87,10 +87,10 @@ int main()
d2 << 1;
d2 << 1.0;
- if (strcmp (output, " 1-a1-11-12-a2-12-1") == 0)
- printf ("PASS\n");
+ if (std::strcmp (output, " 1-a1-11-12-a2-12-1") == 0)
+ std::printf ("PASS\n");
else
- { printf ("FAIL\n"); return 1; }
+ { std::printf ("FAIL\n"); return 1; }
return 0;
}
diff --git a/gcc/testsuite/g++.old-deja/g++.brendan/ptolemy2.C b/gcc/testsuite/g++.old-deja/g++.brendan/ptolemy2.C
index 4fd7e184323..0d053c2cda7 100644
--- a/gcc/testsuite/g++.old-deja/g++.brendan/ptolemy2.C
+++ b/gcc/testsuite/g++.old-deja/g++.brendan/ptolemy2.C
@@ -1,5 +1,5 @@
// GROUPS passed ptolemy-bugs
-#include <iostream.h>
+#include <iostream>
class PTcl {
public:
@@ -45,19 +45,19 @@ void printargs(char** argv) {
}
int PTcl::one(int, char** argv) {
- cout << "FAIL\n";
+ std::cout << "FAIL\n";
printargs(argv);
return 1;
}
int PTcl::two(int, char** argv) {
- cout << "PASS\n";
+ std::cout << "PASS\n";
printargs(argv);
return 0;
}
int PTcl::three(int, char** argv) {
- cout << "FAIL\n";
+ std::cout << "FAIL\n";
printargs(argv);
return 1;
}
diff --git a/gcc/testsuite/g++.old-deja/g++.eh/catch13.C b/gcc/testsuite/g++.old-deja/g++.eh/catch13.C
new file mode 100644
index 00000000000..47a0c90b963
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.eh/catch13.C
@@ -0,0 +1,19 @@
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Jakub Jelinek 2 May 2001 <jakub@redhat.com>
+
+// Build don't link:
+// Special g++ Options: -O2
+
+struct A;
+
+A *foo();
+
+struct A {
+ A *a() { try { return foo(); } catch (...) {} }
+ void b();
+ void c();
+};
+
+void A::b() {
+ a()->c();
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.eh/catch14.C b/gcc/testsuite/g++.old-deja/g++.eh/catch14.C
new file mode 100644
index 00000000000..96be4640bad
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.eh/catch14.C
@@ -0,0 +1,33 @@
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Jakub Jelinek 2 May 2001 <jakub@redhat.com>
+
+// Build don't link:
+// Special g++ Options: -O1
+
+void foo();
+
+struct A {
+ A (int x) { };
+ ~A() {
+ try {
+ foo ();
+ } catch (...) { }
+ };
+};
+
+struct B;
+
+B *x;
+
+struct B {
+ void a();
+ void b();
+ static B* c() {
+ A y = 0;
+ return x;
+ };
+};
+
+void B::a() {
+ c()->b();
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.eh/crash3.C b/gcc/testsuite/g++.old-deja/g++.eh/crash3.C
index b55e1ecf8d6..75287bf80aa 100644
--- a/gcc/testsuite/g++.old-deja/g++.eh/crash3.C
+++ b/gcc/testsuite/g++.old-deja/g++.eh/crash3.C
@@ -1,6 +1,6 @@
// Build don't link:
// Origin: Marc Espie <Marc.Espie@liafa.jussieu.fr>
-// Special g++ Options: -fsjlj-exceptions
+// Used to use -fsjlj-exceptions, but that isn't an option anymore.
extern double f(double a);
diff --git a/gcc/testsuite/g++.old-deja/g++.eh/crash5.C b/gcc/testsuite/g++.old-deja/g++.eh/crash5.C
new file mode 100644
index 00000000000..ef476bf1d3f
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.eh/crash5.C
@@ -0,0 +1,12 @@
+// Build don't link:
+// Origin: Mark Mitchell <mark@codesourcery.com>
+
+int i;
+int j;
+
+void
+f ()
+{
+ j = j + (i ? 7 : throw 1);
+}
+
diff --git a/gcc/testsuite/g++.old-deja/g++.eh/crash6.C b/gcc/testsuite/g++.old-deja/g++.eh/crash6.C
new file mode 100644
index 00000000000..1f5dccedc5e
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.eh/crash6.C
@@ -0,0 +1,26 @@
+// Build don't link:
+//
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 26 April 2001 <nathan@codesourcery.com>
+// Origin: schmid@snake.iap.physik.tu-darmstadt.de
+
+// Bug 2368. When checking shadowed catchers, we didn't ignore
+// template type parms etc, leading to an ICE
+
+template<class CatchType1, class CatchType2>
+void call(int& a)
+{
+ try
+ {
+
+ }
+ catch (CatchType1&)
+ {
+
+ }
+ catch (CatchType2&)
+ {
+
+ }
+}
+
diff --git a/gcc/testsuite/g++.old-deja/g++.eh/new1.C b/gcc/testsuite/g++.old-deja/g++.eh/new1.C
index 1671dbbe7de..788a39b2958 100644
--- a/gcc/testsuite/g++.old-deja/g++.eh/new1.C
+++ b/gcc/testsuite/g++.old-deja/g++.eh/new1.C
@@ -1,8 +1,8 @@
// Test that a throw in foo destroys the A, but does not free the memory.
-#include <stddef.h>
-#include <stdlib.h>
-#include <new.h>
+#include <cstddef>
+#include <cstdlib>
+#include <new>
struct A {
A();
@@ -34,11 +34,15 @@ void foo (B*) { throw 1; }
void* operator new (size_t size) throw (std::bad_alloc)
{
++newed;
- return (void *) malloc (size);
+ return (void *) std::malloc (size);
}
void operator delete (void *p) throw ()
{
--newed;
- free (p);
+ std::free (p);
}
+
+
+
+
diff --git a/gcc/testsuite/g++.old-deja/g++.eh/new2.C b/gcc/testsuite/g++.old-deja/g++.eh/new2.C
index ddc8ba82e58..316afffbfc6 100644
--- a/gcc/testsuite/g++.old-deja/g++.eh/new2.C
+++ b/gcc/testsuite/g++.old-deja/g++.eh/new2.C
@@ -1,8 +1,8 @@
// Test that a throw in B's constructor destroys the A and frees the memory.
-#include <stddef.h>
-#include <stdlib.h>
-#include <new.h>
+#include <cstddef>
+#include <cstdlib>
+#include <new>
struct A {
A();
@@ -35,7 +35,7 @@ void foo (B*) { }
void* operator new (size_t size) throw (std::bad_alloc)
{
++newed;
- return (void *) malloc (size);
+ return (void *) std::malloc (size);
}
void operator delete (void *p) throw ()
@@ -43,3 +43,4 @@ void operator delete (void *p) throw ()
--newed;
free (p);
}
+
diff --git a/gcc/testsuite/g++.old-deja/g++.eh/spec7.C b/gcc/testsuite/g++.old-deja/g++.eh/spec7.C
new file mode 100644
index 00000000000..1945b84aec7
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.eh/spec7.C
@@ -0,0 +1,19 @@
+// Test that we allow simple throw specs on pointers.
+
+void f() throw () { }
+void (*pf)() throw () = f;
+
+struct A
+{
+ void g() throw () { }
+ static void (A::*pmf)() throw ();
+};
+
+void (A::* A::pmf)() = &A::g;
+
+int main()
+{
+ pf ();
+ A a;
+ (a.*A::pmf)();
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.eh/vbase3.C b/gcc/testsuite/g++.old-deja/g++.eh/vbase3.C
index 7cffa6c0cb0..364eca61d11 100644
--- a/gcc/testsuite/g++.old-deja/g++.eh/vbase3.C
+++ b/gcc/testsuite/g++.old-deja/g++.eh/vbase3.C
@@ -1,5 +1,5 @@
// Build don't link:
-// Special g++ Options: -fsjlj-exceptions
+// Used to use -fsjlj-exceptions, but that isn't an option anymore.
// Origin: Donn Terry <donn@interix.com>
struct ios {
diff --git a/gcc/testsuite/g++.old-deja/g++.ext/anon3.C b/gcc/testsuite/g++.old-deja/g++.ext/anon3.C
new file mode 100644
index 00000000000..f4b99036629
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.ext/anon3.C
@@ -0,0 +1,36 @@
+// Build don't link:
+
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 6 Jun 2001 <nathan@codesourcery.com>
+
+// Bug 2914. New types can be created in a static member
+// initializer. These should not be injected into the member's class's
+// scope.
+
+class DoubleSupport
+{
+ public:
+ static void toDouble();
+
+ static const double s_NaN;
+ static const double s_positiveInfinity;
+ static const double s_negativeInfinity;
+ static const double s_positiveZero;
+ static const double s_negativeZero;
+ static const unsigned long* s_NaNFirstDWORD;
+ static const unsigned long* s_NaNSecondDWORD;
+};
+
+const double DoubleSupport::s_positiveInfinity =
+(__extension__ ((union { unsigned char __c[8]; double __d; })
+ { __c: { 0, 0, 0, 0, 0, 0, 0xf0, 0x7f } }).__d);
+
+struct other
+{
+};
+
+
+void
+DoubleSupport::toDouble()
+{
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.ext/arrnew.C b/gcc/testsuite/g++.old-deja/g++.ext/arrnew.C
index ef051d265a0..0ecb8777e26 100644
--- a/gcc/testsuite/g++.old-deja/g++.ext/arrnew.C
+++ b/gcc/testsuite/g++.old-deja/g++.ext/arrnew.C
@@ -2,4 +2,6 @@
// Build don't link:
// Special g++ Options:
- int *f(){ return new int[1] = { 1 }; }
+int *f(){
+ return new int[1] = { 1 }; // WARNING - deprecated
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.ext/attrib5.C b/gcc/testsuite/g++.old-deja/g++.ext/attrib5.C
index 62f35e87468..191fede6389 100644
--- a/gcc/testsuite/g++.old-deja/g++.ext/attrib5.C
+++ b/gcc/testsuite/g++.old-deja/g++.ext/attrib5.C
@@ -1,5 +1,5 @@
// Test that attributes weak and alias coexist.
-// excess errors test - XFAIL alpha*-dec-osf* *-*-hms
+// excess errors test - XFAIL alpha*-dec-osf* *-*-hms hppa*-*-hpux*
extern "C" {
void f () __attribute__((weak, alias ("_f")));
diff --git a/gcc/testsuite/g++.old-deja/g++.ext/comint1.C b/gcc/testsuite/g++.old-deja/g++.ext/comint1.C
index 1b8b3c81c45..78d99e6c357 100644
--- a/gcc/testsuite/g++.old-deja/g++.ext/comint1.C
+++ b/gcc/testsuite/g++.old-deja/g++.ext/comint1.C
@@ -1,5 +1,4 @@
// Test that we can use mixins with COM classes.
-// Special g++ Options: -fvtable-thunks
struct A
{
diff --git a/gcc/testsuite/g++.old-deja/g++.ext/instantiate1.C b/gcc/testsuite/g++.old-deja/g++.ext/instantiate1.C
index 8d5457f5944..8e0fbe073fd 100644
--- a/gcc/testsuite/g++.old-deja/g++.ext/instantiate1.C
+++ b/gcc/testsuite/g++.old-deja/g++.ext/instantiate1.C
@@ -13,12 +13,22 @@ template <class T> struct A {
template <class T> void A<T>::f () { }
extern template struct A<int>;
+// These functions must be defined in a single line, so that, even if
+// constants or pointers are placed in the code section (for example,
+// on the SH), we still get the same line numbers.
+
+void test_f_int () { f(42); } // ERROR - not instantiated
+
+void test_A_int_f () { A<int> a; a.f (); } // ERROR - not instantiated
+
+void test_f_double () { f (2.0); } // gets bogus error
+
+void test_A_double_f () { A<double> b; b.f (); } // gets bogus error
+
int main ()
{
- f (42); // ERROR - not instantiated
- A<int> a;
- a.f (); // ERROR - not instantiated
- f (2.0); // gets bogus error
- A<double> b;
- b.f (); // gets bogus error
+ test_f_int ();
+ test_A_int_f ();
+ test_f_double ();
+ test_A_double_f ();
}
diff --git a/gcc/testsuite/g++.old-deja/g++.ext/instantiate2.C b/gcc/testsuite/g++.old-deja/g++.ext/instantiate2.C
index 0b3dc24ea4c..805233248b2 100644
--- a/gcc/testsuite/g++.old-deja/g++.ext/instantiate2.C
+++ b/gcc/testsuite/g++.old-deja/g++.ext/instantiate2.C
@@ -10,10 +10,18 @@ template <class T> struct A {
template <class T> T A<T>::t = 0;
static template struct A<int>;
+// These functions must be defined in a single line, so that, even if
+// constants or pointers are placed in the code section (for example,
+// on the SH), we still get the same line numbers.
+
+void test_int() { A<int>::t = 42; } // gets bogus error
+
+void test_char() { A<char>::t = 42; } // ERROR - not instantiated XFAIL *-*-irix* *-*-hpux*
+// Irix's default linker does not produce line numbers so XFAIL it.
+// Similarly for HP's linker
+
int main ()
{
- A<int>::t = 42; // gets bogus error
- A<char>::t = 42; // ERROR - not instantiated XFAIL mips*-*-*
- // Irix's default linker does not
- // produce line numbers so XFAIL it.
+ test_int ();
+ test_char ();
}
diff --git a/gcc/testsuite/g++.old-deja/g++.ext/instantiate3.C b/gcc/testsuite/g++.old-deja/g++.ext/instantiate3.C
index 92ad16dfd45..18d5a579c88 100644
--- a/gcc/testsuite/g++.old-deja/g++.ext/instantiate3.C
+++ b/gcc/testsuite/g++.old-deja/g++.ext/instantiate3.C
@@ -10,9 +10,10 @@ template <class T> struct A {
inline template struct A<int>;
A<int> a; // gets bogus error
-A<char> b; // ERROR - not instantiated XFAIL mips*-*-*
+A<char> b; // ERROR - not instantiated XFAIL mips*-*-* *-*-hpux*
// Irix's default linker does not
// produce line numbers so XFAIL it.
+ // Similarly for HPUX.
int main ()
{
diff --git a/gcc/testsuite/g++.old-deja/g++.ext/overload1.C b/gcc/testsuite/g++.old-deja/g++.ext/overload1.C
new file mode 100644
index 00000000000..d99e04fecb8
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.ext/overload1.C
@@ -0,0 +1,20 @@
+// Build don't link:
+// Special g++ Options: -fpermissive
+
+// Copyright (C) 2000 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 28 Feb 2001 <nathan@codesourcery.com>
+
+// Make sure we warn about our overload extension about picking the
+// one with the least worse conversion
+
+struct X
+{
+ X (int);
+};
+void Foo (int, float, bool);
+void Foo (float, int, X);
+
+void Baz ()
+{
+ Foo (1, 1, 0); // WARNING - least worse
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.ext/realpt1.C b/gcc/testsuite/g++.old-deja/g++.ext/realpt1.C
index 7e8ea9164bc..0bfc6408692 100644
--- a/gcc/testsuite/g++.old-deja/g++.ext/realpt1.C
+++ b/gcc/testsuite/g++.old-deja/g++.ext/realpt1.C
@@ -2,17 +2,17 @@
// Special g++ Options:
// Origin: Mark Mitchell <mark@codesourcery.com>
-template <double d>
+template <double d> // WARNING - deprecated
struct S;
-template <double d, double e>
-void f (S<d>*, S<e>*, S<d + e>*);
+template <double d, double e> // WARNING - deprecated
+void f (S<d>*, S<e>*, S<d + e>*); // WARNING - deprecated
void g ()
{
- S<2.0>* s1;
- S<3.7>* s2;
- S<5.7>* s3;
+ S<2.0>* s1; // WARNING - deprecated
+ S<3.7>* s2; // WARNING - deprecated
+ S<5.7>* s3; // WARNING - deprecated
f (s1, s2, s3);
}
diff --git a/gcc/testsuite/g++.old-deja/g++.jason/2371.C b/gcc/testsuite/g++.old-deja/g++.jason/2371.C
index 5e45071e6ea..a982d4042e4 100644
--- a/gcc/testsuite/g++.old-deja/g++.jason/2371.C
+++ b/gcc/testsuite/g++.old-deja/g++.jason/2371.C
@@ -7,12 +7,12 @@
// Wendell Baker, Berkeley CAD Group, 1993 (wbaker@ic.Berkeley.EDU)
//
-
#pragma implementation "ListS.h"
#pragma implementation "SetLS.h"
-#include <stdlib.h>
-#include <iostream.h>
+#include <cstdlib>
+#include <iostream>
+using namespace std;
# 1 "../../templates/SetLS.h" 1
// -*- C++ -*-
diff --git a/gcc/testsuite/g++.old-deja/g++.jason/template24.C b/gcc/testsuite/g++.old-deja/g++.jason/template24.C
index 120b717eddd..3315d182c42 100644
--- a/gcc/testsuite/g++.old-deja/g++.jason/template24.C
+++ b/gcc/testsuite/g++.old-deja/g++.jason/template24.C
@@ -1,6 +1,6 @@
// Bug: g++ doesn't find the conversion from ostream_withassign to ostream.
-#include <iostream.h>
+#include <iostream>
template <class T>
struct A {
@@ -8,7 +8,7 @@ struct A {
};
template <class T>
-ostream & operator<< (ostream & os, A<T> & a)
+std::ostream & operator<< (std::ostream & os, A<T> & a)
{
os << a.t;
return os;
@@ -17,5 +17,6 @@ ostream & operator<< (ostream & os, A<T> & a)
int main ()
{
A<int> a = { 1 };
- cout << a << endl;
+ std::cout << a << std::endl;
}
+
diff --git a/gcc/testsuite/g++.old-deja/g++.jason/template31.C b/gcc/testsuite/g++.old-deja/g++.jason/template31.C
index 6fc0e4b5eca..15e91fde7f7 100644
--- a/gcc/testsuite/g++.old-deja/g++.jason/template31.C
+++ b/gcc/testsuite/g++.old-deja/g++.jason/template31.C
@@ -1,6 +1,6 @@
// PRMS Id: 8569
-#include <iostream.h>
+#include <iostream>
#include <vector>
using std::vector;
@@ -33,10 +33,15 @@ private:
int main(int argc, char**argv) {
IncludeIt foo;
IncludeIt* bar;
- exit(0);
+ std::exit(0);
}
template class std::__malloc_alloc_template<0>;
#ifndef __USE_MALLOC
template class std::__default_alloc_template<false, 0>;
#endif
+
+
+
+
+
diff --git a/gcc/testsuite/g++.old-deja/g++.jason/thunk1.C b/gcc/testsuite/g++.old-deja/g++.jason/thunk1.C
index 22c0516f1b3..a46d356a6c0 100644
--- a/gcc/testsuite/g++.old-deja/g++.jason/thunk1.C
+++ b/gcc/testsuite/g++.old-deja/g++.jason/thunk1.C
@@ -1,5 +1,4 @@
// Test that non-variadic function calls using thunks work right.
-// Special g++ Options: -fvtable-thunks
struct A {
void* p;
@@ -38,7 +37,7 @@ void* test(MMixin& anExample)
return anExample.MixinFunc(1,A(0)).p;
}
-main ()
+int main ()
{
CExample c;
diff --git a/gcc/testsuite/g++.old-deja/g++.jason/thunk2.C b/gcc/testsuite/g++.old-deja/g++.jason/thunk2.C
index 73bb0ff33b1..3df566a68cc 100644
--- a/gcc/testsuite/g++.old-deja/g++.jason/thunk2.C
+++ b/gcc/testsuite/g++.old-deja/g++.jason/thunk2.C
@@ -1,6 +1,6 @@
// Test that non-variadic function calls using thunks and PIC work right.
// Skip if not native
-// Special g++ Options: -fvtable-thunks -fPIC
+// Special g++ Options: -fPIC
// excess errors test - XFAIL m68k-motorola-sysv m88k-motorola-sysv3
struct A {
diff --git a/gcc/testsuite/g++.old-deja/g++.jason/thunk3.C b/gcc/testsuite/g++.old-deja/g++.jason/thunk3.C
index 79c0bd96e3a..8833348230d 100644
--- a/gcc/testsuite/g++.old-deja/g++.jason/thunk3.C
+++ b/gcc/testsuite/g++.old-deja/g++.jason/thunk3.C
@@ -2,7 +2,6 @@
// Note that this will break on any target that uses the generic thunk
// support, because it doesn't support variadic functions.
-// Special g++ Options: -fvtable-thunks
// excess errors test - XFAIL mips*-*-* rs6000-*-* powerpc-*-eabi m68k-*-coff m68k-motorola-sysv m88k-motorola-sysv3 mn10300-*-* mn10200-*-* v850-*-* sh-*-* h8*-*-*
#include <stdarg.h>
@@ -50,7 +49,7 @@ void* test(MMixin& anExample)
return anExample.MixinFunc(1,2,3,4,5,6,7,8,9).p;
}
-main ()
+int main ()
{
CExample c;
diff --git a/gcc/testsuite/g++.old-deja/g++.jason/typeid1.C b/gcc/testsuite/g++.old-deja/g++.jason/typeid1.C
index f6cd45bc664..0f44cb75ed1 100644
--- a/gcc/testsuite/g++.old-deja/g++.jason/typeid1.C
+++ b/gcc/testsuite/g++.old-deja/g++.jason/typeid1.C
@@ -1,11 +1,11 @@
#include <typeinfo>
-#include <iostream.h>
+#include <iostream>
struct foo { double f(int); };
int main() {
double f (int);
const std::type_info &r = typeid (f);
- cout << typeid(f).name() << endl;
- cout << typeid(foo::f).name() << endl;
+ std::cout << typeid(f).name() << std::endl;
+ std::cout << typeid(foo::f).name() << std::endl;
}
diff --git a/gcc/testsuite/g++.old-deja/g++.law/arg1.C b/gcc/testsuite/g++.old-deja/g++.law/arg1.C
index 1712f932f13..e017ea0e12a 100644
--- a/gcc/testsuite/g++.old-deja/g++.law/arg1.C
+++ b/gcc/testsuite/g++.old-deja/g++.law/arg1.C
@@ -5,18 +5,18 @@
// From: kondo@akane.mech.ibaraki.ac.jp
// Date: Fri, 04 Sep 92 17:41:05 JST
-#include <iostream.h>
+#include <iostream>
// check the order of declarations
class A {
public:
- void f(double* p) { cout << "A(double*)\n"; } // ERROR - candidate
- void f(int* p) { cout << "A(int*)\n"; } // ERROR - candidate
+ void f(double* p) { std::cout << "A(double*)\n"; } // ERROR - candidate
+ void f(int* p) { std::cout << "A(int*)\n"; } // ERROR - candidate
};
class B {
public:
- void f(int* p) { cout << "B(int*)\n"; } // ERROR - candidate
- void f(double* p) { cout << "B(double*)\n"; } // ERROR - candidate
+ void f(int* p) { std::cout << "B(int*)\n"; } // ERROR - candidate
+ void f(double* p) { std::cout << "B(double*)\n"; } // ERROR - candidate
};
int main()
@@ -27,3 +27,4 @@ int main()
a.f(0);// ERROR - .*
b.f(0);// ERROR - .*
}
+
diff --git a/gcc/testsuite/g++.old-deja/g++.law/arg8.C b/gcc/testsuite/g++.old-deja/g++.law/arg8.C
index 802471bae47..5f7360d5e49 100644
--- a/gcc/testsuite/g++.old-deja/g++.law/arg8.C
+++ b/gcc/testsuite/g++.old-deja/g++.law/arg8.C
@@ -6,22 +6,22 @@
// Date: Thu, 8 Jul 93 11:47:28 MDT
-#include <iostream.h>
-#include <stdio.h>
+#include <iostream>
+#include <cstdio>
// With this declaration the program will not link.
-template <class Type> ostream & save(ostream & os, Type T);
+template <class Type> std::ostream & save(std::ostream & os, Type T);
- template <class Type> ostream &
-save(ostream & os, Type T) {
+ template <class Type> std::ostream &
+save(std::ostream & os, Type T) {
return os << T;
} // save
int
main() {
int i = 10;
- save((ostream &)cout, i) << endl;
+ save((std::ostream &)std::cout, i) << std::endl;
short int s = 5;
- save((ostream &)cout, s) << endl;
- printf ("PASS\n");
+ save((std::ostream &)std::cout, s) << std::endl;
+ std::printf ("PASS\n");
} // main
diff --git a/gcc/testsuite/g++.old-deja/g++.law/arm12.C b/gcc/testsuite/g++.old-deja/g++.law/arm12.C
index 89e2a4d2c82..49d39d5a4db 100644
--- a/gcc/testsuite/g++.old-deja/g++.law/arm12.C
+++ b/gcc/testsuite/g++.old-deja/g++.law/arm12.C
@@ -5,7 +5,7 @@
// Subject: Bad access control with private constructor and derivation
// Date: Fri, 28 May 1993 12:39:57 -0400 (EDT)
-#include <iostream.h>
+#include <iostream>
class X
{
@@ -24,17 +24,17 @@ public:
X::X()
{// ERROR - .*
- cout << "X::X()" << endl;
+ std::cout << "X::X()" << std::endl;
}
void X::f()
{
- cout << "X::f()" << endl;
+ std::cout << "X::f()" << std::endl;
}
Y::Y()
{// ERROR - within this
- cout << "Y::Y()" << endl;
+ std::cout << "Y::Y()" << std::endl;
}
@@ -45,3 +45,5 @@ int main()
}
+
+
diff --git a/gcc/testsuite/g++.old-deja/g++.law/arm9.C b/gcc/testsuite/g++.old-deja/g++.law/arm9.C
index 35658b17cbc..7e79fdcdc56 100644
--- a/gcc/testsuite/g++.old-deja/g++.law/arm9.C
+++ b/gcc/testsuite/g++.old-deja/g++.law/arm9.C
@@ -1,6 +1,6 @@
// Build don't link:
// GROUPS passed ARM-compliance
-#include <iostream.h>
+#include <iostream>
enum f1 {
F1
};
@@ -13,13 +13,13 @@ class A {
public:
void set (f1 f);
};
-void A::set (f1 f) { cout << "called A f1\n";}
+void A::set (f1 f) { std::cout << "called A f1\n";}
class B : public A {
public:
void set (f2 f);
};
-void B::set (f2 f) { cout << "called B\n";} // ERROR - candidate
+void B::set (f2 f) { std::cout << "called B\n";} // ERROR - candidate
int main() {
B b;
@@ -31,3 +31,8 @@ int main() {
// belong to different scopes. Thus B::set() should have
// hidden (completely) the A::set() function.
}
+
+
+
+
+
diff --git a/gcc/testsuite/g++.old-deja/g++.law/bad-error7.C b/gcc/testsuite/g++.old-deja/g++.law/bad-error7.C
index 434921dd72d..05b3033b1cf 100644
--- a/gcc/testsuite/g++.old-deja/g++.law/bad-error7.C
+++ b/gcc/testsuite/g++.old-deja/g++.law/bad-error7.C
@@ -1,6 +1,6 @@
// Build don't link:
// GROUPS passed bad-errors
-#include <iostream.h>
+#include <iostream>
class ParX
{
@@ -11,7 +11,7 @@ class ParX
class X : public ParX
{
public:
- void fn2() { cout << "hi" << endl; }
+ void fn2() { std::cout << "hi" << std::endl; }
};
int main()
@@ -22,3 +22,9 @@ int main()
(pParX->*p)();
}
+
+
+
+
+
+
diff --git a/gcc/testsuite/g++.old-deja/g++.law/builtin1.C b/gcc/testsuite/g++.old-deja/g++.law/builtin1.C
index 86a91e7e36f..c285c29fe2e 100644
--- a/gcc/testsuite/g++.old-deja/g++.law/builtin1.C
+++ b/gcc/testsuite/g++.old-deja/g++.law/builtin1.C
@@ -8,10 +8,9 @@
// the use of __builtin_alloca, and thus ends up being unresolved.
// Special g++ Options:
-extern "C" void* alloca( __SIZE_TYPE__ );
extern "C" int printf (const char *, ...);
void* junk() {
- return std::alloca(10);
+ return __builtin_alloca(10);
}
main() { printf ("PASS\n");}
diff --git a/gcc/testsuite/g++.old-deja/g++.law/code-gen5.C b/gcc/testsuite/g++.old-deja/g++.law/code-gen5.C
index 35087c0a51f..ff908758c4f 100644
--- a/gcc/testsuite/g++.old-deja/g++.law/code-gen5.C
+++ b/gcc/testsuite/g++.old-deja/g++.law/code-gen5.C
@@ -5,12 +5,12 @@
// Subject: An error!
// Message-ID: <9311160259.AA03353@pi14.arc.umn.edu>
-#include <stdlib.h>
-#include <stdio.h>
-#include <assert.h>
-#include <fstream.h>
-#include <iostream.h>
-#include <math.h>
+#include <cstdlib>
+#include <cstdio>
+#include <cassert>
+#include <fstream>
+#include <iostream>
+#include <cmath>
#define ANSI_C
@@ -79,7 +79,7 @@ class Vector
double assign( int, double );
- friend ostream& operator<<( ostream&, const Vector& m );
+ friend std::ostream& operator<<(std::ostream&, const Vector& m );
private:
@@ -142,7 +142,7 @@ operator=( const Vector &A )
double Vector::
operator()( int row ) const
{
- assert( r );
+ assert(r != 0);
return *r->vec;
}
@@ -150,7 +150,7 @@ operator()( int row ) const
VecElem Vector::
operator()( int r )
{
- assert(r);
+ assert(r != 0);
return VecElem( *this, r );
}
@@ -159,13 +159,13 @@ operator()( int r )
double Vector::
assign( int rownum, double d )
{
- assert(r);
+ assert(r != 0);
if( rownum > row() || rownum <= 0 ) {
- cerr << "Warning: trying to assign out of bounds" << endl;
- cerr << "row " << rownum << endl;
- cerr << "Vector size " << row() << endl;
- abort();
+ std::cerr << "Warning: trying to assign out of bounds" << std::endl;
+ std::cerr << "row " << rownum << std::endl;
+ std::cerr << "Vector size " << row() << std::endl;
+ std::abort();
}
if( r->count == 1 ) {
@@ -232,8 +232,9 @@ VecElem( Vector &vec, int r )
: v(vec), row(r)
{
if( r < 1 || r > vec.row() ) {
- cerr << "Trying to access vector element out of bounds" << endl;
- abort();
+ std::cerr << "Trying to access vector element out of bounds";
+ std::cerr << std::endl;
+ std::abort();
}
}
@@ -245,7 +246,7 @@ VecElem( const VecElem &elem )
VecElem::
operator double()
{
- assert( v.r->vec );
+ assert( v.r->vec != 0 );
return *v.r->vec;
};
@@ -268,9 +269,9 @@ int main()
int i, j;
if (makeforms (cen,a,b) != 10)
- { printf ("FAIL\n"); return 1; }
+ { std::printf ("FAIL\n"); return 1; }
else
- printf ("PASS\n");
+ std::printf ("PASS\n");
}
@@ -281,3 +282,5 @@ makeforms( Vector cen, Vector **a, Vector **b)
return 10;
}
+
+
diff --git a/gcc/testsuite/g++.old-deja/g++.law/ctors10.C b/gcc/testsuite/g++.old-deja/g++.law/ctors10.C
index 6520087d52f..4cc20e86cb6 100644
--- a/gcc/testsuite/g++.old-deja/g++.law/ctors10.C
+++ b/gcc/testsuite/g++.old-deja/g++.law/ctors10.C
@@ -6,14 +6,14 @@
// Subject: bug019.cc
// Date: Fri, 5 Feb 93 15:51:42 -0800
-#include <iostream.h>
+#include <iostream>
class Class
{
- class Err : public ostream
+ class Err : public std::ostream
{
public:
- Err(void) : ostream(NULL) { }
+ Err(void) : std::ostream(NULL) { }
~Err(void) { }
};
public:
@@ -22,3 +22,7 @@ public:
private:
char x;
};
+
+
+
+
diff --git a/gcc/testsuite/g++.old-deja/g++.law/ctors12.C b/gcc/testsuite/g++.old-deja/g++.law/ctors12.C
index 403bf3fc42b..30d944d4da9 100644
--- a/gcc/testsuite/g++.old-deja/g++.law/ctors12.C
+++ b/gcc/testsuite/g++.old-deja/g++.law/ctors12.C
@@ -1,7 +1,7 @@
// GROUPS passed constructors
-#include <stdio.h>
-#include <stdlib.h>
-#include <iostream.h>
+#include <cstdio>
+#include <cstdlib>
+#include <iostream>
#define MAGIC 7654
@@ -14,9 +14,9 @@ public:
complex() { re=im=0; magic=MAGIC; }
complex(double d) { re=d; im=0; magic=MAGIC; }
complex(double d, double d2) {re=d; im=d2; magic=MAGIC; }
- ~complex() {if(magic!=MAGIC) {printf("FAIL\n");exit(1);}}
- friend ostream& operator << (ostream& o, const complex& c)
- { return o << "(" << c.re << "," << c.im << ")"; }
+ ~complex() {if(magic!=MAGIC) {std::printf("FAIL\n"); std::exit(1);}}
+ friend std::ostream& operator << (std::ostream& o, const complex& c)
+ { return o << "(" << c.re << "," << c.im << ")"; }
};
int complex::count=0;
diff --git a/gcc/testsuite/g++.old-deja/g++.law/ctors13.C b/gcc/testsuite/g++.old-deja/g++.law/ctors13.C
index aef721be7ce..1442b02eb56 100644
--- a/gcc/testsuite/g++.old-deja/g++.law/ctors13.C
+++ b/gcc/testsuite/g++.old-deja/g++.law/ctors13.C
@@ -1,6 +1,6 @@
// Build don't link:
// GROUPS passed constructors
-#include <iostream.h>
+#include <iostream>
class A {
A() {} // private constructor// ERROR - .*
@@ -9,8 +9,10 @@ class A {
int main() {
A* a = new A();// ERROR - .*
if (a) {
- cout << "a != NULL\n";
+ std::cout << "a != NULL\n";
} else {
- cout << "a == NULL\n";
+ std::cout << "a == NULL\n";
}
}
+
+
diff --git a/gcc/testsuite/g++.old-deja/g++.law/ctors17.C b/gcc/testsuite/g++.old-deja/g++.law/ctors17.C
index 1f5f0b00c6c..5fe1724df78 100644
--- a/gcc/testsuite/g++.old-deja/g++.law/ctors17.C
+++ b/gcc/testsuite/g++.old-deja/g++.law/ctors17.C
@@ -7,9 +7,9 @@
// Date: Tue, 15 Jun 1993 18:34:14 +0200 (MET DST)
-#include <fstream.h>
+#include <fstream>
-class X : public ifstream { // ERROR - candidate
+class X : public std::ifstream { // ERROR - candidate
public:
X(int a, char *b) {} // ERROR - candidate
};
diff --git a/gcc/testsuite/g++.old-deja/g++.law/ctors6.C b/gcc/testsuite/g++.old-deja/g++.law/ctors6.C
index a46f4e89bdb..b2d0a197d51 100644
--- a/gcc/testsuite/g++.old-deja/g++.law/ctors6.C
+++ b/gcc/testsuite/g++.old-deja/g++.law/ctors6.C
@@ -1,8 +1,8 @@
// Build don't link:
// GROUPS passed constructors
-#include <complex.h>
+#include <complex>
-double foo(double_complex *a)
+double foo(std::complex<double> *a)
{
return 0.0;
}
@@ -10,6 +10,6 @@ double foo(double_complex *a)
double bar(void)
{
- double_complex v[10];
+ std::complex<double> v[10];
return foo(v);
}
diff --git a/gcc/testsuite/g++.old-deja/g++.law/cvt16.C b/gcc/testsuite/g++.old-deja/g++.law/cvt16.C
index c539c96e536..2d75c4c3106 100644
--- a/gcc/testsuite/g++.old-deja/g++.law/cvt16.C
+++ b/gcc/testsuite/g++.old-deja/g++.law/cvt16.C
@@ -6,7 +6,7 @@
// Subject: g++ bug
// Date: Mon, 12 Apr 93 10:47:01 MDT
-#include <iostream.h>
+#include <iostream>
class B {
};
@@ -22,8 +22,9 @@ public:
main() {
A a(37);
//cout << a << endl;
- cout << (short)a << endl;
+ std::cout << (short)a << std::endl;
return 0;
} // main
+
diff --git a/gcc/testsuite/g++.old-deja/g++.law/cvt2.C b/gcc/testsuite/g++.old-deja/g++.law/cvt2.C
index c37098536e9..7db6b2b566a 100644
--- a/gcc/testsuite/g++.old-deja/g++.law/cvt2.C
+++ b/gcc/testsuite/g++.old-deja/g++.law/cvt2.C
@@ -1,15 +1,15 @@
// GROUPS passed conversions
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <iostream.h>
-#include <fstream.h>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
+#include <iostream>
+#include <fstream>
class cvec {
public:
~cvec(){ delete s; }
- cvec(const char*x) { s = new char[strlen(x)+1]; strcpy(s, x); }
- cvec(const cvec& c) { s = new char[strlen(c.s)+1]; strcpy(s, c.s); }
+ cvec(const char*x) { s = new char[std::strlen(x)+1]; std::strcpy(s, x); }
+ cvec(const cvec& c) { s = new char[std::strlen(c.s)+1]; std::strcpy(s, c.s); }
operator const char*() { return s; }
private:
char *s;
@@ -25,18 +25,17 @@ void
A(const char* s)
{
// s still ok here
- ifstream inf(s);
- if (strncmp ("aaa", s, 3))
+ std::ifstream inf(s);
+ if (std::strncmp ("aaa", s, 3))
{
- printf ("FAIL\n");
- exit (1);
+ std::printf ("FAIL\n");
+ std::exit (1);
}
else
- printf ("PASS\n");
+ std::printf ("PASS\n");
}
int main()
{
A(B("aaa"));
}
-
diff --git a/gcc/testsuite/g++.old-deja/g++.law/cvt7.C b/gcc/testsuite/g++.old-deja/g++.law/cvt7.C
index fc775c4f079..3327f73c2e1 100644
--- a/gcc/testsuite/g++.old-deja/g++.law/cvt7.C
+++ b/gcc/testsuite/g++.old-deja/g++.law/cvt7.C
@@ -5,14 +5,13 @@
// Message-Id: <9208250205.AA26351@icsib43.ICSI.Berkeley.EDU>
// Subject: implicit int. convs. from member refs. in switch expressions
-#include <stream.h>
-#include <stdio.h>
+#include <cstdio>
class A
{
public:
- A(int j) { i = j; } // ERROR - candidate
- A(A& a) { i = a.i; } // ERROR - candidate
+ A(int j) { i = j; }
+ A(A& a) { i = a.i; }
operator int() { return i; }
void assign(int v) { i = v; }
@@ -38,10 +37,10 @@ B::run()
// Replacing above with "switch (int(in))" removes the error.
{
case 0:
- out = 1; // ERROR - no usable copy ctor
+ out = 1;
break;
default:
- out = 0; // ERROR - no usable copy ctor
+ out = 0;
break;
}
}
@@ -72,3 +71,10 @@ int main()
return 0;
}
+
+
+
+
+
+
+
diff --git a/gcc/testsuite/g++.old-deja/g++.law/except5.C b/gcc/testsuite/g++.old-deja/g++.law/except5.C
index 623d0d8587f..18174e7fcf5 100644
--- a/gcc/testsuite/g++.old-deja/g++.law/except5.C
+++ b/gcc/testsuite/g++.old-deja/g++.law/except5.C
@@ -7,7 +7,8 @@
// Subject: exception's bug?
// Date: Wed, 10 Nov 1993 11:07:12 -0500
-#include <stream.h>
+#include <iostream>
+
class X {
int *a;
int sz;
@@ -33,7 +34,7 @@ main()
for (int i = 0; i < 12; i++)
c[i] = 1;
} catch (X::range) {
- cerr << "invalid range\n";
+ std::cerr << "invalid range\n";
}
return 0;
}
diff --git a/gcc/testsuite/g++.old-deja/g++.law/missed-error2.C b/gcc/testsuite/g++.old-deja/g++.law/missed-error2.C
index 18a026d1502..2fc1ddf5326 100644
--- a/gcc/testsuite/g++.old-deja/g++.law/missed-error2.C
+++ b/gcc/testsuite/g++.old-deja/g++.law/missed-error2.C
@@ -6,7 +6,7 @@
// Subject: More on [g++ 2.1 : overloaded function selection incorrect]
// Message-ID: <9205212240.AA17934@ndc.com>
-#include <iostream.h>
+#include <iostream>
inline int max(int a, int b) {return a > b ? a : b;}; // ERROR - candidate
inline double max(double a, double b) {return a > b ? a : b;}; // ERROR - candidate
@@ -21,8 +21,8 @@ int main() {
// about the declaration above
static void foo(int i, int j, double x, double y) {
- cout << "Max(int): " << max(i,j) << " Max(double): " <<
+ std::cout << "Max(int): " << max(i,j) << " Max(double): " <<
max(x,y) << '\n';
- cout << "Max(int, double): " << max(i, y) << '\n';// ERROR -
+ std::cout << "Max(int, double): " << max(i, y) << '\n';// ERROR -
}
diff --git a/gcc/testsuite/g++.old-deja/g++.law/nest3.C b/gcc/testsuite/g++.old-deja/g++.law/nest3.C
index eac308e566a..d390bc48582 100644
--- a/gcc/testsuite/g++.old-deja/g++.law/nest3.C
+++ b/gcc/testsuite/g++.old-deja/g++.law/nest3.C
@@ -1,15 +1,15 @@
// Build don't link:
// GROUPS passed nest
-#include <iostream.h>
+#include <iostream>
struct inner {
- static void f() { cout << "inner::f()\n";}
+ static void f() { std::cout << "inner::f()\n";}
};
struct outer {
struct inner {
- static void f() { cout << "outer::inner::f()\n";}
+ static void f() { std::cout << "outer::inner::f()\n";}
};
static void f() {
@@ -20,6 +20,6 @@ struct outer {
int main() {
outer::f();
- cout << endl;
+ std::cout << std::endl;
return 0;
}
diff --git a/gcc/testsuite/g++.old-deja/g++.law/operators32.C b/gcc/testsuite/g++.old-deja/g++.law/operators32.C
index 26e439876a9..daebcefd339 100644
--- a/gcc/testsuite/g++.old-deja/g++.law/operators32.C
+++ b/gcc/testsuite/g++.old-deja/g++.law/operators32.C
@@ -1,6 +1,6 @@
// Build don't link:
// GROUPS passed operators
-#include <iostream.h>
+#include <iostream>
//
// frees space allocated for N-D array
@@ -43,9 +43,9 @@ long d1 = 3, d2 = 4;
class foo
{
public:
-foo() {cout << "foo created" << endl; }
+foo() {std::cout << "foo created" << std::endl; }
-~foo() {cout << "foo deleted" << endl; }
+~foo() {std::cout << "foo deleted" << std::endl; }
};
foo **f2;
diff --git a/gcc/testsuite/g++.old-deja/g++.law/vbase1.C b/gcc/testsuite/g++.old-deja/g++.law/vbase1.C
index 42282d57df8..a013c72901b 100644
--- a/gcc/testsuite/g++.old-deja/g++.law/vbase1.C
+++ b/gcc/testsuite/g++.old-deja/g++.law/vbase1.C
@@ -7,11 +7,11 @@
// Message-ID: <317f1j$o9c@agate.berkeley.edu>
-#include <iostream.h>
+#include <iostream>
class a {
protected:
- virtual void foo() { cout << "Class A\n";}
+ virtual void foo() { std::cout << "Class A\n";}
};
class b : public virtual a {};
@@ -26,3 +26,4 @@ int main() {
test.bar();
}
+
diff --git a/gcc/testsuite/g++.old-deja/g++.law/virtual3.C b/gcc/testsuite/g++.old-deja/g++.law/virtual3.C
index 0e25a3e70e1..8c30b7689a4 100644
--- a/gcc/testsuite/g++.old-deja/g++.law/virtual3.C
+++ b/gcc/testsuite/g++.old-deja/g++.law/virtual3.C
@@ -5,12 +5,12 @@
// Date: 4 Nov 1993 22:57:36 -0500
// Message-ID: <9311041820.AA05942@ramjet.multinet.DE>
-#include <iostream.h>
-#include <strstream.h>
+#include <iostream>
+#include <sstream>
using namespace std;
-class BugStream : public ostrstream {
+class BugStream : public ostringstream {
public:
BugStream() {}
BugStream& eval();
@@ -26,12 +26,12 @@ BugStream& BugStream::eval()
*this << ends;
// eval the command and set the status
- char* s = str();
+ const char* s = str().data();
cerr << s << endl;
// reset the stream for the next command
clear(ios::goodbit);
- rdbuf()->freeze(0);
+ // rdbuf()->freeze(0);
seekp(0);
return *this;
diff --git a/gcc/testsuite/g++.old-deja/g++.law/visibility1.C b/gcc/testsuite/g++.old-deja/g++.law/visibility1.C
index 67f4bcd9919..736c11ab8ad 100644
--- a/gcc/testsuite/g++.old-deja/g++.law/visibility1.C
+++ b/gcc/testsuite/g++.old-deja/g++.law/visibility1.C
@@ -1,6 +1,6 @@
// Build don't link:
// GROUPS passed visibility
-#include <iostream.h>
+#include <iostream>
@@ -8,17 +8,17 @@ class base {
//==========
void base_priv(char * n)
- { cout << "base_priv called from: " << n << "\n"; };
+ { std::cout << "base_priv called from: " << n << "\n"; };
protected:
void base_prot(char * n)
- { cout << "base_prot called from: " << n << "\n"; };
+ { std::cout << "base_prot called from: " << n << "\n"; };
public:
void base_publ(char * n)
- { cout << "base_publ called from: " << n << "\n"; };
+ { std::cout << "base_publ called from: " << n << "\n"; };
void test(char * n) { base_publ(n); base_prot(n); base_priv(n); }
@@ -57,12 +57,12 @@ int main(int argc, char *argv[])
base b;
b.base_publ("base class object");
b.test("member of base class object");
- cout << "\n";
+ std::cout << "\n";
derived pd;
pd.test("member of derived class object");
derived_friend();
- cout << "\n";
+ std::cout << "\n";
} /* main */
diff --git a/gcc/testsuite/g++.old-deja/g++.law/visibility10.C b/gcc/testsuite/g++.old-deja/g++.law/visibility10.C
index 14dfa333dea..7f68af05b24 100644
--- a/gcc/testsuite/g++.old-deja/g++.law/visibility10.C
+++ b/gcc/testsuite/g++.old-deja/g++.law/visibility10.C
@@ -1,12 +1,12 @@
// Build don't link:
// GROUPS passed visibility
-#include <iostream.h>
+#include <iostream>
class base {
public:
- void f1 () { cout << "f1" << endl; };
- void f2 () { cout << "f2" << endl; };
+ void f1 () { std::cout << "f1" << std::endl; };
+ void f2 () { std::cout << "f2" << std::endl; };
};
class deriv : public base {
@@ -19,3 +19,4 @@ int main ()
d.f2();
}
+
diff --git a/gcc/testsuite/g++.old-deja/g++.law/visibility13.C b/gcc/testsuite/g++.old-deja/g++.law/visibility13.C
index 7f634e20cd8..dbde720d276 100644
--- a/gcc/testsuite/g++.old-deja/g++.law/visibility13.C
+++ b/gcc/testsuite/g++.old-deja/g++.law/visibility13.C
@@ -6,11 +6,13 @@
// Subject: class, template and their scoping problem
// Message-ID: <9307130521.AA18312@oahu.cs.ucla.edu>
-#include <iostream.h>
-#include <assert.h>
+#include <iostream>
+#include <cassert>
// --------------- Array.h && Array.cc ------------------
+using namespace std;
+
const int ArraySize = 12;
template <class Type>
diff --git a/gcc/testsuite/g++.old-deja/g++.law/visibility17.C b/gcc/testsuite/g++.old-deja/g++.law/visibility17.C
index fa4d6db69b9..2aa08a09169 100644
--- a/gcc/testsuite/g++.old-deja/g++.law/visibility17.C
+++ b/gcc/testsuite/g++.old-deja/g++.law/visibility17.C
@@ -5,8 +5,8 @@
// Date: Thu, 05 Aug 1993 17:23:20 -0700
// Subject: Access to private constructor.
// Message-ID: <9308060023.AA10283@neptune.caere.com>
-#include <iostream.h>
-#include <string.h>
+#include <iostream>
+#include <cstring>
class Base
{
@@ -33,13 +33,13 @@ private:
Base::Base()
{ // ERROR - private
- name_ = strcpy(new char[strlen(" ") + 1], " ");
+ name_ = std::strcpy(new char[std::strlen(" ") + 1], " ");
}
Base::Base(char* str)
{ // ERROR - private
if(str != NULL)
- name_ = strcpy(new char[strlen(str) + 1], str);
+ name_ = std::strcpy(new char[std::strlen(str) + 1], str);
}
Derived::Derived(int n, char* str) : Base(str)
@@ -59,6 +59,8 @@ int main()
// Derived* d = new Derived(10, "test");
Derived* d = new Derived(10);
- cerr << d->getNum() << "\t" << d->getName() << endl;
+ std::cerr << d->getNum() << "\t" << d->getName() << std::endl;
}
+
+
diff --git a/gcc/testsuite/g++.old-deja/g++.law/visibility2.C b/gcc/testsuite/g++.old-deja/g++.law/visibility2.C
index 5806fc564b7..9d038d46891 100644
--- a/gcc/testsuite/g++.old-deja/g++.law/visibility2.C
+++ b/gcc/testsuite/g++.old-deja/g++.law/visibility2.C
@@ -1,6 +1,6 @@
// Build don't link:
// GROUPS passed visibility
-#include <iostream.h>
+#include <iostream>
@@ -8,17 +8,17 @@ class base {
//==========
void base_priv(char * n)
- { cout << "base_priv called from: " << n << "\n"; };
+ { std::cout << "base_priv called from: " << n << "\n"; };
protected:
void base_prot(char * n)
- { cout << "base_prot called from: " << n << "\n"; };
+ { std::cout << "base_prot called from: " << n << "\n"; };
public:
void base_publ(char * n)
- { cout << "base_publ called from: " << n << "\n"; };
+ { std::cout << "base_publ called from: " << n << "\n"; };
void test(char * n) { base_publ(n); base_prot(n); base_priv(n); }
@@ -57,12 +57,12 @@ int main(int argc, char *argv[])
base b;
b.base_publ("base class object");
b.test("member of base class object");
- cout << "\n";
+ std::cout << "\n";
derived pd;
pd.test("member of derived class object");
derived_friend();
- cout << "\n";
+ std::cout << "\n";
} /* main */
diff --git a/gcc/testsuite/g++.old-deja/g++.law/visibility22.C b/gcc/testsuite/g++.old-deja/g++.law/visibility22.C
index a9448c07fee..edfb897d0b7 100644
--- a/gcc/testsuite/g++.old-deja/g++.law/visibility22.C
+++ b/gcc/testsuite/g++.old-deja/g++.law/visibility22.C
@@ -7,7 +7,7 @@
// Message-ID: <9308121348.aa26256@Paris.ics.uci.edu>
// 5.cc
-#include <stream.h>
+#include <iostream>
class A {
int x;
@@ -23,3 +23,8 @@ protected:
public:
A::g;
};
+
+
+
+
+
diff --git a/gcc/testsuite/g++.old-deja/g++.law/visibility25.C b/gcc/testsuite/g++.old-deja/g++.law/visibility25.C
index 607e25a00ce..96db3936b90 100644
--- a/gcc/testsuite/g++.old-deja/g++.law/visibility25.C
+++ b/gcc/testsuite/g++.old-deja/g++.law/visibility25.C
@@ -5,7 +5,7 @@
// Date: Wed, 17 Nov 93 21:30:32 EST
// Subject: gcc 2.5.3 - can't privately inherit and contain same class
// Message-ID: <9311171030.AA00604@mencon>
-#include <iostream.h>
+#include <iostream>
class A {
public:
@@ -24,3 +24,10 @@ public:
private:
::A a;
};
+
+
+
+
+
+
+
diff --git a/gcc/testsuite/g++.old-deja/g++.law/visibility7.C b/gcc/testsuite/g++.old-deja/g++.law/visibility7.C
index 764da35d9db..ec7947c5503 100644
--- a/gcc/testsuite/g++.old-deja/g++.law/visibility7.C
+++ b/gcc/testsuite/g++.old-deja/g++.law/visibility7.C
@@ -5,7 +5,7 @@
// Date: Wed, 21 Apr 93 09:42:07 +0100
// Subject: /*** BUG REPORT : THE MYTH OF PRIVATE INHERITANCE ***/
// Message-ID: <9304210842.AA01815@life.ai.mit.edu>
-#include <iostream.h>
+#include <iostream>
class A {
private:
@@ -64,8 +64,10 @@ int main()
B* bobject = new B(2, 1);
C* cobject = new C(bobject);
cobject->setBValue(8);
- cout << cobject->getBValue() << endl;
+ std::cout << cobject->getBValue() << std::endl;
delete bobject;
delete cobject;
}
+
+
diff --git a/gcc/testsuite/g++.old-deja/g++.law/vtable2.C b/gcc/testsuite/g++.old-deja/g++.law/vtable2.C
index bbc8074de91..15b31e42908 100644
--- a/gcc/testsuite/g++.old-deja/g++.law/vtable2.C
+++ b/gcc/testsuite/g++.old-deja/g++.law/vtable2.C
@@ -1,5 +1,4 @@
// Build don't link:
-// Special g++ Options: -fvtable-thunks
// GROUPS passed vtable
struct C1
{
diff --git a/gcc/testsuite/g++.old-deja/g++.law/weak.C b/gcc/testsuite/g++.old-deja/g++.law/weak.C
index a799d0a0bd1..5937979f301 100644
--- a/gcc/testsuite/g++.old-deja/g++.law/weak.C
+++ b/gcc/testsuite/g++.old-deja/g++.law/weak.C
@@ -5,16 +5,16 @@
// libc-5.4.xx has __IO_putc in its static C library, which can conflict
// with the copy of __IO_putc in the libstdc++ library built by egcs.
-#include <iostream.h>
-#include <streambuf.h>
-#include <stdio.h>
+#include <iostream>
+#include <streambuf>
+#include <cstdio>
-istream x (0);
+std::istream x (0);
main () {
x.get();
- putc(0, 0);
- fgets(0, 0, 0);
+ std::putc(0, 0);
+ std::fgets(0, 0, 0);
x.get((char*) 0, 0);
}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh2.C b/gcc/testsuite/g++.old-deja/g++.mike/eh2.C
index 4fc513ff0f5..c92afde4cd4 100644
--- a/gcc/testsuite/g++.old-deja/g++.mike/eh2.C
+++ b/gcc/testsuite/g++.old-deja/g++.mike/eh2.C
@@ -1,8 +1,8 @@
// Special g++ Options: -fexceptions
// excess errors test - XFAIL a29k-*-* sparc64-*-elf arm-*-pe
-#include <stdlib.h>
-#include <iostream.h>
+#include <cstdlib>
+#include <iostream>
class Vector {
private:
@@ -57,9 +57,9 @@ f(Vector& v) {
try {
do_something( v );
} catch (Vector::Range& r) {
- cout << "Invalid vector range " << r.value()
- << " caught in f()" << endl;
- exit(0);
+ std::cout << "Invalid vector range " << r.value()
+ << " caught in f()" << std::endl;
+ std::exit(0);
}
}
@@ -69,3 +69,6 @@ main() {
f( v );
return 1;
}
+
+
+
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh33.C b/gcc/testsuite/g++.old-deja/g++.mike/eh33.C
index d7c509ecd37..0c383501003 100644
--- a/gcc/testsuite/g++.old-deja/g++.mike/eh33.C
+++ b/gcc/testsuite/g++.old-deja/g++.mike/eh33.C
@@ -1,5 +1,5 @@
// Special g++ Options: -fexceptions
-// excess errors test - XFAIL hppa*-*-* a29k-*-* sparc64-*-elf z8k-*-* arm-*-pe
+// excess errors test - XFAIL a29k-*-* sparc64-*-elf z8k-*-* arm-*-pe
#include <exception>
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh50.C b/gcc/testsuite/g++.old-deja/g++.mike/eh50.C
index 84ccaddb9a9..f4421ab1824 100644
--- a/gcc/testsuite/g++.old-deja/g++.mike/eh50.C
+++ b/gcc/testsuite/g++.old-deja/g++.mike/eh50.C
@@ -1,5 +1,5 @@
// Special g++ Options: -fexceptions
-// excess errors test - XFAIL hppa*-*-* a29k-*-* sparc64-*-elf z8k-*-* arm-*-pe
+// excess errors test - XFAIL a29k-*-* sparc64-*-elf z8k-*-* arm-*-pe
#include <exception>
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/memoize1.C b/gcc/testsuite/g++.old-deja/g++.mike/memoize1.C
index 9b7aadc5081..cc98cfae2fa 100644
--- a/gcc/testsuite/g++.old-deja/g++.mike/memoize1.C
+++ b/gcc/testsuite/g++.old-deja/g++.mike/memoize1.C
@@ -1,4 +1,4 @@
// Build don't link:
// Special g++ Options: -fsave-memoized
-#include <iostream.h>
+#include <iostream>
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net34.C b/gcc/testsuite/g++.old-deja/g++.mike/net34.C
index dada4cd13f0..9cf550c126e 100644
--- a/gcc/testsuite/g++.old-deja/g++.mike/net34.C
+++ b/gcc/testsuite/g++.old-deja/g++.mike/net34.C
@@ -1,6 +1,6 @@
// Special g++ Options:
-#include <iostream.h>
+#include <iostream>
class foo {
public:
@@ -25,10 +25,10 @@ class multiple : public bar_1, public bar_2 {
public:
multiple(int i1, int i2) : bar_1(i1), bar_2(i2) {}
void print() {
- cout << "bar_1::k -> " << bar_1::k << "\n";
- cout << "bar_2::k -> " << bar_2::k << "\n";
- cout << "bar_1::get_k() -> " << bar_1::get_k() << "\n";
- cout << "bar_2::get_k() -> " << bar_2::get_k() << "\n";
+ std::cout << "bar_1::k -> " << bar_1::k << "\n";
+ std::cout << "bar_2::k -> " << bar_2::k << "\n";
+ std::cout << "bar_1::get_k() -> " << bar_1::get_k() << "\n";
+ std::cout << "bar_2::get_k() -> " << bar_2::get_k() << "\n";
}
};
@@ -36,3 +36,5 @@ int main() {
multiple m(1,2);
m.print();
}
+
+
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net46.C b/gcc/testsuite/g++.old-deja/g++.mike/net46.C
index 9a985450a4a..bacee852c85 100644
--- a/gcc/testsuite/g++.old-deja/g++.mike/net46.C
+++ b/gcc/testsuite/g++.old-deja/g++.mike/net46.C
@@ -1,6 +1,6 @@
-#include <iostream.h>
-#include <stdlib.h>
-#include <stddef.h>
+#include <iostream>
+#include <cstdlib>
+#include <cstddef>
#include <new>
int fail = 1;
@@ -14,7 +14,7 @@ void *operator new(size_t size) throw (std::bad_alloc) {
}
int main() {
- cout << "";
+ std::cout << "";
in_main = 1;
new int;
return fail;
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net5.C b/gcc/testsuite/g++.old-deja/g++.mike/net5.C
deleted file mode 100644
index 665c0ba8188..00000000000
--- a/gcc/testsuite/g++.old-deja/g++.mike/net5.C
+++ /dev/null
@@ -1,10 +0,0 @@
-// Build don't link:
-// Special g++ Options:
-
-namespace std {
-volatile void abort(); // WARNING - mismatch
-}
-
-volatile void oink() {
- std::abort() ;
-} // gets bogus error -
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p2846.C b/gcc/testsuite/g++.old-deja/g++.mike/p2846.C
index b9a44c43c1e..2849491a0b4 100644
--- a/gcc/testsuite/g++.old-deja/g++.mike/p2846.C
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p2846.C
@@ -6,6 +6,8 @@ extern "C" void exit(int);
class A;
class B;
+int c;
+
class A {
public:
@@ -30,6 +32,7 @@ public:
virtual ~B(void){}
void print(void) const {
+ ++c;
printf("B::print\n");
}
@@ -50,6 +53,14 @@ int main ()
{
A titi;
A toto = titi.compute();
- printf("PASS\n");
- return 0;
+ if (c != 1)
+ {
+ printf ("FAIL\n");
+ return 1;
+ }
+ else
+ {
+ printf("PASS\n");
+ return 0;
+ }
}
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p5469.C b/gcc/testsuite/g++.old-deja/g++.mike/p5469.C
index 9e5250e43de..9af20101171 100644
--- a/gcc/testsuite/g++.old-deja/g++.mike/p5469.C
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p5469.C
@@ -4,7 +4,7 @@ int count;
class A {
A();
- A(const A&); // ERROR - referenced below
+ A(const A&);
public:
A(int) { ++count; }
~A() { --count; }
@@ -14,7 +14,7 @@ public:
int main() {
{
A a (1);
- if (a == 2 && a == 1) // ERROR - private copy ctor
+ if (a == 2 && a == 1)
;
}
return count;
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p5469a.C b/gcc/testsuite/g++.old-deja/g++.mike/p5469a.C
index 9cbd2dfe7a8..0783f77dffe 100644
--- a/gcc/testsuite/g++.old-deja/g++.mike/p5469a.C
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p5469a.C
@@ -4,7 +4,7 @@ int count;
class A {
A();
- A(const A&); // ERROR - referenced below
+ A(const A&);
public:
A(int) { ++count; }
~A() { --count; }
@@ -14,7 +14,7 @@ public:
int main() {
{
A a (1);
- if (a == 2 || a == 1) // ERROR - private copy ctor
+ if (a == 2 || a == 1)
;
}
return count;
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p658.C b/gcc/testsuite/g++.old-deja/g++.mike/p658.C
index 842ae8b78d6..b9137fb8ca2 100644
--- a/gcc/testsuite/g++.old-deja/g++.mike/p658.C
+++ b/gcc/testsuite/g++.old-deja/g++.mike/p658.C
@@ -1,7 +1,7 @@
// prms-id: 658
-#include <ostream.h>
-#include <stdlib.h>
+#include <iostream>
+#include <cstdlib>
/* We may not find the libg++ <bool.h>. */
#ifndef FALSE
@@ -65,8 +65,8 @@ void
Object::OK() const
{
if (_destructed) {
- cerr << "FAILURE - reference was made to a destructed object\n";
- abort();
+ std::cerr << "FAILURE - reference was made to a destructed object\n";
+ std::abort();
}
}
@@ -98,3 +98,5 @@ Char::operator char () const
{
return _c;
}
+
+
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/rtti1.C b/gcc/testsuite/g++.old-deja/g++.mike/rtti1.C
index e44c5fafdc5..3403abf0999 100644
--- a/gcc/testsuite/g++.old-deja/g++.mike/rtti1.C
+++ b/gcc/testsuite/g++.old-deja/g++.mike/rtti1.C
@@ -1,4 +1,4 @@
// Build don't link:
#include <typeinfo>
-#include <iostream.h>
+#include <iostream>
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/thunk1.C b/gcc/testsuite/g++.old-deja/g++.mike/thunk1.C
index 9780c05bc97..fc5e9b54b47 100644
--- a/gcc/testsuite/g++.old-deja/g++.mike/thunk1.C
+++ b/gcc/testsuite/g++.old-deja/g++.mike/thunk1.C
@@ -1,5 +1,4 @@
// Build don't link:
-// Special g++ Options: -fvtable-thunks
struct C1
{
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/thunk2.C b/gcc/testsuite/g++.old-deja/g++.mike/thunk2.C
index 36b9659fa41..20f1379d393 100644
--- a/gcc/testsuite/g++.old-deja/g++.mike/thunk2.C
+++ b/gcc/testsuite/g++.old-deja/g++.mike/thunk2.C
@@ -1,5 +1,3 @@
-// Special g++ Options: -fvtable-thunks
-
#include <typeinfo>
int state;
@@ -26,7 +24,7 @@ A* bar() {
return new A;
}
-main() {
+int main() {
A *aptr = bar();
aptr->foo();
if (dynamic_cast <void*> (aptr) != aptr)
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/thunk3.C b/gcc/testsuite/g++.old-deja/g++.mike/thunk3.C
index 3e97aacd6ba..16a5be85da6 100644
--- a/gcc/testsuite/g++.old-deja/g++.mike/thunk3.C
+++ b/gcc/testsuite/g++.old-deja/g++.mike/thunk3.C
@@ -1,5 +1,3 @@
-// Special g++ Options: -fvtable-thunks
-
int state;
int fail;
@@ -24,7 +22,7 @@ A* bar() {
return new A;
}
-main() {
+int main() {
A *aptr = bar();
aptr->foo();
if (dynamic_cast <void*> (aptr) != aptr)
diff --git a/gcc/testsuite/g++.old-deja/g++.ns/ns14.C b/gcc/testsuite/g++.old-deja/g++.ns/ns14.C
index 5a3cc701074..4049139eae9 100644
--- a/gcc/testsuite/g++.old-deja/g++.ns/ns14.C
+++ b/gcc/testsuite/g++.old-deja/g++.ns/ns14.C
@@ -1,4 +1,4 @@
-//Special g++ Options: -fhonor-std
+
namespace std{
int f(){
return 0;
diff --git a/gcc/testsuite/g++.old-deja/g++.ns/template15.C b/gcc/testsuite/g++.old-deja/g++.ns/template15.C
new file mode 100644
index 00000000000..ac781305642
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.ns/template15.C
@@ -0,0 +1,5 @@
+// Build don't link:
+// Origin: Mark Mitchell <mark@codesourcery.com>
+
+namespace X { template <class T> void f () {} }
+template void X::f<int> ();
diff --git a/gcc/testsuite/g++.old-deja/g++.ns/template17.C b/gcc/testsuite/g++.old-deja/g++.ns/template17.C
new file mode 100644
index 00000000000..11f21c921e1
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.ns/template17.C
@@ -0,0 +1,37 @@
+// Build don't link:
+//
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 29 Apr 2001 <nathan@codesourcery.com>
+
+// Bug 2258. We failed to implement using directives inside template
+// functions. This makes us regress now that ::std is real.
+
+namespace thing
+{
+ template <typename T> T end2 (T);
+}
+namespace whatever
+{
+}
+
+template <typename T> void fn (T, T (*)(T));
+
+template <class T> void mycout(const T& data)
+{
+ using namespace thing;
+ using namespace whatever;
+
+ fn (data, end2);
+ fn (data, end3);
+}
+
+namespace whatever
+{
+ template <typename T> T end3 (T);
+}
+
+int main()
+{
+ double data = 5.0;
+ mycout(data);
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.ns/template18.C b/gcc/testsuite/g++.old-deja/g++.ns/template18.C
new file mode 100644
index 00000000000..4b3f720e74b
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.ns/template18.C
@@ -0,0 +1,24 @@
+// Build don't run:
+// Origin: Andrey Slepuhin <pooh@msu.ru>
+
+namespace A
+{
+ int j;
+
+ template <typename val_t>
+ struct X
+ {
+ inline X ()
+ {
+ extern int j;
+ i = j;
+ }
+
+ int i;
+ };
+}
+
+int main ()
+{
+ A::X<int> x;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.ns/type2.C b/gcc/testsuite/g++.old-deja/g++.ns/type2.C
new file mode 100644
index 00000000000..d8407b151b4
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.ns/type2.C
@@ -0,0 +1,19 @@
+// Build don't link:
+//
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 11 April 2001 <nathan@codesourcery.com>
+// Origin:stephen.webb@cybersafe.com
+
+// Bug 2125. TYPE_DECLS never had their DECL_CONTEXT set, which
+// confused forward references to classes.
+
+typedef void T;
+namespace A {
+ class C;
+ typedef class C C;
+ typedef int T;
+ class C
+ {
+ T i; // got bogus error, found wrong T
+ };
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.oliva/ChangeLog b/gcc/testsuite/g++.old-deja/g++.oliva/ChangeLog
index 73b0aa47c44..4eb36f99d37 100644
--- a/gcc/testsuite/g++.old-deja/g++.oliva/ChangeLog
+++ b/gcc/testsuite/g++.old-deja/g++.oliva/ChangeLog
@@ -1,3 +1,39 @@
+2002-02-20 Release Manager
+
+ * GCC 3.0.4 Released.
+
+2002-02-20 Release Manager
+
+ * GCC 3.0.4 Released.
+
+2001-12-20 Release Manager
+
+ * GCC 3.0.3 Released.
+
+2001-10-23 Release Manager
+
+ * GCC 3.0.2 Released.
+
+2001-08-19 Release Manager
+
+ * GCC 3.0.1 Released.
+
+2001-08-19 Release Manager
+
+ * GCC 3.0.1 Released.
+
+20010617 Release Manager
+
+ * GCC 3.0 Released.
+
+2001-05-14 Mark Mitchell <mark@codesourcery.com>
+
+ * delete3.C: XFAIL it.
+
+2001-02-15 Alexandre Oliva <aoliva@redhat.com>
+
+ * friend1.C: New test.
+
2000-05-28 Alexandre Oliva <aoliva@cygnus.com>
* expr2.C: New test.
diff --git a/gcc/testsuite/g++.old-deja/g++.oliva/delete1.C b/gcc/testsuite/g++.old-deja/g++.oliva/delete1.C
index dee7f219f2e..d8ddefec32e 100644
--- a/gcc/testsuite/g++.old-deja/g++.oliva/delete1.C
+++ b/gcc/testsuite/g++.old-deja/g++.oliva/delete1.C
@@ -1,6 +1,6 @@
// Build don't link:
-// Copyright (C) 1999 Free Software Foundation
+// Copyright (C) 1999, 2001 Free Software Foundation
// by Alexandre Oliva <oliva@dcc.unicamp.br>
// simplified from bug report by K. Haley <khaley@bigfoot.com>
@@ -21,7 +21,7 @@ struct bar : foo {
delete this; // ERROR - delete is private
// An implicit invocation of delete is emitted in destructors, but
// it should only be checked in virtual destructors
- } // gets bogus error - not virtual - XFAIL *-*-*
+ } // gets bogus error - not virtual
} bar_;
struct baz : foo {
diff --git a/gcc/testsuite/g++.old-deja/g++.oliva/delete3.C b/gcc/testsuite/g++.old-deja/g++.oliva/delete3.C
index 44299f2c9b7..1ea2d585e37 100644
--- a/gcc/testsuite/g++.old-deja/g++.oliva/delete3.C
+++ b/gcc/testsuite/g++.old-deja/g++.oliva/delete3.C
@@ -1,4 +1,4 @@
-// Copyright (C) 1999 Free Software Foundation
+// Copyright (C) 1999, 2001 Free Software Foundation
// by Alexandre Oliva <oliva@lsd.ic.unicamp.br>
@@ -29,8 +29,9 @@ struct Bar : virtual Foo {
};
int main() {
- delete [] new Bar[2];
+ try {
+ delete [] new Bar[2];
+ } catch (...) {
+ }
abort();
}
-
-
diff --git a/gcc/testsuite/g++.old-deja/g++.oliva/friend1.C b/gcc/testsuite/g++.old-deja/g++.oliva/friend1.C
new file mode 100644
index 00000000000..aea98e1136e
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.oliva/friend1.C
@@ -0,0 +1,12 @@
+// Build don't link:
+
+// Copyright (C) 2001 Free Software Foundation
+
+// by Alexandre Oliva <aoliva@redhat.com>
+
+// We shouldn't warn about bar referring to a non-template in this case.
+
+template <typename T>
+class foo {
+ friend int bar(int);
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.oliva/thunk1.C b/gcc/testsuite/g++.old-deja/g++.oliva/thunk1.C
index 225a1f98103..0aa2178da5d 100644
--- a/gcc/testsuite/g++.old-deja/g++.oliva/thunk1.C
+++ b/gcc/testsuite/g++.old-deja/g++.oliva/thunk1.C
@@ -3,8 +3,6 @@
// by Alexandre Oliva <oliva@dcc.unicamp.br>
// based on bug report by Fredrik Öhrström <d92-foh@nada.kth.se>
-// Special g++ Options: -fvtable-thunks
-
#include <cstdlib>
using namespace std;
diff --git a/gcc/testsuite/g++.old-deja/g++.other/anon8.C b/gcc/testsuite/g++.old-deja/g++.other/anon8.C
new file mode 100644
index 00000000000..54d41b788c6
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/anon8.C
@@ -0,0 +1,22 @@
+// Build don't link:
+
+struct B
+{
+ int a;
+ B & operator= (const B &);
+};
+
+struct A
+{
+ union {
+ int a;
+ };
+ B b;
+};
+
+A x;
+
+void foo (const A &y)
+{
+ x = y;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/array4.C b/gcc/testsuite/g++.old-deja/g++.other/array4.C
new file mode 100644
index 00000000000..9ac745c0dc4
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/array4.C
@@ -0,0 +1,10 @@
+// Build don't link:
+// We tried to create a temporary of unknown size and crashed.
+
+extern int a1[];
+extern int a2[];
+int foo(int p)
+{
+ int x = (p ? a1 : a2)[1];
+ return x;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/array5.C b/gcc/testsuite/g++.old-deja/g++.other/array5.C
new file mode 100644
index 00000000000..ab076f2af38
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/array5.C
@@ -0,0 +1,20 @@
+// Special g++ Options: -O1
+
+int count = 0;
+
+double foo () {
+ count++;
+ return 0;
+};
+
+double bar () {
+ const double x[1] = { foo() };
+ return x[0];
+};
+
+int main ()
+{
+ bar();
+ if (count != 1)
+ return 1;
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.other/asm2.C b/gcc/testsuite/g++.old-deja/g++.other/asm2.C
new file mode 100644
index 00000000000..d37de69329a
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/asm2.C
@@ -0,0 +1,11 @@
+// Build don't link:
+// Skip if not target: i?86-*-*
+// Special g++ Options: -O2
+
+typedef unsigned long long uint64;
+uint64 fstps(void)
+{
+ uint64 ret;
+ asm volatile("fstps %0" : "=m" (ret));
+ return ret;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/builtins1.C b/gcc/testsuite/g++.old-deja/g++.other/builtins1.C
index b6cea1e201f..4a1630b013d 100644
--- a/gcc/testsuite/g++.old-deja/g++.other/builtins1.C
+++ b/gcc/testsuite/g++.old-deja/g++.other/builtins1.C
@@ -7,27 +7,14 @@
namespace std
{
extern "C" void abort (void);
- extern "C" __SIZE_TYPE__ strlen (const char *);
}
int main ()
{
using namespace std;
- if (strlen ("hello") != 5)
- abort ();
- if (std::strlen ("hello") != 5)
- abort ();
if (::__builtin_strlen ("hello") != 5)
abort ();
return 0;
}
-
-extern "C"
-{
- static __SIZE_TYPE__ ::strlen (const char *)
- {
- std::abort ();
- }
-}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/builtins2.C b/gcc/testsuite/g++.old-deja/g++.other/builtins2.C
index 48e53f14343..9c55b762531 100644
--- a/gcc/testsuite/g++.old-deja/g++.other/builtins2.C
+++ b/gcc/testsuite/g++.old-deja/g++.other/builtins2.C
@@ -7,8 +7,6 @@
namespace std
{
extern "C" void abort (void);
- extern "C" char *strcpy (char *, const char *);
- extern "C" int memcmp (const void *, const void *, __SIZE_TYPE__);
}
int main ()
@@ -16,25 +14,9 @@ int main ()
using namespace std;
char f[16];
- if (strcpy (f, "hello world") != f
- || memcmp (f, "hello world", sizeof ("hello world")))
- abort ();
-
- if (std::strcpy (f, "bye world") != f
- || memcmp (f, "bye world", sizeof ("bye world")))
- abort ();
-
if (::__builtin_strcpy (f, "hello world") != f
- || memcmp (f, "hello world", sizeof ("hello world")))
+ || __builtin_memcmp (f, "hello world", sizeof ("hello world")))
abort ();
return 0;
}
-
-extern "C"
-{
- static char * ::strcpy (char *, const char *)
- {
- std::abort ();
- }
-}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/builtins3.C b/gcc/testsuite/g++.old-deja/g++.other/builtins3.C
index 4a67b28e969..e075d3fdba3 100644
--- a/gcc/testsuite/g++.old-deja/g++.other/builtins3.C
+++ b/gcc/testsuite/g++.old-deja/g++.other/builtins3.C
@@ -7,7 +7,6 @@
namespace std
{
extern "C" void abort (void);
- extern "C" void *alloca (__SIZE_TYPE__);
}
int main ()
@@ -15,14 +14,6 @@ int main ()
using namespace std;
void *foo;
- foo = alloca (32);
- if (!foo)
- abort ();
-
- foo = std::alloca (32);
- if (!foo)
- abort ();
-
foo = ::__builtin_alloca (32);
if (!foo)
abort ();
@@ -30,10 +21,3 @@ int main ()
return 0;
}
-extern "C"
-{
- static void * ::alloca (__SIZE_TYPE__)
- {
- std::abort ();
- }
-}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/builtins4.C b/gcc/testsuite/g++.old-deja/g++.other/builtins4.C
index 7118910a27f..235bb135752 100644
--- a/gcc/testsuite/g++.old-deja/g++.other/builtins4.C
+++ b/gcc/testsuite/g++.old-deja/g++.other/builtins4.C
@@ -7,21 +7,12 @@
namespace std
{
extern "C" void abort (void);
- extern "C" int printf (const char *, ...);
}
int main ()
{
using namespace std;
- printf ("hello world\n");
- printf ("\n");
- printf ("%s\n", "hello world");
- printf ("%c", '\n');
- std::printf ("hello world\n");
- std::printf ("\n");
- std::printf ("%s\n", "hello world");
- std::printf ("%c", '\n');
::__builtin_printf ("hello world\n");
::__builtin_printf ("\n");
::__builtin_printf ("%s\n", "hello world");
@@ -30,10 +21,3 @@ int main ()
return 0;
}
-extern "C"
-{
- static int ::printf (const char *, ...)
- {
- std::abort ();
- }
-}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/call1.C b/gcc/testsuite/g++.old-deja/g++.other/call1.C
index 7341488d949..1cf6d9708ff 100644
--- a/gcc/testsuite/g++.old-deja/g++.other/call1.C
+++ b/gcc/testsuite/g++.old-deja/g++.other/call1.C
@@ -23,7 +23,7 @@ struct B {
};
struct C {
- const fptr &pr;
+ const fptr pr;
C (fptr n): pr(n) { }
operator const fptr& () { return pr; }
diff --git a/gcc/testsuite/g++.old-deja/g++.other/cond7.C b/gcc/testsuite/g++.old-deja/g++.other/cond7.C
new file mode 100644
index 00000000000..49fa73ca1f8
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/cond7.C
@@ -0,0 +1,26 @@
+// Build don't link:
+//
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 24 Jul 2001 <nathan@codesourcery.com>
+
+// Bug 3416. We left some unchecked overloaded functions lying around.
+
+struct X
+{
+ void operator << (int);
+ void operator << (float);
+};
+
+void OVL1 (int);
+void OVL1 (float);
+
+void OVL2 (int);
+void OVL2 (float);
+
+X x;
+
+void foo (bool a)
+{
+ x << (a ? OVL1 : OVL2); // ERROR - incomplete type
+ a ? OVL1 : OVL2; // ERROR - incomplete type
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/conv7.C b/gcc/testsuite/g++.old-deja/g++.other/conv7.C
new file mode 100644
index 00000000000..0a7e76dfe3f
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/conv7.C
@@ -0,0 +1,45 @@
+// Build don't link:
+//
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 5 May 2001 <nathan@codesourcery.com>
+
+// Bug 2726. We ICE'd trying to say something about possibly confusing
+// conversion overload resolution.
+
+class foo
+{
+};
+
+template<class T>
+class bar
+{
+public:
+ operator const T&() const ;
+ operator T&() ;
+
+};
+
+
+template<class T, class Ref, class NodePtr, class ListPtr>
+class iterator_template
+{
+public:
+ iterator_template();
+ Ref operator*() const;
+
+};
+
+struct IdlDeclarator
+{
+};
+
+typedef bar< IdlDeclarator > IdlDeclarator_bar;
+int
+yyparse()
+
+{
+
+ iterator_template<IdlDeclarator_bar,IdlDeclarator_bar&,foo*,foo*> declIter;
+ const IdlDeclarator& declarator = *declIter; // WARNING - choosing
+ return 1;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/copy3.C b/gcc/testsuite/g++.old-deja/g++.other/copy3.C
new file mode 100644
index 00000000000..aa2c9058f8f
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/copy3.C
@@ -0,0 +1,23 @@
+// Build don't run:
+// Origin: ericp@mit.edu
+
+class bar {
+};
+
+class foo {
+ foo (const foo &f);
+
+public:
+
+ foo (bar x) {}
+ foo () {}
+
+ void test (const foo &f) {}
+};
+
+int main (void) {
+ foo f;
+ bar b;
+
+ f.test (b);
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/crash14.C b/gcc/testsuite/g++.old-deja/g++.other/crash14.C
index 85f093d7cc3..f249a67106a 100644
--- a/gcc/testsuite/g++.old-deja/g++.other/crash14.C
+++ b/gcc/testsuite/g++.old-deja/g++.other/crash14.C
@@ -1,5 +1,4 @@
// Build don't link:
-// Special g++ Options: -fnew-abi
// Origin: Mark Mitchell <mark@codesourcery.com>
struct S
diff --git a/gcc/testsuite/g++.old-deja/g++.other/crash18.C b/gcc/testsuite/g++.old-deja/g++.other/crash18.C
index ce0f64621c9..2fa185f56f1 100644
--- a/gcc/testsuite/g++.old-deja/g++.other/crash18.C
+++ b/gcc/testsuite/g++.old-deja/g++.other/crash18.C
@@ -1,7 +1,7 @@
// Build don't link:
// Special g++ Options: -fvtable-gc
// Origin: Mark Mitchell <mitchell@codesourcery.com>
-// excess errors test - XFAIL *-*-coff *-*-aout *-*-hms mips*-sgi-irix*
+// excess errors test - XFAIL *-*-*
struct S {
virtual void f ();
diff --git a/gcc/testsuite/g++.old-deja/g++.other/crash27.C b/gcc/testsuite/g++.old-deja/g++.other/crash27.C
index 6654bdfb00d..dfbacc80387 100644
--- a/gcc/testsuite/g++.old-deja/g++.other/crash27.C
+++ b/gcc/testsuite/g++.old-deja/g++.other/crash27.C
@@ -1,8 +1,6 @@
// Build don't link:
// Origin: Jakub Jelinek <jakub@redhat.com>
-// excess errors test - XFAIL *-*-*
-
X(Y(long, Type, CLink)); break; default: break; } } } // ERROR -
struct A {
diff --git a/gcc/testsuite/g++.old-deja/g++.other/crash31.C b/gcc/testsuite/g++.old-deja/g++.other/crash31.C
index 32912a0e7cb..9d5cc43178e 100644
--- a/gcc/testsuite/g++.old-deja/g++.other/crash31.C
+++ b/gcc/testsuite/g++.old-deja/g++.other/crash31.C
@@ -2,10 +2,11 @@
// Origin: Jakub Jelinek <jakub@redhat.com>
// crash test - XFAIL *-*-*
+// excess errors test - XFAIL *-*-*
namespace bar
{
struct foo
{
foo();
-}; // ERROR - parse error
+}; // ERROR - parse error XFAIL *-*-*
diff --git a/gcc/testsuite/g++.old-deja/g++.other/crash40.C b/gcc/testsuite/g++.old-deja/g++.other/crash40.C
new file mode 100644
index 00000000000..3af3f731a66
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/crash40.C
@@ -0,0 +1,19 @@
+// Build don't link:
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 11 April 2001 <nathan@codesourcery.com>
+// Origin: Theo Papadopoulo <Theodore.Papadopoulo@sophia.inria.fr>
+
+// Bug 1917. We were considering thunks to clones to be clones. and
+// hence getting confused.
+
+struct A { virtual ~A(); };
+struct B { virtual ~B(); };
+
+struct C: public A,B {};
+
+template <class TYPE>
+inline TYPE
+sqr(const TYPE& x) {
+ return 1;
+}
+int f(const int t) { return sqr(t); }
diff --git a/gcc/testsuite/g++.old-deja/g++.other/crash41.C b/gcc/testsuite/g++.old-deja/g++.other/crash41.C
new file mode 100644
index 00000000000..70434507f8c
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/crash41.C
@@ -0,0 +1,13 @@
+// Build don't link:
+//
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 8 May 2001 <nathan@codesourcery.com>
+
+// Bug 2744. We ICE'd on strange characters
+
+@ // ERROR - parse error
+int a; #// ERROR - parse error
+## // ERROR - parse error
+$ // ERROR - parse error
+£ // ERROR - parse error
+` // ERROR - parse error
diff --git a/gcc/testsuite/g++.old-deja/g++.other/crash42.C b/gcc/testsuite/g++.old-deja/g++.other/crash42.C
new file mode 100644
index 00000000000..be316ac6645
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/crash42.C
@@ -0,0 +1,17 @@
+// Build don't link:
+// Special g++ Options: -g
+//
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 25 Jul 2001 <nathan@codesourcery.com>
+
+// Bug 3152. Using a typedef to declare a function used an unset
+// global variable, last_function_parms.
+
+struct actor
+{
+ typedef bool (operation)();
+
+ operation a;
+ operation b;
+ operation c;
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.other/debug7.C b/gcc/testsuite/g++.old-deja/g++.other/debug7.C
new file mode 100644
index 00000000000..f79b00a9cc7
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/debug7.C
@@ -0,0 +1,11 @@
+// Build don't run:
+// Origin: Loren James Rittle <rittle@latour.rsch.comm.mot.com>
+// Special g++ Options: -g -O2
+
+namespace std {
+ const int __stl_chunk_size = 7;
+};
+
+int main ()
+{
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/debug8.C b/gcc/testsuite/g++.old-deja/g++.other/debug8.C
new file mode 100644
index 00000000000..2b78be2911f
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/debug8.C
@@ -0,0 +1,21 @@
+// Build don't link:
+// Special g++ Options: -g
+
+struct X {
+ const int x[4];
+};
+
+struct A {
+ A();
+ A(const A&);
+};
+
+struct B {
+ A a;
+ int b[4];
+};
+
+struct C {
+ A a;
+ C() { B b=B(); };
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.other/decl9.C b/gcc/testsuite/g++.old-deja/g++.other/decl9.C
new file mode 100644
index 00000000000..5ec9a6e4ece
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/decl9.C
@@ -0,0 +1,9 @@
+// Build don't link
+// Origin: batali@cogsci.ucsd.edu
+// Contributed by Gabriel Dos Reis <gdr@codesourcery.com>
+
+typedef struct { } S; // OK
+typedef struct { }; // ERROR - Missing type-name
+
+typedef union { } U; // OK
+typedef union { }; // ERROR - Missing type-name
diff --git a/gcc/testsuite/g++.old-deja/g++.other/defarg9.C b/gcc/testsuite/g++.old-deja/g++.other/defarg9.C
new file mode 100644
index 00000000000..f3b0a48c361
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/defarg9.C
@@ -0,0 +1,52 @@
+// Build don't link:
+//
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 24 April 2001 <nathan@codesourcery.com>
+
+// Bug 2608. A default parameter introduced in the definition of a
+// ctor never made it into the clones, leading to later overload
+// resolution failures. This is related to bug 2356.
+
+struct A
+{
+ A (int, int);
+};
+
+A::A (int d, int = 0)
+{
+ if (d)
+ {
+ A a (0);
+ }
+}
+
+void get_width ()
+{
+ A a (1);
+}
+
+struct B : A
+{
+ B ();
+};
+B::B ()
+ :A (1)
+{
+}
+
+struct C : virtual A
+{
+ C (int, int);
+};
+C::C (int, int = 0)
+ :A (1)
+{
+}
+struct D: C
+{
+ D ();
+};
+D::D ()
+ :A (0), C (0)
+{
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/delete8.C b/gcc/testsuite/g++.old-deja/g++.other/delete8.C
new file mode 100644
index 00000000000..1f884b70b53
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/delete8.C
@@ -0,0 +1,39 @@
+// Origin: Mark Mitchell <mark@codesourcery.com>
+
+#include <stdlib.h>
+
+struct S {
+ ~S ();
+};
+
+bool flag;
+S* s1;
+S* s2;
+
+void* operator new (size_t s)
+{
+ return malloc (s);
+}
+
+void operator delete (void* p)
+{
+ if (flag && p != s2)
+ abort ();
+}
+
+S::~S () {
+ if (this != s2)
+ abort ();
+ s1 = 0;
+}
+
+int main () {
+ s2 = new S;
+ s1 = s2;
+ // Turn on the check in `operator delete'.
+ flag = true;
+ delete s1;
+ // Turn it off again so that normal shutdown code works.
+ flag = false;
+}
+
diff --git a/gcc/testsuite/g++.old-deja/g++.other/eh4.C b/gcc/testsuite/g++.old-deja/g++.other/eh4.C
new file mode 100644
index 00000000000..e88a4337db4
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/eh4.C
@@ -0,0 +1,12 @@
+// Origin: Jean-Marc Bourguet <bourguet@cadence.com>
+// Build don't link:
+
+class foo {
+public:
+ foo() {};
+ void throwMe () {
+ throw *this; // ERROR - cannot be used in throw-expression
+ };
+ virtual void test () = 0;
+};
+
diff --git a/gcc/testsuite/g++.old-deja/g++.other/empty1.C b/gcc/testsuite/g++.old-deja/g++.other/empty1.C
index 1210327ee17..a876ce84a9f 100644
--- a/gcc/testsuite/g++.old-deja/g++.other/empty1.C
+++ b/gcc/testsuite/g++.old-deja/g++.other/empty1.C
@@ -1,4 +1,10 @@
// Origin: Mark Mitchell <mark@codesourcery.com>
+// This test case checks that the return value optimization works for
+// empty classes.
+
+// xfailed because empty classes clobbering what they overlay as the
+// backend treats them as single byte objects. See bug 4222
+// execution test - XFAIL *-*-*
extern "C" void abort();
extern "C" int printf (const char *, ...);
diff --git a/gcc/testsuite/g++.old-deja/g++.other/empty2.C b/gcc/testsuite/g++.old-deja/g++.other/empty2.C
new file mode 100644
index 00000000000..92585b8b03f
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/empty2.C
@@ -0,0 +1,10 @@
+// Build don't link:
+// Origin: Mark Mitchell <mark@codesourcery.com>
+
+struct E {};
+
+void f () {
+ E e1, e2;
+ e1 = e2; // We should not warn about this statement, even though no
+ // code is generated for it.
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/empty3.C b/gcc/testsuite/g++.old-deja/g++.other/empty3.C
new file mode 100644
index 00000000000..e6523e7c690
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/empty3.C
@@ -0,0 +1,28 @@
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 3 Sept 2001 <nathan@codesourcery.com>
+
+// Bug 4203. We were bit copying empty bases including the
+// padding. Which clobbers whatever they overlay.
+
+class EmptyBase0 {};
+class EmptyBase1 : public EmptyBase0 {};
+class Base1
+{
+public:
+unsigned int t_;
+Base1(unsigned int t) : t_(t) {}
+};
+
+class PEPE : public Base1, public EmptyBase1
+{
+public:
+PEPE(unsigned int t)
+ : Base1(t), EmptyBase1(EmptyBase1()) {}
+};
+
+int main()
+{
+ PEPE pepe(0xff);
+
+ return pepe.t_ != 255;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/enum3.C b/gcc/testsuite/g++.old-deja/g++.other/enum3.C
new file mode 100644
index 00000000000..f401613df3a
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/enum3.C
@@ -0,0 +1,13 @@
+// Origin: Mark Mitchell <mark@codesourcery.com>
+// Special g++ Options: -fshort-enums
+
+enum E {
+ a = -312
+};
+
+E e = a;
+
+int main () {
+ if ((int) e != -312)
+ return 1;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/externC5.C b/gcc/testsuite/g++.old-deja/g++.other/externC5.C
new file mode 100644
index 00000000000..aadbc5a46fe
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/externC5.C
@@ -0,0 +1,19 @@
+// Build don't link:
+// Origin: schmid@snake.iap.physik.tu-darmstadt.de
+
+extern "C" int rand (void) throw ();
+
+namespace std
+{
+extern "C" int rand(void) throw();
+template <class T> void f(T a) {}
+}
+
+using namespace std;
+
+int main()
+{
+ f(rand);
+ f(std::rand);
+ f(::rand);
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/fnname1.C b/gcc/testsuite/g++.old-deja/g++.other/fnname1.C
new file mode 100644
index 00000000000..8fcf07f08ef
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/fnname1.C
@@ -0,0 +1,8 @@
+// Build don't run:
+// Origin: Loren James Rittle <rittle@latour.rsch.comm.mot.com>
+// Special g++ Options: -g
+
+int main ()
+{
+ const char *s = __FUNCTION__;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/friend11.C b/gcc/testsuite/g++.old-deja/g++.other/friend11.C
new file mode 100644
index 00000000000..b9804c4e617
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/friend11.C
@@ -0,0 +1,12 @@
+// Build don't link:
+// Origin: robt@flyingpig.com
+
+class Outer
+{
+ friend void f1();
+ class Inner2;
+};
+
+class Outer::Inner2
+{
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.other/init16.C b/gcc/testsuite/g++.old-deja/g++.other/init16.C
index 8d7c1af3b10..83d5a4eb5c5 100644
--- a/gcc/testsuite/g++.old-deja/g++.other/init16.C
+++ b/gcc/testsuite/g++.old-deja/g++.other/init16.C
@@ -1,11 +1,28 @@
-// Build don't link:
// Origin: Jakub Jelinek <jakub@redhat.com>
-// excess errors test - XFAIL *-*-*
-
-#include <string>
+struct bar {
+ char c;
+ bar (const char *);
+ bar (const bar &);
+};
struct foo {
- string x;
+ bar x;
};
+
extern const struct foo y = { "foo" };
+
+bar::bar (const bar &ref)
+{
+ c = ref.c;
+}
+
+bar::bar (const char *p)
+{
+ c = p[2];
+}
+
+int main ()
+{
+ return y.x.c != 'o';
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/inline19.C b/gcc/testsuite/g++.old-deja/g++.other/inline19.C
index 8770eb326d5..c27aa5305be 100644
--- a/gcc/testsuite/g++.old-deja/g++.other/inline19.C
+++ b/gcc/testsuite/g++.old-deja/g++.other/inline19.C
@@ -2,7 +2,7 @@
// Origin: Scott Snyder <snyder@fnal.gov> via PR 1733.
// Special g++ Options: -O1
//
-// crash test - XFAIL *-*-*
+// crash test
struct TBtItem
{
diff --git a/gcc/testsuite/g++.old-deja/g++.other/inline20.C b/gcc/testsuite/g++.old-deja/g++.other/inline20.C
new file mode 100644
index 00000000000..a4af375f164
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/inline20.C
@@ -0,0 +1,58 @@
+// Build don't link:
+
+struct A {
+ int a, b, c, d;
+};
+
+inline void foo (int, A &);
+
+struct D {
+};
+
+struct E: public D {
+ void f (A &y)
+ {
+ foo (1, y);
+ }
+};
+
+struct F: public D {
+ void f (A &y)
+ {
+ foo (2, y);
+ }
+};
+
+E *d;
+F *e;
+
+inline int baz (int y)
+{
+ A a;
+ if (y) {
+ d->f (a);
+ } else {
+ e->f (a);
+ }
+ return 0;
+}
+
+inline void foo (int y, A &z)
+{
+ z.a = baz (y);
+ z.b = baz (y);
+ z.c = baz (y);
+ z.d = baz (y);
+}
+
+struct G {
+ E a;
+ F b;
+ void bar (A &);
+};
+
+void G::bar(A &y)
+{
+ a.f(y);
+ b.f(y);
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/inline21.C b/gcc/testsuite/g++.old-deja/g++.other/inline21.C
new file mode 100644
index 00000000000..1f3dd0eaa5c
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/inline21.C
@@ -0,0 +1,39 @@
+// Special g++ Options: -O2
+// Origin: suckfish@ihug.co.nz
+
+// DECLARATIONS
+
+struct Record {
+ Record (int bb) :
+ b (bb)
+ { }
+ int extra; // Having an extra member in record is crucial.
+ int b;
+};
+
+struct Container {
+ Record record;
+ // The const on the next line is crucial.
+ Container ( const Record b) : record(b) {}
+};
+
+
+// TEST FOR CORRECT BEHAVIOUR
+
+int myArray[3];
+int * intp = myArray;
+
+void use_pair (const Container & c)
+{
+ *intp++ = c.record.b;
+}
+
+extern "C" int printf (const char *,...);
+
+int main()
+{
+ use_pair (Container (1234));
+
+ if (myArray[0] != 1234)
+ return 1;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/inline8.C b/gcc/testsuite/g++.old-deja/g++.other/inline8.C
index a5b540bcf72..17965d9a90b 100644
--- a/gcc/testsuite/g++.old-deja/g++.other/inline8.C
+++ b/gcc/testsuite/g++.old-deja/g++.other/inline8.C
@@ -23,23 +23,23 @@ public:
NAMES_ITEM::NAMES_ITEM (const NAMES_ITEM& item2)
{
- size_t length=strlen(item2.name);
+ size_t length=std::strlen(item2.name);
name=new char[length+1];
- memcpy(name,item2.name,length+1);
+ std::memcpy(name,item2.name,length+1);
}
NAMES_ITEM::NAMES_ITEM (const char* name2)
{
- size_t length=strlen(name2);
+ size_t length=std::strlen(name2);
name=new char[length+1];
- memcpy(name,name2,length+1);
+ std::memcpy(name,name2,length+1);
}
NAMES_ITEM::~NAMES_ITEM ()
{
- if (strcmp (name, "one") != 0)
+ if (std::strcmp (name, "one") != 0)
abort ();
name=0;
@@ -47,12 +47,12 @@ NAMES_ITEM::~NAMES_ITEM ()
bool NAMES_ITEM::operator==(const NAMES_ITEM& n) const
{
- return (strcmp(name,n.name) == 0);
+ return (std::strcmp(name,n.name) == 0);
}
bool operator<(const NAMES_ITEM& n1, const NAMES_ITEM& n2)
{
- return (strcmp(n1.name,n2.name) < 0);
+ return (std::strcmp(n1.name,n2.name) < 0);
}
typedef map<NAMES_ITEM,size_t,less<NAMES_ITEM> > lookup_t;
diff --git a/gcc/testsuite/g++.old-deja/g++.other/lex1.C b/gcc/testsuite/g++.old-deja/g++.other/lex1.C
new file mode 100644
index 00000000000..b639f05c39a
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/lex1.C
@@ -0,0 +1,12 @@
+// Build don't link:
+//
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 26 April 2001 <nathan@codesourcery.com>
+
+// Bug 2510. We ICEd when a bogus char was present.
+
+void foo ()
+{
+ // there is a ctrl-h on the next line
+  // ERROR - stray char
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/lineno5.C b/gcc/testsuite/g++.old-deja/g++.other/lineno5.C
new file mode 100644
index 00000000000..dc779ed894a
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/lineno5.C
@@ -0,0 +1,19 @@
+// Build don't link:
+//
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 25 Jul 2001 <nathan@codesourcery.com>
+
+// Origin: johanb@DoCS.UU.SE
+// Bug 3621. At the end of saved input, we'd set the lineno to
+// zero. This would confusing things no end, if there was a subsequent
+// error.
+
+namespace tmp {
+ typedef int B;
+ B b;
+}
+
+class A {
+ public:
+ int kaka(tmp::B = b); // ERROR - no b in scope
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.other/linkage7.C b/gcc/testsuite/g++.old-deja/g++.other/linkage7.C
new file mode 100644
index 00000000000..b168e013db1
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/linkage7.C
@@ -0,0 +1,14 @@
+// Build don't run:
+// Origin: Mark Mitchell <mark@codesourcery.com>
+
+namespace N {
+ extern "C" int i;
+
+ void f () {
+ i = 3;
+ }
+};
+
+int i;
+
+int main () { N::f (); }
diff --git a/gcc/testsuite/g++.old-deja/g++.other/lookup22.C b/gcc/testsuite/g++.old-deja/g++.other/lookup22.C
new file mode 100644
index 00000000000..c62ce50e129
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/lookup22.C
@@ -0,0 +1,13 @@
+// Origin: GerhardTonn@gmx.de
+// Build don't link:
+
+struct super {
+ union {
+ int myName;
+ void* secondMember;
+ };
+};
+
+struct sub : super {
+ int myName() { return 1; }
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.other/lookup23.C b/gcc/testsuite/g++.old-deja/g++.other/lookup23.C
new file mode 100644
index 00000000000..9deee9eda45
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/lookup23.C
@@ -0,0 +1,13 @@
+// Test for proper handling of type lookup if base class has field with the
+// same name as the containing class.
+// Build don't link:
+
+struct a { int a; };
+struct b : a {};
+
+b x;
+
+void foo ()
+{
+ x.a = 22;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/mangle1.C b/gcc/testsuite/g++.old-deja/g++.other/mangle1.C
deleted file mode 100644
index 21e7b32d9a0..00000000000
--- a/gcc/testsuite/g++.old-deja/g++.other/mangle1.C
+++ /dev/null
@@ -1,58 +0,0 @@
-// Test for proper mangling by setting up name clashes.
-// Special g++ Options: -fno-squangle
-
-#if (!defined (__GXX_ABI_VERSION) || __GXX_ABI_VERSION < 100)
-#define NAME(OLD, NEW) OLD
-#else
-#define NAME(OLD, NEW) NEW
-#endif /* (!defined (__GXX_ABI_VERSION) || __GXX_ABI_VERSION < 100) */
-
-class A { };
-typedef A A2;
-typedef int I;
-typedef void V;
-typedef I I2;
-
-void f (const A2&, int, const A2&, const A&) { } // ERROR - name clash
-int NAME (f__FRC1AiT0T0, _Z1fRK1AiS1_S1_) = 0; // ERROR - name clash
-
-void f (int, long, int, I) { } // ERROR - name clash
-int NAME (f__Filii, _Z1filii) = 0; // ERROR - name clash
-
-void f (I, float, I, I2) { } // ERROR - name clash
-int NAME (f__Fifii, _Z1fifii) = 0; // ERROR - name clash
-
-void f (void*, float, void*, V*) { } // ERROR - name clash
-int NAME (f__FPvfT0T0, _Z1fPvfS_S_) = 0; // ERROR - name clash
-
-void f (wchar_t) { } // ERROR - name clash
-int NAME (f__Fw, _Z1fw) = 0; // ERROR - name clash
-
-void f(int, A, A2, A) { } // ERROR - name clash
-int NAME (f__FiG1AN21, _Z1fi1AS_S_) = 0; // ERROR - name clash
-
-void f(const A2&, const A2&, const A2&, const A2&,
- int&) { } // ERROR - name clash
-int NAME (f__FRC1AN30Ri, _Z1fRK1AS1_S1_S1_Ri) = 0; // ERROR - name clash
-
-void f(const A2&, int, const A2&, const A2&, const A2&,
- int&) { } // ERROR - name clash
-int NAME (f__FRC1AiT0N20Ri, _Z1fRK1AiS1_S1_S1_Ri) = 0; // ERROR - name clash
-
-void f(const A2&, int, const A2&, const A2&, const A2&, int&, int&,
- int&) { } // ERROR - name clash
-int NAME (f__FRC1AiT0N20RiN25, _Z1fRK1AiS1_S1_S1_RiS2_S2_) = 0; // ERROR - name clash
-
-void f(const A2&, int, const A2&, const A2&, const A2&, int, int,
- int) { } // ERROR - name clash
-int NAME (f__FRC1AiT0N20iii, _Z1fRK1AiS1_S1_S1_iii) = 0; // ERROR - name clash
-
-void f(bool, bool) {} // ERROR - name clash
-int NAME (f__FbT0, _Z1fbb) = 0; // ERROR - name clash
-
-int
-main ()
-{
- return 0;
-}
-
diff --git a/gcc/testsuite/g++.old-deja/g++.other/mangle3.C b/gcc/testsuite/g++.old-deja/g++.other/mangle3.C
new file mode 100644
index 00000000000..d77a4b548de
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/mangle3.C
@@ -0,0 +1,41 @@
+struct foo {
+ static int bar ()
+ {
+ int i;
+ static int baz = 1;
+ {
+ static int baz = 2;
+ i = baz++;
+ }
+ {
+ struct baz {
+ static int m ()
+ {
+ static int n;
+ return n += 10;
+ }
+ };
+ baz a;
+ i += a.m ();
+ }
+ {
+ static int baz = 3;
+ i += baz;
+ baz += 30;
+ }
+ i += baz;
+ baz += 60;
+ return i;
+ }
+};
+
+int main ()
+{
+ foo x;
+
+ if (x.bar () != 16)
+ return 1;
+ if (x.bar() != 117)
+ return 1;
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/new7.C b/gcc/testsuite/g++.old-deja/g++.other/new7.C
new file mode 100644
index 00000000000..35ec0bbac88
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/new7.C
@@ -0,0 +1,39 @@
+// Origin: philip_martin@ntlworld.com
+
+#include <new>
+
+extern "C" void abort();
+
+bool new_flag = false;
+bool delete_flag = false;
+
+struct X {
+ X()
+ {
+ throw 1;
+ }
+ void* operator new ( std::size_t n ) throw ( std::bad_alloc )
+ {
+ new_flag = true;
+ return ::operator new( n );
+ }
+ void operator delete( void* p, std::size_t n ) throw()
+ {
+ delete_flag = true;
+ ::operator delete( p );
+ }
+};
+
+int
+main()
+{
+ try
+ {
+ X* x = new X; // gcc 3.0 fails to call operator delete when X::X throws
+ }
+ catch ( ... )
+ {
+ }
+ if ( ! new_flag || ! delete_flag )
+ ::abort();
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/op2.C b/gcc/testsuite/g++.old-deja/g++.other/op2.C
index 70af6ac34a0..4e5528f9583 100644
--- a/gcc/testsuite/g++.old-deja/g++.other/op2.C
+++ b/gcc/testsuite/g++.old-deja/g++.other/op2.C
@@ -1,4 +1,4 @@
-// Copyright (C) 2000 Free Software Foundation, Inc.
+// Copyright (C) 2000, 2001 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 28 Nov 2000 <nathan@codesourcery.com>
// Bug 91. We'd not preserve constness looking for a base classes assignment
@@ -6,23 +6,23 @@
#include <stdio.h>
-int glob = 0;
+int value = 0;
struct A
{
A() {}
A( A& arg)
- { printf ("%s\n", __PRETTY_FUNCTION__); glob = 1;}
+ { printf ("%s\n", __PRETTY_FUNCTION__); value = 1;}
A( const A& arg)
- { printf ("%s\n", __PRETTY_FUNCTION__); glob = 2;}
+ { printf ("%s\n", __PRETTY_FUNCTION__); value = 2;}
A& operator=( A& )
- { printf ("%s\n", __PRETTY_FUNCTION__); glob = 3; return *this; }
+ { printf ("%s\n", __PRETTY_FUNCTION__); value = 3; return *this; }
A& operator=( const A& )
- { printf ("%s\n", __PRETTY_FUNCTION__); glob = 4; return *this; }
+ { printf ("%s\n", __PRETTY_FUNCTION__); value = 4; return *this; }
};
struct B : A
@@ -32,32 +32,32 @@ struct B : A
void foo( A& )
{
- printf ("%s\n", __PRETTY_FUNCTION__); glob = 5;
+ printf ("%s\n", __PRETTY_FUNCTION__); value = 5;
}
void foo( const A& )
{
- printf ("%s\n", __PRETTY_FUNCTION__); glob = 6;
+ printf ("%s\n", __PRETTY_FUNCTION__); value = 6;
}
int main()
{
const A a0;
- glob = 0; printf ("A(cA) : "); A a1(a0); if (glob != 2) return 1;
- glob = 0; printf ("A(A ) : "); A a2(a1); if (glob != 1) return 2;
+ value = 0; printf ("A(cA) : "); A a1(a0); if (value != 2) return 1;
+ value = 0; printf ("A(A ) : "); A a2(a1); if (value != 1) return 2;
const B b0;
- glob = 0; printf ("B(cB) : "); B b1(b0); if (glob != 2) return 3;
- glob = 0; printf ("B(B ) : "); B b2(b1); if (glob != 2) return 4;
+ value = 0; printf ("B(cB) : "); B b1(b0); if (value != 2) return 3;
+ value = 0; printf ("B(B ) : "); B b2(b1); if (value != 2) return 4;
- glob = 0; printf ("A= cA : "); a1 = a0; if (glob != 4) return 5;
- glob = 0; printf ("A= A : "); a1 = a2; if (glob != 3) return 6;
- glob = 0; printf ("B= cB : "); b1 = b0; if (glob != 4) return 7;
- glob = 0; printf ("B= B : "); b1 = b2; if (glob != 4) return 8;
+ value = 0; printf ("A= cA : "); a1 = a0; if (value != 4) return 5;
+ value = 0; printf ("A= A : "); a1 = a2; if (value != 3) return 6;
+ value = 0; printf ("B= cB : "); b1 = b0; if (value != 4) return 7;
+ value = 0; printf ("B= B : "); b1 = b2; if (value != 4) return 8;
- glob = 0; printf ("foo(cB): "); foo(b0); if (glob != 6) return 9;
- glob = 0; printf ("foo(B ): "); foo(b2); if (glob != 5) return 10;
+ value = 0; printf ("foo(cB): "); foo(b0); if (value != 6) return 9;
+ value = 0; printf ("foo(B ): "); foo(b2); if (value != 5) return 10;
return 0;
}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/op3.C b/gcc/testsuite/g++.old-deja/g++.other/op3.C
index 957b4d32fd3..08833c49104 100644
--- a/gcc/testsuite/g++.old-deja/g++.other/op3.C
+++ b/gcc/testsuite/g++.old-deja/g++.other/op3.C
@@ -1,4 +1,4 @@
-// Copyright (C) 2000 Free Software Foundation, Inc.
+// Copyright (C) 2000, 2001 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 28 Nov 2000 <nathan@codesourcery.com>
// Related to bug 91. We'd not preserve constness accessing a member of the
@@ -6,23 +6,23 @@
#include <stdio.h>
-int glob = 0;
+int value = 0;
struct A
{
A() {}
A( A& arg)
- { printf ("%s\n", __PRETTY_FUNCTION__); glob = 1;}
+ { printf ("%s\n", __PRETTY_FUNCTION__); value = 1;}
A( const A& arg)
- { printf ("%s\n", __PRETTY_FUNCTION__); glob = 2;}
+ { printf ("%s\n", __PRETTY_FUNCTION__); value = 2;}
A& operator=( A& )
- { printf ("%s\n", __PRETTY_FUNCTION__); glob = 3; return *this; }
+ { printf ("%s\n", __PRETTY_FUNCTION__); value = 3; return *this; }
A& operator=( const A& )
- { printf ("%s\n", __PRETTY_FUNCTION__); glob = 4; return *this; }
+ { printf ("%s\n", __PRETTY_FUNCTION__); value = 4; return *this; }
};
struct B
@@ -33,31 +33,31 @@ struct B
void foo( A& )
{
- printf ("%s\n", __PRETTY_FUNCTION__); glob = 5;
+ printf ("%s\n", __PRETTY_FUNCTION__); value = 5;
}
void foo( const A& )
{
- printf ("%s\n", __PRETTY_FUNCTION__); glob = 6;
+ printf ("%s\n", __PRETTY_FUNCTION__); value = 6;
}
int main()
{
const A a0;
- glob = 0; printf ("A(cA) : "); A a1(a0); if (glob != 2) return 1;
- glob = 0; printf ("A(A ) : "); A a2(a1); if (glob != 1) return 2;
+ value = 0; printf ("A(cA) : "); A a1(a0); if (value != 2) return 1;
+ value = 0; printf ("A(A ) : "); A a2(a1); if (value != 1) return 2;
const B b0;
- glob = 0; printf ("B(cB) : "); B b1(b0); if (glob != 2) return 3;
- glob = 0; printf ("B(B ) : "); B b2(b1); if (glob != 2) return 4;
+ value = 0; printf ("B(cB) : "); B b1(b0); if (value != 2) return 3;
+ value = 0; printf ("B(B ) : "); B b2(b1); if (value != 2) return 4;
- glob = 0; printf ("A= cA : "); a1 = a0; if (glob != 4) return 5;
- glob = 0; printf ("A= A : "); a1 = a2; if (glob != 3) return 6;
- glob = 0; printf ("B= cB : "); b1 = b0; if (glob != 4) return 7;
- glob = 0; printf ("B= B : "); b1 = b2; if (glob != 4) return 8;
+ value = 0; printf ("A= cA : "); a1 = a0; if (value != 4) return 5;
+ value = 0; printf ("A= A : "); a1 = a2; if (value != 3) return 6;
+ value = 0; printf ("B= cB : "); b1 = b0; if (value != 4) return 7;
+ value = 0; printf ("B= B : "); b1 = b2; if (value != 4) return 8;
- glob = 0; printf ("foo(cB): "); foo(b0.a); if (glob != 6) return 9;
- glob = 0; printf ("foo(B ): "); foo(b2.a); if (glob != 5) return 10;
+ value = 0; printf ("foo(cB): "); foo(b0.a); if (value != 6) return 9;
+ value = 0; printf ("foo(B ): "); foo(b2.a); if (value != 5) return 10;
return 0;
}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/optimize1.C b/gcc/testsuite/g++.old-deja/g++.other/optimize1.C
new file mode 100644
index 00000000000..bff78dc3eab
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/optimize1.C
@@ -0,0 +1,70 @@
+// Special g++ Options: -O2
+//
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 18 May 2001 <nathan@codesourcery.com>
+
+// Bug 2781. We forgot to copy addressability information when
+// cloning.
+
+struct B
+{
+ B(int v1);
+ void Member (int v1);
+ static void Static (int v1);
+};
+
+struct D : B
+{
+ D (int v1);
+};
+
+void xswap(int& x1) ;
+
+int xxx = 0;
+
+B::B(int v1)
+{
+ xswap(v1);
+ xxx = v1;
+}
+
+void B::Member(int v1)
+{
+ xswap(v1);
+ xxx = v1;
+}
+
+void B::Static(int v1)
+{
+ xswap(v1);
+ xxx = v1;
+}
+
+D::D(int v1)
+ : B (v1)
+{
+}
+
+void xswap (int& x1) { x1 = 2; }
+
+int main ()
+{
+ B p (1);
+
+ if (xxx != 2)
+ return 1;
+
+ D q (1);
+ if (xxx != 2)
+ return 2;
+
+ p.Member (1);
+ if (xxx != 2)
+ return 3;
+
+ p.Static (1);
+ if (xxx != 2)
+ return 4;
+
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/optimize2.C b/gcc/testsuite/g++.old-deja/g++.other/optimize2.C
new file mode 100644
index 00000000000..8a62b32233f
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/optimize2.C
@@ -0,0 +1,74 @@
+// Special g++ Options: -O2
+//
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 26 May 2001 <nathan@codesourcery.com>
+
+// Bug 2823. Inlineing the body of a thunk broke things. But that's
+// rarely a sensible thing to do anyway.
+
+#include <cstdio>
+#include <cstdlib>
+
+int objCount = 0;
+
+struct Thing
+{
+ int count;
+
+ Thing ();
+ Thing (Thing const &src);
+
+ ~Thing ();
+
+};
+
+Thing::Thing ()
+ :count (0)
+{
+ objCount++;
+ std::printf ("%p %s\n", (void *)this,__PRETTY_FUNCTION__);
+}
+
+Thing::Thing (Thing const &src)
+ :count (0)
+{
+ objCount++;
+ std::printf ("%p %s\n", (void *)this, __PRETTY_FUNCTION__);
+}
+
+Thing::~Thing ()
+{
+ std::printf ("%p %s\n", (void *)this, __PRETTY_FUNCTION__);
+ if (count)
+ std::abort ();
+ count--;
+ objCount--;
+}
+
+void x(Thing name)
+{
+ // destruct name here
+}
+
+class Base
+{
+ public:
+ virtual void test(const Thing& s) = 0;
+};
+
+class Impl : virtual public Base
+{
+ public:
+ virtual void test(const Thing& s)
+ {
+ x(s); // copy construct temporary
+ }
+};
+
+int main()
+{
+ Impl *impl = new Impl();
+
+ impl->test( Thing ()); // This will use a thunk
+ return objCount != 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/optimize3.C b/gcc/testsuite/g++.old-deja/g++.other/optimize3.C
new file mode 100644
index 00000000000..737aabb3a7a
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/optimize3.C
@@ -0,0 +1,38 @@
+// Special g++ Options: -O2
+//
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 29 May 2001 <nathan@codesourcery.com>
+
+// Bug 2936. We ICE'd on tree inlining a function with an anonymous
+// union decl.
+
+inline const unsigned char *Foo (const char *string)
+{
+ union
+ {
+ const char *p1;
+ const unsigned char *p2;
+ };
+ p1 = 0;
+ p2 = 0;
+
+
+ p1 = string;
+ return p2;
+
+}
+
+const unsigned char *Baz (const char *string)
+{
+ return Foo (string);
+}
+
+int main ()
+{
+ const char *string = "s";
+ const unsigned char *result;
+
+ result = Baz (string);
+ return (static_cast <const void *> (result)
+ != static_cast <const void *> (string));
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/optimize4.C b/gcc/testsuite/g++.old-deja/g++.other/optimize4.C
new file mode 100644
index 00000000000..7082e2cb951
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/optimize4.C
@@ -0,0 +1,31 @@
+// Build don't link:
+//
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 24 Jul 2001 <nathan@codesourcery.com>
+
+// Bug 3543. We forgot to resolve an OFFSET_REF
+
+
+struct Writeable {
+ bool blocking_mode;
+};
+
+
+struct Pipe : Writeable {
+ void ewrite();
+
+ void set_write_blocking ()
+ {
+ if (Writeable::blocking_mode);
+ }
+};
+
+void Pipe::ewrite()
+{
+ set_write_blocking();
+}
+
+void ewrite(Pipe &p)
+{
+ p.set_write_blocking();
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/overload14.C b/gcc/testsuite/g++.old-deja/g++.other/overload14.C
new file mode 100644
index 00000000000..8938ef1d7d4
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/overload14.C
@@ -0,0 +1,31 @@
+extern "C" void abort();
+
+struct A {
+ typedef double (&B);
+ typedef const double (&C);
+
+ A() { }
+
+ operator C () const;
+ operator B ();
+};
+
+static const double d = 2.0;
+static double e = 3.0;
+
+A::operator A::C () const
+{
+ abort ();
+ return d;
+}
+
+A::operator A::B ()
+{
+ return e;
+}
+
+int main ()
+{
+ (A::C) A (); // WARNING -
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/override1.C b/gcc/testsuite/g++.old-deja/g++.other/override1.C
new file mode 100644
index 00000000000..c7f3a4c9c0a
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/override1.C
@@ -0,0 +1,20 @@
+// Build don't link:
+// Origin: Frank Pilhofer <fp@fpx.de>
+
+struct A {
+virtual void f ();
+};
+
+struct B : virtual public A {
+void f ();
+};
+
+struct C : virtual public A {
+void f ();
+};
+
+struct D : virtual public B, virtual public C {
+void f ();
+};
+
+struct Di : virtual public B, virtual public C, virtual public D {};
diff --git a/gcc/testsuite/g++.old-deja/g++.other/override2.C b/gcc/testsuite/g++.old-deja/g++.other/override2.C
new file mode 100644
index 00000000000..6466b7d76ef
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/override2.C
@@ -0,0 +1,9 @@
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Jason Merrill 14 Jun 2001 <jason@redhat.com>
+
+// Test for diagnosis of missing final overrider.
+
+struct A { virtual void f (); };
+struct B1: virtual A { virtual void f (); };
+struct B2: virtual A { virtual void f (); };
+struct C: public B1, public B2 {}; // ERROR - no final overrider
diff --git a/gcc/testsuite/g++.old-deja/g++.other/perf1.C b/gcc/testsuite/g++.old-deja/g++.other/perf1.C
new file mode 100644
index 00000000000..3f898117511
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/perf1.C
@@ -0,0 +1,78 @@
+// Build don't link:
+
+// Test of severe performance regression from 2.95. This code generates
+// a heavily self-referential tree which caused the inliner to take
+// O(3**N) time to scan it for function calls.
+// Reported by Kelley Cook <kelley.cook@home.com>. PR c++/1687.
+
+bool in0 ;
+bool in1 ;
+bool in2 ;
+bool in3 ;
+bool in4 ;
+bool in5 ;
+bool in6 ;
+bool in7 ;
+bool in8 ;
+bool in9 ;
+bool in10;
+bool in11;
+bool in12;
+bool in13;
+bool in14;
+bool in15;
+bool in16;
+bool in17;
+bool in18;
+bool in19;
+bool in20;
+bool in21;
+bool in22;
+bool in23;
+bool in24;
+bool in25;
+bool in26;
+bool in27;
+bool in28;
+bool in29;
+bool in30;
+bool in31;
+unsigned long output;
+
+void mux(void)
+{
+ output =
+ (in0 ? 0x00000001 : 0) |
+ (in1 ? 0x00000002 : 0) |
+ (in2 ? 0x00000004 : 0) |
+ (in3 ? 0x00000008 : 0) |
+ (in4 ? 0x00000010 : 0) |
+ (in5 ? 0x00000020 : 0) |
+ (in6 ? 0x00000040 : 0) |
+ (in7 ? 0x00000080 : 0) |
+ (in8 ? 0x00000100 : 0) |
+ (in9 ? 0x00000200 : 0) |
+ (in10 ? 0x00000400 : 0) |
+ (in11 ? 0x00000800 : 0) |
+ (in12 ? 0x00001000 : 0) |
+ (in13 ? 0x00002000 : 0) |
+ (in14 ? 0x00004000 : 0) |
+ (in15 ? 0x00008000 : 0) |
+ (in16 ? 0x00010000 : 0) |
+ (in17 ? 0x00020000 : 0) |
+ (in18 ? 0x00040000 : 0) |
+ (in19 ? 0x00080000 : 0) |
+ (in20 ? 0x00100000 : 0) |
+ (in21 ? 0x00200000 : 0) |
+ (in22 ? 0x00400000 : 0) |
+ (in23 ? 0x00800000 : 0) |
+ (in24 ? 0x01000000 : 0) |
+ (in25 ? 0x02000000 : 0) |
+ (in26 ? 0x04000000 : 0) |
+ (in27 ? 0x08000000 : 0) |
+ (in28 ? 0x10000000 : 0) |
+ (in29 ? 0x20000000 : 0) |
+ (in30 ? 0x40000000 : 0) |
+ (in31 ? 0x80000000 : 0) ;
+}
+
diff --git a/gcc/testsuite/g++.old-deja/g++.other/pod1.C b/gcc/testsuite/g++.old-deja/g++.other/pod1.C
new file mode 100644
index 00000000000..c6faf0d0b18
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/pod1.C
@@ -0,0 +1,21 @@
+// Build don't link:
+
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 28 Feb 2001 <nathan@codesourcery.com>
+
+// DR 148. Now allows pointer to members in POD struct.
+
+struct X
+{
+ int X::*m;
+ int (X::*f) ();
+};
+
+void Foo (int, ...);
+
+void Baz ()
+{
+ X x;
+
+ Foo (1, x);
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/ptrmem6.C b/gcc/testsuite/g++.old-deja/g++.other/ptrmem6.C
index 3e9db8daec9..53087f825c7 100644
--- a/gcc/testsuite/g++.old-deja/g++.other/ptrmem6.C
+++ b/gcc/testsuite/g++.old-deja/g++.other/ptrmem6.C
@@ -1,7 +1,7 @@
// Build don't link:
// crash test - XFAIL *-*-*
-// Copyright (c) 2000 Free Software Foundation.
+// Copyright (c) 2000, 2001 Free Software Foundation.
// Distilled from a bug report by Eric Ford <eford@princeton.edu>
extern double *y;
@@ -12,5 +12,5 @@ void SetInitCond(void)
{
int i;
for(i = 2; i < nPoints; ++i)
- y[i] = y[nPoints] .* (x[i]-x[1]) / (x[nPoints]-x[1]); // ERROR
+ y[i] = y[nPoints] .* (x[i]-x[1]) / (x[nPoints]-x[1]); // ERROR -
}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/ref4.C b/gcc/testsuite/g++.old-deja/g++.other/ref4.C
new file mode 100644
index 00000000000..c3535d0d3e0
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/ref4.C
@@ -0,0 +1,28 @@
+// Build don't link:
+
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 27 Feb 2001 <nathan@codesourcery.com>
+
+// Bug 2117. A conversion op to reference type created a temporary, even
+// when bound to another reference.
+
+struct Abstract
+{
+ virtual void Foo () = 0;
+};
+
+struct Proxy
+{
+ operator Abstract & ();
+ Abstract &Convert ();
+};
+
+void Baz (Abstract &);
+
+void Foo ()
+{
+ Proxy proxy;
+
+ Baz (proxy);
+ Baz (proxy.Convert ());
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/regstack.C b/gcc/testsuite/g++.old-deja/g++.other/regstack.C
new file mode 100644
index 00000000000..ea7222156de
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/regstack.C
@@ -0,0 +1,31 @@
+// Special g++ Options: -O2
+// Skip if not target: i?86-*-*
+
+inline double foo (double x)
+{
+ register double r;
+ asm volatile ("fsqrt" : "=t" (r) : "0" (x));
+ return r;
+}
+
+struct X
+{
+ ~X() {}
+};
+
+int b;
+
+double bar (X x)
+{
+ if (b)
+ return 1.0;
+ return 36.0 * foo (36.0);
+}
+
+int main ()
+{
+ X x;
+ if (bar (x) != 216.0)
+ return 1;
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/return1.C b/gcc/testsuite/g++.old-deja/g++.other/return1.C
new file mode 100644
index 00000000000..5b998460ab3
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/return1.C
@@ -0,0 +1,17 @@
+// Build don't link:
+// Special g++ Option:
+
+struct C {
+ int f() {return 0;}
+};
+
+struct D {
+ C a[1];
+ C* g();
+};
+
+C* D::g() {
+ int i = 0;
+ while (i < 1 && a[i].f() != 1) {}
+ return undefined_variable; // ERROR -
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/sibcall1.C b/gcc/testsuite/g++.old-deja/g++.other/sibcall1.C
index 99a1dc176e4..c6eadaa3dd5 100644
--- a/gcc/testsuite/g++.old-deja/g++.other/sibcall1.C
+++ b/gcc/testsuite/g++.old-deja/g++.other/sibcall1.C
@@ -1,13 +1,13 @@
// Special g++ Options: -O2
-#include <iostream.h>
+#include <iostream>
-ostream& foo (char *x, ostream &y)
+std::ostream& foo (char *x, std::ostream &y)
{
return y << "" << x;
}
int main ()
{
- foo ("", cout);
+ foo ("", std::cout);
}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/static8.C b/gcc/testsuite/g++.old-deja/g++.other/static8.C
deleted file mode 100644
index 5672d728be8..00000000000
--- a/gcc/testsuite/g++.old-deja/g++.other/static8.C
+++ /dev/null
@@ -1,13 +0,0 @@
-// Build don't link:
-// Special g++ Options: -fno-squangle
-// Origin: Mark Mitchell <mark@codesourcery.com>
-
-#if (!defined (__GXX_ABI_VERSION) || __GXX_ABI_VERSION < 100)
-#define NAME(OLD, NEW) OLD
-#else
-#define NAME(OLD, NEW) NEW
-#endif /* (!defined (__GXX_ABI_VERSION) || __GXX_ABI_VERSION < 100) */
-
-static unsigned int strlen (const char*) {return 0;} // ERROR - previous declaration
-
-int NAME (strlen__FPCc, _Z6strlenPKc) = 0; // ERROR - duplicate declaration
diff --git a/gcc/testsuite/g++.old-deja/g++.other/std1.C b/gcc/testsuite/g++.old-deja/g++.other/std1.C
index 21a232a0879..dc36519d050 100644
--- a/gcc/testsuite/g++.old-deja/g++.other/std1.C
+++ b/gcc/testsuite/g++.old-deja/g++.other/std1.C
@@ -1,5 +1,4 @@
// Build don't link:
-// Special g++ Options: -fhonor-std
// Origin: Mark Mitchell <mark@codesourcery.com>
extern "C" int memcmp (const void * __s1,
diff --git a/gcc/testsuite/g++.old-deja/g++.other/thunk1.C b/gcc/testsuite/g++.old-deja/g++.other/thunk1.C
new file mode 100644
index 00000000000..72ca2ce5008
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/thunk1.C
@@ -0,0 +1,35 @@
+extern "C" void abort();
+
+int ic;
+
+struct X
+{
+ X() { ++ic; }
+ X( const X & ) { ++ic; }
+ ~X() { if (--ic < 0) abort(); }
+};
+
+struct V
+{
+ virtual ~V() {}
+};
+
+struct A : public virtual V
+{
+};
+
+struct B : public virtual V
+{
+ virtual void foo( X ) = 0;
+};
+
+struct D : public A, public virtual B
+{
+ virtual void foo( X ) {}
+};
+
+int main()
+{
+ B *b = new D;
+ b->foo( X() );
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/typeid1.C b/gcc/testsuite/g++.old-deja/g++.other/typeid1.C
new file mode 100644
index 00000000000..e50f3c2bf87
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/typeid1.C
@@ -0,0 +1,15 @@
+// Build don't link:
+// Origin: sk@gluit.de
+// Special g++ Options:
+
+#include <typeinfo>
+
+int main ()
+{
+ typeid(char*);
+
+ int len = 1;
+ char carr[len];
+ typeid(typeof(carr)); // ERROR - type has variable size
+ typeid(carr); // ERROR - type has variable size
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/using9.C b/gcc/testsuite/g++.old-deja/g++.other/using9.C
new file mode 100644
index 00000000000..1d3d9f2634d
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/using9.C
@@ -0,0 +1,21 @@
+// Build don't link:
+//
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 26 Feb 2001 <nathan@codesourcery.com>
+
+// Bug 75. using declarations cannot introduce functions which ambiguate
+// those in the current namespace, BUT here we're reaccessing the current
+// namespace -- the function is not being 'introduced'.
+
+extern int a();
+struct x {};
+
+using ::x;
+using ::a;
+
+extern "C" void foo ();
+
+namespace {
+ extern "C" int foo ();
+ using ::foo; // ERROR - already in use
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/vector1.C b/gcc/testsuite/g++.old-deja/g++.other/vector1.C
new file mode 100644
index 00000000000..5ed9a48d561
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/vector1.C
@@ -0,0 +1,16 @@
+// Build don't link:
+// Origin: Joe Buck <jbuck@welsh-buck.org>
+
+#include <vector>
+using std::vector;
+
+struct foo {
+int a;
+};
+
+bool operator==(const foo&, const foo&);
+
+bool veq(const vector<foo>& a, const vector<foo>& b)
+{
+return a == b;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/warn5.C b/gcc/testsuite/g++.old-deja/g++.other/warn5.C
new file mode 100644
index 00000000000..4c17dc66406
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/warn5.C
@@ -0,0 +1,19 @@
+// Special g++ Options: -W
+// Build don't link:
+//
+// Copyright (C) 2000 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 6 Febs 2001 <nathan@codesourcery.com>
+
+// Bug 1765. We gave bogus warning on default initializer.
+
+struct X
+{
+ int i;
+};
+
+X *foo ()
+{
+ return new X (); // gets bogus warning
+}
+
+X x = {}; // WARNING - missing initializer
diff --git a/gcc/testsuite/g++.old-deja/g++.other/warn6.C b/gcc/testsuite/g++.old-deja/g++.other/warn6.C
new file mode 100644
index 00000000000..1a54b329789
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/warn6.C
@@ -0,0 +1,17 @@
+// Build don't link:
+// Special g++ Options: -W -Wall
+
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 2 Mar 2001 <nathan@codesourcery.com>
+
+// Bug 2139. We gave an erronous warning about an unused parm on a
+// synthesized function
+
+struct A
+{
+ virtual ~A ();
+};
+void foo (A const &a)
+{
+ A a1 = a;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/warn7.C b/gcc/testsuite/g++.old-deja/g++.other/warn7.C
new file mode 100644
index 00000000000..a27756a1a9a
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/warn7.C
@@ -0,0 +1,45 @@
+// Build don't link:
+// Special g++ Options: -W -Wall
+//
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 26 April 2001 <nathan@codesourcery.com>
+
+// Bug 2356. Unused parameter information introduced in a ctor
+// definition was not propagated to clones, leading to missed or
+// unwarranted unused parameter warnings, possibly given twice.
+
+struct X
+{
+ X(int i);
+ void foo (int i);
+
+};
+void foo (int i);
+
+X::X(int)
+{
+}
+void X::foo (int)
+{
+}
+void foo (int)
+{
+}
+
+struct Y
+{
+ Y(int);
+ void bar (int);
+
+};
+void bar (int);
+
+Y::Y(int i)
+{ // WARNING - unused parameter
+}
+void Y::bar (int i)
+{ // WARNING - unused parameter
+}
+void bar (int i)
+{ // WARNING - unused parameter
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/array7.C b/gcc/testsuite/g++.old-deja/g++.pt/array7.C
new file mode 100644
index 00000000000..02e0733b91b
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.pt/array7.C
@@ -0,0 +1,11 @@
+// Build don't link:
+// Origin: Mark Mitchell <mark@codesourcery.com>
+
+template <typename T>
+struct S {
+ enum E { e = 5 };
+ static int i[e];
+};
+
+template <typename T>
+int S<T>::i[S<T>::e];
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/const2.C b/gcc/testsuite/g++.old-deja/g++.pt/const2.C
new file mode 100644
index 00000000000..3c064fe6d4a
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.pt/const2.C
@@ -0,0 +1,9 @@
+// This test should get a linker error for the reference to A<int>::i.
+// An XPASS on this test is really a FAIL.
+// excess errors test - XFAIL *-*-*
+
+template <class T> struct B { static const int i = 3; };
+template <class T> struct A { static const int i = B<T>::i; };
+const int *p = &A<int>::i;
+
+int main(){}
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/crash68.C b/gcc/testsuite/g++.old-deja/g++.pt/crash68.C
new file mode 100644
index 00000000000..b856f22a3b0
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.pt/crash68.C
@@ -0,0 +1,70 @@
+// Build don't link:
+//
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 25 Jul 2001 <nathan@codesourcery.com>
+
+// Origin: gustavo@geneura.ugr.es
+// Bug 3624. Template instantiation of a reference type was not
+// converted from reference when doing a call.
+
+#include <iostream>
+
+using namespace std;
+
+template <class A, class B, class C, C& c, bool d> class eo: public A
+{
+public:
+ eo()
+ {
+ cout << this->x << " " << this->y << " "
+ << c(*this) << " "
+ << ((d)?"true":"false") << endl;
+ }
+
+private:
+ B b;
+};
+
+struct XY
+{
+ float x, y;
+
+ XY(): x(1), y(0.1) {}
+};
+
+float fitness(const XY& a)
+{
+ return a.x + a.y;
+}
+
+struct fitness2
+{
+ float operator()(const XY& a)
+ {
+ return a.x - a.y;
+ }
+
+ float f(const XY& a)
+ {
+ return a.x - a.y;
+ }
+};
+
+struct fitness3
+{
+ float operator()(const XY& a)
+ {
+ return a.x / a.y;
+ }
+};
+
+fitness2 f2;
+fitness3 f3;
+
+int main()
+{
+ eo<XY, float, fitness2, f2, true> eo2;
+ eo<XY, float, fitness3, f3, true> eo3;
+
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/deduct5.C b/gcc/testsuite/g++.old-deja/g++.pt/deduct5.C
new file mode 100644
index 00000000000..d47a7669295
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.pt/deduct5.C
@@ -0,0 +1,33 @@
+// Copyright (C) 2000 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 13 Feb 2001 <nathan@codesourcery.com>
+
+// Bug 1960. We were not dealing with qualified array types properly.
+
+#include <stdio.h>
+
+template <typename T> int Foo (T const *ptr)
+{
+ static int count = 0;
+
+ printf ("%s\n", __PRETTY_FUNCTION__);
+ count++;
+
+ return count;
+}
+
+int main ()
+{
+ static int const cs = 1;
+ static int const ca[1] = {1};
+ static int s = 1;
+ static int a[1] = {1};
+
+ Foo (&cs);
+ Foo (&ca);
+ if (Foo (&s) != 2)
+ return 1;
+ if (Foo (&a) != 2)
+ return 2;
+
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/deduct6.C b/gcc/testsuite/g++.old-deja/g++.pt/deduct6.C
new file mode 100644
index 00000000000..7fcef4edc4b
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.pt/deduct6.C
@@ -0,0 +1,24 @@
+// Build don't link:
+// Copyright (C) 2000 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 13 Feb 2001 <nathan@codesourcery.com>
+
+// Bug 1962. We were not dealing with qualified array types properly.
+
+#include <stdio.h>
+
+template <typename T, unsigned I> int Baz (T (&obj)[I])
+{
+ printf ("%s\n", __PRETTY_FUNCTION__);
+ return 1;
+}
+
+int main ()
+{
+ static int const ca[1] = {1};
+ static int a[1] = {1};
+
+ Baz (ca);
+ Baz (a);
+
+ return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/deduct7.C b/gcc/testsuite/g++.old-deja/g++.pt/deduct7.C
new file mode 100644
index 00000000000..ec51d30878d
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.pt/deduct7.C
@@ -0,0 +1,14 @@
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Jason Merrill 14 Jun 2001 <jason@redhat.com>
+
+// Test that deduction can add cv-quals to a pointer-to-member type.
+
+struct A;
+int A::* pi;
+
+template <typename T> void f (const T A::*) {}
+
+int main ()
+{
+ f (pi);
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/friend48.C b/gcc/testsuite/g++.old-deja/g++.pt/friend48.C
new file mode 100644
index 00000000000..af0e3caf15c
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.pt/friend48.C
@@ -0,0 +1,17 @@
+// Build don't link:
+// Origin: Mark Mitchell <mark@codesourcery.com>
+
+template <class T>
+class C {
+ template <class U>
+ friend class ::C;
+};
+
+namespace N
+{
+template <class T>
+class D {
+ template <class U>
+ friend class N::D;
+};
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/friend49.C b/gcc/testsuite/g++.old-deja/g++.pt/friend49.C
new file mode 100644
index 00000000000..3b243f09249
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.pt/friend49.C
@@ -0,0 +1,26 @@
+// Build don't link:
+
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 5 Jun 2001 <nathan@codesourcery.com>
+
+// Bug 2929. We were forgetting about template parm scope when
+// injecting a friend decl into a class template specialization's
+// containing scope.
+
+template <class Type> class Vec;
+
+template <> class Vec<double>
+{
+public:
+ Vec ();
+ Vec<double> & Fn (double);
+ friend Vec<double> Fn (const Vec<double> &, double);
+}; // pop_binding ICE
+
+template <class _Tp> class Alloc
+{
+ template <class _Tp1> struct Rebind
+ {
+ typedef Alloc<_Tp1> other;
+ };
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/mangle2.C b/gcc/testsuite/g++.old-deja/g++.pt/mangle2.C
new file mode 100644
index 00000000000..a7b95b1a408
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.pt/mangle2.C
@@ -0,0 +1,40 @@
+// Build don't link:
+//
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 25 April 2001 <nathan@codesourcery.com>
+// Origin:pcarlini@unitus.it
+
+// Bug 2559. We hadn't implemented code to mangle numbers bigger than
+// HOST_WIDE_INT.
+
+template<class T, T min_val, T max_val>
+class integer_traits_base
+{
+public:
+static const bool is_integral = true;
+};
+
+template<class T>
+class integer_traits
+{
+public:
+static const bool is_integral = false;
+};
+
+template<>
+class integer_traits<long long>
+: public integer_traits_base<long long, (-9223372036854775807LL - 1),
+9223372036854775807LL>
+{ };
+
+integer_traits<long long> f;
+
+template <class T, T value> T foo ()
+{
+ return value;
+}
+
+void x ()
+{
+ foo<long long, -9223372036854775807LL> ();
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/memtemp100.C b/gcc/testsuite/g++.old-deja/g++.pt/memtemp100.C
new file mode 100644
index 00000000000..c88c3e7a2f5
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.pt/memtemp100.C
@@ -0,0 +1,40 @@
+// Build don't link:
+// Origin: philippeb@videotron.ca
+// Special g++ Options:
+
+#include <iostream>
+
+using namespace std;
+
+template <class T> struct traits
+{
+ typedef long next;
+};
+
+
+template <class T>
+struct c1
+{
+ template <class U>
+ struct c2
+ {
+ c2()
+ {
+ cout << __PRETTY_FUNCTION__ << endl;
+ }
+ };
+};
+
+
+template <class T>
+void foo()
+{
+ cout << __PRETTY_FUNCTION__ << endl;
+ typename c1<typename traits<T>::next>::template c2<void>();
+}
+
+
+int main()
+{
+ foo<int>();
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/memtemp99.C b/gcc/testsuite/g++.old-deja/g++.pt/memtemp99.C
new file mode 100644
index 00000000000..2295bea022d
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.pt/memtemp99.C
@@ -0,0 +1,10 @@
+// Build don't link:
+// Origin: bitti@cs.tut.fi
+
+template<typename T, unsigned int N>
+class Vector
+{
+public:
+ template<unsigned int I>
+ class Vector<T,N>::CommaInit { }; // ERROR - invalid definition
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/ptrmem2.C b/gcc/testsuite/g++.old-deja/g++.pt/ptrmem2.C
index c6927d19472..1f254e93c31 100644
--- a/gcc/testsuite/g++.old-deja/g++.pt/ptrmem2.C
+++ b/gcc/testsuite/g++.old-deja/g++.pt/ptrmem2.C
@@ -31,6 +31,11 @@ S* S::g()
return this;
}
+S* S::h()
+{
+ return this;
+}
+
int main()
{
S s;
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/ref4.C b/gcc/testsuite/g++.old-deja/g++.pt/ref4.C
new file mode 100644
index 00000000000..1291dc1ff2d
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.pt/ref4.C
@@ -0,0 +1,25 @@
+// Build don't link:
+//
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 29 Apr 2001 <nathan@codesourcery.com>
+
+// Bug 2664. We failed to convert_from_reference for non-type
+// template parms.
+
+struct cow { };
+
+cow c;
+
+void func (cow &c) {}
+void operator-(cow &c) {}
+
+template<cow &C> void test()
+{
+ func(C); //OK
+ -C; //bogus error
+}
+
+int main()
+{
+ test<c> ();
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/repo4.C b/gcc/testsuite/g++.old-deja/g++.pt/repo4.C
new file mode 100644
index 00000000000..6180acbb57e
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.pt/repo4.C
@@ -0,0 +1,15 @@
+// Build then link:
+// Special g++ Options: -frepo
+
+template <class T>
+struct S {
+ ~S ();
+};
+
+template <class T>
+S<T>::~S () {}
+
+int main ()
+{
+ S<int> s;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/spec40.C b/gcc/testsuite/g++.old-deja/g++.pt/spec40.C
new file mode 100644
index 00000000000..2d0ad90088c
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.pt/spec40.C
@@ -0,0 +1,13 @@
+// Copyright (C) 2000 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 12 Feb 2001 <nathan@codesourcery.com>
+
+// More from bug 1617. We didn't resolve partial ordering properly. The
+// std is rather vague about it anyway, DR 214 talks about this.
+
+template <typename T> int Foo (T const *) {return 1;}
+template <unsigned I> int Foo (char const (&)[I]) {return 2;}
+
+int main ()
+{
+ return Foo ("a") != 2;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/static3.C b/gcc/testsuite/g++.old-deja/g++.pt/static3.C
index df770dac87d..bfcfbdbe743 100644
--- a/gcc/testsuite/g++.old-deja/g++.pt/static3.C
+++ b/gcc/testsuite/g++.old-deja/g++.pt/static3.C
@@ -1,6 +1,6 @@
// On targets that don't support weak symbols, we require an explicit
// instantiation of arr.
-// excess errors test - XFAIL *-*-aout *-*-coff *-*-hpux* alpha*-dec-osf* *-*-hms
+// excess errors test - XFAIL *-*-aout *-*-coff *-*-hpux* *-*-hms
template<class T>
struct A {
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/static6.C b/gcc/testsuite/g++.old-deja/g++.pt/static6.C
index b433e3efa39..8052dc219a3 100644
--- a/gcc/testsuite/g++.old-deja/g++.pt/static6.C
+++ b/gcc/testsuite/g++.old-deja/g++.pt/static6.C
@@ -1,5 +1,5 @@
// Build don't run:
-// excess errors test - XFAIL *-*-aout *-*-coff *-*-hpux* alpha*-dec-osf* *-*-hms
+// excess errors test - XFAIL *-*-aout *-*-coff *-*-hpux* *-*-hms
// Simplified from testcase by Erez Louidor Lior <s3824888@techst02.technion.ac.il>
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/typename28.C b/gcc/testsuite/g++.old-deja/g++.pt/typename28.C
new file mode 100644
index 00000000000..a538c4d946f
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.pt/typename28.C
@@ -0,0 +1,27 @@
+// Build don't link:
+//
+// Origin: Jens.Maurer@gmx.net
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 11 Apr 2001 <nathan@codesourcery.com>
+
+// Bug 1844. We can meet types in cp_tree_equal via a template-id-expr.
+
+typedef int *Ptr;
+
+template<class T> struct B
+{
+ typedef typename T::template X<T> type;
+ typedef typename T::template X<Ptr> type2;
+ typedef typename T::template X<int *> type3;
+
+ void foo (type);
+ void baz (type2);
+
+};
+
+template<class T> void B<T>::foo (type)
+{
+}
+template<class T> void B<T>::baz (type3)
+{
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/unify8.C b/gcc/testsuite/g++.old-deja/g++.pt/unify8.C
index 4e2f392b64b..afe57d1cd14 100644
--- a/gcc/testsuite/g++.old-deja/g++.pt/unify8.C
+++ b/gcc/testsuite/g++.old-deja/g++.pt/unify8.C
@@ -9,10 +9,12 @@
template <typename T> void Foo (T const **);
+template <typename T> void Bar (T const * const *);
void Foo (int); // ERROR - candidate
void Foo (float); // ERROR - candidate
void baz (int **p1)
{
Foo (p1); // ERROR - no such function
+ Bar (p1); // OK
}
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/using1.C b/gcc/testsuite/g++.old-deja/g++.pt/using1.C
new file mode 100644
index 00000000000..632fca00a45
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.pt/using1.C
@@ -0,0 +1,36 @@
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 26 Feb 2001 <nathan@codesourcery.com>
+
+// Bug 1981. using declarations in namespace scope were not remembered.
+
+namespace A
+{
+ void swap () {}
+};
+
+template <class T> void f()
+{
+ using A::swap;
+}
+
+template void f<float> ();
+
+int foo (int) { return 0;}
+
+namespace B
+{
+ int foo (int) { return 1;}
+
+ template <class T> int baz ()
+ {
+ using ::foo;
+
+ return foo (1);
+ }
+ template int baz<float> ();
+};
+
+int main ()
+{
+ return B::baz<float> ();
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/using2.C b/gcc/testsuite/g++.old-deja/g++.pt/using2.C
new file mode 100644
index 00000000000..5d47b7527a6
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.pt/using2.C
@@ -0,0 +1,26 @@
+// Build don't link:
+//
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 22 May 2001 <nathan@codesourcery.com>
+
+// Bug 2184. Using decls in templates weren't doing the right thing.
+
+namespace N {
+ template <class T>
+ class vector {};
+}
+
+void g(const int&) {
+ using N::vector;
+ typedef vector<int> V;
+}
+
+template <class J>
+void f(const J&) {
+ using N::vector;
+ typedef vector<int> V;
+}
+
+int main() {
+ f(0);
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb109.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb109.C
index b87be9c1ae9..7a7c56cd34f 100644
--- a/gcc/testsuite/g++.old-deja/g++.robertl/eb109.C
+++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb109.C
@@ -1,8 +1,10 @@
#include<map>
-#include<iostream.h>
+#include<iostream>
#include<vector>
#include<string>
+using namespace std;
+
// empty parameter class with a minimal set of operations
// if there are no weights for edges necessary
struct Empty
diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb113.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb113.C
index f3c28b9ac65..88d33b148d7 100644
--- a/gcc/testsuite/g++.old-deja/g++.robertl/eb113.C
+++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb113.C
@@ -1,5 +1,5 @@
// Build don't link:
-#include <iostream.h>
+#include <iostream>
class X : public std::streambuf
{
diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb115.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb115.C
index 30eab786f34..fc404d9ae32 100644
--- a/gcc/testsuite/g++.old-deja/g++.robertl/eb115.C
+++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb115.C
@@ -1,9 +1,9 @@
// Special g++ Options: -O
-#include <iostream.h>
+#include <iostream>
#include <typeinfo>
int main() {
int *i1, *i2;
- cerr << (typeid(i1)==typeid(i2)) << endl;
+ std::cerr << (typeid(i1)==typeid(i2)) << std::endl;
}
diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb118.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb118.C
index 23498c78554..b191ac11717 100644
--- a/gcc/testsuite/g++.old-deja/g++.robertl/eb118.C
+++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb118.C
@@ -1,7 +1,7 @@
// Test for obsolete specialization syntax. Turn off -pedantic.
// Special g++ Options:
-#include <iostream.h>
+#include <iostream>
#include <typeinfo>
template <typename T>
@@ -13,7 +13,7 @@ public:
template <typename T>
void
A<T>::test(){
- cerr << "test for " << typeid(*this).name() << endl;
+ std::cerr << "test for " << typeid(*this).name() << std::endl;
}
// Specialization declaration
void
@@ -22,7 +22,7 @@ A<double>::test();
// Specialization definition
void
A<double>::test(){
- cerr << "specialization for " << typeid(*this).name() << endl;
+ std::cerr << "specialization for " << typeid(*this).name() << std::endl;
}
@@ -35,3 +35,4 @@ main(){
return 0;
}
+
diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb130.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb130.C
index 48bbb8f9898..7e9fc59dd7a 100644
--- a/gcc/testsuite/g++.old-deja/g++.robertl/eb130.C
+++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb130.C
@@ -6,6 +6,6 @@
// From: Klaus-Georg Adams <Klaus-Georg.Adams@chemie.uni-karlsruhe.de>
-#include <hash_set>
+#include <ext/hash_set>
std::hash_set<int> foo;
diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb133.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb133.C
index 788d60388cc..e2b25f6ef08 100644
--- a/gcc/testsuite/g++.old-deja/g++.robertl/eb133.C
+++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb133.C
@@ -1,9 +1,10 @@
// Build don't link:
-// Special g++ Options: -fno-honor-std
// Gives ICE 109
// From: Klaus-Georg Adams <Klaus-Georg.Adams@chemie.uni-karlsruhe.de>
// Reported against EGCS snaps 98/06/28.
+using namespace std;
+
int main()
{
try {
diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb15.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb15.C
index 902d4631ac1..f56f3137e64 100644
--- a/gcc/testsuite/g++.old-deja/g++.robertl/eb15.C
+++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb15.C
@@ -1,18 +1,18 @@
// Build don't link:
-#include<iostream.h>
-#include<stddef.h>
+#include<iostream>
+#include<cstddef>
struct A {
A() {
- cerr<<"A constructing\n";
+ std::cerr<<"A constructing\n";
throw 1;
}
void *operator new(size_t sz) {
- cerr<<"A allocated\n";
+ std::cerr<<"A allocated\n";
return ::operator new(sz);
}
void operator delete (void *p) {
- cerr<<"A deleted\n";
+ std::cerr<<"A deleted\n";
::operator delete (p);
}
};
@@ -23,3 +23,6 @@ int main() {
} catch (...) {
}
}
+
+
+
diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb21.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb21.C
index f534f4891d7..11b38cdc731 100644
--- a/gcc/testsuite/g++.old-deja/g++.robertl/eb21.C
+++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb21.C
@@ -1,6 +1,6 @@
#include <vector>
-#include <strstream.h>
+#include <sstream>
using namespace std;
@@ -16,7 +16,7 @@ std::vector<connection_t> connections;
int
main() {
- ostrstream str;
+ ostringstream str;
connections.insert(connections.end(), connection_t());
diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb24.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb24.C
index b1f01043817..7ea7b41205b 100644
--- a/gcc/testsuite/g++.old-deja/g++.robertl/eb24.C
+++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb24.C
@@ -1,5 +1,5 @@
// Build don't link:
-#include <iostream.h>
+#include <iostream>
template < class T >
class X
@@ -19,5 +19,5 @@ class Y : public X<T>
using X<T>::x;
- void f () { cout << x << endl; }
+ void f () { std::cout << x << std::endl; }
};
diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb27.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb27.C
index 31012bee0d8..3d32f1c0028 100644
--- a/gcc/testsuite/g++.old-deja/g++.robertl/eb27.C
+++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb27.C
@@ -7,7 +7,7 @@
// for the test<T> record_type. This is marked as an expected failure for now,
// until we actually fix it.
-#include <iostream.h>
+#include <iostream>
template <class T> class test;
template <class T> test<T> operator + (const test<T>& a, const test<T>& b);
@@ -22,7 +22,7 @@ class test
test (const T& a) { elem = a; };
test<T>& operator += (const test<T>& a) { elem += a.elem; return *this; };
friend test<T> operator + <> (const test<T>&, const test<T>&);
- friend ostream& operator << (ostream& os, const test<T>& a)
+ friend std::ostream& operator << (std::ostream& os, const test<T>& a)
{ return os << a.elem; };
};
@@ -34,6 +34,8 @@ test<T> operator + (const test<T>& a, const test<T>& b) return c(a);
int main()
{
test<int> x, y;
- x += 5; cout << x << endl;
- y = x + test<int>(2); cout << y << endl;
+ x += 5;
+ std::cout << x << std::endl;
+ y = x + test<int>(2);
+ std::cout << y << std::endl;
}
diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb3.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb3.C
index d257043e46a..ccf6027102a 100644
--- a/gcc/testsuite/g++.old-deja/g++.robertl/eb3.C
+++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb3.C
@@ -1,5 +1,5 @@
// Build don't link:
-#include <complex.h>
+#include <complex>
template<class T>
class Vec {
public:
@@ -8,4 +8,4 @@ public:
void operator=(const Vec<T> &v) { data = new T; }
T *data;
};
-template class Vec<complex<double> >;
+template class Vec<std::complex<double> >;
diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb30.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb30.C
index c116ab4cd4d..0d245875284 100644
--- a/gcc/testsuite/g++.old-deja/g++.robertl/eb30.C
+++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb30.C
@@ -1,7 +1,7 @@
// Build don't link:
-#include <fstream.h>
+#include <fstream>
-class bifstream : public ifstream {
+class bifstream : public std::ifstream {
public:
bifstream();
// ~bifstream();
@@ -14,3 +14,6 @@ void load_bin()
if (!InFile)
return;
}
+
+
+
diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb31.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb31.C
index 1a18af5b4c8..33a12b89ac2 100644
--- a/gcc/testsuite/g++.old-deja/g++.robertl/eb31.C
+++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb31.C
@@ -1,4 +1,4 @@
-#include<iostream.h>
+#include<iostream>
int main() {
try {
@@ -15,3 +15,5 @@ int main() {
}
return 0;
}
+
+
diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb33.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb33.C
index 3797ab3740f..9664f42e941 100644
--- a/gcc/testsuite/g++.old-deja/g++.robertl/eb33.C
+++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb33.C
@@ -1,11 +1,11 @@
-#include <fstream.h>
-#include <stdio.h>
+#include <fstream>
+#include <cstdio>
int
main()
{
- printf("If you see this, you don't have a problem!\n");
+ std::printf("If you see this, you don't have a problem!\n");
#ifdef EXPOSE_BUG
- ifstream a;
+ std::ifstream a;
#endif
}
diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb39.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb39.C
index 4d194e05010..98bee9c6fcf 100644
--- a/gcc/testsuite/g++.old-deja/g++.robertl/eb39.C
+++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb39.C
@@ -1,10 +1,8 @@
// Build don't link:
-#include <ctype.h>
-#include <iostream.h>
-// #include <streambuf.h>
-// #include <libio.h>
-#include <strstream.h>
-#include <string.h>
+#include <cctype>
+#include <iostream>
+#include <sstream>
+#include <cstring>
using namespace std;
@@ -13,7 +11,8 @@ extern bool foo2 (ostream &out, istream &in);
bool
foo1 (ostream &out, const char *in)
{
- strstreambuf sb (in, (int) strlen (in));
+ string tmp(in, std::strlen(in));
+ stringbuf sb (tmp);
istream fmt (&sb);
return foo2 (out, fmt);
}
diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb4.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb4.C
index b51d3eafb98..69728967480 100644
--- a/gcc/testsuite/g++.old-deja/g++.robertl/eb4.C
+++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb4.C
@@ -1,6 +1,6 @@
// Error: Internal Compiler Error in GCC 2.7.2 and EGCS 1998/05/28 snapshot.
-#include <iostream.h>
+#include <iostream>
class some_base
{
@@ -31,7 +31,7 @@ public:
class some_derived::func(derived_func_args &a) // ERROR - illegal member syntax
{
- cout << a.i << ' ' << a.f << endl;
+ std::cout << a.i << ' ' << a.f << std::endl;
}
int
diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb41.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb41.C
index 0bd69e37648..1cc7509314a 100644
--- a/gcc/testsuite/g++.old-deja/g++.robertl/eb41.C
+++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb41.C
@@ -1,8 +1,8 @@
-#include <iostream.h>
-#include <iterator.h>
+#include <iostream>
+#include <iterator>
#include <string>
-ostream_iterator<std::string> oo(cout);
+std::ostream_iterator<std::string> oo(std::cout);
int main()
{
diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb42.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb42.C
index 8850f9fa639..22099fd397e 100644
--- a/gcc/testsuite/g++.old-deja/g++.robertl/eb42.C
+++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb42.C
@@ -1,6 +1,6 @@
//Build don't link:
-#include <vector.h>
-#include <algo.h>
+#include <vector>
+#include <algorithm>
template <class T> class Expr
{
@@ -14,6 +14,11 @@ inline bool compare(const Expr<T> a, const Expr<T> b){ return true; };
int main()
{
-vector<int> a(3);
-sort( a.begin(), a.end(), compare ); // ERROR - no matching function
+ std::vector<int> a(3);
+ std::sort( a.begin(), a.end(), compare ); // ERROR - no matching function
}
+
+
+
+
+
diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb44.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb44.C
index 04ff13d698f..36042337417 100644
--- a/gcc/testsuite/g++.old-deja/g++.robertl/eb44.C
+++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb44.C
@@ -4,9 +4,11 @@
// Also, the template instantiation does not provide the missing
// friend function, the non-template function does
-#include <stdio.h>
-#include <stdlib.h>
-#include <iostream.h>
+#include <cstdio>
+#include <cstdlib>
+#include <iostream>
+
+using namespace std;
template <class T>
class Vector
diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb46.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb46.C
index ad077e38dc3..8d3b3055b8a 100644
--- a/gcc/testsuite/g++.old-deja/g++.robertl/eb46.C
+++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb46.C
@@ -1,4 +1,4 @@
-#include <iostream.h>
+#include <iostream>
class A1 {
friend class B;
@@ -22,6 +22,9 @@ int main()
A1* a=new A3;
B b(a);
- if (b.itsA) cout << "cast ok" << endl; else cout << "cast failed" << endl;
+ if (b.itsA)
+ std::cout << "cast ok" << std::endl;
+ else
+ std::cout << "cast failed" << std::endl;
return 0;
}
diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb54.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb54.C
index bcf9968d121..b8ac4035e68 100644
--- a/gcc/testsuite/g++.old-deja/g++.robertl/eb54.C
+++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb54.C
@@ -1,8 +1,9 @@
-#include <iomanip.h>
-#include <stdlib.h>
+#include <iomanip>
+#include <iostream>
+#include <cstdlib>
int main()
{
- cout << setbase(3) << endl;
- exit (0);
+ std::cout << std::setbase(3) << std::endl;
+ std::exit (0);
}
diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb55.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb55.C
index 11f98bba89b..0ab10d5d424 100644
--- a/gcc/testsuite/g++.old-deja/g++.robertl/eb55.C
+++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb55.C
@@ -2,11 +2,11 @@
// Since the constructor is in streambuf.h, additional diagnostics are
// produced, which are not really supported in the old-deja framework
-#include <strstream.h>
+#include <sstream>
void
t( char* buf )
{
- istrstream str = buf; //ERROR - inaccessible copy constructor
+ std::istrstream str = buf; //ERROR - inaccessible copy constructor
}
diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb63.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb63.C
index 671fe813200..f786e707923 100644
--- a/gcc/testsuite/g++.old-deja/g++.robertl/eb63.C
+++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb63.C
@@ -11,6 +11,6 @@ public:
main() {
A* a;
- a = new A[2] = { A(1,false), A(1,false) } ;
+
a = new A[2](1,false);
}
diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb66.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb66.C
index d79865f21d9..2ac350e989c 100644
--- a/gcc/testsuite/g++.old-deja/g++.robertl/eb66.C
+++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb66.C
@@ -1,5 +1,5 @@
-#include <assert.h>
-#include <iostream.h>
+#include <cassert>
+#include <iostream>
int bar ()
{
diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb73.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb73.C
index 75695de92d6..622d3ec9d3f 100644
--- a/gcc/testsuite/g++.old-deja/g++.robertl/eb73.C
+++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb73.C
@@ -1,7 +1,7 @@
// Special g++ Options: -O -Wall
// Depletes VM.
-#include <iostream.h>
+#include <iostream>
#include <list>
#include <algorithm>
using namespace std;
diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb77.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb77.C
index f5fbb6f2515..3db45cc8007 100644
--- a/gcc/testsuite/g++.old-deja/g++.robertl/eb77.C
+++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb77.C
@@ -1,15 +1,15 @@
-#include <stream.h>
-#include <strstream.h>
+#include <iostream>
+#include <sstream>
using namespace std;
int
main(int, char* [])
{
- strstream s;
+ stringstream s;
s << "line 1\nline 2\n\nline 4";
- s << ends;
+ s << std::ends;
int nLine = 0;
@@ -22,7 +22,7 @@ main(int, char* [])
}
++nLine;
- cout << nLine << ": " << line << endl;
+ std::cout << nLine << ": " << line << std::endl;
if( nLine > 10 ) { // stop infinite loop
break;
diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb79.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb79.C
index 5691532b99f..453916ed097 100644
--- a/gcc/testsuite/g++.old-deja/g++.robertl/eb79.C
+++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb79.C
@@ -1,5 +1,7 @@
// Makes bogus x86 assembly code.
-#include <iostream.h>
+#include <iostream>
+
+using namespace std;
template<class T>
T max(T a, T b)
diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb83.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb83.C
index 7121e140078..0f42cf4afa7 100644
--- a/gcc/testsuite/g++.old-deja/g++.robertl/eb83.C
+++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb83.C
@@ -1,7 +1,7 @@
// Skip if not native
// Special g++ Options: -fprofile-arcs -ftest-coverage
void
-swap(int& x, int& y) throw()
+test_swap(int& x, int& y) throw()
{
int tmp = x;
x = y;
@@ -12,5 +12,5 @@ main()
{
int i = 5;
int j = 7;
- swap(i, j);
+ test_swap(i, j);
}
diff --git a/gcc/testsuite/g++.old-deja/g++.warn/iomanip.C b/gcc/testsuite/g++.old-deja/g++.warn/iomanip.C
index 2fea4edf6af..b7a47faa25a 100644
--- a/gcc/testsuite/g++.old-deja/g++.warn/iomanip.C
+++ b/gcc/testsuite/g++.old-deja/g++.warn/iomanip.C
@@ -3,10 +3,11 @@
// Special g++ Options: -O -Winline
// Build don't link:
-#include <iomanip.h>
+#include <iomanip>
+#include <iostream>
void
f()
{
- cout << setw(3);
+ std::cout << std::setw(3);
}
diff --git a/gcc/testsuite/g++.old-deja/g++.warn/virt1.C b/gcc/testsuite/g++.old-deja/g++.warn/virt1.C
new file mode 100644
index 00000000000..2712adde96c
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.warn/virt1.C
@@ -0,0 +1,10 @@
+// Special g++ Options: -Woverloaded-virtual
+// Build don't link:
+
+struct A {
+ virtual void f(); // WARNING - hidden
+};
+
+struct B: public A {
+ void f(int); // WARNING - by this
+};
diff --git a/gcc/testsuite/g77.dg/20010216-1.f b/gcc/testsuite/g77.dg/20010216-1.f
new file mode 100644
index 00000000000..150dc9f016a
--- /dev/null
+++ b/gcc/testsuite/g77.dg/20010216-1.f
@@ -0,0 +1,51 @@
+C Test for bug in reg-stack handling conditional moves.
+C Reported by Tim Prince <tprince@computer.org>
+C
+C { dg-do run { target "i[6789]86-*-*" } }
+C { dg-options "-ffast-math -march=pentiumpro" }
+
+ double precision function foo(x, y)
+ implicit none
+ double precision x, y
+ double precision a, b, c, d
+ if (x /= y) then
+ if (x * y >= 0) then
+ a = abs(x)
+ b = abs(y)
+ c = max(a, b)
+ d = min(a, b)
+ foo = 1 - d/c
+ else
+ foo = 1
+ end if
+ else
+ foo = 0
+ end if
+ end
+
+ program test
+ implicit none
+
+ integer ntests
+ parameter (ntests=7)
+ double precision tolerance
+ parameter (tolerance=1.0D-6)
+
+C Each column is a pair of values to feed to foo,
+C and its expected return value.
+ double precision a(ntests) /1, -23, -1, 1, 9, 10, -9/
+ double precision b(ntests) /1, -23, 12, -12, 10, 9, -10/
+ double precision x(ntests) /0, 0, 1, 1, 0.1, 0.1, 0.1/
+
+ double precision foo
+ double precision result
+ integer i
+
+ do i = 1, ntests
+ result = foo(a(i), b(i))
+ if (abs(result - x(i)) > tolerance) then
+ print *, i, a(i), b(i), x(i), result
+ call abort
+ end if
+ end do
+ end
diff --git a/libstdc++-v3/testsuite/libstdc++.tests/tests.exp b/gcc/testsuite/g77.dg/dg.exp
index d811803ad4c..446166c49db 100644
--- a/libstdc++-v3/testsuite/libstdc++.tests/tests.exp
+++ b/gcc/testsuite/g77.dg/dg.exp
@@ -1,4 +1,4 @@
-# Copyright (C) 2001 Free Software Foundation, Inc.
+# Copyright (C) 1997 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -14,14 +14,23 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-# Please email any bugs, comments, and/or additions to this file to:
-# libstdc++@gcc.gnu.org
-#
-# This file is contributed by Gabriel Dos Reis <gdr@codesourcery.com>
+# GCC testsuite that uses the `dg.exp' driver.
-load_lib libstdc++.exp
+# Load support procs.
+load_lib g77-dg.exp
-libstdc++-dg-init
-libstdc++_runtest [glob -nocomplain $srcdir/*]
-dg-finish
+# If a testcase doesn't have special options, use these.
+global DEFAULT_FFLAGS
+if ![info exists DEFAULT_FFLAGS] then {
+ set DEFAULT_FFLAGS " -pedantic-errors"
+}
+
+# Initialize `dg'.
+dg-init
+# Main loop.
+g77-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.f]] \
+ $DEFAULT_FFLAGS
+
+# All done.
+dg-finish
diff --git a/gcc/testsuite/g77.f-torture/compile/20000629-1.x b/gcc/testsuite/g77.f-torture/compile/20000629-1.x
deleted file mode 100644
index f1c5c19d655..00000000000
--- a/gcc/testsuite/g77.f-torture/compile/20000629-1.x
+++ /dev/null
@@ -1,10 +0,0 @@
-set torture_eval_before_compile {
- set compiler_conditional_xfail_data {
- "bug with -funroll-loops" \
- "i?86-*-*" \
- { "-funroll-loops" "-funroll-all-loops" } \
- { "" }
- }
-}
-
-return 0
diff --git a/gcc/testsuite/g77.f-torture/compile/20010321-1.f b/gcc/testsuite/g77.f-torture/compile/20010321-1.f
new file mode 100644
index 00000000000..3f3b5602737
--- /dev/null
+++ b/gcc/testsuite/g77.f-torture/compile/20010321-1.f
@@ -0,0 +1,8 @@
+# 1 "20010321-1.f"
+ SUBROUTINE TWOEXP
+# 1 "include/implicit.h" 1 3
+ IMPLICIT DOUBLE PRECISION (A-H)
+# 3 "20010321-1.f" 2 3
+ LOGICAL ANTI
+ ANTI = .FALSE.
+ END
diff --git a/gcc/testsuite/g77.f-torture/compile/20010519-1.f b/gcc/testsuite/g77.f-torture/compile/20010519-1.f
new file mode 100644
index 00000000000..5690580f751
--- /dev/null
+++ b/gcc/testsuite/g77.f-torture/compile/20010519-1.f
@@ -0,0 +1,1326 @@
+CHARMM Element source/dimb/nmdimb.src 1.1
+C.##IF DIMB
+ SUBROUTINE NMDIMB(X,Y,Z,NAT3,BNBND,BIMAG,LNOMA,AMASS,DDS,DDSCR,
+ 1 PARDDV,DDV,DDM,PARDDF,DDF,PARDDE,DDEV,DD1BLK,
+ 2 DD1BLL,NADD,LRAISE,DD1CMP,INBCMP,JNBCMP,
+ 3 NPAR,ATMPAR,ATMPAS,BLATOM,PARDIM,NFREG,NFRET,
+ 4 PARFRQ,CUTF1,ITMX,TOLDIM,IUNMOD,IUNRMD,
+ 5 LBIG,LSCI,ATMPAD,SAVF,NBOND,IB,JB,DDVALM)
+C-----------------------------------------------------------------------
+C 01-Jul-1992 David Perahia, Liliane Mouawad
+C 15-Dec-1994 Herman van Vlijmen
+C
+C This is the main routine for the mixed-basis diagonalization.
+C See: L.Mouawad and D.Perahia, Biopolymers (1993), 33, 599,
+C and: D.Perahia and L.Mouawad, Comput. Chem. (1995), 19, 241.
+C The method iteratively solves the diagonalization of the
+C Hessian matrix. To save memory space, it uses a compressed
+C form of the Hessian, which only contains the non-zero elements.
+C In the diagonalization process, approximate eigenvectors are
+C mixed with Cartesian coordinates to form a reduced basis. The
+C Hessian is then diagonalized in the reduced basis. By iterating
+C over different sets of Cartesian coordinates the method ultimately
+C converges to the exact eigenvalues and eigenvectors (up to the
+C requested accuracy).
+C If no existing basis set is read, an initial basis will be created
+C which consists of the low-frequency eigenvectors of diagonal blocks
+C of the Hessian.
+C-----------------------------------------------------------------------
+C-----------------------------------------------------------------------
+C:::##INCLUDE '~/charmm_fcm/impnon.fcm'
+C..##IF VAX CONVEX IRIS HPUX IRIS GNU CSPP OS2 GWS CRAY ALPHA
+ IMPLICIT NONE
+C..##ENDIF
+C-----------------------------------------------------------------------
+C-----------------------------------------------------------------------
+C:::##INCLUDE '~/charmm_fcm/stream.fcm'
+ LOGICAL LOWER,QLONGL
+ INTEGER MXSTRM,POUTU
+ PARAMETER (MXSTRM=20,POUTU=6)
+ INTEGER NSTRM,ISTRM,JSTRM,OUTU,PRNLEV,WRNLEV,IOLEV
+ COMMON /CASE/ LOWER, QLONGL
+ COMMON /STREAM/ NSTRM,ISTRM,JSTRM(MXSTRM),OUTU,PRNLEV,WRNLEV,IOLEV
+C..##IF SAVEFCM
+C..##ENDIF
+C-----------------------------------------------------------------------
+C-----------------------------------------------------------------------
+C:::##INCLUDE '~/charmm_fcm/dimens.fcm'
+ INTEGER LARGE,MEDIUM,SMALL,REDUCE
+C..##IF QUANTA
+C..##ELIF T3D
+C..##ELSE
+ PARAMETER (LARGE=60120, MEDIUM=25140, SMALL=6120)
+C..##ENDIF
+ PARAMETER (REDUCE=15000)
+ INTEGER SIZE
+C..##IF XLARGE
+C..##ELIF XXLARGE
+C..##ELIF LARGE
+C..##ELIF MEDIUM
+ PARAMETER (SIZE=MEDIUM)
+C..##ELIF REDUCE
+C..##ELIF SMALL
+C..##ELIF XSMALL
+C..##ENDIF
+C..##IF MMFF
+ integer MAXDEFI
+ parameter(MAXDEFI=250)
+ INTEGER NAME0,NAMEQ0,NRES0,KRES0
+ PARAMETER (NAME0=4,NAMEQ0=10,NRES0=4,KRES0=4)
+ integer MaxAtN
+ parameter (MaxAtN=55)
+ INTEGER MAXAUX
+ PARAMETER (MAXAUX = 10)
+C..##ENDIF
+ INTEGER MAXCSP, MAXHSET
+C..##IF HMCM
+ PARAMETER (MAXHSET = 200)
+C..##ELSE
+C..##ENDIF
+C..##IF REDUCE
+C..##ELSE
+ PARAMETER (MAXCSP = 500)
+C..##ENDIF
+C..##IF HMCM
+ INTEGER MAXHCM,MAXPCM,MAXRCM
+C...##IF REDUCE
+C...##ELSE
+ PARAMETER (MAXHCM=500)
+ PARAMETER (MAXPCM=5000)
+ PARAMETER (MAXRCM=2000)
+C...##ENDIF
+C..##ENDIF
+ INTEGER MXCMSZ
+C..##IF IBM IBMRS CRAY INTEL IBMSP T3D REDUCE
+C..##ELSE
+ PARAMETER (MXCMSZ = 5000)
+C..##ENDIF
+ INTEGER CHRSIZ
+ PARAMETER (CHRSIZ = SIZE)
+ INTEGER MAXATB
+C..##IF REDUCE
+C..##ELIF QUANTA
+C..##ELSE
+ PARAMETER (MAXATB = 200)
+C..##ENDIF
+ INTEGER MAXVEC
+C..##IFN VECTOR PARVECT
+ PARAMETER (MAXVEC = 10)
+C..##ELIF LARGE XLARGE XXLARGE
+C..##ELIF MEDIUM
+C..##ELIF SMALL REDUCE
+C..##ELIF XSMALL
+C..##ELSE
+C..##ENDIF
+ INTEGER IATBMX
+ PARAMETER (IATBMX = 8)
+ INTEGER MAXHB
+C..##IF LARGE XLARGE XXLARGE
+C..##ELIF MEDIUM
+ PARAMETER (MAXHB = 8000)
+C..##ELIF SMALL
+C..##ELIF REDUCE XSMALL
+C..##ELSE
+C..##ENDIF
+ INTEGER MAXTRN,MAXSYM
+C..##IFN NOIMAGES
+ PARAMETER (MAXTRN = 5000)
+ PARAMETER (MAXSYM = 192)
+C..##ELSE
+C..##ENDIF
+C..##IF LONEPAIR (lonepair_max)
+ INTEGER MAXLP,MAXLPH
+C...##IF REDUCE
+C...##ELSE
+ PARAMETER (MAXLP = 2000)
+ PARAMETER (MAXLPH = 4000)
+C...##ENDIF
+C..##ENDIF (lonepair_max)
+ INTEGER NOEMAX,NOEMX2
+C..##IF REDUCE
+C..##ELSE
+ PARAMETER (NOEMAX = 2000)
+ PARAMETER (NOEMX2 = 4000)
+C..##ENDIF
+ INTEGER MAXATC, MAXCB, MAXCH, MAXCI, MAXCP, MAXCT, MAXITC, MAXNBF
+C..##IF REDUCE
+C..##ELIF MMFF CFF
+ PARAMETER (MAXATC = 500, MAXCB = 1500, MAXCH = 3200, MAXCI = 600,
+ & MAXCP = 3000,MAXCT = 15500,MAXITC = 200, MAXNBF=1000)
+C..##ELIF YAMMP
+C..##ELIF LARGE
+C..##ELSE
+C..##ENDIF
+ INTEGER MAXCN
+ PARAMETER (MAXCN = MAXITC*(MAXITC+1)/2)
+ INTEGER MAXA, MAXAIM, MAXB, MAXT, MAXP
+ INTEGER MAXIMP, MAXNB, MAXPAD, MAXRES
+ INTEGER MAXSEG, MAXGRP
+C..##IF LARGE XLARGE XXLARGE
+C..##ELIF MEDIUM
+ PARAMETER (MAXA = SIZE, MAXB = SIZE, MAXT = SIZE,
+ & MAXP = 2*SIZE)
+ PARAMETER (MAXIMP = 9200, MAXNB = 17200, MAXPAD = 8160,
+ & MAXRES = 14000)
+C...##IF MCSS
+C...##ELSE
+ PARAMETER (MAXSEG = 1000)
+C...##ENDIF
+C..##ELIF SMALL
+C..##ELIF XSMALL
+C..##ELIF REDUCE
+C..##ELSE
+C..##ENDIF
+C..##IF NOIMAGES
+C..##ELSE
+ PARAMETER (MAXAIM = 2*SIZE)
+ PARAMETER (MAXGRP = 2*SIZE/3)
+C..##ENDIF
+ INTEGER REDMAX,REDMX2
+C..##IF REDUCE
+C..##ELSE
+ PARAMETER (REDMAX = 20)
+ PARAMETER (REDMX2 = 80)
+C..##ENDIF
+ INTEGER MXRTRS, MXRTA, MXRTB, MXRTT, MXRTP, MXRTI, MXRTX,
+ & MXRTHA, MXRTHD, MXRTBL, NICM
+ PARAMETER (MXRTRS = 200, MXRTA = 5000, MXRTB = 5000,
+ & MXRTT = 5000, MXRTP = 5000, MXRTI = 2000,
+C..##IF YAMMP
+C..##ELSE
+ & MXRTX = 5000, MXRTHA = 300, MXRTHD = 300,
+C..##ENDIF
+ & MXRTBL = 5000, NICM = 10)
+ INTEGER NMFTAB, NMCTAB, NMCATM, NSPLIN
+C..##IF REDUCE
+C..##ELSE
+ PARAMETER (NMFTAB = 200, NMCTAB = 3, NMCATM = 12000, NSPLIN = 3)
+C..##ENDIF
+ INTEGER MAXSHK
+C..##IF XSMALL
+C..##ELIF REDUCE
+C..##ELSE
+ PARAMETER (MAXSHK = SIZE*3/4)
+C..##ENDIF
+ INTEGER SCRMAX
+C..##IF IBM IBMRS CRAY INTEL IBMSP T3D REDUCE
+C..##ELSE
+ PARAMETER (SCRMAX = 5000)
+C..##ENDIF
+C..##IF TSM
+ INTEGER MXPIGG
+C...##IF REDUCE
+C...##ELSE
+ PARAMETER (MXPIGG=500)
+C...##ENDIF
+ INTEGER MXCOLO,MXPUMB
+ PARAMETER (MXCOLO=20,MXPUMB=20)
+C..##ENDIF
+C..##IF ADUMB
+ INTEGER MAXUMP, MAXEPA, MAXNUM
+C...##IF REDUCE
+C...##ELSE
+ PARAMETER (MAXUMP = 10, MAXNUM = 4)
+C...##ENDIF
+C..##ENDIF
+ INTEGER MAXING
+ PARAMETER (MAXING=1000)
+C..##IF MMFF
+ integer MAX_RINGSIZE, MAX_EACH_SIZE
+ parameter (MAX_RINGSIZE = 20, MAX_EACH_SIZE = 1000)
+ integer MAXPATHS
+ parameter (MAXPATHS = 8000)
+ integer MAX_TO_SEARCH
+ parameter (MAX_TO_SEARCH = 6)
+C..##ENDIF
+C-----------------------------------------------------------------------
+C-----------------------------------------------------------------------
+C:::##INCLUDE '~/charmm_fcm/number.fcm'
+ REAL*8 ZERO, ONE, TWO, THREE, FOUR, FIVE, SIX,
+ & SEVEN, EIGHT, NINE, TEN, ELEVEN, TWELVE, THIRTN,
+ & FIFTN, NINETN, TWENTY, THIRTY
+C..##IF SINGLE
+C..##ELSE
+ PARAMETER (ZERO = 0.D0, ONE = 1.D0, TWO = 2.D0,
+ & THREE = 3.D0, FOUR = 4.D0, FIVE = 5.D0,
+ & SIX = 6.D0, SEVEN = 7.D0, EIGHT = 8.D0,
+ & NINE = 9.D0, TEN = 10.D0, ELEVEN = 11.D0,
+ & TWELVE = 12.D0, THIRTN = 13.D0, FIFTN = 15.D0,
+ & NINETN = 19.D0, TWENTY = 20.D0, THIRTY = 30.D0)
+C..##ENDIF
+ REAL*8 FIFTY, SIXTY, SVNTY2, EIGHTY, NINETY, HUNDRD,
+ & ONE2TY, ONE8TY, THRHUN, THR6TY, NINE99, FIFHUN, THOSND,
+ & FTHSND,MEGA
+C..##IF SINGLE
+C..##ELSE
+ PARAMETER (FIFTY = 50.D0, SIXTY = 60.D0, SVNTY2 = 72.D0,
+ & EIGHTY = 80.D0, NINETY = 90.D0, HUNDRD = 100.D0,
+ & ONE2TY = 120.D0, ONE8TY = 180.D0, THRHUN = 300.D0,
+ & THR6TY=360.D0, NINE99 = 999.D0, FIFHUN = 1500.D0,
+ & THOSND = 1000.D0,FTHSND = 5000.D0, MEGA = 1.0D6)
+C..##ENDIF
+ REAL*8 MINONE, MINTWO, MINSIX
+ PARAMETER (MINONE = -1.D0, MINTWO = -2.D0, MINSIX = -6.D0)
+ REAL*8 TENM20,TENM14,TENM8,TENM5,PT0001,PT0005,PT001,PT005,
+ & PT01, PT02, PT05, PTONE, PT125, PT25, SIXTH, THIRD,
+ & PTFOUR, PTSIX, HALF, PT75, PT9999, ONEPT5, TWOPT4
+C..##IF SINGLE
+C..##ELSE
+ PARAMETER (TENM20 = 1.0D-20, TENM14 = 1.0D-14, TENM8 = 1.0D-8,
+ & TENM5 = 1.0D-5, PT0001 = 1.0D-4, PT0005 = 5.0D-4,
+ & PT001 = 1.0D-3, PT005 = 5.0D-3, PT01 = 0.01D0,
+ & PT02 = 0.02D0, PT05 = 0.05D0, PTONE = 0.1D0,
+ & PT125 = 0.125D0, SIXTH = ONE/SIX,PT25 = 0.25D0,
+ & THIRD = ONE/THREE,PTFOUR = 0.4D0, HALF = 0.5D0,
+ & PTSIX = 0.6D0, PT75 = 0.75D0, PT9999 = 0.9999D0,
+ & ONEPT5 = 1.5D0, TWOPT4 = 2.4D0)
+C..##ENDIF
+ REAL*8 ANUM,FMARK
+ REAL*8 RSMALL,RBIG
+C..##IF SINGLE
+C..##ELSE
+ PARAMETER (ANUM=9999.0D0, FMARK=-999.0D0)
+ PARAMETER (RSMALL=1.0D-10,RBIG=1.0D20)
+C..##ENDIF
+ REAL*8 RPRECI,RBIGST
+C..##IF VAX DEC
+C..##ELIF IBM
+C..##ELIF CRAY
+C..##ELIF ALPHA T3D T3E
+C..##ELSE
+C...##IF SINGLE
+C...##ELSE
+ PARAMETER (RPRECI = 2.22045D-16, RBIGST = 4.49423D+307)
+C...##ENDIF
+C..##ENDIF
+C-----------------------------------------------------------------------
+C-----------------------------------------------------------------------
+C:::##INCLUDE '~/charmm_fcm/consta.fcm'
+ REAL*8 PI,RADDEG,DEGRAD,TWOPI
+ PARAMETER(PI=3.141592653589793D0,TWOPI=2.0D0*PI)
+ PARAMETER (RADDEG=180.0D0/PI)
+ PARAMETER (DEGRAD=PI/180.0D0)
+ REAL*8 COSMAX
+ PARAMETER (COSMAX=0.9999999999D0)
+ REAL*8 TIMFAC
+ PARAMETER (TIMFAC=4.88882129D-02)
+ REAL*8 KBOLTZ
+ PARAMETER (KBOLTZ=1.987191D-03)
+ REAL*8 CCELEC
+C..##IF AMBER
+C..##ELIF DISCOVER
+C..##ELSE
+ PARAMETER (CCELEC=332.0716D0)
+C..##ENDIF
+ REAL*8 CNVFRQ
+ PARAMETER (CNVFRQ=2045.5D0/(2.99793D0*6.28319D0))
+ REAL*8 SPEEDL
+ PARAMETER (SPEEDL=2.99793D-02)
+ REAL*8 ATMOSP
+ PARAMETER (ATMOSP=1.4584007D-05)
+ REAL*8 PATMOS
+ PARAMETER (PATMOS = 1.D0 / ATMOSP )
+ REAL*8 BOHRR
+ PARAMETER (BOHRR = 0.529177249D0 )
+ REAL*8 TOKCAL
+ PARAMETER (TOKCAL = 627.5095D0 )
+C..##IF MMFF
+ real*8 MDAKCAL
+ parameter(MDAKCAL=143.9325D0)
+C..##ENDIF
+ REAL*8 DEBYEC
+ PARAMETER ( DEBYEC = 2.541766D0 / BOHRR )
+ REAL*8 ZEROC
+ PARAMETER ( ZEROC = 298.15D0 )
+C-----------------------------------------------------------------------
+C-----------------------------------------------------------------------
+C:::##INCLUDE '~/charmm_fcm/exfunc.fcm'
+C..##IF ACE
+C..##ENDIF
+C..##IF ADUMB
+C..##ENDIF
+ CHARACTER*4 GTRMA, NEXTA4, CURRA4
+ CHARACTER*6 NEXTA6
+ CHARACTER*8 NEXTA8
+ CHARACTER*20 NEXT20
+ INTEGER ALLCHR, ALLSTK, ALLHP, DECODI, FIND52,
+ * GETATN, GETRES, GETRSN, GETSEG, GTRMI, I4VAL,
+ * ICHAR4, ICMP16, ILOGI4, INDX, INDXA, INDXAF,
+ * INDXRA, INTEG4, IREAL4, IREAL8, LOCDIF,
+ * LUNASS, MATOM, NEXTI, NINDX, NSELCT, NSELCTV, ATMSEL,
+ * PARNUM, PARINS,
+ * SRCHWD, SRCHWS, STRLNG, DSIZE, SSIZE
+C..##IF ACE
+ * ,GETNNB
+C..##ENDIF
+ LOGICAL CHKPTR, EQST, EQSTA, EQSTWC, EQWDWC, DOTRIM, CHECQUE,
+ * HYDROG, INITIA, LONE, LTSTEQ, ORDER, ORDER5,
+ * ORDERR, USEDDT, QTOKDEL, QDIGIT, QALPHA
+ REAL*8 DECODF, DOTVEC, GTRMF, LENVEC, NEXTF, RANDOM, GTRR8,
+ * RANUMB, R8VAL, RETVAL8, SUMVEC
+C..##IF ADUMB
+ * ,UMFI
+C..##ENDIF
+ EXTERNAL GTRMA, NEXTA4, CURRA4, NEXTA6, NEXTA8,NEXT20,
+ * ALLCHR, ALLSTK, ALLHP, DECODI, FIND52,
+ * GETATN, GETRES, GETRSN, GETSEG, GTRMI, I4VAL,
+ * ICHAR4, ICMP16, ILOGI4, INDX, INDXA, INDXAF,
+ * INDXRA, INTEG4, IREAL4, IREAL8, LOCDIF,
+ * LUNASS, MATOM, NEXTI, NINDX, NSELCT, NSELCTV, ATMSEL,
+ * PARNUM, PARINS,
+ * SRCHWD, SRCHWS, STRLNG, DSIZE, SSIZE,
+ * CHKPTR, EQST, EQSTA, EQSTWC, EQWDWC, DOTRIM, CHECQUE,
+ * HYDROG, INITIA, LONE, LTSTEQ, ORDER, ORDER5,
+ * ORDERR, USEDDT, QTOKDEL, QDIGIT, QALPHA,
+ * DECODF, DOTVEC, GTRMF, LENVEC, NEXTF, RANDOM, GTRR8,
+ * RANUMB, R8VAL, RETVAL8, SUMVEC
+C..##IF ADUMB
+ * ,UMFI
+C..##ENDIF
+C..##IF ACE
+ * ,GETNNB
+C..##ENDIF
+C..##IFN NOIMAGES
+ INTEGER IMATOM
+ EXTERNAL IMATOM
+C..##ENDIF
+C..##IF MBOND
+C..##ENDIF
+C..##IF MMFF
+ INTEGER LEN_TRIM
+ EXTERNAL LEN_TRIM
+ CHARACTER*4 AtName
+ external AtName
+ CHARACTER*8 ElementName
+ external ElementName
+ CHARACTER*10 QNAME
+ external QNAME
+ integer IATTCH, IBORDR, CONN12, CONN13, CONN14
+ integer LEQUIV, LPATH
+ integer nbndx, nbnd2, nbnd3, NTERMA
+ external IATTCH, IBORDR, CONN12, CONN13, CONN14
+ external LEQUIV, LPATH
+ external nbndx, nbnd2, nbnd3, NTERMA
+ external find_loc
+ real*8 vangle, OOPNGL, TORNGL, ElementMass
+ external vangle, OOPNGL, TORNGL, ElementMass
+C..##ENDIF
+C-----------------------------------------------------------------------
+C-----------------------------------------------------------------------
+C:::##INCLUDE '~/charmm_fcm/stack.fcm'
+ INTEGER STKSIZ
+C..##IFN UNICOS
+C...##IF LARGE XLARGE
+C...##ELIF MEDIUM REDUCE
+ PARAMETER (STKSIZ=4000000)
+C...##ELIF SMALL
+C...##ELIF XSMALL
+C...##ELIF XXLARGE
+C...##ELSE
+C...##ENDIF
+ INTEGER LSTUSD,MAXUSD,STACK
+ COMMON /ISTACK/ LSTUSD,MAXUSD,STACK(STKSIZ)
+C..##ELSE
+C..##ENDIF
+C..##IF SAVEFCM
+C..##ENDIF
+C-----------------------------------------------------------------------
+C-----------------------------------------------------------------------
+C:::##INCLUDE '~/charmm_fcm/heap.fcm'
+ INTEGER HEAPDM
+C..##IFN UNICOS (unicos)
+C...##IF XXLARGE (size)
+C...##ELIF LARGE XLARGE (size)
+C...##ELIF MEDIUM (size)
+C....##IF T3D (t3d2)
+C....##ELIF TERRA (t3d2)
+C....##ELIF ALPHA (t3d2)
+C....##ELIF T3E (t3d2)
+C....##ELSE (t3d2)
+ PARAMETER (HEAPDM=2048000)
+C....##ENDIF (t3d2)
+C...##ELIF SMALL (size)
+C...##ELIF REDUCE (size)
+C...##ELIF XSMALL (size)
+C...##ELSE (size)
+C...##ENDIF (size)
+ INTEGER FREEHP,HEAPSZ,HEAP
+ COMMON /HEAPST/ FREEHP,HEAPSZ,HEAP(HEAPDM)
+ LOGICAL LHEAP(HEAPDM)
+ EQUIVALENCE (LHEAP,HEAP)
+C..##ELSE (unicos)
+C..##ENDIF (unicos)
+C..##IF SAVEFCM (save)
+C..##ENDIF (save)
+C-----------------------------------------------------------------------
+C-----------------------------------------------------------------------
+C:::##INCLUDE '~/charmm_fcm/fast.fcm'
+ INTEGER IACNB, NITCC, ICUSED, FASTER, LFAST, LMACH, OLMACH
+ INTEGER ICCOUNT, LOWTP, IGCNB, NITCC2
+ INTEGER ICCNBA, ICCNBB, ICCNBC, ICCNBD, LCCNBA, LCCNBD
+ COMMON /FASTI/ FASTER, LFAST, LMACH, OLMACH, NITCC, NITCC2,
+ & ICUSED(MAXATC), ICCOUNT(MAXATC), LOWTP(MAXATC),
+ & IACNB(MAXAIM), IGCNB(MAXATC),
+ & ICCNBA, ICCNBB, ICCNBC, ICCNBD, LCCNBA, LCCNBD
+C..##IF SAVEFCM
+C..##ENDIF
+C-----------------------------------------------------------------------
+C-----------------------------------------------------------------------
+C:::##INCLUDE '~/charmm_fcm/deriv.fcm'
+ REAL*8 DX,DY,DZ
+ COMMON /DERIVR/ DX(MAXAIM),DY(MAXAIM),DZ(MAXAIM)
+C..##IF SAVEFCM
+C..##ENDIF
+C-----------------------------------------------------------------------
+C-----------------------------------------------------------------------
+C:::##INCLUDE '~/charmm_fcm/energy.fcm'
+ INTEGER LENENP, LENENT, LENENV, LENENA
+ PARAMETER (LENENP = 50, LENENT = 70, LENENV = 50,
+ & LENENA = LENENP + LENENT + LENENV )
+ INTEGER TOTE, TOTKE, EPOT, TEMPS, GRMS, BPRESS, PJNK1, PJNK2,
+ & PJNK3, PJNK4, HFCTE, HFCKE, EHFC, EWORK, VOLUME, PRESSE,
+ & PRESSI, VIRI, VIRE, VIRKE, TEPR, PEPR, KEPR, KEPR2,
+ & DROFFA,
+ & XTLTE, XTLKE, XTLPE, XTLTEM, XTLPEP, XTLKEP, XTLKP2,
+ & TOT4, TOTK4, EPOT4, TEM4, MbMom, BodyT, PartT
+C..##IF ACE
+ & , SELF, SCREEN, COUL ,SOLV, INTER
+C..##ENDIF
+C..##IF FLUCQ
+ & ,FQKIN
+C..##ENDIF
+ PARAMETER (TOTE = 1, TOTKE = 2, EPOT = 3, TEMPS = 4,
+ & GRMS = 5, BPRESS = 6, PJNK1 = 7, PJNK2 = 8,
+ & PJNK3 = 9, PJNK4 = 10, HFCTE = 11, HFCKE = 12,
+ & EHFC = 13, EWORK = 11, VOLUME = 15, PRESSE = 16,
+ & PRESSI = 17, VIRI = 18, VIRE = 19, VIRKE = 20,
+ & TEPR = 21, PEPR = 22, KEPR = 23, KEPR2 = 24,
+ & DROFFA = 26, XTLTE = 27, XTLKE = 28,
+ & XTLPE = 29, XTLTEM = 30, XTLPEP = 31, XTLKEP = 32,
+ & XTLKP2 = 33,
+ & TOT4 = 37, TOTK4 = 38, EPOT4 = 39, TEM4 = 40,
+ & MbMom = 41, BodyT = 42, PartT = 43
+C..##IF ACE
+ & , SELF = 45, SCREEN = 46, COUL = 47,
+ & SOLV = 48, INTER = 49
+C..##ENDIF
+C..##IF FLUCQ
+ & ,FQKIN = 50
+C..##ENDIF
+ & )
+C..##IF ACE
+C..##ENDIF
+C..##IF GRID
+C..##ENDIF
+C..##IF FLUCQ
+C..##ENDIF
+ INTEGER BOND, ANGLE, UREYB, DIHE, IMDIHE, VDW, ELEC, HBOND,
+ & USER, CHARM, CDIHE, CINTCR, CQRT, NOE, SBNDRY,
+ & IMVDW, IMELEC, IMHBND, EWKSUM, EWSELF, EXTNDE, RXNFLD,
+ & ST2, IMST2, TSM, QMEL, QMVDW, ASP, EHARM, GEO, MDIP,
+ & PRMS, PANG, SSBP, BK4D, SHEL, RESD, SHAP,
+ & STRB, OOPL, PULL, POLAR, DMC, RGY, EWEXCL, EWQCOR,
+ & EWUTIL, PBELEC, PBNP, PINT, MbDefrm, MbElec, STRSTR,
+ & BNDBND, BNDTW, EBST, MBST, BBT, SST, GBEnr, GSBP
+C..##IF HMCM
+ & , HMCM
+C..##ENDIF
+C..##IF ADUMB
+ & , ADUMB
+C..##ENDIF
+ & , HYDR
+C..##IF FLUCQ
+ & , FQPOL
+C..##ENDIF
+ PARAMETER (BOND = 1, ANGLE = 2, UREYB = 3, DIHE = 4,
+ & IMDIHE = 5, VDW = 6, ELEC = 7, HBOND = 8,
+ & USER = 9, CHARM = 10, CDIHE = 11, CINTCR = 12,
+ & CQRT = 13, NOE = 14, SBNDRY = 15, IMVDW = 16,
+ & IMELEC = 17, IMHBND = 18, EWKSUM = 19, EWSELF = 20,
+ & EXTNDE = 21, RXNFLD = 22, ST2 = 23, IMST2 = 24,
+ & TSM = 25, QMEL = 26, QMVDW = 27, ASP = 28,
+ & EHARM = 29, GEO = 30, MDIP = 31, PINT = 32,
+ & PRMS = 33, PANG = 34, SSBP = 35, BK4D = 36,
+ & SHEL = 37, RESD = 38, SHAP = 39, STRB = 40,
+ & OOPL = 41, PULL = 42, POLAR = 43, DMC = 44,
+ & RGY = 45, EWEXCL = 46, EWQCOR = 47, EWUTIL = 48,
+ & PBELEC = 49, PBNP = 50, MbDefrm= 51, MbElec = 52,
+ & STRSTR = 53, BNDBND = 54, BNDTW = 55, EBST = 56,
+ & MBST = 57, BBT = 58, SST = 59, GBEnr = 60,
+ & GSBP = 65
+C..##IF HMCM
+ & , HMCM = 61
+C..##ENDIF
+C..##IF ADUMB
+ & , ADUMB = 62
+C..##ENDIF
+ & , HYDR = 63
+C..##IF FLUCQ
+ & , FQPOL = 65
+C..##ENDIF
+ & )
+ INTEGER VEXX, VEXY, VEXZ, VEYX, VEYY, VEYZ, VEZX, VEZY, VEZZ,
+ & VIXX, VIXY, VIXZ, VIYX, VIYY, VIYZ, VIZX, VIZY, VIZZ,
+ & PEXX, PEXY, PEXZ, PEYX, PEYY, PEYZ, PEZX, PEZY, PEZZ,
+ & PIXX, PIXY, PIXZ, PIYX, PIYY, PIYZ, PIZX, PIZY, PIZZ
+ PARAMETER ( VEXX = 1, VEXY = 2, VEXZ = 3, VEYX = 4,
+ & VEYY = 5, VEYZ = 6, VEZX = 7, VEZY = 8,
+ & VEZZ = 9,
+ & VIXX = 10, VIXY = 11, VIXZ = 12, VIYX = 13,
+ & VIYY = 14, VIYZ = 15, VIZX = 16, VIZY = 17,
+ & VIZZ = 18,
+ & PEXX = 19, PEXY = 20, PEXZ = 21, PEYX = 22,
+ & PEYY = 23, PEYZ = 24, PEZX = 25, PEZY = 26,
+ & PEZZ = 27,
+ & PIXX = 28, PIXY = 29, PIXZ = 30, PIYX = 31,
+ & PIYY = 32, PIYZ = 33, PIZX = 34, PIZY = 35,
+ & PIZZ = 36)
+ CHARACTER*4 CEPROP, CETERM, CEPRSS
+ COMMON /ANER/ CEPROP(LENENP), CETERM(LENENT), CEPRSS(LENENV)
+ LOGICAL QEPROP, QETERM, QEPRSS
+ COMMON /QENER/ QEPROP(LENENP), QETERM(LENENT), QEPRSS(LENENV)
+ REAL*8 EPROP, ETERM, EPRESS
+ COMMON /ENER/ EPROP(LENENP), ETERM(LENENT), EPRESS(LENENV)
+C..##IF SAVEFCM
+C..##ENDIF
+ REAL*8 EPRPA, EPRP2A, EPRPP, EPRP2P,
+ & ETRMA, ETRM2A, ETRMP, ETRM2P,
+ & EPRSA, EPRS2A, EPRSP, EPRS2P
+ COMMON /ENACCM/ EPRPA(LENENP), ETRMA(LENENT), EPRSA(LENENV),
+ & EPRP2A(LENENP),ETRM2A(LENENT),EPRS2A(LENENV),
+ & EPRPP(LENENP), ETRMP(LENENT), EPRSP(LENENV),
+ & EPRP2P(LENENP),ETRM2P(LENENT),EPRS2P(LENENV)
+C..##IF SAVEFCM
+C..##ENDIF
+ INTEGER ECALLS, TOT1ST, TOT2ND
+ COMMON /EMISCI/ ECALLS, TOT1ST, TOT2ND
+ REAL*8 EOLD, FITA, DRIFTA, EAT0A, CORRA, FITP, DRIFTP,
+ & EAT0P, CORRP
+ COMMON /EMISCR/ EOLD, FITA, DRIFTA, EAT0A, CORRA,
+ & FITP, DRIFTP, EAT0P, CORRP
+C..##IF SAVEFCM
+C..##ENDIF
+C..##IF ACE
+C..##ENDIF
+C..##IF FLUCQ
+C..##ENDIF
+C..##IF ADUMB
+C..##ENDIF
+C..##IF GRID
+C..##ENDIF
+C..##IF FLUCQ
+C..##ENDIF
+C..##IF TSM
+ REAL*8 TSMTRM(LENENT),TSMTMP(LENENT)
+ COMMON /TSMENG/ TSMTRM,TSMTMP
+C...##IF SAVEFCM
+C...##ENDIF
+C..##ENDIF
+ REAL*8 EHQBM
+ LOGICAL HQBM
+ COMMON /HQBMVAR/HQBM
+C..##IF SAVEFCM
+C..##ENDIF
+C-----------------------------------------------------------------------
+C-----------------------------------------------------------------------
+C:::##INCLUDE '~/charmm_fcm/dimb.fcm'
+C..##IF DIMB (dimbfcm)
+ INTEGER NPARMX,MNBCMP,LENDSK
+ PARAMETER (NPARMX=1000,MNBCMP=300,LENDSK=200000)
+ INTEGER IJXXCM,IJXYCM,IJXZCM,IJYXCM,IJYYCM
+ INTEGER IJYZCM,IJZXCM,IJZYCM,IJZZCM
+ INTEGER IIXXCM,IIXYCM,IIXZCM,IIYYCM
+ INTEGER IIYZCM,IIZZCM
+ INTEGER JJXXCM,JJXYCM,JJXZCM,JJYYCM
+ INTEGER JJYZCM,JJZZCM
+ PARAMETER (IJXXCM=1,IJXYCM=2,IJXZCM=3,IJYXCM=4,IJYYCM=5)
+ PARAMETER (IJYZCM=6,IJZXCM=7,IJZYCM=8,IJZZCM=9)
+ PARAMETER (IIXXCM=1,IIXYCM=2,IIXZCM=3,IIYYCM=4)
+ PARAMETER (IIYZCM=5,IIZZCM=6)
+ PARAMETER (JJXXCM=1,JJXYCM=2,JJXZCM=3,JJYYCM=4)
+ PARAMETER (JJYZCM=5,JJZZCM=6)
+ INTEGER ITER,IPAR1,IPAR2,NFSAV,PINBCM,PJNBCM,PDD1CM,LENCMP
+ LOGICAL QDISK,QDW,QCMPCT
+ COMMON /DIMBI/ ITER,IPAR1,IPAR2,NFSAV,PINBCM,PJNBCM,LENCMP
+ COMMON /DIMBL/ QDISK,QDW,QCMPCT
+C...##IF SAVEFCM
+C...##ENDIF
+C..##ENDIF (dimbfcm)
+C-----------------------------------------------------------------------
+C-----------------------------------------------------------------------
+C:::##INCLUDE '~/charmm_fcm/ctitla.fcm'
+ INTEGER MAXTIT
+ PARAMETER (MAXTIT=32)
+ INTEGER NTITLA,NTITLB
+ CHARACTER*80 TITLEA,TITLEB
+ COMMON /NTITLA/ NTITLA,NTITLB
+ COMMON /CTITLA/ TITLEA(MAXTIT),TITLEB(MAXTIT)
+C..##IF SAVEFCM
+C..##ENDIF
+C-----------------------------------------------------------------------
+C Passed variables
+ INTEGER NAT3,NADD,NPAR,NFREG,NFRET,BLATOM
+ INTEGER ATMPAR(2,*),ATMPAS(2,*),ATMPAD(2,*)
+ INTEGER BNBND(*),BIMAG(*)
+ INTEGER INBCMP(*),JNBCMP(*),PARDIM
+ INTEGER ITMX,IUNMOD,IUNRMD,SAVF
+ INTEGER NBOND,IB(*),JB(*)
+ REAL*8 X(*),Y(*),Z(*),AMASS(*),DDSCR(*)
+ REAL*8 DDV(NAT3,*),PARDDV(PARDIM,*),DDM(*),DDS(*)
+ REAL*8 DDF(*),PARDDF(*),DDEV(*),PARDDE(*)
+ REAL*8 DD1BLK(*),DD1BLL(*),DD1CMP(*)
+ REAL*8 TOLDIM,DDVALM
+ REAL*8 PARFRQ,CUTF1
+ LOGICAL LNOMA,LRAISE,LSCI,LBIG
+C Local variables
+ INTEGER NATOM,NATP,NDIM,I,J,II,OLDFAS,OLDPRN,IUPD
+ INTEGER NPARC,NPARD,NPARS,NFCUT1,NFREG2,NFREG6
+ INTEGER IH1,IH2,IH3,IH4,IH5,IH6,IH7,IH8
+ INTEGER IS1,IS2,IS3,IS4,JSPACE,JSP,DDSS,DD5
+ INTEGER ISTRT,ISTOP,IPA1,IPA2,IRESF
+ INTEGER ATMPAF,INIDS,TRAROT
+ INTEGER SUBLIS,ATMCOR
+ INTEGER NFRRES,DDVBAS
+ INTEGER DDV2,DDVAL
+ INTEGER LENCM,NTR,NFRE,NFC,N1,N2,NFCUT,NSUBP
+ INTEGER SCIFV1,SCIFV2,SCIFV3,SCIFV4,SCIFV6
+ INTEGER DRATQ,ERATQ,E2RATQ,BDRATQ,INRATQ
+ INTEGER I620,I640,I660,I700,I720,I760,I800,I840,I880,I920
+ REAL*8 CVGMX,TOLER
+ LOGICAL LCARD,LAPPE,LPURG,LWDINI,QCALC,QMASWT,QMIX,QDIAG
+C Begin
+ QCALC=.TRUE.
+ LWDINI=.FALSE.
+ INIDS=0
+ IS3=0
+ IS4=0
+ LPURG=.TRUE.
+ ITER=0
+ NADD=0
+ NFSAV=0
+ TOLER=TENM5
+ QDIAG=.TRUE.
+ CVGMX=HUNDRD
+ QMIX=.FALSE.
+ NATOM=NAT3/3
+ NFREG6=(NFREG-6)/NPAR
+ NFREG2=NFREG/2
+ NFRRES=(NFREG+6)/2
+ IF(NFREG.GT.PARDIM) CALL WRNDIE(-3,'<NMDIMB>',
+ 1 'NFREG IS LARGER THAN PARDIM*3')
+C
+C ALLOCATE-SPACE-FOR-TRANSROT-VECTORS
+ ASSIGN 801 TO I800
+ GOTO 800
+ 801 CONTINUE
+C ALLOCATE-SPACE-FOR-DIAGONALIZATION
+ ASSIGN 721 TO I720
+ GOTO 720
+ 721 CONTINUE
+C ALLOCATE-SPACE-FOR-REDUCED-BASIS
+ ASSIGN 761 TO I760
+ GOTO 760
+ 761 CONTINUE
+C ALLOCATE-SPACE-FOR-OTHER-ARRAYS
+ ASSIGN 921 TO I920
+ GOTO 920
+ 921 CONTINUE
+C
+C Space allocation for working arrays of EISPACK
+C diagonalization subroutines
+ IF(LSCI) THEN
+C ALLOCATE-SPACE-FOR-LSCI
+ ASSIGN 841 TO I840
+ GOTO 840
+ 841 CONTINUE
+ ELSE
+C ALLOCATE-DUMMY-SPACE-FOR-LSCI
+ ASSIGN 881 TO I880
+ GOTO 880
+ 881 CONTINUE
+ ENDIF
+ QMASWT=(.NOT.LNOMA)
+ IF(.NOT. QDISK) THEN
+ LENCM=INBCMP(NATOM-1)*9+NATOM*6
+ DO I=1,LENCM
+ DD1CMP(I)=0.0
+ ENDDO
+ OLDFAS=LFAST
+ QCMPCT=.TRUE.
+ LFAST = -1
+ CALL ENERGY(X,Y,Z,DX,DY,DZ,BNBND,BIMAG,NAT3,DD1CMP,.TRUE.,1)
+ LFAST=OLDFAS
+ QCMPCT=.FALSE.
+C
+C Mass weight DD1CMP matrix
+C
+ CALL MASSDD(DD1CMP,DDM,INBCMP,JNBCMP,NATOM)
+ ELSE
+ CALL WRNDIE(-3,'<NMDIMB>','QDISK OPTION NOT SUPPORTED YET')
+C DO I=1,LENDSK
+C DD1CMP(I)=0.0
+C ENDDO
+C OLDFAS=LFAST
+C LFAST = -1
+ ENDIF
+C
+C Fill DDV with six translation-rotation vectors
+C
+ CALL TRROT(X,Y,Z,DDV,NAT3,1,DDM)
+ CALL CPARAY(HEAP(TRAROT),DDV,NAT3,1,6,1)
+ NTR=6
+ OLDPRN=PRNLEV
+ PRNLEV=1
+ CALL ORTHNM(1,6,NTR,HEAP(TRAROT),NAT3,.FALSE.,TOLER)
+ PRNLEV=OLDPRN
+ IF(IUNRMD .LT. 0) THEN
+C
+C If no previous basis is read
+C
+ IF(PRNLEV.GE.2) WRITE(OUTU,502) NPAR
+ 502 FORMAT(/' NMDIMB: Calculating initial basis from block ',
+ 1 'diagonals'/' NMDIMB: The number of blocks is ',I5/)
+ NFRET = 6
+ DO I=1,NPAR
+ IS1=ATMPAR(1,I)
+ IS2=ATMPAR(2,I)
+ NDIM=(IS2-IS1+1)*3
+ NFRE=NDIM
+ IF(NFRE.GT.NFREG6) NFRE=NFREG6
+ IF(NFREG6.EQ.0) NFRE=1
+ CALL FILUPT(HEAP(IUPD),NDIM)
+ CALL MAKDDU(DD1BLK,DD1CMP,INBCMP,JNBCMP,HEAP(IUPD),
+ 1 IS1,IS2,NATOM)
+ IF(PRNLEV.GE.9) CALL PRINTE(OUTU,EPROP,ETERM,'VIBR',
+ 1 'ENR',.TRUE.,1,ZERO,ZERO)
+C
+C Generate the lower section of the matrix and diagonalize
+C
+C..##IF EISPACK
+C..##ENDIF
+ IH1=1
+ NATP=NDIM+1
+ IH2=IH1+NATP
+ IH3=IH2+NATP
+ IH4=IH3+NATP
+ IH5=IH4+NATP
+ IH6=IH5+NATP
+ IH7=IH6+NATP
+ IH8=IH7+NATP
+ CALL DIAGQ(NDIM,NFRE,DD1BLK,PARDDV,DDS(IH2),DDS(IH3),
+ 1 DDS(IH4),DDS(IH5),DDS,DDS(IH6),DDS(IH7),DDS(IH8),NADD)
+C..##IF EISPACK
+C..##ENDIF
+C
+C Put the PARDDV vectors into DDV and replace the elements which do
+C not belong to the considered partitioned region by zeros.
+C
+ CALL ADJNME(DDV,PARDDV,NAT3,NDIM,NFRE,NFRET,IS1,IS2)
+ IF(LSCI) THEN
+ DO J=1,NFRE
+ PARDDF(J)=CNVFRQ*SQRT(ABS(PARDDE(J)))
+ IF(PARDDE(J) .LT. 0.0) PARDDF(J)=-PARDDF(J)
+ ENDDO
+ ELSE
+ DO J=1,NFRE
+ PARDDE(J)=DDS(J)
+ PARDDF(J)=CNVFRQ*SQRT(ABS(PARDDE(J)))
+ IF(PARDDE(J) .LT. 0.0) PARDDF(J)=-PARDDF(J)
+ ENDDO
+ ENDIF
+ IF(PRNLEV.GE.2) THEN
+ WRITE(OUTU,512) I
+ WRITE(OUTU,514)
+ WRITE(OUTU,516) (J,PARDDF(J),J=1,NFRE)
+ ENDIF
+ NFRET=NFRET+NFRE
+ IF(NFRET .GE. NFREG) GOTO 10
+ ENDDO
+ 512 FORMAT(/' NMDIMB: Diagonalization of part',I5,' completed')
+ 514 FORMAT(' NMDIMB: Frequencies'/)
+ 516 FORMAT(5(I4,F12.6))
+ 10 CONTINUE
+C
+C Orthonormalize the eigenvectors
+C
+ OLDPRN=PRNLEV
+ PRNLEV=1
+ CALL ORTHNM(1,NFRET,NFRET,DDV,NAT3,LPURG,TOLER)
+ PRNLEV=OLDPRN
+C
+C Do reduced basis diagonalization using the DDV vectors
+C and get eigenvectors of zero iteration
+C
+ IF(PRNLEV.GE.2) THEN
+ WRITE(OUTU,521) ITER
+ WRITE(OUTU,523) NFRET
+ ENDIF
+ 521 FORMAT(/' NMDIMB: Iteration number = ',I5)
+ 523 FORMAT(' NMDIMB: Dimension of the reduced basis set = ',I5)
+ IF(LBIG) THEN
+ IF(PRNLEV.GE.2) WRITE(OUTU,585) NFRET,IUNMOD
+ 525 FORMAT(' NMDIMB: ',I5,' basis vectors are saved in unit',I5)
+ REWIND (UNIT=IUNMOD)
+ LCARD=.FALSE.
+ CALL WRTNMD(LCARD,1,NFRET,NAT3,DDV,DDSCR,DDEV,IUNMOD,AMASS)
+ CALL SAVEIT(IUNMOD)
+ ELSE
+ CALL CPARAY(HEAP(DDVBAS),DDV,NAT3,1,NFRET,1)
+ ENDIF
+ CALL RBDG(X,Y,Z,NAT3,NDIM,NFRET,DDV,DDF,DDEV,
+ 1 DDSCR,HEAP(DD5),HEAP(DDSS),HEAP(DDV2),NADD,
+ 2 INBCMP,JNBCMP,HEAP(DDVBAS),DD1CMP,QMIX,0,0,IS3,IS4,
+ 3 CUTF1,NFCUT1,NFREG,HEAP(IUPD),DD1BLL,HEAP(SCIFV1),
+ 4 HEAP(SCIFV2),HEAP(SCIFV3),HEAP(SCIFV4),HEAP(SCIFV6),
+ 5 HEAP(DRATQ),HEAP(ERATQ),HEAP(E2RATQ),
+ 6 HEAP(BDRATQ),HEAP(INRATQ),LSCI,LBIG,IUNMOD)
+C
+C DO-THE-DIAGONALISATIONS-WITH-RESIDUALS
+C
+ ASSIGN 621 TO I620
+ GOTO 620
+ 621 CONTINUE
+C SAVE-MODES
+ ASSIGN 701 TO I700
+ GOTO 700
+ 701 CONTINUE
+ IF(ITER.EQ.ITMX) THEN
+ CALL CLEANHP(NAT3,NFREG,NPARD,NSUBP,PARDIM,DDV2,DDSS,DDVBAS,
+ 1 DDVAL,JSPACE,TRAROT,
+ 2 SCIFV1,SCIFV2,SCIFV3,SCIFV4,SCIFV6,
+ 3 DRATQ,ERATQ,E2RATQ,BDRATQ,INRATQ,IUPD,ATMPAF,
+ 4 ATMCOR,SUBLIS,LSCI,QDW,LBIG)
+ RETURN
+ ENDIF
+ ELSE
+C
+C Read in existing basis
+C
+ IF(PRNLEV.GE.2) THEN
+ WRITE(OUTU,531)
+ 531 FORMAT(/' NMDIMB: Calculations restarted')
+ ENDIF
+C READ-MODES
+ ISTRT=1
+ ISTOP=99999999
+ LCARD=.FALSE.
+ LAPPE=.FALSE.
+ CALL RDNMD(LCARD,NFRET,NFREG,NAT3,NDIM,
+ 1 DDV,DDSCR,DDF,DDEV,
+ 2 IUNRMD,LAPPE,ISTRT,ISTOP)
+ NFRET=NDIM
+ IF(NFRET.GT.NFREG) THEN
+ NFRET=NFREG
+ CALL WRNDIE(-1,'<NMDIMB>',
+ 1 'Not enough space to hold the basis. Increase NMODes')
+ ENDIF
+C PRINT-MODES
+ IF(PRNLEV.GE.2) THEN
+ WRITE(OUTU,533) NFRET,IUNRMD
+ WRITE(OUTU,514)
+ WRITE(OUTU,516) (J,DDF(J),J=1,NFRET)
+ ENDIF
+ 533 FORMAT(/' NMDIMB: ',I5,' restart modes read from unit ',I5)
+ NFRRES=NFRET
+ ENDIF
+C
+C -------------------------------------------------
+C Here starts the mixed-basis diagonalization part.
+C -------------------------------------------------
+C
+C
+C Check cut-off frequency
+C
+ CALL SELNMD(DDF,NFRET,CUTF1,NFCUT1)
+C TEST-NFCUT1
+ IF(IUNRMD.LT.0) THEN
+ IF(NFCUT1*2-6.GT.NFREG) THEN
+ IF(PRNLEV.GE.2) WRITE(OUTU,537) DDF(NFRRES)
+ NFCUT1=NFRRES
+ CUTF1=DDF(NFRRES)
+ ENDIF
+ ELSE
+ CUTF1=DDF(NFRRES)
+ ENDIF
+ 537 FORMAT(/' NMDIMB: Too many vectors for the given cutoff frequency'
+ 1 /' Cutoff frequency is decreased to',F9.3)
+C
+C Compute the new partioning of the molecule
+C
+ CALL PARTIC(NAT3,NFREG,NFCUT1,NPARMX,NPARC,ATMPAR,NFRRES,
+ 1 PARDIM)
+ NPARS=NPARC
+ DO I=1,NPARC
+ ATMPAS(1,I)=ATMPAR(1,I)
+ ATMPAS(2,I)=ATMPAR(2,I)
+ ENDDO
+ IF(QDW) THEN
+ IF(IPAR1.EQ.0.OR.IPAR2.EQ.0) LWDINI=.TRUE.
+ IF(IPAR1.GE.IPAR2) LWDINI=.TRUE.
+ IF(IABS(IPAR1).GT.NPARC*2) LWDINI=.TRUE.
+ IF(IABS(IPAR2).GT.NPARC*2) LWDINI=.TRUE.
+ IF(ITER.EQ.0) LWDINI=.TRUE.
+ ENDIF
+ ITMX=ITMX+ITER
+ IF(PRNLEV.GE.2) THEN
+ WRITE(OUTU,543) ITER,ITMX
+ IF(QDW) WRITE(OUTU,545) IPAR1,IPAR2
+ ENDIF
+ 543 FORMAT(/' NMDIMB: Previous iteration number = ',I8/
+ 1 ' NMDIMB: Iteration number to reach = ',I8)
+ 545 FORMAT(' NMDIMB: Previous sub-blocks = ',I5,2X,I5)
+C
+ IF(SAVF.LE.0) SAVF=NPARC
+ IF(PRNLEV.GE.2) WRITE(OUTU,547) SAVF
+ 547 FORMAT(' NMDIMB: Eigenvectors will be saved every',I5,
+ 1 ' iterations')
+C
+C If double windowing is defined, the original block sizes are divided
+C in two.
+C
+ IF(QDW) THEN
+ NSUBP=1
+ CALL PARTID(NPARC,ATMPAR,NPARD,ATMPAD,NPARMX)
+ ATMPAF=ALLHP(INTEG4(NPARD*NPARD))
+ ATMCOR=ALLHP(INTEG4(NATOM))
+ DDVAL=ALLHP(IREAL8(NPARD*NPARD))
+ CALL CORARR(ATMPAD,NPARD,HEAP(ATMCOR),NATOM)
+ CALL PARLIS(HEAP(ATMCOR),HEAP(ATMPAF),INBCMP,JNBCMP,NPARD,
+ 2 NSUBP,NATOM,X,Y,Z,NBOND,IB,JB,DD1CMP,HEAP(DDVAL),DDVALM)
+ SUBLIS=ALLHP(INTEG4(NSUBP*2))
+ CALL PARINT(HEAP(ATMPAF),NPARD,HEAP(SUBLIS),NSUBP)
+ CALL INIPAF(HEAP(ATMPAF),NPARD)
+C
+C Find out with which block to continue (double window method only)
+C
+ IPA1=IPAR1
+ IPA2=IPAR2
+ IRESF=0
+ IF(LWDINI) THEN
+ ITER=0
+ LWDINI=.FALSE.
+ GOTO 500
+ ENDIF
+ DO II=1,NSUBP
+ CALL IPART(HEAP(SUBLIS),II,IPAR1,IPAR2,HEAP(ATMPAF),
+ 1 NPARD,QCALC)
+ IF((IPAR1.EQ.IPA1).AND.(IPAR2.EQ.IPA2)) GOTO 500
+ ENDDO
+ ENDIF
+ 500 CONTINUE
+C
+C Main loop.
+C
+ DO WHILE((CVGMX.GT.TOLDIM).AND.(ITER.LT.ITMX))
+ IF(.NOT.QDW) THEN
+ ITER=ITER+1
+ IF(PRNLEV.GE.2) WRITE(OUTU,553) ITER
+ 553 FORMAT(/' NMDIMB: Iteration number = ',I8)
+ IF(INIDS.EQ.0) THEN
+ INIDS=1
+ ELSE
+ INIDS=0
+ ENDIF
+ CALL PARTDS(NAT3,NPARC,ATMPAR,NPARS,ATMPAS,INIDS,NPARMX,
+ 1 DDF,NFREG,CUTF1,PARDIM,NFCUT1)
+C DO-THE-DIAGONALISATIONS
+ ASSIGN 641 to I640
+ GOTO 640
+ 641 CONTINUE
+ QDIAG=.FALSE.
+C DO-THE-DIAGONALISATIONS-WITH-RESIDUALS
+ ASSIGN 622 TO I620
+ GOTO 620
+ 622 CONTINUE
+ QDIAG=.TRUE.
+C SAVE-MODES
+ ASSIGN 702 TO I700
+ GOTO 700
+ 702 CONTINUE
+C
+ ELSE
+ DO II=1,NSUBP
+ CALL IPART(HEAP(SUBLIS),II,IPAR1,IPAR2,HEAP(ATMPAF),
+ 1 NPARD,QCALC)
+ IF(QCALC) THEN
+ IRESF=IRESF+1
+ ITER=ITER+1
+ IF(PRNLEV.GE.2) WRITE(OUTU,553) ITER
+C DO-THE-DWIN-DIAGONALISATIONS
+ ASSIGN 661 TO I660
+ GOTO 660
+ 661 CONTINUE
+ ENDIF
+ IF((IRESF.EQ.SAVF).OR.(ITER.EQ.ITMX)) THEN
+ IRESF=0
+ QDIAG=.FALSE.
+C DO-THE-DIAGONALISATIONS-WITH-RESIDUALS
+ ASSIGN 623 TO I620
+ GOTO 620
+ 623 CONTINUE
+ QDIAG=.TRUE.
+ IF((CVGMX.LE.TOLDIM).OR.(ITER.EQ.ITMX)) GOTO 600
+C SAVE-MODES
+ ASSIGN 703 TO I700
+ GOTO 700
+ 703 CONTINUE
+ ENDIF
+ ENDDO
+ ENDIF
+ ENDDO
+ 600 CONTINUE
+C
+C SAVE-MODES
+ ASSIGN 704 TO I700
+ GOTO 700
+ 704 CONTINUE
+ CALL CLEANHP(NAT3,NFREG,NPARD,NSUBP,PARDIM,DDV2,DDSS,DDVBAS,
+ 1 DDVAL,JSPACE,TRAROT,
+ 2 SCIFV1,SCIFV2,SCIFV3,SCIFV4,SCIFV6,
+ 3 DRATQ,ERATQ,E2RATQ,BDRATQ,INRATQ,IUPD,ATMPAF,
+ 4 ATMCOR,SUBLIS,LSCI,QDW,LBIG)
+ RETURN
+C-----------------------------------------------------------------------
+C INTERNAL PROCEDURES
+C-----------------------------------------------------------------------
+C TO DO-THE-DIAGONALISATIONS-WITH-RESIDUALS
+ 620 CONTINUE
+ IF(IUNRMD.LT.0) THEN
+ CALL SELNMD(DDF,NFRET,CUTF1,NFC)
+ N1=NFCUT1
+ N2=(NFRET+6)/2
+ NFCUT=MAX(N1,N2)
+ IF(NFCUT*2-6 .GT. NFREG) THEN
+ NFCUT=(NFREG+6)/2
+ CUTF1=DDF(NFCUT)
+ IF(PRNLEV.GE.2) THEN
+ WRITE(OUTU,562) ITER
+ WRITE(OUTU,564) CUTF1
+ ENDIF
+ ENDIF
+ ELSE
+ NFCUT=NFRET
+ NFC=NFRET
+ ENDIF
+ 562 FORMAT(/' NMDIMB: Not enough space to hold the residual vectors'/
+ 1 ' into DDV array during iteration ',I5)
+ 564 FORMAT(' Cutoff frequency is changed to ',F9.3)
+C
+C do reduced diagonalization with preceding eigenvectors plus
+C residual vectors
+C
+ ISTRT=1
+ ISTOP=NFCUT
+ CALL CLETR(DDV,HEAP(TRAROT),NAT3,ISTRT,ISTOP,NFCUT,DDEV,DDF)
+ CALL RNMTST(DDV,HEAP(DDVBAS),NAT3,DDSCR,DD1CMP,INBCMP,JNBCMP,
+ 2 7,NFCUT,CVGMX,NFCUT,NFC,QDIAG,LBIG,IUNMOD)
+ NFSAV=NFCUT
+ IF(QDIAG) THEN
+ NFRET=NFCUT*2-6
+ IF(PRNLEV.GE.2) WRITE(OUTU,566) NFRET
+ 566 FORMAT(/' NMDIMB: Diagonalization with residual vectors. '/
+ 1 ' Dimension of the reduced basis set'/
+ 2 ' before orthonormalization = ',I5)
+ NFCUT=NFRET
+ OLDPRN=PRNLEV
+ PRNLEV=1
+ CALL ORTHNM(1,NFRET,NFCUT,DDV,NAT3,LPURG,TOLER)
+ PRNLEV=OLDPRN
+ NFRET=NFCUT
+ IF(PRNLEV.GE.2) WRITE(OUTU,568) NFRET
+ 568 FORMAT(' after orthonormalization = ',I5)
+ IF(LBIG) THEN
+ IF(PRNLEV.GE.2) WRITE(OUTU,570) NFCUT,IUNMOD
+ 570 FORMAT(' NMDIMB: ',I5,' basis vectors are saved in unit',I5)
+ REWIND (UNIT=IUNMOD)
+ LCARD=.FALSE.
+ CALL WRTNMD(LCARD,1,NFCUT,NAT3,DDV,DDSCR,DDEV,IUNMOD,AMASS)
+ CALL SAVEIT(IUNMOD)
+ ELSE
+ CALL CPARAY(HEAP(DDVBAS),DDV,NAT3,1,NFCUT,1)
+ ENDIF
+ QMIX=.FALSE.
+ CALL RBDG(X,Y,Z,NAT3,NDIM,NFRET,DDV,DDF,DDEV,
+ 1 DDSCR,HEAP(DD5),HEAP(DDSS),HEAP(DDV2),NADD,
+ 2 INBCMP,JNBCMP,HEAP(DDVBAS),DD1CMP,QMIX,0,0,IS3,IS4,
+ 3 CUTF1,NFCUT1,NFREG,HEAP(IUPD),DD1BLL,HEAP(SCIFV1),
+ 4 HEAP(SCIFV2),HEAP(SCIFV3),HEAP(SCIFV4),HEAP(SCIFV6),
+ 5 HEAP(DRATQ),HEAP(ERATQ),HEAP(E2RATQ),
+ 6 HEAP(BDRATQ),HEAP(INRATQ),LSCI,LBIG,IUNMOD)
+ CALL SELNMD(DDF,NFRET,CUTF1,NFCUT1)
+ ENDIF
+ GOTO I620
+C
+C-----------------------------------------------------------------------
+C TO DO-THE-DIAGONALISATIONS
+ 640 CONTINUE
+ DO I=1,NPARC
+ NFCUT1=NFRRES
+ IS1=ATMPAR(1,I)
+ IS2=ATMPAR(2,I)
+ NDIM=(IS2-IS1+1)*3
+ IF(PRNLEV.GE.2) WRITE(OUTU,573) I,IS1,IS2
+ 573 FORMAT(/' NMDIMB: Mixed diagonalization, part ',I5/
+ 1 ' NMDIMB: Block limits: ',I5,2X,I5)
+ IF(NDIM+NFCUT1.GT.PARDIM) CALL WRNDIE(-3,'<NMDIMB>',
+ 1 'Error in dimension of block')
+ NFRET=NFCUT1
+ IF(NFRET.GT.NFREG) NFRET=NFREG
+ CALL CLETR(DDV,HEAP(TRAROT),NAT3,1,NFCUT1,NFCUT,DDEV,DDF)
+ NFCUT1=NFCUT
+ CALL ADZER(DDV,1,NFCUT1,NAT3,IS1,IS2)
+ NFSAV=NFCUT1
+ OLDPRN=PRNLEV
+ PRNLEV=1
+ CALL ORTHNM(1,NFCUT1,NFCUT,DDV,NAT3,LPURG,TOLER)
+ PRNLEV=OLDPRN
+ CALL CPARAY(HEAP(DDVBAS),DDV,NAT3,1,NFCUT,1)
+ NFRET=NDIM+NFCUT
+ QMIX=.TRUE.
+ CALL RBDG(X,Y,Z,NAT3,NDIM,NFRET,DDV,DDF,DDEV,
+ 1 DDSCR,HEAP(DD5),HEAP(DDSS),HEAP(DDV2),NADD,
+ 2 INBCMP,JNBCMP,HEAP(DDVBAS),DD1CMP,QMIX,IS1,IS2,IS3,IS4,
+ 3 CUTF1,NFCUT,NFREG,HEAP(IUPD),DD1BLL,HEAP(SCIFV1),
+ 4 HEAP(SCIFV2),HEAP(SCIFV3),HEAP(SCIFV4),HEAP(SCIFV6),
+ 5 HEAP(DRATQ),HEAP(ERATQ),HEAP(E2RATQ),
+ 6 HEAP(BDRATQ),HEAP(INRATQ),LSCI,LBIG,IUNMOD)
+ QMIX=.FALSE.
+ IF(NFCUT.GT.NFRRES) NFCUT=NFRRES
+ NFCUT1=NFCUT
+ NFRET=NFCUT
+ ENDDO
+ GOTO I640
+C
+C-----------------------------------------------------------------------
+C TO DO-THE-DWIN-DIAGONALISATIONS
+ 660 CONTINUE
+C
+C Store the DDV vectors into DDVBAS
+C
+ NFCUT1=NFRRES
+ IS1=ATMPAD(1,IPAR1)
+ IS2=ATMPAD(2,IPAR1)
+ IS3=ATMPAD(1,IPAR2)
+ IS4=ATMPAD(2,IPAR2)
+ NDIM=(IS2-IS1+IS4-IS3+2)*3
+ IF(PRNLEV.GE.2) WRITE(OUTU,577) IPAR1,IPAR2,IS1,IS2,IS3,IS4
+ 577 FORMAT(/' NMDIMB: Mixed double window diagonalization, parts ',
+ 1 2I5/
+ 2 ' NMDIMB: Block limits: ',I5,2X,I5,4X,I5,2X,I5)
+ IF(NDIM+NFCUT1.GT.PARDIM) CALL WRNDIE(-3,'<NMDIMB>',
+ 1 'Error in dimension of block')
+ NFRET=NFCUT1
+ IF(NFRET.GT.NFREG) NFRET=NFREG
+C
+C Prepare the DDV vectors consisting of 6 translations-rotations
+C + eigenvectors from 7 to NFCUT1 + cartesian displacements vectors
+C spanning the atoms from IS1 to IS2
+C
+ CALL CLETR(DDV,HEAP(TRAROT),NAT3,1,NFCUT1,NFCUT,DDEV,DDF)
+ NFCUT1=NFCUT
+ NFSAV=NFCUT1
+ CALL ADZERD(DDV,1,NFCUT1,NAT3,IS1,IS2,IS3,IS4)
+ OLDPRN=PRNLEV
+ PRNLEV=1
+ CALL ORTHNM(1,NFCUT1,NFCUT,DDV,NAT3,LPURG,TOLER)
+ PRNLEV=OLDPRN
+ CALL CPARAY(HEAP(DDVBAS),DDV,NAT3,1,NFCUT,1)
+C
+ NFRET=NDIM+NFCUT
+ QMIX=.TRUE.
+ CALL RBDG(X,Y,Z,NAT3,NDIM,NFRET,DDV,DDF,DDEV,
+ 1 DDSCR,HEAP(DD5),HEAP(DDSS),HEAP(DDV2),NADD,
+ 2 INBCMP,JNBCMP,HEAP(DDVBAS),DD1CMP,QMIX,IS1,IS2,IS3,IS4,
+ 3 CUTF1,NFCUT,NFREG,HEAP(IUPD),DD1BLL,HEAP(SCIFV1),
+ 4 HEAP(SCIFV2),HEAP(SCIFV3),HEAP(SCIFV4),HEAP(SCIFV6),
+ 5 HEAP(DRATQ),HEAP(ERATQ),HEAP(E2RATQ),
+ 6 HEAP(BDRATQ),HEAP(INRATQ),LSCI,LBIG,IUNMOD)
+ QMIX=.FALSE.
+C
+ IF(NFCUT.GT.NFRRES) NFCUT=NFRRES
+ NFCUT1=NFCUT
+ NFRET=NFCUT
+ GOTO I660
+C
+C-----------------------------------------------------------------------
+C TO SAVE-MODES
+ 700 CONTINUE
+ IF(PRNLEV.GE.2) WRITE(OUTU,583) IUNMOD
+ 583 FORMAT(/' NMDIMB: Saving the eigenvalues and eigenvectors to unit'
+ 1 ,I4)
+ REWIND (UNIT=IUNMOD)
+ ISTRT=1
+ ISTOP=NFSAV
+ LCARD=.FALSE.
+ IF(PRNLEV.GE.2) WRITE(OUTU,585) NFSAV,IUNMOD
+ 585 FORMAT(' NMDIMB: ',I5,' modes are saved in unit',I5)
+ CALL WRTNMD(LCARD,ISTRT,ISTOP,NAT3,DDV,DDSCR,DDEV,IUNMOD,
+ 1 AMASS)
+ CALL SAVEIT(IUNMOD)
+ GOTO I700
+C
+C-----------------------------------------------------------------------
+C TO ALLOCATE-SPACE-FOR-DIAGONALIZATION
+ 720 CONTINUE
+ DDV2=ALLHP(IREAL8((PARDIM+3)*(PARDIM+3)))
+ JSPACE=IREAL8((PARDIM+4))*8
+ JSP=IREAL8(((PARDIM+3)*(PARDIM+4))/2)
+ JSPACE=JSPACE+JSP
+ DDSS=ALLHP(JSPACE)
+ DD5=DDSS+JSPACE-JSP
+ GOTO I720
+C
+C-----------------------------------------------------------------------
+C TO ALLOCATE-SPACE-FOR-REDUCED-BASIS
+ 760 CONTINUE
+ IF(LBIG) THEN
+ DDVBAS=ALLHP(IREAL8(NAT3))
+ ELSE
+ DDVBAS=ALLHP(IREAL8(NFREG*NAT3))
+ ENDIF
+ GOTO I760
+C
+C-----------------------------------------------------------------------
+C TO ALLOCATE-SPACE-FOR-TRANSROT-VECTORS
+ 800 CONTINUE
+ TRAROT=ALLHP(IREAL8(6*NAT3))
+ GOTO I800
+C
+C-----------------------------------------------------------------------
+C TO ALLOCATE-SPACE-FOR-LSCI
+ 840 CONTINUE
+ SCIFV1=ALLHP(IREAL8(PARDIM+3))
+ SCIFV2=ALLHP(IREAL8(PARDIM+3))
+ SCIFV3=ALLHP(IREAL8(PARDIM+3))
+ SCIFV4=ALLHP(IREAL8(PARDIM+3))
+ SCIFV6=ALLHP(IREAL8(PARDIM+3))
+ DRATQ=ALLHP(IREAL8(PARDIM+3))
+ ERATQ=ALLHP(IREAL8(PARDIM+3))
+ E2RATQ=ALLHP(IREAL8(PARDIM+3))
+ BDRATQ=ALLHP(IREAL8(PARDIM+3))
+ INRATQ=ALLHP(INTEG4(PARDIM+3))
+ GOTO I840
+C
+C-----------------------------------------------------------------------
+C TO ALLOCATE-DUMMY-SPACE-FOR-LSCI
+ 880 CONTINUE
+ SCIFV1=ALLHP(IREAL8(2))
+ SCIFV2=ALLHP(IREAL8(2))
+ SCIFV3=ALLHP(IREAL8(2))
+ SCIFV4=ALLHP(IREAL8(2))
+ SCIFV6=ALLHP(IREAL8(2))
+ DRATQ=ALLHP(IREAL8(2))
+ ERATQ=ALLHP(IREAL8(2))
+ E2RATQ=ALLHP(IREAL8(2))
+ BDRATQ=ALLHP(IREAL8(2))
+ INRATQ=ALLHP(INTEG4(2))
+ GOTO I880
+C
+C-----------------------------------------------------------------------
+C TO ALLOCATE-SPACE-FOR-OTHER-ARRAYS
+ 920 CONTINUE
+ IUPD=ALLHP(INTEG4(PARDIM+3))
+ GOTO I920
+C.##ELSE
+C.##ENDIF
+ END
diff --git a/gcc/testsuite/g77.f-torture/compile/cpp2.F b/gcc/testsuite/g77.f-torture/compile/cpp2.F
new file mode 100644
index 00000000000..968d9f666ef
--- /dev/null
+++ b/gcc/testsuite/g77.f-torture/compile/cpp2.F
@@ -0,0 +1,7 @@
+C The preprocessor must not introduce a newline after
+C the "a" when ARGUMENTS is expanded.
+
+#define ARGUMENTS a\
+
+ subroutine yada (ARGUMENTS)
+ end
diff --git a/gcc/testsuite/g77.f-torture/execute/20010116.x b/gcc/testsuite/g77.f-torture/execute/20010116.x
deleted file mode 100644
index 93d817aae92..00000000000
--- a/gcc/testsuite/g77.f-torture/execute/20010116.x
+++ /dev/null
@@ -1,2 +0,0 @@
-set torture_execute_xfail "i?86-*-*"
-return 0
diff --git a/gcc/testsuite/gcc.c-torture/compile/20000804-1.x b/gcc/testsuite/gcc.c-torture/compile/20000804-1.x
new file mode 100644
index 00000000000..7538c513f70
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/20000804-1.x
@@ -0,0 +1,10 @@
+# This does not work on m68hc11 due to the use of an asm statement
+# to force a 'long long' (64-bits) to go in a register.
+
+global target_triplet
+if { [istarget "m6811-*-*"] || [istarget "m6812-*-*"] } {
+ set torture_compile_xfail "$target_triplet"
+ return 1
+}
+
+return 0
diff --git a/gcc/testsuite/gcc.c-torture/compile/20001205-1.x b/gcc/testsuite/gcc.c-torture/compile/20001205-1.x
new file mode 100644
index 00000000000..bde61fd93da
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/20001205-1.x
@@ -0,0 +1,8 @@
+# This does not work on m68hc11 due to the asm statement which
+# forces two 'long' (32-bits) variables to go in registers.
+
+global target_triplet
+if { [istarget "m6811-*-*"] || [istarget "m6812-*-*"] } {
+ set torture_compile_xfail "$target_triplet"
+}
+return 0
diff --git a/gcc/testsuite/gcc.c-torture/compile/20001226-1.x b/gcc/testsuite/gcc.c-torture/compile/20001226-1.x
new file mode 100644
index 00000000000..f1f000f8889
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/20001226-1.x
@@ -0,0 +1,13 @@
+# This does not assemble on m68hc11 because the function is larger
+# than 64K.
+
+# It doesn't work on Xtensa with -O0 because the function is larger
+# than the range of a jump instruction (+- 128K) and the assembler
+# does not yet relax jumps to indirect jumps.
+
+global target_triplet
+if { [istarget "m6811-*-*"] || [istarget "m6812-*-*"] || [istarget "xtensa-*-*"]} {
+ set torture_compile_xfail "$target_triplet"
+ return 1
+}
+return 0
diff --git a/gcc/testsuite/gcc.c-torture/compile/20010327-1.c b/gcc/testsuite/gcc.c-torture/compile/20010327-1.c
new file mode 100644
index 00000000000..fc31a6e68c2
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/20010327-1.c
@@ -0,0 +1,2 @@
+extern void _text;
+static unsigned long x = (unsigned long) &_text - 0x10000000L - 1;
diff --git a/gcc/testsuite/gcc.c-torture/compile/20010328-1.c b/gcc/testsuite/gcc.c-torture/compile/20010328-1.c
new file mode 100644
index 00000000000..d92c6dae113
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/20010328-1.c
@@ -0,0 +1,80 @@
+typedef unsigned int size_t;
+typedef unsigned int __u_int;
+typedef unsigned long __u_long;
+
+__extension__ typedef unsigned long long int __u_quad_t;
+__extension__ typedef long long int __quad_t;
+
+typedef struct
+ {
+ int __val[2];
+ } __fsid_t;
+
+typedef long int __blksize_t;
+typedef long int __blkcnt_t;
+typedef __quad_t __blkcnt64_t;
+typedef __u_long __fsblkcnt_t;
+typedef __u_quad_t __fsblkcnt64_t;
+typedef __u_long __fsfilcnt_t;
+typedef __u_quad_t __fsfilcnt64_t;
+typedef __u_quad_t __ino64_t;
+
+extern void *memcpy (void *__restrict __dest,
+ __const void *__restrict __src, size_t __n) ;
+
+struct statfs
+ {
+ int f_type;
+ int f_bsize;
+
+ __fsblkcnt_t f_blocks;
+ __fsblkcnt_t f_bfree;
+ __fsblkcnt_t f_bavail;
+ __fsfilcnt_t f_files;
+ __fsfilcnt_t f_ffree;
+
+ __fsid_t f_fsid;
+ int f_namelen;
+ int f_spare[6];
+ };
+
+
+struct statfs64
+ {
+ int f_type;
+ int f_bsize;
+ __fsblkcnt64_t f_blocks;
+ __fsblkcnt64_t f_bfree;
+ __fsblkcnt64_t f_bavail;
+ __fsfilcnt64_t f_files;
+ __fsfilcnt64_t f_ffree;
+ __fsid_t f_fsid;
+ int f_namelen;
+ int f_spare[6];
+ };
+
+extern int __statfs (__const char *__file, struct statfs *__buf);
+extern int __statfs64 (__const char *__file, struct statfs64 *__buf);
+
+
+int
+__statfs64 (const char *file, struct statfs64 *buf)
+{
+ struct statfs buf32;
+
+ if (__statfs (file, &buf32) < 0)
+ return -1;
+
+ buf->f_type = buf32.f_type;
+ buf->f_bsize = buf32.f_bsize;
+ buf->f_blocks = buf32.f_blocks;
+ buf->f_bfree = buf32.f_bfree;
+ buf->f_bavail = buf32.f_bavail;
+ buf->f_files = buf32.f_files;
+ buf->f_ffree = buf32.f_ffree;
+ buf->f_fsid = buf32.f_fsid;
+ buf->f_namelen = buf32.f_namelen;
+ memcpy (buf->f_spare, buf32.f_spare, sizeof (buf32.f_spare));
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.c-torture/compile/20010329-1.c b/gcc/testsuite/gcc.c-torture/compile/20010329-1.c
new file mode 100644
index 00000000000..4d495e1afc8
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/20010329-1.c
@@ -0,0 +1,17 @@
+union u {
+ unsigned char a;
+ double b;
+};
+
+int a;
+
+union u foo (void)
+{
+ union u b;
+
+ if (a)
+ b.a = 1;
+ else
+ b.a = 0;
+ return b;
+}
diff --git a/gcc/testsuite/gcc.c-torture/compile/20010404-1.c b/gcc/testsuite/gcc.c-torture/compile/20010404-1.c
new file mode 100644
index 00000000000..f890118e15d
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/20010404-1.c
@@ -0,0 +1,15 @@
+/* This testcase caused a floating point exception in the compiler when
+ compiled with -O2. The crash occurs when trying to simplify division
+ and modulo operations. */
+
+#include <limits.h>
+
+extern void bar (int);
+
+void foo ()
+{
+ int a = INT_MIN;
+ int b = -1;
+ bar (a / b);
+ bar (a % b);
+}
diff --git a/gcc/testsuite/gcc.c-torture/compile/20010408-1.c b/gcc/testsuite/gcc.c-torture/compile/20010408-1.c
new file mode 100644
index 00000000000..9aa3597a24a
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/20010408-1.c
@@ -0,0 +1,77 @@
+extern struct win *windows, *wtab[];
+struct win
+{
+ struct win *w_next;
+};
+
+struct auser;
+
+struct comm
+{
+ char *name;
+ int flags;
+};
+
+extern struct comm comms[];
+
+extern int WindowByNoN (char *);
+extern int FindCommnr (char *);
+extern int AclSetPermCmd (struct auser *, char *, struct comm *);
+extern int AclSetPermWin (struct auser *, struct auser *, char *, struct win *);
+
+
+int
+ AclSetPerm(uu, u, mode, s)
+ struct auser *uu, *u;
+char *mode, *s;
+{
+ struct win *w;
+ int i;
+ char *p, ch;
+
+ do
+ {
+ }
+ while (0);
+
+ while (*s)
+ {
+ switch (*s)
+ {
+ case '*':
+ return AclSetPerm(uu, u, mode, "#?");
+ case '#':
+ if (uu)
+ AclSetPermWin(uu, u, mode, (struct win *)1);
+ else
+ for (w = windows; w; w = w->w_next)
+ AclSetPermWin((struct auser *)0, u, mode, w);
+ s++;
+ break;
+ case '?':
+ if (uu)
+ AclSetPermWin(uu, u, mode, (struct win *)0);
+ else
+ for (i = 0; i <= 174; i++)
+ AclSetPermCmd(u, mode, &comms[i]);
+ s++;
+ break;
+ default:
+ for (p = s; *p && *p != ' ' && *p != '\t' && *p != ','; p++)
+ ;
+ if ((ch = *p))
+ *p++ = '\0';
+ if ((i = FindCommnr(s)) != -1)
+ AclSetPermCmd(u, mode, &comms[i]);
+ else if (((i = WindowByNoN(s)) >= 0) && wtab[i])
+ AclSetPermWin((struct auser *)0, u, mode, wtab[i]);
+ else
+ return -1;
+ if (ch)
+ p[-1] = ch;
+ s = p;
+ }
+ }
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.c-torture/compile/20010421-1.c b/gcc/testsuite/gcc.c-torture/compile/20010421-1.c
new file mode 100644
index 00000000000..bec6aa90304
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/20010421-1.c
@@ -0,0 +1,8 @@
+int j;
+
+void residual ()
+{
+ long double s;
+ for (j = 3; j < 9; j++)
+ s -= 3;
+}
diff --git a/gcc/testsuite/gcc.c-torture/compile/20010423-1.c b/gcc/testsuite/gcc.c-torture/compile/20010423-1.c
new file mode 100644
index 00000000000..ef7771f8e6b
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/20010423-1.c
@@ -0,0 +1,16 @@
+/* Origin: PR c/2618 from Cesar Eduardo Barros <cesarb@nitnet.com.br>,
+ adapted to a testcase by Joseph Myers <jsm28@cam.ac.uk>.
+
+ Boolean conversions were causing infinite recursion between convert
+ and fold in certain cases. */
+
+#include <stdbool.h>
+
+bool x;
+unsigned char y;
+
+void
+fn (void)
+{
+ x = y & 0x1 ? 1 : 0;
+}
diff --git a/gcc/testsuite/gcc.c-torture/compile/20010503-1.c b/gcc/testsuite/gcc.c-torture/compile/20010503-1.c
new file mode 100644
index 00000000000..75005f456c3
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/20010503-1.c
@@ -0,0 +1,17 @@
+void f1 (double);
+void f2 (int);
+
+void
+foo (int type, double xx)
+{
+ if (type)
+ f1 (xx);
+ else
+ f2 (type);
+}
+
+void
+bar (int type)
+{
+ foo (type, 1.0);
+}
diff --git a/gcc/testsuite/gcc.c-torture/compile/20010525-1.c b/gcc/testsuite/gcc.c-torture/compile/20010525-1.c
new file mode 100644
index 00000000000..2e4ae382ab9
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/20010525-1.c
@@ -0,0 +1,6 @@
+static int kind_varread(char *str)
+{
+ if (0 == memcmp("%_#", str, 3)) return 2;
+ /* NOTREACHED */
+}
+
diff --git a/gcc/testsuite/gcc.c-torture/compile/20010605-1.c b/gcc/testsuite/gcc.c-torture/compile/20010605-1.c
new file mode 100644
index 00000000000..036b796982e
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/20010605-1.c
@@ -0,0 +1,15 @@
+int
+main (int argc, char **argv)
+{
+ int size = 10;
+
+ typedef struct {
+ char val[size];
+ } block;
+ block retframe_block()
+ {
+ return *(block*)0;
+ }
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.c-torture/compile/20010610-1.c b/gcc/testsuite/gcc.c-torture/compile/20010610-1.c
new file mode 100644
index 00000000000..ee8e2431bbb
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/20010610-1.c
@@ -0,0 +1,19 @@
+/* Origin: Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ Boolean types were not accepted as array sizes nor as switch
+ quantities. */
+
+#include <stdbool.h>
+
+int
+main(void)
+{
+ bool arr[(bool)1];
+
+ switch (arr[0])
+ {
+ default:;
+ }
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.c-torture/compile/20010611-1.c b/gcc/testsuite/gcc.c-torture/compile/20010611-1.c
new file mode 100644
index 00000000000..87723bd497a
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/20010611-1.c
@@ -0,0 +1,24 @@
+/* Origin: PR c/3116 from Andreas Jaeger <aj@suse.de>. */
+/* When determining type compatibility of function types, we must remove
+ qualifiers from argument types. We used to fail to do this properly
+ in store_parm_decls when comparing prototype and non-prototype
+ declarations. */
+struct _IO_FILE {
+ int _flags;
+};
+
+typedef struct _IO_FILE __FILE;
+typedef struct _IO_FILE _IO_FILE;
+typedef long int wchar_t;
+
+extern wchar_t *fgetws (wchar_t *__restrict __ws, int __n,
+ __FILE *__restrict __stream);
+
+wchar_t *
+fgetws (buf, n, fp)
+ wchar_t *buf;
+ int n;
+ _IO_FILE *fp;
+{
+ return (wchar_t *)0;
+}
diff --git a/gcc/testsuite/gcc.c-torture/compile/20010903-1.c b/gcc/testsuite/gcc.c-torture/compile/20010903-1.c
new file mode 100644
index 00000000000..8e519f26e41
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/20010903-1.c
@@ -0,0 +1,28 @@
+struct A {
+ long a;
+};
+
+static inline void foo(struct A *x)
+{
+ __asm__ __volatile__("" : "+m"(x->a) : "r"(x) : "memory", "cc");
+}
+
+static inline void bar(struct A *x)
+{
+ foo(x);
+}
+
+struct B { char buf[640]; struct A a; };
+struct B b[32];
+
+int baz(void)
+{
+ int i;
+ struct B *j;
+ for (i = 1; i < 32; i++)
+ {
+ j = &b[i];
+ bar(&j->a);
+ }
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.c-torture/compile/20011010-1.c b/gcc/testsuite/gcc.c-torture/compile/20011010-1.c
new file mode 100644
index 00000000000..b0137554379
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/20011010-1.c
@@ -0,0 +1,10 @@
+extern int used (void);
+
+
+int foo ()
+{
+ int i;
+ for (; used (); ({while (1) if (used ()) return 0;}))
+ i++;
+ return i;
+}
diff --git a/gcc/testsuite/gcc.c-torture/compile/20011029-1.c b/gcc/testsuite/gcc.c-torture/compile/20011029-1.c
new file mode 100644
index 00000000000..3b2bcdf2e9d
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/20011029-1.c
@@ -0,0 +1,9 @@
+void foo (void *) __attribute__ ((noreturn));
+
+void
+bar (void *x)
+{
+ if (__builtin_setjmp (x))
+ return;
+ foo (x);
+}
diff --git a/gcc/testsuite/gcc.c-torture/compile/20011109-1.c b/gcc/testsuite/gcc.c-torture/compile/20011109-1.c
new file mode 100644
index 00000000000..f1987a74bf2
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/20011109-1.c
@@ -0,0 +1,51 @@
+typedef struct { short x[4]; } S;
+typedef struct { unsigned int a, b, c; S *d; } T;
+
+S *(*foo) (T *, int, int, int, int);
+unsigned short *(*bar)(const T *);
+unsigned short baz(T *,const int);
+
+T *die (void)
+{
+ typedef struct { unsigned int a, b, e; double f, g; } U;
+
+ char h[8], i[2053], j[2053];
+ double k, l, m;
+ U n;
+ T *o;
+ unsigned short p;
+ int q, r;
+ long s;
+ unsigned short *t;
+ S *u;
+ unsigned char *v, *w;
+ unsigned int x;
+
+ o = 0;
+ for (x = 0; x < n.e; x++)
+ {
+ l = 1.0;
+ if (n.g - n.f <= 1.0)
+ l = ((1 << o->c) - 1) / (n.g - n.f);
+ v = w;
+ for (r = o->b - 1; r >= 0; r--)
+ {
+ u = foo (o, 0, r, o->a, 1);
+ if (!u)
+ break;
+ t = bar (o);
+ for (q = 0; q < (int) o->a; q++)
+ {
+ h[0] = *v;
+ s = *v++;
+ k = (double) s;
+ m = l*k;
+ p = m < 0 ? 0 : m > (1 << o->c) - 1 ? (1 << o->c) - 1 : m + 0.5;
+ p = baz (o,p);
+ t[q] = p;
+ *u++ = o->d[p];
+ }
+ }
+ }
+ return o;
+}
diff --git a/gcc/testsuite/gcc.c-torture/compile/20011205-1.c b/gcc/testsuite/gcc.c-torture/compile/20011205-1.c
new file mode 100644
index 00000000000..ffc5ac419ea
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/20011205-1.c
@@ -0,0 +1,10 @@
+/* Failure to mark_addressable all operands before evaluation means we
+ don't set up the proper temporaries, which leaves us with an asm that
+ doesn't match its contraints. */
+
+long foo()
+{
+ long x;
+ asm("" : "=r"(x) : "m"(x));
+ return x;
+}
diff --git a/gcc/testsuite/gcc.c-torture/compile/920520-1.x b/gcc/testsuite/gcc.c-torture/compile/920520-1.x
index 4cfce33b2dc..d571cb0cb25 100644
--- a/gcc/testsuite/gcc.c-torture/compile/920520-1.x
+++ b/gcc/testsuite/gcc.c-torture/compile/920520-1.x
@@ -1,2 +1,11 @@
+# This does not work on m68hc11 due to the asm which forces a
+# float or a double to go in a register.
+
+global target_triplet
+if { [istarget "m6811-*-*"] || [istarget "m6812-*-*"] } {
+ set torture_compile_xfail "$target_triplet"
+ return 1
+}
+
set options "-S"
return 0
diff --git a/gcc/testsuite/gcc.c-torture/compile/920723-1.c b/gcc/testsuite/gcc.c-torture/compile/920723-1.c
index af0cf76f42c..d8734a6796e 100644
--- a/gcc/testsuite/gcc.c-torture/compile/920723-1.c
+++ b/gcc/testsuite/gcc.c-torture/compile/920723-1.c
@@ -1,3 +1,11 @@
+#if defined(STACK_SIZE) && STACK_SIZE < 65536
+# define GITT_SIZE 75
+#endif
+
+#ifndef GITT_SIZE
+# define GITT_SIZE 150
+#endif
+
typedef struct {
double x, y;
} vector_t;
@@ -6,7 +14,7 @@ f(int count,vector_t*pos,double r,double *rho)
{
int i, j, miny, maxy, hy;
float help, d;
- int gitt[150][150];
+ int gitt[GITT_SIZE][GITT_SIZE];
int *data = (int *)malloc(count*sizeof(int));
for (i = 0; i < count; i++)
rho[i] = 0;
diff --git a/gcc/testsuite/gcc.c-torture/compile/920729-1.c b/gcc/testsuite/gcc.c-torture/compile/920729-1.c
index 96676e95307..de00be5af88 100644
--- a/gcc/testsuite/gcc.c-torture/compile/920729-1.c
+++ b/gcc/testsuite/gcc.c-torture/compile/920729-1.c
@@ -1,2 +1,2 @@
-extern int i;extern volatile int i;
+extern volatile int i;
f(){int j;for(;;)j = i;}
diff --git a/gcc/testsuite/gcc.c-torture/compile/930621-1.c b/gcc/testsuite/gcc.c-torture/compile/930621-1.c
index 3679cf1d3de..4199bbe0870 100644
--- a/gcc/testsuite/gcc.c-torture/compile/930621-1.c
+++ b/gcc/testsuite/gcc.c-torture/compile/930621-1.c
@@ -1,6 +1,14 @@
+#if defined(STACK_SIZE) && (STACK_SIZE < 65536)
+# define BYTEMEM_SIZE 10000L
+#endif
+
+#ifndef BYTEMEM_SIZE
+# define BYTEMEM_SIZE 45000L
+#endif
+
int bytestart[5000 + 1];
unsigned char modtext[400 + 1];
-unsigned char bytemem[2][45000L + 1];
+unsigned char bytemem[2][BYTEMEM_SIZE + 1];
long
modlookup (int l)
diff --git a/gcc/testsuite/gcc.c-torture/compile/961203-1.x b/gcc/testsuite/gcc.c-torture/compile/961203-1.x
new file mode 100644
index 00000000000..ce8820d934c
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/961203-1.x
@@ -0,0 +1,7 @@
+# Array 'a' in this test is too large to fit in 64K.
+
+global target_triplet
+if { [istarget "m6811-*-*"] || [istarget "m6812-*-*"]} {
+ set torture_compile_xfail "$target_triplet"
+}
+return 0
diff --git a/gcc/testsuite/gcc.c-torture/compile/981006-1.x b/gcc/testsuite/gcc.c-torture/compile/981006-1.x
index 6f8a1a6346c..80d53daac29 100644
--- a/gcc/testsuite/gcc.c-torture/compile/981006-1.x
+++ b/gcc/testsuite/gcc.c-torture/compile/981006-1.x
@@ -6,6 +6,7 @@ if { [istarget rs6000-*-aix*]
|| [istarget fr30-*-*]
|| [istarget sh-*-hms]
|| [istarget sh-*-coff]
+ || [istarget h8300*-*-*]
} {
set options "-Wuninitialized -Werror"
} else {
diff --git a/gcc/testsuite/gcc.c-torture/compile/991214-2.c b/gcc/testsuite/gcc.c-torture/compile/991214-2.c
index 2f7b6bc7d4f..3e18d215e13 100644
--- a/gcc/testsuite/gcc.c-torture/compile/991214-2.c
+++ b/gcc/testsuite/gcc.c-torture/compile/991214-2.c
@@ -1,3 +1,9 @@
+#if defined(STACK_SIZE) && (STACK_SIZE < 65536)
+# define HISTO_SIZE 9
+#else
+# define HISTO_SIZE 36
+#endif
+
extern int N;
extern int nrows;
extern int or_num_angles;
@@ -8,7 +14,7 @@ typedef struct
int count;
}Histo;
-Histo add_histo[10][2][36][36];
+Histo add_histo[10][2][HISTO_SIZE][HISTO_SIZE];
void cmd_connection_statistics( )
{
diff --git a/gcc/testsuite/gcc.c-torture/execute/20001227-1.c b/gcc/testsuite/gcc.c-torture/execute/20001227-1.c
deleted file mode 100644
index a5cb3eece03..00000000000
--- a/gcc/testsuite/gcc.c-torture/execute/20001227-1.c
+++ /dev/null
@@ -1,32 +0,0 @@
-typedef struct {
- char y;
- char x[32];
-} X;
-
-int z (void)
-{
- X xxx;
- xxx.x[0] =
- xxx.x[31] = '0';
- xxx.y = 0xf;
- return f (xxx, xxx);
-}
-
-int main (void)
-{
- int val;
-
- val = z ();
- if (val != 0x60)
- abort ();
- exit (0);
-}
-
-int f(X x, X y)
-{
- if (x.y != y.y)
- return 'F';
-
- return x.x[0] + y.x[0];
-}
-
diff --git a/gcc/testsuite/gcc.c-torture/execute/20001229-1.c b/gcc/testsuite/gcc.c-torture/execute/20001229-1.c
index fecf1978e84..39b58af62e7 100644
--- a/gcc/testsuite/gcc.c-torture/execute/20001229-1.c
+++ b/gcc/testsuite/gcc.c-torture/execute/20001229-1.c
@@ -21,6 +21,7 @@ setsysinfo(unsigned long op, void *buffer, unsigned long size,
#else
#include <sys/sysinfo.h>
+#include <sys/proc.h>
#endif
static void __attribute__((constructor))
diff --git a/gcc/testsuite/gcc.c-torture/execute/20010122-1.c b/gcc/testsuite/gcc.c-torture/execute/20010122-1.c
index c88144b6022..3bc53f604fd 100644
--- a/gcc/testsuite/gcc.c-torture/execute/20010122-1.c
+++ b/gcc/testsuite/gcc.c-torture/execute/20010122-1.c
@@ -1,7 +1,7 @@
extern void exit (int);
extern void abort (void);
-extern void *alloca (int);
+extern void *alloca (__SIZE_TYPE__);
char *dummy (void);
void *save_ret1[6];
diff --git a/gcc/testsuite/gcc.c-torture/execute/20010122-1.x b/gcc/testsuite/gcc.c-torture/execute/20010122-1.x
new file mode 100644
index 00000000000..cb113766530
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/20010122-1.x
@@ -0,0 +1,2 @@
+set torture_execute_xfail "mips-*-*"
+return 0
diff --git a/gcc/testsuite/gcc.c-torture/execute/20010123-1.x b/gcc/testsuite/gcc.c-torture/execute/20010123-1.x
new file mode 100644
index 00000000000..2f397b96e51
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/20010123-1.x
@@ -0,0 +1,2 @@
+set torture_execute_xfail "*-*-*"
+return 0
diff --git a/gcc/testsuite/gcc.c-torture/execute/20010222-1.c b/gcc/testsuite/gcc.c-torture/execute/20010222-1.c
new file mode 100644
index 00000000000..c3a2b18e5f0
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/20010222-1.c
@@ -0,0 +1,9 @@
+int a[2] = { 18, 6 };
+
+int main ()
+{
+ int b = (-3 * a[0] -3 * a[1]) / 12;
+ if (b != -6)
+ abort ();
+ exit (0);
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/20010224-1.c b/gcc/testsuite/gcc.c-torture/execute/20010224-1.c
new file mode 100644
index 00000000000..1d04fd17395
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/20010224-1.c
@@ -0,0 +1,44 @@
+extern void abort (void);
+
+typedef signed short int16_t;
+typedef unsigned short uint16_t;
+
+int16_t logadd (int16_t *a, int16_t *b);
+void ba_compute_psd (int16_t start);
+
+int16_t masktab[6] = { 1, 2, 3, 4, 5};
+int16_t psd[6] = { 50, 40, 30, 20, 10};
+int16_t bndpsd[6] = { 1, 2, 3, 4, 5};
+
+void ba_compute_psd (int16_t start)
+{
+ int i,j,k;
+ int16_t lastbin = 4;
+
+ j = start;
+ k = masktab[start];
+
+ bndpsd[k] = psd[j];
+ j++;
+
+ for (i = j; i < lastbin; i++) {
+ bndpsd[k] = logadd(&bndpsd[k], &psd[j]);
+ j++;
+ }
+}
+
+int16_t logadd (int16_t *a, int16_t *b)
+{
+ return *a + *b;
+}
+
+int main (void)
+{
+ int i;
+
+ ba_compute_psd (0);
+
+ if (bndpsd[1] != 140) abort ();
+ return 0;
+}
+
diff --git a/gcc/testsuite/gcc.c-torture/execute/20010325-1.c b/gcc/testsuite/gcc.c-torture/execute/20010325-1.c
new file mode 100644
index 00000000000..100679fa184
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/20010325-1.c
@@ -0,0 +1,15 @@
+/* Origin: Joseph Myers <jsm28@cam.ac.uk>.
+
+ This tests for inconsistency in whether wide STRING_CSTs use the host
+ or the target endianness. */
+
+extern void exit (int);
+extern void abort (void);
+
+int
+main (void)
+{
+ if (L"a" "b"[1] != L'b')
+ abort ();
+ exit (0);
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/20010329-1.c b/gcc/testsuite/gcc.c-torture/execute/20010329-1.c
new file mode 100644
index 00000000000..e28d6d7c72e
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/20010329-1.c
@@ -0,0 +1,14 @@
+#include <limits.h>
+
+int main (void)
+{
+ void *x = ((void *)((unsigned int)INT_MAX + 2));
+ void *y = ((void *)((unsigned long)LONG_MAX + 2));
+ if (x >= ((void *)((unsigned int)INT_MAX + 1))
+ && x <= ((void *)((unsigned int)INT_MAX + 6))
+ && y >= ((void *)((unsigned long)LONG_MAX + 1))
+ && y <= ((void *)((unsigned long)LONG_MAX + 6)))
+ exit (0);
+ else
+ abort ();
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/20010403-1.c b/gcc/testsuite/gcc.c-torture/execute/20010403-1.c
new file mode 100644
index 00000000000..6a8f2a4242c
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/20010403-1.c
@@ -0,0 +1,36 @@
+void b (int *);
+void c (int, int);
+void d (int);
+
+int e;
+
+void a (int x, int y)
+{
+ int f = x ? e : 0;
+ int z = y;
+
+ b (&y);
+ c (z, y);
+ d (f);
+}
+
+void b (int *y)
+{
+ (*y)++;
+}
+
+void c (int x, int y)
+{
+ if (x == y)
+ abort ();
+}
+
+void d (int x)
+{
+}
+
+int main (void)
+{
+ a (0, 0);
+ exit (0);
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/20010422-1.c b/gcc/testsuite/gcc.c-torture/execute/20010422-1.c
new file mode 100644
index 00000000000..5c6bccc9ed1
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/20010422-1.c
@@ -0,0 +1,15 @@
+unsigned int foo(unsigned int x)
+{
+ if (x < 5)
+ x = 4;
+ else
+ x = 8;
+ return x;
+}
+
+int main(void)
+{
+ if (foo (8) != 8)
+ abort ();
+ exit (0);
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/20010604-1.c b/gcc/testsuite/gcc.c-torture/execute/20010604-1.c
new file mode 100644
index 00000000000..e0deaf524f0
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/20010604-1.c
@@ -0,0 +1,14 @@
+#include <stdbool.h>
+
+int f (int a, int b, int c, _Bool d, _Bool e, _Bool f, char g)
+{
+ if (g != 1 || d != true || e != true || f != true) abort ();
+ return a + b + c;
+}
+
+int main (void)
+{
+ if (f (1, 2, -3, true, true, true, '\001'))
+ abort ();
+ exit (0);
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/20010605-1.c b/gcc/testsuite/gcc.c-torture/execute/20010605-1.c
new file mode 100644
index 00000000000..4bf230ba54a
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/20010605-1.c
@@ -0,0 +1,11 @@
+int main ()
+{
+ int v = 42;
+
+ static inline int fff (int x)
+ {
+ return x*10;
+ }
+
+ return (fff (v) != 420);
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/20010605-2.c b/gcc/testsuite/gcc.c-torture/execute/20010605-2.c
new file mode 100644
index 00000000000..09c7f76ac82
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/20010605-2.c
@@ -0,0 +1,36 @@
+void foo (), bar (), baz ();
+int main ()
+{
+ __complex__ double x;
+ __complex__ float y;
+ __complex__ long double z;
+ __real__ x = 1.0;
+ __imag__ x = 2.0;
+ foo (x);
+ __real__ y = 3.0f;
+ __imag__ y = 4.0f;
+ bar (y);
+ __real__ z = 5.0L;
+ __imag__ z = 6.0L;
+ baz (z);
+ exit (0);
+}
+
+void foo (__complex__ double x)
+{
+ if (__real__ x != 1.0 || __imag__ x != 2.0)
+ abort ();
+}
+
+void bar (__complex__ float x)
+{
+ if (__real__ x != 3.0f || __imag__ x != 4.0f)
+ abort ();
+}
+
+void baz (__complex__ long double x)
+{
+ if (__real__ x != 5.0L || __imag__ x != 6.0L)
+ abort ();
+}
+
diff --git a/gcc/testsuite/gcc.c-torture/execute/20010724-1.c b/gcc/testsuite/gcc.c-torture/execute/20010724-1.c
new file mode 100644
index 00000000000..8ff7d0f44a0
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/20010724-1.c
@@ -0,0 +1,59 @@
+/* Verify that the workarounds in config/mips/irix6-libc-compat.c are still
+ needed. */
+
+/* IRIX 6, unlike other Unix systems, defines union semun in <sys/sem.h>.
+ Inhibit this definition to be able to run this test on other platforms. */
+#define _XOPEN_SOURCE
+
+#include <sys/types.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <sys/ipc.h>
+#include <sys/sem.h>
+
+union semun {
+ int val;
+ struct semid_ds *buf;
+ ushort_t *array;
+};
+
+int
+main (void)
+{
+ struct in_addr ia;
+ int semid;
+ union semun su;
+
+ ia.s_addr = INADDR_BROADCAST;
+
+ if (strcmp (inet_ntoa (ia), "255.255.255.255") != 0)
+ abort ();
+
+ ia.s_addr = INADDR_LOOPBACK;
+
+ if (inet_lnaof (ia) != 1)
+ abort ();
+
+ if (inet_netof (ia) != IN_LOOPBACKNET)
+ abort ();
+
+ ia = inet_makeaddr (IN_LOOPBACKNET, 1);
+ if (ia.s_addr != INADDR_LOOPBACK)
+ abort ();
+
+ if ((semid = semget (IPC_PRIVATE, 1, IPC_CREAT | IPC_EXCL | SEM_R | SEM_A)) < 0)
+ abort ();
+
+ su.val = 10;
+
+ if (semctl (semid, 0, SETVAL, su) != 0)
+ abort ();
+
+ if (semctl (semid, 0, GETVAL) != 10)
+ abort ();
+
+ if (semctl (semid, 0, IPC_RMID) != 0)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/20010724-1.x b/gcc/testsuite/gcc.c-torture/execute/20010724-1.x
new file mode 100644
index 00000000000..2f2f05634c4
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/20010724-1.x
@@ -0,0 +1,3 @@
+# This test is only needed on IRIX 6
+if { ! [istarget "mips*-sgi-irix6*"] } { return 1 }
+return 0
diff --git a/gcc/testsuite/gcc.c-torture/execute/20010904-1.c b/gcc/testsuite/gcc.c-torture/execute/20010904-1.c
new file mode 100644
index 00000000000..92b258b5202
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/20010904-1.c
@@ -0,0 +1,11 @@
+typedef struct x { int a; int b; } __attribute__((aligned(32))) X;
+typedef struct y { X x[32]; int c; } Y;
+
+Y y[2];
+
+int main(void)
+{
+ if (((char *)&y[1] - (char *)&y[0]) & 31)
+ abort ();
+ exit (0);
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/20010904-2.c b/gcc/testsuite/gcc.c-torture/execute/20010904-2.c
new file mode 100644
index 00000000000..cbe49806c60
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/20010904-2.c
@@ -0,0 +1,11 @@
+typedef struct x { int a; int b; } __attribute__((aligned(32))) X;
+typedef struct y { X x; X y[31]; int c; } Y;
+
+Y y[2];
+
+int main(void)
+{
+ if (((char *)&y[1] - (char *)&y[0]) & 31)
+ abort ();
+ exit (0);
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/20010910-1.c b/gcc/testsuite/gcc.c-torture/execute/20010910-1.c
new file mode 100644
index 00000000000..185e29d2b28
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/20010910-1.c
@@ -0,0 +1,59 @@
+/* Test case contributed by Ingo Rohloff <rohloff@in.tum.de>.
+ Code distilled from Linux kernel. */
+
+/* Compile this program with a gcc-2.95.2 using
+ "gcc -O2" and run it. The result will be that
+ rx_ring[1].next == 0 (it should be == 14)
+ and
+ ep.skbuff[4] == 5 (it should be 0)
+*/
+
+extern void abort(void);
+
+struct epic_rx_desc
+{
+ unsigned int next;
+};
+
+struct epic_private
+{
+ struct epic_rx_desc *rx_ring;
+ unsigned int rx_skbuff[5];
+};
+
+static void epic_init_ring(struct epic_private *ep)
+{
+ int i;
+
+ for (i = 0; i < 5; i++)
+ {
+ ep->rx_ring[i].next = 10 + (i+1)*2;
+ ep->rx_skbuff[i] = 0;
+ }
+ ep->rx_ring[i-1].next = 10;
+}
+
+static int check_rx_ring[5] = { 12,14,16,18,10 };
+
+int main(void)
+{
+ struct epic_private ep;
+ struct epic_rx_desc rx_ring[5];
+ int i;
+
+ for (i=0;i<5;i++)
+ {
+ rx_ring[i].next=0;
+ ep.rx_skbuff[i]=5;
+ }
+
+ ep.rx_ring=rx_ring;
+ epic_init_ring(&ep);
+
+ for (i=0;i<5;i++)
+ {
+ if ( rx_ring[i].next != check_rx_ring[i] ) abort();
+ if ( ep.rx_skbuff[i] != 0 ) abort();
+ }
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/20011008-3.c b/gcc/testsuite/gcc.c-torture/execute/20011008-3.c
new file mode 100644
index 00000000000..5a24ac92ecf
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/20011008-3.c
@@ -0,0 +1,99 @@
+extern void exit (int);
+extern void abort (void);
+
+typedef unsigned int u_int32_t;
+typedef unsigned char u_int8_t;
+typedef int int32_t;
+
+typedef enum {
+ TXNLIST_DELETE,
+ TXNLIST_LSN,
+ TXNLIST_TXNID,
+ TXNLIST_PGNO
+} db_txnlist_type;
+
+struct __db_lsn; typedef struct __db_lsn DB_LSN;
+struct __db_lsn {
+ u_int32_t file;
+ u_int32_t offset;
+};
+struct __db_txnlist; typedef struct __db_txnlist DB_TXNLIST;
+
+struct __db_txnlist {
+ db_txnlist_type type;
+ struct { struct __db_txnlist *le_next; struct __db_txnlist **le_prev; } links;
+ union {
+ struct {
+ u_int32_t txnid;
+ int32_t generation;
+ int32_t aborted;
+ } t;
+ struct {
+
+
+ u_int32_t flags;
+ int32_t fileid;
+ u_int32_t count;
+ char *fname;
+ } d;
+ struct {
+ int32_t ntxns;
+ int32_t maxn;
+ DB_LSN *lsn_array;
+ } l;
+ struct {
+ int32_t nentries;
+ int32_t maxentry;
+ char *fname;
+ int32_t fileid;
+ void *pgno_array;
+ u_int8_t uid[20];
+ } p;
+ } u;
+};
+
+int log_compare (const DB_LSN *a, const DB_LSN *b)
+{
+ return 1;
+}
+
+
+int
+__db_txnlist_lsnadd(int val, DB_TXNLIST *elp, DB_LSN *lsnp, u_int32_t flags)
+{
+ int i;
+
+ for (i = 0; i < (!(flags & (0x1)) ? 1 : elp->u.l.ntxns); i++)
+ {
+ int __j;
+ DB_LSN __tmp;
+ val++;
+ for (__j = 0; __j < elp->u.l.ntxns - 1; __j++)
+ if (log_compare(&elp->u.l.lsn_array[__j], &elp->u.l.lsn_array[__j + 1]) < 0)
+ {
+ __tmp = elp->u.l.lsn_array[__j];
+ elp->u.l.lsn_array[__j] = elp->u.l.lsn_array[__j + 1];
+ elp->u.l.lsn_array[__j + 1] = __tmp;
+ }
+ }
+
+ *lsnp = elp->u.l.lsn_array[0];
+ return val;
+}
+
+int main (void)
+{
+ DB_TXNLIST el;
+ DB_LSN lsn, lsn_a[1235];
+
+ el.u.l.ntxns = 1234;
+ el.u.l.lsn_array = lsn_a;
+
+ if (__db_txnlist_lsnadd (0, &el, &lsn, 0) != 1)
+ abort ();
+
+ if (__db_txnlist_lsnadd (0, &el, &lsn, 1) != 1234)
+ abort ();
+
+ exit (0);
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/920501-8.x b/gcc/testsuite/gcc.c-torture/execute/920501-8.x
new file mode 100644
index 00000000000..f675fb66d13
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/920501-8.x
@@ -0,0 +1,5 @@
+# sprintf() does not support %f on m6811/m6812 target.
+if { [istarget "m6811-*-*"] || [istarget "m6812-*-*"]} {
+ return 1
+}
+return 0
diff --git a/gcc/testsuite/gcc.c-torture/execute/920730-1t.c b/gcc/testsuite/gcc.c-torture/execute/920730-1t.c
index bc5e4131983..7467f35753c 100644
--- a/gcc/testsuite/gcc.c-torture/execute/920730-1t.c
+++ b/gcc/testsuite/gcc.c-torture/execute/920730-1t.c
@@ -1,3 +1,8 @@
/* This is just 920730-1.c compiled with -traditional.
See 920730-1t.x. */
+
+/* It is necessary to undefine __GNUC__ in order to prevent glibc 2.2's
+ sys/cdefs.h from issuing an #error. Do Not Ask. */
+#undef __GNUC__
+
#include "920730-1.c"
diff --git a/gcc/testsuite/gcc.c-torture/execute/930513-1.x b/gcc/testsuite/gcc.c-torture/execute/930513-1.x
new file mode 100644
index 00000000000..f675fb66d13
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/930513-1.x
@@ -0,0 +1,5 @@
+# sprintf() does not support %f on m6811/m6812 target.
+if { [istarget "m6811-*-*"] || [istarget "m6812-*-*"]} {
+ return 1
+}
+return 0
diff --git a/gcc/testsuite/gcc.c-torture/execute/931018-1.c b/gcc/testsuite/gcc.c-torture/execute/931018-1.c
index d3814e699b8..01b6050bf35 100644
--- a/gcc/testsuite/gcc.c-torture/execute/931018-1.c
+++ b/gcc/testsuite/gcc.c-torture/execute/931018-1.c
@@ -1,5 +1,5 @@
unsigned int a[0x1000];
-extern unsigned long v;
+extern const unsigned long v;
main ()
{
diff --git a/gcc/testsuite/gcc.c-torture/execute/980709-1.x b/gcc/testsuite/gcc.c-torture/execute/980709-1.x
new file mode 100644
index 00000000000..a5eefd57a21
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/980709-1.x
@@ -0,0 +1,5 @@
+# pow() is not available on m6811/m6812 target, this test will not link.
+if { [istarget "m6811-*-*"] || [istarget "m6812-*-*"]} {
+ return 1
+}
+return 0
diff --git a/gcc/testsuite/gcc.c-torture/execute/990208-1.x b/gcc/testsuite/gcc.c-torture/execute/990208-1.x
new file mode 100644
index 00000000000..95b82b5d45e
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/990208-1.x
@@ -0,0 +1,14 @@
+# Doesn't work at -O3 because of ifcvt.c optimizations which
+# cause the 2 inlined labels to be at the same location.
+
+set torture_eval_before_execute {
+
+ set compiler_conditional_xfail_data {
+ "ifcvt transforms 2 inlined labels to the same address" \
+ "ia64-*-*" \
+ { "-O3" } \
+ { "" }
+ }
+}
+
+return 0
diff --git a/gcc/testsuite/gcc.c-torture/execute/990826-0.x b/gcc/testsuite/gcc.c-torture/execute/990826-0.x
new file mode 100644
index 00000000000..84a8c2a1dcb
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/990826-0.x
@@ -0,0 +1,5 @@
+# floor() is not available on m6811/m6812 target, this test will not link.
+if { [istarget "m6811-*-*"] || [istarget "m6812-*-*"]} {
+ return 1
+}
+return 0
diff --git a/gcc/testsuite/gcc.c-torture/execute/20010114-2.c b/gcc/testsuite/gcc.c-torture/execute/ieee/20010114-2.c
index e5ab9485ffe..e5ab9485ffe 100644
--- a/gcc/testsuite/gcc.c-torture/execute/20010114-2.c
+++ b/gcc/testsuite/gcc.c-torture/execute/ieee/20010114-2.c
diff --git a/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-1.c b/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-1.c
index 4794efcb53b..929639c31e2 100644
--- a/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-1.c
+++ b/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-1.c
@@ -1,6 +1,6 @@
#include <signal.h>
-double nan = 1.0/0.0 - 1.0/0.0;
+double dnan = 1.0/0.0 - 1.0/0.0;
double x = 1.0;
void leave ()
@@ -19,22 +19,22 @@ main ()
signal (SIGFPE, leave);
#endif
/* NaN is an IEEE unordered operand. All these test should be false. */
- if (nan == nan)
+ if (dnan == dnan)
abort ();
- if (nan != x)
+ if (dnan != x)
x = 1.0;
else
abort ();
- if (nan < x)
+ if (dnan < x)
abort ();
- if (nan > x)
+ if (dnan > x)
abort ();
- if (nan <= x)
+ if (dnan <= x)
abort ();
- if (nan >= x)
+ if (dnan >= x)
abort ();
- if (nan == x)
+ if (dnan == x)
abort ();
#endif
exit (0);
diff --git a/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-2.c b/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-2.c
index 2a86d0f5eb9..5d6538b9d74 100644
--- a/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-2.c
+++ b/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-2.c
@@ -1,6 +1,6 @@
#include <signal.h>
-float nan = 1.0f/0.0f - 1.0f/0.0f;
+float fnan = 1.0f/0.0f - 1.0f/0.0f;
float x = 1.0f;
void leave ()
@@ -19,22 +19,22 @@ main ()
signal (SIGFPE, leave);
#endif
/* NaN is an IEEE unordered operand. All these test should be false. */
- if (nan == nan)
+ if (fnan == fnan)
abort ();
- if (nan != x)
+ if (fnan != x)
x = 1.0;
else
abort ();
- if (nan < x)
+ if (fnan < x)
abort ();
- if (nan > x)
+ if (fnan > x)
abort ();
- if (nan <= x)
+ if (fnan <= x)
abort ();
- if (nan >= x)
+ if (fnan >= x)
abort ();
- if (nan == x)
+ if (fnan == x)
abort ();
#endif
exit (0);
diff --git a/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-3.c b/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-3.c
index 8b182902d9b..993b8d33fbd 100644
--- a/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-3.c
+++ b/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-3.c
@@ -1,6 +1,6 @@
#include <signal.h>
-long double nan = 1.0l/0.0l - 1.0l/0.0l;
+long double dnan = 1.0l/0.0l - 1.0l/0.0l;
long double x = 1.0l;
void leave ()
@@ -19,22 +19,22 @@ main ()
signal (SIGFPE, leave);
#endif
/* NaN is an IEEE unordered operand. All these test should be false. */
- if (nan == nan)
+ if (dnan == dnan)
abort ();
- if (nan != x)
+ if (dnan != x)
x = 1.0;
else
abort ();
- if (nan < x)
+ if (dnan < x)
abort ();
- if (nan > x)
+ if (dnan > x)
abort ();
- if (nan <= x)
+ if (dnan <= x)
abort ();
- if (nan >= x)
+ if (dnan >= x)
abort ();
- if (nan == x)
+ if (dnan == x)
abort ();
#endif
exit (0);
diff --git a/gcc/testsuite/gcc.c-torture/execute/ieee/ieee.exp b/gcc/testsuite/gcc.c-torture/execute/ieee/ieee.exp
index 903d5cef147..a5bbc4dbca6 100644
--- a/gcc/testsuite/gcc.c-torture/execute/ieee/ieee.exp
+++ b/gcc/testsuite/gcc.c-torture/execute/ieee/ieee.exp
@@ -1,6 +1,6 @@
#
# Expect driver script for GCC Regression Tests
-# Copyright (C) 1993, 1996 Free Software Foundation
+# Copyright (C) 1993, 1996, 2001 Free Software Foundation
#
# This file is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -24,19 +24,25 @@
# C torture test suite, and other contributors.
#
+# VAX does not have hardware support for IEEE arithmetic.
+if { [istarget "vax-*-*"] } { return }
+
if $tracelevel then {
strace $tracelevel
}
-if [target_info exists ieee_multilib_flags] {
- set additional_flags [target_info ieee_multilib_flags];
-} else {
- set additional_flags "";
+set additional_flags "";
+
+# We must use -ffloat-store/-mieee to ensure that excess precision on some
+# machines does not cause problems
+if [istarget "i\[34567\]86-*-*"] then {
+ lappend additional_flags "-ffloat-store"
}
-# We must use -ffloat-store to ensure that excess precision on some machines
-# does not cause problems
-lappend additional_flags "-ffloat-store"
+if { [istarget "alpha*-*-*"]
+ || [istarget "sh-*-*"] } then {
+ lappend additional_flags "-mieee"
+}
# load support procs
load_lib c-torture.exp
diff --git a/gcc/testsuite/gcc.c-torture/execute/ieee/rbug.x b/gcc/testsuite/gcc.c-torture/execute/ieee/rbug.x
index 5982d9bd5ff..ee879ae4c95 100644
--- a/gcc/testsuite/gcc.c-torture/execute/ieee/rbug.x
+++ b/gcc/testsuite/gcc.c-torture/execute/ieee/rbug.x
@@ -6,7 +6,7 @@ if { [istarget "d10v-*-*"] && ! [string-match "*-mdouble64*" $CFLAGS] } {
# freebsd sets up the fpu with a different precision control which causes
# this test to "fail".
-if { [istarget "i?86-*-freebsd*\[123\]\.*"] } {
+if { [istarget "i?86-*-freebsd*\[12345\]\.*"] } {
set torture_execute_xfail "i?86-*-freebsd*"
}
return 0
diff --git a/gcc/testsuite/gcc.c-torture/execute/loop-2b.x b/gcc/testsuite/gcc.c-torture/execute/loop-2b.x
new file mode 100644
index 00000000000..9c6616cc3e9
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/loop-2b.x
@@ -0,0 +1,15 @@
+# This test has failed off and on for ages, depending on the optimization
+# level and the target. A rewrite of the strength reduction code is really
+# required.
+
+set torture_eval_before_execute {
+
+ set compiler_conditional_xfail_data {
+ "strength reduction lossage" \
+ "i?86-*-*" \
+ { "-O2" } \
+ { "" }
+ }
+}
+
+return 0
diff --git a/gcc/testsuite/gcc.c-torture/execute/memcheck/blkarg.x b/gcc/testsuite/gcc.c-torture/execute/memcheck/blkarg.x
index 52b53fe2163..a56e2ca59b7 100644
--- a/gcc/testsuite/gcc.c-torture/execute/memcheck/blkarg.x
+++ b/gcc/testsuite/gcc.c-torture/execute/memcheck/blkarg.x
@@ -1,9 +1,10 @@
-# The memeory checking code does not mark the stack as readable or writable
+# The memory checking code does not mark the stack as readable or writable
# so this test fails. Ideally the memory checking library ought to
# cooperate with the host OS to mark the stack as it is used or individual
# function prologues and epilogues ought to mark their pieces of stack as
# writable and readable-after-written.
-set torture_execute_xfail "*-*-*"
-
-return 0
+# Setting XFAIL here creates noise because the test passes at
+# random optimization levels for quite a number of targets.
+# Don't run the test at all.
+return 1
diff --git a/gcc/testsuite/gcc.c-torture/execute/memcheck/memcheck.exp b/gcc/testsuite/gcc.c-torture/execute/memcheck/memcheck.exp
index 0d36253ffe8..690b9024ef8 100644
--- a/gcc/testsuite/gcc.c-torture/execute/memcheck/memcheck.exp
+++ b/gcc/testsuite/gcc.c-torture/execute/memcheck/memcheck.exp
@@ -41,6 +41,14 @@ if $idx>=0 {
error "list can't find driver.c in $srcdir/$subdir"
}
+# These don't work on AIX. The constructors get run by a program built
+# with -fcheck-memory-usage, which confuses the driver so much that
+# they don't even link.
+if { [istarget "powerpc-*-aix*"]
+ || [istarget "rs6000-*-aix*"] } {
+ set tests ""
+}
+
# Compiling driver.c on a remote host requires our ability to also
# find its driver.h header.
if [is_remote host] {
diff --git a/gcc/testsuite/gcc.c-torture/unsorted/msp.c b/gcc/testsuite/gcc.c-torture/unsorted/msp.c
index c73cedd294c..5d350fd5ee0 100644
--- a/gcc/testsuite/gcc.c-torture/unsorted/msp.c
+++ b/gcc/testsuite/gcc.c-torture/unsorted/msp.c
@@ -1,5 +1,10 @@
+#ifdef STACK_SIZE
+# define A_SIZE (STACK_SIZE/sizeof(int))
+#else
+# define A_SIZE 16384
+#endif
foo ()
{
- int a[16384];
+ int a[A_SIZE];
bar (a);
}
diff --git a/gcc/testsuite/gcc.dg/20000724-1.c b/gcc/testsuite/gcc.dg/20000724-1.c
index 17d2e7ee0d9..5027d6e9746 100644
--- a/gcc/testsuite/gcc.dg/20000724-1.c
+++ b/gcc/testsuite/gcc.dg/20000724-1.c
@@ -30,16 +30,24 @@ void do_check(struct s *x)
abort();
}
-asm ("
-___checkme:
- pushl %eax; pushl %ebx; pushl %ecx; pushl %edx; pushl %esi; pushl %edi; pushl $0; pushl $0
- pushl $0; pushl $0; pushl $0; pushl $0; pushl $0; pushl $0; pushl $0; pushl $0
- movl %ecx, %eax
- call do_check
- popl %eax; popl %eax; popl %eax; popl %eax; popl %eax; popl %eax; popl %eax; popl %eax
- popl %eax; popl %eax; popl %edi; popl %esi; popl %edx; popl %ecx; popl %ebx; popl %eax
- ret
-");
+#define NT "\n\t"
+
+asm ("\n"
+"___checkme:"
+NT "pushl %eax; pushl %ebx; pushl %ecx; pushl %edx; pushl %esi; pushl %edi"
+
+NT "pushl $0; pushl $0; pushl $0; pushl $0; pushl $0"
+NT "pushl $0; pushl $0; pushl $0; pushl $0; pushl $0"
+
+NT "movl %ecx, %eax"
+NT "call do_check"
+
+NT "popl %eax; popl %eax; popl %eax; popl %eax; popl %eax"
+NT "popl %eax; popl %eax; popl %eax; popl %eax; popl %eax"
+
+NT "popl %edi; popl %esi; popl %edx; popl %ecx; popl %ebx; popl %eax"
+NT "ret"
+);
extern inline void do_asm(struct s * x)
{
diff --git a/gcc/testsuite/gcc.dg/20010520-1.c b/gcc/testsuite/gcc.dg/20010520-1.c
new file mode 100644
index 00000000000..c96dbc4eee5
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/20010520-1.c
@@ -0,0 +1,10 @@
+/* { dg-do compile { target i?86-*-* } } */
+/* { dg-options "-w" } */
+
+void f ()
+{
+ int i __asm__ ("%eax");
+ __asm__ volatile ("" : "=a" (i));
+}
+
+
diff --git a/gcc/testsuite/gcc.dg/20010622-1.c b/gcc/testsuite/gcc.dg/20010622-1.c
new file mode 100644
index 00000000000..dc4b28ccb15
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/20010622-1.c
@@ -0,0 +1,11 @@
+/* Test for segfault doing -Wsequence-point processing on an empty
+ statement expression. */
+/* Origin: PR c/3259 from <David.Decotigny@irisa.fr>. */
+/* { dg-do compile } */
+/* { dg-options "-Wall" } */
+
+void
+f (void)
+{
+ ({ });
+}
diff --git a/gcc/testsuite/gcc.dg/20010912-1.c b/gcc/testsuite/gcc.dg/20010912-1.c
new file mode 100644
index 00000000000..b33b729cb94
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/20010912-1.c
@@ -0,0 +1,48 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -fpic" } */
+
+extern void abort (void);
+extern void exit (int);
+
+int bar (int x, char **y)
+{
+ if (x != 56)
+ abort ();
+ if (**y != 'a')
+ abort ();
+ *y = "def";
+ return 1;
+}
+
+int baz (int x, char **y)
+{
+ if (x != 56)
+ abort ();
+ if (**y != 'a')
+ abort ();
+ return 26;
+}
+
+int foo (int x, char *y)
+{
+ int a;
+ char *b = y;
+ a = bar (x, &y);
+ if (a)
+ {
+ y = b;
+ a = baz (x, &y);
+ }
+ if (a)
+ return a;
+
+ baz (x, &y);
+ return 0;
+}
+
+int main ()
+{
+ if (foo (56, "abc") != 26)
+ abort ();
+ exit (0);
+}
diff --git a/gcc/testsuite/gcc.dg/array-5.c b/gcc/testsuite/gcc.dg/array-5.c
new file mode 100644
index 00000000000..7a8e3ac633d
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/array-5.c
@@ -0,0 +1,42 @@
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+/* Check compatibility of array declarations. */
+
+/* Incomplete decl matches. */
+extern char arr0[];
+char arr0[1];
+
+/* Two integral expressions must be the same. Note that 0 is
+ a gcc extension, but it should work like any other constant. */
+extern char arr1[1];
+char arr1[1];
+extern char arr2[0];
+char arr2[0];
+extern char arr3[0]; /* { dg-error "previous declaration" } */
+char arr3[1]; /* { dg-error "conflicting types" } */
+
+/* Variable size matches. */
+void func(int n, int m)
+{
+ /* The next two are from the example in c99 6.7.5.2/9. */
+ {
+ /* Invalid: not compatible because 4 != 6. */
+ int a[n][6][m];
+ int (*p)[4][n+1];
+ p = a; /* { dg-error "incompatible" } */
+ }
+ {
+ /* Compatible, but defined behavior only if n == 6 and m == n+1. */
+ int c[n][n][6][m];
+ int (*r)[n][n][n+1];
+ r = c;
+ }
+ {
+ /* Compatible, but undefined behavior; (2, 2) is not a constant
+ expression, and thus A is a VLA. */
+ int a[6][(2, 2)];
+ int (*p)[3];
+ p = a; /* { dg-bogus "incompatible" "bad vla handling" { xfail *-*-* } } */
+ }
+}
diff --git a/gcc/testsuite/gcc.dg/bconstp-1.c b/gcc/testsuite/gcc.dg/bconstp-1.c
new file mode 100644
index 00000000000..36831a5d6d5
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/bconstp-1.c
@@ -0,0 +1,25 @@
+/* { dg-do compile } */
+
+/* This test checks that builtin_constant_p can be used safely in
+ initializers for static data. The macro X() defined below should
+ be an acceptable initializer expression no matter how complex its
+ argument is. */
+
+extern int a;
+extern int b;
+
+extern int foo(void);
+extern int bar(void);
+
+#define X(exp) (__builtin_constant_p(exp) ? (exp) : -1)
+
+const short tests[] = {
+ X(0),
+ X(a),
+ X(0 && a),
+ X(a && b),
+ X(foo()),
+ X(0 && foo()),
+ X(a && foo()),
+ X(foo() && bar())
+};
diff --git a/gcc/testsuite/gcc.dg/c90-hexfloat-1.c b/gcc/testsuite/gcc.dg/c90-hexfloat-1.c
index 9139677cad3..122d5ee5e71 100644
--- a/gcc/testsuite/gcc.dg/c90-hexfloat-1.c
+++ b/gcc/testsuite/gcc.dg/c90-hexfloat-1.c
@@ -5,3 +5,7 @@
double d = 0x1.2p2; /* { dg-bogus "warning" "warning in place of error" } */
/* { dg-error "radix 16" "hex float error" { target *-*-* } 6 } */
+double d1 = 0x1p2; /* { dg-bogus "warning" "warning in place of error" } */
+/* { dg-error "radix 16" "hex float error" { target *-*-* } 8 } */
+double d2 = 0x1...p2; /* { dg-bogus "warning" "warning in place of error" } */
+/* { dg-error "too many decimal points" "bad hex float" { target *-*-* } 10 } */
diff --git a/gcc/testsuite/gcc.dg/c99-float-1.c b/gcc/testsuite/gcc.dg/c99-float-1.c
index 07fb9ee8bfb..9e86cca543c 100644
--- a/gcc/testsuite/gcc.dg/c99-float-1.c
+++ b/gcc/testsuite/gcc.dg/c99-float-1.c
@@ -125,9 +125,9 @@
#endif
#ifndef FLT_EVAL_METHOD
-#error "FLT_EVAL_METHOD undefined"
+#error "FLT_EVAL_METHOD undefined" /* { dg-bogus "undefined" "undefined" { xfail sparc*-sun-solaris2.* } } */
#endif
#ifndef DECIMAL_DIG
-#error "DECIMAL_DIG undefined"
+#error "DECIMAL_DIG undefined" /* { dg-bogus "undefined" "undefined" { xfail sparc*-sun-solaris2.* } } */
#endif
diff --git a/gcc/testsuite/gcc.dg/concat.c b/gcc/testsuite/gcc.dg/concat.c
new file mode 100644
index 00000000000..4f4f8d7b08b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/concat.c
@@ -0,0 +1,16 @@
+/* Copyright (C) 2001 Free Software Foundation, Inc. */
+
+/* { dg-do compile } */
+
+/* Test we output a warning for concatenation of artifical strings.
+
+ Neil Booth, 10 Dec 2001. */
+
+void foo ()
+{
+ char str1[] = __FUNCTION__ "."; /* { dg-warning "deprecated" } */
+ char str2[] = __PRETTY_FUNCTION__ ".";/* { dg-warning "deprecated" } */
+ char str3[] = "." __FUNCTION__; /* { dg-warning "deprecated" } */
+ char str4[] = "." __PRETTY_FUNCTION__;/* { dg-warning "deprecated" } */
+ char str5[] = "." "."; /* No warning. */
+}
diff --git a/gcc/testsuite/gcc.dg/cpp/macro7.c b/gcc/testsuite/gcc.dg/cpp/macro7.c
new file mode 100644
index 00000000000..6f2c67c1080
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/cpp/macro7.c
@@ -0,0 +1,10 @@
+/* { dg-do preprocess } */
+
+/* Test we don't complain about directives in macro expansions when
+ looking for the '(' of a function-like macro.
+
+ Submitter: Neil Booth. 3 Mar 2000. */
+
+#define f(x) x
+f
+#define g
diff --git a/gcc/testsuite/gcc.dg/cpp/multiline.c b/gcc/testsuite/gcc.dg/cpp/multiline.c
index 36b60537cfb..1db0a3e26ad 100644
--- a/gcc/testsuite/gcc.dg/cpp/multiline.c
+++ b/gcc/testsuite/gcc.dg/cpp/multiline.c
@@ -22,3 +22,5 @@ L"line 1
{ dg-final { if \{ [grep multiline.i "^$"] == "" \} \{ } }
{ dg-final { return \} } }
{ dg-final { fail "multiline.c: multi-line tokens" } } */
+/* { dg-warning "deprecated" "multiline strings" { target *-*-* } 11 } */
+/* { dg-warning "deprecated" "multiline strings" { target *-*-* } 15 } */
diff --git a/gcc/testsuite/gcc.dg/cpp/redef2.c b/gcc/testsuite/gcc.dg/cpp/redef2.c
index 1656ab80054..b0068d91626 100644
--- a/gcc/testsuite/gcc.dg/cpp/redef2.c
+++ b/gcc/testsuite/gcc.dg/cpp/redef2.c
@@ -1,7 +1,7 @@
/* Test for redefining macros with significant differences. */
/* { dg-do preprocess }
- { dg-options "-ansi -pedantic -Wall -fno-show-column" } */
+ { dg-options "-ansi -Wall -fno-show-column" } */
#define mac(a, b) (a) + (b)
#define mac(a, b) (a) * (b)
@@ -14,6 +14,9 @@
#define va(a...) a
#define va(...) __VA_ARGS__
+#define foo(x) x
+#define foo(x)x /* { dg-bogus "redefined" "redefined foo" } */
+
/* { dg-warning "redefined" "redef mac" { target *-*-* } 7 }
{ dg-warning "redefined" "redef mac" { target *-*-* } 8 }
{ dg-warning "redefined" "redef mac" { target *-*-* } 9 }
@@ -25,6 +28,4 @@
{ dg-warning "previous" "prev def mac" { target *-*-* } 8 }
{ dg-warning "previous" "prev def ro" { target *-*-* } 11 }
{ dg-warning "previous" "prev def va" { target *-*-* } 14 }
-
- { dg-warning "named var" "named variadic" { target *-*-* } 14 }
- { dg-warning "anonymous var" "anon variadic" { target *-*-* } 15 } */
+*/
diff --git a/gcc/testsuite/gcc.dg/cpp/tr-define.c b/gcc/testsuite/gcc.dg/cpp/tr-define.c
new file mode 100644
index 00000000000..54bd7a73b3b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/cpp/tr-define.c
@@ -0,0 +1,2 @@
+/* { dg-do preprocess } */
+/* { dg-options "-traditional -DDEFINE1DEFINE -DDEFINE2DEFIN=" } */
diff --git a/gcc/testsuite/gcc.dg/direct2.c b/gcc/testsuite/gcc.dg/direct2.c
new file mode 100644
index 00000000000..d6dc1088c37
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/direct2.c
@@ -0,0 +1,37 @@
+/* Copyright (C) 2001 Free Software Foundation, Inc.
+ Contributed by Nathan Sidwell 8 May 2001 <nathan@codesourcery.com> */
+
+/* Test of prohibition on directives which result from macro expansion.
+ See also direct2s.c */
+
+/* { dg-do compile } */
+
+#define HASH #
+#define HASHDEFINE #define
+#define HASHINCLUDE #include
+
+HASH include "somerandomfile" /*{ dg-error "syntax|parse" "non-include" }*/
+/*{ dg-bogus "No such" "don't execute non-include" { target *-*-* } 13 }*/
+HASHINCLUDE <somerandomfile> /*{ dg-error "syntax|parse" "non-include 2" }*/
+/*{ dg-bogus "No such" "don't execute non-include 2" { target *-*-* } 15 }*/
+
+void g ()
+{
+HASH define X 1 /* { dg-error "syntax error" "# from macro" } */
+HASHDEFINE Y 1 /* { dg-error "syntax error" "#define from macro" } */
+}
+
+#pragma GCC dependency "direct2.c"
+#
+
+void f ()
+{
+ int i = X; /* { dg-error "undeclared|for each" "no macro X" } */
+ int j = Y; /* { dg-error "undeclared|for each" "no macro Y" } */
+}
+
+#define slashstar /##*
+#define starslash *##/
+
+slashstar starslash /* { dg-error "parse error" "not a comment" } */
+/* { dg-warning "does not give" "paste warning(s)" { target *-*-* } 36 } */
diff --git a/gcc/testsuite/gcc.dg/direct2s.c b/gcc/testsuite/gcc.dg/direct2s.c
new file mode 100644
index 00000000000..6c98ecc9a12
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/direct2s.c
@@ -0,0 +1,39 @@
+/* Copyright (C) 2001 Free Software Foundation, Inc.
+ Contributed by Nathan Sidwell 8 May 2001 <nathan@codesourcery.com> */
+
+/* Test of prohibition on directives which result from macro
+ expansion. Same as direct2.c, with -save-temps applied; results
+ should be identical. */
+
+/* { dg-do compile } */
+/* { dg-options "-save-temps -ansi -pedantic-errors" } */
+
+#define HASH #
+#define HASHDEFINE #define
+#define HASHINCLUDE #include
+
+HASH include "somerandomfile" /*{ dg-error "syntax|parse" "non-include" }*/
+/*{ dg-bogus "No such" "don't execute non-include" { target *-*-* } 15 }*/
+HASHINCLUDE <somerandomfile> /*{ dg-error "syntax|parse" "non-include 2" }*/
+/*{ dg-bogus "No such" "don't execute non-include 2" { target *-*-* } 17 }*/
+
+void g ()
+{
+HASH define X 1 /* { dg-error "syntax error" "# from macro" } */
+HASHDEFINE Y 1 /* { dg-error "syntax error" "#define from macro" } */
+}
+
+#pragma GCC dependency "direct2s.c"
+#
+
+void f ()
+{
+ int i = X; /* { dg-error "undeclared|for each" "no macro X" } */
+ int j = Y; /* { dg-error "undeclared|for each" "no macro Y" } */
+}
+
+#define slashstar /##*
+#define starslash *##/
+
+slashstar starslash /* { dg-error "parse error" "not a comment" } */
+/* { dg-warning "does not give" "paste warning(s)" { target *-*-* } 38 } */
diff --git a/gcc/testsuite/gcc.dg/noncompile/20010524-1.c b/gcc/testsuite/gcc.dg/noncompile/20010524-1.c
new file mode 100644
index 00000000000..754a38c147f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/noncompile/20010524-1.c
@@ -0,0 +1,2 @@
+int i = 7 / 0; /* { dg-error "not constant" } */
+
diff --git a/gcc/testsuite/gcc.dg/noncompile/redecl-1.c b/gcc/testsuite/gcc.dg/noncompile/redecl-1.c
index 65b06369ddb..f4db95013e2 100644
--- a/gcc/testsuite/gcc.dg/noncompile/redecl-1.c
+++ b/gcc/testsuite/gcc.dg/noncompile/redecl-1.c
@@ -4,7 +4,7 @@
int
foo ()
{
- int bar; /* { dg-error "previously declared" "previously declared" } */
- volatile int bar; /* { dg-error "redeclaration" "redeclaration" } */
+ int bar; /* { dg-error "previous.*decl" "previous.*decl" } */
+ volatile int bar; /* { dg-error "conflicting types" "conflicting types" } */
}
diff --git a/gcc/testsuite/gcc.dg/sequence-pt-1.c b/gcc/testsuite/gcc.dg/sequence-pt-1.c
index 1faf4a9e24a..5220227c43c 100644
--- a/gcc/testsuite/gcc.dg/sequence-pt-1.c
+++ b/gcc/testsuite/gcc.dg/sequence-pt-1.c
@@ -56,7 +56,7 @@ foo (int a, int b, int n, int p, int *ptr, struct s *sptr,
ap[a+=1] += a++; /* { dg-warning "undefined" "sequence point warning" } */
a = a++, b = a; /* { dg-warning "undefined" "sequence point warning" } */
b = a, a = a++; /* { dg-warning "undefined" "sequence point warning" } */
- a = (b++ ? n : a) + b; /* { dg-warning "undefined" "sequence point warning" } */
+ a = (b++ ? n : a) + b; /* { dg-warning "undefined" "sequence point warning" { xfail *-*-* } } */
b ? a = a++ : a; /* { dg-warning "undefined" "sequence point warning" } */
b ? a : a = a++; /* { dg-warning "undefined" "sequence point warning" } */
b && (a = a++); /* { dg-warning "undefined" "sequence point warning" } */
diff --git a/gcc/testsuite/gcc.dg/ultrasp2.c b/gcc/testsuite/gcc.dg/ultrasp2.c
index dd8032bc4fb..1b8e5827a29 100644
--- a/gcc/testsuite/gcc.dg/ultrasp2.c
+++ b/gcc/testsuite/gcc.dg/ultrasp2.c
@@ -6,7 +6,6 @@
/* { dg-options "" } */
/* { dg-options "-O0 -m64" { target sparc64-*-* } } */
/* { dg-options "-O0 -m64" { target sparcv9-*-* } } */
-/* { dg-options "-O0 -m64" { target sparc-*-solaris* } } */
/* { dg-options "" { target sparc-*-solaris2.[0-6] } } */
/* { dg-options "" { target sparc-*-solaris2.[0-6].* } } */
diff --git a/gcc/testsuite/gcc.dg/wchar_t-1.c b/gcc/testsuite/gcc.dg/wchar_t-1.c
new file mode 100644
index 00000000000..6d95c69c304
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/wchar_t-1.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-Wall" } */
+
+/* Compile with -Wall to get a warning if built-in and system wchar_t don't
+ match. */
+
+#define _STDDEF_H
+#include <wchar.h>
+
+__WCHAR_TYPE__ __wc_t__;
+wchar_t *wc_t_p;
+
+void
+wct (void)
+{
+ wc_t_p = &__wc_t__;
+}
diff --git a/gcc/testsuite/gcc.dg/wint_t-1.c b/gcc/testsuite/gcc.dg/wint_t-1.c
new file mode 100644
index 00000000000..3f88dcbeab0
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/wint_t-1.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-Wall" } */
+
+/* Compile with -Wall to get a warning if built-in and system wint_t don't
+ match. */
+
+#define _STDDEF_H
+#include <wchar.h>
+
+__WINT_TYPE__ __wi_t__;
+wint_t *wi_t_p;
+
+void
+wit (void)
+{
+ wi_t_p = &__wi_t__;
+}
diff --git a/gcc/testsuite/gcc.dg/wtr-conversion-1.c b/gcc/testsuite/gcc.dg/wtr-conversion-1.c
new file mode 100644
index 00000000000..ecf688fe405
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/wtr-conversion-1.c
@@ -0,0 +1,66 @@
+/* Test for -Wtraditional warnings on conversions by prototypes.
+ Note, gcc should omit these warnings in system header files.
+ By Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 4/09/2001. */
+/* { dg-do compile } */
+/* { dg-options "-Wtraditional" } */
+
+extern void foo_i (int);
+extern void foo_f (float);
+extern void foo_ld (long double);
+extern void foo_cd (__complex__ double);
+
+extern int i;
+extern float f;
+extern long double ld;
+extern __complex__ double cd;
+
+void
+testfunc1 (void)
+{
+ foo_i (i);
+ foo_i (f); /* { dg-warning "as integer rather than floating" "prototype conversion warning" } */
+ foo_i (ld); /* { dg-warning "as integer rather than floating" "prototype conversion warning" } */
+ foo_i (cd); /* { dg-warning "as integer rather than complex" "prototype conversion warning" } */
+
+ foo_f (i); /* { dg-warning "as floating rather than integer" "prototype conversion warning" } */
+ foo_f (f); /* { dg-warning "as `float' rather than `double'" "prototype conversion warning" } */
+ foo_f (ld); /* { dg-warning "as `float' rather than `double'" "prototype conversion warning" } */
+ foo_f (cd); /* { dg-warning "as floating rather than complex" "prototype conversion warning" } */
+
+ foo_ld (i); /* { dg-warning "as floating rather than integer" "prototype conversion warning" } */
+ foo_ld (f);
+ foo_ld (ld);
+ foo_ld (cd); /* { dg-warning "as floating rather than complex" "prototype conversion warning" } */
+
+ foo_cd (i); /* { dg-warning "as complex rather than integer" "prototype conversion warning" } */
+ foo_cd (f); /* { dg-warning "as complex rather than floating" "prototype conversion warning" } */
+ foo_cd (ld); /* { dg-warning "as complex rather than floating" "prototype conversion warning" } */
+ foo_cd (cd);
+}
+
+# 54 "sys-header.h" 3
+/* We are in system headers now, no -Wtraditional warnings should issue. */
+
+void
+testfunc2 (void)
+{
+ foo_i (i);
+ foo_i (f);
+ foo_i (ld);
+ foo_i (cd);
+
+ foo_f (i);
+ foo_f (f);
+ foo_f (ld);
+ foo_f (cd);
+
+ foo_ld (i);
+ foo_ld (f);
+ foo_ld (ld);
+ foo_ld (cd);
+
+ foo_cd (i);
+ foo_cd (f);
+ foo_cd (ld);
+ foo_cd (cd);
+}
diff --git a/gcc/testsuite/gcc.misc-tests/gcov-3.c b/gcc/testsuite/gcc.misc-tests/gcov-3.c
new file mode 100644
index 00000000000..36fe64f802b
--- /dev/null
+++ b/gcc/testsuite/gcc.misc-tests/gcov-3.c
@@ -0,0 +1,45 @@
+/* Test Gcov with computed gotos.
+ This is the same as test gcc.c-torture/execute/980526-1.c */
+
+/* { dg-options "-fprofile-arcs -ftest-coverage" } */
+/* { dg-do run { target native } } */
+
+int expect_do1 = 1, expect_do2 = 2;
+
+static int doit(int x){
+ __label__ lbl1;
+ __label__ lbl2;
+ static int jtab_init = 0;
+ static void *jtab[2];
+
+ if(!jtab_init) {
+ jtab[0] = &&lbl1;
+ jtab[1] = &&lbl2;
+ jtab_init = 1;
+ }
+ goto *jtab[x];
+lbl1:
+ return 1;
+lbl2:
+ return 2;
+}
+
+static void do1(void) {
+ if (doit(0) != expect_do1)
+ abort ();
+}
+
+static void do2(void){
+ if (doit(1) != expect_do2)
+ abort ();
+}
+
+int main(void){ /* count(1) */
+#ifndef NO_LABEL_VALUES
+ do1();
+ do2();
+#endif
+ exit(0); /* count(1) */
+}
+
+/* { dg-final { run-gcov gcov-3.c } } */
diff --git a/gcc/testsuite/gcc.misc-tests/linkage.exp b/gcc/testsuite/gcc.misc-tests/linkage.exp
index 785b1f1e77f..a58fea6b2f9 100644
--- a/gcc/testsuite/gcc.misc-tests/linkage.exp
+++ b/gcc/testsuite/gcc.misc-tests/linkage.exp
@@ -1,4 +1,4 @@
-# Copyright (C) 1988, 90-96, 1997, 2000 Free Software Foundation, Inc.
+# Copyright (C) 1988, 90-96, 1997, 2000, 2001 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -24,12 +24,25 @@ if [isnative] then {
fail "linkage.c"
} else {
# This is a completely bogus test. Sorry.
+
+ # Need to ensure ABI for native compiler matches gcc
+ set native_cflags ""
+ if [istarget "mips-sgi-irix6*"] {
+ set file_string [exec file "linkage-x.o"]
+ if [ string match "*64*" $file_string ] {
+ set native_cflags "-64"
+ }
+ if [ string match "*N32*" $file_string ] {
+ set native_cflags "-n32"
+ }
+ }
+
catch { exec rm -f linkage-y.o }
- send_log "cc -c $srcdir/$subdir/linkage-y.c >&/dev/null\n"
- catch { exec cc -c "$srcdir/$subdir/linkage-y.c" >&/dev/null }
+ send_log "cc -c $native_cflags $srcdir/$subdir/linkage-y.c >&/dev/null\n"
+ catch { exec cc -c $native_cflags "$srcdir/$subdir/linkage-y.c" >&/dev/null }
if ![file exists "linkage-y.o"] then {
- send_log "c89 -c $srcdir/$subdir/linkage-y.c >&/dev/null\n"
- catch { exec c89 -c "$srcdir/$subdir/linkage-y.c" >&/dev/null }
+ send_log "c89 -c $native_cflags $srcdir/$subdir/linkage-y.c >&/dev/null\n"
+ catch { exec c89 -c $native_cflags "$srcdir/$subdir/linkage-y.c" >&/dev/null }
}
if [file exists "linkage-y.o"] then {
set lines [gcc_target_compile "linkage-y.o linkage-x.o" "x" executable ""]
diff --git a/gcc/testsuite/gcc.misc-tests/mg.exp b/gcc/testsuite/gcc.misc-tests/mg.exp
index 2d5558f315f..c47a801bb5e 100644
--- a/gcc/testsuite/gcc.misc-tests/mg.exp
+++ b/gcc/testsuite/gcc.misc-tests/mg.exp
@@ -20,5 +20,5 @@ load_lib mike-gcc.exp
prebase
set actions none-of-the-above
-set compiler_output "mg.o ?: .*mg.c \[ \\\n\]*nonexist.h"
+set compiler_output "mg.o ?: .*mg.c \[ \\\\\n\]*nonexist.h"
postbase mg.c "" "" "-MM -MG"
diff --git a/gcc/testsuite/lib/g++.exp b/gcc/testsuite/lib/g++.exp
index 650b49c40a7..54fc04eef90 100644
--- a/gcc/testsuite/lib/g++.exp
+++ b/gcc/testsuite/lib/g++.exp
@@ -63,7 +63,7 @@ proc g++_version { } {
# provide new versions of g++_include_flags and g++_link_flags (both
# originally from libgloss.exp) which know about the new gcc tree structure
#
-proc g++_include_flags { args } {
+proc g++_include_flags { paths } {
global srcdir
global HAVE_LIBSTDCXX_V3
@@ -78,12 +78,11 @@ proc g++_include_flags { args } {
append flags "-I${dir} -I${dir}/src "
}
- set gccpath [get_multilibs]
+ set gccpath ${paths}
if { ${HAVE_LIBSTDCXX_V3} } {
set odir_v3 [lookfor_file ${gccpath} libstdc++-v3]
- set sdir_v3 [lookfor_file ${srcdir} libstdc++-v3]
- append flags [exec sh ${odir_v3}/tests_flags --compiler ${odir_v3} ${sdir_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++]
@@ -93,12 +92,12 @@ proc g++_include_flags { args } {
return "$flags"
}
-proc g++_link_flags { args } {
+proc g++_link_flags { paths } {
global rootme
global srcdir
global ld_library_path
- set gccpath [get_multilibs];
+ set gccpath ${paths}
set libio_dir ""
set flags ""
set ld_library_path "."
@@ -212,8 +211,13 @@ proc g++_init { args } {
set ALWAYS_CXXFLAGS ""
if ![is_remote host] {
- lappend ALWAYS_CXXFLAGS "additional_flags=[g++_include_flags]";
- lappend ALWAYS_CXXFLAGS "ldflags=[g++_link_flags]";
+ if [info exists TOOL_OPTIONS] {
+ lappend ALWAYS_CXXFLAGS "additional_flags=[g++_include_flags [get_multilibs ${TOOL_OPTIONS}] ]";
+ lappend ALWAYS_CXXFLAGS "ldflags=[g++_link_flags [get_multilibs ${TOOL_OPTIONS}] ]";
+ } else {
+ lappend ALWAYS_CXXFLAGS "additional_flags=[g++_include_flags [get_multilibs] ]";
+ lappend ALWAYS_CXXFLAGS "ldflags=[g++_link_flags [get_multilibs] ]";
+ }
}
if [info exists TOOL_OPTIONS] {
@@ -299,12 +303,12 @@ if { [info procs prune_warnings] == "" } then {
# proper, so we do it here, by trickery. We really only need to do
# this on IRIX, but it shouldn't hurt to do it anywhere else.
-proc g++_set_ld_library_path { name element op } {
+proc ${tool}_set_ld_library_path { name element op } {
setenv LD_LIBRARYN32_PATH [getenv LD_LIBRARY_PATH]
setenv LD_LIBRARY64_PATH [getenv LD_LIBRARY_PATH]
}
-trace variable env(LD_LIBRARY_PATH) w g++_set_ld_library_path
+trace variable env(LD_LIBRARY_PATH) w ${tool}_set_ld_library_path
# Utility used by mike-g++.exp and old-dejagnu.exp.
# Check the compiler(/assembler/linker) output for text indicating that
diff --git a/gcc/testsuite/lib/g77-dg.exp b/gcc/testsuite/lib/g77-dg.exp
new file mode 100644
index 00000000000..cb72c365361
--- /dev/null
+++ b/gcc/testsuite/lib/g77-dg.exp
@@ -0,0 +1,161 @@
+# Copyright (C) 1997, 1999, 2000 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program 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 program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+load_lib dg.exp
+load_lib file-format.exp
+load_lib target-supports.exp
+load_lib scanasm.exp
+
+if ![info exists TORTURE_OPTIONS] {
+ # It is theoretically beneficial to group all of the O2/O3 options together,
+ # as in many cases the compiler will generate identical executables for
+ # all of them--and the c-torture testsuite will skip testing identical
+ # executables multiple times.
+ # Also note that -finline-functions is explicitly included in one of the
+ # items below, even though -O3 is also specified, because some ports may
+ # choose to disable inlining functions by default, even when optimizing.
+ set TORTURE_OPTIONS [list \
+ { -O0 } \
+ { -O1 } \
+ { -O2 } \
+ { -O3 -fomit-frame-pointer } \
+ { -O3 -fomit-frame-pointer -funroll-loops } \
+ { -O3 -fomit-frame-pointer -funroll-all-loops -finline-functions } \
+ { -O3 -g } \
+ { -Os } ]
+}
+
+
+# Split TORTURE_OPTIONS into two choices: one for testcases with loops and
+# one for testcases without loops.
+
+set torture_with_loops $TORTURE_OPTIONS
+set torture_without_loops ""
+foreach option $TORTURE_OPTIONS {
+ if ![string match "*loop*" $option] {
+ lappend torture_without_loops $option
+ }
+}
+
+# Define g77 callbacks for dg.exp.
+
+proc g77-dg-test { prog do_what extra_tool_flags } {
+ # Set up the compiler flags, based on what we're going to do.
+
+ switch $do_what {
+ "preprocess" {
+ set compile_type "preprocess"
+ set output_file "[file rootname [file tail $prog]].i"
+ }
+ "compile" {
+ set compile_type "assembly"
+ set output_file "[file rootname [file tail $prog]].s"
+ }
+ "assemble" {
+ set compile_type "object"
+ set output_file "[file rootname [file tail $prog]].o"
+ }
+ "link" {
+ set compile_type "executable"
+ set output_file "a.out"
+ # The following line is needed for targets like the i960 where
+ # the default output file is b.out. Sigh.
+ }
+ "run" {
+ set compile_type "executable"
+ # FIXME: "./" is to cope with "." not being in $PATH.
+ # Should this be handled elsewhere?
+ # YES.
+ set output_file "./a.out"
+ # This is the only place where we care if an executable was
+ # created or not. If it was, dg.exp will try to run it.
+ remote_file build delete $output_file;
+ }
+ default {
+ perror "$do_what: not a valid dg-do keyword"
+ return ""
+ }
+ }
+ set options ""
+ if { $extra_tool_flags != "" } {
+ lappend options "additional_flags=$extra_tool_flags"
+ }
+
+ set comp_output [g77_target_compile "$prog" "$output_file" "$compile_type" $options];
+
+ return [list $comp_output $output_file]
+}
+
+proc g77-dg-prune { system text } {
+ set text [prune_g77_output $text]
+
+ # If we see "region xxx is full" then the testcase is too big for ram.
+ # This is tricky to deal with in a large testsuite like c-torture so
+ # deal with it here. Just mark the testcase as unsupported.
+ if [regexp "(^|\n)\[^\n\]*: region \[^\n\]* is full" $text] {
+ # The format here is important. See dg.exp.
+ return "::unsupported::memory full"
+ }
+
+ return $text
+}
+
+# Utility routines.
+
+#
+# search_for -- looks for a string match in a file
+#
+proc search_for { file pattern } {
+ set fd [open $file r]
+ while { [gets $fd cur_line]>=0 } {
+ if [string match "*$pattern*" $cur_line] then {
+ close $fd
+ return 1
+ }
+ }
+ close $fd
+ return 0
+}
+
+# Modified dg-runtest that can cycle through a list of optimization options
+# as c-torture does.
+proc g77-dg-runtest { testcases default-extra-flags } {
+ global runtests
+
+ foreach test $testcases {
+ # If we're only testing specific files and this isn't one of
+ # them, skip it.
+ if ![runtest_file_p $runtests $test] {
+ continue
+ }
+
+ # Look for a loop within the source code - if we don't find one,
+ # don't pass -funroll[-all]-loops.
+ global torture_with_loops torture_without_loops
+ if [expr [search_for $test "do *\[0-9\]"]+[search_for $test "end *do"]] {
+ set option_list $torture_with_loops
+ } else {
+ set option_list $torture_without_loops
+ }
+
+ set nshort [file tail [file dirname $test]]/[file tail $test]
+
+ foreach flags $option_list {
+ verbose "Testing $nshort, $flags" 1
+ dg-test $test $flags ${default-extra-flags}
+ }
+ }
+}
diff --git a/gcc/testsuite/lib/objc.exp b/gcc/testsuite/lib/objc.exp
index 8a9658f57ef..00a6eac4318 100644
--- a/gcc/testsuite/lib/objc.exp
+++ b/gcc/testsuite/lib/objc.exp
@@ -1,4 +1,4 @@
-# Copyright (C) 1992, 1993, 1994, 1996, 1997, 2000 Free Software Foundation, Inc.
+# Copyright (C) 1992, 1993, 1994, 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -113,13 +113,14 @@ proc objc_init { args } {
}
proc objc_target_compile { source dest type options } {
+ global rootme;
global tmpdir;
global gluefile wrap_flags;
global OBJC_UNDER_TEST
global TOOL_OPTIONS
global ld_library_path
- set ld_library_path "."
+ set ld_library_path ".:${rootme}"
lappend options "libs=-lobjc"
if { [target_info needs_status_wrapper]!="" && [info exists gluefile] } {
@@ -235,6 +236,20 @@ if { [info procs prune_warnings] == "" } then {
}
}
+# On IRIX 6, we have to set variables akin to LD_LIBRARY_PATH, but
+# called LD_LIBRARYN32_PATH (for the N32 ABI) and LD_LIBRARY64_PATH
+# (for the 64-bit ABI). The right way to do this would be to modify
+# unix.exp -- but that's not an option since it's part of DejaGNU
+# proper, so we do it here, by trickery. We really only need to do
+# this on IRIX, but it shouldn't hurt to do it anywhere else.
+
+proc ${tool}_set_ld_library_path { name element op } {
+ setenv LD_LIBRARYN32_PATH [getenv LD_LIBRARY_PATH]
+ setenv LD_LIBRARY64_PATH [getenv LD_LIBRARY_PATH]
+}
+
+trace variable env(LD_LIBRARY_PATH) w ${tool}_set_ld_library_path
+
# Utility used by mike-gcc.exp and c-torture.exp.
# Check the compiler(/assembler/linker) output for text indicating that
# the testcase should be marked as "unsupported".
diff --git a/gcc/testsuite/lib/old-dejagnu.exp b/gcc/testsuite/lib/old-dejagnu.exp
index aaac095b21a..8384e8392c6 100644
--- a/gcc/testsuite/lib/old-dejagnu.exp
+++ b/gcc/testsuite/lib/old-dejagnu.exp
@@ -1,4 +1,4 @@
-# Copyright (C) 1988, 90, 91, 92, 1994, 1996, 1997, 2000 Free Software Foundation, Inc.
+# Copyright (C) 1988, 90, 91, 92, 1994, 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -233,7 +233,7 @@ proc old-dejagnu { compiler prog name cflagsx default_cflags libs } {
lappend cflags "compiler=$compiler"
regsub -all "\[./\]" "$name" "-" output;
- set output "$tmpdir/$output";
+ set output "$tmpdir/$output.exe";
set compile_type "executable"
set tmp [lindex [grep $prog "Build don.t link:"] 0]
@@ -574,9 +574,10 @@ proc old-dejagnu { compiler prog name cflagsx default_cflags libs } {
}
$status "$name $pattern Execution test"
}
+ } else {
+ verbose "deleting $output"
+ remote_file build delete $output
}
- verbose "deleting $output"
- remote_file build delete $output
return 0
}
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index 054fdb8f770..86642567878 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -27,6 +27,7 @@
# this proc returns 1 if they're supported, 0 if they're not, or -1 if unsure
proc check_weak_available { } {
+ global target_triplet
global target_cpu
# All mips targets should support it
@@ -35,6 +36,12 @@ proc check_weak_available { } {
return 1
}
+ # DEC OSF/1/Digital UNIX/Tru64 UNIX supports it
+
+ if { [regexp "alpha.*osf.*" $target_triplet] } {
+ return 1
+ }
+
# ELF and ECOFF support it. a.out does with gas/gld but may also with
# other linkers, so we should try it
diff --git a/gcc/testsuite/objc/execute/IMP.m b/gcc/testsuite/objc/execute/IMP.m
new file mode 100644
index 00000000000..979aebb0158
--- /dev/null
+++ b/gcc/testsuite/objc/execute/IMP.m
@@ -0,0 +1,39 @@
+/* Contributed by Nicola Pero - Fri Mar 9 19:39:15 CET 2001 */
+#include <objc/objc.h>
+#include <objc/objc-api.h>
+
+/* Test getting and calling the IMP of a method */
+
+@interface TestClass
+{
+ Class isa;
+}
+- (int) next: (int)a;
+@end
+
+@implementation TestClass
+- (int) next: (int)a
+{
+ return a + 1;
+}
+@end
+
+
+int main (void)
+{
+ Class class;
+ SEL selector;
+ int (* imp) (id, SEL, int);
+
+ class = objc_get_class ("TestClass");
+ selector = @selector (next:);
+ imp = (int (*)(id, SEL, int))method_get_imp
+ (class_get_class_method (class, selector));
+
+ if (imp (class, selector, 5) != 6)
+ {
+ abort ();
+ }
+
+ return 0;
+}
diff --git a/gcc/testsuite/objc/execute/_cmd.m b/gcc/testsuite/objc/execute/_cmd.m
new file mode 100644
index 00000000000..20203b51711
--- /dev/null
+++ b/gcc/testsuite/objc/execute/_cmd.m
@@ -0,0 +1,30 @@
+/* Contributed by Nicola Pero - Fri Mar 9 19:39:15 CET 2001 */
+#include <objc/objc.h>
+#include <objc/objc-api.h>
+
+/* Test the hidden argument _cmd to method calls */
+
+@interface TestClass
+{
+ Class isa;
+}
++ (const char*) method;
+@end
+
+@implementation TestClass
++ (const char*) method;
+{
+ return sel_get_name (_cmd);
+}
+@end
+
+
+int main (void)
+{
+ if (strcmp ([TestClass method], "method"))
+ {
+ abort ();
+ }
+
+ return 0;
+}
diff --git a/gcc/testsuite/objc/execute/accessing_ivars.m b/gcc/testsuite/objc/execute/accessing_ivars.m
new file mode 100644
index 00000000000..2c024f5ba7e
--- /dev/null
+++ b/gcc/testsuite/objc/execute/accessing_ivars.m
@@ -0,0 +1,55 @@
+/* Contributed by Nicola Pero - Thu Mar 8 16:27:46 CET 2001 */
+#include <objc/objc.h>
+#include <objc/objc-api.h>
+#include <objc/Object.h>
+
+/* Test that by using -> we can access ivars of other objects of the same
+ class */
+
+@interface TestClass : Object
+{
+ int value;
+}
+- (int) value;
+- (int) setValue: (int)number;
+- (void) takeValueFrom: (TestClass *)object;
+@end
+
+@implementation TestClass : Object
+{
+ int value;
+}
+- (int) value
+{
+ return value;
+}
+- (int) setValue: (int)number
+{
+ value = number;
+}
+- (void) takeValueFrom: (TestClass *)object
+{
+ value = object->value;
+}
+@end
+
+int main (void)
+{
+ TestClass *a;
+ TestClass *b;
+
+ a = [TestClass new];
+ [a setValue: 10];
+
+ b = [TestClass new];
+ [b setValue: -10];
+
+ [b takeValueFrom: a];
+
+ if ([b value] != [a value])
+ {
+ abort ();
+ }
+
+ return 0;
+}
diff --git a/gcc/testsuite/objc/execute/bycopy-3.m b/gcc/testsuite/objc/execute/bycopy-3.m
new file mode 100644
index 00000000000..b4fd48a80ae
--- /dev/null
+++ b/gcc/testsuite/objc/execute/bycopy-3.m
@@ -0,0 +1,69 @@
+/*
+ * Contributed by Nicola Pero <nicola@brainstorm.co.uk>
+ * Wed Feb 28 12:27:03 CET 2001
+ */
+
+/*
+ * This test contains some no-op code which is needed to keep it
+ * compile on broken gcc 3.x. Anyway, the no-op code does not
+ * interfere with what we are testing, which is that the `bycopy'
+ * keyword generates the _F_BYCOPY qualifier for the return type. */
+
+#include <objc/objc.h>
+#include <objc/Object.h>
+#include <objc/Protocol.h>
+#include <objc/encoding.h>
+
+@protocol MyProtocol
++ (bycopy id<MyProtocol>) bycopyMethod;
+@end
+
+/* This no-op class to keep it compile under broken gcc 3.x */
+@interface MyObject : Object <MyProtocol>
+@end
+
+@implementation MyObject
++ (bycopy id<MyProtocol>) bycopyMethod
+{
+ return [MyObject alloc];
+}
+@end
+
+int main (void)
+{
+ struct objc_method_description *method;
+ const char *method_types;
+ unsigned qualifiers;
+ Protocol *protocol;
+ /* This no-op command is needed to keep the test compile on broken
+ gcc 3.x */
+ MyObject *object = [MyObject bycopyMethod];
+
+ /* Get the protocol object */
+ protocol = @protocol (MyProtocol);
+
+ /* Ask to the protocol for the description of the method bycopyMethod */
+ method = [protocol descriptionForClassMethod: @selector (bycopyMethod)];
+ if (method == NULL)
+ {
+ printf ("Could not find method bycopyMethod in protocol!\n");
+ exit (1);
+ }
+
+ /* Get the method types for the method - which encode return type,
+ arguments etc. */
+ method_types = method->types;
+
+ /* Get the qualifiers for the return type */
+ qualifiers = objc_get_type_qualifiers (method_types);
+
+ /* If _F_BYCOPY is not there, the compiler is broken */
+ if (! (qualifiers & _F_BYCOPY))
+ {
+ printf ("Failed - selector does not contain _F_BYCOPY qualifier!\n");
+ exit (1);
+ }
+
+ /* Else, happy end */
+ return 0;
+}
diff --git a/gcc/testsuite/objc/execute/class-1.m b/gcc/testsuite/objc/execute/class-1.m
new file mode 100644
index 00000000000..a28cfc3abb8
--- /dev/null
+++ b/gcc/testsuite/objc/execute/class-1.m
@@ -0,0 +1,23 @@
+/* Contributed by Nicola Pero - Tue Mar 6 23:05:53 CET 2001 */
+#include <objc/objc.h>
+#include <objc/objc-api.h>
+
+/* Tests creating a RootClass */
+
+@interface RootClass
+{
+ Class isa;
+}
+@end
+
+@implementation RootClass
+@end
+
+#include "class-tests-1.h"
+
+int main (void)
+{
+ test_class_with_superclass ("RootClass", "");
+
+ return 0;
+}
diff --git a/gcc/testsuite/objc/execute/class-10.m b/gcc/testsuite/objc/execute/class-10.m
new file mode 100644
index 00000000000..3d9697c0d86
--- /dev/null
+++ b/gcc/testsuite/objc/execute/class-10.m
@@ -0,0 +1,77 @@
+/* Contributed by Nicola Pero - Tue Mar 6 23:05:53 CET 2001 */
+#include <objc/objc.h>
+#include <objc/objc-api.h>
+
+/* Tests creating a root class and a subclass with an ivar and
+ accessor methods and a subclass overriding the superclass'
+ implementation, and using self to call another method of itself */
+
+@interface RootClass
+{
+ Class isa;
+}
+@end
+
+@implementation RootClass
+@end
+
+@interface SubClass : RootClass
+{
+ int state;
+}
+- (void) setState: (int)number;
+- (int) state;
+@end
+
+@implementation SubClass
+- (void) setState: (int)number
+{
+ state = number;
+}
+- (int) state
+{
+ return state;
+}
+@end
+
+@interface SubSubClass : SubClass
+- (int) shift;
+@end
+
+@implementation SubSubClass
+- (int) state
+{
+ return state + [self shift];
+}
+- (int) shift
+{
+ return 1;
+}
+@end
+
+#include "class-tests-1.h"
+#define TYPE_OF_OBJECT_WITH_ACCESSOR_METHOD SubClass *
+#include "class-tests-2.h"
+
+int main (void)
+{
+ SubClass *object;
+ SubSubClass *sub_object;
+
+ test_class_with_superclass ("SubClass", "RootClass");
+ test_that_class_has_instance_method ("SubClass", @selector (setState:));
+ test_that_class_has_instance_method ("SubClass", @selector (state));
+
+ test_class_with_superclass ("SubSubClass", "SubClass");
+ test_that_class_has_instance_method ("SubSubClass", @selector (setState:));
+ test_that_class_has_instance_method ("SubSubClass", @selector (state));
+ test_that_class_has_instance_method ("SubSubClass", @selector (shift));
+
+ object = class_create_instance (objc_lookup_class ("SubClass"));
+ test_accessor_method (object, 0, -1, -1, 1, 1);
+
+ sub_object = class_create_instance (objc_lookup_class ("SubSubClass"));
+ test_accessor_method (sub_object, 1, -1, 0, 1, 2);
+
+ return 0;
+}
diff --git a/gcc/testsuite/objc/execute/class-11.m b/gcc/testsuite/objc/execute/class-11.m
new file mode 100644
index 00000000000..902db2b9a33
--- /dev/null
+++ b/gcc/testsuite/objc/execute/class-11.m
@@ -0,0 +1,81 @@
+/* Contributed by Nicola Pero - Tue Mar 6 23:05:53 CET 2001 */
+#include <objc/objc.h>
+#include <objc/objc-api.h>
+
+/* Tests creating a root class and a subclass with an ivar and
+ accessor methods and a subclass overriding the superclass'
+ implementation and using self to call another method of itself - in
+ a category */
+
+@interface RootClass
+{
+ Class isa;
+}
+@end
+
+@implementation RootClass
+@end
+
+@interface SubClass : RootClass
+{
+ int state;
+}
+- (void) setState: (int)number;
+- (int) state;
+@end
+
+@implementation SubClass
+- (void) setState: (int)number
+{
+ state = number;
+}
+- (int) state
+{
+ return state;
+}
+@end
+
+@interface SubSubClass : SubClass
+- (int) shift;
+@end
+
+@implementation SubSubClass
+- (int) shift
+{
+ return 1;
+}
+@end
+
+@implementation SubSubClass (Additions)
+- (int) state
+{
+ return state + [self shift];
+}
+@end
+
+#include "class-tests-1.h"
+#define TYPE_OF_OBJECT_WITH_ACCESSOR_METHOD SubClass *
+#include "class-tests-2.h"
+
+int main (void)
+{
+ SubClass *object;
+ SubSubClass *sub_object;
+
+ test_class_with_superclass ("SubClass", "RootClass");
+ test_that_class_has_instance_method ("SubClass", @selector (setState:));
+ test_that_class_has_instance_method ("SubClass", @selector (state));
+
+ test_class_with_superclass ("SubSubClass", "SubClass");
+ test_that_class_has_instance_method ("SubSubClass", @selector (setState:));
+ test_that_class_has_instance_method ("SubSubClass", @selector (state));
+ test_that_class_has_instance_method ("SubSubClass", @selector (shift));
+
+ object = class_create_instance (objc_lookup_class ("SubClass"));
+ test_accessor_method (object, 0, -1, -1, 1, 1);
+
+ sub_object = class_create_instance (objc_lookup_class ("SubSubClass"));
+ test_accessor_method (sub_object, 1, -1, 0, 1, 2);
+
+ return 0;
+}
diff --git a/gcc/testsuite/objc/execute/class-12.m b/gcc/testsuite/objc/execute/class-12.m
new file mode 100644
index 00000000000..e65611df06b
--- /dev/null
+++ b/gcc/testsuite/objc/execute/class-12.m
@@ -0,0 +1,50 @@
+/* Contributed by Nicola Pero - Tue Mar 6 23:05:53 CET 2001 */
+#include <objc/objc.h>
+#include <objc/objc-api.h>
+
+/* Tests creating a root class and a subclass with a class methods */
+
+@interface RootClass
+{
+ Class isa;
+}
+@end
+
+@implementation RootClass
+@end
+
+static int class_variable = 0;
+
+@interface SubClass : RootClass
++ (void) setState: (int)number;
++ (int) state;
+@end
+
+@implementation SubClass
++ (void) setState: (int)number
+{
+ class_variable = number;
+}
++ (int) state
+{
+ return class_variable;
+}
+@end
+
+#include "class-tests-1.h"
+#define TYPE_OF_OBJECT_WITH_ACCESSOR_METHOD Class
+#include "class-tests-2.h"
+
+int main (void)
+{
+ Class class;
+
+ test_class_with_superclass ("SubClass", "RootClass");
+ test_that_class_has_class_method ("SubClass", @selector (setState:));
+ test_that_class_has_class_method ("SubClass", @selector (state));
+
+ class = objc_lookup_class ("SubClass");
+ test_accessor_method (class, 0, -1, -1, 1, 1);
+
+ return 0;
+}
diff --git a/gcc/testsuite/objc/execute/class-13.m b/gcc/testsuite/objc/execute/class-13.m
new file mode 100644
index 00000000000..0d87afd9508
--- /dev/null
+++ b/gcc/testsuite/objc/execute/class-13.m
@@ -0,0 +1,71 @@
+/* Contributed by Nicola Pero - Tue Mar 6 23:05:53 CET 2001 */
+#include <objc/objc.h>
+#include <objc/objc-api.h>
+
+/* Tests creating a root class and a subclass with a class accessor
+ methods and a subclass overriding the superclass' implementation
+ but reusing it with super */
+
+@interface RootClass
+{
+ Class isa;
+}
+@end
+
+@implementation RootClass
+@end
+
+static int class_variable = 0;
+
+@interface SubClass : RootClass
++ (void) setState: (int)number;
++ (int) state;
+@end
+
+@implementation SubClass
++ (void) setState: (int)number
+{
+ class_variable = number;
+}
++ (int) state
+{
+ return class_variable;
+}
+@end
+
+@interface SubSubClass : SubClass
+@end
+
+@implementation SubSubClass
++ (int) state
+{
+ return [super state] + 1;
+}
+@end
+
+#include "class-tests-1.h"
+#define TYPE_OF_OBJECT_WITH_ACCESSOR_METHOD Class
+#include "class-tests-2.h"
+
+int main (void)
+{
+ Class class;
+ Class sub_class;
+
+ test_class_with_superclass ("SubClass", "RootClass");
+ test_that_class_has_class_method ("SubClass", @selector (setState:));
+ test_that_class_has_class_method ("SubClass", @selector (state));
+
+ test_class_with_superclass ("SubSubClass", "SubClass");
+ test_that_class_has_class_method ("SubSubClass", @selector (setState:));
+ test_that_class_has_class_method ("SubSubClass", @selector (state));
+
+ class = objc_lookup_class ("SubClass");
+ test_accessor_method (class, 0, -1, -1, 1, 1);
+
+ sub_class = objc_lookup_class ("SubSubClass");
+ class_variable = 0;
+ test_accessor_method (sub_class, 1, -1, 0, 1, 2);
+
+ return 0;
+}
diff --git a/gcc/testsuite/objc/execute/class-14.m b/gcc/testsuite/objc/execute/class-14.m
new file mode 100644
index 00000000000..2827031358c
--- /dev/null
+++ b/gcc/testsuite/objc/execute/class-14.m
@@ -0,0 +1,76 @@
+/* Contributed by Nicola Pero - Tue Mar 6 23:05:53 CET 2001 */
+#include <objc/objc.h>
+#include <objc/objc-api.h>
+
+/* Tests creating a root class and a subclass with a class accessor
+ methods and a subclass overriding the superclass' implementation,
+ and using self to call another method of itself */
+
+@interface RootClass
+{
+ Class isa;
+}
+@end
+
+@implementation RootClass
+@end
+
+static int class_variable = 0;
+
+@interface SubClass : RootClass
++ (void) setState: (int)number;
++ (int) state;
+@end
+
+@implementation SubClass
++ (void) setState: (int)number
+{
+ class_variable = number;
+}
++ (int) state
+{
+ return class_variable;
+}
+@end
+
+@interface SubSubClass : SubClass
++ (int) shift;
+@end
+
+@implementation SubSubClass
++ (int) state
+{
+ return class_variable + [self shift];
+}
++ (int) shift
+{
+ return 1;
+}
+@end
+
+#include "class-tests-1.h"
+#define TYPE_OF_OBJECT_WITH_ACCESSOR_METHOD Class
+#include "class-tests-2.h"
+
+int main (void)
+{
+ Class class, sub_class;
+
+ test_class_with_superclass ("SubClass", "RootClass");
+ test_that_class_has_class_method ("SubClass", @selector (setState:));
+ test_that_class_has_class_method ("SubClass", @selector (state));
+
+ test_class_with_superclass ("SubSubClass", "SubClass");
+ test_that_class_has_class_method ("SubSubClass", @selector (setState:));
+ test_that_class_has_class_method ("SubSubClass", @selector (state));
+ test_that_class_has_class_method ("SubSubClass", @selector (shift));
+
+ class = objc_lookup_class ("SubClass");
+ test_accessor_method (class, 0, -1, -1, 1, 1);
+
+ sub_class = objc_lookup_class ("SubSubClass");
+ class_variable = 0;
+ test_accessor_method (sub_class, 1, -1, 0, 1, 2);
+
+ return 0;
+}
diff --git a/gcc/testsuite/objc/execute/class-2.m b/gcc/testsuite/objc/execute/class-2.m
new file mode 100644
index 00000000000..cb8b47fa1a3
--- /dev/null
+++ b/gcc/testsuite/objc/execute/class-2.m
@@ -0,0 +1,29 @@
+/* Contributed by Nicola Pero - Tue Mar 6 23:05:53 CET 2001 */
+#include <objc/objc.h>
+#include <objc/objc-api.h>
+
+/* Tests creating a root class and a subclass */
+
+@interface RootClass
+{
+ Class isa;
+}
+@end
+
+@implementation RootClass
+@end
+
+@interface SubClass : RootClass
+@end
+
+@implementation SubClass
+@end
+
+#include "class-tests-1.h"
+
+int main (void)
+{
+ test_class_with_superclass ("SubClass", "RootClass");
+
+ return 0;
+}
diff --git a/gcc/testsuite/objc/execute/class-3.m b/gcc/testsuite/objc/execute/class-3.m
new file mode 100644
index 00000000000..dbe68bf9037
--- /dev/null
+++ b/gcc/testsuite/objc/execute/class-3.m
@@ -0,0 +1,43 @@
+/* Contributed by Nicola Pero - Tue Mar 6 23:05:53 CET 2001 */
+#include <objc/objc.h>
+#include <objc/objc-api.h>
+
+/* Tests creating a root class and a minimal subclass tree */
+
+@interface RootClass
+{
+ Class isa;
+}
+@end
+
+@implementation RootClass
+@end
+
+@interface SubClassA : RootClass
+@end
+
+@implementation SubClassA
+@end
+
+@interface SubClassB : RootClass
+@end
+
+@implementation SubClassB
+@end
+
+@interface SubSubClass : SubClassA
+@end
+
+@implementation SubSubClass
+@end
+
+#include "class-tests-1.h"
+
+int main (void)
+{
+ test_class_with_superclass ("SubClassA", "RootClass");
+ test_class_with_superclass ("SubClassB", "RootClass");
+ test_class_with_superclass ("SubSubClass", "SubClassA");
+
+ return 0;
+}
diff --git a/gcc/testsuite/objc/execute/class-4.m b/gcc/testsuite/objc/execute/class-4.m
new file mode 100644
index 00000000000..0ae723c035b
--- /dev/null
+++ b/gcc/testsuite/objc/execute/class-4.m
@@ -0,0 +1,52 @@
+/* Contributed by Nicola Pero - Tue Mar 6 23:05:53 CET 2001 */
+#include <objc/objc.h>
+#include <objc/objc-api.h>
+
+/* Tests creating a root class and a subclass with an ivar and
+ accessor methods */
+
+@interface RootClass
+{
+ Class isa;
+}
+@end
+
+@implementation RootClass
+@end
+
+@interface SubClass : RootClass
+{
+ int state;
+}
+- (void) setState: (int)number;
+- (int) state;
+@end
+
+@implementation SubClass
+- (void) setState: (int)number
+{
+ state = number;
+}
+- (int) state
+{
+ return state;
+}
+@end
+
+#include "class-tests-1.h"
+#define TYPE_OF_OBJECT_WITH_ACCESSOR_METHOD SubClass *
+#include "class-tests-2.h"
+
+int main (void)
+{
+ SubClass *object;
+
+ test_class_with_superclass ("SubClass", "RootClass");
+ test_that_class_has_instance_method ("SubClass", @selector (setState:));
+ test_that_class_has_instance_method ("SubClass", @selector (state));
+
+ object = class_create_instance (objc_lookup_class ("SubClass"));
+ test_accessor_method (object, 0, 1, 1, -3, -3);
+
+ return 0;
+}
diff --git a/gcc/testsuite/objc/execute/class-5.m b/gcc/testsuite/objc/execute/class-5.m
new file mode 100644
index 00000000000..5d5297f6247
--- /dev/null
+++ b/gcc/testsuite/objc/execute/class-5.m
@@ -0,0 +1,71 @@
+/* Contributed by Nicola Pero - Tue Mar 6 23:05:53 CET 2001 */
+#include <objc/objc.h>
+#include <objc/objc-api.h>
+
+/* Tests creating a root class and a subclass with an ivar and
+ accessor methods and a subclass overriding the superclass'
+ implementation */
+
+@interface RootClass
+{
+ Class isa;
+}
+@end
+
+@implementation RootClass
+@end
+
+@interface SubClass : RootClass
+{
+ int state;
+}
+- (void) setState: (int)number;
+- (int) state;
+@end
+
+@implementation SubClass
+- (void) setState: (int)number
+{
+ state = number;
+}
+- (int) state
+{
+ return state;
+}
+@end
+
+@interface SubSubClass : SubClass
+@end
+
+@implementation SubSubClass
+- (int) state
+{
+ return state + 1;
+}
+@end
+
+#include "class-tests-1.h"
+#define TYPE_OF_OBJECT_WITH_ACCESSOR_METHOD SubClass *
+#include "class-tests-2.h"
+
+int main (void)
+{
+ SubClass *object;
+ SubSubClass *sub_object;
+
+ test_class_with_superclass ("SubClass", "RootClass");
+ test_that_class_has_instance_method ("SubClass", @selector (setState:));
+ test_that_class_has_instance_method ("SubClass", @selector (state));
+
+ test_class_with_superclass ("SubSubClass", "SubClass");
+ test_that_class_has_instance_method ("SubSubClass", @selector (setState:));
+ test_that_class_has_instance_method ("SubSubClass", @selector (state));
+
+ object = class_create_instance (objc_lookup_class ("SubClass"));
+ test_accessor_method (object, 0, -1, -1, 1, 1);
+
+ sub_object = class_create_instance (objc_lookup_class ("SubSubClass"));
+ test_accessor_method (sub_object, 1, -1, 0, 1, 2);
+
+ return 0;
+}
diff --git a/gcc/testsuite/objc/execute/class-6.m b/gcc/testsuite/objc/execute/class-6.m
new file mode 100644
index 00000000000..f60912aa608
--- /dev/null
+++ b/gcc/testsuite/objc/execute/class-6.m
@@ -0,0 +1,71 @@
+/* Contributed by Nicola Pero - Tue Mar 6 23:05:53 CET 2001 */
+#include <objc/objc.h>
+#include <objc/objc-api.h>
+
+/* Tests creating a root class and a subclass with an ivar and
+ accessor methods and a subclass overriding the superclass'
+ implementation but reusing it with super */
+
+@interface RootClass
+{
+ Class isa;
+}
+@end
+
+@implementation RootClass
+@end
+
+@interface SubClass : RootClass
+{
+ int state;
+}
+- (void) setState: (int)number;
+- (int) state;
+@end
+
+@implementation SubClass
+- (void) setState: (int)number
+{
+ state = number;
+}
+- (int) state
+{
+ return state;
+}
+@end
+
+@interface SubSubClass : SubClass
+@end
+
+@implementation SubSubClass
+- (int) state
+{
+ return [super state] + 1;
+}
+@end
+
+#include "class-tests-1.h"
+#define TYPE_OF_OBJECT_WITH_ACCESSOR_METHOD SubClass *
+#include "class-tests-2.h"
+
+int main (void)
+{
+ SubClass *object;
+ SubSubClass *sub_object;
+
+ test_class_with_superclass ("SubClass", "RootClass");
+ test_that_class_has_instance_method ("SubClass", @selector (setState:));
+ test_that_class_has_instance_method ("SubClass", @selector (state));
+
+ test_class_with_superclass ("SubSubClass", "SubClass");
+ test_that_class_has_instance_method ("SubSubClass", @selector (setState:));
+ test_that_class_has_instance_method ("SubSubClass", @selector (state));
+
+ object = class_create_instance (objc_lookup_class ("SubClass"));
+ test_accessor_method (object, 0, -1, -1, 1, 1);
+
+ sub_object = class_create_instance (objc_lookup_class ("SubSubClass"));
+ test_accessor_method (sub_object, 1, -1, 0, 1, 2);
+
+ return 0;
+}
diff --git a/gcc/testsuite/objc/execute/class-7.m b/gcc/testsuite/objc/execute/class-7.m
new file mode 100644
index 00000000000..9a2fe0cff41
--- /dev/null
+++ b/gcc/testsuite/objc/execute/class-7.m
@@ -0,0 +1,59 @@
+/* Contributed by Nicola Pero - Tue Mar 6 23:05:53 CET 2001 */
+#include <objc/objc.h>
+#include <objc/objc-api.h>
+
+/* Tests creating a root class and a subclass with an ivar and
+ accessor methods; accessor methods implemented in a separate
+ category */
+
+@interface RootClass
+{
+ Class isa;
+}
+@end
+
+@implementation RootClass
+@end
+
+@interface SubClass : RootClass
+{
+ int state;
+}
+@end
+
+@implementation SubClass
+@end
+
+@interface SubClass (Additions)
+- (void) setState: (int)number;
+- (int) state;
+@end
+
+@implementation SubClass (Additions)
+- (void) setState: (int)number
+{
+ state = number;
+}
+- (int) state
+{
+ return state;
+}
+@end
+
+#include "class-tests-1.h"
+#define TYPE_OF_OBJECT_WITH_ACCESSOR_METHOD SubClass *
+#include "class-tests-2.h"
+
+int main (void)
+{
+ SubClass *object;
+
+ test_class_with_superclass ("SubClass", "RootClass");
+ test_that_class_has_instance_method ("SubClass", @selector (setState:));
+ test_that_class_has_instance_method ("SubClass", @selector (state));
+
+ object = class_create_instance (objc_lookup_class ("SubClass"));
+ test_accessor_method (object, 0, 1, 1, -3, -3);
+
+ return 0;
+}
diff --git a/gcc/testsuite/objc/execute/class-8.m b/gcc/testsuite/objc/execute/class-8.m
new file mode 100644
index 00000000000..fa111850213
--- /dev/null
+++ b/gcc/testsuite/objc/execute/class-8.m
@@ -0,0 +1,74 @@
+/* Contributed by Nicola Pero - Tue Mar 6 23:05:53 CET 2001 */
+#include <objc/objc.h>
+#include <objc/objc-api.h>
+
+/* Tests creating a root class and a subclass with an ivar and
+ accessor methods and a subclass overriding the superclass'
+ implementation - in a category */
+
+@interface RootClass
+{
+ Class isa;
+}
+@end
+
+@implementation RootClass
+@end
+
+@interface SubClass : RootClass
+{
+ int state;
+}
+- (void) setState: (int)number;
+- (int) state;
+@end
+
+@implementation SubClass
+- (void) setState: (int)number
+{
+ state = number;
+}
+- (int) state
+{
+ return state;
+}
+@end
+
+@interface SubSubClass : SubClass
+@end
+
+@implementation SubSubClass
+@end
+
+@implementation SubSubClass (Additions)
+- (int) state
+{
+ return state + 1;
+}
+@end
+
+#include "class-tests-1.h"
+#define TYPE_OF_OBJECT_WITH_ACCESSOR_METHOD SubClass *
+#include "class-tests-2.h"
+
+int main (void)
+{
+ SubClass *object;
+ SubSubClass *sub_object;
+
+ test_class_with_superclass ("SubClass", "RootClass");
+ test_that_class_has_instance_method ("SubClass", @selector (setState:));
+ test_that_class_has_instance_method ("SubClass", @selector (state));
+
+ test_class_with_superclass ("SubSubClass", "SubClass");
+ test_that_class_has_instance_method ("SubSubClass", @selector (setState:));
+ test_that_class_has_instance_method ("SubSubClass", @selector (state));
+
+ object = class_create_instance (objc_lookup_class ("SubClass"));
+ test_accessor_method (object, 0, -1, -1, 1, 1);
+
+ sub_object = class_create_instance (objc_lookup_class ("SubSubClass"));
+ test_accessor_method (sub_object, 1, -1, 0, 1, 2);
+
+ return 0;
+}
diff --git a/gcc/testsuite/objc/execute/class-9.m b/gcc/testsuite/objc/execute/class-9.m
new file mode 100644
index 00000000000..bb405fbc982
--- /dev/null
+++ b/gcc/testsuite/objc/execute/class-9.m
@@ -0,0 +1,74 @@
+/* Contributed by Nicola Pero - Tue Mar 6 23:05:53 CET 2001 */
+#include <objc/objc.h>
+#include <objc/objc-api.h>
+
+/* Tests creating a root class and a subclass with an ivar and
+ accessor methods and a subclass overriding the superclass'
+ implementation but reusing it with super - in a category */
+
+@interface RootClass
+{
+ Class isa;
+}
+@end
+
+@implementation RootClass
+@end
+
+@interface SubClass : RootClass
+{
+ int state;
+}
+- (void) setState: (int)number;
+- (int) state;
+@end
+
+@implementation SubClass
+- (void) setState: (int)number
+{
+ state = number;
+}
+- (int) state
+{
+ return state;
+}
+@end
+
+@interface SubSubClass : SubClass
+@end
+
+@implementation SubSubClass
+@end
+
+@implementation SubSubClass (Additions)
+- (int) state
+{
+ return [super state] + 1;
+}
+@end
+
+#include "class-tests-1.h"
+#define TYPE_OF_OBJECT_WITH_ACCESSOR_METHOD SubClass *
+#include "class-tests-2.h"
+
+int main (void)
+{
+ SubClass *object;
+ SubSubClass *sub_object;
+
+ test_class_with_superclass ("SubClass", "RootClass");
+ test_that_class_has_instance_method ("SubClass", @selector (setState:));
+ test_that_class_has_instance_method ("SubClass", @selector (state));
+
+ test_class_with_superclass ("SubSubClass", "SubClass");
+ test_that_class_has_instance_method ("SubSubClass", @selector (setState:));
+ test_that_class_has_instance_method ("SubSubClass", @selector (state));
+
+ object = class_create_instance (objc_lookup_class ("SubClass"));
+ test_accessor_method (object, 0, -1, -1, 1, 1);
+
+ sub_object = class_create_instance (objc_lookup_class ("SubSubClass"));
+ test_accessor_method (sub_object, 1, -1, 0, 1, 2);
+
+ return 0;
+}
diff --git a/gcc/testsuite/objc/execute/class-tests-1.h b/gcc/testsuite/objc/execute/class-tests-1.h
new file mode 100644
index 00000000000..f321df4f335
--- /dev/null
+++ b/gcc/testsuite/objc/execute/class-tests-1.h
@@ -0,0 +1,137 @@
+/* Contributed by Nicola Pero on Tue Mar 6 23:05:53 CET 2001 */
+#include <objc/objc.h>
+#include <objc/objc-api.h>
+#include <objc/Object.h>
+#include <stdlib.h>
+
+/*
+ * Standard Tests For Classes and Objects - abort upon failing; return
+ * normally if all is well.
+ */
+
+/* Test that `class' is a Class */
+static void test_is_class (Class class)
+{
+ if (object_is_class (class) == NO)
+ {
+ printf ("test_is_class failed\n");
+ abort ();
+ }
+
+ if (class_is_class (class) == NO)
+ {
+ printf ("test_is_class failed\n");
+ abort ();
+ }
+}
+
+/* Test that the superclass of `class' is `superclass' */
+static void test_superclass (Class class, Class superclass)
+{
+ if (class_get_super_class (class) != superclass)
+ {
+ printf ("test_superclass failed\n");
+ abort ();
+ }
+}
+
+/* Test that the classname of `class' is `classname' */
+static void test_class_name (Class class, const char *classname)
+{
+ if (strcmp (class_get_class_name (class), classname))
+ {
+ printf ("test_class_name failed\n");
+ abort ();
+ }
+}
+
+/* Test that we can allocate instances of `class' */
+static void test_allocate (Class class)
+{
+ /* The object we create is leaked but who cares, this is only a test */
+ id object = class_create_instance (class);
+
+ if (object == nil)
+ {
+ printf ("test_allocate failed\n");
+ abort ();
+ }
+}
+
+/* Test that instances of `class' are instances and not classes */
+static void test_instances (Class class)
+{
+ id object = class_create_instance (class);
+
+ if (object_is_class (object) == YES)
+ {
+ printf ("test_instances failed\n");
+ abort ();
+ }
+}
+
+/* Test that we can deallocate instances of `class' */
+static void test_deallocate (Class class)
+{
+ id object = class_create_instance (class);
+
+ object_dispose (object);
+}
+
+/* Test that the object and the class agree on what the class is */
+static void test_object_class (Class class)
+{
+ id object = class_create_instance (class);
+
+ if (object_get_class (object) != class)
+ {
+ printf ("test_object_class failed\n");
+ abort ();
+ }
+}
+
+/* Test that the object and the class agree on what the superclass is */
+static void test_object_super_class (Class class)
+{
+ id object = class_create_instance (class);
+
+ if (object_get_super_class (object) != class_get_super_class (class))
+ {
+ printf ("test_object_super_class failed\n");
+ abort ();
+ }
+}
+
+/*
+ * Runs all the tests in this file for the specified class
+ */
+void test_class_with_superclass (const char *class_name,
+ const char *superclass_name)
+{
+ Class class;
+ Class superclass;
+
+ /* We need at least a method call before playing with the internals,
+ so that the runtime will call __objc_resolve_class_links () */
+ [Object initialize];
+
+ /* class_name must be an existing class */
+ class = objc_lookup_class (class_name);
+ test_is_class (class);
+
+ /* But superclass_name can be "", which means `Nil' */
+ superclass = objc_lookup_class (superclass_name);
+ if (superclass != Nil)
+ {
+ test_is_class (superclass);
+ }
+
+ /* Now the tests */
+ test_superclass (class, superclass);
+ test_class_name (class, class_name);
+ test_allocate (class);
+ test_instances (class);
+ test_deallocate (class);
+ test_object_class (class);
+ test_object_super_class (class);
+}
diff --git a/gcc/testsuite/objc/execute/class-tests-2.h b/gcc/testsuite/objc/execute/class-tests-2.h
new file mode 100644
index 00000000000..6df91df2b6e
--- /dev/null
+++ b/gcc/testsuite/objc/execute/class-tests-2.h
@@ -0,0 +1,67 @@
+/* Contributed by Nicola Pero on Tue Mar 6 23:05:53 CET 2001 */
+#include <objc/objc.h>
+#include <objc/objc-api.h>
+#include <stdlib.h>
+
+/*
+ * Standard Tests For Methods of Classes and Objects - abort upon
+ * failing; return normally if all is well.
+ */
+
+/* Test that `class' has an instance method for the selector `selector' */
+void test_that_class_has_instance_method (const char *class_name,
+ SEL selector)
+{
+ Class class = objc_lookup_class (class_name);
+
+ if (class_get_instance_method (class, selector) == NULL)
+ {
+ printf ("test_class_has_instance_method failed\n");
+ abort ();
+ }
+}
+
+/* Test that `class' has a class method for the selector `selector' */
+void test_that_class_has_class_method (const char *class_name,
+ SEL selector)
+{
+ Class meta_class = objc_get_meta_class (class_name);
+
+ if (class_get_class_method (meta_class, selector) == NULL)
+ {
+ printf ("test_class_has_class_method failed\n");
+ abort ();
+ }
+}
+
+/* Test the accessor methods (called -state and -setState:) on the
+ object `object'. */
+#ifdef TYPE_OF_OBJECT_WITH_ACCESSOR_METHOD
+void test_accessor_method (TYPE_OF_OBJECT_WITH_ACCESSOR_METHOD object,
+ int initial_state,
+ int new_state_0, int expected_result_0,
+ int new_state_1, int expected_result_1)
+{
+ if ([object state] != initial_state)
+ {
+ printf ("test_accessor_method (initial state) failed\n");
+ abort ();
+ }
+
+ [object setState: new_state_0];
+ if ([object state] != expected_result_0)
+ {
+ printf ("test_accessor_method (new_state_0) failed\n");
+ abort ();
+ }
+
+ [object setState: new_state_1];
+ if ([object state] != expected_result_1)
+ {
+ printf ("test_accessor_method (new_state_1) failed\n");
+ abort ();
+ }
+}
+#endif CLASS_WITH_ACCESSOR_METHOD
+
+
diff --git a/gcc/testsuite/objc/execute/compatibility_alias.m b/gcc/testsuite/objc/execute/compatibility_alias.m
new file mode 100644
index 00000000000..24f47712eec
--- /dev/null
+++ b/gcc/testsuite/objc/execute/compatibility_alias.m
@@ -0,0 +1,12 @@
+/* Contributed by Nicola Pero - Thu Mar 8 17:23:59 CET 2001 */
+#include <objc/objc.h>
+#include <objc/Object.h>
+
+@compatibility_alias MyObject Object;
+
+int main (void)
+{
+ MyObject *object = [MyObject alloc];
+
+ return 0;
+}
diff --git a/gcc/testsuite/objc/execute/encode-1.m b/gcc/testsuite/objc/execute/encode-1.m
new file mode 100644
index 00000000000..3f232c9cdd2
--- /dev/null
+++ b/gcc/testsuite/objc/execute/encode-1.m
@@ -0,0 +1,31 @@
+/* Contributed by Nicola Pero - Thu Mar 8 16:27:46 CET 2001 */
+#include <objc/objc.h>
+#include <objc/objc-api.h>
+#include <objc/Object.h>
+
+/* Test very simple @encode */
+
+int main (void)
+{
+ if (strcmp ("i", @encode (int)))
+ {
+ abort ();
+ }
+
+ if (strcmp ("@", @encode (id)))
+ {
+ abort ();
+ }
+
+ if (strcmp ("@", @encode (Object *)))
+ {
+ abort ();
+ }
+
+ if (strcmp (":", @encode (SEL)))
+ {
+ abort ();
+ }
+
+ return 0;
+}
diff --git a/gcc/testsuite/objc/execute/formal_protocol-1.m b/gcc/testsuite/objc/execute/formal_protocol-1.m
new file mode 100644
index 00000000000..1fde38b794d
--- /dev/null
+++ b/gcc/testsuite/objc/execute/formal_protocol-1.m
@@ -0,0 +1,44 @@
+/* Contributed by Nicola Pero - Fri Mar 9 21:35:47 CET 2001 */
+#include <objc/objc.h>
+#include <objc/Object.h>
+
+/* Tests defining a protocol and a class adopting it */
+
+@protocol Enabling
+- (BOOL) isEnabled;
+- (void) setEnabled: (BOOL)flag;
+@end
+
+@interface Feature : Object <Enabling>
+{
+ const char *name;
+ BOOL isEnabled;
+}
+@end
+
+@implementation Feature
+- (BOOL) isEnabled
+{
+ return isEnabled;
+}
+- (void) setEnabled: (BOOL)flag
+{
+ isEnabled = flag;
+}
+@end
+
+int main (void)
+{
+ Feature *object;
+
+ object = [Feature new];
+
+ [object setEnabled: YES];
+ if (![object isEnabled])
+ {
+ abort ();
+ }
+
+ return 0;
+}
+
diff --git a/gcc/testsuite/objc/execute/formal_protocol-2.m b/gcc/testsuite/objc/execute/formal_protocol-2.m
new file mode 100644
index 00000000000..f399555ed14
--- /dev/null
+++ b/gcc/testsuite/objc/execute/formal_protocol-2.m
@@ -0,0 +1,45 @@
+/* Contributed by Nicola Pero - Fri Mar 9 21:35:47 CET 2001 */
+#include <objc/objc.h>
+#include <objc/Object.h>
+
+/* Test defining a protocol, a class adopting it, and using an object
+ of type `id <protocol>'. */
+
+@protocol Enabling
+- (BOOL) isEnabled;
+- (void) setEnabled: (BOOL)flag;
+@end
+
+@interface Feature : Object <Enabling>
+{
+ const char *name;
+ BOOL isEnabled;
+}
+@end
+
+@implementation Feature
+- (BOOL) isEnabled
+{
+ return isEnabled;
+}
+- (void) setEnabled: (BOOL)flag
+{
+ isEnabled = flag;
+}
+@end
+
+int main (void)
+{
+ id <Enabling> object;
+
+ object = [Feature new];
+
+ [object setEnabled: YES];
+ if (![object isEnabled])
+ {
+ abort ();
+ }
+
+ return 0;
+}
+
diff --git a/gcc/testsuite/objc/execute/formal_protocol-3.m b/gcc/testsuite/objc/execute/formal_protocol-3.m
new file mode 100644
index 00000000000..9fc2a768ded
--- /dev/null
+++ b/gcc/testsuite/objc/execute/formal_protocol-3.m
@@ -0,0 +1,58 @@
+/* Contributed by Nicola Pero - Fri Mar 9 21:35:47 CET 2001 */
+#include <objc/objc.h>
+#include <objc/Object.h>
+
+/* Test defining two protocol, a class adopting both of them,
+ and using an object of type `id <Protocol1, Protocol2>' */
+
+@protocol Enabling
+- (BOOL) isEnabled;
+- (void) setEnabled: (BOOL)flag;
+@end
+
+@protocol Evaluating
+- (int) importance;
+@end
+
+@interface Feature : Object <Enabling, Evaluating>
+{
+ const char *name;
+ BOOL isEnabled;
+}
+@end
+
+@implementation Feature
+- (BOOL) isEnabled
+{
+ return isEnabled;
+}
+- (void) setEnabled: (BOOL)flag
+{
+ isEnabled = flag;
+}
+- (int) importance
+{
+ return 1000;
+}
+@end
+
+int main (void)
+{
+ id <Enabling, Evaluating> object;
+
+ object = [Feature new];
+
+ [object setEnabled: YES];
+ if (![object isEnabled])
+ {
+ abort ();
+ }
+
+ if ([object importance] != 1000)
+ {
+ abort ();
+ }
+
+ return 0;
+}
+
diff --git a/gcc/testsuite/objc/execute/formal_protocol-4.m b/gcc/testsuite/objc/execute/formal_protocol-4.m
new file mode 100644
index 00000000000..af79606c065
--- /dev/null
+++ b/gcc/testsuite/objc/execute/formal_protocol-4.m
@@ -0,0 +1,40 @@
+/* Contributed by Nicola Pero - Fri Mar 9 21:35:47 CET 2001 */
+#include <objc/objc.h>
+#include <objc/Object.h>
+
+/* Test defining a protocol, a class adopting it in a category */
+
+@protocol Evaluating
+- (int) importance;
+@end
+
+@interface Feature : Object
+@end
+
+@implementation Feature
+@end
+
+@interface Feature (EvaluatingProtocol) <Evaluating>
+@end
+
+@implementation Feature (EvaluatingProtocol)
+- (int) importance
+{
+ return 1000;
+}
+@end
+
+int main (void)
+{
+ id <Evaluating> object;
+
+ object = [Feature new];
+
+ if ([object importance] != 1000)
+ {
+ abort ();
+ }
+
+ return 0;
+}
+
diff --git a/gcc/testsuite/objc/execute/formal_protocol-5.m b/gcc/testsuite/objc/execute/formal_protocol-5.m
new file mode 100644
index 00000000000..3d9f778fe63
--- /dev/null
+++ b/gcc/testsuite/objc/execute/formal_protocol-5.m
@@ -0,0 +1,33 @@
+/* Contributed by Nicola Pero - Fri Mar 9 21:35:47 CET 2001 */
+#include <objc/objc.h>
+#include <objc/Protocol.h>
+
+/* Test defining a protocol, and accessing it using @protocol */
+
+@protocol Evaluating
+- (int) importance;
+@end
+
+/* A class adopting the protocol */
+@interface Test <Evaluating>
+@end
+
+@implementation Test
+- (int) importance
+{
+ return 1000;
+}
+@end
+
+int main (void)
+{
+ Protocol *protocol = @protocol (Evaluating);
+
+ if (strcmp ([protocol name], "Evaluating"))
+ {
+ abort ();
+ }
+
+ return 0;
+}
+
diff --git a/gcc/testsuite/objc/execute/formal_protocol-6.cexp b/gcc/testsuite/objc/execute/formal_protocol-6.cexp
new file mode 100644
index 00000000000..2f397b96e51
--- /dev/null
+++ b/gcc/testsuite/objc/execute/formal_protocol-6.cexp
@@ -0,0 +1,2 @@
+set torture_execute_xfail "*-*-*"
+return 0
diff --git a/gcc/testsuite/objc/execute/formal_protocol-6.m b/gcc/testsuite/objc/execute/formal_protocol-6.m
new file mode 100644
index 00000000000..7873fdcdf39
--- /dev/null
+++ b/gcc/testsuite/objc/execute/formal_protocol-6.m
@@ -0,0 +1,25 @@
+/* Contributed by Nicola Pero - Fri Mar 9 21:35:47 CET 2001 */
+#include <objc/objc.h>
+#include <objc/Protocol.h>
+
+/* Test defining a protocol, and accessing it using @protocol */
+
+@protocol Evaluating
+- (int) importance;
+@end
+
+/* Without a class adopting the protocol - this doesn't work
+ with gcc-2.95.2 as well */
+
+int main (void)
+{
+ Protocol *protocol = @protocol (Evaluating);
+
+ if (strcmp ([protocol name], "Evaluating"))
+ {
+ abort ();
+ }
+
+ return 0;
+}
+
diff --git a/gcc/testsuite/objc/execute/formal_protocol-7.m b/gcc/testsuite/objc/execute/formal_protocol-7.m
new file mode 100644
index 00000000000..14d7594e163
--- /dev/null
+++ b/gcc/testsuite/objc/execute/formal_protocol-7.m
@@ -0,0 +1,44 @@
+/* Contributed by Nicola Pero - Fri Mar 9 21:35:47 CET 2001 */
+#include <objc/objc.h>
+#include <objc/Object.h>
+#include <objc/Protocol.h>
+
+/* Test defining two protocols, one incorporating the other one. */
+
+@protocol Configuring
+- (void) configure;
+@end
+
+@protocol Processing <Configuring>
+- (void) process;
+@end
+
+/* A class adopting the protocol */
+@interface Test : Object <Processing>
+{
+ BOOL didConfigure;
+ BOOL didProcess;
+}
+@end
+
+@implementation Test
+- (void) configure
+{
+ didConfigure = YES;
+}
+- (void) process
+{
+ didProcess = YES;
+}
+@end
+
+int main (void)
+{
+ id <Processing> object = [Test new];
+
+ [object configure];
+ [object process];
+
+ return 0;
+}
+
diff --git a/gcc/testsuite/objc/execute/informal_protocol.m b/gcc/testsuite/objc/execute/informal_protocol.m
new file mode 100644
index 00000000000..9815053a2e9
--- /dev/null
+++ b/gcc/testsuite/objc/execute/informal_protocol.m
@@ -0,0 +1,13 @@
+/* Contributed by Nicola Pero - Fri Mar 9 21:35:47 CET 2001 */
+#include <objc/objc.h>
+#include <objc/Object.h>
+
+@interface Object (StopProtocol)
+- (void) stop;
+@end
+
+int main (void)
+{
+ return 0;
+}
+
diff --git a/gcc/testsuite/objc/execute/initialize.m b/gcc/testsuite/objc/execute/initialize.m
new file mode 100644
index 00000000000..53783982970
--- /dev/null
+++ b/gcc/testsuite/objc/execute/initialize.m
@@ -0,0 +1,36 @@
+/* Contributed by Nicola Pero - Wed Mar 7 17:55:04 CET 2001 */
+#include <objc/objc.h>
+
+/* Test that +initialize is automatically called before the class is
+ accessed */
+
+static int class_variable = 0;
+
+@interface TestClass
+{
+ Class isa;
+}
++ (void) initialize;
++ (int) classVariable;
+@end
+
+@implementation TestClass
++ (void) initialize
+{
+ class_variable = 1;
+}
++ (int) classVariable
+{
+ return class_variable;
+}
+@end
+
+int main (void)
+{
+ if ([TestClass classVariable] != 1)
+ {
+ abort ();
+ }
+
+ return 0;
+}
diff --git a/gcc/testsuite/objc/execute/load-2.m b/gcc/testsuite/objc/execute/load-2.m
new file mode 100644
index 00000000000..eb90658367e
--- /dev/null
+++ b/gcc/testsuite/objc/execute/load-2.m
@@ -0,0 +1,46 @@
+/* Contributed by Nicola Pero - Wed Jun 6 14:34:23 CEST 2001 */
+#include <objc/objc.h>
+
+/* Test that +load is automatically called before main is run;
+ on two different classes. */
+
+static int static_variable1 = 0;
+static int static_variable2 = 0;
+
+@interface TestClass1
+{
+ Class isa;
+}
++ (void) load;
+@end
+
+@implementation TestClass1
++ (void) load
+{
+ static_variable1 = 1;
+}
+@end
+
+@interface TestClass2
+{
+ Class isa;
+}
++ (void) load;
+@end
+
+@implementation TestClass2
++ (void) load
+{
+ static_variable2 = 1;
+}
+@end
+
+int main (void)
+{
+ if (static_variable1 != 1 || static_variable2 != 1)
+ {
+ abort ();
+ }
+
+ return 0;
+}
diff --git a/gcc/testsuite/objc/execute/load-3.m b/gcc/testsuite/objc/execute/load-3.m
new file mode 100644
index 00000000000..e7543930a73
--- /dev/null
+++ b/gcc/testsuite/objc/execute/load-3.m
@@ -0,0 +1,108 @@
+/*
+ load-3.m
+
+ Author: Ovidiu Predescu <ovidiu@cup.hp.com>
+ Date: June 3, 2001
+
+ Test if the +load methods are invoked, and are invoked in the
+ proper order.
+ */
+
+#include <objc/objc.h>
+#include <objc/Object.h>
+
+@interface A : Object
+@end
+
+@interface B : A
+@end
+
+static a_load = 0;
+static b_load = 0;
+static a_category_load = 0;
+static b_category_load = 0;
+
+@implementation A (Category)
++ (void)load
+{
+ a_category_load = 1;
+ printf("+[A(Category) load]\n");
+
+ if (a_load != 1)
+ {
+ printf("+load for A(Category) invoked before A's!\n");
+ abort();
+ }
+}
+@end
+
+@implementation B(Category)
++ (void)load
+{
+ b_category_load = 1;
+ printf("+[B(Category) load]\n");
+
+ if (b_load != 1)
+ {
+ printf ("+load for B(Category) invoked before B!\n");
+ abort();
+ }
+}
+@end
+
+@implementation B
++ (void)load
+{
+ b_load = 1;
+ printf("+[B load]\n");
+
+ if (a_load != 1)
+ {
+ printf("+load for B invoked before A's!\n");
+ abort();
+ }
+
+ if (b_category_load != 0)
+ {
+ printf("+load for B invoked after B(Category)!\n");
+ abort();
+ }
+}
+@end
+
+@implementation A
++ (void)load
+{
+ a_load = 1;
+ printf("+[A load]\n");
+
+ if (a_category_load != 0)
+ {
+ printf("+load for A(Category) invoked before A!\n");
+ abort();
+ }
+
+ if (b_load != 0)
+ {
+ printf("+load for A invoked after B!\n");
+ abort();
+ }
+
+ if (b_category_load != 0)
+ {
+ printf("+load for B(Category) invoked before A and B!\n");
+ abort();
+ }
+}
+@end
+
+int main (void)
+{
+ if (a_load + b_load + a_category_load + b_category_load != 4)
+ {
+ printf("Not all +load methods invoked!\n");
+ abort();
+ }
+
+ return 0;
+}
diff --git a/gcc/testsuite/objc/execute/load.m b/gcc/testsuite/objc/execute/load.m
new file mode 100644
index 00000000000..fad662384d6
--- /dev/null
+++ b/gcc/testsuite/objc/execute/load.m
@@ -0,0 +1,30 @@
+/* Contributed by Nicola Pero - Wed Mar 7 17:55:04 CET 2001 */
+#include <objc/objc.h>
+
+/* Test that +load is automatically called before main is run */
+
+static int static_variable = 0;
+
+@interface TestClass
+{
+ Class isa;
+}
++ (void) load;
+@end
+
+@implementation TestClass
++ (void) load
+{
+ static_variable = 1;
+}
+@end
+
+int main (void)
+{
+ if (static_variable != 1)
+ {
+ abort ();
+ }
+
+ return 0;
+}
diff --git a/gcc/testsuite/objc/execute/many_args_method.m b/gcc/testsuite/objc/execute/many_args_method.m
new file mode 100644
index 00000000000..d811082cb86
--- /dev/null
+++ b/gcc/testsuite/objc/execute/many_args_method.m
@@ -0,0 +1,56 @@
+/* Contributed by Nicola Pero - Fri Mar 9 19:39:15 CET 2001 */
+#include <objc/objc.h>
+
+/* Test the syntax of methods with many arguments */
+
+@interface TestClass
+{
+ Class isa;
+}
++ (int) sumInteger: (int)a withInteger: (int)b;
++ (int) sum: (int)a : (int)b;
++ (int) sumInteger: (int)a withInteger: (int)b withInteger: (int)c;
++ (int) sum: (int)a : (int)b : (int)c;
+@end
+
+@implementation TestClass
++ (int) sumInteger: (int)a withInteger: (int)b
+{
+ return a + b;
+}
++ (int) sum: (int)a : (int)b
+{
+ return [self sumInteger: a withInteger: b];
+}
++ (int) sumInteger: (int)a withInteger: (int)b withInteger: (int)c
+{
+ return a + b + c;
+}
++ (int) sum: (int)a : (int)b : (int)c
+{
+ return [self sumInteger: a withInteger: b withInteger: c];
+}
+@end
+
+
+int main (void)
+{
+ if ([TestClass sumInteger: 1 withInteger: 1] != 2)
+ {
+ abort ();
+ }
+ if ([TestClass sum: 1 : 1] != 2)
+ {
+ abort ();
+ }
+ if ([TestClass sumInteger: 1 withInteger: 1 withInteger: 1] != 3)
+ {
+ abort ();
+ }
+ if ([TestClass sum: 1 : 1 : 1] != 3)
+ {
+ abort ();
+ }
+
+ return 0;
+}
diff --git a/gcc/testsuite/objc/execute/nested-1.m b/gcc/testsuite/objc/execute/nested-1.m
new file mode 100644
index 00000000000..02a39036815
--- /dev/null
+++ b/gcc/testsuite/objc/execute/nested-1.m
@@ -0,0 +1,12 @@
+/* Contributed by Nicola Pero Wed Feb 21 12:08:16 GMT 2001 */
+
+int main (void)
+{
+ void nested (void)
+ {
+ return;
+ }
+
+ return 0;
+}
+
diff --git a/gcc/testsuite/objc/execute/nested-2.m b/gcc/testsuite/objc/execute/nested-2.m
new file mode 100644
index 00000000000..0c67ec14778
--- /dev/null
+++ b/gcc/testsuite/objc/execute/nested-2.m
@@ -0,0 +1,17 @@
+/* Contributed by Nicola Pero Mon Mar 5 19:57:11 CET 2001 */
+
+int main (void)
+{
+ inline int nested (void)
+ {
+ return 1;
+ }
+
+ if (nested () != 1)
+ {
+ exit (1);
+ }
+
+ return 0;
+}
+
diff --git a/gcc/testsuite/objc/execute/nested-3.m b/gcc/testsuite/objc/execute/nested-3.m
new file mode 100644
index 00000000000..94271c4e4c0
--- /dev/null
+++ b/gcc/testsuite/objc/execute/nested-3.m
@@ -0,0 +1,37 @@
+/* Contributed by Nicola Pero - Fri Mar 9 19:39:15 CET 2001 */
+#include <objc/objc.h>
+
+/* Test defining a nested function inside a method */
+
+@interface Test
+{
+ Class isa;
+}
++ (int) test;
+@end
+
+@implementation Test
+
++ (int) test
+{
+ int test (void)
+ {
+ return 1;
+ }
+
+ return test ();
+}
+
+@end
+
+int main (void)
+{
+ if ([Test test] != 1)
+ {
+ abort ();
+ }
+
+ return 0;
+}
+
+
diff --git a/gcc/testsuite/objc/execute/no_clash.m b/gcc/testsuite/objc/execute/no_clash.m
new file mode 100644
index 00000000000..7eaa5130727
--- /dev/null
+++ b/gcc/testsuite/objc/execute/no_clash.m
@@ -0,0 +1,41 @@
+/* Contributed by Nicola Pero - Fri Mar 9 19:39:15 CET 2001 */
+#include <objc/objc.h>
+#include <objc/Object.h>
+
+/* Test that using the same name for different things makes no
+ problem */
+
+@interface TestClass : Object
+{
+ int test;
+}
++ (int) test;
+- (int) test;
+@end
+
+@implementation TestClass
++ (int) test
+{
+ return 1;
+}
+- (int) test
+{
+ /* 0 + 2 as `test' is implicitly initialized to zero */
+ return test + 2;
+}
+@end
+
+
+int main (void)
+{
+ if ([TestClass test] != 1)
+ {
+ abort ();
+ }
+ if ([[[TestClass alloc] init] test] != 2)
+ {
+ abort ();
+ }
+
+ return 0;
+}
diff --git a/gcc/testsuite/objc/execute/object_is_class.m b/gcc/testsuite/objc/execute/object_is_class.m
new file mode 100644
index 00000000000..a053434fb14
--- /dev/null
+++ b/gcc/testsuite/objc/execute/object_is_class.m
@@ -0,0 +1,42 @@
+/* Contributed by Nicola Pero - Tue Jul 3 10:55:21 BST 2001 */
+#include <objc/objc.h>
+#include <objc/objc-api.h>
+#include <objc/Object.h>
+
+/* This test demonstrate a failure in object_is_class which was fixed */
+
+/* Create a class whose instance variables mirror the struct used for
+ Class structures in the runtime ... yes we're feeling evil today */
+@interface EvilClass : Object
+{
+ Class super_class;
+ const char* name;
+ long version;
+ unsigned long info;
+}
+@end
+
+@implementation EvilClass
+- (id) init
+{
+ self = [super init];
+ /* The following one is used in the runtime to mark classes */
+ info = 0x1L;
+ return self;
+}
+@end
+
+int main (void)
+{
+ /* Create an object of our EvilClass */
+ EvilClass *evilObject = [EvilClass new];
+
+ /* Now check that the object is not a class object */
+ if (object_is_class (evilObject))
+ {
+ printf ("object_is_class failed\n");
+ abort ();
+ }
+
+ return 0;
+}
diff --git a/gcc/testsuite/objc/execute/object_is_meta_class.m b/gcc/testsuite/objc/execute/object_is_meta_class.m
new file mode 100644
index 00000000000..90cd3a962f0
--- /dev/null
+++ b/gcc/testsuite/objc/execute/object_is_meta_class.m
@@ -0,0 +1,41 @@
+/* Contributed by Nicola Pero - Tue Jul 3 10:55:21 BST 2001 */
+#include <objc/objc.h>
+#include <objc/objc-api.h>
+#include <objc/Object.h>
+
+/* This test demonstrate a failure in object_is_meta_class which was fixed */
+
+@interface EvilClass : Object
+{
+ Class super_class;
+ const char* name;
+ long version;
+ unsigned long info;
+}
+@end
+
+@implementation EvilClass
+- (id) init
+{
+ self = [super init];
+ /* The following one is used in the runtime to mark meta classes */
+ info = 0x2L;
+ return self;
+}
+@end
+
+int main (void)
+{
+ /* Create an object of our EvilClass */
+ EvilClass *evilObject = [EvilClass new];
+
+ /* Now check that the object is not a meta class object */
+ if (object_is_meta_class (evilObject))
+ {
+ printf ("object_is_meta_class failed\n");
+ abort ();
+ }
+
+ return 0;
+}
+
diff --git a/gcc/testsuite/objc/execute/private.m b/gcc/testsuite/objc/execute/private.m
new file mode 100644
index 00000000000..02cc23498bd
--- /dev/null
+++ b/gcc/testsuite/objc/execute/private.m
@@ -0,0 +1,32 @@
+/* Contributed by Nicola Pero - Fri Mar 9 19:39:15 CET 2001 */
+#include <objc/objc.h>
+#include <objc/Object.h>
+
+/* Test the @private, @protected, @public keyworks for ivars. We only
+ check syntax. */
+
+@interface TestClass : Object
+{
+ int a;
+
+@private
+ int ivarOne, ivarTwo;
+ id ivarThree;
+
+@protected
+ int ivarFour;
+
+@public
+ id ivarFive;
+}
+@end
+
+@implementation TestClass
+@end
+
+
+int main (void)
+{
+ /* Only test compilation */
+ return 0;
+}
diff --git a/gcc/testsuite/objc/execute/protocol.m b/gcc/testsuite/objc/execute/protocol.m
index 96ce8751a1c..539fc2994c2 100644
--- a/gcc/testsuite/objc/execute/protocol.m
+++ b/gcc/testsuite/objc/execute/protocol.m
@@ -14,3 +14,8 @@
}
@end
+int main (void)
+{
+ return 0;
+}
+
diff --git a/gcc/testsuite/objc/execute/redefining_self.m b/gcc/testsuite/objc/execute/redefining_self.m
new file mode 100644
index 00000000000..93659dbac8d
--- /dev/null
+++ b/gcc/testsuite/objc/execute/redefining_self.m
@@ -0,0 +1,31 @@
+/* Contributed by Nicola Pero - Fri Mar 9 19:39:15 CET 2001 */
+#include <objc/objc.h>
+
+/* Test redefining self */
+
+@interface TestClass
+{
+ Class isa;
+}
++ (Class) class;
+@end
+
+@implementation TestClass
++ (Class) class
+{
+ self = Nil;
+
+ return self;
+}
+@end
+
+
+int main (void)
+{
+ if ([TestClass class] != Nil)
+ {
+ abort ();
+ }
+
+ return 0;
+}
diff --git a/gcc/testsuite/objc/execute/root_methods.m b/gcc/testsuite/objc/execute/root_methods.m
new file mode 100644
index 00000000000..4f2c2fa0ee4
--- /dev/null
+++ b/gcc/testsuite/objc/execute/root_methods.m
@@ -0,0 +1,42 @@
+/* Contributed by Nicola Pero - Thu Mar 8 16:27:46 CET 2001 */
+#include <objc/objc.h>
+
+/* Test that instance methods of root classes are available as class
+ methods to other classes as well */
+
+@interface RootClass
+{
+ Class isa;
+}
+- (id) self;
+@end
+
+@implementation RootClass
+- (id) self
+{
+ return self;
+}
+@end
+
+@interface NormalClass : RootClass
+@end
+
+@implementation NormalClass : RootClass
+@end
+
+int main (void)
+{
+ Class normal = objc_get_class ("NormalClass");
+
+ if (normal == Nil)
+ {
+ abort ();
+ }
+
+ if ([NormalClass self] != normal)
+ {
+ abort ();
+ }
+
+ return 0;
+}
diff --git a/gcc/testsuite/objc/execute/selector-1.m b/gcc/testsuite/objc/execute/selector-1.m
new file mode 100644
index 00000000000..7e21da52a5e
--- /dev/null
+++ b/gcc/testsuite/objc/execute/selector-1.m
@@ -0,0 +1,17 @@
+/* Contributed by Nicola Pero - Thu Mar 8 16:27:46 CET 2001 */
+#include <objc/objc.h>
+#include <objc/objc-api.h>
+#include <objc/Object.h>
+
+int main (void)
+{
+ SEL selector;
+
+ selector = @selector (alloc);
+ if (strcmp (sel_get_name (selector), "alloc"))
+ {
+ abort ();
+ }
+
+ return 0;
+}
diff --git a/gcc/testsuite/objc/execute/static-1.m b/gcc/testsuite/objc/execute/static-1.m
new file mode 100644
index 00000000000..761e7070271
--- /dev/null
+++ b/gcc/testsuite/objc/execute/static-1.m
@@ -0,0 +1,34 @@
+/* Contributed by Nicola Pero - Fri Mar 9 19:39:15 CET 2001 */
+#include <objc/objc.h>
+
+/* Test defining a static variable *inside* a class implementation */
+
+@interface Test
+{
+ Class isa;
+}
++ (int) test;
+@end
+
+@implementation Test
+
+static int test = 1;
+
++ (int) test
+{
+ return test;
+}
+
+@end
+
+int main (void)
+{
+ if ([Test test] != 1)
+ {
+ abort ();
+ }
+
+ return 0;
+}
+
+
diff --git a/gcc/testsuite/objc/execute/static-2.m b/gcc/testsuite/objc/execute/static-2.m
new file mode 100644
index 00000000000..52a03a8fbd4
--- /dev/null
+++ b/gcc/testsuite/objc/execute/static-2.m
@@ -0,0 +1,37 @@
+/* Contributed by Nicola Pero - Fri Mar 9 19:39:15 CET 2001 */
+#include <objc/objc.h>
+
+/* Test defining a static function *inside* a class implementation */
+
+@interface Test
+{
+ Class isa;
+}
++ (int) test;
+@end
+
+@implementation Test
+
+static int test (void)
+{
+ return 1;
+}
+
++ (int) test
+{
+ return test ();
+}
+
+@end
+
+int main (void)
+{
+ if ([Test test] != 1)
+ {
+ abort ();
+ }
+
+ return 0;
+}
+
+
diff --git a/gcc/testsuite/objc/execute/string1.m b/gcc/testsuite/objc/execute/string1.m
index f0d14731836..fff03c7cfa6 100644
--- a/gcc/testsuite/objc/execute/string1.m
+++ b/gcc/testsuite/objc/execute/string1.m
@@ -1,8 +1,12 @@
-#include <stdio.h>
+/* Based on a test case contributed by Nicola Pero. */
+
+#include <string.h>
+#include <stdlib.h>
#include <objc/NXConstStr.h>
int main(int argc, void **args)
{
- printf ([@"this is a string\n" cString]);
+ if (strcmp ([@"this is a string" cString], "this is a string"))
+ abort ();
return 0;
}
diff --git a/gcc/testsuite/objc/execute/string2.m b/gcc/testsuite/objc/execute/string2.m
index 247e22bc3d6..66462b3c96c 100644
--- a/gcc/testsuite/objc/execute/string2.m
+++ b/gcc/testsuite/objc/execute/string2.m
@@ -1,8 +1,13 @@
-#include <stdio.h>
+/* Based on a test case contributed by Nicola Pero. */
+
+#include <string.h>
+#include <stdlib.h>
#include <objc/NXConstStr.h>
int main(int argc, void **args)
{
- printf ([@"this " @"is " @"a " @"string\n" cString]);
+ if (strcmp ([@"this " @"is " @"a " @"string" cString],
+ "this " "is " "a " "string"))
+ abort ();
return 0;
}
diff --git a/gcc/testsuite/objc/execute/string3.m b/gcc/testsuite/objc/execute/string3.m
new file mode 100644
index 00000000000..21527dcbf15
--- /dev/null
+++ b/gcc/testsuite/objc/execute/string3.m
@@ -0,0 +1,14 @@
+/* Based on a test case contributed by Nicola Pero. */
+
+#include <string.h>
+#include <stdlib.h>
+#include <objc/NXConstStr.h>
+
+#define STRING "this is a string"
+
+int main (int argc, void **args)
+{
+ if (strcmp ([@STRING cString], STRING))
+ abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/objc/execute/string4.m b/gcc/testsuite/objc/execute/string4.m
new file mode 100644
index 00000000000..54550d6f5e9
--- /dev/null
+++ b/gcc/testsuite/objc/execute/string4.m
@@ -0,0 +1,12 @@
+/* Based on a test case contributed by Nicola Pero. */
+
+#include <string.h>
+#include <stdlib.h>
+#include <objc/NXConstStr.h>
+
+int main(int argc, void **args)
+{
+ if ([@"this is a string" length] != strlen ("this is a string"))
+ abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/objc/execute/va_method.m b/gcc/testsuite/objc/execute/va_method.m
new file mode 100644
index 00000000000..bcf43d272a2
--- /dev/null
+++ b/gcc/testsuite/objc/execute/va_method.m
@@ -0,0 +1,44 @@
+/* Contributed by Nicola Pero - Thu Mar 8 16:27:46 CET 2001 */
+#include <objc/objc.h>
+#include <objc/objc-api.h>
+
+/* Test method with variable number of arguments */
+
+@interface MathClass
+{
+ Class isa;
+}
+/* sum positive numbers; -1 ends the list */
++ (int) sum: (int)firstNumber, ...;
+@end
+
+@implementation MathClass
++ (int) sum: (int)firstNumber, ...
+{
+ va_list ap;
+ int sum = 0, number = 0;
+
+ va_start (ap, firstNumber);
+ number = firstNumber;
+
+ while (number >= 0)
+ {
+ sum += number;
+ number = va_arg (ap, int);
+ }
+
+ va_end (ap);
+
+ return sum;
+}
+@end
+
+int main (void)
+{
+ if ([MathClass sum: 1, 2, 3, 4, 5, -1] != 15)
+ {
+ abort ();
+ }
+
+ return 0;
+}
diff --git a/gcc/timevar.c b/gcc/timevar.c
index cce106abd71..fd0f76cf2b9 100644
--- a/gcc/timevar.c
+++ b/gcc/timevar.c
@@ -401,7 +401,7 @@ timevar_print (fp)
{
/* Only print stuff if we have some sort of time information. */
#if defined (HAVE_USER_TIME) || defined (HAVE_SYS_TIME) || defined (HAVE_WALL_TIME)
- timevar_id_t id;
+ unsigned int /* timevar_id_t */ id;
struct timevar_time_def *total = &timevars[TV_TOTAL].elapsed;
struct timevar_time_def now;
@@ -426,13 +426,13 @@ timevar_print (fp)
start_time = now;
fprintf (fp, _("\nExecution times (seconds)\n"));
- for (id = 0; id < TIMEVAR_LAST; ++id)
+ for (id = 0; id < (unsigned int) TIMEVAR_LAST; ++id)
{
- struct timevar_def *tv = &timevars[id];
+ struct timevar_def *tv = &timevars[(timevar_id_t) id];
/* Don't print the total execution time here; that goes at the
end. */
- if (id == TV_TOTAL)
+ if ((timevar_id_t) id == TV_TOTAL)
continue;
/* Don't print timing variables that were never used. */
diff --git a/gcc/tlink.c b/gcc/tlink.c
index 8758556c14c..ae68fb03c4e 100644
--- a/gcc/tlink.c
+++ b/gcc/tlink.c
@@ -72,7 +72,7 @@ static struct hash_entry * symbol_hash_newfunc PARAMS ((struct hash_entry *,
struct hash_table *,
hash_table_key));
static struct symbol_hash_entry * symbol_hash_lookup PARAMS ((const char *,
- boolean));
+ int));
static struct hash_entry * file_hash_newfunc PARAMS ((struct hash_entry *,
struct hash_table *,
hash_table_key));
@@ -81,7 +81,7 @@ static struct hash_entry * demangled_hash_newfunc PARAMS ((struct hash_entry *,
struct hash_table *,
hash_table_key));
static struct demangled_hash_entry *
- demangled_hash_lookup PARAMS ((const char *, boolean));
+ demangled_hash_lookup PARAMS ((const char *, int));
static void symbol_push PARAMS ((symbol *));
static symbol * symbol_pop PARAMS ((void));
static void file_push PARAMS ((file *));
@@ -129,7 +129,7 @@ symbol_hash_newfunc (entry, table, string)
static struct symbol_hash_entry *
symbol_hash_lookup (string, create)
const char *string;
- boolean create;
+ int create;
{
return ((struct symbol_hash_entry *)
hash_lookup (&symbol_table, (const hash_table_key) string,
@@ -201,7 +201,7 @@ demangled_hash_newfunc (entry, table, string)
static struct demangled_hash_entry *
demangled_hash_lookup (string, create)
const char *string;
- boolean create;
+ int create;
{
return ((struct demangled_hash_entry *)
hash_lookup (&demangled_table, (const hash_table_key) string,
@@ -668,6 +668,7 @@ scan_linker_output (fname)
mistakenly use GNU ld's "In function `foo':" message. */
if (q && (strstr (oldq, "ndefined")
|| strstr (oldq, "nresolved")
+ || strstr (oldq, "nsatisfied")
|| strstr (oldq, "ultiple")))
{
*q = 0;
diff --git a/gcc/toplev.c b/gcc/toplev.c
index 26cc52d53d1..bfe0cc2e9cf 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -45,7 +45,6 @@ Boston, MA 02111-1307, USA. */
#include "tm_p.h"
#include "flags.h"
#include "insn-attr.h"
-#include "insn-codes.h"
#include "insn-config.h"
#include "hard-reg-set.h"
#include "recog.h"
@@ -63,10 +62,8 @@ Boston, MA 02111-1307, USA. */
#include "timevar.h"
#include "diagnostic.h"
#include "ssa.h"
-
-#ifndef ACCUMULATE_OUTGOING_ARGS
-#define ACCUMULATE_OUTGOING_ARGS 0
-#endif
+#include "params.h"
+#include "dwarf2asm.h"
#ifdef DWARF_DEBUGGING_INFO
#include "dwarfout.h"
@@ -163,10 +160,6 @@ static const char *decl_name PARAMS ((tree, int));
static void float_signal PARAMS ((int)) ATTRIBUTE_NORETURN;
static void crash_signal PARAMS ((int)) ATTRIBUTE_NORETURN;
-#ifdef ASM_IDENTIFY_LANGUAGE
-/* This might or might not be used in ASM_IDENTIFY_LANGUAGE. */
-static void output_lang_identify PARAMS ((FILE *)) ATTRIBUTE_UNUSED;
-#endif
static void compile_file PARAMS ((const char *));
static void display_help PARAMS ((void));
static void display_target_options PARAMS ((void));
@@ -256,6 +249,7 @@ enum dump_file_index
{
DFI_rtl,
DFI_sibling,
+ DFI_eh,
DFI_jump,
DFI_cse,
DFI_addressof,
@@ -293,7 +287,7 @@ enum dump_file_index
Remaining -d letters:
- " h o q u "
+ " o q u "
" H K OPQ TUVW YZ"
*/
@@ -301,6 +295,7 @@ struct dump_file_info dump_file[DFI_MAX] =
{
{ "rtl", 'r', 0, 0, 0 },
{ "sibling", 'i', 0, 0, 0 },
+ { "eh", 'h', 0, 0, 0 },
{ "jump", 'j', 0, 0, 0 },
{ "cse", 's', 0, 0, 0 },
{ "addressof", 'F', 0, 0, 0 },
@@ -390,6 +385,9 @@ int errorcount = 0;
int warningcount = 0;
int sorrycount = 0;
+/* Nonzero if we should exit after parsing options. */
+static int exit_after_options = 0;
+
/* The FUNCTION_DECL for the function currently being compiled,
or 0 if between functions. */
tree current_function_decl;
@@ -718,11 +716,6 @@ int flag_pic;
int flag_exceptions;
-/* Nonzero means use the new model for exception handling. Replaces
- -DNEW_EH_MODEL as a compile option. */
-
-int flag_new_exceptions = 1;
-
/* Nonzero means generate frame unwind info table when supported. */
int flag_unwind_tables = 0;
@@ -917,26 +910,26 @@ static struct
debug_args[] =
{
{ "", NO_DEBUG, DEFAULT_GDB_EXTENSIONS,
- "Generate default debug format output" },
- { "gdb", NO_DEBUG, 1, "Generate default extended debug format output" },
+ N_("Generate debugging info in default format") },
+ { "gdb", NO_DEBUG, 1, N_("Generate debugging info in default extended format") },
#ifdef DBX_DEBUGGING_INFO
- { "stabs", DBX_DEBUG, 0, "Generate STABS format debug output" },
- { "stabs+", DBX_DEBUG, 1, "Generate extended STABS format debug output" },
+ { "stabs", DBX_DEBUG, 0, N_("Generate STABS format debug info") },
+ { "stabs+", DBX_DEBUG, 1, N_("Generate extended STABS format debug info") },
#endif
#ifdef DWARF_DEBUGGING_INFO
- { "dwarf", DWARF_DEBUG, 0, "Generate DWARF-1 format debug output"},
+ { "dwarf", DWARF_DEBUG, 0, N_("Generate DWARF-1 format debug info") },
{ "dwarf+", DWARF_DEBUG, 1,
- "Generated extended DWARF-1 format debug output" },
+ N_("Generate extended DWARF-1 format debug info") },
#endif
#ifdef DWARF2_DEBUGGING_INFO
- { "dwarf-2", DWARF2_DEBUG, 0, "Enable DWARF-2 debug output" },
+ { "dwarf-2", DWARF2_DEBUG, 0, N_("Generate DWARF-2 debug info") },
#endif
#ifdef XCOFF_DEBUGGING_INFO
- { "xcoff", XCOFF_DEBUG, 0, "Generate XCOFF format debug output" },
- { "xcoff+", XCOFF_DEBUG, 1, "Generate extended XCOFF format debug output" },
+ { "xcoff", XCOFF_DEBUG, 0, N_("Generate XCOFF format debug info") },
+ { "xcoff+", XCOFF_DEBUG, 1, N_("Generate extended XCOFF format debug info") },
#endif
#ifdef SDB_DEBUGGING_INFO
- { "coff", SDB_DEBUG, 0, "Generate COFF format debug output" },
+ { "coff", SDB_DEBUG, 0, N_("Generate COFF format debug info") },
#endif
{ 0, 0, 0, 0 }
};
@@ -958,6 +951,14 @@ int flag_leading_underscore = -1;
/* The user symbol prefix after having resolved same. */
const char *user_label_prefix;
+static const param_info lang_independent_params[] = {
+#define DEFPARAM(ENUM, OPTION, HELP, DEFAULT) \
+ { OPTION, DEFAULT, HELP },
+#include "params.def"
+#undef DEFPARAM
+ { NULL, 0, NULL }
+};
+
/* A default for same. */
#ifndef USER_LABEL_PREFIX
#define USER_LABEL_PREFIX ""
@@ -971,189 +972,179 @@ const char *user_label_prefix;
lang_independent_options f_options[] =
{
- {"eliminate-dwarf2-dups", &flag_eliminate_dwarf2_dups, 1,
- "Perform DWARF2 duplicate elimination"},
{"float-store", &flag_float_store, 1,
- "Do not store floats in registers" },
+ N_("Do not store floats in registers") },
{"volatile", &flag_volatile, 1,
- "Consider all mem refs through pointers as volatile"},
+ N_("Consider all mem refs through pointers as volatile") },
{"volatile-global", &flag_volatile_global, 1,
- "Consider all mem refs to global data to be volatile" },
+ N_("Consider all mem refs to global data to be volatile") },
{"volatile-static", &flag_volatile_static, 1,
- "Consider all mem refs to static data to be volatile" },
+ N_("Consider all mem refs to static data to be volatile") },
{"defer-pop", &flag_defer_pop, 1,
- "Defer popping functions args from stack until later" },
+ N_("Defer popping functions args from stack until later") },
{"omit-frame-pointer", &flag_omit_frame_pointer, 1,
- "When possible do not generate stack frames"},
+ N_("When possible do not generate stack frames") },
{"optimize-sibling-calls", &flag_optimize_sibling_calls, 1,
- "Optimize sibling and tail recursive calls" },
+ N_("Optimize sibling and tail recursive calls") },
{"cse-follow-jumps", &flag_cse_follow_jumps, 1,
- "When running CSE, follow jumps to their targets" },
+ N_("When running CSE, follow jumps to their targets") },
{"cse-skip-blocks", &flag_cse_skip_blocks, 1,
- "When running CSE, follow conditional jumps" },
+ N_("When running CSE, follow conditional jumps") },
{"expensive-optimizations", &flag_expensive_optimizations, 1,
- "Perform a number of minor, expensive optimisations" },
+ N_("Perform a number of minor, expensive optimisations") },
{"thread-jumps", &flag_thread_jumps, 1,
- "Perform jump threading optimisations"},
+ N_("Perform jump threading optimisations") },
{"strength-reduce", &flag_strength_reduce, 1,
- "Perform strength reduction optimisations" },
+ N_("Perform strength reduction optimisations") },
{"unroll-loops", &flag_unroll_loops, 1,
- "Perform loop unrolling when iteration count is known" },
+ N_("Perform loop unrolling when iteration count is known") },
{"unroll-all-loops", &flag_unroll_all_loops, 1,
- "Perform loop unrolling for all loops" },
+ N_("Perform loop unrolling for all loops") },
{"move-all-movables", &flag_move_all_movables, 1,
- "Force all loop invariant computations out of loops" },
+ N_("Force all loop invariant computations out of loops") },
{"reduce-all-givs", &flag_reduce_all_givs, 1,
- "Strength reduce all loop general induction variables" },
+ N_("Strength reduce all loop general induction variables") },
{"writable-strings", &flag_writable_strings, 1,
- "Store strings in writable data section" },
+ N_("Store strings in writable data section") },
{"peephole", &flag_no_peephole, 0,
- "Enable machine specific peephole optimisations" },
+ N_("Enable machine specific peephole optimisations") },
{"force-mem", &flag_force_mem, 1,
- "Copy memory operands into registers before using" },
+ N_("Copy memory operands into registers before using") },
{"force-addr", &flag_force_addr, 1,
- "Copy memory address constants into regs before using" },
+ N_("Copy memory address constants into regs before using") },
{"function-cse", &flag_no_function_cse, 0,
- "Allow function addresses to be held in registers" },
+ N_("Allow function addresses to be held in registers") },
{"inline-functions", &flag_inline_functions, 1,
- "Integrate simple functions into their callers" },
+ N_("Integrate simple functions into their callers") },
{"keep-inline-functions", &flag_keep_inline_functions, 1,
- "Generate code for funcs even if they are fully inlined" },
+ N_("Generate code for funcs even if they are fully inlined") },
{"inline", &flag_no_inline, 0,
- "Pay attention to the 'inline' keyword"},
+ N_("Pay attention to the 'inline' keyword") },
{"keep-static-consts", &flag_keep_static_consts, 1,
- "Emit static const variables even if they are not used" },
+ N_("Emit static const variables even if they are not used") },
{"syntax-only", &flag_syntax_only, 1,
- "Check for syntax errors, then stop" },
+ N_("Check for syntax errors, then stop") },
{"shared-data", &flag_shared_data, 1,
- "Mark data as shared rather than private" },
+ N_("Mark data as shared rather than private") },
{"caller-saves", &flag_caller_saves, 1,
- "Enable saving registers around function calls" },
+ N_("Enable saving registers around function calls") },
{"pcc-struct-return", &flag_pcc_struct_return, 1,
- "Return 'short' aggregates in memory, not registers" },
+ N_("Return 'short' aggregates in memory, not registers") },
{"reg-struct-return", &flag_pcc_struct_return, 0,
- "Return 'short' aggregates in registers" },
+ N_("Return 'short' aggregates in registers") },
{"delayed-branch", &flag_delayed_branch, 1,
- "Attempt to fill delay slots of branch instructions" },
+ N_("Attempt to fill delay slots of branch instructions") },
{"gcse", &flag_gcse, 1,
- "Perform the global common subexpression elimination" },
+ N_("Perform the global common subexpression elimination") },
{"rerun-cse-after-loop", &flag_rerun_cse_after_loop, 1,
- "Run CSE pass after loop optimisations"},
+ N_("Run CSE pass after loop optimisations") },
{"rerun-loop-opt", &flag_rerun_loop_opt, 1,
- "Run the loop optimiser twice"},
+ N_("Run the loop optimiser twice") },
{"delete-null-pointer-checks", &flag_delete_null_pointer_checks, 1,
- "Delete useless null pointer checks" },
+ N_("Delete useless null pointer checks") },
{"pretend-float", &flag_pretend_float, 1,
- "Pretend that host and target use the same FP format"},
+ N_("Pretend that host and target use the same FP format") },
{"schedule-insns", &flag_schedule_insns, 1,
- "Reschedule instructions to avoid pipeline stalls"},
+ N_("Reschedule instructions before register allocation") },
{"schedule-insns2", &flag_schedule_insns_after_reload, 1,
- "Run two passes of the instruction scheduler"},
+ N_("Reschedule instructions after register allocation") },
{"sched-interblock",&flag_schedule_interblock, 1,
- "Enable scheduling across basic blocks" },
+ N_("Enable scheduling across basic blocks") },
{"sched-spec",&flag_schedule_speculative, 1,
- "Allow speculative motion of non-loads" },
+ N_("Allow speculative motion of non-loads") },
{"sched-spec-load",&flag_schedule_speculative_load, 1,
- "Allow speculative motion of some loads" },
+ N_("Allow speculative motion of some loads") },
{"sched-spec-load-dangerous",&flag_schedule_speculative_load_dangerous, 1,
- "Allow speculative motion of more loads" },
+ N_("Allow speculative motion of more loads") },
{"branch-count-reg",&flag_branch_on_count_reg, 1,
- "Replace add,compare,branch with branch on count reg"},
+ N_("Replace add,compare,branch with branch on count reg") },
{"pic", &flag_pic, 1,
- "Generate position independent code, if possible"},
+ N_("Generate position independent code, if possible") },
{"PIC", &flag_pic, 2, ""},
{"exceptions", &flag_exceptions, 1,
- "Enable exception handling" },
- {"new-exceptions", &flag_new_exceptions, 1,
- "Use the new model for exception handling" },
+ N_("Enable exception handling") },
{"unwind-tables", &flag_unwind_tables, 1,
- "Just generate unwind tables for exception handling" },
- {"sjlj-exceptions", &exceptions_via_longjmp, 1,
- "Use setjmp/longjmp to handle exceptions" },
- {"asynchronous-exceptions", &asynchronous_exceptions, 1,
- "Support asynchronous exceptions" },
+ N_("Just generate unwind tables for exception handling") },
+ {"non-call-exceptions", &flag_non_call_exceptions, 1,
+ N_("Support synchronous non-call exceptions") },
{"profile-arcs", &profile_arc_flag, 1,
- "Insert arc based program profiling code" },
+ N_("Insert arc based program profiling code") },
{"test-coverage", &flag_test_coverage, 1,
- "Create data files needed by gcov" },
+ N_("Create data files needed by gcov") },
{"branch-probabilities", &flag_branch_probabilities, 1,
- "Use profiling information for branch probabilities" },
+ N_("Use profiling information for branch probabilities") },
{"reorder-blocks", &flag_reorder_blocks, 1,
- "Reorder basic blocks to improve code placement" },
+ N_("Reorder basic blocks to improve code placement") },
{"rename-registers", &flag_rename_registers, 1,
- "Do the register renaming optimization pass"},
+ N_("Do the register renaming optimization pass") },
{"fast-math", &flag_fast_math, 1,
- "Improve FP speed by violating ANSI & IEEE rules" },
+ N_("Improve FP speed by violating ANSI & IEEE rules") },
{"common", &flag_no_common, 0,
- "Do not put unitialised globals in the common section" },
+ N_("Do not put uninitialized globals in the common section") },
{"inhibit-size-directive", &flag_inhibit_size_directive, 1,
- "Do not generate .size directives" },
+ N_("Do not generate .size directives") },
{"function-sections", &flag_function_sections, 1,
- "place each function into its own section" },
+ N_("place each function into its own section") },
{"data-sections", &flag_data_sections, 1,
- "place data items into their own section" },
+ N_("place data items into their own section") },
{"verbose-asm", &flag_verbose_asm, 1,
- "Add extra commentry to assembler output"},
+ N_("Add extra commentry to assembler output") },
{"gnu-linker", &flag_gnu_linker, 1,
- "Output GNU ld formatted global initialisers"},
+ N_("Output GNU ld formatted global initialisers") },
{"regmove", &flag_regmove, 1,
- "Enables a register move optimisation"},
+ N_("Enables a register move optimisation") },
{"optimize-register-move", &flag_regmove, 1,
- "Do the full regmove optimization pass"},
+ N_("Do the full regmove optimization pass") },
{"pack-struct", &flag_pack_struct, 1,
- "Pack structure members together without holes" },
+ N_("Pack structure members together without holes") },
{"stack-check", &flag_stack_check, 1,
- "Insert stack checking code into the program" },
+ N_("Insert stack checking code into the program") },
{"argument-alias", &flag_argument_noalias, 0,
- "Specify that arguments may alias each other & globals"},
+ N_("Specify that arguments may alias each other & globals") },
{"argument-noalias", &flag_argument_noalias, 1,
- "Assume arguments may alias globals but not each other"},
+ N_("Assume arguments may alias globals but not each other") },
{"argument-noalias-global", &flag_argument_noalias, 2,
- "Assume arguments do not alias each other or globals" },
+ N_("Assume arguments do not alias each other or globals") },
{"strict-aliasing", &flag_strict_aliasing, 1,
- "Assume strict aliasing rules apply" },
+ N_("Assume strict aliasing rules apply") },
{"align-loops", &align_loops, 0,
- "Align the start of loops" },
+ N_("Align the start of loops") },
{"align-jumps", &align_jumps, 0,
- "Align labels which are only reached by jumping" },
+ N_("Align labels which are only reached by jumping") },
{"align-labels", &align_labels, 0,
- "Align all labels" },
+ N_("Align all labels") },
{"align-functions", &align_functions, 0,
- "Align the start of functions" },
+ N_("Align the start of functions") },
{"check-memory-usage", &flag_check_memory_usage, 1,
- "Generate code to check every memory access" },
+ N_("Generate code to check every memory access") },
{"prefix-function-name", &flag_prefix_function_name, 1,
- "Add a prefix to all function names" },
+ N_("Add a prefix to all function names") },
{"dump-unnumbered", &flag_dump_unnumbered, 1,
- "Suppress output of instruction numbers and line number notes in debugging dumps"},
+ N_("Suppress output of instruction numbers and line number notes in debugging dumps") },
{"instrument-functions", &flag_instrument_function_entry_exit, 1,
- "Instrument function entry/exit with profiling calls"},
+ N_("Instrument function entry/exit with profiling calls") },
{"ssa", &flag_ssa, 1,
- "Enable SSA optimizations" },
+ N_("Enable SSA optimizations") },
{"dce", &flag_dce, 1,
- "Enable dead code elimination" },
+ N_("Enable dead code elimination") },
{"leading-underscore", &flag_leading_underscore, 1,
- "External symbols have a leading underscore" },
+ N_("External symbols have a leading underscore") },
{"ident", &flag_no_ident, 0,
- "Process #ident directives"},
+ N_("Process #ident directives") },
{ "peephole2", &flag_peephole2, 1,
- "Enables an rtl peephole pass run before sched2" },
+ N_("Enables an rtl peephole pass run before sched2") },
{ "guess-branch-probability", &flag_guess_branch_prob, 1,
- "Enables guessing of branch probabilities" },
+ N_("Enables guessing of branch probabilities") },
{"math-errno", &flag_errno_math, 1,
- "Set errno after built-in math functions"},
- {"bounded-pointers", &flag_bounded_pointers, 1,
- "Compile pointers as triples: value, base & end" },
- {"bounds-check", &flag_bounds_check, 1,
- "Generate code to check bounds before dereferencing pointers and arrays" },
+ N_("Set errno after built-in math functions") },
{"single-precision-constant", &flag_single_precision_constant, 1,
- "Convert floating point constant to single precision constant"},
+ N_("Convert floating point constant to single precision constant") },
{"time-report", &time_report, 1,
- "Report time taken by each compiler pass at end of run"},
+ N_("Report time taken by each compiler pass at end of run") },
{"mem-report", &mem_report, 1,
- "Report on permanent memory allocation at end of run"},
+ N_("Report on permanent memory allocation at end of run") },
{ "trapv", &flag_trapv, 1,
- "Trap for signed overflow in addition / subtraction / multiplication." },
+ N_("Trap for signed overflow in addition / subtraction / multiplication.") },
};
/* Table of language-specific options. */
@@ -1169,129 +1160,167 @@ documented_lang_options[] =
used here is to only describe those options which are not
enabled by default. */
- { "-ansi", "Compile just for ISO C89" },
+ { "-ansi",
+ N_("Compile just for ISO C89") },
{ "-fallow-single-precision",
- "Do not promote floats to double if using -traditional" },
- { "-std= ", "Determine language standard"},
+ N_("Do not promote floats to double if using -traditional") },
+ { "-std= ",
+ N_("Determine language standard") },
{ "-fsigned-bitfields", "" },
- { "-funsigned-bitfields","Make bitfields by unsigned by default" },
+ { "-funsigned-bitfields",
+ N_("Make bitfields by unsigned by default") },
{ "-fno-signed-bitfields", "" },
{ "-fno-unsigned-bitfields","" },
- { "-fsigned-char", "Make 'char' be signed by default"},
- { "-funsigned-char", "Make 'char' be unsigned by default"},
+ { "-fsigned-char",
+ N_("Make 'char' be signed by default") },
+ { "-funsigned-char",
+ N_("Make 'char' be unsigned by default") },
{ "-fno-signed-char", "" },
{ "-fno-unsigned-char", "" },
{ "-ftraditional", "" },
- { "-traditional", "Attempt to support traditional K&R style C"},
+ { "-traditional",
+ N_("Attempt to support traditional K&R style C") },
{ "-fnotraditional", "" },
{ "-fno-traditional", "" },
{ "-fasm", "" },
- { "-fno-asm", "Do not recognise the 'asm' keyword" },
+ { "-fno-asm",
+ N_("Do not recognise the 'asm' keyword") },
{ "-fbuiltin", "" },
- { "-fno-builtin", "Do not recognise any built in functions" },
- { "-fhosted", "Assume normal C execution environment" },
+ { "-fno-builtin",
+ N_("Do not recognise any built in functions") },
+ { "-fhosted",
+ N_("Assume normal C execution environment") },
{ "-fno-hosted", "" },
{ "-ffreestanding",
- "Assume that standard libraries & main might not exist" },
+ N_("Assume that standard libraries & main might not exist") },
{ "-fno-freestanding", "" },
- { "-fcond-mismatch", "Allow different types as args of ? operator"},
+ { "-fcond-mismatch",
+ N_("Allow different types as args of ? operator") },
{ "-fno-cond-mismatch", "" },
- { "-fdollars-in-identifiers", "Allow the use of $ inside identifiers" },
+ { "-fdollars-in-identifiers",
+ N_("Allow the use of $ inside identifiers") },
{ "-fno-dollars-in-identifiers", "" },
{ "-fpreprocessed", "" },
{ "-fno-preprocessed", "" },
- { "-fshort-double", "Use the same size for double as for float" },
+ { "-fshort-double",
+ N_("Use the same size for double as for float") },
{ "-fno-short-double", "" },
- { "-fshort-enums", "Use the smallest fitting integer to hold enums"},
+ { "-fshort-enums",
+ N_("Use the smallest fitting integer to hold enums") },
{ "-fno-short-enums", "" },
- { "-fshort-wchar", "Override the underlying type for wchar_t to `unsigned short'" },
+ { "-fshort-wchar",
+ N_("Override the underlying type for wchar_t to `unsigned short'") },
{ "-fno-short-wchar", "" },
- { "-Wall", "Enable most warning messages" },
+ { "-Wall",
+ N_("Enable most warning messages") },
{ "-Wbad-function-cast",
- "Warn about casting functions to incompatible types" },
+ N_("Warn about casting functions to incompatible types") },
{ "-Wno-bad-function-cast", "" },
{ "-Wno-missing-noreturn", "" },
{ "-Wmissing-format-attribute",
- "Warn about functions which might be candidates for format attributes" },
+ N_("Warn about functions which might be candidates for format attributes") },
{ "-Wno-missing-format-attribute", "" },
- { "-Wcast-qual", "Warn about casts which discard qualifiers"},
+ { "-Wcast-qual",
+ N_("Warn about casts which discard qualifiers") },
{ "-Wno-cast-qual", "" },
- { "-Wchar-subscripts", "Warn about subscripts whose type is 'char'"},
+ { "-Wchar-subscripts",
+ N_("Warn about subscripts whose type is 'char'") },
{ "-Wno-char-subscripts", "" },
- { "-Wcomment", "Warn if nested comments are detected" },
+ { "-Wcomment",
+ N_("Warn if nested comments are detected") },
{ "-Wno-comment", "" },
- { "-Wcomments", "Warn if nested comments are detected" },
+ { "-Wcomments",
+ N_("Warn if nested comments are detected") },
{ "-Wno-comments", "" },
- { "-Wconversion", "Warn about possibly confusing type conversions" },
+ { "-Wconversion",
+ N_("Warn about possibly confusing type conversions") },
{ "-Wno-conversion", "" },
- { "-Wformat", "Warn about printf/scanf/strftime/strfmon format anomalies" },
+ { "-Wformat",
+ N_("Warn about printf/scanf/strftime/strfmon format anomalies") },
{ "-Wno-format", "" },
{ "-Wformat-y2k", "" },
{ "-Wno-format-y2k",
- "Don't warn about strftime formats yielding 2 digit years" },
+ N_("Don't warn about strftime formats yielding 2 digit years") },
{ "-Wformat-extra-args", "" },
{ "-Wno-format-extra-args",
- "Don't warn about too many arguments to format functions" },
- { "-Wformat-nonliteral", "Warn about non-string-literal format strings" },
+ N_("Don't warn about too many arguments to format functions") },
+ { "-Wformat-nonliteral",
+ N_("Warn about non-string-literal format strings") },
{ "-Wno-format-nonliteral", "" },
{ "-Wformat-security",
- "Warn about possible security problems with format functions" },
+ N_("Warn about possible security problems with format functions") },
{ "-Wno-format-security", "" },
{ "-Wimplicit-function-declaration",
- "Warn about implicit function declarations" },
+ N_("Warn about implicit function declarations") },
{ "-Wno-implicit-function-declaration", "" },
{ "-Werror-implicit-function-declaration", "" },
- { "-Wimplicit-int", "Warn when a declaration does not specify a type" },
+ { "-Wimplicit-int",
+ N_("Warn when a declaration does not specify a type") },
{ "-Wno-implicit-int", "" },
{ "-Wimplicit", "" },
{ "-Wno-implicit", "" },
- { "-Wimport", "Warn about the use of the #import directive" },
+ { "-Wimport",
+ N_("Warn about the use of the #import directive") },
{ "-Wno-import", "" },
{ "-Wlong-long","" },
- { "-Wno-long-long", "Do not warn about using 'long long' when -pedantic" },
- { "-Wmain", "Warn about suspicious declarations of main" },
+ { "-Wno-long-long",
+ N_("Do not warn about using 'long long' when -pedantic") },
+ { "-Wmain",
+ N_("Warn about suspicious declarations of main") },
{ "-Wno-main", "" },
{ "-Wmissing-braces",
- "Warn about possibly missing braces around initialisers" },
+ N_("Warn about possibly missing braces around initialisers") },
{ "-Wno-missing-braces", "" },
{ "-Wmissing-declarations",
- "Warn about global funcs without previous declarations"},
+ N_("Warn about global funcs without previous declarations") },
{ "-Wno-missing-declarations", "" },
- { "-Wmissing-prototypes", "Warn about global funcs without prototypes" },
+ { "-Wmissing-prototypes",
+ N_("Warn about global funcs without prototypes") },
{ "-Wno-missing-prototypes", "" },
- { "-Wmultichar", "Warn about use of multicharacter literals"},
+ { "-Wmultichar",
+ N_("Warn about use of multicharacter literals") },
{ "-Wno-multichar", "" },
- { "-Wnested-externs", "Warn about externs not at file scope level" },
+ { "-Wnested-externs",
+ N_("Warn about externs not at file scope level") },
{ "-Wno-nested-externs", "" },
- { "-Wparentheses", "Warn about possible missing parentheses" },
+ { "-Wparentheses",
+ N_("Warn about possible missing parentheses") },
{ "-Wno-parentheses", "" },
{ "-Wsequence-point",
- "Warn about possible violations of sequence point rules" },
+ N_("Warn about possible violations of sequence point rules") },
{ "-Wno-sequence-point", "" },
- { "-Wpointer-arith", "Warn about function pointer arithmetic" },
+ { "-Wpointer-arith",
+ N_("Warn about function pointer arithmetic") },
{ "-Wno-pointer-arith", "" },
{ "-Wredundant-decls",
- "Warn about multiple declarations of the same object" },
+ N_("Warn about multiple declarations of the same object") },
{ "-Wno-redundant-decls", "" },
- { "-Wsign-compare", "Warn about signed/unsigned comparisons" },
+ { "-Wsign-compare",
+ N_("Warn about signed/unsigned comparisons") },
{ "-Wno-sign-compare", "" },
- { "-Wfloat-equal", "Warn about testing equality of floating point numbers" },
+ { "-Wfloat-equal",
+ N_("Warn about testing equality of floating point numbers") },
{ "-Wno-float-equal", "" },
- { "-Wunknown-pragmas", "Warn about unrecognized pragmas" },
+ { "-Wunknown-pragmas",
+ N_("Warn about unrecognized pragmas") },
{ "-Wno-unknown-pragmas", "" },
- { "-Wstrict-prototypes", "Warn about non-prototyped function decls" },
+ { "-Wstrict-prototypes",
+ N_("Warn about non-prototyped function decls") },
{ "-Wno-strict-prototypes", "" },
- { "-Wtraditional", "Warn about constructs whose meaning change in ISO C"},
+ { "-Wtraditional",
+ N_("Warn about constructs whose meaning change in ISO C") },
{ "-Wno-traditional", "" },
- { "-Wtrigraphs", "Warn when trigraphs are encountered" },
+ { "-Wtrigraphs",
+ N_("Warn when trigraphs are encountered") },
{ "-Wno-trigraphs", "" },
{ "-Wundef", "" },
{ "-Wno-undef", "" },
- { "-Wwrite-strings", "Mark strings as 'const char *'"},
+ { "-Wwrite-strings",
+ N_("Mark strings as 'const char *'") },
{ "-Wno-write-strings", "" },
#define DEFINE_LANG_NAME(NAME) { NULL, NAME },
@@ -1438,34 +1467,42 @@ int warn_missing_noreturn;
lang_independent_options W_options[] =
{
- {"unused-function", &warn_unused_function, 1, "Warn when a function is unused" },
- {"unused-label", &warn_unused_label, 1, "Warn when a label is unused" },
- {"unused-parameter", &warn_unused_parameter, 1, "Warn when a function parameter is unused" },
- {"unused-variable", &warn_unused_variable, 1, "Warn when a variable is unused" },
- {"unused-value", &warn_unused_value, 1, "Warn when an expression value is unused" },
- {"system-headers", &warn_system_headers, 1, "Do not suppress warnings from system headers"},
- {"error", &warnings_are_errors, 1, ""},
- {"shadow", &warn_shadow, 1, "Warn when one local variable shadows another" },
+ {"unused-function", &warn_unused_function, 1,
+ N_("Warn when a function is unused") },
+ {"unused-label", &warn_unused_label, 1,
+ N_("Warn when a label is unused") },
+ {"unused-parameter", &warn_unused_parameter, 1,
+ N_("Warn when a function parameter is unused") },
+ {"unused-variable", &warn_unused_variable, 1,
+ N_("Warn when a variable is unused") },
+ {"unused-value", &warn_unused_value, 1,
+ N_("Warn when an expression value is unused") },
+ {"system-headers", &warn_system_headers, 1,
+ N_("Do not suppress warnings from system headers") },
+ {"error", &warnings_are_errors, 1,
+ N_("Treat all warnings as errors") },
+ {"shadow", &warn_shadow, 1,
+ N_("Warn when one local variable shadows another") },
{"switch", &warn_switch, 1,
- "Warn about enumerated switches missing a specific case" },
+ N_("Warn about enumerated switches missing a specific case") },
{"aggregate-return", &warn_aggregate_return, 1,
- "Warn about returning structures, unions or arrays" },
+ N_("Warn about returning structures, unions or arrays") },
{"cast-align", &warn_cast_align, 1,
- "Warn about pointer casts which increase alignment" },
+ N_("Warn about pointer casts which increase alignment") },
{"unreachable-code", &warn_notreached, 1,
- "Warn about code that will never be executed" },
+ N_("Warn about code that will never be executed") },
{"uninitialized", &warn_uninitialized, 1,
- "Warn about unitialized automatic variables"},
+ N_("Warn about uninitialized automatic variables") },
{"inline", &warn_inline, 1,
- "Warn when an inlined function cannot be inlined"},
+ N_("Warn when an inlined function cannot be inlined") },
{"packed", &warn_packed, 1,
- "Warn when the packed attribute has no effect on struct layout"},
+ N_("Warn when the packed attribute has no effect on struct layout") },
{"padded", &warn_padded, 1,
- "Warn when padding is required to align struct members"},
+ N_("Warn when padding is required to align struct members") },
{"disabled-optimization", &warn_disabled_optimization, 1,
- "Warn when an optimization pass is disabled"},
+ N_("Warn when an optimization pass is disabled") },
{"missing-noreturn", &warn_missing_noreturn, 1,
- "Warn about functions which might be candidates for attribute noreturn"}
+ N_("Warn about functions which might be candidates for attribute noreturn") }
};
/* Output files for assembler code (real compiler output)
@@ -1794,21 +1831,6 @@ output_file_directive (asm_file, input_name)
#endif
}
-#ifdef ASM_IDENTIFY_LANGUAGE
-/* Routine to build language identifier for object file. */
-
-static void
-output_lang_identify (asm_out_file)
- FILE *asm_out_file;
-{
- int len = strlen (lang_identify ()) + sizeof ("__gnu_compiled_") + 1;
- char *s = (char *) alloca (len);
-
- sprintf (s, "__gnu_compiled_%s", lang_identify ());
- ASM_OUTPUT_LABEL (asm_out_file, s);
-}
-#endif
-
/* Routine to open a dump file. Return true if the dump file is enabled. */
static int
@@ -2014,7 +2036,7 @@ check_global_declarations (vec, len)
/* Cancel the RTL for this decl so that, if debugging info
output for global variables is still to come,
this one will be omitted. */
- DECL_RTL (decl) = NULL;
+ SET_DECL_RTL (decl, NULL_RTX);
/* Warn about any function
declared static but not defined.
@@ -2183,14 +2205,15 @@ compile_file (name)
init_regs ();
init_alias_once ();
init_decl_processing ();
+ init_eh ();
init_optabs ();
init_stmt ();
- init_eh ();
init_loop ();
init_reload ();
init_function_once ();
init_stor_layout_once ();
init_varasm_once ();
+ init_EXPR_INSN_LIST_cache ();
/* The following initialization functions need to generate rtl, so
provide a dummy function context for them. */
@@ -2281,18 +2304,6 @@ compile_file (name)
fprintf (asm_out_file, "\n");
}
#endif
-
- /* Output something to inform GDB that this compilation was by GCC. */
-#ifndef ASM_IDENTIFY_GCC
- fprintf (asm_out_file, "gcc2_compiled.:\n");
-#else
- ASM_IDENTIFY_GCC (asm_out_file);
-#endif
-
- /* Output something to identify which front-end produced this file. */
-#ifdef ASM_IDENTIFY_LANGUAGE
- ASM_IDENTIFY_LANGUAGE (asm_out_file);
-#endif
} /* ! flag_syntax_only */
#ifndef ASM_OUTPUT_SECTION_NAME
@@ -2320,25 +2331,6 @@ compile_file (name)
warning ("-ffunction-sections may affect debugging on some targets.");
#endif
- /* ??? Note: There used to be a conditional here
- to call assemble_zeros without fail if DBX_DEBUGGING_INFO is defined.
- This was to guarantee separation between gcc_compiled. and
- the first function, for the sake of dbx on Suns.
- However, having the extra zero here confused the Emacs
- code for unexec, and might confuse other programs too.
- Therefore, I took out that change.
- In future versions we should find another way to solve
- that dbx problem. -- rms, 23 May 93. */
-
- /* Don't let the first function fall at the same address
- as gcc_compiled., if profiling. */
- if (profile_flag || profile_block_flag)
- {
- /* It's best if we can write a nop here since some
- assemblers don't tolerate zeros in the text section. */
- output_asm_insn (get_insn_template (CODE_FOR_nop, NULL), NULL_PTR);
- }
-
/* If dbx symbol table desired, initialize writing it
and output the predefined types. */
timevar_push (TV_SYMOUT);
@@ -2422,14 +2414,6 @@ compile_file (name)
loop above. */
output_func_start_profiler ();
- /* Now that all possible functions have been output, we can dump
- the exception table. */
-
-#ifndef IA64_UNWIND_INFO
- output_exception_table ();
-#endif
- free_exception_table ();
-
check_global_declarations (vec, len);
/* Clean up. */
@@ -2465,6 +2449,8 @@ compile_file (name)
/* Output some stuff at end of file if nec. */
+ dw2_output_indirect_constants ();
+
end_final (dump_base_name);
if (profile_arc_flag || flag_test_coverage || flag_branch_probabilities)
@@ -2482,6 +2468,15 @@ compile_file (name)
ASM_FILE_END (asm_out_file);
#endif
+ /* Attach a special .ident directive to the end of the file to identify
+ the version of GCC which compiled this code. The format of the .ident
+ string is patterned after the ones produced by native SVR4 compilers. */
+#ifdef IDENT_ASM_OP
+ if (!flag_no_ident)
+ fprintf (asm_out_file, "%s\"GCC: (GNU) %s\"\n",
+ IDENT_ASM_OP, version_string);
+#endif
+
/* Language-specific end of compilation actions. */
finish_syntax:
if (lang_hooks.finish)
@@ -2520,7 +2515,7 @@ compile_file (name)
{
int i;
- for (i = 0; i < DFI_MAX; ++i)
+ for (i = 0; i < (int) DFI_MAX; ++i)
if (dump_file[i].initialized && dump_file[i].graph_dump_p)
{
char seq[16];
@@ -2584,7 +2579,8 @@ rest_of_decl_compilation (decl, asmspec, top_level, at_end)
|| TREE_CODE (decl) == FUNCTION_DECL)
{
timevar_push (TV_VARCONST);
- make_decl_rtl (decl, asmspec);
+ if (asmspec)
+ make_decl_rtl (decl, asmspec);
/* Initialized extern variable exists to be replaced
with its value, or represents something that will be
output in another file. */
@@ -2610,14 +2606,15 @@ rest_of_decl_compilation (decl, asmspec, top_level, at_end)
{
if (decode_reg_name (asmspec) >= 0)
{
- DECL_RTL (decl) = 0;
+ SET_DECL_RTL (decl, NULL_RTX);
make_decl_rtl (decl, asmspec);
}
else
{
error ("invalid register name `%s' for register variable", asmspec);
DECL_REGISTER (decl) = 0;
- make_decl_rtl (decl, NULL);
+ if (!top_level)
+ expand_decl (decl);
}
}
#if defined (DBX_DEBUGGING_INFO) || defined (XCOFF_DEBUGGING_INFO)
@@ -2684,19 +2681,23 @@ note_deferral_of_defined_inline_function (decl)
/* Generate the DWARF info for the "abstract" instance of a function
which we may later generate inlined and/or out-of-line instances
of. */
- if (write_symbols == DWARF_DEBUG && DECL_INLINE (decl))
+ if (write_symbols == DWARF_DEBUG
+ && (DECL_INLINE (decl) || DECL_ABSTRACT (decl))
+ && ! DECL_ABSTRACT_ORIGIN (decl))
{
/* The front-end may not have set CURRENT_FUNCTION_DECL, but the
DWARF code expects it to be set in this case. Intuitively,
DECL is the function we just finished defining, so setting
CURRENT_FUNCTION_DECL is sensible. */
tree saved_cfd = current_function_decl;
+ int was_abstract = DECL_ABSTRACT (decl);
current_function_decl = decl;
/* Let the DWARF code do its work. */
set_decl_abstract_flags (decl, 1);
dwarfout_file_scope_decl (decl, 0);
- set_decl_abstract_flags (decl, 0);
+ if (! was_abstract)
+ set_decl_abstract_flags (decl, 0);
/* Reset CURRENT_FUNCTION_DECL. */
current_function_decl = saved_cfd;
@@ -2704,6 +2705,24 @@ note_deferral_of_defined_inline_function (decl)
#endif
}
+/* FNDECL is an inline function which is about to be emitted out of line.
+ Do any preparation, such as emitting abstract debug info for the inline
+ before it gets mangled by optimization. */
+
+void
+note_outlining_of_inline_function (fndecl)
+ tree fndecl ATTRIBUTE_UNUSED;
+{
+#ifdef DWARF2_DEBUGGING_INFO
+ /* The DWARF 2 backend tries to reduce debugging bloat by not emitting
+ the abstract description of inline functions until something tries to
+ reference them. Force it out now, before optimizations mangle the
+ block tree. */
+ if (write_symbols == DWARF2_DEBUG)
+ dwarf2out_abstract_function (fndecl);
+#endif
+}
+
/* This is called from finish_function (within yyparse)
after each top-level definition is parsed.
It is supposed to compile that function or variable
@@ -2771,7 +2790,8 @@ rest_of_compilation (decl)
}
/* If requested, consider whether to make this function inline. */
- if (DECL_INLINE (decl) || flag_inline_functions)
+ if ((DECL_INLINE (decl) && !flag_no_inline)
+ || flag_inline_functions)
{
timevar_push (TV_INTEGRATION);
lose = function_cannot_inline_p (decl);
@@ -2809,6 +2829,11 @@ rest_of_compilation (decl)
close_dump_file (DFI_rtl, print_rtl, insns);
}
+ /* Convert from NOTE_INSN_EH_REGION style notes, and do other
+ sorts of eh initialization. Delay this until after the
+ initial rtl dump so that we can see the original nesting. */
+ convert_from_eh_region_ranges ();
+
/* If function is inline, and we don't yet know whether to
compile it by itself, defer decision till end of compilation.
finish_compilation will call rest_of_compilation again
@@ -2868,8 +2893,6 @@ rest_of_compilation (decl)
goto exit_rest_of_compilation;
}
- init_EXPR_INSN_LIST_cache ();
-
ggc_collect ();
/* Initialize some variables used by the optimizers. */
@@ -2890,9 +2913,6 @@ rest_of_compilation (decl)
if ((rtl_dump_and_exit || flag_syntax_only) && !warn_return_type)
goto exit_rest_of_compilation;
- /* Emit code to get eh context, if needed. */
- emit_eh_context ();
-
/* We may have potential sibling or tail recursion sites. Select one
(of possibly multiple) methods of performing the call. */
if (flag_optimize_sibling_calls)
@@ -2906,6 +2926,19 @@ rest_of_compilation (decl)
timevar_pop (TV_JUMP);
}
+ /* Complete generation of exception handling code. */
+ find_exception_handler_labels ();
+ if (doing_eh (0))
+ {
+ timevar_push (TV_JUMP);
+ open_dump_file (DFI_eh, decl);
+
+ finish_eh_generation ();
+
+ close_dump_file (DFI_eh, print_rtl, get_insns ());
+ timevar_pop (TV_JUMP);
+ }
+
#ifdef FINALIZE_PIC
/* If we are doing position-independent code generation, now
is the time to output special prologues and epilogues.
@@ -2929,9 +2962,6 @@ rest_of_compilation (decl)
/* Instantiate all virtual registers. */
instantiate_virtual_regs (current_function_decl, insns);
- /* Find all the EH handlers. */
- find_exception_handler_labels ();
-
open_dump_file (DFI_jump, decl);
/* Always do one jump optimization pass to ensure that JUMP_LABEL fields
@@ -2961,7 +2991,7 @@ rest_of_compilation (decl)
if (optimize > 0)
{
find_basic_blocks (insns, max_reg_num (), rtl_dump_file);
- cleanup_cfg (insns);
+ cleanup_cfg ();
/* ??? Run if-conversion before delete_null_pointer_checks,
since the later does not preserve the CFG. This should
@@ -3031,7 +3061,7 @@ rest_of_compilation (decl)
timevar_push (TV_JUMP);
find_basic_blocks (insns, max_reg_num (), rtl_dump_file);
- cleanup_cfg (insns);
+ cleanup_cfg ();
delete_null_pointer_checks (insns);
timevar_pop (TV_JUMP);
@@ -3062,7 +3092,7 @@ rest_of_compilation (decl)
open_dump_file (DFI_ssa, decl);
find_basic_blocks (insns, max_reg_num (), rtl_dump_file);
- cleanup_cfg (insns);
+ cleanup_cfg ();
convert_to_ssa ();
close_dump_file (DFI_ssa, print_rtl_with_bb, insns);
@@ -3114,7 +3144,7 @@ rest_of_compilation (decl)
open_dump_file (DFI_gcse, decl);
find_basic_blocks (insns, max_reg_num (), rtl_dump_file);
- cleanup_cfg (insns);
+ cleanup_cfg ();
tem = gcse_main (insns, rtl_dump_file);
/* If gcse altered any jumps, rerun jump optimizations to clean
@@ -3186,7 +3216,7 @@ rest_of_compilation (decl)
timevar_push (TV_IFCVT);
find_basic_blocks (insns, max_reg_num (), rtl_dump_file);
- cleanup_cfg (insns);
+ cleanup_cfg ();
if_convert (0);
timevar_pop(TV_IFCVT);
@@ -3232,7 +3262,7 @@ rest_of_compilation (decl)
open_dump_file (DFI_cfg, decl);
find_basic_blocks (insns, max_reg_num (), rtl_dump_file);
- cleanup_cfg (insns);
+ cleanup_cfg ();
check_function_return_warnings ();
close_dump_file (DFI_cfg, print_rtl_with_bb, insns);
@@ -3307,7 +3337,7 @@ rest_of_compilation (decl)
timevar_push (TV_FLOW);
find_basic_blocks (insns, max_reg_num (), rtl_dump_file);
- cleanup_cfg (insns);
+ cleanup_cfg ();
/* Blimey. We've got to have the CFG up to date for the call to
if_convert below. However, the random deletion of blocks
@@ -3515,7 +3545,7 @@ rest_of_compilation (decl)
if (optimize)
{
- cleanup_cfg (insns);
+ cleanup_cfg ();
life_analysis (insns, rtl_dump_file, PROP_FINAL);
/* This is kind of a heuristic. We need to run combine_stack_adjustments
@@ -3650,6 +3680,12 @@ rest_of_compilation (decl)
}
#endif
+#ifndef STACK_REGS
+ /* ??? Do this before shorten branches so that we aren't creating
+ insns too late and fail sanity checks in final. */
+ convert_to_eh_region_ranges ();
+#endif
+
/* Shorten branches.
Note this must run before reg-stack because of death note (ab)use
@@ -3668,6 +3704,8 @@ rest_of_compilation (decl)
timevar_pop (TV_REG_STACK);
ggc_collect ();
+
+ convert_to_eh_region_ranges ();
#endif
current_function_nothrow = nothrow_function_p ();
@@ -3698,7 +3736,20 @@ rest_of_compilation (decl)
final_start_function (insns, asm_out_file, optimize);
final (insns, asm_out_file, optimize, 0);
final_end_function (insns, asm_out_file, optimize);
+
+#ifdef IA64_UNWIND_INFO
+ /* ??? The IA-64 ".handlerdata" directive must be issued before
+ the ".endp" directive that closes the procedure descriptor. */
+ output_function_exception_table ();
+#endif
+
assemble_end_function (decl, fnname);
+
+#ifndef IA64_UNWIND_INFO
+ /* Otherwise, it feels unclean to switch sections in the middle. */
+ output_function_exception_table ();
+#endif
+
if (! quiet_flag)
fflush (asm_out_file);
@@ -3812,11 +3863,22 @@ display_help ()
if (description != NULL && * description != 0)
printf (" -f%-21s %s\n",
- f_options[i].string, description);
+ f_options[i].string, _(description));
}
printf (_(" -O[number] Set optimisation level to [number]\n"));
printf (_(" -Os Optimise for space rather than speed\n"));
+ for (i = LAST_PARAM; i--;)
+ {
+ const char *description = compiler_params[i].help;
+ const int length = 21-strlen(compiler_params[i].option);
+
+ if (description != NULL && * description != 0)
+ printf (" --param %s=<value>%.*s%s\n",
+ compiler_params[i].option,
+ length > 0 ? length : 1, " ",
+ _(description));
+ }
printf (_(" -pedantic Issue warnings needed by strict compliance to ISO C\n"));
printf (_(" -pedantic-errors Like -pedantic except that errors are produced\n"));
printf (_(" -w Suppress warnings\n"));
@@ -3828,7 +3890,7 @@ display_help ()
if (description != NULL && * description != 0)
printf (" -W%-21s %s\n",
- W_options[i].string, description);
+ W_options[i].string, _(description));
}
printf (_(" -Wunused Enable unused warnings\n"));
@@ -3850,10 +3912,10 @@ display_help ()
{
if (debug_args[i].description != NULL)
printf (" -g%-21s %s\n",
- debug_args[i].arg, debug_args[i].description);
+ debug_args[i].arg, _(debug_args[i].description));
}
- printf (_(" -aux-info <file> Emit declaration info into <file>.X\n"));
+ printf (_(" -aux-info <file> Emit declaration info into <file>\n"));
printf (_(" -quiet Do not display functions compiled or elapsed time\n"));
printf (_(" -version Display the compiler's version\n"));
printf (_(" -d[letters] Enable dumps from specific passes of the compiler\n"));
@@ -3905,7 +3967,7 @@ display_help ()
lang = description;
}
else
- printf (" %-23.23s %s\n", option, description);
+ printf (" %-23.23s %s\n", option, _(description));
}
}
@@ -3948,7 +4010,7 @@ display_target_options ()
printf (_(" -m%-23.23s [undocumented]\n"), option);
}
else if (* description != 0)
- doc += printf (" -m%-23.23s %s\n", option, description);
+ doc += printf (" -m%-23.23s %s\n", option, _(description));
}
#ifdef TARGET_OPTIONS
@@ -3967,7 +4029,7 @@ display_target_options ()
printf (_(" -m%-23.23s [undocumented]\n"), option);
}
else if (* description != 0)
- doc += printf (" -m%-23.23s %s\n", option, description);
+ doc += printf (" -m%-23.23s %s\n", option, _(description));
}
#endif
if (undoc)
@@ -3992,7 +4054,7 @@ decode_d_option (arg)
switch (c = *arg++)
{
case 'a':
- for (i = 0; i < DFI_MAX; ++i)
+ for (i = 0; i < (int) DFI_MAX; ++i)
dump_file[i].enabled = 1;
break;
case 'A':
@@ -4023,7 +4085,7 @@ decode_d_option (arg)
default:
matched = 0;
- for (i = 0; i < DFI_MAX; ++i)
+ for (i = 0; i < (int) DFI_MAX; ++i)
if (c == dump_file[i].debug_switch)
{
dump_file[i].enabled = 1;
@@ -4066,8 +4128,12 @@ decode_f_option (arg)
if ((option_value = skip_leading_substring (arg, "inline-limit-"))
|| (option_value = skip_leading_substring (arg, "inline-limit=")))
- inline_max_insns =
- read_integral_parameter (option_value, arg - 2, inline_max_insns);
+ {
+ int val =
+ read_integral_parameter (option_value, arg - 2,
+ MAX_INLINE_INSNS);
+ set_param_value ("max-inline-insns", val);
+ }
#ifdef INSN_SCHEDULING
else if ((option_value = skip_leading_substring (arg, "sched-verbose=")))
fix_sched_param ("verbose", option_value);
@@ -4338,19 +4404,53 @@ independent_decode_option (argc, argv)
if (!strcmp (arg, "-help"))
{
display_help ();
- exit (0);
+ exit_after_options = 1;
}
if (!strcmp (arg, "-target-help"))
{
display_target_options ();
- exit (0);
+ exit_after_options = 1;
}
if (!strcmp (arg, "-version"))
{
print_version (stderr, "");
- exit (0);
+ exit_after_options = 1;
+ }
+
+ /* 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;
}
if (*arg == 'Y')
@@ -4454,17 +4554,22 @@ independent_decode_option (argc, argv)
}
else if (!strncmp (arg, "aux-info", 8))
{
- flag_gen_aux_info = 1;
if (arg[8] == '\0')
{
if (argc == 1)
return 0;
aux_info_file_name = argv[1];
+ flag_gen_aux_info = 1;
return 2;
}
+ else if (arg[8] == '=')
+ {
+ aux_info_file_name = arg + 9;
+ flag_gen_aux_info = 1;
+ }
else
- aux_info_file_name = arg + 8;
+ return 0;
}
else
return 0;
@@ -4594,6 +4699,9 @@ main (argc, argv)
/* Initialize the diagnostics reporting machinery. */
initialize_diagnostics ();
+ /* Register the language-independent parameters. */
+ add_params (lang_independent_params, LAST_PARAM);
+
/* Perform language-specific options intialization. */
if (lang_hooks.init_options)
(*lang_hooks.init_options) ();
@@ -4703,16 +4811,22 @@ main (argc, argv)
/* Perform normal command line switch decoding. */
for (i = 1; i < argc;)
{
- unsigned int lang_processed;
- unsigned int indep_processed;
+ int lang_processed;
+ int indep_processed;
/* Give the language a chance to decode the option for itself. */
lang_processed = (*lang_hooks.decode_option) (argc - i, argv + i);
- /* 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);
+ 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);
@@ -4763,6 +4877,9 @@ main (argc, argv)
if (lang_hooks.post_options)
(*lang_hooks.post_options) ();
+ if (exit_after_options)
+ exit (0);
+
/* Reflect any language-specific diagnostic option setting. */
reshape_diagnostic_buffer ();
@@ -4784,32 +4901,17 @@ main (argc, argv)
warning ("-Wuninitialized is not supported without -O");
}
+ /* We do not currently support sibling-call optimization in the
+ presence of exceptions. See PR2975 for a test-case that will
+ fail if we try to combine both of these features. */
+ if (flag_exceptions)
+ flag_optimize_sibling_calls = 0;
+
#ifdef OVERRIDE_OPTIONS
/* Some machines may reject certain combinations of options. */
OVERRIDE_OPTIONS;
#endif
- if (exceptions_via_longjmp == 2)
- {
-#ifdef DWARF2_UNWIND_INFO
- exceptions_via_longjmp = ! DWARF2_UNWIND_INFO;
-#else
-#ifdef IA64_UNWIND_INFO
- exceptions_via_longjmp = ! IA64_UNWIND_INFO;
-#else
- exceptions_via_longjmp = 1;
-#endif
-#endif
- }
-
- /* Since each function gets its own handler data, we can't support the
- new model currently, since it depend on a specific rethrow label
- which is declared at the front of the table, and we can only
- have one such symbol in a file. */
-#ifdef IA64_UNWIND_INFO
- flag_new_exceptions = 0;
-#endif
-
/* Set up the align_*_log variables, defaulting them to 1 if they
were still unset. */
if (align_loops <= 0) align_loops = 1;
@@ -4851,6 +4953,16 @@ main (argc, argv)
warning ("this target machine does not have delayed branches");
#endif
+ /* Some operating systems do not allow profiling without a frame
+ pointer. */
+ if (!TARGET_ALLOWS_PROFILING_WITHOUT_FRAME_POINTER
+ && profile_flag
+ && flag_omit_frame_pointer)
+ {
+ error ("profiling does not work without a frame pointer");
+ flag_omit_frame_pointer = 0;
+ }
+
user_label_prefix = USER_LABEL_PREFIX;
if (flag_leading_underscore != -1)
{
diff --git a/gcc/toplev.h b/gcc/toplev.h
index 093c8f85366..e621857826f 100644
--- a/gcc/toplev.h
+++ b/gcc/toplev.h
@@ -42,6 +42,7 @@ extern void debug_end_source_file PARAMS ((unsigned));
extern void debug_define PARAMS ((unsigned, const char *));
extern void debug_undef PARAMS ((unsigned, const char *));
extern int debug_ignore_block PARAMS ((union tree_node *));
+extern const char *trim_filename PARAMS ((const char *));
extern void internal_error PARAMS ((const char *, ...))
ATTRIBUTE_PRINTF_1
ATTRIBUTE_NORETURN;
@@ -130,11 +131,14 @@ extern int wrapup_global_declarations PARAMS ((union tree_node **, int));
extern void check_global_declarations PARAMS ((union tree_node **, int));
extern void note_deferral_of_defined_inline_function
PARAMS ((union tree_node *));
+extern void note_outlining_of_inline_function
+ PARAMS ((union tree_node *));
extern int errorcount;
extern int warningcount;
extern int sorrycount;
extern const char *progname;
+extern const char *dump_base_name;
/* Language-specific hooks. Can be NULL unless otherwise specified. */
struct lang_hooks
@@ -152,7 +156,12 @@ struct lang_hooks
single option (typically starting with -f or -W or +). It should
return the number of command-line arguments it uses if it handles
the option, or 0 and not complain if it does not recognise the
- option. This hook cannot be NULL. */
+ option. If this function returns a negative number, then its
+ absolute value is the number of command-line arguments used, but,
+ in addition, no language-independent option processing should be
+ done for this option.
+
+ This hook cannot be NULL. */
int (*decode_option) PARAMS ((int, char **));
/* Called when all command line options have been processed. */
diff --git a/gcc/tradcpp.c b/gcc/tradcpp.c
index 82de0bb7d69..27a70cbce7e 100644
--- a/gcc/tradcpp.c
+++ b/gcc/tradcpp.c
@@ -105,6 +105,7 @@ static const char *user_label_prefix;
It is zero for rescanning results of macro expansion
and for expanding macro arguments. */
#define INPUT_STACK_MAX 200
+struct file_name_list;
struct file_buf {
const char *fname;
int lineno;
@@ -120,6 +121,8 @@ struct file_buf {
struct if_stack *if_stack;
/* Object to be freed at end of input at this level. */
U_CHAR *free_ptr;
+ /* Position to start scanning for #include_next in this file. */
+ struct file_name_list *next_header_dir;
} instack[INPUT_STACK_MAX];
typedef struct file_buf FILE_BUF;
@@ -240,6 +243,7 @@ union hashval {
enum node_type {
T_DEFINE = 1, /* `#define' */
T_INCLUDE, /* `#include' */
+ T_INCLUDE_NEXT,/* `#include_next' */
T_IFDEF, /* `#ifdef' */
T_IFNDEF, /* `#ifndef' */
T_IF, /* `#if' */
@@ -358,6 +362,7 @@ static void do_error PARAMS ((U_CHAR *, U_CHAR *, FILE_BUF *));
static void do_warning PARAMS ((U_CHAR *, U_CHAR *, FILE_BUF *));
static void do_line PARAMS ((U_CHAR *, U_CHAR *, FILE_BUF *));
static void do_include PARAMS ((U_CHAR *, U_CHAR *, FILE_BUF *));
+static void do_include_next PARAMS ((U_CHAR *, U_CHAR *, FILE_BUF *));
static void do_undef PARAMS ((U_CHAR *, U_CHAR *, FILE_BUF *));
static void do_if PARAMS ((U_CHAR *, U_CHAR *, FILE_BUF *));
static void do_ifdef PARAMS ((U_CHAR *, U_CHAR *, FILE_BUF *));
@@ -415,7 +420,10 @@ static void make_assertion PARAMS ((const char *));
static void grow_outbuf PARAMS ((FILE_BUF *, int));
static int handle_directive PARAMS ((FILE_BUF *, FILE_BUF *));
-static void finclude PARAMS ((int, const char *, FILE_BUF *));
+static void process_include PARAMS ((struct file_name_list *,
+ const U_CHAR *, int, int, FILE_BUF *));
+static void finclude PARAMS ((int, const char *,
+ struct file_name_list *, FILE_BUF *));
static void init_dependency_output PARAMS ((void));
static void rescan PARAMS ((FILE_BUF *, int));
static void newline_fix PARAMS ((U_CHAR *));
@@ -450,6 +458,7 @@ struct directive directive_table[] = {
{ 4, do_elif, "elif", T_ELIF },
{ 5, do_error, "error", T_ERROR },
{ 7, do_warning, "warning", T_WARNING },
+ { 12, do_include_next, "include_next", T_INCLUDE_NEXT },
{ 6, do_assert, "assert", T_ASSERT },
{ 8, do_unassert,"unassert",T_UNASSERT},
{ -1, 0, "", T_UNUSED},
@@ -853,7 +862,7 @@ main (argc, argv)
if (print_deps)
deps_add_dep (deps, pend[i].arg);
- finclude (fd, pend[i].arg, &outbuf);
+ finclude (fd, pend[i].arg, 0, &outbuf);
}
indepth--;
no_output--;
@@ -2061,7 +2070,7 @@ handle_directive (ip, op)
while (cp != buf && is_space(cp[-1])) cp--;
cp++;
SKIP_WHITE_SPACE (xp);
- } else if (is_space (*xp)) {
+ } else if (is_nvspace (*xp)) {
*cp++ = *xp++;
SKIP_WHITE_SPACE (xp);
}
@@ -2278,22 +2287,17 @@ do_include (buf, limit, op)
U_CHAR *buf, *limit;
FILE_BUF *op;
{
- char *fname; /* Dynamically allocated fname buffer */
U_CHAR *fbeg, *fend; /* Beginning and end of fname */
struct file_name_list *stackp = include; /* Chain of dirs to search */
struct file_name_list dsp[1]; /* First in chain, if #include "..." */
int flen;
- int f; /* file number */
-
int retried = 0; /* Have already tried macro
expanding the include line*/
FILE_BUF trybuf; /* It got expanded into here */
int system_header_p = 0; /* 0 for "...", 1 for <...> */
- f= -1; /* JF we iz paranoid! */
-
get_filename:
fbeg = buf;
@@ -2374,6 +2378,90 @@ get_filename:
}
flen = fend - fbeg;
+ process_include (stackp, fbeg, flen, system_header_p, op);
+}
+
+static void
+do_include_next (buf, limit, op)
+ U_CHAR *buf, *limit;
+ FILE_BUF *op;
+{
+ U_CHAR *fbeg, *fend; /* Beginning and end of fname */
+
+ struct file_name_list *stackp; /* Chain of dirs to search */
+ int flen;
+
+ int retried = 0; /* Have already tried macro
+ expanding the include line*/
+ FILE_BUF trybuf; /* It got expanded into here */
+ int system_header_p = 0; /* 0 for "...", 1 for <...> */
+
+ /* Treat as plain #include if we don't know where to start
+ looking. */
+ stackp = instack[indepth].next_header_dir;
+ if (stackp == 0)
+ {
+ do_include (buf, limit, op);
+ return;
+ }
+
+get_filename:
+
+ fbeg = buf;
+ SKIP_WHITE_SPACE (fbeg);
+ /* Discard trailing whitespace so we can easily see
+ if we have parsed all the significant chars we were given. */
+ while (limit != fbeg && is_nvspace (limit[-1])) limit--;
+
+ switch (*fbeg++) {
+ case '\"':
+ fend = fbeg;
+ while (fend != limit && *fend != '\"')
+ fend++;
+ if (*fend == '\"' && fend + 1 == limit)
+ break;
+ goto fail;
+
+ case '<':
+ fend = fbeg;
+ while (fend != limit && *fend != '>') fend++;
+ if (*fend == '>' && fend + 1 == limit) {
+ system_header_p = 1;
+ break;
+ }
+ goto fail;
+
+ default:
+ fail:
+ if (retried) {
+ error ("#include expects \"fname\" or <fname>");
+ return;
+ } else {
+ trybuf = expand_to_temp_buffer (buf, limit, 0);
+ buf = (U_CHAR *) alloca (trybuf.bufp - trybuf.buf + 1);
+ memcpy (buf, trybuf.buf, trybuf.bufp - trybuf.buf);
+ limit = buf + (trybuf.bufp - trybuf.buf);
+ free (trybuf.buf);
+ retried++;
+ goto get_filename;
+ }
+ }
+
+ flen = fend - fbeg;
+ process_include (stackp, fbeg, flen, system_header_p, op);
+}
+
+static void
+process_include (stackp, fbeg, flen, system_header_p, op)
+ struct file_name_list *stackp;
+ const U_CHAR *fbeg;
+ int flen;
+ int system_header_p;
+ FILE_BUF *op;
+{
+ char *fname;
+ int f = -1; /* file number */
+
fname = (char *) alloca (max_include_len + flen + 2);
/* + 2 above for slash and terminating null. */
@@ -2472,7 +2560,7 @@ get_filename:
system_include_depth++;
/* Actually process the file. */
- finclude (f, fname, op);
+ finclude (f, fname, stackp->next, op);
if (system_header_p)
system_include_depth--;
@@ -2485,9 +2573,10 @@ get_filename:
with output to OP. */
static void
-finclude (f, fname, op)
+finclude (f, fname, nhd, op)
int f;
const char *fname;
+ struct file_name_list *nhd;
FILE_BUF *op;
{
int st_mode;
@@ -2506,6 +2595,7 @@ finclude (f, fname, op)
fp->length = 0;
fp->lineno = 1;
fp->if_stack = if_stack;
+ fp->next_header_dir = nhd;
if (S_ISREG (st_mode)) {
fp->buf = (U_CHAR *) xmalloc (st_size + 2);
@@ -2670,8 +2760,8 @@ do_define (buf, limit, op)
}
}
- ++bp; /* skip paren */
- while (is_nvspace (*bp)) /* and leading whitespace */
+ ++bp; /* skip paren */
+ while (is_nvspace (*bp) && bp < limit) /* and leading whitespace */
++bp;
/* now everything from bp before limit is the definition. */
defn = collect_expansion (bp, limit, argno, arg_ptrs);
@@ -2698,7 +2788,7 @@ do_define (buf, limit, op)
}
} else {
/* simple expansion or empty definition; skip leading whitespace */
- while (is_nvspace (*bp))
+ while (is_nvspace (*bp) && bp < limit)
++bp;
/* now everything from bp before limit is the definition. */
defn = collect_expansion (bp, limit, -1, 0);
diff --git a/gcc/tree.c b/gcc/tree.c
index 4ef1441041b..210024e98f0 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -182,10 +182,44 @@ void (*lang_unsave_expr_now) PARAMS ((tree));
/* If non-null, these are language-specific helper functions for
unsafe_for_reeval. Return negative to not handle some tree. */
int (*lang_unsafe_for_reeval) PARAMS ((tree));
+
+/* Set the DECL_ASSEMBLER_NAME for a node. If it is the sort of thing
+ that the assembler should talk about, set DECL_ASSEMBLER_NAME to an
+ appropriate IDENTIFIER_NODE. Otherwise, set it to the
+ ERROR_MARK_NODE to ensure that the assembler does not talk about
+ it. */
+void (*lang_set_decl_assembler_name) PARAMS ((tree));
tree global_trees[TI_MAX];
tree integer_types[itk_none];
+/* Set the DECL_ASSEMBLER_NAME for DECL. */
+void
+set_decl_assembler_name (decl)
+ tree decl;
+{
+ /* The language-independent code should never use the
+ DECL_ASSEMBLER_NAME for lots of DECLs. Only FUNCTION_DECLs and
+ VAR_DECLs for variables with static storage duration need a real
+ DECL_ASSEMBLER_NAME. */
+ if (TREE_CODE (decl) == FUNCTION_DECL
+ || (TREE_CODE (decl) == VAR_DECL
+ && (TREE_STATIC (decl)
+ || DECL_EXTERNAL (decl)
+ || TREE_PUBLIC (decl))))
+ /* By default, assume the name to use in assembly code is the
+ same as that used in the source language. (That's correct
+ for C, and GCC used to set DECL_ASSEMBLER_NAME to the same
+ value as DECL_NAME in build_decl, so this choice provides
+ backwards compatibility with existing front-ends. */
+ SET_DECL_ASSEMBLER_NAME (decl, DECL_NAME (decl));
+ else
+ /* Nobody should ever be asking for the DECL_ASSEMBLER_NAME of
+ these DECLs -- unless they're in language-dependent code, in
+ which case lang_set_decl_assembler_name should handle things. */
+ abort ();
+}
+
/* Init the principal obstacks. */
void
@@ -199,6 +233,9 @@ init_obstacks ()
ggc_add_root (&type_hash_table, 1, sizeof type_hash_table, mark_type_hash);
ggc_add_tree_root (global_trees, TI_MAX);
ggc_add_tree_root (integer_types, itk_none);
+
+ /* Set lang_set_decl_set_assembler_name to a default value. */
+ lang_set_decl_assembler_name = set_decl_assembler_name;
}
void
@@ -2557,7 +2594,6 @@ build_decl (code, name, type)
as the type can suppress useless errors in the use of this variable. */
DECL_NAME (t) = name;
- DECL_ASSEMBLER_NAME (t) = name;
TREE_TYPE (t) = type;
if (code == VAR_DECL || code == PARM_DECL || code == RESULT_DECL)
@@ -2957,31 +2993,47 @@ set_type_quals (type, type_quals)
TYPE_RESTRICT (type) = (type_quals & TYPE_QUAL_RESTRICT) != 0;
}
-/* Given a type node TYPE and a TYPE_QUALIFIER_SET, return a type for
- the same kind of data as TYPE describes. Variants point to the
- "main variant" (which has no qualifiers set) via TYPE_MAIN_VARIANT,
- and it points to a chain of other variants so that duplicate
- variants are never made. Only main variants should ever appear as
- types of expressions. */
+/* Return a version of the TYPE, qualified as indicated by the
+ TYPE_QUALS, if one exists. If no qualified version exists yet,
+ return NULL_TREE. */
tree
-build_qualified_type (type, type_quals)
+get_qualified_type (type, type_quals)
tree type;
int type_quals;
{
- register tree t;
+ tree t;
/* Search the chain of variants to see if there is already one there just
like the one we need to have. If so, use that existing one. We must
preserve the TYPE_NAME, since there is code that depends on this. */
-
for (t = TYPE_MAIN_VARIANT (type); t; t = TYPE_NEXT_VARIANT (t))
if (TYPE_QUALS (t) == type_quals && TYPE_NAME (t) == TYPE_NAME (type))
return t;
- /* We need a new one. */
- t = build_type_copy (type);
- set_type_quals (t, type_quals);
+ return NULL_TREE;
+}
+
+/* Like get_qualified_type, but creates the type if it does not
+ exist. This function never returns NULL_TREE. */
+
+tree
+build_qualified_type (type, type_quals)
+ tree type;
+ int type_quals;
+{
+ tree t;
+
+ /* See if we already have the appropriate qualified variant. */
+ t = get_qualified_type (type, type_quals);
+
+ /* If not, build it. */
+ if (!t)
+ {
+ t = build_type_copy (type);
+ set_type_quals (t, type_quals);
+ }
+
return t;
}
@@ -3302,6 +3354,28 @@ type_list_equal (l1, l2)
return t1 == t2;
}
+/* Returns the number of arguments to the FUNCTION_TYPE or METHOD_TYPE
+ given by TYPE. If the argument list accepts variable arguments,
+ then this function counts only the ordinary arguments. */
+
+int
+type_num_arguments (type)
+ tree type;
+{
+ int i = 0;
+ tree t;
+
+ for (t = TYPE_ARG_TYPES (type); t; t = TREE_CHAIN (t))
+ /* If the function does not take a variable number of arguments,
+ the last element in the list will have type `void'. */
+ if (VOID_TYPE_P (TREE_VALUE (t)))
+ break;
+ else
+ ++i;
+
+ return i;
+}
+
/* Nonzero if integer constants T1 and T2
represent the same constant value. */
@@ -3518,10 +3592,10 @@ simple_cst_equal (t1, t2)
as being equivalent to anything. */
if ((TREE_CODE (TREE_OPERAND (t1, 0)) == VAR_DECL
&& DECL_NAME (TREE_OPERAND (t1, 0)) == NULL_TREE
- && DECL_RTL (TREE_OPERAND (t1, 0)) == 0)
+ && !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 (TREE_OPERAND (t2, 0)) == 0))
+ && !DECL_RTL_SET_P (TREE_OPERAND (t2, 0))))
cmp = 1;
else
cmp = simple_cst_equal (TREE_OPERAND (t1, 0), TREE_OPERAND (t2, 0));
@@ -4412,15 +4486,7 @@ dump_tree_statistics ()
#define FILE_FUNCTION_PREFIX_LEN 9
-#ifndef NO_DOLLAR_IN_LABEL
-#define FILE_FUNCTION_FORMAT "_GLOBAL_$%s$%s"
-#else /* NO_DOLLAR_IN_LABEL */
-#ifndef NO_DOT_IN_LABEL
-#define FILE_FUNCTION_FORMAT "_GLOBAL_.%s.%s"
-#else /* NO_DOT_IN_LABEL */
#define FILE_FUNCTION_FORMAT "_GLOBAL__%s_%s"
-#endif /* NO_DOT_IN_LABEL */
-#endif /* NO_DOLLAR_IN_LABEL */
/* Appends 6 random characters to TEMPLATE to (hopefully) avoid name
clashes in cases where we can't reliably choose a unique name.
@@ -4663,9 +4729,9 @@ tree_check_failed (node, code, file, line, function)
int line;
const char *function;
{
- error ("Tree check: expected %s, have %s",
- tree_code_name[code], tree_code_name[TREE_CODE (node)]);
- fancy_abort (file, line, function);
+ internal_error ("Tree check: expected %s, have %s in %s, at %s:%d",
+ tree_code_name[code], tree_code_name[TREE_CODE (node)],
+ function, trim_filename (file), line);
}
/* Similar to above, except that we check for a class of tree
@@ -4679,10 +4745,10 @@ tree_class_check_failed (node, cl, file, line, function)
int line;
const char *function;
{
- error ("Tree check: expected class '%c', have '%c' (%s)",
- cl, TREE_CODE_CLASS (TREE_CODE (node)),
- tree_code_name[TREE_CODE (node)]);
- fancy_abort (file, line, function);
+ internal_error
+ ("Tree check: expected class '%c', have '%c' (%s) in %s, at %s:%d",
+ cl, TREE_CODE_CLASS (TREE_CODE (node)),
+ tree_code_name[TREE_CODE (node)], function, trim_filename (file), line);
}
#endif /* ENABLE_TREE_CHECKING */
@@ -4832,7 +4898,16 @@ build_common_tree_nodes_2 (short_double)
{
tree t;
BUILD_VA_LIST_TYPE (t);
- va_list_type_node = build_type_copy (t);
+
+ /* Many back-ends define record types without seting TYPE_NAME.
+ If we copied the record type here, we'd keep the original
+ record type without a name. This breaks name mangling. So,
+ don't copy record types and let c_common_nodes_and_builtins()
+ declare the type to be __builtin_va_list. */
+ if (TREE_CODE (t) != RECORD_TYPE)
+ t = build_type_copy (t);
+
+ va_list_type_node = t;
}
V4SF_type_node = make_node (VECTOR_TYPE);
diff --git a/gcc/tree.def b/gcc/tree.def
index c59f7f219e0..3e79a92436a 100644
--- a/gcc/tree.def
+++ b/gcc/tree.def
@@ -425,8 +425,10 @@ DEFTREECODE (TARGET_EXPR, "target_expr", 'e', 4)
Operand 0 is the condition.
Operand 1 is the then-value.
Operand 2 is the else-value.
- Operand 0 may be of any type, but the types of operands 1 and 2
- must be the same and the same as the type of this expression. */
+ Operand 0 may be of any type.
+ Operand 1 must have the same type as the entire expression, unless
+ it unconditionally throws an exception, in which case it should
+ have VOID_TYPE. The same constraints apply to operand 2. */
DEFTREECODE (COND_EXPR, "cond_expr", 'e', 3)
/* Declare local variables, including making RTL and allocating space.
@@ -600,7 +602,13 @@ DEFTREECODE (NEGATE_EXPR, "negate_expr", '1', 1)
DEFTREECODE (MIN_EXPR, "min_expr", '2', 2)
DEFTREECODE (MAX_EXPR, "max_expr", '2', 2)
+
+/* Represents the absolute value of the operand.
+
+ An ABS_EXPR must have either an INTEGER_TYPE or a REAL_TYPE. The
+ operand of the ABS_EXPR must have the same type. */
DEFTREECODE (ABS_EXPR, "abs_expr", '1', 1)
+
DEFTREECODE (FFS_EXPR, "ffs_expr", '1', 1)
/* Shift operations for shift and rotate.
@@ -709,9 +717,13 @@ DEFTREECODE (ADDR_EXPR, "addr_expr", 'e', 1)
DEFTREECODE (REFERENCE_EXPR, "reference_expr", 'e', 1)
/* Operand is a function constant; result is a function variable value
- of typeEPmode. Used only for languages that need static chains. */
+ of type EPmode. Used only for languages that need static chains. */
DEFTREECODE (ENTRY_VALUE_EXPR, "entry_value_expr", 'e', 1)
+/* Operand0 is a function constant; result is part N of a function
+ descriptor of type ptr_mode. */
+DEFTREECODE (FDESC_EXPR, "fdesc_expr", 'e', 2)
+
/* Given two real or integer operands of the same type,
returns a complex value of the corresponding complex type. */
DEFTREECODE (COMPLEX_EXPR, "complex_expr", '2', 2)
@@ -762,17 +774,6 @@ DEFTREECODE (TRY_FINALLY_EXPR, "try_finally", 'e', 2)
Operand 1 is the rtx for a variable in which to store the address
of where the subroutine should return to. */
DEFTREECODE (GOTO_SUBROUTINE_EXPR, "goto_subroutine", 'e', 2)
-
-/* Pop the top element off the dynamic handler chain. Used in
- conjunction with setjmp/longjmp based exception handling, see
- except.c for more details. This is meant to be used only by the
- exception handling backend, expand_dhc_cleanup specifically. */
-DEFTREECODE (POPDHC_EXPR, "popdhc_expr", 's', 0)
-
-/* Pop the top element off the dynamic cleanup chain. Used in
- conjunction with the exception handling. This is meant to be used
- only by the exception handling backend. */
-DEFTREECODE (POPDCC_EXPR, "popdcc_expr", 's', 0)
/* These types of expressions have no useful value,
and always have side effects. */
@@ -826,6 +827,10 @@ DEFTREECODE (EXPR_WITH_FILE_LOCATION, "expr_with_file_location", 'e', 3)
Operand 1 contains the case values. The way they're organized is
front-end implementation defined. */
DEFTREECODE (SWITCH_EXPR, "switch_expr", 'e', 2)
+
+/* The exception object from the runtime. */
+DEFTREECODE (EXC_PTR_EXPR, "exc_ptr_expr", 'e', 0)
+
/*
Local variables:
mode:c
diff --git a/gcc/tree.h b/gcc/tree.h
index 33597d6f556..83f068ba573 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -239,8 +239,6 @@ struct tree_common
INTEGER_TYPE, ENUMERAL_TYPE, FIELD_DECL
DECL_BUILT_IN_NONANSI in
FUNCTION_DECL
- TREE_PARMLIST in
- TREE_PARMLIST (C++)
SAVE_EXPR_NOPLACEHOLDER in
SAVE_EXPR
@@ -274,7 +272,8 @@ struct tree_common
/* The tree-code says what kind of node it is.
Codes are defined in tree.def. */
#define TREE_CODE(NODE) ((enum tree_code) (NODE)->common.code)
-#define TREE_SET_CODE(NODE, VALUE) ((NODE)->common.code = (int) (VALUE))
+#define TREE_SET_CODE(NODE, VALUE) \
+((NODE)->common.code = (ENUM_BITFIELD(tree_code)) (VALUE))
/* When checking is enabled, errors will be generated if a tree node
is accessed incorrectly. The macros abort with a fatal error. */
@@ -823,7 +822,7 @@ struct tree_exp
#define BLOCK_SUPERCONTEXT(NODE) (BLOCK_CHECK (NODE)->block.supercontext)
/* Note: when changing this, make sure to find the places
that use chainon or nreverse. */
-#define BLOCK_CHAIN(NODE) TREE_CHAIN (NODE)
+#define BLOCK_CHAIN(NODE) TREE_CHAIN (BLOCK_CHECK (NODE))
#define BLOCK_ABSTRACT_ORIGIN(NODE) (BLOCK_CHECK (NODE)->block.abstract_origin)
#define BLOCK_ABSTRACT(NODE) (BLOCK_CHECK (NODE)->block.abstract_flag)
@@ -1256,11 +1255,37 @@ struct tree_type
/* This is the name of the object as written by the user.
It is an IDENTIFIER_NODE. */
#define DECL_NAME(NODE) (DECL_CHECK (NODE)->decl.name)
-/* This is the name of the object as the assembler will see it
- (but before any translations made by ASM_OUTPUT_LABELREF).
- Often this is the same as DECL_NAME.
- It is an IDENTIFIER_NODE. */
-#define DECL_ASSEMBLER_NAME(NODE) (DECL_CHECK (NODE)->decl.assembler_name)
+/* The name of the object as the assembler will see it (but before any
+ translations made by ASM_OUTPUT_LABELREF). Often this is the same
+ as DECL_NAME. It is an IDENTIFIER_NODE. */
+#define DECL_ASSEMBLER_NAME(NODE) \
+ ((DECL_ASSEMBLER_NAME_SET_P (NODE) \
+ ? (void) 0 \
+ : (*lang_set_decl_assembler_name) (NODE)), \
+ DECL_CHECK (NODE)->decl.assembler_name)
+/* Returns non-zero if the DECL_ASSEMBLER_NAME for NODE has been
+ set. If zero, the NODE might still have a DECL_ASSEMBLER_NAME --
+ it just hasn't been set yet. */
+#define DECL_ASSEMBLER_NAME_SET_P(NODE) \
+ (DECL_CHECK (NODE)->decl.assembler_name != NULL_TREE)
+/* Set the DECL_ASSEMBLER_NAME for NODE to NAME. */
+#define SET_DECL_ASSEMBLER_NAME(NODE, NAME) \
+ (DECL_CHECK (NODE)->decl.assembler_name = (NAME))
+/* Copy the DECL_ASSEMBLER_NAME from DECL1 to DECL2. Note that if
+ DECL1's DECL_ASSEMBLER_NAME has not yet been set, using this macro
+ will not cause the DECL_ASSEMBLER_NAME of either DECL to be set.
+ In other words, the semantics of using this macro, are different
+ than saying:
+
+ SET_DECL_ASSEMBLER_NAME(DECL2, DECL_ASSEMBLER_NAME (DECL1))
+
+ which will try to set the DECL_ASSEMBLER_NAME for DECL1. */
+#define COPY_DECL_ASSEMBLER_NAME(DECL1, DECL2) \
+ (DECL_ASSEMBLER_NAME_SET_P (DECL1) \
+ ? (void) SET_DECL_ASSEMBLER_NAME (DECL2, \
+ DECL_ASSEMBLER_NAME (DECL1)) \
+ : (void) 0)
+
/* Records the section name in a section attribute. Used to pass
the name from decl_attributes to make_function_rtl and make_decl_rtl. */
#define DECL_SECTION_NAME(NODE) (DECL_CHECK (NODE)->decl.section_name)
@@ -1310,7 +1335,10 @@ struct tree_type
/* For a FIELD_DECL in a QUAL_UNION_TYPE, records the expression, which
if nonzero, indicates that the field occupies the type. */
#define DECL_QUALIFIER(NODE) (FIELD_DECL_CHECK (NODE)->decl.initial)
-/* These two fields describe where in the source code the declaration was. */
+/* These two fields describe where in the source code the declaration
+ was. If the declaration appears in several places (as for a C
+ function that is declared first and then defined later), this
+ information should refer to the definition. */
#define DECL_SOURCE_FILE(NODE) (DECL_CHECK (NODE)->decl.filename)
#define DECL_SOURCE_LINE(NODE) (DECL_CHECK (NODE)->decl.linenum)
/* Holds the size of the datum, in bits, as a tree expression.
@@ -1342,8 +1370,27 @@ struct tree_type
PROMOTED_MODE is defined, the mode of this expression may not be same
as DECL_MODE. In that case, DECL_MODE contains the mode corresponding
to the variable's data type, while the mode
- of DECL_RTL is the mode actually used to contain the data. */
-#define DECL_RTL(NODE) (DECL_CHECK (NODE)->decl.rtl)
+ of DECL_RTL is the mode actually used to contain the data.
+
+ This value can be evaluated lazily for functions, variables with
+ static storage duration, and labels. */
+#define DECL_RTL(NODE) \
+ (DECL_CHECK (NODE)->decl.rtl \
+ ? (NODE)->decl.rtl \
+ : (make_decl_rtl (NODE, NULL), (NODE)->decl.rtl))
+/* Set the DECL_RTL for NODE to RTL. */
+#define SET_DECL_RTL(NODE, RTL) \
+ (DECL_CHECK (NODE)->decl.rtl = (RTL))
+/* Returns non-zero if the DECL_RTL for NODE has already been set. */
+#define DECL_RTL_SET_P(NODE) \
+ (DECL_CHECK (NODE)->decl.rtl != NULL)
+/* Copy the RTL from NODE1 to NODE2. If the RTL was not set for
+ NODE1, it will not be set for NODE2; this is a lazy copy. */
+#define COPY_DECL_RTL(NODE1, NODE2) \
+ (DECL_CHECK (NODE2)->decl.rtl = DECL_CHECK (NODE1)->decl.rtl)
+/* The DECL_RTL for NODE, if it is set, or NULL, if it is not set. */
+#define DECL_RTL_IF_SET(NODE) \
+ (DECL_RTL_SET_P (NODE) ? DECL_RTL (NODE) : NULL)
/* Holds an INSN_LIST of all of the live ranges in which the variable
has been moved to a possibly different register. */
#define DECL_LIVE_RANGE_RTL(NODE) (DECL_CHECK (NODE)->decl.live_range_rtl)
@@ -1352,9 +1399,6 @@ struct tree_type
#define DECL_INCOMING_RTL(NODE) (PARM_DECL_CHECK (NODE)->decl.u2.r)
/* For FUNCTION_DECL, if it is inline, holds the saved insn chain. */
#define DECL_SAVED_INSNS(NODE) (FUNCTION_DECL_CHECK (NODE)->decl.u2.f)
-/* For FUNCTION_DECL, if it is inline,
- holds the size of the stack frame, as an integer. */
-#define DECL_FRAME_SIZE(NODE) (FUNCTION_DECL_CHECK (NODE)->decl.u1.i)
/* For FUNCTION_DECL, if it is built-in,
this identifies which built-in operation it is. */
#define DECL_FUNCTION_CODE(NODE) (FUNCTION_DECL_CHECK (NODE)->decl.u1.f)
@@ -1461,6 +1505,9 @@ struct tree_type
where it is called. */
#define DECL_INLINE(NODE) (FUNCTION_DECL_CHECK (NODE)->decl.inline_flag)
+/* In a FUNCTION_DECL, nonzero if the function cannot be inlined. */
+#define DECL_UNINLINABLE(NODE) (FUNCTION_DECL_CHECK (NODE)->decl.uninlinable)
+
/* Nonzero in a FUNCTION_DECL means this is a built-in function
that is not specified by ansi C and that users are supposed to be allowed
to redefine for any purpose whatever. */
@@ -1632,7 +1679,8 @@ struct tree_decl
unsigned pointer_depth : 2;
unsigned non_addressable : 1;
unsigned user_align : 1;
- /* Three unused bits. */
+ unsigned uninlinable : 1;
+ /* Two unused bits. */
unsigned lang_flag_0 : 1;
unsigned lang_flag_1 : 1;
@@ -1643,12 +1691,15 @@ struct tree_decl
unsigned lang_flag_6 : 1;
unsigned lang_flag_7 : 1;
- /* For a FUNCTION_DECL, if inline, this is the size of frame needed.
- If built-in, this is the code for which built-in function.
- For other kinds of decls, this is DECL_ALIGN and DECL_OFFSET_ALIGN. */
union {
- HOST_WIDE_INT i;
+ /* In a FUNCTION_DECL for which DECL_BUILT_IN holds, this is
+ DECL_FUNCTION_CODE. */
enum built_in_function f;
+ /* In a FUNCITON_DECL for which DECL_BUILT_IN does not hold, this
+ is used by language-dependent code. */
+ HOST_WIDE_INT i;
+ /* DECL_ALIGN and DECL_OFFSET_ALIGN. (These are not used for
+ FUNCTION_DECLs). */
struct {unsigned int align : 24; unsigned int off_align : 8;} a;
} u1;
@@ -1915,6 +1966,13 @@ extern tree get_identifier PARAMS ((const char *));
extern tree maybe_get_identifier PARAMS ((const char *));
+/* Look up an identifier with the name TEXT, replace its identifier
+ node with NODE, and return the old identifier node. This is used
+ by languages which need to enable and disable keywords based on
+ context; e.g. see remember_protocol_qualifiers in objc/objc-act.c. */
+
+extern tree set_identifier PARAMS ((const char *, tree));
+
/* Construct various types of nodes. */
#define build_int_2(LO,HI) \
@@ -2016,12 +2074,14 @@ extern tree lookup_attribute PARAMS ((const char *, tree));
extern tree merge_attributes PARAMS ((tree, tree));
-/* Given a type node TYPE and a TYPE_QUALIFIER_SET, return a type for
- the same kind of data as TYPE describes. Variants point to the
- "main variant" (which has no qualifiers set) via TYPE_MAIN_VARIANT,
- and it points to a chain of other variants so that duplicate
- variants are never made. Only main variants should ever appear as
- types of expressions. */
+/* Return a version of the TYPE, qualified as indicated by the
+ TYPE_QUALS, if one exists. If no qualified version exists yet,
+ return NULL_TREE. */
+
+extern tree get_qualified_type PARAMS ((tree, int));
+
+/* Like get_qualified_type, but creates the type if it does not
+ exist. This function never returns NULL_TREE. */
extern tree build_qualified_type PARAMS ((tree, int));
@@ -2466,6 +2526,8 @@ extern tree get_set_constructor_bits PARAMS ((tree, char *, int));
extern tree get_set_constructor_bytes PARAMS ((tree,
unsigned char *, int));
extern tree get_callee_fndecl PARAMS ((tree));
+extern void set_decl_assembler_name PARAMS ((tree));
+extern int type_num_arguments PARAMS ((tree));
/* In stmt.c */
@@ -2493,7 +2555,9 @@ extern void expand_end_null_loop PARAMS ((void));
extern int expand_continue_loop PARAMS ((struct nesting *));
extern int expand_exit_loop PARAMS ((struct nesting *));
extern int expand_exit_loop_if_false PARAMS ((struct nesting *,
- tree));
+ tree));
+extern int expand_exit_loop_top_cond PARAMS ((struct nesting *,
+ tree));
extern int expand_exit_something PARAMS ((void));
extern void expand_null_return PARAMS ((void));
@@ -2508,13 +2572,8 @@ extern void start_cleanup_deferral PARAMS ((void));
extern void end_cleanup_deferral PARAMS ((void));
extern int is_body_block PARAMS ((tree));
-extern void mark_block_as_eh_region PARAMS ((void));
-extern void mark_block_as_not_eh_region PARAMS ((void));
-extern int is_eh_region PARAMS ((void));
extern int conditional_context PARAMS ((void));
extern tree last_cleanup_this_contour PARAMS ((void));
-extern int expand_dhc_cleanup PARAMS ((tree));
-extern int expand_dcc_cleanup PARAMS ((tree));
extern void expand_start_case PARAMS ((int, tree, tree,
const char *));
extern void expand_end_case PARAMS ((tree));
@@ -2635,6 +2694,13 @@ extern int objects_must_conflict_p PARAMS ((tree, tree));
/* In c-common.c */
extern HOST_WIDE_INT lang_get_alias_set PARAMS ((tree));
+/* Set the DECL_ASSEMBLER_NAME for a node. If it is the sort of thing
+ that the assembler should talk about, set DECL_ASSEMBLER_NAME to an
+ appropriate IDENTIFIER_NODE. Otherwise, set it to the
+ ERROR_MARK_NODE to ensure that the assembler does not talk about
+ it. */
+extern void (*lang_set_decl_assembler_name) PARAMS ((tree));
+
struct obstack;
/* In tree.c */
@@ -2666,6 +2732,7 @@ extern void print_obstack_name PARAMS ((char *, FILE *,
#endif
extern void expand_function_end PARAMS ((const char *, int, int));
extern void expand_function_start PARAMS ((tree, int));
+extern void expand_pending_sizes PARAMS ((tree));
extern int real_onep PARAMS ((tree));
extern int real_twop PARAMS ((tree));
@@ -2796,6 +2863,9 @@ extern int div_and_round_double PARAMS ((enum tree_code, int,
extern void emit_nop PARAMS ((void));
extern void expand_computed_goto PARAMS ((tree));
extern struct rtx_def *label_rtx PARAMS ((tree));
+extern bool parse_output_constraint PARAMS ((const char **,
+ int, int, int,
+ bool *, bool *, bool *));
extern void expand_asm_operands PARAMS ((tree, tree, tree, tree, int,
const char *, int));
extern int any_pending_cleanups PARAMS ((int));
diff --git a/gcc/unroll.c b/gcc/unroll.c
index 0d3927632b1..d5532c914e2 100644
--- a/gcc/unroll.c
+++ b/gcc/unroll.c
@@ -900,6 +900,9 @@ unroll_loop (loop, insn_count, strength_reduce_p)
register rtx diff;
rtx *labels;
int abs_inc, neg_inc;
+ enum rtx_code cc = loop_info->comparison_code;
+ int less_p = (cc == LE || cc == LEU || cc == LT || cc == LTU);
+ int unsigned_p = (cc == LEU || cc == GEU || cc == LTU || cc == GTU);
map->reg_map = (rtx *) xmalloc (maxregnum * sizeof (rtx));
@@ -932,11 +935,25 @@ unroll_loop (loop, insn_count, strength_reduce_p)
a constant.
We must copy the final and initial values here to avoid
- improperly shared rtl. */
-
- diff = expand_binop (mode, sub_optab, copy_rtx (final_value),
- copy_rtx (initial_value), NULL_RTX, 0,
- OPTAB_LIB_WIDEN);
+ improperly shared rtl.
+
+ We have to deal with for (i = 0; --i < 6;) type loops.
+ For such loops the real final value is the first time the
+ loop variable overflows, so the diff we calculate is the
+ distance from the overflow value. This is 0 or ~0 for
+ unsigned loops depending on the direction, or INT_MAX,
+ INT_MAX+1 for signed loops. We really do not need the
+ exact value, since we are only interested in the diff
+ modulo the increment, and the increment is a power of 2,
+ so we can pretend that the overflow value is 0/~0. */
+
+ if (cc == NE || less_p != neg_inc)
+ diff = expand_binop (mode, sub_optab, copy_rtx (final_value),
+ copy_rtx (initial_value), NULL_RTX, 0,
+ OPTAB_LIB_WIDEN);
+ else
+ diff = expand_unop (mode, neg_inc ? one_cmpl_optab : neg_optab,
+ copy_rtx (initial_value), NULL_RTX, 0);
/* Now calculate (diff % (unroll * abs (increment))) by using an
and instruction. */
@@ -957,11 +974,15 @@ unroll_loop (loop, insn_count, strength_reduce_p)
case. This check does not apply if the loop has a NE
comparison at the end. */
- if (loop_info->comparison_code != NE)
+ if (cc != NE)
{
- emit_cmp_and_jump_insns (initial_value, final_value,
- neg_inc ? LE : GE,
- NULL_RTX, mode, 0, 0, labels[1]);
+ rtx incremented_initval;
+ incremented_initval = expand_binop (mode, add_optab,
+ initial_value, increment,
+ NULL_RTX,0, OPTAB_LIB_WIDEN);
+ emit_cmp_and_jump_insns (incremented_initval, final_value,
+ less_p ? GE : LE, NULL_RTX,
+ mode, unsigned_p, 0, labels[1]);
JUMP_LABEL (get_last_insn ()) = labels[1];
LABEL_NUSES (labels[1])++;
}
@@ -1672,7 +1693,7 @@ initial_reg_note_copy (notes, map)
XEXP (copy, 0) = copy_rtx_and_substitute (XEXP (notes, 0), map, 0);
else if (GET_CODE (notes) == INSN_LIST)
/* Don't substitute for these yet. */
- XEXP (copy, 0) = XEXP (notes, 0);
+ XEXP (copy, 0) = copy_rtx (XEXP (notes, 0));
else
abort ();
@@ -3498,6 +3519,44 @@ loop_iterations (loop)
return 0;
}
+ /* If there are multiple conditionalized loop exit tests, they may jump
+ back to differing CODE_LABELs. */
+ if (loop->top && loop->cont)
+ {
+ rtx temp = PREV_INSN (last_loop_insn);
+
+ do
+ {
+ if (GET_CODE (temp) == JUMP_INSN)
+ {
+ /* There are some kinds of jumps we can't deal with easily. */
+ if (JUMP_LABEL (temp) == 0)
+ {
+ if (loop_dump_stream)
+ fprintf
+ (loop_dump_stream,
+ "Loop iterations: Jump insn has null JUMP_LABEL.\n");
+ return 0;
+ }
+
+ if (/* Previous unrolling may have generated new insns not
+ covered by the uid_luid array. */
+ INSN_UID (JUMP_LABEL (temp)) < max_uid_for_loop
+ /* Check if we jump back into the loop body. */
+ && INSN_LUID (JUMP_LABEL (temp)) > INSN_LUID (loop->top)
+ && INSN_LUID (JUMP_LABEL (temp)) < INSN_LUID (loop->cont))
+ {
+ if (loop_dump_stream)
+ fprintf
+ (loop_dump_stream,
+ "Loop iterations: Loop has multiple back edges.\n");
+ return 0;
+ }
+ }
+ }
+ while ((temp = PREV_INSN (temp)) != loop->cont);
+ }
+
/* Find the iteration variable. If the last insn is a conditional
branch, and the insn before tests a register value, make that the
iteration variable. */
diff --git a/gcc/unwind-dw2-fde.c b/gcc/unwind-dw2-fde.c
new file mode 100644
index 00000000000..f924ef94501
--- /dev/null
+++ b/gcc/unwind-dw2-fde.c
@@ -0,0 +1,1006 @@
+/* Subroutines needed for unwinding stack frames for exception handling. */
+/* Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+ Contributed by Jason Merrill <jason@cygnus.com>.
+
+This file is part of GNU CC.
+
+GNU CC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+In addition to the permissions in the GNU General Public License, the
+Free Software Foundation gives you unlimited permission to link the
+compiled version of this file into combinations with other programs,
+and to distribute those combinations without any restriction coming
+from the use of this file. (The General Public License restrictions
+do apply in other respects; for example, they cover modification of
+the file, and distribution when not linked into a combine
+executable.)
+
+GNU CC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU CC; see the file COPYING. If not, write to
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA. */
+
+#include "tconfig.h"
+#include "tsystem.h"
+#include "dwarf2.h"
+#include "unwind.h"
+#define NO_BASE_OF_ENCODED_VALUE
+#include "unwind-pe.h"
+#include "unwind-dw2-fde.h"
+#include "gthr.h"
+
+/* The unseen_objects list contains objects that have been registered
+ but not yet categorized in any way. The seen_objects list has had
+ it's pc_begin and count fields initialized at minimum, and is sorted
+ by decreasing value of pc_begin. */
+static struct object *unseen_objects;
+static struct object *seen_objects;
+
+#ifdef __GTHREAD_MUTEX_INIT
+static __gthread_mutex_t object_mutex = __GTHREAD_MUTEX_INIT;
+#else
+static __gthread_mutex_t object_mutex;
+#endif
+
+#ifdef __GTHREAD_MUTEX_INIT_FUNCTION
+static void
+init_object_mutex (void)
+{
+ __GTHREAD_MUTEX_INIT_FUNCTION (&object_mutex);
+}
+
+static void
+init_object_mutex_once (void)
+{
+ static __gthread_once_t once = __GTHREAD_ONCE_INIT;
+ __gthread_once (&once, init_object_mutex);
+}
+#else
+#define init_object_mutex_once()
+#endif
+
+/* Called from crtbegin.o to register the unwind info for an object. */
+
+void
+__register_frame_info_bases (void *begin, struct object *ob,
+ void *tbase, void *dbase)
+{
+ ob->pc_begin = (void *)-1;
+ ob->tbase = tbase;
+ ob->dbase = dbase;
+ ob->u.single = begin;
+ ob->s.i = 0;
+ ob->s.b.encoding = DW_EH_PE_omit;
+
+ init_object_mutex_once ();
+ __gthread_mutex_lock (&object_mutex);
+
+ ob->next = unseen_objects;
+ unseen_objects = ob;
+
+ __gthread_mutex_unlock (&object_mutex);
+}
+
+void
+__register_frame_info (void *begin, struct object *ob)
+{
+ __register_frame_info_bases (begin, ob, 0, 0);
+}
+
+void
+__register_frame (void *begin)
+{
+ struct object *ob = (struct object *) malloc (sizeof (struct object));
+ __register_frame_info (begin, ob);
+}
+
+/* Similar, but BEGIN is actually a pointer to a table of unwind entries
+ for different translation units. Called from the file generated by
+ collect2. */
+
+void
+__register_frame_info_table_bases (void *begin, struct object *ob,
+ void *tbase, void *dbase)
+{
+ ob->pc_begin = (void *)-1;
+ ob->tbase = tbase;
+ ob->dbase = dbase;
+ ob->u.array = begin;
+ ob->s.i = 0;
+ ob->s.b.from_array = 1;
+ ob->s.b.encoding = DW_EH_PE_omit;
+
+ init_object_mutex_once ();
+ __gthread_mutex_lock (&object_mutex);
+
+ ob->next = unseen_objects;
+ unseen_objects = ob;
+
+ __gthread_mutex_unlock (&object_mutex);
+}
+
+void
+__register_frame_info_table (void *begin, struct object *ob)
+{
+ __register_frame_info_table_bases (begin, ob, 0, 0);
+}
+
+void
+__register_frame_table (void *begin)
+{
+ struct object *ob = (struct object *) malloc (sizeof (struct object));
+ __register_frame_info_table (begin, ob);
+}
+
+/* Called from crtbegin.o to deregister the unwind info for an object. */
+/* ??? Glibc has for a while now exported __register_frame_info and
+ __deregister_frame_info. If we call __register_frame_info_bases
+ from crtbegin (wherein it is declared weak), and this object does
+ not get pulled from libgcc.a for other reasons, then the
+ invocation of __deregister_frame_info will be resolved from glibc.
+ Since the registration did not happen there, we'll abort.
+
+ Therefore, declare a new deregistration entry point that does the
+ exact same thing, but will resolve to the same library as
+ implements __register_frame_info_bases. */
+
+void *
+__deregister_frame_info_bases (void *begin)
+{
+ struct object **p;
+ struct object *ob = 0;
+
+ init_object_mutex_once ();
+ __gthread_mutex_lock (&object_mutex);
+
+ for (p = &unseen_objects; *p ; p = &(*p)->next)
+ if ((*p)->u.single == begin)
+ {
+ ob = *p;
+ *p = ob->next;
+ goto out;
+ }
+
+ for (p = &seen_objects; *p ; p = &(*p)->next)
+ if ((*p)->s.b.sorted)
+ {
+ if ((*p)->u.sort->orig_data == begin)
+ {
+ ob = *p;
+ *p = ob->next;
+ free (ob->u.sort);
+ goto out;
+ }
+ }
+ else
+ {
+ if ((*p)->u.single == begin)
+ {
+ ob = *p;
+ *p = ob->next;
+ goto out;
+ }
+ }
+
+ __gthread_mutex_unlock (&object_mutex);
+ abort ();
+
+ out:
+ __gthread_mutex_unlock (&object_mutex);
+ return (void *) ob;
+}
+
+void *
+__deregister_frame_info (void *begin)
+{
+ return __deregister_frame_info_bases (begin);
+}
+
+void
+__deregister_frame (void *begin)
+{
+ free (__deregister_frame_info (begin));
+}
+
+
+/* Like base_of_encoded_value, but take the base from a struct object
+ instead of an _Unwind_Context. */
+
+static _Unwind_Ptr
+base_from_object (unsigned char encoding, struct object *ob)
+{
+ if (encoding == DW_EH_PE_omit)
+ return 0;
+
+ switch (encoding & 0x70)
+ {
+ case DW_EH_PE_absptr:
+ case DW_EH_PE_pcrel:
+ case DW_EH_PE_aligned:
+ return 0;
+
+ case DW_EH_PE_textrel:
+ return (_Unwind_Ptr) ob->tbase;
+ case DW_EH_PE_datarel:
+ return (_Unwind_Ptr) ob->dbase;
+ }
+ abort ();
+}
+
+/* Return the FDE pointer encoding from the CIE. */
+/* ??? This is a subset of extract_cie_info from unwind-dw2.c. */
+
+static int
+get_cie_encoding (struct dwarf_cie *cie)
+{
+ const unsigned char *aug, *p;
+ _Unwind_Ptr dummy;
+
+ aug = cie->augmentation;
+ if (aug[0] != 'z')
+ return DW_EH_PE_absptr;
+
+ p = aug + strlen (aug) + 1; /* Skip the augmentation string. */
+ p = read_uleb128 (p, &dummy); /* Skip code alignment. */
+ p = read_sleb128 (p, &dummy); /* Skip data alignment. */
+ p++; /* Skip return address column. */
+
+ aug++; /* Skip 'z' */
+ p = read_uleb128 (p, &dummy); /* Skip augmentation length. */
+ while (1)
+ {
+ /* This is what we're looking for. */
+ if (*aug == 'R')
+ return *p;
+ /* Personality encoding and pointer. */
+ else if (*aug == 'P')
+ {
+ /* ??? Avoid dereferencing indirect pointers, since we're
+ faking the base address. Gotta keep DW_EH_PE_aligned
+ intact, however. */
+ p = read_encoded_value_with_base (*p & 0x7F, 0, p + 1, &dummy);
+ }
+ /* LSDA encoding. */
+ else if (*aug == 'L')
+ p++;
+ /* Otherwise end of string, or unknown augmentation. */
+ else
+ return DW_EH_PE_absptr;
+ aug++;
+ }
+}
+
+static inline int
+get_fde_encoding (struct dwarf_fde *f)
+{
+ return get_cie_encoding (get_cie (f));
+}
+
+
+/* Sorting an array of FDEs by address.
+ (Ideally we would have the linker sort the FDEs so we don't have to do
+ it at run time. But the linkers are not yet prepared for this.) */
+
+/* Comparison routines. Three variants of increasing complexity. */
+
+static int
+fde_unencoded_compare (struct object *ob __attribute__((unused)),
+ fde *x, fde *y)
+{
+ _Unwind_Ptr x_ptr = *(_Unwind_Ptr *) x->pc_begin;
+ _Unwind_Ptr y_ptr = *(_Unwind_Ptr *) y->pc_begin;
+
+ if (x_ptr > y_ptr)
+ return 1;
+ if (x_ptr < y_ptr)
+ return -1;
+ return 0;
+}
+
+static int
+fde_single_encoding_compare (struct object *ob, fde *x, fde *y)
+{
+ _Unwind_Ptr base, x_ptr, y_ptr;
+
+ base = base_from_object (ob->s.b.encoding, ob);
+ read_encoded_value_with_base (ob->s.b.encoding, base, x->pc_begin, &x_ptr);
+ read_encoded_value_with_base (ob->s.b.encoding, base, y->pc_begin, &y_ptr);
+
+ if (x_ptr > y_ptr)
+ return 1;
+ if (x_ptr < y_ptr)
+ return -1;
+ return 0;
+}
+
+static int
+fde_mixed_encoding_compare (struct object *ob, fde *x, fde *y)
+{
+ int x_encoding, y_encoding;
+ _Unwind_Ptr x_ptr, y_ptr;
+
+ x_encoding = get_fde_encoding (x);
+ read_encoded_value_with_base (x_encoding, base_from_object (x_encoding, ob),
+ x->pc_begin, &x_ptr);
+
+ y_encoding = get_fde_encoding (y);
+ read_encoded_value_with_base (y_encoding, base_from_object (y_encoding, ob),
+ y->pc_begin, &y_ptr);
+
+ if (x_ptr > y_ptr)
+ return 1;
+ if (x_ptr < y_ptr)
+ return -1;
+ return 0;
+}
+
+typedef int (*fde_compare_t) (struct object *, fde *, fde *);
+
+
+/* This is a special mix of insertion sort and heap sort, optimized for
+ the data sets that actually occur. They look like
+ 101 102 103 127 128 105 108 110 190 111 115 119 125 160 126 129 130.
+ I.e. a linearly increasing sequence (coming from functions in the text
+ section), with additionally a few unordered elements (coming from functions
+ in gnu_linkonce sections) whose values are higher than the values in the
+ surrounding linear sequence (but not necessarily higher than the values
+ at the end of the linear sequence!).
+ The worst-case total run time is O(N) + O(n log (n)), where N is the
+ total number of FDEs and n is the number of erratic ones. */
+
+struct fde_accumulator
+{
+ struct fde_vector *linear;
+ struct fde_vector *erratic;
+};
+
+static inline int
+start_fde_sort (struct fde_accumulator *accu, size_t count)
+{
+ size_t size;
+ if (! count)
+ return 0;
+
+ size = sizeof (struct fde_vector) + sizeof (fde *) * count;
+ if ((accu->linear = (struct fde_vector *) malloc (size)))
+ {
+ accu->linear->count = 0;
+ if ((accu->erratic = (struct fde_vector *) malloc (size)))
+ accu->erratic->count = 0;
+ return 1;
+ }
+ else
+ return 0;
+}
+
+static inline void
+fde_insert (struct fde_accumulator *accu, fde *this_fde)
+{
+ if (accu->linear)
+ accu->linear->array[accu->linear->count++] = this_fde;
+}
+
+/* Split LINEAR into a linear sequence with low values and an erratic
+ sequence with high values, put the linear one (of longest possible
+ length) into LINEAR and the erratic one into ERRATIC. This is O(N).
+
+ Because the longest linear sequence we are trying to locate within the
+ incoming LINEAR array can be interspersed with (high valued) erratic
+ entries. We construct a chain indicating the sequenced entries.
+ To avoid having to allocate this chain, we overlay it onto the space of
+ the ERRATIC array during construction. A final pass iterates over the
+ chain to determine what should be placed in the ERRATIC array, and
+ what is the linear sequence. This overlay is safe from aliasing. */
+
+static inline void
+fde_split (struct object *ob, fde_compare_t fde_compare,
+ struct fde_vector *linear, struct fde_vector *erratic)
+{
+ static fde *marker;
+ size_t count = linear->count;
+ fde **chain_end = &marker;
+ size_t i, j, k;
+
+ /* This should optimize out, but it is wise to make sure this assumption
+ is correct. Should these have different sizes, we cannot cast between
+ them and the overlaying onto ERRATIC will not work. */
+ if (sizeof (fde *) != sizeof (fde **))
+ abort ();
+
+ for (i = 0; i < count; i++)
+ {
+ fde **probe;
+
+ for (probe = chain_end;
+ probe != &marker && fde_compare (ob, linear->array[i], *probe) < 0;
+ probe = chain_end)
+ {
+ chain_end = (fde **)erratic->array[probe - linear->array];
+ erratic->array[probe - linear->array] = NULL;
+ }
+ erratic->array[i] = (fde *)chain_end;
+ chain_end = &linear->array[i];
+ }
+
+ /* Each entry in LINEAR which is part of the linear sequence we have
+ discovered will correspond to a non-NULL entry in the chain we built in
+ the ERRATIC array. */
+ for (i = j = k = 0; i < count; i++)
+ if (erratic->array[i])
+ linear->array[j++] = linear->array[i];
+ else
+ erratic->array[k++] = linear->array[i];
+ linear->count = j;
+ erratic->count = k;
+}
+
+/* This is O(n log(n)). BSD/OS defines heapsort in stdlib.h, so we must
+ use a name that does not conflict. */
+
+static void
+frame_heapsort (struct object *ob, fde_compare_t fde_compare,
+ struct fde_vector *erratic)
+{
+ /* For a description of this algorithm, see:
+ Samuel P. Harbison, Guy L. Steele Jr.: C, a reference manual, 2nd ed.,
+ p. 60-61. */
+ fde ** a = erratic->array;
+ /* A portion of the array is called a "heap" if for all i>=0:
+ If i and 2i+1 are valid indices, then a[i] >= a[2i+1].
+ If i and 2i+2 are valid indices, then a[i] >= a[2i+2]. */
+#define SWAP(x,y) do { fde * tmp = x; x = y; y = tmp; } while (0)
+ size_t n = erratic->count;
+ size_t m = n;
+ size_t i;
+
+ while (m > 0)
+ {
+ /* Invariant: a[m..n-1] is a heap. */
+ m--;
+ for (i = m; 2*i+1 < n; )
+ {
+ if (2*i+2 < n
+ && fde_compare (ob, a[2*i+2], a[2*i+1]) > 0
+ && fde_compare (ob, a[2*i+2], a[i]) > 0)
+ {
+ SWAP (a[i], a[2*i+2]);
+ i = 2*i+2;
+ }
+ else if (fde_compare (ob, a[2*i+1], a[i]) > 0)
+ {
+ SWAP (a[i], a[2*i+1]);
+ i = 2*i+1;
+ }
+ else
+ break;
+ }
+ }
+ while (n > 1)
+ {
+ /* Invariant: a[0..n-1] is a heap. */
+ n--;
+ SWAP (a[0], a[n]);
+ for (i = 0; 2*i+1 < n; )
+ {
+ if (2*i+2 < n
+ && fde_compare (ob, a[2*i+2], a[2*i+1]) > 0
+ && fde_compare (ob, a[2*i+2], a[i]) > 0)
+ {
+ SWAP (a[i], a[2*i+2]);
+ i = 2*i+2;
+ }
+ else if (fde_compare (ob, a[2*i+1], a[i]) > 0)
+ {
+ SWAP (a[i], a[2*i+1]);
+ i = 2*i+1;
+ }
+ else
+ break;
+ }
+ }
+#undef SWAP
+}
+
+/* Merge V1 and V2, both sorted, and put the result into V1. */
+static inline void
+fde_merge (struct object *ob, fde_compare_t fde_compare,
+ struct fde_vector *v1, struct fde_vector *v2)
+{
+ size_t i1, i2;
+ fde * fde2;
+
+ i2 = v2->count;
+ if (i2 > 0)
+ {
+ i1 = v1->count;
+ do {
+ i2--;
+ fde2 = v2->array[i2];
+ while (i1 > 0 && fde_compare (ob, v1->array[i1-1], fde2) > 0)
+ {
+ v1->array[i1+i2] = v1->array[i1-1];
+ i1--;
+ }
+ v1->array[i1+i2] = fde2;
+ } while (i2 > 0);
+ v1->count += v2->count;
+ }
+}
+
+static inline void
+end_fde_sort (struct object *ob, struct fde_accumulator *accu, size_t count)
+{
+ fde_compare_t fde_compare;
+
+ if (accu->linear && accu->linear->count != count)
+ abort ();
+
+ if (ob->s.b.mixed_encoding)
+ fde_compare = fde_mixed_encoding_compare;
+ else if (ob->s.b.encoding == DW_EH_PE_absptr)
+ fde_compare = fde_unencoded_compare;
+ else
+ fde_compare = fde_single_encoding_compare;
+
+ if (accu->erratic)
+ {
+ fde_split (ob, fde_compare, accu->linear, accu->erratic);
+ if (accu->linear->count + accu->erratic->count != count)
+ abort ();
+ frame_heapsort (ob, fde_compare, accu->erratic);
+ fde_merge (ob, fde_compare, accu->linear, accu->erratic);
+ free (accu->erratic);
+ }
+ else
+ {
+ /* We've not managed to malloc an erratic array,
+ so heap sort in the linear one. */
+ frame_heapsort (ob, fde_compare, accu->linear);
+ }
+}
+
+
+/* Update encoding, mixed_encoding, and pc_begin for OB for the
+ fde array beginning at THIS_FDE. Return the number of fdes
+ encountered along the way. */
+
+static size_t
+classify_object_over_fdes (struct object *ob, fde *this_fde)
+{
+ struct dwarf_cie *last_cie = 0;
+ size_t count = 0;
+ int encoding = DW_EH_PE_absptr;
+ _Unwind_Ptr base = 0;
+
+ for (; this_fde->length != 0; this_fde = next_fde (this_fde))
+ {
+ struct dwarf_cie *this_cie;
+ _Unwind_Ptr mask, pc_begin;
+
+ /* Skip CIEs. */
+ if (this_fde->CIE_delta == 0)
+ continue;
+
+ /* Determine the encoding for this FDE. Note mixed encoded
+ objects for later. */
+ this_cie = get_cie (this_fde);
+ if (this_cie != last_cie)
+ {
+ last_cie = this_cie;
+ encoding = get_cie_encoding (this_cie);
+ base = base_from_object (encoding, ob);
+ if (ob->s.b.encoding == DW_EH_PE_omit)
+ ob->s.b.encoding = encoding;
+ else if (ob->s.b.encoding != encoding)
+ ob->s.b.mixed_encoding = 1;
+ }
+
+ read_encoded_value_with_base (encoding, base, this_fde->pc_begin,
+ &pc_begin);
+
+ /* Take care to ignore link-once functions that were removed.
+ In these cases, the function address will be NULL, but if
+ the encoding is smaller than a pointer a true NULL may not
+ be representable. Assume 0 in the representable bits is NULL. */
+ mask = size_of_encoded_value (encoding);
+ if (mask < sizeof (void *))
+ mask = (1L << (mask << 3)) - 1;
+ else
+ mask = -1;
+
+ if ((pc_begin & mask) == 0)
+ continue;
+
+ count += 1;
+ if ((void *)pc_begin < ob->pc_begin)
+ ob->pc_begin = (void *)pc_begin;
+ }
+
+ return count;
+}
+
+static void
+add_fdes (struct object *ob, struct fde_accumulator *accu, fde *this_fde)
+{
+ struct dwarf_cie *last_cie = 0;
+ int encoding = ob->s.b.encoding;
+ _Unwind_Ptr base = base_from_object (ob->s.b.encoding, ob);
+
+ for (; this_fde->length != 0; this_fde = next_fde (this_fde))
+ {
+ struct dwarf_cie *this_cie;
+
+ /* Skip CIEs. */
+ if (this_fde->CIE_delta == 0)
+ continue;
+
+ if (ob->s.b.mixed_encoding)
+ {
+ /* Determine the encoding for this FDE. Note mixed encoded
+ objects for later. */
+ this_cie = get_cie (this_fde);
+ if (this_cie != last_cie)
+ {
+ last_cie = this_cie;
+ encoding = get_cie_encoding (this_cie);
+ base = base_from_object (encoding, ob);
+ }
+ }
+
+ if (encoding == DW_EH_PE_absptr)
+ {
+ if (*(_Unwind_Ptr *)this_fde->pc_begin == 0)
+ continue;
+ }
+ else
+ {
+ _Unwind_Ptr pc_begin, mask;
+
+ read_encoded_value_with_base (encoding, base, this_fde->pc_begin,
+ &pc_begin);
+
+ /* Take care to ignore link-once functions that were removed.
+ In these cases, the function address will be NULL, but if
+ the encoding is smaller than a pointer a true NULL may not
+ be representable. Assume 0 in the representable bits is NULL. */
+ mask = size_of_encoded_value (encoding);
+ if (mask < sizeof (void *))
+ mask = (1L << (mask << 3)) - 1;
+ else
+ mask = -1;
+
+ if ((pc_begin & mask) == 0)
+ continue;
+ }
+
+ fde_insert (accu, this_fde);
+ }
+}
+
+/* Set up a sorted array of pointers to FDEs for a loaded object. We
+ count up the entries before allocating the array because it's likely to
+ be faster. We can be called multiple times, should we have failed to
+ allocate a sorted fde array on a previous occasion. */
+
+static inline void
+init_object (struct object* ob)
+{
+ struct fde_accumulator accu;
+ size_t count;
+
+ count = ob->s.b.count;
+ if (count == 0)
+ {
+ if (ob->s.b.from_array)
+ {
+ fde **p = ob->u.array;
+ for (count = 0; *p; ++p)
+ count += classify_object_over_fdes (ob, *p);
+ }
+ else
+ count = classify_object_over_fdes (ob, ob->u.single);
+
+ /* The count field we have in the main struct object is somewhat
+ limited, but should suffice for virtually all cases. If the
+ counted value doesn't fit, re-write a zero. The worst that
+ happens is that we re-count next time -- admittedly non-trivial
+ in that this implies some 2M fdes, but at least we function. */
+ ob->s.b.count = count;
+ if (ob->s.b.count != count)
+ ob->s.b.count = 0;
+ }
+
+ if (!start_fde_sort (&accu, count))
+ return;
+
+ if (ob->s.b.from_array)
+ {
+ fde **p;
+ for (p = ob->u.array; *p; ++p)
+ add_fdes (ob, &accu, *p);
+ }
+ else
+ add_fdes (ob, &accu, ob->u.single);
+
+ end_fde_sort (ob, &accu, count);
+
+ /* Save the original fde pointer, since this is the key by which the
+ DSO will deregister the object. */
+ accu.linear->orig_data = ob->u.single;
+ ob->u.sort = accu.linear;
+
+ ob->s.b.sorted = 1;
+}
+
+/* A linear search through a set of FDEs for the given PC. This is
+ used when there was insufficient memory to allocate and sort an
+ array. */
+
+static fde *
+linear_search_fdes (struct object *ob, fde *this_fde, void *pc)
+{
+ struct dwarf_cie *last_cie = 0;
+ int encoding = ob->s.b.encoding;
+ _Unwind_Ptr base = base_from_object (ob->s.b.encoding, ob);
+
+ for (; this_fde->length != 0; this_fde = next_fde (this_fde))
+ {
+ struct dwarf_cie *this_cie;
+ _Unwind_Ptr pc_begin, pc_range;
+
+ /* Skip CIEs. */
+ if (this_fde->CIE_delta == 0)
+ continue;
+
+ if (ob->s.b.mixed_encoding)
+ {
+ /* Determine the encoding for this FDE. Note mixed encoded
+ objects for later. */
+ this_cie = get_cie (this_fde);
+ if (this_cie != last_cie)
+ {
+ last_cie = this_cie;
+ encoding = get_cie_encoding (this_cie);
+ base = base_from_object (encoding, ob);
+ }
+ }
+
+ if (encoding == DW_EH_PE_absptr)
+ {
+ pc_begin = ((_Unwind_Ptr *)this_fde->pc_begin)[0];
+ pc_range = ((_Unwind_Ptr *)this_fde->pc_begin)[1];
+ if (pc_begin == 0)
+ continue;
+ }
+ else
+ {
+ _Unwind_Ptr mask;
+ const char *p;
+
+ p = read_encoded_value_with_base (encoding, base,
+ this_fde->pc_begin, &pc_begin);
+ read_encoded_value_with_base (encoding & 0x0F, 0, p, &pc_range);
+
+ /* Take care to ignore link-once functions that were removed.
+ In these cases, the function address will be NULL, but if
+ the encoding is smaller than a pointer a true NULL may not
+ be representable. Assume 0 in the representable bits is NULL. */
+ mask = size_of_encoded_value (encoding);
+ if (mask < sizeof (void *))
+ mask = (1L << (mask << 3)) - 1;
+ else
+ mask = -1;
+
+ if ((pc_begin & mask) == 0)
+ continue;
+ }
+
+ if ((_Unwind_Ptr)pc - pc_begin < pc_range)
+ return this_fde;
+ }
+
+ return NULL;
+}
+
+/* Binary search for an FDE containing the given PC. Here are three
+ implementations of increasing complexity. */
+
+static inline fde *
+binary_search_unencoded_fdes (struct object *ob, void *pc)
+{
+ struct fde_vector *vec = ob->u.sort;
+ size_t lo, hi;
+
+ for (lo = 0, hi = vec->count; lo < hi; )
+ {
+ size_t i = (lo + hi) / 2;
+ fde *f = vec->array[i];
+ void *pc_begin;
+ uaddr pc_range;
+
+ pc_begin = ((void **)f->pc_begin)[0];
+ pc_range = ((uaddr *)f->pc_begin)[1];
+
+ if (pc < pc_begin)
+ hi = i;
+ else if (pc >= pc_begin + pc_range)
+ lo = i + 1;
+ else
+ return f;
+ }
+
+ return NULL;
+}
+
+static inline fde *
+binary_search_single_encoding_fdes (struct object *ob, void *pc)
+{
+ struct fde_vector *vec = ob->u.sort;
+ int encoding = ob->s.b.encoding;
+ _Unwind_Ptr base = base_from_object (encoding, ob);
+ size_t lo, hi;
+
+ for (lo = 0, hi = vec->count; lo < hi; )
+ {
+ size_t i = (lo + hi) / 2;
+ fde *f = vec->array[i];
+ _Unwind_Ptr pc_begin, pc_range;
+ const char *p;
+
+ p = read_encoded_value_with_base (encoding, base, f->pc_begin,
+ &pc_begin);
+ read_encoded_value_with_base (encoding & 0x0F, 0, p, &pc_range);
+
+ if ((_Unwind_Ptr)pc < pc_begin)
+ hi = i;
+ else if ((_Unwind_Ptr)pc >= pc_begin + pc_range)
+ lo = i + 1;
+ else
+ return f;
+ }
+
+ return NULL;
+}
+
+static inline fde *
+binary_search_mixed_encoding_fdes (struct object *ob, void *pc)
+{
+ struct fde_vector *vec = ob->u.sort;
+ size_t lo, hi;
+
+ for (lo = 0, hi = vec->count; lo < hi; )
+ {
+ size_t i = (lo + hi) / 2;
+ fde *f = vec->array[i];
+ _Unwind_Ptr pc_begin, pc_range;
+ const char *p;
+ int encoding;
+
+ encoding = get_fde_encoding (f);
+ p = read_encoded_value_with_base (encoding,
+ base_from_object (encoding, ob),
+ f->pc_begin, &pc_begin);
+ read_encoded_value_with_base (encoding & 0x0F, 0, p, &pc_range);
+
+ if ((_Unwind_Ptr)pc < pc_begin)
+ hi = i;
+ else if ((_Unwind_Ptr)pc >= pc_begin + pc_range)
+ lo = i + 1;
+ else
+ return f;
+ }
+
+ return NULL;
+}
+
+static fde *
+search_object (struct object* ob, void *pc)
+{
+ /* If the data hasn't been sorted, try to do this now. We may have
+ more memory available than last time we tried. */
+ if (! ob->s.b.sorted)
+ {
+ init_object (ob);
+
+ /* Despite the above comment, the normal reason to get here is
+ that we've not processed this object before. A quick range
+ check is in order. */
+ if (pc < ob->pc_begin)
+ return NULL;
+ }
+
+ if (ob->s.b.sorted)
+ {
+ if (ob->s.b.mixed_encoding)
+ return binary_search_mixed_encoding_fdes (ob, pc);
+ else if (ob->s.b.encoding == DW_EH_PE_absptr)
+ return binary_search_unencoded_fdes (ob, pc);
+ else
+ return binary_search_single_encoding_fdes (ob, pc);
+ }
+ else
+ {
+ /* Long slow labourious linear search, cos we've no memory. */
+ if (ob->s.b.from_array)
+ {
+ fde **p;
+ for (p = ob->u.array; *p ; p++)
+ {
+ fde *f = linear_search_fdes (ob, *p, pc);
+ if (f)
+ return f;
+ }
+ return NULL;
+ }
+ else
+ return linear_search_fdes (ob, ob->u.single, pc);
+ }
+}
+
+fde *
+_Unwind_Find_FDE (void *pc, struct dwarf_eh_bases *bases)
+{
+ struct object *ob;
+ fde *f = NULL;
+
+ init_object_mutex_once ();
+ __gthread_mutex_lock (&object_mutex);
+
+ /* Linear search through the classified objects, to find the one
+ containing the pc. Note that pc_begin is sorted decending, and
+ we expect objects to be non-overlapping. */
+ for (ob = seen_objects; ob; ob = ob->next)
+ if (pc >= ob->pc_begin)
+ {
+ f = search_object (ob, pc);
+ if (f)
+ goto fini;
+ break;
+ }
+
+ /* Classify and search the objects we've not yet processed. */
+ while ((ob = unseen_objects))
+ {
+ struct object **p;
+
+ unseen_objects = ob->next;
+ f = search_object (ob, pc);
+
+ /* Insert the object into the classified list. */
+ for (p = &seen_objects; *p ; p = &(*p)->next)
+ if ((*p)->pc_begin < ob->pc_begin)
+ break;
+ ob->next = *p;
+ *p = ob;
+
+ if (f)
+ goto fini;
+ }
+
+ fini:
+ __gthread_mutex_unlock (&object_mutex);
+
+ if (f)
+ {
+ int encoding;
+
+ bases->tbase = ob->tbase;
+ bases->dbase = ob->dbase;
+
+ encoding = ob->s.b.encoding;
+ if (ob->s.b.mixed_encoding)
+ encoding = get_fde_encoding (f);
+ read_encoded_value_with_base (encoding, base_from_object (encoding, ob),
+ f->pc_begin, (_Unwind_Ptr *)&bases->func);
+ }
+
+ return f;
+}
diff --git a/gcc/unwind-dw2-fde.h b/gcc/unwind-dw2-fde.h
new file mode 100644
index 00000000000..3d7df409e64
--- /dev/null
+++ b/gcc/unwind-dw2-fde.h
@@ -0,0 +1,161 @@
+/* Subroutines needed for unwinding stack frames for exception handling. */
+/* Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+ Contributed by Jason Merrill <jason@cygnus.com>.
+
+This file is part of GNU CC.
+
+GNU CC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+In addition to the permissions in the GNU General Public License, the
+Free Software Foundation gives you unlimited permission to link the
+compiled version of this file into combinations with other programs,
+and to distribute those combinations without any restriction coming
+from the use of this file. (The General Public License restrictions
+do apply in other respects; for example, they cover modification of
+the file, and distribution when not linked into a combine
+executable.)
+
+GNU CC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU CC; see the file COPYING. If not, write to
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA. */
+
+
+struct fde_vector
+{
+ void *orig_data;
+ size_t count;
+ struct dwarf_fde *array[];
+};
+
+struct object
+{
+ void *pc_begin;
+ void *tbase;
+ void *dbase;
+ union {
+ struct dwarf_fde *single;
+ struct dwarf_fde **array;
+ struct fde_vector *sort;
+ } u;
+
+ union {
+ struct {
+ unsigned long sorted : 1;
+ unsigned long from_array : 1;
+ unsigned long mixed_encoding : 1;
+ unsigned long encoding : 8;
+ /* ??? Wish there was an easy way to detect a 64-bit host here;
+ we've got 32 bits left to play with... */
+ unsigned long count : 21;
+ } b;
+ size_t i;
+ } s;
+
+ struct object *next;
+};
+
+/* This is the original definition of struct object. While the struct
+ itself was opaque to users, they did know how large it was, and
+ allocate one statically in crtbegin for each DSO. Keep this around
+ so that we're aware of the static size limitations for the new struct. */
+struct old_object
+{
+ void *pc_begin;
+ void *pc_end;
+ struct dwarf_fde *fde_begin;
+ struct dwarf_fde **fde_array;
+ size_t count;
+ struct old_object *next;
+};
+
+struct dwarf_eh_bases
+{
+ void *tbase;
+ void *dbase;
+ void *func;
+};
+
+
+extern void __register_frame_info_bases (void *, struct object *,
+ void *, void *);
+extern void __register_frame_info (void *, struct object *);
+extern void __register_frame (void *);
+extern void __register_frame_info_table_bases (void *, struct object *,
+ void *, void *);
+extern void __register_frame_info_table (void *, struct object *);
+extern void __register_frame_table (void *);
+extern void *__deregister_frame_info (void *);
+extern void *__deregister_frame_info_bases (void *);
+extern void __deregister_frame (void *);
+
+
+typedef int sword __attribute__ ((mode (SI)));
+typedef unsigned int uword __attribute__ ((mode (SI)));
+typedef unsigned int uaddr __attribute__ ((mode (pointer)));
+typedef int saddr __attribute__ ((mode (pointer)));
+typedef unsigned char ubyte;
+
+/* Terminology:
+ CIE - Common Information Element
+ FDE - Frame Descriptor Element
+
+ There is one per function, and it describes where the function code
+ is located, and what the register lifetimes and stack layout are
+ within the function.
+
+ The data structures are defined in the DWARF specfication, although
+ not in a very readable way (see LITERATURE).
+
+ Every time an exception is thrown, the code needs to locate the FDE
+ for the current function, and starts to look for exception regions
+ from that FDE. This works in a two-level search:
+ a) in a linear search, find the shared image (i.e. DLL) containing
+ the PC
+ b) using the FDE table for that shared object, locate the FDE using
+ binary search (which requires the sorting). */
+
+/* The first few fields of a CIE. The CIE_id field is 0 for a CIE,
+ to distinguish it from a valid FDE. FDEs are aligned to an addressing
+ unit boundary, but the fields within are unaligned. */
+struct dwarf_cie
+{
+ uword length;
+ sword CIE_id;
+ ubyte version;
+ unsigned char augmentation[];
+} __attribute__ ((packed, aligned (__alignof__ (void *))));
+
+/* The first few fields of an FDE. */
+struct dwarf_fde
+{
+ uword length;
+ sword CIE_delta;
+ unsigned char pc_begin[];
+} __attribute__ ((packed, aligned (__alignof__ (void *))));
+
+typedef struct dwarf_fde fde;
+
+/* Locate the CIE for a given FDE. */
+
+static inline struct dwarf_cie *
+get_cie (struct dwarf_fde *f)
+{
+ return (void *)&f->CIE_delta - f->CIE_delta;
+}
+
+static inline fde *
+next_fde (fde *f)
+{
+ return (fde *)((char *)f + f->length + sizeof (f->length));
+}
+
+extern fde * _Unwind_Find_FDE (void *, struct dwarf_eh_bases *);
diff --git a/gcc/unwind-dw2.c b/gcc/unwind-dw2.c
new file mode 100644
index 00000000000..c1aa67fdb5a
--- /dev/null
+++ b/gcc/unwind-dw2.c
@@ -0,0 +1,1186 @@
+/* DWARF2 exception handling and frame unwind runtime interface routines.
+ Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+
+ This file is part of GNU CC.
+
+ GNU CC is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ GNU CC is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GNU CC; see the file COPYING. If not, write to
+ the Free Software Foundation, 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include "tconfig.h"
+#include "tsystem.h"
+#include "dwarf2.h"
+#include "unwind.h"
+#include "unwind-pe.h"
+#include "unwind-dw2-fde.h"
+#include "gthr.h"
+
+
+#if !USING_SJLJ_EXCEPTIONS
+
+#ifndef STACK_GROWS_DOWNWARD
+#define STACK_GROWS_DOWNWARD 0
+#else
+#undef STACK_GROWS_DOWNWARD
+#define STACK_GROWS_DOWNWARD 1
+#endif
+
+/* A target can override (perhaps for backward compatibility) how
+ many dwarf2 columns are unwound. */
+#ifndef DWARF_FRAME_REGISTERS
+#define DWARF_FRAME_REGISTERS FIRST_PSEUDO_REGISTER
+#endif
+
+/* This is the register and unwind state for a particular frame. */
+struct _Unwind_Context
+{
+ void *reg[DWARF_FRAME_REGISTERS+1];
+ void *cfa;
+ void *ra;
+ void *lsda;
+ struct dwarf_eh_bases bases;
+ _Unwind_Word args_size;
+};
+
+/* Byte size of every register managed by these routines. */
+static unsigned char dwarf_reg_size_table[DWARF_FRAME_REGISTERS];
+
+
+/* The result of interpreting the frame unwind info for a frame.
+ This is all symbolic at this point, as none of the values can
+ be resolved until the target pc is located. */
+typedef struct
+{
+ /* Each register save state can be described in terms of a CFA slot,
+ another register, or a location expression. */
+ struct frame_state_reg_info
+ {
+ struct {
+ union {
+ unsigned int reg;
+ _Unwind_Sword offset;
+ const unsigned char *exp;
+ } loc;
+ enum {
+ REG_UNSAVED,
+ REG_SAVED_OFFSET,
+ REG_SAVED_REG,
+ REG_SAVED_EXP,
+ } how;
+ } reg[DWARF_FRAME_REGISTERS+1];
+
+ /* Used to implement DW_CFA_remember_state. */
+ struct frame_state_reg_info *prev;
+ } regs;
+
+ /* The CFA can be described in terms of a reg+offset or a
+ location expression. */
+ _Unwind_Sword cfa_offset;
+ _Unwind_Word cfa_reg;
+ const unsigned char *cfa_exp;
+ enum {
+ CFA_UNSET,
+ CFA_REG_OFFSET,
+ CFA_EXP,
+ } cfa_how;
+
+ /* The PC described by the current frame state. */
+ void *pc;
+
+ /* The information we care about from the CIE/FDE. */
+ _Unwind_Personality_Fn personality;
+ signed int data_align;
+ unsigned int code_align;
+ unsigned char retaddr_column;
+ unsigned char fde_encoding;
+ unsigned char lsda_encoding;
+ unsigned char saw_z;
+ void *eh_ptr;
+} _Unwind_FrameState;
+
+/* Read unaligned data from the instruction buffer. */
+
+union unaligned
+{
+ void *p;
+ unsigned u2 __attribute__ ((mode (HI)));
+ unsigned u4 __attribute__ ((mode (SI)));
+ unsigned u8 __attribute__ ((mode (DI)));
+ signed s2 __attribute__ ((mode (HI)));
+ signed s4 __attribute__ ((mode (SI)));
+ signed s8 __attribute__ ((mode (DI)));
+} __attribute__ ((packed));
+
+static inline void *
+read_pointer (const void *p) { const union unaligned *up = p; return up->p; }
+
+static inline int
+read_1u (const void *p) { return *(const unsigned char *)p; }
+
+static inline int
+read_1s (const void *p) { return *(const signed char *)p; }
+
+static inline int
+read_2u (const void *p) { const union unaligned *up = p; return up->u2; }
+
+static inline int
+read_2s (const void *p) { const union unaligned *up = p; return up->s2; }
+
+static inline unsigned int
+read_4u (const void *p) { const union unaligned *up = p; return up->u4; }
+
+static inline int
+read_4s (const void *p) { const union unaligned *up = p; return up->s4; }
+
+static inline unsigned long
+read_8u (const void *p) { const union unaligned *up = p; return up->u8; }
+
+static inline unsigned long
+read_8s (const void *p) { const union unaligned *up = p; return up->s8; }
+
+/* Get the value of register REG as saved in CONTEXT. */
+
+inline _Unwind_Word
+_Unwind_GetGR (struct _Unwind_Context *context, int index)
+{
+ /* This will segfault if the register hasn't been saved. */
+ return * (_Unwind_Word *) context->reg[index];
+}
+
+/* Overwrite the saved value for register REG in CONTEXT with VAL. */
+
+inline void
+_Unwind_SetGR (struct _Unwind_Context *context, int index, _Unwind_Word val)
+{
+ * (_Unwind_Word *) context->reg[index] = val;
+}
+
+/* Retrieve the return address for CONTEXT. */
+
+inline _Unwind_Ptr
+_Unwind_GetIP (struct _Unwind_Context *context)
+{
+ return (_Unwind_Ptr) context->ra;
+}
+
+/* Overwrite the return address for CONTEXT with VAL. */
+
+inline void
+_Unwind_SetIP (struct _Unwind_Context *context, _Unwind_Ptr val)
+{
+ context->ra = (void *) val;
+}
+
+void *
+_Unwind_GetLanguageSpecificData (struct _Unwind_Context *context)
+{
+ return context->lsda;
+}
+
+_Unwind_Ptr
+_Unwind_GetRegionStart (struct _Unwind_Context *context)
+{
+ return (_Unwind_Ptr) context->bases.func;
+}
+
+#ifndef __ia64__
+_Unwind_Ptr
+_Unwind_GetDataRelBase (struct _Unwind_Context *context)
+{
+ return (_Unwind_Ptr) context->bases.dbase;
+}
+
+_Unwind_Ptr
+_Unwind_GetTextRelBase (struct _Unwind_Context *context)
+{
+ return (_Unwind_Ptr) context->bases.tbase;
+}
+#endif
+
+/* Extract any interesting information from the CIE for the translation
+ unit F belongs to. Return a pointer to the byte after the augmentation,
+ or NULL if we encountered an undecipherable augmentation. */
+
+static const unsigned char *
+extract_cie_info (struct dwarf_cie *cie, struct _Unwind_Context *context,
+ _Unwind_FrameState *fs)
+{
+ const unsigned char *aug = cie->augmentation;
+ const unsigned char *p = aug + strlen (aug) + 1;
+ const unsigned char *ret = NULL;
+ _Unwind_Ptr tmp;
+
+ /* g++ v2 "eh" has pointer immediately following augmentation string,
+ so it must be handled first. */
+ if (aug[0] == 'e' && aug[1] == 'h')
+ {
+ fs->eh_ptr = read_pointer (p);
+ p += sizeof (void *);
+ aug += 2;
+ }
+
+ /* Immediately following the augmentation are the code and
+ data alignment and return address column. */
+ p = read_uleb128 (p, &tmp); fs->code_align = tmp;
+ p = read_sleb128 (p, &tmp); fs->data_align = (saddr) tmp;
+ fs->retaddr_column = *p++;
+ fs->lsda_encoding = DW_EH_PE_omit;
+
+ /* If the augmentation starts with 'z', then a uleb128 immediately
+ follows containing the length of the augmentation field following
+ the size. */
+ if (*aug == 'z')
+ {
+ p = read_uleb128 (p, &tmp);
+ ret = p + tmp;
+
+ fs->saw_z = 1;
+ ++aug;
+ }
+
+ /* Iterate over recognized augmentation subsequences. */
+ while (*aug != '\0')
+ {
+ /* "L" indicates a byte showing how the LSDA pointer is encoded. */
+ if (aug[0] == 'L')
+ {
+ fs->lsda_encoding = *p++;
+ aug += 1;
+ }
+
+ /* "R" indicates a byte indicating how FDE addresses are encoded. */
+ else if (aug[0] == 'R')
+ {
+ fs->fde_encoding = *p++;
+ aug += 1;
+ }
+
+ /* "P" indicates a personality routine in the CIE augmentation. */
+ else if (aug[0] == 'P')
+ {
+ p = read_encoded_value (context, *p, p + 1,
+ (_Unwind_Ptr *) &fs->personality);
+ aug += 1;
+ }
+
+ /* Otherwise we have an unknown augmentation string.
+ Bail unless we saw a 'z' prefix. */
+ else
+ return ret;
+ }
+
+ return ret ? ret : p;
+}
+
+
+/* Decode a DW_OP stack program. Return the top of stack. Push INITIAL
+ onto the stack to start. */
+
+static _Unwind_Word
+execute_stack_op (const unsigned char *op_ptr, const unsigned char *op_end,
+ struct _Unwind_Context *context, _Unwind_Word initial)
+{
+ _Unwind_Word stack[64]; /* ??? Assume this is enough. */
+ int stack_elt;
+
+ stack[0] = initial;
+ stack_elt = 1;
+
+ while (op_ptr < op_end)
+ {
+ enum dwarf_location_atom op = *op_ptr++;
+ _Unwind_Word result, reg;
+ _Unwind_Sword offset;
+ _Unwind_Ptr ptrtmp;
+
+ switch (op)
+ {
+ case DW_OP_lit0:
+ case DW_OP_lit1:
+ case DW_OP_lit2:
+ case DW_OP_lit3:
+ case DW_OP_lit4:
+ case DW_OP_lit5:
+ case DW_OP_lit6:
+ case DW_OP_lit7:
+ case DW_OP_lit8:
+ case DW_OP_lit9:
+ case DW_OP_lit10:
+ case DW_OP_lit11:
+ case DW_OP_lit12:
+ case DW_OP_lit13:
+ case DW_OP_lit14:
+ case DW_OP_lit15:
+ case DW_OP_lit16:
+ case DW_OP_lit17:
+ case DW_OP_lit18:
+ case DW_OP_lit19:
+ case DW_OP_lit20:
+ case DW_OP_lit21:
+ case DW_OP_lit22:
+ case DW_OP_lit23:
+ case DW_OP_lit24:
+ case DW_OP_lit25:
+ case DW_OP_lit26:
+ case DW_OP_lit27:
+ case DW_OP_lit28:
+ case DW_OP_lit29:
+ case DW_OP_lit30:
+ case DW_OP_lit31:
+ result = op - DW_OP_lit0;
+ break;
+
+ case DW_OP_addr:
+ result = (_Unwind_Word) (_Unwind_Ptr) read_pointer (op_ptr);
+ op_ptr += sizeof (void *);
+ break;
+
+ case DW_OP_const1u:
+ result = read_1u (op_ptr);
+ op_ptr += 1;
+ break;
+ case DW_OP_const1s:
+ result = read_1s (op_ptr);
+ op_ptr += 1;
+ break;
+ case DW_OP_const2u:
+ result = read_2u (op_ptr);
+ op_ptr += 2;
+ break;
+ case DW_OP_const2s:
+ result = read_2s (op_ptr);
+ op_ptr += 2;
+ break;
+ case DW_OP_const4u:
+ result = read_4u (op_ptr);
+ op_ptr += 4;
+ break;
+ case DW_OP_const4s:
+ result = read_4s (op_ptr);
+ op_ptr += 4;
+ break;
+ case DW_OP_const8u:
+ result = read_8u (op_ptr);
+ op_ptr += 8;
+ break;
+ case DW_OP_const8s:
+ result = read_8s (op_ptr);
+ op_ptr += 8;
+ break;
+ case DW_OP_constu:
+ op_ptr = read_uleb128 (op_ptr, &ptrtmp);
+ result = ptrtmp;
+ break;
+ case DW_OP_consts:
+ op_ptr = read_sleb128 (op_ptr, &ptrtmp);
+ result = (saddr)ptrtmp;
+ break;
+
+ case DW_OP_reg0:
+ case DW_OP_reg1:
+ case DW_OP_reg2:
+ case DW_OP_reg3:
+ case DW_OP_reg4:
+ case DW_OP_reg5:
+ case DW_OP_reg6:
+ case DW_OP_reg7:
+ case DW_OP_reg8:
+ case DW_OP_reg9:
+ case DW_OP_reg10:
+ case DW_OP_reg11:
+ case DW_OP_reg12:
+ case DW_OP_reg13:
+ case DW_OP_reg14:
+ case DW_OP_reg15:
+ case DW_OP_reg16:
+ case DW_OP_reg17:
+ case DW_OP_reg18:
+ case DW_OP_reg19:
+ case DW_OP_reg20:
+ case DW_OP_reg21:
+ case DW_OP_reg22:
+ case DW_OP_reg23:
+ case DW_OP_reg24:
+ case DW_OP_reg25:
+ case DW_OP_reg26:
+ case DW_OP_reg27:
+ case DW_OP_reg28:
+ case DW_OP_reg29:
+ case DW_OP_reg30:
+ case DW_OP_reg31:
+ result = _Unwind_GetGR (context, op - DW_OP_reg0);
+ break;
+ case DW_OP_regx:
+ op_ptr = read_uleb128 (op_ptr, &ptrtmp); reg = ptrtmp;
+ result = _Unwind_GetGR (context, reg);
+ break;
+
+ case DW_OP_breg0:
+ case DW_OP_breg1:
+ case DW_OP_breg2:
+ case DW_OP_breg3:
+ case DW_OP_breg4:
+ case DW_OP_breg5:
+ case DW_OP_breg6:
+ case DW_OP_breg7:
+ case DW_OP_breg8:
+ case DW_OP_breg9:
+ case DW_OP_breg10:
+ case DW_OP_breg11:
+ case DW_OP_breg12:
+ case DW_OP_breg13:
+ case DW_OP_breg14:
+ case DW_OP_breg15:
+ case DW_OP_breg16:
+ case DW_OP_breg17:
+ case DW_OP_breg18:
+ case DW_OP_breg19:
+ case DW_OP_breg20:
+ case DW_OP_breg21:
+ case DW_OP_breg22:
+ case DW_OP_breg23:
+ case DW_OP_breg24:
+ case DW_OP_breg25:
+ case DW_OP_breg26:
+ case DW_OP_breg27:
+ case DW_OP_breg28:
+ case DW_OP_breg29:
+ case DW_OP_breg30:
+ case DW_OP_breg31:
+ op_ptr = read_sleb128 (op_ptr, &ptrtmp); offset = (saddr)ptrtmp;
+ result = _Unwind_GetGR (context, op - DW_OP_breg0) + offset;
+ break;
+ case DW_OP_bregx:
+ op_ptr = read_uleb128 (op_ptr, &ptrtmp); reg = ptrtmp;
+ op_ptr = read_sleb128 (op_ptr, &ptrtmp); offset = (saddr)ptrtmp;
+ result = _Unwind_GetGR (context, reg) + offset;
+ break;
+
+ case DW_OP_dup:
+ if (stack_elt < 1)
+ abort ();
+ result = stack[stack_elt - 1];
+ break;
+
+ case DW_OP_drop:
+ if (--stack_elt < 0)
+ abort ();
+ goto no_push;
+
+ case DW_OP_pick:
+ offset = *op_ptr++;
+ if (offset >= stack_elt - 1)
+ abort ();
+ result = stack[stack_elt - 1 - offset];
+ break;
+
+ case DW_OP_over:
+ if (stack_elt < 2)
+ abort ();
+ result = stack[stack_elt - 2];
+ break;
+
+ case DW_OP_rot:
+ {
+ _Unwind_Word t1, t2, t3;
+
+ if (stack_elt < 3)
+ abort ();
+ t1 = stack[stack_elt - 1];
+ t2 = stack[stack_elt - 2];
+ t3 = stack[stack_elt - 3];
+ stack[stack_elt - 1] = t2;
+ stack[stack_elt - 2] = t3;
+ stack[stack_elt - 3] = t1;
+ goto no_push;
+ }
+
+ case DW_OP_deref:
+ case DW_OP_deref_size:
+ case DW_OP_abs:
+ case DW_OP_neg:
+ case DW_OP_not:
+ case DW_OP_plus_uconst:
+ /* Unary operations. */
+ if (--stack_elt < 0)
+ abort ();
+ result = stack[stack_elt];
+
+ switch (op)
+ {
+ case DW_OP_deref:
+ {
+ void *ptr = (void *)(_Unwind_Ptr) result;
+ result = (_Unwind_Ptr) read_pointer (ptr);
+ }
+ break;
+
+ case DW_OP_deref_size:
+ {
+ void *ptr = (void *)(_Unwind_Ptr) result;
+ switch (*op_ptr++)
+ {
+ case 1:
+ result = read_1u (ptr);
+ break;
+ case 2:
+ result = read_2u (ptr);
+ break;
+ case 4:
+ result = read_4u (ptr);
+ break;
+ case 8:
+ result = read_8u (ptr);
+ break;
+ default:
+ abort ();
+ }
+ }
+ break;
+
+ case DW_OP_abs:
+ if ((_Unwind_Sword) result < 0)
+ result = -result;
+ break;
+ case DW_OP_neg:
+ result = -result;
+ break;
+ case DW_OP_not:
+ result = ~result;
+ break;
+ case DW_OP_plus_uconst:
+ op_ptr = read_uleb128 (op_ptr, &ptrtmp); reg = ptrtmp;
+ result += reg;
+ break;
+ }
+ break;
+
+ case DW_OP_and:
+ case DW_OP_div:
+ case DW_OP_minus:
+ case DW_OP_mod:
+ case DW_OP_mul:
+ case DW_OP_or:
+ case DW_OP_plus:
+ case DW_OP_le:
+ case DW_OP_ge:
+ case DW_OP_eq:
+ case DW_OP_lt:
+ case DW_OP_gt:
+ case DW_OP_ne:
+ {
+ /* Binary operations. */
+ _Unwind_Word first, second;
+ if ((stack_elt -= 2) < 0)
+ abort ();
+ second = stack[stack_elt];
+ first = stack[stack_elt + 1];
+
+ switch (op)
+ {
+ case DW_OP_and:
+ result = second & first;
+ break;
+ case DW_OP_div:
+ result = (_Unwind_Sword)second / (_Unwind_Sword)first;
+ break;
+ case DW_OP_minus:
+ result = second - first;
+ break;
+ case DW_OP_mod:
+ result = (_Unwind_Sword)second % (_Unwind_Sword)first;
+ break;
+ case DW_OP_mul:
+ result = second * first;
+ break;
+ case DW_OP_or:
+ result = second | first;
+ break;
+ case DW_OP_plus:
+ result = second + first;
+ break;
+ case DW_OP_shl:
+ result = second << first;
+ break;
+ case DW_OP_shr:
+ result = second >> first;
+ break;
+ case DW_OP_shra:
+ result = (_Unwind_Sword)second >> first;
+ break;
+ case DW_OP_xor:
+ result = second ^ first;
+ break;
+ case DW_OP_le:
+ result = (_Unwind_Sword)first <= (_Unwind_Sword)second;
+ break;
+ case DW_OP_ge:
+ result = (_Unwind_Sword)first >= (_Unwind_Sword)second;
+ break;
+ case DW_OP_eq:
+ result = (_Unwind_Sword)first == (_Unwind_Sword)second;
+ break;
+ case DW_OP_lt:
+ result = (_Unwind_Sword)first < (_Unwind_Sword)second;
+ break;
+ case DW_OP_gt:
+ result = (_Unwind_Sword)first > (_Unwind_Sword)second;
+ break;
+ case DW_OP_ne:
+ result = (_Unwind_Sword)first != (_Unwind_Sword)second;
+ break;
+ }
+ }
+ break;
+
+ case DW_OP_skip:
+ offset = read_2s (op_ptr);
+ op_ptr += 2;
+ op_ptr += offset;
+ goto no_push;
+
+ case DW_OP_bra:
+ if (--stack_elt < 0)
+ abort ();
+ offset = read_2s (op_ptr);
+ op_ptr += 2;
+ if (stack[stack_elt] != 0)
+ op_ptr += offset;
+ goto no_push;
+
+ case DW_OP_nop:
+ goto no_push;
+
+ default:
+ abort ();
+ }
+
+ /* Most things push a result value. */
+ if ((size_t) stack_elt >= sizeof(stack)/sizeof(*stack))
+ abort ();
+ stack[++stack_elt] = result;
+ no_push:;
+ }
+
+ /* We were executing this program to get a value. It should be
+ at top of stack. */
+ if (--stack_elt < 0)
+ abort ();
+ return stack[stack_elt];
+}
+
+
+/* Decode DWARF 2 call frame information. Takes pointers the
+ instruction sequence to decode, current register information and
+ CIE info, and the PC range to evaluate. */
+
+static void
+execute_cfa_program (const unsigned char *insn_ptr,
+ const unsigned char *insn_end,
+ struct _Unwind_Context *context,
+ _Unwind_FrameState *fs)
+{
+ struct frame_state_reg_info *unused_rs = NULL;
+
+ /* Don't allow remember/restore between CIE and FDE programs. */
+ fs->regs.prev = NULL;
+
+ while (insn_ptr < insn_end && fs->pc < context->ra)
+ {
+ unsigned char insn = *insn_ptr++;
+ _Unwind_Word reg;
+ _Unwind_Sword offset;
+ _Unwind_Ptr ptrtmp;
+
+ if (insn & DW_CFA_advance_loc)
+ fs->pc += (insn & 0x3f) * fs->code_align;
+ else if (insn & DW_CFA_offset)
+ {
+ reg = insn & 0x3f;
+ insn_ptr = read_uleb128 (insn_ptr, &ptrtmp);
+ offset = ptrtmp * fs->data_align;
+ fs->regs.reg[reg].how = REG_SAVED_OFFSET;
+ fs->regs.reg[reg].loc.offset = offset;
+ }
+ else if (insn & DW_CFA_restore)
+ {
+ reg = insn & 0x3f;
+ fs->regs.reg[reg].how = REG_UNSAVED;
+ }
+ else switch (insn)
+ {
+ case DW_CFA_set_loc:
+ insn_ptr = read_encoded_value (context, fs->fde_encoding,
+ insn_ptr, (_Unwind_Ptr *) &fs->pc);
+ break;
+
+ case DW_CFA_advance_loc1:
+ fs->pc += read_1u (insn_ptr) * fs->code_align;
+ insn_ptr += 1;
+ break;
+ case DW_CFA_advance_loc2:
+ fs->pc += read_2u (insn_ptr) * fs->code_align;
+ insn_ptr += 2;
+ break;
+ case DW_CFA_advance_loc4:
+ fs->pc += read_4u (insn_ptr) * fs->code_align;
+ insn_ptr += 4;
+ break;
+
+ case DW_CFA_offset_extended:
+ insn_ptr = read_uleb128 (insn_ptr, &ptrtmp); reg = ptrtmp;
+ insn_ptr = read_uleb128 (insn_ptr, &ptrtmp);
+ offset = ptrtmp * fs->data_align;
+ fs->regs.reg[reg].how = REG_SAVED_OFFSET;
+ fs->regs.reg[reg].loc.offset = offset;
+ break;
+
+ case DW_CFA_restore_extended:
+ insn_ptr = read_uleb128 (insn_ptr, &ptrtmp); reg = ptrtmp;
+ fs->regs.reg[reg].how = REG_UNSAVED;
+ break;
+
+ case DW_CFA_undefined:
+ case DW_CFA_same_value:
+ case DW_CFA_nop:
+ break;
+
+ case DW_CFA_register:
+ {
+ _Unwind_Word reg2;
+ insn_ptr = read_uleb128 (insn_ptr, &ptrtmp); reg = ptrtmp;
+ insn_ptr = read_uleb128 (insn_ptr, &ptrtmp); reg2 = ptrtmp;
+ fs->regs.reg[reg].how = REG_SAVED_REG;
+ fs->regs.reg[reg].loc.reg = reg2;
+ }
+ break;
+
+ case DW_CFA_remember_state:
+ {
+ struct frame_state_reg_info *new_rs;
+ if (unused_rs)
+ {
+ new_rs = unused_rs;
+ unused_rs = unused_rs->prev;
+ }
+ else
+ new_rs = alloca (sizeof (struct frame_state_reg_info));
+
+ *new_rs = fs->regs;
+ fs->regs.prev = new_rs;
+ }
+ break;
+
+ case DW_CFA_restore_state:
+ {
+ struct frame_state_reg_info *old_rs = fs->regs.prev;
+ fs->regs = *old_rs;
+ old_rs->prev = unused_rs;
+ unused_rs = old_rs;
+ }
+ break;
+
+ case DW_CFA_def_cfa:
+ insn_ptr = read_uleb128 (insn_ptr, &ptrtmp);
+ fs->cfa_reg = ptrtmp;
+ insn_ptr = read_uleb128 (insn_ptr, &ptrtmp);
+ fs->cfa_offset = ptrtmp;
+ fs->cfa_how = CFA_REG_OFFSET;
+ break;
+
+ case DW_CFA_def_cfa_register:
+ insn_ptr = read_uleb128 (insn_ptr, &ptrtmp);
+ fs->cfa_reg = ptrtmp;
+ fs->cfa_how = CFA_REG_OFFSET;
+ break;
+
+ case DW_CFA_def_cfa_offset:
+ insn_ptr = read_uleb128 (insn_ptr, &ptrtmp);
+ fs->cfa_offset = ptrtmp;
+ /* cfa_how deliberately not set. */
+ break;
+
+ case DW_CFA_def_cfa_expression:
+ insn_ptr = read_uleb128 (insn_ptr, &ptrtmp);
+ fs->cfa_exp = insn_ptr;
+ fs->cfa_how = CFA_EXP;
+ insn_ptr += ptrtmp;
+ break;
+
+ case DW_CFA_expression:
+ insn_ptr = read_uleb128 (insn_ptr, &ptrtmp); reg = ptrtmp;
+ insn_ptr = read_uleb128 (insn_ptr, &ptrtmp);
+ fs->regs.reg[reg].how = REG_SAVED_EXP;
+ fs->regs.reg[reg].loc.exp = insn_ptr;
+ insn_ptr += ptrtmp;
+ break;
+
+ /* From the 2.1 draft. */
+ case DW_CFA_offset_extended_sf:
+ insn_ptr = read_uleb128 (insn_ptr, &ptrtmp); reg = ptrtmp;
+ insn_ptr = read_sleb128 (insn_ptr, &ptrtmp);
+ offset = (saddr)ptrtmp * fs->data_align;
+ fs->regs.reg[reg].how = REG_SAVED_OFFSET;
+ fs->regs.reg[reg].loc.offset = offset;
+ break;
+
+ case DW_CFA_def_cfa_sf:
+ insn_ptr = read_uleb128 (insn_ptr, &ptrtmp);
+ fs->cfa_reg = ptrtmp;
+ insn_ptr = read_sleb128 (insn_ptr, &ptrtmp);
+ fs->cfa_offset = (saddr)ptrtmp;
+ fs->cfa_how = CFA_REG_OFFSET;
+ break;
+
+ case DW_CFA_def_cfa_offset_sf:
+ insn_ptr = read_uleb128 (insn_ptr, &ptrtmp);
+ fs->cfa_offset = ptrtmp;
+ /* cfa_how deliberately not set. */
+ break;
+
+ case DW_CFA_GNU_window_save:
+ /* ??? Hardcoded for SPARC register window configuration. */
+ for (reg = 16; reg < 32; ++reg)
+ {
+ fs->regs.reg[reg].how = REG_SAVED_OFFSET;
+ fs->regs.reg[reg].loc.offset = (reg - 16) * sizeof (void *);
+ }
+ break;
+
+ case DW_CFA_GNU_args_size:
+ insn_ptr = read_uleb128 (insn_ptr, &ptrtmp);
+ context->args_size = ptrtmp;
+ break;
+
+ case DW_CFA_GNU_negative_offset_extended:
+ /* Obsoleted by DW_CFA_offset_extended_sf, but used by
+ older PowerPC code. */
+ insn_ptr = read_uleb128 (insn_ptr, &ptrtmp); reg = ptrtmp;
+ insn_ptr = read_uleb128 (insn_ptr, &ptrtmp);
+ offset = ptrtmp * fs->data_align;
+ fs->regs.reg[reg].how = REG_SAVED_OFFSET;
+ fs->regs.reg[reg].loc.offset = -offset;
+ break;
+
+ default:
+ abort ();
+ }
+ }
+}
+
+static _Unwind_Reason_Code
+uw_frame_state_for (struct _Unwind_Context *context, _Unwind_FrameState *fs)
+{
+ struct dwarf_fde *fde;
+ struct dwarf_cie *cie;
+ const unsigned char *aug, *insn, *end;
+
+ memset (fs, 0, sizeof (*fs));
+ context->args_size = 0;
+ context->lsda = 0;
+
+ fde = _Unwind_Find_FDE (context->ra - 1, &context->bases);
+ if (fde == NULL)
+ {
+ /* Couldn't find frame unwind info for this function. Try a
+ target-specific fallback mechanism. This will necessarily
+ not profide a personality routine or LSDA. */
+#ifdef MD_FALLBACK_FRAME_STATE_FOR
+ MD_FALLBACK_FRAME_STATE_FOR (context, fs, success);
+ return _URC_END_OF_STACK;
+ success:
+ return _URC_NO_REASON;
+#else
+ return _URC_END_OF_STACK;
+#endif
+ }
+
+ fs->pc = context->bases.func;
+
+ cie = get_cie (fde);
+ insn = extract_cie_info (cie, context, fs);
+ if (insn == NULL)
+ /* CIE contained unknown augmentation. */
+ return _URC_FATAL_PHASE1_ERROR;
+
+ /* First decode all the insns in the CIE. */
+ end = (unsigned char *) next_fde ((struct dwarf_fde *) cie);
+ execute_cfa_program (insn, end, context, fs);
+
+ /* Locate augmentation for the fde. */
+ aug = (unsigned char *)fde + sizeof (*fde);
+ aug += 2 * size_of_encoded_value (fs->fde_encoding);
+ insn = NULL;
+ if (fs->saw_z)
+ {
+ _Unwind_Ptr i;
+ aug = read_uleb128 (aug, &i);
+ insn = aug + i;
+ }
+ if (fs->lsda_encoding != DW_EH_PE_omit)
+ aug = read_encoded_value (context, fs->lsda_encoding, aug,
+ (_Unwind_Ptr *) &context->lsda);
+
+ /* Then the insns in the FDE up to our target PC. */
+ if (insn == NULL)
+ insn = aug;
+ end = (unsigned char *) next_fde (fde);
+ execute_cfa_program (insn, end, context, fs);
+
+ return _URC_NO_REASON;
+}
+
+typedef struct frame_state
+{
+ void *cfa;
+ void *eh_ptr;
+ long cfa_offset;
+ long args_size;
+ long reg_or_offset[DWARF_FRAME_REGISTERS+1];
+ unsigned short cfa_reg;
+ unsigned short retaddr_column;
+ char saved[DWARF_FRAME_REGISTERS+1];
+} frame_state;
+
+struct frame_state * __frame_state_for (void *, struct frame_state *);
+
+/* Called from pre-G++ 3.0 __throw to find the registers to restore for
+ a given PC_TARGET. The caller should allocate a local variable of
+ `struct frame_state' and pass its address to STATE_IN. */
+
+struct frame_state *
+__frame_state_for (void *pc_target, struct frame_state *state_in)
+{
+ struct _Unwind_Context context;
+ _Unwind_FrameState fs;
+ int reg;
+
+ memset (&context, 0, sizeof (struct _Unwind_Context));
+ context.ra = pc_target + 1;
+
+ if (uw_frame_state_for (&context, &fs) != _URC_NO_REASON)
+ return 0;
+
+ /* We have no way to pass a location expression for the CFA to our
+ caller. It wouldn't understand it anyway. */
+ if (fs.cfa_how == CFA_EXP)
+ return 0;
+
+ for (reg = 0; reg < DWARF_FRAME_REGISTERS + 1; reg++)
+ {
+ state_in->saved[reg] = fs.regs.reg[reg].how;
+ switch (state_in->saved[reg])
+ {
+ case REG_SAVED_REG:
+ state_in->reg_or_offset[reg] = fs.regs.reg[reg].loc.reg;
+ break;
+ case REG_SAVED_OFFSET:
+ state_in->reg_or_offset[reg] = fs.regs.reg[reg].loc.offset;
+ break;
+ default:
+ state_in->reg_or_offset[reg] = 0;
+ break;
+ }
+ }
+
+ state_in->cfa_offset = fs.cfa_offset;
+ state_in->cfa_reg = fs.cfa_reg;
+ state_in->retaddr_column = fs.retaddr_column;
+ state_in->args_size = context.args_size;
+ state_in->eh_ptr = fs.eh_ptr;
+
+ return state_in;
+}
+
+static void
+uw_update_context_1 (struct _Unwind_Context *context, _Unwind_FrameState *fs)
+{
+ struct _Unwind_Context orig_context = *context;
+ void *cfa;
+ long i;
+
+ /* Compute this frame's CFA. */
+ switch (fs->cfa_how)
+ {
+ case CFA_REG_OFFSET:
+ /* Special handling here: Many machines do not use a frame pointer,
+ and track the CFA only through offsets from the stack pointer from
+ one frame to the next. In this case, the stack pointer is never
+ stored, so it has no saved address in the context. What we do
+ have is the CFA from the previous stack frame. */
+ if (context->reg[fs->cfa_reg] == NULL)
+ cfa = context->cfa;
+ else
+ cfa = (void *) (_Unwind_Ptr) _Unwind_GetGR (context, fs->cfa_reg);
+ cfa += fs->cfa_offset;
+ break;
+
+ case CFA_EXP:
+ /* ??? No way of knowing what register number is the stack pointer
+ to do the same sort of handling as above. Assume that if the
+ CFA calculation is so complicated as to require a stack program
+ that this will not be a problem. */
+ {
+ const unsigned char *exp = fs->cfa_exp;
+ _Unwind_Ptr len;
+
+ exp = read_uleb128 (exp, &len);
+ cfa = (void *) (_Unwind_Ptr)
+ execute_stack_op (exp, exp + len, context, 0);
+ break;
+ }
+
+ default:
+ abort ();
+ }
+ context->cfa = cfa;
+
+ /* Compute the addresses of all registers saved in this frame. */
+ for (i = 0; i < DWARF_FRAME_REGISTERS + 1; ++i)
+ switch (fs->regs.reg[i].how)
+ {
+ case REG_UNSAVED:
+ break;
+ case REG_SAVED_OFFSET:
+ context->reg[i] = cfa + fs->regs.reg[i].loc.offset;
+ break;
+ case REG_SAVED_REG:
+ context->reg[i] = orig_context.reg[fs->regs.reg[i].loc.reg];
+ break;
+ case REG_SAVED_EXP:
+ {
+ const unsigned char *exp = fs->regs.reg[i].loc.exp;
+ _Unwind_Ptr len;
+ _Unwind_Ptr val;
+
+ exp = read_uleb128 (exp, &len);
+ val = execute_stack_op (exp, exp + len, &orig_context,
+ (_Unwind_Ptr) cfa);
+ context->reg[i] = (void *) val;
+ }
+ break;
+ }
+}
+
+static void
+uw_update_context (struct _Unwind_Context *context, _Unwind_FrameState *fs)
+{
+ uw_update_context_1 (context, fs);
+
+ /* Compute the return address now, since the return address column
+ can change from frame to frame. */
+ context->ra = __builtin_extract_return_addr
+ ((void *) (_Unwind_Ptr) _Unwind_GetGR (context, fs->retaddr_column));
+}
+
+/* Fill in CONTEXT for top-of-stack. The only valid registers at this
+ level will be the return address and the CFA. */
+
+#define uw_init_context(CONTEXT) \
+do { \
+ /* Do any necessary initialization to access arbitrary stack frames. \
+ On the SPARC, this means flushing the register windows. */ \
+ __builtin_unwind_init (); \
+ uw_init_context_1 (CONTEXT, __builtin_dwarf_cfa (), \
+ __builtin_return_address (0)); \
+} while (0)
+
+static void
+uw_init_context_1 (struct _Unwind_Context *context,
+ void *outer_cfa, void *outer_ra)
+{
+ void *ra = __builtin_extract_return_addr (__builtin_return_address (0));
+ _Unwind_FrameState fs;
+
+ memset (context, 0, sizeof (struct _Unwind_Context));
+ context->ra = ra;
+
+ if (uw_frame_state_for (context, &fs) != _URC_NO_REASON)
+ abort ();
+
+ /* Force the frame state to use the known cfa value. */
+ context->cfa = outer_cfa;
+ fs.cfa_how = CFA_REG_OFFSET;
+ fs.cfa_reg = 0;
+ fs.cfa_offset = 0;
+
+ uw_update_context_1 (context, &fs);
+
+ /* If the return address column was saved in a register in the
+ initialization context, then we can't see it in the given
+ call frame data. So have the initialization context tell us. */
+ context->ra = __builtin_extract_return_addr (outer_ra);
+}
+
+
+/* Install TARGET into CURRENT so that we can return to it. This is a
+ macro because __builtin_eh_return must be invoked in the context of
+ our caller. */
+
+#define uw_install_context(CURRENT, TARGET) \
+do { \
+ long offset = uw_install_context_1 ((CURRENT), (TARGET)); \
+ void *handler = __builtin_frob_return_addr ((TARGET)->ra); \
+ __builtin_eh_return (offset, handler); \
+} while (0)
+
+static inline void
+init_dwarf_reg_size_table (void)
+{
+ __builtin_init_dwarf_reg_size_table (dwarf_reg_size_table);
+}
+
+static long
+uw_install_context_1 (struct _Unwind_Context *current,
+ struct _Unwind_Context *target)
+{
+ long i;
+
+#if __GTHREADS
+ {
+ static __gthread_once_t once_regsizes = __GTHREAD_ONCE_INIT;
+ if (__gthread_once (&once_regsizes, init_dwarf_reg_size_table) != 0
+ || dwarf_reg_size_table[0] == 0)
+ init_dwarf_reg_size_table ();
+ }
+#else
+ if (dwarf_reg_size_table[0] == 0)
+ init_dwarf_reg_size_table ();
+#endif
+
+ for (i = 0; i < DWARF_FRAME_REGISTERS; ++i)
+ {
+ void *c = current->reg[i];
+ void *t = target->reg[i];
+ if (t && c && t != c)
+ memcpy (c, t, dwarf_reg_size_table[i]);
+ }
+
+ /* We adjust SP by the difference between CURRENT and TARGET's CFA. */
+ if (STACK_GROWS_DOWNWARD)
+ return target->cfa - current->cfa + target->args_size;
+ else
+ return current->cfa - target->cfa - target->args_size;
+}
+
+static inline _Unwind_Ptr
+uw_identify_context (struct _Unwind_Context *context)
+{
+ return _Unwind_GetIP (context);
+}
+
+
+#include "unwind.inc"
+
+#endif /* !USING_SJLJ_EXCEPTIONS */
diff --git a/gcc/unwind-pe.h b/gcc/unwind-pe.h
new file mode 100644
index 00000000000..9a98f4571ff
--- /dev/null
+++ b/gcc/unwind-pe.h
@@ -0,0 +1,258 @@
+/* Exception handling and frame unwind runtime interface routines.
+ Copyright (C) 2001 Free Software Foundation, Inc.
+
+ This file is part of GNU CC.
+
+ GNU CC is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ GNU CC is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GNU CC; see the file COPYING. If not, write to
+ the Free Software Foundation, 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+/* @@@ Really this should be out of line, but this also causes link
+ compatibility problems with the base ABI. This is slightly better
+ than duplicating code, however. */
+
+/* If using C++, references to abort have to be qualified with std::. */
+#if __cplusplus
+#define __gxx_abort std::abort
+#else
+#define __gxx_abort abort
+#endif
+
+/* Pointer encodings, from dwarf2.h. */
+#define DW_EH_PE_absptr 0x00
+#define DW_EH_PE_omit 0xff
+
+#define DW_EH_PE_uleb128 0x01
+#define DW_EH_PE_udata2 0x02
+#define DW_EH_PE_udata4 0x03
+#define DW_EH_PE_udata8 0x04
+#define DW_EH_PE_sleb128 0x09
+#define DW_EH_PE_sdata2 0x0A
+#define DW_EH_PE_sdata4 0x0B
+#define DW_EH_PE_sdata8 0x0C
+#define DW_EH_PE_signed 0x08
+
+#define DW_EH_PE_pcrel 0x10
+#define DW_EH_PE_textrel 0x20
+#define DW_EH_PE_datarel 0x30
+#define DW_EH_PE_funcrel 0x40
+#define DW_EH_PE_aligned 0x50
+
+#define DW_EH_PE_indirect 0x80
+
+
+/* Given an encoding, return the number of bytes the format occupies.
+ This is only defined for fixed-size encodings, and so does not
+ include leb128. */
+
+static unsigned int
+size_of_encoded_value (unsigned char encoding)
+{
+ if (encoding == DW_EH_PE_omit)
+ return 0;
+
+ switch (encoding & 0x07)
+ {
+ case DW_EH_PE_absptr:
+ return sizeof (void *);
+ case DW_EH_PE_udata2:
+ return 2;
+ case DW_EH_PE_udata4:
+ return 4;
+ case DW_EH_PE_udata8:
+ return 8;
+ }
+ __gxx_abort ();
+}
+
+#ifndef NO_BASE_OF_ENCODED_VALUE
+
+/* Given an encoding and an _Unwind_Context, return the base to which
+ the encoding is relative. This base may then be passed to
+ read_encoded_value_with_base for use when the _Unwind_Context is
+ not available. */
+
+static _Unwind_Ptr
+base_of_encoded_value (unsigned char encoding, struct _Unwind_Context *context)
+{
+ if (encoding == DW_EH_PE_omit)
+ return 0;
+
+ switch (encoding & 0x70)
+ {
+ case DW_EH_PE_absptr:
+ case DW_EH_PE_pcrel:
+ case DW_EH_PE_aligned:
+ return 0;
+
+ case DW_EH_PE_textrel:
+ return _Unwind_GetTextRelBase (context);
+ case DW_EH_PE_datarel:
+ return _Unwind_GetDataRelBase (context);
+ case DW_EH_PE_funcrel:
+ return _Unwind_GetRegionStart (context);
+ }
+ __gxx_abort ();
+}
+
+#endif
+
+/* Load an encoded value from memory at P. The value is returned in VAL;
+ The function returns P incremented past the value. BASE is as given
+ by base_of_encoded_value for this encoding in the appropriate context. */
+
+static const unsigned char *
+read_encoded_value_with_base (unsigned char encoding, _Unwind_Ptr base,
+ const unsigned char *p, _Unwind_Ptr *val)
+{
+ union unaligned
+ {
+ void *ptr;
+ unsigned u2 __attribute__ ((mode (HI)));
+ unsigned u4 __attribute__ ((mode (SI)));
+ unsigned u8 __attribute__ ((mode (DI)));
+ signed s2 __attribute__ ((mode (HI)));
+ signed s4 __attribute__ ((mode (SI)));
+ signed s8 __attribute__ ((mode (DI)));
+ } __attribute__((__packed__));
+
+ union unaligned *u = (union unaligned *) p;
+ _Unwind_Ptr result;
+
+ if (encoding == DW_EH_PE_aligned)
+ {
+ _Unwind_Ptr a = (_Unwind_Ptr)p;
+ a = (a + sizeof (void *) - 1) & - sizeof(void *);
+ result = *(_Unwind_Ptr *) a;
+ p = (const unsigned char *)(a + sizeof (void *));
+ }
+ else
+ {
+ switch (encoding & 0x0f)
+ {
+ case DW_EH_PE_absptr:
+ result = (_Unwind_Ptr) u->ptr;
+ p += sizeof (void *);
+ break;
+
+ case DW_EH_PE_uleb128:
+ {
+ unsigned int shift = 0;
+ unsigned char byte;
+
+ result = 0;
+ do
+ {
+ byte = *p++;
+ result |= (_Unwind_Ptr)(byte & 0x7f) << shift;
+ shift += 7;
+ }
+ while (byte & 0x80);
+ }
+ break;
+
+ case DW_EH_PE_sleb128:
+ {
+ unsigned int shift = 0;
+ unsigned char byte;
+
+ result = 0;
+ do
+ {
+ byte = *p++;
+ result |= (_Unwind_Ptr)(byte & 0x7f) << shift;
+ shift += 7;
+ }
+ while (byte & 0x80);
+
+ if (shift < 8 * sizeof(result) && (byte & 0x40) != 0)
+ result |= -(1L << shift);
+ }
+ break;
+
+ case DW_EH_PE_udata2:
+ result = u->u2;
+ p += 2;
+ break;
+ case DW_EH_PE_udata4:
+ result = u->u4;
+ p += 4;
+ break;
+ case DW_EH_PE_udata8:
+ result = u->u8;
+ p += 8;
+ break;
+
+ case DW_EH_PE_sdata2:
+ result = u->s2;
+ p += 2;
+ break;
+ case DW_EH_PE_sdata4:
+ result = u->s4;
+ p += 4;
+ break;
+ case DW_EH_PE_sdata8:
+ result = u->s8;
+ p += 8;
+ break;
+
+ default:
+ __gxx_abort ();
+ }
+
+ if (result != 0)
+ {
+ result += ((encoding & 0x70) == DW_EH_PE_pcrel
+ ? (_Unwind_Ptr)u : base);
+ if (encoding & DW_EH_PE_indirect)
+ result = *(_Unwind_Ptr *)result;
+ }
+ }
+
+ *val = result;
+ return p;
+}
+
+#ifndef NO_BASE_OF_ENCODED_VALUE
+
+/* Like read_encoded_value_with_base, but get the base from the context
+ rather than providing it directly. */
+
+static inline const unsigned char *
+read_encoded_value (struct _Unwind_Context *context, unsigned char encoding,
+ const unsigned char *p, _Unwind_Ptr *val)
+{
+ return read_encoded_value_with_base (encoding,
+ base_of_encoded_value (encoding, context),
+ p, val);
+}
+
+#endif
+
+/* Read an unsigned leb128 value from P, store the value in VAL, return
+ P incremented past the value. */
+
+static inline const unsigned char *
+read_uleb128 (const unsigned char *p, _Unwind_Ptr *val)
+{
+ return read_encoded_value_with_base (DW_EH_PE_uleb128, 0, p, val);
+}
+
+/* Similar, but read a signed leb128 value. */
+
+static inline const unsigned char *
+read_sleb128 (const unsigned char *p, _Unwind_Ptr *val)
+{
+ return read_encoded_value_with_base (DW_EH_PE_sleb128, 0, p, val);
+}
diff --git a/gcc/unwind-sjlj.c b/gcc/unwind-sjlj.c
new file mode 100644
index 00000000000..a6360a1720e
--- /dev/null
+++ b/gcc/unwind-sjlj.c
@@ -0,0 +1,272 @@
+/* DWARF2 exception handling and frame unwind runtime interface routines.
+ Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+
+ This file is part of GNU CC.
+
+ GNU CC is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ GNU CC is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GNU CC; see the file COPYING. If not, write to
+ the Free Software Foundation, 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include "tconfig.h"
+#include "tsystem.h"
+#include "unwind.h"
+#include "gthr.h"
+
+#if USING_SJLJ_EXCEPTIONS
+
+#ifdef DONT_USE_BUILTIN_SETJMP
+#include <setjmp.h>
+#else
+#define setjmp __builtin_setjmp
+#define longjmp __builtin_longjmp
+#endif
+
+/* This structure is allocated on the stack of the target function.
+ This must match the definition created in except.c:init_eh. */
+struct SjLj_Function_Context
+{
+ /* This is the chain through all registered contexts. It is
+ filled in by _Unwind_SjLj_Register. */
+ struct SjLj_Function_Context *prev;
+
+ /* This is assigned in by the target function before every call
+ to the index of the call site in the lsda. It is assigned by
+ the personality routine to the landing pad index. */
+ int call_site;
+
+ /* This is how data is returned from the personality routine to
+ the target function's handler. */
+ _Unwind_Word data[4];
+
+ /* These are filled in once by the target function before any
+ exceptions are expected to be handled. */
+ _Unwind_Personality_Fn personality;
+ void *lsda;
+
+#ifdef DONT_USE_BUILTIN_SETJMP
+ /* We don't know what sort of alignment requirements the system
+ jmp_buf has. We over estimated in except.c, and now we have
+ to match that here just in case the system *didn't* have more
+ restrictive requirements. */
+ jmp_buf jbuf __attribute__((aligned));
+#else
+ void *jbuf[];
+#endif
+};
+
+struct _Unwind_Context
+{
+ struct SjLj_Function_Context *fc;
+};
+
+typedef struct
+{
+ _Unwind_Personality_Fn personality;
+} _Unwind_FrameState;
+
+
+/* Manage the chain of registered function contexts. */
+
+/* Single threaded fallback chain. */
+static struct SjLj_Function_Context *fc_static;
+
+#if __GTHREADS
+static __gthread_key_t fc_key;
+static int use_fc_key = -1;
+
+static void
+fc_key_dtor (void *ptr)
+{
+ __gthread_key_dtor (fc_key, ptr);
+}
+
+static void
+fc_key_init (void)
+{
+ use_fc_key = __gthread_key_create (&fc_key, fc_key_dtor) == 0;
+}
+
+static void
+fc_key_init_once (void)
+{
+ static __gthread_once_t once = __GTHREAD_ONCE_INIT;
+ if (__gthread_once (&once, fc_key_init) != 0 || use_fc_key < 0)
+ use_fc_key = 0;
+}
+#endif
+
+void
+_Unwind_SjLj_Register (struct SjLj_Function_Context *fc)
+{
+#if __GTHREADS
+ if (use_fc_key < 0)
+ fc_key_init_once ();
+
+ if (use_fc_key)
+ {
+ fc->prev = __gthread_getspecific (fc_key);
+ __gthread_setspecific (fc_key, fc);
+ }
+ else
+#endif
+ {
+ fc->prev = fc_static;
+ fc_static = fc;
+ }
+}
+
+static inline struct SjLj_Function_Context *
+_Unwind_SjLj_GetContext (void)
+{
+#if __GTHREADS
+ if (use_fc_key < 0)
+ fc_key_init_once ();
+
+ if (use_fc_key)
+ return __gthread_getspecific (fc_key);
+#endif
+ return fc_static;
+}
+
+static inline void
+_Unwind_SjLj_SetContext (struct SjLj_Function_Context *fc)
+{
+#if __GTHREADS
+ if (use_fc_key < 0)
+ fc_key_init_once ();
+
+ if (use_fc_key)
+ __gthread_setspecific (fc_key, fc);
+ else
+#endif
+ fc_static = fc;
+}
+
+void
+_Unwind_SjLj_Unregister (struct SjLj_Function_Context *fc)
+{
+ _Unwind_SjLj_SetContext (fc->prev);
+}
+
+
+/* Get/set the return data value at INDEX in CONTEXT. */
+
+_Unwind_Word
+_Unwind_GetGR (struct _Unwind_Context *context, int index)
+{
+ return context->fc->data[index];
+}
+
+void
+_Unwind_SetGR (struct _Unwind_Context *context, int index, _Unwind_Word val)
+{
+ context->fc->data[index] = val;
+}
+
+/* Get the call-site index as saved in CONTEXT. */
+
+_Unwind_Ptr
+_Unwind_GetIP (struct _Unwind_Context *context)
+{
+ return context->fc->call_site + 1;
+}
+
+/* Set the return landing pad index in CONTEXT. */
+
+void
+_Unwind_SetIP (struct _Unwind_Context *context, _Unwind_Ptr val)
+{
+ context->fc->call_site = val - 1;
+}
+
+void *
+_Unwind_GetLanguageSpecificData (struct _Unwind_Context *context)
+{
+ return context->fc->lsda;
+}
+
+_Unwind_Ptr
+_Unwind_GetRegionStart (struct _Unwind_Context *context)
+{
+ return 0;
+}
+
+#ifndef __ia64__
+_Unwind_Ptr
+_Unwind_GetDataRelBase (struct _Unwind_Context *context)
+{
+ return 0;
+}
+
+_Unwind_Ptr
+_Unwind_GetTextRelBase (struct _Unwind_Context *context)
+{
+ return 0;
+}
+#endif
+
+static inline _Unwind_Reason_Code
+uw_frame_state_for (struct _Unwind_Context *context, _Unwind_FrameState *fs)
+{
+ if (context->fc == NULL)
+ {
+ fs->personality = NULL;
+ return _URC_END_OF_STACK;
+ }
+ else
+ {
+ fs->personality = context->fc->personality;
+ return _URC_NO_REASON;
+ }
+}
+
+static inline void
+uw_update_context (struct _Unwind_Context *context,
+ _Unwind_FrameState *fs __attribute__((unused)) )
+{
+ context->fc = context->fc->prev;
+}
+
+static inline void
+uw_init_context (struct _Unwind_Context *context)
+{
+ context->fc = _Unwind_SjLj_GetContext ();
+}
+
+/* ??? There appear to be bugs in integrate.c wrt __builtin_longjmp and
+ virtual-stack-vars. An inline version of this segfaults on Sparc. */
+#define uw_install_context(CURRENT, TARGET) \
+ do { \
+ _Unwind_SjLj_SetContext ((TARGET)->fc); \
+ longjmp ((TARGET)->fc->jbuf, 1); \
+ } while (0)
+
+
+static inline _Unwind_Ptr
+uw_identify_context (struct _Unwind_Context *context)
+{
+ return (_Unwind_Ptr) context->fc;
+}
+
+
+/* Play games with unwind symbols so that we can have call frame
+ and sjlj symbols in the same shared library. Not that you can
+ use them simultaneously... */
+#define _Unwind_RaiseException _Unwind_SjLj_RaiseException
+#define _Unwind_ForcedUnwind _Unwind_SjLj_ForcedUnwind
+#define _Unwind_Resume _Unwind_SjLj_Resume
+
+#include "unwind.inc"
+
+#endif /* USING_SJLJ_EXCEPTIONS */
diff --git a/gcc/unwind.h b/gcc/unwind.h
new file mode 100644
index 00000000000..30c40affd2b
--- /dev/null
+++ b/gcc/unwind.h
@@ -0,0 +1,192 @@
+/* Exception handling and frame unwind runtime interface routines.
+ Copyright (C) 2001 Free Software Foundation, Inc.
+
+ This file is part of GNU CC.
+
+ GNU CC is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ GNU CC is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GNU CC; see the file COPYING. If not, write to
+ the Free Software Foundation, 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+/* This is derived from the C++ ABI for IA-64. Where we diverge
+ for cross-architecture compatibility are noted with "@@@". */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Level 1: Base ABI */
+
+/* @@@ The IA-64 ABI uses uint64 throughout. Most places this is
+ inefficient for 32-bit and smaller machines. */
+typedef unsigned _Unwind_Word __attribute__((__mode__(__word__)));
+typedef signed _Unwind_Sword __attribute__((__mode__(__word__)));
+typedef unsigned _Unwind_Ptr __attribute__((__mode__(__pointer__)));
+
+/* @@@ The IA-64 ABI uses a 64-bit word to identify the producer and
+ consumer of an exception. We'll go along with this for now even on
+ 32-bit machines. We'll need to provide some other option for
+ 16-bit machines and for machines with > 8 bits per byte. */
+typedef unsigned _Unwind_Exception_Class __attribute__((__mode__(__DI__)));
+
+/* The unwind interface uses reason codes in several contexts to
+ identify the reasons for failures or other actions. */
+typedef enum
+{
+ _URC_NO_REASON = 0,
+ _URC_FOREIGN_EXCEPTION_CAUGHT = 1,
+ _URC_FATAL_PHASE2_ERROR = 2,
+ _URC_FATAL_PHASE1_ERROR = 3,
+ _URC_NORMAL_STOP = 4,
+ _URC_END_OF_STACK = 5,
+ _URC_HANDLER_FOUND = 6,
+ _URC_INSTALL_CONTEXT = 7,
+ _URC_CONTINUE_UNWIND = 8
+} _Unwind_Reason_Code;
+
+
+/* The unwind interface uses a pointer to an exception header object
+ as its representation of an exception being thrown. In general, the
+ full representation of an exception object is language- and
+ implementation-specific, but it will be prefixed by a header
+ understood by the unwind interface. */
+
+struct _Unwind_Exception;
+
+typedef void (*_Unwind_Exception_Cleanup_Fn) (_Unwind_Reason_Code,
+ struct _Unwind_Exception *);
+
+struct _Unwind_Exception
+{
+ _Unwind_Exception_Class exception_class;
+ _Unwind_Exception_Cleanup_Fn exception_cleanup;
+ _Unwind_Word private_1;
+ _Unwind_Word private_2;
+
+ /* @@@ The IA-64 ABI says that this structure must be double-word aligned.
+ Taking that literally does not make much sense generically. Instead we
+ provide the maximum alignment required by any type for the machine. */
+} __attribute__((__aligned__));
+
+
+/* The ACTIONS argument to the personality routine is a bitwise OR of one
+ or more of the following constants. */
+typedef int _Unwind_Action;
+
+#define _UA_SEARCH_PHASE 1
+#define _UA_CLEANUP_PHASE 2
+#define _UA_HANDLER_FRAME 4
+#define _UA_FORCE_UNWIND 8
+#define _UA_END_OF_STACK 16
+
+/* This is an opaque type used to refer to a system-specific data
+ structure used by the system unwinder. This context is created and
+ destroyed by the system, and passed to the personality routine
+ during unwinding. */
+struct _Unwind_Context;
+
+/* Raise an exception, passing along the given exception object. */
+extern _Unwind_Reason_Code _Unwind_RaiseException (struct _Unwind_Exception *);
+
+/* Raise an exception for forced unwinding. */
+
+typedef _Unwind_Reason_Code (*_Unwind_Stop_Fn)
+ (int, _Unwind_Action, _Unwind_Exception_Class,
+ struct _Unwind_Exception *, struct _Unwind_Context *, void *);
+
+extern _Unwind_Reason_Code _Unwind_ForcedUnwind (struct _Unwind_Exception *,
+ _Unwind_Stop_Fn,
+ void *);
+
+/* Helper to invoke the exception_cleanup routine. */
+extern void _Unwind_DeleteException (struct _Unwind_Exception *);
+
+/* Resume propagation of an existing exception. This is used after
+ e.g. executing cleanup code, and not to implement rethrowing. */
+extern void _Unwind_Resume (struct _Unwind_Exception *);
+
+/* These functions are used for communicating information about the unwind
+ context (i.e. the unwind descriptors and the user register state) between
+ the unwind library and the personality routine and landing pad. Only
+ selected registers maybe manipulated. */
+
+extern _Unwind_Word _Unwind_GetGR (struct _Unwind_Context *, int);
+extern void _Unwind_SetGR (struct _Unwind_Context *, int, _Unwind_Word);
+
+extern _Unwind_Ptr _Unwind_GetIP (struct _Unwind_Context *);
+extern void _Unwind_SetIP (struct _Unwind_Context *, _Unwind_Ptr);
+
+extern void *_Unwind_GetLanguageSpecificData (struct _Unwind_Context *);
+
+extern _Unwind_Ptr _Unwind_GetRegionStart (struct _Unwind_Context *);
+
+
+/* The personality routine is the function in the C++ (or other language)
+ runtime library which serves as an interface between the system unwind
+ library and language-specific exception handling semantics. It is
+ specific to the code fragment described by an unwind info block, and
+ it is always referenced via the pointer in the unwind info block, and
+ hence it has no ABI-specified name.
+
+ Note that this implies that two different C++ implementations can
+ use different names, and have different contents in the language
+ specific data area. Moreover, that the language specific data
+ area contains no version info because name of the function invoked
+ provides more effective versioning by detecting at link time the
+ lack of code to handle the different data format. */
+
+typedef _Unwind_Reason_Code (*_Unwind_Personality_Fn)
+ (int, _Unwind_Action, _Unwind_Exception_Class,
+ struct _Unwind_Exception *, struct _Unwind_Context *);
+
+/* @@@ The following alternate entry points are for setjmp/longjmp
+ based unwinding. */
+
+struct SjLj_Function_Context;
+extern void _Unwind_SjLj_Register (struct SjLj_Function_Context *);
+extern void _Unwind_SjLj_Unregister (struct SjLj_Function_Context *);
+
+extern _Unwind_Reason_Code _Unwind_SjLj_RaiseException
+ (struct _Unwind_Exception *);
+extern _Unwind_Reason_Code _Unwind_SjLj_ForcedUnwind
+ (struct _Unwind_Exception *, _Unwind_Stop_Fn, void *);
+extern void _Unwind_SjLj_Resume (struct _Unwind_Exception *);
+
+/* @@@ The following provide access to the base addresses for text
+ and data-relative addressing in the LDSA. In order to stay link
+ compatible with the standard ABI for IA-64, we inline these. */
+
+#ifdef __ia64__
+#include <stdlib.h>
+
+static inline _Unwind_Ptr
+_Unwind_GetDataRelBase (struct _Unwind_Context *_C)
+{
+ /* The GP is stored in R1. */
+ return _Unwind_GetGR (_C, 1);
+}
+
+static inline _Unwind_Ptr
+_Unwind_GetTextRelBase (struct _Unwind_Context *_C)
+{
+ abort ();
+ return 0;
+}
+#else
+extern _Unwind_Ptr _Unwind_GetDataRelBase (struct _Unwind_Context *);
+extern _Unwind_Ptr _Unwind_GetTextRelBase (struct _Unwind_Context *);
+#endif
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/gcc/unwind.inc b/gcc/unwind.inc
new file mode 100644
index 00000000000..37d35cef583
--- /dev/null
+++ b/gcc/unwind.inc
@@ -0,0 +1,236 @@
+/* Exception handling and frame unwind runtime interface routines. -*- C -*-
+ Copyright (C) 2001 Free Software Foundation, Inc.
+
+ This file is part of GNU CC.
+
+ GNU CC is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ GNU CC is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GNU CC; see the file COPYING. If not, write to
+ the Free Software Foundation, 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+/* This is derived from the C++ ABI for IA-64. Where we diverge
+ for cross-architecture compatibility are noted with "@@@".
+ This file is included from unwind-dw2.c or unwind-ia64.c. */
+
+/* Subroutine of _Unwind_RaiseException also invoked from _Unwind_Resume.
+
+ Unwind the stack calling the personality routine to find both the
+ exception handler and intermediary cleanup code. We'll only locate
+ the first such frame here. Cleanup code will call back into
+ _Unwind_Resume and we'll continue Phase 2 there. */
+
+static _Unwind_Reason_Code
+_Unwind_RaiseException_Phase2(struct _Unwind_Exception *exc,
+ struct _Unwind_Context *context)
+{
+ _Unwind_Reason_Code code;
+
+ while (1)
+ {
+ _Unwind_FrameState fs;
+ int match_handler;
+
+ code = uw_frame_state_for (context, &fs);
+
+ /* Identify when we've reached the designated handler context. */
+ match_handler = (uw_identify_context (context) == exc->private_2
+ ? _UA_HANDLER_FRAME : 0);
+
+ if (code != _URC_NO_REASON)
+ /* Some error encountered. Ususally the unwinder doesn't
+ diagnose these and merely crashes. */
+ return _URC_FATAL_PHASE2_ERROR;
+
+ /* Unwind successful. Run the personality routine, if any. */
+ if (fs.personality)
+ {
+ code = (*fs.personality) (1, _UA_CLEANUP_PHASE | match_handler,
+ exc->exception_class, exc, context);
+ if (code == _URC_INSTALL_CONTEXT)
+ break;
+ if (code != _URC_CONTINUE_UNWIND)
+ return _URC_FATAL_PHASE2_ERROR;
+ }
+
+ /* Don't let us unwind past the handler context. */
+ if (match_handler)
+ abort ();
+
+ uw_update_context (context, &fs);
+ }
+
+ return code;
+}
+
+
+/* Raise an exception, passing along the given exception object. */
+
+_Unwind_Reason_Code
+_Unwind_RaiseException(struct _Unwind_Exception *exc)
+{
+ struct _Unwind_Context this_context, cur_context;
+ _Unwind_Reason_Code code;
+
+ uw_init_context (&this_context);
+ cur_context = this_context;
+
+ /* Phase 1: Search. Unwind the stack, calling the personality routine
+ with the _UA_SEARCH_PHASE flag set. Do not modify the stack yet. */
+ while (1)
+ {
+ _Unwind_FrameState fs;
+
+ code = uw_frame_state_for (&cur_context, &fs);
+
+ if (code == _URC_END_OF_STACK)
+ /* Hit end of stack with no handler found. */
+ return _URC_END_OF_STACK;
+
+ if (code != _URC_NO_REASON)
+ /* Some error encountered. Ususally the unwinder doesn't
+ diagnose these and merely crashes. */
+ return _URC_FATAL_PHASE1_ERROR;
+
+ /* Unwind successful. Run the personality routine, if any. */
+ if (fs.personality)
+ {
+ code = (*fs.personality) (1, _UA_SEARCH_PHASE, exc->exception_class,
+ exc, &cur_context);
+ if (code == _URC_HANDLER_FOUND)
+ break;
+ else if (code != _URC_CONTINUE_UNWIND)
+ return _URC_FATAL_PHASE1_ERROR;
+ }
+
+ uw_update_context (&cur_context, &fs);
+ }
+
+ /* Indicate to _Unwind_Resume and associated subroutines that this
+ is not a forced unwind. Further, note where we found a handler. */
+ exc->private_1 = 0;
+ exc->private_2 = uw_identify_context (&cur_context);
+
+ cur_context = this_context;
+ code = _Unwind_RaiseException_Phase2 (exc, &cur_context);
+ if (code != _URC_INSTALL_CONTEXT)
+ return code;
+
+ uw_install_context (&this_context, &cur_context);
+}
+
+
+/* Subroutine of _Unwind_ForcedUnwind also invoked from _Unwind_Resume. */
+
+static _Unwind_Reason_Code
+_Unwind_ForcedUnwind_Phase2(struct _Unwind_Exception *exc,
+ struct _Unwind_Context *context)
+{
+ _Unwind_Stop_Fn stop = (_Unwind_Stop_Fn) (_Unwind_Ptr) exc->private_1;
+ void *stop_argument = (void *) (_Unwind_Ptr) exc->private_2;
+ _Unwind_Reason_Code code, stop_code;
+
+ while (1)
+ {
+ _Unwind_FrameState fs;
+ int action;
+
+ code = uw_frame_state_for (context, &fs);
+ if (code != _URC_NO_REASON && code != _URC_END_OF_STACK)
+ return _URC_FATAL_PHASE2_ERROR;
+
+ /* Unwind successful. */
+ action = _UA_FORCE_UNWIND | _UA_CLEANUP_PHASE;
+ if (code == _URC_END_OF_STACK)
+ action |= _UA_END_OF_STACK;
+ stop_code = (*stop) (1, action, exc->exception_class, exc,
+ context, stop_argument);
+ if (stop_code != _URC_NO_REASON)
+ return _URC_FATAL_PHASE2_ERROR;
+
+ /* Stop didn't want to do anything. Invoke the personality
+ handler, if applicable, to run cleanups. */
+ if (code == _URC_END_OF_STACK)
+ break;
+
+ if (fs.personality)
+ {
+ code = (*fs.personality) (1, _UA_FORCE_UNWIND | _UA_CLEANUP_PHASE,
+ exc->exception_class, exc, context);
+ if (code == _URC_INSTALL_CONTEXT)
+ break;
+ if (code != _URC_CONTINUE_UNWIND)
+ return _URC_FATAL_PHASE2_ERROR;
+ }
+
+ uw_update_context (context, &fs);
+ }
+
+ return code;
+}
+
+
+/* Raise an exception for forced unwinding. */
+
+_Unwind_Reason_Code
+_Unwind_ForcedUnwind (struct _Unwind_Exception *exc,
+ _Unwind_Stop_Fn stop, void * stop_argument)
+{
+ struct _Unwind_Context this_context, cur_context;
+ _Unwind_Reason_Code code;
+
+ uw_init_context (&this_context);
+ cur_context = this_context;
+
+ exc->private_1 = (_Unwind_Ptr) stop;
+ exc->private_2 = (_Unwind_Ptr) stop_argument;
+
+ code = _Unwind_ForcedUnwind_Phase2 (exc, &cur_context);
+ if (code != _URC_INSTALL_CONTEXT)
+ return code;
+
+ uw_install_context (&this_context, &cur_context);
+}
+
+
+/* Resume propagation of an existing exception. This is used after
+ e.g. executing cleanup code, and not to implement rethrowing. */
+
+void
+_Unwind_Resume (struct _Unwind_Exception *exc)
+{
+ struct _Unwind_Context this_context, cur_context;
+ _Unwind_Reason_Code code;
+
+ uw_init_context (&this_context);
+ cur_context = this_context;
+
+ /* Choose between continuing to process _Unwind_RaiseException
+ or _Unwind_ForcedUnwind. */
+ if (exc->private_1 == 0)
+ code = _Unwind_RaiseException_Phase2 (exc, &cur_context);
+ else
+ code = _Unwind_ForcedUnwind_Phase2 (exc, &cur_context);
+
+ if (code != _URC_INSTALL_CONTEXT)
+ abort ();
+
+ uw_install_context (&this_context, &cur_context);
+}
+
+/* A convenience function that calls the exception_cleanup field. */
+
+void
+_Unwind_DeleteException (struct _Unwind_Exception *exc)
+{
+ (*exc->exception_cleanup) (_URC_FOREIGN_EXCEPTION_CAUGHT, exc);
+}
diff --git a/gcc/varasm.c b/gcc/varasm.c
index 047065777d7..60e7e47cb50 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -61,15 +61,7 @@ Boston, MA 02111-1307, USA. */
#endif
/* Define the prefix to use when check_memory_usage_flag is enable. */
-#ifdef NO_DOLLAR_IN_LABEL
-#ifdef NO_DOT_IN_LABEL
-#define CHKR_PREFIX "chkr_prefix_"
-#else /* !NO_DOT_IN_LABEL */
-#define CHKR_PREFIX "chkr."
-#endif
-#else /* !NO_DOLLAR_IN_LABEL */
-#define CHKR_PREFIX "chkr$"
-#endif
+#define CHKR_PREFIX "_CHKR_"
#define CHKR_PREFIX_SIZE (sizeof (CHKR_PREFIX) - 1)
/* File in which assembler code is being written. */
@@ -565,10 +557,15 @@ decode_reg_name (asmspec)
return -1;
}
-/* Create the DECL_RTL for a declaration for a static or external variable
- or static or external function.
- ASMSPEC, if not 0, is the string which the user specified
- as the assembler symbol name.
+/* Create the DECL_RTL for a VAR_DECL or FUNCTION_DECL. DECL should
+ have static storage duration. In other words, it should not be an
+ automatic variable, including PARM_DECLs.
+
+ There is, however, one exception: this function handles variables
+ explicitly placed in a particular register by the user.
+
+ ASMSPEC, if not 0, is the string which the user specified as the
+ assembler symbol name.
This is never called for PARM_DECL nodes. */
@@ -582,9 +579,24 @@ make_decl_rtl (decl, asmspec)
const char *new_name = 0;
int reg_number;
+ /* Check that we are not being given an automatic variable. */
+ /* A weak alias has TREE_PUBLIC set but not the other bits. */
+ if (TREE_CODE (decl) == PARM_DECL
+ || TREE_CODE (decl) == RESULT_DECL
+ || (TREE_CODE (decl) == VAR_DECL
+ && !TREE_STATIC (decl)
+ && !TREE_PUBLIC (decl)
+ && !DECL_EXTERNAL (decl)
+ && !DECL_REGISTER (decl)))
+ abort ();
+ /* And that we were not given a type or a label. */
+ else if (TREE_CODE (decl) == TYPE_DECL
+ || TREE_CODE (decl) == LABEL_DECL)
+ abort ();
+
/* For a duplicate declaration, we can be called twice on the
same DECL node. Don't discard the RTL already made. */
- if (DECL_RTL (decl) != 0)
+ if (DECL_RTL_SET_P (decl))
{
/* If the old RTL had the wrong mode, fix the mode. */
if (GET_MODE (DECL_RTL (decl)) != DECL_MODE (decl))
@@ -652,8 +664,9 @@ make_decl_rtl (decl, asmspec)
usage is somewhat suspect, we nevertheless use the following
kludge to avoid setting DECL_RTL to frame_pointer_rtx. */
- DECL_RTL (decl)
- = gen_rtx_REG (DECL_MODE (decl), FIRST_PSEUDO_REGISTER);
+ SET_DECL_RTL (decl,
+ gen_rtx_REG (DECL_MODE (decl),
+ FIRST_PSEUDO_REGISTER));
REGNO (DECL_RTL (decl)) = reg_number;
REG_USERVAR_P (DECL_RTL (decl)) = 1;
@@ -695,7 +708,8 @@ make_decl_rtl (decl, asmspec)
Concatenate a distinguishing number. */
if (!top_level && !TREE_PUBLIC (decl)
&& ! (DECL_CONTEXT (decl) && TYPE_P (DECL_CONTEXT (decl)))
- && asmspec == 0)
+ && asmspec == 0
+ && name == IDENTIFIER_POINTER (DECL_NAME (decl)))
{
char *label;
ASM_FORMAT_PRIVATE_NAME (label, name, var_labelno);
@@ -719,7 +733,7 @@ make_decl_rtl (decl, asmspec)
if (name != new_name)
{
- DECL_ASSEMBLER_NAME (decl) = get_identifier (new_name);
+ SET_DECL_ASSEMBLER_NAME (decl, get_identifier (new_name));
name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
}
@@ -731,8 +745,9 @@ make_decl_rtl (decl, asmspec)
&& (TREE_PUBLIC (decl) || TREE_STATIC (decl)))))
TREE_SIDE_EFFECTS (decl) = 1;
- DECL_RTL (decl) = gen_rtx_MEM (DECL_MODE (decl),
- gen_rtx_SYMBOL_REF (Pmode, name));
+ SET_DECL_RTL (decl, gen_rtx_MEM (DECL_MODE (decl),
+ gen_rtx_SYMBOL_REF (Pmode, name)));
+ SYMBOL_REF_WEAK (XEXP (DECL_RTL (decl), 0)) = DECL_WEAK (decl);
if (TREE_CODE (decl) != FUNCTION_DECL)
set_mem_attributes (DECL_RTL (decl), decl, 1);
@@ -1223,10 +1238,11 @@ assemble_variable (decl, top_level, at_end, dont_output_data)
unsigned int align;
int reloc = 0;
enum in_section saved_in_section;
+ rtx decl_rtl;
last_assemble_variable_decl = 0;
- if (GET_CODE (DECL_RTL (decl)) == REG)
+ if (DECL_RTL_SET_P (decl) && GET_CODE (DECL_RTL (decl)) == REG)
{
/* Do output symbol info for global register variables, but do nothing
else for them. */
@@ -1304,6 +1320,9 @@ assemble_variable (decl, top_level, at_end, dont_output_data)
if (TREE_ASM_WRITTEN (decl))
return;
+ /* Make sure ENCODE_SECTION_INFO is invoked before we set ASM_WRITTEN. */
+ decl_rtl = DECL_RTL (decl);
+
TREE_ASM_WRITTEN (decl) = 1;
/* Do no output if -fsyntax-only. */
@@ -1319,7 +1338,7 @@ assemble_variable (decl, top_level, at_end, dont_output_data)
goto finish;
}
- name = XSTR (XEXP (DECL_RTL (decl), 0), 0);
+ name = XSTR (XEXP (decl_rtl, 0), 0);
if (TREE_PUBLIC (decl) && DECL_NAME (decl)
&& ! first_global_object_name
&& ! (DECL_COMMON (decl) && (DECL_INITIAL (decl) == 0
@@ -1610,6 +1629,13 @@ void
assemble_external (decl)
tree decl ATTRIBUTE_UNUSED;
{
+ /* Because most platforms do not define ASM_OUTPUT_EXTERNAL, the
+ main body of this code is only rarely exercised. To provide some
+ testing, on all platforms, we make sure that the ASM_OUT_FILE is
+ open. If it's not, we should not be calling this function. */
+ if (!asm_out_file)
+ abort ();
+
#ifdef ASM_OUTPUT_EXTERNAL
if (DECL_P (decl) && DECL_EXTERNAL (decl) && TREE_PUBLIC (decl))
{
@@ -2431,7 +2457,7 @@ const_hash (exp)
default:
/* A language specific constant. Just hash the code. */
- return code % MAX_HASH_TABLE;
+ return (int) code % MAX_HASH_TABLE;
}
/* Compute hashing function */
@@ -3235,7 +3261,8 @@ output_constant_def_contents (exp, reloc, labelno)
/* Output the value of EXP. */
output_constant (exp,
(TREE_CODE (exp) == STRING_CST
- ? TREE_STRING_LENGTH (exp)
+ ? MAX (TREE_STRING_LENGTH (exp),
+ int_size_in_bytes (TREE_TYPE (exp)))
: int_size_in_bytes (TREE_TYPE (exp))));
}
@@ -3344,7 +3371,7 @@ free_varasm_status (f)
f->varasm = NULL;
}
-enum kind { RTX_DOUBLE, RTX_INT };
+enum kind { RTX_DOUBLE, RTX_INT, RTX_UNSPEC };
/* Express an rtx for a constant integer (perhaps symbolic)
as the sum of a symbol or label plus an explicit integer.
@@ -3412,7 +3439,24 @@ decode_rtx_const (mode, x, value)
abort ();
}
- if (value->kind == RTX_INT && value->un.addr.base != 0)
+ if (value->kind == RTX_INT && value->un.addr.base != 0
+ && GET_CODE (value->un.addr.base) == UNSPEC)
+ {
+ /* For a simple UNSPEC, the base is set to the
+ operand, the kind field is set to the index of
+ the unspec expression.
+ Together with the code below, in case that
+ the operand is a SYMBOL_REF or LABEL_REF,
+ the address of the string or the code_label
+ is taken as base. */
+ if (XVECLEN (value->un.addr.base, 0) == 1)
+ {
+ value->kind = RTX_UNSPEC + XINT (value->un.addr.base, 1);
+ value->un.addr.base = XVECEXP (value->un.addr.base, 0, 0);
+ }
+ }
+
+ if (value->kind != RTX_DOUBLE && value->un.addr.base != 0)
switch (GET_CODE (value->un.addr.base))
{
case SYMBOL_REF:
@@ -3442,7 +3486,8 @@ simplify_subtraction (x)
decode_rtx_const (GET_MODE (x), XEXP (x, 0), &val0);
decode_rtx_const (GET_MODE (x), XEXP (x, 1), &val1);
- if (val0.un.addr.base == val1.un.addr.base)
+ if (val0.kind != RTX_DOUBLE && val0.kind == val1.kind
+ && val0.un.addr.base == val1.un.addr.base)
return GEN_INT (val0.un.addr.offset - val1.un.addr.offset);
return x;
}
@@ -3580,6 +3625,9 @@ force_const_mem (mode, x)
pool_offset += align - 1;
pool_offset &= ~ (align - 1);
+ if (GET_CODE (x) == LABEL_REF)
+ LABEL_PRESERVE_P (XEXP (x, 0)) = 1;
+
/* Allocate a pool constant descriptor, fill it in, and chain it in. */
pool = (struct pool_constant *) ggc_alloc (sizeof (struct pool_constant));
@@ -4071,6 +4119,7 @@ initializer_constant_valid_p (value, endtype)
return null_pointer_node;
case ADDR_EXPR:
+ case FDESC_EXPR:
return staticp (TREE_OPERAND (value, 0)) ? TREE_OPERAND (value, 0) : 0;
case NON_LVALUE_EXPR:
@@ -4229,7 +4278,10 @@ output_constant (exp, size)
directly. Give the front-end a chance to convert EXP to a
language-independent representation. */
if (lang_expand_constant)
- exp = (*lang_expand_constant) (exp);
+ {
+ exp = (*lang_expand_constant) (exp);
+ code = TREE_CODE (TREE_TYPE (exp));
+ }
if (size == 0 || flag_syntax_only)
return;
@@ -4257,6 +4309,18 @@ output_constant (exp, size)
return;
}
+ if (TREE_CODE (exp) == FDESC_EXPR)
+ {
+ HOST_WIDE_INT part = tree_low_cst (TREE_OPERAND (exp, 1), 0);
+ tree decl = TREE_OPERAND (exp, 0);
+#ifdef ASM_OUTPUT_FDESC
+ ASM_OUTPUT_FDESC (asm_out_file, decl, part);
+#else
+ abort ();
+#endif
+ return;
+ }
+
switch (code)
{
case CHAR_TYPE:
@@ -4749,11 +4813,7 @@ weak_finish ()
for (t = weak_decls; t; t = t->next)
{
if (t->name)
- {
- ASM_WEAKEN_LABEL (asm_out_file, t->name);
- if (t->value)
- ASM_OUTPUT_DEF (asm_out_file, t->name, t->value);
- }
+ ASM_OUTPUT_WEAK_ALIAS (asm_out_file, t->name, t->value);
}
}
#endif
@@ -4787,8 +4847,11 @@ assemble_alias (decl, target)
{
const char *name;
- make_decl_rtl (decl, (char *) 0);
- name = XSTR (XEXP (DECL_RTL (decl), 0), 0);
+ /* We must force creation of DECL_RTL for debug info generation, even though
+ we don't use it here. */
+ make_decl_rtl (decl, NULL_PTR);
+
+ name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
#ifdef ASM_OUTPUT_DEF
/* Make name accessible from other files, if appropriate. */
diff --git a/gcc/version.c b/gcc/version.c
index 9fc42c6bafe..83a771ec266 100644
--- a/gcc/version.c
+++ b/gcc/version.c
@@ -1,4 +1,4 @@
#include "gansidecl.h"
#include "version.h"
-const char *const version_string = "2.97 20010211 (experimental)";
+const char *const version_string = "3.0.4";
diff --git a/gcc/xcoffout.c b/gcc/xcoffout.c
index 6c8c2fe0599..ea0a5b7ced0 100644
--- a/gcc/xcoffout.c
+++ b/gcc/xcoffout.c
@@ -45,11 +45,6 @@ Boston, MA 02111-1307, USA. */
#include "gstab.h"
#else
#include <stab.h>
-
-/* This is a GNU extension we need to reference in this file. */
-#ifndef N_CATCH
-#define N_CATCH 0x54
-#endif
#endif
/* Line number of beginning of current function, minus one.
@@ -178,10 +173,7 @@ xcoff_output_standard_types (syms)
/* Print an error message for unrecognized stab codes. */
#define UNKNOWN_STAB(STR) \
- do { \
- error ("Unknown stab %s: : 0x%x\n", STR, stab); \
- fflush (stderr); \
- } while (0)
+ internal_error ("No sclass for %s stab (0x%x)\n", STR, stab)
/* Conversion routine from BSD stabs to AIX storage classes. */
@@ -196,7 +188,6 @@ stab_to_sclass (stab)
case N_FNAME:
UNKNOWN_STAB ("N_FNAME");
- abort ();
case N_FUN:
return C_FUN;
@@ -208,7 +199,6 @@ stab_to_sclass (stab)
#ifdef N_MAIN
case N_MAIN:
UNKNOWN_STAB ("N_MAIN");
- abort ();
#endif
case N_RSYM:
@@ -216,7 +206,6 @@ stab_to_sclass (stab)
case N_SSYM:
UNKNOWN_STAB ("N_SSYM");
- abort ();
case N_RPSYM:
return C_RPSYM;
@@ -232,59 +221,43 @@ stab_to_sclass (stab)
case N_SO:
UNKNOWN_STAB ("N_SO");
- abort ();
case N_SOL:
UNKNOWN_STAB ("N_SOL");
- abort ();
case N_SLINE:
UNKNOWN_STAB ("N_SLINE");
- abort ();
#ifdef N_DSLINE
case N_DSLINE:
UNKNOWN_STAB ("N_DSLINE");
- abort ();
#endif
#ifdef N_BSLINE
case N_BSLINE:
UNKNOWN_STAB ("N_BSLINE");
- abort ();
-#endif
-#if 0
- /* This has the same value as N_BSLINE. */
- case N_BROWS:
- UNKNOWN_STAB ("N_BROWS");
- abort ();
#endif
#ifdef N_BINCL
case N_BINCL:
UNKNOWN_STAB ("N_BINCL");
- abort ();
#endif
#ifdef N_EINCL
case N_EINCL:
UNKNOWN_STAB ("N_EINCL");
- abort ();
#endif
#ifdef N_EXCL
case N_EXCL:
UNKNOWN_STAB ("N_EXCL");
- abort ();
#endif
case N_LBRAC:
UNKNOWN_STAB ("N_LBRAC");
- abort ();
case N_RBRAC:
UNKNOWN_STAB ("N_RBRAC");
- abort ();
case N_BCOMM:
return C_BCOMM;
@@ -295,31 +268,32 @@ stab_to_sclass (stab)
case N_LENG:
UNKNOWN_STAB ("N_LENG");
- abort ();
case N_PC:
UNKNOWN_STAB ("N_PC");
- abort ();
#ifdef N_M2C
case N_M2C:
UNKNOWN_STAB ("N_M2C");
- abort ();
#endif
#ifdef N_SCOPE
case N_SCOPE:
UNKNOWN_STAB ("N_SCOPE");
- abort ();
#endif
+#ifdef N_CATCH
case N_CATCH:
UNKNOWN_STAB ("N_CATCH");
- abort ();
+#endif
+
+#ifdef N_OPT
+ case N_OPT:
+ UNKNOWN_STAB ("N_OPT");
+#endif
default:
- UNKNOWN_STAB ("default");
- abort ();
+ UNKNOWN_STAB ("?");
}
}
diff --git a/gcc/xcoffout.h b/gcc/xcoffout.h
index 2fb8ab3fb4e..d44fad7d588 100644
--- a/gcc/xcoffout.h
+++ b/gcc/xcoffout.h
@@ -172,6 +172,15 @@ extern const char *xcoff_lastfile;
} \
}
+/* .stabx has the type in a different place. */
+#if 0 /* Do not emit any marker for XCOFF until assembler allows XFT_CV. */
+#define DBX_OUTPUT_GCC_MARKER(FILE) \
+ fprintf ((FILE), "%s\"%s\",0,%d,0\n", ASM_STABS_OP, STABS_GCC_MARKER, \
+ stab_to_sclass (N_GSYM))
+#else
+#define DBX_OUTPUT_GCC_MARKER(FILE)
+#endif
+
/* Do not break .stabs pseudos into continuations. */
#define DBX_CONTIN_LENGTH 0
diff --git a/include/ChangeLog b/include/ChangeLog
index 5326292a144..dc84db81ddd 100644
--- a/include/ChangeLog
+++ b/include/ChangeLog
@@ -1,3 +1,51 @@
+2002-02-20 Release Manager
+
+ * GCC 3.0.4 Released.
+
+2001-12-20 Release Manager
+
+ * GCC 3.0.3 Released.
+
+2001-10-23 Release Manager
+
+ * GCC 3.0.2 Released.
+
+2001-08-19 Release Manager
+
+ * GCC 3.0.1 Released.
+
+2001-08-19 Release Manager
+
+ * GCC 3.0.1 Released.
+
+20010617 Release Manager
+
+ * GCC 3.0 Released.
+
+2001-05-07 Zack Weinberg <zackw@stanford.edu>
+
+ * demangle.h: Use PARAMS for all prototypes.
+
+2001-05-07 Mark Mitchell <mark@codesourcery.com>
+
+ * splay-tree.h (splay_tree_max): New function.
+ (splay_tree_min): Likewise.
+
+2001-03-20 Neil Booth <neil@daikokuya.demon.co.uk>
+
+ * libiberty.h: Declare lbasename ().
+
+2001-03-20 Jim Blandy <jimb@redhat.com>
+
+ * demangle.h (enum gnu_v3_constructor_kinds,
+ is_gnu_v3_mangled_ctor, enum gnu_v3_destructor_kinds,
+ is_gnu_v3_mangled_dtor): New declarations.
+
+2001-03-01 John David Anglin <dave@hiauly1.hia.nrc.ca>
+
+ * safe-ctype.h (_sch_test): Cast enum bit to short int for pcc
+ compatibility.
+
2000-12-18 Joseph S. Myers <jsm28@cam.ac.uk>
* COPYING: Update to current
diff --git a/include/demangle.h b/include/demangle.h
index a3b664b0e7c..ef48747dc29 100644
--- a/include/demangle.h
+++ b/include/demangle.h
@@ -127,4 +127,32 @@ cplus_demangle_v3 PARAMS ((const char* mangled));
extern char*
java_demangle_v3 PARAMS ((const char* mangled));
+
+enum gnu_v3_ctor_kinds {
+ gnu_v3_complete_object_ctor = 1,
+ gnu_v3_base_object_ctor,
+ gnu_v3_complete_object_allocating_ctor
+};
+
+/* Return non-zero iff NAME is the mangled form of a constructor name
+ in the G++ V3 ABI demangling style. Specifically, return an `enum
+ gnu_v3_ctor_kinds' value indicating what kind of constructor
+ it is. */
+extern enum gnu_v3_ctor_kinds
+ is_gnu_v3_mangled_ctor PARAMS ((const char *name));
+
+
+enum gnu_v3_dtor_kinds {
+ gnu_v3_deleting_dtor = 1,
+ gnu_v3_complete_object_dtor,
+ gnu_v3_base_object_dtor
+};
+
+/* Return non-zero iff NAME is the mangled form of a destructor name
+ in the G++ V3 ABI demangling style. Specifically, return an `enum
+ gnu_v3_dtor_kinds' value, indicating what kind of destructor
+ it is. */
+extern enum gnu_v3_dtor_kinds
+ is_gnu_v3_mangled_dtor PARAMS ((const char *name));
+
#endif /* DEMANGLE_H */
diff --git a/include/libiberty.h b/include/libiberty.h
index 64d072be392..bad5587bfff 100644
--- a/include/libiberty.h
+++ b/include/libiberty.h
@@ -56,6 +56,10 @@ extern char *basename ();
# endif
#endif
+/* A well-defined basename () that is always compiled in. */
+
+extern char *lbasename PARAMS ((const char *));
+
/* Concatenate an arbitrary number of strings, up to (char *) NULL.
Allocates memory using xmalloc. */
diff --git a/include/safe-ctype.h b/include/safe-ctype.h
index d5fc649051a..ccacda5b31b 100644
--- a/include/safe-ctype.h
+++ b/include/safe-ctype.h
@@ -1,6 +1,6 @@
/* <ctype.h> replacement macros.
- Copyright (C) 2000 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2001 Free Software Foundation, Inc.
Contributed by Zack Weinberg <zackw@stanford.edu>.
This file is part of the libiberty library.
@@ -69,7 +69,7 @@ enum {
/* Character classification. */
extern const unsigned short _sch_istable[256];
-#define _sch_test(c, bit) (_sch_istable[(c) & 0xff] & (bit))
+#define _sch_test(c, bit) (_sch_istable[(c) & 0xff] & (unsigned short)(bit))
#define ISALPHA(c) _sch_test(c, _sch_isalpha)
#define ISALNUM(c) _sch_test(c, _sch_isalnum)
diff --git a/include/splay-tree.h b/include/splay-tree.h
index f53f855767b..fcc6c9baa9e 100644
--- a/include/splay-tree.h
+++ b/include/splay-tree.h
@@ -1,5 +1,5 @@
/* A splay-tree datatype.
- Copyright (C) 1998, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1998, 2000, 2001 Free Software Foundation, Inc.
Contributed by Mark Mitchell (mark@markmitchell.com).
This file is part of GNU CC.
@@ -110,6 +110,10 @@ extern splay_tree_node splay_tree_predecessor
extern splay_tree_node splay_tree_successor
PARAMS((splay_tree,
splay_tree_key));
+extern splay_tree_node splay_tree_max
+ PARAMS((splay_tree));
+extern splay_tree_node splay_tree_min
+ PARAMS((splay_tree));
extern int splay_tree_foreach PARAMS((splay_tree,
splay_tree_foreach_fn,
void*));
diff --git a/libchill/ChangeLog b/libchill/ChangeLog
deleted file mode 100644
index a62ab15dda1..00000000000
--- a/libchill/ChangeLog
+++ /dev/null
@@ -1,859 +0,0 @@
-2000-05-31 Richard Henderson <rth@cygnus.com>
-
- * Makefile.in (STROBJS): Get memmove.o from configure.
- * configure.in (RANLIB): Detect and substitute.
- (memmove): Detect and substitute.
- * memmove.c (memmove): Use size_t.
-
-2000-05-29 Zack Weinberg <zack@wolery.cumb.org>
-
- * concatstr.c, exh.c: Include stdlib.h and string.h.
- * delaycase.c, eqstr.c, memmove.c, printbuffer.c,
- printevent.c, sendbuffer.c, waitbuffer.c: Include string.h.
-
-Mon Apr 3 01:20:50 2000 George France <france@crl.dec.com>
-
- * basicio.c (PATH_MAX): Always provide a definition.
-
-Wed Oct 27 01:13:12 1999 Alan Modra <alan@SPRI.Levels.UniSA.Edu.Au>
-
- * Makefile.in (config.status): Fix leading whitespace.
- (clean): Remove libchill.a.
-
-Thu Sep 2 17:50:47 1999 Jeffrey A Law (law@cygnus.com)
-
- * powerset.h (SET_WORD, SET_SHORT, SET_CHAR): Do not redefine based
- on USE_CHAR.
- (USE_CHAR): No longer define.
- * eqps.c ffsetclrps.c flsetclrps.c: Remove !USE_CHARS support.
-
-Mon Aug 30 16:42:45 1999 Hans-Peter Nilsson <hp@axis.se>
-
- * Makefile.in (chillrt0.o): Depend on chillrt0.c explicitly.
-
-Fri Aug 6 23:32:29 1999 Daniel Jacobowitz <drow@drow.them.org>
-
- * Makefile.in (FLAGS_TO_PASS): Include prefix, exec_prefix,
- libdir, libsubdir and tooldir.
-
-Thu May 20 03:20:59 1999 Jeffrey A Law (law@cygnus.com)
-
- * configure.in (AC_EXEEXT): Remove call.
- (compiler_name): Explicitly check with no extension and .exe
- extension.
- * configure: Regenerate.
-
-Wed Mar 24 22:41:28 1999 Mumit Khan <khan@xraylith.wisc.edu>
-
- * configure.in (AC_PREREQ): Update to 2.13.
- (AC_EXEEXT): Call to find possible file extension.
- (compiler_name): Use.
- * configure: Regenerate.
-
-1999-01-19 08:10 -0500 Zack Weinberg <zack@rabi.columbia.edu>
-
- * Makefile.in: Fix typos in previous change.
- (rtsdummy.o): Don't depend on gvarargs.h.
-
-Mon Jan 18 04:47:34 1999 Jeffrey A Law (law@cygnus.com)
- Hans-Peter Nilsson <hp@axis.se>
-
- * Makefile.in: Add many missing dependencies.
-
-Sun Jan 3 21:04:53 1999 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
-
- * readrecord.c: Include <sys/types.h> for off_t.
-
-1998-11-26 Manfred Hollstein <manfred@s-direktnet.de>
-
- * configure.in (compiler_name): Add check to detect if this
- language's compiler has been built.
- * configure: Regenerate.
-
-Mon Nov 23 16:48:39 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * configure.in: Use AC_PREREQ(2.12.1).
-
-Fri Nov 20 18:48:34 1998 J"orn Rennecke <amylaar@cygnus.co.uk>
-
- * basicio.c (PATH_MAX): Define only to _POSIX_PATH_MAX if that is
- defined. Otherwise, try MAXPATHLEN.
-
-Thu Oct 22 14:37:35 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * configure.in: Use AC_CONFIG_AUX_DIR($topsrcdir).
-
-1998-09-22 Ben Elliston <bje@cygnus.com>
-
- * configure.in: This is GNU CHILL, not GNU Fortran.
-
-1998-09-20 Manfred Hollstein <manfred@s-direktnet.de>
-
- * Makefile.in: Add dummy targets "info", "install-info", "clean-info"
- and "dvi".
-
-1998-09-13 David S. Miller <davem@pierdol.cobaltmicro.com>
-
- * configure.in: Use 'if test' not brackets.
- * configure: Rebuilt.
-
-Wed Sep 9 21:32:46 1998 Jeffrey A Law (law@cygnus.com)
-
- * Add library exception clause to the copyright notice for all
- .c and .h files.
-
-Tue Sep 8 10:41:38 1998 Jeffrey A Law (law@cygnus.com)
-
- * rts.h: Update with missing code.
-
-Sun Sep 6 01:30:40 1998 Jeffrey A Law (law@cygnus.com)
-
- * allgmem.c: Do not include config.h anymore.
- * allmem.c allocate.c andps.c cardps.c cause.c copyps.c: Likewise.
- * diffps.c eqps.c exh.c exhstack.c ffsetclrps.c ffsetps.c: Likewise.
- * flsetclrps.c flsetps.c inbitstr.c inps.c leps.c ltps.c: Likewise.
- * neps.c notps.c orps.c retmem.c rtsdummy.c setbitps.c: Likewise.
- * setbits.c sliceps.c terminate.c unhex.c unhex1.c xorps.c: Likewise.
-
-Sat Sep 5 02:09:42 1998 Jeffrey A Law (law@cygnus.com)
-
- * Chill runtime moved into toplevel libchill.
- * Makefile.in Revamped due to move. Add multilib support.
- * configure.in: Similarly. Use autoconf.
- * powerset.h: Do not depend on BITS_PER_UNIT.
-
-Fri Apr 24 16:12:40 1998 Dave Brolley <brolley@cygnus.com>
-
- * writerecord.c (sys/types.h): #included to pick up off_t.
-
-Tue Nov 26 01:56:03 1996 Wilfried Moser <moser@rtl.cygnus.com>
-
- * memmove.c (memmove): If nor overlapping use memcpy instead of
- byte copy.
-
-Tue May 14 21:26:52 1996 Per Bothner <bothner@deneb.cygnus.com>
-
- * gestr.c, gtstr.c, lestr.c, nestr.c: Removed - no longer used.
- * Makefile.in (STROBJS) Removed gestr.o, gtstr.o, lestr.o, nestr.o.
-
-Thu May 9 06:59:23 1996 Wilfried Moser <moser@rtl.cygnus.com>
-
- * basicio.c (__connect): In case of Same, fix condition for
- exception.
-
-Thu Feb 29 10:55:01 1996 Per Bothner <bothner@kalessin.cygnus.com>
-
- * format.c: Use ANSI-standard float.h, rather than old values.h.
-
-Mon Jan 15 06:16:22 1996 Wilfried Moser <moser@rtl.cygnus.com>
-
- * sendbuffer.c (__send_buffer): Take care of possibly unaligned
- pointers.
-
- * waitbuffer.c (__wait_buffer): Ditto.
-
-Thu Nov 30 03:49:58 1995 Wilfried Moser <moser@rtl.cygnus.com>
-
- * format.c (inpioctrl): Process NOTCONNECTED.
- (outioctrl): Deto.
- (scanformcont): Fix processing of %% in format string.
-
-Mon Nov 27 05:27:14 1995 Wilfried Moser <moser@rtl.cygnus.com>
-
- * chillrt0.c (main): Pass argc & argv to __RTS_INIT__.
-
-Thu Nov 23 05:15:05 1995 Wilfried Moser <moser@rtl.cygnus.com>
-
- * ioerror.h (io_info_word_t): Make value of first entry compile time
- comfigurable.
-
-Tue Nov 7 22:52:24 1995 Wilfried Moser <moser@rtl.cygnus.com>
-
- * format.c: Rename ultoa to myultoa cause of conflicting types
- on some systems.
-
-Mon Nov 6 03:17:50 1995 Wilfried Moser <moser@rtl.cygnus.com>
-
- * chillrt0.c: Move definition of chill_stdin, chill_stdout,
- chill_stderr ...
-
- * chillstdio.c: ... to here.
-
- * delete.c, eoln.c, existing.c, getusage.c, indexable.c,
- isassociated.c, outoffile.c, readable.c, sequencible.c,
- variable.c, writeable.c: Modified for new implementation of
- chill file i/o.
-
- * basicio.c, format.c, getassoc.c, gettextaccess.c, gettextindex.c,
- gettextrecord.c, ioerror.c, readrecord.c, settextaccess.c,
- settextindex.c, settextrecord.c, writerecord.c: New files to
- implement chill file i/o.
-
- * allocate.c, terminate.c: New files to implement chill's
- ALLOCATE and TERMINATE built-in's.
-
- * associate.c, checksum.c, connect.c, create.c, disconnect.c,
- dissociate.c, findfile.c, findnextfile.c, fstable.c, getass.c,
- getdir.c, gettxtacc.c, gettxtidx.c, gettxtrec.c, iostatus.c,
- lowlevelio.c, modify.c, rdformat.c, rdrecord.c, rdstring.c,
- rdtext.c, rdunixstd.c, readlen.c, regexp.h, setdir.c, settxtacc.c,
- settxtidx.c, settxtrec.c, skiprec.c, wrformat.c, wrrecord.c,
- wrstring.c, wrtext.c, wrunixstd.c: Removed.
-
-Tue Sep 12 04:27:47 1995 Wilfried Moser <moser@rtl.cygnus.com>
-
- * Makefile.in (Makefile): Add rule for Makefile.
- OBJS depends on ../../cc1 to build a new library when cc1 have
- changed.
-
-Mon Jul 31 15:04:04 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * ffsetclrps.c, flsetclrps.c: Completely different interface,
- * storeoutps.c: Remove, no longer needed.
- * Makefile.in (PSOBJS): Take out storeoutps.o.
-
-Mon Jun 19 05:23:35 1995 Wilfried Moser <moser@rtl.cygnus.com>
-
- * exh.c (__cause_exception): New argument.
- (__cause_ex1): New function. This function will get called
- now by the compiler when an exception should be raised.
-
- * abstime.c, allgmem.c, allmem.c, checkcycle.c, delaycase.c,
- ffsetps.c, flsetps.c, inbitstr.c, sendbuffer.c, waitbuffer.c:
- Change calls to __cause_exception to calls to __cause_ex1.
-
- * unhex.c (unhandled_exception),
- cause.c (cause_exception): New argument.
-
- * rts.h: Add prototypes for __delay_this and __continue_that.
-
- * ffsetclrps.c, flsetclrps.c, inps.c, rtltypes.h, setbitps.c:
- Remove prototype for __cause_exception (not needed).
-
- * rdstring.c (_readstring), wrstring.c (_writestring): Add argument
- to call to __cause_exception.
-
- * Makefile.in, unhex1.c: New file. Function __unhandled_ex
- is defined here. This gets called when the compiler doesn't
- find a handler when causing an exception.
-
-Tue Apr 11 16:01:02 1995 Per Bothner <bothner@kalessin.cygnus.com>
-
- * iomodes.h (__tmp_WIO_union, __tmp_RIO_union): Make __forbyte
- be explicitly signed, for the sake of systems where char is unsigned.
-
-Wed Mar 22 06:10:18 1995 Wilfried Moser <moser@rtl.cygnus.com>
-
- * setbitps.c (__setbitpowerset): Change definition of new_value
- to char, cause booleans are represented as 8 bit values by the
- compiler. Use only least significant bit of new_value.
-
-Tue Jan 17 07:32:17 1995 Wilfried Moser <moser@rtl.cygnus.com>
-
- * inps.c (__inpowerset): Don't do rangecheck. Return 0
- if value not in range.
-
- * Makefile.in, inbitstr.c (__inbitstring): New file and
- function for accessing single elements in a bitstring.
-
-Tue Dec 6 02:35:00 1994 Wilfried Moser <moser@rtl.cygnus.com>
-
- * rdformat.c (rf_parse_iolist): In case of __IO_set and
- __IO_SetRange process the ignore_case flag.
-
- * iomodes.h: Change definition of __tmp_RIO_forset and
- __tmp_RIO_forsetrange.
-
-Fri Nov 4 12:04:16 1994 Per Bothner <bothner@kalessin.cygnus.com>
-
- * concatstr.c (__concatstring): Add support for input strings
- to overlap target.
- * setbits.c (__setbits): Fix function name passed
- to __cause_exception.
-
-Wed Nov 2 05:02:59 1994 Wilfried Moser (moser@rtl.cygnus.com)
-
- * Makefile.in (TIMEOBJS): Add new files.
-
- * checkcycle.c (__check_cycle): New file and function for
- CYCLE statement.
-
- * convdurrtstime.c (__convert_duration_rtstime): New file
- and function for conversion of DURATION (unsigned long) to
- RtsTime format.
-
- * delaycase.c (__delay_event): Implement processing of
- timesupervision.
-
- * remaintime.c (__remaintime): New file and function to
- calculate the remaining time of a duration (used for
- timesupervision).
-
- * rts.h: New definitions and prototypes.
-
- * sendbuffer.c (__send_buffer): Implement processing of
- timesupervision.
-
- * waitbuffer.c (__wait_buffer): Implement processing of
- timesupervision.
-
- * waituntil.c (__wait_until): Changed due to implementation
- of timesupervision.
-
-Thu Oct 6 06:41:02 1994 Wilfried Moser (moser@rtl.cygnus.com)
-
- * wrformat.c (default_conv): Remove processing of
- POWERSET's.
-
- * rdformat.c (rf_parse_iolist): Remove processing of
- POWERSET's.
-
- * iomodes.h: Remove definition for POWERSET's.
-
-Fri Sep 30 01:52:25 1994 Wilfried Moser (moser@rtl.cygnus.com)
-
- * rdformat.c (rf_parse_iolist): Fix processing of BITSTRINGs.
-
-Mon Sep 26 16:10:47 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * copyps.c (__pscpy): Add missing 'const'.
-
- * wrformat.c (default_conv): Replace memcpy by explicit loop,
- since memcpy can get mis-optimized when we have unaligned data.
-
- * wrformat.c (__write_format): Don't alloca an extra copy of
- the format string.
-
-Mon Sep 26 08:54:03 1994 Wilfried Moser (moser@rtl.cygnus.com)
-
- * wrformat.c (default_conv): Remove formating of nonprintable
- characters (ESC-sequences wouldn't work).
-
-Fri Sep 23 00:48:28 1994 Wilfried Moser (moser@rtl.cygnus.com)
-
- * copyps.c (__pscpy): Fix masking out unused bits.
-
- * fileio.h: Fix prototype.
-
-Tue Sep 13 04:54:45 1994 Wilfried Moser (moser@rtl.cygnus.com)
-
- * rdformat.c (__read_format): Remove end-of-input string
- check.
-
-Thu Sep 8 17:20:07 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * setbits.c (__setbits): New function, based on __setpowersetbits,
- but with 4 instead of 5 parameters.
- * setpsbits.c: Removed. No longer used.
- * Makefile (PSOBJS): Update accordingly.
-
-Mon Sep 5 08:03:46 1994 Wilfried Moser (moser@rtl.cygnus.com)
-
- * queuelength.c (__queue_length): New file and function
- to implement QUEUE_LENGTH built-in.
- * Makefile.in (TASKOBJS): Add queuelength.o.
-
-Fri Aug 26 16:27:21 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * Makefile.in (INCLUDES): Add -I../../include.
-
-Wed Aug 24 01:12:32 1994 Wilfried Moser (moser@rtl.cygnus.com)
-
- * sendbuffer.c, waitbuffer.c, delaycase.c, printbuffer.c,
- printevent.c: Be careful with addresses of data from the
- application,they may be unaligned (-fpack).
-
-Fri Aug 19 07:16:15 1994 Wilfried Moser (moser@rtl.cygnus.com)
-
- * wrformat.c (default_conv), rdformat.c (rf_parse_iolist): Be
- careful with addresses of data from the application, they may
- be unaligned (-fpack).
-
-Fri Aug 12 20:31:47 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * eqps.c (__eqpowerset): Calculate number of full words
- as floor, not ceiling of bitslength/SET_WORD_SIZE.
-
-Fri Aug 5 17:25:48 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * eqps.c (__eqpowerset): Revert Wilfried's fix, and fix
- the problem in a slightly different way (which is simpler
- and will also work for 0-length bitstrings).
- * neps.c (__nepowerset): Simplify - just call __eqpowerset.
-
-Fri Jul 29 04:06:56 1994 Wilfried Moser (moser@rtl.cygnus.com)
-
- * neps.c (__nepowerset): Correct processing of powerset
- in case of USE_CHARS defined.
-
-Wed Jul 27 05:27:06 1994 Wilfried Moser (moser@rtl.cygnus.com)
-
- * eqps.c (__eqpowerset): Correct processing of powerset
- in case of USE_CHARS defined.
-
-Mon Jun 27 01:17:09 1994 Wilfried Moser (moser@rtl.cygnus.com)
-
- * iomodes.h: Change layout of __tmp_WIO_list that it is always
- the same, regardless if compiled with -fpack or not.
-
-Tue May 31 04:54:48 1994 Wilfried Moser (moser@rtl.cygnus.com)
-
- * printbuffer.c, printevent.c, rts.h, sendbuffer.c,
- waitbuffer.c: Finish the implementation of BUFFER's
- and EVENT's.
-
-Tue May 10 05:17:43 1994 Wilfried Moser (moser@rtl.cygnus.com)
-
- * iomodes.h: Change names of __access, __association and
- __text to __access_type, __association_type and
- __text_type. __access is already defined in one of the
- linux header files.
-
-Wed May 4 15:37:22 1994 Wilfried Moser (moser@rtl.cygnus.com)
-
- * Makefile.in (clean): Add chillrt0.o
- * continue.c (__continue): Implement the function.
- * delaycase.c (__delay_event): Implement the function.
- * printbuffer.c (__print_buffer): Implement the function.
- * printevent.c (__print_event.c): Implement the function.
- * rts.h: Change datatypes used for EVENT's and BUFFER's.
- * sendbuffer.c (__send_buffer): Implement the function.
- FIXME: not completely done.
- * waitbuffer.c (__wait_buffer): Implement the function.
- FIXME: not completely done.
-
-Thu Apr 28 14:39:06 1994 Wilfried Moser (moser@rtl.cygnus.com)
-
- * Makefile.in (TASKOBJS): New variable for tasking related
- objects files.
- * Makefile.in (TIMEOBJS): New object file added.
- * rts.h: Add definitions for BUFFER's and EVENT's.
- * waituntil.c (__wait_until): New file and new function.
- Implements the AT action.
- * delaycase.c (__delay_event): New file and new function.
- Implements the DELAY and DELAY CASE action. FIXME: not yet done.
- * continue.c (__continue): New file and new function.
- Implements the CONTINUE action. FIXME: not yet done.
- * sendbuffer.c (__send_buffer): New file and new function.
- Implements the SEND buffer action. FIXME: not yet done.
- * waitbuffer.c (__wait_buffer): New file and new function.
- Implements the RECEIVE buffer CASE action. FIXME: not yet done.
- * printevent.c (__print_event): New file and new function.
- Prints an event queue. FIXME: not yet done.
- * printbuffer.c (__print_buffer): New file and new function.
- Prints a buffer queue. FIXME: not yet done.
-
-Fri Apr 1 10:59:55 1994 Wilfried Moser (fs_moser at rcsw47)
-
- * wrformat.c (default_conv): Change output of characters in the
- range 0 to 31 (control characters now printed as ^C).
-
-Fri Apr 15 16:29:21 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
-
- * Makefile.in: XTRAFLAGS is no longer need, since -Bdir now
- implies -Idir/include.
- (XTRAFLAGS): Don't define.
- (ALL_CFLAGS): Don't include $(XTRAFLAGS).
-
-Thu Apr 14 13:44:31 1994 Wilfried Moser (moser@phishhead.cygnus.com)
-
- * Makefile.in (TIMEOBJS): New variable for time related stuff.
- * Makefile.in (OBJS): Add TIMEOBJS.
- * abstime.c (_abstime): New file and new function to handle
- ABSTIME builtin.
- * inttime.c (_inttime): New file and new function to handle
- INTTIME builtin.
-
-Tue Mar 29 13:11:37 1994 Wilfried Moser (fs_moser at rcsw1h)
-
- * Makefile.in (LIBOBJS2): Add new modules rdformat.o rdstring.o
- rdunixstd.o
- * iomodes.h: Remove unnecessary definitions. Redefine interface to
- READTEXT/WRITETEXT functions.
- * rdstring.c (_readstring): Rework function.
- * rdformat.c: Rework functionality.
- * rdunixstd.d: New module. This is designed to implement
- READTEXT (stdin...).
- * wrformat.c (copy_text): Change return value of function. In case
- of an empty string this function has failed.
- * wrformat.c: Change formating of a NULL pointer to NULL instead
- of 0.
- * wrformat.c (PUT_CHARS): Change macro according to new return
- value of function copy_text.
-
-Sun Mar 20 21:11:35 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * powerset.h: Bitstrings are now allocated in units
- of (unsigned char), rather than words.
- * eqps.c (__eqpowerset): Optimize slighly for above change.
-
- * setbitps.c (__setbitpowerset): Clean up parameter list.
-
-Thu Mar 10 11:10:32 1994 Bill Cox (bill@rtl.cygnus.com)
-
- * Makefile.in: Add standard gcc Makefile stuff. Move
- chillcrt0 and libchill.a to all.indirect from all target.
-
-Tue Mar 1 17:01:32 1994 Wilfried Moser (fs_moser at rcsw1h)
-
- * iomodes.h: Add definition for POWERSET's
- * wrunixstd.c: Change the write call to an fprintf cause a system
- we have doesn't support write.
- * wrformat.c: Add processing of SET's and POWERSET's
-
-Sat Jan 29 13:32:52 1994 Bill Cox (bill@rtl.cygnus.com)
-
- * Makefile.in: Add new files copyps.c and concatps.c.
- * copyps.c: New function with functionality from sliceps.c,
- * sliceps.c: Change to call copyps now from here.
- * concatps.c: New function - call copyps from here.
- * powerset.h: Fix CLEAR_BIT_IN_CHAR macro.
-
-Wed Jan 26 12:30:48 1994 Mike Stump (mrs@cygnus.com)
-
- * Makefile.in: Don't echo ranlib command.
-
-Wed Jan 26 12:21:11 1994 Mike Stump (mrs@cygnus.com)
-
- * Makefile.in: Make sure cross builds work. AR, and RANLIB now
- used properly. Make sure we can reconfigure if Makefile.in
- changes. Use GCC_FOR_TARGET, not CC to compile libchill.a.
-
-Fri Jan 21 15:30:31 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * allgmem.c: Make prototype K&R-compatible.
-
-Sat Jan 15 10:04:08 1994 Bill Cox (bill@rtl.cygnus.com)
-
- * Makefile.in: Remove unused install code.
- (Install will happen from devo/gcc). Add
- rules for cleaning up.
-
-Fri Jan 14 21:43:45 1994 Per Bothner (bothner@kalessin.cygnus.com)
-
- * chillrt0.c (__init_list): Renamed to _ch_init_list, to
- avoid a conflict on the Alpha.
-
-Tue Jan 25 13:28:15 1994 Wilfried Moser (fs_moser at rcsw1j)
-
- * Makefile.in: clean up for cross compilation. Remove a lot of
- functions (file-io) which are not used at the moment.
- * iomodes.h: clean up the datatypes passed to the writetext
- functions.
- * unhex.c: Comment out include of gvarargs.h (not needed).
- * rtsdummy.c: Comment out include of gvarargs.h (not needed).
- * wrformat.c: change various procedure arguments according to the
- new type passed by the compiler. Remove include of fcntl.h and
- sys/stat.h (not needed).
- * wrformat.c (default_conv): Change formatting of integers in case
- of %O, %H, %B to unsigned. (PR-4395)
- * wrstring.c: change various procedure arguments according to the
- new type passed by the compiler. Remove include of fcntl.h and
- sys/stat.h (not needed).
- * wrtext.c: change various procedure arguments according to the
- new type passed by the compiler.
- * wrunixstd.c: change various procedure arguments according to the
- new type passed by the compiler. Remove include of fcntl.h and
- sys/stat.h (not needed).
- * wrunixstd.c (_writeunixstd): Change the fwrite call to fprintf.
- This is necessary due to a port to a system which does not
- support fwrite.
-
-Sun Jan 2 14:40:32 1994 Bill Cox (bill@cygnus.com)
-
- * Makefile.in: Clean out obsolete .c286 suffix references.
-
-Sat Jan 1 16:51:22 1994 Bill Cox (bill@cygnus.com)
-
- * Makefile.in: Add dependencies on fileio.h
-
-Sat Jan 1 12:31:22 1994 Bill Cox (bill@cygnus.com)
-
- * Reorganize the whole directory and the Makefile. Now you
- can recompile a single function and not have to recompile
- a whole file full of them.
- * eqps.c, neps.c: Fix handling of a one-word set. (PR-4077).
-
-Thu Dec 16 10:19:00 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * fileio.c (default_conv): Changes to support all basic CHILL types.
- Standardize function header formats.
-
-Tue Dec 14 14:36:27 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * fileio.c (writeunixstd): Call _allocate_memory and
- _return_memory, so we'll get appropriate exceptions.
- * powerset.c: Ensure a space between each macro name and the
- parameters.
-
-Mon Nov 22 10:42:37 1993 Wilfried Moser (moser@rtl.cygnus.com)
-
- * Makefile.in: Add functions to LIBFUNCS1
- * chillrt0.c (main): Clear the exception stack.
- * libchill.c (__setexceptionStack, __getexceptionStack): New
- functions according to allow one exceptionStack per thread.
-
-Sat Nov 20 17:45:52 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * libchill.c (__ch_link_handler, __ch_unlink_handler): New functions.
-
-Fri Nov 19 14:37:12 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * Makefile.in, string.c: Add memmove function (PR-3937).
-
-Wed Nov 17 17:07:46 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * fileio.c (_writestring): Add parameters for the source file
- and line number where it was called, for way better error
- messages.
- * powerset.c: Make all length and count variables longs.
- Allows much larger powersets.
-
-Mon Nov 15 14:59:47 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * fileio.c (writestring): Changed interface.
- * iomodes.h: New structures for above interface.
- * libchill.c: Delete bunch of powerset-related cruft.
- (cause_exception): Empty it out.
- * powerset.c: Call correct exception causer.
- * string.c: Rewrite string comparisons from scratch. They
- were bad...
-
-Sat Oct 30 14:54:39 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * Makefile.in: Change paths to executables.
-
-Thu Oct 28 16:38:34 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * powerset.c (__inpowerset, __setbitpowerset): Correct error checking.
- These were throwing false exceptions.
- (__setpowersetbits): Add check for null output set ptr.
-
-Wed Oct 27 16:45:29 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * powerset.c (__diffpowerset): Check for SET_SHORT_SIZE, not
- SET_CHAR_SIZE twice.
- (__ffsetpowerset, __flsetpowerset): Add code for CHAR and SHORT sets.
- * libchill.c (cause_exception): Output a message to stderr, and
- abort, as a default exception action.
-
-Thu Oct 21 16:04:09 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * fileio.c (__write_format): Add missing increment of fstr.
-
-Thu Sep 30 20:11:34 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * powerset.c (__psslice): Take length, rather than upper bound.
-
-Sun Sep 19 23:14:57 1993 Per Bothner (bothner@kalessin.cygnus.com)
-
- * chillrt0.c, fileio.c (_writeunixstd): Change a standard Unix file
- from (long*) to (long). Use fwrite rather than write.
- * fileio.c (PUT_CHARS, PUT_CHAR): New macros.
- * fileio.c (__write_format): Use them.
- * fileio.c (__write-format): Handle "%/" format even if
- not io_ctrl_allowed (by emitting '\n').
-
-Fri Sep 10 12:15:51 1993 Wilfried Moser (fs_moser at rcsw1j)
-
- * chillrt0.c: Make stdin, stdout, stderr available to chill
- programs. This is done by setting the apropriate file handles
- to chill_stdin, chill_stdout, chill_stderr.
- * fileio.c: Add a new function (_writeunixstd) to the
- chill library. This function will be called when the compiler
- detects a WRITETEXT action to one of the above mentioned
- file handles.
- * Makefile.in: Add _writeunixstd to LIBFUNCS3.
-
-Sat Aug 21 17:17:53 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * Makefile.in: Add psset to list of powerset stuff.
- * powerset.c: Standardize (and correct) for loops. Fix
- comments.
-
-Mon Jul 5 09:48:06 1993 Wilfried Moser (fs_moser at rcsw1j)
-
- * rtltypes.h: Change layout of struct __ch_handler. The entry
- jmp_buf is moved to the end of the structure.
-
-Mon Jun 14 12:17:53 1993 david d `zoo' zuhn (zoo at rtl.cygnus.com)
-
- * Makefile.in: rename INSTALLDIR to libdir; remove parentdir
- support; update definition of INSTALL
-
-Thu Jun 10 18:14:41 1993 Wilfried Moser (moser@deneb.cygnus.com)
-
- * libchill.c: (vector): This entry was removed. It is no
- longer neccessary.
- * Makefile.in: Change due to the remove of vector.
-
-Wed Jun 9 10:39:25 1993 Wilfried Moser (moser@deneb.cygnus.com)
-
- * chillrt0.c (main): Change processing of constructors
- according to the new design made for tasking.
- * libchill.c (__rts_main_loop, __rts_init): Don't do an
- abort () there.
-
-Mon May 31 08:24:51 1993 Ian Lance Taylor (ian@cygnus.com)
-
- * Makefile.in (install): Create directory if necessary.
-
-Sun May 30 15:57:05 1993 Per Bothner (bothner@cygnus.com)
-
- * powerset.c (__eqpowerset, _newpowerset): Don't call
- MASK_UNUSED_{CHAR,SHORT}_BITS on input operand
- (which might be in read-only memory).
- * powerset.c (SET_CHAR, SET_SHORT): Make unsigned.
-
-Fri May 21 10:45:07 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * Makefile.in, chillrt0.c, fileio.c, libchill.c,
- powerset.c, rtltypes.h: Wilfried's changes checked
- in at Cygnus.
-
-Tue May 18 09:21:56 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * powerset.c, Makefile.in: Add psslice routine.
- Change function name from bitsetpowerset to
- setpowersetbits. Drop build of I/O library
- stuff, per Wilfried's request.
-
-Tue May 18 07:55:25 1993 Wilfried Moser (fs_moser at rcsw1j)
-
- * Makefile.in: clean up directory. Remove chillrt0.c
- from libchill.a, this will be linked separately.
- Remove librmt.a from Makefile, this is application
- dependent.
-
-Fri May 7 10:45:09 1993 Ian Lance Taylor (ian@cygnus.com)
-
- * Makefile.in (tooldir): Define.
- * configure.in: If cross-compilation, install in $(tooldir)/lib
- rather than in $(exec_prefix)/lib.
-
-Sat May 1 11:43:44 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * Makefile.in: Add store_output to lists.
- * powerset.c: Add char- and short-length set handling
- across the board.
-
-Thu Apr 8 17:43:33 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * powerset.c (nepowerset): Return TRUE for non-equal comparison.
- * string.c (eqstring, nestring): Call memcmp for the real work.
-
-Mon Mar 22 23:22:53 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
-
- * Makefile.in: add dvi, check and installcheck targets
-
-Fri Mar 12 10:59:31 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * string.c (nestring): Fix return status - was completely bogus.
-
-Fri Mar 5 18:34:15 1993 Per Bothner (bothner@rtl.cygnus.com)
-
- * powerset.c: Re-name INT_TYPE_SIZE to SET_WORD_SIZE.
- * powerset.c: Use SET_WORD instead of (unsigned int).
- * powerset.c (__eqpowerset, __nepowerset): Fix masking
- of final word to not trash memory.
-
-Fri Mar 5 07:55:13 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * Makefile.in, powerset.c (__nepowerset): add psne for powerset
- inequality test.
- * string.c: fix comment.
-
-Sat Feb 20 08:07:21 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * Makefile.in, libchill.c, powerset.c: split out powerset stuff.
- * powerset.c: fix __ffsetpowerset and __flsetpowerset.
-
-Fri Feb 19 11:00:10 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * Makefile.in: add psmax and psmin to LIBFUNCS1, so the
- ffsetpowerset and flsetpowerset functions get into the library.
-
-Sat Feb 13 15:43:21 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * Makefile.in, string.c: cleanup
-
-Sat Feb 13 13:52:20 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * Makefile.in: Add LIBFUNC4, and loop for it. Builds
- string-related runtime functions, adds them to libchill.a.
-
-Wed Feb 10 09:45:29 1993 Bill Cox (bill@rtl.cygnus.com)
-
- * rtltypes.h: added missing TExceptionDefinition.
-
- * libchill.c: add GNU comment header, various new powerset
- support routines. Change function declarations for K&R
- compatibility.
- * string.c: added - runtime string routines (relationals and
- concat).
-
-Tue Feb 9 16:17:35 1993 Per Bothner (bothner@rtl.cygnus.com)
-
- * libchill.c, rtltypes.h: Replace exceptions-handling code.
- * fileio.c: Comment out non-working pseudo-exception-handlers.
-
-Fri Feb 5 07:38:39 1993 Fred Fish (fnf@cygnus.com)
-
- * Makefile.in (RANLIB_TEST, INSTALL, INSTALL_PROGRAM,
- INSTALL_DATA): Supply default definitions.
-
-Sat Jan 30 13:57:09 1993 Per Bothner (bothner@rtl.cygnus.com)
-
- * libchill.c: Change exception to be plain (char*).
- (This is a simplification, at the cost of needing strcmp's.)
- * Makefile.in: Move install actions over form ../gcc/Makefile.in.
-
-Wed Jan 27 23:22:44 1993 Per Bothner (bothner@rtl.cygnus.com)
-
- * libchill.c (__cause_exception): Exception is (for now)
- (char**), rather than short.
- Also, add (commented-out) sketch of new exception implementation.
-
-Tue Jan 12 21:14:56 1993 Per Bothner (bothner@cygnus.com)
-
- * libchill.c: Re-wrote bitstring/powerset code: Each chunk is
- now a (unsigned int), rather than a (char), and bit-order
- depends on BITS_BIG_ENDIAN, rather than being always
- litle-endian. Other improvements here and there.
- * libchill.c (__cardpowerset, __diffpowerset): Faster code.
- * libchill.c (__setbitinstring): New routine, to assign
- a single bit in a bitstring/powerset.
- * Makefile.in (LIBFUNCS1): Add psset for __setbitinstring().
-
-Tue Jan 12 00:10:46 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
-
- * Makefile.in: compile all files with ALL_CFLAGS instead of CFLAGS,
- default ALL_CFLAGS to include CFLAGS,
- default XTRAFLAGS which is used to find the C library (like libg++),
- added dummy install-info target for devo builds,
-
-Wed Jan 6 08:03:46 1993 Fred Fish (fnf@cygnus.com)
-
- * Makefile.in (libchill.a): Since libchill.a depends upon
- chillrt0.o, don't remove chillrt0.o after adding to archive.
- * config/mh-sysv4: Add SVR4 configuration file.
- * Makefile.in (GCC_MAKEFILE): Define to point to gcc/chill
- compiler Makefile, which contains the actual makefile fragments
- to do the install, since it knows where gcc/chill is installed.
- * Makefile.in: Add lines that configure looks for to insert
- host, target, and site specific Makefile fragments.
- * Makefile.in (install): New target that invokes make on the
- gcc/chill makefile to do the actual install.
- * configure.in (*-*-sysv4): Use mh-sysv4 as host_makefile_frag.
-
-Sun Jan 3 16:47:25 1993 Per Bothner (bothner@cygnus.com)
-
- * chillrt0.c: Comment out for now the non-portable
- kludge for adding build_exceptions to the C++ initialision list.
-
-Sat Jan 2 15:51:43 1993 Per Bothner (bothner@rtl.cygnus.com)
-
- * New directory. Moved files from ../gcc/chillrt.
- * configure.in: New file.
- * Makefile.in: Modified from old Makefile to fit into standard
- directory structure.
diff --git a/libchill/Makefile.in b/libchill/Makefile.in
deleted file mode 100644
index fb03aeec038..00000000000
--- a/libchill/Makefile.in
+++ /dev/null
@@ -1,246 +0,0 @@
-# Makefile for GNU CHILL compiler runtime library.
-# Copyright (C) 1987, 88, 90-94, 1998, 1999 Free Software Foundation, Inc.
-
-#This file is part of GNU CC.
-
-#GNU CC is free software; you can redistribute it and/or modify
-#it under the terms of the GNU General Public License as published by
-#the Free Software Foundation; either version 2, or (at your option)
-#any later version.
-
-#GNU CC is distributed in the hope that it will be useful,
-#but WITHOUT ANY WARRANTY; without even the implied warranty of
-#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-#GNU General Public License for more details.
-
-#You should have received a copy of the GNU General Public License
-#along with GNU CC; see the file COPYING. If not, write to
-#the Free Software Foundation, 59 Temple Place - Suite 330,
-#Boston, MA 02111-1307, USA. */
-
-# This was cribbed from the libf2c, libiberty and libstdc++ Makefile.in
-# files. Some of this stuff may be unnecessary and worthless.
-
-SHELL = /bin/sh
-
-#### Start of system configuration section. ####
-
-srcdir = @srcdir@
-VPATH = @srcdir@
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-target_alias = @target_alias@
-gcc_version = @gcc_version@
-gcc_version_trigger = @gcc_version_trigger@
-
-libdir = $(exec_prefix)/lib
-libsubdir = $(libdir)/gcc-lib/$(target_alias)/$(gcc_version)
-
-# Multilib support variables.
-MULTISRCTOP =
-MULTIBUILDTOP =
-MULTIDIRS =
-MULTISUBDIR =
-MULTIDO = true
-MULTICLEAN = true
-
-# Not configured per top-level version, since that doesn't get passed
-# down at configure time, but overrridden by the top-level install
-# target.
-INSTALL = @INSTALL@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_DATA = @INSTALL_DATA@
-
-AR = @AR@
-AR_FLAGS = rc
-
-RANLIB = @RANLIB@
-
-CC = @CC@
-CFLAGS = @CFLAGS@
-ALL_CFLAGS = -I. -I$(srcdir) $(CPPFLAGS) $(DEFS) $(CFLAGS)
-
-.SUFFIXES:
-.SUFFIXES: .c .o
-
-.c.o:
- $(CC) -c $(ALL_CFLAGS) $(INCLUDES) $<
-
-# Lists of required functions for each archive.
-
-LIBOBJS1 = allgmem.o allmem.o allocate.o cause.o exhstack.o exh.o retmem.o \
- unhex.o unhex1.o rtsdummy.o terminate.o
-
-IOOBJS = basicio.o chillstdio.o delete.o eoln.o existing.o format.o getassoc.o \
- gettextaccess.o gettextindex.o gettextrecord.o getusage.o \
- indexable.o ioerror.o isassociated.o outoffile.o readable.o \
- readrecord.o sequencible.o settextaccess.o settextindex.o \
- settextrecord.o variable.o writeable.o writerecord.o
-
-PSOBJS = andps.o cardps.o concatps.o copyps.o diffps.o eqps.o ffsetclrps.o \
- ffsetps.o flsetclrps.o flsetps.o inbitstr.o inps.o leps.o ltps.o \
- neps.o notps.o orps.o setbitps.o setbits.o sliceps.o xorps.o
-
-STROBJS = concatstr.o eqstr.o ltstr.o @MEMMOVE_O@
-
-TIMEOBJS = abstime.o inttime.o waituntil.o remaintime.o convdurrtstime.o \
- checkcycle.o
-
-TASKOBJS = continue.o delaycase.o printbuffer.o printevent.o queuelength.o \
- sendbuffer.o waitbuffer.o
-
-OBJS = $(LIBOBJS1) $(IOOBJS) $(PSOBJS) $(STROBJS) $(TIMEOBJS) $(TASKOBJS)
-
-libchill.a: $(OBJS)
- $(AR) $(AR_FLAGS) $@ $(OBJS)
- $(RANLIB) $@
-
-allgmem.o: allgmem.c rtltypes.h
-allmem.o: allmem.c rtltypes.h
-allocate.o: allocate.c rtltypes.h
-cause.o: cause.c
-exhstack.o: exhstack.c rtltypes.h
-exh.o: exh.c rtltypes.h
-retmem.o: retmem.c
-unhex.o: unhex.c
-unhex1.o: unhex1.c
-rtsdummy.o: rtsdummy.c rtltypes.h
-terminate.o: terminate.c rtltypes.h
-basicio.o: basicio.c fileio.h
-chillstdio.o: chillstdio.c iomodes.h
-delete.o: delete.c fileio.h
-eoln.o: eoln.c fileio.h
-existing.o: existing.c fileio.h
-format.o: format.c bitstring.h auxtypes.h iomodes.h format.h fileio.h ioerror.h
-getassoc.o: getassoc.c fileio.h
-gettextaccess.o: gettextaccess.c fileio.h
-gettextindex.o: gettextindex.c fileio.h
-gettextrecord.o: gettextrecord.c fileio.h
-getusage.o: getusage.c fileio.h
-indexable.o: indexable.c fileio.h
-ioerror.o: ioerror.c
-isassociated.o: isassociated.c fileio.h
-outoffile.o: outoffile.c fileio.h
-readable.o: readable.c fileio.h
-readrecord.o: readrecord.c fileio.h
-sequencible.o: sequencible.c fileio.h
-settextaccess.o: settextaccess.c fileio.h
-settextindex.o: settextindex.c fileio.h
-settextrecord.o: settextrecord.c fileio.h
-variable.o: variable.c fileio.h
-writeable.o: writeable.c fileio.h
-writerecord.o: writerecord.c fileio.h
-andps.o: andps.c powerset.h
-cardps.o: cardps.c powerset.h
-concatps.o: concatps.c powerset.h
-copyps.o: copyps.c powerset.h
-diffps.o: diffps.c powerset.h
-eqps.o: eqps.c powerset.h
-ffsetclrps.o: ffsetclrps.c powerset.h
-ffsetps.o: ffsetps.c powerset.h
-flsetclrps.o: flsetclrps.c powerset.h
-flsetps.o: flsetps.c powerset.h
-inbitstr.o: inbitstr.c powerset.h
-inps.o: inps.c powerset.h
-leps.o: leps.c powerset.h
-ltps.o: ltps.c powerset.h
-neps.o: neps.c powerset.h
-notps.o: notps.c powerset.h
-orps.o: orps.c powerset.h
-setbitps.o: setbitps.c powerset.h
-setbits.o: setbits.c powerset.h
-sliceps.o: sliceps.c powerset.h
-xorps.o: xorps.c powerset.h
-concatstr.o: concatstr.c
-eqstr.o: eqstr.c
-ltstr.o: ltstr.c
-memmove.o: memmove.c
-abstime.o: abstime.c rtltypes.h
-inttime.o: inttime.c
-waituntil.o: waituntil.c rtltypes.h rts.h
-remaintime.o: remaintime.c rts.h
-convdurrtstime.o: convdurrtstime.c rts.h
-checkcycle.o: checkcycle.c rtltypes.h rts.h
-continue.o: continue.c rtltypes.h rts.h
-delaycase.o: delaycase.c rtltypes.h rts.h
-printbuffer.o: printbuffer.c rtltypes.h rts.h
-printevent.o: printevent.c rtltypes.h rts.h
-queuelength.o: queuelength.c rtltypes.h rts.h
-sendbuffer.o: sendbuffer.c rtltypes.h rts.h
-waitbuffer.o: waitbuffer.c rtltypes.h rts.h
-
-$(PSOBJS): $(srcdir)/powerset.h
-librmt.o: $(srcdir)/rtltypes.h
-chillrt0.o: chillrt0.c $(srcdir)/rtltypes.h $(srcdir)/iomodes.h $(srcdir)/auxtypes.h
-$(LIBOBJS1): $(srcdir)/rtltypes.h
-$(TIMEOBJS): $(srcdir)/rtltypes.h $(srcdir)/rts.h
-$(TASKOBJS): $(srcdir)/rts.h $(srcdir)/rtltypes.h
-$(IOOBJS): $(srcdir)/fileio.h $(srcdir)/bitstring.h $(srcdir)/auxtypes.h \
- $(srcdir)/iomodes.h $(srcdir)/format.h $(srcdir)/ioerror.h
-
-# Flags to pass to a recursive make.
-FLAGS_TO_PASS = \
- "AR=$(AR)" \
- "AR_FLAGS=$(AR_FLAGS)" \
- "CC=$(CC)" \
- "CFLAGS=$(CFLAGS)" \
- "LIBCFLAGS=$(LIBCFLAGS)" \
- "EXTRA_OFILES=$(EXTRA_OFILES)" \
- "HDEFINES=$(HDEFINES)" \
- "INSTALL=$(INSTALL)" \
- "INSTALL_DATA=$(INSTALL_DATA)" \
- "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
- "LDFLAGS=$(LDFLAGS)" \
- "LOADLIBES=$(LOADLIBES)" \
- "PICFLAG=$(PICFLAG)" \
- "RANLIB=$(RANLIB)" \
- "SHELL=$(SHELL)" \
- "prefix=$(prefix)" \
- "exec_prefix=$(exec_prefix)" \
- "libdir=$(libdir)" \
- "libsubdir=$(libsubdir)" \
- "tooldir=$(tooldir)"
-
-all: chillrt0.o libchill.a
- @$(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=all
-
-Makefile: Makefile.in config.status
- $(SHELL) config.status
-
-config.status: configure
- rm -f config.cache
- CONFIG_SITE=no-such-file CC='$(CC)' AR='$(AR)' CFLAGS='$(CFLAGS)' \
- CPPFLAGS='$(CPPFLAGS)' $(SHELL) config.status --recheck
-
-${srcdir}/configure: configure.in
- rm -f config.cache
- cd ${srcdir} && autoconf
-
-install: all
- $(INSTALL_DATA) libchill.a $(libsubdir)$(MULTISUBDIR)/libchill.a.n
- $(RANLIB) $(libsubdir)$(MULTISUBDIR)/libchill.a.n
- mv $(libsubdir)$(MULTISUBDIR)/libchill.a.n $(libsubdir)$(MULTISUBDIR)/libchill.a
- $(INSTALL_DATA) chillrt0.o $(libsubdir)$(MULTISUBDIR)/chillrt0.o
- @rootme=`pwd`/ ; export rootme ; \
- $(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=install
-
-
-check uninstall install-strip dist installcheck installdirs info install-info clean-info dvi:
-
-mostlyclean:
- rm -f *.o
- @$(MULTICLEAN) multi-clean DO=mostlyclean
-
-clean: mostlyclean
- rm -f config.log libchill.a
- @$(MULTICLEAN) multi-clean DO=clean
-
-distclean: clean
- @$(MULTICLEAN) multi-clean DO=distclean
- rm -f config.cache config.status Makefile configure
-
-maintainer-clean realclean: distclean
-
-.PHONY: mostlyclean clean distclean maintainer-clean all check uninstall \
- install-strip dist installcheck installdirs
-
diff --git a/libchill/abstime.c b/libchill/abstime.c
deleted file mode 100644
index bf3d6149110..00000000000
--- a/libchill/abstime.c
+++ /dev/null
@@ -1,139 +0,0 @@
-/* Implement timing-related runtime actions for CHILL.
- Copyright (C) 1992,1993 Free Software Foundation, Inc.
- Author: Wilfried Moser
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with other files,
- some of which are compiled with GCC, to produce an executable,
- this library 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. */
-
-#include <time.h>
-#include "rtltypes.h"
-
-EXCEPTION (rangefail);
-
-#define SECOND_VALID 1
-#define MINUTE_VALID 2
-#define HOUR_VALID 4
-#define DAY_VALID 8
-#define MONTH_VALID 16
-#define YEAR_VALID 32
-
-extern void __cause_ex1 (char *ex, char *file, int lineno);
-
-#define CAUSE_RANGEFAIL __cause_ex1 ("rangefail", filename, lineno)
-
-/*
- * function _abstime
- *
- * parameters:
- * mask - mask of valid values
- * year
- * month
- * day
- * hour
- * minute
- * second
- *
- * returns:
- * unsigned long
- *
- * exceptions:
- * rangefail
- *
- * abstract:
- * perform the ABSTIME builtin call
- *
- */
-
-unsigned long
-_abstime (mask, year, month, day, hour, minute, second,
- filename, lineno)
- int mask, year, month, day, hour, minute, second;
- char *filename;
- int lineno;
-{
- struct tm *time_str;
- time_t result, current_time;
-
- /* first of all get current time */
- if ((current_time = time (0)) == (time_t)-1)
- /* FIXME: what excpetion ?? */
- CAUSE_RANGEFAIL;
-
- /* if we just have to determine the current time, we are ready.
- This is shown by mask == 0. */
- if (mask == 0)
- return (unsigned long)current_time;
-
- /* convert current time to struct tm */
- time_str = localtime (&current_time);
-
- if (mask & YEAR_VALID)
- {
- if (year < 1900)
- CAUSE_RANGEFAIL;
- time_str->tm_year = year - 1900;
- }
-
- if (mask & MONTH_VALID)
- {
- if (month < 1 || month > 12)
- CAUSE_RANGEFAIL;
- time_str->tm_mon = month - 1;
- }
-
- if (mask & DAY_VALID)
- {
- if (day < 1 || day > 31)
- CAUSE_RANGEFAIL;
- time_str->tm_mday = day;
- }
-
- if (mask & HOUR_VALID)
- {
- if (hour < 0 || hour > 23)
- CAUSE_RANGEFAIL;
- time_str->tm_hour = hour;
- }
-
- if (mask & MINUTE_VALID)
- {
- if (minute < 0 || minute > 59)
- CAUSE_RANGEFAIL;
- time_str->tm_min = minute;
- }
-
- if (mask & SECOND_VALID)
- {
- if (second < 0 || second > 59)
- CAUSE_RANGEFAIL;
- time_str->tm_sec = second;
- }
-
- /* do it */
- time_str->tm_isdst = -1;
- if ((result = mktime (time_str)) == (time_t)-1)
- CAUSE_RANGEFAIL;
-
- return (unsigned long)result;
-}
diff --git a/libchill/allgmem.c b/libchill/allgmem.c
deleted file mode 100644
index 3e80d119ae6..00000000000
--- a/libchill/allgmem.c
+++ /dev/null
@@ -1,68 +0,0 @@
-/* Implement runtime actions for CHILL.
- Copyright (C) 1992,1993 Free Software Foundation, Inc.
- Author: Wilfried Moser
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with other files,
- some of which are compiled with GCC, to produce an executable,
- this library 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. */
-
-#include <stdlib.h>
-#include "rtltypes.h"
-
-extern void __cause_ex1 (char *ex, char *filename, int lineno);
-
-EXCEPTION (notimplemented);
-
-/*
- * function _allocate_global_memory
- *
- * parameters:
- * ptr pointer to location where pointer should be written
- * size number of bytes to allocate
- * filename source file which issued the call
- * linenumber line number of the call within that file
- *
- * returns:
- * void
- *
- * exceptions:
- * spacefail
- * protectionfail
- * rangefail
- *
- * abstract:
- * allocate global memory. At the moment we dont know how to realize this,
- * therefore cause NotImplemented.
- *
-*/
-
-void
-_allocate_global_memory (ptr, size, filename, linenumber)
- void **ptr;
- int size;
- char *filename;
- int linenumber;
-{
- __cause_ex1 ("notimplemented", filename, linenumber);
-}
-
diff --git a/libchill/allmem.c b/libchill/allmem.c
deleted file mode 100644
index c8306482472..00000000000
--- a/libchill/allmem.c
+++ /dev/null
@@ -1,80 +0,0 @@
-/* Implement runtime actions for CHILL.
- Copyright (C) 1992,1993 Free Software Foundation, Inc.
- Author: Wilfried Moser
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with other files,
- some of which are compiled with GCC, to produce an executable,
- this library 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. */
-
-#define __CHILL_LIB__
-
-#include <stdlib.h>
-#include "rtltypes.h"
-
-extern void __cause_ex1 (char *exname, char *file, int lineno);
-
-/* define needed exceptions */
-EXCEPTION (protectionfail);
-EXCEPTION (rangefail);
-EXCEPTION (spacefail);
-
-/*
- * function _allocate_memory
- *
- * parameters:
- * ptr pointer to location where pointer should be written
- * size number of bytes to allocate
- * filename source file which issued the call
- * linenumber line number within that source file
- *
- * returns:
- * void
- *
- * exceptions:
- * spacefail
- * protectionfail
- * rangefail
- *
- * abstract:
- * allocate memory from heap
- *
-*/
-
-void
-_allocate_memory (ptr, size, filename, linenumber)
- void **ptr;
- int size;
- char *filename;
- int linenumber;
-{
- void *tmp;
-
- if (!ptr)
- __cause_ex1 ("protectionfail", filename, linenumber);
- if (size < 0)
- __cause_ex1 ("rangefail", filename, linenumber);
- tmp = malloc (size);
- if (!tmp)
- __cause_ex1 ("spacefail", filename, linenumber);
- *ptr = tmp;
-}
diff --git a/libchill/allocate.c b/libchill/allocate.c
deleted file mode 100644
index 628381e772a..00000000000
--- a/libchill/allocate.c
+++ /dev/null
@@ -1,74 +0,0 @@
-/* Implement runtime actions for CHILL.
- Copyright (C) 1992,1993 Free Software Foundation, Inc.
- Author: Wilfried Moser
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with other files,
- some of which are compiled with GCC, to produce an executable,
- this library 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. */
-
-#define __CHILL_LIB__
-
-#include <stdlib.h>
-#include "rtltypes.h"
-
-extern void __cause_ex1 (char *exname, char *file, int lineno);
-
-/* define needed exceptions */
-EXCEPTION (allocatefail)
-EXCEPTION (rangefail)
-
-/*
- * function __allocate
- *
- * parameters:
- * size number of bytes to allocate
- * filename source file which issued the call
- * linenumber line number within that source file
- *
- * returns:
- * void *
- *
- * exceptions:
- * allocatefail
- * rangefail
- *
- * abstract:
- * allocate memory from heap
- *
-*/
-
-void *
-__allocate (size, filename, linenumber)
- int size;
- char *filename;
- int linenumber;
-{
- void *tmp;
-
- if (size < 0)
- __cause_ex1 ("rangefail", filename, linenumber);
- tmp = malloc (size);
- if (!tmp)
- __cause_ex1 ("allocatefail", filename, linenumber);
- return tmp;
-}
diff --git a/libchill/andps.c b/libchill/andps.c
deleted file mode 100644
index c638a5a6de1..00000000000
--- a/libchill/andps.c
+++ /dev/null
@@ -1,83 +0,0 @@
-/* Implement POWERSET runtime actions for CHILL.
- Copyright (C) 1992,1993 Free Software Foundation, Inc.
- Author: Wilfried Moser, et al
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with other files,
- some of which are compiled with GCC, to produce an executable,
- this library 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. */
-
-#define __CHILL_LIB__
-
-#include <stdio.h>
-#include "powerset.h"
-
-/*
- * function __andpowerset
- *
- * parameters:
- * out return from __andpowerset
- * left left powerset
- * right right powerset
- * bitlength length of powerset in bits
- *
- * returns:
- * void
- *
- * exceptions:
- * none
- *
- * abstract:
- * and's two powersets
- *
- */
-
-void
-__andpowerset (out, left, right, bitlength)
- SET_WORD *out;
- SET_WORD *left;
- SET_WORD *right;
- unsigned long bitlength;
-{
- if (bitlength <= SET_CHAR_SIZE)
- {
- *((SET_CHAR *)out) = *((SET_CHAR *)left) &
- *((SET_CHAR *)right);
- MASK_UNUSED_CHAR_BITS((SET_CHAR *)out, bitlength);
- }
- else if (bitlength <= SET_SHORT_SIZE)
- {
- *((SET_SHORT *)out) = *((SET_SHORT *)left) &
- *((SET_SHORT *)right);
- MASK_UNUSED_SHORT_BITS((SET_SHORT *)out, bitlength);
- }
- else
- {
- unsigned long len = BITS_TO_WORDS (bitlength);
- register unsigned long i;
-
- for (i = 0; i < len; i++)
- out[i] = left[i] & right[i];
- MASK_UNUSED_WORD_BITS ((out + len - 1),
- bitlength % SET_WORD_SIZE);
- }
-}
diff --git a/libchill/auxtypes.h b/libchill/auxtypes.h
deleted file mode 100644
index 33bcc36573b..00000000000
--- a/libchill/auxtypes.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/* Implement Input/Output runtime actions for CHILL.
- Copyright (C) 1992,1993 Free Software Foundation, Inc.
- Author: Wilfried Moser, et al
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with other files,
- some of which are compiled with GCC, to produce an executable,
- this library 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. */
-
-#ifndef _auxtypes_h_
-#define _auxtypes_h_
-
-
-typedef enum { False, True } Boolean;
-
-#define VARYING_STRING(strlen) \
- struct { unsigned short len; char body[strlen]; }
-
-typedef struct {
- unsigned short len;
- char body[1];
-} VarString;
-
-/* Macros for moving an (U)INT and (U)LONG without alignment worries */
-#define MOV2(tgt,src) \
- *((char*)(tgt) ) = *((char*)(src) ), \
- *((char*)(tgt)+1) = *((char*)(src)+1)
-#define MOV4(tgt,src) \
- *((char*)(tgt) ) = *((char*)(src) ), \
- *((char*)(tgt)+1) = *((char*)(src)+1), \
- *((char*)(tgt)+2) = *((char*)(src)+2), \
- *((char*)(tgt)+3) = *((char*)(src)+3)
-
-#endif
diff --git a/libchill/basicio.c b/libchill/basicio.c
deleted file mode 100644
index 79fd9cbfa93..00000000000
--- a/libchill/basicio.c
+++ /dev/null
@@ -1,483 +0,0 @@
-/* Implement Input/Output runtime actions for CHILL.
- Copyright (C) 1992,1993 Free Software Foundation, Inc.
- Author: Wilfried Moser, et al
-
- This file is part of GNU CC.
-
- GNU CC is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- GNU CC is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with GNU CC; see the file COPYING. If not, write to
- the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with other files,
- some of which are compiled with GCC, to produce an executable,
- this library 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. */
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <limits.h>
-#include <errno.h>
-
-#include <string.h>
-#include <stdlib.h>
-
-#include "fileio.h"
-
-#ifndef PATH_MAX
-# ifdef _POSIX_PATH_MAX
-# define PATH_MAX _POSIX_PATH_MAX
-# else
-# ifdef MAXPATHLEN
-# define PATH_MAX MAXPATHLEN
-# else
-# define PATH_MAX 1024
-# endif
-# endif
-#endif
-
-static
-void
-GetSetAttributes( Association_Mode* the_assoc )
-{
- struct stat statbuf;
- int retco;
-
- if( (retco = stat( the_assoc->pathname, &statbuf )) )
- return;
-
- if( S_ISREG(statbuf.st_mode) )
- {
- SET_FLAG( the_assoc, IO_EXISTING );
- if( !TEST_FLAG( the_assoc, IO_VARIABLE ) )
- SET_FLAG( the_assoc, IO_INDEXABLE );
- }
- else
- if( S_ISCHR(statbuf.st_mode) || S_ISFIFO(statbuf.st_mode) )
- {
- SET_FLAG( the_assoc, IO_EXISTING );
- CLR_FLAG( the_assoc, IO_INDEXABLE );
- }
- SET_FLAG( the_assoc, IO_SEQUENCIBLE );
-
- /* FIXME: File size and computation of number of records for outoffile ? */
-
- if( !access( the_assoc->pathname, R_OK ) )
- SET_FLAG( the_assoc, IO_READABLE );
- if( !access( the_assoc->pathname, W_OK ) )
- SET_FLAG( the_assoc, IO_WRITEABLE );
-}
-
-static
-void
-makeName( Association_Mode* the_assoc, char* the_path, int the_path_len,
- char* file, int line)
-{
- int namlen;
- if( ! the_assoc->pathname &&
- ! (the_assoc->pathname = (char*)malloc( PATH_MAX )) )
- CHILLEXCEPTION( file, line, SPACEFAIL, PATHNAME_ALLOC );
-
- if( the_path[0] != DIRSEP )
- {
- if( !getcwd( the_assoc->pathname, PATH_MAX ) )
- {
- the_assoc->syserrno = errno;
- CHILLEXCEPTION( file, line, ASSOCIATEFAIL, GETCWD_FAILS );
- }
- namlen = strlen( the_assoc->pathname );
- the_assoc->pathname[namlen++] = DIRSEP;
- }
- else
- namlen = 0;
-
- strncpy( the_assoc->pathname + namlen, the_path, the_path_len );
- the_assoc->pathname[namlen+the_path_len] = '\0';
-}
-
-/*
- * ASSOCIATE
- */
-/* Caution: returns an Association mode location (!) */
-Association_Mode*
-__associate( Association_Mode* the_assoc,
- char* the_path,
- int the_path_len,
- char* the_mode,
- int the_mode_len,
- char* file,
- int line )
-{
- if( !the_assoc )
- CHILLEXCEPTION( file, line, EMPTY, NULL_ASSOCIATION );
-
- if( TEST_FLAG(the_assoc, IO_ISASSOCIATED) )
- CHILLEXCEPTION( file, line, ASSOCIATEFAIL, IS_ASSOCIATED );
-
- /* clear all flags */
- the_assoc->flags = 0;
-
- if( ! the_path_len )
- CHILLEXCEPTION( file, line, ASSOCIATEFAIL, NO_PATH_NAME );
-
- makeName( the_assoc, the_path, the_path_len, file, line );
- GetSetAttributes( the_assoc );
-
- CLR_FLAG( the_assoc, IO_VARIABLE );
- if ( the_mode )
- {
- if( !strncmp( the_mode, "VARIABLE", 8 ) )
- {
- SET_FLAG( the_assoc, IO_VARIABLE );
- CLR_FLAG( the_assoc, IO_INDEXABLE );
- }
- else
- if( strlen( the_mode ) )
- CHILLEXCEPTION( file, line, ASSOCIATEFAIL, INVALID_ASSOCIATION_MODE );
- }
-
- SET_FLAG( the_assoc, IO_ISASSOCIATED );
- return the_assoc;
-}
-
-/*
- * DISSOCIATE
- */
-void
-__dissociate( Association_Mode* the_assoc, char* file, int line )
-{
- if( !the_assoc )
- CHILLEXCEPTION( file, line, EMPTY, NULL_ASSOCIATION );
-
- if( !TEST_FLAG( the_assoc, IO_ISASSOCIATED ) )
- CHILLEXCEPTION( file, line, NOTASSOCIATED, IS_NOT_ASSOCIATED );
-
- if( the_assoc->access )
- __disconnect( the_assoc->access, file, line );
-
- the_assoc->access = NULL;
- CLR_FLAG( the_assoc, IO_ISASSOCIATED );
-
- /* free allocated memory */
- if (the_assoc->pathname)
- {
- free (the_assoc->pathname);
- the_assoc->pathname = 0;
- }
- if (the_assoc->bufptr)
- {
- free (the_assoc->bufptr);
- the_assoc->bufptr = 0;
- }
-}
-
-/*
- * CREATE
- */
-void __create( Association_Mode* the_assoc, char* file, int line )
-{
- if( !the_assoc )
- CHILLEXCEPTION( file, line, EMPTY, NULL_ASSOCIATION );
-
- if( !TEST_FLAG( the_assoc, IO_ISASSOCIATED ) )
- CHILLEXCEPTION( file, line, NOTASSOCIATED, IS_NOT_ASSOCIATED );
-
- if( TEST_FLAG( the_assoc, IO_EXISTING ) )
- CHILLEXCEPTION( file, line, CREATEFAIL, FILE_EXISTING );
-
- if( (the_assoc->handle = open( the_assoc->pathname, O_CREAT+O_TRUNC+O_WRONLY, 0666 ))
- == -1 )
- CHILLEXCEPTION( file, line, CREATEFAIL, CREATE_FAILS );
-
- the_assoc->usage = ReadWrite;
- GetSetAttributes( the_assoc );
-
- close( the_assoc->handle );
-}
-
-/*
- * MODIFY
- */
-void
-__modify( Association_Mode* the_assoc,
- char* the_path,
- int the_path_len,
- char* the_mode,
- int the_mode_len,
- char* file,
- int line )
-{
- if( !the_assoc )
- CHILLEXCEPTION( file, line, EMPTY, NULL_ASSOCIATION );
-
- if( !TEST_FLAG( the_assoc, IO_ISASSOCIATED ) )
- CHILLEXCEPTION( file, line, NOTASSOCIATED, IS_NOT_ASSOCIATED );
-
- if( the_path_len )
- {
- char* oldname;
-
- if( ! (oldname = (char*)malloc( PATH_MAX )) )
- CHILLEXCEPTION( file, line, SPACEFAIL, PATHNAME_ALLOC );
- strcpy( oldname, the_assoc->pathname );
-
- makeName( the_assoc, the_path, the_path_len, file, line );
-
- if( rename( oldname, the_assoc->pathname ) )
- {
- free( oldname );
- CHILLEXCEPTION( file, line, MODIFYFAIL, RENAME_FAILS );
- }
- free( oldname );
- }
- else
- {
- /* FIXME: other options? */
- }
-}
-
-static
-/*** char* DirMode[] = { "rb", "r+b", "r+b" }; ***/
-int DirMode[] = { O_RDONLY, O_RDWR, O_RDWR };
-
-static
-/*** char* SeqMode [] = { "rb", "r+b", "r+b" }; ***/
-int SeqMode[] = { O_RDONLY, O_RDWR, O_RDWR };
-
-/*
- * CONNECT
- */
-void
-__connect( void* the_transfer,
- Association_Mode* the_assoc,
- Usage_Mode the_usage,
- Where_Mode the_where,
- Boolean with_index,
- signed long the_index,
- char* file,
- int line )
-{
- Access_Mode* the_access;
- off_t filepos;
- off_t savepos;
- char dummy;
- unsigned long nbytes;
- int oflag;
-
- if( !the_transfer )
- CHILLEXCEPTION( file, line, EMPTY, NULL_ACCESS );
- if( !the_assoc )
- CHILLEXCEPTION( file, line, EMPTY, NULL_ASSOCIATION );
-
- if( TEST_FLAG((Text_Mode*)the_transfer, IO_TEXTLOCATION ))
- {
- if( ! ((Text_Mode*)the_transfer)->access_sub )
- CHILLEXCEPTION( file, line, EMPTY, NO_ACCESS_SUBLOCATION );
- the_access = ((Text_Mode*)the_transfer)->access_sub;
- SET_FLAG( the_access, IO_TEXTIO );
- }
- else
- {
- the_access = (Access_Mode*)the_transfer;
- CLR_FLAG( the_access, IO_TEXTIO );
- }
-
- /* FIXME: This should be an (implementation-dependent) static check
- if( with_index && the_access->rectype > Fixed )
- CHILLEXCEPTION( file, line, CONNECTFAIL, IMPL_RESTRICTION );
- */
-
- if( ! TEST_FLAG(the_assoc, IO_ISASSOCIATED) )
- CHILLEXCEPTION( file, line, NOTASSOCIATED, IS_NOT_ASSOCIATED );
-
- if( ! TEST_FLAG( the_assoc, IO_EXISTING ) )
- CHILLEXCEPTION( file, line, CONNECTFAIL, NOT_EXISTING );
-
- if( ! TEST_FLAG( the_assoc, IO_READABLE ) &&
- ( the_usage = ReadOnly || the_usage == ReadWrite ) )
- CHILLEXCEPTION( file, line, CONNECTFAIL, NOT_READABLE );
-
- if( ! TEST_FLAG( the_assoc, IO_WRITEABLE ) &&
- ( the_usage = WriteOnly || the_usage == ReadWrite ) )
- CHILLEXCEPTION( file, line, CONNECTFAIL, NOT_WRITEABLE );
-
- if( ! TEST_FLAG( the_assoc, IO_INDEXABLE )
- && TEST_FLAG( the_access, IO_INDEXED ) )
- CHILLEXCEPTION( file, line, CONNECTFAIL, NOT_INDEXABLE );
-
- if( ! TEST_FLAG( the_assoc, IO_SEQUENCIBLE )
- && ! TEST_FLAG( the_access, IO_INDEXED ) )
- CHILLEXCEPTION( file, line, CONNECTFAIL, NOT_SEQUENCIBLE );
-
- if( the_where == Same && the_assoc->access == NULL )
- CHILLEXCEPTION( file, line, CONNECTFAIL, NO_CURRENT_POS );
-
- /* This dynamic condition is not checked for text connections. */
- if( ! TEST_FLAG( the_access, IO_TEXTIO ) )
- if( ! TEST_FLAG( the_assoc, IO_VARIABLE )
- && the_access->rectype > Fixed
- && ( the_usage == WriteOnly || the_usage == ReadWrite ) )
- CHILLEXCEPTION( file, line, CONNECTFAIL, NOT_VARIABLE );
-
- if( TEST_FLAG( the_assoc, IO_VARIABLE )
- && the_access->rectype == Fixed
- && ( the_usage == ReadOnly || the_usage == ReadWrite ) )
- CHILLEXCEPTION( file, line, CONNECTFAIL, NOT_FIXED );
-
- if( ! TEST_FLAG( the_access, IO_INDEXED ) && the_usage == ReadWrite )
- CHILLEXCEPTION( file, line, CONNECTFAIL, NOT_INDEXED );
-
- /* Access location may be connected to a different association. */
- if( the_access->association && the_access->association != the_assoc )
- __disconnect( the_access, file, line );
-
- /* Is the association location already connected? */
- if( the_assoc->access )
- {
- /* save position just in case we need it for the_where == Same */
- if( (savepos = lseek( the_assoc->handle, 0L, SEEK_CUR )) == -1L )
- CHILLEXCEPTION( file, line, CONNECTFAIL, LSEEK_FAILS );
-
- /* text: read correction, flush buffer */
- if( the_assoc->bufptr ){
- savepos -= the_assoc->bufptr->len - the_assoc->bufptr->cur;
- the_assoc->bufptr->len = the_assoc->bufptr->cur = 0;
- }
-
- /* implicit disconnect */
- __disconnect( the_assoc->access, file, line );
- }
-
- the_assoc->usage = the_usage;
- CLR_FLAG( the_access, IO_OUTOFFILE );
-
- if( TEST_FLAG( the_access, IO_INDEXED ) )
- {
- if( (the_assoc->handle = open( the_assoc->pathname, DirMode[the_usage] )) == -1 )
- CHILLEXCEPTION( file, line, CONNECTFAIL, OPEN_FAILS );
-
- /* Set base index. */
- switch( the_where )
- {
- case First:
- filepos = 0;
- break;
- case Same:
- filepos = savepos;
- break;
- case Last:
- if( lseek( the_assoc->handle, 0L, SEEK_END ) == -1L )
- CHILLEXCEPTION( file, line, CONNECTFAIL, LSEEK_FAILS );
- filepos = lseek( the_assoc->handle, 0L, SEEK_CUR );
- break;
- }
-
- /* Set current index */
- if( with_index )
- {
- if( the_index < the_access->lowindex
- || the_access->highindex < the_index )
- CHILLEXCEPTION( file, line, RANGEFAIL, BAD_INDEX );
- filepos += (the_index - the_access->lowindex) * the_access->reclength;
- }
- if( lseek( the_assoc->handle, filepos, SEEK_SET ) == -1L )
- CHILLEXCEPTION( file, line, CONNECTFAIL, LSEEK_FAILS );
- the_access->base = filepos;
- }
- else
- {
- /* for association to text for reading: allocate buffer */
- if( TEST_FLAG((Text_Mode*)the_transfer, IO_TEXTLOCATION ) &&
- the_usage == ReadOnly &&
- !the_assoc->bufptr )
- {
- if( ! (the_assoc->bufptr = (readbuf_t*)malloc( sizeof(readbuf_t) )) )
- CHILLEXCEPTION( file, line, CONNECTFAIL, BUFFER_ALLOC );
- memset (the_assoc->bufptr, 0, sizeof (readbuf_t));
- }
- if( (the_assoc->handle = open( the_assoc->pathname, SeqMode[the_usage] )) == -1 )
- CHILLEXCEPTION( file, line, CONNECTFAIL, OPEN_FAILS );
-
- /* Set base index. */
- switch( the_where )
- {
- case First:
- filepos = 0;
- break;
- case Same:
- filepos = savepos;
- break;
- case Last:
- if( lseek( the_assoc->handle, 0L, SEEK_END ) == -1L )
- CHILLEXCEPTION( file, line, CONNECTFAIL, LSEEK_FAILS );
- filepos = lseek( the_assoc->handle, 0L, SEEK_CUR );
- break;
- }
-
- /* file truncation for sequential, Write Only */
- /***************************** FIXME: cannot truncate at Same
- if( the_usage == WriteOnly )
- {
- if( fseek( the_assoc->file_ptr, filepos, SEEK_SET ) == -1L )
- CHILLEXCEPTION( file, line, CONNECTFAIL, FSEEK_FAILS );
- fclose( the_assoc->file_ptr );
- if( !(the_assoc->file_ptr = fopen( the_assoc->pathname, "ab" )) )
- CHILLEXCEPTION( file, line, CONNECTFAIL, OPEN_FAILS );
- }
- else
- ***************************/
- if( (filepos = lseek( the_assoc->handle, filepos, SEEK_SET )) == -1L )
- CHILLEXCEPTION( file, line, CONNECTFAIL, LSEEK_FAILS );
- }
-
- the_access->association = the_assoc;
- the_assoc->access = the_access;
- /* for text: set carriage control default */
- if( TEST_FLAG((Text_Mode*)the_transfer, IO_TEXTLOCATION ) ){
- the_assoc->ctl_pre = '\0';
- the_assoc->ctl_post = '\n';
- }
-}
-
-void
-__disconnect( void* the_transfer, char* file, int line )
-{
- Access_Mode* the_access;
-
- if( !the_transfer )
- CHILLEXCEPTION( file, line, EMPTY, NULL_ACCESS );
-
- if( TEST_FLAG((Text_Mode*)the_transfer, IO_TEXTLOCATION ))
- {
- the_access = ((Text_Mode*)the_transfer)->access_sub;
- CLR_FLAG( the_access, IO_TEXTIO );
- }
- else
- the_access = (Access_Mode*)the_transfer;
-
- if( !the_access->association )
- CHILLEXCEPTION( file, line, NOTCONNECTED, IS_NOT_CONNECTED );
-
- close( the_access->association->handle );
- /* FIXME: check result */
-
- if( the_access->store_loc )
- free( the_access->store_loc );
- the_access->store_loc = NULL;
- the_access->association->access = NULL;
- the_access->association = NULL;
-}
diff --git a/libchill/bitstring.h b/libchill/bitstring.h
deleted file mode 100644
index 6870277d0b1..00000000000
--- a/libchill/bitstring.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/* Implement Input/Output runtime actions for CHILL.
- Copyright (C) 1992,1993 Free Software Foundation, Inc.
- Author: Wilfried Moser, et al
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with other files,
- some of which are compiled with GCC, to produce an executable,
- this library 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. */
-
-#ifndef _bitstring_h_
-#define _bitstring_h_
-
-int __inpowerset( int i, char* string, int strlen, int dummy );
-void __setbitpowerset (char *powerset, unsigned long bitlength,
- long minval, long bitno, char newval,
- char *filename, int lineno);
-
-#endif
diff --git a/libchill/cardps.c b/libchill/cardps.c
deleted file mode 100644
index c3de8c921da..00000000000
--- a/libchill/cardps.c
+++ /dev/null
@@ -1,106 +0,0 @@
-/* Implement POWERSET runtime actions for CHILL.
- Copyright (C) 1992,1993 Free Software Foundation, Inc.
- Author: Wilfried Moser, et al
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with other files,
- some of which are compiled with GCC, to produce an executable,
- this library 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. */
-
-#define __CHILL_LIB__
-
-#include <stdio.h>
-#include "powerset.h"
-
-
-/*
- * function __cardpowerset
- *
- * parameters:
- * ps powerset
- * bitlength length of powerset
- *
- * returns:
- * long number of set bits
- *
- * exceptions:
- * none
- *
- * abstract:
- * returns the number of set bit's in a powerset
- *
- */
-
-/* bit_count[I] is number of '1' bits in I. */
-static
-const unsigned char __four_bit_count[16] = {
- 0, 1, 1, 2,
- 1, 2, 2, 3,
- 1, 2, 2, 3,
- 2, 3, 3, 4 };
-
-long
-__cardpowerset (ps, bitlength)
- SET_WORD *ps;
- unsigned long bitlength;
-{
- unsigned long count = 0;
- if (bitlength <= SET_CHAR_SIZE)
- {
- register SET_CHAR c = *((SET_CHAR *)ps);
- /* count 4 bits at a time. */
- while (c > 0)
- {
- count += __four_bit_count[c & 15];
- c >>= 4;
- }
- return count;
- }
- else if (bitlength <= SET_SHORT_SIZE)
- {
- register SET_SHORT c = *((SET_SHORT *)ps);
- /* count 4 bits at a time. */
- while (c > 0)
- {
- count += __four_bit_count[c & 15];
- c >>= 4;
- }
- return count;
- }
- else
- {
- register SET_WORD *p = ps;
- SET_WORD *endp = p + BITS_TO_WORDS(bitlength);
-
- while (p < endp)
- {
- register SET_WORD c = *p++;
- /* count 4 bits at a time. */
- while (c > 0)
- {
- count += __four_bit_count[c & 15];
- c >>= 4;
- }
- }
- return (count);
- }
-}
diff --git a/libchill/cause.c b/libchill/cause.c
deleted file mode 100644
index 544f0f94a5e..00000000000
--- a/libchill/cause.c
+++ /dev/null
@@ -1,54 +0,0 @@
-/* Implement runtime actions for CHILL.
- Copyright (C) 1992,1993 Free Software Foundation, Inc.
- Author: Wilfried Moser
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with other files,
- some of which are compiled with GCC, to produce an executable,
- this library 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. */
-
-#define __CHILL_LIB__
-
-/*
- * function cause_exception
- *
- * parameters:
- * exname exception name
- * file file name
- * lineno line number
- * user_arg user specified argument
- *
- * returns:
- * void
- *
- * abstract:
- * dummy for ChillLib but may be overwritten by the user
- *
- */
-void
-cause_exception (exname, file, lineno, user_arg)
- char *exname;
- char *file;
- int lineno;
- int user_arg;
-{
-}
diff --git a/libchill/checkcycle.c b/libchill/checkcycle.c
deleted file mode 100644
index 992a05acbd6..00000000000
--- a/libchill/checkcycle.c
+++ /dev/null
@@ -1,73 +0,0 @@
-/* Implement timing-related runtime actions for CHILL.
- Copyright (C) 1992,1993 Free Software Foundation, Inc.
- Author: Wilfried Moser
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with other files,
- some of which are compiled with GCC, to produce an executable,
- this library 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. */
-
-#include "rtltypes.h"
-#include "rts.h"
-
-EXCEPTION (cyclefail);
-
-/*
- * function __check_cycle
- *
- * parameters:
- * t pointer to initial time
- * dur duration
- * filename filename of call
- * lineno linenumber of call
- *
- * returns:
- * void
- *
- * exceptions:
- * cyclefail
- *
- * abstract:
- * Function checks if cycle is possible (there is time left) and wait the
- * remaining time.
- *
- */
-
-extern int __remaintime (RtsTime *since, unsigned long dur, RtsTime *remain);
-extern int __cause_ex1 (char *ex, char *file, int lineno);
-
-void
-__check_cycle (t, dur, fname, lineno)
- RtsTime *t;
- unsigned long dur;
- char *fname;
- int lineno;
-{
- RtsTime remain;
-
- if (__remaintime (t, dur, &remain) != 0)
- /* no time left -- cause exception */
- __cause_ex1 ("cyclefail", fname, lineno);
-
- /* delay the process */
- __delay_this (wait_wait, &remain, fname, lineno);
-}
diff --git a/libchill/chillrt0.c b/libchill/chillrt0.c
deleted file mode 100644
index 3c25be2d3eb..00000000000
--- a/libchill/chillrt0.c
+++ /dev/null
@@ -1,155 +0,0 @@
-/* Implement runtime actions for CHILL.
- Copyright (C) 1992,1993 Free Software Foundation, Inc.
- Author: Wilfried Moser
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with other files,
- some of which are compiled with GCC, to produce an executable,
- this library 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. */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <string.h>
-
-#include "rtltypes.h"
-#include "iomodes.h"
-
-/* type definitions */
-typedef void (*init_ptr) ();
-typedef void (*rts_init_ptr) (int *argc, char *argv []);
-
-typedef struct INIT_LIST
-{
- init_ptr code;
- struct INIT_LIST *forward;
-} InitList;
-
-InitList *_ch_init_list = 0;
-
-/* force linker to get correct RTS functions */
-extern rts_init_ptr __RTS_INIT__;
-extern init_ptr __RTS_MAIN_LOOP__;
-extern init_ptr __RTS_FETCH_NUMBERS__;
-extern init_ptr __RTS_FETCH_NAMES__;
-static init_ptr *rts_dummies[4] =
-{
- &__RTS_INIT__,
- &__RTS_MAIN_LOOP__,
- &__RTS_FETCH_NUMBERS__,
- &__RTS_FETCH_NAMES__,
-};
-
-/* chill argc and argv */
-int chill_argc = 0;
-TVaryingCharType **chill_argv = NULL;
-
-/* the program name for debugging purpose */
-char *progname = 0;
-
-extern void *__xmalloc_ ();
-
-/*
- * function __xrealloc_
- *
- * parameter:
- * ptr pointer to reallocate
- * size new number of bytes
- *
- * returns:
- * void*
- *
- * abstract:
- * This is the general reallocation routine for libchill
- *
- */
-
-void *
-__xrealloc_ (ptr, size)
-void *ptr;
-int size;
-{
- void *tmp = realloc (ptr, size);
-
- if (!tmp)
- {
- fprintf (stderr, "ChillLib: Out of heap space.\n");
- fflush (stderr);
- exit (ENOMEM);
- }
- return (tmp);
-} /* __xrealloc_ */
-
-static void
-setup_argc_argv (argc, argv)
-int argc;
-char *argv[];
-{
- int i;
-
- chill_argv = __xmalloc_ ((argc + 1) * sizeof (TVaryingCharType *));
- for (i = 0; i < argc; i++)
- {
- chill_argv[i] = __xmalloc_ (sizeof (TVaryingCharType) + strlen (argv[i]) + 1);
- chill_argv[i]->len = strlen (argv[i]);
- strcpy (chill_argv[i]->body, argv[i]);
- }
- chill_argv[chill_argc = argc] = NULL;
-
- if ((progname = strrchr (argv[0], '/')) == 0)
- progname = argv[0];
- else
- progname++;
-
-} /* setup_argc_argv */
-
-extern void __setexceptionStack ();
-
-/*--------- main entry for each CHILL - program ----------*/
-int
-main (argc, argv)
- int argc;
- char *argv [];
-{
- /* call look up for tasking */
- (*__RTS_INIT__) (&argc, argv);
-
- /* setup argc and argv */
- setup_argc_argv (argc, argv);
-
- /* clear exception stack */
- __setexceptionStack (0);
-
- /* now call code at module level */
- while (_ch_init_list)
- {
- if (_ch_init_list->code)
- (*(_ch_init_list->code)) ();
- _ch_init_list = _ch_init_list->forward;
- }
-
- /* if we have rts linked, something will be done, else just return */
- (*__RTS_MAIN_LOOP__) ();
-
- return (0);
-
-} /* main */
diff --git a/libchill/chillstdio.c b/libchill/chillstdio.c
deleted file mode 100644
index d12c809625e..00000000000
--- a/libchill/chillstdio.c
+++ /dev/null
@@ -1,218 +0,0 @@
-/* Implement runtime actions for CHILL.
- Copyright (C) 1992,1993 Free Software Foundation, Inc.
- Author: Wilfried Moser
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with other files,
- some of which are compiled with GCC, to produce an executable,
- this library 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. */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <string.h>
-
-#include "iomodes.h"
-
-/* predefined associations, accesses, and text for stdin, stdout, stderr */
-/* stdin */
-#define STDIO_TEXT_LENGTH 1024
-#define STDIN_TEXT_LENGTH STDIO_TEXT_LENGTH
-
-static Access_Mode stdin_access;
-
-#ifndef STDIN_FILENO
-#define STDIN_FILENO 0
-#endif
-
-static
-Association_Mode stdin_association =
-{
- IO_EXISTING | IO_READABLE | IO_SEQUENCIBLE | IO_ISASSOCIATED,
- NULL,
- &stdin_access,
- STDIN_FILENO,
- NULL,
- 0,
- ReadOnly
-};
-
-static Access_Mode stdin_access =
-{
- IO_TEXTIO,
- STDIN_TEXT_LENGTH + 2,
- 0,
- 0,
- &stdin_association,
- 0,
- NULL,
- VaryingChars
-};
-
-static
-VARYING_STRING(STDIN_TEXT_LENGTH) stdin_text_record;
-
-Text_Mode chill_stdin =
-{
- IO_TEXTLOCATION,
- (VarString *)&stdin_text_record,
- &stdin_access,
- 0
-};
-
-/* stdout */
-#define STDOUT_TEXT_LENGTH STDIO_TEXT_LENGTH
-#ifndef STDOUT_FILENO
-#define STDOUT_FILENO 1
-#endif
-
-static Access_Mode stdout_access;
-
-static
-Association_Mode stdout_association =
-{
- IO_EXISTING | IO_WRITEABLE | IO_SEQUENCIBLE | IO_ISASSOCIATED,
- NULL,
- &stdout_access,
- STDOUT_FILENO,
- NULL,
- 0,
- WriteOnly
-};
-
-static Access_Mode stdout_access =
-{
- IO_TEXTIO,
- STDOUT_TEXT_LENGTH + 2,
- 0,
- 0,
- &stdout_association,
- 0,
- NULL,
- VaryingChars
-};
-
-static
-VARYING_STRING(STDOUT_TEXT_LENGTH) stdout_text_record;
-
-Text_Mode chill_stdout =
-{
- IO_TEXTLOCATION,
- (VarString *)&stdout_text_record,
- &stdout_access,
- 0
-};
-
-/* stderr */
-#define STDERR_TEXT_LENGTH STDIO_TEXT_LENGTH
-#ifndef STDERR_FILENO
-#define STDERR_FILENO 2
-#endif
-
-static Access_Mode stderr_access;
-
-static
-Association_Mode stderr_association =
-{
- IO_EXISTING | IO_WRITEABLE | IO_SEQUENCIBLE | IO_ISASSOCIATED,
- NULL,
- &stderr_access,
- STDERR_FILENO,
- NULL,
- 0,
- WriteOnly
-};
-
-static Access_Mode stderr_access =
-{
- IO_TEXTIO,
- STDERR_TEXT_LENGTH + 2,
- 0,
- 0,
- &stderr_association,
- 0,
- NULL,
- VaryingChars
-};
-
-static
-VARYING_STRING(STDIN_TEXT_LENGTH) stderr_text_record;
-
-Text_Mode chill_stderr =
-{
- IO_TEXTLOCATION,
- (VarString *)&stderr_text_record,
- &stderr_access,
- 0
-};
-
-/*
- * function __xmalloc_
- *
- * parameter:
- * size number of bytes to allocate
- *
- * returns:
- * void*
- *
- * abstract:
- * This is the general allocation routine for libchill
- *
- */
-
-void *
-__xmalloc_ (size)
-int size;
-{
- void *tmp = malloc (size);
-
- if (!tmp)
- {
- fprintf (stderr, "ChillLib: Out of heap space.\n");
- fflush (stderr);
- exit (ENOMEM);
- }
- return (tmp);
-} /* __xmalloc_ */
-
-static char *
-newstring (char *str)
-{
- char *tmp = __xmalloc_ (strlen (str) + 1);
- strcpy (tmp, str);
- return tmp;
-}
-
-static void setup_stdinout (void) __attribute__((constructor));
-
-static void
-setup_stdinout ()
-{
- /* allocate the names */
- stdin_association.pathname = newstring ("stdin");
- stdout_association.pathname = newstring ("stdout");
- stderr_association.pathname = newstring ("stderr");
-
- /* stdin needs a readbuffer */
- stdin_association.bufptr = __xmalloc_ (sizeof (readbuf_t));
- memset (stdin_association.bufptr, 0, sizeof (readbuf_t));
-}
diff --git a/libchill/concatps.c b/libchill/concatps.c
deleted file mode 100644
index f350f2b5363..00000000000
--- a/libchill/concatps.c
+++ /dev/null
@@ -1,101 +0,0 @@
-/* Implement powerset-related runtime actions for CHILL.
- Copyright (C) 1992, 93, 1994 Free Software Foundation, Inc.
- Author: Bill Cox
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with other files,
- some of which are compiled with GCC, to produce an executable,
- this library 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. */
-
-#define __CHILL_LIB__
-
-#include "powerset.h"
-
-extern void cause_exception (char *exname, char *file, int lineno);
-
-/*
- * function __concatps
- *
- * parameters:
- * OUT - pointer to output PS
- * LEFT - pointer to left PS
- * LEFTLEN - length of left PS in bits
- * RIGHT - pointer to right PS
- * RIGHTLEN - length of right PS in bits
- *
- * returns:
- * void
- *
- * exceptions:
- * none
- *
- * abstract:
- * concatenates two powersets into the output powerset.
- *
- */
-
-extern void
-__pscpy (SET_WORD *dps,
- unsigned long dbl,
- unsigned long doffset,
- SET_WORD *sps,
- unsigned long sbl,
- unsigned long start,
- unsigned long length);
-
-void
-__concatps (out, left, leftlen, right, rightlen)
- SET_WORD *out;
- SET_WORD *left;
- unsigned long leftlen;
- SET_WORD *right;
- unsigned long rightlen;
-{
- /* allocated sizes for each set involved */
- unsigned long outall, leftall, rightall;
-
- if (!out)
- {
- /* FIXME: cause an exception */
- }
- else if (leftlen == 0 || !left)
- {
- if (rightlen == 0 || !right)
- return; /* no work to do */
- __pscpy (out, rightlen, (unsigned long)0,
- right, rightlen, (unsigned long)0, rightlen);
- }
- else if (rightlen == 0 || !right)
- {
- if (leftlen == 0 || !left)
- return; /* no work to do */
- __pscpy (out, leftlen, (unsigned long)0,
- left, leftlen, (unsigned long)0, leftlen);
- }
- /* copy the left powerset into bits 0..leftlen - 1 */
- __pscpy (out, leftlen + rightlen, (unsigned long)0,
- left, leftlen, (unsigned long)0, leftlen);
-
- /* copy the right powerset into bits leftlen..leftlen+rightlen-1 */
- __pscpy (out, leftlen + rightlen, leftlen,
- right, rightlen, (unsigned long)0, rightlen);
-}
diff --git a/libchill/concatstr.c b/libchill/concatstr.c
deleted file mode 100644
index 866d3307ef5..00000000000
--- a/libchill/concatstr.c
+++ /dev/null
@@ -1,80 +0,0 @@
-/* Implement string-related runtime actions for CHILL.
- Copyright (C) 1992,1993,2000 Free Software Foundation, Inc.
- Author: Bill Cox
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with other files,
- some of which are compiled with GCC, to produce an executable,
- this library 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. */
-
-#include <stdlib.h>
-#include <string.h>
-
-#define MIN(a, b) ((a) < (b) ? (a) : (b))
-
-extern void cause_exception (char *exname, char *file, int lineno);
-
-/*
- * function __concatstring
- *
- * parameters:
- * OUT - pointer to output string
- * S1 - pointer to left string
- * LEN1 - length of left string
- * S2 - pointer to right string
- * LEN2 - length of right string
- *
- * returns:
- * pointer to OUT string
- *
- * exceptions:
- * none
- *
- * abstract:
- * concatenates two character strings into the output string
- *
- */
-
-char *
-__concatstring (out, s1, len1, s2, len2)
- char *out, *s1;
- int len1;
- char *s2;
- int len2;
-{
- if (out)
- {
- if (s2 /* Check for overlap between s2 and out. */
- && ((s2 >= out && s2 < (out + len1 + len2))
- || (s2 + len2 > out && s2 <= out + len1)))
- {
- char *tmp = alloca (len2);
- memcpy (tmp, s2, len2);
- s2 = tmp;
- }
- if (s1)
- memmove (out, s1, len1);
- if (s2)
- memcpy (&out[len1], s2, len2);
- }
- return out;
-}
diff --git a/libchill/configure b/libchill/configure
deleted file mode 100755
index 8111966c879..00000000000
--- a/libchill/configure
+++ /dev/null
@@ -1,1686 +0,0 @@
-#! /bin/sh
-
-# Guess values for system-dependent variables and create Makefiles.
-# Generated automatically using autoconf version 2.13
-# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
-#
-# This configure script is free software; the Free Software Foundation
-# gives unlimited permission to copy, distribute and modify it.
-
-# Defaults:
-ac_help=
-ac_default_prefix=/usr/local
-# Any additions from configure.in:
-
-# Initialize some variables set by options.
-# The variables have the same names as the options, with
-# dashes changed to underlines.
-build=NONE
-cache_file=./config.cache
-exec_prefix=NONE
-host=NONE
-no_create=
-nonopt=NONE
-no_recursion=
-prefix=NONE
-program_prefix=NONE
-program_suffix=NONE
-program_transform_name=s,x,x,
-silent=
-site=
-srcdir=
-target=NONE
-verbose=
-x_includes=NONE
-x_libraries=NONE
-bindir='${exec_prefix}/bin'
-sbindir='${exec_prefix}/sbin'
-libexecdir='${exec_prefix}/libexec'
-datadir='${prefix}/share'
-sysconfdir='${prefix}/etc'
-sharedstatedir='${prefix}/com'
-localstatedir='${prefix}/var'
-libdir='${exec_prefix}/lib'
-includedir='${prefix}/include'
-oldincludedir='/usr/include'
-infodir='${prefix}/info'
-mandir='${prefix}/man'
-
-# Initialize some other variables.
-subdirs=
-MFLAGS= MAKEFLAGS=
-SHELL=${CONFIG_SHELL-/bin/sh}
-# Maximum number of lines to put in a shell here document.
-ac_max_here_lines=12
-
-ac_prev=
-for ac_option
-do
-
- # If the previous option needs an argument, assign it.
- if test -n "$ac_prev"; then
- eval "$ac_prev=\$ac_option"
- ac_prev=
- continue
- fi
-
- case "$ac_option" in
- -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
- *) ac_optarg= ;;
- esac
-
- # Accept the important Cygnus configure options, so we can diagnose typos.
-
- case "$ac_option" in
-
- -bindir | --bindir | --bindi | --bind | --bin | --bi)
- ac_prev=bindir ;;
- -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
- bindir="$ac_optarg" ;;
-
- -build | --build | --buil | --bui | --bu)
- ac_prev=build ;;
- -build=* | --build=* | --buil=* | --bui=* | --bu=*)
- build="$ac_optarg" ;;
-
- -cache-file | --cache-file | --cache-fil | --cache-fi \
- | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
- ac_prev=cache_file ;;
- -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
- | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
- cache_file="$ac_optarg" ;;
-
- -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
- ac_prev=datadir ;;
- -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
- | --da=*)
- datadir="$ac_optarg" ;;
-
- -disable-* | --disable-*)
- ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
- # Reject names that are not valid shell variable names.
- if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
- { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
- fi
- ac_feature=`echo $ac_feature| sed 's/-/_/g'`
- eval "enable_${ac_feature}=no" ;;
-
- -enable-* | --enable-*)
- ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
- # Reject names that are not valid shell variable names.
- if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
- { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
- fi
- ac_feature=`echo $ac_feature| sed 's/-/_/g'`
- case "$ac_option" in
- *=*) ;;
- *) ac_optarg=yes ;;
- esac
- eval "enable_${ac_feature}='$ac_optarg'" ;;
-
- -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
- | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
- | --exec | --exe | --ex)
- ac_prev=exec_prefix ;;
- -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
- | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
- | --exec=* | --exe=* | --ex=*)
- exec_prefix="$ac_optarg" ;;
-
- -gas | --gas | --ga | --g)
- # Obsolete; use --with-gas.
- with_gas=yes ;;
-
- -help | --help | --hel | --he)
- # Omit some internal or obsolete options to make the list less imposing.
- # This message is too long to be a string in the A/UX 3.1 sh.
- cat << EOF
-Usage: configure [options] [host]
-Options: [defaults in brackets after descriptions]
-Configuration:
- --cache-file=FILE cache test results in FILE
- --help print this message
- --no-create do not create output files
- --quiet, --silent do not print \`checking...' messages
- --version print the version of autoconf that created configure
-Directory and file names:
- --prefix=PREFIX install architecture-independent files in PREFIX
- [$ac_default_prefix]
- --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
- [same as prefix]
- --bindir=DIR user executables in DIR [EPREFIX/bin]
- --sbindir=DIR system admin executables in DIR [EPREFIX/sbin]
- --libexecdir=DIR program executables in DIR [EPREFIX/libexec]
- --datadir=DIR read-only architecture-independent data in DIR
- [PREFIX/share]
- --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc]
- --sharedstatedir=DIR modifiable architecture-independent data in DIR
- [PREFIX/com]
- --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var]
- --libdir=DIR object code libraries in DIR [EPREFIX/lib]
- --includedir=DIR C header files in DIR [PREFIX/include]
- --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include]
- --infodir=DIR info documentation in DIR [PREFIX/info]
- --mandir=DIR man documentation in DIR [PREFIX/man]
- --srcdir=DIR find the sources in DIR [configure dir or ..]
- --program-prefix=PREFIX prepend PREFIX to installed program names
- --program-suffix=SUFFIX append SUFFIX to installed program names
- --program-transform-name=PROGRAM
- run sed PROGRAM on installed program names
-EOF
- cat << EOF
-Host type:
- --build=BUILD configure for building on BUILD [BUILD=HOST]
- --host=HOST configure for HOST [guessed]
- --target=TARGET configure for TARGET [TARGET=HOST]
-Features and packages:
- --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
- --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
- --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
- --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
- --x-includes=DIR X include files are in DIR
- --x-libraries=DIR X library files are in DIR
-EOF
- if test -n "$ac_help"; then
- echo "--enable and --with options recognized:$ac_help"
- fi
- exit 0 ;;
-
- -host | --host | --hos | --ho)
- ac_prev=host ;;
- -host=* | --host=* | --hos=* | --ho=*)
- host="$ac_optarg" ;;
-
- -includedir | --includedir | --includedi | --included | --include \
- | --includ | --inclu | --incl | --inc)
- ac_prev=includedir ;;
- -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
- | --includ=* | --inclu=* | --incl=* | --inc=*)
- includedir="$ac_optarg" ;;
-
- -infodir | --infodir | --infodi | --infod | --info | --inf)
- ac_prev=infodir ;;
- -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
- infodir="$ac_optarg" ;;
-
- -libdir | --libdir | --libdi | --libd)
- ac_prev=libdir ;;
- -libdir=* | --libdir=* | --libdi=* | --libd=*)
- libdir="$ac_optarg" ;;
-
- -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
- | --libexe | --libex | --libe)
- ac_prev=libexecdir ;;
- -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
- | --libexe=* | --libex=* | --libe=*)
- libexecdir="$ac_optarg" ;;
-
- -localstatedir | --localstatedir | --localstatedi | --localstated \
- | --localstate | --localstat | --localsta | --localst \
- | --locals | --local | --loca | --loc | --lo)
- ac_prev=localstatedir ;;
- -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
- | --localstate=* | --localstat=* | --localsta=* | --localst=* \
- | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
- localstatedir="$ac_optarg" ;;
-
- -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
- ac_prev=mandir ;;
- -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
- mandir="$ac_optarg" ;;
-
- -nfp | --nfp | --nf)
- # Obsolete; use --without-fp.
- with_fp=no ;;
-
- -no-create | --no-create | --no-creat | --no-crea | --no-cre \
- | --no-cr | --no-c)
- no_create=yes ;;
-
- -no-recursion | --no-recursion | --no-recursio | --no-recursi \
- | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
- no_recursion=yes ;;
-
- -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
- | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
- | --oldin | --oldi | --old | --ol | --o)
- ac_prev=oldincludedir ;;
- -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
- | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
- | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
- oldincludedir="$ac_optarg" ;;
-
- -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
- ac_prev=prefix ;;
- -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
- prefix="$ac_optarg" ;;
-
- -program-prefix | --program-prefix | --program-prefi | --program-pref \
- | --program-pre | --program-pr | --program-p)
- ac_prev=program_prefix ;;
- -program-prefix=* | --program-prefix=* | --program-prefi=* \
- | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
- program_prefix="$ac_optarg" ;;
-
- -program-suffix | --program-suffix | --program-suffi | --program-suff \
- | --program-suf | --program-su | --program-s)
- ac_prev=program_suffix ;;
- -program-suffix=* | --program-suffix=* | --program-suffi=* \
- | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
- program_suffix="$ac_optarg" ;;
-
- -program-transform-name | --program-transform-name \
- | --program-transform-nam | --program-transform-na \
- | --program-transform-n | --program-transform- \
- | --program-transform | --program-transfor \
- | --program-transfo | --program-transf \
- | --program-trans | --program-tran \
- | --progr-tra | --program-tr | --program-t)
- ac_prev=program_transform_name ;;
- -program-transform-name=* | --program-transform-name=* \
- | --program-transform-nam=* | --program-transform-na=* \
- | --program-transform-n=* | --program-transform-=* \
- | --program-transform=* | --program-transfor=* \
- | --program-transfo=* | --program-transf=* \
- | --program-trans=* | --program-tran=* \
- | --progr-tra=* | --program-tr=* | --program-t=*)
- program_transform_name="$ac_optarg" ;;
-
- -q | -quiet | --quiet | --quie | --qui | --qu | --q \
- | -silent | --silent | --silen | --sile | --sil)
- silent=yes ;;
-
- -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
- ac_prev=sbindir ;;
- -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
- | --sbi=* | --sb=*)
- sbindir="$ac_optarg" ;;
-
- -sharedstatedir | --sharedstatedir | --sharedstatedi \
- | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
- | --sharedst | --shareds | --shared | --share | --shar \
- | --sha | --sh)
- ac_prev=sharedstatedir ;;
- -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
- | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
- | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
- | --sha=* | --sh=*)
- sharedstatedir="$ac_optarg" ;;
-
- -site | --site | --sit)
- ac_prev=site ;;
- -site=* | --site=* | --sit=*)
- site="$ac_optarg" ;;
-
- -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
- ac_prev=srcdir ;;
- -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
- srcdir="$ac_optarg" ;;
-
- -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
- | --syscon | --sysco | --sysc | --sys | --sy)
- ac_prev=sysconfdir ;;
- -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
- | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
- sysconfdir="$ac_optarg" ;;
-
- -target | --target | --targe | --targ | --tar | --ta | --t)
- ac_prev=target ;;
- -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
- target="$ac_optarg" ;;
-
- -v | -verbose | --verbose | --verbos | --verbo | --verb)
- verbose=yes ;;
-
- -version | --version | --versio | --versi | --vers)
- echo "configure generated by autoconf version 2.13"
- exit 0 ;;
-
- -with-* | --with-*)
- ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
- # Reject names that are not valid shell variable names.
- if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
- { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
- fi
- ac_package=`echo $ac_package| sed 's/-/_/g'`
- case "$ac_option" in
- *=*) ;;
- *) ac_optarg=yes ;;
- esac
- eval "with_${ac_package}='$ac_optarg'" ;;
-
- -without-* | --without-*)
- ac_package=`echo $ac_option|sed -e 's/-*without-//'`
- # Reject names that are not valid shell variable names.
- if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
- { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
- fi
- ac_package=`echo $ac_package| sed 's/-/_/g'`
- eval "with_${ac_package}=no" ;;
-
- --x)
- # Obsolete; use --with-x.
- with_x=yes ;;
-
- -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
- | --x-incl | --x-inc | --x-in | --x-i)
- ac_prev=x_includes ;;
- -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
- | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
- x_includes="$ac_optarg" ;;
-
- -x-libraries | --x-libraries | --x-librarie | --x-librari \
- | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
- ac_prev=x_libraries ;;
- -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
- | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
- x_libraries="$ac_optarg" ;;
-
- -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
- ;;
-
- *)
- if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
- echo "configure: warning: $ac_option: invalid host type" 1>&2
- fi
- if test "x$nonopt" != xNONE; then
- { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
- fi
- nonopt="$ac_option"
- ;;
-
- esac
-done
-
-if test -n "$ac_prev"; then
- { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
-fi
-
-trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
-
-# File descriptor usage:
-# 0 standard input
-# 1 file creation
-# 2 errors and warnings
-# 3 some systems may open it to /dev/tty
-# 4 used on the Kubota Titan
-# 6 checking for... messages and results
-# 5 compiler messages saved in config.log
-if test "$silent" = yes; then
- exec 6>/dev/null
-else
- exec 6>&1
-fi
-exec 5>./config.log
-
-echo "\
-This file contains any messages produced by compilers while
-running configure, to aid debugging if configure makes a mistake.
-" 1>&5
-
-# Strip out --no-create and --no-recursion so they do not pile up.
-# Also quote any args containing shell metacharacters.
-ac_configure_args=
-for ac_arg
-do
- case "$ac_arg" in
- -no-create | --no-create | --no-creat | --no-crea | --no-cre \
- | --no-cr | --no-c) ;;
- -no-recursion | --no-recursion | --no-recursio | --no-recursi \
- | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
- *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
- ac_configure_args="$ac_configure_args '$ac_arg'" ;;
- *) ac_configure_args="$ac_configure_args $ac_arg" ;;
- esac
-done
-
-# NLS nuisances.
-# Only set these to C if already set. These must not be set unconditionally
-# because not all systems understand e.g. LANG=C (notably SCO).
-# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
-# Non-C LC_CTYPE values break the ctype check.
-if test "${LANG+set}" = set; then LANG=C; export LANG; fi
-if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
-if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
-if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
-
-# confdefs.h avoids OS command line length limits that DEFS can exceed.
-rm -rf conftest* confdefs.h
-# AIX cpp loses on an empty file, so make sure it contains at least a newline.
-echo > confdefs.h
-
-# A filename unique to this package, relative to the directory that
-# configure is in, which we can look for to find out if srcdir is correct.
-ac_unique_file=chillrt0.c
-
-# Find the source files, if location was not specified.
-if test -z "$srcdir"; then
- ac_srcdir_defaulted=yes
- # Try the directory containing this script, then its parent.
- ac_prog=$0
- ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
- test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
- srcdir=$ac_confdir
- if test ! -r $srcdir/$ac_unique_file; then
- srcdir=..
- fi
-else
- ac_srcdir_defaulted=no
-fi
-if test ! -r $srcdir/$ac_unique_file; then
- if test "$ac_srcdir_defaulted" = yes; then
- { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
- else
- { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
- fi
-fi
-srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
-
-# Prefer explicitly selected file to automatically selected ones.
-if test -z "$CONFIG_SITE"; then
- if test "x$prefix" != xNONE; then
- CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
- else
- CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
- fi
-fi
-for ac_site_file in $CONFIG_SITE; do
- if test -r "$ac_site_file"; then
- echo "loading site script $ac_site_file"
- . "$ac_site_file"
- fi
-done
-
-if test -r "$cache_file"; then
- echo "loading cache $cache_file"
- . $cache_file
-else
- echo "creating cache $cache_file"
- > $cache_file
-fi
-
-ac_ext=c
-# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cc_cross
-
-ac_exeext=
-ac_objext=o
-if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
- # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
- if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
- ac_n= ac_c='
-' ac_t=' '
- else
- ac_n=-n ac_c= ac_t=
- fi
-else
- ac_n= ac_c='\c' ac_t=
-fi
-
-
-
-if test "${srcdir}" = "." ; then
- if test "${with_target_subdir}" != "." ; then
- topsrcdir=${with_multisrctop}../..
- else
- topsrcdir=${with_multisrctop}..
- fi
-else
- topsrcdir=${srcdir}/..
-fi
-ac_aux_dir=
-for ac_dir in $topsrcdir $srcdir/$topsrcdir; do
- if test -f $ac_dir/install-sh; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/install-sh -c"
- break
- elif test -f $ac_dir/install.sh; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/install.sh -c"
- break
- fi
-done
-if test -z "$ac_aux_dir"; then
- { echo "configure: error: can not find install-sh or install.sh in $topsrcdir $srcdir/$topsrcdir" 1>&2; exit 1; }
-fi
-ac_config_guess=$ac_aux_dir/config.guess
-ac_config_sub=$ac_aux_dir/config.sub
-ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
-
-
-# If the language specific compiler does not exist, but the "gcc" directory
-# does, we do not build anything. Note, $r is set by the top-level Makefile.
-# Note that when we look for the compiler, we search both with and without
-# extension to handle cross and canadian cross builds.
-compiler_name=cc1chill
-rm -f skip-this-dir
-echo $ac_n "checking if compiler $compiler_name has been built""... $ac_c" 1>&6
-echo "configure:562: checking if compiler $compiler_name has been built" >&5
-if eval "test \"`echo '$''{'chill_cv_compiler_exists'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- chill_cv_compiler_exists=yes
-if test -n "$r"; then
- if test -d "$r"/gcc; then
- if test -f "$r"/gcc/$compiler_name \
- || test -f "$r"/gcc/$compiler_name.exe; then
- true
- else
- chill_cv_compiler_exists=no
- echo "rm -f config.cache config.log multilib.out" > skip-this-dir
- fi
- fi
-fi
-
-fi
-
-echo "$ac_t""$chill_cv_compiler_exists" 1>&6
-if test x$chill_cv_compiler_exists = xno
-then
- rm -f Makefile conftest* confdefs* core
- exit 0
-fi
-
-# For chill we'll set CC to point at the built gcc, but this will get it into
-# the makefiles
-# Extract the first word of "gcc", so it can be a program name with args.
-set dummy gcc; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:593: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
- ac_dummy="$PATH"
- for ac_dir in $ac_dummy; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_prog_CC="gcc"
- break
- fi
- done
- IFS="$ac_save_ifs"
-fi
-fi
-CC="$ac_cv_prog_CC"
-if test -n "$CC"; then
- echo "$ac_t""$CC" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
-if test -z "$CC"; then
- # Extract the first word of "cc", so it can be a program name with args.
-set dummy cc; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:623: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
- ac_prog_rejected=no
- ac_dummy="$PATH"
- for ac_dir in $ac_dummy; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
- ac_prog_rejected=yes
- continue
- fi
- ac_cv_prog_CC="cc"
- break
- fi
- done
- IFS="$ac_save_ifs"
-if test $ac_prog_rejected = yes; then
- # We found a bogon in the path, so make sure we never use it.
- set dummy $ac_cv_prog_CC
- shift
- if test $# -gt 0; then
- # We chose a different compiler from the bogus one.
- # However, it has the same basename, so the bogon will be chosen
- # first if we set CC to just the basename; use the full file name.
- shift
- set dummy "$ac_dir/$ac_word" "$@"
- shift
- ac_cv_prog_CC="$@"
- fi
-fi
-fi
-fi
-CC="$ac_cv_prog_CC"
-if test -n "$CC"; then
- echo "$ac_t""$CC" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
- if test -z "$CC"; then
- case "`uname -s`" in
- *win32* | *WIN32*)
- # Extract the first word of "cl", so it can be a program name with args.
-set dummy cl; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:674: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
- ac_dummy="$PATH"
- for ac_dir in $ac_dummy; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_prog_CC="cl"
- break
- fi
- done
- IFS="$ac_save_ifs"
-fi
-fi
-CC="$ac_cv_prog_CC"
-if test -n "$CC"; then
- echo "$ac_t""$CC" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
- ;;
- esac
- fi
- test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
-fi
-
-echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:706: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
-
-ac_ext=c
-# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cc_cross
-
-cat > conftest.$ac_ext << EOF
-
-#line 717 "configure"
-#include "confdefs.h"
-
-main(){return(0);}
-EOF
-if { (eval echo configure:722: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- ac_cv_prog_cc_works=yes
- # If we can't run a trivial program, we are probably using a cross compiler.
- if (./conftest; exit) 2>/dev/null; then
- ac_cv_prog_cc_cross=no
- else
- ac_cv_prog_cc_cross=yes
- fi
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- ac_cv_prog_cc_works=no
-fi
-rm -fr conftest*
-ac_ext=c
-# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cc_cross
-
-echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
-if test $ac_cv_prog_cc_works = no; then
- { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
-fi
-echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:748: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
-echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
-cross_compiling=$ac_cv_prog_cc_cross
-
-echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:753: checking whether we are using GNU C" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.c <<EOF
-#ifdef __GNUC__
- yes;
-#endif
-EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:762: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
- ac_cv_prog_gcc=yes
-else
- ac_cv_prog_gcc=no
-fi
-fi
-
-echo "$ac_t""$ac_cv_prog_gcc" 1>&6
-
-if test $ac_cv_prog_gcc = yes; then
- GCC=yes
-else
- GCC=
-fi
-
-ac_test_CFLAGS="${CFLAGS+set}"
-ac_save_CFLAGS="$CFLAGS"
-CFLAGS=
-echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:781: checking whether ${CC-cc} accepts -g" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- echo 'void f(){}' > conftest.c
-if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
- ac_cv_prog_cc_g=yes
-else
- ac_cv_prog_cc_g=no
-fi
-rm -f conftest*
-
-fi
-
-echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
-if test "$ac_test_CFLAGS" = set; then
- CFLAGS="$ac_save_CFLAGS"
-elif test $ac_cv_prog_cc_g = yes; then
- if test "$GCC" = yes; then
- CFLAGS="-g -O2"
- else
- CFLAGS="-g"
- fi
-else
- if test "$GCC" = yes; then
- CFLAGS="-O2"
- else
- CFLAGS=
- fi
-fi
-
-
-test "$AR" || AR=ar
-
-if test "$RANLIB"; then :
-
-else
- # 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:821: 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
- if test -n "$RANLIB"; then
- ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
-else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
- ac_dummy="$PATH"
- for ac_dir in $ac_dummy; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_prog_RANLIB="ranlib"
- break
- fi
- done
- IFS="$ac_save_ifs"
- test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
-fi
-fi
-RANLIB="$ac_cv_prog_RANLIB"
-if test -n "$RANLIB"; then
- echo "$ac_t""$RANLIB" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
-fi
-echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:850: 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
-else
- cat > conftestmake <<\EOF
-all:
- @echo 'ac_maketemp="${MAKE}"'
-EOF
-# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
-eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
-if test -n "$ac_maketemp"; then
- eval ac_cv_prog_make_${ac_make}_set=yes
-else
- eval ac_cv_prog_make_${ac_make}_set=no
-fi
-rm -f conftestmake
-fi
-if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- SET_MAKE=
-else
- echo "$ac_t""no" 1>&6
- SET_MAKE="MAKE=${MAKE-make}"
-fi
-
-
-
-# Sanity check for the cross-compilation case:
-echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:880: checking how to run the C preprocessor" >&5
-# On Suns, sometimes $CPP names a directory.
-if test -n "$CPP" && test -d "$CPP"; then
- CPP=
-fi
-if test -z "$CPP"; then
-if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- # This must be in double quotes, not single quotes, because CPP may get
- # substituted into the Makefile and "${CC-cc}" will confuse make.
- CPP="${CC-cc} -E"
- # On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp.
- cat > conftest.$ac_ext <<EOF
-#line 895 "configure"
-#include "confdefs.h"
-#include <assert.h>
-Syntax Error
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:901: \"$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
- :
-else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- CPP="${CC-cc} -E -traditional-cpp"
- cat > conftest.$ac_ext <<EOF
-#line 912 "configure"
-#include "confdefs.h"
-#include <assert.h>
-Syntax Error
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:918: \"$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
- :
-else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- CPP="${CC-cc} -nologo -E"
- cat > conftest.$ac_ext <<EOF
-#line 929 "configure"
-#include "confdefs.h"
-#include <assert.h>
-Syntax Error
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:935: \"$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
- :
-else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- CPP=/lib/cpp
-fi
-rm -f conftest*
-fi
-rm -f conftest*
-fi
-rm -f conftest*
- ac_cv_prog_CPP="$CPP"
-fi
- CPP="$ac_cv_prog_CPP"
-else
- ac_cv_prog_CPP="$CPP"
-fi
-echo "$ac_t""$CPP" 1>&6
-
-ac_safe=`echo "stdio.h" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for stdio.h""... $ac_c" 1>&6
-echo "configure:961: checking for stdio.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 966 "configure"
-#include "confdefs.h"
-#include <stdio.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:971: \"$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*
- eval "ac_cv_header_$ac_safe=yes"
-else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=no"
-fi
-rm -f conftest*
-fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- :
-else
- echo "$ac_t""no" 1>&6
-{ echo "configure: error: Can't find stdio.h.
-You must have a usable C system for the target already installed, at least
-including headers and, preferably, the library, before you can configure
-the Chill runtime system. If necessary, install gcc now with \`LANGUAGES=c',
-then the target library, then build with \`LANGUAGES=chill'." 1>&2; exit 1; }
-fi
-
-
-echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:999: 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 1004 "configure"
-#include "confdefs.h"
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <float.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1012: \"$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*
- ac_cv_header_stdc=yes
-else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ac_cv_header_stdc=no
-fi
-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 1029 "configure"
-#include "confdefs.h"
-#include <string.h>
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "memchr" >/dev/null 2>&1; then
- :
-else
- rm -rf conftest*
- ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-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 1047 "configure"
-#include "confdefs.h"
-#include <stdlib.h>
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "free" >/dev/null 2>&1; then
- :
-else
- rm -rf conftest*
- ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
- # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
-if test "$cross_compiling" = yes; then
- :
-else
- cat > conftest.$ac_ext <<EOF
-#line 1068 "configure"
-#include "confdefs.h"
-#include <ctype.h>
-#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
-#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
-#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
-int main () { int i; for (i = 0; i < 256; i++)
-if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
-exit (0); }
-
-EOF
-if { (eval echo configure:1079: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
- :
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -fr conftest*
- ac_cv_header_stdc=no
-fi
-rm -fr conftest*
-fi
-
-fi
-fi
-
-echo "$ac_t""$ac_cv_header_stdc" 1>&6
-if test $ac_cv_header_stdc = yes; then
- cat >> confdefs.h <<\EOF
-#define STDC_HEADERS 1
-EOF
-
-fi
-
-
-echo $ac_n "checking for posix""... $ac_c" 1>&6
-echo "configure:1104: checking for posix" >&5
-if eval "test \"`echo '$''{'chill_cv_header_posix'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1109 "configure"
-#include "confdefs.h"
-#include <sys/types.h>
-#include <unistd.h>
-#ifdef _POSIX_VERSION
- yes
-#endif
-
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "yes" >/dev/null 2>&1; then
- rm -rf conftest*
- chill_cv_header_posix=yes
-else
- rm -rf conftest*
- chill_cv_header_posix=no
-fi
-rm -f conftest*
-
-fi
-
-echo "$ac_t""$chill_cv_header_posix" 1>&6
-
-# We can rely on the GNU library being posix-ish. I guess checking the
-# header isn't actually like checking the functions, though...
-echo $ac_n "checking for GNU library""... $ac_c" 1>&6
-echo "configure:1135: checking for GNU library" >&5
-if eval "test \"`echo '$''{'chill_cv_lib_gnu'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1140 "configure"
-#include "confdefs.h"
-#include <stdio.h>
-#ifdef __GNU_LIBRARY__
- yes
-#endif
-
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "yes" >/dev/null 2>&1; then
- rm -rf conftest*
- chill_cv_lib_gnu=yes
-else
- rm -rf conftest*
- chill_cv_lib_gnu=no
-fi
-rm -f conftest*
-
-fi
-
-echo "$ac_t""$chill_cv_lib_gnu" 1>&6
-
-echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
-echo "configure:1163: checking return type of signal handlers" >&5
-if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1168 "configure"
-#include "confdefs.h"
-#include <sys/types.h>
-#include <signal.h>
-#ifdef signal
-#undef signal
-#endif
-#ifdef __cplusplus
-extern "C" void (*signal (int, void (*)(int)))(int);
-#else
-void (*signal ()) ();
-#endif
-
-int main() {
-int i;
-; return 0; }
-EOF
-if { (eval echo configure:1185: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- ac_cv_type_signal=void
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ac_cv_type_signal=int
-fi
-rm -f conftest*
-fi
-
-echo "$ac_t""$ac_cv_type_signal" 1>&6
-cat >> confdefs.h <<EOF
-#define RETSIGTYPE $ac_cv_type_signal
-EOF
-
-
-# we'll get atexit by default
-if test $ac_cv_header_stdc != yes; then
-echo $ac_n "checking for atexit""... $ac_c" 1>&6
-echo "configure:1206: checking for atexit" >&5
-if eval "test \"`echo '$''{'ac_cv_func_atexit'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1211 "configure"
-#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char atexit(); below. */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char atexit();
-
-int main() {
-
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined (__stub_atexit) || defined (__stub___atexit)
-choke me
-#else
-atexit();
-#endif
-
-; return 0; }
-EOF
-if { (eval echo configure:1234: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_atexit=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_atexit=no"
-fi
-rm -f conftest*
-fi
-
-if eval "test \"`echo '$ac_cv_func_'atexit`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- cat >> confdefs.h <<\EOF
-#define onexit atexit
-EOF
-
-else
- echo "$ac_t""no" 1>&6
- cat >> confdefs.h <<\EOF
-#define NO_ONEXIT 1
-EOF
-
- echo $ac_n "checking for onexit""... $ac_c" 1>&6
-echo "configure:1259: checking for onexit" >&5
-if eval "test \"`echo '$''{'ac_cv_func_onexit'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1264 "configure"
-#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char onexit(); below. */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char onexit();
-
-int main() {
-
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined (__stub_onexit) || defined (__stub___onexit)
-choke me
-#else
-onexit();
-#endif
-
-; return 0; }
-EOF
-if { (eval echo configure:1287: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_onexit=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_onexit=no"
-fi
-rm -f conftest*
-fi
-
-if eval "test \"`echo '$ac_cv_func_'onexit`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- :
-else
- echo "$ac_t""no" 1>&6
-echo $ac_n "checking for on_exit""... $ac_c" 1>&6
-echo "configure:1305: checking for on_exit" >&5
-if eval "test \"`echo '$''{'ac_cv_func_on_exit'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1310 "configure"
-#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char on_exit(); below. */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char on_exit();
-
-int main() {
-
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined (__stub_on_exit) || defined (__stub___on_exit)
-choke me
-#else
-on_exit();
-#endif
-
-; return 0; }
-EOF
-if { (eval echo configure:1333: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_on_exit=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_on_exit=no"
-fi
-rm -f conftest*
-fi
-
-if eval "test \"`echo '$ac_cv_func_'on_exit`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- cat >> confdefs.h <<\EOF
-#define onexit on_exit
-EOF
-
-else
- echo "$ac_t""no" 1>&6
-fi
-
-fi
-
-fi
-
-else true
-fi
-echo $ac_n "checking for memmove""... $ac_c" 1>&6
-echo "configure:1362: checking for memmove" >&5
-if eval "test \"`echo '$''{'ac_cv_func_memmove'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1367 "configure"
-#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char memmove(); below. */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char memmove();
-
-int main() {
-
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined (__stub_memmove) || defined (__stub___memmove)
-choke me
-#else
-memmove();
-#endif
-
-; return 0; }
-EOF
-if { (eval echo configure:1390: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_memmove=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_memmove=no"
-fi
-rm -f conftest*
-fi
-
-if eval "test \"`echo '$ac_cv_func_'memmove`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- MEMMOVE_O=''
-else
- echo "$ac_t""no" 1>&6
-MEMMOVE_O=memmove.o
-fi
-
-
-
-# We need multilib support, but only if configuring for the target.
-trap '' 1 2 15
-cat > confcache <<\EOF
-# This file is a shell script that caches the results of configure
-# tests run on this system so they can be shared between configure
-# scripts and configure runs. It is not useful on other systems.
-# If it contains results you don't want to keep, you may remove or edit it.
-#
-# By default, configure uses ./config.cache as the cache file,
-# creating it if it does not exist already. You can give configure
-# the --cache-file=FILE option to use a different cache file; that is
-# what configure does when it calls configure scripts in
-# subdirectories, so they share the cache.
-# Giving --cache-file=/dev/null disables caching, for debugging configure.
-# config.status only pays attention to the cache file if you give it the
-# --recheck option to rerun configure.
-#
-EOF
-# The following way of writing the cache mishandles newlines in values,
-# but we know of no workaround that is simple, portable, and efficient.
-# So, don't put newlines in cache variables' values.
-# Ultrix sh set writes to stderr and can't be redirected directly,
-# and sets the high bit in the cache file unless we assign to the vars.
-(set) 2>&1 |
- case `(ac_space=' '; set | grep ac_space) 2>&1` in
- *ac_space=\ *)
- # `set' does not quote correctly, so add quotes (double-quote substitution
- # turns \\\\ into \\, and sed turns \\ into \).
- sed -n \
- -e "s/'/'\\\\''/g" \
- -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
- ;;
- *)
- # `set' quotes correctly as required by POSIX, so do not add quotes.
- sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
- ;;
- esac >> confcache
-if cmp -s $cache_file confcache; then
- :
-else
- if test -w $cache_file; then
- echo "updating cache $cache_file"
- cat confcache > $cache_file
- else
- echo "not updating unwritable cache $cache_file"
- fi
-fi
-rm -f confcache
-
-trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
-
-test "x$prefix" = xNONE && prefix=$ac_default_prefix
-# Let make expand exec_prefix.
-test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
-
-# Any assignment to VPATH causes Sun make to only execute
-# the first set of double-colon rules, so remove it if not needed.
-# If there is a colon in the path, we need to keep it.
-if test "x$srcdir" = x.; then
- ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d'
-fi
-
-trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
-
-# Transform confdefs.h into DEFS.
-# Protect against shell expansion while executing Makefile rules.
-# Protect against Makefile macro expansion.
-cat > conftest.defs <<\EOF
-s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g
-s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g
-s%\[%\\&%g
-s%\]%\\&%g
-s%\$%$$%g
-EOF
-DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '`
-rm -f conftest.defs
-
-
-# Without the "./", some shells look in PATH for config.status.
-: ${CONFIG_STATUS=./config.status}
-
-echo creating $CONFIG_STATUS
-rm -f $CONFIG_STATUS
-cat > $CONFIG_STATUS <<EOF
-#! /bin/sh
-# Generated automatically by configure.
-# Run this file to recreate the current configuration.
-# This directory was configured as follows,
-# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-#
-# $0 $ac_configure_args
-#
-# Compiler output produced by configure, useful for debugging
-# configure, is in ./config.log if it exists.
-
-ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
-for ac_option
-do
- case "\$ac_option" in
- -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
- echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
- exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
- -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
- echo "$CONFIG_STATUS generated by autoconf version 2.13"
- exit 0 ;;
- -help | --help | --hel | --he | --h)
- echo "\$ac_cs_usage"; exit 0 ;;
- *) echo "\$ac_cs_usage"; exit 1 ;;
- esac
-done
-
-ac_given_srcdir=$srcdir
-
-trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
-EOF
-cat >> $CONFIG_STATUS <<EOF
-
-# Protect against being on the right side of a sed subst in config.status.
-sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
- s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
-$ac_vpsub
-$extrasub
-s%@SHELL@%$SHELL%g
-s%@CFLAGS@%$CFLAGS%g
-s%@CPPFLAGS@%$CPPFLAGS%g
-s%@CXXFLAGS@%$CXXFLAGS%g
-s%@FFLAGS@%$FFLAGS%g
-s%@DEFS@%$DEFS%g
-s%@LDFLAGS@%$LDFLAGS%g
-s%@LIBS@%$LIBS%g
-s%@exec_prefix@%$exec_prefix%g
-s%@prefix@%$prefix%g
-s%@program_transform_name@%$program_transform_name%g
-s%@bindir@%$bindir%g
-s%@sbindir@%$sbindir%g
-s%@libexecdir@%$libexecdir%g
-s%@datadir@%$datadir%g
-s%@sysconfdir@%$sysconfdir%g
-s%@sharedstatedir@%$sharedstatedir%g
-s%@localstatedir@%$localstatedir%g
-s%@libdir@%$libdir%g
-s%@includedir@%$includedir%g
-s%@oldincludedir@%$oldincludedir%g
-s%@infodir@%$infodir%g
-s%@mandir@%$mandir%g
-s%@CC@%$CC%g
-s%@AR@%$AR%g
-s%@RANLIB@%$RANLIB%g
-s%@SET_MAKE@%$SET_MAKE%g
-s%@CPP@%$CPP%g
-s%@MEMMOVE_O@%$MEMMOVE_O%g
-
-CEOF
-EOF
-
-cat >> $CONFIG_STATUS <<\EOF
-
-# Split the substitutions into bite-sized pieces for seds with
-# small command number limits, like on Digital OSF/1 and HP-UX.
-ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
-ac_file=1 # Number of current file.
-ac_beg=1 # First line for current file.
-ac_end=$ac_max_sed_cmds # Line after last line for current file.
-ac_more_lines=:
-ac_sed_cmds=""
-while $ac_more_lines; do
- if test $ac_beg -gt 1; then
- sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
- else
- sed "${ac_end}q" conftest.subs > conftest.s$ac_file
- fi
- if test ! -s conftest.s$ac_file; then
- ac_more_lines=false
- rm -f conftest.s$ac_file
- else
- if test -z "$ac_sed_cmds"; then
- ac_sed_cmds="sed -f conftest.s$ac_file"
- else
- ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
- fi
- ac_file=`expr $ac_file + 1`
- ac_beg=$ac_end
- ac_end=`expr $ac_end + $ac_max_sed_cmds`
- fi
-done
-if test -z "$ac_sed_cmds"; then
- ac_sed_cmds=cat
-fi
-EOF
-
-cat >> $CONFIG_STATUS <<EOF
-
-CONFIG_FILES=\${CONFIG_FILES-"Makefile"}
-EOF
-cat >> $CONFIG_STATUS <<\EOF
-for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
- # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
- case "$ac_file" in
- *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
- ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
- *) ac_file_in="${ac_file}.in" ;;
- esac
-
- # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
-
- # Remove last slash and all that follows it. Not all systems have dirname.
- ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
- if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
- # The file is in a subdirectory.
- test ! -d "$ac_dir" && mkdir "$ac_dir"
- ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
- # A "../" for each directory in $ac_dir_suffix.
- ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
- else
- ac_dir_suffix= ac_dots=
- fi
-
- case "$ac_given_srcdir" in
- .) srcdir=.
- if test -z "$ac_dots"; then top_srcdir=.
- else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
- /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
- *) # Relative path.
- srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
- top_srcdir="$ac_dots$ac_given_srcdir" ;;
- esac
-
-
- echo creating "$ac_file"
- rm -f "$ac_file"
- configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
- case "$ac_file" in
- *Makefile*) ac_comsub="1i\\
-# $configure_input" ;;
- *) ac_comsub= ;;
- esac
-
- ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
- sed -e "$ac_comsub
-s%@configure_input@%$configure_input%g
-s%@srcdir@%$srcdir%g
-s%@top_srcdir@%$top_srcdir%g
-" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
-fi; done
-rm -f conftest.s*
-
-EOF
-cat >> $CONFIG_STATUS <<EOF
-srcdir=${srcdir}
-host=${host}
-target=${target}
-with_target_subdir=${with_target_subdir}
-with_multisubdir=${with_multisubdir}
-ac_configure_args="--enable-multilib ${ac_configure_args}"
-CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-topsrcdir=${topsrcdir}
-
-EOF
-cat >> $CONFIG_STATUS <<\EOF
-test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h
-if test -n "$CONFIG_FILES"; then
- if test -n "${with_target_subdir}"; then
- # FIXME: We shouldn't need to set ac_file
- ac_file=Makefile
- . ${topsrcdir}/config-ml.in
- fi
-fi
-exit 0
-EOF
-chmod +x $CONFIG_STATUS
-rm -fr confdefs* $ac_clean_files
-test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
-
-
-
-
diff --git a/libchill/configure.in b/libchill/configure.in
deleted file mode 100644
index cd08ba1f776..00000000000
--- a/libchill/configure.in
+++ /dev/null
@@ -1,162 +0,0 @@
-# Process this file with autoconf to produce a configure script.
-# Copyright (C) 1995, 1997, 1998, 1999 Free Software Foundation, Inc.
-# Contributed by Dave Love (d.love@dl.ac.uk).
-#
-#This file is part of GNU CC.
-#
-#GNU CHILL 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 CHILL 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 CHILL; see the file COPYING. If not, write to
-#the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-#02111-1307, USA.
-
-AC_PREREQ(2.13)
-AC_INIT(chillrt0.c)
-
-if test "${srcdir}" = "." ; then
- if test "${with_target_subdir}" != "." ; then
- topsrcdir=${with_multisrctop}../..
- else
- topsrcdir=${with_multisrctop}..
- fi
-else
- topsrcdir=${srcdir}/..
-fi
-dnl This is needed for a multilibbed build in the source tree so
-dnl that install-sh and config.sub get found.
-AC_CONFIG_AUX_DIR($topsrcdir)
-
-# If the language specific compiler does not exist, but the "gcc" directory
-# does, we do not build anything. Note, $r is set by the top-level Makefile.
-# Note that when we look for the compiler, we search both with and without
-# extension to handle cross and canadian cross builds.
-compiler_name=cc1chill
-rm -f skip-this-dir
-AC_MSG_CHECKING(if compiler $compiler_name has been built)
-AC_CACHE_VAL(chill_cv_compiler_exists,
-[chill_cv_compiler_exists=yes
-if test -n "$r"; then
- if test -d "$r"/gcc; then
- if test -f "$r"/gcc/$compiler_name \
- || test -f "$r"/gcc/$compiler_name.exe; then
- true
- else
- chill_cv_compiler_exists=no
- echo "rm -f config.cache config.log multilib.out" > skip-this-dir
- fi
- fi
-fi
-])
-AC_MSG_RESULT($chill_cv_compiler_exists)
-if test x$chill_cv_compiler_exists = xno
-then
- rm -f Makefile conftest* confdefs* core
- exit 0
-fi
-
-dnl Checks for programs.
-# For chill we'll set CC to point at the built gcc, but this will get it into
-# the makefiles
-AC_PROG_CC
-
-test "$AR" || AR=ar
-AC_SUBST(AR)
-if test "$RANLIB"; then :
- AC_SUBST(RANLIB)
-else
- AC_PROG_RANLIB
-fi
-AC_PROG_MAKE_SET
-
-dnl Checks for libraries.
-
-dnl Checks for header files.
-# Sanity check for the cross-compilation case:
-AC_CHECK_HEADER(stdio.h,:,
- [AC_MSG_ERROR([Can't find stdio.h.
-You must have a usable C system for the target already installed, at least
-including headers and, preferably, the library, before you can configure
-the Chill runtime system. If necessary, install gcc now with \`LANGUAGES=c',
-then the target library, then build with \`LANGUAGES=chill'.])])
-
-AC_HEADER_STDC
-
-AC_MSG_CHECKING(for posix)
-AC_CACHE_VAL(chill_cv_header_posix,
- AC_EGREP_CPP(yes,
- [#include <sys/types.h>
-#include <unistd.h>
-#ifdef _POSIX_VERSION
- yes
-#endif
-],
- chill_cv_header_posix=yes,
- chill_cv_header_posix=no))
-AC_MSG_RESULT($chill_cv_header_posix)
-
-# We can rely on the GNU library being posix-ish. I guess checking the
-# header isn't actually like checking the functions, though...
-AC_MSG_CHECKING(for GNU library)
-AC_CACHE_VAL(chill_cv_lib_gnu,
- AC_EGREP_CPP(yes,
- [#include <stdio.h>
-#ifdef __GNU_LIBRARY__
- yes
-#endif
-],
- chill_cv_lib_gnu=yes, chill_cv_lib_gnu=no))
-AC_MSG_RESULT($chill_cv_lib_gnu)
-
-dnl Checks for library functions.
-AC_TYPE_SIGNAL
-# we'll get atexit by default
-if test $ac_cv_header_stdc != yes; then
-AC_CHECK_FUNC(atexit,
- AC_DEFINE(onexit,atexit),dnl just in case
- [AC_DEFINE(NO_ONEXIT)
- AC_CHECK_FUNC(onexit,,
- [AC_CHECK_FUNC(on_exit,
- AC_DEFINE(onexit,on_exit),)])])
-else true
-fi
-AC_CHECK_FUNC(memmove,
- MEMMOVE_O='',
- MEMMOVE_O=memmove.o)
-AC_SUBST(MEMMOVE_O)
-
-# We need multilib support, but only if configuring for the target.
-AC_OUTPUT(Makefile,
-[test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h
-if test -n "$CONFIG_FILES"; then
- if test -n "${with_target_subdir}"; then
- # FIXME: We shouldn't need to set ac_file
- ac_file=Makefile
- . ${topsrcdir}/config-ml.in
- fi
-fi],
-srcdir=${srcdir}
-host=${host}
-target=${target}
-with_target_subdir=${with_target_subdir}
-with_multisubdir=${with_multisubdir}
-ac_configure_args="--enable-multilib ${ac_configure_args}"
-CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-topsrcdir=${topsrcdir}
-)
-
-
-
-dnl Local Variables:
-dnl comment-start: "dnl "
-dnl comment-end: ""
-dnl comment-start-skip: "\\bdnl\\b\\s *"
-dnl End:
diff --git a/libchill/continue.c b/libchill/continue.c
deleted file mode 100644
index f2048f17ae7..00000000000
--- a/libchill/continue.c
+++ /dev/null
@@ -1,91 +0,0 @@
-/* Implement tasking-related runtime actions for CHILL.
- Copyright (C) 1992,1993 Free Software Foundation, Inc.
- Author: Wilfried Moser
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with other files,
- some of which are compiled with GCC, to produce an executable,
- this library 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. */
-
-#include "rtltypes.h"
-#include "rts.h"
-
-/*
- * function __continue
- *
- * parameters:
- * evaddr pointer to Eventlocation
- * filename source file name where function gets called
- * lineno linenumber in source file
- *
- * returns:
- * void
- *
- * exceptions:
- * none
- *
- * abstract:
- * implement the CHILL CONTINUE action.
- */
-
-void
-__continue (evaddr, filename, lineno)
- Event_Queue **evaddr;
- char *filename;
- int lineno;
-{
- Event_Queue *ev = *evaddr;
- Event_Queue *wrk;
-
- if (ev == 0)
- /* nothing to do */
- return;
-
- /* search for 1st one is not already continued */
- while (ev && ev->is_continued)
- ev = ev->forward;
- if (!ev)
- /* all have been continued in that queue, do nothing */
- return;
-
- wrk = ev->startlist;
- while (wrk)
- {
- Event_Queue *tmp = (Event_Queue *)wrk->listhead;
-
- while (tmp->forward != wrk)
- tmp = tmp->forward;
- tmp->forward = wrk->forward;
- wrk = wrk->chain;
- }
-
- /* so far so good, continue this one */
- ev->is_continued = 1;
- ev->who_continued = THIS;
-
- /* tell the runtime system to activate the process */
- __continue_that (ev->this, ev->priority, filename, lineno);
-}
-
-/* force function print_event to be linked */
-extern void __print_event ();
-static EntryPoint pev = __print_event;
diff --git a/libchill/convdurrtstime.c b/libchill/convdurrtstime.c
deleted file mode 100644
index 5a1d3380168..00000000000
--- a/libchill/convdurrtstime.c
+++ /dev/null
@@ -1,60 +0,0 @@
-/* Implement timing-related runtime actions for CHILL.
- Copyright (C) 1992,1993 Free Software Foundation, Inc.
- Author: Wilfried Moser
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with other files,
- some of which are compiled with GCC, to produce an executable,
- this library 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. */
-
-#include "rts.h"
-
-/*
- * function __convert_duration_rtstime
- *
- * parameters:
- * dur the duration value
- * t pointer to the duration value converted to RtsTime
- *
- * returns:
- * void
- *
- * exceptions:
- * none
- *
- * abstract:
- * converts a duration value (unsigned long in millisecs) to RtsTime
- * format.
- *
- */
-
-void
-__convert_duration_rtstime (dur, t)
- unsigned long dur;
- RtsTime *t;
-{
- unsigned long tmp;
-
- t->secs = dur / 1000;
- tmp = dur - (t->secs * 1000);
- t->nanosecs = tmp * 1000000;
-}
diff --git a/libchill/copyps.c b/libchill/copyps.c
deleted file mode 100644
index 6b7a4a19356..00000000000
--- a/libchill/copyps.c
+++ /dev/null
@@ -1,118 +0,0 @@
-/* Implement POWERSET runtime actions for CHILL.
- Copyright (C) 1992,1993 Free Software Foundation, Inc.
- Author: Wilfried Moser, et al
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with other files,
- some of which are compiled with GCC, to produce an executable,
- this library 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. */
-
-#define __CHILL_LIB__
-
-#include <stdio.h>
-#include "powerset.h"
-
-/*
- * function __powerset_copy
- * This is more general than __psslice, since it
- * can be told where in the destination powerset (DOFFSET
- * parameter) to start storing the slice.
- *
- * parameters:
- * dps dest powerset
- * dbl destination bit length
- * doffset offset bit number (zero origin)
- * sps sourcepowerset
- * sbl source powerset length in bits
- * start starting bit number
- * end ending bit number
- *
- * exceptions:
- * none
- *
- * abstract:
- * Extract into a powerset a slice of another powerset.
- *
- */
-void
-__pscpy (dps, dbl, doffset, sps, sbl, start, length)
- SET_WORD *dps;
- unsigned long dbl;
- unsigned long doffset;
- const SET_WORD*sps;
- unsigned long sbl;
- unsigned long start;
- unsigned long length;
-{
- unsigned long end = start + length - 1;
- unsigned long src, dst;
-
- /* assert end >= start;
- assert end - start + 1 <= dbl;
- assert "the sets don't overlap in memory" */
-
- /* assert doffset >= 0 and < dbl */
-
- for (src = start, dst = doffset; src <= end; src++, dst++)
- {
- char tmp;
-
- if (sbl <= SET_CHAR_SIZE) /* fetch a bit */
- tmp = GET_BIT_IN_CHAR (*((SET_CHAR *)sps), src);
- else if (sbl <= SET_SHORT_SIZE)
- tmp = GET_BIT_IN_SHORT (*((SET_SHORT *)sps), src);
- else
- tmp = GET_BIT_IN_WORD (sps[src / SET_WORD_SIZE], src % SET_WORD_SIZE);
-
- if (tmp & 1)
- {
- if (dbl <= SET_CHAR_SIZE) /* store a 1-bit */
- SET_BIT_IN_CHAR (*((SET_CHAR *)dps), dst);
- else if (dbl <= SET_SHORT_SIZE)
- SET_BIT_IN_SHORT (*((SET_SHORT *)dps), dst);
- else
- SET_BIT_IN_WORD (dps[dst / SET_WORD_SIZE], dst % SET_WORD_SIZE);
- }
- else
- {
- if (dbl <= SET_CHAR_SIZE) /* store a 0-bit */
- CLEAR_BIT_IN_CHAR (*((SET_CHAR *)dps), dst);
- else if (dbl <= SET_SHORT_SIZE)
- CLEAR_BIT_IN_SHORT (*((SET_SHORT *)dps), dst);
- else
- CLEAR_BIT_IN_WORD (dps[dst / SET_WORD_SIZE], dst % SET_WORD_SIZE);
- }
- }
- if (dbl <= SET_CHAR_SIZE) /* clear unused bits in output bitstring */
- {
- MASK_UNUSED_CHAR_BITS ((SET_CHAR *)dps, dbl);
- }
- else if (dbl <= SET_SHORT_SIZE)
- {
- MASK_UNUSED_SHORT_BITS ((SET_SHORT *)dps, dbl);
- }
- else
- {
- MASK_UNUSED_WORD_BITS ((SET_WORD *)(dps + (dbl/SET_WORD_SIZE)),
- dbl % SET_WORD_SIZE);
- }
-}
diff --git a/libchill/delaycase.c b/libchill/delaycase.c
deleted file mode 100644
index 3c2a3c7777a..00000000000
--- a/libchill/delaycase.c
+++ /dev/null
@@ -1,229 +0,0 @@
-/* Implement tasking-related runtime actions for CHILL.
- Copyright (C) 1992,1993 Free Software Foundation, Inc.
- Author: Wilfried Moser
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with other files,
- some of which are compiled with GCC, to produce an executable,
- this library 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. */
-
-#include <string.h>
-#include "rtltypes.h"
-#include "rts.h"
-
-extern void __cause_ex1 (char *ex, char *file, int lineno);
-
-EXCEPTION (delayfail);
-#define CAUSE_DELAYFAIL __cause_ex1 ("delayfail", filename, lineno)
-
-EXCEPTION (notyetimplemented);
-#define CAUSE_NOTIMPLEMENTED __cause_ex1 ("notyetimplemeyed", filename, lineno)
-
-/*
- * function __delay_event
- *
- * parameters:
- * ev_got pointer to location where to write the event got.
- * nevents number of events in list
- * evptrs array of event descriptors
- * priority specified priority
- * insloc pointer to resulting instance location
- * to timeout value
- * filename filename of caller
- * lineno linenumber of caller
- *
- * returns:
- * int 0 .. success
- * 1 .. timed out
- *
- * exceptions:
- * delayfail
- *
- * abstract:
- * implement the CHILL DELAY and DELAY CASE actions.
- *
- */
-
-int
-__delay_event (ev_got, nevents, evptrs, priority, to, insloc, filename, lineno)
- void **ev_got;
- int nevents;
- Event_Descr *evptrs;
- int priority;
- void *to;
- INSTANCE *insloc;
- char *filename;
- int lineno;
-{
- int i, already_done = 0;
- Event_Queue *start_list = 0;
- Event_Queue **retval = 0;
- Event_Queue *wrk;
- int timed_out = 0;
-
- /* check if all specified event queues have enough space left
- to perform the delay */
- for (i = 0; i < nevents; i++)
- {
- Event_Queue *e;
- unsigned long cnt = 0;
- int j, have_done = 0;
-
- if (evptrs[i].maxqueuelength == 0)
- CAUSE_DELAYFAIL;
- else if (evptrs[i].maxqueuelength == (unsigned long)-1L)
- /* infinite length */
- continue;
-
- /* check if we already have processed this one, that means, this
- event is mentioned more then once */
- for (j = 0; j < i; j++)
- {
- if (evptrs[i].ev == evptrs[j].ev)
- {
- have_done = 1;
- break;
- }
- }
- if (have_done)
- continue;
-
- memcpy (&e, evptrs[i].ev, sizeof (Event_Queue *));
- while (e)
- {
- cnt++;
- e = e->forward;
- }
- if (cnt >= evptrs[i].maxqueuelength)
- CAUSE_DELAYFAIL;
- }
-
- for (i = 0; i < nevents; i++)
- {
- /* queue that stuff on each event */
- Event_Queue *wrk;
- Event_Queue *ev;
- Event_Queue *prev_queue_entry = 0;
- Event_Queue *prev_list_entry;
- int j, have_done = 0;
-
- /* check for this event already processed */
- for (j = 0; j < i; j++)
- {
- if (evptrs[i].ev == evptrs[j].ev)
- {
- have_done = 1;
- break;
- }
- }
- if (have_done)
- continue;
-
- memcpy (&ev, &evptrs[i].ev, sizeof (Event_Queue *));
- MALLOC (wrk, sizeof (Event_Queue));
- memset (wrk, 0, sizeof (Event_Queue));
-
- wrk->priority = priority;
- wrk->this = THIS;
- wrk->listhead = evptrs[i].ev;
-
- /* search for the place to queue this entry in */
- while (ev->forward != 0 && ev->priority >= priority)
- {
- prev_queue_entry = ev;
- ev = ev->forward;
- }
-
- /* ready to put entry into queue */
- if (ev->forward == 0 || prev_queue_entry == 0)
- {
- /* beginning or end of the list */
- wrk->forward = ev->forward;
- ev->forward = wrk;
- }
- else
- {
- /* this is somewhere in the middle */
- wrk->forward = prev_queue_entry->forward;
- prev_queue_entry->forward = wrk;
- }
-
- /* queue it into list */
- wrk->startlist = start_list;
- if (! start_list)
- {
- /* we are the first in the list */
- start_list = wrk;
- prev_list_entry = wrk;
- wrk->startlist = start_list;
- }
- else
- {
- prev_list_entry->chain = wrk;
- prev_list_entry = wrk;
- }
- }
-
- /* tell runtime system to delay that process */
- timed_out = __delay_this (wait_event_delay, to, filename, lineno);
- if (timed_out)
- {
- /* we have to remove the entries from the queue's */
- wrk = start_list;
- while (wrk)
- {
- Event_Queue *tmp = (Event_Queue *)wrk->listhead;
-
- while (tmp->forward != wrk)
- tmp = tmp->forward;
- tmp->forward = wrk->forward;
- wrk = wrk->chain;
- }
- }
-
- wrk = start_list;
- while (wrk)
- {
- Event_Queue *tmp;
-
- if (wrk->is_continued && ! already_done)
- {
- already_done = 1;
- retval = wrk->listhead;
- if (insloc && !timed_out)
- {
- insloc->ptype = wrk->who_continued.ptype;
- insloc->pcopy = wrk->who_continued.pcopy;
- }
- }
- tmp = wrk->chain;
- FREE (wrk);
- wrk = tmp;
- }
- if (!timed_out && ev_got)
- *ev_got = (void *)retval;
- return timed_out;
-}
-
-/* force function print_event to be linked */
-extern void __print_event ();
-static EntryPoint pev = __print_event;
diff --git a/libchill/delete.c b/libchill/delete.c
deleted file mode 100644
index eca04dd4e8f..00000000000
--- a/libchill/delete.c
+++ /dev/null
@@ -1,50 +0,0 @@
-/* Implement Input/Output runtime actions for CHILL.
- Copyright (C) 1992,1993 Free Software Foundation, Inc.
- Author: Wilfried Moser, et al
-
- This file is part of GNU CC.
-
- GNU CC is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- GNU CC is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with GNU CC; see the file COPYING. If not, write to
- the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with other files,
- some of which are compiled with GCC, to produce an executable,
- this library 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. */
-
-#include <unistd.h>
-
-#include "fileio.h"
-
-void __delete( Association_Mode* the_assoc, char* file, int line )
-{
- if( !the_assoc )
- CHILLEXCEPTION( file, line, EMPTY, NULL_ASSOCIATION );
-
- if( !TEST_FLAG( the_assoc, IO_ISASSOCIATED ) )
- CHILLEXCEPTION( file, line, NOTASSOCIATED, IS_NOT_ASSOCIATED );
-
- /* forced dissociate */
- if( the_assoc->access )
- __disconnect( the_assoc->access, file, line );
-
- /* delete */
- if( unlink( the_assoc->pathname ) )
- CHILLEXCEPTION( file, line, DELETEFAIL, DELETE_FAILS );
-
- CLR_FLAG( the_assoc, IO_EXISTING );
-}
diff --git a/libchill/diffps.c b/libchill/diffps.c
deleted file mode 100644
index 67027abd847..00000000000
--- a/libchill/diffps.c
+++ /dev/null
@@ -1,81 +0,0 @@
-/* Implement POWERSET runtime actions for CHILL.
- Copyright (C) 1992,1993 Free Software Foundation, Inc.
- Author: Wilfried Moser, et al
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with other files,
- some of which are compiled with GCC, to produce an executable,
- this library 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. */
-
-#define __CHILL_LIB__
-
-#include <stdio.h>
-#include "powerset.h"
-
-/*
- * function __diffpowerset
- *
- * parameters:
- * out result of __diffpowerset
- * left powerset
- * right powerset
- * bitlength length of powerset
- *
- * returns:
- * void
- *
- * exceptions:
- * none
- *
- * abstract:
- * makes a difference of 2 powersets (out = left - right)
- *
- */
-void
-__diffpowerset (out, left, right, bitlength)
- SET_WORD *out;
- SET_WORD *left;
- SET_WORD *right;
- unsigned long bitlength;
-{
- if (bitlength <= SET_CHAR_SIZE)
- {
- *((SET_CHAR *)out) = *((SET_CHAR *)left) & ~
- *((SET_CHAR *)right);
- MASK_UNUSED_CHAR_BITS ((SET_CHAR *)out, bitlength);
- }
- else if (bitlength <= SET_SHORT_SIZE)
- {
- *((SET_SHORT *)out) = *((SET_SHORT *)left) & ~
- *((SET_SHORT *)right);
- MASK_UNUSED_SHORT_BITS ((SET_SHORT *)out, bitlength);
- }
- else
- {
- unsigned long len = BITS_TO_WORDS(bitlength);
- register unsigned long i;
-
- for (i = 0; i < len; i++)
- out[i] = left[i] & ~right[i];
- MASK_UNUSED_WORD_BITS ((out + len - 1), bitlength % SET_WORD_SIZE);
- }
-}
diff --git a/libchill/eoln.c b/libchill/eoln.c
deleted file mode 100644
index 6c881bb74ed..00000000000
--- a/libchill/eoln.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/* Implement Input/Output runtime actions for CHILL.
- Copyright (C) 1992,1993 Free Software Foundation, Inc.
- Author: Wilfried Moser, et al
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with other files,
- some of which are compiled with GCC, to produce an executable,
- this library 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. */
-
-#include "fileio.h"
-
-Boolean
-__eoln( Text_Mode* the_text, char* file, int line )
-{
- if( !the_text )
- CHILLEXCEPTION( file, line, EMPTY, NULL_TEXT );
-
- return the_text->actual_index == the_text->access_sub->reclength - 2;
-}
diff --git a/libchill/eqps.c b/libchill/eqps.c
deleted file mode 100644
index e0e00db3cc2..00000000000
--- a/libchill/eqps.c
+++ /dev/null
@@ -1,74 +0,0 @@
-/* Implement POWERSET runtime actions for CHILL.
- Copyright (C) 1992,1993 Free Software Foundation, Inc.
- Author: Wilfried Moser, et al
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with other files,
- some of which are compiled with GCC, to produce an executable,
- this library 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. */
-
-#define __CHILL_LIB__
-
-#include <stdio.h>
-#include "powerset.h"
-
-/*
- * function __eqpowerset
- *
- * parameters:
- * left left powerset
- * right right powerset
- * bitlength length of powerset in bits
- *
- * returns:
- * 1 if powersets are equal, bit for bit
- *
- * exceptions:
- * none
- *
- * abstract:
- * compares two powersets for equality
- *
- */
-int
-__eqpowerset (left, right, bitlength)
- SET_WORD *left;
- SET_WORD *right;
- unsigned long bitlength;
-{
- {
- SET_WORD c;
- register unsigned long i;
- unsigned long len = bitlength / SET_WORD_SIZE;
-
- for (i = 0; i < len; i++) /* a word-oriented memcmp */
- if (left[i] != right[i])
- return 0;
- /* do the last (possibly partial) word */
- bitlength %= SET_WORD_SIZE;
- if (bitlength == 0)
- return 1;
- c = left[i] ^ right[i];
- MASK_UNUSED_WORD_BITS (&c, bitlength);
- return (c == 0) ? 1 : 0;
- }
-}
diff --git a/libchill/eqstr.c b/libchill/eqstr.c
deleted file mode 100644
index 9261572a1f0..00000000000
--- a/libchill/eqstr.c
+++ /dev/null
@@ -1,64 +0,0 @@
-/* Implement string-related runtime actions for CHILL.
- Copyright (C) 1992,1993 Free Software Foundation, Inc.
- Author: Bill Cox
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with other files,
- some of which are compiled with GCC, to produce an executable,
- this library 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. */
-
-#include <string.h>
-
-extern void cause_exception (char *exname, char *file, int lineno);
-
-/*
- * function __eqstring
- *
- * parameters:
- * S1 - pointer to left string
- * LEN1 - length of left string
- * S2 - pointer to right string
- * LEN2 - length of right string
- *
- * returns:
- * 1 if strings equal, 0 if not
- *
- * exceptions:
- * none
- *
- * abstract:
- * compares two character strings for equality
- *
- */
-
-int
-__eqstring (s1, len1, s2, len2)
- char *s1;
- int len1;
- char *s2;
- int len2;
-{
- if (len1 != len2)
- return 0;
-
- return ! memcmp (s1, s2, len1);
-}
diff --git a/libchill/exh.c b/libchill/exh.c
deleted file mode 100644
index 8845d4336d5..00000000000
--- a/libchill/exh.c
+++ /dev/null
@@ -1,162 +0,0 @@
-/* Implement runtime actions for CHILL.
- Copyright (C) 1992,1993 Free Software Foundation, Inc.
- Author: Wilfried Moser
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with other files,
- some of which are compiled with GCC, to produce an executable,
- this library 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. */
-
-
-#define __CHILL_LIB__
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <setjmp.h>
-#include "rtltypes.h"
-
-extern void cause_exception (char *exname, char *file, int lineno, int user_arg);
-extern void unhandled_exception (char *exname, char *file, int lineno, int user_arg);
-
-/* An action with a handler:
- BODY ON (e1, e2): H12; (e3): H3; ELSE HE; END;
- is translated into:
-
- struct __ch_handler __tmp;
- static struct __ch_handler_excepts _H[4] =
- {
- { <<e1>>, 1 },
- { <<e2>>, 1 },
- { <<e3>>, 2 },
- { __ch_else_except, 3 },
- };
- __ch_link_handler(&__tmp);
- __tmp.handlers = _H;
- switch (setmp(&__tmp.jbuf))
- {
- case 0: BODY; __ch_unlink_handler(&__tmp); break;
- case 1: H12; break;
- case 2: H3; break;
- case 3: HE; break;
- }
-*/
-
-/* this part contains all neccessary functions to handle exceptions in CHILL */
-
-/* These two trivial function aren't inlines, to allow for
- more flexibility (e.g. a per-thread exception stack). */
-
-extern void __setexceptionStack (TExceptionHandlerStack *new);
-extern TExceptionHandlerStack * __getexceptionStack (void);
-
-void
-__ch_link_handler (handler)
- struct __ch_handler *handler;
-{
- handler->prev = __getexceptionStack ();
- __setexceptionStack (handler);
-}
-
- void
-__ch_unlink_handler (handler)
- struct __ch_handler *handler;
-{
- __setexceptionStack (handler->prev);
-}
-
-/*
- * function __cause_exception
- *
- * parameters:
- * exnum name string of exception to raise
- * file filename of CAUSE statement
- * lineno linenumber of CAUSE statement
- * user_arg user specified argument
- *
- * returns:
- * never leave function with longjmp or abort
- *
- * abstract:
- * search exceptionstack for last handler of caused exception,
- * call userdefined function to signal exception,
- * jump to handler with longjmp or call unhandled_exception
- *
- */
-
-void
-__cause_exception (ex, file, lineno, user_arg)
- char *ex;
- char *file;
- int lineno;
- int user_arg;
-{
- register struct __ch_handler *handler = __getexceptionStack();
-
- /* call user defined cause function */
- cause_exception (ex, file, lineno, user_arg);
-
- for ( ; handler != NULL; handler = handler->prev)
- {
- register struct __ch_handled_excepts *list = handler->handlers;
- for ( ; list->code != 0; list++ )
- {
- if (list->ex == __ch_else_except || EX_EQ(list->ex, ex)) /* found */
- {
- __setexceptionStack (handler->prev);
- longjmp(handler->jbuf, list->code);
- }
- }
- }
-
- /* no handler found -- call unhandled_exception */
- unhandled_exception (ex, file, lineno, user_arg);
- abort ();
-}
-
-/*
- * function __cause_ex1
- *
- * parameters:
- * exnum name string of exception to raise
- * file filename of CAUSE statement
- * lineno linenumber of CAUSE statement
- *
- * returns:
- * never leave function with longjmp or abort
- *
- * abstract:
- * This is the function the compiler generated code calls.
- * Search exceptionstack for last handler of caused exception,
- * call userdefined function to signal exception,
- * jump to handler with longjmp or call unhandled_exception
- *
- */
-
-void
-__cause_ex1 (ex, file, lineno)
- char *ex;
- char *file;
- int lineno;
-{
- __cause_exception (ex, file, lineno, 0);
-}
diff --git a/libchill/exhstack.c b/libchill/exhstack.c
deleted file mode 100644
index fe8ad2905f8..00000000000
--- a/libchill/exhstack.c
+++ /dev/null
@@ -1,47 +0,0 @@
-/* Implement runtime actions for CHILL.
- Copyright (C) 1992,1993 Free Software Foundation, Inc.
- Author: Wilfried Moser
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with other files,
- some of which are compiled with GCC, to produce an executable,
- this library 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. */
-
-#define __CHILL_LIB__
-
-#include <setjmp.h>
-#include "rtltypes.h"
-
-typedef void (*init_ptr) ();
-typedef int * tasking_ptr;
-
-static TExceptionHandlerStack *__exceptionStack;
-
-TExceptionHandlerStack * __getexceptionStack ()
-{
- return __exceptionStack;
-}
-
-void __setexceptionStack (TExceptionHandlerStack *new)
-{
- __exceptionStack = new;
-}
diff --git a/libchill/existing.c b/libchill/existing.c
deleted file mode 100644
index 186b77ca36f..00000000000
--- a/libchill/existing.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/* Implement Input/Output runtime actions for CHILL.
- Copyright (C) 1992,1993 Free Software Foundation, Inc.
- Author: Wilfried Moser, et al
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with other files,
- some of which are compiled with GCC, to produce an executable,
- this library 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. */
-
-#include "fileio.h"
-
-Boolean
-__existing( Association_Mode* the_assoc, char* file, int line )
-{
- if( !the_assoc )
- CHILLEXCEPTION( file, line, EMPTY, NULL_ASSOCIATION );
- if( !TEST_FLAG(the_assoc, IO_ISASSOCIATED) )
- CHILLEXCEPTION( file, line, NOTASSOCIATED, IS_NOT_ASSOCIATED );
- return TEST_FLAG(the_assoc, IO_EXISTING ) ? True : False;
-}
diff --git a/libchill/ffsetclrps.c b/libchill/ffsetclrps.c
deleted file mode 100644
index a5c202c7b93..00000000000
--- a/libchill/ffsetclrps.c
+++ /dev/null
@@ -1,92 +0,0 @@
-/* Implement POWERSET runtime actions for CHILL.
- Copyright (C) 1992,1993 Free Software Foundation, Inc.
- Author: Wilfried Moser, et al
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with other files,
- some of which are compiled with GCC, to produce an executable,
- this library 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. */
-
-#define __CHILL_LIB__
-
-#include <stdio.h>
-#include "powerset.h"
-
-/*
- * function __ffsetclrpowerset
- *
- * parameters:
- * ps powerset
- * bitlength length of powerset
- *
- * returns:
- * int -1 .. nothing found
- * >=0 .. index of first true bit found
- * exceptions:
- * none
- */
-
-int
-__ffsetclrpowerset (ps, bitlength, first_bit)
- SET_WORD *ps;
- unsigned long bitlength;
- int first_bit;
-{
- register int bitno;
-
- if (first_bit >= bitlength)
- return -1;
-
- {
- unsigned int words_to_skip = (unsigned) first_bit / SET_WORD_SIZE;
- unsigned long cnt = words_to_skip * SET_WORD_SIZE;
- SET_WORD *p = ps + words_to_skip;
- SET_WORD *endp = ps + BITS_TO_WORDS(bitlength);
- SET_WORD c;
- first_bit = (unsigned) first_bit % (unsigned) SET_WORD_SIZE;
-
- c = *p++;
- if (c)
- {
- for (bitno = first_bit; bitno < SET_WORD_SIZE; bitno++)
- if (GET_BIT_IN_WORD(c, bitno))
- goto found;
- }
- cnt += SET_WORD_SIZE;
-
- while (p < endp)
- {
- if ((c = *p++))
- {
- /* found a bit set .. calculate which */
- for (bitno = 0; bitno < SET_WORD_SIZE; bitno++)
- if (GET_BIT_IN_WORD(c, bitno))
- goto found;
- }
- cnt += SET_WORD_SIZE;
- }
- return -1;
- found:
- bitno += cnt;
- return bitno >= bitlength ? -1 : bitno;
- }
-}
diff --git a/libchill/ffsetps.c b/libchill/ffsetps.c
deleted file mode 100644
index e506db41a9d..00000000000
--- a/libchill/ffsetps.c
+++ /dev/null
@@ -1,116 +0,0 @@
-/* Implement POWERSET runtime actions for CHILL.
- Copyright (C) 1992,1993 Free Software Foundation, Inc.
- Author: Wilfried Moser, et al
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with other files,
- some of which are compiled with GCC, to produce an executable,
- this library 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. */
-
-#define __CHILL_LIB__
-
-#include <stdio.h>
-#include "powerset.h"
-
-extern void __cause_ex1 (char *exname, char *file, int lineno);
-
-/*
- * function __ffsetpowerset
- *
- * parameters:
- * ps powerset
- * bitlength length of powerset
- * minval set low bound
- * filename caller's file name
- * lineno caller's line number
- *
- * returns:
- * int enum value of lowest member of powerset
- *
- * exceptions:
- * "empty" if the set is empty
- *
- * abstract:
- * Find first bit set in a powerset and return the corresponding value.
- *
- */
-long
-__ffsetpowerset (ps, bitlength, minval, filename, lineno)
- SET_WORD *ps;
- unsigned long bitlength;
- long minval;
- char *filename;
- int lineno;
-{
- unsigned long bitno;
-
- if (bitlength <= SET_CHAR_SIZE)
- {
- SET_CHAR cset = *((SET_CHAR *)ps);
- if (cset != 0)
- {
- /* found a bit set .. calculate which */
- for (bitno = 0; bitno < SET_CHAR_SIZE; bitno++)
- if (GET_BIT_IN_CHAR (cset, bitno))
- break;
- /* return its index */
- return bitno + minval;
- }
- }
- else if (bitlength <= SET_SHORT_SIZE)
- {
- SET_SHORT sset = *((SET_SHORT *)ps);
- if (sset != 0)
- {
- /* found a bit set .. calculate which */
- for (bitno = 0; bitno < SET_SHORT_SIZE; bitno++)
- if (GET_BIT_IN_SHORT (sset, bitno))
- break;
- /* return its index */
- return bitno + minval;
- }
- }
- else /* set composed of array of one or more WORDs */
- {
- SET_WORD *p = ps;
- SET_WORD *endp = ps + BITS_TO_WORDS(bitlength);
- unsigned long cnt;
-
- /* FIXME: bitorder problems? */
- for (cnt = 0; p < endp; p++, cnt += SET_WORD_SIZE)
- {
- SET_WORD c = *p;
-
- if (c)
- {
- /* found a bit set .. calculate which */
- for (bitno = 0; bitno < SET_WORD_SIZE; bitno++)
- if (GET_BIT_IN_WORD (c, bitno))
- break;
- /* return its index */
- return cnt + bitno + minval;
- }
- }
- }
- /* no bits found - raise exception */
- __cause_ex1 ("empty", filename, lineno);
-}
diff --git a/libchill/fileio.h b/libchill/fileio.h
deleted file mode 100644
index 7d0c1d09901..00000000000
--- a/libchill/fileio.h
+++ /dev/null
@@ -1,161 +0,0 @@
-/* Implement Input/Output runtime actions for CHILL.
- Copyright (C) 1992,1993 Free Software Foundation, Inc.
- Author: Wilfried Moser, et al
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with other files,
- some of which are compiled with GCC, to produce an executable,
- this library 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. */
-
-#ifndef _fileio_h_
-#define _fileio_h_
-
-#include <stdio.h>
-
-#include "auxtypes.h"
-#include "ioerror.h"
-#include "iomodes.h"
-
-#define DIRSEP '/'
-
-#define TEST_FLAG(Xloc,Flag) (((Xloc)->flags) & (Flag))
-#define SET_FLAG(Xloc,Flag) (Xloc)->flags |= (Flag)
-#define CLR_FLAG(Xloc,Flag) (Xloc)->flags = ((Xloc)->flags & ~(Flag))
-
-Boolean
-__isassociated( Association_Mode* the_assoc, char* file, int line );
-
-Boolean
-__existing( Association_Mode* the_assoc, char* file, int line );
-
-Boolean
-__readable( Association_Mode* the_assoc, char* file, int line );
-
-Boolean
-__writeable( Association_Mode* the_assoc, char* file, int line );
-
-Boolean
-__indexable( Association_Mode* the_assoc, char* file, int line );
-
-Boolean
-__sequencible( Association_Mode* the_assoc, char* file, int line );
-
-Boolean
-__variable( Association_Mode* the_assoc, char* file, int line );
-
-typedef signed long int Index_t;
-
-Association_Mode*
-__associate( Association_Mode* the_assoc,
- char* the_path,
- int the_path_len,
- char* the_mode,
- int the_mode_len,
- char* file,
- int line );
-
-void
-__dissociate( Association_Mode* the_assoc, char* file, int line );
-
-void
-__create( Association_Mode* the_assoc, char* file, int line );
-
-void
-__delete( Association_Mode* the_assoc, char* file, int line );
-
-void
-__modify( Association_Mode* the_assoc,
- char* the_path,
- int the_path_len,
- char* the_mode,
- int the_mode_len,
- char* file,
- int line );
-
-void
-__connect( void* the_transfer,
- Association_Mode* the_assoc,
- Usage_Mode the_usage,
- Where_Mode the_where,
- Boolean with_index,
- signed long the_index,
- char* file,
- int line );
-
-void
-__disconnect( void* the_transfer, char* file, int line );
-
-Association_Mode*
-__getassociation( void* the_transfer, char* file, int line );
-
-Usage_Mode
-__getusage( void* the_transfer, char* file, int line );
-
-Boolean
-__outoffile( void* the_transfer, char* file, int line );
-
-void*
-__readrecord( Access_Mode* the_access,
- signed long the_index,
- char* the_buf_addr,
- char* file,
- int line );
-
-void
-__writerecord( Access_Mode* the_access,
- signed long the_index,
- char* the_val_addr,
- unsigned long the_val_len,
- char* file,
- int line );
-
-VarString*
-__gettextrecord( Text_Mode* the_text, char* file, int line );
-
-unsigned long
-__gettextindex( Text_Mode* the_text, char* file, int line );
-
-Access_Mode*
-__gettextaccess( Text_Mode* the_text, char* file, int line );
-
-Boolean
-__eoln( Text_Mode* the_text, char* file, int line );
-
-void
-__settextrecord( Text_Mode* the_text,
- VarString* the_text_rec,
- char* file,
- int line );
-
-void
-__settextindex( Text_Mode* the_text,
- signed long the_text_index,
- char* file,
- int line );
-
-void
-__settextaccess( Text_Mode* the_text,
- Access_Mode* the_access,
- char* file,
- int line );
-
-#endif
diff --git a/libchill/flsetclrps.c b/libchill/flsetclrps.c
deleted file mode 100644
index fe86c0c9abf..00000000000
--- a/libchill/flsetclrps.c
+++ /dev/null
@@ -1,89 +0,0 @@
-/* Implement POWERSET runtime actions for CHILL.
- Copyright (C) 1992,1993 Free Software Foundation, Inc.
- Author: Wilfried Moser, et al
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with other files,
- some of which are compiled with GCC, to produce an executable,
- this library 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. */
-
-#define __CHILL_LIB__
-
-#include <stdio.h>
-#include "powerset.h"
-
-/*
- * function __flsetclrpowerset
- *
- * parameters:
- * ps powerset
- * bitlength length of powerset
- *
- * returns:
- * int -1 .. nothing found
- * >= 0 .. index of last set bit
- * exceptions:
- * none
- *
- * abstract:
- * Find last bit set in a powerset and return the corresponding value
- * in *out and clear this bit. Return 0 for no more found, else 1.
- *
- */
-int
-__flsetclrpowerset (ps, bitlength, first_bit)
- SET_WORD *ps;
- unsigned long bitlength;
- int first_bit;
-{
- register int bitno;
-
- {
- SET_WORD *p, c;
- bitno = bitlength - 1;
- if (bitno < first_bit)
- return -1;
- p = &ps[(unsigned) bitno / SET_WORD_SIZE];
- c = *p;
- if (((unsigned) bitlength % SET_WORD_SIZE) != 0)
- MASK_UNUSED_WORD_BITS(&c, (unsigned) bitlength % SET_WORD_SIZE);
- if (c)
- goto found;
- else
- bitno -= ((unsigned) bitno % SET_WORD_SIZE) + 1;
- while (bitno >= first_bit)
- {
- c = *--p;
- if (c)
- goto found;
- bitno -= SET_WORD_SIZE;
- }
- return -1;
- found:
- for (; bitno >= first_bit; bitno--)
- {
- if (GET_BIT_IN_WORD (c, (unsigned) bitno % SET_WORD_SIZE))
- return bitno;
- }
- return -1;
- }
-}
diff --git a/libchill/flsetps.c b/libchill/flsetps.c
deleted file mode 100644
index 95a0b3bad68..00000000000
--- a/libchill/flsetps.c
+++ /dev/null
@@ -1,114 +0,0 @@
-/* Implement POWERSET runtime actions for CHILL.
- Copyright (C) 1992,1993 Free Software Foundation, Inc.
- Author: Wilfried Moser, et al
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with other files,
- some of which are compiled with GCC, to produce an executable,
- this library 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. */
-
-#define __CHILL_LIB__
-
-#include <stdio.h>
-#include "powerset.h"
-
-extern void __cause_ex1 (char *exname, char *file, int lineno);
-
-/*
- * function __flsetpowerset
- *
- * parameters:
- * ps powerset
- * bitlength length of powerset
- * minval set low bound
- * filename caller's file name
- * lineno caller's line number
- *
- * returns:
- * int largest enumeration value
- * exceptions:
- * "empty" if set is empty
- *
- * abstract:
- * Find last bit set in a powerset and return the corresponding value.
- *
- */
-long
-__flsetpowerset (ps, bitlength, minval, filename, lineno)
- SET_WORD *ps;
- unsigned long bitlength;
- long minval;
- char *filename;
- int lineno;
-{
- unsigned long bitno;
-
- if (bitlength <= SET_CHAR_SIZE)
- {
- SET_CHAR cset = *((SET_CHAR *)ps);
- if (cset != 0)
- {
- /* found a bit set .. calculate which */
- for (bitno = SET_CHAR_SIZE; bitno >= 1; bitno--)
- if (GET_BIT_IN_CHAR (cset, bitno - 1))
- break;
- /* return its index */
- return bitno + minval - 1;
- }
- }
- else if (bitlength <= SET_SHORT_SIZE)
- {
- SET_SHORT sset = *((SET_SHORT *)ps);
- if (sset != 0)
- {
- /* found a bit set .. calculate which */
- for (bitno = SET_SHORT_SIZE; bitno >= 1; bitno--)
- if (GET_BIT_IN_SHORT (sset, bitno - 1))
- break;
- /* return its index */
- return bitno + minval - 1;
- }
- }
- else /* set composed of array of one or more WORDs */
- {
- SET_WORD *endp = ps;
- SET_WORD *p = ps + BITS_TO_WORDS(bitlength) - 1;
- unsigned long cnt;
-
- /* FIXME: bitorder problems? */
- for (cnt = ((bitlength - 1) / SET_WORD_SIZE) * SET_WORD_SIZE;
- p >= endp; p--, cnt -= SET_WORD_SIZE)
- {
- SET_WORD c = *p;
- if (c)
- {
- /* found a bit set .. calculate which */
- for (bitno = SET_WORD_SIZE; bitno >= 1; bitno--)
- if (GET_BIT_IN_WORD (c, bitno - 1))
- break;
- return cnt + bitno + minval - 1;
- }
- }
- }
- /* no bits found - raise exception */
- __cause_ex1 ("empty", filename, lineno);
-}
diff --git a/libchill/format.c b/libchill/format.c
deleted file mode 100644
index da05e5edb7e..00000000000
--- a/libchill/format.c
+++ /dev/null
@@ -1,2194 +0,0 @@
-/* Implement Input/Output runtime actions for CHILL.
- Copyright (C) 1992,1993 Free Software Foundation, Inc.
- Author: Wilfried Moser, et al
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with other files,
- some of which are compiled with GCC, to produce an executable,
- this library 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. */
-
-#include <limits.h>
-#include <string.h>
-#include <ctype.h>
-#include <setjmp.h>
-#include <float.h>
-#include <math.h>
-#include <stdlib.h>
-#if _TEXTIO_DEBUG_
-#include <stdio.h>
-#endif
-
-#include "bitstring.h"
-#include "auxtypes.h"
-#include "iomodes.h"
-#include "format.h"
-#include "fileio.h"
-#include "ioerror.h"
-
-#define CH_BYTE_MIN 0xffffff80L
-#define CH_BYTE_MAX 0x0000007fL
-#define CH_UBYTE_MAX 0x000000ffUL
-#define CH_INT_MIN 0xffff8000L
-#define CH_INT_MAX 0x00007fffL
-#define CH_UINT_MAX 0x0000ffffUL
-#define CH_LONG_MIN 0x80000000L
-#define CH_LONG_MAX 0x7fffffffL
-#define CH_ULONG_MAX 0xffffffffUL
-
-#ifndef M_LN2
-#define M_LN2 0.69314718055994530942
-#endif
-#ifndef M_LN10
-#define M_LN10 2.30258509299404568402
-#endif
-
-#define DMANTDIGS (1 + (int)(DBL_MANT_DIG * M_LN2 / M_LN10))
-#define FMANTDIGS (1 + (int)(FLT_MANT_DIG * M_LN2 / M_LN10))
-
-/* float register length */
-#define MAXPREC 40
-
-#define LET 0x0001
-#define BIN 0x0002
-#define DEC 0x0004
-#define OCT 0x0008
-#define HEX 0x0010
-#define USC 0x0020
-#define BIL 0x0040
-#define SPC 0x0080
-#define SCS 0x0100
-#define IOC 0x0200
-#define EDC 0x0400
-#define CVC 0x0800
-
-#define isDEC(c) ( chartab[(c)] & DEC )
-#define isCVC(c) ( chartab[(c)] & CVC )
-#define isEDC(c) ( chartab[(c)] & EDC )
-#define isIOC(c) ( chartab[(c)] & IOC )
-#define isUSC(c)
-#define isXXX(c,XXX) ( chartab[(c)] & XXX )
-
-/*
- * local definitions
- */
-
-static
-short int chartab[256] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, SPC, SPC, SPC, SPC, SPC, 0, 0,
-
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-
- SPC, IOC, 0, 0, 0, 0, 0, 0,
- SCS, SCS, SCS, SCS+IOC, SCS, SCS+IOC, SCS, SCS+IOC,
- BIN+OCT+DEC+HEX, BIN+OCT+DEC+HEX, OCT+DEC+HEX, OCT+DEC+HEX, OCT+DEC+HEX,
- OCT+DEC+HEX, OCT+DEC+HEX, OCT+DEC+HEX,
- DEC+HEX, DEC+HEX, SCS, SCS, SCS+EDC, SCS+IOC, SCS+EDC, IOC,
-
- 0, LET+HEX+BIL, LET+HEX+BIL+CVC, LET+HEX+BIL+CVC, LET+HEX+BIL, LET+HEX,
- LET+HEX+CVC, LET,
- LET+BIL+CVC, LET, LET, LET, LET, LET, LET, LET+CVC,
-
- LET, LET, LET, LET, LET+EDC, LET, LET, LET,
- LET+EDC, LET, LET, SCS, 0, SCS, 0, USC,
-
- 0, LET+HEX, LET+HEX, LET+HEX, LET+HEX, LET+HEX, LET+HEX, LET,
- LET, LET, LET, LET, LET, LET, LET, LET,
-
- LET, LET, LET, LET, LET, LET, LET, LET,
- LET, LET, LET, 0, 0, 0, 0, 0
-};
-
-typedef enum {
- FormatText, FirstPercent, RepFact, ConvClause, EditClause, ClauseEnd,
- AfterWidth, FractWidth, FractWidthCont, ExpoWidth, ExpoWidthCont,
- ClauseWidth, CatchPadding, LastPercent
-} fcsstate_t;
-
-#define CONVERSIONCODES "CHOBF"
-typedef enum {
- DefaultConv, HexConv, OctalConv, BinaryConv, ScientConv
-} convcode_t;
-
-static
-short int base[4] = { 10, 16, 8, 2 };
-
-static
-short int dset[4] = { DEC, HEX, OCT, BIN };
-
-#define EDITCODES "X<>T"
-typedef enum {
- SpaceSkip, SkipLeft, SkipRight, Tabulation
-} editcode_t;
-
-#define IOCODES "/+-?!="
-typedef enum {
- NextRecord, NextPage, CurrentLine, Prompt, Emit, EndPage
-} iocode_t;
-
-typedef enum {
- ConvAct, EditAct, IOAct
-} acttype_t;
-
-typedef enum {
- NormalEnd, EndAtParen, TextFailEnd
-} formatexit_t;
-
-static
-double ep_1[10] = {
- 1e0, 1e1, 1e2, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9 };
-static
-double ep_10[10] = {
- 1e0, 1e10, 1e20, 1e30, 1e40, 1e50, 1e60, 1e70, 1e80, 1e90 };
-static
-double ep_100 = 1e100;
-
-/* float register */
-static
-unsigned char floatdig[MAXPREC];
-
-/*
- * global io variables
- */
-
-static Text_Mode* textptr = NULL;
-static VarString* textrecptr;
-
-static int actual_index;
-static int maximum_index;
-static int iolist_index;
-
-static __tmp_IO_list* iolistptr;
-static int iolistlen;
-static char* iostrptr;
-static int iostrlen;
-
-
-static convcode_t convcode;
-static editcode_t editcode;
-static iocode_t iocode;
-static unsigned long repetition;
-static Boolean leftadjust;
-static Boolean overflowev;
-static Boolean dynamicwid;
-static Boolean paddingdef;
-static char paddingchar;
-static Boolean fractiondef;
-static unsigned long fractionwidth;
-static Boolean exponentdef;
-static unsigned long exponentwidth;
-static unsigned long clausewidth;
-static signed long textindex;
-
-static
-__tmp_IO_enum_table_type bool_tab[] =
- { { 0, "FALSE" },
- { 1, "TRUE" },
- { 0 , NULL } };
-
-/*
- * case insensitive compare: s1 is zero delimited, s2 has n chars
- */
-static
-int casncmp( const char* s1, const char* s2, int n )
-{
- int res = 0;
- while( n-- )
- {
- if( (res = toupper(*s1++) - toupper(*s2++)) )
- return res;
- }
- return *s1;
-}
-
-/*
- * skip spaces with blank equal to tab
- */
-static
-int skip_space( int limit )
-{
- int skipped = 0;
- while( actual_index < limit &&
- (iostrptr[actual_index] == ' ' || iostrptr[actual_index] == '\t' ) )
- {
- actual_index++;
- skipped++;
- }
- return skipped;
-}
-
-/*
- * skip leading pad characters
- */
-static
-int skip_pad( int limit )
-{
- int skipped = 0;
- while( actual_index < limit && iostrptr[actual_index] == paddingchar )
- {
- actual_index++;
- skipped++;
- }
-#if _TEXTIO_DEBUG_
- printf( "skipping '%c' until %d: %d\n", paddingchar, limit, skipped );
-#endif
- return skipped;
-}
-
-/*
- * backup trailing pad characters
- */
-static
-int piks_pad( int start, int limit )
-{
- int skipped = 0;
- while( start >/***=*/ limit && iostrptr[--start] == paddingchar )
- {
- skipped++;
- }
-#if _TEXTIO_DEBUG_
- printf( "piksing '%c' from %d until %d: %d\n",
- paddingchar, start, limit, skipped );
-#endif
- return skipped;
-}
-
-/*
- * parse an integer
- */
-static
-int parse_int( int limit, int SET, int base,
- unsigned long* valptr, int* signptr )
-{
- int parsed = actual_index;
- Boolean digits = False;
- unsigned long value = 0;
- char curr;
- int dig;
-
- if( actual_index >= limit )
- IOEXCEPTION( TEXTFAIL, NO_CHARS_FOR_INT );
- *signptr = +1;
- if( iostrptr[actual_index] == '+' )
- actual_index++;
- else
- if( iostrptr[actual_index] == '-' )
- { *signptr = -1;
- actual_index++;
- }
-
- for( ; actual_index < limit; actual_index++ )
- {
- curr = iostrptr[actual_index];
- if( curr == '_' ) continue;
- if( isXXX(curr,SET) )
- {
- digits = True;
- dig = curr <= '9' ? curr - '0' : toupper(curr) - 'A' + 10;
- if( value > (ULONG_MAX - dig)/base )
- IOEXCEPTION( TEXTFAIL, INT_VAL_OVERFLOW );
- value = value*base + dig;
- continue;
- }
- break;
- }
- if( !digits )
- IOEXCEPTION( TEXTFAIL, NO_DIGITS_FOR_INT );
-
- *valptr = value;
-#if _TEXTIO_DEBUG_
- printf( "parsing for int until %d, base %d: %u\n", limit, base, value );
-#endif
- return actual_index - parsed;
-}
-
-static
-double
-make_float( int dexp, int sign )
-{
- double value = atof( floatdig );
-#if _TEXTIO_DEBUG_
- printf( " value = %25.20e, dexp = %d\n", value, dexp );
-#endif
- while( dexp >= 100 )
- value *= ep_100, dexp -= 100;
- if( dexp >= 10 )
- value *= ep_10[dexp/10], dexp %= 10;
- if( dexp > 0 )
- value *= ep_1[dexp];
-
- while( dexp <= -100 )
- value /= ep_100, dexp += 100;
- if( dexp <= -10 )
- value /= ep_10[-dexp/10], dexp %= 10;
- if( dexp < 0 )
- value /= ep_1[-dexp];
-
- return sign ? -value : value;
-}
-
-/* %C -> fixed point [+|-]<digit>+[.<digit>*] */
-static
-int parse_fixedpoint( int limit, double* valptr )
-{
- int parsed = actual_index;
- Boolean digits = False;
- int sdig = 0;
- double value;
- char curr;
- int sign = False;
- int expo = 0;
-
- if( actual_index >= limit )
- IOEXCEPTION( TEXTFAIL, NO_CHARS_FOR_FLOAT );
- if( iostrptr[actual_index] == '+' )
- actual_index++;
- else
- if( iostrptr[actual_index] == '-' )
- {
- sign = True;
- actual_index++;
- }
-
- floatdig[0] = '.';
- for( ; actual_index < limit; actual_index++ )
- {
- curr = iostrptr[actual_index];
- if( ! isDEC(curr) )
- break;
- digits = True;
- if( sdig < MAXPREC - 1 )
- {
- if( sdig || curr != '0' )
- {
- floatdig[++sdig] = curr;
- expo++;
- }
- }
- else
- if( sdig )
- expo++;
- }
- if( digits && curr == '.' )
- {
- actual_index++;
- for( ; actual_index < limit; actual_index++ )
- {
- curr = iostrptr[actual_index];
- if( !isDEC(curr) )
- break;
- if( sdig < MAXPREC - 1 )
- {
- if( sdig || curr != '0' )
- floatdig[++sdig] = curr;
- else
- expo--;
- }
- }
- }
- floatdig[++sdig] = '\0';
-
- if( !digits )
- IOEXCEPTION( TEXTFAIL, NO_DIGITS_FOR_FLOAT );
-
- *valptr = make_float( expo, sign);
- return actual_index - parsed;
-}
-
-
-typedef enum {
- s_sign, s_dig, s_period, s_fraca, s_fracb, s_expo, s_exposign,
- s_expoa, s_expob }
-scient_t;
-
-/* %C -> scientific [+|-]<digit>[.<digit>*]E[=|-]<digit>+ */
-static
-int parse_scientific( int limit, double* valptr, double dmin, double dmax )
-{
- int parsed = actual_index;
- int sdig = 0;
- char curr;
- double value;
- int sign = False;
- int expo = 0;
- int expo_sign = +1;
-
- scient_t state = s_sign;
-
- if( actual_index >= limit )
- IOEXCEPTION( TEXTFAIL, NO_CHARS_FOR_FLOAT );
-
- floatdig[0] = '.';
- for( ; actual_index < limit; actual_index++ )
- {
- curr = iostrptr[actual_index];
- switch( state )
- {
- case s_sign:
- if( iostrptr[actual_index] == '+' )
- {
- state = s_dig;
- break;
- }
- if( iostrptr[actual_index] == '-' )
- {
- sign = True;
- state = s_dig;
- break;
- }
- /* fall through - no break */
- case s_dig:
- if( isDEC(curr) && curr > '0' )
- {
- floatdig[++sdig] = curr;
- state = s_period;
- break;
- }
- IOEXCEPTION( TEXTFAIL, NO_DIGITS_FOR_FLOAT );
- case s_period:
- if( curr == '.' )
- {
- state = s_fraca;
- break;
- }
- if( curr == 'E' )
- {
- state = s_exposign;
- break;
- }
- IOEXCEPTION( TEXTFAIL, NO_EXPONENT );
- case s_fraca:
- if( isDEC(curr) )
- {
- floatdig[++sdig] = curr;
- state = s_fracb;
- break;
- }
- IOEXCEPTION( TEXTFAIL, NO_DIGITS_FOR_FLOAT );
- case s_fracb:
- if( isDEC(curr) )
- {
- if( sdig < MAXPREC - 1 )
- floatdig[++sdig] = curr;
- break;
- }
- if( curr == 'E' )
- {
- state = s_exposign;
- break;
- }
- IOEXCEPTION( TEXTFAIL, NO_EXPONENT );
- case s_exposign:
- if( iostrptr[actual_index] == '+' )
- {
- state = s_expoa;
- break;
- }
- if( iostrptr[actual_index] == '-' )
- {
- expo_sign = -1;
- state = s_expoa;
- break;
- }
- case s_expoa:
- if( isDEC(curr) )
- {
- expo = curr - '0';
- state = s_expob;
- break;
- }
- IOEXCEPTION( TEXTFAIL, NO_EXPONENT );
- case s_expob:
- expo = expo*10 + (curr - '0');
- if( expo > 1000 )
- IOEXCEPTION( TEXTFAIL, REAL_OVERFLOW );
- }
- }
- if( state != s_expob )
- IOEXCEPTION( TEXTFAIL, NO_EXPONENT );
-
- expo *= expo_sign;
- expo++;
-
- floatdig[++sdig] = '\0';
-
- *valptr = make_float( expo, sign );
- return actual_index - parsed;
-}
-
-
-static
-int parse_set( int limit, __tmp_IO_enum_table_type* tabptr,
- unsigned long* valptr )
-{
- int parsed = actual_index;
- char curr;
- __tmp_IO_enum_table_type* etptr;
-
- if( actual_index >= limit )
- IOEXCEPTION( TEXTFAIL, NO_CHARS_FOR_SET );
-
- curr = iostrptr[actual_index];
- if( isXXX(curr,LET+USC) )
- actual_index++;
- else
- IOEXCEPTION( TEXTFAIL, NO_CHARS_FOR_SET );
-
- for( ; actual_index < limit; actual_index++ )
- {
- if( ! isXXX(iostrptr[actual_index],LET+DEC+USC) )
- break;
- }
-
- if( tabptr )
- while( tabptr->name )
- {
- if( !casncmp( tabptr->name, &iostrptr[parsed], actual_index-parsed ) )
- {
- *valptr = tabptr->value;
-#if _TEXTIO_DEBUG_
- printf( "parsing set value until %d: %u\n", limit, tabptr->value );
-#endif
- return actual_index - parsed;
- }
- tabptr++;
- }
- IOEXCEPTION( TEXTFAIL, SET_CONVERSION_ERROR );
-}
-
-static
-int parse_bit( int limit, char* bitptr )
-{
- int parsed = actual_index;
- int i = 0;
- char curr;
-
- if( actual_index >= limit )
- IOEXCEPTION( TEXTFAIL, NO_CHARS_FOR_BOOLS );
-
- for( ; actual_index < limit; actual_index++ )
- {
- curr = iostrptr[actual_index] - '0';
- if( curr == 0 || curr == 1 )
- /* __setbitinset( i++, bitptr, limit, curr ); */
- __setbitpowerset (bitptr, limit, 0, i++, curr, __FILE__, __LINE__);
- else
- break;
- }
- return actual_index - parsed;
-}
-
-static
-char* myultoa( unsigned long ul, char* buf, int base )
-{
- char* res = buf;
- unsigned long h = ul/base;
- unsigned long q = 1;
-
- while( h >= q ) q *= base;
- while( q > 0 )
- {
- *buf++ = "0123456789ABCDEF"[ul/q];
- ul %= q;
- q /= base;
- }
- *buf++ = '\0';
- return res;
-}
-
-/*
- * convert a bit string from src, bit offset up to len
- */
-static
-char* bitput( char* dst, char* src, int offset, int len )
-{
- char* res = dst;
- int i;
- for( i = offset; i < len; i++ )
- {
- *dst++ = __inpowerset( i, src, len, 0 ) ? '1' : '0';
- }
- return res;
-}
-
-/*
- * dround: round decimal register *digptr starting at digit mdigs,
- * on carry advance begin of digit sequence and bump exponent
- */
-static
-char*
-dround( char* digptr, int mdigs, int* deptr )
-{
- int carry;
-#if _TEXTIO_DEBUG_
- printf( "Rounding from %d\n", mdigs );
-#endif
- if( digptr[mdigs] >= 5 )
- {
- carry = 1;
- while( carry )
- {
- digptr[--mdigs]++;
- if( digptr[mdigs] >= 10 )
- digptr[mdigs] = 0;
- else
- carry = 0;
- }
- }
- if( mdigs < 0 )
- {
- digptr[--mdigs] = 1;
- (*deptr)++;
- return digptr - 1;
- }
- else
- return digptr;
-}
-
-/*
- * mydtoa: convert val with a precision of mantdigs to a decimal fraction
- * first digit is at **fstdiptr, decimal exponent is at *deptr
- */
-static
-char*
-mydtoa( double val, int mantdigs, int* deptr, int* sgnptr )
-{
- double m;
- int be;
- int de = -1;
- int fstdig = 0;
- int idig;
- char* digptr = floatdig+2;
-
- floatdig[0] = floatdig[1] = 0;
-
- if( val < 0 )
- *sgnptr = -1, val = fabs( val );
- else
- *sgnptr = +1;
-
- /* split the value */
- m = frexp( val, &be ) * 10.0;
-
- /* 5.0 <= m < 10.0 */
- while( be > 0 )
- {
- de++; be--; m /= 5.0;
- if( m < 1.0 )
- m *= 10.0, de--;
- }
- while( be < 0 )
- {
- de--; be++; m *= 5.0;
- if( m >= 10.0 )
- m /= 10.0, de++;
- }
-
- for( idig = 0; idig < mantdigs; idig++ )
- {
- digptr[idig] = (int)m;
- m = (m - digptr[idig])*10.0;
- }
- digptr[idig] = (int)m;
-
- *deptr = de;
- return dround( digptr, mantdigs, deptr );
-}
-
-#define PUT(c) \
- { if( ifst <= ++iprt && iprt <= ilst ) *dst++ = c; }
-
-static
-char*
-fixput( char* dst, char* src,
- int ifst, int ilst,
- int sign, int fst, int lst,
- int nid, int nfd )
-{
- char* dstsav = dst;
- int idig;
- int iprt = 0;
-
- if( sign < 0 )
- PUT( '-' );
- for( idig = nid; idig >= -nfd; idig-- )
- {
- if (idig == -1)
- PUT( '.' );
- PUT( idig > fst || lst >= idig ? '0': '0' + *src++ );
- }
- return dstsav;
-}
-
-static
-char*
-sciput( char* dst, char* src, char* expbeg,
- int ifst, int ilst,
- int sign, int de, int expwid )
-{
- char* dstsav = dst;
- int iprt = 0;
- int nfd = fractionwidth;
- int explen = strlen( expbeg );
-
- if( sign < 0 )
- PUT( '-' );
- PUT( '0' + *src++ );
- PUT( '.' );
-
- while( nfd-- )
- PUT( '0' + *src++ );
- PUT( 'E' );
- PUT( de >= 0 ? '+' : '-' );
- while( expwid > explen )
- {
- PUT( '0' );
- expwid--;
- }
- while( explen-- )
- PUT( *expbeg++ );
- return dstsav;
-}
-
-/*
- * handle dynamic field width
- */
-static
-get_field_width( void )
-{
- unsigned long width;
- unsigned long ulongval;
- long longval;
- __tmp_IO_list io;
-
-
- if( ++iolist_index > iolistlen )
- IOEXCEPTION( TEXTFAIL, IOLIST_EXHAUSTED );
-
- io = *iolistptr++;
-
- /* must be integer, >= 0 */
- switch( io.__descr )
- {
- case __IO_ByteVal:
- longval = io.__t.__valbyte;
- goto signed_fieldwidth;
- case __IO_UByteVal:
- width = io.__t.__valubyte;
- goto unsigned_fieldwidth;
- case __IO_IntVal:
- longval = io.__t.__valint;
- goto signed_fieldwidth;
- case __IO_UIntVal:
- width = io.__t.__valuint;
- goto unsigned_fieldwidth;
- case __IO_LongVal:
- longval = io.__t.__vallong;
- goto signed_fieldwidth;
- case __IO_ULongVal:
- width = io.__t.__valulong;
- goto unsigned_fieldwidth;
- case __IO_ByteLoc:
- longval = *(signed char*)io.__t.__locint;
- goto signed_fieldwidth;
- case __IO_UByteLoc:
- width = *(unsigned char*)io.__t.__locint;
- goto unsigned_fieldwidth;
- case __IO_IntLoc:
- longval = *(signed short*)io.__t.__locint;
- goto signed_fieldwidth;
- case __IO_UIntLoc:
- width = *(unsigned short*)io.__t.__locint;
- goto unsigned_fieldwidth;
- case __IO_LongLoc:
- longval = *(signed long*) io.__t.__locint;
- goto signed_fieldwidth;
- case __IO_ULongLoc:
- width = *(unsigned long*)io.__t.__locint;
- goto unsigned_fieldwidth;
- default:
- IOEXCEPTION( TEXTFAIL, NON_INT_FIELD_WIDTH );
- }
-
-signed_fieldwidth: ;
- if( longval < 0 )
- IOEXCEPTION( TEXTFAIL, NEGATIVE_FIELD_WIDTH );
- width = longval;
-
-unsigned_fieldwidth: ;
- return width;
-}
-
-
-static
-void inpconv( void )
-{
- __tmp_IO_list io;
- int width;
- int limit;
- int skiplim;
- int skipped;
- int bypass;
- int parsed;
- Boolean fixedchars;
- int fixedlen;
- unsigned char curr;
- double dval;
- float fval;
-
- __tmp_IO_long lval;
- int sign;
- unsigned long umin;
- unsigned long umax;
- signed long smin;
- signed long smax;
- int ilen;
- short unsigned slen;
- __tmp_IO_enum_table_type* settabptr;
-
- while( repetition-- )
- {
- if( ++iolist_index > iolistlen )
- IOEXCEPTION( TEXTFAIL, IOLIST_EXHAUSTED );
-
- io = *iolistptr++;
-
- if( dynamicwid )
- width = get_field_width();
- else
- width = clausewidth;
-
- bypass = skipped = 0;
- if( width )
- {
- if( actual_index + width > iostrlen )
- IOEXCEPTION( TEXTFAIL, NOT_ENOUGH_CHARS );
-
- switch(io.__descr)
- {
- case __IO_CharLoc:
- case __IO_CharRangeLoc:
- fixedchars = True;
- fixedlen = 1;
- break;
- case __IO_CharStrLoc:
- fixedchars = True;
- fixedlen = io.__t.__loccharstring.string_length;
- break;
- default:
- fixedchars = False;
- break;
- }
-
- if( leftadjust )
- {
- skiplim = fixedchars ? actual_index + fixedlen
- : actual_index;
- bypass = skipped = piks_pad( actual_index + width, skiplim );
- }
- else
- {
- skiplim = fixedchars ? actual_index + width - fixedlen
- : actual_index + width;
- skipped = skip_pad( skiplim );
- }
- width -= skipped;
- limit = actual_index + width;
- }
- else
- { /* free format */
- if( paddingdef || !( io.__descr == __IO_CharLoc ||
- io.__descr == __IO_CharRangeLoc ||
- io.__descr == __IO_CharStrLoc ||
- io.__descr == __IO_CharVaryingLoc ) )
- if( paddingchar == ' ' || paddingchar == '\t' )
- skip_space( iostrlen );
- else
- skip_pad( iostrlen );
- limit = iostrlen;
- }
-
- switch( io.__descr )
- {
- case __IO_ByteLoc:
- ilen = 1;
- smin = CH_BYTE_MIN;
- smax = CH_BYTE_MAX;
- goto parse_signed_int;
- case __IO_UByteLoc:
- ilen = 1;
- umin = 0;
- umax = CH_UBYTE_MAX;
- goto parse_unsigned_int;
- case __IO_IntLoc:
- ilen = 2;
- smin = CH_INT_MIN;
- smax = CH_INT_MAX;
- goto parse_signed_int;
- case __IO_UIntLoc:
- ilen = 2;
- umin = 0;
- umax = CH_UINT_MAX;
- goto parse_unsigned_int;
- case __IO_LongLoc:
- ilen = 4;
- smin = CH_LONG_MIN;
- smax = CH_LONG_MAX;
- goto parse_signed_int;
- case __IO_ULongLoc:
- ilen = 4;
- umin = 0;
- umax = CH_ULONG_MAX;
- goto parse_unsigned_int;
-
- case __IO_ByteRangeLoc:
- ilen = 1;
- smin = io.__t.__locintrange.lower.slong;
- smax = io.__t.__locintrange.upper.slong;
- goto parse_signed_int;
- case __IO_UByteRangeLoc:
- ilen = 1;
- umin = io.__t.__locintrange.lower.ulong;
- umax = io.__t.__locintrange.upper.ulong;
- goto parse_unsigned_int;
- case __IO_IntRangeLoc:
- ilen = 2;
- smin = io.__t.__locintrange.lower.slong;
- smax = io.__t.__locintrange.upper.slong;
- goto parse_signed_int;
- case __IO_UIntRangeLoc:
- ilen = 2;
- umin = io.__t.__locintrange.lower.ulong;
- umax = io.__t.__locintrange.upper.ulong;
- goto parse_unsigned_int;
- case __IO_LongRangeLoc:
- ilen = 4;
- smin = io.__t.__locintrange.lower.slong;
- smax = io.__t.__locintrange.upper.slong;
- goto parse_signed_int;
- case __IO_ULongRangeLoc:
- ilen = 4;
- umin = io.__t.__locintrange.lower.ulong;
- umax = io.__t.__locintrange.upper.ulong;
- goto parse_unsigned_int;
-
- case __IO_BoolLoc:
- ilen = 1;
- umin = 0;
- umax = 1;
- settabptr = bool_tab;
- goto parse_set;
- case __IO_BoolRangeLoc:
- ilen = 1;
- umin = io.__t.__locboolrange.lower;
- umax = io.__t.__locboolrange.upper;
- settabptr = bool_tab;
- goto parse_set;
-
- case __IO_SetLoc:
- ilen = io.__t.__locsetrange.length;
- settabptr = io.__t.__locsetrange.name_table;
- umin = 0;
- umax = CH_ULONG_MAX;
- goto parse_set;
- case __IO_SetRangeLoc:
- ilen = io.__t.__locsetrange.length;
- settabptr = io.__t.__locsetrange.name_table;
- umin = io.__t.__locsetrange.lower;
- umax = io.__t.__locsetrange.upper;
- goto parse_set;
-
- case __IO_CharLoc:
- umin = 0;
- umax = 0xff;
- goto parse_char;
- case __IO_CharRangeLoc:
- umin = io.__t.__loccharrange.lower;
- umax = io.__t.__loccharrange.upper;
- goto parse_char;
-
- case __IO_CharVaryingLoc:
- if( convcode != DefaultConv )
- IOEXCEPTION( TEXTFAIL, CONVCODE_MODE_MISFIT );
- slen = io.__t.__loccharstring.string_length;
- if( (parsed = limit - actual_index) < slen )
- slen = parsed;
- else
- parsed = slen;
- memcpy( io.__t.__loccharstring.string + 2,
- &iostrptr[actual_index], parsed );
- MOV2(io.__t.__loccharstring.string,&slen);
- actual_index += parsed;
- goto check_field_complete;
-
-
- case __IO_CharStrLoc:
- if( convcode != DefaultConv )
- IOEXCEPTION( TEXTFAIL, CONVCODE_MODE_MISFIT );
- if( actual_index + io.__t.__loccharstring.string_length > limit )
- IOEXCEPTION( TEXTFAIL, NO_CHARS_FOR_CHARS );
- memcpy( io.__t.__loccharstring.string,
- &iostrptr[actual_index],
- parsed = io.__t.__loccharstring.string_length );
- actual_index += parsed;
- goto check_field_complete;
-
- case __IO_BitStrLoc:
- if( convcode != DefaultConv )
- IOEXCEPTION( TEXTFAIL, CONVCODE_MODE_MISFIT );
- parsed = parse_bit( limit, io.__t.__loccharstring.string );
- if( parsed < io.__t.__loccharstring.string_length )
- IOEXCEPTION( TEXTFAIL, NO_CHARS_FOR_BOOLS );
- goto check_field_complete;
-
- case __IO_LongRealLoc:
- case __IO_RealLoc:
- switch( convcode )
- {
- case ScientConv:
- parse_scientific( limit, &dval, DBL_MIN, DBL_MAX );
- break;
- case DefaultConv:
- parse_fixedpoint( limit, &dval );
- break;
- default:
- IOEXCEPTION( TEXTFAIL, CONVCODE_MODE_MISFIT );
- }
- if( io.__descr == __IO_LongRealLoc )
- memcpy( io.__t.__loclongreal, &dval, sizeof(double) );
- else
- {
- fval = (float)dval;
- MOV4(io.__t.__locreal,&fval);
- }
- goto check_field_complete;
- default:
- IOEXCEPTION( TEXTFAIL, INVALID_IO_LIST );
- }
-
-
-parse_signed_int: ;
- if( convcode == ScientConv )
- IOEXCEPTION( TEXTFAIL, CONVCODE_MODE_MISFIT );
- parsed = parse_int( limit, dset[convcode], base[convcode],
- &lval.ulong, &sign );
- if( sign < 0 )
- {
- if( lval.ulong > (unsigned long)CH_LONG_MIN )
- IOEXCEPTION( TEXTFAIL, INTEGER_RANGE_ERROR );
- lval.slong = -lval.ulong;
- }
- else
- {
- /* not needed: lval.slong = lval.ulong; */
- /* Hack: sign extension for bin/oct/dec if no sign present */
- if( convcode != DefaultConv && lval.ulong & (1 << (ilen*8-1)) )
- {
- if( ilen < 4 )
- lval.ulong |= 0xFFFFFFFF << ilen*8;
- }
- else
- if( lval.ulong > (unsigned long)CH_LONG_MAX )
- IOEXCEPTION( TEXTFAIL, INTEGER_RANGE_ERROR );
- }
- if( lval.slong < smin || smax < lval.slong )
- IOEXCEPTION( TEXTFAIL, INTEGER_RANGE_ERROR );
- goto store_int;
-
-parse_unsigned_int: ;
- if( convcode == ScientConv )
- IOEXCEPTION( TEXTFAIL, CONVCODE_MODE_MISFIT );
- parsed = parse_int( limit, dset[convcode], base[convcode],
- &lval.ulong, &sign );
- if( sign < 0 || lval.ulong < umin || umax < lval.ulong )
- IOEXCEPTION( TEXTFAIL, INTEGER_RANGE_ERROR );
- goto store_int;
-
-parse_set: ;
- if( convcode != DefaultConv )
- IOEXCEPTION( TEXTFAIL, CONVCODE_MODE_MISFIT );
- parsed = parse_set( limit, settabptr, &lval.ulong );
- if( lval.ulong < umin || umax < lval.ulong )
- IOEXCEPTION( TEXTFAIL, SET_RANGE_ERROR );
- goto store_int;
-
-store_int: ;
- switch( ilen )
- {
- case 1:
- *(unsigned char*)io.__t.__locint = lval.ulong;
- break;
- case 2:
- slen = lval.ulong;
- MOV2(io.__t.__locint,&slen);
- break;
- case 4:
- MOV4(io.__t.__locint,&lval.ulong);
- break;
- default:
- IOEXCEPTION( TEXTFAIL, INTERNAL_ERROR );
- }
- goto check_field_complete;
-
-parse_char: ;
- if( convcode != DefaultConv )
- IOEXCEPTION( TEXTFAIL, CONVCODE_MODE_MISFIT );
- if( actual_index >= limit )
- IOEXCEPTION( TEXTFAIL, NO_CHARS_FOR_CHARS );
- curr = iostrptr[actual_index++];
- parsed = 1;
- if( curr < umin || umax < curr )
- IOEXCEPTION( TEXTFAIL, CHAR_RANGE_ERROR );
- *io.__t.__locchar = curr;
- goto check_field_complete;
-
-check_field_complete: ;
- actual_index += bypass;
- if( width > parsed )
- IOEXCEPTION( TEXTFAIL, INVALID_CHAR );
- }
-}
-
-static
-void inpedit( void )
-{
- int nchars;
-
- if( dynamicwid )
- clausewidth = get_field_width();
-
- switch( editcode )
- {
- case SpaceSkip:
- nchars = repetition*clausewidth;
- if( actual_index + nchars > iostrlen )
- IOEXCEPTION( TEXTFAIL, NO_CHARS_FOR_EDIT );
- for( ; nchars ; nchars-- )
- if( iostrptr[actual_index++] != ' ' )
- IOEXCEPTION( TEXTFAIL, NO_SPACE_TO_SKIP );
- break;
-
- case SkipLeft:
- nchars = repetition*clausewidth;
- if( (actual_index -= nchars) < 0 )
- IOEXCEPTION( TEXTFAIL, NO_CHARS_FOR_EDIT );
- break;
-
- case SkipRight:
- nchars = repetition*clausewidth;
- if( (actual_index += nchars) > iostrlen )
- IOEXCEPTION( TEXTFAIL, NO_CHARS_FOR_EDIT );
- break;
-
- case Tabulation:
- if( (actual_index = clausewidth) > iostrlen )
- IOEXCEPTION( TEXTFAIL, TEXT_LOC_OVERFLOW );
- break;
- }
-}
-
-static
-void outconv( void )
-{
- unsigned long width;
- char itembuf[33];
- unsigned long ulongval;
- long longval;
- __tmp_IO_list io;
- __tmp_IO_enum_table_type* etptr;
- char* itembeg;
- unsigned long itemlen;
- double doubleval;
- int de;
- int sign;
- int mantdigs;
- int nid;
- int nfd;
- char* expbeg;
- int explen;
- unsigned int expwid;
-
- while( repetition-- )
- {
- if( ++iolist_index > iolistlen )
- IOEXCEPTION( TEXTFAIL, IOLIST_EXHAUSTED );
-
- io = *iolistptr++;
- width = dynamicwid ? get_field_width() : clausewidth;
-
- switch( convcode )
- {
- case DefaultConv:
- switch( io.__descr )
- {
- case __IO_ByteVal:
- longval = io.__t.__valbyte;
- goto signed_conversion;
- case __IO_UByteVal:
- ulongval = io.__t.__valubyte;
- goto unsigned_conversion;
- case __IO_IntVal:
- longval = io.__t.__valint;
- goto signed_conversion;
- case __IO_UIntVal:
- ulongval = io.__t.__valuint;
- goto unsigned_conversion;
- case __IO_LongVal:
- longval = io.__t.__vallong;
- goto signed_conversion;
- case __IO_ULongVal:
- ulongval = io.__t.__valulong;
- goto unsigned_conversion;
-
- case __IO_BoolVal:
- switch( io.__t.__valbool )
- {
- case 0:
- itembeg = "FALSE";
- itemlen = 5;
- goto move_item;
- case 1:
- itembeg = "TRUE";
- itemlen = 4;
- goto move_item;
- default:
- IOEXCEPTION( TEXTFAIL, BOOL_CONVERSION_ERROR );
- }
-
- case __IO_CharVal:
- itembeg = &io.__t.__valchar;
- itemlen = 1;
- goto move_item;
-
- case __IO_SetVal:
- /* locate name string using set mode name table */
- itembeg = 0;
-
- if( (etptr = io.__t.__valset.name_table) )
- while( etptr->name )
- {
- if( etptr->value == io.__t.__valset.value )
- {
- itembeg = etptr->name;
- itemlen = strlen( itembeg );
- goto move_item;
- }
- etptr++;
- }
- IOEXCEPTION( TEXTFAIL, SET_CONVERSION_ERROR );
-
- case __IO_CharVaryingLoc:
- {
- unsigned short l;
- itembeg = (char*)io.__t.__loccharstring.string;
- MOV2(&l,itembeg);
- itembeg += 2;
- itemlen = l;
- goto move_item;
- }
-
- case __IO_CharStrLoc:
- itembeg = io.__t.__loccharstring.string;
- itemlen = io.__t.__loccharstring.string_length;
- goto move_item;
-
- case __IO_BitStrLoc:
- itemlen = io.__t.__loccharstring.string_length;
- itembeg = io.__t.__loccharstring.string;
-
- if( !width )
- width = itemlen;
-
- /* check remaining space */
- if( actual_index + width > iostrlen )
- IOEXCEPTION( TEXTFAIL, TEXT_LOC_OVERFLOW );
-
- if( itemlen == width )
- bitput( iostrptr + actual_index, itembeg, 0, itemlen );
- else
- if( itemlen < width )
- if( leftadjust )
- memset( bitput( iostrptr + actual_index, itembeg, 0, itemlen )
- + itemlen,
- paddingchar, width - itemlen );
- else
- bitput( memset( iostrptr + actual_index,
- paddingchar, width - itemlen )
- + width - itemlen,
- itembeg, itemlen - width, itemlen );
- else
- if( overflowev )
- memset( iostrptr + actual_index, '*', width );
- else
- if( leftadjust )
- bitput( iostrptr + actual_index, itembeg, 0, width );
- else
- bitput( iostrptr + actual_index, itembeg,
- itemlen - width, itemlen );
- goto adjust_index;
-
- case __IO_RealVal:
- doubleval = io.__t.__valreal;
- mantdigs = FMANTDIGS;
- goto fixed_point_conversion;
- case __IO_LongRealVal:
- doubleval = io.__t.__vallongreal;
- mantdigs = DBL_DIG;
- goto fixed_point_conversion;
- break;
-
- default:
- IOEXCEPTION( TEXTFAIL, INVALID_IO_LIST );
- }
-
- case HexConv:
- case OctalConv:
- case BinaryConv:
- switch( io.__descr )
- {
- case __IO_ByteVal:
- case __IO_UByteVal:
- ulongval = io.__t.__valubyte;
- break;
- case __IO_IntVal:
- case __IO_UIntVal:
- ulongval = io.__t.__valuint;
- break;
- case __IO_LongVal:
- case __IO_ULongVal:
- ulongval = io.__t.__valulong;
- break;
- default:
- IOEXCEPTION( TEXTFAIL, CONVCODE_MODE_MISFIT );
- }
- itembeg = myultoa( ulongval, itembuf, base[convcode] );
- itemlen = strlen( itembeg );
- goto move_item;
-
- case ScientConv:
- switch( io.__descr )
- {
- case __IO_RealVal:
- doubleval = io.__t.__valreal;
- mantdigs = FMANTDIGS;
- if( !fractiondef )
- fractionwidth = FMANTDIGS - 1;
- goto scientific_conversion;
- case __IO_LongRealVal:
- doubleval = io.__t.__vallongreal;
- mantdigs = DBL_DIG;
- if( !fractiondef )
- fractionwidth = DBL_DIG - 1;
- goto scientific_conversion;
- break;
- default:
- IOEXCEPTION( TEXTFAIL, CONVCODE_MODE_MISFIT );
- }
- }
-
-fixed_point_conversion: ;
- itembeg = mydtoa( doubleval, mantdigs, &de, &sign );
- if( fractiondef && de >= -fractionwidth - 1
- && -fractionwidth > de - mantdigs )
- itembeg = dround( itembeg, de + fractionwidth + 1, &de );
-
- nid = de >= 0 ? de : 0;
- nfd = fractiondef ? fractionwidth
- : ( de + 1 - mantdigs > 0 ? 0 : mantdigs - de - 1 );
- itemlen = ( sign < 0 ? 1 : 0 ) + 2 + nid + nfd;
-#if _TEXTIO_DEBUG_
-printf( "fixed item length %d\n", itemlen );
-#endif
- if( !width )
- width = itemlen;
-#if _TEXTIO_DEBUG_
-printf( "fixed item width %d\n", width );
-#endif
- /* check remaining space */
- if( actual_index + width > iostrlen )
- IOEXCEPTION( TEXTFAIL, TEXT_LOC_OVERFLOW );
-
- if( itemlen == width )
- fixput( iostrptr + actual_index, itembeg,
- 1, itemlen, sign, de, de - mantdigs, nid, nfd );
- else
- if( itemlen < width )
- if( leftadjust )
- memset( fixput( iostrptr + actual_index, itembeg,
- 1, itemlen, sign, de, de - mantdigs, nid, nfd )
- + itemlen,
- paddingchar, width - itemlen );
- else
- fixput( memset( iostrptr + actual_index,
- paddingchar, width - itemlen )
- + width - itemlen,
- itembeg, 1, itemlen, sign, de, de - mantdigs, nid, nfd );
- else
- if( overflowev )
- memset( iostrptr + actual_index, '*', width );
- else
- if( leftadjust )
- fixput( iostrptr + actual_index, itembeg,
- 1, width, sign, de, de - mantdigs, nid, nfd );
- else
- fixput( iostrptr + actual_index, itembeg,
- itemlen - width + 1, itemlen,
- sign, de, de - mantdigs, nid, nfd );
- goto adjust_index;
-
-scientific_conversion: ;
- itembeg = mydtoa( doubleval, mantdigs, &de, &sign );
-
- if( fractiondef && fractionwidth < mantdigs )
- itembeg = dround( itembeg, fractionwidth + 1, &de );
-
- expbeg = myultoa( abs(de), itembuf, 10 );
- explen = strlen( expbeg );
-
- expwid = explen > exponentwidth ? explen : exponentwidth;
- itemlen = ( sign < 0 ? 1 : 0 ) + 2 + fractionwidth + 2 + expwid;
-#if _TEXTIO_DEBUG_
-printf( "floating item length %d, fraction %d, exponent %d\n",
- itemlen, fractionwidth, expwid );
-#endif
- if( width == 0 )
- width = itemlen;
-#if _TEXTIO_DEBUG_
-printf( "floating item width %d\n", width );
-#endif
- /* check remaining space */
- if( actual_index + width > iostrlen )
- IOEXCEPTION( TEXTFAIL, TEXT_LOC_OVERFLOW );
-
- if( itemlen == width )
- sciput( iostrptr + actual_index, itembeg, expbeg,
- 1, itemlen, sign, de, expwid );
- else
- if( itemlen < width )
- if( leftadjust )
- memset( sciput( iostrptr + actual_index, itembeg, expbeg,
- 1, itemlen, sign, de, expwid )
- + itemlen,
- paddingchar, width - itemlen );
- else
- sciput( memset( iostrptr + actual_index,
- paddingchar, width - itemlen )
- + width - itemlen,
- itembeg, expbeg, 1, itemlen, sign, de, expwid );
- else
- if( overflowev )
- memset( iostrptr + actual_index, '*', width );
- else
- if( leftadjust )
- sciput( iostrptr + actual_index, itembeg, expbeg,
- 1, width, sign, de, expwid );
- else
- sciput( iostrptr + actual_index, itembeg, expbeg,
- itemlen - width + 1, itemlen,
- sign, de, expwid );
- goto adjust_index;
-
-signed_conversion: ;
- if( longval >= 0 )
- itembeg = myultoa( longval, itembuf, 10 );
- else
- {
- itembuf[0] = '-';
- myultoa( -longval, itembuf+1, 10 );
- itembeg = itembuf;
- }
- itemlen = strlen( itembeg );
- goto move_item;
-
-unsigned_conversion: ;
- itembeg = myultoa( ulongval, itembuf, 10 );
- itemlen = strlen( itembeg );
- goto move_item;
-
-move_item: ;
- if( !width )
- width = itemlen;
-
- /* check remaining space */
- if( actual_index + width > iostrlen )
- IOEXCEPTION( TEXTFAIL, TEXT_LOC_OVERFLOW );
-
- /* move item, filling or truncating or overflow-evidencing */
- if( itemlen == width )
- memcpy( iostrptr + actual_index, itembeg, itemlen );
- else
- if( itemlen < width )
- if( leftadjust )
- memset( memcpy( iostrptr + actual_index, itembeg, itemlen )
- + itemlen,
- paddingchar, width - itemlen );
- else
- memcpy( memset( iostrptr + actual_index,
- paddingchar, width - itemlen )
- + width - itemlen,
- itembeg, itemlen );
- else
- if( overflowev )
- memset( iostrptr + actual_index, '*', width );
- else
- if( leftadjust )
- memcpy( iostrptr + actual_index, itembeg, width );
- else
- memcpy( iostrptr + actual_index,
- itembeg + itemlen - width, width );
-
- /*
- * adjust.
- */
-adjust_index: ;
- actual_index += width;
- if( actual_index > maximum_index )
- maximum_index = actual_index;
- }
-}
-
-static
-void outedit( void )
-{
- int nchars;
-
- if( dynamicwid )
- clausewidth = get_field_width();
- switch( editcode )
- {
- case SpaceSkip:
- nchars = repetition*clausewidth;
- if( actual_index + nchars > iostrlen )
- IOEXCEPTION( TEXTFAIL, TEXT_LOC_OVERFLOW );
- memset( iostrptr + actual_index, ' ', nchars );
- actual_index += nchars;
- if( actual_index > maximum_index )
- maximum_index = actual_index;
- break;
-
- case SkipLeft:
- nchars = repetition*clausewidth;
- if( actual_index - nchars < 0 )
- IOEXCEPTION( TEXTFAIL, TEXT_LOC_OVERFLOW );
- actual_index -= nchars;
- break;
-
- case SkipRight:
- nchars = repetition*clausewidth;
- if( actual_index + nchars > iostrlen )
- IOEXCEPTION( TEXTFAIL, TEXT_LOC_OVERFLOW );
- actual_index += nchars;
- if( actual_index > maximum_index )
- {
- memset( iostrptr + maximum_index, ' ', actual_index - maximum_index );
- maximum_index = actual_index;
- }
- break;
-
- case Tabulation:
- if( clausewidth >= iostrlen )
- IOEXCEPTION( TEXTFAIL, TEXT_LOC_OVERFLOW );
- actual_index = clausewidth;
- if( actual_index > maximum_index )
- {
- memset( iostrptr + maximum_index, ' ', actual_index - maximum_index );
- maximum_index = actual_index;
- }
- break;
- }
-}
-
-
-static
-void inpioctrl( void )
-{
- unsigned short hlen;
- if( !textptr )
- IOEXCEPTION( TEXTFAIL, IO_CONTROL_NOT_VALID );
- if( iocode != EndPage )
- {
- jmp_buf ioerror;
- unsigned long info;
-
- if (textptr->access_sub->association)
- {
- if( (info = setjmp( ioerror )) )
- IOEXCEPTION( info>>16, info & 0xffff );
- while( repetition-- )
- {
- __readrecord( textptr->access_sub, textindex,
- (char*)textptr->text_record,
- __FILE__, __LINE__ );
- actual_index = 0;
- MOV2(&hlen,&textptr->text_record->len);
- iostrlen = hlen;
- }
- }
- else
- IOEXCEPTION (NOTCONNECTED, IS_NOT_CONNECTED);
- }
-}
-
-/* specify pre/post in the order "/+-?!" */
-static
-char* pre_char = "\0\f\0\r\0"; /* Z.200: "\n\f\0\n\0" */
-static
-char* post_char = "\n\n\r\0\0"; /* Z.200: "\r\r\r\0\0" */
-
-static
-void outioctrl( void )
-{
- Association_Mode* assoc;
- unsigned short hlen;
- if( !textptr )
- IOEXCEPTION( TEXTFAIL, IO_CONTROL_NOT_VALID );
- if( (assoc = textptr->access_sub->association) )
- {
- jmp_buf ioerror;
- unsigned long info;
- if( (info = setjmp( ioerror )) )
- IOEXCEPTION( info>>16, info & 0xffff );
-
- while( repetition-- )
- {
- if( iocode != EndPage )
- {
- if( TEST_FLAG( assoc, IO_FIRSTLINE ) )
- {
- CLR_FLAG( assoc, IO_FIRSTLINE );
- assoc->ctl_pre = '\0';
- }
- else
- {
- if( TEST_FLAG( assoc, IO_FORCE_PAGE ) )
- {
- CLR_FLAG( assoc, IO_FORCE_PAGE );
- assoc->ctl_pre = '\f';
- }
- else
- assoc->ctl_pre = pre_char[iocode];
- }
- assoc->ctl_post = post_char[iocode];
- hlen = actual_index;
- MOV2(&textptr->text_record->len,&hlen);
- __writerecord( textptr->access_sub, textindex,
- (char*)textptr->text_record,
- textptr->text_record->len,
- __FILE__, __LINE__ );
- hlen = actual_index = 0;
- MOV2(&textptr->text_record->len,&hlen);
- }
- else if( !TEST_FLAG( textptr, IO_FIRSTLINE ) )
- SET_FLAG( textptr, IO_FORCE_PAGE );
- assoc->ctl_pre = assoc->ctl_post = '\0';
- }
- }
- else
- IOEXCEPTION (NOTCONNECTED, IS_NOT_CONNECTED);
-}
-
-static
-void (**actionptr)( void );
-static
-void (*readactions[])( void ) = { inpconv, inpedit, inpioctrl };
-static
-void (*writeactions[])( void ) = { outconv, outedit, outioctrl };
-
-
-static
-void emitstr( char* begtxt, char* endtxt )
-{
- char c;
- int nchars = endtxt - begtxt;
- if( actual_index + nchars > iostrlen )
- IOEXCEPTION( TEXTFAIL, TEXT_LOC_OVERFLOW );
- memcpy( iostrptr + actual_index, begtxt, nchars );
- actual_index += nchars;
- if( actual_index > maximum_index )
- maximum_index = actual_index;
-}
-
-static
-void scanstr( char* begtxt, char* endtxt )
-{
- int nchars = endtxt - begtxt;
- if( actual_index + nchars > iostrlen )
- IOEXCEPTION( TEXTFAIL, NO_CHARS_FOR_TEXT );
- if( strncmp( iostrptr + actual_index, begtxt, nchars ) )
- IOEXCEPTION( TEXTFAIL, FORMAT_TEXT_MISMATCH );
- actual_index += nchars;
-}
-
-void (*ftextptr) ( char*, char* );
-
-static
-formatexit_t scanformcont( char* fcs, int len,
- char** fcsptr, int* lenptr )
-{
- char curr;
- fcsstate_t state = FormatText;
- unsigned long buf;
- int dig;
- acttype_t action;
- char* begtxt = fcs;
-
- while( len-- )
- {
- curr = *fcs++;
- switch( state )
- {
- case FormatText:
- if( curr == '%' )
- {
- ftextptr( begtxt, fcs-1 );
- state = FirstPercent;
- }
- break;
-
-after_first_percent: ;
- case FirstPercent:
- if( curr == '%' )
- {
- state = FormatText;
- begtxt = fcs - 1;
- break;
- }
- if( curr == ')' )
- {
- *lenptr = len;
- *fcsptr = fcs;
- return EndAtParen;
- }
- if( isDEC(curr) )
- {
- state = RepFact;
- repetition = curr - '0';
- break;
- }
-
- repetition = 1;
-
-test_for_control_codes: ;
- if( isCVC(curr) )
- {
- state = ConvClause;
- action = ConvAct;
- convcode = strchr( CONVERSIONCODES, curr ) - CONVERSIONCODES;
- leftadjust = False;
- overflowev = False;
- dynamicwid = False;
- paddingdef = False;
- paddingchar = ' ';
- fractiondef = False;
- /* fractionwidth = 0; default depends on mode ! */
- exponentdef = False;
- exponentwidth = 3;
- clausewidth = 0;
- break;
- }
- if( isEDC(curr) )
- {
- state = EditClause;
- action = EditAct;
- editcode = strchr( EDITCODES, curr ) - EDITCODES;
- dynamicwid = False;
- clausewidth = editcode == Tabulation ? 0 : 1;
- break;
- }
- if( isIOC(curr) )
- {
- state = ClauseEnd;
- action = IOAct;
- iocode = strchr( IOCODES, curr ) - IOCODES;
- break;
- }
- if( curr == '(' )
- {
- unsigned long times = repetition;
- int cntlen;
- char* cntfcs;
- while( times-- )
- {
- if( scanformcont( fcs, len, &cntfcs, &cntlen ) != EndAtParen )
- IOEXCEPTION( TEXTFAIL, UNMATCHED_OPENING_PAREN );
- }
- fcs = cntfcs;
- len = cntlen;
- state = FormatText;
- begtxt = fcs;
- break;
- }
- IOEXCEPTION( TEXTFAIL, BAD_FORMAT_SPEC_CHAR );
-
- case RepFact:
- if( isDEC(curr) )
- {
- dig = curr - '0';
- if( repetition > (ULONG_MAX - dig)/10 )
- IOEXCEPTION( TEXTFAIL, REPFAC_OVERFLOW );
- repetition = repetition*10 + dig;
- break;
- }
- goto test_for_control_codes;
-
- case ConvClause:
- if( isDEC(curr) )
- {
- state = ClauseWidth;
- clausewidth = curr - '0';
- break;
- }
- if( curr == 'L' )
- {
- if( leftadjust )
- IOEXCEPTION( TEXTFAIL, DUPLICATE_QUALIFIER );
- leftadjust = True;
- break;
- }
- if( curr == 'E' )
- {
- if( overflowev )
- IOEXCEPTION( TEXTFAIL, DUPLICATE_QUALIFIER );
- overflowev = True;
- break;
- }
- if( curr == 'P' )
- {
- if( paddingdef )
- IOEXCEPTION( TEXTFAIL, DUPLICATE_QUALIFIER );
- paddingdef = True;
- state = CatchPadding;
- break;
- }
-
-test_for_variable_width: ;
- if( curr == 'V' )
- {
- dynamicwid = True;
- state = AfterWidth;
- break;
- }
- goto test_for_fraction_width;
-
- case ClauseWidth:
- if( isDEC(curr) )
- {
- dig = curr - '0';
- if( clausewidth > (ULONG_MAX - dig)/10 )
- IOEXCEPTION( TEXTFAIL, CLAUSE_WIDTH_OVERFLOW );
- clausewidth = clausewidth*10 + dig;
- break;
- }
- /* fall through */
-
-test_for_fraction_width: ;
- case AfterWidth:
- if( curr == '.' )
- {
- if( convcode != DefaultConv && convcode != ScientConv )
- IOEXCEPTION( TEXTFAIL, NO_FRACTION );
- fractiondef = True;
- state = FractWidth;
- break;
- }
- goto test_for_exponent_width;
-
- case FractWidth:
- if( isDEC( curr ) )
- {
- state = FractWidthCont;
- fractionwidth = curr - '0';
- break;
- }
- else
- IOEXCEPTION( TEXTFAIL, NO_FRACTION_WIDTH );
-
- case FractWidthCont:
- if( isDEC( curr ) )
- {
- dig = curr - '0';
- if( fractionwidth > (ULONG_MAX - dig)/10 )
- IOEXCEPTION( TEXTFAIL, FRACTION_WIDTH_OVERFLOW );
- fractionwidth = fractionwidth*10 + dig;
- break;
- }
-
-test_for_exponent_width: ;
- if( curr == ':' )
- {
- if( convcode != ScientConv )
- IOEXCEPTION( TEXTFAIL, NO_EXPONENT );
- exponentdef = True;
- state = ExpoWidth;
- break;
- }
- goto test_for_final_percent;
-
- case ExpoWidth:
- if( isDEC( curr ) )
- {
- state = ExpoWidthCont;
- exponentwidth = curr - '0';
- break;
- }
- else
- IOEXCEPTION( TEXTFAIL, NO_EXPONENT_WIDTH );
-
- case ExpoWidthCont:
- if( isDEC( curr ) )
- {
- dig = curr - '0';
- if( exponentwidth > (ULONG_MAX - dig)/10 )
- IOEXCEPTION( TEXTFAIL, EXPONENT_WIDTH_OVERFLOW );
- exponentwidth = exponentwidth*10 + dig;
- break;
- }
- /* fall through */
-
-test_for_final_percent: ;
- case ClauseEnd:
- if( curr == '%' )
- {
- state = LastPercent;
- break;
- }
-
- do_the_action: ;
- actionptr[action]();
- state = FormatText;
- begtxt = fcs - 1;
- break;
-
- case CatchPadding:
- paddingchar = curr;
- state = ConvClause;
- break;
-
- case EditClause:
- if( isDEC(curr) )
- {
- state = ClauseWidth;
- clausewidth = curr - '0';
- break;
- }
- goto test_for_variable_width;
-
- case LastPercent:
- actionptr[action]();
- if( curr == '.' )
- {
- state = FormatText;
- begtxt = fcs;
- break;
- }
- goto after_first_percent;
-
- default:
- IOEXCEPTION( TEXTFAIL, INTERNAL_ERROR );
- }
- }
- switch( state )
- {
- case FormatText:
- ftextptr( begtxt, fcs );
- break;
- case FirstPercent:
- case LastPercent:
- case RepFact:
- case FractWidth:
- case ExpoWidth:
- IOEXCEPTION( TEXTFAIL, BAD_FORMAT_SPEC_CHAR );
- case CatchPadding:
- IOEXCEPTION( TEXTFAIL, NO_PAD_CHAR );
- default:
- actionptr[action]();
- }
-
- *lenptr = len;
- *fcsptr = fcs;
- return NormalEnd;
-}
-
-static
-void
-__read_format (char* fmtptr,
- int fmtlen,
- __tmp_IO_list* ioptr,
- int iolen,
- void* inpptr,
- int inplen )
-{
- formatexit_t res;
- unsigned short l;
-
- iostrptr = (char*)inpptr;
- iostrlen = inplen;
-
- /* initialisation */
- iolist_index = 0;
- iolistptr = ioptr;
- iolistlen = iolen;
-
- actionptr = readactions;
- ftextptr = scanstr;
-
- if( (res = scanformcont( fmtptr, fmtlen, &fmtptr, &fmtlen )) == EndAtParen )
- IOEXCEPTION( TEXTFAIL, UNMATCHED_CLOSING_PAREN );
-
- if( iolist_index != iolen )
- IOEXCEPTION( TEXTFAIL, EXCESS_IOLIST_ELEMENTS );
-
- return;
-}
-
-void
-__readtext_f( Text_Mode* the_text_loc,
- signed long the_index,
- char* fmtptr,
- int fmtlen,
- __tmp_IO_list* ioptr,
- int iolen,
- char* file,
- int line )
-{
- unsigned long info;
-
- if( (info = setjmp( __io_exception )) )
- CHILLEXCEPTION( file, line, info>>16, info & 0xffff );
-
- textptr = the_text_loc;
- textrecptr = textptr->text_record;
- actual_index = textptr->actual_index;
- textindex = the_index;
-
- __read_format ( fmtptr, fmtlen, ioptr, iolen,
- (char*)textrecptr + 2, textptr->text_record->len );
- textptr->actual_index = actual_index;
-}
-
-void
-__readtext_s( void* string_ptr,
- int string_len,
- char* fmtptr,
- int fmtlen,
- __tmp_IO_list* ioptr,
- int iolen,
- char* file,
- int line )
-{
- int info;
-
- if( (info = setjmp( __io_exception )) )
- CHILLEXCEPTION( file, line, info>>16, info & 0xffff );
-
- textptr = NULL;
- actual_index = 0;
-
- __read_format ( fmtptr, fmtlen, ioptr, iolen, string_ptr, string_len );
-}
-
-static
-void
-__write_format (char* fmtptr,
- int fmtlen,
- __tmp_IO_list* ioptr,
- int iolen,
- void* outptr,
- int outlen )
-{
- formatexit_t res;
- unsigned short l;
-
- /* initialisation */
- maximum_index = actual_index;
- iolist_index = 0;
-
- actionptr = writeactions;
- ftextptr = emitstr;
- iolistptr = ioptr;
- iolistlen = iolen;
- iostrptr = (char *)outptr + 2;
- iostrlen = outlen;
-
- if( (res = scanformcont( fmtptr, fmtlen, &fmtptr, &fmtlen )) == EndAtParen )
- IOEXCEPTION( TEXTFAIL, UNMATCHED_CLOSING_PAREN );
-
- if( iolist_index != iolen )
- IOEXCEPTION( TEXTFAIL, EXCESS_IOLIST_ELEMENTS );
-
- /* set length of output string */
-#if _TEXTIO_DEBUG_
- printf( "maximum index = %d\n", maximum_index );
-#endif
- l = maximum_index;
- MOV2(outptr,&l);
- return;
-}
-
-void
-__writetext_f( Text_Mode* the_text_loc,
- signed long the_index,
- char* fmtptr,
- int fmtlen,
- __tmp_IO_list* ioptr,
- int iolen,
- char* file,
- int line )
-{
- int info;
-
- if( (info = setjmp( __io_exception )) )
- CHILLEXCEPTION( file, line, info>>16, info & 0xffff );
-
- textptr = the_text_loc;
- textrecptr = the_text_loc->text_record;
- textindex = the_index;
- iolistptr = ioptr;
- iolistlen = iolen;
-
- actual_index = textptr->actual_index;
- __write_format ( fmtptr, fmtlen, ioptr, iolen,
- textrecptr, textptr->access_sub->reclength - 2 );
- textptr->actual_index = actual_index;
-}
-
-void
-__writetext_s( void* string_ptr,
- int string_len,
- char* fmtptr,
- int fmtlen,
- __tmp_IO_list* ioptr,
- int iolen,
- char* file,
- int line )
-{
- int info;
-
- if( (info = setjmp( __io_exception )) )
- CHILLEXCEPTION( file, line, info>>16, info & 0xffff );
-
- textptr = NULL;
- actual_index = 0;
-
- __write_format ( fmtptr, fmtlen, ioptr, iolen, string_ptr, string_len );
-}
diff --git a/libchill/format.h b/libchill/format.h
deleted file mode 100644
index d70cfaa79b7..00000000000
--- a/libchill/format.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/* Implement Input/Output runtime actions for CHILL.
- Copyright (C) 1992,1993 Free Software Foundation, Inc.
- Author: Wilfried Moser, et al
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with other files,
- some of which are compiled with GCC, to produce an executable,
- this library 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. */
-
-#ifndef _format_h_
-#define _format_h_
-
-#include "iomodes.h"
-#include "fileio.h"
-
-extern Text_Mode __stdin_text;
-extern Text_Mode __stdout_text;
-extern Text_Mode __stderr_text;
-
-void
-__readtext_f( Text_Mode* TextLoc,
- signed long Index,
- char* fmtptr,
- int fmtlen,
- __tmp_IO_list* ioptr,
- int iolen,
- char* file,
- int line );
-
-void
-__readtext_s( void* string_ptr,
- int string_len,
- char* fmtptr,
- int fmtlen,
- __tmp_IO_list* ioptr,
- int iolen,
- char* file,
- int line );
-
-void
-__writetext_f( Text_Mode* Text_Loc,
- signed long Index,
- char* fmtptr,
- int fmtlen,
- __tmp_IO_list* ioptr,
- int iolen,
- char* file,
- int line );
-
-void
-__writetext_s( void* string_ptr,
- int string_len,
- char* fmtptr,
- int fmtlen,
- __tmp_IO_list* ioptr,
- int iolen,
- char* file,
- int line );
-
-#endif _format_h_
diff --git a/libchill/getassoc.c b/libchill/getassoc.c
deleted file mode 100644
index 47ee5154f5c..00000000000
--- a/libchill/getassoc.c
+++ /dev/null
@@ -1,45 +0,0 @@
-/* Implement Input/Output runtime actions for CHILL.
- Copyright (C) 1992,1993 Free Software Foundation, Inc.
- Author: Wilfried Moser, et al
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with other files,
- some of which are compiled with GCC, to produce an executable,
- this library 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. */
-
-#include "fileio.h"
-
-Association_Mode*
-__getassociation( void* the_transfer, char* file, int line )
-{
- Access_Mode* the_access;
-
- if( !the_transfer )
- CHILLEXCEPTION( file, line, EMPTY, NULL_ACCESS );
-
- if( TEST_FLAG((Text_Mode*)the_transfer, IO_TEXTLOCATION ))
- the_access = ((Text_Mode*)the_transfer)->access_sub;
- else
- the_access = (Access_Mode*)the_transfer;
-
- return the_access->association;
-}
diff --git a/libchill/gettextaccess.c b/libchill/gettextaccess.c
deleted file mode 100644
index 7094e2bcae4..00000000000
--- a/libchill/gettextaccess.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/* Implement Input/Output runtime actions for CHILL.
- Copyright (C) 1992,1993 Free Software Foundation, Inc.
- Author: Wilfried Moser, et al
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with other files,
- some of which are compiled with GCC, to produce an executable,
- this library 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. */
-
-#include "fileio.h"
-
-Access_Mode*
-__gettextaccess( Text_Mode* the_text, char* file, int line )
-{
- if( !the_text )
- CHILLEXCEPTION( file, line, EMPTY, NULL_TEXT );
-
- return the_text->access_sub;
-}
-
diff --git a/libchill/gettextindex.c b/libchill/gettextindex.c
deleted file mode 100644
index f6f442b9c36..00000000000
--- a/libchill/gettextindex.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/* Implement Input/Output runtime actions for CHILL.
- Copyright (C) 1992,1993 Free Software Foundation, Inc.
- Author: Wilfried Moser, et al
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with other files,
- some of which are compiled with GCC, to produce an executable,
- this library 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. */
-
-#include "fileio.h"
-
-unsigned long
-__gettextindex( Text_Mode* the_text, char* file, int line )
-{
- if( !the_text )
- CHILLEXCEPTION( file, line, EMPTY, NULL_TEXT );
-
- return the_text->actual_index;
-}
diff --git a/libchill/gettextrecord.c b/libchill/gettextrecord.c
deleted file mode 100644
index 00c9af7e4dc..00000000000
--- a/libchill/gettextrecord.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/* Implement Input/Output runtime actions for CHILL.
- Copyright (C) 1992,1993 Free Software Foundation, Inc.
- Author: Wilfried Moser, et al
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with other files,
- some of which are compiled with GCC, to produce an executable,
- this library 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. */
-
-#include "fileio.h"
-
-VarString*
-__gettextrecord( Text_Mode* the_text, char* file, int line )
-{
- if( !the_text )
- CHILLEXCEPTION( file, line, EMPTY, NULL_TEXT );
-
- return the_text->text_record;
-}
diff --git a/libchill/getusage.c b/libchill/getusage.c
deleted file mode 100644
index f1feb5c8e8d..00000000000
--- a/libchill/getusage.c
+++ /dev/null
@@ -1,48 +0,0 @@
-/* Implement Input/Output runtime actions for CHILL.
- Copyright (C) 1992,1993 Free Software Foundation, Inc.
- Author: Wilfried Moser, et al
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with other files,
- some of which are compiled with GCC, to produce an executable,
- this library 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. */
-
-#include "fileio.h"
-
-Usage_Mode
-__getusage( void* the_transfer, char* file, int line )
-{
- Access_Mode* the_access;
-
- if( !the_transfer )
- CHILLEXCEPTION( file, line, EMPTY, NULL_ACCESS );
-
- if( TEST_FLAG((Text_Mode*)the_transfer, IO_TEXTLOCATION ))
- the_access = ((Text_Mode*)the_transfer)->access_sub;
- else
- the_access = (Access_Mode*)the_transfer;
-
- if( !the_access->association )
- CHILLEXCEPTION( file, line, NOTCONNECTED, IS_NOT_CONNECTED );
- return the_access->association->usage;
-}
-
diff --git a/libchill/inbitstr.c b/libchill/inbitstr.c
deleted file mode 100644
index 2d776ac4f35..00000000000
--- a/libchill/inbitstr.c
+++ /dev/null
@@ -1,81 +0,0 @@
-/* Implement POWERSET runtime actions for CHILL.
- Copyright (C) 1992,1993 Free Software Foundation, Inc.
- Author: Wilfried Moser, et al
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with other files,
- some of which are compiled with GCC, to produce an executable,
- this library 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. */
-
-#define __CHILL_LIB__
-
-#include <stdio.h>
-#include "powerset.h"
-
-extern void __cause_ex1 (char *exname, char *file, int lineno);
-
-/*
- * function __inbitstring
- *
- * parameters:
- * bitno bit number within set
- * powerset the powerset
- * bitlength length of powerset in bits
- * minval number of lowest bit stored
- * fname filename of caller
- * lineno linenumber of caller
- *
- * returns:
- * int 1 .. found
- * 0 .. not found
- *
- * exceptions:
- * rangefail
- *
- * abstract:
- * checks if a given value is included in a bitstring
- *
- */
-int
-__inbitstring (bitno, powerset, bitlength, minval, fname, lineno)
- unsigned long bitno;
- SET_WORD *powerset;
- unsigned long bitlength;
- long minval;
- char *fname;
- int lineno;
-
-{
- if (powerset == NULL
- || bitno < minval
- || (bitno - minval) >= bitlength)
- __cause_ex1 ("rangefail", fname, lineno);
-
- bitno -= minval;
- if (bitlength <= SET_CHAR_SIZE)
- return GET_BIT_IN_CHAR (*((SET_CHAR *)powerset), bitno);
- else if (bitlength <= SET_SHORT_SIZE)
- return GET_BIT_IN_SHORT (*((SET_SHORT *)powerset), bitno);
- else
- return GET_BIT_IN_WORD (powerset[bitno / SET_WORD_SIZE],
- bitno % SET_WORD_SIZE);
-}
diff --git a/libchill/indexable.c b/libchill/indexable.c
deleted file mode 100644
index 20cd7100f82..00000000000
--- a/libchill/indexable.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/* Implement Input/Output runtime actions for CHILL.
- Copyright (C) 1992,1993 Free Software Foundation, Inc.
- Author: Wilfried Moser, et al
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with other files,
- some of which are compiled with GCC, to produce an executable,
- this library 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. */
-
-#include "fileio.h"
-
-Boolean
-__indexable( Association_Mode* the_assoc, char* file, int line )
-{
- if( !the_assoc )
- CHILLEXCEPTION( file, line, EMPTY, NULL_ASSOCIATION );
- if( !TEST_FLAG(the_assoc, IO_ISASSOCIATED) )
- CHILLEXCEPTION( file, line, NOTASSOCIATED, IS_NOT_ASSOCIATED );
- return TEST_FLAG(the_assoc, IO_INDEXABLE) ? True : False;
-}
diff --git a/libchill/inps.c b/libchill/inps.c
deleted file mode 100644
index d412b23d940..00000000000
--- a/libchill/inps.c
+++ /dev/null
@@ -1,72 +0,0 @@
-/* Implement POWERSET runtime actions for CHILL.
- Copyright (C) 1992,1993 Free Software Foundation, Inc.
- Author: Wilfried Moser, et al
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with other files,
- some of which are compiled with GCC, to produce an executable,
- this library 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. */
-
-#define __CHILL_LIB__
-
-#include <stdio.h>
-#include "powerset.h"
-
-/*
- * function __inpowerset
- *
- * parameters:
- * bitno bit number within set
- * powerset the powerset
- * bitlength length of powerset in bits
- * minval number of lowest bit stored
- *
- * returns:
- * int 1 .. found
- * 0 .. not found
- *
- * exceptions:
- * rangefail
- *
- * abstract:
- * checks if a given value is included in a powerset
- *
- */
-int
-__inpowerset (bitno, powerset, bitlength, minval)
- unsigned long bitno;
- SET_WORD *powerset;
- unsigned long bitlength;
- long minval;
-{
- if (bitno < minval || (bitno - minval) >= bitlength)
- return 0;
-
- bitno -= minval;
- if (bitlength <= SET_CHAR_SIZE)
- return GET_BIT_IN_CHAR (*((SET_CHAR *)powerset), bitno);
- else if (bitlength <= SET_SHORT_SIZE)
- return GET_BIT_IN_SHORT (*((SET_SHORT *)powerset), bitno);
- else
- return GET_BIT_IN_WORD (powerset[bitno / SET_WORD_SIZE],
- bitno % SET_WORD_SIZE);
-}
diff --git a/libchill/inttime.c b/libchill/inttime.c
deleted file mode 100644
index 7cd10f52d0b..00000000000
--- a/libchill/inttime.c
+++ /dev/null
@@ -1,93 +0,0 @@
-/* Implement timing-related runtime actions for CHILL.
- Copyright (C) 1992,1993 Free Software Foundation, Inc.
- Author: Wilfried Moser
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with other files,
- some of which are compiled with GCC, to produce an executable,
- this library 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. */
-
-#include <time.h>
-
-typedef struct
-{
- void *p;
- unsigned long len;
-} Descr;
-
-typedef Descr **Toutlist;
-
-#define ASSIGN_VALUE(OUT,VAL) \
-do \
-{ \
- if (OUT) \
- switch (OUT->len) \
- { \
- case 1: \
- *(char *)((OUT)->p) = VAL; \
- break; \
- case 2: \
- *(short *)((OUT)->p) = VAL; \
- break; \
- case 4: \
- *(int *)((OUT)->p) = VAL; \
- break; \
- } \
-} while (0)
-
-
-/*
- * function _inttime
- *
- * parameters:
- * t time_t
- * list the pointers to the results
- *
- * returns:
- * void
- *
- * exceptions:
- * none
- *
- * abstract:
- * perform the INTTIME builtin call
- *
- */
-
-void
-_inttime (timer, outlist)
- time_t timer;
- Toutlist outlist;
-{
- struct tm *time_str;
-
- /* get struct tm from time_t */
- time_str = localtime (&timer);
-
- /* assign the values */
- ASSIGN_VALUE (outlist[0], time_str->tm_year + 1900);
- ASSIGN_VALUE (outlist[1], time_str->tm_mon + 1);
- ASSIGN_VALUE (outlist[2], time_str->tm_mday);
- ASSIGN_VALUE (outlist[3], time_str->tm_hour);
- ASSIGN_VALUE (outlist[4], time_str->tm_min);
- ASSIGN_VALUE (outlist[5], time_str->tm_sec);
-}
diff --git a/libchill/ioerror.c b/libchill/ioerror.c
deleted file mode 100644
index 7c9257d16ec..00000000000
--- a/libchill/ioerror.c
+++ /dev/null
@@ -1,53 +0,0 @@
-/* Implement Input/Output runtime actions for CHILL.
- Copyright (C) 1992,1993 Free Software Foundation, Inc.
- Author: Wilfried Moser, et al
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with other files,
- some of which are compiled with GCC, to produce an executable,
- this library 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. */
-
-#include <setjmp.h>
-
-/* define names of IO-exceptions */
-
-char * __IO_exception_names[] =
-{
- "UNUSED",
- "notassociated",
- "associatefail",
- "createfail",
- "deletefail",
- "modifyfail",
- "connectfail",
- "notconnected",
- "empty",
- "rangefail",
- "spacefail",
- "readfail",
- "writefail",
- "textfail",
-};
-
-jmp_buf __io_exception;
-
-jmp_buf __rw_exception;
diff --git a/libchill/ioerror.h b/libchill/ioerror.h
deleted file mode 100644
index 40842173424..00000000000
--- a/libchill/ioerror.h
+++ /dev/null
@@ -1,169 +0,0 @@
-/* Implement Input/Output runtime actions for CHILL.
- Copyright (C) 1992,1993 Free Software Foundation, Inc.
- Author: Wilfried Moser, et al
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with other files,
- some of which are compiled with GCC, to produce an executable,
- this library 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. */
-
-#ifndef _ioerror_h_
-#define _ioerror_h_
-
-#include <setjmp.h>
-
-/* Note: numbers must be in the same order as
- strings in ioerror.c */
-typedef enum
-{ NOTASSOCIATED = 1,
- ASSOCIATEFAIL,
- CREATEFAIL,
- DELETEFAIL,
- MODIFYFAIL,
- CONNECTFAIL,
- NOTCONNECTED,
- EMPTY,
- RANGEFAIL,
- SPACEFAIL,
- READFAIL,
- WRITEFAIL,
- TEXTFAIL
-} io_exceptions_t;
-
-#ifndef FIRST_IO_ERROR_NUMBER
-#define FIRST_IO_ERROR_NUMBER 0
-#endif
-
-typedef enum {
- FIRST_AND_UNUSED = FIRST_IO_ERROR_NUMBER,
- INTERNAL_ERROR,
- INVALID_IO_LIST,
- REPFAC_OVERFLOW,
- CLAUSE_WIDTH_OVERFLOW,
- UNMATCHED_CLOSING_PAREN,
- UNMATCHED_OPENING_PAREN,
- BAD_FORMAT_SPEC_CHAR,
- NO_PAD_CHAR,
- IO_CONTROL_NOT_VALID,
- DUPLICATE_QUALIFIER,
- NO_FRACTION_WIDTH,
- NO_EXPONENT_WIDTH,
- FRACTION_WIDTH_OVERFLOW,
- EXPONENT_WIDTH_OVERFLOW,
- NO_FRACTION,
- NO_EXPONENT,
- NEGATIVE_FIELD_WIDTH,
- TEXT_LOC_OVERFLOW,
- IOLIST_EXHAUSTED,
- CONVCODE_MODE_MISFIT,
- SET_CONVERSION_ERROR,
- BOOL_CONVERSION_ERROR,
- NON_INT_FIELD_WIDTH,
- EXCESS_IOLIST_ELEMENTS,
- NOT_ENOUGH_CHARS,
- NO_CHARS_FOR_INT,
- NO_CHARS_FOR_FLOAT,
- NO_EXPONENT_VAL,
- INT_VAL_OVERFLOW,
- REAL_OVERFLOW,
- NO_DIGITS_FOR_INT,
- NO_DIGITS_FOR_FLOAT,
- NO_CHARS_FOR_SET,
- NO_CHARS_FOR_CHAR,
- NO_CHARS_FOR_BOOLS,
- NO_CHARS_FOR_CHARS,
- NO_CHARS_FOR_TEXT,
- NO_CHARS_FOR_EDIT,
- NO_SPACE_TO_SKIP,
- FORMAT_TEXT_MISMATCH,
- INTEGER_RANGE_ERROR,
- SET_RANGE_ERROR,
- CHAR_RANGE_ERROR,
- INVALID_CHAR,
-/* end of formatting errors */
- NULL_ASSOCIATION,
- NULL_ACCESS,
- NULL_TEXT,
- IS_NOT_ASSOCIATED,
- IS_ASSOCIATED,
- GETCWD_FAILS,
- INVALID_ASSOCIATION_MODE,
- FILE_EXISTING,
- CREATE_FAILS,
- DELETE_FAILS,
- RENAME_FAILS,
- IMPL_RESTRICTION,
- NOT_EXISTING,
- NOT_READABLE,
- NOT_WRITEABLE,
- NOT_INDEXABLE,
- NOT_SEQUENCIBLE,
- NO_CURRENT_POS,
- NOT_VARIABLE,
- NOT_FIXED,
- NOT_INDEXED,
- LENGTH_CHANGE,
- LSEEK_FAILS,
- BUFFER_ALLOC,
- OPEN_FAILS,
- NO_ACCESS_SUBLOCATION,
- BAD_INDEX,
- IS_NOT_CONNECTED,
- NO_PATH_NAME,
- PATHNAME_ALLOC,
- BAD_USAGE,
- OUT_OF_FILE,
- NULL_STORE_LOC,
- STORE_LOC_ALLOC,
- OS_IO_ERROR,
- RECORD_TOO_LONG,
- RECORD_TOO_SHORT,
- BAD_TEXTINDEX,
- NULL_TEXTREC
-} io_info_word_t;
-
-
-extern
-char* io_info_text [];
-
-extern
-char* exc_text [];
-
-extern
-jmp_buf __io_exception;
-
-extern
-jmp_buf __rw_exception;
-
-void __cause_exception (char *ex, char* f, int line, int info);
-extern char * __IO_exception_names[];
-
-#define IOEXCEPTION(EXC,INFO) \
- longjmp( __io_exception, (EXC<<16) + INFO )
-
-#define RWEXCEPTION(EXC,INFO) \
- longjmp( __rw_exception, (EXC<<16) + INFO )
-
-#define CHILLEXCEPTION(FILE,LINE,EXC,INFO) \
- __cause_exception (__IO_exception_names[EXC], FILE, LINE, INFO);
-
-#endif
diff --git a/libchill/iomodes.h b/libchill/iomodes.h
deleted file mode 100644
index 05927e3c102..00000000000
--- a/libchill/iomodes.h
+++ /dev/null
@@ -1,259 +0,0 @@
-/* Implement Input/Output runtime actions for CHILL.
- Copyright (C) 1992,1993 Free Software Foundation, Inc.
- Author: Wilfried Moser, et al
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with other files,
- some of which are compiled with GCC, to produce an executable,
- this library 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. */
-
-#ifndef _iomodes_h_
-#define _iomodes_h_
-
-#include "auxtypes.h"
-
-typedef enum { ReadOnly, WriteOnly, ReadWrite
-} Usage_Mode;
-
-typedef enum { First, Same, Last
-} Where_Mode;
-
-typedef enum { None, Fixed, VaryingChars
-} Record_t;
-
-/* association flags */
-#define IO_ISASSOCIATED 0x00000001
-#define IO_EXISTING 0x00000002
-#define IO_READABLE 0x00000004
-#define IO_WRITEABLE 0x00000008
-#define IO_INDEXABLE 0x00000010
-#define IO_SEQUENCIBLE 0x00000020
-#define IO_VARIABLE 0x00000040
-#define IO_FIRSTLINE 0x00000100
-#define IO_FORCE_PAGE 0x00000200
-
-struct Access_Mode;
-
-#define READBUFLEN 512
-typedef struct
-{
- unsigned long len;
- unsigned long cur;
- char buf[READBUFLEN];
-} readbuf_t;
-
-typedef struct Association_Mode {
- unsigned long flags; /* INIT = 0 */
- char* pathname;
- struct Access_Mode* access;
- int handle;
- readbuf_t* bufptr;
- long syserrno;
- char usage;
- char ctl_pre;
- char ctl_post;
-} Association_Mode;
-
-/*
- rectype indexed max. reclength act. reclength
- ---------------------------------------------------
- None T/F 0
- Fixed T/F SIZE(recmode) = SIZE(recmode)
- Varying F SIZE(recmode) >= length
-*/
-
-/* access/text flags */
-#define IO_TEXTLOCATION 0x80000000
-#define IO_INDEXED 0x00000001
-#define IO_TEXTIO 0x00000002
-#define IO_OUTOFFILE 0x00010000
-
-typedef struct Access_Mode {
- unsigned long flags; /* INIT */
- unsigned long reclength; /* INIT */
- signed long lowindex; /* INIT */
- signed long highindex; /* INIT */
- Association_Mode* association;
- unsigned long base;
- char* store_loc;
- Record_t rectype; /* INIT */
-} Access_Mode;
-
-typedef struct Text_Mode {
- unsigned long flags; /* INIT */
- VarString* text_record; /* INIT */
- Access_Mode* access_sub; /* INIT */
- unsigned long actual_index;
-} Text_Mode;
-
-typedef enum
-{
- __IO_UNUSED,
-
- __IO_ByteVal,
- __IO_UByteVal,
- __IO_IntVal,
- __IO_UIntVal,
- __IO_LongVal,
- __IO_ULongVal,
-
- __IO_ByteLoc,
- __IO_UByteLoc,
- __IO_IntLoc,
- __IO_UIntLoc,
- __IO_LongLoc,
- __IO_ULongLoc,
-
- __IO_ByteRangeLoc,
- __IO_UByteRangeLoc,
- __IO_IntRangeLoc,
- __IO_UIntRangeLoc,
- __IO_LongRangeLoc,
- __IO_ULongRangeLoc,
-
- __IO_BoolVal,
- __IO_BoolLoc,
- __IO_BoolRangeLoc,
-
- __IO_SetVal,
- __IO_SetLoc,
- __IO_SetRangeLoc,
-
- __IO_CharVal,
- __IO_CharLoc,
- __IO_CharRangeLoc,
-
- __IO_CharStrLoc,
-
- __IO_CharVaryingLoc,
-
- __IO_BitStrLoc,
-
- __IO_RealVal,
- __IO_RealLoc,
- __IO_LongRealVal,
- __IO_LongRealLoc
-} __tmp_IO_enum;
-
-typedef struct
-{
- long value;
- char* name;
-} __tmp_IO_enum_table_type;
-
-typedef struct
-{
- long value;
- __tmp_IO_enum_table_type* name_table;
-} __tmp_WIO_set;
-
-typedef struct
-{
- char* ptr;
- long lower;
- long upper;
-} __tmp_IO_charrange;
-
-typedef union
-{
- signed long slong;
- unsigned long ulong;
-} __tmp_IO_long;
-
-typedef struct
-{
- void* ptr;
- __tmp_IO_long lower;
- __tmp_IO_long upper;
-} __tmp_IO_intrange;
-
-typedef struct
-{
- void* ptr;
- unsigned long lower;
- unsigned long upper;
-} __tmp_RIO_boolrange;
-
-typedef struct
-{
- void* ptr;
- long length;
- __tmp_IO_enum_table_type* name_table;
-} __tmp_RIO_set;
-
-typedef struct
-{
- void* ptr;
- long length;
- __tmp_IO_enum_table_type* name_table;
- unsigned long lower;
- unsigned long upper;
-} __tmp_RIO_setrange;
-
-typedef struct
-{
- char* string;
- long string_length;
-} __tmp_IO_charstring;
-
-typedef union
-{
- char __valbyte;
- unsigned char __valubyte;
- short __valint;
- unsigned short __valuint;
- long __vallong;
- unsigned long __valulong;
- void* __locint;
- __tmp_IO_intrange __locintrange;
-
- unsigned char __valbool;
- unsigned char* __locbool;
- __tmp_RIO_boolrange __locboolrange;
-
- __tmp_WIO_set __valset;
- __tmp_RIO_set __locset;
- __tmp_RIO_setrange __locsetrange;
-
- unsigned char __valchar;
- unsigned char* __locchar;
- __tmp_IO_charrange __loccharrange;
-
- __tmp_IO_charstring __loccharstring;
-
- float __valreal;
- float* __locreal;
- double __vallongreal;
- double* __loclongreal;
-} __tmp_IO_union;
-
-/*
- * CAUTION: The longest variant of __tmp_IO_union is 5 words long.
- * Together with __descr this caters for double alignment where required.
- */
-typedef struct
-{
- __tmp_IO_union __t;
- __tmp_IO_enum __descr;
-} __tmp_IO_list;
-
-#endif
diff --git a/libchill/isassociated.c b/libchill/isassociated.c
deleted file mode 100644
index 0df0fa87c26..00000000000
--- a/libchill/isassociated.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/* Implement Input/Output runtime actions for CHILL.
- Copyright (C) 1992,1993 Free Software Foundation, Inc.
- Author: Wilfried Moser, et al
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with other files,
- some of which are compiled with GCC, to produce an executable,
- this library 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. */
-
-#include "fileio.h"
-
-Boolean
-__isassociated( Association_Mode* the_assoc, char* file, int line )
-{
- if( !the_assoc )
- CHILLEXCEPTION( file, line, EMPTY, NULL_ASSOCIATION );
- return TEST_FLAG(the_assoc, IO_ISASSOCIATED) ? True : False;
-}
diff --git a/libchill/leps.c b/libchill/leps.c
deleted file mode 100644
index cbe499ab58d..00000000000
--- a/libchill/leps.c
+++ /dev/null
@@ -1,83 +0,0 @@
-/* Implement POWERSET runtime actions for CHILL.
- Copyright (C) 1992,1993 Free Software Foundation, Inc.
- Author: Wilfried Moser, et al
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with other files,
- some of which are compiled with GCC, to produce an executable,
- this library 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. */
-
-#define __CHILL_LIB__
-
-#include <stdio.h>
-#include "powerset.h"
-
-/*
- * function __lepowerset
- *
- * parameters:
- * left powerset
- * right powerset
- * bitlength length of powerset
- *
- * returns:
- * int 1 .. left is included in right
- * 0 .. not
- *
- * abstract:
- * check if one powerset is included in another
- *
- */
-int
-__lepowerset (left, right, bitlength)
- SET_WORD *left;
- SET_WORD *right;
- unsigned long bitlength;
-{
- if (bitlength <= SET_CHAR_SIZE)
- {
- if ((*((SET_CHAR *)left) & *((SET_CHAR *)right))
- != *((SET_CHAR *)left))
- return 0;
- return 1;
- }
- else if (bitlength <= SET_SHORT_SIZE)
- {
- if ((*((SET_SHORT *)left) & *((SET_SHORT *)right))
- != *((SET_SHORT *)left))
- return 0;
- return 1;
- }
- else
- {
- SET_WORD *endp = left + BITS_TO_WORDS(bitlength);
-
- while (left < endp)
- {
- if ((*right & *left) != *left)
- return 0;
- left++;
- right++;
- }
- return 1;
- }
-}
diff --git a/libchill/ltps.c b/libchill/ltps.c
deleted file mode 100644
index c08c884d6c0..00000000000
--- a/libchill/ltps.c
+++ /dev/null
@@ -1,93 +0,0 @@
-/* Implement POWERSET runtime actions for CHILL.
- Copyright (C) 1992,1993 Free Software Foundation, Inc.
- Author: Wilfried Moser, et al
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with other files,
- some of which are compiled with GCC, to produce an executable,
- this library 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. */
-
-#define __CHILL_LIB__
-
-#include <stdio.h>
-#include "powerset.h"
-
-/*
- * function __ltpowerset
- *
- * parameters:
- * left powerset
- * right powerset
- * bitlength length of powerset
- *
- * returns:
- * int 1 .. left is proper subset of right
- * (excludes case where left == right)
- * 0 .. not
- *
- * abstract:
- * check if one powerset is included in another
- *
- */
-int
-__ltpowerset (left, right, bitlength)
- SET_WORD *left;
- SET_WORD *right;
- unsigned long bitlength;
-{
- if (bitlength <= SET_CHAR_SIZE)
- {
- if ((*((SET_CHAR *)left) & *((SET_CHAR *)right))
- != *((SET_CHAR *)left))
- return 0;
- if (*((SET_CHAR *)left) != *((SET_CHAR *)right))
- return 1;
- return 0;
- }
- else if (bitlength <= SET_SHORT_SIZE)
- {
- if ((*((SET_SHORT *)left) & *((SET_SHORT *)right))
- != *((SET_SHORT *)left))
- return 0;
- if (*((SET_SHORT *)left) != *((SET_SHORT *)right))
- return 1;
- return 0;
- }
- else
- {
- SET_WORD *endp = left + BITS_TO_WORDS(bitlength);
- int all_equal = 1; /* assume all bits are equal */
-
- while (left < endp)
- {
- if ((*right & *left) != *left)
- return 0;
- if (*left != *right)
- all_equal = 0;
- left++;
- right++;
- }
- if (left == endp && all_equal) /* exclude TRUE return for == case */
- return 0;
- return 1;
- }
-}
diff --git a/libchill/ltstr.c b/libchill/ltstr.c
deleted file mode 100644
index 7ddcfda5c3c..00000000000
--- a/libchill/ltstr.c
+++ /dev/null
@@ -1,65 +0,0 @@
-/* Implement string-related runtime actions for CHILL.
- Copyright (C) 1992,1993 Free Software Foundation, Inc.
- Author: Bill Cox
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with other files,
- some of which are compiled with GCC, to produce an executable,
- this library 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. */
-
-#include <string.h>
-
-#define MIN(a, b) ((a) < (b) ? (a) : (b))
-
-/*
- * function __ltstring
- *
- * parameters:
- * S1 - pointer to left string
- * LEN1 - length of left string
- * S2 - pointer to right string
- * LEN2 - length of right string
- *
- * returns:
- * 1 if left string is a proper subset of the right string, 0 otherwise
- *
- * exceptions:
- * none
- *
- * abstract:
- * compares two character strings for subset relationship
- *
- */
-
-int __ltstring (s1, len1, s2, len2)
- char *s1;
- int len1;
- char *s2;
- int len2;
-{
- int i;
-
- i = memcmp (s1, s2, MIN (len1, len2));
- if (i)
- return (i < 0);
- return (len1 < len2);
-}
diff --git a/libchill/memmove.c b/libchill/memmove.c
deleted file mode 100644
index a995481fb01..00000000000
--- a/libchill/memmove.c
+++ /dev/null
@@ -1,75 +0,0 @@
-/* Implement string-related runtime actions for CHILL.
- Copyright (C) 1992,1993 Free Software Foundation, Inc.
- Author: Bill Cox
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with other files,
- some of which are compiled with GCC, to produce an executable,
- this library 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. */
-
-#ifdef __STDC__
-#include <stddef.h>
-#else
-#define size_t unsigned long
-#endif
-
-
-/*
- * function memmove
- *
- * parameters:
- * S1 - pointer to destination string
- * S2 - pointer to source string
- * LEN - length of string
- *
- * returns:
- * pointer to destination string
- *
- * exceptions:
- * none
- *
- * abstract:
- * copies a string safely, where the source and dest areas may overlap.
- *
- */
-
-void *
-memmove (s1, s2, n)
- void *s1;
- const void *s2;
- size_t n;
-{
- char *sc1 = s1;
- const char *sc2 = s2;
-
- if (sc2 < sc1 && (sc1 < sc2 + n))
- for (sc1 += n, sc2 += n; 0 < n; --n)
- *--sc1 = *--sc2;
- else
-#if 0
- for (; 0 < n; --n)
- *sc1++ = *sc2++;
-#else
- memcpy (sc1, sc2, n);
-#endif
- return s1;
-}
diff --git a/libchill/neps.c b/libchill/neps.c
deleted file mode 100644
index 40147bd97bf..00000000000
--- a/libchill/neps.c
+++ /dev/null
@@ -1,59 +0,0 @@
-/* Implement POWERSET runtime actions for CHILL.
- Copyright (C) 1992,1993 Free Software Foundation, Inc.
- Author: Wilfried Moser, et al
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with other files,
- some of which are compiled with GCC, to produce an executable,
- this library 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. */
-
-#define __CHILL_LIB__
-
-#include <stdio.h>
-#include "powerset.h"
-
-/*
- * function __nepowerset
- *
- * parameters:
- * left left powerset
- * right right powerset
- * bitlength length of powerset in bits
- *
- * returns:
- * 1 if powersets are not equal, bit for bit
- *
- * exceptions:
- * none
- *
- * abstract:
- * compares two powersets for inequality
- *
- */
-int
-__nepowerset (left, right, bitlength)
- SET_WORD *left;
- SET_WORD *right;
- unsigned long bitlength;
-{
- return ! __eqpowerset (left, right, bitlength);
-}
diff --git a/libchill/notps.c b/libchill/notps.c
deleted file mode 100644
index 849d32eeba8..00000000000
--- a/libchill/notps.c
+++ /dev/null
@@ -1,88 +0,0 @@
-/* Implement POWERSET runtime actions for CHILL.
- Copyright (C) 1992,1993 Free Software Foundation, Inc.
- Author: Wilfried Moser, et al
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with other files,
- some of which are compiled with GCC, to produce an executable,
- this library 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. */
-
-#define __CHILL_LIB__
-
-#include <stdio.h>
-#include "powerset.h"
-
-/*
- * function __notpowerset
- *
- * parameters:
- * out output powerset
- * left input powerset
- * bitlength length of powerset in bits
- *
- * returns:
- * void
- *
- * exceptions:
- * none
- *
- * abstract:
- *
- */
-
-void
-__notpowerset (out, left, bitlength)
- SET_WORD *out;
- SET_WORD *left;
- unsigned long bitlength;
-{
- if (bitlength <= SET_CHAR_SIZE)
- {
- *((SET_CHAR *)out) = ~ (*((SET_CHAR *)left));
-#if 0
- SET_CHAR tmp;
- tmp = *((SET_CHAR *)left);
- tmp = ~ tmp;
- *((SET_CHAR *)out) = tmp;
-
- MASK_UNUSED_CHAR_BITS((SET_CHAR *)out, bitlength);
- *((SET_CHAR *)out) = ~ *((SET_CHAR *)left);
- MASK_UNUSED_CHAR_BITS((SET_CHAR *)out, bitlength);
- *((SET_CHAR *)out) = (~(0)) ^ (*((SET_CHAR *)left));
- MASK_UNUSED_CHAR_BITS((SET_CHAR *)out, bitlength);
-#endif
- }
- else if (bitlength <= SET_SHORT_SIZE)
- {
- *((SET_SHORT *)out) = ~ (*((SET_SHORT *)left));
- MASK_UNUSED_SHORT_BITS((SET_SHORT *)out, bitlength);
- }
- else
- {
- unsigned long len = BITS_TO_WORDS(bitlength);
- register unsigned long i;
-
- for (i = 0; i < len; i++)
- out[i] = ~ left[i];
- MASK_UNUSED_WORD_BITS((out + len - 1), bitlength % SET_WORD_SIZE);
- }
-}
diff --git a/libchill/orps.c b/libchill/orps.c
deleted file mode 100644
index 3731bdfb1c0..00000000000
--- a/libchill/orps.c
+++ /dev/null
@@ -1,82 +0,0 @@
-/* Implement POWERSET runtime actions for CHILL.
- Copyright (C) 1992,1993 Free Software Foundation, Inc.
- Author: Wilfried Moser, et al
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with other files,
- some of which are compiled with GCC, to produce an executable,
- this library 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. */
-
-#define __CHILL_LIB__
-
-#include <stdio.h>
-#include "powerset.h"
-
-/*
- * function __orpowerset
- *
- * parameters:
- * out return from __orpowerset
- * left left powerset
- * right right powerset
- * bitlength length of powerset in bits
- *
- * returns:
- * void
- *
- * exceptions:
- * none
- *
- * abstract:
- * or's two powersets.
- *
- */
-
-void
-__orpowerset (out, left, right, bitlength)
- SET_WORD *out;
- SET_WORD *left;
- SET_WORD *right;
- unsigned long bitlength;
-{
- if (bitlength <= SET_CHAR_SIZE)
- {
- *((SET_CHAR *)out) = *((SET_CHAR *)left) |
- *((SET_CHAR *)right);
- MASK_UNUSED_CHAR_BITS((SET_CHAR *)out, bitlength);
- }
- else if (bitlength <= SET_SHORT_SIZE)
- {
- *((SET_SHORT *)out) = *((SET_SHORT *)left) |
- *((SET_SHORT *)right);
- MASK_UNUSED_SHORT_BITS((SET_SHORT *)out, bitlength);
- }
- else
- {
- register unsigned long i;
- unsigned long len = BITS_TO_WORDS(bitlength);
-
- for (i = 0; i < len; i++)
- out[i] = left[i] | right[i];
- MASK_UNUSED_WORD_BITS ((out + len - 1), bitlength % SET_WORD_SIZE);
- }
-}
diff --git a/libchill/outoffile.c b/libchill/outoffile.c
deleted file mode 100644
index 6a50a7f67c8..00000000000
--- a/libchill/outoffile.c
+++ /dev/null
@@ -1,48 +0,0 @@
-/* Implement Input/Output runtime actions for CHILL.
- Copyright (C) 1992,1993 Free Software Foundation, Inc.
- Author: Wilfried Moser, et al
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with other files,
- some of which are compiled with GCC, to produce an executable,
- this library 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. */
-
-#include "fileio.h"
-
-Boolean
-__outoffile( void* the_transfer, char* file, int line )
-{
- Access_Mode* the_access;
-
- if( !the_transfer )
- CHILLEXCEPTION( file, line, EMPTY, NULL_ACCESS );
-
- if( TEST_FLAG((Text_Mode*)the_transfer, IO_TEXTLOCATION ))
- the_access = ((Text_Mode*)the_transfer)->access_sub;
- else
- the_access = (Access_Mode*)the_transfer;
-
- if( !the_access->association )
- CHILLEXCEPTION( file, line, NOTCONNECTED, IS_NOT_CONNECTED );
-
- return TEST_FLAG( the_access, IO_OUTOFFILE ) ? True : False;
-}
diff --git a/libchill/powerset.h b/libchill/powerset.h
deleted file mode 100644
index e40303a2eeb..00000000000
--- a/libchill/powerset.h
+++ /dev/null
@@ -1,106 +0,0 @@
-/* Common macros for POWERSET runtime actions for CHILL.
- Copyright (C) 1992,1993 Free Software Foundation, Inc.
- Author: Wilfried Moser, et al
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with other files,
- some of which are compiled with GCC, to produce an executable,
- this library 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. */
-
-#ifndef _POWERSET_H
-#define _POWERSET_H
-
-/* Do not set these to anything other than character types without fixing
- their uses in andps.c and other files which implement bit sets operations.
-
- The uses in those files will violate ANSI/ISO C aliasing rules as they
- are currently written. */
-#define SET_WORD unsigned char
-#define SET_CHAR unsigned char
-#define SET_SHORT unsigned char
-
-#define SET_WORD_SIZE (sizeof (char) * sizeof (SET_WORD))
-#define SET_SHORT_SIZE (sizeof (char) * sizeof (SET_SHORT))
-#define SET_CHAR_SIZE sizeof (char)
-
-/* Powersets and bit strings are stored as arrays of SET_WORD.
- if they are a word or longer. Powersets and bit strings whic
- fit in a byte or short are stored that way by the compiler.
-
- The order of the bits follows native bit order:
- If BITS_BIG_ENDIAN, bit 0 is the most significant bit (i.e. 0x80..00);
- otherwise, bit 0 is the least significant bit (i.e. 0x1).
-
- MASK_UNUSED_BITS masks out unused bits in powersets and bitstrings.
- GET_BIT_IN_WORD(W,B) yields 1 (or 0) if the B'th bit if W is set (cleared).
-*/
-
-#if BITS_BIG_ENDIAN
-#define GET_BIT_IN_WORD(w,b) (((w) >> (SET_WORD_SIZE - 1 - (b))) & 1)
-#define GET_BIT_IN_SHORT(w,b) (((w) >> (SET_SHORT_SIZE - 1 - (b))) & 1)
-#define GET_BIT_IN_CHAR(w,b) (((w) >> (SET_CHAR_SIZE - 1 - (b))) & 1)
-
-#define SET_BIT_IN_WORD(w,b) ((w) |= 1 << ((SET_WORD_SIZE) - 1 - (b)))
-#define SET_BIT_IN_SHORT(w,b) ((w) |= 1 << ((SET_SHORT_SIZE) - 1 - (b)))
-#define SET_BIT_IN_CHAR(w,b) ((w) |= 1 << ((SET_CHAR_SIZE) - 1 - (b)))
-
-#define CLEAR_BIT_IN_WORD(w,b) ((w) &= ~(1 << ((SET_WORD_SIZE) - 1 - (b))))
-#define CLEAR_BIT_IN_SHORT(w,b) ((w) &= ~(1 << ((SET_SHORT_SIZE) - 1 - (b))))
-#define CLEAR_BIT_IN_CHAR(w,b) ((w) &= ~(1 << ((SET_CHAR_SIZE) - 1 - (b))))
-#define MASK_UNUSED_WORD_BITS(p,b) \
-{ if (b) *(p) &= (~0) << (SET_WORD_SIZE - (b)); }
-#define MASK_UNUSED_SHORT_BITS(p,b) \
-{ if (b) *(p) &= (~0) << (SET_SHORT_SIZE - (b)); }
-#define MASK_UNUSED_CHAR_BITS(p,b) \
-{ if (b) *(p) &= (~0) << (SET_CHAR_SIZE - (b)); }
-
-#else /* !BITS_BIG_ENDIAN */
-
-#define GET_BIT_IN_WORD(w,b) (((w) >> (b)) & 1)
-#define GET_BIT_IN_SHORT(w,b) GET_BIT_IN_WORD(w,b)
-#define GET_BIT_IN_CHAR(w,b) GET_BIT_IN_WORD(w,b)
-
-#define SET_BIT_IN_WORD(w,b) ((w) |= 1 << (b))
-#define SET_BIT_IN_SHORT(w,b) SET_BIT_IN_WORD(w,b)
-#define SET_BIT_IN_CHAR(w,b) SET_BIT_IN_WORD(w,b)
-
-#define CLEAR_BIT_IN_WORD(w,b) ((w) &= ~(1 << (b)))
-#define CLEAR_BIT_IN_SHORT(w,b) CLEAR_BIT_IN_WORD(w,b)
-#define CLEAR_BIT_IN_CHAR(w,b) CLEAR_BIT_IN_WORD(w,b)
-
-#define MASK_UNUSED_WORD_BITS(p,b) \
-{ if (b) *(p) &= ~((~0) << (b)); }
-#define MASK_UNUSED_SHORT_BITS(p,b) MASK_UNUSED_WORD_BITS(p,b)
-#define MASK_UNUSED_CHAR_BITS(p,b) MASK_UNUSED_WORD_BITS(p,b)
-
-#endif
-
-
-/* Number of words needed for a bitstring/powerset of size BITLENGTH.
- This definition handles the (BITLENGTH==0) by yielding 0. */
-
-#define BITS_TO_WORDS(BITLENGTH) \
- (((BITLENGTH) + (SET_WORD_SIZE-1)) / SET_WORD_SIZE)
-#define BITS_TO_CHARS(BITLENGTH) \
- (((BITLENGTH) + (SET_CHAR_SIZE-1)) / SET_CHAR_SIZE)
-
-#endif
diff --git a/libchill/printbuffer.c b/libchill/printbuffer.c
deleted file mode 100644
index a46cb5d5ef0..00000000000
--- a/libchill/printbuffer.c
+++ /dev/null
@@ -1,125 +0,0 @@
-/* Implement tasking-related runtime actions for CHILL.
- Copyright (C) 1992,1993 Free Software Foundation, Inc.
- Author: Wilfried Moser
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with other files,
- some of which are compiled with GCC, to produce an executable,
- this library 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. */
-
-#include <stdio.h>
-#include <string.h>
-#include "rtltypes.h"
-#include "rts.h"
-
-typedef char *(*fetch_names) (int number);
-extern fetch_names __RTS_FETCH_NAMES__;
-
-/*
- * function print_instance
- *
- */
-
-static char *print_instance (ins)
- INSTANCE ins;
-{
- static char buf[256];
- char *f;
-
- if (!__RTS_FETCH_NAMES__)
- f = 0;
- else
- f = (*__RTS_FETCH_NAMES__) (ins.ptype);
- if (!f)
- sprintf (buf, "[%u;%u]", ins.ptype, ins.pcopy);
- else
- sprintf (buf, "[%s;%u]", f, ins.pcopy);
- return buf;
-}
-
-/*
- * function __print_buffer
- *
- * parameters:
- * buffer buffer location
- *
- * returns:
- * void
- *
- * exceptions:
- * none
- *
- * abstract:
- * Function is used for debugging purposes only to print a
- * buffer queue
- */
-
-void
-__print_buffer (buffer, name)
- Buffer_Queue **buffer;
- char *name;
-{
- Buffer_Queue *bq;
- int bsqcnt = 0, bwqcnt = 0;
- Buffer_Send_Queue *bsq;
- Buffer_Wait_Queue *bwq;
-
- if (name)
- printf ("Buffer %s:\n", name);
- else
- printf ("Buffer at address H'%X:\n", buffer);
-
- memcpy (&bq, buffer, sizeof (Buffer_Queue *));
- if (bq == 0)
- {
- printf ("EMPTY\n");
- return;
- }
-
- bsq = bq->sendqueue;
- if (bsq != 0)
- printf ("Send Queue:\n");
- while (bsq)
- {
- printf (" %3d: ", ++bsqcnt);
- printf ("Process %s, ", print_instance (bsq->this));
- printf ("Priority %d", bsq->priority);
- if (bsq->is_delayed)
- printf (", Delayed");
- printf ("\n");
- bsq = bsq->forward;
- }
- bwq = bq->waitqueue;
- if (bwq != 0)
- printf ("Wait Queue:\n");
- while (bwq)
- {
- printf (" %3d: ", ++bwqcnt);
- printf ("Process %s, ", print_instance (bwq->this));
- if (bwq->is_sent)
- printf (", Send by %s", print_instance (bwq->who_sent));
- printf ("\n");
- bwq = bwq->forward;
- }
- if (bsqcnt == 0 && bwqcnt == 0)
- printf ("EMPTY\n");
-}
diff --git a/libchill/printevent.c b/libchill/printevent.c
deleted file mode 100644
index 88c4bc0acc7..00000000000
--- a/libchill/printevent.c
+++ /dev/null
@@ -1,102 +0,0 @@
-/* Implement tasking-related runtime actions for CHILL.
- Copyright (C) 1992,1993 Free Software Foundation, Inc.
- Author: Wilfried Moser
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with other files,
- some of which are compiled with GCC, to produce an executable,
- this library 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. */
-
-#include <stdio.h>
-#include <string.h>
-#include "rtltypes.h"
-#include "rts.h"
-
-typedef char *(*fetch_names) (int number);
-extern fetch_names __RTS_FETCH_NAMES__;
-
-/*
- * function print_instance
- *
- */
-
-static char *print_instance (ins)
- INSTANCE ins;
-{
- static char buf[256];
- char *f;
-
- if (!__RTS_FETCH_NAMES__)
- f = 0;
- else
- f = (*__RTS_FETCH_NAMES__) (ins.ptype);
- if (!f)
- sprintf (buf, "[%u;%u]", ins.ptype, ins.pcopy);
- else
- sprintf (buf, "[%s;%u]", f, ins.pcopy);
- return buf;
-}
-
-/*
- * function __print_event
- *
- * parameters:
- * event event location
- *
- * returns:
- * void
- *
- * exceptions:
- * none
- *
- * abstract:
- * Function is used for debugging purposes only to print an
- * event queue
- */
-
-void
-__print_event (evaddr, name)
- Event_Queue **evaddr;
- char *name;
-{
- Event_Queue *ev;
- int cnt = 0;
-
- if (name)
- printf ("Event %s:\n", name);
- else
- printf ("Event at address H'%X:\n", evaddr);
-
- memcpy (&ev, evaddr, sizeof (Event_Queue *));
- while (ev)
- {
- printf (" %3d: ", ++cnt);
- printf ("Process %s, ", print_instance (ev->this));
- printf ("Priority %d", ev->priority);
- if (ev->is_continued)
- printf (" ,Continued by %s", print_instance (ev->who_continued));
- printf ("\n");
- ev = ev->forward;
- }
- if (!cnt)
- printf ("EMPTY\n");
-}
diff --git a/libchill/queuelength.c b/libchill/queuelength.c
deleted file mode 100644
index 777d50389d5..00000000000
--- a/libchill/queuelength.c
+++ /dev/null
@@ -1,87 +0,0 @@
-/* Implement tasking-related runtime actions for CHILL.
- Copyright (C) 1992,1993 Free Software Foundation, Inc.
- Author: Wilfried Moser
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with other files,
- some of which are compiled with GCC, to produce an executable,
- this library 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. */
-
-#include "rtltypes.h"
-#include "rts.h"
-
-/*
- * function __queue_length
- *
- * parameters:
- * buf_ev Buffer or event location
- * is_event 0 .. buf_ev is a buffer location
- * 1 .. buf_ev is an event location
- *
- * returns:
- * int number of delayed processeson an event location
- * or number of send delayed processes on a buffer
- *
- * exceptions:
- * none
- *
- * abstract:
- * implements the QUEUE_LENGTH built-in.
- *
- */
-
-int
-__queue_length (buf_ev, is_event)
- void *buf_ev;
- int is_event;
-{
- int retval = 0;
-
- /* if buf_ev == 0 then we don't have anything */
- if (buf_ev == 0)
- return 0;
-
- if (is_event)
- {
- /* process an event queue */
- Event_Queue *ev = buf_ev;
-
- while (ev)
- {
- retval++;
- ev = ev->forward;
- }
- }
- else
- {
- /* process a buffer queue */
- Buffer_Queue *bq = buf_ev;
- Buffer_Send_Queue *bsq = bq->sendqueue;
-
- while (bsq)
- {
- retval++;
- bsq = bsq->forward;
- }
- }
- return retval;
-}
diff --git a/libchill/readable.c b/libchill/readable.c
deleted file mode 100644
index 0b3b3d3858b..00000000000
--- a/libchill/readable.c
+++ /dev/null
@@ -1,40 +0,0 @@
-/* Implement Input/Output runtime actions for CHILL.
- Copyright (C) 1992,1993 Free Software Foundation, Inc.
- Author: Wilfried Moser, et al
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with other files,
- some of which are compiled with GCC, to produce an executable,
- this library 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. */
-
-#include "fileio.h"
-
-Boolean
-__readable( Association_Mode* the_assoc, char* file, int line )
-{
- if( !the_assoc )
- CHILLEXCEPTION( file, line, EMPTY, NULL_ASSOCIATION );
- if( !TEST_FLAG(the_assoc, IO_ISASSOCIATED) )
- CHILLEXCEPTION( file, line, NOTASSOCIATED, IS_NOT_ASSOCIATED );
- return TEST_FLAG(the_assoc, IO_READABLE) ? True : False;
-}
-
diff --git a/libchill/readrecord.c b/libchill/readrecord.c
deleted file mode 100644
index f462883972b..00000000000
--- a/libchill/readrecord.c
+++ /dev/null
@@ -1,217 +0,0 @@
-/* Implement Input/Output runtime actions for CHILL.
- Copyright (C) 1992, 1993, 1998 Free Software Foundation, Inc.
- Author: Wilfried Moser, et al
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with other files,
- some of which are compiled with GCC, to produce an executable,
- this library 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. */
-
-#include <setjmp.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <sys/types.h>
-#include <unistd.h>
-
-#include "fileio.h"
-
-#ifdef EOF
-#undef EOF
-#endif
-#define EOF -1
-
-static
-Boolean
-doRead( Access_Mode* the_access, void* buf, size_t nbyte )
-{
- size_t nread;
-
- nread = read( the_access->association->handle, buf, nbyte );
- if( nread == nbyte )
- {
- CLR_FLAG( the_access, IO_OUTOFFILE );
- return True;
- }
- if( nread == 0 )
- {
- SET_FLAG( the_access, IO_OUTOFFILE );
- return False;
- }
- the_access->association->syserrno = errno;
- RWEXCEPTION( READFAIL, OS_IO_ERROR );
- /* no return */
-}
-
-static
-int bgetc( int handle, readbuf_t* rbptr )
-{
- if( rbptr->cur >= rbptr->len )
- {
- rbptr->len = read( handle, rbptr->buf, READBUFLEN );
- if( rbptr->len == 0 )
- return EOF;
- rbptr->cur = 0;
- }
- return rbptr->buf[rbptr->cur++];
-}
-
-static
-void bungetc( readbuf_t* rbptr, int c )
-{
- rbptr->buf[--rbptr->cur] = c;
-}
-
-void*
-__readrecord( Access_Mode* the_access,
- signed long the_index,
- char* the_buf_addr,
- char* file,
- int line )
-{
- unsigned long info;
- char* actaddr;
- unsigned short actlen;
- off_t filepos;
- unsigned short reclen;
- unsigned long readlen;
-
- if( !the_access )
- CHILLEXCEPTION( file, line, EMPTY, NULL_ACCESS );
-
- if( !the_access->association )
- CHILLEXCEPTION( file, line, NOTCONNECTED, IS_NOT_CONNECTED );
-
- /* Usage must not be WriteOnly */
- if( the_access->association->usage == WriteOnly )
- CHILLEXCEPTION( file, line, READFAIL, BAD_USAGE );
-
- /* OUTOFFILE must not be True when connected for sequential read */
- if( !TEST_FLAG( the_access, IO_INDEXED )
- && TEST_FLAG( the_access, IO_OUTOFFILE ) )
- CHILLEXCEPTION( file, line, READFAIL, OUT_OF_FILE );
-
- /*
- * Positioning
- */
- if( TEST_FLAG( the_access, IO_INDEXED ) )
- {
- /* index expression must be within bounds of index mode */
- if( the_index < the_access->lowindex
- || the_access->highindex < the_index )
- CHILLEXCEPTION( file, line, RANGEFAIL, BAD_INDEX );
-
- filepos = the_access->base +
- (the_index - the_access->lowindex) * the_access->reclength;
-
- if( lseek( the_access->association->handle, filepos, SEEK_SET ) == -1L )
- CHILLEXCEPTION( file, line, READFAIL, LSEEK_FAILS );
- }
-
- /* establish store loc */
- if( !(actaddr = the_buf_addr ))
- {
- /* if not yet allocated, do it now */
- if (!the_access->store_loc)
- if( !(the_access->store_loc = (char*)malloc( the_access->reclength ) ) )
- CHILLEXCEPTION( file, line, SPACEFAIL, STORE_LOC_ALLOC );
- actaddr = the_access->store_loc;
- }
- actlen = the_access->reclength;
-
- if( (info = setjmp( __rw_exception )) )
- CHILLEXCEPTION( file, line, info>>16, info & 0xffff );
-
- if( TEST_FLAG( the_access, IO_TEXTIO ) )
- {
- readlen = actlen - 2;
- if( TEST_FLAG( the_access, IO_INDEXED ) )
- {
- if( ! doRead( the_access, &reclen, sizeof(reclen) ) )
- return NULL;
- if( reclen > readlen )
- CHILLEXCEPTION( file, line, RANGEFAIL, RECORD_TOO_LONG );
- if( ! doRead( the_access, actaddr + 2, reclen ) )
- CHILLEXCEPTION( file, line, READFAIL, RECORD_TOO_SHORT );
- }
- else
- {
- Association_Mode *assoc = the_access->association;
- int handle = assoc->handle;
- readbuf_t* rbuf = assoc->bufptr;
- char* cptr = actaddr+2;
- int curr;
-
- reclen = 0;
- while( readlen-- )
- {
- curr = bgetc( handle, rbuf );
- if( curr == '\n' )
- goto end_of_line;
- if( curr == EOF )
- {
- if( !reclen )
- SET_FLAG( the_access, IO_OUTOFFILE );
- goto end_of_line;
- }
- *cptr++ = curr;
- reclen++;
- }
- if( (curr = bgetc( handle, rbuf )) != '\n' )
- {
- bungetc( rbuf, curr );
- CHILLEXCEPTION( file, line, RANGEFAIL, RECORD_TOO_LONG );
- }
-end_of_line: ;
- }
- MOV2(actaddr,&reclen);
- }
- else
- {
- switch( the_access->rectype )
- {
- case Fixed:
- if( ! doRead( the_access, actaddr, actlen ) )
- return NULL;
- break;
- case VaryingChars:
- if( TEST_FLAG( the_access->association, IO_VARIABLE ) )
- {
- if( ! doRead( the_access, &reclen, sizeof(reclen) ) )
- return NULL;
- if( reclen > actlen - 2 )
- CHILLEXCEPTION( file, line, RANGEFAIL, RECORD_TOO_LONG );
- readlen = TEST_FLAG( the_access, IO_INDEXED ) ? actlen - 2 : reclen;
- if( ! doRead( the_access, actaddr + 2, readlen ) )
- CHILLEXCEPTION( file, line, READFAIL, RECORD_TOO_SHORT );
- }
- else
- {
- if( ! doRead( the_access, actaddr + 2, reclen = actlen - 2 ) )
- CHILLEXCEPTION( file, line, READFAIL, RECORD_TOO_SHORT );
- }
- MOV2(actaddr,&reclen);
- break;
- }
- }
-
- return actaddr;
-}
diff --git a/libchill/remaintime.c b/libchill/remaintime.c
deleted file mode 100644
index 5d87e8c7af3..00000000000
--- a/libchill/remaintime.c
+++ /dev/null
@@ -1,91 +0,0 @@
-/* Implement timing-related runtime actions for CHILL.
- Copyright (C) 1992,1993 Free Software Foundation, Inc.
- Author: Wilfried Moser
-
- This file is part of GNU CC.
-
- GNU CC is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- GNU CC is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with GNU CC; see the file COPYING. If not, write to
- the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with other files,
- some of which are compiled with GCC, to produce an executable,
- this library 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. */
-
-#include "rts.h"
-
-/*
- * function __remaintime
- *
- * parameters:
- * since pointer to the initial RtsTime
- * dur the duration value
- * t pointer to the remaining RtsTime
- *
- * returns:
- * int 0 .. there is a remaining time
- * 1 .. there is no remaining time
- *
- * exceptions:
- * none
- *
- * abstract:
- * This function writes to t the remaining duration value in RtsTime format
- * from a given start (since) and the current RtsTime.
- *
- */
-
-extern void __convert_duration_rtstime (unsigned long dur, RtsTime *t);
-
-int
- __remaintime (since, dur, t)
-RtsTime *since;
-unsigned long dur;
-RtsTime *t;
-{
- RtsTime now, dur_in_rtstime, tmp, diff;
-
- __rtstime (&now);
- __convert_duration_rtstime (dur, &dur_in_rtstime);
-
- tmp.secs = since->secs;
- tmp.nanosecs = since->nanosecs;
-
- /* calculate the difference of absolute times */
- if (tmp.nanosecs > now.nanosecs)
- {
- tmp.secs--;
- tmp.nanosecs += 1000000000;
- }
- diff.secs = now.secs - tmp.secs;
- diff.nanosecs = now.nanosecs - tmp.nanosecs;
-
- /* substract diff from duration */
- if (diff.nanosecs > dur_in_rtstime.nanosecs)
- {
- dur_in_rtstime.secs--;
- dur_in_rtstime.nanosecs += 1000000000;
- }
-
- t->secs = dur_in_rtstime.secs - diff.secs;
- t->nanosecs = dur_in_rtstime.nanosecs - diff.nanosecs;
-
- if (t->secs > dur_in_rtstime.secs)
- return 1;
- else
- return 0;
-}
diff --git a/libchill/retmem.c b/libchill/retmem.c
deleted file mode 100644
index 810a71ad8ea..00000000000
--- a/libchill/retmem.c
+++ /dev/null
@@ -1,59 +0,0 @@
-/* Implement runtime actions for CHILL.
- Copyright (C) 1992,1993 Free Software Foundation, Inc.
- Author: Wilfried Moser
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with other files,
- some of which are compiled with GCC, to produce an executable,
- this library 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. */
-
-#define __CHILL_LIB__
-
-#include <stdlib.h>
-
-/*
- * function _return_memory
- *
- * parameter:
- * ptr pointer to memory to free
- * filename source file which issued the call
- * linenumber line number of the call within that file
- *
- * returns:
- * void
- *
- * exceptions:
- * none
- *
- * abstract:
- * free memory previously allocated by _allocate_(global_)memory
- *
-*/
-
-void
-_return_memory (ptr, filename, linenumber)
- void *ptr;
- char *filename;
- int linenumber;
-{
- free (ptr);
-}
diff --git a/libchill/rtltypes.h b/libchill/rtltypes.h
deleted file mode 100644
index 7175785440c..00000000000
--- a/libchill/rtltypes.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/* Implement timing-related runtime actions for CHILL.
- Copyright (C) 1992,1993 Free Software Foundation, Inc.
- Author: Wilfried Moser
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with other files,
- some of which are compiled with GCC, to produce an executable,
- this library 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. */
-
-#ifndef __rtltypes_h__
-#define __rtltypes_h__
-
-#include <setjmp.h>
-
-/* Add prototype support. */
-#ifndef PROTO
-#if defined (USE_PROTOTYPES) ? USE_PROTOTYPES : defined (__STDC__)
-#define PROTO(ARGS) ARGS
-#else
-#define PROTO(ARGS) ()
-#endif
-#endif
-
-/* argc, argv */
-typedef struct
-{
- unsigned short len;
- char body[0];
-} TVaryingCharType;
-
-#ifndef __CHILL_LIB__
-extern TVaryingCharType **chill_argv;
-extern int chill_argc;
-#endif
-
-/* definitions for exceptions */
-typedef struct
-{
- char *exname;
- short exnumber;
-} TExceptionDefinition;
-
-#if 1
-typedef char *__ch_exception;
-#define EX_EQ(e1, e2) (strcmp(e1, e2)==0)
-#else
-typedef void *__ch_exception;
-#define EX_EQ(e1, e2) (e1 == e2)
-#endif
-#define __ch_else_except ((__ch_exception)0)
-
-struct __ch_handled_excepts
-{
- /* List is ended by a code==0, or ex==__ch_else_except (ELSE handler). */
- __ch_exception ex;
- int code; /* Positive number indicating ordinal in handler list. */
-};
-
-/* definitions for exception handlers */
-typedef struct __ch_handler
-{
- struct __ch_handler *prev;
- struct __ch_handled_excepts *handlers;
- jmp_buf jbuf;
-} TExceptionHandlerStack;
-
-/* exceptions */
-#define EXCEPTION(x) /* nothing */
-
-#endif /* __rtltypes_h__ */
diff --git a/libchill/rts.c b/libchill/rts.c
deleted file mode 100644
index fd1878c6cfd..00000000000
--- a/libchill/rts.c
+++ /dev/null
@@ -1,663 +0,0 @@
-/* GNU CHILL compiler regression test file
- Copyright (C) 1992, 1993 Free Software Foundation, Inc.
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with other files,
- some of which are compiled with GCC, to produce an executable,
- this library 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. */
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <setjmp.h>
-#include <signal.h>
-
-#include "rts.h"
-
-
-/* some allocation/reallocation functions */
-
-static void *
-xmalloc (size)
- int size;
-{
- void *tmp = malloc (size);
-
- if (!tmp)
- {
- fprintf (stderr, "Out of heap space.\n");
- exit (1);
- }
- return (tmp);
-}
-
-static void *
-xrealloc (ptr, size)
- void *ptr;
- int size;
-{
- void *tmp = realloc (ptr, size);
-
- if (!tmp)
- {
- fprintf (stderr, "Out of heap space.\n");
- exit (1);
- }
- return (tmp);
-}
-
-/* the necessary data */
-#define MAX_NUMBER 100
-typedef char UsedValues[MAX_NUMBER];
-
-#define MAX_COPIES 100
-
-#define MAX_PER_ITEM 20
-typedef struct TASKINGSTRUCTLIST
-{
- struct TASKINGSTRUCTLIST *forward;
- int num;
- TaskingStruct *data[MAX_PER_ITEM];
- char copies[MAX_COPIES];
- jmp_buf where;
-} TaskingStructList;
-
-static TaskingStructList *task_array[LAST_AND_UNUSED];
-static UsedValues used_values[LAST_AND_UNUSED];
-
-static short
-get_next_free_number (vals)
- UsedValues vals;
-{
- short i;
- for (i = 1; i < MAX_NUMBER; i++)
- {
- if (!vals[i])
- {
- vals[i] = 1;
- return (i);
- }
- }
- fprintf (stderr, "There are no more free numbers.\n");
- exit (1);
-}
-
-/* function search for the next available copy number */
-static short
-get_next_copy_number (p)
- TaskingStructList *p;
-{
- short i;
-
- for (i = 0; i < MAX_COPIES; i++)
- {
- if (!p->copies[i])
- {
- p->copies[i] = 1;
- return (i);
- }
- }
- fprintf (stderr, "No more copies available for \"%s\".\n",
- p->data[0]->name);
- exit (1);
-}
-
-/* function registers a tasking entry from a module and assign
- a value to the type */
-
-void
-__register_tasking (t)
- TaskingStruct *t;
-{
- TaskingStructList *p;
-
- /* check first if a value was provided and if it is in range */
- if (t->value_defined && *t->value >= MAX_NUMBER)
- {
- fprintf (stderr, "Value %d out of range.\n", *t->value);
- exit (1);
- }
-
- /* look for item defined */
- p = task_array[t->type];
- while (p)
- {
- if (!strcmp (p->data[0]->name, t->name))
- /* have found it */
- break;
- p = p->forward;
- }
-
- if (!p)
- {
- TaskingStructList *wrk = (TaskingStructList *)&task_array[t->type];
-
- /* this is a new one -- allocate space */
- p = xmalloc (sizeof (TaskingStructList));
- memset (p->copies, 0, sizeof (p->copies));
- p->forward = 0;
- p->num = 1;
- p->data[0] = t;
-
- /* queue it in */
- while (wrk->forward)
- wrk = wrk->forward;
- wrk->forward = p;
- }
- else
- {
- if (p->num >= MAX_PER_ITEM)
- {
- fprintf (stderr, "Too many registrations of \"%s\".\n", t->name);
- exit (1);
- }
- p->data[p->num++] = t;
- }
-}
-
-/* define all the entries for the runtime system. They will be
- needed by chillrt0.o */
-
-typedef char *(*fetch_names) ();
-typedef int (*fetch_numbers) ();
-
-static char tmp_for_fetch_name[100];
-
-char *
-__fetch_name (number)
- int number;
-{
- TaskingStructList *p = task_array[Process];
-
- while (p)
- {
- if (*(p->data[0]->value) == number)
- return (p->data[0]->name);
- p = p->forward;
- }
- sprintf (tmp_for_fetch_name, "%d", number);
- return (tmp_for_fetch_name);
-}
-fetch_names __RTS_FETCH_NAMES__ = __fetch_name;
-
-static int
-__fetch_number (name)
- char *name;
-{
- TaskingStructList *p = task_array[Process];
-
- while (p)
- {
- if (!strcmp (p->data[0]->name, name))
- return (*(p->data[0]->value));
- p = p->forward;
- }
- return (-1);
-}
-fetch_numbers __RTS_FETCH_NUMBERS__ = __fetch_number;
-
-
-/* here we go to check all registered items */
-static void
- __rts_init ()
-{
- int i;
- TaskingStructList *p;
-
- for (i = Process; i <= Event; i++)
- {
- p = task_array[i];
- while (p)
- {
- TaskingStruct *t = 0;
- int j;
- short val;
-
- for (j = 0; j < p->num; j++)
- {
- if (p->data[j]->value_defined)
- {
- if (t)
- {
- if (*(t->value) != *(p->data[j]->value))
- {
- fprintf (stderr, "Different values (%d & %d) for \"%s\".",
- *(t->value), *(p->data[j]->value), t->name);
- exit (1);
- }
- }
- else
- t = p->data[j];
- }
- }
-
- if (t)
- {
-
- val = *(t->value);
-
- if (used_values[t->type][val])
- {
- fprintf (stderr, "Value %d for \"%s\" is already used.\n",
- val, t->name);
- exit (1);
- }
- used_values[t->type][val] = 1;
- }
- else
- {
- /* we have to create a new value */
- val = get_next_free_number (used_values[p->data[0]->type]);
- }
-
- for (j = 0; j < p->num; j++)
- {
- p->data[j]->value_defined = 1;
- *(p->data[j]->value) = val;
- }
-
- p = p->forward;
- }
- }
-}
-EntryPoint __RTS_INIT__ = __rts_init;
-
-/* define the start process queue */
-typedef struct STARTENTRY
-{
- struct STARTENTRY *forward;
- INSTANCE whoami;
- EntryPoint entry;
- void *data;
- int datalen;
-} StartEntry;
-
-static StartEntry *start_queue = 0;
-static StartEntry *current_process = 0;
-
-/* the jump buffer for the main loop */
-static jmp_buf jump_buffer;
-static int jump_buffer_initialized = 0;
-
-/* look for entries in start_queue and start the process */
-static void
-__rts_main_loop ()
-{
- StartEntry *s;
-
- while (1)
- {
- if (setjmp (jump_buffer) == 0)
- {
- jump_buffer_initialized = 1;
- s = start_queue;
- while (s)
- {
- current_process = s;
- start_queue = s->forward;
-
- /* call the process */
- (*s->entry) (s->data);
- s = start_queue;
- }
- /* when queue empty we have finished */
- return;
- }
- else
- {
- /* stop executed */
- if (current_process->data)
- free (current_process->data);
- free (current_process);
- current_process = 0;
- }
- }
-}
-EntryPoint __RTS_MAIN_LOOP__ = __rts_main_loop;
-
-
-void
-__start_process (ptype, pcopy, arg_size, args, ins)
- short ptype;
- short pcopy;
- int arg_size;
- void *args;
- INSTANCE *ins;
-{
- TaskingStructList *p = task_array[Process];
- EntryPoint pc = 0;
- int i;
- short this_copy = pcopy;
- StartEntry *s, *wrk;
-
- /* search for the process */
- while (p)
- {
- if (*(p->data[0]->value) == ptype)
- break;
- p = p->forward;
- }
- if (!p)
- {
- fprintf (stderr, "Cannot find a process with type %d.\n", ptype);
- exit (1);
- }
-
- /* search for the entry point */
- for (i = 0; i < p->num; i++)
- {
- if (p->data[i]->entry)
- {
- pc = p->data[i]->entry;
- break;
- }
- }
- if (!pc)
- {
- fprintf (stderr, "Process \"%s\" doesn't have an entry point.\n",
- p->data[0]->name);
- exit (1);
- }
-
- /* check the copy */
- if (pcopy >= MAX_COPIES)
- {
- fprintf (stderr, "Copy number (%d) out of range.\n", pcopy);
- exit (1);
- }
- if (pcopy == -1)
- {
- /* search for a copy number */
- this_copy = get_next_copy_number (p);
- }
- else
- {
- if (p->copies[pcopy])
- {
- /* FIXME: should be exception 'startfail' */
- fprintf (stderr, "Copy number %d already in use for \"%s\".\n",
- pcopy, p->data[0]->name);
- exit (1);
- }
- p->copies[this_copy = pcopy] = 1;
- }
-
- /* ready to build start_queue entry */
- s = xmalloc (sizeof (StartEntry));
- s->forward = 0;
- s->whoami.pcopy = this_copy;
- s->whoami.ptype = ptype;
- s->entry = pc;
- s->datalen = arg_size;
- if (args)
- {
- s->data = xmalloc (arg_size);
- memcpy (s->data, args, arg_size);
- }
- else
- s->data = 0;
-
- /* queue that stuff in */
- wrk = (StartEntry *)&start_queue;
- while (wrk->forward)
- wrk = wrk->forward;
- wrk->forward = s;
-
- /* if we have a pointer to ins -- set it */
- if (ins)
- {
- ins->ptype = ptype;
- ins->pcopy = this_copy;
- }
-}
-
-void
-__stop_process ()
-{
- if (!jump_buffer_initialized)
- {
- fprintf (stderr, "STOP called before START.\n");
- exit (1);
- }
- longjmp (jump_buffer, 1);
-}
-
-
-/* function returns INSTANCE of current process */
-INSTANCE
-__whoami ()
-{
- INSTANCE whoami;
- if (current_process)
- whoami = current_process->whoami;
- else
- {
- whoami.ptype = 0;
- whoami.pcopy = 0;
- }
- return (whoami);
-}
-
-typedef struct
-{
- short *sc;
- int data_len;
- void *data;
-} SignalDescr;
-
-typedef struct SIGNALQUEUE
-{
- struct SIGNALQUEUE *forward;
- short sc;
- int data_len;
- void *data;
- INSTANCE to;
- INSTANCE from;
-} SignalQueue;
-
-/* define the signal queue */
-static SignalQueue *msg_queue = 0;
-
-/* send a signal */
-void
-__send_signal (s, to, prio, with_len, with)
- SignalDescr *s;
- INSTANCE to;
- int prio;
- int with_len;
- void *with;
-{
- SignalQueue *wrk = (SignalQueue *)&msg_queue;
- SignalQueue *p;
- TaskingStructList *t = task_array[Process];
-
- /* search for process is defined and running */
- while (t)
- {
- if (*(t->data[0]->value) == to.ptype)
- break;
- t = t->forward;
- }
- if (!t || !t->copies[to.pcopy])
- {
- fprintf (stderr, "Can't find instance [%d,%d].\n",
- to.ptype, to.pcopy);
- exit (1);
- }
-
- /* go to the end of the msg_queue */
- while (wrk->forward)
- wrk = wrk->forward;
-
- p = xmalloc (sizeof (SignalQueue));
- p->sc = *(s->sc);
- if (p->data_len = s->data_len)
- {
- p->data = xmalloc (s->data_len);
- memcpy (p->data, s->data, s->data_len);
- }
- else
- p->data = 0;
- p->to = to;
- p->from = __whoami ();
- p->forward = 0;
- wrk->forward = p;
-}
-
-void
-start_signal_timeout (i, s, j)
- int i;
- SignalDescr *s;
- int j;
-{
- __send_signal (s, __whoami (), 0, 0, 0);
-}
-
-
-/* receive a signal */
-int
-__wait_signal_timed (sig_got, nsigs, sigptr, datap,
- datalen, ins, else_branche,
- to, filename, lineno)
- short *sig_got;
- int nsigs;
- short *sigptr[];
- void *datap;
- int datalen;
- INSTANCE *ins;
- int else_branche;
- void *to;
- char *filename;
- int lineno;
-{
- INSTANCE me = __whoami ();
- SignalQueue *wrk, *p = msg_queue;
- int i;
- short sc;
-
- /* search for a signal to `me' */
- wrk = (SignalQueue *)&msg_queue;
-
- while (p)
- {
- if (p->to.ptype == me.ptype
- && p->to.pcopy == me.pcopy)
- break;
- wrk = p;
- p = p->forward;
- }
-
- if (!p)
- {
- fprintf (stderr, "No signal for [%d,%d].\n",
- me.ptype, me.pcopy);
- exit (1);
- }
-
- /* queue the message out */
- wrk->forward = p->forward;
-
- /* now look for signal in list */
- for (i = 0; i < nsigs; i++)
- if (*(sigptr[i]) == p->sc)
- break;
-
- if (i >= nsigs && ! else_branche)
- /* signal not in list and no ELSE in code */
- __cause_exception ("signalfail", __FILE__, __LINE__);
-
- if (i >= nsigs)
- {
- /* signal not in list */
- sc = p->sc;
- if (ins)
- *ins = p->from;
- if (p->data)
- free (p->data);
- free (p);
- *sig_got = sc;
- return (0);
- }
-
- /* we have found a signal in the list */
- if (p->data_len)
- {
- if (datalen >= p->data_len
- && datap)
- memcpy (datap, p->data, p->data_len);
- else
- __cause_exception ("spacefail", __FILE__, __LINE__);
- }
-
- sc = p->sc;
- if (ins)
- *ins = p->from;
- if (p->data)
- free (p->data);
- free (p);
- *sig_got = sc;
- return (0);
-}
-
-/* wait a certain amount of seconds */
-int
-__sleep_till (abstime, reltime, fname, lineno)
- time_t abstime;
- int reltime;
- char *fname;
- int lineno;
-{
- sleep (reltime);
- return 0;
-}
-
-/* set up an alarm */
-static int timeout_flag = 0;
-
-static void alarm_handler ()
-{
- timeout_flag = 1;
-}
-
-int *
-__define_timeout (howlong, filename, lineno)
- unsigned long howlong; /* comes in millisecs */
- char *filename;
- int lineno;
-{
- unsigned int prev_alarm_value;
-
- signal (SIGALRM, alarm_handler);
- prev_alarm_value = alarm ((unsigned int)(howlong / 1000));
- return &timeout_flag;
-}
-
-/* wait till timeout expires */
-void
-__wait_timeout (toid, filename, lineno)
- volatile int *toid;
- char *filename;
- int lineno;
-{
- while (! *toid) ;
- *toid = 0;
-}
diff --git a/libchill/rts.h b/libchill/rts.h
deleted file mode 100644
index 3a9a26cb2ac..00000000000
--- a/libchill/rts.h
+++ /dev/null
@@ -1,159 +0,0 @@
-/* GNU CHILL compiler regression test file
- Copyright (C) 1992, 1993 Free Software Foundation, Inc.
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with other files,
- some of which are compiled with GCC, to produce an executable,
- this library 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. */
-
-#ifndef __rts_h_
-#define __rts_h_
-
-typedef enum
-{
- UNUSED,
- Process,
- Signal,
- Buffer,
- Event,
- Synonym,
- Exception,
- LAST_AND_UNUSED,
-} TaskingEnum;
-
-typedef void (*EntryPoint) ();
-
-typedef struct
-{
- char *name;
- short *value;
- int value_defined;
- EntryPoint entry;
- unsigned char /*TaskingEnum*/ type;
-} TaskingStruct;
-
-/* how an INSTANCE is implemented */
-typedef struct
-{
- short ptype;
- short pcopy;
-} INSTANCE;
-
-/* interface to underlaying os */
-typedef enum
-{
- wait_wait,
- wait_buffer_send,
- wait_buffer_receive,
- wait_buffer_free,
- wait_event_delay,
- wait_event_free,
-} Delay_Reason;
-
-extern INSTANCE __whoami ();
-extern void *__xmalloc_ ();
-
-#define THIS __whoami()
-/* for easier changing to something different,
- i.e. allocate_memory */
-#define MALLOC(ADDR,SIZE) ADDR = __xmalloc_(SIZE)
-#define FREE(ADDR) free (ADDR)
-
-/* definitions for EVENTS */
-typedef struct EVENTQUEUE
-{
- struct EVENTQUEUE *forward; /* next in the list */
- struct EVENTQUEUE **listhead; /* pointer to EVENT location */
- int priority; /* prio for DELAY or DELAY CASE */
- INSTANCE this; /* specify the instance is delayed */
- struct EVENTQUEUE *startlist; /* start of the list */
- struct EVENTQUEUE *chain; /* list of all events in an DELAY CASE */
- int is_continued; /* indicates a continue action on that event */
- INSTANCE who_continued; /* indicates who continued */
-} Event_Queue;
-
-typedef struct
-{
- Event_Queue **ev;
- unsigned long maxqueuelength;
-} Event_Descr;
-
-/* definitions for BUFFERS */
-struct BUFFERQUEUE;
-
-typedef struct BUFFER_WAIT_QUEUE
-{
- struct BUFFER_WAIT_QUEUE *forward;
- struct BUFFERQUEUE **bufferaddr;
- INSTANCE this;
- struct BUFFER_WAIT_QUEUE *startlist;
- struct BUFFER_WAIT_QUEUE *chain;
- int is_sent;
- INSTANCE who_sent; /* instance which have
- send a buffer */
- unsigned long datalen;
- void *dataptr;
-} Buffer_Wait_Queue;
-
-typedef struct BUFFER_SEND_QUEUE
-{
- struct BUFFER_SEND_QUEUE *forward;
- int priority;
- INSTANCE this;
- int is_delayed;
- unsigned long datalen;
- void *dataptr;
-} Buffer_Send_Queue;
-
-typedef struct BUFFERQUEUE
-{
- Buffer_Wait_Queue *waitqueue;
- unsigned long waitqueuelength;
- Buffer_Send_Queue *sendqueue;
- unsigned long sendqueuelength;
-} Buffer_Queue;
-
-typedef struct
-{
- Buffer_Queue **buf;
- unsigned long maxqueuelength;
-} Buffer_Descr;
-
-/* descriptor for data */
-typedef struct
-{
- void *ptr;
- int length;
-} Data_Descr;
-
-/* time format runtime delivers */
-typedef struct
-{
- unsigned long secs;
- unsigned long nanosecs;
-} RtsTime;
-
-extern void __rtstime (RtsTime *t);
-extern int __delay_this (Delay_Reason reason, RtsTime *t, char *file, int lineno);
-extern void __continue_that (INSTANCE ins, int prio, char *file, int lineno);
-
-#endif /* __rts_h_ */
diff --git a/libchill/rtsdummy.c b/libchill/rtsdummy.c
deleted file mode 100644
index c49de589844..00000000000
--- a/libchill/rtsdummy.c
+++ /dev/null
@@ -1,72 +0,0 @@
-/* Implement runtime actions for CHILL.
- Copyright (C) 1992,1993 Free Software Foundation, Inc.
- Author: Wilfried Moser
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with other files,
- some of which are compiled with GCC, to produce an executable,
- this library 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. */
-
-#define __CHILL_LIB__
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <setjmp.h>
-/*#include "gvarargs.h" Gcc source and runtime libs use gvarargs.h */
-
-#include "rtltypes.h"
-
-typedef void (*init_ptr) ();
-typedef int * tasking_ptr;
-
-/* Dummy functions for rts access. When we come here we have an error. */
-
-typedef char *(*fetch_names) (int number);
-typedef int (*fetch_numbers) (char *name);
-
-static void __rts_main_loop ()
-{
- /* do nothing in case of no run time system */
-}
-init_ptr __RTS_MAIN_LOOP__ = __rts_main_loop;
-
-static void __rts_init ()
-{
- /* do nothing in case of no run time system */
-}
-init_ptr __RTS_INIT__ = __rts_init;
-
-static char *__fetch_name (int number)
-{
- fprintf (stderr, "ChillLib: fetch_name: no runtime system library linked.\n");
- fflush (stderr);
- abort ();
-}
-fetch_names __RTS_FETCH_NAMES__ = __fetch_name;
-
-static int __fetch_number (char *name)
-{
- fprintf (stderr, "ChillLib: fetch_number: no runtime system library linked.\n");
- fflush (stderr);
- abort ();
-}
-fetch_numbers __RTS_FETCH_NUMBERS__ = __fetch_number;
diff --git a/libchill/sendbuffer.c b/libchill/sendbuffer.c
deleted file mode 100644
index 7ca229c81be..00000000000
--- a/libchill/sendbuffer.c
+++ /dev/null
@@ -1,184 +0,0 @@
-/* Implement tasking-related runtime actions for CHILL.
- Copyright (C) 1992,1993 Free Software Foundation, Inc.
- Author: Wilfried Moser
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with other files,
- some of which are compiled with GCC, to produce an executable,
- this library 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. */
-
-#include <string.h>
-#include "rtltypes.h"
-#include "rts.h"
-
-EXCEPTION (sendfail);
-
-extern void __cause_ex1 (char *ex, char *file, int lineno);
-
-#define CAUSE_SENDFAIL __cause_ex1 ("sendfail", filename, lineno)
-
-/*
- * function __send_buffer
- *
- * parameters:
- * buffer pointer to buffer descriptor
- * data pointer to data descriptor
- * prio priority for send action
- * timeout pointer to timeout value
- * filename source file name where function gets called
- * lineno linenumber in source file
- *
- * returns:
- * int 0 .. success
- * 1 .. timeout
- *
- * exceptions:
- * sendfail
- *
- * abstract:
- * implement the CHILL SEND buffer action.
- */
-
-int
-__send_buffer (buffer, data, prio, timeout, filename, lineno)
- Buffer_Descr *buffer;
- Data_Descr *data;
- int prio;
- void *timeout;
- char *filename;
- int lineno;
-{
- Buffer_Queue *bq;
- Buffer_Send_Queue *bsq, *bsq_entry, *prev_bsq_entry;
- int cnt = 0;
- int retval = 0;
-
- /* if we don't have anything queued on that buffer,
- set up the structure */
- memcpy (&bq, buffer->buf, sizeof (Buffer_Queue *));
- if (bq == 0)
- {
- MALLOC (bq, sizeof (Buffer_Queue));
- memset (bq, 0, sizeof (Buffer_Queue));
- memcpy (buffer->buf, &bq, sizeof (Buffer_Queue *));
- }
-
- /* look if there is a process delayed on that buffer */
- if (bq->waitqueue != 0)
- {
- Buffer_Wait_Queue *listentry;
-
- /* there is already a processes waiting for that buffer,
- check datalength and copy the data in */
- if (bq->waitqueue->datalen < data->length)
- CAUSE_SENDFAIL;
- memcpy (bq->waitqueue->dataptr, data->ptr, data->length);
-
- /* set up the entry */
- bq->waitqueue->is_sent = 1;
- bq->waitqueue->who_sent = THIS;
-
- /* continue waiting process */
- __continue_that (bq->waitqueue->this, prio, filename, lineno);
-
- /* now dequeue all entries of this list */
- listentry = bq->waitqueue->startlist;
- while (listentry != 0)
- {
- Buffer_Wait_Queue *tmp, *prev_entry, *bwq;
- Buffer_Queue *bq;
-
- tmp = listentry->chain;
- memcpy (&bq, listentry->bufferaddr, sizeof (Buffer_Queue *));
- prev_entry = (Buffer_Wait_Queue *)&bq->waitqueue;
- bwq = bq->waitqueue;
-
- while (bwq != listentry)
- {
- prev_entry = bwq;
- bwq = bwq->forward;
- }
- /* dequeue it */
- prev_entry->forward = bwq->forward;
- bq->waitqueuelength--;
- listentry = tmp;
- }
-
- /* all done */
- return 0;
- }
-
- /* nothing in waitqueue, set up an entry for sendqueue.
- Note: we allocate here space for the data too, to reduce
- calls to malloc and let the dataptr point just behind
- the Buffer_Send_Queue structure. */
- MALLOC (bsq_entry, sizeof (Buffer_Send_Queue) + data->length);
- memset (bsq_entry, 0, sizeof (Buffer_Send_Queue));
-
- bsq_entry->priority = prio;
- bsq_entry->this = THIS;
- bsq_entry->datalen = data->length;
- bsq_entry->dataptr = bsq_entry + 1;
- memcpy (bsq_entry->dataptr, data->ptr, data->length);
-
- /* add entry to sendqueue */
- prev_bsq_entry = (Buffer_Send_Queue *)&bq->sendqueue;
- bsq = bq->sendqueue;
-
- while (bsq != 0 && bsq->priority >= prio)
- {
- prev_bsq_entry = bsq;
- bsq = bsq->forward;
- }
- if (bsq == 0)
- {
- /* beginning or end of the list */
- prev_bsq_entry->forward = bsq_entry;
- }
- else
- {
- /* somewhere in the middle */
- bsq_entry->forward = prev_bsq_entry->forward;
- prev_bsq_entry->forward = bsq_entry;
- }
-
- if (buffer->maxqueuelength != (unsigned long)-1L &&
- bq->sendqueuelength >= buffer->maxqueuelength)
- {
- /* we have to delay this process */
- bsq_entry->is_delayed = 1;
- retval = __delay_this (wait_buffer_send, timeout, filename, lineno);
- if (retval)
- {
- prev_bsq_entry->forward = bsq_entry->forward;
- FREE (bsq_entry);
- }
- }
- else
- /* just say that there is one more entry in the queue */
- bq->sendqueuelength++;
- return retval;
-}
-
-/* force function __print_buffer to be linked */
-extern void __print_buffer ();
-static EntryPoint pev = __print_buffer;
diff --git a/libchill/sequencible.c b/libchill/sequencible.c
deleted file mode 100644
index c8bdb573834..00000000000
--- a/libchill/sequencible.c
+++ /dev/null
@@ -1,40 +0,0 @@
-/* Implement Input/Output runtime actions for CHILL.
- Copyright (C) 1992,1993 Free Software Foundation, Inc.
- Author: Wilfried Moser, et al
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with other files,
- some of which are compiled with GCC, to produce an executable,
- this library 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. */
-
-#include "fileio.h"
-
-Boolean
-__sequencible( Association_Mode* the_assoc, char* file, int line )
-{
- if( !the_assoc )
- CHILLEXCEPTION( file, line, EMPTY, NULL_ASSOCIATION );
- if( !TEST_FLAG(the_assoc, IO_ISASSOCIATED) )
- CHILLEXCEPTION( file, line, NOTASSOCIATED, IS_NOT_ASSOCIATED );
- return TEST_FLAG(the_assoc, IO_SEQUENCIBLE) ? True : False;
-}
-
diff --git a/libchill/setbitps.c b/libchill/setbitps.c
deleted file mode 100644
index 859c9a2714c..00000000000
--- a/libchill/setbitps.c
+++ /dev/null
@@ -1,96 +0,0 @@
-/* Implement POWERSET runtime actions for CHILL.
- Copyright (C) 1992,1993 Free Software Foundation, Inc.
- Author: Wilfried Moser, et al
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with other files,
- some of which are compiled with GCC, to produce an executable,
- this library 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. */
-
-#define __CHILL_LIB__
-
-#include <stdio.h>
-#include "powerset.h"
-
-extern void __cause_ex1 (char *exname, char *file, int lineno);
-
-/*
- * function __setbitpowerset
- *
- * parameters:
- * set destination set
- * bitlength length of powerset in bits
- * minval lowest valid set value
- * bitno bit number within set
- * new_value zero or one - (new bit value)
- *
- * returns:
- * int 1 .. found
- * 0 .. not found
- *
- * exceptions:
- * rangefail
- *
- * abstract:
- * checks if a given value is included in a powerset
- *
- */
-void
-__setbitpowerset (powerset, bitlength, minval, bitno, new_value, filename, lineno)
- SET_WORD *powerset;
- unsigned long bitlength;
- long minval;
- long bitno;
- char new_value; /* booleans are represented as 8 bit value */
- char * filename;
- int lineno;
-{
- if (powerset == NULL
- || bitno < minval
- || (bitno - minval) >= bitlength)
- __cause_ex1 ("rangefail", filename, lineno);
-
- bitno -= minval;
- if (bitlength <= SET_CHAR_SIZE)
- {
- if (new_value & 1)
- SET_BIT_IN_CHAR (*((SET_CHAR *)powerset), bitno);
- else
- CLEAR_BIT_IN_CHAR (*((SET_CHAR *)powerset), bitno);
- }
- else if (bitlength <= SET_SHORT_SIZE)
- {
- if (new_value & 1)
- SET_BIT_IN_SHORT (*((SET_SHORT *)powerset), bitno);
- else
- CLEAR_BIT_IN_SHORT (*((SET_SHORT *)powerset), bitno);
- }
- else
- {
- powerset += (bitno/SET_WORD_SIZE);
- bitno %= SET_WORD_SIZE;
- if (new_value & 1)
- SET_BIT_IN_WORD (*powerset, bitno);
- else
- CLEAR_BIT_IN_WORD (*powerset, bitno);
- }
-}
diff --git a/libchill/setbits.c b/libchill/setbits.c
deleted file mode 100644
index ffade265579..00000000000
--- a/libchill/setbits.c
+++ /dev/null
@@ -1,92 +0,0 @@
-/* Implement POWERSET runtime actions for CHILL.
- Copyright (C) 1992,1993 Free Software Foundation, Inc.
- Author: Wilfried Moser, et al
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with other files,
- some of which are compiled with GCC, to produce an executable,
- this library 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. */
-
-#define __CHILL_LIB__
-
-#include <stdio.h>
-#include "powerset.h"
-
-extern void __cause_ex1 (char *exname, char *file, int lineno);
-
-/*
- * function __setbits
- *
- * parameters:
- * out result
- * bitlength length of bitstring in bits
- * startbit starting bitnumber
- * endbit ending bitnumber
- *
- * returns:
- * void
- *
- * exceptions:
- * rangefail
- *
- * abstract:
- * set all bits from starting bitnumber to ending bitnumber
- * in a powerset
- *
- */
-void
-__setbits (out, bitlength, startbit, endbit)
- SET_WORD *out;
- unsigned long bitlength;
- long startbit;
- long endbit;
-{
- unsigned long i;
-
- if (out == NULL
- || startbit < 0
- || startbit >= bitlength
- || endbit < 0
- || endbit >= bitlength
- || endbit < startbit)
- __cause_ex1 ("rangefail", "__setbits", __LINE__);
-
- if (bitlength <= SET_CHAR_SIZE)
- for (i = startbit; i <= endbit; i++)
- SET_BIT_IN_CHAR (*((SET_CHAR *)out), i);
- else if (bitlength <= SET_SHORT_SIZE)
- for (i = startbit; i <= endbit; i++)
- SET_BIT_IN_SHORT (*((SET_SHORT *)out), i);
- else
- {
- SET_WORD *p;
- unsigned long bitnr;
-
- /* FIXME - this is inefficient! */
- for (i = startbit; i <= endbit; i++)
- {
- p = out + (i / SET_WORD_SIZE);
- bitnr = i % SET_WORD_SIZE;
- SET_BIT_IN_WORD (*p, bitnr);
- }
- }
-}
diff --git a/libchill/settextaccess.c b/libchill/settextaccess.c
deleted file mode 100644
index 99c6b57553e..00000000000
--- a/libchill/settextaccess.c
+++ /dev/null
@@ -1,47 +0,0 @@
-/* Implement Input/Output runtime actions for CHILL.
- Copyright (C) 1992,1993 Free Software Foundation, Inc.
- Author: Wilfried Moser, et al
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with other files,
- some of which are compiled with GCC, to produce an executable,
- this library 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. */
-
-#include "fileio.h"
-
-void
-__settextaccess( Text_Mode* the_text,
- Access_Mode* the_access,
- char* file,
- int line )
-{
- if( !the_text )
- CHILLEXCEPTION( file, line, EMPTY, NULL_TEXT );
-
- if( !the_access )
- CHILLEXCEPTION( file, line, EMPTY, NULL_ACCESS );
-
- CLR_FLAG( the_text->access_sub, IO_TEXTIO );
-
- the_text->access_sub = the_access;
- SET_FLAG( the_access, IO_TEXTIO );
-}
diff --git a/libchill/settextindex.c b/libchill/settextindex.c
deleted file mode 100644
index bf0388ad201..00000000000
--- a/libchill/settextindex.c
+++ /dev/null
@@ -1,46 +0,0 @@
-/* Implement Input/Output runtime actions for CHILL.
- Copyright (C) 1992,1993 Free Software Foundation, Inc.
- Author: Wilfried Moser, et al
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with other files,
- some of which are compiled with GCC, to produce an executable,
- this library 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. */
-
-#include "fileio.h"
-
-void
-__settextindex( Text_Mode* the_text,
- signed long the_text_index,
- char* file,
- int line )
-{
- if( !the_text )
- CHILLEXCEPTION( file, line, EMPTY, NULL_TEXT );
-
- if( the_text_index < 0
- || the_text->access_sub->reclength - 2 < the_text_index )
- CHILLEXCEPTION( file, line, TEXTFAIL, BAD_TEXTINDEX );
-
- the_text->actual_index = the_text_index;
-}
-
diff --git a/libchill/settextrecord.c b/libchill/settextrecord.c
deleted file mode 100644
index bd03af3f16f..00000000000
--- a/libchill/settextrecord.c
+++ /dev/null
@@ -1,45 +0,0 @@
-/* Implement Input/Output runtime actions for CHILL.
- Copyright (C) 1992,1993 Free Software Foundation, Inc.
- Author: Wilfried Moser, et al
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with other files,
- some of which are compiled with GCC, to produce an executable,
- this library 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. */
-
-#include "fileio.h"
-
-void
-__settextrecord( Text_Mode* the_text,
- VarString* the_text_rec,
- char* file,
- int line )
-{
- if( !the_text )
- CHILLEXCEPTION( file, line, EMPTY, NULL_TEXT );
-
- if( !the_text_rec )
- CHILLEXCEPTION( file, line, EMPTY, NULL_TEXTREC );
-
- the_text->text_record = the_text_rec;
-}
-
diff --git a/libchill/sliceps.c b/libchill/sliceps.c
deleted file mode 100644
index 39b54c046fe..00000000000
--- a/libchill/sliceps.c
+++ /dev/null
@@ -1,72 +0,0 @@
-/* Implement POWERSET runtime actions for CHILL.
- Copyright (C) 1992,1993 Free Software Foundation, Inc.
- Author: Wilfried Moser, et al
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with other files,
- some of which are compiled with GCC, to produce an executable,
- this library 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. */
-
-#define __CHILL_LIB__
-
-#include <stdio.h>
-#include "powerset.h"
-
-/*
- * function __powerset_slice
- *
- * parameters:
- * dps dest powerset
- * dbl destination bit length
- * sps sourcepowerset
- * sbl source powerset length in bits
- * start starting bit number
- * end ending bit number
- *
- * exceptions:
- * none
- *
- * abstract:
- * Extract into a powerset a slice of another powerset.
- *
- */
-extern void
-__pscpy (SET_WORD *dps,
- unsigned long dbl,
- unsigned long doffset,
- SET_WORD *sps,
- unsigned long sbl,
- unsigned long start,
- unsigned long length);
-
-void
-__psslice (dps, dbl, sps, sbl, start, length)
- SET_WORD *dps;
- unsigned long dbl;
- SET_WORD *sps;
- unsigned long sbl;
- unsigned long start;
- unsigned long length;
-{
- /* simply supply a zero destination offset and copy the slice */
- __pscpy (dps, dbl, (unsigned long)0, sps, sbl, start, length);
-}
diff --git a/libchill/terminate.c b/libchill/terminate.c
deleted file mode 100644
index c2da4038802..00000000000
--- a/libchill/terminate.c
+++ /dev/null
@@ -1,67 +0,0 @@
-/* Implement runtime actions for CHILL.
- Copyright (C) 1992,1993 Free Software Foundation, Inc.
- Author: Wilfried Moser
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with other files,
- some of which are compiled with GCC, to produce an executable,
- this library 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. */
-
-#define __CHILL_LIB__
-
-#include <stdlib.h>
-#include "rtltypes.h"
-
-extern void __cause_ex1 (char *exname, char *file, int lineno);
-
-/* define needed exceptions */
-EXCEPTION (empty)
-
-/*
- * function __terminate
- *
- * parameter:
- * ptr pointer to memory to free
- * filename source file which issued the call
- * linenumber line number of the call within that file
- *
- * returns:
- * void
- *
- * exceptions:
- * empty
- *
- * abstract:
- * free memory previously allocated by __allocate.
- *
-*/
-
-void
-__terminate (ptr, filename, linenumber)
- void *ptr;
- char *filename;
- int linenumber;
-{
- if (! ptr)
- __cause_ex1 ("empty", filename, linenumber);
- free (ptr);
-}
diff --git a/libchill/unhex.c b/libchill/unhex.c
deleted file mode 100644
index 1a7a34408c1..00000000000
--- a/libchill/unhex.c
+++ /dev/null
@@ -1,64 +0,0 @@
-/* Implement runtime actions for CHILL.
- Copyright (C) 1992,1993 Free Software Foundation, Inc.
- Author: Wilfried Moser
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with other files,
- some of which are compiled with GCC, to produce an executable,
- this library 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. */
-
-#define __CHILL_LIB__
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <setjmp.h>
-
-/*
- * function unhandled_exception
- *
- * parameter:
- * exname name of exception
- * file filename
- * lineno line number
- * user_arg user specified argument
- *
- * returns:
- * never
- *
- * abstract:
- * print an error message about unhandled exception and call abort
- *
- */
-
-void
-unhandled_exception (exname, file, lineno, user_arg)
- char *exname;
- char *file;
- int lineno;
- int user_arg;
-{
- sleep (1); /* give previous output a chance to finish */
- fprintf (stderr, "ChillLib: unhandled exception `%s' in file %s at line %d\n",
- exname, file, lineno);
- fflush (stderr);
- abort ();
-} /* unhandled_exception */
diff --git a/libchill/unhex1.c b/libchill/unhex1.c
deleted file mode 100644
index cae20c5e258..00000000000
--- a/libchill/unhex1.c
+++ /dev/null
@@ -1,65 +0,0 @@
-/* Implement runtime actions for CHILL.
- Copyright (C) 1992,1993 Free Software Foundation, Inc.
- Author: Wilfried Moser
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with other files,
- some of which are compiled with GCC, to produce an executable,
- this library 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. */
-
-#define __CHILL_LIB__
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <setjmp.h>
-
-extern void cause_exception (char *ex, char *file, int lineno, int arg);
-extern void unhandled_exception (char *ex, char *file, int lineno, int arg);
-
-/*
- * function __unhandled_ex
- *
- * parameter:
- * exname name of exception
- * file filename
- * lineno line number
- *
- * returns:
- * never
- *
- * abstract:
- * This function gets called by compiler generated code when an unhandled
- * exception occures.
- * First cause_exception gets called (which may be user defined) and
- * then the standard unhandled exception routine gets called.
- *
- */
-
-void
-__unhandled_ex (exname, file, lineno)
- char *exname;
- char *file;
- int lineno;
-{
- cause_exception (exname, file, lineno, 0);
- unhandled_exception (exname, file, lineno, 0);
-} /* unhandled_exception */
diff --git a/libchill/variable.c b/libchill/variable.c
deleted file mode 100644
index 996118e8653..00000000000
--- a/libchill/variable.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/* Implement Input/Output runtime actions for CHILL.
- Copyright (C) 1992,1993 Free Software Foundation, Inc.
- Author: Wilfried Moser, et al
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with other files,
- some of which are compiled with GCC, to produce an executable,
- this library 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. */
-
-#include "fileio.h"
-
-Boolean
-__variable( Association_Mode* the_assoc, char* file, int line )
-{
- if( !the_assoc )
- CHILLEXCEPTION( file, line, EMPTY, NULL_ASSOCIATION );
- if( !TEST_FLAG(the_assoc, IO_ISASSOCIATED) )
- CHILLEXCEPTION( file, line, NOTASSOCIATED, IS_NOT_ASSOCIATED );
- return TEST_FLAG( the_assoc, IO_VARIABLE ) ? True : False;
-}
diff --git a/libchill/waitbuffer.c b/libchill/waitbuffer.c
deleted file mode 100644
index 939c4fca7a1..00000000000
--- a/libchill/waitbuffer.c
+++ /dev/null
@@ -1,306 +0,0 @@
-/* Implement tasking-related runtime actions for CHILL.
- Copyright (C) 1992,1993 Free Software Foundation, Inc.
- Author: Wilfried Moser
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with other files,
- some of which are compiled with GCC, to produce an executable,
- this library 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. */
-
-#include <string.h>
-#include "rtltypes.h"
-#include "rts.h"
-
-extern void __cause_ex1 (char *ex, char *file, int lineno);
-
-EXCEPTION (bufferinconsistency)
-#define CAUSE_BUFFINCONS __cause_ex1 ("bufferinconsistency", filename, lineno)
-EXCEPTION (spacefail);
-#define CAUSE_SPACEFAIL __cause_ex1 ("spacefail", filename, lineno)
-
-/*
- * function __wait_buffer
- *
- * parameters:
- * buf_got pointer to location for writing the received buffer address
- * nbuf number of buffers in RECEIVE CASE
- * bufptr array of pointers to buffer descriptor
- * datap pointer where to store data
- * datalen length of data
- * ins pointer to instance location or 0
- * else_clause else specified or not
- * to_loc pointer to timesupervision value
- * filename source file name where function gets called
- * lineno linenumber in source file
- *
- * returns:
- * int 0 .. success
- * 1 .. timed out
- *
- * exceptions:
- * bufferinconsistency if something's wrong in the buffer queue's
- * spacefail out of heap space of datalength of receiver
- * less then data avilable.
- *
- * abstract:
- * implement the CHILL RECEIVE buffer CASE action.
- */
-
-int
-__wait_buffer (buf_got, nbuf, bufptr, datap, datalen, ins,
- else_clause, to, filename, lineno)
- void **buf_got;
- int nbuf;
- Buffer_Descr *bufptr[];
- void *datap;
- int datalen;
- INSTANCE *ins;
- int else_clause;
- void *to;
- char *filename;
- int lineno;
-{
- int i;
- Buffer_Wait_Queue *start_list;
- Buffer_Queue **retval;
- Buffer_Queue **highprio;
- int timed_out;
-
- /* look if there is a buffer already sent */
- highprio = 0;
- for (i = 0; i < nbuf; i++)
- {
- Buffer_Queue *bq;
-
- memcpy (&bq, bufptr[i]->buf, sizeof (Buffer_Queue *));
- if (bq != 0 && bq->sendqueue != 0)
- {
- if (highprio != 0)
- {
- Buffer_Queue *bsq = *highprio;
-
- if (bq->sendqueue->priority > bsq->sendqueue->priority)
- highprio = bufptr[i]->buf;
- }
- else
- highprio = bufptr[i]->buf;
- }
- }
-
- if (highprio != 0)
- {
- Buffer_Queue *bq;
-
- memcpy (&bq, highprio, sizeof (Buffer_Queue *));
- if (bq != 0 && bq->sendqueue != 0)
- {
- Buffer_Send_Queue *bsq = bq->sendqueue;
- Buffer_Send_Queue *tmp;
-
- /* check data length */
- if (datalen < bsq->datalen)
- /* something's totaly wrong. Raise exception */
- CAUSE_SPACEFAIL;
-
- /* copy data out */
- memcpy (datap, bsq->dataptr, bsq->datalen);
-
- /* update instance, if present */
- if (ins != 0)
- memcpy (ins, &bsq->this, sizeof (INSTANCE));
-
- /* dequeue entry */
- tmp = bsq;
- bq->sendqueue = tmp->forward;
-
- if (tmp->is_delayed)
- {
- /* there is an instance delayed on a send,
- continue it. */
- __continue_that (tmp->this, tmp->priority, filename, lineno);
- FREE (tmp);
-
- /* return the buffer we have received from */
- *buf_got = (void *)highprio;
- return 0;
- }
-
- /* just decrease sendqueue length */
- bq->sendqueuelength--;
-
- FREE (tmp);
-
- /* as we got an entry free, we should continue
- an INSTANCE which is delayed on a send at this
- buffer */
- bsq = bq->sendqueue;
- while (bsq != 0)
- {
- if (bsq->is_delayed)
- {
- bq->sendqueuelength++;
- bsq->is_delayed = 0;
- __continue_that (bsq->this, bsq->priority, filename, lineno);
- break;
- }
- bsq = bsq->forward;
- }
- /* return the buffer we have received from */
- *buf_got = (void *)highprio;
- return 0;
- }
- }
-
- /* if we come here, there is no buffer already sent */
- if (else_clause != 0)
- {
- /* in that case we return immediately */
- *buf_got = 0;
- return 0;
- }
-
- /* now we have to queue ourself to the wait queue(s) */
- start_list = 0;
- for (i = 0; i < nbuf; i++)
- {
- Buffer_Queue *bq;
- Buffer_Wait_Queue *wrk;
- Buffer_Wait_Queue *bwq;
- Buffer_Wait_Queue *prev_queue_entry = 0;
- Buffer_Wait_Queue *prev_list_entry;
- int j, have_done = 0;
-
- for (j = 0; j < i; j++)
- {
- if (bufptr[i]->buf == bufptr[j]->buf)
- {
- have_done = 1;
- break;
- }
- }
- if (have_done)
- continue;
-
- memcpy (&bq, bufptr[i]->buf, sizeof (Buffer_Queue *));
- if (bq == 0)
- {
- MALLOC (bq, sizeof (Buffer_Queue));
- memset (bq, 0, sizeof (Buffer_Queue));
- /* *(bufptr[i]->buf) = bq; may be unaligned */
- memcpy (bufptr[i]->buf, &bq, sizeof (Buffer_Queue *));
- }
- MALLOC (wrk, sizeof (Buffer_Wait_Queue));
- memset (wrk, 0, sizeof (Buffer_Wait_Queue));
- bwq = (Buffer_Wait_Queue *)&bq->waitqueue;
-
- wrk->this = THIS;
- wrk->datalen = datalen;
- wrk->dataptr = datap;
- wrk->bufferaddr = bufptr[i]->buf;
-
- /* queue it at the end of buffer wait queue */
- while (bwq->forward != 0)
- bwq = bwq->forward;
- wrk->forward = bwq->forward;
- bwq->forward = wrk;
-
- /* queue it into list */
- wrk->startlist = start_list;
- if (! start_list)
- {
- start_list = wrk;
- prev_list_entry = wrk;
- wrk->startlist = start_list;
- }
- else
- {
- prev_list_entry->chain = wrk;
- prev_list_entry = wrk;
- }
-
- /* increment wait queue count */
- bq->waitqueuelength++;
- }
-
- /* tell runtime system to delay this process */
- timed_out = __delay_this (wait_buffer_receive, to, filename, lineno);
- if (timed_out)
- {
- /* remove all entries from buffer queues */
- Buffer_Wait_Queue *listentry = start_list;
-
- while (listentry != 0)
- {
- Buffer_Queue *bq = *(listentry->bufferaddr);
- Buffer_Wait_Queue *prev_entry = (Buffer_Wait_Queue *)&bq->waitqueue;
- Buffer_Wait_Queue *bwq = bq->waitqueue;
-
- while (bwq != listentry)
- {
- prev_entry = bwq;
- bwq = bwq->forward;
- }
- /* dequeue it */
- prev_entry->forward = bwq->forward;
- bq->waitqueuelength--;
- listentry = listentry->chain;
- }
- }
-
- /* someone has continued us, find which buffer got ready */
- retval = 0;
-
- while (start_list != 0)
- {
- Buffer_Wait_Queue *tmp = start_list->chain;
-
- if (start_list->is_sent)
- {
- /* this one has been sent */
- /* save return value */
- if (retval == 0)
- retval = start_list->bufferaddr;
- else
- /* more then one has been sent, that's wrong */
- CAUSE_BUFFINCONS;
-
- /* update instance, if present */
- if (ins != 0)
- memcpy (ins, &start_list->who_sent, sizeof (INSTANCE));
- }
- FREE (start_list);
- start_list = tmp;
- }
-
- /* now check if there was really a buffer got */
- if (retval == 0 && !timed_out)
- /* something's totally wrong, raise an exception */
- CAUSE_BUFFINCONS;
-
- if (!timed_out)
- *buf_got = (void *)retval;
- return timed_out;
-}
-
-/* force function __print_buffer to be linked */
-extern void __print_buffer ();
-static EntryPoint pev = __print_buffer;
diff --git a/libchill/waituntil.c b/libchill/waituntil.c
deleted file mode 100644
index 2245a81809a..00000000000
--- a/libchill/waituntil.c
+++ /dev/null
@@ -1,82 +0,0 @@
-/* Implement timing-related runtime actions for CHILL.
- Copyright (C) 1992,1993 Free Software Foundation, Inc.
- Author: Wilfried Moser
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with other files,
- some of which are compiled with GCC, to produce an executable,
- this library 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. */
-
-#include "rtltypes.h"
-#include "rts.h"
-
-EXCEPTION (timerfail);
-
-/*
- * function __wait_until
- *
- * parameters:
- * abstime absolute time value
- * filename
- * linenumber
- *
- * returns:
- * int 0 on success, 1 on failure
- *
- * exceptions:
- * timerfail
- *
- * abstract:
- * check for given argument is valid, calculate how long to wait in
- * seconds and call os to do it.
- *
- */
-
-int
-__wait_until (abstime, filename, linenumber)
- unsigned long abstime;
- char *filename;
- int linenumber;
-{
- RtsTime now, delta, abs_rtstime;
-
- /* get current time */
- __rtstime (&now);
-
- abs_rtstime.secs = abstime;
- abs_rtstime.nanosecs = 0;
-
- if (abs_rtstime.nanosecs < now.nanosecs)
- {
- abs_rtstime.secs--;
- abs_rtstime.nanosecs += 1000000000;
- }
-
- delta.secs = abs_rtstime.secs - now.secs;
- delta.nanosecs = abs_rtstime.nanosecs - now.nanosecs;
-
- if (delta.secs > abs_rtstime.secs)
- /* cannot wait into past */
- return 1;
-
- return __delay_this (wait_wait, &delta, filename, linenumber) == 1 ? 0 : 1;
-}
diff --git a/libchill/writeable.c b/libchill/writeable.c
deleted file mode 100644
index 9278ed1ec1a..00000000000
--- a/libchill/writeable.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/* Implement Input/Output runtime actions for CHILL.
- Copyright (C) 1992,1993 Free Software Foundation, Inc.
- Author: Wilfried Moser, et al
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with other files,
- some of which are compiled with GCC, to produce an executable,
- this library 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. */
-
-#include "fileio.h"
-
-Boolean
-__writeable( Association_Mode* the_assoc, char* file, int line )
-{
- if( !the_assoc )
- CHILLEXCEPTION( file, line, EMPTY, NULL_ASSOCIATION );
- if( !TEST_FLAG(the_assoc, IO_ISASSOCIATED) )
- CHILLEXCEPTION( file, line, NOTASSOCIATED, IS_NOT_ASSOCIATED );
- return TEST_FLAG(the_assoc, IO_WRITEABLE) ? True : False;
-}
diff --git a/libchill/writerecord.c b/libchill/writerecord.c
deleted file mode 100644
index 887bb3d4989..00000000000
--- a/libchill/writerecord.c
+++ /dev/null
@@ -1,141 +0,0 @@
-/* Implement Input/Output runtime actions for CHILL.
- Copyright (C) 1992,1993 Free Software Foundation, Inc.
- Author: Wilfried Moser, et al
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with other files,
- some of which are compiled with GCC, to produce an executable,
- this library 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. */
-
-#include <setjmp.h>
-#include <errno.h>
-#include <string.h>
-#include <unistd.h>
-#include <sys/types.h>
-
-#include "fileio.h"
-
-static
-void
-doWrite( Access_Mode* the_access, void* buf, size_t nbyte )
-{
- size_t nwrit;
-
- nwrit = write( the_access->association->handle, buf, nbyte );
-
- if( nwrit < nbyte )
- {
- the_access->association->syserrno = errno;
- RWEXCEPTION( WRITEFAIL, OS_IO_ERROR );
- }
-}
-
-
-void
-__writerecord( Access_Mode* the_access,
- signed long the_index,
- char* the_val_addr,
- unsigned long the_val_len,
- char* file,
- int line )
-
-{
- Association_Mode* the_assoc;
- unsigned long info;
- char* actaddr;
- unsigned short actlen;
- off_t filepos;
-
- if( !the_access )
- CHILLEXCEPTION( file, line, EMPTY, NULL_ACCESS );
-
- if( !(the_assoc = the_access->association) )
- CHILLEXCEPTION( file, line, NOTCONNECTED, IS_NOT_CONNECTED );
-
- /* Usage must no be ReadOnly */
- if( the_assoc->usage == ReadOnly )
- CHILLEXCEPTION( file, line, WRITEFAIL, BAD_USAGE );
-
- /*
- * Positioning
- */
- if( TEST_FLAG( the_access, IO_INDEXED ) )
- {
- /* index expression must be within bounds of index mode */
- if( the_index < the_access->lowindex
- || the_access->highindex < the_index )
- CHILLEXCEPTION( file, line, RANGEFAIL, BAD_INDEX );
- filepos = the_access->base +
- (the_index - the_access->lowindex) * the_access->reclength;
-
- if( lseek( the_assoc->handle, filepos, SEEK_SET ) == -1L )
- CHILLEXCEPTION( file, line, WRITEFAIL, LSEEK_FAILS );
- }
-
- if( (info = setjmp( __rw_exception )) )
- CHILLEXCEPTION( file, line, info>>16, info & 0xffff );
-
- if( TEST_FLAG( the_access, IO_TEXTIO ) )
- {
- if( TEST_FLAG( the_access, IO_INDEXED ) )
- {
- int nspace = the_access->reclength - the_val_len;
- memset( the_val_addr + 2 + the_val_len, ' ', nspace );
- actlen = the_access->reclength - 2;
- MOV2(the_val_addr,&actlen);
- doWrite( the_access, the_val_addr, the_access->reclength );
- }
- else
- {
- if( the_assoc->ctl_pre )
- write( the_assoc->handle, &the_assoc->ctl_pre, 1 );
- MOV2(&actlen,the_val_addr);
- write( the_assoc->handle, the_val_addr + 2, actlen );
- if( the_assoc->ctl_post )
- write( the_assoc->handle, &the_assoc->ctl_post, 1 );
- the_assoc->ctl_pre = '\0';
- the_assoc->ctl_post = '\n';
- }
- }
- else
- {
- switch( the_access->rectype )
- {
- case Fixed:
- if( TEST_FLAG( the_assoc, IO_VARIABLE ) )
- {
- actlen = the_access->reclength;
- doWrite( the_access, &actlen, sizeof(actlen) );
- }
- doWrite( the_access, the_val_addr, the_val_len );
- break;
- case VaryingChars:
- MOV2(&actlen,the_val_addr);
- if( actlen > the_access->reclength - 2 )
- CHILLEXCEPTION( file, line, RANGEFAIL, RECORD_TOO_LONG );
- actlen = TEST_FLAG( the_access, IO_INDEXED )
- ? the_access->reclength : actlen + 2;
- doWrite( the_access, the_val_addr, actlen );
- break;
- }
- }
-}
diff --git a/libchill/xorps.c b/libchill/xorps.c
deleted file mode 100644
index 83f972071f1..00000000000
--- a/libchill/xorps.c
+++ /dev/null
@@ -1,83 +0,0 @@
-/* Implement POWERSET runtime actions for CHILL.
- Copyright (C) 1992,1993 Free Software Foundation, Inc.
- Author: Wilfried Moser, et al
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* As a special exception, if you link this library with other files,
- some of which are compiled with GCC, to produce an executable,
- this library 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. */
-
-#define __CHILL_LIB__
-
-#include <stdio.h>
-#include "powerset.h"
-
-/*
- * function __xorpowerset
- *
- * parameters:
- * out return from __xorpowerset
- * left left powerset
- * right right powerset
- * bitlength length of powerset in bits
- *
- * returns:
- * void
- *
- * exceptions:
- * none
- *
- * abstract:
- * xor's 2 powersets
- *
- */
-
-void
-__xorpowerset (out, left, right, bitlength)
- SET_WORD *out;
- SET_WORD *left;
- SET_WORD *right;
- unsigned long bitlength;
-{
- if (bitlength <= SET_CHAR_SIZE)
- {
- *((SET_CHAR *)out) = *((SET_CHAR *)left) ^
- *((SET_CHAR *)right);
- MASK_UNUSED_CHAR_BITS((SET_CHAR *)out, bitlength);
- }
- else if (bitlength <= SET_SHORT_SIZE)
- {
- *((SET_SHORT *)out) = *((SET_SHORT *)left) ^
- *((SET_SHORT *)right);
- MASK_UNUSED_SHORT_BITS((SET_SHORT *)out, bitlength);
- }
- else
- {
- unsigned long len = BITS_TO_WORDS(bitlength);
- register unsigned long i;
-
- for (i = 0; i < len; i++)
- out[i] = left[i] ^ right[i];
- MASK_UNUSED_WORD_BITS ((out + len - 1),
- bitlength % SET_WORD_SIZE);
- }
-}
diff --git a/libf2c/ChangeLog b/libf2c/ChangeLog
index 7e8f1053c79..8793ff3ce96 100644
--- a/libf2c/ChangeLog
+++ b/libf2c/ChangeLog
@@ -1,3 +1,113 @@
+2002-02-20 Release Manager
+
+ * GCC 3.0.4 Released.
+
+2001-12-20 Release Manager
+
+ * GCC 3.0.3 Released.
+
+2001-12-03 Toon Moene <toon@moene.indiv.nluug.nl>
+
+ PR fortran/4885
+ * endfile.c (t_runc): After ftruncate, seek to end-of-file.
+
+2001-11-25 Toon Moene <toon@moene.indiv.nluug.nl>
+
+ * libF77/Makefile.in: Fix non-portable use of `$<' in z_log.c's rule.
+
+2001-11-25 Toon Moene <toon@moene.indiv.nluug.nl>
+
+ PR libf2c/4930
+ * libF77/Makefile.in: Compile z_log.c with -ffloat-store.
+
+2001-10-23 Release Manager
+
+ * GCC 3.0.2 Released.
+
+2001-08-19 Release Manager
+
+ * GCC 3.0.1 Released.
+
+2001-08-19 Release Manager
+
+ * GCC 3.0.1 Released.
+
+20010617 Release Manager
+
+ * GCC 3.0 Released.
+
+2001-06-13 Toon Moene <toon@moene.indiv.nluug.nl>
+
+ * libI77/inquire.c: Include "config.h".
+
+2001-05-21 Loren J. Rittle <ljrittle@acm.org>
+
+ * libI77/Makefile.in (stamp-h): Create in $(objdir) instead
+ of $(srcdir).
+
+2001-05-18 Andreas Jaeger <aj@suse.de>
+
+ * libI77/Makefile.in (stamp-h): Only create config.h, touch stamp-h.
+ (${srcdir}/config.h.in): Add true rule.
+
+ * libI77/stamp-h.in: Added.
+
+2001-05-17 Andreas Jaeger <aj@suse.de>
+
+ * libI77/Makefile.in: Add rules to rebuild config.h.in when
+ needed.
+
+2001-05-16 Andreas Jaeger <aj@suse.de>
+
+ * libI77/backspace.c: Include "config.h".
+ * libI77/close.c: Likewise.
+ * libI77/dfe.c: Likewise.
+ * libI77/dolio.c: Likewise.
+ * libI77/due.c: Likewise.
+ * libI77/err.c: Likewise.
+ * libI77/fmt.c: Likewise.
+ * libI77/fmtlib.c: Likewise.
+ * libI77/ftell_.c: Likewise.
+ * libI77/ilnw.c: Likewise.
+ * libI77/lread.c: Likewise.
+ * libI77/open.c: Likewise.
+ * libI77/rdfmt.c: Likewise.
+ * libI77/rsfe.c: Likewise.
+ * libI77/rsne.c: Likewise.
+ * libI77/util.c: Likewise.
+ * libI77/wrtfmt.c: Likewise.
+ * libI77/wsne.c: Likewise.
+ * libI77/xwsne.c: Likewise.
+
+ * libI77/config.h.in: Generate with autoheader.
+
+ * libI77/configure.in: Add comments for all AC_DEFINES so that
+ autoheader can grok it.
+ * libI77/configure: Regenerated.
+
+2001-05-16 Andreas Jaeger <aj@suse.de>
+
+ * libI77/Makefile.in (endfile.o): Add dependency on config.h.
+
+ * libI77/endfile.c: Include config.h and sys/types for off_t.
+
+ * libI77/config.h.in: New file.
+
+ * libI77/configure.in: Add test for off_t, create config.h file.
+ * libI77/configure: Regenerated.
+
+2001-05-15 Loren J. Rittle <ljrittle@acm.org>
+
+ * libI77/endfile.c (t_runc): Add cast to help case where
+ ftruncate() prototype is somehow missing even though autoconf
+ test found it properly.
+
+2001-02-27 Toon Moene <toon@moene.indiv.nluug.nl>
+
+ * libI77/configure.in: Test for ftruncate.
+ * libI77/configure: Rebuilt.
+ * libI77/endfile.c: Use fflush/ftruncate when available.
+
2001-02-08 Geoffrey Keating <geoffk@redhat.com>
* configure.in: Don't run AC_PROG_CC_WORKS, because
@@ -122,7 +232,7 @@ Wed Feb 16 11:10:05 2000 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
Tue Nov 16 20:39:42 1999 Geoffrey Keating <geoffk@cygnus.com>
* libU77/u77-test.f (wd): Allow for longer working directory
- pathnames.
+ pathnames.
1999-10-14 Theo Papadopoulo <Theodore.Papadopoulo@sophia.inria.fr>
@@ -196,7 +306,7 @@ Wed May 26 14:26:35 1999 Craig Burley <craig@jcb-sc.com>
Thu May 20 03:20:59 1999 Jeffrey A Law (law@cygnus.com)
- * configure.in (AC_EXEEXT): Remove call.
+ * configure.in (AC_EXEEXT): Remove call.
(compiler_name): Explicitly check with no extension and .exe
extension.
* configure: Regenerate.
@@ -292,7 +402,7 @@ Sat Apr 17 17:33:30 1999 Craig Burley <craig@jcb-sc.com>
(s-libu77): Depend on u77.
Mon Apr 12 21:38:14 1999 Mumit Khan <khan@xraylith.wisc.edu>
-
+
* libF77/getenv_.c: Include stdlib.h.
Sun Apr 11 23:30:42 1999 Mumit Khan <khan@xraylith.wisc.edu>
@@ -310,10 +420,10 @@ Sun Apr 11 23:30:42 1999 Mumit Khan <khan@xraylith.wisc.edu>
Wed Mar 31 13:50:24 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* configure.in (extra_includes): Don't attempt to calculate the
- location of the gcc src or obj directories. Instead rely on
- precomputed variables, $topsrcdir and $r, to obtain these values.
+ location of the gcc src or obj directories. Instead rely on
+ precomputed variables, $topsrcdir and $r, to obtain these values.
Set -I flags appropriately.
-
+
1999-03-28 Dave Love <fx@gnu.org>
* configure: Rebuilt.
@@ -347,7 +457,7 @@ Wed Mar 24 22:41:28 1999 Mumit Khan <khan@xraylith.wisc.edu>
on respective .c file.
* libF77/Makefile.in (all .o except VersionF.o): Similarly.
* libU77/Makefile.in (date_.o): Added dependence on date_.c
-
+
1999-03-06 Craig Burley <craig@jcb-sc.com>
Rename non-Y2K-compliant intrinsics:
@@ -451,11 +561,11 @@ Mon Oct 5 01:16:10 1998 H.J. Lu (hjl@gnu.org)
* Makefile.in (f2cext.c): Depend on g2c.h.
-1998-09-30 Robert Lipe <robertl@dgii.com>
+1998-09-30 Robert Lipe <robertl@dgii.com>
- * Makefile.in (all): Correct dependencies so --disable-multilibs
+ * Makefile.in (all): Correct dependencies so --disable-multilibs
works again.
- (distclean): Correct typo.
+ (distclean): Correct typo.
1998-09-28 Dave Love <d.love@dl.ac.uk>
@@ -469,11 +579,11 @@ Mon Oct 5 01:16:10 1998 H.J. Lu (hjl@gnu.org)
Mon Sep 21 12:27:27 1998 Robert Lipe <robertl@dgii.com>
- * Makefile.in (distclean, clean, uninstall, install, all): Add
+ * Makefile.in (distclean, clean, uninstall, install, all): Add
multilib support.
* configure.in: Likewise.
* configure: Regenerate.
- * libF77/Makefile.in, libU77/Makefile.in, libI77/Makefile.in (clean):
+ * libF77/Makefile.in, libU77/Makefile.in, libI77/Makefile.in (clean):
Explictly remove stamp in parent's directory.
1998-09-20 Dave Love <d.love@dl.ac.uk>
@@ -828,9 +938,9 @@ Sun Feb 1 02:36:33 1998 Richard Henderson <rth@cygnus.com>
* Previous contents of gcc/f/runtime moved into toplevel
"libf2c" directory.
-Sun Feb 1 01:42:47 1998 Mumit Khan <khan@xraylith.wisc.edu>
+Sun Feb 1 01:42:47 1998 Mumit Khan <khan@xraylith.wisc.edu>
- * libU77/configure.in (getlogin,getgid,getuid, kill,link,ttyname):
+ * libU77/configure.in (getlogin,getgid,getuid, kill,link,ttyname):
Check.
* libU77/config.h.in (HAVE_GETLOGIN, HAVE_GETGID, HAVE_GETUID,
HAVE_KILL, HAVE_LINK, HAVE_TTYNAME): New defs.
@@ -858,7 +968,7 @@ Sat Jan 17 22:40:31 1998 Mumit Khan <khan@xraylith.wisc.edu>
* libU77/dtime_.c: Likewise.
* libU77/etime_.c: Likewise.
* libU77/sys_clock_.c: Likewise.
-
+
* configure.in (NON_UNIX_STDIO): Define if MINGW32.
(NON_ANSI_RW_MODE): Do not define for CYGWIN32 or MINGW32.
@@ -965,7 +1075,7 @@ Mon Sep 29 16:30:31 1997 Craig Burley <burley@gnu.ai.mit.edu>
1997-09-19 Dave Love <d.love@dl.ac.uk>
* libU77/dtime_.c (G77_dtime_0): Fix types in HAVE_GETRUSAGE case
- so as not to truncate results to integer values.
+ so as not to truncate results to integer values.
* libU77/Version.c: Bump.
Thu Sep 18 16:58:46 1997 Jeffrey A Law (law@cygnus.com)
@@ -1111,8 +1221,8 @@ Tue Jun 24 18:50:06 1997 Craig Burley <burley@gnu.ai.mit.edu>
1997-06-20 Dave Love <d.love@dl.ac.uk>
* runtime/configure.in: Check for cygwin32 after Mumit Khan (but
- differently); if cygwin32 define NON_UNIX_STDIO and don't define
- NON_ANSI_RW_MODES.
+ differently); if cygwin32 define NON_UNIX_STDIO and don't define
+ NON_ANSI_RW_MODES.
Tue Jun 01 06:26:29 1997 Craig Burley <burley@gnu.ai.mit.edu>
@@ -1479,7 +1589,7 @@ Thu Oct 31 22:27:45 1996 Craig Burley <burley@gnu.ai.mit.edu>
1996-10-19 Dave Love <d.love@dl.ac.uk>
Update to Netlib version of 1996-09-26.
-
+
* libI77/Version.c: Use <stdio.h>, not "stdio.h".
* libF77/Version.c: Likewise.
@@ -1511,25 +1621,25 @@ Sat Aug 17 13:00:47 1996 Dave Love <d.love@dl.ac.uk>
Sun Jul 7 18:06:33 1996 Dave Love <d.love@dl.ac.uk>
* libF77/z_sqrt.c, libF77/z_sin.c, libF77/z_exp.c, libF77/z_log.c,
- libF77/system_.c, libF77/z_cos.c, libF77/signal_.c,
- libF77/s_stop.c, libF77/sig_die.c, libF77/s_paus.c,
- libF77/s_rnge.c, libF77/s_cat.c, libF77/r_tan.c, libF77/r_tanh.c,
- libF77/r_sinh.c, libF77/r_sqrt.c, libF77/r_sin.c, libF77/r_mod.c,
- libF77/r_nint.c, libF77/r_lg10.c, libF77/r_log.c, libF77/r_exp.c,
- libF77/r_int.c, libF77/r_cosh.c, libF77/r_atn2.c, libF77/r_cos.c,
- libF77/r_asin.c, libF77/r_atan.c, libF77/r_acos.c,
- libF77/pow_dd.c, libF77/pow_zz.c, libF77/main.c, libF77/i_dnnt.c,
- libF77/i_nint.c, libF77/h_dnnt.c, libF77/h_nint.c, libF77/exit.c,
- libF77/d_tan.c, libF77/d_tanh.c, libF77/d_sqrt.c, libF77/d_sin.c,
- libF77/d_sinh.c, libF77/d_mod.c, libF77/d_nint.c, libF77/d_log.c,
- libF77/d_int.c, libF77/d_lg10.c, libF77/d_cosh.c, libF77/d_exp.c,
- libF77/d_atn2.c, libF77/d_cos.c, libF77/d_atan.c, libF77/d_acos.c,
- libF77/d_asin.c, libF77/c_sqrt.c, libF77/cabs.c, libF77/c_sin.c,
- libF77/c_exp.c, libF77/c_log.c, libF77/c_cos.c, libF77/F77_aloc.c,
- libF77/abort_.c, libI77/xwsne.c, libI77/wref.c, libI77/util.c,
- libI77/uio.c, libI77/rsne.c, libI77/rdfmt.c, libI77/rawio.h,
- libI77/open.c, libI77/lread.c, libI77/inquire.c, libI77/fio.h,
- libI77/err.c, libI77/endfile.c, libI77/close.c:
+ libF77/system_.c, libF77/z_cos.c, libF77/signal_.c,
+ libF77/s_stop.c, libF77/sig_die.c, libF77/s_paus.c,
+ libF77/s_rnge.c, libF77/s_cat.c, libF77/r_tan.c, libF77/r_tanh.c,
+ libF77/r_sinh.c, libF77/r_sqrt.c, libF77/r_sin.c, libF77/r_mod.c,
+ libF77/r_nint.c, libF77/r_lg10.c, libF77/r_log.c, libF77/r_exp.c,
+ libF77/r_int.c, libF77/r_cosh.c, libF77/r_atn2.c, libF77/r_cos.c,
+ libF77/r_asin.c, libF77/r_atan.c, libF77/r_acos.c,
+ libF77/pow_dd.c, libF77/pow_zz.c, libF77/main.c, libF77/i_dnnt.c,
+ libF77/i_nint.c, libF77/h_dnnt.c, libF77/h_nint.c, libF77/exit.c,
+ libF77/d_tan.c, libF77/d_tanh.c, libF77/d_sqrt.c, libF77/d_sin.c,
+ libF77/d_sinh.c, libF77/d_mod.c, libF77/d_nint.c, libF77/d_log.c,
+ libF77/d_int.c, libF77/d_lg10.c, libF77/d_cosh.c, libF77/d_exp.c,
+ libF77/d_atn2.c, libF77/d_cos.c, libF77/d_atan.c, libF77/d_acos.c,
+ libF77/d_asin.c, libF77/c_sqrt.c, libF77/cabs.c, libF77/c_sin.c,
+ libF77/c_exp.c, libF77/c_log.c, libF77/c_cos.c, libF77/F77_aloc.c,
+ libF77/abort_.c, libI77/xwsne.c, libI77/wref.c, libI77/util.c,
+ libI77/uio.c, libI77/rsne.c, libI77/rdfmt.c, libI77/rawio.h,
+ libI77/open.c, libI77/lread.c, libI77/inquire.c, libI77/fio.h,
+ libI77/err.c, libI77/endfile.c, libI77/close.c:
Use #include <...>, not #include "..." for mkdeps
Sat Jul 6 21:39:21 1996 Dave Love <d.love@dl.ac.uk>
@@ -1539,7 +1649,7 @@ Sat Jul 6 21:39:21 1996 Dave Love <d.love@dl.ac.uk>
Sat Mar 30 20:57:24 1996 Dave Love <d.love@dl.ac.uk>
* configure.in: Eliminate explicit use of
- {RANLIB,AR}_FOR_TARGET.
+ {RANLIB,AR}_FOR_TARGET.
* Makefile.in: Likewise.
* libF77/Makefile.in: Likewise.
* libI77/Makefile.in: Likewise.
@@ -1548,12 +1658,12 @@ Sat Mar 30 20:57:24 1996 Dave Love <d.love@dl.ac.uk>
Sat Mar 30 21:02:03 1996 Dave Love <d.love@dl.ac.uk>
* Makefile.in: Eliminate explicit use of
- {RANLIB,AR}_FOR_TARGET.
+ {RANLIB,AR}_FOR_TARGET.
Tue Mar 26 23:39:59 1996 Dave Love <d.love@dl.ac.uk>
* Makefile.in: Remove hardwired RANLIB and RANLIB_TEST (unnoted
- change).
+ change).
Mon Mar 25 21:04:56 1996 Craig Burley <burley@gnu.ai.mit.edu>
diff --git a/libf2c/libF77/Makefile.in b/libf2c/libF77/Makefile.in
index 74c69a0915a..1b6a6e7ac32 100644
--- a/libf2c/libF77/Makefile.in
+++ b/libf2c/libF77/Makefile.in
@@ -144,6 +144,7 @@ z_cos.o: z_cos.c
z_div.o: z_div.c
z_exp.o: z_exp.c
z_log.o: z_log.c
+ $(CC) -c -DSkip_f2c_Undefs $(ALL_CFLAGS) -ffloat-store $(srcdir)/z_log.c
z_sin.o: z_sin.c
z_sqrt.o: z_sqrt.c
r_abs.o: r_abs.c
diff --git a/libf2c/libF77/Version.c b/libf2c/libF77/Version.c
index c8a1ad8a213..0f8c4093acf 100644
--- a/libf2c/libF77/Version.c
+++ b/libf2c/libF77/Version.c
@@ -3,7 +3,7 @@ static char junk[] = "\n@(#)LIBF77 VERSION 20000929\n";
/*
*/
-char __G77_LIBF77_VERSION__[] = "0.5.26 20010211 (experimental)";
+char __G77_LIBF77_VERSION__[] = "0.5.26 20020220 (release)";
/*
2.00 11 June 1980. File version.c added to library.
diff --git a/libf2c/libI77/Makefile.in b/libf2c/libI77/Makefile.in
index 1ff6b601451..544f24ef4d5 100644
--- a/libf2c/libI77/Makefile.in
+++ b/libf2c/libI77/Makefile.in
@@ -1,7 +1,7 @@
# Makefile for GNU F77 compiler runtime.
# Copyright 1990 - 1994 by AT&T Bell Laboratories and Bellcore (see the
# file `Notice').
-# Portions of this file Copyright (C) 1995, 1996, 1998 Free Software Foundation, Inc.
+# Portions of this file Copyright (C) 1995, 1996, 1998, 2001 Free Software Foundation, Inc.
# Contributed by Dave Love (d.love@dl.ac.uk).
#
#This file is part of GNU Fortran.
@@ -81,6 +81,18 @@ ${srcdir}/configure: configure.in
rm -f config.cache
cd ${srcdir} && autoconf
+# autoheader might not change config.h.in, so touch a stamp file.
+${srcdir}/config.h.in: stamp-h.in; @true
+${srcdir}/stamp-h.in: configure.in
+ (cd ${srcdir} && autoheader)
+ @rm -f ${srcdir}/stamp-h.in
+ echo timestamp > ${srcdir}/stamp-h.in
+
+config.h: stamp-h; @true
+stamp-h: config.h.in config.status
+ CONFIG_FILES= CONFIG_HEADERS=config.h $(SHELL) config.status
+ echo timestamp > stamp-h
+
VersionI.o: Version.c
$(CC) -c $(ALL_CFLAGS) -o $@ $(srcdir)/Version.c
@@ -90,7 +102,7 @@ dfe.o: fio.h
dfe.o: dfe.c fmt.h
dolio.o: dolio.c
due.o: due.c fio.h
-endfile.o: endfile.c fio.h rawio.h
+endfile.o: endfile.c fio.h rawio.h config.h
err.o: err.c fio.h rawio.h
fmt.o: fio.h
fmt.o: fmt.c fmt.h
diff --git a/libf2c/libI77/Version.c b/libf2c/libI77/Version.c
index 8a65767faca..5be1cc4c34e 100644
--- a/libf2c/libI77/Version.c
+++ b/libf2c/libI77/Version.c
@@ -3,7 +3,7 @@ static char junk[] = "\n@(#) LIBI77 VERSION pjw,dmg-mods 20001205\n";
/*
*/
-char __G77_LIBI77_VERSION__[] = "0.5.26 20010211 (experimental)";
+char __G77_LIBI77_VERSION__[] = "0.5.26 20020220 (release)";
/*
2.01 $ format added
diff --git a/libf2c/libI77/backspace.c b/libf2c/libI77/backspace.c
index 1968801aab7..b2bd4163222 100644
--- a/libf2c/libI77/backspace.c
+++ b/libf2c/libI77/backspace.c
@@ -1,3 +1,4 @@
+#include "config.h"
#include <sys/types.h>
#include "f2c.h"
#include "fio.h"
diff --git a/libf2c/libI77/close.c b/libf2c/libI77/close.c
index bbc5bacb821..79a349369ed 100644
--- a/libf2c/libI77/close.c
+++ b/libf2c/libI77/close.c
@@ -1,3 +1,4 @@
+#include "config.h"
#include "f2c.h"
#include "fio.h"
#ifdef KR_headers
diff --git a/libf2c/libI77/config.h.in b/libf2c/libI77/config.h.in
new file mode 100644
index 00000000000..58f83af092f
--- /dev/null
+++ b/libf2c/libI77/config.h.in
@@ -0,0 +1,47 @@
+/* config.h.in. Generated automatically from configure.in by autoheader. */
+
+/* Define to empty if the keyword does not work. */
+#undef const
+
+/* Define to `long' if <sys/types.h> doesn't define. */
+#undef off_t
+
+/* Define if you need to in order for stat and other things to work. */
+#undef _POSIX_SOURCE
+
+/* Define to `unsigned' if <sys/types.h> doesn't define. */
+#undef size_t
+
+/* Define if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Define if you have the ftruncate function. */
+#undef HAVE_FTRUNCATE
+
+/* Define if you have the mkstemp function. */
+#undef HAVE_MKSTEMP
+
+/* Define if you have the tempnam function. */
+#undef HAVE_TEMPNAM
+
+/* Define if fcntl.h is missing. */
+#undef NO_FCNTL
+
+/* Define if fcntl.h is missing. */
+#undef OPEN_DECL
+
+/* Define if we do not have Unix Stdio. */
+#undef NON_UNIX_STDIO
+
+/* Define if we use strlen. */
+#undef USE_STRLEN
+
+/* Define if we have non ANSI RW modes. */
+#undef NON_ANSI_RW_MODES
+
+/* Always defined. */
+#undef NO_EOF_CHAR_CHECK
+
+/* Define to skip f2c undefs. */
+#undef Skip_f2c_Undefs
+
diff --git a/libf2c/libI77/configure b/libf2c/libI77/configure
index 82d0e6c3d1f..ec7988e86b4 100755
--- a/libf2c/libI77/configure
+++ b/libf2c/libI77/configure
@@ -525,12 +525,13 @@ fi
+
# For g77 we'll set CC to point at the built gcc, but this will get it into
# the makefiles
# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:534: checking for $ac_word" >&5
+echo "configure:535: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -560,7 +561,7 @@ if test -z "$CC"; then
# Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:564: checking for $ac_word" >&5
+echo "configure:565: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -611,7 +612,7 @@ fi
# Extract the first word of "cl", so it can be a program name with args.
set dummy cl; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:615: checking for $ac_word" >&5
+echo "configure:616: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -644,7 +645,7 @@ fi
echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:648: checking whether we are using GNU C" >&5
+echo "configure:649: checking whether we are using GNU C" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -653,7 +654,7 @@ else
yes;
#endif
EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:657: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:658: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
ac_cv_prog_gcc=yes
else
ac_cv_prog_gcc=no
@@ -672,7 +673,7 @@ ac_test_CFLAGS="${CFLAGS+set}"
ac_save_CFLAGS="$CFLAGS"
CFLAGS=
echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:676: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:677: checking whether ${CC-cc} accepts -g" >&5
if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -707,7 +708,7 @@ fi
test "$AR" || AR=ar
echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:711: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:712: 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
@@ -737,7 +738,7 @@ fi
# Sanity check for the cross-compilation case:
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:741: checking how to run the C preprocessor" >&5
+echo "configure:742: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
@@ -752,13 +753,13 @@ else
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp.
cat > conftest.$ac_ext <<EOF
-#line 756 "configure"
+#line 757 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:762: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:763: \"$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
:
@@ -769,13 +770,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
-#line 773 "configure"
+#line 774 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:779: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:780: \"$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
:
@@ -786,13 +787,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -nologo -E"
cat > conftest.$ac_ext <<EOF
-#line 790 "configure"
+#line 791 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:796: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:797: \"$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
:
@@ -818,17 +819,17 @@ echo "$ac_t""$CPP" 1>&6
ac_safe=`echo "stdio.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for stdio.h""... $ac_c" 1>&6
-echo "configure:822: checking for stdio.h" >&5
+echo "configure:823: checking for stdio.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 827 "configure"
+#line 828 "configure"
#include "confdefs.h"
#include <stdio.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:832: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:833: \"$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*
@@ -856,12 +857,12 @@ fi
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:860: checking for ANSI C header files" >&5
+echo "configure:861: 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 865 "configure"
+#line 866 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
@@ -869,7 +870,7 @@ else
#include <float.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:873: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:874: \"$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*
@@ -886,7 +887,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 890 "configure"
+#line 891 "configure"
#include "confdefs.h"
#include <string.h>
EOF
@@ -904,7 +905,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 908 "configure"
+#line 909 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
@@ -925,7 +926,7 @@ if test "$cross_compiling" = yes; then
:
else
cat > conftest.$ac_ext <<EOF
-#line 929 "configure"
+#line 930 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -936,7 +937,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); }
EOF
-if { (eval echo configure:940: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:941: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
:
else
@@ -961,12 +962,12 @@ fi
echo $ac_n "checking for posix""... $ac_c" 1>&6
-echo "configure:965: checking for posix" >&5
+echo "configure:966: checking for posix" >&5
if eval "test \"`echo '$''{'g77_cv_header_posix'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 970 "configure"
+#line 971 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <unistd.h>
@@ -992,12 +993,12 @@ echo "$ac_t""$g77_cv_header_posix" 1>&6
# We can rely on the GNU library being posix-ish. I guess checking the
# header isn't actually like checking the functions, though...
echo $ac_n "checking for GNU library""... $ac_c" 1>&6
-echo "configure:996: checking for GNU library" >&5
+echo "configure:997: checking for GNU library" >&5
if eval "test \"`echo '$''{'g77_cv_lib_gnu'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1001 "configure"
+#line 1002 "configure"
#include "confdefs.h"
#include <stdio.h>
#ifdef __GNU_LIBRARY__
@@ -1021,12 +1022,12 @@ echo "$ac_t""$g77_cv_lib_gnu" 1>&6
# Apparently cygwin needs to be special-cased.
echo $ac_n "checking for cyg\`win'32""... $ac_c" 1>&6
-echo "configure:1025: checking for cyg\`win'32" >&5
+echo "configure:1026: checking for cyg\`win'32" >&5
if eval "test \"`echo '$''{'g77_cv_sys_cygwin32'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1030 "configure"
+#line 1031 "configure"
#include "confdefs.h"
#ifdef __CYGWIN32__
yes
@@ -1049,12 +1050,12 @@ echo "$ac_t""$g77_cv_sys_cygwin32" 1>&6
# ditto for mingw32.
echo $ac_n "checking for mingw32""... $ac_c" 1>&6
-echo "configure:1053: checking for mingw32" >&5
+echo "configure:1054: checking for mingw32" >&5
if eval "test \"`echo '$''{'g77_cv_sys_mingw32'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1058 "configure"
+#line 1059 "configure"
#include "confdefs.h"
#ifdef __MINGW32__
yes
@@ -1078,17 +1079,17 @@ echo "$ac_t""$g77_cv_sys_mingw32" 1>&6
ac_safe=`echo "fcntl.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for fcntl.h""... $ac_c" 1>&6
-echo "configure:1082: checking for fcntl.h" >&5
+echo "configure:1083: checking for fcntl.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 1087 "configure"
+#line 1088 "configure"
#include "confdefs.h"
#include <fcntl.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1092: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1093: \"$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*
@@ -1113,7 +1114,8 @@ else
cat >> confdefs.h <<\EOF
#define NO_FCNTL 1
EOF
- cat >> confdefs.h <<\EOF
+
+ cat >> confdefs.h <<\EOF
#define OPEN_DECL 1
EOF
@@ -1121,12 +1123,12 @@ fi
echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:1125: checking for working const" >&5
+echo "configure:1127: 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 1130 "configure"
+#line 1132 "configure"
#include "confdefs.h"
int main() {
@@ -1175,7 +1177,7 @@ ccp = (char const *const *) p;
; return 0; }
EOF
-if { (eval echo configure:1179: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1181: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_const=yes
else
@@ -1196,12 +1198,12 @@ EOF
fi
echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:1200: checking for size_t" >&5
+echo "configure:1202: 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 1205 "configure"
+#line 1207 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -1234,12 +1236,12 @@ fi
# Apparently positive result on cygwin loses re. NON_UNIX_STDIO
# (as of cygwin b18). Likewise on mingw.
echo $ac_n "checking for fstat""... $ac_c" 1>&6
-echo "configure:1238: checking for fstat" >&5
+echo "configure:1240: checking for fstat" >&5
if eval "test \"`echo '$''{'ac_cv_func_fstat'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1243 "configure"
+#line 1245 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char fstat(); below. */
@@ -1262,7 +1264,7 @@ fstat();
; return 0; }
EOF
-if { (eval echo configure:1266: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1268: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_fstat=yes"
else
@@ -1282,7 +1284,7 @@ else
fi
echo $ac_n "checking need for NON_UNIX_STDIO""... $ac_c" 1>&6
-echo "configure:1286: checking need for NON_UNIX_STDIO" >&5
+echo "configure:1288: checking need for NON_UNIX_STDIO" >&5
if test $g77_cv_sys_cygwin32 = yes \
|| test $g77_cv_sys_mingw32 = yes \
|| test $ac_cv_func_fstat = no; then
@@ -1295,15 +1297,70 @@ else
echo "$ac_t""no" 1>&6
fi
+for ac_func in ftruncate
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:1304: 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 1309 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:1332: \"$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
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
for ac_func in mkstemp
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1302: checking for $ac_func" >&5
+echo "configure:1359: 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 1307 "configure"
+#line 1364 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -1326,7 +1383,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:1330: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1387: \"$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
@@ -1353,12 +1410,12 @@ done
for ac_func in tempnam
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1357: checking for $ac_func" >&5
+echo "configure:1414: 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 1362 "configure"
+#line 1419 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -1381,7 +1438,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:1385: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1442: \"$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
@@ -1411,19 +1468,19 @@ done
# However, on my sunos4/gcc setup unistd.h leads us wrongly to believe
# we're posix-conformant, so always do the test.
echo $ac_n "checking for ansi/posix sprintf result""... $ac_c" 1>&6
-echo "configure:1415: checking for ansi/posix sprintf result" >&5
+echo "configure:1472: checking for ansi/posix sprintf result" >&5
if test "$cross_compiling" = yes; then
g77_cv_sys_sprintf_ansi=no
else
cat > conftest.$ac_ext <<EOF
-#line 1420 "configure"
+#line 1477 "configure"
#include "confdefs.h"
#include <stdio.h>
/* does sprintf return the number of chars transferred? */
main () {char foo[2]; (sprintf(foo, "1") == 1) ? exit(0) : exit(1);}
EOF
-if { (eval echo configure:1427: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1484: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
g77_cv_sys_sprintf_ansi=yes
else
@@ -1454,9 +1511,9 @@ fi
# define NON_ANSI_RW_MODES on unix (can't hurt)
echo $ac_n "checking NON_ANSI_RW_MODES""... $ac_c" 1>&6
-echo "configure:1458: checking NON_ANSI_RW_MODES" >&5
+echo "configure:1515: checking NON_ANSI_RW_MODES" >&5
cat > conftest.$ac_ext <<EOF
-#line 1460 "configure"
+#line 1517 "configure"
#include "confdefs.h"
#ifdef unix
yes
@@ -1500,6 +1557,40 @@ cat >> confdefs.h <<\EOF
EOF
+echo $ac_n "checking for off_t""... $ac_c" 1>&6
+echo "configure:1562: 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 1567 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#if STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
+#endif
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
+ rm -rf conftest*
+ ac_cv_type_off_t=yes
+else
+ rm -rf conftest*
+ ac_cv_type_off_t=no
+fi
+rm -f conftest*
+
+fi
+echo "$ac_t""$ac_cv_type_off_t" 1>&6
+if test $ac_cv_type_off_t = no; then
+ cat >> confdefs.h <<\EOF
+#define off_t long
+EOF
+
+fi
+
+
cat >> confdefs.h <<\EOF
#define Skip_f2c_Undefs 1
EOF
@@ -1568,19 +1659,7 @@ fi
trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
-# Transform confdefs.h into DEFS.
-# Protect against shell expansion while executing Makefile rules.
-# Protect against Makefile macro expansion.
-cat > conftest.defs <<\EOF
-s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g
-s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g
-s%\[%\\&%g
-s%\]%\\&%g
-s%\$%$$%g
-EOF
-DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '`
-rm -f conftest.defs
-
+DEFS=-DHAVE_CONFIG_H
# Without the "./", some shells look in PATH for config.status.
: ${CONFIG_STATUS=./config.status}
@@ -1617,7 +1696,7 @@ done
ac_given_srcdir=$srcdir
-trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
+trap 'rm -fr `echo "Makefile config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
EOF
cat >> $CONFIG_STATUS <<EOF
@@ -1748,6 +1827,113 @@ s%@top_srcdir@%$top_srcdir%g
fi; done
rm -f conftest.s*
+# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
+# NAME is the cpp macro being defined and VALUE is the value it is being given.
+#
+# ac_d sets the value in "#define NAME VALUE" lines.
+ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)'
+ac_dB='\([ ][ ]*\)[^ ]*%\1#\2'
+ac_dC='\3'
+ac_dD='%g'
+# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
+ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
+ac_uB='\([ ]\)%\1#\2define\3'
+ac_uC=' '
+ac_uD='\4%g'
+# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
+ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
+ac_eB='$%\1#\2define\3'
+ac_eC=' '
+ac_eD='%g'
+
+if test "${CONFIG_HEADERS+set}" != set; then
+EOF
+cat >> $CONFIG_STATUS <<EOF
+ CONFIG_HEADERS="config.h"
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+fi
+for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+ case "$ac_file" in
+ *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
+ ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+ *) ac_file_in="${ac_file}.in" ;;
+ esac
+
+ echo creating $ac_file
+
+ rm -f conftest.frag conftest.in conftest.out
+ ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
+ cat $ac_file_inputs > conftest.in
+
+EOF
+
+# Transform confdefs.h into a sed script conftest.vals that substitutes
+# the proper values into config.h.in to produce config.h. And first:
+# Protect against being on the right side of a sed subst in config.status.
+# Protect against being in an unquoted here document in config.status.
+rm -f conftest.vals
+cat > conftest.hdr <<\EOF
+s/[\\&%]/\\&/g
+s%[\\$`]%\\&%g
+s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
+s%ac_d%ac_u%gp
+s%ac_u%ac_e%gp
+EOF
+sed -n -f conftest.hdr confdefs.h > conftest.vals
+rm -f conftest.hdr
+
+# This sed command replaces #undef with comments. This is necessary, for
+# example, in the case of _POSIX_SOURCE, which is predefined and required
+# on some systems where configure will not decide to define it.
+cat >> conftest.vals <<\EOF
+s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
+EOF
+
+# Break up conftest.vals because some shells have a limit on
+# the size of here documents, and old seds have small limits too.
+
+rm -f conftest.tail
+while :
+do
+ ac_lines=`grep -c . conftest.vals`
+ # grep -c gives empty output for an empty file on some AIX systems.
+ if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
+ # Write a limited-size here document to conftest.frag.
+ echo ' cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
+ sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
+ echo 'CEOF
+ sed -f conftest.frag conftest.in > conftest.out
+ rm -f conftest.in
+ mv conftest.out conftest.in
+' >> $CONFIG_STATUS
+ sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
+ rm -f conftest.vals
+ mv conftest.tail conftest.vals
+done
+rm -f conftest.vals
+
+cat >> $CONFIG_STATUS <<\EOF
+ rm -f conftest.frag conftest.h
+ echo "/* $ac_file. Generated automatically by configure. */" > conftest.h
+ cat conftest.in >> conftest.h
+ rm -f conftest.in
+ if cmp -s $ac_file conftest.h 2>/dev/null; then
+ echo "$ac_file is unchanged"
+ rm -f conftest.h
+ else
+ # Remove last slash and all that follows it. Not all systems have dirname.
+ ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
+ if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
+ # The file is in a subdirectory.
+ test ! -d "$ac_dir" && mkdir "$ac_dir"
+ fi
+ rm -f $ac_file
+ mv conftest.h $ac_file
+ fi
+fi; done
+
EOF
cat >> $CONFIG_STATUS <<EOF
diff --git a/libf2c/libI77/configure.in b/libf2c/libI77/configure.in
index 7e920f91abd..20f2628ba3a 100644
--- a/libf2c/libI77/configure.in
+++ b/libf2c/libI77/configure.in
@@ -1,5 +1,5 @@
# Process this file with autoconf to produce a configure script.
-# Copyright (C) 1995, 1997, 1998 Free Software Foundation, Inc.
+# Copyright (C) 1995, 1997, 1998, 2001 Free Software Foundation, Inc.
# Contributed by Dave Love (d.love@dl.ac.uk).
#
#This file is part of GNU Fortran.
@@ -21,6 +21,7 @@
AC_PREREQ(2.12.1)
AC_INIT(ftell_.c)
+AC_CONFIG_HEADER(config.h)
dnl Checks for programs.
@@ -112,7 +113,8 @@ AC_MSG_RESULT($g77_cv_sys_mingw32)
AC_CHECK_HEADER(fcntl.h,
test $g77_cv_header_posix = yes && AC_DEFINE(_POSIX_SOURCE),
- AC_DEFINE(NO_FCNTL) AC_DEFINE(OPEN_DECL))
+ AC_DEFINE(NO_FCNTL, 1, [Define if fcntl.h is missing.])
+ AC_DEFINE(OPEN_DECL, 1, [Define if fcntl.h is missing.]))
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
@@ -129,11 +131,12 @@ if test $g77_cv_sys_cygwin32 = yes \
|| test $g77_cv_sys_mingw32 = yes \
|| test $ac_cv_func_fstat = no; then
AC_MSG_RESULT(yes)
- AC_DEFINE(NON_UNIX_STDIO)
+ AC_DEFINE(NON_UNIX_STDIO, 1, [Define if we do not have Unix Stdio.])
else
AC_MSG_RESULT(no)
fi
+AC_CHECK_FUNCS(ftruncate)
AC_CHECK_FUNCS(mkstemp)
AC_CHECK_FUNCS(tempnam)
@@ -161,7 +164,7 @@ AC_MSG_RESULT($g77_cv_sys_sprintf_ansi)
# The cygwin patch takes steps to avoid defining USE_STRLEN here -- I don't
# understand why.
if test $g77_cv_sys_sprintf_ansi != yes; then
- AC_DEFINE(USE_STRLEN)
+ AC_DEFINE(USE_STRLEN, 1, [Define if we use strlen.])
fi
# define NON_ANSI_RW_MODES on unix (can't hurt)
@@ -182,7 +185,7 @@ if test $g77_cv_sys_cygwin32 = yes || test $g77_cv_sys_mingw32 = yes; then
AC_MSG_RESULT(no)
else
if test $is_unix = yes; then
- AC_DEFINE(NON_ANSI_RW_MODES)
+ AC_DEFINE(NON_ANSI_RW_MODES, 1, [Define if we have non ANSI RW modes.])
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
@@ -190,9 +193,11 @@ else
fi
# This EOF_CHAR is a misfeature on unix.
-AC_DEFINE(NO_EOF_CHAR_CHECK)
+AC_DEFINE(NO_EOF_CHAR_CHECK, 1, [Always defined.])
-AC_DEFINE(Skip_f2c_Undefs)
+AC_TYPE_OFF_T
+
+AC_DEFINE(Skip_f2c_Undefs, 1, [Define to skip f2c undefs.])
AC_OUTPUT(Makefile)
diff --git a/libf2c/libI77/dfe.c b/libf2c/libI77/dfe.c
index f639ab51ce7..e90b16d0551 100644
--- a/libf2c/libI77/dfe.c
+++ b/libf2c/libI77/dfe.c
@@ -1,3 +1,4 @@
+#include "config.h"
#include "f2c.h"
#include "fio.h"
#include "fmt.h"
diff --git a/libf2c/libI77/dolio.c b/libf2c/libI77/dolio.c
index 4b5a2ca6588..1e0c3779bb5 100644
--- a/libf2c/libI77/dolio.c
+++ b/libf2c/libI77/dolio.c
@@ -1,3 +1,4 @@
+#include "config.h"
#include "f2c.h"
#ifdef __cplusplus
diff --git a/libf2c/libI77/due.c b/libf2c/libI77/due.c
index cb80a39b44d..df341332150 100644
--- a/libf2c/libI77/due.c
+++ b/libf2c/libI77/due.c
@@ -1,3 +1,4 @@
+#include "config.h"
#include "f2c.h"
#include "fio.h"
diff --git a/libf2c/libI77/endfile.c b/libf2c/libI77/endfile.c
index f7a78e12555..9cd72161d52 100644
--- a/libf2c/libI77/endfile.c
+++ b/libf2c/libI77/endfile.c
@@ -1,6 +1,10 @@
+#include "config.h"
#include "f2c.h"
#include "fio.h"
+#include <sys/types.h>
+#include <unistd.h>
+
#ifdef KR_headers
extern char *strcpy();
extern FILE *tmpfile();
@@ -38,6 +42,7 @@ integer f_end(alist *a)
return(b->useek ? t_runc(a) : 0);
}
+#ifndef HAVE_FTRUNCATE
static int
#ifdef KR_headers
copy(from, len, to) FILE *from, *to; register long len;
@@ -56,6 +61,7 @@ copy(FILE *from, register long len, FILE *to)
}
return 0;
}
+#endif /* !defined(HAVE_FTRUNCATE) */
int
#ifdef KR_headers
@@ -66,8 +72,11 @@ t_runc(alist *a)
{
long loc, len;
unit *b;
- FILE *bf, *tf;
- int rc = 0;
+ int rc;
+ FILE *bf;
+#ifndef HAVE_FTRUNCATE
+ FILE *tf;
+#endif /* !defined(HAVE_FTRUNCATE) */
b = &f__units[a->aunit];
if(b->url)
@@ -77,6 +86,8 @@ t_runc(alist *a)
len=ftell(bf);
if (loc >= len || b->useek == 0 || b->ufnm == NULL)
return(0);
+#ifndef HAVE_FTRUNCATE
+ rc = 0;
fclose(b->ufd);
if (!loc) {
if (!(bf = fopen(b->ufnm, f__w_mode[b->ufmt])))
@@ -118,6 +129,11 @@ done1:
fclose(tf);
done:
f__cf = b->ufd = bf;
+#else /* !defined(HAVE_FTRUNCATE) */
+ fflush(b->ufd);
+ rc = ftruncate(fileno(b->ufd), (off_t)loc);
+ fseek(bf,loc,SEEK_SET);
+#endif /* !defined(HAVE_FTRUNCATE) */
if (rc)
err(a->aerr,111,"endfile");
return 0;
diff --git a/libf2c/libI77/err.c b/libf2c/libI77/err.c
index e7ac23a6cfe..6784cdd4576 100644
--- a/libf2c/libI77/err.c
+++ b/libf2c/libI77/err.c
@@ -1,3 +1,4 @@
+#include "config.h"
#ifndef NON_UNIX_STDIO
#define _INCLUDE_POSIX_SOURCE /* for HP-UX */
#define _INCLUDE_XOPEN_SOURCE /* for HP-UX */
diff --git a/libf2c/libI77/fmt.c b/libf2c/libI77/fmt.c
index 8f08952ed45..793dceb53b8 100644
--- a/libf2c/libI77/fmt.c
+++ b/libf2c/libI77/fmt.c
@@ -1,3 +1,4 @@
+#include "config.h"
#include "f2c.h"
#include "fio.h"
#include "fmt.h"
diff --git a/libf2c/libI77/fmtlib.c b/libf2c/libI77/fmtlib.c
index 91483fc5290..69c0d9b406f 100644
--- a/libf2c/libI77/fmtlib.c
+++ b/libf2c/libI77/fmtlib.c
@@ -1,5 +1,6 @@
/* @(#)fmtlib.c 1.2 */
#define MAXINTLENGTH 23
+#include "config.h"
#include "f2c.h"
#ifndef Allow_TYQUAD
diff --git a/libf2c/libI77/ftell_.c b/libf2c/libI77/ftell_.c
index 1bd03be325a..1f6d87f50bd 100644
--- a/libf2c/libI77/ftell_.c
+++ b/libf2c/libI77/ftell_.c
@@ -1,3 +1,4 @@
+#include "config.h"
#include "f2c.h"
#include "fio.h"
diff --git a/libf2c/libI77/ilnw.c b/libf2c/libI77/ilnw.c
index abc64099d31..58fca0d326a 100644
--- a/libf2c/libI77/ilnw.c
+++ b/libf2c/libI77/ilnw.c
@@ -1,3 +1,4 @@
+#include "config.h"
#include "f2c.h"
#include "fio.h"
#include "lio.h"
diff --git a/libf2c/libI77/inquire.c b/libf2c/libI77/inquire.c
index 963d4c3e5e8..71eb700a57a 100644
--- a/libf2c/libI77/inquire.c
+++ b/libf2c/libI77/inquire.c
@@ -1,3 +1,4 @@
+#include "config.h"
#include "f2c.h"
#include "fio.h"
#include <string.h>
diff --git a/libf2c/libI77/lread.c b/libf2c/libI77/lread.c
index 4b62a5cbadf..d546efcc4e1 100644
--- a/libf2c/libI77/lread.c
+++ b/libf2c/libI77/lread.c
@@ -1,3 +1,4 @@
+#include "config.h"
#include <ctype.h>
#include "f2c.h"
#include "fio.h"
diff --git a/libf2c/libI77/open.c b/libf2c/libI77/open.c
index 830dca5a359..56bbc5232ee 100644
--- a/libf2c/libI77/open.c
+++ b/libf2c/libI77/open.c
@@ -1,6 +1,7 @@
/* Define _XOPEN_SOURCE to get tempnam prototype with glibc et al --
more general than _INCLUDE_XOPEN_SOURCE used elsewhere `for HP-UX'. */
#define _XOPEN_SOURCE 1
+#include "config.h"
#include "f2c.h"
#include "fio.h"
#include <string.h>
diff --git a/libf2c/libI77/rdfmt.c b/libf2c/libI77/rdfmt.c
index f2b121193a7..6ddd36958a5 100644
--- a/libf2c/libI77/rdfmt.c
+++ b/libf2c/libI77/rdfmt.c
@@ -1,3 +1,4 @@
+#include "config.h"
#include <ctype.h>
#include "f2c.h"
#include "fio.h"
diff --git a/libf2c/libI77/rsfe.c b/libf2c/libI77/rsfe.c
index a79cd79f03c..1be45310f51 100644
--- a/libf2c/libI77/rsfe.c
+++ b/libf2c/libI77/rsfe.c
@@ -1,4 +1,5 @@
/* read sequential formatted external */
+#include "config.h"
#include "f2c.h"
#include "fio.h"
#include "fmt.h"
diff --git a/libf2c/libI77/rsne.c b/libf2c/libI77/rsne.c
index 77ffdf70bd2..a0d0bfe407d 100644
--- a/libf2c/libI77/rsne.c
+++ b/libf2c/libI77/rsne.c
@@ -1,3 +1,4 @@
+#include "config.h"
#include "f2c.h"
#include "fio.h"
#include "lio.h"
diff --git a/libf2c/libI77/stamp-h.in b/libf2c/libI77/stamp-h.in
new file mode 100644
index 00000000000..9788f70238c
--- /dev/null
+++ b/libf2c/libI77/stamp-h.in
@@ -0,0 +1 @@
+timestamp
diff --git a/libf2c/libI77/sue.c b/libf2c/libI77/sue.c
index eacb1d69b01..e7dbba02bd4 100644
--- a/libf2c/libI77/sue.c
+++ b/libf2c/libI77/sue.c
@@ -1,3 +1,4 @@
+#include "config.h"
#include "f2c.h"
#include "fio.h"
extern uiolen f__reclen;
diff --git a/libf2c/libI77/typesize.c b/libf2c/libI77/typesize.c
index 1cb20ff2863..7f42aa1bcc8 100644
--- a/libf2c/libI77/typesize.c
+++ b/libf2c/libI77/typesize.c
@@ -1,3 +1,4 @@
+#include "config.h"
#include "f2c.h"
ftnlen f__typesize[] = { 0, 0, sizeof(shortint), sizeof(integer),
diff --git a/libf2c/libI77/util.c b/libf2c/libI77/util.c
index ccaad2d3b6f..8280ac06a7f 100644
--- a/libf2c/libI77/util.c
+++ b/libf2c/libI77/util.c
@@ -1,3 +1,4 @@
+#include "config.h"
#ifndef NON_UNIX_STDIO
#define _INCLUDE_POSIX_SOURCE /* for HP-UX */
#define _INCLUDE_XOPEN_SOURCE /* for HP-UX */
diff --git a/libf2c/libI77/wrtfmt.c b/libf2c/libI77/wrtfmt.c
index 477c40f5d3b..37006ba77c2 100644
--- a/libf2c/libI77/wrtfmt.c
+++ b/libf2c/libI77/wrtfmt.c
@@ -1,3 +1,4 @@
+#include "config.h"
#include "f2c.h"
#include "fio.h"
#include "fmt.h"
diff --git a/libf2c/libI77/wsle.c b/libf2c/libI77/wsle.c
index f8555d79c45..386e8678aad 100644
--- a/libf2c/libI77/wsle.c
+++ b/libf2c/libI77/wsle.c
@@ -1,3 +1,4 @@
+#include "config.h"
#include "f2c.h"
#include "fio.h"
#include "fmt.h"
diff --git a/libf2c/libI77/xwsne.c b/libf2c/libI77/xwsne.c
index babec475325..96fdd021916 100644
--- a/libf2c/libI77/xwsne.c
+++ b/libf2c/libI77/xwsne.c
@@ -1,3 +1,4 @@
+#include "config.h"
#include "f2c.h"
#include "fio.h"
#include "lio.h"
diff --git a/libf2c/libU77/Version.c b/libf2c/libU77/Version.c
index 250620ba89b..5ff24d331c2 100644
--- a/libf2c/libU77/Version.c
+++ b/libf2c/libU77/Version.c
@@ -1,6 +1,6 @@
static char junk[] = "\n@(#) LIBU77 VERSION 19980709\n";
-char __G77_LIBU77_VERSION__[] = "0.5.26 20010211 (experimental)";
+char __G77_LIBU77_VERSION__[] = "0.5.26 20020220 (release)";
#include <stdio.h>
diff --git a/libffi/ChangeLog b/libffi/ChangeLog
index 7622498740a..a84be7eb0cd 100644
--- a/libffi/ChangeLog
+++ b/libffi/ChangeLog
@@ -1,3 +1,124 @@
+2002-02-20 Release Manager
+
+ * GCC 3.0.4 Released.
+
+2001-12-20 Release Manager
+
+ * GCC 3.0.3 Released.
+
+2001-10-23 Release Manager
+
+ * GCC 3.0.2 Released.
+
+2001-08-19 Release Manager
+
+ * GCC 3.0.1 Released.
+
+2001-08-19 Release Manager
+
+ * GCC 3.0.1 Released.
+
+2001-07-16 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * src/x86/sysv.S: Avoid gas-only .balign directive.
+ Use C style comments.
+
+2001-07-16 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * src/alpha/ffi.c (ffi_prep_closure): Avoid gas-only mnemonic.
+ Fixes PR bootstrap/3563.
+
+2001-06-26 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * src/alpha/osf.S (ffi_closure_osf): Use .rdata for ECOFF.
+
+2001-06-25 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * configure.in: Recognize sparc*-sun-* host.
+ * configure: Regenerate.
+
+20010617 Release Manager
+
+ * GCC 3.0 Released.
+
+2001-06-06 Andrew Haley <aph@redhat.com>
+
+ * src/alpha/osf.S (__FRAME_BEGIN__): Conditionalize for ELF.
+
+2001-06-03 Andrew Haley <aph@redhat.com>
+
+ * src/alpha/osf.S: Add unwind info.
+ * src/powerpc/sysv.S: Add unwind info.
+ * src/powerpc/ppc_closure.S: Likewise.
+
+2001-05-06 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
+
+ * configure.in: Remove warning about beta code.
+ * configure: Rebuilt.
+
+2001-04-25 Hans Boehm <Hans_Boehm@hp.com>
+
+ * src/ia64/unix.S: Restore stack pointer when returning from
+ ffi_closure_UNIX.
+
+2001-04-18 Jim Wilson <wilson@redhat.com>
+
+ * src/ia64/unix.S: Delete unnecessary increment and decrement of loc2
+ to eliminate RAW DV.
+
+2001-04-12 Bryce McKinlay <bryce@albatross.co.nz>
+
+ * Makefile.am: Make a libtool convenience library.
+ * Makefile.in: Rebuilt.
+
+2001-03-29 Bryce McKinlay <bryce@albatross.co.nz>
+
+ * configure.in: Use different syntax for subdirectory creation.
+ * configure: Rebuilt.
+
+2001-03-27 Jon Beniston <jon@beniston.com>
+
+ * configure.in: Added X86_WIN32 target (Win32, CygWin, MingW).
+ * configure: Rebuilt.
+ * Makefile.am: Added X86_WIN32 target support.
+ * Makefile.in: Rebuilt.
+
+ * include/ffi.h.in: Added X86_WIN32 target support.
+
+ * src/ffitest.c: Doesn't run structure tests for X86_WIN32 targets.
+ * src/types.c: Added X86_WIN32 target support.
+
+ * src/x86/win32.S: New file. Based on sysv.S, but with EH
+ stuff removed and made to work with CygWin's gas.
+
+2001-03-26 Bryce McKinlay <bryce@albatross.co.nz>
+
+ * configure.in: Make target subdirectory in build dir.
+ * Makefile.am: Override suffix based rules to specify correct output
+ subdirectory.
+ * Makefile.in: Rebuilt.
+ * configure: Rebuilt.
+
+2001-03-23 Kevin B Hendricks <khendricks@ivey.uwo.ca>
+
+ * src/powerpc/ppc_closure.S: New file.
+ * src/powerpc/ffi.c (ffi_prep_args): Fixed ABI compatibility bug
+ involving long long and register pairs.
+ (ffi_prep_closure): New function.
+ (flush_icache): Likewise.
+ (ffi_closure_helper_SYSV): Likewise.
+ * include/ffi.h.in (FFI_CLOSURES): Define on PPC.
+ (FFI_TRAMPOLINE_SIZE): Likewise.
+ (FFI_NATIVE_RAW_API): Likewise.
+ * Makefile.in: Rebuilt.
+ * Makefile.am (EXTRA_DIST): Added src/powerpc/ppc_closure.S.
+ (TARGET_SRC_POWERPC): Likewise.
+
+2001-03-19 Tom Tromey <tromey@redhat.com>
+
+ * Makefile.in: Rebuilt.
+ * Makefile.am (ffitest_LDFLAGS): New macro.
+
2001-02-08 Joseph S. Myers <jsm28@cam.ac.uk>
* include/ffi.h.in: Change sourceware.cygnus.com references to
diff --git a/libffi/Makefile.am b/libffi/Makefile.am
index 9b9375cc188..ad55c5eb64d 100644
--- a/libffi/Makefile.am
+++ b/libffi/Makefile.am
@@ -7,10 +7,11 @@ SUBDIRS = include
EXTRA_DIST = LICENSE ChangeLog.v1 src/mips/ffi.c src/mips/n32.S \
src/mips/n32.s src/mips/o32.S src/mips/o32.s \
src/sparc/ffi.c src/sparc/v8.S src/sparc/v9.S \
- src/x86/ffi.c src/x86/sysv.S \
+ src/x86/ffi.c src/x86/sysv.S src/x86/win32.S \
src/alpha/ffi.c src/alpha/osf.S \
src/m68k/ffi.c src/m68k/sysv.S \
- src/powerpc/ffi.c src/powerpc/sysv.S src/powerpc/asm.h \
+ src/powerpc/ffi.c src/powerpc/sysv.S \
+ src/powerpc/ppc_closure.S src/powerpc/asm.h \
src/arm/ffi.c src/arm/sysv.S
VPATH = @srcdir@:@srcdir@/src:@srcdir@/src/@TARGETDIR@
@@ -79,20 +80,23 @@ toolexeclibdir = $(toolexecdir)/lib$(MULTISUBDIR)
endif
toolexeclib_LTLIBRARIES = libffi.la
+noinst_LTLIBRARIES = libfficonvenience.la
noinst_PROGRAMS = ffitest
ffitest_SOURCES = src/ffitest.c
ffitest_LDADD = libffi.la
+ffitest_LDFLAGS = -shared-libgcc
TARGET_SRC_MIPS_GCC = src/mips/ffi.c src/mips/o32.S src/mips/n32.S
TARGET_SRC_MIPS_SGI = src/mips/ffi.c src/mips/o32.s src/mips/n32.s
TARGET_SRC_X86 = src/x86/ffi.c src/x86/sysv.S
+TARGET_SRC_X86_WIN32 = src/x86/ffi.c src/x86/win32.S
TARGET_SRC_SPARC = src/sparc/ffi.c src/sparc/v8.S src/sparc/v9.S
TARGET_SRC_ALPHA = src/alpha/ffi.c src/alpha/osf.S
TARGET_SRC_IA64 = src/ia64/ffi.c src/ia64/unix.S
TARGET_SRC_M68K = src/m68k/ffi.c src/m68k/sysv.S
-TARGET_SRC_POWERPC = src/powerpc/ffi.c src/powerpc/sysv.S
+TARGET_SRC_POWERPC = src/powerpc/ffi.c src/powerpc/sysv.S src/powerpc/ppc_closure.S
TARGET_SRC_ARM = src/arm/sysv.S src/arm/ffi.c
##libffi_la_SOURCES = src/debug.c src/prep_cif.c src/types.c $(TARGET_SRC_@TARGET@)
@@ -101,30 +105,43 @@ libffi_la_common_SOURCES = src/debug.c src/prep_cif.c src/types.c \
src/raw_api.c src/java_raw_api.c
if MIPS_GCC
libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_GCC)
+libfficonvenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_GCC)
endif
if MIPS_SGI
libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_SGI)
+libfficonvenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_SGI)
endif
if X86
libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_X86)
+libfficonvenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_X86)
+endif
+if X86_WIN32
+libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_X86_WIN32)
+libfficonvenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_X86_WIN32)
endif
if SPARC
libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_SPARC)
+libfficonvenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_SPARC)
endif
if ALPHA
libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_ALPHA)
+libfficonvenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_ALPHA)
endif
if IA64
libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_IA64)
+libfficonvenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_IA64)
endif
if M68K
libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_M68K)
+libfficonvenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_M68K)
endif
if POWERPC
libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_POWERPC)
+libfficonvenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_POWERPC)
endif
if ARM
libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_ARM)
+libfficonvenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_ARM)
endif
AM_CFLAGS = -fexceptions
@@ -133,6 +150,26 @@ libffi_la_LDFLAGS = -release $(VERSION)
INCLUDES = -I$(top_srcdir)/include -Iinclude -I$(top_srcdir)/src
+# Override these rules so that object files get put in the correct
+# subdirectories.
+.c.o:
+ $(LTCOMPILE) -c -o $@ $<
+
+.s.o:
+ $(LTCOMPILE) -c -o $@ $<
+
+.S.o:
+ $(LTCOMPILE) -c -o $@ $<
+
+.c.lo:
+ $(LTCOMPILE) -c -o $@ $<
+
+.s.lo:
+ $(LTCOMPILE) -c -o $@ $<
+
+.S.lo:
+ $(LTCOMPILE) -c -o $@ $<
+
# Multilib support.
.PHONY: all-multi mostlyclean-multi clean-multi distclean-multi \
maintainer-clean-multi
diff --git a/libffi/Makefile.in b/libffi/Makefile.in
index 083dd4ace24..372be2b90c1 100644
--- a/libffi/Makefile.in
+++ b/libffi/Makefile.in
@@ -1,6 +1,6 @@
-# Makefile.in generated automatically by automake 1.4a from Makefile.am
+# Makefile.in generated automatically by automake 1.4 from Makefile.am
-# Copyright (C) 1994, 1995-9, 2000 Free Software Foundation, Inc.
+# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -10,6 +10,7 @@
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
+
SHELL = @SHELL@
srcdir = @srcdir@
@@ -30,6 +31,8 @@ mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
+DESTDIR =
+
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
@@ -42,10 +45,9 @@ AUTOMAKE = @AUTOMAKE@
AUTOHEADER = @AUTOHEADER@
INSTALL = @INSTALL@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
INSTALL_DATA = @INSTALL_DATA@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_FLAG =
transform = @program_transform_name@
NORMAL_INSTALL = :
@@ -54,28 +56,31 @@ POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
-
-@SET_MAKE@
host_alias = @host_alias@
host_triplet = @host@
AS = @AS@
CC = @CC@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
DLLTOOL = @DLLTOOL@
EXEEXT = @EXEEXT@
+GCJ = @GCJ@
+GCJFLAGS = @GCJFLAGS@
LIBTOOL = @LIBTOOL@
LN_S = @LN_S@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
RANLIB = @RANLIB@
SHELL = @SHELL@
+STRIP = @STRIP@
TARGET = @TARGET@
TARGETDIR = @TARGETDIR@
VERSION = @VERSION@
libffi_basedir = @libffi_basedir@
-
AUTOMAKE_OPTIONS = cygnus
SUBDIRS = include
@@ -83,10 +88,11 @@ SUBDIRS = include
EXTRA_DIST = LICENSE ChangeLog.v1 src/mips/ffi.c src/mips/n32.S \
src/mips/n32.s src/mips/o32.S src/mips/o32.s \
src/sparc/ffi.c src/sparc/v8.S src/sparc/v9.S \
- src/x86/ffi.c src/x86/sysv.S \
+ src/x86/ffi.c src/x86/sysv.S src/x86/win32.S \
src/alpha/ffi.c src/alpha/osf.S \
src/m68k/ffi.c src/m68k/sysv.S \
- src/powerpc/ffi.c src/powerpc/sysv.S src/powerpc/asm.h \
+ src/powerpc/ffi.c src/powerpc/sysv.S \
+ src/powerpc/ppc_closure.S src/powerpc/asm.h \
src/arm/ffi.c src/arm/sysv.S
@@ -145,20 +151,23 @@ MULTICLEAN = true
@USE_LIBDIR_FALSE@toolexecdir = @USE_LIBDIR_FALSE@$(exec_prefix)/$(target_alias)
toolexeclib_LTLIBRARIES = libffi.la
+noinst_LTLIBRARIES = libfficonvenience.la
noinst_PROGRAMS = ffitest
ffitest_SOURCES = src/ffitest.c
ffitest_LDADD = libffi.la
+ffitest_LDFLAGS = -shared-libgcc
TARGET_SRC_MIPS_GCC = src/mips/ffi.c src/mips/o32.S src/mips/n32.S
TARGET_SRC_MIPS_SGI = src/mips/ffi.c src/mips/o32.s src/mips/n32.s
TARGET_SRC_X86 = src/x86/ffi.c src/x86/sysv.S
+TARGET_SRC_X86_WIN32 = src/x86/ffi.c src/x86/win32.S
TARGET_SRC_SPARC = src/sparc/ffi.c src/sparc/v8.S src/sparc/v9.S
TARGET_SRC_ALPHA = src/alpha/ffi.c src/alpha/osf.S
TARGET_SRC_IA64 = src/ia64/ffi.c src/ia64/unix.S
TARGET_SRC_M68K = src/m68k/ffi.c src/m68k/sysv.S
-TARGET_SRC_POWERPC = src/powerpc/ffi.c src/powerpc/sysv.S
+TARGET_SRC_POWERPC = src/powerpc/ffi.c src/powerpc/sysv.S src/powerpc/ppc_closure.S
TARGET_SRC_ARM = src/arm/sysv.S src/arm/ffi.c
libffi_la_common_SOURCES = src/debug.c src/prep_cif.c src/types.c \
@@ -167,77 +176,132 @@ libffi_la_common_SOURCES = src/debug.c src/prep_cif.c src/types.c \
@MIPS_GCC_TRUE@libffi_la_SOURCES = @MIPS_GCC_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_GCC)
@MIPS_SGI_TRUE@libffi_la_SOURCES = @MIPS_SGI_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_SGI)
@X86_TRUE@libffi_la_SOURCES = @X86_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_X86)
+@X86_WIN32_TRUE@libffi_la_SOURCES = @X86_WIN32_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_X86_WIN32)
@SPARC_TRUE@libffi_la_SOURCES = @SPARC_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_SPARC)
@ALPHA_TRUE@libffi_la_SOURCES = @ALPHA_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_ALPHA)
@IA64_TRUE@libffi_la_SOURCES = @IA64_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_IA64)
@M68K_TRUE@libffi_la_SOURCES = @M68K_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_M68K)
@POWERPC_TRUE@libffi_la_SOURCES = @POWERPC_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_POWERPC)
@ARM_TRUE@libffi_la_SOURCES = @ARM_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_ARM)
+@MIPS_GCC_TRUE@libfficonvenience_la_SOURCES = @MIPS_GCC_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_GCC)
+@MIPS_SGI_TRUE@libfficonvenience_la_SOURCES = @MIPS_SGI_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_SGI)
+@X86_TRUE@libfficonvenience_la_SOURCES = @X86_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_X86)
+@X86_WIN32_TRUE@libfficonvenience_la_SOURCES = @X86_WIN32_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_X86_WIN32)
+@SPARC_TRUE@libfficonvenience_la_SOURCES = @SPARC_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_SPARC)
+@ALPHA_TRUE@libfficonvenience_la_SOURCES = @ALPHA_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_ALPHA)
+@IA64_TRUE@libfficonvenience_la_SOURCES = @IA64_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_IA64)
+@M68K_TRUE@libfficonvenience_la_SOURCES = @M68K_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_M68K)
+@POWERPC_TRUE@libfficonvenience_la_SOURCES = @POWERPC_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_POWERPC)
+@ARM_TRUE@libfficonvenience_la_SOURCES = @ARM_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_ARM)
AM_CFLAGS = -fexceptions
libffi_la_LDFLAGS = -release $(VERSION)
INCLUDES = -I$(top_srcdir)/include -Iinclude -I$(top_srcdir)/src
-subdir = .
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs
CONFIG_HEADER = fficonfig.h
CONFIG_CLEAN_FILES =
-LTLIBRARIES = $(toolexeclib_LTLIBRARIES)
+LTLIBRARIES = $(noinst_LTLIBRARIES) $(toolexeclib_LTLIBRARIES)
DEFS = @DEFS@ -I. -I$(srcdir) -I.
CPPFLAGS = @CPPFLAGS@
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
+libfficonvenience_la_LDFLAGS =
+libfficonvenience_la_LIBADD =
+@SPARC_TRUE@libfficonvenience_la_OBJECTS = src/debug.lo src/prep_cif.lo \
+@SPARC_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
+@SPARC_TRUE@src/sparc/ffi.lo src/sparc/v8.lo src/sparc/v9.lo
+@MIPS_SGI_TRUE@libfficonvenience_la_OBJECTS = src/debug.lo \
+@MIPS_SGI_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \
+@MIPS_SGI_TRUE@src/java_raw_api.lo src/mips/ffi.lo src/mips/o32.lo \
+@MIPS_SGI_TRUE@src/mips/n32.lo
+@IA64_TRUE@libfficonvenience_la_OBJECTS = src/debug.lo src/prep_cif.lo \
+@IA64_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
+@IA64_TRUE@src/ia64/ffi.lo src/ia64/unix.lo
+@MIPS_GCC_TRUE@libfficonvenience_la_OBJECTS = src/debug.lo \
+@MIPS_GCC_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \
+@MIPS_GCC_TRUE@src/java_raw_api.lo src/mips/ffi.lo src/mips/o32.lo \
+@MIPS_GCC_TRUE@src/mips/n32.lo
+@M68K_TRUE@libfficonvenience_la_OBJECTS = src/debug.lo src/prep_cif.lo \
+@M68K_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
+@M68K_TRUE@src/m68k/ffi.lo src/m68k/sysv.lo
+@ALPHA_TRUE@libfficonvenience_la_OBJECTS = src/debug.lo src/prep_cif.lo \
+@ALPHA_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
+@ALPHA_TRUE@src/alpha/ffi.lo src/alpha/osf.lo
+@X86_TRUE@libfficonvenience_la_OBJECTS = src/debug.lo src/prep_cif.lo \
+@X86_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
+@X86_TRUE@src/x86/ffi.lo src/x86/sysv.lo
+@ARM_TRUE@libfficonvenience_la_OBJECTS = src/debug.lo src/prep_cif.lo \
+@ARM_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
+@ARM_TRUE@src/arm/sysv.lo src/arm/ffi.lo
+@POWERPC_TRUE@libfficonvenience_la_OBJECTS = src/debug.lo \
+@POWERPC_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \
+@POWERPC_TRUE@src/java_raw_api.lo src/powerpc/ffi.lo \
+@POWERPC_TRUE@src/powerpc/sysv.lo src/powerpc/ppc_closure.lo
+@X86_WIN32_TRUE@libfficonvenience_la_OBJECTS = src/debug.lo \
+@X86_WIN32_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \
+@X86_WIN32_TRUE@src/java_raw_api.lo src/x86/ffi.lo src/x86/win32.lo
libffi_la_LIBADD =
-@ALPHA_TRUE@am_libffi_la_OBJECTS = debug.lo prep_cif.lo types.lo \
-@ALPHA_TRUE@raw_api.lo java_raw_api.lo ffi.lo osf.lo
-@ARM_TRUE@am_libffi_la_OBJECTS = debug.lo prep_cif.lo types.lo \
-@ARM_TRUE@raw_api.lo java_raw_api.lo sysv.lo ffi.lo
-@IA64_TRUE@am_libffi_la_OBJECTS = debug.lo prep_cif.lo types.lo \
-@IA64_TRUE@raw_api.lo java_raw_api.lo ffi.lo unix.lo
-@M68K_TRUE@am_libffi_la_OBJECTS = debug.lo prep_cif.lo types.lo \
-@M68K_TRUE@raw_api.lo java_raw_api.lo ffi.lo sysv.lo
-@MIPS_GCC_TRUE@am_libffi_la_OBJECTS = debug.lo prep_cif.lo types.lo \
-@MIPS_GCC_TRUE@raw_api.lo java_raw_api.lo ffi.lo o32.lo n32.lo
-@MIPS_SGI_TRUE@am_libffi_la_OBJECTS = debug.lo prep_cif.lo types.lo \
-@MIPS_SGI_TRUE@raw_api.lo java_raw_api.lo ffi.lo o32.lo n32.lo
-@POWERPC_TRUE@am_libffi_la_OBJECTS = debug.lo prep_cif.lo types.lo \
-@POWERPC_TRUE@raw_api.lo java_raw_api.lo ffi.lo sysv.lo
-@SPARC_TRUE@am_libffi_la_OBJECTS = debug.lo prep_cif.lo types.lo \
-@SPARC_TRUE@raw_api.lo java_raw_api.lo ffi.lo v8.lo v9.lo
-@X86_TRUE@am_libffi_la_OBJECTS = debug.lo prep_cif.lo types.lo \
-@X86_TRUE@raw_api.lo java_raw_api.lo ffi.lo sysv.lo
-libffi_la_OBJECTS = $(am_libffi_la_OBJECTS)
+@SPARC_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \
+@SPARC_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
+@SPARC_TRUE@src/sparc/ffi.lo src/sparc/v8.lo src/sparc/v9.lo
+@MIPS_SGI_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \
+@MIPS_SGI_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
+@MIPS_SGI_TRUE@src/mips/ffi.lo src/mips/o32.lo src/mips/n32.lo
+@IA64_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \
+@IA64_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
+@IA64_TRUE@src/ia64/ffi.lo src/ia64/unix.lo
+@MIPS_GCC_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \
+@MIPS_GCC_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
+@MIPS_GCC_TRUE@src/mips/ffi.lo src/mips/o32.lo src/mips/n32.lo
+@M68K_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \
+@M68K_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
+@M68K_TRUE@src/m68k/ffi.lo src/m68k/sysv.lo
+@ALPHA_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \
+@ALPHA_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
+@ALPHA_TRUE@src/alpha/ffi.lo src/alpha/osf.lo
+@X86_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo src/types.lo \
+@X86_TRUE@src/raw_api.lo src/java_raw_api.lo src/x86/ffi.lo \
+@X86_TRUE@src/x86/sysv.lo
+@ARM_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo src/types.lo \
+@ARM_TRUE@src/raw_api.lo src/java_raw_api.lo src/arm/sysv.lo \
+@ARM_TRUE@src/arm/ffi.lo
+@POWERPC_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \
+@POWERPC_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
+@POWERPC_TRUE@src/powerpc/ffi.lo src/powerpc/sysv.lo \
+@POWERPC_TRUE@src/powerpc/ppc_closure.lo
+@X86_WIN32_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \
+@X86_WIN32_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
+@X86_WIN32_TRUE@src/x86/ffi.lo src/x86/win32.lo
noinst_PROGRAMS = ffitest$(EXEEXT)
PROGRAMS = $(noinst_PROGRAMS)
-am_ffitest_OBJECTS = ffitest.o
-ffitest_OBJECTS = $(am_ffitest_OBJECTS)
+ffitest_OBJECTS = src/ffitest.$(OBJEXT)
ffitest_DEPENDENCIES = libffi.la
-ffitest_LDFLAGS =
+CFLAGS = @CFLAGS@
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-CFLAGS = @CFLAGS@
CCLD = $(CC)
-LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
-DIST_SOURCES = $(libffi_la_SOURCES) $(ffitest_SOURCES)
-depcomp =
+LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
DIST_COMMON = README ./stamp-h.in ChangeLog Makefile.am Makefile.in \
-acconfig.h acinclude.m4 aclocal.m4 configure configure.in fficonfig.h.in
+acconfig.h acinclude.m4 aclocal.m4 configure configure.in \
+fficonfig.h.in
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+TAR = gtar
GZIP_ENV = --best
-SOURCES = $(libffi_la_SOURCES) $(ffitest_SOURCES)
-OBJECTS = $(am_libffi_la_OBJECTS) $(am_ffitest_OBJECTS)
+SOURCES = $(libfficonvenience_la_SOURCES) $(libffi_la_SOURCES) $(ffitest_SOURCES)
+OBJECTS = $(libfficonvenience_la_OBJECTS) $(libffi_la_OBJECTS) $(ffitest_OBJECTS)
all: all-redirect
.SUFFIXES:
-.SUFFIXES: .S .c .lo .o .s
+.SUFFIXES: .S .c .lo .o .obj .s
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile
@@ -245,7 +309,7 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) \
&& CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
-$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ configure.in
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ configure.in acinclude.m4
cd $(srcdir) && $(ACLOCAL)
config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -259,22 +323,18 @@ fficonfig.h: stamp-h
$(MAKE) stamp-h; \
else :; fi
stamp-h: $(srcdir)/fficonfig.h.in $(top_builddir)/config.status
- @rm -f stamp-h stamp-hT
- @echo timestamp > stamp-hT 2> /dev/null
cd $(top_builddir) \
&& CONFIG_FILES= CONFIG_HEADERS=fficonfig.h \
$(SHELL) ./config.status
- @mv stamp-hT stamp-h
-$(srcdir)/fficonfig.h.in: @MAINTAINER_MODE_TRUE@$(srcdir)/./stamp-h.in
+ @echo timestamp > stamp-h 2> /dev/null
+$(srcdir)/fficonfig.h.in: @MAINTAINER_MODE_TRUE@$(srcdir)/stamp-h.in
@if test ! -f $@; then \
- rm -f $(srcdir)/./stamp-h.in; \
- $(MAKE) $(srcdir)/./stamp-h.in; \
+ rm -f $(srcdir)/stamp-h.in; \
+ $(MAKE) $(srcdir)/stamp-h.in; \
else :; fi
-$(srcdir)/./stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) acconfig.h
- @rm -f $(srcdir)/./stamp-h.in $(srcdir)/./stamp-h.inT
- @echo timestamp > $(srcdir)/./stamp-h.inT 2> /dev/null
+$(srcdir)/stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) acconfig.h
cd $(top_srcdir) && $(AUTOHEADER)
- @mv $(srcdir)/./stamp-h.inT $(srcdir)/./stamp-h.in
+ @echo timestamp > $(srcdir)/stamp-h.in 2> /dev/null
mostlyclean-hdr:
@@ -285,6 +345,15 @@ distclean-hdr:
maintainer-clean-hdr:
+mostlyclean-noinstLTLIBRARIES:
+
+clean-noinstLTLIBRARIES:
+ -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
+
+distclean-noinstLTLIBRARIES:
+
+maintainer-clean-noinstLTLIBRARIES:
+
mostlyclean-toolexeclibLTLIBRARIES:
clean-toolexeclibLTLIBRARIES:
@@ -299,20 +368,25 @@ install-toolexeclibLTLIBRARIES: $(toolexeclib_LTLIBRARIES)
$(mkinstalldirs) $(DESTDIR)$(toolexeclibdir)
@list='$(toolexeclib_LTLIBRARIES)'; for p in $$list; do \
if test -f $$p; then \
- echo " $(LIBTOOL) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(toolexeclibdir)/$$p"; \
- $(LIBTOOL) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(toolexeclibdir)/$$p; \
+ echo "$(LIBTOOL) --mode=install $(INSTALL) $$p $(DESTDIR)$(toolexeclibdir)/$$p"; \
+ $(LIBTOOL) --mode=install $(INSTALL) $$p $(DESTDIR)$(toolexeclibdir)/$$p; \
else :; fi; \
done
uninstall-toolexeclibLTLIBRARIES:
@$(NORMAL_UNINSTALL)
- @list='$(toolexeclib_LTLIBRARIES)'; for p in $$list; do \
- echo " $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(toolexeclibdir)/$$p"; \
+ list='$(toolexeclib_LTLIBRARIES)'; for p in $$list; do \
$(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(toolexeclibdir)/$$p; \
done
+# FIXME: We should only use cygpath when building on Windows,
+# and only if it is available.
+.c.obj:
+ $(COMPILE) -c `cygpath -w $<`
+
mostlyclean-compile:
-rm -f *.o core *.core
+ -rm -f *.$(OBJEXT)
clean-compile:
@@ -330,19 +404,9 @@ clean-libtool:
distclean-libtool:
maintainer-clean-libtool:
-debug.lo: src/debug.c
-prep_cif.lo: src/prep_cif.c
-types.lo: src/types.c
-raw_api.lo: src/raw_api.c
-java_raw_api.lo: src/java_raw_api.c
-ffi.lo: src/alpha/ffi.c
-osf.lo: src/alpha/osf.S
-sysv.lo: src/arm/sysv.S
-unix.lo: src/ia64/unix.S
-o32.lo: src/mips/o32.S
-n32.lo: src/mips/n32.S
-v8.lo: src/sparc/v8.S
-v9.lo: src/sparc/v9.S
+
+libfficonvenience.la: $(libfficonvenience_la_OBJECTS) $(libfficonvenience_la_DEPENDENCIES)
+ $(LINK) $(libfficonvenience_la_LDFLAGS) $(libfficonvenience_la_OBJECTS) $(libfficonvenience_la_LIBADD) $(LIBS)
libffi.la: $(libffi_la_OBJECTS) $(libffi_la_DEPENDENCIES)
$(LINK) -rpath $(toolexeclibdir) $(libffi_la_LDFLAGS) $(libffi_la_OBJECTS) $(libffi_la_LIBADD) $(LIBS)
@@ -355,23 +419,10 @@ clean-noinstPROGRAMS:
distclean-noinstPROGRAMS:
maintainer-clean-noinstPROGRAMS:
-ffitest.o: src/ffitest.c
ffitest$(EXEEXT): $(ffitest_OBJECTS) $(ffitest_DEPENDENCIES)
@rm -f ffitest$(EXEEXT)
$(LINK) $(ffitest_LDFLAGS) $(ffitest_OBJECTS) $(ffitest_LDADD) $(LIBS)
-.S.o:
- $(COMPILE) -c $<
-.S.lo:
- $(LTCOMPILE) -c -o $@ $<
-.c.o:
- $(COMPILE) -c $<
-.c.lo:
- $(LTCOMPILE) -c -o $@ $<
-.s.o:
- $(COMPILE) -c $<
-.s.lo:
- $(LTCOMPILE) -c -o $@ $<
# This directory's subdirectories are mostly independent; you can cd
# into them and run `make' without going through this Makefile.
@@ -380,6 +431,8 @@ ffitest$(EXEEXT): $(ffitest_OBJECTS) $(ffitest_DEPENDENCIES)
# (which will cause the Makefiles to be regenerated when you run `make');
# (2) otherwise, pass the desired values on the `make' command line.
+@SET_MAKE@
+
all-recursive install-data-recursive install-exec-recursive \
installdirs-recursive install-recursive uninstall-recursive install-info-recursive \
check-recursive installcheck-recursive info-recursive dvi-recursive:
@@ -407,7 +460,7 @@ maintainer-clean-recursive:
dot_seen=no; \
rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \
rev="$$subdir $$rev"; \
- if test "$$subdir" = "."; then dot_seen=yes; else :; fi; \
+ test "$$subdir" = "." && dot_seen=yes; \
done; \
test "$$dot_seen" = "no" && rev=". $$rev"; \
target=`echo $@ | sed s/-recursive//`; \
@@ -428,17 +481,15 @@ tags-recursive:
tags: TAGS
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
- list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
+ID: $(HEADERS) $(SOURCES) $(LISP)
+ list='$(SOURCES) $(HEADERS)'; \
+ unique=`for i in $$list; do echo $$i; done | \
+ awk ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
- mkid -fID $$unique $(LISP)
+ here=`pwd` && cd $(srcdir) \
+ && mkid -f$$here/ID $$unique $(LISP)
-TAGS: tags-recursive $(HEADERS) $(SOURCES) fficonfig.h.in $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
+TAGS: tags-recursive $(HEADERS) $(SOURCES) fficonfig.h.in $(TAGS_DEPENDENCIES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SUBDIRS)'; for subdir in $$list; do \
@@ -446,14 +497,12 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) fficonfig.h.in $(TAGS_DEPENDENCIES) \
test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \
fi; \
done; \
- list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
+ list='$(SOURCES) $(HEADERS)'; \
+ unique=`for i in $$list; do echo $$i; done | \
+ awk ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(ETAGS_ARGS)fficonfig.h.in$$unique$(LISP)$$tags" \
- || etags $(ETAGS_ARGS) $$tags fficonfig.h.in $$unique $(LISP)
+ || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags fficonfig.h.in $$unique $(LISP) -o $$here/TAGS)
mostlyclean-tags:
@@ -467,56 +516,41 @@ maintainer-clean-tags:
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
-
# This target untars the dist file and tries a VPATH configuration. Then
# it guarantees that the distribution is self-contained by making another
# tarfile.
distcheck: dist
- -chmod -R a+w $(distdir) > /dev/null 2>&1; rm -rf $(distdir)
- GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(AMTAR) xf -
- chmod -R a-w $(distdir); chmod a+w $(distdir)
+ -rm -rf $(distdir)
+ GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz
mkdir $(distdir)/=build
mkdir $(distdir)/=inst
- chmod a-w $(distdir)
- dc_install_base=`CDPATH=: && cd $(distdir)/=inst && pwd` \
- && cd $(distdir)/=build \
+ dc_install_base=`cd $(distdir)/=inst && pwd`; \
+ cd $(distdir)/=build \
&& ../configure --srcdir=.. --prefix=$$dc_install_base \
&& $(MAKE) $(AM_MAKEFLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
&& $(MAKE) $(AM_MAKEFLAGS) check \
&& $(MAKE) $(AM_MAKEFLAGS) install \
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
- && $(MAKE) $(AM_MAKEFLAGS) uninstall \
- && test `find $$dc_install_base -type f -print | wc -l` -le 1 \
- && $(MAKE) $(AM_MAKEFLAGS) dist \
- && $(MAKE) $(AM_MAKEFLAGS) distclean \
- && rm -f $(distdir).tar.gz \
- && test `find . -type f -print | wc -l` -eq 0
- -chmod -R a+w $(distdir) > /dev/null 2>&1; rm -rf $(distdir)
+ && $(MAKE) $(AM_MAKEFLAGS) dist
+ -rm -rf $(distdir)
@banner="$(distdir).tar.gz is ready for distribution"; \
dashes=`echo "$$banner" | sed s/./=/g`; \
echo "$$dashes"; \
echo "$$banner"; \
echo "$$dashes"
dist: distdir
- -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
- ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
- ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
- ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \
- || chmod -R a+r $(distdir)
- $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c > $(distdir).tar.gz
- -chmod -R a+w $(distdir) > /dev/null 2>&1; rm -rf $(distdir)
+ -chmod -R a+r $(distdir)
+ GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir)
+ -rm -rf $(distdir)
dist-all: distdir
- -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
- ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
- ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
- ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \
- || chmod -R a+r $(distdir)
- $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c > $(distdir).tar.gz
- -chmod -R a+w $(distdir) > /dev/null 2>&1; rm -rf $(distdir)
+ -chmod -R a+r $(distdir)
+ GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir)
+ -rm -rf $(distdir)
distdir: $(DISTFILES)
- -chmod -R a+w $(distdir) > /dev/null 2>&1; rm -rf $(distdir)
+ -rm -rf $(distdir)
mkdir $(distdir)
+ -chmod 777 $(distdir)
$(mkinstalldirs) $(distdir)/src/alpha $(distdir)/src/arm \
$(distdir)/src/m68k $(distdir)/src/mips \
$(distdir)/src/powerpc $(distdir)/src/sparc \
@@ -524,12 +558,11 @@ distdir: $(DISTFILES)
@for file in $(DISTFILES); do \
if test -f $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
- cp -pR $$d/$$file $(distdir) \
- || exit 1; \
+ cp -pr $$d/$$file $(distdir)/$$file; \
else \
test -f $(distdir)/$$file \
- || cp -p $$d/$$file $(distdir)/$$file \
- || exit 1; \
+ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
+ || cp -p $$d/$$file $(distdir)/$$file || :; \
fi; \
done
for subdir in $(SUBDIRS); do \
@@ -537,6 +570,7 @@ distdir: $(DISTFILES)
test -d $(distdir)/$$subdir \
|| mkdir $(distdir)/$$subdir \
|| exit 1; \
+ chmod 777 $(distdir)/$$subdir; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(distdir) distdir=../$(distdir)/$$subdir distdir) \
|| exit 1; \
fi; \
@@ -568,7 +602,7 @@ uninstall: uninstall-recursive
all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) fficonfig.h
all-redirect: all-recursive-am
install-strip:
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_STRIP_FLAG=-s install
+ $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
installdirs: installdirs-recursive
installdirs-am:
$(mkinstalldirs) $(DESTDIR)$(toolexeclibdir)
@@ -583,30 +617,31 @@ distclean-generic:
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
maintainer-clean-generic:
- -rm -f Makefile.in
-mostlyclean-am: mostlyclean-hdr mostlyclean-toolexeclibLTLIBRARIES \
- mostlyclean-compile mostlyclean-libtool \
- mostlyclean-noinstPROGRAMS mostlyclean-tags \
- mostlyclean-generic
+mostlyclean-am: mostlyclean-hdr mostlyclean-noinstLTLIBRARIES \
+ mostlyclean-toolexeclibLTLIBRARIES mostlyclean-compile \
+ mostlyclean-libtool mostlyclean-noinstPROGRAMS \
+ mostlyclean-tags mostlyclean-generic
mostlyclean: mostlyclean-recursive
-clean-am: clean-hdr clean-toolexeclibLTLIBRARIES clean-compile \
+clean-am: clean-hdr clean-noinstLTLIBRARIES \
+ clean-toolexeclibLTLIBRARIES clean-compile \
clean-libtool clean-noinstPROGRAMS clean-tags \
clean-generic mostlyclean-am
clean: clean-recursive
-distclean-am: distclean-hdr distclean-toolexeclibLTLIBRARIES \
- distclean-compile distclean-libtool \
- distclean-noinstPROGRAMS distclean-tags \
- distclean-generic clean-am
+distclean-am: distclean-hdr distclean-noinstLTLIBRARIES \
+ distclean-toolexeclibLTLIBRARIES distclean-compile \
+ distclean-libtool distclean-noinstPROGRAMS \
+ distclean-tags distclean-generic clean-am
-rm -f libtool
distclean: distclean-recursive
-rm -f config.status
maintainer-clean-am: maintainer-clean-hdr \
+ maintainer-clean-noinstLTLIBRARIES \
maintainer-clean-toolexeclibLTLIBRARIES \
maintainer-clean-compile maintainer-clean-libtool \
maintainer-clean-noinstPROGRAMS maintainer-clean-tags \
@@ -618,6 +653,8 @@ maintainer-clean: maintainer-clean-recursive
-rm -f config.status
.PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \
+mostlyclean-noinstLTLIBRARIES distclean-noinstLTLIBRARIES \
+clean-noinstLTLIBRARIES maintainer-clean-noinstLTLIBRARIES \
mostlyclean-toolexeclibLTLIBRARIES distclean-toolexeclibLTLIBRARIES \
clean-toolexeclibLTLIBRARIES maintainer-clean-toolexeclibLTLIBRARIES \
uninstall-toolexeclibLTLIBRARIES install-toolexeclibLTLIBRARIES \
@@ -625,8 +662,8 @@ mostlyclean-compile distclean-compile clean-compile \
maintainer-clean-compile mostlyclean-libtool distclean-libtool \
clean-libtool maintainer-clean-libtool mostlyclean-noinstPROGRAMS \
distclean-noinstPROGRAMS clean-noinstPROGRAMS \
-maintainer-clean-noinstPROGRAMS install-recursive uninstall-recursive \
-install-data-recursive uninstall-data-recursive install-exec-recursive \
+maintainer-clean-noinstPROGRAMS install-data-recursive \
+uninstall-data-recursive install-exec-recursive \
uninstall-exec-recursive installdirs-recursive uninstalldirs-recursive \
all-recursive check-recursive installcheck-recursive info-recursive \
dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \
@@ -635,10 +672,30 @@ distclean-tags clean-tags maintainer-clean-tags distdir info-am info \
dvi-am dvi check check-am installcheck-am installcheck install-info-am \
install-info all-recursive-am install-exec-am install-exec \
install-data-am install-data install-am install uninstall-am uninstall \
-all-redirect all-am all install-strip installdirs-am installdirs \
-mostlyclean-generic distclean-generic clean-generic \
-maintainer-clean-generic clean mostlyclean distclean maintainer-clean
+all-redirect all-am all installdirs-am installdirs mostlyclean-generic \
+distclean-generic clean-generic maintainer-clean-generic clean \
+mostlyclean distclean maintainer-clean
+
+
+# Override these rules so that object files get put in the correct
+# subdirectories.
+.c.o:
+ $(LTCOMPILE) -c -o $@ $<
+
+.s.o:
+ $(LTCOMPILE) -c -o $@ $<
+.S.o:
+ $(LTCOMPILE) -c -o $@ $<
+
+.c.lo:
+ $(LTCOMPILE) -c -o $@ $<
+
+.s.lo:
+ $(LTCOMPILE) -c -o $@ $<
+
+.S.lo:
+ $(LTCOMPILE) -c -o $@ $<
# Multilib support.
.PHONY: all-multi mostlyclean-multi clean-multi distclean-multi \
diff --git a/libffi/configure b/libffi/configure
index 071d074c803..4aeb281d4c1 100755
--- a/libffi/configure
+++ b/libffi/configure
@@ -14,9 +14,6 @@ ac_default_prefix=/usr/local
ac_help="$ac_help
--enable-multilib build many library versions (default)"
ac_help="$ac_help
- --enable-maintainer-mode enable make rules and dependencies not useful
- (and sometimes confusing) to the casual installer"
-ac_help="$ac_help
--enable-shared[=PKGS] build shared libraries [default=yes]"
ac_help="$ac_help
--enable-static[=PKGS] build static libraries [default=yes]"
@@ -29,6 +26,9 @@ ac_help="$ac_help
ac_help="$ac_help
--with-pic try to use only PIC/non-PIC objects [default=use both]"
ac_help="$ac_help
+ --enable-maintainer-mode enable make rules and dependencies not useful
+ (and sometimes confusing) to the casual installer"
+ac_help="$ac_help
--enable-debug debugging mode"
ac_help="$ac_help
--disable-structs omit code for struct support"
@@ -545,17 +545,72 @@ else
ac_n= ac_c='\c' ac_t=
fi
+echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
+echo "configure:550: checking for Cygwin environment" >&5
+if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 555 "configure"
+#include "confdefs.h"
+int main() {
+
+#ifndef __CYGWIN__
+#define __CYGWIN__ __CYGWIN32__
+#endif
+return __CYGWIN__;
+; return 0; }
+EOF
+if { (eval echo configure:566: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_cv_cygwin=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_cv_cygwin=no
+fi
+rm -f conftest*
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_cygwin" 1>&6
+CYGWIN=
+test "$ac_cv_cygwin" = yes && CYGWIN=yes
+echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
+echo "configure:583: checking for mingw32 environment" >&5
+if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 588 "configure"
+#include "confdefs.h"
+
+int main() {
+return __MINGW32__;
+; return 0; }
+EOF
+if { (eval echo configure:595: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_cv_mingw32=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_cv_mingw32=no
+fi
+rm -f conftest*
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_mingw32" 1>&6
+MINGW32=
+test "$ac_cv_mingw32" = yes && MINGW32=yes
-echo "configure: warning: ***********************************************************" 1>&2
-echo "configure: warning: ***********************************************************" 1>&2
-echo "configure: warning: This is beta code. If you're looking for a stable release" 1>&2
-echo "configure: warning: then use the most recent one - libffi-1.20." 1>&2
-echo "configure: warning: ***********************************************************" 1>&2
-echo "configure: warning: ***********************************************************" 1>&2
# Check whether --enable-multilib or --disable-multilib was given.
if test "${enable_multilib+set}" = set; then
@@ -607,7 +662,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
fi
echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:611: checking host system type" >&5
+echo "configure:666: checking host system type" >&5
host_alias=$host
case "$host_alias" in
@@ -628,356 +683,97 @@ host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
echo "$ac_t""$host" 1>&6
-# Find a good install program. We prefer a C program (faster),
-# so one script is as good as another. But avoid the broken or
-# incompatible versions:
-# SysV /etc/install, /usr/sbin/install
-# SunOS /usr/etc/install
-# IRIX /sbin/install
-# AIX /bin/install
-# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
-# AFS /usr/afsws/bin/install, which mishandles nonexistent args
-# 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:644: 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
-else
- IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":"
- for ac_dir in $PATH; do
- # Account for people who put trailing slashes in PATH elements.
- case "$ac_dir/" in
- /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
- *)
- # OSF1 and SCO ODT 3.0 have their own names for install.
- # Don't use installbsd from OSF since it installs stuff as root
- # by default.
- for ac_prog in ginstall scoinst install; do
- if test -f $ac_dir/$ac_prog; then
- if test $ac_prog = install &&
- grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
- # AIX install. It has an incompatible calling convention.
- :
- else
- ac_cv_path_install="$ac_dir/$ac_prog -c"
- break 2
- fi
- fi
- done
- ;;
- esac
+# Check whether --enable-shared or --disable-shared was given.
+if test "${enable_shared+set}" = set; then
+ enableval="$enable_shared"
+ p=${PACKAGE-default}
+case $enableval in
+yes) enable_shared=yes ;;
+no) enable_shared=no ;;
+*)
+ enable_shared=no
+ # Look at the argument we got. We use all the common list separators.
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+ for pkg in $enableval; do
+ if test "X$pkg" = "X$p"; then
+ enable_shared=yes
+ fi
done
- IFS="$ac_save_IFS"
-
-fi
- if test "${ac_cv_path_install+set}" = set; then
- INSTALL="$ac_cv_path_install"
- else
- # As a last resort, use the slow shell script. We don't cache a
- # path for INSTALL within a source directory, because that will
- # break other packages using the cache if that directory is
- # removed, or if the path is relative.
- INSTALL="$ac_install_sh"
- fi
-fi
-echo "$ac_t""$INSTALL" 1>&6
-
-# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
-# It thinks the first close brace ends the variable substitution.
-test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
-
-test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
-
-test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
-
-echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
-echo "configure:697: checking whether build environment is sane" >&5
-# Just in case
-sleep 1
-echo timestamp > conftestfile
-# Do `set' in a subshell so we don't clobber the current shell's
-# arguments. Must try -L first in case configure is actually a
-# symlink; some systems play weird games with the mod time of symlinks
-# (eg FreeBSD returns the mod time of the symlink's containing
-# directory).
-if (
- set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
- if test "$*" = "X"; then
- # -L didn't work.
- set X `ls -t $srcdir/configure conftestfile`
- fi
- if test "$*" != "X $srcdir/configure conftestfile" \
- && test "$*" != "X conftestfile $srcdir/configure"; then
-
- # If neither matched, then we have a broken ls. This can happen
- # if, for instance, CONFIG_SHELL is bash and it inherits a
- # broken ls alias from the environment. This has actually
- # happened. Such a system could not be considered "sane".
- { echo "configure: error: ls -t appears to fail. Make sure there is not a broken
-alias in your environment" 1>&2; exit 1; }
- fi
-
- test "$2" = conftestfile
- )
-then
- # Ok.
- :
-else
- { echo "configure: error: newly created file is older than distributed files!
-Check your system clock" 1>&2; exit 1; }
-fi
-rm -f conftest*
-echo "$ac_t""yes" 1>&6
-if test "$program_transform_name" = s,x,x,; then
- program_transform_name=
-else
- # Double any \ or $. echo might interpret backslashes.
- cat <<\EOF_SED > conftestsed
-s,\\,\\\\,g; s,\$,$$,g
-EOF_SED
- program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
- rm -f conftestsed
-fi
-test "$program_prefix" != NONE &&
- program_transform_name="s,^,${program_prefix},; $program_transform_name"
-# Use a double $ so make ignores it.
-test "$program_suffix" != NONE &&
- program_transform_name="s,\$\$,${program_suffix},; $program_transform_name"
-
-# sed with no file args requires a program.
-test "$program_transform_name" = "" && program_transform_name="s,x,x,"
-
-echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:754: 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
-else
- cat > conftestmake <<\EOF
-all:
- @echo 'ac_maketemp="${MAKE}"'
-EOF
-# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
-eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
-if test -n "$ac_maketemp"; then
- eval ac_cv_prog_make_${ac_make}_set=yes
-else
- eval ac_cv_prog_make_${ac_make}_set=no
-fi
-rm -f conftestmake
-fi
-if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- SET_MAKE=
-else
- echo "$ac_t""no" 1>&6
- SET_MAKE="MAKE=${MAKE-make}"
-fi
-
-
-PACKAGE=libffi
-
-VERSION=2.00-beta
-
-if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
- { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
-fi
-
-
-
-missing_dir=`cd $ac_aux_dir && pwd`
-echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
-echo "configure:793: checking for working aclocal" >&5
-# Run test in a subshell; some versions of sh will print an error if
-# an executable is not found, even if stderr is redirected.
-# Redirect stdin to placate older versions of autoconf. Sigh.
-if (aclocal --version) < /dev/null > /dev/null 2>&1; then
- ACLOCAL=aclocal
- echo "$ac_t""found" 1>&6
-else
- ACLOCAL="$missing_dir/missing aclocal"
- echo "$ac_t""missing" 1>&6
-fi
-
-echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
-echo "configure:806: checking for working autoconf" >&5
-# Run test in a subshell; some versions of sh will print an error if
-# an executable is not found, even if stderr is redirected.
-# Redirect stdin to placate older versions of autoconf. Sigh.
-if (autoconf --version) < /dev/null > /dev/null 2>&1; then
- AUTOCONF=autoconf
- echo "$ac_t""found" 1>&6
-else
- AUTOCONF="$missing_dir/missing autoconf"
- echo "$ac_t""missing" 1>&6
-fi
-
-echo $ac_n "checking for working automake""... $ac_c" 1>&6
-echo "configure:819: checking for working automake" >&5
-# Run test in a subshell; some versions of sh will print an error if
-# an executable is not found, even if stderr is redirected.
-# Redirect stdin to placate older versions of autoconf. Sigh.
-if (automake --version) < /dev/null > /dev/null 2>&1; then
- AUTOMAKE=automake
- echo "$ac_t""found" 1>&6
-else
- AUTOMAKE="$missing_dir/missing automake"
- echo "$ac_t""missing" 1>&6
-fi
-
-echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
-echo "configure:832: checking for working autoheader" >&5
-# Run test in a subshell; some versions of sh will print an error if
-# an executable is not found, even if stderr is redirected.
-# Redirect stdin to placate older versions of autoconf. Sigh.
-if (autoheader --version) < /dev/null > /dev/null 2>&1; then
- AUTOHEADER=autoheader
- echo "$ac_t""found" 1>&6
-else
- AUTOHEADER="$missing_dir/missing autoheader"
- echo "$ac_t""missing" 1>&6
-fi
-
-echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
-echo "configure:845: checking for working makeinfo" >&5
-# Run test in a subshell; some versions of sh will print an error if
-# an executable is not found, even if stderr is redirected.
-# Redirect stdin to placate older versions of autoconf. Sigh.
-if (makeinfo --version) < /dev/null > /dev/null 2>&1; then
- MAKEINFO=makeinfo
- echo "$ac_t""found" 1>&6
-else
- MAKEINFO="$missing_dir/missing makeinfo"
- echo "$ac_t""missing" 1>&6
-fi
-
-
-
-echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
-echo "configure:860: checking for Cygwin environment" >&5
-if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 865 "configure"
-#include "confdefs.h"
-
-int main() {
-
-#ifndef __CYGWIN__
-#define __CYGWIN__ __CYGWIN32__
-#endif
-return __CYGWIN__;
-; return 0; }
-EOF
-if { (eval echo configure:876: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- ac_cv_cygwin=yes
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ac_cv_cygwin=no
-fi
-rm -f conftest*
-rm -f conftest*
-fi
-
-echo "$ac_t""$ac_cv_cygwin" 1>&6
-CYGWIN=
-test "$ac_cv_cygwin" = yes && CYGWIN=yes
-echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
-echo "configure:893: checking for mingw32 environment" >&5
-if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 898 "configure"
-#include "confdefs.h"
-
-int main() {
-return __MINGW32__;
-; return 0; }
-EOF
-if { (eval echo configure:905: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- ac_cv_mingw32=yes
+ IFS="$ac_save_ifs"
+ ;;
+esac
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ac_cv_mingw32=no
-fi
-rm -f conftest*
-rm -f conftest*
+ enable_shared=yes
fi
-echo "$ac_t""$ac_cv_mingw32" 1>&6
-MINGW32=
-test "$ac_cv_mingw32" = yes && MINGW32=yes
-
-
-echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:924: checking for executable suffix" >&5
-if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- if test "$CYGWIN" = yes || test "$MINGW32" = yes; then
- ac_cv_exeext=.exe
+# Check whether --enable-static or --disable-static was given.
+if test "${enable_static+set}" = set; then
+ enableval="$enable_static"
+ p=${PACKAGE-default}
+case $enableval in
+yes) enable_static=yes ;;
+no) enable_static=no ;;
+*)
+ enable_static=no
+ # Look at the argument we got. We use all the common list separators.
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+ for pkg in $enableval; do
+ if test "X$pkg" = "X$p"; then
+ enable_static=yes
+ fi
+ done
+ IFS="$ac_save_ifs"
+ ;;
+esac
else
- rm -f conftest*
- echo 'int main () { return 0; }' > conftest.$ac_ext
- ac_cv_exeext=
- if { (eval echo configure:934: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
- for file in conftest.*; do
- case $file in
- *.c | *.o | *.obj) ;;
- *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
- esac
- done
- else
- { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
- fi
- rm -f conftest*
- test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
-fi
+ enable_static=yes
fi
-EXEEXT=""
-test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
-echo "$ac_t""${ac_cv_exeext}" 1>&6
-ac_exeext=$EXEEXT
-
-echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
-echo "configure:955: 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"
- USE_MAINTAINER_MODE=$enableval
+# Check whether --enable-fast-install or --disable-fast-install was given.
+if test "${enable_fast_install+set}" = set; then
+ enableval="$enable_fast_install"
+ p=${PACKAGE-default}
+case $enableval in
+yes) enable_fast_install=yes ;;
+no) enable_fast_install=no ;;
+*)
+ enable_fast_install=no
+ # Look at the argument we got. We use all the common list separators.
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+ for pkg in $enableval; do
+ if test "X$pkg" = "X$p"; then
+ enable_fast_install=yes
+ fi
+ done
+ IFS="$ac_save_ifs"
+ ;;
+esac
else
- USE_MAINTAINER_MODE=no
+ enable_fast_install=yes
fi
- echo "$ac_t""$USE_MAINTAINER_MODE" 1>&6
-
+echo $ac_n "checking build system type""... $ac_c" 1>&6
+echo "configure:757: checking build system type" >&5
-if test $USE_MAINTAINER_MODE = yes; then
- MAINTAINER_MODE_TRUE=
- MAINTAINER_MODE_FALSE='#'
-else
- MAINTAINER_MODE_TRUE='#'
- MAINTAINER_MODE_FALSE=
-fi
- MAINT=$MAINTAINER_MODE_TRUE
-
+build_alias=$build
+case "$build_alias" in
+NONE)
+ case $nonopt in
+ NONE) build_alias=$host_alias ;;
+ *) build_alias=$nonopt ;;
+ esac ;;
+esac
+build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias`
+build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$build" 1>&6
# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:981: checking for $ac_word" >&5
+echo "configure:777: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1007,7 +803,7 @@ if test -z "$CC"; then
# Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1011: checking for $ac_word" >&5
+echo "configure:807: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1058,7 +854,7 @@ fi
# Extract the first word of "cl", so it can be a program name with args.
set dummy cl; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1062: checking for $ac_word" >&5
+echo "configure:858: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1090,7 +886,7 @@ fi
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:1094: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:890: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -1101,12 +897,12 @@ cross_compiling=$ac_cv_prog_cc_cross
cat > conftest.$ac_ext << EOF
-#line 1105 "configure"
+#line 901 "configure"
#include "confdefs.h"
main(){return(0);}
EOF
-if { (eval echo configure:1110: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:906: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ac_cv_prog_cc_works=yes
# If we can't run a trivial program, we are probably using a cross compiler.
if (./conftest; exit) 2>/dev/null; then
@@ -1132,12 +928,12 @@ if test $ac_cv_prog_cc_works = no; then
{ echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:1136: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:932: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
cross_compiling=$ac_cv_prog_cc_cross
echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:1141: checking whether we are using GNU C" >&5
+echo "configure:937: checking whether we are using GNU C" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1146,7 +942,7 @@ else
yes;
#endif
EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1150: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:946: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
ac_cv_prog_gcc=yes
else
ac_cv_prog_gcc=no
@@ -1165,7 +961,7 @@ ac_test_CFLAGS="${CFLAGS+set}"
ac_save_CFLAGS="$CFLAGS"
CFLAGS=
echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:1169: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:965: checking whether ${CC-cc} accepts -g" >&5
if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1196,93 +992,6 @@ else
fi
fi
-# Check whether --enable-shared or --disable-shared was given.
-if test "${enable_shared+set}" = set; then
- enableval="$enable_shared"
- p=${PACKAGE-default}
-case "$enableval" in
-yes) enable_shared=yes ;;
-no) enable_shared=no ;;
-*)
- enable_shared=no
- # Look at the argument we got. We use all the common list separators.
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
- for pkg in $enableval; do
- if test "X$pkg" = "X$p"; then
- enable_shared=yes
- fi
- done
- IFS="$ac_save_ifs"
- ;;
-esac
-else
- enable_shared=yes
-fi
-
-# Check whether --enable-static or --disable-static was given.
-if test "${enable_static+set}" = set; then
- enableval="$enable_static"
- p=${PACKAGE-default}
-case "$enableval" in
-yes) enable_static=yes ;;
-no) enable_static=no ;;
-*)
- enable_static=no
- # Look at the argument we got. We use all the common list separators.
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
- for pkg in $enableval; do
- if test "X$pkg" = "X$p"; then
- enable_static=yes
- fi
- done
- IFS="$ac_save_ifs"
- ;;
-esac
-else
- enable_static=yes
-fi
-
-# Check whether --enable-fast-install or --disable-fast-install was given.
-if test "${enable_fast_install+set}" = set; then
- enableval="$enable_fast_install"
- p=${PACKAGE-default}
-case "$enableval" in
-yes) enable_fast_install=yes ;;
-no) enable_fast_install=no ;;
-*)
- enable_fast_install=no
- # Look at the argument we got. We use all the common list separators.
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
- for pkg in $enableval; do
- if test "X$pkg" = "X$p"; then
- enable_fast_install=yes
- fi
- done
- IFS="$ac_save_ifs"
- ;;
-esac
-else
- enable_fast_install=yes
-fi
-
-echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:1270: checking build system type" >&5
-
-build_alias=$build
-case "$build_alias" in
-NONE)
- case $nonopt in
- NONE) build_alias=$host_alias ;;
- *) build_alias=$nonopt ;;
- esac ;;
-esac
-
-build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias`
-build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
-build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
-build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
-echo "$ac_t""$build" 1>&6
-
# Check whether --with-gnu-ld or --without-gnu-ld was given.
if test "${with_gnu_ld+set}" = set; then
withval="$with_gnu_ld"
@@ -1292,10 +1001,10 @@ else
fi
ac_prog=ld
-if test "$ac_cv_prog_gcc" = yes; then
+if test "$GCC" = yes; then
# Check if gcc -print-prog-name=ld gives a path.
echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
-echo "configure:1299: checking for ld used by GCC" >&5
+echo "configure:1008: checking for ld used by GCC" >&5
case $host in
*-*-mingw*)
# gcc leaves a trailing carriage return which upsets mingw
@@ -1303,7 +1012,7 @@ echo "configure:1299: checking for ld used by GCC" >&5
*)
ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
esac
- case "$ac_prog" in
+ case $ac_prog in
# Accept absolute paths.
[\\/]* | [A-Za-z]:[\\/]*)
re_direlt='/[^/][^/]*/\.\./'
@@ -1325,12 +1034,12 @@ echo "configure:1299: checking for ld used by GCC" >&5
esac
elif test "$with_gnu_ld" = yes; then
echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
-echo "configure:1329: checking for GNU ld" >&5
+echo "configure:1038: checking for GNU ld" >&5
else
echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
-echo "configure:1332: checking for non-GNU ld" >&5
+echo "configure:1041: checking for non-GNU ld" >&5
fi
-if eval "test \"`echo '$''{'ac_cv_path_LD'+set}'`\" = set"; then
+if eval "test \"`echo '$''{'lt_cv_path_LD'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test -z "$LD"; then
@@ -1338,11 +1047,11 @@ else
for ac_dir in $PATH; do
test -z "$ac_dir" && ac_dir=.
if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
- ac_cv_path_LD="$ac_dir/$ac_prog"
+ lt_cv_path_LD="$ac_dir/$ac_prog"
# Check to see if the program is GNU ld. I'd rather use --version,
# but apparently some GNU ld's only accept -v.
# Break only if it was the GNU/non-GNU ld that we prefer.
- if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
+ if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
test "$with_gnu_ld" != no && break
else
test "$with_gnu_ld" != yes && break
@@ -1351,11 +1060,11 @@ else
done
IFS="$ac_save_ifs"
else
- ac_cv_path_LD="$LD" # Let the user override the test with a path.
+ lt_cv_path_LD="$LD" # Let the user override the test with a path.
fi
fi
-LD="$ac_cv_path_LD"
+LD="$lt_cv_path_LD"
if test -n "$LD"; then
echo "$ac_t""$LD" 1>&6
else
@@ -1363,24 +1072,24 @@ else
fi
test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
-echo "configure:1367: checking if the linker ($LD) is GNU ld" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_gnu_ld'+set}'`\" = set"; then
+echo "configure:1076: checking if the linker ($LD) is GNU ld" >&5
+if eval "test \"`echo '$''{'lt_cv_prog_gnu_ld'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# I'd rather use --version here, but apparently some GNU ld's only accept -v.
if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
- ac_cv_prog_gnu_ld=yes
+ lt_cv_prog_gnu_ld=yes
else
- ac_cv_prog_gnu_ld=no
+ lt_cv_prog_gnu_ld=no
fi
fi
-echo "$ac_t""$ac_cv_prog_gnu_ld" 1>&6
-with_gnu_ld=$ac_cv_prog_gnu_ld
+echo "$ac_t""$lt_cv_prog_gnu_ld" 1>&6
+with_gnu_ld=$lt_cv_prog_gnu_ld
echo $ac_n "checking for $LD option to reload object files""... $ac_c" 1>&6
-echo "configure:1384: checking for $LD option to reload object files" >&5
+echo "configure:1093: checking for $LD option to reload object files" >&5
if eval "test \"`echo '$''{'lt_cv_ld_reload_flag'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1392,13 +1101,13 @@ reload_flag=$lt_cv_ld_reload_flag
test -n "$reload_flag" && reload_flag=" $reload_flag"
echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
-echo "configure:1396: checking for BSD-compatible nm" >&5
-if eval "test \"`echo '$''{'ac_cv_path_NM'+set}'`\" = set"; then
+echo "configure:1105: checking for BSD-compatible nm" >&5
+if eval "test \"`echo '$''{'lt_cv_path_NM'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test -n "$NM"; then
# Let the user override the test.
- ac_cv_path_NM="$NM"
+ lt_cv_path_NM="$NM"
else
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
@@ -1410,27 +1119,27 @@ else
# nm: unknown option "B" ignored
# Tru64's nm complains that /dev/null is an invalid object file
if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then
- ac_cv_path_NM="$tmp_nm -B"
+ lt_cv_path_NM="$tmp_nm -B"
break
elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
- ac_cv_path_NM="$tmp_nm -p"
+ lt_cv_path_NM="$tmp_nm -p"
break
else
- ac_cv_path_NM=${ac_cv_path_NM="$tmp_nm"} # keep the first match, but
+ lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
continue # so that we can try to find one that supports BSD flags
fi
fi
done
IFS="$ac_save_ifs"
- test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
+ test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
fi
fi
-NM="$ac_cv_path_NM"
+NM="$lt_cv_path_NM"
echo "$ac_t""$NM" 1>&6
echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:1434: checking whether ln -s works" >&5
+echo "configure:1143: checking whether ln -s works" >&5
if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1451,7 +1160,7 @@ else
fi
echo $ac_n "checking how to recognise dependant libraries""... $ac_c" 1>&6
-echo "configure:1455: checking how to recognise dependant libraries" >&5
+echo "configure:1164: checking how to recognise dependant libraries" >&5
if eval "test \"`echo '$''{'lt_cv_deplibs_check_method'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1469,8 +1178,8 @@ lt_cv_deplibs_check_method='unknown'
# If you have `file' or equivalent on your system and you're not sure
# whether `pass_all' will *always* work, you probably want this one.
-case "$host_os" in
-aix4*)
+case $host_os in
+aix*)
lt_cv_deplibs_check_method=pass_all
;;
@@ -1479,8 +1188,8 @@ beos*)
;;
bsdi4*)
- lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
- lt_cv_file_magic_cmd='/usr/bin/file -L'
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
+ lt_cv_file_magic_cmd='/usr/bin/file -L'
lt_cv_file_magic_test_file=/shlib/libc.so
;;
@@ -1489,14 +1198,27 @@ cygwin* | mingw* |pw32*)
lt_cv_file_magic_cmd='$OBJDUMP -f'
;;
+darwin* | rhapsody*)
+ lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library'
+ lt_cv_file_magic_cmd='/usr/bin/file -L'
+ case "$host_os" in
+ rhapsody* | darwin1.012)
+ lt_cv_file_magic_test_file='/System/Library/Frameworks/System.framework/System'
+ ;;
+ *) # Darwin 1.3 on
+ lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib'
+ ;;
+ esac
+ ;;
+
freebsd* )
if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
- case "$host_cpu" in
+ case $host_cpu in
i*86 )
# Not sure whether the presence of OpenBSD here was a mistake.
# Let's accept both of them until this is cleared up.
- lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library'
- lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library'
+ lt_cv_file_magic_cmd=/usr/bin/file
lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
;;
esac
@@ -1509,29 +1231,28 @@ gnu*)
lt_cv_deplibs_check_method=pass_all
;;
-hpux10.20*)
- # TODO: Does this work for hpux-11 too?
- lt_cv_deplibs_check_method='file_magic (s0-90-90-9|PA-RISC0-9.0-9) shared library'
+hpux10.20*|hpux11*)
+ lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library'
lt_cv_file_magic_cmd=/usr/bin/file
lt_cv_file_magic_test_file=/usr/lib/libc.sl
;;
irix5* | irix6*)
- case "$host_os" in
+ case $host_os in
irix5*)
# this will be overridden with pass_all, but let us keep it just in case
lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1"
;;
*)
- case "$LD" in
+ case $LD in
*-32|*"-32 ") libmagic=32-bit;;
*-n32|*"-n32 ") libmagic=N32;;
*-64|*"-64 ") libmagic=64-bit;;
*) libmagic=never-match;;
esac
# this will be overridden with pass_all, but let us keep it just in case
- lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1"
- ;;
+ lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1"
+ ;;
esac
lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*`
lt_cv_deplibs_check_method=pass_all
@@ -1539,25 +1260,30 @@ irix5* | irix6*)
# This must be Linux ELF.
linux-gnu*)
- case "$host_cpu" in
- alpha* | i*86 | powerpc* | sparc* | ia64* )
+ case $host_cpu in
+ alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* )
lt_cv_deplibs_check_method=pass_all ;;
*)
# glibc up to 2.1.1 does not perform some relocations on ARM
- lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;;
- esac
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;;
+ esac
lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
;;
netbsd*)
- if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then :
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
else
- lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object'
- lt_cv_file_magic_cmd='/usr/bin/file -L'
- lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so$'
fi
;;
+newsos6)
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=/usr/lib/libnls.so
+ ;;
+
osf3* | osf4* | osf5*)
# this will be overridden with pass_all, but let us keep it just in case
lt_cv_deplibs_check_method='file_magic COFF format alpha shared library'
@@ -1574,14 +1300,18 @@ solaris*)
lt_cv_file_magic_test_file=/lib/libc.so
;;
+sysv5uw[78]* | sysv4*uw2*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
- case "$host_vendor" in
+ case $host_vendor in
ncr)
lt_cv_deplibs_check_method=pass_all
;;
motorola)
- lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
- lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
;;
esac
;;
@@ -1594,13 +1324,13 @@ file_magic_cmd=$lt_cv_file_magic_cmd
deplibs_check_method=$lt_cv_deplibs_check_method
echo $ac_n "checking for object suffix""... $ac_c" 1>&6
-echo "configure:1598: checking for object suffix" >&5
+echo "configure:1328: checking for object suffix" >&5
if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
rm -f conftest*
echo 'int i = 1;' > conftest.$ac_ext
-if { (eval echo configure:1604: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1334: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
for ac_file in conftest.*; do
case $ac_file in
*.c) ;;
@@ -1617,6 +1347,39 @@ echo "$ac_t""$ac_cv_objext" 1>&6
OBJEXT=$ac_cv_objext
ac_objext=$ac_cv_objext
+
+
+echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
+echo "configure:1354: checking for executable suffix" >&5
+if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test "$CYGWIN" = yes || test "$MINGW32" = yes; then
+ ac_cv_exeext=.exe
+else
+ rm -f conftest*
+ echo 'int main () { return 0; }' > conftest.$ac_ext
+ ac_cv_exeext=
+ if { (eval echo configure:1364: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+ for file in conftest.*; do
+ case $file in
+ *.c | *.o | *.obj) ;;
+ *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
+ esac
+ done
+ else
+ { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
+ fi
+ rm -f conftest*
+ test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
+fi
+fi
+
+EXEEXT=""
+test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
+echo "$ac_t""${ac_cv_exeext}" 1>&6
+ac_exeext=$EXEEXT
+
if test $host != $build; then
ac_tool_prefix=${host_alias}-
else
@@ -1626,15 +1389,15 @@ fi
# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
# Only perform the check for file, if the check method requires it
-case "$deplibs_check_method" in
+case $deplibs_check_method in
file_magic*)
if test "$file_magic_cmd" = '$MAGIC_CMD'; then
echo $ac_n "checking for ${ac_tool_prefix}file""... $ac_c" 1>&6
-echo "configure:1634: checking for ${ac_tool_prefix}file" >&5
+echo "configure:1397: checking for ${ac_tool_prefix}file" >&5
if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
- case "$MAGIC_CMD" in
+ case $MAGIC_CMD in
/*)
lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
;;
@@ -1650,7 +1413,7 @@ else
if test -f $ac_dir/${ac_tool_prefix}file; then
lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file"
if test -n "$file_magic_test_file"; then
- case "$deplibs_check_method" in
+ case $deplibs_check_method in
"file_magic "*)
file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
@@ -1692,11 +1455,11 @@ fi
if test -z "$lt_cv_path_MAGIC_CMD"; then
if test -n "$ac_tool_prefix"; then
echo $ac_n "checking for file""... $ac_c" 1>&6
-echo "configure:1696: checking for file" >&5
+echo "configure:1459: checking for file" >&5
if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
- case "$MAGIC_CMD" in
+ case $MAGIC_CMD in
/*)
lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
;;
@@ -1712,7 +1475,7 @@ else
if test -f $ac_dir/file; then
lt_cv_path_MAGIC_CMD="$ac_dir/file"
if test -n "$file_magic_test_file"; then
- case "$deplibs_check_method" in
+ case $deplibs_check_method in
"file_magic "*)
file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
@@ -1763,7 +1526,7 @@ esac
# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
set dummy ${ac_tool_prefix}ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1767: checking for $ac_word" >&5
+echo "configure:1530: 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
@@ -1795,7 +1558,7 @@ if test -n "$ac_tool_prefix"; 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:1799: checking for $ac_word" >&5
+echo "configure:1562: 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
@@ -1830,7 +1593,7 @@ fi
# Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
set dummy ${ac_tool_prefix}strip; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1834: checking for $ac_word" >&5
+echo "configure:1597: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1862,7 +1625,7 @@ if test -n "$ac_tool_prefix"; then
# Extract the first word of "strip", so it can be a program name with args.
set dummy strip; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1866: checking for $ac_word" >&5
+echo "configure:1629: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1900,8 +1663,8 @@ libtool_flags="--cache-file=$cache_file"
test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
-test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
-test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
+test "$GCC" = yes && libtool_flags="$libtool_flags --with-gcc"
+test "$lt_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
# Check whether --enable-libtool-lock or --disable-libtool-lock was given.
@@ -1926,12 +1689,12 @@ test x"$pic_mode" = xno && libtool_flags="$libtool_flags --prefer-non-pic"
# Some flags need to be propagated to the compiler or linker for good
# libtool support.
-case "$host" in
+case $host in
*-*-irix6*)
# Find out which ABI we are using.
- echo '#line 1933 "configure"' > conftest.$ac_ext
- if { (eval echo configure:1934: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- case "`/usr/bin/file conftest.o`" in
+ echo '#line 1696 "configure"' > conftest.$ac_ext
+ if { (eval echo configure:1697: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ case `/usr/bin/file conftest.$ac_objext` in
*32-bit*)
LD="${LD-ld} -32"
;;
@@ -1951,7 +1714,7 @@ case "$host" in
SAVE_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -belf"
echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6
-echo "configure:1955: checking whether the C compiler needs -belf" >&5
+echo "configure:1718: checking whether the C compiler needs -belf" >&5
if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1964,14 +1727,14 @@ ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$a
cross_compiling=$ac_cv_prog_cc_cross
cat > conftest.$ac_ext <<EOF
-#line 1968 "configure"
+#line 1731 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
-if { (eval echo configure:1975: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1738: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
lt_cv_cc_needs_belf=yes
else
@@ -2081,6 +1844,517 @@ LIBTOOL='$(SHELL) $(top_builddir)/libtool'
# clobbered by the next message.
exec 5>>./config.log
+
+
+
+
+
+
+# Find a good install program. We prefer a C program (faster),
+# so one script is as good as another. But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# 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:1866: 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
+else
+ IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":"
+ for ac_dir in $PATH; do
+ # Account for people who put trailing slashes in PATH elements.
+ case "$ac_dir/" in
+ /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
+ *)
+ # OSF1 and SCO ODT 3.0 have their own names for install.
+ # Don't use installbsd from OSF since it installs stuff as root
+ # by default.
+ for ac_prog in ginstall scoinst install; do
+ if test -f $ac_dir/$ac_prog; then
+ if test $ac_prog = install &&
+ grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
+ # AIX install. It has an incompatible calling convention.
+ :
+ else
+ ac_cv_path_install="$ac_dir/$ac_prog -c"
+ break 2
+ fi
+ fi
+ done
+ ;;
+ esac
+ done
+ IFS="$ac_save_IFS"
+
+fi
+ if test "${ac_cv_path_install+set}" = set; then
+ INSTALL="$ac_cv_path_install"
+ else
+ # As a last resort, use the slow shell script. We don't cache a
+ # path for INSTALL within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the path is relative.
+ INSTALL="$ac_install_sh"
+ fi
+fi
+echo "$ac_t""$INSTALL" 1>&6
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
+echo "configure:1919: checking whether build environment is sane" >&5
+# Just in case
+sleep 1
+echo timestamp > conftestfile
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments. Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+ set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
+ if test "$*" = "X"; then
+ # -L didn't work.
+ set X `ls -t $srcdir/configure conftestfile`
+ fi
+ if test "$*" != "X $srcdir/configure conftestfile" \
+ && test "$*" != "X conftestfile $srcdir/configure"; then
+
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ { echo "configure: error: ls -t appears to fail. Make sure there is not a broken
+alias in your environment" 1>&2; exit 1; }
+ fi
+
+ test "$2" = conftestfile
+ )
+then
+ # Ok.
+ :
+else
+ { echo "configure: error: newly created file is older than distributed files!
+Check your system clock" 1>&2; exit 1; }
+fi
+rm -f conftest*
+echo "$ac_t""yes" 1>&6
+if test "$program_transform_name" = s,x,x,; then
+ program_transform_name=
+else
+ # Double any \ or $. echo might interpret backslashes.
+ cat <<\EOF_SED > conftestsed
+s,\\,\\\\,g; s,\$,$$,g
+EOF_SED
+ program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
+ rm -f conftestsed
+fi
+test "$program_prefix" != NONE &&
+ program_transform_name="s,^,${program_prefix},; $program_transform_name"
+# Use a double $ so make ignores it.
+test "$program_suffix" != NONE &&
+ program_transform_name="s,\$\$,${program_suffix},; $program_transform_name"
+
+# sed with no file args requires a program.
+test "$program_transform_name" = "" && program_transform_name="s,x,x,"
+
+echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
+echo "configure:1976: 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
+else
+ cat > conftestmake <<\EOF
+all:
+ @echo 'ac_maketemp="${MAKE}"'
+EOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
+if test -n "$ac_maketemp"; then
+ eval ac_cv_prog_make_${ac_make}_set=yes
+else
+ eval ac_cv_prog_make_${ac_make}_set=no
+fi
+rm -f conftestmake
+fi
+if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ SET_MAKE=
+else
+ echo "$ac_t""no" 1>&6
+ SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+
+PACKAGE=libffi
+
+VERSION=2.00-beta
+
+if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
+ { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
+fi
+
+
+
+missing_dir=`cd $ac_aux_dir && pwd`
+echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
+echo "configure:2015: checking for working aclocal" >&5
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf. Sigh.
+if (aclocal --version) < /dev/null > /dev/null 2>&1; then
+ ACLOCAL=aclocal
+ echo "$ac_t""found" 1>&6
+else
+ ACLOCAL="$missing_dir/missing aclocal"
+ echo "$ac_t""missing" 1>&6
+fi
+
+echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
+echo "configure:2028: checking for working autoconf" >&5
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf. Sigh.
+if (autoconf --version) < /dev/null > /dev/null 2>&1; then
+ AUTOCONF=autoconf
+ echo "$ac_t""found" 1>&6
+else
+ AUTOCONF="$missing_dir/missing autoconf"
+ echo "$ac_t""missing" 1>&6
+fi
+
+echo $ac_n "checking for working automake""... $ac_c" 1>&6
+echo "configure:2041: checking for working automake" >&5
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf. Sigh.
+if (automake --version) < /dev/null > /dev/null 2>&1; then
+ AUTOMAKE=automake
+ echo "$ac_t""found" 1>&6
+else
+ AUTOMAKE="$missing_dir/missing automake"
+ echo "$ac_t""missing" 1>&6
+fi
+
+echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
+echo "configure:2054: checking for working autoheader" >&5
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf. Sigh.
+if (autoheader --version) < /dev/null > /dev/null 2>&1; then
+ AUTOHEADER=autoheader
+ echo "$ac_t""found" 1>&6
+else
+ AUTOHEADER="$missing_dir/missing autoheader"
+ echo "$ac_t""missing" 1>&6
+fi
+
+echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
+echo "configure:2067: checking for working makeinfo" >&5
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf. Sigh.
+if (makeinfo --version) < /dev/null > /dev/null 2>&1; then
+ MAKEINFO=makeinfo
+ echo "$ac_t""found" 1>&6
+else
+ MAKEINFO="$missing_dir/missing makeinfo"
+ echo "$ac_t""missing" 1>&6
+fi
+
+
+
+
+
+echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
+echo "configure:2084: checking for executable suffix" >&5
+if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test "$CYGWIN" = yes || test "$MINGW32" = yes; then
+ ac_cv_exeext=.exe
+else
+ rm -f conftest*
+ echo 'int main () { return 0; }' > conftest.$ac_ext
+ ac_cv_exeext=
+ if { (eval echo configure:2094: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+ for file in conftest.*; do
+ case $file in
+ *.c | *.o | *.obj) ;;
+ *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
+ esac
+ done
+ else
+ { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
+ fi
+ rm -f conftest*
+ test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
+fi
+fi
+
+EXEEXT=""
+test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
+echo "$ac_t""${ac_cv_exeext}" 1>&6
+ac_exeext=$EXEEXT
+
+echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
+echo "configure:2115: 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"
+ USE_MAINTAINER_MODE=$enableval
+else
+ USE_MAINTAINER_MODE=no
+fi
+
+ echo "$ac_t""$USE_MAINTAINER_MODE" 1>&6
+
+
+if test $USE_MAINTAINER_MODE = yes; then
+ MAINTAINER_MODE_TRUE=
+ MAINTAINER_MODE_FALSE='#'
+else
+ MAINTAINER_MODE_TRUE='#'
+ MAINTAINER_MODE_FALSE=
+fi
+ MAINT=$MAINTAINER_MODE_TRUE
+
+
+
+# Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:2141: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_prog_CC="gcc"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+ echo "$ac_t""$CC" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+if test -z "$CC"; then
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:2171: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_prog_rejected=no
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
+ ac_prog_rejected=yes
+ continue
+ fi
+ ac_cv_prog_CC="cc"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+if test $ac_prog_rejected = yes; then
+ # We found a bogon in the path, so make sure we never use it.
+ set dummy $ac_cv_prog_CC
+ shift
+ if test $# -gt 0; then
+ # We chose a different compiler from the bogus one.
+ # However, it has the same basename, so the bogon will be chosen
+ # first if we set CC to just the basename; use the full file name.
+ shift
+ set dummy "$ac_dir/$ac_word" "$@"
+ shift
+ ac_cv_prog_CC="$@"
+ fi
+fi
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+ echo "$ac_t""$CC" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ if test -z "$CC"; then
+ case "`uname -s`" in
+ *win32* | *WIN32*)
+ # Extract the first word of "cl", so it can be a program name with args.
+set dummy cl; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:2222: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_prog_CC="cl"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+ echo "$ac_t""$CC" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+ ;;
+ esac
+ fi
+ test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
+fi
+
+echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
+echo "configure:2254: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+cat > conftest.$ac_ext << EOF
+
+#line 2265 "configure"
+#include "confdefs.h"
+
+main(){return(0);}
+EOF
+if { (eval echo configure:2270: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ ac_cv_prog_cc_works=yes
+ # If we can't run a trivial program, we are probably using a cross compiler.
+ if (./conftest; exit) 2>/dev/null; then
+ ac_cv_prog_cc_cross=no
+ else
+ ac_cv_prog_cc_cross=yes
+ fi
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ ac_cv_prog_cc_works=no
+fi
+rm -fr conftest*
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
+if test $ac_cv_prog_cc_works = no; then
+ { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
+fi
+echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
+echo "configure:2296: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
+cross_compiling=$ac_cv_prog_cc_cross
+
+echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
+echo "configure:2301: checking whether we are using GNU C" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.c <<EOF
+#ifdef __GNUC__
+ yes;
+#endif
+EOF
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2310: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+ ac_cv_prog_gcc=yes
+else
+ ac_cv_prog_gcc=no
+fi
+fi
+
+echo "$ac_t""$ac_cv_prog_gcc" 1>&6
+
+if test $ac_cv_prog_gcc = yes; then
+ GCC=yes
+else
+ GCC=
+fi
+
+ac_test_CFLAGS="${CFLAGS+set}"
+ac_save_CFLAGS="$CFLAGS"
+CFLAGS=
+echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
+echo "configure:2329: checking whether ${CC-cc} accepts -g" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ echo 'void f(){}' > conftest.c
+if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
+ ac_cv_prog_cc_g=yes
+else
+ ac_cv_prog_cc_g=no
+fi
+rm -f conftest*
+
+fi
+
+echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
+if test "$ac_test_CFLAGS" = set; then
+ CFLAGS="$ac_save_CFLAGS"
+elif test $ac_cv_prog_cc_g = yes; then
+ if test "$GCC" = yes; then
+ CFLAGS="-g -O2"
+ else
+ CFLAGS="-g"
+ fi
+else
+ if test "$GCC" = yes; then
+ CFLAGS="-O2"
+ else
+ CFLAGS=
+ fi
+fi
@@ -2095,8 +2369,11 @@ i*86-*-linux*) TARGET=X86; TARGETDIR=x86;;
i*86-*-solaris*) TARGET=X86; TARGETDIR=x86;;
i*86-*-beos*) TARGET=X86; TARGETDIR=x86;;
i*86-*-freebsd*) TARGET=X86; TARGETDIR=x86;;
+i*86-*-win32*) TARGET=X86_WIN32; TARGETDIR=x86;;
+i*86-*-cygwin*) TARGET=X86_WIN32; TARGETDIR=x86;;
+i*86-*-mingw*) TARGET=X86_WIN32; TARGETDIR=x86;;
sparc-sun-4*) TARGET=SPARC; TARGETDIR=sparc;;
-sparc-sun-*) TARGET=SPARC; TARGETDIR=sparc;;
+sparc*-sun-*) TARGET=SPARC; TARGETDIR=sparc;;
sparc-*-linux*) TARGET=SPARC; TARGETDIR=sparc;;
sparc64-*-linux*) TARGET=SPARC; TARGETDIR=sparc;;
alpha*-*-linux* | alpha*-*-osf*) TARGET=ALPHA; TARGETDIR=alpha;;
@@ -2149,6 +2426,15 @@ else
fi
+if test x$TARGET = xX86_WIN32; then
+ X86_WIN32_TRUE=
+ X86_WIN32_FALSE='#'
+else
+ X86_WIN32_TRUE='#'
+ X86_WIN32_FALSE=
+fi
+
+
if test x$TARGET = xALPHA; then
ALPHA_TRUE=
ALPHA_FALSE='#'
@@ -2194,7 +2480,7 @@ else
fi
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:2198: checking how to run the C preprocessor" >&5
+echo "configure:2484: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
@@ -2209,13 +2495,13 @@ else
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp.
cat > conftest.$ac_ext <<EOF
-#line 2213 "configure"
+#line 2499 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2219: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2505: \"$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
:
@@ -2226,13 +2512,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
-#line 2230 "configure"
+#line 2516 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2236: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2522: \"$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
:
@@ -2243,13 +2529,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -nologo -E"
cat > conftest.$ac_ext <<EOF
-#line 2247 "configure"
+#line 2533 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2253: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2539: \"$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
:
@@ -2274,12 +2560,12 @@ fi
echo "$ac_t""$CPP" 1>&6
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:2278: checking for ANSI C header files" >&5
+echo "configure:2564: 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 2283 "configure"
+#line 2569 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
@@ -2287,7 +2573,7 @@ else
#include <float.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2291: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2577: \"$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*
@@ -2304,7 +2590,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 2308 "configure"
+#line 2594 "configure"
#include "confdefs.h"
#include <string.h>
EOF
@@ -2322,7 +2608,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 2326 "configure"
+#line 2612 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
@@ -2343,7 +2629,7 @@ if test "$cross_compiling" = yes; then
:
else
cat > conftest.$ac_ext <<EOF
-#line 2347 "configure"
+#line 2633 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -2354,7 +2640,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); }
EOF
-if { (eval echo configure:2358: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2644: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
:
else
@@ -2380,12 +2666,12 @@ fi
for ac_func in memcpy
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2384: checking for $ac_func" >&5
+echo "configure:2670: 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 2389 "configure"
+#line 2675 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -2408,7 +2694,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:2412: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2698: \"$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
@@ -2435,19 +2721,19 @@ done
# 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:2439: checking for working alloca.h" >&5
+echo "configure:2725: 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 2444 "configure"
+#line 2730 "configure"
#include "confdefs.h"
#include <alloca.h>
int main() {
char *p = alloca(2 * sizeof(int));
; return 0; }
EOF
-if { (eval echo configure:2451: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2737: \"$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
@@ -2468,12 +2754,12 @@ EOF
fi
echo $ac_n "checking for alloca""... $ac_c" 1>&6
-echo "configure:2472: checking for alloca" >&5
+echo "configure:2758: 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 2477 "configure"
+#line 2763 "configure"
#include "confdefs.h"
#ifdef __GNUC__
@@ -2501,7 +2787,7 @@ int main() {
char *p = (char *) alloca(1);
; return 0; }
EOF
-if { (eval echo configure:2505: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2791: \"$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
@@ -2533,12 +2819,12 @@ EOF
echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-echo "configure:2537: checking whether alloca needs Cray hooks" >&5
+echo "configure:2823: 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 2542 "configure"
+#line 2828 "configure"
#include "confdefs.h"
#if defined(CRAY) && ! defined(CRAY2)
webecray
@@ -2563,12 +2849,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:2567: checking for $ac_func" >&5
+echo "configure:2853: 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 2572 "configure"
+#line 2858 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -2591,7 +2877,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:2595: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2881: \"$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
@@ -2618,7 +2904,7 @@ done
fi
echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-echo "configure:2622: checking stack direction for C alloca" >&5
+echo "configure:2908: 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
@@ -2626,7 +2912,7 @@ else
ac_cv_c_stack_direction=0
else
cat > conftest.$ac_ext <<EOF
-#line 2630 "configure"
+#line 2916 "configure"
#include "confdefs.h"
find_stack_direction ()
{
@@ -2645,7 +2931,7 @@ main ()
exit (find_stack_direction() < 0);
}
EOF
-if { (eval echo configure:2649: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2935: \"$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
@@ -2668,7 +2954,7 @@ fi
echo $ac_n "checking size of short""... $ac_c" 1>&6
-echo "configure:2672: checking size of short" >&5
+echo "configure:2958: 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
@@ -2676,7 +2962,7 @@ else
{ echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
-#line 2680 "configure"
+#line 2966 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
@@ -2687,7 +2973,7 @@ main()
exit(0);
}
EOF
-if { (eval echo configure:2691: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2977: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_sizeof_short=`cat conftestval`
else
@@ -2707,7 +2993,7 @@ EOF
echo $ac_n "checking size of int""... $ac_c" 1>&6
-echo "configure:2711: checking size of int" >&5
+echo "configure:2997: 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
@@ -2715,7 +3001,7 @@ else
{ echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
-#line 2719 "configure"
+#line 3005 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
@@ -2726,7 +3012,7 @@ main()
exit(0);
}
EOF
-if { (eval echo configure:2730: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3016: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_sizeof_int=`cat conftestval`
else
@@ -2746,7 +3032,7 @@ EOF
echo $ac_n "checking size of long""... $ac_c" 1>&6
-echo "configure:2750: checking size of long" >&5
+echo "configure:3036: 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
@@ -2754,7 +3040,7 @@ else
{ echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
-#line 2758 "configure"
+#line 3044 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
@@ -2765,7 +3051,7 @@ main()
exit(0);
}
EOF
-if { (eval echo configure:2769: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3055: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_sizeof_long=`cat conftestval`
else
@@ -2785,7 +3071,7 @@ EOF
echo $ac_n "checking size of long long""... $ac_c" 1>&6
-echo "configure:2789: checking size of long long" >&5
+echo "configure:3075: 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
@@ -2793,7 +3079,7 @@ else
{ echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
-#line 2797 "configure"
+#line 3083 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
@@ -2804,7 +3090,7 @@ main()
exit(0);
}
EOF
-if { (eval echo configure:2808: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3094: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_sizeof_long_long=`cat conftestval`
else
@@ -2824,7 +3110,7 @@ EOF
echo $ac_n "checking size of float""... $ac_c" 1>&6
-echo "configure:2828: checking size of float" >&5
+echo "configure:3114: checking size of float" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_float'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2832,7 +3118,7 @@ else
{ echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
-#line 2836 "configure"
+#line 3122 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
@@ -2843,7 +3129,7 @@ main()
exit(0);
}
EOF
-if { (eval echo configure:2847: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3133: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_sizeof_float=`cat conftestval`
else
@@ -2863,7 +3149,7 @@ EOF
echo $ac_n "checking size of double""... $ac_c" 1>&6
-echo "configure:2867: checking size of double" >&5
+echo "configure:3153: checking size of double" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_double'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2871,7 +3157,7 @@ else
{ echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
-#line 2875 "configure"
+#line 3161 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
@@ -2882,7 +3168,7 @@ main()
exit(0);
}
EOF
-if { (eval echo configure:2886: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3172: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_sizeof_double=`cat conftestval`
else
@@ -2902,7 +3188,7 @@ EOF
echo $ac_n "checking size of long double""... $ac_c" 1>&6
-echo "configure:2906: checking size of long double" >&5
+echo "configure:3192: checking size of long double" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_long_double'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2910,7 +3196,7 @@ else
{ echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
-#line 2914 "configure"
+#line 3200 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
@@ -2921,7 +3207,7 @@ main()
exit(0);
}
EOF
-if { (eval echo configure:2925: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3211: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_sizeof_long_double=`cat conftestval`
else
@@ -2942,7 +3228,7 @@ EOF
echo $ac_n "checking size of void *""... $ac_c" 1>&6
-echo "configure:2946: checking size of void *" >&5
+echo "configure:3232: checking size of void *" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_void_p'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2950,7 +3236,7 @@ else
{ echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
-#line 2954 "configure"
+#line 3240 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
@@ -2961,7 +3247,7 @@ main()
exit(0);
}
EOF
-if { (eval echo configure:2965: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3251: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_sizeof_void_p=`cat conftestval`
else
@@ -2981,14 +3267,14 @@ EOF
echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
-echo "configure:2985: checking whether byte ordering is bigendian" >&5
+echo "configure:3271: 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 2992 "configure"
+#line 3278 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/param.h>
@@ -2999,11 +3285,11 @@ int main() {
#endif
; return 0; }
EOF
-if { (eval echo configure:3003: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3289: \"$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 3007 "configure"
+#line 3293 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/param.h>
@@ -3014,7 +3300,7 @@ int main() {
#endif
; return 0; }
EOF
-if { (eval echo configure:3018: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3304: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_bigendian=yes
else
@@ -3034,7 +3320,7 @@ if test "$cross_compiling" = yes; then
{ echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
-#line 3038 "configure"
+#line 3324 "configure"
#include "confdefs.h"
main () {
/* Are we little or big endian? From Harbison&Steele. */
@@ -3047,7 +3333,7 @@ main () {
exit (u.c[sizeof (long) - 1] == 1);
}
EOF
-if { (eval echo configure:3051: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3337: \"$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
@@ -3271,6 +3557,18 @@ s%@host_alias@%$host_alias%g
s%@host_cpu@%$host_cpu%g
s%@host_vendor@%$host_vendor%g
s%@host_os@%$host_os%g
+s%@build@%$build%g
+s%@build_alias@%$build_alias%g
+s%@build_cpu@%$build_cpu%g
+s%@build_vendor@%$build_vendor%g
+s%@build_os@%$build_os%g
+s%@CC@%$CC%g
+s%@LN_S@%$LN_S%g
+s%@OBJEXT@%$OBJEXT%g
+s%@EXEEXT@%$EXEEXT%g
+s%@RANLIB@%$RANLIB%g
+s%@STRIP@%$STRIP%g
+s%@LIBTOOL@%$LIBTOOL%g
s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
s%@INSTALL_DATA@%$INSTALL_DATA%g
@@ -3282,21 +3580,9 @@ s%@AUTOMAKE@%$AUTOMAKE%g
s%@AUTOHEADER@%$AUTOHEADER%g
s%@MAKEINFO@%$MAKEINFO%g
s%@SET_MAKE@%$SET_MAKE%g
-s%@EXEEXT@%$EXEEXT%g
s%@MAINTAINER_MODE_TRUE@%$MAINTAINER_MODE_TRUE%g
s%@MAINTAINER_MODE_FALSE@%$MAINTAINER_MODE_FALSE%g
s%@MAINT@%$MAINT%g
-s%@CC@%$CC%g
-s%@build@%$build%g
-s%@build_alias@%$build_alias%g
-s%@build_cpu@%$build_cpu%g
-s%@build_vendor@%$build_vendor%g
-s%@build_os@%$build_os%g
-s%@LN_S@%$LN_S%g
-s%@OBJEXT@%$OBJEXT%g
-s%@RANLIB@%$RANLIB%g
-s%@STRIP@%$STRIP%g
-s%@LIBTOOL@%$LIBTOOL%g
s%@MIPS_GCC_TRUE@%$MIPS_GCC_TRUE%g
s%@MIPS_GCC_FALSE@%$MIPS_GCC_FALSE%g
s%@MIPS_SGI_TRUE@%$MIPS_SGI_TRUE%g
@@ -3305,6 +3591,8 @@ s%@SPARC_TRUE@%$SPARC_TRUE%g
s%@SPARC_FALSE@%$SPARC_FALSE%g
s%@X86_TRUE@%$X86_TRUE%g
s%@X86_FALSE@%$X86_FALSE%g
+s%@X86_WIN32_TRUE@%$X86_WIN32_TRUE%g
+s%@X86_WIN32_FALSE@%$X86_WIN32_FALSE%g
s%@ALPHA_TRUE@%$ALPHA_TRUE%g
s%@ALPHA_FALSE@%$ALPHA_FALSE%g
s%@IA64_TRUE@%$IA64_TRUE%g
@@ -3563,3 +3851,7 @@ chmod +x $CONFIG_STATUS
rm -fr confdefs* $ac_clean_files
test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
+
+# Make target subdirectories if required.
+test -d src || mkdir src
+test -d src/${TARGETDIR} || mkdir src/${TARGETDIR}
diff --git a/libffi/configure.in b/libffi/configure.in
index d26887b85f6..c8510905b57 100644
--- a/libffi/configure.in
+++ b/libffi/configure.in
@@ -2,13 +2,6 @@ dnl Process this with autoconf to create configure
AC_INIT(fficonfig.h.in)
AM_CONFIG_HEADER(fficonfig.h)
-AC_MSG_WARN(***********************************************************)
-AC_MSG_WARN(***********************************************************)
-AC_MSG_WARN(This is beta code. If you're looking for a stable release)
-AC_MSG_WARN(then use the most recent one - libffi-1.20.)
-AC_MSG_WARN(***********************************************************)
-AC_MSG_WARN(***********************************************************)
-
dnl Default to --enable-multilib
AC_ARG_ENABLE(multilib,
[ --enable-multilib build many library versions (default)],
@@ -34,6 +27,8 @@ AC_SUBST(libffi_basedir)
AC_CANONICAL_HOST
+AM_PROG_LIBTOOL
+
AM_INIT_AUTOMAKE(libffi,2.00-beta,no-define)
AC_EXEEXT
@@ -49,8 +44,11 @@ i*86-*-linux*) TARGET=X86; TARGETDIR=x86;;
i*86-*-solaris*) TARGET=X86; TARGETDIR=x86;;
i*86-*-beos*) TARGET=X86; TARGETDIR=x86;;
i*86-*-freebsd*) TARGET=X86; TARGETDIR=x86;;
+i*86-*-win32*) TARGET=X86_WIN32; TARGETDIR=x86;;
+i*86-*-cygwin*) TARGET=X86_WIN32; TARGETDIR=x86;;
+i*86-*-mingw*) TARGET=X86_WIN32; TARGETDIR=x86;;
sparc-sun-4*) TARGET=SPARC; TARGETDIR=sparc;;
-sparc-sun-*) TARGET=SPARC; TARGETDIR=sparc;;
+sparc*-sun-*) TARGET=SPARC; TARGETDIR=sparc;;
sparc-*-linux*) TARGET=SPARC; TARGETDIR=sparc;;
sparc64-*-linux*) TARGET=SPARC; TARGETDIR=sparc;;
alpha*-*-linux* | alpha*-*-osf*) TARGET=ALPHA; TARGETDIR=alpha;;
@@ -69,6 +67,7 @@ AM_CONDITIONAL(MIPS_GCC, test ${TARGET}${ac_cv_prog_gcc} = MIPSyes)
AM_CONDITIONAL(MIPS_SGI, test ${TARGET}${ac_cv_prog_gcc} = MIPSno)
AM_CONDITIONAL(SPARC, test x$TARGET = xSPARC)
AM_CONDITIONAL(X86, test x$TARGET = xX86)
+AM_CONDITIONAL(X86_WIN32, test x$TARGET = xX86_WIN32)
AM_CONDITIONAL(ALPHA, test x$TARGET = xALPHA)
AM_CONDITIONAL(IA64, test x$TARGET = xIA64)
AM_CONDITIONAL(M68K, test x$TARGET = xM68K)
@@ -137,3 +136,7 @@ else
cp fficonfig.h include/fficonfig.h
fi
)
+
+# Make target subdirectories if required.
+test -d src || mkdir src
+test -d src/${TARGETDIR} || mkdir src/${TARGETDIR}
diff --git a/libffi/include/ffi.h.in b/libffi/include/ffi.h.in
index 830026a4a85..7f373e64a40 100644
--- a/libffi/include/ffi.h.in
+++ b/libffi/include/ffi.h.in
@@ -1,7 +1,7 @@
/* -----------------------------------------------------------------*-C-*-
libffi @VERSION@ - Copyright (c) 1996-1999 Cygnus Solutions
- $Id: ffi.h.in,v 1.6 2000/12/08 19:41:15 green Exp $
+ $Id: ffi.h.in,v 1.7.2.1 2001/03/24 03:10:30 tromey Exp $
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
@@ -197,6 +197,12 @@ typedef enum ffi_abi {
FFI_DEFAULT_ABI = FFI_SYSV,
#endif
+ /* ---- Intel x86 Win32 ---------- */
+#ifdef X86_WIN32
+ FFI_SYSV,
+ FFI_DEFAULT_ABI = FFI_SYSV,
+#endif
+
/* ---- Intel ia64 ---------------- */
#ifdef IA64
FFI_UNIX, /* Linux and all Unix variants use the same conventions */
@@ -353,6 +359,12 @@ size_t ffi_java_raw_size (ffi_cif *cif);
#define FFI_TRAMPOLINE_SIZE 10
#define FFI_NATIVE_RAW_API 1 /* and has native raw api support */
+#elif defined(X86_WIN32)
+
+#define FFI_CLOSURES 1 /* x86 supports closures */
+#define FFI_TRAMPOLINE_SIZE 10
+#define FFI_NATIVE_RAW_API 1 /* and has native raw api support */
+
#elif defined(IA64)
#define FFI_CLOSURES 1
@@ -374,6 +386,12 @@ struct ffi_ia64_trampoline_struct {
#define FFI_TRAMPOLINE_SIZE 24
#define FFI_NATIVE_RAW_API 0
+#elif defined(POWERPC)
+
+#define FFI_CLOSURES 1
+#define FFI_TRAMPOLINE_SIZE 40
+#define FFI_NATIVE_RAW_API 0
+
#else
#define FFI_CLOSURES 0
diff --git a/libffi/src/alpha/ffi.c b/libffi/src/alpha/ffi.c
index 29292e6abe6..ed6cc9511d3 100644
--- a/libffi/src/alpha/ffi.c
+++ b/libffi/src/alpha/ffi.c
@@ -1,5 +1,5 @@
/* -----------------------------------------------------------------------
- ffi.c - Copyright (c) 1998 Cygnus Solutions
+ ffi.c - Copyright (c) 1998, 2001 Cygnus Solutions
Alpha Foreign Function Interface
@@ -168,8 +168,13 @@ ffi_prep_closure (ffi_closure* closure,
closure->fun = fun;
closure->user_data = user_data;
- /* Flush the Icache. */
- asm volatile ("imb" : : : "memory");
+ /* Flush the Icache.
+
+ Tru64 UNIX as doesn't understand the imb mnemonic, so use call_pal
+ instead, since both Compaq as and gas can handle it.
+
+ 0x86 is PAL_imb in Tru64 UNIX <alpha/pal.h>. */
+ asm volatile ("call_pal 0x86" : : : "memory");
return FFI_OK;
}
diff --git a/libffi/src/alpha/osf.S b/libffi/src/alpha/osf.S
index fce089ac05d..75beab8996c 100644
--- a/libffi/src/alpha/osf.S
+++ b/libffi/src/alpha/osf.S
@@ -1,5 +1,5 @@
/* -----------------------------------------------------------------------
- osf.S - Copyright (c) 1998 Cygnus Solutions
+ osf.S - Copyright (c) 1998, 2001 Red Hat
Alpha/OSF Foreign Function Interface
@@ -44,12 +44,16 @@
ffi_call_osf:
.frame $15, 32, $26, 0
.mask 0x4008000, -32
+$LFB1:
addq $16,$17,$1
mov $16, $30
stq $26, 0($1)
+$LCFI0:
stq $15, 8($1)
+$LCFI1:
stq $18, 16($1)
mov $1, $15
+$LCFI2:
.prologue 0
stq $19, 24($1)
@@ -110,6 +114,7 @@ $retdouble:
nop
ldq $15, 8($15)
ret
+$LFE1:
.end ffi_call_osf
@@ -123,9 +128,12 @@ $retdouble:
ffi_closure_osf:
.frame $30, 16*8, $26, 0
.mask 0x4000000, -16*8
+$LFB2:
ldgp $29, 0($27)
subq $30, 16*8, $30
+$LCFI5:
stq $26, 0($30)
+$LCFI6:
.prologue 1
# Store all of the potential argument registers in va_list format.
@@ -239,10 +247,15 @@ $load_64:
nop
addq $30, 16*8, $30
ret
+$LFE2:
.end ffi_closure_osf
+#ifdef __ELF__
.section .rodata
+#else
+.rdata
+#endif
$load_table:
.gprel32 $load_none # FFI_TYPE_VOID
.gprel32 $load_32 # FFI_TYPE_INT
@@ -277,3 +290,65 @@ $load_table:
|| FFI_TYPE_LAST != 14
#error "osf.S out of sync with ffi.h"
#endif
+
+#ifdef __ELF__
+ .section .eh_frame,"aw",@progbits
+__FRAME_BEGIN__:
+ .4byte $LECIE1-$LSCIE1 # Length of Common Information Entry
+$LSCIE1:
+ .4byte 0x0 # CIE Identifier Tag
+ .byte 0x1 # CIE Version
+ .ascii "zR\0" # CIE Augmentation
+ .byte 0x1 # uleb128 0x1; CIE Code Alignment Factor
+ .byte 0x78 # sleb128 -8; CIE Data Alignment Factor
+ .byte 0x1a # CIE RA Column
+ .byte 0x1 # uleb128 0x1; Augmentation size
+ .byte 0x1b # FDE Encoding (pcrel sdata4)
+ .byte 0xc # DW_CFA_def_cfa
+ .byte 0x1e # uleb128 0x1e
+ .byte 0x0 # uleb128 0x0
+ .align 3
+$LECIE1:
+$LSFDE1:
+ .4byte $LEFDE1-$LASFDE1 # FDE Length
+$LASFDE1:
+ .4byte $LASFDE1-__FRAME_BEGIN__ # FDE CIE offset
+ .4byte $LFB1-. # FDE initial location
+ .4byte $LFE1-$LFB1 # FDE address range
+ .byte 0x0 # uleb128 0x0; Augmentation size
+ .byte 0x4 # DW_CFA_advance_loc4
+ .4byte $LCFI0-$LFB1
+ .byte 0xe # DW_CFA_def_cfa_offset
+ .byte 0x30 # uleb128 0x30
+ .byte 0x4 # DW_CFA_advance_loc4
+ .4byte $LCFI1-$LCFI0
+ .byte 0x9a # DW_CFA_offset, column 0x1a
+ .byte 0x6 # uleb128 0x6
+ .byte 0x8f # DW_CFA_offset, column 0xf
+ .byte 0x5 # uleb128 0x5
+ .byte 0x4 # DW_CFA_advance_loc4
+ .4byte $LCFI2-$LCFI1
+ .byte 0xc # DW_CFA_def_cfa
+ .byte 0xf # uleb128 0xf
+ .byte 0x30 # uleb128 0x30
+ .align 3
+$LEFDE1:
+
+$LSFDE3:
+ .4byte $LEFDE3-$LASFDE3 # FDE Length
+$LASFDE3:
+ .4byte $LASFDE3-__FRAME_BEGIN__ # FDE CIE offset
+ .4byte $LFB2-. # FDE initial location
+ .4byte $LFE2-$LFB2 # FDE address range
+ .byte 0x0 # uleb128 0x0; Augmentation size
+ .byte 0x4 # DW_CFA_advance_loc4
+ .4byte $LCFI5-$LFB2
+ .byte 0xe # DW_CFA_def_cfa_offset
+ .byte 0x90,0x1 # uleb128 0x90
+ .byte 0x4 # DW_CFA_advance_loc4
+ .4byte $LCFI6-$LCFI5
+ .byte 0x9a # DW_CFA_offset, column 0x1a
+ .byte 0x12 # uleb128 0x12
+ .align 3
+$LEFDE3:
+#endif
diff --git a/libffi/src/ffitest.c b/libffi/src/ffitest.c
index d4a687c6d53..7506713b49e 100644
--- a/libffi/src/ffitest.c
+++ b/libffi/src/ffitest.c
@@ -543,6 +543,8 @@ int main(/*@unused@*/ int argc, /*@unused@*/ char *argv[])
printf("%lu promotion tests run\n", ul);
}
+#ifndef X86_WIN32 /* Structures dont work on Win32 */
+
/* struct tests */
{
test_structure_1 ts1_arg;
@@ -701,6 +703,10 @@ int main(/*@unused@*/ int argc, /*@unused@*/ char *argv[])
free (ts5_result);
}
+#else
+ printf("Structure passing doesn't work on Win32.\n");
+#endif /* X86_WIN32 */
+
# if FFI_CLOSURES
/* A simple closure test */
{
diff --git a/libffi/src/ia64/unix.S b/libffi/src/ia64/unix.S
index fdaf8be28ad..c0ca516be7f 100644
--- a/libffi/src/ia64/unix.S
+++ b/libffi/src/ia64/unix.S
@@ -94,11 +94,11 @@ fp_done:
ld8 out4=[loc2],16
ld8 out5=[loc3],16
;;
- ld8 out6=[loc2],16
+ ld8 out6=[loc2]
ld8 out7=[loc3]
- /* loc2 points at first stack parameter. Set sp to 16 bytes */
- /* below that. */
- add sp=-16,loc2
+ /* Set sp to 16 bytes below the first stack parameter. This */
+ /* is the value currently in loc2. */
+ mov sp=loc2
ld8 r8=[fn],8
;;
@@ -295,6 +295,7 @@ ffi_closure_UNIX:
;;
mov b0=loc1
mov ar.pfs=loc0
+ add sp=BASIC_ARGS_SZ,sp
br.ret.sptk.many b0
.endp ffi_closure_UNIX
diff --git a/libffi/src/powerpc/ffi.c b/libffi/src/powerpc/ffi.c
index 6d12d653baa..0e8daa6d38f 100644
--- a/libffi/src/powerpc/ffi.c
+++ b/libffi/src/powerpc/ffi.c
@@ -1,423 +1,257 @@
-/* -----------------------------------------------------------------------
- ffi.c - Copyright (c) 1998 Geoffrey Keating
-
- PowerPC Foreign Function Interface
-
- $Id: ffi.c,v 1.1.1.1 1998/11/29 16:48:16 green Exp $
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR
- OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- OTHER DEALINGS IN THE SOFTWARE.
- ----------------------------------------------------------------------- */
-
-#include <ffi.h>
-#include <ffi_common.h>
-
-#include <stdlib.h>
-
-enum {
- /* The assembly depends on these exact flags. */
- FLAG_RETURNS_NOTHING = 1 << (31-30), /* These go in cr7 */
- FLAG_RETURNS_FP = 1 << (31-29),
- FLAG_RETURNS_64BITS = 1 << (31-28),
-
- FLAG_ARG_NEEDS_COPY = 1 << (31- 7),
- FLAG_FP_ARGUMENTS = 1 << (31- 6), /* cr1.eq; specified by ABI */
- FLAG_4_GPR_ARGUMENTS = 1 << (31- 5),
- FLAG_RETVAL_REFERENCE = 1 << (31- 4)
-};
-
-/* About the SYSV ABI. */
-enum {
- NUM_GPR_ARG_REGISTERS = 8,
- NUM_FPR_ARG_REGISTERS = 8
-};
-enum { ASM_NEEDS_REGISTERS = 4 };
-
-/* ffi_prep_args is called by the assembly routine once stack space
- has been allocated for the function's arguments.
-
- The stack layout we want looks like this:
-
- | Return address from ffi_call_SYSV 4bytes | higher addresses
- |--------------------------------------------|
- | Previous backchain pointer 4 | stack pointer here
- |--------------------------------------------|<+ <<< on entry to
- | Saved r28-r31 4*4 | | ffi_call_SYSV
- |--------------------------------------------| |
- | GPR registers r3-r10 8*4 | | ffi_call_SYSV
- |--------------------------------------------| |
- | FPR registers f1-f8 (optional) 8*8 | |
- |--------------------------------------------| | stack |
- | Space for copied structures | | grows |
- |--------------------------------------------| | down V
- | Parameters that didn't fit in registers | |
- |--------------------------------------------| | lower addresses
- | Space for callee's LR 4 | |
- |--------------------------------------------| | stack pointer here
- | Current backchain pointer 4 |-/ during
- |--------------------------------------------| <<< ffi_call_SYSV
-
- */
-
-/*@-exportheader@*/
-void ffi_prep_args(extended_cif *ecif, unsigned *const stack)
-/*@=exportheader@*/
+#include <stdio.h>
+
+extern void ffi_closure_SYSV(void);
+ /* whoops: abi states only certain register pairs
+ * can be used for passing long long int
+ * specifically (r3,r4), (r5,r6), (r7,r8),
+ * (r9,r10) and if next arg is long long but
+ * not correct starting register of pair then skip
+ * until the proper starting register
+ */
+ if (intarg_count%2 != 0)
+ {
+ intarg_count ++;
+ gpr_base++;
+ }
+
+
+static void flush_icache(char *, int);
+
+ffi_status
+ffi_prep_closure (ffi_closure* closure,
+ ffi_cif* cif,
+ void (*fun)(ffi_cif*, void*, void**, void*),
+ void *user_data)
{
- const unsigned bytes = ecif->cif->bytes;
- const unsigned flags = ecif->cif->flags;
-
- /* 'stacktop' points at the previous backchain pointer. */
- unsigned *const stacktop = stack + (ecif->cif->bytes / sizeof(unsigned));
+ unsigned int *tramp;
- /* 'gpr_base' points at the space for gpr3, and grows upwards as
- we use GPR registers. */
- unsigned *gpr_base = stacktop - ASM_NEEDS_REGISTERS - NUM_GPR_ARG_REGISTERS;
- int intarg_count = 0;
+ FFI_ASSERT (cif->abi == FFI_GCC_SYSV);
- /* 'fpr_base' points at the space for fpr1, and grows upwards as
- we use FPR registers. */
- double *fpr_base = (double *)gpr_base - NUM_FPR_ARG_REGISTERS;
- int fparg_count = 0;
+ tramp = (unsigned int *) &closure->tramp[0];
+ tramp[0] = 0x7c0802a6; /* mflr r0 */
+ tramp[1] = 0x4800000d; /* bl 10 <trampoline_initial+0x10> */
+ tramp[4] = 0x7d6802a6; /* mflr r11 */
+ tramp[5] = 0x7c0803a6; /* mtlr r0 */
+ tramp[6] = 0x800b0000; /* lwz r0,0(r11) */
+ tramp[7] = 0x816b0004; /* lwz r11,4(r11) */
+ tramp[8] = 0x7c0903a6; /* mtctr r0 */
+ tramp[9] = 0x4e800420; /* bctr */
+ *(void **) &tramp[2] = (void *)ffi_closure_SYSV; /* function */
+ *(void **) &tramp[3] = (void *)closure; /* context */
- /* 'copy_space' grows down as we put structures in it. It should
- stay 16-byte aligned. */
- char *copy_space = ((flags & FLAG_FP_ARGUMENTS)
- ? (char *)fpr_base
- : (char *)gpr_base);
+ closure->cif = cif;
+ closure->fun = fun;
+ closure->user_data = user_data;
- /* 'next_arg' grows up as we put parameters in it. */
- unsigned *next_arg = stack + 2;
+ /* Flush the icache. */
+ flush_icache(&closure->tramp[0],FFI_TRAMPOLINE_SIZE);
- int i;
- ffi_type **ptr;
- double double_tmp;
- void **p_argv;
- size_t struct_copy_size;
- unsigned gprvalue;
-
- /* Check that everything starts aligned properly. */
- FFI_ASSERT(((unsigned)(char *)stack & 0xF) == 0);
- FFI_ASSERT(((unsigned)(char *)copy_space & 0xF) == 0);
- FFI_ASSERT(((unsigned)(char *)stacktop & 0xF) == 0);
- FFI_ASSERT((bytes & 0xF) == 0);
- FFI_ASSERT(copy_space >= (char *)next_arg);
-
- /* Deal with return values that are actually pass-by-reference. */
- if (flags & FLAG_RETVAL_REFERENCE)
- {
- *gpr_base++ = (unsigned)(char *)ecif->rvalue;
- intarg_count++;
- }
+ return FFI_OK;
+}
- /* Now for the arguments. */
- p_argv = ecif->avalue;
- for (ptr = ecif->cif->arg_types, i = ecif->cif->nargs;
- i > 0;
- i--, ptr++, p_argv++)
- {
- switch ((*ptr)->type)
- {
- case FFI_TYPE_FLOAT:
- case FFI_TYPE_DOUBLE:
- if ((*ptr)->type == FFI_TYPE_FLOAT)
- double_tmp = *(float *)*p_argv;
- else
- double_tmp = *(double *)*p_argv;
-
- if (fparg_count >= NUM_FPR_ARG_REGISTERS)
- {
- if (intarg_count%2 != 0)
- {
- intarg_count++;
- next_arg++;
- }
- *(double *)next_arg = double_tmp;
- next_arg += 2;
- }
- else
- *fpr_base++ = double_tmp;
- fparg_count++;
- FFI_ASSERT(flags & FLAG_FP_ARGUMENTS);
- break;
- case FFI_TYPE_UINT64:
- case FFI_TYPE_SINT64:
- if (intarg_count == NUM_GPR_ARG_REGISTERS-1)
- intarg_count++;
- if (intarg_count >= NUM_GPR_ARG_REGISTERS)
- {
- if (intarg_count%2 != 0)
- {
- intarg_count++;
- next_arg++;
- }
- *(long long *)next_arg = *(long long *)*p_argv;
- next_arg += 2;
- }
- else
- {
- *(long long *)gpr_base = *(long long *)*p_argv;
- gpr_base += 2;
- }
- intarg_count += 2;
- break;
+#define MIN_CACHE_LINE_SIZE 8
- case FFI_TYPE_STRUCT:
-#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
- case FFI_TYPE_LONGDOUBLE:
-#endif
- struct_copy_size = ((*ptr)->size + 15) & ~0xF;
- copy_space -= struct_copy_size;
- memcpy(copy_space, (char *)*p_argv, (*ptr)->size);
-
- gprvalue = (unsigned)copy_space;
-
- FFI_ASSERT(copy_space > (char *)next_arg);
- FFI_ASSERT(flags & FLAG_ARG_NEEDS_COPY);
- goto putgpr;
+static void flush_icache(char * addr1, int size)
+{
+ int i;
+ char * addr;
+ for (i = 0; i < size; i += MIN_CACHE_LINE_SIZE) {
+ addr = addr1 + i;
+ __asm__ volatile ("icbi 0,%0;" "dcbf 0,%0;" : : "r"(addr) : "memory");
+ }
+ addr = addr1 + size - 1;
+ __asm__ volatile ("icbi 0,%0;" "dcbf 0,%0;" "sync;" "isync;" : : "r"(addr) : "memory");
+}
- case FFI_TYPE_UINT8:
- gprvalue = *(unsigned char *)*p_argv;
- goto putgpr;
- case FFI_TYPE_SINT8:
- gprvalue = *(signed char *)*p_argv;
- goto putgpr;
- case FFI_TYPE_UINT16:
- gprvalue = *(unsigned short *)*p_argv;
- goto putgpr;
- case FFI_TYPE_SINT16:
- gprvalue = *(signed short *)*p_argv;
- goto putgpr;
- case FFI_TYPE_INT:
- case FFI_TYPE_UINT32:
- case FFI_TYPE_SINT32:
- case FFI_TYPE_POINTER:
- gprvalue = *(unsigned *)*p_argv;
- putgpr:
- if (intarg_count >= NUM_GPR_ARG_REGISTERS)
- *next_arg++ = gprvalue;
- else
- *gpr_base++ = gprvalue;
- intarg_count++;
- break;
- }
- }
+int ffi_closure_helper_SYSV (ffi_closure*, void*, unsigned long*,
+ unsigned long*, unsigned long*);
- /* Check that we didn't overrun the stack... */
- FFI_ASSERT(copy_space >= (char *)next_arg);
- FFI_ASSERT(gpr_base <= stacktop - ASM_NEEDS_REGISTERS);
- FFI_ASSERT((unsigned *)fpr_base
- <= stacktop - ASM_NEEDS_REGISTERS - NUM_GPR_ARG_REGISTERS);
- FFI_ASSERT(flags & FLAG_4_GPR_ARGUMENTS || intarg_count <= 4);
-}
+/* Basically the trampoline invokes ffi_closure_SYSV, and on
+ * entry, r11 holds the address of the closure.
+ * After storing the registers that could possibly contain
+ * parameters to be passed into the stack frame and setting
+ * up space for a return value, ffi_closure_SYSV invokes the
+ * following helper function to do most of the work
+ */
-/* Perform machine dependent cif processing */
-ffi_status ffi_prep_cif_machdep(ffi_cif *cif)
+int
+ffi_closure_helper_SYSV (ffi_closure* closure, void * rvalue,
+ unsigned long * pgr, unsigned long * pfr,
+ unsigned long * pst)
{
- /* All this is for the SYSV ABI. */
- int i;
- ffi_type **ptr;
- unsigned bytes;
- int fparg_count = 0, intarg_count = 0;
- unsigned flags = 0;
- unsigned struct_copy_size = 0;
-
- /* All the machine-independent calculation of cif->bytes will be wrong.
- Redo the calculation for SYSV. */
-
- /* Space for the frame pointer, callee's LR, and the asm's temp regs. */
- bytes = (2 + ASM_NEEDS_REGISTERS) * sizeof(int);
-
- /* Space for the GPR registers. */
- bytes += NUM_GPR_ARG_REGISTERS * sizeof(int);
-
- /* Return value handling. The rules are as follows:
- - 32-bit (or less) integer values are returned in gpr3;
- - Structures of size <= 4 bytes also returned in gpr3;
- - 64-bit integer values and structures between 5 and 8 bytes are returned
- in gpr3 and gpr4;
- - Single/double FP values are returned in fpr1;
- - Larger structures and long double (if not equivalent to double) values
- are allocated space and a pointer is passed as the first argument. */
- switch (cif->rtype->type)
+ /* rvalue is the pointer to space for return value in closure assembly */
+ /* pgr is the pointer to where r3-r10 are stored in ffi_closure_SYSV */
+ /* pfr is the pointer to where f1-f8 are stored in ffi_closure_SYSV */
+ /* pst is the pointer to outgoing parameter stack in original caller */
+
+ void ** avalue;
+ ffi_type ** arg_types;
+ long i, avn;
+ long nf; /* number of floating registers already used */
+ long ng; /* number of general registers already used */
+ ffi_cif * cif;
+ double temp;
+
+ cif = closure->cif;
+ avalue = alloca(cif->nargs * sizeof(void *));
+
+ nf = 0;
+ ng = 0;
+
+ /* Copy the caller's structure return value address so that the closure
+ returns the data directly to the caller. */
+ if (cif->rtype->type == FFI_TYPE_STRUCT)
{
- case FFI_TYPE_DOUBLE:
- flags |= FLAG_RETURNS_64BITS;
- /* Fall through. */
- case FFI_TYPE_FLOAT:
- flags |= FLAG_RETURNS_FP;
- break;
-
- case FFI_TYPE_UINT64:
- case FFI_TYPE_SINT64:
- flags |= FLAG_RETURNS_64BITS;
- break;
-
- case FFI_TYPE_STRUCT:
- if (cif->abi != FFI_GCC_SYSV)
- if (cif->rtype->size <= 4)
- break;
- else if (cif->rtype->size <= 8)
- {
- flags |= FLAG_RETURNS_64BITS;
- break;
- }
- /* else fall through. */
-#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
- case FFI_TYPE_LONGDOUBLE:
-#endif
- intarg_count++;
- flags |= FLAG_RETVAL_REFERENCE;
- /* Fall through. */
- case FFI_TYPE_VOID:
- flags |= FLAG_RETURNS_NOTHING;
- break;
-
- default:
- /* Returns 32-bit integer, or similar. Nothing to do here. */
- break;
+ rvalue = *pgr;
+ ng++;
+ pgr++;
}
- /* The first NUM_GPR_ARG_REGISTERS words of integer arguments, and the
- first NUM_FPR_ARG_REGISTERS fp arguments, go in registers; the rest
- goes on the stack. Structures and long doubles (if not equivalent
- to double) are passed as a pointer to a copy of the structure.
- Stuff on the stack needs to keep proper alignment. */
- for (ptr = cif->arg_types, i = cif->nargs; i > 0; i--, ptr++)
+ i = 0;
+ avn = cif->nargs;
+ arg_types = cif->arg_types;
+
+ /* Grab the addresses of the arguments from the stack frame. */
+ while (i < avn)
{
- switch ((*ptr)->type)
+ switch (arg_types[i]->type)
{
- case FFI_TYPE_FLOAT:
- case FFI_TYPE_DOUBLE:
- fparg_count++;
- /* If this FP arg is going on the stack, it must be
- 8-byte-aligned. */
- if (fparg_count > NUM_FPR_ARG_REGISTERS
- && intarg_count%2 != 0)
- intarg_count++;
+ case FFI_TYPE_SINT8:
+ case FFI_TYPE_UINT8:
+ /* there are 8 gpr registers used to pass values */
+ if (ng < 8) {
+ avalue[i] = (((char *)pgr)+3);
+ ng++;
+ pgr++;
+ } else {
+ avalue[i] = (((char *)pst)+3);
+ pst++;
+ }
+ break;
+
+ case FFI_TYPE_SINT16:
+ case FFI_TYPE_UINT16:
+ /* there are 8 gpr registers used to pass values */
+ if (ng < 8) {
+ avalue[i] = (((char *)pgr)+2);
+ ng++;
+ pgr++;
+ } else {
+ avalue[i] = (((char *)pst)+2);
+ pst++;
+ }
+ break;
+
+ case FFI_TYPE_SINT32:
+ case FFI_TYPE_UINT32:
+ case FFI_TYPE_POINTER:
+ case FFI_TYPE_STRUCT:
+ /* there are 8 gpr registers used to pass values */
+ if (ng < 8) {
+ avalue[i] = pgr;
+ ng++;
+ pgr++;
+ } else {
+ avalue[i] = pst;
+ pst++;
+ }
break;
- case FFI_TYPE_UINT64:
case FFI_TYPE_SINT64:
- /* 'long long' arguments are passed as two words, but
- either both words must fit in registers or both go
- on the stack. If they go on the stack, they must
- be 8-byte-aligned. */
- if (intarg_count == NUM_GPR_ARG_REGISTERS-1
- || intarg_count >= NUM_GPR_ARG_REGISTERS && intarg_count%2 != 0)
- intarg_count++;
- intarg_count += 2;
+ case FFI_TYPE_UINT64:
+ /* passing long long ints are complex, they must
+ * be passed in suitable register pairs such as
+ * (r3,r4) or (r5,r6) or (r6,r7), or (r7,r8) or (r9,r10)
+ * and if the entire pair aren't available then the outgoing
+ * parameter stack is used for both but an alignment of 8
+ * must will be kept. So we must either look in pgr
+ * or pst to find the correct address for this type
+ * of parameter.
+ */
+ if (ng < 7) {
+ if (ng & 0x01) {
+ /* skip r4, r6, r8 as starting points */
+ ng++;
+ pgr++;
+ }
+ avalue[i] = pgr;
+ ng+=2;
+ pgr+=2;
+ } else {
+ if (((long)pst) & 4) pst++;
+ avalue[i] = pst;
+ pst+=2;
+ }
+ break;
+
+ case FFI_TYPE_FLOAT:
+ /* unfortunately float values are stored as doubles
+ * in the ffi_closure_SYSV code (since we don't check
+ * the type in that routine). This is also true
+ * of floats passed on the outgoing parameter stack.
+ * Also, on the outgoing stack all values are aligned
+ * to 8
+ *
+ * Don't you just love the simplicity of this ABI!
+ */
+
+ /* there are 8 64bit floating point registers */
+
+ if (nf < 8) {
+ temp = *(double*)pfr;
+ *(float*)pfr = (float)temp;
+ avalue[i] = pfr;
+ nf++;
+ pfr+=2;
+ } else {
+ /* FIXME? here we are really changing the values
+ * stored in the original calling routines outgoing
+ * parameter stack. This is probably a really
+ * naughty thing to do but...
+ */
+ if (((long)pst) & 4) pst++;
+ temp = *(double*)pst;
+ *(float*)pst = (float)temp;
+ avalue[i] = pst;
+ nf++;
+ pst+=2;
+ }
break;
- case FFI_TYPE_STRUCT:
-#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
- case FFI_TYPE_LONGDOUBLE:
-#endif
- /* We must allocate space for a copy of these to enforce
- pass-by-value. Pad the space up to a multiple of 16
- bytes (the maximum alignment required for anything under
- the SYSV ABI). */
- struct_copy_size += ((*ptr)->size + 15) & ~0xF;
- /* Fall through (allocate space for the pointer). */
+ case FFI_TYPE_DOUBLE:
+ /* On the outgoing stack all values are aligned to 8 */
+ /* there are 8 64bit floating point registers */
+
+ if (nf < 8) {
+ avalue[i] = pfr;
+ nf++;
+ pfr+=2;
+ } else {
+ if (((long)pst) & 4) pst++;
+ avalue[i] = pst;
+ nf++;
+ pst+=2;
+ }
+ break;
default:
- /* Everything else is passed as a 4-byte word in a GPR, either
- the object itself or a pointer to it. */
- intarg_count++;
- break;
+ FFI_ASSERT(0);
}
+
+ i++;
}
- if (fparg_count != 0)
- flags |= FLAG_FP_ARGUMENTS;
- if (intarg_count > 4)
- flags |= FLAG_4_GPR_ARGUMENTS;
- if (struct_copy_size != 0)
- flags |= FLAG_ARG_NEEDS_COPY;
-
- /* Space for the FPR registers, if needed. */
- if (fparg_count != 0)
- bytes += NUM_FPR_ARG_REGISTERS * sizeof(double);
- /* Stack space. */
- if (intarg_count > NUM_GPR_ARG_REGISTERS)
- bytes += (intarg_count - NUM_GPR_ARG_REGISTERS) * sizeof(int);
- if (fparg_count > NUM_FPR_ARG_REGISTERS)
- bytes += (fparg_count - NUM_FPR_ARG_REGISTERS) * sizeof(double);
+ (closure->fun) (cif, rvalue, avalue, closure->user_data);
- /* The stack space allocated needs to be a multiple of 16 bytes. */
- bytes = (bytes + 15) & ~0xF;
+ /* Tell ffi_closure_osf how to perform return type promotions. */
+ return cif->rtype->type;
- /* Add in the space for the copied structures. */
- bytes += struct_copy_size;
+}
- cif->flags = flags;
- cif->bytes = bytes;
- return FFI_OK;
-}
-/*@-declundef@*/
-/*@-exportheader@*/
-extern void ffi_call_SYSV(/*@out@*/ extended_cif *,
- unsigned, unsigned,
- /*@out@*/ unsigned *,
- void (*fn)());
-/*@=declundef@*/
-/*@=exportheader@*/
-
-void ffi_call(/*@dependent@*/ ffi_cif *cif,
- void (*fn)(),
- /*@out@*/ void *rvalue,
- /*@dependent@*/ void **avalue)
-{
- extended_cif ecif;
- ecif.cif = cif;
- ecif.avalue = avalue;
-
- /* If the return value is a struct and we don't have a return */
- /* value address then we need to make one */
- if ((rvalue == NULL) &&
- (cif->rtype->type == FFI_TYPE_STRUCT))
- {
- /*@-sysunrecog@*/
- ecif.rvalue = alloca(cif->rtype->size);
- /*@=sysunrecog@*/
- }
- else
- ecif.rvalue = rvalue;
-
-
- switch (cif->abi)
- {
- case FFI_SYSV:
- case FFI_GCC_SYSV:
- /*@-usedef@*/
- ffi_call_SYSV(&ecif, -cif->bytes,
- cif->flags, ecif.rvalue, fn);
- /*@=usedef@*/
- break;
- default:
- FFI_ASSERT(0);
- break;
- }
-}
diff --git a/libffi/src/powerpc/ppc_closure.S b/libffi/src/powerpc/ppc_closure.S
new file mode 100644
index 00000000000..a9ea9c7ee52
--- /dev/null
+++ b/libffi/src/powerpc/ppc_closure.S
@@ -0,0 +1,181 @@
+#define LIBFFI_ASM
+#include <powerpc/asm.h>
+
+.globl ffi_closure_helper_SYSV
+
+ENTRY(ffi_closure_SYSV)
+.LFB1:
+ stwu %r1,-144(%r1)
+.LCFI0:
+ mflr %r0
+ stw %r31,140(%r1)
+.LCFI1:
+ stw %r0,148(%r1)
+
+# we want to build up an areas for the parameters passed
+# in registers (both floating point and integer)
+
+ # so first save gpr 3 to gpr 10 (aligned to 4)
+ stw %r3, 16(%r1)
+ stw %r4, 20(%r1)
+ stw %r5, 24(%r1)
+ stw %r6, 28(%r1)
+ stw %r7, 32(%r1)
+ stw %r8, 36(%r1)
+ stw %r9, 40(%r1)
+ stw %r10,44(%r1)
+
+ # next save fpr 1 to fpr 8 (aligned to 8)
+ stfd %f1, 48(%r1)
+ stfd %f2, 56(%r1)
+ stfd %f3, 64(%r1)
+ stfd %f4, 72(%r1)
+ stfd %f5, 80(%r1)
+ stfd %f6, 88(%r1)
+ stfd %f7, 96(%r1)
+ stfd %f8, 104(%r1)
+
+ # set up registers for the routine that actually does the work
+ # get the context pointer from the trampoline
+ mr %r3,%r11
+
+ # now load up the pointer to the result storage
+ addi %r4,%r1,112
+
+ # now load up the pointer to the saved gpr registers
+ addi %r5,%r1,16
+
+ # now load up the pointer to the saved fpr registers */
+ addi %r6,%r1,48
+
+ # now load up the pointer to the outgoing parameter
+ # stack in the previous frame
+ # i.e. the previous frame pointer + 8
+ addi %r7,%r1,152
+
+ # make the call
+ bl JUMPTARGET(ffi_closure_helper_SYSV)
+
+ # now r3 contains the return type
+ # so use it to look up in a table
+ # so we know how to deal with each type
+
+ # look up the proper starting point in table
+ # by using return type as offset
+ addi %r5,%r1,112 # get pointer to results area
+ addis %r4,0,.L60@ha # get address of jump table
+ addi %r4,%r4,.L60@l
+ slwi %r3,%r3,2 # now multiply return type by 4
+ lwzx %r3,%r4,%r3 # get the contents of that table value
+ add %r3,%r3,%r4 # add contents of table to table address
+ mtctr %r3
+ bctr # jump to it
+.LFE1:
+ .align 2
+.L60:
+ .long .L44-.L60 # FFI_TYPE_VOID
+ .long .L50-.L60 # FFI_TYPE_INT
+ .long .L47-.L60 # FFI_TYPE_FLOAT
+ .long .L46-.L60 # FFI_TYPE_DOUBLE
+ .long .L46-.L60 # FFI_TYPE_LONGDOUBLE
+ .long .L56-.L60 # FFI_TYPE_UINT8
+ .long .L55-.L60 # FFI_TYPE_SINT8
+ .long .L58-.L60 # FFI_TYPE_UINT16
+ .long .L57-.L60 # FFI_TYPE_SINT16
+ .long .L50-.L60 # FFI_TYPE_UINT32
+ .long .L50-.L60 # FFI_TYPE_SINT32
+ .long .L48-.L60 # FFI_TYPE_UINT64
+ .long .L48-.L60 # FFI_TYPE_SINT64
+ .long .L44-.L60 # FFI_TYPE_STRUCT
+ .long .L50-.L60 # FFI_TYPE_POINTER
+
+
+# case double
+.L46:
+ lfd %f1,0(%r5)
+ b .L44
+
+# case float
+.L47:
+ lfs %f1,0(%r5)
+ b .L44
+
+# case long long
+.L48:
+ lwz %r3,0(%r5)
+ lwz %r4,4(%r5)
+ b .L44
+
+# case default / int32 / pointer
+.L50:
+ lwz %r3,0(%r5)
+ b .L44
+
+# case signed int8
+.L55:
+ addi %r5,%r5,3
+ lbz %r3,0(%r5)
+ extsb %r3,%r3
+ b .L44
+
+# case unsigned int8
+.L56:
+ addi %r5,%r5,3
+ lbz %r3,0(%r5)
+ b .L44
+
+# case signed int16
+.L57:
+ addi %r5,%r5,2
+ lhz %r3,0(%r5)
+ extsh %r3,%r3
+ b .L44
+
+#case unsigned int16
+.L58:
+ addi %r5,%r5,2
+ lhz %r3,0(%r5)
+
+# case void / done
+.L44:
+
+ lwz %r11,0(%r1)
+ lwz %r0,4(%r11)
+ mtlr %r0
+ lwz %r31,-4(%r11)
+ mr %r1,%r11
+ blr
+END(ffi_closure_SYSV)
+
+ .section ".eh_frame","aw"
+__FRAME_BEGIN__:
+ .4byte .LECIE1-.LSCIE1 # Length of Common Information Entry
+.LSCIE1:
+ .4byte 0x0 # CIE Identifier Tag
+ .byte 0x1 # CIE Version
+ .ascii "\0" # CIE Augmentation
+ .byte 0x1 # uleb128 0x1; CIE Code Alignment Factor
+ .byte 0x7c # sleb128 -4; CIE Data Alignment Factor
+ .byte 0x41 # CIE RA Column
+ .byte 0xc # DW_CFA_def_cfa
+ .byte 0x1 # uleb128 0x1
+ .byte 0x0 # uleb128 0x0
+ .align 2
+.LECIE1:
+.LSFDE1:
+ .4byte .LEFDE1-.LASFDE1 # FDE Length
+.LASFDE1:
+ .4byte .LASFDE1-__FRAME_BEGIN__ # FDE CIE offset
+ .4byte .LFB1 # FDE initial location
+ .4byte .LFE1-.LFB1 # FDE address range
+ .byte 0x4 # DW_CFA_advance_loc4
+ .4byte .LCFI0-.LFB1
+ .byte 0xe # DW_CFA_def_cfa_offset
+ .byte 144,1 # uleb128 144
+ .byte 0x4 # DW_CFA_advance_loc4
+ .4byte .LCFI1-.LCFI0
+ .byte 0x2f # DW_CFA_GNU_negative_offset_extended
+ .byte 0x41 # uleb128 0x41
+ .byte 0x1 # uleb128 0x1
+ .align 2
+.LEFDE1:
diff --git a/libffi/src/powerpc/sysv.S b/libffi/src/powerpc/sysv.S
index 88b037844f3..91efd6e1fa8 100644
--- a/libffi/src/powerpc/sysv.S
+++ b/libffi/src/powerpc/sysv.S
@@ -1,119 +1,54 @@
-/* -----------------------------------------------------------------------
- sysv.h - Copyright (c) 1998 Geoffrey Keating
-
- PowerPC Assembly glue.
-
- $Id: sysv.S,v 1.1.1.1 1998/11/29 16:48:16 green Exp $
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR
- OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- OTHER DEALINGS IN THE SOFTWARE.
- ----------------------------------------------------------------------- */
-
-#define LIBFFI_ASM
-#include <ffi.h>
-#include <powerpc/asm.h>
-
- .globl ffi_prep_args
-ENTRY(ffi_call_SYSV)
- /* Save the old stack pointer as AP. */
- mr %r8,%r1
-
- /* Allocate the stack space we need. */
- stwux %r1,%r1,%r4
- /* Save registers we use. */
- mflr %r9
- stw %r28,-16(%r8)
- stw %r29,-12(%r8)
- stw %r30, -8(%r8)
- stw %r31, -4(%r8)
- stw %r9, 4(%r8)
-
- /* Save arguments over call... */
- mr %r31,%r5 /* flags, */
- mr %r30,%r6 /* rvalue, */
- mr %r29,%r7 /* function address, */
- mr %r28,%r8 /* our AP. */
-
- /* Call ffi_prep_args. */
- mr %r4,%r1
- bl JUMPTARGET(ffi_prep_args)
-
- /* Now do the call. */
- /* Set up cr1 with bits 4-7 of the flags. */
- mtcrf 0x40,%r31
- /* Get the address to call into CTR. */
- mtctr %r29
- /* Load all those argument registers. */
- lwz %r3,-16-(8*4)(%r28)
- lwz %r4,-16-(7*4)(%r28)
- lwz %r5,-16-(6*4)(%r28)
- lwz %r6,-16-(5*4)(%r28)
- bf- 5,1f
- nop
- lwz %r7,-16-(4*4)(%r28)
- lwz %r8,-16-(3*4)(%r28)
- lwz %r9,-16-(2*4)(%r28)
- lwz %r10,-16-(1*4)(%r28)
- nop
-1:
-
- /* Load all the FP registers. */
- bf- 6,2f
- lfd %f1,-16-(8*4)-(8*8)(%r28)
- lfd %f2,-16-(8*4)-(7*8)(%r28)
- lfd %f3,-16-(8*4)-(6*8)(%r28)
- lfd %f4,-16-(8*4)-(5*8)(%r28)
- nop
- lfd %f5,-16-(8*4)-(4*8)(%r28)
- lfd %f6,-16-(8*4)-(3*8)(%r28)
- lfd %f7,-16-(8*4)-(2*8)(%r28)
- lfd %f8,-16-(8*4)-(1*8)(%r28)
-2:
-
- /* Make the call. */
- bctrl
-
- /* Now, deal with the return value. */
- mtcrf 0x01,%r31
- bt- 30,L(done_return_value)
- bt- 29,L(fp_return_value)
- stw %r3,0(%r30)
- bf+ 28,L(done_return_value)
- stw %r4,4(%r30)
- /* Fall through... */
-
-L(done_return_value):
- /* Restore the registers we used and return. */
- lwz %r9, 4(%r28)
- lwz %r31, -4(%r28)
- mtlr %r9
- lwz %r30, -8(%r28)
- lwz %r29,-12(%r28)
- lwz %r28,-16(%r28)
- lwz %r1,0(%r1)
- blr
-
-L(fp_return_value):
- bf 28,L(float_return_value)
- stfd %f1,0(%r30)
- b L(done_return_value)
-L(float_return_value):
- stfs %f1,0(%r30)
- b L(done_return_value)
-END(ffi_call_SYSV)
+.LFB1:
+.LCFI0:
+.LCFI1:
+.LCFI2:
+.LCFI3:
+.LCFI4:
+.LCFI5:
+.LCFI6:
+.LFE1:
+
+ .section ".eh_frame","aw"
+__FRAME_BEGIN__:
+ .4byte .LECIE1-.LSCIE1 /* Length of Common Information Entry */
+.LSCIE1:
+ .4byte 0x0 /* CIE Identifier Tag */
+ .byte 0x1 /* CIE Version */
+ .ascii "\0" /* CIE Augmentation */
+ .byte 0x1 /* uleb128 0x1; CIE Code Alignment Factor */
+ .byte 0x7c /* sleb128 -4; CIE Data Alignment Factor */
+ .byte 0x41 /* CIE RA Column */
+ .byte 0xc /* DW_CFA_def_cfa */
+ .byte 0x1 /* uleb128 0x1 */
+ .byte 0x0 /* uleb128 0x0 */
+ .align 2
+.LECIE1:
+.LSFDE1:
+ .4byte .LEFDE1-.LASFDE1 /* FDE Length */
+.LASFDE1:
+ .4byte .LASFDE1-__FRAME_BEGIN__ /* FDE CIE offset */
+ .4byte .LFB1 /* FDE initial location */
+ .4byte .LFE1-.LFB1 /* FDE address range */
+ .byte 0x4 /* DW_CFA_advance_loc4 */
+ .4byte .LCFI0-.LFB1
+ .byte 0xd /* DW_CFA_def_cfa_register */
+ .byte 0x08 /* uleb128 0x08 */
+ .byte 0x4 /* DW_CFA_advance_loc4 */
+ .4byte .LCFI5-.LCFI0
+ .byte 0x2f /* DW_CFA_GNU_negative_offset_extended */
+ .byte 0x41 /* uleb128 0x41 */
+ .byte 0x1 /* uleb128 0x1 */
+ .byte 0x9f /* DW_CFA_offset, column 0x1f */
+ .byte 0x1 /* uleb128 0x1 */
+ .byte 0x9e /* DW_CFA_offset, column 0x1e */
+ .byte 0x2 /* uleb128 0x2 */
+ .byte 0x9d /* DW_CFA_offset, column 0x1d */
+ .byte 0x3 /* uleb128 0x3 */
+ .byte 0x9c /* DW_CFA_offset, column 0x1c */
+ .byte 0x4 /* uleb128 0x4 */
+ .byte 0x4 /* DW_CFA_advance_loc4 */
+ .4byte .LCFI6-.LCFI5
+ .byte 0xd /* DW_CFA_def_cfa_register */
+ .byte 0x1c /* uleb128 0x1c */
+ .align 2
+.LEFDE1:
diff --git a/libffi/src/types.c b/libffi/src/types.c
index 43aab913130..a216f0ab348 100644
--- a/libffi/src/types.c
+++ b/libffi/src/types.c
@@ -59,6 +59,11 @@ FFI_INTEGRAL_TYPEDEF(pointer, 4, 4, FFI_TYPE_POINTER);
FFI_INTEGRAL_TYPEDEF(uint64, 8, 4, FFI_TYPE_UINT64);
FFI_INTEGRAL_TYPEDEF(sint64, 8, 4, FFI_TYPE_SINT64);
+#elif defined X86_WIN32
+
+FFI_INTEGRAL_TYPEDEF(uint64, 8, 4, FFI_TYPE_UINT64);
+FFI_INTEGRAL_TYPEDEF(sint64, 8, 4, FFI_TYPE_SINT64);
+
#elif defined ARM
FFI_INTEGRAL_TYPEDEF(uint64, 8, 4, FFI_TYPE_UINT64);
@@ -82,6 +87,11 @@ FFI_INTEGRAL_TYPEDEF(sint64, 8, 8, FFI_TYPE_SINT64);
FFI_INTEGRAL_TYPEDEF(double, 8, 4, FFI_TYPE_DOUBLE);
FFI_INTEGRAL_TYPEDEF(longdouble, 12, 4, FFI_TYPE_LONGDOUBLE);
+#elif defined X86_WIN32
+
+FFI_INTEGRAL_TYPEDEF(double, 8, 4, FFI_TYPE_DOUBLE);
+FFI_INTEGRAL_TYPEDEF(longdouble, 12, 4, FFI_TYPE_LONGDOUBLE);
+
#elif defined ARM
FFI_INTEGRAL_TYPEDEF(double, 8, 4, FFI_TYPE_DOUBLE);
diff --git a/libffi/src/x86/sysv.S b/libffi/src/x86/sysv.S
index 4c8473ae901..3a27c4b5377 100644
--- a/libffi/src/x86/sysv.S
+++ b/libffi/src/x86/sysv.S
@@ -1,5 +1,5 @@
/* -----------------------------------------------------------------------
- sysv.S - Copyright (c) 1996, 1998 Cygnus Solutions
+ sysv.S - Copyright (c) 1996, 1998, 2001 Cygnus Solutions
X86 Foreign Function Interface
@@ -32,8 +32,7 @@
.globl ffi_prep_args
- # This assumes we are using gas.
- .balign 16
+ .align 4
.globl ffi_call_SYSV
.type ffi_call_SYSV,@function
@@ -43,35 +42,35 @@ ffi_call_SYSV:
.LCFI0:
movl %esp,%ebp
.LCFI1:
- # Make room for all of the new args.
+ /* Make room for all of the new args. */
movl 16(%ebp),%ecx
subl %ecx,%esp
movl %esp,%eax
- # Place all of the ffi_prep_args in position
+ /* Place all of the ffi_prep_args in position */
pushl 12(%ebp)
pushl %eax
call *8(%ebp)
- # Return stack to previous state and call the function
+ /* Return stack to previous state and call the function */
addl $8,%esp
call *28(%ebp)
- # Remove the space we pushed for the args
+ /* Remove the space we pushed for the args */
movl 16(%ebp),%ecx
addl %ecx,%esp
- # Load %ecx with the return type code
+ /* Load %ecx with the return type code */
movl 20(%ebp),%ecx
- # If the return value pointer is NULL, assume no return value.
+ /* If the return value pointer is NULL, assume no return value. */
cmpl $0,24(%ebp)
jne retint
- # Even if there is no space for the return value, we are
- # obliged to handle floating-point values.
+ /* Even if there is no space for the return value, we are
+ obliged to handle floating-point values. */
cmpl $FFI_TYPE_FLOAT,%ecx
jne noretval
fstp %st(0)
@@ -81,7 +80,7 @@ ffi_call_SYSV:
retint:
cmpl $FFI_TYPE_INT,%ecx
jne retfloat
- # Load %ecx with the pointer to storage for the return value
+ /* Load %ecx with the pointer to storage for the return value */
movl 24(%ebp),%ecx
movl %eax,0(%ecx)
jmp epilogue
@@ -89,7 +88,7 @@ retint:
retfloat:
cmpl $FFI_TYPE_FLOAT,%ecx
jne retdouble
- # Load %ecx with the pointer to storage for the return value
+ /* Load %ecx with the pointer to storage for the return value */
movl 24(%ebp),%ecx
fstps (%ecx)
jmp epilogue
@@ -97,7 +96,7 @@ retfloat:
retdouble:
cmpl $FFI_TYPE_DOUBLE,%ecx
jne retlongdouble
- # Load %ecx with the pointer to storage for the return value
+ /* Load %ecx with the pointer to storage for the return value */
movl 24(%ebp),%ecx
fstpl (%ecx)
jmp epilogue
@@ -105,7 +104,7 @@ retdouble:
retlongdouble:
cmpl $FFI_TYPE_LONGDOUBLE,%ecx
jne retint64
- # Load %ecx with the pointer to storage for the return value
+ /* Load %ecx with the pointer to storage for the return value */
movl 24(%ebp),%ecx
fstpt (%ecx)
jmp epilogue
@@ -113,13 +112,13 @@ retlongdouble:
retint64:
cmpl $FFI_TYPE_SINT64,%ecx
jne retstruct
- # Load %ecx with the pointer to storage for the return value
+ /* Load %ecx with the pointer to storage for the return value */
movl 24(%ebp),%ecx
movl %eax,0(%ecx)
movl %edx,4(%ecx)
retstruct:
- # Nothing to do!
+ /* Nothing to do! */
noretval:
epilogue:
diff --git a/libffi/src/x86/win32.S b/libffi/src/x86/win32.S
new file mode 100644
index 00000000000..603fb2b769e
--- /dev/null
+++ b/libffi/src/x86/win32.S
@@ -0,0 +1,127 @@
+/* -----------------------------------------------------------------------
+ win32.S - Copyright (c) 1996, 1998, 2001 Cygnus Solutions
+
+ X86 Foreign Function Interface
+
+ $Id: win32.S,v 1.2 2001/01/10 18:00:05 green Exp $
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ ``Software''), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to
+ permit persons to whom the Software is furnished to do so, subject to
+ the following conditions:
+
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ OTHER DEALINGS IN THE SOFTWARE.
+ ----------------------------------------------------------------------- */
+
+#define LIBFFI_ASM
+#include <ffi.h>
+
+.text
+
+.globl ffi_prep_args
+
+ # This assumes we are using gas.
+ .balign 16
+.globl _ffi_call_SYSV
+
+_ffi_call_SYSV:
+ pushl %ebp
+ movl %esp,%ebp
+
+ # Make room for all of the new args.
+ movl 16(%ebp),%ecx
+ subl %ecx,%esp
+
+ movl %esp,%eax
+
+ # Place all of the ffi_prep_args in position
+ pushl 12(%ebp)
+ pushl %eax
+ call *8(%ebp)
+
+ # Return stack to previous state and call the function
+ addl $8,%esp
+
+ call *28(%ebp)
+
+ # Remove the space we pushed for the args
+ movl 16(%ebp),%ecx
+ addl %ecx,%esp
+
+ # Load %ecx with the return type code
+ movl 20(%ebp),%ecx
+
+ # If the return value pointer is NULL, assume no return value.
+ cmpl $0,24(%ebp)
+ jne retint
+
+ # Even if there is no space for the return value, we are
+ # obliged to handle floating-point values.
+ cmpl $FFI_TYPE_FLOAT,%ecx
+ jne noretval
+ fstp %st(0)
+
+ jmp epilogue
+
+retint:
+ cmpl $FFI_TYPE_INT,%ecx
+ jne retfloat
+ # Load %ecx with the pointer to storage for the return value
+ movl 24(%ebp),%ecx
+ movl %eax,0(%ecx)
+ jmp epilogue
+
+retfloat:
+ cmpl $FFI_TYPE_FLOAT,%ecx
+ jne retdouble
+ # Load %ecx with the pointer to storage for the return value
+ movl 24(%ebp),%ecx
+ fstps (%ecx)
+ jmp epilogue
+
+retdouble:
+ cmpl $FFI_TYPE_DOUBLE,%ecx
+ jne retlongdouble
+ # Load %ecx with the pointer to storage for the return value
+ movl 24(%ebp),%ecx
+ fstpl (%ecx)
+ jmp epilogue
+
+retlongdouble:
+ cmpl $FFI_TYPE_LONGDOUBLE,%ecx
+ jne retint64
+ # Load %ecx with the pointer to storage for the return value
+ movl 24(%ebp),%ecx
+ fstpt (%ecx)
+ jmp epilogue
+
+retint64:
+ cmpl $FFI_TYPE_SINT64,%ecx
+ jne retstruct
+ # Load %ecx with the pointer to storage for the return value
+ movl 24(%ebp),%ecx
+ movl %eax,0(%ecx)
+ movl %edx,4(%ecx)
+
+retstruct:
+ # Nothing to do!
+
+noretval:
+epilogue:
+ movl %ebp,%esp
+ popl %ebp
+ ret
+
+.ffi_call_SYSV_end:
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index e2830665b52..b634665e875 100644
--- a/libiberty/ChangeLog
+++ b/libiberty/ChangeLog
@@ -1,3 +1,106 @@
+2002-02-20 Release Manager
+
+ * GCC 3.0.4 Released.
+
+2002-01-22 Momchil Velikov <velco@fadata.bg>
+
+ * configure.in (variable detection): Use arrays of unspecified
+ size instead of plain integers.
+
+2001-12-20 Release Manager
+
+ * GCC 3.0.3 Released.
+
+2001-12-12 Craig Rodrigues <rodrigc@gcc.gnu.org>
+
+ PR other/2719
+ * cplus-dem.c (consume_count): Treat negative count as an error.
+ * testsuite/demangle-expected: Added testcase.
+
+2001-12-06 DJ Delorie <dj@redhat.com>
+ Daniel Jacobowitz <drow@mvista.com>
+
+ * Makefile.in (stamp-h): Depend on Makefile for proper
+ serialization.
+ (*-subdir): Depend on config.h for proper serialization.
+
+2001-10-23 Release Manager
+
+ * GCC 3.0.2 Released.
+
+2001-08-21 Christopher Faylor <cgf@cygnus.com>
+
+ * configure.in: Set HAVE_SYS_ERRLIST and HAVE_SYS_NERR whenever hosting
+ on cygwin.
+ * configure: Regenerate.
+
+2001-08-19 Release Manager
+
+ * GCC 3.0.1 Released.
+
+2001-08-19 Release Manager
+
+ * GCC 3.0.1 Released.
+
+20010617 Release Manager
+
+ * GCC 3.0 Released.
+
+2001-06-11 Loren J. Rittle <ljrittle@acm.org>
+
+ bootstrap/3106
+ * strerror.c (sys_nerr): Hide the OS header version.
+ * strsignal.c (sys_nsig): Likewise.
+
+2001-05-07 Zack Weinberg <zackw@stanford.edu>
+
+ * cp-demangle.c (demangle_v3_with_details,
+ is_gnu_v3_mangled_ctor, is_gnu_v3_mangled_dtor): Use K+R style
+ function definition.
+
+2001-05-07 Mark Mitchell <mark@codesourcery.com>
+
+ * splay-tree.c (splay_tree_max): New function.
+ (splay_tree_min): Likewise.
+
+2001-03-27 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * memchr.c (memchr): Adjust condition to avoid infinite loop.
+
+2001-03-26 Jakub Jelinek <jakub@redhat.com>
+
+ * cp-demangle.c (demangle_discriminator): `_0' is discriminator #1,
+ `_' not followed by a digit is invalid.
+
+2001-03-24 Neil Booth <neil@daikokuya.demon.co.uk>
+
+ * lbasename.c: New file / function, always compiled in.
+ * Makefile.in: Always compile and link lbasename.c. Add
+ target for lbasename.o.
+
+2001-03-20 Jim Blandy <jimb@redhat.com>
+
+ * cp-demangle.c (struct demangling_def): New fields:
+ is_constructor and is_destructor.
+ (demangling_new): Initialize them.
+ (demangle_ctor_dtor_name): Set them, if we detect a constructor
+ or destructor.
+ (demangle_v3_with_details, is_gnu_v3_mangled_ctor,
+ is_gnu_v3_mangled_dtor): New functions.
+
+2001-03-15 Michael Meissner <meissner@redhat.com>
+
+ * hashtab.c (higher_prime_number): Silence warning that 4294967291
+ might be a signed integer under pre-ISO C systems.
+
+2001-03-04 John David Anglin <dave@hiauly1.hia.nrc.ca>
+
+ * cplus-dem.c (main): Cast enum style to int.
+
+2001-02-16 Loren J. Rittle <ljrittle@acm.org>
+
+ * cplus-dem.c (main): Initialize style.
+
2001-02-02 Phil Edwards <pme@sources.redhat.com>
* COPYING.LIB: Update to LGPL 2.1 from the FSF.
diff --git a/libiberty/Makefile.in b/libiberty/Makefile.in
index 0eab5a6c141..cd61011dc34 100644
--- a/libiberty/Makefile.in
+++ b/libiberty/Makefile.in
@@ -128,7 +128,8 @@ CFILES = asprintf.c alloca.c argv.c atexit.c basename.c bcmp.c bcopy.c \
bzero.c calloc.c choose-temp.c clock.c concat.c cplus-dem.c \
cp-demangle.c dyn-string.c fdmatch.c fnmatch.c getcwd.c \
getpwd.c getopt.c getopt1.c getpagesize.c getruntime.c \
- floatformat.c hashtab.c hex.c index.c insque.c md5.c memchr.c \
+ floatformat.c hashtab.c hex.c index.c insque.c lbasename.c \
+ md5.c memchr.c \
memcmp.c memcpy.c memmove.c memset.c mkstemps.c objalloc.c obstack.c \
partition.c pexecute.c putenv.c random.c rename.c rindex.c setenv.c \
sigsetmask.c safe-ctype.c sort.c spaces.c splay-tree.c strcasecmp.c \
@@ -140,7 +141,8 @@ CFILES = asprintf.c alloca.c argv.c atexit.c basename.c bcmp.c bcopy.c \
# These are always included in the library.
REQUIRED_OFILES = argv.o choose-temp.o concat.o cplus-dem.o cp-demangle.o \
dyn-string.o fdmatch.o fnmatch.o getopt.o getopt1.o getpwd.o \
- getruntime.o hashtab.o hex.o floatformat.o md5.o objalloc.o obstack.o \
+ getruntime.o hashtab.o hex.o floatformat.o lbasename.o md5.o \
+ objalloc.o obstack.o \
partition.o pexecute.o safe-ctype.o sort.o spaces.o splay-tree.o \
strerror.o strsignal.o xatexit.o xexit.o xmalloc.o xmemdup.o \
xstrdup.o xstrerror.o
@@ -236,18 +238,23 @@ force:
Makefile: $(srcdir)/Makefile.in config.status
CONFIG_FILES=Makefile CONFIG_HEADERS= $(SHELL) ./config.status
+# Depending on Makefile makes sure that config.status has been re-run
+# if needed. This prevents problems with parallel builds.
config.h: stamp-h ; @true
-stamp-h: config.in config.status
+stamp-h: config.in config.status Makefile
CONFIG_FILES= CONFIG_HEADERS=config.h:config.in $(SHELL) ./config.status
config.status: $(srcdir)/configure $(srcdir)/config.table
$(SHELL) ./config.status --recheck
+# Depending on config.h makes sure that config.status has been re-run
+# if needed. This prevents problems with parallel builds, in case
+# subdirectories need to run config.status also.
all-subdir check-subdir installcheck-subdir info-subdir \
install-info-subdir clean-info-subdir dvi-subdir install-subdir \
etags-subdir mostlyclean-subdir clean-subdir distclean-subdir \
-maintainer-clean-subdir:
+maintainer-clean-subdir: config.h
@subdirs='$(SUBDIRS)'; \
target=`echo $@ | sed -e 's/-subdir//'`; \
for dir in $$subdirs ; do \
@@ -276,6 +283,7 @@ getpwd.o: config.h $(INCDIR)/libiberty.h
getruntime.o: config.h $(INCDIR)/libiberty.h
hex.o: $(INCDIR)/libiberty.h
floatformat.o: $(INCDIR)/floatformat.h
+lbasename.o: $(INCDIR)/libiberty.h
mkstemps.o: config.h
md5.o: config.h
objalloc.o: config.h $(INCDIR)/objalloc.h
diff --git a/libiberty/configure b/libiberty/configure
index ca24ef96c5b..3e12d3c53ef 100755
--- a/libiberty/configure
+++ b/libiberty/configure
@@ -1826,6 +1826,19 @@ fi
+case "${host}" in
+ *-*-cygwin*)
+ cat >> confdefs.h <<\EOF
+#define HAVE_SYS_ERRLIST 1
+EOF
+
+ cat >> confdefs.h <<\EOF
+#define HAVE_SYS_NERR 1
+EOF
+
+ ;;
+esac
+
if test -z "${setobjs}"; then
case "${host}" in
@@ -1917,7 +1930,7 @@ if test -z "${setobjs}"; then
# We haven't set the list of objects yet. Use the standard autoconf
# tests. This will only work if the compiler works.
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:1921: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:1934: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -1928,12 +1941,12 @@ cross_compiling=$ac_cv_prog_cc_cross
cat > conftest.$ac_ext << EOF
-#line 1932 "configure"
+#line 1945 "configure"
#include "confdefs.h"
main(){return(0);}
EOF
-if { (eval echo configure:1937: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1950: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ac_cv_prog_cc_works=yes
# If we can't run a trivial program, we are probably using a cross compiler.
if (./conftest; exit) 2>/dev/null; then
@@ -1959,19 +1972,19 @@ if test $ac_cv_prog_cc_works = no; then
{ echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:1963: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:1976: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
cross_compiling=$ac_cv_prog_cc_cross
for ac_func in $funcs
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1970: checking for $ac_func" >&5
+echo "configure:1983: 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 1975 "configure"
+#line 1988 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -1994,7 +2007,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:1998: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2011: \"$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
@@ -2041,19 +2054,19 @@ EOF
# 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:2045: checking for working alloca.h" >&5
+echo "configure:2058: 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 2050 "configure"
+#line 2063 "configure"
#include "confdefs.h"
#include <alloca.h>
int main() {
char *p = alloca(2 * sizeof(int));
; return 0; }
EOF
-if { (eval echo configure:2057: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2070: \"$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
@@ -2074,12 +2087,12 @@ EOF
fi
echo $ac_n "checking for alloca""... $ac_c" 1>&6
-echo "configure:2078: checking for alloca" >&5
+echo "configure:2091: 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 2083 "configure"
+#line 2096 "configure"
#include "confdefs.h"
#ifdef __GNUC__
@@ -2107,7 +2120,7 @@ int main() {
char *p = (char *) alloca(1);
; return 0; }
EOF
-if { (eval echo configure:2111: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2124: \"$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
@@ -2139,12 +2152,12 @@ EOF
echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-echo "configure:2143: checking whether alloca needs Cray hooks" >&5
+echo "configure:2156: 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 2148 "configure"
+#line 2161 "configure"
#include "confdefs.h"
#if defined(CRAY) && ! defined(CRAY2)
webecray
@@ -2169,12 +2182,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:2173: checking for $ac_func" >&5
+echo "configure:2186: 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 2178 "configure"
+#line 2191 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -2197,7 +2210,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:2201: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2214: \"$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
@@ -2224,7 +2237,7 @@ done
fi
echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-echo "configure:2228: checking stack direction for C alloca" >&5
+echo "configure:2241: 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
@@ -2232,7 +2245,7 @@ else
ac_cv_c_stack_direction=0
else
cat > conftest.$ac_ext <<EOF
-#line 2236 "configure"
+#line 2249 "configure"
#include "confdefs.h"
find_stack_direction ()
{
@@ -2251,7 +2264,7 @@ main ()
exit (find_stack_direction() < 0);
}
EOF
-if { (eval echo configure:2255: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2268: \"$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
@@ -2276,12 +2289,12 @@ fi
esac
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:2280: checking for ANSI C header files" >&5
+echo "configure:2293: 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 2285 "configure"
+#line 2298 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
@@ -2289,7 +2302,7 @@ else
#include <float.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2293: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2306: \"$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*
@@ -2306,7 +2319,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 2310 "configure"
+#line 2323 "configure"
#include "confdefs.h"
#include <string.h>
EOF
@@ -2324,7 +2337,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 2328 "configure"
+#line 2341 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
@@ -2345,7 +2358,7 @@ if test "$cross_compiling" = yes; then
:
else
cat > conftest.$ac_ext <<EOF
-#line 2349 "configure"
+#line 2362 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -2356,7 +2369,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); }
EOF
-if { (eval echo configure:2360: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2373: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
:
else
@@ -2380,12 +2393,12 @@ EOF
fi
echo $ac_n "checking for pid_t""... $ac_c" 1>&6
-echo "configure:2384: checking for pid_t" >&5
+echo "configure:2397: 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 2389 "configure"
+#line 2402 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -2414,17 +2427,17 @@ fi
ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for vfork.h""... $ac_c" 1>&6
-echo "configure:2418: checking for vfork.h" >&5
+echo "configure:2431: 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 2423 "configure"
+#line 2436 "configure"
#include "confdefs.h"
#include <vfork.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2428: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2441: \"$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*
@@ -2449,18 +2462,18 @@ else
fi
echo $ac_n "checking for working vfork""... $ac_c" 1>&6
-echo "configure:2453: checking for working vfork" >&5
+echo "configure:2466: 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:2459: checking for vfork" >&5
+echo "configure:2472: 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 2464 "configure"
+#line 2477 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char vfork(); below. */
@@ -2483,7 +2496,7 @@ vfork();
; return 0; }
EOF
-if { (eval echo configure:2487: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2500: \"$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
@@ -2505,7 +2518,7 @@ fi
ac_cv_func_vfork_works=$ac_cv_func_vfork
else
cat > conftest.$ac_ext <<EOF
-#line 2509 "configure"
+#line 2522 "configure"
#include "confdefs.h"
/* Thanks to Paul Eggert for this test. */
#include <stdio.h>
@@ -2600,7 +2613,7 @@ main() {
}
}
EOF
-if { (eval echo configure:2604: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2617: \"$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
@@ -2627,19 +2640,19 @@ fi
fi
for v in $vars; do
echo $ac_n "checking for $v""... $ac_c" 1>&6
-echo "configure:2631: checking for $v" >&5
+echo "configure:2644: checking for $v" >&5
if eval "test \"`echo '$''{'libiberty_cv_var_$v'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2636 "configure"
+#line 2649 "configure"
#include "confdefs.h"
int *p;
int main() {
-extern int $v; p = &$v;
+extern int $v []; p = &$v;
; return 0; }
EOF
-if { (eval echo configure:2643: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2656: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "libiberty_cv_var_$v=yes"
else
@@ -2665,12 +2678,12 @@ EOF
for ac_func in $checkfuncs
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2669: checking for $ac_func" >&5
+echo "configure:2682: 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 2674 "configure"
+#line 2687 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -2693,7 +2706,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:2697: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2710: \"$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
@@ -2723,17 +2736,17 @@ for ac_hdr in unistd.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2727: checking for $ac_hdr" >&5
+echo "configure:2740: 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 2732 "configure"
+#line 2745 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2737: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2750: \"$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*
@@ -2762,12 +2775,12 @@ done
for ac_func in getpagesize
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2766: checking for $ac_func" >&5
+echo "configure:2779: 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 2771 "configure"
+#line 2784 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -2790,7 +2803,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:2794: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2807: \"$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
@@ -2815,7 +2828,7 @@ fi
done
echo $ac_n "checking for working mmap""... $ac_c" 1>&6
-echo "configure:2819: checking for working mmap" >&5
+echo "configure:2832: checking for working mmap" >&5
if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2823,7 +2836,7 @@ else
ac_cv_func_mmap_fixed_mapped=no
else
cat > conftest.$ac_ext <<EOF
-#line 2827 "configure"
+#line 2840 "configure"
#include "confdefs.h"
/* Thanks to Mike Haertel and Jim Avera for this test.
@@ -2963,7 +2976,7 @@ main()
}
EOF
-if { (eval echo configure:2967: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2980: \"$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
@@ -2987,7 +3000,7 @@ fi
echo $ac_n "checking for working strncmp""... $ac_c" 1>&6
-echo "configure:2991: checking for working strncmp" >&5
+echo "configure:3004: 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
@@ -2995,7 +3008,7 @@ else
ac_cv_func_strncmp_works=no
else
cat > conftest.$ac_ext <<EOF
-#line 2999 "configure"
+#line 3012 "configure"
#include "confdefs.h"
/* Test by Jim Wilson and Kaveh Ghazi.
@@ -3056,7 +3069,7 @@ main ()
}
EOF
-if { (eval echo configure:3060: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3073: \"$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 af80e0dd2d2..664a97ced02 100644
--- a/libiberty/configure.in
+++ b/libiberty/configure.in
@@ -191,6 +191,13 @@ fi
AC_SUBST(CHECK)
+case "${host}" in
+ *-*-cygwin*)
+ AC_DEFINE(HAVE_SYS_ERRLIST)
+ AC_DEFINE(HAVE_SYS_NERR)
+ ;;
+esac
+
if test -z "${setobjs}"; then
case "${host}" in
@@ -306,7 +313,7 @@ EOF
for v in $vars; do
AC_MSG_CHECKING([for $v])
AC_CACHE_VAL(libiberty_cv_var_$v,
- [AC_TRY_LINK([int *p;], [extern int $v; p = &$v;],
+ [AC_TRY_LINK([int *p;], [extern int $v []; p = &$v;],
[eval "libiberty_cv_var_$v=yes"],
[eval "libiberty_cv_var_$v=no"])])
if eval "test \"`echo '$libiberty_cv_var_'$v`\" = yes"; then
diff --git a/libiberty/cp-demangle.c b/libiberty/cp-demangle.c
index db34b58b1c5..b702ecac901 100644
--- a/libiberty/cp-demangle.c
+++ b/libiberty/cp-demangle.c
@@ -172,6 +172,15 @@ struct demangling_def
/* Language style to use for demangled output. */
int style;
+
+ /* Set to non-zero iff this name is a constructor. The actual value
+ indicates what sort of constructor this is; see demangle.h. */
+ enum gnu_v3_ctor_kinds is_constructor;
+
+ /* Set to non-zero iff this name is a destructor. The actual value
+ indicates what sort of destructor this is; see demangle.h. */
+ enum gnu_v3_dtor_kinds is_destructor;
+
};
typedef struct demangling_def *demangling_t;
@@ -815,6 +824,8 @@ demangling_new (name, style)
return NULL;
}
dm->style = style;
+ dm->is_constructor = 0;
+ dm->is_destructor = 0;
return dm;
}
@@ -2018,15 +2029,24 @@ demangle_ctor_dtor_name (dm)
{
/* A constructor name. Consume the C. */
advance_char (dm);
- if (peek_char (dm) < '1' || peek_char (dm) > '3')
+ flavor = next_char (dm);
+ if (flavor < '1' || flavor > '3')
return "Unrecognized constructor.";
RETURN_IF_ERROR (result_add_string (dm, dm->last_source_name));
+ switch (flavor)
+ {
+ case '1': dm->is_constructor = gnu_v3_complete_object_ctor;
+ break;
+ case '2': dm->is_constructor = gnu_v3_base_object_ctor;
+ break;
+ case '3': dm->is_constructor = gnu_v3_complete_object_allocating_ctor;
+ break;
+ }
/* Print the flavor of the constructor if in verbose mode. */
- flavor = next_char (dm) - '1';
if (flag_verbose)
{
RETURN_IF_ERROR (result_add (dm, "["));
- RETURN_IF_ERROR (result_add (dm, ctor_flavors[flavor]));
+ RETURN_IF_ERROR (result_add (dm, ctor_flavors[flavor - '1']));
RETURN_IF_ERROR (result_add_char (dm, ']'));
}
}
@@ -2034,16 +2054,25 @@ demangle_ctor_dtor_name (dm)
{
/* A destructor name. Consume the D. */
advance_char (dm);
- if (peek_char (dm) < '0' || peek_char (dm) > '2')
+ flavor = next_char (dm);
+ if (flavor < '0' || flavor > '2')
return "Unrecognized destructor.";
RETURN_IF_ERROR (result_add_char (dm, '~'));
RETURN_IF_ERROR (result_add_string (dm, dm->last_source_name));
+ switch (flavor)
+ {
+ case '0': dm->is_destructor = gnu_v3_deleting_dtor;
+ break;
+ case '1': dm->is_destructor = gnu_v3_complete_object_dtor;
+ break;
+ case '2': dm->is_destructor = gnu_v3_base_object_dtor;
+ break;
+ }
/* Print the flavor of the destructor if in verbose mode. */
- flavor = next_char (dm) - '0';
if (flag_verbose)
{
RETURN_IF_ERROR (result_add (dm, " ["));
- RETURN_IF_ERROR (result_add (dm, dtor_flavors[flavor]));
+ RETURN_IF_ERROR (result_add (dm, dtor_flavors[flavor - '0']));
RETURN_IF_ERROR (result_add_char (dm, ']'));
}
}
@@ -3417,15 +3446,11 @@ demangle_discriminator (dm, suppress_first)
/* Write the discriminator. The mangled number is two
less than the discriminator ordinal, counting from
zero. */
- RETURN_IF_ERROR (int_to_dyn_string (discriminator + 2,
+ RETURN_IF_ERROR (int_to_dyn_string (discriminator + 1,
(dyn_string_t) dm->result));
}
else
- {
- if (flag_verbose)
- /* A missing digit correspond to one. */
- RETURN_IF_ERROR (result_add_char (dm, '1'));
- }
+ return STATUS_ERROR;
if (flag_verbose)
RETURN_IF_ERROR (result_add_char (dm, ']'));
}
@@ -3789,6 +3814,88 @@ java_demangle_v3 (mangled)
#endif /* IN_LIBGCC2 */
+
+/* Demangle NAME in the G++ V3 ABI demangling style, and return either
+ zero, indicating that some error occurred, or a demangling_t
+ holding the results. */
+static demangling_t
+demangle_v3_with_details (name)
+ const char *name;
+{
+ demangling_t dm;
+ status_t status;
+
+ if (strncmp (name, "_Z", 2))
+ return 0;
+
+ dm = demangling_new (name, DMGL_GNU_V3);
+ if (dm == NULL)
+ {
+ fprintf (stderr, "Memory allocation failed.\n");
+ abort ();
+ }
+
+ status = result_push (dm);
+ if (! STATUS_NO_ERROR (status))
+ {
+ demangling_delete (dm);
+ fprintf (stderr, "%s\n", status);
+ abort ();
+ }
+
+ status = demangle_mangled_name (dm);
+ if (STATUS_NO_ERROR (status))
+ return dm;
+
+ demangling_delete (dm);
+ return 0;
+}
+
+
+/* Return non-zero iff NAME is the mangled form of a constructor name
+ in the G++ V3 ABI demangling style. Specifically, return:
+ - '1' if NAME is a complete object constructor,
+ - '2' if NAME is a base object constructor, or
+ - '3' if NAME is a complete object allocating constructor. */
+enum gnu_v3_ctor_kinds
+is_gnu_v3_mangled_ctor (name)
+ const char *name;
+{
+ demangling_t dm = demangle_v3_with_details (name);
+
+ if (dm)
+ {
+ enum gnu_v3_ctor_kinds result = dm->is_constructor;
+ demangling_delete (dm);
+ return result;
+ }
+ else
+ return 0;
+}
+
+
+/* Return non-zero iff NAME is the mangled form of a destructor name
+ in the G++ V3 ABI demangling style. Specifically, return:
+ - '0' if NAME is a deleting destructor,
+ - '1' if NAME is a complete object destructor, or
+ - '2' if NAME is a base object destructor. */
+enum gnu_v3_dtor_kinds
+is_gnu_v3_mangled_dtor (name)
+ const char *name;
+{
+ demangling_t dm = demangle_v3_with_details (name);
+
+ if (dm)
+ {
+ enum gnu_v3_dtor_kinds result = dm->is_destructor;
+ demangling_delete (dm);
+ return result;
+ }
+ else
+ return 0;
+}
+
+
#ifdef STANDALONE_DEMANGLER
#include "getopt.h"
diff --git a/libiberty/cplus-dem.c b/libiberty/cplus-dem.c
index d49ec7c7e1d..edbb4d09984 100644
--- a/libiberty/cplus-dem.c
+++ b/libiberty/cplus-dem.c
@@ -568,6 +568,9 @@ consume_count (type)
(*type)++;
}
+ if (count < 0)
+ count = -1;
+
return (count);
}
@@ -5050,7 +5053,7 @@ main (argc, argv)
char *result;
int c;
const char *valid_symbols;
- enum demangling_styles style;
+ enum demangling_styles style = auto_demangling;
program_name = argv[0];
@@ -5148,7 +5151,7 @@ main (argc, argv)
skip_first = i;
mbuffer[i] = 0;
- flags |= style;
+ flags |= (int) style;
result = cplus_demangle (mbuffer + skip_first, flags);
if (result)
{
diff --git a/libiberty/hashtab.c b/libiberty/hashtab.c
index 122ed43e128..274ad9ec207 100644
--- a/libiberty/hashtab.c
+++ b/libiberty/hashtab.c
@@ -1,5 +1,5 @@
/* An expandable hash tables datatype.
- Copyright (C) 1999, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
Contributed by Vladimir Makarov (vmakarov@cygnus.com).
This file is part of the libiberty library.
@@ -81,37 +81,38 @@ higher_prime_number (n)
/* These are primes that are near, but slightly smaller than, a
power of two. */
static unsigned long primes[] = {
- 2,
- 7,
- 13,
- 31,
- 61,
- 127,
- 251,
- 509,
- 1021,
- 2039,
- 4093,
- 8191,
- 16381,
- 32749,
- 65521,
- 131071,
- 262139,
- 524287,
- 1048573,
- 2097143,
- 4194301,
- 8388593,
- 16777213,
- 33554393,
- 67108859,
- 134217689,
- 268435399,
- 536870909,
- 1073741789,
- 2147483647,
- 4294967291
+ (unsigned long) 2,
+ (unsigned long) 7,
+ (unsigned long) 13,
+ (unsigned long) 31,
+ (unsigned long) 61,
+ (unsigned long) 127,
+ (unsigned long) 251,
+ (unsigned long) 509,
+ (unsigned long) 1021,
+ (unsigned long) 2039,
+ (unsigned long) 4093,
+ (unsigned long) 8191,
+ (unsigned long) 16381,
+ (unsigned long) 32749,
+ (unsigned long) 65521,
+ (unsigned long) 131071,
+ (unsigned long) 262139,
+ (unsigned long) 524287,
+ (unsigned long) 1048573,
+ (unsigned long) 2097143,
+ (unsigned long) 4194301,
+ (unsigned long) 8388593,
+ (unsigned long) 16777213,
+ (unsigned long) 33554393,
+ (unsigned long) 67108859,
+ (unsigned long) 134217689,
+ (unsigned long) 268435399,
+ (unsigned long) 536870909,
+ (unsigned long) 1073741789,
+ (unsigned long) 2147483647,
+ /* 4294967291L */
+ ((unsigned long) 2147483647) + ((unsigned long) 2147483644),
};
unsigned long* low = &primes[0];
diff --git a/libiberty/lbasename.c b/libiberty/lbasename.c
new file mode 100644
index 00000000000..7f870497c4f
--- /dev/null
+++ b/libiberty/lbasename.c
@@ -0,0 +1,89 @@
+/* Libiberty basename. Like basename, but is not overridden by the
+ system C library.
+ Copyright (C) 2001 Free Software Foundation, Inc.
+
+This file is part of the libiberty library.
+Libiberty is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public
+License as published by the Free Software Foundation; either
+version 2 of the License, or (at your option) any later version.
+
+Libiberty 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
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+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. */
+
+/*
+NAME
+ lbasename -- return pointer to last component of a pathname
+
+SYNOPSIS
+ char *lbasename (const char *name)
+
+DESCRIPTION
+ Given a pointer to a string containing a typical pathname
+ (/usr/src/cmd/ls/ls.c for example), returns a pointer to the
+ last component of the pathname ("ls.c" in this case). The
+ returned pointer is guaranteed to lie within the original
+ string. This latter fact is not true of many vendor C
+ libraries, which return special strings or modify the passed
+ strings for particular input.
+
+ In particular, the empty string returns the same empty string,
+ and a path ending in '/' returns the empty string after it.
+*/
+
+#include "ansidecl.h"
+#include "libiberty.h"
+#include "safe-ctype.h"
+
+#ifndef DIR_SEPARATOR
+# define DIR_SEPARATOR '/'
+#endif
+
+#if defined (_WIN32) || defined (__MSDOS__) \
+ || defined (__DJGPP__) || defined (__OS2__)
+# define HAVE_DOS_BASED_FILE_SYSTEM
+# ifndef DIR_SEPARATOR_2
+# define DIR_SEPARATOR_2 '\\'
+# endif
+#endif
+
+/* Define IS_DIR_SEPARATOR. VMS uses '::', ':', '[...]' and '<...>' to
+ separate the different components of a file specification. It's a
+ bit of a stretch to call ':', ']' and '>' directory separators, so
+ just define the test to find the file name component. */
+#ifdef VMS
+# define IS_DIR_SEPARATOR(ch) ((ch) == ':' || (ch) == ']' || (ch) == '>')
+#else
+# ifndef DIR_SEPARATOR_2
+# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
+# else
+# define IS_DIR_SEPARATOR(ch) \
+ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
+# endif
+#endif
+
+char *
+lbasename (name)
+ const char *name;
+{
+ const char *base;
+
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+ /* Skip over a possible disk name. */
+ if (ISALPHA (name[0]) && name[1] == ':')
+ name += 2;
+#endif
+
+ for (base = name; *name; name++)
+ if (IS_DIR_SEPARATOR (*name))
+ base = name + 1;
+
+ return (char *) base;
+}
diff --git a/libiberty/memchr.c b/libiberty/memchr.c
index cce30039437..89aa98f1d94 100644
--- a/libiberty/memchr.c
+++ b/libiberty/memchr.c
@@ -50,7 +50,7 @@ memchr (src_void, c, length)
{
const unsigned char *src = (const unsigned char *)src_void;
- while (--length >= 0)
+ while (length-- > 0)
{
if (*src == c)
return (PTR)src;
diff --git a/libiberty/splay-tree.c b/libiberty/splay-tree.c
index 52b57c088a7..a7123952671 100644
--- a/libiberty/splay-tree.c
+++ b/libiberty/splay-tree.c
@@ -1,5 +1,5 @@
/* A splay-tree datatype.
- Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
Contributed by Mark Mitchell (mark@markmitchell.com).
This file is part of GNU CC.
@@ -368,6 +368,40 @@ splay_tree_lookup (sp, key)
return 0;
}
+/* Return the node in SP with the greatest key. */
+
+splay_tree_node
+splay_tree_max (sp)
+ splay_tree sp;
+{
+ splay_tree_node n = sp->root;
+
+ if (!n)
+ return NULL;
+
+ while (n->right)
+ n = n->right;
+
+ return n;
+}
+
+/* Return the node in SP with the smallest key. */
+
+splay_tree_node
+splay_tree_min (sp)
+ splay_tree sp;
+{
+ splay_tree_node n = sp->root;
+
+ if (!n)
+ return NULL;
+
+ while (n->left)
+ n = n->left;
+
+ return n;
+}
+
/* Return the immediate predecessor KEY, or NULL if there is no
predecessor. KEY need not be present in the tree. */
diff --git a/libiberty/strerror.c b/libiberty/strerror.c
index 0dd2220cd73..ba837e32332 100644
--- a/libiberty/strerror.c
+++ b/libiberty/strerror.c
@@ -13,6 +13,7 @@
incompatible with our later declaration, perhaps by using const
attributes. So we hide the declaration in errno.h (if any) using a
macro. */
+#define sys_nerr sys_nerr__
#define sys_errlist sys_errlist__
#endif
@@ -20,6 +21,7 @@
#include <errno.h>
#ifdef HAVE_SYS_ERRLIST
+#undef sys_nerr
#undef sys_errlist
#endif
diff --git a/libiberty/strsignal.c b/libiberty/strsignal.c
index 5625323b71b..2533adce297 100644
--- a/libiberty/strsignal.c
+++ b/libiberty/strsignal.c
@@ -17,6 +17,7 @@
ignore any declaration in the system header files, and always
declare it ourselves. With luck, this will always work. */
#define sys_siglist no_such_symbol
+#define sys_nsig sys_nsig__no_such_symbol
#include <stdio.h>
#include <signal.h>
@@ -38,6 +39,7 @@ extern PTR memset ();
/* Undefine the macro we used to hide the definition of sys_siglist
found in the system header files. */
#undef sys_siglist
+#undef sys_nsig
#ifndef NULL
# ifdef __STDC__
diff --git a/libiberty/testsuite/demangle-expected b/libiberty/testsuite/demangle-expected
index 4953c7d1103..3a828472de1 100644
--- a/libiberty/testsuite/demangle-expected
+++ b/libiberty/testsuite/demangle-expected
@@ -2586,3 +2586,7 @@ JArray.t(JArray[])
--format=java
_ZN4Prim1iEibcdfwPN4java4lang6StringEsx
Prim.i(int, boolean, byte, double, float, char, java.lang.String, short, long)
+#
+--format=hp
+_Utf58_0_1__1_2147483647__2147483648
+_Utf58_0_1__1_2147483647__2147483648
diff --git a/libjava/ChangeLog b/libjava/ChangeLog
index 93a23bce13d..c55298233ed 100644
--- a/libjava/ChangeLog
+++ b/libjava/ChangeLog
@@ -1,3 +1,998 @@
+2002-02-20 Release Manager
+
+ * GCC 3.0.4 Released.
+
+2001-12-20 Release Manager
+
+ * GCC 3.0.3 Released.
+
+2001-11-23 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * configure: Regenerate.
+ Fixes PR bootstrap/4116.
+
+2001-09-17 Andreas Jaeger <aj@suse.de>
+
+ * jni.cc (array_from_valist): Use promoted types for va_arg.
+
+2001-10-23 Release Manager
+
+ * GCC 3.0.2 Released.
+
+2001-10-16 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
+
+ * name-finder.cc (_Jv_name_finder::lookup): Check for NULL dli_sname
+ and dli_fname.
+
+2001-10-03 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
+
+ * resolve.cc (_Jv_PrepareClass): Fix typos in vtable layout.
+
+2001-09-30 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
+
+ * java/lang/natClass.cc (_Jv_IsAssignableFrom): Handle the case of
+ an uninitialized target class. Revert patch of 2001-07-18.
+
+2001-08-17 Tom Tromey <tromey@redhat.com>
+
+ * gnu/gcj/convert/IOConverter.java: Add `646' alias.
+
+2001-06-15 Tom Tromey <tromey@redhat.com>
+
+ * jni.cc (_Jv_JNI_NewLocalRef): Search other frames.
+
+2001-05-03 Tom Tromey <tromey@redhat.com>
+
+ * java/lang/natRuntime.cc (init): Call add_library on the program
+ itself.
+ (_Jv_FindSymbolInExecutable): Return NULL if no library on the
+ list has the symbol.
+
+2001-09-21 Richard Henderson <rth@redhat.com>
+
+ * include/jvm.h (_Jv_VTable): Handle function descriptors for ia64;
+ add get_method, set_method, vtable_elt_size, new_vtable.
+ (_Jv_ArrayVTable): Derive from _Jv_VTable.
+ * resolve.cc (_Jv_PrepareClass): Use new _Jv_VTable methods.
+ * interpret.cc (_Jv_InterpMethod::continue1): Likewise.
+ * java/lang/natClassLoader.cc (_Jv_NewArrayClass): Likewise.
+
+2001-09-17 Jeff Sturm <jsturm@one-point.com>
+
+ * gnu/gcj/convert/UnicodeToBytes.java (write): Write work buffer
+ starting from zero offset.
+
+2001-08-19 Release Manager
+
+ * GCC 3.0.1 Released.
+
+2001-08-19 Release Manager
+
+ * GCC 3.0.1 Released.
+
+2001-08-01 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * include/posix.h (_POSIX_PII_SOCKET): Define.
+ * configure.in (HAVE_SOCKLEN_T): Define.
+ * java/net/natPlainSocketImpl.cc [!HAVE_SOCKLEN_T]: Move socklen_t
+ definition up.
+ (_JV_accept): New function, avoids Tru64 UNIX accept macro.
+ (java::net::PlainSocketImpl::accept): Use it.
+ Fixes PRs libgcj/3694, libgcj/3696.
+
+ * configure.in (HAVE_STRUCT_IPV6_MREQ): New test.
+ * acconfig.h (HAVE_STRUCT_IPV6_MREQ): Provide template.
+ * configure, include/config.h.in: Regenerate.
+ * java/net/natPlainDatagramSocketImpl.cc (union McastReq): Use it.
+ (mcastGrp): Likewise.
+ (java::net::PlainDatagramSocketImpl::setOption): Guard against
+ missing IPV6_MULTICAST_IF.
+ Fixes PR libgcj/3694.
+
+2001-07-31 Christian Iseli <chris@ludwig-alpha.unil.ch>
+
+ * Makefile.in: Rebuilt.
+ * Makefile.am (GCJLINK): Added --tag=GCJ.
+ (LIBLINK): Likewise.
+
+2001-07-29 Mark Wielaard <mark@klomp.org>
+
+ * HACKING: New documentation file.
+
+2001-07-24 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * gnu/gcj/runtime/natFirstThread.cc (_JNI_OnLoad): New function.
+ (JNI_OnLoad): Use it.
+ (gnu::gcj::runtime::FirstThread::run): Check for _JNI_OnLoad, not
+ NULL.
+
+2001-07-24 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * Makefile.am (AM_MAKEFLAGS): Pass RUNTESTFLAGS.
+ Makefile.in: Regenerate.
+
+2001-07-18 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * java/net/natPlainDatagramSocketImpl.cc (mcastGrp): Use new RFC
+ 2533 socket options IPV6_JOIN_GROUP, IPV6_LEAVE_GROUP, falling
+ back to old RFC 2133 variants if missing.
+
+2001-07-18 Tom Tromey <tromey@redhat.com>
+
+ * java/io/natFileWin32.cc (_access): Renamed.
+ (_stat): Likewise.
+ * java/io/natFile.cc (_access): Renamed.
+ (_stat): Likewise.
+ * java/io/File.java (access, stat): Add leading `_' to name.
+ Updated all callers.
+
+2001-07-18 Martin Kahlert <martin.kahlert@infineon.com>
+
+ * java/lang/natClass.cc: Move calls of _Jv_InitClass from
+ java::lang::Class::isAssignableFrom and java::lang::Class::isInstance
+ into _Jv_IsAssignableFrom
+
+2001-07-18 Tom Tromey <tromey@redhat.com>
+
+ For PR java/2812:
+ * libgcj.spec.in (*lib): Added LIBICONV.
+ * Makefile.am (GCJLINK): Added ICONV_LDFLAGS.
+ (LIBLINK): Likewise.
+ * configure: Rebuilt.
+ * configure.in: Call AM_ICONV. Don't check for iconv function.
+ * acinclude.m4 (AM_ICONV): New macro, from Bruno Haible. Then
+ modified to generate ICONV_LDFLAGS.
+
+2001-07-05 Tom Tromey <tromey@redhat.com>
+
+ For PR java/3562:
+ * java/lang/Class.h (Class(void)): Now private. Removed
+ implementation. From dmorsberger@sensysdl.com.
+
+2001-07-02 Tom Tromey <tromey@redhat.com>
+
+ Fix for PR bootstrap/3281:
+ * aclocal.m4, configure: Rebuilt.
+ * acinclude.m4 (LIBGCJ_CONFIGURE): Don't set libgcj_flagbasedir.
+ Correctly compute libgcj_basedir.
+ (mkinstalldirs): Define and subst.
+
+2001-07-02 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * configure.in (test for eh model): Fixed typo.
+ * configure: Rebuilt.
+
+20010617 Release Manager
+
+ * GCC 3.0 Released.
+
+2001-06-13 Tom Tromey <tromey@redhat.com>
+
+ * configure.host: Don't use -fno-use-divide-subroutine on x86.
+
+2001-06-12 Tom Tromey <tromey@redhat.com>
+
+ * aclocal.m4, configure: Rebuilt.
+ * acinclude.m4: Find configure.host in srcdir.
+
+2001-06-10 Alexandre Petit-Bianco <apbianco@redhat.com>
+
+ * exception.cc (cstdlib): Replaces stdlib.h.
+ (_Jv_Throw): Use std::abort().
+ (PERSONALITY_FUNCTION): Likewise.
+
+2001-06-08 Tom Tromey <tromey@redhat.com>
+
+ * configure: Rebuilt.
+ * configure.in: Compute new aux dir using `pwd'.
+
+2001-06-07 Tom Tromey <tromey@redhat.com>
+
+ For PR bootstrap/3075:
+ * configure, aclocal.m4, Makefile.am: Rebuilt.
+ * configure.in: Pass `--with-auxdir' to subdir configure. Don't
+ call AC_CONFIG_AUX_DIR or AC_CANONICAL_SYSTEM. Look for unwind.h
+ relative to libgcj_basedir.
+ * acinclude.m4 ((LIBGCJ_CONFIGURE): Call AC_CONFIG_AUX_DIR and
+ AC_CANONICAL_SYSTEM here.
+ * Makefile.am (CONFIG_STATUS_DEPENDENCIES): Use srcdir, not
+ libgcj_basedir.
+ ($(extra_headers)): New target.
+
+2001-05-31 Martin Kahlert <martin.kahlert@infineon.com>
+ Bryce McKinlay <bryce@waitaki.otago.ac.nz>
+
+ * java/lang/natClass.cc (_Jv_IsAssignableFrom): Ensure that ancestors
+ table index is within allowed bounds. Ensure that we dont try to access
+ class itable at a negative offset. Avoid an ancestor table lookup if
+ source is a primitive type class.
+ (isInstance): Remove redundant isPrimitive() check.
+
+2001-05-31 Jeff Sturm <jsturm@one-point.com>
+
+ * natFile.cc (get_entry): Removed functions.
+ (performList): Call readdir or readdir_r if HAVE_READDIR_R defined.
+ Allocate enough storage for d_name if using readdir_r.
+
+2001-05-30 Tom Tromey <tromey@redhat.com>
+
+ * Makefile.in: Rebuilt.
+ * Makefile.am: Removed erroneous patch.
+
+2001-05-29 Tom Tromey <tromey@redhat.com>
+
+ * Makefile.in: Rebuilt.
+ * Makefile.am (AM_CXXFLAGS): Remove -fvtable-thunks.
+
+2001-05-29 Andrew Haley <aph@redhat.com>
+
+ * include/i386-signal.h (MAKE_THROW_FRAME): Don't fix up frame
+ pointer: the dwarf unwinder in libgcc will do everything that's
+ needed.
+ (HANDLE_DIVIDE_OVERFLOW): Tidy. Don't mess with stack frames any
+ more than we absolutely need to.
+ * configure.host (EXCEPTIONSPEC): Remove libgcj_sjlj on Alpha.
+ * configure.in (SIGNAL_HANDLER): Use include/dwarf2-signal.h on
+ Alpha.
+ (SIGNAL_HANDLER): Test "$enable_sjlj_exceptions", not
+ "$libgcj_sjlj".
+ * configure: Rebuilt.
+ * include/dwarf2-signal.h (MAKE_THROW_FRAME): Adjust PC
+ for Alpha.
+ (SIGNAL_HANDLER): Use siginfo style handler.
+ (INIT_SEGV): Likewise.
+ (INIT_FPE): Likewise.
+ * include/ppc-signal.h: Delete whole file.
+
+2001-05-23 Jeff Sturm <jsturm@one-point.com>
+
+ * java/net/natPlainDatagramSocketImpl.cc: Undefine bind if defined.
+ (_Jv_bind): New static function.
+ (bind): Use _Jv_bind.
+ * java/net/natPlainSocketImpl.cc: Undefine bind, connect if defined.
+ (_Jv_bind, _Jv_connect): New static functions.
+ (bind): Use _Jv_bind.
+ (connect): Use _Jv_connect.
+
+2001-05-23 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * gij.cc (version): Update copyright year.
+
+2001-05-22 Anthony Green <green@redhat.com>
+
+ * configure: Rebuilt.
+ * configure.in: Tweak canadian cross test, and don't redefine GCJ
+ for cross builds.
+
+2001-05-21 Andrew Haley <aph@cambridge.redhat.com>
+
+ * configure.host (EXCEPTIONSPEC): Revert broken patch that removed
+ sjlj on Alpha.
+
+2001-05-21 Andrew Haley <aph@cambridge.redhat.com>
+
+ * include/dwarf2-signal.h: Correct copyright date.
+
+2001-05-18 Andrew Haley <aph@cambridge.redhat.com>
+
+ * include/dwarf2-signal.h: New file.
+ * configure.in (SYSDEP_SOURCES): Add dwarf2-signal.h for PPC.
+ * configure.host (EXCEPTIONSPEC): Don't use sjlj on PPC.
+ * configure: Rebuilt.
+
+2001-05-19 Bryce McKinlay <bryce@albatross.co.nz>
+
+ * include/jvm.h: Move "#pragma GCC java_exceptions" to ...
+ * gcj/javaprims.h: ... here.
+ * gnu/gcj/io/shs.cc: Add "#pragma GCC java_exceptions".
+
+2001-05-19 Zack Weinberg <zackw@stanford.edu>
+
+ * Makefile.am (libgcj_la_OBJECTS): Remove libsupc++convenience.la.
+ * Makefile.in: Regenerate (by hand).
+ * include/jvm.h: Add #pragma GCC java_exceptions at top of file.
+ * doc/cni.sgml: Document #pragma GCC java_exceptions.
+
+ * prims.cc (_Jv_ThisExecutable): Use _Jv_Malloc.
+ * posix-threads.cc (_Jv_ThreadInitData): Use _Jv_Malloc.
+ (_Jv_ThreadDestroyData): Use _Jv_Free.
+ * java/lang/natClassLoader.cc (_Jv_RegisterInitiatingLoader):
+ Use _Jv_Malloc.
+
+2001-05-18 Alexandre Petit-Bianco <apbianco@redhat.com>
+
+ * include/posix-threads.h (_Jv_CondInit): `0' used in place of `NULL.'
+ (_Jv_MutexInit): Likewise.
+
+2001-05-17 Martin Kahlert <martin.kahlert@infineon.com>
+
+ * java/lang/natClass.cc (_Jv_FindIIndex): Fix an off by one error
+ with length of ioffset table.
+ (_Jv_IsAssignableFrom): Likewise.
+
+2001-05-17 Per Bothner <per@bothner.com>
+
+ * Makefile.am (ZIP): The "fastjar" binary is now plain "jar".
+
+2001-05-14 Andrew Haley <aph@cambridge.redhat.com>
+
+ * libgcj.spec.in (jc1): Add EXCEPTIONSPEC.
+ * configure.host (EXCEPTIONSPEC): New.
+ * configure.in (EXCEPTIONSPEC): New.
+ * configure: Rebuilt.
+
+2001-05-12 Richard Henderson <rth@redhat.com>
+
+ EH merge from mainline:
+
+ 2001-05-11 Richard Henderson <rth@redhat.com>
+ * configure.in (ia64-*): Don't set SYSDEP_SOURCES.
+ * java/lang/natThrowable.cc: Don't use __ia64_backtrace.
+
+ 2001-05-11 Richard Henderson <rth@redhat.com>
+ * exception.cc: Include unwind-pe.h. Remove all pointer
+ encoding logic.
+
+ 2001-04-02 Richard Henderson <rth@redhat.com>
+ * configure.in (GCC_UNWIND_INCLUDE): Assume we're built within
+ the same tree as gcc.
+ * configure: Rebuilt.
+
+ * exception.cc (_Jv_Throw): Clarify commentary.
+
+ 2001-03-28 Richard Henderson <rth@redhat.com>
+ * Makefile.am (GCC_UNWIND_INCLUDE): Rename from EH_COMMON_INCLUDE.
+ (AM_CXXFLAGS): -fnon-call-exceptions not -fasynchronous-exceptions.
+ Remove EXCEPTIONSPEC.
+ * configure.host (libgcj_sjlj): Remove.
+ * configure.in (EXCEPTIONSPEC): Remove.
+ (enable-sjlj-exceptions): Detect if not specified.
+ (GCC_UNWIND_INCLUDE): Rename from EH_COMMON_INCLUDE; change
+ what header we're looking for.
+ * libgcj.spec.in (jc1): Remove EXCEPTIONSPEC.
+ * Makefile.in, configure: Regenerate.
+ * exception.cc: Don't declare libgcc2 stuff.
+ (java_eh_info, _Jv_type_matcher, _Jv_exception_info): Remove.
+ (_Jv_eh_alloc, _Jv_eh_free, _Jv_setup_eh_info): Remove.
+ (win32_get_restart_frame): Remove.
+ (struct java_exception_header): New.
+ (__gcj_exception_class): New.
+ (get_exception_header_from_ue): New.
+ (_Jv_Throw): Rewrite for IA-64 ABI unwind routines.
+ (size_of_encoded_value, read_encoded_value): New.
+ (read_uleb128, read_sleb128, parse_lsda_header): New.
+ (get_ttype_entry, __gcj_personality_sj0): New.
+ * gcj/javaprims.h (_Jv_Sjlj_Throw): Remove.
+
+2001-05-06 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
+
+ * gcj/javaprims.h: Rebuild CNI namespace.
+
+2001-05-06 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
+
+ * java/lang/Class.h (_Jv_Self): New union type.
+ (Class): Manipulate vtable pointer via _Jv_Self union. Thanks to
+ Jeff Sturm and Fergus Henderson.
+
+2001-05-06 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
+
+ Fix PR libgcj/2237:
+ * java/io/ObjectStreamClass.java (setClass): Calculate
+ serialVersionUID for local class and compare it against the UID
+ from the Object Stream. Throw InvalidClassException upon mismatch.
+ (setUID): Renamed to...
+ (getClassUID): this. Return the calculated class UID rather than
+ setting uid field directly.
+ (getDefinedSUID): Removed.
+ * java/io/ObjectInputStream.java (resolveClass): Use the
+ three-argument Class.forName().
+ * java/io/InvalidClassException.java (toString): Don't include
+ classname in result if it is null.
+
+2001-05-06 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
+
+ * java/lang/Class.h (forName): Add initialize parameter. Fixes
+ declaration to comply with JDK spec.
+ * java/lang/natClass.cc (forName): Correct declaration of the three-arg
+ variant. Honour "initialize" flag.
+ * java/lang/Class.java: Fix forName() declaration.
+ * java/lang/ClassLoader.java (getParent): Now final.
+ (findSystemClass): Now final.
+ (getSystemResourceAsStream): Remove redundant "final" modifier.
+ (getSystemResource): Remove redundant "final" modifier.
+ (getResources): Now final.
+ (getSystemClassLoader): Now non-native.
+ * java/util/ResourceBundle.java (tryGetSomeBundle): Use the correct
+ arguments for Class.forName().
+ * gnu/gcj/runtime/VMClassLoader.java (getVMClassLoader): Removed.
+ (instance): Static initialize singleton.
+ (findClass): Override this, not findSystemClass.
+ * java/lang/natClassLoader.cc (findClass): Renamed from
+ findSystemClass. Call the interpreter via URLClassLoader.findClass if
+ loading class via dlopen fails.
+
+2001-05-03 Martin Kahlert <martin.kahlert@infineon.com>
+
+ * jni.cc (_Jv_JNI_GetPrimitiveArrayRegion): Fixed bounds
+ checking.
+ (_Jv_JNI_SetPrimitiveArrayRegion): Likewise.
+
+2001-05-02 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
+
+ * doc/*.texi: Remove generated documentation.
+
+2001-04-30 Matt Kraai <kraai@alumni.carnegiemellon.edu>
+
+ * java/io/natFile.cc (performSetReadOnly): Fix #ifdef test.
+ (performDelete): Fix #endif placement.
+
+2001-04-27 Tom Tromey <tromey@redhat.com>
+
+ * jni.cc (_Jv_JNI_GetPrimitiveArrayRegion): Fixed bounds
+ checking.
+ (_Jv_JNI_SetPrimitiveArrayRegion): Likewise.
+
+2001-04-27 Martin Kahlert <martin.kahlert@infineon.com>
+
+ * include/jni.h (struct JNINativeInterface): Fixed types in
+ Get/Set*ArrayRegion declarations.
+ (class _Jv_JNIEnv): Likewise.
+
+2001-04-26 Alexandre Oliva <aoliva@redhat.com>
+
+ * configure.in: Obtain THREADS with `gcc -v'.
+ * configure: Rebuilt.
+
+2001-04-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * java/net/natInetAddress.cc (java::net::InetAddress::aton):
+ Wrap use of inet_pton in HAVE_INET6.
+
+2001-04-24 Alexandre Oliva <aoliva@redhat.com>
+
+ * configure.in (CPPFLAGS): Added builddir and srcdir to CPPFLAGS
+ for libtool tests. Pre-create gnu/classpath/Configuration.java.
+ * configure: Rebuilt.
+
+2001-04-20 Warren Levy <warrenl@redhat.com>
+
+ * java/lang/natSystem.cc (getSystemTimeZone): Adjust for DST.
+ * java/text/SimpleDateFormat.java
+ (indexInArray): Removed private method.
+ (processYear): Removed private method.
+ (parseLenient): Removed private method.
+ (parseLeadingZeros): Removed private method.
+ (parseStrict): Removed private method.
+ (expect): Added new private method.
+ (parse): Reverted to pre-Classpath merge version with minor fixes.
+ * java/util/natGregorianCalendar.cc (computeTime): Handle strict
+ calendars.
+
+2001-04-18 Warren Levy <warrenl@redhat.com>
+
+ * java/util/TimeZone.java: Sync up with Classpath. Includes new
+ and corrected SimpleTimeZone's for the timezones hash table.
+
+2001-04-12 Bryce McKinlay <bryce@albatross.co.nz>
+
+ * java/io/File.java (normalizePath): New private method.
+ (File (String)): Use normalizePath().
+ (File (String, String)): Likewise.
+
+ * Makefile.am (libffi_files): Removed.
+ (libgcj.la): Link libffi as a convenience library instead of
+ refering to its object files directly.
+ * Makefile.in: Rebuilt.
+
+2001-04-08 Per Bothner <per@bothner.com>
+
+ * java/lang/natString.cc (_Jv_NewStringUtf8Const): Register finalizer.
+ Recalculate hash, since Utf8Const's hash is only 16 bits.
+
+ * java/lang/natString.cc (_Jv_StringFindSlot, rehash): Use high-order
+ bits of hash to calculate step for chaining.
+
+ * java/lang/natString.cc (intern, _Jv_NewStringUtf8Const): Rehash
+ when 2/3 full, rather than 3/4 full.
+
+2001-04-06 Tom Tromey <tromey@redhat.com>
+
+ * jni.cc (wrap_value<jobject>, wrap_value<jclass>): Removed.
+ (wrap_value<T*>): New specialization.
+ (_Jv_JNI_PopLocalFrame): Update env->locals.
+
+2001-04-05 Tom Tromey <tromey@redhat.com>
+
+ * libtool-version: Updated current.
+
+2001-04-04 Andreas Jaeger <aj@suse.de>
+
+ * gcj/Makefile.am (AUTOMAKE_OPTIONS): Remove no-installinfo.
+ * gcj/Makefile.in: Rebuilt.
+ * Makefile.am (AUTOMAKE_OPTIONS): Remove no-installinfo.
+ * Makefile.in: Rebuilt.
+ * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Remove no-installinfo.
+ * testsuite/Makefile.in: Rebuild.
+ * include/Makefile.am (AUTOMAKE_OPTIONS): Remove no-installinfo.
+ * include/Makefile.in: Rebuild.
+
+2001-04-02 Zack Weinberg <zackw@stanford.edu>
+
+ * testsuite/lib/libjava.exp: Correct typo: 'output from source
+ compiled test', not 'execution from source compiled test'.
+ Use UNTESTED, not XFAIL, for tests which are not run because
+ they depend on a previous test which failed.
+
+2001-04-02 Marcus G. Daniels <mgd@swarm.org>
+
+ * jni.cc (wrap_value<jclass>): New specialization.
+
+2001-04-02 Tom Tromey <tromey@redhat.com>
+
+ * java/io/PrintStream.java (out): Removed field. Fixes PR
+ java/2449.
+ (write): Call flush, not out.flush, per spec.
+ (close): Flush output stream, per spec. Handle
+ InterruptedIOException.
+ (checkError): Likewise.
+ (flush, print, write): Handle InterruptedIOException per spec.
+ (PrintStream): Don't create BufferedOutputStream.
+ (work_bytes): New field.
+ (writeChars): Use work_bytes. Don't assume `out' is a
+ BufferedOutputStream.
+
+2001-04-02 Torsten Rueger <torsten.rueger@firsthop.com>
+
+ * java/text/MessageFormat.java (setLocale): Added missing `else'.
+ For PR libgcj/2429.
+
+2001-03-30 Tom Tromey <tromey@redhat.com>
+
+ * jni.cc (add_char): Correctly encode non-ascii characters.
+ (add_char): Define even when INTERPRETER not defined.
+ (mangled_name): Likewise.
+ (_Jv_GetJNIEnvNewFrame): Likewise.
+ (_Jv_LookupJNIMethod): Likewise.
+
+2001-04-02 Bryce McKinlay <bryce@albatross.co.nz>
+
+ * java/lang/natSystem.cc (init_properties): Revert yesterday's changes
+ to "file.separator", "path.separator", and "java.io.tmpdir" property
+ initialization.
+ * java/io/File.java: Likewise.
+ * java/io/natFile.cc (init_native): Likewise.
+ * java/io/natFileWin32.cc (init_native): Likewise.
+
+2001-04-01 Per Bothner <per@bothner.com>
+
+ * java/lang/natString.cc (intern): If string's data does not point to
+ this String, make a fresh String that does.
+
+ * java/lang/natString.cc (unintern): Replace by static function.
+ * java/lang/String.java (unintern): Remove method.
+
+2001-04-01 Per Bothner <per@bothner.com>
+
+ * DeflaterOutputStream.java (deflate): Loop while def.needsInput.
+ (finish): def.deflate needs to be called in a loop.
+ (inbuf, inbufLength): New private fields.
+ (write(int)): Use inbuf.
+ (write(byte[],int,int): Check if pending output in inbuf.
+ * ZipOutputStream.java: Don't use Deflater if stored.
+ Use a Checksum object directly, not via a CheckedOutputStream.
+ (uncompressed_size): New field,
+ (closeEntry): Only write data_directory if needed.
+ (write): If STORED, write directly.
+ Always update crc, and uncompressed_size.
+ (write_entry): Fix lots of protocol erors.
+
+2001-04-01 Bryce McKinlay <bryce@albatross.co.nz>
+
+ 1.3-Compliant Implementation of java.io.File.
+ * java/lang/natSystem.cc (init_properties): Get "file.separator",
+ "path.separator", and "java.io.tmpdir" from the File class, instead
+ of setting them explicitly.
+ * java/io/File.java: Do not canonicalize paths for security manager
+ checks. Call init_native() from static initializer. Do not pass path
+ argument to native methods. New native method declarations. Some
+ security manager checks moved to checkWrite().
+ (equals): Check file system case sensitivity and act appropriatly.
+ (hashCode): Likewise.
+ (isHidden): New method implemented.
+ (performList): Changed prototype. Now takes a class argument specifying
+ the class of the returned array: Strings or File objects. Also added
+ FileFilter argument.
+ (listFiles): New variants with "File" return type implemented.
+ (createTempFile): Use createNewFile(). Use maxPathLen.
+ (setReadOnly): New method implemented.
+ (listRoots): Likewise.
+ (compareTo): Likewise.
+ (setLastModified): Likewise.
+ (checkWrite): New method.
+ (setPath): Removed.
+ * java/io/natFile.cc: Various functions no longer take canonical path
+ argument.
+ (stat): Handle ISHIDDEN query.
+ (isAbsolute): Remove WIN32 cruft.
+ (performList): New arguments. Handle returning either File[] or String[]
+ arrays. Check with FileFilter or FilenameFilter arguments as
+ appropriate. Use an ArrayList, not a Vector, for the temporary list.
+ (performSetReadOnly): New method implemented.
+ (performListRoots): Likewise.
+ (performSetLastModified): Likewise.
+ (performCreate): Likewise.
+ (init_native): New initialization function.
+ * java/io/natFileWin32.cc: Various functions no longer take canonical
+ path argument.
+ (stat): Add FIXME about ISHIDDEN query.
+ (performList): New arguments. Handle returning either File[] or String[]
+ arrays. Check with FileFilter or FilenameFilter arguments as
+ appropriate. Use an ArrayList, not a Vector, for the temporary list.
+ (performSetReadOnly): New. Stubbed.
+ (performListRoots): Likewise.
+ (performSetLastModified): Likewise.
+ (performCreate): Likewise.
+ (init_native) New initialization function.
+ * configure.in: Check for utime() and chmod().
+ * configure: Rebuilt.
+ * include/config.h.in: Rebuilt.
+
+2001-03-27 Joerg Brunsmann <joerg_brunsmann@yahoo.de>
+
+ * javax/naming/InitialContext.java (init): Fix typo.
+ (composeName): Remove unnecessary semicolon.
+ (addToEnvironment): Remove unnecessary semicolon.
+ (addToEnvironment): Use put() instead of add().
+
+ * javax/naming/InitialContext.java (InitialContext):
+ Make public.
+ (destroySubcontext): Method doesn't return a result.
+ * javax/naming/Context.java: Import java.util.Hashtable.
+ * javax/naming/Name.java: Import java.util.Enumeration.
+
+2001-03-27 Bryce McKinlay <bryce@albatross.co.nz>
+
+ * Makefile.am (libffi_files): Use $(shell) wrapper instead of back
+ quotes.
+ (libgcj.la): Echo the list of object files one at a time, using a
+ for loop.
+ (libgcjx.la): Likewise.
+ * Makefile.in: Rebuilt.
+
+2001-03-27 Bryce McKinlay <bryce@albatross.co.nz>
+
+ * Makefile.am (libffi_files): Use 'find' to pick up libffi libtool
+ objects in subdirectories.
+ * Makefile.in: Rebuilt.
+
+2001-03-24 Bryce McKinlay <bryce@albatross.co.nz>
+
+ * java/util/HashMap.java (HashMap): If 0 is given for initialCapacity
+ paramater, bump it to 1.
+ * java/util/Hashtable.java (Hashtable): Likewise.
+
+2001-03-23 Kevin B Hendricks <khendricks@ivey.uwo.ca>
+
+ * configure.host: Enable interpreter for PPC.
+
+2001-03-23 Per Bothner <per@bothner.com>
+
+ * java/lang/natDouble.cc (parseDouble): Cannot use errno to
+ check for errors, since we don't want to throw exception on
+ overflow/underflow. Instead, trim whitespace, and then check that
+ _strtod_r uses up all the rest of the string.
+
+ * java/lang/natClass.cc (_Jv_IsAssignableFrom): Checking the
+ ancestors array is invalid for interfaces, so do that *after*
+ check that the target type is not an interface.
+
+2000-03-23 Jeff Sturm <jsturm@one-point.com>
+
+ * prims.cc (_Jv_FindClassFromSignature): Check return of
+ recursive call. Do not abort on invalid signature; return NULL
+ instead.
+
+2001-03-22 Tom Tromey <tromey@redhat.com>
+
+ * jni.cc (_Jv_JNI_GetAnyFieldID): Handle unresolved fields.
+ * java/lang/reflect/natField.cc (getType): Use _Jv_ResolveField
+ unconditionally.
+ * include/jvm.h (_Jv_ResolveField): Declare.
+ * include/java-interp.h (_Jv_ResolveField): Don't declare.
+ * resolve.cc (_Jv_ResolveField): No longer conditional on
+ INTERPRETER.
+
+2001-03-23 Bryce McKinlay <bryce@albatross.co.nz>
+
+ Fix for PR libgcj/1736. Thanks to Robert Boehne and Alexandre Oliva
+ for libtool hacking.
+ * Makefile.am (libgcj.la): New explicit rule. Echo the list of objects
+ to a temporary file, then invoke libtool with the -objectlist
+ paramater.
+ (libgcjx.la): Likewise.
+ * Makefile.in: Rebuilt.
+
+2001-03-22 Joerg Brunsmann <joerg_brunsmann@yahoo.de>
+
+ * javax/naming/Context.java (SECURITY_CREDENTIALS): Fix typo.
+
+2001-03-22 Marcus G. Daniels <mgd@swarm.org>
+
+ * jni.cc (add_char): Handle `.' like `/'.
+
+2001-03-22 Bryce McKinlay <bryce@albatross.co.nz>
+
+ * java/lang/reflect/Method.java (getExceptionTypes): Call getType() to
+ initialize if exception_types is null.
+ * java/lang/reflect/Constructor.java: Likewise.
+ * java/lang/reflect/natConstructor.cc (getType): Initialize
+ exception_types to an empty Object array.
+
+2001-03-21 Tom Tromey <tromey@redhat.com>
+
+ * configure: Rebuilt.
+ * configure.in (GCJFLAGS): Subst.
+ * Makefile.in: Rebuilt.
+ * Makefile.am (jv_convert_LDFLAGS): Added -shared-libgcc.
+ (gij_LDFLAGS): Likewise.
+ (JC1FLAGS): Added GCJFLAGS and removed -g.
+
+ * java/io/natFileDescriptorPosix.cc (open): Add O_CREAT in
+ read/write case. Fixes PR libgcj/2338.
+
+2001-03-19 Per Bothner <per@bothner.com>
+
+ * java/net/URLStreamHandler.java (parseURL): Fix bug which would
+ "canonicalize" "../../xxx" to "/xxx".
+
+2001-03-17 Tom Tromey <tromey@redhat.com>
+
+ * java/lang/natString.cc (rehash): Don't bother with memset;
+ _Jv_AllocBytes returns zero'd memory. Use _Jv_AllocBytesChecked.
+ Use UNMASK_PTR.
+ (UNMASK_PTR): New macro.
+ (intern): Unmask pointer before returning it. Register finalizer
+ for the string.
+ (unintern): Handle case where
+ (MASK_PTR): New macro.
+ (PTR_MAKSED): Likewise.
+ (_Jv_NewStringUtf8Const): Use UNMASK_PTR.
+
+2001-03-01 Andrew Haley <aph@redhat.com>
+
+ * java/lang/natThrowable.cc (printRawStackTrace): Copy the
+ stackTrace buffer to a correctly aligned pointer array.
+
+2001-03-12 Bryce McKinlay <bryce@albatross.co.nz>
+
+ * java/lang/Runtime.java (_exit): Declare new package-private native.
+ * java/lang/natRuntime.cc (_exit): Implemented. Same as exit() but
+ without a security manager check.
+ (exit): Call _exit.
+ * java/lang/System.java (setSecurityManager): If a security manager
+ is already in place, call checkPermission.
+ * java/lang/ThreadGroup.java (uncaughtException): If printStackTrace()
+ throws an exception, try to deal with it gracefully.
+ * prims.cc (JvRunMain): Call Runtime._exit to shutdown
+ the runtime.
+ * java/lang/ExceptionInInitializerError.java (printStackTrace):
+ Only try to print the subordinate stack trace if "exception" is set.
+ Print our class name first.
+
+2001-03-08 Tom Tromey <tromey@redhat.com>
+
+ * java/io/ObjectStreamClass.java (setUID): Don't write interface
+ info for array classes.
+ Fixes PR libgcj/1971.
+
+2001-03-06 Bryce McKinlay <bryce@albatross.co.nz>
+
+ * java/util/TreeSet.java (writeObject): Use a for-loop instead of
+ Iterator.hasNext().
+
+2001-03-05 Jochen Hoenicke <jochen@gnu.org>
+
+ * java/util/TreeMap.java (writeObject): Use defaultWriteObject()
+ instead of the new JDK1.2 API. This is simpler and makes
+ back-porting the classes to JDK1.1 trivial.
+ (readObject): likewise.
+
+2001-03-01 Per Bothner <per@bothner.com>
+
+ Changes merged from Kawa's gnu.math.
+ * gnu/gcj/math/MPN.java (rshift0): New method handles zero shift count.
+ (rshift(int[],int[],int,int): Removed - not needed.
+ (gcd): Use rshift0 rather than rshift.
+ * java/math/BigInteger.java (setShiftRight): Likewise.
+ (divide): Simplify by using rshift0.
+ (divide): Zero-extend results if high-order bit set.
+
+2001-02-23 Per Bothner <per@bothner.com>
+
+ Change to sometimes include class name in ClassFormatError message.
+ * defineclass.cc (_Jv_VerifyFieldSignature, _Jv_VerifyMethodSignature,
+ _Jv_VerifyIdentifier, _Jv_VerifyClassName (two overlods)): Return
+ boolean instead of throwing ClassFormatError on failure.
+ (throw_class_format_error): Change static function to method.
+ (_Jv_ClassReader): New inline methods verify_identifier,
+ two overloads of verify_classname, verify_field_signature, and
+ verify_method_signature
+ * include/java-interp.h: Update declarations to return bool.
+ * java/lang/natClassLoader.cc (defineClass0): Explicitly throw
+ ClassFormatError since _Jv_VerifyClassName now returns bool.
+
+2001-02-23 Per Bothner <per@bothner.com>
+
+ * java/lang/Throwable.java (CPlusPlusDemangler): Pass -s java to
+ c++filt to select java-style output.
+
+2001-02-27 Bryce McKinlay <bryce@albatross.co.nz>
+
+ * libgcj.spec.in: Insert %(libgcc) before %(liborig) to fix static
+ linking.
+
+2001-02-22 Bryce McKinlay <bryce@albatross.co.nz>
+
+ Fix for PR java/2040:
+ * java/util/HashMap.java (HashMap): Don't throw exception for
+ loadFactor > 1. Add exception messages.
+ * java/util/Hashtable.java (Hashtable): Likewise.
+
+2001-02-21 Bryce McKinlay <bryce@albatross.co.nz>
+
+ Disable libgcjx by default.
+ * configure.in: Add support for --enable-java-awt configure option.
+ Use --enable-java-awt=xlib to build the xlib peers (libgcjx).
+ * Makefile.am: Make libgcjx conditional on XLIB_AWT, instead of NO_X.
+ * Makefile.in: Rebuilt.
+ * configure: Rebuilt.
+
+2001-02-20 Tom Tromey <tromey@redhat.com>
+
+ * java/io/PipedWriter.java (flush): Throw exception if stream
+ closed.
+ * java/io/OutputStreamWriter.java (write): Throw exception if
+ stream closed.
+ (writeChars): Don't throw exception if stream closed.
+ * java/io/CharArrayWriter.java (closed): New field.
+ (close): Set it.
+ (flush): Throw exception if stream closed.
+ (reset): Synchronize on correct lock. Allow stream to be
+ reopened.
+ (toCharArray, toString, writeTo): Synchronize.
+ (write): Throwe exception if stream closed.
+ * java/io/BufferedWriter.java (close): Clear `buffer'.
+ (flush): Throw IOException if stream is closed.
+ (write): Likewise.
+
+2001-02-16 Tom Tromey <tromey@cygnus.com>
+
+ * java/lang/ThreadGroup.java (activeCount): Only include threads
+ which are alive.
+ (enumerate): Likewise.
+
+2001-02-19 Bryce McKinlay <bryce@albatross.co.nz>
+
+ * java/lang/Integer.java (getInteger): Return default argument if
+ property is not set. Don't call decode with null argument.
+ * java/lang/Long.java (getLong): Likewise.
+
+ * java/io/CharArrayReader.java (CharArrayReader): Throw
+ IllegalArgumentException if constructor arguments are illegal.
+ (ready): Return false if no more characters can be read.
+ * java/io/ByteArrayInputStream.java (ByteArrayInputStream): Likewise.
+
+2001-02-16 Bryce McKinlay <bryce@albatross.co.nz>
+
+ * java/util/TreeSet.java (clone): Made subclass safe, use
+ super.clone(), not new.
+ * java/util/TreeMap.java (clone): Likewise.
+
+ * java/util/TreeMap.java (nil): Made non-final.
+ (clone): Create new nil node for copy.
+
+ * java/util/HashSet.java (clone): Made subclass safe, use
+ super.clone(), not new.
+
+2001-02-15 Anthony Green <green@redhat.com>
+
+ * defineclass.cc: Don't include alloca.h.
+ (prepare_pool_entry): Convert alloca to __builtin_alloca.
+ * interpret.cc (run_normal): Ditto.
+ (continue1): Ditto.
+ * java/lang/natDouble.cc (parseDouble): Ditto.
+
+2001-02-15 Bryce McKinlay <bryce@albatross.co.nz>
+
+ * java/util/TreeSet.java (clone): Call TreeMap.clone(), not
+ Object.clone().
+ * java/util/Collections.java (ReverseComparator): New static class.
+ (reverseOrder): Return static instance of ReverseComparator.
+
+ * java/util/HashSet.java (clone): Remove try/catch.
+
+ * java/util/AbstractSequentialList.java: Synchronize with Classpath.
+ * java/util/Collection.java: Likewise.
+ * java/util/Comparator.java: Likewise.
+ * java/util/Dictionary.java: Likewise.
+ * java/util/Iterator.java: Likewise.
+ * java/util/ListIterator.java: Likewise.
+ * java/util/Map.java: Likewise.
+ * java/util/Set.java: Likewise.
+
+2001-02-14 Bryce McKinlay <bryce@albatross.co.nz>
+
+ * java/util/TreeMap.java: New file.
+ * java/util/TreeSet.java: New file.
+ * Makefile.am: Add TreeMap and TreeSet. Enable WeakHashMap.
+ * Makefile.in: Rebuilt.
+ * java/util/HashSet.java (clone): Use constructor instead of calling
+ clone on itself.
+ * java/util/SortedSet.java: Sync with classpath.
+ * java/util/HashMap.java (hash): Use if statement instead of ternary,
+ for clarity.
+
+ * java/lang/natClass.cc (getSignature): Don't try to dereference
+ param_types if it is null. Instead, take this to mean "no parameters".
+ * java/lang/TreeMap.java (TreeIterator.next): Throw
+ NoSuchElementException in preference to ConcurrentModificationException.
+ (TreeIterator.remove): Throw IllegalStateException in preference to
+ ConcurrentModificationException.
+ (SubMap.firstKey): Do a better check for empty SubMap, and if it is,
+ throw a NoSuchElementException.
+ (SubMap.lastKey): Likewise.
+
+2001-02-13 Tom Tromey <tromey@redhat.com>
+
+ * java/io/PipedReader.java (ready): Throw IOException if pipe
+ closed.
+ * java/io/FilterReader.java (close): Don't clear `in'.
+ * java/io/CharArrayReader.java (mark): Throw IOException if stream
+ closed.
+ (read, ready, reset, skip): Added exception message.
+ * java/io/BufferedReader.java (mark, reset, ready, read, skip):
+ Perform checkStatus check inside synchronized block.
+
+2001-02-13 Tom Tromey <tromey@redhat.com>
+
+ Fix for PR libgcj/1351:
+ * posix.cc (_Jv_select): Throw InterruptedIOException if thread is
+ interrupted.
+ Include Thread.h and InterruptedIOException.h.
+
+2001-02-13 Bryce McKinlay <bryce@albatross.co.nz>
+
+ * java/io/BlockDataException.java: Removed.
+ * java/io/ObjectInputStream.java (readObject): Throw
+ StreamCorruptedException, not BlockDataException.
+ * Makefile.am: Remove BlockDataException.
+ * Makefile.in: Rebuild.
+
+2001-02-12 Jeff Sturm <jeff.sturm@commerceone.com>
+ Tom Tromey <tromey@redhat.com>
+
+ * interpret.cc (continue1): [insn_invokevirtual] Do an explicit
+ null pointer check.
+
+2001-02-15 Zack Weinberg <zackw@stanford.edu>
+
+ * include/i386-signal.h: Adjust comment to match previous change.
+
+2001-02-14 Andrew Haley <aph@redhat.com>
+
+ * include/i386-signal.h (INIT_SEGV): Use a direct system call to
+ set the handler.
+
+2001-02-15 Bryce McKinlay <bryce@albatross.co.nz>
+
+ * gnu/awt/j2d/DirectRasterGraphics.java (clone): Hoist to public.
+ * gnu/awt/j2d/IntegerGraphicsState.java (setClip): Call
+ Rectangle.clone(), not Object.clone().
+
+2001-02-13 Tom Tromey <tromey@redhat.com>
+
+ * gnu/awt/j2d/AbstractGraphicsState.java (clone): Made public.
+
2001-02-09 Tom Tromey <tromey@redhat.com>
* java/util/Timer.java: New version from Classpath.
@@ -27,7 +1022,7 @@
* java/lang/Float.java: As above.
(floatToRawIntBits): New method.
- * java/io/OutputStreamWriter.java: (flush, writeChars): Throw
+ * java/io/OutputStreamWriter.java: (flush, writeChars): Throw
IOException if stream closed.
2001-02-08 Tom Tromey <tromey@redhat.com>
@@ -84,7 +1079,7 @@
2001-01-26 Andrew Haley <aph@redhat.com>
(INIT_FPE): Use a direct system call to set the handler.
-
+
2001-01-27 Richard Henderson <rth@redhat.com>
* configure.host (alpha*-*) [libgcj_flags]: Add -mieee.
@@ -98,10 +1093,10 @@
* java/io/ObjectInputStream.java (read): AND byte with 0xff to make
result unsigned.
- (read (byte[], int, int)): Only call readNextBlock() if the block
+ (read (byte[], int, int)): Only call readNextBlock() if the block
buffer would actually be overrun. Increment blockDataPosition.
(callReadMethod): Propagate exceptions from invocation target.
- * java/io/ObjectOutputStream.java (callWriteMethod): Propagate
+ * java/io/ObjectOutputStream.java (callWriteMethod): Propagate
exceptions from invocation target.
2001-01-26 Tom Tromey <tromey@redhat.com>
@@ -138,7 +1133,7 @@
2001-01-17 Bryce McKinlay <bryce@albatross.co.nz>
- * java/lang/Class.h (isInterface): Move implementation from
+ * java/lang/Class.h (isInterface): Move implementation from
natClass.cc. Declare inline.
(Class): Add default constructor.
* java/lang/Object.h: Update comments.
@@ -247,13 +1242,13 @@
(_Jv_GetArrayClass): New inline function.
(arrayclass): New field.
* prims.cc (_Jv_NewObjectArray): Use _Jv_GetArrayClass. Don't use
- _Jv_GetArrayElementFromElementType.
+ _Jv_GetArrayElementFromElementType.
(_Jv_NewPrimArray): Ditto.
(_Jv_PrimClass constructor): Initialize "depth", "ancestors", and
"idt" for completeness. Initialze "arrayclass" using _Jv_NewArrayClass.
Set Modifier::ABSTRACT.
* java/lang/natClassLoader.cc (_Jv_NewClass): Initialize "arrayclass".
- (_Jv_NewArrayClass): Renamed from _Jv_FindArrayClass. Now void.
+ (_Jv_NewArrayClass): Renamed from _Jv_FindArrayClass. Now void.
Now synchronized. Array classes are now referenced from
elementClass->arrayclass. Don't use _Jv_FindClassInCache.
Set array classes' accessibility flags correctly. Optimize so that
@@ -300,7 +1295,7 @@
* java/lang/Object.h (struct _JvObjectPrefix): New virtuals
nacd_1 and nacd_2 (for compatibility with the new C++ ABI.)
(class java::lang::Object): `finalize' moved up front.
- * java/lang/natClass.cc
+ * java/lang/natClass.cc
(isAssignableFrom): Turned outline.
(isInstance): Likewise.
(isInterface): Likewise, fixed indentation.
@@ -353,7 +1348,7 @@
* java/io/PipedInputStream: Rewrote to be simpler and more correct.
* java/io/PipedOutputStream: Updated to match new PipedInputStream.
- * java/io/PipedReader: New implementation based on new
+ * java/io/PipedReader: New implementation based on new
PipedInputStream.
* java/io/PipedWriter: Updated to match new PipedReader.
@@ -405,15 +1400,15 @@
* include/win32-threads.h: Ditto.
* include/no-threads.h: Ditto.
* posix-threads.cc (_Jv_ThreadInitData): Implement new prototype.
- (_Jv_ThreadDestroyData): New function. Free native thread "data" and
+ (_Jv_ThreadDestroyData): New function. Free native thread "data" and
move mutex and condition variable destroy code from:
(really_start): ...here.
(_Jv_ThreadStart): Set PTHREAD_CREATE_DETACHED.
* win32-threads.cc (_Jv_ThreadInitData): Implement new prototype.
(_Jv_ThreadDestroyData): Implemented.
* nogc.cc (_Jv_AllocObject): Use "void *" not "ptr_t".
- (_Jv_AllocArray): Ditto.
-
+ (_Jv_AllocArray): Ditto.
+
2000-12-27 Jeff Sturm <jeff.sturm@commerceone.com>
* java/sql/DriverManager.java (getConnection): Don't set user/password
@@ -442,8 +1437,8 @@
Fix for PR libgcj/1516:
* java/lang/reflect/natMethod.cc (primitives): Remove void entry.
Add boolean entry.
- (can_widen): Declared inline. Remove redundant checks for void
- arguments and char->short conversion. Add special case for boolean
+ (can_widen): Declared inline. Remove redundant checks for void
+ arguments and char->short conversion. Add special case for boolean
conversions.
(ffi_type): Declared inline.
(_Jv_CallAnyMethodA): Move unwrapping logic inside isPrimitive() block.
@@ -557,7 +1552,7 @@
2000-12-18 Bryce McKinlay <bryce@albatross.co.nz>
- * java/awt/Window.java (addNotify): Remove peer casting hack now that
+ * java/awt/Window.java (addNotify): Remove peer casting hack now that
gcj/312 is fixed.
* java/awt/Button.java (addNotify): Likewise.
* java/awt/Label.java (addNotify): Likewise.
@@ -574,7 +1569,7 @@
2000-12-18 Bryce McKinlay <bryce@albatross.co.nz>
- * java/util/zip/natInflater.cc (inflate): Treat Z_BUF_ERROR as
+ * java/util/zip/natInflater.cc (inflate): Treat Z_BUF_ERROR as
end-of-stream if avail_in is 0.
2000-12-17 Bryce McKinlay <bryce@albatross.co.nz>
@@ -639,11 +1634,11 @@
* configure.in: Remove check for -fuse-divide-subroutine.
* configure: Rebuilt.
-
+
* java/util/Hashtable.java (Enumerator.nextElement): Initialize `e'.
* gcj/javaprims.h: Rebuilt CNI namespace declarations.
-
+
2000-12-11 Bryce McKinlay <bryce@albatross.co.nz>
* Makefile.am: Add HashSet.java and java/lang/ref classes.
@@ -657,14 +1652,14 @@
* java/util/BasicMapEntry.java: Deleted.
* java/util/Collections.java (search): Use a for-loop, not iterator
hasNext().
- (copy): Use a for-loop. Throw an IndexOutOfBoundsException if run out
+ (copy): Use a for-loop. Throw an IndexOutOfBoundsException if run out
of elements in source.
(max): Use a for-loop.
(min): Ditto.
- (reverse): Keep track of positions instead of using Iterator's
+ (reverse): Keep track of positions instead of using Iterator's
nextIndex() and previousIndex().
- (shuffle(List)): Initialize defaultRandom if required using
- double-check thread safety idiom. Call two-argument shuffle method
+ (shuffle(List)): Initialize defaultRandom if required using
+ double-check thread safety idiom. Call two-argument shuffle method
using defaultRandom.
(defaultRandom): New field.
(shuffle(List, Random)): Use a for-loop. Keep track of pos instead of
@@ -679,7 +1674,7 @@
* java/lang/ref/ReferenceQueue.java: Ditto.
2000-12-10 Richard Henderson <rth@redhat.com>
-
+
* configure.host: Recognize alpha*-*, not alphaev6-*.
2000-12-09 Anthony Green <green@redhat.com>
@@ -704,10 +1699,10 @@
java/lang/String.h:, java/lang/reflect/Constructor.h:,
java/lang/reflect/Field.h:, java/lang/reflect/Method.h:,
gnu/gcj/runtime/VMClassLoader.h:,
- java/io/ObjectInputStream$$GetField.h:,
+ java/io/ObjectInputStream$$GetField.h:,
java/io/ObjectOutputStream$$PutField.h:, header-check:): Likewise.
(Makefile.in): Rebuilt.
-
+
2000-12-08 Tom Tromey <tromey@redhat.com>
From Phil Edwards:
@@ -759,7 +1754,7 @@
2000-12-04 Bryce McKinlay <bryce@albatross.co.nz>
- * java/lang/natDouble.cc: Include fdlibm.h, not mprec.h. From
+ * java/lang/natDouble.cc: Include fdlibm.h, not mprec.h. From
Edgar Villanueva <edgarvil@home.com>.
2000-12-03 Tom Tromey <tromey@redhat.com>
@@ -810,7 +1805,7 @@
* java/lang/dtoa.c: Include string.h.
* java/lang/natString.cc (toLowerCase): Initialize `ch' to prevent
compiler warning.
-
+
From Adam Welc <welc@cs.purdue.edu>:
* java/util/LinkedList.java (removeFirst): Update `first' field.
Handle the last == first case.
@@ -857,7 +1852,7 @@
* configure.in: Check for setlocale.
* configure: Rebuilt.
* include/config.h.in: Rebuilt.
-
+
* java/util/zip/InflaterInputStream (read): Don't return -1 unless
the infate() call didn't deliver any output. Throw a ZipException if
the needsDictionary() call returns true.
@@ -875,11 +1870,11 @@
2000-11-28 Bryce McKinlay <bryce@albatross.co.nz>
* java/io/DataInputStream.java: Merge classpath docs. Call in.read()
- directly rather than read() in all cases. Make primitive read
+ directly rather than read() in all cases. Make primitive read
implementations more efficient, as defined in JDK online docs.
(skipBytes): Behave like the JDK's implementation.
- * java/io/BufferedReader.java: Merge classpath docs. Check for a
- closed stream with checkStatus() whenever an IOException can be
+ * java/io/BufferedReader.java: Merge classpath docs. Check for a
+ closed stream with checkStatus() whenever an IOException can be
thrown.
(checkStatus): New private method.
@@ -914,7 +1909,7 @@
(addAll): Ditto.
* java/util/Collections.java (UnmodifiableCollection): Implement
toString().
- (UnmodifiableList): Throw UnsupportedOperationException from
+ (UnmodifiableList): Throw UnsupportedOperationException from
modification methods. Set `l' from the one-parameter constructor.
(UnmodifiableMap): Implement toString().
(SynchronizedCollection): Ditto.
@@ -934,7 +1929,7 @@ Sun Nov 26 23:59:55 2000 Anthony Green <green@redhat.com>
javax/naming/directory/InvalidSearchFilterException.java,
javax/naming/directory/NoSuchAttributeException.java,
javax/naming/directory/SchemaViolationException.java: New files.
-
+
Sun Nov 26 22:35:53 2000 Anthony Green <green@redhat.com>
* javax/naming/InitialContext.java (rebind): Implement.
@@ -1056,7 +2051,7 @@ Sun Nov 26 21:30:25 2000 Anthony Green <green@redhat.com>
javax/naming/NamingEnumeration.java, javax/naming/Name.java,
javax/naming/InitialContext.java,
javax/naming/NoInitialContextException.java: New files.
-
+
2000-11-25 Anthony Green <green@redhat.com>
* prims.cc (_Jv_NewObjectArray): Undo placement change.
@@ -1079,7 +2074,7 @@ Sun Nov 26 21:30:25 2000 Anthony Green <green@redhat.com>
(URLClassLoader): Call jarFileize. Use addElement instead of
insertElementAt.
(findResources): New method.
-
+
* java/lang/ClassLoader.java: Import java.util.Enumeration.
(getResource): Implement correct logic.
(findResource): New method.
@@ -1087,7 +2082,7 @@ Sun Nov 26 21:30:25 2000 Anthony Green <green@redhat.com>
(findClass): Create a ClassNotFoundException with the name of the
class rather than nothing at all.
(defineClass) Only throw ClassFormatError.
-
+
* java/lang/Class.java (forName): New method.
* java/lang/Class.h (forName): New method.
* java/lang/natClass.cc (forName): New method.
@@ -1095,13 +2090,13 @@ Sun Nov 26 21:30:25 2000 Anthony Green <green@redhat.com>
2000-11-24 Bryce McKinlay <bryce@albatross.co.nz>
* java/lang/System.java (setProperties): Only call init_properties()
- if properties is null.
+ if properties is null.
(getProperties): Ditto.
(getProperty): Ditto.
(setProperty): Call init_properties if properties are null.
(prop_init): Remove field.
* java/lang/natSystem.cc (init_properties): Synchronize the entire
- method. Check for null properties after synchronizing instead of
+ method. Check for null properties after synchronizing instead of
prop_init flag. Set the properties field last for thread safety.
* java/io/ObjectInputStream.java (ObjectInputStream): If DEBUG is set,
@@ -1119,8 +2114,8 @@ Sun Nov 26 21:30:25 2000 Anthony Green <green@redhat.com>
* configure: Rebuilt.
* Makefile.in: Rebuilt.
* Makefile.am (built_java_source_files): Add Configuration.java.
- * configure.in: Add Configuration.java to CONFIG_FILES. Set
- LIBGCJDEBUG substitution if --enable-libgcj-debug is specified.
+ * configure.in: Add Configuration.java to CONFIG_FILES. Set
+ LIBGCJDEBUG substitution if --enable-libgcj-debug is specified.
Create `gnu' directory in the build tree.
* gnu/classpath/Configuration.java.in: New file.
@@ -1153,16 +2148,16 @@ Sun Nov 26 21:30:25 2000 Anthony Green <green@redhat.com>
* Makefile.in: Rebuilt.
* Makefile.am (core_java_source_files): Added Collections.java.
* java/util/List.java: Merged from classpath.
- * java/util/Vector.java: Ditto.
+ * java/util/Vector.java: Ditto.
* java/util/Collections.java: From classpath.
- * java/util/ArrayList.java (addAll(Collection)): Call
+ * java/util/ArrayList.java (addAll(Collection)): Call
addAll(int,Collection) instead of duplicating code.
(indexOf): Clean up int initialization.
- (clear): Set cleared array entries to null, to allow garbage
+ (clear): Set cleared array entries to null, to allow garbage
collection.
- * java/util/List.java: Minor formatting fixes.
+ * java/util/List.java: Minor formatting fixes.
* java/util/SimpleTimeZone.java: ditto.
-
+
2000-11-18 Tom Tromey <tromey@cygnus.com>
* Makefile.in: Rebuilt.
@@ -1325,24 +2320,24 @@ Sun Nov 26 21:30:25 2000 Anthony Green <green@redhat.com>
2000-11-02 Bryce McKinlay <bryce@albatross.co.nz>
- * java/util/AbstractList.java: Throw messages with
+ * java/util/AbstractList.java: Throw messages with
IndexOutOfBoundsExceptions.
(listIterator()): Call listIterator(0).
(size): New field. Initialize to size().
(hasNext): Test position against size, not size().
- (remove): Increment knownMod by one instead of resetting it from
+ (remove): Increment knownMod by one instead of resetting it from
modCount.
(add): Ditto.
(SubList.upMod): Removed.
(SubList.set): Don't call upMod() or update knownMod.
(SubList.add(int,Object)): Increment modCount instead of caling upMod().
(SubList.remove): Ditto.
- (SubList.addAll): Don't call backingList.size(). Increment size from
+ (SubList.addAll): Don't call backingList.size(). Increment size from
c.size().
(SubList.iterator): New method. Call listIterator(0).
(SubList.listIterator): New method. Restore code to return an anonymous
listIterator implementation (with some changes).
- * java/util/AbstractSequentialList.java: Throw messages with
+ * java/util/AbstractSequentialList.java: Throw messages with
IndexOutOfBoundsExceptions.
(addAll): Add a specnote.
* java/util/ArrayList.java (removeRange): Get the math right.
@@ -1388,7 +2383,7 @@ Sun Nov 26 21:30:25 2000 Anthony Green <green@redhat.com>
* java/io/Reader.java: Merge docs from classpath.
(skip): Synchronize on `lock'.
- * java/io/FileReader.java: Import correct implementation from
+ * java/io/FileReader.java: Import correct implementation from
classpath.
* java/io/StringReader.java: Merge docs from classpath.
(ready): Throw IOException if stream is closed.
@@ -1412,16 +2407,16 @@ Sun Nov 26 21:30:25 2000 Anthony Green <green@redhat.com>
(hashCode): Ditto.
(indexOf): Ditto. Don't take null check outside of the loop.
(iterator): Return an AbstractListItr instead of anonymous class.
- (lastIndexOf): Use a for loop bounded by size() instead of
+ (lastIndexOf): Use a for loop bounded by size() instead of
hasPrevious() in iterator loop.
(listIterator): Return an AbstractListItr.
(removeRange): Remove bounds checking code and docs.
- (AbstractListItr): New inner class. Code moved here from
+ (AbstractListItr): New inner class. Code moved here from
listIterator().
- (SubList.iterator): Removed. Use default implementation from
+ (SubList.iterator): Removed. Use default implementation from
AbstractList instead.
(SubList.listIterator): As above.
- * java/util/AbstractMap.java (clear): Use a for loop bounded by size()
+ * java/util/AbstractMap.java (clear): Use a for loop bounded by size()
instead of hasNext() in iterator loop.
(containsValue): Ditto.
(equals): Ditto.
@@ -1431,7 +2426,7 @@ Sun Nov 26 21:30:25 2000 Anthony Green <green@redhat.com>
(remove): Ditto.
(toString): Ditto. Use string concatenation operators, not
StringBuffer.
- * java/util/AbstractSequentialList.java (addAll): Use a for loop
+ * java/util/AbstractSequentialList.java (addAll): Use a for loop
bounded by size() instead of hasNext() in iterator loop.
* java/util/AbstractSet.java (hashCode): Don't catch exception as
part of normal execution flow. Do an explicit null check instead.
@@ -1443,7 +2438,7 @@ Sun Nov 26 21:30:25 2000 Anthony Green <green@redhat.com>
(removeRange): Make protected. Don't check bounds.
(add): Check lower bounds also. Simplify IndexOutOfBoundsException
message.
- (addAll (Collection)): Use a size-bounded for loop instead of hasNext()
+ (addAll (Collection)): Use a size-bounded for loop instead of hasNext()
check.
(addAll (int, Collection)): Check lower bounds. Simplify exception
string.
@@ -1455,11 +2450,11 @@ Sun Nov 26 21:30:25 2000 Anthony Green <green@redhat.com>
(toArray): Correct comment.
(trimToSize): Don't update modCount, this is not a structural change.
Add comment.
-
+
* java/util/BitSet.java: Merged with classpath, new JDK 1.2 methods
implemented.
(toString): Declare `bit' as long, not int.
- (data): Made package-private, not private.
+ (data): Made package-private, not private.
2000-10-27 Warren Levy <warrenl@cygnus.com>
@@ -1503,9 +2498,9 @@ Sun Nov 26 21:30:25 2000 Anthony Green <green@redhat.com>
* Makefile.am (GCJCOMPILE): Pass --tag=GCJ to libtool.
(core_java_source_files): Put java.lang, java.io, and java.util here.
- (ordinary_java_source_files): Order so that core_java_source_files are
+ (ordinary_java_source_files): Order so that core_java_source_files are
built first.
- (java_source_files): Reorder so that special_java_source_files are
+ (java_source_files): Reorder so that special_java_source_files are
built first.
* configure.in: Don't pass -I flag to gcj.
* Makefile.in: Rebuilt.
@@ -1519,7 +2514,7 @@ Sun Nov 26 21:30:25 2000 Anthony Green <green@redhat.com>
2000-10-24 Bryce McKinlay <bryce@albatross.co.nz>
* java/util/EventObject.java: Merged from classpath.
-
+
* java/lang/ThreadGroup.java (uncaughtException): Print thread name
with stack dump.
@@ -1695,7 +2690,7 @@ Sun Nov 26 21:30:25 2000 Anthony Green <green@redhat.com>
* include/jvm.h: Enable __builtin_expect().
- * name-finder.cc (lookup): Don't trust dladdr() if the address is from
+ * name-finder.cc (lookup): Don't trust dladdr() if the address is from
the main program. Fix for PR libgcj/341.
2000-10-07 Tom Tromey <tromey@cygnus.com>
@@ -1771,7 +2766,7 @@ Sun Nov 26 21:30:25 2000 Anthony Green <green@redhat.com>
* java/security/interfaces/DSAPrivateKey.java (serialVersionUID):
New field.
* java/security/interfaces/DSAPublicKey.java (serialVersionUID):
- New field.
+ New field.
* java/sql/DataTruncation.java (serialVersionUID): New field.
* java/sql/SQLException.java (serialVersionUID): New field.
* java/sql/SQLWarning.java (serialVersionUID): New field.
@@ -1818,7 +2813,7 @@ Sun Nov 26 21:30:25 2000 Anthony Green <green@redhat.com>
2000-09-30 Hans Boehm <boehm@acm.org>
Bryce McKinlay <bryce@albatross.co.nz>
-
+
Implement bitmap descriptor based marking for Boehm GC.
* configure.in: Define JC1GCSPEC. Set it if boehm-gc is used.
@@ -1826,7 +2821,7 @@ Sun Nov 26 21:30:25 2000 Anthony Green <green@redhat.com>
* libgcj.spec.in: Pass JC1GCSPEC to jc1.
* include/jvm.h (struct _Jv_VTable): New field `gc_descr'. New inline
method get_finalizer().
- (struct _Jv_ArrayVTable): Ditto. Declare method array with
+ (struct _Jv_ArrayVTable): Ditto. Declare method array with
NUM_OBJECT_METHODS elements instead of NUM_OBJECT_METHODS + 1.
(_Jv_AllocObj): Add new jclass parameter.
(_Jv_AllocArray): Ditto.
@@ -1841,7 +2836,7 @@ Sun Nov 26 21:30:25 2000 Anthony Green <green@redhat.com>
* resolve.cc (METHOD_NOT_THERE, METHOD_INACCESSIBLE): New #defines.
(_Jv_ResolvePoolEntry): Use METHOD_NOT_THERE and METHOD_INACCESSIBLE.
(_Jv_DetermineVTableIndex): Ditto.
- (_Jv_PrepareClass): Ditto. Remove offset-by-one adjustments from vtable
+ (_Jv_PrepareClass): Ditto. Remove offset-by-one adjustments from vtable
calculations to account for new gc_descr field.
* boehm.cc: #include gc_gcj.h.
(obj_kind_x, obj_free_list): `#if 0'-ed away.
@@ -1849,10 +2844,10 @@ Sun Nov 26 21:30:25 2000 Anthony Green <green@redhat.com>
New commentary from HB. Mark the classes vtable.
(_Jv_MarkArray): Check that vtable doesn't point to a cleared object.
(GC_DEFAULT_DESCR): New #define.
- (_Jv_BuildGCDescr): New function. Use GC_DEFAULT_DESCR, for now.
+ (_Jv_BuildGCDescr): New function. Use GC_DEFAULT_DESCR, for now.
(_Jv_AllocObj): New parameter `klass'. Use GC_GCJ_MALLOC ().
(_Jv_AllocArray): New parameter `klass'. Allocate with GC_MALLOC and
- scan conservativly if size is less than min_heap_addr. Set vtable
+ scan conservativly if size is less than min_heap_addr. Set vtable
pointer of new object before returning.
(_Jv_AllocBytes): Use GC_MALLOC_ATOMIC, not GC_GENERIC_MALLOC.
(_Jv_InitGC): Call GC_init_gcj_malloc(). Don't set up marking and
@@ -1863,10 +2858,10 @@ Sun Nov 26 21:30:25 2000 Anthony Green <green@redhat.com>
* java/lang/Class.h (_Jv_NewObjectArray): No longer a friend.
(_Jv_NewPrimArray): Ditto.
(_Jv_AllocObj): Declare as a friend.
- (_Jv_AllocArray): Ditto.
+ (_Jv_AllocArray): Ditto.
* java/lang/natClassLoader.cc (_Jv_FindArrayClass): Copy gc_descr
- from &ObjectClass into new array class. Remove offset-by-one
- adjustments from `method' size calculations to account for gc_descr
+ from &ObjectClass into new array class. Remove offset-by-one
+ adjustments from `method' size calculations to account for gc_descr
field.
2000-09-26 Tom Tromey <tromey@cygnus.com>
@@ -1913,7 +2908,7 @@ Sun Nov 26 21:30:25 2000 Anthony Green <green@redhat.com>
* java/lang/String.java (CASE_INSENSITIVE_ORDER): New static field.
Initialize with anonymous class.
(compareToIgnoreCase): New method.
-
+
* java/lang/ThreadGroup.java (had_uncaught_exception): New field.
(uncaughtException): Set had_uncaught_exception.
* prims.cc (JvRunMain): Check value of had_uncaught_exception and
@@ -1999,7 +2994,7 @@ Sun Nov 26 21:30:25 2000 Anthony Green <green@redhat.com>
2000-09-07 Bryce McKinlay <bryce@albatross.co.nz>
- * Makefile.am (Thread.h): Don't be friends with native threads
+ * Makefile.am (Thread.h): Don't be friends with native threads
functions.
* Makefile.in: Rebuilt.
* java/lang/Thread.java (interrupt_flag): Make package-private.
@@ -2031,7 +3026,7 @@ Sun Nov 26 21:30:25 2000 Anthony Green <green@redhat.com>
calls to `throw'.
(send): Undo last patch. Remove the label only.
(mcastGrp): Ditto.
- * java/net/natPlainSocketImpl.cc: Change various `JvThrow' calls to
+ * java/net/natPlainSocketImpl.cc: Change various `JvThrow' calls to
`throw'.
* java/net/natInetAdress.cc: Ditto.
@@ -2049,7 +3044,7 @@ Sun Nov 26 21:30:25 2000 Anthony Green <green@redhat.com>
stack. Synchronize.
* java/lang/fdlibm.h: #undef __P if previously defined.
* java/lang/natSystem.cc (currentTimeMillis): Remove unused local.
- * java/net/natPlainDatagramSocketImpl.cc (send): Remove unreachable
+ * java/net/natPlainDatagramSocketImpl.cc (send): Remove unreachable
block.
(mcastGrp): Ditto.
@@ -2060,10 +3055,10 @@ Sun Nov 26 21:30:25 2000 Anthony Green <green@redhat.com>
2000-09-04 Anthony Green <green@redhat.com>
- Fix for PR java.io/203:
- * java/io/File.java (createTempFile): Obey directory argument.
+ Fix for PR java.io/203:
+ * java/io/File.java (createTempFile): Obey directory argument.
Use java.io.tmpdir if needed. Don't leave FileDescripators open.
- * java/lang/natSystem.cc (init_properties): Use TMPDIR environment
+ * java/lang/natSystem.cc (init_properties): Use TMPDIR environment
variable to set java.io.tmpdir on non-WIN32 systems.
2000-09-04 Anthony Green <green@redhat.com>
@@ -2083,10 +3078,10 @@ Sun Nov 26 21:30:25 2000 Anthony Green <green@redhat.com>
2000-09-01 Andrew Haley <aph@redhat.com>
- * java/io/StreamTokenizer.java: Don't throw a
- NumberFormatException if a field is numeric as far as the
- StreamTokenizer is concerned but not as far as Double.valueOf() is
- concerned: return a zero instead.
+ * java/io/StreamTokenizer.java: Don't throw a
+ NumberFormatException if a field is numeric as far as the
+ StreamTokenizer is concerned but not as far as Double.valueOf() is
+ concerned: return a zero instead.
2000-08-30 Tom Tromey <tromey@cygnus.com>
@@ -2133,7 +3128,7 @@ Sun Nov 26 21:30:25 2000 Anthony Green <green@redhat.com>
java/util/SortedSet.java: Imported from GNU Classpath.
* Makefile.in: Rebuilt.
* Makefile.am: Added new files.
-
+
2000-08-26 Anthony Green <green@redhat.com>
* Makefile.in: Rebuilt.
@@ -2230,7 +3225,7 @@ Sun Aug 20 12:33:43 2000 Anthony Green <green@redhat.com>
* java/util/jar/JarFile.java: Don't call
java.util.zip.ZipFile.getEntry twice. From Mark Wielaard
<mark@klomp.org>.
-
+
Sun Aug 20 09:51:48 2000 Anthony Green <green@redhat.com>
* java/net/URLClassLoader.java: Find the JarEntry via the JarFile.
@@ -2284,7 +3279,7 @@ Sat Aug 19 11:00:53 2000 Anthony Green <green@redhat.com>
* Makefile.in, gcj/Makefile.in: Rebuilt.
* Makefile.am (ordinary_java_source_files): Add these new classes.
-
+
2000-08-16 Rolf W. Rasmussen <rolfwr@ii.uib.no>
* gnu/gcj/awt/ComponentDataBlitOp.java: New file.
@@ -2470,18 +3465,18 @@ Sun Aug 13 19:53:01 2000 Anthony Green <green@redhat.com>
John Stracke <francis@ecal.com>
* gnu/gcj/protocol/http/Connection.java (gotHeaders): Removed.
- (connect): Don't falsely claim HTTP/1.1 compliance. Call
+ (connect): Don't falsely claim HTTP/1.1 compliance. Call
getHttpHeaders().
(disconnect): Don't unset connected flag.
(getHeaderField (String)): Call connect() if not connected.
(getHeaderField (int)): Ditto.
(getHeaderFieldKey): Ditto.
- (getHttpHeaders): Don't call connect().
+ (getHttpHeaders): Don't call connect().
* java/net/HttpURLConnection.java (instanceFollowRedirects,
gotResponseVals): New fields.
(getResponseCode): Call getResponseVals() conditionally.
(getResponseMessage): Ditto.
- (getResponseVals): Call connect(). Don't throw FileNotFoundException.
+ (getResponseVals): Call connect(). Don't throw FileNotFoundException.
2000-08-09 Bryce McKinlay <bryce@albatross.co.nz>
@@ -2502,8 +3497,8 @@ Sun Aug 13 19:53:01 2000 Anthony Green <green@redhat.com>
* java/awt/geom/Point2D.java (clone): Ditto.
* java/awt/geom/RectangularShape.java (clone): Ditto.
* java/awt/image/ColorModel.java (bits, cspace, transparency, hasAlpha,
- isAlphaPremultiplied): Make package-private, not private.
-
+ isAlphaPremultiplied): Make package-private, not private.
+
2000-08-08 Tom Tromey <tromey@cygnus.com>
* gnu/gcj/convert/Input_UTF8.java (read): Fixed handling of
@@ -2569,22 +3564,22 @@ Sun Aug 13 19:53:01 2000 Anthony Green <green@redhat.com>
2000-08-03 Bryce McKinlay <bryce@albatross.co.nz>
- * Makefile.am: Add new AWT stubs.
- * java/awt/Canvas.java: New placeholder class.
- * java/awt/Checkbox.java: Ditto.
- * java/awt/CheckboxMenuItem.java: Ditto.
- * java/awt/Choice.java: Ditto.
- * java/awt/Dialog.java: Ditto.
- * java/awt/FileDialog.java: Ditto.
- * java/awt/List.java: Ditto.
- * java/awt/ScrollPane.java: Ditto.
- * java/awt/TextField.java: Ditto.
- * java/awt/datatransfer/Clipboard.java: Ditto.
- * java/awt/Component.java (treeLock): Now a static String. Add comment.
- * java/awt/MenuItem.java (MenuItem): Add default constructor.
- * java/awt/Toolkit.java: Added all methods from J2SE 1.3 API docs.
- Some commented out. Partially implemented.
- * java/awt/natToolkit.cc: Removed file.
+ * Makefile.am: Add new AWT stubs.
+ * java/awt/Canvas.java: New placeholder class.
+ * java/awt/Checkbox.java: Ditto.
+ * java/awt/CheckboxMenuItem.java: Ditto.
+ * java/awt/Choice.java: Ditto.
+ * java/awt/Dialog.java: Ditto.
+ * java/awt/FileDialog.java: Ditto.
+ * java/awt/List.java: Ditto.
+ * java/awt/ScrollPane.java: Ditto.
+ * java/awt/TextField.java: Ditto.
+ * java/awt/datatransfer/Clipboard.java: Ditto.
+ * java/awt/Component.java (treeLock): Now a static String. Add comment.
+ * java/awt/MenuItem.java (MenuItem): Add default constructor.
+ * java/awt/Toolkit.java: Added all methods from J2SE 1.3 API docs.
+ Some commented out. Partially implemented.
+ * java/awt/natToolkit.cc: Removed file.
2000-08-03 Bryce McKinlay <bryce@albatross.co.nz>
@@ -2622,26 +3617,26 @@ Sun Aug 13 19:53:01 2000 Anthony Green <green@redhat.com>
2000-08-02 Bryce McKinlay <bryce@albatross.co.nz>
- * interpret.cc (_Jv_InterpMethod::continue1): Type of `fun' changed
+ * interpret.cc (_Jv_InterpMethod::continue1): Type of `fun' changed
to match C declaration in ffi.h.
* Makefile.am: Add java/awt/Button.java.
* Makefile.in: Rebuilt.
2000-07-29 Alexandre Petit-Bianco <apbianco@cygnus.com>
- * java/lang/reflect/natMethod.cc (_Jv_CallAnyMethodA): Type of the
- cast of the second argument to `ffi_raw_call' changed to match
- prototype.
+ * java/lang/reflect/natMethod.cc (_Jv_CallAnyMethodA): Type of the
+ cast of the second argument to `ffi_raw_call' changed to match
+ prototype.
2000-07-26 Alexandre Petit-Bianco <apbianco@cygnus.com>
- * jni.cc (_Jv_JNIMethod::call): Type of the cast of the second
- argument to `ffi_raw_call' changed to match prototype.
+ * jni.cc (_Jv_JNIMethod::call): Type of the cast of the second
+ argument to `ffi_raw_call' changed to match prototype.
2000-07-31 Bryce McKinlay <bryce@albatross.co.nz>
* java/awt/Component.java (toString): Implemented.
- * java/awt/Container.java (addImpl): Remove FIXME. Only call
+ * java/awt/Container.java (addImpl): Remove FIXME. Only call
dispatchEvent() to dispatch the event.
(removeImpl): Ditto.
@@ -2837,7 +3832,7 @@ Sun Aug 13 19:53:01 2000 Anthony Green <green@redhat.com>
* java/awt/geom/RectangularShape.java: New file.
* java/awt/geom/Point2D.java (Double, Float): New inner classes.
* java/awt/geom/IllegalPathStateException.java: New file.
-
+
* scripts/showval.java: New file.
* scripts/classes.pl (scan): Print inner classes properly.
@@ -2888,26 +3883,26 @@ Sun Aug 13 19:53:01 2000 Anthony Green <green@redhat.com>
* java/util/ResourceBundle.java (getLocale): stub.
* Makefile.am: Added new AWT classes.
* Makefile.in: Rebuilt.
- * java/awt/AWTEvent.java: Add EVENT_MASK constants, isConsumed,
+ * java/awt/AWTEvent.java: Add EVENT_MASK constants, isConsumed,
constructors. Fix toString() and paramString().
* java/awt/AWTEventMulticaster.java: New class. Implemented.
* java/awt/CheckboxGroup.java: New class.
* java/awt/ColorModel.java: New class.
- * java/awt/Component.java: Added stubs for most methods. Implemented
+ * java/awt/Component.java: Added stubs for most methods. Implemented
event dispatch.
* java/awt/Container.java: ditto.
* java/awt/ComponentOrientation.java: New class. Partly implemented.
* java/awt/Cursor.java: ditto.
* java/awt/Event.java: Fix paramString().
* java/awt/EventQueue.java: New class. Implemented.
- * java/awt/Font.java: Added additional stub methods. Implemented
+ * java/awt/Font.java: Added additional stub methods. Implemented
toString().
* java/awt/FontMetrics.java: New class. Stubbed.
- * java/awt/GraphicsConfiguration.java: New class. Complete, except for
+ * java/awt/GraphicsConfiguration.java: New class. Complete, except for
Java2D parts.
* java/awt/Insets.java: New class. Implemented.
* java/awt/Menu.java: Add new methods. Partially implemented.
- * java/awt/MenuItem.java: Add new methods and fields. Partially
+ * java/awt/MenuItem.java: Add new methods and fields. Partially
implemented.
* java/awt/MenuShortcut.java: New class. Implemented.
* java/awt/Panel.java: New class. Placeholder.
@@ -2924,7 +3919,7 @@ Sun Aug 13 19:53:01 2000 Anthony Green <green@redhat.com>
* java/awt/event/HierarchyEvent.java: New class.
* java/awt/event/HierarchyListener.java: New class.
* java/awt/event/InputMethodEvent.java: Implement paramString().
- * java/awt/event/InvocationEvent.java: Implement paramString(). Throw
+ * java/awt/event/InvocationEvent.java: Implement paramString(). Throw
exception if !catchExceptions.
* java/awt/event/ItemEvent.java: Implement paramString().
* java/awt/event/KeyEvent.java: Implement paramString().
@@ -2932,7 +3927,7 @@ Sun Aug 13 19:53:01 2000 Anthony Green <green@redhat.com>
* java/awt/event/PaintEvent.java: Implement paramString().
* java/awt/event/TextEvent.java: Implement paramString().
* java/awt/event/WindowEvent.java: Implement paramString().
-
+
AWT Peer interfaces:
* java/awt/peer/ButtonPeer.java: New file.
* java/awt/peer/ListPeer.java: New file.
@@ -2997,7 +3992,7 @@ Sun Aug 13 19:53:01 2000 Anthony Green <green@redhat.com>
* java/lang/ThreadGroup.java: Added synchronized flag to many methods.
(destroyed_flag): Removed.
- (isDestroyed, removeGroup, removeThread): Test for parent == null.
+ (isDestroyed, removeGroup, removeThread): Test for parent == null.
(activeCount): Added spec note.
2000-06-27 Warren Levy <warrenl@cygnus.com>
@@ -3072,8 +4067,8 @@ Sun Aug 13 19:53:01 2000 Anthony Green <green@redhat.com>
* prims.cc (_Jv_RunMain): Don't use `main_group'.
* gnu/gcj/runtime/FirstThread.java: Remove ThreadGroup constructor
argument.
- * java/lang/Thread.java (Thread): Bootstrap initial thread from
- ThreadGroup.root if Thread.currentThread is null. Honour the
+ * java/lang/Thread.java (Thread): Bootstrap initial thread from
+ ThreadGroup.root if Thread.currentThread is null. Honour the
ThreadGroup's max priority setting.
2000-06-18 Tom Tromey <tromey@cygnus.com>
@@ -3099,11 +4094,11 @@ Sun Aug 13 19:53:01 2000 Anthony Green <green@redhat.com>
2000-06-15 Bryce McKinlay <bryce@albatross.co.nz>
Fix for PR java.lang/258:
- * prims.cc (_Jv_PrimClass): Set state of primitive class to
+ * prims.cc (_Jv_PrimClass): Set state of primitive class to
JV_STATE_DONE, to prevent accidental initialization.
- * java/lang/natClass.cc (_Jv_IsAssignableFrom): Call
+ * java/lang/natClass.cc (_Jv_IsAssignableFrom): Call
_Jv_InterfaceAssignableFrom if target is an interface and source is an
- interface or an abstract class. Remove redundant initializeClass calls.
+ interface or an abstract class. Remove redundant initializeClass calls.
Remove duplicate if_idt test.
(_Jv_InterfaceAssignableFrom): New function.
* java/lang/Class.h (_Jv_InterfaceAssignableFrom): Prototype.
@@ -3145,13 +4140,13 @@ Sun Aug 13 19:53:01 2000 Anthony Green <green@redhat.com>
Fix for PR libgcj/226:
* java/lang/Class.h (_Jv_InitClass): Don't call __builtin_expect,
since this is an installed header.
-
+
Fix for PR libgcj/228:
- * java/util/zip/ZipFile (getInputStream): Create inflater with
+ * java/util/zip/ZipFile (getInputStream): Create inflater with
nowrapper option.
-
+
* java/util/zip/natInflater.cc (inflate): Throw zlib's error message
- with DataFormatException.
+ with DataFormatException.
2000-05-20 Tom Tromey <tromey@cygnus.com>
@@ -3296,7 +4291,7 @@ Sun Aug 13 19:53:01 2000 Anthony Green <green@redhat.com>
2000-04-17 Andrew Haley <aph@cygnus.com>
- * Makefile.am: Add new files:
+ * Makefile.am: Add new files:
gnu/gcj/io/SimpleSHSStream.java, gnu/gcj/io/natSimpleSHSStream.cc,
gnu/gcj/io/shs.cc.
* Makefile.in: Rebuilt.
@@ -3320,12 +4315,12 @@ Sun Aug 13 19:53:01 2000 Anthony Green <green@redhat.com>
punctuation from the classname of an array element.
* gcj/javaprims.h: Add SimpleDigestStream.
-
+
2000-04-17 Andrew Haley <aph@cygnus.com>
* java/lang/natClass.cc (getPrivateField): Make recursive calls
to getPrivateField for superclasses.
-
+
2000-04-14 Andrew Haley <aph@cygnus.com>
* Makefile.am: Add new files:
@@ -3342,7 +4337,7 @@ Sun Aug 13 19:53:01 2000 Anthony Green <green@redhat.com>
* java/lang/natClass.cc (getPrivateField): New method.
(getPrivateMethod): Ditto.
(_Jv_IsAssignableFrom): Return false for Interface with no IDT.
- * gcj/javaprims.h: Add serialization classes.
+ * gcj/javaprims.h: Add serialization classes.
* java/io/ObjectInputStream.java (setBooleanField): Rewrite in Java.
(setByteField): Ditto.
(setCharField): Ditto.
@@ -3368,7 +4363,7 @@ Sun Aug 13 19:53:01 2000 Anthony Green <green@redhat.com>
(getDefinedSUID): Ditto.
* java/io/natObjectOutputStream.cc: New file.
* java/io/natObjectInputStream.cc: New file.
-
+
2000-04-13 Warren Levy <warrenl@cygnus.com>
* java/io/ObjectInputStream.java: Temporary workarounds for compiler
@@ -3585,7 +4580,7 @@ Sun Aug 13 19:53:01 2000 Anthony Green <green@redhat.com>
* sysdep/ia64.c (rse_address_add): Delete.
(IS_NaT_COLLECTION_ADDR): Delete.
(ia64_backtrace_helper): check for null unwind_info.
-
+
* sysdep/ia64-frame.h: add calc_caller_bsp.
* java/lang/natThrowable.cc (printRawStackTrace): Flush
@@ -3595,7 +4590,7 @@ Sun Aug 13 19:53:01 2000 Anthony Green <green@redhat.com>
(_Jv_remI): Likewise.
(_Jv_divJ): Likewise.
(_Jv_remJ): Likewise.
-
+
* interpret.cc (continue1): Use divide subroutines to guarantee
correct Java standard behaviour.
Floating-point division should not abort; make it so.
@@ -3616,7 +4611,7 @@ Sun Aug 13 19:53:01 2000 Anthony Green <green@redhat.com>
lookups on ia64.
* java/lang/natThrowable.cc(printRawStackTrace): Don't print out a
blank line.
-
+
2000-03-22 Andrew Haley <aph@cygnus.com>
* configure.host: Add -funwind-tables for IA64.
@@ -3627,7 +4622,7 @@ Sun Aug 13 19:53:01 2000 Anthony Green <green@redhat.com>
* sysdep/ia64-frame.h: New file.
* configure.in: Add sysdep/ia64.c for ia64.
* configure: Rebuilt.
-
+
2000-03-17 Andrew Haley <aph@cygnus.com>
* java/lang/natString.cc: Remove `register' keyword.
@@ -3689,7 +4684,7 @@ Sun Aug 13 19:53:01 2000 Anthony Green <green@redhat.com>
(StringBuffer (String)): Use DEFAULT_CAPACITY.
(replace): Calculate length for arraycopy() correctly.
-
+
2000-05-09 Tom Tromey <tromey@cygnus.com>
* java/lang/StringBuffer.java (toString): Don't mark buffer as
@@ -3743,7 +4738,7 @@ Sun Aug 13 19:53:01 2000 Anthony Green <green@redhat.com>
(_Jv_IsInstanceOf): Ditto.
(_Jv_CheckCast): Ditto.
(_Jv_CheckArrayStore): Ditto.
- * java/lang/Class.h (_Jv_InitClass): Ditto.
+ * java/lang/Class.h (_Jv_InitClass): Ditto.
* java/lang/natObject.cc (_Jv_MonitorEnter): __builtin_expect `false',
not `0'.
(notify): Ditto.
@@ -3967,7 +4962,7 @@ Sun Aug 13 19:53:01 2000 Anthony Green <green@redhat.com>
* include/posix-threads.h (_Jv_MutexUnlock): Replace
_JV_NOT_OWNER.
-
+
2000-04-08 Anthony Green <green@cygnus.com>
* posix-threads.cc (_Jv_MutexLock): Moved back to posix-threads.h.
@@ -4073,7 +5068,7 @@ Sun Apr 2 08:27:18 2000 Anthony Green <green@redhat.com>
* configure.in: Add --disable-jvmpi.
* include/config.h.in: Rebuilt.
* acconfig.h: Add ENABLE_JVMPI.
-
+
* include/jvm.h: Declare _Jv_DisableGC and _Jv_EnableGC.
(_Jv_JVMPI_Notify_OBJECT_ALLOC): New define.
(_Jv_JVMPI_Notify_THREAD_END): New define.
@@ -4099,12 +5094,12 @@ Sun Apr 2 08:27:18 2000 Anthony Green <green@redhat.com>
(disable_gc_mutex): Declare.
* nogc.cc (_Jv_DisableGC): New function.
(_Jv_EnableGC): New function.
-
+
* jni.cc (_Jv_JNI_GetEnv): Handle JVMPI interface requests.
(_Jv_JVMPI_Interface): Define.
(jvmpiEnableEvent): New function.
(_Jv_JNI_Init): Initialize _Jv_JVMPI_Interface.
-
+
* include/jvmpi.h: New file.
2000-03-27 Bryce McKinlay <bryce@albatross.co.nz>
@@ -4121,10 +5116,10 @@ Sun Apr 2 08:27:18 2000 Anthony Green <green@redhat.com>
the target thread by signaling its wait condition.
(_Jv_ThreadInitData): Set `thread_obj' in the thread data struct,
not the starter struct. Initialize wait_mutex and wait_cond.
- (_Jv_MutexLock): New recursive mutex implementation. Moved from
+ (_Jv_MutexLock): New recursive mutex implementation. Moved from
posix-threads.h.
(_Jv_MutexUnlock): Ditto.
- (really_start): Set info->data->thread from pthread_self() to work
+ (really_start): Set info->data->thread from pthread_self() to work
around a race condition. Destroy wait_mutex and wait_cond when run()
returns.
* java/lang/Thread.java: (isInterrupted_): Renamed to overloaded
@@ -4133,7 +5128,7 @@ Sun Apr 2 08:27:18 2000 Anthony Green <green@redhat.com>
startable_flag: New private field.
(Thread): Initialize `startable_flag'.
(toString): Check for null thread group.
- * java/lang/natThread.cc: (struct natThread): New fields
+ * java/lang/natThread.cc: (struct natThread): New fields
`join_mutex', `join_cond'. Removed fields `joiner', `next'.
(class locker): Removed.
(initialize_native): Initialize `join_cond' and `join_mutex'.
@@ -4148,7 +5143,7 @@ Sun Apr 2 08:27:18 2000 Anthony Green <green@redhat.com>
#defines and #ifdefs.
(struct _Jv_Thread_t): New fields `thread_obj', `wait_cond',
`wait_mutex', `next'.
- (struct _Jv_ConditionVariable_t): Define as a struct instead of
+ (struct _Jv_ConditionVariable_t): Define as a struct instead of
directly mapping to pthread_cond_t.
(struct _Jv_Mutex_t): New recursive implementation.
(_Jv_PthreadCheckMonitor): Reimplemented. Simple `owner' check.
@@ -4161,10 +5156,10 @@ Sun Apr 2 08:27:18 2000 Anthony Green <green@redhat.com>
(_Jv_MutexDestroy): Ditto.
(_Jv_CondDestroy): Removed.
(_Jv_PthreadGetMutex): Removed.
- * include/win32-threads.h: (_Jv_CondNotify): Guess _JV_NOT_OWNER on an
+ * include/win32-threads.h: (_Jv_CondNotify): Guess _JV_NOT_OWNER on an
error. Add a FIXME about this.
(_Jv_CondNotifyAll): Ditto.
- * win32-threads.cc: (_Jv_CondWait): Return 0 on a timeout. Guess
+ * win32-threads.cc: (_Jv_CondWait): Return 0 on a timeout. Guess
_JV_NOT_OWNER on other errors. Add FIXME.
2000-03-26 Tom Tromey <tromey@cygnus.com>
@@ -4201,7 +5196,7 @@ Sun Apr 2 08:27:18 2000 Anthony Green <green@redhat.com>
* interpret.cc (PUSHL, PUSHD, POPL, POPD, LOADL, LOADD, STOREL,
STORED): Define differently on a 64 bit machine.
(continue1): Use ffi_java_raw_call when appropriate.
-
+
2000-03-24 Warren Levy <warrenl@cygnus.com>
* java/math/BigInteger.java(divide): Handle the special case when
@@ -4232,9 +5227,9 @@ Sun Apr 2 08:27:18 2000 Anthony Green <green@redhat.com>
* java/lang/natClass.cc (isInstance): Initialize `this'.
(isAssignableFrom): Initialize `this' and `klass'.
- (_Jv_IsAssignableFrom): If an interface has no idt, it is not
+ (_Jv_IsAssignableFrom): If an interface has no idt, it is not
implemented by any loaded class, so return false.
- * java/lang/natClass.cc (isInstance): Use _Jv_IsAssignableFrom(),
+ * java/lang/natClass.cc (isInstance): Use _Jv_IsAssignableFrom(),
not Class.isAssignableFrom(). Use JV_CLASS, not getClass().
2000-03-19 Warren Levy <warrenl@cygnus.com>
@@ -4429,17 +5424,17 @@ Sun Apr 2 08:27:18 2000 Anthony Green <green@redhat.com>
* java/lang/natClass.cc (isAssignableFrom): Move functionality to
inline function `_Jv_IsAssignableFrom'. Use that function.
(isInstance): Declare `inline'.
- (initializeClass): Get lock on class before checking `state'. Unlock
- before calling resolveClass0. Call _Jv_PrepareConstantTimeTables with
+ (initializeClass): Get lock on class before checking `state'. Unlock
+ before calling resolveClass0. Call _Jv_PrepareConstantTimeTables with
the lock held.
(_Jv_LookupInterfaceMethod): Use _Jv_GetMessageString.
- (_Jv_IsAssignableFrom): New inline function. Test assignability using
+ (_Jv_IsAssignableFrom): New inline function. Test assignability using
class->depth and ancestor table.
(_Jv_IsInstanceOf): Use _Jv_IsAssignableFrom.
(_Jv_CheckCast): Move from prims.cc. Use JV_CLASS and
_Jv_IsAssignableFrom.
(_Jv_CheckArrayStore): Ditto.
- (_Jv_LookupInterfaceMethodIdx): New function.
+ (_Jv_LookupInterfaceMethodIdx): New function.
INITIAL_IOFFSETS_LEN, INITIAL_IFACES_LEN: New #defines.
(_Jv_PrepareConstantTimeTables): New function.
(_Jv_IndexOf): Ditto.
@@ -4731,7 +5726,7 @@ Sun Apr 2 08:27:18 2000 Anthony Green <green@redhat.com>
* java/lang/natRuntime.cc (_load): Include library path with
exception message.
- * java/lang/natSystem.cc (init_properties): set java.lang.classpath
+ * java/lang/natSystem.cc (init_properties): set java.lang.classpath
property.
* java/lang/natThread.cc (dumpStack): Removed.
@@ -4871,7 +5866,7 @@ Fri Feb 11 19:48:08 2000 Anthony Green <green@cygnus.com>
* java/lang/natThread.cc (stop): Don't abort, throw an exception
instead.
(suspend): Ditto.
-
+
2000-02-09 Tom Tromey <tromey@cygnus.com>
* java/lang/natRuntime.cc (_load): Call add_library.
@@ -5268,9 +6263,9 @@ Tue Jan 25 08:51:16 2000 Tom Tromey <tromey@ferrule.cygnus.com>
(printStackTrace): Call native method to do this.
(Throwable): Call fillInStackTrace.
(stackTrace): New variable.
-
+
* include/jvm.h: Add _Jv_ThisExecutable functions.
-
+
* prims.cc: (_Jv_execName): New variable.
(catch_segv): Call fillInStackTrace.
(catch_fpe): Ditto.
diff --git a/libjava/HACKING b/libjava/HACKING
new file mode 100644
index 00000000000..842617abe75
--- /dev/null
+++ b/libjava/HACKING
@@ -0,0 +1,63 @@
+Things libgcj hackers should know
+---------------------------------
+
+If you want to hack on the libgcj files you need to be aware of the
+following things. There are probably lots of other things that should be
+explained in this HACKING file. Please add them if you discover them :)
+
+--
+
+A lot of the standard library files come from the GNU Classpath project.
+<http://www.gnu.org/software/classpath/>
+The libgcj and Classpath project have officially merged, but the merge
+is not yet complete. Our eventual goal is for Classpath to be an upstream
+source provider for libgcj, however it will be some time before this becomes
+reality: libgcj and Classpath have different implementations of many core
+java classes. In order to merge them, we need to select the best (most
+efficient, cleanest) implementation of each method/class/package, resolve
+any conflicts created by the merge, and test the final result.
+
+The merged files can be recognized by the standard Classpath copyright
+comments at the top of the file. If you make changes to these files then
+you should also send a patch to the classpath mailinglist.
+<http://mail.gnu.org/mailman/listinfo/classpath/>
+<mailto:classpath@gnu.org>
+
+If you merge a libgcj class with a classpath class then you must update the
+copyright notice at the top of the file so others can see that this is a
+shared libgcj/classpath file.
+
+--
+
+If you need to add new java files to libgcj then you have to edit the
+Makefile.am file in the top (libjava) directory. And run automake.
+But note the following (thanks to Bryce McKinlay):
+
+> Do you know the magic dance I have to do when adding files to Makefile.am
+> so they will appear in Makefile.in and finally in the user generated
+> Makefile?
+Yup, you need the magic libgcj automake ;-)
+
+<ftp://ftp.freesoftware.com/.0/sourceware/java/automake-gcj-1.4.tar.gz>
+
+Install that (dont worry, it should still work for other projects), add your
+files to the Makefile.am, then just type "automake" and it will regenerate the
+Makefile.in. Easy!
+
+Tom Tromey adds:
+If you add a class to java.lang, java.io, or java.util
+(including sub-packages, like java.lang.ref).
+
+* Edit gcj/javaprims.h
+
+* Go to the `namespace java' line, and delete that entire block (the
+ entire contents of the namespace)
+
+* Then insert the output of `perl ../scripts/classes.pl' into the file
+ at that point.
+
+If you're generating a patch there is a program you can get to do an
+offline `cvs add' (it will fake an `add' if you don't have write
+permission yet). Then you can use `cvs diff -N' to generate the
+patch. See http://www.red-bean.com/cvsutils/
+
diff --git a/libjava/Makefile.am b/libjava/Makefile.am
index d57f06cefbb..a0cae954fb5 100644
--- a/libjava/Makefile.am
+++ b/libjava/Makefile.am
@@ -1,6 +1,6 @@
## Process this file with automake to produce Makefile.in.
-AUTOMAKE_OPTIONS = foreign no-installinfo
+AUTOMAKE_OPTIONS = foreign
if TESTSUBDIR
SUBDIRS = $(DIRLTDL) testsuite gcj include
@@ -23,10 +23,10 @@ toolexecdir = $(exec_prefix)/$(target_alias)
toolexeclibdir = $(toolexecdir)/lib$(MULTISUBDIR)
endif
-if NO_X
-cond_x_ltlibrary =
-else
+if XLIB_AWT
cond_x_ltlibrary = libgcjx.la
+else
+cond_x_ltlibrary =
endif
toolexeclib_LTLIBRARIES = libgcj.la $(cond_x_ltlibrary)
@@ -57,9 +57,9 @@ if CANADIAN
if NULL_TARGET
## In this case, gcj is found outside the build tree. However, zip is
## found in the build tree.
-ZIP = $(MULTIBUILDTOP)../$(COMPPATH)/fastjar/fastjar$(EXEEXT)
+ZIP = $(MULTIBUILDTOP)../$(COMPPATH)/fastjar/jar$(EXEEXT)
else
-ZIP = fastjar
+ZIP = jar
endif
GCJH = gcjh
else # CANADIAN
@@ -68,7 +68,7 @@ else # CANADIAN
## definition of GCJ won't work; instead we resort to this ugly
## definition that gives us absolute paths.
GCJH = $(MULTIBUILDTOP)../$(COMPPATH)/gcc/gcjh$(EXEEXT)
-ZIP = $(MULTIBUILDTOP)../$(COMPPATH)/fastjar/fastjar$(EXEEXT)
+ZIP = $(MULTIBUILDTOP)../$(COMPPATH)/fastjar/jar$(EXEEXT)
endif # CANADIAN
## The compiler with whatever flags we want for both -c and -C
@@ -76,8 +76,10 @@ endif # CANADIAN
GCJ_WITH_FLAGS = $(GCJ) --encoding=UTF-8
GCJCOMPILE = $(LIBTOOL) --tag=GCJ --mode=compile $(GCJ_WITH_FLAGS) -fassume-compiled -fclasspath=$(here) -L$(here) $(JC1FLAGS) -MD -MT $@ -MF $(@:.lo=.d) -c
-GCJLINK = $(LIBTOOL) --mode=link $(GCJ) -L$(here) $(JC1FLAGS) $(LDFLAGS) -o $@
-LIBLINK = $(LIBTOOL) --mode=link $(CC) -L$(here) $(JC1FLAGS) $(LDFLAGS) -o $@
+GCJLINK = $(LIBTOOL) --tag=GCJ --mode=link $(GCJ) -L$(here) $(JC1FLAGS) \
+ $(ICONV_LDFLAGS) $(LDFLAGS) -o $@
+LIBLINK = $(LIBTOOL) --tag=CC --mode=link $(CC) -L$(here) $(JC1FLAGS) \
+ $(ICONV_LDFLAGS) $(LDFLAGS) -o $@
## We define this because otherwise libtool can be run with different
## values of `CXX' and will then get confused and fail to work. So,
@@ -87,18 +89,15 @@ LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(INCLUDES) $(
JAVAC = $(GCJ_WITH_FLAGS) -C
-EH_COMMON_INCLUDE = @EH_COMMON_INCLUDE@
+GCC_UNWIND_INCLUDE = @GCC_UNWIND_INCLUDE@
WARNINGS = -W -Wall
## We need _GNU_SOURCE defined for some Linux builds. It doesn't hurt
## to always define it.
-## Note that we need -fasynchronous-exceptions because gcc is
-## currently broken with respect to exception handling in leaf
-## functions.
-AM_CXXFLAGS = -fno-rtti -fvtable-thunks -fasynchronous-exceptions \
+AM_CXXFLAGS = -fno-rtti -fnon-call-exceptions \
## Some systems don't allow `$' in identifiers by default, so we force it.
-fdollars-in-identifiers \
- @LIBGCJ_CXXFLAGS@ @EXCEPTIONSPEC@ @X_CFLAGS@ $(WARNINGS) -D_GNU_SOURCE
+ @LIBGCJ_CXXFLAGS@ @X_CFLAGS@ $(WARNINGS) -D_GNU_SOURCE
if USING_GCC
AM_CFLAGS = @LIBGCJ_CFLAGS@ $(WARNINGS)
else
@@ -106,13 +105,13 @@ AM_CFLAGS = @LIBGCJ_CFLAGS@
endif
JCFLAGS = -g
-JC1FLAGS = -g @LIBGCJ_JAVAFLAGS@
+JC1FLAGS = @LIBGCJ_JAVAFLAGS@ $(GCJFLAGS)
LIBFFIINCS = -I$(top_srcdir)/../libffi/include -I$(MULTIBUILDTOP)../libffi/include
INCLUDES = -I$(top_srcdir) -Iinclude -I$(top_srcdir)/include \
$(GCINCS) $(THREADINCS) $(INCLTDL) \
- $(EH_COMMON_INCLUDE) $(ZINCS) $(LIBFFIINCS)
+ $(GCC_UNWIND_INCLUDE) $(ZINCS) $(LIBFFIINCS)
## ################################################################
@@ -131,9 +130,6 @@ javao_files = $(java_source_files:.java=.lo) \
$(built_java_source_files:.java=.lo)
x_javao_files = $(x_java_source_files:.java=.lo)
-## Extract the libffi object file names.
-libffi_files = `$(AR) t ../libffi/.libs/libffi.a 2>/dev/null | sed 's/\.o/\.lo/g' | sed 's/^/..\/libffi\//g'`
-
libgcj_la_SOURCES = prims.cc posix.cc jni.cc exception.cc \
resolve.cc defineclass.cc interpret.cc name-finder.cc \
$(nat_source_files)
@@ -142,12 +138,11 @@ EXTRA_libgcj_la_SOURCES = boehm.cc nogc.cc posix-threads.cc no-threads.cc \
libgcj_la_DEPENDENCIES = libgcj.jar $(javao_files) \
$(c_files) $(GCOBJS) $(THREADOBJS) $(LIBLTDL)
+libgcj_la_LIBADD = $(javao_files) $(c_files) $(GCOBJS) \
+ $(THREADOBJS)
# Include THREADLIBS here to ensure that the correct version of
# certain linuxthread functions get linked:
-libgcj_la_LIBADD = $(javao_files) $(c_files) $(GCOBJS) \
- $(THREADOBJS) $(THREADLIBS) $(libffi_files) $(LIBLTDL)
-libgcj_la_LDFLAGS = -L$(here)/../libstdc++-v3/libsupc++ -lsupc++ \
- -rpath $(toolexeclibdir) \
+libgcj_la_LDFLAGS = -rpath $(toolexeclibdir) $(THREADLIBS) $(LIBLTDL) \
## The mysterious backslash is consumed by make.
-version-info `grep -v '^\#' $(srcdir)/libtool-version`
libgcj_la_LINK = $(LIBLINK)
@@ -157,7 +152,6 @@ EXTRA_libgcjx_la_SOURCES = $(x_java_source_files)
libgcjx_la_DEPENDENCIES = libgcj.jar $(x_javao_files)
libgcjx_la_LIBADD = $(x_javao_files)
libgcjx_la_LDFLAGS = @X_PRE_LIBS@ @X_LIBS@ -lX11 @X_EXTRA_LIBS@ \
- -L$(here)/../libstdc++-v3/libsupc++ -lsupc++ \
-rpath $(toolexeclibdir) \
## The mysterious backslash is consumed by make.
-version-info `grep -v '^\#' $(srcdir)/libtool-version`
@@ -262,6 +256,21 @@ $(c_files): java/lang/fdlibm.h java/lang/ieeefp.h java/lang/mprec.h
$(javao_files) $(x_javao_files): %.lo: %.java
$(GCJCOMPILE) -o $@ $<
+## Pass the list of object files to libtool in a temporary file to
+## avoid tripping platform command line length limits.
+libgcj.la: $(libgcj_la_OBJECTS) $(libgcj_la_DEPENDENCIES)
+ @echo $(libgcj_la_OBJECTS) > libgcj.objectlist;
+ @echo $(libgcj_la_LIBADD) >> libgcj.objectlist;
+ $(libgcj_la_LINK) -objectlist libgcj.objectlist \
+ ../libffi/libfficonvenience.la \
+ -rpath $(toolexeclibdir) $(libgcj_la_LDFLAGS) $(LIBS)
+
+libgcjx.la: $(libgcjx_la_OBJECTS) $(libgcjx_la_DEPENDENCIES)
+ @echo $(libgcjx_la_OBJECTS) > libgcjx.objectlist;
+ @echo $(libgcjx_la_LIBADD) >> libgcjx.objectlist;
+ $(libgcjx_la_LINK) -objectlist libgcjx.objectlist \
+ -rpath $(toolexeclibdir) $(libgcjx_la_LDFLAGS) $(LIBS)
+
## ################################################################
##
@@ -351,6 +360,9 @@ java/io/ObjectOutputStream$$PutField.h: libgcj.jar
## Headers we maintain by hand and which we want to install.
extra_headers = java/lang/Object.h java/lang/Class.h
+$(extra_headers):
+ @:
+
## Install the headers. It is fairly ugly that we have to do this by
## hand.
install-data-local:
@@ -416,7 +428,7 @@ EXTRA_jv_convert_SOURCES = $(convert_source_files)
## need this because we are explicitly using libtool to link using the
## `.la' file.
jv_convert_LDFLAGS = --main=gnu.gcj.convert.Convert \
- -rpath $(toolexeclibdir)
+ -rpath $(toolexeclibdir) -shared-libgcc
jv_convert_LINK = $(GCJLINK)
## We explicitly link in the libraries we need. This way we don't
## need -nodefaultlibs, so we can still rely on gcj picking up the
@@ -434,7 +446,7 @@ gij_SOURCES = gij.cc
## We need -nodefaultlibs because we want to avoid gcj's `-lgcj'. We
## need this because we are explicitly using libtool to link using the
## `.la' file.
-gij_LDFLAGS = -rpath $(toolexeclibdir)
+gij_LDFLAGS = -rpath $(toolexeclibdir) -shared-libgcc
gij_LINK = $(GCJLINK)
## We explicitly link in the libraries we need. This way we don't
## need -nodefaultlibs, so we can still rely on gcj picking up the
@@ -857,7 +869,6 @@ java/lang/UnsupportedOperationException.java \
java/lang/VerifyError.java \
java/lang/VirtualMachineError.java \
java/lang/Void.java \
-java/io/BlockDataException.java \
java/io/BufferedInputStream.java \
java/io/BufferedOutputStream.java \
java/io/BufferedReader.java \
@@ -981,9 +992,11 @@ java/util/StringTokenizer.java \
java/util/TimeZone.java \
java/util/Timer.java \
java/util/TimerTask.java \
+java/util/TreeMap.java \
+java/util/TreeSet.java \
java/util/TooManyListenersException.java \
-java/util/Vector.java
-#java/util/WeakHashmap.java
+java/util/Vector.java \
+java/util/WeakHashMap.java
## List of all .java files to be compiled. Please keep this list
@@ -1206,6 +1219,7 @@ java/util/zip/ZipOutputStream.java \
$(awt_java_source_files) \
$(convert_source_files)
+
java_source_files = $(special_java_source_files) $(ordinary_java_source_files)
## Math library: C, not C++
@@ -1408,6 +1422,7 @@ AM_MAKEFLAGS = \
"PICFLAG=$(PICFLAG)" \
"PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \
"SHELL=$(SHELL)" \
+ "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
"exec_prefix=$(exec_prefix)" \
"infodir=$(infodir)" \
"libdir=$(libdir)" \
@@ -1423,7 +1438,7 @@ AM_MAKEFLAGS = \
"RANLIB=$(RANLIB)" \
"DESTDIR=$(DESTDIR)"
-CONFIG_STATUS_DEPENDENCIES = $(libgcj_basedir)/configure.host
+CONFIG_STATUS_DEPENDENCIES = $(srcdir)/configure.host
MAKEOVERRIDES=
diff --git a/libjava/Makefile.in b/libjava/Makefile.in
index b7de31ca92e..f3328fc5ff9 100644
--- a/libjava/Makefile.in
+++ b/libjava/Makefile.in
@@ -75,15 +75,16 @@ DIVIDESPEC = @DIVIDESPEC@
DLLTOOL = @DLLTOOL@
EXCEPTIONSPEC = @EXCEPTIONSPEC@
EXEEXT = @EXEEXT@
-FORCELIBGCCSPEC = @FORCELIBGCCSPEC@
GCDEPS = @GCDEPS@
GCINCS = @GCINCS@
GCJ = @GCJ@
GCJFLAGS = @GCJFLAGS@
+GCJVERSION = @GCJVERSION@
GCLIBS = @GCLIBS@
GCOBJS = @GCOBJS@
GCSPEC = @GCSPEC@
GCTESTSPEC = @GCTESTSPEC@
+ICONV_LDFLAGS = @ICONV_LDFLAGS@
INCLTDL = @INCLTDL@
JC1GCSPEC = @JC1GCSPEC@
LIBDATASTARTSPEC = @LIBDATASTARTSPEC@
@@ -92,6 +93,7 @@ LIBGCJTESTSPEC = @LIBGCJTESTSPEC@
LIBGCJ_CFLAGS = @LIBGCJ_CFLAGS@
LIBGCJ_CXXFLAGS = @LIBGCJ_CXXFLAGS@
LIBGCJ_JAVAFLAGS = @LIBGCJ_JAVAFLAGS@
+LIBICONV = @LIBICONV@
LIBLTDL = @LIBLTDL@
LIBTOOL = @LIBTOOL@
LN_S = @LN_S@
@@ -118,8 +120,9 @@ ZLIBSPEC = @ZLIBSPEC@
ZLIBTESTSPEC = @ZLIBTESTSPEC@
here = @here@
libgcj_basedir = @libgcj_basedir@
+mkinstalldirs = @mkinstalldirs@
-AUTOMAKE_OPTIONS = foreign no-installinfo
+AUTOMAKE_OPTIONS = foreign
@TESTSUBDIR_TRUE@SUBDIRS = \
@TESTSUBDIR_TRUE@$(DIRLTDL) testsuite gcj include
@TESTSUBDIR_FALSE@SUBDIRS = \
@@ -130,9 +133,9 @@ AUTOMAKE_OPTIONS = foreign no-installinfo
@USE_LIBDIR_FALSE@$(toolexecdir)/lib$(MULTISUBDIR)
@USE_LIBDIR_FALSE@toolexecdir = \
@USE_LIBDIR_FALSE@$(exec_prefix)/$(target_alias)
-@NO_X_TRUE@cond_x_ltlibrary = \
-@NO_X_FALSE@cond_x_ltlibrary = \
-@NO_X_FALSE@libgcjx.la
+@XLIB_AWT_TRUE@cond_x_ltlibrary = \
+@XLIB_AWT_TRUE@libgcjx.la
+@XLIB_AWT_FALSE@cond_x_ltlibrary = \
toolexeclib_LTLIBRARIES = libgcj.la $(cond_x_ltlibrary)
toolexeclib_DATA = libgcj.spec
@@ -148,11 +151,11 @@ data_DATA = libgcj.jar
bin_SCRIPTS = addr2name.awk
@CANADIAN_TRUE@@NULL_TARGET_TRUE@ZIP = \
-@CANADIAN_TRUE@@NULL_TARGET_TRUE@$(MULTIBUILDTOP)../$(COMPPATH)/fastjar/fastjar$(EXEEXT)
+@CANADIAN_TRUE@@NULL_TARGET_TRUE@$(MULTIBUILDTOP)../$(COMPPATH)/fastjar/jar$(EXEEXT)
@CANADIAN_TRUE@@NULL_TARGET_FALSE@ZIP = \
-@CANADIAN_TRUE@@NULL_TARGET_FALSE@fastjar
+@CANADIAN_TRUE@@NULL_TARGET_FALSE@jar
@CANADIAN_FALSE@ZIP = \
-@CANADIAN_FALSE@$(MULTIBUILDTOP)../$(COMPPATH)/fastjar/fastjar$(EXEEXT)
+@CANADIAN_FALSE@$(MULTIBUILDTOP)../$(COMPPATH)/fastjar/jar$(EXEEXT)
@CANADIAN_TRUE@GCJH = \
@CANADIAN_TRUE@gcjh
@CANADIAN_FALSE@GCJH = \
@@ -161,19 +164,23 @@ bin_SCRIPTS = addr2name.awk
GCJ_WITH_FLAGS = $(GCJ) --encoding=UTF-8
GCJCOMPILE = $(LIBTOOL) --tag=GCJ --mode=compile $(GCJ_WITH_FLAGS) -fassume-compiled -fclasspath=$(here) -L$(here) $(JC1FLAGS) -MD -MT $@ -MF $(@:.lo=.d) -c
-GCJLINK = $(LIBTOOL) --mode=link $(GCJ) -L$(here) $(JC1FLAGS) $(LDFLAGS) -o $@
-LIBLINK = $(LIBTOOL) --mode=link $(CC) -L$(here) $(JC1FLAGS) $(LDFLAGS) -o $@
+GCJLINK = $(LIBTOOL) --tag=GCJ --mode=link $(GCJ) -L$(here) $(JC1FLAGS) \
+ $(ICONV_LDFLAGS) $(LDFLAGS) -o $@
+
+LIBLINK = $(LIBTOOL) --tag=CC --mode=link $(CC) -L$(here) $(JC1FLAGS) \
+ $(ICONV_LDFLAGS) $(LDFLAGS) -o $@
+
LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
JAVAC = $(GCJ_WITH_FLAGS) -C
-EH_COMMON_INCLUDE = @EH_COMMON_INCLUDE@
+GCC_UNWIND_INCLUDE = @GCC_UNWIND_INCLUDE@
WARNINGS = -W -Wall
-AM_CXXFLAGS = -fno-rtti -fvtable-thunks -fasynchronous-exceptions \
+AM_CXXFLAGS = -fno-rtti -fnon-call-exceptions \
-fdollars-in-identifiers \
- @LIBGCJ_CXXFLAGS@ @EXCEPTIONSPEC@ @X_CFLAGS@ $(WARNINGS) -D_GNU_SOURCE
+ @LIBGCJ_CXXFLAGS@ @X_CFLAGS@ $(WARNINGS) -D_GNU_SOURCE
@USING_GCC_TRUE@AM_CFLAGS = \
@USING_GCC_TRUE@@LIBGCJ_CFLAGS@ $(WARNINGS)
@@ -181,13 +188,13 @@ AM_CXXFLAGS = -fno-rtti -fvtable-thunks -fasynchronous-exceptions \
@USING_GCC_FALSE@@LIBGCJ_CFLAGS@
JCFLAGS = -g
-JC1FLAGS = -g @LIBGCJ_JAVAFLAGS@
+JC1FLAGS = @LIBGCJ_JAVAFLAGS@ $(GCJFLAGS)
LIBFFIINCS = -I$(top_srcdir)/../libffi/include -I$(MULTIBUILDTOP)../libffi/include
INCLUDES = -I$(top_srcdir) -Iinclude -I$(top_srcdir)/include \
$(GCINCS) $(THREADINCS) $(INCLTDL) \
- $(EH_COMMON_INCLUDE) $(ZINCS) $(LIBFFIINCS)
+ $(GCC_UNWIND_INCLUDE) $(ZINCS) $(LIBFFIINCS)
nat_files = $(nat_source_files:.cc=.lo)
@@ -198,8 +205,6 @@ javao_files = $(java_source_files:.java=.lo) \
x_javao_files = $(x_java_source_files:.java=.lo)
-libffi_files = `$(AR) t ../libffi/.libs/libffi.a 2>/dev/null | sed 's/\.o/\.lo/g' | sed 's/^/..\/libffi\//g'`
-
libgcj_la_SOURCES = prims.cc posix.cc jni.cc exception.cc \
resolve.cc defineclass.cc interpret.cc name-finder.cc \
$(nat_source_files)
@@ -211,13 +216,12 @@ libgcj_la_DEPENDENCIES = libgcj.jar $(javao_files) \
$(c_files) $(GCOBJS) $(THREADOBJS) $(LIBLTDL)
-# Include THREADLIBS here to ensure that the correct version of
-# certain linuxthread functions get linked:
libgcj_la_LIBADD = $(javao_files) $(c_files) $(GCOBJS) \
- $(THREADOBJS) $(THREADLIBS) $(libffi_files) $(LIBLTDL)
+ $(THREADOBJS)
-libgcj_la_LDFLAGS = -L$(here)/../libstdc++-v3/libsupc++ -lsupc++ \
- -rpath $(toolexeclibdir) \
+# Include THREADLIBS here to ensure that the correct version of
+# certain linuxthread functions get linked:
+libgcj_la_LDFLAGS = -rpath $(toolexeclibdir) $(THREADLIBS) $(LIBLTDL) \
-version-info `grep -v '^\#' $(srcdir)/libtool-version`
libgcj_la_LINK = $(LIBLINK)
@@ -227,7 +231,6 @@ EXTRA_libgcjx_la_SOURCES = $(x_java_source_files)
libgcjx_la_DEPENDENCIES = libgcj.jar $(x_javao_files)
libgcjx_la_LIBADD = $(x_javao_files)
libgcjx_la_LDFLAGS = @X_PRE_LIBS@ @X_LIBS@ -lX11 @X_EXTRA_LIBS@ \
- -L$(here)/../libstdc++-v3/libsupc++ -lsupc++ \
-rpath $(toolexeclibdir) \
-version-info `grep -v '^\#' $(srcdir)/libtool-version`
@@ -258,7 +261,7 @@ CONVERT_DIR = gnu/gcj/convert
jv_convert_SOURCES =
EXTRA_jv_convert_SOURCES = $(convert_source_files)
jv_convert_LDFLAGS = --main=gnu.gcj.convert.Convert \
- -rpath $(toolexeclibdir)
+ -rpath $(toolexeclibdir) -shared-libgcc
jv_convert_LINK = $(GCJLINK)
jv_convert_LDADD = $(convert_source_files:.java=.lo) libgcj.la \
@@ -269,7 +272,7 @@ jv_convert_DEPENDENCIES = $(convert_source_files:.java=.lo) \
gij_SOURCES = gij.cc
-gij_LDFLAGS = -rpath $(toolexeclibdir)
+gij_LDFLAGS = -rpath $(toolexeclibdir) -shared-libgcc
gij_LINK = $(GCJLINK)
gij_LDADD = libgcj.la $(GCLIBS) $(THREADLIBS) $(ZLIBS) -L$(here)/.libs
gij_DEPENDENCIES = $(GCDEPS) $(THREADDEPS) $(ZDEPS) libgcj.la libgcj.spec
@@ -619,7 +622,6 @@ java/lang/UnsupportedOperationException.java \
java/lang/VerifyError.java \
java/lang/VirtualMachineError.java \
java/lang/Void.java \
-java/io/BlockDataException.java \
java/io/BufferedInputStream.java \
java/io/BufferedOutputStream.java \
java/io/BufferedReader.java \
@@ -743,10 +745,12 @@ java/util/StringTokenizer.java \
java/util/TimeZone.java \
java/util/Timer.java \
java/util/TimerTask.java \
+java/util/TreeMap.java \
+java/util/TreeSet.java \
java/util/TooManyListenersException.java \
-java/util/Vector.java
+java/util/Vector.java \
+java/util/WeakHashMap.java
-#java/util/WeakHashmap.java
ordinary_java_source_files = $(core_java_source_files) \
gnu/gcj/RawData.java \
@@ -1107,6 +1111,7 @@ AM_MAKEFLAGS = \
"PICFLAG=$(PICFLAG)" \
"PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \
"SHELL=$(SHELL)" \
+ "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
"exec_prefix=$(exec_prefix)" \
"infodir=$(infodir)" \
"libdir=$(libdir)" \
@@ -1123,7 +1128,7 @@ AM_MAKEFLAGS = \
"DESTDIR=$(DESTDIR)"
-CONFIG_STATUS_DEPENDENCIES = $(libgcj_basedir)/configure.host
+CONFIG_STATUS_DEPENDENCIES = $(srcdir)/configure.host
MAKEOVERRIDES =
@@ -1135,7 +1140,6 @@ MULTISUBDIR =
MULTIDO = true
MULTICLEAN = true
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs
CONFIG_HEADER = ./include/config.h
CONFIG_CLEAN_FILES = libgcj.spec libgcj-test.spec
LIBRARIES = $(toolexeclib_LIBRARIES)
@@ -1468,7 +1472,7 @@ DEP_FILES = .deps/$(srcdir)/$(CONVERT_DIR)/gen-from-JIS.P \
.deps/java/beans/beancontext/BeanContextServiceRevokedListener.P \
.deps/java/beans/beancontext/BeanContextServices.P \
.deps/java/beans/beancontext/BeanContextServicesListener.P \
-.deps/java/io/BlockDataException.P .deps/java/io/BufferedInputStream.P \
+.deps/java/io/BufferedInputStream.P \
.deps/java/io/BufferedOutputStream.P .deps/java/io/BufferedReader.P \
.deps/java/io/BufferedWriter.P .deps/java/io/ByteArrayInputStream.P \
.deps/java/io/ByteArrayOutputStream.P .deps/java/io/CharArrayReader.P \
@@ -1721,10 +1725,11 @@ DEP_FILES = .deps/$(srcdir)/$(CONVERT_DIR)/gen-from-JIS.P \
.deps/java/util/SortedSet.P .deps/java/util/Stack.P \
.deps/java/util/StringTokenizer.P .deps/java/util/TimeZone.P \
.deps/java/util/Timer.P .deps/java/util/TimerTask.P \
-.deps/java/util/TooManyListenersException.P .deps/java/util/Vector.P \
-.deps/java/util/jar/Attributes.P .deps/java/util/jar/JarEntry.P \
-.deps/java/util/jar/JarException.P .deps/java/util/jar/JarFile.P \
-.deps/java/util/jar/JarInputStream.P \
+.deps/java/util/TooManyListenersException.P .deps/java/util/TreeMap.P \
+.deps/java/util/TreeSet.P .deps/java/util/Vector.P \
+.deps/java/util/WeakHashMap.P .deps/java/util/jar/Attributes.P \
+.deps/java/util/jar/JarEntry.P .deps/java/util/jar/JarException.P \
+.deps/java/util/jar/JarFile.P .deps/java/util/jar/JarInputStream.P \
.deps/java/util/jar/JarOutputStream.P .deps/java/util/jar/Manifest.P \
.deps/java/util/natGregorianCalendar.P .deps/java/util/zip/Adler32.P \
.deps/java/util/zip/CRC32.P .deps/java/util/zip/CheckedInputStream.P \
@@ -1868,12 +1873,6 @@ uninstall-toolexeclibLTLIBRARIES:
$(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(toolexeclibdir)/$$p; \
done
-libgcj.la: $(libgcj_la_OBJECTS) $(libgcj_la_DEPENDENCIES)
- $(libgcj_la_LINK) -rpath $(toolexeclibdir) $(libgcj_la_LDFLAGS) $(libgcj_la_OBJECTS) $(libgcj_la_LIBADD) $(LIBS)
-
-libgcjx.la: $(libgcjx_la_OBJECTS) $(libgcjx_la_DEPENDENCIES)
- $(libgcjx_la_LINK) -rpath $(toolexeclibdir) $(libgcjx_la_LDFLAGS) $(libgcjx_la_OBJECTS) $(libgcjx_la_LIBADD) $(LIBS)
-
mostlyclean-binPROGRAMS:
clean-binPROGRAMS:
@@ -1993,7 +1992,7 @@ uninstall-toolexeclibDATA:
@SET_MAKE@
all-recursive install-data-recursive install-exec-recursive \
-installdirs-recursive install-recursive uninstall-recursive install-info-recursive \
+installdirs-recursive install-recursive uninstall-recursive \
check-recursive installcheck-recursive info-recursive dvi-recursive:
@set fnord $(MAKEFLAGS); amf=$$2; \
dot_seen=no; \
@@ -2194,8 +2193,6 @@ check-am: all-am
check: check-recursive
installcheck-am:
installcheck: installcheck-recursive
-install-info-am:
-install-info: install-info-recursive
install-exec-am: install-toolexeclibLIBRARIES \
install-toolexeclibLTLIBRARIES install-binPROGRAMS \
install-binSCRIPTS install-toolexeclibDATA
@@ -2298,12 +2295,11 @@ maintainer-clean-recursive tags tags-recursive mostlyclean-tags \
distclean-tags clean-tags maintainer-clean-tags distdir \
mostlyclean-depend distclean-depend clean-depend \
maintainer-clean-depend info-am info dvi-am dvi check check-am \
-installcheck-am installcheck install-info-am install-info \
-install-exec-am install-exec install-data-local install-data-am \
-install-data install-am install uninstall-am uninstall all-redirect \
-all-am all installdirs-am installdirs mostlyclean-generic \
-distclean-generic clean-generic maintainer-clean-generic clean \
-mostlyclean distclean maintainer-clean
+installcheck-am installcheck install-exec-am install-exec \
+install-data-local install-data-am install-data install-am install \
+uninstall-am uninstall all-redirect all-am all installdirs-am \
+installdirs mostlyclean-generic distclean-generic clean-generic \
+maintainer-clean-generic clean mostlyclean distclean maintainer-clean
install-exec-hook:
@@ -2368,6 +2364,19 @@ $(c_files): java/lang/fdlibm.h java/lang/ieeefp.h java/lang/mprec.h
$(javao_files) $(x_javao_files): %.lo: %.java
$(GCJCOMPILE) -o $@ $<
+libgcj.la: $(libgcj_la_OBJECTS) $(libgcj_la_DEPENDENCIES)
+ @echo $(libgcj_la_OBJECTS) > libgcj.objectlist;
+ @echo $(libgcj_la_LIBADD) >> libgcj.objectlist;
+ $(libgcj_la_LINK) -objectlist libgcj.objectlist \
+ ../libffi/libfficonvenience.la \
+ -rpath $(toolexeclibdir) $(libgcj_la_LDFLAGS) $(LIBS)
+
+libgcjx.la: $(libgcjx_la_OBJECTS) $(libgcjx_la_DEPENDENCIES)
+ @echo $(libgcjx_la_OBJECTS) > libgcjx.objectlist;
+ @echo $(libgcjx_la_LIBADD) >> libgcjx.objectlist;
+ $(libgcjx_la_LINK) -objectlist libgcjx.objectlist \
+ -rpath $(toolexeclibdir) $(libgcjx_la_LDFLAGS) $(LIBS)
+
.class.h:
$(GCJH) -classpath $(top_builddir) $(basename $<)
@@ -2438,6 +2447,9 @@ java/io/ObjectOutputStream$$PutField.h: libgcj.jar
$(GCJH) -classpath $(top_builddir) \
'java/io/ObjectOutputStream$$PutField'
+$(extra_headers):
+ @:
+
install-data-local:
$(PRE_INSTALL)
@for f in $(nat_headers) $(extra_headers); do \
diff --git a/libjava/THANKS b/libjava/THANKS
index c671d362d4e..53af79a8a16 100644
--- a/libjava/THANKS
+++ b/libjava/THANKS
@@ -19,6 +19,7 @@ The GNU Classpath project for all of their merged runtime code.
Mo DeJong for gcj and libgcj bug fixes.
The GCC project contributors for all of their great compiler work.
Ivan Fontes Garcia for the Portugese translation of the FAQ.
+John Gilmore for a donation to the FSF earmarked improving GNU Java.
Anthony Green for various contributions.
Stu Grossman for gdb hacking, allowing us to debug our code.
Andrew Haley for his amazing compiler and library efforts.
diff --git a/libjava/acconfig.h b/libjava/acconfig.h
index 0a4d96544a9..0546fd7ad73 100644
--- a/libjava/acconfig.h
+++ b/libjava/acconfig.h
@@ -65,6 +65,9 @@
/* Define if struct ip_mreq is defined in netinet/in.h. */
#undef HAVE_STRUCT_IP_MREQ
+/* Define if struct ipv6_mreq is defined in netinet/in.h. */
+#undef HAVE_STRUCT_IPV6_MREQ
+
/* Define it socklen_t typedef is in sys/socket.h. */
#undef HAVE_SOCKLEN_T
diff --git a/libjava/acinclude.m4 b/libjava/acinclude.m4
index f8f2423f5eb..b782152e6ea 100644
--- a/libjava/acinclude.m4
+++ b/libjava/acinclude.m4
@@ -12,18 +12,40 @@ AC_ARG_ENABLE(multilib,
dnl We may get other options which we dont document:
dnl --with-target-subdir, --with-multisrctop, --with-multisubdir
-if test "[$]{srcdir}" = "."; then
- if test "[$]{with_target_subdir}" != "."; then
- libgcj_basedir="[$]{srcdir}/[$]{with_multisrctop}../$1"
+# When building with srcdir == objdir, links to the source files will
+# be created in directories within the target_subdir. We have to
+# adjust toplevel_srcdir accordingly, so that configure finds
+# install-sh and other auxiliary files that live in the top-level
+# source directory.
+if test "${srcdir}" = "."; then
+ if test -z "${with_target_subdir}"; then
+ toprel=".."
else
- libgcj_basedir="[$]{srcdir}/[$]{with_multisrctop}$1"
+ if test "${with_target_subdir}" != "."; then
+ toprel="${with_multisrctop}../.."
+ else
+ toprel="${with_multisrctop}.."
+ fi
fi
else
- libgcj_basedir="[$]{srcdir}/$1"
+ toprel=".."
fi
+
+libgcj_basedir=$srcdir/$toprel/$1/libjava
AC_SUBST(libgcj_basedir)
-AC_CANONICAL_HOST
+AC_CONFIG_AUX_DIR(${srcdir}/$toprel)
+if :; then :; else
+ # This overrides the previous occurrence for automake, but not for
+ # autoconf, which is exactly what we want.
+ AC_CONFIG_AUX_DIR(..)
+fi
+
+# This works around an automake problem.
+mkinstalldirs="`cd $ac_aux_dir && pwd`/mkinstalldirs"
+AC_SUBST(mkinstalldirs)
+
+AC_CANONICAL_SYSTEM
dnl This shouldn't be needed, as long as top-level dependencies are
dnl defined correctly and shared-library paths are set up so that
@@ -73,12 +95,7 @@ libgcj_cflags=
libgcj_cxxflags=
libgcj_javaflags=
-. [$]{libgcj_basedir}/configure.host
-
-case [$]{libgcj_basedir} in
-/* | [A-Za-z]:[/\\]*) libgcj_flagbasedir=[$]{libgcj_basedir} ;;
-*) libgcj_flagbasedir='[$](top_builddir)/'[$]{libgcj_basedir} ;;
-esac
+. [$]{srcdir}/configure.host
LIBGCJ_CFLAGS="[$]{libgcj_cflags}"
LIBGCJ_CXXFLAGS="[$]{libgcj_cxxflags}"
@@ -100,3 +117,78 @@ AC_DEFUN([LT_AC_PROG_GCJ],)
AC_SUBST(GCJ)
AC_SUBST(LIBTOOL)
])
+
+#serial AM2
+
+dnl From Bruno Haible.
+
+AC_DEFUN([AM_ICONV],
+[
+ dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
+ dnl those with the standalone portable GNU libiconv installed).
+
+ ICONV_LDFLAGS=
+ AC_ARG_WITH([libiconv-prefix],
+[ --with-libiconv-prefix=DIR search for libiconv in DIR/include and DIR/lib], [
+ for dir in `echo "$withval" | tr : ' '`; do
+ if test -d $dir/include; then CPPFLAGS="$CPPFLAGS -I$dir/include"; fi
+ if test -d $dir/lib; then
+ LDFLAGS="$LDFLAGS -L$dir/lib"
+ ICONV_LDFLAGS=-L$dir/lib
+ fi
+ done
+ ])
+ AC_SUBST(ICONV_LDFLAGS)
+
+ AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
+ am_cv_func_iconv="no, consider installing GNU libiconv"
+ am_cv_lib_iconv=no
+ AC_TRY_LINK([#include <stdlib.h>
+#include <iconv.h>],
+ [iconv_t cd = iconv_open("","");
+ iconv(cd,NULL,NULL,NULL,NULL);
+ iconv_close(cd);],
+ am_cv_func_iconv=yes)
+ if test "$am_cv_func_iconv" != yes; then
+ am_save_LIBS="$LIBS"
+ LIBS="$LIBS -liconv"
+ AC_TRY_LINK([#include <stdlib.h>
+#include <iconv.h>],
+ [iconv_t cd = iconv_open("","");
+ iconv(cd,NULL,NULL,NULL,NULL);
+ iconv_close(cd);],
+ am_cv_lib_iconv=yes
+ am_cv_func_iconv=yes)
+ LIBS="$am_save_LIBS"
+ fi
+ ])
+ if test "$am_cv_func_iconv" = yes; then
+ AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
+ AC_MSG_CHECKING([for iconv declaration])
+ AC_CACHE_VAL(am_cv_proto_iconv, [
+ AC_TRY_COMPILE([
+#include <stdlib.h>
+#include <iconv.h>
+extern
+#ifdef __cplusplus
+"C"
+#endif
+#if defined(__STDC__) || defined(__cplusplus)
+size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
+#else
+size_t iconv();
+#endif
+], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
+ am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"])
+ am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
+ AC_MSG_RESULT([$]{ac_t:-
+ }[$]am_cv_proto_iconv)
+ AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
+ [Define as const if the declaration of iconv() needs const.])
+ fi
+ LIBICONV=
+ if test "$am_cv_lib_iconv" = yes; then
+ LIBICONV="-liconv"
+ fi
+ AC_SUBST(LIBICONV)
+])
diff --git a/libjava/aclocal.m4 b/libjava/aclocal.m4
index a99cac3318e..ecbf62ecc32 100644
--- a/libjava/aclocal.m4
+++ b/libjava/aclocal.m4
@@ -24,18 +24,40 @@ AC_ARG_ENABLE(multilib,
dnl We may get other options which we dont document:
dnl --with-target-subdir, --with-multisrctop, --with-multisubdir
-if test "[$]{srcdir}" = "."; then
- if test "[$]{with_target_subdir}" != "."; then
- libgcj_basedir="[$]{srcdir}/[$]{with_multisrctop}../$1"
+# When building with srcdir == objdir, links to the source files will
+# be created in directories within the target_subdir. We have to
+# adjust toplevel_srcdir accordingly, so that configure finds
+# install-sh and other auxiliary files that live in the top-level
+# source directory.
+if test "${srcdir}" = "."; then
+ if test -z "${with_target_subdir}"; then
+ toprel=".."
else
- libgcj_basedir="[$]{srcdir}/[$]{with_multisrctop}$1"
+ if test "${with_target_subdir}" != "."; then
+ toprel="${with_multisrctop}../.."
+ else
+ toprel="${with_multisrctop}.."
+ fi
fi
else
- libgcj_basedir="[$]{srcdir}/$1"
+ toprel=".."
fi
+
+libgcj_basedir=$srcdir/$toprel/$1/libjava
AC_SUBST(libgcj_basedir)
-AC_CANONICAL_HOST
+AC_CONFIG_AUX_DIR(${srcdir}/$toprel)
+if :; then :; else
+ # This overrides the previous occurrence for automake, but not for
+ # autoconf, which is exactly what we want.
+ AC_CONFIG_AUX_DIR(..)
+fi
+
+# This works around an automake problem.
+mkinstalldirs="`cd $ac_aux_dir && pwd`/mkinstalldirs"
+AC_SUBST(mkinstalldirs)
+
+AC_CANONICAL_SYSTEM
dnl This shouldn't be needed, as long as top-level dependencies are
dnl defined correctly and shared-library paths are set up so that
@@ -85,12 +107,7 @@ libgcj_cflags=
libgcj_cxxflags=
libgcj_javaflags=
-. [$]{libgcj_basedir}/configure.host
-
-case [$]{libgcj_basedir} in
-/* | [A-Za-z]:[/\\]*) libgcj_flagbasedir=[$]{libgcj_basedir} ;;
-*) libgcj_flagbasedir='[$](top_builddir)/'[$]{libgcj_basedir} ;;
-esac
+. [$]{srcdir}/configure.host
LIBGCJ_CFLAGS="[$]{libgcj_cflags}"
LIBGCJ_CXXFLAGS="[$]{libgcj_cxxflags}"
@@ -113,6 +130,81 @@ AC_SUBST(GCJ)
AC_SUBST(LIBTOOL)
])
+#serial AM2
+
+dnl From Bruno Haible.
+
+AC_DEFUN([AM_ICONV],
+[
+ dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
+ dnl those with the standalone portable GNU libiconv installed).
+
+ ICONV_LDFLAGS=
+ AC_ARG_WITH([libiconv-prefix],
+[ --with-libiconv-prefix=DIR search for libiconv in DIR/include and DIR/lib], [
+ for dir in `echo "$withval" | tr : ' '`; do
+ if test -d $dir/include; then CPPFLAGS="$CPPFLAGS -I$dir/include"; fi
+ if test -d $dir/lib; then
+ LDFLAGS="$LDFLAGS -L$dir/lib"
+ ICONV_LDFLAGS=-L$dir/lib
+ fi
+ done
+ ])
+ AC_SUBST(ICONV_LDFLAGS)
+
+ AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
+ am_cv_func_iconv="no, consider installing GNU libiconv"
+ am_cv_lib_iconv=no
+ AC_TRY_LINK([#include <stdlib.h>
+#include <iconv.h>],
+ [iconv_t cd = iconv_open("","");
+ iconv(cd,NULL,NULL,NULL,NULL);
+ iconv_close(cd);],
+ am_cv_func_iconv=yes)
+ if test "$am_cv_func_iconv" != yes; then
+ am_save_LIBS="$LIBS"
+ LIBS="$LIBS -liconv"
+ AC_TRY_LINK([#include <stdlib.h>
+#include <iconv.h>],
+ [iconv_t cd = iconv_open("","");
+ iconv(cd,NULL,NULL,NULL,NULL);
+ iconv_close(cd);],
+ am_cv_lib_iconv=yes
+ am_cv_func_iconv=yes)
+ LIBS="$am_save_LIBS"
+ fi
+ ])
+ if test "$am_cv_func_iconv" = yes; then
+ AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
+ AC_MSG_CHECKING([for iconv declaration])
+ AC_CACHE_VAL(am_cv_proto_iconv, [
+ AC_TRY_COMPILE([
+#include <stdlib.h>
+#include <iconv.h>
+extern
+#ifdef __cplusplus
+"C"
+#endif
+#if defined(__STDC__) || defined(__cplusplus)
+size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
+#else
+size_t iconv();
+#endif
+], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
+ am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"])
+ am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
+ AC_MSG_RESULT([$]{ac_t:-
+ }[$]am_cv_proto_iconv)
+ AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
+ [Define as const if the declaration of iconv() needs const.])
+ fi
+ LIBICONV=
+ if test "$am_cv_lib_iconv" = yes; then
+ LIBICONV="-liconv"
+ fi
+ AC_SUBST(LIBICONV)
+])
+
# Do all the work for Automake. This macro actually does too much --
# some checks are only needed if your package does certain things.
# But this isn't really a big deal.
diff --git a/libjava/configure b/libjava/configure
index 593be38f1ba..44d6254c000 100755
--- a/libjava/configure
+++ b/libjava/configure
@@ -43,7 +43,7 @@ ac_help="$ac_help
ac_help="$ac_help
--enable-interpreter enable interpreter"
ac_help="$ac_help
- --enable-sjlj-exceptions use setjmp/longjmp exceptions"
+ --enable-sjlj-exceptions force use of builtin_setjmp for exceptions"
ac_help="$ac_help
--disable-java-net disable java.net"
ac_help="$ac_help
@@ -55,9 +55,11 @@ ac_help="$ac_help
ac_help="$ac_help
--enable-java-gc=TYPE choose garbage collector [boehm]"
ac_help="$ac_help
- --enable-threads=TYPE choose threading package"
+ --with-libiconv-prefix=DIR search for libiconv in DIR/include and DIR/lib"
ac_help="$ac_help
--with-x use the X Window System"
+ac_help="$ac_help
+ --enable-java-awt list of AWT peer implementations to be built"
# Initialize some variables set by options.
# The variables have the same names as the options, with
@@ -569,117 +571,8 @@ fi
-ac_aux_dir=
-for ac_dir in .. $srcdir/..; do
- if test -f $ac_dir/install-sh; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/install-sh -c"
- break
- elif test -f $ac_dir/install.sh; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/install.sh -c"
- break
- fi
-done
-if test -z "$ac_aux_dir"; then
- { echo "configure: error: can not find install-sh or install.sh in .. $srcdir/.." 1>&2; exit 1; }
-fi
-ac_config_guess=$ac_aux_dir/config.guess
-ac_config_sub=$ac_aux_dir/config.sub
-ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
-
-
-
-# Do some error checking and defaulting for the host and target type.
-# The inputs are:
-# configure --host=HOST --target=TARGET --build=BUILD NONOPT
-#
-# The rules are:
-# 1. You are not allowed to specify --host, --target, and nonopt at the
-# same time.
-# 2. Host defaults to nonopt.
-# 3. If nonopt is not specified, then host defaults to the current host,
-# as determined by config.guess.
-# 4. Target and build default to nonopt.
-# 5. If nonopt is not specified, then target and build default to host.
-
-# The aliases save the names the user supplied, while $host etc.
-# will get canonicalized.
-case $host---$target---$nonopt in
-NONE---*---* | *---NONE---* | *---*---NONE) ;;
-*) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;;
-esac
-
-
-# Make sure we can run config.sub.
-if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
-else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
-fi
-
-echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:621: checking host system type" >&5
-
-host_alias=$host
-case "$host_alias" in
-NONE)
- case $nonopt in
- NONE)
- if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
- else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
- fi ;;
- *) host_alias=$nonopt ;;
- esac ;;
-esac
-
-host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
-host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
-host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
-host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
-echo "$ac_t""$host" 1>&6
-
-echo $ac_n "checking target system type""... $ac_c" 1>&6
-echo "configure:642: checking target system type" >&5
-
-target_alias=$target
-case "$target_alias" in
-NONE)
- case $nonopt in
- NONE) target_alias=$host_alias ;;
- *) target_alias=$nonopt ;;
- esac ;;
-esac
-
-target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias`
-target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
-target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
-target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
-echo "$ac_t""$target" 1>&6
-
-echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:660: checking build system type" >&5
-
-build_alias=$build
-case "$build_alias" in
-NONE)
- case $nonopt in
- NONE) build_alias=$host_alias ;;
- *) build_alias=$nonopt ;;
- esac ;;
-esac
-
-build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias`
-build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
-build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
-build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
-echo "$ac_t""$build" 1>&6
-
-test "$host_alias" != "$target_alias" &&
- test "$program_prefix$program_suffix$program_transform_name" = \
- NONENONEs,x,x, &&
- program_prefix=${target_alias}-
-
echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:683: checking whether ln -s works" >&5
+echo "configure:576: checking whether ln -s works" >&5
if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -725,7 +618,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:729: checking for a BSD compatible install" >&5
+echo "configure:622: 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
@@ -778,7 +671,7 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
-echo "configure:782: checking whether build environment is sane" >&5
+echo "configure:675: checking whether build environment is sane" >&5
# Just in case
sleep 1
echo timestamp > conftestfile
@@ -835,7 +728,7 @@ test "$program_suffix" != NONE &&
test "$program_transform_name" = "" && program_transform_name="s,x,x,"
echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:839: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:732: 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
@@ -868,12 +761,12 @@ else
fi
echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
-echo "configure:872: checking for Cygwin environment" >&5
+echo "configure:765: checking for Cygwin environment" >&5
if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 877 "configure"
+#line 770 "configure"
#include "confdefs.h"
int main() {
@@ -884,7 +777,7 @@ int main() {
return __CYGWIN__;
; return 0; }
EOF
-if { (eval echo configure:888: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:781: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_cygwin=yes
else
@@ -901,19 +794,19 @@ echo "$ac_t""$ac_cv_cygwin" 1>&6
CYGWIN=
test "$ac_cv_cygwin" = yes && CYGWIN=yes
echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
-echo "configure:905: checking for mingw32 environment" >&5
+echo "configure:798: checking for mingw32 environment" >&5
if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 910 "configure"
+#line 803 "configure"
#include "confdefs.h"
int main() {
return __MINGW32__;
; return 0; }
EOF
-if { (eval echo configure:917: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:810: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_mingw32=yes
else
@@ -943,25 +836,104 @@ else
fi
+# When building with srcdir == objdir, links to the source files will
+# be created in directories within the target_subdir. We have to
+# adjust toplevel_srcdir accordingly, so that configure finds
+# install-sh and other auxiliary files that live in the top-level
+# source directory.
if test "${srcdir}" = "."; then
- if test "${with_target_subdir}" != "."; then
- libgcj_basedir="${srcdir}/${with_multisrctop}../."
+ if test -z "${with_target_subdir}"; then
+ toprel=".."
else
- libgcj_basedir="${srcdir}/${with_multisrctop}."
+ if test "${with_target_subdir}" != "."; then
+ toprel="${with_multisrctop}../.."
+ else
+ toprel="${with_multisrctop}.."
+ fi
fi
else
- libgcj_basedir="${srcdir}/."
+ toprel=".."
+fi
+
+libgcj_basedir=$srcdir/$toprel/./libjava
+
+
+ac_aux_dir=
+for ac_dir in ${srcdir}/$toprel $srcdir/${srcdir}/$toprel; do
+ if test -f $ac_dir/install-sh; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install-sh -c"
+ break
+ elif test -f $ac_dir/install.sh; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install.sh -c"
+ break
+ fi
+done
+if test -z "$ac_aux_dir"; then
+ { echo "configure: error: can not find install-sh or install.sh in ${srcdir}/$toprel $srcdir/${srcdir}/$toprel" 1>&2; exit 1; }
fi
+ac_config_guess=$ac_aux_dir/config.guess
+ac_config_sub=$ac_aux_dir/config.sub
+ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
+
+if :; then :; else
+ # This overrides the previous occurrence for automake, but not for
+ # autoconf, which is exactly what we want.
+ ac_aux_dir=
+for ac_dir in .. $srcdir/..; do
+ if test -f $ac_dir/install-sh; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install-sh -c"
+ break
+ elif test -f $ac_dir/install.sh; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install.sh -c"
+ break
+ fi
+done
+if test -z "$ac_aux_dir"; then
+ { echo "configure: error: can not find install-sh or install.sh in .. $srcdir/.." 1>&2; exit 1; }
+fi
+ac_config_guess=$ac_aux_dir/config.guess
+ac_config_sub=$ac_aux_dir/config.sub
+ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
+
+fi
+
+# This works around an automake problem.
+mkinstalldirs="`cd $ac_aux_dir && pwd`/mkinstalldirs"
+# Do some error checking and defaulting for the host and target type.
+# The inputs are:
+# configure --host=HOST --target=TARGET --build=BUILD NONOPT
+#
+# The rules are:
+# 1. You are not allowed to specify --host, --target, and nonopt at the
+# same time.
+# 2. Host defaults to nonopt.
+# 3. If nonopt is not specified, then host defaults to the current host,
+# as determined by config.guess.
+# 4. Target and build default to nonopt.
+# 5. If nonopt is not specified, then target and build default to host.
+
+# The aliases save the names the user supplied, while $host etc.
+# will get canonicalized.
+case $host---$target---$nonopt in
+NONE---*---* | *---NONE---* | *---*---NONE) ;;
+*) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;;
+esac
+
+
# Make sure we can run config.sub.
if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
fi
echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:965: checking host system type" >&5
+echo "configure:937: checking host system type" >&5
host_alias=$host
case "$host_alias" in
@@ -981,6 +953,47 @@ host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
echo "$ac_t""$host" 1>&6
+echo $ac_n "checking target system type""... $ac_c" 1>&6
+echo "configure:958: checking target system type" >&5
+
+target_alias=$target
+case "$target_alias" in
+NONE)
+ case $nonopt in
+ NONE) target_alias=$host_alias ;;
+ *) target_alias=$nonopt ;;
+ esac ;;
+esac
+
+target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias`
+target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$target" 1>&6
+
+echo $ac_n "checking build system type""... $ac_c" 1>&6
+echo "configure:976: checking build system type" >&5
+
+build_alias=$build
+case "$build_alias" in
+NONE)
+ case $nonopt in
+ NONE) build_alias=$host_alias ;;
+ *) build_alias=$nonopt ;;
+ esac ;;
+esac
+
+build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias`
+build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$build" 1>&6
+
+test "$host_alias" != "$target_alias" &&
+ test "$program_prefix$program_suffix$program_transform_name" = \
+ NONENONEs,x,x, &&
+ program_prefix=${target_alias}-
+
@@ -988,7 +1001,7 @@ echo "$ac_t""$host" 1>&6
# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:992: checking for $ac_word" >&5
+echo "configure:1005: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1018,7 +1031,7 @@ if test -z "$CC"; then
# Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1022: checking for $ac_word" >&5
+echo "configure:1035: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1069,7 +1082,7 @@ fi
# Extract the first word of "cl", so it can be a program name with args.
set dummy cl; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1073: checking for $ac_word" >&5
+echo "configure:1086: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1102,7 +1115,7 @@ fi
echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:1106: checking whether we are using GNU C" >&5
+echo "configure:1119: checking whether we are using GNU C" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1111,7 +1124,7 @@ else
yes;
#endif
EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1115: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1128: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
ac_cv_prog_gcc=yes
else
ac_cv_prog_gcc=no
@@ -1130,7 +1143,7 @@ ac_test_CFLAGS="${CFLAGS+set}"
ac_save_CFLAGS="$CFLAGS"
CFLAGS=
echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:1134: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:1147: checking whether ${CC-cc} accepts -g" >&5
if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1166,7 +1179,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:1170: checking for $ac_word" >&5
+echo "configure:1183: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1199,7 +1212,7 @@ test -n "$CXX" || CXX="gcc"
echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6
-echo "configure:1203: checking whether we are using GNU C++" >&5
+echo "configure:1216: checking whether we are using GNU C++" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1208,7 +1221,7 @@ else
yes;
#endif
EOF
-if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:1212: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:1225: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
ac_cv_prog_gxx=yes
else
ac_cv_prog_gxx=no
@@ -1227,7 +1240,7 @@ ac_test_CXXFLAGS="${CXXFLAGS+set}"
ac_save_CXXFLAGS="$CXXFLAGS"
CXXFLAGS=
echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6
-echo "configure:1231: checking whether ${CXX-g++} accepts -g" >&5
+echo "configure:1244: checking whether ${CXX-g++} accepts -g" >&5
if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1280,7 +1293,7 @@ EOF
missing_dir=`cd $ac_aux_dir && pwd`
echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
-echo "configure:1284: checking for working aclocal" >&5
+echo "configure:1297: checking for working aclocal" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh.
@@ -1293,7 +1306,7 @@ else
fi
echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
-echo "configure:1297: checking for working autoconf" >&5
+echo "configure:1310: checking for working autoconf" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh.
@@ -1306,7 +1319,7 @@ else
fi
echo $ac_n "checking for working automake""... $ac_c" 1>&6
-echo "configure:1310: checking for working automake" >&5
+echo "configure:1323: checking for working automake" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh.
@@ -1319,7 +1332,7 @@ else
fi
echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
-echo "configure:1323: checking for working autoheader" >&5
+echo "configure:1336: checking for working autoheader" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh.
@@ -1332,7 +1345,7 @@ else
fi
echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
-echo "configure:1336: checking for working makeinfo" >&5
+echo "configure:1349: checking for working makeinfo" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh.
@@ -1351,7 +1364,7 @@ fi
# LIBGCJ_CONFIGURE, which doesn't work because that means that it will
# be run before AC_CANONICAL_HOST.
echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:1355: checking build system type" >&5
+echo "configure:1368: checking build system type" >&5
build_alias=$build
case "$build_alias" in
@@ -1372,7 +1385,7 @@ echo "$ac_t""$build" 1>&6
# Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args.
set dummy ${ac_tool_prefix}as; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1376: checking for $ac_word" >&5
+echo "configure:1389: 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
@@ -1404,7 +1417,7 @@ fi
# Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
set dummy ${ac_tool_prefix}ar; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1408: checking for $ac_word" >&5
+echo "configure:1421: 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
@@ -1436,7 +1449,7 @@ fi
# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
set dummy ${ac_tool_prefix}ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1440: checking for $ac_word" >&5
+echo "configure:1453: 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
@@ -1468,7 +1481,7 @@ if test -n "$ac_tool_prefix"; 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:1472: checking for $ac_word" >&5
+echo "configure:1485: 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
@@ -1513,7 +1526,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:1517: checking for a BSD compatible install" >&5
+echo "configure:1530: 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
@@ -1567,7 +1580,7 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
-echo "configure:1571: checking whether to enable maintainer-specific portions of Makefiles" >&5
+echo "configure:1584: 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"
@@ -1601,7 +1614,7 @@ if false; then
echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:1605: checking for executable suffix" >&5
+echo "configure:1618: checking for executable suffix" >&5
if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1611,7 +1624,7 @@ else
rm -f conftest*
echo 'int main () { return 0; }' > conftest.$ac_ext
ac_cv_exeext=
- if { (eval echo configure:1615: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+ if { (eval echo configure:1628: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
for file in conftest.*; do
case $file in
*.c | *.o | *.obj) ;;
@@ -1642,12 +1655,7 @@ libgcj_cflags=
libgcj_cxxflags=
libgcj_javaflags=
-. ${libgcj_basedir}/configure.host
-
-case ${libgcj_basedir} in
-/* | A-Za-z:/\\*) libgcj_flagbasedir=${libgcj_basedir} ;;
-*) libgcj_flagbasedir='$(top_builddir)/'${libgcj_basedir} ;;
-esac
+. ${srcdir}/configure.host
LIBGCJ_CFLAGS="${libgcj_cflags}"
LIBGCJ_CXXFLAGS="${libgcj_cxxflags}"
@@ -1663,7 +1671,7 @@ LIBGCJ_JAVAFLAGS="${libgcj_javaflags}"
# Only use libltdl for native builds.
if test -z "${with_cross_host}"; then
- case "$enable_ltdl_convenience" in
+ case $enable_ltdl_convenience in
no) { echo "configure: error: this package needs a convenience libltdl" 1>&2; exit 1; } ;;
"") enable_ltdl_convenience=yes
ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
@@ -1679,6 +1687,9 @@ EOF
# Sigh. Libtool's macro doesn't do the right thing.
INCLTDL="-I\$(top_srcdir)/libltdl $INCLTDL"
+ # FIXME: this is a hack.
+ sub_auxdir="`cd $ac_aux_dir && pwd`"
+ ac_configure_args="$ac_configure_args --with-auxdir=$sub_auxdir"
fi
@@ -1687,7 +1698,7 @@ fi
if test "${enable_shared+set}" = set; then
enableval="$enable_shared"
p=${PACKAGE-default}
-case "$enableval" in
+case $enableval in
yes) enable_shared=yes ;;
no) enable_shared=no ;;
*)
@@ -1710,7 +1721,7 @@ fi
if test "${enable_static+set}" = set; then
enableval="$enable_static"
p=${PACKAGE-default}
-case "$enableval" in
+case $enableval in
yes) enable_static=yes ;;
no) enable_static=no ;;
*)
@@ -1733,7 +1744,7 @@ fi
if test "${enable_fast_install+set}" = set; then
enableval="$enable_fast_install"
p=${PACKAGE-default}
-case "$enableval" in
+case $enableval in
yes) enable_fast_install=yes ;;
no) enable_fast_install=no ;;
*)
@@ -1761,10 +1772,10 @@ else
fi
ac_prog=ld
-if test "$ac_cv_prog_gcc" = yes; then
+if test "$GCC" = yes; then
# Check if gcc -print-prog-name=ld gives a path.
echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
-echo "configure:1768: checking for ld used by GCC" >&5
+echo "configure:1779: checking for ld used by GCC" >&5
case $host in
*-*-mingw*)
# gcc leaves a trailing carriage return which upsets mingw
@@ -1772,7 +1783,7 @@ echo "configure:1768: checking for ld used by GCC" >&5
*)
ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
esac
- case "$ac_prog" in
+ case $ac_prog in
# Accept absolute paths.
[\\/]* | [A-Za-z]:[\\/]*)
re_direlt='/[^/][^/]*/\.\./'
@@ -1794,12 +1805,12 @@ echo "configure:1768: checking for ld used by GCC" >&5
esac
elif test "$with_gnu_ld" = yes; then
echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
-echo "configure:1798: checking for GNU ld" >&5
+echo "configure:1809: checking for GNU ld" >&5
else
echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
-echo "configure:1801: checking for non-GNU ld" >&5
+echo "configure:1812: checking for non-GNU ld" >&5
fi
-if eval "test \"`echo '$''{'ac_cv_path_LD'+set}'`\" = set"; then
+if eval "test \"`echo '$''{'lt_cv_path_LD'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test -z "$LD"; then
@@ -1807,11 +1818,11 @@ else
for ac_dir in $PATH; do
test -z "$ac_dir" && ac_dir=.
if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
- ac_cv_path_LD="$ac_dir/$ac_prog"
+ lt_cv_path_LD="$ac_dir/$ac_prog"
# Check to see if the program is GNU ld. I'd rather use --version,
# but apparently some GNU ld's only accept -v.
# Break only if it was the GNU/non-GNU ld that we prefer.
- if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
+ if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
test "$with_gnu_ld" != no && break
else
test "$with_gnu_ld" != yes && break
@@ -1820,11 +1831,11 @@ else
done
IFS="$ac_save_ifs"
else
- ac_cv_path_LD="$LD" # Let the user override the test with a path.
+ lt_cv_path_LD="$LD" # Let the user override the test with a path.
fi
fi
-LD="$ac_cv_path_LD"
+LD="$lt_cv_path_LD"
if test -n "$LD"; then
echo "$ac_t""$LD" 1>&6
else
@@ -1832,24 +1843,24 @@ else
fi
test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
-echo "configure:1836: checking if the linker ($LD) is GNU ld" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_gnu_ld'+set}'`\" = set"; then
+echo "configure:1847: checking if the linker ($LD) is GNU ld" >&5
+if eval "test \"`echo '$''{'lt_cv_prog_gnu_ld'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# I'd rather use --version here, but apparently some GNU ld's only accept -v.
if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
- ac_cv_prog_gnu_ld=yes
+ lt_cv_prog_gnu_ld=yes
else
- ac_cv_prog_gnu_ld=no
+ lt_cv_prog_gnu_ld=no
fi
fi
-echo "$ac_t""$ac_cv_prog_gnu_ld" 1>&6
-with_gnu_ld=$ac_cv_prog_gnu_ld
+echo "$ac_t""$lt_cv_prog_gnu_ld" 1>&6
+with_gnu_ld=$lt_cv_prog_gnu_ld
echo $ac_n "checking for $LD option to reload object files""... $ac_c" 1>&6
-echo "configure:1853: checking for $LD option to reload object files" >&5
+echo "configure:1864: checking for $LD option to reload object files" >&5
if eval "test \"`echo '$''{'lt_cv_ld_reload_flag'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1861,13 +1872,13 @@ reload_flag=$lt_cv_ld_reload_flag
test -n "$reload_flag" && reload_flag=" $reload_flag"
echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
-echo "configure:1865: checking for BSD-compatible nm" >&5
-if eval "test \"`echo '$''{'ac_cv_path_NM'+set}'`\" = set"; then
+echo "configure:1876: checking for BSD-compatible nm" >&5
+if eval "test \"`echo '$''{'lt_cv_path_NM'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test -n "$NM"; then
# Let the user override the test.
- ac_cv_path_NM="$NM"
+ lt_cv_path_NM="$NM"
else
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
@@ -1879,27 +1890,27 @@ else
# nm: unknown option "B" ignored
# Tru64's nm complains that /dev/null is an invalid object file
if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then
- ac_cv_path_NM="$tmp_nm -B"
+ lt_cv_path_NM="$tmp_nm -B"
break
elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
- ac_cv_path_NM="$tmp_nm -p"
+ lt_cv_path_NM="$tmp_nm -p"
break
else
- ac_cv_path_NM=${ac_cv_path_NM="$tmp_nm"} # keep the first match, but
+ lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
continue # so that we can try to find one that supports BSD flags
fi
fi
done
IFS="$ac_save_ifs"
- test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
+ test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
fi
fi
-NM="$ac_cv_path_NM"
+NM="$lt_cv_path_NM"
echo "$ac_t""$NM" 1>&6
echo $ac_n "checking how to recognise dependant libraries""... $ac_c" 1>&6
-echo "configure:1903: checking how to recognise dependant libraries" >&5
+echo "configure:1914: checking how to recognise dependant libraries" >&5
if eval "test \"`echo '$''{'lt_cv_deplibs_check_method'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1917,8 +1928,8 @@ lt_cv_deplibs_check_method='unknown'
# If you have `file' or equivalent on your system and you're not sure
# whether `pass_all' will *always* work, you probably want this one.
-case "$host_os" in
-aix4*)
+case $host_os in
+aix*)
lt_cv_deplibs_check_method=pass_all
;;
@@ -1927,8 +1938,8 @@ beos*)
;;
bsdi4*)
- lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
- lt_cv_file_magic_cmd='/usr/bin/file -L'
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
+ lt_cv_file_magic_cmd='/usr/bin/file -L'
lt_cv_file_magic_test_file=/shlib/libc.so
;;
@@ -1937,14 +1948,27 @@ cygwin* | mingw* |pw32*)
lt_cv_file_magic_cmd='$OBJDUMP -f'
;;
+darwin* | rhapsody*)
+ lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library'
+ lt_cv_file_magic_cmd='/usr/bin/file -L'
+ case "$host_os" in
+ rhapsody* | darwin1.012)
+ lt_cv_file_magic_test_file='/System/Library/Frameworks/System.framework/System'
+ ;;
+ *) # Darwin 1.3 on
+ lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib'
+ ;;
+ esac
+ ;;
+
freebsd* )
if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
- case "$host_cpu" in
+ case $host_cpu in
i*86 )
# Not sure whether the presence of OpenBSD here was a mistake.
# Let's accept both of them until this is cleared up.
- lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library'
- lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library'
+ lt_cv_file_magic_cmd=/usr/bin/file
lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
;;
esac
@@ -1957,29 +1981,28 @@ gnu*)
lt_cv_deplibs_check_method=pass_all
;;
-hpux10.20*)
- # TODO: Does this work for hpux-11 too?
- lt_cv_deplibs_check_method='file_magic (s0-90-90-9|PA-RISC0-9.0-9) shared library'
+hpux10.20*|hpux11*)
+ lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library'
lt_cv_file_magic_cmd=/usr/bin/file
lt_cv_file_magic_test_file=/usr/lib/libc.sl
;;
irix5* | irix6*)
- case "$host_os" in
+ case $host_os in
irix5*)
# this will be overridden with pass_all, but let us keep it just in case
lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1"
;;
*)
- case "$LD" in
+ case $LD in
*-32|*"-32 ") libmagic=32-bit;;
*-n32|*"-n32 ") libmagic=N32;;
*-64|*"-64 ") libmagic=64-bit;;
*) libmagic=never-match;;
esac
# this will be overridden with pass_all, but let us keep it just in case
- lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1"
- ;;
+ lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1"
+ ;;
esac
lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*`
lt_cv_deplibs_check_method=pass_all
@@ -1987,25 +2010,30 @@ irix5* | irix6*)
# This must be Linux ELF.
linux-gnu*)
- case "$host_cpu" in
- alpha* | i*86 | powerpc* | sparc* | ia64* )
+ case $host_cpu in
+ alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* )
lt_cv_deplibs_check_method=pass_all ;;
*)
# glibc up to 2.1.1 does not perform some relocations on ARM
- lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;;
- esac
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;;
+ esac
lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
;;
netbsd*)
- if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then :
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
else
- lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object'
- lt_cv_file_magic_cmd='/usr/bin/file -L'
- lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so$'
fi
;;
+newsos6)
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=/usr/lib/libnls.so
+ ;;
+
osf3* | osf4* | osf5*)
# this will be overridden with pass_all, but let us keep it just in case
lt_cv_deplibs_check_method='file_magic COFF format alpha shared library'
@@ -2022,14 +2050,18 @@ solaris*)
lt_cv_file_magic_test_file=/lib/libc.so
;;
+sysv5uw[78]* | sysv4*uw2*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
- case "$host_vendor" in
+ case $host_vendor in
ncr)
lt_cv_deplibs_check_method=pass_all
;;
motorola)
- lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
- lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
;;
esac
;;
@@ -2042,13 +2074,13 @@ file_magic_cmd=$lt_cv_file_magic_cmd
deplibs_check_method=$lt_cv_deplibs_check_method
echo $ac_n "checking for object suffix""... $ac_c" 1>&6
-echo "configure:2046: checking for object suffix" >&5
+echo "configure:2078: checking for object suffix" >&5
if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
rm -f conftest*
echo 'int i = 1;' > conftest.$ac_ext
-if { (eval echo configure:2052: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2084: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
for ac_file in conftest.*; do
case $ac_file in
*.c) ;;
@@ -2068,15 +2100,15 @@ ac_objext=$ac_cv_objext
# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
# Only perform the check for file, if the check method requires it
-case "$deplibs_check_method" in
+case $deplibs_check_method in
file_magic*)
if test "$file_magic_cmd" = '$MAGIC_CMD'; then
echo $ac_n "checking for ${ac_tool_prefix}file""... $ac_c" 1>&6
-echo "configure:2076: checking for ${ac_tool_prefix}file" >&5
+echo "configure:2108: checking for ${ac_tool_prefix}file" >&5
if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
- case "$MAGIC_CMD" in
+ case $MAGIC_CMD in
/*)
lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
;;
@@ -2092,7 +2124,7 @@ else
if test -f $ac_dir/${ac_tool_prefix}file; then
lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file"
if test -n "$file_magic_test_file"; then
- case "$deplibs_check_method" in
+ case $deplibs_check_method in
"file_magic "*)
file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
@@ -2134,11 +2166,11 @@ fi
if test -z "$lt_cv_path_MAGIC_CMD"; then
if test -n "$ac_tool_prefix"; then
echo $ac_n "checking for file""... $ac_c" 1>&6
-echo "configure:2138: checking for file" >&5
+echo "configure:2170: checking for file" >&5
if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
- case "$MAGIC_CMD" in
+ case $MAGIC_CMD in
/*)
lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
;;
@@ -2154,7 +2186,7 @@ else
if test -f $ac_dir/file; then
lt_cv_path_MAGIC_CMD="$ac_dir/file"
if test -n "$file_magic_test_file"; then
- case "$deplibs_check_method" in
+ case $deplibs_check_method in
"file_magic "*)
file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
@@ -2205,7 +2237,7 @@ esac
# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
set dummy ${ac_tool_prefix}ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2209: checking for $ac_word" >&5
+echo "configure:2241: 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
@@ -2237,7 +2269,7 @@ if test -n "$ac_tool_prefix"; 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:2241: checking for $ac_word" >&5
+echo "configure:2273: 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
@@ -2272,7 +2304,7 @@ fi
# Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
set dummy ${ac_tool_prefix}strip; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2276: checking for $ac_word" >&5
+echo "configure:2308: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2304,7 +2336,7 @@ if test -n "$ac_tool_prefix"; then
# Extract the first word of "strip", so it can be a program name with args.
set dummy strip; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2308: checking for $ac_word" >&5
+echo "configure:2340: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2342,8 +2374,8 @@ libtool_flags="--cache-file=$cache_file"
test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
-test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
-test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
+test "$GCC" = yes && libtool_flags="$libtool_flags --with-gcc"
+test "$lt_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
libtool_flags="$libtool_flags --enable-dlopen"
# Check whether --enable-libtool-lock or --disable-libtool-lock was given.
@@ -2368,12 +2400,12 @@ test x"$pic_mode" = xno && libtool_flags="$libtool_flags --prefer-non-pic"
# Some flags need to be propagated to the compiler or linker for good
# libtool support.
-case "$host" in
+case $host in
*-*-irix6*)
# Find out which ABI we are using.
- echo '#line 2375 "configure"' > conftest.$ac_ext
- if { (eval echo configure:2376: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- case "`/usr/bin/file conftest.o`" in
+ echo '#line 2407 "configure"' > conftest.$ac_ext
+ if { (eval echo configure:2408: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ case `/usr/bin/file conftest.$ac_objext` in
*32-bit*)
LD="${LD-ld} -32"
;;
@@ -2393,7 +2425,7 @@ case "$host" in
SAVE_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -belf"
echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6
-echo "configure:2397: checking whether the C compiler needs -belf" >&5
+echo "configure:2429: checking whether the C compiler needs -belf" >&5
if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2406,14 +2438,14 @@ ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$a
cross_compiling=$ac_cv_prog_cc_cross
cat > conftest.$ac_ext <<EOF
-#line 2410 "configure"
+#line 2442 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
-if { (eval echo configure:2417: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2449: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
lt_cv_cc_needs_belf=yes
else
@@ -2443,7 +2475,7 @@ echo "$ac_t""$lt_cv_cc_needs_belf" 1>&6
esac
echo $ac_n "checking how to run the C++ preprocessor""... $ac_c" 1>&6
-echo "configure:2447: checking how to run the C++ preprocessor" >&5
+echo "configure:2479: checking how to run the C++ preprocessor" >&5
if test -z "$CXXCPP"; then
if eval "test \"`echo '$''{'ac_cv_prog_CXXCPP'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -2456,12 +2488,12 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes
cross_compiling=$ac_cv_prog_cxx_cross
CXXCPP="${CXX-g++} -E"
cat > conftest.$ac_ext <<EOF
-#line 2460 "configure"
+#line 2492 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2465: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2497: \"$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
:
@@ -2568,12 +2600,11 @@ exec 5>>./config.log
-
LIBTOOL_DEPS=$LIBTOOL_DEPS" $ac_aux_dir/ltcf-cxx.sh"
lt_save_CC="$CC"
lt_save_CFLAGS="$CFLAGS"
AR="$AR" LTCC="$CC" CC="$CXX" CXX="$CXX" CFLAGS="$CXXFLAGS" CPPFLAGS="$CPPFLAGS" \
-MAGIC_CMD="$MAGIC_CMD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
+MAGIC_CMD="$MAGIC_CMD" LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" STRIP="$STRIP" \
AS="$AS" DLLTOOL="$DLLTOOL" OBJDUMP="$OBJDUMP" \
objext="$OBJEXT" exeext="$EXEEXT" reload_flag="$reload_flag" \
@@ -2589,7 +2620,6 @@ CFLAGS="$lt_save_CFLAGS"
# clobbered by the next message.
exec 5>>./config.log
-
@@ -2679,38 +2709,77 @@ EOF
fi
-EXCEPTIONSPEC=
+echo $ac_n "checking for exception model to use""... $ac_c" 1>&6
+echo "configure:2714: checking for exception model to use" >&5
+
+ac_ext=C
+# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cxx_cross
+
# Check whether --enable-sjlj-exceptions or --disable-sjlj-exceptions was given.
if test "${enable_sjlj_exceptions+set}" = set; then
enableval="$enable_sjlj_exceptions"
- if test "$enable_sjlj_exceptions" = yes; then
- # This can be set in configure.host.
- libgcj_sjlj=yes
+ :
+else
+ cat > conftest.$ac_ext << EOF
+#line 2729 "configure"
+struct S { ~S(); };
+void bar();
+void foo()
+{
+ S s;
+ bar();
+}
+EOF
+old_CXXFLAGS="$CXXFLAGS"
+CXXFLAGS=-S
+if { (eval echo configure:2740: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ if grep _Unwind_SjLj_Resume conftest.s >/dev/null 2>&1 ; then
+ enable_sjlj_exceptions=yes
+ elif grep _Unwind_Resume conftest.s >/dev/null 2>&1 ; then
+ enable_sjlj_exceptions=no
fi
fi
+CXXFLAGS="$old_CXXFLAGS"
+rm -f conftest*
+fi
-
-if test "$libgcj_sjlj" = yes; then
- EXCEPTIONSPEC="-fsjlj-exceptions"
- cat >> confdefs.h <<\EOF
+if test x$enable_sjlj_exceptions = xyes; then
+ cat >> confdefs.h <<\EOF
#define SJLJ_EXCEPTIONS 1
EOF
+ ac_exception_model_name=sjlj
+elif test x$enable_sjlj_exceptions = xno; then
+ ac_exception_model_name="call frame"
+else
+ { echo "configure: error: unable to detect exception model" 1>&2; exit 1; }
fi
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+echo "$ac_t""$ac_exception_model_name" 1>&6
echo $ac_n "checking for data_start""... $ac_c" 1>&6
-echo "configure:2703: checking for data_start" >&5
+echo "configure:2772: checking for data_start" >&5
LIBDATASTARTSPEC=
NEEDS_DATA_START=
cat > conftest.$ac_ext <<EOF
-#line 2707 "configure"
+#line 2776 "configure"
#include "confdefs.h"
extern int data_start;
int main() {
return ((int) &data_start);
; return 0; }
EOF
-if { (eval echo configure:2714: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2783: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
echo "$ac_t""found it" 1>&6
else
@@ -2780,7 +2849,7 @@ EOF
esac
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:2784: checking how to run the C preprocessor" >&5
+echo "configure:2853: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
@@ -2795,13 +2864,13 @@ else
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp.
cat > conftest.$ac_ext <<EOF
-#line 2799 "configure"
+#line 2868 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2805: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2874: \"$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
:
@@ -2812,13 +2881,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
-#line 2816 "configure"
+#line 2885 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2822: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2891: \"$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
:
@@ -2829,13 +2898,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -nologo -E"
cat > conftest.$ac_ext <<EOF
-#line 2833 "configure"
+#line 2902 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2839: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2908: \"$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
:
@@ -2860,7 +2929,7 @@ fi
echo "$ac_t""$CPP" 1>&6
cat > conftest.$ac_ext <<EOF
-#line 2864 "configure"
+#line 2933 "configure"
#include "confdefs.h"
#include <stdint.h>
EOF
@@ -2875,7 +2944,7 @@ fi
rm -f conftest*
cat > conftest.$ac_ext <<EOF
-#line 2879 "configure"
+#line 2948 "configure"
#include "confdefs.h"
#include <inttypes.h>
EOF
@@ -2890,7 +2959,7 @@ fi
rm -f conftest*
cat > conftest.$ac_ext <<EOF
-#line 2894 "configure"
+#line 2963 "configure"
#include "confdefs.h"
#include <sys/types.h>
EOF
@@ -2905,7 +2974,7 @@ fi
rm -f conftest*
cat > conftest.$ac_ext <<EOF
-#line 2909 "configure"
+#line 2978 "configure"
#include "confdefs.h"
#include <sys/config.h>
EOF
@@ -2922,7 +2991,7 @@ rm -f conftest*
cat > conftest.$ac_ext <<EOF
-#line 2926 "configure"
+#line 2995 "configure"
#include "confdefs.h"
#include <time.h>
EOF
@@ -2937,7 +3006,7 @@ fi
rm -f conftest*
cat > conftest.$ac_ext <<EOF
-#line 2941 "configure"
+#line 3010 "configure"
#include "confdefs.h"
#include <time.h>
EOF
@@ -2981,7 +3050,7 @@ ZLIBTESTSPEC=
libsubdir=.libs
echo $ac_n "checking for garbage collector to use""... $ac_c" 1>&6
-echo "configure:2985: checking for garbage collector to use" >&5
+echo "configure:3054: checking for garbage collector to use" >&5
# Check whether --enable-java-gc or --disable-java-gc was given.
if test "${enable_java_gc+set}" = set; then
enableval="$enable_java_gc"
@@ -3036,45 +3105,10 @@ esac
-echo $ac_n "checking for threads package to use""... $ac_c" 1>&6
-echo "configure:3041: checking for threads package to use" >&5
-# Check whether --enable-threads or --disable-threads was given.
-if test "${enable_threads+set}" = set; then
- enableval="$enable_threads"
- THREADS=$enableval
-else
- THREADS=no
-fi
-
-
-if test "$THREADS" = yes; then
- case "$host" in
- *-*-vxworks*)
- THREADS=vxworks
- ;;
- *-*-linux*)
- # FIXME: this isn't correct in all cases.
- THREADS=posix
- ;;
- *-*-win*)
- THREADS=win32
- ;;
- *-*-irix*)
- # FIXME: for now, choose POSIX, because we implement that.
- # Later, choose irix threads.
- THREADS=posix
- ;;
- *-*-solaris*)
- # FIXME: for now, choose POSIX, because we implement that.
- # Later, choose solaris threads.
- THREADS=posix
- ;;
- *)
- # For now.
- THREADS=none
- ;;
- esac
-fi
+echo $ac_n "checking for thread model used by GCC""... $ac_c" 1>&6
+echo "configure:3110: checking for thread model used by GCC" >&5
+THREADS=`$CC -v 2>&1 | sed -n 's/^Thread model: //p'`
+echo "$ac_t""$THREADS" 1>&6
case "$THREADS" in
no | none | single)
@@ -3098,7 +3132,6 @@ EOF
{ echo "configure: error: $THREADS is an unknown thread package" 1>&2; exit 1; }
;;
esac
-echo "$ac_t""$THREADS" 1>&6
THREADLIBS=
THREADINCS=
@@ -3160,16 +3193,17 @@ CANADIAN=no
NULL_TARGET=no
NATIVE=yes
-# Find eh-common.h and support headers. If we're in the tree with
+# Find unwind.h and support headers. If we're in the tree with
# gcc, then look there. Otherwise look in compat-include. If all else
# fails, just hope the user has set things up somehow.
-if test -r $srcdir/../gcc/eh-common.h; then
- EH_COMMON_INCLUDE='-I$(top_srcdir)/../gcc -I$(top_srcdir)/../include'
+echo "probing $srcdir/../gcc/unwind.h"
+if test -r $libgcj_basedir/../gcc/unwind.h; then
+ GCC_UNWIND_INCLUDE='-I$(libgcj_basedir)/../gcc'
else
if test -d $srcdir/../compat-include; then
- EH_COMMON_INCLUDE='-I$(top_srcdir)/../compat-include'
+ GCC_UNWIND_INCLUDE='-I$(top_srcdir)/../compat-include'
else
- EH_COMMON_INCLUDE=
+ GCC_UNWIND_INCLUDE=
fi
fi
@@ -3219,24 +3253,22 @@ EOF
# If Canadian cross, then don't pick up tools from the build
# directory.
- if test "$build" != "$with_cross_host"; then
+ if test x"$build" != x"$with_cross_host" && x"$build" != x"$target"; then
CANADIAN=yes
- EH_COMMON_INCLUDE=
+ GCC_UNWIND_INCLUDE=
GCJ="${target_alias}-gcj"
- else
- GCJ=
fi
NATIVE=no
else
for ac_func in strerror ioctl select fstat open fsync sleep
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3235: checking for $ac_func" >&5
+echo "configure:3267: 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 3240 "configure"
+#line 3272 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -3259,7 +3291,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:3263: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3295: \"$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
@@ -3286,12 +3318,12 @@ done
for ac_func in gmtime_r localtime_r readdir_r getpwuid_r getcwd
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3290: checking for $ac_func" >&5
+echo "configure:3322: 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 3295 "configure"
+#line 3327 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -3314,7 +3346,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:3318: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3350: \"$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
@@ -3338,15 +3370,15 @@ else
fi
done
- for ac_func in access stat mkdir rename rmdir unlink realpath
+ for ac_func in access stat mkdir rename rmdir unlink realpath utime chmod
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3345: checking for $ac_func" >&5
+echo "configure:3377: 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 3350 "configure"
+#line 3382 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -3369,7 +3401,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:3373: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3405: \"$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
@@ -3393,15 +3425,15 @@ else
fi
done
- for ac_func in iconv nl_langinfo setlocale
+ for ac_func in nl_langinfo setlocale
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3400: checking for $ac_func" >&5
+echo "configure:3432: 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 3405 "configure"
+#line 3437 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -3424,7 +3456,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:3428: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3460: \"$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
@@ -3451,12 +3483,12 @@ done
for ac_func in inet_aton inet_addr
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3455: checking for $ac_func" >&5
+echo "configure:3487: 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 3460 "configure"
+#line 3492 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -3479,7 +3511,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:3483: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3515: \"$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
@@ -3506,12 +3538,12 @@ done
for ac_func in inet_pton uname inet_ntoa
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3510: checking for $ac_func" >&5
+echo "configure:3542: 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 3515 "configure"
+#line 3547 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -3534,7 +3566,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:3538: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3570: \"$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
@@ -3561,12 +3593,12 @@ done
for ac_func in backtrace fork execvp pipe
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3565: checking for $ac_func" >&5
+echo "configure:3597: 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 3570 "configure"
+#line 3602 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -3589,7 +3621,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:3593: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3625: \"$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
@@ -3617,17 +3649,17 @@ done
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3621: checking for $ac_hdr" >&5
+echo "configure:3653: 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 3626 "configure"
+#line 3658 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3631: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3663: \"$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*
@@ -3654,7 +3686,7 @@ fi
done
echo $ac_n "checking for dladdr in -ldl""... $ac_c" 1>&6
-echo "configure:3658: checking for dladdr in -ldl" >&5
+echo "configure:3690: checking for dladdr in -ldl" >&5
ac_lib_var=`echo dl'_'dladdr | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -3662,7 +3694,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 3666 "configure"
+#line 3698 "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
@@ -3673,7 +3705,7 @@ int main() {
dladdr()
; return 0; }
EOF
-if { (eval echo configure:3677: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3709: \"$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
@@ -3702,7 +3734,7 @@ do
ac_safe=`echo "$ac_file" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_file""... $ac_c" 1>&6
-echo "configure:3706: checking for $ac_file" >&5
+echo "configure:3738: checking for $ac_file" >&5
if eval "test \"`echo '$''{'ac_cv_file_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3734,15 +3766,149 @@ fi
done
+
+
+ ICONV_LDFLAGS=
+ # Check whether --with-libiconv-prefix or --without-libiconv-prefix was given.
+if test "${with_libiconv_prefix+set}" = set; then
+ withval="$with_libiconv_prefix"
+
+ for dir in `echo "$withval" | tr : ' '`; do
+ if test -d $dir/include; then CPPFLAGS="$CPPFLAGS -I$dir/include"; fi
+ if test -d $dir/lib; then
+ LDFLAGS="$LDFLAGS -L$dir/lib"
+ ICONV_LDFLAGS=-L$dir/lib
+ fi
+ done
+
+fi
+
+
+
+ echo $ac_n "checking for iconv""... $ac_c" 1>&6
+echo "configure:3790: checking for iconv" >&5
+if eval "test \"`echo '$''{'am_cv_func_iconv'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+
+ am_cv_func_iconv="no, consider installing GNU libiconv"
+ am_cv_lib_iconv=no
+ cat > conftest.$ac_ext <<EOF
+#line 3798 "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+#include <iconv.h>
+int main() {
+iconv_t cd = iconv_open("","");
+ iconv(cd,NULL,NULL,NULL,NULL);
+ iconv_close(cd);
+; return 0; }
+EOF
+if { (eval echo configure:3808: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ am_cv_func_iconv=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+fi
+rm -f conftest*
+ if test "$am_cv_func_iconv" != yes; then
+ am_save_LIBS="$LIBS"
+ LIBS="$LIBS -liconv"
+ cat > conftest.$ac_ext <<EOF
+#line 3820 "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+#include <iconv.h>
+int main() {
+iconv_t cd = iconv_open("","");
+ iconv(cd,NULL,NULL,NULL,NULL);
+ iconv_close(cd);
+; return 0; }
+EOF
+if { (eval echo configure:3830: \"$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
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+fi
+rm -f conftest*
+ LIBS="$am_save_LIBS"
+ fi
+
+fi
+
+echo "$ac_t""$am_cv_func_iconv" 1>&6
+ if test "$am_cv_func_iconv" = yes; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_ICONV 1
+EOF
+
+ echo $ac_n "checking for iconv declaration""... $ac_c" 1>&6
+echo "configure:3851: 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 3857 "configure"
+#include "confdefs.h"
+
+#include <stdlib.h>
+#include <iconv.h>
+extern
+#ifdef __cplusplus
+"C"
+#endif
+#if defined(__STDC__) || defined(__cplusplus)
+size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
+#else
+size_t iconv();
+#endif
+
+int main() {
+
+; return 0; }
+EOF
+if { (eval echo configure:3876: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ am_cv_proto_iconv_arg1=""
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ am_cv_proto_iconv_arg1="const"
+fi
+rm -f conftest*
+ am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"
+fi
+
+ am_cv_proto_iconv=`echo "$am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
+ echo "$ac_t""${ac_t:-
+ }$am_cv_proto_iconv" 1>&6
+ cat >> confdefs.h <<EOF
+#define ICONV_CONST $am_cv_proto_iconv_arg1
+EOF
+
+ fi
+ LIBICONV=
+ if test "$am_cv_lib_iconv" = yes; then
+ LIBICONV="-liconv"
+ fi
+
+
+
for ac_func in gethostbyname_r
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3741: checking for $ac_func" >&5
+echo "configure:3907: 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 3746 "configure"
+#line 3912 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -3765,7 +3931,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:3769: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3935: \"$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
@@ -3792,7 +3958,7 @@ EOF
# We look for the one that returns `int'.
# Hopefully this check is robust enough.
cat > conftest.$ac_ext <<EOF
-#line 3796 "configure"
+#line 3962 "configure"
#include "confdefs.h"
#include <netdb.h>
EOF
@@ -3812,7 +3978,7 @@ rm -f conftest*
*" -D_REENTRANT "*) ;;
*)
echo $ac_n "checking whether gethostbyname_r declaration requires -D_REENTRANT""... $ac_c" 1>&6
-echo "configure:3816: checking whether gethostbyname_r declaration requires -D_REENTRANT" >&5
+echo "configure:3982: checking whether gethostbyname_r declaration requires -D_REENTRANT" >&5
if eval "test \"`echo '$''{'libjava_cv_gethostbyname_r_needs_reentrant'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3825,14 +3991,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 3829 "configure"
+#line 3995 "configure"
#include "confdefs.h"
#include <netdb.h>
int main() {
gethostbyname_r("", 0, 0);
; return 0; }
EOF
-if { (eval echo configure:3836: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4002: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
libjava_cv_gethostbyname_r_needs_reentrant=no
else
@@ -3842,14 +4008,14 @@ else
CPPFLAGS_SAVE="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS -D_REENTRANT"
cat > conftest.$ac_ext <<EOF
-#line 3846 "configure"
+#line 4012 "configure"
#include "confdefs.h"
#include <netdb.h>
int main() {
gethostbyname_r("", 0, 0);
; return 0; }
EOF
-if { (eval echo configure:3853: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4019: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
libjava_cv_gethostbyname_r_needs_reentrant=yes
else
@@ -3884,12 +4050,12 @@ EOF
esac
echo $ac_n "checking for struct hostent_data""... $ac_c" 1>&6
-echo "configure:3888: checking for struct hostent_data" >&5
+echo "configure:4054: checking for struct hostent_data" >&5
if eval "test \"`echo '$''{'libjava_cv_struct_hostent_data'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3893 "configure"
+#line 4059 "configure"
#include "confdefs.h"
#if GETHOSTBYNAME_R_NEEDS_REENTRANT && !defined(_REENTRANT)
@@ -3900,7 +4066,7 @@ int main() {
struct hostent_data data;
; return 0; }
EOF
-if { (eval echo configure:3904: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4070: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
libjava_cv_struct_hostent_data=yes
else
@@ -3929,12 +4095,12 @@ done
for ac_func in gethostbyaddr_r
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3933: checking for $ac_func" >&5
+echo "configure:4099: 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 3938 "configure"
+#line 4104 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -3957,7 +4123,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:3961: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4127: \"$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
@@ -3984,7 +4150,7 @@ EOF
# We look for the one that returns `int'.
# Hopefully this check is robust enough.
cat > conftest.$ac_ext <<EOF
-#line 3988 "configure"
+#line 4154 "configure"
#include "confdefs.h"
#include <netdb.h>
EOF
@@ -4008,12 +4174,12 @@ done
for ac_func in gethostname
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4012: checking for $ac_func" >&5
+echo "configure:4178: 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 4017 "configure"
+#line 4183 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -4036,7 +4202,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:4040: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4206: \"$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
@@ -4060,7 +4226,7 @@ EOF
EOF
cat > conftest.$ac_ext <<EOF
-#line 4064 "configure"
+#line 4230 "configure"
#include "confdefs.h"
#include <unistd.h>
EOF
@@ -4091,12 +4257,12 @@ done
for ac_func in pthread_mutexattr_settype pthread_mutexattr_setkind_np
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4095: checking for $ac_func" >&5
+echo "configure:4261: 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 4100 "configure"
+#line 4266 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -4119,7 +4285,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:4123: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4289: \"$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
@@ -4149,12 +4315,12 @@ done
for ac_func in sched_yield
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4153: checking for $ac_func" >&5
+echo "configure:4319: 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 4158 "configure"
+#line 4324 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -4177,7 +4343,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:4181: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4347: \"$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
@@ -4199,7 +4365,7 @@ EOF
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for sched_yield in -lrt""... $ac_c" 1>&6
-echo "configure:4203: checking for sched_yield in -lrt" >&5
+echo "configure:4369: checking for sched_yield in -lrt" >&5
ac_lib_var=`echo rt'_'sched_yield | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -4207,7 +4373,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lrt $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 4211 "configure"
+#line 4377 "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
@@ -4218,7 +4384,7 @@ int main() {
sched_yield()
; return 0; }
EOF
-if { (eval echo configure:4222: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4388: \"$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
@@ -4244,7 +4410,7 @@ else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for sched_yield in -lposix4""... $ac_c" 1>&6
-echo "configure:4248: checking for sched_yield in -lposix4" >&5
+echo "configure:4414: checking for sched_yield in -lposix4" >&5
ac_lib_var=`echo posix4'_'sched_yield | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -4252,7 +4418,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lposix4 $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 4256 "configure"
+#line 4422 "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
@@ -4263,7 +4429,7 @@ int main() {
sched_yield()
; return 0; }
EOF
-if { (eval echo configure:4267: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4433: \"$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
@@ -4299,7 +4465,7 @@ done
# We can save a little space at runtime if the mutex has m_count
# or __m_count. This is a nice hack for Linux.
cat > conftest.$ac_ext <<EOF
-#line 4303 "configure"
+#line 4469 "configure"
#include "confdefs.h"
#include <pthread.h>
int main() {
@@ -4308,7 +4474,7 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:4312: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4478: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define PTHREAD_MUTEX_HAVE_M_COUNT 1
@@ -4320,7 +4486,7 @@ else
rm -rf conftest*
cat > conftest.$ac_ext <<EOF
-#line 4324 "configure"
+#line 4490 "configure"
#include "confdefs.h"
#include <pthread.h>
int main() {
@@ -4329,7 +4495,7 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:4333: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4499: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define PTHREAD_MUTEX_HAVE___M_COUNT 1
@@ -4349,12 +4515,12 @@ rm -f conftest*
for ac_func in gettimeofday time ftime
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4353: checking for $ac_func" >&5
+echo "configure:4519: 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 4358 "configure"
+#line 4524 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -4377,7 +4543,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:4381: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4547: \"$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
@@ -4408,12 +4574,12 @@ done
for ac_func in memmove
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4412: checking for $ac_func" >&5
+echo "configure:4578: 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 4417 "configure"
+#line 4583 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -4436,7 +4602,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:4440: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4606: \"$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
@@ -4466,12 +4632,12 @@ done
for ac_func in memcpy
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4470: checking for $ac_func" >&5
+echo "configure:4636: 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 4475 "configure"
+#line 4641 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -4494,7 +4660,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:4498: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4664: \"$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
@@ -4542,7 +4708,7 @@ done
#--------------------------------------------------------------------
echo $ac_n "checking for socket libraries""... $ac_c" 1>&6
-echo "configure:4546: checking for socket libraries" >&5
+echo "configure:4712: checking for socket libraries" >&5
if eval "test \"`echo '$''{'gcj_cv_lib_sockets'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -4550,12 +4716,12 @@ else
gcj_checkBoth=0
unset ac_cv_func_connect
echo $ac_n "checking for connect""... $ac_c" 1>&6
-echo "configure:4554: checking for connect" >&5
+echo "configure:4720: checking for connect" >&5
if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4559 "configure"
+#line 4725 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char connect(); below. */
@@ -4578,7 +4744,7 @@ connect();
; return 0; }
EOF
-if { (eval echo configure:4582: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4748: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_connect=yes"
else
@@ -4601,7 +4767,7 @@ fi
if test "$gcj_checkSocket" = 1; then
unset ac_cv_func_connect
echo $ac_n "checking for main in -lsocket""... $ac_c" 1>&6
-echo "configure:4605: checking for main in -lsocket" >&5
+echo "configure:4771: checking for main in -lsocket" >&5
ac_lib_var=`echo socket'_'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
@@ -4609,14 +4775,14 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lsocket $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 4613 "configure"
+#line 4779 "configure"
#include "confdefs.h"
int main() {
main()
; return 0; }
EOF
-if { (eval echo configure:4620: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4786: \"$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
@@ -4643,12 +4809,12 @@ fi
LIBS="$LIBS -lsocket -lnsl"
unset ac_cv_func_accept
echo $ac_n "checking for accept""... $ac_c" 1>&6
-echo "configure:4647: checking for accept" >&5
+echo "configure:4813: checking for accept" >&5
if eval "test \"`echo '$''{'ac_cv_func_accept'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4652 "configure"
+#line 4818 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char accept(); below. */
@@ -4671,7 +4837,7 @@ accept();
; return 0; }
EOF
-if { (eval echo configure:4675: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4841: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_accept=yes"
else
@@ -4698,12 +4864,12 @@ fi
gcj_oldLibs=$LIBS
LIBS="$LIBS $gcj_cv_lib_sockets"
echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
-echo "configure:4702: checking for gethostbyname" >&5
+echo "configure:4868: checking for gethostbyname" >&5
if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4707 "configure"
+#line 4873 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char gethostbyname(); below. */
@@ -4726,7 +4892,7 @@ gethostbyname();
; return 0; }
EOF
-if { (eval echo configure:4730: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4896: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_gethostbyname=yes"
else
@@ -4744,7 +4910,7 @@ if eval "test \"`echo '$ac_cv_func_'gethostbyname`\" = yes"; then
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
-echo "configure:4748: checking for main in -lnsl" >&5
+echo "configure:4914: checking for main in -lnsl" >&5
ac_lib_var=`echo nsl'_'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
@@ -4752,14 +4918,14 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lnsl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 4756 "configure"
+#line 4922 "configure"
#include "confdefs.h"
int main() {
main()
; return 0; }
EOF
-if { (eval echo configure:4763: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4929: \"$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
@@ -4791,7 +4957,7 @@ echo "$ac_t""$gcj_cv_lib_sockets" 1>&6
if test "$with_system_zlib" = yes; then
echo $ac_n "checking for deflate in -lz""... $ac_c" 1>&6
-echo "configure:4795: checking for deflate in -lz" >&5
+echo "configure:4961: checking for deflate in -lz" >&5
ac_lib_var=`echo z'_'deflate | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -4799,7 +4965,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lz $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 4803 "configure"
+#line 4969 "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
@@ -4810,7 +4976,7 @@ int main() {
deflate()
; return 0; }
EOF
-if { (eval echo configure:4814: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4980: \"$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
@@ -4840,7 +5006,7 @@ fi
# requires -ldl.
if test "$GC" = boehm; then
echo $ac_n "checking for main in -ldl""... $ac_c" 1>&6
-echo "configure:4844: checking for main in -ldl" >&5
+echo "configure:5010: checking for main in -ldl" >&5
ac_lib_var=`echo dl'_'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
@@ -4848,14 +5014,14 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 4852 "configure"
+#line 5018 "configure"
#include "confdefs.h"
int main() {
main()
; return 0; }
EOF
-if { (eval echo configure:4859: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5025: \"$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
@@ -4897,11 +5063,31 @@ fi
# Create it, so that compile/link tests don't fail
test -f libgcj.spec || touch libgcj.spec
+# We must search the source tree for java.lang, since we still don't
+# have libgcj.jar nor java/lang/*.class
+GCJ_SAVE_CPPFLAGS=$CPPFLAGS
+CPPFLAGS="$CPPFLAGS -I`pwd` -I`cd $srcdir && pwd`"
+
+# Since some classes depend on this one, we need its source available
+# before we can do any GCJ compilation test :-(
+if test ! -f gnu/classpath/Configuration.java; then
+ test -d gnu || mkdir gnu
+ test -d gnu/classpath || mkdir gnu/classpath
+ sed 's,@LIBGCJDEBUG@,$LIBGCJDEBUG,' \
+ < $srcdir/gnu/classpath/Configuration.java.in \
+ > gnu/classpath/Configuration.java
+ # We do not want to redirect the output of the grep below to /dev/null,
+ # but we add /dev/null to the input list so that grep will print the
+ # filename of Configuration.java in case it finds any matches.
+ if grep @ gnu/classpath/Configuration.java /dev/null; then
+ { echo "configure: error: configure.in is missing the substitutions above" 1>&2; exit 1; }
+ fi
+fi
- # Extract the first word of "${ac_tool_prefix}gcj", so it can be a program name with args.
+# Extract the first word of "${ac_tool_prefix}gcj", so it can be a program name with args.
set dummy ${ac_tool_prefix}gcj; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4905: checking for $ac_word" >&5
+echo "configure:5091: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_GCJ'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -4933,7 +5119,7 @@ if test -n "$ac_tool_prefix"; then
# Extract the first word of "gcj", so it can be a program name with args.
set dummy gcj; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4937: checking for $ac_word" >&5
+echo "configure:5123: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_GCJ'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -4973,7 +5159,7 @@ LIBTOOL_DEPS=$LIBTOOL_DEPS" $ac_aux_dir/ltcf-gcj.sh"
lt_save_CC="$CC"
lt_save_CFLAGS="$CFLAGS"
AR="$AR" LTCC="$CC" CC="$GCJ" CFLAGS="$GCJFLAGS" CPPFLAGS="$CPPFLAGS" \
-MAGIC_CMD="$MAGIC_CMD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
+MAGIC_CMD="$MAGIC_CMD" LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" STRIP="$STRIP" \
AS="$AS" DLLTOOL="$DLLTOOL" OBJDUMP="$OBJDUMP" \
objext="$OBJEXT" exeext="$EXEEXT" reload_flag="$reload_flag" \
@@ -4992,8 +5178,10 @@ exec 5>>./config.log
+CPPFLAGS=$GCJ_SAVE_CPPFLAGS
+
echo $ac_n "checking size of void *""... $ac_c" 1>&6
-echo "configure:4997: checking size of void *" >&5
+echo "configure:5185: checking size of void *" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_void_p'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -5001,7 +5189,7 @@ else
{ echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
-#line 5005 "configure"
+#line 5193 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
@@ -5012,7 +5200,7 @@ main()
exit(0);
}
EOF
-if { (eval echo configure:5016: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:5204: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_sizeof_void_p=`cat conftestval`
else
@@ -5108,19 +5296,20 @@ EOF
+
echo $ac_n "checking for g++ -ffloat-store bug""... $ac_c" 1>&6
-echo "configure:5113: checking for g++ -ffloat-store bug" >&5
+echo "configure:5302: checking for g++ -ffloat-store bug" >&5
save_CFLAGS="$CFLAGS"
CFLAGS="-x c++ -O2 -ffloat-store"
cat > conftest.$ac_ext <<EOF
-#line 5117 "configure"
+#line 5306 "configure"
#include "confdefs.h"
#include <math.h>
int main() {
; return 0; }
EOF
-if { (eval echo configure:5124: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5313: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
echo "$ac_t""no" 1>&6
else
@@ -5140,17 +5329,17 @@ for ac_hdr in unistd.h bstring.h sys/time.h sys/types.h fcntl.h sys/ioctl.h sys/
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5144: checking for $ac_hdr" >&5
+echo "configure:5333: 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 5149 "configure"
+#line 5338 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5154: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5343: \"$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*
@@ -5180,17 +5369,17 @@ for ac_hdr in dirent.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5184: checking for $ac_hdr" >&5
+echo "configure:5373: 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 5189 "configure"
+#line 5378 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5194: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5383: \"$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*
@@ -5218,12 +5407,12 @@ done
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:5222: checking for ANSI C header files" >&5
+echo "configure:5411: 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 5227 "configure"
+#line 5416 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
@@ -5231,7 +5420,7 @@ else
#include <float.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5235: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5424: \"$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*
@@ -5248,7 +5437,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 5252 "configure"
+#line 5441 "configure"
#include "confdefs.h"
#include <string.h>
EOF
@@ -5266,7 +5455,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 5270 "configure"
+#line 5459 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
@@ -5287,7 +5476,7 @@ if test "$cross_compiling" = yes; then
:
else
cat > conftest.$ac_ext <<EOF
-#line 5291 "configure"
+#line 5480 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -5298,7 +5487,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); }
EOF
-if { (eval echo configure:5302: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:5491: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
:
else
@@ -5322,12 +5511,12 @@ EOF
fi
echo $ac_n "checking for ssize_t""... $ac_c" 1>&6
-echo "configure:5326: checking for ssize_t" >&5
+echo "configure:5515: 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 5331 "configure"
+#line 5520 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -5356,9 +5545,9 @@ fi
echo $ac_n "checking for in_addr_t""... $ac_c" 1>&6
-echo "configure:5360: checking for in_addr_t" >&5
+echo "configure:5549: checking for in_addr_t" >&5
cat > conftest.$ac_ext <<EOF
-#line 5362 "configure"
+#line 5551 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -5372,7 +5561,7 @@ int main() {
in_addr_t foo;
; return 0; }
EOF
-if { (eval echo configure:5376: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5565: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define HAVE_IN_ADDR_T 1
@@ -5388,16 +5577,16 @@ fi
rm -f conftest*
echo $ac_n "checking whether struct ip_mreq is in netinet/in.h""... $ac_c" 1>&6
-echo "configure:5392: checking whether struct ip_mreq is in netinet/in.h" >&5
+echo "configure:5581: checking whether struct ip_mreq is in netinet/in.h" >&5
cat > conftest.$ac_ext <<EOF
-#line 5394 "configure"
+#line 5583 "configure"
#include "confdefs.h"
#include <netinet/in.h>
int main() {
struct ip_mreq mreq;
; return 0; }
EOF
-if { (eval echo configure:5401: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5590: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define HAVE_STRUCT_IP_MREQ 1
@@ -5412,17 +5601,42 @@ else
fi
rm -f conftest*
+echo $ac_n "checking whether struct ipv6_mreq is in netinet/in.h""... $ac_c" 1>&6
+echo "configure:5606: checking whether struct ipv6_mreq is in netinet/in.h" >&5
+cat > conftest.$ac_ext <<EOF
+#line 5608 "configure"
+#include "confdefs.h"
+#include <netinet/in.h>
+int main() {
+struct ipv6_mreq mreq6;
+; return 0; }
+EOF
+if { (eval echo configure:5615: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ cat >> confdefs.h <<\EOF
+#define HAVE_STRUCT_IPV6_MREQ 1
+EOF
+
+ echo "$ac_t""yes" 1>&6
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ echo "$ac_t""no" 1>&6
+fi
+rm -f conftest*
+
echo $ac_n "checking whether struct sockaddr_in6 is in netinet/in.h""... $ac_c" 1>&6
-echo "configure:5417: checking whether struct sockaddr_in6 is in netinet/in.h" >&5
+echo "configure:5631: checking whether struct sockaddr_in6 is in netinet/in.h" >&5
cat > conftest.$ac_ext <<EOF
-#line 5419 "configure"
+#line 5633 "configure"
#include "confdefs.h"
#include <netinet/in.h>
int main() {
struct sockaddr_in6 addr6;
; return 0; }
EOF
-if { (eval echo configure:5426: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5640: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define HAVE_INET6 1
@@ -5438,17 +5652,18 @@ fi
rm -f conftest*
echo $ac_n "checking for socklen_t in sys/socket.h""... $ac_c" 1>&6
-echo "configure:5442: checking for socklen_t in sys/socket.h" >&5
+echo "configure:5656: checking for socklen_t in sys/socket.h" >&5
cat > conftest.$ac_ext <<EOF
-#line 5444 "configure"
+#line 5658 "configure"
#include "confdefs.h"
+#define _POSIX_PII_SOCKET
#include <sys/types.h>
#include <sys/socket.h>
int main() {
socklen_t x = 5;
; return 0; }
EOF
-if { (eval echo configure:5452: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5667: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define HAVE_SOCKLEN_T 1
@@ -5464,16 +5679,16 @@ fi
rm -f conftest*
echo $ac_n "checking for tm_gmtoff in struct tm""... $ac_c" 1>&6
-echo "configure:5468: checking for tm_gmtoff in struct tm" >&5
+echo "configure:5683: checking for tm_gmtoff in struct tm" >&5
cat > conftest.$ac_ext <<EOF
-#line 5470 "configure"
+#line 5685 "configure"
#include "confdefs.h"
#include <time.h>
int main() {
struct tm tim; tim.tm_gmtoff = 0;
; return 0; }
EOF
-if { (eval echo configure:5477: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5692: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define STRUCT_TM_HAS_GMTOFF 1
@@ -5486,16 +5701,16 @@ else
rm -rf conftest*
echo "$ac_t""no" 1>&6
echo $ac_n "checking for global timezone variable""... $ac_c" 1>&6
-echo "configure:5490: checking for global timezone variable" >&5
+echo "configure:5705: checking for global timezone variable" >&5
cat > conftest.$ac_ext <<EOF
-#line 5492 "configure"
+#line 5707 "configure"
#include "confdefs.h"
#include <time.h>
int main() {
long z2 = timezone;
; return 0; }
EOF
-if { (eval echo configure:5499: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5714: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define HAVE_TIMEZONE 1
@@ -5515,19 +5730,19 @@ rm -f conftest*
# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
# for constant arguments. Useless!
echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
-echo "configure:5519: checking for working alloca.h" >&5
+echo "configure:5734: 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 5524 "configure"
+#line 5739 "configure"
#include "confdefs.h"
#include <alloca.h>
int main() {
char *p = alloca(2 * sizeof(int));
; return 0; }
EOF
-if { (eval echo configure:5531: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5746: \"$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
@@ -5548,12 +5763,12 @@ EOF
fi
echo $ac_n "checking for alloca""... $ac_c" 1>&6
-echo "configure:5552: checking for alloca" >&5
+echo "configure:5767: 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 5557 "configure"
+#line 5772 "configure"
#include "confdefs.h"
#ifdef __GNUC__
@@ -5581,7 +5796,7 @@ int main() {
char *p = (char *) alloca(1);
; return 0; }
EOF
-if { (eval echo configure:5585: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5800: \"$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
@@ -5613,12 +5828,12 @@ EOF
echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-echo "configure:5617: checking whether alloca needs Cray hooks" >&5
+echo "configure:5832: 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 5622 "configure"
+#line 5837 "configure"
#include "confdefs.h"
#if defined(CRAY) && ! defined(CRAY2)
webecray
@@ -5643,12 +5858,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:5647: checking for $ac_func" >&5
+echo "configure:5862: 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 5652 "configure"
+#line 5867 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -5671,7 +5886,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:5675: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5890: \"$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
@@ -5698,7 +5913,7 @@ done
fi
echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-echo "configure:5702: checking stack direction for C alloca" >&5
+echo "configure:5917: 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
@@ -5706,7 +5921,7 @@ else
ac_cv_c_stack_direction=0
else
cat > conftest.$ac_ext <<EOF
-#line 5710 "configure"
+#line 5925 "configure"
#include "confdefs.h"
find_stack_direction ()
{
@@ -5725,7 +5940,7 @@ main ()
exit (find_stack_direction() < 0);
}
EOF
-if { (eval echo configure:5729: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:5944: \"$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
@@ -5752,7 +5967,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:5756: checking for $ac_word" >&5
+echo "configure:5971: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_PERL'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -5792,9 +6007,15 @@ case "${host}" in
sparc-sun-solaris*)
SIGNAL_HANDLER=include/sparc-signal.h
;;
- ia64-*)
- SYSDEP_SOURCES=sysdep/ia64.c
- test -d sysdep || mkdir sysdep
+# ia64-*)
+# SYSDEP_SOURCES=sysdep/ia64.c
+# test -d sysdep || mkdir sysdep
+# ;;
+ powerpc-*-linux*)
+ SIGNAL_HANDLER=include/dwarf2-signal.h
+ ;;
+ alpha*-*-linux*)
+ SIGNAL_HANDLER=include/dwarf2-signal.h
;;
*)
SIGNAL_HANDLER=include/default-signal.h
@@ -5802,7 +6023,7 @@ case "${host}" in
esac
# If we're using sjlj exceptions, forget what we just learned.
-if test "$libgcj_sjlj" = yes; then
+if test "$enable_sjlj_exceptions" = yes; then
SIGNAL_HANDLER=include/default-signal.h
fi
@@ -5821,7 +6042,7 @@ fi
# Uses ac_ vars as temps to allow command line to override cache and checks.
# --without-x overrides everything else, but does not touch the cache.
echo $ac_n "checking for X""... $ac_c" 1>&6
-echo "configure:5825: checking for X" >&5
+echo "configure:6046: checking for X" >&5
# Check whether --with-x or --without-x was given.
if test "${with_x+set}" = set; then
@@ -5883,12 +6104,12 @@ if test "$ac_x_includes" = NO; then
# First, try using that file with no special directory specified.
cat > conftest.$ac_ext <<EOF
-#line 5887 "configure"
+#line 6108 "configure"
#include "confdefs.h"
#include <$x_direct_test_include>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5892: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6113: \"$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*
@@ -5957,14 +6178,14 @@ if test "$ac_x_libraries" = NO; then
ac_save_LIBS="$LIBS"
LIBS="-l$x_direct_test_library $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 5961 "configure"
+#line 6182 "configure"
#include "confdefs.h"
int main() {
${x_direct_test_function}()
; return 0; }
EOF
-if { (eval echo configure:5968: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6189: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
LIBS="$ac_save_LIBS"
# We can link X programs with no special library path.
@@ -6070,17 +6291,17 @@ else
case "`(uname -sr) 2>/dev/null`" in
"SunOS 5"*)
echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6
-echo "configure:6074: checking whether -R must be followed by a space" >&5
+echo "configure:6295: checking whether -R must be followed by a space" >&5
ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries"
cat > conftest.$ac_ext <<EOF
-#line 6077 "configure"
+#line 6298 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
-if { (eval echo configure:6084: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6305: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_R_nospace=yes
else
@@ -6096,14 +6317,14 @@ rm -f conftest*
else
LIBS="$ac_xsave_LIBS -R $x_libraries"
cat > conftest.$ac_ext <<EOF
-#line 6100 "configure"
+#line 6321 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
-if { (eval echo configure:6107: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6328: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_R_space=yes
else
@@ -6135,7 +6356,7 @@ rm -f conftest*
# libraries were built with DECnet support. And karl@cs.umb.edu says
# the Alpha needs dnet_stub (dnet does not exist).
echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6
-echo "configure:6139: checking for dnet_ntoa in -ldnet" >&5
+echo "configure:6360: checking for dnet_ntoa in -ldnet" >&5
ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -6143,7 +6364,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldnet $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 6147 "configure"
+#line 6368 "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
@@ -6154,7 +6375,7 @@ int main() {
dnet_ntoa()
; return 0; }
EOF
-if { (eval echo configure:6158: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6379: \"$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
@@ -6176,7 +6397,7 @@ fi
if test $ac_cv_lib_dnet_dnet_ntoa = no; then
echo $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>&6
-echo "configure:6180: checking for dnet_ntoa in -ldnet_stub" >&5
+echo "configure:6401: checking for dnet_ntoa in -ldnet_stub" >&5
ac_lib_var=`echo dnet_stub'_'dnet_ntoa | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -6184,7 +6405,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldnet_stub $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 6188 "configure"
+#line 6409 "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
@@ -6195,7 +6416,7 @@ int main() {
dnet_ntoa()
; return 0; }
EOF
-if { (eval echo configure:6199: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6420: \"$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
@@ -6224,12 +6445,12 @@ fi
# The nsl library prevents programs from opening the X display
# on Irix 5.2, according to dickey@clark.net.
echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
-echo "configure:6228: checking for gethostbyname" >&5
+echo "configure:6449: checking for gethostbyname" >&5
if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6233 "configure"
+#line 6454 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char gethostbyname(); below. */
@@ -6252,7 +6473,7 @@ gethostbyname();
; return 0; }
EOF
-if { (eval echo configure:6256: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6477: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_gethostbyname=yes"
else
@@ -6273,7 +6494,7 @@ fi
if test $ac_cv_func_gethostbyname = no; then
echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
-echo "configure:6277: checking for gethostbyname in -lnsl" >&5
+echo "configure:6498: checking for gethostbyname in -lnsl" >&5
ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -6281,7 +6502,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lnsl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 6285 "configure"
+#line 6506 "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
@@ -6292,7 +6513,7 @@ int main() {
gethostbyname()
; return 0; }
EOF
-if { (eval echo configure:6296: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6517: \"$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
@@ -6322,12 +6543,12 @@ fi
# -lsocket must be given before -lnsl if both are needed.
# We assume that if connect needs -lnsl, so does gethostbyname.
echo $ac_n "checking for connect""... $ac_c" 1>&6
-echo "configure:6326: checking for connect" >&5
+echo "configure:6547: checking for connect" >&5
if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6331 "configure"
+#line 6552 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char connect(); below. */
@@ -6350,7 +6571,7 @@ connect();
; return 0; }
EOF
-if { (eval echo configure:6354: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6575: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_connect=yes"
else
@@ -6371,7 +6592,7 @@ fi
if test $ac_cv_func_connect = no; then
echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6
-echo "configure:6375: checking for connect in -lsocket" >&5
+echo "configure:6596: checking for connect in -lsocket" >&5
ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -6379,7 +6600,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 6383 "configure"
+#line 6604 "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
@@ -6390,7 +6611,7 @@ int main() {
connect()
; return 0; }
EOF
-if { (eval echo configure:6394: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6615: \"$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
@@ -6414,12 +6635,12 @@ fi
# gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX.
echo $ac_n "checking for remove""... $ac_c" 1>&6
-echo "configure:6418: checking for remove" >&5
+echo "configure:6639: checking for remove" >&5
if eval "test \"`echo '$''{'ac_cv_func_remove'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6423 "configure"
+#line 6644 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char remove(); below. */
@@ -6442,7 +6663,7 @@ remove();
; return 0; }
EOF
-if { (eval echo configure:6446: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6667: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_remove=yes"
else
@@ -6463,7 +6684,7 @@ fi
if test $ac_cv_func_remove = no; then
echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6
-echo "configure:6467: checking for remove in -lposix" >&5
+echo "configure:6688: checking for remove in -lposix" >&5
ac_lib_var=`echo posix'_'remove | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -6471,7 +6692,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lposix $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 6475 "configure"
+#line 6696 "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
@@ -6482,7 +6703,7 @@ int main() {
remove()
; return 0; }
EOF
-if { (eval echo configure:6486: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6707: \"$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
@@ -6506,12 +6727,12 @@ fi
# BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
echo $ac_n "checking for shmat""... $ac_c" 1>&6
-echo "configure:6510: checking for shmat" >&5
+echo "configure:6731: checking for shmat" >&5
if eval "test \"`echo '$''{'ac_cv_func_shmat'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6515 "configure"
+#line 6736 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char shmat(); below. */
@@ -6534,7 +6755,7 @@ shmat();
; return 0; }
EOF
-if { (eval echo configure:6538: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6759: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_shmat=yes"
else
@@ -6555,7 +6776,7 @@ fi
if test $ac_cv_func_shmat = no; then
echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6
-echo "configure:6559: checking for shmat in -lipc" >&5
+echo "configure:6780: checking for shmat in -lipc" >&5
ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -6563,7 +6784,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lipc $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 6567 "configure"
+#line 6788 "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
@@ -6574,7 +6795,7 @@ int main() {
shmat()
; return 0; }
EOF
-if { (eval echo configure:6578: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6799: \"$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
@@ -6607,7 +6828,7 @@ fi
# libraries we check for below, so use a different variable.
# --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
echo $ac_n "checking for IceConnectionNumber in -lICE""... $ac_c" 1>&6
-echo "configure:6611: checking for IceConnectionNumber in -lICE" >&5
+echo "configure:6832: checking for IceConnectionNumber in -lICE" >&5
ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -6615,7 +6836,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lICE $X_EXTRA_LIBS $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 6619 "configure"
+#line 6840 "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
@@ -6626,7 +6847,7 @@ int main() {
IceConnectionNumber()
; return 0; }
EOF
-if { (eval echo configure:6630: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6851: \"$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
@@ -6651,19 +6872,61 @@ fi
fi
+# Check whether --enable-java-awt or --disable-java-awt was given.
+if test "${enable_java_awt+set}" = set; then
+ enableval="$enable_java_awt"
+ :
+fi
-if test "$no_x" = yes; then
- NO_X_TRUE=
- NO_X_FALSE='#'
+peerlibs="`echo ${enable_java_awt} | tr ',' ' '`"
+use_xlib_awt=""
+use_gtk_awt=""
+
+for peer in $peerlibs ; do
+ case $peer in
+ xlib)
+ if test "$no_x" = yes; then
+ echo "*** xlib peers requested but no X library available" 1>&2
+ exit 1
+ else
+ use_xlib_awt="yes"
+ fi
+ ;;
+ gtk)
+ # Nothing, yet...
+ ;;
+ *)
+ echo "*** unrecognised argument \"${peer}\" for --enable-java-awt" 1>&2
+ exit 1
+ esac
+done
+
+
+
+if test "$use_xlib_awt" = yes; then
+ XLIB_AWT_TRUE=
+ XLIB_AWT_FALSE='#'
+else
+ XLIB_AWT_TRUE='#'
+ XLIB_AWT_FALSE=
+fi
+
+
+if test "$use_gtk_awt" = yes; then
+ GTK_AWT_TRUE=
+ GTK_AWT_FALSE='#'
else
- NO_X_TRUE='#'
- NO_X_FALSE=
+ GTK_AWT_TRUE='#'
+ GTK_AWT_FALSE=
fi
+
here=`pwd`
+# We get this from the environment.
+
trap '' 1 2 15
cat > confcache <<\EOF
@@ -6798,6 +7061,9 @@ s%@includedir@%$includedir%g
s%@oldincludedir@%$oldincludedir%g
s%@infodir@%$infodir%g
s%@mandir@%$mandir%g
+s%@LN_S@%$LN_S%g
+s%@libgcj_basedir@%$libgcj_basedir%g
+s%@mkinstalldirs@%$mkinstalldirs%g
s%@host@%$host%g
s%@host_alias@%$host_alias%g
s%@host_cpu@%$host_cpu%g
@@ -6813,8 +7079,6 @@ s%@build_alias@%$build_alias%g
s%@build_cpu@%$build_cpu%g
s%@build_vendor@%$build_vendor%g
s%@build_os@%$build_os%g
-s%@LN_S@%$LN_S%g
-s%@libgcj_basedir@%$libgcj_basedir%g
s%@CC@%$CC%g
s%@CXX@%$CXX%g
s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
@@ -6870,6 +7134,8 @@ s%@THREADOBJS@%$THREADOBJS%g
s%@THREADSPEC@%$THREADSPEC%g
s%@USING_GCC_TRUE@%$USING_GCC_TRUE%g
s%@USING_GCC_FALSE@%$USING_GCC_FALSE%g
+s%@ICONV_LDFLAGS@%$ICONV_LDFLAGS%g
+s%@LIBICONV@%$LIBICONV%g
s%@GCJ@%$GCJ%g
s%@GCJFLAGS@%$GCJFLAGS%g
s%@ZLIBS@%$ZLIBS%g
@@ -6887,7 +7153,8 @@ s%@USE_LIBDIR_TRUE@%$USE_LIBDIR_TRUE%g
s%@USE_LIBDIR_FALSE@%$USE_LIBDIR_FALSE%g
s%@NEEDS_DATA_START_TRUE@%$NEEDS_DATA_START_TRUE%g
s%@NEEDS_DATA_START_FALSE@%$NEEDS_DATA_START_FALSE%g
-s%@EH_COMMON_INCLUDE@%$EH_COMMON_INCLUDE%g
+s%@GCC_UNWIND_INCLUDE@%$GCC_UNWIND_INCLUDE%g
+s%@GCJVERSION@%$GCJVERSION%g
s%@AM_RUNTESTFLAGS@%$AM_RUNTESTFLAGS%g
s%@ALLOCA@%$ALLOCA%g
s%@PERL@%$PERL%g
@@ -6896,8 +7163,10 @@ s%@X_CFLAGS@%$X_CFLAGS%g
s%@X_PRE_LIBS@%$X_PRE_LIBS%g
s%@X_LIBS@%$X_LIBS%g
s%@X_EXTRA_LIBS@%$X_EXTRA_LIBS%g
-s%@NO_X_TRUE@%$NO_X_TRUE%g
-s%@NO_X_FALSE@%$NO_X_FALSE%g
+s%@XLIB_AWT_TRUE@%$XLIB_AWT_TRUE%g
+s%@XLIB_AWT_FALSE@%$XLIB_AWT_FALSE%g
+s%@GTK_AWT_TRUE@%$GTK_AWT_TRUE%g
+s%@GTK_AWT_FALSE@%$GTK_AWT_FALSE%g
s%@here@%$here%g
CEOF
@@ -7185,7 +7454,7 @@ h=`pwd`
d=`echo $f | sed -e 's,/[^/]*$,,'`
- $srcdir/../mkinstalldirs $d
+ $libgcj_basedir/../mkinstalldirs $d
echo > $f
}
done
diff --git a/libjava/configure.host b/libjava/configure.host
index e466b63c971..cdced6e7404 100644
--- a/libjava/configure.host
+++ b/libjava/configure.host
@@ -23,7 +23,6 @@ libgcj_flags=
libgcj_cflags=
libgcj_cxxflags=
libgcj_javaflags=
-libgcj_sjlj=
libgcj_interpreter=
case "${target_optspace}:${host}" in
@@ -46,6 +45,7 @@ AM_RUNTESTFLAGS=
echo "$target"
DIVIDESPEC=-fuse-divide-subroutine
+EXCEPTIONSPEC=-fnon-call-exceptions
case "${host}" in
mips-tx39-*|mipstx39-unknown-*)
@@ -62,23 +62,20 @@ case "${host}" in
libgcj_interpreter=yes
libgcj_cxxflags="-D__NO_MATH_INLINES"
libgcj_cflags="-D__NO_MATH_INLINES"
- DIVIDESPEC=-fno-use-divide-subroutine
;;
alpha*-*)
libgcj_flags="${libgcj_flags} -mieee"
libgcj_interpreter=yes
- libgcj_sjlj=yes
+ ;;
+ powerpc*-*)
+ libgcj_interpreter=yes
;;
sparc-*)
;;
ia64-*)
libgcj_flags="${libgcj_flags} -funwind-tables"
- libgcj_sjlj=yes
libgcj_interpreter=yes
;;
- *)
- libgcj_sjlj=yes
- ;;
esac
libgcj_cflags="${libgcj_cflags} ${libgcj_flags}"
diff --git a/libjava/configure.in b/libjava/configure.in
index 365b0277a59..582b56d60b2 100644
--- a/libjava/configure.in
+++ b/libjava/configure.in
@@ -1,10 +1,6 @@
dnl Process this with autoconf to create configure
AC_INIT(java/lang/System.java)
-dnl Can't be done in LIBGCJ_CONFIGURE because that confuses automake.
-AC_CONFIG_AUX_DIR(..)
-
-AC_CANONICAL_SYSTEM
AC_PROG_LN_S
dnl We use these options to decide which functions to include.
@@ -26,6 +22,9 @@ if test -z "${with_cross_host}"; then
AC_DEFINE(USE_LTDL)
# Sigh. Libtool's macro doesn't do the right thing.
INCLTDL="-I\$(top_srcdir)/libltdl $INCLTDL"
+ # FIXME: this is a hack.
+ sub_auxdir="`cd $ac_aux_dir && pwd`"
+ ac_configure_args="$ac_configure_args --with-auxdir=$sub_auxdir"
fi
AC_SUBST(INCLTDL)
AC_SUBST(LIBLTDL)
@@ -88,19 +87,51 @@ if test "$libgcj_interpreter" = yes; then
AC_DEFINE(INTERPRETER)
fi
-EXCEPTIONSPEC=
-dnl See if we should use setjmp/longjmp exceptions
+AC_MSG_CHECKING([for exception model to use])
+AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
AC_ARG_ENABLE(sjlj-exceptions,
-[ --enable-sjlj-exceptions use setjmp/longjmp exceptions],
- if test "$enable_sjlj_exceptions" = yes; then
- # This can be set in configure.host.
- libgcj_sjlj=yes
- fi)
-
-if test "$libgcj_sjlj" = yes; then
- EXCEPTIONSPEC="-fsjlj-exceptions"
- AC_DEFINE(SJLJ_EXCEPTIONS)
+[ --enable-sjlj-exceptions force use of builtin_setjmp for exceptions],
+[:],
+[dnl Botheration. Now we've got to detect the exception model.
+dnl Link tests against libgcc.a are problematic since -- at least
+dnl as of this writing -- we've not been given proper -L bits for
+dnl single-tree newlib and libgloss.
+dnl
+dnl This is what AC_TRY_COMPILE would do if it didn't delete the
+dnl conftest files before we got a change to grep them first.
+cat > conftest.$ac_ext << EOF
+[#]line __oline__ "configure"
+struct S { ~S(); };
+void bar();
+void foo()
+{
+ S s;
+ bar();
+}
+EOF
+old_CXXFLAGS="$CXXFLAGS"
+CXXFLAGS=-S
+if AC_TRY_EVAL(ac_compile); then
+ if grep _Unwind_SjLj_Resume conftest.s >/dev/null 2>&1 ; then
+ enable_sjlj_exceptions=yes
+ elif grep _Unwind_Resume conftest.s >/dev/null 2>&1 ; then
+ enable_sjlj_exceptions=no
+ fi
fi
+CXXFLAGS="$old_CXXFLAGS"
+rm -f conftest*])
+if test x$enable_sjlj_exceptions = xyes; then
+ AC_DEFINE(SJLJ_EXCEPTIONS, 1,
+ [Define if the compiler is configured for setjmp/longjmp exceptions.])
+ ac_exception_model_name=sjlj
+elif test x$enable_sjlj_exceptions = xno; then
+ ac_exception_model_name="call frame"
+else
+ AC_MSG_ERROR([unable to detect exception model])
+fi
+AC_LANG_RESTORE
+AC_MSG_RESULT($ac_exception_model_name)
AC_MSG_CHECKING([for data_start])
LIBDATASTARTSPEC=
@@ -247,43 +278,9 @@ AC_SUBST(GCTESTSPEC)
AC_LINK_FILES(include/$GCHDR, include/java-gc.h)
-dnl Note that this code is kept in sync with similar code in gcc/configure.in.
-dnl In particular both packages must make the same decision about which
-dnl thread package to use.
-AC_MSG_CHECKING([for threads package to use])
-AC_ARG_ENABLE(threads, [ --enable-threads=TYPE choose threading package],
- THREADS=$enableval,
- dnl FIXME: figure out native threads to use here.
- THREADS=no)
-
-if test "$THREADS" = yes; then
- case "$host" in
- *-*-vxworks*)
- THREADS=vxworks
- ;;
- *-*-linux*)
- # FIXME: this isn't correct in all cases.
- THREADS=posix
- ;;
- *-*-win*)
- THREADS=win32
- ;;
- *-*-irix*)
- # FIXME: for now, choose POSIX, because we implement that.
- # Later, choose irix threads.
- THREADS=posix
- ;;
- *-*-solaris*)
- # FIXME: for now, choose POSIX, because we implement that.
- # Later, choose solaris threads.
- THREADS=posix
- ;;
- *)
- # For now.
- THREADS=none
- ;;
- esac
-fi
+AC_MSG_CHECKING([for thread model used by GCC])
+THREADS=`$CC -v 2>&1 | sed -n 's/^Thread model: //p'`
+AC_MSG_RESULT([$THREADS])
case "$THREADS" in
no | none | single)
@@ -304,7 +301,6 @@ case "$THREADS" in
AC_MSG_ERROR($THREADS is an unknown thread package)
;;
esac
-AC_MSG_RESULT($THREADS)
THREADLIBS=
THREADINCS=
@@ -349,16 +345,17 @@ CANADIAN=no
NULL_TARGET=no
NATIVE=yes
-# Find eh-common.h and support headers. If we're in the tree with
+# Find unwind.h and support headers. If we're in the tree with
# gcc, then look there. Otherwise look in compat-include. If all else
# fails, just hope the user has set things up somehow.
-if test -r $srcdir/../gcc/eh-common.h; then
- EH_COMMON_INCLUDE='-I$(top_srcdir)/../gcc -I$(top_srcdir)/../include'
+echo "probing $srcdir/../gcc/unwind.h"
+if test -r $libgcj_basedir/../gcc/unwind.h; then
+ GCC_UNWIND_INCLUDE='-I$(libgcj_basedir)/../gcc'
else
if test -d $srcdir/../compat-include; then
- EH_COMMON_INCLUDE='-I$(top_srcdir)/../compat-include'
+ GCC_UNWIND_INCLUDE='-I$(top_srcdir)/../compat-include'
else
- EH_COMMON_INCLUDE=
+ GCC_UNWIND_INCLUDE=
fi
fi
@@ -387,19 +384,17 @@ if test -n "${with_cross_host}"; then
# If Canadian cross, then don't pick up tools from the build
# directory.
- if test "$build" != "$with_cross_host"; then
+ if test x"$build" != x"$with_cross_host" && x"$build" != x"$target"; then
CANADIAN=yes
- EH_COMMON_INCLUDE=
+ GCC_UNWIND_INCLUDE=
GCJ="${target_alias}-gcj"
- else
- GCJ=
fi
NATIVE=no
else
AC_CHECK_FUNCS(strerror ioctl select fstat open fsync sleep)
AC_CHECK_FUNCS(gmtime_r localtime_r readdir_r getpwuid_r getcwd)
- AC_CHECK_FUNCS(access stat mkdir rename rmdir unlink realpath)
- AC_CHECK_FUNCS(iconv nl_langinfo setlocale)
+ AC_CHECK_FUNCS(access stat mkdir rename rmdir unlink realpath utime chmod)
+ AC_CHECK_FUNCS(nl_langinfo setlocale)
AC_CHECK_FUNCS(inet_aton inet_addr, break)
AC_CHECK_FUNCS(inet_pton uname inet_ntoa)
AC_CHECK_FUNCS(backtrace fork execvp pipe)
@@ -409,6 +404,8 @@ else
AC_CHECK_FILES(/proc/self/exe, [
AC_DEFINE(HAVE_PROC_SELF_EXE)])
+ AM_ICONV
+
AC_CHECK_FUNCS(gethostbyname_r, [
AC_DEFINE(HAVE_GETHOSTBYNAME_R)
# There are two different kinds of gethostbyname_r.
@@ -602,8 +599,31 @@ fi
# Create it, so that compile/link tests don't fail
test -f libgcj.spec || touch libgcj.spec
+# We must search the source tree for java.lang, since we still don't
+# have libgcj.jar nor java/lang/*.class
+GCJ_SAVE_CPPFLAGS=$CPPFLAGS
+CPPFLAGS="$CPPFLAGS -I`pwd` -I`cd $srcdir && pwd`"
+
+# Since some classes depend on this one, we need its source available
+# before we can do any GCJ compilation test :-(
+if test ! -f gnu/classpath/Configuration.java; then
+ test -d gnu || mkdir gnu
+ test -d gnu/classpath || mkdir gnu/classpath
+ sed 's,@LIBGCJDEBUG@,$LIBGCJDEBUG,' \
+ < $srcdir/gnu/classpath/Configuration.java.in \
+ > gnu/classpath/Configuration.java
+ # We do not want to redirect the output of the grep below to /dev/null,
+ # but we add /dev/null to the input list so that grep will print the
+ # filename of Configuration.java in case it finds any matches.
+ if grep @ gnu/classpath/Configuration.java /dev/null; then
+ AC_MSG_ERROR([configure.in is missing the substitutions above])
+ fi
+fi
+
LT_AC_PROG_GCJ
+CPPFLAGS=$GCJ_SAVE_CPPFLAGS
+
dnl FIXME: cross compilation
AC_CHECK_SIZEOF(void *)
@@ -630,13 +650,14 @@ AM_CONDITIONAL(NULL_TARGET, test "$NULL_TARGET" = yes)
AM_CONDITIONAL(NATIVE, test "$NATIVE" = yes || test "$NULL_TARGET" = yes)
AM_CONDITIONAL(USE_LIBDIR, test -z "$with_cross_host")
AM_CONDITIONAL(NEEDS_DATA_START, test "$NEEDS_DATA_START" = yes && test "$NATIVE" = yes)
-AC_SUBST(EH_COMMON_INCLUDE)
+AC_SUBST(GCC_UNWIND_INCLUDE)
# Determine gcj version number.
changequote(<<,>>)
gcjvers="`$GCJ -v 2>&1 | sed -n 's/^.*version \([^ ]*\).*$/\1/p'`"
changequote([,])
AC_DEFINE_UNQUOTED(GCJVERSION, "$gcjvers")
+AC_SUBST(GCJVERSION)
AC_SUBST(AM_RUNTESTFLAGS)
@@ -679,6 +700,12 @@ AC_TRY_COMPILE([#include <netinet/in.h>], [struct ip_mreq mreq;],
AC_MSG_RESULT(yes)],
[AC_MSG_RESULT(no)])
+AC_MSG_CHECKING([whether struct ipv6_mreq is in netinet/in.h])
+AC_TRY_COMPILE([#include <netinet/in.h>], [struct ipv6_mreq mreq6;],
+ [AC_DEFINE(HAVE_STRUCT_IPV6_MREQ)
+ AC_MSG_RESULT(yes)],
+ [AC_MSG_RESULT(no)])
+
AC_MSG_CHECKING([whether struct sockaddr_in6 is in netinet/in.h])
AC_TRY_COMPILE([#include <netinet/in.h>], [struct sockaddr_in6 addr6;],
[AC_DEFINE(HAVE_INET6)
@@ -686,7 +713,8 @@ AC_TRY_COMPILE([#include <netinet/in.h>], [struct sockaddr_in6 addr6;],
[AC_MSG_RESULT(no)])
AC_MSG_CHECKING([for socklen_t in sys/socket.h])
-AC_TRY_COMPILE([#include <sys/types.h>
+AC_TRY_COMPILE([#define _POSIX_PII_SOCKET
+#include <sys/types.h>
#include <sys/socket.h>], [socklen_t x = 5;],
[AC_DEFINE(HAVE_SOCKLEN_T)
AC_MSG_RESULT(yes)],
@@ -719,9 +747,15 @@ case "${host}" in
sparc-sun-solaris*)
SIGNAL_HANDLER=include/sparc-signal.h
;;
- ia64-*)
- SYSDEP_SOURCES=sysdep/ia64.c
- test -d sysdep || mkdir sysdep
+# ia64-*)
+# SYSDEP_SOURCES=sysdep/ia64.c
+# test -d sysdep || mkdir sysdep
+# ;;
+ powerpc-*-linux*)
+ SIGNAL_HANDLER=include/dwarf2-signal.h
+ ;;
+ alpha*-*-linux*)
+ SIGNAL_HANDLER=include/dwarf2-signal.h
;;
*)
SIGNAL_HANDLER=include/default-signal.h
@@ -729,7 +763,7 @@ case "${host}" in
esac
# If we're using sjlj exceptions, forget what we just learned.
-if test "$libgcj_sjlj" = yes; then
+if test "$enable_sjlj_exceptions" = yes; then
SIGNAL_HANDLER=include/default-signal.h
fi
@@ -745,11 +779,42 @@ fi
AC_PATH_XTRA
-AM_CONDITIONAL(NO_X, test "$no_x" = yes)
+dnl Determine which AWT peer libraries to build
+AC_ARG_ENABLE(java-awt,
+[ --enable-java-awt list of AWT peer implementations to be built])
+
+peerlibs="`echo ${enable_java_awt} | tr ',' ' '`"
+use_xlib_awt=""
+use_gtk_awt=""
+
+for peer in $peerlibs ; do
+ case $peer in
+ xlib)
+ if [test "$no_x" = yes]; then
+ echo "*** xlib peers requested but no X library available" 1>&2
+ exit 1
+ else
+ use_xlib_awt="yes"
+ fi
+ ;;
+ gtk)
+ # Nothing, yet...
+ ;;
+ *)
+ echo "*** unrecognised argument \"${peer}\" for --enable-java-awt" 1>&2
+ exit 1
+ esac
+done
+
+AM_CONDITIONAL(XLIB_AWT, test "$use_xlib_awt" = yes)
+AM_CONDITIONAL(GTK_AWT, test "$use_gtk_awt" = yes)
+
here=`pwd`
AC_SUBST(here)
+# We get this from the environment.
+AC_SUBST(GCJFLAGS)
AC_OUTPUT(Makefile libgcj.spec libgcj-test.spec gnu/classpath/Configuration.java gcj/Makefile include/Makefile testsuite/Makefile,
[if test -n "$CONFIG_FILES"; then
@@ -770,7 +835,7 @@ h=`pwd`
changequote(<<,>>)
d=`echo $f | sed -e 's,/[^/]*$,,'`
changequote([,])
- $srcdir/../mkinstalldirs $d
+ $libgcj_basedir/../mkinstalldirs $d
echo > $f
}
done
diff --git a/libjava/defineclass.cc b/libjava/defineclass.cc
index 49774839abf..962b8355aff 100644
--- a/libjava/defineclass.cc
+++ b/libjava/defineclass.cc
@@ -25,9 +25,6 @@ details. */
#ifdef INTERPRETER
#include <stdlib.h>
-#if HAVE_ALLOCA_H
-#include <alloca.h>
-#endif
#include <java-cpool.h>
#include <gcj/cni.h>
@@ -59,8 +56,6 @@ static void throw_no_class_def_found_error (char *msg)
__attribute__ ((__noreturn__));
static void throw_class_format_error (jstring msg)
__attribute__ ((__noreturn__));
-static void throw_class_format_error (char *msg)
- __attribute__ ((__noreturn__));
static void throw_incompatible_class_change_error (jstring msg)
__attribute__ ((__noreturn__));
static void throw_class_circularity_error (jstring msg)
@@ -194,6 +189,36 @@ struct _Jv_ClassReader {
throw_class_format_error ("erroneous constant pool tag");
}
+ inline void verify_identifier (_Jv_Utf8Const* name)
+ {
+ if (! _Jv_VerifyIdentifier (name))
+ throw_class_format_error ("erroneous identifier");
+ }
+
+ inline void verify_classname (unsigned char* ptr, _Jv_ushort length)
+ {
+ if (! _Jv_VerifyClassName (ptr, length))
+ throw_class_format_error ("erroneous class name");
+ }
+
+ inline void verify_classname (_Jv_Utf8Const *name)
+ {
+ if (! _Jv_VerifyClassName (name))
+ throw_class_format_error ("erroneous class name");
+ }
+
+ inline void verify_field_signature (_Jv_Utf8Const *sig)
+ {
+ if (! _Jv_VerifyFieldSignature (sig))
+ throw_class_format_error ("erroneous type descriptor");
+ }
+
+ inline void verify_method_signature (_Jv_Utf8Const *sig)
+ {
+ if (! _Jv_VerifyMethodSignature (sig))
+ throw_class_format_error ("erroneous type descriptor");
+ }
+
_Jv_ClassReader (jclass klass, jbyteArray data, jint offset, jint length)
{
if (klass == 0 || length < 0 || offset+length > data->length)
@@ -216,6 +241,7 @@ struct _Jv_ClassReader {
void read_one_method_attribute (int method);
void read_one_code_attribute (int method);
void read_one_field_attribute (int field);
+ void throw_class_format_error (char *msg);
/** check an utf8 entry, without creating a Utf8Const object */
bool is_attribute_name (int index, char *name);
@@ -678,7 +704,7 @@ _Jv_ClassReader::prepare_pool_entry (int index, unsigned char this_tag)
// order to accomondate gcj's internal representation.
int len = get2u (this_data);
- char *buffer = (char*) alloca (len);
+ char *buffer = (char*) __builtin_alloca (len);
char *s = ((char*) this_data)+2;
/* FIXME: avoid using a buffer here */
@@ -702,7 +728,7 @@ _Jv_ClassReader::prepare_pool_entry (int index, unsigned char this_tag)
prepare_pool_entry (utf_index, JV_CONSTANT_Utf8);
if (verify)
- _Jv_VerifyClassName (pool_data[utf_index].utf8);
+ verify_classname (pool_data[utf_index].utf8);
pool_data[index].utf8 = pool_data[utf_index].utf8;
pool_tags[index] = JV_CONSTANT_Class;
@@ -745,7 +771,7 @@ _Jv_ClassReader::prepare_pool_entry (int index, unsigned char this_tag)
|| _Jv_equalUtf8Consts (name, init_name)))
/* ignore */;
else
- _Jv_VerifyIdentifier (pool_data[name_index].utf8);
+ verify_identifier (pool_data[name_index].utf8);
}
_Jv_storeIndexes (&pool_data[index], class_index, nat_index);
@@ -1033,7 +1059,7 @@ void _Jv_ClassReader::handleField (int field_no,
#endif
if (verify)
- _Jv_VerifyIdentifier (field_name);
+ verify_identifier (field_name);
// ignore flags we don't know about.
field->flags = flags & Modifier::ALL_FLAGS;
@@ -1187,7 +1213,7 @@ void _Jv_ClassReader::handleMethod
|| _Jv_equalUtf8Consts (method->name, init_name))
/* ignore */;
else
- _Jv_VerifyIdentifier (method->name);
+ verify_identifier (method->name);
_Jv_VerifyMethodSignature (method->signature);
@@ -1277,6 +1303,36 @@ void _Jv_ClassReader::handleMethodsEnd ()
}
+void _Jv_ClassReader::throw_class_format_error (char *msg)
+{
+ jstring str;
+ if (def->name != NULL)
+ {
+ jsize mlen = strlen (msg);
+ unsigned char* data = (unsigned char*) def->name->data;
+ int ulen = def->name->length;
+ unsigned char* limit = data + ulen;
+ jsize nlen = _Jv_strLengthUtf8 ((char *) data, ulen);
+ jsize len = nlen + mlen + 3;
+ str = JvAllocString(len);
+ jchar *chrs = JvGetStringChars(str);
+ while (data < limit)
+ *chrs++ = UTF8_GET(data, limit);
+ *chrs++ = ' ';
+ *chrs++ = '(';
+ for (;;)
+ {
+ char c = *msg++;
+ if (c == 0)
+ break;
+ *chrs++ = c & 0xFFFF;
+ }
+ *chrs++ = ')';
+ }
+ else
+ str = JvNewStringLatin1 (msg);
+ ::throw_class_format_error (str);
+}
/** This section takes care of verifying integrity of identifiers,
signatures, field ddescriptors, and class names */
@@ -1317,7 +1373,8 @@ _Jv_VerifyOne (unsigned char* ptr, unsigned char* limit, bool void_ok)
return 0;
} while (ch != ';');
- _Jv_VerifyClassName (start, (unsigned short) (end-start));
+ if (! _Jv_VerifyClassName (start, (unsigned short) (end-start)))
+ return 0;
}
break;
@@ -1336,7 +1393,7 @@ _Jv_VerifyOne (unsigned char* ptr, unsigned char* limit, bool void_ok)
/** verification and loading procedures **/
-void
+bool
_Jv_VerifyFieldSignature (_Jv_Utf8Const*sig)
{
unsigned char* ptr = (unsigned char*) sig->data;
@@ -1344,36 +1401,28 @@ _Jv_VerifyFieldSignature (_Jv_Utf8Const*sig)
ptr = _Jv_VerifyOne (ptr, limit, false);
- if (ptr != limit)
- throw_class_format_error ("erroneous type descriptor");
+ return ptr == limit;
}
-void
+bool
_Jv_VerifyMethodSignature (_Jv_Utf8Const*sig)
{
unsigned char* ptr = (unsigned char*) sig->data;
unsigned char* limit = ptr + sig->length;
- if (ptr == limit)
- throw_class_format_error ("erroneous type descriptor");
-
- if (UTF8_GET(ptr,limit) != '(')
- throw_class_format_error ("erroneous type descriptor");
+ if (ptr == limit || UTF8_GET(ptr,limit) != '(')
+ return false;
while (ptr && UTF8_PEEK (ptr, limit) != ')')
ptr = _Jv_VerifyOne (ptr, limit, false);
if (UTF8_GET (ptr, limit) != ')')
- throw_class_format_error ("erroneous type descriptor");
+ return false;
// get the return type
ptr = _Jv_VerifyOne (ptr, limit, true);
- if (ptr != limit)
- throw_class_format_error ("erroneous type descriptor");
-
- return;
-
+ return ptr == limit;
}
/* we try to avoid calling the Character methods all the time,
@@ -1411,7 +1460,7 @@ is_identifier_part (int c)
return character->isJavaIdentifierStart ((jchar) ch);
}
-void
+bool
_Jv_VerifyIdentifier (_Jv_Utf8Const* name)
{
unsigned char *ptr = (unsigned char*) name->data;
@@ -1420,18 +1469,18 @@ _Jv_VerifyIdentifier (_Jv_Utf8Const* name)
if ((ch = UTF8_GET (ptr, limit))==-1
|| ! is_identifier_start (ch))
- throw_class_format_error ("erroneous identifier");
+ return false;
while (ptr != limit)
{
if ((ch = UTF8_GET (ptr, limit))==-1
|| ! is_identifier_part (ch))
- throw_class_format_error ("erroneous identifier");
+ return false;
}
+ return true;
}
-
-void
+bool
_Jv_VerifyClassName (unsigned char* ptr, _Jv_ushort length)
{
unsigned char *limit = ptr+length;
@@ -1440,39 +1489,37 @@ _Jv_VerifyClassName (unsigned char* ptr, _Jv_ushort length)
if ('[' == UTF8_PEEK (ptr, limit))
{
if (! _Jv_VerifyOne (++ptr, limit, false))
- throw_class_format_error ("erroneous class name");
+ return false;
else
- return;
+ return true;
}
next_level:
- do {
+ for (;;) {
if ((ch = UTF8_GET (ptr, limit))==-1)
- throw_class_format_error ("erroneous class name");
+ return false;
if (! is_identifier_start (ch))
- throw_class_format_error ("erroneous class name");
- do {
+ return false;
+ for (;;) {
if (ptr == limit)
- return;
+ return true;
else if ((ch = UTF8_GET (ptr, limit))==-1)
- throw_class_format_error ("erroneous class name");
+ return false;
else if (ch == '.')
goto next_level;
else if (! is_identifier_part (ch))
- throw_class_format_error ("erroneous class name");
- } while (true);
- } while (true);
-
+ return false;
+ }
+ }
}
-void
+bool
_Jv_VerifyClassName (_Jv_Utf8Const *name)
{
- _Jv_VerifyClassName ((unsigned char*)&name->data[0],
- (_Jv_ushort) name->length);
+ return _Jv_VerifyClassName ((unsigned char*)&name->data[0],
+ (_Jv_ushort) name->length);
}
-
/** returns true, if name1 and name2 represents classes in the same
package. */
@@ -1551,12 +1598,6 @@ throw_class_format_error (jstring msg)
}
static void
-throw_class_format_error (char *msg)
-{
- throw_class_format_error (JvNewStringLatin1 (msg));
-}
-
-static void
throw_internal_error (char *msg)
{
JvThrow
diff --git a/libjava/doc/cni.sgml b/libjava/doc/cni.sgml
index 0c82ca67ddd..495e3e9c5a5 100644
--- a/libjava/doc/cni.sgml
+++ b/libjava/doc/cni.sgml
@@ -779,6 +779,31 @@ if (i >= count)
throw new java::lang::IndexOutOfBoundsException();
</programlisting>
</para>
+<para>
+Normally, GNU C++ will automatically detect when you are writing C++
+code that uses Java exceptions, and handle them appropriately.
+However, if C++ code only needs to execute destructors when Java
+exceptions are thrown through it, GCC will guess incorrectly. Sample
+problematic code:
+<programlisting>
+ struct S { ~S(); };
+ extern void bar(); // is implemented in Java and may throw exceptions
+ void foo()
+ {
+ S s;
+ bar();
+ }
+</programlisting>
+The usual effect of an incorrect guess is a link failure, complaining of
+a missing routine called <literal>__gxx_personality_v0</literal>.
+</para>
+<para>
+You can inform the compiler that Java exceptions are to be used in a
+translation unit, irrespective of what it might think, by writing
+<literal>#pragma GCC java_exceptions</literal> at the head of the
+file. This <literal>#pragma</literal> must appear before any
+functions that throw or catch exceptions, or run destructors when
+exceptions are thrown through them.</para>
</sect1>
<sect1><title>Synchronization</title>
diff --git a/libjava/doc/java-applet.texi b/libjava/doc/java-applet.texi
deleted file mode 100644
index bcd4637d233..00000000000
--- a/libjava/doc/java-applet.texi
+++ /dev/null
@@ -1,141 +0,0 @@
-@deftypemethod AppletContext {public AudioClip} getAudioClip (java.net.URL@w{ }@var{url})
-Returns an audio clip from the specified URL.
-@end deftypemethod
-@deftypemethod AppletContext {public Image} getImage (java.net.URL@w{ }@var{url})
-Returns an image from the specified URL. Note that the image is not
- actually retrieved until the applet attempts to display it, so this
- method returns immediately.
-@end deftypemethod
-@deftypemethod AppletContext {public Applet} getApplet (java.lang.String@w{ }@var{name})
-Returns the applet in the document for this object that has the
- specified name.
-@end deftypemethod
-@deftypemethod AppletContext {public Enumeration} getApplets ()
-Returns a list of all the applets in the document for this object.
-@end deftypemethod
-@deftypemethod AppletContext {public void} showDocument (java.net.URL@w{ }@var{url})
-Displays the web page pointed to by the specified URL in the window
- for this object. This page replaces the document that is currently
- there.
-@end deftypemethod
-@deftypemethod AppletContext {public void} showDocument (java.net.URL@w{ }@var{url}, java.lang.String@w{ }@var{target})
-Displays the web page pointed to be the sepcified URL in the window
- with the specified name. The standard names "_top", "_blank",
- "_parent", and "_self" are allowed.
-@end deftypemethod
-@deftypemethod AppletContext {public void} showStatus (java.lang.String@w{ }@var{message})
-Displays the specified message in the status window if that window
- exists.
-@end deftypemethod
-@deftypemethod Applet {public URL} getDocumentBase ()
-Returns the URL of the document this applet is embedded in.
-@end deftypemethod
-@deftypemethod Applet {public URL} getCodeBase ()
-Returns the URL of the code base for this applet.
-@end deftypemethod
-@deftypemethod Applet {public String} getParameter (java.lang.String@w{ }@var{name})
-Returns the value of the specified parameter that was specified in
- the &lt;APPLET&gt; tag for this applet.
-@end deftypemethod
-@deftypemethod Applet {public AppletContext} getAppletContext ()
-Returns the applet context for this applet.
-@end deftypemethod
-@deftypemethod Applet {public boolean} isActive ()
-Tests whether or not this applet is currently active.
-@end deftypemethod
-@deftypemethod Applet {public void} resize (int@w{ }@var{width}, int@w{ }@var{height})
-Requests that the applet window for this applet be resized.
-@end deftypemethod
-@deftypemethod Applet {public void} resize (java.awt.Dimension@w{ }@var{dim})
-Requests that the applet window for this applet be resized.
-@end deftypemethod
-@deftypemethod Applet {public AudioClip} getAudioClip (java.net.URL@w{ }@var{url})
-Returns an audio clip from the specified URL.
-@end deftypemethod
-@deftypemethod Applet {public AudioClip} getAudioClip (java.net.URL@w{ }@var{url}, java.lang.String@w{ }@var{name})
-Returns an audio clip from the specified URL and name
-@end deftypemethod
-@deftypemethod Applet {public void} play (java.net.URL@w{ }@var{url})
-Loads and plays the audio clip pointed to by the specified URL.
-@end deftypemethod
-@deftypemethod Applet {public void} play (java.net.URL@w{ }@var{url}, java.lang.String@w{ }@var{name})
-Loads and plays the audio clip pointed to by the specified URL.
-@end deftypemethod
-@deftypemethod Applet {public Image} getImage (java.net.URL@w{ }@var{url})
-Returns an image from the specified URL. Note that the image is not
- actually retrieved until the applet attempts to display it, so this
- method returns immediately.
-@end deftypemethod
-@deftypemethod Applet {public Image} getImage (java.net.URL@w{ }@var{url}, java.lang.String@w{ }@var{name})
-Returns an image from the specified URL. Note that the image is not
- actually retrieved until the applet attempts to display it, so this
- method returns immediately.
-@end deftypemethod
-@deftypemethod Applet {public Locale} getLocale ()
-Returns the locale for this applet, if it has been set. If no applet
- specific locale has been set, the default locale is returned.
-@end deftypemethod
-@deftypemethod Applet {public String} getAppletInfo ()
-Returns a descriptive string with applet defined information. The
- implementation in this class returns @code{null}. Applets who
- wish to return this information should override.
-@end deftypemethod
-@deftypemethod Applet {public String} getParameterInfo ()
-Returns a list of parameters this applet supports. Each element of
- the array is a list of three strings with the name of the parameter,
- the data type or valid values, and a description. This method is
- optional and the default implementation returns @code{null}.
-@end deftypemethod
-@deftypemethod Applet {public void} init ()
-This method is called when the applet is first loaded. The default
- implementation does nothing. Applets that wish to do one time
- initialization should override.
-@end deftypemethod
-@deftypemethod Applet {public void} destroy ()
-This method is called when the applet is being unloaded. The default
- implementation does nothing. Applets that need to clean up resources
- on exit should override.
-@end deftypemethod
-@deftypemethod Applet {public void} start ()
-This method is called when the applet should start running. This is
- normally each time a web page containing it is loaded. The default
- implemention does nothing. Subclasses should override.
-@end deftypemethod
-@deftypemethod Applet {public void} stop ()
-This method is called when the applet should stop running. This is
- normally when the next web page is loaded. The default implementation
- does nothing.
-@end deftypemethod
-@deftypemethod Applet {public final void} setStub (java.applet.AppletStub@w{ }@var{stub})
-The browser calls this method to set the applet's stub, which is the
- low level interface to the browser.
-@end deftypemethod
-@deftypemethod AppletStub {public URL} getDocumentBase ()
-Returns the URL of the document this applet is embedded in.
-@end deftypemethod
-@deftypemethod AppletStub {public URL} getCodeBase ()
-Returns the URL of the code base for this applet.
-@end deftypemethod
-@deftypemethod AppletStub {public String} getParameter (java.lang.String@w{ }@var{name})
-Returns the value of the specified parameter that was specified in
- the &lt;APPLET&gt; tag for this applet.
-@end deftypemethod
-@deftypemethod AppletStub {public AppletContext} getAppletContext ()
-Returns the applet context for this applet.
-@end deftypemethod
-@deftypemethod AppletStub {public boolean} isActive ()
-Tests whether or not this applet is currently active.
-@end deftypemethod
-@deftypemethod AppletStub {public void} appletResize (int@w{ }@var{width}, int@w{ }@var{height})
-Requests that the applet window for this applet be resized.
-@end deftypemethod
-@deftypemethod AudioClip {public void} play ()
-Plays the audio clip starting from the beginning.
-@end deftypemethod
-@deftypemethod AudioClip {public void} stop ()
-Stops playing this audio clip. There is no mechanism for restarting
- at the point where the clip is stopped.
-@end deftypemethod
-@deftypemethod AudioClip {public void} loop ()
-Plays this audio clip in a continuous loop.
-@end deftypemethod
diff --git a/libjava/doc/java-awt-color.texi b/libjava/doc/java-awt-color.texi
deleted file mode 100644
index 266810784af..00000000000
--- a/libjava/doc/java-awt-color.texi
+++ /dev/null
@@ -1,48 +0,0 @@
-@deftypemethod ColorSpace {public static ColorSpace} getInstance (int@w{ }@var{colorspace})
-
-@end deftypemethod
-@deftypemethod ColorSpace {public boolean} isCS_sRGB ()
-
-@end deftypemethod
-@deftypemethod ColorSpace {public abstract float} toRGB (float[]@w{ }@var{colorvalue})
-
-@end deftypemethod
-@deftypemethod ColorSpace {public abstract float} fromRGB (float[]@w{ }@var{rgbvalue})
-
-@end deftypemethod
-@deftypemethod ColorSpace {public abstract float} toCIEXYZ (float[]@w{ }@var{colorvalue})
-
-@end deftypemethod
-@deftypemethod ColorSpace {public abstract float} fromCIEXYZ (float[]@w{ }@var{colorvalue})
-
-@end deftypemethod
-@deftypemethod ColorSpace {public int} getType ()
-
-@end deftypemethod
-@deftypemethod ColorSpace {public int} getNumComponents ()
-
-@end deftypemethod
-@deftypemethod ColorSpace {public String} getName (int@w{ }@var{idx})
-
-@end deftypemethod
-@deftypemethod ColorSpace {public String} toString ()
-
-@end deftypemethod
-@deftypemethod ICC_ColorSpace {public ICC_Profile} getProfile ()
-
-@end deftypemethod
-@deftypemethod ICC_ColorSpace {public float} toRGB (float[]@w{ }@var{colorvalue})
-
-@end deftypemethod
-@deftypemethod ICC_ColorSpace {public float} fromRGB (float[]@w{ }@var{rgbvalue})
-
-@end deftypemethod
-@deftypemethod ICC_ColorSpace {public float} toCIEXYZ (float[]@w{ }@var{colorvalue})
-
-@end deftypemethod
-@deftypemethod ICC_ColorSpace {public float} fromCIEXYZ (float[]@w{ }@var{colorvalue})
-
-@end deftypemethod
-@deftypemethod ICC_Profile {public int} getNumComponents ()
-
-@end deftypemethod
diff --git a/libjava/doc/java-awt-event.texi b/libjava/doc/java-awt-event.texi
deleted file mode 100644
index e1acf0d3d86..00000000000
--- a/libjava/doc/java-awt-event.texi
+++ /dev/null
@@ -1,357 +0,0 @@
-@deftypemethod ActionEvent {public String} getActionCommand ()
-
-@end deftypemethod
-@deftypemethod ActionEvent {public int} getModifiers ()
-
-@end deftypemethod
-@deftypemethod ActionEvent {public String} paramString ()
-
-@end deftypemethod
-@deftypemethod ActionListener {public void} actionPerformed (java.awt.event.ActionEvent@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod AdjustmentEvent {public Adjustable} getAdjustable ()
-
-@end deftypemethod
-@deftypemethod AdjustmentEvent {public int} getAdjustmentType ()
-
-@end deftypemethod
-@deftypemethod AdjustmentEvent {public int} getValue ()
-
-@end deftypemethod
-@deftypemethod AdjustmentEvent {public String} paramString ()
-
-@end deftypemethod
-@deftypemethod AdjustmentListener {public void} adjustmentValueChanged (java.awt.event.AdjustmentEvent@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod AWTEventListener {public void} eventDispatched (java.awt.AWTEvent@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod ComponentAdapter {public void} componentHidden (java.awt.event.ComponentEvent@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod ComponentAdapter {public void} componentMoved (java.awt.event.ComponentEvent@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod ComponentAdapter {public void} componentResized (java.awt.event.ComponentEvent@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod ComponentAdapter {public void} componentShown (java.awt.event.ComponentEvent@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod ComponentEvent {public Component} getComponent ()
-
-@end deftypemethod
-@deftypemethod ComponentEvent {public String} paramString ()
-
-@end deftypemethod
-@deftypemethod ComponentListener {public void} componentHidden (java.awt.event.ComponentEvent@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod ComponentListener {public void} componentMoved (java.awt.event.ComponentEvent@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod ComponentListener {public void} componentResized (java.awt.event.ComponentEvent@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod ComponentListener {public void} componentShown (java.awt.event.ComponentEvent@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod ContainerAdapter {public void} componentAdded (java.awt.event.ContainerEvent@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod ContainerAdapter {public void} componentRemoved (java.awt.event.ContainerEvent@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod ContainerEvent {public Component} getChild ()
-
-@end deftypemethod
-@deftypemethod ContainerEvent {public Component} getContainer ()
-
-@end deftypemethod
-@deftypemethod ContainerEvent {public String} paramString ()
-
-@end deftypemethod
-@deftypemethod ContainerListener {public void} componentAdded (java.awt.event.ContainerEvent@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod ContainerListener {public void} componentRemoved (java.awt.event.ContainerEvent@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod FocusAdapter {public void} focusGained (java.awt.event.FocusEvent@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod FocusAdapter {public void} focusLost (java.awt.event.FocusEvent@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod FocusEvent {public boolean} isTemporary ()
-
-@end deftypemethod
-@deftypemethod FocusEvent {public String} paramString ()
-
-@end deftypemethod
-@deftypemethod FocusListener {public void} focusGained (java.awt.event.FocusEvent@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod FocusListener {public void} focusLost (java.awt.event.FocusEvent@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod HierarchyBoundsAdapter {public void} ancestorMoved (java.awt.event.HierarchyEvent@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod HierarchyBoundsAdapter {public void} ancestorResized (java.awt.event.HierarchyEvent@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod HierarchyBoundsListener {public void} ancestorMoved (java.awt.event.HierarchyEvent@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod HierarchyBoundsListener {public void} ancestorResized (java.awt.event.HierarchyEvent@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod HierarchyEvent {public Component} getComponent ()
-
-@end deftypemethod
-@deftypemethod HierarchyEvent {public Component} getChanged ()
-
-@end deftypemethod
-@deftypemethod HierarchyEvent {public Container} getChangedParent ()
-
-@end deftypemethod
-@deftypemethod HierarchyEvent {public long} getChangeFlags ()
-
-@end deftypemethod
-@deftypemethod HierarchyEvent {public String} paramString ()
-
-@end deftypemethod
-@deftypemethod HierarchyListener {public void} hierarchyChanged (java.awt.event.HierarchyEvent@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod InputEvent {public boolean} isShiftDown ()
-
-@end deftypemethod
-@deftypemethod InputEvent {public boolean} isControlDown ()
-
-@end deftypemethod
-@deftypemethod InputEvent {public boolean} isMetaDown ()
-
-@end deftypemethod
-@deftypemethod InputEvent {public boolean} isAltDown ()
-
-@end deftypemethod
-@deftypemethod InputEvent {public boolean} isAltGraphDown ()
-
-@end deftypemethod
-@deftypemethod InputEvent {public long} getWhen ()
-
-@end deftypemethod
-@deftypemethod InputEvent {public int} getModifiers ()
-
-@end deftypemethod
-@deftypemethod InputEvent {public boolean} isConsumed ()
-
-@end deftypemethod
-@deftypemethod InputEvent {public void} consume ()
-
-@end deftypemethod
-@deftypemethod InputMethodListener {public void} caretPositionChanged (java.awt.event.InputMethodEvent@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod InputMethodListener {public void} inputMethodTextChanged (java.awt.event.InputMethodEvent@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod InvocationEvent {public void} dispatch ()
-
-@end deftypemethod
-@deftypemethod InvocationEvent {public Exception} getException ()
-
-@end deftypemethod
-@deftypemethod InvocationEvent {public String} paramString ()
-
-@end deftypemethod
-@deftypemethod ItemEvent {public Object} getItem ()
-
-@end deftypemethod
-@deftypemethod ItemEvent {public ItemSelectable} getItemSelectable ()
-
-@end deftypemethod
-@deftypemethod ItemEvent {public int} getStateChange ()
-
-@end deftypemethod
-@deftypemethod ItemEvent {public String} paramString ()
-
-@end deftypemethod
-@deftypemethod ItemListener {public void} itemStateChanged (java.awt.event.ItemEvent@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod KeyAdapter {public void} keyPressed (java.awt.event.KeyEvent@w{ }@var{w})
-
-@end deftypemethod
-@deftypemethod KeyAdapter {public void} keyReleased (java.awt.event.KeyEvent@w{ }@var{w})
-
-@end deftypemethod
-@deftypemethod KeyAdapter {public void} keyTyped (java.awt.event.KeyEvent@w{ }@var{w})
-
-@end deftypemethod
-@deftypemethod KeyEvent {public int} getKeyCode ()
-
-@end deftypemethod
-@deftypemethod KeyEvent {public char} getKeyChar ()
-
-@end deftypemethod
-@deftypemethod KeyEvent {public void} setKeyCode (int@w{ }@var{keyCode})
-
-@end deftypemethod
-@deftypemethod KeyEvent {public void} setKeyChar (char@w{ }@var{keyChar})
-
-@end deftypemethod
-@deftypemethod KeyEvent {public void} setModifiers (int@w{ }@var{modifiers})
-
-@end deftypemethod
-@deftypemethod KeyEvent {public static String} getKeyText (int@w{ }@var{keyCode})
-
-@end deftypemethod
-@deftypemethod KeyEvent {public static String} getKeyModifiersText (int@w{ }@var{modifiers})
-
-@end deftypemethod
-@deftypemethod KeyEvent {public boolean} isActionKey ()
-
-@end deftypemethod
-@deftypemethod KeyEvent {public String} paramString ()
-
-@end deftypemethod
-@deftypemethod KeyListener {public void} keyPressed (java.awt.event.KeyEvent@w{ }@var{w})
-
-@end deftypemethod
-@deftypemethod KeyListener {public void} keyReleased (java.awt.event.KeyEvent@w{ }@var{w})
-
-@end deftypemethod
-@deftypemethod KeyListener {public void} keyTyped (java.awt.event.KeyEvent@w{ }@var{w})
-
-@end deftypemethod
-@deftypemethod MouseAdapter {public void} mouseClicked (java.awt.event.MouseEvent@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod MouseAdapter {public void} mouseEntered (java.awt.event.MouseEvent@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod MouseAdapter {public void} mouseExited (java.awt.event.MouseEvent@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod MouseAdapter {public void} mousePressed (java.awt.event.MouseEvent@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod MouseAdapter {public void} mouseReleased (java.awt.event.MouseEvent@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod MouseEvent {public int} getClickCount ()
-
-@end deftypemethod
-@deftypemethod MouseEvent {public Point} getPoint ()
-
-@end deftypemethod
-@deftypemethod MouseEvent {public int} getX ()
-
-@end deftypemethod
-@deftypemethod MouseEvent {public int} getY ()
-
-@end deftypemethod
-@deftypemethod MouseEvent {public boolean} isPopupTrigger ()
-
-@end deftypemethod
-@deftypemethod MouseEvent {public String} paramString ()
-
-@end deftypemethod
-@deftypemethod MouseEvent {public void} translatePoint (int@w{ }@var{x}, int@w{ }@var{y})
-
-@end deftypemethod
-@deftypemethod MouseListener {public void} mouseClicked (java.awt.event.MouseEvent@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod MouseListener {public void} mouseEntered (java.awt.event.MouseEvent@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod MouseListener {public void} mouseExited (java.awt.event.MouseEvent@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod MouseListener {public void} mousePressed (java.awt.event.MouseEvent@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod MouseListener {public void} mouseReleased (java.awt.event.MouseEvent@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod MouseMotionAdapter {public void} mouseDragged (java.awt.event.MouseEvent@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod MouseMotionAdapter {public void} mouseMoved (java.awt.event.MouseEvent@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod MouseMotionListener {public void} mouseDragged (java.awt.event.MouseEvent@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod MouseMotionListener {public void} mouseMoved (java.awt.event.MouseEvent@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod PaintEvent {public Rectangle} getUpdateRect ()
-
-@end deftypemethod
-@deftypemethod PaintEvent {public String} paramString ()
-
-@end deftypemethod
-@deftypemethod PaintEvent {public void} setUpdateRect (java.awt.Rectangle@w{ }@var{updateRect})
-
-@end deftypemethod
-@deftypemethod TextEvent {public String} paramString ()
-
-@end deftypemethod
-@deftypemethod TextListener {public void} textValueChanged (java.awt.event.TextEvent@w{ }@var{w})
-
-@end deftypemethod
-@deftypemethod WindowAdapter {public void} windowActivated (java.awt.event.WindowEvent@w{ }@var{w})
-
-@end deftypemethod
-@deftypemethod WindowAdapter {public void} windowClosed (java.awt.event.WindowEvent@w{ }@var{w})
-
-@end deftypemethod
-@deftypemethod WindowAdapter {public void} windowClosing (java.awt.event.WindowEvent@w{ }@var{w})
-
-@end deftypemethod
-@deftypemethod WindowAdapter {public void} windowDeactivated (java.awt.event.WindowEvent@w{ }@var{w})
-
-@end deftypemethod
-@deftypemethod WindowAdapter {public void} windowDeiconified (java.awt.event.WindowEvent@w{ }@var{w})
-
-@end deftypemethod
-@deftypemethod WindowAdapter {public void} windowIconified (java.awt.event.WindowEvent@w{ }@var{w})
-
-@end deftypemethod
-@deftypemethod WindowAdapter {public void} windowOpened (java.awt.event.WindowEvent@w{ }@var{w})
-
-@end deftypemethod
-@deftypemethod WindowEvent {public Window} getWindow ()
-
-@end deftypemethod
-@deftypemethod WindowEvent {public String} paramString ()
-
-@end deftypemethod
-@deftypemethod WindowListener {public void} windowActivated (java.awt.event.WindowEvent@w{ }@var{w})
-
-@end deftypemethod
-@deftypemethod WindowListener {public void} windowClosed (java.awt.event.WindowEvent@w{ }@var{w})
-
-@end deftypemethod
-@deftypemethod WindowListener {public void} windowClosing (java.awt.event.WindowEvent@w{ }@var{w})
-
-@end deftypemethod
-@deftypemethod WindowListener {public void} windowDeactivated (java.awt.event.WindowEvent@w{ }@var{w})
-
-@end deftypemethod
-@deftypemethod WindowListener {public void} windowDeiconified (java.awt.event.WindowEvent@w{ }@var{w})
-
-@end deftypemethod
-@deftypemethod WindowListener {public void} windowIconified (java.awt.event.WindowEvent@w{ }@var{w})
-
-@end deftypemethod
-@deftypemethod WindowListener {public void} windowOpened (java.awt.event.WindowEvent@w{ }@var{w})
-
-@end deftypemethod
diff --git a/libjava/doc/java-awt-geom.texi b/libjava/doc/java-awt-geom.texi
deleted file mode 100644
index 1913fd0accd..00000000000
--- a/libjava/doc/java-awt-geom.texi
+++ /dev/null
@@ -1,576 +0,0 @@
-@deftypemethod AffineTransform {public static AffineTransform} getTranslateInstance (double@w{ }@var{tx}, double@w{ }@var{ty})
-
-@end deftypemethod
-@deftypemethod AffineTransform {public static AffineTransform} getRotateInstance (double@w{ }@var{theta})
-
-@end deftypemethod
-@deftypemethod AffineTransform {public static AffineTransform} getRotateInstance (double@w{ }@var{theta}, double@w{ }@var{x}, double@w{ }@var{y})
-
-@end deftypemethod
-@deftypemethod AffineTransform {public static AffineTransform} getScaleInstance (double@w{ }@var{sx}, double@w{ }@var{sy})
-
-@end deftypemethod
-@deftypemethod AffineTransform {public static AffineTransform} getShearInstance (double@w{ }@var{shx}, double@w{ }@var{shy})
-
-@end deftypemethod
-@deftypemethod AffineTransform {public int} getType ()
-
-@end deftypemethod
-@deftypemethod AffineTransform {public double} getDeterminant ()
-
-@end deftypemethod
-@deftypemethod AffineTransform {public void} getMatrix (double[]@w{ }@var{flatmatrix})
-
-@end deftypemethod
-@deftypemethod AffineTransform {public double} getScaleX ()
-
-@end deftypemethod
-@deftypemethod AffineTransform {public double} getScaleY ()
-
-@end deftypemethod
-@deftypemethod AffineTransform {public double} getShearX ()
-
-@end deftypemethod
-@deftypemethod AffineTransform {public double} getShearY ()
-
-@end deftypemethod
-@deftypemethod AffineTransform {public double} getTranslateX ()
-
-@end deftypemethod
-@deftypemethod AffineTransform {public double} getTranslateY ()
-
-@end deftypemethod
-@deftypemethod AffineTransform {public void} translate (double@w{ }@var{tx}, double@w{ }@var{ty})
-
-@end deftypemethod
-@deftypemethod AffineTransform {public void} rotate (double@w{ }@var{theta})
-
-@end deftypemethod
-@deftypemethod AffineTransform {public void} rotate (double@w{ }@var{theta}, double@w{ }@var{x}, double@w{ }@var{y})
-
-@end deftypemethod
-@deftypemethod AffineTransform {public void} scale (double@w{ }@var{sx}, double@w{ }@var{sy})
-
-@end deftypemethod
-@deftypemethod AffineTransform {public void} shear (double@w{ }@var{shx}, double@w{ }@var{shy})
-
-@end deftypemethod
-@deftypemethod AffineTransform {public void} setToIdentity ()
-
-@end deftypemethod
-@deftypemethod AffineTransform {public void} setToTranslation (double@w{ }@var{tx}, double@w{ }@var{ty})
-
-@end deftypemethod
-@deftypemethod AffineTransform {public void} setToRotation (double@w{ }@var{theta})
-
-@end deftypemethod
-@deftypemethod AffineTransform {public void} setToScale (double@w{ }@var{sx}, double@w{ }@var{sy})
-
-@end deftypemethod
-@deftypemethod AffineTransform {public void} setToShear (double@w{ }@var{shx}, double@w{ }@var{shy})
-
-@end deftypemethod
-@deftypemethod AffineTransform {public void} setTransform (java.awt.geom.AffineTransform@w{ }@var{tx})
-
-@end deftypemethod
-@deftypemethod AffineTransform {public void} setTransform (double@w{ }@var{m00}, double@w{ }@var{m10}, double@w{ }@var{m01}, double@w{ }@var{m11}, double@w{ }@var{m02}, double@w{ }@var{m12})
-
-@end deftypemethod
-@deftypemethod AffineTransform {public void} concatenate (java.awt.geom.AffineTransform@w{ }@var{tx})
-
-@end deftypemethod
-@deftypemethod AffineTransform {public void} preConcatenate (java.awt.geom.AffineTransform@w{ }@var{tx})
-
-@end deftypemethod
-@deftypemethod AffineTransform {public AffineTransform} createInverse () @*throws NoninvertibleTransformException
-
-@end deftypemethod
-@deftypemethod AffineTransform {public Point2D} transform (java.awt.geom.Point2D@w{ }@var{src}, java.awt.geom.Point2D@w{ }@var{dst})
-
-@end deftypemethod
-@deftypemethod AffineTransform {public void} transform (java.awt.geom.Point2D[]@w{ }@var{src}, int@w{ }@var{srcOff}, java.awt.geom.Point2D[]@w{ }@var{dst}, int@w{ }@var{dstOff}, int@w{ }@var{num})
-
-@end deftypemethod
-@deftypemethod AffineTransform {public void} transform (float[]@w{ }@var{srcPts}, int@w{ }@var{srcOff}, float[]@w{ }@var{dstPts}, int@w{ }@var{dstOff}, int@w{ }@var{num})
-
-@end deftypemethod
-@deftypemethod AffineTransform {public void} transform (double[]@w{ }@var{srcPts}, int@w{ }@var{srcOff}, double[]@w{ }@var{dstPts}, int@w{ }@var{dstOff}, int@w{ }@var{num})
-
-@end deftypemethod
-@deftypemethod AffineTransform {public void} transform (float[]@w{ }@var{srcPts}, int@w{ }@var{srcOff}, double[]@w{ }@var{dstPts}, int@w{ }@var{dstOff}, int@w{ }@var{num})
-
-@end deftypemethod
-@deftypemethod AffineTransform {public void} transform (double[]@w{ }@var{srcPts}, int@w{ }@var{srcOff}, float[]@w{ }@var{dstPts}, int@w{ }@var{dstOff}, int@w{ }@var{num})
-
-@end deftypemethod
-@deftypemethod AffineTransform {public Point2D} inverseTransform (java.awt.geom.Point2D@w{ }@var{src}, java.awt.geom.Point2D@w{ }@var{dst}) @*throws NoninvertibleTransformException
-
-@end deftypemethod
-@deftypemethod AffineTransform {public void} inverseTransform (double[]@w{ }@var{srcPts}, int@w{ }@var{srcOff}, double[]@w{ }@var{dstPts}, int@w{ }@var{dstOff}, int@w{ }@var{num}) @*throws NoninvertibleTransformException
-
-@end deftypemethod
-@deftypemethod AffineTransform {public Point2D} deltaTransform (java.awt.geom.Point2D@w{ }@var{src}, java.awt.geom.Point2D@w{ }@var{dst})
-
-@end deftypemethod
-@deftypemethod AffineTransform {public void} deltaTransform (double[]@w{ }@var{srcPts}, int@w{ }@var{srcOff}, double[]@w{ }@var{dstPts}, int@w{ }@var{dstOff}, int@w{ }@var{num})
-
-@end deftypemethod
-@deftypemethod AffineTransform {public Shape} createTransformedShape (java.awt.Shape@w{ }@var{pSrc})
-
-@end deftypemethod
-@deftypemethod AffineTransform {public String} toString ()
-
-@end deftypemethod
-@deftypemethod AffineTransform {public boolean} isIdentity ()
-
-@end deftypemethod
-@deftypemethod AffineTransform {public Object} clone ()
-
-@end deftypemethod
-@deftypemethod AffineTransform {public int} hashCode ()
-
-@end deftypemethod
-@deftypemethod AffineTransform {public boolean} equals (java.lang.Object@w{ }@var{obj})
-
-@end deftypemethod
-@deftypemethod Dimension2D {public abstract double} getWidth ()
-
-@end deftypemethod
-@deftypemethod Dimension2D {public abstract double} getHeight ()
-
-@end deftypemethod
-@deftypemethod Dimension2D {public abstract void} setSize (double@w{ }@var{width}, double@w{ }@var{height})
-
-@end deftypemethod
-@deftypemethod Dimension2D {public void} setSize (java.awt.geom.Dimension2D@w{ }@var{dim})
-
-@end deftypemethod
-@deftypemethod Dimension2D {public Object} clone ()
-
-@end deftypemethod
-@deftypemethod Ellipse2D {public boolean} contains (double@w{ }@var{x}, double@w{ }@var{y})
-
-@end deftypemethod
-@deftypemethod Ellipse2D {public boolean} contains (double@w{ }@var{x}, double@w{ }@var{y}, double@w{ }@var{w}, double@w{ }@var{h})
-
-@end deftypemethod
-@deftypemethod Ellipse2D {public PathIterator} getPathIterator (java.awt.geom.AffineTransform@w{ }@var{at})
-
-@end deftypemethod
-@deftypemethod Ellipse2D {public boolean} intersects (double@w{ }@var{x}, double@w{ }@var{y}, double@w{ }@var{w}, double@w{ }@var{h})
-
-@end deftypemethod
-@deftypemethod Ellipse2D.Double {public Rectangle2D} getBounds2D ()
-
-@end deftypemethod
-@deftypemethod Ellipse2D.Double {public double} getHeight ()
-
-@end deftypemethod
-@deftypemethod Ellipse2D.Double {public double} getWidth ()
-
-@end deftypemethod
-@deftypemethod Ellipse2D.Double {public double} getX ()
-
-@end deftypemethod
-@deftypemethod Ellipse2D.Double {public double} getY ()
-
-@end deftypemethod
-@deftypemethod Ellipse2D.Double {public boolean} isEmpty ()
-
-@end deftypemethod
-@deftypemethod Ellipse2D.Double {public void} setFrame (double@w{ }@var{x}, double@w{ }@var{y}, double@w{ }@var{w}, double@w{ }@var{h})
-
-@end deftypemethod
-@deftypemethod Ellipse2D.Float {public Rectangle2D} getBounds2D ()
-
-@end deftypemethod
-@deftypemethod Ellipse2D.Float {public double} getHeight ()
-
-@end deftypemethod
-@deftypemethod Ellipse2D.Float {public double} getWidth ()
-
-@end deftypemethod
-@deftypemethod Ellipse2D.Float {public double} getX ()
-
-@end deftypemethod
-@deftypemethod Ellipse2D.Float {public double} getY ()
-
-@end deftypemethod
-@deftypemethod Ellipse2D.Float {public boolean} isEmpty ()
-
-@end deftypemethod
-@deftypemethod Ellipse2D.Float {public void} setFrame (float@w{ }@var{x}, float@w{ }@var{y}, float@w{ }@var{w}, float@w{ }@var{h})
-
-@end deftypemethod
-@deftypemethod Ellipse2D.Float {public void} setFrame (double@w{ }@var{x}, double@w{ }@var{y}, double@w{ }@var{w}, double@w{ }@var{h})
-
-@end deftypemethod
-@deftypemethod PathIterator {public int} currentSegment (double[]@w{ }@var{coords})
-
-@end deftypemethod
-@deftypemethod PathIterator {public int} currentSegment (float[]@w{ }@var{coords})
-
-@end deftypemethod
-@deftypemethod PathIterator {public int} getWindingRule ()
-
-@end deftypemethod
-@deftypemethod PathIterator {public boolean} isDone ()
-
-@end deftypemethod
-@deftypemethod PathIterator {public void} next ()
-
-@end deftypemethod
-@deftypemethod Point2D {public abstract double} getX ()
-
-@end deftypemethod
-@deftypemethod Point2D {public abstract double} getY ()
-
-@end deftypemethod
-@deftypemethod Point2D {public abstract void} setLocation (double@w{ }@var{x}, double@w{ }@var{y})
-
-@end deftypemethod
-@deftypemethod Point2D {public void} setLocation (java.awt.geom.Point2D@w{ }@var{pt})
-
-@end deftypemethod
-@deftypemethod Point2D {public static double} distanceSq (double@w{ }@var{X1}, double@w{ }@var{Y1}, double@w{ }@var{X2}, double@w{ }@var{Y2})
-
-@end deftypemethod
-@deftypemethod Point2D {public static double} distance (double@w{ }@var{X1}, double@w{ }@var{Y1}, double@w{ }@var{X2}, double@w{ }@var{Y2})
-
-@end deftypemethod
-@deftypemethod Point2D {public double} distanceSq (double@w{ }@var{PX}, double@w{ }@var{PY})
-
-@end deftypemethod
-@deftypemethod Point2D {public double} distance (double@w{ }@var{PX}, double@w{ }@var{PY})
-
-@end deftypemethod
-@deftypemethod Point2D {public double} distanceSq (java.awt.geom.Point2D@w{ }@var{pt})
-
-@end deftypemethod
-@deftypemethod Point2D {public double} distance (java.awt.geom.Point2D@w{ }@var{pt})
-
-@end deftypemethod
-@deftypemethod Point2D {public int} hashCode ()
-
-@end deftypemethod
-@deftypemethod Point2D {public Object} clone ()
-
-@end deftypemethod
-@deftypemethod Point2D {public boolean} equals (java.lang.Object@w{ }@var{o})
-
-@end deftypemethod
-@deftypemethod Point2D.Double {public double} getX ()
-
-@end deftypemethod
-@deftypemethod Point2D.Double {public double} getY ()
-
-@end deftypemethod
-@deftypemethod Point2D.Double {public void} setLocation (double@w{ }@var{x}, double@w{ }@var{y})
-
-@end deftypemethod
-@deftypemethod Point2D.Double {public String} toString ()
-
-@end deftypemethod
-@deftypemethod Point2D.Float {public double} getX ()
-
-@end deftypemethod
-@deftypemethod Point2D.Float {public double} getY ()
-
-@end deftypemethod
-@deftypemethod Point2D.Float {public void} setLocation (double@w{ }@var{x}, double@w{ }@var{y})
-
-@end deftypemethod
-@deftypemethod Point2D.Float {public void} setLocation (float@w{ }@var{x}, float@w{ }@var{y})
-
-@end deftypemethod
-@deftypemethod Point2D.Float {public String} toString ()
-
-@end deftypemethod
-@deftypemethod Rectangle2D {public abstract void} setRect (double@w{ }@var{x}, double@w{ }@var{y}, double@w{ }@var{w}, double@w{ }@var{h})
-Set the bounding box of this rectangle.
-@end deftypemethod
-@deftypemethod Rectangle2D {public void} setRect (java.awt.geom.Rectangle2D@w{ }@var{r})
-Set the bounding box of this rectangle.
-@end deftypemethod
-@deftypemethod Rectangle2D {public boolean} intersectsLine (double@w{ }@var{x1}, double@w{ }@var{y1}, double@w{ }@var{x2}, double@w{ }@var{y2})
-Returns true if line segment intersects interior of this
- rectangle.
-@end deftypemethod
-@deftypemethod Rectangle2D {public abstract int} outcode (double@w{ }@var{x}, double@w{ }@var{y})
-Return true if line segment intersects interior of this
- rectangle.
-@end deftypemethod
-@deftypemethod Rectangle2D {public int} outcode (java.awt.geom.Point2D@w{ }@var{p})
-
-@end deftypemethod
-@deftypemethod Rectangle2D {public void} setFrame (double@w{ }@var{x}, double@w{ }@var{y}, double@w{ }@var{w}, double@w{ }@var{h})
-Set bounding frame for this rectangle.
-@end deftypemethod
-@deftypemethod Rectangle2D {public Rectangle2D} getBounds2D ()
-
-@end deftypemethod
-@deftypemethod Rectangle2D {public boolean} contains (double@w{ }@var{x}, double@w{ }@var{y})
-
-@end deftypemethod
-@deftypemethod Rectangle2D {public boolean} intersects (double@w{ }@var{x}, double@w{ }@var{y}, double@w{ }@var{w}, double@w{ }@var{h})
-
-@end deftypemethod
-@deftypemethod Rectangle2D {public boolean} contains (double@w{ }@var{x}, double@w{ }@var{y}, double@w{ }@var{w}, double@w{ }@var{h})
-
-@end deftypemethod
-@deftypemethod Rectangle2D {public abstract Rectangle2D} createIntersection (java.awt.geom.Rectangle2D@w{ }@var{r})
-
-@end deftypemethod
-@deftypemethod Rectangle2D {public static void} intersect (java.awt.geom.Rectangle2D@w{ }@var{src1}, java.awt.geom.Rectangle2D@w{ }@var{src2}, java.awt.geom.Rectangle2D@w{ }@var{dest})
-
-@end deftypemethod
-@deftypemethod Rectangle2D {public abstract Rectangle2D} createUnion (java.awt.geom.Rectangle2D@w{ }@var{r})
-
-@end deftypemethod
-@deftypemethod Rectangle2D {public static void} union (java.awt.geom.Rectangle2D@w{ }@var{src1}, java.awt.geom.Rectangle2D@w{ }@var{src2}, java.awt.geom.Rectangle2D@w{ }@var{dest})
-
-@end deftypemethod
-@deftypemethod Rectangle2D {public void} add (double@w{ }@var{newx}, double@w{ }@var{newy})
-
-@end deftypemethod
-@deftypemethod Rectangle2D {public void} add (java.awt.geom.Point2D@w{ }@var{p})
-
-@end deftypemethod
-@deftypemethod Rectangle2D {public void} add (java.awt.geom.Rectangle2D@w{ }@var{r})
-
-@end deftypemethod
-@deftypemethod Rectangle2D {public PathIterator} getPathIterator (java.awt.geom.AffineTransform@w{ }@var{at})
-
-@end deftypemethod
-@deftypemethod Rectangle2D.Double {public double} getX ()
-
-@end deftypemethod
-@deftypemethod Rectangle2D.Double {public double} getY ()
-
-@end deftypemethod
-@deftypemethod Rectangle2D.Double {public double} getWidth ()
-
-@end deftypemethod
-@deftypemethod Rectangle2D.Double {public double} getHeight ()
-
-@end deftypemethod
-@deftypemethod Rectangle2D.Double {public boolean} isEmpty ()
-
-@end deftypemethod
-@deftypemethod Rectangle2D.Double {public void} setRect (double@w{ }@var{x}, double@w{ }@var{y}, double@w{ }@var{w}, double@w{ }@var{h})
-
-@end deftypemethod
-@deftypemethod Rectangle2D.Double {public void} setRect (java.awt.geom.Rectangle2D@w{ }@var{r})
-
-@end deftypemethod
-@deftypemethod Rectangle2D.Double {public int} outcode (double@w{ }@var{x}, double@w{ }@var{y})
-
-@end deftypemethod
-@deftypemethod Rectangle2D.Double {public Rectangle2D} getBounds2D ()
-
-@end deftypemethod
-@deftypemethod Rectangle2D.Double {public Rectangle2D} createIntersection (java.awt.geom.Rectangle2D@w{ }@var{r})
-
-@end deftypemethod
-@deftypemethod Rectangle2D.Double {public Rectangle2D} createUnion (java.awt.geom.Rectangle2D@w{ }@var{r})
-
-@end deftypemethod
-@deftypemethod Rectangle2D.Double {public String} toString ()
-
-@end deftypemethod
-@deftypemethod Rectangle2D.Float {public double} getX ()
-
-@end deftypemethod
-@deftypemethod Rectangle2D.Float {public double} getY ()
-
-@end deftypemethod
-@deftypemethod Rectangle2D.Float {public double} getWidth ()
-
-@end deftypemethod
-@deftypemethod Rectangle2D.Float {public double} getHeight ()
-
-@end deftypemethod
-@deftypemethod Rectangle2D.Float {public boolean} isEmpty ()
-
-@end deftypemethod
-@deftypemethod Rectangle2D.Float {public void} setRect (double@w{ }@var{x}, double@w{ }@var{y}, double@w{ }@var{w}, double@w{ }@var{h})
-
-@end deftypemethod
-@deftypemethod Rectangle2D.Float {public void} setRect (java.awt.geom.Rectangle2D@w{ }@var{r})
-
-@end deftypemethod
-@deftypemethod Rectangle2D.Float {public int} outcode (double@w{ }@var{x}, double@w{ }@var{y})
-
-@end deftypemethod
-@deftypemethod Rectangle2D.Float {public Rectangle2D} getBounds2D ()
-
-@end deftypemethod
-@deftypemethod Rectangle2D.Float {public Rectangle2D} createIntersection (java.awt.geom.Rectangle2D@w{ }@var{r})
-
-@end deftypemethod
-@deftypemethod Rectangle2D.Float {public Rectangle2D} createUnion (java.awt.geom.Rectangle2D@w{ }@var{r})
-
-@end deftypemethod
-@deftypemethod Rectangle2D.Float {public String} toString ()
-
-@end deftypemethod
-@deftypemethod RectangularShape {public abstract double} getX ()
-
-@end deftypemethod
-@deftypemethod RectangularShape {public abstract double} getY ()
-
-@end deftypemethod
-@deftypemethod RectangularShape {public abstract double} getWidth ()
-
-@end deftypemethod
-@deftypemethod RectangularShape {public abstract double} getHeight ()
-
-@end deftypemethod
-@deftypemethod RectangularShape {public double} getMinX ()
-
-@end deftypemethod
-@deftypemethod RectangularShape {public double} getMinY ()
-
-@end deftypemethod
-@deftypemethod RectangularShape {public double} getMaxX ()
-
-@end deftypemethod
-@deftypemethod RectangularShape {public double} getMaxY ()
-
-@end deftypemethod
-@deftypemethod RectangularShape {public double} getCenterX ()
-
-@end deftypemethod
-@deftypemethod RectangularShape {public double} getCenterY ()
-
-@end deftypemethod
-@deftypemethod RectangularShape {public Rectangle2D} getFrame ()
-
-@end deftypemethod
-@deftypemethod RectangularShape {public abstract boolean} isEmpty ()
-
-@end deftypemethod
-@deftypemethod RectangularShape {public abstract void} setFrame (double@w{ }@var{x}, double@w{ }@var{y}, double@w{ }@var{w}, double@w{ }@var{h})
-
-@end deftypemethod
-@deftypemethod RectangularShape {public void} setFrame (java.awt.geom.Point2D@w{ }@var{loc}, java.awt.geom.Dimension2D@w{ }@var{size})
-
-@end deftypemethod
-@deftypemethod RectangularShape {public void} setFrame (java.awt.geom.Rectangle2D@w{ }@var{r})
-
-@end deftypemethod
-@deftypemethod RectangularShape {public void} setFrameFromDiagonal (double@w{ }@var{x1}, double@w{ }@var{y1}, double@w{ }@var{x2}, double@w{ }@var{y2})
-
-@end deftypemethod
-@deftypemethod RectangularShape {public void} setFrameFromDiagonal (java.awt.geom.Point2D@w{ }@var{p1}, java.awt.geom.Point2D@w{ }@var{p2})
-
-@end deftypemethod
-@deftypemethod RectangularShape {public void} setFrameFromCenter (double@w{ }@var{centerX}, double@w{ }@var{centerY}, double@w{ }@var{cornerX}, double@w{ }@var{cornerY})
-
-@end deftypemethod
-@deftypemethod RectangularShape {public void} setFrameFromCenter (java.awt.geom.Point2D@w{ }@var{center}, java.awt.geom.Point2D@w{ }@var{corner})
-
-@end deftypemethod
-@deftypemethod RectangularShape {public boolean} contains (java.awt.geom.Point2D@w{ }@var{p})
-
-@end deftypemethod
-@deftypemethod RectangularShape {public boolean} intersects (java.awt.geom.Rectangle2D@w{ }@var{r})
-
-@end deftypemethod
-@deftypemethod RectangularShape {public boolean} contains (java.awt.geom.Rectangle2D@w{ }@var{r})
-
-@end deftypemethod
-@deftypemethod RectangularShape {public Rectangle} getBounds ()
-
-@end deftypemethod
-@deftypemethod RectangularShape {public PathIterator} getPathIterator (java.awt.geom.AffineTransform@w{ }@var{at}, double@w{ }@var{flatness})
-
-@end deftypemethod
-@deftypemethod RectangularShape {public Object} clone ()
-
-@end deftypemethod
-@deftypemethod RoundRectangle2D {public abstract double} getArcHeight ()
-Return the arc height of this round rectangle.
-@end deftypemethod
-@deftypemethod RoundRectangle2D {public abstract double} getArcWidth ()
-Return the arc width of this round rectangle.
-@end deftypemethod
-@deftypemethod RoundRectangle2D {public abstract void} setRoundRect (double@w{ }@var{x}, double@w{ }@var{y}, double@w{ }@var{w}, double@w{ }@var{h}, double@w{ }@var{arcWidth}, double@w{ }@var{arcHeight})
-Set the values of this round rectangle
-@end deftypemethod
-@deftypemethod RoundRectangle2D {public boolean} contains (double@w{ }@var{x}, double@w{ }@var{y})
-Return true if this object contains the specified point.
-@end deftypemethod
-@deftypemethod RoundRectangle2D {public boolean} contains (double@w{ }@var{x}, double@w{ }@var{y}, double@w{ }@var{w}, double@w{ }@var{h})
-Return true if this object contains the specified rectangle
-@end deftypemethod
-@deftypemethod RoundRectangle2D {public PathIterator} getPathIterator (java.awt.geom.AffineTransform@w{ }@var{at})
-Return a new path iterator which iterates over this rectangle.
-@end deftypemethod
-@deftypemethod RoundRectangle2D {public boolean} intersects (double@w{ }@var{x}, double@w{ }@var{y}, double@w{ }@var{w}, double@w{ }@var{h})
-Return true if the given rectangle intersects this shape.
-@end deftypemethod
-@deftypemethod RoundRectangle2D {public void} setFrame (double@w{ }@var{x}, double@w{ }@var{y}, double@w{ }@var{w}, double@w{ }@var{h})
-Set the boundary of this round rectangle.
-@end deftypemethod
-@deftypemethod RoundRectangle2D {public void} setRoundRect (java.awt.geom.RoundRectangle2D@w{ }@var{rr})
-Set the values of this round rectangle to be the same as those
- of the argument.
-@end deftypemethod
-@deftypemethod RoundRectangle2D.Float {public double} getArcHeight ()
-
-@end deftypemethod
-@deftypemethod RoundRectangle2D.Float {public double} getArcWidth ()
-
-@end deftypemethod
-@deftypemethod RoundRectangle2D.Float {public Rectangle2D} getBounds2D ()
-
-@end deftypemethod
-@deftypemethod RoundRectangle2D.Float {public double} getX ()
-
-@end deftypemethod
-@deftypemethod RoundRectangle2D.Float {public double} getY ()
-
-@end deftypemethod
-@deftypemethod RoundRectangle2D.Float {public double} getWidth ()
-
-@end deftypemethod
-@deftypemethod RoundRectangle2D.Float {public double} getHeight ()
-
-@end deftypemethod
-@deftypemethod RoundRectangle2D.Float {public boolean} isEmpty ()
-
-@end deftypemethod
-@deftypemethod RoundRectangle2D.Float {public void} setRoundRect (float@w{ }@var{x}, float@w{ }@var{y}, float@w{ }@var{w}, float@w{ }@var{h}, float@w{ }@var{arcWidth}, float@w{ }@var{arcHeight})
-
-@end deftypemethod
-@deftypemethod RoundRectangle2D.Float {public void} setRoundRect (double@w{ }@var{x}, double@w{ }@var{y}, double@w{ }@var{w}, double@w{ }@var{h}, double@w{ }@var{arcWidth}, double@w{ }@var{arcHeight})
-
-@end deftypemethod
-@deftypemethod RoundRectangle2D.Double {public double} getArcHeight ()
-
-@end deftypemethod
-@deftypemethod RoundRectangle2D.Double {public double} getArcWidth ()
-
-@end deftypemethod
-@deftypemethod RoundRectangle2D.Double {public Rectangle2D} getBounds2D ()
-
-@end deftypemethod
-@deftypemethod RoundRectangle2D.Double {public double} getX ()
-
-@end deftypemethod
-@deftypemethod RoundRectangle2D.Double {public double} getY ()
-
-@end deftypemethod
-@deftypemethod RoundRectangle2D.Double {public double} getWidth ()
-
-@end deftypemethod
-@deftypemethod RoundRectangle2D.Double {public double} getHeight ()
-
-@end deftypemethod
-@deftypemethod RoundRectangle2D.Double {public boolean} isEmpty ()
-
-@end deftypemethod
-@deftypemethod RoundRectangle2D.Double {public void} setRoundRect (double@w{ }@var{x}, double@w{ }@var{y}, double@w{ }@var{w}, double@w{ }@var{h}, double@w{ }@var{arcWidth}, double@w{ }@var{arcHeight})
-
-@end deftypemethod
diff --git a/libjava/doc/java-awt-image.texi b/libjava/doc/java-awt-image.texi
deleted file mode 100644
index a658628376c..00000000000
--- a/libjava/doc/java-awt-image.texi
+++ /dev/null
@@ -1,1149 +0,0 @@
-@deftypemethod BufferedImage {public void} coerceData (boolean@w{ }@var{premultiplied})
-
-@end deftypemethod
-@deftypemethod BufferedImage {public WritableRaster} copyData (java.awt.image.WritableRaster@w{ }@var{dest})
-
-@end deftypemethod
-@deftypemethod BufferedImage {public Graphics2D} createGraphics ()
-
-@end deftypemethod
-@deftypemethod BufferedImage {public void} flush ()
-
-@end deftypemethod
-@deftypemethod BufferedImage {public WritableRaster} getAlphaRaster ()
-
-@end deftypemethod
-@deftypemethod BufferedImage {public ColorModel} getColorModel ()
-
-@end deftypemethod
-@deftypemethod BufferedImage {public Raster} getData ()
-
-@end deftypemethod
-@deftypemethod BufferedImage {public Raster} getData (java.awt.Rectangle@w{ }@var{rectangle})
-
-@end deftypemethod
-@deftypemethod BufferedImage {public Graphics} getGraphics ()
-
-@end deftypemethod
-@deftypemethod BufferedImage {public int} getHeight ()
-
-@end deftypemethod
-@deftypemethod BufferedImage {public int} getHeight (java.awt.image.ImageObserver@w{ }@var{imageobserver})
-
-@end deftypemethod
-@deftypemethod BufferedImage {public int} getMinTileX ()
-
-@end deftypemethod
-@deftypemethod BufferedImage {public int} getMinTileY ()
-
-@end deftypemethod
-@deftypemethod BufferedImage {public int} getMinX ()
-
-@end deftypemethod
-@deftypemethod BufferedImage {public int} getMinY ()
-
-@end deftypemethod
-@deftypemethod BufferedImage {public int} getNumXTiles ()
-
-@end deftypemethod
-@deftypemethod BufferedImage {public int} getNumYTiles ()
-
-@end deftypemethod
-@deftypemethod BufferedImage {public Object} getProperty (java.lang.String@w{ }@var{string})
-
-@end deftypemethod
-@deftypemethod BufferedImage {public Object} getProperty (java.lang.String@w{ }@var{string}, java.awt.image.ImageObserver@w{ }@var{imageobserver})
-
-@end deftypemethod
-@deftypemethod BufferedImage {public String} getPropertyNames ()
-
-@end deftypemethod
-@deftypemethod BufferedImage {public int} getRGB (int@w{ }@var{x}, int@w{ }@var{y})
-
-@end deftypemethod
-@deftypemethod BufferedImage {public int} getRGB (int@w{ }@var{startX}, int@w{ }@var{startY}, int@w{ }@var{w}, int@w{ }@var{h}, int[]@w{ }@var{rgbArray}, int@w{ }@var{offset}, int@w{ }@var{scanlineStride})
-
-@end deftypemethod
-@deftypemethod BufferedImage {public WritableRaster} getRaster ()
-
-@end deftypemethod
-@deftypemethod BufferedImage {public SampleModel} getSampleModel ()
-
-@end deftypemethod
-@deftypemethod BufferedImage {public ImageProducer} getSource ()
-
-@end deftypemethod
-@deftypemethod BufferedImage {public Vector} getSources ()
-
-@end deftypemethod
-@deftypemethod BufferedImage {public BufferedImage} getSubimage (int@w{ }@var{x}, int@w{ }@var{y}, int@w{ }@var{w}, int@w{ }@var{h})
-
-@end deftypemethod
-@deftypemethod BufferedImage {public Raster} getTile (int@w{ }@var{tileX}, int@w{ }@var{tileY})
-
-@end deftypemethod
-@deftypemethod BufferedImage {public int} getTileGridXOffset ()
-
-@end deftypemethod
-@deftypemethod BufferedImage {public int} getTileGridYOffset ()
-
-@end deftypemethod
-@deftypemethod BufferedImage {public int} getTileHeight ()
-
-@end deftypemethod
-@deftypemethod BufferedImage {public int} getTileWidth ()
-
-@end deftypemethod
-@deftypemethod BufferedImage {public int} getType ()
-
-@end deftypemethod
-@deftypemethod BufferedImage {public int} getWidth ()
-
-@end deftypemethod
-@deftypemethod BufferedImage {public int} getWidth (java.awt.image.ImageObserver@w{ }@var{imageobserver})
-
-@end deftypemethod
-@deftypemethod BufferedImage {public WritableRaster} getWritableTile (int@w{ }@var{tileX}, int@w{ }@var{tileY})
-
-@end deftypemethod
-@deftypemethod BufferedImage {public Point} getWritableTileIndices ()
-
-@end deftypemethod
-@deftypemethod BufferedImage {public boolean} hasTileWriters ()
-
-@end deftypemethod
-@deftypemethod BufferedImage {public boolean} isAlphaPremultiplied ()
-
-@end deftypemethod
-@deftypemethod BufferedImage {public boolean} isTileWritable (int@w{ }@var{tileX}, int@w{ }@var{tileY})
-
-@end deftypemethod
-@deftypemethod BufferedImage {public void} releaseWritableTile (int@w{ }@var{tileX}, int@w{ }@var{tileY})
-
-@end deftypemethod
-@deftypemethod BufferedImage {public void} setData (java.awt.image.Raster@w{ }@var{src})
-
-@end deftypemethod
-@deftypemethod BufferedImage {public void} setRGB (int@w{ }@var{x}, int@w{ }@var{y}, int@w{ }@var{argb})
-
-@end deftypemethod
-@deftypemethod BufferedImage {public void} setRGB (int@w{ }@var{startX}, int@w{ }@var{startY}, int@w{ }@var{w}, int@w{ }@var{h}, int[]@w{ }@var{argbArray}, int@w{ }@var{offset}, int@w{ }@var{scanlineStride})
-
-@end deftypemethod
-@deftypemethod BufferedImage {public String} toString ()
-
-@end deftypemethod
-@deftypemethod ColorModel {public static ColorModel} getRGBdefault ()
-
-@end deftypemethod
-@deftypemethod ColorModel {public final boolean} hasAlpha ()
-
-@end deftypemethod
-@deftypemethod ColorModel {public final boolean} isAlphaPremultiplied ()
-
-@end deftypemethod
-@deftypemethod ColorModel {public int} getPixelSize ()
-
-@end deftypemethod
-@deftypemethod ColorModel {public int} getComponentSize (int@w{ }@var{componentIdx})
-
-@end deftypemethod
-@deftypemethod ColorModel {public int} getComponentSize ()
-
-@end deftypemethod
-@deftypemethod ColorModel {public int} getTransparency ()
-
-@end deftypemethod
-@deftypemethod ColorModel {public int} getNumComponents ()
-
-@end deftypemethod
-@deftypemethod ColorModel {public int} getNumColorComponents ()
-
-@end deftypemethod
-@deftypemethod ColorModel {public abstract int} getRed (int@w{ }@var{pixel})
-Converts pixel value to sRGB and extract red int sample scaled
- to range [0, 255].
-@end deftypemethod
-@deftypemethod ColorModel {public abstract int} getGreen (int@w{ }@var{pixel})
-Converts pixel value to sRGB and extract green int sample
- scaled to range [0, 255].
-@end deftypemethod
-@deftypemethod ColorModel {public abstract int} getBlue (int@w{ }@var{pixel})
-Converts pixel value to sRGB and extract blue int sample
- scaled to range [0, 255].
-@end deftypemethod
-@deftypemethod ColorModel {public abstract int} getAlpha (int@w{ }@var{pixel})
-Extract alpha int sample from pixel value, scaled to [0, 255].
-@end deftypemethod
-@deftypemethod ColorModel {public int} getRGB (int@w{ }@var{pixel})
-Converts a pixel int value of the color space of the color
- model to a sRGB pixel int value.
-
- This method is typically overriden in subclasses to provide a
- more efficient implementation.
-@end deftypemethod
-@deftypemethod ColorModel {public int} getRed (java.lang.Object@w{ }@var{inData})
-Converts pixel in the given array to sRGB and extract blue int
- sample scaled to range [0-255].
-
- This method is typically overriden in subclasses to provide a
- more efficient implementation.
-@end deftypemethod
-@deftypemethod ColorModel {public int} getGreen (java.lang.Object@w{ }@var{inData})
-
-@end deftypemethod
-@deftypemethod ColorModel {public int} getBlue (java.lang.Object@w{ }@var{inData})
-
-@end deftypemethod
-@deftypemethod ColorModel {public int} getAlpha (java.lang.Object@w{ }@var{inData})
-
-@end deftypemethod
-@deftypemethod ColorModel {public int} getRGB (java.lang.Object@w{ }@var{inData})
-Converts a pixel in the given array of the color space of the
- color model to an sRGB pixel int value.
-
-
-
-This method performs the inverse function of
- @code{getDataElements(int rgb, Object pixel)}.
- I.e. @code{(rgb == cm.getRGB(cm.getDataElements(rgb,
- null)))}.
-@end deftypemethod
-@deftypemethod ColorModel {public Object} getDataElements (int@w{ }@var{rgb}, java.lang.Object@w{ }@var{pixel})
-Converts an sRGB pixel int value to an array containing a
- single pixel of the color space of the color model.
-
-
-
-This method performs the inverse function of
- @code{getRGB(Object inData)}.
-
- Outline of conversion process:
-
-
-@itemize @bullet
-
-
-
-@item
-Convert rgb to normalized [0.0, 1.0] sRGB values.
-
-
-
-@item
-Convert to color space components using fromRGB in
- ColorSpace.
-
-
-
-@item
-If color model has alpha and should be premultiplied,
- multiply color space components with alpha value
-
-
-
-@item
-Scale the components to the correct number of bits.
-
-
-
-@item
-Arrange the components in the output array
-
-
-
-@end itemize
-
-@end deftypemethod
-@deftypemethod ColorModel {public int} getComponents (int@w{ }@var{pixel}, int[]@w{ }@var{components}, int@w{ }@var{offset})
-Fills an array with the unnormalized component samples from a
- pixel value. I.e. decompose the pixel, but not perform any
- color conversion.
-
- This method is typically overriden in subclasses to provide a
- more efficient implementation.
-@end deftypemethod
-@deftypemethod ColorModel {public int} getComponents (java.lang.Object@w{ }@var{pixel}, int[]@w{ }@var{components}, int@w{ }@var{offset})
-Fills an array with the unnormalized component samples from an
- array of transferType containing a single pixel. I.e. decompose
- the pixel, but not perform any color conversion.
-
- This method is typically overriden in subclasses to provide a
- more efficient implementation.
-@end deftypemethod
-@deftypemethod ColorModel {public int} getUnnormalizedComponents (float[]@w{ }@var{normComponents}, int@w{ }@var{normOffset}, int[]@w{ }@var{components}, int@w{ }@var{offset})
-Convert normalized components to unnormalized components.
-@end deftypemethod
-@deftypemethod ColorModel {public float} getNormalizedComponents (int[]@w{ }@var{components}, int@w{ }@var{offset}, float[]@w{ }@var{normComponents}, int@w{ }@var{normOffset})
-Convert unnormalized components to normalized components.
-@end deftypemethod
-@deftypemethod ColorModel {public int} getDataElement (int[]@w{ }@var{components}, int@w{ }@var{offset})
-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.
-
- This method performs the inverse function of
- @code{getComponents(int pixel, int[] components,
- int offset)}. I.e.
-
- @code{(pixel == cm.getDataElement(cm.getComponents(pixel, null,
- 0), 0))}.
-
- This method is typically overriden in subclasses to provide a
- more efficient implementation.
-@end deftypemethod
-@deftypemethod ColorModel {public Object} getDataElements (int[]@w{ }@var{components}, int@w{ }@var{offset}, java.lang.Object@w{ }@var{obj})
-
-@end deftypemethod
-@deftypemethod ColorModel {public boolean} equals (java.lang.Object@w{ }@var{obj})
-
-@end deftypemethod
-@deftypemethod ColorModel {public final ColorSpace} getColorSpace ()
-
-@end deftypemethod
-@deftypemethod ColorModel {public ColorModel} coerceData (java.awt.image.WritableRaster@w{ }@var{raster}, boolean@w{ }@var{isAlphaPremultiplied})
-
-@end deftypemethod
-@deftypemethod ColorModel {public boolean} isCompatibleRaster (java.awt.image.Raster@w{ }@var{raster})
-
-@end deftypemethod
-@deftypemethod ColorModel {public WritableRaster} createCompatibleWritableRaster (int@w{ }@var{w}, int@w{ }@var{h})
-
-@end deftypemethod
-@deftypemethod ColorModel {public SampleModel} createCompatibleSampleModel (int@w{ }@var{w}, int@w{ }@var{h})
-
-@end deftypemethod
-@deftypemethod ColorModel {public boolean} isCompatibleSampleModel (java.awt.image.SampleModel@w{ }@var{sm})
-
-@end deftypemethod
-@deftypemethod ColorModel {public void} finalize ()
-
-@end deftypemethod
-@deftypemethod ColorModel {public WritableRaster} getAlphaRaster (java.awt.image.WritableRaster@w{ }@var{raster})
-Subclasses must override this method if it is possible for the
- color model to have an alpha channel.
-@end deftypemethod
-@deftypemethod ColorModel {public String} toString ()
-
-@end deftypemethod
-@deftypemethod ComponentColorModel {public int} getRed (int@w{ }@var{pixel})
-
-@end deftypemethod
-@deftypemethod ComponentColorModel {public int} getGreen (int@w{ }@var{pixel})
-
-@end deftypemethod
-@deftypemethod ComponentColorModel {public int} getBlue (int@w{ }@var{pixel})
-
-@end deftypemethod
-@deftypemethod ComponentColorModel {public int} getAlpha (int@w{ }@var{pixel})
-
-@end deftypemethod
-@deftypemethod ComponentColorModel {public int} getRGB (int@w{ }@var{pixel})
-
-@end deftypemethod
-@deftypemethod ComponentColorModel {public int} getRed (java.lang.Object@w{ }@var{inData})
-
-@end deftypemethod
-@deftypemethod ComponentColorModel {public int} getGreen (java.lang.Object@w{ }@var{inData})
-
-@end deftypemethod
-@deftypemethod ComponentColorModel {public int} getBlue (java.lang.Object@w{ }@var{inData})
-
-@end deftypemethod
-@deftypemethod ComponentColorModel {public int} getAlpha (java.lang.Object@w{ }@var{inData})
-
-@end deftypemethod
-@deftypemethod ComponentColorModel {public int} getRGB (java.lang.Object@w{ }@var{inData})
-
-@end deftypemethod
-@deftypemethod ComponentColorModel {public Object} getDataElements (int@w{ }@var{rgb}, java.lang.Object@w{ }@var{pixel})
-
-@end deftypemethod
-@deftypemethod ComponentColorModel {public int} getComponents (int@w{ }@var{pixel}, int[]@w{ }@var{components}, int@w{ }@var{offset})
-
-@end deftypemethod
-@deftypemethod ComponentColorModel {public int} getComponents (java.lang.Object@w{ }@var{pixel}, int[]@w{ }@var{components}, int@w{ }@var{offset})
-
-@end deftypemethod
-@deftypemethod ComponentColorModel {public int} getDataElement (int[]@w{ }@var{components}, int@w{ }@var{offset})
-
-@end deftypemethod
-@deftypemethod ComponentColorModel {public Object} getDataElements (int[]@w{ }@var{components}, int@w{ }@var{offset}, java.lang.Object@w{ }@var{obj})
-
-@end deftypemethod
-@deftypemethod ComponentColorModel {public ColorModel} coerceData (java.awt.image.WritableRaster@w{ }@var{raster}, boolean@w{ }@var{isAlphaPremultiplied})
-
-@end deftypemethod
-@deftypemethod ComponentColorModel {public boolean} isCompatibleRaster (java.awt.image.Raster@w{ }@var{raster})
-
-@end deftypemethod
-@deftypemethod ComponentColorModel {public WritableRaster} createCompatibleWritableRaster (int@w{ }@var{w}, int@w{ }@var{h})
-
-@end deftypemethod
-@deftypemethod ComponentColorModel {public SampleModel} createCompatibleSampleModel (int@w{ }@var{w}, int@w{ }@var{h})
-
-@end deftypemethod
-@deftypemethod ComponentColorModel {public boolean} isCompatibleSampleModel (java.awt.image.SampleModel@w{ }@var{sm})
-
-@end deftypemethod
-@deftypemethod ComponentColorModel {public WritableRaster} getAlphaRaster (java.awt.image.WritableRaster@w{ }@var{raster})
-
-@end deftypemethod
-@deftypemethod ComponentColorModel {public boolean} equals (java.lang.Object@w{ }@var{obj})
-
-@end deftypemethod
-@deftypemethod ComponentSampleModel {public SampleModel} createCompatibleSampleModel (int@w{ }@var{w}, int@w{ }@var{h})
-
-@end deftypemethod
-@deftypemethod ComponentSampleModel {public SampleModel} createSubsetSampleModel (int[]@w{ }@var{bands})
-
-@end deftypemethod
-@deftypemethod ComponentSampleModel {public DataBuffer} createDataBuffer ()
-
-@end deftypemethod
-@deftypemethod ComponentSampleModel {public int} getOffset (int@w{ }@var{x}, int@w{ }@var{y})
-
-@end deftypemethod
-@deftypemethod ComponentSampleModel {public int} getOffset (int@w{ }@var{x}, int@w{ }@var{y}, int@w{ }@var{b})
-
-@end deftypemethod
-@deftypemethod ComponentSampleModel {public final int} getSampleSize ()
-
-@end deftypemethod
-@deftypemethod ComponentSampleModel {public final int} getSampleSize (int@w{ }@var{band})
-
-@end deftypemethod
-@deftypemethod ComponentSampleModel {public final int} getBankIndices ()
-
-@end deftypemethod
-@deftypemethod ComponentSampleModel {public final int} getBandOffsets ()
-
-@end deftypemethod
-@deftypemethod ComponentSampleModel {public final int} getScanlineStride ()
-
-@end deftypemethod
-@deftypemethod ComponentSampleModel {public final int} getPixelStride ()
-
-@end deftypemethod
-@deftypemethod ComponentSampleModel {public final int} getNumDataElements ()
-
-@end deftypemethod
-@deftypemethod ComponentSampleModel {public Object} getDataElements (int@w{ }@var{x}, int@w{ }@var{y}, java.lang.Object@w{ }@var{obj}, java.awt.image.DataBuffer@w{ }@var{data})
-
-@end deftypemethod
-@deftypemethod ComponentSampleModel {public Object} getDataElements (int@w{ }@var{x}, int@w{ }@var{y}, int@w{ }@var{w}, int@w{ }@var{h}, java.lang.Object@w{ }@var{obj}, java.awt.image.DataBuffer@w{ }@var{data})
-
-@end deftypemethod
-@deftypemethod ComponentSampleModel {public void} setDataElements (int@w{ }@var{x}, int@w{ }@var{y}, int@w{ }@var{w}, int@w{ }@var{h}, java.lang.Object@w{ }@var{obj}, java.awt.image.DataBuffer@w{ }@var{data})
-
-@end deftypemethod
-@deftypemethod ComponentSampleModel {public int} getPixel (int@w{ }@var{x}, int@w{ }@var{y}, int[]@w{ }@var{iArray}, java.awt.image.DataBuffer@w{ }@var{data})
-
-@end deftypemethod
-@deftypemethod ComponentSampleModel {public int} getPixels (int@w{ }@var{x}, int@w{ }@var{y}, int@w{ }@var{w}, int@w{ }@var{h}, int[]@w{ }@var{iArray}, java.awt.image.DataBuffer@w{ }@var{data})
-
-@end deftypemethod
-@deftypemethod ComponentSampleModel {public int} getSample (int@w{ }@var{x}, int@w{ }@var{y}, int@w{ }@var{b}, java.awt.image.DataBuffer@w{ }@var{data})
-
-@end deftypemethod
-@deftypemethod ComponentSampleModel {public void} setDataElements (int@w{ }@var{x}, int@w{ }@var{y}, java.lang.Object@w{ }@var{obj}, java.awt.image.DataBuffer@w{ }@var{data})
-
-@end deftypemethod
-@deftypemethod ComponentSampleModel {public void} setPixel (int@w{ }@var{x}, int@w{ }@var{y}, int[]@w{ }@var{iArray}, java.awt.image.DataBuffer@w{ }@var{data})
-
-@end deftypemethod
-@deftypemethod ComponentSampleModel {public void} setSample (int@w{ }@var{x}, int@w{ }@var{y}, int@w{ }@var{b}, int@w{ }@var{s}, java.awt.image.DataBuffer@w{ }@var{data})
-
-@end deftypemethod
-@deftypemethod DataBufferByte {public byte} getData ()
-
-@end deftypemethod
-@deftypemethod DataBufferByte {public byte} getData (int@w{ }@var{bank})
-
-@end deftypemethod
-@deftypemethod DataBufferByte {public byte} getBankData ()
-
-@end deftypemethod
-@deftypemethod DataBufferByte {public int} getElem (int@w{ }@var{i})
-
-@end deftypemethod
-@deftypemethod DataBufferByte {public int} getElem (int@w{ }@var{bank}, int@w{ }@var{i})
-
-@end deftypemethod
-@deftypemethod DataBufferByte {public void} setElem (int@w{ }@var{i}, int@w{ }@var{val})
-
-@end deftypemethod
-@deftypemethod DataBufferByte {public void} setElem (int@w{ }@var{bank}, int@w{ }@var{i}, int@w{ }@var{val})
-
-@end deftypemethod
-@deftypemethod DataBufferInt {public int} getData ()
-
-@end deftypemethod
-@deftypemethod DataBufferInt {public int} getData (int@w{ }@var{bank})
-
-@end deftypemethod
-@deftypemethod DataBufferInt {public int} getBankData ()
-
-@end deftypemethod
-@deftypemethod DataBufferInt {public int} getElem (int@w{ }@var{i})
-
-@end deftypemethod
-@deftypemethod DataBufferInt {public int} getElem (int@w{ }@var{bank}, int@w{ }@var{i})
-
-@end deftypemethod
-@deftypemethod DataBufferInt {public void} setElem (int@w{ }@var{i}, int@w{ }@var{val})
-
-@end deftypemethod
-@deftypemethod DataBufferInt {public void} setElem (int@w{ }@var{bank}, int@w{ }@var{i}, int@w{ }@var{val})
-
-@end deftypemethod
-@deftypemethod DataBuffer {public static int} getDataTypeSize (int@w{ }@var{dataType})
-
-@end deftypemethod
-@deftypemethod DataBuffer {public int} getDataType ()
-
-@end deftypemethod
-@deftypemethod DataBuffer {public int} getSize ()
-
-@end deftypemethod
-@deftypemethod DataBuffer {public int} getOffset ()
-
-@end deftypemethod
-@deftypemethod DataBuffer {public int} getOffsets ()
-
-@end deftypemethod
-@deftypemethod DataBuffer {public int} getNumBanks ()
-
-@end deftypemethod
-@deftypemethod DataBuffer {public int} getElem (int@w{ }@var{i})
-
-@end deftypemethod
-@deftypemethod DataBuffer {public abstract int} getElem (int@w{ }@var{bank}, int@w{ }@var{i})
-
-@end deftypemethod
-@deftypemethod DataBuffer {public void} setElem (int@w{ }@var{i}, int@w{ }@var{val})
-
-@end deftypemethod
-@deftypemethod DataBuffer {public abstract void} setElem (int@w{ }@var{bank}, int@w{ }@var{i}, int@w{ }@var{val})
-
-@end deftypemethod
-@deftypemethod DataBuffer {public float} getElemFloat (int@w{ }@var{i})
-
-@end deftypemethod
-@deftypemethod DataBuffer {public float} getElemFloat (int@w{ }@var{bank}, int@w{ }@var{i})
-
-@end deftypemethod
-@deftypemethod DataBuffer {public void} setElemFloat (int@w{ }@var{i}, float@w{ }@var{val})
-
-@end deftypemethod
-@deftypemethod DataBuffer {public void} setElemFloat (int@w{ }@var{bank}, int@w{ }@var{i}, float@w{ }@var{val})
-
-@end deftypemethod
-@deftypemethod DataBuffer {public double} getElemDouble (int@w{ }@var{i})
-
-@end deftypemethod
-@deftypemethod DataBuffer {public double} getElemDouble (int@w{ }@var{bank}, int@w{ }@var{i})
-
-@end deftypemethod
-@deftypemethod DataBuffer {public void} setElemDouble (int@w{ }@var{i}, double@w{ }@var{val})
-
-@end deftypemethod
-@deftypemethod DataBuffer {public void} setElemDouble (int@w{ }@var{bank}, int@w{ }@var{i}, double@w{ }@var{val})
-
-@end deftypemethod
-@deftypemethod DataBufferUShort {public short} getData ()
-
-@end deftypemethod
-@deftypemethod DataBufferUShort {public short} getData (int@w{ }@var{bank})
-
-@end deftypemethod
-@deftypemethod DataBufferUShort {public short} getBankData ()
-
-@end deftypemethod
-@deftypemethod DataBufferUShort {public int} getElem (int@w{ }@var{i})
-
-@end deftypemethod
-@deftypemethod DataBufferUShort {public int} getElem (int@w{ }@var{bank}, int@w{ }@var{i})
-
-@end deftypemethod
-@deftypemethod DataBufferUShort {public void} setElem (int@w{ }@var{i}, int@w{ }@var{val})
-
-@end deftypemethod
-@deftypemethod DataBufferUShort {public void} setElem (int@w{ }@var{bank}, int@w{ }@var{i}, int@w{ }@var{val})
-
-@end deftypemethod
-@deftypemethod DirectColorModel {public final int} getRedMask ()
-
-@end deftypemethod
-@deftypemethod DirectColorModel {public final int} getGreenMask ()
-
-@end deftypemethod
-@deftypemethod DirectColorModel {public final int} getBlueMask ()
-
-@end deftypemethod
-@deftypemethod DirectColorModel {public final int} getAlphaMask ()
-
-@end deftypemethod
-@deftypemethod DirectColorModel {public final int} getRed (int@w{ }@var{pixel})
-
-@end deftypemethod
-@deftypemethod DirectColorModel {public final int} getGreen (int@w{ }@var{pixel})
-
-@end deftypemethod
-@deftypemethod DirectColorModel {public final int} getBlue (int@w{ }@var{pixel})
-
-@end deftypemethod
-@deftypemethod DirectColorModel {public final int} getAlpha (int@w{ }@var{pixel})
-
-@end deftypemethod
-@deftypemethod DirectColorModel {public final int} getRGB (int@w{ }@var{pixel})
-
-@end deftypemethod
-@deftypemethod DirectColorModel {public int} getRed (java.lang.Object@w{ }@var{inData})
-
-@end deftypemethod
-@deftypemethod DirectColorModel {public int} getGreen (java.lang.Object@w{ }@var{inData})
-
-@end deftypemethod
-@deftypemethod DirectColorModel {public int} getBlue (java.lang.Object@w{ }@var{inData})
-
-@end deftypemethod
-@deftypemethod DirectColorModel {public int} getAlpha (java.lang.Object@w{ }@var{inData})
-
-@end deftypemethod
-@deftypemethod DirectColorModel {public int} getRGB (java.lang.Object@w{ }@var{inData})
-
-@end deftypemethod
-@deftypemethod DirectColorModel {public Object} getDataElements (int@w{ }@var{rgb}, java.lang.Object@w{ }@var{pixel})
-Converts a normalized pixel int value in the sRGB color
- space to an array containing a single pixel of the color space
- of the color model.
-
-
-
-This method performs the inverse function of
- @code{getRGB(Object inData)}.
-@end deftypemethod
-@deftypemethod DirectColorModel {public final int} getComponents (int@w{ }@var{pixel}, int[]@w{ }@var{components}, int@w{ }@var{offset})
-Fills an array with the unnormalized component samples from a
- pixel value. I.e. decompose the pixel, but not perform any
- color conversion.
-@end deftypemethod
-@deftypemethod DirectColorModel {public final int} getComponents (java.lang.Object@w{ }@var{pixel}, int[]@w{ }@var{components}, int@w{ }@var{offset})
-
-@end deftypemethod
-@deftypemethod DirectColorModel {public final WritableRaster} createCompatibleWritableRaster (int@w{ }@var{w}, int@w{ }@var{h})
-
-@end deftypemethod
-@deftypemethod DirectColorModel {public int} getDataElement (int[]@w{ }@var{components}, int@w{ }@var{offset})
-
-@end deftypemethod
-@deftypemethod DirectColorModel {public Object} getDataElements (int[]@w{ }@var{components}, int@w{ }@var{offset}, java.lang.Object@w{ }@var{obj})
-
-@end deftypemethod
-@deftypemethod DirectColorModel {public ColorModel} coerceData (java.awt.image.WritableRaster@w{ }@var{raster}, boolean@w{ }@var{isAlphaPremultiplied})
-
-@end deftypemethod
-@deftypemethod DirectColorModel {public boolean} isCompatibleRaster (java.awt.image.Raster@w{ }@var{raster})
-
-@end deftypemethod
-@deftypemethod DirectColorModel {public String} toString ()
-
-@end deftypemethod
-@deftypemethod ImageConsumer {public void} setDimensions (int@w{ }@var{width}, int@w{ }@var{height})
-
-@end deftypemethod
-@deftypemethod ImageConsumer {public void} setProperties (java.util.Hashtable@w{ }@var{props})
-
-@end deftypemethod
-@deftypemethod ImageConsumer {public void} setColorModel (java.awt.image.ColorModel@w{ }@var{model})
-
-@end deftypemethod
-@deftypemethod ImageConsumer {public void} setHints (int@w{ }@var{hintflags})
-
-@end deftypemethod
-@deftypemethod ImageConsumer {public void} setPixels (int@w{ }@var{x}, int@w{ }@var{y}, int@w{ }@var{w}, int@w{ }@var{h}, java.awt.image.ColorModel@w{ }@var{model}, byte[]@w{ }@var{pixels}, int@w{ }@var{off}, int@w{ }@var{scansize})
-
-@end deftypemethod
-@deftypemethod ImageConsumer {public void} setPixels (int@w{ }@var{x}, int@w{ }@var{y}, int@w{ }@var{w}, int@w{ }@var{h}, java.awt.image.ColorModel@w{ }@var{model}, int[]@w{ }@var{pixels}, int@w{ }@var{off}, int@w{ }@var{scansize})
-
-@end deftypemethod
-@deftypemethod ImageConsumer {public void} imageComplete (int@w{ }@var{status})
-
-@end deftypemethod
-@deftypemethod ImageObserver {public boolean} imageUpdate (java.awt.Image@w{ }@var{image}, int@w{ }@var{infoFlags}, int@w{ }@var{x}, int@w{ }@var{y}, int@w{ }@var{width}, int@w{ }@var{height})
-
-@end deftypemethod
-@deftypemethod ImageProducer {public void} addConsumer (java.awt.image.ImageConsumer@w{ }@var{ic})
-
-@end deftypemethod
-@deftypemethod ImageProducer {public boolean} isConsumer (java.awt.image.ImageConsumer@w{ }@var{ic})
-
-@end deftypemethod
-@deftypemethod ImageProducer {public void} removeConsumer (java.awt.image.ImageConsumer@w{ }@var{ic})
-
-@end deftypemethod
-@deftypemethod ImageProducer {public void} startProduction (java.awt.image.ImageConsumer@w{ }@var{ic})
-
-@end deftypemethod
-@deftypemethod ImageProducer {public void} requestTopDownLeftRightResend (java.awt.image.ImageConsumer@w{ }@var{ic})
-
-@end deftypemethod
-@deftypemethod IndexColorModel {public final int} getMapSize ()
-
-@end deftypemethod
-@deftypemethod IndexColorModel {public final int} getTransparentPixel ()
-
-@end deftypemethod
-@deftypemethod IndexColorModel {public final void} getReds (byte[]@w{ }@var{r})
-
-@end deftypemethod
-@deftypemethod IndexColorModel {public final void} getGreens (byte[]@w{ }@var{g})
-
-@end deftypemethod
-@deftypemethod IndexColorModel {public final void} getBlues (byte[]@w{ }@var{b})
-
-@end deftypemethod
-@deftypemethod IndexColorModel {public final void} getAlphas (byte[]@w{ }@var{a})
-
-@end deftypemethod
-@deftypemethod IndexColorModel {public final void} getRGBs (int[]@w{ }@var{rgb})
-
-@end deftypemethod
-@deftypemethod IndexColorModel {public int} getRed (int@w{ }@var{pixel})
-
-@end deftypemethod
-@deftypemethod IndexColorModel {public int} getGreen (int@w{ }@var{pixel})
-
-@end deftypemethod
-@deftypemethod IndexColorModel {public int} getBlue (int@w{ }@var{pixel})
-
-@end deftypemethod
-@deftypemethod IndexColorModel {public int} getAlpha (int@w{ }@var{pixel})
-
-@end deftypemethod
-@deftypemethod IndexColorModel {public int} getRed (java.lang.Object@w{ }@var{inData})
-
-@end deftypemethod
-@deftypemethod IndexColorModel {public int} getGreen (java.lang.Object@w{ }@var{inData})
-
-@end deftypemethod
-@deftypemethod IndexColorModel {public int} getBlue (java.lang.Object@w{ }@var{inData})
-
-@end deftypemethod
-@deftypemethod IndexColorModel {public int} getAlpha (java.lang.Object@w{ }@var{inData})
-
-@end deftypemethod
-@deftypemethod IndexColorModel {public int} getRGB (java.lang.Object@w{ }@var{inData})
-
-@end deftypemethod
-@deftypemethod IndexColorModel {public Object} getDataElements (int@w{ }@var{rgb}, java.lang.Object@w{ }@var{pixel})
-
-@end deftypemethod
-@deftypemethod IndexColorModel {public int} getComponents (int@w{ }@var{pixel}, int[]@w{ }@var{components}, int@w{ }@var{offset})
-
-@end deftypemethod
-@deftypemethod IndexColorModel {public final int} getComponents (java.lang.Object@w{ }@var{pixel}, int[]@w{ }@var{components}, int@w{ }@var{offset})
-
-@end deftypemethod
-@deftypemethod IndexColorModel {public int} getDataElement (int[]@w{ }@var{components}, int@w{ }@var{offset})
-
-@end deftypemethod
-@deftypemethod IndexColorModel {public Object} getDataElements (int[]@w{ }@var{components}, int@w{ }@var{offset}, java.lang.Object@w{ }@var{pixel})
-
-@end deftypemethod
-@deftypemethod IndexColorModel {public SampleModel} createCompatibleSampleModel (int@w{ }@var{w}, int@w{ }@var{h})
-
-@end deftypemethod
-@deftypemethod PackedColorModel {public final int} getMask (int@w{ }@var{index})
-
-@end deftypemethod
-@deftypemethod PackedColorModel {public final int} getMasks ()
-
-@end deftypemethod
-@deftypemethod PackedColorModel {public SampleModel} createCompatibleSampleModel (int@w{ }@var{w}, int@w{ }@var{h})
-
-@end deftypemethod
-@deftypemethod PackedColorModel {public boolean} isCompatibleSampleModel (java.awt.image.SampleModel@w{ }@var{sm})
-
-@end deftypemethod
-@deftypemethod PackedColorModel {public WritableRaster} getAlphaRaster (java.awt.image.WritableRaster@w{ }@var{raster})
-
-@end deftypemethod
-@deftypemethod PackedColorModel {public boolean} equals (java.lang.Object@w{ }@var{obj})
-
-@end deftypemethod
-@deftypemethod Raster {public static WritableRaster} createInterleavedRaster (int@w{ }@var{dataType}, int@w{ }@var{w}, int@w{ }@var{h}, int@w{ }@var{bands}, java.awt.Point@w{ }@var{location})
-
-@end deftypemethod
-@deftypemethod Raster {public static WritableRaster} createInterleavedRaster (int@w{ }@var{dataType}, int@w{ }@var{w}, int@w{ }@var{h}, int@w{ }@var{scanlineStride}, int@w{ }@var{pixelStride}, int[]@w{ }@var{bandOffsets}, java.awt.Point@w{ }@var{location})
-
-@end deftypemethod
-@deftypemethod Raster {public static WritableRaster} createBandedRaster (int@w{ }@var{dataType}, int@w{ }@var{w}, int@w{ }@var{h}, int@w{ }@var{bands}, java.awt.Point@w{ }@var{location})
-
-@end deftypemethod
-@deftypemethod Raster {public static WritableRaster} createBandedRaster (int@w{ }@var{dataType}, int@w{ }@var{w}, int@w{ }@var{h}, int@w{ }@var{scanlineStride}, int[]@w{ }@var{bankIndices}, int[]@w{ }@var{bandOffsets}, java.awt.Point@w{ }@var{location})
-
-@end deftypemethod
-@deftypemethod Raster {public static WritableRaster} createPackedRaster (int@w{ }@var{dataType}, int@w{ }@var{w}, int@w{ }@var{h}, int[]@w{ }@var{bandMasks}, java.awt.Point@w{ }@var{location})
-
-@end deftypemethod
-@deftypemethod Raster {public static WritableRaster} createInterleavedRaster (java.awt.image.DataBuffer@w{ }@var{dataBuffer}, int@w{ }@var{w}, int@w{ }@var{h}, int@w{ }@var{scanlineStride}, int@w{ }@var{pixelStride}, int[]@w{ }@var{bandOffsets}, java.awt.Point@w{ }@var{location})
-
-@end deftypemethod
-@deftypemethod Raster {public static WritableRaster} createBandedRaster (java.awt.image.DataBuffer@w{ }@var{dataBuffer}, int@w{ }@var{w}, int@w{ }@var{h}, int@w{ }@var{scanlineStride}, int[]@w{ }@var{bankIndices}, int[]@w{ }@var{bandOffsets}, java.awt.Point@w{ }@var{location})
-
-@end deftypemethod
-@deftypemethod Raster {public static WritableRaster} createPackedRaster (java.awt.image.DataBuffer@w{ }@var{dataBuffer}, int@w{ }@var{w}, int@w{ }@var{h}, int@w{ }@var{scanlineStride}, int[]@w{ }@var{bandMasks}, java.awt.Point@w{ }@var{location})
-
-@end deftypemethod
-@deftypemethod Raster {public static Raster} createRaster (java.awt.image.SampleModel@w{ }@var{sm}, java.awt.image.DataBuffer@w{ }@var{db}, java.awt.Point@w{ }@var{location})
-
-@end deftypemethod
-@deftypemethod Raster {public static WritableRaster} createWritableRaster (java.awt.image.SampleModel@w{ }@var{sm}, java.awt.Point@w{ }@var{location})
-
-@end deftypemethod
-@deftypemethod Raster {public static WritableRaster} createWritableRaster (java.awt.image.SampleModel@w{ }@var{sm}, java.awt.image.DataBuffer@w{ }@var{db}, java.awt.Point@w{ }@var{location})
-
-@end deftypemethod
-@deftypemethod Raster {public Raster} getParent ()
-
-@end deftypemethod
-@deftypemethod Raster {public final int} getSampleModelTranslateX ()
-
-@end deftypemethod
-@deftypemethod Raster {public final int} getSampleModelTranslateY ()
-
-@end deftypemethod
-@deftypemethod Raster {public WritableRaster} createCompatibleWritableRaster ()
-
-@end deftypemethod
-@deftypemethod Raster {public WritableRaster} createCompatibleWritableRaster (int@w{ }@var{w}, int@w{ }@var{h})
-
-@end deftypemethod
-@deftypemethod Raster {public WritableRaster} createCompatibleWritableRaster (java.awt.Rectangle@w{ }@var{rect})
-
-@end deftypemethod
-@deftypemethod Raster {public WritableRaster} createCompatibleWritableRaster (int@w{ }@var{x}, int@w{ }@var{y}, int@w{ }@var{w}, int@w{ }@var{h})
-
-@end deftypemethod
-@deftypemethod Raster {public Raster} createTranslatedChild (int@w{ }@var{childMinX}, int@w{ }@var{childMinY})
-
-@end deftypemethod
-@deftypemethod Raster {public Raster} createChild (int@w{ }@var{parentX}, int@w{ }@var{parentY}, int@w{ }@var{width}, int@w{ }@var{height}, int@w{ }@var{childMinX}, int@w{ }@var{childMinY}, int[]@w{ }@var{bandList})
-
-@end deftypemethod
-@deftypemethod Raster {public Rectangle} getBounds ()
-
-@end deftypemethod
-@deftypemethod Raster {public final int} getMinX ()
-
-@end deftypemethod
-@deftypemethod Raster {public final int} getMinY ()
-
-@end deftypemethod
-@deftypemethod Raster {public final int} getWidth ()
-
-@end deftypemethod
-@deftypemethod Raster {public final int} getHeight ()
-
-@end deftypemethod
-@deftypemethod Raster {public final int} getNumDataElements ()
-
-@end deftypemethod
-@deftypemethod Raster {public final int} getTransferType ()
-
-@end deftypemethod
-@deftypemethod Raster {public DataBuffer} getDataBuffer ()
-
-@end deftypemethod
-@deftypemethod Raster {public SampleModel} getSampleModel ()
-
-@end deftypemethod
-@deftypemethod Raster {public Object} getDataElements (int@w{ }@var{x}, int@w{ }@var{y}, java.lang.Object@w{ }@var{outData})
-
-@end deftypemethod
-@deftypemethod Raster {public Object} getDataElements (int@w{ }@var{x}, int@w{ }@var{y}, int@w{ }@var{w}, int@w{ }@var{h}, java.lang.Object@w{ }@var{outData})
-
-@end deftypemethod
-@deftypemethod Raster {public int} getPixel (int@w{ }@var{x}, int@w{ }@var{y}, int[]@w{ }@var{iArray})
-
-@end deftypemethod
-@deftypemethod Raster {public float} getPixel (int@w{ }@var{x}, int@w{ }@var{y}, float[]@w{ }@var{fArray})
-
-@end deftypemethod
-@deftypemethod Raster {public double} getPixel (int@w{ }@var{x}, int@w{ }@var{y}, double[]@w{ }@var{dArray})
-
-@end deftypemethod
-@deftypemethod Raster {public int} getPixels (int@w{ }@var{x}, int@w{ }@var{y}, int@w{ }@var{w}, int@w{ }@var{h}, int[]@w{ }@var{iArray})
-
-@end deftypemethod
-@deftypemethod Raster {public float} getPixels (int@w{ }@var{x}, int@w{ }@var{y}, int@w{ }@var{w}, int@w{ }@var{h}, float[]@w{ }@var{fArray})
-
-@end deftypemethod
-@deftypemethod Raster {public double} getPixels (int@w{ }@var{x}, int@w{ }@var{y}, int@w{ }@var{w}, int@w{ }@var{h}, double[]@w{ }@var{dArray})
-
-@end deftypemethod
-@deftypemethod Raster {public int} getSample (int@w{ }@var{x}, int@w{ }@var{y}, int@w{ }@var{b})
-
-@end deftypemethod
-@deftypemethod Raster {public float} getSampleFloat (int@w{ }@var{x}, int@w{ }@var{y}, int@w{ }@var{b})
-
-@end deftypemethod
-@deftypemethod Raster {public double} getSampleDouble (int@w{ }@var{x}, int@w{ }@var{y}, int@w{ }@var{b})
-
-@end deftypemethod
-@deftypemethod Raster {public int} getSamples (int@w{ }@var{x}, int@w{ }@var{y}, int@w{ }@var{w}, int@w{ }@var{h}, int@w{ }@var{b}, int[]@w{ }@var{iArray})
-
-@end deftypemethod
-@deftypemethod Raster {public float} getSamples (int@w{ }@var{x}, int@w{ }@var{y}, int@w{ }@var{w}, int@w{ }@var{h}, int@w{ }@var{b}, float[]@w{ }@var{fArray})
-
-@end deftypemethod
-@deftypemethod Raster {public double} getSamples (int@w{ }@var{x}, int@w{ }@var{y}, int@w{ }@var{w}, int@w{ }@var{h}, int@w{ }@var{b}, double[]@w{ }@var{dArray})
-
-@end deftypemethod
-@deftypemethod RasterOp {public WritableRaster} filter (java.awt.image.Raster@w{ }@var{src}, java.awt.image.WritableRaster@w{ }@var{dest})
-
-@end deftypemethod
-@deftypemethod RasterOp {public Rectangle2D} getBounds2D (java.awt.image.Raster@w{ }@var{src})
-
-@end deftypemethod
-@deftypemethod RasterOp {public WritableRaster} createCompatibleDestRaster (java.awt.image.Raster@w{ }@var{src})
-
-@end deftypemethod
-@deftypemethod RasterOp {public Point2D} getPoint2D (java.awt.geom.Point2D@w{ }@var{srcPoint}, java.awt.geom.Point2D@w{ }@var{destPoint})
-
-@end deftypemethod
-@deftypemethod RasterOp {public RenderingHints} getRenderingHints ()
-
-@end deftypemethod
-@deftypemethod SampleModel {public final int} getWidth ()
-
-@end deftypemethod
-@deftypemethod SampleModel {public final int} getHeight ()
-
-@end deftypemethod
-@deftypemethod SampleModel {public final int} getNumBands ()
-
-@end deftypemethod
-@deftypemethod SampleModel {public abstract int} getNumDataElements ()
-
-@end deftypemethod
-@deftypemethod SampleModel {public final int} getDataType ()
-
-@end deftypemethod
-@deftypemethod SampleModel {public int} getTransferType ()
-
-@end deftypemethod
-@deftypemethod SampleModel {public int} getPixel (int@w{ }@var{x}, int@w{ }@var{y}, int[]@w{ }@var{iArray}, java.awt.image.DataBuffer@w{ }@var{data})
-
-@end deftypemethod
-@deftypemethod SampleModel {public abstract Object} getDataElements (int@w{ }@var{x}, int@w{ }@var{y}, java.lang.Object@w{ }@var{obj}, java.awt.image.DataBuffer@w{ }@var{data})
-This method is provided as a faster alternative to getPixel(),
- that can be used when there is no need to decode the pixel into
- seperate sample values.
-@end deftypemethod
-@deftypemethod SampleModel {public Object} getDataElements (int@w{ }@var{x}, int@w{ }@var{y}, int@w{ }@var{w}, int@w{ }@var{h}, java.lang.Object@w{ }@var{obj}, java.awt.image.DataBuffer@w{ }@var{data})
-
-@end deftypemethod
-@deftypemethod SampleModel {public abstract void} setDataElements (int@w{ }@var{x}, int@w{ }@var{y}, java.lang.Object@w{ }@var{obj}, java.awt.image.DataBuffer@w{ }@var{data})
-
-@end deftypemethod
-@deftypemethod SampleModel {public void} setDataElements (int@w{ }@var{x}, int@w{ }@var{y}, int@w{ }@var{w}, int@w{ }@var{h}, java.lang.Object@w{ }@var{obj}, java.awt.image.DataBuffer@w{ }@var{data})
-
-@end deftypemethod
-@deftypemethod SampleModel {public float} getPixel (int@w{ }@var{x}, int@w{ }@var{y}, float[]@w{ }@var{fArray}, java.awt.image.DataBuffer@w{ }@var{data})
-
-@end deftypemethod
-@deftypemethod SampleModel {public double} getPixel (int@w{ }@var{x}, int@w{ }@var{y}, double[]@w{ }@var{dArray}, java.awt.image.DataBuffer@w{ }@var{data})
-
-@end deftypemethod
-@deftypemethod SampleModel {public int} getPixels (int@w{ }@var{x}, int@w{ }@var{y}, int@w{ }@var{w}, int@w{ }@var{h}, int[]@w{ }@var{iArray}, java.awt.image.DataBuffer@w{ }@var{data})
-
-@end deftypemethod
-@deftypemethod SampleModel {public float} getPixels (int@w{ }@var{x}, int@w{ }@var{y}, int@w{ }@var{w}, int@w{ }@var{h}, float[]@w{ }@var{fArray}, java.awt.image.DataBuffer@w{ }@var{data})
-
-@end deftypemethod
-@deftypemethod SampleModel {public double} getPixels (int@w{ }@var{x}, int@w{ }@var{y}, int@w{ }@var{w}, int@w{ }@var{h}, double[]@w{ }@var{dArray}, java.awt.image.DataBuffer@w{ }@var{data})
-
-@end deftypemethod
-@deftypemethod SampleModel {public abstract int} getSample (int@w{ }@var{x}, int@w{ }@var{y}, int@w{ }@var{b}, java.awt.image.DataBuffer@w{ }@var{data})
-
-@end deftypemethod
-@deftypemethod SampleModel {public float} getSampleFloat (int@w{ }@var{x}, int@w{ }@var{y}, int@w{ }@var{b}, java.awt.image.DataBuffer@w{ }@var{data})
-
-@end deftypemethod
-@deftypemethod SampleModel {public double} getSampleDouble (int@w{ }@var{x}, int@w{ }@var{y}, int@w{ }@var{b}, java.awt.image.DataBuffer@w{ }@var{data})
-
-@end deftypemethod
-@deftypemethod SampleModel {public int} getSamples (int@w{ }@var{x}, int@w{ }@var{y}, int@w{ }@var{w}, int@w{ }@var{h}, int@w{ }@var{b}, int[]@w{ }@var{iArray}, java.awt.image.DataBuffer@w{ }@var{data})
-
-@end deftypemethod
-@deftypemethod SampleModel {public float} getSamples (int@w{ }@var{x}, int@w{ }@var{y}, int@w{ }@var{w}, int@w{ }@var{h}, int@w{ }@var{b}, float[]@w{ }@var{fArray}, java.awt.image.DataBuffer@w{ }@var{data})
-
-@end deftypemethod
-@deftypemethod SampleModel {public double} getSamples (int@w{ }@var{x}, int@w{ }@var{y}, int@w{ }@var{w}, int@w{ }@var{h}, int@w{ }@var{b}, double[]@w{ }@var{dArray}, java.awt.image.DataBuffer@w{ }@var{data})
-
-@end deftypemethod
-@deftypemethod SampleModel {public void} setPixel (int@w{ }@var{x}, int@w{ }@var{y}, int[]@w{ }@var{iArray}, java.awt.image.DataBuffer@w{ }@var{data})
-
-@end deftypemethod
-@deftypemethod SampleModel {public void} setPixel (int@w{ }@var{x}, int@w{ }@var{y}, float[]@w{ }@var{fArray}, java.awt.image.DataBuffer@w{ }@var{data})
-
-@end deftypemethod
-@deftypemethod SampleModel {public void} setPixel (int@w{ }@var{x}, int@w{ }@var{y}, double[]@w{ }@var{dArray}, java.awt.image.DataBuffer@w{ }@var{data})
-
-@end deftypemethod
-@deftypemethod SampleModel {public void} setPixels (int@w{ }@var{x}, int@w{ }@var{y}, int@w{ }@var{w}, int@w{ }@var{h}, int[]@w{ }@var{iArray}, java.awt.image.DataBuffer@w{ }@var{data})
-
-@end deftypemethod
-@deftypemethod SampleModel {public void} setPixels (int@w{ }@var{x}, int@w{ }@var{y}, int@w{ }@var{w}, int@w{ }@var{h}, float[]@w{ }@var{fArray}, java.awt.image.DataBuffer@w{ }@var{data})
-
-@end deftypemethod
-@deftypemethod SampleModel {public void} setPixels (int@w{ }@var{x}, int@w{ }@var{y}, int@w{ }@var{w}, int@w{ }@var{h}, double[]@w{ }@var{dArray}, java.awt.image.DataBuffer@w{ }@var{data})
-
-@end deftypemethod
-@deftypemethod SampleModel {public abstract void} setSample (int@w{ }@var{x}, int@w{ }@var{y}, int@w{ }@var{b}, int@w{ }@var{s}, java.awt.image.DataBuffer@w{ }@var{data})
-
-@end deftypemethod
-@deftypemethod SampleModel {public void} setSample (int@w{ }@var{x}, int@w{ }@var{y}, int@w{ }@var{b}, float@w{ }@var{s}, java.awt.image.DataBuffer@w{ }@var{data})
-
-@end deftypemethod
-@deftypemethod SampleModel {public void} setSample (int@w{ }@var{x}, int@w{ }@var{y}, int@w{ }@var{b}, double@w{ }@var{s}, java.awt.image.DataBuffer@w{ }@var{data})
-
-@end deftypemethod
-@deftypemethod SampleModel {public void} setSamples (int@w{ }@var{x}, int@w{ }@var{y}, int@w{ }@var{w}, int@w{ }@var{h}, int@w{ }@var{b}, int[]@w{ }@var{iArray}, java.awt.image.DataBuffer@w{ }@var{data})
-
-@end deftypemethod
-@deftypemethod SampleModel {public void} setSamples (int@w{ }@var{x}, int@w{ }@var{y}, int@w{ }@var{w}, int@w{ }@var{h}, int@w{ }@var{b}, float[]@w{ }@var{fArray}, java.awt.image.DataBuffer@w{ }@var{data})
-
-@end deftypemethod
-@deftypemethod SampleModel {public void} setSamples (int@w{ }@var{x}, int@w{ }@var{y}, int@w{ }@var{w}, int@w{ }@var{h}, int@w{ }@var{b}, double[]@w{ }@var{dArray}, java.awt.image.DataBuffer@w{ }@var{data})
-
-@end deftypemethod
-@deftypemethod SampleModel {public abstract SampleModel} createCompatibleSampleModel (int@w{ }@var{w}, int@w{ }@var{h})
-
-@end deftypemethod
-@deftypemethod SampleModel {public abstract SampleModel} createSubsetSampleModel (int[]@w{ }@var{bands})
-
-@end deftypemethod
-@deftypemethod SampleModel {public abstract DataBuffer} createDataBuffer ()
-
-@end deftypemethod
-@deftypemethod SampleModel {public abstract int} getSampleSize ()
-
-@end deftypemethod
-@deftypemethod SampleModel {public abstract int} getSampleSize (int@w{ }@var{band})
-
-@end deftypemethod
-@deftypemethod SinglePixelPackedSampleModel {public int} getNumDataElements ()
-
-@end deftypemethod
-@deftypemethod SinglePixelPackedSampleModel {public SampleModel} createCompatibleSampleModel (int@w{ }@var{w}, int@w{ }@var{h})
-
-@end deftypemethod
-@deftypemethod SinglePixelPackedSampleModel {public DataBuffer} createDataBuffer ()
-
-@end deftypemethod
-@deftypemethod SinglePixelPackedSampleModel {public int} getSampleSize ()
-
-@end deftypemethod
-@deftypemethod SinglePixelPackedSampleModel {public int} getSampleSize (int@w{ }@var{band})
-
-@end deftypemethod
-@deftypemethod SinglePixelPackedSampleModel {public int} getOffset (int@w{ }@var{x}, int@w{ }@var{y})
-
-@end deftypemethod
-@deftypemethod SinglePixelPackedSampleModel {public int} getBitOffsets ()
-
-@end deftypemethod
-@deftypemethod SinglePixelPackedSampleModel {public int} getBitMasks ()
-
-@end deftypemethod
-@deftypemethod SinglePixelPackedSampleModel {public int} getScanlineStride ()
-
-@end deftypemethod
-@deftypemethod SinglePixelPackedSampleModel {public SampleModel} createSubsetSampleModel (int[]@w{ }@var{bands})
-
-@end deftypemethod
-@deftypemethod SinglePixelPackedSampleModel {public Object} getDataElements (int@w{ }@var{x}, int@w{ }@var{y}, java.lang.Object@w{ }@var{obj}, java.awt.image.DataBuffer@w{ }@var{data})
-
-@end deftypemethod
-@deftypemethod SinglePixelPackedSampleModel {public int} getPixel (int@w{ }@var{x}, int@w{ }@var{y}, int[]@w{ }@var{iArray}, java.awt.image.DataBuffer@w{ }@var{data})
-
-@end deftypemethod
-@deftypemethod SinglePixelPackedSampleModel {public int} getPixels (int@w{ }@var{x}, int@w{ }@var{y}, int@w{ }@var{w}, int@w{ }@var{h}, int[]@w{ }@var{iArray}, java.awt.image.DataBuffer@w{ }@var{data})
-
-@end deftypemethod
-@deftypemethod SinglePixelPackedSampleModel {public int} getSample (int@w{ }@var{x}, int@w{ }@var{y}, int@w{ }@var{b}, java.awt.image.DataBuffer@w{ }@var{data})
-
-@end deftypemethod
-@deftypemethod SinglePixelPackedSampleModel {public void} setDataElements (int@w{ }@var{x}, int@w{ }@var{y}, java.lang.Object@w{ }@var{obj}, java.awt.image.DataBuffer@w{ }@var{data})
-
-@end deftypemethod
-@deftypemethod SinglePixelPackedSampleModel {public void} setPixel (int@w{ }@var{x}, int@w{ }@var{y}, int[]@w{ }@var{iArray}, java.awt.image.DataBuffer@w{ }@var{data})
-
-@end deftypemethod
-@deftypemethod SinglePixelPackedSampleModel {public void} setSample (int@w{ }@var{x}, int@w{ }@var{y}, int@w{ }@var{b}, int@w{ }@var{s}, java.awt.image.DataBuffer@w{ }@var{data})
-
-@end deftypemethod
-@deftypemethod WritableRaster {public WritableRaster} getWritableParent ()
-
-@end deftypemethod
-@deftypemethod WritableRaster {public WritableRaster} createWritableTranslatedChild (int@w{ }@var{childMinX}, int@w{ }@var{childMinY})
-
-@end deftypemethod
-@deftypemethod WritableRaster {public WritableRaster} createWritableChild (int@w{ }@var{parentX}, int@w{ }@var{parentY}, int@w{ }@var{w}, int@w{ }@var{h}, int@w{ }@var{childMinX}, int@w{ }@var{childMinY}, int[]@w{ }@var{bandList})
-
-@end deftypemethod
-@deftypemethod WritableRaster {public void} setDataElements (int@w{ }@var{x}, int@w{ }@var{y}, java.lang.Object@w{ }@var{inData})
-
-@end deftypemethod
-@deftypemethod WritableRaster {public void} setDataElements (int@w{ }@var{x}, int@w{ }@var{y}, java.awt.image.Raster@w{ }@var{inRaster})
-
-@end deftypemethod
-@deftypemethod WritableRaster {public void} setDataElements (int@w{ }@var{x}, int@w{ }@var{y}, int@w{ }@var{w}, int@w{ }@var{h}, java.lang.Object@w{ }@var{inData})
-
-@end deftypemethod
-@deftypemethod WritableRaster {public void} setRect (java.awt.image.Raster@w{ }@var{srcRaster})
-
-@end deftypemethod
-@deftypemethod WritableRaster {public void} setRect (java.awt.image.Raster@w{ }@var{srcRaster}, int@w{ }@var{dx}, int@w{ }@var{dy})
-
-@end deftypemethod
-@deftypemethod WritableRaster {public void} setPixel (int@w{ }@var{x}, int@w{ }@var{y}, int[]@w{ }@var{iArray})
-
-@end deftypemethod
-@deftypemethod WritableRaster {public void} setPixel (int@w{ }@var{x}, int@w{ }@var{y}, float[]@w{ }@var{fArray})
-
-@end deftypemethod
-@deftypemethod WritableRaster {public void} setPixel (int@w{ }@var{x}, int@w{ }@var{y}, double[]@w{ }@var{dArray})
-
-@end deftypemethod
-@deftypemethod WritableRaster {public void} setPixels (int@w{ }@var{x}, int@w{ }@var{y}, int@w{ }@var{w}, int@w{ }@var{h}, int[]@w{ }@var{iArray})
-
-@end deftypemethod
-@deftypemethod WritableRaster {public void} setPixels (int@w{ }@var{x}, int@w{ }@var{y}, int@w{ }@var{w}, int@w{ }@var{h}, float[]@w{ }@var{fArray})
-
-@end deftypemethod
-@deftypemethod WritableRaster {public void} setPixels (int@w{ }@var{x}, int@w{ }@var{y}, int@w{ }@var{w}, int@w{ }@var{h}, double[]@w{ }@var{dArray})
-
-@end deftypemethod
-@deftypemethod WritableRaster {public void} setSample (int@w{ }@var{x}, int@w{ }@var{y}, int@w{ }@var{b}, int@w{ }@var{s})
-
-@end deftypemethod
-@deftypemethod WritableRaster {public void} setSample (int@w{ }@var{x}, int@w{ }@var{y}, int@w{ }@var{b}, float@w{ }@var{s})
-
-@end deftypemethod
-@deftypemethod WritableRaster {public void} setSample (int@w{ }@var{x}, int@w{ }@var{y}, int@w{ }@var{b}, double@w{ }@var{s})
-
-@end deftypemethod
-@deftypemethod WritableRaster {public void} setSamples (int@w{ }@var{x}, int@w{ }@var{y}, int@w{ }@var{w}, int@w{ }@var{h}, int@w{ }@var{b}, int[]@w{ }@var{iArray})
-
-@end deftypemethod
-@deftypemethod WritableRaster {public void} setSamples (int@w{ }@var{x}, int@w{ }@var{y}, int@w{ }@var{w}, int@w{ }@var{h}, int@w{ }@var{b}, float[]@w{ }@var{fArray})
-
-@end deftypemethod
-@deftypemethod WritableRaster {public void} setSamples (int@w{ }@var{x}, int@w{ }@var{y}, int@w{ }@var{w}, int@w{ }@var{h}, int@w{ }@var{b}, double[]@w{ }@var{dArray})
-
-@end deftypemethod
diff --git a/libjava/doc/java-awt-peer.texi b/libjava/doc/java-awt-peer.texi
deleted file mode 100644
index c065026213f..00000000000
--- a/libjava/doc/java-awt-peer.texi
+++ /dev/null
@@ -1,265 +0,0 @@
-@deftypemethod ButtonPeer {public void} setLabel (java.lang.String@w{ }@var{label})
-
-@end deftypemethod
-@deftypemethod CheckboxMenuItemPeer {public void} setState (boolean@w{ }@var{state})
-
-@end deftypemethod
-@deftypemethod CheckboxPeer {public void} setCheckboxGroup (java.awt.CheckboxGroup@w{ }@var{group})
-
-@end deftypemethod
-@deftypemethod CheckboxPeer {public void} setLabel (java.lang.String@w{ }@var{label})
-
-@end deftypemethod
-@deftypemethod CheckboxPeer {public void} setState (boolean@w{ }@var{state})
-
-@end deftypemethod
-@deftypemethod ChoicePeer {public void} add (java.lang.String@w{ }@var{item}, int@w{ }@var{index})
-
-@end deftypemethod
-@deftypemethod ChoicePeer {public void} remove (int@w{ }@var{index})
-
-@end deftypemethod
-@deftypemethod ChoicePeer {public void} select (int@w{ }@var{index})
-
-@end deftypemethod
-@deftypemethod ComponentPeer {public int} checkImage (java.awt.Image@w{ }@var{img}, int@w{ }@var{width}, int@w{ }@var{height}, java.awt.image.ImageObserver@w{ }@var{o})
-
-@end deftypemethod
-@deftypemethod ComponentPeer {public Image} createImage (java.awt.image.ImageProducer@w{ }@var{prod})
-
-@end deftypemethod
-@deftypemethod ComponentPeer {public Image} createImage (int@w{ }@var{width}, int@w{ }@var{height})
-
-@end deftypemethod
-@deftypemethod ComponentPeer {public void} dispose ()
-
-@end deftypemethod
-@deftypemethod ComponentPeer {public GraphicsConfiguration} getGraphicsConfiguration ()
-Get the graphics configuration of the component. The color model
- of the component can be derived from the configuration.
-@end deftypemethod
-@deftypemethod ComponentPeer {public FontMetrics} getFontMetrics (java.awt.Font@w{ }@var{f})
-
-@end deftypemethod
-@deftypemethod ComponentPeer {public Graphics} getGraphics ()
-
-@end deftypemethod
-@deftypemethod ComponentPeer {public Point} getLocationOnScreen ()
-
-@end deftypemethod
-@deftypemethod ComponentPeer {public Dimension} getMinimumSize ()
-
-@end deftypemethod
-@deftypemethod ComponentPeer {public Dimension} getPreferredSize ()
-
-@end deftypemethod
-@deftypemethod ComponentPeer {public Toolkit} getToolkit ()
-
-@end deftypemethod
-@deftypemethod ComponentPeer {public void} handleEvent (java.awt.AWTEvent@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod ComponentPeer {public boolean} isFocusTraversable ()
-
-@end deftypemethod
-@deftypemethod ComponentPeer {public void} paint (java.awt.Graphics@w{ }@var{graphics})
-
-@end deftypemethod
-@deftypemethod ComponentPeer {public boolean} prepareImage (java.awt.Image@w{ }@var{img}, int@w{ }@var{width}, int@w{ }@var{height}, java.awt.image.ImageObserver@w{ }@var{o})
-
-@end deftypemethod
-@deftypemethod ComponentPeer {public void} print (java.awt.Graphics@w{ }@var{graphics})
-
-@end deftypemethod
-@deftypemethod ComponentPeer {public void} repaint (long@w{ }@var{tm}, int@w{ }@var{x}, int@w{ }@var{y}, int@w{ }@var{width}, int@w{ }@var{height})
-
-@end deftypemethod
-@deftypemethod ComponentPeer {public void} requestFocus ()
-
-@end deftypemethod
-@deftypemethod ComponentPeer {public void} setBackground (java.awt.Color@w{ }@var{color})
-
-@end deftypemethod
-@deftypemethod ComponentPeer {public void} setBounds (int@w{ }@var{x}, int@w{ }@var{y}, int@w{ }@var{width}, int@w{ }@var{height})
-
-@end deftypemethod
-@deftypemethod ComponentPeer {public void} setCursor (java.awt.Cursor@w{ }@var{cursor})
-
-@end deftypemethod
-@deftypemethod ComponentPeer {public void} setEnabled (boolean@w{ }@var{enabled})
-
-@end deftypemethod
-@deftypemethod ComponentPeer {public void} setEventMask (long@w{ }@var{eventMask})
-
-@end deftypemethod
-@deftypemethod ComponentPeer {public void} setFont (java.awt.Font@w{ }@var{font})
-
-@end deftypemethod
-@deftypemethod ComponentPeer {public void} setForeground (java.awt.Color@w{ }@var{color})
-
-@end deftypemethod
-@deftypemethod ComponentPeer {public void} setVisible (boolean@w{ }@var{visible})
-
-@end deftypemethod
-@deftypemethod ContainerPeer {public Insets} getInsets ()
-
-@end deftypemethod
-@deftypemethod ContainerPeer {public void} beginValidate ()
-
-@end deftypemethod
-@deftypemethod ContainerPeer {public void} endValidate ()
-
-@end deftypemethod
-@deftypemethod DialogPeer {public void} setResizable (boolean@w{ }@var{resizeable})
-
-@end deftypemethod
-@deftypemethod DialogPeer {public void} setTitle (java.lang.String@w{ }@var{title})
-
-@end deftypemethod
-@deftypemethod FileDialogPeer {public void} setDirectory (java.lang.String@w{ }@var{dir})
-
-@end deftypemethod
-@deftypemethod FileDialogPeer {public void} setFile (java.lang.String@w{ }@var{file})
-
-@end deftypemethod
-@deftypemethod FileDialogPeer {public void} setFilenameFilter (java.io.FilenameFilter@w{ }@var{filter})
-
-@end deftypemethod
-@deftypemethod FramePeer {public void} setIconImage (java.awt.Image@w{ }@var{image})
-
-@end deftypemethod
-@deftypemethod FramePeer {public void} setMenuBar (java.awt.MenuBar@w{ }@var{mb})
-
-@end deftypemethod
-@deftypemethod FramePeer {public void} setResizable (boolean@w{ }@var{resizable})
-
-@end deftypemethod
-@deftypemethod FramePeer {public void} setTitle (java.lang.String@w{ }@var{title})
-
-@end deftypemethod
-@deftypemethod LabelPeer {public void} setAlignment (int@w{ }@var{alignment})
-
-@end deftypemethod
-@deftypemethod LabelPeer {public void} setText (java.lang.String@w{ }@var{text})
-
-@end deftypemethod
-@deftypemethod ListPeer {public void} add (java.lang.String@w{ }@var{item}, int@w{ }@var{index})
-
-@end deftypemethod
-@deftypemethod ListPeer {public void} delItems (int@w{ }@var{start_index}, int@w{ }@var{end_index})
-
-@end deftypemethod
-@deftypemethod ListPeer {public void} deselect (int@w{ }@var{index})
-
-@end deftypemethod
-@deftypemethod ListPeer {public int} getSelectedIndexes ()
-
-@end deftypemethod
-@deftypemethod ListPeer {public void} makeVisible (int@w{ }@var{index})
-
-@end deftypemethod
-@deftypemethod ListPeer {public void} removeAll ()
-
-@end deftypemethod
-@deftypemethod ListPeer {public void} select (int@w{ }@var{index})
-
-@end deftypemethod
-@deftypemethod ListPeer {public void} setMultipleMode (boolean@w{ }@var{multipleMode})
-
-@end deftypemethod
-@deftypemethod MenuBarPeer {public void} addHelpMenu (java.awt.Menu@w{ }@var{menu})
-
-@end deftypemethod
-@deftypemethod MenuBarPeer {public void} add (java.awt.Menu@w{ }@var{menu})
-
-@end deftypemethod
-@deftypemethod MenuBarPeer {public void} remove (int@w{ }@var{index})
-
-@end deftypemethod
-@deftypemethod MenuComponentPeer {public void} dispose ()
-
-@end deftypemethod
-@deftypemethod MenuItemPeer {public void} setEnabled (boolean@w{ }@var{enabled})
-
-@end deftypemethod
-@deftypemethod MenuItemPeer {public void} setLabel (java.lang.String@w{ }@var{text})
-
-@end deftypemethod
-@deftypemethod MenuPeer {public void} add (java.awt.MenuItem@w{ }@var{item})
-
-@end deftypemethod
-@deftypemethod MenuPeer {public void} addSeparator ()
-
-@end deftypemethod
-@deftypemethod MenuPeer {public void} remove (int@w{ }@var{index})
-
-@end deftypemethod
-@deftypemethod PopupMenuPeer {public void} show (java.awt.Event@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod ScrollbarPeer {public void} setLineIncrement (int@w{ }@var{increment})
-
-@end deftypemethod
-@deftypemethod ScrollbarPeer {public void} setPageIncrement (int@w{ }@var{increment})
-
-@end deftypemethod
-@deftypemethod ScrollbarPeer {public void} setValues (int@w{ }@var{value}, int@w{ }@var{visible}, int@w{ }@var{minimum}, int@w{ }@var{maximum})
-
-@end deftypemethod
-@deftypemethod ScrollPanePeer {public void} childResized (int@w{ }@var{width}, int@w{ }@var{height})
-
-@end deftypemethod
-@deftypemethod ScrollPanePeer {public int} getHScrollbarHeight ()
-
-@end deftypemethod
-@deftypemethod ScrollPanePeer {public int} getVScrollbarWidth ()
-
-@end deftypemethod
-@deftypemethod ScrollPanePeer {public void} setScrollPosition (int@w{ }@var{x}, int@w{ }@var{y})
-
-@end deftypemethod
-@deftypemethod ScrollPanePeer {public void} setUnitIncrement (java.awt.Adjustable@w{ }@var{adj}, int@w{ }@var{increment})
-
-@end deftypemethod
-@deftypemethod ScrollPanePeer {public void} setValue (java.awt.Adjustable@w{ }@var{adj}, int@w{ }@var{value})
-
-@end deftypemethod
-@deftypemethod TextAreaPeer {public void} insert (java.lang.String@w{ }@var{text}, int@w{ }@var{pos})
-
-@end deftypemethod
-@deftypemethod TextAreaPeer {public void} replaceRange (java.lang.String@w{ }@var{text}, int@w{ }@var{start}, int@w{ }@var{end})
-
-@end deftypemethod
-@deftypemethod TextComponentPeer {public int} getCaretPosition ()
-
-@end deftypemethod
-@deftypemethod TextComponentPeer {public int} getSelectionEnd ()
-
-@end deftypemethod
-@deftypemethod TextComponentPeer {public int} getSelectionStart ()
-
-@end deftypemethod
-@deftypemethod TextComponentPeer {public String} getText ()
-
-@end deftypemethod
-@deftypemethod TextComponentPeer {public void} select (int@w{ }@var{start}, int@w{ }@var{end})
-
-@end deftypemethod
-@deftypemethod TextComponentPeer {public void} setCaretPosition (int@w{ }@var{pos})
-
-@end deftypemethod
-@deftypemethod TextComponentPeer {public void} setEditable (boolean@w{ }@var{editable})
-
-@end deftypemethod
-@deftypemethod TextComponentPeer {public void} setText (java.lang.String@w{ }@var{text})
-
-@end deftypemethod
-@deftypemethod TextFieldPeer {public void} setEchoChar (char@w{ }@var{echo})
-
-@end deftypemethod
-@deftypemethod WindowPeer {public void} toBack ()
-
-@end deftypemethod
-@deftypemethod WindowPeer {public void} toFront ()
-
-@end deftypemethod
diff --git a/libjava/doc/java-awt.texi b/libjava/doc/java-awt.texi
deleted file mode 100644
index 071cd4144c5..00000000000
--- a/libjava/doc/java-awt.texi
+++ /dev/null
@@ -1,2757 +0,0 @@
-@deftypemethod ActiveEvent {public void} dispatch ()
-
-@end deftypemethod
-@deftypemethod Adjustable {public void} addAdjustmentListener (java.awt.event.AdjustmentListener@w{ }@var{l})
-
-@end deftypemethod
-@deftypemethod Adjustable {public int} getBlockIncrement ()
-
-@end deftypemethod
-@deftypemethod Adjustable {public int} getMaximum ()
-
-@end deftypemethod
-@deftypemethod Adjustable {public int} getMinimum ()
-
-@end deftypemethod
-@deftypemethod Adjustable {public int} getOrientation ()
-
-@end deftypemethod
-@deftypemethod Adjustable {public int} getUnitIncrement ()
-
-@end deftypemethod
-@deftypemethod Adjustable {public int} getValue ()
-
-@end deftypemethod
-@deftypemethod Adjustable {public int} getVisibleAmount ()
-
-@end deftypemethod
-@deftypemethod Adjustable {public void} removeAdjustmentListener (java.awt.event.AdjustmentListener@w{ }@var{l})
-
-@end deftypemethod
-@deftypemethod Adjustable {public void} setBlockIncrement (int@w{ }@var{b})
-
-@end deftypemethod
-@deftypemethod Adjustable {public void} setMaximum (int@w{ }@var{max})
-
-@end deftypemethod
-@deftypemethod Adjustable {public void} setMinimum (int@w{ }@var{min})
-
-@end deftypemethod
-@deftypemethod Adjustable {public void} setUnitIncrement (int@w{ }@var{u})
-
-@end deftypemethod
-@deftypemethod Adjustable {public void} setValue (int@w{ }@var{v})
-
-@end deftypemethod
-@deftypemethod Adjustable {public void} setVisibleAmount (int@w{ }@var{v})
-
-@end deftypemethod
-@deftypemethod AWTEvent {public int} getID ()
-
-@end deftypemethod
-@deftypemethod AWTEvent {public String} paramString ()
-
-@end deftypemethod
-@deftypemethod AWTEvent {public String} toString ()
-
-@end deftypemethod
-@deftypemethod AWTEvent {protected void} consume ()
-
-@end deftypemethod
-@deftypemethod AWTEvent {protected boolean} isConsumed ()
-
-@end deftypemethod
-@deftypemethod AWTEventMulticaster {protected static EventListener} addInternal (java.util.EventListener@w{ }@var{a}, java.util.EventListener@w{ }@var{b})
-
-@end deftypemethod
-@deftypemethod AWTEventMulticaster {protected static EventListener} removeInternal (java.util.EventListener@w{ }@var{l}, java.util.EventListener@w{ }@var{oldl})
-
-@end deftypemethod
-@deftypemethod AWTEventMulticaster {protected EventListener} remove (java.util.EventListener@w{ }@var{oldl})
-
-@end deftypemethod
-@deftypemethod AWTEventMulticaster {public static ActionListener} add (java.awt.event.ActionListener@w{ }@var{a}, java.awt.event.ActionListener@w{ }@var{b})
-
-@end deftypemethod
-@deftypemethod AWTEventMulticaster {public static AdjustmentListener} add (java.awt.event.AdjustmentListener@w{ }@var{a}, java.awt.event.AdjustmentListener@w{ }@var{b})
-
-@end deftypemethod
-@deftypemethod AWTEventMulticaster {public static ComponentListener} add (java.awt.event.ComponentListener@w{ }@var{a}, java.awt.event.ComponentListener@w{ }@var{b})
-
-@end deftypemethod
-@deftypemethod AWTEventMulticaster {public static ContainerListener} add (java.awt.event.ContainerListener@w{ }@var{a}, java.awt.event.ContainerListener@w{ }@var{b})
-
-@end deftypemethod
-@deftypemethod AWTEventMulticaster {public static FocusListener} add (java.awt.event.FocusListener@w{ }@var{a}, java.awt.event.FocusListener@w{ }@var{b})
-
-@end deftypemethod
-@deftypemethod AWTEventMulticaster {public static HierarchyBoundsListener} add (java.awt.event.HierarchyBoundsListener@w{ }@var{a}, java.awt.event.HierarchyBoundsListener@w{ }@var{b})
-
-@end deftypemethod
-@deftypemethod AWTEventMulticaster {public static HierarchyListener} add (java.awt.event.HierarchyListener@w{ }@var{a}, java.awt.event.HierarchyListener@w{ }@var{b})
-
-@end deftypemethod
-@deftypemethod AWTEventMulticaster {public static InputMethodListener} add (java.awt.event.InputMethodListener@w{ }@var{a}, java.awt.event.InputMethodListener@w{ }@var{b})
-
-@end deftypemethod
-@deftypemethod AWTEventMulticaster {public static ItemListener} add (java.awt.event.ItemListener@w{ }@var{a}, java.awt.event.ItemListener@w{ }@var{b})
-
-@end deftypemethod
-@deftypemethod AWTEventMulticaster {public static KeyListener} add (java.awt.event.KeyListener@w{ }@var{a}, java.awt.event.KeyListener@w{ }@var{b})
-
-@end deftypemethod
-@deftypemethod AWTEventMulticaster {public static MouseListener} add (java.awt.event.MouseListener@w{ }@var{a}, java.awt.event.MouseListener@w{ }@var{b})
-
-@end deftypemethod
-@deftypemethod AWTEventMulticaster {public static MouseMotionListener} add (java.awt.event.MouseMotionListener@w{ }@var{a}, java.awt.event.MouseMotionListener@w{ }@var{b})
-
-@end deftypemethod
-@deftypemethod AWTEventMulticaster {public static TextListener} add (java.awt.event.TextListener@w{ }@var{a}, java.awt.event.TextListener@w{ }@var{b})
-
-@end deftypemethod
-@deftypemethod AWTEventMulticaster {public static WindowListener} add (java.awt.event.WindowListener@w{ }@var{a}, java.awt.event.WindowListener@w{ }@var{b})
-
-@end deftypemethod
-@deftypemethod AWTEventMulticaster {public static ActionListener} remove (java.awt.event.ActionListener@w{ }@var{l}, java.awt.event.ActionListener@w{ }@var{oldl})
-
-@end deftypemethod
-@deftypemethod AWTEventMulticaster {public static AdjustmentListener} remove (java.awt.event.AdjustmentListener@w{ }@var{l}, java.awt.event.AdjustmentListener@w{ }@var{oldl})
-
-@end deftypemethod
-@deftypemethod AWTEventMulticaster {public static ComponentListener} remove (java.awt.event.ComponentListener@w{ }@var{l}, java.awt.event.ComponentListener@w{ }@var{oldl})
-
-@end deftypemethod
-@deftypemethod AWTEventMulticaster {public static ContainerListener} remove (java.awt.event.ContainerListener@w{ }@var{l}, java.awt.event.ContainerListener@w{ }@var{oldl})
-
-@end deftypemethod
-@deftypemethod AWTEventMulticaster {public static FocusListener} remove (java.awt.event.FocusListener@w{ }@var{l}, java.awt.event.FocusListener@w{ }@var{oldl})
-
-@end deftypemethod
-@deftypemethod AWTEventMulticaster {public static HierarchyBoundsListener} remove (java.awt.event.HierarchyBoundsListener@w{ }@var{l}, java.awt.event.HierarchyBoundsListener@w{ }@var{oldl})
-
-@end deftypemethod
-@deftypemethod AWTEventMulticaster {public static HierarchyListener} remove (java.awt.event.HierarchyListener@w{ }@var{l}, java.awt.event.HierarchyListener@w{ }@var{oldl})
-
-@end deftypemethod
-@deftypemethod AWTEventMulticaster {public static InputMethodListener} remove (java.awt.event.InputMethodListener@w{ }@var{l}, java.awt.event.InputMethodListener@w{ }@var{oldl})
-
-@end deftypemethod
-@deftypemethod AWTEventMulticaster {public static ItemListener} remove (java.awt.event.ItemListener@w{ }@var{l}, java.awt.event.ItemListener@w{ }@var{oldl})
-
-@end deftypemethod
-@deftypemethod AWTEventMulticaster {public static KeyListener} remove (java.awt.event.KeyListener@w{ }@var{l}, java.awt.event.KeyListener@w{ }@var{oldl})
-
-@end deftypemethod
-@deftypemethod AWTEventMulticaster {public static MouseListener} remove (java.awt.event.MouseListener@w{ }@var{l}, java.awt.event.MouseListener@w{ }@var{oldl})
-
-@end deftypemethod
-@deftypemethod AWTEventMulticaster {public static MouseMotionListener} remove (java.awt.event.MouseMotionListener@w{ }@var{l}, java.awt.event.MouseMotionListener@w{ }@var{oldl})
-
-@end deftypemethod
-@deftypemethod AWTEventMulticaster {public static TextListener} remove (java.awt.event.TextListener@w{ }@var{l}, java.awt.event.TextListener@w{ }@var{oldl})
-
-@end deftypemethod
-@deftypemethod AWTEventMulticaster {public static WindowListener} remove (java.awt.event.WindowListener@w{ }@var{l}, java.awt.event.WindowListener@w{ }@var{oldl})
-
-@end deftypemethod
-@deftypemethod AWTEventMulticaster {public void} actionPerformed (java.awt.event.ActionEvent@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod AWTEventMulticaster {public void} adjustmentValueChanged (java.awt.event.AdjustmentEvent@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod AWTEventMulticaster {public void} componentHidden (java.awt.event.ComponentEvent@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod AWTEventMulticaster {public void} componentMoved (java.awt.event.ComponentEvent@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod AWTEventMulticaster {public void} componentResized (java.awt.event.ComponentEvent@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod AWTEventMulticaster {public void} componentShown (java.awt.event.ComponentEvent@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod AWTEventMulticaster {public void} componentAdded (java.awt.event.ContainerEvent@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod AWTEventMulticaster {public void} componentRemoved (java.awt.event.ContainerEvent@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod AWTEventMulticaster {public void} focusGained (java.awt.event.FocusEvent@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod AWTEventMulticaster {public void} focusLost (java.awt.event.FocusEvent@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod AWTEventMulticaster {public void} ancestorMoved (java.awt.event.HierarchyEvent@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod AWTEventMulticaster {public void} ancestorResized (java.awt.event.HierarchyEvent@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod AWTEventMulticaster {public void} hierarchyChanged (java.awt.event.HierarchyEvent@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod AWTEventMulticaster {public void} caretPositionChanged (java.awt.event.InputMethodEvent@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod AWTEventMulticaster {public void} inputMethodTextChanged (java.awt.event.InputMethodEvent@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod AWTEventMulticaster {public void} itemStateChanged (java.awt.event.ItemEvent@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod AWTEventMulticaster {public void} keyPressed (java.awt.event.KeyEvent@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod AWTEventMulticaster {public void} keyReleased (java.awt.event.KeyEvent@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod AWTEventMulticaster {public void} keyTyped (java.awt.event.KeyEvent@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod AWTEventMulticaster {public void} mouseClicked (java.awt.event.MouseEvent@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod AWTEventMulticaster {public void} mouseEntered (java.awt.event.MouseEvent@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod AWTEventMulticaster {public void} mouseExited (java.awt.event.MouseEvent@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod AWTEventMulticaster {public void} mousePressed (java.awt.event.MouseEvent@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod AWTEventMulticaster {public void} mouseReleased (java.awt.event.MouseEvent@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod AWTEventMulticaster {public void} mouseDragged (java.awt.event.MouseEvent@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod AWTEventMulticaster {public void} mouseMoved (java.awt.event.MouseEvent@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod AWTEventMulticaster {public void} textValueChanged (java.awt.event.TextEvent@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod AWTEventMulticaster {public void} windowActivated (java.awt.event.WindowEvent@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod AWTEventMulticaster {public void} windowClosed (java.awt.event.WindowEvent@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod AWTEventMulticaster {public void} windowClosing (java.awt.event.WindowEvent@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod AWTEventMulticaster {public void} windowDeactivated (java.awt.event.WindowEvent@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod AWTEventMulticaster {public void} windowDeiconified (java.awt.event.WindowEvent@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod AWTEventMulticaster {public void} windowIconified (java.awt.event.WindowEvent@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod AWTEventMulticaster {public void} windowOpened (java.awt.event.WindowEvent@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod AWTEventMulticaster {protected static void} save (java.io.ObjectOutputStream@w{ }@var{s}, java.lang.String@w{ }@var{k}, java.util.EventListener@w{ }@var{l})
-
-@end deftypemethod
-@deftypemethod AWTEventMulticaster {protected void} saveInternal (java.io.ObjectOutputStream@w{ }@var{s}, java.lang.String@w{ }@var{k})
-
-@end deftypemethod
-@deftypemethod BorderLayout {public int} getHgap ()
-
-@end deftypemethod
-@deftypemethod BorderLayout {public void} setHgap (int@w{ }@var{hgap})
-
-@end deftypemethod
-@deftypemethod BorderLayout {public int} getVgap ()
-
-@end deftypemethod
-@deftypemethod BorderLayout {public void} setVgap (int@w{ }@var{vgap})
-
-@end deftypemethod
-@deftypemethod BorderLayout {public void} addLayoutComponent (java.awt.Component@w{ }@var{comp}, java.lang.Object@w{ }@var{constraints})
-
-@end deftypemethod
-@deftypemethod BorderLayout {public void} addLayoutComponent (java.lang.String@w{ }@var{name}, java.awt.Component@w{ }@var{comp})
-
-@end deftypemethod
-@deftypemethod BorderLayout {public void} removeLayoutComponent (java.awt.Component@w{ }@var{comp})
-
-@end deftypemethod
-@deftypemethod BorderLayout {public Dimension} minimumLayoutSize (java.awt.Container@w{ }@var{target})
-
-@end deftypemethod
-@deftypemethod BorderLayout {public Dimension} preferredLayoutSize (java.awt.Container@w{ }@var{target})
-
-@end deftypemethod
-@deftypemethod BorderLayout {public Dimension} maximumLayoutSize (java.awt.Container@w{ }@var{target})
-Completely disregards the requested maximum sizes of the
- components, and states that the container has no upper size
- limit.
-@end deftypemethod
-@deftypemethod BorderLayout {public float} getLayoutAlignmentX (java.awt.Container@w{ }@var{parent})
-
-@end deftypemethod
-@deftypemethod BorderLayout {public float} getLayoutAlignmentY (java.awt.Container@w{ }@var{parent})
-
-@end deftypemethod
-@deftypemethod BorderLayout {public void} invalidateLayout (java.awt.Container@w{ }@var{target})
-
-@end deftypemethod
-@deftypemethod BorderLayout {public void} layoutContainer (java.awt.Container@w{ }@var{target})
-
-@end deftypemethod
-@deftypemethod BorderLayout {public String} toString ()
-
-@end deftypemethod
-@deftypemethod Button {public void} addActionListener (java.awt.event.ActionListener@w{ }@var{l})
-
-@end deftypemethod
-@deftypemethod Button {public void} addNotify ()
-
-@end deftypemethod
-@deftypemethod Button {public String} getActionCommand ()
-
-@end deftypemethod
-@deftypemethod Button {public String} getLabel ()
-
-@end deftypemethod
-@deftypemethod Button {protected String} paramString ()
-
-@end deftypemethod
-@deftypemethod Button {protected void} processActionEvent (java.awt.event.ActionEvent@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod Button {protected void} processEvent (java.awt.AWTEvent@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod Button {public void} removeActionListener (java.awt.event.ActionListener@w{ }@var{l})
-
-@end deftypemethod
-@deftypemethod Button {public EventListener} getListeners (java.lang.Class@w{ }@var{listenerType})
-
-@end deftypemethod
-@deftypemethod Button {public void} setActionCommand (java.lang.String@w{ }@var{command})
-
-@end deftypemethod
-@deftypemethod Button {public void} setLabel (java.lang.String@w{ }@var{label})
-
-@end deftypemethod
-@deftypemethod Canvas {public void} addNotify ()
-
-@end deftypemethod
-@deftypemethod Canvas {public void} paint (java.awt.Graphics@w{ }@var{gfx})
-Override this to create components with custom painting.
-Defaults to filling the component with the background color.
-@end deftypemethod
-@deftypemethod CardLayout {public void} addLayoutComponent (java.awt.Component@w{ }@var{comp}, java.lang.Object@w{ }@var{constraints})
-Add a new component to the layout. The constraint must be a
- string which is used to name the component. This string can
- later be used to refer to the particular component.
-@end deftypemethod
-@deftypemethod CardLayout {public void} addLayoutComponent (java.lang.String@w{ }@var{name}, java.awt.Component@w{ }@var{comp})
-Add a new component to the layout. The name can be used later
- to refer to the component.
-@end deftypemethod
-@deftypemethod CardLayout {public void} first (java.awt.Container@w{ }@var{parent})
-Cause the first component in the container to be displayed.
-@end deftypemethod
-@deftypemethod CardLayout {public int} getHgap ()
-Return this layout manager's horizontal gap.
-@end deftypemethod
-@deftypemethod CardLayout {public float} getLayoutAlignmentX (java.awt.Container@w{ }@var{parent})
-Return this layout manager's x alignment. This method always
- returns Component.CENTER_ALIGNMENT.
-@end deftypemethod
-@deftypemethod CardLayout {public float} getLayoutAlignmentY (java.awt.Container@w{ }@var{parent})
-Returns this layout manager's y alignment. This method always
- returns Component.CENTER_ALIGNMENT.
-@end deftypemethod
-@deftypemethod CardLayout {public int} getVgap ()
-Return this layout manager's vertical gap.
-@end deftypemethod
-@deftypemethod CardLayout {public void} invalidateLayout (java.awt.Container@w{ }@var{target})
-Invalidate this layout manager's state.
-@end deftypemethod
-@deftypemethod CardLayout {public void} last (java.awt.Container@w{ }@var{parent})
-Cause the last component in the container to be displayed.
-@end deftypemethod
-@deftypemethod CardLayout {public void} layoutContainer (java.awt.Container@w{ }@var{parent})
-Lay out the container's components based on the current
- settings.
-@end deftypemethod
-@deftypemethod CardLayout {public Dimension} maximumLayoutSize (java.awt.Container@w{ }@var{target})
-Get the maximum layout size of the container.
-@end deftypemethod
-@deftypemethod CardLayout {public Dimension} minimumLayoutSize (java.awt.Container@w{ }@var{target})
-Get the minimum layout size of the container.
-@end deftypemethod
-@deftypemethod CardLayout {public void} next (java.awt.Container@w{ }@var{parent})
-Cause the next component in the container to be displayed.
-@end deftypemethod
-@deftypemethod CardLayout {public Dimension} preferredLayoutSize (java.awt.Container@w{ }@var{parent})
-Get the preferred layout size of the container.
-@end deftypemethod
-@deftypemethod CardLayout {public void} previous (java.awt.Container@w{ }@var{parent})
-Cause the previous component in the container to be displayed.
-@end deftypemethod
-@deftypemethod CardLayout {public void} removeLayoutComponent (java.awt.Component@w{ }@var{comp})
-Remove the indicated component from this layout manager.
-@end deftypemethod
-@deftypemethod CardLayout {public void} setHgap (int@w{ }@var{hgap})
-Set this layout manager's horizontal gap.
-@end deftypemethod
-@deftypemethod CardLayout {public void} setVgap (int@w{ }@var{vgap})
-Set this layout manager's vertical gap.
-@end deftypemethod
-@deftypemethod CardLayout {public void} show (java.awt.Container@w{ }@var{parent}, java.lang.String@w{ }@var{name})
-Cause the named component to be shown. If the component name is
- unknown, this method does nothing.
-@end deftypemethod
-@deftypemethod CardLayout {public String} toString ()
-
-@end deftypemethod
-@deftypemethod CheckboxGroup {public Checkbox} getCurrent ()
-Returns the currently selected checkbox in the group.
-@end deftypemethod
-@deftypemethod CheckboxGroup {public Checkbox} getSelectedCheckbox ()
-Returns the currently selected checkbox in the group.
-@end deftypemethod
-@deftypemethod CheckboxGroup {public synchronized void} setCurrent (java.awt.Checkbox@w{ }@var{checkbox})
-Set the selected checkbox.
-@end deftypemethod
-@deftypemethod CheckboxGroup {public synchronized void} setSelectedCheckbox (java.awt.Checkbox@w{ }@var{checkbox})
-Set the selected checkbox.
-@end deftypemethod
-@deftypemethod CheckboxGroup {public String} toString ()
-Return String representation of this class and current Checkbox.
-@end deftypemethod
-@deftypemethod Checkbox {public synchronized void} addItemListener (java.awt.event.ItemListener@w{ }@var{listener})
-Add a listener for item events.
-@end deftypemethod
-@deftypemethod Checkbox {public void} addNotify ()
-This creates the component's peer.
-@end deftypemethod
-@deftypemethod Checkbox {public CheckboxGroup} getCheckboxGroup ()
-Returns the current CheckboxGroup associated with this
- Checkbox.
-@end deftypemethod
-@deftypemethod Checkbox {public String} getLabel ()
-Returns the current label; might be null.
-@end deftypemethod
-@deftypemethod Checkbox {public Object} getSelectedObjects ()
-Returns this checkbox's label if this checkbox is selected.
-@end deftypemethod
-@deftypemethod Checkbox {public boolean} getState ()
-Returns the current state of this checkbox.
-@end deftypemethod
-@deftypemethod Checkbox {protected String} paramString ()
-Generates a String representation of this Checkbox's state.
-@end deftypemethod
-@deftypemethod Checkbox {protected void} processEvent (java.awt.AWTEvent@w{ }@var{event})
-Process an event for this Checkbox.
-@end deftypemethod
-@deftypemethod Checkbox {protected void} processItemEvent (java.awt.event.ItemEvent@w{ }@var{event})
-Process an item event for this Checkbox.
-@end deftypemethod
-@deftypemethod Checkbox {public synchronized void} removeItemListener (java.awt.event.ItemListener@w{ }@var{listener})
-Remove an item listener.
-@end deftypemethod
-@deftypemethod Checkbox {public void} setCheckboxGroup (java.awt.CheckboxGroup@w{ }@var{group})
-Set this checkbox's group.
-@end deftypemethod
-@deftypemethod Checkbox {public synchronized void} setLabel (java.lang.String@w{ }@var{label})
-Set the checkbox's label.
-@end deftypemethod
-@deftypemethod Checkbox {public void} setState (boolean@w{ }@var{state})
-Set the checkbox's state.
-@end deftypemethod
-@deftypemethod CheckboxMenuItem {public synchronized void} addItemListener (java.awt.event.ItemListener@w{ }@var{listener})
-Add a listener for item events.
-@end deftypemethod
-@deftypemethod CheckboxMenuItem {public void} addNotify ()
-This creates the component's peer.
-@end deftypemethod
-@deftypemethod CheckboxMenuItem {public Object} getSelectedObjects ()
-Returns this checkbox's label if this checkbox is selected.
-@end deftypemethod
-@deftypemethod CheckboxMenuItem {public boolean} getState ()
-Returns the current state of this checkbox.
-@end deftypemethod
-@deftypemethod CheckboxMenuItem {public String} paramString ()
-Generates a String representation of this Checkbox's state.
-@end deftypemethod
-@deftypemethod CheckboxMenuItem {protected void} processEvent (java.awt.AWTEvent@w{ }@var{event})
-Process an event for this Checkbox.
-@end deftypemethod
-@deftypemethod CheckboxMenuItem {protected void} processItemEvent (java.awt.event.ItemEvent@w{ }@var{event})
-Process an item event for this Checkbox.
-@end deftypemethod
-@deftypemethod CheckboxMenuItem {public synchronized void} removeItemListener (java.awt.event.ItemListener@w{ }@var{listener})
-Remove an item listener.
-@end deftypemethod
-@deftypemethod CheckboxMenuItem {public void} setState (boolean@w{ }@var{state})
-Set the checkbox's state.
-@end deftypemethod
-@deftypemethod Choice {public synchronized void} add (java.lang.String@w{ }@var{item})
-Add a new item to this Choice object. If the item is the first
- item on the list, then it is selected.
-@end deftypemethod
-@deftypemethod Choice {public void} addItem (java.lang.String@w{ }@var{item})
-Add a new item to this Choice object. This is the same as the
- add method.
-@end deftypemethod
-@deftypemethod Choice {public synchronized void} addItemListener (java.awt.event.ItemListener@w{ }@var{listener})
-Add a listener for item events.
-@end deftypemethod
-@deftypemethod Choice {public void} addNotify ()
-This creates the component's peer.
-@end deftypemethod
-@deftypemethod Choice {public int} countItems ()
-Returns number of items.
-@end deftypemethod
-@deftypemethod Choice {public String} getItem (int@w{ }@var{index})
-Returns an item from this choice.
-@end deftypemethod
-@deftypemethod Choice {public int} getItemCount ()
-Returns number of items in Choice.
-@end deftypemethod
-@deftypemethod Choice {public int} getSelectedIndex ()
-Returns index of selected item; -1 if no item is selected.
-@end deftypemethod
-@deftypemethod Choice {public synchronized String} getSelectedItem ()
-Returns currently selected item; null if no item is selected.
-@end deftypemethod
-@deftypemethod Choice {public synchronized Object} getSelectedObjects ()
-Returns the currently selected item.
-@end deftypemethod
-@deftypemethod Choice {public synchronized void} insert (java.lang.String@w{ }@var{item}, int@w{ }@var{index})
-Inserts an item into this Choice. Existing items are shifted
- upwards. If the new item is the only item, then it is selected.
- If the currently selected item is shifted, then the first item is
- selected. If the currently selected item is not shifted, then it
- remains selected.
-@end deftypemethod
-@deftypemethod Choice {protected String} paramString ()
-Generates a String representation of this Choice's state.
-@end deftypemethod
-@deftypemethod Choice {protected void} processEvent (java.awt.AWTEvent@w{ }@var{event})
-Process an event for this Choice
-@end deftypemethod
-@deftypemethod Choice {protected void} processItemEvent (java.awt.event.ItemEvent@w{ }@var{event})
-Process an item event for this Choice.
-@end deftypemethod
-@deftypemethod Choice {public synchronized void} remove (java.lang.String@w{ }@var{item})
-Remove an item from this Choice. If several matches exist, the
- first one is removed. If the removed item is selected, the the
- first item is selected.
-@end deftypemethod
-@deftypemethod Choice {public synchronized void} remove (int@w{ }@var{index})
-Remove an item from this Choice. If the removed item is
- selected, the the first item is selected.
-@end deftypemethod
-@deftypemethod Choice {public synchronized void} removeAll ()
-Remove all items from this choice.
-@end deftypemethod
-@deftypemethod Choice {public synchronized void} removeItemListener (java.awt.event.ItemListener@w{ }@var{listener})
-Remove an item listener.
-@end deftypemethod
-@deftypemethod Choice {public synchronized void} select (java.lang.String@w{ }@var{item})
-Select an item in this Choice.
-@end deftypemethod
-@deftypemethod Choice {public synchronized void} select (int@w{ }@var{index})
-Select an item in this choice.
-@end deftypemethod
-@deftypemethod Color {public int} getRed ()
-
-@end deftypemethod
-@deftypemethod Color {public int} getGreen ()
-
-@end deftypemethod
-@deftypemethod Color {public int} getBlue ()
-
-@end deftypemethod
-@deftypemethod Color {public int} getAlpha ()
-
-@end deftypemethod
-@deftypemethod Color {public int} getRGB ()
-
-@end deftypemethod
-@deftypemethod Color {public Color} brighter ()
-
-@end deftypemethod
-@deftypemethod Color {public Color} darker ()
-
-@end deftypemethod
-@deftypemethod Color {public int} hashCode ()
-
-@end deftypemethod
-@deftypemethod Color {public int} getTransparency ()
-
-@end deftypemethod
-@deftypemethod Component {public String} getName ()
-
-@end deftypemethod
-@deftypemethod Component {public void} setName (java.lang.String@w{ }@var{name})
-
-@end deftypemethod
-@deftypemethod Component {public Container} getParent ()
-
-@end deftypemethod
-@deftypemethod Component {public ComponentPeer} getPeer ()
-
-@end deftypemethod
-@deftypemethod Component {public GraphicsConfiguration} getGraphicsConfiguration ()
-
-@end deftypemethod
-@deftypemethod Component {public final Object} getTreeLock ()
-
-@end deftypemethod
-@deftypemethod Component {public Toolkit} getToolkit ()
-
-@end deftypemethod
-@deftypemethod Component {public boolean} isValid ()
-
-@end deftypemethod
-@deftypemethod Component {public boolean} isDisplayable ()
-
-@end deftypemethod
-@deftypemethod Component {public boolean} isVisible ()
-
-@end deftypemethod
-@deftypemethod Component {public boolean} isShowing ()
-
-@end deftypemethod
-@deftypemethod Component {public boolean} isEnabled ()
-
-@end deftypemethod
-@deftypemethod Component {public void} setEnabled (boolean@w{ }@var{b})
-
-@end deftypemethod
-@deftypemethod Component {public void} enable ()
-
-@end deftypemethod
-@deftypemethod Component {public void} enable (boolean@w{ }@var{b})
-
-@end deftypemethod
-@deftypemethod Component {public void} disable ()
-
-@end deftypemethod
-@deftypemethod Component {public boolean} isDoubleBuffered ()
-
-@end deftypemethod
-@deftypemethod Component {public void} enableInputMethods (boolean@w{ }@var{enable})
-
-@end deftypemethod
-@deftypemethod Component {public void} setVisible (boolean@w{ }@var{b})
-
-@end deftypemethod
-@deftypemethod Component {public void} show ()
-
-@end deftypemethod
-@deftypemethod Component {public void} show (boolean@w{ }@var{b})
-
-@end deftypemethod
-@deftypemethod Component {public void} hide ()
-
-@end deftypemethod
-@deftypemethod Component {public Color} getForeground ()
-
-@end deftypemethod
-@deftypemethod Component {public void} setForeground (java.awt.Color@w{ }@var{c})
-
-@end deftypemethod
-@deftypemethod Component {public Color} getBackground ()
-
-@end deftypemethod
-@deftypemethod Component {public void} setBackground (java.awt.Color@w{ }@var{c})
-
-@end deftypemethod
-@deftypemethod Component {public Font} getFont ()
-
-@end deftypemethod
-@deftypemethod Component {public void} setFont (java.awt.Font@w{ }@var{f})
-
-@end deftypemethod
-@deftypemethod Component {public Locale} getLocale () @*throws IllegalComponentStateException
-
-@end deftypemethod
-@deftypemethod Component {public void} setLocale (java.util.Locale@w{ }@var{l})
-
-@end deftypemethod
-@deftypemethod Component {public ColorModel} getColorModel ()
-
-@end deftypemethod
-@deftypemethod Component {public Point} getLocation ()
-
-@end deftypemethod
-@deftypemethod Component {public Point} getLocationOnScreen ()
-
-@end deftypemethod
-@deftypemethod Component {public Point} location ()
-
-@end deftypemethod
-@deftypemethod Component {public void} setLocation (int@w{ }@var{x}, int@w{ }@var{y})
-
-@end deftypemethod
-@deftypemethod Component {public void} move (int@w{ }@var{x}, int@w{ }@var{y})
-
-@end deftypemethod
-@deftypemethod Component {public void} setLocation (java.awt.Point@w{ }@var{p})
-
-@end deftypemethod
-@deftypemethod Component {public Dimension} getSize ()
-
-@end deftypemethod
-@deftypemethod Component {public Dimension} size ()
-
-@end deftypemethod
-@deftypemethod Component {public void} setSize (int@w{ }@var{width}, int@w{ }@var{height})
-
-@end deftypemethod
-@deftypemethod Component {public void} resize (int@w{ }@var{width}, int@w{ }@var{height})
-
-@end deftypemethod
-@deftypemethod Component {public void} setSize (java.awt.Dimension@w{ }@var{d})
-
-@end deftypemethod
-@deftypemethod Component {public void} resize (java.awt.Dimension@w{ }@var{d})
-
-@end deftypemethod
-@deftypemethod Component {public Rectangle} getBounds ()
-
-@end deftypemethod
-@deftypemethod Component {public Rectangle} bounds ()
-
-@end deftypemethod
-@deftypemethod Component {public void} setBounds (int@w{ }@var{x}, int@w{ }@var{y}, int@w{ }@var{w}, int@w{ }@var{h})
-
-@end deftypemethod
-@deftypemethod Component {public void} reshape (int@w{ }@var{x}, int@w{ }@var{y}, int@w{ }@var{width}, int@w{ }@var{height})
-
-@end deftypemethod
-@deftypemethod Component {public void} setBounds (java.awt.Rectangle@w{ }@var{r})
-
-@end deftypemethod
-@deftypemethod Component {public int} getX ()
-
-@end deftypemethod
-@deftypemethod Component {public int} getY ()
-
-@end deftypemethod
-@deftypemethod Component {public int} getWidth ()
-
-@end deftypemethod
-@deftypemethod Component {public int} getHeight ()
-
-@end deftypemethod
-@deftypemethod Component {public Rectangle} getBounds (java.awt.Rectangle@w{ }@var{r})
-
-@end deftypemethod
-@deftypemethod Component {public Dimension} getSize (java.awt.Dimension@w{ }@var{d})
-
-@end deftypemethod
-@deftypemethod Component {public Point} getLocation (java.awt.Point@w{ }@var{p})
-
-@end deftypemethod
-@deftypemethod Component {public boolean} isOpaque ()
-
-@end deftypemethod
-@deftypemethod Component {public boolean} isLightweight ()
-Return whether the component is lightweight.
-@end deftypemethod
-@deftypemethod Component {public Dimension} getPreferredSize ()
-
-@end deftypemethod
-@deftypemethod Component {public Dimension} preferredSize ()
-
-@end deftypemethod
-@deftypemethod Component {public Dimension} getMinimumSize ()
-
-@end deftypemethod
-@deftypemethod Component {public Dimension} minimumSize ()
-
-@end deftypemethod
-@deftypemethod Component {public Dimension} getMaximumSize ()
-
-@end deftypemethod
-@deftypemethod Component {public float} getAlignmentX ()
-
-@end deftypemethod
-@deftypemethod Component {public float} getAlignmentY ()
-
-@end deftypemethod
-@deftypemethod Component {public void} doLayout ()
-
-@end deftypemethod
-@deftypemethod Component {public void} layout ()
-
-@end deftypemethod
-@deftypemethod Component {public void} validate ()
-
-@end deftypemethod
-@deftypemethod Component {public void} invalidate ()
-
-@end deftypemethod
-@deftypemethod Component {public Graphics} getGraphics ()
-
-@end deftypemethod
-@deftypemethod Component {public FontMetrics} getFontMetrics (java.awt.Font@w{ }@var{font})
-
-@end deftypemethod
-@deftypemethod Component {public void} setCursor (java.awt.Cursor@w{ }@var{cursor})
-
-@end deftypemethod
-@deftypemethod Component {public Cursor} getCursor ()
-
-@end deftypemethod
-@deftypemethod Component {public void} paint (java.awt.Graphics@w{ }@var{g})
-
-@end deftypemethod
-@deftypemethod Component {public void} update (java.awt.Graphics@w{ }@var{g})
-
-@end deftypemethod
-@deftypemethod Component {public void} paintAll (java.awt.Graphics@w{ }@var{g})
-
-@end deftypemethod
-@deftypemethod Component {public void} repaint ()
-
-@end deftypemethod
-@deftypemethod Component {public void} repaint (long@w{ }@var{tm})
-
-@end deftypemethod
-@deftypemethod Component {public void} repaint (int@w{ }@var{x}, int@w{ }@var{y}, int@w{ }@var{width}, int@w{ }@var{height})
-
-@end deftypemethod
-@deftypemethod Component {public void} repaint (long@w{ }@var{tm}, int@w{ }@var{x}, int@w{ }@var{y}, int@w{ }@var{width}, int@w{ }@var{height})
-
-@end deftypemethod
-@deftypemethod Component {public void} print (java.awt.Graphics@w{ }@var{g})
-
-@end deftypemethod
-@deftypemethod Component {public void} printAll (java.awt.Graphics@w{ }@var{g})
-
-@end deftypemethod
-@deftypemethod Component {public boolean} imageUpdate (java.awt.Image@w{ }@var{img}, int@w{ }@var{infoflags}, int@w{ }@var{x}, int@w{ }@var{y}, int@w{ }@var{w}, int@w{ }@var{h})
-
-@end deftypemethod
-@deftypemethod Component {public Image} createImage (java.awt.image.ImageProducer@w{ }@var{producer})
-
-@end deftypemethod
-@deftypemethod Component {public Image} createImage (int@w{ }@var{width}, int@w{ }@var{height})
-
-@end deftypemethod
-@deftypemethod Component {public boolean} prepareImage (java.awt.Image@w{ }@var{image}, java.awt.image.ImageObserver@w{ }@var{observer})
-
-@end deftypemethod
-@deftypemethod Component {public boolean} prepareImage (java.awt.Image@w{ }@var{image}, int@w{ }@var{width}, int@w{ }@var{height}, java.awt.image.ImageObserver@w{ }@var{observer})
-
-@end deftypemethod
-@deftypemethod Component {public int} checkImage (java.awt.Image@w{ }@var{image}, java.awt.image.ImageObserver@w{ }@var{observer})
-
-@end deftypemethod
-@deftypemethod Component {public int} checkImage (java.awt.Image@w{ }@var{image}, int@w{ }@var{width}, int@w{ }@var{height}, java.awt.image.ImageObserver@w{ }@var{observer})
-
-@end deftypemethod
-@deftypemethod Component {public boolean} contains (int@w{ }@var{x}, int@w{ }@var{y})
-
-@end deftypemethod
-@deftypemethod Component {public boolean} inside (int@w{ }@var{x}, int@w{ }@var{y})
-
-@end deftypemethod
-@deftypemethod Component {public boolean} contains (java.awt.Point@w{ }@var{p})
-
-@end deftypemethod
-@deftypemethod Component {public Component} getComponentAt (int@w{ }@var{x}, int@w{ }@var{y})
-
-@end deftypemethod
-@deftypemethod Component {public Component} locate (int@w{ }@var{x}, int@w{ }@var{y})
-
-@end deftypemethod
-@deftypemethod Component {public Component} getComponentAt (java.awt.Point@w{ }@var{p})
-
-@end deftypemethod
-@deftypemethod Component {public void} deliverEvent (java.awt.Event@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod Component {public final void} dispatchEvent (java.awt.AWTEvent@w{ }@var{e})
-Forward AWT events to processEvent() if:
- - Events have been enabled for this type of event via enableEvents(),
- OR:
- - There is at least one registered listener for this type of event
-@end deftypemethod
-@deftypemethod Component {public boolean} postEvent (java.awt.Event@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod Component {public synchronized void} addComponentListener (java.awt.event.ComponentListener@w{ }@var{l})
-
-@end deftypemethod
-@deftypemethod Component {public synchronized void} removeComponentListener (java.awt.event.ComponentListener@w{ }@var{l})
-
-@end deftypemethod
-@deftypemethod Component {public synchronized void} addFocusListener (java.awt.event.FocusListener@w{ }@var{l})
-
-@end deftypemethod
-@deftypemethod Component {public synchronized void} removeFocusListener (java.awt.event.FocusListener@w{ }@var{l})
-
-@end deftypemethod
-@deftypemethod Component {public synchronized void} addHierarchyListener (java.awt.event.HierarchyListener@w{ }@var{l})
-
-@end deftypemethod
-@deftypemethod Component {public synchronized void} removeHierarchyListener (java.awt.event.HierarchyListener@w{ }@var{l})
-
-@end deftypemethod
-@deftypemethod Component {public synchronized void} addHierarchyBoundsListener (java.awt.event.HierarchyBoundsListener@w{ }@var{l})
-
-@end deftypemethod
-@deftypemethod Component {public synchronized void} removeHierarchyBoundsListener (java.awt.event.HierarchyBoundsListener@w{ }@var{l})
-
-@end deftypemethod
-@deftypemethod Component {public synchronized void} addKeyListener (java.awt.event.KeyListener@w{ }@var{l})
-
-@end deftypemethod
-@deftypemethod Component {public synchronized void} removeKeyListener (java.awt.event.KeyListener@w{ }@var{l})
-
-@end deftypemethod
-@deftypemethod Component {public synchronized void} addMouseListener (java.awt.event.MouseListener@w{ }@var{l})
-
-@end deftypemethod
-@deftypemethod Component {public synchronized void} removeMouseListener (java.awt.event.MouseListener@w{ }@var{l})
-
-@end deftypemethod
-@deftypemethod Component {public synchronized void} addMouseMotionListener (java.awt.event.MouseMotionListener@w{ }@var{l})
-
-@end deftypemethod
-@deftypemethod Component {public synchronized void} removeMouseMotionListener (java.awt.event.MouseMotionListener@w{ }@var{l})
-
-@end deftypemethod
-@deftypemethod Component {public synchronized void} addInputMethodListener (java.awt.event.InputMethodListener@w{ }@var{l})
-
-@end deftypemethod
-@deftypemethod Component {public synchronized void} removeInputMethodListener (java.awt.event.InputMethodListener@w{ }@var{l})
-
-@end deftypemethod
-@deftypemethod Component {public EventListener} getListeners (java.lang.Class@w{ }@var{listenerType})
-Returns all registered EventListers of the given listenerType.
- listenerType must be a subclass of EventListener, or a
- ClassClassException is thrown.
-@end deftypemethod
-@deftypemethod Component {protected final void} enableEvents (long@w{ }@var{eventsToEnable})
-
-@end deftypemethod
-@deftypemethod Component {protected final void} disableEvents (long@w{ }@var{eventsToDisable})
-
-@end deftypemethod
-@deftypemethod Component {protected AWTEvent} coalesceEvents (java.awt.AWTEvent@w{ }@var{existingEvent}, java.awt.AWTEvent@w{ }@var{newEvent})
-coalesceEvents is called by the EventQueue if two events with the same
- event id are queued. Returns a new combined event, or null if no
- combining is done.
-@end deftypemethod
-@deftypemethod Component {protected void} processEvent (java.awt.AWTEvent@w{ }@var{e})
-Forward event to the appropriate processXXXEvent method based on the
- event type.
-@end deftypemethod
-@deftypemethod Component {protected void} processComponentEvent (java.awt.event.ComponentEvent@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod Component {protected void} processFocusEvent (java.awt.event.FocusEvent@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod Component {protected void} processKeyEvent (java.awt.event.KeyEvent@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod Component {protected void} processMouseEvent (java.awt.event.MouseEvent@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod Component {protected void} processMouseMotionEvent (java.awt.event.MouseEvent@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod Component {protected void} processInputMethodEvent (java.awt.event.InputMethodEvent@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod Component {protected void} processHierarchyEvent (java.awt.event.HierarchyEvent@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod Component {protected void} processHierarchyBoundsEvent (java.awt.event.HierarchyEvent@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod Component {public boolean} handleEvent (java.awt.Event@w{ }@var{evt})
-
-@end deftypemethod
-@deftypemethod Component {public boolean} mouseDown (java.awt.Event@w{ }@var{evt}, int@w{ }@var{x}, int@w{ }@var{y})
-
-@end deftypemethod
-@deftypemethod Component {public boolean} mouseDrag (java.awt.Event@w{ }@var{evt}, int@w{ }@var{x}, int@w{ }@var{y})
-
-@end deftypemethod
-@deftypemethod Component {public boolean} mouseUp (java.awt.Event@w{ }@var{evt}, int@w{ }@var{x}, int@w{ }@var{y})
-
-@end deftypemethod
-@deftypemethod Component {public boolean} mouseMove (java.awt.Event@w{ }@var{evt}, int@w{ }@var{x}, int@w{ }@var{y})
-
-@end deftypemethod
-@deftypemethod Component {public boolean} mouseEnter (java.awt.Event@w{ }@var{evt}, int@w{ }@var{x}, int@w{ }@var{y})
-
-@end deftypemethod
-@deftypemethod Component {public boolean} mouseExit (java.awt.Event@w{ }@var{evt}, int@w{ }@var{x}, int@w{ }@var{y})
-
-@end deftypemethod
-@deftypemethod Component {public boolean} keyDown (java.awt.Event@w{ }@var{evt}, int@w{ }@var{key})
-
-@end deftypemethod
-@deftypemethod Component {public boolean} keyUp (java.awt.Event@w{ }@var{evt}, int@w{ }@var{key})
-
-@end deftypemethod
-@deftypemethod Component {public boolean} action (java.awt.Event@w{ }@var{evt}, java.lang.Object@w{ }@var{what})
-
-@end deftypemethod
-@deftypemethod Component {public void} addNotify ()
-
-@end deftypemethod
-@deftypemethod Component {public void} removeNotify ()
-
-@end deftypemethod
-@deftypemethod Component {public boolean} gotFocus (java.awt.Event@w{ }@var{evt}, java.lang.Object@w{ }@var{what})
-
-@end deftypemethod
-@deftypemethod Component {public boolean} lostFocus (java.awt.Event@w{ }@var{evt}, java.lang.Object@w{ }@var{what})
-
-@end deftypemethod
-@deftypemethod Component {public boolean} isFocusTraversable ()
-
-@end deftypemethod
-@deftypemethod Component {public void} requestFocus ()
-
-@end deftypemethod
-@deftypemethod Component {public void} transferFocus ()
-
-@end deftypemethod
-@deftypemethod Component {public void} nextFocus ()
-
-@end deftypemethod
-@deftypemethod Component {public boolean} hasFocus ()
-
-@end deftypemethod
-@deftypemethod Component {public synchronized void} add (java.awt.PopupMenu@w{ }@var{popup})
-
-@end deftypemethod
-@deftypemethod Component {public synchronized void} remove (java.awt.MenuComponent@w{ }@var{popup})
-
-@end deftypemethod
-@deftypemethod Component {protected String} paramString ()
-
-@end deftypemethod
-@deftypemethod Component {public String} toString ()
-
-@end deftypemethod
-@deftypemethod Component {public void} list ()
-
-@end deftypemethod
-@deftypemethod Component {public void} list (java.io.PrintStream@w{ }@var{out})
-
-@end deftypemethod
-@deftypemethod Component {public void} list (java.io.PrintStream@w{ }@var{out}, int@w{ }@var{indent})
-
-@end deftypemethod
-@deftypemethod Component {public void} list (java.io.PrintWriter@w{ }@var{out})
-
-@end deftypemethod
-@deftypemethod Component {public void} list (java.io.PrintWriter@w{ }@var{out}, int@w{ }@var{indent})
-
-@end deftypemethod
-@deftypemethod Component {public void} addPropertyChangeListener (java.beans.PropertyChangeListener@w{ }@var{listener})
-
-@end deftypemethod
-@deftypemethod Component {public void} removePropertyChangeListener (java.beans.PropertyChangeListener@w{ }@var{listener})
-
-@end deftypemethod
-@deftypemethod Component {public void} addPropertyChangeListener (java.lang.String@w{ }@var{propertyName}, java.beans.PropertyChangeListener@w{ }@var{listener})
-
-@end deftypemethod
-@deftypemethod Component {public void} removePropertyChangeListener (java.lang.String@w{ }@var{propertyName}, java.beans.PropertyChangeListener@w{ }@var{listener})
-
-@end deftypemethod
-@deftypemethod Component {protected void} firePropertyChange (java.lang.String@w{ }@var{propertyName}, java.lang.Object@w{ }@var{oldValue}, java.lang.Object@w{ }@var{newValue})
-
-@end deftypemethod
-@deftypemethod Component {public void} setComponentOrientation (java.awt.ComponentOrientation@w{ }@var{o})
-
-@end deftypemethod
-@deftypemethod Component {public ComponentOrientation} getComponentOrientation ()
-
-@end deftypemethod
-@deftypemethod ComponentOrientation {public boolean} isHorizontal ()
-
-@end deftypemethod
-@deftypemethod ComponentOrientation {public boolean} isLeftToRight ()
-
-@end deftypemethod
-@deftypemethod ComponentOrientation {public static ComponentOrientation} getOrientation (java.util.Locale@w{ }@var{locale})
-
-@end deftypemethod
-@deftypemethod ComponentOrientation {public static ComponentOrientation} getOrientation (java.util.ResourceBundle@w{ }@var{bdl})
-
-@end deftypemethod
-@deftypemethod Container {public int} getComponentCount ()
-
-@end deftypemethod
-@deftypemethod Container {public int} countComponents ()
-
-@end deftypemethod
-@deftypemethod Container {public Component} getComponent (int@w{ }@var{n})
-
-@end deftypemethod
-@deftypemethod Container {public Component} getComponents ()
-
-@end deftypemethod
-@deftypemethod Container {public Insets} getInsets ()
-
-@end deftypemethod
-@deftypemethod Container {public Insets} insets ()
-
-@end deftypemethod
-@deftypemethod Container {public Component} add (java.awt.Component@w{ }@var{comp})
-
-@end deftypemethod
-@deftypemethod Container {public Component} add (java.lang.String@w{ }@var{name}, java.awt.Component@w{ }@var{comp})
-
-@end deftypemethod
-@deftypemethod Container {public Component} add (java.awt.Component@w{ }@var{comp}, int@w{ }@var{index})
-
-@end deftypemethod
-@deftypemethod Container {public void} add (java.awt.Component@w{ }@var{comp}, java.lang.Object@w{ }@var{constraints})
-
-@end deftypemethod
-@deftypemethod Container {public void} add (java.awt.Component@w{ }@var{comp}, java.lang.Object@w{ }@var{constraints}, int@w{ }@var{index})
-
-@end deftypemethod
-@deftypemethod Container {protected void} addImpl (java.awt.Component@w{ }@var{comp}, java.lang.Object@w{ }@var{constraints}, int@w{ }@var{index})
-
-@end deftypemethod
-@deftypemethod Container {public void} remove (int@w{ }@var{index})
-
-@end deftypemethod
-@deftypemethod Container {public void} remove (java.awt.Component@w{ }@var{comp})
-
-@end deftypemethod
-@deftypemethod Container {public void} removeAll ()
-
-@end deftypemethod
-@deftypemethod Container {public LayoutManager} getLayout ()
-
-@end deftypemethod
-@deftypemethod Container {public void} setLayout (java.awt.LayoutManager@w{ }@var{mgr})
-
-@end deftypemethod
-@deftypemethod Container {public void} doLayout ()
-
-@end deftypemethod
-@deftypemethod Container {public void} layout ()
-
-@end deftypemethod
-@deftypemethod Container {public void} invalidate ()
-
-@end deftypemethod
-@deftypemethod Container {public void} validate ()
-
-@end deftypemethod
-@deftypemethod Container {protected void} validateTree ()
-
-@end deftypemethod
-@deftypemethod Container {public void} setFont (java.awt.Font@w{ }@var{f})
-
-@end deftypemethod
-@deftypemethod Container {public Dimension} getPreferredSize ()
-
-@end deftypemethod
-@deftypemethod Container {public Dimension} preferredSize ()
-
-@end deftypemethod
-@deftypemethod Container {public Dimension} getMinimumSize ()
-
-@end deftypemethod
-@deftypemethod Container {public Dimension} minimumSize ()
-
-@end deftypemethod
-@deftypemethod Container {public Dimension} getMaximumSize ()
-
-@end deftypemethod
-@deftypemethod Container {public float} getAlignmentX ()
-
-@end deftypemethod
-@deftypemethod Container {public float} getAlignmentY ()
-
-@end deftypemethod
-@deftypemethod Container {public void} paint (java.awt.Graphics@w{ }@var{g})
-
-@end deftypemethod
-@deftypemethod Container {public void} update (java.awt.Graphics@w{ }@var{g})
-
-@end deftypemethod
-@deftypemethod Container {public void} print (java.awt.Graphics@w{ }@var{g})
-
-@end deftypemethod
-@deftypemethod Container {public void} paintComponents (java.awt.Graphics@w{ }@var{g})
-
-@end deftypemethod
-@deftypemethod Container {public void} printComponents (java.awt.Graphics@w{ }@var{g})
-
-@end deftypemethod
-@deftypemethod Container {public void} addContainerListener (java.awt.event.ContainerListener@w{ }@var{l})
-
-@end deftypemethod
-@deftypemethod Container {public void} removeContainerListener (java.awt.event.ContainerListener@w{ }@var{l})
-
-@end deftypemethod
-@deftypemethod Container {public EventListener} getListeners (java.lang.Class@w{ }@var{listenerType})
-
-@end deftypemethod
-@deftypemethod Container {protected void} processEvent (java.awt.AWTEvent@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod Container {protected void} processContainerEvent (java.awt.event.ContainerEvent@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod Container {public void} deliverEvent (java.awt.Event@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod Container {public Component} getComponentAt (int@w{ }@var{x}, int@w{ }@var{y})
-
-@end deftypemethod
-@deftypemethod Container {public Component} locate (int@w{ }@var{x}, int@w{ }@var{y})
-
-@end deftypemethod
-@deftypemethod Container {public Component} getComponentAt (java.awt.Point@w{ }@var{p})
-
-@end deftypemethod
-@deftypemethod Container {public Component} findComponentAt (int@w{ }@var{x}, int@w{ }@var{y})
-
-@end deftypemethod
-@deftypemethod Container {public Component} findComponentAt (java.awt.Point@w{ }@var{p})
-
-@end deftypemethod
-@deftypemethod Container {public void} addNotify ()
-
-@end deftypemethod
-@deftypemethod Container {public void} removeNotify ()
-
-@end deftypemethod
-@deftypemethod Container {public boolean} isAncestorOf (java.awt.Component@w{ }@var{comp})
-
-@end deftypemethod
-@deftypemethod Container {protected String} paramString ()
-
-@end deftypemethod
-@deftypemethod Container {public void} list (java.io.PrintStream@w{ }@var{out}, int@w{ }@var{indent})
-
-@end deftypemethod
-@deftypemethod Container {public void} list (java.io.PrintWriter@w{ }@var{out}, int@w{ }@var{indent})
-
-@end deftypemethod
-@deftypemethod Cursor {public static Cursor} getPredefinedCursor (int@w{ }@var{type})
-
-@end deftypemethod
-@deftypemethod Cursor {public static Cursor} getSystemCustomCursor (java.lang.String@w{ }@var{name}) @*throws AWTException
-
-@end deftypemethod
-@deftypemethod Cursor {public static Cursor} getDefaultCursor ()
-
-@end deftypemethod
-@deftypemethod Cursor {public int} getType ()
-
-@end deftypemethod
-@deftypemethod Cursor {public String} getName ()
-
-@end deftypemethod
-@deftypemethod Cursor {public String} toString ()
-
-@end deftypemethod
-@deftypemethod Dimension {public boolean} equals (java.lang.Object@w{ }@var{obj})
-
-@end deftypemethod
-@deftypemethod Dimension {public Dimension} getSize ()
-
-@end deftypemethod
-@deftypemethod Dimension {public void} setSize (java.awt.Dimension@w{ }@var{dim})
-
-@end deftypemethod
-@deftypemethod Dimension {public void} setSize (int@w{ }@var{width}, int@w{ }@var{height})
-
-@end deftypemethod
-@deftypemethod Dimension {public String} toString ()
-
-@end deftypemethod
-@deftypemethod Dimension {public double} getWidth ()
-
-@end deftypemethod
-@deftypemethod Dimension {public double} getHeight ()
-
-@end deftypemethod
-@deftypemethod Dimension {public void} setSize (double@w{ }@var{width}, double@w{ }@var{height})
-
-@end deftypemethod
-@deftypemethod Event {public boolean} controlDown ()
-
-@end deftypemethod
-@deftypemethod Event {public boolean} metaDown ()
-
-@end deftypemethod
-@deftypemethod Event {protected String} paramString ()
-
-@end deftypemethod
-@deftypemethod Event {public boolean} shiftDown ()
-
-@end deftypemethod
-@deftypemethod Event {public String} toString ()
-
-@end deftypemethod
-@deftypemethod Event {public void} translate (int@w{ }@var{x}, int@w{ }@var{y})
-
-@end deftypemethod
-@deftypemethod EventQueue {public synchronized AWTEvent} getNextEvent () @*throws InterruptedException
-
-@end deftypemethod
-@deftypemethod EventQueue {public synchronized AWTEvent} peekEvent ()
-
-@end deftypemethod
-@deftypemethod EventQueue {public synchronized AWTEvent} peekEvent (int@w{ }@var{id})
-
-@end deftypemethod
-@deftypemethod EventQueue {public synchronized void} postEvent (java.awt.AWTEvent@w{ }@var{evt})
-
-@end deftypemethod
-@deftypemethod EventQueue {public static void} invokeAndWait (java.lang.Runnable@w{ }@var{runnable}) @*throws InterruptedException, InvocationTargetException
-
-@end deftypemethod
-@deftypemethod EventQueue {public synchronized void} push (java.awt.EventQueue@w{ }@var{newEventQueue})
-Allows a custom EventQueue implementation to replace this one.
- All pending events are transferred to the new queue. Calls to postEvent,
- getNextEvent, and peekEvent are forwarded to the pushed queue until it
- is removed with a pop().
-@end deftypemethod
-@deftypemethod EventQueue {protected void} pop () @*throws EmptyStackException
-Transfer any pending events from this queue back to the parent queue that
- was previously push()ed. Event dispatch from this queue is suspended.
-@end deftypemethod
-@deftypemethod EventQueue {protected void} dispatchEvent (java.awt.AWTEvent@w{ }@var{evt})
-
-@end deftypemethod
-@deftypemethod FlowLayout {public void} addLayoutComponent (java.lang.String@w{ }@var{name}, java.awt.Component@w{ }@var{comp})
-Add a new component to the layout. This particular implementation
- does nothing.
-@end deftypemethod
-@deftypemethod FlowLayout {public int} getAlignment ()
-Return the alignment.
-@end deftypemethod
-@deftypemethod FlowLayout {public int} getHgap ()
-Return the horizontal gap.
-@end deftypemethod
-@deftypemethod FlowLayout {public int} getVgap ()
-Return the vertical gap.
-@end deftypemethod
-@deftypemethod FlowLayout {public void} layoutContainer (java.awt.Container@w{ }@var{parent})
-Lay out the container's components based on current settings.
-@end deftypemethod
-@deftypemethod FlowLayout {public Dimension} minimumLayoutSize (java.awt.Container@w{ }@var{cont})
-Get the minimum layout size of the container.
-@end deftypemethod
-@deftypemethod FlowLayout {public Dimension} preferredLayoutSize (java.awt.Container@w{ }@var{cont})
-Get the preferred layout size of the container.
-@end deftypemethod
-@deftypemethod FlowLayout {public void} removeLayoutComponent (java.awt.Component@w{ }@var{comp})
-Remove the indicated component from this layout manager.
- This particular implementation does nothing.
-@end deftypemethod
-@deftypemethod FlowLayout {public void} setAlignment (int@w{ }@var{align})
-Set the alignment.
-@end deftypemethod
-@deftypemethod FlowLayout {public void} setHgap (int@w{ }@var{hgap})
-Set the horizontal gap
-@end deftypemethod
-@deftypemethod FlowLayout {public void} setVgap (int@w{ }@var{vgap})
-Set the vertical gap.
-@end deftypemethod
-@deftypemethod FlowLayout {public String} toString ()
-Return String description of this object.
-@end deftypemethod
-@deftypemethod Font {public boolean} isPlain ()
-
-@end deftypemethod
-@deftypemethod Font {public boolean} isBold ()
-
-@end deftypemethod
-@deftypemethod Font {public boolean} isItalic ()
-
-@end deftypemethod
-@deftypemethod Font {public String} getName ()
-
-@end deftypemethod
-@deftypemethod Font {public String} getFamily ()
-
-@end deftypemethod
-@deftypemethod Font {public String} getFamily (java.util.Locale@w{ }@var{l})
-
-@end deftypemethod
-@deftypemethod Font {public int} getStyle ()
-
-@end deftypemethod
-@deftypemethod Font {public int} getSize ()
-
-@end deftypemethod
-@deftypemethod Font {public float} getSize2D ()
-
-@end deftypemethod
-@deftypemethod Font {public static Font} decode (java.lang.String@w{ }@var{str})
-
-@end deftypemethod
-@deftypemethod Font {public String} toString ()
-
-@end deftypemethod
-@deftypemethod FontMetrics {public Font} getFont ()
-
-@end deftypemethod
-@deftypemethod FontMetrics {public int} getLeading ()
-
-@end deftypemethod
-@deftypemethod FontMetrics {public int} getAscent ()
-
-@end deftypemethod
-@deftypemethod FontMetrics {public int} getDescent ()
-
-@end deftypemethod
-@deftypemethod FontMetrics {public int} getHeight ()
-
-@end deftypemethod
-@deftypemethod FontMetrics {public int} getMaxAscent ()
-
-@end deftypemethod
-@deftypemethod FontMetrics {public int} getMaxDescent ()
-
-@end deftypemethod
-@deftypemethod FontMetrics {public int} getMaxDecent ()
-
-@end deftypemethod
-@deftypemethod FontMetrics {public int} getMaxAdvance ()
-
-@end deftypemethod
-@deftypemethod FontMetrics {public int} charWidth (int@w{ }@var{ch})
-
-@end deftypemethod
-@deftypemethod FontMetrics {public int} charWidth (char@w{ }@var{ch})
-
-@end deftypemethod
-@deftypemethod FontMetrics {public int} stringWidth (java.lang.String@w{ }@var{str})
-
-@end deftypemethod
-@deftypemethod FontMetrics {public int} charsWidth (char[]@w{ }@var{data}, int@w{ }@var{off}, int@w{ }@var{len})
-
-@end deftypemethod
-@deftypemethod FontMetrics {public int} bytesWidth (byte[]@w{ }@var{data}, int@w{ }@var{off}, int@w{ }@var{len})
-
-@end deftypemethod
-@deftypemethod FontMetrics {public int} getWidths ()
-
-@end deftypemethod
-@deftypemethod FontMetrics {public boolean} hasUniformLineMetrics ()
-
-@end deftypemethod
-@deftypemethod FontMetrics {public String} toString ()
-
-@end deftypemethod
-@deftypemethod Frame {public String} getTitle ()
-
-@end deftypemethod
-@deftypemethod Frame {public void} setTitle (java.lang.String@w{ }@var{title})
-
-@end deftypemethod
-@deftypemethod Frame {public Image} getIconImage ()
-
-@end deftypemethod
-@deftypemethod Frame {public void} setIconImage (java.awt.Image@w{ }@var{image})
-
-@end deftypemethod
-@deftypemethod Frame {protected void} finalize () @*throws Throwable
-
-@end deftypemethod
-@deftypemethod Frame {public synchronized void} setMenuBar (java.awt.MenuBar@w{ }@var{menuBar})
-
-@end deftypemethod
-@deftypemethod Frame {public boolean} isResizable ()
-
-@end deftypemethod
-@deftypemethod Frame {public void} setResizable (boolean@w{ }@var{resizable})
-
-@end deftypemethod
-@deftypemethod Frame {public int} getState ()
-
-@end deftypemethod
-@deftypemethod Frame {public synchronized void} addNotify ()
-
-@end deftypemethod
-@deftypemethod Frame {public boolean} postEvent (java.awt.Event@w{ }@var{evt})
-
-@end deftypemethod
-@deftypemethod Frame {public void} remove (java.awt.MenuComponent@w{ }@var{m})
-
-@end deftypemethod
-@deftypemethod Frame {public void} removeNotify ()
-
-@end deftypemethod
-@deftypemethod Frame {public static Frame} getFrames ()
-
-@end deftypemethod
-@deftypemethod Graphics2D {public void} draw3DRect (int@w{ }@var{x}, int@w{ }@var{y}, int@w{ }@var{width}, int@w{ }@var{height}, boolean@w{ }@var{raised})
-
-@end deftypemethod
-@deftypemethod Graphics2D {public void} fill3DRect (int@w{ }@var{x}, int@w{ }@var{y}, int@w{ }@var{width}, int@w{ }@var{height}, boolean@w{ }@var{raised})
-
-@end deftypemethod
-@deftypemethod Graphics2D {public abstract void} draw (java.awt.Shape@w{ }@var{shape})
-
-@end deftypemethod
-@deftypemethod Graphics2D {public abstract boolean} drawImage (java.awt.Image@w{ }@var{image}, java.awt.geom.AffineTransform@w{ }@var{xform}, java.awt.image.ImageObserver@w{ }@var{obs})
-
-@end deftypemethod
-@deftypemethod Graphics2D {public abstract void} drawString (java.lang.String@w{ }@var{text}, int@w{ }@var{x}, int@w{ }@var{y})
-
-@end deftypemethod
-@deftypemethod Graphics2D {public abstract void} drawString (java.lang.String@w{ }@var{text}, float@w{ }@var{x}, float@w{ }@var{y})
-
-@end deftypemethod
-@deftypemethod Graphics2D {public abstract void} fill (java.awt.Shape@w{ }@var{shape})
-
-@end deftypemethod
-@deftypemethod Graphics2D {public abstract boolean} hit (java.awt.Rectangle@w{ }@var{rect}, java.awt.Shape@w{ }@var{text}, boolean@w{ }@var{onStroke})
-
-@end deftypemethod
-@deftypemethod Graphics2D {public abstract GraphicsConfiguration} getDeviceConfiguration ()
-
-@end deftypemethod
-@deftypemethod Graphics2D {public abstract void} setPaint (java.awt.Paint@w{ }@var{paint})
-
-@end deftypemethod
-@deftypemethod Graphics2D {public abstract void} setRenderingHint (java.awt.RenderingHints.Key@w{ }@var{hintKey}, java.lang.Object@w{ }@var{hintValue})
-
-@end deftypemethod
-@deftypemethod Graphics2D {public abstract Object} getRenderingHint (java.awt.RenderingHints.Key@w{ }@var{hintKey})
-
-@end deftypemethod
-@deftypemethod Graphics2D {public abstract RenderingHints} getRenderingHints ()
-
-@end deftypemethod
-@deftypemethod Graphics2D {public abstract void} translate (int@w{ }@var{x}, int@w{ }@var{y})
-
-@end deftypemethod
-@deftypemethod Graphics2D {public abstract void} translate (double@w{ }@var{tx}, double@w{ }@var{ty})
-
-@end deftypemethod
-@deftypemethod Graphics2D {public abstract void} rotate (double@w{ }@var{theta})
-
-@end deftypemethod
-@deftypemethod Graphics2D {public abstract void} rotate (double@w{ }@var{theta}, double@w{ }@var{x}, double@w{ }@var{y})
-
-@end deftypemethod
-@deftypemethod Graphics2D {public abstract void} scale (double@w{ }@var{scaleX}, double@w{ }@var{scaleY})
-
-@end deftypemethod
-@deftypemethod Graphics2D {public abstract void} shear (double@w{ }@var{shearX}, double@w{ }@var{shearY})
-
-@end deftypemethod
-@deftypemethod Graphics2D {public abstract void} transform (java.awt.geom.AffineTransform@w{ }@var{Tx})
-
-@end deftypemethod
-@deftypemethod Graphics2D {public abstract void} setTransform (java.awt.geom.AffineTransform@w{ }@var{Tx})
-
-@end deftypemethod
-@deftypemethod Graphics2D {public abstract AffineTransform} getTransform ()
-
-@end deftypemethod
-@deftypemethod Graphics2D {public abstract Paint} getPaint ()
-
-@end deftypemethod
-@deftypemethod Graphics2D {public abstract void} setBackground (java.awt.Color@w{ }@var{color})
-
-@end deftypemethod
-@deftypemethod Graphics2D {public abstract Color} getBackground ()
-
-@end deftypemethod
-@deftypemethod Graphics2D {public abstract void} clip (java.awt.Shape@w{ }@var{s})
-
-@end deftypemethod
-@deftypemethod GraphicsConfiguration {public abstract BufferedImage} createCompatibleImage (int@w{ }@var{width}, int@w{ }@var{height})
-
-@end deftypemethod
-@deftypemethod GraphicsConfiguration {public abstract BufferedImage} createCompatibleImage (int@w{ }@var{width}, int@w{ }@var{height}, int@w{ }@var{transparency})
-
-@end deftypemethod
-@deftypemethod GraphicsConfiguration {public abstract ColorModel} getColorModel ()
-
-@end deftypemethod
-@deftypemethod GraphicsConfiguration {public abstract ColorModel} getColorModel (int@w{ }@var{transparency})
-
-@end deftypemethod
-@deftypemethod GraphicsConfiguration {public abstract AffineTransform} getDefaultTransform ()
-
-@end deftypemethod
-@deftypemethod GraphicsConfiguration {public abstract AffineTransform} getNormalizingTransform ()
-
-@end deftypemethod
-@deftypemethod GraphicsConfiguration {public abstract Rectangle} getBounds ()
-
-@end deftypemethod
-@deftypemethod Graphics {public abstract Graphics} create ()
-
-@end deftypemethod
-@deftypemethod Graphics {public Graphics} create (int@w{ }@var{x}, int@w{ }@var{y}, int@w{ }@var{width}, int@w{ }@var{height})
-
-@end deftypemethod
-@deftypemethod Graphics {public abstract void} translate (int@w{ }@var{x}, int@w{ }@var{y})
-
-@end deftypemethod
-@deftypemethod Graphics {public abstract Color} getColor ()
-
-@end deftypemethod
-@deftypemethod Graphics {public abstract void} setColor (java.awt.Color@w{ }@var{color})
-
-@end deftypemethod
-@deftypemethod Graphics {public abstract void} setPaintMode ()
-
-@end deftypemethod
-@deftypemethod Graphics {public abstract void} setXORMode (java.awt.Color@w{ }@var{altColor})
-
-@end deftypemethod
-@deftypemethod Graphics {public abstract Font} getFont ()
-
-@end deftypemethod
-@deftypemethod Graphics {public abstract void} setFont (java.awt.Font@w{ }@var{font})
-
-@end deftypemethod
-@deftypemethod Graphics {public FontMetrics} getFontMetrics ()
-
-@end deftypemethod
-@deftypemethod Graphics {public abstract FontMetrics} getFontMetrics (java.awt.Font@w{ }@var{font})
-
-@end deftypemethod
-@deftypemethod Graphics {public abstract Rectangle} getClipBounds ()
-
-@end deftypemethod
-@deftypemethod Graphics {public abstract void} clipRect (int@w{ }@var{x}, int@w{ }@var{y}, int@w{ }@var{width}, int@w{ }@var{height})
-
-@end deftypemethod
-@deftypemethod Graphics {public abstract void} setClip (int@w{ }@var{x}, int@w{ }@var{y}, int@w{ }@var{width}, int@w{ }@var{height})
-
-@end deftypemethod
-@deftypemethod Graphics {public abstract Shape} getClip ()
-
-@end deftypemethod
-@deftypemethod Graphics {public abstract void} setClip (java.awt.Shape@w{ }@var{clip})
-
-@end deftypemethod
-@deftypemethod Graphics {public abstract void} copyArea (int@w{ }@var{x}, int@w{ }@var{y}, int@w{ }@var{width}, int@w{ }@var{height}, int@w{ }@var{dx}, int@w{ }@var{dy})
-
-@end deftypemethod
-@deftypemethod Graphics {public abstract void} drawLine (int@w{ }@var{x1}, int@w{ }@var{y1}, int@w{ }@var{x2}, int@w{ }@var{y2})
-
-@end deftypemethod
-@deftypemethod Graphics {public abstract void} fillRect (int@w{ }@var{x}, int@w{ }@var{y}, int@w{ }@var{width}, int@w{ }@var{height})
-
-@end deftypemethod
-@deftypemethod Graphics {public void} drawRect (int@w{ }@var{x}, int@w{ }@var{y}, int@w{ }@var{width}, int@w{ }@var{height})
-
-@end deftypemethod
-@deftypemethod Graphics {public abstract void} clearRect (int@w{ }@var{x}, int@w{ }@var{y}, int@w{ }@var{width}, int@w{ }@var{height})
-
-@end deftypemethod
-@deftypemethod Graphics {public abstract void} drawRoundRect (int@w{ }@var{x}, int@w{ }@var{y}, int@w{ }@var{width}, int@w{ }@var{height}, int@w{ }@var{arcWidth}, int@w{ }@var{arcHeight})
-
-@end deftypemethod
-@deftypemethod Graphics {public abstract void} fillRoundRect (int@w{ }@var{x}, int@w{ }@var{y}, int@w{ }@var{width}, int@w{ }@var{height}, int@w{ }@var{arcWidth}, int@w{ }@var{arcHeight})
-
-@end deftypemethod
-@deftypemethod Graphics {public void} draw3DRect (int@w{ }@var{x}, int@w{ }@var{y}, int@w{ }@var{width}, int@w{ }@var{height}, boolean@w{ }@var{raised})
-
-@end deftypemethod
-@deftypemethod Graphics {public void} fill3DRect (int@w{ }@var{x}, int@w{ }@var{y}, int@w{ }@var{width}, int@w{ }@var{height}, boolean@w{ }@var{raised})
-
-@end deftypemethod
-@deftypemethod Graphics {public abstract void} drawOval (int@w{ }@var{x}, int@w{ }@var{y}, int@w{ }@var{width}, int@w{ }@var{height})
-
-@end deftypemethod
-@deftypemethod Graphics {public abstract void} fillOval (int@w{ }@var{x}, int@w{ }@var{y}, int@w{ }@var{width}, int@w{ }@var{height})
-
-@end deftypemethod
-@deftypemethod Graphics {public abstract void} drawArc (int@w{ }@var{x}, int@w{ }@var{y}, int@w{ }@var{width}, int@w{ }@var{height}, int@w{ }@var{startAngle}, int@w{ }@var{arcAngle})
-
-@end deftypemethod
-@deftypemethod Graphics {public abstract void} fillArc (int@w{ }@var{x}, int@w{ }@var{y}, int@w{ }@var{width}, int@w{ }@var{height}, int@w{ }@var{startAngle}, int@w{ }@var{arcAngle})
-
-@end deftypemethod
-@deftypemethod Graphics {public abstract void} drawPolyline (int[]@w{ }@var{xPoints}, int[]@w{ }@var{yPoints}, int@w{ }@var{nPoints})
-
-@end deftypemethod
-@deftypemethod Graphics {public abstract void} drawPolygon (int[]@w{ }@var{xPoints}, int[]@w{ }@var{yPoints}, int@w{ }@var{nPoints})
-
-@end deftypemethod
-@deftypemethod Graphics {public abstract void} fillPolygon (int[]@w{ }@var{xPoints}, int[]@w{ }@var{yPoints}, int@w{ }@var{nPoints})
-
-@end deftypemethod
-@deftypemethod Graphics {public abstract void} drawString (java.lang.String@w{ }@var{str}, int@w{ }@var{x}, int@w{ }@var{y})
-
-@end deftypemethod
-@deftypemethod Graphics {public void} drawChars (char[]@w{ }@var{data}, int@w{ }@var{offset}, int@w{ }@var{length}, int@w{ }@var{x}, int@w{ }@var{y})
-
-@end deftypemethod
-@deftypemethod Graphics {public void} drawBytes (byte[]@w{ }@var{data}, int@w{ }@var{offset}, int@w{ }@var{length}, int@w{ }@var{x}, int@w{ }@var{y})
-
-@end deftypemethod
-@deftypemethod Graphics {public abstract boolean} drawImage (java.awt.Image@w{ }@var{img}, int@w{ }@var{x}, int@w{ }@var{y}, java.awt.image.ImageObserver@w{ }@var{observer})
-
-@end deftypemethod
-@deftypemethod Graphics {public abstract boolean} drawImage (java.awt.Image@w{ }@var{img}, int@w{ }@var{x}, int@w{ }@var{y}, int@w{ }@var{width}, int@w{ }@var{height}, java.awt.image.ImageObserver@w{ }@var{observer})
-
-@end deftypemethod
-@deftypemethod Graphics {public abstract boolean} drawImage (java.awt.Image@w{ }@var{img}, int@w{ }@var{x}, int@w{ }@var{y}, java.awt.Color@w{ }@var{bgcolor}, java.awt.image.ImageObserver@w{ }@var{observer})
-
-@end deftypemethod
-@deftypemethod Graphics {public abstract boolean} drawImage (java.awt.Image@w{ }@var{img}, int@w{ }@var{x}, int@w{ }@var{y}, int@w{ }@var{width}, int@w{ }@var{height}, java.awt.Color@w{ }@var{bgcolor}, java.awt.image.ImageObserver@w{ }@var{observer})
-
-@end deftypemethod
-@deftypemethod Graphics {public abstract boolean} drawImage (java.awt.Image@w{ }@var{img}, int@w{ }@var{dx1}, int@w{ }@var{dy1}, int@w{ }@var{dx2}, int@w{ }@var{dy2}, int@w{ }@var{sx1}, int@w{ }@var{sy1}, int@w{ }@var{sx2}, int@w{ }@var{sy2}, java.awt.image.ImageObserver@w{ }@var{observer})
-
-@end deftypemethod
-@deftypemethod Graphics {public abstract boolean} drawImage (java.awt.Image@w{ }@var{img}, int@w{ }@var{dx1}, int@w{ }@var{dy1}, int@w{ }@var{dx2}, int@w{ }@var{dy2}, int@w{ }@var{sx1}, int@w{ }@var{sy1}, int@w{ }@var{sx2}, int@w{ }@var{sy2}, java.awt.Color@w{ }@var{bgcolor}, java.awt.image.ImageObserver@w{ }@var{observer})
-
-@end deftypemethod
-@deftypemethod Graphics {public abstract void} dispose ()
-
-@end deftypemethod
-@deftypemethod Graphics {public void} finalize ()
-
-@end deftypemethod
-@deftypemethod Graphics {public String} toString ()
-
-@end deftypemethod
-@deftypemethod Graphics {public Rectangle} getClipRect ()
-
-@end deftypemethod
-@deftypemethod Graphics {public boolean} hitClip (int@w{ }@var{x}, int@w{ }@var{y}, int@w{ }@var{width}, int@w{ }@var{height})
-
-@end deftypemethod
-@deftypemethod Graphics {public Rectangle} getClipBounds (java.awt.Rectangle@w{ }@var{r})
-
-@end deftypemethod
-@deftypemethod GridBagConstraints {public Object} clone ()
-Create a copy of this object.
-@end deftypemethod
-@deftypemethod GridLayout {public void} addLayoutComponent (java.lang.String@w{ }@var{name}, java.awt.Component@w{ }@var{comp})
-Add a new component to the layout. This particular implementation
- does nothing.
-@end deftypemethod
-@deftypemethod GridLayout {public int} getColumns ()
-Return the number of columns in this layout.
-@end deftypemethod
-@deftypemethod GridLayout {public int} getHgap ()
-Return the horizontal gap.
-@end deftypemethod
-@deftypemethod GridLayout {public int} getRows ()
-Return the number of rows in this layout.
-@end deftypemethod
-@deftypemethod GridLayout {public int} getVgap ()
-Return the vertical gap.
-@end deftypemethod
-@deftypemethod GridLayout {public void} layoutContainer (java.awt.Container@w{ }@var{parent})
-Lay out the container's components based on current settings.
-@end deftypemethod
-@deftypemethod GridLayout {public Dimension} minimumLayoutSize (java.awt.Container@w{ }@var{cont})
-Get the minimum layout size of the container.
-@end deftypemethod
-@deftypemethod GridLayout {public Dimension} preferredLayoutSize (java.awt.Container@w{ }@var{cont})
-Get the preferred layout size of the container.
-@end deftypemethod
-@deftypemethod GridLayout {public void} removeLayoutComponent (java.awt.Component@w{ }@var{comp})
-Remove the indicated component from this layout manager.
- This particular implementation does nothing.
-@end deftypemethod
-@deftypemethod GridLayout {public void} setColumns (int@w{ }@var{newCols})
-Set the number of columns.
-@end deftypemethod
-@deftypemethod GridLayout {public void} setHgap (int@w{ }@var{hgap})
-Set the horizontal gap
-@end deftypemethod
-@deftypemethod GridLayout {public void} setRows (int@w{ }@var{newRows})
-Set the number of rows
-@end deftypemethod
-@deftypemethod GridLayout {public void} setVgap (int@w{ }@var{vgap})
-Set the vertical gap.
-@end deftypemethod
-@deftypemethod GridLayout {public String} toString ()
-Return String description of this object.
-@end deftypemethod
-@deftypemethod Image {public abstract int} getWidth (java.awt.image.ImageObserver@w{ }@var{observer})
-
-@end deftypemethod
-@deftypemethod Image {public abstract int} getHeight (java.awt.image.ImageObserver@w{ }@var{observer})
-
-@end deftypemethod
-@deftypemethod Image {public abstract ImageProducer} getSource ()
-
-@end deftypemethod
-@deftypemethod Image {public abstract Graphics} getGraphics ()
-
-@end deftypemethod
-@deftypemethod Image {public abstract Object} getProperty (java.lang.String@w{ }@var{name}, java.awt.image.ImageObserver@w{ }@var{observer})
-
-@end deftypemethod
-@deftypemethod Image {public Image} getScaledInstance (int@w{ }@var{width}, int@w{ }@var{height}, int@w{ }@var{hints})
-
-@end deftypemethod
-@deftypemethod Image {public abstract void} flush ()
-
-@end deftypemethod
-@deftypemethod Insets {public boolean} equals (java.lang.Object@w{ }@var{obj})
-
-@end deftypemethod
-@deftypemethod Insets {public int} hashCode ()
-
-@end deftypemethod
-@deftypemethod Insets {public String} toString ()
-
-@end deftypemethod
-@deftypemethod Insets {public Object} clone ()
-
-@end deftypemethod
-@deftypemethod ItemSelectable {public void} addItemListener (java.awt.event.ItemListener@w{ }@var{l})
-This method adds a listener to receive item events fired by the
- component.
-@end deftypemethod
-@deftypemethod ItemSelectable {public Object} getSelectedObjects ()
-This method returns the items in this component which are
- currently selected.
-@end deftypemethod
-@deftypemethod ItemSelectable {public void} removeItemListener (java.awt.event.ItemListener@w{ }@var{l})
-This method removes an item listener.
-@end deftypemethod
-@deftypemethod Label {public void} addNotify ()
-
-@end deftypemethod
-@deftypemethod Label {public int} getAlignment ()
-
-@end deftypemethod
-@deftypemethod Label {public String} getText ()
-
-@end deftypemethod
-@deftypemethod Label {protected String} paramString ()
-
-@end deftypemethod
-@deftypemethod Label {public void} setAlignment (int@w{ }@var{alignment})
-
-@end deftypemethod
-@deftypemethod Label {public void} setText (java.lang.String@w{ }@var{text})
-
-@end deftypemethod
-@deftypemethod LayoutManager2 {public void} addLayoutComponent (java.awt.Component@w{ }@var{comp}, java.lang.Object@w{ }@var{constraints})
-
-@end deftypemethod
-@deftypemethod LayoutManager2 {public float} getLayoutAlignmentX (java.awt.Container@w{ }@var{target})
-
-@end deftypemethod
-@deftypemethod LayoutManager2 {public float} getLayoutAlignmentY (java.awt.Container@w{ }@var{target})
-
-@end deftypemethod
-@deftypemethod LayoutManager2 {public void} invalidateLayout (java.awt.Container@w{ }@var{target})
-
-@end deftypemethod
-@deftypemethod LayoutManager2 {public Dimension} maximumLayoutSize (java.awt.Container@w{ }@var{target})
-
-@end deftypemethod
-@deftypemethod LayoutManager {public void} addLayoutComponent (java.lang.String@w{ }@var{name}, java.awt.Component@w{ }@var{comp})
-
-@end deftypemethod
-@deftypemethod LayoutManager {public void} layoutContainer (java.awt.Container@w{ }@var{parent})
-
-@end deftypemethod
-@deftypemethod LayoutManager {public Dimension} minimumLayoutSize (java.awt.Container@w{ }@var{parent})
-
-@end deftypemethod
-@deftypemethod LayoutManager {public Dimension} preferredLayoutSize (java.awt.Container@w{ }@var{parent})
-
-@end deftypemethod
-@deftypemethod LayoutManager {public void} removeLayoutComponent (java.awt.Component@w{ }@var{comp})
-
-@end deftypemethod
-@deftypemethod MenuBar {public synchronized Menu} add (java.awt.Menu@w{ }@var{menu})
-Add a menu to this MenuBar. If the menu has already has a
- parent, it is first removed from its old parent before being
- added.
-@end deftypemethod
-@deftypemethod MenuBar {public void} addNotify ()
-This creates the component's peer.
-@end deftypemethod
-@deftypemethod MenuBar {public int} countMenus ()
-
-@end deftypemethod
-@deftypemethod MenuBar {public void} deleteShortcut (java.awt.MenuShortcut@w{ }@var{shortcut})
-Delete a keyboard shortcut.
-@end deftypemethod
-@deftypemethod MenuBar {public Menu} getHelpMenu ()
-Returns the current Help menu.
-@end deftypemethod
-@deftypemethod MenuBar {public Menu} getMenu (int@w{ }@var{index})
-Returns a menu from this object.
-@end deftypemethod
-@deftypemethod MenuBar {public int} getMenuCount ()
-Returns the number of menus on this MenuBar.
-@end deftypemethod
-@deftypemethod MenuBar {public MenuItem} getShortcutMenuItem (java.awt.MenuShortcut@w{ }@var{shortcut})
-Returns the menu item on this MenuBar with the specified
- shortcut.
-@end deftypemethod
-@deftypemethod MenuBar {public synchronized void} remove (java.awt.MenuComponent@w{ }@var{menu})
-Remove a menu from the menu bar. If the menu is specified by
- component (and not index), and does not exist on the menu, then
- the method does nothing. If the removed menu has a peer, it is
- destroyed.
-@end deftypemethod
-@deftypemethod MenuBar {public synchronized void} remove (int@w{ }@var{index})
-
-@end deftypemethod
-@deftypemethod MenuBar {public synchronized void} setHelpMenu (java.awt.Menu@w{ }@var{menu})
-Set the Help menu for this MenuBar. If a Help menu already
- exists, it is first removed.
-@end deftypemethod
-@deftypemethod MenuBar {public synchronized Enumeration} shortcuts ()
-Returns an Enumeration which lists the keyboard shortcuts
- associated with menu items on this MenuBar.
-@end deftypemethod
-@deftypemethod MenuComponent {public String} getName ()
-
-@end deftypemethod
-@deftypemethod MenuComponent {public void} setName (java.lang.String@w{ }@var{name})
-
-@end deftypemethod
-@deftypemethod MenuComponent {public MenuContainer} getParent ()
-
-@end deftypemethod
-@deftypemethod MenuComponent {public MenuComponentPeer} getPeer ()
-
-@end deftypemethod
-@deftypemethod MenuComponent {public Font} getFont ()
-
-@end deftypemethod
-@deftypemethod MenuComponent {public void} setFont (java.awt.Font@w{ }@var{f})
-
-@end deftypemethod
-@deftypemethod MenuComponent {public void} removeNotify ()
-
-@end deftypemethod
-@deftypemethod MenuComponent {public boolean} postEvent (java.awt.Event@w{ }@var{evt})
-
-@end deftypemethod
-@deftypemethod MenuComponent {public final void} dispatchEvent (java.awt.AWTEvent@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod MenuComponent {protected void} processEvent (java.awt.AWTEvent@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod MenuComponent {protected String} paramString ()
-
-@end deftypemethod
-@deftypemethod MenuComponent {public String} toString ()
-
-@end deftypemethod
-@deftypemethod MenuComponent {protected final Object} getTreeLock ()
-
-@end deftypemethod
-@deftypemethod MenuContainer {public Font} getFont ()
-
-@end deftypemethod
-@deftypemethod MenuContainer {public boolean} postEvent (java.awt.Event@w{ }@var{evt})
-
-@end deftypemethod
-@deftypemethod MenuContainer {public void} remove (java.awt.MenuComponent@w{ }@var{comp})
-
-@end deftypemethod
-@deftypemethod MenuItem {public String} getLabel ()
-
-@end deftypemethod
-@deftypemethod MenuItem {public synchronized void} setLabel (java.lang.String@w{ }@var{label})
-
-@end deftypemethod
-@deftypemethod MenuItem {public boolean} isEnabled ()
-
-@end deftypemethod
-@deftypemethod MenuItem {public synchronized void} setEnabled (boolean@w{ }@var{b})
-
-@end deftypemethod
-@deftypemethod MenuItem {public void} enable ()
-
-@end deftypemethod
-@deftypemethod MenuItem {public void} enable (boolean@w{ }@var{b})
-
-@end deftypemethod
-@deftypemethod MenuItem {public void} disable ()
-
-@end deftypemethod
-@deftypemethod MenuItem {public MenuShortcut} getShortcut ()
-
-@end deftypemethod
-@deftypemethod MenuItem {public void} setShortcut (java.awt.MenuShortcut@w{ }@var{s})
-
-@end deftypemethod
-@deftypemethod MenuItem {public void} deleteShortcut ()
-
-@end deftypemethod
-@deftypemethod MenuItem {protected final void} enableEvents (long@w{ }@var{eventsToEnable})
-
-@end deftypemethod
-@deftypemethod MenuItem {protected final void} disableEvents (long@w{ }@var{eventsToDisable})
-
-@end deftypemethod
-@deftypemethod MenuItem {public void} setActionCommand (java.lang.String@w{ }@var{command})
-
-@end deftypemethod
-@deftypemethod MenuItem {public String} getActionCommand ()
-
-@end deftypemethod
-@deftypemethod MenuItem {public synchronized void} addActionListener (java.awt.event.ActionListener@w{ }@var{l})
-
-@end deftypemethod
-@deftypemethod MenuItem {public synchronized void} removeActionListener (java.awt.event.ActionListener@w{ }@var{l})
-
-@end deftypemethod
-@deftypemethod MenuItem {public void} addNotify ()
-
-@end deftypemethod
-@deftypemethod MenuItem {public EventListener} getListeners (java.lang.Class@w{ }@var{listenerType})
-Returns all registered EventListers of the given listenerType.
- listenerType must be a subclass of EventListener, or a
- ClassClassException is thrown.
-@end deftypemethod
-@deftypemethod MenuItem {protected void} processEvent (java.awt.AWTEvent@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod MenuItem {protected void} processActionEvent (java.awt.event.ActionEvent@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod MenuItem {public String} paramString ()
-
-@end deftypemethod
-@deftypemethod Menu {public void} addNotify ()
-
-@end deftypemethod
-@deftypemethod Menu {public void} removeNotify ()
-
-@end deftypemethod
-@deftypemethod Menu {public boolean} isTearOff ()
-
-@end deftypemethod
-@deftypemethod Menu {public int} getItemCount ()
-
-@end deftypemethod
-@deftypemethod Menu {public int} countItems ()
-
-@end deftypemethod
-@deftypemethod Menu {public MenuItem} getItem (int@w{ }@var{index})
-
-@end deftypemethod
-@deftypemethod Menu {public synchronized MenuItem} add (java.awt.MenuItem@w{ }@var{mi})
-
-@end deftypemethod
-@deftypemethod Menu {public void} add (java.lang.String@w{ }@var{label})
-
-@end deftypemethod
-@deftypemethod Menu {public synchronized void} insert (java.awt.MenuItem@w{ }@var{menuitem}, int@w{ }@var{index})
-
-@end deftypemethod
-@deftypemethod Menu {public void} insert (java.lang.String@w{ }@var{label}, int@w{ }@var{index})
-
-@end deftypemethod
-@deftypemethod Menu {public void} addSeparator ()
-
-@end deftypemethod
-@deftypemethod Menu {public void} insertSeparator (int@w{ }@var{index})
-
-@end deftypemethod
-@deftypemethod Menu {public synchronized void} remove (int@w{ }@var{index})
-
-@end deftypemethod
-@deftypemethod Menu {public synchronized void} remove (java.awt.MenuComponent@w{ }@var{item})
-
-@end deftypemethod
-@deftypemethod Menu {public synchronized void} removeAll ()
-
-@end deftypemethod
-@deftypemethod Menu {public String} paramString ()
-
-@end deftypemethod
-@deftypemethod MenuShortcut {public int} getKey ()
-
-@end deftypemethod
-@deftypemethod MenuShortcut {public boolean} usesShiftModifier ()
-
-@end deftypemethod
-@deftypemethod MenuShortcut {public boolean} equals (java.awt.MenuShortcut@w{ }@var{ms})
-
-@end deftypemethod
-@deftypemethod MenuShortcut {public boolean} equals (java.lang.Object@w{ }@var{obj})
-
-@end deftypemethod
-@deftypemethod MenuShortcut {public int} hashCode ()
-
-@end deftypemethod
-@deftypemethod MenuShortcut {public String} toString ()
-
-@end deftypemethod
-@deftypemethod MenuShortcut {protected String} paramString ()
-
-@end deftypemethod
-@deftypemethod PaintContext {public void} dispose ()
-
-@end deftypemethod
-@deftypemethod Panel {public void} addNotify ()
-
-@end deftypemethod
-@deftypemethod Point {public boolean} equals (java.lang.Object@w{ }@var{obj})
-
-@end deftypemethod
-@deftypemethod Point {public int} hashCode ()
-
-@end deftypemethod
-@deftypemethod Point {public Point} getLocation ()
-
-@end deftypemethod
-@deftypemethod Point {public void} move (int@w{ }@var{x}, int@w{ }@var{y})
-
-@end deftypemethod
-@deftypemethod Point {public void} setLocation (int@w{ }@var{x}, int@w{ }@var{y})
-
-@end deftypemethod
-@deftypemethod Point {public void} setLocation (java.awt.Point@w{ }@var{pt})
-
-@end deftypemethod
-@deftypemethod Point {public void} translate (int@w{ }@var{x}, int@w{ }@var{y})
-
-@end deftypemethod
-@deftypemethod Point {public String} toString ()
-
-@end deftypemethod
-@deftypemethod Point {public double} getX ()
-
-@end deftypemethod
-@deftypemethod Point {public double} getY ()
-
-@end deftypemethod
-@deftypemethod Point {public void} setLocation (double@w{ }@var{x}, double@w{ }@var{y})
-
-@end deftypemethod
-@deftypemethod PopupMenu {public void} addNotify ()
-
-@end deftypemethod
-@deftypemethod PopupMenu {public void} show (java.awt.Component@w{ }@var{origin}, int@w{ }@var{x}, int@w{ }@var{y})
-
-@end deftypemethod
-@deftypemethod Rectangle {public Rectangle} getBounds ()
-
-@end deftypemethod
-@deftypemethod Rectangle {public void} add (int@w{ }@var{newx}, int@w{ }@var{newy})
-
-@end deftypemethod
-@deftypemethod Rectangle {public void} add (java.awt.Point@w{ }@var{pt})
-
-@end deftypemethod
-@deftypemethod Rectangle {public void} add (java.awt.Rectangle@w{ }@var{r})
-
-@end deftypemethod
-@deftypemethod Rectangle {public boolean} contains (int@w{ }@var{x}, int@w{ }@var{y})
-
-@end deftypemethod
-@deftypemethod Rectangle {public boolean} contains (int@w{ }@var{x}, int@w{ }@var{y}, int@w{ }@var{w}, int@w{ }@var{h})
-
-@end deftypemethod
-@deftypemethod Rectangle {public boolean} contains (java.awt.Point@w{ }@var{p})
-
-@end deftypemethod
-@deftypemethod Rectangle {public boolean} contains (java.awt.Rectangle@w{ }@var{r})
-
-@end deftypemethod
-@deftypemethod Rectangle {public boolean} equals (java.lang.Object@w{ }@var{obj})
-
-@end deftypemethod
-@deftypemethod Rectangle {public double} getHeight ()
-
-@end deftypemethod
-@deftypemethod Rectangle {public Point} getLocation ()
-
-@end deftypemethod
-@deftypemethod Rectangle {public PathIterator} getPathIterator (java.awt.geom.AffineTransform@w{ }@var{t})
-
-@end deftypemethod
-@deftypemethod Rectangle {public Dimension} getSize ()
-
-@end deftypemethod
-@deftypemethod Rectangle {public double} getWidth ()
-
-@end deftypemethod
-@deftypemethod Rectangle {public double} getX ()
-
-@end deftypemethod
-@deftypemethod Rectangle {public double} getY ()
-
-@end deftypemethod
-@deftypemethod Rectangle {public void} grow (int@w{ }@var{h}, int@w{ }@var{v})
-
-@end deftypemethod
-@deftypemethod Rectangle {public boolean} inside (int@w{ }@var{x}, int@w{ }@var{y})
-
-@end deftypemethod
-@deftypemethod Rectangle {public Rectangle} intersection (java.awt.Rectangle@w{ }@var{r})
-
-@end deftypemethod
-@deftypemethod Rectangle {public boolean} intersects (java.awt.Rectangle@w{ }@var{r})
-
-@end deftypemethod
-@deftypemethod Rectangle {public boolean} isEmpty ()
-
-@end deftypemethod
-@deftypemethod Rectangle {public void} move (int@w{ }@var{x}, int@w{ }@var{y})
-
-@end deftypemethod
-@deftypemethod Rectangle {public int} outcode (double@w{ }@var{x}, double@w{ }@var{y})
-
-@end deftypemethod
-@deftypemethod Rectangle {public void} reshape (int@w{ }@var{x}, int@w{ }@var{y}, int@w{ }@var{width}, int@w{ }@var{height})
-
-@end deftypemethod
-@deftypemethod Rectangle {public void} resize (int@w{ }@var{width}, int@w{ }@var{height})
-
-@end deftypemethod
-@deftypemethod Rectangle {public void} setBounds (int@w{ }@var{x}, int@w{ }@var{y}, int@w{ }@var{width}, int@w{ }@var{height})
-
-@end deftypemethod
-@deftypemethod Rectangle {public void} setBounds (java.awt.Rectangle@w{ }@var{r})
-
-@end deftypemethod
-@deftypemethod Rectangle {public void} setLocation (int@w{ }@var{x}, int@w{ }@var{y})
-
-@end deftypemethod
-@deftypemethod Rectangle {public void} setLocation (java.awt.Point@w{ }@var{p})
-
-@end deftypemethod
-@deftypemethod Rectangle {public void} setRect (double@w{ }@var{x}, double@w{ }@var{y}, double@w{ }@var{width}, double@w{ }@var{height})
-
-@end deftypemethod
-@deftypemethod Rectangle {public void} setSize (java.awt.Dimension@w{ }@var{d})
-
-@end deftypemethod
-@deftypemethod Rectangle {public void} setSize (int@w{ }@var{width}, int@w{ }@var{height})
-
-@end deftypemethod
-@deftypemethod Rectangle {public void} translate (int@w{ }@var{x}, int@w{ }@var{y})
-
-@end deftypemethod
-@deftypemethod Rectangle {public Rectangle} union (java.awt.Rectangle@w{ }@var{r})
-
-@end deftypemethod
-@deftypemethod Rectangle {public Rectangle2D} createIntersection (java.awt.geom.Rectangle2D@w{ }@var{r})
-
-@end deftypemethod
-@deftypemethod Rectangle {public Rectangle2D} createUnion (java.awt.geom.Rectangle2D@w{ }@var{r})
-
-@end deftypemethod
-@deftypemethod Rectangle {public Rectangle2D} getBounds2D ()
-
-@end deftypemethod
-@deftypemethod Rectangle {public String} toString ()
-
-@end deftypemethod
-@deftypemethod RenderingHints {public int} size ()
-
-@end deftypemethod
-@deftypemethod RenderingHints {public boolean} isEmpty ()
-
-@end deftypemethod
-@deftypemethod RenderingHints {public boolean} containsKey (java.lang.Object@w{ }@var{key})
-
-@end deftypemethod
-@deftypemethod RenderingHints {public boolean} containsValue (java.lang.Object@w{ }@var{value})
-
-@end deftypemethod
-@deftypemethod RenderingHints {public Object} get (java.lang.Object@w{ }@var{key})
-
-@end deftypemethod
-@deftypemethod RenderingHints {public Object} put (java.lang.Object@w{ }@var{key}, java.lang.Object@w{ }@var{value})
-
-@end deftypemethod
-@deftypemethod RenderingHints {public void} add (java.awt.RenderingHints@w{ }@var{hints})
-
-@end deftypemethod
-@deftypemethod RenderingHints {public void} clear ()
-
-@end deftypemethod
-@deftypemethod RenderingHints {public Object} remove (java.lang.Object@w{ }@var{key})
-
-@end deftypemethod
-@deftypemethod RenderingHints {public boolean} equals (java.lang.Object@w{ }@var{o})
-
-@end deftypemethod
-@deftypemethod RenderingHints {public int} hashCode ()
-
-@end deftypemethod
-@deftypemethod RenderingHints {public Object} clone ()
-
-@end deftypemethod
-@deftypemethod RenderingHints {public String} toString ()
-
-@end deftypemethod
-@deftypemethod Scrollbar {public void} addNotify ()
-
-@end deftypemethod
-@deftypemethod Scrollbar {public int} getOrientation ()
-
-@end deftypemethod
-@deftypemethod Scrollbar {public void} setOrientation (int@w{ }@var{orientation})
-
-@end deftypemethod
-@deftypemethod Scrollbar {public int} getValue ()
-
-@end deftypemethod
-@deftypemethod Scrollbar {public void} setValue (int@w{ }@var{value})
-
-@end deftypemethod
-@deftypemethod Scrollbar {public int} getMinimum ()
-
-@end deftypemethod
-@deftypemethod Scrollbar {public void} setMinimum (int@w{ }@var{minimum})
-
-@end deftypemethod
-@deftypemethod Scrollbar {public int} getMaximum ()
-
-@end deftypemethod
-@deftypemethod Scrollbar {public void} setMaximum (int@w{ }@var{maximum})
-
-@end deftypemethod
-@deftypemethod Scrollbar {public int} getVisibleAmount ()
-
-@end deftypemethod
-@deftypemethod Scrollbar {public int} getVisible ()
-
-@end deftypemethod
-@deftypemethod Scrollbar {public void} setVisibleAmount (int@w{ }@var{visible})
-
-@end deftypemethod
-@deftypemethod Scrollbar {public void} setUnitIncrement (int@w{ }@var{v})
-
-@end deftypemethod
-@deftypemethod Scrollbar {public void} setLineIncrement (int@w{ }@var{v})
-
-@end deftypemethod
-@deftypemethod Scrollbar {public int} getUnitIncrement ()
-
-@end deftypemethod
-@deftypemethod Scrollbar {public int} getLineIncrement ()
-
-@end deftypemethod
-@deftypemethod Scrollbar {public void} setBlockIncrement (int@w{ }@var{v})
-
-@end deftypemethod
-@deftypemethod Scrollbar {public void} setPageIncrement (int@w{ }@var{v})
-
-@end deftypemethod
-@deftypemethod Scrollbar {public int} getBlockIncrement ()
-
-@end deftypemethod
-@deftypemethod Scrollbar {public int} getPageIncrement ()
-
-@end deftypemethod
-@deftypemethod Scrollbar {public synchronized void} setValues (int@w{ }@var{value}, int@w{ }@var{visible}, int@w{ }@var{minimum}, int@w{ }@var{maximum})
-
-@end deftypemethod
-@deftypemethod Scrollbar {public void} addAdjustmentListener (java.awt.event.AdjustmentListener@w{ }@var{l})
-
-@end deftypemethod
-@deftypemethod Scrollbar {public void} removeAdjustmentListener (java.awt.event.AdjustmentListener@w{ }@var{l})
-
-@end deftypemethod
-@deftypemethod Scrollbar {protected void} processEvent (java.awt.AWTEvent@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod Scrollbar {protected void} processAdjustmentEvent (java.awt.event.AdjustmentEvent@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod Scrollbar {protected String} paramString ()
-
-@end deftypemethod
-@deftypemethod ScrollPane {protected final void} addImpl (java.awt.Component@w{ }@var{comp}, java.lang.Object@w{ }@var{constraints}, int@w{ }@var{pos})
-Add a component to this ScrollPane.
-@end deftypemethod
-@deftypemethod ScrollPane {public void} addNotify ()
-This creates the component's peer.
-@end deftypemethod
-@deftypemethod ScrollPane {public void} doLayout ()
-Lays out the components in this container.
-@end deftypemethod
-@deftypemethod ScrollPane {public Adjustable} getHAdjustable ()
-Returns an Adjustable representing the horizontal scrollbar.
- The methods setMaximum, setMinimum, and setVisibleAmount should
- not be called on this Adjustable. They will throw AWTError if
- called.
-@end deftypemethod
-@deftypemethod ScrollPane {public int} getHScrollbarHeight ()
-Returns the height of the horizontal scrollbar.
-@end deftypemethod
-@deftypemethod ScrollPane {public int} getScrollbarDisplayPolicy ()
-Returns the scrollbar display policy.
-@end deftypemethod
-@deftypemethod ScrollPane {public Point} getScrollPosition ()
-Returns the viewport's scroll position.
-@end deftypemethod
-@deftypemethod ScrollPane {public Adjustable} getVAdjustable ()
-Returns an Adjustable representing the vertical scrollbar.
- The methods setMaximum, setMinimum, and setVisibleAmount should
- not be called on this Adjustable. They will throw AWTError if
- called.
-@end deftypemethod
-@deftypemethod ScrollPane {public Dimension} getViewportSize ()
-Returns the size of the viewport.
-@end deftypemethod
-@deftypemethod ScrollPane {public int} getVScrollbarWidth ()
-Returns the width of the vertical scrollbar.
-@end deftypemethod
-@deftypemethod ScrollPane {public String} paramString ()
-Generates a String representation of this ScrollPane's state.
-@end deftypemethod
-@deftypemethod ScrollPane {public final void} setLayout (java.awt.LayoutManager@w{ }@var{m})
-Set the layout manager for this component. ScrollPane has its
- own layout manager and overrides this method so that the layout
- manager cannot be changed.
-@end deftypemethod
-@deftypemethod ScrollPane {public void} setScrollPosition (int@w{ }@var{x}, int@w{ }@var{y})
-Sets the scroll position for this ScrollPane. If the point if
- out of range it is silently moved within range.
-@end deftypemethod
-@deftypemethod ScrollPane {public void} setScrollPosition (java.awt.Point@w{ }@var{p})
-Sets the scroll position for this ScrollPane. If the point if
- out of range it is silently moved within range.
-@end deftypemethod
-@deftypemethod Shape {public boolean} contains (double@w{ }@var{x}, double@w{ }@var{y})
-
-@end deftypemethod
-@deftypemethod Shape {public boolean} contains (double@w{ }@var{x}, double@w{ }@var{y}, double@w{ }@var{w}, double@w{ }@var{h})
-
-@end deftypemethod
-@deftypemethod Shape {public boolean} contains (java.awt.geom.Point2D@w{ }@var{p})
-
-@end deftypemethod
-@deftypemethod Shape {public boolean} contains (java.awt.geom.Rectangle2D@w{ }@var{r})
-
-@end deftypemethod
-@deftypemethod Shape {public Rectangle} getBounds ()
-
-@end deftypemethod
-@deftypemethod Shape {public Rectangle2D} getBounds2D ()
-
-@end deftypemethod
-@deftypemethod Shape {public PathIterator} getPathIterator (java.awt.geom.AffineTransform@w{ }@var{at})
-
-@end deftypemethod
-@deftypemethod Shape {public PathIterator} getPathIterator (java.awt.geom.AffineTransform@w{ }@var{at}, double@w{ }@var{flatness})
-
-@end deftypemethod
-@deftypemethod Shape {public boolean} intersects (double@w{ }@var{x}, double@w{ }@var{y}, double@w{ }@var{w}, double@w{ }@var{h})
-
-@end deftypemethod
-@deftypemethod Shape {public boolean} intersects (java.awt.geom.Rectangle2D@w{ }@var{r})
-
-@end deftypemethod
-@deftypemethod SystemColor {public int} getRGB ()
-
-@end deftypemethod
-@deftypemethod SystemColor {public String} toString ()
-
-@end deftypemethod
-@deftypemethod TextArea {public synchronized void} append (java.lang.String@w{ }@var{str})
-
-@end deftypemethod
-@deftypemethod TextArea {public synchronized void} insert (java.lang.String@w{ }@var{str}, int@w{ }@var{pos})
-
-@end deftypemethod
-@deftypemethod TextArea {public synchronized void} replaceRange (java.lang.String@w{ }@var{str}, int@w{ }@var{start}, int@w{ }@var{end})
-
-@end deftypemethod
-@deftypemethod TextComponent {public synchronized String} getText ()
-
-@end deftypemethod
-@deftypemethod TextComponent {public synchronized void} setText (java.lang.String@w{ }@var{text})
-
-@end deftypemethod
-@deftypemethod TextComponent {public synchronized void} addTextListener (java.awt.event.TextListener@w{ }@var{listener})
-
-@end deftypemethod
-@deftypemethod TextComponent {public int} getCaretPosition ()
-
-@end deftypemethod
-@deftypemethod TextComponent {public void} setCaretPosition (int@w{ }@var{pos})
-
-@end deftypemethod
-@deftypemethod Toolkit {public static Toolkit} getDefaultToolkit ()
-
-@end deftypemethod
-@deftypemethod Toolkit {protected abstract ButtonPeer} createButton (java.awt.Button@w{ }@var{target})
-
-@end deftypemethod
-@deftypemethod Toolkit {protected abstract TextFieldPeer} createTextField (java.awt.TextField@w{ }@var{target})
-
-@end deftypemethod
-@deftypemethod Toolkit {protected abstract LabelPeer} createLabel (java.awt.Label@w{ }@var{target})
-
-@end deftypemethod
-@deftypemethod Toolkit {protected abstract ListPeer} createList (java.awt.List@w{ }@var{target})
-
-@end deftypemethod
-@deftypemethod Toolkit {protected abstract CheckboxPeer} createCheckbox (java.awt.Checkbox@w{ }@var{target})
-
-@end deftypemethod
-@deftypemethod Toolkit {protected abstract ScrollbarPeer} createScrollbar (java.awt.Scrollbar@w{ }@var{target})
-
-@end deftypemethod
-@deftypemethod Toolkit {protected abstract ScrollPanePeer} createScrollPane (java.awt.ScrollPane@w{ }@var{target})
-
-@end deftypemethod
-@deftypemethod Toolkit {protected abstract TextAreaPeer} createTextArea (java.awt.TextArea@w{ }@var{target})
-
-@end deftypemethod
-@deftypemethod Toolkit {protected abstract ChoicePeer} createChoice (java.awt.Choice@w{ }@var{target})
-
-@end deftypemethod
-@deftypemethod Toolkit {protected abstract FramePeer} createFrame (java.awt.Frame@w{ }@var{target})
-
-@end deftypemethod
-@deftypemethod Toolkit {protected abstract CanvasPeer} createCanvas (java.awt.Canvas@w{ }@var{target})
-
-@end deftypemethod
-@deftypemethod Toolkit {protected abstract PanelPeer} createPanel (java.awt.Panel@w{ }@var{target})
-
-@end deftypemethod
-@deftypemethod Toolkit {protected abstract WindowPeer} createWindow (java.awt.Window@w{ }@var{target})
-
-@end deftypemethod
-@deftypemethod Toolkit {protected abstract DialogPeer} createDialog (java.awt.Dialog@w{ }@var{target})
-
-@end deftypemethod
-@deftypemethod Toolkit {protected abstract MenuBarPeer} createMenuBar (java.awt.MenuBar@w{ }@var{target})
-
-@end deftypemethod
-@deftypemethod Toolkit {protected abstract MenuPeer} createMenu (java.awt.Menu@w{ }@var{target})
-
-@end deftypemethod
-@deftypemethod Toolkit {protected abstract PopupMenuPeer} createPopupMenu (java.awt.PopupMenu@w{ }@var{target})
-
-@end deftypemethod
-@deftypemethod Toolkit {protected abstract MenuItemPeer} createMenuItem (java.awt.MenuItem@w{ }@var{target})
-
-@end deftypemethod
-@deftypemethod Toolkit {protected abstract FileDialogPeer} createFileDialog (java.awt.FileDialog@w{ }@var{target})
-
-@end deftypemethod
-@deftypemethod Toolkit {protected abstract CheckboxMenuItemPeer} createCheckboxMenuItem (java.awt.CheckboxMenuItem@w{ }@var{target})
-
-@end deftypemethod
-@deftypemethod Toolkit {protected LightweightPeer} createComponent (java.awt.Component@w{ }@var{target})
-
-@end deftypemethod
-@deftypemethod Toolkit {protected abstract FontPeer} getFontPeer (java.lang.String@w{ }@var{name}, int@w{ }@var{style})
-
-@end deftypemethod
-@deftypemethod Toolkit {protected void} loadSystemColors (int[]@w{ }@var{systemColors})
-
-@end deftypemethod
-@deftypemethod Toolkit {public abstract Dimension} getScreenSize ()
-
-@end deftypemethod
-@deftypemethod Toolkit {public abstract int} getScreenResolution ()
-
-@end deftypemethod
-@deftypemethod Toolkit {public abstract ColorModel} getColorModel ()
-
-@end deftypemethod
-@deftypemethod Toolkit {public abstract String} getFontList ()
-
-@end deftypemethod
-@deftypemethod Toolkit {public abstract FontMetrics} getFontMetrics (java.awt.Font@w{ }@var{font})
-
-@end deftypemethod
-@deftypemethod Toolkit {public abstract void} sync ()
-
-@end deftypemethod
-@deftypemethod Toolkit {public abstract Image} getImage (java.lang.String@w{ }@var{filename})
-
-@end deftypemethod
-@deftypemethod Toolkit {public abstract Image} getImage (java.net.URL@w{ }@var{url})
-
-@end deftypemethod
-@deftypemethod Toolkit {public abstract Image} createImage (java.lang.String@w{ }@var{filename})
-
-@end deftypemethod
-@deftypemethod Toolkit {public abstract Image} createImage (java.net.URL@w{ }@var{url})
-
-@end deftypemethod
-@deftypemethod Toolkit {public abstract boolean} prepareImage (java.awt.Image@w{ }@var{image}, int@w{ }@var{width}, int@w{ }@var{height}, java.awt.image.ImageObserver@w{ }@var{observer})
-
-@end deftypemethod
-@deftypemethod Toolkit {public abstract int} checkImage (java.awt.Image@w{ }@var{image}, int@w{ }@var{width}, int@w{ }@var{height}, java.awt.image.ImageObserver@w{ }@var{observer})
-
-@end deftypemethod
-@deftypemethod Toolkit {public abstract Image} createImage (java.awt.image.ImageProducer@w{ }@var{producer})
-
-@end deftypemethod
-@deftypemethod Toolkit {public Image} createImage (byte[]@w{ }@var{imagedata})
-
-@end deftypemethod
-@deftypemethod Toolkit {public abstract Image} createImage (byte[]@w{ }@var{imagedata}, int@w{ }@var{imageoffset}, int@w{ }@var{imagelength})
-
-@end deftypemethod
-@deftypemethod Toolkit {public abstract void} beep ()
-
-@end deftypemethod
-@deftypemethod Toolkit {public abstract Clipboard} getSystemClipboard ()
-
-@end deftypemethod
-@deftypemethod Toolkit {public int} getMenuShortcutKeyMask ()
-
-@end deftypemethod
-@deftypemethod Toolkit {public boolean} getLockingKeyState (int@w{ }@var{keyCode})
-
-@end deftypemethod
-@deftypemethod Toolkit {public void} setLockingKeyState (int@w{ }@var{keyCode}, boolean@w{ }@var{on})
-
-@end deftypemethod
-@deftypemethod Toolkit {protected static Container} getNativeContainer (java.awt.Component@w{ }@var{c})
-
-@end deftypemethod
-@deftypemethod Toolkit {public Cursor} createCustomCursor (java.awt.Image@w{ }@var{cursor}, java.awt.Point@w{ }@var{hotSpot}, java.lang.String@w{ }@var{name}) @*throws IndexOutOfBoundsException
-
-@end deftypemethod
-@deftypemethod Toolkit {public Dimension} getBestCursorSize (int@w{ }@var{preferredWidth}, int@w{ }@var{preferredHeight})
-
-@end deftypemethod
-@deftypemethod Toolkit {public int} getMaximumCursorColors ()
-
-@end deftypemethod
-@deftypemethod Toolkit {public static String} getProperty (java.lang.String@w{ }@var{key}, java.lang.String@w{ }@var{defaultValue})
-
-@end deftypemethod
-@deftypemethod Toolkit {public final EventQueue} getSystemEventQueue ()
-
-@end deftypemethod
-@deftypemethod Toolkit {protected abstract EventQueue} getSystemEventQueueImpl ()
-
-@end deftypemethod
-@deftypemethod Toolkit {public final Object} getDesktopProperty (java.lang.String@w{ }@var{propertyName})
-
-@end deftypemethod
-@deftypemethod Toolkit {protected final void} setDesktopProperty (java.lang.String@w{ }@var{name}, java.lang.Object@w{ }@var{newValue})
-
-@end deftypemethod
-@deftypemethod Toolkit {protected Object} lazilyLoadDesktopProperty (java.lang.String@w{ }@var{name})
-
-@end deftypemethod
-@deftypemethod Toolkit {protected void} initializeDesktopProperties ()
-
-@end deftypemethod
-@deftypemethod Toolkit {public void} addPropertyChangeListener (java.lang.String@w{ }@var{name}, java.beans.PropertyChangeListener@w{ }@var{pcl})
-
-@end deftypemethod
-@deftypemethod Toolkit {public void} removePropertyChangeListener (java.lang.String@w{ }@var{name}, java.beans.PropertyChangeListener@w{ }@var{pcl})
-
-@end deftypemethod
-@deftypemethod Toolkit {public void} addAWTEventListener (java.awt.event.AWTEventListener@w{ }@var{listener}, long@w{ }@var{eventMask})
-
-@end deftypemethod
-@deftypemethod Toolkit {public void} removeAWTEventListener (java.awt.event.AWTEventListener@w{ }@var{listener})
-
-@end deftypemethod
-@deftypemethod Transparency {public int} getTransparency ()
-
-@end deftypemethod
-@deftypemethod Window {protected void} finalize () @*throws Throwable
-
-@end deftypemethod
-@deftypemethod Window {public void} addNotify ()
-
-@end deftypemethod
-@deftypemethod Window {public void} pack ()
-
-@end deftypemethod
-@deftypemethod Window {public void} show ()
-
-@end deftypemethod
-@deftypemethod Window {public void} hide ()
-
-@end deftypemethod
-@deftypemethod Window {public void} dispose ()
-
-@end deftypemethod
-@deftypemethod Window {public void} toBack ()
-
-@end deftypemethod
-@deftypemethod Window {public void} toFront ()
-
-@end deftypemethod
-@deftypemethod Window {public Toolkit} getToolkit ()
-
-@end deftypemethod
-@deftypemethod Window {public final String} getWarningString ()
-
-@end deftypemethod
-@deftypemethod Window {public Locale} getLocale ()
-
-@end deftypemethod
-@deftypemethod Window {public void} setCursor (java.awt.Cursor@w{ }@var{cursor})
-
-@end deftypemethod
-@deftypemethod Window {public Window} getOwner ()
-
-@end deftypemethod
-@deftypemethod Window {public Window} getOwnedWindows ()
-
-@end deftypemethod
-@deftypemethod Window {public synchronized void} addWindowListener (java.awt.event.WindowListener@w{ }@var{listener})
-
-@end deftypemethod
-@deftypemethod Window {public synchronized void} removeWindowListener (java.awt.event.WindowListener@w{ }@var{listener})
-
-@end deftypemethod
-@deftypemethod Window {public EventListener} getListeners (java.lang.Class@w{ }@var{listenerType})
-
-@end deftypemethod
-@deftypemethod Window {protected void} processEvent (java.awt.AWTEvent@w{ }@var{evt})
-
-@end deftypemethod
-@deftypemethod Window {protected void} processWindowEvent (java.awt.event.WindowEvent@w{ }@var{evt})
-
-@end deftypemethod
-@deftypemethod Window {public Component} getFocusOwner ()
-
-@end deftypemethod
-@deftypemethod Window {public boolean} postEvent (java.awt.Event@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod Window {public boolean} isShowing ()
-
-@end deftypemethod
-@deftypemethod Window {public void} applyResourceBundle (java.util.ResourceBundle@w{ }@var{rb})
-
-@end deftypemethod
-@deftypemethod Window {public void} applyResourceBundle (java.lang.String@w{ }@var{rbName})
-
-@end deftypemethod
-@deftypemethod Window {public GraphicsConfiguration} getGraphicsConfiguration ()
-Get graphics configuration. The implementation for Window will
- not ask any parent containers, since Window is a toplevel
- window and not actually embedded in the parent component.
-@end deftypemethod
diff --git a/libjava/doc/java-beans-beancontext.texi b/libjava/doc/java-beans-beancontext.texi
deleted file mode 100644
index f67328600aa..00000000000
--- a/libjava/doc/java-beans-beancontext.texi
+++ /dev/null
@@ -1,543 +0,0 @@
-@deftypemethod BeanContextChildComponentProxy {public Component} getComponent ()
-Get the @code{Component} associated with this @code{BeanContextChild}.
-@end deftypemethod
-@deftypemethod BeanContextChild {public void} setBeanContext (java.beans.beancontext.BeanContext@w{ }@var{parent}) @*throws PropertyVetoException
-Set the parent @code{BeanContext}.
-
-
-
-
- This method is called from @code{BeanContext.add()} and
- should not be called directly.
-
-
-
-
- When this Object is being added to a new BeanContext or moved
- from an old one, a non-null value will be passed in.
-
-
-
-
- When this Object is being removed from the current
- @code{BeanContext}, @code{setBeanContext()} will
- receive the parameter @code{null}.
-
-
-
-
- When being removed from the current @code{BeanContext},
- it is the @code{BeanContextChild}'s responsibility to
- release all services it has obtained.
-
-
-
-
- This change should generate @code{PropertyChangeEvent}
- and @code{VetoableChangeEvent}s with the property name
- "beanContext". If the change is vetoed, it must re-throw the
- exception and not change anything. In this way, the parent
- @code{BeanContextChild}, who has registered himself with
- you, will have a chance to remove this child from its
- collection.
-
-
-
-
- If the Bean does not wish to change the parent or be removed
- from one, it may throw the @code{PropertyVetoException}.
- If you veto a @code{setBeanContext(null)} call, then you
- should try your hardest to remedy whatever problem is keeping
- you from being removed from the @code{BeanContext} so
- that you can <em>not</em> veto it the next time.
- Otherwise, nasty pathological recursion stuff could occur in
- certain situations.
-
-
-
-
- If you do veto the change, you must first back out any changes
- you made prior to the veto. Best not to make any such changes
- prior to the veto in the first place.
-
-
-
-
- This method is called from @code{BeanContext.add()} and
- should not be called directly.
-@end deftypemethod
-@deftypemethod BeanContextChild {public BeanContext} getBeanContext ()
-Get the parent @code{BeanContext}.
-@end deftypemethod
-@deftypemethod BeanContextChild {public void} addPropertyChangeListener (java.lang.String@w{ }@var{prop}, java.beans.PropertyChangeListener@w{ }@var{listener})
-Add a listener that will be notified when a specific property changes.
-@end deftypemethod
-@deftypemethod BeanContextChild {public void} removePropertyChangeListener (java.lang.String@w{ }@var{prop}, java.beans.PropertyChangeListener@w{ }@var{listener})
-Remove a listener to a certain property.
-@end deftypemethod
-@deftypemethod BeanContextChild {public void} addVetoableChangeListener (java.lang.String@w{ }@var{prop}, java.beans.VetoableChangeListener@w{ }@var{listener})
-Add a listener that will be notified when a specific property
- change is requested (a PropertyVetoException may be thrown) as
- well as after the change is successfully made.
-@end deftypemethod
-@deftypemethod BeanContextChild {public void} removeVetoableChangeListener (java.lang.String@w{ }@var{prop}, java.beans.VetoableChangeListener@w{ }@var{listener})
-Remove a listener to a certain property.
-@end deftypemethod
-@deftypemethod BeanContextChildSupport {public void} setBeanContext (java.beans.beancontext.BeanContext@w{ }@var{newBeanContext}) @*throws PropertyVetoException
-Set the parent @code{BeanContext}.
-
-
-
-
- When this Object is being added to a new BeanContext or moved
- from an old one, a non-null value will be passed in.
-
-
-
-
- When this Object is being removed from the current
- @code{BeanContext}, @code{setBeanContext()} will
- receive the parameter @code{null}.
-
-
-
-
- Order of events:
-
-@itemize @bullet
-
-
-@item
-
- If the new @code{BeanContext} is the same as the old
- one, nothing happens.
-
-
-
-@item
-
- If the change has not been rejected or vetoed before, call
- @code{validatePendingSetBeanContext()}. If this call
- returns @code{false}, the change is rejected and a
- @code{PropertyVetoException} is thrown.
-
-
-
-@item
-
- If the change has not been rejected or vetoed before,
- @code{VetoableChangeEvent}s are fired with the name
- @code{"beanContext"}, using the
- @code{fireVetoableChange()} method. If a veto
- occurs, reversion events are fired using the same method,
- the change is rejected, and the veto is rethrown.
-
-
-
-@item
-
- @code{releaseBeanContextResources()} is called.
-
-
-
-@item
-
- The change is made.
-
-
-
-@item
-
- @code{PropertyChangeEvent}s are fired using the
- @code{firePropertyChange()} method.
-
-
-
-@item
-
- @code{initializeBeanContextResources()} is called.
-
-
-
-@end itemize
-
-
-
-
-@end deftypemethod
-@deftypemethod BeanContextChildSupport {public BeanContext} getBeanContext ()
-Get the parent @code{BeanContext}.
-@end deftypemethod
-@deftypemethod BeanContextChildSupport {public BeanContextChild} getBeanContextChildPeer ()
-Get the peer (or @code{this} if there is no peer).
-@end deftypemethod
-@deftypemethod BeanContextChildSupport {public boolean} isDelegated ()
-Determine whether there is a peer.
- This is true iff @code{getBeanContextChildPeer() == this}.
-@end deftypemethod
-@deftypemethod BeanContextChildSupport {public void} addPropertyChangeListener (java.lang.String@w{ }@var{propertyName}, java.beans.PropertyChangeListener@w{ }@var{listener})
-Add a listener that will be notified when a specific property changes.
-@end deftypemethod
-@deftypemethod BeanContextChildSupport {public void} removePropertyChangeListener (java.lang.String@w{ }@var{propertyName}, java.beans.PropertyChangeListener@w{ }@var{listener})
-Remove a listener to a certain property.
-@end deftypemethod
-@deftypemethod BeanContextChildSupport {public void} addVetoableChangeListener (java.lang.String@w{ }@var{propertyName}, java.beans.VetoableChangeListener@w{ }@var{listener})
-Add a listener that will be notified when a specific property
- change is requested (a PropertyVetoException may be thrown) as
- well as after the change is successfully made.
-@end deftypemethod
-@deftypemethod BeanContextChildSupport {public void} removeVetoableChangeListener (java.lang.String@w{ }@var{propertyName}, java.beans.VetoableChangeListener@w{ }@var{listener})
-Remove a listener to a certain property.
-@end deftypemethod
-@deftypemethod BeanContextChildSupport {public void} firePropertyChange (java.lang.String@w{ }@var{propertyName}, java.lang.Object@w{ }@var{oldVal}, java.lang.Object@w{ }@var{newVal})
-Fire a property change.
-@end deftypemethod
-@deftypemethod BeanContextChildSupport {public void} fireVetoableChange (java.lang.String@w{ }@var{propertyName}, java.lang.Object@w{ }@var{oldVal}, java.lang.Object@w{ }@var{newVal}) @*throws PropertyVetoException
-Fire a vetoable property change.
-@end deftypemethod
-@deftypemethod BeanContextChildSupport {public void} serviceRevoked (java.beans.beancontext.BeanContextServiceRevokedEvent@w{ }@var{event})
-Called by @code{BeanContextServices.revokeService()} to indicate that a service has been revoked.
- If you have a reference to such a service, it should be
- discarded and may no longer function properly.
- @code{getService()} will no longer work on the specified
- service class after this event has been fired.
-
-
-
-
- <EM>This method is meant to be overriden.</EM>
- @code{BeanContextChildSupport}'s implementation does
- nothing.
-@end deftypemethod
-@deftypemethod BeanContextChildSupport {public void} serviceAvailable (java.beans.beancontext.BeanContextServiceAvailableEvent@w{ }@var{event})
-Called by @code{BeanContextServices} whenever a service is made available.
-
-
-
-
- <EM>This method is meant to be overriden.</EM>
- @code{BeanContextChildSupport}'s implementation does
- nothing.
-@end deftypemethod
-@deftypemethod BeanContextChildSupport {public boolean} validatePendingSetBeanContext (java.beans.beancontext.BeanContext@w{ }@var{newBeanContext})
-Called by @code{setBeanContext()} to determine whether the set should be rejected.
-
-
-
-
- <EM>This method is meant to be overriden.</EM>
- @code{BeanContextChildSupport}'s implementation simply
- returns @code{true}.
-@end deftypemethod
-@deftypemethod BeanContextChildSupport {protected void} releaseBeanContextResources ()
-Called by @code{setBeanContext()} to release resources of a what will soon no longer be the parent.
-
-
-
-
- <EM>This method is meant to be overriden.</EM>
- @code{BeanContextChildSupport}'s implementation does
- nothing.
-@end deftypemethod
-@deftypemethod BeanContextChildSupport {protected void} initializeBeanContextResources ()
-Called by @code{setBeanContext()} to grab resources when the parent has been set.
-
-
-
-
- <EM>This method is meant to be overriden.</EM>
- @code{BeanContextChildSupport}'s implementation does
- nothing.
-@end deftypemethod
-@deftypemethod BeanContextContainerProxy {public Container} getContainer ()
-Get the @code{Container} associated with this @code{BeanContext}.
-@end deftypemethod
-@deftypemethod BeanContextEvent {public BeanContext} getBeanContext ()
-Get the @code{BeanContext} that originated this event.
-@end deftypemethod
-@deftypemethod BeanContextEvent {public BeanContext} getPropagatedFrom ()
-Get the most recent propagator of this event.
- If this value is @code{null}, you have received the event
- straight from the source.
-@end deftypemethod
-@deftypemethod BeanContextEvent {public boolean} isPropagated ()
-Tell whether this event has been propagated.
-@end deftypemethod
-@deftypemethod BeanContextEvent {public void} setPropagatedFrom (java.beans.beancontext.BeanContext@w{ }@var{propagator})
-Set the most recent propagator of this event.
-@end deftypemethod
-@deftypemethod BeanContext {public Object} instantiateChild (java.lang.String@w{ }@var{beanName}) @*throws IOException, ClassNotFoundException
-Instantiate a Bean using this Bean's @code{ClassLoader}
- and this @code{BeanContext} as the parent.
-
-
-
-
- This method exists mainly so that @code{BeanContext}
- implementations can perform extra actions on Beans that are
- created within them.
-@end deftypemethod
-@deftypemethod BeanContext {public URL} getResource (java.lang.String@w{ }@var{resourceName}, java.beans.beancontext.BeanContextChild@w{ }@var{requestor})
-Get a resource. The @code{BeanContext} will typically
- call @code{ClassLoader.getResource()}, but may do it any
- way it wants to. This allows a @code{BeanContext} to
- have its own set of resources separate from the rest of the
- system.
-
-
-
-
- Beans should call this method on their parent rather than the
- associated @code{ClassLoader} method.
-
-
-
-
- I am assuming, but am not entirely sure, that if a
- @code{BeanContext} cannot find a resource, its
- responsibility is to call the @code{getResource} method
- of its parent @code{BeanContext}.
-@end deftypemethod
-@deftypemethod BeanContext {public InputStream} getResourceAsStream (java.lang.String@w{ }@var{resourceName}, java.beans.beancontext.BeanContextChild@w{ }@var{requestor})
-Get a resource as a stream. The @code{BeanContext} will
- typically call @code{ClassLoader.getResourceAsStream()},
- but may do it any way it wants to. This allows a
- @code{BeanContext}'s children to have their own set of
- resources separate from the rest of the system.
-
-
-
-
- Beans should call this method on their parent rather than the
- associated @code{ClassLoader} method.
-
-
-
-
- I am assuming, but am not entirely sure, that if a
- @code{BeanContext} cannot find a resource, its
- responsibility is to call the @code{getResourceAsStream}
- method of its parent @code{BeanContext}.
-@end deftypemethod
-@deftypemethod BeanContext {public void} addBeanContextMembershipListener (java.beans.beancontext.BeanContextMembershipListener@w{ }@var{listener})
-Add a listener on changes to the membership of this
- @code{BeanContext} object.
-@end deftypemethod
-@deftypemethod BeanContext {public void} removeBeanContextMembershipListener (java.beans.beancontext.BeanContextMembershipListener@w{ }@var{listener})
-Remove a listener on changes to the membership of this
- @code{BeanContext} object.
-@end deftypemethod
-@deftypemethod BeanContextMembershipEvent {public int} size ()
-The number of children removed or added.
-@end deftypemethod
-@deftypemethod BeanContextMembershipEvent {public Iterator} iterator ()
-An iterator that will step through all the children.
-@end deftypemethod
-@deftypemethod BeanContextMembershipEvent {public Object} toArray ()
-An array of the children.
-@end deftypemethod
-@deftypemethod BeanContextMembershipEvent {public boolean} contains (java.lang.Object@w{ }@var{child})
-Tell whether the @code{Object} is one of the children added or removed.
-@end deftypemethod
-@deftypemethod BeanContextMembershipListener {public void} childrenAdded (java.beans.beancontext.BeanContextMembershipEvent@w{ }@var{event})
-When beans are added to a @code{BeanContext},
- this method is called to fire the event.
-@end deftypemethod
-@deftypemethod BeanContextMembershipListener {public void} childrenRemoved (java.beans.beancontext.BeanContextMembershipEvent@w{ }@var{event})
-When beans are removed from a @code{BeanContext},
- this method is called to fire the event.
-@end deftypemethod
-@deftypemethod BeanContextProxy {public BeanContextChild} getBeanContextProxy ()
-Return the @code{BeanContextChild} associated with this
- @code{Object}.
-@end deftypemethod
-@deftypemethod BeanContextServiceAvailableEvent {public Iterator} getCurrentServiceSelectors ()
-Get the current service selectors of the service class.
- This is identical to @code{getSourceAsBeanContextServices().getCurrentServiceSelectors(getServiceClass())}
-@end deftypemethod
-@deftypemethod BeanContextServiceAvailableEvent {public Class} getServiceClass ()
-Get the newly available service class.
-@end deftypemethod
-@deftypemethod BeanContextServiceAvailableEvent {public BeanContextServices} getSourceAsBeanContextServices ()
-Get the @code{BeanContextServices} through which the new service is available.
-@end deftypemethod
-@deftypemethod BeanContextServiceProviderBeanInfo {public BeanInfo} getServicesBeanInfo ()
-Get @code{BeanInfo}s for all of the service classes of this @code{BeanInfoServiceProvider}.
-@end deftypemethod
-@deftypemethod BeanContextServiceProvider {public Object} getService (java.beans.beancontext.BeanContextServices@w{ }@var{services}, java.lang.Object@w{ }@var{requestor}, java.lang.Class@w{ }@var{serviceClass}, java.lang.Object@w{ }@var{serviceSelector})
-Get a service.
- Called from @code{BeanContextServices.getService().
-
-
-
-
- If the requested service class is not available, or if this
- @code{BeanContextServiceProvider} chooses not honor the
- request for some reason, then this method will return
- @code{null}.
-
-
-
-
- This method may throw unchecked exceptions, so watch out.
-@end deftypemethod
-@deftypemethod BeanContextServiceProvider {public void} releaseService (java.beans.beancontext.BeanContextServices@w{ }@var{services}, java.lang.Object@w{ }@var{requestor}, java.lang.Object@w{ }@var{service})
-Release the service.
-
-
-
-
- Called by @code{BeanContextServices.releaseService()}.
-
-
-
-
- Most @code{BeanContextServiceProvider}s won't have to do
- anything here.
-@end deftypemethod
-@deftypemethod BeanContextServiceProvider {public Iterator} getCurrentServiceSelectors (java.beans.beancontext.BeanContextServices@w{ }@var{services}, java.lang.Class@w{ }@var{serviceClass})
-Get a list of valid service selectors for the specified service class.
- This method is called from
- @code{BeanContextServices.getCurrentServiceSelectors()}.
-
-
-
-
- If the specified service class does not have a finite number of
- valid service selectors, it should return @code{null}.
- If it takes a general @code{Integer} parameter, for
- example, you may as well return @code{null} or the poor
- soul who called this method will be iterating all day.
-
-
-
-
- If it has no valid service selectors, it should still return an empty
- @code{Iterator}.
-@end deftypemethod
-@deftypemethod BeanContextServiceRevokedEvent {public Class} getServiceClass ()
-Get the revoked service class.
-@end deftypemethod
-@deftypemethod BeanContextServiceRevokedEvent {public boolean} isServiceClass (java.lang.Class@w{ }@var{c})
-Tell whether the revoked service class is the same as the specified class.
- Identical to @code{getServiceClass().equals(c)}.
-@end deftypemethod
-@deftypemethod BeanContextServiceRevokedEvent {public BeanContextServices} getSourceAsBeanContextServices ()
-Get the @code{BeanContextServices} through which the service was available.
-@end deftypemethod
-@deftypemethod BeanContextServiceRevokedEvent {public boolean} isCurrentServiceInvalidNow ()
-Tell whether current instances of the revoked service are usable or not.
- This is determined by whether the service was revoked
- immediately.
-@end deftypemethod
-@deftypemethod BeanContextServiceRevokedListener {public void} serviceRevoked (java.beans.beancontext.BeanContextServiceRevokedEvent@w{ }@var{event})
-Called by @code{BeanContextServices.revokeService()} to indicate that a service has been revoked.
- If you have a reference to such a service, it should be
- discarded and may no longer function properly.
- @code{getService()} will no longer work on the specified
- service class after this event has been fired.
-@end deftypemethod
-@deftypemethod BeanContextServices {public boolean} addService (java.lang.Class@w{ }@var{serviceClass}, java.beans.beancontext.BeanContextServiceProvider@w{ }@var{provider})
-Register a service to make it available to others.
- This class may refuse to add the service based on whatever
- information it can gather, including whether the service
- provider is trusted.
-@end deftypemethod
-@deftypemethod BeanContextServices {public void} revokeService (java.lang.Class@w{ }@var{serviceClass}, java.beans.beancontext.BeanContextServiceProvider@w{ }@var{provider}, boolean@w{ }@var{revokeNow})
-Make it so that no one else can use this service.
-
-
-
-
- If @code{revokeNow} is @code{false}, the only
- effect of this method is to make all subsequent calls to
- @code{getService()} on this service class fail.
-
-
-
-
- If it is @code{true}, a message is also sent out to all
- listeners on the service and all references to it are released.
-@end deftypemethod
-@deftypemethod BeanContextServices {public void} releaseService (java.beans.beancontext.BeanContextChild@w{ }@var{requestorChild}, java.lang.Object@w{ }@var{requestor}, java.lang.Object@w{ }@var{service})
-Release your copy of this service.
-
-
-
-
- If all copies of the service's class have been relinquished by
- the requestor, the @code{BeanContextServiceRevokedListener}
- previously registered by @code{getService()} will be
- unregistered.
-@end deftypemethod
-@deftypemethod BeanContextServices {public Object} getService (java.beans.beancontext.BeanContextChild@w{ }@var{requestorChild}, java.lang.Object@w{ }@var{requestor}, java.lang.Class@w{ }@var{serviceClass}, java.lang.Object@w{ }@var{serviceSelector}, java.beans.beancontext.BeanContextServiceRevokedListener@w{ }@var{listener})
-Get a service from this @code{BeanContextServices}.
-
-
-
-
- The specified listener will be registered to receive a
- revocation notice for the specified serviceClass. One
- notification per service class per requestor object will be
- sent.
-
-
-
-
- The listener will be unregistered when all services that were
- obtained by that requestor for that service class are released.
-
-
-
-
- If the requested service class is not available, or if this
- @code{BeanContextServices} object chooses not honor the
- request because the service class has been revoked or for some
- other reason, then this method will return @code{null}.
-
-
-
-
- This method may throw unchecked exceptions, so watch out.
-@end deftypemethod
-@deftypemethod BeanContextServices {public Iterator} getCurrentServiceClasses ()
-Get a list of all service classes supported.
-
-
-
-
- This method must synchronize on
- @code{BeanContext.globalHierarchyLock}.
-@end deftypemethod
-@deftypemethod BeanContextServices {public Iterator} getCurrentServiceSelectors (java.lang.Class@w{ }@var{serviceClass})
-Get a list of valid service selectors for the specified service class.
-
-
-
-
- If the specified service class does not have a finite number of
- valid service selectors, it should return @code{null}.
- If it takes a general @code{Integer} parameter, for
- example, you may as well return @code{null} or the poor
- soul who called this method will be iterating all day.
-
-
-
-
- If it has no valid service selectors, it should still return an empty
- @code{Iterator}.
-@end deftypemethod
-@deftypemethod BeanContextServices {public boolean} hasService (java.lang.Class@w{ }@var{serviceClass})
-Tell whether the specified service class is available.
- Iff getService() could return a non-null value for the
- specified service, this method will return @code{true}.
-@end deftypemethod
-@deftypemethod BeanContextServices {public void} addBeanContextServicesListener (java.beans.beancontext.BeanContextServicesListener@w{ }@var{listener})
-Add a listener on all adds and removes of services.
-@end deftypemethod
-@deftypemethod BeanContextServices {public void} removeBeanContextServicesListener (java.beans.beancontext.BeanContextServicesListener@w{ }@var{listener})
-Remove a listener on all adds and removes of services.
-@end deftypemethod
-@deftypemethod BeanContextServicesListener {public void} serviceAvailable (java.beans.beancontext.BeanContextServiceAvailableEvent@w{ }@var{event})
-Called by @code{BeanContextServices} whenever a service is made available.
-@end deftypemethod
diff --git a/libjava/doc/java-beans.texi b/libjava/doc/java-beans.texi
deleted file mode 100644
index 2b8887181ee..00000000000
--- a/libjava/doc/java-beans.texi
+++ /dev/null
@@ -1,810 +0,0 @@
-@deftypemethod BeanDescriptor {public Class} getBeanClass ()
-Get the Bean's class.
-@end deftypemethod
-@deftypemethod BeanDescriptor {public Class} getCustomizerClass ()
-Get the Bean's customizer's class.
-@end deftypemethod
-@deftypemethod BeanInfo {public BeanDescriptor} getBeanDescriptor ()
-Get the general description of this Bean type.
-@end deftypemethod
-@deftypemethod BeanInfo {public EventSetDescriptor} getEventSetDescriptors ()
-Get the events this Bean type fires.
-@end deftypemethod
-@deftypemethod BeanInfo {public int} getDefaultEventIndex ()
-Get the "default" event, basically the one a RAD tool
- user is most likely to select.
-@end deftypemethod
-@deftypemethod BeanInfo {public PropertyDescriptor} getPropertyDescriptors ()
-Get the properties (get/set method pairs) this Bean
- type supports.
-@end deftypemethod
-@deftypemethod BeanInfo {public int} getDefaultPropertyIndex ()
-Get the "default" property, basically the one a RAD
- tool user is most likely to select.
-@end deftypemethod
-@deftypemethod BeanInfo {public MethodDescriptor} getMethodDescriptors ()
-Get the methods this Bean type supports.
-@end deftypemethod
-@deftypemethod BeanInfo {public BeanInfo} getAdditionalBeanInfo ()
-Get additional BeanInfos representing this Bean.
- In this version of JavaBeans, this method is used so
- that space and time can be saved by reading a BeanInfo
- for each class in the hierarchy (super, super(super),
- and so on).
-
-
-
- The order of precedence when two pieces of BeanInfo
- conflict (such as two PropertyDescriptors that have
- the same name), in order from highest precedence to
- lowest, is:
-
-@itemize @bullet
-
-
-@item
-This BeanInfo object.
-
-
-@item
-@code{getAdditionalBeanInfo()[getAdditionalBeanInfo().length]}
-
-
-@item
- ...
-
-
-@item
-@code{getAdditionalBeanInfo()[1]}
-
-
-@item
-@code{getAdditionalBeanInfo()[0]}
-
-
-@end itemize
-
-
-
-
- <STRONG>Spec Note:</STRONG> It is possible that
- returning @code{null} from this method could
- stop Introspection in its tracks, but it is unclear
- from the spec whether this is the case.
-@end deftypemethod
-@deftypemethod BeanInfo {public Image} getIcon (int@w{ }@var{iconType})
-Get a visual icon for this Bean.
- A Bean does not have to support icons, and if it does
- support icons, it does not have to support every single
- type. Sun recommends that if you only support one
- type, you support 16x16 color. Sun also notes that you
- should try to use a type (like GIF) that allows for
- transparent pixels, so that the background of the RAD
- tool can show through.
-
-
-
- <STRONG>Spec Note:</STRONG> If you do not support the
- type of icon that is being asked for, but you do
- support another type, it is unclear whether you should
- return the other type or not. I would presume not.
-@end deftypemethod
-@deftypemethod Beans {public static Object} instantiate (java.lang.ClassLoader@w{ }@var{cl}, java.lang.String@w{ }@var{beanName}) @*throws IOException, ClassNotFoundException
-Allows you to instantiate a Bean. This method takes
- a ClassLoader from which to read the Bean and the
- name of the Bean.
-
-
-
- The Bean name should be a dotted name, like a class.
- It can represent several things. Beans will search
- for the Bean using the name like this:
-
-
-
-@itemize @bullet
-
-
-@item
-Searches for a serialized instance of the Bean
- using getResource(), mangling the Bean name by
- replacing the dots with slashes and appending .ser
- (for example, gnu.beans.BlahDeBlah would cause
- Beans to search for gnu/beans/BlahDeBlah.ser using
- getResource()).
-
-
-@item
-Searches for the Bean class using the beanName,
- and then instantiates it with the no-arg constructor.
- At that point, if it is an Applet, it provides it
- with AppletContext and AppletStub, and then calls
- init().
-
-
-@end itemize
-
-@end deftypemethod
-@deftypemethod Beans {public static Object} getInstanceOf (java.lang.Object@w{ }@var{bean}, java.lang.Class@w{ }@var{newClass})
-Get the Bean as a different class type.
- This should be used instead of casting to get a new
- type view of a Bean, because in the future there may
- be new types of Bean, even Beans spanning multiple
- Objects.
-@end deftypemethod
-@deftypemethod Beans {public static boolean} isInstanceOf (java.lang.Object@w{ }@var{bean}, java.lang.Class@w{ }@var{newBeanClass})
-Determine whether the Bean can be cast to a different
- class type.
- This should be used instead of instanceof to determine
- a Bean's castability, because in the future there may
- be new types of Bean, even Beans spanning multiple
- Objects.
-@end deftypemethod
-@deftypemethod Beans {public static boolean} isGuiAvailable ()
-Find out whether the GUI is available to use.
- Defaults to true.
-@end deftypemethod
-@deftypemethod Beans {public static boolean} isDesignTime ()
-Find out whether it is design time. Design time means
- we are in a RAD tool.
- Defaults to false.
-@end deftypemethod
-@deftypemethod Beans {public static void} setGuiAvailable (boolean@w{ }@var{guiAvailable}) @*throws SecurityException
-Set whether the GUI is available to use.
-@end deftypemethod
-@deftypemethod Beans {public static void} setDesignTime (boolean@w{ }@var{designTime}) @*throws SecurityException
-Set whether it is design time. Design time means we
- are in a RAD tool.
-@end deftypemethod
-@deftypemethod Customizer {public void} setObject (java.lang.Object@w{ }@var{bean})
-Set the object to Customize. This will always be a
- Bean that had a BeanDescriptor indicating this
- Customizer.
-@end deftypemethod
-@deftypemethod Customizer {public void} addPropertyChangeListener (java.beans.PropertyChangeListener@w{ }@var{l})
-Add a PropertyChangeListener.
-@end deftypemethod
-@deftypemethod Customizer {public void} removePropertyChangeListener (java.beans.PropertyChangeListener@w{ }@var{l})
-Remove a PropertyChangeListener.
-@end deftypemethod
-@deftypemethod DesignMode {public void} setDesignTime (boolean@w{ }@var{designTime})
-The environment will call this method on your
- @code{BeanContextChild} when it is registered in a parent
- @code{BeanContext} or when behavior needs to switch from
- design time to runtime behavior (or vice versa).
-
-
-
-
- @code{BeanContext}s are required to fire
- @code{PropertyChangeEvent}s when properties change.
- @code{designTime} is a property, and therefore when you
- implement @code{setDesignTime()}, you need to fire a
- @code{PropertyChangeEvent} with the old value, the new
- value and using @code{PROPERTYNAME} as the property name.
-@end deftypemethod
-@deftypemethod DesignMode {public boolean} isDesignTime ()
-This method should tell whether it is design time or runtime.
-@end deftypemethod
-@deftypemethod EventSetDescriptor {public Class} getListenerType ()
-Get the class that contains the event firing methods.
-@end deftypemethod
-@deftypemethod EventSetDescriptor {public Method} getListenerMethods ()
-Get the event firing methods.
-@end deftypemethod
-@deftypemethod EventSetDescriptor {public MethodDescriptor} getListenerMethodDescriptors ()
-Get the event firing methods as MethodDescriptors.
-@end deftypemethod
-@deftypemethod EventSetDescriptor {public Method} getAddListenerMethod ()
-Get the add listener method.
-@end deftypemethod
-@deftypemethod EventSetDescriptor {public Method} getRemoveListenerMethod ()
-Get the remove listener method.
-@end deftypemethod
-@deftypemethod EventSetDescriptor {public void} setUnicast (boolean@w{ }@var{unicast})
-Set whether or not multiple listeners may be added.
-@end deftypemethod
-@deftypemethod EventSetDescriptor {public boolean} isUnicast ()
-Get whether or not multiple listeners may be added. (Defaults to false.)
-@end deftypemethod
-@deftypemethod EventSetDescriptor {public void} setInDefaultEventSet (boolean@w{ }@var{inDefaultEventSet})
-Set whether or not this is in the default event set.
-@end deftypemethod
-@deftypemethod EventSetDescriptor {public boolean} isInDefaultEventSet ()
-Get whether or not this is in the default event set. (Defaults to true.)
-@end deftypemethod
-@deftypemethod FeatureDescriptor {public String} getName ()
-Get the programmatic name of this feature.
-@end deftypemethod
-@deftypemethod FeatureDescriptor {public void} setName (java.lang.String@w{ }@var{name})
-Set the programmatic name of this feature.
-@end deftypemethod
-@deftypemethod FeatureDescriptor {public String} getDisplayName ()
-Get the localized (display) name of this feature.
-@end deftypemethod
-@deftypemethod FeatureDescriptor {public void} setDisplayName (java.lang.String@w{ }@var{displayName})
-Set the localized (display) name of this feature.
-@end deftypemethod
-@deftypemethod FeatureDescriptor {public String} getShortDescription ()
-Get the localized short description for this feature.
-@end deftypemethod
-@deftypemethod FeatureDescriptor {public void} setShortDescription (java.lang.String@w{ }@var{shortDescription})
-Set the localized short description for this feature.
-@end deftypemethod
-@deftypemethod FeatureDescriptor {public boolean} isExpert ()
-Indicates whether this feature is for expert use only.
-@end deftypemethod
-@deftypemethod FeatureDescriptor {public void} setExpert (boolean@w{ }@var{expert})
-Set whether this feature is for expert use only.
-@end deftypemethod
-@deftypemethod FeatureDescriptor {public boolean} isHidden ()
-Indicates whether this feature is for use by tools only.
- If it is for use by tools only, then it should not be displayed.
-@end deftypemethod
-@deftypemethod FeatureDescriptor {public void} setHidden (boolean@w{ }@var{hidden})
-Set whether this feature is for use by tools only.
- If it is for use by tools only, then it should not be displayed.
-@end deftypemethod
-@deftypemethod FeatureDescriptor {public Object} getValue (java.lang.String@w{ }@var{name})
-Get an arbitrary value set with setValue().
-@end deftypemethod
-@deftypemethod FeatureDescriptor {public void} setValue (java.lang.String@w{ }@var{name}, java.lang.Object@w{ }@var{value})
-Set an arbitrary string-value pair with this feature.
-@end deftypemethod
-@deftypemethod FeatureDescriptor {public Enumeration} attributeNames ()
-Get a list of the programmatic key names set with setValue().
-@end deftypemethod
-@deftypemethod IndexedPropertyDescriptor {public Class} getIndexedPropertyType ()
-
-@end deftypemethod
-@deftypemethod IndexedPropertyDescriptor {public Method} getIndexedReadMethod ()
-
-@end deftypemethod
-@deftypemethod IndexedPropertyDescriptor {public Method} getIndexedWriteMethod ()
-
-@end deftypemethod
-@deftypemethod Introspector {public static BeanInfo} getBeanInfo (java.lang.Class@w{ }@var{beanClass}) @*throws IntrospectionException
-Get the BeanInfo for class @code{beanClass},
- first by looking for explicit information, next by
- using standard design patterns to determine
- information about the class.
-@end deftypemethod
-@deftypemethod Introspector {public static BeanInfo} getBeanInfo (java.lang.Class@w{ }@var{beanClass}, java.lang.Class@w{ }@var{stopClass}) @*throws IntrospectionException
-Get the BeanInfo for class @code{beanClass},
- first by looking for explicit information, next by
- using standard design patterns to determine
- information about the class. It crawls up the
- inheritance tree until it hits @code{topClass}.
-@end deftypemethod
-@deftypemethod Introspector {public static String} getBeanInfoSearchPath ()
-Get the search path for BeanInfo classes.
-@end deftypemethod
-@deftypemethod Introspector {public static void} setBeanInfoSearchPath (java.lang.String[]@w{ }@var{beanInfoSearchPath})
-Set the search path for BeanInfo classes.
-@end deftypemethod
-@deftypemethod Introspector {public static String} decapitalize (java.lang.String@w{ }@var{name})
-A helper method to convert a name to standard Java
- naming conventions: anything with two capitals as the
- first two letters remains the same, otherwise the
- first letter is decapitalized. URL = URL, I = i,
- MyMethod = myMethod.
-@end deftypemethod
-@deftypemethod MethodDescriptor {public ParameterDescriptor} getParameterDescriptors ()
-Get the parameter descriptors from this method.
- Since MethodDescriptor has no way of determining what
- the parameter names were, this defaults to null.
-@end deftypemethod
-@deftypemethod MethodDescriptor {public Method} getMethod ()
-Get the method this MethodDescriptor represents.
-@end deftypemethod
-@deftypemethod PropertyChangeEvent {public String} getPropertyName ()
-Get the property name.
-@end deftypemethod
-@deftypemethod PropertyChangeEvent {public Object} getOldValue ()
-Get the property's old value.
-@end deftypemethod
-@deftypemethod PropertyChangeEvent {public Object} getNewValue ()
-Get the property's new value.
-@end deftypemethod
-@deftypemethod PropertyChangeEvent {public void} setPropagationId (java.lang.Object@w{ }@var{propagationId})
-Set the propagation ID. This is a way for the event
- to be passed from hand to hand and retain a little
- extra state. Right now it is unused, but it should
- be propagated anyway so that future versions of
- JavaBeans can use it, for God knows what.
-@end deftypemethod
-@deftypemethod PropertyChangeEvent {public Object} getPropagationId ()
-Get the propagation ID.
-@end deftypemethod
-@deftypemethod PropertyChangeListener {public void} propertyChange (java.beans.PropertyChangeEvent@w{ }@var{e})
-Fired after a Bean's property has changed.
-@end deftypemethod
-@deftypemethod PropertyChangeSupport {public void} addPropertyChangeListener (java.beans.PropertyChangeListener@w{ }@var{l})
-Adds a PropertyChangeListener to the list of listeners.
- All property change events will be sent to this listener.
-
-
-
-
- The listener add is not unique: that is, <em>n</em> adds with
- the same listener will result in <em>n</em> events being sent
- to that listener for every property change.
-
-
-
-
- Adding a null listener will cause undefined behavior.
-@end deftypemethod
-@deftypemethod PropertyChangeSupport {public void} addPropertyChangeListener (java.lang.String@w{ }@var{propertyName}, java.beans.PropertyChangeListener@w{ }@var{l})
-Adds a PropertyChangeListener listening on the specified property.
- Events will be sent to the listener for that particular property.
-
-
-
-
- The listener add is not unique; that is, <em>n</em> adds on a
- particular property for a particular listener will result in
- <em>n</em> events being sent to that listener when that
- property is changed.
-
-
-
-
- The effect is cumulative, too; if you are registered to listen
- to receive events on all property changes, and then you
- register on a particular property, you will receive change
- events for that property twice.
-
-
-
-
- Adding a null listener will cause undefined behavior.
-@end deftypemethod
-@deftypemethod PropertyChangeSupport {public void} removePropertyChangeListener (java.beans.PropertyChangeListener@w{ }@var{l})
-Removes a PropertyChangeListener from the list of listeners.
- If any specific properties are being listened on, they must
- be deregistered by themselves; this will only remove the
- general listener to all properties.
-
-
-
-
- If @code{add()} has been called multiple times for a
- particular listener, @code{remove()} will have to be
- called the same number of times to deregister it.
-@end deftypemethod
-@deftypemethod PropertyChangeSupport {public void} removePropertyChangeListener (java.lang.String@w{ }@var{propertyName}, java.beans.PropertyChangeListener@w{ }@var{l})
-Removes a PropertyChangeListener from listening to a specific property.
-
-
-
-
- If @code{add()} has been called multiple times for a
- particular listener on a property, @code{remove()} will
- have to be called the same number of times to deregister it.
-@end deftypemethod
-@deftypemethod PropertyChangeSupport {public void} firePropertyChange (java.beans.PropertyChangeEvent@w{ }@var{event})
-Fire a PropertyChangeEvent to all the listeners.
-@end deftypemethod
-@deftypemethod PropertyChangeSupport {public void} firePropertyChange (java.lang.String@w{ }@var{propertyName}, java.lang.Object@w{ }@var{oldVal}, java.lang.Object@w{ }@var{newVal})
-Fire a PropertyChangeEvent containing the old and new values of the property to all the listeners.
-@end deftypemethod
-@deftypemethod PropertyChangeSupport {public void} firePropertyChange (java.lang.String@w{ }@var{propertyName}, boolean@w{ }@var{oldVal}, boolean@w{ }@var{newVal})
-Fire a PropertyChangeEvent containing the old and new values of the property to all the listeners.
-@end deftypemethod
-@deftypemethod PropertyChangeSupport {public void} firePropertyChange (java.lang.String@w{ }@var{propertyName}, int@w{ }@var{oldVal}, int@w{ }@var{newVal})
-Fire a PropertyChangeEvent containing the old and new values of the property to all the listeners.
-@end deftypemethod
-@deftypemethod PropertyChangeSupport {public boolean} hasListeners (java.lang.String@w{ }@var{propertyName})
-Tell whether the specified property is being listened on or not.
- This will only return @code{true} if there are listeners
- on all properties or if there is a listener specifically on this
- property.
-@end deftypemethod
-@deftypemethod PropertyDescriptor {public Class} getPropertyType ()
-Get the property type.
- This is the type the get method returns and the set method
- takes in.
-@end deftypemethod
-@deftypemethod PropertyDescriptor {public Method} getReadMethod ()
-Get the get method. Why they call it readMethod here and
- get everywhere else is beyond me.
-@end deftypemethod
-@deftypemethod PropertyDescriptor {public Method} getWriteMethod ()
-Get the set method. Why they call it writeMethod here and
- set everywhere else is beyond me.
-@end deftypemethod
-@deftypemethod PropertyDescriptor {public boolean} isBound ()
-Get whether the property is bound. Defaults to false.
-@end deftypemethod
-@deftypemethod PropertyDescriptor {public void} setBound (boolean@w{ }@var{bound})
-Set whether the property is bound.
- As long as the the bean implements addPropertyChangeListener() and
- removePropertyChangeListener(), setBound(true) may safely be called.
-
-
- If these things are not true, then the behavior of the system
- will be undefined.
-
-
-
- When a property is bound, its set method is required to fire the
- @code{PropertyChangeListener.propertyChange())} event
- after the value has changed.
-@end deftypemethod
-@deftypemethod PropertyDescriptor {public boolean} isConstrained ()
-Get whether the property is constrained. Defaults to false.
-@end deftypemethod
-@deftypemethod PropertyDescriptor {public void} setConstrained (boolean@w{ }@var{constrained})
-Set whether the property is constrained.
- If the set method throws @code{java.beans.PropertyVetoException}
- (or subclass thereof) and the bean implements addVetoableChangeListener()
- and removeVetoableChangeListener(), then setConstrained(true) may safely
- be called. Otherwise, the system behavior is undefined.
- <B>Spec note:</B> given those strict parameters, it would be nice if it
- got set automatically by detection, but oh well.
-
-
- When a property is constrained, its set method is required to:
-
-
-
-@itemize @bullet
-
-
-@item
-Fire the @code{VetoableChangeListener.vetoableChange()}
- event notifying others of the change and allowing them a chance to
- say it is a bad thing.
-
-
-@item
-If any of the listeners throws a PropertyVetoException, then
- it must fire another vetoableChange() event notifying the others
- of a reversion to the old value (though, of course, the change
- was never made). Then it rethrows the PropertyVetoException and
- exits.
-
-
-@item
-If all has gone well to this point, the value may be changed.
-
-
-@end itemize
-
-@end deftypemethod
-@deftypemethod PropertyDescriptor {public Class} getPropertyEditorClass ()
-Get the PropertyEditor class. Defaults to null.
-@end deftypemethod
-@deftypemethod PropertyDescriptor {public void} setPropertyEditorClass (java.lang.Class@w{ }@var{propertyEditorClass})
-Set the PropertyEditor class. If the class does not implement
- the PropertyEditor interface, you will likely get an exception
- late in the game.
-@end deftypemethod
-@deftypemethod PropertyEditor {public void} setValue (java.lang.Object@w{ }@var{value})
-Called by the RAD tool to set the value of this property for the PropertyEditor.
- If the property type is native, it should be wrapped in the appropriate
- wrapper type.
-@end deftypemethod
-@deftypemethod PropertyEditor {public Object} getValue ()
-Accessor method to get the current value the PropertyEditor is working with.
- If the property type is native, it will be wrapped in the appropriate
- wrapper type.
-@end deftypemethod
-@deftypemethod PropertyEditor {public void} setAsText (java.lang.String@w{ }@var{text}) @*throws IllegalArgumentException
-Set the value of this property using a String.
- Whether or not this PropertyEditor is editing a String type, this converts
- the String into the type of the PropertyEditor.
-@end deftypemethod
-@deftypemethod PropertyEditor {public String} getAsText ()
-Get the value of this property in String format.
- Many times this can simply use Object.toString().
-
-
- Return null if you do not support getAsText()/setAsText().
- @code{setAsText(getAsText())} should be valid; i.e. the stuff you spit out in
- getAsText() should be able to go into setAsText().
-@end deftypemethod
-@deftypemethod PropertyEditor {public String} getTags ()
-Get a list of possible Strings which this property type can have.
- The value of these will be used by the RAD tool to construct some sort
- of list box or to check text box input, and the resulting String passed
- to setAsText() should be one of these. Note, however, that like most things
- with this mammoth, unwieldy interface, this is not guaranteed. Thus, you
- must check the value in setAsText() anyway.
-@end deftypemethod
-@deftypemethod PropertyEditor {public boolean} isPaintable ()
-The RAD tool calls this to find out whether the PropertyEditor can paint itself.
-@end deftypemethod
-@deftypemethod PropertyEditor {public void} paintValue (java.awt.Graphics@w{ }@var{g}, java.awt.Rectangle@w{ }@var{bounds})
-The RAD tool calls this to paint the actual value of the property.
- The Graphics context will have the same current font, color, etc. as the
- parent Container. You may safely change the font, color, etc. and not
- change them back.
-
-
- This method should do a silent no-op if isPaintable() is false.
-@end deftypemethod
-@deftypemethod PropertyEditor {public boolean} supportsCustomEditor ()
-The RAD tool calls this to find out whether the PropertyEditor supports a custom component to edit and display itself.
-@end deftypemethod
-@deftypemethod PropertyEditor {public Component} getCustomEditor ()
-The RAD tool calls this to grab the component that can edit this type.
- The component may be painted anywhere the RAD tool wants to paint it--
- even in its own window.
-
-
- The component must hook up with the PropertyEditor and, whenever a
- change to the value is made, fire a PropertyChangeEvent to the source.
-
-
-@end deftypemethod
-@deftypemethod PropertyEditor {public void} addPropertyChangeListener (java.beans.PropertyChangeListener@w{ }@var{listener})
-Adds a property change listener to this PropertyEditor.
-@end deftypemethod
-@deftypemethod PropertyEditor {public void} removePropertyChangeListener (java.beans.PropertyChangeListener@w{ }@var{listener})
-Removes a property change listener from this PropertyEditor.
-@end deftypemethod
-@deftypemethod PropertyEditor {public String} getJavaInitializationString ()
-Get a Java language-specific String which could be used to create an Object
- of the specified type. Every PropertyEditor must support this.
-
-
- The reason for this is that while most RAD tools will serialize the Beans
- and deserialize them at runtime, some RAD tools will generate code that
- creates the Beans. Examples of Java initialization strings would be:
-
-
-
-@itemize @bullet
-
-
-@item
-@code{2}
-
-
-@item
-@code{"I am a String"}
-
-
-@item
-@code{new MyObject(2, "String", new StringBuffer())}
-
-
-@end itemize
-
-@end deftypemethod
-@deftypemethod PropertyEditorManager {public static void} registerEditor (java.lang.Class@w{ }@var{editedClass}, java.lang.Class@w{ }@var{editorClass})
-Register an editor for a class. Replaces old editor
- if there was one registered before.
-@end deftypemethod
-@deftypemethod PropertyEditorManager {public static PropertyEditor} findEditor (java.lang.Class@w{ }@var{editedClass})
-Returns a new instance of the property editor for the
- specified class.
-@end deftypemethod
-@deftypemethod PropertyEditorManager {public static String} getEditorSearchPath ()
-Get the editor search path.
- As a minor departure from the spec, the default value
- for the editor search path is "gnu.java.beans.editors",
- "sun.beans.editors".
-@end deftypemethod
-@deftypemethod PropertyEditorManager {public static void} setEditorSearchPath (java.lang.String[]@w{ }@var{editorSearchPath})
-Set the editor search path.
-@end deftypemethod
-@deftypemethod PropertyEditorSupport {public void} setValue (java.lang.Object@w{ }@var{val})
-Set the current value of the property.
- <STRONG>Implementation Note</STRONG> Sun does not
- state what exactly this version of the method does.
- Thus, in this implementation, it sets the value, and
- then if the old and new values are different, it
- fires a property change event with no property name
- and the old and new values.
-@end deftypemethod
-@deftypemethod PropertyEditorSupport {public Object} getValue ()
-Get the current value of the property.
-@end deftypemethod
-@deftypemethod PropertyEditorSupport {public boolean} isPaintable ()
-Get whether this object is paintable or not.
-@end deftypemethod
-@deftypemethod PropertyEditorSupport {public void} paintValue (java.awt.Graphics@w{ }@var{g}, java.awt.Rectangle@w{ }@var{r})
-Paint this object. This class does nothing in
- this method.
-@end deftypemethod
-@deftypemethod PropertyEditorSupport {public String} getJavaInitializationString ()
-Get the Java initialization String for the current
- value of the Object. This class returns gibberish or
- null (though the spec does not say which).
-
-
- <STRONG>Implementation Note:</STRONG> This class
- returns the string "@$#^" to make sure the code will
- be broken, so that you will know to override it when
- you create your own property editor.
-@end deftypemethod
-@deftypemethod PropertyEditorSupport {public String} getAsText ()
-Get the value as text.
- In this class, you cannot count on getAsText() doing
- anything useful, although in this implementation I
- do toString().
-@end deftypemethod
-@deftypemethod PropertyEditorSupport {public void} setAsText (java.lang.String@w{ }@var{s}) @*throws IllegalArgumentException
-Set the value as text.
- In this class, you cannot count on setAsText() doing
- anything useful across implementations.
- <STRONG>Implementation Note:</STRONG> In this
- implementation it checks if the String is "null", and
- if it is, sets the value to null, otherwise it throws
- an IllegalArgumentException.
-@end deftypemethod
-@deftypemethod PropertyEditorSupport {public String} getTags ()
-Returns a list of possible choices for the value.
-@end deftypemethod
-@deftypemethod PropertyEditorSupport {public Component} getCustomEditor ()
-Return a custom component to edit the value.
-@end deftypemethod
-@deftypemethod PropertyEditorSupport {public boolean} supportsCustomEditor ()
-Find out whether this property editor supports a
- custom component to edit its value.
-@end deftypemethod
-@deftypemethod PropertyEditorSupport {public void} addPropertyChangeListener (java.beans.PropertyChangeListener@w{ }@var{l})
-Add a property change listener to this property editor.
-@end deftypemethod
-@deftypemethod PropertyEditorSupport {public void} removePropertyChangeListener (java.beans.PropertyChangeListener@w{ }@var{l})
-Remove a property change listener from this property editor.
-@end deftypemethod
-@deftypemethod PropertyEditorSupport {public void} firePropertyChange ()
-Notify people that we've changed, although we don't
- tell them just how. The only thing I can think of to
- send in the event is the new value (since the old value
- is unavailable and there is no property name).
- I confess I do not understand the point of this method.
-@end deftypemethod
-@deftypemethod PropertyVetoException {public PropertyChangeEvent} getPropertyChangeEvent ()
-Get the PropertyChange event that was vetoed.
-@end deftypemethod
-@deftypemethod SimpleBeanInfo {public BeanDescriptor} getBeanDescriptor ()
-Force Introspection of the general bean info.
-@end deftypemethod
-@deftypemethod SimpleBeanInfo {public EventSetDescriptor} getEventSetDescriptors ()
-Force Introspection of the events this Bean type
- fires.
-@end deftypemethod
-@deftypemethod SimpleBeanInfo {public int} getDefaultEventIndex ()
-Say that there is no "default" event set.
-@end deftypemethod
-@deftypemethod SimpleBeanInfo {public PropertyDescriptor} getPropertyDescriptors ()
-Force Introspection of the Bean properties.
-@end deftypemethod
-@deftypemethod SimpleBeanInfo {public int} getDefaultPropertyIndex ()
-Say that there is no "default" property.
-@end deftypemethod
-@deftypemethod SimpleBeanInfo {public MethodDescriptor} getMethodDescriptors ()
-Force Introspection of the Bean's methods.
-@end deftypemethod
-@deftypemethod SimpleBeanInfo {public BeanInfo} getAdditionalBeanInfo ()
-Tell the Introspector to go look for other BeanInfo
- itself.
-@end deftypemethod
-@deftypemethod SimpleBeanInfo {public Image} getIcon (int@w{ }@var{iconType})
-Say that this Bean has no icons.
-@end deftypemethod
-@deftypemethod SimpleBeanInfo {public Image} loadImage (java.lang.String@w{ }@var{location})
-Helper method to load an image using the Bean class
- getResource() method on the BeanInfo class (using
- getClass(), since you'll extend this class to get
- the BeanInfo). Basically it's assumed that the Bean
- and its BeanInfo are both loaded by the same
- ClassLoader, generally a reasonable assumption.
-@end deftypemethod
-@deftypemethod VetoableChangeListener {public void} vetoableChange (java.beans.PropertyChangeEvent@w{ }@var{e}) @*throws PropertyVetoException
-Fired before a Bean's property changes.
-@end deftypemethod
-@deftypemethod VetoableChangeSupport {public void} addVetoableChangeListener (java.beans.VetoableChangeListener@w{ }@var{l})
-Adds a VetoableChangeListener to the list of listeners.
- All property change events will be sent to this listener.
-
-
-
-
- The listener add is not unique: that is, <em>n</em> adds with
- the same listener will result in <em>n</em> events being sent
- to that listener for every property change.
-
-
-
-
- Adding a null listener will cause undefined behavior.
-@end deftypemethod
-@deftypemethod VetoableChangeSupport {public void} addVetoableChangeListener (java.lang.String@w{ }@var{propertyName}, java.beans.VetoableChangeListener@w{ }@var{l})
-Adds a VetoableChangeListener listening on the specified property.
- Events will be sent to the listener for that particular property.
-
-
-
-
- The listener add is not unique; that is, <em>n</em> adds on a
- particular property for a particular listener will result in
- <em>n</em> events being sent to that listener when that
- property is changed.
-
-
-
-
- The effect is cumulative, too; if you are registered to listen
- to receive events on all property changes, and then you
- register on a particular property, you will receive change
- events for that property twice.
-
-
-
-
- Adding a null listener will cause undefined behavior.
-@end deftypemethod
-@deftypemethod VetoableChangeSupport {public void} removeVetoableChangeListener (java.beans.VetoableChangeListener@w{ }@var{l})
-Removes a VetoableChangeListener from the list of listeners.
- If any specific properties are being listened on, they must
- be deregistered by themselves; this will only remove the
- general listener to all properties.
-
-
-
-
- If @code{add()} has been called multiple times for a
- particular listener, @code{remove()} will have to be
- called the same number of times to deregister it.
-@end deftypemethod
-@deftypemethod VetoableChangeSupport {public void} removeVetoableChangeListener (java.lang.String@w{ }@var{propertyName}, java.beans.VetoableChangeListener@w{ }@var{l})
-Removes a VetoableChangeListener from listening to a specific property.
-
-
-
-
- If @code{add()} has been called multiple times for a
- particular listener on a property, @code{remove()} will
- have to be called the same number of times to deregister it.
-@end deftypemethod
-@deftypemethod VetoableChangeSupport {public void} fireVetoableChange (java.beans.PropertyChangeEvent@w{ }@var{proposedChange}) @*throws PropertyVetoException
-Fire a VetoableChangeEvent to all the listeners.
- If any listener objects, a reversion event will be sent to
- those listeners who received the initial event.
-@end deftypemethod
-@deftypemethod VetoableChangeSupport {public void} fireVetoableChange (java.lang.String@w{ }@var{propertyName}, java.lang.Object@w{ }@var{oldVal}, java.lang.Object@w{ }@var{newVal}) @*throws PropertyVetoException
-Fire a VetoableChangeEvent containing the old and new values of the property to all the listeners.
- If any listener objects, a reversion event will be sent to
- those listeners who received the initial event.
-@end deftypemethod
-@deftypemethod VetoableChangeSupport {public void} fireVetoableChange (java.lang.String@w{ }@var{propertyName}, boolean@w{ }@var{oldVal}, boolean@w{ }@var{newVal}) @*throws PropertyVetoException
-Fire a VetoableChangeEvent containing the old and new values of the property to all the listeners.
- If any listener objects, a reversion event will be sent to
- those listeners who received the initial event.
-@end deftypemethod
-@deftypemethod VetoableChangeSupport {public void} fireVetoableChange (java.lang.String@w{ }@var{propertyName}, int@w{ }@var{oldVal}, int@w{ }@var{newVal}) @*throws PropertyVetoException
-Fire a VetoableChangeEvent containing the old and new values of the property to all the listeners.
- If any listener objects, a reversion event will be sent to
- those listeners who received the initial event.
-@end deftypemethod
-@deftypemethod VetoableChangeSupport {public boolean} hasListeners (java.lang.String@w{ }@var{propertyName})
-Tell whether the specified property is being listened on or not.
- This will only return @code{true} if there are listeners
- on all properties or if there is a listener specifically on this
- property.
-@end deftypemethod
-@deftypemethod Visibility {public boolean} needsGui ()
-Tells whether the Bean can run without a GUI or not.
-@end deftypemethod
-@deftypemethod Visibility {public boolean} avoidingGui ()
-Tells whether Bean is trying not to use the GUI.
- If needsGui() is true, this method should always return false.
-@end deftypemethod
-@deftypemethod Visibility {public void} dontUseGui ()
-Tells the Bean not to use GUI methods.
- If needsGUI() is false, then after this method is called,
- avoidingGui() should return true.
-@end deftypemethod
-@deftypemethod Visibility {public void} okToUseGui ()
-Tells the Bean it may use the GUI.
- The Bean is not required to use the GUI in this case, it is
- merely being <EM>permitted</EM> to use it. If needsGui() is
- false, avoidingGui() may return true or false after this method
- is called.
-@end deftypemethod
diff --git a/libjava/doc/java-io.texi b/libjava/doc/java-io.texi
deleted file mode 100644
index 753bf96639e..00000000000
--- a/libjava/doc/java-io.texi
+++ /dev/null
@@ -1,2592 +0,0 @@
-@deftypemethod BufferedInputStream {public synchronized int} available () @*throws IOException
-
-@end deftypemethod
-@deftypemethod BufferedInputStream {public void} close () @*throws IOException
-
-@end deftypemethod
-@deftypemethod BufferedInputStream {public synchronized void} mark (int@w{ }@var{readlimit})
-
-@end deftypemethod
-@deftypemethod BufferedInputStream {public boolean} markSupported ()
-
-@end deftypemethod
-@deftypemethod BufferedInputStream {public synchronized int} read () @*throws IOException
-
-@end deftypemethod
-@deftypemethod BufferedInputStream {public synchronized int} read (byte[]@w{ }@var{b}, int@w{ }@var{off}, int@w{ }@var{len}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod BufferedInputStream {public synchronized void} reset () @*throws IOException
-
-@end deftypemethod
-@deftypemethod BufferedInputStream {public synchronized long} skip (long@w{ }@var{n}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod BufferedOutputStream {public synchronized void} flush () @*throws IOException
-This method causes any currently buffered bytes to be immediately
- written to the underlying output stream.
-@end deftypemethod
-@deftypemethod BufferedOutputStream {public synchronized void} write (int@w{ }@var{b}) @*throws IOException
-This method writes a single byte of data. This will be written to the
- buffer instead of the underlying data source. However, if the buffer
- is filled as a result of this write request, it will be flushed to the
- underlying output stream.
-@end deftypemethod
-@deftypemethod BufferedOutputStream {public synchronized void} write (byte[]@w{ }@var{buf}, int@w{ }@var{offset}, int@w{ }@var{len}) @*throws IOException
-This method writes @code{len} bytes from the byte array
- @code{buf} starting at position @code{offset} in the buffer.
- These bytes will be written to the internal buffer. However, if this
- write operation fills the buffer, the buffer will be flushed to the
- underlying output stream.
-@end deftypemethod
-@deftypemethod BufferedReader {public void} close () @*throws IOException
-This method closes the stream
-@end deftypemethod
-@deftypemethod BufferedReader {public boolean} markSupported ()
-Returns @code{true} to indicate that this class supports mark/reset
- functionality.
-@end deftypemethod
-@deftypemethod BufferedReader {public void} mark (int@w{ }@var{readLimit}) @*throws IOException
-Mark a position in the input to which the stream can be
- "reset" by calling the @code{reset()} method. The parameter
- @code{readlimit} is the number of chars that can be read from the
- stream after setting the mark before the mark becomes invalid. For
- example, if @code{mark()} is called with a read limit of 10, then
- when 11 chars of data are read from the stream before the
- @code{reset()} method is called, then the mark is invalid and the
- stream object instance is not required to remember the mark.
-
-
-
- Note that the number of chars that can be remembered by this method
- can be greater than the size of the internal read buffer. It is also
- not dependent on the subordinate stream supporting mark/reset
- functionality.
-@end deftypemethod
-@deftypemethod BufferedReader {public void} reset () @*throws IOException
-Reset the stream to the point where the @code{mark()} method
- was called. Any chars that were read after the mark point was set will
- be re-read during subsequent reads.
-
-
-
- This method will throw an IOException if the number of chars read from
- the stream since the call to @code{mark()} exceeds the mark limit
- passed when establishing the mark.
-@end deftypemethod
-@deftypemethod BufferedReader {public boolean} ready () @*throws IOException
-This method determines whether or not a stream is ready to be read. If
- This method returns @code{false} then this stream could (but is
- not guaranteed to) block on the next read attempt.
-@end deftypemethod
-@deftypemethod BufferedReader {public int} read (char[]@w{ }@var{buf}, int@w{ }@var{offset}, int@w{ }@var{count}) @*throws IOException
-This method read chars from a stream and stores them into a caller
- supplied buffer. It starts storing the data at index @code{offset} into
- the buffer and attempts to read @code{len} chars. This method can
- return before reading the number of chars requested. The actual number
- of chars read is returned as an int. A -1 is returned to indicate the
- end of the stream.
-
-
-
- This method will block until some data can be read.
-@end deftypemethod
-@deftypemethod BufferedReader {public int} read () @*throws IOException
-
-@end deftypemethod
-@deftypemethod BufferedReader {public String} readLine () @*throws IOException
-This method reads a single line of text from the input stream, returning
- it as a @code{String}. A line is terminated by "\n", a "\r", or
- an "\r\n" sequence. The system dependent line separator is not used.
- The line termination characters are not returned in the resulting
- @code{String}.
-@end deftypemethod
-@deftypemethod BufferedReader {public long} skip (long@w{ }@var{count}) @*throws IOException
-This method skips the specified number of chars in the stream. It
- returns the actual number of chars skipped, which may be less than the
- requested amount.
-
-
-
- This method first discards chars in the buffer, then calls the
- @code{skip} method on the underlying stream to skip the remaining chars.
-@end deftypemethod
-@deftypemethod BufferedWriter {public void} close () @*throws IOException
-This method flushes any remaining buffered chars then closes the
- underlying output stream. Any further attempts to write to this stream
- may throw an exception
-@end deftypemethod
-@deftypemethod BufferedWriter {public void} flush () @*throws IOException
-This method causes any currently buffered chars to be immediately
- written to the underlying output stream.
-@end deftypemethod
-@deftypemethod BufferedWriter {public void} newLine () @*throws IOException
-This method writes out a system depedent line separator sequence. The
- actual value written is detemined from the <xmp>line.separator</xmp>
- system property.
-@end deftypemethod
-@deftypemethod BufferedWriter {public void} write (int@w{ }@var{oneChar}) @*throws IOException
-This method writes a single char of data. This will be written to the
- buffer instead of the underlying data source. However, if the buffer
- is filled as a result of this write request, it will be flushed to the
- underlying output stream.
-@end deftypemethod
-@deftypemethod BufferedWriter {public void} write (char[]@w{ }@var{buf}, int@w{ }@var{offset}, int@w{ }@var{len}) @*throws IOException
-This method writes @code{len} chars from the char array
- @code{buf} starting at position @code{offset} in the buffer.
- These chars will be written to the internal buffer. However, if this
- write operation fills the buffer, the buffer will be flushed to the
- underlying output stream.
-@end deftypemethod
-@deftypemethod BufferedWriter {public void} write (java.lang.String@w{ }@var{str}, int@w{ }@var{offset}, int@w{ }@var{len}) @*throws IOException
-This method writes @code{len} chars from the @code{String}
- @code{str} starting at position @code{offset} in the string.
- These chars will be written to the internal buffer. However, if this
- write operation fills the buffer, the buffer will be flushed to the
- underlying output stream.
-@end deftypemethod
-@deftypemethod ByteArrayInputStream {public synchronized int} available ()
-
-@end deftypemethod
-@deftypemethod ByteArrayInputStream {public synchronized void} mark (int@w{ }@var{readAheadLimit})
-
-@end deftypemethod
-@deftypemethod ByteArrayInputStream {public boolean} markSupported ()
-
-@end deftypemethod
-@deftypemethod ByteArrayInputStream {public synchronized int} read ()
-
-@end deftypemethod
-@deftypemethod ByteArrayInputStream {public synchronized int} read (byte[]@w{ }@var{b}, int@w{ }@var{off}, int@w{ }@var{len})
-
-@end deftypemethod
-@deftypemethod ByteArrayInputStream {public synchronized void} reset ()
-
-@end deftypemethod
-@deftypemethod ByteArrayInputStream {public synchronized long} skip (long@w{ }@var{n})
-
-@end deftypemethod
-@deftypemethod ByteArrayOutputStream {public synchronized void} reset ()
-This method discards all of the bytes that have been written to
- the internal buffer so far by setting the @code{count}
- variable to 0. The internal buffer remains at its currently
- allocated size.
-@end deftypemethod
-@deftypemethod ByteArrayOutputStream {public int} size ()
-This method returns the number of bytes that have been written to
- the buffer so far. This is the same as the value of the protected
- @code{count} variable. If the @code{reset} method is
- called, then this value is reset as well. Note that this method does
- not return the length of the internal buffer, but only the number
- of bytes that have been written to it.
-@end deftypemethod
-@deftypemethod ByteArrayOutputStream {public synchronized byte} toByteArray ()
-This method returns a byte array containing the bytes that have been
- written to this stream so far. This array is a copy of the valid
- bytes in the internal buffer and its length is equal to the number of
- valid bytes, not necessarily to the the length of the current
- internal buffer. Note that since this method allocates a new array,
- it should be used with caution when the internal buffer is very large.
-@end deftypemethod
-@deftypemethod ByteArrayOutputStream {public String} toString ()
-Returns the bytes in the internal array as a @code{String}. The
- bytes in the buffer are converted to characters using the system default
- encoding. There is an overloaded @code{toString()} method that
- allows an application specified character encoding to be used.
-@end deftypemethod
-@deftypemethod ByteArrayOutputStream {public String} toString (java.lang.String@w{ }@var{enc}) @*throws UnsupportedEncodingException
-Returns the bytes in the internal array as a @code{String}. The
- bytes in the buffer are converted to characters using the specified
- encoding.
-@end deftypemethod
-@deftypemethod ByteArrayOutputStream {public String} toString (int@w{ }@var{hibyte})
-This method returns the bytes in the internal array as a
- @code{String}. It uses each byte in the array as the low
- order eight bits of the Unicode character value and the passed in
- parameter as the high eight bits.
-
-
-
- This method does not convert bytes to characters in the proper way and
- so is deprecated in favor of the other overloaded @code{toString}
- methods which use a true character encoding.
-@end deftypemethod
-@deftypemethod ByteArrayOutputStream {public synchronized void} write (int@w{ }@var{oneByte})
-This method writes the writes the specified byte into the internal
- buffer.
-@end deftypemethod
-@deftypemethod ByteArrayOutputStream {public synchronized void} write (byte[]@w{ }@var{buffer}, int@w{ }@var{offset}, int@w{ }@var{add})
-This method writes @code{len} bytes from the passed in array
- @code{buf} starting at index @code{offset} into the
- internal buffer.
-@end deftypemethod
-@deftypemethod ByteArrayOutputStream {public synchronized void} writeTo (java.io.OutputStream@w{ }@var{out}) @*throws IOException
-This method writes all the bytes that have been written to this stream
- from the internal buffer to the specified @code{OutputStream}.
-@end deftypemethod
-@deftypemethod CharArrayReader {public void} close ()
-
-@end deftypemethod
-@deftypemethod CharArrayReader {public void} mark (int@w{ }@var{readAheadLimit})
-
-@end deftypemethod
-@deftypemethod CharArrayReader {public boolean} markSupported ()
-
-@end deftypemethod
-@deftypemethod CharArrayReader {public int} read () @*throws IOException
-
-@end deftypemethod
-@deftypemethod CharArrayReader {public int} read (char[]@w{ }@var{b}, int@w{ }@var{off}, int@w{ }@var{len}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod CharArrayReader {public boolean} ready () @*throws IOException
-
-@end deftypemethod
-@deftypemethod CharArrayReader {public void} reset () @*throws IOException
-
-@end deftypemethod
-@deftypemethod CharArrayReader {public long} skip (long@w{ }@var{n}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod CharArrayWriter {public void} close ()
-
-@end deftypemethod
-@deftypemethod CharArrayWriter {public void} flush ()
-
-@end deftypemethod
-@deftypemethod CharArrayWriter {public synchronized void} reset ()
-
-@end deftypemethod
-@deftypemethod CharArrayWriter {public int} size ()
-
-@end deftypemethod
-@deftypemethod CharArrayWriter {public char} toCharArray ()
-
-@end deftypemethod
-@deftypemethod CharArrayWriter {public String} toString ()
-
-@end deftypemethod
-@deftypemethod CharArrayWriter {public void} write (int@w{ }@var{oneChar})
-
-@end deftypemethod
-@deftypemethod CharArrayWriter {public void} write (char[]@w{ }@var{buffer}, int@w{ }@var{offset}, int@w{ }@var{len})
-
-@end deftypemethod
-@deftypemethod CharArrayWriter {public void} write (java.lang.String@w{ }@var{str}, int@w{ }@var{offset}, int@w{ }@var{len})
-
-@end deftypemethod
-@deftypemethod CharArrayWriter {public void} writeTo (java.io.Writer@w{ }@var{out}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod DataInput {public boolean} readBoolean () @*throws IOException
-
-@end deftypemethod
-@deftypemethod DataInput {public byte} readByte () @*throws IOException
-
-@end deftypemethod
-@deftypemethod DataInput {public char} readChar () @*throws IOException
-
-@end deftypemethod
-@deftypemethod DataInput {public double} readDouble () @*throws IOException
-
-@end deftypemethod
-@deftypemethod DataInput {public float} readFloat () @*throws IOException
-
-@end deftypemethod
-@deftypemethod DataInput {public void} readFully (byte[]@w{ }@var{b}) @*throws IOException, NullPointerException
-
-@end deftypemethod
-@deftypemethod DataInput {public void} readFully (byte[]@w{ }@var{b}, int@w{ }@var{off}, int@w{ }@var{len}) @*throws IOException, NullPointerException, IndexOutOfBoundsException
-
-@end deftypemethod
-@deftypemethod DataInput {public int} readInt () @*throws IOException
-
-@end deftypemethod
-@deftypemethod DataInput {public String} readLine () @*throws IOException
-
-@end deftypemethod
-@deftypemethod DataInput {public long} readLong () @*throws IOException
-
-@end deftypemethod
-@deftypemethod DataInput {public short} readShort () @*throws IOException
-
-@end deftypemethod
-@deftypemethod DataInput {public int} readUnsignedByte () @*throws IOException
-
-@end deftypemethod
-@deftypemethod DataInput {public int} readUnsignedShort () @*throws IOException
-
-@end deftypemethod
-@deftypemethod DataInput {public String} readUTF () @*throws IOException
-
-@end deftypemethod
-@deftypemethod DataInput {public int} skipBytes (int@w{ }@var{n}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod DataInputStream {public final int} read (byte[]@w{ }@var{b}) @*throws IOException
-This method reads bytes from the underlying stream into the specified
- byte array buffer. It will attempt to fill the buffer completely, but
- may return a short count if there is insufficient data remaining to be
- read to fill the buffer.
-@end deftypemethod
-@deftypemethod DataInputStream {public final int} read (byte[]@w{ }@var{b}, int@w{ }@var{off}, int@w{ }@var{len}) @*throws IOException
-This method reads bytes from the underlying stream into the specified
- byte array buffer. It will attempt to read @code{len} bytes and
- will start storing them at position @code{off} into the buffer.
- This method can return a short count if there is insufficient data
- remaining to be read to complete the desired read length.
-@end deftypemethod
-@deftypemethod DataInputStream {public final boolean} readBoolean () @*throws IOException
-This method reads a Java boolean value from an input stream. It does
- so by reading a single byte of data. If that byte is zero, then the
- value returned is @code{false}. If the byte is non-zero, then
- the value returned is @code{true}.
-
-
-
- This method can read a @code{boolean} written by an object
- implementing the @code{writeBoolean()} method in the
- @code{DataOutput} interface.
-@end deftypemethod
-@deftypemethod DataInputStream {public final byte} readByte () @*throws IOException
-This method reads a Java byte value from an input stream. The value
- is in the range of -128 to 127.
-
-
-
- This method can read a @code{byte} written by an object
- implementing the @code{writeByte()} method in the
- @code{DataOutput} interface.
-@end deftypemethod
-@deftypemethod DataInputStream {public final char} readChar () @*throws IOException
-This method reads a Java @code{char} value from an input stream.
- It operates by reading two bytes from the stream and converting them to
- a single 16-bit Java @code{char}. The two bytes are stored most
- significant byte first (i.e., "big endian") regardless of the native
- host byte ordering.
-
-
-
- As an example, if @code{byte1} and @code{byte2}
- represent the first and second byte read from the stream
- respectively, they will be transformed to a @code{char} in
- the following manner:
-
-
-
- @code{(char)(((byte1 & 0xFF) << 8) | (byte2 & 0xFF)}
-
-
-
- This method can read a @code{char} written by an object
- implementing the @code{writeChar()} method in the
- @code{DataOutput} interface.
-@end deftypemethod
-@deftypemethod DataInputStream {public final double} readDouble () @*throws IOException
-This method reads a Java double value from an input stream. It operates
- by first reading a @code{long} value from the stream by calling the
- @code{readLong()} method in this interface, then converts
- that @code{long} to a @code{double} using the
- @code{longBitsToDouble} method in the class
- @code{java.lang.Double}
-
-
-
- This method can read a @code{double} written by an object
- implementing the @code{writeDouble()} method in the
- @code{DataOutput} interface.
-@end deftypemethod
-@deftypemethod DataInputStream {public final float} readFloat () @*throws IOException
-This method reads a Java float value from an input stream. It
- operates by first reading an @code{int} value from the
- stream by calling the @code{readInt()} method in this
- interface, then converts that @code{int} to a
- @code{float} using the @code{intBitsToFloat} method
- in the class @code{java.lang.Float}
-
-
-
- This method can read a @code{float} written by an object
- implementing the * @code{writeFloat()} method in the
- @code{DataOutput} interface.
-@end deftypemethod
-@deftypemethod DataInputStream {public final void} readFully (byte[]@w{ }@var{b}) @*throws IOException
-This method reads raw bytes into the passed array until the array is
- full. Note that this method blocks until the data is available and
- throws an exception if there is not enough data left in the stream to
- fill the buffer
-@end deftypemethod
-@deftypemethod DataInputStream {public final void} readFully (byte[]@w{ }@var{b}, int@w{ }@var{off}, int@w{ }@var{len}) @*throws IOException
-This method reads raw bytes into the passed array
- @code{buf} starting @code{offset} bytes into the
- buffer. The number of bytes read will be exactly
- @code{len} Note that this method blocks until the data is
- available and * throws an exception if there is not enough data
- left in the stream to read @code{len} bytes.
-@end deftypemethod
-@deftypemethod DataInputStream {public final int} readInt () @*throws IOException
-This method reads a Java @code{int} value from an input
- stream It operates by reading four bytes from the stream and
- converting them to a single Java @code{int} The bytes are
- stored most significant byte first (i.e., "big endian")
- regardless of the native host byte ordering.
-
-
-
- As an example, if @code{byte1} through @code{byte4}
- represent the first four bytes read from the stream, they will be
- transformed to an @code{int} in the following manner:
-
-
-
- @code{(int)(((byte1 & 0xFF) << 24) + ((byte2 & 0xFF) << 16) +
- ((byte3 & 0xFF) << 8) + (byte4 & 0xFF)))}
-
-
-
- The value returned is in the range of 0 to 65535.
-
-
-
- This method can read an @code{int} written by an object
- implementing the @code{writeInt()} method in the
- @code{DataOutput} interface.
-@end deftypemethod
-@deftypemethod DataInputStream {public final String} readLine () @*throws IOException
-This method reads the next line of text data from an input
- stream. It operates by reading bytes and converting those bytes
- to @code{char} values by treating the byte read as the low
- eight bits of the @code{char} and using 0 as the high eight
- bits. Because of this, it does not support the full 16-bit
- Unicode character set.
-
-
-
- The reading of bytes ends when either the end of file or a line
- terminator is encountered. The bytes read are then returned as a
- @code{String} A line terminator is a byte sequence
- consisting of either @code{\r}, @code{\n} or
- @code{\r\n}. These termination charaters are discarded and
- are not returned as part of the string.
-
-
-
- This method can read data that was written by an object implementing the
- @code{writeLine()} method in @code{DataOutput}.
-@end deftypemethod
-@deftypemethod DataInputStream {public final long} readLong () @*throws IOException
-This method reads a Java long value from an input stream
- It operates by reading eight bytes from the stream and converting them to
- a single Java @code{long} The bytes are stored most
- significant byte first (i.e., "big endian") regardless of the native
- host byte ordering.
-
-
-
- As an example, if @code{byte1} through @code{byte8}
- represent the first eight bytes read from the stream, they will
- be transformed to an @code{long} in the following manner:
-
-
-
- @code{(long)((((long)byte1 & 0xFF) << 56) + (((long)byte2 & 0xFF) << 48) +
- (((long)byte3 & 0xFF) << 40) + (((long)byte4 & 0xFF) << 32) +
- (((long)byte5 & 0xFF) << 24) + (((long)byte6 & 0xFF) << 16) +
- (((long)byte7 & 0xFF) << 8) + ((long)byte9 & 0xFF)))}
-
-
-
- The value returned is in the range of 0 to 65535.
-
-
-
- This method can read an @code{long} written by an object
- implementing the @code{writeLong()} method in the
- @code{DataOutput} interface.
-@end deftypemethod
-@deftypemethod DataInputStream {public final short} readShort () @*throws IOException
-This method reads a signed 16-bit value into a Java in from the
- stream. It operates by reading two bytes from the stream and
- converting them to a single 16-bit Java @code{short}. The
- two bytes are stored most significant byte first (i.e., "big
- endian") regardless of the native host byte ordering.
-
-
-
- As an example, if @code{byte1} and @code{byte2}
- represent the first and second byte read from the stream
- respectively, they will be transformed to a @code{short}. in
- the following manner:
-
-
-
- @code{(short)(((byte1 & 0xFF) << 8) | (byte2 & 0xFF)}
-
-
-
- The value returned is in the range of -32768 to 32767.
-
-
-
- This method can read a @code{short} written by an object
- implementing the @code{writeShort()} method in the
- @code{DataOutput} interface.
-@end deftypemethod
-@deftypemethod DataInputStream {public final int} readUnsignedByte () @*throws IOException
-This method reads 8 unsigned bits into a Java @code{int}
- value from the stream. The value returned is in the range of 0 to
- 255.
-
-
-
- This method can read an unsigned byte written by an object
- implementing the @code{writeUnsignedByte()} method in the
- @code{DataOutput} interface.
-@end deftypemethod
-@deftypemethod DataInputStream {public final int} readUnsignedShort () @*throws IOException
-This method reads 16 unsigned bits into a Java int value from the stream.
- It operates by reading two bytes from the stream and converting them to
- a single Java @code{int} The two bytes are stored most
- significant byte first (i.e., "big endian") regardless of the native
- host byte ordering.
-
-
-
- As an example, if @code{byte1} and @code{byte2}
- represent the first and second byte read from the stream
- respectively, they will be transformed to an @code{int} in
- the following manner:
-
-
-
- @code{(int)(((byte1 & 0xFF) << 8) + (byte2 & 0xFF))}
-
-
-
- The value returned is in the range of 0 to 65535.
-
-
-
- This method can read an unsigned short written by an object
- implementing the @code{writeUnsignedShort()} method in the
- @code{DataOutput} interface.
-@end deftypemethod
-@deftypemethod DataInputStream {public final String} readUTF () @*throws IOException
-This method reads a @code{String} from an input stream that
- is encoded in a modified UTF-8 format. This format has a leading
- two byte sequence that contains the remaining number of bytes to
- read. This two byte sequence is read using the
- @code{readUnsignedShort()} method of this interface.
-
-
-
- After the number of remaining bytes have been determined, these
- bytes are read an transformed into @code{char} values.
- These @code{char} values are encoded in the stream using
- either a one, two, or three byte format. The particular format
- in use can be determined by examining the first byte read.
-
-
-
- If the first byte has a high order bit of 0, then that character
- consists on only one byte. This character value consists of
- seven bits that are at positions 0 through 6 of the byte. As an
- example, if @code{byte1} is the byte read from the stream,
- it would be converted to a @code{char} like so:
-
-
-
- @code{(char)byte1}
-
-
-
- If the first byte has 110 as its high order bits, then the
- character consists of two bytes. The bits that make up the character
- value are in positions 0 through 4 of the first byte and bit positions
- 0 through 5 of the second byte. (The second byte should have
- 10 as its high order bits). These values are in most significant
- byte first (i.e., "big endian") order.
-
-
-
- As an example, if @code{byte1} and @code{byte2} are
- the first two bytes read respectively, and the high order bits of
- them match the patterns which indicate a two byte character
- encoding, then they would be converted to a Java
- @code{char} like so:
-
-
-
- @code{(char)(((byte1 & 0x1F) << 6) | (byte2 & 0x3F))}
-
-
-
- If the first byte has a 1110 as its high order bits, then the
- character consists of three bytes. The bits that make up the character
- value are in positions 0 through 3 of the first byte and bit positions
- 0 through 5 of the other two bytes. (The second and third bytes should
- have 10 as their high order bits). These values are in most
- significant byte first (i.e., "big endian") order.
-
-
-
- As an example, if @code{byte1} @code{byte2} and
- @code{byte3} are the three bytes read, and the high order
- bits of them match the patterns which indicate a three byte
- character encoding, then they would be converted to a Java
- @code{char} like so:
-
-
-
- @code{(char)(((byte1 & 0x0F) << 12) | ((byte2 & 0x3F) << 6) | (byte3 & 0x3F))}
-
-
-
- Note that all characters are encoded in the method that requires
- the fewest number of bytes with the exception of the character
- with the value of @code{&#92;u0000} which is encoded as two
- bytes. This is a modification of the UTF standard used to
- prevent C language style @code{NUL} values from appearing
- in the byte stream.
-
-
-
- This method can read data that was written by an object implementing the
- @code{writeUTF()} method in @code{DataOutput}
-@end deftypemethod
-@deftypemethod DataInputStream {public static final String} readUTF (java.io.DataInput@w{ }@var{in}) @*throws IOException
-This method reads a String encoded in UTF-8 format from the
- specified @code{DataInput} source.
-@end deftypemethod
-@deftypemethod DataInputStream {public final int} skipBytes (int@w{ }@var{n}) @*throws IOException
-This method attempts to skip and discard the specified number of bytes
- in the input stream. It may actually skip fewer bytes than requested.
- This method will not skip any bytes if passed a negative number of bytes
- to skip.
-@end deftypemethod
-@deftypemethod DataOutput {public void} write (int@w{ }@var{b}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod DataOutput {public void} write (byte[]@w{ }@var{b}) @*throws IOException, NullPointerException
-
-@end deftypemethod
-@deftypemethod DataOutput {public void} write (byte[]@w{ }@var{b}, int@w{ }@var{off}, int@w{ }@var{len}) @*throws IOException, NullPointerException, IndexOutOfBoundsException
-
-@end deftypemethod
-@deftypemethod DataOutput {public void} writeBoolean (boolean@w{ }@var{v}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod DataOutput {public void} writeByte (int@w{ }@var{v}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod DataOutput {public void} writeShort (int@w{ }@var{v}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod DataOutput {public void} writeChar (int@w{ }@var{v}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod DataOutput {public void} writeInt (int@w{ }@var{v}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod DataOutput {public void} writeLong (long@w{ }@var{v}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod DataOutput {public void} writeFloat (float@w{ }@var{v}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod DataOutput {public void} writeDouble (double@w{ }@var{v}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod DataOutput {public void} writeBytes (java.lang.String@w{ }@var{s}) @*throws IOException, NullPointerException
-
-@end deftypemethod
-@deftypemethod DataOutput {public void} writeChars (java.lang.String@w{ }@var{s}) @*throws IOException, NullPointerException
-
-@end deftypemethod
-@deftypemethod DataOutput {public void} writeUTF (java.lang.String@w{ }@var{s}) @*throws IOException, NullPointerException
-
-@end deftypemethod
-@deftypemethod DataOutputStream {public void} flush () @*throws IOException
-
-@end deftypemethod
-@deftypemethod DataOutputStream {public final int} size ()
-
-@end deftypemethod
-@deftypemethod DataOutputStream {public synchronized void} write (int@w{ }@var{b}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod DataOutputStream {public synchronized void} write (byte[]@w{ }@var{b}, int@w{ }@var{off}, int@w{ }@var{len}) @*throws IOException, NullPointerException, IndexOutOfBoundsException
-
-@end deftypemethod
-@deftypemethod DataOutputStream {public final void} writeBoolean (boolean@w{ }@var{v}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod DataOutputStream {public final void} writeByte (int@w{ }@var{v}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod DataOutputStream {public final void} writeShort (int@w{ }@var{v}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod DataOutputStream {public final void} writeChar (int@w{ }@var{v}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod DataOutputStream {public final void} writeInt (int@w{ }@var{v}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod DataOutputStream {public final void} writeLong (long@w{ }@var{v}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod DataOutputStream {public final void} writeFloat (float@w{ }@var{v}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod DataOutputStream {public final void} writeDouble (double@w{ }@var{v}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod DataOutputStream {public final void} writeBytes (java.lang.String@w{ }@var{s}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod DataOutputStream {public final void} writeChars (java.lang.String@w{ }@var{s}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod DataOutputStream {public final void} writeUTF (java.lang.String@w{ }@var{s}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod Externalizable {public void} readExternal (java.io.ObjectInput@w{ }@var{in}) @*throws ClassNotFoundException, IOException
-This method restores an object's state by reading in the instance data
- for the object from the passed in stream. Note that this stream is not
- a subclass of @code{InputStream}, but rather is a class that implements
- the @code{ObjectInput} interface. That interface provides a mechanism for
- reading in Java data types from a stream.
-
-
-
- Note that this method must be compatible with @code{writeExternal}.
- It must read back the exact same types that were written by that
- method in the exact order they were written.
-
-
-
- If this method needs to read back an object instance, then the class
- for that object must be found and loaded. If that operation fails,
- then this method throws a @code{ClassNotFoundException}
-@end deftypemethod
-@deftypemethod Externalizable {public void} writeExternal (java.io.ObjectOutput@w{ }@var{out}) @*throws IOException
-This method is responsible for writing the instance data of an object
- to the passed in stream. Note that this stream is not a subclass of
- @code{OutputStream}, but rather is a class that implements the
- @code{ObjectOutput} interface. That interface provides a number of methods
- for writing Java data values to a stream.
-
-
-
- Not that the implementation of this method must be coordinated with
- the implementation of @code{readExternal}.
-@end deftypemethod
-@deftypemethod FileDescriptor {public native void} sync () @*throws SyncFailedException
-
-@end deftypemethod
-@deftypemethod FileDescriptor {public native boolean} valid ()
-
-@end deftypemethod
-@deftypemethod FileDescriptor {protected void} finalize () @*throws IOException
-
-@end deftypemethod
-@deftypemethod FileFilter {public boolean} accept (java.io.File@w{ }@var{pathname})
-This method determines whether or not a given pathname should be included
- in a pathname listing.
-@end deftypemethod
-@deftypemethod FileInputStream {public int} available () @*throws IOException
-
-@end deftypemethod
-@deftypemethod FileInputStream {public void} close () @*throws IOException
-
-@end deftypemethod
-@deftypemethod FileInputStream {protected void} finalize () @*throws IOException
-
-@end deftypemethod
-@deftypemethod FileInputStream {public final FileDescriptor} getFD () @*throws IOException
-
-@end deftypemethod
-@deftypemethod FileInputStream {public int} read () @*throws IOException
-
-@end deftypemethod
-@deftypemethod FileInputStream {public int} read (byte[]@w{ }@var{b}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod FileInputStream {public int} read (byte[]@w{ }@var{b}, int@w{ }@var{off}, int@w{ }@var{len}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod FileInputStream {public long} skip (long@w{ }@var{n}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod File {public boolean} canRead ()
-
-@end deftypemethod
-@deftypemethod File {public boolean} canWrite ()
-
-@end deftypemethod
-@deftypemethod File {public boolean} delete ()
-
-@end deftypemethod
-@deftypemethod File {public boolean} equals (java.lang.Object@w{ }@var{obj})
-
-@end deftypemethod
-@deftypemethod File {public boolean} exists ()
-
-@end deftypemethod
-@deftypemethod File {public String} getAbsolutePath ()
-
-@end deftypemethod
-@deftypemethod File {public native String} getCanonicalPath () @*throws IOException
-
-@end deftypemethod
-@deftypemethod File {public String} getName ()
-
-@end deftypemethod
-@deftypemethod File {public String} getParent ()
-
-@end deftypemethod
-@deftypemethod File {public File} getParentFile ()
-
-@end deftypemethod
-@deftypemethod File {public String} getPath ()
-
-@end deftypemethod
-@deftypemethod File {public int} hashCode ()
-
-@end deftypemethod
-@deftypemethod File {public native boolean} isAbsolute ()
-
-@end deftypemethod
-@deftypemethod File {public boolean} isDirectory ()
-
-@end deftypemethod
-@deftypemethod File {public boolean} isFile ()
-
-@end deftypemethod
-@deftypemethod File {public long} lastModified ()
-
-@end deftypemethod
-@deftypemethod File {public long} length ()
-
-@end deftypemethod
-@deftypemethod File {public String} list (java.io.FilenameFilter@w{ }@var{filter})
-
-@end deftypemethod
-@deftypemethod File {public String} list ()
-
-@end deftypemethod
-@deftypemethod File {public String} toString ()
-
-@end deftypemethod
-@deftypemethod File {public boolean} mkdir ()
-
-@end deftypemethod
-@deftypemethod File {public boolean} mkdirs ()
-
-@end deftypemethod
-@deftypemethod File {public static File} createTempFile (java.lang.String@w{ }@var{prefix}, java.lang.String@w{ }@var{suffix}, java.io.File@w{ }@var{directory}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod File {public static File} createTempFile (java.lang.String@w{ }@var{prefix}, java.lang.String@w{ }@var{suffix}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod File {public boolean} renameTo (java.io.File@w{ }@var{dest})
-
-@end deftypemethod
-@deftypemethod File {public void} deleteOnExit ()
-
-@end deftypemethod
-@deftypemethod FilenameFilter {public boolean} accept (java.io.File@w{ }@var{dir}, java.lang.String@w{ }@var{name})
-
-@end deftypemethod
-@deftypemethod FileOutputStream {protected void} finalize () @*throws IOException
-
-@end deftypemethod
-@deftypemethod FileOutputStream {public final FileDescriptor} getFD () @*throws IOException
-
-@end deftypemethod
-@deftypemethod FileOutputStream {public void} write (int@w{ }@var{b}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod FileOutputStream {public void} write (byte[]@w{ }@var{b}) @*throws IOException, NullPointerException
-
-@end deftypemethod
-@deftypemethod FileOutputStream {public void} write (byte[]@w{ }@var{b}, int@w{ }@var{off}, int@w{ }@var{len}) @*throws IOException, NullPointerException, IndexOutOfBoundsException
-
-@end deftypemethod
-@deftypemethod FileOutputStream {public void} close () @*throws IOException
-
-@end deftypemethod
-@deftypemethod FilePermission {public String} getActions ()
-Get the actions this FilePermission supports.
-@end deftypemethod
-@deftypemethod FilePermission {public int} hashCode ()
-Get the hash code for this Object.
-
-
- FilePermission's hash code is calculated as the exclusive or of the target
- String's hash code and the action String's hash code.
-@end deftypemethod
-@deftypemethod FilePermission {public boolean} equals (java.lang.Object@w{ }@var{o})
-Check two FilePermissions for semantic equality.
- Two FilePermissions are exactly equivalent if they have identical path
- expressions and have exactly the same access permissions.
-@end deftypemethod
-@deftypemethod FilePermission {public boolean} implies (java.security.Permission@w{ }@var{p})
-Check to see if this permission implies another.
- Permission A implies permission B if these things are all true:
-
-@itemize @bullet
-
-
-@item
-A and B are both FilePermissions.
-
-
-@item
-All possible files in B are included in A (possibly more are in A).
-
-
-@item
-All actions B supports, A also supports.
-
-
-@end itemize
-
-@end deftypemethod
-@deftypemethod FilterInputStream {public int} available () @*throws IOException
-
-@end deftypemethod
-@deftypemethod FilterInputStream {public void} close () @*throws IOException
-
-@end deftypemethod
-@deftypemethod FilterInputStream {public synchronized void} mark (int@w{ }@var{readlimit})
-
-@end deftypemethod
-@deftypemethod FilterInputStream {public boolean} markSupported ()
-
-@end deftypemethod
-@deftypemethod FilterInputStream {public int} read () @*throws IOException
-
-@end deftypemethod
-@deftypemethod FilterInputStream {public int} read (byte[]@w{ }@var{b}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod FilterInputStream {public int} read (byte[]@w{ }@var{b}, int@w{ }@var{off}, int@w{ }@var{len}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod FilterInputStream {public synchronized void} reset () @*throws IOException
-
-@end deftypemethod
-@deftypemethod FilterInputStream {public long} skip (long@w{ }@var{n}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod FilterOutputStream {public void} close () @*throws IOException
-
-@end deftypemethod
-@deftypemethod FilterOutputStream {public void} flush () @*throws IOException
-
-@end deftypemethod
-@deftypemethod FilterOutputStream {public void} write (int@w{ }@var{b}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod FilterOutputStream {public void} write (byte[]@w{ }@var{b}) @*throws IOException, NullPointerException
-
-@end deftypemethod
-@deftypemethod FilterOutputStream {public void} write (byte[]@w{ }@var{b}, int@w{ }@var{off}, int@w{ }@var{len}) @*throws IOException, NullPointerException, IndexOutOfBoundsException
-
-@end deftypemethod
-@deftypemethod FilterReader {public void} close () @*throws IOException
-
-@end deftypemethod
-@deftypemethod FilterReader {public synchronized void} mark (int@w{ }@var{readlimit}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod FilterReader {public boolean} markSupported ()
-
-@end deftypemethod
-@deftypemethod FilterReader {public int} read () @*throws IOException
-
-@end deftypemethod
-@deftypemethod FilterReader {public int} read (char[]@w{ }@var{b}, int@w{ }@var{off}, int@w{ }@var{len}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod FilterReader {public boolean} ready () @*throws IOException
-
-@end deftypemethod
-@deftypemethod FilterReader {public synchronized void} reset () @*throws IOException
-
-@end deftypemethod
-@deftypemethod FilterReader {public long} skip (long@w{ }@var{n}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod FilterWriter {public void} close () @*throws IOException
-
-@end deftypemethod
-@deftypemethod FilterWriter {public void} flush () @*throws IOException
-
-@end deftypemethod
-@deftypemethod FilterWriter {public void} write (int@w{ }@var{oneChar}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod FilterWriter {public void} write (char[]@w{ }@var{buffer}, int@w{ }@var{offset}, int@w{ }@var{count}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod FilterWriter {public void} write (java.lang.String@w{ }@var{str}, int@w{ }@var{offset}, int@w{ }@var{count}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod InputStream {public int} available () @*throws IOException
-
-@end deftypemethod
-@deftypemethod InputStream {public void} close () @*throws IOException
-
-@end deftypemethod
-@deftypemethod InputStream {public void} mark (int@w{ }@var{readlimit})
-
-@end deftypemethod
-@deftypemethod InputStream {public boolean} markSupported ()
-
-@end deftypemethod
-@deftypemethod InputStream {public abstract int} read () @*throws IOException
-
-@end deftypemethod
-@deftypemethod InputStream {public int} read (byte[]@w{ }@var{b}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod InputStream {public int} read (byte[]@w{ }@var{b}, int@w{ }@var{off}, int@w{ }@var{len}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod InputStream {public void} reset () @*throws IOException
-
-@end deftypemethod
-@deftypemethod InputStream {public long} skip (long@w{ }@var{n}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod InputStreamReader {public void} close () @*throws IOException
-
-@end deftypemethod
-@deftypemethod InputStreamReader {public String} getEncoding ()
-
-@end deftypemethod
-@deftypemethod InputStreamReader {public boolean} ready () @*throws IOException
-
-@end deftypemethod
-@deftypemethod InputStreamReader {public int} read (char[]@w{ }@var{buf}, int@w{ }@var{offset}, int@w{ }@var{length}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod InputStreamReader {public int} read () @*throws IOException
-
-@end deftypemethod
-@deftypemethod InvalidClassException {public String} getMessage ()
-Returns the descriptive error message for this exception. It will
- include the class name that caused the problem if known. This method
- overrides Throwable.getMessage()
-@end deftypemethod
-@deftypemethod LineNumberInputStream {public int} available () @*throws IOException
-
-@end deftypemethod
-@deftypemethod LineNumberInputStream {public int} getLineNumber ()
-
-@end deftypemethod
-@deftypemethod LineNumberInputStream {public void} mark (int@w{ }@var{readlimit})
-
-@end deftypemethod
-@deftypemethod LineNumberInputStream {public int} read () @*throws IOException
-
-@end deftypemethod
-@deftypemethod LineNumberInputStream {public int} read (byte[]@w{ }@var{b}, int@w{ }@var{off}, int@w{ }@var{len}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod LineNumberInputStream {public void} reset () @*throws IOException
-
-@end deftypemethod
-@deftypemethod LineNumberInputStream {public void} setLineNumber (int@w{ }@var{lineNumber})
-
-@end deftypemethod
-@deftypemethod LineNumberInputStream {public long} skip (long@w{ }@var{n}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod LineNumberReader {public int} getLineNumber ()
-
-@end deftypemethod
-@deftypemethod LineNumberReader {public void} setLineNumber (int@w{ }@var{lineNumber})
-
-@end deftypemethod
-@deftypemethod LineNumberReader {public void} mark (int@w{ }@var{readLimit}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod LineNumberReader {public void} reset () @*throws IOException
-
-@end deftypemethod
-@deftypemethod LineNumberReader {public int} read () @*throws IOException
-
-@end deftypemethod
-@deftypemethod LineNumberReader {public int} read (char[]@w{ }@var{buf}, int@w{ }@var{offset}, int@w{ }@var{count}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod LineNumberReader {public String} readLine () @*throws IOException
-
-@end deftypemethod
-@deftypemethod LineNumberReader {public long} skip (long@w{ }@var{count}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod ObjectInput {public int} available () @*throws IOException
-This method returns the number of bytes that can be read without
- blocking.
-@end deftypemethod
-@deftypemethod ObjectInput {public int} read () @*throws IOException
-This method reading a byte of data from a stream. It returns that byte
- as an int. This method blocks if no data is available to be read.
-@end deftypemethod
-@deftypemethod ObjectInput {public int} read (byte[]@w{ }@var{buf}) @*throws IOException
-This method reads raw bytes and stores them them a byte array buffer.
- Note that this method will block if no data is available. However,
- it will not necessarily block until it fills the entire buffer. That is,
- a "short count" is possible.
-@end deftypemethod
-@deftypemethod ObjectInput {public int} read (byte[]@w{ }@var{buf}, int@w{ }@var{offset}, int@w{ }@var{len}) @*throws IOException
-This method reads raw bytes and stores them in a byte array buffer
- @code{buf} starting at position @code{offset} into the buffer. A
- maximum of @code{len} bytes will be read. Note that this method
- blocks if no data is available, but will not necessarily block until
- it can read @code{len} bytes of data. That is, a "short count" is
- possible.
-@end deftypemethod
-@deftypemethod ObjectInput {public Object} readObject () @*throws ClassNotFoundException, IOException
-Reads an object instance and returns it. If the class for the object
- being read cannot be found, then a ClassNotFoundException will
- be thrown.
-@end deftypemethod
-@deftypemethod ObjectInput {public long} skip (long@w{ }@var{num_bytes}) @*throws IOException
-This method causes the specified number of bytes to be read and
- discarded. It is possible that fewer than the requested number of bytes
- will actually be skipped.
-@end deftypemethod
-@deftypemethod ObjectInput {public void} close () @*throws IOException
-This method closes the input source
-@end deftypemethod
-@deftypemethod ObjectInputStream {public final Object} readObject () @*throws ClassNotFoundException, IOException
-Returns the next deserialized object read from the underlying stream.
-
-This method can be overriden by a class by implementing
-@code{private void readObject (ObjectInputStream)}.
-
-If an exception is thrown from this method, the stream is left in
-an undefined state.
-@end deftypemethod
-@deftypemethod ObjectInputStream {public void} defaultReadObject () @*throws ClassNotFoundException, IOException, NotActiveException
-Reads the current objects non-transient, non-static fields from
-the current class from the underlying output stream.
-
-This method is intended to be called from within a object's
-@code{private void readObject (ObjectInputStream)}
-method.
-@end deftypemethod
-@deftypemethod ObjectInputStream {public void} registerValidation (java.io.ObjectInputValidation@w{ }@var{validator}, int@w{ }@var{priority}) @*throws InvalidObjectException, NotActiveException
-Registers a @code{ObjectInputValidation} to be carried out
-on the object graph currently being deserialized before it is
-returned to the original caller of @code{readObject ()}.
-The order of validation for multiple
-@code{ObjectInputValidation}s can be controled using
-@code{priority}. Validators with higher priorities are
-called first.
-@end deftypemethod
-@deftypemethod ObjectInputStream {protected Class} resolveClass (java.io.ObjectStreamClass@w{ }@var{osc}) @*throws ClassNotFoundException, IOException
-Called when a class is being deserialized. This is a hook to
-allow subclasses to read in information written by the
-@code{annotateClass (Class)} method of an
-@code{ObjectOutputStream}.
-
-This implementation looks up the active call stack for a
-@code{ClassLoader}; if a @code{ClassLoader} is found,
-it is used to load the class associated with @code{osc},
-otherwise, the default system @code{ClassLoader} is used.
-@end deftypemethod
-@deftypemethod ObjectInputStream {protected Object} resolveObject (java.lang.Object@w{ }@var{obj}) @*throws IOException
-Allows subclasses to resolve objects that are read from the
-stream with other objects to be returned in their place. This
-method is called the first time each object is encountered.
-
-This method must be enabled before it will be called in the
-serialization process.
-@end deftypemethod
-@deftypemethod ObjectInputStream {protected boolean} enableResolveObject (boolean@w{ }@var{enable}) @*throws SecurityException
-If @code{enable} is @code{true} and this object is
-trusted, then @code{resolveObject (Object)} will be called
-in subsequent calls to @code{readObject (Object)}.
-Otherwise, @code{resolveObject (Object)} will not be called.
-@end deftypemethod
-@deftypemethod ObjectInputStream {protected void} readStreamHeader () @*throws IOException, StreamCorruptedException
-Reads stream magic and stream version information from the
-underlying stream.
-@end deftypemethod
-@deftypemethod ObjectInputStream {public int} read () @*throws IOException
-
-@end deftypemethod
-@deftypemethod ObjectInputStream {public int} read (byte[]@w{ }@var{data}, int@w{ }@var{offset}, int@w{ }@var{length}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod ObjectInputStream {public int} available () @*throws IOException
-
-@end deftypemethod
-@deftypemethod ObjectInputStream {public void} close () @*throws IOException
-
-@end deftypemethod
-@deftypemethod ObjectInputStream {public boolean} readBoolean () @*throws IOException
-
-@end deftypemethod
-@deftypemethod ObjectInputStream {public byte} readByte () @*throws IOException
-
-@end deftypemethod
-@deftypemethod ObjectInputStream {public int} readUnsignedByte () @*throws IOException
-
-@end deftypemethod
-@deftypemethod ObjectInputStream {public short} readShort () @*throws IOException
-
-@end deftypemethod
-@deftypemethod ObjectInputStream {public int} readUnsignedShort () @*throws IOException
-
-@end deftypemethod
-@deftypemethod ObjectInputStream {public char} readChar () @*throws IOException
-
-@end deftypemethod
-@deftypemethod ObjectInputStream {public int} readInt () @*throws IOException
-
-@end deftypemethod
-@deftypemethod ObjectInputStream {public long} readLong () @*throws IOException
-
-@end deftypemethod
-@deftypemethod ObjectInputStream {public float} readFloat () @*throws IOException
-
-@end deftypemethod
-@deftypemethod ObjectInputStream {public double} readDouble () @*throws IOException
-
-@end deftypemethod
-@deftypemethod ObjectInputStream {public void} readFully (byte[]@w{ }@var{data}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod ObjectInputStream {public void} readFully (byte[]@w{ }@var{data}, int@w{ }@var{offset}, int@w{ }@var{size}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod ObjectInputStream {public int} skipBytes (int@w{ }@var{len}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod ObjectInputStream {public String} readLine () @*throws IOException
-
-@end deftypemethod
-@deftypemethod ObjectInputStream {public String} readUTF () @*throws IOException
-
-@end deftypemethod
-@deftypemethod ObjectInputStream {public ObjectInputStream.GetField} readFields () @*throws IOException, ClassNotFoundException, NotActiveException
-
-@end deftypemethod
-@deftypemethod ObjectInputStream {protected Object} readObjectOverride () @*throws ClassNotFoundException, IOException, OptionalDataException
-This method allows subclasses to override the default
-de serialization mechanism provided by
-@code{ObjectInputStream}. To make this method be used for
-writing objects, subclasses must invoke the 0-argument
-constructor on this class from there constructor.
-@end deftypemethod
-@deftypemethod ObjectInputStream.GetField {public abstract ObjectStreamClass} getObjectStreamClass ()
-
-@end deftypemethod
-@deftypemethod ObjectInputStream.GetField {public abstract boolean} defaulted (java.lang.String@w{ }@var{name}) @*throws IOException, IllegalArgumentException
-
-@end deftypemethod
-@deftypemethod ObjectInputStream.GetField {public abstract boolean} get (java.lang.String@w{ }@var{name}, boolean@w{ }@var{defvalue}) @*throws IOException, IllegalArgumentException
-
-@end deftypemethod
-@deftypemethod ObjectInputStream.GetField {public abstract char} get (java.lang.String@w{ }@var{name}, char@w{ }@var{defvalue}) @*throws IOException, IllegalArgumentException
-
-@end deftypemethod
-@deftypemethod ObjectInputStream.GetField {public abstract byte} get (java.lang.String@w{ }@var{name}, byte@w{ }@var{defvalue}) @*throws IOException, IllegalArgumentException
-
-@end deftypemethod
-@deftypemethod ObjectInputStream.GetField {public abstract short} get (java.lang.String@w{ }@var{name}, short@w{ }@var{defvalue}) @*throws IOException, IllegalArgumentException
-
-@end deftypemethod
-@deftypemethod ObjectInputStream.GetField {public abstract int} get (java.lang.String@w{ }@var{name}, int@w{ }@var{defvalue}) @*throws IOException, IllegalArgumentException
-
-@end deftypemethod
-@deftypemethod ObjectInputStream.GetField {public abstract long} get (java.lang.String@w{ }@var{name}, long@w{ }@var{defvalue}) @*throws IOException, IllegalArgumentException
-
-@end deftypemethod
-@deftypemethod ObjectInputStream.GetField {public abstract float} get (java.lang.String@w{ }@var{name}, float@w{ }@var{defvalue}) @*throws IOException, IllegalArgumentException
-
-@end deftypemethod
-@deftypemethod ObjectInputStream.GetField {public abstract double} get (java.lang.String@w{ }@var{name}, double@w{ }@var{defvalue}) @*throws IOException, IllegalArgumentException
-
-@end deftypemethod
-@deftypemethod ObjectInputStream.GetField {public abstract Object} get (java.lang.String@w{ }@var{name}, java.lang.Object@w{ }@var{defvalue}) @*throws IOException, IllegalArgumentException
-
-@end deftypemethod
-@deftypemethod ObjectInputValidation {public void} validateObject () @*throws InvalidObjectException
-This method is called to validate an object. If the object is invalid
- an exception is thrown.
-@end deftypemethod
-@deftypemethod ObjectOutput {public void} write (int@w{ }@var{b}) @*throws IOException
-This method writes the specified byte to the output stream.
-@end deftypemethod
-@deftypemethod ObjectOutput {public void} write (byte[]@w{ }@var{buf}) @*throws IOException
-This method writes all the bytes in the specified byte array to the
- output stream.
-@end deftypemethod
-@deftypemethod ObjectOutput {public void} write (byte[]@w{ }@var{buf}, int@w{ }@var{offset}, int@w{ }@var{len}) @*throws IOException
-This method writes @code{len} bytes from the specified array
- starting at index @code{offset} into that array.
-@end deftypemethod
-@deftypemethod ObjectOutput {public void} writeObject (java.lang.Object@w{ }@var{obj}) @*throws IOException
-This method writes a object instance to a stream. The format of the
- data written is determined by the actual implementation of this method
-@end deftypemethod
-@deftypemethod ObjectOutput {public void} flush () @*throws IOException
-This method causes any buffered data to be flushed out to the underlying
- stream
-@end deftypemethod
-@deftypemethod ObjectOutput {public void} close () @*throws IOException
-This method closes the underlying stream.
-@end deftypemethod
-@deftypemethod ObjectOutputStream {public final void} writeObject (java.lang.Object@w{ }@var{obj}) @*throws IOException
-Writes a representation of @code{obj} to the underlying
-output stream by writing out information about its class, then
-writing out each of the objects non-transient, non-static
-fields. If any of these fields are other objects,
-they are written out in the same manner.
-
-This method can be overriden by a class by implementing
-@code{private void writeObject (ObjectOutputStream)}.
-
-If an exception is thrown from this method, the stream is left in
-an undefined state.
-@end deftypemethod
-@deftypemethod ObjectOutputStream {public void} defaultWriteObject () @*throws IOException, NotActiveException
-Writes the current objects non-transient, non-static fields from
-the current class to the underlying output stream.
-
-This method is intended to be called from within a object's
-@code{private void writeObject (ObjectOutputStream)}
-method.
-@end deftypemethod
-@deftypemethod ObjectOutputStream {public void} reset () @*throws IOException
-Resets stream to state equivalent to the state just after it was
-constructed.
-
-Causes all objects previously written to the stream to be
-forgotten. A notification of this reset is also written to the
-underlying stream.
-@end deftypemethod
-@deftypemethod ObjectOutputStream {public void} useProtocolVersion (int@w{ }@var{version}) @*throws IOException
-Informs this @code{ObjectOutputStream} to write data
-according to the specified protocol. There are currently two
-different protocols, specified by @code{PROTOCOL_VERSION_1}
-and @code{PROTOCOL_VERSION_2}. This implementation writes
-data using @code{PROTOCOL_VERSION_1} by default, as is done
-by the JDK 1.1.
-
-A non-portable method, @code{setDefaultProtocolVersion (int
-version)} is provided to change the default protocol
-version.
-
-For an explination of the differences beween the two protocols
-see XXX: the Java ObjectSerialization Specification.
-@end deftypemethod
-@deftypemethod ObjectOutputStream {public static void} setDefaultProtocolVersion (int@w{ }@var{version}) @*throws IOException
-<em>GNU $classpath specific</em>
-
-Changes the default stream protocol used by all
-@code{ObjectOutputStream}s. There are currently two
-different protocols, specified by @code{PROTOCOL_VERSION_1}
-and @code{PROTOCOL_VERSION_2}. The default default is
-@code{PROTOCOL_VERSION_1}.
-@end deftypemethod
-@deftypemethod ObjectOutputStream {protected void} annotateClass (java.lang.Class@w{ }@var{cl}) @*throws IOException
-An empty hook that allows subclasses to write extra information
-about classes to the stream. This method is called the first
-time each class is seen, and after all of the standard
-information about the class has been written.
-@end deftypemethod
-@deftypemethod ObjectOutputStream {protected Object} replaceObject (java.lang.Object@w{ }@var{obj}) @*throws IOException
-Allows subclasses to replace objects that are written to the
-stream with other objects to be written in their place. This
-method is called the first time each object is encountered
-(modulo reseting of the stream).
-
-This method must be enabled before it will be called in the
-serialization process.
-@end deftypemethod
-@deftypemethod ObjectOutputStream {protected boolean} enableReplaceObject (boolean@w{ }@var{enable}) @*throws SecurityException
-If @code{enable} is @code{true} and this object is
-trusted, then @code{replaceObject (Object)} will be called
-in subsequent calls to @code{writeObject (Object)}.
-Otherwise, @code{replaceObject (Object)} will not be called.
-@end deftypemethod
-@deftypemethod ObjectOutputStream {protected void} writeStreamHeader () @*throws IOException
-Writes stream magic and stream version information to the
-underlying stream.
-@end deftypemethod
-@deftypemethod ObjectOutputStream {protected void} writeObjectOverride (java.lang.Object@w{ }@var{obj}) @*throws NotActiveException, IOException
-This method allows subclasses to override the default
-serialization mechanism provided by
-@code{ObjectOutputStream}. To make this method be used for
-writing objects, subclasses must invoke the 0-argument
-constructor on this class from there constructor.
-@end deftypemethod
-@deftypemethod ObjectOutputStream {public void} write (int@w{ }@var{data}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod ObjectOutputStream {public void} write (byte[]@w{ }@var{b}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod ObjectOutputStream {public void} write (byte[]@w{ }@var{b}, int@w{ }@var{off}, int@w{ }@var{len}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod ObjectOutputStream {public void} flush () @*throws IOException
-
-@end deftypemethod
-@deftypemethod ObjectOutputStream {protected void} drain () @*throws IOException
-Causes the block-data buffer to be written to the underlying
-stream, but does not flush underlying stream.
-@end deftypemethod
-@deftypemethod ObjectOutputStream {public void} close () @*throws IOException
-
-@end deftypemethod
-@deftypemethod ObjectOutputStream {public void} writeBoolean (boolean@w{ }@var{data}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod ObjectOutputStream {public void} writeByte (int@w{ }@var{data}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod ObjectOutputStream {public void} writeShort (int@w{ }@var{data}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod ObjectOutputStream {public void} writeChar (int@w{ }@var{data}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod ObjectOutputStream {public void} writeInt (int@w{ }@var{data}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod ObjectOutputStream {public void} writeLong (long@w{ }@var{data}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod ObjectOutputStream {public void} writeFloat (float@w{ }@var{data}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod ObjectOutputStream {public void} writeDouble (double@w{ }@var{data}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod ObjectOutputStream {public void} writeBytes (java.lang.String@w{ }@var{data}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod ObjectOutputStream {public void} writeChars (java.lang.String@w{ }@var{data}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod ObjectOutputStream {public void} writeUTF (java.lang.String@w{ }@var{data}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod ObjectOutputStream {public ObjectOutputStream.PutField} putFields () @*throws IOException
-
-@end deftypemethod
-@deftypemethod ObjectOutputStream {public void} writeFields () @*throws IOException
-
-@end deftypemethod
-@deftypemethod ObjectOutputStream.PutField {public abstract void} put (java.lang.String@w{ }@var{name}, boolean@w{ }@var{value}) @*throws IOException, IllegalArgumentException
-
-@end deftypemethod
-@deftypemethod ObjectOutputStream.PutField {public abstract void} put (java.lang.String@w{ }@var{name}, byte@w{ }@var{value}) @*throws IOException, IllegalArgumentException
-
-@end deftypemethod
-@deftypemethod ObjectOutputStream.PutField {public abstract void} put (java.lang.String@w{ }@var{name}, char@w{ }@var{value}) @*throws IOException, IllegalArgumentException
-
-@end deftypemethod
-@deftypemethod ObjectOutputStream.PutField {public abstract void} put (java.lang.String@w{ }@var{name}, double@w{ }@var{value}) @*throws IOException, IllegalArgumentException
-
-@end deftypemethod
-@deftypemethod ObjectOutputStream.PutField {public abstract void} put (java.lang.String@w{ }@var{name}, float@w{ }@var{value}) @*throws IOException, IllegalArgumentException
-
-@end deftypemethod
-@deftypemethod ObjectOutputStream.PutField {public abstract void} put (java.lang.String@w{ }@var{name}, int@w{ }@var{value}) @*throws IOException, IllegalArgumentException
-
-@end deftypemethod
-@deftypemethod ObjectOutputStream.PutField {public abstract void} put (java.lang.String@w{ }@var{name}, long@w{ }@var{value}) @*throws IOException, IllegalArgumentException
-
-@end deftypemethod
-@deftypemethod ObjectOutputStream.PutField {public abstract void} put (java.lang.String@w{ }@var{name}, short@w{ }@var{value}) @*throws IOException, IllegalArgumentException
-
-@end deftypemethod
-@deftypemethod ObjectOutputStream.PutField {public abstract void} put (java.lang.String@w{ }@var{name}, java.lang.Object@w{ }@var{value}) @*throws IOException, IllegalArgumentException
-
-@end deftypemethod
-@deftypemethod ObjectOutputStream.PutField {public abstract void} write (java.io.ObjectOutput@w{ }@var{out}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod ObjectStreamClass {public static ObjectStreamClass} lookup (java.lang.Class@w{ }@var{cl})
-Returns the @code{ObjectStreamClass} for @code{cl}.
-If @code{cl} is null, or is not @code{Serializable},
-null is returned. @code{ObjectStreamClass}'s are memorized;
-later calls to this method with the same class will return the
-same @code{ObjectStreamClass} object and no recalculation
-will be done.
-@end deftypemethod
-@deftypemethod ObjectStreamClass {public String} getName ()
-Returns the name of the class that this
-@code{ObjectStreamClass} represents.
-@end deftypemethod
-@deftypemethod ObjectStreamClass {public Class} forClass ()
-Returns the class that this @code{ObjectStreamClass}
-represents. Null could be returned if this
-@code{ObjectStreamClass} was read from an
-@code{ObjectInputStream} and the class it represents cannot
-be found or loaded.
-@end deftypemethod
-@deftypemethod ObjectStreamClass {public long} getSerialVersionUID ()
-Returns the serial version stream-unique identifier for the class
-represented by this @code{ObjectStreamClass}. This SUID is
-either defined by the class as @code{static final long
-serialVersionUID} or is calculated as specified in
-Javasoft's "Object Serialization Specification" XXX: add reference
-@end deftypemethod
-@deftypemethod ObjectStreamClass {public ObjectStreamField} getFields ()
-
-@end deftypemethod
-@deftypemethod ObjectStreamClass {public ObjectStreamField} getField (java.lang.String@w{ }@var{name})
-
-@end deftypemethod
-@deftypemethod ObjectStreamClass {public String} toString ()
-Returns a textual representation of this
-@code{ObjectStreamClass} object including the name of the
-class it represents as well as that class's serial version
-stream-unique identifier.
-@end deftypemethod
-@deftypemethod ObjectStreamField {public String} getName ()
-
-@end deftypemethod
-@deftypemethod ObjectStreamField {public Class} getType ()
-
-@end deftypemethod
-@deftypemethod ObjectStreamField {public char} getTypeCode ()
-
-@end deftypemethod
-@deftypemethod ObjectStreamField {public String} getTypeString ()
-
-@end deftypemethod
-@deftypemethod ObjectStreamField {public int} getOffset ()
-
-@end deftypemethod
-@deftypemethod ObjectStreamField {protected void} setOffset (int@w{ }@var{off})
-
-@end deftypemethod
-@deftypemethod ObjectStreamField {public boolean} isPrimitive ()
-
-@end deftypemethod
-@deftypemethod ObjectStreamField {public int} compareTo (java.lang.Object@w{ }@var{o})
-
-@end deftypemethod
-@deftypemethod ObjectStreamField {public String} toString ()
-
-@end deftypemethod
-@deftypemethod OutputStream {public abstract void} write (int@w{ }@var{b}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod OutputStream {public void} write (byte[]@w{ }@var{b}) @*throws IOException, NullPointerException
-
-@end deftypemethod
-@deftypemethod OutputStream {public void} write (byte[]@w{ }@var{b}, int@w{ }@var{off}, int@w{ }@var{len}) @*throws IOException, NullPointerException, IndexOutOfBoundsException
-
-@end deftypemethod
-@deftypemethod OutputStream {public void} flush () @*throws IOException
-
-@end deftypemethod
-@deftypemethod OutputStream {public void} close () @*throws IOException
-
-@end deftypemethod
-@deftypemethod OutputStreamWriter {public String} getEncoding ()
-
-@end deftypemethod
-@deftypemethod OutputStreamWriter {public void} close () @*throws IOException
-
-@end deftypemethod
-@deftypemethod OutputStreamWriter {public void} flush () @*throws IOException
-
-@end deftypemethod
-@deftypemethod OutputStreamWriter {public void} write (char[]@w{ }@var{buf}, int@w{ }@var{offset}, int@w{ }@var{count}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod OutputStreamWriter {public void} write (java.lang.String@w{ }@var{str}, int@w{ }@var{offset}, int@w{ }@var{count}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod OutputStreamWriter {public void} write (int@w{ }@var{ch}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod PipedInputStream {public void} connect (java.io.PipedOutputStream@w{ }@var{source}) @*throws IOException
-This method connects this stream to the passed in @code{PipedOutputStream}.
- This stream is then ready for reading. If this stream is already
- connected or has been previously closed, then an exception is thrown
-@end deftypemethod
-@deftypemethod PipedInputStream {protected synchronized void} receive (int@w{ }@var{b}) @*throws IOException
-This method receives a byte of input from the source PipedOutputStream.
- If the internal circular buffer is full, this method blocks.
-@end deftypemethod
-@deftypemethod PipedInputStream {public int} read () @*throws IOException
-This method reads bytes from the stream into a caller supplied buffer.
- It starts storing bytes at position @code{offset} into the buffer and
- reads a maximum of @code{len} bytes. Note that this method can actually
- read fewer than @code{len} bytes. The actual number of bytes read is
- returned. A -1 is returned to indicated that no bytes can be read
- because the end of the stream was reached. If the stream is already
- closed, a -1 will again be returned to indicate the end of the stream.
-
-
-
- This method will block if no bytes are available to be read.
-@end deftypemethod
-@deftypemethod PipedInputStream {public synchronized int} read (byte[]@w{ }@var{buf}, int@w{ }@var{offset}, int@w{ }@var{len}) @*throws IOException
-This method reads bytes from the stream into a caller supplied buffer.
- It starts storing bytes at position @code{offset} into the buffer and
- reads a maximum of @code{len} bytes. Note that this method can actually
- read fewer than @code{len} bytes. The actual number of bytes read is
- returned. A -1 is returned to indicated that no bytes can be read
- because the end of the stream was reached - ie close() was called on the
- connected PipedOutputStream.
-
-
-
- This method will block if no bytes are available to be read.
-@end deftypemethod
-@deftypemethod PipedInputStream {public synchronized int} available () @*throws IOException
-This method returns the number of bytes that can be read from this stream
- before blocking could occur. This is the number of bytes that are
- currently unread in the internal circular buffer. Note that once this
- many additional bytes are read, the stream may block on a subsequent
- read, but it not guaranteed to block.
-@end deftypemethod
-@deftypemethod PipedInputStream {public synchronized void} close () @*throws IOException
-This methods closes the stream so that no more data can be read
- from it.
-@end deftypemethod
-@deftypemethod PipedOutputStream {public void} connect (java.io.PipedInputStream@w{ }@var{sink}) @*throws IOException
-Connects this object to the specified @code{PipedInputStream}
- object. This stream will then be ready for writing.
-@end deftypemethod
-@deftypemethod PipedOutputStream {public void} write (int@w{ }@var{b}) @*throws IOException
-Write a single byte of date to the stream. Note that this method will
- block if the @code{PipedInputStream} to which this object is
- connected has a full buffer.
-@end deftypemethod
-@deftypemethod PipedOutputStream {public void} write (byte[]@w{ }@var{b}, int@w{ }@var{off}, int@w{ }@var{len}) @*throws IOException
-This method writes @code{len} bytes of data from the byte array
- @code{buf} starting at index @code{offset} in the array
- to the stream. Note that this method will block if the
- @code{PipedInputStream} to which this object is connected has
- a buffer that cannot hold all of the bytes to be written.
-@end deftypemethod
-@deftypemethod PipedOutputStream {public void} flush ()
-This method does nothing.
-@end deftypemethod
-@deftypemethod PipedOutputStream {public void} close ()
-This method closes this stream so that no more data can be written
- to it. Any further attempts to write to this stream may throw an
- exception
-@end deftypemethod
-@deftypemethod PipedReader {public void} connect (java.io.PipedWriter@w{ }@var{source}) @*throws IOException
-This method connects this stream to the passed in @code{PipedWriter}.
- This stream is then ready for reading. If this stream is already
- connected or has been previously closed, then an exception is thrown
-@end deftypemethod
-@deftypemethod PipedReader {public int} read () @*throws IOException
-This method reads chars from the stream into a caller supplied buffer.
- It starts storing chars at position @code{offset} into the buffer and
- reads a maximum of @code{len} chars. Note that this method can actually
- read fewer than @code{len} chars. The actual number of chars read is
- returned. A -1 is returned to indicated that no chars can be read
- because the end of the stream was reached. If the stream is already
- closed, a -1 will again be returned to indicate the end of the stream.
-
-
-
- This method will block if no chars are available to be read.
-@end deftypemethod
-@deftypemethod PipedReader {public int} read (char[]@w{ }@var{buf}, int@w{ }@var{offset}, int@w{ }@var{len}) @*throws IOException
-This method reads characters from the stream into a caller supplied buffer.
- It starts storing chars at position @code{offset} into the buffer and
- reads a maximum of @code{len} chars. Note that this method can actually
- read fewer than @code{len} chars. The actual number of chars read is
- returned. A -1 is returned to indicated that no chars can be read
- because the end of the stream was reached - ie close() was called on the
- connected PipedWriter.
-
-
-
- This method will block if no chars are available to be read.
-@end deftypemethod
-@deftypemethod PipedReader {public boolean} ready () @*throws IOException
-
-@end deftypemethod
-@deftypemethod PipedReader {public void} close () @*throws IOException
-This methods closes the stream so that no more data can be read
- from it.
-@end deftypemethod
-@deftypemethod PipedWriter {public void} connect (java.io.PipedReader@w{ }@var{sink}) @*throws IOException
-Connects this object to the specified @code{PipedReader}
- object. This stream will then be ready for writing.
-@end deftypemethod
-@deftypemethod PipedWriter {public void} write (char@w{ }@var{b}) @*throws IOException
-Write a single char of date to the stream. Note that this method will
- block if the @code{PipedReader} to which this object is
- connected has a full buffer.
-@end deftypemethod
-@deftypemethod PipedWriter {public void} write (char[]@w{ }@var{b}, int@w{ }@var{off}, int@w{ }@var{len}) @*throws IOException
-This method writes @code{len} chars of data from the char array
- @code{buf} starting at index @code{offset} in the array
- to the stream. Note that this method will block if the
- @code{PipedReader} to which this object is connected has
- a buffer that cannot hold all of the chars to be written.
-@end deftypemethod
-@deftypemethod PipedWriter {public void} flush ()
-This method does nothing.
-@end deftypemethod
-@deftypemethod PipedWriter {public void} close ()
-This method closes this stream so that no more data can be written
- to it. Any further attempts to write to this stream may throw an
- exception
-@end deftypemethod
-@deftypemethod PrintStream {public boolean} checkError ()
-
-@end deftypemethod
-@deftypemethod PrintStream {public void} close ()
-
-@end deftypemethod
-@deftypemethod PrintStream {public void} flush ()
-
-@end deftypemethod
-@deftypemethod PrintStream {public void} print (boolean@w{ }@var{bool})
-
-@end deftypemethod
-@deftypemethod PrintStream {public void} print (int@w{ }@var{inum})
-
-@end deftypemethod
-@deftypemethod PrintStream {public void} print (long@w{ }@var{lnum})
-
-@end deftypemethod
-@deftypemethod PrintStream {public void} print (float@w{ }@var{fnum})
-
-@end deftypemethod
-@deftypemethod PrintStream {public void} print (double@w{ }@var{dnum})
-
-@end deftypemethod
-@deftypemethod PrintStream {public void} print (java.lang.Object@w{ }@var{obj})
-
-@end deftypemethod
-@deftypemethod PrintStream {public void} print (java.lang.String@w{ }@var{str})
-
-@end deftypemethod
-@deftypemethod PrintStream {public synchronized void} print (char@w{ }@var{ch})
-
-@end deftypemethod
-@deftypemethod PrintStream {public void} print (char[]@w{ }@var{charArray})
-
-@end deftypemethod
-@deftypemethod PrintStream {public void} println ()
-
-@end deftypemethod
-@deftypemethod PrintStream {public void} println (boolean@w{ }@var{bool})
-
-@end deftypemethod
-@deftypemethod PrintStream {public void} println (int@w{ }@var{inum})
-
-@end deftypemethod
-@deftypemethod PrintStream {public void} println (long@w{ }@var{lnum})
-
-@end deftypemethod
-@deftypemethod PrintStream {public void} println (float@w{ }@var{fnum})
-
-@end deftypemethod
-@deftypemethod PrintStream {public void} println (double@w{ }@var{dnum})
-
-@end deftypemethod
-@deftypemethod PrintStream {public void} println (java.lang.Object@w{ }@var{obj})
-
-@end deftypemethod
-@deftypemethod PrintStream {public void} println (java.lang.String@w{ }@var{str})
-
-@end deftypemethod
-@deftypemethod PrintStream {public synchronized void} println (char@w{ }@var{ch})
-
-@end deftypemethod
-@deftypemethod PrintStream {public void} println (char[]@w{ }@var{charArray})
-
-@end deftypemethod
-@deftypemethod PrintStream {protected void} setError ()
-
-@end deftypemethod
-@deftypemethod PrintStream {public void} write (int@w{ }@var{oneByte})
-
-@end deftypemethod
-@deftypemethod PrintStream {public void} write (byte[]@w{ }@var{buffer}, int@w{ }@var{offset}, int@w{ }@var{count})
-
-@end deftypemethod
-@deftypemethod PrintWriter {protected void} setError ()
-This method can be called by subclasses to indicate that an error
- has occurred and should be reported by @code{checkError}.
-@end deftypemethod
-@deftypemethod PrintWriter {public boolean} checkError ()
-This method checks to see if an error has occurred on this stream. Note
- that once an error has occurred, this method will continue to report
- @code{true} forever for this stream. Before checking for an
- error condition, this method flushes the stream.
-@end deftypemethod
-@deftypemethod PrintWriter {public void} flush ()
-This method flushes any buffered chars to the underlying stream and
- then flushes that stream as well.
-@end deftypemethod
-@deftypemethod PrintWriter {public void} close ()
-This method closes this stream and all underlying streams.
-@end deftypemethod
-@deftypemethod PrintWriter {public void} print (java.lang.String@w{ }@var{str})
-This method prints a @code{String} to the stream. The actual
- value printed depends on the system default encoding.
-@end deftypemethod
-@deftypemethod PrintWriter {public void} print (char@w{ }@var{ch})
-This method prints a char to the stream. The actual value printed is
- determined by the character encoding in use.
-@end deftypemethod
-@deftypemethod PrintWriter {public void} print (char[]@w{ }@var{charArray})
-This method prints an array of characters to the stream. The actual
- value printed depends on the system default encoding.
-@end deftypemethod
-@deftypemethod PrintWriter {public void} print (boolean@w{ }@var{bool})
-This methods prints a boolean value to the stream. @code{true}
- values are printed as "true" and @code{false} values are printed
- as "false".
-@end deftypemethod
-@deftypemethod PrintWriter {public void} print (int@w{ }@var{inum})
-This method prints an integer to the stream. The value printed is
- determined using the @code{String.valueOf()} method.
-@end deftypemethod
-@deftypemethod PrintWriter {public void} print (long@w{ }@var{lnum})
-This method prints a long to the stream. The value printed is
- determined using the @code{String.valueOf()} method.
-@end deftypemethod
-@deftypemethod PrintWriter {public void} print (float@w{ }@var{fnum})
-This method prints a float to the stream. The value printed is
- determined using the @code{String.valueOf()} method.
-@end deftypemethod
-@deftypemethod PrintWriter {public void} print (double@w{ }@var{dnum})
-This method prints a double to the stream. The value printed is
- determined using the @code{String.valueOf()} method.
-@end deftypemethod
-@deftypemethod PrintWriter {public void} print (java.lang.Object@w{ }@var{obj})
-This method prints an @code{Object} to the stream. The actual
- value printed is determined by calling the @code{String.valueOf()}
- method.
-@end deftypemethod
-@deftypemethod PrintWriter {public void} println ()
-This method prints a line separator sequence to the stream. The value
- printed is determined by the system property <xmp>line.separator</xmp>
- and is not necessarily the Unix '\n' newline character.
-@end deftypemethod
-@deftypemethod PrintWriter {public void} println (boolean@w{ }@var{bool})
-This methods prints a boolean value to the stream. @code{true}
- values are printed as "true" and @code{false} values are printed
- as "false".
-
- This method prints a line termination sequence after printing the value.
-@end deftypemethod
-@deftypemethod PrintWriter {public void} println (int@w{ }@var{inum})
-This method prints an integer to the stream. The value printed is
- determined using the @code{String.valueOf()} method.
-
- This method prints a line termination sequence after printing the value.
-@end deftypemethod
-@deftypemethod PrintWriter {public void} println (long@w{ }@var{lnum})
-This method prints a long to the stream. The value printed is
- determined using the @code{String.valueOf()} method.
-
- This method prints a line termination sequence after printing the value.
-@end deftypemethod
-@deftypemethod PrintWriter {public void} println (float@w{ }@var{fnum})
-This method prints a float to the stream. The value printed is
- determined using the @code{String.valueOf()} method.
-
- This method prints a line termination sequence after printing the value.
-@end deftypemethod
-@deftypemethod PrintWriter {public void} println (double@w{ }@var{dnum})
-This method prints a double to the stream. The value printed is
- determined using the @code{String.valueOf()} method.
-
- This method prints a line termination sequence after printing the value.
-@end deftypemethod
-@deftypemethod PrintWriter {public void} println (java.lang.Object@w{ }@var{obj})
-This method prints an @code{Object} to the stream. The actual
- value printed is determined by calling the @code{String.valueOf()}
- method.
-
- This method prints a line termination sequence after printing the value.
-@end deftypemethod
-@deftypemethod PrintWriter {public void} println (java.lang.String@w{ }@var{str})
-This method prints a @code{String} to the stream. The actual
- value printed depends on the system default encoding.
-
- This method prints a line termination sequence after printing the value.
-@end deftypemethod
-@deftypemethod PrintWriter {public void} println (char@w{ }@var{ch})
-This method prints a char to the stream. The actual value printed is
- determined by the character encoding in use.
-
- This method prints a line termination sequence after printing the value.
-@end deftypemethod
-@deftypemethod PrintWriter {public void} println (char[]@w{ }@var{charArray})
-This method prints an array of characters to the stream. The actual
- value printed depends on the system default encoding.
-
- This method prints a line termination sequence after printing the value.
-@end deftypemethod
-@deftypemethod PrintWriter {public void} write (int@w{ }@var{ch})
-This method writes a single char to the stream.
-@end deftypemethod
-@deftypemethod PrintWriter {public void} write (char[]@w{ }@var{charArray}, int@w{ }@var{offset}, int@w{ }@var{count})
-This method writes @code{count} chars from the specified array
- starting at index @code{offset} into the array.
-@end deftypemethod
-@deftypemethod PrintWriter {public void} write (java.lang.String@w{ }@var{str}, int@w{ }@var{offset}, int@w{ }@var{count})
-This method writes @code{count} chars from the specified
- @code{String} to the output starting at character position
- @code{offset} into the @code{String}
-@end deftypemethod
-@deftypemethod PrintWriter {public void} write (char[]@w{ }@var{charArray})
-This method write all the chars in the specified array to the output.
-@end deftypemethod
-@deftypemethod PrintWriter {public void} write (java.lang.String@w{ }@var{str})
-This method writes the contents of the specified @code{String}
- to the underlying stream.
-@end deftypemethod
-@deftypemethod PushbackInputStream {public int} available () @*throws IOException
-
-@end deftypemethod
-@deftypemethod PushbackInputStream {public void} close () @*throws IOException
-
-@end deftypemethod
-@deftypemethod PushbackInputStream {public boolean} markSupported ()
-
-@end deftypemethod
-@deftypemethod PushbackInputStream {public int} read () @*throws IOException
-
-@end deftypemethod
-@deftypemethod PushbackInputStream {public int} read (byte[]@w{ }@var{b}, int@w{ }@var{off}, int@w{ }@var{len}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod PushbackInputStream {public void} unread (int@w{ }@var{b}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod PushbackInputStream {public void} unread (byte[]@w{ }@var{b}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod PushbackInputStream {public void} unread (byte[]@w{ }@var{b}, int@w{ }@var{off}, int@w{ }@var{len}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod PushbackInputStream {public long} skip (long@w{ }@var{n}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod PushbackReader {public void} close () @*throws IOException
-This method closes the stream and frees any associated resources.
-@end deftypemethod
-@deftypemethod PushbackReader {public void} mark (int@w{ }@var{read_limit}) @*throws IOException
-This method throws an exception when called since this class does
- not support mark/reset.
-@end deftypemethod
-@deftypemethod PushbackReader {public boolean} markSupported ()
-This method returns @code{false} to indicate that it does not support
- mark/reset functionality.
-@end deftypemethod
-@deftypemethod PushbackReader {public void} reset () @*throws IOException
-This method always throws an IOException in this class because
- mark/reset functionality is not supported.
-@end deftypemethod
-@deftypemethod PushbackReader {public boolean} ready () @*throws IOException
-This method determines whether or not this stream is ready to be read.
- If it returns @code{false} to indicate that the stream is not
- ready, any attempt to read from the stream could (but is not
- guaranteed to) block.
-
-
-
- This stream is ready to read if there are either chars waiting to be
- read in the pushback buffer or if the underlying stream is ready to
- be read.
-@end deftypemethod
-@deftypemethod PushbackReader {public long} skip (long@w{ }@var{num_chars}) @*throws IOException
-This method skips the specified number of chars in the stream. It
- returns the actual number of chars skipped, which may be less than the
- requested amount.
-
-
-
- This method first discards chars from the buffer, then calls the
- @code{skip} method on the underlying @code{Reader} to
- skip additional chars if necessary.
-@end deftypemethod
-@deftypemethod PushbackReader {public int} read () @*throws IOException
-This method reads an unsigned char from the input stream and returns it
- as an int in the range of 0-65535. This method also will return -1 if
- the end of the stream has been reached. The char returned will be read
- from the pushback buffer, unless the buffer is empty, in which case
- the char will be read from the underlying stream.
-
-
-
- This method will block until the char can be read.
-@end deftypemethod
-@deftypemethod PushbackReader {public synchronized int} read (char[]@w{ }@var{b}, int@w{ }@var{offset}, int@w{ }@var{len}) @*throws IOException
-This method read chars from a stream and stores them into a caller
- supplied buffer. It starts storing the data at index @code{offset} into
- the buffer and attempts to read @code{len} chars. This method can
- return before reading the number of chars requested. The actual number
- of chars read is returned as an int. A -1 is returned to indicate the
- end of the stream.
-
-
-
- This method will block until some data can be read.
-
-
-
- This method first reads chars from the pushback buffer in order to
- satisfy the read request. If the pushback buffer cannot provide all
- of the chars requested, the remaining chars are read from the
- underlying stream.
-@end deftypemethod
-@deftypemethod PushbackReader {public void} unread (int@w{ }@var{b}) @*throws IOException
-This method pushes a single char of data into the pushback buffer.
- The char pushed back is the one that will be returned as the first char
- of the next read.
-
-
-
- If the pushback buffer is full, this method throws an exception.
-
-
-
- The argument to this method is an @code{int}. Only the low eight bits
- of this value are pushed back.
-@end deftypemethod
-@deftypemethod PushbackReader {public synchronized void} unread (char[]@w{ }@var{buf}) @*throws IOException
-This method pushes all of the chars in the passed char array into
- the pushback buffer. These chars are pushed in reverse order so that
- the next char read from the stream after this operation will be
- @code{buf[0]} followed by @code{buf[1]}, etc.
-
-
-
- If the pushback buffer cannot hold all of the requested chars, an
- exception is thrown.
-@end deftypemethod
-@deftypemethod PushbackReader {public synchronized void} unread (char[]@w{ }@var{b}, int@w{ }@var{offset}, int@w{ }@var{len}) @*throws IOException
-This method pushed back chars from the passed in array into the pushback
- buffer. The chars from @code{buf[offset]} to @code{buf[offset + len]}
- are pushed in reverse order so that the next char read from the stream
- after this operation will be @code{buf[offset]} followed by
- @code{buf[offset + 1]}, etc.
-
-
-
- If the pushback buffer cannot hold all of the requested chars, an
- exception is thrown.
-@end deftypemethod
-@deftypemethod RandomAccessFile {public void} close () @*throws IOException
-
-@end deftypemethod
-@deftypemethod RandomAccessFile {public final FileDescriptor} getFD () @*throws IOException
-
-@end deftypemethod
-@deftypemethod RandomAccessFile {public long} getFilePointer () @*throws IOException
-
-@end deftypemethod
-@deftypemethod RandomAccessFile {public long} length () @*throws IOException
-
-@end deftypemethod
-@deftypemethod RandomAccessFile {public int} read () @*throws IOException
-
-@end deftypemethod
-@deftypemethod RandomAccessFile {public int} read (byte[]@w{ }@var{buffer}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod RandomAccessFile {public int} read (byte[]@w{ }@var{buffer}, int@w{ }@var{offset}, int@w{ }@var{count}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod RandomAccessFile {public final boolean} readBoolean () @*throws IOException
-
-@end deftypemethod
-@deftypemethod RandomAccessFile {public final byte} readByte () @*throws IOException
-
-@end deftypemethod
-@deftypemethod RandomAccessFile {public final char} readChar () @*throws IOException
-
-@end deftypemethod
-@deftypemethod RandomAccessFile {public final double} readDouble () @*throws IOException
-
-@end deftypemethod
-@deftypemethod RandomAccessFile {public final float} readFloat () @*throws IOException
-
-@end deftypemethod
-@deftypemethod RandomAccessFile {public final void} readFully (byte[]@w{ }@var{buffer}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod RandomAccessFile {public final void} readFully (byte[]@w{ }@var{buffer}, int@w{ }@var{offset}, int@w{ }@var{count}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod RandomAccessFile {public final int} readInt () @*throws IOException
-
-@end deftypemethod
-@deftypemethod RandomAccessFile {public final String} readLine () @*throws IOException
-
-@end deftypemethod
-@deftypemethod RandomAccessFile {public final long} readLong () @*throws IOException
-
-@end deftypemethod
-@deftypemethod RandomAccessFile {public final short} readShort () @*throws IOException
-
-@end deftypemethod
-@deftypemethod RandomAccessFile {public final int} readUnsignedByte () @*throws IOException
-
-@end deftypemethod
-@deftypemethod RandomAccessFile {public final int} readUnsignedShort () @*throws IOException
-
-@end deftypemethod
-@deftypemethod RandomAccessFile {public final String} readUTF () @*throws IOException
-
-@end deftypemethod
-@deftypemethod RandomAccessFile {public void} seek (long@w{ }@var{pos}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod RandomAccessFile {public int} skipBytes (int@w{ }@var{count}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod RandomAccessFile {public void} write (int@w{ }@var{oneByte}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod RandomAccessFile {public void} write (byte[]@w{ }@var{buffer}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod RandomAccessFile {public void} write (byte[]@w{ }@var{buffer}, int@w{ }@var{offset}, int@w{ }@var{count}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod RandomAccessFile {public final void} writeBoolean (boolean@w{ }@var{val}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod RandomAccessFile {public final void} writeByte (int@w{ }@var{v}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod RandomAccessFile {public final void} writeShort (int@w{ }@var{v}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod RandomAccessFile {public final void} writeChar (int@w{ }@var{v}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod RandomAccessFile {public final void} writeInt (int@w{ }@var{v}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod RandomAccessFile {public final void} writeLong (long@w{ }@var{v}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod RandomAccessFile {public final void} writeFloat (float@w{ }@var{v}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod RandomAccessFile {public final void} writeDouble (double@w{ }@var{v}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod RandomAccessFile {public final void} writeBytes (java.lang.String@w{ }@var{s}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod RandomAccessFile {public final void} writeChars (java.lang.String@w{ }@var{s}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod RandomAccessFile {public final void} writeUTF (java.lang.String@w{ }@var{s}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod Reader {public abstract int} read (char[]@w{ }@var{buf}, int@w{ }@var{offset}, int@w{ }@var{count}) @*throws IOException
-Read chars from a stream and stores them into a caller
- supplied buffer. It starts storing the data at index @code{offset}
- into the buffer and attempts to read @code{len} chars. This method
- can return before reading the number of chars requested. The actual
- number of chars read is returned as an int. A -1 is returned to indicate
- the end of the stream.
-
-
-
- This method will block until some data can be read.
-
-
-
- This method operates by calling the single char @code{read()} method
- in a loop until the desired number of chars are read. The read loop
- stops short if the end of the stream is encountered or if an IOException
- is encountered on any read operation except the first. If the first
- attempt to read a chars fails, the IOException is allowed to propagate
- upward. And subsequent IOException is caught and treated identically
- to an end of stream condition. Subclasses can (and should if possible)
- override this method to provide a more efficient implementation.
-@end deftypemethod
-@deftypemethod Reader {public int} read (char[]@w{ }@var{buf}) @*throws IOException
-Reads chars from a stream and stores them into a caller
- supplied buffer. This method attempts to completely fill the buffer,
- but can return before doing so. The actual number of chars read is
- returned as an int. A -1 is returned to indicate the end of the stream.
-
-
-
- This method will block until some data can be read.
-
-
-
- This method operates by calling an overloaded read method like so:
- @code{read(buf, 0, buf.length)}
-@end deftypemethod
-@deftypemethod Reader {public int} read () @*throws IOException
-Reads an char from the input stream and returns it
- as an int in the range of 0-65535. This method also will return -1 if
- the end of the stream has been reached.
-
-
-
- This method will block until the char can be read.
-@end deftypemethod
-@deftypemethod Reader {public abstract void} close () @*throws IOException
-Closes the stream. Any futher attempts to read from the
- stream may generate an @code{IOException}.
-@end deftypemethod
-@deftypemethod Reader {public boolean} markSupported ()
-Returns a boolean that indicates whether the mark/reset
- methods are supported in this class. Those methods can be used to
- remember a specific point in the stream and reset the stream to that
- point.
-
-
-
- This method always returns @code{false} in this class, but
- subclasses can override this method to return @code{true} if they
- support mark/reset functionality.
-@end deftypemethod
-@deftypemethod Reader {public void} mark (int@w{ }@var{readLimit}) @*throws IOException
-Marks a position in the input to which the stream can be
- "reset" by calling the @code{reset()} method. The parameter
- @code{readlimit} is the number of chars that can be read from the
- stream after setting the mark before the mark becomes invalid. For
- example, if @code{mark()} is called with a read limit of 10, then
- when 11 chars of data are read from the stream before the
- @code{reset()} method is called, then the mark is invalid and the
- stream object instance is not required to remember the mark.
-@end deftypemethod
-@deftypemethod Reader {public void} reset () @*throws IOException
-Resets a stream to the point where the @code{mark()}
- method was called. Any chars that were read after the mark point was
- set will be re-read during subsequent reads.
-
-
-
- This method always throws an IOException in this class, but subclasses
- can override this method if they provide mark/reset functionality.
-@end deftypemethod
-@deftypemethod Reader {public boolean} ready () @*throws IOException
-Determines whether or not this stream is ready to be
- read. If it returns @code{false} the stream may block if a
- read is attempted, but it is not guaranteed to do so.
-
-
-
- This method always returns @code{false} in this class
-@end deftypemethod
-@deftypemethod Reader {public long} skip (long@w{ }@var{count}) @*throws IOException
-Skips the specified number of chars in the stream. It
- returns the actual number of chars skipped, which may be less than the
- requested amount.
-
-
-
- This method reads and discards chars into a 256 char array until the
- specified number of chars were skipped or until either the end of stream
- is reached or a read attempt returns a short count. Subclasses can
- override this method to provide a more efficient implementation where
- one exists.
-@end deftypemethod
-@deftypemethod SequenceInputStream {public int} available () @*throws IOException
-
-@end deftypemethod
-@deftypemethod SequenceInputStream {public void} close () @*throws IOException
-
-@end deftypemethod
-@deftypemethod SequenceInputStream {public int} read () @*throws IOException
-
-@end deftypemethod
-@deftypemethod SequenceInputStream {public int} read (byte[]@w{ }@var{b}, int@w{ }@var{off}, int@w{ }@var{len}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod StreamTokenizer {public void} commentChar (int@w{ }@var{ch})
-This method sets the comment attribute on the specified character.
-@end deftypemethod
-@deftypemethod StreamTokenizer {public void} eolIsSignificant (boolean@w{ }@var{flag})
-This method sets a flag that indicates whether or not the end of line
- sequence terminates and is a token. The defaults to @code{false}
-@end deftypemethod
-@deftypemethod StreamTokenizer {public int} lineno ()
-This method returns the current line number. Note that if the
- @code{pushBack()} method is called, it has no effect on the
- line number returned by this method.
-@end deftypemethod
-@deftypemethod StreamTokenizer {public void} lowerCaseMode (boolean@w{ }@var{flag})
-This method sets a flag that indicates whether or not alphabetic
- tokens that are returned should be converted to lower case.
-@end deftypemethod
-@deftypemethod StreamTokenizer {public int} nextToken () @*throws IOException
-This method reads the next token from the stream. It sets the
- @code{ttype} variable to the appropriate token type and
- returns it. It also can set @code{sval} or @code{nval}
- as described below. The parsing strategy is as follows:
-
-@itemize @bullet
-
-
-@item
-Skip any whitespace characters.
-
-@item
-If a numeric character is encountered, attempt to parse a numeric
- value. Leading '-' characters indicate a numeric only if followed by
- another non-'-' numeric. The value of the numeric token is terminated
- by either the first non-numeric encountered, or the second occurrence of
- '-' or '.'. The token type returned is TT_NUMBER and @code{nval}
- is set to the value parsed.
-
-@item
-If an alphabetic character is parsed, all subsequent characters
- are read until the first non-alphabetic or non-numeric character is
- encountered. The token type returned is TT_WORD and the value parsed
- is stored in @code{sval}. If lower case mode is set, the token
- stored in @code{sval} is converted to lower case. The end of line
- sequence terminates a word only if EOL signficance has been turned on.
- The start of a comment also terminates a word. Any character with a
- non-alphabetic and non-numeric attribute (such as white space, a quote,
- or a commet) are treated as non-alphabetic and terminate the word.
-
-@item
-If a comment charcters is parsed, then all remaining characters on
- the current line are skipped and another token is parsed. Any EOL or
- EOF's encountered are not discarded, but rather terminate the comment.
-
-@item
-If a quote character is parsed, then all characters up to the
- second occurrence of the same quote character are parsed into a
- @code{String}. This @code{String} is stored as
- @code{sval}, but is not converted to lower case, even if lower case
- mode is enabled. The token type returned is the value of the quote
- character encountered. Any escape sequences
- (\b (backspace), \t (HTAB), \n (linefeed), \f (form feed), \r
- (carriage return), \" (double quote), \' (single quote), \\
- (backslash), \XXX (octal esacpe)) are converted to the appropriate
- char values. Invalid esacape sequences are left in untranslated.
- Unicode characters like ('\ u0000') are not recognized.
-
-@item
-If the C++ comment sequence "//" is encountered, and the parser
- is configured to handle that sequence, then the remainder of the line
- is skipped and another token is read exactly as if a character with
- the comment attribute was encountered.
-
-@item
-If the C comment sequence "/*" is encountered, and the parser
- is configured to handle that sequence, then all characters up to and
- including the comment terminator sequence are discarded and another
- token is parsed.
-
-@item
-If all cases above are not met, then the character is an ordinary
- character that is parsed as a token by itself. The char encountered
- is returned as the token type.
-
-@end itemize
-
-@end deftypemethod
-@deftypemethod StreamTokenizer {public void} ordinaryChar (int@w{ }@var{ch})
-This method makes the specified character an ordinary character. This
- means that none of the attributes (whitespace, alphabetic, numeric,
- quote, or comment) will be set on this character. This character will
- parse as its own token.
-@end deftypemethod
-@deftypemethod StreamTokenizer {public void} ordinaryChars (int@w{ }@var{low}, int@w{ }@var{hi})
-This method makes all the characters in the specified range, range
- terminators included, ordinary. This means the none of the attributes
- (whitespace, alphabetic, numeric, quote, or comment) will be set on
- any of the characters in the range. This makes each character in this
- range parse as its own token.
-@end deftypemethod
-@deftypemethod StreamTokenizer {public void} parseNumbers ()
-This method sets the numeric attribute on the characters '0' - '9' and
- the characters '.' and '-'.
-@end deftypemethod
-@deftypemethod StreamTokenizer {public void} pushBack ()
-This method returns the current line number. Note that if the
- @code{pushBack()} method is called, it has no effect on the
- line number returned by this method.
-@end deftypemethod
-@deftypemethod StreamTokenizer {public void} quoteChar (int@w{ }@var{ch})
-This method sets the quote attribute on the specified character.
-@end deftypemethod
-@deftypemethod StreamTokenizer {public void} resetSyntax ()
-This method removes all attributes (whitespace, alphabetic, numeric,
- quote, and comment) from all characters. It is equivalent to calling
- @code{ordinaryChars(0x00, 0xFF)}.
-@end deftypemethod
-@deftypemethod StreamTokenizer {public void} slashSlashComments (boolean@w{ }@var{flag})
-This method sets a flag that indicates whether or not "C++" language style
- comments ("//" comments through EOL ) are handled by the parser.
- If this is @code{true} commented out sequences are skipped and
- ignored by the parser. This defaults to @code{false}.
-@end deftypemethod
-@deftypemethod StreamTokenizer {public void} slashStarComments (boolean@w{ }@var{flag})
-This method sets a flag that indicates whether or not "C" language style
- comments (with nesting not allowed) are handled by the parser.
- If this is @code{true} commented out sequences are skipped and
- ignored by the parser. This defaults to @code{false}.
-@end deftypemethod
-@deftypemethod StreamTokenizer {public String} toString ()
-This method returns the current token value as a @code{String} in
- the form "Token[x], line n", where 'n' is the current line numbers and
- 'x' is determined as follows.
-
-
-
-
-@itemize @bullet
-
-
-@item
-If no token has been read, then 'x' is "NOTHING" and 'n' is 0
-
-@item
-If @code{ttype} is TT_EOF, then 'x' is "EOF"
-
-@item
-If @code{ttype} is TT_EOL, then 'x' is "EOL"
-
-@item
-If @code{ttype} is TT_WORD, then 'x' is @code{sval}
-
-@item
-If @code{ttype} is TT_NUMBER, then 'x' is "n=strnval" where
- 'strnval' is @code{String.valueOf(nval)}.
-
-@item
-If @code{ttype} is a quote character, then 'x' is
- @code{sval}
-
-@item
-For all other cases, 'x' is @code{ttype}
-
-@end itemize
-
-@end deftypemethod
-@deftypemethod StreamTokenizer {public void} whitespaceChars (int@w{ }@var{low}, int@w{ }@var{hi})
-This method sets the whitespace attribute for all charcters in the
- specified range, range terminators included.
-@end deftypemethod
-@deftypemethod StreamTokenizer {public void} wordChars (int@w{ }@var{low}, int@w{ }@var{hi})
-This method sets the alphabetic attribute for all charcters in the
- specified range, range terminators included.
-@end deftypemethod
-@deftypemethod StringBufferInputStream {public int} available ()
-
-@end deftypemethod
-@deftypemethod StringBufferInputStream {public int} read ()
-
-@end deftypemethod
-@deftypemethod StringBufferInputStream {public int} read (byte[]@w{ }@var{b}, int@w{ }@var{off}, int@w{ }@var{len})
-
-@end deftypemethod
-@deftypemethod StringBufferInputStream {public void} reset ()
-
-@end deftypemethod
-@deftypemethod StringBufferInputStream {public long} skip (long@w{ }@var{n})
-
-@end deftypemethod
-@deftypemethod StringReader {public void} close ()
-
-@end deftypemethod
-@deftypemethod StringReader {public void} mark (int@w{ }@var{readAheadLimit}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod StringReader {public boolean} markSupported ()
-
-@end deftypemethod
-@deftypemethod StringReader {public int} read () @*throws IOException
-
-@end deftypemethod
-@deftypemethod StringReader {public int} read (char[]@w{ }@var{b}, int@w{ }@var{off}, int@w{ }@var{len}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod StringReader {public boolean} ready () @*throws IOException
-This method determines if the stream is ready to be read. This class
- is always ready to read and so always returns @code{true}, unless
- close() has previously been called in which case an IOException is
- thrown.
-@end deftypemethod
-@deftypemethod StringReader {public void} reset () @*throws IOException
-Sets the read position in the stream to the previously
- marked position or to 0 (i.e., the beginning of the stream) if the mark
- has not already been set.
-@end deftypemethod
-@deftypemethod StringReader {public long} skip (long@w{ }@var{n}) @*throws IOException
-This method attempts to skip the requested number of chars in the
- input stream. It does this by advancing the @code{pos} value by
- the specified number of chars. It this would exceed the length of the
- buffer, then only enough chars are skipped to position the stream at
- the end of the buffer. The actual number of chars skipped is returned.
-@end deftypemethod
-@deftypemethod StringWriter {public void} close ()
-
-@end deftypemethod
-@deftypemethod StringWriter {public void} flush ()
-
-@end deftypemethod
-@deftypemethod StringWriter {public StringBuffer} getBuffer ()
-
-@end deftypemethod
-@deftypemethod StringWriter {public String} toString ()
-
-@end deftypemethod
-@deftypemethod StringWriter {public void} write (int@w{ }@var{oneChar})
-
-@end deftypemethod
-@deftypemethod StringWriter {public void} write (char[]@w{ }@var{chars}, int@w{ }@var{offset}, int@w{ }@var{len})
-
-@end deftypemethod
-@deftypemethod StringWriter {public void} write (java.lang.String@w{ }@var{str})
-
-@end deftypemethod
-@deftypemethod StringWriter {public void} write (java.lang.String@w{ }@var{str}, int@w{ }@var{offset}, int@w{ }@var{len})
-
-@end deftypemethod
-@deftypemethod WriteAbortedException {public String} getMessage ()
-This method returns a message indicating what went wrong, including
- the message text from the initial exception that caused this one to
- be thrown
-@end deftypemethod
-@deftypemethod Writer {public abstract void} close () @*throws IOException
-
-@end deftypemethod
-@deftypemethod Writer {public abstract void} flush () @*throws IOException
-
-@end deftypemethod
-@deftypemethod Writer {public abstract void} write (char[]@w{ }@var{buf}, int@w{ }@var{offset}, int@w{ }@var{count}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod Writer {public void} write (char[]@w{ }@var{buf}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod Writer {public void} write (int@w{ }@var{ch}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod Writer {public void} write (java.lang.String@w{ }@var{str}, int@w{ }@var{offset}, int@w{ }@var{count}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod Writer {public void} write (java.lang.String@w{ }@var{str}) @*throws IOException
-
-@end deftypemethod
diff --git a/libjava/doc/java-lang-ref.texi b/libjava/doc/java-lang-ref.texi
deleted file mode 100644
index 4b9d7879538..00000000000
--- a/libjava/doc/java-lang-ref.texi
+++ /dev/null
@@ -1,34 +0,0 @@
-@deftypemethod PhantomReference {public Object} get ()
-Returns the object, this reference refers to.
-@end deftypemethod
-@deftypemethod Reference {public Object} get ()
-Returns the object, this reference refers to.
-@end deftypemethod
-@deftypemethod Reference {public void} clear ()
-Clears the reference, so that it doesn't refer to its object
- anymore. For soft and weak references this is called by the
- garbage collection. For phantom references you should call
- this when enqueuing the reference.
-@end deftypemethod
-@deftypemethod Reference {public boolean} isEnqueued ()
-Tells if the object is enqueued on a reference queue.
-@end deftypemethod
-@deftypemethod Reference {public boolean} enqueue ()
-Enqueue an object on a reference queue. This is normally executed
- by the garbage collection.
-@end deftypemethod
-@deftypemethod ReferenceQueue {public synchronized Reference} poll ()
-Checks if there is a reference on the queue, returning it
- immediately. The reference will be dequeued.
-@end deftypemethod
-@deftypemethod ReferenceQueue {public synchronized Reference} remove (long@w{ }@var{timeout}) @*throws InterruptedException
-Removes a reference from the queue, blocking for @code{timeout}
- until a reference is enqueued.
-@end deftypemethod
-@deftypemethod ReferenceQueue {public Reference} remove () @*throws InterruptedException
-Removes a reference from the queue, blocking until a reference is
- enqueued.
-@end deftypemethod
-@deftypemethod SoftReference {public Object} get ()
-Returns the object, this reference refers to.
-@end deftypemethod
diff --git a/libjava/doc/java-lang-reflect.texi b/libjava/doc/java-lang-reflect.texi
deleted file mode 100644
index 3712047747d..00000000000
--- a/libjava/doc/java-lang-reflect.texi
+++ /dev/null
@@ -1,294 +0,0 @@
-@deftypemethod AccessibleObject {public boolean} isAccessible ()
-
-@end deftypemethod
-@deftypemethod AccessibleObject {public static void} setAccessible (java.lang.reflect.AccessibleObject[]@w{ }@var{array}, boolean@w{ }@var{flag})
-
-@end deftypemethod
-@deftypemethod AccessibleObject {public void} setAccessible (boolean@w{ }@var{flag})
-
-@end deftypemethod
-@deftypemethod Array {public static native Object} newInstance (java.lang.Class@w{ }@var{componentType}, int@w{ }@var{length})
-
-@end deftypemethod
-@deftypemethod Array {public static native Object} newInstance (java.lang.Class@w{ }@var{elementType}, int[]@w{ }@var{dimensions})
-
-@end deftypemethod
-@deftypemethod Array {public static native int} getLength (java.lang.Object@w{ }@var{array})
-
-@end deftypemethod
-@deftypemethod Array {public static native Object} get (java.lang.Object@w{ }@var{array}, int@w{ }@var{index})
-
-@end deftypemethod
-@deftypemethod Array {public static native char} getChar (java.lang.Object@w{ }@var{array}, int@w{ }@var{index})
-
-@end deftypemethod
-@deftypemethod Array {public static native byte} getByte (java.lang.Object@w{ }@var{array}, int@w{ }@var{index})
-
-@end deftypemethod
-@deftypemethod Array {public static native short} getShort (java.lang.Object@w{ }@var{array}, int@w{ }@var{index})
-
-@end deftypemethod
-@deftypemethod Array {public static native int} getInt (java.lang.Object@w{ }@var{array}, int@w{ }@var{index})
-
-@end deftypemethod
-@deftypemethod Array {public static native long} getLong (java.lang.Object@w{ }@var{array}, int@w{ }@var{index})
-
-@end deftypemethod
-@deftypemethod Array {public static native float} getFloat (java.lang.Object@w{ }@var{array}, int@w{ }@var{index})
-
-@end deftypemethod
-@deftypemethod Array {public static native double} getDouble (java.lang.Object@w{ }@var{array}, int@w{ }@var{index})
-
-@end deftypemethod
-@deftypemethod Array {public static native boolean} getBoolean (java.lang.Object@w{ }@var{array}, int@w{ }@var{index})
-
-@end deftypemethod
-@deftypemethod Array {public static void} set (java.lang.Object@w{ }@var{array}, int@w{ }@var{index}, java.lang.Object@w{ }@var{value})
-
-@end deftypemethod
-@deftypemethod Array {public static native void} setByte (java.lang.Object@w{ }@var{array}, int@w{ }@var{index}, byte@w{ }@var{value})
-
-@end deftypemethod
-@deftypemethod Array {public static native void} setShort (java.lang.Object@w{ }@var{array}, int@w{ }@var{index}, short@w{ }@var{value})
-
-@end deftypemethod
-@deftypemethod Array {public static native void} setInt (java.lang.Object@w{ }@var{array}, int@w{ }@var{index}, int@w{ }@var{value})
-
-@end deftypemethod
-@deftypemethod Array {public static native void} setLong (java.lang.Object@w{ }@var{array}, int@w{ }@var{index}, long@w{ }@var{value})
-
-@end deftypemethod
-@deftypemethod Array {public static native void} setFloat (java.lang.Object@w{ }@var{array}, int@w{ }@var{index}, float@w{ }@var{value})
-
-@end deftypemethod
-@deftypemethod Array {public static native void} setDouble (java.lang.Object@w{ }@var{array}, int@w{ }@var{index}, double@w{ }@var{value})
-
-@end deftypemethod
-@deftypemethod Array {public static native void} setChar (java.lang.Object@w{ }@var{array}, int@w{ }@var{index}, char@w{ }@var{value})
-
-@end deftypemethod
-@deftypemethod Array {public static native void} setBoolean (java.lang.Object@w{ }@var{array}, int@w{ }@var{index}, boolean@w{ }@var{value})
-
-@end deftypemethod
-@deftypemethod Constructor {public boolean} equals (java.lang.Object@w{ }@var{obj})
-
-@end deftypemethod
-@deftypemethod Constructor {public Class} getDeclaringClass ()
-
-@end deftypemethod
-@deftypemethod Constructor {public Class} getExceptionTypes ()
-
-@end deftypemethod
-@deftypemethod Constructor {public native int} getModifiers ()
-
-@end deftypemethod
-@deftypemethod Constructor {public String} getName ()
-
-@end deftypemethod
-@deftypemethod Constructor {public Class} getParameterTypes ()
-
-@end deftypemethod
-@deftypemethod Constructor {public int} hashCode ()
-
-@end deftypemethod
-@deftypemethod Constructor {public native Object} newInstance (java.lang.Object[]@w{ }@var{args}) @*throws InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException
-
-@end deftypemethod
-@deftypemethod Constructor {public String} toString ()
-
-@end deftypemethod
-@deftypemethod Field {public boolean} equals (java.lang.Object@w{ }@var{fld})
-
-@end deftypemethod
-@deftypemethod Field {public Class} getDeclaringClass ()
-
-@end deftypemethod
-@deftypemethod Field {public native String} getName ()
-
-@end deftypemethod
-@deftypemethod Field {public native Class} getType ()
-
-@end deftypemethod
-@deftypemethod Field {public native int} getModifiers ()
-
-@end deftypemethod
-@deftypemethod Field {public int} hashCode ()
-
-@end deftypemethod
-@deftypemethod Field {public boolean} getBoolean (java.lang.Object@w{ }@var{obj}) @*throws IllegalArgumentException, IllegalAccessException
-
-@end deftypemethod
-@deftypemethod Field {public char} getChar (java.lang.Object@w{ }@var{obj}) @*throws IllegalArgumentException, IllegalAccessException
-
-@end deftypemethod
-@deftypemethod Field {public byte} getByte (java.lang.Object@w{ }@var{obj}) @*throws IllegalArgumentException, IllegalAccessException
-
-@end deftypemethod
-@deftypemethod Field {public short} getShort (java.lang.Object@w{ }@var{obj}) @*throws IllegalArgumentException, IllegalAccessException
-
-@end deftypemethod
-@deftypemethod Field {public int} getInt (java.lang.Object@w{ }@var{obj}) @*throws IllegalArgumentException, IllegalAccessException
-
-@end deftypemethod
-@deftypemethod Field {public long} getLong (java.lang.Object@w{ }@var{obj}) @*throws IllegalArgumentException, IllegalAccessException
-
-@end deftypemethod
-@deftypemethod Field {public float} getFloat (java.lang.Object@w{ }@var{obj}) @*throws IllegalArgumentException, IllegalAccessException
-
-@end deftypemethod
-@deftypemethod Field {public double} getDouble (java.lang.Object@w{ }@var{obj}) @*throws IllegalArgumentException, IllegalAccessException
-
-@end deftypemethod
-@deftypemethod Field {public Object} get (java.lang.Object@w{ }@var{obj}) @*throws IllegalArgumentException, IllegalAccessException
-
-@end deftypemethod
-@deftypemethod Field {public native Object} get (java.lang.Class@w{ }@var{caller}, java.lang.Object@w{ }@var{obj}) @*throws IllegalArgumentException, IllegalAccessException
-
-@end deftypemethod
-@deftypemethod Field {public void} setByte (java.lang.Object@w{ }@var{obj}, byte@w{ }@var{b}) @*throws IllegalArgumentException, IllegalAccessException
-
-@end deftypemethod
-@deftypemethod Field {public void} setShort (java.lang.Object@w{ }@var{obj}, short@w{ }@var{s}) @*throws IllegalArgumentException, IllegalAccessException
-
-@end deftypemethod
-@deftypemethod Field {public void} setInt (java.lang.Object@w{ }@var{obj}, int@w{ }@var{i}) @*throws IllegalArgumentException, IllegalAccessException
-
-@end deftypemethod
-@deftypemethod Field {public void} setLong (java.lang.Object@w{ }@var{obj}, long@w{ }@var{l}) @*throws IllegalArgumentException, IllegalAccessException
-
-@end deftypemethod
-@deftypemethod Field {public void} setFloat (java.lang.Object@w{ }@var{obj}, float@w{ }@var{f}) @*throws IllegalArgumentException, IllegalAccessException
-
-@end deftypemethod
-@deftypemethod Field {public void} setDouble (java.lang.Object@w{ }@var{obj}, double@w{ }@var{d}) @*throws IllegalArgumentException, IllegalAccessException
-
-@end deftypemethod
-@deftypemethod Field {public void} setChar (java.lang.Object@w{ }@var{obj}, char@w{ }@var{c}) @*throws IllegalArgumentException, IllegalAccessException
-
-@end deftypemethod
-@deftypemethod Field {public void} setBoolean (java.lang.Object@w{ }@var{obj}, boolean@w{ }@var{b}) @*throws IllegalArgumentException, IllegalAccessException
-
-@end deftypemethod
-@deftypemethod Field {public native void} setByte (java.lang.Class@w{ }@var{caller}, java.lang.Object@w{ }@var{obj}, byte@w{ }@var{b}) @*throws IllegalArgumentException, IllegalAccessException
-
-@end deftypemethod
-@deftypemethod Field {public native void} setShort (java.lang.Class@w{ }@var{caller}, java.lang.Object@w{ }@var{obj}, short@w{ }@var{s}) @*throws IllegalArgumentException, IllegalAccessException
-
-@end deftypemethod
-@deftypemethod Field {public native void} setInt (java.lang.Class@w{ }@var{caller}, java.lang.Object@w{ }@var{obj}, int@w{ }@var{i}) @*throws IllegalArgumentException, IllegalAccessException
-
-@end deftypemethod
-@deftypemethod Field {public native void} setLong (java.lang.Class@w{ }@var{caller}, java.lang.Object@w{ }@var{obj}, long@w{ }@var{l}) @*throws IllegalArgumentException, IllegalAccessException
-
-@end deftypemethod
-@deftypemethod Field {public native void} setFloat (java.lang.Class@w{ }@var{caller}, java.lang.Object@w{ }@var{obj}, float@w{ }@var{f}) @*throws IllegalArgumentException, IllegalAccessException
-
-@end deftypemethod
-@deftypemethod Field {public native void} setDouble (java.lang.Class@w{ }@var{caller}, java.lang.Object@w{ }@var{obj}, double@w{ }@var{d}) @*throws IllegalArgumentException, IllegalAccessException
-
-@end deftypemethod
-@deftypemethod Field {public native void} setChar (java.lang.Class@w{ }@var{caller}, java.lang.Object@w{ }@var{obj}, char@w{ }@var{c}) @*throws IllegalArgumentException, IllegalAccessException
-
-@end deftypemethod
-@deftypemethod Field {public native void} setBoolean (java.lang.Class@w{ }@var{caller}, java.lang.Object@w{ }@var{obj}, boolean@w{ }@var{b}) @*throws IllegalArgumentException, IllegalAccessException
-
-@end deftypemethod
-@deftypemethod Field {public void} set (java.lang.Object@w{ }@var{object}, java.lang.Object@w{ }@var{value}) @*throws IllegalArgumentException, IllegalAccessException
-
-@end deftypemethod
-@deftypemethod Field {public void} set (java.lang.Class@w{ }@var{caller}, java.lang.Object@w{ }@var{object}, java.lang.Object@w{ }@var{value}) @*throws IllegalArgumentException, IllegalAccessException
-
-@end deftypemethod
-@deftypemethod Field {public String} toString ()
-
-@end deftypemethod
-@deftypemethod InvocationTargetException {public Throwable} getTargetException ()
-
-@end deftypemethod
-@deftypemethod InvocationTargetException {public void} printStackTrace ()
-
-@end deftypemethod
-@deftypemethod InvocationTargetException {public void} printStackTrace (java.io.PrintStream@w{ }@var{s})
-
-@end deftypemethod
-@deftypemethod InvocationTargetException {public void} printStackTrace (java.io.PrintWriter@w{ }@var{wr})
-
-@end deftypemethod
-@deftypemethod Member {public Class} getDeclaringClass ()
-
-@end deftypemethod
-@deftypemethod Member {public int} getModifiers ()
-
-@end deftypemethod
-@deftypemethod Member {public String} getName ()
-
-@end deftypemethod
-@deftypemethod Method {public boolean} equals (java.lang.Object@w{ }@var{obj})
-
-@end deftypemethod
-@deftypemethod Method {public Class} getDeclaringClass ()
-
-@end deftypemethod
-@deftypemethod Method {public Class} getExceptionTypes ()
-
-@end deftypemethod
-@deftypemethod Method {public native int} getModifiers ()
-
-@end deftypemethod
-@deftypemethod Method {public native String} getName ()
-
-@end deftypemethod
-@deftypemethod Method {public Class} getParameterTypes ()
-
-@end deftypemethod
-@deftypemethod Method {public Class} getReturnType ()
-
-@end deftypemethod
-@deftypemethod Method {public int} hashCode ()
-
-@end deftypemethod
-@deftypemethod Method {public native Object} invoke (java.lang.Object@w{ }@var{obj}, java.lang.Object[]@w{ }@var{args}) @*throws IllegalAccessException, IllegalArgumentException, InvocationTargetException
-
-@end deftypemethod
-@deftypemethod Method {public String} toString ()
-
-@end deftypemethod
-@deftypemethod Modifier {public static boolean} isAbstract (int@w{ }@var{mod})
-
-@end deftypemethod
-@deftypemethod Modifier {public static boolean} isFinal (int@w{ }@var{mod})
-
-@end deftypemethod
-@deftypemethod Modifier {public static boolean} isInterface (int@w{ }@var{mod})
-
-@end deftypemethod
-@deftypemethod Modifier {public static boolean} isNative (int@w{ }@var{mod})
-
-@end deftypemethod
-@deftypemethod Modifier {public static boolean} isPrivate (int@w{ }@var{mod})
-
-@end deftypemethod
-@deftypemethod Modifier {public static boolean} isProtected (int@w{ }@var{mod})
-
-@end deftypemethod
-@deftypemethod Modifier {public static boolean} isPublic (int@w{ }@var{mod})
-
-@end deftypemethod
-@deftypemethod Modifier {public static boolean} isStatic (int@w{ }@var{mod})
-
-@end deftypemethod
-@deftypemethod Modifier {public static boolean} isStrict (int@w{ }@var{mod})
-
-@end deftypemethod
-@deftypemethod Modifier {public static boolean} isSynchronized (int@w{ }@var{mod})
-
-@end deftypemethod
-@deftypemethod Modifier {public static boolean} isTransient (int@w{ }@var{mod})
-
-@end deftypemethod
-@deftypemethod Modifier {public static boolean} isVolatile (int@w{ }@var{mod})
-
-@end deftypemethod
-@deftypemethod Modifier {public static String} toString (int@w{ }@var{mod})
-
-@end deftypemethod
diff --git a/libjava/doc/java-lang.texi b/libjava/doc/java-lang.texi
deleted file mode 100644
index 086e7e1b386..00000000000
--- a/libjava/doc/java-lang.texi
+++ /dev/null
@@ -1,855 +0,0 @@
-@deftypemethod Process {public abstract void} destroy ()
-
-@end deftypemethod
-@deftypemethod Process {public abstract int} exitValue ()
-
-@end deftypemethod
-@deftypemethod Process {public abstract InputStream} getErrorStream ()
-
-@end deftypemethod
-@deftypemethod Process {public abstract InputStream} getInputStream ()
-
-@end deftypemethod
-@deftypemethod Process {public abstract OutputStream} getOutputStream ()
-
-@end deftypemethod
-@deftypemethod Process {public abstract int} waitFor () @*throws InterruptedException
-
-@end deftypemethod
-@deftypemethod Runnable {public void} run ()
-
-@end deftypemethod
-@deftypemethod Runtime {public Process} exec (java.lang.String@w{ }@var{prog}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod Runtime {public Process} exec (java.lang.String@w{ }@var{prog}, java.lang.String[]@w{ }@var{envp}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod Runtime {public Process} exec (java.lang.String[]@w{ }@var{progarray}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod Runtime {public Process} exec (java.lang.String[]@w{ }@var{progarray}, java.lang.String[]@w{ }@var{envp}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod Runtime {public native void} exit (int@w{ }@var{status})
-
-@end deftypemethod
-@deftypemethod Runtime {public native long} freeMemory ()
-
-@end deftypemethod
-@deftypemethod Runtime {public native void} gc ()
-
-@end deftypemethod
-@deftypemethod Runtime {public InputStream} getLocalizedInputStream (java.io.InputStream@w{ }@var{in})
-
-@end deftypemethod
-@deftypemethod Runtime {public OutputStream} getLocalizedOutputStream (java.io.OutputStream@w{ }@var{out})
-
-@end deftypemethod
-@deftypemethod Runtime {public static Runtime} getRuntime ()
-
-@end deftypemethod
-@deftypemethod Runtime {public void} load (java.lang.String@w{ }@var{pathname})
-
-@end deftypemethod
-@deftypemethod Runtime {public void} loadLibrary (java.lang.String@w{ }@var{libname})
-
-@end deftypemethod
-@deftypemethod Runtime {public native void} runFinalization ()
-
-@end deftypemethod
-@deftypemethod Runtime {public static void} runFinalizersOnExit (boolean@w{ }@var{run})
-
-@end deftypemethod
-@deftypemethod Runtime {public native long} totalMemory ()
-
-@end deftypemethod
-@deftypemethod Runtime {public native void} traceInstructions (boolean@w{ }@var{on})
-
-@end deftypemethod
-@deftypemethod Runtime {public native void} traceMethodCalls (boolean@w{ }@var{on})
-
-@end deftypemethod
-@deftypemethod SecurityManager {public void} checkAccept (java.lang.String@w{ }@var{host}, int@w{ }@var{port})
-
-@end deftypemethod
-@deftypemethod SecurityManager {public void} checkAccess (java.lang.Thread@w{ }@var{thrd})
-
-@end deftypemethod
-@deftypemethod SecurityManager {public void} checkAccess (java.lang.ThreadGroup@w{ }@var{thrdGroup})
-
-@end deftypemethod
-@deftypemethod SecurityManager {public void} checkAwtEventQueueAccess ()
-
-@end deftypemethod
-@deftypemethod SecurityManager {public void} checkConnect (java.lang.String@w{ }@var{host}, int@w{ }@var{prt})
-
-@end deftypemethod
-@deftypemethod SecurityManager {public void} checkConnect (java.lang.String@w{ }@var{host}, int@w{ }@var{prt}, java.lang.Object@w{ }@var{ctx})
-
-@end deftypemethod
-@deftypemethod SecurityManager {public void} checkCreateClassLoader ()
-
-@end deftypemethod
-@deftypemethod SecurityManager {public void} checkDelete (java.lang.String@w{ }@var{fileName})
-
-@end deftypemethod
-@deftypemethod SecurityManager {public void} checkExec (java.lang.String@w{ }@var{prog})
-
-@end deftypemethod
-@deftypemethod SecurityManager {public void} checkExit (int@w{ }@var{stat})
-
-@end deftypemethod
-@deftypemethod SecurityManager {public void} checkLink (java.lang.String@w{ }@var{lib})
-
-@end deftypemethod
-@deftypemethod SecurityManager {public void} checkListen (int@w{ }@var{lport})
-
-@end deftypemethod
-@deftypemethod SecurityManager {public void} checkMemberAccess (java.lang.Class@w{ }@var{cl}, int@w{ }@var{mtype})
-
-@end deftypemethod
-@deftypemethod SecurityManager {public void} checkMulticast (java.net.InetAddress@w{ }@var{maddr})
-
-@end deftypemethod
-@deftypemethod SecurityManager {public void} checkMulticast (java.net.InetAddress@w{ }@var{maddr}, byte@w{ }@var{ttl})
-
-@end deftypemethod
-@deftypemethod SecurityManager {public void} checkPackageAccess (java.lang.String@w{ }@var{pkg})
-
-@end deftypemethod
-@deftypemethod SecurityManager {public void} checkPackageDefinition (java.lang.String@w{ }@var{pkg})
-
-@end deftypemethod
-@deftypemethod SecurityManager {public void} checkPermission (java.security.Permission@w{ }@var{perm})
-
-@end deftypemethod
-@deftypemethod SecurityManager {public void} checkPrintJobAccess ()
-
-@end deftypemethod
-@deftypemethod SecurityManager {public void} checkPropertiesAccess ()
-
-@end deftypemethod
-@deftypemethod SecurityManager {public void} checkPropertyAccess (java.lang.String@w{ }@var{prop})
-
-@end deftypemethod
-@deftypemethod SecurityManager {public void} checkPropertyAccess (java.lang.String@w{ }@var{prop}, java.lang.String@w{ }@var{defval})
-
-@end deftypemethod
-@deftypemethod SecurityManager {public void} checkRead (java.io.FileDescriptor@w{ }@var{fd})
-
-@end deftypemethod
-@deftypemethod SecurityManager {public void} checkRead (java.lang.String@w{ }@var{fileName})
-
-@end deftypemethod
-@deftypemethod SecurityManager {public void} checkRead (java.lang.String@w{ }@var{fileName}, java.lang.Object@w{ }@var{ctx})
-
-@end deftypemethod
-@deftypemethod SecurityManager {public void} checkSecurityAccess (java.lang.String@w{ }@var{action})
-
-@end deftypemethod
-@deftypemethod SecurityManager {public void} checkSetFactory ()
-
-@end deftypemethod
-@deftypemethod SecurityManager {public void} checkSystemClipboardAccess ()
-
-@end deftypemethod
-@deftypemethod SecurityManager {public boolean} checkTopLevelWindow (java.lang.Object@w{ }@var{window})
-
-@end deftypemethod
-@deftypemethod SecurityManager {public void} checkWrite (java.io.FileDescriptor@w{ }@var{fd})
-
-@end deftypemethod
-@deftypemethod SecurityManager {public void} checkWrite (java.lang.String@w{ }@var{fileName})
-
-@end deftypemethod
-@deftypemethod SecurityManager {protected int} classDepth (java.lang.String@w{ }@var{className})
-
-@end deftypemethod
-@deftypemethod SecurityManager {protected int} classLoaderDepth ()
-
-@end deftypemethod
-@deftypemethod SecurityManager {protected ClassLoader} currentClassLoader ()
-
-@end deftypemethod
-@deftypemethod SecurityManager {protected Class} currentLoadedClass ()
-
-@end deftypemethod
-@deftypemethod SecurityManager {protected Class} getClassContext ()
-
-@end deftypemethod
-@deftypemethod SecurityManager {public boolean} getInCheck ()
-
-@end deftypemethod
-@deftypemethod SecurityManager {public Object} getSecurityContext ()
-
-@end deftypemethod
-@deftypemethod SecurityManager {public ThreadGroup} getThreadGroup ()
-
-@end deftypemethod
-@deftypemethod SecurityManager {protected boolean} inClass (java.lang.String@w{ }@var{className})
-
-@end deftypemethod
-@deftypemethod SecurityManager {protected boolean} inClassLoader ()
-
-@end deftypemethod
-@deftypemethod Short {public byte} byteValue ()
-
-@end deftypemethod
-@deftypemethod Short {public short} shortValue ()
-
-@end deftypemethod
-@deftypemethod Short {public int} intValue ()
-
-@end deftypemethod
-@deftypemethod Short {public long} longValue ()
-
-@end deftypemethod
-@deftypemethod Short {public float} floatValue ()
-
-@end deftypemethod
-@deftypemethod Short {public double} doubleValue ()
-
-@end deftypemethod
-@deftypemethod Short {public static Short} decode (java.lang.String@w{ }@var{str}) @*throws NumberFormatException
-
-@end deftypemethod
-@deftypemethod Short {public static short} parseShort (java.lang.String@w{ }@var{str}, int@w{ }@var{radix}) @*throws NumberFormatException
-
-@end deftypemethod
-@deftypemethod Short {public static short} parseShort (java.lang.String@w{ }@var{str}) @*throws NumberFormatException
-
-@end deftypemethod
-@deftypemethod Short {public static Short} valueOf (java.lang.String@w{ }@var{str}, int@w{ }@var{radix}) @*throws NumberFormatException
-
-@end deftypemethod
-@deftypemethod Short {public static Short} valueOf (java.lang.String@w{ }@var{str}) @*throws NumberFormatException
-
-@end deftypemethod
-@deftypemethod Short {public int} compareTo (java.lang.Short@w{ }@var{anotherShort})
-
-@end deftypemethod
-@deftypemethod Short {public int} compareTo (java.lang.Object@w{ }@var{o}) @*throws ClassCastException
-
-@end deftypemethod
-@deftypemethod Short {public boolean} equals (java.lang.Object@w{ }@var{obj})
-
-@end deftypemethod
-@deftypemethod Short {public int} hashCode ()
-
-@end deftypemethod
-@deftypemethod Short {public String} toString ()
-
-@end deftypemethod
-@deftypemethod Short {public static String} toString (short@w{ }@var{value})
-
-@end deftypemethod
-@deftypemethod String {public static String} copyValueOf (char[]@w{ }@var{data})
-
-@end deftypemethod
-@deftypemethod String {public static String} copyValueOf (char[]@w{ }@var{data}, int@w{ }@var{offset}, int@w{ }@var{count})
-
-@end deftypemethod
-@deftypemethod String {public String} toString ()
-
-@end deftypemethod
-@deftypemethod String {public native boolean} equals (java.lang.Object@w{ }@var{anObject})
-
-@end deftypemethod
-@deftypemethod String {public native int} hashCode ()
-
-@end deftypemethod
-@deftypemethod String {public int} length ()
-
-@end deftypemethod
-@deftypemethod String {public native char} charAt (int@w{ }@var{index})
-
-@end deftypemethod
-@deftypemethod String {public native void} getChars (int@w{ }@var{srcBegin}, int@w{ }@var{srcEnd}, char[]@w{ }@var{dst}, int@w{ }@var{dstBegin})
-
-@end deftypemethod
-@deftypemethod String {public byte} getBytes ()
-
-@end deftypemethod
-@deftypemethod String {public native byte} getBytes (java.lang.String@w{ }@var{enc}) @*throws UnsupportedEncodingException
-
-@end deftypemethod
-@deftypemethod String {public native void} getBytes (int@w{ }@var{srcBegin}, int@w{ }@var{srcEnd}, byte[]@w{ }@var{dst}, int@w{ }@var{dstBegin})
-
-@end deftypemethod
-@deftypemethod String {public native char} toCharArray ()
-
-@end deftypemethod
-@deftypemethod String {public native boolean} equalsIgnoreCase (java.lang.String@w{ }@var{anotherString})
-
-@end deftypemethod
-@deftypemethod String {public native int} compareTo (java.lang.String@w{ }@var{anotherString})
-
-@end deftypemethod
-@deftypemethod String {public int} compareTo (java.lang.Object@w{ }@var{obj})
-
-@end deftypemethod
-@deftypemethod String {public int} compareToIgnoreCase (java.lang.String@w{ }@var{str})
-
-@end deftypemethod
-@deftypemethod String {public native boolean} regionMatches (int@w{ }@var{toffset}, java.lang.String@w{ }@var{other}, int@w{ }@var{ooffset}, int@w{ }@var{len})
-
-@end deftypemethod
-@deftypemethod String {public native boolean} regionMatches (boolean@w{ }@var{ignoreCase}, int@w{ }@var{toffset}, java.lang.String@w{ }@var{other}, int@w{ }@var{ooffset}, int@w{ }@var{len})
-
-@end deftypemethod
-@deftypemethod String {public boolean} startsWith (java.lang.String@w{ }@var{prefix})
-
-@end deftypemethod
-@deftypemethod String {public native boolean} startsWith (java.lang.String@w{ }@var{prefix}, int@w{ }@var{toffset})
-
-@end deftypemethod
-@deftypemethod String {public boolean} endsWith (java.lang.String@w{ }@var{suffix})
-
-@end deftypemethod
-@deftypemethod String {public int} indexOf (int@w{ }@var{ch})
-
-@end deftypemethod
-@deftypemethod String {public native int} indexOf (int@w{ }@var{ch}, int@w{ }@var{fromIndex})
-
-@end deftypemethod
-@deftypemethod String {public int} indexOf (java.lang.String@w{ }@var{str})
-
-@end deftypemethod
-@deftypemethod String {public native int} indexOf (java.lang.String@w{ }@var{str}, int@w{ }@var{fromIndex})
-
-@end deftypemethod
-@deftypemethod String {public int} lastIndexOf (int@w{ }@var{ch})
-
-@end deftypemethod
-@deftypemethod String {public native int} lastIndexOf (int@w{ }@var{ch}, int@w{ }@var{fromIndex})
-
-@end deftypemethod
-@deftypemethod String {public int} lastIndexOf (java.lang.String@w{ }@var{str})
-
-@end deftypemethod
-@deftypemethod String {public int} lastIndexOf (java.lang.String@w{ }@var{str}, int@w{ }@var{fromIndex})
-
-@end deftypemethod
-@deftypemethod String {public String} substring (int@w{ }@var{beginIndex})
-
-@end deftypemethod
-@deftypemethod String {public native String} substring (int@w{ }@var{beginIndex}, int@w{ }@var{endIndex})
-
-@end deftypemethod
-@deftypemethod String {public native String} concat (java.lang.String@w{ }@var{str})
-
-@end deftypemethod
-@deftypemethod String {public native String} replace (char@w{ }@var{oldChar}, char@w{ }@var{newChar})
-
-@end deftypemethod
-@deftypemethod String {public native String} toLowerCase (java.util.Locale@w{ }@var{locale})
-
-@end deftypemethod
-@deftypemethod String {public native String} toUpperCase (java.util.Locale@w{ }@var{locale})
-
-@end deftypemethod
-@deftypemethod String {public String} toLowerCase ()
-
-@end deftypemethod
-@deftypemethod String {public String} toUpperCase ()
-
-@end deftypemethod
-@deftypemethod String {public native String} trim ()
-
-@end deftypemethod
-@deftypemethod String {public static String} valueOf (java.lang.Object@w{ }@var{obj})
-
-@end deftypemethod
-@deftypemethod String {public static String} valueOf (char[]@w{ }@var{data})
-
-@end deftypemethod
-@deftypemethod String {public static native String} valueOf (char[]@w{ }@var{data}, int@w{ }@var{offset}, int@w{ }@var{count})
-
-@end deftypemethod
-@deftypemethod String {public static String} valueOf (boolean@w{ }@var{b})
-
-@end deftypemethod
-@deftypemethod String {public static native String} valueOf (char@w{ }@var{c})
-
-@end deftypemethod
-@deftypemethod String {public static String} valueOf (int@w{ }@var{i})
-
-@end deftypemethod
-@deftypemethod String {public static String} valueOf (long@w{ }@var{l})
-
-@end deftypemethod
-@deftypemethod String {public static String} valueOf (float@w{ }@var{f})
-
-@end deftypemethod
-@deftypemethod String {public static String} valueOf (double@w{ }@var{d})
-
-@end deftypemethod
-@deftypemethod String {public native String} intern ()
-
-@end deftypemethod
-@deftypemethod StringBuffer {public StringBuffer} append (boolean@w{ }@var{bool})
-Append the @code{String} value of the argument to this @code{StringBuffer}.
- Uses @code{String.valueOf()} to convert to
- @code{String}.
-@end deftypemethod
-@deftypemethod StringBuffer {public synchronized StringBuffer} append (char@w{ }@var{ch})
-Append the @code{char} to this @code{StringBuffer}.
-@end deftypemethod
-@deftypemethod StringBuffer {public StringBuffer} append (int@w{ }@var{inum})
-Append the @code{String} value of the argument to this @code{StringBuffer}.
- Uses @code{String.valueOf()} to convert to
- @code{String}.
-@end deftypemethod
-@deftypemethod StringBuffer {public StringBuffer} append (long@w{ }@var{lnum})
-Append the @code{String} value of the argument to this @code{StringBuffer}.
- Uses @code{String.valueOf()} to convert to
- @code{String}.
-@end deftypemethod
-@deftypemethod StringBuffer {public StringBuffer} append (float@w{ }@var{fnum})
-Append the @code{String} value of the argument to this @code{StringBuffer}.
- Uses @code{String.valueOf()} to convert to
- @code{String}.
-@end deftypemethod
-@deftypemethod StringBuffer {public StringBuffer} append (double@w{ }@var{dnum})
-Append the @code{String} value of the argument to this @code{StringBuffer}.
- Uses @code{String.valueOf()} to convert to
- @code{String}.
-@end deftypemethod
-@deftypemethod StringBuffer {public StringBuffer} append (java.lang.Object@w{ }@var{obj})
-Append the @code{String} value of the argument to this @code{StringBuffer}.
- Uses @code{String.valueOf()} to convert to
- @code{String}.
-@end deftypemethod
-@deftypemethod StringBuffer {public synchronized StringBuffer} append (java.lang.String@w{ }@var{str})
-Append the @code{String} to this @code{StringBuffer}.
-@end deftypemethod
-@deftypemethod StringBuffer {public StringBuffer} append (char[]@w{ }@var{data})
-Append the @code{char} array to this @code{StringBuffer}.
-@end deftypemethod
-@deftypemethod StringBuffer {public synchronized StringBuffer} append (char[]@w{ }@var{data}, int@w{ }@var{offset}, int@w{ }@var{count})
-Append the @code{char} array to this @code{StringBuffer}.
-@end deftypemethod
-@deftypemethod StringBuffer {public int} capacity ()
-Get the total number of characters this @code{StringBuffer}
- can support before it must be grown. Not to be confused with
- <em>length</em>.
-@end deftypemethod
-@deftypemethod StringBuffer {public synchronized char} charAt (int@w{ }@var{index})
-Get the character at the specified index.
-@end deftypemethod
-@deftypemethod StringBuffer {public synchronized StringBuffer} delete (int@w{ }@var{start}, int@w{ }@var{end})
-Delete characters from this @code{StringBuffer}.
- @code{delete(10, 12)} will delete 10 and 11, but not 12.
-@end deftypemethod
-@deftypemethod StringBuffer {public StringBuffer} deleteCharAt (int@w{ }@var{index})
-Delete a character from this @code{StringBuffer}.
-@end deftypemethod
-@deftypemethod StringBuffer {public synchronized void} ensureCapacity (int@w{ }@var{minimumCapacity})
-Increase the capacity of this @code{StringBuffer}.
- This will ensure that an expensive growing operation will not occur
- until @code{minimumCapacity} is reached.
- If the capacity is actually already greater than @code{minimumCapacity}
-@end deftypemethod
-@deftypemethod StringBuffer {public synchronized void} getChars (int@w{ }@var{srcOffset}, int@w{ }@var{srcEnd}, char[]@w{ }@var{dst}, int@w{ }@var{dstOffset})
-Get the specified array of characters.
- The characters will be copied into the array you pass in.
-@end deftypemethod
-@deftypemethod StringBuffer {public StringBuffer} insert (int@w{ }@var{offset}, boolean@w{ }@var{bool})
-Insert the @code{String} value of the argument into this @code{StringBuffer}.
- Uses @code{String.valueOf()} to convert to
- @code{String}.
-@end deftypemethod
-@deftypemethod StringBuffer {public synchronized StringBuffer} insert (int@w{ }@var{offset}, char@w{ }@var{ch})
-Insert the @code{char} argument into this @code{StringBuffer}.
-@end deftypemethod
-@deftypemethod StringBuffer {public StringBuffer} insert (int@w{ }@var{offset}, int@w{ }@var{inum})
-Insert the @code{String} value of the argument into this @code{StringBuffer}.
- Uses @code{String.valueOf()} to convert to
- @code{String}.
-@end deftypemethod
-@deftypemethod StringBuffer {public StringBuffer} insert (int@w{ }@var{offset}, long@w{ }@var{lnum})
-Insert the @code{String} value of the argument into this @code{StringBuffer}.
- Uses @code{String.valueOf()} to convert to
- @code{String}.
-@end deftypemethod
-@deftypemethod StringBuffer {public StringBuffer} insert (int@w{ }@var{offset}, float@w{ }@var{fnum})
-Insert the @code{String} value of the argument into this @code{StringBuffer}.
- Uses @code{String.valueOf()} to convert to
- @code{String}.
-@end deftypemethod
-@deftypemethod StringBuffer {public StringBuffer} insert (int@w{ }@var{offset}, double@w{ }@var{dnum})
-Insert the @code{String} value of the argument into this @code{StringBuffer}.
- Uses @code{String.valueOf()} to convert to
- @code{String}.
-@end deftypemethod
-@deftypemethod StringBuffer {public StringBuffer} insert (int@w{ }@var{offset}, java.lang.Object@w{ }@var{obj})
-Insert the @code{String} value of the argument into this @code{StringBuffer}.
- Uses @code{String.valueOf()} to convert to
- @code{String}.
-@end deftypemethod
-@deftypemethod StringBuffer {public synchronized StringBuffer} insert (int@w{ }@var{offset}, java.lang.String@w{ }@var{str})
-Insert the @code{String} argument into this @code{StringBuffer}.
-@end deftypemethod
-@deftypemethod StringBuffer {public StringBuffer} insert (int@w{ }@var{offset}, char[]@w{ }@var{data})
-Insert the @code{char[]} argument into this
- @code{StringBuffer}.
-@end deftypemethod
-@deftypemethod StringBuffer {public synchronized StringBuffer} insert (int@w{ }@var{offset}, char[]@w{ }@var{str}, int@w{ }@var{str_offset}, int@w{ }@var{len})
-Insert the @code{char[]} argument into this
- @code{StringBuffer}.
-@end deftypemethod
-@deftypemethod StringBuffer {public int} length ()
-Get the length of the @code{String} this
- @code{StringBuffer} would create. Not to be confused with the
- <em>capacity</em> of the @code{StringBuffer}.
-@end deftypemethod
-@deftypemethod StringBuffer {public synchronized StringBuffer} replace (int@w{ }@var{start}, int@w{ }@var{end}, java.lang.String@w{ }@var{str})
-Replace characters between index @code{start} (inclusive) and
- @code{end} (exclusive) with @code{str}. If @code{end}
- is larger than the size of this StringBuffer, all characters after
- @code{start} are replaced.
-@end deftypemethod
-@deftypemethod StringBuffer {public synchronized StringBuffer} reverse ()
-Reverse the characters in this StringBuffer.
-@end deftypemethod
-@deftypemethod StringBuffer {public synchronized void} setCharAt (int@w{ }@var{index}, char@w{ }@var{ch})
-Set the character at the specified index.
-@end deftypemethod
-@deftypemethod StringBuffer {public synchronized void} setLength (int@w{ }@var{newLength})
-Set the length of this StringBuffer.
-
-
-
- If the new length is greater than the current length, all the new
- characters are set to '\0'.
-
-
-
- If the new length is less than the current length, the first
- @code{newLength} characters of the old array will be
-@end deftypemethod
-@deftypemethod StringBuffer {public String} substring (int@w{ }@var{beginIndex})
-Creates a substring of this StringBuffer, starting at a specified index
- and ending at the end of this StringBuffer.
-@end deftypemethod
-@deftypemethod StringBuffer {public synchronized String} substring (int@w{ }@var{beginIndex}, int@w{ }@var{endIndex})
-Creates a substring of this StringBuffer, starting at a specified index
- and ending at one character before a specified index.
-@end deftypemethod
-@deftypemethod StringBuffer {public String} toString ()
-Convert this @code{StringBuffer} to a @code{String}.
-@end deftypemethod
-@deftypemethod System {public static native void} arraycopy (java.lang.Object@w{ }@var{src}, int@w{ }@var{srcOffset}, java.lang.Object@w{ }@var{dst}, int@w{ }@var{dstOffset}, int@w{ }@var{count})
-
-@end deftypemethod
-@deftypemethod System {public static native long} currentTimeMillis ()
-
-@end deftypemethod
-@deftypemethod System {public static void} exit (int@w{ }@var{status})
-
-@end deftypemethod
-@deftypemethod System {public static void} gc ()
-
-@end deftypemethod
-@deftypemethod System {public static String} getenv (java.lang.String@w{ }@var{name})
-
-@end deftypemethod
-@deftypemethod System {public static Properties} getProperties ()
-
-@end deftypemethod
-@deftypemethod System {public static String} getProperty (java.lang.String@w{ }@var{property})
-
-@end deftypemethod
-@deftypemethod System {public static String} getProperty (java.lang.String@w{ }@var{property}, java.lang.String@w{ }@var{defval})
-
-@end deftypemethod
-@deftypemethod System {public static SecurityManager} getSecurityManager ()
-
-@end deftypemethod
-@deftypemethod System {public static native int} identityHashCode (java.lang.Object@w{ }@var{obj})
-
-@end deftypemethod
-@deftypemethod System {public static void} load (java.lang.String@w{ }@var{pathname})
-
-@end deftypemethod
-@deftypemethod System {public static void} loadLibrary (java.lang.String@w{ }@var{libname})
-
-@end deftypemethod
-@deftypemethod System {public static void} runFinalization ()
-
-@end deftypemethod
-@deftypemethod System {public static void} runFinalizersOnExit (boolean@w{ }@var{run})
-
-@end deftypemethod
-@deftypemethod System {public static native void} setErr (java.io.PrintStream@w{ }@var{newErr})
-
-@end deftypemethod
-@deftypemethod System {public static native void} setIn (java.io.InputStream@w{ }@var{newIn})
-
-@end deftypemethod
-@deftypemethod System {public static native void} setOut (java.io.PrintStream@w{ }@var{newOut})
-
-@end deftypemethod
-@deftypemethod System {public static void} setProperties (java.util.Properties@w{ }@var{props})
-
-@end deftypemethod
-@deftypemethod System {public static String} setProperty (java.lang.String@w{ }@var{key}, java.lang.String@w{ }@var{value})
-
-@end deftypemethod
-@deftypemethod System {public static void} setSecurityManager (java.lang.SecurityManager@w{ }@var{s})
-
-@end deftypemethod
-@deftypemethod Thread {public static int} activeCount ()
-
-@end deftypemethod
-@deftypemethod Thread {public final void} checkAccess ()
-
-@end deftypemethod
-@deftypemethod Thread {public native int} countStackFrames ()
-
-@end deftypemethod
-@deftypemethod Thread {public static native Thread} currentThread ()
-
-@end deftypemethod
-@deftypemethod Thread {public native void} destroy ()
-
-@end deftypemethod
-@deftypemethod Thread {public static void} dumpStack ()
-
-@end deftypemethod
-@deftypemethod Thread {public static int} enumerate (java.lang.Thread[]@w{ }@var{threads})
-
-@end deftypemethod
-@deftypemethod Thread {public final String} getName ()
-
-@end deftypemethod
-@deftypemethod Thread {public final int} getPriority ()
-
-@end deftypemethod
-@deftypemethod Thread {public final ThreadGroup} getThreadGroup ()
-
-@end deftypemethod
-@deftypemethod Thread {public native void} interrupt ()
-
-@end deftypemethod
-@deftypemethod Thread {public static boolean} interrupted ()
-
-@end deftypemethod
-@deftypemethod Thread {public boolean} isInterrupted ()
-
-@end deftypemethod
-@deftypemethod Thread {public final boolean} isAlive ()
-
-@end deftypemethod
-@deftypemethod Thread {public final boolean} isDaemon ()
-
-@end deftypemethod
-@deftypemethod Thread {public final void} join () @*throws InterruptedException
-
-@end deftypemethod
-@deftypemethod Thread {public final void} join (long@w{ }@var{timeout}) @*throws InterruptedException
-
-@end deftypemethod
-@deftypemethod Thread {public final native void} join (long@w{ }@var{timeout}, int@w{ }@var{nanos}) @*throws InterruptedException
-
-@end deftypemethod
-@deftypemethod Thread {public final native void} resume ()
-
-@end deftypemethod
-@deftypemethod Thread {public void} run ()
-
-@end deftypemethod
-@deftypemethod Thread {public final void} setDaemon (boolean@w{ }@var{status})
-
-@end deftypemethod
-@deftypemethod Thread {public synchronized ClassLoader} getContextClassLoader ()
-
-@end deftypemethod
-@deftypemethod Thread {public synchronized void} setContextClassLoader (java.lang.ClassLoader@w{ }@var{cl})
-
-@end deftypemethod
-@deftypemethod Thread {public final void} setName (java.lang.String@w{ }@var{n})
-
-@end deftypemethod
-@deftypemethod Thread {public final native void} setPriority (int@w{ }@var{newPriority})
-
-@end deftypemethod
-@deftypemethod Thread {public static void} sleep (long@w{ }@var{timeout}) @*throws InterruptedException
-
-@end deftypemethod
-@deftypemethod Thread {public static native void} sleep (long@w{ }@var{timeout}, int@w{ }@var{nanos}) @*throws InterruptedException
-
-@end deftypemethod
-@deftypemethod Thread {public native synchronized void} start ()
-
-@end deftypemethod
-@deftypemethod Thread {public final void} stop ()
-
-@end deftypemethod
-@deftypemethod Thread {public final native synchronized void} stop (java.lang.Throwable@w{ }@var{e})
-
-@end deftypemethod
-@deftypemethod Thread {public final native void} suspend ()
-
-@end deftypemethod
-@deftypemethod Thread {public String} toString ()
-
-@end deftypemethod
-@deftypemethod Thread {public static native void} yield ()
-
-@end deftypemethod
-@deftypemethod ThreadGroup {public final String} getName ()
-Get the name of this ThreadGroup.
-@end deftypemethod
-@deftypemethod ThreadGroup {public final ThreadGroup} getParent ()
-Get the parent of this ThreadGroup.
-@end deftypemethod
-@deftypemethod ThreadGroup {public final synchronized void} setMaxPriority (int@w{ }@var{maxpri})
-Set the maximum priority for Threads in this ThreadGroup. setMaxPriority
- can only be used to reduce the current maximum. If maxpri
- is greater than the current Maximum, the current value is not changed.
- Calling this does not effect threads already in this ThreadGroup.
-@end deftypemethod
-@deftypemethod ThreadGroup {public final int} getMaxPriority ()
-Get the maximum priority of Threads in this ThreadGroup.
-@end deftypemethod
-@deftypemethod ThreadGroup {public final void} setDaemon (boolean@w{ }@var{daemon})
-Set whether this ThreadGroup is a daemon group. A daemon
- group will be destroyed when its last thread is stopped and
- its last thread group is destroyed.
-@end deftypemethod
-@deftypemethod ThreadGroup {public final boolean} isDaemon ()
-Tell whether this ThreadGroup is a daemon group. A daemon
- group will be destroyed when its last thread is stopped and
- its last thread group is destroyed.
-@end deftypemethod
-@deftypemethod ThreadGroup {public synchronized boolean} isDestroyed ()
-Tell whether this ThreadGroup has been destroyed or not.
-@end deftypemethod
-@deftypemethod ThreadGroup {public final boolean} parentOf (java.lang.ThreadGroup@w{ }@var{tg})
-Check whether this ThreadGroup is an ancestor of the
- specified ThreadGroup, or if they are the same.
-@end deftypemethod
-@deftypemethod ThreadGroup {public synchronized int} activeCount ()
-Return the total number of active threads in this ThreadGroup
- and all its descendants.
-
-
-
- This cannot return an exact number, since the status of threads
- may change after they were counted. But it should be pretty
- close.
-
-
-@end deftypemethod
-@deftypemethod ThreadGroup {public synchronized int} activeGroupCount ()
-Get the number of active groups in this ThreadGroup. This group
- itself is not included in the count.
-@end deftypemethod
-@deftypemethod ThreadGroup {public int} enumerate (java.lang.Thread[]@w{ }@var{threads})
-Copy all of the active Threads from this ThreadGroup and
- its descendants into the specified array. If the array is
- not big enough to hold all the Threads, extra Threads will
- simply not be copied.
-@end deftypemethod
-@deftypemethod ThreadGroup {public int} enumerate (java.lang.Thread[]@w{ }@var{threads}, boolean@w{ }@var{useDescendants})
-Copy all of the active Threads from this ThreadGroup and,
- if desired, from its descendants, into the specified array.
- If the array is not big enough to hold all the Threads,
- extra Threads will simply not be copied.
-@end deftypemethod
-@deftypemethod ThreadGroup {public int} enumerate (java.lang.ThreadGroup[]@w{ }@var{groups})
-Copy all active ThreadGroups that are descendants of this
- ThreadGroup into the specified array. If the array is not
- large enough to hold all active ThreadGroups, extra
- ThreadGroups simply will not be copied.
-@end deftypemethod
-@deftypemethod ThreadGroup {public int} enumerate (java.lang.ThreadGroup[]@w{ }@var{groups}, boolean@w{ }@var{recurse})
-Copy all active ThreadGroups that are children of this
- ThreadGroup into the specified array, and if desired, also
- copy all active descendants into the array. If the array
- is not large enough to hold all active ThreadGroups, extra
- ThreadGroups simply will not be copied.
-@end deftypemethod
-@deftypemethod ThreadGroup {public final synchronized void} interrupt ()
-Interrupt all Threads in this ThreadGroup and its sub-groups.
-@end deftypemethod
-@deftypemethod ThreadGroup {public final synchronized void} stop ()
-Stop all Threads in this ThreadGroup and its descendants.
-@end deftypemethod
-@deftypemethod ThreadGroup {public final synchronized void} suspend ()
-Suspend all Threads in this ThreadGroup and its descendants.
-@end deftypemethod
-@deftypemethod ThreadGroup {public final synchronized void} resume ()
-Resume all Threads in this ThreadGroup and its descendants.
-@end deftypemethod
-@deftypemethod ThreadGroup {public final synchronized void} destroy ()
-Destroy this ThreadGroup. There can be no Threads in it,
- and none of its descendants (sub-groups) may have Threads in them.
- All its descendants will be destroyed as well.
-@end deftypemethod
-@deftypemethod ThreadGroup {public void} list ()
-Print out information about this ThreadGroup to System.out.
-@end deftypemethod
-@deftypemethod ThreadGroup {public void} uncaughtException (java.lang.Thread@w{ }@var{thread}, java.lang.Throwable@w{ }@var{t})
-When a Thread in this ThreadGroup does not catch an exception,
- this method of the ThreadGroup is called.
-
-
-
- ThreadGroup's implementation does the following:<BR>
-
-@itemize @bullet
-
-
-@item
-If there is a parent ThreadGroup, call uncaughtException()
- in the parent.
-
-
-@item
-If the Throwable passed is a ThreadDeath, don't do
- anything.
-
-
-@item
-Otherwise, call @code{exception.printStackTrace().}
-
-
-@end itemize
-
-@end deftypemethod
-@deftypemethod ThreadGroup {public boolean} allowThreadSuspension (boolean@w{ }@var{allow})
-Tell the VM whether it may suspend Threads in low memory
- situations.
-@end deftypemethod
-@deftypemethod ThreadGroup {public String} toString ()
-Get a human-readable representation of this ThreadGroup.
-@end deftypemethod
-@deftypemethod ThreadGroup {public final void} checkAccess ()
-Find out if the current Thread can modify this ThreadGroup.
- Calls the current SecurityManager's checkAccess() method to
- find out. If there is none, it assumes everything's OK.
-@end deftypemethod
-@deftypemethod Throwable {public native Throwable} fillInStackTrace ()
-
-@end deftypemethod
-@deftypemethod Throwable {public String} getLocalizedMessage ()
-
-@end deftypemethod
-@deftypemethod Throwable {public String} getMessage ()
-
-@end deftypemethod
-@deftypemethod Throwable {public void} printStackTrace ()
-
-@end deftypemethod
-@deftypemethod Throwable {public void} printStackTrace (java.io.PrintStream@w{ }@var{ps})
-
-@end deftypemethod
-@deftypemethod Throwable {public void} printStackTrace (java.io.PrintWriter@w{ }@var{wr})
-
-@end deftypemethod
-@deftypemethod Throwable {public String} toString ()
-
-@end deftypemethod
diff --git a/libjava/doc/java-math.texi b/libjava/doc/java-math.texi
deleted file mode 100644
index 0b2c4e29a8b..00000000000
--- a/libjava/doc/java-math.texi
+++ /dev/null
@@ -1,206 +0,0 @@
-@deftypemethod BigDecimal {public static BigDecimal} valueOf (long@w{ }@var{val})
-
-@end deftypemethod
-@deftypemethod BigDecimal {public static BigDecimal} valueOf (long@w{ }@var{val}, int@w{ }@var{scale}) @*throws NumberFormatException
-
-@end deftypemethod
-@deftypemethod BigDecimal {public BigDecimal} add (java.math.BigDecimal@w{ }@var{val})
-
-@end deftypemethod
-@deftypemethod BigDecimal {public BigDecimal} subtract (java.math.BigDecimal@w{ }@var{val})
-
-@end deftypemethod
-@deftypemethod BigDecimal {public BigDecimal} multiply (java.math.BigDecimal@w{ }@var{val})
-
-@end deftypemethod
-@deftypemethod BigDecimal {public BigDecimal} divide (java.math.BigDecimal@w{ }@var{val}, int@w{ }@var{roundingMode}) @*throws ArithmeticException, IllegalArgumentException
-
-@end deftypemethod
-@deftypemethod BigDecimal {public BigDecimal} divide (java.math.BigDecimal@w{ }@var{val}, int@w{ }@var{newScale}, int@w{ }@var{roundingMode}) @*throws ArithmeticException, IllegalArgumentException
-
-@end deftypemethod
-@deftypemethod BigDecimal {public int} compareTo (java.math.BigDecimal@w{ }@var{val})
-
-@end deftypemethod
-@deftypemethod BigDecimal {public int} compareTo (java.lang.Object@w{ }@var{val})
-
-@end deftypemethod
-@deftypemethod BigDecimal {public boolean} equals (java.lang.Object@w{ }@var{o})
-
-@end deftypemethod
-@deftypemethod BigDecimal {public int} hashCode ()
-
-@end deftypemethod
-@deftypemethod BigDecimal {public BigDecimal} max (java.math.BigDecimal@w{ }@var{val})
-
-@end deftypemethod
-@deftypemethod BigDecimal {public BigDecimal} min (java.math.BigDecimal@w{ }@var{val})
-
-@end deftypemethod
-@deftypemethod BigDecimal {public BigDecimal} movePointLeft (int@w{ }@var{n})
-
-@end deftypemethod
-@deftypemethod BigDecimal {public BigDecimal} movePointRight (int@w{ }@var{n})
-
-@end deftypemethod
-@deftypemethod BigDecimal {public int} signum ()
-
-@end deftypemethod
-@deftypemethod BigDecimal {public int} scale ()
-
-@end deftypemethod
-@deftypemethod BigDecimal {public BigDecimal} abs ()
-
-@end deftypemethod
-@deftypemethod BigDecimal {public BigDecimal} negate ()
-
-@end deftypemethod
-@deftypemethod BigDecimal {public String} toString ()
-
-@end deftypemethod
-@deftypemethod BigDecimal {public BigInteger} toBigInteger ()
-
-@end deftypemethod
-@deftypemethod BigDecimal {public int} intValue ()
-
-@end deftypemethod
-@deftypemethod BigDecimal {public long} longValue ()
-
-@end deftypemethod
-@deftypemethod BigDecimal {public float} floatValue ()
-
-@end deftypemethod
-@deftypemethod BigDecimal {public double} doubleValue ()
-
-@end deftypemethod
-@deftypemethod BigInteger {public static BigInteger} valueOf (long@w{ }@var{val})
-
-@end deftypemethod
-@deftypemethod BigInteger {public int} signum ()
-
-@end deftypemethod
-@deftypemethod BigInteger {public int} compareTo (java.lang.Object@w{ }@var{obj})
-
-@end deftypemethod
-@deftypemethod BigInteger {public int} compareTo (java.math.BigInteger@w{ }@var{val})
-
-@end deftypemethod
-@deftypemethod BigInteger {public BigInteger} min (java.math.BigInteger@w{ }@var{val})
-
-@end deftypemethod
-@deftypemethod BigInteger {public BigInteger} max (java.math.BigInteger@w{ }@var{val})
-
-@end deftypemethod
-@deftypemethod BigInteger {public BigInteger} add (java.math.BigInteger@w{ }@var{val})
-
-@end deftypemethod
-@deftypemethod BigInteger {public BigInteger} subtract (java.math.BigInteger@w{ }@var{val})
-
-@end deftypemethod
-@deftypemethod BigInteger {public BigInteger} multiply (java.math.BigInteger@w{ }@var{y})
-
-@end deftypemethod
-@deftypemethod BigInteger {public BigInteger} divide (java.math.BigInteger@w{ }@var{val})
-
-@end deftypemethod
-@deftypemethod BigInteger {public BigInteger} remainder (java.math.BigInteger@w{ }@var{val})
-
-@end deftypemethod
-@deftypemethod BigInteger {public BigInteger} divideAndRemainder (java.math.BigInteger@w{ }@var{val})
-
-@end deftypemethod
-@deftypemethod BigInteger {public BigInteger} mod (java.math.BigInteger@w{ }@var{m})
-
-@end deftypemethod
-@deftypemethod BigInteger {public BigInteger} pow (int@w{ }@var{exponent})
-Calculate the integral power of a BigInteger.
-@end deftypemethod
-@deftypemethod BigInteger {public BigInteger} modInverse (java.math.BigInteger@w{ }@var{y})
-
-@end deftypemethod
-@deftypemethod BigInteger {public BigInteger} modPow (java.math.BigInteger@w{ }@var{exponent}, java.math.BigInteger@w{ }@var{m})
-
-@end deftypemethod
-@deftypemethod BigInteger {public BigInteger} gcd (java.math.BigInteger@w{ }@var{y})
-
-@end deftypemethod
-@deftypemethod BigInteger {public boolean} isProbablePrime (int@w{ }@var{certainty})
-
-@end deftypemethod
-@deftypemethod BigInteger {public BigInteger} shiftLeft (int@w{ }@var{n})
-
-@end deftypemethod
-@deftypemethod BigInteger {public BigInteger} shiftRight (int@w{ }@var{n})
-
-@end deftypemethod
-@deftypemethod BigInteger {public String} toString ()
-
-@end deftypemethod
-@deftypemethod BigInteger {public String} toString (int@w{ }@var{radix})
-
-@end deftypemethod
-@deftypemethod BigInteger {public int} intValue ()
-
-@end deftypemethod
-@deftypemethod BigInteger {public long} longValue ()
-
-@end deftypemethod
-@deftypemethod BigInteger {public int} hashCode ()
-
-@end deftypemethod
-@deftypemethod BigInteger {public boolean} equals (java.lang.Object@w{ }@var{obj})
-
-@end deftypemethod
-@deftypemethod BigInteger {public double} doubleValue ()
-
-@end deftypemethod
-@deftypemethod BigInteger {public float} floatValue ()
-
-@end deftypemethod
-@deftypemethod BigInteger {public BigInteger} abs ()
-
-@end deftypemethod
-@deftypemethod BigInteger {public BigInteger} negate ()
-
-@end deftypemethod
-@deftypemethod BigInteger {public int} bitLength ()
-Calculates ceiling(log2(this < 0 ? -this : this+1))
- See Common Lisp: the Language, 2nd ed, p. 361.
-@end deftypemethod
-@deftypemethod BigInteger {public byte} toByteArray ()
-
-@end deftypemethod
-@deftypemethod BigInteger {public BigInteger} and (java.math.BigInteger@w{ }@var{y})
-Return the logical (bit-wise) "and" of two BigIntegers.
-@end deftypemethod
-@deftypemethod BigInteger {public BigInteger} or (java.math.BigInteger@w{ }@var{y})
-Return the logical (bit-wise) "(inclusive) or" of two BigIntegers.
-@end deftypemethod
-@deftypemethod BigInteger {public BigInteger} xor (java.math.BigInteger@w{ }@var{y})
-Return the logical (bit-wise) "exclusive or" of two BigIntegers.
-@end deftypemethod
-@deftypemethod BigInteger {public BigInteger} not ()
-Return the logical (bit-wise) negation of a BigInteger.
-@end deftypemethod
-@deftypemethod BigInteger {public BigInteger} andNot (java.math.BigInteger@w{ }@var{val})
-
-@end deftypemethod
-@deftypemethod BigInteger {public BigInteger} clearBit (int@w{ }@var{n})
-
-@end deftypemethod
-@deftypemethod BigInteger {public BigInteger} setBit (int@w{ }@var{n})
-
-@end deftypemethod
-@deftypemethod BigInteger {public boolean} testBit (int@w{ }@var{n})
-
-@end deftypemethod
-@deftypemethod BigInteger {public BigInteger} flipBit (int@w{ }@var{n})
-
-@end deftypemethod
-@deftypemethod BigInteger {public int} getLowestSetBit ()
-
-@end deftypemethod
-@deftypemethod BigInteger {public int} bitCount ()
-Count one bits in a BigInteger.
- If argument is negative, count zero bits instead.
-@end deftypemethod
diff --git a/libjava/doc/java-net.texi b/libjava/doc/java-net.texi
deleted file mode 100644
index 0d172b9c690..00000000000
--- a/libjava/doc/java-net.texi
+++ /dev/null
@@ -1,558 +0,0 @@
-@deftypemethod ContentHandlerFactory {public ContentHandler} createContentHandler (java.lang.String@w{ }@var{mimetype})
-
-@end deftypemethod
-@deftypemethod ContentHandler {public abstract Object} getContent (java.net.URLConnection@w{ }@var{urlc}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod DatagramPacket {public synchronized InetAddress} getAddress ()
-
-@end deftypemethod
-@deftypemethod DatagramPacket {public synchronized int} getPort ()
-
-@end deftypemethod
-@deftypemethod DatagramPacket {public synchronized byte} getData ()
-
-@end deftypemethod
-@deftypemethod DatagramPacket {public synchronized int} getOffset ()
-
-@end deftypemethod
-@deftypemethod DatagramPacket {public synchronized int} getLength ()
-
-@end deftypemethod
-@deftypemethod DatagramPacket {public synchronized void} setAddress (java.net.InetAddress@w{ }@var{iaddr})
-
-@end deftypemethod
-@deftypemethod DatagramPacket {public synchronized void} setPort (int@w{ }@var{iport})
-
-@end deftypemethod
-@deftypemethod DatagramPacket {public synchronized void} setData (byte[]@w{ }@var{buf})
-
-@end deftypemethod
-@deftypemethod DatagramPacket {public synchronized void} setData (byte[]@w{ }@var{buf}, int@w{ }@var{offset}, int@w{ }@var{length})
-
-@end deftypemethod
-@deftypemethod DatagramPacket {public synchronized void} setLength (int@w{ }@var{length})
-
-@end deftypemethod
-@deftypemethod DatagramSocketImpl {protected abstract void} bind (int@w{ }@var{lport}, java.net.InetAddress@w{ }@var{laddr}) @*throws SocketException
-
-@end deftypemethod
-@deftypemethod DatagramSocketImpl {protected abstract void} close ()
-
-@end deftypemethod
-@deftypemethod DatagramSocketImpl {protected abstract void} create () @*throws SocketException
-
-@end deftypemethod
-@deftypemethod DatagramSocketImpl {protected abstract int} peek (java.net.InetAddress@w{ }@var{i}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod DatagramSocketImpl {protected abstract void} send (java.net.DatagramPacket@w{ }@var{p}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod DatagramSocketImpl {protected abstract void} receive (java.net.DatagramPacket@w{ }@var{p}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod DatagramSocketImpl {protected abstract void} setTTL (byte@w{ }@var{ttl}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod DatagramSocketImpl {protected abstract byte} getTTL () @*throws IOException
-
-@end deftypemethod
-@deftypemethod DatagramSocketImpl {protected abstract void} setTimeToLive (int@w{ }@var{ttl}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod DatagramSocketImpl {protected abstract int} getTimeToLive () @*throws IOException
-
-@end deftypemethod
-@deftypemethod DatagramSocketImpl {protected abstract void} join (java.net.InetAddress@w{ }@var{inetaddr}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod DatagramSocketImpl {protected abstract void} leave (java.net.InetAddress@w{ }@var{inetaddr}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod DatagramSocketImpl {public abstract Object} getOption (int@w{ }@var{optID}) @*throws SocketException
-
-@end deftypemethod
-@deftypemethod DatagramSocketImpl {public abstract void} setOption (int@w{ }@var{optID}, java.lang.Object@w{ }@var{value}) @*throws SocketException
-
-@end deftypemethod
-@deftypemethod DatagramSocketImpl {protected FileDescriptor} getFileDescriptor ()
-
-@end deftypemethod
-@deftypemethod DatagramSocketImpl {protected int} getLocalPort ()
-
-@end deftypemethod
-@deftypemethod DatagramSocket {public void} close ()
-
-@end deftypemethod
-@deftypemethod DatagramSocket {public InetAddress} getLocalAddress ()
-
-@end deftypemethod
-@deftypemethod DatagramSocket {public int} getLocalPort ()
-
-@end deftypemethod
-@deftypemethod DatagramSocket {public synchronized int} getSoTimeout () @*throws SocketException
-
-@end deftypemethod
-@deftypemethod DatagramSocket {public synchronized void} receive (java.net.DatagramPacket@w{ }@var{p}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod DatagramSocket {public void} send (java.net.DatagramPacket@w{ }@var{p}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod DatagramSocket {public synchronized void} setSoTimeout (int@w{ }@var{timeout}) @*throws SocketException
-
-@end deftypemethod
-@deftypemethod FileNameMap {public String} getContentTypeFor (java.lang.String@w{ }@var{fileName})
-
-@end deftypemethod
-@deftypemethod HttpURLConnection {public abstract void} disconnect ()
-
-@end deftypemethod
-@deftypemethod HttpURLConnection {public abstract boolean} usingProxy ()
-
-@end deftypemethod
-@deftypemethod HttpURLConnection {public static void} setFollowRedirects (boolean@w{ }@var{set})
-
-@end deftypemethod
-@deftypemethod HttpURLConnection {public static boolean} getFollowRedirects ()
-
-@end deftypemethod
-@deftypemethod HttpURLConnection {public void} setRequestMethod (java.lang.String@w{ }@var{method}) @*throws ProtocolException
-
-@end deftypemethod
-@deftypemethod HttpURLConnection {public String} getRequestMethod ()
-
-@end deftypemethod
-@deftypemethod HttpURLConnection {public int} getResponseCode () @*throws IOException
-
-@end deftypemethod
-@deftypemethod HttpURLConnection {public String} getResponseMessage () @*throws IOException
-
-@end deftypemethod
-@deftypemethod InetAddress {public boolean} isMulticastAddress ()
-
-@end deftypemethod
-@deftypemethod InetAddress {public String} getHostName ()
-
-@end deftypemethod
-@deftypemethod InetAddress {public byte} getAddress ()
-
-@end deftypemethod
-@deftypemethod InetAddress {public String} getHostAddress ()
-
-@end deftypemethod
-@deftypemethod InetAddress {public int} hashCode ()
-
-@end deftypemethod
-@deftypemethod InetAddress {public boolean} equals (java.lang.Object@w{ }@var{obj})
-
-@end deftypemethod
-@deftypemethod InetAddress {public String} toString ()
-
-@end deftypemethod
-@deftypemethod InetAddress {public static InetAddress} getByName (java.lang.String@w{ }@var{host}) @*throws UnknownHostException
-
-@end deftypemethod
-@deftypemethod InetAddress {public static InetAddress} getAllByName (java.lang.String@w{ }@var{host}) @*throws UnknownHostException
-
-@end deftypemethod
-@deftypemethod InetAddress {public static InetAddress} getLocalHost () @*throws UnknownHostException
-
-@end deftypemethod
-@deftypemethod JarURLConnection {public URL} getJarFileURL ()
-
-@end deftypemethod
-@deftypemethod JarURLConnection {public String} getEntryName ()
-
-@end deftypemethod
-@deftypemethod JarURLConnection {public synchronized void} connect () @*throws IOException
-
-@end deftypemethod
-@deftypemethod JarURLConnection {public InputStream} getInputStream () @*throws IOException
-
-@end deftypemethod
-@deftypemethod JarURLConnection {public JarEntry} getJarEntry () @*throws IOException
-
-@end deftypemethod
-@deftypemethod JarURLConnection {public abstract JarFile} getJarFile () @*throws IOException
-
-@end deftypemethod
-@deftypemethod JarURLConnection {public String} getHeaderField (java.lang.String@w{ }@var{name})
-
-@end deftypemethod
-@deftypemethod JarURLConnection {public String} getHeaderField (int@w{ }@var{n})
-
-@end deftypemethod
-@deftypemethod JarURLConnection {public String} getHeaderFieldKey (int@w{ }@var{n})
-
-@end deftypemethod
-@deftypemethod MulticastSocket {public InetAddress} getInterface () @*throws SocketException
-
-@end deftypemethod
-@deftypemethod MulticastSocket {public byte} getTTL () @*throws IOException
-
-@end deftypemethod
-@deftypemethod MulticastSocket {public int} getTimeToLive () @*throws IOException
-
-@end deftypemethod
-@deftypemethod MulticastSocket {public void} setInterface (java.net.InetAddress@w{ }@var{inf}) @*throws SocketException
-
-@end deftypemethod
-@deftypemethod MulticastSocket {public void} setTTL (byte@w{ }@var{ttl}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod MulticastSocket {public void} setTimeToLive (int@w{ }@var{ttl}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod MulticastSocket {public void} joinGroup (java.net.InetAddress@w{ }@var{mcastaddr}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod MulticastSocket {public void} leaveGroup (java.net.InetAddress@w{ }@var{mcastaddr}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod MulticastSocket {public synchronized void} send (java.net.DatagramPacket@w{ }@var{p}, byte@w{ }@var{ttl}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod ServerSocket {public InetAddress} getInetAddress ()
-
-@end deftypemethod
-@deftypemethod ServerSocket {public int} getLocalPort ()
-
-@end deftypemethod
-@deftypemethod ServerSocket {public Socket} accept () @*throws IOException
-
-@end deftypemethod
-@deftypemethod ServerSocket {protected final void} implAccept (java.net.Socket@w{ }@var{s}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod ServerSocket {public void} close () @*throws IOException
-
-@end deftypemethod
-@deftypemethod ServerSocket {public synchronized void} setSoTimeout (int@w{ }@var{timeout}) @*throws SocketException
-
-@end deftypemethod
-@deftypemethod ServerSocket {public synchronized int} getSoTimeout () @*throws SocketException
-
-@end deftypemethod
-@deftypemethod ServerSocket {public String} toString ()
-
-@end deftypemethod
-@deftypemethod ServerSocket {public static synchronized void} setSocketFactory (java.net.SocketImplFactory@w{ }@var{fac}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod SocketImplFactory {public SocketImpl} createSocketImpl ()
-
-@end deftypemethod
-@deftypemethod SocketImpl {protected abstract void} create (boolean@w{ }@var{stream}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod SocketImpl {protected abstract void} connect (java.lang.String@w{ }@var{host}, int@w{ }@var{port}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod SocketImpl {protected abstract void} connect (java.net.InetAddress@w{ }@var{host}, int@w{ }@var{port}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod SocketImpl {protected abstract void} bind (java.net.InetAddress@w{ }@var{host}, int@w{ }@var{port}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod SocketImpl {protected abstract void} listen (int@w{ }@var{backlog}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod SocketImpl {protected abstract void} accept (java.net.SocketImpl@w{ }@var{s}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod SocketImpl {protected abstract InputStream} getInputStream () @*throws IOException
-
-@end deftypemethod
-@deftypemethod SocketImpl {protected abstract OutputStream} getOutputStream () @*throws IOException
-
-@end deftypemethod
-@deftypemethod SocketImpl {protected abstract int} available () @*throws IOException
-
-@end deftypemethod
-@deftypemethod SocketImpl {protected abstract void} close () @*throws IOException
-
-@end deftypemethod
-@deftypemethod SocketImpl {protected FileDescriptor} getFileDescriptor ()
-
-@end deftypemethod
-@deftypemethod SocketImpl {protected InetAddress} getInetAddress ()
-
-@end deftypemethod
-@deftypemethod SocketImpl {protected int} getPort ()
-
-@end deftypemethod
-@deftypemethod SocketImpl {protected int} getLocalPort ()
-
-@end deftypemethod
-@deftypemethod SocketImpl {public abstract Object} getOption (int@w{ }@var{optID}) @*throws SocketException
-
-@end deftypemethod
-@deftypemethod SocketImpl {public abstract void} setOption (int@w{ }@var{optID}, java.lang.Object@w{ }@var{value}) @*throws SocketException
-
-@end deftypemethod
-@deftypemethod SocketImpl {public String} toString ()
-
-@end deftypemethod
-@deftypemethod Socket {public InetAddress} getInetAddress ()
-
-@end deftypemethod
-@deftypemethod Socket {public InetAddress} getLocalAddress ()
-
-@end deftypemethod
-@deftypemethod Socket {public int} getPort ()
-
-@end deftypemethod
-@deftypemethod Socket {public int} getLocalPort ()
-
-@end deftypemethod
-@deftypemethod Socket {public InputStream} getInputStream () @*throws IOException
-
-@end deftypemethod
-@deftypemethod Socket {public OutputStream} getOutputStream () @*throws IOException
-
-@end deftypemethod
-@deftypemethod Socket {public void} setTcpNoDelay (boolean@w{ }@var{on}) @*throws SocketException
-
-@end deftypemethod
-@deftypemethod Socket {public boolean} getTcpNoDelay () @*throws SocketException
-
-@end deftypemethod
-@deftypemethod Socket {public void} setSoLinger (boolean@w{ }@var{on}, int@w{ }@var{linger}) @*throws SocketException
-
-@end deftypemethod
-@deftypemethod Socket {public int} getSoLinger () @*throws SocketException
-
-@end deftypemethod
-@deftypemethod Socket {public synchronized void} setSoTimeout (int@w{ }@var{timeout}) @*throws SocketException
-
-@end deftypemethod
-@deftypemethod Socket {public synchronized int} getSoTimeout () @*throws SocketException
-
-@end deftypemethod
-@deftypemethod Socket {public void} setSendBufferSize (int@w{ }@var{size}) @*throws SocketException
-
-@end deftypemethod
-@deftypemethod Socket {public int} getSendBufferSize () @*throws SocketException
-
-@end deftypemethod
-@deftypemethod Socket {public void} setReceiveBufferSize (int@w{ }@var{size}) @*throws SocketException
-
-@end deftypemethod
-@deftypemethod Socket {public int} getReceiveBufferSize () @*throws SocketException
-
-@end deftypemethod
-@deftypemethod Socket {public synchronized void} close () @*throws IOException
-
-@end deftypemethod
-@deftypemethod Socket {public String} toString ()
-
-@end deftypemethod
-@deftypemethod Socket {public static synchronized void} setSocketImplFactory (java.net.SocketImplFactory@w{ }@var{fac}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod SocketOptions {public void} setOption (int@w{ }@var{optID}, java.lang.Object@w{ }@var{value}) @*throws SocketException
-
-@end deftypemethod
-@deftypemethod SocketOptions {public Object} getOption (int@w{ }@var{optID}) @*throws SocketException
-
-@end deftypemethod
-@deftypemethod URLClassLoader {protected void} addURL (java.net.URL@w{ }@var{url})
-
-@end deftypemethod
-@deftypemethod URLClassLoader {public URL} getURLs ()
-
-@end deftypemethod
-@deftypemethod URLClassLoader {public Enumeration} findResources (java.lang.String@w{ }@var{name})
-
-@end deftypemethod
-@deftypemethod URLClassLoader {public URL} findResource (java.lang.String@w{ }@var{name})
-
-@end deftypemethod
-@deftypemethod URLClassLoader {protected Class} findClass (java.lang.String@w{ }@var{name}) @*throws ClassNotFoundException
-
-@end deftypemethod
-@deftypemethod URLConnection {public abstract void} connect () @*throws IOException
-
-@end deftypemethod
-@deftypemethod URLConnection {public URL} getURL ()
-
-@end deftypemethod
-@deftypemethod URLConnection {public int} getContentLength ()
-
-@end deftypemethod
-@deftypemethod URLConnection {public String} getContentType ()
-
-@end deftypemethod
-@deftypemethod URLConnection {public String} getContentEncoding ()
-
-@end deftypemethod
-@deftypemethod URLConnection {public long} getExpiration ()
-
-@end deftypemethod
-@deftypemethod URLConnection {public long} getDate ()
-
-@end deftypemethod
-@deftypemethod URLConnection {public long} getLastModified ()
-
-@end deftypemethod
-@deftypemethod URLConnection {public String} getHeaderField (int@w{ }@var{n})
-
-@end deftypemethod
-@deftypemethod URLConnection {public String} getHeaderField (java.lang.String@w{ }@var{name})
-
-@end deftypemethod
-@deftypemethod URLConnection {public int} getHeaderFieldInt (java.lang.String@w{ }@var{name}, int@w{ }@var{val})
-
-@end deftypemethod
-@deftypemethod URLConnection {public long} getHeaderFieldDate (java.lang.String@w{ }@var{name}, long@w{ }@var{val})
-
-@end deftypemethod
-@deftypemethod URLConnection {public String} getHeaderFieldKey (int@w{ }@var{n})
-
-@end deftypemethod
-@deftypemethod URLConnection {public Object} getContent () @*throws IOException
-
-@end deftypemethod
-@deftypemethod URLConnection {public InputStream} getInputStream () @*throws IOException
-
-@end deftypemethod
-@deftypemethod URLConnection {public OutputStream} getOutputStream () @*throws IOException
-
-@end deftypemethod
-@deftypemethod URLConnection {public String} toString ()
-
-@end deftypemethod
-@deftypemethod URLConnection {public void} setDoInput (boolean@w{ }@var{doinput})
-
-@end deftypemethod
-@deftypemethod URLConnection {public boolean} getDoInput ()
-
-@end deftypemethod
-@deftypemethod URLConnection {public void} setDoOutput (boolean@w{ }@var{dooutput})
-
-@end deftypemethod
-@deftypemethod URLConnection {public boolean} getDoOutput ()
-
-@end deftypemethod
-@deftypemethod URLConnection {public void} setAllowUserInteraction (boolean@w{ }@var{allowuserinteraction})
-
-@end deftypemethod
-@deftypemethod URLConnection {public boolean} getAllowUserInteraction ()
-
-@end deftypemethod
-@deftypemethod URLConnection {public static void} setDefaultAllowUserInteraction (boolean@w{ }@var{defaultallowuserinteraction})
-
-@end deftypemethod
-@deftypemethod URLConnection {public static boolean} getDefaultAllowUserInteraction ()
-
-@end deftypemethod
-@deftypemethod URLConnection {public void} setUseCaches (boolean@w{ }@var{usecaches})
-
-@end deftypemethod
-@deftypemethod URLConnection {public boolean} getUseCaches ()
-
-@end deftypemethod
-@deftypemethod URLConnection {public void} setIfModifiedSince (long@w{ }@var{ifmodifiedsince})
-
-@end deftypemethod
-@deftypemethod URLConnection {public long} getIfModifiedSince ()
-
-@end deftypemethod
-@deftypemethod URLConnection {public boolean} getDefaultUseCaches ()
-
-@end deftypemethod
-@deftypemethod URLConnection {public void} setDefaultUseCaches (boolean@w{ }@var{defaultusecaches})
-
-@end deftypemethod
-@deftypemethod URLConnection {public void} setRequestProperty (java.lang.String@w{ }@var{key}, java.lang.String@w{ }@var{value})
-
-@end deftypemethod
-@deftypemethod URLConnection {public String} getRequestProperty (java.lang.String@w{ }@var{key})
-
-@end deftypemethod
-@deftypemethod URLConnection {public static void} setDefaultRequestProperty (java.lang.String@w{ }@var{key}, java.lang.String@w{ }@var{value})
-
-@end deftypemethod
-@deftypemethod URLConnection {public static String} getDefaultRequestProperty (java.lang.String@w{ }@var{key})
-
-@end deftypemethod
-@deftypemethod URLConnection {public static void} setContentHandlerFactory (java.net.ContentHandlerFactory@w{ }@var{fac})
-
-@end deftypemethod
-@deftypemethod URLConnection {protected static String} guessContentTypeFromName (java.lang.String@w{ }@var{fname})
-
-@end deftypemethod
-@deftypemethod URLConnection {public static FileNameMap} getFileNameMap ()
-
-@end deftypemethod
-@deftypemethod URLConnection {public static void} setFileNameMap (java.net.FileNameMap@w{ }@var{map})
-
-@end deftypemethod
-@deftypemethod URLDecoder {public static String} decode (java.lang.String@w{ }@var{s}) @*throws Exception
-
-@end deftypemethod
-@deftypemethod URLEncoder {public static String} encode (java.lang.String@w{ }@var{s})
-
-@end deftypemethod
-@deftypemethod URL {public boolean} equals (java.lang.Object@w{ }@var{obj})
-
-@end deftypemethod
-@deftypemethod URL {public final Object} getContent () @*throws IOException
-
-@end deftypemethod
-@deftypemethod URL {public String} getFile ()
-
-@end deftypemethod
-@deftypemethod URL {public String} getHost ()
-
-@end deftypemethod
-@deftypemethod URL {public int} getPort ()
-
-@end deftypemethod
-@deftypemethod URL {public String} getProtocol ()
-
-@end deftypemethod
-@deftypemethod URL {public String} getRef ()
-
-@end deftypemethod
-@deftypemethod URL {public int} hashCode ()
-
-@end deftypemethod
-@deftypemethod URL {public URLConnection} openConnection () @*throws IOException
-
-@end deftypemethod
-@deftypemethod URL {public final InputStream} openStream () @*throws IOException
-
-@end deftypemethod
-@deftypemethod URL {public boolean} sameFile (java.net.URL@w{ }@var{other})
-
-@end deftypemethod
-@deftypemethod URL {protected void} set (java.lang.String@w{ }@var{protocol}, java.lang.String@w{ }@var{host}, int@w{ }@var{port}, java.lang.String@w{ }@var{file}, java.lang.String@w{ }@var{ref})
-
-@end deftypemethod
-@deftypemethod URL {public static synchronized void} setURLStreamHandlerFactory (java.net.URLStreamHandlerFactory@w{ }@var{fac})
-
-@end deftypemethod
-@deftypemethod URL {public String} toExternalForm ()
-
-@end deftypemethod
-@deftypemethod URL {public String} toString ()
-
-@end deftypemethod
-@deftypemethod URLStreamHandlerFactory {public URLStreamHandler} createURLStreamHandler (java.lang.String@w{ }@var{protocol})
-
-@end deftypemethod
-@deftypemethod URLStreamHandler {protected abstract URLConnection} openConnection (java.net.URL@w{ }@var{u}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod URLStreamHandler {protected void} parseURL (java.net.URL@w{ }@var{u}, java.lang.String@w{ }@var{spec}, int@w{ }@var{start}, int@w{ }@var{limit})
-
-@end deftypemethod
-@deftypemethod URLStreamHandler {protected void} setURL (java.net.URL@w{ }@var{u}, java.lang.String@w{ }@var{protocol}, java.lang.String@w{ }@var{host}, int@w{ }@var{port}, java.lang.String@w{ }@var{file}, java.lang.String@w{ }@var{ref})
-
-@end deftypemethod
-@deftypemethod URLStreamHandler {protected String} toExternalForm (java.net.URL@w{ }@var{u})
-
-@end deftypemethod
diff --git a/libjava/doc/java-security-spec.texi b/libjava/doc/java-security-spec.texi
deleted file mode 100644
index e69de29bb2d..00000000000
--- a/libjava/doc/java-security-spec.texi
+++ /dev/null
diff --git a/libjava/doc/java-security.texi b/libjava/doc/java-security.texi
deleted file mode 100644
index c1a5da87fe1..00000000000
--- a/libjava/doc/java-security.texi
+++ /dev/null
@@ -1,354 +0,0 @@
-@deftypemethod BasicPermission {public boolean} implies (java.security.Permission@w{ }@var{perm})
-This method tests to see if the specified permission is implied by
- this permission. This will be true if the following conditions are met:
-
-
-
-
-@itemize @bullet
-
-
-@item
-The specified object is an instance of @code{BasicPermission},
- or a subclass.
-
-@item
-The name of the specified permission is identical to this permission's
- name or the name of the specified permission satisfies a wildcard match
- on this permission.
-
-@end itemize
-
-@end deftypemethod
-@deftypemethod BasicPermission {public boolean} equals (java.lang.Object@w{ }@var{obj})
-This method tests to see if this object is equal to the specified
- @code{Object}. This will be true if and only if the specified
- object meets the following conditions:
-
-
-
-
-@itemize @bullet
-
-
-@item
-It is an instance of @code{BasicPermission}, or a subclass.
-
-@item
-It has the same name as this permission.
-
-@end itemize
-
-@end deftypemethod
-@deftypemethod BasicPermission {public int} hashCode ()
-This method returns a hash code for this permission object. The hash
- code returned is the value returned by calling the @code{hashCode}
- method on the @code{String} that is the name of this permission.
-@end deftypemethod
-@deftypemethod BasicPermission {public String} getActions ()
-This method returns a list of the actions associated with this
- permission. This method always returns the empty string ("") since
- this class ignores actions.
-@end deftypemethod
-@deftypemethod BasicPermission {public PermissionCollection} newPermissionCollection ()
-This method returns an instance of @code{PermissionCollection}
- suitable for storing @code{BasicPermission} objects. This returns
- be a sub class of @code{PermissionCollection}
- that allows for an efficient and consistent implementation of
- the @code{implies} method. The collection doesn't handle subclasses
- of BasicPermission correctly; they must override this method.
-@end deftypemethod
-@deftypemethod DigestOutputStream {public MessageDigest} getMessageDigest ()
-Returns the MessageDigest associated with this DigestOutputStream
-@end deftypemethod
-@deftypemethod DigestOutputStream {public void} setMessageDigest (java.security.MessageDigest@w{ }@var{digest})
-Sets the current MessageDigest to current parameter
-@end deftypemethod
-@deftypemethod DigestOutputStream {public void} write (int@w{ }@var{b}) @*throws IOException
-Updates the hash if the on flag is true and then writes a byte to
-the underlying output stream.
-@end deftypemethod
-@deftypemethod DigestOutputStream {public void} write (byte[]@w{ }@var{b}, int@w{ }@var{off}, int@w{ }@var{len}) @*throws IOException
-Updates the hash if the on flag is true and then writes the bytes
-to the underlying output stream.
-@end deftypemethod
-@deftypemethod DigestOutputStream {public void} on (boolean@w{ }@var{on})
-Sets the flag specifying if this DigestOutputStream updates the
-digest in the write() methods. The default is on;
-@end deftypemethod
-@deftypemethod DigestOutputStream {public String} toString ()
-Converts the output stream and underlying message digest to a string.
-@end deftypemethod
-@deftypemethod Guard {public void} checkGuard (java.lang.Object@w{ }@var{obj}) @*throws SecurityException
-This method tests whether or not access is allowed to the specified
- guarded object. Access is allowed if this method returns silently. If
- access is denied, an exception is generated.
-@end deftypemethod
-@deftypemethod Key {public String} getAlgorithm ()
-
-@end deftypemethod
-@deftypemethod Key {public String} getFormat ()
-
-@end deftypemethod
-@deftypemethod Key {public byte} getEncoded ()
-
-@end deftypemethod
-@deftypemethod KeyPairGenerator {public static KeyPairGenerator} getInstance (java.lang.String@w{ }@var{algorithm}) @*throws NoSuchAlgorithmException
-
-@end deftypemethod
-@deftypemethod KeyPairGenerator {public static KeyPairGenerator} getInstance (java.lang.String@w{ }@var{algorithm}, java.lang.String@w{ }@var{provider}) @*throws NoSuchAlgorithmException, NoSuchProviderException
-
-@end deftypemethod
-@deftypemethod KeyPairGenerator {public String} getAlgorithm ()
-
-@end deftypemethod
-@deftypemethod KeyPairGenerator {public abstract void} initialize (int@w{ }@var{strength}, java.security.SecureRandom@w{ }@var{random})
-
-@end deftypemethod
-@deftypemethod KeyPairGenerator {public abstract KeyPair} generateKeyPair ()
-
-@end deftypemethod
-@deftypemethod KeyPairGeneratorSpi {public abstract void} initialize (int@w{ }@var{keysize}, java.security.SecureRandom@w{ }@var{random})
-
-@end deftypemethod
-@deftypemethod KeyPairGeneratorSpi {public abstract KeyPair} generateKeyPair ()
-
-@end deftypemethod
-@deftypemethod KeyPair {public PublicKey} getPublic ()
-
-@end deftypemethod
-@deftypemethod KeyPair {public PrivateKey} getPrivate ()
-
-@end deftypemethod
-@deftypemethod MessageDigest {public static MessageDigest} getInstance (java.lang.String@w{ }@var{algorithm}) @*throws NoSuchAlgorithmException
-
-@end deftypemethod
-@deftypemethod MessageDigest {public static MessageDigest} getInstance (java.lang.String@w{ }@var{algorithm}, java.lang.String@w{ }@var{provider}) @*throws NoSuchAlgorithmException, NoSuchProviderException
-
-@end deftypemethod
-@deftypemethod MessageDigest {public void} update (byte@w{ }@var{input})
-
-@end deftypemethod
-@deftypemethod MessageDigest {public void} update (byte[]@w{ }@var{input}, int@w{ }@var{offset}, int@w{ }@var{len})
-
-@end deftypemethod
-@deftypemethod MessageDigest {public void} update (byte[]@w{ }@var{input})
-
-@end deftypemethod
-@deftypemethod MessageDigest {public byte} digest ()
-
-@end deftypemethod
-@deftypemethod MessageDigest {public byte} digest (byte[]@w{ }@var{input})
-
-@end deftypemethod
-@deftypemethod MessageDigest {public String} toString ()
-
-@end deftypemethod
-@deftypemethod MessageDigest {public static boolean} isEqual (byte[]@w{ }@var{digesta}, byte[]@w{ }@var{digestb})
-
-@end deftypemethod
-@deftypemethod MessageDigest {public void} reset ()
-
-@end deftypemethod
-@deftypemethod MessageDigest {public final String} getAlgorithm ()
-
-@end deftypemethod
-@deftypemethod MessageDigest {protected abstract void} engineUpdate (byte@w{ }@var{input})
-
-@end deftypemethod
-@deftypemethod MessageDigest {protected abstract void} engineUpdate (byte[]@w{ }@var{input}, int@w{ }@var{offset}, int@w{ }@var{len})
-
-@end deftypemethod
-@deftypemethod MessageDigest {protected abstract byte} engineDigest ()
-
-@end deftypemethod
-@deftypemethod MessageDigest {protected abstract void} engineReset ()
-
-@end deftypemethod
-@deftypemethod MessageDigest {public Object} clone () @*throws CloneNotSupportedException
-
-@end deftypemethod
-@deftypemethod PermissionCollection {public boolean} isReadOnly ()
-This method tests whether or not this @code{PermissionCollection}
- object is read only.
-@end deftypemethod
-@deftypemethod PermissionCollection {public void} setReadOnly ()
-This method sets this @code{PermissionCollection} object to be
- read only. No further permissions can be added to it after calling this
- method.
-@end deftypemethod
-@deftypemethod PermissionCollection {public abstract void} add (java.security.Permission@w{ }@var{perm}) @*throws SecurityException, IllegalArgumentException
-This method adds a new @code{Permission} object to the collection.
-@end deftypemethod
-@deftypemethod PermissionCollection {public abstract Enumeration} elements ()
-This method returns an @code{Enumeration} of all the objects in
- this collection.
-@end deftypemethod
-@deftypemethod PermissionCollection {public abstract boolean} implies (java.security.Permission@w{ }@var{perm})
-This method tests whether the specified @code{Permission} object is
- implied by this collection of @code{Permission} objects.
-@end deftypemethod
-@deftypemethod PermissionCollection {public String} toString ()
-This method returns a @code{String} representation of this
- collection. It will print the class name and has code in the same
- manner as @code{Object.toString()} then print a listing of all
- the @code{Permission} objects contained.
-@end deftypemethod
-@deftypemethod Permission {public String} getName ()
-This method returns the name of this @code{Permission}
-@end deftypemethod
-@deftypemethod Permission {public abstract String} getActions ()
-This method returns the list of actions for this @code{Permission}
- as a @code{String}.
-@end deftypemethod
-@deftypemethod Permission {public void} checkGuard (java.lang.Object@w{ }@var{obj}) @*throws SecurityException
-This method implements the @code{Guard} interface for this class.
- It calls the @code{checkPermission} method in
- @code{SecurityManager} with this @code{Permission} as its
- argument. This method returns silently if the security check succeeds
- or throws an exception if it fails.
-@end deftypemethod
-@deftypemethod Permission {public abstract boolean} implies (java.security.Permission@w{ }@var{perm})
-This method tests whether this @code{Permission} implies that the
- specified @code{Permission} is also granted.
-@end deftypemethod
-@deftypemethod Permission {public abstract int} hashCode ()
-This method returns a hash code for this @code{Permission}.
-@end deftypemethod
-@deftypemethod Permission {public String} toString ()
-This method returns a @code{String} representation of this
- @code{Permission} object.
-@end deftypemethod
-@deftypemethod Permission {public PermissionCollection} newPermissionCollection ()
-This method returns an empty @code{PermissionCollection} object
- that can store permissions of this type, or @code{null} if no
- such collection is defined.
-@end deftypemethod
-@deftypemethod Principal {public String} getName ()
-This method returns a @code{String} that names this
- @code{Principal}.
-@end deftypemethod
-@deftypemethod Principal {public boolean} equals (java.lang.Object@w{ }@var{obj})
-This method tests another @code{Principal} object for equality
- with this one.
-@end deftypemethod
-@deftypemethod Principal {public int} hashCode ()
-This method returns a hash code value for this @code{Principal}.
-@end deftypemethod
-@deftypemethod Principal {public String} toString ()
-This method returns a @code{String} representation of this
- @code{Principal}.
-@end deftypemethod
-@deftypemethod Provider {public String} getName ()
-This method returns the name assigned to this @code{Provider}.
-@end deftypemethod
-@deftypemethod Provider {public double} getVersion ()
-This method retunrs the version number of this @code{Provider}.
-@end deftypemethod
-@deftypemethod Provider {public String} getInfo ()
-This method returns a textual description of the @code{Provider}.
-@end deftypemethod
-@deftypemethod Provider {public Object} put (java.lang.Object@w{ }@var{key}, java.lang.Object@w{ }@var{value})
-This method sets the specified key to have the specified value.
-@end deftypemethod
-@deftypemethod Provider {public Object} remove (java.lang.Object@w{ }@var{key})
-This method removes the specified key entry (and its associated value)
- from the property mapping list.
-@end deftypemethod
-@deftypemethod Provider {public void} clear ()
-This method clears the entire property list such that it no longer
- contains the properties used to look up the services provided by
- the @code{Provider}.
-@end deftypemethod
-@deftypemethod Provider {public String} toString ()
-This method returns a @code{String} representation of this
- object. This will include the @code{Provider} name and
- version number.
-@end deftypemethod
-@deftypemethod Security {public static int} insertProviderAt (java.security.Provider@w{ }@var{provider}, int@w{ }@var{position})
-
-@end deftypemethod
-@deftypemethod Security {public static int} addProvider (java.security.Provider@w{ }@var{provider})
-
-@end deftypemethod
-@deftypemethod Security {public static void} removeProvider (java.lang.String@w{ }@var{name})
-
-@end deftypemethod
-@deftypemethod Security {public static Provider} getProviders ()
-
-@end deftypemethod
-@deftypemethod Security {public static Provider} getProvider (java.lang.String@w{ }@var{name})
-
-@end deftypemethod
-@deftypemethod Security {public static String} getProperty (java.lang.String@w{ }@var{key})
-
-@end deftypemethod
-@deftypemethod Security {public static void} setProperty (java.lang.String@w{ }@var{key}, java.lang.String@w{ }@var{value})
-
-@end deftypemethod
-@deftypemethod Signature {public static Signature} getInstance (java.lang.String@w{ }@var{algorithm}) @*throws NoSuchAlgorithmException
-
-@end deftypemethod
-@deftypemethod Signature {public static Signature} getInstance (java.lang.String@w{ }@var{algorithm}, java.lang.String@w{ }@var{provider}) @*throws NoSuchAlgorithmException, NoSuchProviderException
-
-@end deftypemethod
-@deftypemethod Signature {public final void} initVerify (java.security.PublicKey@w{ }@var{publicKey}) @*throws InvalidKeyException
-
-@end deftypemethod
-@deftypemethod Signature {public final void} initSign (java.security.PrivateKey@w{ }@var{privateKey}) @*throws InvalidKeyException
-
-@end deftypemethod
-@deftypemethod Signature {public final byte} sign () @*throws SignatureException
-
-@end deftypemethod
-@deftypemethod Signature {public final boolean} verify (byte[]@w{ }@var{signature}) @*throws SignatureException
-
-@end deftypemethod
-@deftypemethod Signature {public final void} update (byte@w{ }@var{b}) @*throws SignatureException
-
-@end deftypemethod
-@deftypemethod Signature {public final void} update (byte[]@w{ }@var{data}) @*throws SignatureException
-
-@end deftypemethod
-@deftypemethod Signature {public final void} update (byte[]@w{ }@var{data}, int@w{ }@var{off}, int@w{ }@var{len}) @*throws SignatureException
-
-@end deftypemethod
-@deftypemethod Signature {public final String} getAlgorithm ()
-
-@end deftypemethod
-@deftypemethod Signature {public String} toString ()
-
-@end deftypemethod
-@deftypemethod Signature {public final void} setParameter (java.lang.String@w{ }@var{param}, java.lang.Object@w{ }@var{value}) @*throws InvalidParameterException
-
-@end deftypemethod
-@deftypemethod Signature {public final Object} getParameter (java.lang.String@w{ }@var{param}) @*throws InvalidParameterException
-
-@end deftypemethod
-@deftypemethod Signature {protected abstract void} engineInitVerify (java.security.PublicKey@w{ }@var{publicKey}) @*throws InvalidKeyException
-
-@end deftypemethod
-@deftypemethod Signature {protected abstract void} engineInitSign (java.security.PrivateKey@w{ }@var{privateKey}) @*throws InvalidKeyException
-
-@end deftypemethod
-@deftypemethod Signature {protected abstract void} engineUpdate (byte@w{ }@var{b}) @*throws SignatureException
-
-@end deftypemethod
-@deftypemethod Signature {protected abstract void} engineUpdate (byte[]@w{ }@var{b}, int@w{ }@var{off}, int@w{ }@var{len}) @*throws SignatureException
-
-@end deftypemethod
-@deftypemethod Signature {protected abstract byte} engineSign () @*throws SignatureException
-
-@end deftypemethod
-@deftypemethod Signature {protected abstract boolean} engineVerify (byte[]@w{ }@var{sigBytes}) @*throws SignatureException
-
-@end deftypemethod
-@deftypemethod Signature {protected abstract void} engineSetParameter (java.lang.String@w{ }@var{param}, java.lang.Object@w{ }@var{value}) @*throws InvalidParameterException
-
-@end deftypemethod
-@deftypemethod Signature {protected abstract Object} engineGetParameter (java.lang.String@w{ }@var{param}) @*throws InvalidParameterException
-
-@end deftypemethod
-@deftypemethod Signature {public Object} clone () @*throws CloneNotSupportedException
-
-@end deftypemethod
diff --git a/libjava/doc/java-sql.texi b/libjava/doc/java-sql.texi
deleted file mode 100644
index b522ff7127c..00000000000
--- a/libjava/doc/java-sql.texi
+++ /dev/null
@@ -1,2892 +0,0 @@
-@deftypemethod Array {public String} getBaseTypeName () @*throws SQLException
-This method returns the name of the SQL type of the elements in this
- array. This name is database specific.
-@end deftypemethod
-@deftypemethod Array {public int} getBaseType () @*throws SQLException
-This method returns the JDBC type identifier of the elements in this
- array. This will be one of the values defined in the @code{Types}
- class.
-@end deftypemethod
-@deftypemethod Array {public Object} getArray () @*throws SQLException
-This method returns the contents of this array. This object returned
- will be an array of Java objects of the appropriate types.
-@end deftypemethod
-@deftypemethod Array {public Object} getArray (java.util.Map@w{ }@var{map}) @*throws SQLException
-This method returns the contents of this array. The specified
- @code{Map} will be used to override selected mappings between
- SQL types and Java classes.
-@end deftypemethod
-@deftypemethod Array {public Object} getArray (long@w{ }@var{offset}, int@w{ }@var{count}) @*throws SQLException
-This method returns a portion of this array starting at index
- @code{offset} into the array and continuing for @code{length}
- elements. Fewer than the requested number of elements will be
- returned if the array does not contain the requested number of elements.
- The object returned will be an array of Java objects of
- the appropriate types.
-@end deftypemethod
-@deftypemethod Array {public Object} getArray (long@w{ }@var{index}, int@w{ }@var{count}, java.util.Map@w{ }@var{map}) @*throws SQLException
-This method returns a portion of this array starting at index
- @code{offset} into the array and continuing for @code{length}
- elements. Fewer than the requested number of elements will be
- returned if the array does not contain the requested number of elements.
- The object returned will be an array of Java objects. The specified
- @code{Map} will be used for overriding selected SQL type to
- Java class mappings.
-@end deftypemethod
-@deftypemethod Array {public ResultSet} getResultSet () @*throws SQLException
-This method returns the elements in the array as a @code{ResultSet}.
- Each row of the result set will have two columns. The first will be
- the index into the array of that row's contents. The second will be
- the actual value of that array element.
-@end deftypemethod
-@deftypemethod Array {public ResultSet} getResultSet (java.util.Map@w{ }@var{map}) @*throws SQLException
-This method returns the elements in the array as a @code{ResultSet}.
- Each row of the result set will have two columns. The first will be
- the index into the array of that row's contents. The second will be
- the actual value of that array element. The specified @code{Map}
- will be used to override selected default mappings of SQL types to
- Java classes.
-@end deftypemethod
-@deftypemethod Array {public ResultSet} getResultSet (long@w{ }@var{index}, int@w{ }@var{count}) @*throws SQLException
-This method returns a portion of the array as a @code{ResultSet}.
- The returned portion will start at index @code{offset} into the
- array and up to @code{length} elements will be returned.
-
-
-
- Each row of the result set will have two columns. The first will be
- the index into the array of that row's contents. The second will be
- the actual value of that array element.
-@end deftypemethod
-@deftypemethod Array {public ResultSet} getResultSet (long@w{ }@var{index}, int@w{ }@var{count}, java.util.Map@w{ }@var{map}) @*throws SQLException
-This method returns a portion of the array as a @code{ResultSet}.
- The returned portion will start at index @code{offset} into the
- array and up to @code{length} elements will be returned.
-
-
-
- Each row of the result set will have two columns. The first will be
- the index into the array of that row's contents. The second will be
- the actual value of that array element. The specified @code{Map}
- will be used to override selected default mappings of SQL types to
- Java classes.
-@end deftypemethod
-@deftypemethod BatchUpdateException {public int} getUpdateCounts ()
-This method returns the update count information for this error. If
- not @code{null} this is an array of @code{int}'s that are
- the update accounts for each command that was successfully executed.
- The array elements are in the order that the commands were executed.
-@end deftypemethod
-@deftypemethod Blob {public long} length () @*throws SQLException
-This method returns the number of bytes in the BLOB.
-@end deftypemethod
-@deftypemethod Blob {public byte} getBytes (long@w{ }@var{offset}, int@w{ }@var{length}) @*throws SQLException
-This method returns up to the requested bytes of this BLOB as a
- @code{byte} array.
-@end deftypemethod
-@deftypemethod Blob {public InputStream} getBinaryStream () @*throws SQLException
-This method returns a stream that will read the bytes of the BLOB.
-@end deftypemethod
-@deftypemethod Blob {public long} position (byte[]@w{ }@var{pattern}, long@w{ }@var{offset}) @*throws SQLException
-This method returns the index into the BLOB at which the first instance
- of the specified bytes occur. The searching starts at the specified
- index into the BLOB.
-@end deftypemethod
-@deftypemethod Blob {public long} position (java.sql.Blob@w{ }@var{pattern}, long@w{ }@var{offset}) @*throws SQLException
-This method returns the index into the BLOB at which the first instance
- of the specified pattern occurs. The searching starts at the specified
- index into this BLOB. The bytes in the specified @code{Blob} are
- used as the search pattern.
-@end deftypemethod
-@deftypemethod CallableStatement {public boolean} wasNull () @*throws SQLException
-This method tests whether the value of the last parameter that was fetched
- was actually a SQL NULL value.
-@end deftypemethod
-@deftypemethod CallableStatement {public String} getString (int@w{ }@var{index}) @*throws SQLException
-This method returns the value of the specified parameter as a Java
- @code{String}.
-@end deftypemethod
-@deftypemethod CallableStatement {public Object} getObject (int@w{ }@var{index}) @*throws SQLException
-This method returns the value of the specified parameter as a Java
- @code{Object}.
-@end deftypemethod
-@deftypemethod CallableStatement {public Object} getObject (int@w{ }@var{index}, java.util.Map@w{ }@var{map}) @*throws SQLException
-This method returns the value of the specified parameter as a Java
- @code{Object}.
-@end deftypemethod
-@deftypemethod CallableStatement {public boolean} getBoolean (int@w{ }@var{index}) @*throws SQLException
-This method returns the value of the specified parameter as a Java
- @code{boolean}.
-@end deftypemethod
-@deftypemethod CallableStatement {public byte} getByte (int@w{ }@var{index}) @*throws SQLException
-This method returns the value of the specified parameter as a Java
- @code{byte}.
-@end deftypemethod
-@deftypemethod CallableStatement {public short} getShort (int@w{ }@var{index}) @*throws SQLException
-This method returns the value of the specified parameter as a Java
- @code{short}.
-@end deftypemethod
-@deftypemethod CallableStatement {public int} getInt (int@w{ }@var{index}) @*throws SQLException
-This method returns the value of the specified parameter as a Java
- @code{int}.
-@end deftypemethod
-@deftypemethod CallableStatement {public long} getLong (int@w{ }@var{index}) @*throws SQLException
-This method returns the value of the specified parameter as a Java
- @code{long}.
-@end deftypemethod
-@deftypemethod CallableStatement {public float} getFloat (int@w{ }@var{index}) @*throws SQLException
-This method returns the value of the specified parameter as a Java
- @code{float}.
-@end deftypemethod
-@deftypemethod CallableStatement {public double} getDouble (int@w{ }@var{index}) @*throws SQLException
-This method returns the value of the specified parameter as a Java
- @code{double}.
-@end deftypemethod
-@deftypemethod CallableStatement {public BigDecimal} getBigDecimal (int@w{ }@var{index}) @*throws SQLException
-This method returns the value of the specified parameter as a Java
- @code{BigDecimal}.
-@end deftypemethod
-@deftypemethod CallableStatement {public BigDecimal} getBigDecimal (int@w{ }@var{index}, int@w{ }@var{scale}) @*throws SQLException
-This method returns the value of the specified parameter as a Java
- @code{BigDecimal}.
-@end deftypemethod
-@deftypemethod CallableStatement {public byte} getBytes (int@w{ }@var{index}) @*throws SQLException
-This method returns the value of the specified parameter as a Java
- byte array.
-@end deftypemethod
-@deftypemethod CallableStatement {public Date} getDate (int@w{ }@var{index}) @*throws SQLException
-This method returns the value of the specified parameter as a Java
- @code{java.sql.Date}.
-@end deftypemethod
-@deftypemethod CallableStatement {public Date} getDate (int@w{ }@var{index}, java.util.Calendar@w{ }@var{calendar}) @*throws SQLException
-This method returns the value of the specified parameter as a Java
- @code{java.sql.Date}.
-@end deftypemethod
-@deftypemethod CallableStatement {public Time} getTime (int@w{ }@var{index}) @*throws SQLException
-This method returns the value of the specified parameter as a Java
- @code{java.sql.Time}.
-@end deftypemethod
-@deftypemethod CallableStatement {public Time} getTime (int@w{ }@var{index}, java.util.Calendar@w{ }@var{calendar}) @*throws SQLException
-This method returns the value of the specified parameter as a Java
- @code{java.sql.Time}.
-@end deftypemethod
-@deftypemethod CallableStatement {public Timestamp} getTimestamp (int@w{ }@var{index}) @*throws SQLException
-This method returns the value of the specified parameter as a Java
- @code{java.sql.Timestamp}.
-@end deftypemethod
-@deftypemethod CallableStatement {public Timestamp} getTimestamp (int@w{ }@var{index}, java.util.Calendar@w{ }@var{calendar}) @*throws SQLException
-This method returns the value of the specified parameter as a Java
- @code{java.sql.Timestamp}.
-@end deftypemethod
-@deftypemethod CallableStatement {public Ref} getRef (int@w{ }@var{index}) @*throws SQLException
-This method returns the value of the specified parameter as a Java
- @code{Ref}.
-@end deftypemethod
-@deftypemethod CallableStatement {public Blob} getBlob (int@w{ }@var{index}) @*throws SQLException
-This method returns the value of the specified parameter as a Java
- @code{Blob}.
-@end deftypemethod
-@deftypemethod CallableStatement {public Clob} getClob (int@w{ }@var{index}) @*throws SQLException
-This method returns the value of the specified parameter as a Java
- @code{Clob}.
-@end deftypemethod
-@deftypemethod CallableStatement {public Array} getArray (int@w{ }@var{index}) @*throws SQLException
-This method returns the value of the specified parameter as a Java
- @code{Array}.
-@end deftypemethod
-@deftypemethod CallableStatement {public void} registerOutParameter (int@w{ }@var{index}, int@w{ }@var{type}) @*throws SQLException
-This method registers the specified parameter as an output parameter
- of the specified SQL type.
-@end deftypemethod
-@deftypemethod CallableStatement {public void} registerOutParameter (int@w{ }@var{index}, int@w{ }@var{type}, java.lang.String@w{ }@var{name}) @*throws SQLException
-This method registers the specified parameter as an output parameter
- of the specified SQL type.
-@end deftypemethod
-@deftypemethod CallableStatement {public void} registerOutParameter (int@w{ }@var{index}, int@w{ }@var{type}, int@w{ }@var{scale}) @*throws SQLException
-This method registers the specified parameter as an output parameter
- of the specified SQL type and scale.
-@end deftypemethod
-@deftypemethod Clob {public long} length () @*throws SQLException
-This method returns the number of characters in the CLOB.
-@end deftypemethod
-@deftypemethod Clob {public String} getSubString (long@w{ }@var{offset}, int@w{ }@var{length}) @*throws SQLException
-This method returns the specified portion of the CLOB as a
- @code{String}.
-@end deftypemethod
-@deftypemethod Clob {public InputStream} getAsciiStream () @*throws SQLException
-This method returns a byte stream that reads the contents of the
- CLOB as a series of ASCII bytes.
-@end deftypemethod
-@deftypemethod Clob {public Reader} getCharacterStream () @*throws SQLException
-This method returns a character stream that reads the contents of the
- CLOB.
-@end deftypemethod
-@deftypemethod Clob {public long} position (java.lang.String@w{ }@var{pattern}, long@w{ }@var{offset}) @*throws SQLException
-This method returns the index into the CLOB of the first occurrence of
- the specified character pattern (supplied by the caller as a
- @code{String}). The search begins at the specified index.
-@end deftypemethod
-@deftypemethod Clob {public long} position (java.sql.Clob@w{ }@var{pattern}, long@w{ }@var{offset}) @*throws SQLException
-This method returns the index into the CLOB of the first occurrence of
- the specified character pattern (supplied by the caller as a
- @code{Clob}). The search begins at the specified index.
-@end deftypemethod
-@deftypemethod Connection {public Statement} createStatement () @*throws SQLException
-This method creates a new SQL statement. The default result set type
- and concurrency will be used.
-@end deftypemethod
-@deftypemethod Connection {public Statement} createStatement (int@w{ }@var{resultSetType}, int@w{ }@var{resultSetConcurrency}) @*throws SQLException
-This method creates a new SQL statement with the specified type and
- concurrency. Valid values for these parameters are specified in the
- @code{ResultSet} class.
-@end deftypemethod
-@deftypemethod Connection {public PreparedStatement} prepareStatement (java.lang.String@w{ }@var{sql}) @*throws SQLException
-This method creates a new @code{PreparedStatement} for the specified
- SQL string. This method is designed for use with parameterized
- statements. The default result set type and concurrency will be used.
-@end deftypemethod
-@deftypemethod Connection {public PreparedStatement} prepareStatement (java.lang.String@w{ }@var{sql}, int@w{ }@var{resultSetType}, int@w{ }@var{resultSetConcurrency}) @*throws SQLException
-This method creates a new @code{PreparedStatement} for the specified
- SQL string. This method is designed for use with parameterized
- statements. The specified result set type and concurrency will be used.
- Valid values for these parameters are specified in the
- @code{ResultSet} class.
-@end deftypemethod
-@deftypemethod Connection {public CallableStatement} prepareCall (java.lang.String@w{ }@var{sql}) @*throws SQLException
-This method creates a new @code{CallableStatement} for the
- specified SQL string. Thie method is designed to be used with
- stored procedures. The default result set type and concurrency
- will be used.
-@end deftypemethod
-@deftypemethod Connection {public CallableStatement} prepareCall (java.lang.String@w{ }@var{sql}, int@w{ }@var{resultSetType}, int@w{ }@var{resultSetConcurrency}) @*throws SQLException
-This method creates a new @code{CallableStatement} for the
- specified SQL string. Thie method is designed to be used with
- stored procedures. The specified result set type and concurrency
- will be used. Valid values for these parameters are specified in the
- @code{ResultSet} class.
-@end deftypemethod
-@deftypemethod Connection {public String} nativeSQL (java.lang.String@w{ }@var{sql}) @*throws SQLException
-This method converts the specified generic SQL statement into the
- native grammer of the database this object is connected to.
-@end deftypemethod
-@deftypemethod Connection {public boolean} getAutoCommit () @*throws SQLException
-This method tests whether or not auto commit mode is currently enabled.
- In auto commit mode, every SQL statement is committed its own transaction.
- Otherwise a transaction must be explicitly committed or rolled back.
-@end deftypemethod
-@deftypemethod Connection {public void} setAutoCommit (boolean@w{ }@var{autoCommit}) @*throws SQLException
-This method turns auto commit mode on or off. In auto commit mode,
- every SQL statement is committed its own transaction. Otherwise a
- transaction must be explicitly committed or rolled back.
-@end deftypemethod
-@deftypemethod Connection {public void} commit () @*throws SQLException
-This method commits any SQL statements executed on this connection since
- the last commit or rollback.
-@end deftypemethod
-@deftypemethod Connection {public void} rollback () @*throws SQLException
-This method rolls back any SQL statements executed on this connection
- since the last commit or rollback.
-@end deftypemethod
-@deftypemethod Connection {public void} close () @*throws SQLException
-This method immediately closes this database connection.
-@end deftypemethod
-@deftypemethod Connection {public boolean} isClosed () @*throws SQLException
-This method tests whether or not this connection has been closed.
-@end deftypemethod
-@deftypemethod Connection {public DatabaseMetaData} getMetaData () @*throws SQLException
-This method returns the meta data for this database connection.
-@end deftypemethod
-@deftypemethod Connection {public boolean} isReadOnly () @*throws SQLException
-This method tests whether or not this connection is in read only mode.
-@end deftypemethod
-@deftypemethod Connection {public void} setReadOnly (boolean@w{ }@var{readOnly}) @*throws SQLException
-This method turns read only mode on or off. It may not be called while
- a transaction is in progress.
-@end deftypemethod
-@deftypemethod Connection {public String} getCatalog () @*throws SQLException
-This method returns the name of the catalog in use by this connection,
- if any.
-@end deftypemethod
-@deftypemethod Connection {public void} setCatalog (java.lang.String@w{ }@var{catalog}) @*throws SQLException
-This method sets the name of the catalog in use by this connection.
- Note that this method does nothing if catalogs are not supported by
- this database.
-@end deftypemethod
-@deftypemethod Connection {public int} getTransactionIsolation () @*throws SQLException
-This method returns the current transaction isolation mode. This will
- be one of the constants defined in this interface.
-@end deftypemethod
-@deftypemethod Connection {public void} setTransactionIsolation (int@w{ }@var{level}) @*throws SQLException
-This method sets the current transaction isolation mode. This must
- be one of the constants defined in this interface.
-@end deftypemethod
-@deftypemethod Connection {public SQLWarning} getWarnings () @*throws SQLException
-This method returns the first warning that occurred on this connection,
- if any. If there were any subsequence warnings, they will be chained
- to the first one.
-@end deftypemethod
-@deftypemethod Connection {public void} clearWarnings () @*throws SQLException
-This method clears all warnings that have occurred on this connection.
-@end deftypemethod
-@deftypemethod Connection {public Map} getTypeMap () @*throws SQLException
-This method returns the mapping of SQL types to Java classes
- currently in use by this connection. This mapping will have no
- entries unless they have been manually added.
-@end deftypemethod
-@deftypemethod Connection {public void} setTypeMap (java.util.Map@w{ }@var{map}) @*throws SQLException
-This method sets the mapping table for SQL types to Java classes.
- Any entries in this map override the defaults.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public boolean} allProceduresAreCallable () @*throws SQLException
-This method tests whether or not all the procedures returned by
- the @code{getProcedures} method can be called by this user.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public boolean} allTablesAreSelectable () @*throws SQLException
-This method tests whether or not all the table returned by the
- @code{getTables} method can be selected by this user.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public String} getURL () @*throws SQLException
-This method returns the URL for this database.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public String} getUserName () @*throws SQLException
-This method returns the database username for this connection.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public boolean} isReadOnly () @*throws SQLException
-This method tests whether or not the database is in read only mode.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public boolean} nullsAreSortedHigh () @*throws SQLException
-This method tests whether or not NULL's sort as high values.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public boolean} nullsAreSortedLow () @*throws SQLException
-This method tests whether or not NULL's sort as low values.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public boolean} nullsAreSortedAtStart () @*throws SQLException
-This method test whether or not NULL's are sorted to the beginning
- of the list regardless of ascending or descending sort order.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public boolean} nullsAreSortedAtEnd () @*throws SQLException
-This method test whether or not NULL's are sorted to the end
- of the list regardless of ascending or descending sort order.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public String} getDatabaseProductName () @*throws SQLException
-This method returns the name of the database product.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public String} getDatabaseProductVersion () @*throws SQLException
-This method returns the version of the database product.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public String} getDriverName () @*throws SQLException
-This method returns the name of the JDBC driver.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public String} getDriverVersion () @*throws SQLException
-This method returns the version of the JDBC driver.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public int} getDriverMajorVersion ()
-This method returns the major version number of the JDBC driver.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public int} getDriverMinorVersion ()
-This method returns the minor version number of the JDBC driver.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public boolean} usesLocalFiles () @*throws SQLException
-This method tests whether or not the database uses local files to
- store tables.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public boolean} usesLocalFilePerTable () @*throws SQLException
-This method tests whether or not the database uses a separate file for
- each table.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public boolean} supportsMixedCaseIdentifiers () @*throws SQLException
-This method tests whether or not the database supports identifiers
- with mixed case.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public boolean} storesUpperCaseIdentifiers () @*throws SQLException
-This method tests whether or not the database treats mixed case
- identifiers as all upper case.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public boolean} storesLowerCaseIdentifiers () @*throws SQLException
-This method tests whether or not the database treats mixed case
- identifiers as all lower case.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public boolean} storesMixedCaseIdentifiers () @*throws SQLException
-This method tests whether or not the database stores mixed case
- identifers even if it treats them as case insensitive.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public boolean} supportsMixedCaseQuotedIdentifiers () @*throws SQLException
-This method tests whether or not the database supports quoted identifiers
- with mixed case.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public boolean} storesUpperCaseQuotedIdentifiers () @*throws SQLException
-This method tests whether or not the database treats mixed case
- quoted identifiers as all upper case.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public boolean} storesLowerCaseQuotedIdentifiers () @*throws SQLException
-This method tests whether or not the database treats mixed case
- quoted identifiers as all lower case.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public boolean} storesMixedCaseQuotedIdentifiers () @*throws SQLException
-This method tests whether or not the database stores mixed case
- quoted identifers even if it treats them as case insensitive.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public String} getIdentifierQuoteString () @*throws SQLException
-This metohd returns the quote string for SQL identifiers.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public String} getSQLKeywords () @*throws SQLException
-This method returns a comma separated list of all the SQL keywords in
- the database that are not in SQL92.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public String} getNumericFunctions () @*throws SQLException
-This method returns a comma separated list of math functions.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public String} getStringFunctions () @*throws SQLException
-This method returns a comma separated list of string functions.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public String} getSystemFunctions () @*throws SQLException
-This method returns a comma separated list of of system functions.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public String} getTimeDateFunctions () @*throws SQLException
-This method returns comma separated list of time/date functions.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public String} getSearchStringEscape () @*throws SQLException
-This method returns the string used to escape wildcards in search strings.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public String} getExtraNameCharacters () @*throws SQLException
-This methods returns non-standard characters that can appear in
- unquoted identifiers.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public boolean} supportsAlterTableWithAddColumn () @*throws SQLException
-This method tests whether or not the database supports
- "ALTER TABLE ADD COLUMN"
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public boolean} supportsAlterTableWithDropColumn () @*throws SQLException
-This method tests whether or not the database supports
- "ALTER TABLE DROP COLUMN"
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public boolean} supportsColumnAliasing () @*throws SQLException
-This method tests whether or not column aliasing is supported.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public boolean} nullPlusNonNullIsNull () @*throws SQLException
-This method tests whether the concatenation of a NULL and non-NULL
- value results in a NULL. This will always be true in fully JDBC compliant
- drivers.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public boolean} supportsConvert () @*throws SQLException
-Tests whether or not CONVERT is supported.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public boolean} supportsConvert (int@w{ }@var{fromType}, int@w{ }@var{toType}) @*throws SQLException
-This method tests whether or not CONVERT can be performed between the
- specified types. The types are contants from @code{Types}.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public boolean} supportsTableCorrelationNames () @*throws SQLException
-This method tests whether or not table correlation names are
- supported. This will be always be @code{true} in a fully JDBC
- compliant driver.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public boolean} supportsDifferentTableCorrelationNames () @*throws SQLException
-This method tests whether correlation names must be different from the
- name of the table.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public boolean} supportsExpressionsInOrderBy () @*throws SQLException
-This method tests whether or not expressions are allowed in an
- ORDER BY lists.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public boolean} supportsOrderByUnrelated () @*throws SQLException
-This method tests whether or ORDER BY on a non-selected column is
- allowed.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public boolean} supportsGroupBy () @*throws SQLException
-This method tests whether or not GROUP BY is supported.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public boolean} supportsGroupByUnrelated () @*throws SQLException
-This method tests whether GROUP BY on a non-selected column is
- allowed.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public boolean} supportsGroupByBeyondSelect () @*throws SQLException
-This method tests whether or not a GROUP BY can add columns not in the
- select if it includes all the columns in the select.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public boolean} supportsLikeEscapeClause () @*throws SQLException
-This method tests whether or not the escape character is supported in
- LIKE expressions. A fully JDBC compliant driver will always return
- @code{true}.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public boolean} supportsMultipleResultSets () @*throws SQLException
-This method tests whether multiple result sets for a single statement are
- supported.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public boolean} supportsMultipleTransactions () @*throws SQLException
-This method test whether or not multiple transactions may be open
- at once, as long as they are on different connections.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public boolean} supportsNonNullableColumns () @*throws SQLException
-This method tests whether or not columns can be defined as NOT NULL. A
- fully JDBC compliant driver always returns @code{true}.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public boolean} supportsMinimumSQLGrammar () @*throws SQLException
-This method tests whether or not the minimum grammer for ODBC is supported.
- A fully JDBC compliant driver will always return @code{true}.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public boolean} supportsCoreSQLGrammar () @*throws SQLException
-This method tests whether or not the core grammer for ODBC is supported.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public boolean} supportsExtendedSQLGrammar () @*throws SQLException
-This method tests whether or not the extended grammer for ODBC is supported.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public boolean} supportsANSI92EntryLevelSQL () @*throws SQLException
-This method tests whether or not the ANSI92 entry level SQL
- grammar is supported. A fully JDBC compliant drivers must return
- @code{true}.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public boolean} supportsANSI92IntermediateSQL () @*throws SQLException
-This method tests whether or not the ANSI92 intermediate SQL
- grammar is supported.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public boolean} supportsANSI92FullSQL () @*throws SQLException
-This method tests whether or not the ANSI92 full SQL
- grammar is supported.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public boolean} supportsIntegrityEnhancementFacility () @*throws SQLException
-This method tests whether or not the SQL integrity enhancement
- facility is supported.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public boolean} supportsOuterJoins () @*throws SQLException
-This method tests whether or not the database supports outer joins.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public boolean} supportsFullOuterJoins () @*throws SQLException
-This method tests whether or not the database supports full outer joins.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public boolean} supportsLimitedOuterJoins () @*throws SQLException
-This method tests whether or not the database supports limited outer joins.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public String} getSchemaTerm () @*throws SQLException
-This method returns the vendor's term for "schema".
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public String} getProcedureTerm () @*throws SQLException
-This method returns the vendor's term for "procedure".
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public String} getCatalogTerm () @*throws SQLException
-This method returns the vendor's term for "catalog".
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public boolean} isCatalogAtStart () @*throws SQLException
-This method tests whether a catalog name appears at the beginning of
- a fully qualified table name.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public String} getCatalogSeparator () @*throws SQLException
-This method returns the separator between the catalog name and the
- table name.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public boolean} supportsSchemasInDataManipulation () @*throws SQLException
-This method tests whether a catalog name can appear in a data
- manipulation statement.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public boolean} supportsSchemasInProcedureCalls () @*throws SQLException
-This method tests whether a catalog name can appear in a procedure
- call
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public boolean} supportsSchemasInTableDefinitions () @*throws SQLException
-This method tests whether a catalog name can appear in a table definition.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public boolean} supportsSchemasInIndexDefinitions () @*throws SQLException
-This method tests whether a catalog name can appear in an index definition.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public boolean} supportsSchemasInPrivilegeDefinitions () @*throws SQLException
-This method tests whether a catalog name can appear in privilege definitions.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public boolean} supportsCatalogsInDataManipulation () @*throws SQLException
-This method tests whether a catalog name can appear in a data
- manipulation statement.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public boolean} supportsCatalogsInProcedureCalls () @*throws SQLException
-This method tests whether a catalog name can appear in a procedure
- call
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public boolean} supportsCatalogsInTableDefinitions () @*throws SQLException
-This method tests whether a catalog name can appear in a table definition.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public boolean} supportsCatalogsInIndexDefinitions () @*throws SQLException
-This method tests whether a catalog name can appear in an index definition.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public boolean} supportsCatalogsInPrivilegeDefinitions () @*throws SQLException
-This method tests whether a catalog name can appear in privilege definitions.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public boolean} supportsPositionedDelete () @*throws SQLException
-This method tests whether or not that database supports positioned
- deletes.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public boolean} supportsPositionedUpdate () @*throws SQLException
-This method tests whether or not that database supports positioned
- updates.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public boolean} supportsSelectForUpdate () @*throws SQLException
-This method tests whether or not SELECT FOR UPDATE is supported by the
- database.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public boolean} supportsStoredProcedures () @*throws SQLException
-This method tests whether or not stored procedures are supported on
- this database.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public boolean} supportsSubqueriesInComparisons () @*throws SQLException
-This method tests whether or not subqueries are allowed in comparisons.
- A fully JDBC compliant driver will always return @code{true}.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public boolean} supportsSubqueriesInExists () @*throws SQLException
-This method tests whether or not subqueries are allowed in exists
- expressions. A fully JDBC compliant driver will always return
- @code{true}.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public boolean} supportsSubqueriesInIns () @*throws SQLException
-This method tests whether subqueries are allowed in IN statements.
- A fully JDBC compliant driver will always return @code{true}.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public boolean} supportsSubqueriesInQuantifieds () @*throws SQLException
-This method tests whether or not subqueries are allowed in quantified
- expressions. A fully JDBC compliant driver will always return
- @code{true}.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public boolean} supportsCorrelatedSubqueries () @*throws SQLException
-This method test whether or not correlated subqueries are allowed. A
- fully JDBC compliant driver will always return @code{true}.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public boolean} supportsUnion () @*throws SQLException
-This method tests whether or not the UNION statement is supported.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public boolean} supportsUnionAll () @*throws SQLException
-This method tests whether or not the UNION ALL statement is supported.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public boolean} supportsOpenCursorsAcrossCommit () @*throws SQLException
-This method tests whether or not the database supports cursors
- remaining open across commits.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public boolean} supportsOpenCursorsAcrossRollback () @*throws SQLException
-This method tests whether or not the database supports cursors
- remaining open across rollbacks.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public boolean} supportsOpenStatementsAcrossCommit () @*throws SQLException
-This method tests whether or not the database supports statements
- remaining open across commits.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public boolean} supportsOpenStatementsAcrossRollback () @*throws SQLException
-This method tests whether or not the database supports statements
- remaining open across rollbacks.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public int} getMaxBinaryLiteralLength () @*throws SQLException
-This method returns the number of hex characters allowed in an inline
- binary literal.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public int} getMaxCharLiteralLength () @*throws SQLException
-This method returns the maximum length of a character literal.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public int} getMaxColumnNameLength () @*throws SQLException
-This method returns the maximum length of a column name.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public int} getMaxColumnsInGroupBy () @*throws SQLException
-This method returns the maximum number of columns in a GROUP BY statement.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public int} getMaxColumnsInIndex () @*throws SQLException
-This method returns the maximum number of columns in an index.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public int} getMaxColumnsInOrderBy () @*throws SQLException
-This method returns the maximum number of columns in an ORDER BY statement.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public int} getMaxColumnsInSelect () @*throws SQLException
-This method returns the maximum number of columns in a SELECT statement.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public int} getMaxColumnsInTable () @*throws SQLException
-This method returns the maximum number of columns in a table.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public int} getMaxConnections () @*throws SQLException
-This method returns the maximum number of connections this client
- can have to the database.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public int} getMaxCursorNameLength () @*throws SQLException
-This method returns the maximum length of a cursor name.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public int} getMaxIndexLength () @*throws SQLException
-This method returns the maximum length of an index.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public int} getMaxSchemaNameLength () @*throws SQLException
-This method returns the maximum length of a schema name.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public int} getMaxProcedureNameLength () @*throws SQLException
-This method returns the maximum length of a procedure name.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public int} getMaxCatalogNameLength () @*throws SQLException
-This method returns the maximum length of a catalog name.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public int} getMaxRowSize () @*throws SQLException
-This method returns the maximum size of a row in bytes.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public boolean} doesMaxRowSizeIncludeBlobs () @*throws SQLException
-This method tests whether or not the maximum row size includes BLOB's
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public int} getMaxStatementLength () @*throws SQLException
-This method includes the maximum length of a SQL statement.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public int} getMaxStatements () @*throws SQLException
-This method returns the maximum number of statements that can be
- active at any time.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public int} getMaxTableNameLength () @*throws SQLException
-This method returns the maximum length of a table name.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public int} getMaxTablesInSelect () @*throws SQLException
-This method returns the maximum number of tables that may be referenced
- in a SELECT statement.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public int} getMaxUserNameLength () @*throws SQLException
-This method returns the maximum length of a user name.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public int} getDefaultTransactionIsolation () @*throws SQLException
-This method returns the default transaction isolation level of the
- database.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public boolean} supportsTransactions () @*throws SQLException
-This method tests whether or not the database supports transactions.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public boolean} supportsTransactionIsolationLevel (int@w{ }@var{level}) @*throws SQLException
-This method tests whether or not the database supports the specified
- transaction isolation level.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public boolean} supportsDataDefinitionAndDataManipulationTransactions () @*throws SQLException
-This method tests whether or not DDL and DML statements allowed within
- the same transaction.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public boolean} supportsDataManipulationTransactionsOnly () @*throws SQLException
-This method tests whether or not only DML statement are allowed
- inside a transaction.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public boolean} dataDefinitionCausesTransactionCommit () @*throws SQLException
-This method tests whether or not a DDL statement will cause the
- current transaction to be automatically committed.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public boolean} dataDefinitionIgnoredInTransactions () @*throws SQLException
-This method tests whether or not DDL statements are ignored in
- transactions.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public ResultSet} getProcedures (java.lang.String@w{ }@var{catalog}, java.lang.String@w{ }@var{schemaPattern}, java.lang.String@w{ }@var{namePattern}) @*throws SQLException
-This method returns a list of all the stored procedures matching the
- specified pattern in the given schema and catalog. This is returned
- a @code{ResultSet} with the following columns:
-
-
-
-
-@itemize @bullet
-
-
-@item
-PROCEDURE_CAT - The catalog the procedure is in, which may be
- @code{null}.
-
-@item
-PROCEDURE_SCHEM - The schema the procedures is in, which may be
- @code{null}.
-
-@item
-PROCEDURE_NAME - The name of the procedure.
-
-@item
-Unused
-
-@item
-Unused
-
-@item
-Unused
-
-@item
-REMARKS - A description of the procedure
-
-@item
-PROCEDURE_TYPE - Indicates the return type of the procedure, which
- is one of the contstants defined in this class
- (@code{procedureResultUnknown}, @code{procedureNoResult}, or
- @code{procedureReturnsResult}).
-
-@end itemize
-
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public ResultSet} getProcedureColumns (java.lang.String@w{ }@var{catalog}, java.lang.String@w{ }@var{schemaPattern}, java.lang.String@w{ }@var{namePattern}, java.lang.String@w{ }@var{columnPattern}) @*throws SQLException
-This method returns a list of the parameter and result columns for
- the requested stored procedures. This is returned in the form of a
- @code{ResultSet} with the following columns:
-
-
-
-
-@itemize @bullet
-
-
-@item
-PROCEDURE_CAT - The catalog the procedure is in, which may be
- @code{null}.
-
-@item
-PROCEDURE_SCHEM - The schema the procedures is in, which may be
- @code{null}.
-
-@item
-PROCEDURE_NAME - The name of the procedure.
-
-@item
-COLUMN_NAME - The name of the column
-
-@item
-COLUMN_TYPE - The type of the column, which will be one of the
- contants defined in this class (@code{procedureColumnUnknown},
- @code{procedureColumnIn}, @code{procedureColumnInOut},
- @code{procedureColumnOut}, @code{procedureColumnReturn},
- or @code{procedureColumnResult}).
-
-@item
-DATA_TYPE - The SQL type of the column. This is one of the constants
- defined in @code{Types}.
-
-@item
-TYPE_NAME - The string name of the data type for this column.
-
-@item
-PRECISION - The precision of the column.
-
-@item
-LENGTH - The length of the column in bytes
-
-@item
-SCALE - The scale of the column.
-
-@item
-RADIX - The radix of the column.
-
-@item
-NULLABLE - Whether or not the column is NULLABLE. This is one of
- the constants defined in this class (@code{procedureNoNulls},
- @code{procedureNullable}, or @code{procedureNullableUnknown})
-
-@item
-REMARKS - A description of the column.
-
-@end itemize
-
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public ResultSet} getTables (java.lang.String@w{ }@var{catalog}, java.lang.String@w{ }@var{schemaPattern}, java.lang.String@w{ }@var{namePattern}, java.lang.String[]@w{ }@var{types}) @*throws SQLException
-This method returns a list of the requested table as a
- @code{ResultSet} with the following columns:
-
-
-
-
-@itemize @bullet
-
-
-@item
-TABLE_CAT - The catalog the table is in, which may be @code{null}.
-
-@item
-TABLE_SCHEM - The schema the table is in, which may be @code{null}.
-
-@item
-TABLE_NAME - The name of the table.
-
-@item
-TABLE_TYPE - A string describing the table type. This will be one
- of the values returned by the @code{getTableTypes()} method.
-
-@item
-REMARKS - Comments about the table.
-
-@end itemize
-
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public ResultSet} getSchemas () @*throws SQLException
-This method returns the list of database schemas as a
- @code{ResultSet}, with one column - TABLE_SCHEM - that is the
- name of the schema.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public ResultSet} getCatalogs () @*throws SQLException
-This method returns the list of database catalogs as a
- @code{ResultSet} with one column - TABLE_CAT - that is the
- name of the catalog.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public ResultSet} getTableTypes () @*throws SQLException
-This method returns the list of database table types as a
- @code{ResultSet} with one column - TABLE_TYPE - that is the
- name of the table type.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public ResultSet} getColumns (java.lang.String@w{ }@var{catalog}, java.lang.String@w{ }@var{schemaPattern}, java.lang.String@w{ }@var{namePattern}, java.lang.String@w{ }@var{columnPattern}) @*throws SQLException
-This method returns a list of the tables columns for
- the requested tables. This is returned in the form of a
- @code{ResultSet} with the following columns:
-
-
-
-
-@itemize @bullet
-
-
-@item
-TABLE_CAT - The catalog the table is in, which may be
- @code{null}.
-
-@item
-TABLE_SCHEM - The schema the tables is in, which may be
- @code{null}.
-
-@item
-TABLE_NAME - The name of the table.
-
-@item
-COLUMN_NAME - The name of the column
-
-@item
-DATA_TYPE - The SQL type of the column. This is one of the constants
- defined in @code{Types}.
-
-@item
-TYPE_NAME - The string name of the data type for this column.
-
-@item
-COLUMN_SIZE - The size of the column.
-
-@item
-Unused
-
-@item
-NUM_PREC_RADIX - The radix of the column.
-
-@item
-NULLABLE - Whether or not the column is NULLABLE. This is one of
- the constants defined in this class (@code{tableNoNulls},
- @code{tableNullable}, or @code{tableNullableUnknown})
-
-@item
-REMARKS - A description of the column.
-
-@item
-COLUMN_DEF - The default value for the column, may be @code{null}.
-
-@item
-SQL_DATA_TYPE - Unused
-
-@item
-SQL_DATETIME_SUB - Unused
-
-@item
-CHAR_OCTET_LENGTH - For character columns, the maximum number of bytes
- in the column.
-
-@item
-ORDINAL_POSITION - The index of the column in the table.
-
-@item
-IS_NULLABLE - "NO" means no, "YES" means maybe, and an empty string
- means unknown.
-
-@end itemize
-
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public ResultSet} getColumnPrivileges (java.lang.String@w{ }@var{catalog}, java.lang.String@w{ }@var{schema}, java.lang.String@w{ }@var{table}, java.lang.String@w{ }@var{columnPattern}) @*throws SQLException
-This method returns the access rights that have been granted to the
- requested columns. This information is returned as a @code{ResultSet}
- with the following columns:
-
-
-
-
-@itemize @bullet
-
-
-@item
-TABLE_CAT - The catalog the table is in, which may be
- @code{null}.
-
-@item
-TABLE_SCHEM - The schema the tables is in, which may be
- @code{null}.
-
-@item
-TABLE_NAME - The name of the table.
-
-@item
-COLUMN_NAME - The name of the column.
-
-@item
-GRANTOR - The entity that granted the access.
-
-@item
-GRANTEE - The entity granted the access.
-
-@item
-PRIVILEGE - The name of the privilege granted.
-
-@item
-IS_GRANTABLE - "YES" if the grantee can grant the privilege to
- others, "NO" if not, and @code{null} if unknown.
-
-@end itemize
-
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public ResultSet} getTablePrivileges (java.lang.String@w{ }@var{catalog}, java.lang.String@w{ }@var{schema}, java.lang.String@w{ }@var{table}) @*throws SQLException
-This method returns the access rights that have been granted to the
- requested tables. This information is returned as a @code{ResultSet}
- with the following columns:
-
-
-
-
-@itemize @bullet
-
-
-@item
-TABLE_CAT - The catalog the table is in, which may be
- @code{null}.
-
-@item
-TABLE_SCHEM - The schema the tables is in, which may be
- @code{null}.
-
-@item
-TABLE_NAME - The name of the table.
-
-@item
-GRANTOR - The entity that granted the access.
-
-@item
-GRANTEE - The entity granted the access.
-
-@item
-PRIVILEGE - The name of the privilege granted.
-
-@item
-IS_GRANTABLE - "YES" if the grantee can grant the privilege to
- others, "NO" if not, and @code{null} if unknown.
-
-@end itemize
-
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public ResultSet} getBestRowIdentifier (java.lang.String@w{ }@var{catalog}, java.lang.String@w{ }@var{schema}, java.lang.String@w{ }@var{table}, int@w{ }@var{scope}, boolean@w{ }@var{nullable}) @*throws SQLException
-This method returns the best set of columns for uniquely identifying
- a row. It returns this information as a @code{ResultSet} with
- the following columns:
-
-
-
-
-@itemize @bullet
-
-
-@item
-SCOPE - The scope of the results returned. This is one of the
- constants defined in this class (@code{bestRowTemporary},
- @code{bestRowTransaction}, or @code{bestRowSession}).
-
-@item
-COLUMN_NAME - The name of the column.
-
-@item
-DATA_TYPE - The SQL type of the column. This is one of the constants
- defined in @code{Types}.
-
-@item
-TYPE_NAME - The string name of the data type for this column.
-
-@item
-COLUMN_SIZE - The precision of the columns
-
-@item
-BUFFER_LENGTH - Unused
-
-@item
-DECIMAL_DIGITS - The scale of the column.
-
-@item
-PSEUDO_COLUMN - Whether or not the best row identifier is a
- pseudo_column. This is one of the constants defined in this class
- (@code{bestRowUnknown}, @code{bestRowNotPseudo}, or
- @code{bestRowPseudo}).
-
-@end itemize
-
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public ResultSet} getVersionColumns (java.lang.String@w{ }@var{catalog}, java.lang.String@w{ }@var{schema}, java.lang.String@w{ }@var{table}) @*throws SQLException
-This method returns the set of columns that are automatically updated
- when the row is update. It returns this information as a
- @code{ResultSet} with the following columns:
-
-
-
-
-@itemize @bullet
-
-
-@item
-SCOPE - Unused
-
-@item
-COLUMN_NAME - The name of the column.
-
-@item
-DATA_TYPE - The SQL type of the column. This is one of the constants
- defined in @code{Types}.
-
-@item
-TYPE_NAME - The string name of the data type for this column.
-
-@item
-COLUMN_SIZE - The precision of the columns
-
-@item
-BUFFER_LENGTH - Unused
-
-@item
-DECIMAL_DIGITS - The scale of the column.
-
-@item
-PSEUDO_COLUMN - Whether or not the best row identifier is a
- pseudo_column. This is one of the constants defined in this class
- (@code{versionRowUnknown}, @code{versionRowNotPseudo}, or
- @code{versionRowPseudo}).
-
-@end itemize
-
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public ResultSet} getPrimaryKeys (java.lang.String@w{ }@var{catalog}, java.lang.String@w{ }@var{schema}, java.lang.String@w{ }@var{table}) @*throws SQLException
-This method returns a list of a table's primary key columns. These
- are returned as a @code{ResultSet} with the following columns.
-
-
-
-
-@itemize @bullet
-
-
-@item
-TABLE_CAT - The catalog of the table, which may be @code{null}.
-
-@item
-TABLE_SCHEM - The schema of the table, which may be @code{null}.
-
-@item
-TABLE_NAME - The name of the table.
-
-@item
-COLUMN_NAME - The name of the column.
-
-@item
-KEY_SEQ - The sequence number of the column within the primary key.
-
-@item
-PK_NAME - The name of the primary key, which may be @code{null}.
-
-@end itemize
-
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public ResultSet} getImportedKeys (java.lang.String@w{ }@var{catalog}, java.lang.String@w{ }@var{schema}, java.lang.String@w{ }@var{table}) @*throws SQLException
-This method returns a list of the table's foreign keys. These are
- returned as a @code{ResultSet} with the following columns:
-
-
-
-
-@itemize @bullet
-
-
-@item
-PKTABLE_CAT - The catalog of the table the key was imported from.
-
-@item
-PKTABLE_SCHEM - The schema of the table the key was imported from.
-
-@item
-PKTABLE_NAME - The name of the table the key was imported from.
-
-@item
-PKCOLUMN_NAME - The name of the column that was imported.
-
-@item
-FKTABLE_CAT - The foreign key catalog name.
-
-@item
-FKTABLE_SCHEM - The foreign key schema name.
-
-@item
-FKTABLE_NAME - The foreign key table name.
-
-@item
-FKCOLUMN_NAME - The foreign key column name.
-
-@item
-KEY_SEQ - The sequence number of the column within the foreign key.
-
-@item
-UPDATE_RULE - How the foreign key behaves when the primary key is
- updated. This is one of the constants defined in this class
- (@code{importedNoAction}, @code{importedKeyCascade},
- @code{importedKeySetNull}, @code{importedKeySetDefault}, or
- @code{importedKeyRestrict}).
-
-@item
-DELETE_RULE - How the foreign key behaves when the primary key is
- deleted. This is one of the constants defined in this class
- (@code{importedNoAction}, @code{importedKeyCascade},
- @code{importedKeySetNull}, or @code{importedKeySetDefault})
-
-@item
-FK_NAME - The name of the foreign key.
-
-@item
-PK_NAME - The name of the primary key.
-
-@item
-DEFERRABILITY - The deferrability value. This is one of the
- constants defined in this table (@code{importedKeyInitiallyDeferred},
- @code{importedKeyInitiallyImmediate}, or
- @code{importedKeyNotDeferrable}).
-
-@end itemize
-
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public ResultSet} getExportedKeys (java.lang.String@w{ }@var{catalog}, java.lang.String@w{ }@var{schema}, java.lang.String@w{ }@var{table}) @*throws SQLException
-This method returns a list of the table's which use this table's
- primary key as a foreign key. The information is
- returned as a @code{ResultSet} with the following columns:
-
-
-
-
-@itemize @bullet
-
-
-@item
-PKTABLE_CAT - The catalog of the table the key was imported from.
-
-@item
-PKTABLE_SCHEM - The schema of the table the key was imported from.
-
-@item
-PKTABLE_NAME - The name of the table the key was imported from.
-
-@item
-PKCOLUMN_NAME - The name of the column that was imported.
-
-@item
-FKTABLE_CAT - The foreign key catalog name.
-
-@item
-FKTABLE_SCHEM - The foreign key schema name.
-
-@item
-FKTABLE_NAME - The foreign key table name.
-
-@item
-FKCOLUMN_NAME - The foreign key column name.
-
-@item
-KEY_SEQ - The sequence number of the column within the foreign key.
-
-@item
-UPDATE_RULE - How the foreign key behaves when the primary key is
- updated. This is one of the constants defined in this class
- (@code{importedNoAction}, @code{importedKeyCascade},
- @code{importedKeySetNull}, @code{importedKeySetDefault}, or
- @code{importedKeyRestrict}).
-
-@item
-DELETE_RULE - How the foreign key behaves when the primary key is
- deleted. This is one of the constants defined in this class
- (@code{importedNoAction}, @code{importedKeyCascade},
- @code{importedKeySetNull}, or @code{importedKeySetDefault})
-
-@item
-FK_NAME - The name of the foreign key.
-
-@item
-PK_NAME - The name of the primary key.
-
-@item
-DEFERRABILITY - The deferrability value. This is one of the
- constants defined in this table (@code{importedKeyInitiallyDeferred},
- @code{importedKeyInitiallyImmediate}, or
- @code{importedKeyNotDeferrable}).
-
-@end itemize
-
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public ResultSet} getCrossReference (java.lang.String@w{ }@var{primCatalog}, java.lang.String@w{ }@var{primSchema}, java.lang.String@w{ }@var{primTable}, java.lang.String@w{ }@var{forCatalog}, java.lang.String@w{ }@var{forSchema}, java.lang.String@w{ }@var{forTable}) @*throws SQLException
-This method returns a description of how one table imports another
- table's primary key as a foreign key. The information is
- returned as a @code{ResultSet} with the following columns:
-
-
-
-
-@itemize @bullet
-
-
-@item
-PKTABLE_CAT - The catalog of the table the key was imported from.
-
-@item
-PKTABLE_SCHEM - The schema of the table the key was imported from.
-
-@item
-PKTABLE_NAME - The name of the table the key was imported from.
-
-@item
-PKCOLUMN_NAME - The name of the column that was imported.
-
-@item
-FKTABLE_CAT - The foreign key catalog name.
-
-@item
-FKTABLE_SCHEM - The foreign key schema name.
-
-@item
-FKTABLE_NAME - The foreign key table name.
-
-@item
-FKCOLUMN_NAME - The foreign key column name.
-
-@item
-KEY_SEQ - The sequence number of the column within the foreign key.
-
-@item
-UPDATE_RULE - How the foreign key behaves when the primary key is
- updated. This is one of the constants defined in this class
- (@code{importedNoAction}, @code{importedKeyCascade},
- @code{importedKeySetNull}, @code{importedKeySetDefault}, or
- @code{importedKeyRestrict}).
-
-@item
-DELETE_RULE - How the foreign key behaves when the primary key is
- deleted. This is one of the constants defined in this class
- (@code{importedNoAction}, @code{importedKeyCascade},
- @code{importedKeySetNull}, or @code{importedKeySetDefault})
-
-@item
-FK_NAME - The name of the foreign key.
-
-@item
-PK_NAME - The name of the primary key.
-
-@item
-DEFERRABILITY - The deferrability value. This is one of the
- constants defined in this table (@code{importedKeyInitiallyDeferred},
- @code{importedKeyInitiallyImmediate}, or
- @code{importedKeyNotDeferrable}).
-
-@end itemize
-
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public ResultSet} getTypeInfo () @*throws SQLException
-This method returns a list of the SQL types supported by this
- database. The information is returned as a @code{ResultSet}
- with the following columns:
-
-
-
-
-@itemize @bullet
-
-
-@item
-TYPE_NAME - The name of the data type.
-
-@item
-DATA_TYPE - A data type constant from @code{Types} for this
- type.
-
-@item
-PRECISION - The maximum precision of this type.
-
-@item
-LITERAL_PREFIX - Prefix value used to quote a literal, which may be
- @code{null}.
-
-@item
-LITERAL_SUFFIX - Suffix value used to quote a literal, which may be
- @code{null}.
-
-@item
-CREATE_PARAMS - The parameters used to create the type, which may be
- @code{null}.
-
-@item
-NULLABLE - Whether or not this type supports NULL values. This will
- be one of the constants defined in this interface
- (@code{typeNoNulls}, @code{typeNullable}, or
- @code{typeNullableUnknown}).
-
-@item
-CASE_SENSITIVE - Whether or not the value is case sensitive.
-
-@item
-SEARCHABLE - Whether or not "LIKE" expressions are supported in
- WHERE clauses for this type. This will be one of the constants defined
- in this interface (@code{typePredNone}, @code{typePredChar},
- @code{typePredBasic}, or @code{typeSearchable}).
-
-@item
-UNSIGNED_ATTRIBUTE - Is the value of this type unsigned.
-
-@item
-FIXED_PREC_SCALE - Whether or not this type can be used for money.
-
-@item
-AUTO_INCREMENT - Whether or not this type supports auto-incrementing.
-
-@item
-LOCAL_TYPE_NAME - A localized name for this data type.
-
-@item
-MINIMUM_SCALE - The minimum scale supported by this type.
-
-@item
-MAXIMUM_SCALE - The maximum scale supported by this type.
-
-@item
-SQL_DATA_TYPE - Unused.
-
-@item
-SQL_DATETIME_SUB - Unused.
-
-@item
-NUM_PREC_RADIX - The radix of this data type.
-
-@end itemize
-
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public ResultSet} getIndexInfo (java.lang.String@w{ }@var{catalog}, java.lang.String@w{ }@var{schema}, java.lang.String@w{ }@var{table}, boolean@w{ }@var{unique}, boolean@w{ }@var{approx}) @*throws SQLException
-This method returns information about a tables indices and statistics.
- It is returned as a @code{ResultSet} with the following columns:
-
-
-
-
-@itemize @bullet
-
-
-@item
-TABLE_CAT - The catalog of the table, which may be @code{null}.
-
-@item
-TABLE_SCHEM - The schema of the table, which may be @code{null}.
-
-@item
-TABLE_NAME - The name of the table.
-
-@item
-NON_UNIQUE - Are index values non-unique?
-
-@item
-INDEX_QUALIFIER The index catalog, which may be @code{null}
-
-@item
-INDEX_NAME - The name of the index.
-
-@item
-TYPE - The type of index, which will be one of the constants defined
- in this interface (@code{tableIndexStatistic},
- @code{tableIndexClustered}, @code{tableIndexHashed}, or
- @code{tableIndexOther}).
-
-@item
-ORDINAL_POSITION - The sequence number of this column in the index.
- This will be 0 when the index type is @code{tableIndexStatistic}.
-
-@item
-COLUMN_NAME - The name of this column in the index.
-
-@item
-ASC_OR_DESC - "A" for an ascending sort sequence, "D" for a
- descending sort sequence or @code{null} if a sort sequence is not
- supported.
-
-@item
-CARDINALITY - The number of unique rows in the index, or the number
- of rows in the table if the index type is @code{tableIndexStatistic}.
-
-@item
-PAGES - The number of pages used for the index, or the number of pages
- in the table if the index type is @code{tableIndexStatistic}.
-
-@item
-FILTER_CONDITION - The filter condition for this index, which may be
- @code{null}.
-
-@end itemize
-
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public boolean} supportsResultSetType (int@w{ }@var{type}) @*throws SQLException
-This method tests whether or not the datbase supports the specified
- result type.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public boolean} supportsResultSetConcurrency (int@w{ }@var{type}, int@w{ }@var{concur}) @*throws SQLException
-This method tests whether the specified result set type and result set
- concurrency type are supported by the database.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public boolean} ownUpdatesAreVisible (int@w{ }@var{type}) @*throws SQLException
-This method tests whether or not the specified result set type sees its
- own updates.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public boolean} ownDeletesAreVisible (int@w{ }@var{type}) @*throws SQLException
-This method tests whether or not the specified result set type sees its
- own deletes.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public boolean} ownInsertsAreVisible (int@w{ }@var{type}) @*throws SQLException
-This method tests whether or not the specified result set type sees its
- own inserts.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public boolean} othersUpdatesAreVisible (int@w{ }@var{type}) @*throws SQLException
-This method tests whether or not the specified result set type sees
- updates committed by others.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public boolean} othersDeletesAreVisible (int@w{ }@var{type}) @*throws SQLException
-This method tests whether or not the specified result set type sees
- deletes committed by others.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public boolean} othersInsertsAreVisible (int@w{ }@var{type}) @*throws SQLException
-This method tests whether or not the specified result set type sees
- inserts committed by others.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public boolean} updatesAreDetected (int@w{ }@var{type}) @*throws SQLException
-This method tests whether or not the specified result set type can detect
- a visible update by calling the @code{rowUpdated} method.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public boolean} deletesAreDetected (int@w{ }@var{type}) @*throws SQLException
-This method tests whether or not the specified result set type can detect
- a visible delete by calling the @code{rowUpdated} method.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public boolean} insertsAreDetected (int@w{ }@var{type}) @*throws SQLException
-This method tests whether or not the specified result set type can detect
- a visible insert by calling the @code{rowUpdated} method.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public boolean} supportsBatchUpdates () @*throws SQLException
-This method tests whether or not the database supports batch updates.
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public ResultSet} getUDTs (java.lang.String@w{ }@var{catalog}, java.lang.String@w{ }@var{schema}, java.lang.String@w{ }@var{typePattern}, int[]@w{ }@var{types}) @*throws SQLException
-This method returns the list of user defined data types in use. These
- are returned as a @code{ResultSet} with the following columns:
-
-
-
-
-@itemize @bullet
-
-
-@item
-TYPE_CAT - The catalog name, which may be @code{null}.
-
-@item
-TYPE_SCEHM - The schema name, which may be @code{null}.
-
-@item
-TYPE_NAME - The user defined data type name.
-
-@item
-CLASS_NAME - The Java class name this type maps to.
-
-@item
-DATA_TYPE - A type identifer from @code{Types} for this type.
- This will be one of @code{JAVA_OBJECT}, @code{STRUCT}, or
- @code{DISTINCT}.
-
-@item
-REMARKS - Comments about this data type.
-
-@end itemize
-
-@end deftypemethod
-@deftypemethod DatabaseMetaData {public Connection} getConnection () @*throws SQLException
-This method returns the @code{Connection} object that was used
- to generate the metadata in this object.
-@end deftypemethod
-@deftypemethod DataTruncation {public int} getIndex ()
-This method returns the index of the column or parameter that was
- truncated.
-@end deftypemethod
-@deftypemethod DataTruncation {public boolean} getParameter ()
-This method determines whether or not it was a parameter that was
- truncated.
-@end deftypemethod
-@deftypemethod DataTruncation {public boolean} getRead ()
-This method determines whether or not it was a column that was
- truncated.
-@end deftypemethod
-@deftypemethod DataTruncation {public int} getDataSize ()
-This method returns the original size of the parameter or column that
- was truncated.
-@end deftypemethod
-@deftypemethod DataTruncation {public int} getTransferSize ()
-This method returns the size of the parameter or column after it was
- truncated.
-@end deftypemethod
-@deftypemethod Date {public static Date} valueOf (java.lang.String@w{ }@var{str})
-This method returns a new instance of this class by parsing a
- date in JDBC format into a Java date.
-@end deftypemethod
-@deftypemethod Date {public String} toString ()
-This method returns this date in JDBC format.
-@end deftypemethod
-@deftypemethod Driver {public int} getMajorVersion ()
-This method returns the major version number of the driver.
-@end deftypemethod
-@deftypemethod Driver {public int} getMinorVersion ()
-This method returns the minor version number of the driver.
-@end deftypemethod
-@deftypemethod Driver {public boolean} jdbcCompliant ()
-This method tests whether or not the driver is JDBC compliant. This
- method should only return @code{true} if the driver has been
- certified as JDBC compliant.
-@end deftypemethod
-@deftypemethod Driver {public DriverPropertyInfo} getPropertyInfo (java.lang.String@w{ }@var{url}, java.util.Properties@w{ }@var{properties}) @*throws SQLException
-This method returns an array of possible properties that could be
- used to connect to the specified database.
-@end deftypemethod
-@deftypemethod Driver {public boolean} acceptsURL (java.lang.String@w{ }@var{url}) @*throws SQLException
-This method tests whether or not the driver believes it can connect to
- the specified database. The driver should only test whether it
- understands and accepts the URL. It should not necessarily attempt to
- probe the database for a connection.
-@end deftypemethod
-@deftypemethod Driver {public Connection} connect (java.lang.String@w{ }@var{url}, java.util.Properties@w{ }@var{properties}) @*throws SQLException
-This method connects to the specified database using the connection
- properties supplied. If the driver does not understand the database
- URL, it should return @code{null} instead of throwing an
- exception since the @code{DriverManager} will probe a driver
- in this manner.
-@end deftypemethod
-@deftypemethod DriverManager {public static int} getLoginTimeout ()
-This method returns the login timeout in use by JDBC drivers systemwide.
-@end deftypemethod
-@deftypemethod DriverManager {public static void} setLoginTimeout (int@w{ }@var{login_timeout})
-This method set the login timeout used by JDBC drivers. This is a
- system-wide parameter that applies to all drivers.
-@end deftypemethod
-@deftypemethod DriverManager {public static PrintWriter} getLogWriter ()
-This method returns the log writer being used by all JDBC drivers.
- This method should be used in place of the deprecated
- @code{getLogStream} method.
-@end deftypemethod
-@deftypemethod DriverManager {public static void} setLogWriter (java.io.PrintWriter@w{ }@var{log_writer})
-This method sets the log writer being used by JDBC drivers. This is a
- system-wide parameter that affects all drivers. Note that since there
- is no way to retrieve a @code{PrintStream} from a
- @code{PrintWriter}, this method cannot set the log stream in
- use by JDBC. Thus any older drivers may not see this setting.
-@end deftypemethod
-@deftypemethod DriverManager {public static PrintStream} getLogStream ()
-This method returns the log stream in use by JDBC.
-@end deftypemethod
-@deftypemethod DriverManager {public static void} setLogStream (java.io.PrintStream@w{ }@var{log_stream})
-This method sets the log stream in use by JDBC.
-@end deftypemethod
-@deftypemethod DriverManager {public static void} println (java.lang.String@w{ }@var{str})
-This method prints the specified line to the log stream.
-@end deftypemethod
-@deftypemethod DriverManager {public static void} registerDriver (java.sql.Driver@w{ }@var{driver}) @*throws SQLException
-This method registers a new driver with the manager. This is normally
- called by the driver itself in a static initializer.
-@end deftypemethod
-@deftypemethod DriverManager {public static void} deregisterDriver (java.sql.Driver@w{ }@var{driver}) @*throws SQLException
-This method de-registers a driver from the manager.
-@end deftypemethod
-@deftypemethod DriverManager {public static Enumeration} getDrivers ()
-This method returns a list of all the currently registered JDBC drivers
- that were loaded by the current @code{ClassLoader}.
-@end deftypemethod
-@deftypemethod DriverManager {public static Driver} getDriver (java.lang.String@w{ }@var{url}) @*throws SQLException
-This method returns a driver that can connect to the specified
- JDBC URL string. This will be selected from among drivers loaded
- at initialization time and those drivers manually loaded by the
- same class loader as the caller.
-@end deftypemethod
-@deftypemethod DriverManager {public static Connection} getConnection (java.lang.String@w{ }@var{url}) @*throws SQLException
-This method attempts to return a connection to the specified
- JDBC URL string.
-@end deftypemethod
-@deftypemethod DriverManager {public static Connection} getConnection (java.lang.String@w{ }@var{url}, java.lang.String@w{ }@var{user}, java.lang.String@w{ }@var{password}) @*throws SQLException
-This method attempts to return a connection to the specified
- JDBC URL string using the specified username and password.
-@end deftypemethod
-@deftypemethod DriverManager {public static Connection} getConnection (java.lang.String@w{ }@var{url}, java.util.Properties@w{ }@var{properties}) @*throws SQLException
-This method attempts to return a connection to the specified
- JDBC URL string using the specified connection properties.
-@end deftypemethod
-@deftypemethod PreparedStatement {public void} setNull (int@w{ }@var{index}, int@w{ }@var{type}) @*throws SQLException
-This method populates the specified parameter with a SQL NULL value
- for the specified type.
-@end deftypemethod
-@deftypemethod PreparedStatement {public void} setNull (int@w{ }@var{index}, int@w{ }@var{type}, java.lang.String@w{ }@var{name}) @*throws SQLException
-This method populates the specified parameter with a SQL NULL value
- for the specified type.
-@end deftypemethod
-@deftypemethod PreparedStatement {public void} setBoolean (int@w{ }@var{index}, boolean@w{ }@var{value}) @*throws SQLException
-This method sets the specified parameter from the given Java
- @code{boolean} value.
-@end deftypemethod
-@deftypemethod PreparedStatement {public void} setByte (int@w{ }@var{index}, byte@w{ }@var{value}) @*throws SQLException
-This method sets the specified parameter from the given Java
- @code{byte} value.
-@end deftypemethod
-@deftypemethod PreparedStatement {public void} setShort (int@w{ }@var{index}, short@w{ }@var{value}) @*throws SQLException
-This method sets the specified parameter from the given Java
- @code{short} value.
-@end deftypemethod
-@deftypemethod PreparedStatement {public void} setInt (int@w{ }@var{index}, int@w{ }@var{value}) @*throws SQLException
-This method sets the specified parameter from the given Java
- @code{int} value.
-@end deftypemethod
-@deftypemethod PreparedStatement {public void} setLong (int@w{ }@var{index}, long@w{ }@var{value}) @*throws SQLException
-This method sets the specified parameter from the given Java
- @code{long} value.
-@end deftypemethod
-@deftypemethod PreparedStatement {public void} setFloat (int@w{ }@var{index}, float@w{ }@var{value}) @*throws SQLException
-This method sets the specified parameter from the given Java
- @code{float} value.
-@end deftypemethod
-@deftypemethod PreparedStatement {public void} setDouble (int@w{ }@var{index}, double@w{ }@var{value}) @*throws SQLException
-This method sets the specified parameter from the given Java
- @code{double} value.
-@end deftypemethod
-@deftypemethod PreparedStatement {public void} setString (int@w{ }@var{index}, java.lang.String@w{ }@var{value}) @*throws SQLException
-This method sets the specified parameter from the given Java
- @code{String} value.
-@end deftypemethod
-@deftypemethod PreparedStatement {public void} setBytes (int@w{ }@var{index}, byte[]@w{ }@var{value}) @*throws SQLException
-This method sets the specified parameter from the given Java
- @code{byte} array value.
-@end deftypemethod
-@deftypemethod PreparedStatement {public void} setBigDecimal (int@w{ }@var{index}, java.math.BigDecimal@w{ }@var{value}) @*throws SQLException
-This method sets the specified parameter from the given Java
- @code{java.math.BigDecimal} value.
-@end deftypemethod
-@deftypemethod PreparedStatement {public void} setDate (int@w{ }@var{index}, java.sql.Date@w{ }@var{value}) @*throws SQLException
-This method sets the specified parameter from the given Java
- @code{java.sql.Date} value.
-@end deftypemethod
-@deftypemethod PreparedStatement {public void} setDate (int@w{ }@var{index}, java.sql.Date@w{ }@var{value}, java.util.Calendar@w{ }@var{calendar}) @*throws SQLException
-This method sets the specified parameter from the given Java
- @code{java.sql.Date} value.
-@end deftypemethod
-@deftypemethod PreparedStatement {public void} setTime (int@w{ }@var{index}, java.sql.Time@w{ }@var{value}) @*throws SQLException
-This method sets the specified parameter from the given Java
- @code{java.sql.Time} value.
-@end deftypemethod
-@deftypemethod PreparedStatement {public void} setTime (int@w{ }@var{index}, java.sql.Time@w{ }@var{value}, java.util.Calendar@w{ }@var{calendar}) @*throws SQLException
-This method sets the specified parameter from the given Java
- @code{java.sql.Time} value.
-@end deftypemethod
-@deftypemethod PreparedStatement {public void} setTimestamp (int@w{ }@var{index}, java.sql.Timestamp@w{ }@var{value}) @*throws SQLException
-This method sets the specified parameter from the given Java
- @code{java.sql.Timestamp} value.
-@end deftypemethod
-@deftypemethod PreparedStatement {public void} setTimestamp (int@w{ }@var{index}, java.sql.Timestamp@w{ }@var{value}, java.util.Calendar@w{ }@var{calendar}) @*throws SQLException
-This method sets the specified parameter from the given Java
- @code{java.sql.Timestamp} value.
-@end deftypemethod
-@deftypemethod PreparedStatement {public void} setAsciiStream (int@w{ }@var{index}, java.io.InputStream@w{ }@var{value}, int@w{ }@var{length}) @*throws SQLException
-This method sets the specified parameter from the given Java
- ASCII @code{InputStream} value.
-@end deftypemethod
-@deftypemethod PreparedStatement {public void} setUnicodeStream (int@w{ }@var{index}, java.io.InputStream@w{ }@var{value}, int@w{ }@var{length}) @*throws SQLException
-This method sets the specified parameter from the given Java
- Unicode UTF-8 @code{InputStream} value.
-@end deftypemethod
-@deftypemethod PreparedStatement {public void} setBinaryStream (int@w{ }@var{index}, java.io.InputStream@w{ }@var{value}, int@w{ }@var{length}) @*throws SQLException
-This method sets the specified parameter from the given Java
- binary @code{InputStream} value.
-@end deftypemethod
-@deftypemethod PreparedStatement {public void} setCharacterStream (int@w{ }@var{index}, java.io.Reader@w{ }@var{value}, int@w{ }@var{length}) @*throws SQLException
-This method sets the specified parameter from the given Java
- character @code{Reader} value.
-@end deftypemethod
-@deftypemethod PreparedStatement {public void} setRef (int@w{ }@var{index}, java.sql.Ref@w{ }@var{value}) @*throws SQLException
-This method sets the specified parameter from the given Java
- @code{Ref} value. The default object type to SQL type mapping
- will be used.
-@end deftypemethod
-@deftypemethod PreparedStatement {public void} setBlob (int@w{ }@var{index}, java.sql.Blob@w{ }@var{value}) @*throws SQLException
-This method sets the specified parameter from the given Java
- @code{Blob} value. The default object type to SQL type mapping
- will be used.
-@end deftypemethod
-@deftypemethod PreparedStatement {public void} setClob (int@w{ }@var{index}, java.sql.Clob@w{ }@var{value}) @*throws SQLException
-This method sets the specified parameter from the given Java
- @code{Clob} value. The default object type to SQL type mapping
- will be used.
-@end deftypemethod
-@deftypemethod PreparedStatement {public void} setArray (int@w{ }@var{index}, java.sql.Array@w{ }@var{value}) @*throws SQLException
-This method sets the specified parameter from the given Java
- @code{Array} value. The default object type to SQL type mapping
- will be used.
-@end deftypemethod
-@deftypemethod PreparedStatement {public void} setObject (int@w{ }@var{index}, java.lang.Object@w{ }@var{value}) @*throws SQLException
-This method sets the specified parameter from the given Java
- @code{Object} value. The default object type to SQL type mapping
- will be used.
-@end deftypemethod
-@deftypemethod PreparedStatement {public void} setObject (int@w{ }@var{index}, java.lang.Object@w{ }@var{value}, int@w{ }@var{type}) @*throws SQLException
-This method sets the specified parameter from the given Java
- @code{Object} value. The specified SQL object type will be used.
-@end deftypemethod
-@deftypemethod PreparedStatement {public void} setObject (int@w{ }@var{index}, java.lang.Object@w{ }@var{value}, int@w{ }@var{type}, int@w{ }@var{scale}) @*throws SQLException
-This method sets the specified parameter from the given Java
- @code{Object} value. The specified SQL object type will be used.
-@end deftypemethod
-@deftypemethod PreparedStatement {public void} addBatch () @*throws SQLException
-This method adds a set of parameters to the batch for JDBC 2.0.
-@end deftypemethod
-@deftypemethod PreparedStatement {public void} clearParameters () @*throws SQLException
-This method clears all of the input parameter that have been
- set on this statement.
-@end deftypemethod
-@deftypemethod PreparedStatement {public ResultSetMetaData} getMetaData () @*throws SQLException
-This method returns meta data for the result set from this statement.
-@end deftypemethod
-@deftypemethod PreparedStatement {public boolean} execute () @*throws SQLException
-This method executes a prepared SQL query.
- Some prepared statements return multiple results; the execute method
- handles these complex statements as well as the simpler form of
- statements handled by executeQuery and executeUpdate.
-@end deftypemethod
-@deftypemethod PreparedStatement {public ResultSet} executeQuery () @*throws SQLException
-This method executes a prepared SQL query and returns its ResultSet.
-@end deftypemethod
-@deftypemethod PreparedStatement {public int} executeUpdate () @*throws SQLException
-This method executes an SQL INSERT, UPDATE or DELETE statement. SQL
- statements that return nothing such as SQL DDL statements can be executed.
-@end deftypemethod
-@deftypemethod Ref {public String} getBaseTypeName () @*throws SQLException
-This method returns the fully qualified name of the SQL structured
- type of the referenced item.
-@end deftypemethod
-@deftypemethod ResultSet {public boolean} next () @*throws SQLException
-This method advances to the next row in the result set. Any streams
- open on the current row are closed automatically.
-@end deftypemethod
-@deftypemethod ResultSet {public boolean} previous () @*throws SQLException
-This method moves the current position to the previous row in the
- result set.
-@end deftypemethod
-@deftypemethod ResultSet {public void} close () @*throws SQLException
-This method closes the result set and frees any associated resources.
-@end deftypemethod
-@deftypemethod ResultSet {public boolean} wasNull () @*throws SQLException
-This method tests whether the value of the last column that was fetched
- was actually a SQL NULL value.
-@end deftypemethod
-@deftypemethod ResultSet {public String} getString (int@w{ }@var{index}) @*throws SQLException
-This method returns the value of the specified column as a Java
- @code{String}.
-@end deftypemethod
-@deftypemethod ResultSet {public Object} getObject (int@w{ }@var{index}) @*throws SQLException
-This method returns the value of the specified column as a Java
- @code{Object}.
-@end deftypemethod
-@deftypemethod ResultSet {public boolean} getBoolean (int@w{ }@var{index}) @*throws SQLException
-This method returns the value of the specified column as a Java
- @code{boolean}.
-@end deftypemethod
-@deftypemethod ResultSet {public byte} getByte (int@w{ }@var{index}) @*throws SQLException
-This method returns the value of the specified column as a Java
- @code{byte}.
-@end deftypemethod
-@deftypemethod ResultSet {public short} getShort (int@w{ }@var{index}) @*throws SQLException
-This method returns the value of the specified column as a Java
- @code{short}.
-@end deftypemethod
-@deftypemethod ResultSet {public int} getInt (int@w{ }@var{index}) @*throws SQLException
-This method returns the value of the specified column as a Java
- @code{int}.
-@end deftypemethod
-@deftypemethod ResultSet {public long} getLong (int@w{ }@var{index}) @*throws SQLException
-This method returns the value of the specified column as a Java
- @code{long}.
-@end deftypemethod
-@deftypemethod ResultSet {public float} getFloat (int@w{ }@var{index}) @*throws SQLException
-This method returns the value of the specified column as a Java
- @code{float}.
-@end deftypemethod
-@deftypemethod ResultSet {public double} getDouble (int@w{ }@var{index}) @*throws SQLException
-This method returns the value of the specified column as a Java
- @code{double}.
-@end deftypemethod
-@deftypemethod ResultSet {public BigDecimal} getBigDecimal (int@w{ }@var{index}) @*throws SQLException
-This method returns the value of the specified column as a Java
- @code{BigDecimal}.
-@end deftypemethod
-@deftypemethod ResultSet {public BigDecimal} getBigDecimal (int@w{ }@var{index}, int@w{ }@var{scale}) @*throws SQLException
-This method returns the value of the specified column as a Java
- @code{BigDecimal}.
-@end deftypemethod
-@deftypemethod ResultSet {public byte} getBytes (int@w{ }@var{index}) @*throws SQLException
-This method returns the value of the specified column as a Java
- byte array.
-@end deftypemethod
-@deftypemethod ResultSet {public Date} getDate (int@w{ }@var{index}) @*throws SQLException
-This method returns the value of the specified column as a Java
- @code{java.sql.Date}.
-@end deftypemethod
-@deftypemethod ResultSet {public Time} getTime (int@w{ }@var{index}) @*throws SQLException
-This method returns the value of the specified column as a Java
- @code{java.sql.Time}.
-@end deftypemethod
-@deftypemethod ResultSet {public Timestamp} getTimestamp (int@w{ }@var{index}) @*throws SQLException
-This method returns the value of the specified column as a Java
- @code{java.sql.Timestamp}.
-@end deftypemethod
-@deftypemethod ResultSet {public InputStream} getAsciiStream (int@w{ }@var{index}) @*throws SQLException
-This method returns the value of the specified column as an ASCII
- stream. Note that all the data from this stream must be read before
- fetching the value of any other column. Please also be aware that
- calling @code{next()} or @code{close()} on this result set
- will close this stream as well.
-@end deftypemethod
-@deftypemethod ResultSet {public InputStream} getUnicodeStream (int@w{ }@var{index}) @*throws SQLException
-This method returns the value of the specified column as a Unicode UTF-8
- stream. Note that all the data from this stream must be read before
- fetching the value of any other column. Please also be aware that
- calling @code{next()} or @code{close()} on this result set
- will close this stream as well.
-@end deftypemethod
-@deftypemethod ResultSet {public InputStream} getBinaryStream (int@w{ }@var{index}) @*throws SQLException
-This method returns the value of the specified column as a raw byte
- stream. Note that all the data from this stream must be read before
- fetching the value of any other column. Please also be aware that
- calling @code{next()} or @code{close()} on this result set
- will close this stream as well.
-@end deftypemethod
-@deftypemethod ResultSet {public Reader} getCharacterStream (int@w{ }@var{index}) @*throws SQLException
-This method returns the value of the specified column as a character
- stream. Note that all the data from this stream must be read before
- fetching the value of any other column. Please also be aware that
- calling @code{next()} or @code{close()} on this result set
- will close this stream as well.
-@end deftypemethod
-@deftypemethod ResultSet {public String} getString (java.lang.String@w{ }@var{column}) @*throws SQLException
-This method returns the value of the specified column as a Java
- @code{String}.
-@end deftypemethod
-@deftypemethod ResultSet {public Object} getObject (java.lang.String@w{ }@var{column}) @*throws SQLException
-This method returns the value of the specified column as a Java
- @code{Object}.
-@end deftypemethod
-@deftypemethod ResultSet {public boolean} getBoolean (java.lang.String@w{ }@var{column}) @*throws SQLException
-This method returns the value of the specified column as a Java
- @code{boolean}.
-@end deftypemethod
-@deftypemethod ResultSet {public byte} getByte (java.lang.String@w{ }@var{column}) @*throws SQLException
-This method returns the value of the specified column as a Java
- @code{byte}.
-@end deftypemethod
-@deftypemethod ResultSet {public short} getShort (java.lang.String@w{ }@var{column}) @*throws SQLException
-This method returns the value of the specified column as a Java
- @code{short}.
-@end deftypemethod
-@deftypemethod ResultSet {public int} getInt (java.lang.String@w{ }@var{column}) @*throws SQLException
-This method returns the value of the specified column as a Java
- @code{int}.
-@end deftypemethod
-@deftypemethod ResultSet {public long} getLong (java.lang.String@w{ }@var{column}) @*throws SQLException
-This method returns the value of the specified column as a Java
- @code{long}.
-@end deftypemethod
-@deftypemethod ResultSet {public float} getFloat (java.lang.String@w{ }@var{column}) @*throws SQLException
-This method returns the value of the specified column as a Java
- @code{float}.
-@end deftypemethod
-@deftypemethod ResultSet {public double} getDouble (java.lang.String@w{ }@var{column}) @*throws SQLException
-This method returns the value of the specified column as a Java
- @code{double}.
-@end deftypemethod
-@deftypemethod ResultSet {public BigDecimal} getBigDecimal (java.lang.String@w{ }@var{column}) @*throws SQLException
-This method returns the value of the specified column as a Java
- @code{BigDecimal}.
-@end deftypemethod
-@deftypemethod ResultSet {public BigDecimal} getBigDecimal (java.lang.String@w{ }@var{column}, int@w{ }@var{scale}) @*throws SQLException
-This method returns the value of the specified column as a Java
- @code{BigDecimal}.
-@end deftypemethod
-@deftypemethod ResultSet {public byte} getBytes (java.lang.String@w{ }@var{column}) @*throws SQLException
-This method returns the value of the specified column as a Java
- byte array.
-@end deftypemethod
-@deftypemethod ResultSet {public Date} getDate (java.lang.String@w{ }@var{column}) @*throws SQLException
-This method returns the value of the specified column as a Java
- @code{java.sql.Date}.
-@end deftypemethod
-@deftypemethod ResultSet {public Time} getTime (java.lang.String@w{ }@var{column}) @*throws SQLException
-This method returns the value of the specified column as a Java
- @code{java.sql.Time}.
-@end deftypemethod
-@deftypemethod ResultSet {public Timestamp} getTimestamp (java.lang.String@w{ }@var{column}) @*throws SQLException
-This method returns the value of the specified column as a Java
- @code{java.sql.Timestamp}.
-@end deftypemethod
-@deftypemethod ResultSet {public InputStream} getAsciiStream (java.lang.String@w{ }@var{column}) @*throws SQLException
-This method returns the value of the specified column as an ASCII
- stream. Note that all the data from this stream must be read before
- fetching the value of any other column. Please also be aware that
- calling @code{next()} or @code{close()} on this result set
- will close this stream as well.
-@end deftypemethod
-@deftypemethod ResultSet {public InputStream} getUnicodeStream (java.lang.String@w{ }@var{column}) @*throws SQLException
-This method returns the value of the specified column as a Unicode UTF-8
- stream. Note that all the data from this stream must be read before
- fetching the value of any other column. Please also be aware that
- calling @code{next()} or @code{close()} on this result set
- will close this stream as well.
-@end deftypemethod
-@deftypemethod ResultSet {public InputStream} getBinaryStream (java.lang.String@w{ }@var{column}) @*throws SQLException
-This method returns the value of the specified column as a raw byte
- stream. Note that all the data from this stream must be read before
- fetching the value of any other column. Please also be aware that
- calling @code{next()} or @code{close()} on this result set
- will close this stream as well.
-@end deftypemethod
-@deftypemethod ResultSet {public Reader} getCharacterStream (java.lang.String@w{ }@var{column}) @*throws SQLException
-This method returns the value of the specified column as a character
- stream. Note that all the data from this stream must be read before
- fetching the value of any other column. Please also be aware that
- calling @code{next()} or @code{close()} on this result set
- will close this stream as well.
-@end deftypemethod
-@deftypemethod ResultSet {public SQLWarning} getWarnings () @*throws SQLException
-This method returns the first SQL warning associated with this result
- set. Any additional warnings will be chained to this one.
-@end deftypemethod
-@deftypemethod ResultSet {public void} clearWarnings () @*throws SQLException
-This method clears all warnings associated with this result set.
-@end deftypemethod
-@deftypemethod ResultSet {public String} getCursorName () @*throws SQLException
-This method returns the name of the database cursor used by this
- result set.
-@end deftypemethod
-@deftypemethod ResultSet {public ResultSetMetaData} getMetaData () @*throws SQLException
-This method returns data about the columns returned as part of the
- result set as a @code{ResultSetMetaData} instance.
-@end deftypemethod
-@deftypemethod ResultSet {public int} findColumn (java.lang.String@w{ }@var{column}) @*throws SQLException
-This method returns the column index of the specified named column.
-@end deftypemethod
-@deftypemethod ResultSet {public boolean} isBeforeFirst () @*throws SQLException
-This method tests whether or not the cursor is before the first row
- in the result set.
-@end deftypemethod
-@deftypemethod ResultSet {public boolean} isAfterLast () @*throws SQLException
-This method tests whether or not the cursor is after the last row
- in the result set.
-@end deftypemethod
-@deftypemethod ResultSet {public boolean} isFirst () @*throws SQLException
-This method tests whether or not the cursor is positioned on the first
- row in the result set.
-@end deftypemethod
-@deftypemethod ResultSet {public boolean} isLast () @*throws SQLException
-This method tests whether or not the cursor is on the last row
- in the result set.
-@end deftypemethod
-@deftypemethod ResultSet {public void} beforeFirst () @*throws SQLException
-This method repositions the cursor to before the first row in the
- result set.
-@end deftypemethod
-@deftypemethod ResultSet {public void} afterLast () @*throws SQLException
-This method repositions the cursor to after the last row in the result
- set.
-@end deftypemethod
-@deftypemethod ResultSet {public boolean} first () @*throws SQLException
-This method repositions the cursor on the first row in the
- result set.
-@end deftypemethod
-@deftypemethod ResultSet {public boolean} last () @*throws SQLException
-This method repositions the cursor on the last row in the result
- set.
-@end deftypemethod
-@deftypemethod ResultSet {public int} getRow () @*throws SQLException
-This method returns the current row number in the cursor. Numbering
- begins at index 1.
-@end deftypemethod
-@deftypemethod ResultSet {public boolean} absolute (int@w{ }@var{row}) @*throws SQLException
-This method positions the result set to the specified absolute row.
- Positive numbers are row offsets from the beginning of the result
- set (numbering starts from row 1) and negative numbers are row offsets
- from the end of the result set (numbering starts from -1).
-@end deftypemethod
-@deftypemethod ResultSet {public boolean} relative (int@w{ }@var{row}) @*throws SQLException
-This method moves the result set position relative to the current row.
- The offset can be positive or negative.
-@end deftypemethod
-@deftypemethod ResultSet {public void} setFetchDirection (int@w{ }@var{direction}) @*throws SQLException
-This method provides a hint to the driver about which direction the
- result set will be processed in.
-@end deftypemethod
-@deftypemethod ResultSet {public int} getFetchDirection () @*throws SQLException
-This method returns the current fetch direction for this result set.
-@end deftypemethod
-@deftypemethod ResultSet {public void} setFetchSize (int@w{ }@var{rows}) @*throws SQLException
-This method provides a hint to the driver about how many rows at a
- time it should fetch from the database.
-@end deftypemethod
-@deftypemethod ResultSet {public int} getFetchSize () @*throws SQLException
-This method returns the current number of rows that will be fetched
- from the database at a time.
-@end deftypemethod
-@deftypemethod ResultSet {public int} getType () @*throws SQLException
-This method returns the result set type of this result set. This will
- be one of the TYPE_* constants defined in this interface.
-@end deftypemethod
-@deftypemethod ResultSet {public int} getConcurrency () @*throws SQLException
-This method returns the concurrency type of this result set. This will
- be one of the CONCUR_* constants defined in this interface.
-@end deftypemethod
-@deftypemethod ResultSet {public boolean} rowUpdated () @*throws SQLException
-This method tests whether or not the current row in the result set
- has been updated. Updates must be visible in order of this method to
- detect the update.
-@end deftypemethod
-@deftypemethod ResultSet {public boolean} rowInserted () @*throws SQLException
-This method tests whether or not the current row in the result set
- has been inserted. Inserts must be visible in order of this method to
- detect the insert.
-@end deftypemethod
-@deftypemethod ResultSet {public boolean} rowDeleted () @*throws SQLException
-This method tests whether or not the current row in the result set
- has been deleted. Deletes must be visible in order of this method to
- detect the deletion.
-@end deftypemethod
-@deftypemethod ResultSet {public void} updateNull (int@w{ }@var{index}) @*throws SQLException
-This method updates the specified column to have a NULL value. This
- does not update the actual database. @code{updateRow} must be
- called in order to do that.
-@end deftypemethod
-@deftypemethod ResultSet {public void} updateBoolean (int@w{ }@var{index}, boolean@w{ }@var{value}) @*throws SQLException
-This method updates the specified column to have a boolean value. This
- does not update the actual database. @code{updateRow} must be
- called in order to do that.
-@end deftypemethod
-@deftypemethod ResultSet {public void} updateByte (int@w{ }@var{index}, byte@w{ }@var{value}) @*throws SQLException
-This method updates the specified column to have a byte value. This
- does not update the actual database. @code{updateRow} must be
- called in order to do that.
-@end deftypemethod
-@deftypemethod ResultSet {public void} updateShort (int@w{ }@var{index}, short@w{ }@var{value}) @*throws SQLException
-This method updates the specified column to have a short value. This
- does not update the actual database. @code{updateRow} must be
- called in order to do that.
-@end deftypemethod
-@deftypemethod ResultSet {public void} updateInt (int@w{ }@var{index}, int@w{ }@var{value}) @*throws SQLException
-This method updates the specified column to have an int value. This
- does not update the actual database. @code{updateRow} must be
- called in order to do that.
-@end deftypemethod
-@deftypemethod ResultSet {public void} updateLong (int@w{ }@var{index}, long@w{ }@var{value}) @*throws SQLException
-This method updates the specified column to have a long value. This
- does not update the actual database. @code{updateRow} must be
- called in order to do that.
-@end deftypemethod
-@deftypemethod ResultSet {public void} updateFloat (int@w{ }@var{index}, float@w{ }@var{value}) @*throws SQLException
-This method updates the specified column to have a float value. This
- does not update the actual database. @code{updateRow} must be
- called in order to do that.
-@end deftypemethod
-@deftypemethod ResultSet {public void} updateDouble (int@w{ }@var{index}, double@w{ }@var{value}) @*throws SQLException
-This method updates the specified column to have a double value. This
- does not update the actual database. @code{updateRow} must be
- called in order to do that.
-@end deftypemethod
-@deftypemethod ResultSet {public void} updateBigDecimal (int@w{ }@var{index}, java.math.BigDecimal@w{ }@var{value}) @*throws SQLException
-This method updates the specified column to have a BigDecimal value. This
- does not update the actual database. @code{updateRow} must be
- called in order to do that.
-@end deftypemethod
-@deftypemethod ResultSet {public void} updateString (int@w{ }@var{index}, java.lang.String@w{ }@var{value}) @*throws SQLException
-This method updates the specified column to have a String value. This
- does not update the actual database. @code{updateRow} must be
- called in order to do that.
-@end deftypemethod
-@deftypemethod ResultSet {public void} updateBytes (int@w{ }@var{index}, byte[]@w{ }@var{value}) @*throws SQLException
-This method updates the specified column to have a byte array value. This
- does not update the actual database. @code{updateRow} must be
- called in order to do that.
-@end deftypemethod
-@deftypemethod ResultSet {public void} updateDate (int@w{ }@var{index}, java.sql.Date@w{ }@var{value}) @*throws SQLException
-This method updates the specified column to have a java.sql.Date value. This
- does not update the actual database. @code{updateRow} must be
- called in order to do that.
-@end deftypemethod
-@deftypemethod ResultSet {public void} updateTime (int@w{ }@var{index}, java.sql.Time@w{ }@var{value}) @*throws SQLException
-This method updates the specified column to have a java.sql.Time value. This
- does not update the actual database. @code{updateRow} must be
- called in order to do that.
-@end deftypemethod
-@deftypemethod ResultSet {public void} updateTimestamp (int@w{ }@var{index}, java.sql.Timestamp@w{ }@var{value}) @*throws SQLException
-This method updates the specified column to have a java.sql.Timestamp value.
- This does not update the actual database. @code{updateRow} must be
- called in order to do that.
-@end deftypemethod
-@deftypemethod ResultSet {public void} updateAsciiStream (int@w{ }@var{index}, java.io.InputStream@w{ }@var{value}, int@w{ }@var{length}) @*throws SQLException
-This method updates the specified column from an ASCII text stream.
- This does not update the actual database. @code{updateRow} must be
- called in order to do that.
-@end deftypemethod
-@deftypemethod ResultSet {public void} updateBinaryStream (int@w{ }@var{index}, java.io.InputStream@w{ }@var{value}, int@w{ }@var{length}) @*throws SQLException
-This method updates the specified column from a binary stream.
- This does not update the actual database. @code{updateRow} must be
- called in order to do that.
-@end deftypemethod
-@deftypemethod ResultSet {public void} updateCharacterStream (int@w{ }@var{index}, java.io.Reader@w{ }@var{value}, int@w{ }@var{length}) @*throws SQLException
-This method updates the specified column from a character stream.
- This does not update the actual database. @code{updateRow} must be
- called in order to do that.
-@end deftypemethod
-@deftypemethod ResultSet {public void} updateObject (int@w{ }@var{index}, java.lang.Object@w{ }@var{value}) @*throws SQLException
-This method updates the specified column to have an Object value.
- This does not update the actual database. @code{updateRow} must be
- called in order to do that.
-@end deftypemethod
-@deftypemethod ResultSet {public void} updateObject (int@w{ }@var{index}, java.lang.Object@w{ }@var{value}, int@w{ }@var{scale}) @*throws SQLException
-This method updates the specified column to have an Object value.
- This does not update the actual database. @code{updateRow} must be
- called in order to do that.
-@end deftypemethod
-@deftypemethod ResultSet {public void} updateNull (java.lang.String@w{ }@var{name}) @*throws SQLException
-This method updates the specified column to have a NULL value. This
- does not update the actual database. @code{updateRow} must be
- called in order to do that.
-@end deftypemethod
-@deftypemethod ResultSet {public void} updateBoolean (java.lang.String@w{ }@var{name}, boolean@w{ }@var{value}) @*throws SQLException
-This method updates the specified column to have a boolean value. This
- does not update the actual database. @code{updateRow} must be
- called in order to do that.
-@end deftypemethod
-@deftypemethod ResultSet {public void} updateByte (java.lang.String@w{ }@var{name}, byte@w{ }@var{value}) @*throws SQLException
-This method updates the specified column to have a byte value. This
- does not update the actual database. @code{updateRow} must be
- called in order to do that.
-@end deftypemethod
-@deftypemethod ResultSet {public void} updateShort (java.lang.String@w{ }@var{name}, short@w{ }@var{value}) @*throws SQLException
-This method updates the specified column to have a short value. This
- does not update the actual database. @code{updateRow} must be
- called in order to do that.
-@end deftypemethod
-@deftypemethod ResultSet {public void} updateInt (java.lang.String@w{ }@var{name}, int@w{ }@var{value}) @*throws SQLException
-This method updates the specified column to have an int value. This
- does not update the actual database. @code{updateRow} must be
- called in order to do that.
-@end deftypemethod
-@deftypemethod ResultSet {public void} updateLong (java.lang.String@w{ }@var{name}, long@w{ }@var{value}) @*throws SQLException
-This method updates the specified column to have a long value. This
- does not update the actual database. @code{updateRow} must be
- called in order to do that.
-@end deftypemethod
-@deftypemethod ResultSet {public void} updateFloat (java.lang.String@w{ }@var{name}, float@w{ }@var{value}) @*throws SQLException
-This method updates the specified column to have a float value. This
- does not update the actual database. @code{updateRow} must be
- called in order to do that.
-@end deftypemethod
-@deftypemethod ResultSet {public void} updateDouble (java.lang.String@w{ }@var{name}, double@w{ }@var{value}) @*throws SQLException
-This method updates the specified column to have a double value. This
- does not update the actual database. @code{updateRow} must be
- called in order to do that.
-@end deftypemethod
-@deftypemethod ResultSet {public void} updateBigDecimal (java.lang.String@w{ }@var{name}, java.math.BigDecimal@w{ }@var{value}) @*throws SQLException
-This method updates the specified column to have a BigDecimal value. This
- does not update the actual database. @code{updateRow} must be
- called in order to do that.
-@end deftypemethod
-@deftypemethod ResultSet {public void} updateString (java.lang.String@w{ }@var{name}, java.lang.String@w{ }@var{value}) @*throws SQLException
-This method updates the specified column to have a String value. This
- does not update the actual database. @code{updateRow} must be
- called in order to do that.
-@end deftypemethod
-@deftypemethod ResultSet {public void} updateBytes (java.lang.String@w{ }@var{name}, byte[]@w{ }@var{value}) @*throws SQLException
-This method updates the specified column to have a byte array value. This
- does not update the actual database. @code{updateRow} must be
- called in order to do that.
-@end deftypemethod
-@deftypemethod ResultSet {public void} updateDate (java.lang.String@w{ }@var{name}, java.sql.Date@w{ }@var{value}) @*throws SQLException
-This method updates the specified column to have a java.sql.Date value. This
- does not update the actual database. @code{updateRow} must be
- called in order to do that.
-@end deftypemethod
-@deftypemethod ResultSet {public void} updateTime (java.lang.String@w{ }@var{name}, java.sql.Time@w{ }@var{value}) @*throws SQLException
-This method updates the specified column to have a java.sql.Time value. This
- does not update the actual database. @code{updateRow} must be
- called in order to do that.
-@end deftypemethod
-@deftypemethod ResultSet {public void} updateTimestamp (java.lang.String@w{ }@var{name}, java.sql.Timestamp@w{ }@var{value}) @*throws SQLException
-This method updates the specified column to have a java.sql.Timestamp value.
- This does not update the actual database. @code{updateRow} must be
- called in order to do that.
-@end deftypemethod
-@deftypemethod ResultSet {public void} updateAsciiStream (java.lang.String@w{ }@var{name}, java.io.InputStream@w{ }@var{value}, int@w{ }@var{length}) @*throws SQLException
-This method updates the specified column from an ASCII text stream.
- This does not update the actual database. @code{updateRow} must be
- called in order to do that.
-@end deftypemethod
-@deftypemethod ResultSet {public void} updateBinaryStream (java.lang.String@w{ }@var{name}, java.io.InputStream@w{ }@var{value}, int@w{ }@var{length}) @*throws SQLException
-This method updates the specified column from a binary stream.
- This does not update the actual database. @code{updateRow} must be
- called in order to do that.
-@end deftypemethod
-@deftypemethod ResultSet {public void} updateCharacterStream (java.lang.String@w{ }@var{name}, java.io.Reader@w{ }@var{value}, int@w{ }@var{length}) @*throws SQLException
-This method updates the specified column from a character stream.
- This does not update the actual database. @code{updateRow} must be
- called in order to do that.
-@end deftypemethod
-@deftypemethod ResultSet {public void} updateObject (java.lang.String@w{ }@var{name}, java.lang.Object@w{ }@var{value}) @*throws SQLException
-This method updates the specified column to have an Object value.
- This does not update the actual database. @code{updateRow} must be
- called in order to do that.
-@end deftypemethod
-@deftypemethod ResultSet {public void} updateObject (java.lang.String@w{ }@var{name}, java.lang.Object@w{ }@var{value}, int@w{ }@var{scale}) @*throws SQLException
-This method updates the specified column to have an Object value.
- This does not update the actual database. @code{updateRow} must be
- called in order to do that.
-@end deftypemethod
-@deftypemethod ResultSet {public void} insertRow () @*throws SQLException
-This method inserts the current row into the database. The result set
- must be positioned on the insert row in order to call this method
- successfully.
-@end deftypemethod
-@deftypemethod ResultSet {public void} updateRow () @*throws SQLException
-This method updates the current row in the database.
-@end deftypemethod
-@deftypemethod ResultSet {public void} deleteRow () @*throws SQLException
-This method deletes the current row in the database.
-@end deftypemethod
-@deftypemethod ResultSet {public void} refreshRow () @*throws SQLException
-This method refreshes the contents of the current row from the database.
-@end deftypemethod
-@deftypemethod ResultSet {public void} cancelRowUpdates () @*throws SQLException
-This method cancels any changes that have been made to a row. If
- the @code{rowUpdate} method has been called, then the changes
- cannot be undone.
-@end deftypemethod
-@deftypemethod ResultSet {public void} moveToInsertRow () @*throws SQLException
-This method positions the result set to the "insert row", which allows
- a new row to be inserted into the database from the result set.
-@end deftypemethod
-@deftypemethod ResultSet {public void} moveToCurrentRow () @*throws SQLException
-This method moves the result set position from the insert row back to
- the current row that was selected prior to moving to the insert row.
-@end deftypemethod
-@deftypemethod ResultSet {public Statement} getStatement () @*throws SQLException
-This method returns a the @code{Statement} that was used to
- produce this result set.
-@end deftypemethod
-@deftypemethod ResultSet {public Object} getObject (int@w{ }@var{index}, java.util.Map@w{ }@var{map}) @*throws SQLException
-This method returns the value of the specified column as a Java
- @code{Object} using the specified SQL type to Java type map.
-@end deftypemethod
-@deftypemethod ResultSet {public Ref} getRef (int@w{ }@var{index}) @*throws SQLException
-This method returns a @code{Ref} for the specified column which
- represents the structured type for the column.
-@end deftypemethod
-@deftypemethod ResultSet {public Blob} getBlob (int@w{ }@var{index}) @*throws SQLException
-This method returns the specified column value as a BLOB.
-@end deftypemethod
-@deftypemethod ResultSet {public Clob} getClob (int@w{ }@var{index}) @*throws SQLException
-This method returns the specified column value as a CLOB.
-@end deftypemethod
-@deftypemethod ResultSet {public Array} getArray (int@w{ }@var{index}) @*throws SQLException
-This method returns the specified column value as an @code{Array}.
-@end deftypemethod
-@deftypemethod ResultSet {public Object} getObject (java.lang.String@w{ }@var{name}, java.util.Map@w{ }@var{map}) @*throws SQLException
-This method returns the value of the specified column as a Java
- @code{Object} using the specified SQL type to Java type map.
-@end deftypemethod
-@deftypemethod ResultSet {public Ref} getRef (java.lang.String@w{ }@var{name}) @*throws SQLException
-This method returns a @code{Ref} for the specified column which
- represents the structured type for the column.
-@end deftypemethod
-@deftypemethod ResultSet {public Blob} getBlob (java.lang.String@w{ }@var{name}) @*throws SQLException
-This method returns the specified column value as a BLOB.
-@end deftypemethod
-@deftypemethod ResultSet {public Clob} getClob (java.lang.String@w{ }@var{name}) @*throws SQLException
-This method returns the specified column value as a CLOB.
-@end deftypemethod
-@deftypemethod ResultSet {public Array} getArray (java.lang.String@w{ }@var{name}) @*throws SQLException
-This method returns the specified column value as an @code{Array}.
-@end deftypemethod
-@deftypemethod ResultSet {public Date} getDate (int@w{ }@var{index}, java.util.Calendar@w{ }@var{cal}) @*throws SQLException
-This method returns the specified column value as a
- @code{java.sql.Date}. The specified @code{Calendar} is used
- to generate a value for the date if the database does not support
- timezones.
-@end deftypemethod
-@deftypemethod ResultSet {public Time} getTime (int@w{ }@var{index}, java.util.Calendar@w{ }@var{cal}) @*throws SQLException
-This method returns the specified column value as a
- @code{java.sql.Time}. The specified @code{Calendar} is used
- to generate a value for the time if the database does not support
- timezones.
-@end deftypemethod
-@deftypemethod ResultSet {public Timestamp} getTimestamp (int@w{ }@var{index}, java.util.Calendar@w{ }@var{cal}) @*throws SQLException
-This method returns the specified column value as a
- @code{java.sql.Timestamp}. The specified @code{Calendar} is used
- to generate a value for the timestamp if the database does not support
- timezones.
-@end deftypemethod
-@deftypemethod ResultSet {public Date} getDate (java.lang.String@w{ }@var{name}, java.util.Calendar@w{ }@var{cal}) @*throws SQLException
-This method returns the specified column value as a
- @code{java.sql.Date}. The specified @code{Calendar} is used
- to generate a value for the date if the database does not support
- timezones.
-@end deftypemethod
-@deftypemethod ResultSet {public Time} getTime (java.lang.String@w{ }@var{name}, java.util.Calendar@w{ }@var{cal}) @*throws SQLException
-This method returns the specified column value as a
- @code{java.sql.Time}. The specified @code{Calendar} is used
- to generate a value for the time if the database does not support
- timezones.
-@end deftypemethod
-@deftypemethod ResultSet {public Timestamp} getTimestamp (java.lang.String@w{ }@var{name}, java.util.Calendar@w{ }@var{cal}) @*throws SQLException
-This method returns the specified column value as a
- @code{java.sql.Timestamp}. The specified @code{Calendar} is used
- to generate a value for the timestamp if the database does not support
- timezones.
-@end deftypemethod
-@deftypemethod ResultSetMetaData {public int} getColumnCount () @*throws SQLException
-This method returns the number of columns in the result set.
-@end deftypemethod
-@deftypemethod ResultSetMetaData {public boolean} isAutoIncrement (int@w{ }@var{index}) @*throws SQLException
-This method test whether or not the column is an auto-increment column.
- Auto-increment columns are read-only.
-@end deftypemethod
-@deftypemethod ResultSetMetaData {public boolean} isCaseSensitive (int@w{ }@var{index}) @*throws SQLException
-This method tests whether or not a column is case sensitive in its values.
-@end deftypemethod
-@deftypemethod ResultSetMetaData {public boolean} isSearchable (int@w{ }@var{index}) @*throws SQLException
-This method tests whether not the specified column can be used in
- a WHERE clause.
-@end deftypemethod
-@deftypemethod ResultSetMetaData {public boolean} isCurrency (int@w{ }@var{index}) @*throws SQLException
-This method tests whether or not the column stores a monetary value.
-@end deftypemethod
-@deftypemethod ResultSetMetaData {public int} isNullable (int@w{ }@var{index}) @*throws SQLException
-This method returns a value indicating whether or not the specified
- column may contain a NULL value.
-@end deftypemethod
-@deftypemethod ResultSetMetaData {public boolean} isSigned (int@w{ }@var{index}) @*throws SQLException
-This method tests whether or not the value of the specified column
- is signed or unsigned.
-@end deftypemethod
-@deftypemethod ResultSetMetaData {public int} getColumnDisplaySize (int@w{ }@var{index}) @*throws SQLException
-This method returns the maximum number of characters that can be used
- to display a value in this column.
-@end deftypemethod
-@deftypemethod ResultSetMetaData {public String} getColumnLabel (int@w{ }@var{index}) @*throws SQLException
-This method returns a string that should be used as a caption for this
- column for user display purposes.
-@end deftypemethod
-@deftypemethod ResultSetMetaData {public String} getColumnName (int@w{ }@var{index}) @*throws SQLException
-This method returns the name of the specified column.
-@end deftypemethod
-@deftypemethod ResultSetMetaData {public String} getSchemaName (int@w{ }@var{index}) @*throws SQLException
-This method returns the name of the schema that contains the specified
- column.
-@end deftypemethod
-@deftypemethod ResultSetMetaData {public int} getPrecision (int@w{ }@var{index}) @*throws SQLException
-This method returns the precision of the specified column, which is the
- number of decimal digits it contains.
-@end deftypemethod
-@deftypemethod ResultSetMetaData {public int} getScale (int@w{ }@var{index}) @*throws SQLException
-This method returns the scale of the specified column, which is the
- number of digits to the right of the decimal point.
-@end deftypemethod
-@deftypemethod ResultSetMetaData {public String} getTableName (int@w{ }@var{index}) @*throws SQLException
-This method returns the name of the table containing the specified
- column.
-@end deftypemethod
-@deftypemethod ResultSetMetaData {public String} getCatalogName (int@w{ }@var{index}) @*throws SQLException
-This method returns the name of the catalog containing the specified
- column.
-@end deftypemethod
-@deftypemethod ResultSetMetaData {public int} getColumnType (int@w{ }@var{index}) @*throws SQLException
-This method returns the SQL type of the specified column. This will
- be one of the constants from @code{Types}.
-@end deftypemethod
-@deftypemethod ResultSetMetaData {public String} getColumnTypeName (int@w{ }@var{index}) @*throws SQLException
-This method returns the name of the SQL type for this column.
-@end deftypemethod
-@deftypemethod ResultSetMetaData {public boolean} isReadOnly (int@w{ }@var{index}) @*throws SQLException
-This method tests whether or not the specified column is read only.
-@end deftypemethod
-@deftypemethod ResultSetMetaData {public boolean} isWritable (int@w{ }@var{index}) @*throws SQLException
-This method tests whether or not the column may be writable. This
- does not guarantee that a write will be successful.
-@end deftypemethod
-@deftypemethod ResultSetMetaData {public boolean} isDefinitelyWritable (int@w{ }@var{index}) @*throws SQLException
-This method tests whether or not the column is writable. This
- does guarantee that a write will be successful.
-@end deftypemethod
-@deftypemethod ResultSetMetaData {public String} getColumnClassName (int@w{ }@var{index}) @*throws SQLException
-This method returns the name of the Java class which will be used to
- create objects representing the data in this column.
-@end deftypemethod
-@deftypemethod SQLData {public String} getSQLTypeName () @*throws SQLException
-This method returns the user defined datatype name for this object.
-@end deftypemethod
-@deftypemethod SQLData {public void} readSQL (java.sql.SQLInput@w{ }@var{stream}, java.lang.String@w{ }@var{name}) @*throws SQLException
-This method populates the data in the object from the specified stream.
-@end deftypemethod
-@deftypemethod SQLData {public void} writeSQL (java.sql.SQLOutput@w{ }@var{stream}) @*throws SQLException
-This method writes the data in this object to the specified stream.
-@end deftypemethod
-@deftypemethod SQLException {public String} getSQLState ()
-This method returns the SQLState information associated with this
- error. The value returned is a @code{String} which is formatted
- using the XOPEN SQL state conventions.
-@end deftypemethod
-@deftypemethod SQLException {public int} getErrorCode ()
-This method returns the vendor specific error code associated with
- this error.
-@end deftypemethod
-@deftypemethod SQLException {public SQLException} getNextException ()
-This method returns the exception that is chained to this object.
-@end deftypemethod
-@deftypemethod SQLException {public void} setNextException (java.sql.SQLException@w{ }@var{e})
-This method adds a new exception to the end of the chain of exceptions
- that are chained to this object.
-@end deftypemethod
-@deftypemethod SQLInput {public String} readString () @*throws SQLException
-This method reads the next item from the stream a Java
- @code{String}.
-@end deftypemethod
-@deftypemethod SQLInput {public boolean} readBoolean () @*throws SQLException
-This method reads the next item from the stream a Java
- @code{boolean}.
-@end deftypemethod
-@deftypemethod SQLInput {public byte} readByte () @*throws SQLException
-This method reads the next item from the stream a Java
- @code{byte}.
-@end deftypemethod
-@deftypemethod SQLInput {public short} readShort () @*throws SQLException
-This method reads the next item from the stream a Java
- @code{short}.
-@end deftypemethod
-@deftypemethod SQLInput {public int} readInt () @*throws SQLException
-This method reads the next item from the stream a Java
- @code{int}.
-@end deftypemethod
-@deftypemethod SQLInput {public long} readLong () @*throws SQLException
-This method reads the next item from the stream a Java
- @code{long}.
-@end deftypemethod
-@deftypemethod SQLInput {public float} readFloat () @*throws SQLException
-This method reads the next item from the stream a Java
- @code{float}.
-@end deftypemethod
-@deftypemethod SQLInput {public double} readDouble () @*throws SQLException
-This method reads the next item from the stream a Java
- @code{double}.
-@end deftypemethod
-@deftypemethod SQLInput {public BigDecimal} readBigDecimal () @*throws SQLException
-This method reads the next item from the stream a Java
- @code{BigDecimal}.
-@end deftypemethod
-@deftypemethod SQLInput {public byte} readBytes () @*throws SQLException
-This method reads the next item from the stream a Java
- byte array
-@end deftypemethod
-@deftypemethod SQLInput {public Date} readDate () @*throws SQLException
-This method reads the next item from the stream a Java
- @code{java.sql.Date}.
-@end deftypemethod
-@deftypemethod SQLInput {public Time} readTime () @*throws SQLException
-This method reads the next item from the stream a Java
- @code{java.sql.Time}.
-@end deftypemethod
-@deftypemethod SQLInput {public Timestamp} readTimestamp () @*throws SQLException
-This method reads the next item from the stream a Java
- @code{java.sql.Timestamp}.
-@end deftypemethod
-@deftypemethod SQLInput {public InputStream} readAsciiStream () @*throws SQLException
-This method reads the next item from the stream a ASCII text
- @code{InputStream}.
-@end deftypemethod
-@deftypemethod SQLInput {public InputStream} readBinaryStream () @*throws SQLException
-This method reads the next item from the stream a binary
- @code{InputStream}.
-@end deftypemethod
-@deftypemethod SQLInput {public Reader} readCharacterStream () @*throws SQLException
-This method reads the next item from the stream a character
- @code{Reader}.
-@end deftypemethod
-@deftypemethod SQLInput {public Object} readObject () @*throws SQLException
-This method reads the next item from the stream a Java
- @code{Object}.
-@end deftypemethod
-@deftypemethod SQLInput {public Ref} readRef () @*throws SQLException
-This method reads the next item from the stream a Java SQL
- @code{Ref}.
-@end deftypemethod
-@deftypemethod SQLInput {public Blob} readBlob () @*throws SQLException
-This method reads the next item from the stream a Java SQL
- @code{Blob}.
-@end deftypemethod
-@deftypemethod SQLInput {public Clob} readClob () @*throws SQLException
-This method reads the next item from the stream a Java SQL
- @code{Clob}.
-@end deftypemethod
-@deftypemethod SQLInput {public Array} readArray () @*throws SQLException
-This method reads the next item from the stream a Java SQL
- @code{Array}.
-@end deftypemethod
-@deftypemethod SQLInput {public boolean} wasNull () @*throws SQLException
-This method tests whether or not the last value read was a SQL
- NULL value.
-@end deftypemethod
-@deftypemethod SQLOutput {public void} writeString (java.lang.String@w{ }@var{value}) @*throws SQLException
-This method writes the specified Java @code{String}
- to the SQL stream.
-@end deftypemethod
-@deftypemethod SQLOutput {public void} writeBoolean (boolean@w{ }@var{value}) @*throws SQLException
-This method writes the specified Java @code{boolean}
- to the SQL stream.
-@end deftypemethod
-@deftypemethod SQLOutput {public void} writeByte (byte@w{ }@var{value}) @*throws SQLException
-This method writes the specified Java @code{byte}
- to the SQL stream.
-@end deftypemethod
-@deftypemethod SQLOutput {public void} writeShort (short@w{ }@var{value}) @*throws SQLException
-This method writes the specified Java @code{short}
- to the SQL stream.
-@end deftypemethod
-@deftypemethod SQLOutput {public void} writeInt (int@w{ }@var{value}) @*throws SQLException
-This method writes the specified Java @code{int}
- to the SQL stream.
-@end deftypemethod
-@deftypemethod SQLOutput {public void} writeLong (long@w{ }@var{value}) @*throws SQLException
-This method writes the specified Java @code{long}
- to the SQL stream.
-@end deftypemethod
-@deftypemethod SQLOutput {public void} writeFloat (float@w{ }@var{value}) @*throws SQLException
-This method writes the specified Java @code{float}
- to the SQL stream.
-@end deftypemethod
-@deftypemethod SQLOutput {public void} writeDouble (double@w{ }@var{value}) @*throws SQLException
-This method writes the specified Java @code{double}
- to the SQL stream.
-@end deftypemethod
-@deftypemethod SQLOutput {public void} writeBigDecimal (java.math.BigDecimal@w{ }@var{value}) @*throws SQLException
-This method writes the specified Java @code{BigDecimal}
- to the SQL stream.
-@end deftypemethod
-@deftypemethod SQLOutput {public void} writeBytes (byte[]@w{ }@var{value}) @*throws SQLException
-This method writes the specified Java @code{byte} array
- to the SQL stream.
-@end deftypemethod
-@deftypemethod SQLOutput {public void} writeDate (java.sql.Date@w{ }@var{value}) @*throws SQLException
-This method writes the specified Java @code{java.sql.Date}
- to the SQL stream.
-@end deftypemethod
-@deftypemethod SQLOutput {public void} writeTime (java.sql.Time@w{ }@var{value}) @*throws SQLException
-This method writes the specified Java @code{java.sql.Time}
- to the SQL stream.
-@end deftypemethod
-@deftypemethod SQLOutput {public void} writeTimestamp (java.sql.Timestamp@w{ }@var{value}) @*throws SQLException
-This method writes the specified Java @code{java.sql.Timestamp}
- to the SQL stream.
-@end deftypemethod
-@deftypemethod SQLOutput {public void} writeCharacterStream (java.io.Reader@w{ }@var{value}) @*throws SQLException
-This method writes the specified Java character stream
- to the SQL stream.
-@end deftypemethod
-@deftypemethod SQLOutput {public void} writeBinaryStream (java.io.InputStream@w{ }@var{value}) @*throws SQLException
-This method writes the specified uninterpreted binary byte stream
- to the SQL stream.
-@end deftypemethod
-@deftypemethod SQLOutput {public void} writeAsciiStream (java.io.InputStream@w{ }@var{value}) @*throws SQLException
-This method writes the specified ASCII text stream
- to the SQL stream.
-@end deftypemethod
-@deftypemethod SQLOutput {public void} writeObject (java.sql.SQLData@w{ }@var{value}) @*throws SQLException
-This method writes the specified Java @code{SQLData} object
- to the SQL stream.
-@end deftypemethod
-@deftypemethod SQLOutput {public void} writeRef (java.sql.Ref@w{ }@var{value}) @*throws SQLException
-This method writes the specified Java SQL @code{Ref} object
- to the SQL stream.
-@end deftypemethod
-@deftypemethod SQLOutput {public void} writeBlob (java.sql.Blob@w{ }@var{value}) @*throws SQLException
-This method writes the specified Java SQL @code{Blob} object
- to the SQL stream.
-@end deftypemethod
-@deftypemethod SQLOutput {public void} writeClob (java.sql.Clob@w{ }@var{value}) @*throws SQLException
-This method writes the specified Java SQL @code{Clob} object
- to the SQL stream.
-@end deftypemethod
-@deftypemethod SQLOutput {public void} writeStruct (java.sql.Struct@w{ }@var{value}) @*throws SQLException
-This method writes the specified Java SQL @code{Struct} object
- to the SQL stream.
-@end deftypemethod
-@deftypemethod SQLOutput {public void} writeArray (java.sql.Array@w{ }@var{value}) @*throws SQLException
-This method writes the specified Java SQL @code{Array} object
- to the SQL stream.
-@end deftypemethod
-@deftypemethod SQLWarning {public SQLWarning} getNextWarning ()
-This method returns the exception that is chained to this object.
-@end deftypemethod
-@deftypemethod SQLWarning {public void} setNextWarning (java.sql.SQLWarning@w{ }@var{e})
-This method adds a new exception to the end of the chain of exceptions
- that are chained to this object.
-@end deftypemethod
-@deftypemethod Statement {public ResultSet} executeQuery (java.lang.String@w{ }@var{sql}) @*throws SQLException
-This method executes the specified SQL SELECT statement and returns a
- (possibly empty) @code{ResultSet} with the results of the query.
-@end deftypemethod
-@deftypemethod Statement {public int} executeUpdate (java.lang.String@w{ }@var{sql}) @*throws SQLException
-This method executes the specified SQL INSERT, UPDATE, or DELETE statement
- and returns the number of rows affected, which may be 0.
-@end deftypemethod
-@deftypemethod Statement {public void} close () @*throws SQLException
-This method closes the statement and frees any associated resources.
-@end deftypemethod
-@deftypemethod Statement {public int} getMaxFieldSize () @*throws SQLException
-This method returns the maximum length of any column value in bytes.
-@end deftypemethod
-@deftypemethod Statement {public void} setMaxFieldSize (int@w{ }@var{maxsize}) @*throws SQLException
-This method sets the limit for the maximum length of any column in bytes.
-@end deftypemethod
-@deftypemethod Statement {public int} getMaxRows () @*throws SQLException
-This method returns the maximum possible number of rows in a result set.
-@end deftypemethod
-@deftypemethod Statement {public void} setMaxRows (int@w{ }@var{maxrows}) @*throws SQLException
-This method sets the maximum number of rows that can be present in a
- result set.
-@end deftypemethod
-@deftypemethod Statement {public void} setEscapeProcessing (boolean@w{ }@var{esacpe}) @*throws SQLException
-This method sets the local escape processing mode on or off. The
- default value is on.
-@end deftypemethod
-@deftypemethod Statement {public int} getQueryTimeout () @*throws SQLException
-The method returns the number of seconds a statement may be in process
- before timing out. A value of 0 means there is no timeout.
-@end deftypemethod
-@deftypemethod Statement {public void} setQueryTimeout (int@w{ }@var{timeout}) @*throws SQLException
-This method sets the number of seconds a statement may be in process
- before timing out. A value of 0 means there is no timeout.
-@end deftypemethod
-@deftypemethod Statement {public void} cancel () @*throws SQLException
-This method cancels an outstanding statement, if the database supports
- that operation.
-@end deftypemethod
-@deftypemethod Statement {public SQLWarning} getWarnings () @*throws SQLException
-This method returns the first SQL warning attached to this statement.
- Subsequent warnings will be chained to this one.
-@end deftypemethod
-@deftypemethod Statement {public void} clearWarnings () @*throws SQLException
-This method clears any SQL warnings that have been attached to this
- statement.
-@end deftypemethod
-@deftypemethod Statement {public void} setCursorName (java.lang.String@w{ }@var{name}) @*throws SQLException
-This method sets the cursor name that will be used by the result set.
-@end deftypemethod
-@deftypemethod Statement {public boolean} execute (java.lang.String@w{ }@var{sql}) @*throws SQLException
-This method executes an arbitrary SQL statement of any time. The
- methods @code{getResultSet}, @code{getMoreResults} and
- @code{getUpdateCount} retrieve the results.
-@end deftypemethod
-@deftypemethod Statement {public ResultSet} getResultSet () @*throws SQLException
-This method returns the result set of the SQL statement that was
- executed. This should be called only once per result set returned.
-@end deftypemethod
-@deftypemethod Statement {public int} getUpdateCount () @*throws SQLException
-This method returns the update count of the SQL statement that was
- executed. This should be called only once per executed SQL statement.
-@end deftypemethod
-@deftypemethod Statement {public boolean} getMoreResults () @*throws SQLException
-This method advances the result set pointer to the next result set,
- which can then be retrieved using @code{getResultSet}
-@end deftypemethod
-@deftypemethod Statement {public int} getFetchDirection () @*throws SQLException
-This method returns the current direction that the driver thinks the
- result set will be accessed int.
-@end deftypemethod
-@deftypemethod Statement {public void} setFetchDirection (int@w{ }@var{direction}) @*throws SQLException
-This method informs the driver which direction the result set will
- be accessed in.
-@end deftypemethod
-@deftypemethod Statement {public int} getFetchSize () @*throws SQLException
-This method returns the number of rows the driver believes should be
- fetched from the database at a time.
-@end deftypemethod
-@deftypemethod Statement {public void} setFetchSize (int@w{ }@var{numrows}) @*throws SQLException
-This method informs the driver how many rows it should fetch from the
- database at a time.
-@end deftypemethod
-@deftypemethod Statement {public int} getResultSetConcurrency () @*throws SQLException
-This method returns the concurrency type of the result set for this
- statement. This will be one of the concurrency types defined in
- @code{ResultSet}.
-@end deftypemethod
-@deftypemethod Statement {public int} getResultSetType () @*throws SQLException
-This method returns the result set type for this statement. This will
- be one of the result set types defined in @code{ResultSet}.
-@end deftypemethod
-@deftypemethod Statement {public void} addBatch (java.lang.String@w{ }@var{sql}) @*throws SQLException
-This method adds a SQL statement to a SQL batch. A driver is not
- required to implement this method.
-@end deftypemethod
-@deftypemethod Statement {public void} clearBatch () @*throws SQLException
-This method clears out any SQL statements that have been populated in
- the current batch. A driver is not required to implement this method.
-@end deftypemethod
-@deftypemethod Statement {public int} executeBatch () @*throws SQLException
-This method executes the SQL batch and returns an array of update
- counts - one for each SQL statement in the batch - ordered in the same
- order the statements were added to the batch. A driver is not required
- to implement this method.
-@end deftypemethod
-@deftypemethod Statement {public Connection} getConnection () @*throws SQLException
-This method returns the @code{Connection} instance that was
- used to create this object.
-@end deftypemethod
-@deftypemethod Struct {public String} getSQLTypeName () @*throws SQLException
-This method returns the name of the SQL structured type for this
- object.
-@end deftypemethod
-@deftypemethod Struct {public Object} getAttributes () @*throws SQLException
-This method returns the attributes of this SQL structured type.
-@end deftypemethod
-@deftypemethod Struct {public Object} getAttributes (java.util.Map@w{ }@var{map}) @*throws SQLException
-This method returns the attributes of this SQL structured type.
- The specified map of type mappings overrides the default mappings.
-@end deftypemethod
-@deftypemethod Time {public static Time} valueOf (java.lang.String@w{ }@var{str})
-This method returns a new instance of this class by parsing a
- date in JDBC format into a Java date.
-@end deftypemethod
-@deftypemethod Time {public String} toString ()
-This method returns this date in JDBC format.
-@end deftypemethod
-@deftypemethod Timestamp {public static Timestamp} valueOf (java.lang.String@w{ }@var{str})
-This method returns a new instance of this class by parsing a
- date in JDBC format into a Java date.
-@end deftypemethod
-@deftypemethod Timestamp {public String} toString ()
-This method returns this date in JDBC format.
-@end deftypemethod
-@deftypemethod Timestamp {public int} getNanos ()
-This method returns the nanosecond value for this object.
-@end deftypemethod
-@deftypemethod Timestamp {public void} setNanos (int@w{ }@var{nanos})
-This method sets the nanosecond value for this object.
-@end deftypemethod
-@deftypemethod Timestamp {public boolean} before (java.sql.Timestamp@w{ }@var{ts})
-This methods tests whether this object is earlier than the specified
- object.
-@end deftypemethod
-@deftypemethod Timestamp {public boolean} after (java.sql.Timestamp@w{ }@var{ts})
-This methods tests whether this object is later than the specified
- object.
-@end deftypemethod
-@deftypemethod Timestamp {public boolean} equals (java.lang.Object@w{ }@var{obj})
-This method these the specified @code{Object} for equality
- against this object. This will be true if an only if the specified
- object is an instance of @code{Timestamp} and has the same
- time value fields.
-@end deftypemethod
-@deftypemethod Timestamp {public boolean} equals (java.sql.Timestamp@w{ }@var{ts})
-This method tests the specified timestamp for equality against this
- object. This will be true if and only if the specified object is
- not @code{null} and contains all the same time value fields
- as this object.
-@end deftypemethod
diff --git a/libjava/doc/java-text.texi b/libjava/doc/java-text.texi
deleted file mode 100644
index fd6cecc4638..00000000000
--- a/libjava/doc/java-text.texi
+++ /dev/null
@@ -1,859 +0,0 @@
-@deftypemethod BreakIterator {public abstract int} current ()
-
-@end deftypemethod
-@deftypemethod BreakIterator {public abstract int} first ()
-
-@end deftypemethod
-@deftypemethod BreakIterator {public abstract int} following (int@w{ }@var{pos})
-
-@end deftypemethod
-@deftypemethod BreakIterator {public static synchronized Locale} getAvailableLocales ()
-
-@end deftypemethod
-@deftypemethod BreakIterator {public static BreakIterator} getCharacterInstance ()
-
-@end deftypemethod
-@deftypemethod BreakIterator {public static BreakIterator} getCharacterInstance (java.util.Locale@w{ }@var{loc})
-
-@end deftypemethod
-@deftypemethod BreakIterator {public static BreakIterator} getLineInstance ()
-
-@end deftypemethod
-@deftypemethod BreakIterator {public static BreakIterator} getLineInstance (java.util.Locale@w{ }@var{loc})
-
-@end deftypemethod
-@deftypemethod BreakIterator {public static BreakIterator} getSentenceInstance ()
-
-@end deftypemethod
-@deftypemethod BreakIterator {public static BreakIterator} getSentenceInstance (java.util.Locale@w{ }@var{loc})
-
-@end deftypemethod
-@deftypemethod BreakIterator {public abstract CharacterIterator} getText ()
-
-@end deftypemethod
-@deftypemethod BreakIterator {public static BreakIterator} getWordInstance ()
-
-@end deftypemethod
-@deftypemethod BreakIterator {public static BreakIterator} getWordInstance (java.util.Locale@w{ }@var{loc})
-
-@end deftypemethod
-@deftypemethod BreakIterator {public boolean} isBoundary (int@w{ }@var{pos})
-
-@end deftypemethod
-@deftypemethod BreakIterator {public abstract int} last ()
-
-@end deftypemethod
-@deftypemethod BreakIterator {public abstract int} next ()
-
-@end deftypemethod
-@deftypemethod BreakIterator {public abstract int} next (int@w{ }@var{n})
-
-@end deftypemethod
-@deftypemethod BreakIterator {public int} preceding (int@w{ }@var{pos})
-
-@end deftypemethod
-@deftypemethod BreakIterator {public abstract int} previous ()
-
-@end deftypemethod
-@deftypemethod BreakIterator {public void} setText (java.lang.String@w{ }@var{newText})
-
-@end deftypemethod
-@deftypemethod BreakIterator {public abstract void} setText (java.text.CharacterIterator@w{ }@var{newText})
-
-@end deftypemethod
-@deftypemethod CharacterIterator {public Object} clone ()
-
-@end deftypemethod
-@deftypemethod CharacterIterator {public char} current ()
-
-@end deftypemethod
-@deftypemethod CharacterIterator {public char} first ()
-
-@end deftypemethod
-@deftypemethod CharacterIterator {public int} getBeginIndex ()
-
-@end deftypemethod
-@deftypemethod CharacterIterator {public int} getEndIndex ()
-
-@end deftypemethod
-@deftypemethod CharacterIterator {public int} getIndex ()
-
-@end deftypemethod
-@deftypemethod CharacterIterator {public char} last ()
-
-@end deftypemethod
-@deftypemethod CharacterIterator {public char} next ()
-
-@end deftypemethod
-@deftypemethod CharacterIterator {public char} previous ()
-
-@end deftypemethod
-@deftypemethod CharacterIterator {public char} setIndex (int@w{ }@var{idx})
-
-@end deftypemethod
-@deftypemethod ChoiceFormat {public void} applyPattern (java.lang.String@w{ }@var{newPattern})
-
-@end deftypemethod
-@deftypemethod ChoiceFormat {public Object} clone ()
-
-@end deftypemethod
-@deftypemethod ChoiceFormat {public boolean} equals (java.lang.Object@w{ }@var{obj})
-
-@end deftypemethod
-@deftypemethod ChoiceFormat {public StringBuffer} format (long@w{ }@var{num}, java.lang.StringBuffer@w{ }@var{appendBuf}, java.text.FieldPosition@w{ }@var{pos})
-
-@end deftypemethod
-@deftypemethod ChoiceFormat {public StringBuffer} format (double@w{ }@var{num}, java.lang.StringBuffer@w{ }@var{appendBuf}, java.text.FieldPosition@w{ }@var{pos})
-
-@end deftypemethod
-@deftypemethod ChoiceFormat {public Object} getFormats ()
-
-@end deftypemethod
-@deftypemethod ChoiceFormat {public double} getLimits ()
-
-@end deftypemethod
-@deftypemethod ChoiceFormat {public int} hashCode ()
-
-@end deftypemethod
-@deftypemethod ChoiceFormat {public static final double} nextDouble (double@w{ }@var{d})
-
-@end deftypemethod
-@deftypemethod ChoiceFormat {public static double} nextDouble (double@w{ }@var{d}, boolean@w{ }@var{next})
-
-@end deftypemethod
-@deftypemethod ChoiceFormat {public Number} parse (java.lang.String@w{ }@var{sourceStr}, java.text.ParsePosition@w{ }@var{pos})
-
-@end deftypemethod
-@deftypemethod ChoiceFormat {public static final double} previousDouble (double@w{ }@var{d})
-
-@end deftypemethod
-@deftypemethod ChoiceFormat {public void} setChoices (double[]@w{ }@var{choiceLimits}, java.lang.String[]@w{ }@var{choiceFormats})
-
-@end deftypemethod
-@deftypemethod ChoiceFormat {public String} toPattern ()
-
-@end deftypemethod
-@deftypemethod CollationElementIterator {public int} next ()
-
-@end deftypemethod
-@deftypemethod CollationElementIterator {public static final int} primaryOrder (int@w{ }@var{order})
-
-@end deftypemethod
-@deftypemethod CollationElementIterator {public void} reset ()
-
-@end deftypemethod
-@deftypemethod CollationElementIterator {public static final short} secondaryOrder (int@w{ }@var{order})
-
-@end deftypemethod
-@deftypemethod CollationElementIterator {public static final short} tertiaryOrder (int@w{ }@var{order})
-
-@end deftypemethod
-@deftypemethod CollationKey {public int} compareTo (java.text.CollationKey@w{ }@var{target})
-
-@end deftypemethod
-@deftypemethod CollationKey {public int} compareTo (java.lang.Object@w{ }@var{o})
-
-@end deftypemethod
-@deftypemethod CollationKey {public boolean} equals (java.lang.Object@w{ }@var{obj})
-
-@end deftypemethod
-@deftypemethod CollationKey {public String} getSourceString ()
-
-@end deftypemethod
-@deftypemethod CollationKey {public int} hashCode ()
-
-@end deftypemethod
-@deftypemethod CollationKey {public byte} toByteArray ()
-
-@end deftypemethod
-@deftypemethod Collator {public abstract int} compare (java.lang.String@w{ }@var{source}, java.lang.String@w{ }@var{target})
-
-@end deftypemethod
-@deftypemethod Collator {public int} compare (java.lang.Object@w{ }@var{o1}, java.lang.Object@w{ }@var{o2})
-
-@end deftypemethod
-@deftypemethod Collator {public boolean} equals (java.lang.Object@w{ }@var{obj})
-
-@end deftypemethod
-@deftypemethod Collator {public boolean} equals (java.lang.String@w{ }@var{source}, java.lang.String@w{ }@var{target})
-
-@end deftypemethod
-@deftypemethod Collator {public Object} clone ()
-
-@end deftypemethod
-@deftypemethod Collator {public static synchronized Locale} getAvailableLocales ()
-
-@end deftypemethod
-@deftypemethod Collator {public abstract CollationKey} getCollationKey (java.lang.String@w{ }@var{source})
-
-@end deftypemethod
-@deftypemethod Collator {public synchronized int} getDecomposition ()
-
-@end deftypemethod
-@deftypemethod Collator {public static Collator} getInstance ()
-
-@end deftypemethod
-@deftypemethod Collator {public static Collator} getInstance (java.util.Locale@w{ }@var{loc})
-
-@end deftypemethod
-@deftypemethod Collator {public synchronized int} getStrength ()
-
-@end deftypemethod
-@deftypemethod Collator {public abstract int} hashCode ()
-
-@end deftypemethod
-@deftypemethod Collator {public synchronized void} setDecomposition (int@w{ }@var{mode})
-
-@end deftypemethod
-@deftypemethod Collator {public synchronized void} setStrength (int@w{ }@var{strength})
-
-@end deftypemethod
-@deftypemethod DateFormat {public boolean} equals (java.lang.Object@w{ }@var{obj})
-
-@end deftypemethod
-@deftypemethod DateFormat {public Object} clone ()
-
-@end deftypemethod
-@deftypemethod DateFormat {public final StringBuffer} format (java.lang.Object@w{ }@var{obj}, java.lang.StringBuffer@w{ }@var{buf}, java.text.FieldPosition@w{ }@var{pos})
-
-@end deftypemethod
-@deftypemethod DateFormat {public final String} format (java.util.Date@w{ }@var{date})
-
-@end deftypemethod
-@deftypemethod DateFormat {public abstract StringBuffer} format (java.util.Date@w{ }@var{date}, java.lang.StringBuffer@w{ }@var{buf}, java.text.FieldPosition@w{ }@var{pos})
-
-@end deftypemethod
-@deftypemethod DateFormat {public static Locale} getAvailableLocales ()
-
-@end deftypemethod
-@deftypemethod DateFormat {public Calendar} getCalendar ()
-
-@end deftypemethod
-@deftypemethod DateFormat {public static final DateFormat} getDateInstance ()
-
-@end deftypemethod
-@deftypemethod DateFormat {public static final DateFormat} getDateInstance (int@w{ }@var{style})
-
-@end deftypemethod
-@deftypemethod DateFormat {public static final DateFormat} getDateInstance (int@w{ }@var{style}, java.util.Locale@w{ }@var{loc})
-
-@end deftypemethod
-@deftypemethod DateFormat {public static final DateFormat} getDateTimeInstance ()
-
-@end deftypemethod
-@deftypemethod DateFormat {public static final DateFormat} getDateTimeInstance (int@w{ }@var{dateStyle}, int@w{ }@var{timeStyle})
-
-@end deftypemethod
-@deftypemethod DateFormat {public static final DateFormat} getDateTimeInstance (int@w{ }@var{dateStyle}, int@w{ }@var{timeStyle}, java.util.Locale@w{ }@var{loc})
-
-@end deftypemethod
-@deftypemethod DateFormat {public static final DateFormat} getInstance ()
-
-@end deftypemethod
-@deftypemethod DateFormat {public NumberFormat} getNumberFormat ()
-
-@end deftypemethod
-@deftypemethod DateFormat {public static final DateFormat} getTimeInstance ()
-
-@end deftypemethod
-@deftypemethod DateFormat {public static final DateFormat} getTimeInstance (int@w{ }@var{style})
-
-@end deftypemethod
-@deftypemethod DateFormat {public static final DateFormat} getTimeInstance (int@w{ }@var{style}, java.util.Locale@w{ }@var{loc})
-
-@end deftypemethod
-@deftypemethod DateFormat {public TimeZone} getTimeZone ()
-
-@end deftypemethod
-@deftypemethod DateFormat {public int} hashCode ()
-
-@end deftypemethod
-@deftypemethod DateFormat {public boolean} isLenient ()
-
-@end deftypemethod
-@deftypemethod DateFormat {public Date} parse (java.lang.String@w{ }@var{source}) @*throws ParseException
-
-@end deftypemethod
-@deftypemethod DateFormat {public abstract Date} parse (java.lang.String@w{ }@var{source}, java.text.ParsePosition@w{ }@var{pos})
-
-@end deftypemethod
-@deftypemethod DateFormat {public Object} parseObject (java.lang.String@w{ }@var{source}, java.text.ParsePosition@w{ }@var{pos})
-
-@end deftypemethod
-@deftypemethod DateFormat {public void} setCalendar (java.util.Calendar@w{ }@var{calendar})
-
-@end deftypemethod
-@deftypemethod DateFormat {public void} setLenient (boolean@w{ }@var{lenient})
-
-@end deftypemethod
-@deftypemethod DateFormat {public void} setNumberFormat (java.text.NumberFormat@w{ }@var{numberFormat})
-
-@end deftypemethod
-@deftypemethod DateFormat {public void} setTimeZone (java.util.TimeZone@w{ }@var{timeZone})
-
-@end deftypemethod
-@deftypemethod DateFormatSymbols {public String} getAmPmStrings ()
-
-@end deftypemethod
-@deftypemethod DateFormatSymbols {public String} getEras ()
-
-@end deftypemethod
-@deftypemethod DateFormatSymbols {public String} getLocalPatternChars ()
-
-@end deftypemethod
-@deftypemethod DateFormatSymbols {public String} getMonths ()
-
-@end deftypemethod
-@deftypemethod DateFormatSymbols {public String} getShortMonths ()
-
-@end deftypemethod
-@deftypemethod DateFormatSymbols {public String} getShortWeekdays ()
-
-@end deftypemethod
-@deftypemethod DateFormatSymbols {public String} getWeekdays ()
-
-@end deftypemethod
-@deftypemethod DateFormatSymbols {public String} getZoneStrings ()
-
-@end deftypemethod
-@deftypemethod DateFormatSymbols {public void} setAmPmStrings (java.lang.String[]@w{ }@var{value})
-
-@end deftypemethod
-@deftypemethod DateFormatSymbols {public void} setEras (java.lang.String[]@w{ }@var{value})
-
-@end deftypemethod
-@deftypemethod DateFormatSymbols {public void} setLocalPatternChars (java.lang.String@w{ }@var{value})
-
-@end deftypemethod
-@deftypemethod DateFormatSymbols {public void} setMonths (java.lang.String[]@w{ }@var{value})
-
-@end deftypemethod
-@deftypemethod DateFormatSymbols {public void} setShortMonths (java.lang.String[]@w{ }@var{value})
-
-@end deftypemethod
-@deftypemethod DateFormatSymbols {public void} setShortWeekdays (java.lang.String[]@w{ }@var{value})
-
-@end deftypemethod
-@deftypemethod DateFormatSymbols {public void} setWeekdays (java.lang.String[]@w{ }@var{value})
-
-@end deftypemethod
-@deftypemethod DateFormatSymbols {public void} setZoneStrings (java.lang.String[][]@w{ }@var{value})
-
-@end deftypemethod
-@deftypemethod DateFormatSymbols {public boolean} equals (java.lang.Object@w{ }@var{obj})
-
-@end deftypemethod
-@deftypemethod DateFormatSymbols {public Object} clone ()
-
-@end deftypemethod
-@deftypemethod DateFormatSymbols {public int} hashCode ()
-
-@end deftypemethod
-@deftypemethod DecimalFormat {public void} applyLocalizedPattern (java.lang.String@w{ }@var{pattern})
-
-@end deftypemethod
-@deftypemethod DecimalFormat {public void} applyPattern (java.lang.String@w{ }@var{pattern})
-
-@end deftypemethod
-@deftypemethod DecimalFormat {public Object} clone ()
-
-@end deftypemethod
-@deftypemethod DecimalFormat {public boolean} equals (java.lang.Object@w{ }@var{obj})
-
-@end deftypemethod
-@deftypemethod DecimalFormat {public StringBuffer} format (double@w{ }@var{number}, java.lang.StringBuffer@w{ }@var{dest}, java.text.FieldPosition@w{ }@var{fieldPos})
-
-@end deftypemethod
-@deftypemethod DecimalFormat {public StringBuffer} format (long@w{ }@var{number}, java.lang.StringBuffer@w{ }@var{dest}, java.text.FieldPosition@w{ }@var{fieldPos})
-
-@end deftypemethod
-@deftypemethod DecimalFormat {public DecimalFormatSymbols} getDecimalFormatSymbols ()
-
-@end deftypemethod
-@deftypemethod DecimalFormat {public int} getGroupingSize ()
-
-@end deftypemethod
-@deftypemethod DecimalFormat {public int} getMultiplier ()
-
-@end deftypemethod
-@deftypemethod DecimalFormat {public String} getNegativePrefix ()
-
-@end deftypemethod
-@deftypemethod DecimalFormat {public String} getNegativeSuffix ()
-
-@end deftypemethod
-@deftypemethod DecimalFormat {public String} getPositivePrefix ()
-
-@end deftypemethod
-@deftypemethod DecimalFormat {public String} getPositiveSuffix ()
-
-@end deftypemethod
-@deftypemethod DecimalFormat {public int} hashCode ()
-
-@end deftypemethod
-@deftypemethod DecimalFormat {public boolean} isDecimalSeparatorAlwaysShown ()
-
-@end deftypemethod
-@deftypemethod DecimalFormat {public Number} parse (java.lang.String@w{ }@var{str}, java.text.ParsePosition@w{ }@var{pos})
-
-@end deftypemethod
-@deftypemethod DecimalFormat {public void} setDecimalFormatSymbols (java.text.DecimalFormatSymbols@w{ }@var{newSymbols})
-
-@end deftypemethod
-@deftypemethod DecimalFormat {public void} setDecimalSeparatorAlwaysShown (boolean@w{ }@var{newValue})
-
-@end deftypemethod
-@deftypemethod DecimalFormat {public void} setGroupingSize (int@w{ }@var{groupSize})
-
-@end deftypemethod
-@deftypemethod DecimalFormat {public void} setMaximumFractionDigits (int@w{ }@var{newValue})
-
-@end deftypemethod
-@deftypemethod DecimalFormat {public void} setMaximumIntegerDigits (int@w{ }@var{newValue})
-
-@end deftypemethod
-@deftypemethod DecimalFormat {public void} setMinimumFractionDigits (int@w{ }@var{newValue})
-
-@end deftypemethod
-@deftypemethod DecimalFormat {public void} setMinimumIntegerDigits (int@w{ }@var{newValue})
-
-@end deftypemethod
-@deftypemethod DecimalFormat {public void} setMultiplier (int@w{ }@var{newValue})
-
-@end deftypemethod
-@deftypemethod DecimalFormat {public void} setNegativePrefix (java.lang.String@w{ }@var{newValue})
-
-@end deftypemethod
-@deftypemethod DecimalFormat {public void} setNegativeSuffix (java.lang.String@w{ }@var{newValue})
-
-@end deftypemethod
-@deftypemethod DecimalFormat {public void} setPositivePrefix (java.lang.String@w{ }@var{newValue})
-
-@end deftypemethod
-@deftypemethod DecimalFormat {public void} setPositiveSuffix (java.lang.String@w{ }@var{newValue})
-
-@end deftypemethod
-@deftypemethod DecimalFormat {public String} toLocalizedPattern ()
-
-@end deftypemethod
-@deftypemethod DecimalFormat {public String} toPattern ()
-
-@end deftypemethod
-@deftypemethod DecimalFormatSymbols {public Object} clone ()
-
-@end deftypemethod
-@deftypemethod DecimalFormatSymbols {public boolean} equals (java.lang.Object@w{ }@var{obj})
-
-@end deftypemethod
-@deftypemethod DecimalFormatSymbols {public String} getCurrencySymbol ()
-
-@end deftypemethod
-@deftypemethod DecimalFormatSymbols {public char} getDecimalSeparator ()
-
-@end deftypemethod
-@deftypemethod DecimalFormatSymbols {public char} getDigit ()
-
-@end deftypemethod
-@deftypemethod DecimalFormatSymbols {public char} getGroupingSeparator ()
-
-@end deftypemethod
-@deftypemethod DecimalFormatSymbols {public String} getInfinity ()
-
-@end deftypemethod
-@deftypemethod DecimalFormatSymbols {public String} getInternationalCurrencySymbol ()
-
-@end deftypemethod
-@deftypemethod DecimalFormatSymbols {public char} getMinusSign ()
-
-@end deftypemethod
-@deftypemethod DecimalFormatSymbols {public char} getMonetaryDecimalSeparator ()
-
-@end deftypemethod
-@deftypemethod DecimalFormatSymbols {public String} getNaN ()
-
-@end deftypemethod
-@deftypemethod DecimalFormatSymbols {public char} getPatternSeparator ()
-
-@end deftypemethod
-@deftypemethod DecimalFormatSymbols {public char} getPercent ()
-
-@end deftypemethod
-@deftypemethod DecimalFormatSymbols {public char} getPerMill ()
-
-@end deftypemethod
-@deftypemethod DecimalFormatSymbols {public char} getZeroDigit ()
-
-@end deftypemethod
-@deftypemethod DecimalFormatSymbols {public int} hashCode ()
-
-@end deftypemethod
-@deftypemethod DecimalFormatSymbols {public void} setCurrencySymbol (java.lang.String@w{ }@var{currency})
-
-@end deftypemethod
-@deftypemethod DecimalFormatSymbols {public void} setDecimalSeparator (char@w{ }@var{decimalSep})
-
-@end deftypemethod
-@deftypemethod DecimalFormatSymbols {public void} setDigit (char@w{ }@var{digit})
-
-@end deftypemethod
-@deftypemethod DecimalFormatSymbols {public void} setGroupingSeparator (char@w{ }@var{groupSep})
-
-@end deftypemethod
-@deftypemethod DecimalFormatSymbols {public void} setInfinity (java.lang.String@w{ }@var{infinity})
-
-@end deftypemethod
-@deftypemethod DecimalFormatSymbols {public void} setInternationalCurrencySymbol (java.lang.String@w{ }@var{currency})
-
-@end deftypemethod
-@deftypemethod DecimalFormatSymbols {public void} setMinusSign (char@w{ }@var{minusSign})
-
-@end deftypemethod
-@deftypemethod DecimalFormatSymbols {public void} setMonetaryDecimalSeparator (char@w{ }@var{decimalSep})
-
-@end deftypemethod
-@deftypemethod DecimalFormatSymbols {public void} setNaN (java.lang.String@w{ }@var{nan})
-
-@end deftypemethod
-@deftypemethod DecimalFormatSymbols {public void} setPatternSeparator (char@w{ }@var{patternSep})
-
-@end deftypemethod
-@deftypemethod DecimalFormatSymbols {public void} setPercent (char@w{ }@var{percent})
-
-@end deftypemethod
-@deftypemethod DecimalFormatSymbols {public void} setPerMill (char@w{ }@var{perMill})
-
-@end deftypemethod
-@deftypemethod DecimalFormatSymbols {public void} setZeroDigit (char@w{ }@var{zeroDigit})
-
-@end deftypemethod
-@deftypemethod FieldPosition {public int} getField ()
-
-@end deftypemethod
-@deftypemethod FieldPosition {public int} getBeginIndex ()
-
-@end deftypemethod
-@deftypemethod FieldPosition {public int} getEndIndex ()
-
-@end deftypemethod
-@deftypemethod FieldPosition {public void} setBeginIndex (int@w{ }@var{index})
-
-@end deftypemethod
-@deftypemethod FieldPosition {public void} setEndIndex (int@w{ }@var{index})
-
-@end deftypemethod
-@deftypemethod FieldPosition {public boolean} equals (java.lang.Object@w{ }@var{obj})
-
-@end deftypemethod
-@deftypemethod Format {public abstract StringBuffer} format (java.lang.Object@w{ }@var{obj}, java.lang.StringBuffer@w{ }@var{sbuf}, java.text.FieldPosition@w{ }@var{pos})
-
-@end deftypemethod
-@deftypemethod Format {public final String} format (java.lang.Object@w{ }@var{obj})
-
-@end deftypemethod
-@deftypemethod Format {public abstract Object} parseObject (java.lang.String@w{ }@var{source}, java.text.ParsePosition@w{ }@var{pos})
-
-@end deftypemethod
-@deftypemethod Format {public Object} parseObject (java.lang.String@w{ }@var{source}) @*throws ParseException
-
-@end deftypemethod
-@deftypemethod Format {public Object} clone ()
-
-@end deftypemethod
-@deftypemethod MessageFormat {public void} applyPattern (java.lang.String@w{ }@var{newPattern})
-
-@end deftypemethod
-@deftypemethod MessageFormat {public Object} clone ()
-
-@end deftypemethod
-@deftypemethod MessageFormat {public boolean} equals (java.lang.Object@w{ }@var{obj})
-
-@end deftypemethod
-@deftypemethod MessageFormat {public static String} format (java.lang.String@w{ }@var{pattern}, java.lang.Object[]@w{ }@var{arguments})
-
-@end deftypemethod
-@deftypemethod MessageFormat {public final StringBuffer} format (java.lang.Object[]@w{ }@var{arguments}, java.lang.StringBuffer@w{ }@var{appendBuf}, java.text.FieldPosition@w{ }@var{ignore})
-
-@end deftypemethod
-@deftypemethod MessageFormat {public final StringBuffer} format (java.lang.Object@w{ }@var{singleArg}, java.lang.StringBuffer@w{ }@var{appendBuf}, java.text.FieldPosition@w{ }@var{ignore})
-
-@end deftypemethod
-@deftypemethod MessageFormat {public Format} getFormats ()
-
-@end deftypemethod
-@deftypemethod MessageFormat {public Locale} getLocale ()
-
-@end deftypemethod
-@deftypemethod MessageFormat {public int} hashCode ()
-
-@end deftypemethod
-@deftypemethod MessageFormat {public Object} parse (java.lang.String@w{ }@var{sourceStr}, java.text.ParsePosition@w{ }@var{pos})
-
-@end deftypemethod
-@deftypemethod MessageFormat {public Object} parse (java.lang.String@w{ }@var{sourceStr}) @*throws ParseException
-
-@end deftypemethod
-@deftypemethod MessageFormat {public Object} parseObject (java.lang.String@w{ }@var{sourceStr}, java.text.ParsePosition@w{ }@var{pos})
-
-@end deftypemethod
-@deftypemethod MessageFormat {public void} setFormat (int@w{ }@var{variableNum}, java.text.Format@w{ }@var{newFormat})
-
-@end deftypemethod
-@deftypemethod MessageFormat {public void} setFormats (java.text.Format[]@w{ }@var{newFormats})
-
-@end deftypemethod
-@deftypemethod MessageFormat {public void} setLocale (java.util.Locale@w{ }@var{loc})
-
-@end deftypemethod
-@deftypemethod MessageFormat {public String} toPattern ()
-
-@end deftypemethod
-@deftypemethod NumberFormat {public final String} format (long@w{ }@var{number})
-
-@end deftypemethod
-@deftypemethod NumberFormat {public final StringBuffer} format (java.lang.Object@w{ }@var{obj}, java.lang.StringBuffer@w{ }@var{sbuf}, java.text.FieldPosition@w{ }@var{pos})
-
-@end deftypemethod
-@deftypemethod NumberFormat {public abstract StringBuffer} format (double@w{ }@var{number}, java.lang.StringBuffer@w{ }@var{sbuf}, java.text.FieldPosition@w{ }@var{pos})
-
-@end deftypemethod
-@deftypemethod NumberFormat {public abstract StringBuffer} format (long@w{ }@var{number}, java.lang.StringBuffer@w{ }@var{sbuf}, java.text.FieldPosition@w{ }@var{pos})
-
-@end deftypemethod
-@deftypemethod NumberFormat {public Object} clone ()
-
-@end deftypemethod
-@deftypemethod NumberFormat {public boolean} equals (java.lang.Object@w{ }@var{obj})
-
-@end deftypemethod
-@deftypemethod NumberFormat {public static Locale} getAvailableLocales ()
-
-@end deftypemethod
-@deftypemethod NumberFormat {public static final NumberFormat} getCurrencyInstance ()
-
-@end deftypemethod
-@deftypemethod NumberFormat {public static NumberFormat} getCurrencyInstance (java.util.Locale@w{ }@var{loc})
-
-@end deftypemethod
-@deftypemethod NumberFormat {public static final NumberFormat} getInstance ()
-
-@end deftypemethod
-@deftypemethod NumberFormat {public static NumberFormat} getInstance (java.util.Locale@w{ }@var{loc})
-
-@end deftypemethod
-@deftypemethod NumberFormat {public int} getMaximumFractionDigits ()
-
-@end deftypemethod
-@deftypemethod NumberFormat {public int} getMaximumIntegerDigits ()
-
-@end deftypemethod
-@deftypemethod NumberFormat {public int} getMinimumFractionDigits ()
-
-@end deftypemethod
-@deftypemethod NumberFormat {public int} getMinimumIntegerDigits ()
-
-@end deftypemethod
-@deftypemethod NumberFormat {public static final NumberFormat} getNumberInstance ()
-
-@end deftypemethod
-@deftypemethod NumberFormat {public static NumberFormat} getNumberInstance (java.util.Locale@w{ }@var{loc})
-
-@end deftypemethod
-@deftypemethod NumberFormat {public static final NumberFormat} getPercentInstance ()
-
-@end deftypemethod
-@deftypemethod NumberFormat {public static NumberFormat} getPercentInstance (java.util.Locale@w{ }@var{loc})
-
-@end deftypemethod
-@deftypemethod NumberFormat {public int} hashCode ()
-
-@end deftypemethod
-@deftypemethod NumberFormat {public boolean} isGroupingUsed ()
-
-@end deftypemethod
-@deftypemethod NumberFormat {public boolean} isParseIntegerOnly ()
-
-@end deftypemethod
-@deftypemethod NumberFormat {public abstract Number} parse (java.lang.String@w{ }@var{sourceStr}, java.text.ParsePosition@w{ }@var{pos})
-
-@end deftypemethod
-@deftypemethod NumberFormat {public Number} parse (java.lang.String@w{ }@var{sourceStr}) @*throws ParseException
-
-@end deftypemethod
-@deftypemethod NumberFormat {public final Object} parseObject (java.lang.String@w{ }@var{sourceStr}, java.text.ParsePosition@w{ }@var{pos})
-
-@end deftypemethod
-@deftypemethod NumberFormat {public void} setGroupingUsed (boolean@w{ }@var{newValue})
-
-@end deftypemethod
-@deftypemethod NumberFormat {public void} setMaximumFractionDigits (int@w{ }@var{newValue})
-
-@end deftypemethod
-@deftypemethod NumberFormat {public void} setMaximumIntegerDigits (int@w{ }@var{newValue})
-
-@end deftypemethod
-@deftypemethod NumberFormat {public void} setMinimumFractionDigits (int@w{ }@var{newValue})
-
-@end deftypemethod
-@deftypemethod NumberFormat {public void} setMinimumIntegerDigits (int@w{ }@var{newValue})
-
-@end deftypemethod
-@deftypemethod NumberFormat {public void} setParseIntegerOnly (boolean@w{ }@var{value})
-
-@end deftypemethod
-@deftypemethod NumberFormat {public final String} format (double@w{ }@var{number})
-
-@end deftypemethod
-@deftypemethod ParseException {public int} getErrorOffset ()
-
-@end deftypemethod
-@deftypemethod ParsePosition {public int} getIndex ()
-
-@end deftypemethod
-@deftypemethod ParsePosition {public void} setIndex (int@w{ }@var{index})
-
-@end deftypemethod
-@deftypemethod ParsePosition {public int} getErrorIndex ()
-
-@end deftypemethod
-@deftypemethod ParsePosition {public void} setErrorIndex (int@w{ }@var{ei})
-
-@end deftypemethod
-@deftypemethod ParsePosition {public boolean} equals (java.lang.Object@w{ }@var{obj})
-
-@end deftypemethod
-@deftypemethod RuleBasedCollator {public Object} clone ()
-
-@end deftypemethod
-@deftypemethod RuleBasedCollator {public int} compare (java.lang.String@w{ }@var{source}, java.lang.String@w{ }@var{target})
-
-@end deftypemethod
-@deftypemethod RuleBasedCollator {public boolean} equals (java.lang.Object@w{ }@var{obj})
-
-@end deftypemethod
-@deftypemethod RuleBasedCollator {public CollationElementIterator} getCollationElementIterator (java.lang.String@w{ }@var{source})
-
-@end deftypemethod
-@deftypemethod RuleBasedCollator {public CollationElementIterator} getCollationElementIterator (java.text.CharacterIterator@w{ }@var{source})
-
-@end deftypemethod
-@deftypemethod RuleBasedCollator {public CollationKey} getCollationKey (java.lang.String@w{ }@var{source})
-
-@end deftypemethod
-@deftypemethod RuleBasedCollator {public String} getRules ()
-
-@end deftypemethod
-@deftypemethod RuleBasedCollator {public int} hashCode ()
-
-@end deftypemethod
-@deftypemethod SimpleDateFormat {public String} toString ()
-
-@end deftypemethod
-@deftypemethod SimpleDateFormat {public String} toPattern ()
-This method returns a string with the formatting pattern being used
- by this object. This string is unlocalized.
-@end deftypemethod
-@deftypemethod SimpleDateFormat {public String} toLocalizedPattern ()
-This method returns a string with the formatting pattern being used
- by this object. This string is localized.
-@end deftypemethod
-@deftypemethod SimpleDateFormat {public void} applyPattern (java.lang.String@w{ }@var{pattern})
-This method sets the formatting pattern that should be used by this
- object. This string is not localized.
-@end deftypemethod
-@deftypemethod SimpleDateFormat {public void} applyLocalizedPattern (java.lang.String@w{ }@var{pattern})
-This method sets the formatting pattern that should be used by this
- object. This string is localized.
-@end deftypemethod
-@deftypemethod SimpleDateFormat {public Date} get2DigitYearStart ()
-Returns the start of the century used for two digit years.
-@end deftypemethod
-@deftypemethod SimpleDateFormat {public void} set2DigitYearStart (java.util.Date@w{ }@var{date})
-Sets the start of the century used for two digit years.
-@end deftypemethod
-@deftypemethod SimpleDateFormat {public DateFormatSymbols} getDateFormatSymbols ()
-This method returns the format symbol information used for parsing
- and formatting dates.
-@end deftypemethod
-@deftypemethod SimpleDateFormat {public void} setDateFormatSymbols (java.text.DateFormatSymbols@w{ }@var{formatData})
-This method sets the format symbols information used for parsing
- and formatting dates.
-@end deftypemethod
-@deftypemethod SimpleDateFormat {public boolean} equals (java.lang.Object@w{ }@var{o})
-This methods tests whether the specified object is equal to this
- object. This will be true if and only if the specified object:
-
-
-
-
-@itemize @bullet
-
-
-@item
-Is not @code{null}.
-
-@item
-Is an instance of @code{SimpleDateFormat}.
-
-@item
-Is equal to this object at the superclass (i.e., @code{DateFormat})
- level.
-
-@item
-Has the same formatting pattern.
-
-@item
-Is using the same formatting symbols.
-
-@item
-Is using the same century for two digit years.
-
-@end itemize
-
-@end deftypemethod
-@deftypemethod SimpleDateFormat {public StringBuffer} format (java.util.Date@w{ }@var{date}, java.lang.StringBuffer@w{ }@var{buffer}, java.text.FieldPosition@w{ }@var{pos})
-Formats the date input according to the format string in use,
- appending to the specified StringBuffer. The input StringBuffer
- is returned as output for convenience.
-@end deftypemethod
-@deftypemethod SimpleDateFormat {public Date} parse (java.lang.String@w{ }@var{dateStr}, java.text.ParsePosition@w{ }@var{pos})
-This method parses the specified string into a date.
-@end deftypemethod
-@deftypemethod StringCharacterIterator {public Object} clone ()
-
-@end deftypemethod
-@deftypemethod StringCharacterIterator {public char} current ()
-
-@end deftypemethod
-@deftypemethod StringCharacterIterator {public boolean} equals (java.lang.Object@w{ }@var{obj})
-
-@end deftypemethod
-@deftypemethod StringCharacterIterator {public char} first ()
-
-@end deftypemethod
-@deftypemethod StringCharacterIterator {public int} getBeginIndex ()
-
-@end deftypemethod
-@deftypemethod StringCharacterIterator {public int} getEndIndex ()
-
-@end deftypemethod
-@deftypemethod StringCharacterIterator {public int} getIndex ()
-
-@end deftypemethod
-@deftypemethod StringCharacterIterator {public int} hashCode ()
-
-@end deftypemethod
-@deftypemethod StringCharacterIterator {public char} last ()
-
-@end deftypemethod
-@deftypemethod StringCharacterIterator {public char} next ()
-
-@end deftypemethod
-@deftypemethod StringCharacterIterator {public char} previous ()
-
-@end deftypemethod
-@deftypemethod StringCharacterIterator {public char} setIndex (int@w{ }@var{idx})
-
-@end deftypemethod
-@deftypemethod StringCharacterIterator {public void} setText (java.lang.String@w{ }@var{text})
-
-@end deftypemethod
diff --git a/libjava/doc/java-util-jar.texi b/libjava/doc/java-util-jar.texi
deleted file mode 100644
index 7a36859f45c..00000000000
--- a/libjava/doc/java-util-jar.texi
+++ /dev/null
@@ -1,188 +0,0 @@
-@deftypemethod Attributes {public String} getValue (java.lang.String@w{ }@var{name})
-Gets the value of an attribute name given as a String.
-@end deftypemethod
-@deftypemethod Attributes {public String} getValue (java.util.jar.Attributes.Name@w{ }@var{name})
-Gets the value of the given attribute name.
-@end deftypemethod
-@deftypemethod Attributes {public String} putValue (java.lang.String@w{ }@var{name}, java.lang.String@w{ }@var{value})
-Stores an attribute name (represented by a String) and value in this
- Attributes map.
- When the (case insensitive string) name already exists the value is
- replaced and the old value is returned.
-@end deftypemethod
-@deftypemethod Attributes {public Object} clone ()
-Return a clone of this attribute map.
-@end deftypemethod
-@deftypemethod Attributes {public void} clear ()
-Removes all attributes.
-@end deftypemethod
-@deftypemethod Attributes {public boolean} containsKey (java.lang.Object@w{ }@var{attrName})
-Checks to see if there is an attribute with the specified name.
- XXX - what if the object is a String?
-@end deftypemethod
-@deftypemethod Attributes {public boolean} containsValue (java.lang.Object@w{ }@var{attrValue})
-Checks to see if there is an attribute name with the specified value.
-@end deftypemethod
-@deftypemethod Attributes {public Set} entrySet ()
-Gives a Set of attribute name and values pairs as MapEntries.
-@end deftypemethod
-@deftypemethod Attributes {public boolean} equals (java.lang.Object@w{ }@var{o})
-Checks to see if two Attributes are equal. The supplied object must be
- a real instance of Attributes and contain the same attribute name/value
- pairs.
-@end deftypemethod
-@deftypemethod Attributes {public Object} get (java.lang.Object@w{ }@var{attrName})
-Gets the value of a specified attribute name.
- XXX - what if the object is a String?
-@end deftypemethod
-@deftypemethod Attributes {public int} hashCode ()
-Returns the hashcode of the attribute name/value map.
-@end deftypemethod
-@deftypemethod Attributes {public boolean} isEmpty ()
-Returns true if there are no attributes set, false otherwise.
-@end deftypemethod
-@deftypemethod Attributes {public Set} keySet ()
-Gives a Set of all the values of defined attribute names.
-@end deftypemethod
-@deftypemethod Attributes {public Object} put (java.lang.Object@w{ }@var{name}, java.lang.Object@w{ }@var{value})
-Adds or replaces a attribute name/value pair.
- XXX - What if the name is a string? What if the name is neither a Name
- nor a String? What if the value is not a string?
-@end deftypemethod
-@deftypemethod Attributes {public void} putAll (java.util.Map@w{ }@var{attr})
-Adds or replaces all attribute name/value pairs from another
- Attributes object to this one. The supplied Map must be an instance of
- Attributes.
-@end deftypemethod
-@deftypemethod Attributes {public Object} remove (java.lang.Object@w{ }@var{name})
-Remove a attribute name/value pair.
- XXX - What if the name is a String?
-@end deftypemethod
-@deftypemethod Attributes {public int} size ()
-Returns the number of defined attribute name/value pairs.
-@end deftypemethod
-@deftypemethod Attributes {public Collection} values ()
-Returns all the values of the defined attribute name/value pairs as a
- Collection.
-@end deftypemethod
-@deftypemethod Attributes.Name {public int} hashCode ()
-Returns the hash code of the (lowercase) String representation of
- this Name.
-@end deftypemethod
-@deftypemethod Attributes.Name {public boolean} equals (java.lang.Object@w{ }@var{o})
-Checks if another object is equal to this Name object.
- Another object is equal to this Name object if it is an instance of
- Name and the (lowercase) string representation of the name is equal.
-@end deftypemethod
-@deftypemethod Attributes.Name {public String} toString ()
-Returns the string representation of this Name as given to the
- constructor (not neccesarily the lower case representation).
-@end deftypemethod
-@deftypemethod JarEntry {public Attributes} getAttributes () @*throws IOException
-Returns a copy of the Attributes set for this entry.
- When no Attributes are set in the manifest null is returned.
-@end deftypemethod
-@deftypemethod JarEntry {public Certificate} getCertificates ()
-Returns a copy of the certificates set for this entry.
- When no certificates are set or when not all data of this entry has
- been read null is returned.
-
-
-
- To make sure that this call returns a valid value you must read all
- data from the JarInputStream for this entry.
- When you don't need the data for an entry but want to know the
- certificates that are set for the entry then you can skip all data by
- calling @code{skip(entry.getSize())} on the JarInputStream for
- the entry.
-@end deftypemethod
-@deftypemethod JarFile {public Enumeration} entries () @*throws IllegalStateException
-Returns a enumeration of all the entries in the JarFile.
- Note that also the Jar META-INF entries are returned.
-@end deftypemethod
-@deftypemethod JarFile {public ZipEntry} getEntry (java.lang.String@w{ }@var{name})
-XXX
- It actually returns a JarEntry not a zipEntry
-@end deftypemethod
-@deftypemethod JarFile {public synchronized InputStream} getInputStream (java.util.zip.ZipEntry@w{ }@var{entry}) @*throws ZipException, IOException
-XXX should verify the inputstream
-@end deftypemethod
-@deftypemethod JarFile {public JarEntry} getJarEntry (java.lang.String@w{ }@var{name})
-Returns the JarEntry that belongs to the name if such an entry
- exists in the JarFile. Returns null otherwise
- Convenience method that just casts the result from @code{getEntry}
- to a JarEntry.
-@end deftypemethod
-@deftypemethod JarFile {public Manifest} getManifest ()
-Returns the manifest for this JarFile or null when the JarFile does not
- contain a manifest file.
-@end deftypemethod
-@deftypemethod JarInputStream {protected ZipEntry} createZipEntry (java.lang.String@w{ }@var{name})
-Creates a JarEntry for a particular name and consults the manifest
- for the Attributes of the entry.
- Used by @code{ZipEntry.getNextEntry()}
-@end deftypemethod
-@deftypemethod JarInputStream {public Manifest} getManifest ()
-Returns the Manifest for the jar file or null if there was no Manifest.
-@end deftypemethod
-@deftypemethod JarInputStream {public ZipEntry} getNextEntry () @*throws IOException
-Returns the next entry or null when there are no more entries.
- Does actually return a JarEntry, if you don't want to cast it yourself
- use @code{getNextJarEntry()}. Does not return any entries found
- at the beginning of the ZipFile that are special
- (those that start with "META-INF/").
-@end deftypemethod
-@deftypemethod JarInputStream {public JarEntry} getNextJarEntry () @*throws IOException
-Returns the next jar entry or null when there are no more entries.
-@end deftypemethod
-@deftypemethod JarInputStream {public int} read (byte[]@w{ }@var{buf}, int@w{ }@var{off}, int@w{ }@var{len}) @*throws IOException
-XXX
-@end deftypemethod
-@deftypemethod JarOutputStream {public void} putNextEntry (java.util.zip.ZipEntry@w{ }@var{entry}) @*throws IOException
-Prepares the JarOutputStream for writing the next entry.
- This implementation just calls @code{super.putNextEntre()}.
-@end deftypemethod
-@deftypemethod Manifest {public Attributes} getMainAttributes ()
-Gets the main attributes of this Manifest.
-@end deftypemethod
-@deftypemethod Manifest {public Map} getEntries ()
-Gets a map of entry Strings to Attributes for all the entries described
- in this manifest. Adding, changing or removing from this entries map
- changes the entries of this manifest.
-@end deftypemethod
-@deftypemethod Manifest {public Attributes} getAttributes (java.lang.String@w{ }@var{entryName})
-Returns the Attributes associated with the Entry.
-
-
-
- Implemented as:
- @code{return (Attributes)getEntries().get(entryName)}
-@end deftypemethod
-@deftypemethod Manifest {public void} clear ()
-Clears the main attributes and removes all the entries from the
- manifest.
-@end deftypemethod
-@deftypemethod Manifest {public void} read (java.io.InputStream@w{ }@var{in}) @*throws IOException
-XXX
-@end deftypemethod
-@deftypemethod Manifest {public void} write (java.io.OutputStream@w{ }@var{out}) @*throws IOException
-XXX
-@end deftypemethod
-@deftypemethod Manifest {public Object} clone ()
-Makes a deep copy of the main attributes, but a shallow copy of
- the other entries. This means that you can freely add, change or remove
- the main attributes or the entries of the new manifest without effecting
- the original manifest, but adding, changing or removing attributes from
- a particular entry also changes the attributes of that entry in the
- original manifest. Calls @code{new Manifest(this)}.
-@end deftypemethod
-@deftypemethod Manifest {public boolean} equals (java.lang.Object@w{ }@var{o})
-Checks if another object is equal to this Manifest object.
- Another Object is equal to this Manifest object if it is an instance of
- Manifest and the main attributes and the entries of the other manifest
- are equal to this one.
-@end deftypemethod
-@deftypemethod Manifest {public int} hashCode ()
-Calculates the hash code of the manifest. Implemented by a xor of the
- hash code of the main attributes with the hash code of the entries map.
-@end deftypemethod
diff --git a/libjava/doc/java-util-zip.texi b/libjava/doc/java-util-zip.texi
deleted file mode 100644
index d084b69a00b..00000000000
--- a/libjava/doc/java-util-zip.texi
+++ /dev/null
@@ -1,352 +0,0 @@
-@deftypemethod Adler32 {public void} reset ()
-Resets the Adler32 data checksum as if no update was ever called.
-@end deftypemethod
-@deftypemethod Adler32 {public void} update (int@w{ }@var{bval})
-Adds one byte to the data checksum.
-@end deftypemethod
-@deftypemethod Adler32 {public void} update (byte[]@w{ }@var{buffer})
-Adds the complete byte array to the data checksum.
-@end deftypemethod
-@deftypemethod Adler32 {public void} update (byte[]@w{ }@var{buf}, int@w{ }@var{off}, int@w{ }@var{len})
-Adds the byte array to the data checksum.
-@end deftypemethod
-@deftypemethod Adler32 {public long} getValue ()
-Returns the Adler32 data checksum computed so far.
-@end deftypemethod
-@deftypemethod CheckedInputStream {public Checksum} getChecksum ()
-Returns the Checksum object used. To get the data checksum computed so
- far call @code{getChecksum.getValue()}.
-@end deftypemethod
-@deftypemethod CheckedInputStream {public int} read () @*throws IOException
-Reads one byte, updates the checksum and returns the read byte
- (or -1 when the end of file was reached).
-@end deftypemethod
-@deftypemethod CheckedInputStream {public int} read (byte[]@w{ }@var{buf}, int@w{ }@var{off}, int@w{ }@var{len}) @*throws IOException
-Reads at most len bytes in the supplied buffer and updates the checksum
- with it. Returns the number of bytes actually read or -1 when the end
- of file was reached.
-@end deftypemethod
-@deftypemethod CheckedInputStream {public long} skip (long@w{ }@var{n}) @*throws IOException
-Skips n bytes by reading them in a temporary buffer and updating the
- the checksum with that buffer. Returns the actual number of bytes skiped
- which can be less then requested when the end of file is reached.
-@end deftypemethod
-@deftypemethod CheckedOutputStream {public Checksum} getChecksum ()
-Returns the Checksum object used. To get the data checksum computed so
- far call @code{getChecksum.getValue()}.
-@end deftypemethod
-@deftypemethod CheckedOutputStream {public void} write (int@w{ }@var{bval}) @*throws IOException
-Writes one byte to the OutputStream and updates the Checksum.
-@end deftypemethod
-@deftypemethod CheckedOutputStream {public void} write (byte[]@w{ }@var{buf}, int@w{ }@var{off}, int@w{ }@var{len}) @*throws IOException
-Writes the byte array to the OutputStream and updates the Checksum.
-@end deftypemethod
-@deftypemethod Checksum {public long} getValue ()
-Returns the data checksum computed so far.
-@end deftypemethod
-@deftypemethod Checksum {public void} reset ()
-Resets the data checksum as if no update was ever called.
-@end deftypemethod
-@deftypemethod Checksum {public void} update (int@w{ }@var{bval})
-Adds one byte to the data checksum.
-@end deftypemethod
-@deftypemethod Checksum {public void} update (byte[]@w{ }@var{buf}, int@w{ }@var{off}, int@w{ }@var{len})
-Adds the byte array to the data checksum.
-@end deftypemethod
-@deftypemethod CRC32 {public long} getValue ()
-Returns the CRC32 data checksum computed so far.
-@end deftypemethod
-@deftypemethod CRC32 {public void} reset ()
-Resets the CRC32 data checksum as if no update was ever called.
-@end deftypemethod
-@deftypemethod CRC32 {public void} update (int@w{ }@var{bval})
-
-@end deftypemethod
-@deftypemethod CRC32 {public void} update (byte[]@w{ }@var{buf}, int@w{ }@var{off}, int@w{ }@var{len})
-Adds the byte array to the data checksum.
-@end deftypemethod
-@deftypemethod CRC32 {public void} update (byte[]@w{ }@var{buf})
-Adds the complete byte array to the data checksum.
-@end deftypemethod
-@deftypemethod Deflater {public int} deflate (byte[]@w{ }@var{buf})
-
-@end deftypemethod
-@deftypemethod Deflater {public native int} deflate (byte[]@w{ }@var{buf}, int@w{ }@var{off}, int@w{ }@var{len})
-
-@end deftypemethod
-@deftypemethod Deflater {public native void} end ()
-
-@end deftypemethod
-@deftypemethod Deflater {protected void} finalize ()
-
-@end deftypemethod
-@deftypemethod Deflater {public native void} finish ()
-
-@end deftypemethod
-@deftypemethod Deflater {public synchronized boolean} finished ()
-
-@end deftypemethod
-@deftypemethod Deflater {public native int} getAdler ()
-
-@end deftypemethod
-@deftypemethod Deflater {public native int} getTotalIn ()
-
-@end deftypemethod
-@deftypemethod Deflater {public native int} getTotalOut ()
-
-@end deftypemethod
-@deftypemethod Deflater {public native boolean} needsInput ()
-
-@end deftypemethod
-@deftypemethod Deflater {public native void} reset ()
-
-@end deftypemethod
-@deftypemethod Deflater {public void} setDictionary (byte[]@w{ }@var{buf})
-
-@end deftypemethod
-@deftypemethod Deflater {public native void} setDictionary (byte[]@w{ }@var{buf}, int@w{ }@var{off}, int@w{ }@var{len})
-
-@end deftypemethod
-@deftypemethod Deflater {public void} setInput (byte[]@w{ }@var{buf})
-
-@end deftypemethod
-@deftypemethod Deflater {public native void} setInput (byte[]@w{ }@var{buf}, int@w{ }@var{off}, int@w{ }@var{len})
-
-@end deftypemethod
-@deftypemethod Deflater {public synchronized void} setLevel (int@w{ }@var{lvl})
-
-@end deftypemethod
-@deftypemethod Deflater {public synchronized void} setStrategy (int@w{ }@var{stgy})
-
-@end deftypemethod
-@deftypemethod DeflaterOutputStream {public void} close () @*throws IOException
-
-@end deftypemethod
-@deftypemethod DeflaterOutputStream {protected void} deflate () @*throws IOException
-
-@end deftypemethod
-@deftypemethod DeflaterOutputStream {public void} finish () @*throws IOException
-
-@end deftypemethod
-@deftypemethod DeflaterOutputStream {public void} write (int@w{ }@var{bval}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod DeflaterOutputStream {public void} write (byte[]@w{ }@var{buf}, int@w{ }@var{off}, int@w{ }@var{len}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod GZIPInputStream {public void} close () @*throws IOException
-
-@end deftypemethod
-@deftypemethod GZIPInputStream {public int} read (byte[]@w{ }@var{buf}, int@w{ }@var{off}, int@w{ }@var{len}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod GZIPOutputStream {public void} close () @*throws IOException
-
-@end deftypemethod
-@deftypemethod GZIPOutputStream {public void} finish () @*throws IOException
-
-@end deftypemethod
-@deftypemethod GZIPOutputStream {public synchronized void} write (byte[]@w{ }@var{buf}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod GZIPOutputStream {public synchronized void} write (byte[]@w{ }@var{buf}, int@w{ }@var{off}, int@w{ }@var{len}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod InflaterInputStream {protected void} fill () @*throws IOException
-
-@end deftypemethod
-@deftypemethod InflaterInputStream {public int} read () @*throws IOException
-
-@end deftypemethod
-@deftypemethod InflaterInputStream {public int} read (byte[]@w{ }@var{buf}, int@w{ }@var{off}, int@w{ }@var{len}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod InflaterInputStream {public void} close () @*throws IOException
-
-@end deftypemethod
-@deftypemethod InflaterInputStream {public int} available () @*throws IOException
-
-@end deftypemethod
-@deftypemethod InflaterInputStream {public long} skip (long@w{ }@var{n}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod Inflater {public native void} end ()
-
-@end deftypemethod
-@deftypemethod Inflater {protected void} finalize ()
-
-@end deftypemethod
-@deftypemethod Inflater {public synchronized boolean} finished ()
-
-@end deftypemethod
-@deftypemethod Inflater {public native int} getAdler ()
-
-@end deftypemethod
-@deftypemethod Inflater {public native int} getRemaining ()
-
-@end deftypemethod
-@deftypemethod Inflater {public native int} getTotalIn ()
-
-@end deftypemethod
-@deftypemethod Inflater {public native int} getTotalOut ()
-
-@end deftypemethod
-@deftypemethod Inflater {public int} inflate (byte[]@w{ }@var{buf}) @*throws DataFormatException
-
-@end deftypemethod
-@deftypemethod Inflater {public native int} inflate (byte[]@w{ }@var{buf}, int@w{ }@var{off}, int@w{ }@var{len}) @*throws DataFormatException
-
-@end deftypemethod
-@deftypemethod Inflater {public synchronized boolean} needsDictionary ()
-
-@end deftypemethod
-@deftypemethod Inflater {public synchronized boolean} needsInput ()
-
-@end deftypemethod
-@deftypemethod Inflater {public native void} reset ()
-
-@end deftypemethod
-@deftypemethod Inflater {public void} setDictionary (byte[]@w{ }@var{buf})
-
-@end deftypemethod
-@deftypemethod Inflater {public native void} setDictionary (byte[]@w{ }@var{buf}, int@w{ }@var{off}, int@w{ }@var{len})
-
-@end deftypemethod
-@deftypemethod Inflater {public void} setInput (byte[]@w{ }@var{buf})
-
-@end deftypemethod
-@deftypemethod Inflater {public native void} setInput (byte[]@w{ }@var{buf}, int@w{ }@var{off}, int@w{ }@var{len})
-
-@end deftypemethod
-@deftypemethod ZipEntry {public Object} clone ()
-Creates a clone of this ZipEntry. Calls @code{new ZipEntry (this)}
- and creates a clone of the contents of the extra byte array field.
-@end deftypemethod
-@deftypemethod ZipEntry {public String} getComment ()
-
-@end deftypemethod
-@deftypemethod ZipEntry {public long} getCompressedSize ()
-
-@end deftypemethod
-@deftypemethod ZipEntry {public long} getCrc ()
-
-@end deftypemethod
-@deftypemethod ZipEntry {public byte} getExtra ()
-
-@end deftypemethod
-@deftypemethod ZipEntry {public int} getMethod ()
-
-@end deftypemethod
-@deftypemethod ZipEntry {public String} getName ()
-
-@end deftypemethod
-@deftypemethod ZipEntry {public long} getSize ()
-
-@end deftypemethod
-@deftypemethod ZipEntry {public long} getTime ()
-
-@end deftypemethod
-@deftypemethod ZipEntry {public boolean} isDirectory ()
-
-@end deftypemethod
-@deftypemethod ZipEntry {public void} setComment (java.lang.String@w{ }@var{comment})
-
-@end deftypemethod
-@deftypemethod ZipEntry {public void} setCompressedSize (long@w{ }@var{compressedSize})
-Sets the compressedSize of this ZipEntry.
- The new size must be between 0 and 0xffffffffL.
-@end deftypemethod
-@deftypemethod ZipEntry {public void} setCrc (long@w{ }@var{crc})
-
-@end deftypemethod
-@deftypemethod ZipEntry {public void} setExtra (byte[]@w{ }@var{extra})
-
-@end deftypemethod
-@deftypemethod ZipEntry {public void} setMethod (int@w{ }@var{method})
-
-@end deftypemethod
-@deftypemethod ZipEntry {public void} setSize (long@w{ }@var{size})
-
-@end deftypemethod
-@deftypemethod ZipEntry {public void} setTime (long@w{ }@var{time})
-
-@end deftypemethod
-@deftypemethod ZipEntry {public String} toString ()
-
-@end deftypemethod
-@deftypemethod ZipEntry {public int} hashCode ()
-Returns the hashcode of the name of this ZipEntry.
-@end deftypemethod
-@deftypemethod ZipFile {public Enumeration} entries ()
-
-@end deftypemethod
-@deftypemethod ZipFile {public void} close () @*throws IOException
-
-@end deftypemethod
-@deftypemethod ZipFile {public ZipEntry} getEntry (java.lang.String@w{ }@var{name})
-
-@end deftypemethod
-@deftypemethod ZipFile {public InputStream} getInputStream (java.util.zip.ZipEntry@w{ }@var{ze}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod ZipFile {public String} getName ()
-
-@end deftypemethod
-@deftypemethod ZipFile {public int} size ()
-Returns the number of entries in this ZipFile.
-@end deftypemethod
-@deftypemethod ZipFile {protected void} finalize () @*throws IOException
-
-@end deftypemethod
-@deftypemethod ZipInputStream {public ZipEntry} getNextEntry () @*throws IOException
-
-@end deftypemethod
-@deftypemethod ZipInputStream {protected void} fill () @*throws IOException
-
-@end deftypemethod
-@deftypemethod ZipInputStream {protected ZipEntry} createZipEntry (java.lang.String@w{ }@var{name})
-Creates a new ZipEntry with the given name.
- Used by ZipInputStream when normally @code{new ZipEntry (name)}
- would be called. This gives subclasses such as JarInputStream a change
- to override this method and add aditional information to the ZipEntry
- (subclass).
-@end deftypemethod
-@deftypemethod ZipInputStream {public int} read (byte[]@w{ }@var{b}, int@w{ }@var{off}, int@w{ }@var{len}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod ZipInputStream {public long} skip (long@w{ }@var{n}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod ZipInputStream {public int} available ()
-Returns 0 if the ZipInputStream is closed and 1 otherwise.
-@end deftypemethod
-@deftypemethod ZipInputStream {public void} closeEntry () @*throws IOException
-
-@end deftypemethod
-@deftypemethod ZipInputStream {public void} close () @*throws IOException
-Closes this InflaterInputStream.
-@end deftypemethod
-@deftypemethod ZipOutputStream {public void} close () @*throws IOException
-
-@end deftypemethod
-@deftypemethod ZipOutputStream {public void} closeEntry () @*throws IOException
-
-@end deftypemethod
-@deftypemethod ZipOutputStream {public void} finish () @*throws IOException
-
-@end deftypemethod
-@deftypemethod ZipOutputStream {public void} putNextEntry (java.util.zip.ZipEntry@w{ }@var{entry}) @*throws IOException
-
-@end deftypemethod
-@deftypemethod ZipOutputStream {public void} setLevel (int@w{ }@var{level})
-
-@end deftypemethod
-@deftypemethod ZipOutputStream {public void} setMethod (int@w{ }@var{method})
-
-@end deftypemethod
-@deftypemethod ZipOutputStream {public void} setComment (java.lang.String@w{ }@var{comment})
-
-@end deftypemethod
-@deftypemethod ZipOutputStream {public synchronized void} write (byte[]@w{ }@var{buf}, int@w{ }@var{off}, int@w{ }@var{len}) @*throws IOException
-
-@end deftypemethod
diff --git a/libjava/doc/java-util.texi b/libjava/doc/java-util.texi
deleted file mode 100644
index c2c18a4eefa..00000000000
--- a/libjava/doc/java-util.texi
+++ /dev/null
@@ -1,2425 +0,0 @@
-@deftypemethod AbstractCollection {public abstract Iterator} iterator ()
-Return an Iterator over this collection. The iterator must provide the
- hasNext and next methods and should in addition provide remove if the
- collection is modifiable.
-@end deftypemethod
-@deftypemethod AbstractCollection {public abstract int} size ()
-Return the number of elements in this collection.
-@end deftypemethod
-@deftypemethod AbstractCollection {public boolean} add (java.lang.Object@w{ }@var{o})
-Add an object to the collection. This implementation always throws an
- UnsupportedOperationException - it should be overridden if the collection
- is to be modifiable.
-@end deftypemethod
-@deftypemethod AbstractCollection {public boolean} addAll (java.util.Collection@w{ }@var{c})
-Add all the elements of a given collection to this collection. This
- implementation obtains an Iterator over the given collection and iterates
- over it, adding each element with the add(Object) method (thus this method
- will fail with an UnsupportedOperationException if the add method does).
-@end deftypemethod
-@deftypemethod AbstractCollection {public void} clear ()
-Remove all elements from the collection. This implementation obtains an
- iterator over the collection and calls next and remove on it repeatedly
- (thus this method will fail with an UnsupportedOperationException if the
- Iterator's remove method does) until there are no more elements to remove.
- Many implementations will have a faster way of doing this.
-@end deftypemethod
-@deftypemethod AbstractCollection {public boolean} contains (java.lang.Object@w{ }@var{o})
-Test whether this collection contains a given object. That is, if the
- collection has an element e such that (o == null ? e == null :
- o.equals(e)). This implementation obtains an iterator over the collection
- and iterates over it, testing each element for equality with the given
- object. If it is equal, true is returned. Otherwise false is returned when
- the end of the collection is reached.
-@end deftypemethod
-@deftypemethod AbstractCollection {public boolean} containsAll (java.util.Collection@w{ }@var{c})
-Tests whether this collection contains all the elements in a given
- collection. This implementation iterates over the given collection,
- testing whether each element is contained in this collection. If any one
- is not, false is returned. Otherwise true is returned.
-@end deftypemethod
-@deftypemethod AbstractCollection {public boolean} isEmpty ()
-Test whether this collection is empty. This implementation returns
- size() == 0.
-@end deftypemethod
-@deftypemethod AbstractCollection {public boolean} remove (java.lang.Object@w{ }@var{o})
-Remove a single instance of an object from this collection. That is,
- remove one element e such that (o == null ? e == null : o.equals(e)), if
- such an element exists. This implementation obtains an iterator over the
- collection and iterates over it, testing each element for equality with
- the given object. If it is equal, it is removed by the iterator's remove
- method (thus this method will fail with an UnsupportedOperationException
- if the Iterator's remove method does). After the first element has been
- removed, true is returned; if the end of the collection is reached, false
- is returned.
-@end deftypemethod
-@deftypemethod AbstractCollection {public boolean} removeAll (java.util.Collection@w{ }@var{c})
-Remove from this collection all its elements that are contained in a given
- collection. This implementation iterates over this collection, and for
- each element tests if it is contained in the given collection. If so, it
- is removed by the Iterator's remove method (thus this method will fail
- with an UnsupportedOperationException if the Iterator's remove method
- does).
-@end deftypemethod
-@deftypemethod AbstractCollection {public boolean} retainAll (java.util.Collection@w{ }@var{c})
-Remove from this collection all its elements that are not contained in a
- given collection. This implementation iterates over this collection, and
- for each element tests if it is contained in the given collection. If not,
- it is removed by the Iterator's remove method (thus this method will fail
- with an UnsupportedOperationException if the Iterator's remove method
- does).
-@end deftypemethod
-@deftypemethod AbstractCollection {public Object} toArray ()
-Return an array containing the elements of this collection. This
- implementation creates an Object array of size size() and then iterates
- over the collection, setting each element of the array from the value
- returned by the iterator.
-@end deftypemethod
-@deftypemethod AbstractCollection {public Object} toArray (java.lang.Object[]@w{ }@var{a})
-Copy the collection into a given array if it will fit, or into a
- dynamically created array of the same run-time type as the given array if
- not. If there is space remaining in the array, the first element after the
- end of the collection is set to null (this is only useful if the
- collection is known to contain no null elements, however). This
- implementation first tests whether the given array is large enough to hold
- all the elements of the collection. If not, the reflection API is used to
- allocate a new array of the same run-time type. Next an iterator is
- obtained over the collection and the elements are placed in the array as
- they are returned by the iterator. Finally the first spare element, if
- any, of the array is set to null, and the created array is returned.
-@end deftypemethod
-@deftypemethod AbstractCollection {public String} toString ()
-Creates a String representation of the Collection. The string returned is
- of the form "[a, b, ...]" where a and b etc are the results of calling
- toString on the elements of the collection. This implementation obtains an
- Iterator over the Collection and adds each element to a StringBuffer as it
- is returned by the iterator.
-@end deftypemethod
-@deftypemethod AbstractList {public abstract Object} get (int@w{ }@var{index})
-
-@end deftypemethod
-@deftypemethod AbstractList {public void} add (int@w{ }@var{index}, java.lang.Object@w{ }@var{o})
-
-@end deftypemethod
-@deftypemethod AbstractList {public boolean} add (java.lang.Object@w{ }@var{o})
-
-@end deftypemethod
-@deftypemethod AbstractList {public boolean} addAll (int@w{ }@var{index}, java.util.Collection@w{ }@var{c})
-
-@end deftypemethod
-@deftypemethod AbstractList {public void} clear ()
-
-@end deftypemethod
-@deftypemethod AbstractList {public boolean} equals (java.lang.Object@w{ }@var{o})
-
-@end deftypemethod
-@deftypemethod AbstractList {public int} hashCode ()
-
-@end deftypemethod
-@deftypemethod AbstractList {public int} indexOf (java.lang.Object@w{ }@var{o})
-
-@end deftypemethod
-@deftypemethod AbstractList {public Iterator} iterator ()
-
-@end deftypemethod
-@deftypemethod AbstractList {public int} lastIndexOf (java.lang.Object@w{ }@var{o})
-
-@end deftypemethod
-@deftypemethod AbstractList {public ListIterator} listIterator ()
-Return an Iterator over this List. This implementation calls
- listIterator(0).
-@end deftypemethod
-@deftypemethod AbstractList {public ListIterator} listIterator (int@w{ }@var{index})
-
-@end deftypemethod
-@deftypemethod AbstractList {public Object} remove (int@w{ }@var{index})
-
-@end deftypemethod
-@deftypemethod AbstractList {protected void} removeRange (int@w{ }@var{fromIndex}, int@w{ }@var{toIndex})
-Remove a subsection of the list. This is called by the clear and
- removeRange methods of the class which implements subList, which are
- difficult for subclasses to override directly. Therefore, this method
- should be overridden instead by the more efficient implementation, if one
- exists.
-
-
-
- This implementation first checks for illegal or out of range arguments. It
- then obtains a ListIterator over the list using listIterator(fromIndex).
- It then calls next() and remove() on this iterator repeatedly, toIndex -
- fromIndex times.
-@end deftypemethod
-@deftypemethod AbstractList {public Object} set (int@w{ }@var{index}, java.lang.Object@w{ }@var{o})
-
-@end deftypemethod
-@deftypemethod AbstractList {public List} subList (int@w{ }@var{fromIndex}, int@w{ }@var{toIndex})
-
-@end deftypemethod
-@deftypemethod AbstractMap {public void} clear ()
-Remove all entries from this Map. This default implementation calls
- entrySet().clear().
-@end deftypemethod
-@deftypemethod AbstractMap {public boolean} containsKey (java.lang.Object@w{ }@var{key})
-
-@end deftypemethod
-@deftypemethod AbstractMap {public boolean} containsValue (java.lang.Object@w{ }@var{value})
-
-@end deftypemethod
-@deftypemethod AbstractMap {public abstract Set} entrySet ()
-
-@end deftypemethod
-@deftypemethod AbstractMap {public boolean} equals (java.lang.Object@w{ }@var{o})
-
-@end deftypemethod
-@deftypemethod AbstractMap {public Object} get (java.lang.Object@w{ }@var{key})
-
-@end deftypemethod
-@deftypemethod AbstractMap {public int} hashCode ()
-
-@end deftypemethod
-@deftypemethod AbstractMap {public boolean} isEmpty ()
-
-@end deftypemethod
-@deftypemethod AbstractMap {public Set} keySet ()
-
-@end deftypemethod
-@deftypemethod AbstractMap {public Object} put (java.lang.Object@w{ }@var{key}, java.lang.Object@w{ }@var{value})
-
-@end deftypemethod
-@deftypemethod AbstractMap {public void} putAll (java.util.Map@w{ }@var{m})
-
-@end deftypemethod
-@deftypemethod AbstractMap {public Object} remove (java.lang.Object@w{ }@var{key})
-
-@end deftypemethod
-@deftypemethod AbstractMap {public int} size ()
-
-@end deftypemethod
-@deftypemethod AbstractMap {public String} toString ()
-
-@end deftypemethod
-@deftypemethod AbstractMap {public Collection} values ()
-
-@end deftypemethod
-@deftypemethod AbstractSequentialList {public abstract ListIterator} listIterator (int@w{ }@var{index})
-Returns a ListIterator over the list, starting from position index.
- Subclasses must provide an implementation of this method.
-@end deftypemethod
-@deftypemethod AbstractSequentialList {public void} add (int@w{ }@var{index}, java.lang.Object@w{ }@var{o})
-Add an element to the list at a given index. This implementation obtains a
- ListIterator positioned at the specified index, and then adds the element
- using the ListIterator's add method.
-@end deftypemethod
-@deftypemethod AbstractSequentialList {public boolean} addAll (int@w{ }@var{index}, java.util.Collection@w{ }@var{c})
-
-@end deftypemethod
-@deftypemethod AbstractSequentialList {public Object} get (int@w{ }@var{index})
-
-@end deftypemethod
-@deftypemethod AbstractSequentialList {public Iterator} iterator ()
-Return an Iterator over this List. This implementation returns
- listIterator().
-@end deftypemethod
-@deftypemethod AbstractSequentialList {public Object} remove (int@w{ }@var{index})
-
-@end deftypemethod
-@deftypemethod AbstractSequentialList {public Object} set (int@w{ }@var{index}, java.lang.Object@w{ }@var{o})
-
-@end deftypemethod
-@deftypemethod AbstractSet {public boolean} equals (java.lang.Object@w{ }@var{o})
-Tests whether the given object is equal to this Set. This implementation
- first checks whether this set <em>is</em> the given object, and returns
- true if so. Otherwise, if o is a Set and is the same size as this one, it
- returns the result of calling containsAll on the given Set. Otherwise, it
- returns false.
-@end deftypemethod
-@deftypemethod AbstractSet {public int} hashCode ()
-Returns a hash code for this Set. The hash code of a Set is the sum of the
- hash codes of all its elements, except that the hash code of null is
- defined to be zero. This implementation obtains an Iterator over the Set,
- and sums the results.
-@end deftypemethod
-@deftypemethod ArrayList {public void} ensureCapacity (int@w{ }@var{minCapacity})
-Guarantees that this list will have at least enough capacity to
- hold minCapacity elements.
-@end deftypemethod
-@deftypemethod ArrayList {public boolean} add (java.lang.Object@w{ }@var{e})
-Appends the supplied element to the end of this list.
-@end deftypemethod
-@deftypemethod ArrayList {public Object} get (int@w{ }@var{index})
-Retrieves the element at the user-supplied index.
-@end deftypemethod
-@deftypemethod ArrayList {public int} size ()
-Returns the number of elements in this list
-@end deftypemethod
-@deftypemethod ArrayList {public Object} remove (int@w{ }@var{index})
-Removes the element at the user-supplied index
-@end deftypemethod
-@deftypemethod ArrayList {protected void} removeRange (int@w{ }@var{fromIndex}, int@w{ }@var{toIndex})
-Removes all elements in the half-open interval [iFromIndex, iToIndex).
-@end deftypemethod
-@deftypemethod ArrayList {public void} add (int@w{ }@var{index}, java.lang.Object@w{ }@var{e})
-Adds the supplied element at the specified index, shifting all
- elements currently at that index or higher one to the right.
-@end deftypemethod
-@deftypemethod ArrayList {public boolean} addAll (java.util.Collection@w{ }@var{c})
-Add each element in the supplied Collection to this List.
-@end deftypemethod
-@deftypemethod ArrayList {public boolean} addAll (int@w{ }@var{index}, java.util.Collection@w{ }@var{c})
-Add all elements in the supplied collection, inserting them beginning
- at the specified index.
-@end deftypemethod
-@deftypemethod ArrayList {public Object} clone ()
-Creates a shallow copy of this ArrayList
-@end deftypemethod
-@deftypemethod ArrayList {public boolean} contains (java.lang.Object@w{ }@var{e})
-Returns true iff oElement is in this ArrayList.
-@end deftypemethod
-@deftypemethod ArrayList {public int} indexOf (java.lang.Object@w{ }@var{e})
-Returns the lowest index at which oElement appears in this List, or
- -1 if it does not appear.
-@end deftypemethod
-@deftypemethod ArrayList {public int} lastIndexOf (java.lang.Object@w{ }@var{e})
-Returns the highest index at which oElement appears in this List, or
- -1 if it does not appear.
-@end deftypemethod
-@deftypemethod ArrayList {public void} clear ()
-Removes all elements from this List
-@end deftypemethod
-@deftypemethod ArrayList {public Object} set (int@w{ }@var{index}, java.lang.Object@w{ }@var{e})
-Sets the element at the specified index.
-@end deftypemethod
-@deftypemethod ArrayList {public Object} toArray ()
-Returns an Object Array containing all of the elements in this ArrayList
-@end deftypemethod
-@deftypemethod ArrayList {public Object} toArray (java.lang.Object[]@w{ }@var{array})
-Returns an Array whose component type is the runtime component type of
- the passed-in Array. The returned Array is populated with all of the
- elements in this ArrayList. If the passed-in Array is not large enough
- to store all of the elements in this List, a new Array will be created
- and returned; if the passed-in Array is <i>larger</i> than the size
- of this List, then size() index will be set to null.
-@end deftypemethod
-@deftypemethod ArrayList {public void} trimToSize ()
-Trims the capacity of this List to be equal to its size;
- a memory saver.
-@end deftypemethod
-@deftypemethod Arrays {public static int} binarySearch (byte[]@w{ }@var{a}, byte@w{ }@var{key})
-Perform a binary search of a byte array for a key. The array must be
- sorted (as by the sort() method) - if it is not, the behaviour of this
- method is undefined, and may be an infinite loop. If the array contains
- the key more than once, any one of them may be found. Note: although the
- specification allows for an infinite loop if the array is unsorted, it
- will not happen in this implementation.
-@end deftypemethod
-@deftypemethod Arrays {public static int} binarySearch (char[]@w{ }@var{a}, char@w{ }@var{key})
-Perform a binary search of a char array for a key. The array must be
- sorted (as by the sort() method) - if it is not, the behaviour of this
- method is undefined, and may be an infinite loop. If the array contains
- the key more than once, any one of them may be found. Note: although the
- specification allows for an infinite loop if the array is unsorted, it
- will not happen in this implementation.
-@end deftypemethod
-@deftypemethod Arrays {public static int} binarySearch (double[]@w{ }@var{a}, double@w{ }@var{key})
-Perform a binary search of a double array for a key. The array must be
- sorted (as by the sort() method) - if it is not, the behaviour of this
- method is undefined, and may be an infinite loop. If the array contains
- the key more than once, any one of them may be found. Note: although the
- specification allows for an infinite loop if the array is unsorted, it
- will not happen in this implementation.
-@end deftypemethod
-@deftypemethod Arrays {public static int} binarySearch (float[]@w{ }@var{a}, float@w{ }@var{key})
-Perform a binary search of a float array for a key. The array must be
- sorted (as by the sort() method) - if it is not, the behaviour of this
- method is undefined, and may be an infinite loop. If the array contains
- the key more than once, any one of them may be found. Note: although the
- specification allows for an infinite loop if the array is unsorted, it
- will not happen in this implementation.
-@end deftypemethod
-@deftypemethod Arrays {public static int} binarySearch (int[]@w{ }@var{a}, int@w{ }@var{key})
-Perform a binary search of an int array for a key. The array must be
- sorted (as by the sort() method) - if it is not, the behaviour of this
- method is undefined, and may be an infinite loop. If the array contains
- the key more than once, any one of them may be found. Note: although the
- specification allows for an infinite loop if the array is unsorted, it
- will not happen in this implementation.
-@end deftypemethod
-@deftypemethod Arrays {public static int} binarySearch (long[]@w{ }@var{a}, long@w{ }@var{key})
-Perform a binary search of a long array for a key. The array must be
- sorted (as by the sort() method) - if it is not, the behaviour of this
- method is undefined, and may be an infinite loop. If the array contains
- the key more than once, any one of them may be found. Note: although the
- specification allows for an infinite loop if the array is unsorted, it
- will not happen in this implementation.
-@end deftypemethod
-@deftypemethod Arrays {public static int} binarySearch (short[]@w{ }@var{a}, short@w{ }@var{key})
-Perform a binary search of a short array for a key. The array must be
- sorted (as by the sort() method) - if it is not, the behaviour of this
- method is undefined, and may be an infinite loop. If the array contains
- the key more than once, any one of them may be found. Note: although the
- specification allows for an infinite loop if the array is unsorted, it
- will not happen in this implementation.
-@end deftypemethod
-@deftypemethod Arrays {public static int} binarySearch (java.lang.Object[]@w{ }@var{a}, java.lang.Object@w{ }@var{key})
-Perform a binary search of an Object array for a key, using the natural
- ordering of the elements. The array must be sorted (as by the sort()
- method) - if it is not, the behaviour of this method is undefined, and may
- be an infinite loop. Further, the key must be comparable with every item
- in the array. If the array contains the key more than once, any one of
- them may be found. Note: although the specification allows for an infinite
- loop if the array is unsorted, it will not happen in this (JCL)
- implementation.
-@end deftypemethod
-@deftypemethod Arrays {public static int} binarySearch (java.lang.Object[]@w{ }@var{a}, java.lang.Object@w{ }@var{key}, java.util.Comparator@w{ }@var{c})
-Perform a binary search of an Object array for a key, using a supplied
- Comparator. The array must be sorted (as by the sort() method with the
- same Comparator) - if it is not, the behaviour of this method is
- undefined, and may be an infinite loop. Further, the key must be
- comparable with every item in the array. If the array contains the key
- more than once, any one of them may be found. Note: although the
- specification allows for an infinite loop if the array is unsorted, it
- will not happen in this (JCL) implementation.
-@end deftypemethod
-@deftypemethod Arrays {public static boolean} equals (byte[]@w{ }@var{a1}, byte[]@w{ }@var{a2})
-Compare two byte arrays for equality.
-@end deftypemethod
-@deftypemethod Arrays {public static boolean} equals (char[]@w{ }@var{a1}, char[]@w{ }@var{a2})
-Compare two char arrays for equality.
-@end deftypemethod
-@deftypemethod Arrays {public static boolean} equals (double[]@w{ }@var{a1}, double[]@w{ }@var{a2})
-Compare two double arrays for equality.
-@end deftypemethod
-@deftypemethod Arrays {public static boolean} equals (float[]@w{ }@var{a1}, float[]@w{ }@var{a2})
-Compare two float arrays for equality.
-@end deftypemethod
-@deftypemethod Arrays {public static boolean} equals (long[]@w{ }@var{a1}, long[]@w{ }@var{a2})
-Compare two long arrays for equality.
-@end deftypemethod
-@deftypemethod Arrays {public static boolean} equals (short[]@w{ }@var{a1}, short[]@w{ }@var{a2})
-Compare two short arrays for equality.
-@end deftypemethod
-@deftypemethod Arrays {public static boolean} equals (boolean[]@w{ }@var{a1}, boolean[]@w{ }@var{a2})
-Compare two boolean arrays for equality.
-@end deftypemethod
-@deftypemethod Arrays {public static boolean} equals (int[]@w{ }@var{a1}, int[]@w{ }@var{a2})
-Compare two int arrays for equality.
-@end deftypemethod
-@deftypemethod Arrays {public static boolean} equals (java.lang.Object[]@w{ }@var{a1}, java.lang.Object[]@w{ }@var{a2})
-Compare two Object arrays for equality.
-@end deftypemethod
-@deftypemethod Arrays {public static void} fill (boolean[]@w{ }@var{a}, boolean@w{ }@var{val})
-Fill an array with a boolean value.
-@end deftypemethod
-@deftypemethod Arrays {public static void} fill (boolean[]@w{ }@var{a}, int@w{ }@var{fromIndex}, int@w{ }@var{toIndex}, boolean@w{ }@var{val})
-Fill a range of an array with a boolean value.
-@end deftypemethod
-@deftypemethod Arrays {public static void} fill (byte[]@w{ }@var{a}, byte@w{ }@var{val})
-Fill an array with a byte value.
-@end deftypemethod
-@deftypemethod Arrays {public static void} fill (byte[]@w{ }@var{a}, int@w{ }@var{fromIndex}, int@w{ }@var{toIndex}, byte@w{ }@var{val})
-Fill a range of an array with a byte value.
-@end deftypemethod
-@deftypemethod Arrays {public static void} fill (char[]@w{ }@var{a}, char@w{ }@var{val})
-Fill an array with a char value.
-@end deftypemethod
-@deftypemethod Arrays {public static void} fill (char[]@w{ }@var{a}, int@w{ }@var{fromIndex}, int@w{ }@var{toIndex}, char@w{ }@var{val})
-Fill a range of an array with a char value.
-@end deftypemethod
-@deftypemethod Arrays {public static void} fill (double[]@w{ }@var{a}, double@w{ }@var{val})
-Fill an array with a double value.
-@end deftypemethod
-@deftypemethod Arrays {public static void} fill (double[]@w{ }@var{a}, int@w{ }@var{fromIndex}, int@w{ }@var{toIndex}, double@w{ }@var{val})
-Fill a range of an array with a double value.
-@end deftypemethod
-@deftypemethod Arrays {public static void} fill (float[]@w{ }@var{a}, float@w{ }@var{val})
-Fill an array with a float value.
-@end deftypemethod
-@deftypemethod Arrays {public static void} fill (float[]@w{ }@var{a}, int@w{ }@var{fromIndex}, int@w{ }@var{toIndex}, float@w{ }@var{val})
-Fill a range of an array with a float value.
-@end deftypemethod
-@deftypemethod Arrays {public static void} fill (int[]@w{ }@var{a}, int@w{ }@var{val})
-Fill an array with an int value.
-@end deftypemethod
-@deftypemethod Arrays {public static void} fill (int[]@w{ }@var{a}, int@w{ }@var{fromIndex}, int@w{ }@var{toIndex}, int@w{ }@var{val})
-Fill a range of an array with an int value.
-@end deftypemethod
-@deftypemethod Arrays {public static void} fill (long[]@w{ }@var{a}, long@w{ }@var{val})
-Fill an array with a long value.
-@end deftypemethod
-@deftypemethod Arrays {public static void} fill (long[]@w{ }@var{a}, int@w{ }@var{fromIndex}, int@w{ }@var{toIndex}, long@w{ }@var{val})
-Fill a range of an array with a long value.
-@end deftypemethod
-@deftypemethod Arrays {public static void} fill (short[]@w{ }@var{a}, short@w{ }@var{val})
-Fill an array with a short value.
-@end deftypemethod
-@deftypemethod Arrays {public static void} fill (short[]@w{ }@var{a}, int@w{ }@var{fromIndex}, int@w{ }@var{toIndex}, short@w{ }@var{val})
-Fill a range of an array with a short value.
-@end deftypemethod
-@deftypemethod Arrays {public static void} fill (java.lang.Object[]@w{ }@var{a}, java.lang.Object@w{ }@var{val})
-Fill an array with an Object value.
-@end deftypemethod
-@deftypemethod Arrays {public static void} fill (java.lang.Object[]@w{ }@var{a}, int@w{ }@var{fromIndex}, int@w{ }@var{toIndex}, java.lang.Object@w{ }@var{val})
-Fill a range of an array with an Object value.
-@end deftypemethod
-@deftypemethod Arrays {public static void} sort (byte[]@w{ }@var{a})
-Sort a byte array into ascending order. The sort algorithm is an optimised
- quicksort, as described in Jon L. Bentley and M. Douglas McIlroy's
- "Engineering a Sort Function", Software-Practice and Experience, Vol.
- 23(11) P. 1249-1265 (November 1993). This algorithm gives nlog(n)
- performance on many arrays that would take quadratic time with a standard
- quicksort.
-@end deftypemethod
-@deftypemethod Arrays {public static void} sort (byte[]@w{ }@var{a}, int@w{ }@var{fromIndex}, int@w{ }@var{toIndex})
-
-@end deftypemethod
-@deftypemethod Arrays {public static void} sort (char[]@w{ }@var{a})
-Sort a char array into ascending order. The sort algorithm is an optimised
- quicksort, as described in Jon L. Bentley and M. Douglas McIlroy's
- "Engineering a Sort Function", Software-Practice and Experience, Vol.
- 23(11) P. 1249-1265 (November 1993). This algorithm gives nlog(n)
- performance on many arrays that would take quadratic time with a standard
- quicksort.
-@end deftypemethod
-@deftypemethod Arrays {public static void} sort (char[]@w{ }@var{a}, int@w{ }@var{fromIndex}, int@w{ }@var{toIndex})
-
-@end deftypemethod
-@deftypemethod Arrays {public static void} sort (double[]@w{ }@var{a})
-Sort a double array into ascending order. The sort algorithm is an
- optimised quicksort, as described in Jon L. Bentley and M. Douglas
- McIlroy's "Engineering a Sort Function", Software-Practice and Experience,
- Vol. 23(11) P. 1249-1265 (November 1993). This algorithm gives nlog(n)
- performance on many arrays that would take quadratic time with a standard
- quicksort. Note that this implementation, like Sun's, has undefined
- behaviour if the array contains any NaN values.
-@end deftypemethod
-@deftypemethod Arrays {public static void} sort (double[]@w{ }@var{a}, int@w{ }@var{fromIndex}, int@w{ }@var{toIndex})
-
-@end deftypemethod
-@deftypemethod Arrays {public static void} sort (float[]@w{ }@var{a})
-Sort a float array into ascending order. The sort algorithm is an
- optimised quicksort, as described in Jon L. Bentley and M. Douglas
- McIlroy's "Engineering a Sort Function", Software-Practice and Experience,
- Vol. 23(11) P. 1249-1265 (November 1993). This algorithm gives nlog(n)
- performance on many arrays that would take quadratic time with a standard
- quicksort. Note that this implementation, like Sun's, has undefined
- behaviour if the array contains any NaN values.
-@end deftypemethod
-@deftypemethod Arrays {public static void} sort (float[]@w{ }@var{a}, int@w{ }@var{fromIndex}, int@w{ }@var{toIndex})
-
-@end deftypemethod
-@deftypemethod Arrays {public static void} sort (int[]@w{ }@var{a})
-Sort an int array into ascending order. The sort algorithm is an optimised
- quicksort, as described in Jon L. Bentley and M. Douglas McIlroy's
- "Engineering a Sort Function", Software-Practice and Experience, Vol.
- 23(11) P. 1249-1265 (November 1993). This algorithm gives nlog(n)
- performance on many arrays that would take quadratic time with a standard
- quicksort.
-@end deftypemethod
-@deftypemethod Arrays {public static void} sort (int[]@w{ }@var{a}, int@w{ }@var{fromIndex}, int@w{ }@var{toIndex})
-
-@end deftypemethod
-@deftypemethod Arrays {public static void} sort (long[]@w{ }@var{a})
-Sort a long array into ascending order. The sort algorithm is an optimised
- quicksort, as described in Jon L. Bentley and M. Douglas McIlroy's
- "Engineering a Sort Function", Software-Practice and Experience, Vol.
- 23(11) P. 1249-1265 (November 1993). This algorithm gives nlog(n)
- performance on many arrays that would take quadratic time with a standard
- quicksort.
-@end deftypemethod
-@deftypemethod Arrays {public static void} sort (long[]@w{ }@var{a}, int@w{ }@var{fromIndex}, int@w{ }@var{toIndex})
-
-@end deftypemethod
-@deftypemethod Arrays {public static void} sort (short[]@w{ }@var{a})
-Sort a short array into ascending order. The sort algorithm is an
- optimised quicksort, as described in Jon L. Bentley and M. Douglas
- McIlroy's "Engineering a Sort Function", Software-Practice and Experience,
- Vol. 23(11) P. 1249-1265 (November 1993). This algorithm gives nlog(n)
- performance on many arrays that would take quadratic time with a standard
- quicksort.
-@end deftypemethod
-@deftypemethod Arrays {public static void} sort (short[]@w{ }@var{a}, int@w{ }@var{fromIndex}, int@w{ }@var{toIndex})
-
-@end deftypemethod
-@deftypemethod Arrays {public static void} sort (java.lang.Object[]@w{ }@var{a})
-Sort an array of Objects according to their natural ordering. The sort is
- guaranteed to be stable, that is, equal elements will not be reordered.
- The sort algorithm is a mergesort with the merge omitted if the last
- element of one half comes before the first element of the other half. This
- algorithm gives guaranteed O(nlog(n)) time, at the expense of making a
- copy of the array.
-@end deftypemethod
-@deftypemethod Arrays {public static void} sort (java.lang.Object[]@w{ }@var{a}, java.util.Comparator@w{ }@var{c})
-Sort an array of Objects according to a Comparator. The sort is
- guaranteed to be stable, that is, equal elements will not be reordered.
- The sort algorithm is a mergesort with the merge omitted if the last
- element of one half comes before the first element of the other half. This
- algorithm gives guaranteed O(nlog(n)) time, at the expense of making a
- copy of the array.
-@end deftypemethod
-@deftypemethod Arrays {public static void} sort (java.lang.Object[]@w{ }@var{a}, int@w{ }@var{fromIndex}, int@w{ }@var{toIndex})
-Sort an array of Objects according to their natural ordering. The sort is
- guaranteed to be stable, that is, equal elements will not be reordered.
- The sort algorithm is a mergesort with the merge omitted if the last
- element of one half comes before the first element of the other half. This
- algorithm gives guaranteed O(nlog(n)) time, at the expense of making a
- copy of the array.
-@end deftypemethod
-@deftypemethod Arrays {public static void} sort (java.lang.Object[]@w{ }@var{a}, int@w{ }@var{fromIndex}, int@w{ }@var{toIndex}, java.util.Comparator@w{ }@var{c})
-Sort an array of Objects according to a Comparator. The sort is
- guaranteed to be stable, that is, equal elements will not be reordered.
- The sort algorithm is a mergesort with the merge omitted if the last
- element of one half comes before the first element of the other half. This
- algorithm gives guaranteed O(nlog(n)) time, at the expense of making a
- copy of the array.
-@end deftypemethod
-@deftypemethod Arrays {public static List} asList (java.lang.Object[]@w{ }@var{a})
-Returns a list "view" of the specified array. This method is intended to
- make it easy to use the Collections API with existing array-based APIs and
- programs.
-@end deftypemethod
-@deftypemethod BitSet {public void} and (java.util.BitSet@w{ }@var{bs})
-Performs the logical AND operation on this bit set and the
- given @code{set}. This means it builds the intersection
- of the two sets. The result is stored into this bit set.
-@end deftypemethod
-@deftypemethod BitSet {public void} andNot (java.util.BitSet@w{ }@var{bs})
-Performs the logical AND operation on this bit set and the
- complement of the given @code{set}. This means it
- selects every element in the first set, that isn't in the
- second set. The result is stored into this bit set.
-@end deftypemethod
-@deftypemethod BitSet {public void} clear (int@w{ }@var{pos})
-Removes the integer @code{bitIndex} from this set. That is
- the corresponding bit is cleared. If the index is not in the set,
- this method does nothing.
-@end deftypemethod
-@deftypemethod BitSet {public Object} clone ()
-Create a clone of this bit set, that is an instance of the same
- class and contains the same elements. But it doesn't change when
- this bit set changes.
-@end deftypemethod
-@deftypemethod BitSet {public boolean} equals (java.lang.Object@w{ }@var{obj})
-Returns true if the @code{obj} is a bit set that contains
- exactly the same elements as this bit set, otherwise false.
-@end deftypemethod
-@deftypemethod BitSet {public boolean} get (int@w{ }@var{pos})
-Returns true if the integer @code{bitIndex} is in this bit
- set, otherwise false.
-@end deftypemethod
-@deftypemethod BitSet {public int} hashCode ()
-Returns a hash code value for this bit set. The hash code of
- two bit sets containing the same integers is identical. The algorithm
- used to compute it is as follows:
-
- Suppose the bits in the BitSet were to be stored in an array of
- long integers called @code{bits}, in such a manner that
- bit @code{k} is set in the BitSet (for non-negative values
- of @code{k}) if and only if
-
- <pre>
- ((k/64) < bits.length) && ((bits[k/64] & (1L << (bit % 64))) != 0)
- </pre>
-
- Then the following definition of the hashCode method
- would be a correct implementation of the actual algorithm:
-
- <pre>
- public int hashCode() {
- long h = 1234;
- for (int i = bits.length-1; i>=0; i--) {
- h ^= bits[i] * (i + 1);
- }
- return (int)((h >> 32) ^ h);
- }
- </pre>
-
- Note that the hash code values changes, if the set is changed.
-@end deftypemethod
-@deftypemethod BitSet {public int} length ()
-Returns the logical number of bits actually used by this bit
- set. It returns the index of the highest set bit plus one.
- Note that this method doesn't return the number of set bits.
-@end deftypemethod
-@deftypemethod BitSet {public void} or (java.util.BitSet@w{ }@var{bs})
-Performs the logical OR operation on this bit set and the
- given @code{set}. This means it builds the union
- of the two sets. The result is stored into this bit set, which
- grows as necessary.
-@end deftypemethod
-@deftypemethod BitSet {public void} set (int@w{ }@var{pos})
-Add the integer @code{bitIndex} to this set. That is
- the corresponding bit is set to true. If the index was already in
- the set, this method does nothing. The size of this structure
- is automatically increased as necessary.
-@end deftypemethod
-@deftypemethod BitSet {public int} size ()
-Returns the number of bits actually used by this bit set. Note
- that this method doesn't return the number of set bits.
-@end deftypemethod
-@deftypemethod BitSet {public String} toString ()
-Returns the string representation of this bit set. This
- consists of a comma separated list of the integers in this set
- surrounded by curly braces. There is a space after each comma.
-@end deftypemethod
-@deftypemethod BitSet {public void} xor (java.util.BitSet@w{ }@var{bs})
-Performs the logical XOR operation on this bit set and the
- given @code{set}. This means it builds the symmetric
- remainder of the two sets (the elements that are in one set,
- but not in the other). The result is stored into this bit set,
- which grows as necessary.
-@end deftypemethod
-@deftypemethod Calendar {public static synchronized Calendar} getInstance ()
-Creates a calendar representing the actual time, using the default
- time zone and locale.
-@end deftypemethod
-@deftypemethod Calendar {public static synchronized Calendar} getInstance (java.util.TimeZone@w{ }@var{zone})
-Creates a calendar representing the actual time, using the given
- time zone and the default locale.
-@end deftypemethod
-@deftypemethod Calendar {public static synchronized Calendar} getInstance (java.util.Locale@w{ }@var{locale})
-Creates a calendar representing the actual time, using the default
- time zone and the given locale.
-@end deftypemethod
-@deftypemethod Calendar {public static synchronized Calendar} getInstance (java.util.TimeZone@w{ }@var{zone}, java.util.Locale@w{ }@var{locale})
-Creates a calendar representing the actual time, using the given
- time zone and locale.
-@end deftypemethod
-@deftypemethod Calendar {public static synchronized Locale} getAvailableLocales ()
-Gets the set of locales for which a Calendar is availiable.
-@end deftypemethod
-@deftypemethod Calendar {protected abstract void} computeTime ()
-Converts the time field values (@code{fields}) to
- milliseconds since the epoch UTC (@code{time}). Override
- this method if you write your own Calendar.
-@end deftypemethod
-@deftypemethod Calendar {protected abstract void} computeFields ()
-Converts the milliseconds since the epoch UTC
- (@code{time}) to time fields
- (@code{fields}). Override this method if you write your
- own Calendar.
-@end deftypemethod
-@deftypemethod Calendar {public final Date} getTime ()
-Converts the time represented by this object to a
- @code{Date}-Object.
-@end deftypemethod
-@deftypemethod Calendar {public final void} setTime (java.util.Date@w{ }@var{date})
-Sets this Calender's time to the given Date. All time fields
- are invalidated by this method.
-@end deftypemethod
-@deftypemethod Calendar {protected long} getTimeInMillis ()
-Returns the time represented by this Calendar.
-@end deftypemethod
-@deftypemethod Calendar {protected void} setTimeInMillis (long@w{ }@var{time})
-Sets this Calender's time to the given Time. All time fields
- are invalidated by this method.
-@end deftypemethod
-@deftypemethod Calendar {public final int} get (int@w{ }@var{field})
-Gets the value of the specified field. They are recomputed
- if they are invalid.
-@end deftypemethod
-@deftypemethod Calendar {protected final int} internalGet (int@w{ }@var{field})
-Gets the value of the specified field. This method doesn't
- recompute the fields, if they are invalid.
-@end deftypemethod
-@deftypemethod Calendar {public final void} set (int@w{ }@var{field}, int@w{ }@var{value})
-Sets the time field with the given value. This does invalidate
- the time in milliseconds.
-@end deftypemethod
-@deftypemethod Calendar {public final void} set (int@w{ }@var{year}, int@w{ }@var{month}, int@w{ }@var{date})
-Sets the fields for year, month, and date
-@end deftypemethod
-@deftypemethod Calendar {public final void} set (int@w{ }@var{year}, int@w{ }@var{month}, int@w{ }@var{date}, int@w{ }@var{hour}, int@w{ }@var{minute})
-Sets the fields for year, month, date, hour, and minute
-@end deftypemethod
-@deftypemethod Calendar {public final void} set (int@w{ }@var{year}, int@w{ }@var{month}, int@w{ }@var{date}, int@w{ }@var{hour}, int@w{ }@var{minute}, int@w{ }@var{second})
-Sets the fields for year, month, date, hour, and minute
-@end deftypemethod
-@deftypemethod Calendar {public final void} clear ()
-Clears the values of all the time fields.
-@end deftypemethod
-@deftypemethod Calendar {public final void} clear (int@w{ }@var{field})
-Clears the values of the specified time field.
-@end deftypemethod
-@deftypemethod Calendar {public final boolean} isSet (int@w{ }@var{field})
-Determines if the specified field has a valid value.
-@end deftypemethod
-@deftypemethod Calendar {protected void} complete ()
-Fills any unset fields in the time field list
-@end deftypemethod
-@deftypemethod Calendar {public boolean} equals (java.lang.Object@w{ }@var{o})
-Compares the given calender with this.
-@end deftypemethod
-@deftypemethod Calendar {public int} hashCode ()
-Returns a hash code for this calendar.
-@end deftypemethod
-@deftypemethod Calendar {public boolean} before (java.lang.Object@w{ }@var{o})
-Compares the given calender with this.
-@end deftypemethod
-@deftypemethod Calendar {public boolean} after (java.lang.Object@w{ }@var{o})
-Compares the given calender with this.
-@end deftypemethod
-@deftypemethod Calendar {public abstract void} add (int@w{ }@var{field}, int@w{ }@var{amount})
-Adds the specified amount of time to the given time field. The
- amount may be negative to subtract the time. If the field overflows
- it does what you expect: Jan, 25 + 10 Days is Feb, 4.
-@end deftypemethod
-@deftypemethod Calendar {public abstract void} roll (int@w{ }@var{field}, boolean@w{ }@var{up})
-Rolls the specified time field up or down. This means add one
- to the specified field, but don't change the other fields. If
- the maximum for this field is reached, start over with the
- minimum value. <br>
-
- <strong>Note:</strong> There may be situation, where the other
- fields must be changed, e.g rolling the month on May, 31.
- The date June, 31 is automatically converted to July, 1.
-@end deftypemethod
-@deftypemethod Calendar {public void} roll (int@w{ }@var{field}, int@w{ }@var{amount})
-Rolls up or down the specified time field by the given amount.
- A negative amount rolls down. The default implementation is
- call @code{roll(int, boolean)} for the specified amount.
-
- Subclasses should override this method to do more intuitiv things.
-@end deftypemethod
-@deftypemethod Calendar {public void} setTimeZone (java.util.TimeZone@w{ }@var{zone})
-Sets the time zone to the specified value.
-@end deftypemethod
-@deftypemethod Calendar {public TimeZone} getTimeZone ()
-Gets the time zone of this calendar
-@end deftypemethod
-@deftypemethod Calendar {public void} setLenient (boolean@w{ }@var{lenient})
-Specifies if the date/time interpretation should be lenient.
- If the flag is set, a date such as "February 30, 1996" will be
- treated as the 29th day after the February 1. If this flag
- is false, such dates will cause an exception.
-@end deftypemethod
-@deftypemethod Calendar {public boolean} isLenient ()
-Tells if the date/time interpretation is lenient.
-@end deftypemethod
-@deftypemethod Calendar {public void} setFirstDayOfWeek (int@w{ }@var{value})
-Sets what the first day of week is. This is used for
- WEEK_OF_MONTH and WEEK_OF_YEAR fields.
-@end deftypemethod
-@deftypemethod Calendar {public int} getFirstDayOfWeek ()
-Gets what the first day of week is. This is used for
- WEEK_OF_MONTH and WEEK_OF_YEAR fields.
-@end deftypemethod
-@deftypemethod Calendar {public void} setMinimalDaysInFirstWeek (int@w{ }@var{value})
-Sets how many days are required in the first week of the year.
- If the first day of the year should be the first week you should
- set this value to 1. If the first week must be a full week, set
- it to 7.
-@end deftypemethod
-@deftypemethod Calendar {public int} getMinimalDaysInFirstWeek ()
-Gets how many days are required in the first week of the year.
-@end deftypemethod
-@deftypemethod Calendar {public abstract int} getMinimum (int@w{ }@var{field})
-Gets the smallest value that is allowed for the specified field.
-@end deftypemethod
-@deftypemethod Calendar {public abstract int} getMaximum (int@w{ }@var{field})
-Gets the biggest value that is allowed for the specified field.
-@end deftypemethod
-@deftypemethod Calendar {public abstract int} getGreatestMinimum (int@w{ }@var{field})
-Gets the greatest minimum value that is allowed for the specified field.
-@end deftypemethod
-@deftypemethod Calendar {public abstract int} getLeastMaximum (int@w{ }@var{field})
-Gets the smallest maximum value that is allowed for the
- specified field. For example this is 28 for DAY_OF_MONTH.
-@end deftypemethod
-@deftypemethod Calendar {public Object} clone ()
-Return a clone of this object.
-@end deftypemethod
-@deftypemethod Calendar {public String} toString ()
-Returns a string representation of this object. It is mainly
- for debugging purposes and its content is implementation
- specific.
-@end deftypemethod
-@deftypemethod Collection {public int} size ()
-
-@end deftypemethod
-@deftypemethod Collection {public boolean} isEmpty ()
-
-@end deftypemethod
-@deftypemethod Collection {public boolean} contains (java.lang.Object@w{ }@var{o})
-
-@end deftypemethod
-@deftypemethod Collection {public Iterator} iterator ()
-
-@end deftypemethod
-@deftypemethod Collection {public Object} toArray ()
-
-@end deftypemethod
-@deftypemethod Collection {public Object} toArray (java.lang.Object[]@w{ }@var{a})
-
-@end deftypemethod
-@deftypemethod Collection {public boolean} add (java.lang.Object@w{ }@var{o})
-
-@end deftypemethod
-@deftypemethod Collection {public boolean} remove (java.lang.Object@w{ }@var{o})
-
-@end deftypemethod
-@deftypemethod Collection {public boolean} containsAll (java.util.Collection@w{ }@var{c})
-
-@end deftypemethod
-@deftypemethod Collection {public boolean} addAll (java.util.Collection@w{ }@var{c})
-
-@end deftypemethod
-@deftypemethod Collection {public boolean} removeAll (java.util.Collection@w{ }@var{c})
-
-@end deftypemethod
-@deftypemethod Collection {public boolean} retainAll (java.util.Collection@w{ }@var{c})
-
-@end deftypemethod
-@deftypemethod Collection {public void} clear ()
-
-@end deftypemethod
-@deftypemethod Collection {public boolean} equals (java.lang.Object@w{ }@var{o})
-
-@end deftypemethod
-@deftypemethod Collection {public int} hashCode ()
-
-@end deftypemethod
-@deftypemethod Collections {public static int} binarySearch (java.util.List@w{ }@var{l}, java.lang.Object@w{ }@var{key})
-Perform a binary search of a List for a key, using the natural ordering of
- the elements. The list must be sorted (as by the sort() method) - if it is
- not, the behaviour of this method is undefined, and may be an infinite
- loop. Further, the key must be comparable with every item in the list. If
- the list contains the key more than once, any one of them may be found. To
- avoid pathological behaviour on sequential-access lists, a linear search
- is used if (l instanceof AbstractSequentialList). Note: although the
- specification allows for an infinite loop if the list is unsorted, it will
- not happen in this (Classpath) implementation.
-@end deftypemethod
-@deftypemethod Collections {public static int} binarySearch (java.util.List@w{ }@var{l}, java.lang.Object@w{ }@var{key}, java.util.Comparator@w{ }@var{c})
-Perform a binary search of a List for a key, using a supplied Comparator.
- The list must be sorted (as by the sort() method with the same Comparator)
- - if it is not, the behaviour of this method is undefined, and may be an
- infinite loop. Further, the key must be comparable with every item in the
- list. If the list contains the key more than once, any one of them may be
- found. To avoid pathological behaviour on sequential-access lists, a
- linear search is used if (l instanceof AbstractSequentialList). Note:
- although the specification allows for an infinite loop if the list is
- unsorted, it will not happen in this (Classpath) implementation.
-@end deftypemethod
-@deftypemethod Collections {public static void} copy (java.util.List@w{ }@var{dest}, java.util.List@w{ }@var{source})
-Copy one list to another. If the destination list is longer than the
- source list, the remaining elements are unaffected. This method runs in
- linear time.
-@end deftypemethod
-@deftypemethod Collections {public static Enumeration} enumeration (java.util.Collection@w{ }@var{c})
-Returns an Enumeration over a collection. This allows interoperability
- with legacy APIs that require an Enumeration as input.
-@end deftypemethod
-@deftypemethod Collections {public static void} fill (java.util.List@w{ }@var{l}, java.lang.Object@w{ }@var{val})
-Replace every element of a list with a given value. This method runs in
- linear time.
-@end deftypemethod
-@deftypemethod Collections {public static Object} max (java.util.Collection@w{ }@var{c})
-Find the maximum element in a Collection, according to the natural
- ordering of the elements. This implementation iterates over the
- Collection, so it works in linear time.
-@end deftypemethod
-@deftypemethod Collections {public static Object} max (java.util.Collection@w{ }@var{c}, java.util.Comparator@w{ }@var{order})
-Find the maximum element in a Collection, according to a specified
- Comparator. This implementation iterates over the Collection, so it
- works in linear time.
-@end deftypemethod
-@deftypemethod Collections {public static Object} min (java.util.Collection@w{ }@var{c})
-Find the minimum element in a Collection, according to the natural
- ordering of the elements. This implementation iterates over the
- Collection, so it works in linear time.
-@end deftypemethod
-@deftypemethod Collections {public static Object} min (java.util.Collection@w{ }@var{c}, java.util.Comparator@w{ }@var{order})
-Find the minimum element in a Collection, according to a specified
- Comparator. This implementation iterates over the Collection, so it
- works in linear time.
-@end deftypemethod
-@deftypemethod Collections {public static List} nCopies (int@w{ }@var{n}, java.lang.Object@w{ }@var{o})
-Creates an immutable list consisting of the same object repeated n times.
- The returned object is tiny, consisting of only a single reference to the
- object and a count of the number of elements. It is Serializable.
-@end deftypemethod
-@deftypemethod Collections {public static void} reverse (java.util.List@w{ }@var{l})
-Reverse a given list. This method works in linear time.
-@end deftypemethod
-@deftypemethod Collections {public static Comparator} reverseOrder ()
-Get a comparator that implements the reverse of natural ordering. This is
- intended to make it easy to sort into reverse order, by simply passing
- Collections.reverseOrder() to the sort method. The return value of this
- method is Serializable.
-@end deftypemethod
-@deftypemethod Collections {public static void} shuffle (java.util.List@w{ }@var{l})
-Shuffle a list according to a default source of randomness. The algorithm
- used would result in a perfectly fair shuffle (that is, each element would
- have an equal chance of ending up in any position) with a perfect source
- of randomness; in practice the results are merely very close to perfect.
-
-
-
- This method operates in linear time on a random-access list, but may take
- quadratic time on a sequential-access list.
- Note: this (classpath) implementation will never take quadratic time, but
- it does make a copy of the list. This is in line with the behaviour of the
- sort methods and seems preferable.
-@end deftypemethod
-@deftypemethod Collections {public static void} shuffle (java.util.List@w{ }@var{l}, java.util.Random@w{ }@var{r})
-Shuffle a list according to a given source of randomness. The algorithm
- used iterates backwards over the list, swapping each element with an
- element randomly selected from the elements in positions less than or
- equal to it (using r.nextInt(int)).
-
-
-
- This algorithm would result in a perfectly fair shuffle (that is, each
- element would have an equal chance of ending up in any position) if r were
- a perfect source of randomness. In practise (eg if r = new Random()) the
- results are merely very close to perfect.
-
-
-
- This method operates in linear time on a random-access list, but may take
- quadratic time on a sequential-access list.
- Note: this (classpath) implementation will never take quadratic time, but
- it does make a copy of the list. This is in line with the behaviour of the
- sort methods and seems preferable.
-@end deftypemethod
-@deftypemethod Collections {public static Set} singleton (java.lang.Object@w{ }@var{o})
-Obtain an immutable Set consisting of a single element. The return value
- of this method is Serializable.
-@end deftypemethod
-@deftypemethod Collections {public static List} singletonList (java.lang.Object@w{ }@var{o})
-Obtain an immutable List consisting of a single element. The return value
- of this method is Serializable.
-@end deftypemethod
-@deftypemethod Collections {public static Map} singletonMap (java.lang.Object@w{ }@var{key}, java.lang.Object@w{ }@var{value})
-Obtain an immutable Map consisting of a single key value pair.
- The return value of this method is Serializable.
-@end deftypemethod
-@deftypemethod Collections {public static void} sort (java.util.List@w{ }@var{l})
-Sort a list according to the natural ordering of its elements. The list
- must be modifiable, but can be of fixed size. The sort algorithm is
- precisely that used by Arrays.sort(Object[]), which offers guaranteed
- nlog(n) performance. This implementation dumps the list into an array,
- sorts the array, and then iterates over the list setting each element from
- the array.
-@end deftypemethod
-@deftypemethod Collections {public static void} sort (java.util.List@w{ }@var{l}, java.util.Comparator@w{ }@var{c})
-Sort a list according to a specified Comparator. The list must be
- modifiable, but can be of fixed size. The sort algorithm is precisely that
- used by Arrays.sort(Object[], Comparator), which offers guaranteed
- nlog(n) performance. This implementation dumps the list into an array,
- sorts the array, and then iterates over the list setting each element from
- the array.
-@end deftypemethod
-@deftypemethod Collections {public static Collection} synchronizedCollection (java.util.Collection@w{ }@var{c})
-
-@end deftypemethod
-@deftypemethod Collections {public static List} synchronizedList (java.util.List@w{ }@var{l})
-
-@end deftypemethod
-@deftypemethod Collections {public static Map} synchronizedMap (java.util.Map@w{ }@var{m})
-
-@end deftypemethod
-@deftypemethod Collections {public static Set} synchronizedSet (java.util.Set@w{ }@var{s})
-
-@end deftypemethod
-@deftypemethod Collections {public static SortedMap} synchronizedSortedMap (java.util.SortedMap@w{ }@var{m})
-
-@end deftypemethod
-@deftypemethod Collections {public static SortedSet} synchronizedSortedSet (java.util.SortedSet@w{ }@var{s})
-
-@end deftypemethod
-@deftypemethod Collections {public static Collection} unmodifiableCollection (java.util.Collection@w{ }@var{c})
-
-@end deftypemethod
-@deftypemethod Collections {public static List} unmodifiableList (java.util.List@w{ }@var{l})
-
-@end deftypemethod
-@deftypemethod Collections {public static Map} unmodifiableMap (java.util.Map@w{ }@var{m})
-
-@end deftypemethod
-@deftypemethod Collections {public static Set} unmodifiableSet (java.util.Set@w{ }@var{s})
-
-@end deftypemethod
-@deftypemethod Collections {public static SortedMap} unmodifiableSortedMap (java.util.SortedMap@w{ }@var{m})
-
-@end deftypemethod
-@deftypemethod Collections {public static SortedSet} unmodifiableSortedSet (java.util.SortedSet@w{ }@var{s})
-
-@end deftypemethod
-@deftypemethod Comparator {public int} compare (java.lang.Object@w{ }@var{o1}, java.lang.Object@w{ }@var{o2})
-
-@end deftypemethod
-@deftypemethod Comparator {public boolean} equals (java.lang.Object@w{ }@var{obj})
-
-@end deftypemethod
-@deftypemethod Date {public static long} parse (java.lang.String@w{ }@var{string})
-
-@end deftypemethod
-@deftypemethod Date {public boolean} after (java.util.Date@w{ }@var{when})
-
-@end deftypemethod
-@deftypemethod Date {public boolean} before (java.util.Date@w{ }@var{when})
-
-@end deftypemethod
-@deftypemethod Date {public boolean} equals (java.lang.Object@w{ }@var{obj})
-
-@end deftypemethod
-@deftypemethod Date {public long} getTime ()
-
-@end deftypemethod
-@deftypemethod Date {public int} hashCode ()
-
-@end deftypemethod
-@deftypemethod Date {public void} setTime (long@w{ }@var{millis})
-
-@end deftypemethod
-@deftypemethod Date {public int} getYear ()
-
-@end deftypemethod
-@deftypemethod Date {public int} getMonth ()
-
-@end deftypemethod
-@deftypemethod Date {public int} getDate ()
-
-@end deftypemethod
-@deftypemethod Date {public int} getDay ()
-
-@end deftypemethod
-@deftypemethod Date {public int} getHours ()
-
-@end deftypemethod
-@deftypemethod Date {public int} getMinutes ()
-
-@end deftypemethod
-@deftypemethod Date {public int} getSeconds ()
-
-@end deftypemethod
-@deftypemethod Date {public void} setYear (int@w{ }@var{year})
-
-@end deftypemethod
-@deftypemethod Date {public void} setMonth (int@w{ }@var{month})
-
-@end deftypemethod
-@deftypemethod Date {public void} setDate (int@w{ }@var{date})
-
-@end deftypemethod
-@deftypemethod Date {public void} setHours (int@w{ }@var{hours})
-
-@end deftypemethod
-@deftypemethod Date {public void} setMinutes (int@w{ }@var{minutes})
-
-@end deftypemethod
-@deftypemethod Date {public void} setSeconds (int@w{ }@var{seconds})
-
-@end deftypemethod
-@deftypemethod Date {public int} getTimezoneOffset ()
-
-@end deftypemethod
-@deftypemethod Date {public String} toString ()
-
-@end deftypemethod
-@deftypemethod Date {public String} toGMTString ()
-
-@end deftypemethod
-@deftypemethod Date {public String} toLocaleString ()
-
-@end deftypemethod
-@deftypemethod Date {public static long} UTC (int@w{ }@var{year}, int@w{ }@var{month}, int@w{ }@var{date}, int@w{ }@var{hours}, int@w{ }@var{minutes}, int@w{ }@var{seconds})
-
-@end deftypemethod
-@deftypemethod Dictionary {public abstract Enumeration} elements ()
-
-@end deftypemethod
-@deftypemethod Dictionary {public abstract Object} get (java.lang.Object@w{ }@var{key}) @*throws NullPointerException
-
-@end deftypemethod
-@deftypemethod Dictionary {public abstract boolean} isEmpty ()
-
-@end deftypemethod
-@deftypemethod Dictionary {public abstract Enumeration} keys ()
-
-@end deftypemethod
-@deftypemethod Dictionary {public abstract Object} put (java.lang.Object@w{ }@var{key}, java.lang.Object@w{ }@var{elem}) @*throws NullPointerException
-
-@end deftypemethod
-@deftypemethod Dictionary {public abstract Object} remove (java.lang.Object@w{ }@var{key}) @*throws NullPointerException
-
-@end deftypemethod
-@deftypemethod Dictionary {public abstract int} size ()
-
-@end deftypemethod
-@deftypemethod Enumeration {public boolean} hasMoreElements ()
-
-@end deftypemethod
-@deftypemethod Enumeration {public Object} nextElement () @*throws NoSuchElementException
-
-@end deftypemethod
-@deftypemethod EventObject {public Object} getSource ()
-
-@end deftypemethod
-@deftypemethod EventObject {public String} toString ()
-
-@end deftypemethod
-@deftypemethod GregorianCalendar {public int} getMinimum (int@w{ }@var{calfield})
-
-@end deftypemethod
-@deftypemethod GregorianCalendar {public int} getGreatestMinimum (int@w{ }@var{calfield})
-
-@end deftypemethod
-@deftypemethod GregorianCalendar {public int} getMaximum (int@w{ }@var{calfield})
-
-@end deftypemethod
-@deftypemethod GregorianCalendar {public int} getLeastMaximum (int@w{ }@var{calfield})
-
-@end deftypemethod
-@deftypemethod GregorianCalendar {protected native void} computeFields ()
-
-@end deftypemethod
-@deftypemethod GregorianCalendar {protected native void} computeTime ()
-
-@end deftypemethod
-@deftypemethod GregorianCalendar {public void} add (int@w{ }@var{fld}, int@w{ }@var{amount})
-
-@end deftypemethod
-@deftypemethod GregorianCalendar {public void} roll (int@w{ }@var{fld}, boolean@w{ }@var{up})
-
-@end deftypemethod
-@deftypemethod GregorianCalendar {public final Date} getGregorianChange ()
-
-@end deftypemethod
-@deftypemethod GregorianCalendar {public void} setGregorianChange (java.util.Date@w{ }@var{date})
-
-@end deftypemethod
-@deftypemethod GregorianCalendar {public boolean} isLeapYear (int@w{ }@var{year})
-
-@end deftypemethod
-@deftypemethod GregorianCalendar {public boolean} after (java.lang.Object@w{ }@var{cal})
-
-@end deftypemethod
-@deftypemethod GregorianCalendar {public boolean} before (java.lang.Object@w{ }@var{cal})
-
-@end deftypemethod
-@deftypemethod GregorianCalendar {public boolean} equals (java.lang.Object@w{ }@var{obj})
-
-@end deftypemethod
-@deftypemethod GregorianCalendar {public int} hashCode ()
-
-@end deftypemethod
-@deftypemethod HashMap {public int} size ()
-returns the number of kay-value mappings currently in this Map
-@end deftypemethod
-@deftypemethod HashMap {public boolean} isEmpty ()
-returns true if there are no key-value mappings currently in this Map
-@end deftypemethod
-@deftypemethod HashMap {public boolean} containsValue (java.lang.Object@w{ }@var{value})
-returns true if this HashMap contains a value <pre>o</pre>, such that
- <pre>o.equals(value)</pre>.
-@end deftypemethod
-@deftypemethod HashMap {public boolean} containsKey (java.lang.Object@w{ }@var{key})
-returns true if the supplied object equals (<pre>equals()</pre>) a key
- in this HashMap
-@end deftypemethod
-@deftypemethod HashMap {public Object} get (java.lang.Object@w{ }@var{key})
-return the value in this Hashtable associated with the supplied key, or <pre>null</pre>
- if the key maps to nothing
-@end deftypemethod
-@deftypemethod HashMap {public Object} put (java.lang.Object@w{ }@var{key}, java.lang.Object@w{ }@var{value})
-puts the supplied value into the Map, mapped by the supplied key
-@end deftypemethod
-@deftypemethod HashMap {public Object} remove (java.lang.Object@w{ }@var{key})
-removes from the HashMap and returns the value which is mapped by the
- supplied key; if the key maps to nothing, then the HashMap remains unchanged,
- and <pre>null</pre> is returned
-@end deftypemethod
-@deftypemethod HashMap {public void} putAll (java.util.Map@w{ }@var{m})
-
-@end deftypemethod
-@deftypemethod HashMap {public void} clear ()
-
-@end deftypemethod
-@deftypemethod HashMap {public Object} clone ()
-returns a shallow clone of this HashMap (i.e. the Map itself is cloned, but
- its contents are not)
-@end deftypemethod
-@deftypemethod HashMap {public Set} keySet ()
-returns a "set view" of this HashMap's keys
-@end deftypemethod
-@deftypemethod HashMap {public Collection} values ()
-Returns a "collection view" (or "bag view") of this HashMap's values.
-@end deftypemethod
-@deftypemethod HashMap {public Set} entrySet ()
-Returns a "set view" of this HashMap's entries.
-@end deftypemethod
-@deftypemethod HashSet {public boolean} add (java.lang.Object@w{ }@var{o})
-adds the given Object to the set if it is not already in the Set,
- returns true if teh element was added, false otherwise
-@end deftypemethod
-@deftypemethod HashSet {public void} clear ()
-empties this Set of all elements; this is a fast operation [O(1)]
-@end deftypemethod
-@deftypemethod HashSet {public Object} clone ()
-returns a shallow copy of this Set (the Set itself is cloned; its
- elements are not)
-@end deftypemethod
-@deftypemethod HashSet {public boolean} contains (java.lang.Object@w{ }@var{o})
-returns true if the supplied element is in this Set, false otherwise
-@end deftypemethod
-@deftypemethod HashSet {public boolean} isEmpty ()
-returns true if this set has no elements in it (size() == 0)
-@end deftypemethod
-@deftypemethod HashSet {public Iterator} iterator ()
-returns an Iterator over the elements of this Set; the Iterator allows
- removal of elements
-@end deftypemethod
-@deftypemethod HashSet {public boolean} remove (java.lang.Object@w{ }@var{o})
-removes the supplied Object from this Set if it is in the Set; returns
- true if an element was removed, false otherwise
-@end deftypemethod
-@deftypemethod HashSet {public int} size ()
-returns the number of elements in this Set
-@end deftypemethod
-@deftypemethod Hashtable {public int} size ()
-Returns the number of key-value mappings currently in this Map
-@end deftypemethod
-@deftypemethod Hashtable {public boolean} isEmpty ()
-returns true if there are no key-value mappings currently in this Map
-@end deftypemethod
-@deftypemethod Hashtable {public synchronized Enumeration} keys ()
-
-@end deftypemethod
-@deftypemethod Hashtable {public synchronized Enumeration} elements ()
-
-@end deftypemethod
-@deftypemethod Hashtable {public synchronized boolean} contains (java.lang.Object@w{ }@var{value})
-returns true if this Hashtable contains a value <pre>o</pre>,
- such that <pre>o.equals(value)</pre>.
-
- Note: this is one of the <i>old</i> Hashtable methods which does
- not like null values; it throws NullPointerException if the
- supplied parameter is null.
-@end deftypemethod
-@deftypemethod Hashtable {public boolean} containsValue (java.lang.Object@w{ }@var{value})
-returns true if this Hashtable contains a value <pre>o</pre>, such that
- <pre>o.equals(value)</pre>.
-@end deftypemethod
-@deftypemethod Hashtable {public synchronized boolean} containsKey (java.lang.Object@w{ }@var{key})
-returns true if the supplied object equals (<pre>equals()</pre>) a key
- in this Hashtable
-@end deftypemethod
-@deftypemethod Hashtable {public synchronized Object} get (java.lang.Object@w{ }@var{key})
-return the value in this Hashtable associated with the supplied key, or <pre>null</pre>
- if the key maps to nothing
-@end deftypemethod
-@deftypemethod Hashtable {public synchronized Object} put (java.lang.Object@w{ }@var{key}, java.lang.Object@w{ }@var{value})
-puts the supplied value into the Map, mapped by the supplied key
-@end deftypemethod
-@deftypemethod Hashtable {public synchronized Object} remove (java.lang.Object@w{ }@var{key})
-removes from the table and returns the value which is mapped by the
- supplied key; if the key maps to nothing, then the table remains
- unchanged, and <pre>null</pre> is returned
-@end deftypemethod
-@deftypemethod Hashtable {public synchronized void} putAll (java.util.Map@w{ }@var{m})
-
-@end deftypemethod
-@deftypemethod Hashtable {public synchronized void} clear ()
-
-@end deftypemethod
-@deftypemethod Hashtable {public synchronized Object} clone ()
-returns a shallow clone of this Hashtable (i.e. the Map itself is cloned,
- but its contents are not)
-@end deftypemethod
-@deftypemethod Hashtable {public synchronized String} toString ()
-
-@end deftypemethod
-@deftypemethod Hashtable {public Set} keySet ()
-returns a "set view" of this Hashtable's keys
-@end deftypemethod
-@deftypemethod Hashtable {public Collection} values ()
-Returns a "collection view" (or "bag view") of this Hashtable's values.
-@end deftypemethod
-@deftypemethod Hashtable {public Set} entrySet ()
-Returns a "set view" of this Hashtable's entries.
-@end deftypemethod
-@deftypemethod Hashtable {public boolean} equals (java.lang.Object@w{ }@var{o})
-returns true if this Hashtable equals the supplied Object <pre>o</pre>;
- that is:
- <pre>
- if (o instanceof Map)
- and
- o.keySet().equals(keySet())
- and
- for each key in o.keySet(), o.get(key).equals(get(key))
-</pre>
-@end deftypemethod
-@deftypemethod Hashtable {public int} hashCode ()
-a Map's hashCode is the sum of the hashCodes of all of its
-Map.Entry objects
-@end deftypemethod
-@deftypemethod Hashtable {protected void} rehash ()
-increases the size of the Hashtable and rehashes all keys to new array
- indices; this is called when the addition of a new value would cause
- size() > threshold. Note that the existing Entry objects are reused in
- the new hash table.
-@end deftypemethod
-@deftypemethod Iterator {public boolean} hasNext ()
-
-@end deftypemethod
-@deftypemethod Iterator {public Object} next ()
-
-@end deftypemethod
-@deftypemethod Iterator {public void} remove ()
-
-@end deftypemethod
-@deftypemethod LinkedList {public Object} getFirst ()
-
-@end deftypemethod
-@deftypemethod LinkedList {public Object} getLast ()
-
-@end deftypemethod
-@deftypemethod LinkedList {public Object} removeFirst ()
-
-@end deftypemethod
-@deftypemethod LinkedList {public Object} removeLast ()
-
-@end deftypemethod
-@deftypemethod LinkedList {public void} addFirst (java.lang.Object@w{ }@var{o})
-
-@end deftypemethod
-@deftypemethod LinkedList {public void} addLast (java.lang.Object@w{ }@var{o})
-
-@end deftypemethod
-@deftypemethod LinkedList {public boolean} contains (java.lang.Object@w{ }@var{o})
-
-@end deftypemethod
-@deftypemethod LinkedList {public int} size ()
-
-@end deftypemethod
-@deftypemethod LinkedList {public boolean} add (java.lang.Object@w{ }@var{o})
-
-@end deftypemethod
-@deftypemethod LinkedList {public boolean} remove (java.lang.Object@w{ }@var{o})
-
-@end deftypemethod
-@deftypemethod LinkedList {public boolean} addAll (java.util.Collection@w{ }@var{c})
-
-@end deftypemethod
-@deftypemethod LinkedList {public boolean} addAll (int@w{ }@var{index}, java.util.Collection@w{ }@var{c})
-
-@end deftypemethod
-@deftypemethod LinkedList {public void} clear ()
-
-@end deftypemethod
-@deftypemethod LinkedList {public Object} get (int@w{ }@var{index})
-
-@end deftypemethod
-@deftypemethod LinkedList {public Object} set (int@w{ }@var{index}, java.lang.Object@w{ }@var{o})
-
-@end deftypemethod
-@deftypemethod LinkedList {public void} add (int@w{ }@var{index}, java.lang.Object@w{ }@var{o})
-
-@end deftypemethod
-@deftypemethod LinkedList {public Object} remove (int@w{ }@var{index})
-
-@end deftypemethod
-@deftypemethod LinkedList {public int} indexOf (java.lang.Object@w{ }@var{o})
-
-@end deftypemethod
-@deftypemethod LinkedList {public int} lastIndexOf (java.lang.Object@w{ }@var{o})
-
-@end deftypemethod
-@deftypemethod LinkedList {public ListIterator} listIterator (int@w{ }@var{index})
-Obtain a ListIterator over this list, starting at a given index. The
- ListIterator returned by this method supports the add, remove and set
- methods.
-@end deftypemethod
-@deftypemethod LinkedList {public Object} clone ()
-Create a shallow copy of this LinkedList.
-@end deftypemethod
-@deftypemethod LinkedList {public Object} toArray ()
-
-@end deftypemethod
-@deftypemethod LinkedList {public Object} toArray (java.lang.Object[]@w{ }@var{array})
-
-@end deftypemethod
-@deftypemethod ListIterator {public boolean} hasNext ()
-
-@end deftypemethod
-@deftypemethod ListIterator {public Object} next ()
-
-@end deftypemethod
-@deftypemethod ListIterator {public boolean} hasPrevious ()
-
-@end deftypemethod
-@deftypemethod ListIterator {public Object} previous ()
-
-@end deftypemethod
-@deftypemethod ListIterator {public int} nextIndex ()
-
-@end deftypemethod
-@deftypemethod ListIterator {public int} previousIndex ()
-
-@end deftypemethod
-@deftypemethod ListIterator {public void} remove ()
-
-@end deftypemethod
-@deftypemethod ListIterator {public void} set (java.lang.Object@w{ }@var{o})
-
-@end deftypemethod
-@deftypemethod ListIterator {public void} add (java.lang.Object@w{ }@var{o})
-
-@end deftypemethod
-@deftypemethod List {public void} add (int@w{ }@var{index}, java.lang.Object@w{ }@var{o})
-Insert an element into the list at a given position.
-@end deftypemethod
-@deftypemethod List {public boolean} add (java.lang.Object@w{ }@var{o})
-Add an element to the end of the list.
-@end deftypemethod
-@deftypemethod List {public boolean} addAll (int@w{ }@var{index}, java.util.Collection@w{ }@var{c})
-Insert the contents of a collection into the list at a given position.
-@end deftypemethod
-@deftypemethod List {public boolean} addAll (java.util.Collection@w{ }@var{c})
-Add the contents of a collection to the end of the list.
-@end deftypemethod
-@deftypemethod List {public void} clear ()
-Clear the list, such that a subsequent call to isEmpty() would return
- true.
-@end deftypemethod
-@deftypemethod List {public boolean} contains (java.lang.Object@w{ }@var{o})
-Test whether this list contains a given object as one of its elements.
-@end deftypemethod
-@deftypemethod List {public boolean} containsAll (java.util.Collection@w{ }@var{c})
-Test whether this list contains every element in a given collection.
-@end deftypemethod
-@deftypemethod List {public boolean} equals (java.lang.Object@w{ }@var{o})
-Test whether this list is equal to another object. A List is defined to be
- equal to an object if and only if that object is also a List, and the two
- lists are equal. Two lists l1 and l2 are defined to be equal if and only
- if @code{l1.size() == l2.size()}, and for every integer n between 0
- and @code{l1.size() - 1} inclusive, @code{l1.get(n) == null ?
- l2.get(n) == null : l1.get(n).equals(l2.get(n))}.
-@end deftypemethod
-@deftypemethod List {public Object} get (int@w{ }@var{index})
-Get the element at a given index in this list.
-@end deftypemethod
-@deftypemethod List {public int} hashCode ()
-Obtain a hash code for this list. In order to obey the general contract of
- the hashCode method of class Object, this value is calculated as follows:
- <pre>
- hashCode = 1;
- Iterator i = list.iterator();
- while (i.hasNext()) {
- Object obj = i.next();
- hashCode = 31*hashCode + (obj==null ? 0 : obj.hashCode());
- }
- </pre>
- This ensures that the general contract of Object.hashCode() is adhered to.
-@end deftypemethod
-@deftypemethod List {public int} indexOf (java.lang.Object@w{ }@var{o})
-Obtain the first index at which a given object is to be found in this
- list.
-@end deftypemethod
-@deftypemethod List {public boolean} isEmpty ()
-Test whether this list is empty, that is, if size() == 0.
-@end deftypemethod
-@deftypemethod List {public Iterator} iterator ()
-Obtain an Iterator over this list.
-@end deftypemethod
-@deftypemethod List {public int} lastIndexOf (java.lang.Object@w{ }@var{o})
-Obtain the last index at which a given object is to be found in this
- list.
-@end deftypemethod
-@deftypemethod List {public ListIterator} listIterator ()
-Obtain a ListIterator over this list, starting at the beginning.
-@end deftypemethod
-@deftypemethod List {public ListIterator} listIterator (int@w{ }@var{index})
-Obtain a ListIterator over this list, starting at a given position.
-@end deftypemethod
-@deftypemethod List {public Object} remove (int@w{ }@var{index})
-Remove the element at a given position in this list.
-@end deftypemethod
-@deftypemethod List {public boolean} remove (java.lang.Object@w{ }@var{o})
-Remove the first occurence of an object from this list. That is, remove
- the first element e such that @code{o == null ? e == null :
- o.equals(e)}.
-@end deftypemethod
-@deftypemethod List {public boolean} removeAll (java.util.Collection@w{ }@var{c})
-Remove all elements of a given collection from this list. That is, remove
- every element e such that c.contains(e).
-@end deftypemethod
-@deftypemethod List {public boolean} retainAll (java.util.Collection@w{ }@var{c})
-Remove all elements of this list that are not contained in a given
- collection. That is, remove every element e such that !c.contains(e).
-@end deftypemethod
-@deftypemethod List {public Object} set (int@w{ }@var{index}, java.lang.Object@w{ }@var{o})
-Replace an element of this list with another object.
-@end deftypemethod
-@deftypemethod List {public int} size ()
-Get the number of elements in this list.
-@end deftypemethod
-@deftypemethod List {public List} subList (int@w{ }@var{fromIndex}, int@w{ }@var{toIndex})
-Obtain a List view of a subsection of this list, from fromIndex
- (inclusive) to toIndex (exclusive). The returned list should be modifiable
- if and only if this list is modifiable. Changes to the returned list
- should be reflected in this list. If this list is structurally modified in
- any way other than through the returned list, the result of any subsequent
- operations on the returned list is undefined.
-@end deftypemethod
-@deftypemethod List {public Object} toArray ()
-Copy the current contents of this list into an array.
-@end deftypemethod
-@deftypemethod List {public Object} toArray (java.lang.Object[]@w{ }@var{a})
-Copy the current contents of this list into an array. If the array passed
- as an argument has length less than that of this list, an array of the
- same run-time type as a, and length equal to the length of this list, is
- allocated using Reflection. Otherwise, a itself is used. The elements of
- this list are copied into it, and if there is space in the array, the
- following element is set to null. The resultant array is returned.
- Note: The fact that the following element is set to null is only useful
- if it is known that this list does not contain any null elements.
-@end deftypemethod
-@deftypemethod ListResourceBundle {public final Object} handleGetObject (java.lang.String@w{ }@var{key})
-
-@end deftypemethod
-@deftypemethod ListResourceBundle {public Enumeration} getKeys ()
-
-@end deftypemethod
-@deftypemethod ListResourceBundle {protected abstract Object} getContents ()
-
-@end deftypemethod
-@deftypemethod Locale {public Object} clone ()
-
-@end deftypemethod
-@deftypemethod Locale {public boolean} equals (java.lang.Object@w{ }@var{obj})
-
-@end deftypemethod
-@deftypemethod Locale {public String} getCountry ()
-
-@end deftypemethod
-@deftypemethod Locale {public String} getLanguage ()
-
-@end deftypemethod
-@deftypemethod Locale {public String} getVariant ()
-
-@end deftypemethod
-@deftypemethod Locale {public int} hashCode ()
-
-@end deftypemethod
-@deftypemethod Locale {public static Locale} getDefault ()
-
-@end deftypemethod
-@deftypemethod Locale {public static void} setDefault (java.util.Locale@w{ }@var{newLocale})
-
-@end deftypemethod
-@deftypemethod Locale {public String} toString ()
-
-@end deftypemethod
-@deftypemethod Map {public void} clear ()
-
-@end deftypemethod
-@deftypemethod Map {public boolean} containsKey (java.lang.Object@w{ }@var{key})
-
-@end deftypemethod
-@deftypemethod Map {public boolean} containsValue (java.lang.Object@w{ }@var{value})
-
-@end deftypemethod
-@deftypemethod Map {public Set} entrySet ()
-
-@end deftypemethod
-@deftypemethod Map {public boolean} equals (java.lang.Object@w{ }@var{o})
-
-@end deftypemethod
-@deftypemethod Map {public Object} get (java.lang.Object@w{ }@var{key})
-
-@end deftypemethod
-@deftypemethod Map {public Object} put (java.lang.Object@w{ }@var{key}, java.lang.Object@w{ }@var{value})
-
-@end deftypemethod
-@deftypemethod Map {public int} hashCode ()
-
-@end deftypemethod
-@deftypemethod Map {public boolean} isEmpty ()
-
-@end deftypemethod
-@deftypemethod Map {public Set} keySet ()
-
-@end deftypemethod
-@deftypemethod Map {public void} putAll (java.util.Map@w{ }@var{m})
-
-@end deftypemethod
-@deftypemethod Map {public Object} remove (java.lang.Object@w{ }@var{o})
-
-@end deftypemethod
-@deftypemethod Map {public int} size ()
-
-@end deftypemethod
-@deftypemethod Map {public Collection} values ()
-
-@end deftypemethod
-@deftypemethod Map.Entry {public Object} getKey ()
-
-@end deftypemethod
-@deftypemethod Map.Entry {public Object} getValue ()
-
-@end deftypemethod
-@deftypemethod Map.Entry {public Object} setValue (java.lang.Object@w{ }@var{value})
-
-@end deftypemethod
-@deftypemethod Map.Entry {public int} hashCode ()
-
-@end deftypemethod
-@deftypemethod Map.Entry {public boolean} equals (java.lang.Object@w{ }@var{o})
-
-@end deftypemethod
-@deftypemethod MissingResourceException {public String} getClassName ()
-
-@end deftypemethod
-@deftypemethod MissingResourceException {public String} getKey ()
-
-@end deftypemethod
-@deftypemethod Observable {public synchronized void} addObserver (java.util.Observer@w{ }@var{obs})
-
-@end deftypemethod
-@deftypemethod Observable {protected synchronized void} clearChanged ()
-
-@end deftypemethod
-@deftypemethod Observable {public synchronized int} countObservers ()
-
-@end deftypemethod
-@deftypemethod Observable {public synchronized void} deleteObserver (java.util.Observer@w{ }@var{obs})
-
-@end deftypemethod
-@deftypemethod Observable {public synchronized void} deleteObservers ()
-
-@end deftypemethod
-@deftypemethod Observable {public synchronized boolean} hasChanged ()
-
-@end deftypemethod
-@deftypemethod Observable {public void} notifyObservers ()
-
-@end deftypemethod
-@deftypemethod Observable {public void} notifyObservers (java.lang.Object@w{ }@var{arg})
-
-@end deftypemethod
-@deftypemethod Observable {protected synchronized void} setChanged ()
-
-@end deftypemethod
-@deftypemethod Observer {public void} update (java.util.Observable@w{ }@var{observed}, java.lang.Object@w{ }@var{arg})
-
-@end deftypemethod
-@deftypemethod Properties {public void} load (java.io.InputStream@w{ }@var{inStream}) @*throws IOException
-Reads a property list from an input stream. The stream should
- have the following format: <br>
-
- An empty line or a line starting with @code{#} or
- @code{!} is ignored. An backslash (@code{\}) at the
- end of the line makes the line continueing on the next line
- (but make sure there is no whitespace after the backslash).
- Otherwise, each line describes a key/value pair. <br>
-
- The chars up to the first whitespace, = or : are the key. You
- can include this caracters in the key, if you precede them with
- a backslash (@code{\}). The key is followed by optional
- whitespaces, optionally one @code{=} or @code{:},
- and optionally some more whitespaces. The rest of the line is
- the resource belonging to the key. <br>
-
- Escape sequences @code{\t, \n, \r, \\, \", \', \!, \#, \ }(a
- space), and unicode characters with the
- @code{\}@code{u}xxxx notation are detected, and
- converted to the corresponding single character. <br>
-
- <pre>
- # This is a comment
- key = value
- k\:5 \ a string starting with space and ending with newline\n
- # This is a multiline specification; note that the value contains
- # no white space.
- weekdays: Sunday,Monday,Tuesday,Wednesday,\
- Thursday,Friday,Saturday
- # The safest way to include a space at the end of a value:
- label = Name:\@code{}u0020
- </pre>
-@end deftypemethod
-@deftypemethod Properties {public void} save (java.io.OutputStream@w{ }@var{out}, java.lang.String@w{ }@var{header})
-Calls @code{store(OutputStream out, String header)} and
- ignores the IOException that may be thrown.
-@end deftypemethod
-@deftypemethod Properties {public void} store (java.io.OutputStream@w{ }@var{out}, java.lang.String@w{ }@var{header}) @*throws IOException
-Writes the key/value pairs to the given output stream. <br>
-
- If header is not null, this method writes a comment containing
- the header as first line to the stream. The next line (or first
- line if header is null) contains a comment with the current date.
- Afterwards the key/value pairs are written to the stream in the
- following format. <br>
-
- Each line has the form @code{key = value}. Newlines,
- Returns and tabs are written as @code{\n,\t,\r} resp.
- The characters @code{\, !, #, =} and @code{:} are
- preceeded by a backslash. Spaces are preceded with a backslash,
- if and only if they are at the beginning of the key. Characters
- that are not in the ascii range 33 to 127 are written in the
- @code{\}@code{u}xxxx Form.
-@end deftypemethod
-@deftypemethod Properties {public Object} setProperty (java.lang.String@w{ }@var{key}, java.lang.String@w{ }@var{value})
-Adds the given key/value pair to this properties. This calls
- the hashtable method put.
-@end deftypemethod
-@deftypemethod Properties {public String} getProperty (java.lang.String@w{ }@var{key})
-Gets the property with the specified key in this property list.
- If the key is not found, the default property list is searched.
- If the property is not found in default or the default of
- default, null is returned.
-@end deftypemethod
-@deftypemethod Properties {public String} getProperty (java.lang.String@w{ }@var{key}, java.lang.String@w{ }@var{defaultValue})
-Gets the property with the specified key in this property list. If
- the key is not found, the default property list is searched. If the
- property is not found in default or the default of default, the
- specified defaultValue is returned.
-@end deftypemethod
-@deftypemethod Properties {public Enumeration} propertyNames ()
-Returns an enumeration of all keys in this property list, including
- the keys in the default property list.
-@end deftypemethod
-@deftypemethod Properties {public void} list (java.io.PrintStream@w{ }@var{out})
-Writes the key/value pairs to the given print stream. They are
- written in the way, described in the method store.
-@end deftypemethod
-@deftypemethod Properties {public void} list (java.io.PrintWriter@w{ }@var{out})
-Writes the key/value pairs to the given print writer. They are
- written in the way, described in the method store.
-@end deftypemethod
-@deftypemethod PropertyPermission {public boolean} implies (java.security.Permission@w{ }@var{p})
-Check if this permission implies p. This returns true iff all of
- the following conditions are true:
-
-@itemize @bullet
-
-
-@item
- p is a PropertyPermission
-
-
-@item
- this.getName() implies p.getName(),
- e.g. @code{java.*} implies @code{java.home}
-
-
-@item
- this.getActions is a subset of p.getActions
-
-
-@end itemize
-
-@end deftypemethod
-@deftypemethod PropertyPermission {public String} getActions ()
-Returns the action string. Note that this may differ from the string
- given at the constructor: The actions are converted to lowercase and
- may be reordered.
-@end deftypemethod
-@deftypemethod PropertyPermission {public boolean} equals (java.lang.Object@w{ }@var{obj})
-Check to see whether this object is the same as another
- PropertyPermission object.
-@end deftypemethod
-@deftypemethod PropertyPermission {public PermissionCollection} newPermissionCollection ()
-Returns a permission collection suitable to take
- PropertyPermission objects.
-@end deftypemethod
-@deftypemethod PropertyResourceBundle {public Enumeration} getKeys ()
-
-@end deftypemethod
-@deftypemethod PropertyResourceBundle {public Object} handleGetObject (java.lang.String@w{ }@var{key})
-
-@end deftypemethod
-@deftypemethod Random {protected synchronized int} next (int@w{ }@var{bits})
-
-@end deftypemethod
-@deftypemethod Random {public boolean} nextBoolean ()
-
-@end deftypemethod
-@deftypemethod Random {public void} nextBytes (byte[]@w{ }@var{buf})
-
-@end deftypemethod
-@deftypemethod Random {public double} nextDouble ()
-
-@end deftypemethod
-@deftypemethod Random {public float} nextFloat ()
-
-@end deftypemethod
-@deftypemethod Random {public synchronized double} nextGaussian ()
-
-@end deftypemethod
-@deftypemethod Random {public int} nextInt ()
-
-@end deftypemethod
-@deftypemethod Random {public int} nextInt (int@w{ }@var{n})
-
-@end deftypemethod
-@deftypemethod Random {public long} nextLong ()
-
-@end deftypemethod
-@deftypemethod Random {public synchronized void} setSeed (long@w{ }@var{seed})
-
-@end deftypemethod
-@deftypemethod ResourceBundle {public Locale} getLocale ()
-
-@end deftypemethod
-@deftypemethod ResourceBundle {public final String} getString (java.lang.String@w{ }@var{key}) @*throws MissingResourceException
-
-@end deftypemethod
-@deftypemethod ResourceBundle {public final String} getStringArray (java.lang.String@w{ }@var{key}) @*throws MissingResourceException
-
-@end deftypemethod
-@deftypemethod ResourceBundle {public final Object} getObject (java.lang.String@w{ }@var{key}) @*throws MissingResourceException
-
-@end deftypemethod
-@deftypemethod ResourceBundle {public static final ResourceBundle} getBundle (java.lang.String@w{ }@var{baseName}) @*throws MissingResourceException
-
-@end deftypemethod
-@deftypemethod ResourceBundle {public static final ResourceBundle} getBundle (java.lang.String@w{ }@var{baseName}, java.util.Locale@w{ }@var{locale})
-
-@end deftypemethod
-@deftypemethod ResourceBundle {public static final ResourceBundle} getBundle (java.lang.String@w{ }@var{baseName}, java.util.Locale@w{ }@var{locale}, java.lang.ClassLoader@w{ }@var{loader}) @*throws MissingResourceException
-
-@end deftypemethod
-@deftypemethod ResourceBundle {protected void} setParent (java.util.ResourceBundle@w{ }@var{parent})
-
-@end deftypemethod
-@deftypemethod ResourceBundle {protected abstract Object} handleGetObject (java.lang.String@w{ }@var{key}) @*throws MissingResourceException
-
-@end deftypemethod
-@deftypemethod ResourceBundle {public abstract Enumeration} getKeys ()
-
-@end deftypemethod
-@deftypemethod Set {public boolean} add (java.lang.Object@w{ }@var{o})
-
-@end deftypemethod
-@deftypemethod Set {public boolean} addAll (java.util.Collection@w{ }@var{c})
-
-@end deftypemethod
-@deftypemethod Set {public void} clear ()
-
-@end deftypemethod
-@deftypemethod Set {public boolean} contains (java.lang.Object@w{ }@var{o})
-
-@end deftypemethod
-@deftypemethod Set {public boolean} containsAll (java.util.Collection@w{ }@var{c})
-
-@end deftypemethod
-@deftypemethod Set {public boolean} equals (java.lang.Object@w{ }@var{o})
-
-@end deftypemethod
-@deftypemethod Set {public int} hashCode ()
-
-@end deftypemethod
-@deftypemethod Set {public boolean} isEmpty ()
-
-@end deftypemethod
-@deftypemethod Set {public Iterator} iterator ()
-
-@end deftypemethod
-@deftypemethod Set {public boolean} remove (java.lang.Object@w{ }@var{o})
-
-@end deftypemethod
-@deftypemethod Set {public boolean} removeAll (java.util.Collection@w{ }@var{c})
-
-@end deftypemethod
-@deftypemethod Set {public boolean} retainAll (java.util.Collection@w{ }@var{c})
-
-@end deftypemethod
-@deftypemethod Set {public int} size ()
-
-@end deftypemethod
-@deftypemethod Set {public Object} toArray ()
-
-@end deftypemethod
-@deftypemethod SimpleTimeZone {public void} setStartYear (int@w{ }@var{year})
-Sets the first year, where daylight savings applies. The daylight
- savings rule never apply for years in the BC era. Note that this
- is gregorian calendar specific.
-@end deftypemethod
-@deftypemethod SimpleTimeZone {public void} setStartRule (int@w{ }@var{month}, int@w{ }@var{day}, int@w{ }@var{dayOfWeek}, int@w{ }@var{time})
-Sets the daylight savings start rule. You must also set the
- end rule with @code{setEndRule} or the result of
- getOffset is undefined. For the parameters see the ten-argument
- constructor above.
-@end deftypemethod
-@deftypemethod SimpleTimeZone {public void} setEndRule (int@w{ }@var{month}, int@w{ }@var{day}, int@w{ }@var{dayOfWeek}, int@w{ }@var{time})
-Sets the daylight savings end rule. You must also set the
- start rule with @code{setStartRule} or the result of
- getOffset is undefined. For the parameters see the ten-argument
- constructor above.
-@end deftypemethod
-@deftypemethod SimpleTimeZone {public int} getOffset (int@w{ }@var{era}, int@w{ }@var{year}, int@w{ }@var{month}, int@w{ }@var{day}, int@w{ }@var{dayOfWeek}, int@w{ }@var{millis})
-Gets the time zone offset, for current date, modified in case of
- daylight savings. This is the offset to add to UTC to get the local
- time.
-
- In the standard JDK the results given by this method may result in
- inaccurate results at the end of February or the beginning of March.
- To avoid this, you should use Calendar instead:
- <pre>
- offset = cal.get(Calendar.ZONE_OFFSET) + cal.get(Calendar.DST_OFFSET);
- </pre>
- You could also use in
-
- This version doesn't suffer this inaccuracy.
-@end deftypemethod
-@deftypemethod SimpleTimeZone {public int} getRawOffset ()
-Returns the time zone offset to GMT in milliseconds, ignoring
- day light savings.
-@end deftypemethod
-@deftypemethod SimpleTimeZone {public void} setRawOffset (int@w{ }@var{rawOffset})
-Sets the standard time zone offset to GMT.
-@end deftypemethod
-@deftypemethod SimpleTimeZone {public int} getDSTSavings ()
-Gets the daylight savings offset. This is a positive offset in
- milliseconds with respect to standard time. Typically this
- is one hour, but for some time zones this may be half an our.
-@end deftypemethod
-@deftypemethod SimpleTimeZone {public boolean} useDaylightTime ()
-Returns if this time zone uses daylight savings time.
-@end deftypemethod
-@deftypemethod SimpleTimeZone {public boolean} inDaylightTime (java.util.Date@w{ }@var{date})
-Determines if the given date is in daylight savings time.
-@end deftypemethod
-@deftypemethod SimpleTimeZone {public synchronized int} hashCode ()
-Generates the hashCode for the SimpleDateFormat object. It is
- the rawOffset, possibly, if useDaylightSavings is true, xored
- with startYear, startMonth, startDayOfWeekInMonth, ..., endTime.
-@end deftypemethod
-@deftypemethod SimpleTimeZone {public synchronized boolean} equals (java.lang.Object@w{ }@var{o})
-
-@end deftypemethod
-@deftypemethod SimpleTimeZone {public boolean} hasSameRules (java.util.TimeZone@w{ }@var{other})
-Test if the other time zone uses the same rule and only
- possibly differs in ID. This implementation for this particular
- class will return true if the other object is a SimpleTimeZone,
- the raw offsets and useDaylight are identical and if useDaylight
- is true, also the start and end datas are identical.
-@end deftypemethod
-@deftypemethod SimpleTimeZone {public String} toString ()
-Returns a string representation of this SimpleTimeZone object.
-@end deftypemethod
-@deftypemethod SortedMap {public Comparator} comparator ()
-
-@end deftypemethod
-@deftypemethod SortedMap {public Object} firstKey ()
-
-@end deftypemethod
-@deftypemethod SortedMap {public SortedMap} headMap (java.lang.Object@w{ }@var{toKey})
-
-@end deftypemethod
-@deftypemethod SortedMap {public Object} lastKey ()
-
-@end deftypemethod
-@deftypemethod SortedMap {public SortedMap} subMap (java.lang.Object@w{ }@var{fromKey}, java.lang.Object@w{ }@var{toKey})
-
-@end deftypemethod
-@deftypemethod SortedMap {public SortedMap} tailMap (java.lang.Object@w{ }@var{fromKey})
-
-@end deftypemethod
-@deftypemethod SortedSet {public Comparator} comparator ()
-
-@end deftypemethod
-@deftypemethod SortedSet {public Object} first ()
-
-@end deftypemethod
-@deftypemethod SortedSet {public SortedSet} headSet (java.lang.Object@w{ }@var{toElement})
-
-@end deftypemethod
-@deftypemethod SortedSet {public Object} last ()
-
-@end deftypemethod
-@deftypemethod SortedSet {public SortedSet} subSet (java.lang.Object@w{ }@var{fromElement}, java.lang.Object@w{ }@var{toElement})
-
-@end deftypemethod
-@deftypemethod SortedSet {public SortedSet} tailSet (java.lang.Object@w{ }@var{fromElement})
-
-@end deftypemethod
-@deftypemethod Stack {public boolean} empty ()
-
-@end deftypemethod
-@deftypemethod Stack {public synchronized Object} peek ()
-
-@end deftypemethod
-@deftypemethod Stack {public synchronized Object} pop ()
-
-@end deftypemethod
-@deftypemethod Stack {public Object} push (java.lang.Object@w{ }@var{obj})
-
-@end deftypemethod
-@deftypemethod Stack {public synchronized int} search (java.lang.Object@w{ }@var{obj})
-
-@end deftypemethod
-@deftypemethod StringTokenizer {public int} countTokens ()
-
-@end deftypemethod
-@deftypemethod StringTokenizer {public boolean} hasMoreElements ()
-
-@end deftypemethod
-@deftypemethod StringTokenizer {public boolean} hasMoreTokens ()
-
-@end deftypemethod
-@deftypemethod StringTokenizer {public Object} nextElement ()
-
-@end deftypemethod
-@deftypemethod StringTokenizer {public String} nextToken ()
-
-@end deftypemethod
-@deftypemethod StringTokenizer {public String} nextToken (java.lang.String@w{ }@var{delims})
-
-@end deftypemethod
-@deftypemethod Timer {public void} cancel ()
-Cancels the execution of the scheduler. If a task is executing it will
- normally finish execution, but no other tasks will be executed and no
- more tasks can be scheduled.
-@end deftypemethod
-@deftypemethod Timer {public void} schedule (java.util.TimerTask@w{ }@var{task}, java.util.Date@w{ }@var{date})
-Schedules the task at the specified data for one time execution.
-@end deftypemethod
-@deftypemethod Timer {public void} schedule (java.util.TimerTask@w{ }@var{task}, java.util.Date@w{ }@var{date}, long@w{ }@var{period})
-Schedules the task at the specified date and reschedules the task every
- period milliseconds after the last execution of the task finishes until
- this timer or the task is canceled.
-@end deftypemethod
-@deftypemethod Timer {public void} schedule (java.util.TimerTask@w{ }@var{task}, long@w{ }@var{delay})
-Schedules the task after the specified delay milliseconds for one time
- execution.
-@end deftypemethod
-@deftypemethod Timer {public void} schedule (java.util.TimerTask@w{ }@var{task}, long@w{ }@var{delay}, long@w{ }@var{period})
-Schedules the task after the delay milliseconds and reschedules the
- task every period milliseconds after the last execution of the task
- finishes until this timer or the task is canceled.
-@end deftypemethod
-@deftypemethod Timer {public void} scheduleAtFixedRate (java.util.TimerTask@w{ }@var{task}, java.util.Date@w{ }@var{date}, long@w{ }@var{period})
-Schedules the task at the specified date and reschedules the task at a
- fixed rate every period milliseconds until this timer or the task is
- canceled.
-@end deftypemethod
-@deftypemethod Timer {public void} scheduleAtFixedRate (java.util.TimerTask@w{ }@var{task}, long@w{ }@var{delay}, long@w{ }@var{period})
-Schedules the task after the delay milliseconds and reschedules the task
- at a fixed rate every period milliseconds until this timer or the task
- is canceled.
-@end deftypemethod
-@deftypemethod Timer {protected void} finalize ()
-Tells the scheduler that the Timer task died
- so there will be no more new tasks scheduled.
-@end deftypemethod
-@deftypemethod TimerTask {public boolean} cancel ()
-Marks the task as canceled and prevents any further execution.
- Returns true if the task was scheduled for any execution in the future
- and this cancel operation prevents that execution from happening.
-
-
-
- A task that has been canceled can never be scheduled again.
-
-
-
- In this implementation the TimerTask it is possible that the Timer does
- keep a reference to the TimerTask until the first time the TimerTask
- is actually scheduled. But the reference will disappear immediatly when
- cancel is called from within the TimerTask run method.
-@end deftypemethod
-@deftypemethod TimerTask {public abstract void} run ()
-Method that is called when this task is scheduled for execution.
-@end deftypemethod
-@deftypemethod TimerTask {public long} scheduledExecutionTime ()
-Returns the last time this task was scheduled or (when called by the
- task from the run method) the time the current execution of the task
- was scheduled. When the task has not yet run the return value is
- undefined.
-
-
-
- Can be used (when the task is scheduled at fixed rate) to see the
- difference between the requested schedule time and the actual time
- that can be found with @code{System.currentTimeMillis()}.
-@end deftypemethod
-@deftypemethod TimeZone {public abstract int} getOffset (int@w{ }@var{era}, int@w{ }@var{year}, int@w{ }@var{month}, int@w{ }@var{day}, int@w{ }@var{dayOfWeek}, int@w{ }@var{milliseconds})
-Gets the time zone offset, for current date, modified in case of
- daylight savings. This is the offset to add to UTC to get the local
- time.
-@end deftypemethod
-@deftypemethod TimeZone {public abstract int} getRawOffset ()
-Gets the time zone offset, ignoring daylight savings. This is
- the offset to add to UTC to get the local time.
-@end deftypemethod
-@deftypemethod TimeZone {public abstract void} setRawOffset (int@w{ }@var{offsetMillis})
-Sets the time zone offset, ignoring daylight savings. This is
- the offset to add to UTC to get the local time.
-@end deftypemethod
-@deftypemethod TimeZone {public String} getID ()
-Gets the identifier of this time zone. For instance, PST for
- Pacific Standard Time.
-@end deftypemethod
-@deftypemethod TimeZone {public void} setID (java.lang.String@w{ }@var{id})
-Sets the identifier of this time zone. For instance, PST for
- Pacific Standard Time.
-@end deftypemethod
-@deftypemethod TimeZone {public final String} getDisplayName ()
-This method returns a string name of the time zone suitable
- for displaying to the user. The string returned will be the long
- description of the timezone in the current locale. The name
- displayed will assume daylight savings time is not in effect.
-@end deftypemethod
-@deftypemethod TimeZone {public final String} getDisplayName (java.util.Locale@w{ }@var{locale})
-This method returns a string name of the time zone suitable
- for displaying to the user. The string returned will be the long
- description of the timezone in the specified locale. The name
- displayed will assume daylight savings time is not in effect.
-@end deftypemethod
-@deftypemethod TimeZone {public final String} getDisplayName (boolean@w{ }@var{dst}, int@w{ }@var{style})
-This method returns a string name of the time zone suitable
- for displaying to the user. The string returned will be of the
- specified type in the current locale.
-@end deftypemethod
-@deftypemethod TimeZone {public String} getDisplayName (boolean@w{ }@var{dst}, int@w{ }@var{style}, java.util.Locale@w{ }@var{locale})
-This method returns a string name of the time zone suitable
- for displaying to the user. The string returned will be of the
- specified type in the specified locale.
-@end deftypemethod
-@deftypemethod TimeZone {public abstract boolean} useDaylightTime ()
-Returns true, if this time zone uses Daylight Savings Time.
-@end deftypemethod
-@deftypemethod TimeZone {public abstract boolean} inDaylightTime (java.util.Date@w{ }@var{date})
-Returns true, if the given date is in Daylight Savings Time in this
- time zone.
-@end deftypemethod
-@deftypemethod TimeZone {public static TimeZone} getTimeZone (java.lang.String@w{ }@var{ID})
-Gets the TimeZone for the given ID.
-@end deftypemethod
-@deftypemethod TimeZone {public static String} getAvailableIDs (int@w{ }@var{rawOffset})
-Gets the available IDs according to the given time zone
- offset.
-@end deftypemethod
-@deftypemethod TimeZone {public static String} getAvailableIDs ()
-Gets all available IDs.
-@end deftypemethod
-@deftypemethod TimeZone {public static TimeZone} getDefault ()
-Returns the time zone under which the host is running. This
- can be changed with setDefault.
-@end deftypemethod
-@deftypemethod TimeZone {public static void} setDefault (java.util.TimeZone@w{ }@var{zone})
-
-@end deftypemethod
-@deftypemethod TimeZone {public boolean} hasSameRules (java.util.TimeZone@w{ }@var{other})
-Test if the other time zone uses the same rule and only
- possibly differs in ID. This implementation for this particular
- class will return true if the raw offsets are identical. Subclasses
- should override this method if they use daylight savings.
-@end deftypemethod
-@deftypemethod TimeZone {public Object} clone ()
-Returns a clone of this object. I can't imagine, why this is
- useful for a time zone.
-@end deftypemethod
-@deftypemethod Vector {public synchronized void} copyInto (java.lang.Object[]@w{ }@var{anArray})
-Copies the contents of a provided array into the Vector. If the
- array is too large to fit in the Vector, an ArrayIndexOutOfBoundsException
- is thrown. Old elements in the Vector are overwritten by the new
- elements
-@end deftypemethod
-@deftypemethod Vector {public synchronized void} trimToSize ()
-Trims the Vector down to size. If the internal data array is larger
- than the number of Objects its holding, a new array is constructed
- that precisely holds the elements.
-@end deftypemethod
-@deftypemethod Vector {public synchronized void} ensureCapacity (int@w{ }@var{minCapacity})
-Ensures that <b>minCapacity</b> elements can fit within this Vector.
- If it cannot hold this many elements, the internal data array is expanded
- in the following manner. If the current size plus the capacityIncrement
- is sufficient, the internal array is expanded by capacityIncrement.
- If capacityIncrement is non-positive, the size is doubled. If
- neither is sufficient, the internal array is expanded to size minCapacity
-@end deftypemethod
-@deftypemethod Vector {public synchronized void} setSize (int@w{ }@var{newSize})
-Explicitly sets the size of the internal data array, copying the
- old values to the new internal array. If the new array is smaller
- than the old one, old values that don't fit are lost. If the new size
- is larger than the old one, the vector is padded with null entries.
-@end deftypemethod
-@deftypemethod Vector {public int} capacity ()
-Returns the size of the internal data array (not the amount of elements
- contained in the Vector)
-@end deftypemethod
-@deftypemethod Vector {public int} size ()
-Returns the number of elements stored in this Vector
-@end deftypemethod
-@deftypemethod Vector {public boolean} isEmpty ()
-Returns true if this Vector is empty, false otherwise
-@end deftypemethod
-@deftypemethod Vector {public synchronized int} indexOf (java.lang.Object@w{ }@var{e}, int@w{ }@var{index})
-Searches the vector starting at <b>index</b> for object <b>elem</b>
- and returns the index of the first occurence of this Object. If
- the object is not found, -1 is returned
-@end deftypemethod
-@deftypemethod Vector {public int} indexOf (java.lang.Object@w{ }@var{elem})
-Returns the first occurence of <b>elem</b> in the Vector, or -1 if
- <b>elem</b> is not found.
-@end deftypemethod
-@deftypemethod Vector {public boolean} contains (java.lang.Object@w{ }@var{elem})
-Returns true if <b>elem</b> is contained in this Vector, false otherwise.
-@end deftypemethod
-@deftypemethod Vector {public synchronized int} lastIndexOf (java.lang.Object@w{ }@var{e}, int@w{ }@var{index})
-Returns the index of the first occurence of <b>elem</b>, when searching
- backwards from <b>index</b>. If the object does not occur in this Vector,
- -1 is returned.
-@end deftypemethod
-@deftypemethod Vector {public int} lastIndexOf (java.lang.Object@w{ }@var{elem})
-Returns the last index of <b>elem</b> within this Vector, or -1
- if the object is not within the Vector
-@end deftypemethod
-@deftypemethod Vector {public synchronized Object} elementAt (int@w{ }@var{index})
-Returns the Object stored at <b>index</b>. If index is out of range
- an ArrayIndexOutOfBoundsException is thrown.
-@end deftypemethod
-@deftypemethod Vector {public synchronized Object} firstElement ()
-Returns the first element in the Vector. If there is no first Object
- (The vector is empty), a NoSuchElementException is thrown.
-@end deftypemethod
-@deftypemethod Vector {public synchronized Object} lastElement ()
-Returns the last element in the Vector. If the Vector has no last element
- (The vector is empty), a NoSuchElementException is thrown.
-@end deftypemethod
-@deftypemethod Vector {public synchronized void} setElementAt (java.lang.Object@w{ }@var{obj}, int@w{ }@var{index})
-Places <b>obj</b> at <b>index</b> within the Vector. If <b>index</b>
- refers to an index outside the Vector, an ArrayIndexOutOfBoundsException
- is thrown.
-@end deftypemethod
-@deftypemethod Vector {public synchronized Object} set (int@w{ }@var{index}, java.lang.Object@w{ }@var{element})
-Puts <b>element</b> into the Vector at position <b>index</b> and returns
- the Object that previously occupied that position.
-@end deftypemethod
-@deftypemethod Vector {public synchronized void} removeElementAt (int@w{ }@var{index})
-Removes the element at <b>index</b>, and shifts all elements at
- positions greater than index to their index - 1.
-@end deftypemethod
-@deftypemethod Vector {public void} insertElementAt (java.lang.Object@w{ }@var{obj}, int@w{ }@var{index})
-Inserts a new element into the Vector at <b>index</b>. Any elements
- at or greater than index are shifted up one position.
-@end deftypemethod
-@deftypemethod Vector {public synchronized void} addElement (java.lang.Object@w{ }@var{obj})
-Adds an element to the Vector at the end of the Vector. If the vector
- cannot hold the element with its present capacity, its size is increased
- based on the same rules followed if ensureCapacity was called with the
- argument currentSize+1.
-@end deftypemethod
-@deftypemethod Vector {public synchronized boolean} removeElement (java.lang.Object@w{ }@var{obj})
-Removes the first occurence of the given object from the Vector.
- If such a remove was performed (the object was found), true is returned.
- If there was no such object, false is returned.
-@end deftypemethod
-@deftypemethod Vector {public synchronized void} removeAllElements ()
-Removes all elements from the Vector. Note that this does not
- resize the internal data array.
-@end deftypemethod
-@deftypemethod Vector {public synchronized Object} clone ()
-Creates a new Vector with the same contents as this one.
-@end deftypemethod
-@deftypemethod Vector {public synchronized Object} toArray ()
-Returns an Object array with the contents of this Vector, in the order
- they are stored within this Vector. Note that the Object array returned
- is not the internal data array, and that it holds only the elements
- within the Vector. This is similar to creating a new Object[] with the
- size of this Vector, then calling Vector.copyInto(yourArray).
-@end deftypemethod
-@deftypemethod Vector {public synchronized Object} toArray (java.lang.Object[]@w{ }@var{array})
-Returns an array containing the contents of this Vector.
- If the provided array is large enough, the contents are copied
- into that array, and a null is placed in the position size().
- In this manner, you can obtain the size of a Vector by the position
- of the null element. If the type of the provided array cannot
- hold the elements, an ArrayStoreException is thrown.
-
- If the provided array is not large enough,
- a new one is created with the contents of the Vector, and no null
- element. The new array is of the same runtime type as the provided
- array.
-@end deftypemethod
-@deftypemethod Vector {public synchronized Object} get (int@w{ }@var{index})
-Returns the element at position <b>index</b>
-@end deftypemethod
-@deftypemethod Vector {public boolean} remove (java.lang.Object@w{ }@var{o})
-Removes the given Object from the Vector. If it exists, true
- is returned, if not, false is returned.
-@end deftypemethod
-@deftypemethod Vector {public synchronized boolean} add (java.lang.Object@w{ }@var{o})
-Adds an object to the Vector.
-@end deftypemethod
-@deftypemethod Vector {public void} add (int@w{ }@var{index}, java.lang.Object@w{ }@var{element})
-Adds an object at the specified index. Elements at or above
- index are shifted up one position.
-@end deftypemethod
-@deftypemethod Vector {public synchronized Object} remove (int@w{ }@var{index})
-Removes the element at the specified index, and returns it.
-@end deftypemethod
-@deftypemethod Vector {public void} clear ()
-Clears all elements in the Vector and sets its size to 0
-@end deftypemethod
-@deftypemethod Vector {public synchronized boolean} containsAll (java.util.Collection@w{ }@var{c})
-
-@end deftypemethod
-@deftypemethod Vector {public synchronized boolean} addAll (java.util.Collection@w{ }@var{c})
-
-@end deftypemethod
-@deftypemethod Vector {public synchronized boolean} removeAll (java.util.Collection@w{ }@var{c})
-
-@end deftypemethod
-@deftypemethod Vector {public synchronized boolean} retainAll (java.util.Collection@w{ }@var{c})
-
-@end deftypemethod
-@deftypemethod Vector {public synchronized boolean} addAll (int@w{ }@var{index}, java.util.Collection@w{ }@var{c})
-
-@end deftypemethod
-@deftypemethod Vector {public synchronized boolean} equals (java.lang.Object@w{ }@var{c})
-
-@end deftypemethod
-@deftypemethod Vector {public synchronized int} hashCode ()
-
-@end deftypemethod
-@deftypemethod Vector {public synchronized String} toString ()
-Returns a string representation of this Vector in the form
- [element0, element1, ... elementN]
-@end deftypemethod
-@deftypemethod Vector {public synchronized Enumeration} elements ()
-Returns an Enumeration of the elements of this List.
- The Enumeration returned is compatible behavior-wise with
- the 1.1 elements() method, in that it does not check for
- concurrent modification.
-@end deftypemethod
-@deftypemethod Vector {public List} subList (int@w{ }@var{fromIndex}, int@w{ }@var{toIndex})
-
-@end deftypemethod
-@deftypemethod Vector {protected synchronized void} removeRange (int@w{ }@var{fromIndex}, int@w{ }@var{toIndex})
-
-@end deftypemethod
-@deftypemethod WeakHashMap {public int} size ()
-Returns the size of this hash map. Note that the size() may shrink
- spontanously, if the some of the keys were only weakly reachable.
-@end deftypemethod
-@deftypemethod WeakHashMap {public boolean} isEmpty ()
-Tells if the map is empty. Note that the result may change
- spontanously, if all of the keys were only weakly reachable.
-@end deftypemethod
-@deftypemethod WeakHashMap {public boolean} containsKey (java.lang.Object@w{ }@var{key})
-Tells if the map contains the given key. Note that the result
- may change spontanously, if all the key was only weakly
- reachable.
-@end deftypemethod
-@deftypemethod WeakHashMap {public Object} get (java.lang.Object@w{ }@var{key})
-Gets the value the key will be mapped to.
-@end deftypemethod
-@deftypemethod WeakHashMap {public Object} put (java.lang.Object@w{ }@var{key}, java.lang.Object@w{ }@var{value})
-Adds a new key/value mapping to this map.
-@end deftypemethod
-@deftypemethod WeakHashMap {public Object} remove (java.lang.Object@w{ }@var{key})
-Removes the key and the corresponding value from this map.
-@end deftypemethod
-@deftypemethod WeakHashMap {public Set} entrySet ()
-Returns a set representation of the entries in this map. This
- set will not have strong references to the keys, so they can be
- silently removed. The returned set has therefore the same
- strange behaviour (shrinking size(), disappearing entries) as
- this weak hash map.
-@end deftypemethod
diff --git a/libjava/exception.cc b/libjava/exception.cc
index b8b9634e94d..29109402b27 100644
--- a/libjava/exception.cc
+++ b/libjava/exception.cc
@@ -1,6 +1,6 @@
// Functions for Exception Support for Java.
-/* Copyright (C) 1998, 1999 Free Software Foundation
+/* Copyright (C) 1998, 1999, 2001 Free Software Foundation
This file is part of libgcj.
@@ -11,185 +11,385 @@ details. */
#include <config.h>
#include <stddef.h>
-#include <stdlib.h>
+#include <cstdlib>
#include <java/lang/Class.h>
#include <java/lang/NullPointerException.h>
#include <gcj/cni.h>
#include <jvm.h>
-// eh-common.h needs gansidecl.h.
-#include "gansidecl.h"
-#include "eh-common.h"
+#include "unwind.h"
-typedef struct {
- __eh_info eh_info;
- void *value;
-} java_eh_info;
+
+// More nastiness: the GC wants to define TRUE and FALSE. We don't
+// need the Java definitions (themselves a hack), so we undefine them.
+#undef TRUE
+#undef FALSE
-
-/* Language-specific EH info pointer, throw routine, and language/version
- info routines. All defined in libgcc2. */
-
-extern "C" java_eh_info **__get_eh_info ();
-extern "C" void __throw () __attribute__ ((__noreturn__));
-extern "C" void __sjthrow () __attribute__ ((__noreturn__));
-extern "C" short __get_eh_table_version (void *table);
-extern "C" short __get_eh_table_language (void *table);
-extern "C" void *__get_eh_context ();
-
-extern "C" void *
-_Jv_type_matcher (java_eh_info *info, void* match_info,
- void *exception_table)
+extern "C"
{
-#ifndef SJLJ_EXCEPTIONS
- /* No exception table implies the old style mechanism, so don't check. */
- if (exception_table != NULL
- && __get_eh_table_language (exception_table) != EH_LANG_Java)
- return NULL;
-#endif
+#include <gc_priv.h>
+#include <gc_mark.h>
+#include <include/gc_gcj.h>
+};
- /* we don't worry about version info yet, there is only one version! */
-
- if (match_info != NULL)
- {
- // The match_info is either a (java::lang::Class*) or
- // match_info is one more than a (Utf8Const*).
- if (sizeof(void*) != sizeof(size_t))
- abort();
- size_t mi = (size_t) match_info;
- if ((mi & 1) != 0)
- match_info = _Jv_FindClass ((Utf8Const*) (mi - 1), NULL);
- if (! _Jv_IsInstanceOf ((jobject) info->value, (jclass) match_info))
- return NULL;
- }
+
+struct alignment_test_struct
+{
+ char space;
+ char end[0] __attribute__((aligned));
+};
- return info->value;
+struct java_exception_header
+{
+ /* Cache handler details between Phase 1 and Phase 2. */
+ _Unwind_Ptr landingPad;
+ int handlerSwitchValue;
+
+ /* The object being thrown. Compiled code expects this to be immediately
+ before the generic exception header. Which is complicated by the fact
+ that _Unwind_Exception is ((aligned)). */
+
+ char pad[sizeof(jthrowable) < sizeof(alignment_test_struct)
+ ? sizeof(alignment_test_struct) - sizeof(jthrowable) : 0]
+ __attribute__((aligned));
+
+ jthrowable value;
+
+ /* The generic exception header. */
+ _Unwind_Exception unwindHeader;
+};
+
+// This is the exception class we report -- "GNUCJAVA".
+const _Unwind_Exception_Class __gcj_exception_class
+= ((((((((_Unwind_Exception_Class) 'G'
+ << 8 | (_Unwind_Exception_Class) 'N')
+ << 8 | (_Unwind_Exception_Class) 'U')
+ << 8 | (_Unwind_Exception_Class) 'C')
+ << 8 | (_Unwind_Exception_Class) 'J')
+ << 8 | (_Unwind_Exception_Class) 'A')
+ << 8 | (_Unwind_Exception_Class) 'V')
+ << 8 | (_Unwind_Exception_Class) 'A');
+
+
+static inline java_exception_header *
+get_exception_header_from_ue (_Unwind_Exception *exc)
+{
+ return reinterpret_cast<java_exception_header *>(exc + 1) - 1;
}
-/* Compiler hook to return a pointer to java exception object. The value
- is cleared, so if the exception needs to be rethrown, it should be set
- again */
+/* Perform a throw, Java style. Throw will unwind through this call,
+ so there better not be any handlers or exception thrown here. */
-extern "C" void *
-_Jv_exception_info (void)
+extern "C" void
+_Jv_Throw (jthrowable value)
{
- java_eh_info *info = *(__get_eh_info ());
- void *ptr;
+ /* FIXME: Use the proper API to the collector. */
+ java_exception_header *xh
+ = static_cast<java_exception_header *>(GC_malloc (sizeof (*xh)));
- if (info == NULL)
- abort ();
+ if (value == NULL)
+ value = new java::lang::NullPointerException ();
+ xh->value = value;
- ptr = info->value;
+ xh->unwindHeader.exception_class = __gcj_exception_class;
+ xh->unwindHeader.exception_cleanup = NULL;
- /* clear the value so another throw is an error */
- info->value = NULL;
+ /* We're happy with setjmp/longjmp exceptions or region-based
+ exception handlers: entry points are provided here for both. */
+ _Unwind_Reason_Code code;
+#ifdef SJLJ_EXCEPTIONS
+ code = _Unwind_SjLj_RaiseException (&xh->unwindHeader);
+#else
+ code = _Unwind_RaiseException (&xh->unwindHeader);
+#endif
- return ptr;
+ /* If code == _URC_END_OF_STACK, then we reached top of stack without
+ finding a handler for the exception. Since each thread is run in
+ a try/catch, this oughtn't happen. If code is something else, we
+ encountered some sort of heinous lossage from which we could not
+ recover. As is the way of such things, almost certainly we will have
+ crashed before now, rather than actually being able to diagnose the
+ problem. */
+ std::abort ();
}
+
+#include "unwind-pe.h"
+
+struct lsda_header_info
+{
+ _Unwind_Ptr Start;
+ _Unwind_Ptr LPStart;
+ const unsigned char *TType;
+ const unsigned char *action_table;
+ unsigned char ttype_encoding;
+ unsigned char call_site_encoding;
+};
+
+static const unsigned char *
+parse_lsda_header (_Unwind_Context *context, const unsigned char *p,
+ lsda_header_info *info)
+{
+ _Unwind_Ptr tmp;
+ unsigned char lpstart_encoding;
+ info->Start = (context ? _Unwind_GetRegionStart (context) : 0);
-/* Allocate an exception info structure for java. Called the first time
- an exception is thrown. */
-
-extern "C" void
-_Jv_eh_alloc ()
-{
- /* FIXME: we should use _Jv_AllocBytes here. However, libgcc2
- apparently can sometimes free() this value itself. */
- java_eh_info *p = (java_eh_info *) malloc (sizeof (java_eh_info));
- if (p == 0)
- abort ();
+ // Find @LPStart, the base to which landing pad offsets are relative.
+ lpstart_encoding = *p++;
+ if (lpstart_encoding != DW_EH_PE_omit)
+ p = read_encoded_value (context, lpstart_encoding, p, &info->LPStart);
+ else
+ info->LPStart = info->Start;
- p->value = 0;
- java_eh_info ** info_ptr = __get_eh_info ();
+ // Find @TType, the base of the handler and exception spec type data.
+ info->ttype_encoding = *p++;
+ if (info->ttype_encoding != DW_EH_PE_omit)
+ {
+ p = read_uleb128 (p, &tmp);
+ info->TType = p + tmp;
+ }
+ else
+ info->TType = 0;
- /* There should NOT be an exception info pointer already. */
- if (*info_ptr != NULL)
- abort ();
+ // The encoding and length of the call-site table; the action table
+ // immediately follows.
+ info->call_site_encoding = *p++;
+ p = read_uleb128 (p, &tmp);
+ info->action_table = p + tmp;
- *info_ptr = p;
+ return p;
}
-/* Deallocate the current exception info structure. Called at shutdown time. */
-
-extern "C" void
-_Jv_eh_free ()
+static jclass
+get_ttype_entry (_Unwind_Context *context, lsda_header_info *info, long i)
{
- java_eh_info ** info_ptr = __get_eh_info ();
- if (*info_ptr == NULL)
- abort ();
-
- /* FIXME: ideally we should just let the GC handle this. */
- free (*info_ptr);
- *info_ptr = NULL;
-}
+ _Unwind_Ptr ptr;
-/* Initialize an __eh_info structure with this libraries matching info. */
+ i *= size_of_encoded_value (info->ttype_encoding);
+ read_encoded_value (context, info->ttype_encoding, info->TType - i, &ptr);
-extern "C" void
-_Jv_setup_eh_info (__eh_info *)
-{
+ return reinterpret_cast<jclass>(ptr);
}
-/* Perform a throw, Java style. Throw will unwind through this call,
- so there better not be any handlers or exception thrown here. */
-extern "C" void
-_Jv_Throw (void *value)
+// Using a different personality function name causes link failures
+// when trying to mix code using different exception handling models.
+#ifdef SJLJ_EXCEPTIONS
+#define PERSONALITY_FUNCTION __gcj_personality_sj0
+#define __builtin_eh_return_data_regno(x) x
+#else
+#define PERSONALITY_FUNCTION __gcj_personality_v0
+#endif
+
+extern "C" _Unwind_Reason_Code
+PERSONALITY_FUNCTION (int version,
+ _Unwind_Action actions,
+ _Unwind_Exception_Class exception_class,
+ struct _Unwind_Exception *ue_header,
+ struct _Unwind_Context *context)
{
- if (value == NULL)
- value = (void *) new java::lang::NullPointerException ();
- java_eh_info *ehinfo = *(__get_eh_info ());
- if (ehinfo == NULL)
+ java_exception_header *xh = get_exception_header_from_ue (ue_header);
+
+ lsda_header_info info;
+ const unsigned char *language_specific_data;
+ const unsigned char *action_record;
+ const unsigned char *p;
+ _Unwind_Ptr landing_pad, ip;
+ int handler_switch_value;
+ bool saw_cleanup;
+ bool saw_handler;
+
+
+ // Interface version check.
+ if (version != 1)
+ return _URC_FATAL_PHASE1_ERROR;
+
+ // Shortcut for phase 2 found handler for domestic exception.
+ if (actions == (_UA_CLEANUP_PHASE | _UA_HANDLER_FRAME)
+ && exception_class == __gcj_exception_class)
{
- _Jv_eh_alloc ();
- ehinfo = *(__get_eh_info ());
+ handler_switch_value = xh->handlerSwitchValue;
+ landing_pad = xh->landingPad;
+ goto install_context;
}
- ehinfo->eh_info.match_function = (__eh_matcher) _Jv_type_matcher;
- ehinfo->eh_info.language = EH_LANG_Java;
- ehinfo->eh_info.version = 1;
- ehinfo->value = value;
-/* We're happy with setjmp/longjmp exceptions or region-based
- exception handlers: entry points are provided here for both. */
+ // FIXME: In Phase 1, record _Unwind_GetIP in xh->obj as a part of
+ // the stack trace for this exception. This will only collect Java
+ // frames, but perhaps that is acceptable.
+ // FIXME2: _Unwind_GetIP is nonsensical for SJLJ, being a call-site
+ // index instead of a PC value. We could perhaps arrange for
+ // _Unwind_GetRegionStart to return context->fc->jbuf[1], which
+ // is the address of the handler label for __builtin_longjmp, but
+ // there is no solution for DONT_USE_BUILTIN_SETJMP.
+
+ language_specific_data = (const unsigned char *)
+ _Unwind_GetLanguageSpecificData (context);
+
+ // If no LSDA, then there are no handlers or cleanups.
+ if (! language_specific_data)
+ return _URC_CONTINUE_UNWIND;
+
+ // Parse the LSDA header.
+ p = parse_lsda_header (context, language_specific_data, &info);
+ ip = _Unwind_GetIP (context) - 1;
+ landing_pad = 0;
+ action_record = 0;
+ handler_switch_value = 0;
+
#ifdef SJLJ_EXCEPTIONS
- __sjthrow ();
+ // The given "IP" is an index into the call-site table, with two
+ // exceptions -- -1 means no-action, and 0 means terminate. But
+ // since we're using uleb128 values, we've not got random access
+ // to the array.
+ if ((int) ip <= 0)
+ return _URC_CONTINUE_UNWIND;
+ else
+ {
+ _Unwind_Ptr cs_lp, cs_action;
+ do
+ {
+ p = read_uleb128 (p, &cs_lp);
+ p = read_uleb128 (p, &cs_action);
+ }
+ while (--ip);
+
+ // Can never have null landing pad for sjlj -- that would have
+ // been indicated by a -1 call site index.
+ landing_pad = cs_lp + 1;
+ if (cs_action)
+ action_record = info.action_table + cs_action - 1;
+ goto found_something;
+ }
#else
- __throw ();
-#endif
-}
+ // Search the call-site table for the action associated with this IP.
+ while (p < info.action_table)
+ {
+ _Unwind_Ptr cs_start, cs_len, cs_lp, cs_action;
+
+ // Note that all call-site encodings are "absolute" displacements.
+ p = read_encoded_value (0, info.call_site_encoding, p, &cs_start);
+ p = read_encoded_value (0, info.call_site_encoding, p, &cs_len);
+ p = read_encoded_value (0, info.call_site_encoding, p, &cs_lp);
+ p = read_uleb128 (p, &cs_action);
+
+ // The table is sorted, so if we've passed the ip, stop.
+ if (ip < info.Start + cs_start)
+ p = info.action_table;
+ else if (ip < info.Start + cs_start + cs_len)
+ {
+ if (cs_lp)
+ landing_pad = info.LPStart + cs_lp;
+ if (cs_action)
+ action_record = info.action_table + cs_action - 1;
+ goto found_something;
+ }
+ }
+#endif // SJLJ_EXCEPTIONS
-#ifdef USE_WIN32_SIGNALLING
+ // If ip is not present in the table, C++ would call terminate.
+ // ??? It is perhaps better to tweek the LSDA so that no-action
+ // is mapped to no-entry for Java.
+ return _URC_CONTINUE_UNWIND;
-// This is a mangled version of _Jv_Throw and __sjthrow except
-// rather than calling longjmp, it returns a pointer to the jmp buffer
+ found_something:
+ saw_cleanup = false;
+ saw_handler = false;
-extern "C" int *
-win32_get_restart_frame (void *value)
-{
- struct eh_context *eh = (struct eh_context *)__get_eh_context ();
- void ***dhc = &eh->dynamic_handler_chain;
-
- java_eh_info *ehinfo = *(__get_eh_info ());
- if (ehinfo == NULL)
+ if (landing_pad == 0)
{
- _Jv_eh_alloc ();
- ehinfo = *(__get_eh_info ());
+ // If ip is present, and has a null landing pad, there are
+ // no cleanups or handlers to be run.
+ }
+ else if (action_record == 0)
+ {
+ // If ip is present, has a non-null landing pad, and a null
+ // action table offset, then there are only cleanups present.
+ // Cleanups use a zero switch value, as set above.
+ saw_cleanup = true;
+ }
+ else
+ {
+ // Otherwise we have a catch handler.
+ signed long ar_filter, ar_disp;
+
+ while (1)
+ {
+ _Unwind_Ptr tmp;
+
+ p = action_record;
+ p = read_sleb128 (p, &tmp); ar_filter = tmp;
+ read_sleb128 (p, &tmp); ar_disp = tmp;
+
+ if (ar_filter == 0)
+ {
+ // Zero filter values are cleanups.
+ saw_cleanup = true;
+ }
+
+ // During forced unwinding, we only run cleanups. With a
+ // foreign exception class, we have no class info to match.
+ else if ((actions & _UA_FORCE_UNWIND)
+ || exception_class != __gcj_exception_class)
+ ;
+
+ else if (ar_filter > 0)
+ {
+ // Positive filter values are handlers.
+
+ jclass catch_type = get_ttype_entry (context, &info, ar_filter);
+
+ // The catch_type is either a (java::lang::Class*) or
+ // is one more than a (Utf8Const*).
+ if ((size_t)catch_type & 1)
+ catch_type = _Jv_FindClass ((Utf8Const*)catch_type - 1, NULL);
+
+ if (_Jv_IsInstanceOf (xh->value, catch_type))
+ {
+ handler_switch_value = ar_filter;
+ saw_handler = true;
+ break;
+ }
+ }
+ else
+ {
+ // Negative filter values are exception specifications,
+ // which Java does not use.
+ // ??? Perhaps better to make them an index into a table
+ // of null-terminated strings instead of playing games
+ // with Utf8Const+1 as above.
+ std::abort ();
+ }
+
+ if (ar_disp == 0)
+ break;
+ action_record = p + ar_disp;
+ }
}
- ehinfo->eh_info.match_function = (__eh_matcher) _Jv_type_matcher;
- ehinfo->eh_info.language = EH_LANG_Java;
- ehinfo->eh_info.version = 1;
- ehinfo->value = value;
-
- // FIXME: Run clean ups?
- int *jmpbuf = (int*)&(*dhc)[2];
+ if (! saw_handler && ! saw_cleanup)
+ return _URC_CONTINUE_UNWIND;
- *dhc = (void**)(*dhc)[0];
+ if (actions & _UA_SEARCH_PHASE)
+ {
+ if (! saw_handler)
+ return _URC_CONTINUE_UNWIND;
+
+ // For domestic exceptions, we cache data from phase 1 for phase 2.
+ if (exception_class == __gcj_exception_class)
+ {
+ xh->handlerSwitchValue = handler_switch_value;
+ xh->landingPad = landing_pad;
+ }
+ return _URC_HANDLER_FOUND;
+ }
- return jmpbuf;
+ install_context:
+ _Unwind_SetGR (context, __builtin_eh_return_data_regno (0),
+ (_Unwind_Ptr) &xh->unwindHeader);
+ _Unwind_SetGR (context, __builtin_eh_return_data_regno (1),
+ handler_switch_value);
+ _Unwind_SetIP (context, landing_pad);
+ return _URC_INSTALL_CONTEXT;
}
-
-#endif /* USE_WIN32_SIGNALLING */
diff --git a/libjava/gcj/Makefile.am b/libjava/gcj/Makefile.am
index 35fc7eec67e..4b1d8c0569d 100644
--- a/libjava/gcj/Makefile.am
+++ b/libjava/gcj/Makefile.am
@@ -1,6 +1,6 @@
## Process this file with automake to produce Makefile.in.
-AUTOMAKE_OPTIONS = foreign no-installinfo
+AUTOMAKE_OPTIONS = foreign
gcjdir = $(includedir)/gcj
gcj_HEADERS = array.h cni.h field.h javaprims.h method.h
diff --git a/libjava/gcj/Makefile.in b/libjava/gcj/Makefile.in
index b2ffae0594d..80db9d56fb8 100644
--- a/libjava/gcj/Makefile.in
+++ b/libjava/gcj/Makefile.in
@@ -73,18 +73,19 @@ CXXCPP = @CXXCPP@
DIRLTDL = @DIRLTDL@
DIVIDESPEC = @DIVIDESPEC@
DLLTOOL = @DLLTOOL@
-EH_COMMON_INCLUDE = @EH_COMMON_INCLUDE@
EXCEPTIONSPEC = @EXCEPTIONSPEC@
EXEEXT = @EXEEXT@
-FORCELIBGCCSPEC = @FORCELIBGCCSPEC@
+GCC_UNWIND_INCLUDE = @GCC_UNWIND_INCLUDE@
GCDEPS = @GCDEPS@
GCINCS = @GCINCS@
GCJ = @GCJ@
GCJFLAGS = @GCJFLAGS@
+GCJVERSION = @GCJVERSION@
GCLIBS = @GCLIBS@
GCOBJS = @GCOBJS@
GCSPEC = @GCSPEC@
GCTESTSPEC = @GCTESTSPEC@
+ICONV_LDFLAGS = @ICONV_LDFLAGS@
INCLTDL = @INCLTDL@
JC1GCSPEC = @JC1GCSPEC@
LIBDATASTARTSPEC = @LIBDATASTARTSPEC@
@@ -93,6 +94,7 @@ LIBGCJTESTSPEC = @LIBGCJTESTSPEC@
LIBGCJ_CFLAGS = @LIBGCJ_CFLAGS@
LIBGCJ_CXXFLAGS = @LIBGCJ_CXXFLAGS@
LIBGCJ_JAVAFLAGS = @LIBGCJ_JAVAFLAGS@
+LIBICONV = @LIBICONV@
LIBLTDL = @LIBLTDL@
LIBTOOL = @LIBTOOL@
LN_S = @LN_S@
@@ -119,12 +121,12 @@ ZLIBSPEC = @ZLIBSPEC@
ZLIBTESTSPEC = @ZLIBTESTSPEC@
here = @here@
libgcj_basedir = @libgcj_basedir@
+mkinstalldirs = @mkinstalldirs@
-AUTOMAKE_OPTIONS = foreign no-installinfo
+AUTOMAKE_OPTIONS = foreign
gcjdir = $(includedir)/gcj
gcj_HEADERS = array.h cni.h field.h javaprims.h method.h
-mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs
CONFIG_HEADER = ../include/config.h
CONFIG_CLEAN_FILES =
HEADERS = $(gcj_HEADERS)
@@ -218,8 +220,6 @@ check-am: all-am
check: check-am
installcheck-am:
installcheck: installcheck-am
-install-info-am:
-install-info: install-info-am
install-exec-am:
install-exec: install-exec-am
@@ -270,10 +270,10 @@ maintainer-clean: maintainer-clean-am
.PHONY: uninstall-gcjHEADERS install-gcjHEADERS tags mostlyclean-tags \
distclean-tags clean-tags maintainer-clean-tags distdir 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-redirect all-am all \
-installdirs mostlyclean-generic distclean-generic clean-generic \
+dvi-am dvi check check-am installcheck-am installcheck install-exec-am \
+install-exec install-data-am install-data install-am install \
+uninstall-am uninstall all-redirect all-am all installdirs \
+mostlyclean-generic distclean-generic clean-generic \
maintainer-clean-generic clean mostlyclean distclean maintainer-clean
diff --git a/libjava/gcj/cni.h b/libjava/gcj/cni.h
index 1dacbd0810d..26be2fc5214 100644
--- a/libjava/gcj/cni.h
+++ b/libjava/gcj/cni.h
@@ -106,16 +106,12 @@ public:
{ _Jv_MonitorExit (obj); }
};
-#ifdef SJLJ_EXCEPTIONS
-#define _Jv_Throw _Jv_Sjlj_Throw
-#endif
-
// Throw some exception.
extern void JvThrow (jobject obj) __attribute__ ((__noreturn__));
extern inline void
JvThrow (jobject obj)
{
- _Jv_Throw ((void *) obj);
+ _Jv_Throw ((jthrowable) obj);
}
/* Call malloc, but throw exception if insufficient memory. */
diff --git a/libjava/gcj/javaprims.h b/libjava/gcj/javaprims.h
index 622db0c79f5..a66bf29c2fe 100644
--- a/libjava/gcj/javaprims.h
+++ b/libjava/gcj/javaprims.h
@@ -11,6 +11,9 @@ details. */
#ifndef __JAVAPRIMS_H__
#define __JAVAPRIMS_H__
+// Force C++ compiler to use Java-style exceptions.
+#pragma GCC java_exceptions
+
// FIXME: this is a hack until we get a proper gcjh.
// It is needed to work around system header files that define TRUE
// and FALSE.
@@ -39,7 +42,6 @@ extern "Java"
{
namespace io
{
- class BlockDataException;
class BufferedInputStream;
class BufferedOutputStream;
class BufferedReader;
@@ -233,10 +235,12 @@ extern "Java"
class ArrayList;
class Arrays;
class Arrays$ListImpl;
+ class BasicMapEntry;
class BitSet;
class Calendar;
class Collection;
class Collections;
+ class Collections$ReverseComparator;
class Collections$SynchronizedCollection;
class Collections$SynchronizedIterator;
class Collections$SynchronizedList;
@@ -302,6 +306,12 @@ extern "Java"
class Timer$TaskQueue;
class TimerTask;
class TooManyListenersException;
+ class TreeMap;
+ class TreeMap$Node;
+ class TreeMap$SubMap;
+ class TreeMap$TreeIterator;
+ class TreeMap$VerifyResult;
+ class TreeSet;
class Vector;
class WeakHashMap;
class WeakHashMap$Entry;
@@ -368,8 +378,7 @@ extern "C" jstring _Jv_NewStringLatin1(const char*, jsize)
extern "C" jsize _Jv_GetStringUTFLength (jstring);
extern "C" jsize _Jv_GetStringUTFRegion (jstring, jsize, jsize, char *);
-extern "C" void _Jv_Throw (void *) __attribute__ ((__noreturn__));
-extern "C" void _Jv_Sjlj_Throw (void *) __attribute__ ((__noreturn__));
+extern "C" void _Jv_Throw (jthrowable) __attribute__ ((__noreturn__));
extern "C" void* _Jv_Malloc (jsize) __attribute__((__malloc__));
extern "C" void* _Jv_Realloc (void *, jsize);
extern "C" void _Jv_Free (void*);
diff --git a/libjava/gij.cc b/libjava/gij.cc
index 47faed37597..11d4a163de3 100644
--- a/libjava/gij.cc
+++ b/libjava/gij.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999, 2000 Free Software Foundation
+/* Copyright (C) 1999, 2000, 2001 Free Software Foundation
This file is part of libgcj.
@@ -41,7 +41,7 @@ static void
version ()
{
printf ("gij (GNU libgcj) version %s\n\n", VERSION);
- printf ("Copyright (C) 1999, 2000 Free Software Foundation.\n");
+ printf ("Copyright (C) 2001 Free Software Foundation.\n");
printf ("This is free software; see the source for copying conditions. There is NO\n");
printf ("warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n");
exit (0);
diff --git a/libjava/gnu/awt/j2d/AbstractGraphicsState.java b/libjava/gnu/awt/j2d/AbstractGraphicsState.java
index e3b3ec61599..1c29bc202f6 100644
--- a/libjava/gnu/awt/j2d/AbstractGraphicsState.java
+++ b/libjava/gnu/awt/j2d/AbstractGraphicsState.java
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 Free Software Foundation
+/* Copyright (C) 2000, 2001 Free Software Foundation
This file is part of libgcj.
@@ -125,4 +125,9 @@ public abstract class AbstractGraphicsState implements Cloneable
public abstract void scale(double scaleX, double scaleY);
public abstract void shear(double shearX, double shearY);
+
+ public Object clone ()
+ {
+ return super.clone ();
+ }
}
diff --git a/libjava/gnu/awt/j2d/DirectRasterGraphics.java b/libjava/gnu/awt/j2d/DirectRasterGraphics.java
index 6bbdbd1d23e..8d25b88d018 100644
--- a/libjava/gnu/awt/j2d/DirectRasterGraphics.java
+++ b/libjava/gnu/awt/j2d/DirectRasterGraphics.java
@@ -79,4 +79,6 @@ public interface DirectRasterGraphics extends Cloneable
* Detach previously mapped pixel data from a raster object.
*/
public void unmapRaster(MappedRaster mappedRaster);
+
+ public Object clone();
}
diff --git a/libjava/gnu/awt/j2d/IntegerGraphicsState.java b/libjava/gnu/awt/j2d/IntegerGraphicsState.java
index 923720e06ae..90a1a4d2ab5 100644
--- a/libjava/gnu/awt/j2d/IntegerGraphicsState.java
+++ b/libjava/gnu/awt/j2d/IntegerGraphicsState.java
@@ -69,7 +69,6 @@ public class IntegerGraphicsState extends AbstractGraphicsState
super.dispose();
}
-
// -------- Graphics methods:
public void setColor(Color color)
@@ -101,7 +100,7 @@ public class IntegerGraphicsState extends AbstractGraphicsState
{
if (clip instanceof Rectangle)
{
- Rectangle clipRect = (Rectangle) clip.clone();
+ Rectangle clipRect = (Rectangle) ((Rectangle) clip).clone();
clipRect.x += tx;
clipRect.y += ty;
diff --git a/libjava/gnu/gcj/convert/IOConverter.java b/libjava/gnu/gcj/convert/IOConverter.java
index 9b5fbad00f4..a978c752069 100644
--- a/libjava/gnu/gcj/convert/IOConverter.java
+++ b/libjava/gnu/gcj/convert/IOConverter.java
@@ -27,6 +27,11 @@ public abstract class IOConverter
// Manually maintained aliases. Note that the value must be our
// canonical name.
hash.put ("ISO-Latin-1", "8859_1");
+ // On Solaris the default encoding, as returned by nl_langinfo(),
+ // is `646' (aka ASCII), but the Solaris iconv_open() doesn't
+ // understand that. We work around the problem by adding an
+ // explicit alias for Solaris users.
+ hash.put ("646", "ASCII");
// All aliases after this point are automatically generated by the
// `encodings.pl' script. Run it to make any corrections.
hash.put ("ANSI_X3.4-1968", "ASCII");
diff --git a/libjava/gnu/gcj/convert/UnicodeToBytes.java b/libjava/gnu/gcj/convert/UnicodeToBytes.java
index dce7797fbaf..5a84af3876d 100644
--- a/libjava/gnu/gcj/convert/UnicodeToBytes.java
+++ b/libjava/gnu/gcj/convert/UnicodeToBytes.java
@@ -120,6 +120,6 @@ public abstract class UnicodeToBytes extends IOConverter
work = new char[inlength];
int srcEnd = inpos + (inlength > work.length ? work.length : inlength);
str.getChars(inpos, srcEnd, work, 0);
- return write(work, inpos, inlength);
+ return write(work, 0, srcEnd - inpos);
}
}
diff --git a/libjava/gnu/gcj/io/shs.cc b/libjava/gnu/gcj/io/shs.cc
index 96b4f560352..b9a563c544c 100644
--- a/libjava/gnu/gcj/io/shs.cc
+++ b/libjava/gnu/gcj/io/shs.cc
@@ -10,6 +10,10 @@
* Comments to pgut1@cs.aukuni.ac.nz
*/
+// Force C++ compiler to use Java-style EH, so we don't have to link with
+// libstdc++.
+#pragma GCC java_exceptions
+
#include <string.h>
#include "shs.h"
diff --git a/libjava/gnu/gcj/math/MPN.java b/libjava/gnu/gcj/math/MPN.java
index fb947a5a699..879b1733236 100644
--- a/libjava/gnu/gcj/math/MPN.java
+++ b/libjava/gnu/gcj/math/MPN.java
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999, 2000 Free Software Foundation
+/* Copyright (C) 1999, 2000, 2001 Free Software Foundation
This file is part of libgcj.
@@ -481,7 +481,7 @@ public class MPN
return xlen > ylen ? 1 : xlen < ylen ? -1 : cmp (x, y, xlen);
}
- /* Shift x[x_start:x_start+len-1]count bits to the "right"
+ /* Shift x[x_start:x_start+len-1] count bits to the "right"
* (i.e. divide by 2**count).
* Store the len least significant words of the result at dest.
* The bits shifted out to the right are returned.
@@ -506,6 +506,23 @@ public class MPN
return retval;
}
+ /* Shift x[x_start:x_start+len-1] count bits to the "right"
+ * (i.e. divide by 2**count).
+ * Store the len least significant words of the result at dest.
+ * OK if dest==x.
+ * Assumes: 0 <= count < 32
+ * Same as rshift, but handles count==0 (and has no return value).
+ */
+ public static void rshift0 (int[] dest, int[] x, int x_start,
+ int len, int count)
+ {
+ if (count > 0)
+ rshift(dest, x, x_start, len, count);
+ else
+ for (int i = 0; i < len; i++)
+ dest[i] = x[i + x_start];
+ }
+
/** Return the long-truncated value of right shifting.
* @param x a two's-complement "bignum"
* @param len the number of significant words in x
@@ -530,20 +547,6 @@ public class MPN
return ((long)w1 << 32) | ((long)w0 & 0xffffffffL);
}
- /* Shift x[0:len-1]count bits to the "right" (i.e. divide by 2**count).
- * Store the len least significant words of the result at dest.
- * OK if dest==x.
- * OK if count > 32 (but must be >= 0).
- */
- public static void rshift (int[] dest, int[] x, int len, int count)
- {
- int word_count = count >> 5;
- count &= 31;
- rshift (dest, x, word_count, len, count);
- while (word_count < len)
- dest[word_count++] = 0;
- }
-
/* Shift x[0:len-1] left by count bits, and store the len least
* significant words of the result in dest[d_offset:d_offset+len-1].
* Return the bits shifted out from the most significant digit.
@@ -624,8 +627,8 @@ public class MPN
// Temporarily devide both x and y by 2**sh.
len -= initShiftWords;
- MPN.rshift (x, x, initShiftWords, len, initShiftBits);
- MPN.rshift (y, y, initShiftWords, len, initShiftBits);
+ MPN.rshift0 (x, x, initShiftWords, len, initShiftBits);
+ MPN.rshift0 (y, y, initShiftWords, len, initShiftBits);
int[] odd_arg; /* One of x or y which is odd. */
int[] other_arg; /* The other one can be even or odd. */
@@ -704,7 +707,7 @@ public class MPN
}
/** Calcaulte the Common Lisp "integer-length" function.
- * Assumes input is canonicalized: len==IntNum.wordsNeeded(words,len) */
+ * Assumes input is canonicalized: len==BigInteger.wordsNeeded(words,len) */
public static int intLength (int[] words, int len)
{
len--;
@@ -712,7 +715,7 @@ public class MPN
}
/* DEBUGGING:
- public static void dprint (IntNum x)
+ public static void dprint (BigInteger x)
{
if (x.words == null)
System.err.print(Long.toString((long) x.ival & 0xffffffffL, 16));
diff --git a/libjava/gnu/gcj/runtime/VMClassLoader.java b/libjava/gnu/gcj/runtime/VMClassLoader.java
index 77051d253b7..cc3436928ec 100644
--- a/libjava/gnu/gcj/runtime/VMClassLoader.java
+++ b/libjava/gnu/gcj/runtime/VMClassLoader.java
@@ -65,18 +65,11 @@ final class VMClassLoader extends java.net.URLClassLoader
/** This is overridden to search the internal hash table, which
* will only search existing linked-in classes. This will make
* the default implementation of loadClass (in ClassLoader) work right.
+ * The implementation of this method is in java/lang/natClassLoader.cc.
*/
- protected final native Class findSystemClass(String name)
- throws java.lang.ClassNotFoundException, java.lang.LinkageError;
-
- // Return the sole VMClassLoader.
- private static synchronized VMClassLoader getVMClassLoader ()
- {
- if (redirect == null)
- redirect = new VMClassLoader ();
- return redirect;
- }
+ protected native Class findClass(String name)
+ throws java.lang.ClassNotFoundException;
// The only VMClassLoader that can exist.
- private static VMClassLoader redirect;
+ public static VMClassLoader instance = new VMClassLoader ();
}
diff --git a/libjava/gnu/gcj/runtime/natFirstThread.cc b/libjava/gnu/gcj/runtime/natFirstThread.cc
index 3b36d392e10..b7ec4aa86f4 100644
--- a/libjava/gnu/gcj/runtime/natFirstThread.cc
+++ b/libjava/gnu/gcj/runtime/natFirstThread.cc
@@ -1,6 +1,6 @@
// natFirstThread.cc - Implementation of FirstThread native methods.
-/* Copyright (C) 1998, 1999, 2000 Free Software Foundation
+/* Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation
This file is part of libgcj.
@@ -37,12 +37,19 @@ typedef void main_func (jobject);
extern void (*_Jv_JVMPI_Notify_THREAD_START) (JVMPI_Event *event);
#endif
-/* This will be non-NULL if the user has preloaded a JNI library, or
- linked one into the executable. */
+/* This will be different from _JNI_OnLoad if the user has preloaded a JNI
+ library, or linked one into the executable. */
extern "C"
{
-#pragma weak JNI_OnLoad
+ /* Some systems, like Tru64 UNIX, don't support weak definitions, so use
+ an empty dummy function to check if the user provided his own. */
+#pragma weak JNI_OnLoad = _JNI_OnLoad
extern jint JNI_OnLoad (JavaVM *, void *) __attribute__((weak));
+
+ jint _JNI_OnLoad (JavaVM *vm, void *)
+ {
+ return 0;
+ }
}
void
@@ -57,7 +64,7 @@ gnu::gcj::runtime::FirstThread::run (void)
environment variable. We take advatage of this here to allow for
dynamically loading a JNI library into a fully linked executable. */
- if (JNI_OnLoad != NULL)
+ if (JNI_OnLoad != _JNI_OnLoad)
{
JavaVM *vm = _Jv_GetJavaVM ();
if (vm == NULL)
diff --git a/libjava/include/Makefile.am b/libjava/include/Makefile.am
index 8e3f18f9d0c..8c0814abb1b 100644
--- a/libjava/include/Makefile.am
+++ b/libjava/include/Makefile.am
@@ -1,5 +1,5 @@
## Process this file with automake to produce Makefile.in.
-AUTOMAKE_OPTIONS = foreign no-installinfo
+AUTOMAKE_OPTIONS = foreign
include_HEADERS = jni.h jvmpi.h
diff --git a/libjava/include/Makefile.in b/libjava/include/Makefile.in
index 021c1efa632..d521c34f9e8 100644
--- a/libjava/include/Makefile.in
+++ b/libjava/include/Makefile.in
@@ -73,18 +73,19 @@ CXXCPP = @CXXCPP@
DIRLTDL = @DIRLTDL@
DIVIDESPEC = @DIVIDESPEC@
DLLTOOL = @DLLTOOL@
-EH_COMMON_INCLUDE = @EH_COMMON_INCLUDE@
EXCEPTIONSPEC = @EXCEPTIONSPEC@
EXEEXT = @EXEEXT@
-FORCELIBGCCSPEC = @FORCELIBGCCSPEC@
+GCC_UNWIND_INCLUDE = @GCC_UNWIND_INCLUDE@
GCDEPS = @GCDEPS@
GCINCS = @GCINCS@
GCJ = @GCJ@
GCJFLAGS = @GCJFLAGS@
+GCJVERSION = @GCJVERSION@
GCLIBS = @GCLIBS@
GCOBJS = @GCOBJS@
GCSPEC = @GCSPEC@
GCTESTSPEC = @GCTESTSPEC@
+ICONV_LDFLAGS = @ICONV_LDFLAGS@
INCLTDL = @INCLTDL@
JC1GCSPEC = @JC1GCSPEC@
LIBDATASTARTSPEC = @LIBDATASTARTSPEC@
@@ -93,6 +94,7 @@ LIBGCJTESTSPEC = @LIBGCJTESTSPEC@
LIBGCJ_CFLAGS = @LIBGCJ_CFLAGS@
LIBGCJ_CXXFLAGS = @LIBGCJ_CXXFLAGS@
LIBGCJ_JAVAFLAGS = @LIBGCJ_JAVAFLAGS@
+LIBICONV = @LIBICONV@
LIBLTDL = @LIBLTDL@
LIBTOOL = @LIBTOOL@
LN_S = @LN_S@
@@ -119,11 +121,11 @@ ZLIBSPEC = @ZLIBSPEC@
ZLIBTESTSPEC = @ZLIBTESTSPEC@
here = @here@
libgcj_basedir = @libgcj_basedir@
+mkinstalldirs = @mkinstalldirs@
-AUTOMAKE_OPTIONS = foreign no-installinfo
+AUTOMAKE_OPTIONS = foreign
include_HEADERS = jni.h jvmpi.h
-mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs
CONFIG_HEADER = config.h
CONFIG_CLEAN_FILES =
HEADERS = $(include_HEADERS)
@@ -245,8 +247,6 @@ check-am: all-am
check: check-am
installcheck-am:
installcheck: installcheck-am
-install-info-am:
-install-info: install-info-am
all-recursive-am: config.h
$(MAKE) $(AM_MAKEFLAGS) all-recursive
@@ -301,12 +301,11 @@ maintainer-clean: maintainer-clean-am
.PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \
uninstall-includeHEADERS install-includeHEADERS tags mostlyclean-tags \
distclean-tags clean-tags maintainer-clean-tags distdir info-am info \
-dvi-am dvi check check-am installcheck-am installcheck install-info-am \
-install-info all-recursive-am install-exec-am install-exec \
-install-data-am install-data install-am install uninstall-am uninstall \
-all-redirect all-am all installdirs mostlyclean-generic \
-distclean-generic clean-generic maintainer-clean-generic clean \
-mostlyclean distclean maintainer-clean
+dvi-am dvi check check-am installcheck-am installcheck all-recursive-am \
+install-exec-am install-exec install-data-am install-data install-am \
+install uninstall-am uninstall all-redirect all-am all installdirs \
+mostlyclean-generic distclean-generic clean-generic \
+maintainer-clean-generic clean mostlyclean distclean maintainer-clean
# Tell versions [3.59,3.63) of GNU make to not export all variables.
diff --git a/libjava/include/config.h.in b/libjava/include/config.h.in
index a31dceadce4..00a29a1d0fd 100644
--- a/libjava/include/config.h.in
+++ b/libjava/include/config.h.in
@@ -83,6 +83,9 @@
/* Define if struct ip_mreq is defined in netinet/in.h. */
#undef HAVE_STRUCT_IP_MREQ
+/* Define if struct ipv6_mreq is defined in netinet/in.h. */
+#undef HAVE_STRUCT_IPV6_MREQ
+
/* Define it socklen_t typedef is in sys/socket.h. */
#undef HAVE_SOCKLEN_T
@@ -135,9 +138,6 @@
getenv("GCJ_PROPERTIES"). */
#undef DISABLE_GETENV_PROPERTIES
-/* Define if using setjmp/longjmp exceptions. */
-#undef SJLJ_EXCEPTIONS
-
/* Define if you have /proc/self/exe */
#undef HAVE_PROC_SELF_EXE
@@ -167,6 +167,9 @@
/* Define if you have the backtrace function. */
#undef HAVE_BACKTRACE
+/* Define if you have the chmod function. */
+#undef HAVE_CHMOD
+
/* Define if you have the execvp function. */
#undef HAVE_EXECVP
@@ -203,9 +206,6 @@
/* Define if you have the gmtime_r function. */
#undef HAVE_GMTIME_R
-/* Define if you have the iconv function. */
-#undef HAVE_ICONV
-
/* Define if you have the inet_addr function. */
#undef HAVE_INET_ADDR
@@ -287,6 +287,9 @@
/* Define if you have the unlink function. */
#undef HAVE_UNLINK
+/* Define if you have the utime function. */
+#undef HAVE_UTIME
+
/* Define if you have the <arpa/inet.h> header file. */
#undef HAVE_ARPA_INET_H
@@ -359,12 +362,21 @@
/* Version number of package */
#undef VERSION
+/* Define if the compiler is configured for setjmp/longjmp exceptions. */
+#undef SJLJ_EXCEPTIONS
+
/* Required define if using POSIX threads */
#undef _REENTRANT
/* Required define if using POSIX threads */
#undef _POSIX_PTHREAD_SEMANTICS
+/* Define if you have the iconv() function. */
+#undef HAVE_ICONV
+
+/* Define as const if the declaration of iconv() needs const. */
+#undef ICONV_CONST
+
/* Required define if using POSIX threads */
#undef _REENTRANT
diff --git a/libjava/include/dwarf2-signal.h b/libjava/include/dwarf2-signal.h
new file mode 100644
index 00000000000..3a662aec2d9
--- /dev/null
+++ b/libjava/include/dwarf2-signal.h
@@ -0,0 +1,85 @@
+// dwarf2-signal.h - Catch runtime signals and turn them into exceptions.
+
+/* Copyright (C) 2000, 2001 Free Software Foundation
+
+ This file is part of libgcj.
+
+ Use this file for a target for which the dwarf2 unwinder in libgcc
+ can unwind through signal handlers.
+
+This software is copyrighted work licensed under the terms of the
+Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
+details. */
+
+#ifndef JAVA_SIGNAL_H
+#define JAVA_SIGNAL_H 1
+
+#include <signal.h>
+#include <sys/syscall.h>
+
+#define HANDLE_SEGV 1
+#undef HANDLE_FPE
+
+#define SIGNAL_HANDLER(_name) \
+static void _Jv_##_name (int, siginfo_t *, void *_p)
+
+class java::lang::Throwable;
+
+// Unwind the stack to the point at which the signal was generated and
+// then throw an exception. With the dwarf2 unwinder we don't usually
+// need to do anything, with some minor exceptions.
+
+#ifdef __alpha__
+#define MAKE_THROW_FRAME(_exception) \
+do \
+{ \
+ /* Alpha either leaves PC pointing at a faulting instruction or the \
+ following instruction, depending on the signal. SEGV always does \
+ the former, so we adjust the saved PC to point to the following \
+ instruction; this is what the handler in libgcc expects. */ \
+ struct sigcontext *_sc = (struct sigcontext *)_p; \
+ _sc->sc_pc += 4; \
+} \
+while (0)
+#else
+#define MAKE_THROW_FRAME(_exception) \
+do \
+{ \
+ (void)_p; \
+} \
+while (0)
+#endif
+
+#define INIT_SEGV \
+do \
+ { \
+ nullp = new java::lang::NullPointerException (); \
+ struct sigaction act; \
+ act.sa_sigaction = _Jv_catch_segv; \
+ sigemptyset (&act.sa_mask); \
+ act.sa_flags = SA_SIGINFO; \
+ syscall (SYS_sigaction, SIGSEGV, &act, NULL); \
+ } \
+while (0)
+
+#define INIT_FPE \
+do \
+ { \
+ arithexception = new java::lang::ArithmeticException \
+ (JvNewStringLatin1 ("/ by zero")); \
+ struct sigaction act; \
+ act.sa_sigaction = _Jv_catch_fpe; \
+ sigemptyset (&act.sa_mask); \
+ act.sa_flags = SA_SIGINFO; \
+ syscall (SYS_sigaction, SIGFPE, &act, NULL); \
+ } \
+while (0)
+
+/* We use syscall(SYS_sigaction) in INIT_SEGV and INIT_FPE instead of
+ * sigaction() because on some systems the pthreads wrappers for
+ * signal handlers are not compiled with unwind information, so it's
+ * not possible to unwind through them. This is a problem that will
+ * go away once all systems have pthreads libraries that are
+ * compiled with full unwind info. */
+
+#endif /* JAVA_SIGNAL_H */
diff --git a/libjava/include/i386-signal.h b/libjava/include/i386-signal.h
index de2e39cdbc2..c68567586bb 100644
--- a/libjava/include/i386-signal.h
+++ b/libjava/include/i386-signal.h
@@ -31,16 +31,11 @@ do \
void **_p = (void **)&_dummy; \
struct sigcontext_struct *_regs = (struct sigcontext_struct *)++_p; \
\
- register unsigned long _ebp = _regs->ebp; \
- register unsigned char *_eip = (unsigned char *)_regs->eip; \
- \
/* Advance the program counter so that it is after the start of the \
instruction: the x86 exception handler expects \
the PC to point to the instruction after a call. */ \
- _eip += 2; \
+ _regs->eip += 2; \
\
- asm volatile ("mov %0, (%%ebp); mov %1, 4(%%ebp)" \
- : : "r"(_ebp), "r"(_eip)); \
} \
while (0)
@@ -63,7 +58,7 @@ do \
* As the instructions are variable length it is necessary to do a \
* little calculation to figure out where the following instruction \
* actually is. \
- \
+ \
*/ \
\
if (_eip[0] == 0xf7) \
@@ -104,6 +99,9 @@ do \
\
_eip = (unsigned char *)_ebp[1]; \
_ebp = (unsigned long *)_ebp[0]; \
+ \
+ asm volatile ("mov %0, (%%ebp); mov %1, 4(%%ebp)" \
+ : : "r"(_ebp), "r"(_eip)); \
} \
else \
{ \
@@ -111,12 +109,9 @@ do \
of the instruction: this is because the x86 exception \
handler expects the PC to point to the instruction after a \
call. */ \
- _eip += 2; \
+ _regs->eip += 2; \
} \
} \
- \
- asm volatile ("mov %0, (%%ebp); mov %1, 4(%%ebp)" \
- : : "r"(_ebp), "r"(_eip)); \
} \
while (0)
@@ -128,7 +123,7 @@ do \
act.sa_handler = catch_segv; \
sigemptyset (&act.sa_mask); \
act.sa_flags = 0; \
- __sigaction (SIGSEGV, &act, NULL); \
+ syscall (SYS_sigaction, SIGSEGV, &act, NULL); \
} \
while (0)
@@ -145,18 +140,18 @@ do \
} \
while (0)
-/* You might wonder why we use syscall(SYS_sigaction) in INIT_FPE
- * instead of the standard sigaction(). This is necessary because of
- * the shenanigans above where we increment the PC saved in the
- * context and then return. This trick will only work when we are
+/* You might wonder why we use syscall(SYS_sigaction) in INIT_SEGV and
+ * INIT_FPE instead of the standard sigaction(). This is necessary
+ * because of the shenanigans above where we increment the PC saved in
+ * the context and then return. This trick will only work when we are
* called _directly_ by the kernel, because linuxthreads wraps signal
- * handlers and its wrappers do not copy the sigcontext struct back
- * when returning from a signal handler. If we return from our divide
- * handler to a linuxthreads wrapper, we will lose the PC adjustment
- * we made and return to the faulting instruction again. Using
- * syscall(SYS_sigaction) causes our handler to be called directly by
- * the kernel, bypassing any wrappers. This is a kludge, and a future
- * version of this handler will do something better. */
+ * handlers and its wrappers do not copy the sigcontext struct back when
+ * returning from a signal handler. If we return from our divide handler
+ * to a linuxthreads wrapper, we will lose the PC adjustment we made and
+ * return to the faulting instruction again. Using syscall(SYS_sigaction)
+ * causes our handler to be called directly by the kernel, bypassing
+ * any wrappers. This is a kludge, and a future version of this handler
+ * will do something better. */
#endif /* JAVA_SIGNAL_H */
diff --git a/libjava/include/java-interp.h b/libjava/include/java-interp.h
index 59976b31acf..ebf958bf197 100644
--- a/libjava/include/java-interp.h
+++ b/libjava/include/java-interp.h
@@ -1,6 +1,6 @@
// java-interp.h - Header file for the bytecode interpreter. -*- c++ -*-
-/* Copyright (C) 1999, 2000 Free Software Foundation
+/* Copyright (C) 1999, 2000, 2001 Free Software Foundation
This file is part of libgcj.
@@ -33,14 +33,13 @@ _Jv_IsInterpretedClass (jclass c)
struct _Jv_ResolvedMethod;
-void _Jv_VerifyFieldSignature (_Jv_Utf8Const*sig);
-void _Jv_VerifyMethodSignature (_Jv_Utf8Const*sig);
-void _Jv_VerifyClassName (unsigned char* ptr, _Jv_ushort length);
-void _Jv_VerifyClassName (_Jv_Utf8Const *name);
-void _Jv_VerifyIdentifier (_Jv_Utf8Const *);
+bool _Jv_VerifyFieldSignature (_Jv_Utf8Const*sig);
+bool _Jv_VerifyMethodSignature (_Jv_Utf8Const*sig);
+bool _Jv_VerifyClassName (unsigned char* ptr, _Jv_ushort length);
+bool _Jv_VerifyClassName (_Jv_Utf8Const *name);
+bool _Jv_VerifyIdentifier (_Jv_Utf8Const *);
bool _Jv_ClassNameSamePackage (_Jv_Utf8Const *name1, _Jv_Utf8Const *name2);
void _Jv_DefineClass (jclass, jbyteArray, jint, jint);
-void _Jv_ResolveField (_Jv_Field *, java::lang::ClassLoader*);
void _Jv_InitField (jobject, jclass, int);
void * _Jv_AllocMethodInvocation (jsize size);
diff --git a/libjava/include/jni.h b/libjava/include/jni.h
index f25679afa69..832558a18f1 100644
--- a/libjava/include/jni.h
+++ b/libjava/include/jni.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998, 1999, 2000 Free Software Foundation
+/* Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation
This file is part of libgcj.
@@ -494,37 +494,37 @@ struct JNINativeInterface
void (*GetBooleanArrayRegion) (JNIEnv *, jbooleanArray,
jsize, jsize, jboolean *);
- void (*GetByteArrayRegion) (JNIEnv *, jbooleanArray,
- jsize, jsize, jboolean *);
- void (*GetCharArrayRegion) (JNIEnv *, jbooleanArray,
- jsize, jsize, jboolean *);
- void (*GetShortArrayRegion) (JNIEnv *, jbooleanArray,
- jsize, jsize, jboolean *);
- void (*GetIntArrayRegion) (JNIEnv *, jbooleanArray,
- jsize, jsize, jboolean *);
- void (*GetLongArrayRegion) (JNIEnv *, jbooleanArray,
- jsize, jsize, jboolean *);
- void (*GetFloatArrayRegion) (JNIEnv *, jbooleanArray,
- jsize, jsize, jboolean *);
- void (*GetDoubleArrayRegion) (JNIEnv *, jbooleanArray,
- jsize, jsize, jboolean *);
+ void (*GetByteArrayRegion) (JNIEnv *, jbyteArray,
+ jsize, jsize, jbyte *);
+ void (*GetCharArrayRegion) (JNIEnv *, jcharArray,
+ jsize, jsize, jchar *);
+ void (*GetShortArrayRegion) (JNIEnv *, jshortArray,
+ jsize, jsize, jshort *);
+ void (*GetIntArrayRegion) (JNIEnv *, jintArray,
+ jsize, jsize, jint *);
+ void (*GetLongArrayRegion) (JNIEnv *, jlongArray,
+ jsize, jsize, jlong *);
+ void (*GetFloatArrayRegion) (JNIEnv *, jfloatArray,
+ jsize, jsize, jfloat *);
+ void (*GetDoubleArrayRegion) (JNIEnv *, jdoubleArray,
+ jsize, jsize, jdouble *);
void (*SetBooleanArrayRegion) (JNIEnv *, jbooleanArray,
jsize, jsize, jboolean *);
- void (*SetByteArrayRegion) (JNIEnv *, jbooleanArray,
- jsize, jsize, jboolean *);
- void (*SetCharArrayRegion) (JNIEnv *, jbooleanArray,
- jsize, jsize, jboolean *);
- void (*SetShortArrayRegion) (JNIEnv *, jbooleanArray,
- jsize, jsize, jboolean *);
- void (*SetIntArrayRegion) (JNIEnv *, jbooleanArray,
- jsize, jsize, jboolean *);
- void (*SetLongArrayRegion) (JNIEnv *, jbooleanArray,
- jsize, jsize, jboolean *);
- void (*SetFloatArrayRegion) (JNIEnv *, jbooleanArray,
- jsize, jsize, jboolean *);
- void (*SetDoubleArrayRegion) (JNIEnv *, jbooleanArray,
- jsize, jsize, jboolean *);
+ void (*SetByteArrayRegion) (JNIEnv *, jbyteArray,
+ jsize, jsize, jbyte *);
+ void (*SetCharArrayRegion) (JNIEnv *, jcharArray,
+ jsize, jsize, jchar *);
+ void (*SetShortArrayRegion) (JNIEnv *, jshortArray,
+ jsize, jsize, jshort *);
+ void (*SetIntArrayRegion) (JNIEnv *, jintArray,
+ jsize, jsize, jint *);
+ void (*SetLongArrayRegion) (JNIEnv *, jlongArray,
+ jsize, jsize, jlong *);
+ void (*SetFloatArrayRegion) (JNIEnv *, jfloatArray,
+ jsize, jsize, jfloat *);
+ void (*SetDoubleArrayRegion) (JNIEnv *, jdoubleArray,
+ jsize, jsize, jdouble *);
jint (*RegisterNatives) (JNIEnv *, jclass,
const JNINativeMethod *, jint);
@@ -1343,49 +1343,49 @@ public:
void GetBooleanArrayRegion (jbooleanArray val0, jsize val1, jsize val2, jboolean * val3)
{ p->GetBooleanArrayRegion (this, val0, val1, val2, val3); }
- void GetByteArrayRegion (jbooleanArray val0, jsize val1, jsize val2, jboolean * val3)
+ void GetByteArrayRegion (jbyteArray val0, jsize val1, jsize val2, jbyte * val3)
{ p->GetByteArrayRegion (this, val0, val1, val2, val3); }
- void GetCharArrayRegion (jbooleanArray val0, jsize val1, jsize val2, jboolean * val3)
+ void GetCharArrayRegion (jcharArray val0, jsize val1, jsize val2, jchar * val3)
{ p->GetCharArrayRegion (this, val0, val1, val2, val3); }
- void GetShortArrayRegion (jbooleanArray val0, jsize val1, jsize val2, jboolean * val3)
+ void GetShortArrayRegion (jshortArray val0, jsize val1, jsize val2, jshort * val3)
{ p->GetShortArrayRegion (this, val0, val1, val2, val3); }
- void GetIntArrayRegion (jbooleanArray val0, jsize val1, jsize val2, jboolean * val3)
+ void GetIntArrayRegion (jintArray val0, jsize val1, jsize val2, jint * val3)
{ p->GetIntArrayRegion (this, val0, val1, val2, val3); }
- void GetLongArrayRegion (jbooleanArray val0, jsize val1, jsize val2, jboolean * val3)
+ void GetLongArrayRegion (jlongArray val0, jsize val1, jsize val2, jlong * val3)
{ p->GetLongArrayRegion (this, val0, val1, val2, val3); }
- void GetFloatArrayRegion (jbooleanArray val0, jsize val1, jsize val2, jboolean * val3)
+ void GetFloatArrayRegion (jfloatArray val0, jsize val1, jsize val2, jfloat * val3)
{ p->GetFloatArrayRegion (this, val0, val1, val2, val3); }
- void GetDoubleArrayRegion (jbooleanArray val0, jsize val1, jsize val2, jboolean * val3)
+ void GetDoubleArrayRegion (jdoubleArray val0, jsize val1, jsize val2, jdouble * val3)
{ p->GetDoubleArrayRegion (this, val0, val1, val2, val3); }
void SetBooleanArrayRegion (jbooleanArray val0, jsize val1, jsize val2, jboolean * val3)
{ p->SetBooleanArrayRegion (this, val0, val1, val2, val3); }
- void SetByteArrayRegion (jbooleanArray val0, jsize val1, jsize val2, jboolean * val3)
+ void SetByteArrayRegion (jbyteArray val0, jsize val1, jsize val2, jbyte * val3)
{ p->SetByteArrayRegion (this, val0, val1, val2, val3); }
- void SetCharArrayRegion (jbooleanArray val0, jsize val1, jsize val2, jboolean * val3)
+ void SetCharArrayRegion (jcharArray val0, jsize val1, jsize val2, jchar * val3)
{ p->SetCharArrayRegion (this, val0, val1, val2, val3); }
- void SetShortArrayRegion (jbooleanArray val0, jsize val1, jsize val2, jboolean * val3)
+ void SetShortArrayRegion (jshortArray val0, jsize val1, jsize val2, jshort * val3)
{ p->SetShortArrayRegion (this, val0, val1, val2, val3); }
- void SetIntArrayRegion (jbooleanArray val0, jsize val1, jsize val2, jboolean * val3)
+ void SetIntArrayRegion (jintArray val0, jsize val1, jsize val2, jint * val3)
{ p->SetIntArrayRegion (this, val0, val1, val2, val3); }
- void SetLongArrayRegion (jbooleanArray val0, jsize val1, jsize val2, jboolean * val3)
+ void SetLongArrayRegion (jlongArray val0, jsize val1, jsize val2, jlong * val3)
{ p->SetLongArrayRegion (this, val0, val1, val2, val3); }
- void SetFloatArrayRegion (jbooleanArray val0, jsize val1, jsize val2, jboolean * val3)
+ void SetFloatArrayRegion (jfloatArray val0, jsize val1, jsize val2, jfloat * val3)
{ p->SetFloatArrayRegion (this, val0, val1, val2, val3); }
- void SetDoubleArrayRegion (jbooleanArray val0, jsize val1, jsize val2, jboolean * val3)
+ void SetDoubleArrayRegion (jdoubleArray val0, jsize val1, jsize val2, jdouble * val3)
{ p->SetDoubleArrayRegion (this, val0, val1, val2, val3); }
jint RegisterNatives (jclass cl0, const JNINativeMethod * val1, jint val2)
diff --git a/libjava/include/jvm.h b/libjava/include/jvm.h
index 006f1d9adc4..6cc0120e56e 100644
--- a/libjava/include/jvm.h
+++ b/libjava/include/jvm.h
@@ -1,6 +1,6 @@
// jvm.h - Header file for private implementation information. -*- c++ -*-
-/* Copyright (C) 1998, 1999, 2000 Free Software Foundation
+/* Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation
This file is part of libgcj.
@@ -27,10 +27,35 @@ details. */
/* Structure of the virtual table. */
struct _Jv_VTable
{
+#ifdef __ia64__
jclass clas;
+ unsigned long : 64;
void *gc_descr;
- void *method[1];
- void *get_finalizer() { return method[0]; }
+ unsigned long : 64;
+
+ typedef struct { void *pc, *gp; } vtable_elt;
+#else
+ jclass clas;
+ void *gc_descr;
+
+ typedef void *vtable_elt;
+#endif
+
+ // This must be last, as derived classes "extend" this by
+ // adding new data members.
+ vtable_elt method[1];
+
+#ifdef __ia64__
+ void *get_method(int i) { return &method[i]; }
+ void set_method(int i, void *fptr) { method[i] = *(vtable_elt *)fptr; }
+#else
+ void *get_method(int i) { return method[i]; }
+ void set_method(int i, void *fptr) { method[i] = fptr; }
+#endif
+
+ void *get_finalizer() { return get_method(0); }
+ static size_t vtable_elt_size() { return sizeof(vtable_elt); }
+ static _Jv_VTable *new_vtable (int count);
};
// Number of virtual methods on object. FIXME: it sucks that we have
@@ -38,12 +63,9 @@ struct _Jv_VTable
#define NUM_OBJECT_METHODS 5
// This structure is the type of an array's vtable.
-struct _Jv_ArrayVTable
+struct _Jv_ArrayVTable : public _Jv_VTable
{
- jclass clas;
- void *gc_descr;
- void *method[NUM_OBJECT_METHODS];
- void *get_finalizer() { return method[0]; }
+ vtable_elt extra_method[NUM_OBJECT_METHODS - 1];
};
union _Jv_word
@@ -163,6 +185,18 @@ void *_Jv_AllocBytesChecked (jsize size) __attribute__((__malloc__));
extern "C" void JvRunMain (jclass klass, int argc, const char **argv);
void _Jv_RunMain (const char* name, int argc, const char **argv, bool is_jar);
+// Delayed until after _Jv_AllocBytes is declared.
+//
+// Note that we allocate this as unscanned memory -- the vtables
+// are handled specially by the GC.
+
+inline _Jv_VTable *
+_Jv_VTable::new_vtable (int count)
+{
+ size_t size = sizeof(_Jv_VTable) + (count - 1) * vtable_elt_size ();
+ return (_Jv_VTable *) _Jv_AllocBytes (size);
+}
+
// This function is used to determine the hash code of an object.
inline jint
_Jv_HashCode (jobject obj)
@@ -219,6 +253,7 @@ extern "C" void _Jv_CheckArrayStore (jobject array, jobject obj);
extern "C" void _Jv_RegisterClass (jclass klass);
extern "C" void _Jv_RegisterClasses (jclass *classes);
extern void _Jv_UnregisterClass (_Jv_Utf8Const*, java::lang::ClassLoader*);
+extern void _Jv_ResolveField (_Jv_Field *, java::lang::ClassLoader*);
extern jclass _Jv_FindClass (_Jv_Utf8Const *name,
java::lang::ClassLoader *loader);
diff --git a/libjava/include/posix-threads.h b/libjava/include/posix-threads.h
index 75285ca6f50..ca4bfa6ad4b 100644
--- a/libjava/include/posix-threads.h
+++ b/libjava/include/posix-threads.h
@@ -99,7 +99,7 @@ int _Jv_CondNotifyAll (_Jv_ConditionVariable_t *cv, _Jv_Mutex_t *mu);
inline void
_Jv_CondInit (_Jv_ConditionVariable_t *cv)
{
- cv->first = NULL;
+ cv->first = 0;
}
//
@@ -109,7 +109,7 @@ _Jv_CondInit (_Jv_ConditionVariable_t *cv)
inline void
_Jv_MutexInit (_Jv_Mutex_t *mu)
{
- pthread_mutex_init (&mu->mutex, NULL);
+ pthread_mutex_init (&mu->mutex, 0);
mu->count = 0;
mu->owner = 0;
diff --git a/libjava/include/posix.h b/libjava/include/posix.h
index 278f7eb773b..e7ba3174354 100644
--- a/libjava/include/posix.h
+++ b/libjava/include/posix.h
@@ -8,6 +8,11 @@ This software is copyrighted work licensed under the terms of the
Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
details. */
+/* Required on Tru64 UNIX V4/V5 so <sys/socket.h> defines prototypes of
+ socket functions with socklen_t instead of size_t. This must be defined
+ early so <standards.h> defines the correct version of __PIIX. */
+#define _POSIX_PII_SOCKET
+
#include <time.h>
#include <sys/types.h>
diff --git a/libjava/include/ppc-signal.h b/libjava/include/ppc-signal.h
deleted file mode 100644
index 003a7604533..00000000000
--- a/libjava/include/ppc-signal.h
+++ /dev/null
@@ -1,115 +0,0 @@
-// ppc-signal.h - Catch runtime signals and turn them into exceptions.
-
-/* Copyright (C) 2000 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. */
-
-#ifndef JAVA_SIGNAL_H
-#define JAVA_SIGNAL_H 1
-
-#include <signal.h>
-#include <ucontext.h>
-
-#define HANDLE_SEGV 1
-#undef HANDLE_FPE
-
-#define SIGNAL_HANDLER(_name) \
-__asm ("\t.section\t\".text\"\n" \
- "\t.align 2\n" \
- "_Jv_" #_name ":\n" \
- "\tmr 3, 1\n" \
- "\tb _Jv_stub_" #_name "\n"); \
-extern "C" void _Jv_##_name (int _dummy); \
-extern "C" void _Jv_stub_##_name (char *_sp) \
-
-class java::lang::Throwable;
-
-// Unwind the stack to the point at which the signal was generated and
-// then throw an exception.
-
-#define MAKE_THROW_FRAME(_exception) \
-do \
-{ \
- struct sigcontext_struct *_context \
- = (struct sigcontext_struct *)(_sp + __SIGNAL_FRAMESIZE); \
- long int regs [34]; \
- memcpy (regs, &_context->regs->gpr[0], 32 * sizeof (long int)); \
- regs[32] = _context->regs->nip + sizeof (long int); \
- regs[33] = _context->regs->link; \
- \
- __asm volatile ( \
- "\tmr 31,%0\n" \
- "\tmr 3,%1 # exception to throw\n" \
- "\tlwz 0,128(31) # ip\n" \
- "\tmtlr 0\n" \
- "\tlwz 1,4(31) # previous r1\n" \
- "\tlwz 0,132(31) # previous lr\n" \
- "\tlwz 2,0(1) # previous previous r1\n" \
- "\tstw 0,4(2) # save previous lr\n" \
- "\tlwz 0,0(31)\n" \
- "\tlwz 2,8(31)\n" \
- "\tlwz 4,16(31)\n" \
- "\tlwz 5,20(31)\n" \
- "\tlwz 6,24(31)\n" \
- "\tlwz 7,28(31)\n" \
- "\tlwz 8,32(31)\n" \
- "\tlwz 9,36(31)\n" \
- "\tlwz 10,40(31)\n" \
- "\tlwz 11,44(31)\n" \
- "\tlwz 12,48(31)\n" \
- "\tlwz 13,52(31)\n" \
- "\tlwz 14,56(31)\n" \
- "\tlwz 15,60(31)\n" \
- "\tlwz 16,64(31)\n" \
- "\tlwz 17,68(31)\n" \
- "\tlwz 18,72(31)\n" \
- "\tlwz 19,76(31)\n" \
- "\tlwz 20,80(31)\n" \
- "\tlwz 21,84(31)\n" \
- "\tlwz 22,88(31)\n" \
- "\tlwz 23,92(31)\n" \
- "\tlwz 24,96(31)\n" \
- "\tlwz 25,100(31)\n" \
- "\tlwz 26,104(31)\n" \
- "\tlwz 27,108(31)\n" \
- "\tlwz 28,112(31)\n" \
- "\tlwz 29,116(31)\n" \
- "\tlwz 30,120(31)\n" \
- "\tlwz 31,124(31)\n" \
- "\tb _Jv_ThrowSignal\n" \
- : : "r"(regs), "r"(_exception) \
- : "r31", "r3"); \
-} \
-while (0)
-
-
-#define INIT_SEGV \
-do \
- { \
- nullp = new java::lang::NullPointerException (); \
- struct sigaction act; \
- act.sa_handler = _Jv_catch_segv; \
- sigemptyset (&act.sa_mask); \
- act.sa_flags = 0; \
- __sigaction (SIGSEGV, &act, NULL); \
- } \
-while (0)
-
-#define INIT_FPE \
-do \
- { \
- arithexception = new java::lang::ArithmeticException \
- (JvNewStringLatin1 ("/ by zero")); \
- struct sigaction act; \
- act.sa_handler = _Jv_catch_fpe; \
- sigemptyset (&act.sa_mask); \
- act.sa_flags = 0; \
- __sigaction (SIGFPE, &act, NULL); \
- } \
-while (0)
-
-#endif /* JAVA_SIGNAL_H */
diff --git a/libjava/interpret.cc b/libjava/interpret.cc
index 0a069ac4e1c..a2ed2549d69 100644
--- a/libjava/interpret.cc
+++ b/libjava/interpret.cc
@@ -1,6 +1,6 @@
// interpret.cc - Code for the interpreter
-/* Copyright (C) 1999, 2000 Free Software Foundation
+/* Copyright (C) 1999, 2000, 2001 Free Software Foundation
This file is part of libgcj.
@@ -36,9 +36,6 @@ details. */
#ifdef INTERPRETER
#include <stdlib.h>
-#if HAVE_ALLOCA_H
-#include <alloca.h>
-#endif
static _Jv_Utf8Const *init_name = _Jv_makeUtf8Const ("<init>", 6);
@@ -336,11 +333,11 @@ void _Jv_InterpMethod::run_normal (ffi_cif* cif,
// "run" ro be inlined. Otherwise gcc will ignore the inline directive.
int storage_size = _this->max_stack+_this->max_locals;
_Jv_InterpMethodInvocation* inv = (_Jv_InterpMethodInvocation*)
- alloca (sizeof (_Jv_InterpMethodInvocation)
- + storage_size * sizeof (_Jv_word));
+ __builtin_alloca (sizeof (_Jv_InterpMethodInvocation)
+ + storage_size * sizeof (_Jv_word));
jobject ex = _this->run (cif, ret, args, inv);
- if (ex != 0) _Jv_Throw (ex);
+ if (ex != 0) _Jv_Throw ((jthrowable) ex);
}
void _Jv_InterpMethod::run_synch_object (ffi_cif* cif,
@@ -353,14 +350,14 @@ void _Jv_InterpMethod::run_synch_object (ffi_cif* cif,
int storage_size = _this->max_stack+_this->max_locals;
_Jv_InterpMethodInvocation* inv = (_Jv_InterpMethodInvocation*)
- alloca (sizeof (_Jv_InterpMethodInvocation)
- + storage_size * sizeof (_Jv_word));
+ __builtin_alloca (sizeof (_Jv_InterpMethodInvocation)
+ + storage_size * sizeof (_Jv_word));
_Jv_MonitorEnter (rcv);
jobject ex = _this->run (cif, ret, args, inv);
_Jv_MonitorExit (rcv);
- if (ex != 0) _Jv_Throw (ex);
+ if (ex != 0) _Jv_Throw ((jthrowable) ex);
}
void _Jv_InterpMethod::run_synch_class (ffi_cif* cif,
@@ -373,14 +370,14 @@ void _Jv_InterpMethod::run_synch_class (ffi_cif* cif,
int storage_size = _this->max_stack+_this->max_locals;
_Jv_InterpMethodInvocation* inv = (_Jv_InterpMethodInvocation*)
- alloca (sizeof (_Jv_InterpMethodInvocation)
- + storage_size * sizeof (_Jv_word));
+ __builtin_alloca (sizeof (_Jv_InterpMethodInvocation)
+ + storage_size * sizeof (_Jv_word));
_Jv_MonitorEnter (sync);
jobject ex = _this->run (cif, ret, args, inv);
_Jv_MonitorExit (sync);
- if (ex != 0) _Jv_Throw (ex);
+ if (ex != 0) _Jv_Throw ((jthrowable) ex);
}
/*
@@ -678,7 +675,11 @@ void _Jv_InterpMethod::continue1 (_Jv_InterpMethodInvocation *inv)
rmeth = (_Jv_ResolvePoolEntry (defining_class, index)).rmethod;
sp -= rmeth->stack_item_count;
- NULLCHECK (sp[0].o);
+ // We don't use NULLCHECK here because we can't rely on that
+ // working if the method is final. So instead we do an
+ // explicit test.
+ if (! sp[0].o)
+ throw new java::lang::NullPointerException ();
if (rmeth->vtable_index == -1)
{
@@ -690,7 +691,7 @@ void _Jv_InterpMethod::continue1 (_Jv_InterpMethodInvocation *inv)
{
jobject rcv = sp[0].o;
_Jv_VTable *table = *(_Jv_VTable**)rcv;
- fun = (void (*)()) table->method[rmeth->vtable_index];
+ fun = (void (*)()) table->get_method(rmeth->vtable_index);
}
}
goto perform_invoke;
@@ -2376,7 +2377,7 @@ void _Jv_InterpMethod::continue1 (_Jv_InterpMethodInvocation *inv)
jclass type
= (_Jv_ResolvePoolEntry (defining_class, kind_index)).clazz;
_Jv_InitClass (type);
- jint *sizes = (jint*) alloca (sizeof (jint)*dim);
+ jint *sizes = (jint*) __builtin_alloca (sizeof (jint)*dim);
for (int i = dim - 1; i >= 0; i--)
{
diff --git a/libjava/java/io/BlockDataException.java b/libjava/java/io/BlockDataException.java
deleted file mode 100644
index ef70f54c557..00000000000
--- a/libjava/java/io/BlockDataException.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/* BlockDataException.java -- Class used to store name and class of fields
- Copyright (C) 1998 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.
-
-As a special exception, if you link this library with other files to
-produce an executable, this library 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. */
-
-
-package java.io;
-
-//TODO: check 1.2 API to make sure this mathces
-
-class BlockDataException extends IOException
-{
- public BlockDataException( int bytes )
- {
- super( bytes + " bytes are available in the next data block" );
- }
-}
-
diff --git a/libjava/java/io/BufferedReader.java b/libjava/java/io/BufferedReader.java
index 9a293da5cd3..6c54f030349 100644
--- a/libjava/java/io/BufferedReader.java
+++ b/libjava/java/io/BufferedReader.java
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998, 1999, 2000 Free Software Foundation
+/* Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation
This file is part of libgcj.
@@ -128,9 +128,9 @@ public class BufferedReader extends Reader
*/
public void mark(int readLimit) throws IOException
{
- checkStatus();
synchronized (lock)
{
+ checkStatus();
// In this method we need to be aware of the special case where
// pos + 1 == limit. This indicates that a '\r' was the last char
// in the buffer during a readLine. We'll want to maintain that
@@ -185,9 +185,9 @@ public class BufferedReader extends Reader
*/
public void reset() throws IOException
{
- checkStatus();
synchronized (lock)
{
+ checkStatus();
if (markPos < 0)
throw new IOException("mark never set or invalidated");
@@ -215,9 +215,9 @@ public class BufferedReader extends Reader
*/
public boolean ready() throws IOException
{
- checkStatus();
synchronized (lock)
{
+ checkStatus();
return pos < limit || in.ready();
}
}
@@ -242,9 +242,9 @@ public class BufferedReader extends Reader
*/
public int read(char[] buf, int offset, int count) throws IOException
{
- checkStatus();
synchronized (lock)
{
+ checkStatus();
// Once again, we need to handle the special case of a readLine
// that has a '\r' at the end of the buffer. In this case, we'll
// need to skip a '\n' if it is the next char to be read.
@@ -329,9 +329,9 @@ public class BufferedReader extends Reader
public int read() throws IOException
{
- checkStatus();
synchronized (lock)
{
+ checkStatus();
if (pos >= limit && fill () <= 0)
return -1;
return buffer[pos++];
@@ -444,11 +444,11 @@ public class BufferedReader extends Reader
*/
public long skip(long count) throws IOException
{
- checkStatus();
- if (count <= 0)
- return 0;
synchronized (lock)
{
+ checkStatus();
+ if (count <= 0)
+ return 0;
// Yet again, we need to handle the special case of a readLine
// that has a '\r' at the end of the buffer. In this case, we need
// to ignore a '\n' if it is the next char to be read.
diff --git a/libjava/java/io/BufferedWriter.java b/libjava/java/io/BufferedWriter.java
index f31dc28a0d2..e99586121db 100644
--- a/libjava/java/io/BufferedWriter.java
+++ b/libjava/java/io/BufferedWriter.java
@@ -1,12 +1,29 @@
-// BufferedWriter.java - Filtered character output stream.
+/* BufferedWriter.java -- Buffer output into large blocks before writing
+ Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
-/* Copyright (C) 1998, 1999, 2000 Free Software Foundation
+This file is part of GNU Classpath.
- This file is part of libgcj.
+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.
+
+As a special exception, if you link this library with other files to
+produce an executable, this library 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. */
-This software is copyrighted work licensed under the terms of the
-Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
-details. */
package java.io;
@@ -67,8 +84,14 @@ public class BufferedWriter extends Writer
*/
public void close () throws IOException
{
- localFlush ();
- out.close();
+ synchronized (lock)
+ {
+ // It is safe to call localFlush even if the stream is already
+ // closed.
+ localFlush ();
+ out.close();
+ buffer = null;
+ }
}
/**
@@ -79,8 +102,13 @@ public class BufferedWriter extends Writer
*/
public void flush () throws IOException
{
- localFlush ();
- out.flush();
+ synchronized (lock)
+ {
+ if (buffer == null)
+ throw new IOException ("Stream closed");
+ localFlush ();
+ out.flush();
+ }
}
/**
@@ -109,6 +137,8 @@ public class BufferedWriter extends Writer
{
synchronized (lock)
{
+ if (buffer == null)
+ throw new IOException ("Stream closed");
buffer[count++] = (char) oneChar;
if (count == buffer.length)
localFlush ();
@@ -135,6 +165,9 @@ public class BufferedWriter extends Writer
synchronized (lock)
{
+ if (buffer == null)
+ throw new IOException ("Stream closed");
+
// Bypass buffering if there is too much incoming data.
if (count + len > buffer.length)
{
@@ -171,6 +204,9 @@ public class BufferedWriter extends Writer
synchronized (lock)
{
+ if (buffer == null)
+ throw new IOException ("Stream closed");
+
if (count + len > buffer.length)
{
localFlush ();
diff --git a/libjava/java/io/ByteArrayInputStream.java b/libjava/java/io/ByteArrayInputStream.java
index 30ba8d7f9da..0d9339363c1 100644
--- a/libjava/java/io/ByteArrayInputStream.java
+++ b/libjava/java/io/ByteArrayInputStream.java
@@ -40,6 +40,9 @@ public class ByteArrayInputStream extends InputStream
public ByteArrayInputStream(byte[] buffer, int offset, int length)
{
+ if (offset < 0 || length < 0 || offset > buffer.length)
+ throw new IllegalArgumentException();
+
buf = buffer;
count = offset + length;
@@ -47,10 +50,6 @@ public class ByteArrayInputStream extends InputStream
count = buf.length;
pos = offset;
- // TBD: What should we do if pos is neg. or > count? E.g. throw exc. or:
- // if (pos < 0 || pos > count)
- // pos = 0;
-
mark = pos;
}
diff --git a/libjava/java/io/CharArrayReader.java b/libjava/java/io/CharArrayReader.java
index 195403684c2..d67c7c79f5c 100644
--- a/libjava/java/io/CharArrayReader.java
+++ b/libjava/java/io/CharArrayReader.java
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998, 1999 Free Software Foundation
+/* Copyright (C) 1998, 1999, 2001 Free Software Foundation
This file is part of libgcj.
@@ -41,17 +41,16 @@ public class CharArrayReader extends Reader
public CharArrayReader(char[] buffer, int offset, int length)
{
super();
+ if (offset < 0 || length < 0 || offset > buffer.length)
+ throw new IllegalArgumentException();
+
buf = buffer;
count = offset + length;
if (count > buf.length)
count = buf.length;
-
+
pos = offset;
- // TBD: What should we do if pos is neg. or > count? E.g. throw exc. or:
- // if (pos < 0 || pos > count)
- // pos = 0;
-
markedPos = pos;
}
@@ -63,10 +62,12 @@ public class CharArrayReader extends Reader
}
}
- public void mark(int readAheadLimit)
+ public void mark(int readAheadLimit) throws IOException
{
synchronized (lock)
{
+ if (buf == null)
+ throw new IOException("Stream closed");
// readAheadLimit is ignored per Java Class Lib. book, p. 318.
markedPos = pos;
}
@@ -82,7 +83,7 @@ public class CharArrayReader extends Reader
synchronized (lock)
{
if (buf == null)
- throw new IOException();
+ throw new IOException("Stream closed");
if (pos < 0)
throw new ArrayIndexOutOfBoundsException(pos);
@@ -98,7 +99,7 @@ public class CharArrayReader extends Reader
synchronized (lock)
{
if (buf == null)
- throw new IOException();
+ throw new IOException("Stream closed");
/* Don't need to check pos value, arraycopy will check it. */
if (off < 0 || len < 0 || off + len > b.length)
@@ -114,12 +115,17 @@ public class CharArrayReader extends Reader
}
}
+ /** Return true if more characters are available to be read.
+ *
+ * @specnote The JDK 1.3 API docs are wrong here. This method will
+ * return false if there are no more characters available.
+ */
public boolean ready() throws IOException
{
if (buf == null)
- throw new IOException();
+ throw new IOException("Stream closed");
- return true;
+ return (pos < count);
}
public void reset() throws IOException
@@ -127,7 +133,7 @@ public class CharArrayReader extends Reader
synchronized (lock)
{
if (buf == null)
- throw new IOException();
+ throw new IOException("Stream closed");
pos = markedPos;
}
@@ -138,7 +144,7 @@ public class CharArrayReader extends Reader
synchronized (lock)
{
if (buf == null)
- throw new IOException();
+ throw new IOException("Stream closed");
// Even though the var numChars is a long, in reality it can never
// be larger than an int since the result of subtracting 2 positive
diff --git a/libjava/java/io/CharArrayWriter.java b/libjava/java/io/CharArrayWriter.java
index 5e04d6171b1..7bec5558a01 100644
--- a/libjava/java/io/CharArrayWriter.java
+++ b/libjava/java/io/CharArrayWriter.java
@@ -1,6 +1,6 @@
// CharArrayWriter.java - Character array output stream.
-/* Copyright (C) 1998, 1999 Free Software Foundation
+/* Copyright (C) 1998, 1999, 2001 Free Software Foundation
This file is part of libgcj.
@@ -35,18 +35,27 @@ public class CharArrayWriter extends Writer
public void close ()
{
- // JCL says this does nothing. This seems to violate the Writer
- // contract, in that other methods should still throw and
- // IOException after a close. Still, we just follow JCL.
+ closed = true;
}
- public void flush ()
+ public void flush () throws IOException
{
+ synchronized (lock)
+ {
+ if (closed)
+ throw new IOException ("Stream closed");
+ }
}
- public synchronized void reset ()
+ public void reset ()
{
- count = 0;
+ synchronized (lock)
+ {
+ count = 0;
+ // Allow this to reopen the stream.
+ // FIXME - what does the JDK do?
+ closed = false;
+ }
}
public int size ()
@@ -56,29 +65,41 @@ public class CharArrayWriter extends Writer
public char[] toCharArray ()
{
- char[] nc = new char[count];
- System.arraycopy(buf, 0, nc, 0, count);
- return nc;
+ synchronized (lock)
+ {
+ char[] nc = new char[count];
+ System.arraycopy(buf, 0, nc, 0, count);
+ return nc;
+ }
}
public String toString ()
{
- return new String (buf, 0, count);
+ synchronized (lock)
+ {
+ return new String (buf, 0, count);
+ }
}
- public void write (int oneChar)
+ public void write (int oneChar) throws IOException
{
synchronized (lock)
{
+ if (closed)
+ throw new IOException ("Stream closed");
+
resize (1);
buf[count++] = (char) oneChar;
}
}
- public void write (char[] buffer, int offset, int len)
+ public void write (char[] buffer, int offset, int len) throws IOException
{
synchronized (lock)
{
+ if (closed)
+ throw new IOException ("Stream closed");
+
if (len >= 0)
resize (len);
System.arraycopy(buffer, offset, buf, count, len);
@@ -86,10 +107,13 @@ public class CharArrayWriter extends Writer
}
}
- public void write (String str, int offset, int len)
+ public void write (String str, int offset, int len) throws IOException
{
synchronized (lock)
{
+ if (closed)
+ throw new IOException ("Stream closed");
+
if (len >= 0)
resize (len);
str.getChars(offset, offset + len, buf, count);
@@ -99,7 +123,10 @@ public class CharArrayWriter extends Writer
public void writeTo (Writer out) throws IOException
{
- out.write(buf, 0, count);
+ synchronized (lock)
+ {
+ out.write(buf, 0, count);
+ }
}
private final void resize (int len)
@@ -119,4 +146,6 @@ public class CharArrayWriter extends Writer
protected char[] buf;
// Number of valid characters in buffer.
protected int count;
+ // True if stream is closed.
+ private boolean closed;
}
diff --git a/libjava/java/io/File.java b/libjava/java/io/File.java
index 5962641760d..25b6fcd674d 100644
--- a/libjava/java/io/File.java
+++ b/libjava/java/io/File.java
@@ -1,6 +1,6 @@
// File.java - File name
-/* Copyright (C) 1998, 1999, 2000 Free Software Foundation
+/* Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation
This file is part of libgcj.
@@ -21,42 +21,40 @@ import gnu.gcj.runtime.FileDeleter;
/* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3
* "The Java Language Specification", ISBN 0-201-63451-1
- * Status: Complete to version 1.1; 1.2 functionality missing.
- * A known bug: most calls to the security manager can generate
- * IOException since we use the canonical path.
+ * Status: Complete to version 1.3.
*/
-public class File implements Serializable
+public class File implements Serializable, Comparable
{
public boolean canRead ()
{
- return access (checkRead (), READ);
+ checkRead();
+ return _access (READ);
}
public boolean canWrite ()
{
- SecurityManager s = System.getSecurityManager();
- String p = safeCanonicalPath ();
- // FIXME: it isn't entirely clear what to do if we can't find the
- // canonical path.
- if (p == null)
- return false;
- if (s != null)
- s.checkWrite(p);
- return access (p, WRITE);
+ checkWrite();
+ return _access (WRITE);
}
+
+ private native boolean performCreate() throws IOException;
- private final native static boolean performDelete (String canon);
+ /** @since 1.2 */
+ public boolean createNewFile() throws IOException
+ {
+ checkWrite();
+ return performCreate();
+ }
+
+ private native boolean performDelete ();
public boolean delete ()
{
SecurityManager s = System.getSecurityManager();
- String p = safeCanonicalPath ();
- // FIXME: what is right?
- if (p == null)
- return false;
+ String name = path;
if (s != null)
- s.checkDelete(p);
- return performDelete (p);
+ s.checkDelete(path);
+ return performDelete ();
}
public boolean equals (Object obj)
@@ -64,21 +62,70 @@ public class File implements Serializable
if (! (obj instanceof File))
return false;
File other = (File) obj;
- return path.compareTo(other.path) == 0;
+ if (caseSensitive)
+ return (path.equals(other.path));
+ else
+ return (path.equalsIgnoreCase(other.path));
}
public boolean exists ()
{
- return access (checkRead (), EXISTS);
+ checkRead();
+ return _access (EXISTS);
}
public File (String p)
{
- if (p == null)
- throw new NullPointerException ();
- path = p;
+ path = normalizePath(p);
}
+ // Remove duplicate and redundant separator characters.
+ private String normalizePath(String p)
+ {
+ int dupIndex = p.indexOf(dupSeparator);
+ int plen = p.length();
+
+ // Special case: permit Windows UNC path prefix.
+ if (dupSeparator == "\\" && dupIndex == 0)
+ dupIndex = p.indexOf(dupSeparator, 1);
+
+ if (dupIndex == -1)
+ {
+ // Ignore trailing separator.
+ if (plen > 1 && p.charAt(plen - 1) == separatorChar)
+ return p.substring(0, plen - 1);
+ else
+ return p;
+ }
+
+ StringBuffer newpath = new StringBuffer(plen);
+ int last = 0;
+ while (dupIndex != -1)
+ {
+ newpath.append(p.substring(last, dupIndex));
+ // Ignore the duplicate path characters.
+ while (p.charAt(dupIndex) == separatorChar)
+ {
+ dupIndex++;
+ if (dupIndex == plen)
+ return newpath.toString();
+ }
+ newpath.append(separatorChar);
+ last = dupIndex;
+ dupIndex = p.indexOf(dupSeparator, last);
+ }
+
+ // Again, ignore possible trailing separator.
+ int end;
+ if (plen > 1 && p.charAt(plen - 1) == separatorChar)
+ end = plen - 1;
+ else
+ end = plen;
+ newpath.append(p.substring(last, end));
+
+ return newpath.toString();
+ }
+
public File (String dirPath, String name)
{
if (name == null)
@@ -86,13 +133,14 @@ public class File implements Serializable
if (dirPath != null && dirPath.length() > 0)
{
// Try to be smart about the number of separator characters.
- if (dirPath.charAt(dirPath.length() - 1) == separatorChar)
- path = dirPath + name;
+ if (dirPath.charAt(dirPath.length() - 1) == separatorChar
+ || name.length() == 0)
+ path = normalizePath(dirPath + name);
else
- path = dirPath + separatorChar + name;
+ path = normalizePath(dirPath + separatorChar + name);
}
else
- path = name;
+ path = normalizePath(name);
}
public File (File dir, String name)
@@ -100,6 +148,7 @@ public class File implements Serializable
this (dir == null ? null : dir.path, name);
}
+ // FIXME ???
public String getAbsolutePath ()
{
if (isAbsolute ())
@@ -107,6 +156,7 @@ public class File implements Serializable
return System.getProperty("user.dir") + separatorChar + path;
}
+ /** @since 1.2 */
public File getAbsoluteFile () throws IOException
{
return new File (getAbsolutePath());
@@ -114,6 +164,7 @@ public class File implements Serializable
public native String getCanonicalPath () throws IOException;
+ /** @since 1.2 */
public File getCanonicalFile () throws IOException
{
return new File (getCanonicalPath());
@@ -133,6 +184,7 @@ public class File implements Serializable
return path.substring(0, last);
}
+ /** @since 1.2 */
public File getParentFile ()
{
String parent = getParent ();
@@ -146,42 +198,80 @@ public class File implements Serializable
public int hashCode ()
{
- // FIXME: test.
- return path.hashCode();
+ if (caseSensitive)
+ return (path.hashCode() ^ 1234321);
+ else
+ return (path.toLowerCase().hashCode() ^ 1234321);
}
public native boolean isAbsolute ();
public boolean isDirectory ()
{
- return stat (checkRead (), DIRECTORY);
+ checkRead();
+ return _stat (DIRECTORY);
}
public boolean isFile ()
{
- return stat (checkRead (), ISFILE);
+ checkRead();
+ return _stat (ISFILE);
+ }
+
+ /** @since 1.2 */
+ public boolean isHidden()
+ {
+ checkRead();
+ return _stat (ISHIDDEN);
}
public long lastModified ()
{
- return attr (checkRead (), MODIFIED);
+ checkRead();
+ return attr (MODIFIED);
}
public long length ()
{
- return attr (checkRead (), LENGTH);
+ checkRead();
+ return attr (LENGTH);
}
+
+ private final native Object[] performList (FilenameFilter filter,
+ FileFilter fileFilter,
+ Class result_type);
- private final native String[] performList (String canon,
- FilenameFilter filter);
public String[] list (FilenameFilter filter)
{
- return performList (checkRead (), filter);
+ checkRead();
+ return (String[]) performList (filter, null, String.class);
}
public String[] list ()
{
- return performList (checkRead (), null);
+ checkRead();
+ return (String[]) performList (null, null, String.class);
+ }
+
+ /** @since 1.2 */
+ public File[] listFiles()
+ {
+ checkRead();
+ return (File[]) performList (null, null, File.class);
+ }
+
+ /** @since 1.2 */
+ public File[] listFiles(FilenameFilter filter)
+ {
+ checkRead();
+ return (File[]) performList (filter, null, File.class);
+ }
+
+ /** @since 1.2 */
+ public File[] listFiles(FileFilter filter)
+ {
+ checkRead();
+ return (File[]) performList (null, filter, File.class);
}
public String toString ()
@@ -195,16 +285,10 @@ public class File implements Serializable
}
private final native boolean performMkdir ();
+
public boolean mkdir ()
{
- SecurityManager s = System.getSecurityManager();
- if (s != null)
- {
- // NOTE: in theory we should use the canonical path. In
- // practice, we can't compute the canonical path until we've
- // made this completely. Lame.
- s.checkWrite(path);
- }
+ checkWrite();
return performMkdir ();
}
@@ -216,25 +300,17 @@ public class File implements Serializable
String parent = x.getParent();
if (parent != null)
{
- x.setPath(parent);
+ x.path = parent;
if (! mkdirs (x))
return false;
- x.setPath(p);
+ x.path = p;
}
return x.mkdir();
}
public boolean mkdirs ()
{
- SecurityManager s = System.getSecurityManager();
- if (s != null)
- {
- // NOTE: in theory we should use the canonical path. In
- // practice, we can't compute the canonical path until we've
- // made this completely. Lame.
- s.checkWrite(path);
- }
-
+ checkWrite();
if (isDirectory ())
return false;
return mkdirs (new File (path));
@@ -245,6 +321,7 @@ public class File implements Serializable
return Long.toString(counter++, Character.MAX_RADIX);
}
+ /** @since 1.2 */
public static File createTempFile (String prefix, String suffix,
File directory)
throws IOException
@@ -272,19 +349,16 @@ public class File implements Serializable
if (suffix == null)
suffix = ".tmp";
- // FIXME: filename length varies by architecture and filesystem.
- int max_length = 255;
-
// Truncation rules.
// `6' is the number of characters we generate.
- if (prefix.length () + 6 + suffix.length () > max_length)
+ if (prefix.length () + 6 + suffix.length () > maxPathLen)
{
int suf_len = 0;
if (suffix.charAt(0) == '.')
suf_len = 4;
suffix = suffix.substring(0, suf_len);
- if (prefix.length () + 6 + suf_len > max_length)
- prefix = prefix.substring(0, max_length - 6 - suf_len);
+ if (prefix.length () + 6 + suf_len > maxPathLen)
+ prefix = prefix.substring(0, maxPathLen - 6 - suf_len);
}
File f;
@@ -298,27 +372,10 @@ public class File implements Serializable
try
{
f = new File(directory, l);
- if (f.exists())
- continue;
- else
- {
- String af = f.getAbsolutePath ();
-
- // Check to see if we're allowed to write to it.
- SecurityManager s = System.getSecurityManager();
- if (s != null)
- s.checkWrite (af);
-
- // Now create the file.
- FileDescriptor fd =
- new FileDescriptor (af,
- FileDescriptor.WRITE
- | FileDescriptor.EXCL);
- fd.close ();
- return f;
- }
+ if (f.createNewFile())
+ return f;
}
- catch (IOException _)
+ catch (IOException ignored)
{
}
}
@@ -326,32 +383,118 @@ public class File implements Serializable
throw new IOException ("cannot create temporary file");
}
+ private native boolean performSetReadOnly();
+
+ /** @since 1.2 */
+ public boolean setReadOnly()
+ {
+ checkWrite();
+ return performSetReadOnly();
+ }
+
+ private static native File[] performListRoots();
+
+ /** @since 1.2 */
+ public static File[] listRoots()
+ {
+ File[] roots = performListRoots();
+
+ SecurityManager s = System.getSecurityManager();
+ if (s != null)
+ {
+ // Only return roots to which the security manager permits read access.
+ int count = roots.length;
+ for (int i = 0; i < roots.length; i++)
+ {
+ try
+ {
+ s.checkRead(roots[i].path);
+ }
+ catch (SecurityException sx)
+ {
+ roots[i] = null;
+ count--;
+ }
+ }
+ if (count != roots.length)
+ {
+ File[] newRoots = new File[count];
+ int k = 0;
+ for (int i=0; i < roots.length; i++)
+ {
+ if (roots[i] != null)
+ newRoots[k++] = roots[i];
+ }
+ roots = newRoots;
+ }
+ }
+ return roots;
+ }
+
public static File createTempFile (String prefix, String suffix)
throws IOException
{
return createTempFile (prefix, suffix, null);
}
- private final native boolean performRenameTo (File dest);
+ /** @since 1.2 */
+ public int compareTo(File other)
+ {
+ if (caseSensitive)
+ return path.compareTo (other.path);
+ else
+ return path.compareToIgnoreCase (other.path);
+ }
+
+ /** @since 1.2 */
+ public int compareTo(Object o)
+ {
+ File other = (File) o;
+ return compareTo (other);
+ }
+
+ private native boolean performRenameTo (File dest);
public boolean renameTo (File dest)
{
SecurityManager s = System.getSecurityManager();
+ String sname = getName();
+ String dname = dest.getName();
if (s != null)
{
- // FIXME: JCL doesn't specify which path to check. We check the
- // source since we can canonicalize it.
- s.checkWrite(safeCanonicalPath());
+ s.checkWrite(sname);
+ s.checkWrite(dname);
}
return performRenameTo (dest);
}
+ private native boolean performSetLastModified(long time);
+
+ /** @since 1.2 */
+ public boolean setLastModified(long time)
+ {
+ checkWrite();
+ return performSetLastModified(time);
+ }
+
public static final String pathSeparator
= System.getProperty("path.separator");
public static final char pathSeparatorChar = pathSeparator.charAt(0);
public static final String separator = System.getProperty("file.separator");
public static final char separatorChar = separator.charAt(0);
- private static final String tmpdir = System.getProperty("java.io.tmpdir");
+ static final String tmpdir = System.getProperty("java.io.tmpdir");
+ static int maxPathLen;
+ static boolean caseSensitive;
+ static String dupSeparator = separator + separator;
+
+ static
+ {
+ init_native();
+ }
+
+ // Native function called at class initialization. This should should
+ // set the maxPathLen and caseSensitive variables.
+ private static native void init_native();
// The path.
private String path;
@@ -360,41 +503,27 @@ public class File implements Serializable
// value randomly to try to avoid clashes with other VMs.
private static long counter = Double.doubleToLongBits (Math.random ());
- // mkdirs() uses this to avoid repeated allocations.
- private final void setPath (String n)
- {
- path = n;
- }
-
-
- private final String checkRead ()
+ private void checkWrite ()
{
SecurityManager s = System.getSecurityManager();
- String p = safeCanonicalPath ();
- if (p == null)
- return null;
if (s != null)
- s.checkRead(p);
- return p;
+ s.checkWrite(path);
}
- // Return canonical path, or null.
- private final String safeCanonicalPath ()
+ private void checkRead ()
{
- String p = null;
- try
- {
- p = getCanonicalPath ();
- }
- catch (IOException x)
- {
- // Nothing.
- }
- return p;
+ SecurityManager s = System.getSecurityManager();
+ if (s != null)
+ s.checkRead(path);
}
- // Add this File to the set of files to be deleted upon normal
- // termination.
+ /**
+ * Add this File to the set of files to be deleted upon normal
+ * termination.
+ *
+ * @since 1.2
+ */
+ // FIXME: This should use the ShutdownHook API once we implement that.
public void deleteOnExit ()
{
SecurityManager sm = System.getSecurityManager ();
@@ -430,14 +559,18 @@ public class File implements Serializable
// QUERY arguments to stat function.
private final static int DIRECTORY = 0;
private final static int ISFILE = 1;
+ private final static int ISHIDDEN = 2;
// QUERY arguments to attr function.
private final static int MODIFIED = 0;
private final static int LENGTH = 1;
-
- private final native long attr (String p, int query);
- private final native boolean access (String p, int query);
- private final native boolean stat (String p, int query);
+
+ private final native long attr (int query);
+ // On OSF1 V5.0, `stat' is a macro. It is easiest to use the name
+ // `_stat' instead. We do the same thing for `_access' just in
+ // case.
+ private final native boolean _access (int query);
+ private final native boolean _stat (int query);
private static final long serialVersionUID = 301077366599181567L;
}
diff --git a/libjava/java/io/FilterReader.java b/libjava/java/io/FilterReader.java
index bce70cc6eda..608f910ccbd 100644
--- a/libjava/java/io/FilterReader.java
+++ b/libjava/java/io/FilterReader.java
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998, 1999 Free Software Foundation
+/* Copyright (C) 1998, 1999, 2001 Free Software Foundation
This file is part of libgcj.
@@ -31,8 +31,11 @@ public abstract class FilterReader extends Reader
public void close() throws IOException
{
+ // We used to set `in = null' here. We don't, though, because
+ // that is the simplest way to ensure that read-after-close will
+ // throw the appropriate exception -- we rely on the filtered
+ // stream to do it.
in.close();
- in = null;
}
public synchronized void mark(int readlimit) throws IOException
diff --git a/libjava/java/io/InvalidClassException.java b/libjava/java/io/InvalidClassException.java
index fd03154a1f6..1b50bec44f5 100644
--- a/libjava/java/io/InvalidClassException.java
+++ b/libjava/java/io/InvalidClassException.java
@@ -44,67 +44,44 @@ package java.io;
*/
public class InvalidClassException extends ObjectStreamException
{
-
-/*
- * Instance Variables
- */
-
-/**
- * The name of the class which encountered the error.
- */
-public String classname;
-
-/*************************************************************************/
-
-/*
- * Constructors
- */
-
-/**
- * Create a new InvalidClassException with a descriptive error message String
- *
- * @param message The descriptive error message
- */
-public
-InvalidClassException(String message)
-{
- super(message);
-}
-
-/*************************************************************************/
-
-/**
- * Create a new InvalidClassException with a descriptive error message
- * String, and the name of the class that caused the problem.
- *
- * @param classname The number of bytes tranferred before the interruption
- * @param message The descriptive error message
- */
-public
-InvalidClassException(String classname, String message)
-{
- super(message);
- this.classname = classname;
+ /**
+ * The name of the class which encountered the error.
+ */
+ public String classname;
+
+ /**
+ * Create a new InvalidClassException with a descriptive error message String
+ *
+ * @param message The descriptive error message
+ */
+ public InvalidClassException(String message)
+ {
+ super(message);
+ }
+
+ /**
+ * Create a new InvalidClassException with a descriptive error message
+ * String, and the name of the class that caused the problem.
+ *
+ * @param classname The number of bytes tranferred before the interruption
+ * @param message The descriptive error message
+ */
+ public InvalidClassException(String classname, String message)
+ {
+ super(message);
+ this.classname = classname;
+ }
+
+ /**
+ * Returns the descriptive error message for this exception. It will
+ * include the class name that caused the problem if known. This method
+ * overrides Throwable.getMessage()
+ *
+ * @return A descriptive error message
+ */
+ public String getMessage()
+ {
+ return super.getMessage() + (classname == null ? "" : ": " + classname);
+ }
}
-/*************************************************************************/
-
-/*
- * Instance Methods
- */
-
-/**
- * Returns the descriptive error message for this exception. It will
- * include the class name that caused the problem if known. This method
- * overrides Throwable.getMessage()
- *
- * @return A descriptive error message
- */
-public String
-getMessage()
-{
- return(super.getMessage() + ": " + classname);
-}
-
-} // class InvalidClassException
-
diff --git a/libjava/java/io/ObjectInputStream.java b/libjava/java/io/ObjectInputStream.java
index 9c10d58388d..e607975aacb 100644
--- a/libjava/java/io/ObjectInputStream.java
+++ b/libjava/java/io/ObjectInputStream.java
@@ -135,7 +135,7 @@ public class ObjectInputStream extends InputStream
else
dumpElementln ("BLOCKDATA");
readNextBlock (marker);
- throw new BlockDataException (this.blockDataBytes);
+ throw new StreamCorruptedException ("Unexpected blockData");
case TC_NULL:
dumpElementln ("NULL");
@@ -199,8 +199,8 @@ public class ObjectInputStream extends InputStream
(class_name));
}
- setBlockDataMode (true);
- osc.setClass (resolveClass (osc));
+ Class cl = resolveClass (osc);
+ osc.setClass (cl);
setBlockDataMode (false);
if (this.realInputStream.readByte () != TC_ENDBLOCKDATA)
@@ -487,28 +487,16 @@ public class ObjectInputStream extends InputStream
protected Class resolveClass (ObjectStreamClass osc)
throws ClassNotFoundException, IOException
{
-// DEBUGln ("Resolving " + osc);
-
SecurityManager sm = System.getSecurityManager ();
- if (sm == null)
- sm = new SecurityManager () {};
-
+ // FIXME: currentClassLoader doesn't yet do anything useful. We need
+ // to call forName() with the classloader of the class which called
+ // readObject(). See SecurityManager.getClassContext().
ClassLoader cl = currentClassLoader (sm);
- if (cl == null)
- {
-// DEBUGln ("No class loader found");
- return Class.forName (osc.getName ());
- }
- else
- {
-// DEBUGln ("Using " + cl);
- return cl.loadClass (osc.getName ());
- }
+ return Class.forName (osc.getName (), true, cl);
}
-
/**
Allows subclasses to resolve objects that are read from the
stream with other objects to be returned in their place. This
diff --git a/libjava/java/io/ObjectStreamClass.java b/libjava/java/io/ObjectStreamClass.java
index d7306f81b74..193032981ef 100644
--- a/libjava/java/io/ObjectStreamClass.java
+++ b/libjava/java/io/ObjectStreamClass.java
@@ -246,13 +246,27 @@ public class ObjectStreamClass implements Serializable
this.fields = fields;
}
-
- void setClass (Class clazz)
+ void setClass (Class cl) throws InvalidClassException
{
- this.clazz = clazz;
+ this.clazz = cl;
+ long class_uid = getClassUID (cl);
+ if (uid == 0)
+ {
+ uid = class_uid;
+ return;
+ }
+
+ // Check that the actual UID of the resolved class matches the UID from
+ // the stream.
+ if (uid != class_uid)
+ {
+ String msg = cl +
+ ": Local class not compatible: stream serialVersionUID="
+ + uid + ", local serialVersionUID=" + class_uid;
+ throw new InvalidClassException (msg);
+ }
}
-
void setSuperclass (ObjectStreamClass osc)
{
superClass = osc;
@@ -308,7 +322,7 @@ public class ObjectStreamClass implements Serializable
name = cl.getName ();
setFlags (cl);
setFields (cl);
- setUID (cl);
+ uid = getClassUID (cl);
superClass = lookup (cl.getSuperclass ());
}
@@ -396,24 +410,24 @@ public class ObjectStreamClass implements Serializable
calculateOffsets ();
}
- // Sets uid to be serial version UID defined by class, or if that
+ // Returns the serial version UID defined by class, or if that
// isn't present, calculates value of serial version UID.
- private void setUID (Class cl)
+ private long getClassUID (Class cl)
{
try
{
Field suid = cl.getDeclaredField ("serialVersionUID");
int modifiers = suid.getModifiers ();
- if (Modifier.isStatic (modifiers)
- && Modifier.isFinal (modifiers))
- {
- uid = getDefinedSUID (cl);
- return;
- }
+ if (Modifier.isStatic (modifiers) && Modifier.isFinal (modifiers))
+ return suid.getLong (null);
}
catch (NoSuchFieldException ignore)
- {}
+ {
+ }
+ catch (IllegalAccessException ignore)
+ {
+ }
// cl didn't define serialVersionUID, so we have to compute it
try
@@ -444,11 +458,15 @@ public class ObjectStreamClass implements Serializable
| Modifier.INTERFACE | Modifier.PUBLIC);
data_out.writeInt (modifiers);
- Class[] interfaces = cl.getInterfaces ();
- Arrays.sort (interfaces, interfaceComparator);
- for (int i=0; i < interfaces.length; i++)
- data_out.writeUTF (interfaces[i].getName ());
-
+ // Pretend that an array has no interfaces, because when array
+ // serialization was defined (JDK 1.1), arrays didn't have it.
+ if (! cl.isArray ())
+ {
+ Class[] interfaces = cl.getInterfaces ();
+ Arrays.sort (interfaces, interfaceComparator);
+ for (int i=0; i < interfaces.length; i++)
+ data_out.writeUTF (interfaces[i].getName ());
+ }
Field field;
Field[] fields = cl.getDeclaredFields ();
@@ -530,7 +548,7 @@ public class ObjectStreamClass implements Serializable
for (int i=0; i < len; i++)
result += (long)(sha[i] & 0xFF) << (8 * i);
- uid = result;
+ return result;
}
catch (NoSuchAlgorithmException e)
{
@@ -543,31 +561,6 @@ public class ObjectStreamClass implements Serializable
}
}
-
- // Returns the value of CLAZZ's final static long field named
- // `serialVersionUID'.
- private long getDefinedSUID (Class clazz)
- {
- long l = 0;
- try
- {
- // Use getDeclaredField rather than getField, since serialVersionUID
- // may not be public AND we only want the serialVersionUID of this
- // class, not a superclass or interface.
- Field f = clazz.getDeclaredField ("serialVersionUID");
- l = f.getLong (null);
- }
- catch (java.lang.NoSuchFieldException e)
- {
- }
-
- catch (java.lang.IllegalAccessException e)
- {
- }
-
- return l;
- }
-
// Returns the value of CLAZZ's private static final field named
// `serialPersistentFields'.
private ObjectStreamField[] getSerialPersistentFields (Class clazz)
diff --git a/libjava/java/io/OutputStreamWriter.java b/libjava/java/io/OutputStreamWriter.java
index 41275985bea..527ff75c66b 100644
--- a/libjava/java/io/OutputStreamWriter.java
+++ b/libjava/java/io/OutputStreamWriter.java
@@ -86,6 +86,9 @@ public class OutputStreamWriter extends Writer
{
synchronized (lock)
{
+ if (out == null)
+ throw new IOException("Stream closed");
+
if (wcount > 0)
{
writeChars(work, 0, wcount);
@@ -100,9 +103,6 @@ public class OutputStreamWriter extends Writer
private void writeChars(char[] buf, int offset, int count)
throws IOException
{
- if (out == null)
- throw new IOException("Stream closed");
-
while (count > 0)
{
// We must flush if out.count == out.buf.length.
@@ -127,6 +127,9 @@ public class OutputStreamWriter extends Writer
{
synchronized (lock)
{
+ if (out == null)
+ throw new IOException("Stream closed");
+
if (work == null)
work = new char[100];
int wlength = work.length;
@@ -155,6 +158,9 @@ public class OutputStreamWriter extends Writer
{
synchronized (lock)
{
+ if (out == null)
+ throw new IOException("Stream closed");
+
if (work == null)
work = new char[100];
if (wcount >= work.length)
diff --git a/libjava/java/io/PipedReader.java b/libjava/java/io/PipedReader.java
index 8047d55a437..07569eb1dc1 100644
--- a/libjava/java/io/PipedReader.java
+++ b/libjava/java/io/PipedReader.java
@@ -312,10 +312,15 @@ public class PipedReader extends Reader
public boolean ready() throws IOException
{
// The JDK 1.3 implementation does not appear to check for the closed or
- // unconnected stream conditions here.
+ // unconnected stream conditions here. However, checking for a
+ // closed stream is explicitly required by the JDK 1.2 and 1.3
+ // documentation (for Reader.close()), so we do it.
synchronized (lock)
{
+ if (closed)
+ throw new IOException("Pipe closed");
+
if (in < 0)
return false;
diff --git a/libjava/java/io/PipedWriter.java b/libjava/java/io/PipedWriter.java
index a0a51d1d44b..ebcbde783ec 100644
--- a/libjava/java/io/PipedWriter.java
+++ b/libjava/java/io/PipedWriter.java
@@ -142,8 +142,10 @@ public class PipedWriter extends Writer
* had read all available data. Thats not the case - this method
* appears to be a no-op?
*/
- public void flush()
+ public void flush() throws IOException
{
+ if (closed)
+ throw new IOException ("Pipe closed");
}
/**
diff --git a/libjava/java/io/PrintStream.java b/libjava/java/io/PrintStream.java
index 4df8748e217..621778da9d5 100644
--- a/libjava/java/io/PrintStream.java
+++ b/libjava/java/io/PrintStream.java
@@ -1,6 +1,6 @@
// PrintStream.java - Print string representations
-/* Copyright (C) 1998, 1999 Free Software Foundation
+/* Copyright (C) 1998, 1999, 2001 Free Software Foundation
This file is part of libgcj.
@@ -18,7 +18,7 @@ import gnu.gcj.convert.UnicodeToBytes;
/* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3
* "The Java Language Specification", ISBN 0-201-63451-1
- * Status: Not finished.
+ * Status: Believed complete and correct to 1.3
*/
public class PrintStream extends FilterOutputStream
@@ -29,6 +29,7 @@ public class PrintStream extends FilterOutputStream
public boolean checkError ()
{
+ flush();
return error;
}
@@ -36,8 +37,13 @@ public class PrintStream extends FilterOutputStream
{
try
{
+ flush();
out.close();
}
+ catch (InterruptedIOException iioe)
+ {
+ Thread.currentThread().interrupt();
+ }
catch (IOException e)
{
setError ();
@@ -50,6 +56,10 @@ public class PrintStream extends FilterOutputStream
{
out.flush();
}
+ catch (InterruptedIOException iioe)
+ {
+ Thread.currentThread().interrupt();
+ }
catch (IOException e)
{
setError ();
@@ -66,6 +76,10 @@ public class PrintStream extends FilterOutputStream
if (auto_flush)
flush();
}
+ catch (InterruptedIOException iioe)
+ {
+ Thread.currentThread().interrupt();
+ }
catch (IOException e)
{
setError ();
@@ -83,32 +97,26 @@ public class PrintStream extends FilterOutputStream
if (auto_flush)
flush();
}
+ catch (InterruptedIOException iioe)
+ {
+ Thread.currentThread().interrupt();
+ }
catch (IOException e)
{
setError ();
}
}
- /** Writes characters through to the inferior BufferedOutputStream. */
private void writeChars(char[] buf, int offset, int count)
throws IOException
{
while (count > 0)
{
- // We must flush if out.count == out.buf.length.
- // It is probably a good idea to flush if out.buf is almost full.
- // This test is an approximation for "almost full".
- if (out.count + count >= out.buf.length)
- {
- out.flush();
- if (out.count != 0)
- throw new IOException("unable to flush output byte buffer");
- }
- converter.setOutput(out.buf, out.count);
+ converter.setOutput(work_bytes, 0);
int converted = converter.write(buf, offset, count);
offset += converted;
count -= converted;
- out.count = converter.count;
+ out.write(work_bytes, 0, converter.count);
}
}
@@ -117,20 +125,11 @@ public class PrintStream extends FilterOutputStream
{
while (count > 0)
{
- // We must flush if out.count == out.buf.length.
- // It is probably a good idea to flush if out.buf is almost full.
- // This test is an approximation for "almost full".
- if (out.count + count >= out.buf.length)
- {
- out.flush();
- if (out.count != 0)
- throw new IOException("unable to flush output byte buffer");
- }
- converter.setOutput(out.buf, out.count);
+ converter.setOutput(work_bytes, 0);
int converted = converter.write(str, offset, count, work);
offset += converted;
count -= converted;
- out.count = converter.count;
+ out.write(work_bytes, 0, converter.count);
}
}
@@ -239,15 +238,6 @@ public class PrintStream extends FilterOutputStream
public PrintStream (OutputStream out, boolean af)
{
super(out);
- if (out instanceof BufferedOutputStream)
- this.out = (BufferedOutputStream) out;
- else
- {
- this.out = new BufferedOutputStream(out, 250);
- /* PrintStream redefines "out". Explicitly reset FilterOutputStream's
- * "out" so that they're referring to the same thing. */
- super.out = this.out;
- }
converter = UnicodeToBytes.getDefaultEncoder();
error = false;
auto_flush = af;
@@ -264,7 +254,11 @@ public class PrintStream extends FilterOutputStream
{
out.write(oneByte);
if (auto_flush && oneByte == '\n')
- out.flush();
+ flush();
+ }
+ catch (InterruptedIOException iioe)
+ {
+ Thread.currentThread().interrupt();
}
catch (IOException e)
{
@@ -278,7 +272,11 @@ public class PrintStream extends FilterOutputStream
{
out.write(buffer, offset, count);
if (auto_flush)
- out.flush();
+ flush();
+ }
+ catch (InterruptedIOException iioe)
+ {
+ Thread.currentThread().interrupt();
}
catch (IOException e)
{
@@ -286,10 +284,12 @@ public class PrintStream extends FilterOutputStream
}
}
- BufferedOutputStream out;
UnicodeToBytes converter;
+ // Work buffer of characters for converter.
char[] work = new char[100];
+ // Work buffer of bytes where we temporarily keep converter output.
+ byte[] work_bytes = new byte[100];
// True if error occurred.
private boolean error;
diff --git a/libjava/java/io/natFile.cc b/libjava/java/io/natFile.cc
index 2b0da1bebf4..418df107e9a 100644
--- a/libjava/java/io/natFile.cc
+++ b/libjava/java/io/natFile.cc
@@ -1,6 +1,6 @@
-// natFile.cc - Native part of File class.
+// natFile.cc - Native part of File class for POSIX.
-/* Copyright (C) 1998, 1999, 2000 Free Software Foundation
+/* Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation
This file is part of libgcj.
@@ -24,23 +24,23 @@ details. */
#include <dirent.h>
#endif
#include <string.h>
+#include <utime.h>
#include <gcj/cni.h>
#include <jvm.h>
#include <java/io/File.h>
#include <java/io/IOException.h>
-#include <java/util/Vector.h>
+#include <java/util/ArrayList.h>
#include <java/lang/String.h>
#include <java/io/FilenameFilter.h>
+#include <java/io/FileFilter.h>
#include <java/lang/System.h>
jboolean
-java::io::File::access (jstring canon, jint query)
+java::io::File::_access (jint query)
{
- if (! canon)
- return false;
char buf[MAXPATHLEN];
- jsize total = JvGetStringUTFRegion (canon, 0, canon->length(), buf);
+ jsize total = JvGetStringUTFRegion (path, 0, path->length(), buf);
// FIXME?
buf[total] = '\0';
JvAssert (query == READ || query == WRITE || query == EXISTS);
@@ -59,15 +59,16 @@ java::io::File::access (jstring canon, jint query)
}
jboolean
-java::io::File::stat (jstring canon, jint query)
+java::io::File::_stat (jint query)
{
- if (! canon)
- return false;
char buf[MAXPATHLEN];
- jsize total = JvGetStringUTFRegion (canon, 0, canon->length(), buf);
+ jsize total = JvGetStringUTFRegion (path, 0, path->length(), buf);
// FIXME?
buf[total] = '\0';
+ if (query == ISHIDDEN)
+ return (getName()->charAt(0) == '.');
+
#ifdef HAVE_STAT
struct stat sb;
if (::stat (buf, &sb))
@@ -82,13 +83,10 @@ java::io::File::stat (jstring canon, jint query)
}
jlong
-java::io::File::attr (jstring canon, jint query)
+java::io::File::attr (jint query)
{
- if (! canon)
- return false;
-
char buf[MAXPATHLEN];
- jsize total = JvGetStringUTFRegion (canon, 0, canon->length(), buf);
+ jsize total = JvGetStringUTFRegion (path, 0, path->length(), buf);
// FIXME?
buf[total] = '\0';
@@ -99,8 +97,6 @@ java::io::File::attr (jstring canon, jint query)
return 0;
JvAssert (query == MODIFIED || query == LENGTH);
- // FIXME: time computation is very POSIX-specific -- POSIX and Java
- // have the same Epoch.
return query == MODIFIED ? (jlong)sb.st_mtime * 1000 : sb.st_size;
#else
// There's no good choice here.
@@ -118,7 +114,7 @@ java::io::File::getCanonicalPath (void)
#ifdef HAVE_REALPATH
if (realpath (buf, buf2) == NULL)
- _Jv_Throw (new IOException (JvNewStringLatin1 (strerror (errno))));
+ throw new IOException (JvNewStringLatin1 (strerror (errno)));
// FIXME: what encoding to assume for file names? This affects many
// calls.
@@ -131,57 +127,17 @@ java::io::File::getCanonicalPath (void)
jboolean
java::io::File::isAbsolute (void)
{
- // FIXME: cpp define name.
- // FIXME: cygwin.
-#ifdef WIN32
- if (path->charAt(0) == '/' || path->charAt(0) == '\\')
- return true;
- if (path->length() < 3)
- return false;
- // Hard-code A-Za-z because Windows (I think) can't use non-ASCII
- // letters as drive names.
- if ((path->charAt(0) < 'a' || path->charAt(0) > 'z')
- && (path->charAt(0) < 'A' || path->charAt(0) > 'Z'))
- return false;
- return (path->charAt(1) == ':'
- && (path->charAt(2) == '/' || path->charAt(2) == '\\'));
-#else
return path->charAt(0) == '/';
-#endif
}
-#ifdef HAVE_DIRENT_H
-#if defined(__JV_POSIX_THREADS__) && defined(HAVE_READDIR_R)
-
-static struct dirent *
-get_entry (DIR *dir, struct dirent *e)
+jobjectArray
+java::io::File::performList (java::io::FilenameFilter *filter,
+ java::io::FileFilter *fileFilter,
+ java::lang::Class *result_type)
{
- struct dirent *r;
- if (readdir_r (dir, e, &r) || r == NULL)
- return NULL;
- return e;
-}
-
-#else /* defined(__JV_POSIX_THREADS__) && defined(HAVE_READDIR_R) */
-
-static struct dirent *
-get_entry (DIR *dir, struct dirent *)
-{
- return readdir (dir);
-}
-
-#endif /* defined(__JV_POSIX_THREADS__) && defined(HAVE_READDIR_R) */
-#endif /* HAVE_DIRENT_H */
-
-jstringArray
-java::io::File::performList (jstring canon, FilenameFilter *filter)
-{
- if (! canon)
- return NULL;
-
#ifdef HAVE_DIRENT_H
char buf[MAXPATHLEN];
- jsize total = JvGetStringUTFRegion (canon, 0, canon->length(), buf);
+ jsize total = JvGetStringUTFRegion (path, 0, path->length(), buf);
// FIXME?
buf[total] = '\0';
@@ -189,26 +145,44 @@ java::io::File::performList (jstring canon, FilenameFilter *filter)
if (! dir)
return NULL;
- java::util::Vector *vec = new java::util::Vector ();
- struct dirent *d, d2;
- while ((d = get_entry (dir, &d2)) != NULL)
+
+ java::util::ArrayList *list = new java::util::ArrayList ();
+ struct dirent *d;
+#ifdef HAVE_READDIR_R
+ int name_max = pathconf (buf, _PC_NAME_MAX);
+ char dbuf[sizeof (struct dirent) + name_max + 1];
+ while (readdir_r (dir, (struct dirent *) dbuf, &d) == 0 && d != NULL)
+#else /* HAVE_READDIR_R */
+ while ((d = readdir (dir)) != NULL)
+#endif /* HAVE_READDIR_R */
{
- if (! strcmp (d->d_name, ".") || ! strcmp (d->d_name, ".."))
+ // Omit "." and "..".
+ if (d->d_name[0] == '.'
+ && (d->d_name[1] == '\0'
+ || (d->d_name[1] == '.' && d->d_name[2] == '\0')))
continue;
jstring name = JvNewStringUTF (d->d_name);
if (filter && ! filter->accept(this, name))
continue;
-
- vec->addElement(name);
+
+ if (result_type == &java::io::File::class$)
+ {
+ java::io::File *file = new java::io::File (this, name);
+ if (fileFilter && ! fileFilter->accept(file))
+ continue;
+
+ list->add(file);
+ }
+ else
+ list->add(name);
}
closedir (dir);
- jobjectArray ret = JvNewObjectArray (vec->size(), canon->getClass(),
- NULL);
- vec->copyInto(ret);
- return reinterpret_cast<jstringArray> (ret);
+ jobjectArray ret = JvNewObjectArray (list->size(), result_type, NULL);
+ list->toArray(ret);
+ return ret;
#else /* HAVE_DIRENT_H */
return NULL;
#endif /* HAVE_DIRENT_H */
@@ -230,6 +204,42 @@ java::io::File::performMkdir (void)
}
jboolean
+java::io::File::performSetReadOnly (void)
+{
+ char buf[MAXPATHLEN];
+ jsize total = JvGetStringUTFRegion (path, 0, path->length(), buf);
+ // FIXME?
+ buf[total] = '\0';
+
+#if defined (HAVE_STAT) && defined (HAVE_CHMOD)
+ struct stat sb;
+ if (::stat (buf, &sb))
+ return false;
+
+ if (::chmod(buf, sb.st_mode & 0555))
+ return false;
+ return true;
+#else
+ return false;
+#endif
+}
+
+static JArray<java::io::File *> *unixroot;
+
+JArray< ::java::io::File *>*
+java::io::File::performListRoots ()
+{
+ if (unixroot == NULL)
+ {
+ ::java::io::File *f = new ::java::io::File (JvNewStringLatin1 ("/"));
+ unixroot = reinterpret_cast <JArray<java::io::File *>*>
+ (JvNewObjectArray (1, &java::io::File::class$, f));
+ elements (unixroot) [0] = f;
+ }
+ return unixroot;
+}
+
+jboolean
java::io::File::performRenameTo (File *dest)
{
char buf[MAXPATHLEN];
@@ -249,10 +259,52 @@ java::io::File::performRenameTo (File *dest)
}
jboolean
-java::io::File::performDelete (jstring canon)
+java::io::File::performSetLastModified (jlong time)
{
+#ifdef HAVE_UTIME
+ utimbuf tb;
+
char buf[MAXPATHLEN];
- jsize total = JvGetStringUTFRegion (canon, 0, canon->length(), buf);
+ jsize total = JvGetStringUTFRegion (path, 0, path->length(), buf);
+ // FIXME?
+ buf[total] = '\0';
+
+ tb.actime = time / 1000;
+ tb.modtime = time / 1000;
+ return ::utime (buf, &tb);
+#else
+ return false;
+#endif
+}
+
+jboolean
+java::io::File::performCreate (void)
+{
+ char buf[MAXPATHLEN];
+ jsize total = JvGetStringUTFRegion (path, 0, path->length(), buf);
+ // FIXME?
+ buf[total] = '\0';
+
+ int fd = ::open (buf, O_CREAT | O_EXCL, 0644);
+
+ if (fd < 0)
+ {
+ if (errno == EEXIST)
+ return false;
+ throw new IOException (JvNewStringLatin1 (strerror (errno)));
+ }
+ else
+ {
+ ::close (fd);
+ return true;
+ }
+}
+
+jboolean
+java::io::File::performDelete (void)
+{
+ char buf[MAXPATHLEN];
+ jsize total = JvGetStringUTFRegion (path, 0, path->length(), buf);
// FIXME?
buf[total] = '\0';
@@ -260,9 +312,16 @@ java::io::File::performDelete (jstring canon)
#ifdef HAVE_RMDIR
if (! ::rmdir (buf))
return true;
-#endif // HAVE_RMDIR
if (errno == ENOTDIR)
+#endif // HAVE_RMDIR
return ::unlink (buf) == 0;
#endif // HAVE_UNLINK
return false;
}
+
+void
+java::io::File::init_native ()
+{
+ maxPathLen = MAXPATHLEN;
+ caseSensitive = true;
+}
diff --git a/libjava/java/io/natFileDescriptorPosix.cc b/libjava/java/io/natFileDescriptorPosix.cc
index 059eeb96564..0b80c6435c2 100644
--- a/libjava/java/io/natFileDescriptorPosix.cc
+++ b/libjava/java/io/natFileDescriptorPosix.cc
@@ -1,6 +1,6 @@
// natFileDescriptor.cc - Native part of FileDescriptor class.
-/* Copyright (C) 1998, 1999, 2000 Free Software Foundation
+/* Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation
This file is part of libgcj.
@@ -81,7 +81,7 @@ java::io::FileDescriptor::open (jstring path, jint jflags)
JvAssert ((jflags & READ) || (jflags & WRITE));
int mode = 0666;
if ((jflags & READ) && (jflags & WRITE))
- flags |= O_RDWR;
+ flags |= O_RDWR | O_CREAT;
else if ((jflags & READ))
flags |= O_RDONLY;
else
diff --git a/libjava/java/io/natFileWin32.cc b/libjava/java/io/natFileWin32.cc
index a56845a7134..dae0b2b8377 100644
--- a/libjava/java/io/natFileWin32.cc
+++ b/libjava/java/io/natFileWin32.cc
@@ -1,6 +1,6 @@
-// natFileWin32.cc - Native part of File class.
+// natFileWin32.cc - Native part of File class for Win32.
-/* Copyright (C) 1998, 1999 Red Hat, Inc.
+/* Copyright (C) 1998, 1999, 2001 Red Hat, Inc.
This file is part of libgcj.
@@ -25,12 +25,10 @@ details. */
#include <java/lang/System.h>
jboolean
-java::io::File::access (jstring canon, jint query)
+java::io::File::_access (jint query)
{
- if (! canon)
- return false;
char buf[MAX_PATH];
- jsize total = JvGetStringUTFRegion (canon, 0, canon->length(), buf);
+ jsize total = JvGetStringUTFRegion (path, 0, path->length(), buf);
// FIXME?
buf[total] = '\0';
@@ -48,15 +46,15 @@ java::io::File::access (jstring canon, jint query)
}
jboolean
-java::io::File::stat (jstring canon, jint query)
+java::io::File::_stat (jint query)
{
- if (! canon)
- return false;
char buf[MAX_PATH];
- jsize total = JvGetStringUTFRegion (canon, 0, canon->length(), buf);
+ jsize total = JvGetStringUTFRegion (path, 0, path->length(), buf);
// FIXME?
buf[total] = '\0';
+ // FIXME: Need to handle ISHIDDEN query.
+
JvAssert (query == DIRECTORY || query == ISFILE);
DWORD attributes = GetFileAttributes (buf);
@@ -70,12 +68,10 @@ java::io::File::stat (jstring canon, jint query)
}
jlong
-java::io::File::attr (jstring canon, jint query)
+java::io::File::attr (jint query)
{
- if (! canon)
- return false;
char buf[MAX_PATH];
- jsize total = JvGetStringUTFRegion (canon, 0, canon->length(), buf);
+ jsize total = JvGetStringUTFRegion (path, 0, path->length(), buf);
// FIXME?
buf[total] = '\0';
@@ -104,7 +100,7 @@ java::io::File::getCanonicalPath (void)
LPTSTR unused;
if(!GetFullPathName(buf, MAX_PATH, buf2, &unused))
- _Jv_Throw (new IOException (JvNewStringLatin1 ("GetFullPathName failed")));
+ throw new IOException (JvNewStringLatin1 ("GetFullPathName failed"));
// FIXME: what encoding to assume for file names? This affects many
// calls.
@@ -128,12 +124,12 @@ java::io::File::isAbsolute (void)
}
jstringArray
-java::io::File::performList (jstring canon, FilenameFilter *filter)
+java::io::File::performList (java::io::FilenameFilter *filter,
+ java::io::FileFilter *fileFilter,
+ java::lang::Class *result_type)
{
- if (! canon)
- return NULL;
char buf[MAX_PATH];
- jsize total = JvGetStringUTFRegion (canon, 0, canon->length(), buf);
+ jsize total = JvGetStringUTFRegion (path, 0, path->length(), buf);
// FIXME?
strcpy(&buf[total], "\\*.*");
@@ -142,16 +138,28 @@ java::io::File::performList (jstring canon, FilenameFilter *filter)
if (handle == INVALID_HANDLE_VALUE)
return NULL;
- java::util::Vector *vec = new java::util::Vector ();
+ java::util::ArrayList *list = new java::util::ArrayList ();
do
{
if (strcmp (data.cFileName, ".") && strcmp (data.cFileName, ".."))
{
jstring name = JvNewStringUTF (data.cFileName);
- if (! filter || (filter && filter->accept(this, name)))
- vec->addElement (name);
- }
+
+ if (filter && ! filter->accept(this, name))
+ continue;
+
+ if (result_type == &java::io::File::class$)
+ {
+ java::io::File *file = new java::io::File (this, name);
+ if (fileFilter && ! fileFilter->accept(file))
+ continue;
+
+ list->add(file);
+ }
+ else
+ list->add(name);
+ }
}
while (FindNextFile (handle, &data));
@@ -160,7 +168,7 @@ java::io::File::performList (jstring canon, FilenameFilter *filter)
FindClose (handle);
- jobjectArray ret = JvNewObjectArray (vec->size(), canon->getClass(), NULL);
+ jobjectArray ret = JvNewObjectArray (vec->size(), path->getClass(), NULL);
vec->copyInto (ret);
return reinterpret_cast<jstringArray> (ret);
}
@@ -177,6 +185,20 @@ java::io::File::performMkdir (void)
}
jboolean
+java::io::File::performSetReadOnly (void)
+{
+ // PLEASE IMPLEMENT ME
+ return false;
+}
+
+JArray< ::java::io::File *>*
+java::io::File::performListRoots ()
+{
+ // PLEASE IMPLEMENT ME
+ return NULL;
+}
+
+jboolean
java::io::File::performRenameTo (File *dest)
{
char buf[MAX_PATH];
@@ -192,10 +214,24 @@ java::io::File::performRenameTo (File *dest)
}
jboolean
-java::io::File::performDelete (jstring canon)
+java::io::File::performSetLastModified (jlong time)
+{
+ // PLEASE IMPLEMENT ME
+ return false;
+}
+
+jboolean
+java::io::File::performCreate (void)
+{
+ // PLEASE IMPLEMENT ME
+ return false;
+}
+
+jboolean
+java::io::File::performDelete ()
{
char buf[MAX_PATH];
- jsize total = JvGetStringUTFRegion(canon, 0, canon->length(), buf);
+ jsize total = JvGetStringUTFRegion(path, 0, path->length(), buf);
// FIXME?
buf[total] = '\0';
@@ -208,3 +244,10 @@ java::io::File::performDelete (jstring canon)
else
return (DeleteFile (buf)) ? true : false;
}
+
+void
+java::io::File::init_native ()
+{
+ maxPathLen = MAX_PATH;
+ caseSensitive = false;
+}
diff --git a/libjava/java/lang/Class.h b/libjava/java/lang/Class.h
index 9736b78829b..2744d912721 100644
--- a/libjava/java/lang/Class.h
+++ b/libjava/java/lang/Class.h
@@ -98,6 +98,13 @@ struct _Jv_ifaces
jshort count;
};
+// Used for vtable pointer manipulation.
+union _Jv_Self
+{
+ char *vtable_ptr;
+ jclass self;
+};
+
#define JV_PRIMITIVE_VTABLE ((_Jv_VTable *) -1)
#define JV_CLASS(Obj) ((jclass) (*(_Jv_VTable **) Obj)->clas)
@@ -105,7 +112,8 @@ struct _Jv_ifaces
class java::lang::Class : public java::lang::Object
{
public:
- static jclass forName (jstring className, java::lang::ClassLoader *loader);
+ static jclass forName (jstring className, jboolean initialize,
+ java::lang::ClassLoader *loader);
static jclass forName (jstring className);
JArray<jclass> *getClasses (void);
@@ -197,8 +205,6 @@ public:
// finalization
void finalize ();
- Class () {};
-
// This constructor is used to create Class object for the primitive
// types. See prims.cc.
Class (jobject cname, jbyte sig, jint len, jobject array_vtable)
@@ -208,9 +214,8 @@ public:
// C++ ctors set the vtbl pointer to point at an offset inside the vtable
// object. That doesn't work for Java, so this hack adjusts it back.
- void *p = ((void **)this)[0];
- ((void **)this)[0] = (void *)((char *)p-2*sizeof (void *));
-
+ ((_Jv_Self *)this)->vtable_ptr -= 2 * sizeof (void *);
+
// We must initialize every field of the class. We do this in the
// same order they are declared in Class.h, except for fields that
// are initialized to NULL.
@@ -229,6 +234,8 @@ public:
private:
+ Class ();
+
void checkMemberAccess (jint flags);
void initializeClass (void);
diff --git a/libjava/java/lang/Class.java b/libjava/java/lang/Class.java
index 0f081ebbac6..e42c4be6146 100644
--- a/libjava/java/lang/Class.java
+++ b/libjava/java/lang/Class.java
@@ -30,7 +30,9 @@ public final class Class implements Serializable
{
public static native Class forName (String className)
throws ClassNotFoundException;
- public static native Class forName (String className, ClassLoader loader)
+ /** @since 1.2 */
+ public static native Class forName (String className, boolean initialize,
+ ClassLoader loader)
throws ClassNotFoundException;
public native Class[] getClasses ();
public native ClassLoader getClassLoader ();
diff --git a/libjava/java/lang/ClassLoader.java b/libjava/java/lang/ClassLoader.java
index 402e8124864..f081cc55de1 100644
--- a/libjava/java/lang/ClassLoader.java
+++ b/libjava/java/lang/ClassLoader.java
@@ -1,6 +1,6 @@
// ClassLoader.java - Define policies for loading Java classes.
-/* Copyright (C) 1998, 1999, 2000 Free Software Foundation
+/* Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation
This file is part of libgcj.
@@ -25,18 +25,23 @@ import java.util.Stack;
* @author Kresten Krab Thorup
*/
-public abstract class ClassLoader {
-
+public abstract class ClassLoader
+{
static private ClassLoader system;
private ClassLoader parent;
- public ClassLoader getParent ()
+ public final ClassLoader getParent ()
{
/* FIXME: security */
return parent;
}
-
- public static native ClassLoader getSystemClassLoader ();
+
+ public static ClassLoader getSystemClassLoader ()
+ {
+ if (system == null)
+ system = gnu.gcj.runtime.VMClassLoader.instance;
+ return system;
+ }
/**
* Creates a <code>ClassLoader</code> with no parent.
@@ -55,6 +60,7 @@ public abstract class ClassLoader {
* <code>checkCreateClassLoader</code> on the current
* security manager.
* @exception java.lang.SecurityException if not allowed
+ * @since 1.2
*/
protected ClassLoader(ClassLoader parent)
{
@@ -71,12 +77,12 @@ public abstract class ClassLoader {
* @see ClassLoader#loadClass(String,boolean)
* @exception java.lang.ClassNotFoundException
*/
- public Class loadClass(String name)
- throws java.lang.ClassNotFoundException, java.lang.LinkageError
+ public Class loadClass(String name)
+ throws java.lang.ClassNotFoundException
{
return loadClass (name, false);
}
-
+
/**
* Loads the class by the given name. The default implementation
* will search for the class in the following order (similar to jdk 1.2)
@@ -96,7 +102,7 @@ public abstract class ClassLoader {
* @deprecated
*/
protected Class loadClass(String name, boolean link)
- throws java.lang.ClassNotFoundException, java.lang.LinkageError
+ throws java.lang.ClassNotFoundException
{
Class c = findLoadedClass (name);
@@ -106,7 +112,7 @@ public abstract class ClassLoader {
if (parent != null)
return parent.loadClass (name, link);
else
- c = findSystemClass (name);
+ c = system.findClass (name);
} catch (ClassNotFoundException ex) {
/* ignore, we'll try findClass */;
}
@@ -130,6 +136,7 @@ public abstract class ClassLoader {
* @param name Name of the class to find.
* @return The class found.
* @exception java.lang.ClassNotFoundException
+ * @since 1.2
*/
protected Class findClass (String name)
throws ClassNotFoundException
@@ -201,7 +208,7 @@ public abstract class ClassLoader {
throw new java.lang.LinkageError ("class "
+ name
+ " already loaded");
-
+
try {
// Since we're calling into native code here,
// we better make sure that any generated
@@ -232,7 +239,6 @@ public abstract class ClassLoader {
int len)
throws ClassFormatError;
-
/**
* Link the given class. This will bring the class to a state where
* the class initializer can be run. Linking involves the following
@@ -262,13 +268,11 @@ public abstract class ClassLoader {
* @exception java.lang.LinkageError
*/
protected final void resolveClass(Class clazz)
- throws java.lang.LinkageError
{
resolveClass0(clazz);
}
static void resolveClass0(Class clazz)
- throws java.lang.LinkageError
{
synchronized (clazz)
{
@@ -288,15 +292,13 @@ public abstract class ClassLoader {
/** Internal method. Calls _Jv_PrepareClass and
* _Jv_PrepareCompiledClass. This is only called from resolveClass. */
- private static native void linkClass0(Class clazz)
- throws java.lang.LinkageError;
+ private static native void linkClass0(Class clazz);
/** Internal method. Marks the given clazz to be in an erroneous
* state, and calls notifyAll() on the class object. This should only
* be called when the caller has the lock on the class object. */
private static native void markClassErrorState0(Class clazz);
-
/**
* Returns a class found in a system-specific way, typically
* via the <code>java.class.path</code> system property. Loads the
@@ -307,14 +309,14 @@ public abstract class ClassLoader {
* @exception java.lang.LinkageError
* @exception java.lang.ClassNotFoundException
*/
- protected Class findSystemClass(String name)
- throws java.lang.ClassNotFoundException, java.lang.LinkageError
+ protected final Class findSystemClass(String name)
+ throws java.lang.ClassNotFoundException
{
return getSystemClassLoader ().loadClass (name);
}
/*
- * Does currently nothing.
+ * Does currently nothing. FIXME.
*/
protected final void setSigners(Class claz, Object[] signers) {
/* claz.setSigners (signers); */
@@ -328,13 +330,13 @@ public abstract class ClassLoader {
* @param name class to find.
* @return the class loaded, or null.
*/
- protected native Class findLoadedClass(String name);
+ protected final native Class findLoadedClass(String name);
- public static final InputStream getSystemResourceAsStream(String name) {
+ public static InputStream getSystemResourceAsStream(String name) {
return getSystemClassLoader().getResourceAsStream (name);
}
- public static final URL getSystemResource(String name) {
+ public static URL getSystemResource(String name) {
return getSystemClassLoader().getResource (name);
}
@@ -397,7 +399,7 @@ public abstract class ClassLoader {
return null;
}
- public Enumeration getResources (String name) throws IOException
+ public final Enumeration getResources (String name) throws IOException
{
// The rules say search the parent class if non-null,
// otherwise search the built-in class loader (assumed to be
diff --git a/libjava/java/lang/ExceptionInInitializerError.java b/libjava/java/lang/ExceptionInInitializerError.java
index 0aad2fc89ea..d43a8599127 100644
--- a/libjava/java/lang/ExceptionInInitializerError.java
+++ b/libjava/java/lang/ExceptionInInitializerError.java
@@ -1,6 +1,6 @@
// ExceptionInInitializerError.java
-/* Copyright (C) 1998, 1999, 2000 Free Software Foundation
+/* Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation
This file is part of libgcj.
@@ -38,7 +38,7 @@ public class ExceptionInInitializerError extends LinkageError
public ExceptionInInitializerError (Throwable e)
{
- super ();
+ super (e.toString());
exception = e;
}
@@ -49,17 +49,35 @@ public class ExceptionInInitializerError extends LinkageError
public void printStackTrace ()
{
- exception.printStackTrace ();
+ if (exception != null)
+ {
+ System.err.print (this.getClass().getName() + ": ");
+ exception.printStackTrace ();
+ }
+ else
+ super.printStackTrace ();
}
public void printStackTrace (PrintStream ps)
{
- exception.printStackTrace (ps);
+ if (exception != null)
+ {
+ ps.print (this.getClass().getName() + ": ");
+ exception.printStackTrace (ps);
+ }
+ else
+ super.printStackTrace (ps);
}
public void printStackTrace (PrintWriter pw)
{
- exception.printStackTrace (pw);
+ if (exception != null)
+ {
+ pw.print (this.getClass().getName() + ": ");
+ exception.printStackTrace (pw);
+ }
+ else
+ super.printStackTrace (pw);
}
// The exception that caused this error.
diff --git a/libjava/java/lang/Integer.java b/libjava/java/lang/Integer.java
index 2cf7bb45349..88d0769a275 100644
--- a/libjava/java/lang/Integer.java
+++ b/libjava/java/lang/Integer.java
@@ -155,13 +155,15 @@ public final class Integer extends Number implements Comparable
public static Integer getInteger(String prop, Integer defobj)
{
try
- {
- return decode(System.getProperty(prop));
- }
+ {
+ String val = System.getProperty(prop);
+ if (val != null)
+ return decode(val);
+ }
catch (NumberFormatException ex)
- {
- return defobj;
- }
+ {
+ }
+ return defobj;
}
public int hashCode()
diff --git a/libjava/java/lang/Long.java b/libjava/java/lang/Long.java
index cb2cec2d904..2e812f9696d 100644
--- a/libjava/java/lang/Long.java
+++ b/libjava/java/lang/Long.java
@@ -156,13 +156,15 @@ public final class Long extends Number implements Comparable
public static Long getLong(String prop, Long defobj)
{
try
- {
- return decode(System.getProperty(prop));
- }
+ {
+ String val = System.getProperty(prop);
+ if (val != null)
+ return decode(val);
+ }
catch (NumberFormatException ex)
- {
- return defobj;
- }
+ {
+ }
+ return defobj;
}
public int hashCode()
diff --git a/libjava/java/lang/Runtime.java b/libjava/java/lang/Runtime.java
index e746c60b384..28befc26d19 100644
--- a/libjava/java/lang/Runtime.java
+++ b/libjava/java/lang/Runtime.java
@@ -1,6 +1,6 @@
// Runtime.java - Runtime class.
-/* Copyright (C) 1998, 1999, 2000 Free Software Foundation
+/* Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation
This file is part of libgcj.
@@ -63,6 +63,10 @@ public class Runtime
}
public native void exit (int status);
+
+ // Shutdown the runtime without a SecurityManager check. libgcj uses this
+ // exit function internally.
+ final native void _exit (int status);
public native long freeMemory ();
public native void gc ();
diff --git a/libjava/java/lang/String.java b/libjava/java/lang/String.java
index 22e11530f77..b985cf4186c 100644
--- a/libjava/java/lang/String.java
+++ b/libjava/java/lang/String.java
@@ -347,6 +347,5 @@ public final class String implements Serializable, Comparable
private native void init (byte[] chars, int hibyte, int offset, int count);
private native void init (byte[] chars, int offset, int count, String enc)
throws UnsupportedEncodingException;
- private static native void unintern (Object obj);
private static native void rehash ();
}
diff --git a/libjava/java/lang/System.java b/libjava/java/lang/System.java
index 162bc1f21eb..0f7bd7ba8b7 100644
--- a/libjava/java/lang/System.java
+++ b/libjava/java/lang/System.java
@@ -230,7 +230,7 @@ public final class System
public static void setSecurityManager (SecurityManager s)
{
if (secman != null)
- throw new SecurityException ();
+ secman.checkPermission(new RuntimePermission("setSecurityManager"));
secman = s;
}
diff --git a/libjava/java/lang/ThreadGroup.java b/libjava/java/lang/ThreadGroup.java
index cf1e7171ccb..bdf37f9ec9c 100644
--- a/libjava/java/lang/ThreadGroup.java
+++ b/libjava/java/lang/ThreadGroup.java
@@ -1,5 +1,5 @@
/* java.lang.ThreadGroup
- Copyright (C) 1998, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1998, 2000, 2001 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -204,16 +204,21 @@ public class ThreadGroup
* @return the number of active threads in this ThreadGroup and
* its descendants.
* @specnote it isn't clear what the definition of an "Active" thread is.
- * Current JDKs regard all threads as active until they are
- * finished, regardless of whether the thread has been started
- * or not. We implement this behaviour.
- * There is open JDC bug, <A HREF="http://developer.java.sun.com/developer/bugParade/bugs/4089701.html">
+ * Current JDKs regard a thread as active if has been
+ * started and not finished. We implement this behaviour.
+ * There is a JDC bug, <A HREF="http://developer.java.sun.com/developer/bugParade/bugs/4089701.html">
* 4089701</A>, regarding this issue.
*
*/
public synchronized int activeCount()
{
- int total = threads.size();
+ int total = 0;
+ for (int i = 0; i < threads.size(); ++i)
+ {
+ if (((Thread) threads.elementAt(i)).isAlive ())
+ ++total;
+ }
+
for (int i=0; i < groups.size(); i++)
{
ThreadGroup g = (ThreadGroup) groups.elementAt(i);
@@ -274,7 +279,11 @@ public class ThreadGroup
{
Enumeration e = threads.elements();
while (e.hasMoreElements() && next_index < list.length)
- list[next_index++] = (Thread) e.nextElement();
+ {
+ Thread t = (Thread) e.nextElement();
+ if (t.isAlive ())
+ list[next_index++] = t;
+ }
if (recurse && next_index != list.length)
{
e = groups.elements();
@@ -502,7 +511,19 @@ public class ThreadGroup
{
if (thread != null)
System.out.print("Exception in thread \"" + thread.getName() + "\" ");
- t.printStackTrace();
+ try
+ {
+ t.printStackTrace();
+ }
+ catch (Throwable x)
+ {
+ // This means that something is badly screwed up with the runtime,
+ // or perhaps someone is messing with the SecurityManager. In any
+ // case, try to deal with it gracefully.
+ System.out.println(t);
+ System.err.println("*** Got " + x.toString() +
+ " while trying to print stack trace");
+ }
had_uncaught_exception = true;
}
}
diff --git a/libjava/java/lang/Throwable.java b/libjava/java/lang/Throwable.java
index 4aa21399c5a..5c330fe315e 100644
--- a/libjava/java/lang/Throwable.java
+++ b/libjava/java/lang/Throwable.java
@@ -57,7 +57,7 @@ class CPlusPlusDemangler extends OutputStream
CPlusPlusDemangler (PrintWriter writer) throws IOException
{
p = writer;
- proc = Runtime.getRuntime ().exec ("c++filt");
+ proc = Runtime.getRuntime ().exec ("c++filt -s java");
procOut = proc.getOutputStream ();
procIn = proc.getInputStream ();
}
diff --git a/libjava/java/lang/natClass.cc b/libjava/java/lang/natClass.cc
index 6678b7794cf..025781e96ae 100644
--- a/libjava/java/lang/natClass.cc
+++ b/libjava/java/lang/natClass.cc
@@ -72,7 +72,8 @@ static _Jv_Utf8Const *finit_leg_name = _Jv_makeUtf8Const ("$finit$", 7);
jclass
-java::lang::Class::forName (jstring className, java::lang::ClassLoader *loader)
+java::lang::Class::forName (jstring className, jboolean initialize,
+ java::lang::ClassLoader *loader)
{
if (! className)
JvThrow (new java::lang::NullPointerException);
@@ -90,10 +91,11 @@ java::lang::Class::forName (jstring className, java::lang::ClassLoader *loader)
? _Jv_FindClassFromSignature (name->data, loader)
: _Jv_FindClass (name, loader));
- if (klass)
+ if (klass == NULL)
+ throw new java::lang::ClassNotFoundException (className);
+
+ if (initialize)
_Jv_InitClass (klass);
- else
- JvThrow (new java::lang::ClassNotFoundException (className));
return klass;
}
@@ -102,7 +104,7 @@ jclass
java::lang::Class::forName (jstring className)
{
// FIXME: should use class loader from calling method.
- return forName (className, NULL);
+ return forName (className, true, NULL);
}
java::lang::reflect::Constructor *
@@ -290,8 +292,12 @@ java::lang::Class::getSignature (JArray<jclass> *param_types,
java::lang::StringBuffer *buf = new java::lang::StringBuffer ();
buf->append((jchar) '(');
jclass *v = elements (param_types);
- for (int i = 0; i < param_types->length; ++i)
- v[i]->getSignature(buf);
+ // A NULL param_types means "no parameters".
+ if (param_types != NULL)
+ {
+ for (int i = 0; i < param_types->length; ++i)
+ v[i]->getSignature(buf);
+ }
buf->append((jchar) ')');
if (is_constructor)
buf->append((jchar) 'V');
@@ -627,7 +633,7 @@ java::lang::Class::isAssignableFrom (jclass klass)
jboolean
java::lang::Class::isInstance (jobject obj)
{
- if (__builtin_expect (! obj || isPrimitive (), false))
+ if (! obj)
return false;
_Jv_InitClass (this);
return _Jv_IsAssignableFrom (this, JV_CLASS (obj));
@@ -903,11 +909,8 @@ _Jv_LookupInterfaceMethodIdx (jclass klass, jclass iface, int method_idx)
jboolean
_Jv_IsAssignableFrom (jclass target, jclass source)
{
- if (source == target
- || (target == &ObjectClass && !source->isPrimitive())
- || (source->ancestors != NULL
- && source->ancestors[source->depth - target->depth] == target))
- return true;
+ if (source == target)
+ return true;
// If target is array, so must source be.
if (target->isArray ())
@@ -932,15 +935,32 @@ _Jv_IsAssignableFrom (jclass target, jclass source)
if (__builtin_expect ((if_idt == NULL), false))
return false; // No class implementing TARGET has been loaded.
jshort cl_iindex = cl_idt->cls.iindex;
- if (cl_iindex <= if_idt->iface.ioffsets[0])
+ if (cl_iindex < if_idt->iface.ioffsets[0])
{
jshort offset = if_idt->iface.ioffsets[cl_iindex];
- if (offset < cl_idt->cls.itable_length
+ if (offset != -1 && offset < cl_idt->cls.itable_length
&& cl_idt->cls.itable[offset] == target)
return true;
}
+ return false;
}
+
+ // Primitive TYPE classes are only assignable to themselves.
+ if (__builtin_expect (target->isPrimitive(), false))
+ return false;
+ if (target == &ObjectClass)
+ {
+ if (source->isPrimitive())
+ return false;
+ return true;
+ }
+ else if (source->ancestors != NULL
+ && target->ancestors != NULL
+ && source->depth >= target->depth
+ && source->ancestors[source->depth - target->depth] == target)
+ return true;
+
return false;
}
@@ -1310,7 +1330,7 @@ _Jv_FindIIndex (jclass *ifaces, jshort *offsets, jshort num)
{
if (j >= num)
goto found;
- if (i > ifaces[j]->idt->iface.ioffsets[0])
+ if (i >= ifaces[j]->idt->iface.ioffsets[0])
continue;
int ioffset = ifaces[j]->idt->iface.ioffsets[i];
/* We can potentially share this position with another class. */
diff --git a/libjava/java/lang/natClassLoader.cc b/libjava/java/lang/natClassLoader.cc
index 979de3fc2d6..e62c6a80e6a 100644
--- a/libjava/java/lang/natClassLoader.cc
+++ b/libjava/java/lang/natClassLoader.cc
@@ -48,15 +48,6 @@ details. */
/////////// java.lang.ClassLoader native methods ////////////
-java::lang::ClassLoader *
-java::lang::ClassLoader::getSystemClassLoader (void)
-{
- JvSynchronize sync (&ClassLoaderClass);
- if (! system)
- system = gnu::gcj::runtime::VMClassLoader::getVMClassLoader ();
- return system;
-}
-
java::lang::Class *
java::lang::ClassLoader::defineClass0 (jstring name,
jbyteArray data,
@@ -79,7 +70,9 @@ java::lang::ClassLoader::defineClass0 (jstring name,
{
_Jv_Utf8Const * name2 = _Jv_makeUtf8Const (name);
- _Jv_VerifyClassName (name2);
+ if (! _Jv_VerifyClassName (name2))
+ JvThrow (new java::lang::ClassFormatError
+ (JvNewStringLatin1 ("erroneous class name")));
klass->name = name2;
}
@@ -176,11 +169,10 @@ java::lang::ClassLoader::markClassErrorState0 (java::lang::Class *klass)
klass->notifyAll ();
}
-
-/** this is the only native method in VMClassLoader, so
- we define it here. */
+// This is the findClass() implementation for the System classloader. It is
+// the only native method in VMClassLoader, so we define it here.
jclass
-gnu::gcj::runtime::VMClassLoader::findSystemClass (jstring name)
+gnu::gcj::runtime::VMClassLoader::findClass (jstring name)
{
_Jv_Utf8Const *name_u = _Jv_makeUtf8Const (name);
jclass klass = _Jv_FindClassInCache (name_u, 0);
@@ -209,6 +201,12 @@ gnu::gcj::runtime::VMClassLoader::findSystemClass (jstring name)
klass = _Jv_FindClassInCache (name_u, 0);
}
}
+
+ // Now try loading using the interpreter.
+ if (! klass)
+ {
+ klass = java::net::URLClassLoader::findClass (name);
+ }
return klass;
}
@@ -400,7 +398,8 @@ _Jv_UnregisterClass (jclass the_class)
void
_Jv_RegisterInitiatingLoader (jclass klass, java::lang::ClassLoader *loader)
{
- _Jv_LoaderInfo *info = new _Jv_LoaderInfo; // non-gc alloc!
+ // non-gc alloc!
+ _Jv_LoaderInfo *info = (_Jv_LoaderInfo *) _Jv_Malloc (sizeof(_Jv_LoaderInfo));
jint hash = HASH_UTF(klass->name);
_Jv_MonitorEnter (&ClassClass);
@@ -409,7 +408,6 @@ _Jv_RegisterInitiatingLoader (jclass klass, java::lang::ClassLoader *loader)
info->next = initiated_classes[hash];
initiated_classes[hash] = info;
_Jv_MonitorExit (&ClassClass);
-
}
// This function is called many times during startup, before main() is
@@ -594,20 +592,17 @@ _Jv_NewArrayClass (jclass element, java::lang::ClassLoader *loader,
JvAssert (ObjectClass.vtable_method_count == NUM_OBJECT_METHODS);
int dm_count = ObjectClass.vtable_method_count;
- // Create a new vtable by copying Object's vtable (except the
- // class pointer, of course). Note that we allocate this as
- // unscanned memory -- the vtables are handled specially by the
- // GC.
- int size = (sizeof (_Jv_VTable) + ((dm_count - 1) * sizeof (void *)));
+ // Create a new vtable by copying Object's vtable.
_Jv_VTable *vtable;
if (array_vtable)
vtable = array_vtable;
else
- vtable = (_Jv_VTable *) _Jv_AllocBytes (size);
+ vtable = _Jv_VTable::new_vtable (dm_count);
vtable->clas = array_class;
- memcpy (vtable->method, ObjectClass.vtable->method,
- dm_count * sizeof (void *));
vtable->gc_descr = ObjectClass.vtable->gc_descr;
+ for (int i = 0; i < dm_count; ++i)
+ vtable->set_method (i, ObjectClass.vtable->get_method (i));
+
array_class->vtable = vtable;
array_class->vtable_method_count = ObjectClass.vtable_method_count;
diff --git a/libjava/java/lang/natDouble.cc b/libjava/java/lang/natDouble.cc
index bc60ddaec28..af2d70ad6f3 100644
--- a/libjava/java/lang/natDouble.cc
+++ b/libjava/java/lang/natDouble.cc
@@ -10,15 +10,12 @@ details. */
#include <config.h>
-#if HAVE_ALLOCA_H
-#include <alloca.h>
-#endif
-
#include <stdlib.h>
#include <gcj/cni.h>
#include <java/lang/String.h>
#include <java/lang/Double.h>
+#include <java/lang/Character.h>
#include <java/lang/NumberFormatException.h>
#include <jvm.h>
@@ -164,23 +161,28 @@ jdouble
java::lang::Double::parseDouble(jstring str)
{
int length = str->length();
- // Note that UTF can expand 3x.
-
-#ifdef HAVE_ALLOCA
- char *data = (char *) alloca (3 * length + 1);
-#else
-#error --- need an alternate implementation here ---
-#endif
-
- data[_Jv_GetStringUTFRegion (str, 0, length, data)] = 0;
-
- struct _Jv_reent reent;
- memset (&reent, 0, sizeof reent);
-
- double val = _strtod_r (&reent, data, NULL);
-
- if (reent._errno)
- _Jv_Throw (new NumberFormatException);
-
- return val;
+ while (length > 0
+ && Character::isWhitespace(str->charAt(length - 1)))
+ length--;
+ jsize start = 0;
+ while (length > 0
+ && Character::isWhitespace(str->charAt(start)))
+ start++, length--;
+
+ if (length > 0)
+ {
+ // Note that UTF can expand 3x.
+ char *data = (char *) __builtin_alloca (3 * length + 1);
+ jsize blength = _Jv_GetStringUTFRegion (str, start, length, data);
+ data[blength] = 0;
+
+ struct _Jv_reent reent;
+ memset (&reent, 0, sizeof reent);
+
+ char *endptr;
+ double val = _strtod_r (&reent, data, &endptr);
+ if (endptr == data + blength)
+ return val;
+ }
+ _Jv_Throw (new NumberFormatException);
}
diff --git a/libjava/java/lang/natRuntime.cc b/libjava/java/lang/natRuntime.cc
index 5ff7d2edacf..70bb72295b8 100644
--- a/libjava/java/lang/natRuntime.cc
+++ b/libjava/java/lang/natRuntime.cc
@@ -1,6 +1,6 @@
// natRuntime.cc - Implementation of native side of Runtime class.
-/* Copyright (C) 1998, 1999, 2000 Free Software Foundation
+/* Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation
This file is part of libgcj.
@@ -69,7 +69,7 @@ _Jv_FindSymbolInExecutable (const char *symname)
return r;
}
- return lt_dlsym (NULL, symname);
+ return NULL;
}
#endif /* USE_LTDL */
@@ -78,7 +78,12 @@ void
java::lang::Runtime::exit (jint status)
{
checkExit (status);
+ _exit (status);
+}
+void
+java::lang::Runtime::_exit (jint status)
+{
// Make status right for Unix. This is perhaps strange.
if (status < 0 || status > 255)
status = 255;
@@ -186,6 +191,9 @@ java::lang::Runtime::init (void)
finalize_on_exit = false;
#ifdef USE_LTDL
lt_dlinit ();
+ lt_dlhandle self = lt_dlopen (NULL);
+ if (self != NULL)
+ add_library (self);
#endif
}
diff --git a/libjava/java/lang/natString.cc b/libjava/java/lang/natString.cc
index bb903fbde6f..255d4cf11c7 100644
--- a/libjava/java/lang/natString.cc
+++ b/libjava/java/lang/natString.cc
@@ -1,6 +1,6 @@
// natString.cc - Implementation of java.lang.String native methods.
-/* Copyright (C) 1998, 1999, 2000 Free Software Foundation
+/* Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation
This file is part of libgcj.
@@ -29,6 +29,7 @@ details. */
#include <gnu/gcj/convert/BytesToUnicode.h>
#include <jvm.h>
+static void unintern (jobject);
static jstring* strhash = NULL;
static int strhash_count = 0; /* Number of slots used in strhash. */
static int strhash_size = 0; /* Number of slots available in strhash.
@@ -45,6 +46,10 @@ static int strhash_size = 0; /* Number of slots available in strhash.
#define DELETED_STRING ((jstring)(~0))
#define SET_STRING_IS_INTERNED(STR) /* nothing */
+#define UNMASK_PTR(Ptr) (((unsigned long) (Ptr)) & ~0x01)
+#define MASK_PTR(Ptr) (((unsigned long) (Ptr)) | 0x01)
+#define PTR_MASKED(Ptr) (((unsigned long) (Ptr)) & 0x01)
+
/* Find a slot where the string with elements DATA, length LEN,
and hash HASH should go in the strhash table of interned strings. */
jstring*
@@ -57,11 +62,12 @@ _Jv_StringFindSlot (jchar* data, jint len, jint hash)
int index = start_index;
/* step must be non-zero, and relatively prime with strhash_size. */
- int step = 8 * hash + 7;
+ jint step = (hash ^ (hash >> 16)) | 1;
for (;;)
{
jstring* ptr = &strhash[index];
- if (*ptr == NULL)
+ jstring value = (jstring) UNMASK_PTR (*ptr);
+ if (value == NULL)
{
if (deleted_index >= 0)
return (&strhash[deleted_index]);
@@ -70,8 +76,8 @@ _Jv_StringFindSlot (jchar* data, jint len, jint hash)
}
else if (*ptr == DELETED_STRING)
deleted_index = index;
- else if ((*ptr)->length() == len
- && memcmp(JvGetStringChars(*ptr), data, 2*len) == 0)
+ else if (value->length() == len
+ && memcmp(JvGetStringChars(value), data, 2*len) == 0)
return (ptr);
index = (index + step) & (strhash_size - 1);
JvAssert (index != start_index);
@@ -115,16 +121,18 @@ java::lang::String::rehash()
if (strhash == NULL)
{
strhash_size = 1024;
- strhash = (jstring *) _Jv_AllocBytes (strhash_size * sizeof (jstring));
+ strhash = (jstring *) _Jv_AllocBytesChecked (strhash_size
+ * sizeof (jstring));
memset (strhash, 0, strhash_size * sizeof (jstring));
}
else
{
int i = strhash_size;
jstring* ptr = strhash + i;
- strhash_size *= 2;
- strhash = (jstring *) _Jv_AllocBytes (strhash_size * sizeof (jstring));
- memset (strhash, 0, strhash_size * sizeof (jstring));
+ int nsize = strhash_size * 2;
+ jstring *next = (jstring *) _Jv_AllocBytesChecked (nsize
+ * sizeof (jstring));
+ memset (next, 0, nsize * sizeof (jstring));
while (--i >= 0)
{
@@ -134,19 +142,23 @@ java::lang::String::rehash()
/* This is faster equivalent of
* *__JvGetInternSlot(*ptr) = *ptr; */
- jint hash = (*ptr)->hashCode();
- jint index = hash & (strhash_size - 1);
- jint step = 8 * hash + 7;
+ jstring val = (jstring) UNMASK_PTR (*ptr);
+ jint hash = val->hashCode();
+ jint index = hash & (nsize - 1);
+ jint step = (hash ^ (hash >> 16)) | 1;
for (;;)
{
- if (strhash[index] == NULL)
+ if (next[index] == NULL)
{
- strhash[index] = *ptr;
+ next[index] = *ptr;
break;
}
- index = (index + step) & (strhash_size - 1);
+ index = (index + step) & (nsize - 1);
}
}
+
+ strhash_size = nsize;
+ strhash = next;
}
}
@@ -154,30 +166,61 @@ jstring
java::lang::String::intern()
{
JvSynchronize sync (&StringClass);
- if (4 * strhash_count >= 3 * strhash_size)
+ if (3 * strhash_count >= 2 * strhash_size)
rehash();
jstring* ptr = _Jv_StringGetSlot(this);
if (*ptr != NULL && *ptr != DELETED_STRING)
- return *ptr;
- SET_STRING_IS_INTERNED(this);
+ {
+ // See description in unintern() to understand this.
+ *ptr = (jstring) MASK_PTR (*ptr);
+ return (jstring) UNMASK_PTR (*ptr);
+ }
+ jstring str = this->data == this ? this
+ : _Jv_NewString(JvGetStringChars(this), this->length());
+ SET_STRING_IS_INTERNED(str);
strhash_count++;
- *ptr = this;
+ *ptr = str;
// When string is GC'd, clear the slot in the hash table.
- // _Jv_RegisterFinalizer ((void *) this, unintern);
- return this;
+ _Jv_RegisterFinalizer ((void *) str, unintern);
+ return str;
}
/* Called by String fake finalizer. */
-void
-java::lang::String::unintern (jobject obj)
+static void
+unintern (jobject obj)
{
JvSynchronize sync (&StringClass);
jstring str = reinterpret_cast<jstring> (obj);
jstring* ptr = _Jv_StringGetSlot(str);
if (*ptr == NULL || *ptr == DELETED_STRING)
return;
- *ptr = DELETED_STRING;
- strhash_count--;
+
+ // We assume the lowest bit of the pointer is free for our nefarious
+ // manipulations. What we do is set it to `0' (implicitly) when
+ // interning the String. If we subsequently re-intern the same
+ // String, then we set the bit. When finalizing, if the bit is set
+ // then we clear it and re-register the finalizer. We know this is
+ // a safe approach because both the intern() and unintern() acquire
+ // the class lock; this bit can't be manipulated when the lock is
+ // not held. So if we are finalizing and the bit is clear then we
+ // know all references are gone and we can clear the entry in the
+ // hash table. The naive approach of simply clearing the pointer
+ // here fails in the case where a request to intern a new string
+ // with the same contents is made between the time the intern()d
+ // string is found to be unreachable and when the finalizer is
+ // actually run. In this case we could clear a pointer to a valid
+ // string, and future intern() calls for that particular value would
+ // spuriously fail.
+ if (PTR_MASKED (*ptr))
+ {
+ *ptr = (jstring) UNMASK_PTR (*ptr);
+ _Jv_RegisterFinalizer ((void *) obj, unintern);
+ }
+ else
+ {
+ *ptr = DELETED_STRING;
+ strhash_count--;
+ }
}
jstring
@@ -222,17 +265,21 @@ _Jv_NewStringUtf8Const (Utf8Const* str)
chrs = JvGetStringChars(jstr);
}
+ jint hash = 0;
while (data < limit)
- *chrs++ = UTF8_GET(data, limit);
+ {
+ jchar ch = UTF8_GET(data, limit);
+ hash = (31 * hash) + ch;
+ *chrs++ = ch;
+ }
chrs -= length;
JvSynchronize sync (&StringClass);
- if (4 * strhash_count >= 3 * strhash_size)
+ if (3 * strhash_count >= 2 * strhash_size)
java::lang::String::rehash();
- int hash = str->hash;
jstring* ptr = _Jv_StringFindSlot (chrs, length, hash);
if (*ptr != NULL && *ptr != DELETED_STRING)
- return *ptr;
+ return (jstring) UNMASK_PTR (*ptr);
strhash_count++;
if (jstr == NULL)
{
@@ -242,6 +289,8 @@ _Jv_NewStringUtf8Const (Utf8Const* str)
}
*ptr = jstr;
SET_STRING_IS_INTERNED(jstr);
+ // When string is GC'd, clear the slot in the hash table.
+ _Jv_RegisterFinalizer ((void *) jstr, unintern);
return jstr;
}
diff --git a/libjava/java/lang/natSystem.cc b/libjava/java/lang/natSystem.cc
index 330be72220f..57e135c7db5 100644
--- a/libjava/java/lang/natSystem.cc
+++ b/libjava/java/lang/natSystem.cc
@@ -90,7 +90,7 @@ java::lang::System::arraycopy (jobject src, jint src_offset,
jint count)
{
if (! src || ! dst)
- _Jv_Throw (new NullPointerException);
+ throw new NullPointerException;
jclass src_c = src->getClass();
jclass dst_c = dst->getClass();
@@ -100,14 +100,14 @@ java::lang::System::arraycopy (jobject src, jint src_offset,
if (! src_c->isArray() || ! dst_c->isArray()
|| src_comp->isPrimitive() != dst_comp->isPrimitive()
|| (src_comp->isPrimitive() && src_comp != dst_comp))
- _Jv_Throw (new ArrayStoreException);
+ throw new ArrayStoreException;
__JArray *src_a = (__JArray *) src;
__JArray *dst_a = (__JArray *) dst;
if (src_offset < 0 || dst_offset < 0 || count < 0
|| src_offset + count > src_a->length
|| dst_offset + count > dst_a->length)
- _Jv_Throw (new ArrayIndexOutOfBoundsException);
+ throw new ArrayIndexOutOfBoundsException;
// Do-nothing cases.
if ((src == dst && src_offset == dst_offset)
@@ -149,7 +149,7 @@ java::lang::System::arraycopy (jobject src, jint src_offset,
{
if (*src_elts
&& ! dst_comp->isAssignableFrom((*src_elts)->getClass()))
- _Jv_Throw (new ArrayStoreException);
+ throw new ArrayStoreException;
*dst_elts++ = *src_elts++;
}
}
@@ -249,9 +249,11 @@ java::lang::System::getSystemTimeZone (void)
mktime(tim = localtime(&current_time));
#ifdef STRUCT_TM_HAS_GMTOFF
- tzoffset = -(tim->tm_gmtoff); // tm_gmtoff is secs EAST of UTC.
+ // tm_gmtoff is secs EAST of UTC.
+ tzoffset = -(tim->tm_gmtoff) + tim->tm_isdst * 3600L;
#elif HAVE_TIMEZONE
- tzoffset = timezone; // timezone is secs WEST of UTC.
+ // timezone is secs WEST of UTC.
+ tzoffset = timezone;
#else
// FIXME: there must be another global if neither tm_gmtoff nor timezone
// is available, esp. if tzname is valid.
diff --git a/libjava/java/lang/natThrowable.cc b/libjava/java/lang/natThrowable.cc
index dab3ba6387a..e2821c5ddfb 100644
--- a/libjava/java/lang/natThrowable.cc
+++ b/libjava/java/lang/natThrowable.cc
@@ -39,10 +39,6 @@ details. */
#include <name-finder.h>
-#ifdef __ia64__
-extern "C" int __ia64_backtrace (void **array, int size);
-#endif
-
/* FIXME: size of the stack trace is limited to 128 elements. It's
undoubtedly sensible to limit the stack trace, but 128 is rather
arbitrary. It may be better to configure this. */
@@ -52,20 +48,16 @@ java::lang::Throwable::fillInStackTrace (void)
{
if (! trace_enabled)
return this;
-#if defined (HAVE_BACKTRACE) || defined (__ia64__)
+#if defined (HAVE_BACKTRACE)
void *p[128];
// We subtract 1 from the number of elements because we don't want
// to include the call to fillInStackTrace in the trace.
-#if defined (__ia64__)
- int n = __ia64_backtrace (p, 128) - 1;
-#else
int n = backtrace (p, 128) - 1;
-#endif
if (n > 0)
{
- // ??? Might this cause a problem if the byte array isn't aligned?
+ // We copy the array below to deal with alignment issues.
stackTrace = JvNewByteArray (n * sizeof p[0]);
memcpy (elements (stackTrace), p+1, (n * sizeof p[0]));
}
@@ -83,8 +75,9 @@ java::lang::Throwable::printRawStackTrace (java::io::PrintWriter *wr)
if (!stackTrace)
return;
- void **p = (void **)elements (stackTrace);
- int depth = stackTrace->length / sizeof p[0];
+ int depth = stackTrace->length / sizeof (void *);
+ void *p[depth];
+ memcpy (p, elements (stackTrace), sizeof p);
_Jv_name_finder finder (_Jv_ThisExecutable ());
diff --git a/libjava/java/lang/reflect/Constructor.java b/libjava/java/lang/reflect/Constructor.java
index 77c437e24fa..2d527c3ba75 100644
--- a/libjava/java/lang/reflect/Constructor.java
+++ b/libjava/java/lang/reflect/Constructor.java
@@ -1,6 +1,6 @@
// Constructor.java - Represents a constructor for a class.
-/* Copyright (C) 1998, 1999, 2000 Free Software Foundation
+/* Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation
This file is part of libgcj.
@@ -38,6 +38,8 @@ public final class Constructor extends AccessibleObject implements Member
public Class[] getExceptionTypes ()
{
+ if (exception_types == null)
+ getType();
return (Class[]) exception_types.clone();
}
diff --git a/libjava/java/lang/reflect/Method.java b/libjava/java/lang/reflect/Method.java
index 119a56f2141..e616670e587 100644
--- a/libjava/java/lang/reflect/Method.java
+++ b/libjava/java/lang/reflect/Method.java
@@ -1,6 +1,6 @@
// Method.java - Represent method of class or interface.
-/* Copyright (C) 1998, 1999, 2000 Free Software Foundation
+/* Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation
This file is part of libgcj.
@@ -39,6 +39,8 @@ public final class Method extends AccessibleObject implements Member
public Class[] getExceptionTypes ()
{
+ if (exception_types == null)
+ getType();
return (Class[]) exception_types.clone();
}
diff --git a/libjava/java/lang/reflect/natConstructor.cc b/libjava/java/lang/reflect/natConstructor.cc
index a8da794bdb8..2209ad9fa64 100644
--- a/libjava/java/lang/reflect/natConstructor.cc
+++ b/libjava/java/lang/reflect/natConstructor.cc
@@ -34,6 +34,10 @@ java::lang::reflect::Constructor::getType ()
declaringClass,
&parameter_types,
NULL);
+
+ // FIXME: for now we have no way to get exception information.
+ exception_types =
+ (JArray<jclass> *) JvNewObjectArray (0, &java::lang::Class::class$, NULL);
}
jobject
diff --git a/libjava/java/lang/reflect/natField.cc b/libjava/java/lang/reflect/natField.cc
index 57421d690b4..0aedc4ea363 100644
--- a/libjava/java/lang/reflect/natField.cc
+++ b/libjava/java/lang/reflect/natField.cc
@@ -1,6 +1,6 @@
// natField.cc - Implementation of java.lang.reflect.Field native methods.
-/* Copyright (C) 1998, 1999, 2000 Free Software Foundation
+/* Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation
This file is part of libgcj.
@@ -44,17 +44,8 @@ jclass
java::lang::reflect::Field::getType ()
{
jfieldID fld = _Jv_FromReflectedField (this);
- if (! fld->isResolved())
- {
- JvSynchronize sync (declaringClass);
- if (! fld->isResolved())
- {
- fld->type
- = _Jv_FindClassFromSignature(((Utf8Const*) (fld->type))->data,
- declaringClass->getClassLoader());
- fld->flags &= ~_Jv_FIELD_UNRESOLVED_FLAG;
- }
- }
+ JvSynchronize sync (declaringClass);
+ _Jv_ResolveField (fld, declaringClass->getClassLoader ());
return fld->type;
}
diff --git a/libjava/java/math/BigInteger.java b/libjava/java/math/BigInteger.java
index 0d8608eecc3..1d848d13e8f 100644
--- a/libjava/java/math/BigInteger.java
+++ b/libjava/java/math/BigInteger.java
@@ -794,13 +794,7 @@ public class BigInteger extends Number implements Comparable
xwords[xlen++] = 0;
MPN.divide(xwords, xlen, ywords, ylen);
rlen = ylen;
- if (remainder != null || rounding_mode != TRUNCATE)
- {
- if (nshift == 0)
- System.arraycopy(xwords, 0, ywords, 0, rlen);
- else
- MPN.rshift(ywords, xwords, 0, rlen, nshift);
- }
+ MPN.rshift0 (ywords, xwords, 0, rlen, nshift);
qlen = xlen + 1 - ylen;
if (quotient != null)
@@ -810,6 +804,12 @@ public class BigInteger extends Number implements Comparable
}
}
+ if (ywords[rlen-1] < 0)
+ {
+ ywords[rlen] = 0;
+ rlen++;
+ }
+
// Now the quotient is in xwords, and the remainder is in ywords.
boolean add_one = false;
@@ -1399,15 +1399,10 @@ public class BigInteger extends Number implements Comparable
{
if (words == null || words.length < d_len)
realloc(d_len);
- if (count == 0)
- System.arraycopy(x.words, word_count, words, 0, d_len);
- else
- {
- MPN.rshift(words, x.words, word_count, d_len, count);
- if (neg)
- words[d_len-1] |= -1 << (32 - count);
- }
+ MPN.rshift0 (words, x.words, word_count, d_len, count);
ival = d_len;
+ if (neg)
+ words[d_len-1] |= -1 << (32 - count);
}
}
}
diff --git a/libjava/java/net/URLStreamHandler.java b/libjava/java/net/URLStreamHandler.java
index 0060b4ea688..2b646b44a29 100644
--- a/libjava/java/net/URLStreamHandler.java
+++ b/libjava/java/net/URLStreamHandler.java
@@ -111,7 +111,7 @@ public abstract class URLStreamHandler
if (previous >= 0)
file = file.substring(0, previous) + file.substring(index + 3);
else
- file = file.substring(index + 3);
+ break;
}
u.set(u.getProtocol(), host, port, file, u.getRef());
diff --git a/libjava/java/net/natInetAddress.cc b/libjava/java/net/natInetAddress.cc
index 68a0b411828..627fd3c6eea 100644
--- a/libjava/java/net/natInetAddress.cc
+++ b/libjava/java/net/natInetAddress.cc
@@ -118,7 +118,7 @@ java::net::InetAddress::aton (jstring host)
blen = 4;
}
#endif
-#ifdef HAVE_INET_PTON
+#if defined (HAVE_INET_PTON) && defined (HAVE_INET6)
char inet6_addr[16];
if (len == 0 && inet_pton (AF_INET6, hostname, inet6_addr) > 0)
{
diff --git a/libjava/java/net/natPlainDatagramSocketImpl.cc b/libjava/java/net/natPlainDatagramSocketImpl.cc
index a90d2a8e8e0..7aaa0668be7 100644
--- a/libjava/java/net/natPlainDatagramSocketImpl.cc
+++ b/libjava/java/net/natPlainDatagramSocketImpl.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999, 2000 Free Software Foundation
+/* Copyright (C) 1999, 2000, 2001 Free Software Foundation
This file is part of libgcj.
@@ -36,6 +36,18 @@ details. */
#include <bstring.h>
#endif
+// Avoid macro definitions of bind from system headers, e.g. on
+// Solaris 7 with _XOPEN_SOURCE. FIXME
+static inline int
+_Jv_bind (int fd, struct sockaddr *addr, int addrlen)
+{
+ return ::bind (fd, addr, addrlen);
+}
+
+#ifdef bind
+#undef bind
+#endif
+
#include <gcj/cni.h>
#include <java/io/IOException.h>
#include <java/io/FileDescriptor.h>
@@ -146,7 +158,7 @@ union McastReq
#if HAVE_STRUCT_IP_MREQ
struct ip_mreq mreq;
#endif
-#ifdef HAVE_INET6
+#if HAVE_STRUCT_IPV6_MREQ
struct ipv6_mreq mreq6;
#endif
};
@@ -210,7 +222,7 @@ java::net::PlainDatagramSocketImpl::bind (jint lport,
else
throw new java::net::SocketException (JvNewStringUTF ("invalid length"));
- if (::bind (fnum, ptr, len) == 0)
+ if (_Jv_bind (fnum, ptr, len) == 0)
{
socklen_t addrlen = sizeof(u);
if (lport != 0)
@@ -411,11 +423,20 @@ java::net::PlainDatagramSocketImpl::mcastGrp (java::net::InetAddress *inetaddr,
ptr = (const char *) &u.mreq;
}
#endif
-#ifdef HAVE_INET6
+#if HAVE_STRUCT_IPV6_MREQ
else if (len == 16)
{
level = IPPROTO_IPV6;
- opname = join ? IPV6_ADD_MEMBERSHIP : IPV6_DROP_MEMBERSHIP;
+
+ /* Prefer new RFC 2553 names. */
+#ifndef IPV6_JOIN_GROUP
+#define IPV6_JOIN_GROUP IPV6_ADD_MEMBERSHIP
+#endif
+#ifndef IPV6_LEAVE_GROUP
+#define IPV6_LEAVE_GROUP IPV6_DROP_MEMBERSHIP
+#endif
+
+ opname = join ? IPV6_JOIN_GROUP : IPV6_LEAVE_GROUP;
memcpy (&u.mreq6.ipv6mr_multiaddr, bytes, len);
// FIXME: If a non-default interface is set, use it; see Stevens p. 501.
// Maybe not, see note in last paragraph at bottom of Stevens p. 497.
@@ -510,7 +531,8 @@ java::net::PlainDatagramSocketImpl::setOption (jint optID,
len = sizeof (struct in_addr);
ptr = (const char *) &u.addr;
}
-#ifdef HAVE_INET6
+// Tru64 UNIX V5.0 has struct sockaddr_in6, but no IPV6_MULTICAST_IF
+#if defined (HAVE_INET6) && defined (IPV6_MULTICAST_IF)
else if (len == 16)
{
level = IPPROTO_IPV6;
diff --git a/libjava/java/net/natPlainSocketImpl.cc b/libjava/java/net/natPlainSocketImpl.cc
index 751b79821e2..31f11fdf0c7 100644
--- a/libjava/java/net/natPlainSocketImpl.cc
+++ b/libjava/java/net/natPlainSocketImpl.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998, 1999, 2000 Free Software Foundation
+/* Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation
This file is part of libgcj.
@@ -33,6 +33,43 @@ details. */
#include <bstring.h>
#endif
+#ifndef HAVE_SOCKLEN_T
+typedef int socklen_t;
+#endif
+
+// Avoid macro definitions of bind, connect from system headers, e.g. on
+// Solaris 7 with _XOPEN_SOURCE. FIXME
+static inline int
+_Jv_bind (int fd, struct sockaddr *addr, int addrlen)
+{
+ return ::bind (fd, addr, addrlen);
+}
+
+#ifdef bind
+#undef bind
+#endif
+
+static inline int
+_Jv_connect (int fd, struct sockaddr *addr, int addrlen)
+{
+ return ::connect (fd, addr, addrlen);
+}
+
+#ifdef connect
+#undef connect
+#endif
+
+// Same problem with accept on Tru64 UNIX with _POSIX_PII_SOCKET
+static inline int
+_Jv_accept (int fd, struct sockaddr *addr, socklen_t *addrlen)
+{
+ return ::accept (fd, addr, addrlen);
+}
+
+#ifdef accept
+#undef accept
+#endif
+
#include <gcj/cni.h>
#include <gcj/javaprims.h>
#include <java/io/IOException.h>
@@ -104,10 +141,6 @@ java::net::PlainSocketImpl::getOption (jint)
#else /* DISABLE_JAVA_NET */
-#ifndef HAVE_SOCKLEN_T
-typedef int socklen_t;
-#endif
-
union SockAddr
{
struct sockaddr_in address;
@@ -164,7 +197,7 @@ java::net::PlainSocketImpl::bind (java::net::InetAddress *host, jint lport)
// Enable SO_REUSEADDR, so that servers can reuse ports left in TIME_WAIT.
::setsockopt(fnum, SOL_SOCKET, SO_REUSEADDR, (char *) &i, sizeof(i));
- if (::bind (fnum, ptr, len) == 0)
+ if (_Jv_bind (fnum, ptr, len) == 0)
{
address = host;
socklen_t addrlen = sizeof(u);
@@ -209,7 +242,7 @@ java::net::PlainSocketImpl::connect (java::net::InetAddress *host, jint rport)
else
throw new java::net::SocketException (JvNewStringUTF ("invalid length"));
- if (::connect (fnum, ptr, len) != 0)
+ if (_Jv_connect (fnum, ptr, len) != 0)
goto error;
address = host;
port = rport;
@@ -261,7 +294,7 @@ java::net::PlainSocketImpl::accept (java::net::PlainSocketImpl *s)
JvNewStringUTF("Accept timed out"));
}
- new_socket = ::accept (fnum, (sockaddr*) &u, &addrlen);
+ new_socket = _Jv_accept (fnum, (sockaddr*) &u, &addrlen);
if (new_socket < 0)
goto error;
jbyteArray raddr;
diff --git a/libjava/java/text/MessageFormat.java b/libjava/java/text/MessageFormat.java
index 2cd6386a00c..bb2a4c3592a 100644
--- a/libjava/java/text/MessageFormat.java
+++ b/libjava/java/text/MessageFormat.java
@@ -88,7 +88,7 @@ final class MessageFormatElement
int val = DateFormat.DEFAULT;
if (style == null)
;
- if (style.equals("short"))
+ else if (style.equals("short"))
val = DateFormat.SHORT;
else if (style.equals("medium"))
val = DateFormat.MEDIUM;
diff --git a/libjava/java/text/SimpleDateFormat.java b/libjava/java/text/SimpleDateFormat.java
index 50cd99b91ea..527fcc87ada 100644
--- a/libjava/java/text/SimpleDateFormat.java
+++ b/libjava/java/text/SimpleDateFormat.java
@@ -482,679 +482,228 @@ public class SimpleDateFormat extends DateFormat
buffer.append(valStr);
}
- private int indexInArray(String dateStr, int index, String[] values) {
- int l1 = dateStr.length()-index;
- int l2;
-
- for (int i=0; i < values.length; i++) {
- if (values[i] == null)
- continue;
-
- l2 = values[i].length();
- //System.err.println(values[i] + " " + dateStr.substring(index,index+l2));
- if ((l1 >= l2) && (dateStr.substring(index,index+l2).equals(values[i])))
- return i;
- }
- return -1;
- }
-
- /*
- * Get the actual year value, converting two digit years if necessary.
- */
- private int processYear(int val)
+ private final boolean expect (String source, ParsePosition pos, char ch)
{
- if (val > 100)
- return val;
-
- Date d = get2DigitYearStart();
- Calendar c = Calendar.getInstance();
- c.setTime(d);
- int y = c.get(YEAR_FIELD);
-
- return ((y / 100) * 100) + val;
- }
-
- /*
- * Ok, we ignore the format string and just try to parse what we can
- * out of the string. We need, month, day, year at a minimum. The real
- * killer is stuff like XX/XX/XX. How do we interpret that? Is is the
- * US style MM/DD/YY or the European style DD/MM/YY. Or is it YYYY/MM/DD?
- * I'm an American, so I guess you know which one I'm choosing....
- */
- private Date parseLenient(String dateStr, ParsePosition pos)
- {
- int month = -1;
- int day = -1;
- int year = -1;
- int era = -1;
- int hour = -1;
- int hour24 = -1;
- int minute = -1;
- int second = -1;
- int millis = -1;
- int ampm = -1;
- int last = -1;
- TimeZone tz = null;
- char lastsep = ' ';
- char nextchar = ' ';
-
- Calendar cal = (Calendar)calendar.clone();
- cal.clear();
- cal.setTime(new Date(0));
-
- int index = pos.getIndex();
- String buf = dateStr.substring(index, dateStr.length());
-
- top:
- for(;;)
- {
-
- // Are we at the end of the string? If so, make sure we have
- // enough data and return. // FIXME: Also detect sufficient data
- // and return by setting buf to "" on an unparsible string.
- if (buf.equals(""))
- {
- pos.setIndex(index);
-
- // This is the minimum we need
- if ((month == -1) || (day == -1) || (year == -1))
- {
- pos.setErrorIndex(index);
- return null;
- }
-
- if (tz != null)
- cal.setTimeZone(tz);
-
- cal.set(Calendar.YEAR, year);
- cal.set(Calendar.MONTH, month - 1);
- cal.set(Calendar.DATE, day);
-
- if (ampm == 0)
- cal.set(Calendar.AM_PM, Calendar.AM);
- else if (ampm == 1)
- cal.set(Calendar.AM_PM, Calendar.PM);
-
- // If am/pm not set, we assume 24 hour day
- if (hour != -1)
- {
- if (ampm == -1)
- cal.set(Calendar.HOUR_OF_DAY, hour);
- else
- {
- if (ampm == 0)
- {
- if (hour == 12)
- hour = 0;
- }
- else
- {
- if (hour != 12)
- hour += 12;
- }
-
- cal.set(Calendar.HOUR_OF_DAY, hour);
- }
- }
-
- if (minute != -1)
- cal.set(Calendar.MINUTE, minute);
-
- if (second != -1)
- cal.set(Calendar.SECOND, second);
-
- if (millis != -1)
- cal.set(Calendar.MILLISECOND, millis);
-
- if (era == 0)
- cal.set(Calendar.ERA, GregorianCalendar.BC);
- else if (era == 1)
- cal.set(Calendar.ERA, GregorianCalendar.AD);
-
- return cal.getTime();
- }
-
- // Skip over whitespace and expected punctuation
- char c = buf.charAt(0);
- boolean comma_found = false;
- while(Character.isWhitespace(c) || (c == ':') ||
- (c == ',') || (c == '.') || (c == '/'))
- {
- lastsep = c;
- if (c == ',') // This is a total and utter crock
- comma_found = true;
- buf = buf.substring(1);
- if (buf.equals(""))
- continue;
- c = buf.charAt(0);
- }
-
- if (comma_found == true)
- lastsep = ',';
-
- // Is it a month name?
- for (int i = 0; i < formatData.months.length; i++)
- if ((formatData.months[i] != null)
- && buf.startsWith(formatData.months[i]))
- {
- month = i + 1;
- buf = buf.substring(formatData.months[i].length());
- index += formatData.months[i].length();
- last = MONTH_FIELD;
- continue top;
- }
-
- // Is it a short month name?
- for (int i = 0; i < formatData.shortMonths.length; i++)
- if ((formatData.shortMonths[i] != null)
- && buf.startsWith(formatData.shortMonths[i]))
- {
- month = i + 1;
- buf = buf.substring(formatData.shortMonths[i].length());
- index += formatData.shortMonths[i].length();
- last = MONTH_FIELD;
- continue top;
- }
-
- // Is it a weekday name?
- for (int i = 0; i < formatData.weekdays.length; i++)
- if ((formatData.weekdays[i] != null)
- && buf.startsWith(formatData.weekdays[i]))
- {
- buf = buf.substring(formatData.weekdays[i].length());
- index += formatData.weekdays[i].length();
- last = DAY_OF_WEEK_FIELD;
- continue top;
- }
-
- // Is it a short weekday name?
- for (int i = 0; i < formatData.shortWeekdays.length; i++)
- if ((formatData.shortWeekdays[i] != null)
- && buf.startsWith(formatData.shortWeekdays[i]))
- {
- buf = buf.substring(formatData.shortWeekdays[i].length());
- index += formatData.shortWeekdays[i].length();
- last = DAY_OF_WEEK_FIELD;
- continue top;
- }
-
- // Is this an am/pm string?
- for (int i = 0; i < formatData.ampms.length; i++) {
- if ((formatData.ampms[i] != null)
- && buf.toLowerCase().startsWith(formatData.ampms[i].toLowerCase()))
- {
- ampm = i;
- buf = buf.substring(formatData.ampms[i].length());
- index += formatData.ampms[i].length();
- last = AM_PM_FIELD;
- continue top;
- }
- }
-
- // See if we have a number
- c = buf.charAt(0);
- String nbrstr = "";
- while (Character.isDigit(c))
- {
- nbrstr = nbrstr + c;
- buf = buf.substring(1);
- if (buf.equals(""))
- break;
- c = buf.charAt(0);
- }
-
- // If we didn't get a number, try for a timezone, otherwise set buf
- // to "" and loop to see if we are done.
- if (nbrstr.equals(""))
- {
- // Ok, try for a timezone name
- while(!Character.isWhitespace(c) && (c != ',') && (c != '.') &&
- (c != ':') && (c != '/'))
- {
- nbrstr = nbrstr + c;
- buf = buf.substring(1);
- if (buf.equals(""))
- break;
- c = buf.charAt(0);
- }
- TimeZone tmptz = TimeZone.getTimeZone(nbrstr);
-
- // We get GMT on failure, so be sure we asked for it.
- if (tmptz.getID().equals("GMT"))
- {
- if (!nbrstr.equals("GMT"))
- {
- buf = "";
- continue top;
- }
- }
-
- tz = tmptz;
- last = TIMEZONE_FIELD;
- index += nbrstr.length();
- continue top;
- }
-
- // Convert to integer
- int val = 0;
- try
- {
- val = Integer.parseInt(nbrstr);
- }
- catch(Exception e)
- {
- return null; // Shouldn't happen
- }
-
- if (!buf.equals(""))
- nextchar = buf.charAt(0);
- else
- nextchar = ' ';
-
- // Figure out which value to assign to
- // I make bad US assumptions about MM/DD/YYYY
- if (last == DAY_OF_WEEK_FIELD)
- {
- day = val;
- last = DATE_FIELD;
- }
- else if ((last == MONTH_FIELD) && (day != -1))
- {
- year = processYear(val);
- last = YEAR_FIELD;
- }
- else if (last == MONTH_FIELD)
- {
- day = val;
- last = DATE_FIELD;
- }
- else if (last == -1)
- {
- // Assume month
- if ((val < 13) && (val > 0))
- {
- month = val;
- last = MONTH_FIELD;
- }
- // Assume year. This only works for two digit years that aren't
- // between 01 and 12
- else
- {
- year = processYear(val);
- last = YEAR_FIELD;
- }
- }
- else if ((last == YEAR_FIELD) && ((nextchar == '/') ||
- (nextchar == '.')))
- {
- month = val;
- last = MONTH_FIELD;
- }
- else if (last == YEAR_FIELD)
- {
- hour = val;
- last = HOUR0_FIELD;
- }
- else if ((last == DATE_FIELD) && ((nextchar == '/') ||
- (nextchar == '.') || buf.equals("")))
- {
- year = processYear(val);
- last = YEAR_FIELD;
- }
- else if ((last == DATE_FIELD) && ((lastsep == '/') ||
- (lastsep == '.') || (lastsep == ',')))
- {
- year = processYear(val);
- last = YEAR_FIELD;
- }
- else if (last == DATE_FIELD)
- {
- hour = val;
- last = HOUR0_FIELD;
- }
- else if (last == HOUR0_FIELD)
- {
- minute = val;
- last = MINUTE_FIELD;
- }
- else if (last == MINUTE_FIELD)
- {
- second = val;
- last = SECOND_FIELD;
- }
- else if (lastsep == '.')
- {
- ; // This is milliseconds or something. Ignore it
- last = WEEK_OF_YEAR_FIELD; // Just a random value
- }
- else // It is year. I have spoken!
- {
- year = processYear(val);
- last = YEAR_FIELD;
- }
- }
- }
-
- private int parseLeadingZeros(String dateStr, ParsePosition pos,
- FieldSizePair p)
- {
- int value;
- int index = pos.getIndex();
- String buf = null;
-
- if (p.size == 1)
- {
- char c = dateStr.charAt(index+1);
- if ((dateStr.charAt(index) == '1') &&
- Character.isDigit(dateStr.charAt(index+1)))
- buf = dateStr.substring(index, index+2);
- else
- buf = dateStr.substring(index, index+1);
- pos.setIndex(index + buf.length());
- }
- else if (p.size == 2)
- {
- buf = dateStr.substring(index, index+2);
- pos.setIndex(index+2);
- }
- else if (p.size == 3)
- {
- buf = dateStr.substring(index, index+3);
- pos.setIndex(index+3);
- }
+ int x = pos.getIndex();
+ boolean r = x < source.length() && source.charAt(x) == ch;
+ if (r)
+ pos.setIndex(x + 1);
else
- {
- buf = dateStr.substring(index, index+4);
- pos.setIndex(index+4);
- }
- try
- {
- value = Integer.parseInt(buf);
- }
- catch(NumberFormatException nfe)
- {
- pos.setIndex(index);
- pos.setErrorIndex(index);
- return -1;
- }
-
- return value;
+ pos.setErrorIndex(x);
+ return r;
}
- /*
- * Note that this method doesn't properly protect against
- * StringIndexOutOfBoundsException. FIXME
+ /**
+ * This method parses the specified string into a date.
+ *
+ * @param dateStr The date string to parse.
+ * @param pos The input and output parse position
+ *
+ * @return The parsed date, or <code>null</code> if the string cannot be
+ * parsed.
*/
- private Date parseStrict(String dateStr, ParsePosition pos)
+ public Date parse (String dateStr, ParsePosition pos)
{
- // start looking at position pos.index
- Enumeration e = tokens.elements();
- Calendar theCalendar = (Calendar) calendar.clone();
- theCalendar.clear();
- theCalendar.setTime(new Date(0));
-
- int value, index, hour = -1;
- String buf;
- while (pos.getIndex() < dateStr.length()) {
- Object o = e.nextElement();
- if (o instanceof FieldSizePair) {
- FieldSizePair p = (FieldSizePair) o;
- switch (p.field) {
+ int fmt_index = 0;
+ int fmt_max = pattern.length();
- case ERA_FIELD:
- value = indexInArray(dateStr,pos.getIndex(),formatData.eras);
- if (value == -1) {
- pos.setErrorIndex(pos.getIndex());
- return null;
+ calendar.clear();
+ int quote_start = -1;
+ for (; fmt_index < fmt_max; ++fmt_index)
+ {
+ char ch = pattern.charAt(fmt_index);
+ if (ch == '\'')
+ {
+ int index = pos.getIndex();
+ if (fmt_index < fmt_max - 1
+ && pattern.charAt(fmt_index + 1) == '\'')
+ {
+ if (! expect (dateStr, pos, ch))
+ return null;
+ ++fmt_index;
+ }
+ else
+ quote_start = quote_start < 0 ? fmt_index : -1;
+ continue;
}
- pos.setIndex(pos.getIndex() + formatData.eras[value].length());
- theCalendar.set(Calendar.ERA,value);
- break;
- case YEAR_FIELD:
- String y;
- if (p.size < 4)
- y = dateStr.substring(pos.getIndex(), pos.getIndex() + 2);
- else
- y = dateStr.substring(pos.getIndex(), pos.getIndex() + 4);
-
- int year;
- try
- {
- year = Integer.parseInt(y);
- }
- catch(NumberFormatException nfe)
- {
- pos.setErrorIndex(pos.getIndex());
- return null;
- }
-
- if (p.size < 4)
- year += get2DigitYearStart().getYear();
-
- theCalendar.set(Calendar.YEAR, year);
- if (p.size < 4)
- pos.setIndex(pos.getIndex()+2);
- else
- pos.setIndex(pos.getIndex()+4);
- break;
-
- case MONTH_FIELD:
- if (p.size > 2)
- {
- index = pos.getIndex();
-
- value = indexInArray(dateStr,pos.getIndex(),
- (p.size == 3) ? formatData.shortMonths : formatData.months);
- if (value == -1)
- {
- pos.setErrorIndex(pos.getIndex());
- return null;
- }
- if (p.size == 3)
- pos.setIndex(index + formatData.shortMonths[value].length());
- else
- pos.setIndex(index + formatData.months[value].length());
- theCalendar.set(Calendar.MONTH, value);
- break;
- }
-
- value = parseLeadingZeros(dateStr, pos, p);
- if (value == -1)
- return null;
-
- theCalendar.set(Calendar.MONTH, value);
- break;
-
- case DATE_FIELD:
- value = parseLeadingZeros(dateStr, pos, p);
- if (value == -1)
- return null;
-
- theCalendar.set(Calendar.DATE, value);
- break;
-
- case HOUR_OF_DAY1_FIELD:
- case HOUR_OF_DAY0_FIELD:
- index = pos.getIndex();
- buf = dateStr.substring(index, index+2);
- try
- {
- value = Integer.parseInt(buf);
- }
- catch(NumberFormatException nfe)
- {
- return null;
- }
- if (p.field == HOUR_OF_DAY0_FIELD)
- // theCalendar.set(Calendar.HOUR_OF_DAY, value);
- hour = value + 1;
- else
- // theCalendar.set(Calendar.HOUR_OF_DAY, value-1);
- hour = value;
- pos.setIndex(index+2);
-
- break;
-
- case MINUTE_FIELD:
- value = parseLeadingZeros(dateStr, pos, p);
- if (value == -1)
- return null;
-
- theCalendar.set(Calendar.MINUTE, value);
- break;
-
- case SECOND_FIELD:
- value = parseLeadingZeros(dateStr, pos, p);
- if (value == -1)
- return null;
-
- theCalendar.set(Calendar.SECOND, value);
- break;
-
- case MILLISECOND_FIELD:
- value = parseLeadingZeros(dateStr, pos, p);
- if (value == -1)
- return null;
-
- theCalendar.set(Calendar.MILLISECOND, value);
- break;
-
- case DAY_OF_WEEK_FIELD:
- value = indexInArray(dateStr,pos.getIndex(),(p.size < 4) ? formatData.shortWeekdays : formatData.weekdays);
- if (value == -1) {
- pos.setErrorIndex(pos.getIndex());
- return null;
+ if (quote_start != -1
+ || ((ch < 'a' || ch > 'z')
+ && (ch < 'A' || ch > 'Z')))
+ {
+ if (! expect (dateStr, pos, ch))
+ return null;
+ continue;
}
- pos.setIndex(pos.getIndex() + ((p.size < 4) ? formatData.shortWeekdays[value].length()
- : formatData.weekdays[value].length()));
- // Note: Calendar.set(Calendar.DAY_OF_WEEK,value) does not work
- // as implemented in jdk1.1.5 (possibly DAY_OF_WEEK is meant to
- // be read-only). Instead, calculate number of days offset.
- theCalendar.add(Calendar.DATE,value
- - theCalendar.get(Calendar.DAY_OF_WEEK));
- // in JDK, this seems to clear the hours, so we'll do the same.
- theCalendar.set(Calendar.HOUR_OF_DAY,0);
- break;
-
- case DAY_OF_YEAR_FIELD:
- value = parseLeadingZeros(dateStr, pos, p);
- if (value == -1)
- return null;
-
- theCalendar.set(Calendar.DAY_OF_YEAR, value);
- break;
-
- // Just parse and ignore
- case DAY_OF_WEEK_IN_MONTH_FIELD:
- value = parseLeadingZeros(dateStr, pos, p);
- if (value == -1)
- return null;
-
- break;
-
- // Just parse and ignore
- case WEEK_OF_YEAR_FIELD:
- value = parseLeadingZeros(dateStr, pos, p);
- if (value == -1)
- return null;
-
- break;
-
- // Just parse and ignore
- case WEEK_OF_MONTH_FIELD:
- value = parseLeadingZeros(dateStr, pos, p);
- if (value == -1)
- return null;
-
- break;
- case AM_PM_FIELD:
- value = indexInArray(dateStr,pos.getIndex(),formatData.ampms);
- if (value == -1) {
+ // We've arrived at a potential pattern character in the
+ // pattern.
+ int first = fmt_index;
+ while (++fmt_index < fmt_max && pattern.charAt(fmt_index) == ch)
+ ;
+ int count = fmt_index - first;
+ --fmt_index;
+
+ // We can handle most fields automatically: most either are
+ // numeric or are looked up in a string vector. In some cases
+ // we need an offset. When numeric, `offset' is added to the
+ // resulting value. When doing a string lookup, offset is the
+ // initial index into the string array.
+ int calendar_field;
+ boolean is_numeric = true;
+ String[] match = null;
+ int offset = 0;
+ int zone_number = 0;
+ switch (ch)
+ {
+ case 'd':
+ calendar_field = Calendar.DATE;
+ break;
+ case 'D':
+ calendar_field = Calendar.DAY_OF_YEAR;
+ break;
+ case 'F':
+ calendar_field = Calendar.DAY_OF_WEEK_IN_MONTH;
+ break;
+ case 'E':
+ is_numeric = false;
+ offset = 1;
+ calendar_field = Calendar.DAY_OF_WEEK;
+ match = (count <= 3
+ ? formatData.getShortWeekdays()
+ : formatData.getWeekdays());
+ break;
+ case 'w':
+ calendar_field = Calendar.WEEK_OF_YEAR;
+ break;
+ case 'W':
+ calendar_field = Calendar.WEEK_OF_MONTH;
+ break;
+ case 'M':
+ calendar_field = Calendar.MONTH;
+ if (count <= 2)
+ offset = -1;
+ else
+ {
+ is_numeric = false;
+ match = (count <= 3
+ ? formatData.getShortMonths()
+ : formatData.getMonths());
+ }
+ break;
+ case 'y':
+ calendar_field = Calendar.YEAR;
+ if (count <= 2)
+ offset = 1900;
+ break;
+ case 'K':
+ calendar_field = Calendar.HOUR;
+ break;
+ case 'h':
+ calendar_field = Calendar.HOUR;
+ break;
+ case 'H':
+ calendar_field = Calendar.HOUR_OF_DAY;
+ break;
+ case 'k':
+ calendar_field = Calendar.HOUR_OF_DAY;
+ break;
+ case 'm':
+ calendar_field = Calendar.MINUTE;
+ break;
+ case 's':
+ calendar_field = Calendar.SECOND;
+ break;
+ case 'S':
+ calendar_field = Calendar.MILLISECOND;
+ break;
+ case 'a':
+ is_numeric = false;
+ calendar_field = Calendar.AM_PM;
+ match = formatData.getAmPmStrings();
+ break;
+ case 'z':
+ // We need a special case for the timezone, because it
+ // uses a different data structure than the other cases.
+ is_numeric = false;
+ calendar_field = Calendar.DST_OFFSET;
+ String[][] zoneStrings = formatData.getZoneStrings();
+ int zoneCount = zoneStrings.length;
+ int index = pos.getIndex();
+ boolean found_zone = false;
+ for (int j = 0; j < zoneCount; j++)
+ {
+ String[] strings = zoneStrings[j];
+ int k;
+ for (k = 1; k < strings.length; ++k)
+ {
+ if (dateStr.startsWith(strings[k], index))
+ break;
+ }
+ if (k != strings.length)
+ {
+ if (k > 2)
+ ; // FIXME: dst.
+ zone_number = 0; // FIXME: dst.
+ // FIXME: raw offset to SimpleTimeZone const.
+ calendar.setTimeZone(new SimpleTimeZone (1, strings[0]));
+ pos.setIndex(index + strings[k].length());
+ break;
+ }
+ }
+ if (! found_zone)
+ {
+ pos.setErrorIndex(pos.getIndex());
+ return null;
+ }
+ break;
+ default:
pos.setErrorIndex(pos.getIndex());
return null;
}
- pos.setIndex(pos.getIndex() + formatData.ampms[value].length());
- theCalendar.set(Calendar.AM_PM,value);
- break;
-
- case HOUR1_FIELD:
- case HOUR0_FIELD:
- value = parseLeadingZeros(dateStr, pos, p);
- if (value == -1)
- return null;
- if (p.field == HOUR1_FIELD)
- theCalendar.set(Calendar.HOUR, value);
- if (p.field == HOUR0_FIELD)
- theCalendar.set(Calendar.HOUR, value+1);
- break;
- /*
- case TIMEZONE_FIELD:
- // TODO: FIXME: XXX
- break;
- */
+ // Compute the value we should assign to the field.
+ int value;
+ if (is_numeric)
+ {
+ numberFormat.setMinimumIntegerDigits(count);
+ Number n = numberFormat.parse(dateStr, pos);
+ if (pos == null || ! (n instanceof Long))
+ return null;
+ value = n.intValue() + offset;
+ }
+ else if (match != null)
+ {
+ int index = pos.getIndex();
+ int i;
+ for (i = offset; i < match.length; ++i)
+ {
+ if (dateStr.startsWith(match[i], index))
+ break;
+ }
+ if (i == match.length)
+ {
+ pos.setErrorIndex(index);
+ return null;
+ }
+ pos.setIndex(index + match[i].length());
+ value = i;
+ }
+ else
+ value = zone_number;
- default:
- throw new IllegalArgumentException("Illegal pattern character: " +
- p.field);
- } // end switch
- } else if (o instanceof String) {
- String ostr = (String) o;
- if (dateStr.substring(pos.getIndex(),pos.getIndex()+ostr.length()).equals(ostr)) {
- pos.setIndex(pos.getIndex() + ostr.length());
- } else {
- pos.setErrorIndex(pos.getIndex());
- return null;
- }
- } else if (o instanceof Character) {
- Character ochar = (Character) o;
- if (dateStr.charAt(pos.getIndex()) == ochar.charValue()) {
- pos.setIndex(pos.getIndex() + 1);
- } else {
- pos.setErrorIndex(pos.getIndex());
- return null;
- }
+ // Assign the value and move on.
+ calendar.set(calendar_field, value);
}
- }
- if (hour != -1)
+ try
{
- if (theCalendar.get(Calendar.AM_PM) == Calendar.PM)
- {
- if (hour == 12)
- theCalendar.set(Calendar.HOUR_OF_DAY, 12);
- else
- theCalendar.set(Calendar.HOUR_OF_DAY, hour + 12);
- }
- else
- {
- if (hour == 12)
- theCalendar.set(Calendar.HOUR_OF_DAY, 0);
- else
- theCalendar.set(Calendar.HOUR_OF_DAY, hour);
- }
+ return calendar.getTime();
+ }
+ catch (IllegalArgumentException x)
+ {
+ pos.setErrorIndex(pos.getIndex());
+ return null;
}
-
- return theCalendar.getTime();
- }
-
- /**
- * This method parses the specified string into a date.
- *
- * @param dateStr The date string to parse.
- * @param pos The input and output parse position
- *
- * @return The parsed date, or <code>null</code> if the string cannot be
- * parsed.
- */
- public Date parse(String dateStr, ParsePosition pos) {
- if (isLenient())
- return parseLenient(dateStr, pos);
- else
- return parseStrict(dateStr, pos);
-
}
}
-
diff --git a/libjava/java/util/AbstractSequentialList.java b/libjava/java/util/AbstractSequentialList.java
index b9b8e63d1f6..81481be0466 100644
--- a/libjava/java/util/AbstractSequentialList.java
+++ b/libjava/java/util/AbstractSequentialList.java
@@ -38,7 +38,6 @@ package java.util;
*/
public abstract class AbstractSequentialList extends AbstractList
{
-
/**
* Returns a ListIterator over the list, starting from position index.
* Subclasses must provide an implementation of this method.
diff --git a/libjava/java/util/Collection.java b/libjava/java/util/Collection.java
index 46da71b1dc7..b7dbb69b1f7 100644
--- a/libjava/java/util/Collection.java
+++ b/libjava/java/util/Collection.java
@@ -1,37 +1,236 @@
-/* Copyright (C) 2000 Free Software Foundation
+/* Collection.java -- Interface that represents a collection of objects
+ Copyright (C) 1998 Free Software Foundation, Inc.
- This file is part of libgcj.
+This file is part of GNU Classpath.
-This software is copyrighted work licensed under the terms of the
-Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
-details. */
+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.
+
+As a special exception, if you link this library with other files to
+produce an executable, this library 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. */
+
+
+// TO DO:
+// ~ Maybe some more @see clauses would be helpful.
package java.util;
/**
- * @author Warren Levy <warrenl@cygnus.com>
- * @date March 16, 2000.
- */
-/* Written using on-line Java Platform 1.2 API Specification.
- * Status: Believed complete and correct.
+ * Interface that represents a collection of objects. This interface is the
+ * root of the collection hierarchy, and does not provide any guarantees about
+ * the order of its elements or whether or not duplicate elements are
+ * permitted.
+ * <p>
+ * All methods of this interface that are defined to modify the collection are
+ * defined as <dfn>optional</dfn>. An optional operation may throw an
+ * UnsupportedOperationException if the data backing this collection does not
+ * support such a modification. This may mean that the data structure is
+ * immutable, or that it is read-only but may change ("unmodifiable"), or
+ * that it is modifiable but of fixed size (such as an array), or any number
+ * of other combinations.
+ * <p>
+ * A class that wishes to implement this interface should consider subclassing
+ * AbstractCollection, which provides basic implementations of most of the
+ * methods of this interface. Classes that are prepared to make guarantees
+ * about ordering or about absence of duplicate elements should consider
+ * implementing List or Set respectively, both of which are subinterfaces of
+ * Collection.
+ * <p>
+ * A general-purpose implementation of the Collection interface should in most
+ * cases provide at least two constructors: One which takes no arguments and
+ * creates an empty collection, and one which takes a Collection as an argument
+ * and returns a collection containing the same elements (that is, creates a
+ * copy of the argument using its own implementation).
+ *
+ * @see java.util.List
+ * @see java.util.Set
+ * @see java.util.AbstractCollection
*/
-
-// JDK1.2
public interface Collection
{
- public int size();
- public boolean isEmpty();
- public boolean contains(Object o);
- public Iterator iterator();
- public Object[] toArray();
- public Object[] toArray(Object[] a);
- public boolean add(Object o);
- public boolean remove(Object o);
- public boolean containsAll(Collection c);
- public boolean addAll(Collection c);
- public boolean removeAll(Collection c);
- public boolean retainAll(Collection c);
- public void clear();
- public boolean equals(Object o);
- public int hashCode();
+ /**
+ * Add an element to this collection.
+ *
+ * @param o the object to add.
+ * @returns true if the collection was modified as a result of this action.
+ * @exception UnsupportedOperationException if this collection does not
+ * support the add operation.
+ * @exception ClassCastException if o cannot be added to this collection due
+ * to its type.
+ * @exception IllegalArgumentException if o cannot be added to this
+ * collection for some other reason.
+ */
+ boolean add(Object o);
+
+ /**
+ * Add the contents of a given collection to this collection.
+ *
+ * @param c the collection to add.
+ * @returns true if the collection was modified as a result of this action.
+ * @exception UnsupportedOperationException if this collection does not
+ * support the addAll operation.
+ * @exception ClassCastException if some element of c cannot be added to this
+ * collection due to its type.
+ * @exception IllegalArgumentException if some element of c cannot be added
+ * to this collection for some other reason.
+ */
+ boolean addAll(Collection c);
+
+ /**
+ * Clear the collection, such that a subsequent call to isEmpty() would
+ * return true.
+ *
+ * @exception UnsupportedOperationException if this collection does not
+ * support the clear operation.
+ */
+ void clear();
+
+ /**
+ * Test whether this collection contains a given object as one of its
+ * elements.
+ *
+ * @param o the element to look for.
+ * @returns true if this collection contains at least one element e such that
+ * <code>o == null ? e == null : o.equals(e)</code>.
+ */
+ boolean contains(Object o);
+
+ /**
+ * Test whether this collection contains every element in a given collection.
+ *
+ * @param c the collection to test for.
+ * @returns true if for every element o in c, contains(o) would return true.
+ */
+ boolean containsAll(Collection c);
+
+ /**
+ * Test whether this collection is equal to some object. The Collection
+ * interface does not explicitly require any behaviour from this method, and
+ * it may be left to the default implementation provided by Object. The Set
+ * and List interfaces do, however, require specific behaviour from this
+ * method.
+ * <p>
+ * If an implementation of Collection, which is not also an implementation of
+ * Set or List, should choose to implement this method, it should take care
+ * to obey the contract of the equals method of Object. In particular, care
+ * should be taken to return false when o is a Set or a List, in order to
+ * preserve the symmetry of the relation.
+ *
+ * @param o the object to compare to this collection.
+ * @returns true if the o is equal to this collection.
+ */
+ boolean equals(Object o);
+
+ /**
+ * Obtain a hash code for this collection. The Collection interface does not
+ * explicitly require any behaviour from this method, and it may be left to
+ * the default implementation provided by Object. The Set and List interfaces
+ * do, however, require specific behaviour from this method.
+ * <p>
+ * If an implementation of Collection, which is not also an implementation of
+ * Set or List, should choose to implement this method, it should take care
+ * to obey the contract of the hashCode method of Object. Note that this
+ * method renders it impossible to correctly implement both Set and List, as
+ * the required implementations are mutually exclusive.
+ *
+ * @returns a hash code for this collection.
+ */
+ int hashCode();
+
+ /**
+ * Test whether this collection is empty, that is, if size() == 0.
+ *
+ * @returns true if this collection contains no elements.
+ */
+ boolean isEmpty();
+
+ /**
+ * Obtain an Iterator over this collection.
+ *
+ * @returns an Iterator over the elements of this collection, in any order.
+ */
+ Iterator iterator();
+
+ /**
+ * Remove a single occurrence of an object from this collection. That is,
+ * remove an element e, if one exists, such that <code>o == null ? e == null
+ * : o.equals(e)</code>.
+ *
+ * @param o the object to remove.
+ * @returns true if the collection changed as a result of this call, that is,
+ * if the collection contained at least one occurrence of o.
+ * @exception UnsupportedOperationException if this collection does not
+ * support the remove operation.
+ */
+ boolean remove(Object o);
+
+ /**
+ * Remove all elements of a given collection from this collection. That is,
+ * remove every element e such that c.contains(e).
+ *
+ * @returns true if this collection was modified as a result of this call.
+ * @exception UnsupportedOperationException if this collection does not
+ * support the removeAll operation.
+ */
+ boolean removeAll(Collection c);
+
+ /**
+ * Remove all elements of this collection that are not contained in a given
+ * collection. That is, remove every element e such that !c.contains(e).
+ *
+ * @returns true if this collection was modified as a result of this call.
+ * @exception UnsupportedOperationException if this collection does not
+ * support the retainAll operation.
+ */
+ boolean retainAll(Collection c);
+
+ /**
+ * Get the number of elements in this collection.
+ *
+ * @returns the number of elements in the collection.
+ */
+ int size();
+
+ /**
+ * Copy the current contents of this collection into an array.
+ *
+ * @returns an array of type Object[] and length equal to the size of this
+ * collection, containing the elements currently in this collection, in
+ * any order.
+ */
+ Object[] toArray();
+
+ /**
+ * Copy the current contents of this collection into an array. If the array
+ * passed as an argument has length less than the size of this collection, an
+ * array of the same run-time type as a, and length equal to the size of this
+ * collection, is allocated using Reflection. Otherwise, a itself is used.
+ * The elements of this collection are copied into it, and if there is space
+ * in the array, the following element is set to null. The resultant array is
+ * returned.
+ * Note: The fact that the following element is set to null is only useful
+ * if it is known that this collection does not contain any null elements.
+ *
+ * @param a the array to copy this collection into.
+ * @returns an array containing the elements currently in this collection, in
+ * any order.
+ * @exception ArrayStoreException if the type of any element of the
+ * collection is not a subtype of the element type of a.
+ */
+ Object[] toArray(Object[] a);
}
diff --git a/libjava/java/util/Collections.java b/libjava/java/util/Collections.java
index 9035e670a86..74efdec65bf 100644
--- a/libjava/java/util/Collections.java
+++ b/libjava/java/util/Collections.java
@@ -447,7 +447,6 @@ public class Collections
// Create a minimal implementation of List
return new AbstractList()
{
-
public int size()
{
return n;
@@ -487,22 +486,25 @@ public class Collections
}
}
+ static class ReverseComparator implements Comparator, Serializable
+ {
+ public int compare(Object a, Object b)
+ {
+ return -((Comparable) a).compareTo(b);
+ }
+ }
+
+ static ReverseComparator rcInstance = new ReverseComparator();
+
/**
* Get a comparator that implements the reverse of natural ordering. This is
* intended to make it easy to sort into reverse order, by simply passing
* Collections.reverseOrder() to the sort method. The return value of this
* method is Serializable.
*/
- // The return value isn't Serializable, because the spec is broken.
public static Comparator reverseOrder()
{
- return new Comparator()
- {
- public int compare(Object a, Object b)
- {
- return -((Comparable) a).compareTo(b);
- }
- };
+ return rcInstance;
}
/**
diff --git a/libjava/java/util/Comparator.java b/libjava/java/util/Comparator.java
index 8f114ee79b0..4b09e0fdab0 100644
--- a/libjava/java/util/Comparator.java
+++ b/libjava/java/util/Comparator.java
@@ -1,24 +1,64 @@
-/* Copyright (C) 2000 Free Software Foundation
+/* Comparator.java -- Interface for objects that specify an ordering
+ Copyright (C) 1998 Free Software Foundation, Inc.
- This file is part of libgcj.
+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.
+
+As a special exception, if you link this library with other files to
+produce an executable, this library 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. */
-This software is copyrighted work licensed under the terms of the
-Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
-details. */
package java.util;
/**
- * @author Warren Levy <warrenl@cygnus.com>
- * @date March 16, 2000.
- */
-/* Written using on-line Java Platform 1.2 API Specification.
- * Status: Believed complete and correct.
+ * Interface for objects that specify an ordering between objects. The ordering
+ * can be <EM>total</EM>, such that two objects only compare equal if they are
+ * equal by the equals method, or <EM>partial</EM> such that this is not
+ * necessarily true. For example, a case-sensitive dictionary order comparison
+ * of Strings is total, but if it is case-insensitive it is partial, because
+ * "abc" and "ABC" compare as equal even though "abc".equals("ABC") returns
+ * false.
+ * <P>
+ * In general, Comparators should be Serializable, because when they are passed
+ * to Serializable data structures such as SortedMap or SortedSet, the entire
+ * data structure will only serialize correctly if the comparator is
+ * Serializable.
*/
-
-// JDK1.2
public interface Comparator
{
- public int compare(Object o1, Object o2);
- public boolean equals(Object obj);
+ /**
+ * Return an integer that is negative, zero or positive depending on whether
+ * the first argument is less than, equal to or greater than the second
+ * according to this ordering. This method should obey the following contract:
+ * <UL>
+ * <LI>if compare(a, b) &lt; 0 then compare(b, a) &gt; 0</LI>
+ * <LI>if compare(a, b) throws an exception, so does compare(b, a)</LI>
+ * <LI>if compare(a, b) &lt; 0 and compare(b, c) &lt; 0 then compare(a, c)
+ * &lt; 0</LI>
+ * <LI>if a.equals(b) or both a and b are null, then compare(a, b) == 0.
+ * The converse need not be true, but if it is, this Comparator
+ * specifies a <EM>total</EM> ordering.</LI>
+ * </UL>
+ *
+ * @throws ClassCastException if the elements are not of types that can be
+ * compared by this ordering.
+ */
+ int compare(Object o1, Object o2);
}
diff --git a/libjava/java/util/Dictionary.java b/libjava/java/util/Dictionary.java
index f127cc050fd..c39d90a81f0 100644
--- a/libjava/java/util/Dictionary.java
+++ b/libjava/java/util/Dictionary.java
@@ -1,34 +1,85 @@
-/* Copyright (C) 1998, 1999 Free Software Foundation
+/* Dictionary.java -- an abstract (and essentially worthless)
+ class which is Hashtable's superclass
+ Copyright (C) 1998 Free Software Foundation, Inc.
- This file is part of libgcj.
+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.
+
+As a special exception, if you link this library with other files to
+produce an executable, this library 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. */
-This software is copyrighted work licensed under the terms of the
-Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
-details. */
package java.util;
-
+
/**
- * @author Warren Levy <warrenl@cygnus.com>
- * @date August 31, 1998.
- */
-/* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3
- * "The Java Language Specification", ISBN 0-201-63451-1
- * plus online API docs for JDK 1.2 beta from http://www.javasoft.com.
- * Status: Believed complete and correct
- */
-
-/* The JDK 1.2 beta doc indicates that Dictionary is obsolete and that the
- * new java.util.Map interface should be used instead.
+ * A Dictionary maps keys to values; <i>how</i> it does that is
+ * implementation-specific.
+ *
+ * This is an abstract class which has really gone by the wayside.
+ * People at Javasoft are probably embarrassed by it. At this point,
+ * it might as well be an interface rather than a class, but it remains
+ * this poor, laugable skeleton for the sake of backwards compatibility.
+ * At any rate, this was what came before the <pre>Map</pre> interface
+ * in the Collections framework.
+ *
+ * @author Jon Zeppieri
+ * @version $Revision: 1.4 $
+ * @modified $Id: Dictionary.java,v 1.4 2001/02/15 06:43:00 bryce Exp $
*/
-public abstract class Dictionary
+public abstract class Dictionary extends Object
{
+ /** returns an Enumeration of the values in this Dictionary */
public abstract Enumeration elements();
- public abstract Object get(Object key) throws NullPointerException;
+
+ /**
+ * returns the value associated with the supplied key, or null
+ * if no such value exists
+ *
+ * @param key the key to use to fetch the value
+ */
+ public abstract Object get(Object key);
+
+ /** returns true IFF there are no elements in this Dictionary (size() == 0) */
public abstract boolean isEmpty();
+
+ /** returns an Enumeration of the keys in this Dictionary */
public abstract Enumeration keys();
- public abstract Object put(Object key, Object elem)
- throws NullPointerException;
- public abstract Object remove(Object key) throws NullPointerException;
+
+ /**
+ * inserts a new value into this Dictionary, located by the
+ * supllied key; note: Dictionary's subclasses (all 1 of them)
+ * do not support null keys or values (I can only assume this
+ * would have been more general)
+ *
+ * @param key the key which locates the value
+ * @param value the value to put into the Dictionary
+ */
+ public abstract Object put(Object key, Object value);
+
+ /**
+ * removes fro the Dictionary the value located by the given key
+ *
+ * @param key the key used to locate the value to be removed
+ */
+ public abstract Object remove(Object key);
+
+ /** returns the number of values currently in this Dictionary */
public abstract int size();
}
diff --git a/libjava/java/util/HashMap.java b/libjava/java/util/HashMap.java
index b7ec3b49f4d..4bc88b75570 100644
--- a/libjava/java/util/HashMap.java
+++ b/libjava/java/util/HashMap.java
@@ -60,8 +60,6 @@ import java.io.ObjectOutputStream;
* @author Jon Zeppieri
* @author Jochen Hoenicke
* @author Bryce McKinlay
- * @version $Revision: 1.3 $
- * @modified $Id: HashMap.java,v 1.3 2000/12/17 09:15:51 bryce Exp $
*/
public class HashMap extends AbstractMap
implements Map, Cloneable, Serializable
@@ -159,15 +157,19 @@ public class HashMap extends AbstractMap
* @param loadFactor the load factor
*
* @throws IllegalArgumentException if (initialCapacity < 0) ||
- * (initialLoadFactor > 1.0) ||
- * (initialLoadFactor <= 0.0)
+ * (loadFactor <= 0)
*/
public HashMap(int initialCapacity, float loadFactor)
throws IllegalArgumentException
{
- if (initialCapacity < 0 || loadFactor <= 0 || loadFactor > 1)
- throw new IllegalArgumentException();
-
+ if (initialCapacity < 0)
+ throw new IllegalArgumentException("Illegal Initial Capacity: "
+ + initialCapacity);
+ if (loadFactor <= 0)
+ throw new IllegalArgumentException("Illegal Load Factor: " + loadFactor);
+
+ if (initialCapacity == 0)
+ initialCapacity = 1;
buckets = new Entry[initialCapacity];
this.loadFactor = loadFactor;
this.threshold = (int) (initialCapacity * loadFactor);
@@ -500,7 +502,10 @@ public class HashMap extends AbstractMap
/** Return an index in the buckets array for `key' based on its hashCode() */
private int hash(Object key)
{
- return (key == null ? 0 : Math.abs(key.hashCode() % buckets.length));
+ if (key == null)
+ return 0;
+ else
+ return Math.abs(key.hashCode() % buckets.length);
}
/** Return an Entry who's key and value equal the supplied Map.Entry.
@@ -611,15 +616,11 @@ public class HashMap extends AbstractMap
}
/**
- * a class which implements the Iterator interface and is used for
- * iterating over HashMaps;
- * this implementation is parameterized to give a sequential view of
- * keys, values, or entries; it also allows the removal of elements,
- * as per the Javasoft spec.
+ * Iterate over HashMap's entries.
+ * This implementation is parameterized to give a sequential view of
+ * keys, values, or entries.
*
* @author Jon Zeppieri
- * @version $Revision: 1.3 $
- * @modified $Id: HashMap.java,v 1.3 2000/12/17 09:15:51 bryce Exp $
*/
class HashIterator implements Iterator
{
diff --git a/libjava/java/util/HashSet.java b/libjava/java/util/HashSet.java
index f7cb326e59c..147af26a9ce 100644
--- a/libjava/java/util/HashSet.java
+++ b/libjava/java/util/HashSet.java
@@ -45,8 +45,8 @@ import java.io.ObjectOutputStream;
* HashSet is a part of the JDK1.2 Collections API.
*
* @author Jon Zeppieri
- * @version $Revision: 1.5 $
- * @modified $Id: HashSet.java,v 1.5 2000/10/26 10:19:00 bryce Exp $
+ * @version $Revision: 1.4 $
+ * @modified $Id: HashSet.java,v 1.4 2001/02/16 04:50:38 bryce Exp $
*/
public class HashSet extends AbstractSet
implements Set, Cloneable, Serializable
@@ -132,12 +132,11 @@ public class HashSet extends AbstractSet
try
{
copy = (HashSet) super.clone();
- copy.map = (HashMap) map.clone();
}
- catch (CloneNotSupportedException ex)
+ catch (CloneNotSupportedException x)
{
}
-
+ copy.map = (HashMap) map.clone();
return copy;
}
diff --git a/libjava/java/util/Hashtable.java b/libjava/java/util/Hashtable.java
index 9585872fffe..4475785bbbb 100644
--- a/libjava/java/util/Hashtable.java
+++ b/libjava/java/util/Hashtable.java
@@ -64,8 +64,6 @@ import java.io.ObjectOutputStream;
* @author Jon Zeppieri
* @author Warren Levy
* @author Bryce McKinlay
- * @version $Revision: 1.9 $
- * @modified $Id: Hashtable.java,v 1.9 2000/12/17 09:15:51 bryce Exp $
*/
public class Hashtable extends Dictionary
implements Map, Cloneable, Serializable
@@ -171,15 +169,19 @@ public class Hashtable extends Dictionary
* @param loadFactor the load factor
*
* @throws IllegalArgumentException if (initialCapacity < 0) ||
- * (initialLoadFactor > 1.0) ||
* (initialLoadFactor <= 0.0)
*/
public Hashtable(int initialCapacity, float loadFactor)
throws IllegalArgumentException
{
- if (initialCapacity < 0 || loadFactor <= 0 || loadFactor > 1)
- throw new IllegalArgumentException();
+ if (initialCapacity < 0)
+ throw new IllegalArgumentException("Illegal Initial Capacity: "
+ + initialCapacity);
+ if (loadFactor <= 0)
+ throw new IllegalArgumentException("Illegal Load Factor: " + loadFactor);
+ if (initialCapacity == 0)
+ initialCapacity = 1;
buckets = new Entry[initialCapacity];
this.loadFactor = loadFactor;
this.threshold = (int) (initialCapacity * loadFactor);
@@ -721,8 +723,6 @@ public class Hashtable extends Dictionary
* as per the Javasoft spec.
*
* @author Jon Zeppieri
- * @version $Revision: 1.9 $
- * @modified $Id: Hashtable.java,v 1.9 2000/12/17 09:15:51 bryce Exp $
*/
class HashIterator implements Iterator
{
@@ -818,16 +818,15 @@ public class Hashtable extends Dictionary
* elements; this implementation is parameterized to provide access either
* to the keys or to the values in the Hashtable.
*
- * <b>NOTE: Enumeration is not safe if new elements are put in the table as
- * this could cause a rehash and we'd completely lose our place. Even
+ * <b>NOTE</b>: Enumeration is not safe if new elements are put in the table
+ * as this could cause a rehash and we'd completely lose our place. Even
* without a rehash, it is undetermined if a new element added would
* appear in the enumeration. The spec says nothing about this, but
* the "Java Class Libraries" book infers that modifications to the
* hashtable during enumeration causes indeterminate results. Don't do it!
*
* @author Jon Zeppieri
- * @version $Revision: 1.9 $
- * @modified $Id: Hashtable.java,v 1.9 2000/12/17 09:15:51 bryce Exp $ */
+ */
class Enumerator implements Enumeration
{
static final int KEYS = 0;
diff --git a/libjava/java/util/Iterator.java b/libjava/java/util/Iterator.java
index f6942fefa19..92620f8c0ac 100644
--- a/libjava/java/util/Iterator.java
+++ b/libjava/java/util/Iterator.java
@@ -1,25 +1,68 @@
-/* Copyright (C) 2000 Free Software Foundation
+/* Iterator.java -- Interface for iterating over collections
+ Copyright (C) 1998 Free Software Foundation, Inc.
- This file is part of libgcj.
+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.
+
+As a special exception, if you link this library with other files to
+produce an executable, this library 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. */
-This software is copyrighted work licensed under the terms of the
-Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
-details. */
package java.util;
/**
- * @author Warren Levy <warrenl@cygnus.com>
- * @date March 16, 2000.
+ * An object which iterates over a collection. An Iterator is used to return the
+ * items once only, in sequence, by successive calls to the next method. It is
+ * also possible to remove elements from the underlying collection by using the
+ * optional remove method. Iterator is intended as a replacement for the
+ * Enumeration interface of previous versions of Java, which did not have the
+ * remove method and had less conveniently named methods.
*/
-/* Written using on-line Java Platform 1.2 API Specification.
- * Status: Believed complete and correct.
- */
-
-// JDK1.2
public interface Iterator
{
- public boolean hasNext();
- public Object next();
- public void remove();
+ /**
+ * Tests whether there are elements remaining in the collection.
+ *
+ * @return true if there is at least one more element in the collection,
+ * that is, if the next call to next will not throw NoSuchElementException.
+ */
+ boolean hasNext();
+
+ /**
+ * Obtain the next element in the collection.
+ *
+ * @return the next element in the collection
+ * @exception NoSuchElementException if there are no more elements
+ */
+ Object next();
+
+ /**
+ * Remove from the underlying collection the last element returned by next.
+ * This method can be called only once after each call to next. It does not
+ * affect what will be returned by subsequent calls to next. This operation is
+ * optional, it may throw an UnsupportedOperationException.
+ *
+ * @exception IllegalStateException if next has not yet been called or remove
+ * has already been called since the last call to next.
+ * @exception UnsupportedOperationException if this Iterator does not support
+ * the remove operation.
+ */
+ void remove();
}
diff --git a/libjava/java/util/ListIterator.java b/libjava/java/util/ListIterator.java
index 8250e2ab01a..8a8d2c74e9d 100644
--- a/libjava/java/util/ListIterator.java
+++ b/libjava/java/util/ListIterator.java
@@ -1,31 +1,147 @@
-/* Copyright (C) 2000 Free Software Foundation
+/* ListIterator.java -- Extended Iterator for iterating over ordered lists
+ Copyright (C) 1998, 1999 Free Software Foundation, Inc.
- This file is part of libgcj.
+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.
+
+As a special exception, if you link this library with other files to
+produce an executable, this library 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. */
-This software is copyrighted work licensed under the terms of the
-Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
-details. */
package java.util;
/**
- * @author Warren Levy <warrenl@cygnus.com>
- * @date March 16, 2000.
+ * An extended version of Iterator to support the extra features of Lists. The
+ * elements may be accessed in forward or reverse order, elements may be
+ * replaced as well as removed, and new elements may be inserted, during the
+ * traversal of the list.
*/
-/* Written using on-line Java Platform 1.2 API Specification.
- * Status: Believed complete and correct.
- */
-
-// JDK1.2
public interface ListIterator extends Iterator
{
- public boolean hasNext();
- public Object next();
- public boolean hasPrevious();
- public Object previous();
- public int nextIndex();
- public int previousIndex();
- public void remove();
- public void set(Object o);
- public void add(Object o);
+ /**
+ * Tests whether there are elements remaining in the list in the forward
+ * direction.
+ *
+ * @return true if there is at least one more element in the list in the
+ * forward direction, that is, if the next call to next will not throw
+ * NoSuchElementException.
+ */
+ boolean hasNext();
+
+ /**
+ * Tests whether there are elements remaining in the list in the reverse
+ * direction.
+ *
+ * @return true if there is at least one more element in the list in the
+ * reverse direction, that is, if the next call to previous will not throw
+ * NoSuchElementException.
+ */
+ boolean hasPrevious();
+
+ /**
+ * Obtain the next element in the list in the forward direction. Repeated
+ * calls to next may be used to iterate over the entire list, or calls to next
+ * and previous may be used together to go forwards and backwards. Alternating
+ * calls to next and previous will return the same element.
+ *
+ * @return the next element in the list in the forward direction
+ * @exception NoSuchElementException if there are no more elements
+ */
+ Object next();
+
+ /**
+ * Obtain the next element in the list in the reverse direction. Repeated
+ * calls to previous may be used to iterate backwards over the entire list, or
+ * calls to next and previous may be used together to go forwards and
+ * backwards. Alternating calls to next and previous will return the same
+ * element.
+ *
+ * @return the next element in the list in the reverse direction
+ * @exception NoSuchElementException if there are no more elements
+ */
+ Object previous();
+
+ /**
+ * Find the index of the element that would be returned by a call to next.
+ *
+ * @return the index of the element that would be returned by a call to next,
+ * or list.size() if the iterator is at the end of the list.
+ */
+ int nextIndex();
+
+ /**
+ * Find the index of the element that would be returned by a call to previous.
+ *
+ * @return the index of the element that would be returned by a call to
+ * previous, or -1 if the iterator is at the beginning of the list.
+ */
+ int previousIndex();
+
+ /**
+ * Insert an element into the list at the current position of the iterator.
+ * The element is inserted in between the element that would be returned by
+ * previous and the element that would be returned by next. After the
+ * insertion, a subsequent call to next is unaffected, but a call to
+ * previous returns the item that was added. This operation is optional, it
+ * may throw an UnsupportedOperationException.
+ *
+ * @param o the object to insert into the list
+ * @exception ClassCastException the object is of a type which cannot be added
+ * to this list
+ * @exception IllegalArgumentException some other aspect of the object stops
+ * it being added to this list
+ * @exception UnsupportedOperationException if this ListIterator does not
+ * support the add operation
+ */
+ void add(Object o);
+
+ /**
+ * Remove from the list the element last returned by a call to next or
+ * previous. This method may only be called if neither add nor remove have
+ * been called since the last call to next or previous. This operation is
+ * optional, it may throw an UnsupportedOperationException.
+ *
+ * @exception IllegalStateException if neither next or previous have been
+ * called, or if add or remove has been called since the last call to next
+ * or previous.
+ * @exception UnsupportedOperationException if this ListIterator does not
+ * support the remove operation.
+ */
+ void remove();
+
+ /**
+ * Replace the element last returned by a call to next or previous with a
+ * given object. This method may only be called if neither add nor remove have
+ * been called since the last call to next or previous. This operation is
+ * optional, it may throw an UnsupportedOperationException.
+ *
+ * @param o the object to replace the element with
+ * @exception ClassCastException the object is of a type which cannot be added
+ * to this list
+ * @exception IllegalArgumentException some other aspect of the object stops
+ * it being added to this list
+ * @exception IllegalStateException if neither next or previous have been
+ * called, or if add or remove has been called since the last call to next
+ * or previous.
+ * @exception UnsupportedOperationException if this ListIterator does not
+ * support the set operation.
+ */
+ void set(Object o);
}
diff --git a/libjava/java/util/Map.java b/libjava/java/util/Map.java
index c9d46dffb3e..b1d43269711 100644
--- a/libjava/java/util/Map.java
+++ b/libjava/java/util/Map.java
@@ -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
@@ -30,28 +30,29 @@ executable file might be covered by the GNU General Public License. */
package java.util;
-public interface Map
+public interface Map
{
- public void clear();
- public boolean containsKey(Object key);
- public boolean containsValue(Object value);
- public Set entrySet();
- public boolean equals(Object o);
- public Object get(Object key);
- public Object put(Object key, Object value);
+ public void clear();
+ public boolean containsKey(Object key);
+ public boolean containsValue(Object value);
+ public Set entrySet();
+ public boolean equals(Object o);
+ public Object get(Object key);
+ public Object put(Object key, Object value);
+ public int hashCode();
+ public boolean isEmpty();
+ public Set keySet();
+ public void putAll(Map m);
+ public Object remove(Object o);
+ public int size();
+ public Collection values();
+
+ public static interface Entry
+ {
+ public Object getKey();
+ public Object getValue();
+ public Object setValue(Object value);
public int hashCode();
- public boolean isEmpty();
- public Set keySet();
- public void putAll(Map m);
- public Object remove(Object o);
- public int size();
- public Collection values();
-
- public static interface Entry {
- public Object getKey();
- public Object getValue();
- public Object setValue(Object value);
- public int hashCode();
- public boolean equals(Object o);
- }
+ public boolean equals(Object o);
+ }
}
diff --git a/libjava/java/util/ResourceBundle.java b/libjava/java/util/ResourceBundle.java
index ff70ae163e1..61738c92f34 100644
--- a/libjava/java/util/ResourceBundle.java
+++ b/libjava/java/util/ResourceBundle.java
@@ -83,9 +83,7 @@ public abstract class ResourceBundle
{
try
{
- // This call is wrong by the spec, but it will have to
- // do until our Class.forName is fixed.
- rbc = Class.forName(bundleName, loader);
+ rbc = Class.forName(bundleName, true, loader);
r = null;
try
{
diff --git a/libjava/java/util/Set.java b/libjava/java/util/Set.java
index 4eac12063e9..3c8c09be3d3 100644
--- a/libjava/java/util/Set.java
+++ b/libjava/java/util/Set.java
@@ -1,5 +1,5 @@
/* Set.java -- A collection that prohibits duplicates
- Copyright (C) 1998, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1998 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
@@ -30,7 +30,8 @@ executable file might be covered by the GNU General Public License. */
package java.util;
-public interface Set extends Collection {
+public interface Set extends Collection
+{
boolean add(Object o);
boolean addAll(Collection c);
void clear();
diff --git a/libjava/java/util/SortedSet.java b/libjava/java/util/SortedSet.java
index ede65032b52..f72dd66ef97 100644
--- a/libjava/java/util/SortedSet.java
+++ b/libjava/java/util/SortedSet.java
@@ -8,7 +8,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
@@ -31,7 +31,8 @@ executable file might be covered by the GNU General Public License. */
package java.util;
-public interface SortedSet extends Set {
+public interface SortedSet extends Set
+{
Comparator comparator();
Object first();
SortedSet headSet(Object toElement);
diff --git a/libjava/java/util/TimeZone.java b/libjava/java/util/TimeZone.java
index e68f9b56a80..2ee5208ead5 100644
--- a/libjava/java/util/TimeZone.java
+++ b/libjava/java/util/TimeZone.java
@@ -84,9 +84,9 @@ public abstract class TimeZone implements java.io.Serializable, Cloneable
// XXX - Should we read this data from a file?
tz = new SimpleTimeZone(-11000 * 3600, "MIT");
timezones.put("MIT", tz);
- timezones.put("Pacific/Niue", tz);
timezones.put("Pacific/Apia", tz);
timezones.put("Pacific/Midway", tz);
+ timezones.put("Pacific/Niue", tz);
timezones.put("Pacific/Pago_Pago", tz);
tz = new SimpleTimeZone
(-10000 * 3600, "America/Adak",
@@ -100,19 +100,19 @@ public abstract class TimeZone implements java.io.Serializable, Cloneable
timezones.put("Pacific/Johnston", tz);
timezones.put("Pacific/Rarotonga", tz);
timezones.put("Pacific/Tahiti", tz);
+ tz = new SimpleTimeZone(-9500 * 3600, "Pacific/Marquesas");
+ timezones.put("Pacific/Marquesas", tz);
tz = new SimpleTimeZone
(-9000 * 3600, "AST",
Calendar.APRIL, 1, Calendar.SUNDAY, 2000 * 3600,
Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600);
timezones.put("AST", tz);
- timezones.put("America/Juneau", tz);
timezones.put("America/Anchorage", tz);
+ timezones.put("America/Juneau", tz);
timezones.put("America/Nome", tz);
timezones.put("America/Yakutat", tz);
tz = new SimpleTimeZone(-9000 * 3600, "Pacific/Gambier");
timezones.put("Pacific/Gambier", tz);
- tz = new SimpleTimeZone(-8500 * 3600, "Pacific/Marquesas");
- timezones.put("Pacific/Marquesas", tz);
tz = new SimpleTimeZone
(-8000 * 3600, "PST",
Calendar.APRIL, 1, Calendar.SUNDAY, 2000 * 3600,
@@ -126,10 +126,6 @@ public abstract class TimeZone implements java.io.Serializable, Cloneable
timezones.put("US/Pacific-New", tz);
tz = new SimpleTimeZone(-8000 * 3600, "Pacific/Pitcairn");
timezones.put("Pacific/Pitcairn", tz);
- tz = new SimpleTimeZone(-7000 * 3600, "PNT");
- timezones.put("PNT", tz);
- timezones.put("America/Dawson_Creek", tz);
- timezones.put("America/Phoenix", tz);
tz = new SimpleTimeZone
(-7000 * 3600, "MST",
Calendar.APRIL, 1, Calendar.SUNDAY, 2000 * 3600,
@@ -143,16 +139,11 @@ public abstract class TimeZone implements java.io.Serializable, Cloneable
timezones.put("America/Mazatlan", tz);
timezones.put("America/Shiprock", tz);
timezones.put("America/Yellowknife", tz);
- tz = new SimpleTimeZone(-6000 * 3600, "America/Regina");
- timezones.put("America/Regina", tz);
- timezones.put("America/Belize", tz);
- timezones.put("America/Costa_Rica", tz);
- timezones.put("America/El_Salvador", tz);
- timezones.put("America/Guatemala", tz);
- timezones.put("America/Managua", tz);
- timezones.put("America/Swift_Current", tz);
- timezones.put("America/Tegucigalpa", tz);
- timezones.put("Pacific/Galapagos", tz);
+ tz = new SimpleTimeZone(-7000 * 3600, "PNT");
+ timezones.put("PNT", tz);
+ timezones.put("America/Dawson_Creek", tz);
+ timezones.put("America/Hermosillo", tz);
+ timezones.put("America/Phoenix", tz);
tz = new SimpleTimeZone
(-6000 * 3600, "CST",
Calendar.APRIL, 1, Calendar.SUNDAY, 2000 * 3600,
@@ -161,13 +152,22 @@ public abstract class TimeZone implements java.io.Serializable, Cloneable
timezones.put("America/Cambridge_Bay", tz);
timezones.put("America/Cancun", tz);
timezones.put("America/Chicago", tz);
- timezones.put("America/Iqaluit", tz);
timezones.put("America/Menominee", tz);
+ timezones.put("America/Merida", tz);
timezones.put("America/Mexico_City", tz);
- timezones.put("America/Pangnirtung", tz);
+ timezones.put("America/Monterrey", tz);
timezones.put("America/Rainy_River", tz);
- timezones.put("America/Rankin_Inlet", tz);
timezones.put("America/Winnipeg", tz);
+ tz = new SimpleTimeZone(-6000 * 3600, "America/Belize");
+ timezones.put("America/Belize", tz);
+ timezones.put("America/Costa_Rica", tz);
+ timezones.put("America/El_Salvador", tz);
+ timezones.put("America/Guatemala", tz);
+ timezones.put("America/Managua", tz);
+ timezones.put("America/Regina", tz);
+ timezones.put("America/Swift_Current", tz);
+ timezones.put("America/Tegucigalpa", tz);
+ timezones.put("Pacific/Galapagos", tz);
tz = new SimpleTimeZone
(-6000 * 3600, "Pacific/Easter",
Calendar.OCTOBER, 9, -Calendar.SUNDAY, 0 * 3600,
@@ -178,32 +178,34 @@ public abstract class TimeZone implements java.io.Serializable, Cloneable
Calendar.APRIL, 1, Calendar.SUNDAY, 0 * 3600,
Calendar.OCTOBER, -1, Calendar.SUNDAY, 0 * 3600);
timezones.put("America/Grand_Turk", tz);
- tz = new SimpleTimeZone
- (-5000 * 3600, "America/Havana",
- Calendar.APRIL, 1, 0, 0 * 3600,
- Calendar.OCTOBER, -1, Calendar.SUNDAY, 0 * 3600);
timezones.put("America/Havana", tz);
tz = new SimpleTimeZone(-5000 * 3600, "IET");
timezones.put("IET", tz);
timezones.put("America/Bogota", tz);
timezones.put("America/Cayman", tz);
+ timezones.put("America/Eirunepe", tz);
timezones.put("America/Guayaquil", tz);
timezones.put("America/Indiana/Indianapolis", tz);
timezones.put("America/Indiana/Knox", tz);
timezones.put("America/Indiana/Marengo", tz);
timezones.put("America/Indiana/Vevay", tz);
timezones.put("America/Indianapolis", tz);
+ timezones.put("America/Iqaluit", tz);
timezones.put("America/Jamaica", tz);
timezones.put("America/Lima", tz);
timezones.put("America/Panama", tz);
+ timezones.put("America/Pangnirtung", tz);
timezones.put("America/Port-au-Prince", tz);
timezones.put("America/Porto_Acre", tz);
+ timezones.put("America/Rankin_Inlet", tz);
tz = new SimpleTimeZone
(-5000 * 3600, "EST",
Calendar.APRIL, 1, Calendar.SUNDAY, 2000 * 3600,
Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600);
timezones.put("EST", tz);
timezones.put("America/Detroit", tz);
+ timezones.put("America/Kentucky/Louisville", tz);
+ timezones.put("America/Kentucky/Monticello", tz);
timezones.put("America/Louisville", tz);
timezones.put("America/Montreal", tz);
timezones.put("America/Nassau", tz);
@@ -216,6 +218,7 @@ public abstract class TimeZone implements java.io.Serializable, Cloneable
timezones.put("America/Antigua", tz);
timezones.put("America/Aruba", tz);
timezones.put("America/Barbados", tz);
+ timezones.put("America/Boa_Vista", tz);
timezones.put("America/Caracas", tz);
timezones.put("America/Curacao", tz);
timezones.put("America/Dominica", tz);
@@ -236,53 +239,67 @@ public abstract class TimeZone implements java.io.Serializable, Cloneable
timezones.put("America/St_Vincent", tz);
timezones.put("America/Tortola", tz);
tz = new SimpleTimeZone
- (-4000 * 3600, "America/Cuiaba",
+ (-4000 * 3600, "America/Asuncion",
Calendar.OCTOBER, 1, Calendar.SUNDAY, 0 * 3600,
Calendar.FEBRUARY, -1, Calendar.SUNDAY, 0 * 3600);
- timezones.put("America/Cuiaba", tz);
timezones.put("America/Asuncion", tz);
- timezones.put("America/Boa_Vista", tz);
tz = new SimpleTimeZone
- (-4000 * 3600, "America/Thule",
+ (-4000 * 3600, "America/Cuiaba",
+ Calendar.OCTOBER, 2, Calendar.SUNDAY, 0 * 3600,
+ Calendar.FEBRUARY, 3, Calendar.SUNDAY, 0 * 3600);
+ timezones.put("America/Cuiaba", tz);
+ tz = new SimpleTimeZone
+ (-4000 * 3600, "America/Goose_Bay",
+ Calendar.APRIL, 1, Calendar.SUNDAY, 60000,
+ Calendar.OCTOBER, -1, Calendar.SUNDAY, 60000);
+ timezones.put("America/Goose_Bay", tz);
+ tz = new SimpleTimeZone
+ (-4000 * 3600, "America/Glace_Bay",
Calendar.APRIL, 1, Calendar.SUNDAY, 2000 * 3600,
Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600);
- timezones.put("America/Thule", tz);
timezones.put("America/Glace_Bay", tz);
- timezones.put("America/Goose_Bay", tz);
timezones.put("America/Halifax", tz);
+ timezones.put("America/Thule", tz);
timezones.put("Atlantic/Bermuda", tz);
tz = new SimpleTimeZone
- (-4000 * 3600, "Antarctica/Palmer",
+ (-4000 * 3600, "America/Santiago",
Calendar.OCTOBER, 9, -Calendar.SUNDAY, 0 * 3600,
Calendar.MARCH, 9, -Calendar.SUNDAY, 0 * 3600);
- timezones.put("Antarctica/Palmer", tz);
timezones.put("America/Santiago", tz);
+ timezones.put("Antarctica/Palmer", tz);
tz = new SimpleTimeZone
(-4000 * 3600, "Atlantic/Stanley",
Calendar.SEPTEMBER, 2, Calendar.SUNDAY, 0 * 3600,
Calendar.APRIL, 16, -Calendar.SUNDAY, 0 * 3600);
timezones.put("Atlantic/Stanley", tz);
+ tz = new SimpleTimeZone
+ (-3500 * 3600, "CNT",
+ Calendar.APRIL, 1, Calendar.SUNDAY, 60000,
+ Calendar.OCTOBER, -1, Calendar.SUNDAY, 60000);
+ timezones.put("CNT", tz);
+ timezones.put("America/St_Johns", tz);
+ tz = new SimpleTimeZone
+ (-3000 * 3600, "America/Araguaina",
+ Calendar.OCTOBER, 2, Calendar.SUNDAY, 0 * 3600,
+ Calendar.FEBRUARY, 3, Calendar.SUNDAY, 0 * 3600);
+ timezones.put("America/Araguaina", tz);
+ timezones.put("America/Sao_Paulo", tz);
tz = new SimpleTimeZone(-3000 * 3600, "AGT");
timezones.put("AGT", tz);
- timezones.put("America/Buenos_Aires", tz);
timezones.put("America/Belem", tz);
+ timezones.put("America/Buenos_Aires", tz);
timezones.put("America/Catamarca", tz);
timezones.put("America/Cayenne", tz);
timezones.put("America/Cordoba", tz);
+ timezones.put("America/Fortaleza", tz);
timezones.put("America/Jujuy", tz);
+ timezones.put("America/Maceio", tz);
timezones.put("America/Mendoza", tz);
timezones.put("America/Montevideo", tz);
timezones.put("America/Paramaribo", tz);
+ timezones.put("America/Recife", tz);
timezones.put("America/Rosario", tz);
tz = new SimpleTimeZone
- (-3000 * 3600, "America/Fortaleza",
- Calendar.OCTOBER, 1, Calendar.SUNDAY, 0 * 3600,
- Calendar.FEBRUARY, -1, Calendar.SUNDAY, 0 * 3600);
- timezones.put("America/Fortaleza", tz);
- timezones.put("America/Araguaina", tz);
- timezones.put("America/Maceio", tz);
- timezones.put("America/Sao_Paulo", tz);
- tz = new SimpleTimeZone
(-3000 * 3600, "America/Godthab",
Calendar.MARCH, 30, -Calendar.SATURDAY, 22000 * 3600,
Calendar.OCTOBER, 30, -Calendar.SATURDAY, 22000 * 3600);
@@ -292,12 +309,6 @@ public abstract class TimeZone implements java.io.Serializable, Cloneable
Calendar.APRIL, 1, Calendar.SUNDAY, 2000 * 3600,
Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600);
timezones.put("America/Miquelon", tz);
- tz = new SimpleTimeZone
- (-3500 * 3600, "CNT",
- Calendar.APRIL, 1, Calendar.SUNDAY, 2000 * 3600,
- Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600);
- timezones.put("CNT", tz);
- timezones.put("America/St_Johns", tz);
tz = new SimpleTimeZone(-2000 * 3600, "America/Noronha");
timezones.put("America/Noronha", tz);
timezones.put("Atlantic/South_Georgia", tz);
@@ -312,6 +323,7 @@ public abstract class TimeZone implements java.io.Serializable, Cloneable
timezones.put("Atlantic/Jan_Mayen", tz);
tz = new SimpleTimeZone(0 * 3600, "GMT");
timezones.put("GMT", tz);
+ timezones.put("UTC", tz);
timezones.put("Africa/Abidjan", tz);
timezones.put("Africa/Accra", tz);
timezones.put("Africa/Bamako", tz);
@@ -333,7 +345,6 @@ public abstract class TimeZone implements java.io.Serializable, Cloneable
timezones.put("Europe/Belfast", tz);
timezones.put("Europe/Dublin", tz);
timezones.put("Europe/London", tz);
- timezones.put("UTC", tz);
tz = new SimpleTimeZone
(0 * 3600, "WET",
Calendar.MARCH, -1, Calendar.SUNDAY, 1000 * 3600,
@@ -368,6 +379,7 @@ public abstract class TimeZone implements java.io.Serializable, Cloneable
Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600);
timezones.put("CET", tz);
timezones.put("ECT", tz);
+ timezones.put("MET", tz);
timezones.put("Africa/Ceuta", tz);
timezones.put("Arctic/Longyearbyen", tz);
timezones.put("Europe/Amsterdam", tz);
@@ -399,21 +411,19 @@ public abstract class TimeZone implements java.io.Serializable, Cloneable
timezones.put("Europe/Warsaw", tz);
timezones.put("Europe/Zagreb", tz);
timezones.put("Europe/Zurich", tz);
- timezones.put("MET", tz);
tz = new SimpleTimeZone
- (2000 * 3600, "Africa/Cairo",
+ (2000 * 3600, "ART",
Calendar.APRIL, -1, Calendar.FRIDAY, 0 * 3600,
Calendar.SEPTEMBER, -1, Calendar.THURSDAY, 23000 * 3600);
- timezones.put("Africa/Cairo", tz);
timezones.put("ART", tz);
+ timezones.put("Africa/Cairo", tz);
tz = new SimpleTimeZone(2000 * 3600, "CAT");
timezones.put("CAT", tz);
- timezones.put("Africa/Gaborone", tz);
timezones.put("Africa/Blantyre", tz);
timezones.put("Africa/Bujumbura", tz);
+ timezones.put("Africa/Gaborone", tz);
timezones.put("Africa/Harare", tz);
timezones.put("Africa/Johannesburg", tz);
- timezones.put("Africa/Khartoum", tz);
timezones.put("Africa/Kigali", tz);
timezones.put("Africa/Lubumbashi", tz);
timezones.put("Africa/Lusaka", tz);
@@ -421,26 +431,33 @@ public abstract class TimeZone implements java.io.Serializable, Cloneable
timezones.put("Africa/Maseru", tz);
timezones.put("Africa/Mbabane", tz);
timezones.put("Africa/Tripoli", tz);
+ timezones.put("Europe/Riga", tz);
timezones.put("Europe/Tallinn", tz);
+ timezones.put("Europe/Vilnius", tz);
tz = new SimpleTimeZone
(2000 * 3600, "Asia/Amman",
- Calendar.APRIL, 1, 0, 0 * 3600, Calendar.OCTOBER, 1, 0, 0 * 3600);
+ Calendar.MARCH, -1, Calendar.THURSDAY, 0 * 3600,
+ Calendar.SEPTEMBER, -1, Calendar.THURSDAY, 0 * 3600);
timezones.put("Asia/Amman", tz);
- timezones.put("Asia/Damascus", tz);
tz = new SimpleTimeZone
(2000 * 3600, "Asia/Beirut",
Calendar.MARCH, -1, Calendar.SUNDAY, 0 * 3600,
Calendar.OCTOBER, -1, Calendar.SUNDAY, 0 * 3600);
timezones.put("Asia/Beirut", tz);
tz = new SimpleTimeZone
+ (2000 * 3600, "Asia/Damascus",
+ Calendar.APRIL, 1, 0, 0 * 3600,
+ Calendar.OCTOBER, 1, 0, 0 * 3600);
+ timezones.put("Asia/Damascus", tz);
+ tz = new SimpleTimeZone
(2000 * 3600, "Asia/Gaza",
Calendar.APRIL, 3, Calendar.FRIDAY, 0 * 3600,
Calendar.OCTOBER, 3, Calendar.FRIDAY, 0 * 3600);
timezones.put("Asia/Gaza", tz);
tz = new SimpleTimeZone
(2000 * 3600, "Asia/Jerusalem",
- Calendar.APRIL, 1, Calendar.FRIDAY, 2000 * 3600,
- Calendar.SEPTEMBER, 1, Calendar.FRIDAY, 2000 * 3600);
+ Calendar.APRIL, 1, 0, 1000 * 3600,
+ Calendar.OCTOBER, 1, 0, 1000 * 3600);
timezones.put("Asia/Jerusalem", tz);
tz = new SimpleTimeZone
(2000 * 3600, "EET",
@@ -455,37 +472,36 @@ public abstract class TimeZone implements java.io.Serializable, Cloneable
timezones.put("Europe/Helsinki", tz);
timezones.put("Europe/Istanbul", tz);
timezones.put("Europe/Kiev", tz);
- timezones.put("Europe/Riga", tz);
+ timezones.put("Europe/Nicosia", tz);
timezones.put("Europe/Simferopol", tz);
timezones.put("Europe/Sofia", tz);
timezones.put("Europe/Uzhgorod", tz);
- timezones.put("Europe/Vilnius", tz);
timezones.put("Europe/Zaporozhye", tz);
tz = new SimpleTimeZone
- (2000 * 3600, "Europe/Minsk",
+ (2000 * 3600, "Europe/Kaliningrad",
Calendar.MARCH, -1, Calendar.SUNDAY, 2000 * 3600,
Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600);
- timezones.put("Europe/Minsk", tz);
timezones.put("Europe/Kaliningrad", tz);
+ timezones.put("Europe/Minsk", tz);
tz = new SimpleTimeZone
(3000 * 3600, "Asia/Baghdad",
Calendar.APRIL, 1, 0, 3000 * 3600,
Calendar.OCTOBER, 1, 0, 3000 * 3600);
timezones.put("Asia/Baghdad", tz);
tz = new SimpleTimeZone
- (3000 * 3600, "Europe/Tiraspol",
+ (3000 * 3600, "Europe/Moscow",
Calendar.MARCH, -1, Calendar.SUNDAY, 2000 * 3600,
Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600);
- timezones.put("Europe/Tiraspol", tz);
timezones.put("Europe/Moscow", tz);
+ timezones.put("Europe/Tiraspol", tz);
tz = new SimpleTimeZone(3000 * 3600, "EAT");
timezones.put("EAT", tz);
- timezones.put("Indian/Comoro", tz);
timezones.put("Africa/Addis_Ababa", tz);
timezones.put("Africa/Asmera", tz);
timezones.put("Africa/Dar_es_Salaam", tz);
timezones.put("Africa/Djibouti", tz);
timezones.put("Africa/Kampala", tz);
+ timezones.put("Africa/Khartoum", tz);
timezones.put("Africa/Mogadishu", tz);
timezones.put("Africa/Nairobi", tz);
timezones.put("Antarctica/Syowa", tz);
@@ -495,6 +511,7 @@ public abstract class TimeZone implements java.io.Serializable, Cloneable
timezones.put("Asia/Qatar", tz);
timezones.put("Asia/Riyadh", tz);
timezones.put("Indian/Antananarivo", tz);
+ timezones.put("Indian/Comoro", tz);
timezones.put("Indian/Mayotte", tz);
tz = new SimpleTimeZone(3500 * 3600, "Asia/Tehran");
timezones.put("Asia/Tehran", tz);
@@ -504,11 +521,11 @@ public abstract class TimeZone implements java.io.Serializable, Cloneable
Calendar.OCTOBER, -1, Calendar.SUNDAY, 1000 * 3600);
timezones.put("Asia/Baku", tz);
tz = new SimpleTimeZone
- (4000 * 3600, "Asia/Tbilisi",
+ (4000 * 3600, "Asia/Aqtau",
Calendar.MARCH, -1, Calendar.SUNDAY, 0 * 3600,
Calendar.OCTOBER, -1, Calendar.SUNDAY, 0 * 3600);
- timezones.put("Asia/Tbilisi", tz);
timezones.put("Asia/Aqtau", tz);
+ timezones.put("Asia/Tbilisi", tz);
tz = new SimpleTimeZone
(4000 * 3600, "Asia/Yerevan",
Calendar.MARCH, -1, Calendar.SUNDAY, 2000 * 3600,
@@ -517,10 +534,10 @@ public abstract class TimeZone implements java.io.Serializable, Cloneable
timezones.put("Europe/Samara", tz);
tz = new SimpleTimeZone(4000 * 3600, "NET");
timezones.put("NET", tz);
- timezones.put("Indian/Mauritius", tz);
timezones.put("Asia/Dubai", tz);
timezones.put("Asia/Muscat", tz);
timezones.put("Indian/Mahe", tz);
+ timezones.put("Indian/Mauritius", tz);
timezones.put("Indian/Reunion", tz);
tz = new SimpleTimeZone(4500 * 3600, "Asia/Kabul");
timezones.put("Asia/Kabul", tz);
@@ -541,13 +558,13 @@ public abstract class TimeZone implements java.io.Serializable, Cloneable
timezones.put("Asia/Yekaterinburg", tz);
tz = new SimpleTimeZone(5000 * 3600, "PLT");
timezones.put("PLT", tz);
- timezones.put("Indian/Kerguelen", tz);
- timezones.put("Asia/Ashkhabad", tz);
+ timezones.put("Asia/Ashgabat", tz);
timezones.put("Asia/Dushanbe", tz);
timezones.put("Asia/Karachi", tz);
timezones.put("Asia/Samarkand", tz);
timezones.put("Asia/Tashkent", tz);
timezones.put("Indian/Chagos", tz);
+ timezones.put("Indian/Kerguelen", tz);
timezones.put("Indian/Maldives", tz);
tz = new SimpleTimeZone(5500 * 3600, "IST");
timezones.put("IST", tz);
@@ -558,19 +575,19 @@ public abstract class TimeZone implements java.io.Serializable, Cloneable
timezones.put("BST", tz);
timezones.put("Antarctica/Mawson", tz);
timezones.put("Asia/Colombo", tz);
- timezones.put("Asia/Dacca", tz);
- timezones.put("Asia/Thimbu", tz);
+ timezones.put("Asia/Dhaka", tz);
+ timezones.put("Asia/Thimphu", tz);
tz = new SimpleTimeZone
(6000 * 3600, "Asia/Almaty",
Calendar.MARCH, -1, Calendar.SUNDAY, 0 * 3600,
Calendar.OCTOBER, -1, Calendar.SUNDAY, 0 * 3600);
timezones.put("Asia/Almaty", tz);
tz = new SimpleTimeZone
- (6000 * 3600, "Asia/Omsk",
+ (6000 * 3600, "Asia/Novosibirsk",
Calendar.MARCH, -1, Calendar.SUNDAY, 2000 * 3600,
Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600);
- timezones.put("Asia/Omsk", tz);
timezones.put("Asia/Novosibirsk", tz);
+ timezones.put("Asia/Omsk", tz);
tz = new SimpleTimeZone(6500 * 3600, "Asia/Rangoon");
timezones.put("Asia/Rangoon", tz);
timezones.put("Indian/Cocos", tz);
@@ -578,6 +595,7 @@ public abstract class TimeZone implements java.io.Serializable, Cloneable
timezones.put("VST", tz);
timezones.put("Antarctica/Davis", tz);
timezones.put("Asia/Bangkok", tz);
+ timezones.put("Asia/Hovd", tz);
timezones.put("Asia/Jakarta", tz);
timezones.put("Asia/Phnom_Penh", tz);
timezones.put("Asia/Saigon", tz);
@@ -593,7 +611,6 @@ public abstract class TimeZone implements java.io.Serializable, Cloneable
timezones.put("Antarctica/Casey", tz);
timezones.put("Asia/Brunei", tz);
timezones.put("Asia/Chungking", tz);
- timezones.put("Asia/Dili", tz);
timezones.put("Asia/Harbin", tz);
timezones.put("Asia/Hong_Kong", tz);
timezones.put("Asia/Kashgar", tz);
@@ -605,6 +622,7 @@ public abstract class TimeZone implements java.io.Serializable, Cloneable
timezones.put("Asia/Singapore", tz);
timezones.put("Asia/Taipei", tz);
timezones.put("Asia/Ujung_Pandang", tz);
+ timezones.put("Asia/Ulaanbaatar", tz);
timezones.put("Asia/Urumqi", tz);
timezones.put("Australia/Perth", tz);
tz = new SimpleTimeZone
@@ -612,13 +630,9 @@ public abstract class TimeZone implements java.io.Serializable, Cloneable
Calendar.MARCH, -1, Calendar.SUNDAY, 2000 * 3600,
Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600);
timezones.put("Asia/Irkutsk", tz);
- tz = new SimpleTimeZone
- (8000 * 3600, "Asia/Ulan_Bator",
- Calendar.MARCH, -1, Calendar.SUNDAY, 0 * 3600,
- Calendar.SEPTEMBER, -1, Calendar.SUNDAY, 0 * 3600);
- timezones.put("Asia/Ulan_Bator", tz);
tz = new SimpleTimeZone(9000 * 3600, "JST");
timezones.put("JST", tz);
+ timezones.put("Asia/Dili", tz);
timezones.put("Asia/Jayapura", tz);
timezones.put("Asia/Pyongyang", tz);
timezones.put("Asia/Seoul", tz);
@@ -658,12 +672,12 @@ public abstract class TimeZone implements java.io.Serializable, Cloneable
Calendar.MARCH, -1, Calendar.SUNDAY, 2000 * 3600);
timezones.put("Australia/Hobart", tz);
tz = new SimpleTimeZone
- (10000 * 3600, "Australia/Melbourne",
+ (10000 * 3600, "AET",
Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600,
Calendar.MARCH, -1, Calendar.SUNDAY, 2000 * 3600);
+ timezones.put("AET", tz);
timezones.put("Australia/Melbourne", tz);
timezones.put("Australia/Sydney", tz);
- timezones.put("AET", tz);
tz = new SimpleTimeZone
(10500 * 3600, "Australia/Lord_Howe",
Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600,
@@ -676,38 +690,34 @@ public abstract class TimeZone implements java.io.Serializable, Cloneable
timezones.put("Asia/Magadan", tz);
tz = new SimpleTimeZone(11000 * 3600, "SST");
timezones.put("SST", tz);
- timezones.put("Pacific/Ponape", tz);
timezones.put("Pacific/Efate", tz);
timezones.put("Pacific/Guadalcanal", tz);
timezones.put("Pacific/Kosrae", tz);
timezones.put("Pacific/Noumea", tz);
+ timezones.put("Pacific/Ponape", tz);
tz = new SimpleTimeZone(11500 * 3600, "Pacific/Norfolk");
timezones.put("Pacific/Norfolk", tz);
tz = new SimpleTimeZone
- (12000 * 3600, "Antarctica/McMurdo",
+ (12000 * 3600, "NST",
Calendar.OCTOBER, 1, Calendar.SUNDAY, 2000 * 3600,
Calendar.MARCH, 3, Calendar.SUNDAY, 2000 * 3600);
+ timezones.put("NST", tz);
timezones.put("Antarctica/McMurdo", tz);
timezones.put("Antarctica/South_Pole", tz);
timezones.put("Pacific/Auckland", tz);
- timezones.put("NST", tz);
tz = new SimpleTimeZone
- (12000 * 3600, "Asia/Kamchatka",
+ (12000 * 3600, "Asia/Anadyr",
Calendar.MARCH, -1, Calendar.SUNDAY, 2000 * 3600,
Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600);
- timezones.put("Asia/Kamchatka", tz);
timezones.put("Asia/Anadyr", tz);
- tz = new SimpleTimeZone
- (12000 * 3600, "Pacific/Fiji",
- Calendar.NOVEMBER, 1, Calendar.SUNDAY, 2000 * 3600,
- Calendar.FEBRUARY, -1, Calendar.SUNDAY, 3000 * 3600);
+ timezones.put("Asia/Kamchatka", tz);
+ tz = new SimpleTimeZone(12000 * 3600, "Pacific/Fiji");
timezones.put("Pacific/Fiji", tz);
- tz = new SimpleTimeZone(12000 * 3600, "Pacific/Tarawa");
- timezones.put("Pacific/Tarawa", tz);
timezones.put("Pacific/Funafuti", tz);
timezones.put("Pacific/Kwajalein", tz);
timezones.put("Pacific/Majuro", tz);
timezones.put("Pacific/Nauru", tz);
+ timezones.put("Pacific/Tarawa", tz);
timezones.put("Pacific/Wake", tz);
timezones.put("Pacific/Wallis", tz);
tz = new SimpleTimeZone
@@ -717,10 +727,6 @@ public abstract class TimeZone implements java.io.Serializable, Cloneable
timezones.put("Pacific/Chatham", tz);
tz = new SimpleTimeZone(13000 * 3600, "Pacific/Enderbury");
timezones.put("Pacific/Enderbury", tz);
- tz = new SimpleTimeZone
- (13000 * 3600, "Pacific/Tongatapu",
- Calendar.OCTOBER, 1, Calendar.SATURDAY, 2000 * 3600,
- Calendar.APRIL, 16, -Calendar.SUNDAY, 2000 * 3600);
timezones.put("Pacific/Tongatapu", tz);
tz = new SimpleTimeZone(14000 * 3600, "Pacific/Kiritimati");
timezones.put("Pacific/Kiritimati", tz);
diff --git a/libjava/java/util/TreeMap.java b/libjava/java/util/TreeMap.java
new file mode 100644
index 00000000000..59d6079e32a
--- /dev/null
+++ b/libjava/java/util/TreeMap.java
@@ -0,0 +1,1454 @@
+/* TreeMap.java -- a class providing a basic Red-Black Tree data structure,
+ mapping Object --> Object
+ Copyright (C) 1998, 1999, 2000, 2001 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.
+
+As a special exception, if you link this library with other files to
+produce an executable, this library 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. */
+
+
+package java.util;
+
+import java.io.Serializable;
+import java.io.ObjectOutputStream;
+import java.io.ObjectInputStream;
+import java.io.IOException;
+
+/**
+ * This class provides a red-black tree implementation of the SortedMap
+ * interface. Elements in the Map will be sorted by either a user-provided
+ * Comparator object, or by the natural ordering of the keys.
+ *
+ * The algorithms are adopted from Corman, Leiserson,
+ * and Rivest's <i>Introduction to Algorithms.</i> In other words,
+ * I cribbed from the same pseudocode as Sun. <em>Any similarity
+ * between my code and Sun's (if there is any -- I have never looked
+ * at Sun's) is a result of this fact.</em>
+ *
+ * TreeMap guarantees O(log n) insertion and deletion of elements. That
+ * being said, there is a large enough constant coefficient in front of
+ * that "log n" (overhead involved in keeping the tree
+ * balanced), that TreeMap may not be the best choice for small
+ * collections.
+ *
+ * TreeMap is a part of the JDK1.2 Collections API. Null keys are allowed
+ * only if a Comparator is used which can deal with them. Null values are
+ * always allowed.
+ *
+ * @author Jon Zeppieri
+ * @author Bryce McKinlay
+ */
+public class TreeMap extends AbstractMap
+ implements SortedMap, Cloneable, Serializable
+{
+ private static final int RED = -1,
+ BLACK = 1;
+
+ /** Sentinal node, used to avoid null checks for corner cases and make the
+ delete rebalance code simpler. Note that this must not be static, due
+ to thread-safety concerns. */
+ transient Node nil = new Node(null, null);
+
+ /** The root node of this TreeMap */
+ transient Node root = nil;
+
+ /** The size of this TreeMap */
+ transient int size = 0;
+
+ /** Number of modifications */
+ transient int modCount = 0;
+
+ /** This TreeMap's comparator, if any. */
+ Comparator comparator = null;
+
+ static final long serialVersionUID = 919286545866124006L;
+
+ private static class Node extends BasicMapEntry implements Map.Entry
+ {
+ int color;
+ Node left;
+ Node right;
+ Node parent;
+
+ Node(Object key, Object value)
+ {
+ super(key, value);
+ this.color = BLACK;
+ }
+ }
+
+ /**
+ * Instantiate a new TreeMap with no elements, using the keys'
+ * natural ordering to sort.
+ *
+ * @see java.lang.Comparable
+ */
+ public TreeMap()
+ {
+ }
+
+ /**
+ * Instantiate a new TreeMap with no elements, using the provided
+ * comparator to sort.
+ *
+ * @param oComparator a Comparator object, used to sort
+ * the keys of this SortedMap
+ */
+ public TreeMap(Comparator c)
+ {
+ comparator = c;
+ }
+
+ /**
+ * Instantiate a new TreeMap, initializing it with all of the
+ * elements in the provided Map. The elements will be sorted
+ * using the natural ordering of the keys.
+ *
+ * @param map a Map, whose keys will be put into
+ * this TreeMap
+ *
+ * @throws ClassCastException if the keys in the provided
+ * Map do not implement
+ * Comparable
+ *
+ * @see java.lang.Comparable
+ */
+ public TreeMap(Map map)
+ {
+ putAll(map);
+ }
+
+ /**
+ * Instantiate a new TreeMap, initializing it with all of the
+ * elements in the provided SortedMap. The elements will be sorted
+ * using the same method as in the provided SortedMap.
+ */
+ public TreeMap(SortedMap sm)
+ {
+ this(sm.comparator());
+
+ int sm_size = sm.size();
+ Iterator itr = sm.entrySet().iterator();
+
+ fabricateTree(sm_size);
+ Node node = firstNode();
+
+ for (int i = 0; i < sm_size; i++)
+ {
+ Map.Entry me = (Map.Entry) itr.next();
+ node.key = me.getKey();
+ node.value = me.getValue();
+ node = successor(node);
+ }
+ }
+
+ public int size()
+ {
+ return size;
+ }
+
+ public void clear()
+ {
+ modCount++;
+ root = nil;
+ // nil node could have a residual parent reference, clear it for GC.
+ nil.parent = null;
+ size = 0;
+ }
+
+ public Object clone()
+ {
+ TreeMap copy = null;
+ try
+ {
+ copy = (TreeMap) super.clone();
+ }
+ catch (CloneNotSupportedException x)
+ {
+ }
+ // Each instance must have a unique sentinal.
+ copy.nil = new Node(null, null);
+ copy.fabricateTree(size);
+
+ Node node = firstNode();
+ Node cnode = copy.firstNode();
+
+ while (node != nil)
+ {
+ cnode.key = node.key;
+ cnode.value = node.value;
+ node = successor(node);
+ cnode = copy.successor(cnode);
+ }
+ return copy;
+ }
+
+ public Comparator comparator()
+ {
+ return comparator;
+ }
+
+ public boolean containsKey(Object key)
+ {
+ return getNode(key) != nil;
+ }
+
+ public boolean containsValue(Object value)
+ {
+ Node node = firstNode();
+ Object currentVal;
+
+ while (node != nil)
+ {
+ currentVal = node.getValue();
+
+ if (value == null ? currentVal == null : value.equals (currentVal))
+ return true;
+
+ node = successor(node);
+ }
+ return false;
+ }
+
+ public Set entrySet()
+ {
+ // Create an AbstractSet with custom implementations of those methods that
+ // can be overriden easily and efficiently.
+ return new AbstractSet()
+ {
+ public int size()
+ {
+ return size;
+ }
+
+ public Iterator iterator()
+ {
+ return new TreeIterator(TreeIterator.ENTRIES);
+ }
+
+ public void clear()
+ {
+ TreeMap.this.clear();
+ }
+
+ public boolean contains(Object o)
+ {
+ if (!(o instanceof Map.Entry))
+ return false;
+ Map.Entry me = (Map.Entry) o;
+ Node n = getNode(me.getKey());
+ return (n != nil && me.getValue().equals(n.value));
+ }
+
+ public boolean remove(Object o)
+ {
+ if (!(o instanceof Map.Entry))
+ return false;
+ Map.Entry me = (Map.Entry) o;
+ Node n = getNode(me.getKey());
+ if (n != nil && me.getValue().equals(n.value))
+ {
+ removeNode(n);
+ return true;
+ }
+ return false;
+ }
+ };
+ }
+
+ public Object firstKey()
+ {
+ if (root == nil)
+ throw new NoSuchElementException("empty");
+ return firstNode().getKey();
+ }
+
+ private Node firstNode()
+ {
+ if (root == nil)
+ return nil;
+ Node node = root;
+ while (node.left != nil)
+ node = node.left;
+ return node;
+ }
+
+ public Object lastKey()
+ {
+ if (root == nil)
+ throw new NoSuchElementException("empty");
+ return lastNode().getKey();
+ }
+
+ private Node lastNode()
+ {
+ if (root == nil)
+ return nil;
+ Node node = root;
+ while (node.right != nil)
+ node = node.right;
+ return node;
+ }
+
+ public Object get(Object key)
+ {
+ return getNode(key).value;
+ }
+
+ /** Return the TreeMap.Node associated with KEY, or the nil node if no such
+ node exists in the tree. */
+ private Node getNode(Object key)
+ {
+ int comparison;
+ Node current = root;
+
+ while (current != nil)
+ {
+ comparison = compare(key, current.key);
+ if (comparison > 0)
+ current = current.right;
+ else if (comparison < 0)
+ current = current.left;
+ else
+ return current;
+ }
+ return current;
+ }
+
+ public Set keySet()
+ {
+ // Create an AbstractSet with custom implementations of those methods that
+ // can be overriden easily and efficiently.
+ return new AbstractSet()
+ {
+ public int size()
+ {
+ return size;
+ }
+
+ public Iterator iterator()
+ {
+ return new TreeIterator(TreeIterator.KEYS);
+ }
+
+ public void clear()
+ {
+ TreeMap.this.clear();
+ }
+
+ public boolean contains(Object o)
+ {
+ return TreeMap.this.containsKey(o);
+ }
+
+ public boolean remove(Object key)
+ {
+ Node n = getNode(key);
+ if (n == nil)
+ return false;
+ TreeMap.this.removeNode(n);
+ return true;
+ }
+ };
+ }
+
+ public Object put(Object key, Object value)
+ {
+ modCount++;
+ Node current = root;
+ Node parent = nil;
+ int comparison = 0;
+
+ // Find new node's parent.
+ while (current != nil)
+ {
+ parent = current;
+ comparison = compare(key, current.key);
+ if (comparison > 0)
+ current = current.right;
+ else if (comparison < 0)
+ current = current.left;
+ else
+ {
+ // Key already in tree.
+ Object r = current.value;
+ current.value = value;
+ return r;
+ }
+ }
+
+ // Set up new node.
+ Node n = new Node(key, value);
+ n.color = RED;
+ n.parent = parent;
+ n.left = nil;
+ n.right = nil;
+
+ // Insert node in tree.
+ size++;
+ if (parent == nil)
+ {
+ // Special case: inserting into an empty tree.
+ root = n;
+ n.color = BLACK;
+ return null;
+ }
+ else if (comparison > 0)
+ parent.right = n;
+ else
+ parent.left = n;
+
+ // Rebalance after insert.
+ insertFixup(n);
+ //verifyTree();
+ return null;
+ }
+
+ /** Maintain red-black balance after inserting a new node. */
+ private void insertFixup(Node n)
+ {
+ // Only need to rebalance when parent is a RED node, and while at least
+ // 2 levels deep into the tree (ie: node has a grandparent).
+ while (n != root && n.parent.parent != nil && n.parent.color == RED)
+ {
+ if (n.parent == n.parent.parent.left)
+ {
+ Node uncle = n.parent.parent.right;
+ if (uncle != nil && uncle.color == RED)
+ {
+ n.parent.color = BLACK;
+ uncle.color = BLACK;
+ n.parent.parent.color = RED;
+ n = n.parent.parent;
+ }
+ else // Uncle is BLACK.
+ {
+ if (n == n.parent.right)
+ {
+ // Make n a left child.
+ n = n.parent;
+ rotateLeft(n);
+ }
+
+ // Recolor and rotate.
+ n.parent.color = BLACK;
+ n.parent.parent.color = RED;
+ rotateRight(n.parent.parent);
+ }
+ }
+ else
+ {
+ // Mirror image of above code.
+ Node uncle = n.parent.parent.left;
+ if (uncle != nil && uncle.color == RED)
+ {
+ n.parent.color = BLACK;
+ uncle.color = BLACK;
+ n.parent.parent.color = RED;
+ n = n.parent.parent;
+ }
+ else
+ {
+ if (n == n.parent.left)
+ {
+ n = n.parent;
+ rotateRight(n);
+ }
+ n.parent.color = BLACK;
+ n.parent.parent.color = RED;
+ rotateLeft(n.parent.parent);
+ }
+ }
+ }
+ root.color = BLACK;
+ }
+
+ public void putAll(Map m)
+ {
+ Iterator itr = m.entrySet().iterator();
+ int msize = m.size();
+ Map.Entry e;
+
+ for (int i = 0; i < msize; i++)
+ {
+ e = (Map.Entry) itr.next();
+ put(e.getKey(), e.getValue());
+ }
+ }
+
+ public Object remove(Object key)
+ {
+ Node n = getNode(key);
+ if (n != nil)
+ {
+ removeNode(n);
+ return n.value;
+ }
+ return null;
+ }
+
+ // Remove node from tree. This will increment modCount and decrement size.
+ // Node must exist in the tree.
+ private void removeNode(Node node) // z
+ {
+ Node splice; // y
+ Node child; // x
+
+ modCount++;
+ size--;
+
+ // Find splice, the node at the position to actually remove from the tree.
+ if (node.left == nil || node.right == nil)
+ {
+ // Node to be deleted has 0 or 1 children.
+ splice = node;
+ if (node.left == nil)
+ child = node.right;
+ else
+ child = node.left;
+ }
+ else
+ {
+ // Node has 2 children. Splice is node's successor, and will be
+ // swapped with node since we can't remove node directly.
+ splice = node.right;
+ while (splice.left != nil)
+ splice = splice.left;
+ child = splice.right;
+ }
+
+ // Unlink splice from the tree.
+ Node parent = splice.parent;
+ child.parent = parent;
+ if (parent != nil)
+ {
+ if (splice == parent.left)
+ parent.left = child;
+ else
+ parent.right = child;
+ }
+ else
+ root = child;
+
+ // Keep track of splice's color in case it gets changed in the swap.
+ int spliceColor = splice.color;
+
+/*
+ if (splice != node)
+ {
+ node.key = splice.key;
+ node.value = splice.value;
+ }
+*/
+ if (splice != node)
+ {
+ // Swap SPLICE for NODE. Some implementations optimize here by simply
+ // swapping the values, but we can't do that: if an iterator was
+ // referencing a node in its "next" field, and that node got swapped,
+ // things would get confused.
+ if (node == root)
+ {
+ root = splice;
+ }
+ else
+ {
+ if (node.parent.left == node)
+ node.parent.left = splice;
+ else
+ node.parent.right = splice;
+ }
+ splice.parent = node.parent;
+ splice.left = node.left;
+ splice.right = node.right;
+ splice.left.parent = splice;
+ splice.right.parent = splice;
+ splice.color = node.color;
+ }
+
+ if (spliceColor == BLACK)
+ deleteFixup (child);
+
+ //verifyTree();
+ }
+
+ /** Maintain red-black balance after deleting a node. */
+ private void deleteFixup (Node node)
+ {
+ // A black node has been removed, so we need to rebalance to avoid
+ // violating the "same number of black nodes on any path" rule. If
+ // node is red, we can simply recolor it black and all is well.
+ while (node != root && node.color == BLACK)
+ {
+ if (node == node.parent.left)
+ {
+ // Rebalance left side.
+ Node sibling = node.parent.right;
+ if (sibling.color == RED)
+ {
+ sibling.color = BLACK;
+ node.parent.color = RED;
+ rotateLeft(node.parent);
+ sibling = node.parent.right;
+ }
+
+ if (sibling.left.color == BLACK && sibling.right.color == BLACK)
+ {
+ // Case 2: Sibling has no red children.
+ sibling.color = RED;
+ // Black height has been decreased, so move up the tree and
+ // repeat.
+ node = node.parent;
+ }
+ else
+ {
+ if (sibling.right.color == BLACK)
+ {
+ // Case 3: Sibling has red left child.
+ sibling.left.color = BLACK;
+ sibling.color = RED;
+ rotateRight(sibling);
+ sibling = node.parent.right;
+ }
+
+ // Case 4: Sibling has red right child.
+ sibling.color = sibling.parent.color;
+ sibling.parent.color = BLACK;
+ sibling.right.color = BLACK;
+ rotateLeft(node.parent);
+ node = root; // Finished.
+ }
+ }
+ else
+ {
+ // Symmetric "mirror" of left-side case.
+ Node sibling = node.parent.left;
+ if (sibling.color == RED)
+ {
+ sibling.color = BLACK;
+ node.parent.color = RED;
+ rotateRight(node.parent);
+ sibling = node.parent.left;
+ }
+
+ if (sibling.left.color == BLACK && sibling.right.color == BLACK)
+ {
+ sibling.color = RED;
+ node = node.parent;
+ }
+ else
+ {
+ if (sibling.left.color == BLACK)
+ {
+ sibling.right.color = BLACK;
+ sibling.color = RED;
+ rotateLeft(sibling);
+ sibling = node.parent.left;
+ }
+
+ sibling.color = sibling.parent.color;
+ sibling.parent.color = BLACK;
+ sibling.left.color = BLACK;
+ rotateRight(node.parent);
+ node = root;
+ }
+ }
+ }
+ node.color = BLACK;
+ }
+
+ public SortedMap subMap(Object fromKey, Object toKey)
+ {
+ if (compare(fromKey, toKey) <= 0)
+ return new SubMap(fromKey, toKey);
+ else
+ throw new IllegalArgumentException("fromKey > toKey");
+ }
+
+ public SortedMap headMap(Object toKey)
+ {
+ return new SubMap(nil, toKey);
+ }
+
+ public SortedMap tailMap(Object fromKey)
+ {
+ return new SubMap(fromKey, nil);
+ }
+
+ /** Returns a "collection view" (or "bag view") of this TreeMap's values. */
+ public Collection values()
+ {
+ // We don't bother overriding many of the optional methods, as doing so
+ // wouldn't provide any significant performance advantage.
+ return new AbstractCollection()
+ {
+ public int size()
+ {
+ return size;
+ }
+
+ public Iterator iterator()
+ {
+ return new TreeIterator(TreeIterator.VALUES);
+ }
+
+ public void clear()
+ {
+ TreeMap.this.clear();
+ }
+ };
+ }
+
+ // Find the "highest" node which is < key. If key is nil, return last node.
+ // Note that highestLessThan is exclusive (it won't return a key which is
+ // equal to "key"), while lowestGreaterThan is inclusive, in order to be
+ // consistent with the semantics of subMap().
+ private Node highestLessThan(Object key)
+ {
+ if (key == nil)
+ return lastNode();
+
+ Node last = nil;
+ Node current = root;
+ int comparison = 0;
+
+ while (current != nil)
+ {
+ last = current;
+ comparison = compare(key, current.key);
+ if (comparison > 0)
+ current = current.right;
+ else if (comparison < 0)
+ current = current.left;
+ else /* Exact match. */
+ return predecessor(last);
+ }
+ if (comparison <= 0)
+ return predecessor(last);
+ else
+ return last;
+ }
+
+ // Find the "lowest" node which is >= key. If key is nil, return first node.
+ private Node lowestGreaterThan(Object key)
+ {
+ if (key == nil)
+ return firstNode();
+
+ Node last = nil;
+ Node current = root;
+ int comparison = 0;
+
+ while (current != nil)
+ {
+ last = current;
+ comparison = compare(key, current.key);
+ if (comparison > 0)
+ current = current.right;
+ else if (comparison < 0)
+ current = current.left;
+ else
+ return current;
+ }
+ if (comparison > 0)
+ return successor(last);
+ else
+ return last;
+ }
+
+ private void writeObject(ObjectOutputStream out) throws IOException
+ {
+ out.defaultWriteObject();
+
+ Node node = firstNode();
+ out.writeInt(size);
+
+ while (node != nil)
+ {
+ out.writeObject(node.key);
+ out.writeObject(node.value);
+ node = successor(node);
+ }
+ }
+
+ private void readObject(ObjectInputStream in)
+ throws IOException, ClassNotFoundException
+ {
+ in.defaultReadObject();
+ int size = in.readInt();
+ putFromObjStream(in, size, true);
+ }
+
+ private int compare(Object o1, Object o2)
+ {
+ if (comparator == null)
+ return ((Comparable) o1).compareTo(o2);
+ else
+ return comparator.compare(o1, o2);
+ }
+
+ /* Return the node following Node, or nil if there isn't one. */
+ private Node successor(Node node)
+ {
+ if (node.right != nil)
+ {
+ node = node.right;
+ while (node.left != nil)
+ node = node.left;
+ return node;
+ }
+
+ Node parent = node.parent;
+ while (parent != nil && node == parent.right)
+ {
+ node = parent;
+ parent = parent.parent;
+ }
+ return parent;
+ }
+
+ /* Return the node preceeding Node, or nil if there isn't one. */
+ private Node predecessor(Node node)
+ {
+ if (node.left != nil)
+ {
+ node = node.left;
+ while (node.right != nil)
+ node = node.right;
+ return node;
+ }
+
+ Node parent = node.parent;
+ while (parent != nil && node == parent.left)
+ {
+ node = parent;
+ parent = parent.parent;
+ }
+ return parent;
+ }
+
+ /** Rotate node n to the left. */
+ private void rotateLeft(Node node)
+ {
+ Node child = node.right;
+
+ // Establish node.right link.
+ node.right = child.left;
+ if (child.left != nil)
+ child.left.parent = node;
+
+ // Establish child->parent link.
+ child.parent = node.parent;
+ if (node.parent != nil)
+ {
+ if (node == node.parent.left)
+ node.parent.left = child;
+ else
+ node.parent.right = child;
+ }
+ else
+ root = child;
+
+ // Link n and child.
+ child.left = node;
+ if (node != nil)
+ node.parent = child;
+ }
+
+ /** Rotate node n to the right. */
+ private void rotateRight(Node node)
+ {
+ Node child = node.left;
+
+ // Establish node.left link.
+ node.left = child.right;
+ if (child.right != nil)
+ child.right.parent = node;
+
+ // Establish child->parent link.
+ child.parent = node.parent;
+ if (node.parent != nil)
+ {
+ if (node == node.parent.right)
+ node.parent.right = child;
+ else
+ node.parent.left = child;
+ }
+ else
+ root = child;
+
+ // Link n and child.
+ child.right = node;
+ if (node != nil)
+ node.parent = child;
+ }
+
+ /* Construct a tree from sorted keys in linear time. This is used to
+ implement TreeSet's SortedSet constructor. */
+ void putKeysLinear(Iterator keys, int count)
+ {
+ fabricateTree(count);
+ Node node = firstNode();
+
+ for (int i = 0; i < count; i++)
+ {
+ node.key = keys.next();
+ node.value = Boolean.TRUE;
+ node = successor(node);
+ }
+ }
+
+ /* As above, but load keys from an ObjectInputStream. Used by readObject()
+ methods. If "readValues" is set, entry values will also be read from the
+ stream. If not, only keys will be read. */
+ void putFromObjStream(ObjectInputStream in, int count, boolean readValues)
+ throws IOException, ClassNotFoundException
+ {
+ fabricateTree(count);
+ Node node = firstNode();
+
+ for (int i = 0; i < count; i++)
+ {
+ node.key = in.readObject();
+ if (readValues)
+ node.value = in.readObject();
+ else
+ node.value = Boolean.TRUE;
+ node = successor(node);
+ }
+ }
+
+ /* Construct a perfectly balanced tree consisting of n "blank" nodes.
+ This permits a tree to be generated from pre-sorted input in linear
+ time. */
+ private void fabricateTree(int count)
+ {
+ if (count == 0)
+ return;
+ // Calculate the (maximum) depth of the perfectly balanced tree.
+ double ddepth = (Math.log (count + 1) / Math.log (2));
+ int maxdepth = (int) Math.ceil (ddepth);
+
+ // The number of nodes which can fit in a perfectly-balanced tree of
+ // height "depth - 1".
+ int max = (int) Math.pow (2, maxdepth - 1) - 1;
+
+ // Number of nodes which spill over into the deepest row of the tree.
+ int overflow = (int) count - max;
+
+ size = count;
+ // Make the root node.
+ root = new Node(null, null);
+ root.parent = nil;
+ root.left = nil;
+ root.right = nil;
+
+ Node row = root;
+ for (int depth = 2; depth <= maxdepth; depth++) // each row
+ {
+ // Number of nodes at this depth
+ int rowcap = (int) Math.pow (2, depth - 1);
+ Node parent = row;
+ Node last = null;
+
+ // Actual number of nodes to create in this row
+ int rowsize;
+ if (depth == maxdepth)
+ rowsize = overflow;
+ else
+ rowsize = rowcap;
+
+ // The bottom most row of nodes is coloured red, as is every second row
+ // going up, except the root node (row 1). I'm not sure if this is the
+ // optimal configuration for the tree, but it seems logical enough.
+ // We just need to honour the black-height and red-parent rules here.
+ boolean colorRowRed = (depth % 2 == maxdepth % 2);
+
+ int i;
+ for (i = 1; i <= rowsize; i++) // each node in row
+ {
+ Node node = new Node(null, null);
+ node.parent = parent;
+ if (i % 2 == 1)
+ parent.left = node;
+ else
+ {
+ Node nextparent = parent.right;
+ parent.right = node;
+ parent = nextparent;
+ }
+
+ // We use the "right" link to maintain a chain of nodes in
+ // each row until the parent->child links are established.
+ if (last != null)
+ last.right = node;
+ last = node;
+
+ if (colorRowRed)
+ node.color = RED;
+
+ if (i == 1)
+ row = node;
+ }
+
+ // Set nil child pointers on leaf nodes.
+ if (depth == maxdepth)
+ {
+ // leaf nodes at maxdepth-1.
+ if (parent != null)
+ {
+ if (i % 2 == 0)
+ {
+ // Current "parent" has "left" set already.
+ Node next = parent.right;
+ parent.right = nil;
+ parent = next;
+ }
+ while (parent != null)
+ {
+ parent.left = nil;
+ Node next = parent.right;
+ parent.right = nil;
+ parent = next;
+ }
+ }
+ // leaf nodes at maxdepth.
+ Node node = row;
+ Node next;
+ while (node != null)
+ {
+ node.left = nil;
+ next = node.right;
+ node.right = nil;
+ node = next;
+ }
+ }
+ }
+ }
+
+ private class VerifyResult
+ {
+ int count; // Total number of nodes.
+ int black; // Black height/depth.
+ int maxdepth; // Maximum depth of branch.
+ }
+
+ /* Check that red-black properties are consistent for the tree. */
+ private void verifyTree()
+ {
+ if (root == nil)
+ {
+ System.err.println ("Verify: empty tree");
+ if (size != 0)
+ verifyError (this, "no root node but size=" + size);
+ return;
+ }
+ VerifyResult vr = verifySub (root);
+ if (vr.count != size)
+ {
+ verifyError (this, "Tree size not consistent with actual nodes counted. "
+ + "counted " + vr.count + ", size=" + size);
+ System.exit(1);
+ }
+ System.err.println ("Verify: " + vr.count + " nodes, black height=" + vr.black
+ + ", maxdepth=" + vr.maxdepth);
+ }
+
+ /* Recursive call to check that rbtree rules hold. Returns total node count
+ and black height of the given branch. */
+ private VerifyResult verifySub(Node n)
+ {
+ VerifyResult vr1 = null;
+ VerifyResult vr2 = null;
+
+ if (n.left == nil && n.right == nil)
+ {
+ // leaf node
+ VerifyResult r = new VerifyResult();
+ r.black = (n.color == BLACK ? 1 : 0);
+ r.count = 1;
+ r.maxdepth = 1;
+ return r;
+ }
+
+ if (n.left != nil)
+ {
+ if (n.left.parent != n)
+ verifyError(n.left, "Node's parent link does not point to " + n);
+
+ if (n.color == RED && n.left.color == RED)
+ verifyError(n, "Red node has red left child");
+
+ vr1 = verifySub (n.left);
+ if (n.right == nil)
+ {
+ if (n.color == BLACK)
+ vr1.black++;
+ vr1.count++;
+ vr1.maxdepth++;
+ return vr1;
+ }
+ }
+
+ if (n.right != nil)
+ {
+ if (n.right.parent != n)
+ verifyError(n.right, "Node's parent link does not point to " + n);
+
+ if (n.color == RED && n.right.color == RED)
+ verifyError(n, "Red node has red right child");
+
+ vr2 = verifySub (n.right);
+ if (n.left == nil)
+ {
+ if (n.color == BLACK)
+ vr2.black++;
+ vr2.count++;
+ vr2.maxdepth++;
+ return vr2;
+ }
+ }
+
+ if (vr1.black != vr2.black)
+ verifyError (n, "Black heights: " + vr1.black + "," + vr2.black + " don't match.");
+ vr1.count += vr2.count + 1;
+ vr1.maxdepth = Math.max(vr1.maxdepth, vr2.maxdepth) + 1;
+ if (n.color == BLACK)
+ vr1.black++;
+ return vr1;
+ }
+
+ private void verifyError (Object obj, String msg)
+ {
+ System.err.print ("Verify error: ");
+ try
+ {
+ System.err.print (obj);
+ }
+ catch (Exception x)
+ {
+ System.err.print ("(error printing obj): " + x);
+ }
+ System.err.println();
+ System.err.println (msg);
+ Thread.dumpStack();
+ System.exit(1);
+ }
+
+ /**
+ * Iterate over HashMap's entries.
+ * This implementation is parameterized to give a sequential view of
+ * keys, values, or entries.
+ */
+ class TreeIterator implements Iterator
+ {
+ static final int ENTRIES = 0,
+ KEYS = 1,
+ VALUES = 2;
+
+ // the type of this Iterator: KEYS, VALUES, or ENTRIES.
+ int type;
+ // the number of modifications to the backing Map that we know about.
+ int knownMod = TreeMap.this.modCount;
+ // The last Entry returned by a next() call.
+ Node last;
+ // The next entry that should be returned by next().
+ Node next;
+ // The last node visible to this iterator. This is used when iterating
+ // on a SubMap.
+ Node max;
+
+ /* Create Iterator with the supplied type: KEYS, VALUES, or ENTRIES */
+ TreeIterator(int type)
+ {
+ this.type = type;
+ this.next = firstNode();
+ }
+
+ /* Construct an interator for a SubMap. Iteration will begin at node
+ "first", and stop when "max" is reached. */
+ TreeIterator(int type, Node first, Node max)
+ {
+ this.type = type;
+ this.next = first;
+ this.max = max;
+ }
+
+ public boolean hasNext()
+ {
+ if (knownMod != TreeMap.this.modCount)
+ throw new ConcurrentModificationException();
+ return (next != nil);
+ }
+
+ public Object next()
+ {
+ if (next == nil)
+ throw new NoSuchElementException();
+ if (knownMod != TreeMap.this.modCount)
+ throw new ConcurrentModificationException();
+ Node n = next;
+
+ // Check limit in case we are iterating through a submap.
+ if (n != max)
+ next = successor(n);
+ else
+ next = nil;
+
+ last = n;
+
+ if (type == VALUES)
+ return n.value;
+ else if (type == KEYS)
+ return n.key;
+ return n;
+ }
+
+ public void remove()
+ {
+ if (last == null)
+ throw new IllegalStateException();
+ if (knownMod != TreeMap.this.modCount)
+ throw new ConcurrentModificationException();
+/*
+ Object key = null;
+ if (next != nil)
+ key = next.key;
+*/
+ TreeMap.this.removeNode(last);
+ knownMod++;
+/*
+ if (key != null)
+ next = getNode(key);
+*/
+ last = null;
+ }
+ }
+
+ class SubMap extends AbstractMap implements SortedMap
+ {
+ Object minKey;
+ Object maxKey;
+
+ /* Create a SubMap representing the elements between minKey and maxKey
+ (inclusive). If minKey is nil, SubMap has no lower bound (headMap).
+ If maxKey is nil, the SubMap has no upper bound (tailMap). */
+ SubMap(Object minKey, Object maxKey)
+ {
+ this.minKey = minKey;
+ this.maxKey = maxKey;
+ }
+
+ public void clear()
+ {
+ Node current;
+ Node next = lowestGreaterThan(minKey);
+ Node max = highestLessThan(maxKey);
+
+ if (compare(next.key, max.key) > 0)
+ // Nothing to delete.
+ return;
+
+ do
+ {
+ current = next;
+ next = successor(current);
+ remove(current);
+ }
+ while (current != max);
+ }
+
+ /* Check if "key" is in within the range bounds for this SubMap.
+ The lower ("from") SubMap range is inclusive, and the upper (to) bound
+ is exclusive. */
+ private boolean keyInRange(Object key)
+ {
+ return ((minKey == nil || compare(key, minKey) >= 0)
+ && (maxKey == nil || compare(key, maxKey) < 0));
+ }
+
+ public boolean containsKey(Object key)
+ {
+ return (keyInRange(key) && TreeMap.this.containsKey(key));
+ }
+
+ public boolean containsValue(Object value)
+ {
+ Node node = lowestGreaterThan(minKey);
+ Node max = highestLessThan(maxKey);
+ Object currentVal;
+
+ if (node == nil || max == nil || compare(node.key, max.key) > 0)
+ // Nothing to search.
+ return false;
+
+ while (true)
+ {
+ currentVal = node.getValue();
+ if (value == null ? currentVal == null : value.equals (currentVal))
+ return true;
+ if (node == max)
+ return false;
+ node = successor(node);
+ }
+ }
+
+ public Object get(Object key)
+ {
+ if (keyInRange(key))
+ return TreeMap.this.get(key);
+ return null;
+ }
+
+ public Object put(Object key, Object value)
+ {
+ if (keyInRange(key))
+ return TreeMap.this.put(key, value);
+ else
+ throw new IllegalArgumentException("Key outside range");
+ }
+
+ public Object remove(Object key)
+ {
+ if (keyInRange(key))
+ return TreeMap.this.remove(key);
+ else
+ return null;
+ }
+
+ public int size()
+ {
+ Node node = lowestGreaterThan(minKey);
+ Node max = highestLessThan(maxKey);
+
+ if (node == nil || max == nil || compare(node.key, max.key) > 0)
+ return 0; // Empty.
+
+ int count = 1;
+ while (node != max)
+ {
+ count++;
+ node = successor(node);
+ }
+
+ return count;
+ }
+
+ public Set entrySet()
+ {
+ // Create an AbstractSet with custom implementations of those methods that
+ // can be overriden easily and efficiently.
+ return new AbstractSet()
+ {
+ public int size()
+ {
+ return SubMap.this.size();
+ }
+
+ public Iterator iterator()
+ {
+ Node first = lowestGreaterThan(minKey);
+ Node max = highestLessThan(maxKey);
+ return new TreeIterator(TreeIterator.ENTRIES, first, max);
+ }
+
+ public void clear()
+ {
+ this.clear();
+ }
+
+ public boolean contains(Object o)
+ {
+ if (!(o instanceof Map.Entry))
+ return false;
+ Map.Entry me = (Map.Entry) o;
+ Object key = me.getKey();
+ if (!keyInRange(key))
+ return false;
+ Node n = getNode(key);
+ return (n != nil && me.getValue().equals(n.value));
+ }
+
+ public boolean remove(Object o)
+ {
+ if (!(o instanceof Map.Entry))
+ return false;
+ Map.Entry me = (Map.Entry) o;
+ Object key = me.getKey();
+ if (!keyInRange(key))
+ return false;
+ Node n = getNode(key);
+ if (n != nil && me.getValue().equals(n.value))
+ {
+ removeNode(n);
+ return true;
+ }
+ return false;
+ }
+ };
+ }
+
+ public Comparator comparator()
+ {
+ return comparator;
+ }
+
+ public Object firstKey()
+ {
+ Node node = lowestGreaterThan(minKey);
+ if (node == nil || !keyInRange(node.key))
+ throw new NoSuchElementException ("empty");
+ return node.key;
+ }
+
+ public Object lastKey()
+ {
+ Node node = highestLessThan(maxKey);
+ if (node == nil || !keyInRange(node.key))
+ throw new NoSuchElementException ("empty");
+ return node.key;
+ }
+
+ public SortedMap subMap(Object fromKey, Object toKey)
+ {
+ if (!keyInRange(fromKey) || !keyInRange(toKey))
+ throw new IllegalArgumentException("key outside range");
+
+ return TreeMap.this.subMap(fromKey, toKey);
+ }
+
+ public SortedMap headMap(Object toKey)
+ {
+ if (!keyInRange(toKey))
+ throw new IllegalArgumentException("key outside range");
+
+ return TreeMap.this.subMap(minKey, toKey);
+ }
+
+ public SortedMap tailMap(Object fromKey)
+ {
+ if (!keyInRange(fromKey))
+ throw new IllegalArgumentException("key outside range");
+
+ return TreeMap.this.subMap(fromKey, maxKey);
+ }
+ }
+}
diff --git a/libjava/java/util/TreeSet.java b/libjava/java/util/TreeSet.java
new file mode 100644
index 00000000000..02d638f80cf
--- /dev/null
+++ b/libjava/java/util/TreeSet.java
@@ -0,0 +1,290 @@
+/* TreeSet.java -- a class providing a TreeMap-backet SortedSet
+ Copyright (C) 1999, 2000, 2001 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.
+
+As a special exception, if you link this library with other files to
+produce an executable, this library 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. */
+
+
+package java.util;
+
+import java.io.IOException;
+import java.io.Serializable;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+
+/**
+ * This class provides a TreeMap-backed implementation of the
+ * SortedSet interface.
+ *
+ * Each element in the Set is a key in the backing TreeMap; each key
+ * maps to a static token, denoting that the key does, in fact, exist.
+ *
+ * Most operations are O(log n).
+ *
+ * TreeSet is a part of the JDK1.2 Collections API.
+ *
+ * @author Jon Zeppieri
+ * @version $Revision: 1.3.2.1 $
+ * @modified $Id: TreeSet.java,v 1.3.2.1 2001/02/17 01:06:45 bryce Exp $
+ */
+
+public class TreeSet extends AbstractSet
+ implements SortedSet, Cloneable, Serializable
+{
+ /** The TreeMap which backs this Set */
+ transient SortedMap map;
+
+ static final long serialVersionUID = -2479143000061671589L;
+
+ /**
+ * Construct a new TreeSet whose backing TreeMap using the "natural"
+ * ordering of keys.
+ */
+ public TreeSet()
+ {
+ map = new TreeMap();
+ }
+
+ /**
+ * Construct a new TreeSet whose backing TreeMap uses the supplied
+ * Comparator.
+ *
+ * @param oComparator the Comparator this Set will use
+ */
+ public TreeSet(Comparator comparator)
+ {
+ map = new TreeMap(comparator);
+ }
+
+ /**
+ * Construct a new TreeSet whose backing TreeMap uses the "natural"
+ * orering of the keys and which contains all of the elements in the
+ * supplied Collection.
+ *
+ * @param oCollection the new Set will be initialized with all
+ * of the elements in this Collection
+ */
+ public TreeSet(Collection collection)
+ {
+ map = new TreeMap();
+ addAll(collection);
+ }
+
+ /**
+ * Construct a new TreeSet, using the same key ordering as the supplied
+ * SortedSet and containing all of the elements in the supplied SortedSet.
+ * This constructor runs in linear time.
+ *
+ * @param sortedSet the new TreeSet will use this SortedSet's
+ * comparator and will initialize itself
+ * with all of the elements in this SortedSet
+ */
+ public TreeSet(SortedSet sortedSet)
+ {
+ TreeMap map = new TreeMap(sortedSet.comparator());
+ int i = 0;
+ Iterator itr = sortedSet.iterator();
+ map.putKeysLinear(itr, sortedSet.size());
+ this.map = map;
+ }
+
+ /* This private constructor is used to implement the subSet() calls around
+ a backing TreeMap.SubMap. */
+ TreeSet(SortedMap backingMap)
+ {
+ map = backingMap;
+ }
+
+ /**
+ * Adds the spplied Object to the Set if it is not already in the Set;
+ * returns true if the element is added, false otherwise
+ *
+ * @param obj the Object to be added to this Set
+ */
+ public boolean add(Object obj)
+ {
+ return (map.put(obj, Boolean.TRUE) == null);
+ }
+
+ /**
+ * Adds all of the elements in the supplied Collection to this TreeSet.
+ *
+ * @param c All of the elements in this Collection
+ * will be added to the Set.
+ *
+ * @return true if the Set is altered, false otherwise
+ */
+ public boolean addAll(Collection c)
+ {
+ boolean result = false;
+ int size = c.size();
+ Iterator itr = c.iterator();
+
+ for (int i = 0; i < size; i++)
+ result |= (map.put(itr.next(), Boolean.TRUE) == null);
+
+ return result;
+ }
+
+ /**
+ * Removes all elements in this Set.
+ */
+ public void clear()
+ {
+ map.clear();
+ }
+
+ /** Returns a shallow copy of this Set. */
+ public Object clone()
+ {
+ TreeSet copy = null;
+ try
+ {
+ copy = (TreeSet) super.clone();
+ }
+ catch (CloneNotSupportedException x)
+ {
+ }
+ copy.map = (SortedMap) ((TreeMap) map).clone();
+ return copy;
+ }
+
+ /** Returns this Set's comparator */
+ public Comparator comparator()
+ {
+ return map.comparator();
+ }
+
+ /**
+ * Returns true if this Set contains the supplied Object,
+ * false otherwise
+ *
+ * @param oObject the Object whose existence in the Set is
+ * being tested
+ */
+ public boolean contains(Object obj)
+ {
+ return map.containsKey(obj);
+ }
+
+ /** Returns true if this Set has size 0, false otherwise */
+ public boolean isEmpty()
+ {
+ return map.isEmpty();
+ }
+
+ /** Returns the number of elements in this Set */
+ public int size()
+ {
+ return map.size();
+ }
+
+ /**
+ * If the supplied Object is in this Set, it is removed, and true is
+ * returned; otherwise, false is returned.
+ *
+ * @param obj the Object we are attempting to remove
+ * from this Set
+ */
+ public boolean remove(Object obj)
+ {
+ return (map.remove(obj) != null);
+ }
+
+ /** Returns the first (by order) element in this Set */
+ public Object first()
+ {
+ return map.firstKey();
+ }
+
+ /** Returns the last (by order) element in this Set */
+ public Object last()
+ {
+ return map.lastKey();
+ }
+
+ /**
+ * Returns a view of this Set including all elements in the interval
+ * [oFromElement, oToElement).
+ *
+ * @param from the resultant view will contain all
+ * elements greater than or equal to this element
+ * @param to the resultant view will contain all
+ * elements less than this element
+ */
+ public SortedSet subSet(Object from, Object to)
+ {
+ return new TreeSet(map.subMap(from, to));
+ }
+
+ /**
+ * Returns a view of this Set including all elements less than oToElement
+ *
+ * @param toElement the resultant view will contain all
+ * elements less than this element
+ */
+ public SortedSet headSet(Object to)
+ {
+ return new TreeSet(map.headMap(to));
+ }
+
+ /**
+ * Returns a view of this Set including all elements greater than or
+ * equal to oFromElement.
+ *
+ * @param from the resultant view will contain all
+ * elements greater than or equal to this element
+ */
+ public SortedSet tailSet(Object from)
+ {
+ return new TreeSet(map.tailMap(from));
+ }
+
+ /** Returns in Iterator over the elements in this TreeSet */
+ public Iterator iterator()
+ {
+ return map.keySet().iterator();
+ }
+
+ private void writeObject(ObjectOutputStream out) throws IOException
+ {
+ Iterator itr = map.keySet().iterator();
+ int size = map.size();
+
+ out.writeObject(map.comparator());
+ out.writeInt(size);
+
+ for (int i = 0; i < size; i++)
+ out.writeObject(itr.next());
+ }
+
+ private void readObject(ObjectInputStream in)
+ throws IOException, ClassNotFoundException
+ {
+ Comparator comparator = (Comparator) in.readObject();
+ int size = in.readInt();
+ TreeMap map = new TreeMap(comparator);
+ map.putFromObjStream(in, size, false);
+ this.map = map;
+ }
+}
diff --git a/libjava/java/util/natGregorianCalendar.cc b/libjava/java/util/natGregorianCalendar.cc
index 58ee4633954..34b49969b45 100644
--- a/libjava/java/util/natGregorianCalendar.cc
+++ b/libjava/java/util/natGregorianCalendar.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998, 1999, 2000 Free Software Foundation
+/* Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation
This file is part of libgcj.
@@ -15,6 +15,7 @@ details. */
#include <gcj/cni.h>
#include <java/util/TimeZone.h>
#include <java/util/GregorianCalendar.h>
+#include <java/lang/IllegalArgumentException.h>
#include <time.h>
void
@@ -27,11 +28,52 @@ java::util::GregorianCalendar::computeTime ()
tim.tm_mday = elements(fields)[DATE];
tim.tm_mon = elements(fields)[MONTH];
tim.tm_year = elements(fields)[YEAR] - 1900;
- tim.tm_isdst = 0; // FIXME
+ tim.tm_isdst = 0;
#ifndef ECOS
// FIXME: None of the standard C library access to the ECOS calendar
// is yet available.
time_t t = mktime (&tim);
+
+ if (!isLenient ())
+ {
+ // mktime will correct for any time leniencies (e.g. 31-Apr becomes
+ // 1-May).
+ // Daylight savings time is a special case since times in hour 23
+ // will compute to hour 0 of the next day.
+ if (tim.tm_isdst == 0 || elements(fields)[HOUR_OF_DAY] != 23)
+ {
+ if (tim.tm_sec != elements(fields)[SECOND] ||
+ tim.tm_min != elements(fields)[MINUTE] ||
+ tim.tm_hour != elements(fields)[HOUR_OF_DAY] +
+ (tim.tm_isdst > 0 ? 1 : 0) ||
+ tim.tm_mday != elements(fields)[DATE] ||
+ tim.tm_mon != elements(fields)[MONTH] ||
+ tim.tm_year != elements(fields)[YEAR] - 1900)
+ throw new java::lang::IllegalArgumentException ();
+ }
+ else
+ {
+ // The easiest thing to do is to temporarily shift the clock
+ // back from the 23th hour so mktime doesn't cause the extra
+ // hour for DST to roll the date to the next day.
+ struct tm tmp_tim;
+ tmp_tim.tm_sec = elements(fields)[SECOND];
+ tmp_tim.tm_min = elements(fields)[MINUTE];
+ tmp_tim.tm_hour = elements(fields)[HOUR_OF_DAY] - 1;
+ tmp_tim.tm_mday = elements(fields)[DATE];
+ tmp_tim.tm_mon = elements(fields)[MONTH];
+ tmp_tim.tm_year = elements(fields)[YEAR] - 1900;
+ tmp_tim.tm_isdst = 0;
+ mktime (&tmp_tim);
+ if (tmp_tim.tm_sec != elements(fields)[SECOND] ||
+ tmp_tim.tm_min != elements(fields)[MINUTE] ||
+ tmp_tim.tm_hour != elements(fields)[HOUR_OF_DAY] ||
+ tmp_tim.tm_mday != elements(fields)[DATE] ||
+ tmp_tim.tm_mon != elements(fields)[MONTH] ||
+ tmp_tim.tm_year != elements(fields)[YEAR] - 1900)
+ throw new java::lang::IllegalArgumentException ();
+ }
+ }
#else
time_t t = 0;
#endif
diff --git a/libjava/java/util/zip/DeflaterOutputStream.java b/libjava/java/util/zip/DeflaterOutputStream.java
index d4218fa5cc5..7a1dbb2cf66 100644
--- a/libjava/java/util/zip/DeflaterOutputStream.java
+++ b/libjava/java/util/zip/DeflaterOutputStream.java
@@ -50,13 +50,13 @@ public class DeflaterOutputStream extends FilterOutputStream
protected void deflate () throws IOException
{
- while (true)
+ do
{
int len = def.deflate(buf, 0, buf.length);
- if (len == 0 || len == -1)
- break;
- out.write(buf, 0, len);
- }
+ if (len > 0)
+ out.write(buf, 0, len);
+ }
+ while (! def.needsInput());
}
public DeflaterOutputStream (OutputStream out)
@@ -78,23 +78,53 @@ public class DeflaterOutputStream extends FilterOutputStream
public void finish () throws IOException
{
+ if (inbufLength > 0)
+ {
+ def.setInput (inbuf, 0, inbufLength);
+ deflate ();
+ inbufLength = 0;
+ }
def.finish();
- deflate ();
+ while (! def.finished ())
+ {
+ int len = def.deflate(buf, 0, buf.length);
+ if (len > 0)
+ out.write(buf, 0, len);
+ }
}
public void write (int bval) throws IOException
{
- byte[] b = new byte[1];
- b[0] = (byte) bval;
- write (b, 0, 1);
+ if (inbuf == null)
+ {
+ inbuf = new byte[128];
+ }
+ else if (inbufLength == inbuf.length)
+ {
+ def.setInput (inbuf, 0, inbufLength);
+ deflate ();
+ inbufLength = 0;
+ }
+ inbuf[inbufLength++] = (byte) bval;
}
public void write (byte[] buf, int off, int len) throws IOException
{
+ if (inbufLength > 0)
+ {
+ def.setInput (inbuf, 0, inbufLength);
+ deflate ();
+ inbufLength = 0;
+ }
def.setInput (buf, off, len);
deflate ();
}
+ // Used, if needed, for write(int).
+ private byte[] inbuf;
+ // Used length of inbuf.
+ private int inbufLength;
+
// The retrieval buffer.
protected byte[] buf;
diff --git a/libjava/java/util/zip/ZipOutputStream.java b/libjava/java/util/zip/ZipOutputStream.java
index a0a8ed744bb..bcbc59154fb 100644
--- a/libjava/java/util/zip/ZipOutputStream.java
+++ b/libjava/java/util/zip/ZipOutputStream.java
@@ -47,35 +47,62 @@ public class ZipOutputStream extends DeflaterOutputStream
public void closeEntry () throws IOException
{
- int uncompressed_size = def.getTotalIn();
- int compressed_size = def.getTotalOut();
- long crc = filter.getChecksum().getValue();
+ int compressed_size;
+ if (current.method == STORED)
+ {
+ compressed_size = uncompressed_size;
+ }
+ else
+ {
+ super.finish();
+ compressed_size = def.getTotalOut();
+ }
+ long crc = sum.getValue();
bytes_written += compressed_size;
- bytes_written += put4 (0x08074b50);
if (current.getCrc() == -1 || current.getCompressedSize() == -1
|| current.getSize() == -1)
{
current.setCrc(crc);
current.compressedSize = compressed_size;
current.setSize(uncompressed_size);
+ put4 (0x08074b50);
+ put4 ((int) (current.getCrc()));
+ put4 ((int) (current.getCompressedSize()));
+ put4 ((int) (current.getSize()));
+ bytes_written += 16;
}
- else
- {
- if (current.getCrc() != crc
- || current.getCompressedSize() != compressed_size
- || current.getSize() != uncompressed_size)
- throw new ZipException ("zip entry field incorrect");
- }
- bytes_written += put4 ((int) (current.getCrc()));
- bytes_written += put4 ((int) (current.getCompressedSize()));
- bytes_written += put4 ((int) (current.getSize()));
+ else if (current.getCrc() != crc
+ || current.getCompressedSize() != compressed_size
+ || current.getSize() != uncompressed_size)
+ throw new ZipException ("zip entry field incorrect");
current.next = chain;
chain = current;
current = null;
- filter = null;
+ }
+
+ public void write (int bval) throws IOException
+ {
+ if (current.method == STORED)
+ {
+ out.write(bval);
+ }
+ else
+ super.write(bval);
+ sum.update(bval);
+ uncompressed_size += 1;
+ }
+
+ public void write (byte[] buf, int off, int len) throws IOException
+ {
+ if (current.method == STORED)
+ out.write(buf, off, len);
+ else
+ super.write(buf, off, len);
+ sum.update(buf, off, len);
+ uncompressed_size += len;
}
public void finish () throws IOException
@@ -101,21 +128,19 @@ public class ZipOutputStream extends DeflaterOutputStream
// Another disk number.
put2 (0);
put2 (count);
+ put2 (count);
put4 (bytes);
put4 ((int) offset);
byte[] c = comment.getBytes("8859_1");
put2 (c.length);
out.write(c);
- out.write((byte) 0);
}
// Helper for finish and putNextEntry.
private int write_entry (ZipEntry entry, boolean is_local)
throws IOException
{
- long offset = bytes_written;
-
int bytes = put4 (is_local ? 0x04034b50 : 0x02014b50);
if (! is_local)
bytes += put_version ();
@@ -169,25 +194,22 @@ public class ZipOutputStream extends DeflaterOutputStream
// Internal file attributes.
bytes += put2 (0);
// External file attributes.
- bytes += put2 (0);
+ bytes += put4 (0);
// Relative offset of local header.
- bytes += put2 ((int) offset);
+ bytes += put4 ((int) entry.relativeOffset);
}
out.write (name);
- out.write ((byte) 0);
- bytes += name.length + 1;
+ bytes += name.length;
if (entry.extra != null)
{
out.write(entry.extra);
- out.write((byte) 0);
- bytes += entry.extra.length + 1;
+ bytes += entry.extra.length;
}
if (comment != null)
{
out.write(comment);
- out.write((byte) 0);
- bytes += comment.length + 1;
+ bytes += comment.length;
}
bytes_written += bytes;
@@ -208,13 +230,13 @@ public class ZipOutputStream extends DeflaterOutputStream
// Just in case.
entry.compressedSize = entry.getSize();
}
+ entry.relativeOffset = bytes_written;
write_entry (entry, true);
current = entry;
int compr = (method == STORED) ? Deflater.NO_COMPRESSION : level;
def.reset();
def.setLevel(compr);
- filter = new CheckedOutputStream (new DeflaterOutputStream (out, def),
- new CRC32 ());
+ sum.reset();
}
public void setLevel (int level)
@@ -240,18 +262,10 @@ public class ZipOutputStream extends DeflaterOutputStream
this.comment = comment;
}
- public synchronized void write (byte[] buf, int off, int len)
- throws IOException
- {
- if (filter == null)
- throw new ZipException ("no open zip entry");
- filter.write(buf, off, len);
- }
-
public ZipOutputStream (OutputStream out)
{
- super (out);
- def = new Deflater (level, true);
+ super (out, new Deflater (Deflater.DEFAULT_COMPRESSION, true), 8192);
+ sum = new CRC32 ();
}
private int put2 (int i) throws IOException
@@ -282,14 +296,14 @@ public class ZipOutputStream extends DeflaterOutputStream
private ZipEntry current;
// The chain of entries which have been written to this file.
private ZipEntry chain;
- // The output stream to which data should be sent.
- private CheckedOutputStream filter;
private int method = DEFLATED;
private int level = Deflater.DEFAULT_COMPRESSION;
private String comment = "";
private long bytes_written;
- // The Deflater we use.
- private Deflater def;
+ private int uncompressed_size;
+
+ /** The checksum object. */
+ private Checksum sum;
}
diff --git a/libjava/javax/naming/Context.java b/libjava/javax/naming/Context.java
index 8d3b9f60813..32dab766fbe 100644
--- a/libjava/javax/naming/Context.java
+++ b/libjava/javax/naming/Context.java
@@ -8,6 +8,8 @@ details. */
package javax.naming;
+import java.util.Hashtable;
+
public interface Context
{
// Property with name of the inital context factory to use
@@ -64,7 +66,7 @@ public interface Context
// Property specifying the credentials of the principal for
// authenticating the caller to the service.
- public static final String SECURITY_CREDENTIAL
+ public static final String SECURITY_CREDENTIALS
= "java.naming.security.credentials";
// Property for specifying the preferred language to use with the
diff --git a/libjava/javax/naming/InitialContext.java b/libjava/javax/naming/InitialContext.java
index f0404a5a324..a670d7b204e 100644
--- a/libjava/javax/naming/InitialContext.java
+++ b/libjava/javax/naming/InitialContext.java
@@ -26,7 +26,7 @@ public class InitialContext implements Context
protected boolean gotDefault = false;
protected Hashtable myProps;
- InitialContext (Hashtable environment)
+ public InitialContext (Hashtable environment)
{
init (environment);
}
@@ -37,7 +37,7 @@ public class InitialContext implements Context
init (null);
}
- InitialContext ()
+ public InitialContext ()
{
init (null);
}
@@ -116,7 +116,7 @@ public class InitialContext implements Context
// FIXME: Is this enough?
private static final String[] colon_list =
{
- Context.OBJECT_FACTORIS,
+ Context.OBJECT_FACTORIES,
Context.URL_PKG_PREFIXES,
Context.STATE_FACTORIES
};
@@ -256,12 +256,12 @@ public class InitialContext implements Context
public void destroySubcontext (Name name) throws NamingException
{
- return getURLOrDefaultInitCtx (name).destroySubcontext (name);
+ getURLOrDefaultInitCtx (name).destroySubcontext (name);
}
public void destroySubcontext (String name) throws NamingException
{
- return getURLOrDefaultInitCtx (name).destroySubcontext (name);
+ getURLOrDefaultInitCtx (name).destroySubcontext (name);
}
public Context createSubcontext (Name name) throws NamingException
@@ -300,15 +300,15 @@ public class InitialContext implements Context
}
public String composeName (String name,
- String prefix) throws NamingException;
+ String prefix) throws NamingException
{
return getURLOrDefaultInitCtx (name).composeName (name, prefix);
}
public Object addToEnvironment (String propName,
- Object propVal) throws NamingException;
+ Object propVal) throws NamingException
{
- myProps.add (propName, propVal);
+ myProps.put (propName, propVal);
}
public Object removeFromEnvironment (String propName) throws NamingException
diff --git a/libjava/javax/naming/Name.java b/libjava/javax/naming/Name.java
index b7eb4f14ece..5fe612a2acc 100644
--- a/libjava/javax/naming/Name.java
+++ b/libjava/javax/naming/Name.java
@@ -8,6 +8,7 @@ details. */
package javax.naming;
+import java.util.Enumeration;
import java.io.Serializable;
public interface Name extends Cloneable, Serializable
diff --git a/libjava/jni.cc b/libjava/jni.cc
index be79ba95d9f..4141010c7d0 100644
--- a/libjava/jni.cc
+++ b/libjava/jni.cc
@@ -115,19 +115,19 @@ jvmpiEnableEvent (jint event_type, void *)
case JVMPI_EVENT_OBJECT_ALLOC:
_Jv_JVMPI_Notify_OBJECT_ALLOC = _Jv_JVMPI_Interface.NotifyEvent;
break;
-
+
case JVMPI_EVENT_THREAD_START:
_Jv_JVMPI_Notify_THREAD_START = _Jv_JVMPI_Interface.NotifyEvent;
break;
-
+
case JVMPI_EVENT_THREAD_END:
_Jv_JVMPI_Notify_THREAD_END = _Jv_JVMPI_Interface.NotifyEvent;
break;
-
+
default:
return JVMPI_NOT_AVAILABLE;
}
-
+
return JVMPI_SUCCESS;
}
@@ -139,11 +139,11 @@ jvmpiDisableEvent (jint event_type, void *)
case JVMPI_EVENT_OBJECT_ALLOC:
_Jv_JVMPI_Notify_OBJECT_ALLOC = NULL;
break;
-
+
default:
return JVMPI_NOT_AVAILABLE;
}
-
+
return JVMPI_SUCCESS;
}
#endif
@@ -281,16 +281,23 @@ _Jv_JNI_NewLocalRef (JNIEnv *env, jobject obj)
// Try to find an open slot somewhere in the topmost frame.
_Jv_JNI_LocalFrame *frame = env->locals;
bool done = false, set = false;
- while (frame != NULL && ! done)
+ for (; frame != NULL && ! done; frame = frame->next)
{
for (int i = 0; i < frame->size; ++i)
- if (frame->vec[i] == NULL)
- {
- set = true;
- done = true;
- frame->vec[i] = obj;
- break;
- }
+ {
+ if (frame->vec[i] == NULL)
+ {
+ set = true;
+ done = true;
+ frame->vec[i] = obj;
+ break;
+ }
+ }
+
+ // If we found a slot, or if the frame we just searched is the
+ // mark frame, then we are done.
+ if (done || frame->marker != MARK_NONE)
+ break;
}
if (! set)
@@ -313,7 +320,7 @@ _Jv_JNI_PopLocalFrame (JNIEnv *env, jobject result, int stop)
bool done = false;
while (rf != NULL && ! done)
- {
+ {
for (int i = 0; i < rf->size; ++i)
if (rf->vec[i] != NULL)
unmark_for_gc (rf->vec[i]);
@@ -335,6 +342,9 @@ _Jv_JNI_PopLocalFrame (JNIEnv *env, jobject result, int stop)
rf = n;
}
+ // Update the local frame information.
+ env->locals = rf;
+
return result == NULL ? NULL : _Jv_JNI_NewLocalRef (env, result);
}
@@ -369,11 +379,15 @@ wrap_value (JNIEnv *, T value)
return value;
}
-template<>
-static jobject
-wrap_value (JNIEnv *env, jobject value)
+// This specialization is used for jobject, jclass, jstring, jarray,
+// etc.
+template<typename T>
+static T *
+wrap_value (JNIEnv *env, T *value)
{
- return value == NULL ? value : _Jv_JNI_NewLocalRef (env, value);
+ return (value == NULL
+ ? value
+ : (T *) _Jv_JNI_NewLocalRef (env, (jobject) value));
}
@@ -385,7 +399,7 @@ _Jv_JNI_GetVersion (JNIEnv *)
}
static jclass
-_Jv_JNI_DefineClass (JNIEnv *env, jobject loader,
+_Jv_JNI_DefineClass (JNIEnv *env, jobject loader,
const jbyte *buf, jsize bufLen)
{
try
@@ -644,9 +658,9 @@ array_from_valist (jvalue *values, JArray<jclass> *arg_types, va_list vargs)
for (int i = 0; i < arg_types->length; ++i)
{
if (arg_elts[i] == JvPrimClass (byte))
- values[i].b = va_arg (vargs, jbyte);
+ values[i].b = (jbyte) va_arg (vargs, int);
else if (arg_elts[i] == JvPrimClass (short))
- values[i].s = va_arg (vargs, jshort);
+ values[i].s = (jshort) va_arg (vargs, int);
else if (arg_elts[i] == JvPrimClass (int))
values[i].i = va_arg (vargs, jint);
else if (arg_elts[i] == JvPrimClass (long))
@@ -656,9 +670,9 @@ array_from_valist (jvalue *values, JArray<jclass> *arg_types, va_list vargs)
else if (arg_elts[i] == JvPrimClass (double))
values[i].d = va_arg (vargs, jdouble);
else if (arg_elts[i] == JvPrimClass (boolean))
- values[i].z = va_arg (vargs, jboolean);
+ values[i].z = (jboolean) va_arg (vargs, int);
else if (arg_elts[i] == JvPrimClass (char))
- values[i].c = va_arg (vargs, jchar);
+ values[i].c = (jchar) va_arg (vargs, int);
else
{
// An object.
@@ -1032,7 +1046,7 @@ _Jv_JNI_NewObjectA (JNIEnv *env, jclass klass, jmethodID id,
template<typename T>
static T
-_Jv_JNI_GetField (JNIEnv *env, jobject obj, jfieldID field)
+_Jv_JNI_GetField (JNIEnv *env, jobject obj, jfieldID field)
{
JvAssert (obj);
T *ptr = (T *) ((char *) obj + field->getOffset ());
@@ -1068,8 +1082,13 @@ _Jv_JNI_GetAnyFieldID (JNIEnv *env, jclass clazz,
// FIXME: what if field_class == NULL?
+ java::lang::ClassLoader *loader = clazz->getClassLoader ();
while (clazz != NULL)
{
+ // We acquire the class lock so that fields aren't resolved
+ // while we are running.
+ JvSynchronize sync (clazz);
+
jint count = (is_static
? JvNumStaticFields (clazz)
: JvNumInstanceFields (clazz));
@@ -1078,12 +1097,11 @@ _Jv_JNI_GetAnyFieldID (JNIEnv *env, jclass clazz,
: JvGetFirstInstanceField (clazz));
for (jint i = 0; i < count; ++i)
{
- // The field is resolved as a side effect of class
- // initialization.
- JvAssert (field->isResolved ());
-
_Jv_Utf8Const *f_name = field->getNameUtf8Const(clazz);
+ // The field might be resolved or it might not be. It
+ // is much simpler to always resolve it.
+ _Jv_ResolveField (field, loader);
if (_Jv_equalUtf8Consts (f_name, a_name)
&& field->getClass() == field_class)
return field;
@@ -1353,7 +1371,9 @@ _Jv_JNI_GetPrimitiveArrayRegion (JNIEnv *env, JArray<T> *array,
jsize start, jsize len,
T *buf)
{
- if (start < 0 || len >= array->length || start + len >= array->length)
+ // The cast to unsigned lets us save a comparison.
+ if (start < 0 || len < 0
+ || (unsigned long) (start + len) > (unsigned long) array->length)
{
try
{
@@ -1375,10 +1395,12 @@ _Jv_JNI_GetPrimitiveArrayRegion (JNIEnv *env, JArray<T> *array,
template<typename T>
static void
-_Jv_JNI_SetPrimitiveArrayRegion (JNIEnv *env, JArray<T> *array,
+_Jv_JNI_SetPrimitiveArrayRegion (JNIEnv *env, JArray<T> *array,
jsize start, jsize len, T *buf)
{
- if (start < 0 || len >= array->length || start + len >= array->length)
+ // The cast to unsigned lets us save a comparison.
+ if (start < 0 || len < 0
+ || (unsigned long) (start + len) > (unsigned long) array->length)
{
try
{
@@ -1591,8 +1613,6 @@ _Jv_JNI_UnregisterNatives (JNIEnv *, jclass)
-#ifdef INTERPRETER
-
// Add a character to the buffer, encoding properly.
static void
add_char (char *buf, jchar c, int *here)
@@ -1612,11 +1632,14 @@ add_char (char *buf, jchar c, int *here)
buf[(*here)++] = '_';
buf[(*here)++] = '3';
}
- else if (c == '/')
+
+ // Also check for `.' here because we might be passed an internal
+ // qualified class name like `foo.bar'.
+ else if (c == '/' || c == '.')
buf[(*here)++] = '_';
else if ((c >= '0' && c <= '9')
- || (c >= 'a' && c <= 'z')
- || (c >= 'A' && c <= 'Z'))
+ || (c >= 'a' && c <= 'z')
+ || (c >= 'A' && c <= 'Z'))
buf[(*here)++] = (char) c;
else
{
@@ -1626,7 +1649,7 @@ add_char (char *buf, jchar c, int *here)
for (int i = 0; i < 4; ++i)
{
int val = c & 0x0f;
- buf[(*here) + 4 - i] = (val > 10) ? ('a' + val - 10) : ('0' + val);
+ buf[(*here) + 3 - i] = (val > 10) ? ('a' + val - 10) : ('0' + val);
c >>= 4;
}
*here += 4;
@@ -1746,6 +1769,8 @@ _Jv_LookupJNIMethod (jclass klass, _Jv_Utf8Const *name,
return function;
}
+#ifdef INTERPRETER
+
// This function is the stub which is used to turn an ordinary (CNI)
// method call into a JNI call.
void
diff --git a/libjava/libgcj.spec.in b/libjava/libgcj.spec.in
index 4df62fab697..54ef9fe75b4 100644
--- a/libjava/libgcj.spec.in
+++ b/libjava/libgcj.spec.in
@@ -4,9 +4,9 @@
# to link with libgcj.
#
%rename lib liborig
-*lib: -lgcj -lm @GCSPEC@ @THREADSPEC@ @ZLIBSPEC@ @SYSTEMSPEC@ %(liborig)
+*lib: -lgcj -lm @LIBICONV@ @GCSPEC@ @THREADSPEC@ @ZLIBSPEC@ @SYSTEMSPEC@ %(libgcc) %(liborig)
-*jc1: @DIVIDESPEC@ @EXCEPTIONSPEC@ @JC1GCSPEC@ -fasynchronous-exceptions
+*jc1: @DIVIDESPEC@ @JC1GCSPEC@ @EXCEPTIONSPEC@
#
# On some systems we force in a data_start symbol so that the GC will work
diff --git a/libjava/libltdl/ChangeLog b/libjava/libltdl/ChangeLog
index a013585e5d5..75a56cc4820 100644
--- a/libjava/libltdl/ChangeLog
+++ b/libjava/libltdl/ChangeLog
@@ -1,3 +1,33 @@
+2002-02-20 Release Manager
+
+ * GCC 3.0.4 Released.
+
+2001-12-20 Release Manager
+
+ * GCC 3.0.3 Released.
+
+2001-10-23 Release Manager
+
+ * GCC 3.0.2 Released.
+
+2001-08-19 Release Manager
+
+ * GCC 3.0.1 Released.
+
+2001-08-19 Release Manager
+
+ * GCC 3.0.1 Released.
+
+2001-07-02 Tom Tromey <tromey@redhat.com>
+
+ * configure: Rebuilt.
+ * configure.in: Added aux-dir hacks to satisfy automake and
+ in-tree builds.
+
+20010617 Release Manager
+
+ * GCC 3.0 Released.
+
2000-09-10 Alexandre Oliva <aoliva@redhat.com>
* Updated from libtool multi-language branch.
diff --git a/libjava/libltdl/Makefile.in b/libjava/libltdl/Makefile.in
index bfea1574b6b..9fd9ebf882b 100644
--- a/libjava/libltdl/Makefile.in
+++ b/libjava/libltdl/Makefile.in
@@ -80,16 +80,21 @@ PACKAGE = @PACKAGE@
RANLIB = @RANLIB@
STRIP = @STRIP@
VERSION = @VERSION@
+mkinstalldirs = @mkinstalldirs@
AUTOMAKE_OPTIONS = no-dependencies foreign
INCLUDES = $(GCINCS)
-@INSTALL_LTDL_TRUE@include_HEADERS = ltdl.h
-@INSTALL_LTDL_TRUE@lib_LTLIBRARIES = libltdl.la
-@INSTALL_LTDL_FALSE@noinst_HEADERS = ltdl.h
+@INSTALL_LTDL_TRUE@include_HEADERS = \
+@INSTALL_LTDL_TRUE@ltdl.h
+@INSTALL_LTDL_TRUE@lib_LTLIBRARIES = \
+@INSTALL_LTDL_TRUE@libltdl.la
+@INSTALL_LTDL_FALSE@noinst_HEADERS = \
+@INSTALL_LTDL_FALSE@ltdl.h
-@CONVENIENCE_LTDL_TRUE@noinst_LTLIBRARIES = libltdlc.la
+@CONVENIENCE_LTDL_TRUE@noinst_LTLIBRARIES = \
+@CONVENIENCE_LTDL_TRUE@libltdlc.la
libltdl_la_SOURCES = ltdl.c
libltdl_la_LDFLAGS = -no-undefined -version-info 2:0:2
@@ -98,7 +103,6 @@ libltdl_la_LIBADD = $(LIBADD_DL)
libltdlc_la_SOURCES = ltdl.c
libltdlc_la_LIBADD = $(LIBADD_DL)
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-mkinstalldirs = $(SHELL) $(top_srcdir)/../../mkinstalldirs
CONFIG_HEADER = config.h
CONFIG_CLEAN_FILES =
LTLIBRARIES = $(lib_LTLIBRARIES) $(noinst_LTLIBRARIES)
@@ -127,7 +131,7 @@ configure.in
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
-TAR = gtar
+TAR = tar
GZIP_ENV = --best
SOURCES = $(libltdl_la_SOURCES) $(libltdlc_la_SOURCES)
OBJECTS = $(libltdl_la_OBJECTS) $(libltdlc_la_OBJECTS)
@@ -347,7 +351,7 @@ distdir: $(DISTFILES)
@for file in $(DISTFILES); do \
d=$(srcdir); \
if test -d $$d/$$file; then \
- cp -pr $$d/$$file $(distdir)/$$file; \
+ cp -pr $$/$$file $(distdir)/$$file; \
else \
test -f $(distdir)/$$file \
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
diff --git a/libjava/libltdl/configure b/libjava/libltdl/configure
index f0e6f22323d..87475d27edb 100755
--- a/libjava/libltdl/configure
+++ b/libjava/libltdl/configure
@@ -49,6 +49,7 @@ program_suffix=NONE
program_transform_name=s,x,x,
silent=
site=
+sitefile=
srcdir=
target=NONE
verbose=
@@ -163,6 +164,7 @@ Configuration:
--help print this message
--no-create do not create output files
--quiet, --silent do not print \`checking...' messages
+ --site-file=FILE use FILE as the site file
--version print the version of autoconf that created configure
Directory and file names:
--prefix=PREFIX install architecture-independent files in PREFIX
@@ -333,6 +335,11 @@ EOF
-site=* | --site=* | --sit=*)
site="$ac_optarg" ;;
+ -site-file | --site-file | --site-fil | --site-fi | --site-f)
+ ac_prev=sitefile ;;
+ -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*)
+ sitefile="$ac_optarg" ;;
+
-srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
ac_prev=srcdir ;;
-srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
@@ -498,12 +505,16 @@ fi
srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
# Prefer explicitly selected file to automatically selected ones.
-if test -z "$CONFIG_SITE"; then
- if test "x$prefix" != xNONE; then
- CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
- else
- CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+if test -z "$sitefile"; then
+ if test -z "$CONFIG_SITE"; then
+ if test "x$prefix" != xNONE; then
+ CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+ else
+ CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+ fi
fi
+else
+ CONFIG_SITE="$sitefile"
fi
for ac_site_file in $CONFIG_SITE; do
if test -r "$ac_site_file"; then
@@ -542,12 +553,12 @@ else
fi
echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
-echo "configure:546: checking for Cygwin environment" >&5
+echo "configure:557: checking for Cygwin environment" >&5
if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 551 "configure"
+#line 562 "configure"
#include "confdefs.h"
int main() {
@@ -558,7 +569,7 @@ int main() {
return __CYGWIN__;
; return 0; }
EOF
-if { (eval echo configure:562: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:573: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_cygwin=yes
else
@@ -575,19 +586,19 @@ echo "$ac_t""$ac_cv_cygwin" 1>&6
CYGWIN=
test "$ac_cv_cygwin" = yes && CYGWIN=yes
echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
-echo "configure:579: checking for mingw32 environment" >&5
+echo "configure:590: checking for mingw32 environment" >&5
if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 584 "configure"
+#line 595 "configure"
#include "confdefs.h"
int main() {
return __MINGW32__;
; return 0; }
EOF
-if { (eval echo configure:591: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:602: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_mingw32=yes
else
@@ -609,7 +620,7 @@ test "$ac_cv_mingw32" = yes && MINGW32=yes
if test "${with_auxdir+set}" = set; then
withval="$with_auxdir"
ac_aux_dir=
-for ac_dir in $with_auxdir; do
+for ac_dir in $with_auxdir $srcdir/$with_auxdir; do
if test -f $ac_dir/install-sh; then
ac_aux_dir=$ac_dir
ac_install_sh="$ac_aux_dir/install-sh -c"
@@ -621,12 +632,13 @@ for ac_dir in $with_auxdir; do
fi
done
if test -z "$ac_aux_dir"; then
- { echo "configure: error: can not find install-sh or install.sh in $with_auxdir" 1>&2; exit 1; }
+ { echo "configure: error: can not find install-sh or install.sh in $with_auxdir $srcdir/$with_auxdir" 1>&2; exit 1; }
fi
ac_config_guess=$ac_aux_dir/config.guess
ac_config_sub=$ac_aux_dir/config.sub
ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
+
else
ac_aux_dir=
for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
@@ -650,6 +662,10 @@ ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
fi
+# This is another blatant hack to work around automake bugs.
+mkinstalldirs="$ac_aux_dir/mkinstalldirs"
+
+
if test -z "$enable_ltdl_install$enable_ltdl_convenience"; then
if test -f ${srcdir}/ltconfig && test -f ${srcdir}/ltmain.sh; then
# if libltdl is libtoolized, it is assumed to be stand-alone and
@@ -674,7 +690,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:678: checking for a BSD compatible install" >&5
+echo "configure:694: 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
@@ -727,7 +743,7 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
-echo "configure:731: checking whether build environment is sane" >&5
+echo "configure:747: checking whether build environment is sane" >&5
# Just in case
sleep 1
echo timestamp > conftestfile
@@ -784,7 +800,7 @@ test "$program_suffix" != NONE &&
test "$program_transform_name" = "" && program_transform_name="s,x,x,"
echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:788: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:804: 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
@@ -823,7 +839,7 @@ fi
missing_dir=`cd $ac_aux_dir && pwd`
echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
-echo "configure:827: checking for working aclocal" >&5
+echo "configure:843: checking for working aclocal" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh.
@@ -836,7 +852,7 @@ else
fi
echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
-echo "configure:840: checking for working autoconf" >&5
+echo "configure:856: checking for working autoconf" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh.
@@ -849,7 +865,7 @@ else
fi
echo $ac_n "checking for working automake""... $ac_c" 1>&6
-echo "configure:853: checking for working automake" >&5
+echo "configure:869: checking for working automake" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh.
@@ -862,7 +878,7 @@ else
fi
echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
-echo "configure:866: checking for working autoheader" >&5
+echo "configure:882: checking for working autoheader" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh.
@@ -875,7 +891,7 @@ else
fi
echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
-echo "configure:879: checking for working makeinfo" >&5
+echo "configure:895: checking for working makeinfo" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh.
@@ -892,7 +908,7 @@ fi
echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
-echo "configure:896: checking whether to enable maintainer-specific portions of Makefiles" >&5
+echo "configure:912: 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"
@@ -918,7 +934,7 @@ fi
# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:922: checking for $ac_word" >&5
+echo "configure:938: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -948,7 +964,7 @@ if test -z "$CC"; then
# Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:952: checking for $ac_word" >&5
+echo "configure:968: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -999,7 +1015,7 @@ fi
# Extract the first word of "cl", so it can be a program name with args.
set dummy cl; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1003: checking for $ac_word" >&5
+echo "configure:1019: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1031,7 +1047,7 @@ fi
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:1035: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:1051: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -1042,12 +1058,12 @@ cross_compiling=$ac_cv_prog_cc_cross
cat > conftest.$ac_ext << EOF
-#line 1046 "configure"
+#line 1062 "configure"
#include "confdefs.h"
main(){return(0);}
EOF
-if { (eval echo configure:1051: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1067: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ac_cv_prog_cc_works=yes
# If we can't run a trivial program, we are probably using a cross compiler.
if (./conftest; exit) 2>/dev/null; then
@@ -1073,12 +1089,12 @@ if test $ac_cv_prog_cc_works = no; then
{ echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:1077: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:1093: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
cross_compiling=$ac_cv_prog_cc_cross
echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:1082: checking whether we are using GNU C" >&5
+echo "configure:1098: checking whether we are using GNU C" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1087,7 +1103,7 @@ else
yes;
#endif
EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1091: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1107: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
ac_cv_prog_gcc=yes
else
ac_cv_prog_gcc=no
@@ -1106,7 +1122,7 @@ ac_test_CFLAGS="${CFLAGS+set}"
ac_save_CFLAGS="$CFLAGS"
CFLAGS=
echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:1110: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:1126: checking whether ${CC-cc} accepts -g" >&5
if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1138,12 +1154,12 @@ else
fi
echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:1142: checking for working const" >&5
+echo "configure:1158: 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 1147 "configure"
+#line 1163 "configure"
#include "confdefs.h"
int main() {
@@ -1192,7 +1208,7 @@ ccp = (char const *const *) p;
; return 0; }
EOF
-if { (eval echo configure:1196: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1212: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_const=yes
else
@@ -1213,21 +1229,21 @@ EOF
fi
echo $ac_n "checking for inline""... $ac_c" 1>&6
-echo "configure:1217: checking for inline" >&5
+echo "configure:1233: checking for inline" >&5
if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_cv_c_inline=no
for ac_kw in inline __inline__ __inline; do
cat > conftest.$ac_ext <<EOF
-#line 1224 "configure"
+#line 1240 "configure"
#include "confdefs.h"
int main() {
} $ac_kw foo() {
; return 0; }
EOF
-if { (eval echo configure:1231: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1247: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_inline=$ac_kw; break
else
@@ -1330,7 +1346,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
fi
echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:1334: checking host system type" >&5
+echo "configure:1350: checking host system type" >&5
host_alias=$host
case "$host_alias" in
@@ -1351,7 +1367,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
echo "$ac_t""$host" 1>&6
echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:1355: checking build system type" >&5
+echo "configure:1371: checking build system type" >&5
build_alias=$build
case "$build_alias" in
@@ -1380,7 +1396,7 @@ ac_prog=ld
if test "$ac_cv_prog_gcc" = yes; then
# Check if gcc -print-prog-name=ld gives a path.
echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
-echo "configure:1384: checking for ld used by GCC" >&5
+echo "configure:1400: checking for ld used by GCC" >&5
case $host in
*-*-mingw*)
# gcc leaves a trailing carriage return which upsets mingw
@@ -1410,10 +1426,10 @@ echo "configure:1384: checking for ld used by GCC" >&5
esac
elif test "$with_gnu_ld" = yes; then
echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
-echo "configure:1414: checking for GNU ld" >&5
+echo "configure:1430: checking for GNU ld" >&5
else
echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
-echo "configure:1417: checking for non-GNU ld" >&5
+echo "configure:1433: checking for non-GNU ld" >&5
fi
if eval "test \"`echo '$''{'ac_cv_path_LD'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1448,7 +1464,7 @@ else
fi
test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
-echo "configure:1452: checking if the linker ($LD) is GNU ld" >&5
+echo "configure:1468: checking if the linker ($LD) is GNU ld" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gnu_ld'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1465,7 +1481,7 @@ with_gnu_ld=$ac_cv_prog_gnu_ld
echo $ac_n "checking for $LD option to reload object files""... $ac_c" 1>&6
-echo "configure:1469: checking for $LD option to reload object files" >&5
+echo "configure:1485: checking for $LD option to reload object files" >&5
if eval "test \"`echo '$''{'lt_cv_ld_reload_flag'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1477,7 +1493,7 @@ reload_flag=$lt_cv_ld_reload_flag
test -n "$reload_flag" && reload_flag=" $reload_flag"
echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
-echo "configure:1481: checking for BSD-compatible nm" >&5
+echo "configure:1497: checking for BSD-compatible nm" >&5
if eval "test \"`echo '$''{'ac_cv_path_NM'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1515,7 +1531,7 @@ NM="$ac_cv_path_NM"
echo "$ac_t""$NM" 1>&6
echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:1519: checking whether ln -s works" >&5
+echo "configure:1535: checking whether ln -s works" >&5
if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1536,7 +1552,7 @@ else
fi
echo $ac_n "checking how to recognise dependant libraries""... $ac_c" 1>&6
-echo "configure:1540: checking how to recognise dependant libraries" >&5
+echo "configure:1556: checking how to recognise dependant libraries" >&5
if eval "test \"`echo '$''{'lt_cv_deplibs_check_method'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1679,13 +1695,13 @@ file_magic_cmd=$lt_cv_file_magic_cmd
deplibs_check_method=$lt_cv_deplibs_check_method
echo $ac_n "checking for object suffix""... $ac_c" 1>&6
-echo "configure:1683: checking for object suffix" >&5
+echo "configure:1699: checking for object suffix" >&5
if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
rm -f conftest*
echo 'int i = 1;' > conftest.$ac_ext
-if { (eval echo configure:1689: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1705: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
for ac_file in conftest.*; do
case $ac_file in
*.c) ;;
@@ -1705,7 +1721,7 @@ ac_objext=$ac_cv_objext
echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:1709: checking for executable suffix" >&5
+echo "configure:1725: checking for executable suffix" >&5
if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1715,10 +1731,10 @@ else
rm -f conftest*
echo 'int main () { return 0; }' > conftest.$ac_ext
ac_cv_exeext=
- if { (eval echo configure:1719: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+ if { (eval echo configure:1735: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
for file in conftest.*; do
case $file in
- *.c | *.o | *.obj) ;;
+ *.c | *.o | *.obj | *.ilk | *.pdb) ;;
*) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
esac
done
@@ -1748,7 +1764,7 @@ case "$deplibs_check_method" in
file_magic*)
if test "$file_magic_cmd" = '${MAGIC}'; then
echo $ac_n "checking for ${ac_tool_prefix}file""... $ac_c" 1>&6
-echo "configure:1752: checking for ${ac_tool_prefix}file" >&5
+echo "configure:1768: checking for ${ac_tool_prefix}file" >&5
if eval "test \"`echo '$''{'lt_cv_path_MAGIC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1810,7 +1826,7 @@ fi
if test -z "$lt_cv_path_MAGIC"; then
if test -n "$ac_tool_prefix"; then
echo $ac_n "checking for file""... $ac_c" 1>&6
-echo "configure:1814: checking for file" >&5
+echo "configure:1830: checking for file" >&5
if eval "test \"`echo '$''{'lt_cv_path_MAGIC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1881,7 +1897,7 @@ esac
# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
set dummy ${ac_tool_prefix}ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1885: checking for $ac_word" >&5
+echo "configure:1901: 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
@@ -1913,7 +1929,7 @@ if test -n "$ac_tool_prefix"; 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:1917: checking for $ac_word" >&5
+echo "configure:1933: 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
@@ -1948,7 +1964,7 @@ fi
# Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
set dummy ${ac_tool_prefix}strip; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1952: checking for $ac_word" >&5
+echo "configure:1968: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1980,7 +1996,7 @@ if test -n "$ac_tool_prefix"; then
# Extract the first word of "strip", so it can be a program name with args.
set dummy strip; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1984: checking for $ac_word" >&5
+echo "configure:2000: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2047,8 +2063,8 @@ test x"$pic_mode" = xno && libtool_flags="$libtool_flags --prefer-non-pic"
case "$host" in
*-*-irix6*)
# Find out which ABI we are using.
- echo '#line 2051 "configure"' > conftest.$ac_ext
- if { (eval echo configure:2052: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ echo '#line 2067 "configure"' > conftest.$ac_ext
+ if { (eval echo configure:2068: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
case "`/usr/bin/file conftest.o`" in
*32-bit*)
LD="${LD-ld} -32"
@@ -2069,7 +2085,7 @@ case "$host" in
SAVE_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -belf"
echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6
-echo "configure:2073: checking whether the C compiler needs -belf" >&5
+echo "configure:2089: checking whether the C compiler needs -belf" >&5
if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2082,14 +2098,14 @@ ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$a
cross_compiling=$ac_cv_prog_cc_cross
cat > conftest.$ac_ext <<EOF
-#line 2086 "configure"
+#line 2102 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
-if { (eval echo configure:2093: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2109: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
lt_cv_cc_needs_belf=yes
else
@@ -2119,7 +2135,7 @@ echo "$ac_t""$lt_cv_cc_needs_belf" 1>&6
# Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
set dummy ${ac_tool_prefix}dlltool; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2123: checking for $ac_word" >&5
+echo "configure:2139: 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
@@ -2151,7 +2167,7 @@ if test -n "$ac_tool_prefix"; 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:2155: checking for $ac_word" >&5
+echo "configure:2171: 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
@@ -2186,7 +2202,7 @@ fi
# Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args.
set dummy ${ac_tool_prefix}as; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2190: checking for $ac_word" >&5
+echo "configure:2206: 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
@@ -2218,7 +2234,7 @@ if test -n "$ac_tool_prefix"; 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:2222: checking for $ac_word" >&5
+echo "configure:2238: 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
@@ -2253,7 +2269,7 @@ fi
# Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
set dummy ${ac_tool_prefix}objdump; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2257: checking for $ac_word" >&5
+echo "configure:2273: 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
@@ -2285,7 +2301,7 @@ if test -n "$ac_tool_prefix"; 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:2289: checking for $ac_word" >&5
+echo "configure:2305: 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
@@ -2321,12 +2337,12 @@ fi
# recent cygwin and mingw systems supply a stub DllMain which the user
# can override, but on older systems we have to supply one
echo $ac_n "checking if libtool should supply DllMain function""... $ac_c" 1>&6
-echo "configure:2325: checking if libtool should supply DllMain function" >&5
+echo "configure:2341: checking if libtool should supply DllMain function" >&5
if eval "test \"`echo '$''{'lt_cv_need_dllmain'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2330 "configure"
+#line 2346 "configure"
#include "confdefs.h"
int main() {
@@ -2334,7 +2350,7 @@ extern int __attribute__((__stdcall__)) DllMain(void*, int, void*);
DllMain (0, 0, 0);
; return 0; }
EOF
-if { (eval echo configure:2338: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2354: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
lt_cv_need_dllmain=no
else
@@ -2355,19 +2371,19 @@ echo "$ac_t""$lt_cv_need_dllmain" 1>&6
SAVE_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -mdll"
echo $ac_n "checking how to link DLLs""... $ac_c" 1>&6
-echo "configure:2359: checking how to link DLLs" >&5
+echo "configure:2375: checking how to link DLLs" >&5
if eval "test \"`echo '$''{'lt_cv_cc_dll_switch'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2364 "configure"
+#line 2380 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
-if { (eval echo configure:2371: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2387: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
lt_cv_cc_dll_switch=-mdll
else
@@ -2479,7 +2495,7 @@ exec 5>>./config.log
echo $ac_n "checking for garbage collector to use""... $ac_c" 1>&6
-echo "configure:2483: checking for garbage collector to use" >&5
+echo "configure:2499: checking for garbage collector to use" >&5
# Check whether --enable-java-gc or --disable-java-gc was given.
if test "${enable_java_gc+set}" = set; then
enableval="$enable_java_gc"
@@ -2502,7 +2518,7 @@ fi
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:2506: checking how to run the C preprocessor" >&5
+echo "configure:2522: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
@@ -2517,13 +2533,13 @@ else
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp.
cat > conftest.$ac_ext <<EOF
-#line 2521 "configure"
+#line 2537 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2527: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2543: \"$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
:
@@ -2534,13 +2550,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
-#line 2538 "configure"
+#line 2554 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2544: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2560: \"$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
:
@@ -2551,13 +2567,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -nologo -E"
cat > conftest.$ac_ext <<EOF
-#line 2555 "configure"
+#line 2571 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2561: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2577: \"$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
:
@@ -2589,7 +2605,7 @@ rm -f conftest
# Check for command to grab the raw symbol name followed by C symbol from nm.
echo $ac_n "checking command to parse $NM output""... $ac_c" 1>&6
-echo "configure:2593: checking command to parse $NM output" >&5
+echo "configure:2609: checking command to parse $NM output" >&5
if eval "test \"`echo '$''{'ac_cv_sys_global_symbol_pipe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2652,11 +2668,11 @@ void nm_test_func(){}
int main(){nm_test_var='a';nm_test_func;return 0;}
EOF
- if { (eval echo configure:2656: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ if { (eval echo configure:2672: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
# Now try to grab the symbols.
ac_nlist=conftest.nm
- if { (eval echo configure:2660: \"$NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist\") 1>&5; (eval $NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) 2>&5; } && test -s "$ac_nlist"; then
+ if { (eval echo configure:2676: \"$NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist\") 1>&5; (eval $NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) 2>&5; } && test -s "$ac_nlist"; then
# Try sorting and uniquifying the output.
if sort "$ac_nlist" | uniq > "$ac_nlist"T; then
@@ -2708,7 +2724,7 @@ EOF
ac_save_CFLAGS="$CFLAGS"
LIBS="conftstm.$ac_objext"
CFLAGS="$CFLAGS$no_builtin_flag"
- if { (eval echo configure:2712: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+ if { (eval echo configure:2728: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
ac_pipe_works=yes
else
echo "configure: failed program was:" >&5
@@ -2754,12 +2770,12 @@ fi
echo "$ac_t""$ac_result" 1>&6
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:2758: checking for ANSI C header files" >&5
+echo "configure:2774: 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 2763 "configure"
+#line 2779 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
@@ -2767,7 +2783,7 @@ else
#include <float.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2771: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2787: \"$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*
@@ -2784,7 +2800,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 2788 "configure"
+#line 2804 "configure"
#include "confdefs.h"
#include <string.h>
EOF
@@ -2802,7 +2818,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 2806 "configure"
+#line 2822 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
@@ -2823,7 +2839,7 @@ if test "$cross_compiling" = yes; then
:
else
cat > conftest.$ac_ext <<EOF
-#line 2827 "configure"
+#line 2843 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -2834,7 +2850,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); }
EOF
-if { (eval echo configure:2838: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2854: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
:
else
@@ -2884,7 +2900,7 @@ else
fi
echo $ac_n "checking which extension is used for shared libraries""... $ac_c" 1>&6
-echo "configure:2888: checking which extension is used for shared libraries" >&5
+echo "configure:2904: checking which extension is used for shared libraries" >&5
if eval "test \"`echo '$''{'libltdl_cv_shlibext'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2911,7 +2927,7 @@ EOF
fi
echo $ac_n "checking which variable specifies run-time library path""... $ac_c" 1>&6
-echo "configure:2915: checking which variable specifies run-time library path" >&5
+echo "configure:2931: checking which variable specifies run-time library path" >&5
if eval "test \"`echo '$''{'libltdl_cv_shlibpath_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2927,7 +2943,7 @@ EOF
fi
echo $ac_n "checking for the default library search path""... $ac_c" 1>&6
-echo "configure:2931: checking for the default library search path" >&5
+echo "configure:2947: checking for the default library search path" >&5
if eval "test \"`echo '$''{'libltdl_cv_sys_search_path'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2955,7 +2971,7 @@ EOF
fi
echo $ac_n "checking for objdir""... $ac_c" 1>&6
-echo "configure:2959: checking for objdir" >&5
+echo "configure:2975: checking for objdir" >&5
if eval "test \"`echo '$''{'libltdl_cv_objdir'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2982,7 +2998,7 @@ EOF
echo $ac_n "checking whether libtool supports -dlopen/-dlpreopen""... $ac_c" 1>&6
-echo "configure:2986: checking whether libtool supports -dlopen/-dlpreopen" >&5
+echo "configure:3002: checking whether libtool supports -dlopen/-dlpreopen" >&5
if eval "test \"`echo '$''{'libltdl_cv_preloaded_symbols'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3004,7 +3020,7 @@ fi
LIBADD_DL=
echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
-echo "configure:3008: checking for dlopen in -ldl" >&5
+echo "configure:3024: checking for dlopen in -ldl" >&5
ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -3012,7 +3028,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 3016 "configure"
+#line 3032 "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
@@ -3023,7 +3039,7 @@ int main() {
dlopen()
; return 0; }
EOF
-if { (eval echo configure:3027: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3043: \"$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
@@ -3045,12 +3061,12 @@ EOF
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for dlopen""... $ac_c" 1>&6
-echo "configure:3049: checking for dlopen" >&5
+echo "configure:3065: checking for dlopen" >&5
if eval "test \"`echo '$''{'ac_cv_func_dlopen'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3054 "configure"
+#line 3070 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char dlopen(); below. */
@@ -3073,7 +3089,7 @@ dlopen();
; return 0; }
EOF
-if { (eval echo configure:3077: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3093: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_dlopen=yes"
else
@@ -3094,7 +3110,7 @@ EOF
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for dlopen in -lsvld""... $ac_c" 1>&6
-echo "configure:3098: checking for dlopen in -lsvld" >&5
+echo "configure:3114: checking for dlopen in -lsvld" >&5
ac_lib_var=`echo svld'_'dlopen | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -3102,7 +3118,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lsvld $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 3106 "configure"
+#line 3122 "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
@@ -3113,7 +3129,7 @@ int main() {
dlopen()
; return 0; }
EOF
-if { (eval echo configure:3117: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3133: \"$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
@@ -3142,12 +3158,12 @@ fi
fi
echo $ac_n "checking for shl_load""... $ac_c" 1>&6
-echo "configure:3146: checking for shl_load" >&5
+echo "configure:3162: checking for shl_load" >&5
if eval "test \"`echo '$''{'ac_cv_func_shl_load'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3151 "configure"
+#line 3167 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char shl_load(); below. */
@@ -3170,7 +3186,7 @@ shl_load();
; return 0; }
EOF
-if { (eval echo configure:3174: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3190: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_shl_load=yes"
else
@@ -3191,7 +3207,7 @@ EOF
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6
-echo "configure:3195: checking for shl_load in -ldld" >&5
+echo "configure:3211: checking for shl_load in -ldld" >&5
ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -3199,7 +3215,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldld $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 3203 "configure"
+#line 3219 "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
@@ -3210,7 +3226,7 @@ int main() {
shl_load()
; return 0; }
EOF
-if { (eval echo configure:3214: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3230: \"$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
@@ -3238,7 +3254,7 @@ fi
fi
echo $ac_n "checking for dld_link in -ldld""... $ac_c" 1>&6
-echo "configure:3242: checking for dld_link in -ldld" >&5
+echo "configure:3258: checking for dld_link in -ldld" >&5
ac_lib_var=`echo dld'_'dld_link | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -3246,7 +3262,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldld $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 3250 "configure"
+#line 3266 "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
@@ -3257,7 +3273,7 @@ int main() {
dld_link()
; return 0; }
EOF
-if { (eval echo configure:3261: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3277: \"$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
@@ -3288,12 +3304,12 @@ if test "x$ac_cv_func_dlopen" = xyes || test "x$ac_cv_lib_dl_dlopen" = xyes; the
for ac_func in dlerror
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3292: checking for $ac_func" >&5
+echo "configure:3308: 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 3297 "configure"
+#line 3313 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -3316,7 +3332,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:3320: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3336: \"$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
@@ -3344,7 +3360,7 @@ done
fi
echo $ac_n "checking for _ prefix in compiled symbols""... $ac_c" 1>&6
-echo "configure:3348: checking for _ prefix in compiled symbols" >&5
+echo "configure:3364: checking for _ prefix in compiled symbols" >&5
if eval "test \"`echo '$''{'ac_cv_sys_symbol_underscore'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3353,10 +3369,10 @@ cat > conftest.$ac_ext <<EOF
void nm_test_func(){}
int main(){nm_test_func;return 0;}
EOF
-if { (eval echo configure:3357: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3373: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
# Now try to grab the symbols.
ac_nlist=conftest.nm
- if { (eval echo configure:3360: \"$NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist\") 1>&5; (eval $NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) 2>&5; } && test -s "$ac_nlist"; then
+ if { (eval echo configure:3376: \"$NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist\") 1>&5; (eval $NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) 2>&5; } && test -s "$ac_nlist"; then
# See whether the symbols have a leading underscore.
if egrep '^. _nm_test_func' "$ac_nlist" >/dev/null; then
ac_cv_sys_symbol_underscore=yes
@@ -3383,7 +3399,7 @@ if test x"$ac_cv_sys_symbol_underscore" = xyes; then
if test x"$ac_cv_func_dlopen" = xyes ||
test x"$ac_cv_lib_dl_dlopen" = xyes ; then
echo $ac_n "checking whether we have to add an underscore for dlsym""... $ac_c" 1>&6
-echo "configure:3387: checking whether we have to add an underscore for dlsym" >&5
+echo "configure:3403: checking whether we have to add an underscore for dlsym" >&5
if eval "test \"`echo '$''{'libltdl_cv_need_uscore'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3392,7 +3408,7 @@ else
else
cat > conftest.$ac_ext <<EOF
-#line 3396 "configure"
+#line 3412 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -3439,7 +3455,7 @@ main() { void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW);
if(ptr1 && !ptr2) { dlclose(self); exit(0); } } exit(1); }
EOF
-if { (eval echo configure:3443: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3459: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
libltdl_cv_need_uscore=no
else
@@ -3471,17 +3487,17 @@ for ac_hdr in malloc.h memory.h stdlib.h stdio.h ctype.h dlfcn.h dl.h dld.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3475: checking for $ac_hdr" >&5
+echo "configure:3491: 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 3480 "configure"
+#line 3496 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3485: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3501: \"$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*
@@ -3511,17 +3527,17 @@ for ac_hdr in string.h strings.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3515: checking for $ac_hdr" >&5
+echo "configure:3531: 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 3520 "configure"
+#line 3536 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3525: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3541: \"$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*
@@ -3550,12 +3566,12 @@ done
for ac_func in strchr index
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3554: checking for $ac_func" >&5
+echo "configure:3570: 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 3559 "configure"
+#line 3575 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -3578,7 +3594,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:3582: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3598: \"$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
@@ -3605,12 +3621,12 @@ done
for ac_func in strrchr rindex
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3609: checking for $ac_func" >&5
+echo "configure:3625: 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 3614 "configure"
+#line 3630 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -3633,7 +3649,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:3637: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3653: \"$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
@@ -3660,12 +3676,12 @@ done
for ac_func in strcmp
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3664: checking for $ac_func" >&5
+echo "configure:3680: 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 3669 "configure"
+#line 3685 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -3688,7 +3704,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:3692: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3708: \"$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
@@ -3848,6 +3864,7 @@ s%@includedir@%$includedir%g
s%@oldincludedir@%$oldincludedir%g
s%@infodir@%$infodir%g
s%@mandir@%$mandir%g
+s%@mkinstalldirs@%$mkinstalldirs%g
s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
s%@INSTALL_DATA@%$INSTALL_DATA%g
diff --git a/libjava/libltdl/configure.in b/libjava/libltdl/configure.in
index 188fc101da4..4fcedb897af 100644
--- a/libjava/libltdl/configure.in
+++ b/libjava/libltdl/configure.in
@@ -2,13 +2,17 @@ dnl Process this file with autoconf to create configure.
AC_INIT(ltdl.c)
-dnl We shouldn't be using these internal macros of autoconf,
-dnl but CONFIG_AUX_DIR($with_auxdir) breaks automake.
AC_ARG_WITH(auxdir,
[ --with-auxdir=DIR path to autoconf auxiliary files],
-[AC_CONFIG_AUX_DIRS($with_auxdir)],
+[AC_CONFIG_AUX_DIR($with_auxdir)
+dnl This is here just to satisfy automake.
+ifelse(not,equal,[AC_CONFIG_AUX_DIR(../..)])],
[AC_CONFIG_AUX_DIR_DEFAULT])
+# This is another blatant hack to work around automake bugs.
+mkinstalldirs="$ac_aux_dir/mkinstalldirs"
+AC_SUBST(mkinstalldirs)
+
if test -z "$enable_ltdl_install$enable_ltdl_convenience"; then
if test -f ${srcdir}/ltconfig && test -f ${srcdir}/ltmain.sh; then
# if libltdl is libtoolized, it is assumed to be stand-alone and
diff --git a/libjava/libtool-version b/libjava/libtool-version
index 1d68c1f208f..81ae9a1783c 100644
--- a/libjava/libtool-version
+++ b/libjava/libtool-version
@@ -3,4 +3,4 @@
# a separate file so that version updates don't involve re-running
# automake.
# CURRENT:REVISION:AGE
-1:0:0
+2:0:0
diff --git a/libjava/name-finder.cc b/libjava/name-finder.cc
index 3baa6e3c6bf..36726bd941a 100644
--- a/libjava/name-finder.cc
+++ b/libjava/name-finder.cc
@@ -145,11 +145,15 @@ _Jv_name_finder::lookup (void *p)
if (dladdr (p, &dl_info))
{
- strncpy (file_name, dl_info.dli_fname, sizeof file_name);
- strncpy (method_name, dl_info.dli_sname, sizeof method_name);
+ if (dl_info.dli_fname)
+ strncpy (file_name, dl_info.dli_fname, sizeof file_name);
+ if (dl_info.dli_sname)
+ strncpy (method_name, dl_info.dli_sname, sizeof method_name);
/* Don't trust dladdr() if the address is from the main program. */
- if (_Jv_argv == NULL || strcmp (file_name, _Jv_argv[0]) != 0)
+ if (dl_info.dli_fname != NULL
+ && dl_info.dli_sname != NULL
+ && (_Jv_argv == NULL || strcmp (file_name, _Jv_argv[0]) != 0))
return true;
}
}
diff --git a/libjava/posix-threads.cc b/libjava/posix-threads.cc
index 20538436481..b9cb85bce95 100644
--- a/libjava/posix-threads.cc
+++ b/libjava/posix-threads.cc
@@ -300,7 +300,7 @@ _Jv_InitThreads (void)
_Jv_Thread_t *
_Jv_ThreadInitData (java::lang::Thread *obj)
{
- _Jv_Thread_t *data = new _Jv_Thread_t;
+ _Jv_Thread_t *data = (_Jv_Thread_t *) _Jv_Malloc (sizeof (_Jv_Thread_t));
data->flags = 0;
data->thread_obj = obj;
@@ -315,7 +315,7 @@ _Jv_ThreadDestroyData (_Jv_Thread_t *data)
{
pthread_mutex_destroy (&data->wait_mutex);
pthread_cond_destroy (&data->wait_cond);
- delete data;
+ _Jv_Free ((void *)data);
}
void
diff --git a/libjava/posix.cc b/libjava/posix.cc
index d470a644da3..1f5b037f704 100644
--- a/libjava/posix.cc
+++ b/libjava/posix.cc
@@ -1,6 +1,6 @@
// posix.cc -- Helper functions for POSIX-flavored OSs.
-/* Copyright (C) 2000 Free Software Foundation
+/* Copyright (C) 2000, 2001 Free Software Foundation
This file is part of libgcj.
@@ -14,6 +14,10 @@ details. */
#include <errno.h>
+#include <jvm.h>
+#include <java/lang/Thread.h>
+#include <java/io/InterruptedIOException.h>
+
#if defined (ECOS)
extern "C" unsigned long long _clock (void);
#endif
@@ -76,6 +80,10 @@ _Jv_select (int n, fd_set *readfds, fd_set *writefds,
if (r != -1 || errno != EINTR)
return r;
+ // Here we know we got EINTR.
+ if (java::lang::Thread::interrupted ())
+ throw new java::io::InterruptedIOException (JvNewStringLatin1 ("select interrupted"));
+
struct timeval after;
if (timeout)
{
diff --git a/libjava/prims.cc b/libjava/prims.cc
index 85264bb2cce..65853a60692 100644
--- a/libjava/prims.cc
+++ b/libjava/prims.cc
@@ -559,10 +559,14 @@ _Jv_FindClassFromSignature (char *sig, java::lang::ClassLoader *loader)
}
case '[':
- return _Jv_GetArrayClass (_Jv_FindClassFromSignature (&sig[1], loader),
- loader);
+ {
+ jclass klass = _Jv_FindClassFromSignature (&sig[1], loader);
+ if (! klass)
+ return NULL;
+ return _Jv_GetArrayClass (klass, loader);
+ }
}
- JvFail ("couldn't understand class signature");
+
return NULL; // Placate compiler.
}
@@ -606,7 +610,7 @@ _Jv_ThisExecutable (const char *name)
{
if (name)
{
- _Jv_execName = new char[strlen (name) + 1];
+ _Jv_execName = (char *) _Jv_Malloc (strlen (name) + 1);
strcpy (_Jv_execName, name);
}
}
@@ -850,7 +854,7 @@ JvRunMain (jclass klass, int argc, const char **argv)
int status = (int) java::lang::ThreadGroup::had_uncaught_exception;
- java::lang::Runtime::getRuntime ()->exit (status);
+ java::lang::Runtime::getRuntime ()->_exit (status);
}
void
diff --git a/libjava/resolve.cc b/libjava/resolve.cc
index 4a37365c94a..e202da042e6 100644
--- a/libjava/resolve.cc
+++ b/libjava/resolve.cc
@@ -1,6 +1,6 @@
// resolve.cc - Code for linking and resolving classes and pool entries.
-/* Copyright (C) 1999, 2000 Free Software Foundation
+/* Copyright (C) 1999, 2000, 2001 Free Software Foundation
This file is part of libgcj.
@@ -32,6 +32,17 @@ details. */
#include <java/lang/IncompatibleClassChangeError.h>
#include <java/lang/reflect/Modifier.h>
+void
+_Jv_ResolveField (_Jv_Field *field, java::lang::ClassLoader *loader)
+{
+ if (! field->isResolved ())
+ {
+ _Jv_Utf8Const *sig = (_Jv_Utf8Const*)field->type;
+ field->type = _Jv_FindClassFromSignature (sig->data, loader);
+ field->flags &= ~_Jv_FIELD_UNRESOLVED_FLAG;
+ }
+}
+
#ifdef INTERPRETER
static void throw_internal_error (char *msg)
@@ -361,17 +372,6 @@ _Jv_SearchMethodInClass (jclass cls, jclass klass,
return 0;
}
-void
-_Jv_ResolveField (_Jv_Field *field, java::lang::ClassLoader *loader)
-{
- if (! field->isResolved ())
- {
- _Jv_Utf8Const *sig = (_Jv_Utf8Const*)field->type;
- field->type = _Jv_FindClassFromSignature (sig->data, loader);
- field->flags &= ~_Jv_FIELD_UNRESOLVED_FLAG;
- }
-}
-
/** FIXME: this is a terribly inefficient algorithm! It would improve
things if compiled classes to know vtable offset, and _Jv_Method had
a field for this.
@@ -698,9 +698,7 @@ _Jv_PrepareClass(jclass klass)
clz->vtable_method_count = vtable_count;
/* allocate vtable structure */
- _Jv_VTable *vtable = (_Jv_VTable*)
- _Jv_AllocBytesChecked (sizeof (_Jv_VTable)
- + (sizeof (void*) * (vtable_count)));
+ _Jv_VTable *vtable = _Jv_VTable::new_vtable (vtable_count);
vtable->clas = clz;
vtable->gc_descr = _Jv_BuildGCDescr(clz);
@@ -714,9 +712,8 @@ _Jv_PrepareClass(jclass klass)
/* copy super class' vtable entries. */
if (effective_superclass && effective_superclass->vtable)
- memcpy ((void*)&vtable->method[0],
- (void*)&effective_superclass->vtable->method[0],
- sizeof (void*) * effective_superclass->vtable_method_count);
+ for (int i = 0; i < effective_superclass->vtable_method_count; ++i)
+ vtable->set_method (i, effective_superclass->vtable->get_method (i));
}
/* now, install our own vtable entries, reprise... */
@@ -737,9 +734,9 @@ _Jv_PrepareClass(jclass klass)
throw_internal_error ("vtable problem...");
if (clz->interpreted_methods[i] == 0)
- vtable->method[index] = (void*)&_Jv_abstractMethodError;
+ vtable->set_method(index, (void*)&_Jv_abstractMethodError);
else
- vtable->method[index] = this_meth->ncode;
+ vtable->set_method(index, this_meth->ncode);
}
}
diff --git a/libjava/testsuite/ChangeLog b/libjava/testsuite/ChangeLog
index df2896e6480..a93d93fc187 100644
--- a/libjava/testsuite/ChangeLog
+++ b/libjava/testsuite/ChangeLog
@@ -1,3 +1,91 @@
+2002-02-20 Release Manager
+
+ * GCC 3.0.4 Released.
+
+2001-12-20 Release Manager
+
+ * GCC 3.0.3 Released.
+
+2001-10-23 Release Manager
+
+ * GCC 3.0.2 Released.
+
+2001-08-19 Release Manager
+
+ * GCC 3.0.1 Released.
+
+2001-08-19 Release Manager
+
+ * GCC 3.0.1 Released.
+
+2001-07-27 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * lib/libjava.exp (${tool}_set_ld_library_path): New, copied from
+ g++.exp.
+
+20010617 Release Manager
+
+ * GCC 3.0 Released.
+
+2001-05-03 Tom Tromey <tromey@redhat.com>
+
+ * libjava.lang/Thread_Wait_Interrupt.xfail: New file.
+ * libjava.lang/Thread_Wait_2.xfail: New file.
+ * libjava.lang/Thread_Wait.xfail: New file.
+ * libjava.lang/Thread_Sleep.xfail: New file.
+ * libjava.lang/Thread_Monitor.xfail: New file.
+ * libjava.lang/Thread_Join.xfail: New file.
+ * libjava.lang/Thread_Interrupt.xfail: New file.
+ * libjava.lang/Thread_Alive.xfail: New file.
+ * lib/libjava.exp (libjava_init): Set global
+ libjava_uses_threads.
+ (test_libjava): Document `need-threads' tag.
+ (test_libjava_from_source): handle need-threads tag.
+ (test_libjava_from_javac): Likewise.
+
+2001-05-03 Tom Tromey <tromey@redhat.com>
+
+ * libjava.lang/err11.xfail: Removed.
+
+2001-04-25 Tom Tromey <tromey@redhat.com>
+
+ * lib/libjava.exp (libjava_init): Use UTF-8 encoding.
+ (test_libjava_from_javac): Likewise.
+
+2001-04-09 Tom Tromey <tromey@redhat.com>
+
+ * libjava.lang/pr83.xfail: Removed.
+ * libjava.lang/Shazam.xfail: Removed.
+ * libjava.lang/PR162.xfail: Removed.
+ * libjava.compile/PR375.xfail: Removed.
+ * libjava.compile/PR208.xfail: Removed xfail-byte.
+ * libjava.compile/PR207.xfail: Removed xfail-byte.
+
+2001-04-07 Tom Tromey <tromey@redhat.com>
+
+ * libjava.compile/weirddecl.xfail: Removed xfail-*.
+ * libjava.compile/PR374.xfail: Removed.
+
+2001-03-29 Alexandre Petit-Bianco <apbianco@redhat.com>
+
+ * libjava.lang/instinit2.out: Fixed.
+
+2001-03-20 Tom Tromey <tromey@redhat.com>
+
+ * libjava.compile/uesc.java: New file.
+ * libjava.compile/uesc.xfail: New file.
+
+2001-03-16 Tom Tromey <tromey@redhat.com>
+
+ * lib/libjava.exp (libjava_arguments): Rewrote computation of
+ LD_LIBRARY_PATH. Add gcc build directory if it contains
+ libgcc_s.so.
+
+2001-03-14 Tom Tromey <tromey@redhat.com>
+
+ * libjava.compile/assignment.xfail: Removed.
+ * libjava.compile/assignment_2.xfail: Removed.
+
2001-02-08 Warren Levy <warrenl@redhat.com>
* libjava.mauve/mauve.exp: Added support for XFAILs.
diff --git a/libjava/testsuite/Makefile.am b/libjava/testsuite/Makefile.am
index e1d359d8f76..4eeafae18ed 100644
--- a/libjava/testsuite/Makefile.am
+++ b/libjava/testsuite/Makefile.am
@@ -1,15 +1 @@
-## Process this file with automake to produce Makefile.in.
-
-AUTOMAKE_OPTIONS = foreign dejagnu no-installinfo
-
-# Setup the testing framework, if you have one
-EXPECT = `if [ -f $(top_builddir)/../expect/expect ] ; then \
- echo $(top_builddir)/../expect/expect ; \
- else echo expect ; fi`
-
-RUNTEST = `if [ -f $(top_srcdir)/../dejagnu/runtest ] ; then \
- echo $(top_srcdir)/../dejagnu/runtest ; \
- else echo runtest; fi`
-
-RUNTESTFLAGS = @AM_RUNTESTFLAGS@
-
+AUTOMAKE_OPTIONS = foreign dejagnu
diff --git a/libjava/testsuite/Makefile.in b/libjava/testsuite/Makefile.in
index b2cd5934d28..f0e82ce914d 100644
--- a/libjava/testsuite/Makefile.in
+++ b/libjava/testsuite/Makefile.in
@@ -73,18 +73,19 @@ CXXCPP = @CXXCPP@
DIRLTDL = @DIRLTDL@
DIVIDESPEC = @DIVIDESPEC@
DLLTOOL = @DLLTOOL@
-EH_COMMON_INCLUDE = @EH_COMMON_INCLUDE@
EXCEPTIONSPEC = @EXCEPTIONSPEC@
EXEEXT = @EXEEXT@
-FORCELIBGCCSPEC = @FORCELIBGCCSPEC@
+GCC_UNWIND_INCLUDE = @GCC_UNWIND_INCLUDE@
GCDEPS = @GCDEPS@
GCINCS = @GCINCS@
GCJ = @GCJ@
GCJFLAGS = @GCJFLAGS@
+GCJVERSION = @GCJVERSION@
GCLIBS = @GCLIBS@
GCOBJS = @GCOBJS@
GCSPEC = @GCSPEC@
GCTESTSPEC = @GCTESTSPEC@
+ICONV_LDFLAGS = @ICONV_LDFLAGS@
INCLTDL = @INCLTDL@
JC1GCSPEC = @JC1GCSPEC@
LIBDATASTARTSPEC = @LIBDATASTARTSPEC@
@@ -93,6 +94,7 @@ LIBGCJTESTSPEC = @LIBGCJTESTSPEC@
LIBGCJ_CFLAGS = @LIBGCJ_CFLAGS@
LIBGCJ_CXXFLAGS = @LIBGCJ_CXXFLAGS@
LIBGCJ_JAVAFLAGS = @LIBGCJ_JAVAFLAGS@
+LIBICONV = @LIBICONV@
LIBLTDL = @LIBLTDL@
LIBTOOL = @LIBTOOL@
LN_S = @LN_S@
@@ -119,8 +121,9 @@ ZLIBSPEC = @ZLIBSPEC@
ZLIBTESTSPEC = @ZLIBTESTSPEC@
here = @here@
libgcj_basedir = @libgcj_basedir@
+mkinstalldirs = @mkinstalldirs@
-AUTOMAKE_OPTIONS = foreign dejagnu no-installinfo
+AUTOMAKE_OPTIONS = foreign dejagnu
# Setup the testing framework, if you have one
EXPECT = `if [ -f $(top_builddir)/../expect/expect ] ; then \
@@ -134,7 +137,6 @@ RUNTEST = `if [ -f $(top_srcdir)/../dejagnu/runtest ] ; then \
RUNTESTFLAGS = @AM_RUNTESTFLAGS@
-mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs
CONFIG_HEADER = ../include/config.h
CONFIG_CLEAN_FILES =
DIST_COMMON = ChangeLog Makefile.am Makefile.in
@@ -218,8 +220,6 @@ check-am: all-am
check: check-am
installcheck-am:
installcheck: installcheck-am
-install-info-am:
-install-info: install-info-am
install-exec-am:
install-exec: install-exec-am
@@ -267,11 +267,11 @@ maintainer-clean-am: maintainer-clean-generic distclean-am
maintainer-clean: maintainer-clean-am
.PHONY: 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-redirect all-am all installdirs \
-mostlyclean-generic distclean-generic clean-generic \
-maintainer-clean-generic clean mostlyclean distclean maintainer-clean
+check-am installcheck-am installcheck install-exec-am install-exec \
+install-data-am install-data install-am install uninstall-am uninstall \
+all-redirect all-am all installdirs mostlyclean-generic \
+distclean-generic clean-generic maintainer-clean-generic clean \
+mostlyclean distclean maintainer-clean
# Tell versions [3.59,3.63) of GNU make to not export all variables.
diff --git a/libjava/testsuite/lib/libjava.exp b/libjava/testsuite/lib/libjava.exp
index 101871e9055..2dad0daf8f1 100644
--- a/libjava/testsuite/lib/libjava.exp
+++ b/libjava/testsuite/lib/libjava.exp
@@ -1,4 +1,4 @@
-# Copyright (C) 1998, 1999, 2000 Free Software Foundation
+# Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation
load_lib "libgloss.exp"
@@ -107,11 +107,11 @@ set libjava_initialized 0
proc libjava_init { args } {
global wrapper_file;
global wrap_compile_flags;
- global libjava_initialized
+ global libjava_initialized libjava_uses_threads
global GCJ_UNDER_TEST
global TOOL_EXECUTABLE
global original_ld_library_path
- global env
+ global env objdir
if { $libjava_initialized == 1 } { return; }
@@ -127,6 +127,16 @@ proc libjava_init { args } {
}
}
+ # The -B is so we find libgcj.spec.
+ set text [eval exec "$GCJ_UNDER_TEST -B$objdir/../ -v 2>@ stdout"]
+ regexp -- "Thread model: (\[^\n\]+)\n" $text ignore model
+ set libjava_uses_threads [expr {! ($model == "no"
+ || $model == "none"
+ || $model == "single")}]
+
+ # Always set encoding used by gcj.
+ append GCJ_UNDER_TEST " --encoding=UTF-8"
+
if [info exists env(LD_LIBRARY_PATH)] {
set original_ld_library_path $env(LD_LIBRARY_PATH)
} else {
@@ -192,6 +202,7 @@ proc libjava_arguments {{mode compile}} {
global tmpdir
global runtests
global env
+ global tool_root_dir
if [info exists LIBJAVA] {
set libjava $LIBJAVA;
@@ -230,17 +241,25 @@ proc libjava_arguments {{mode compile}} {
# Basically we want to build up a colon separated path list from
# the value of $libjava.
- # First strip away any -L arguments.
- regsub -all -- "-L" $libjava "" ld_library_path
-
- # Then remove any -lgcj argument.
- regsub -all -- " -lgcj.*" $ld_library_path "" ld_library_path
+ set lpath {}
+ foreach dir [list $libjava $libgc $libz] {
+ foreach item [split $dir " "] {
+ switch -glob -- $item {
+ "-L*" {
+ lappend lpath [string range $item 2 end]
+ }
+ }
+ }
+ }
- # First strip away any -L arguments.
- regsub -all -- "-L" $libgc $ld_library_path ld_library_path
+ # Finally, add the gcc build directory so that we can find the
+ # shared libgcc. This, like much of dejagnu, is hideous.
+ set gccdir [lookfor_file $tool_root_dir gcc/libgcc_s.so]
+ if {$gccdir != ""} {
+ lappend lpath [file dirname $gccdir]
+ }
- # Then remove any -lgcjgc argument.
- regsub -all -- " -lgcjgc.*" $ld_library_path "" ld_library_path
+ set ld_library_path [join $lpath :]
# That's enough to make things work for the normal case.
# If we wanted to handle an arbitrary value of libjava,
@@ -251,6 +270,8 @@ proc libjava_arguments {{mode compile}} {
setenv LD_LIBRARY_PATH "$ld_library_path:$original_ld_library_path"
setenv SHLIB_PATH "$ld_library_path:$original_ld_library_path"
+ verbose "LD_LIBRARY_PATH = $env(LD_LIBRARY_PATH)"
+
# Set the CLASSPATH environment variable
verbose "CLASSPATH is .:$srcdir/$subdir:$objdir:$objdir/../libgcj.jar"
global env
@@ -317,6 +338,15 @@ proc test_libjava_from_source { options srcfile compile_args inpfile resultfile
set opts($item) x
}
+ # If we need threads and we don't have them then set the `no-exec'
+ # flag. This is case is also handled specially later.
+ if {[info exists opts(need-threads)]} {
+ global libjava_uses_threads
+ if {! $libjava_uses_threads} {
+ set opts(no-exec) x
+ }
+ }
+
set errname [file rootname [file tail $srcfile]]
if {! [runtest_file_p $runtests $errname]} {
return
@@ -362,11 +392,11 @@ proc test_libjava_from_source { options srcfile compile_args inpfile resultfile
}
fail "$errname compilation from source"
- if {[info exists opts(xfail-gcj)] || ! [info exists opts(no-exec)]} {
- setup_xfail "*-*-*"
- fail "$errname execution from source compiled test"
- setup_xfail "*-*-*"
- fail "$errname output from source compiled test"
+ if {[info exists opts(xfail-gcj)]
+ || ! [info exists opts(no-exec)]
+ || [info exists opts(need-threads)]} {
+ untested "$errname execution from source compiled test"
+ untested "$errname output from source compiled test"
}
return
}
@@ -376,8 +406,17 @@ proc test_libjava_from_source { options srcfile compile_args inpfile resultfile
}
pass "$errname compilation from source"
- if {[info exists opts(no-exec)]
- || [info exists opts(no-link)]} {
+ if {[info exists opts(no-exec)]} {
+ if {[info exists opts(need-threads)]} {
+ # This means we wanted to try to run it but we couldn't
+ # because threads aren't supported. So we have to
+ # generate an `untested'.
+ untested "$errname execution from source compiled test"
+ untested "$errname output from source compiled test"
+ }
+ return
+ }
+ if {[info exists opts(no-link)]} {
return
}
@@ -389,8 +428,7 @@ proc test_libjava_from_source { options srcfile compile_args inpfile resultfile
}
$status "$errname execution from source compiled test"
if { $status != "pass" } {
- setup_xfail "*-*-*"
- fail "$errname execution from source compiled test"
+ untested "$errname output from source compiled test"
return;
}
@@ -453,6 +491,14 @@ proc test_libjava_from_javac { options srcfile compile_args inpfile resultfile e
set opts($item) x
}
+ # If we need threads and we don't have them then set the `no-exec'
+ # flag. This is case is also handled specially later.
+ if {[info exists opts(need-threads)]} {
+ global libjava_uses_threads
+ if {! $libjava_uses_threads} {
+ set opts(no-exec) x
+ }
+ }
set errname [file rootname [file tail $srcfile]]
if {! [runtest_file_p $runtests $errname]} {
return
@@ -477,13 +523,11 @@ proc test_libjava_from_javac { options srcfile compile_args inpfile resultfile e
return
}
fail "$errname byte compilation"
- setup_xfail "*-*-*"
- fail "$errname compilation from bytecode"
- if {! [info exists opts(no-exec)]} {
- setup_xfail "*-*-*"
- fail "$errname execution from bytecode->native test"
- setup_xfail "*-*-*"
- fail "$errname output from bytecode->native test"
+ untested "$errname compilation from bytecode"
+ if {! [info exists opts(no-exec)]
+ || [info exists opts(need-threads)]} {
+ untested "$errname execution from bytecode->native test"
+ untested "$errname output from bytecode->native test"
}
return
}
@@ -496,27 +540,27 @@ proc test_libjava_from_javac { options srcfile compile_args inpfile resultfile e
# Find name to use for --main, and name of all class files.
set jvscan [find_jvscan]
verbose "jvscan is $jvscan"
+ # We insulate ourselves from the user's locale by forcing the
+ # encoding on jvscan.
+ set jvscan "compiler=$jvscan additional_flags=--encoding=UTF-8"
set main_name [string trim \
[prune_warnings \
[libjava_tcompile $srcfile "" none \
- "compiler=$jvscan additional_flags=--print-main"]]]
+ "$jvscan additional_flags=--print-main"]]]
verbose "main name is $main_name"
set class_out [string trim \
[prune_warnings \
[libjava_tcompile $srcfile "" none \
- "compiler=$jvscan additional_flags=--list-class"]]]
+ "$jvscan additional_flags=--list-class"]]]
verbose "class list is $class_out"
if {[string match "*parse error*" $main_name]
|| [string match "*parse error*" $class_out]} {
- # Do the remaining fails.
- setup_xfail "*-*-*"
- fail "$errname compilation from bytecode"
- if {! [info exists opts(no-exec)]} {
- setup_xfail "*-*-*"
- fail "$errname execution from bytecode->native test"
- setup_xfail "*-*-*"
- fail "$errname output from bytecode->native test"
+ untested "$errname compilation from bytecode"
+ if {! [info exists opts(no-exec)]
+ || [info exists opts(need-threads)]} {
+ untested "$errname execution from bytecode->native test"
+ untested "$errname output from bytecode->native test"
}
return
}
@@ -592,17 +636,20 @@ proc test_libjava_from_javac { options srcfile compile_args inpfile resultfile e
if { $x != "" } {
verbose "target_compile failed: $x" 2
fail "$errname compilation from bytecode"
- setup_xfail "*-*-*"
- if {! [info exists opts(no-exec)]} {
- fail "$errname execution from bytecode->native test"
- setup_xfail "*-*-*"
- fail "$errname output from bytecode->native test"
+ if {! [info exists opts(no-exec)]
+ || [info exists opts(need-threads)]} {
+ untested "$errname execution from bytecode->native test"
+ untested "$errname output from bytecode->native test"
}
return;
}
pass "$errname compilation from bytecode"
if {[info exists opts(no-exec)]} {
+ if {[info exists opts(need-threads)]} {
+ untested "$errname execution from bytecode->native test"
+ untested "$errname output from bytecode->native test"
+ }
return
}
@@ -614,8 +661,7 @@ proc test_libjava_from_javac { options srcfile compile_args inpfile resultfile e
}
$status "$errname execution from bytecode->native test"
if { $status != "pass" } {
- setup_xfail "*-*-*"
- fail "$errname output from bytecode->native test"
+ untested "$errname output from bytecode->native test"
return;
}
@@ -672,7 +718,10 @@ proc test_libjava_from_javac { options srcfile compile_args inpfile resultfile e
# front end.
# `xfail-byte' compilation from bytecode will fail
# `xfail-exec' exec will fail
-# `xfail-output' output will be wrong
+# `xfail-output'
+# output will be wrong
+# `need-threads'
+# test relies on thread support
#
proc test_libjava { options srcfile compile_args inpfile resultfile exec_args } {
test_libjava_from_source $options $srcfile $compile_args $inpfile $resultfile $exec_args
@@ -688,6 +737,20 @@ proc default_libjava_version {} {
proc default_libjava_start { } {
}
+# On IRIX 6, we have to set variables akin to LD_LIBRARY_PATH, but
+# called LD_LIBRARYN32_PATH (for the N32 ABI) and LD_LIBRARY64_PATH
+# (for the 64-bit ABI). The right way to do this would be to modify
+# unix.exp -- but that's not an option since it's part of DejaGNU
+# proper, so we do it here, by trickery. We really only need to do
+# this on IRIX, but it shouldn't hurt to do it anywhere else.
+
+proc ${tool}_set_ld_library_path { name element op } {
+ setenv LD_LIBRARYN32_PATH [getenv LD_LIBRARY_PATH]
+ setenv LD_LIBRARY64_PATH [getenv LD_LIBRARY_PATH]
+}
+
+trace variable env(LD_LIBRARY_PATH) w ${tool}_set_ld_library_path
+
# Local Variables:
# tcl-indent-level:4
# End:
diff --git a/libjava/testsuite/libjava.compile/PR207.xfail b/libjava/testsuite/libjava.compile/PR207.xfail
index b3630c99118..76540afa49b 100644
--- a/libjava/testsuite/libjava.compile/PR207.xfail
+++ b/libjava/testsuite/libjava.compile/PR207.xfail
@@ -1,2 +1 @@
no-link
-xfail-byte
diff --git a/libjava/testsuite/libjava.compile/PR208.xfail b/libjava/testsuite/libjava.compile/PR208.xfail
index b3630c99118..76540afa49b 100644
--- a/libjava/testsuite/libjava.compile/PR208.xfail
+++ b/libjava/testsuite/libjava.compile/PR208.xfail
@@ -1,2 +1 @@
no-link
-xfail-byte
diff --git a/libjava/testsuite/libjava.compile/PR374.xfail b/libjava/testsuite/libjava.compile/PR374.xfail
deleted file mode 100644
index a61ff5be362..00000000000
--- a/libjava/testsuite/libjava.compile/PR374.xfail
+++ /dev/null
@@ -1,2 +0,0 @@
-xfail-gcj
-xfail-gcjC
diff --git a/libjava/testsuite/libjava.compile/PR375.xfail b/libjava/testsuite/libjava.compile/PR375.xfail
deleted file mode 100644
index 755ab8794df..00000000000
--- a/libjava/testsuite/libjava.compile/PR375.xfail
+++ /dev/null
@@ -1 +0,0 @@
-xfail-gcj
diff --git a/libjava/testsuite/libjava.compile/assignment.xfail b/libjava/testsuite/libjava.compile/assignment.xfail
deleted file mode 100644
index a61ff5be362..00000000000
--- a/libjava/testsuite/libjava.compile/assignment.xfail
+++ /dev/null
@@ -1,2 +0,0 @@
-xfail-gcj
-xfail-gcjC
diff --git a/libjava/testsuite/libjava.compile/assignment_2.xfail b/libjava/testsuite/libjava.compile/assignment_2.xfail
deleted file mode 100644
index a61ff5be362..00000000000
--- a/libjava/testsuite/libjava.compile/assignment_2.xfail
+++ /dev/null
@@ -1,2 +0,0 @@
-xfail-gcj
-xfail-gcjC
diff --git a/libjava/testsuite/libjava.compile/uesc.java b/libjava/testsuite/libjava.compile/uesc.java
new file mode 100644
index 00000000000..b41ef69f8c0
--- /dev/null
+++ b/libjava/testsuite/libjava.compile/uesc.java
@@ -0,0 +1,9 @@
+public class uesc
+{
+ public foo (Object[] v[])
+ {
+ char z = '\uuu00a0';
+ char y = '\u00au0'; // At one point we erroneously
+ // accepted this.
+ }
+}
diff --git a/libjava/testsuite/libjava.compile/uesc.xfail b/libjava/testsuite/libjava.compile/uesc.xfail
new file mode 100644
index 00000000000..e3b083b1fa5
--- /dev/null
+++ b/libjava/testsuite/libjava.compile/uesc.xfail
@@ -0,0 +1 @@
+shouldfail
diff --git a/libjava/testsuite/libjava.compile/weirddecl.xfail b/libjava/testsuite/libjava.compile/weirddecl.xfail
index 4d57feea2ab..76540afa49b 100644
--- a/libjava/testsuite/libjava.compile/weirddecl.xfail
+++ b/libjava/testsuite/libjava.compile/weirddecl.xfail
@@ -1,3 +1 @@
no-link
-xfail-gcj
-xfail-gcjC
diff --git a/libjava/testsuite/libjava.lang/PR162.xfail b/libjava/testsuite/libjava.lang/PR162.xfail
deleted file mode 100644
index c999f8ee0ca..00000000000
--- a/libjava/testsuite/libjava.lang/PR162.xfail
+++ /dev/null
@@ -1 +0,0 @@
-xfail-output
diff --git a/libjava/testsuite/libjava.lang/Shazam.xfail b/libjava/testsuite/libjava.lang/Shazam.xfail
deleted file mode 100644
index 81d6df0a027..00000000000
--- a/libjava/testsuite/libjava.lang/Shazam.xfail
+++ /dev/null
@@ -1 +0,0 @@
-xfail-byte
diff --git a/libjava/testsuite/libjava.lang/Thread_Alive.xfail b/libjava/testsuite/libjava.lang/Thread_Alive.xfail
new file mode 100644
index 00000000000..3f95317a450
--- /dev/null
+++ b/libjava/testsuite/libjava.lang/Thread_Alive.xfail
@@ -0,0 +1 @@
+need-threads
diff --git a/libjava/testsuite/libjava.lang/Thread_Interrupt.xfail b/libjava/testsuite/libjava.lang/Thread_Interrupt.xfail
new file mode 100644
index 00000000000..3f95317a450
--- /dev/null
+++ b/libjava/testsuite/libjava.lang/Thread_Interrupt.xfail
@@ -0,0 +1 @@
+need-threads
diff --git a/libjava/testsuite/libjava.lang/Thread_Join.xfail b/libjava/testsuite/libjava.lang/Thread_Join.xfail
new file mode 100644
index 00000000000..3f95317a450
--- /dev/null
+++ b/libjava/testsuite/libjava.lang/Thread_Join.xfail
@@ -0,0 +1 @@
+need-threads
diff --git a/libjava/testsuite/libjava.lang/Thread_Monitor.xfail b/libjava/testsuite/libjava.lang/Thread_Monitor.xfail
new file mode 100644
index 00000000000..3f95317a450
--- /dev/null
+++ b/libjava/testsuite/libjava.lang/Thread_Monitor.xfail
@@ -0,0 +1 @@
+need-threads
diff --git a/libjava/testsuite/libjava.lang/Thread_Sleep.xfail b/libjava/testsuite/libjava.lang/Thread_Sleep.xfail
new file mode 100644
index 00000000000..3f95317a450
--- /dev/null
+++ b/libjava/testsuite/libjava.lang/Thread_Sleep.xfail
@@ -0,0 +1 @@
+need-threads
diff --git a/libjava/testsuite/libjava.lang/Thread_Wait.xfail b/libjava/testsuite/libjava.lang/Thread_Wait.xfail
new file mode 100644
index 00000000000..3f95317a450
--- /dev/null
+++ b/libjava/testsuite/libjava.lang/Thread_Wait.xfail
@@ -0,0 +1 @@
+need-threads
diff --git a/libjava/testsuite/libjava.lang/Thread_Wait_2.xfail b/libjava/testsuite/libjava.lang/Thread_Wait_2.xfail
new file mode 100644
index 00000000000..3f95317a450
--- /dev/null
+++ b/libjava/testsuite/libjava.lang/Thread_Wait_2.xfail
@@ -0,0 +1 @@
+need-threads
diff --git a/libjava/testsuite/libjava.lang/Thread_Wait_Interrupt.xfail b/libjava/testsuite/libjava.lang/Thread_Wait_Interrupt.xfail
new file mode 100644
index 00000000000..3f95317a450
--- /dev/null
+++ b/libjava/testsuite/libjava.lang/Thread_Wait_Interrupt.xfail
@@ -0,0 +1 @@
+need-threads
diff --git a/libjava/testsuite/libjava.lang/err11.xfail b/libjava/testsuite/libjava.lang/err11.xfail
deleted file mode 100644
index 81d6df0a027..00000000000
--- a/libjava/testsuite/libjava.lang/err11.xfail
+++ /dev/null
@@ -1 +0,0 @@
-xfail-byte
diff --git a/libjava/testsuite/libjava.lang/instinit2.out b/libjava/testsuite/libjava.lang/instinit2.out
index 01efac10d7e..b6c7351b830 100644
--- a/libjava/testsuite/libjava.lang/instinit2.out
+++ b/libjava/testsuite/libjava.lang/instinit2.out
@@ -1,4 +1,3 @@
Testing class `instinit2'...
-Ctor
Checking the oink...
java.lang.Exception: It just oinked
diff --git a/libjava/testsuite/libjava.lang/pr83.xfail b/libjava/testsuite/libjava.lang/pr83.xfail
deleted file mode 100644
index 81d6df0a027..00000000000
--- a/libjava/testsuite/libjava.lang/pr83.xfail
+++ /dev/null
@@ -1 +0,0 @@
-xfail-byte
diff --git a/libobjc/ChangeLog b/libobjc/ChangeLog
index bd229d11c7f..606c46505af 100644
--- a/libobjc/ChangeLog
+++ b/libobjc/ChangeLog
@@ -1,3 +1,86 @@
+2002-02-20 Release Manager
+
+ * GCC 3.0.4 Released.
+
+2001-12-20 Release Manager
+
+ * GCC 3.0.3 Released.
+
+2001-10-23 Release Manager
+
+ * GCC 3.0.2 Released.
+
+2001-08-19 Release Manager
+
+ * GCC 3.0.1 Released.
+
+2001-08-19 Release Manager
+
+ * GCC 3.0.1 Released.
+
+Mon Jul 16 12:15:00 2001 Nicola Pero <n.pero@mi.flashnet.it>
+
+ * objc/objc-api.h (object_is_class): Fixed - buggy code was trying
+ to cast an id to a Class, which can not be done. Make the check
+ by using CLS_ISMETA on the class pointer instead.
+ (object_is_meta_class): Similar fix.
+
+20010617 Release Manager
+
+ * GCC 3.0 Released.
+
+2001-06-08 Nicola Pero <n.pero@mi.flashnet.it>
+
+ * THREADS: Explain that when we compile libobjc inside GCC, we
+ always use thr-objc.c as a backend, which uses GCC's thread code.
+
+2001-06-06 Richard Frith-Macdonald <rrfm@gnu.org>
+
+ * init.c (__objc_send_message_in_list): When setting a new entry
+ in __objc_load_methods use the method IMP as key, but check to see
+ if the method is in the hashtable by looking at the IMP also.
+ Also ... call the method after adding it to the hashtable rather
+ than before ... thus preventing an obscure possibility of infinite
+ recursion if a +load method itself loads a subclass.
+
+2001-05-25 Ovidiu Predescu <ovidiu@cup.hp.com>
+
+ * init.c (__objc_send_message_in_list): When setting a new entry
+ in __objc_load_methods use the method name as key, not the method
+ IMP (reported by Richard Frith-Macdonald <richard@brainstorm.co.uk>).
+
+2001-05-22 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * sendmsg.c (__objc_forward): Delete strlen() declaration.
+
+2001-05-09 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * objc-features.texi: Move to ../gcc/objc.texi.
+ * fdl.texi: Remove.
+ * Makefile.in: Don't generate documentation from
+ objc-features.texi.
+
+2001-05-01 Mark Mitchell <mark@codesourcery.com>
+
+ * fdl.texi: New file.
+ * objc-features.texi: Simplify.
+ * Makefile.in: Adjust accordingly.
+
+2001-04-30 Mark Mitchell <mark@codesourcery.com>
+
+ * objc-features.texi: Use the GFDL.
+
+2001-03-19 David Edelsohn <edelsohn@gnu.org>
+
+ * encoding.c (TYPE_MODE): Define.
+
+2001-03-14 Nicola Pero <n.pero@mi.flashnet.it>
+
+ * thr.c (objc_thread_add): New function.
+ (objc_thread_remove): Ditto.
+ * objc/thr.h: Declare them.
+ * libobjc.def: Mention them.
+
2001-02-08 Geoffrey Keating <geoffk@redhat.com>
* configure.in: Don't run AC_PROG_CC_WORKS or AC_EXEEXT, because
diff --git a/libobjc/Makefile.in b/libobjc/Makefile.in
index bdea0bbcd42..aed5f11d500 100644
--- a/libobjc/Makefile.in
+++ b/libobjc/Makefile.in
@@ -1,5 +1,5 @@
#Makefile for GNU Objective C runtime library.
-#Copyright (C) 1993, 95-98, 1999 Free Software Foundation, Inc.
+#Copyright (C) 1993, 95-98, 1999, 2001 Free Software Foundation, Inc.
#This file is part of GNU CC.
@@ -289,18 +289,9 @@ libobjc.dll: libobjc_s.a libobjc_entry.o
#
#
-info: objc-features.info
-dvi: objc-features.dvi
-html: objc-features_toc.html
-
-objc-features.info: $(srcdir)/objc-features.texi
- makeinfo $(srcdir)/objc-features.texi
-
-objc-features.dvi: $(srcdir)/objc-features.texi
- texi2dvi $(srcdir)/objc-features.texi
-
-objc-features_toc.html: objc-features.texi
- texi2html -split_node $(srcdir)/objc-features.texi
+info:
+dvi:
+html:
Makefile: Makefile.in config.status
$(SHELL) config.status
diff --git a/libobjc/THREADS b/libobjc/THREADS
index 9dfbbed97af..8a436832f6c 100644
--- a/libobjc/THREADS
+++ b/libobjc/THREADS
@@ -102,30 +102,33 @@ high degree of portability across platforms.
The backend is composed of a file with the necessary code to map the ObjC
thread and mutex to a platform specific implementation. For example, the
-file thr-solaris.c contains the implementation for Solaris. When you
-configure GCC, it attempts to pick an appropriate backend file for the
-target platform; however, you can override this choice by assign the
-OBJC_THREAD_FILE make variable to the basename of the backend file. This
-is especially useful on platforms which have multiple thread libraries.
-For example:
-
- make OBJC_THREAD_FILE=thr-posix
-
-would indicate that the generic posix backend file, thr-posix.c, should be
-compiled with the ObjC runtime library. If your platform does not support
-threads then you should specify the OBJC_THREAD_FILE=thr-single backend file
-to compile the ObjC runtime library without thread or mutex support; note
-that programs which rely upon the ObjC thread and mutex functions will
-compile and link correctly but attempting to create a thread or mutex will
-result in an error.
-
+file thr-solaris.c contains the implementation for Solaris.
+
+If you are compiling libobjc as part of GCC, the thr-objc.c backend is
+always used; this backend uses GCC's gthread code. The thread system
+is automatically configured when GCC is configured. Important: make
+sure you configure GCC using `--enable-threads' if you want threads !
+
+If you want to compile libobjc standalone, then you would need to
+modify the configure.in and makefiles for it; and you need to pick an
+appropriate backend file for the target platform; you make this choice
+by assigning the OBJC_THREAD_FILE make variable to the basename of the
+backend file. For example, OBJC_THREAD_FILE=thr-posix would indicate
+that the generic posix backend file, thr-posix.c, should be compiled
+with the ObjC runtime library. If your platform does not support
+threads then you should specify the OBJC_THREAD_FILE=thr-single
+backend file to compile the ObjC runtime library without thread or
+mutex support; note that programs which rely upon the ObjC thread and
+mutex functions will compile and link correctly but attempting to
+create a thread or mutex will result in an error.
+
It is questionable whether it is really necessary to have both a
frontend and backend function for all available functionality. On the
one hand, it provides a clear, consistent differentiation between what
is public and what is private with the downside of having the overhead
-of multiple functions calls. For example, the function to have a thread
-yield the processor is objc_thread_yield; in the current implementation
-this produces a function call set:
+of multiple functions calls. For example, the function to have a
+thread yield the processor is objc_thread_yield; in the current
+implementation this produces a function call set:
objc_thread_yield() -> __objc_thread_yield() -> system yield function
diff --git a/libobjc/configure b/libobjc/configure
index b3be9026edf..cec0943accd 100755
--- a/libobjc/configure
+++ b/libobjc/configure
@@ -43,6 +43,7 @@ program_suffix=NONE
program_transform_name=s,x,x,
silent=
site=
+sitefile=
srcdir=
target=NONE
verbose=
@@ -157,6 +158,7 @@ Configuration:
--help print this message
--no-create do not create output files
--quiet, --silent do not print \`checking...' messages
+ --site-file=FILE use FILE as the site file
--version print the version of autoconf that created configure
Directory and file names:
--prefix=PREFIX install architecture-independent files in PREFIX
@@ -327,6 +329,11 @@ EOF
-site=* | --site=* | --sit=*)
site="$ac_optarg" ;;
+ -site-file | --site-file | --site-fil | --site-fi | --site-f)
+ ac_prev=sitefile ;;
+ -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*)
+ sitefile="$ac_optarg" ;;
+
-srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
ac_prev=srcdir ;;
-srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
@@ -492,12 +499,16 @@ fi
srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
# Prefer explicitly selected file to automatically selected ones.
-if test -z "$CONFIG_SITE"; then
- if test "x$prefix" != xNONE; then
- CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
- else
- CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+if test -z "$sitefile"; then
+ if test -z "$CONFIG_SITE"; then
+ if test "x$prefix" != xNONE; then
+ CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+ else
+ CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+ fi
fi
+else
+ CONFIG_SITE="$sitefile"
fi
for ac_site_file in $CONFIG_SITE; do
if test -r "$ac_site_file"; then
@@ -574,7 +585,7 @@ ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
compiler_name=cc1obj
rm -f skip-this-dir
echo $ac_n "checking if compiler $compiler_name has been built""... $ac_c" 1>&6
-echo "configure:578: checking if compiler $compiler_name has been built" >&5
+echo "configure:589: checking if compiler $compiler_name has been built" >&5
if eval "test \"`echo '$''{'objc_cv_compiler_exists'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -608,7 +619,7 @@ fi
# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:612: checking for $ac_word" >&5
+echo "configure:623: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -638,7 +649,7 @@ if test -z "$CC"; then
# Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:642: checking for $ac_word" >&5
+echo "configure:653: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -689,7 +700,7 @@ fi
# Extract the first word of "cl", so it can be a program name with args.
set dummy cl; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:693: checking for $ac_word" >&5
+echo "configure:704: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -722,7 +733,7 @@ fi
echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:726: checking whether we are using GNU C" >&5
+echo "configure:737: checking whether we are using GNU C" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -731,7 +742,7 @@ else
yes;
#endif
EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:735: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:746: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
ac_cv_prog_gcc=yes
else
ac_cv_prog_gcc=no
@@ -750,7 +761,7 @@ ac_test_CFLAGS="${CFLAGS+set}"
ac_save_CFLAGS="$CFLAGS"
CFLAGS=
echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:754: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:765: checking whether ${CC-cc} accepts -g" >&5
if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -790,7 +801,7 @@ else
# 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:794: checking for $ac_word" >&5
+echo "configure:805: 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
@@ -830,7 +841,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:834: checking for a BSD compatible install" >&5
+echo "configure:845: 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
@@ -892,12 +903,12 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
# the result.
if false; then
echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
-echo "configure:896: checking for Cygwin environment" >&5
+echo "configure:907: checking for Cygwin environment" >&5
if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 901 "configure"
+#line 912 "configure"
#include "confdefs.h"
int main() {
@@ -908,7 +919,7 @@ int main() {
return __CYGWIN__;
; return 0; }
EOF
-if { (eval echo configure:912: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:923: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_cygwin=yes
else
@@ -925,19 +936,19 @@ echo "$ac_t""$ac_cv_cygwin" 1>&6
CYGWIN=
test "$ac_cv_cygwin" = yes && CYGWIN=yes
echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
-echo "configure:929: checking for mingw32 environment" >&5
+echo "configure:940: checking for mingw32 environment" >&5
if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 934 "configure"
+#line 945 "configure"
#include "confdefs.h"
int main() {
return __MINGW32__;
; return 0; }
EOF
-if { (eval echo configure:941: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:952: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_mingw32=yes
else
@@ -956,7 +967,7 @@ test "$ac_cv_mingw32" = yes && MINGW32=yes
echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:960: checking for executable suffix" >&5
+echo "configure:971: checking for executable suffix" >&5
if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -966,10 +977,10 @@ else
rm -f conftest*
echo 'int main () { return 0; }' > conftest.$ac_ext
ac_cv_exeext=
- if { (eval echo configure:970: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+ if { (eval echo configure:981: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
for file in conftest.*; do
case $file in
- *.c | *.o | *.obj) ;;
+ *.c | *.o | *.obj | *.ilk | *.pdb) ;;
*) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
esac
done
@@ -991,7 +1002,7 @@ fi
# Sanity check for the cross-compilation case:
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:995: checking how to run the C preprocessor" >&5
+echo "configure:1006: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
@@ -1006,13 +1017,13 @@ else
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp.
cat > conftest.$ac_ext <<EOF
-#line 1010 "configure"
+#line 1021 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1016: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1027: \"$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
:
@@ -1023,13 +1034,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
-#line 1027 "configure"
+#line 1038 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1033: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1044: \"$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
:
@@ -1040,13 +1051,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -nologo -E"
cat > conftest.$ac_ext <<EOF
-#line 1044 "configure"
+#line 1055 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1050: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1061: \"$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
:
@@ -1072,17 +1083,17 @@ echo "$ac_t""$CPP" 1>&6
ac_safe=`echo "stdio.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for stdio.h""... $ac_c" 1>&6
-echo "configure:1076: checking for stdio.h" >&5
+echo "configure:1087: checking for stdio.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 1081 "configure"
+#line 1092 "configure"
#include "confdefs.h"
#include <stdio.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1086: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1097: \"$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*
@@ -1110,12 +1121,12 @@ fi
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:1114: checking for ANSI C header files" >&5
+echo "configure:1125: 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 1119 "configure"
+#line 1130 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
@@ -1123,7 +1134,7 @@ else
#include <float.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1127: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1138: \"$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*
@@ -1140,7 +1151,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 1144 "configure"
+#line 1155 "configure"
#include "confdefs.h"
#include <string.h>
EOF
@@ -1158,7 +1169,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 1162 "configure"
+#line 1173 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
@@ -1179,7 +1190,7 @@ if test "$cross_compiling" = yes; then
:
else
cat > conftest.$ac_ext <<EOF
-#line 1183 "configure"
+#line 1194 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -1190,7 +1201,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); }
EOF
-if { (eval echo configure:1194: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1205: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
:
else
@@ -1218,17 +1229,17 @@ for ac_hdr in sched.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1222: checking for $ac_hdr" >&5
+echo "configure:1233: 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 1227 "configure"
+#line 1238 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1232: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1243: \"$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*
@@ -1258,7 +1269,7 @@ done
# Determine CFLAGS for gthread.
echo $ac_n "checking for gthread cflags""... $ac_c" 1>&6
-echo "configure:1262: checking for gthread cflags" >&5
+echo "configure:1273: checking for gthread cflags" >&5
if eval "test \"`echo '$''{'objc_cv_gthread_flags'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1279,7 +1290,7 @@ GTHREAD_FLAGS=$objc_cv_gthread_flags
if test "${enable_shared+set}" = set; then
enableval="$enable_shared"
p=${PACKAGE-default}
-case "$enableval" in
+case $enableval in
yes) enable_shared=yes ;;
no) enable_shared=no ;;
*)
@@ -1305,7 +1316,7 @@ fi
if test "${enable_static+set}" = set; then
enableval="$enable_static"
p=${PACKAGE-default}
-case "$enableval" in
+case $enableval in
yes) enable_static=yes ;;
no) enable_static=no ;;
*)
@@ -1328,7 +1339,7 @@ fi
if test "${enable_fast_install+set}" = set; then
enableval="$enable_fast_install"
p=${PACKAGE-default}
-case "$enableval" in
+case $enableval in
yes) enable_fast_install=yes ;;
no) enable_fast_install=no ;;
*)
@@ -1354,7 +1365,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
fi
echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:1358: checking host system type" >&5
+echo "configure:1369: checking host system type" >&5
host_alias=$host
case "$host_alias" in
@@ -1375,7 +1386,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
echo "$ac_t""$host" 1>&6
echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:1379: checking build system type" >&5
+echo "configure:1390: checking build system type" >&5
build_alias=$build
case "$build_alias" in
@@ -1401,10 +1412,10 @@ else
fi
ac_prog=ld
-if test "$ac_cv_prog_gcc" = yes; then
+if test "$GCC" = yes; then
# Check if gcc -print-prog-name=ld gives a path.
echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
-echo "configure:1408: checking for ld used by GCC" >&5
+echo "configure:1419: checking for ld used by GCC" >&5
case $host in
*-*-mingw*)
# gcc leaves a trailing carriage return which upsets mingw
@@ -1412,7 +1423,7 @@ echo "configure:1408: checking for ld used by GCC" >&5
*)
ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
esac
- case "$ac_prog" in
+ case $ac_prog in
# Accept absolute paths.
[\\/]* | [A-Za-z]:[\\/]*)
re_direlt='/[^/][^/]*/\.\./'
@@ -1434,12 +1445,12 @@ echo "configure:1408: checking for ld used by GCC" >&5
esac
elif test "$with_gnu_ld" = yes; then
echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
-echo "configure:1438: checking for GNU ld" >&5
+echo "configure:1449: checking for GNU ld" >&5
else
echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
-echo "configure:1441: checking for non-GNU ld" >&5
+echo "configure:1452: checking for non-GNU ld" >&5
fi
-if eval "test \"`echo '$''{'ac_cv_path_LD'+set}'`\" = set"; then
+if eval "test \"`echo '$''{'lt_cv_path_LD'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test -z "$LD"; then
@@ -1447,11 +1458,11 @@ else
for ac_dir in $PATH; do
test -z "$ac_dir" && ac_dir=.
if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
- ac_cv_path_LD="$ac_dir/$ac_prog"
+ lt_cv_path_LD="$ac_dir/$ac_prog"
# Check to see if the program is GNU ld. I'd rather use --version,
# but apparently some GNU ld's only accept -v.
# Break only if it was the GNU/non-GNU ld that we prefer.
- if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
+ if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
test "$with_gnu_ld" != no && break
else
test "$with_gnu_ld" != yes && break
@@ -1460,11 +1471,11 @@ else
done
IFS="$ac_save_ifs"
else
- ac_cv_path_LD="$LD" # Let the user override the test with a path.
+ lt_cv_path_LD="$LD" # Let the user override the test with a path.
fi
fi
-LD="$ac_cv_path_LD"
+LD="$lt_cv_path_LD"
if test -n "$LD"; then
echo "$ac_t""$LD" 1>&6
else
@@ -1472,24 +1483,24 @@ else
fi
test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
-echo "configure:1476: checking if the linker ($LD) is GNU ld" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_gnu_ld'+set}'`\" = set"; then
+echo "configure:1487: checking if the linker ($LD) is GNU ld" >&5
+if eval "test \"`echo '$''{'lt_cv_prog_gnu_ld'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# I'd rather use --version here, but apparently some GNU ld's only accept -v.
if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
- ac_cv_prog_gnu_ld=yes
+ lt_cv_prog_gnu_ld=yes
else
- ac_cv_prog_gnu_ld=no
+ lt_cv_prog_gnu_ld=no
fi
fi
-echo "$ac_t""$ac_cv_prog_gnu_ld" 1>&6
-with_gnu_ld=$ac_cv_prog_gnu_ld
+echo "$ac_t""$lt_cv_prog_gnu_ld" 1>&6
+with_gnu_ld=$lt_cv_prog_gnu_ld
echo $ac_n "checking for $LD option to reload object files""... $ac_c" 1>&6
-echo "configure:1493: checking for $LD option to reload object files" >&5
+echo "configure:1504: checking for $LD option to reload object files" >&5
if eval "test \"`echo '$''{'lt_cv_ld_reload_flag'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1501,13 +1512,13 @@ reload_flag=$lt_cv_ld_reload_flag
test -n "$reload_flag" && reload_flag=" $reload_flag"
echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
-echo "configure:1505: checking for BSD-compatible nm" >&5
-if eval "test \"`echo '$''{'ac_cv_path_NM'+set}'`\" = set"; then
+echo "configure:1516: checking for BSD-compatible nm" >&5
+if eval "test \"`echo '$''{'lt_cv_path_NM'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test -n "$NM"; then
# Let the user override the test.
- ac_cv_path_NM="$NM"
+ lt_cv_path_NM="$NM"
else
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
@@ -1519,27 +1530,27 @@ else
# nm: unknown option "B" ignored
# Tru64's nm complains that /dev/null is an invalid object file
if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then
- ac_cv_path_NM="$tmp_nm -B"
+ lt_cv_path_NM="$tmp_nm -B"
break
elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
- ac_cv_path_NM="$tmp_nm -p"
+ lt_cv_path_NM="$tmp_nm -p"
break
else
- ac_cv_path_NM=${ac_cv_path_NM="$tmp_nm"} # keep the first match, but
+ lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
continue # so that we can try to find one that supports BSD flags
fi
fi
done
IFS="$ac_save_ifs"
- test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
+ test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
fi
fi
-NM="$ac_cv_path_NM"
+NM="$lt_cv_path_NM"
echo "$ac_t""$NM" 1>&6
echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:1543: checking whether ln -s works" >&5
+echo "configure:1554: checking whether ln -s works" >&5
if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1560,7 +1571,7 @@ else
fi
echo $ac_n "checking how to recognise dependant libraries""... $ac_c" 1>&6
-echo "configure:1564: checking how to recognise dependant libraries" >&5
+echo "configure:1575: checking how to recognise dependant libraries" >&5
if eval "test \"`echo '$''{'lt_cv_deplibs_check_method'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1578,8 +1589,8 @@ lt_cv_deplibs_check_method='unknown'
# If you have `file' or equivalent on your system and you're not sure
# whether `pass_all' will *always* work, you probably want this one.
-case "$host_os" in
-aix4*)
+case $host_os in
+aix*)
lt_cv_deplibs_check_method=pass_all
;;
@@ -1588,8 +1599,8 @@ beos*)
;;
bsdi4*)
- lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
- lt_cv_file_magic_cmd='/usr/bin/file -L'
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
+ lt_cv_file_magic_cmd='/usr/bin/file -L'
lt_cv_file_magic_test_file=/shlib/libc.so
;;
@@ -1598,14 +1609,27 @@ cygwin* | mingw* |pw32*)
lt_cv_file_magic_cmd='$OBJDUMP -f'
;;
+darwin* | rhapsody*)
+ lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library'
+ lt_cv_file_magic_cmd='/usr/bin/file -L'
+ case "$host_os" in
+ rhapsody* | darwin1.012)
+ lt_cv_file_magic_test_file='/System/Library/Frameworks/System.framework/System'
+ ;;
+ *) # Darwin 1.3 on
+ lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib'
+ ;;
+ esac
+ ;;
+
freebsd* )
if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
- case "$host_cpu" in
+ case $host_cpu in
i*86 )
# Not sure whether the presence of OpenBSD here was a mistake.
# Let's accept both of them until this is cleared up.
- lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library'
- lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library'
+ lt_cv_file_magic_cmd=/usr/bin/file
lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
;;
esac
@@ -1618,29 +1642,28 @@ gnu*)
lt_cv_deplibs_check_method=pass_all
;;
-hpux10.20*)
- # TODO: Does this work for hpux-11 too?
- lt_cv_deplibs_check_method='file_magic (s0-90-90-9|PA-RISC0-9.0-9) shared library'
+hpux10.20*|hpux11*)
+ lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library'
lt_cv_file_magic_cmd=/usr/bin/file
lt_cv_file_magic_test_file=/usr/lib/libc.sl
;;
irix5* | irix6*)
- case "$host_os" in
+ case $host_os in
irix5*)
# this will be overridden with pass_all, but let us keep it just in case
lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1"
;;
*)
- case "$LD" in
+ case $LD in
*-32|*"-32 ") libmagic=32-bit;;
*-n32|*"-n32 ") libmagic=N32;;
*-64|*"-64 ") libmagic=64-bit;;
*) libmagic=never-match;;
esac
# this will be overridden with pass_all, but let us keep it just in case
- lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1"
- ;;
+ lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1"
+ ;;
esac
lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*`
lt_cv_deplibs_check_method=pass_all
@@ -1648,25 +1671,30 @@ irix5* | irix6*)
# This must be Linux ELF.
linux-gnu*)
- case "$host_cpu" in
- alpha* | i*86 | powerpc* | sparc* | ia64* )
+ case $host_cpu in
+ alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* )
lt_cv_deplibs_check_method=pass_all ;;
*)
# glibc up to 2.1.1 does not perform some relocations on ARM
- lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;;
- esac
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;;
+ esac
lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
;;
netbsd*)
- if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then :
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
else
- lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object'
- lt_cv_file_magic_cmd='/usr/bin/file -L'
- lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so$'
fi
;;
+newsos6)
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=/usr/lib/libnls.so
+ ;;
+
osf3* | osf4* | osf5*)
# this will be overridden with pass_all, but let us keep it just in case
lt_cv_deplibs_check_method='file_magic COFF format alpha shared library'
@@ -1683,14 +1711,18 @@ solaris*)
lt_cv_file_magic_test_file=/lib/libc.so
;;
+sysv5uw[78]* | sysv4*uw2*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
- case "$host_vendor" in
+ case $host_vendor in
ncr)
lt_cv_deplibs_check_method=pass_all
;;
motorola)
- lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
- lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
;;
esac
;;
@@ -1703,13 +1735,13 @@ file_magic_cmd=$lt_cv_file_magic_cmd
deplibs_check_method=$lt_cv_deplibs_check_method
echo $ac_n "checking for object suffix""... $ac_c" 1>&6
-echo "configure:1707: checking for object suffix" >&5
+echo "configure:1739: checking for object suffix" >&5
if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
rm -f conftest*
echo 'int i = 1;' > conftest.$ac_ext
-if { (eval echo configure:1713: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1745: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
for ac_file in conftest.*; do
case $ac_file in
*.c) ;;
@@ -1735,15 +1767,15 @@ fi
# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
# Only perform the check for file, if the check method requires it
-case "$deplibs_check_method" in
+case $deplibs_check_method in
file_magic*)
if test "$file_magic_cmd" = '$MAGIC_CMD'; then
echo $ac_n "checking for ${ac_tool_prefix}file""... $ac_c" 1>&6
-echo "configure:1743: checking for ${ac_tool_prefix}file" >&5
+echo "configure:1775: checking for ${ac_tool_prefix}file" >&5
if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
- case "$MAGIC_CMD" in
+ case $MAGIC_CMD in
/*)
lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
;;
@@ -1759,7 +1791,7 @@ else
if test -f $ac_dir/${ac_tool_prefix}file; then
lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file"
if test -n "$file_magic_test_file"; then
- case "$deplibs_check_method" in
+ case $deplibs_check_method in
"file_magic "*)
file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
@@ -1801,11 +1833,11 @@ fi
if test -z "$lt_cv_path_MAGIC_CMD"; then
if test -n "$ac_tool_prefix"; then
echo $ac_n "checking for file""... $ac_c" 1>&6
-echo "configure:1805: checking for file" >&5
+echo "configure:1837: checking for file" >&5
if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
- case "$MAGIC_CMD" in
+ case $MAGIC_CMD in
/*)
lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
;;
@@ -1821,7 +1853,7 @@ else
if test -f $ac_dir/file; then
lt_cv_path_MAGIC_CMD="$ac_dir/file"
if test -n "$file_magic_test_file"; then
- case "$deplibs_check_method" in
+ case $deplibs_check_method in
"file_magic "*)
file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
@@ -1872,7 +1904,7 @@ esac
# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
set dummy ${ac_tool_prefix}ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1876: checking for $ac_word" >&5
+echo "configure:1908: 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
@@ -1904,7 +1936,7 @@ if test -n "$ac_tool_prefix"; 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:1908: checking for $ac_word" >&5
+echo "configure:1940: 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
@@ -1939,7 +1971,7 @@ fi
# Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
set dummy ${ac_tool_prefix}strip; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1943: checking for $ac_word" >&5
+echo "configure:1975: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1971,7 +2003,7 @@ if test -n "$ac_tool_prefix"; then
# Extract the first word of "strip", so it can be a program name with args.
set dummy strip; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1975: checking for $ac_word" >&5
+echo "configure:2007: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2009,8 +2041,8 @@ libtool_flags="--cache-file=$cache_file"
test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
-test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
-test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
+test "$GCC" = yes && libtool_flags="$libtool_flags --with-gcc"
+test "$lt_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
libtool_flags="$libtool_flags --enable-win32-dll"
# Check whether --enable-libtool-lock or --disable-libtool-lock was given.
@@ -2035,12 +2067,12 @@ test x"$pic_mode" = xno && libtool_flags="$libtool_flags --prefer-non-pic"
# Some flags need to be propagated to the compiler or linker for good
# libtool support.
-case "$host" in
+case $host in
*-*-irix6*)
# Find out which ABI we are using.
- echo '#line 2042 "configure"' > conftest.$ac_ext
- if { (eval echo configure:2043: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- case "`/usr/bin/file conftest.o`" in
+ echo '#line 2074 "configure"' > conftest.$ac_ext
+ if { (eval echo configure:2075: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ case `/usr/bin/file conftest.$ac_objext` in
*32-bit*)
LD="${LD-ld} -32"
;;
@@ -2060,7 +2092,7 @@ case "$host" in
SAVE_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -belf"
echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6
-echo "configure:2064: checking whether the C compiler needs -belf" >&5
+echo "configure:2096: checking whether the C compiler needs -belf" >&5
if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2073,14 +2105,14 @@ ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$a
cross_compiling=$ac_cv_prog_cc_cross
cat > conftest.$ac_ext <<EOF
-#line 2077 "configure"
+#line 2109 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
-if { (eval echo configure:2084: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2116: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
lt_cv_cc_needs_belf=yes
else
@@ -2110,7 +2142,7 @@ echo "$ac_t""$lt_cv_cc_needs_belf" 1>&6
# Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
set dummy ${ac_tool_prefix}dlltool; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2114: checking for $ac_word" >&5
+echo "configure:2146: 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
@@ -2142,7 +2174,7 @@ if test -n "$ac_tool_prefix"; 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:2146: checking for $ac_word" >&5
+echo "configure:2178: 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
@@ -2177,7 +2209,7 @@ fi
# Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args.
set dummy ${ac_tool_prefix}as; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2181: checking for $ac_word" >&5
+echo "configure:2213: 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
@@ -2209,7 +2241,7 @@ if test -n "$ac_tool_prefix"; 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:2213: checking for $ac_word" >&5
+echo "configure:2245: 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
@@ -2244,7 +2276,7 @@ fi
# Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
set dummy ${ac_tool_prefix}objdump; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2248: checking for $ac_word" >&5
+echo "configure:2280: 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
@@ -2276,7 +2308,7 @@ if test -n "$ac_tool_prefix"; 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:2280: checking for $ac_word" >&5
+echo "configure:2312: 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
@@ -2312,12 +2344,12 @@ fi
# recent cygwin and mingw systems supply a stub DllMain which the user
# can override, but on older systems we have to supply one
echo $ac_n "checking if libtool should supply DllMain function""... $ac_c" 1>&6
-echo "configure:2316: checking if libtool should supply DllMain function" >&5
+echo "configure:2348: checking if libtool should supply DllMain function" >&5
if eval "test \"`echo '$''{'lt_cv_need_dllmain'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2321 "configure"
+#line 2353 "configure"
#include "confdefs.h"
int main() {
@@ -2325,7 +2357,7 @@ extern int __attribute__((__stdcall__)) DllMain(void*, int, void*);
DllMain (0, 0, 0);
; return 0; }
EOF
-if { (eval echo configure:2329: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2361: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
lt_cv_need_dllmain=no
else
@@ -2339,26 +2371,26 @@ fi
echo "$ac_t""$lt_cv_need_dllmain" 1>&6
- case "$host/$CC" in
+ case $host/$CC in
*-*-cygwin*/gcc*-mno-cygwin*|*-*-mingw*)
# old mingw systems require "-dll" to link a DLL, while more recent ones
# require "-mdll"
SAVE_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -mdll"
echo $ac_n "checking how to link DLLs""... $ac_c" 1>&6
-echo "configure:2350: checking how to link DLLs" >&5
+echo "configure:2382: checking how to link DLLs" >&5
if eval "test \"`echo '$''{'lt_cv_cc_dll_switch'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2355 "configure"
+#line 2387 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
-if { (eval echo configure:2362: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2394: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
lt_cv_cc_dll_switch=-mdll
else
@@ -2462,7 +2494,6 @@ LIBTOOL='$(SHELL) $(top_builddir)/libtool'
# clobbered by the next message.
exec 5>>./config.log
-
diff --git a/libobjc/encoding.c b/libobjc/encoding.c
index bbbb81cdb8b..a87f981e8eb 100644
--- a/libobjc/encoding.c
+++ b/libobjc/encoding.c
@@ -46,8 +46,8 @@ Boston, MA 02111-1307, USA. */
/* Various hacks for objc_layout_record. These are used by the target
macros. */
-#define TREE_CODE(TYPE) *TYPE
-#define TREE_TYPE(TREE) TREE
+#define TREE_CODE(TYPE) *(TYPE)
+#define TREE_TYPE(TREE) (TREE)
#define RECORD_TYPE _C_STRUCT_B
#define UNION_TYPE _C_UNION_B
@@ -56,7 +56,8 @@ Boston, MA 02111-1307, USA. */
#define TYPE_FIELDS(TYPE) objc_skip_typespec (TYPE)
-#define DECL_MODE(TYPE) *(TYPE)
+#define DECL_MODE(TYPE) *(TYPE)
+#define TYPE_MODE(TYPE) *(TYPE)
#define DFmode _C_DBL
diff --git a/libobjc/init.c b/libobjc/init.c
index 954fc9240ae..29ce6393eb7 100644
--- a/libobjc/init.c
+++ b/libobjc/init.c
@@ -313,16 +313,16 @@ __objc_send_message_in_list (MethodList_t method_list, Class class, SEL op)
Method_t mth = &method_list->method_list[i];
if (mth->method_name && sel_eq (mth->method_name, op)
- && !hash_is_key_in_hash (__objc_load_methods, mth->method_name))
+ && !hash_is_key_in_hash (__objc_load_methods, mth->method_imp))
{
- /* The method was found and wasn't previously executed. */
- (*mth->method_imp) ((id)class, mth->method_name);
-
/* Add this method into the +load hash table */
hash_add (&__objc_load_methods, mth->method_imp, mth->method_imp);
DEBUG_PRINTF ("sending +load in class: %s\n", class->name);
+ /* The method was found and wasn't previously executed. */
+ (*mth->method_imp) ((id)class, mth->method_name);
+
break;
}
}
diff --git a/libobjc/libobjc.def b/libobjc/libobjc.def
index a4a6049e816..7e0a857ecf7 100644
--- a/libobjc/libobjc.def
+++ b/libobjc/libobjc.def
@@ -45,6 +45,8 @@ objc_thread_id
objc_thread_set_data
objc_thread_set_priority
objc_thread_yield
+objc_thread_add
+objc_thread_remove
__objc_class_name_Object
__objc_class_name_Protocol
__objc_class_name_NXConstantString
diff --git a/libobjc/objc/objc-api.h b/libobjc/objc/objc-api.h
index d3e22f2088d..d0e3bb7fefb 100644
--- a/libobjc/objc/objc-api.h
+++ b/libobjc/objc/objc-api.h
@@ -578,21 +578,23 @@ object_get_super_class
}
static inline BOOL
-object_is_class(id object)
+object_is_class (id object)
{
- return CLS_ISCLASS((Class)object);
+ return ((object != nil) && CLS_ISMETA (object->class_pointer));
}
-
+
static inline BOOL
-object_is_instance(id object)
+object_is_instance (id object)
{
- return (object!=nil)&&CLS_ISCLASS(object->class_pointer);
+ return ((object != nil) && CLS_ISCLASS (object->class_pointer));
}
static inline BOOL
-object_is_meta_class(id object)
+object_is_meta_class (id object)
{
- return CLS_ISMETA((Class)object);
+ return ((object != nil)
+ && !object_is_instance (object)
+ && !object_is_class (object));
}
struct sarray*
diff --git a/libobjc/objc/thr.h b/libobjc/objc/thr.h
index f904733695a..59766f6ed7d 100644
--- a/libobjc/objc/thr.h
+++ b/libobjc/objc/thr.h
@@ -96,6 +96,8 @@ int objc_thread_get_priority(void);
void * objc_thread_get_data(void);
int objc_thread_set_data(void *value);
objc_thread_t objc_thread_id(void);
+void objc_thread_add(void);
+void objc_thread_remove(void);
/*
Use this to set the hook function that will be called when the
diff --git a/libobjc/sendmsg.c b/libobjc/sendmsg.c
index a0c8c309226..61fa28833b3 100644
--- a/libobjc/sendmsg.c
+++ b/libobjc/sendmsg.c
@@ -597,7 +597,6 @@ __objc_forward (id object, SEL sel, arglist_t args)
/* The object doesn't recognize the method. Check for responding to
error:. If it does then sent it. */
{
- size_t strlen (const char*);
char msg[256 + strlen ((const char*)sel_get_name (sel))
+ strlen ((const char*)object->class_pointer->name)];
diff --git a/libobjc/thr.c b/libobjc/thr.c
index f1c957aaa15..437ee577810 100644
--- a/libobjc/thr.c
+++ b/libobjc/thr.c
@@ -531,4 +531,33 @@ objc_condition_signal(objc_condition_t condition)
return __objc_condition_signal(condition);
}
+/* Make the objc thread system aware that a thread which is managed
+ (started, stopped) by external code could access objc facilities
+ from now on. This is used when you are interfacing with some
+ external non-objc-based environment/system - you must call
+ objc_thread_add() before an alien thread makes any calls to
+ Objective-C. Do not cause the _objc_became_multi_threaded hook to
+ be executed. */
+void
+objc_thread_add(void)
+{
+ objc_mutex_lock(__objc_runtime_mutex);
+ __objc_is_multi_threaded = 1;
+ __objc_runtime_threads_alive++;
+ objc_mutex_unlock(__objc_runtime_mutex);
+}
+
+/* Make the objc thread system aware that a thread managed (started,
+ stopped) by some external code will no longer access objc and thus
+ can be forgotten by the objc thread system. Call
+ objc_thread_remove() when your alien thread is done with making
+ calls to Objective-C. */
+void
+objc_thread_remove(void)
+{
+ objc_mutex_lock(__objc_runtime_mutex);
+ __objc_runtime_threads_alive--;
+ objc_mutex_unlock(__objc_runtime_mutex);
+}
+
/* End of File */
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 3da56c21d19..34114e77445 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,3023 @@
+2002-02-20 Release Manager
+
+ * GCC 3.0.4 Released.
+
+2001-02-14 Joel Sherrill <joel@OARcorp.com>
+
+ * config/cpu/m68k/bits/atomicity.h: Corrected for RTEMS targets which
+ do not have a CAS instruction.
+
+2002-01-28 Jens Rehsack <rehsack@web.de>
+
+ libstdc++/3561
+ * include/bits/ostream.tcc (__pad_char): Support -Wshadow -Werror.
+
+2002-01-23 Richard Henderson <rth@redhat.com>
+
+ PR libstdc++/5198
+ * config/cpu/m68k/bits/atomicity.h (__exchange_and_add): Only use
+ CAS on the cpu variants that support it. Add versions that use
+ TAS and that disable interrupts.
+ (__atomic_add): Use __exchange_and_add to guarantee atomicity.
+
+2002-01-18 David Edelsohn <edelsohn@gnu.org>
+
+ (copy from trunk 2002-01-17 2002-01-16)
+ * configure.target: Define OPT_LDFLAGS for AIX case.
+ * acinclude.m4 (GLIBCPP_CHECK_LINKER_FEATURES): Do not clear
+ SECTION_LDFLAGS and OPT_LDFLAGS. Fix ac_sectionLDflags type.
+ * aclocal.m4: Regenerate.
+ * configure: Regenerate.
+
+2002-01-16 Benjamin Kosnik <bkoz@redhat.com>
+ <vakatov@ncbi.nlm.nih.gov>
+
+ libstdc++/3272 (copy from trunk 2001-06-11)
+ libstdc++/5181
+ * include/bits/streambuf.tcc (__copy_streambufs): Don't set eofbit.
+ * testsuite/27_io/ostream_inserter_other.cc (test04): Add test.
+ * testsuite/27_io/istream_extractor_other.cc: Fix.
+
+2002-01-15 Loren Rittle <ljrittle@acm.org>
+
+ * include/Makefile.am (extra_target_headers): New list of all
+ target files built with ad hoc naming rules.
+ (stamp-*): Handle LN_S failure in manner portable across make
+ implementations.
+ (install-data-local): Install header files from human-maintained
+ file lists and directory components instead of non-robust find.
+ * include/Makefile.in: Rebuilt.
+
+2002-01-14 Benjamin Kosnik <bkoz@redhat.com>
+
+ * src/Makefile.am (libstdc___la_LDFLAGS): Increase revision number.
+ * src/Makefile.in: Regenerate.
+
+2002-01-02 Nathan Myers <ncm@cantrip.org>
+ Loren Rittle <ljrittle@acm.org>
+
+ libstdc++/5037 (copy from trunk 2001-12-07 and 2001-12-11)
+ * config/cpu/sparc/sparc32/bits/atomicity.h
+ (struct __Atomicity_lock<__inst>): Add.
+ (__Atomicity_lock<__inst>::_S_atomicity_lock): Add.
+ (__Atomicity_lock<0>::_S_atomicity_lock): Add.
+ (__exchange_and_add): Use __Atomicity_lock<0>::_S_atomicity_lock
+ instead of lock local to static function.
+ (__atomic_add): Likewise.
+
+2001-12-20 Release Manager
+
+ * GCC 3.0.3 Released.
+
+2001-12-13 Phil Edwards <pme@gcc.gnu.org>
+
+ Bulk documentation merge (copy) from trunk.
+ * docs/html/Makefile, docs/html/documentation.html,
+ docs/html/explanations.html, docs/html/17_intro/BUGS,
+ docs/html/17_intro/C++STYLE, docs/html/17_intro/CHECKLIST,
+ docs/html/17_intro/DESIGN, docs/html/17_intro/TODO,
+ docs/html/17_intro/howto.html, docs/html/17_intro/license.html,
+ docs/html/17_intro/porting-howto.html,
+ docs/html/17_intro/porting-howto.xml, docs/html/17_intro/porting.html,
+ docs/html/17_intro/porting.texi, docs/html/18_support/howto.html,
+ docs/html/19_diagnostics/howto.html, docs/html/20_util/howto.html,
+ docs/html/21_strings/howto.html, docs/html/23_containers/howto.html,
+ docs/html/26_numerics/howto.html, docs/html/27_io/howto.html,
+ docs/html/ext/howto.html, docs/html/ext/lwg-active.html,
+ docs/html/ext/lwg-defects.html, docs/html/ext/sgiexts.html,
+ docs/html/faq/index.html, docs/html/faq/index.txt: Merge from trunk.
+
+2001-12-10 Philip Martin <philip@codematters.co.uk>
+
+ PR libstdc++/3720
+ * include/bits/locale_facets.h
+ (_M_extract_buffer_length): Add this constant.
+ * include/bits/locale_facet.tcc
+ (do_get): Use _M_extract_buffer_length.
+ * src/locale.cc
+ (_M_extract): Set failbit if buffer gets filled while
+ extracting characters.
+ * testsuite/27_io/istream_extractor_arith.cc
+ (tes12_aux, test12, test13): Add, ported from trunk.
+
+2001-12-09 Edward E. Meyer <edward.e.meyer@boeing.com>
+
+ PR libstdc++/4622 (copy from trunk 2001-10-31)
+ * include/bits/std_complex.h (complex::operator/=): Correct sign.
+
+2001-11-21 Paolo Carlini <pcarlini@unitus.it>
+
+ PR libstdc++/4548
+ * include/bits/basic_string.tcc (basic_string::reserve): Never shrink
+ below the current size.
+ * testsuite/21_strings/capacity.cc (test02): Add test.
+
+2001-11-16 Paolo Carlini <pcarlini@unitus.it>
+
+ * include/bits/stl_deque.h (deque::erase()): Fix memory leak.
+
+2001-11-09 Phil Edwards <pme@gcc.gnu.org>
+
+ * acinclude.m4 (GLIBCPP_ENABLE_LONG_LONG): Run the test in
+ LANG_CPLUSPLUS mode.
+ * aclocal.m4: Regenerate.
+ * configure: Regenerate.
+
+2001-11-02 Phil Edwards <pme@gcc.gnu.org>
+
+ * acconfig.h: Update comments.
+ * acinclude.m4 (GLIBCPP_ENABLE_C99): Move strtoll, strtoull tests...
+ (GLIBCPP_ENABLE_LONG_LONG): ...to here. Don't check enable_c99.
+ * aclocal.m4: Regenerate.
+ * config.h.in: Regenerate.
+ * configure: Regenerate.
+
+ * include/bits/boost_concept_check.h: Unconditionally compile uses
+ of 'long long' which require only compiler support, not C lib support.
+ * include/bits/cpp_type_traits.h: Likewise.
+ * include/bits/std_limits.h: Likewise.
+ * include/bits/type_traits.h: Likewise.
+ * src/limits.cc: Likewise.
+ * include/c_shadow/stdlib.h: Compile conditionally on _GLIBCPP_USE_C99
+ instead of _GLIBCPP_USE_LONG_LONG.
+ * include/c_shadow/bits/std_cstdlib.h: Likewise.
+
+2001-11-01 Gabriel Dos Reis <gdr@merlin.codesourcery.com>
+
+ * include/bits/std_complex.h (_Norm_helper): New class template.
+ (norm): Tweak.
+ (std): Tweak.
+
+2001-10-23 Release Manager
+
+ * GCC 3.0.2 Released.
+
+2001-10-19 Phil Edwards <pme@gcc.gnu.org>
+
+ Bulk documentation merge (copy) from trunk.
+ * docs/html/17_intro/COPYING.DOC, docs/html/17_intro/license.html,
+ docs/html/22_locale/messages.html, docs/html/ext/lwg-active.html,
+ docs/html/ext/lwg-defects.html, docs/html/ext/sgiexts.html: New.
+
+ * docs/html/configopts.html, docs/html/documentation.html,
+ docs/html/explanations.html, docs/html/install.html,
+ docs/html/17_intro/howto.html, docs/html/18_support/howto.html,
+ docs/html/19_diagnostics/howto.html, docs/html/20_util/howto.html,
+ docs/html/21_strings/howto.html, docs/html/22_locale/codecvt.html,
+ docs/html/22_locale/ctype.html, docs/html/22_locale/howto.html,
+ docs/html/22_locale/locale.html, docs/html/23_containers/howto.html,
+ docs/html/24_iterators/howto.html, docs/html/25_algorithms/howto.html,
+ docs/html/26_numerics/howto.html, docs/html/27_io/howto.html,
+ docs/html/ext/howto.html, docs/html/faq/index.html,
+ docs/html/faq/index.txt: Merge from trunk.
+
+2001-10-07 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * docs/html/22_locale/locale.html: Fix spelling error of
+ "separate" as "seperate".
+
+2001-10-02 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * testsuite/lib/libstdc++-v3-dg.exp (libstdc++-v3-init): Use
+ correct multilib builddir.
+ Properly locate libgcc_s.
+
+2001-09-25 Phil Edwards <pme@gcc.gnu.org>
+
+ * testsuite/21_strings/c_strings.cc (test01, test02): Increase
+ `carray' size.
+
+2001-09-14 Phil Edwards <pme@sources.redhat.com>
+
+ * docs/html/17_intro/headers_cc.txt: "Sync"/copy real file over.
+ * docs/html/17_intro/howto.html: Spacing and HTML markup fixes.
+ * docs/html/18_support/howto.html: It won't compile; it's not code.
+ * docs/html/19_diagnostics/howto.html: Point diagram seekers to
+ doxygen'd pages.
+ * docs/html/22_locale/howto.html: Comment for future work.
+ * docs/html/23_containers/howto.html: More comments.
+ * docs/html/25_algorithms/howto.html: It's a comment, not a
+ blunt command to the reader. (English grammar.)
+
+2001-09-12 Gabriel Dos Reis <gdr@merlin.codesourcery.com>
+
+ * include/bits/std_limits.h (numeric_limits<float>::radix,
+ numeric_limits<float>::epsilon: Fix thinko.
+
+2001-09-10 Benjamin Kosnik <bkoz@redhat.com>
+
+ * src/Makefile.am (libstdc___la_LDFLAGS): Increase revision number.
+ * src/Makefile.in: Regenerate.
+
+2001-09-04 Benjamin Kosnik <bkoz@redhat.com>
+
+ * include/c_std/bits/std_c*.h: Don't use include_next.
+
+2001-09-05 Phil Edwards <pme@sources.redhat.com>
+
+ * Makefile.am: The testsuite directory never needs to be made here.
+ * Makefile.in: Regenerate.
+ * include/Makefile.in: Regenerate.
+ * libio/Makefile.in: Regenerate.
+ * libmath/Makefile.in: Regenerate.
+ * libsupc++/Makefile.in: Regenerate.
+ * po/Makefile.in: Regenerate.
+ * src/Makefile.in: Regenerate.
+ * testsuite/Makefile.in: Regenerate.
+
+2001-08-30 Loren J. Rittle <ljrittle@acm.org>
+
+ PR libstdc++/4082
+ 2001-08-13 H.J. Lu (hjl@gnu.org)
+
+ * testsuite/lib/libstdc++-v3-dg.exp (libstdc++-v3-copy-files):
+ New. Copy files.
+ (libstdc++-v3-init): Use it.
+
+2001-08-28 Loren J. Rittle <ljrittle@acm.org>
+
+ PR libstdc++/4082
+ * include/Makefile.am: Use toplevel_srcdir to refer to src files
+ outside this component.
+ * include/Makefile.in: Regenerate.
+
+2001-08-28 Phil Edwards <pme@sources.redhat.com>
+
+ Move testsuite_hooks changes onto the branch. This is the 08-06
+ patch (on trunk) from pme, plus the 08-09 change from bkoz and the
+ 08-10 fix from ljrittle, accumulated into one.
+ * acconfig.h (_GLIBCPP_MEM_LIMITS): Define.
+ * acinclude.m4 (GLIBCPP_CONFIGURE_TESTSUITE): New macro, calls...
+ (GLIBCPP_CHECK_SETRLIMIT): ...this new macro, which also uses...
+ (GLIBCPP_CHECK_SETRLIMIT_ancilliary): ...this new macro.
+ * configure.in: Call GLIBCPP_CONFIGURE_TESTSUITE.
+ * aclocal.m4: Regenerate.
+ * config.h.in: Regenerate.
+ * configure: Regenerate.
+ * testsuite/lib/libstdc++-v3-dg.exp: Download new header instead
+ of old header.
+
+ * testsuite/debug_assert.h: Removed; contents merged into...
+ * testsuite/testsuite_hooks.h: ...here. New file.
+ * testsuite/17_intro/header_ciso646.cc: No longer include
+ debug_assert.h, include testsuite_hooks.h instead.
+ * testsuite/17_intro/header_fstream.cc: Likewise.
+ * testsuite/17_intro/header_iomanip.cc: Likewise.
+ * testsuite/17_intro/header_ios.cc: Likewise.
+ * testsuite/17_intro/header_iosfwd.cc: Likewise.
+ * testsuite/17_intro/header_iostream.cc: Likewise.
+ * testsuite/17_intro/header_istream.cc: Likewise.
+ * testsuite/17_intro/header_ostream.cc: Likewise.
+ * testsuite/17_intro/header_sstream.cc: Likewise.
+ * testsuite/17_intro/header_streambuf.cc: Likewise.
+ * testsuite/18_support/numeric_limits.cc: Likewise.
+ * testsuite/19_diagnostics/stdexceptions.cc: Likewise.
+ * testsuite/20_util/auto_ptr.cc: Likewise.
+ * testsuite/21_strings/append.cc: Likewise.
+ * testsuite/21_strings/capacity.cc: Likewise.
+ * testsuite/21_strings/char_traits_requirements.cc: Likewise.
+ * testsuite/21_strings/compare.cc: Likewise.
+ * testsuite/21_strings/ctor_copy_dtor.cc: Likewise.
+ * testsuite/21_strings/element_access.cc: Likewise.
+ * testsuite/21_strings/find.cc: Likewise.
+ * testsuite/21_strings/insert.cc: Likewise.
+ * testsuite/21_strings/inserters_extractors.cc: Likewise.
+ * testsuite/21_strings/invariants.cc: Likewise.
+ * testsuite/21_strings/nonmember.cc: Likewise.
+ * testsuite/21_strings/operations.cc: Likewise.
+ * testsuite/21_strings/replace.cc: Likewise.
+ * testsuite/21_strings/rfind.cc: Likewise.
+ * testsuite/21_strings/substr.cc: Likewise.
+ * testsuite/22_locale/codecvt_char_char.cc: Likewise.
+ * testsuite/22_locale/codecvt_unicode_char.cc: Likewise.
+ * testsuite/22_locale/codecvt_unicode_wchar_t.cc: Likewise.
+ * testsuite/22_locale/codecvt_wchar_t_char.cc: Likewise.
+ * testsuite/22_locale/ctor_copy_dtor.cc: Likewise.
+ * testsuite/22_locale/ctype_char_members.cc: Likewise.
+ * testsuite/22_locale/ctype_wchar_t_members.cc: Likewise.
+ * testsuite/22_locale/facet.cc: Likewise.
+ * testsuite/22_locale/global_templates.cc: Likewise.
+ * testsuite/22_locale/members.cc: Likewise.
+ * testsuite/22_locale/numpunct_byname.cc: Likewise.
+ * testsuite/22_locale/numpunct_char_members.cc: Likewise.
+ * testsuite/22_locale/operators.cc: Likewise.
+ * testsuite/22_locale/static_members.cc: Likewise.
+ * testsuite/23_containers/bitset_ctor.cc: Likewise.
+ * testsuite/23_containers/bitset_members.cc: Likewise.
+ * testsuite/23_containers/bitset_shift.cc: Likewise.
+ * testsuite/23_containers/map_insert.cc: Likewise.
+ * testsuite/23_containers/vector_capacity.cc: Likewise.
+ * testsuite/23_containers/vector_ctor.cc: Likewise.
+ * testsuite/23_containers/vector_element_access.cc: Likewise.
+ * testsuite/23_containers/vector_modifiers.cc: Likewise.
+ * testsuite/24_iterators/istreambuf_iterator.cc: Likewise.
+ * testsuite/24_iterators/iterator.cc: Likewise.
+ * testsuite/24_iterators/ostreambuf_iterator.cc: Likewise.
+ * testsuite/25_algorithms/lower_bound.cc: Likewise.
+ * testsuite/25_algorithms/min_max.cc: Likewise.
+ * testsuite/26_numerics/c_math.cc: Likewise.
+ * testsuite/26_numerics/complex_inserters_extractors.cc: Likewise.
+ * testsuite/26_numerics/complex_value.cc: Likewise.
+ * testsuite/27_io/filebuf.cc: Likewise.
+ * testsuite/27_io/filebuf_members.cc: Likewise.
+ * testsuite/27_io/filebuf_virtuals.cc: Likewise.
+ * testsuite/27_io/fpos.cc: Likewise.
+ * testsuite/27_io/fstream_members.cc: Likewise.
+ * testsuite/27_io/ifstream_members.cc: Likewise.
+ * testsuite/27_io/ios_base_callbacks.cc: Likewise.
+ * testsuite/27_io/ios_base_members_static.cc: Likewise.
+ * testsuite/27_io/ios_base_storage.cc: Likewise.
+ * testsuite/27_io/ios_ctor.cc: Likewise.
+ * testsuite/27_io/ios_init.cc: Likewise.
+ * testsuite/27_io/ios_manip_basefield.cc: Likewise.
+ * testsuite/27_io/ios_manip_fmtflags.cc: Likewise.
+ * testsuite/27_io/ios_members.cc: Likewise.
+ * testsuite/27_io/istream_extractor_arith.cc: Likewise.
+ * testsuite/27_io/istream_extractor_char.cc: Likewise.
+ * testsuite/27_io/istream_extractor_other.cc: Likewise.
+ * testsuite/27_io/istream_manip.cc: Likewise.
+ * testsuite/27_io/istream_seeks.cc: Likewise.
+ * testsuite/27_io/istream_sentry.cc: Likewise.
+ * testsuite/27_io/istream_unformatted.cc: Likewise.
+ * testsuite/27_io/istringstream_members.cc: Likewise.
+ * testsuite/27_io/narrow_stream_objects.cc: Likewise.
+ * testsuite/27_io/ofstream_members.cc: Likewise.
+ * testsuite/27_io/ostream_inserter_arith.cc: Likewise.
+ * testsuite/27_io/ostream_inserter_char.cc: Likewise.
+ * testsuite/27_io/ostream_inserter_other.cc: Likewise.
+ * testsuite/27_io/ostream_manip.cc: Likewise.
+ * testsuite/27_io/ostream_seeks.cc: Likewise.
+ * testsuite/27_io/ostream_unformatted.cc: Likewise.
+ * testsuite/27_io/ostringstream_members.cc: Likewise.
+ * testsuite/27_io/streambuf.cc: Likewise.
+ * testsuite/27_io/stringbuf.cc: Likewise.
+ * testsuite/27_io/stringbuf_virtuals.cc: Likewise.
+ * testsuite/27_io/stringstream.cc: Likewise.
+ * testsuite/27_io/stringstream_members.cc: Likewise.
+ * testsuite/27_io/wide_stream_objects.cc: Likewise.
+
+2001-08-28 Loren J. Rittle <ljrittle@acm.org>
+
+ * testsuite/23_containers/map_insert.cc: (For 3.0 branch only:)
+ Include debug_assert.h not testsuite_hooks.h.
+
+2001-08-27 Phil Edwards <pme@sources.redhat.com>
+
+ PR libstdc++/4143
+ * acinclude.m4 (GLIBCPP_EXPORT_INSTALL_INFO): Handle enable/disable
+ correctly for version-specific-runtime-libs.
+ * aclocal.m4: Regenerate.
+ * configure: Regenerate.
+
+2001-08-24 Benjamin Kosnik <bkoz@redhat.com>
+
+ * include/Makefile.am (install-data-local): Don't install Makefile.
+ * include/Makefile.in: Regenerated.
+
+2001-08-24 Jan van Male <jan.vanmale@fenk.wau.nl>
+
+ * docs/html/17_intro/C++STYLE: Fix typo.
+
+2001-08-24 Phil Edwards <pme@sources.redhat.com>
+
+ * docs/html/23_containers/howto.html: Describe implementation of
+ insertion with hints.
+
+2001-08-24 Sylvain Pion <Sylvain.Pion@sophia.inria.fr>
+ Phil Edwards <pme@sources.redhat.com>
+
+ PR libstdc++/3349
+ * include/bits/stl_tree.h (insert_unique): Revert last change.
+ Values inserted at begin() must be less, not greater, than *begin()'s.
+ * testsuite/23_containers/map_insert.cc: New file.
+
+2001-08-23 David Edelsohn <edelsohn@gnu.org>
+
+ * config/os/gnu-linux/bits/os_defines.h: Correct __s390__ definitions.
+ Set __powerpc__ long double definition based on __LONG_DOUBLE_128__.
+
+2001-08-19 Release Manager
+
+ * GCC 3.0.1 Released.
+
+2001-08-17 Loren J. Rittle <ljrittle@acm.org>
+
+ bootstrap/3963
+ * include/Makefile.am: Use relative file path in rule to allow
+ colon in $(objdir).
+ * include/Makefile.in: Rebuilt.
+
+2001-08-16 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
+
+ * configure.target: Set LIMITSH for powerpc-*-*.
+ * config/cpu/powerpc/bits/limits.h: New file.
+
+2001-08-16 Marc Espie <espie@openbsd.org>
+
+ * libmath/mathconf.h: Include <sys/types.h> on OpenBSD (branch
+ fix only, for robustness).
+
+2001-08-15 Andreas Schwab <schwab@suse.de>
+
+ * configure.target (cpu_include_dir): Set to `config/cpu/m68k' for
+ m68k and m680[246]0.
+ * config/cpu/m68k/bits/atomicity.h: New file.
+
+ * include/bits/std_limits.h [__glibcpp_long_double_bits == 96]:
+ Define appropriate long double limits for m68k extended floating
+ point.
+ (__glibcpp_f32_digits10): Corrected, off by one.
+ (__glibcpp_f80_digits10): Likewise.
+ (__glibcpp_f128_digits10): Likewise.
+ * config/os/gnu-linux/bits/os_defines.h
+ (__glibcpp_long_double_bits) [__mc68000__]: Define to 96.
+
+2001-08-15 Gabriel Dos Reis <gdr@merlin.codesourcery.com>
+
+ * include/bits/std_limits.h (numeric_limits<char>::max): Fix
+ typo.
+
+2001-08-14 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * configure.target (cpu_include_dir): Set to `config/cpu/s390'
+ for s390 and s390x.
+
+ * config/cpu/s390/bits/atomicity.h: New.
+
+2001-08-14 Gabriel Dos Reis <gdr@codesourcery.com>
+
+ * include/bits/std_limits.h: Fix thinko.
+
+2001-08-14 Benjamin Kosnik <bkoz@redhat.com>
+
+ * src/Makefile.am (libstdc___la_LDFLAGS): Increase revision number.
+ * src/Makefile.in: Regenerate.
+
+2001-08-14 Peter Schmid <schmid@snake.iap.physik.tu-darmstadt.de>
+
+ * libstdc++-v3/libmath/stubs.c: Fix PR/3988, replace
+ _GBLICPP_HAVE_LOGL with HAVE_LOGL
+
+2001-08-13 Mark Mitchell <mark@codesourcery.com>
+
+ * configure.in (LIMITS_INC_SRCDIR): New variable.
+ * configure.target (LIMITSH): New variable.
+ * porting.texi: Discuss numeric limits.
+ * config/cpu/generic/bits/limits.h: New file.
+ * config/cpu/i386/bits/limits.h: New file.
+ * include/Makefile.am: Install bits/limits.h.
+ * include/bits/c++config: Include bits/limits.h.
+
+2001-08-10 Gabriel Dos Reis <gdr@merlin.codesourcery.com>
+ Mark Mitchell <mark@codesourcery.com>
+
+ * include/bits/std_limits.h: New file.
+ * include/Makefile.am (bits_headers): Add std_limits.h
+ (all-local): std_limits.h is no longer built.
+ (${target_builddir}/std_limits.h): Remove.
+ * include/Makefile.in: Regenerate.
+ * src/limits.cc: New file.
+ * src/Makefile.am (sources): Add limits.cc in replacement of
+ limitsMEMBERS.cc.
+ * src/Makefile.in: Regenerate.
+
+2001-08-09 David Edelsohn <edelsohn@gnu.org>
+
+ * config/os/aix/bits/os_defines.h: Define std_limits.h macros.
+ * config/os/generic/bits/os_defines.h: Likewise.
+ * config/os/gnu-linux/bits/os_defines.h: Likewise.
+ * config/os/hpux/bits/os_defines.h: Likewise.
+ * config/os/irix/irix6.5/bits/os_defines.h: Likewise.
+ * config/os/solaris/solaris2.7/bits/os_defines.h: Likewise.
+
+2001-08-10 Gunter Winkler <gunter.winkler@mathematik.tu-chemnitz.de>
+
+ * include/bits/std_complex.h (complex<long double>::operator*=,
+ complex<long double>::operator/=): Fix thinko.
+
+2001-07-31 Loren J. Rittle <ljrittle@acm.org>
+
+ * src/gen-num-limits.cc: Use __LONG_LONG_MAX__.
+
+2001-07-30 Benjamin Kosnik <bkoz@redhat.com>
+
+ * configure.target: Remove mips from cpu table.
+ * config/cpu/mips/bits/atomicity.h: Remove generic
+ versions. Comment sgidefs include.
+
+2001-07-26 Gabriel Dos Reis <gdr@merlin.codesourcery.com>
+
+ * acinclude.m4: CHECK_MATH_DECL_AND_LINKAGE for hypot, hypotf,
+ hypotl, atan2f, atan2l. Remove from REPLACE_MATHFUNCS list.
+ * aclocal.m4: Regenerate.
+ * config.h.in: Likewise.
+ * configure: Likewise.
+ * libmath/Makefile.am (EXTRA_LONG_DOUBLE_yes): Remove hypotl.c
+ (EXTRA_DIST): Remove hypot.c hypotf.c.
+ * libmath/Makefile.am: Regenerate.
+ * libmath/hypotf.c: Remove.
+ * libmath/hypot.c: Likewise.
+ * libmath/hypotl.c: Likewise.
+ * libmath/stubs.c: The macros seen here are HAVE_xxx, not
+ _GLIBCPP_HAVE_xxx. Add long double versions.
+
+2001-07-26 Stephen M. Webb <stephen@bregmasoft.com>
+
+ * acinclude.m4 (GLIBCPP_ENABLE_CHEADERS): Use glibcpp_srcdir when
+ setting C_INCLUDE_DIR.
+ * aclocal.m4: Regenerate.
+ * configure: Regenerate.
+
+2001-07-26 Stephen M. Webb <stephen@bregmasoft.com>
+ Loren J. Rittle <ljrittle@acm.org>
+ Phil Edwards <pme@sources.redhat.com>
+
+ * include/Makefile.am: New file encapsulating header generation rules.
+ * Makefile.am (SUBDIRS): Prepend 'include' directory.
+ * acinclude.m4: Moved/removed rules for building various headers.
+ * configure.in (AC_OUTPUT): Add include/Makefile.
+ * mkc++config: Removed.
+
+ * testsuite_flags.in: Changed build-includes to match new scheme.
+ * mknumeric_limits: Likewise.
+ * libio/Makefile.am: Changed INCLUDES to maatch new header scheme.
+ * libmath/Makefile.am: Likewise.
+ * libsupc++/Makefile.am: Likewise.
+ * src/Makefile.am: Likewise; removed rules to build headers.
+ * libmath/mathconf.h: Changed #include'd header names to match.
+ * libmath/stubs.c: Likewise.
+ * src/gen-num-limits.cc: Likewise.
+
+ * configure: Regenerated.
+ * config.h.in: Regenerated.
+ * aclocal.m4: Regenerated.
+ * Makefile.in: Regenerated.
+ * include/Makefile.in: Regenerated.
+ * libio/Makefile.in: Regenerated.
+ * libmath/Makefile.in: Regenerated.
+ * libsupc++/Makefile.in: Regenerated.
+ * src/Makefile.in: Regenerated.
+ * testsuite/Makefile.in: Regenerated.
+
+2001-07-26 Daniel Jacobowitz <drow@mvista.com>
+
+ * configure.in: Remove NATIVE, NULL_TARGET.
+ Set CANADIAN only for Canadian crosses. Set xcompiling
+ for both Canadian crosses and host-x-host crosses.
+ * configure: Regenerated.
+
+2001-07-25 H.J. Lu <hjl@gnu.org>
+
+ * configure.target (cpu_include_dir): Set to `config/cpu/mips'
+ for mips.
+
+ * config/cpu/mips/bits/atomicity.h: New.
+
+2001-07-25 David Edelsohn <edelsohn@gnu.org>
+
+ * include/bits/limits_generic.h (int): Set digits and digits10
+ appropriately for word size.
+ (unsigned int,long,unsigned long): Likewise.
+
+2001-07-19 Phil Edwards <pme@sources.redhat.com>
+ Mark Mitchell <mark@codesourcery.com>
+
+ Merge from cp-parser-branch.
+ * include/bits/basic_string.h: Qualify symbols with 'template'.
+ * include/bits/basic_string.tcc: Likewise.
+ * include/bits/fstream.tcc: Likewise.
+ * include/bits/istream.tcc: Likewise.
+ * include/bits/sstream.tcc: Likewise.
+ * include/bits/std_istream.h: Likewise.
+ * include/bits/stl_iterator.h: Likewise.
+ * include/bits/streambuf.tcc: Likewise.
+ * src/gen-num-limits.cc: Add 'template<>' to specializations.
+ * src/locale.cc: Likewise.
+
+2001-07-19 Gabriel Dos Reis <gdr@merlin.codesourcery.com>
+ Bert De Knuydt <Bert.Deknuydt@esat.kuleuven.ac.be>
+
+ * src/gen-num-limits.cc (set_signals_handler): New function.
+ Factor out signals setting. Set signal handler for SIGILL.
+
+2001-07-18 Phil Edwards <pme@sources.redhat.com>
+
+ * docs/html/27_io/howto.html: Fix typo.
+ * docs/html/faq/index.html: Minor updates for 3.0 all around.
+ * docs/html/faq/index.txt: Regenerated.
+
+2001-07-13 Phil Edwards <pme@sources.redhat.com>
+
+ * include/bits/std_sstream.h (basic_stringbuf::basic_stringbuf(string):
+ Initialize _M_string with pointer-and-size constructor, not just
+ pointer. Fix some comments.
+ * testsuite/21_strings/ctor_copy_dtor.cc (test03): New test.
+ * testsuite/27_io/stringbuf.cc (test02): Remove unused variable.
+ (test03): Add embedded-NUL tests.
+
+ * mkcheck.in: When printing totals, match the order of the tests.
+ * include/bits/stringfwd.h: Use same declaration keywords.
+ * include/bits/std_iosfwd.h: Cosmetic spacing.
+
+2001-07-11 Felix Natter <fnatter@gmx.net>
+
+ * docs/html/17_intro/porting-howto.xml: Initial checkin of
+ master copy.
+ * docs/html/17_intro/porting-howto.html: check in v0.9.3
+
+2001-07-11 Phil Edwards <pme@sources.redhat.com>
+
+ * docs/doxygen/run_doxygen: Don't keep output from previous run.
+ * docs/doxygen/user.cfg.in: Tweaks.
+ * include/bits/c++config: Documentation comments for Doxygen.
+ * include/bits/char_traits.h: Likewise.
+ * include/bits/limits_generic.h: Likewise.
+ * include/bits/std_stdexcept.h: Likewise.
+ * include/bits/stl_pair.h: Likewise.
+ * libsupc++/exception: Likewise.
+ * libsupc++/new: Likewise.
+ * libsupc++/typeinfo: Likewise.
+ * libmath/Makefile.am: Update and correct copyright.
+
+2001-07-10 Gabriel Dos Reis <gdr@merlin.codesourcery.com>
+
+ * acinclude.m4: Don't AC_REPLACE_MATHFUNCS expf and atan2f.
+ * aclocal.m4: Regenerate.
+ * configure: Same.
+
+2001-07-09 Phil Edwards <pme@sources.redhat.com>
+
+ * docs/html/configopts.html: Fix thinko.
+ * docs/html/27_io/howto.html: Fix thinko and HTML markup.
+ * include/bits/stl_iterator.h: Fix typo.
+
+2001-07-09 Phil Edwards <pme@sources.redhat.com>
+
+ * docs/html/explanations.html: New file.
+ * docs/html/configopts.html: Link to it to provide more notes
+ on cstdio. Minor markup and spacing fixes.
+ * docs/html/27_io/howto.html: Talk about sync_with_stdio.
+
+2001-07-09 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ * include/bits/valarray_meta.h (_Expr::operator+): Use qualified id
+ for _Expr template template argument.
+ (_Expr::operator-): Likewise.
+ (_Expr::operator~): Likewise.
+ (_Expr::operator!): Likewise.
+ (_DEFINE_EXPR_UNARY_OPERATOR): Likewise.
+
+2001-07-06 Gabriel Dos Reis <gdr@merlin.codesourcery.com>
+
+ * libmath/Makefile.am (EXTRA_DIST): Remove atan2f.c and expf.c
+ * libmath/Makefile.in: Regenerate.
+ * libmath/expf.c: Remove.
+ * libmath/atan2f.c: Likewise.
+
+2001-07-02 Loren J. Rittle <ljrittle@acm.org>
+
+ * acinclude.m4 (GLIBCPP_ENABLE_THREADS): Protect variable from shell
+ expansion (thanks to Alexandre Oliva).
+ * aclocal.m4: Regenerate.
+ * configure: Regenerate.
+
+2001-07-02 Loren J. Rittle <ljrittle@acm.org>
+
+ libstdc++/3284
+ * acinclude.m4 (GLIBCPP_ENABLE_THREADS): Portability enhancement.
+ * aclocal.m4: Regenerate.
+ * configure: Regenerate.
+
+2001-07-02 Loren J. Rittle <ljrittle@acm.org>
+
+ libstdc++/3243
+ * acinclude.m4 (GLIBCPP_ENABLE_THREADS): Add relative path to
+ staged/installed area to support -I-. Document.
+ * aclocal.m4: Regenerate.
+ * configure: Regenerate.
+
+2001-06-27 Phil Edwards <pme@sources.redhat.com>
+
+ * include/backward/algo.h: Add "GPL plus runtime exception" comment
+ block, this time for real.
+ * include/backward/algobase.h: Likewise.
+ * include/backward/alloc.h: Likewise.
+ * include/backward/bvector.h: Likewise.
+ * include/backward/defalloc.h: Likewise.
+ * include/backward/deque.h: Likewise.
+ * include/backward/function.h: Likewise.
+ * include/backward/hash_map.h: Likewise.
+ * include/backward/hash_set.h: Likewise.
+ * include/backward/hashtable.h: Likewise.
+ * include/backward/heap.h: Likewise.
+ * include/backward/iterator.h: Likewise.
+ * include/backward/list.h: Likewise.
+ * include/backward/map.h: Likewise.
+ * include/backward/multimap.h: Likewise.
+ * include/backward/multiset.h: Likewise.
+ * include/backward/pair.h: Likewise.
+ * include/backward/rope.h: Likewise.
+ * include/backward/set.h: Likewise.
+ * include/backward/slist.h: Likewise.
+ * include/backward/stack.h: Likewise.
+ * include/backward/strstream: Likewise.
+ * include/backward/tempbuf.h: Likewise.
+ * include/backward/tree.h: Likewise.
+ * include/backward/vector.h: Likewise.
+ * include/bits/pthread_allocimpl.h: Likewise.
+ * include/bits/std_algorithm.h: Likewise.
+ * include/bits/std_bitset.h: Likewise.
+ * include/bits/std_deque.h: Likewise.
+ * include/bits/std_functional.h: Likewise.
+ * include/bits/std_iterator.h: Likewise.
+ * include/bits/std_list.h: Likewise.
+ * include/bits/std_map.h: Likewise.
+ * include/bits/std_memory.h: Likewise.
+ * include/bits/std_numeric.h: Likewise.
+ * include/bits/std_queue.h: Likewise.
+ * include/bits/std_set.h: Likewise.
+ * include/bits/std_stack.h: Likewise.
+ * include/bits/std_utility.h: Likewise.
+ * include/bits/std_vector.h: Likewise.
+ * include/bits/stl_algo.h: Likewise.
+ * include/bits/stl_algobase.h: Likewise.
+ * include/bits/stl_alloc.h: Likewise.
+ * include/bits/stl_bvector.h: Likewise.
+ * include/bits/stl_construct.h: Likewise.
+ * include/bits/stl_deque.h: Likewise.
+ * include/bits/stl_function.h: Likewise.
+ * include/bits/stl_heap.h: Likewise.
+ * include/bits/stl_iterator.h: Likewise.
+ * include/bits/stl_iterator_base_funcs.h: Likewise.
+ * include/bits/stl_iterator_base_types.h: Likewise.
+ * include/bits/stl_list.h: Likewise.
+ * include/bits/stl_map.h: Likewise.
+ * include/bits/stl_multimap.h: Likewise.
+ * include/bits/stl_multiset.h: Likewise.
+ * include/bits/stl_numeric.h: Likewise.
+ * include/bits/stl_pair.h: Likewise.
+ * include/bits/stl_pthread_alloc.h: Likewise.
+ * include/bits/stl_queue.h: Likewise.
+ * include/bits/stl_raw_storage_iter.h: Likewise.
+ * include/bits/stl_relops.h: Likewise.
+ * include/bits/stl_set.h: Likewise.
+ * include/bits/stl_stack.h: Likewise.
+ * include/bits/stl_tempbuf.h: Likewise.
+ * include/bits/stl_threads.h: Likewise.
+ * include/bits/stl_tree.h: Likewise.
+ * include/bits/stl_uninitialized.h: Likewise.
+ * include/bits/stl_vector.h: Likewise.
+ * include/bits/type_traits.h: Likewise.
+ * include/ext/hash_map: Likewise.
+ * include/ext/hash_set: Likewise.
+ * include/ext/rope: Likewise.
+ * include/ext/ropeimpl.h: Likewise.
+ * include/ext/slist: Likewise.
+ * include/ext/stl_hash_fun.h: Likewise.
+ * include/ext/stl_hashtable.h: Likewise.
+ * include/ext/stl_rope.h: Likewise.
+ * src/bitset.cc: Likewise.
+ * src/strstream.cc: Likewise.
+
+2001-06-26 Felix Natter <f.natter@ndh.net>
+
+ * docs/html/17_intro/porting-howto.html: Fixed some errors.
+
+2001-06-25 Phil Edwards <pme@sources.redhat.com>
+ Kurt Garloff <garloff@suse.de>
+
+ PR libstdc++/3377
+ * src/cmath.cc: New [version of an old] file; instantiate
+ __cmath_power to start with.
+ * src/Makefile.am (sources): Add cmath.cc (and alphabetize).
+ * Makefile.in: Regenerate.
+ * libio/Makefile.in: Regenerate.
+ * libmath/Makefile.in: Regenerate.
+ * libsupc++/Makefile.in: Regenerate.
+ * src/Makefile.in: Regenerate.
+ * testsuite/Makefile.in: Regenerate.
+
+2001-06-24 Gabriel Dos Reis <gdr@codesourcery.com>
+ David Edelsohn <dje@watson.ibm.com>
+
+ * libmath/stubs.c: New file.
+ * libmath/Makefile.am (libmath_la_SOURCES): Add stubs.c.
+ * libmath/Makefile.in: Regenerate.
+
+2001-06-19 Benjamin Kosnik <bkoz@redhat.com>
+
+ * include/c_std/bits/std_cwchar.h: Include ctime.
+ * testsuite/17_intro/header_cwchar.cc : Check.
+
+ * include/c_std/bits/std_cwctype.h: Inject wctype.
+ * testsuite/17_intro/header_cwctype.cc: Update.
+
+2001-06-17 Release Manager
+
+ * GCC 3.0 Released.
+
+2001-06-14 Nathan Sidwell <nathan@codesourcery.com>
+
+ * configure.in (auxdir): Replace by ...
+ (toprel): ... new variable.
+ (toplevel_srcdir): Construct from $toprel.
+ * acinclude.m4 (GLIBCPP_ENABLE_THREADS): Use $toprel
+ rather than .. to locate gcc source directory.
+ (GLIBCPP_CONFIGURE): Replace $auxdir with $srcdir/$toprel.
+ * aclocal.m4, configure: Rebuilt.
+
+2001-06-13 John David Anglin <dave@hiauly1.hia.nrc.ca>
+
+ (Approved by Mark and Benjamin. Applied by Loren.)
+
+ * src/globals.cc: Define globals _GLIBCPP_mutex_init (),
+ _GLIBCPP_mutex_address_init (), _GLIBCPP_once, _GLIBCPP_mutex
+ and _GLIBCPP_mutex_address.
+ * include/bits/stl_threads.h (_STL_mutex_lock): Use above to provide
+ once-only runtime initialization of _M_lock mutex when
+ __GTHREAD_MUTEX_INIT_FUNCTION is defined.
+ (__STL_MUTEX_INITIALIZER): Provide initializer for _STL_mutex_lock
+ for __GTHREAD_MUTEX_INIT_FUNCTION case.
+
+2001-06-13 Benjamin Kosnik <bkoz@redhat.com>
+
+ * acinclude.m4 (GLIBCPP_CONFIGURE): Bump version to 3.0.0.
+ * aclocal.m4: Regenerate.
+ * configure: Regenerate.
+ * include/bits/c++config (__GLIBCPP__): Update date.
+
+2001-06-12 Benjamin Kosnik <bkoz@redhat.com>
+
+ * include/bits/fpos.h (fpos::operator-): Don't return reference,
+ return original, non-modified version.
+ (fpos::operator+): Same.
+ * testsuite/27_io/fpos.cc: Add test.
+
+2001-06-12 Loren J. Rittle <ljrittle@acm.org>
+
+ libstdc++/2071
+ * porting.texi: Add documentation about libstdc++-v3-specific
+ macros that are currently included in os_defines.h files.
+
+ * config/basic_file_stdio.h (sys_getc): New method.
+ (sys_ungetc): New method.
+ * include/bits/basic_file.h: (sys_getc): New method signature.
+ (sys_ungetc): New method signature.
+
+ * include/bits/fstream.tcc (underflow): Add conditional code
+ paths which avoid using short seeks on streams (especially
+ useful when the stream might be interactive or a pipe). At
+ the moment, this alternate path only avoids seeking when the
+ ``buffer size'' of underflow() is 1 since the C standard only
+ guarantees buffer space for one ungetc (this technique could
+ be extended since *-*-solaris* supports buffering for 4 calls
+ to ungetc and *-*-*bsd* supports buffering limited only by
+ memory resources). Also, _GLIBCPP_AVOID_FSEEK must be defined
+ in a port's os_defines.h file for this alternate path to even
+ be considered. As a bonus, the idiom of using getc/ungetc
+ requires no system calls whereas fseek maps to one or two
+ system call(s) on many platforms.
+
+ * config/os/bsd/freebsd/bits/os_defines.h (_GLIBCPP_AVOID_FSEEK):
+ Define it.
+ * config/os/solaris/solaris2.5/bits/os_defines.h
+ (_GLIBCPP_AVOID_FSEEK): Likewise.
+ * config/os/solaris/solaris2.6/bits/os_defines.h
+ (_GLIBCPP_AVOID_FSEEK): Likewise.
+ * config/os/solaris/solaris2.7/bits/os_defines.h
+ (_GLIBCPP_AVOID_FSEEK): Likewise.
+
+2001-06-12 Benjamin Kosnik <bkoz@redhat.com>
+
+ * acinclude.m4 (GLIBCPP_CHECK_COMPILER_VERSION): Change to
+ AC_TRY_COMPILE, so that the built compiler is checked, and
+ bootstraps or cross compiles with an older compile still work.
+ * aclocal.m4: Regenerate.
+ * configure: Regenerate.
+
+2001-06-12 Benjamin Kosnik <bkoz@redhat.com>
+
+ libstdc++/3142
+ * include/bits/std_sstream.h: Add allocator_type, as per DR 251.
+
+ libstdc++/3141
+ * include/bits/istream.tcc (getline, get): Fix as per DR 243.
+
+ libstdc++/3140
+ * include/bits/std_bitset.h (bitset::set): Fix as per DR 186.
+
+ libstdc++/3139
+ * include/bits/limits_generic.h: Fix as per DR 184.
+
+2001-06-11 Benjamin Kosnik <bkoz@redhat.com>
+
+ libstdc++/3126
+ * include/bits/basic_string.h (string::compare): Adjust signatures
+ as per DR 5.
+ * include/bits/basic_string.tcc: And here.
+
+ libstdc++/2346
+ * config/c_io_stdio.h: Remove whitespace.
+ * testsuite/27_io/istream_seeks.cc (test03): Add regression.
+ (test02): Add regression.
+ * testsuite/27_io/istream_seeks-3.tst: New file.
+
+2001-06-11 Phil Edwards <pme@sources.redhat.com>
+
+ * README: Update to reflect reality.
+ * acinclude.m4: Update descriptions, fix typos. Comment changes only.
+ * configure.in: Make certain target_alias is set and subst'd for 2.50.
+ * aclocal.m4: Regenerate.
+ * configure: Regenerate (with 2.13).
+
+2001-06-11 Benjamin Kosnik <bkoz@redhat.com>
+
+ libstdc++/3114
+ * include/bits/ostream.tcc (ostream::seekp): Add error checking as
+ per DR 129.
+ * include/bits/istream.tcc (istream::seekg): Same.
+ * testsuite/27_io/istream_seeks.cc: Fix.
+
+ libstdc++/3113
+ * include/bits/stl_function.h (binder2nd): Fix as per DR 109.
+ (binder1st): Same.
+ * include/bits/std_queue.h: Add c++config.h.
+ * testsuite/20_util/binders.cc: New test.
+
+2001-06-11 Matthias Klose <doko@debian.org>
+ Phil Edwards <pme@sources.redhat.com>
+
+ * docs/doxygen/run_doxygen (find_doxygen): Tweak version check.
+ (main script): Echo more information.
+
+2001-06-10 Benjamin Kosnik <bkoz@redhat.com>
+
+ * include/c_std/bits/std_cwchar.h: Alphabetize.
+ * include/bits/char_traits.h: Tweak.
+ * acinclude.m4 (GLIBCPP_CHECK_WCHAR_T_SUPPORT): Check for
+ everything used by std_cwchar.h.
+ * aclocal.m4: Regenerate.
+ * configure.in: Regenerate.
+ * config.h.in: Regenerate.
+
+2001-06-10 Benjamin Kosnik <bkoz@redhat.com>
+
+ * acinclude.m4 (GLIBCPP_ENABLE_C99): Add stdio.h checking.
+ Add checking for strtof, _Exit in stdlib.h
+ * aclocal.m4: Regenerate.
+ * configure.in: Regenerate.
+ * include/c_std/bits/std_cstdio.h: Alphabetize lists.
+ (snprintf): Put C99 functions into __gnu_cxx namespace.
+ (vfscanf): Same.
+ (vscanf): Same.
+ (vsnprintf): Same.
+ (vsscanf): Same.
+ * include/c_std/bits/std_cstdlib.h: Alphabetize lists. Put undefs
+ for C99 functions within _GLIBCPP_USE_C99 guard.
+ (_Exit): Same.
+ (strtof): Same.
+ (strtold): Same.
+ * include/bits/locale_facets.tcc: Check if C99 is enabled.
+ * include/c_std/bits/std_cwchar.h (__gnu_cxx): Put undefs within
+ C99 guard.
+ * include/c_std/bits/cmath.tcc: Formatting tweak.
+ * include/c_std/bits/std_cmath.h: Same.
+
+2001-06-10 Benjamin Kosnik <bkoz@redhat.com>
+
+ * include/c_std/bits/std_cstdio.h: Include cstddef for size_t.
+
+2001-06-09 Alexandre Oliva <aoliva@redhat.com>
+ Stephen L Moshier <moshier@mediaone.net>
+
+ * acinclude.m4 (AC_EXEEXT): Work around in case it expands to
+ nothing, as in autoconf 2.50.
+ * configure: Rebuilt.
+
+2001-06-09 Benjamin Kosnik <bkoz@redhat.com>
+
+ * include/c_std/bits/std_cwchar.h: Remove size_t injection,
+ include std_cstddef.
+ * include/c_std/bits/std_ctime.h: Same.
+ * include/c_std/bits/std_cstring.h: Same.
+ * include/c_std/bits/std_cstdlib.h: Same.
+
+ * include/c_std/bits/std_cstdio.h: Remove vsnprintf, snprintf.
+ * include/c_std/bits/std_cctype.h: Remove isblank.
+
+2001-06-09 Benjamin Kosnik <bkoz@redhat.com>
+
+ * acinclude.m4 (GLIBCPP_CHECK_WCHAR_T_SUPPORT): Check for fgetwc,
+ fgetws.
+ * aclocal.m4: Regenerate.
+ * configure: Regenerate.
+ * include/c_std/bits/std_cwchar.h: Remove duplicate fgetwc
+ injection, guard fgetwc, fgetws.
+ * include/c_std/bits/std_cstdio.h: Remove superfluous includes.
+ * include/c_std/bits/std_clocale.h: And here.
+ * include/c_std/bits/std_cctype.h: And here.
+ * include/c_std/bits/std_cstdlib.h (strtof): Guard strtof injection.
+
+ * config/basic_file_stdio.h: Don't include unistd.h.
+ * config/c_io_stdio.h: Don't use compatibility headers.
+ * libsupc++/eh_terminate.cc: Qualify abort.
+ (__terminate): And here.
+ * libsupc++/eh_catch.cc (__cxa_end_catch): Qualify abort.
+
+2001-06-08 Benjamin Kosnik <bkoz@redhat.com>
+
+ * include/c_std/bits/std_cstdlib.h: Remove _Exit, strtof injections.
+
+2001-06-08 Benjamin Kosnik <bkoz@redhat.com>
+
+ libstdc++/2767
+ libstdc++/2989
+ libstdc++/2992
+ * include/std/*: Add copyright notice.
+ * include/c_std/bits/*: Use using statements instead of extern "C".
+ * include/c_std/bits/std_cmath.h: Don't overload double versions
+ of math functions with __buitin versions, use global version to
+ prevent ambiguities. Remove define hacks.
+ * include/c_std/bits/std_cwchar.h: Using declarations for "C"
+ functions that have changed signatures and std::
+ declarations. Remove define hacks.
+ * include/c_std/bits/std_cwchar.h: Same, plus remove ambiguous
+ __builtins in std::. Remove define hacks.
+ * testsuite/17_intro/headers_c.cc: Add tests.
+ * testsuite/17_intro/headers_c++.cc: Add test.
+
+2001-06-07 Loren J. Rittle <ljrittle@acm.org>
+ John David Anglin <dave@hiauly1.hia.nrc.ca>
+
+ c++/3082
+ * libsupc++/eh_alloc.cc: Ensure that required macros are
+ defined before including gthr.h. Ensure that we get the
+ version of gthr.h for which we know how to provide a
+ configuration.
+ * libsupc++/eh_globals.cc: Likewise. And, bring the threading
+ code path into line with the current EH model. Use std, where
+ appropriate.
+
+2001-06-07 Loren J. Rittle <ljrittle@acm.org>
+ John David Anglin <dave@hiauly1.hia.nrc.ca>
+
+ * config/threads-no.h: Remove file.
+ * config/threads-posix.h: Remove file.
+
+ * acconfig.h (_GLIBCPP_USE_THREADS): Remove.
+ (_GLIBCPP_SUPPORTS_WEAK): Add (required by namespace-clean gthr*.h).
+ (_GLIBCPP_HAVE_GTHR_DEFAULT): Likewise.
+ * config.h.in: Regenerate.
+
+ * acinclude.m4 (GLIBCPP_ENABLE_THREADS): Completely rework to
+ setup and use gthr*.h files. In particular, make gthr.h files
+ namespace-clean in the staging area (they don't have to be for
+ libgcc.a).
+ * aclocal.m4: Regenerate.
+ * configure: Regenerate.
+
+ * src/Makefile.am (build_headers): Remove bits/c++threads.h
+ and add bits/gthr.h bits/gthr-single.h bits/gthr-default.h.
+ * src/Makefile.in: Regenerate.
+
+ * include/bits/c++config: Cleanup threading configuration macros.
+ In particular, define __STL_GTHREADS macro which controls...
+ * include/bits/stl_threads.h: ...a brand new gthr.h-based
+ configuration here.
+
+ * config/c_io_stdio.h: Include staged gthr.h instead of local
+ thread configuration file. Always use __gthread_mutex_t
+ instead of __mutext_type (or int).
+ * include/bits/std_fstream.h: Likewise.
+
+ * docs/html/17_intro/howto.html: Remove placeholder comment in
+ case this configuration patch didn't make it. Add advice that
+ section only applies if configured with --enable-threads.
+ * docs/html/23_containers/howto.html: Reword to make clear
+ that _PTHREADS is no longer required for any port to be
+ correctly using STL with threads. Add advice that section
+ only applies if configured with --enable-threads.
+
+2001-06-06 Benjamin Kosnik <bkoz@redhat.com>
+
+ * src/string-inst.cc (_Rep::_S_max_size): Add instantiation.
+
+2001-06-05 Benjamin Kosnik <bkoz@redhat.com>
+
+ libstdc++/3045
+ * include/bits/basic_ios.tcc: Formatting tweaks.
+ * include/bits/ios_base.h: Formatting tweaks.
+ * src/ios.cc (ios_base::Init::_S_ios_create): Use filebufs here.
+ (ios_base::Init::_S_ios_destroy): ..and here. Explicitly call dtors.
+ * src/globals.cc: Allocate filebufs for standard streams here.
+ (buf_cout, buf_cin, buf_cerr): Like so.
+ (buf_wcout, buf_wcin, buf_wcerr): And so.
+ * testsuite/27_io/ios_init.cc: Add.
+
+2001-06-04 Brendan Kehoe <brendan@zen.org>
+ Benjamin Kosnik <bkoz@redhat.com>
+
+ libstdc++/3017
+ * include/bits/locale_facets.h (ctype<_CharT>): Add definitions
+ for generic ctype virtuals.
+ * src/locale.cc: Minor tweaks, naming consistency.
+ * testsuite/22_locale/ctype.cc: Add test.
+
+2001-06-04 Kenny Simpson <theonetruekenny@yahoo.com>
+ Phil Edwards <pme@sources.redhat.com>
+
+ PR libstdc++/3035 and PR libstdc++/3036
+ * include/bits/stl_pair.h: Fix pair ctor and make_pair according
+ to LWG DR 181 and 265.
+
+2001-06-04 Phil Edwards <pme@sources.redhat.com>
+
+ PR libstdc++/3034
+ * include/bits/stl_multiset.h (find, lower_bound, upper_bound,
+ equal_range): Add const overloads as per LWG DR 214.
+ * include/bits/stl_set.h: Likewise.
+
+2001-06-04 Brendan Kehoe <brendan@zen.org>
+ Phil Edwards <pme@sources.redhat.com>
+
+ PR libstdc++/3018
+ * include/bits/std_bitset.h (bitset::test): Fix __pos >= _Nb
+ comparison; all positions must be < _Nb.
+ * testsuite/23_containers/bitset_members.cc: New file.
+
+2001-06-04 Brendan Kehoe <brendan@zen.org>
+
+ PR libstdc++/3016
+ * include/bits/stl_queue.h (classes queue, priority_queue): Fix
+ ctors to match the standard.
+
+2001-06-04 Hans-Peter Nilsson <hp@axis.com>
+
+ * configure.in (use of GLIBCPP_CHECK_GNU_MAKE): Re-apply change
+ from 2001-05-30, accidentally reverted later that day.
+ * configure: Regenerate.
+
+ * libsupc++/Makefile.am (install-glibcppinstallHEADERS,
+ uninstall-glibcppinstallHEADERS): Have explicit rules catering to
+ SUN make VPATH peculiarities.
+ * libsupc++/Makefile.in: Regenerate.
+
+2001-05-31 scott snyder <snyder@fnal.gov>
+
+ libstdc++/2976
+ * include/bits/istream.tcc: Include std_ostream.h.
+
+2001-05-31 Benjamin Kosnik <bkoz@redhat.com>
+
+ libstdc++/2997
+ * src/bitset.cc: Qualify size_t with std::.
+
+2001-05-30 Benjamin Kosnik <bkoz@redhat.com>
+
+ * acconfig.h (_GLIBCPP_BUGGY_FLOAT_COMPLEX): Remove.
+ (_GLIBCPP_BUGGY_COMPLEX): Remove.
+ * config.h.in: Regenerate.
+ * acinclude.m4 (GLIBCPP_CHECK_COMPLEX_MATH_COMPILER_SUPPORT): Remove.
+ * aclocal.m4: Regenerate.
+ * configure.in: Don't call it.
+ * configure: Regenerate.
+
+ libstdc++/2970
+ * src/complex_io.cc (operator<<(ostream&, const complex&): Fix.
+ * testsuite/26_numerics/complex_inserters_extractors.cc (test01):
+ New test.
+
+ libstdc++/2985
+ * include/bits/std_complex.h: Include sstream. Put definitions for
+ complex inserters and extractors here, and remove them from...
+ * src/complex_io.cc: ...here.
+ * include/bits/basic_ios.h (basic_ios::__numput_type): Add _Traits
+ parameter.
+ (basic_ios::__numget_type): Same.
+ * include/bits/std_istream.h: Same.
+ * include/bits/std_ostream.h: Same.
+ * include/bits/sbuf_iter.h (ostreambuf_iterator): Fix typo in base
+ class iterator template arguments.
+ * src/locale-inst.cc: Add explicit has_facet instantiations.
+ * include/bits/basic_ios.h (_M_get_fnumput): Remove.
+ (_M_get_fnumget): Remove.
+ (basic_ios::_M_check_facet): New function.
+ (basic_ios::_M_cache_facets): New function.
+ * include/bits/basic_ios.tcc: Definition for _M_cache_facets.
+ (basic_ios::imbue): Call _M_cache_facets.
+ (basic_ios::init): Same.
+ * include/bits/istream.tcc: Format, use _M_check_facet.
+ * include/bits/ostream.tcc: Same.
+ * include/bits/locale_facets.tcc (__output_float): Change
+ signature, add _Traits.
+ * testsuite/26_numerics/complex_inserters_extractors.cc (test02):
+ New test.
+
+2001-05-30 Loren J. Rittle <ljrittle@acm.org>
+
+ * include/bits/c++config (__USE_MALLOC): Do not define it.
+ Document why not and give pointers to more information.
+
+ * docs/html/23_containers/howto.html: Update documentation
+ to reflect recent understanding of problem.
+ * docs/html/17_intro/howto.html: Likewise.
+
+2001-05-30 Phil Edwards <pme@sources.redhat.com>
+
+ * docs/doxygen/user.cfg.in: Minor addition.
+ * docs/html/documentation.html: Reorganize. Put most-looked-at
+ stuff first.
+ * docs/html/install.html: Update for 3.0. HTML fixups.
+ * docs/html/17_intro/howto.html: Likewise.
+ * docs/html/18_support/howto.html: Likewise.
+ * docs/html/19_diagnostics/howto.html: Likewise.
+ * docs/html/20_util/howto.html: Likewise.
+ * docs/html/23_containers/howto.html: Likewise.
+ * docs/html/24_iterators/howto.html: Likewise. More notes.
+ * docs/html/25_algorithms/howto.html: Likewise.
+ * docs/html/26_numerics/howto.html: Likewise. More notes.
+ * docs/html/27_io/howto.html: Likewise.
+ * docs/html/ext/howto.html: Likewise.
+ * docs/html/faq/index.html: Likewise.
+ * docs/html/faq/index.txt: Regenerate.
+ * docs/html/27_io/iostreams_hierarchy.pdf: Remove in favor of
+ Doxygen-created documentation.
+
+2001-05-30 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * testsuite/lib/libstdc++-v3-dg.exp (libstdc++-v3-init): Use
+ get_multilibs to find gcc.
+
+2001-05-30 Phil Edwards <pme@sources.redhat.com>
+
+ * acinclude.m4 (GLIBCPP_ENABLE_C99): Reorder output messages.
+ * aclocal.m4: Regenerate.
+ * configure: Regenerate.
+
+2001-05-29 Gabriel Dos Reis <gdr@merlin.codesourcery.com>
+
+ * include/c_std/bits/std_cstdlib.h:: Move C99 thingies to __gnu_cxx::.
+ * include/c_std/bits/std_cwchar.h (__gnu_cxx): Likewise.
+
+2001-05-27 Gabriel Dos Reis <gdr@merlin.codesourcery.com>
+
+ * include/c_std/bits/std_cmath.h: Move C99 functions in __gnu_cxx::.
+ * include/c_std/bits/std_cstdlib.h: Same.
+ * include/c_std/bits/std_cwchar.h: Same.
+
+2001-05-30 Hans-Peter Nilsson <hp@axis.com>
+
+ * src/Makefile.am (VPATH): Delimit with ":", not space.
+ * src/Makefile.in: Regenerate.
+
+ * configure.in (use of GLIBCPP_CHECK_GNU_MAKE): Don't fail if GNU
+ make isn't found.
+ * configure: Regenerate.
+
+2001-05-28 Gabriel Dos Reis <gdr@merlin.codesourcery.com>
+
+ * include/c_std/bits/std_cmath.h (sqrt): Change __builtin_fsqrt to
+ __builtin_sqrt.
+
+2001-05-26 Gabriel Dos Reis <gdr@codesourcery.com>
+
+ * include/c_std/bits/std_cmath.h (sqrt): #undef.
+
+2001-05-23 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * mknumeric_limits: Stop if gen-num-limits dies.
+
+2001-05-25 Benjamin Kosnik <bkoz@redhat.com>
+
+ other/2931
+ * acinclude.m4 (GLIBCPP_ENABLE_C99): Use AC_TRY_COMPILE.
+ * aclocal.m4: Regenerate.
+ * configure: Same.
+
+2001-05-25 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+ Phil Edwards <pme@sources.redhat.com>
+ Alexandre Oliva <aoliva@redhat.com>
+
+ * acinclude.m4 (GLIBCPP_EXPORT_INSTALL_INFO): Set glibcpp_srcdir
+ in an amd-safe manner. Revert glibcpp_prefixdir.
+
+2001-05-25 Gabriel Dos Reis <gdr@codesourcery.com>
+
+ * include/c_std/bits/std_cmath.h: Tweak. #define away abs, cos,
+ fabs, sin, sqrt. They are now implemented in terms of __builtin_
+ variants.
+
+2001-05-24 Benjamin Kosnik <bkoz@redhat.com>
+
+ libstdc++/2830
+ * testsuite/21_strings/inserters_extractors.cc (test09): New test.
+ * include/bits/ostream.tcc: Format to match istream.tcc.
+ (operator<<(basic_ostream __out, const basic_string __s)): Fix.
+
+2001-05-24 Phil Edwards <pme@sources.redhat.com>
+
+ * libsupc++/eh_alloc.cc (__cxa_allocate_exception): Qualify
+ malloc with std:: .
+ (__cxa_free_exception): Likewise with free.
+
+2001-05-24 Mark Mitchell <mark@codesourcery.com>
+
+ * include/c_std/bits/std_cstring.h: #define away all global
+ functions we will redeclare in namespace `std'.
+ * libsupc++/eh_alloc.cc (__cxa_allocate_exception): Use
+ std::memset, instead of memset.
+ * testsuite/19_diagnostics/stdexceptions.cc: Use `std::strcmp',
+ not plain `strcmp'.
+ * testsuite/21_strings/c_strings.cc: Use `std::strcpy' instead of
+ plain `strcpy'.
+
+2001-05-24 Benjamin Kosnik <bkoz@redhat.com>
+
+ libstdc++/2832
+ * include/bits/basic_ios.tcc: Small tweak.
+ * include/bits/std_fstream.h (ifstream): Add buffer member. Adjust
+ ctors and dtors, and rdbuf settings.
+ (ofstream): Same.
+ (fstream): Same.
+ * include/bits/std_sstream.h: Same, but for stringstream classes.
+ * testsuite/27_io/ostringstream_members.cc: New.
+ * testsuite/27_io/stringstream_members.cc: New.
+ * testsuite/27_io/fstream_members.cc: New.
+ * testsuite/27_io/ifstream_members.cc: Add test.
+ * testsuite/27_io/istringstream_members.cc: Add test.
+ * testsuite/27_io/ofstream_members.cc: Add test.
+
+2001-05-24 Gabriel Dos Reis <gdr@merlin.codesourcery.com>
+
+ * include/bits/c++config(__NO_MATH_INLINES): Move to...
+ * config/os/gnu-linux/bits/os_defines.h: ...here.
+
+2001-05-24 Gabriel Dos Reis <gdr@codesourcery.com>
+
+ * include/bits/c++config (__NO_MATH_INLINES): New macro.
+ * testsuite/26_numerics/fabs_inline.cc (main): New test.
+
+2001-05-22 Benjamin Kosnik <bkoz@redhat.com>
+
+ libstdc++/2841
+ * testsuite/lib/libstdc++-v3-dg.exp (libstdc++-v3-init): Set
+ ld_library_path.
+ (libstdc++-v3_set_ld_library_path): New, copied from g++.exp.
+ (libstdc++-v3-finish): Remove.
+ (libstdc++-v3_exit): Remove.
+
+2001-05-22 Phil Edwards <pme@sources.redhat.com>
+
+ * docs/html/documentation.html: Point to doxygen output.
+
+2001-05-21 Benjamin Kosnik <bkoz@redhat.com>
+
+ * mkcheck.in (static_fail): Remove S_FLAG decoration on output.
+
+ * include/bits/std_sstream.h (stringbuf::setbuf): Require both
+ arguments to be non-null.
+ * include/bits/fstream.tcc (filebuf::_M_allocate_buffers): Only
+ try allocations if allocated size is greater than zero.
+ (filebuf::_M_filebuf_init): Change to
+ (filebuf::_M_allocate_file): Which is what it does now.
+ (filebuf::_M_allocate_bufers): Change to
+ (filebuf::_M_allocate_internal_buffer): This, and create
+ (filebuf::_M_allocate_pback_buffer): New.
+ (filebuf::_M_destroy_internal_buffer): New.
+ (filebuf::_M_buf_allocated): New data member.
+ (filebuf::setbuf): Use new logic, allow use of external buffer.
+ * testsuite/27_io/stringbuf_virtuals.cc: New file.
+ * testsuite/27_io/filebuf_virtuals.cc: New file.
+
+2001-05-21 Stephen M. Webb <stephen@bregmasoft.com>
+
+ * include/c_std/bits/std_cstring.h (memchr): Define "C" functions to
+ __glibcpp_memchr.
+ (strchr): Same, but to __glibcpp_strchr.
+ (strpbrk): Same.
+ (strrchr): Same.
+ (strstr): Same.
+ * include/c_std/bits/std_cwchar.h (wcschr): Same.
+ (wcsbrk): Same.
+ (wcsrchr): Same.
+ (wcsstr): Same.
+ (wmemchr): Same.
+
+2001-05-21 Benjamin Kosnik <bkoz@redhat.com>
+
+ * testsuite/21_strings/c_strings.cc (main): Fix.
+
+2001-05-19 Phil Edwards <pme@sources.redhat.com>
+
+ * acinclude.m4: Fix --help spacing, correct comments.
+ * aclocal.m4: Regenerate.
+ * configure: Regenerate.
+ * mkcheck.in: Add usage comments.
+ * docs/html/documentation.html: Point to doxygen'd tarball.
+
+2001-05-18 Benjamin Kosnik <bkoz@redhat.com>
+
+ * testsuite/README: Add notes.
+
+ * src/Makefile.am (libstdc++.INC): Remove.
+ * src/Makefile.in: Regenerate.
+
+ Phil Edwards <pedwards@disaster.jaj.com>
+ * mkcheck.in: Add missing '#'.
+
+2001-05-18 Angela Marie Thomas <angela@cygnus.com>
+
+ * testsuite/lib/libstdc++-v3-dg.exp (libstdc++-v3-init): Set flags
+ appropriately for remote testing and testing installed files without
+ a build dir.
+
+2001-05-18 Benjamin Kosnik <bkoz@redhat.com>
+
+ * acinclude.m4 (GLIBCPP_EXPORT_INSTALL_INFO): Set glibcpp_srcdir
+ amd glibcpp_prefixdir with absolute paths.
+
+ * include/bits/c++config (__GLIBCPP__): Bump.
+ * acinclude.m4 (GLIBCPP_CONFIGURE): Correct version number.
+
+2001-05-18 Gabriel Dos Reis <gdr@codesourcery.com>
+
+ * include/bits/std_valarray.h (valarray<>::operator[] const):
+ Return a const reference.
+ * testsuite/26_numerics/valarray_const_bracket.cc: New test.
+
+2001-05-18 Alexandre Oliva <aoliva@redhat.com>
+
+ * configure.target (ATOMICITYH): Actually use AIX-specific code on
+ earlier versions of AIX 4.*.
+
+2001-05-18 Angela Marie Thomas <angela@cygnus.com>
+
+ * testsuite/lib/libstdc++-v3-dg.exp (libstdc++-v3-dg-test): Set
+ output_file based on the name of the testcase.
+
+2001-05-18 Angela Marie Thomas <angela@cygnus.com>
+
+ * testsuite/lib/libstdc++-v3-dg.exp (libstdc++-v3-init): Build
+ gluefile and use it if needs_status_wrapper is set.
+
+2001-05-18 Alexandre Oliva <aoliva@redhat.com>
+
+ * configure.target (ATOMICITYH): Use cpu/generic code on earlier
+ versions of AIX.
+
+2001-05-17 Alexandre Oliva <aoliva@redhat.com>
+
+ * configure.target (ATOMICITYH): Don't use AIX 4.3-specific code
+ on earlier versions of AIX.
+
+2001-05-15 Benjamin Kosnik <bkoz@redhat.com>
+
+ * testsuite_flags.in (query): Add backwards, ext directories.
+
+2001-05-15 Mark Mitchell <mark@codesourcery.com>
+
+ * porting.texi: Correct documentation about handling
+ _LARRGEFILE_SOURCE and its ilk.
+ * config/os/solaris/solaris2.5/bits/os_defines.h: Remove
+ definitions of _XOPEN_SOURCE, _LARGEFILE64_SOURCE, and
+ __EXTENSIONS__.
+ * config/os/solaris/solaris2.6/bits/os_defines.h: Likewise.
+ * config/os/solaris/solaris2.7/bits/os_defines.h: Likewise.
+
+001-05-15 Zack Weinberg <zackw@stanford.edu>
+
+ * testsuite/21_strings/inserters_extractors.cc,
+ testsuite/27_io/istream_unformatted.cc,
+ testsuite/27_io/stringstream.cc:
+ Replace multi-line string constants with C89-style
+ concatenated string constants.
+
+2001-05-14 Richard Henderson <rth@redhat.com>
+
+ * mknumeric_limits: Build with -fno-exceptions.
+
+2001-05-13 Benjamin Kosnik <bkoz@redhat.com>
+
+ Switch over to new harness.
+ * testsuite_flags.in: Tweaks via Gaby.
+ * testsuite/Makefile.am: Change tool to libstdc++-v3.
+ (EXPECT): Quote directly.
+ (RUNTEST): Same.
+ * configure.in: Output testsuite_flags.
+ * acinclude.m4: Substitute src, bld, and prefix dirs.
+ Remove glibcpp_expect, glibcpp_runtestflags.
+ * Makefile.am (RUNTESTFLAGS): Pass this down to subdirs.
+ * mkcheck.in: Port to new interface.
+
+ * aclocal.m4: Regerate.
+ * configure: Regnerate.
+ * Makefile.in: Regnerate.
+ * */Makefile.in: Regenerate.
+
+ * tests_flags.in: Remove.
+ * testsuite/lib/libstdc++.exp: Remove.
+ * testsuite/libstdc++.tests/tests.exp: Remove.
+
+2001-05-13 Alexandre Oliva <aoliva@redhat.com>
+
+ * configure.target: Remove detection of AIX pthread multilib, now
+ obtained from `gcc -v'.
+
+2001-05-13 John David Anglin <dave@hiauly1.hia.nrc.ca>
+
+ * mkcheck.in (setup_size_command): Use Berkeley "-B" mode with GNU
+ size. Add hpux case for HP size.
+
+2001-05-11 Benjamin Kosnik <bkoz@redhat.com>
+
+ * testsuite_flags.in: New, simplified interface.
+ * testsuite/lib/libstdc++-v3-dg.exp: New test harness.
+ * testsuite/libstdc++-v3.dg: Add.
+ * testsuite/libstdc++-v3.dg/dg.exp: Add.
+
+2001-05-11 Benjamin Kosnik <bkoz@redhat.com>
+
+ * testsuite/*/*.cc: Remove spaces, make sure testcases return zero.
+ * testsuite/config/default.exp: Update bugs email address.
+
+2001-05-11 Richard Henderson <rth@redhat.com>
+
+ * libsupc++/eh_personality.cc: Include unwind-pe.h. Remove
+ all pointer encoding logic.
+ (struct lsda_header_info): Add ttype_base.
+ (get_ttype_entry): Use it instead of a context.
+ (check_exception_spec): Likewise.
+ (PERSONALITY_FUNCTION): Initialize ttype_base. Store it in
+ the c++ exception header for __cxa_call_unexpected.
+ (__cxa_call_unexpected): Use it.
+
+2001-05-09 Benjamin Kosnik <bkoz@redhat.com>
+
+ * testsuite/lib/libstdc++.exp: Use libgloss.exp. Call
+ libgloss_link_flags to find crt0.o for targets that use libgloss
+ instead of newlib.
+ Change LDFLAGS to LIBS.
+ Consistently name procedures libstdc++-XXX.
+ * testsuite/libstdc++.tests/tests.exp: Use new procedure names.
+
+2001-05-08 Benjamin Kosnik <bkoz@fillmore.constant.com>
+
+ * include/c_std/bits/std_cstring.h (memchr): Correct definitions.
+ (strchr): Same.
+ (strpbrk): Same.
+ (strrchr): Same.
+ (strstr): Same.
+ * include/c_std/bits/std_cwchar.h (wcschr): Same.
+ (wcsbrk): Same.
+ (wcsrchr): Same.
+ (wcsstr): Same.
+ (wmemchr): Same.
+ * testsuite/21_strings/c_strings.cc: Add tests.
+
+2001-05-07 Benjamin Kosnik <bkoz@redhat.com>
+
+ libstdc++/2523
+ * include/bits/std_fstream.h (basic_filebuf): Change signature.
+ * include/bits/fstream.tcc (basic_filebuf): Change bool argument
+ to int_type, pass in buffer size info.
+ * include/bits/std_streambuf.h (_M_is_indeterminate): Check for
+ unbuffered situation.
+ (underflow): Remove codecvt bits for the time being.
+ * include/bits/istream.tcc (istream::sentry): Avoid sputbackc call.
+ * include/bits/locale_facets.tcc (_M_extract): Cache dereference
+ values from iterators, clean.
+ * src/locale.cc: Ditto.
+ * include/bits/sbuf_iter.h: Format.
+ * src/ios.cc: Explicitly pass in buffer sizes at creation time.
+ * testsuite/27_io/narrow_stream_objects.cc: Add tests.
+ * testsuite/27_io/filebuf.cc: Tweaks.
+ * testsuite/27_io/filebuf_members.cc: Tweaks.
+
+2001-05-07 Mark Mitchell <mark@codesourcery.com>
+
+ * config/os/solaris/solaris2.7/bits/os_defines.h
+ (_LARGEFILE_SOURCE): Define it.
+
+2001-05-03 Alexandre Oliva <aoliva@redhat.com>
+
+ * configure.in (LIBSUPCXX_PICFLAGS): Set it to -prefer-pic or
+ -prefer-non-pic depending on whether libtool has shared libraries
+ enabled or disabled.
+ * libsupc++/Makefile.am (LIBSUPCXX_CXXFLAGS): Set to
+ $(LIBSUPCXX_PICFLAGS).
+ * configure, */Makefile.in: Rebuilt.
+
+2001-05-01 Benjamin Kosnik <bkoz@redhat.com>
+
+ * include/bits/sbuf_iter.h (istreambuf_iterator): Correct.
+ * testsuite/24_iterators/istreambuf_iterator.cc (test02): Add test.
+
+ * include/bits/std_sstream.h (stringbuf): Leak
+ copied string.
+ * testsuite/24_iterators/ostreambuf_iterator.cc: Correct.
+
+2001-05-01 Tom Browder <tbrowder@home.com>
+
+ * docs/html/ext/howto.html: Fix typo.
+
+2001-05-01 Gabriel Dos Reis <gdr@codesourcery.com>
+
+ * testsuite/libstdc++.tests/tests.exp: Add comment.
+
+2001-05-01 Gabriel Dos Reis <gdr@codesourcery.com>
+
+ * testsuite/libstdc++.tests/tests.exp: Set ulimits.
+
+2001-04-30 Mark Mitchell <mark@codesourcery.com>
+
+ * porting.texi: Use the GFDL.
+
+2001-04-30 Benjamin Kosnik <bkoz@redhat.com>
+
+ libstdc++/2627
+ * testsuite/24_iterators/ostreambuf_iterator.cc: New file.
+ * include/bits/sbuf_iter.h (ostreambuf_iterator): Remove bogus
+ specializations.
+
+2001-04-30 Benjamin Kosnik <bkoz@redhat.com>
+
+ libstdc++/2964
+ * include/bits/stl_iterator_base_funcs.h (__advance): Fix.
+
+2001-04-28 Phil Edwards <pme@sources.redhat.com>
+
+ * docs/doxygen/run_doxygen: Minor tweaks.
+ * docs/doxygen/style.css: New file.
+ * docs/doxygen/user.cfg.in: Update using "doxygen -u" to get the
+ latest parameters available. Use style.css.
+
+2001-04-27 Benjamin Kosnik <bkoz@redhat.com>
+
+ * docs/doxygen/mainpage.doxy: New.
+ * docs/doxygen/user.cfg.in: Change default configuration. Single
+ frame, other tweaks.
+
+2001-04-26 Mark Mitchell <mark@codesourcery.com>
+
+ * docs/html/17_intro/BADNAMES: Remove EGCS reference.
+ Indicate obsolete nature of thelist for G++ 3.0.
+
+2001-04-26 Alexandre Oliva <aoliva@redhat.com>
+
+ * acinclude.m4 (GLIBCPP_ENABLE_THREADS): Obtain
+ target_thread_file with `gcc -v'.
+ * aclocal.m4, configure: Rebuilt.
+
+2001-04-25 Benjamin Kosnik <bkoz@redhat.com>
+
+ * include/c_std/bits/std_cmath.h (std): Explicitly inject c99 names.
+ * include/c_std/bits/std_cstdlib.h (std): Same, except for llabs.
+ * include/c_std/bits/std_cwchar.h (std): Same.
+ * acconfig.h (std): Remove c99 injection into std.
+ * config.h.in: Regenerate.
+
+ * testsuite/README: Fix typo.
+
+ * include/bits/codecvt.h: Remove warnings.
+
+2001-04-24 Peter Schmid <schmid@snake.iap.physik.tu-darmstadt.de>
+
+ * include/ext/slist: Include required header files.
+
+2001-04-23 Loren J. Rittle <ljrittle@acm.org>
+
+ * include/c_std/bits/std_cerrno.h (errno): Define macro from
+ identifier declared with external linkage, if needed.
+ * include/c_std/bits/std_csetjmp.h (setjmp): Likewise.
+ * include/c_std/bits/std_cstdarg.h (va_end): Likewise.
+
+2001-04-23 Benjamin Kosnik <bkoz@fillmore.constant.com>
+
+ * acinclude.m4 (CXX): Set to glibcpp_CXX so that in-directory
+ re-configures find the build compiler.
+ (GLIBCPP_ENABLE_C99): Do all fp-tests with 0.0, not 0. Fixes
+ libstdc++/2609.
+ * aclocal.m4: Regenerate.
+ * configure: Regenerate.
+
+2001-04-20 Benjamin Kosnik <bkoz@redhat.com>
+
+ * acinclude.m4 (GLIBCPP_ENABLE_LONG_LONG): Make sure required C99
+ support is enabled correctly before long long is activated.
+ * aclocal.m4: Regenerate.
+ * configure: Regenerate.
+
+ * include/backward/backward_warning.h: Format correctly.
+
+ * testsuite/26_numerics/c99_classification_macros_c.cc: Add.
+ * testsuite/26_numerics/c99_classification_macros_c++.cc: Add.
+ * testsuite/26_numerics/c99_macros.cc: Remove.
+
+2001-04-20 Phil Edwards <pme@sources.redhat.com>
+
+ * include/bits/stl_bvector.h: Replace __ITERATOR_CATEGORY with
+ __iterator_category.
+
+2001-04-19 Benjamin Kosnik <bkoz@redhat.com>
+
+ * acconfig.h (_GLIBCPP_USE_C99): Add.
+ * config.h.in: Regenerate.
+ * acinclude.m4 (GLIBCPP_ENABLE_C99): New macro. Test for ISO/IEC
+ 9899: 1999 support.
+ * aclocal.m4: Regenerate.
+ * configure.in (GLIBCPP_ENABLE_C99): Use it, on by default.
+ * configure: Regenerate.
+ * configure.in (GLIBCPP_ENABLE_LONG_LONG): Set default to yes.
+ * configure: Regenerate.
+ * include/c_std/bits/std_cwchar.h: Put wcstold, wcstoll, wcstoull
+ into c99.
+ * include/c_std/bits/std_cmath.h: Bring C99 functions into c99
+ namespace.
+ * include/c_std/bits/std_cstdlib.h: Same.
+ * docs/html/configopts.html: Update.
+ * testsuite/26_numerics/c99_macros.cc: Edit, use cmath instead of
+ math.h
+ (test_c99_classify): Add.
+ * config/os/gnu-linux/bits/os_defines.h (_GNU_SOURCE): Remove.
+ (_ISOC99_SOURCE): Remove.
+
+ * include/bits/stl_algo.h: Use _GLIBCPP_HAVE_DRAND48.
+ * include/bits/c++config (__STL_ASSERTIONS): Simplify.
+ * acinclude.m4 (GLIBCPP_CHECK_STDLIB_SUPPORT): Add check for drand48.
+ * aclocal.m4: Regenerate.
+ * configure: Regenerate.
+
+2001-04-19 Phil Edwards <pme@sources.redhat.com>
+
+ * Makefile.am (doxygen): Assume script is missing execute perms.
+ * Makefile.in: Regenerated.
+ * docs/doxygen/user.cfg.in: Add class diagrams and source browsing.
+
+2001-04-17 Loren J. Rittle <ljrittle@acm.org>
+
+ * testsuite/27_io/istream_seeks.cc: Inform DejaGnu of required files.
+
+2001-04-17 Benjamin Kosnik <bkoz@redhat.com>
+
+ * testsuite/23_containers/map_operators.cc: Add dg-excess-errors.
+ * testsuite/23_containers/set_operators.cc: Same.
+
+ * include/bits/c++config: Add _GLIBCPP_CONCEPT_CHECKS. Disable by
+ default.
+ (__GLIBCPP__): Bump from value of last release.
+ * include/bits/concept_check.h: Default to off, edit comments.
+ * src/stl-inst.cc: Use _GLIBCPP_CONCEPT_CHECKS.
+ * src/Makefile.am (AM_CXXFLAGS): Remove _GLIBCPP_NO_CONCEPT_CHECKS.
+ * src/Makefile.in: Regenerate.
+
+2001-04-14 Martin Reinecke <martin@MPA-Garching.MPG.DE>
+
+ * include/bits/boost_concept_check.h(_Mutable_ContainerConcept):
+ Properly uglify member.
+
+2001-04-13 Phil Edwards <pme@sources.redhat.com>
+
+ * include/bits/stl_algobase.h (equal): Use EqualOpConcept instead
+ of EqualityCo
+ mparableConcept.
+
+2001-04-13 Phil Edwards <pme@sources.redhat.com>
+
+ * include/bits/boost_concept_check.h: Uglify, fork from Boost.
+ * include/bits/concept_check.h: Uglify.
+ * include/bits/stl_algo.h: Likewise.
+ * include/bits/stl_algobase.h: Likewise.
+ * include/bits/stl_deque.h: Likewise.
+ * include/bits/stl_heap.h: Likewise.
+ * include/bits/stl_iterator_base_funcs.h: Likewise.
+ * include/bits/stl_list.h: Likewise.
+ * include/bits/stl_map.h: Likewise.
+ * include/bits/stl_multimap.h: Likewise.
+ * include/bits/stl_multiset.h: Likewise.
+ * include/bits/stl_numeric.h: Likewise.
+ * include/bits/stl_queue.h: Likewise.
+ * include/bits/stl_set.h: Likewise.
+ * include/bits/stl_stack.h: Likewise.
+ * include/bits/stl_vector.h: Likewise.
+ * include/ext/hash_map: Likewise.
+ * include/ext/hash_set: Likewise.
+ * include/ext/slist: Likewise.
+
+2001-04-13 Gabriel Dos Reis <gdr@codesourcery.com>
+
+ * testsuite/23_containers/set_operators.cc: Just try to compile.
+ Mark as XFAIL.
+ * testsuite/23_containers/map_operators.cc: Same.
+
+2001-04-12 Jason Merrill <jason_merrill@redhat.com>
+
+ * testsuite/lib/libstdc++.exp (libstdc++-dg-test): Prepend "./" to
+ output_file.
+ (dg-test): Revert rth's change.
+
+2001-04-12 Nathan Sidwell <nathan@codesourcery.com>
+
+ * libsupc++/eh_alloc.cc (__cxa_allocate_exception): Don't
+ terminate holding the mutex. Make sure size fits in EMERGENCY_OBJ_SIZE.
+
+2001-04-12 Gabriel Dos Reis <gdr@codesourcery.com>
+
+ * testsuite/README: Add DejaGnu specific documentation.
+
+2001-04-11 Benjamin Kosnik <bkoz@redhat.com>
+
+ * acinclude.m4: AC_CHECK_TOOL for expect.
+ * aclocal.m4: Regenerate.
+ * configure: Regenerate.
+ * testsuite/Makefile.am (RUNTEST): Use substituted.
+ (EXPECT): Same.
+
+ * configure.in: Remove xcompiling substitution.
+ * tests_flags.in (CROSS_LIB_PATH): Remove.
+ (xcompiling): Remove.
+ (CXX): Use substituted CXX.
+
+2001-04-11 Richard Henderson <rth@redhat.com>
+
+ * testsuite/lib/libstdc++.exp: Specify path for output_file.
+
+2001-04-08 Gabriel Dos Reis <gdr@codesourcery.com>
+
+ * include/bits/std_valarray.h(valarray<>::operator[]): Make
+ inline.
+
+2001-04-06 Gabriel Dos Reis <gdr@codesourcery.com>
+
+ * testsuite/25_algorithms/equal.cc: New test.
+
+2001-04-06 Joe Buck <jbuck@welsh-buck.org>
+
+ * stl_algobase.h (std::equal): avoid use of possibly-undefined
+ operator != (one line patch).
+
+2001-04-06 Benjamin Kosnik <bkoz@redhat.com>
+
+ * include/backward/backward_warning.h: Re-enable.
+
+2001-04-06 Benjamin Kosnik <bkoz@redhat.com>
+ Alexandre Oliva <aoliva@redhat.com>
+
+ * tests_flags.in (CROSS_LIB_PATH): Add as -B flag.
+
+2001-04-06 Gabriel Dos Reis <gdr@codesourcery.com>
+
+ * include/c_std/bits/std_cmath.h: Get rid of C99 math macros.
+ * testsuite/26_numerics/c99_macros.cc: Add test.
+
+2001-04-06 Phil Edwards <pme@sources.redhat.com>
+
+ * docs/html/faq/index.html: Update for 2.92, grab from RELEASE-NOTES.
+ * docs/html/faq/index.txt: Regenerated.
+
+2001-04-06 Benjamin Kosnik <bkoz@redhat.com>
+
+ * include/backward/backward_warning.h: Temporarily disable until
+ g++ testsuite changes go in.
+ * tests_flags.in (CROSS_LIB_PATH): Add.
+
+2001-04-05 Benjamin Kosnik <bkoz@redhat.com>
+
+ Warn when using backward headers.
+ * include/backward/algo.h: Include warning file.
+ * include/backward/vector.h: Same.
+ * include/backward/tree.h: Same.
+ * include/backward/tempbuf.h: Same.
+ * include/backward/strstream: Same.
+ * include/backward/streambuf.h: Same.
+ * include/backward/stream.h: Same.
+ * include/backward/stack.h: Same.
+ * include/backward/slist.h: Same.
+ * include/backward/set.h: Same.
+ * include/backward/rope.h:
+ * include/backward/queue.h: Same.
+ * include/backward/pair.h: Same.
+ * include/backward/ostream.h: Same.
+ * include/backward/new.h: Same.
+ * include/backward/multiset.h: Same.
+ * include/backward/multimap.h: Same.
+ * include/backward/map.h: Same.
+ * include/backward/list.h: Same.
+ * include/backward/iterator.h: Same.
+ * include/backward/istream.h: Same.
+ * include/backward/iostream.h:
+ * include/backward/iomanip.h:
+ * include/backward/heap.h: Same.
+ * include/backward/hashtable.h:
+ * include/backward/hash_set.h:
+ * include/backward/hash_map.h:
+ * include/backward/function.h:
+ * include/backward/fstream.h:
+ * include/backward/deque.h:
+ * include/backward/defalloc.h: Same.
+ * include/backward/complex.h: Same.
+ * include/backward/bvector.h:
+ * include/backward/alloc.h:
+ * include/backward/algobase.h: Same.
+
+ * include/backward/backward_warning.h: New file.
+ * src/Makefile.am (backward_headers): Add backward_warning.h
+ * src/Makefile.in: Regenerate.
+
+2001-04-05 Benjamin Kosnik <bkoz@redhat.com>
+
+ * src/Makefile.am (myinstalldirs): Make sure backward directory is
+ created.
+ (myinstallheaders): Install backward headers in backward directory.
+ * src/Makefile.in: Regenerate.
+
+2001-04-05 Benjamin Kosnik <bkoz@redhat.com>
+
+ Prepare for libstdc++-2.92.
+ * docs/html/17_intro/RELEASE-NOTES (New): Update.
+ * docs/html/configopts.html: Fix formatting.
+ * README (file): Updates.
+ * include/bits/c++config (__GLIBCPP__): Update.
+
+2001-04-05 Phil Edwards <pme@sources.redhat.com>
+
+ * docs/doxygen/run_doxygen: Check for the existence of Doxygen.
+
+2001-04-04 Phil Edwards <pme@sources.redhat.com>
+
+ * docs/doxygen/user.cfg.in: Extract all non-private members;
+ reduce confusing documentation output.
+
+2001-04-04 Geoffrey Keating <geoffk@redhat.com>
+
+ * include/backward/fstream.h: Add missing semicolons.
+
+2001-04-03 Benjamin Kosnik <bkoz@redhat.com>
+
+ * include/bits/fstream.tcc: Add bool parameter to filebuf ctor.
+ * include/bits/ios_base.h(ios_base::Init): Remove _M_cout, _M_cin,
+ _M_cerr, _M_wcout, _M_wcin, _M_wcerr.
+ (ios_base::Init::_S_ios_create): New.
+ (ios_base::Init::_S_ios_destroy): New.
+ * include/bits/std_fstream.h: Change ctor args.
+ * src/ios.cc (ios_base::Init::Init): Use _S_ios_create.
+ (ios_base::Init::~Init): Use _S_ios_destroy.
+ (ios_base::sync_with_stdio): Use new members.
+ * testsuite/27_io/filebuf_members.cc: Fix calling conventions for
+ filebuf ctor.
+
+2001-04-03 Peter Schmid <schmid@snake.iap.physik.tu-darmstadt.de>
+
+ * include/backward/fstream.h: Expose streampos to global
+ namespace.
+
+2001-04-03 Peter Schmid <schmid@snake.iap.physik.tu-darmstadt.de>
+
+ * include/bits/stl_iterator_base_types.h: Fix typo
+
+2001-04-03 Andreas Schwab <schwab@suse.de>
+
+ * include/backward/fstream.h: Define filebuf and wfilebuf.
+
+2001-04-02 Phil Edwards <pme@sources.redhat.com>
+
+ New concept checking implementation.
+ * docs/html/19_diagnostics/howto.html: Document.
+ * docs/html/17_intro/concept_check.diff: New file, for reference.
+ * include/bits/boost_concept_check.h: New file from Boost.
+ * include/bits/c++config: Update comments.
+
+ * include/bits/concept_check.h: New file.
+ * include/bits/concept_checks.h: Removed.
+ * include/bits/container_concepts.h: Removed.
+ * include/bits/sequence_concepts.h: Removed.
+ * include/bits/stl_iterator_base.h: Removed; split into...
+ * include/bits/stl_iterator_base_funcs.h: ...this new file...
+ * include/bits/stl_iterator_base_types.h: ...and this new file.
+
+ * include/bits/sbuf_iter.h: Update to use new implementation.
+ * include/bits/std_iterator.h: Likewise.
+ * include/bits/std_memory.h: Likewise.
+ * include/bits/stl_algo.h: Likewise.
+ * include/bits/stl_algobase.h: Likewise.
+ * include/bits/stl_construct.h: Likewise.
+ * include/bits/stl_deque.h: Likewise.
+ * include/bits/stl_heap.h: Likewise.
+ * include/bits/stl_list.h: Likewise.
+ * include/bits/stl_map.h: Likewise.
+ * include/bits/stl_multimap.h: Likewise.
+ * include/bits/stl_multiset.h: Likewise.
+ * include/bits/stl_numeric.h: Likewise.
+ * include/bits/stl_queue.h: Likewise.
+ * include/bits/stl_set.h: Likewise.
+ * include/bits/stl_stack.h: Likewise.
+ * include/bits/stl_uninitialized.h: Likewise.
+ * include/bits/stl_vector.h: Likewise.
+ * include/ext/hash_map: Likewise.
+ * include/ext/hash_set: Likewise.
+ * include/ext/slist: Likewise.
+ * include/ext/stl_hashtable.h: Likewise.
+
+ * src/Makefile.am (base_headers): Update list of headers.
+ * Makefile.in: Regenerated.
+ * src/Makefile.in: Regenerated.
+ * libio/Makefile.in: Regenerated.
+ * libmath/Makefile.in: Regenerated.
+ * libsupc++/Makefile.in: Regenerated.
+ * testsuite/Makefile.in: Regenerated.
+
+ * docs/html/install.html: Update contact information.
+ * docs/html/17_intro/howto.html: Ditto.
+ * docs/html/18_support/howto.html: Ditto.
+ * docs/html/20_util/howto.html: Ditto.
+ * docs/html/21_strings/howto.html: Ditto.
+ * docs/html/22_locale/howto.html: Ditto.
+ * docs/html/23_containers/howto.html: Ditto.
+ * docs/html/24_iterators/howto.html: Ditto.
+ * docs/html/25_algorithms/howto.html: Ditto.
+ * docs/html/26_numerics/howto.html: Ditto.
+ * docs/html/27_io/howto.html: Ditto.
+ * docs/html/faq/index.html: Ditto, plus info on new checking code.
+ * docs/html/ext/howto.html: Ditto, plus info on new checking code.
+ * docs/html/faq/index.txt: Regenerated.
+
+2001-04-02 Zack Weinberg <zackw@stanford.edu>
+
+ * testsuite/lib/libstdc++.exp (dg-test): Annotate result
+ messages with $which_library as well as $tool_flags and
+ ${dg-extra-tool-flags}. Factor out annotation text into
+ a single variable.
+
+2001-04-02 Stephen M. Webb <stephen@bregmasoft.com>
+
+ * include/c_std/bits/std_cstring.h: Fix for const-correctness.
+ * include/c_std/bits/std_cwchar.h: Same.
+ * testsuite/21_strings/c_strings.cc: Add.
+
+2001-04-01 Benjamin Kosnik <bkoz@codesourcery.com>
+
+ * docs/html/configopts.html: Add --enable-sjlj-exceptions docs.
+
+2001-04-01 Zack Weinberg <zackw@stanford.edu>
+
+ * tests_flags.in: Use test a = b, not test a == b which is not
+ portable.
+
+2001-03-31 Benjamin Kosnik <bkoz@redhat.com>
+
+ * configure.target: Remove duplicate aix entry.
+
+2001-03-30 Benjamin Kosnik <bkoz@redhat.com>
+
+ * include/ext/stl_bvector.h: Move to...
+ * include/bits/stl_vector.h: ...here.
+ * include/ext/bvector: Move to...
+ * include/backward/bvector.h: ...here.
+ * include/bits/std_vector.h: Change stl_bvector include.
+ * include/bits/std_queue.h: Remove bvector include.
+ * include/ext/tree: Insert using rb_tree, move to...
+ * include/backward/tree.h: ...here.
+ * include/backward/hash_map.h: Include ext/hash_map.
+ * include/backward/hash_set.h: Include ext/hash_set.
+ * include/backward/queue.h: New file.
+ * include/backward/stack.h: Edit.
+ * include/backward/algo.h: Same.
+ * include/backward/algobase.h: Same.
+ * include/backward/alloc.h: Same.
+ * include/backward/function.h: Same.
+ * include/backward/iomanip.h: Same.
+ * include/backward/istream.h: Same.
+ * include/backward/iterator.h: Same.
+ * include/backward/list.h: Same.
+ * include/backward/map.h: Same.
+ * include/backward/multimap.h: Same.
+ * include/backward/multiset.h: Same.
+ * include/backward/ostream.h: Same.
+ * include/backward/pair.h: Same
+ * include/backward/rope.h: Same.
+ * include/backward/set.h: Same.
+ * include/backward/stream.h: Same.
+ * include/backward/strstream.h: Same.
+ * include/backward/tempbuf.h: Same.
+ * src/Makefile.am (ext_headers): Edit.
+ * src/Makefile.in: Regenerate.
+ * testsuite/ext/headers.cc (main): Fix.
+ * mkcheck.in: Fix.
+
+2001-03-30 Phil Edwards <pme@sources.redhat.com>
+
+ * tests_flags.in (LIBS): Pass correct path for installed testing.
+
+2001-03-28 Benjamin Kosnik <bkoz@redhat.com>
+
+ * mkcheck.in (LIBTOOL): Don't construct -B argument here...
+ * tests_flags.in (CXX): Construct here.
+ (static_fail): Don't remove compile.out. Format with spaces.
+ (INCLUDES): Deal with xcompiling.
+ * configure.in (xcompiling): Substitute.
+ * testsuite/Makefile.am: Snake libjava configury.
+ * testsuite/Makefile.in: Regenerate.
+ * testsuite/23_containers/map_operators.cc: Tweaks.
+ * testsuite/23_containers/set_operators.cc: Tweaks.
+
+2001-03-28 Gabriel Dos Reis <gdr@merlin.codesourcery.com>
+
+ Enable dejagnu testing framework.
+ * configure.in: Generate testsuite/Makefile.
+ * configure: Regenerate.
+ * Makefile.am (check-install): Change rule from this...
+ (check-script-install): ...to this.
+ (check): Change rule from this...
+ (check-script):...to this.
+ * Makefile.in: Regenerate.
+
+2001-03-28 Alexandre Oliva <aoliva@redhat.com>
+
+ * libsupc++/Makefile.am (CXXLINK): Add --tag disable-shared after
+ --tag CXX.
+ (LIBTOOL): Let automake take care of its definition.
+ * libsupc++/Makefile.in: Rebuilt.
+
+2001-03-28 Richard Henderson <rth@redhat.com>
+
+ IA-64 ABI Exception Handling:
+ * acinclude.m4 (GLIBCPP_ENABLE_SJLJ_EXCEPTIONS): New.
+ * configure.in: Use it.
+ * Makefile.in, aclocal.m4, config.h.in, configure: Regenerate.
+ * libsupc++/Makefile.am (sources): Update files list.
+ * libsupc++/Makefile.in: Regenerate.
+ * libsupc++/eh_alloc.cc, libsupc++/eh_aux_runtime.cc: New files.
+ * libsupc++/eh_catch.cc, libsupc++/eh_exception.cc: New files.
+ * libsupc++/eh_globals.cc, libsupc++/eh_personality.cc: New files.
+ * libsupc++/eh_terminate.cc, libsupc++/eh_throw.cc: New files.
+ * libsupc++/exception_support.cc: Remove.
+ * libsupc++/exception_support.h: Remove.
+ * libsupc++/pure.cc: Use std::terminate.
+ * libsupc++/tinfo2.cc (__throw_type_match_rtti_2): Remove.
+ (__is_pointer): Remove.
+ * libsupc++/unwind-cxx.h: New file.
+ * libsupc++/vec.cc (uncatch_exception): Update for new abi.
+
+2001-03-27 Alexandre Oliva <aoliva@redhat.com>
+
+ * libsupc++/Makefile.am (CXXLINK): Use CXX again, and choose
+ CXX tag explicitly.
+ * src/Makefile.am (CXXLINK): Likewise.
+ * libsupc++/Makefile.in, src/Makefile.in: Rebuilt.
+
+2001-03-27 Benjamin Kosnik <bkoz@redhat.com>
+
+ * include/bits/c++config (_STL_USE_CONCEPT_CHECKS): Disable by default.
+
+2001-03-26 Peter Schmid <schmid@snake.iap.physik.tu-darmstadt.de>
+
+ * libstdc++-v3/tests_flags.in: Change the order of libstdc++
+ and libc
+
+2001-03-26 Benjamin Kosnik <bkoz@redhat.com>
+
+ * include/bits/basic_file.h (get_fileno): Remove.
+ (_M_fileno): Remove.
+ (_M_cfile_created): Add.
+ (basic_file::basic_file(__c_file_type*, openmode): Add.
+ (basic_file::basic_file(int, const char*, openmode): Remove.
+ * include/bits/fstream.tcc (basic_fstream::basic_filebuf(int __fd,
+ const char*, ios_base::openmode): Don't allocate
+ internal buffers. Turn off internal buffers.
+ (basic_filebuf::overflow): Remove test for null buffer.
+ (basic_filebuf::_M_really_overflow): Same. Allow unbuffered use.
+ * include/bits/streambuf.cc: Tweak.
+ * include/bits/std_ostream.h: Tweak.
+ * config/basic_file_libio.h: Same.
+ * config/basic_file_stdio.h: Same.
+ * src/ios.cc (ios_base::Init::Init()): Unbuffer stdout by default.
+ * testsuite/27_io/filebuf_members.cc: Tweaks.
+ * testsuite/27_io/ios_base_members_static.cc: Tweaks.
+
+2001-03-24 Phil Edwards <pme@sources.redhat.com>
+
+ * Makefile.am: New targets, doxygen and doxygen-maint.
+ * Makefile.in: Regenerated.
+ * docs/doxygen/run_doxygen: Finally implemented.
+ * docs/doxygen/maint.cfg.in: New file.
+ * docs/doxygen/user.cfg.in: New file.
+
+2001-03-24 Phil Edwards <pme@sources.redhat.com>
+
+ * acinclude.m4 (GLIBCPP_CHECK_COMPILER_FEATURES): Update comment.
+ * src/Makefile.am: Replace leading spaces with tabs on continuation
+ lines.
+ * aclocal.m4: Regenerated.
+ * configure: Ditto.
+ * Makefile.in: Ditto.
+ * src/Makefile.in: Ditto.
+ * libio/Makefile.in: Ditto.
+ * libmath/Makefile.in: Ditto.
+ * libsupc++/Makefile.in: Ditto.
+
+2001-03-24 Phil Edwards <pme@sources.redhat.com>
+
+ * docs/html/19_diagnostics/howto.html: HTML fixup. Describe
+ concept-checking code and current status of same.
+ * docs/html/ext/howto.html: Ditto.
+ * docs/html/faq/index.html: Ditto.
+ * docs/html/faq/index.txt: Regenerated.
+
+2001-03-24 Phil Edwards <pme@sources.redhat.com>
+
+ * include/bits/std_bitset.h: Include ostream and istream headers
+ instead of iostream.
+
+2001-03-22 Greg Bumgardner <bumgard@roguewave.com>
+
+ * include/bits/ostream.tcc: Use __builtin_alloca.
+
+2001-03-22 Benjamin Kosnik <bkoz@redhat.com>
+
+ * src/misc-inst.cc (__sink_unused_warning): Move to...
+ * src/locale-inst.cc (__sink_unused_warning): Move to...
+ * src/stl-inst.cc: Here.
+ * include/bits/c++config (_STL_NO_CONCEPT_CHECKS): Add define,
+ commented it out.
+
+2001-03-21 Theodore Papadopoulo <Theodore.Papadopoulo@sophia.inria.fr>
+
+ * include/bits/basic_file.h: Fix typos in comments.
+
+2001-03-20 Richard Henderson <rth@redhat.com>
+
+ * src/gen-num-limits.cc: Instantiate for wchar_t.
+ * config/os/aix/bits/ctype_base.h (mask): Use unsigned int.
+
+2001-03-20 Jason Merrill <jason@redhat.com>
+
+ * libsupc++/vec.cc (__cxa_vec_cleanup): New fn.
+ (__cxa_vec_ctor, __cxa_vec_cctor, __cxa_vec_dtor): Call it.
+ * libsupc++/cxxabi.h: Declare it.
+
+2001-03-16 Alexandre Oliva <aoliva@redhat.com>
+
+ * src/gen-num-limits.cc (signal_adapter): Overloaded to match
+ signal_func with an unspecified argument list.
+
+2001-03-15 Benjamin Kosnik <bkoz@redhat.com>
+
+ * tests_flags.in (CXXFLAGS): Link libstdc++ before libsupc++.
+
+2001-03-15 Gabriel Dos Reis <gdr@merlin.codesourcery.com>
+
+ * include/bits/basic_string.tcc (operator+): Fix thinko.
+
+2001-03-14 Benjamin Kosnik <bkoz@redhat.com>
+
+ libstdc++/2020
+ * include/bits/std_streambuf.h: Remove cached locale facets.
+ (basic_streambuf::_M_buf_fctype): Remove.
+ (basic_streambuf::~basic_streambuf): Remove here.
+ (basic_streambuf::basic_streambuf): Same.
+ (basic_streambuf::imbue): Same.
+ * include/bits/fstream.tcc (filebuf::imbue): Remove _M_buf_fctype.
+ * include/bits/std_fstream.h (basic_filebuf::_M_fcvt): Remove.
+ (basic_filebuf::~basic_filebuf()): Remove here.
+ * include/bits/fstream.tcc (basic_filebuf::basic_filebuf): Same.
+ (basic_filebuf::imbue): Same.
+ * include/bits/localefwd.h (_Count_ones): Remove.
+ (locale::_S_num_categories): Just use 6, since this doesn't
+ actually change, ever.
+ * include/bits/locale_facets.tcc (has_facet): Simplify.
+ (use_facet): Same.
+ * testsuite/27_io/filebuf.cc (test06): Add tests.
+
+2001-03-13 Steve Ellcey <sje@cup.hp.com>
+
+ * libstdc++-v3/config/os/hpux/bits/ctype_base.h: Make ctype masks
+ match HP-UX ctype.h header file.
+
+2001-03-13 Andris Pavenis <pavenis@latnet.lv>
+
+ * config/djgpp/bits/ctype_noninline.h: Fix typo and remove
+ duplicate definitions of __dj_ctype_*
+
+2001-03-13 Benjamin Kosnik <bkoz@redhat.com>
+
+ * libsupc++/new: Remove pragma interface.
+ * libsupc++/typeinfo: Same.
+ * libsupc++/exception: Same.
+ * libsupc++/new_handler.cc: Remove pragma implementation.
+ (bad_alloc::~bad_alloc()): Add.
+ * libsupc++/exception_support.cc: Same.
+ (exception::~exception): Add.
+ (bad_exception::~bad_exception): Add.
+ * libsupc++/tinfo.cc: Same.
+ (bad_cast::~bad_cast): Add.
+ (bad_typeid::~bad_typeid): Add.
+
+2001-03-13 Phil Edwards <pme@sources.redhat.com>
+
+ * mkcheck.in: Fix IFS regression for non-bash-2.01 hosts.
+
+2001-03-12 Felix Lee <flee@redhat.com>
+
+ * mkcheck.in: workaround for bash 2.01 IFS bug.
+
+2001-03-12 Benjamin Kosnik <bkoz@redhat.com>
+
+ Fixups for -fno-for-scope
+ * include/bits/locale_facets.tcc (__match_parallel): Fixup.
+ * src/valarray-inst.cc (__gslice_to_index): Same.
+
+2001-03-12 Rodney Brown <RodneyBrown@mynd.com>
+
+ * src/gen-num-limits.cc (traps) [SPECIALIZE_TRAPPING]: Add fflush
+ prior to trapping signal (UnixWare 7 workaround).
+
+2001-03-12 Craig Rodrigues <rodrigc@mediaone.net>
+
+ * include/backward/hashtable.h: Same.
+ * include/backward/rope.h: Fix include.
+
+2001-03-12 Benjamin Kosnik <bkoz@redhat.com>
+
+ * include/backward/vector.h: Include std_vector.h.
+
+ * include/bits/istream.tcc (basic_istream<_CharT, _Traits>&
+ operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s)):
+ Fix typo.
+
+2001-03-11 Peter Schmid <schmid@snake.iap.physik.tu-darmstadt.de>
+
+ * include/ext/stl_hashtable.h: Change type of __n to size_t
+ * include/backward/bvector.h: Include <ext/stl_bvector.h>
+
+2001-03-09 Gabriel Dos Reis <gdr@merlin.codesourcery.com>
+
+ * include/bits/istream.tcc ( basic_istream<_CharT, _Traits>&
+ operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s)):
+ Use streamsize, not int_type.
+
+2001-03-08 Benjamin Kosnik <bkoz@redhat.com>
+
+ * testsuite/27_io/streambuf.cc (test06): New test, disabled at the
+ moment.
+
+2001-03-08 Andreas Schwab <schwab@suse.de>
+
+ * acinclude.m4 (GLIBCPP_EXPORT_INSTALL_INFO): Fix syntax in test
+ command.
+ * aclocal.m4, configure: Regenerated.
+
+2001-03-07 Benjamin Kosnik <bkoz@redhat.com>
+
+ * include/bits/std_iosfwd.h: Remove string forward decls here.
+ * include/bits/stringfwd.h: Add forward decls for char_traits
+ specializations.
+ * config/c_io_libio.h (wstreamoff): Delete.
+ * config/c_io_stdio.h (wstreamoff): Same.
+ * include/bits/char_traits.h: Use streamoff not wstreamoff for
+ char_traits<wchar_t>::off_type.
+ Remove duplicate typedefs.
+ * include/bits/fpos.h: Define streampos/wstreampos here.
+ * testsuite/27_io/istream_seeks.cc (test04): Explicitly cast int
+ values to off_type.
+ (test05): Same.
+ Changeup output files.
+ * testsuite/27_io/istream_unformatted.cc: Change output files.
+ * testsuite/27_io/istream_seeks-1.txt: Add.
+ * testsuite/27_io/istream_seeks-2.tst: Add.
+ * testsuite/27_io/istream_seeks-1.tst: Add.
+ * testsuite/27_io/istream_unformatted-2.tst: Delete.
+ * testsuite/27_io/istream_unformatted-3.tst: Delete.
+ * testsuite/27_io/istream_unformatted-3.txt: Delete.
+
+2001-03-07 Alexandre Oliva <aoliva@redhat.com>
+
+ Add Irix 5.2, 6.3 support.
+ * config/os/irix/bits: Renamed to...
+ * config/os/irix/irix6.5/bits: this.
+ * config/os/irix/irix5.2/bits: New, copied from irix6.5/bits.
+ * config/os/irix/irix5.2/bits/ctype_base.h: Use _U, _L, _N,
+ _X, _S, _P, _C and _B instead of IRIX-6.5 _IS* macros.
+ * config/os/irix/irix5.2/bits/ctype_noninline.h
+ (ctype<char>::ctype): Initialize _M_table with __ctype.
+ * configure.target: Adjust.
+
+2001-03-06 Benjamin Kosnik <bkoz@redhat.com>
+
+ libstdc++/2181
+ * include/bits/istream.tcc (basic_istream<_CharT, _Traits>::
+ operator>>(__istream_type& (*__pf)(__istream_type&)): Don't use
+ sentry.
+ (basic_istream<_CharT, _Traits>:: operator>>(__ios_type&
+ (*__pf)(__ios_type&)): Same.
+ (basic_istream<_CharT, _Traits>:: operator>>(ios_base&
+ (*__pf)(ios_base&))): Same.
+ * testsuite/27_io/istream_extractor_other.cc: Add tests.
+ * testsuite/27_io/istream_manip.cc (test01): Fix.
+
+2001-03-06 Nathan Myers <ncm@cantrip.org>
+ Benjamin Kosnik <bkoz@redhat.com>
+
+ * include/c_std/bits/std_cerrno.h: Don't define errno in std::.
+ * testsuite/17_intro/header_cerrno.cc (test01): New file.
+ * testsuite/17_intro/header_cassert.cc (test01): New file.
+ * testsuite/17_intro/header_cstddef.cc (test01): New file.
+ * testsuite/17_intro/header_csetjmp.cc (test01): New file.
+ * testsuite/17_intro/header_cstdarg.cc (test01): New file.
+
+2001-03-05 scott snyder <snyder@fnal.gov>
+
+ libstdc++/2190
+ * include/c_std/bits/std_cmath.h: Move abs(long), div(long,long)
+ from here...
+ * include/c_std/bits/std_cstdlib.h: ... to here.
+ * testsuite/17_intro/header_cstdlib.cc: Add test.
+
+2001-03-05 Stephen M. Webb <stephen.webb@cybersafe.com>
+
+ * libsupc++/vec.cc (__cxxa_vec_new2): Qualify size_t.
+
+2001-03-05 Laurynas Biveinis <lauras@softhome.net>
+
+ * config/os/djgpp/ctype_base.h (ctype_base): fix __to_type
+ definition. Replace enum with static const variables.
+
+ * config/os/djgpp/ctype_inline.h (ctype<char>::is): remove
+ throw specification, fix typos, use <static_cast>.
+ (ctype<char>::scan_is): remove throw specification.
+ (ctype<char>::scan_not): likewise.
+
+ * config/os/djgpp/ctype_noninline.h (ctype<char>::ctype): fix typo.
+ (ctype<char>::do_toupper(char)): use <static_cast>.
+ (ctype<char>::do_toupper(char *, const char *)): likewise.
+ (ctype<char>::do_tolower(char)): likewise.
+ (ctype<char>::do_tolower(char *, const char *)): likewise.
+
+2001-03-04 Phil Edwards <pme@sources.redhat.com>
+
+ http://gcc.gnu.org/ml/libstdc++/2001-03/msg00015.html
+ * include/backward/algo.h: Use std not __STD. Remove unneeded
+ macros and "never happens" code. Adjust to C++STYLE guidelines.
+ * include/backward/algobase.h: Likewise.
+ * include/backward/alloc.h: Likewise.
+ * include/backward/bvector.h: Likewise.
+ * include/backward/deque.h: Likewise.
+ * include/backward/function.h: Likewise.
+ * include/backward/hash_map.h: Likewise.
+ * include/backward/hash_set.h: Likewise.
+ * include/backward/hashtable.h: Likewise.
+ * include/backward/heap.h: Likewise.
+ * include/backward/iterator.h: Likewise.
+ * include/backward/list.h: Likewise.
+ * include/backward/map.h: Likewise.
+ * include/backward/multimap.h: Likewise.
+ * include/backward/multiset.h: Likewise.
+ * include/backward/pair.h: Likewise.
+ * include/backward/rope.h: Likewise.
+ * include/backward/set.h: Likewise.
+ * include/backward/slist.h: Likewise.
+ * include/backward/stack.h: Likewise.
+ * include/backward/strstream: Likewise.
+ * include/backward/tempbuf.h: Likewise.
+ * include/backward/tree.h: Likewise.
+ * include/backward/vector.h: Likewise.
+ * include/bits/basic_ios.h: Likewise.
+ * include/bits/basic_ios.tcc: Likewise.
+ * include/bits/basic_string.h: Likewise.
+ * include/bits/c++config: Likewise.
+ * include/bits/concept_checks.h: Likewise.
+ * include/bits/fpos.h: Likewise.
+ * include/bits/fstream.tcc: Likewise.
+ * include/bits/functexcept.h: Likewise.
+ * include/bits/ios_base.h: Likewise.
+ * include/bits/istream.tcc: Likewise.
+ * include/bits/mask_array.h: Likewise.
+ * include/bits/ostream.tcc: Likewise.
+ * include/bits/pthread_allocimpl.h: Likewise.
+ * include/bits/sbuf_iter.h: Likewise.
+ * include/bits/slice.h: Likewise.
+ * include/bits/slice_array.h: Likewise.
+ * include/bits/sstream.tcc: Likewise.
+ * include/bits/std_bitset.h: Likewise.
+ * include/bits/std_fstream.h: Likewise.
+ * include/bits/std_iomanip.h: Likewise.
+ * include/bits/std_ios.h: Likewise.
+ * include/bits/std_istream.h: Likewise.
+ * include/bits/std_iterator.h: Likewise.
+ * include/bits/std_memory.h: Likewise.
+ * include/bits/std_ostream.h: Likewise.
+ * include/bits/std_sstream.h: Likewise.
+ * include/bits/std_streambuf.h: Likewise.
+ * include/bits/std_string.h: Likewise.
+ * include/bits/std_valarray.h: Likewise.
+ * include/bits/stl_algo.h: Likewise.
+ * include/bits/stl_algobase.h: Likewise.
+ * include/bits/stl_alloc.h: Likewise.
+ * include/bits/stl_construct.h: Likewise.
+ * include/bits/stl_deque.h: Likewise.
+ * include/bits/stl_function.h: Likewise.
+ * include/bits/stl_heap.h: Likewise.
+ * include/bits/stl_iterator.h: Likewise.
+ * include/bits/stl_iterator_base.h: Likewise.
+ * include/bits/stl_list.h: Likewise.
+ * include/bits/stl_map.h: Likewise.
+ * include/bits/stl_multimap.h: Likewise.
+ * include/bits/stl_multiset.h: Likewise.
+ * include/bits/stl_numeric.h: Likewise.
+ * include/bits/stl_pair.h: Likewise.
+ * include/bits/stl_pthread_alloc.h: Likewise.
+ * include/bits/stl_queue.h: Likewise.
+ * include/bits/stl_raw_storage_iter.h: Likewise.
+ * include/bits/stl_relops.h: Likewise.
+ * include/bits/stl_set.h: Likewise.
+ * include/bits/stl_stack.h: Likewise.
+ * include/bits/stl_tempbuf.h: Likewise.
+ * include/bits/stl_threads.h: Likewise.
+ * include/bits/stl_tree.h: Likewise.
+ * include/bits/stl_uninitialized.h: Likewise.
+ * include/bits/stl_vector.h: Likewise.
+ * include/bits/streambuf.tcc: Likewise.
+ * include/bits/type_traits.h: Likewise.
+ * include/bits/valarray_meta.h: Likewise.
+ * include/ext/bvector: Likewise.
+ * include/ext/hash_map: Likewise.
+ * include/ext/hash_set: Likewise.
+ * include/ext/ropeimpl.h: Likewise.
+ * include/ext/slist: Likewise.
+ * include/ext/stl_bvector.h: Likewise.
+ * include/ext/stl_hash_fun.h: Likewise.
+ * include/ext/stl_hashtable.h: Likewise.
+ * include/ext/stl_rope.h: Likewise.
+ * src/complex_io.cc: Likewise.
+ * src/ios.cc: Likewise.
+ * src/locale-inst.cc: Likewise.
+ * src/locale.cc: Likewise.
+ * src/localename.cc: Likewise.
+ * src/misc-inst.cc: Likewise.
+ * src/stdexcept.cc: Likewise.
+ * src/stl-inst.cc: Likewise.
+ * src/strstream.cc: Likewise.
+ * src/valarray-inst.cc: Likewise.
+
+2001-03-03 Benjamin Kosnik <bkoz@redhat.com>
+
+ * src/misc-inst.cc (__copy_streambufs): Fix typo for alpha.
+
+2001-03-02 Peter Schmid <schmid@snake.iap.physik.tu-darmstadt.de>
+
+ * include/bits/istream.tcc: change type of __extracted to __size_type
+
+2001-03-02 Benjamin Kosnik <bkoz@redhat.com>
+
+ * src/wstring-inst.cc: New file.
+ * src/Makefile.am (EXTRA_LTLIBRARIES): Remove.
+ (libinst_wstring_la_SOURCES): Remove.
+ (libstdc___la_LIBADD): Remove libinst_wstring_la.
+ (sources): Add wstring-inst.cc
+ * acinclude.m4 (GLIBCPP_CHECK_WCHAR_T_SUPPORT): Remove
+ libinst_wstring_la.
+
+2001-03-02 Peter Schmid <schmid@snake.iap.physik.tu-darmstadt.de>
+
+ * src/locale.cc: initialise __ret with zero
+ * src/strstream.cc:cast gptr to int_type
+
+2001-03-01 Phil Edwards <pme@sources.redhat.com>
+
+ * docs/html/faq/index.html: Update broken links.
+ * docs/html/faq/index.txt: Regenerated.
+
+2001-02-28 Benjamin Kosnik <bkoz@redhat.com>
+
+ libstdc++/2064
+ * configure.target: Change irix* to irix6.5* in target_os table.
+
+2001-02-28 Benjamin Kosnik <bkoz@redhat.com>
+
+ libstdc++/2103
+ * include/bits/c++config (__GLIBCPP__): Bump number in
+ anticipation of 2.92.
+
+ * include/bits/codecvt.h: Fix typo.
+ * include/bits/basic_file.h (__basic_file): Don't use _M_wfile for
+ stdio model.
+ * acinclude.m4 (GLIBCPP_ENABLE_CSTDIO): Enable wchar_t
+ instantiations for stdio model.
+
+2001-02-28 Phil Edwards <pme@sources.redhat.com>
+
+ * acinclude.m4 (GLIBCPP_CONFIGURE): Remove GLIBCPP_CFLAGS
+ and GLIBCPP_CXXFLAGS as unused variables.
+ * configure.host: Likewise.
+ * configure.target: Likewise.
+ * aclocal.m4: Regenerated.
+ * configure: Regenerated.
+ * Makefile.in: Regenerated.
+ * libio/Makefile.in: Regenerated.
+ * libmath/Makefile.in: Regenerated.
+ * libsupc++/Makefile.in: Regenerated.
+ * src/Makefile.in: Regenerated.
+
+2001-02-27 Benjamin Kosnik <bkoz@redhat.com>
+
+ libstdc++/1886
+ * include/bits/basic_file.h: Include basic_file_model.h.
+ * config/c_io_libio.cc: Move to...
+ * config/basic_file_libio.cc: Here.
+ * config/basic_file_libio.h: New file.
+ * config/c_io_stdio.cc: Move to...
+ * config/basic_file_stdio.cc: Here.
+ * config/basic_file_stdio.h: New file.
+ * config/c_io_libio.h: Tweak.
+ * config/c_io_stdio.h: Tweak.
+ * src/Makefile.am (build_headers): Add basic_file_model.h.
+ (sources): Add basic_file.cc, remove c++io.cc.
+ * src/Makefile.in: Regenerate.
+ * acinclude.m4 (GLIBCPP_ENABLE_CSTDIO): Add support for
+ basic_file_model.h and basic_file.cc.
+ * aclocal.m4: Regenerate.
+ * configure: Regenerate.
+ * testsuite/27_io/filebuf.cc (test05): Add regression.
+
+2001-02-27 Benjamin Kosnik <bkoz@redhat.com>
+
+ Correct license.
+ * config/cpu/alpha/bits/atomicity.h: Change.
+ * config/cpu/arm/bits/atomicit3y.h
+ * config/cpu/generic/bits/atomicity.h
+ * config/cpu/i386/bits/atomicity.h
+ * config/cpu/i486/bits/atomicity.h
+ * config/cpu/ia64/bits/atomicity.h
+ * config/cpu/powerpc/bits/atomicity.h
+ * config/cpu/sparc/sparc32/bits/atomicity.h
+ * config/cpu/sparc/sparc64/bits/atomicity.h
+ * config/os/aix/bits/atomicity.h
+ * config/os/irix/bits/atomicity.h
+
+2001-02-27 Benjamin Kosnik <bkoz@redhat.com>
+
+ * include/bits/std_stdexcept.h (runtime_error): Make string
+ member non-const.
+ (logic_error): Same.
+ * testsuite/19_diagnostics/stdexceptions.cc (test04): Add test.
+ (test03): Fix.
+
+2001-02-26 Benjamin Kosnik <bkoz@redhat.com>
+
+ libstdc++/1972
+ libstdc++/2089
+ * include/bits/std_stdexcept.h (logic_error::logic_error): Use
+ string object, not reference.
+ (runtime_error::runtime_error): Same.
+ * testsuite/19_diagnostics/stdexceptions.cc: New file.
+
+2001-02-26 Phil Edwards <pme@sources.redhat.com>
+
+ * acinclude.m4 (GLIBCPP_CONFIGURE): Update required compiler version.
+ (GLIBCPP_CHECK_COMPILER_FEATURES): Can safely assume new
+ diagnostics. Remove WFMT_FLAGS.
+ * configure.in: Replace WFMT_FLAGS with diagnostics options.
+ * libsupc++/Makefile.am: Likewise.
+ * src/Makefile.am: Likewise.
+ * aclocal.m4: Regenerated.
+ * configure: Regenerated.
+ * Makefile.in: Regenerated.
+ * libio/Makefile.in: Regenerated.
+ * libmath/Makefile.in: Regenerated.
+ * libsupc++/Makefile.in: Regenerated.
+ * src/Makefile.in: Regenerated.
+
+2001-02-26 Phil Edwards <pme@sources.redhat.com>
+
+ Fixes libstdc++/2079
+ * include/backward/iomanip.h: Expose <ios> manipulators to global
+ namespace.
+ * include/backward/iostream.h: Also expose std::ws.
+
+2001-02-25 Greg Freemyer <freemyer@NorcrossGroup.com>
+
+ * libmath/mathconf.h (GET_LDOUBLE_MSW64): Fix thinko.
+
+2001-02-23 Benjamin Kosnik <bkoz@redhat.com>
+
+ * include/bits/codecvt.h: Use __builtin_alloca.
+ * include/bits/ostream.tcc: Same.
+ * include/bits/fstream.tcc: Same.
+
+2001-02-23 Alexandre Oliva <aoliva@redhat.com>
+
+ * mknumeric_limits (CC): Use VAR=${VAR=...} form.
+
+2001-02-23 David Edelsohn <dje@watson.ibm.com>
+
+ * mknumeric_limits (CC): Use $BUILD_DIR/../../gcc/xgcc
+
+2001-02-23 Phil Edwards <pme@sources.redhat.com>
+
+ c++/2052
+ * include/backward/iostream.h: Expose std::flush in old headers.
+
+2001-02-23 Gabriel Dos Reis <gdr@merlin.codesourcery.com>
+
+ * mknumeric_limits: Remove special-casing on target. Use gcc
+ instead of g++ to build gen-num-limits.cc
+
+2001-02-22 Benjamin Kosnik <bkoz@redhat.com>
+
+ * tests_flags.in (CXXFLAGS): Add -rpath to gcc build dir.
+
+ * include/bits/codecvt.h: Use alloca instead of __extension__ for
+ the time being.
+ * include/bits/ostream.tcc: Same.
+ * include/bits/std_ostream.h: Same.
+ * include/bits/fstream.tcc: Same.
+ * include/bits/locale_facets.tcc: Add typename.
+ * include/bits/c++config (_GLIBCPP_FULLY_COMPLIANT_HEADERS): Enable.
+
+2001-02-21 Phil Edwards <pme@sources.redhat.com>
+
+ * tests_flags.in: Remove -n flag from call to echo.
+
+2001-02-20 Benjamin Kosnik <bkoz@redhat.com>
+
+ * config/c_locale_gnu.h: Add clocale include.
+
+2001-02-20 Phil Edwards <pme@sources.redhat.com>
+
+ * include/bits/stl_config.h: Remove file.
+ * src/Makefile.am (base_headers): Remove from list.
+ * configure: Regenerate.
+ * Makefile.in: Ditto.
+ * libio/Makefile.in: Ditto.
+ * libmath/Makefile.in: Ditto.
+ * libsupc++/Makefile.in: Ditto.
+ * src/Makefile.in: Ditto.
+
+ * include/bits/c++config: Move relevant macros to here.
+ * include/backward/alloc.h: Include c++config.h instead.
+ * include/backward/function.h: Ditto.
+ * include/backward/heap.h: Ditto.
+ * include/backward/pair.h: Ditto.
+ * include/bits/pthread_allocimpl.h: Ditto.
+ * include/bits/std_functional.h: Ditto.
+ * include/bits/std_iterator.h: Ditto.
+ * include/bits/std_numeric.h: Ditto.
+ * include/bits/std_utility.h: Ditto.
+ * include/bits/stl_algobase.h: Ditto.
+ * include/bits/type_traits.h: Ditto.
+ * src/stl-inst.cc: Ditto.
+
+2001-02-19 Gabriel Dos Reis <gdr@merlin.codesourcery.com>
+
+ * include/bits/basic_file.h: Add #pragma system_header
+ * include/bits/basic_ios.h: Ditto.
+ * include/bits/basic_string.h: Ditto.
+ * include/bits/char_traits.h: Ditto.
+ * include/bits/codecvt.h: Ditto.
+ * include/bits/cpp_type_traits.h: Ditto.
+ * include/bits/fpos.h: Ditto.
+ * include/bits/gslice.h: Ditto.
+ * include/bits/gslice_array.h: Ditto.
+ * include/bits/indirect_array.h: Ditto.
+ * include/bits/ios_base.h: Ditto.
+ * include/bits/limits_generic.h: Ditto.
+ * include/bits/locale_facets.h: Ditto.
+ * include/bits/localefwd.h: Ditto.
+ * include/bits/mask_array.h: Ditto.
+ * include/bits/sbuf_iter.h: Ditto.
+ * include/bits/sequence_concepts.h: Ditto.
+ * include/bits/slice.h: Ditto.
+ * include/bits/slice_array.h: Ditto.
+ * include/bits/std_algorithm.h: Likewise.
+ * include/bits/std_bitset.h: Likewise.
+ * include/bits/std_complex.h: Likewise.
+ * include/bits/std_deque.h: Likewise.
+ * include/bits/std_fstream.h: Likewise.
+ * include/bits/std_functional.h: Likewise.
+ * include/bits/std_iomanip.h: Likewise.
+ * include/bits/std_ios.h: Likewise.
+ * include/bits/std_iosfwd.h: Likewise.
+ * include/bits/std_iostream.h: Likewise.
+ * include/bits/std_istream.h: Likewise.
+ * include/bits/std_iterator.h: Likewise.
+ * include/bits/std_list.h: Likewise.
+ * include/bits/std_locale.h: Likewise.
+ * include/bits/std_map.h: Likewise.
+ * include/bits/std_memory.h: Likewise.
+ * include/bits/std_numeric.h: Likewise.
+ * include/bits/std_ostream.h: Likewise.
+ * include/bits/std_queue.h: Likewise.
+ * include/bits/std_set.h: Likewise.
+ * include/bits/std_sstream.h: Likewise.
+ * include/bits/std_stack.h: Likewise.
+ * include/bits/std_stdexcept.h: Likewise.
+ * include/bits/std_streambuf.h: Likewise.
+ * include/bits/std_string.h: Likewise.
+ * include/bits/std_utility.h: Likewise.
+ * include/bits/std_valarray.h: Likewise.
+ * include/bits/std_vector.h: Likewise.
+ * include/bits/stringfwd.h: Likewise.
+ * include/bits/type_traits.h: Likewise.
+ * include/bits/valarray_array.h: Likewise.
+ * include/bits/valarray_meta.h: Likewise.
+
+2001-02-19 Andreas Jaeger <aj@suse.de>
+
+ * config/cpu/sparc/sparc64/bits/atomicity.h (__compare_and_swap):
+ Fix typo.
+
+2001-02-16 Greg Bumgardner <bumgard@roguewave.com>
+
+ libstdc++/1734
+ * include/bits/std_ostream.h: Replaced usage of
+ _Traits::_S_eos() with _CharT() as per section 17.2.2.1.3.
+ * include/bits/char_traits.h: Removed non-standard
+ methods that cannot be used elsewhere.
+
+ libstdc++/1885
+ * include/bits/basic_ios.h: Uncommented #include of
+ bits/basic_ios.tcc
+
+ libstdc++/1897
+ * include/bits/codecvt.h: See next...
+ * include/bits/fstream.tcc: See next...
+ * include/bits/ostream.tcc: Add __extension__
+ to variable-length arrays.
+
+ libstdc++/1967
+ * include/bits/localefwd.h: Changed int counter type to size_t.
+
+ libstdc++/1968
+ * include/bits/std_fstream.h: Added typedef for __ctype_type.
+
+2001-02-16 Benjamin Kosnik <bkoz@redhat.com>
+
+ * testsuite/21_strings/char_traits.cc: Move to ...
+ * testsuite/21_strings/char_traits_requirements.cc: ..here.
+ * testsuite/21_strings/char_traits-int_type.cc: Move to ...
+ * testsuite/21_strings/char_traits_typedefs.cc: ..here.
+
+2001-02-16 Gabriel Dos Reis <gdr@codesourcery.com>
+
+ * libmath/mathconf.h (FINITE_P, INFINITE_P): Remove macro
+ definitions.
+
+2001-02-15 Benjamin Kosnik <bkoz@redhat.com>
+
+ * include/bits/c++config: Revert.
+
+2001-02-15 Mark Mitchell <mark@codesourcery.com>
+
+ * include/bits/istream.tcc: Use ios_base::iostate in place of
+ iostate throughout. Insert `typename' keyword where necessary.
+ * include/bits/ostream.tcc: Insert `typename' keyword where
+ necessary.
+
+2001-02-15 Jeffrey Oldham <oldham@codesourcery.com>
+
+ * include/bits/c++config (_GLIBCPP_FULLY_COMPLIANT_HEADERS):
+ Define so library is compliant.
+
+2001-02-15 Anthony Green <green@redhat.com>
+
+ * acinclude.m4 (glibcpp_toolexeclibdir): Fix test for cross
+ compilation.
+ * aclocal.m4: Regenerate.
+ * configure: Regenerate.
+
+2001-02-15 Rodney Brown <RodneyBrown@mynd.com>
+
+ * acinclude.m4 (GLIBCPP_CHECK_MATH_DECL_1):
+ Include ieeefp.h for fpclass on UnixWare{2,7}.
+ * aclocal.m4: Regenerate.
+ * configure: Regenerate.
+ * mkcheck.in (size_command): Do without GNU-grep when using
+ size from binutils.
+
+2001-02-15 Mark Mitchell <mark@codesourcery.com>
+
+ Remove old ABI support from libsupc++.
+ * libsupc++/cxxabi.h: Remove conditionally compiled code.
+ * libsupc++/exception_support.cc: Likewise.
+ * libsupc++/pure.cc: Likewise.
+ * libsupc++/tinfo.cc: Likewise.
+ * libsupc++/tinfo.h: Likewise.
+ * libsupc++/tinfo2.cc: Likewise.
+ * libsupc++/typeinfo: Likewise.
+ * libsupc++/vec.cc: Likewise.
+
+2001-02-15 Benjamin Kosnik <bkoz@redhat.com>
+
+ Add support for -fno-exceptions.
+ * include/bits/exception_support.h: Remove.
+ * include/bits/basic_string.h: Remove exception_support.
+ (string::_M_check): Replace __OUTOFRANGE with __throw_out_of_range.
+ (string::at): Same.
+ (string::substr): Same.
+ * include/bits/basic_string.tcc (string::reserve): Replace
+ __LENGTHERROR with __throw_length_error.
+ (string::_S_create): Same.
+ (string::resize): Same.
+ (string::_M_replace): Same.
+ (string::replace): Same.
+ (string::copy): Replace __OUTOFRANGE with __throw_out_of_range.
+ (string::compare): Same.
+ * include/bits/stl_vector.h: Remove exception_support.
+ * src/Makefile.am (base_headers): Remove here.
+ * src/Makefile.in: Regenerate.
+
+ * include/bits/stl_range_errors.h: Remove.
+ * include/bits/stl_deque.h: Use __throw_range_error.
+ * include/bits/std_deque.h: Include functexcept.h.
+ * include/bits/std_vector.h: Same.
+ * src/Makefile.am (base_headers): Remove here.
+ * src/Makefile.in: Regenerate.
+ * include/ext/stl_bvector.h (class __BVECTOR): Use __throw_range_error.
+ * include/ext/bvector: Remove stl_range_errors.h
+
+ * include/bits/c++config (_GLIBCPP_USE_EXCEPTIONS): Remove.
+
+ * include/bits/functexcept.h: New file.
+ * src/functexcept.cc: New file. Definitions for function-based
+ exception routines.
+ * src/Makefile.am (sources): Add functexcept.cc.
+ * src/Makefile.in: Regenerate.
+
+ * include/bits/stl_config.h (__STL_USE_EXCEPTIONS): Wrap with
+ __EXCEPTIONS.
+
+ * include/bits/localefwd.h: Include functexcept.h.
+ * include/bits/std_iosfwd.h: Same.
+
+ * include/bits/basic_ios.h: Use __throw_ios_failure instead of
+ throw basic_ios::failure.
+ * include/bits/fstream.tcc (filebuf::_M_allocate_buffers):
+ Use __throw_exception_again.
+ (filebuf::_M_filebuf_init): Same.
+ * include/bits/streambuf.tcc (__copy_streambufs): Same.
+ * include/bits/ostream.tcc (ostream::operator<<): Same.
+ * include/bits/istream.tcc (istream::operator>>): Same.
+ * include/bits/basic_string.tcc (string::_M_mutate): Same.
+ (string::_S_construct): Same.
+ (string::_M_clone): Same.
+ * include/bits/locale_facets.tcc (use_facet(const locale&)): Use
+ __throw_bad_cast.
+ (num_put<_CharT, _OutIter>::do_put): Use __throw_exception_again.
+ * src/localename.cc (locale::_Imp::_Imp(const _Impl&, size_t): Use
+ __throw_exception_again.
+ (locale::_Imp::_Imp(string, size_t): Same.
+ (locale::_Imp::_M_replace_facet): Use __throw_runtime_error.
+ * src/locale.cc (locale::_M_coalesce): Use __throw_exception_again.
+ (locale::locale(const char*)): Use __throw_runtime_error.
+ (locale::classic): Use __throw_exception_again.
+ (locale::_S_normalize_category): Use __throw_runtime_error.
+
+ * src/stdexcept.cc: Remove cruft.
+
+ * libsupc++/exception_defines.h: New file.
+ * libsupc++/new_opnt.cc: Include exception_defines.h.
+ * libsupc++/vec.cc: Same.
+ (__cxa_vec_new2): Use __throw_exception_again.
+ (__cxa_vec_new3): Same.
+ (__cxa_vec_ctor): Same.
+ (__cxa_vec_delete3): Same.
+ (__cxa_vec_cctor): Same.
+ (__cxa_vec_delete2): Same.
+ (__cxa_vec_dtor): Same.
+ * libsupc++/exception_support.cc: Include exception_defines.h. Only
+ compile exception-handling bits if __EXCEPTIONS is defined.
+ Remove old ABI support.
+ * libsupc++/new_op.cc (new): Include exception_defines.h. Use
+ std::__throw_bad_alloc() instead of throw bad_alloc.
+ * libsupc++/Makefile.am: Add exception_defines.h.
+ * libsupc++/Makefile.in: Reformat.
+ * libsupc++/*: Format.
+
+2001-02-15 Phil Edwards <pme@sources.redhat.com>
+
+ * docs/html/configopts.html: Minor updates and typo fixes.
+ * docs/html/faq/index.html: Updates of the "not really bugs" list.
+ * docs/html/faq/index.txt: Regenerated.
+
+2001-02-15 Gabriel Dos Reis <gdr@codesourcery.com>
+
+ * testsuite/lib/libstdc++.exp: Lift, temporarily, out of
+ dejagnu/dg.exp. Adapt to log options used to run testcases.
+
+2001-02-13 Gabriel Dos Reis <gdr@merlin.codesourcery.com>
+
+ * testsuite/lib/libstdc++.exp(dg-test): Lift temporarily from
+ dejagnu/dg.exp.
+
+2001-02-13 Dirk Mueller <dmuell@gmx.net>
+ Phil Edwards <pme@sources.redhat.com>
+
+ * include/backward/function.h: Do not use rel_ops for older
+ headers either.
+ * include/backward/pair.h: Likewise.
+
+2001-02-12 Mark Mitchell <mark@codesourcery.com>
+
+ * src/locale.cc: Remove bogus locale::id definitions.
+
2001-02-11 Gabriel Dos Reis <gdr@merlin.codesourcery.com>
* include/bits/std_valarray.h: #undef _DEFINE_LOGICAL_OPERATOR,
@@ -21,7 +3041,7 @@
2001-02-11 Gabriel Dos Reis <gdr@codesourcery.com>
- * src/valarray-inst.cc (gslice::_Indexer::_Indexer): Don't flip
+ * src/valarray-inst.cc (gslice::_Indexer::_Indexer): Don't flip
lengths and strides.
(__gslice_to_index): Document.
@@ -42,7 +3062,7 @@
2001-02-08 Loren J. Rittle <ljrittle@acm.org>
- * src/locale-inst.cc (fill_n): Instantiate with size_t arguments.
+ * src/locale-inst.cc (fill_n): Instantiate with size_t arguments.
2001-02-08 David Edelsohn <edelsohn@gnu.org>
@@ -64,7 +3084,7 @@
* src/Makefile.in: Regenerate.
* include/bits/std_stdexcept.h: Rewrite.
* src/stdexcept.cc: Same.
-
+
2001-02-06 Benjamin Kosnik <bkoz@redhat.com>
* acinclude.m4 (GLIBCPP_EXPORT_INSTALL_INFO): Deal with library
@@ -102,7 +3122,7 @@
__group_digits.
* src/locale-inst.cc: Fixup names. Add use_facet instantiations
for collate, numpunct.
-
+
2001-02-06 Phil Edwards <pme@sources.redhat.com>
* docs/html/configopts.html: Fix HTML markup.
@@ -122,7 +3142,7 @@
(_S_copy_streambufs): Likewise.
2001-02-06 Hyman Rosen <Hyman.Rosen@kbcfp.com>
- Phil Edwards <pme@sources.redhat.com>
+ Phil Edwards <pme@sources.redhat.com>
* include/bits/std_istream.h (op>> signed,unsigned char): Must
use reinterpret_cast, not static_cast.
@@ -132,7 +3152,7 @@
* acinclude.m4 (gxx_include_dir): Quote, fix regression.
* aclocal.m4: Regenerate.
* configure: Regenerate.
-
+
2001-02-05 Benjamin Kosnik <bkoz@redhat.com>
* include/bits/locale_facets.h (class moneypunct): Fix typos.
@@ -149,7 +3169,7 @@
(GLIBCPP_CHECK_MATH_SUPPORT): Remove explicit checks for _* versions.
* aclocal.m4: Regenerate.
* configure: Regenerate.
-
+
2001-02-05 Mark Mitchell <mark@codesourcery.com>
* include/bits/locale_facets.tcc: Remove `static' keyword on
@@ -168,14 +3188,14 @@
installed.
* aclocal.m4: Regenerate.
* configure.in: Use it.
- * configure: Regenerate.
+ * configure: Regenerate.
* src/Makefile.am (targetincludep): Use simplified rules.
(targetincludep): Rename gxx_target_include_dir.
(myincludep): Rename gxx_include_dir.
* src/Makefile.in: Regenerate.
* libsupc++/Makefile.am: Use simplified rules.
* libsupc++/Makefile.in: Regenerate.
-
+
2001-02-05 Benjamin Kosnik <bkoz@redhat.com>
* include/c_std/bits/std_cerrno.h: Correct date format for copyright.
@@ -183,7 +3203,7 @@
* include/c_std/bits/std_cassert.h: Same.
* include/c_std/bits/std_cstdarg.h: Same.
* include/c_std/bits/std_cstddef.h: Same.
-
+
* include/c_std/bits/std_cstdio.h: Undefine all names brought into
namespace std.
* include/c_std/bits/std_ctime.h: Same.
@@ -194,7 +3214,7 @@
* include/c_std/bits/std_cstring.h: Same.
* include/c_std/bits/std_cstdlib.h: Same.
* include/c_std/bits/std_cwchar.h: Same.
-
+
2001-02-05 Phil Edwards <pme@sources.redhat.com>
* testsuite/27_io/ios_base_members_static.cc: Swap order of tests.
@@ -217,13 +3237,13 @@
* libsupc++/tinfo2.cc (std::typeinfo::before): Likewise.
2001-02-03 Alexandre Oliva <aoliva@redhat.com>
- Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
+ Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
- * Makefile.am (mkinstalldirs): Set.
- * src/Makefile.am (mkinstalldirs): Set.
- * libmath/Makefile.am (mkinstalldirs): Set.
- * libsup++/Makefile.am (mkinstalldirs): Set.
- * libio/Makefile.am (mkinstalldirs): Set.
+ * Makefile.am (mkinstalldirs): Set.
+ * src/Makefile.am (mkinstalldirs): Set.
+ * libmath/Makefile.am (mkinstalldirs): Set.
+ * libsup++/Makefile.am (mkinstalldirs): Set.
+ * libio/Makefile.am (mkinstalldirs): Set.
* */Makefile.in: Regenerate.
2001-02-03 Benjamin Kosnik <bkoz@redhat.com>
@@ -238,7 +3258,7 @@
(_S_ios_openmode_end): Similarly.
(_S_ios_iostate_end): Similarly.
(_S_ios_Seekdir_end): Similarly.
-
+
2001-02-02 Phil Edwards <pme@sources.redhat.com>
* mkcheck.in: Also limit virtual memory size, for mmap-based mallocs.
@@ -268,10 +3288,10 @@
* src/Makefile.am (sources): Add c++locale.cc.
(build_headers): Add c++locale.h.
* src/Makefile.in: Regenerate.
- * config/c_locale_gnu.h: New file.
+ * config/c_locale_gnu.h: New file.
* config/c_locale_gnu.cc: New file. Non-inline member functions
for named locales, gnu-specific.
- * config/c_locale_generic.h: New file.
+ * config/c_locale_generic.h: New file.
* config/c_locale_generic.cc: New file. Non-inline member
functions for named locales, generic version.
* docs/html/configopts.html: Add documentation on new options.
@@ -279,11 +3299,11 @@
* include/bits/locale_facets.h (class _Messages): Remove.
(class _Moneypunct): Remove.
* src/locale-inst.cc: Remove.
-
+
* include/bits/locale_facets.h (class _Collate): Remove.
* src/locale-inst.cc (std): Remove.
* src/locale.cc: And here.
-
+
* include/bits/localefwd.h (locale::_M_coalesce): New
function. Correctly put together multi-name locales.
(_Impl(const _Impl&, category, size_t)): Remove.
@@ -295,16 +3315,16 @@
* src/localename.cc (locale::_Impl::_M_construct_collate): Remove.
(locale::_Impl::_M_construct_ctype): Remove.
- (locale::_Impl::_M_construct_monetary): Remove.
- (locale::_Impl::_M_construct_numeric): Remove.
- (locale::_Impl::_M_construct_time): Remove.
- (locale::_Impl::_M_construct_messages): Remove.
+ (locale::_Impl::_M_construct_monetary): Remove.
+ (locale::_Impl::_M_construct_numeric): Remove.
+ (locale::_Impl::_M_construct_time): Remove.
+ (locale::_Impl::_M_construct_messages): Remove.
* include/bits/locale_facets.h (_Bad_use_facet): Remove.
(_Use_facet_failure_handle): Remove.
* src/locale.cc: Remove definitions.
* src/locale-inst.cc: And here.
-
+
* testsuite/22_locale/ctor_copy_dtor.cc (test01): Fixup. Add tests.
* src/localename.cc (locale::facet::_S_create_c_locale): Properly
@@ -314,14 +3334,14 @@
* include/bits/localefwd.h (locale::facet): Declare.
* testsuite/22_locale/members.cc: Don't test "fr_FR" locale for
correctness, as glibc apparently has incorrect info in it. Test
- with it when it works again.....
+ with it when it works again.....
* include/bits/localefwd.h (locale::_Impl::__vec_string):
Remove. Number of categories is fixed at six, so just simplify and
make this an array of strings.
(locale::_Impl::_M_has_name): Remove.
- (locale::_Impl::_M_name): Remove.
- (locale::_Impl::_M_category_names): Turns into...
+ (locale::_Impl::_M_name): Remove.
+ (locale::_Impl::_M_category_names): Turns into...
(locale::_Impl::_M_names): ...this.
(locale::_Impl::_M_has_same_name()): New function.
* src/localename.cc (locale::_Impl::~_Impl()): Remove here.
@@ -344,8 +3364,8 @@
* src/locale.cc: Remove numpunct_byname ctors.
* testsuite/22_locale/numpunct_byname.cc: New file.
- * testsuite/22_locale/numpunct.cc: New file.
-
+ * testsuite/22_locale/numpunct.cc: New file.
+
* include/bits/localefwd.h (class locale): Change data members to
protected, from private.
(_Impl::_M_get_c_locale): Add member function.
@@ -355,7 +3375,7 @@
(numpunct::numpunct( __c_locale*, size_t)): Add additonal ctor for
named locales.
* testsuite/22_locale/members.cc: New file, test name and combine.
-
+
* include/bits/locale_facets.h (class numpunct): Remove class
_Punct and _Numpunct. Rewrite class numpunct to be correct for
named locales.
@@ -364,7 +3384,7 @@
(_Imp::_Impl(size_t, size_t, bool, string)) Initialize _M_c_locale.
* src/locale-inst.cc: Remove _Numpunct, _Punct instantiations.
* testsuite/22_locale/numpunct_char_members.cc: New file.
-
+
2001-01-28 Gabriel Dos Reis <gdr@codesourcery.com>
* testsuite/README: Add more comment.
@@ -376,14 +3396,14 @@
2001-01-25 Loren J. Rittle <ljrittle@acm.org>
- * testsuite/21_strings/inserters_extractors.cc: Remove
- explicit reference to 'testsuite/'.
+ * testsuite/21_strings/inserters_extractors.cc: Remove
+ explicit reference to 'testsuite/'.
2001-01-25 Richard Henderson <rth@redhat.com>
* config/cpu/alpha/bits/atomicity.h: Remove tricky .subsetion
bits. Fixes Tru64 build issues.
-
+
2001-01-25 Michael Sokolov <msokolov@ivan.Harhan.ORG>
* acinclude.m4 (GLIBCPP_CHECK_GNU_MAKE): Bourne shell portability bug
@@ -423,7 +3443,7 @@
* tests_flags.in: Remove reference to $(top_srcdir). Use
${SRC_DIR} instead.
* Makefile.am (check, check-install): Change mkcheck invocation
- logic.
+ logic.
* Makefile.in: Regenerate.
2001-01-24 Mark Mitchell <mark@codesourcery.com>
@@ -450,7 +3470,7 @@
* acinclude.m4 (GLIBCPP_CHECK_CTYPE_SUPPORT): Remove.
(GLIBCPP_ENABLE_ATOMICITY): Remove.
* aclocal.m4: Regenerate.
-
+
2001-01-23 Chris Demetriou <cgd@broadcom.com>
* configure.in: Place definition of MULTISUBDIR in
@@ -472,15 +3492,15 @@
2001-01-23 Mark Mitchell <mark@codesourcery.com>
- * ainclude.m4 (GLIBCPP_CHEC_MATH_DECLS_AND_LINKAGE_1): New macro.
- (GLIBCPP_CHECK_MATH_SUPPORT): Use it.
- (GLIBCPP_CHECK_TYPE_SUPPORT): Don't autoconf ctype information if
- its already provided in config.target.
- * aclocal.m4: Regenerated.
- * configure: Likewise.
- * configure.target: Set ctype_include_dir for lots of systems.
- * libsupc++/Makefile.am: Explicitly include --tag disable-shared.
- * libsupc++/Makefile.in: Regenerated.
+ * ainclude.m4 (GLIBCPP_CHEC_MATH_DECLS_AND_LINKAGE_1): New macro.
+ (GLIBCPP_CHECK_MATH_SUPPORT): Use it.
+ (GLIBCPP_CHECK_TYPE_SUPPORT): Don't autoconf ctype information if
+ its already provided in config.target.
+ * aclocal.m4: Regenerated.
+ * configure: Likewise.
+ * configure.target: Set ctype_include_dir for lots of systems.
+ * libsupc++/Makefile.am: Explicitly include --tag disable-shared.
+ * libsupc++/Makefile.in: Regenerated.
2001-01-23 Gabriel Dos Reis <gdr@codesourcery.com>
@@ -511,7 +3531,7 @@
2001-01-19 Gabriel Dos Reis <gdr@codesourcery.com>
* testsuite/17_intro: Prepare testcases for new style DejaGnu
- framework.
+ framework.
2001-01-18 Gabriel Dos Reis <gdr@codesourcery.com>
@@ -519,10 +3539,10 @@
2001-01-17 Loren J. Rittle <ljrittle@acm.org>
- * mkcheck.in: Construct file names that match $objdir structure.
- * testsuite/27_io/filebuf_members-1.txt: New file.
- * testsuite/27_io/ifstream_members-1.txt: New file.
- * testsuite/27_io/ostream_inserter_char-1.txt: New file.
+ * mkcheck.in: Construct file names that match $objdir structure.
+ * testsuite/27_io/filebuf_members-1.txt: New file.
+ * testsuite/27_io/ifstream_members-1.txt: New file.
+ * testsuite/27_io/ostream_inserter_char-1.txt: New file.
* testsuite/27_io/ios_base_members_static.cc (test02): Add test.
* testsuite/27_io/ios_base_members_static-1.tst: Add expected output.
@@ -536,16 +3556,16 @@
libstdc++/1605
* include/bits/ios_base.h (ios_base::failure): Tighten up throw specs.
* src/ios.cc (ios_base::failure): Make definitions match.
- * libsupc++/typeinfo (class bad_typeid): Add throw specs.
- (class bad_cast): Same.
- * libsupc++/exception (class exception): Add throw specs.
- * libsupc++/exception_support.cc (set_terminate): Add throw specs.
- (set_unexpected): Same.
- (uncaught_exception): Same.
- (what): Same.
+ * libsupc++/typeinfo (class bad_typeid): Add throw specs.
+ (class bad_cast): Same.
+ * libsupc++/exception (class exception): Add throw specs.
+ * libsupc++/exception_support.cc (set_terminate): Add throw specs.
+ (set_unexpected): Same.
+ (uncaught_exception): Same.
+ (what): Same.
* docs/html/17_intro/C++STYLE (classname): Fix.
-
+
2001-01-16 Mark Mitchell <mark@codesourcery.com>
* src/gen-num-limits.cc (INSTANTIATIONS): New macro.
@@ -575,7 +3595,7 @@
libstdc++/1019
reported by Paolo Carlini <pcarlini@unitus.it>
- * include/bits/istream.tcc (operator>>(istream&, string&)): Fix.
+ * include/bits/istream.tcc (operator>>(istream&, string&)): Fix.
* testsuite/21_strings/inserters_extractors.cc (test08): Add test.
libstdc++/1057
@@ -584,7 +3604,7 @@
(xsgetn): Same. Simplify.
* testsuite/27_io/streambuf.cc (test04): Add testcases.
- reported by Larry Evans <jcampbell3@prodigy.net>
+ reported by Larry Evans <jcampbell3@prodigy.net>
* include/bits/streambuf.tcc (streambuf::xsputn): Just check for
equality with eof on returned value from overflow.
@@ -628,10 +3648,10 @@
2001-01-10 Peter Schmid <schmid@snake.iap.physik.tu-darmstadt.de>
- * include/bits/std_complex.h: Fix a typo.
+ * include/bits/std_complex.h: Fix a typo.
2001-01-09 Benjamin Kosnik <bkoz@redhat.com>
- <kainz@ilm.com>
+ <kainz@ilm.com>
Fixes for libstdc++/1576
* src/stdstreams.cc: Initialize with NULL filebuf. Delete
@@ -649,7 +3669,7 @@
2001-01-09 Peter Schmid <schmid@snake.iap.physik.tu-darmstadt.de>
- * include/bits/std_complex.h: Fix a typo.
+ * include/bits/std_complex.h: Fix a typo.
2001-01-09 Loren J. Rittle <ljrittle@acm.org>
@@ -700,8 +3720,8 @@
2001-01-04 Loren J. Rittle <ljrittle@acm.org>
- * config/c_io_stdio.cc (__basic_file<_CharT>::sys_open()): On
- systems that support it, call dup() before fdopen().
+ * config/c_io_stdio.cc (__basic_file<_CharT>::sys_open()): On
+ systems that support it, call dup() before fdopen().
2001-01-03 Benjamin Kosnik <bkoz@redhat.com>
diff --git a/libstdc++-v3/Makefile.am b/libstdc++-v3/Makefile.am
index 95994dbc5a1..8dfcc742455 100644
--- a/libstdc++-v3/Makefile.am
+++ b/libstdc++-v3/Makefile.am
@@ -24,25 +24,38 @@
AUTOMAKE_OPTIONS = 1.3 cygnus
MAINT_CHARSET = latin1
-SUBDIRS = libio libmath libsupc++ src
+SUBDIRS = include libio libmath libsupc++ src testsuite
mkinstalldirs = $(SHELL) $(toplevel_srcdir)/mkinstalldirs
-# Use $${builddir} instead of $(top_builddir) for arguments to "mkcheck"
-# because then the paths will be full pathnames, not relative
-# pathnames. (-Wl,--rpath seems to like this better.)
-check: $(top_builddir)/mkcheck
+# 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; \
- srcdir=`cd $(top_srcdir); pwd`; builddir=`pwd`; \
- test -d testsuite || (mkdir testsuite; chmod u+w testsuite); \
- cd testsuite; $${builddir}/mkcheck 0 $${builddir} $${srcdir})
+ cd testsuite; \
+ @glibcpp_builddir@/mkcheck 0)
-check-install: $(top_builddir)/mkcheck
+check-script-install: $(top_builddir)/mkcheck
-(chmod + $(top_builddir)/mkcheck; \
- srcdir=`cd $(top_srcdir); pwd`; builddir=`pwd`; \
- test -d testsuite || (mkdir testsuite; chmod u+w testsuite); \
cd testsuite; \
- $${builddir}/mkcheck 1 $${builddir} $${srcdir} $(prefix))
+ @glibcpp_builddir@/mkcheck 1)
+
+# These two rules might seem messy, but are hella worth it.
+doxygen:
+ -(srcdir=`cd ${top_srcdir}; pwd`; \
+ outdir=`pwd`; \
+ /bin/sh ${srcdir}/docs/doxygen/run_doxygen \
+ --mode=user $${srcdir} $${outdir})
+
+doxygen-maint:
+ -(srcdir=`cd ${top_srcdir}; pwd`; \
+ outdir=`pwd`; \
+ ${srcdir}/docs/doxygen/run_doxygen --mode=maint $${srcdir} $${outdir})
+
+.PHONY: doxygen doxygen-maint
# Multilib support.
MAKEOVERRIDES=
@@ -106,8 +119,6 @@ AM_MAKEFLAGS = \
"PICFLAG=$(PICFLAG)" \
"PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \
"SHELL=$(SHELL)" \
- "EXPECT=$(EXPECT)" \
- "RUNTEST=$(RUNTEST)" \
"RUNTESTFLAGS=$(RUNTESTFLAGS)" \
"exec_prefix=$(exec_prefix)" \
"infodir=$(infodir)" \
@@ -117,8 +128,6 @@ AM_MAKEFLAGS = \
"tooldir=$(tooldir)" \
"AR=$(AR)" \
"AS=$(AS)" \
- "CC=$(CC)" \
- "CXX=$(CXX)" \
"LD=$(LD)" \
"LIBCFLAGS=$(LIBCFLAGS)" \
"PICFLAG=$(PICFLAG)" \
@@ -128,3 +137,5 @@ AM_MAKEFLAGS = \
"NM_FOR_TARGET=$(NM_FOR_TARGET)" \
"DESTDIR=$(DESTDIR)" \
"WERROR=$(WERROR)"
+
+
diff --git a/libstdc++-v3/Makefile.in b/libstdc++-v3/Makefile.in
index 5c2dee00b6d..1593aa5f7d6 100644
--- a/libstdc++-v3/Makefile.in
+++ b/libstdc++-v3/Makefile.in
@@ -1,6 +1,6 @@
-# Makefile.in generated automatically by automake 1.4 from Makefile.am
+# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am
-# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
+# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -65,13 +65,16 @@ target_alias = @target_alias@
target_triplet = @target@
AR = @AR@
AS = @AS@
+ATOMICITY_INC_SRCDIR = @ATOMICITY_INC_SRCDIR@
+BASIC_FILE_H = @BASIC_FILE_H@
CC = @CC@
+CCODECVT_C = @CCODECVT_C@
+CLOCALE_H = @CLOCALE_H@
CPP = @CPP@
CSHADOW_FLAGS = @CSHADOW_FLAGS@
-CSTD_INCLUDES = @CSTD_INCLUDES@
+CSTDIO_H = @CSTDIO_H@
CXX = @CXX@
CXXCPP = @CXXCPP@
-CXX_libstdcxx = @CXX_libstdcxx@
C_INCLUDE_DIR = @C_INCLUDE_DIR@
DEBUG_FLAGS = @DEBUG_FLAGS@
DLLTOOL = @DLLTOOL@
@@ -79,15 +82,16 @@ EXEEXT = @EXEEXT@
EXTRA_CXX_FLAGS = @EXTRA_CXX_FLAGS@
GCJ = @GCJ@
GCJFLAGS = @GCJFLAGS@
-GLIBCPP_CFLAGS = @GLIBCPP_CFLAGS@
-GLIBCPP_CXXFLAGS = @GLIBCPP_CXXFLAGS@
-GLIBCPP_INCLUDE_DIR = @GLIBCPP_INCLUDE_DIR@
+GLIBCPP_INCLUDES = @GLIBCPP_INCLUDES@
+GLIBCPP_IS_CROSS_COMPILING = @GLIBCPP_IS_CROSS_COMPILING@
LIBIO_INCLUDES = @LIBIO_INCLUDES@
LIBMATHOBJS = @LIBMATHOBJS@
LIBMATH_INCLUDES = @LIBMATH_INCLUDES@
LIBSTRINGOBJS = @LIBSTRINGOBJS@
LIBSUPCXX_INCLUDES = @LIBSUPCXX_INCLUDES@
+LIBSUPCXX_PICFLAGS = @LIBSUPCXX_PICFLAGS@
LIBTOOL = @LIBTOOL@
+LIMITS_INC_SRCDIR = @LIMITS_INC_SRCDIR@
LN_S = @LN_S@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
@@ -95,6 +99,7 @@ OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OPTIMIZE_CXXFLAGS = @OPTIMIZE_CXXFLAGS@
OPT_LDFLAGS = @OPT_LDFLAGS@
+OS_INC_SRCDIR = @OS_INC_SRCDIR@
PACKAGE = @PACKAGE@
RANLIB = @RANLIB@
SECTION_FLAGS = @SECTION_FLAGS@
@@ -105,22 +110,25 @@ USE_COMPLEX_LONG_DOUBLE = @USE_COMPLEX_LONG_DOUBLE@
VERSION = @VERSION@
WARN_FLAGS = @WARN_FLAGS@
WERROR = @WERROR@
-WFMT_FLAGS = @WFMT_FLAGS@
enable_shared = @enable_shared@
enable_static = @enable_static@
+glibcpp_CXX = @glibcpp_CXX@
glibcpp_basedir = @glibcpp_basedir@
+glibcpp_builddir = @glibcpp_builddir@
+glibcpp_prefixdir = @glibcpp_prefixdir@
+glibcpp_srcdir = @glibcpp_srcdir@
+glibcpp_thread_h = @glibcpp_thread_h@
glibcpp_toolexecdir = @glibcpp_toolexecdir@
glibcpp_toolexeclibdir = @glibcpp_toolexeclibdir@
gxx_include_dir = @gxx_include_dir@
ifGNUmake = @ifGNUmake@
-libinst_wstring_la = @libinst_wstring_la@
libio_la = @libio_la@
toplevel_srcdir = @toplevel_srcdir@
AUTOMAKE_OPTIONS = 1.3 cygnus
MAINT_CHARSET = latin1
-SUBDIRS = libio libmath libsupc++ src
+SUBDIRS = include libio libmath libsupc++ src testsuite
mkinstalldirs = $(SHELL) $(toplevel_srcdir)/mkinstalldirs
@@ -138,14 +146,51 @@ MULTICLEAN = true
# Work around what appears to be a GNU make bug handling MAKEFLAGS
# values defined in terms of make variables, as is the case for CC and
# friends when we are called from the top level Makefile.
-AM_MAKEFLAGS = "AR_FLAGS=$(AR_FLAGS)" "CC_FOR_BUILD=$(CC_FOR_BUILD)" "CC_FOR_TARGET=$(CC_FOR_TARGET)" "CFLAGS=$(CFLAGS)" "CXXFLAGS=$(CXXFLAGS)" "CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" "INSTALL=$(INSTALL)" "INSTALL_DATA=$(INSTALL_DATA)" "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" "INSTALL_SCRIPT=$(INSTALL_SCRIPT)" "LDFLAGS=$(LDFLAGS)" "LIBCFLAGS=$(LIBCFLAGS)" "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" "MAKE=$(MAKE)" "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" "PICFLAG=$(PICFLAG)" "PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" "SHELL=$(SHELL)" "EXPECT=$(EXPECT)" "RUNTEST=$(RUNTEST)" "RUNTESTFLAGS=$(RUNTESTFLAGS)" "exec_prefix=$(exec_prefix)" "infodir=$(infodir)" "libdir=$(libdir)" "includedir=$(includedir)" "prefix=$(prefix)" "tooldir=$(tooldir)" "AR=$(AR)" "AS=$(AS)" "CC=$(CC)" "CXX=$(CXX)" "LD=$(LD)" "LIBCFLAGS=$(LIBCFLAGS)" "PICFLAG=$(PICFLAG)" "RANLIB=$(RANLIB)" "NM=$(NM)" "NM_FOR_BUILD=$(NM_FOR_BUILD)" "NM_FOR_TARGET=$(NM_FOR_TARGET)" "DESTDIR=$(DESTDIR)" "WERROR=$(WERROR)"
+AM_MAKEFLAGS = \
+ "AR_FLAGS=$(AR_FLAGS)" \
+ "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
+ "CC_FOR_TARGET=$(CC_FOR_TARGET)" \
+ "CFLAGS=$(CFLAGS)" \
+ "CXXFLAGS=$(CXXFLAGS)" \
+ "CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
+ "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
+ "INSTALL=$(INSTALL)" \
+ "INSTALL_DATA=$(INSTALL_DATA)" \
+ "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
+ "INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \
+ "LDFLAGS=$(LDFLAGS)" \
+ "LIBCFLAGS=$(LIBCFLAGS)" \
+ "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \
+ "MAKE=$(MAKE)" \
+ "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
+ "PICFLAG=$(PICFLAG)" \
+ "PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \
+ "SHELL=$(SHELL)" \
+ "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
+ "exec_prefix=$(exec_prefix)" \
+ "infodir=$(infodir)" \
+ "libdir=$(libdir)" \
+ "includedir=$(includedir)" \
+ "prefix=$(prefix)" \
+ "tooldir=$(tooldir)" \
+ "AR=$(AR)" \
+ "AS=$(AS)" \
+ "LD=$(LD)" \
+ "LIBCFLAGS=$(LIBCFLAGS)" \
+ "PICFLAG=$(PICFLAG)" \
+ "RANLIB=$(RANLIB)" \
+ "NM=$(NM)" \
+ "NM_FOR_BUILD=$(NM_FOR_BUILD)" \
+ "NM_FOR_TARGET=$(NM_FOR_TARGET)" \
+ "DESTDIR=$(DESTDIR)" \
+ "WERROR=$(WERROR)"
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
CONFIG_HEADER = config.h
-CONFIG_CLEAN_FILES = tests_flags mkcheck
+CONFIG_CLEAN_FILES = mkcheck testsuite_flags
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 tests_flags.in
+mkcheck.in testsuite_flags.in
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
@@ -196,10 +241,10 @@ distclean-hdr:
-rm -f config.h
maintainer-clean-hdr:
-tests_flags: $(top_builddir)/config.status tests_flags.in
- cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
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.
@@ -237,7 +282,7 @@ maintainer-clean-recursive:
dot_seen=no; \
rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \
rev="$$subdir $$rev"; \
- test "$$subdir" = "." && dot_seen=yes; \
+ test "$$subdir" != "." || dot_seen=yes; \
done; \
test "$$dot_seen" = "no" && rev=". $$rev"; \
target=`echo $@ | sed s/-recursive//`; \
@@ -411,21 +456,34 @@ distclean-generic clean-generic maintainer-clean-generic clean \
mostlyclean distclean maintainer-clean
-# Use $${builddir} instead of $(top_builddir) for arguments to "mkcheck"
-# because then the paths will be full pathnames, not relative
-# pathnames. (-Wl,--rpath seems to like this better.)
-check: $(top_builddir)/mkcheck
+# 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; \
- srcdir=`cd $(top_srcdir); pwd`; builddir=`pwd`; \
- test -d testsuite || (mkdir testsuite; chmod u+w testsuite); \
- cd testsuite; $${builddir}/mkcheck 0 $${builddir} $${srcdir})
+ cd testsuite; \
+ @glibcpp_builddir@/mkcheck 0)
-check-install: $(top_builddir)/mkcheck
+check-script-install: $(top_builddir)/mkcheck
-(chmod + $(top_builddir)/mkcheck; \
- srcdir=`cd $(top_srcdir); pwd`; builddir=`pwd`; \
- test -d testsuite || (mkdir testsuite; chmod u+w testsuite); \
cd testsuite; \
- $${builddir}/mkcheck 1 $${builddir} $${srcdir} $(prefix))
+ @glibcpp_builddir@/mkcheck 1)
+
+# These two rules might seem messy, but are hella worth it.
+doxygen:
+ -(srcdir=`cd ${top_srcdir}; pwd`; \
+ outdir=`pwd`; \
+ /bin/sh ${srcdir}/docs/doxygen/run_doxygen \
+ --mode=user $${srcdir} $${outdir})
+
+doxygen-maint:
+ -(srcdir=`cd ${top_srcdir}; pwd`; \
+ outdir=`pwd`; \
+ ${srcdir}/docs/doxygen/run_doxygen --mode=maint $${srcdir} $${outdir})
+
+.PHONY: doxygen doxygen-maint
# Multilib Makefile bits.
.PHONY: all-multi mostlyclean-multi clean-multi distclean-multi \
diff --git a/libstdc++-v3/README b/libstdc++-v3/README
index d795882518c..473cf919a6f 100644
--- a/libstdc++-v3/README
+++ b/libstdc++-v3/README
@@ -38,6 +38,22 @@ It has subdirectories:
Headers provided for backward compatibility, such as <iostream.h>.
They are not used in this library.
+ include/c_shadow
+ Headers intended to shadow standard C headers provided by an
+ underlying OS or C library, and other headers depended on directly
+ by C++ headers (e.g. unistd.h). These are meant to wrap the names
+ defined there into the _C_legacy namespace.
+ [NB: this can be enabled via --enable-cheaders=c_shadow]
+
+ include/c
+ Headers intended to directly include standard C headers.
+ [NB: this can be enabled via --enable-cheaders=c]
+
+ include/c_std
+ Headers intended to include standard C headers, and put select
+ names into the std:: namespace.
+ [NB: this is the default, and is the same as --enable-cheaders=c_std]
+
src
Files that are used in constructing the library, but are not
installed.
@@ -46,23 +62,11 @@ It has subdirectories:
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
- command is issued from the build directory. Please note that
- "make check" calls the script mkcheck, which requires bash, and which
- may need the paths to bash adjusted to work properly, as /bin/bash is
- assumed.
-
- shadow
- Headers intended to shadow standard C headers provided by an
- underlying OS or C library, and other headers depended on directly
- by C++ headers (e.g. unistd.h). These are meant to wrap the names
- defined there into the _C_legacy namespace.
- [NB: this can be enabled via --enable-cshadow-headers.]
-
- cshadow
- The contents of this directory are constructed by scripts which
- examine the underlying C headers to discover other headers they
- depend on. These headers are wrappers for them.
- [NB: this is still experimental, and is not currently used.]
+ command is issued from the build directory. Please note that
+ "make check" requires DejaGNU 1.4 or later to be installed. Please
+ note that "make check-script" calls the script mkcheck, which
+ requires bash, and which may need the paths to bash adjusted to
+ work properly, as /bin/bash is assumed.
Other subdirectories contain variant versions of certain files
that are meant to be copied or linked by the configure script.
@@ -95,4 +99,3 @@ any other make.
In files throughout the system, lines marked with an "XXX" indicate
a bug or incompletely-implemented feature. Lines marked "XXX MT"
indicate a place that may require attention for multi-thread safety.
-
diff --git a/libstdc++-v3/acconfig.h b/libstdc++-v3/acconfig.h
index 29ffd5e1125..81763c6051b 100644
--- a/libstdc++-v3/acconfig.h
+++ b/libstdc++-v3/acconfig.h
@@ -1,17 +1,17 @@
// acconfig.h symbols and macros for libstdc++ v3 -*- C++ -*-
-// Define if GCC support for __complex__ float is buggy.
-#undef _GLIBCPP_BUGGY_FLOAT_COMPLEX
+// Define if GCC supports weak symbols.
+#undef _GLIBCPP_SUPPORTS_WEAK
-// Define if GCC support for __complex__ is buggy.
-#undef _GLIBCPP_BUGGY_COMPLEX
+// Define if gthr-default.h exists (meaning that threading support is enabled).
+#undef HAVE_GTHR_DEFAULT
-// Include support for multiple threads, e.g., in the I/O package.
-#undef _GLIBCPP_USE_THREADS
-
-// Include support for 'long long' and 'unsigned long long'.
+// Include I/O support for 'long long' and 'unsigned long long'.
#undef _GLIBCPP_USE_LONG_LONG
+// Define if C99 features such as lldiv_t, llabs, lldiv should be exposed.
+#undef _GLIBCPP_USE_C99
+
// Include support for 'long double'.
#undef _GLIBCPP_USE_LONG_DOUBLE
@@ -21,6 +21,9 @@
// Define if code specialized for wchar_t should be used.
#undef _GLIBCPP_USE_WCHAR_T
+// Define if using setrlimit to limit memory usage during 'make check'.
+#undef _GLIBCPP_MEM_LIMITS
+
// Define if you have the atan2f function.
#undef _GLIBCPP_HAVE_ATAN2F
@@ -30,16 +33,13 @@
// Define if you have the copysignf function.
#undef _GLIBCPP_HAVE_COPYSIGNF
-// Define if lldiv_t exists in stdlib.h.
-#undef HAVE_LLDIV_T
-
-// Define if mbstate_t exists in wchar.h. */
+// Define if mbstate_t exists in wchar.h.
#undef HAVE_MBSTATE_T
-// Define if you have the modff function. */
+// Define if you have the modff function.
#undef HAVE_MODFF
-// Define if you have the modfl function. */
+// Define if you have the modfl function.
#undef HAVE_MODFL
// Define if the compiler/host combination has __builtin_abs
@@ -98,7 +98,6 @@
// Systems that have certain non-standard functions prefixed with an
// underscore, we'll handle those here. Must come after config.h.in.
//
-
#if defined (HAVE__ISNAN) && ! defined (HAVE_ISNAN)
# define HAVE_ISNAN 1
# define isnan _isnan
diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4
index c56d642b788..4eb6184f96e 100644
--- a/libstdc++-v3/acinclude.m4
+++ b/libstdc++-v3/acinclude.m4
@@ -1,8 +1,6 @@
dnl
dnl Initialize configure bits.
dnl
-dnl Define OPTLEVEL='-O2' if new inlining code present.
-dnl
dnl GLIBCPP_CONFIGURE
AC_DEFUN(GLIBCPP_CONFIGURE, [
dnl Default to --enable-multilib
@@ -14,10 +12,10 @@ AC_DEFUN(GLIBCPP_CONFIGURE, [
*) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;;
esac], [multilib=yes])dnl
- glibcpp_basedir=$auxdir/$1/libstdc++-v3
+ glibcpp_basedir=$srcdir/$toprel/$1/libstdc++-v3
AC_SUBST(glibcpp_basedir)
- AM_INIT_AUTOMAKE(libstdc++, 2.90.8)
+ AM_INIT_AUTOMAKE(libstdc++, 3.0.0)
# Never versions of autoconf add an underscore to these functions.
# Prevent future problems ...
@@ -78,15 +76,15 @@ AC_DEFUN(LIB_AC_PROG_CXX,
[AC_BEFORE([$0], [AC_PROG_CXXCPP])dnl
dnl Fool anybody using AC_PROG_CXX.
AC_PROVIDE([AC_PROG_CXX])
-# Use CXX_libstdcxx so that we do not cause CXX to be cached with the
+# Use glibcpp_CXX so that we do not cause CXX to be cached with the
# flags that come in CXX while configuring libstdc++. They're different
# from those used for all other target libraries. If CXX is set in
# the environment, respect that here.
-CXX_libstdcxx=$CXX
-AC_CHECK_PROGS(CXX_libstdcxx, $CCC c++ g++ gcc CC cxx cc++, gcc)
-CXX=$CXX_libstdcxx
-AC_SUBST(CXX)
-test -z "$CXX" && AC_MSG_ERROR([no acceptable c++ found in \$PATH])
+glibcpp_CXX=$CXX
+AC_CHECK_PROGS(glibcpp_CXX, $CCC c++ g++ gcc CC cxx cc++, gcc)
+AC_SUBST(glibcpp_CXX)
+CXX=$glibcpp_CXX
+test -z "$glibcpp_CXX" && AC_MSG_ERROR([no acceptable c++ found in \$PATH])
AC_PROG_CXX_GNU
@@ -116,8 +114,7 @@ LIB_AC_PROG_CXX
AC_CHECK_TOOL(AS, as)
AC_CHECK_TOOL(AR, ar)
- AC_CHECK_TOOL(RANLIB, ranlib, :)
-
+ AC_CHECK_TOOL(RANLIB, ranlib, ranlib-not-found-in-path-error)
AC_PROG_INSTALL
AM_MAINTAINER_MODE
@@ -130,15 +127,13 @@ LIB_AC_PROG_CXX
# automake happy, but we dont execute it, since we dont care about
# the result.
if false; then
+ # autoconf 2.50 runs AC_EXEEXT by default, and the macro expands
+ # to nothing, so nothing would remain between `then' and `fi' if it
+ # were not for the `:' below.
+ :
AC_EXEEXT
fi
- # configure.host sets the following important variables
- # glibcpp_cflags - host specific C compiler flags
- # glibcpp_cxxflags - host specific C++ compiler flags
- glibcpp_cflags=
- glibcpp_cxxflags=
-
. [$]{glibcpp_basedir}/configure.host
case [$]{glibcpp_basedir} in
@@ -147,13 +142,8 @@ LIB_AC_PROG_CXX
esac
# This does for the target what configure.host does for the host. In
- # addition to modifying the same flags, it also sets up symlinks.
+ # addition to possibly modifying the same flags, it also sets up symlinks.
GLIBCPP_CHECK_TARGET
-
- GLIBCPP_CFLAGS="[$]{glibcpp_cflags}"
- GLIBCPP_CXXFLAGS="[$]{glibcpp_cxxflags}"
- AC_SUBST(GLIBCPP_CFLAGS)
- AC_SUBST(GLIBCPP_CXXFLAGS)
])
@@ -167,11 +157,11 @@ if test ! -f stamp-sanity-compiler; then
AC_MSG_CHECKING([for g++ that will successfully compile libstdc++-v3])
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
- AC_EGREP_CPP(ok, [
- #if (__GNUC__ > 2) || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)
- ok
+ AC_TRY_COMPILE(, [
+ #if __GNUC__ < 3
+ not_ok
#endif
- ], gpp_satisfactory=yes, AC_MSG_ERROR([please upgrade to gcc-2.95 or above]))
+ ], gpp_satisfactory=yes, AC_MSG_ERROR([please upgrade to GCC 3.0 or above]))
AC_LANG_RESTORE
AC_MSG_RESULT($gpp_satisfactory)
touch stamp-sanity-compiler
@@ -180,22 +170,21 @@ fi
dnl
-dnl Test for newer compiler features, or features that are present in newer
-dnl compiler version but not older compiler versions should be placed
-dnl here.
+dnl Tests for newer compiler features, or features that are present in newer
+dnl compiler versions but not older compiler versions still in use, should
+dnl be placed here.
dnl
-dnl Define WFMT_FLAGS='-fdiagnostics-show-location=once' if possible
-dnl
dnl Define WERROR='-Werror' if requested and possible; g++'s that lack the
dnl new inlining code or the new system_header pragma will die on -Werror.
dnl Leave it out by default and use maint-mode to use it.
dnl
dnl Define SECTION_FLAGS='-ffunction-sections -fdata-sections' if
-dnl compiler supports it.
+dnl compiler supports it and the user has not requested debug mode.
+dnl
dnl GLIBCPP_CHECK_COMPILER_FEATURES
AC_DEFUN(GLIBCPP_CHECK_COMPILER_FEATURES, [
# All these tests are for C++; save the language and the compiler flags.
- # The CXXFLAGS thing is suspicious, but based on similar bits
+ # The CXXFLAGS thing is suspicious, but based on similar bits previously
# found in GLIBCPP_CONFIGURE.
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
@@ -209,22 +198,6 @@ AC_DEFUN(GLIBCPP_CHECK_COMPILER_FEATURES, [
WERROR='-Werror'
fi
- # Check for more sophisticated diagnostic control.
- AC_MSG_CHECKING([for g++ that supports -fdiagnostics-show-location=once])
- CXXFLAGS='-Werror -fdiagnostics-show-location=once'
- AC_TRY_COMPILE(, [int foo;
- ], [ac_gabydiags=yes], [ac_gabydiags=no])
- if test "$ac_test_CXXFLAGS" = set; then
- CXXFLAGS="$ac_save_CXXFLAGS"
- else
- # this is the suspicious part
- CXXFLAGS=''
- fi
- if test x"$ac_gabydiags" = x"yes"; then
- WFMT_FLAGS='-fdiagnostics-show-location=once'
- fi
- AC_MSG_RESULT($ac_gabydiags)
-
# Check for -ffunction-sections -fdata-sections
AC_MSG_CHECKING([for g++ that supports -ffunction-sections -fdata-sections])
CXXFLAGS='-Werror -ffunction-sections -fdata-sections'
@@ -243,7 +216,6 @@ AC_DEFUN(GLIBCPP_CHECK_COMPILER_FEATURES, [
AC_LANG_RESTORE
AC_SUBST(WERROR)
- AC_SUBST(WFMT_FLAGS)
AC_SUBST(SECTION_FLAGS)
])
@@ -261,8 +233,8 @@ AC_DEFUN(GLIBCPP_CHECK_LINKER_FEATURES, [
# If we're not using GNU ld, then there's no point in even trying these
# tests. Check for that first. We should have already tested for gld
# by now (in libtool), but require it now just to be safe...
- SECTION_LDFLAGS=''
- OPT_LDFLAGS=''
+ test -z "$SECTION_LDFLAGS" && SECTION_LDFLAGS=''
+ test -z "$OPT_LDFLAGS" && OPT_LDFLAGS=''
AC_REQUIRE([AC_PROG_LD])
# Set --gc-sections.
@@ -290,7 +262,7 @@ AC_DEFUN(GLIBCPP_CHECK_LINKER_FEATURES, [
catch (...) { };
return 0;
}
- ], [ac_sectionLDflags=yes],[ac_sectionLFflags=no], [ac_sectionLDflags=yes])
+ ], [ac_sectionLDflags=yes],[ac_sectionLDflags=no], [ac_sectionLDflags=yes])
if test "$ac_test_CFLAGS" = set; then
CFLAGS="$ac_save_CFLAGS"
else
@@ -298,14 +270,14 @@ AC_DEFUN(GLIBCPP_CHECK_LINKER_FEATURES, [
CFLAGS=''
fi
if test "$ac_sectionLDflags" = "yes"; then
- SECTION_LDFLAGS='-Wl,--gc-sections'
+ SECTION_LDFLAGS="-Wl,--gc-sections $SECTION_LDFLAGS"
fi
AC_MSG_RESULT($ac_sectionLDflags)
fi
# Set linker optimization flags.
if test x"$ac_cv_prog_gnu_ld" = x"yes" && test x"$enable_debug" = x"no"; then
- OPT_LDFLAGS='-Wl,-O1'
+ OPT_LDFLAGS="-Wl,-O1 $OPT_LDFLAGS"
fi
AC_SUBST(SECTION_LDFLAGS)
@@ -325,7 +297,11 @@ AC_DEFUN(GLIBCPP_CHECK_MATH_DECL_1, [
AC_CACHE_VAL(glibcpp_cv_func_$1_use, [
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
- AC_TRY_COMPILE([#include <math.h>],
+ AC_TRY_COMPILE([#include <math.h>
+ #ifdef HAVE_IEEEFP_H
+ #include <ieeefp.h>
+ #endif
+ ],
[ $1(0);],
[glibcpp_cv_func_$1_use=yes], [glibcpp_cv_func_$1_use=no])
AC_LANG_RESTORE
@@ -384,7 +360,7 @@ AC_DEFUN(GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1, [
dnl
dnl Check to see if the (math function) argument passed is
dnl declared when using the c++ compiler
-dnl ASSUMES argument is a math function with ONE parameter
+dnl ASSUMES argument is a math function with TWO parameters
dnl
dnl GLIBCPP_CHECK_MATH_DECL_2
AC_DEFUN(GLIBCPP_CHECK_MATH_DECL_2, [
@@ -430,7 +406,7 @@ AC_DEFUN(GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2, [
dnl
dnl Check to see if the (math function) argument passed is
dnl declared when using the c++ compiler
-dnl ASSUMES argument is a math function with ONE parameter
+dnl ASSUMES argument is a math function with THREE parameters
dnl
dnl GLIBCPP_CHECK_MATH_DECL_3
AC_DEFUN(GLIBCPP_CHECK_MATH_DECL_3, [
@@ -478,9 +454,6 @@ dnl Check to see if the (stdlib function) argument passed is
dnl 1) declared when using the c++ compiler
dnl 2) has "C" linkage
dnl
-dnl Define HAVE_STRTOLD if "strtold" is declared and links
-dnl Define HAVE_STRTOF if "strtof" is declared and links
-dnl
dnl argument 1 is name of function to check
dnl
dnl ASSUMES argument is a math function with TWO parameters
@@ -623,8 +596,9 @@ dnl 1) make sure the name is declared when using the c++ compiler
dnl 2) make sure the name has "C" linkage
dnl This might seem like overkill but experience has shown that it's not...
dnl
-dnl Define HAVE_STRTOF etc if "strtof" is found.
-dnl Define HAVE_STRTOLD etc if "strtold" is found.
+dnl Define HAVE_STRTOLD if "strtold" is declared and links
+dnl Define HAVE_STRTOF if "strtof" is declared and links
+dnl Define HAVE_DRAND48 if "drand48" is declared and links
dnl
dnl GLIBCPP_CHECK_STDLIB_SUPPORT
AC_DEFUN(GLIBCPP_CHECK_STDLIB_SUPPORT, [
@@ -632,8 +606,8 @@ AC_DEFUN(GLIBCPP_CHECK_STDLIB_SUPPORT, [
ac_save_CXXFLAGS="$CXXFLAGS"
CXXFLAGS='-fno-builtins -D_GNU_SOURCE'
- AC_CHECK_FUNCS(strtof)
GLIBCPP_CHECK_STDLIB_DECL_AND_LINKAGE_2(strtold)
+ AC_CHECK_FUNCS(drand48)
CXXFLAGS="$ac_save_CXXFLAGS"
])
@@ -667,6 +641,7 @@ AC_DEFUN(GLIBCPP_CHECK_MATH_SUPPORT, [
GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_3(sincos)
GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(fpclass)
GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(qfpclass)
+ GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(hypot)
dnl Check to see if basic C math functions have float versions.
GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(float trig,
@@ -679,9 +654,11 @@ AC_DEFUN(GLIBCPP_CHECK_MATH_SUPPORT, [
ceilf floorf)
GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isnanf)
GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isinff)
+ GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(atan2f)
GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(fabsf)
GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(fmodf)
GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(frexpf)
+ GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(hypotf)
GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(ldexpf)
GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(logf)
GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(log10f)
@@ -708,6 +685,7 @@ AC_DEFUN(GLIBCPP_CHECK_MATH_SUPPORT, [
GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(fabsl)
GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(fmodl)
GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(frexpl)
+ GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(hypotl)
GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(ldexpl)
GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(logl)
GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(log10l)
@@ -752,23 +730,22 @@ dnl Check to see if there is native support for complex
dnl
dnl Don't compile bits in math/* if native support exits.
dnl
-dnl Define USE_COMPLEX_LONG_DOUBLE etc if "atan2l/copysignl" is found.
+dnl Define USE_COMPLEX_LONG_DOUBLE etc if "copysignl" is found.
dnl
dnl GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
AC_DEFUN(GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT, [
dnl Check for complex versions of math functions of platform.
AC_CHECK_LIB(m, main)
- AC_REPLACE_MATHFUNCS(nan hypot hypotf atan2f expf copysignf)
+ AC_REPLACE_MATHFUNCS(nan copysignf)
dnl Compile the long double complex functions only if the function
dnl provides the non-complex long double functions that are needed.
- dnl Currently this includes copysignl and atan2l, which should be
+ dnl Currently this includes copysignl, which should be
dnl cached from the GLIBCPP_CHECK_MATH_SUPPORT macro, above.
USE_COMPLEX_LONG_DOUBLE=no
- if test x$ac_cv_func_atan2l = x"yes" \
- && test x$ac_cv_func_copysignl = x"yes"; then
+ if test x$ac_cv_func_copysignl = x"yes"; then
USE_COMPLEX_LONG_DOUBLE=yes
- AC_REPLACE_MATHFUNCS(hypotl signbitl)
+ AC_REPLACE_MATHFUNCS(signbitl)
fi
AC_SUBST(USE_COMPLEX_LONG_DOUBLE)
@@ -784,7 +761,6 @@ AC_DEFUN(GLIBCPP_CHECK_TARGET, [
. [$]{glibcpp_basedir}/configure.target
AC_MSG_RESULT(CPU config directory is $cpu_include_dir)
AC_MSG_RESULT(OS config directory is $os_include_dir)
- AC_LINK_FILES($os_include_dir/bits/os_defines.h, include/bits/os_defines.h)
])
@@ -837,9 +813,19 @@ AC_DEFUN(GLIBCPP_CHECK_WCHAR_T_SUPPORT, [
AC_MSG_RESULT($has_weof)
dnl Tests for wide character functions used in char_traits<wchar_t>.
- AC_CHECK_FUNCS(wcslen wmemchr wmemcmp wmemcpy wmemmove wmemset \
- wcsrtombs mbsrtowcs, ac_wfuncs=yes, ac_wfuncs=no)
+ ac_wfuncs=yes
+ AC_CHECK_FUNCS(wcslen wmemchr wmemcmp wmemcpy wmemmove wmemset,, \
+ ac_wfuncs=no)
+ dnl Checks for names injected into std:: by the c_std headers.
+ AC_CHECK_FUNCS(btowc wctob fgetwc fgetwc fgetws fputwc fputws fwide \
+ fwprintf fwscanf swprintf swscanf vfwprintf vfwscanf vswprintf vswscanf \
+ vwprintf vwscanf wprintf wscanf getwc getwchar mbsinit mbrlen mbrtowc \
+ mbsrtowcs wcsrtombs putwc putwchar ungetwc wcrtomb wcstod wcstof wcstol \
+ wcstoul wcscpy wcsncpy wcscat wcsncat wcscmp wcscoll wcsncmp wcsxfrm \
+ wcscspn wcsspn wcstok wcsftime wcschr wcspbrk wcsrchr wcsstr,, \
+ ac_wfuncs=no)
+
AC_MSG_CHECKING([for ISO C99 wchar_t support])
if test x"$has_weof" = xyes && test x"$has_wchar_minmax" = xyes \
&& test x"$ac_wfuncs" = xyes; then
@@ -877,16 +863,12 @@ AC_DEFUN(GLIBCPP_CHECK_WCHAR_T_SUPPORT, [
dnl above support is present.
AC_MSG_CHECKING([for enabled wchar_t specializations])
if test x"$ac_isoC99_wchar_t" = xyes \
- && test x"$ac_XPG2_wchar_t" = xyes; then
- libinst_wstring_la="libinst-wstring.la"
+ && test x"$ac_XPG2_wchar_t" = xyes; then
AC_DEFINE(_GLIBCPP_USE_WCHAR_T)
AC_MSG_RESULT("yes")
else
- libinst_wstring_la=""
AC_MSG_RESULT("no")
fi
- AC_SUBST(libinst_wstring_la)
-
else
dnl Wide characters disabled by the user.
AC_MSG_WARN([wchar_t support disabled.])
@@ -895,75 +877,6 @@ AC_DEFUN(GLIBCPP_CHECK_WCHAR_T_SUPPORT, [
dnl
-dnl Check to see if this version of GNU C++ is afflicted by bugs in
-dnl __complex__ float support.
-dnl
-dnl Define _GLIBCPP_BUGGY_FLOAT_COMPLEX if buggy.
-dnl
-dnl Check to see if this version of GNU C++ is afflicted by bugs in
-dnl __complex__ support.Check for buggy __complex__ that will cause ICE in
-dnl gcc-2.95.x when using the library, unless we define the default copy
-dnl ctor in the specializations of complex<>.
-dnl
-dnl Define _GLIBCPP_BUGGY_COMPLEX if buggy.
-dnl GLIBCPP_CHECK_COMPLEX_MATH_COMPILER_SUPPORT
-AC_DEFUN(GLIBCPP_CHECK_COMPLEX_MATH_COMPILER_SUPPORT, [
- AC_REQUIRE([AC_PROG_CXX])
-
- AC_MSG_CHECKING([for GNU C++ __complex__ support])
- AC_CACHE_VAL(glibcpp_cv_complex, [
- AC_LANG_SAVE
- AC_LANG_CPLUSPLUS
- AC_TRY_COMPILE([struct dcomplex { __complex__ double x; }; \
- dcomplex f(const dcomplex& x) { return dcomplex(x); }], \
- [ dcomplex x; f(x); ],
- glibcpp_cv_complex=ok,
- glibcpp_cv_complex=buggy
- )
- AC_LANG_RESTORE
- ])
- AC_MSG_RESULT($glibcpp_cv_complex)
- if test $glibcpp_cv_complex = buggy; then
- AC_DEFINE(_GLIBCPP_BUGGY_COMPLEX)
- fi
-
- AC_MSG_CHECKING([for GNU C++ __complex__ float support])
- AC_CACHE_VAL(glibcpp_cv_float_complex, [
- AC_LANG_SAVE
- AC_LANG_CPLUSPLUS
- rm -f conftest.h
- cat > conftest.h <<EOB
- //
- // Check for buggy __complex__ that causes ICE in most versions of egcs
- // and gcc-2.95.x on certain platforms (eg., x86-win32).
- //
- // See http://gcc.gnu.org/ml/gcc-bugs/1999-07n/msg00845.html for
- // more info on the bug itself.
- //
- struct
- float_complex
- {
- __complex__ float m_value;
- float_complex (float = 0.0f, float = 0.0f);
- float_complex (__complex__ float val) : m_value (val) {}
- float_complex foo (const float_complex &val)
- { return float_complex (~val.m_value); }
- };
-EOB
- AC_TRY_COMPILE([#include "conftest.h"], ,
- glibcpp_cv_float_complex=ok,
- glibcpp_cv_float_complex=buggy
- )
- AC_LANG_RESTORE
- ])
- AC_MSG_RESULT($glibcpp_cv_float_complex)
- if test $glibcpp_cv_float_complex = buggy; then
- AC_DEFINE(_GLIBCPP_BUGGY_FLOAT_COMPLEX)
- fi
-])
-
-
-dnl
dnl Check for special debugging mode; not for production use.
dnl
dnl GLIBCPP_ENABLE_DEBUG
@@ -1067,8 +980,8 @@ dnl
AC_DEFUN(GLIBCPP_ENABLE_CLOCALE, [
AC_MSG_CHECKING([for clocale to use])
AC_ARG_ENABLE(clocale,
- [ --enable-clocale enable model for target locale package.
- --enable-clocale=MODEL use MODEL target-speific locale package. [default=generic]
+ [ --enable-clocale enable model for target locale package.
+ --enable-clocale=MODEL use MODEL target-speific locale package. [default=generic]
],
if test x$enable_clocale = xno; then
enable_clocale=generic
@@ -1095,7 +1008,7 @@ AC_DEFUN(GLIBCPP_ENABLE_CLOCALE, [
;;
esac
- AC_LINK_FILES($CLOCALE_H, include/bits/c++locale.h)
+ AC_SUBST(CLOCALE_H)
AC_LINK_FILES($CLOCALE_CC, src/c++locale.cc)
])
@@ -1111,8 +1024,8 @@ dnl
AC_DEFUN(GLIBCPP_ENABLE_CSTDIO, [
AC_MSG_CHECKING([for cstdio to use])
AC_ARG_ENABLE(cstdio,
- [ --enable-cstdio enable stdio for target io package.
- --enable-cstdio=LIB use LIB target-speific io package. [default=stdio]
+ [ --enable-cstdio enable stdio for target io package.
+ --enable-cstdio=LIB use LIB target-speific io package. [default=stdio]
],
if test x$enable_cstdio = xno; then
enable_cstdio=stdio
@@ -1125,7 +1038,8 @@ AC_DEFUN(GLIBCPP_ENABLE_CSTDIO, [
case x${enable_cstdio_flag} in
xlibio)
CSTDIO_H=config/c_io_libio.h
- CSTDIO_CC=config/c_io_libio.cc
+ BASIC_FILE_H=config/basic_file_libio.h
+ BASIC_FILE_CC=config/basic_file_libio.cc
AC_MSG_RESULT(libio)
# see if we are on a system with libio native (ie, linux)
@@ -1181,26 +1095,26 @@ AC_DEFUN(GLIBCPP_ENABLE_CSTDIO, [
xstdio | x | xno | xnone | xyes)
# default
CSTDIO_H=config/c_io_stdio.h
- CSTDIO_CC=config/c_io_stdio.cc
+ BASIC_FILE_H=config/basic_file_stdio.h
+ BASIC_FILE_CC=config/basic_file_stdio.cc
AC_MSG_RESULT(stdio)
# We're not using stdio.
need_libio=no
need_wlibio=no
- # Wide characters are not supported with this package.
- enable_c_mbchar=no
;;
*)
echo "$enable_cstdio is an unknown io package" 1>&2
exit 1
;;
esac
- AC_LINK_FILES($CSTDIO_H, include/bits/c++io.h)
- AC_LINK_FILES($CSTDIO_CC, src/c++io.cc)
+ AC_SUBST(CSTDIO_H)
+ AC_SUBST(BASIC_FILE_H)
+ AC_LINK_FILES($BASIC_FILE_CC, src/basic_file.cc)
# 2000-08-04 bkoz hack
CCODECVT_C=config/c_io_libio_codecvt.c
- AC_LINK_FILES($CCODECVT_C, libio/c_codecvt.c)
+ AC_SUBST(CCODECVT_C)
# 2000-08-04 bkoz hack
AM_CONDITIONAL(GLIBCPP_BUILD_LIBIO,
@@ -1217,82 +1131,235 @@ AC_DEFUN(GLIBCPP_ENABLE_CSTDIO, [
dnl
-dnl Check for which threading library to use.
-dnl
-dnl GLIBCPP_ENABLE_THREADS
-dnl --enable-threads=posix sets config/threads-posix.h et. al.
-dnl
-dnl Default is no threads, which also disables _IO_MTSAFE_IO in
-dnl libio. Any actual thread package will enable it.
+dnl Setup to use the gcc gthr.h thread-specific memory and mutex model.
+dnl We must stage the required headers so that they will be installed
+dnl with the library (unlike libgcc, the STL implementation is provided
+dnl solely within headers). Since we must not inject random user-space
+dnl macro names into user-provided C++ code, we first stage into <file>-in
+dnl and process to <file> with an output command. The reason for a two-
+dnl stage process here is to correctly handle $srcdir!=$objdir without
+dnl having to write complex code (the sed commands to clean the macro
+dnl namespace are complex and fragile enough as it is). We must also
+dnl add a relative path so that -I- is supported properly.
dnl
AC_DEFUN(GLIBCPP_ENABLE_THREADS, [
- dnl Note this comes from the gcc/config.in and libjava/config.in
- dnl Efforts should be made to keep this in sync.
- AC_MSG_CHECKING([for threads package to use])
- AC_ARG_ENABLE(threads,
- [ --enable-threads enable thread usage for target GCC.
- --enable-threads=LIB use LIB thread package for target GCC. [default=no]
- ],
- if test x$enable_threads = xno; then
- enable_threads=''
- fi,
- enable_threads='')
-
- enable_threads_flag=$enable_threads
-
- dnl Check if a valid thread package
- case x${enable_threads_flag} in
- x | xno | xnone)
- # No threads
- target_thread_file='single'
- ;;
- xyes)
- # default
- target_thread_file='posix'
- ;;
- xdecosf1 | xirix | xmach | xos2 | xposix | xpthreads | xsingle | \
- xsolaris | xwin32 | xdce | xvxworks)
- target_thread_file=$enable_threads_flag
- ;;
- *)
- echo "$enable_threads is an unknown thread package" 1>&2
- exit 1
- ;;
- esac
+ AC_MSG_CHECKING([for thread model used by GCC])
+ target_thread_file=`$CC -v 2>&1 | sed -n 's/^Thread model: //p'`
+ AC_MSG_RESULT([$target_thread_file])
+
+ if test $target_thread_file != single; then
+ AC_DEFINE(HAVE_GTHR_DEFAULT)
+ AC_DEFINE(_GLIBCPP_SUPPORTS_WEAK, __GXX_WEAK__)
+ fi
+
+ glibcpp_thread_h=gthr-$target_thread_file.h
+ AC_SUBST(glibcpp_thread_h)
+])
+
+
+dnl
+dnl Check for exception handling support. If an explicit enable/disable
+dnl sjlj exceptions is given, we don't have to detect. Otherwise the
+dnl target may or may not support call frame exceptions.
+dnl
+dnl GLIBCPP_ENABLE_SJLJ_EXCEPTIONS
+dnl --enable-sjlj-exceptions forces the use of builtin setjmp.
+dnl --disable-sjlj-exceptions forces the use of call frame unwinding.
+dnl
+dnl Define _GLIBCPP_SJLJ_EXCEPTIONS if the compiler is configured for it.
+dnl
+AC_DEFUN(GLIBCPP_ENABLE_SJLJ_EXCEPTIONS, [
+ AC_MSG_CHECKING([for exception model to use])
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ AC_ARG_ENABLE(sjlj-exceptions,
+ [ --enable-sjlj-exceptions force use of builtin_setjmp for exceptions],
+ [:],
+ [dnl Botheration. Now we've got to detect the exception model.
+ dnl Link tests against libgcc.a are problematic since -- at least
+ dnl as of this writing -- we've not been given proper -L bits for
+ dnl single-tree newlib and libgloss.
+ dnl
+ dnl This is what AC_TRY_COMPILE would do if it didn't delete the
+ dnl conftest files before we got a change to grep them first.
+ cat > conftest.$ac_ext << EOF
+[#]line __oline__ "configure"
+struct S { ~S(); };
+void bar();
+void foo()
+{
+ S s;
+ bar();
+}
+EOF
+ old_CXXFLAGS="$CXXFLAGS"
+ CXXFLAGS=-S
+ if AC_TRY_EVAL(ac_compile); then
+ if grep _Unwind_SjLj_Resume conftest.s >/dev/null 2>&1 ; then
+ enable_sjlj_exceptions=yes
+ elif grep _Unwind_Resume conftest.s >/dev/null 2>&1 ; then
+ enable_sjlj_exceptions=no
+ fi
+ fi
+ CXXFLAGS="$old_CXXFLAGS"
+ rm -f conftest*])
+ if test x$enable_sjlj_exceptions = xyes; then
+ AC_DEFINE(_GLIBCPP_SJLJ_EXCEPTIONS, 1,
+ [Define if the compiler is configured for setjmp/longjmp exceptions.])
+ ac_exception_model_name=sjlj
+ elif test x$enable_sjlj_exceptions = xno; then
+ ac_exception_model_name="call frame"
+ else
+ AC_MSG_ERROR([unable to detect exception model])
+ fi
+ AC_LANG_RESTORE
+ AC_MSG_RESULT($ac_exception_model_name)
+])
- dnl Check for thread package actually supported in libstdc++
- THREADH=
- case "$target_thread_file" in
- no | none | single)
- THREADH=threads-no.h
- ;;
- posix | pthreads)
- THREADH=threads-posix.h
- ;;
- decosf1 | irix | mach | os2 | solaris | win32 | dce | vxworks)
- AC_MSG_ERROR(thread package $THREADS not yet supported)
- ;;
- *)
- AC_MSG_ERROR($THREADS is an unsupported/unknown thread package)
- ;;
- esac
- AC_MSG_RESULT($THREADH)
- AC_LINK_FILES(config/$THREADH, include/bits/c++threads.h)
- if test $THREADH != threads-no.h; then
- AC_DEFINE(_GLIBCPP_USE_THREADS)
+dnl
+dnl Check for ISO/IEC 9899:1999 "C99" support.
+dnl
+dnl GLIBCPP_ENABLE_C99
+dnl --enable-c99 defines _GLIBCPP_USE_C99
+dnl --disable-c99 leaves _GLIBCPP_USE_C99 undefined
+dnl + Usage: GLIBCPP_ENABLE_C99[(DEFAULT)]
+dnl Where DEFAULT is either `yes' or `no'. If omitted, it
+dnl defaults to `no'.
+dnl + If 'C99' stuff is not available, ignores DEFAULT and sets `no'.
+dnl
+dnl GLIBCPP_ENABLE_C99
+AC_DEFUN(GLIBCPP_ENABLE_C99, [dnl
+ define([GLIBCPP_ENABLE_C99_DEFAULT], ifelse($1, yes, yes, no))dnl
+
+ AC_ARG_ENABLE(c99,
+ changequote(<<, >>)dnl
+ <<--enable-c99 turns on 'ISO/IEC 9899:1999 support' [default=>>GLIBCPP_ENABLE_C99_DEFAULT],
+ changequote([, ])dnl
+ [case "$enableval" in
+ yes) enable_c99=yes ;;
+ no) enable_c99=no ;;
+ *) AC_MSG_ERROR([Unknown argument to enable/disable C99]) ;;
+ esac],
+ enable_c99=GLIBCPP_ENABLE_C99_DEFAULT)dnl
+
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+
+ # Check for the existence of <math.h> functions used if C99 is enabled.
+ ac_c99_math=yes;
+ AC_MSG_CHECKING([for ISO C99 support in <math.h>])
+ AC_TRY_COMPILE([#include <math.h>],[fpclassify(0.0);],, [ac_c99_math=no])
+ AC_TRY_COMPILE([#include <math.h>],[isfinite(0.0);],, [ac_c99_math=no])
+ AC_TRY_COMPILE([#include <math.h>],[isinf(0.0);],, [ac_c99_math=no])
+ AC_TRY_COMPILE([#include <math.h>],[isnan(0.0);],, [ac_c99_math=no])
+ AC_TRY_COMPILE([#include <math.h>],[isnormal(0.0);],, [ac_c99_math=no])
+ AC_TRY_COMPILE([#include <math.h>],[signbit(0.0);],, [ac_c99_math=no])
+ AC_TRY_COMPILE([#include <math.h>],[isgreater(0.0,0.0);],, [ac_c99_math=no])
+ AC_TRY_COMPILE([#include <math.h>],
+ [isgreaterequal(0.0,0.0);],, [ac_c99_math=no])
+ AC_TRY_COMPILE([#include <math.h>],[isless(0.0,0.0);],, [ac_c99_math=no])
+ AC_TRY_COMPILE([#include <math.h>],[islessequal(0.0,0.0);],,[ac_c99_math=no])
+ AC_TRY_COMPILE([#include <math.h>],
+ [islessgreater(0.0,0.0);],, [ac_c99_math=no])
+ AC_TRY_COMPILE([#include <math.h>],
+ [isunordered(0.0,0.0);],, [ac_c99_math=no])
+ AC_MSG_RESULT($ac_c99_math)
+
+ # Check for the existence in <stdio.h> of vscanf, et. al.
+ ac_c99_stdio=yes;
+ AC_MSG_CHECKING([for ISO C99 support in <stdio.h>])
+ AC_TRY_COMPILE([#include <stdio.h>],
+ [snprintf("12", 0, "%i");],, [ac_c99_stdio=no])
+ AC_TRY_COMPILE([#include <stdio.h>
+ #include <stdarg.h>
+ void foo(char* fmt, ...)
+ {va_list args; va_start(args, fmt);
+ vfscanf(stderr, "%i", args);}],
+ [],, [ac_c99_stdio=no])
+ AC_TRY_COMPILE([#include <stdio.h>
+ #include <stdarg.h>
+ void foo(char* fmt, ...)
+ {va_list args; va_start(args, fmt);
+ vscanf("%i", args);}],
+ [],, [ac_c99_stdio=no])
+ AC_TRY_COMPILE([#include <stdio.h>
+ #include <stdarg.h>
+ void foo(char* fmt, ...)
+ {va_list args; va_start(args, fmt);
+ vsnprintf(fmt, 0, "%i", args);}],
+ [],, [ac_c99_stdio=no])
+ AC_TRY_COMPILE([#include <stdio.h>
+ #include <stdarg.h>
+ void foo(char* fmt, ...)
+ {va_list args; va_start(args, fmt);
+ vsscanf(fmt, "%i", args);}],
+ [],, [ac_c99_stdio=no])
+ AC_MSG_RESULT($ac_c99_stdio)
+
+ # Check for the existence in <stdlib.h> of lldiv_t, et. al.
+ ac_c99_stdlib=yes;
+ AC_MSG_CHECKING([for lldiv_t declaration])
+ AC_CACHE_VAL(ac_c99_lldiv_t, [
+ AC_TRY_COMPILE([#include <stdlib.h>],
+ [ lldiv_t mydivt;],
+ [ac_c99_lldiv_t=yes], [ac_c99_lldiv_t=no])
+ ])
+ AC_MSG_RESULT($ac_c99_lldiv_t)
+
+ AC_MSG_CHECKING([for ISO C99 support in <stdlib.h>])
+ AC_TRY_COMPILE([#include <stdlib.h>],
+ [char* tmp; strtof("gnu", &tmp);],, [ac_c99_stdlib=no])
+ AC_TRY_COMPILE([#include <stdlib.h>],
+ [char* tmp; strtold("gnu", &tmp);],, [ac_c99_stdlib=no])
+ AC_TRY_COMPILE([#include <stdlib.h>], [llabs(10);],, [ac_c99_stdlib=no])
+ AC_TRY_COMPILE([#include <stdlib.h>], [lldiv(10,1);],, [ac_c99_stdlib=no])
+ AC_TRY_COMPILE([#include <stdlib.h>], [atoll("10");],, [ac_c99_stdlib=no])
+ AC_TRY_COMPILE([#include <stdlib.h>], [_Exit(0);],, [ac_c99_stdlib=no])
+ if test x"$ac_c99_lldiv_t" = x"no"; then
+ ac_c99_stdlib=no;
+ fi;
+ AC_MSG_RESULT($ac_c99_stdlib)
+
+ # Check for the existence of <wchar.h> functions used if C99 is enabled.
+ # XXX the wchar.h checks should be rolled into the general C99 bits.
+ ac_c99_wchar=yes;
+ AC_MSG_CHECKING([for additional ISO C99 support in <wchar.h>])
+ AC_TRY_COMPILE([#include <wchar.h>],
+ [wcstold(L"10.0", NULL);],, [ac_c99_wchar=no])
+ AC_TRY_COMPILE([#include <wchar.h>],
+ [wcstoll(L"10", NULL, 10);],, [ac_c99_wchar=no])
+ AC_TRY_COMPILE([#include <wchar.h>],
+ [wcstoull(L"10", NULL, 10);],, [ac_c99_wchar=no])
+ AC_MSG_RESULT($ac_c99_wchar)
+
+ AC_MSG_CHECKING([for enabled ISO C99 support])
+ if test x"$ac_c99_math" = x"no" || test x"$ac_c99_stdio" = x"no" \
+ || test x"$ac_c99_stdlib" = x"no" \
+ || test x"$ac_c99_wchar" = x"no"; then
+ enable_c99=no;
+ fi;
+ AC_MSG_RESULT($enable_c99)
+
+ # Option parsed, now set things appropriately
+ if test x"$enable_c99" = x"yes"; then
+ AC_DEFINE(_GLIBCPP_USE_C99)
fi
+
+ AC_LANG_RESTORE
])
dnl
dnl Check for template specializations for the 'long long' type extension.
+dnl The result determines only whether 'long long' I/O is enabled; things
+dnl like numeric_limits<> specializations are always available.
dnl
dnl GLIBCPP_ENABLE_LONG_LONG
dnl --enable-long-long defines _GLIBCPP_USE_LONG_LONG
dnl --disable-long-long leaves _GLIBCPP_USE_LONG_LONG undefined
dnl + Usage: GLIBCPP_ENABLE_LONG_LONG[(DEFAULT)]
-dnl Where DEFAULT is either `yes' or `no'. If ommitted, it
+dnl Where DEFAULT is either `yes' or `no'. If omitted, it
dnl defaults to `no'.
dnl + If 'long long' stuff is not available, ignores DEFAULT and sets `no'.
dnl
@@ -1310,44 +1377,24 @@ AC_DEFUN(GLIBCPP_ENABLE_LONG_LONG, [dnl
*) AC_MSG_ERROR([Unknown argument to enable/disable long long]) ;;
esac],
enable_long_long=GLIBCPP_ENABLE_LONG_LONG_DEFAULT)dnl
-
- # Allow use of os-dependent settings, so that macros that turn on
- # C99 capabilities can be defined and used in a consistent way.
- OS_INC_PATH=${srcdir}/$os_include_dir
- ac_test_CFLAGS="${CFLAGS+set}"
- ac_save_CFLAGS="$CFLAGS"
- CFLAGS="-I$OS_INC_PATH"
-
- # Check for the existence of functions used if long long is enabled.
- AC_CHECK_FUNC(strtoll,,ac_strtoll=no)
- AC_CHECK_FUNC(strtoull,,ac_strtoull=no)
- # Check for lldiv_t, et. al.
- AC_MSG_CHECKING([for lldiv_t declaration])
- AC_CACHE_VAL(glibcpp_lldiv_t_use, [
- AC_TRY_COMPILE([#include <bits/os_defines.h>
- #include <stdlib.h>],
- [ lldiv_t mydivt;],
- [glibcpp_lldiv_t_use=yes], [glibcpp_lldiv_t_use=no])
- ])
- AC_MSG_RESULT($glibcpp_lldiv_t_use)
- if test x$glibcpp_lldiv_t_use = x"yes"; then
- AC_DEFINE(HAVE_LLDIV_T)
- fi
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
- AC_MSG_CHECKING([for enabled long long])
- if test x"$ac_strtoll" = xno || test x"$ac_strtoull" = xno; then
- enable_long_long=no;
- fi;
- AC_MSG_RESULT($enable_long_long)
+ AC_MSG_CHECKING([for enabled long long I/O support])
+ # iostreams require strtoll, strtoull to compile
+ AC_TRY_COMPILE([#include <stdlib.h>],
+ [char* tmp; strtoll("gnu", &tmp, 10);],,[enable_long_long=no])
+ AC_TRY_COMPILE([#include <stdlib.h>],
+ [char* tmp; strtoull("gnu", &tmp, 10);],,[enable_long_long=no])
# Option parsed, now set things appropriately
if test x"$enable_long_long" = xyes; then
AC_DEFINE(_GLIBCPP_USE_LONG_LONG)
fi
+ AC_MSG_RESULT($enable_long_long)
- # Reset CFLAGS
- CFLAGS="$ac_save_CFLAGS"
+ AC_LANG_RESTORE
])
@@ -1366,8 +1413,7 @@ define([GLIBCPP_ENABLE_CHEADERS_DEFAULT], ifelse($1, c_std, c_std, c_std))dnl
AC_MSG_CHECKING([for c header strategy to use])
AC_ARG_ENABLE(cheaders,
changequote(<<, >>)dnl
-<< --enable-cheaders construct "C" header files for
- g++ [default=>>GLIBCPP_ENABLE_CHEADERS_DEFAULT],
+<< --enable-cheaders construct "C" header files for g++ [default=>>GLIBCPP_ENABLE_CHEADERS_DEFAULT],
changequote([, ])
[case "$enableval" in
c)
@@ -1389,16 +1435,16 @@ changequote([, ])
case "$enable_cheaders" in
c_shadow)
CSHADOW_FLAGS="-fno-builtin"
- C_INCLUDE_DIR='${top_srcdir}/include/c_shadow'
+ C_INCLUDE_DIR='${glibcpp_srcdir}/include/c_shadow'
AC_DEFINE(_GLIBCPP_USE_SHADOW_HEADERS)
;;
c_std)
CSHADOW_FLAGS=""
- C_INCLUDE_DIR='${top_srcdir}/include/c_std'
+ C_INCLUDE_DIR='${glibcpp_srcdir}/include/c_std'
;;
c)
CSHADOW_FLAGS=""
- C_INCLUDE_DIR='${top_srcdir}/include/c'
+ C_INCLUDE_DIR='${glibcpp_srcdir}/include/c'
;;
esac
@@ -1437,25 +1483,19 @@ dnl Option parsed, now other scripts can test enable_c_mbchar for yes/no.
dnl
dnl Set up *_INCLUDES and *_INCLUDE_DIR variables for all sundry Makefile.am's.
dnl
-dnl GLIBCPP_INCLUDE_DIR
-dnl C_INCLUDE_DIR
dnl TOPLEVEL_INCLUDES
dnl LIBMATH_INCLUDES
dnl LIBSUPCXX_INCLUDES
dnl LIBIO_INCLUDES
dnl CSHADOW_INCLUDES
dnl
-dnl GLIBCPP_EXPORT_INCLUDE
+dnl GLIBCPP_EXPORT_INCLUDES
AC_DEFUN(GLIBCPP_EXPORT_INCLUDES, [
- # Root level of the include sources.
- GLIBCPP_INCLUDE_DIR='$(top_srcdir)/include'
+ # Root level of the build directory include sources.
+ GLIBCPP_INCLUDES="-I${glibcpp_builddir}/include/${target_alias} -I${glibcpp_builddir}/include"
- # Can either use include/c or include/c_std to grab "C" headers. This
- # variable is set to the include directory currently in use.
- # set with C_INCLUDE_DIR in GLIBCPP_ENABLE_CHEADERS
-
# Passed down for canadian crosses.
- if test x"$CANADIAN" = xyes; then
+ if test x"$CANADIAN" = xyes; then
TOPLEVEL_INCLUDES='-I$(includedir)'
fi
@@ -1463,26 +1503,16 @@ AC_DEFUN(GLIBCPP_EXPORT_INCLUDES, [
LIBSUPCXX_INCLUDES='-I$(top_srcdir)/libsupc++'
- #if GLIBCPP_NEED_LIBIO
- LIBIO_INCLUDES='-I$(top_builddir)/libio -I$(top_srcdir)/libio'
- #else
- #LIBIO_INCLUDES='-I$(top_srcdir)/libio'
- #endif
-
- #if GLIBCPP_USE_CSHADOW
- # CSHADOW_INCLUDES='-I$(GLIBCPP_INCLUDE_DIR)/std -I$(C_INCLUDE_DIR) \
- # -I$(top_blddir)/cshadow'
- #else
- CSTD_INCLUDES='-I$(GLIBCPP_INCLUDE_DIR)/std -I$(C_INCLUDE_DIR)'
- #endif
+ if test x"$need_libio" = xyes; then
+ LIBIO_INCLUDES='-I$(top_builddir)/libio -I$(top_srcdir)/libio'
+ AC_SUBST(LIBIO_INCLUDES)
+ fi
# Now, export this to all the little Makefiles....
- AC_SUBST(GLIBCPP_INCLUDE_DIR)
+ AC_SUBST(GLIBCPP_INCLUDES)
AC_SUBST(TOPLEVEL_INCLUDES)
AC_SUBST(LIBMATH_INCLUDES)
AC_SUBST(LIBSUPCXX_INCLUDES)
- AC_SUBST(LIBIO_INCLUDES)
- AC_SUBST(CSTD_INCLUDES)
])
@@ -1505,6 +1535,9 @@ dnl GLIBCPP_EXPORT_INSTALL_INFO
dnl calculates gxx_install_dir
dnl exports glibcpp_toolexecdir
dnl exports glibcpp_toolexeclibdir
+dnl exports glibcpp_builddir
+dnl exports glibcpp_srcdir
+dnl exports glibcpp_prefixdir
dnl
dnl Assumes cross_compiling bits already done, and with_cross_host in
dnl particular
@@ -1515,6 +1548,17 @@ AC_DEFUN(GLIBCPP_EXPORT_INSTALL_INFO, [
glibcpp_toolexecdir=no
glibcpp_toolexeclibdir=no
+# Export build and source directories.
+# These need to be absolute paths, yet at the same time need to
+# canonicalize only relative paths, because then amd will not unmount
+# drives. Thus the use of PWDCMD: set it to 'pawd' or 'amq -w' if using amd.
+glibcpp_builddir=`pwd`
+case $srcdir in
+[\\/$]* | ?:[\\/]*) glibcpp_srcdir=${srcdir} ;;
+*) glibcpp_srcdir=`cd "$srcdir" && ${PWDCMD-pwd} || echo "$srcdir"` ;;
+esac
+glibcpp_prefixdir=${prefix}
+
AC_MSG_CHECKING([for interface version number])
libstdcxx_interface=$INTERFACE
AC_MSG_RESULT($libstdcxx_interface)
@@ -1522,7 +1566,7 @@ AC_MSG_RESULT($libstdcxx_interface)
# Process the option --with-gxx-include-dir=<path to include-files directory>
AC_MSG_CHECKING([for --with-gxx-include-dir])
AC_ARG_WITH(gxx-include-dir,
-[ --with-gxx-include-dir the installation directory for include files],
+[ --with-gxx-include-dir the installation directory for include files],
[case "${withval}" in
yes)
AC_MSG_ERROR(Missing directory for --with-gxx-include-dir)
@@ -1541,31 +1585,39 @@ AC_MSG_RESULT($gxx_include_dir)
AC_MSG_CHECKING([for --enable-version-specific-runtime-libs])
AC_ARG_ENABLE(version-specific-runtime-libs,
[ --enable-version-specific-runtime-libs Specify that runtime libraries should be installed in a compiler-specific directory ],
-[ version_specific_libs=yes
-# Need the gcc compiler version to know where to install libraries
-# and header files if --enable-version-specific-runtime-libs option
-# is selected.
-changequote(,)dnl
-gcc_version_trigger=${srcdir}/../gcc/version.c
-gcc_version_full=`grep version_string ${gcc_version_trigger} | sed -e 's/.*\"\([^\"]*\)\".*/\1/'`
-gcc_version=`echo ${gcc_version_full} | sed -e 's/\([^ ]*\) .*/\1/'`
-gxx_include_dir='$(libdir)/gcc-lib/$(target_alias)/'${gcc_version}/include/g++
-glibcpp_toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
-glibcpp_toolexeclibdir='$(toolexecdir)/'${gcc_version}
-changequote([,])dnl
-],version_specific_libs=no)
+[case "$enableval" in
+ yes) version_specific_libs=yes ;;
+ no) version_specific_libs=no ;;
+ *) AC_MSG_ERROR([Unknown argument to enable/disable version-specific libs]);;
+ esac],
+version_specific_libs=no)dnl
+# Option set, now we can test it.
AC_MSG_RESULT($version_specific_libs)
+if test $version_specific_libs = yes; then
+ # Need the gcc compiler version to know where to install libraries
+ # and header files if --enable-version-specific-runtime-libs option
+ # is selected.
+ changequote(,)dnl
+ gcc_version_trigger=${srcdir}/../gcc/version.c
+ gcc_version_full=`grep version_string ${gcc_version_trigger} | sed -e 's/.*\"\([^\"]*\)\".*/\1/'`
+ gcc_version=`echo ${gcc_version_full} | sed -e 's/\([^ ]*\) .*/\1/'`
+ gxx_include_dir='$(libdir)/gcc-lib/$(target_alias)/'${gcc_version}/include/g++
+ glibcpp_toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
+ glibcpp_toolexeclibdir='$(toolexecdir)/'${gcc_version}'$(MULTISUBDIR)'
+ changequote([,])dnl
+fi
+
# Default case for install directory for include files.
-if test x"$version_specific_libs" = x"no" \
- && test x"$gxx_include_dir"=x"no"; then
+if test $version_specific_libs = no &&
+ test $gxx_include_dir = no; then
gxx_include_dir='$(prefix)'/include/g++-${libstdcxx_interface}
fi
# Calculate glibcpp_toolexecdir, glibcpp_toolexeclibdir
# Install a library built with a cross compiler in tooldir, not libdir.
if test x"$glibcpp_toolexecdir" = x"no"; then
- if test x"$with_cross_host" = x"yes"; then
+ if test -n "$with_cross_host" && test x"$with_cross_host" != x"no"; then
glibcpp_toolexecdir='$(exec_prefix)/$(target_alias)'
glibcpp_toolexeclibdir='$(toolexecdir)/lib$(MULTISUBDIR)'
else
@@ -1577,6 +1629,9 @@ fi
AC_MSG_CHECKING([for install location])
AC_MSG_RESULT($gxx_include_dir)
+AC_SUBST(glibcpp_builddir)
+AC_SUBST(glibcpp_srcdir)
+AC_SUBST(glibcpp_prefixdir)
AC_SUBST(gxx_include_dir)
AC_SUBST(glibcpp_toolexecdir)
AC_SUBST(glibcpp_toolexeclibdir)
@@ -1708,6 +1763,62 @@ dnl string, '#' otherwise
AC_SUBST(ifGNUmake)
])
+
+dnl Check for headers for, and arguments to, the setrlimit() function.
+dnl Used only in testsuite_hooks.h.
+AC_DEFUN(GLIBCPP_CHECK_SETRLIMIT_ancilliary, [
+ AC_TRY_COMPILE([#include <sys/resource.h>
+ #include <unistd.h>
+ ], [ int f = RLIMIT_$1 ; ],
+ [glibcpp_mresult=1], [glibcpp_mresult=0])
+ AC_DEFINE_UNQUOTED(HAVE_MEMLIMIT_$1, $glibcpp_mresult,
+ [Only used in build directory testsuite_hooks.h.])
+])
+AC_DEFUN(GLIBCPP_CHECK_SETRLIMIT, [
+ setrlimit_have_headers=yes
+ AC_CHECK_HEADERS(sys/resource.h unistd.h,
+ [],
+ setrlimit_have_headers=no)
+ # If don't have the headers, then we can't run the tests now, and we
+ # won't be seeing any of these during testsuite compilation.
+ if test $setrlimit_have_headers = yes; then
+ # Can't do these in a loop, else the resulting syntax is wrong.
+ GLIBCPP_CHECK_SETRLIMIT_ancilliary(DATA)
+ GLIBCPP_CHECK_SETRLIMIT_ancilliary(RSS)
+ GLIBCPP_CHECK_SETRLIMIT_ancilliary(VMEM)
+ GLIBCPP_CHECK_SETRLIMIT_ancilliary(AS)
+
+ # Check for rlimit, setrlimit.
+ AC_CACHE_VAL(ac_setrlimit, [
+ AC_TRY_COMPILE([#include <sys/resource.h>
+ #include <unistd.h>
+ ],
+ [ struct rlimit r; setrlimit(0, &r);],
+ [ac_setrlimit=yes], [ac_setrlimit=no])
+ ])
+ fi
+
+ AC_MSG_CHECKING([for testsuite memory limit support])
+ if test $setrlimit_have_headers = yes && test $ac_setrlimit = yes; then
+ ac_mem_limits=yes
+ AC_DEFINE(_GLIBCPP_MEM_LIMITS)
+ else
+ ac_mem_limits=no
+ fi
+ AC_MSG_RESULT($ac_mem_limits)
+])
+
+
+dnl
+dnl Does any necessary configuration of the testsuite directory. Generates
+dnl the testsuite_hooks.h header.
+dnl
+dnl GLIBCPP_CONFIGURE_TESTSUITE [no args]
+AC_DEFUN(GLIBCPP_CONFIGURE_TESTSUITE, [
+ GLIBCPP_CHECK_SETRLIMIT
+])
+
+
sinclude(../libtool.m4)
dnl The lines below arrange for aclocal not to bring an installed
dnl libtool.m4 into aclocal.m4, while still arranging for automake to
@@ -1718,3 +1829,4 @@ AC_DEFUN([AC_LIBTOOL_DLOPEN])
AC_DEFUN([AC_PROG_LD])
])
+
diff --git a/libstdc++-v3/aclocal.m4 b/libstdc++-v3/aclocal.m4
index cdaa89147cd..016fe1dcdc6 100644
--- a/libstdc++-v3/aclocal.m4
+++ b/libstdc++-v3/aclocal.m4
@@ -1,6 +1,6 @@
-dnl aclocal.m4 generated automatically by aclocal 1.4
+dnl aclocal.m4 generated automatically by aclocal 1.4-p5
-dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
+dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -13,8 +13,6 @@ dnl PARTICULAR PURPOSE.
dnl
dnl Initialize configure bits.
dnl
-dnl Define OPTLEVEL='-O2' if new inlining code present.
-dnl
dnl GLIBCPP_CONFIGURE
AC_DEFUN(GLIBCPP_CONFIGURE, [
dnl Default to --enable-multilib
@@ -26,10 +24,10 @@ AC_DEFUN(GLIBCPP_CONFIGURE, [
*) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;;
esac], [multilib=yes])dnl
- glibcpp_basedir=$auxdir/$1/libstdc++-v3
+ glibcpp_basedir=$srcdir/$toprel/$1/libstdc++-v3
AC_SUBST(glibcpp_basedir)
- AM_INIT_AUTOMAKE(libstdc++, 2.90.8)
+ AM_INIT_AUTOMAKE(libstdc++, 3.0.0)
# Never versions of autoconf add an underscore to these functions.
# Prevent future problems ...
@@ -90,15 +88,15 @@ AC_DEFUN(LIB_AC_PROG_CXX,
[AC_BEFORE([$0], [AC_PROG_CXXCPP])dnl
dnl Fool anybody using AC_PROG_CXX.
AC_PROVIDE([AC_PROG_CXX])
-# Use CXX_libstdcxx so that we do not cause CXX to be cached with the
+# Use glibcpp_CXX so that we do not cause CXX to be cached with the
# flags that come in CXX while configuring libstdc++. They're different
# from those used for all other target libraries. If CXX is set in
# the environment, respect that here.
-CXX_libstdcxx=$CXX
-AC_CHECK_PROGS(CXX_libstdcxx, $CCC c++ g++ gcc CC cxx cc++, gcc)
-CXX=$CXX_libstdcxx
-AC_SUBST(CXX)
-test -z "$CXX" && AC_MSG_ERROR([no acceptable c++ found in \$PATH])
+glibcpp_CXX=$CXX
+AC_CHECK_PROGS(glibcpp_CXX, $CCC c++ g++ gcc CC cxx cc++, gcc)
+AC_SUBST(glibcpp_CXX)
+CXX=$glibcpp_CXX
+test -z "$glibcpp_CXX" && AC_MSG_ERROR([no acceptable c++ found in \$PATH])
AC_PROG_CXX_GNU
@@ -128,8 +126,7 @@ LIB_AC_PROG_CXX
AC_CHECK_TOOL(AS, as)
AC_CHECK_TOOL(AR, ar)
- AC_CHECK_TOOL(RANLIB, ranlib, :)
-
+ AC_CHECK_TOOL(RANLIB, ranlib, ranlib-not-found-in-path-error)
AC_PROG_INSTALL
AM_MAINTAINER_MODE
@@ -142,15 +139,13 @@ LIB_AC_PROG_CXX
# automake happy, but we dont execute it, since we dont care about
# the result.
if false; then
+ # autoconf 2.50 runs AC_EXEEXT by default, and the macro expands
+ # to nothing, so nothing would remain between `then' and `fi' if it
+ # were not for the `:' below.
+ :
AC_EXEEXT
fi
- # configure.host sets the following important variables
- # glibcpp_cflags - host specific C compiler flags
- # glibcpp_cxxflags - host specific C++ compiler flags
- glibcpp_cflags=
- glibcpp_cxxflags=
-
. [$]{glibcpp_basedir}/configure.host
case [$]{glibcpp_basedir} in
@@ -159,13 +154,8 @@ LIB_AC_PROG_CXX
esac
# This does for the target what configure.host does for the host. In
- # addition to modifying the same flags, it also sets up symlinks.
+ # addition to possibly modifying the same flags, it also sets up symlinks.
GLIBCPP_CHECK_TARGET
-
- GLIBCPP_CFLAGS="[$]{glibcpp_cflags}"
- GLIBCPP_CXXFLAGS="[$]{glibcpp_cxxflags}"
- AC_SUBST(GLIBCPP_CFLAGS)
- AC_SUBST(GLIBCPP_CXXFLAGS)
])
@@ -179,11 +169,11 @@ if test ! -f stamp-sanity-compiler; then
AC_MSG_CHECKING([for g++ that will successfully compile libstdc++-v3])
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
- AC_EGREP_CPP(ok, [
- #if (__GNUC__ > 2) || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)
- ok
+ AC_TRY_COMPILE(, [
+ #if __GNUC__ < 3
+ not_ok
#endif
- ], gpp_satisfactory=yes, AC_MSG_ERROR([please upgrade to gcc-2.95 or above]))
+ ], gpp_satisfactory=yes, AC_MSG_ERROR([please upgrade to GCC 3.0 or above]))
AC_LANG_RESTORE
AC_MSG_RESULT($gpp_satisfactory)
touch stamp-sanity-compiler
@@ -192,22 +182,21 @@ fi
dnl
-dnl Test for newer compiler features, or features that are present in newer
-dnl compiler version but not older compiler versions should be placed
-dnl here.
+dnl Tests for newer compiler features, or features that are present in newer
+dnl compiler versions but not older compiler versions still in use, should
+dnl be placed here.
dnl
-dnl Define WFMT_FLAGS='-fdiagnostics-show-location=once' if possible
-dnl
dnl Define WERROR='-Werror' if requested and possible; g++'s that lack the
dnl new inlining code or the new system_header pragma will die on -Werror.
dnl Leave it out by default and use maint-mode to use it.
dnl
dnl Define SECTION_FLAGS='-ffunction-sections -fdata-sections' if
-dnl compiler supports it.
+dnl compiler supports it and the user has not requested debug mode.
+dnl
dnl GLIBCPP_CHECK_COMPILER_FEATURES
AC_DEFUN(GLIBCPP_CHECK_COMPILER_FEATURES, [
# All these tests are for C++; save the language and the compiler flags.
- # The CXXFLAGS thing is suspicious, but based on similar bits
+ # The CXXFLAGS thing is suspicious, but based on similar bits previously
# found in GLIBCPP_CONFIGURE.
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
@@ -221,22 +210,6 @@ AC_DEFUN(GLIBCPP_CHECK_COMPILER_FEATURES, [
WERROR='-Werror'
fi
- # Check for more sophisticated diagnostic control.
- AC_MSG_CHECKING([for g++ that supports -fdiagnostics-show-location=once])
- CXXFLAGS='-Werror -fdiagnostics-show-location=once'
- AC_TRY_COMPILE(, [int foo;
- ], [ac_gabydiags=yes], [ac_gabydiags=no])
- if test "$ac_test_CXXFLAGS" = set; then
- CXXFLAGS="$ac_save_CXXFLAGS"
- else
- # this is the suspicious part
- CXXFLAGS=''
- fi
- if test x"$ac_gabydiags" = x"yes"; then
- WFMT_FLAGS='-fdiagnostics-show-location=once'
- fi
- AC_MSG_RESULT($ac_gabydiags)
-
# Check for -ffunction-sections -fdata-sections
AC_MSG_CHECKING([for g++ that supports -ffunction-sections -fdata-sections])
CXXFLAGS='-Werror -ffunction-sections -fdata-sections'
@@ -255,7 +228,6 @@ AC_DEFUN(GLIBCPP_CHECK_COMPILER_FEATURES, [
AC_LANG_RESTORE
AC_SUBST(WERROR)
- AC_SUBST(WFMT_FLAGS)
AC_SUBST(SECTION_FLAGS)
])
@@ -273,8 +245,8 @@ AC_DEFUN(GLIBCPP_CHECK_LINKER_FEATURES, [
# If we're not using GNU ld, then there's no point in even trying these
# tests. Check for that first. We should have already tested for gld
# by now (in libtool), but require it now just to be safe...
- SECTION_LDFLAGS=''
- OPT_LDFLAGS=''
+ test -z "$SECTION_LDFLAGS" && SECTION_LDFLAGS=''
+ test -z "$OPT_LDFLAGS" && OPT_LDFLAGS=''
AC_REQUIRE([AC_PROG_LD])
# Set --gc-sections.
@@ -302,7 +274,7 @@ AC_DEFUN(GLIBCPP_CHECK_LINKER_FEATURES, [
catch (...) { };
return 0;
}
- ], [ac_sectionLDflags=yes],[ac_sectionLFflags=no], [ac_sectionLDflags=yes])
+ ], [ac_sectionLDflags=yes],[ac_sectionLDflags=no], [ac_sectionLDflags=yes])
if test "$ac_test_CFLAGS" = set; then
CFLAGS="$ac_save_CFLAGS"
else
@@ -310,14 +282,14 @@ AC_DEFUN(GLIBCPP_CHECK_LINKER_FEATURES, [
CFLAGS=''
fi
if test "$ac_sectionLDflags" = "yes"; then
- SECTION_LDFLAGS='-Wl,--gc-sections'
+ SECTION_LDFLAGS="-Wl,--gc-sections $SECTION_LDFLAGS"
fi
AC_MSG_RESULT($ac_sectionLDflags)
fi
# Set linker optimization flags.
if test x"$ac_cv_prog_gnu_ld" = x"yes" && test x"$enable_debug" = x"no"; then
- OPT_LDFLAGS='-Wl,-O1'
+ OPT_LDFLAGS="-Wl,-O1 $OPT_LDFLAGS"
fi
AC_SUBST(SECTION_LDFLAGS)
@@ -337,7 +309,11 @@ AC_DEFUN(GLIBCPP_CHECK_MATH_DECL_1, [
AC_CACHE_VAL(glibcpp_cv_func_$1_use, [
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
- AC_TRY_COMPILE([#include <math.h>],
+ AC_TRY_COMPILE([#include <math.h>
+ #ifdef HAVE_IEEEFP_H
+ #include <ieeefp.h>
+ #endif
+ ],
[ $1(0);],
[glibcpp_cv_func_$1_use=yes], [glibcpp_cv_func_$1_use=no])
AC_LANG_RESTORE
@@ -396,7 +372,7 @@ AC_DEFUN(GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1, [
dnl
dnl Check to see if the (math function) argument passed is
dnl declared when using the c++ compiler
-dnl ASSUMES argument is a math function with ONE parameter
+dnl ASSUMES argument is a math function with TWO parameters
dnl
dnl GLIBCPP_CHECK_MATH_DECL_2
AC_DEFUN(GLIBCPP_CHECK_MATH_DECL_2, [
@@ -442,7 +418,7 @@ AC_DEFUN(GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2, [
dnl
dnl Check to see if the (math function) argument passed is
dnl declared when using the c++ compiler
-dnl ASSUMES argument is a math function with ONE parameter
+dnl ASSUMES argument is a math function with THREE parameters
dnl
dnl GLIBCPP_CHECK_MATH_DECL_3
AC_DEFUN(GLIBCPP_CHECK_MATH_DECL_3, [
@@ -490,9 +466,6 @@ dnl Check to see if the (stdlib function) argument passed is
dnl 1) declared when using the c++ compiler
dnl 2) has "C" linkage
dnl
-dnl Define HAVE_STRTOLD if "strtold" is declared and links
-dnl Define HAVE_STRTOF if "strtof" is declared and links
-dnl
dnl argument 1 is name of function to check
dnl
dnl ASSUMES argument is a math function with TWO parameters
@@ -635,8 +608,9 @@ dnl 1) make sure the name is declared when using the c++ compiler
dnl 2) make sure the name has "C" linkage
dnl This might seem like overkill but experience has shown that it's not...
dnl
-dnl Define HAVE_STRTOF etc if "strtof" is found.
-dnl Define HAVE_STRTOLD etc if "strtold" is found.
+dnl Define HAVE_STRTOLD if "strtold" is declared and links
+dnl Define HAVE_STRTOF if "strtof" is declared and links
+dnl Define HAVE_DRAND48 if "drand48" is declared and links
dnl
dnl GLIBCPP_CHECK_STDLIB_SUPPORT
AC_DEFUN(GLIBCPP_CHECK_STDLIB_SUPPORT, [
@@ -644,8 +618,8 @@ AC_DEFUN(GLIBCPP_CHECK_STDLIB_SUPPORT, [
ac_save_CXXFLAGS="$CXXFLAGS"
CXXFLAGS='-fno-builtins -D_GNU_SOURCE'
- AC_CHECK_FUNCS(strtof)
GLIBCPP_CHECK_STDLIB_DECL_AND_LINKAGE_2(strtold)
+ AC_CHECK_FUNCS(drand48)
CXXFLAGS="$ac_save_CXXFLAGS"
])
@@ -679,6 +653,7 @@ AC_DEFUN(GLIBCPP_CHECK_MATH_SUPPORT, [
GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_3(sincos)
GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(fpclass)
GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(qfpclass)
+ GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(hypot)
dnl Check to see if basic C math functions have float versions.
GLIBCPP_CHECK_MATH_DECLS_AND_LINKAGES_1(float trig,
@@ -691,9 +666,11 @@ AC_DEFUN(GLIBCPP_CHECK_MATH_SUPPORT, [
ceilf floorf)
GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isnanf)
GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isinff)
+ GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(atan2f)
GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(fabsf)
GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(fmodf)
GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(frexpf)
+ GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(hypotf)
GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(ldexpf)
GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(logf)
GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(log10f)
@@ -720,6 +697,7 @@ AC_DEFUN(GLIBCPP_CHECK_MATH_SUPPORT, [
GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(fabsl)
GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(fmodl)
GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(frexpl)
+ GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(hypotl)
GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_2(ldexpl)
GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(logl)
GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(log10l)
@@ -764,23 +742,22 @@ dnl Check to see if there is native support for complex
dnl
dnl Don't compile bits in math/* if native support exits.
dnl
-dnl Define USE_COMPLEX_LONG_DOUBLE etc if "atan2l/copysignl" is found.
+dnl Define USE_COMPLEX_LONG_DOUBLE etc if "copysignl" is found.
dnl
dnl GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
AC_DEFUN(GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT, [
dnl Check for complex versions of math functions of platform.
AC_CHECK_LIB(m, main)
- AC_REPLACE_MATHFUNCS(nan hypot hypotf atan2f expf copysignf)
+ AC_REPLACE_MATHFUNCS(nan copysignf)
dnl Compile the long double complex functions only if the function
dnl provides the non-complex long double functions that are needed.
- dnl Currently this includes copysignl and atan2l, which should be
+ dnl Currently this includes copysignl, which should be
dnl cached from the GLIBCPP_CHECK_MATH_SUPPORT macro, above.
USE_COMPLEX_LONG_DOUBLE=no
- if test x$ac_cv_func_atan2l = x"yes" \
- && test x$ac_cv_func_copysignl = x"yes"; then
+ if test x$ac_cv_func_copysignl = x"yes"; then
USE_COMPLEX_LONG_DOUBLE=yes
- AC_REPLACE_MATHFUNCS(hypotl signbitl)
+ AC_REPLACE_MATHFUNCS(signbitl)
fi
AC_SUBST(USE_COMPLEX_LONG_DOUBLE)
@@ -796,7 +773,6 @@ AC_DEFUN(GLIBCPP_CHECK_TARGET, [
. [$]{glibcpp_basedir}/configure.target
AC_MSG_RESULT(CPU config directory is $cpu_include_dir)
AC_MSG_RESULT(OS config directory is $os_include_dir)
- AC_LINK_FILES($os_include_dir/bits/os_defines.h, include/bits/os_defines.h)
])
@@ -849,9 +825,19 @@ AC_DEFUN(GLIBCPP_CHECK_WCHAR_T_SUPPORT, [
AC_MSG_RESULT($has_weof)
dnl Tests for wide character functions used in char_traits<wchar_t>.
- AC_CHECK_FUNCS(wcslen wmemchr wmemcmp wmemcpy wmemmove wmemset \
- wcsrtombs mbsrtowcs, ac_wfuncs=yes, ac_wfuncs=no)
+ ac_wfuncs=yes
+ AC_CHECK_FUNCS(wcslen wmemchr wmemcmp wmemcpy wmemmove wmemset,, \
+ ac_wfuncs=no)
+ dnl Checks for names injected into std:: by the c_std headers.
+ AC_CHECK_FUNCS(btowc wctob fgetwc fgetwc fgetws fputwc fputws fwide \
+ fwprintf fwscanf swprintf swscanf vfwprintf vfwscanf vswprintf vswscanf \
+ vwprintf vwscanf wprintf wscanf getwc getwchar mbsinit mbrlen mbrtowc \
+ mbsrtowcs wcsrtombs putwc putwchar ungetwc wcrtomb wcstod wcstof wcstol \
+ wcstoul wcscpy wcsncpy wcscat wcsncat wcscmp wcscoll wcsncmp wcsxfrm \
+ wcscspn wcsspn wcstok wcsftime wcschr wcspbrk wcsrchr wcsstr,, \
+ ac_wfuncs=no)
+
AC_MSG_CHECKING([for ISO C99 wchar_t support])
if test x"$has_weof" = xyes && test x"$has_wchar_minmax" = xyes \
&& test x"$ac_wfuncs" = xyes; then
@@ -889,16 +875,12 @@ AC_DEFUN(GLIBCPP_CHECK_WCHAR_T_SUPPORT, [
dnl above support is present.
AC_MSG_CHECKING([for enabled wchar_t specializations])
if test x"$ac_isoC99_wchar_t" = xyes \
- && test x"$ac_XPG2_wchar_t" = xyes; then
- libinst_wstring_la="libinst-wstring.la"
+ && test x"$ac_XPG2_wchar_t" = xyes; then
AC_DEFINE(_GLIBCPP_USE_WCHAR_T)
AC_MSG_RESULT("yes")
else
- libinst_wstring_la=""
AC_MSG_RESULT("no")
fi
- AC_SUBST(libinst_wstring_la)
-
else
dnl Wide characters disabled by the user.
AC_MSG_WARN([wchar_t support disabled.])
@@ -907,75 +889,6 @@ AC_DEFUN(GLIBCPP_CHECK_WCHAR_T_SUPPORT, [
dnl
-dnl Check to see if this version of GNU C++ is afflicted by bugs in
-dnl __complex__ float support.
-dnl
-dnl Define _GLIBCPP_BUGGY_FLOAT_COMPLEX if buggy.
-dnl
-dnl Check to see if this version of GNU C++ is afflicted by bugs in
-dnl __complex__ support.Check for buggy __complex__ that will cause ICE in
-dnl gcc-2.95.x when using the library, unless we define the default copy
-dnl ctor in the specializations of complex<>.
-dnl
-dnl Define _GLIBCPP_BUGGY_COMPLEX if buggy.
-dnl GLIBCPP_CHECK_COMPLEX_MATH_COMPILER_SUPPORT
-AC_DEFUN(GLIBCPP_CHECK_COMPLEX_MATH_COMPILER_SUPPORT, [
- AC_REQUIRE([AC_PROG_CXX])
-
- AC_MSG_CHECKING([for GNU C++ __complex__ support])
- AC_CACHE_VAL(glibcpp_cv_complex, [
- AC_LANG_SAVE
- AC_LANG_CPLUSPLUS
- AC_TRY_COMPILE([struct dcomplex { __complex__ double x; }; \
- dcomplex f(const dcomplex& x) { return dcomplex(x); }], \
- [ dcomplex x; f(x); ],
- glibcpp_cv_complex=ok,
- glibcpp_cv_complex=buggy
- )
- AC_LANG_RESTORE
- ])
- AC_MSG_RESULT($glibcpp_cv_complex)
- if test $glibcpp_cv_complex = buggy; then
- AC_DEFINE(_GLIBCPP_BUGGY_COMPLEX)
- fi
-
- AC_MSG_CHECKING([for GNU C++ __complex__ float support])
- AC_CACHE_VAL(glibcpp_cv_float_complex, [
- AC_LANG_SAVE
- AC_LANG_CPLUSPLUS
- rm -f conftest.h
- cat > conftest.h <<EOB
- //
- // Check for buggy __complex__ that causes ICE in most versions of egcs
- // and gcc-2.95.x on certain platforms (eg., x86-win32).
- //
- // See http://gcc.gnu.org/ml/gcc-bugs/1999-07n/msg00845.html for
- // more info on the bug itself.
- //
- struct
- float_complex
- {
- __complex__ float m_value;
- float_complex (float = 0.0f, float = 0.0f);
- float_complex (__complex__ float val) : m_value (val) {}
- float_complex foo (const float_complex &val)
- { return float_complex (~val.m_value); }
- };
-EOB
- AC_TRY_COMPILE([#include "conftest.h"], ,
- glibcpp_cv_float_complex=ok,
- glibcpp_cv_float_complex=buggy
- )
- AC_LANG_RESTORE
- ])
- AC_MSG_RESULT($glibcpp_cv_float_complex)
- if test $glibcpp_cv_float_complex = buggy; then
- AC_DEFINE(_GLIBCPP_BUGGY_FLOAT_COMPLEX)
- fi
-])
-
-
-dnl
dnl Check for special debugging mode; not for production use.
dnl
dnl GLIBCPP_ENABLE_DEBUG
@@ -1079,8 +992,8 @@ dnl
AC_DEFUN(GLIBCPP_ENABLE_CLOCALE, [
AC_MSG_CHECKING([for clocale to use])
AC_ARG_ENABLE(clocale,
- [ --enable-clocale enable model for target locale package.
- --enable-clocale=MODEL use MODEL target-speific locale package. [default=generic]
+ [ --enable-clocale enable model for target locale package.
+ --enable-clocale=MODEL use MODEL target-speific locale package. [default=generic]
],
if test x$enable_clocale = xno; then
enable_clocale=generic
@@ -1107,7 +1020,7 @@ AC_DEFUN(GLIBCPP_ENABLE_CLOCALE, [
;;
esac
- AC_LINK_FILES($CLOCALE_H, include/bits/c++locale.h)
+ AC_SUBST(CLOCALE_H)
AC_LINK_FILES($CLOCALE_CC, src/c++locale.cc)
])
@@ -1123,8 +1036,8 @@ dnl
AC_DEFUN(GLIBCPP_ENABLE_CSTDIO, [
AC_MSG_CHECKING([for cstdio to use])
AC_ARG_ENABLE(cstdio,
- [ --enable-cstdio enable stdio for target io package.
- --enable-cstdio=LIB use LIB target-speific io package. [default=stdio]
+ [ --enable-cstdio enable stdio for target io package.
+ --enable-cstdio=LIB use LIB target-speific io package. [default=stdio]
],
if test x$enable_cstdio = xno; then
enable_cstdio=stdio
@@ -1137,7 +1050,8 @@ AC_DEFUN(GLIBCPP_ENABLE_CSTDIO, [
case x${enable_cstdio_flag} in
xlibio)
CSTDIO_H=config/c_io_libio.h
- CSTDIO_CC=config/c_io_libio.cc
+ BASIC_FILE_H=config/basic_file_libio.h
+ BASIC_FILE_CC=config/basic_file_libio.cc
AC_MSG_RESULT(libio)
# see if we are on a system with libio native (ie, linux)
@@ -1193,26 +1107,26 @@ AC_DEFUN(GLIBCPP_ENABLE_CSTDIO, [
xstdio | x | xno | xnone | xyes)
# default
CSTDIO_H=config/c_io_stdio.h
- CSTDIO_CC=config/c_io_stdio.cc
+ BASIC_FILE_H=config/basic_file_stdio.h
+ BASIC_FILE_CC=config/basic_file_stdio.cc
AC_MSG_RESULT(stdio)
# We're not using stdio.
need_libio=no
need_wlibio=no
- # Wide characters are not supported with this package.
- enable_c_mbchar=no
;;
*)
echo "$enable_cstdio is an unknown io package" 1>&2
exit 1
;;
esac
- AC_LINK_FILES($CSTDIO_H, include/bits/c++io.h)
- AC_LINK_FILES($CSTDIO_CC, src/c++io.cc)
+ AC_SUBST(CSTDIO_H)
+ AC_SUBST(BASIC_FILE_H)
+ AC_LINK_FILES($BASIC_FILE_CC, src/basic_file.cc)
# 2000-08-04 bkoz hack
CCODECVT_C=config/c_io_libio_codecvt.c
- AC_LINK_FILES($CCODECVT_C, libio/c_codecvt.c)
+ AC_SUBST(CCODECVT_C)
# 2000-08-04 bkoz hack
AM_CONDITIONAL(GLIBCPP_BUILD_LIBIO,
@@ -1229,82 +1143,235 @@ AC_DEFUN(GLIBCPP_ENABLE_CSTDIO, [
dnl
-dnl Check for which threading library to use.
-dnl
-dnl GLIBCPP_ENABLE_THREADS
-dnl --enable-threads=posix sets config/threads-posix.h et. al.
-dnl
-dnl Default is no threads, which also disables _IO_MTSAFE_IO in
-dnl libio. Any actual thread package will enable it.
+dnl Setup to use the gcc gthr.h thread-specific memory and mutex model.
+dnl We must stage the required headers so that they will be installed
+dnl with the library (unlike libgcc, the STL implementation is provided
+dnl solely within headers). Since we must not inject random user-space
+dnl macro names into user-provided C++ code, we first stage into <file>-in
+dnl and process to <file> with an output command. The reason for a two-
+dnl stage process here is to correctly handle $srcdir!=$objdir without
+dnl having to write complex code (the sed commands to clean the macro
+dnl namespace are complex and fragile enough as it is). We must also
+dnl add a relative path so that -I- is supported properly.
dnl
AC_DEFUN(GLIBCPP_ENABLE_THREADS, [
- dnl Note this comes from the gcc/config.in and libjava/config.in
- dnl Efforts should be made to keep this in sync.
- AC_MSG_CHECKING([for threads package to use])
- AC_ARG_ENABLE(threads,
- [ --enable-threads enable thread usage for target GCC.
- --enable-threads=LIB use LIB thread package for target GCC. [default=no]
- ],
- if test x$enable_threads = xno; then
- enable_threads=''
- fi,
- enable_threads='')
-
- enable_threads_flag=$enable_threads
-
- dnl Check if a valid thread package
- case x${enable_threads_flag} in
- x | xno | xnone)
- # No threads
- target_thread_file='single'
- ;;
- xyes)
- # default
- target_thread_file='posix'
- ;;
- xdecosf1 | xirix | xmach | xos2 | xposix | xpthreads | xsingle | \
- xsolaris | xwin32 | xdce | xvxworks)
- target_thread_file=$enable_threads_flag
- ;;
- *)
- echo "$enable_threads is an unknown thread package" 1>&2
- exit 1
- ;;
- esac
+ AC_MSG_CHECKING([for thread model used by GCC])
+ target_thread_file=`$CC -v 2>&1 | sed -n 's/^Thread model: //p'`
+ AC_MSG_RESULT([$target_thread_file])
+
+ if test $target_thread_file != single; then
+ AC_DEFINE(HAVE_GTHR_DEFAULT)
+ AC_DEFINE(_GLIBCPP_SUPPORTS_WEAK, __GXX_WEAK__)
+ fi
+
+ glibcpp_thread_h=gthr-$target_thread_file.h
+ AC_SUBST(glibcpp_thread_h)
+])
+
+
+dnl
+dnl Check for exception handling support. If an explicit enable/disable
+dnl sjlj exceptions is given, we don't have to detect. Otherwise the
+dnl target may or may not support call frame exceptions.
+dnl
+dnl GLIBCPP_ENABLE_SJLJ_EXCEPTIONS
+dnl --enable-sjlj-exceptions forces the use of builtin setjmp.
+dnl --disable-sjlj-exceptions forces the use of call frame unwinding.
+dnl
+dnl Define _GLIBCPP_SJLJ_EXCEPTIONS if the compiler is configured for it.
+dnl
+AC_DEFUN(GLIBCPP_ENABLE_SJLJ_EXCEPTIONS, [
+ AC_MSG_CHECKING([for exception model to use])
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ AC_ARG_ENABLE(sjlj-exceptions,
+ [ --enable-sjlj-exceptions force use of builtin_setjmp for exceptions],
+ [:],
+ [dnl Botheration. Now we've got to detect the exception model.
+ dnl Link tests against libgcc.a are problematic since -- at least
+ dnl as of this writing -- we've not been given proper -L bits for
+ dnl single-tree newlib and libgloss.
+ dnl
+ dnl This is what AC_TRY_COMPILE would do if it didn't delete the
+ dnl conftest files before we got a change to grep them first.
+ cat > conftest.$ac_ext << EOF
+[#]line __oline__ "configure"
+struct S { ~S(); };
+void bar();
+void foo()
+{
+ S s;
+ bar();
+}
+EOF
+ old_CXXFLAGS="$CXXFLAGS"
+ CXXFLAGS=-S
+ if AC_TRY_EVAL(ac_compile); then
+ if grep _Unwind_SjLj_Resume conftest.s >/dev/null 2>&1 ; then
+ enable_sjlj_exceptions=yes
+ elif grep _Unwind_Resume conftest.s >/dev/null 2>&1 ; then
+ enable_sjlj_exceptions=no
+ fi
+ fi
+ CXXFLAGS="$old_CXXFLAGS"
+ rm -f conftest*])
+ if test x$enable_sjlj_exceptions = xyes; then
+ AC_DEFINE(_GLIBCPP_SJLJ_EXCEPTIONS, 1,
+ [Define if the compiler is configured for setjmp/longjmp exceptions.])
+ ac_exception_model_name=sjlj
+ elif test x$enable_sjlj_exceptions = xno; then
+ ac_exception_model_name="call frame"
+ else
+ AC_MSG_ERROR([unable to detect exception model])
+ fi
+ AC_LANG_RESTORE
+ AC_MSG_RESULT($ac_exception_model_name)
+])
- dnl Check for thread package actually supported in libstdc++
- THREADH=
- case "$target_thread_file" in
- no | none | single)
- THREADH=threads-no.h
- ;;
- posix | pthreads)
- THREADH=threads-posix.h
- ;;
- decosf1 | irix | mach | os2 | solaris | win32 | dce | vxworks)
- AC_MSG_ERROR(thread package $THREADS not yet supported)
- ;;
- *)
- AC_MSG_ERROR($THREADS is an unsupported/unknown thread package)
- ;;
- esac
- AC_MSG_RESULT($THREADH)
- AC_LINK_FILES(config/$THREADH, include/bits/c++threads.h)
- if test $THREADH != threads-no.h; then
- AC_DEFINE(_GLIBCPP_USE_THREADS)
+dnl
+dnl Check for ISO/IEC 9899:1999 "C99" support.
+dnl
+dnl GLIBCPP_ENABLE_C99
+dnl --enable-c99 defines _GLIBCPP_USE_C99
+dnl --disable-c99 leaves _GLIBCPP_USE_C99 undefined
+dnl + Usage: GLIBCPP_ENABLE_C99[(DEFAULT)]
+dnl Where DEFAULT is either `yes' or `no'. If omitted, it
+dnl defaults to `no'.
+dnl + If 'C99' stuff is not available, ignores DEFAULT and sets `no'.
+dnl
+dnl GLIBCPP_ENABLE_C99
+AC_DEFUN(GLIBCPP_ENABLE_C99, [dnl
+ define([GLIBCPP_ENABLE_C99_DEFAULT], ifelse($1, yes, yes, no))dnl
+
+ AC_ARG_ENABLE(c99,
+ changequote(<<, >>)dnl
+ <<--enable-c99 turns on 'ISO/IEC 9899:1999 support' [default=>>GLIBCPP_ENABLE_C99_DEFAULT],
+ changequote([, ])dnl
+ [case "$enableval" in
+ yes) enable_c99=yes ;;
+ no) enable_c99=no ;;
+ *) AC_MSG_ERROR([Unknown argument to enable/disable C99]) ;;
+ esac],
+ enable_c99=GLIBCPP_ENABLE_C99_DEFAULT)dnl
+
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+
+ # Check for the existence of <math.h> functions used if C99 is enabled.
+ ac_c99_math=yes;
+ AC_MSG_CHECKING([for ISO C99 support in <math.h>])
+ AC_TRY_COMPILE([#include <math.h>],[fpclassify(0.0);],, [ac_c99_math=no])
+ AC_TRY_COMPILE([#include <math.h>],[isfinite(0.0);],, [ac_c99_math=no])
+ AC_TRY_COMPILE([#include <math.h>],[isinf(0.0);],, [ac_c99_math=no])
+ AC_TRY_COMPILE([#include <math.h>],[isnan(0.0);],, [ac_c99_math=no])
+ AC_TRY_COMPILE([#include <math.h>],[isnormal(0.0);],, [ac_c99_math=no])
+ AC_TRY_COMPILE([#include <math.h>],[signbit(0.0);],, [ac_c99_math=no])
+ AC_TRY_COMPILE([#include <math.h>],[isgreater(0.0,0.0);],, [ac_c99_math=no])
+ AC_TRY_COMPILE([#include <math.h>],
+ [isgreaterequal(0.0,0.0);],, [ac_c99_math=no])
+ AC_TRY_COMPILE([#include <math.h>],[isless(0.0,0.0);],, [ac_c99_math=no])
+ AC_TRY_COMPILE([#include <math.h>],[islessequal(0.0,0.0);],,[ac_c99_math=no])
+ AC_TRY_COMPILE([#include <math.h>],
+ [islessgreater(0.0,0.0);],, [ac_c99_math=no])
+ AC_TRY_COMPILE([#include <math.h>],
+ [isunordered(0.0,0.0);],, [ac_c99_math=no])
+ AC_MSG_RESULT($ac_c99_math)
+
+ # Check for the existence in <stdio.h> of vscanf, et. al.
+ ac_c99_stdio=yes;
+ AC_MSG_CHECKING([for ISO C99 support in <stdio.h>])
+ AC_TRY_COMPILE([#include <stdio.h>],
+ [snprintf("12", 0, "%i");],, [ac_c99_stdio=no])
+ AC_TRY_COMPILE([#include <stdio.h>
+ #include <stdarg.h>
+ void foo(char* fmt, ...)
+ {va_list args; va_start(args, fmt);
+ vfscanf(stderr, "%i", args);}],
+ [],, [ac_c99_stdio=no])
+ AC_TRY_COMPILE([#include <stdio.h>
+ #include <stdarg.h>
+ void foo(char* fmt, ...)
+ {va_list args; va_start(args, fmt);
+ vscanf("%i", args);}],
+ [],, [ac_c99_stdio=no])
+ AC_TRY_COMPILE([#include <stdio.h>
+ #include <stdarg.h>
+ void foo(char* fmt, ...)
+ {va_list args; va_start(args, fmt);
+ vsnprintf(fmt, 0, "%i", args);}],
+ [],, [ac_c99_stdio=no])
+ AC_TRY_COMPILE([#include <stdio.h>
+ #include <stdarg.h>
+ void foo(char* fmt, ...)
+ {va_list args; va_start(args, fmt);
+ vsscanf(fmt, "%i", args);}],
+ [],, [ac_c99_stdio=no])
+ AC_MSG_RESULT($ac_c99_stdio)
+
+ # Check for the existence in <stdlib.h> of lldiv_t, et. al.
+ ac_c99_stdlib=yes;
+ AC_MSG_CHECKING([for lldiv_t declaration])
+ AC_CACHE_VAL(ac_c99_lldiv_t, [
+ AC_TRY_COMPILE([#include <stdlib.h>],
+ [ lldiv_t mydivt;],
+ [ac_c99_lldiv_t=yes], [ac_c99_lldiv_t=no])
+ ])
+ AC_MSG_RESULT($ac_c99_lldiv_t)
+
+ AC_MSG_CHECKING([for ISO C99 support in <stdlib.h>])
+ AC_TRY_COMPILE([#include <stdlib.h>],
+ [char* tmp; strtof("gnu", &tmp);],, [ac_c99_stdlib=no])
+ AC_TRY_COMPILE([#include <stdlib.h>],
+ [char* tmp; strtold("gnu", &tmp);],, [ac_c99_stdlib=no])
+ AC_TRY_COMPILE([#include <stdlib.h>], [llabs(10);],, [ac_c99_stdlib=no])
+ AC_TRY_COMPILE([#include <stdlib.h>], [lldiv(10,1);],, [ac_c99_stdlib=no])
+ AC_TRY_COMPILE([#include <stdlib.h>], [atoll("10");],, [ac_c99_stdlib=no])
+ AC_TRY_COMPILE([#include <stdlib.h>], [_Exit(0);],, [ac_c99_stdlib=no])
+ if test x"$ac_c99_lldiv_t" = x"no"; then
+ ac_c99_stdlib=no;
+ fi;
+ AC_MSG_RESULT($ac_c99_stdlib)
+
+ # Check for the existence of <wchar.h> functions used if C99 is enabled.
+ # XXX the wchar.h checks should be rolled into the general C99 bits.
+ ac_c99_wchar=yes;
+ AC_MSG_CHECKING([for additional ISO C99 support in <wchar.h>])
+ AC_TRY_COMPILE([#include <wchar.h>],
+ [wcstold(L"10.0", NULL);],, [ac_c99_wchar=no])
+ AC_TRY_COMPILE([#include <wchar.h>],
+ [wcstoll(L"10", NULL, 10);],, [ac_c99_wchar=no])
+ AC_TRY_COMPILE([#include <wchar.h>],
+ [wcstoull(L"10", NULL, 10);],, [ac_c99_wchar=no])
+ AC_MSG_RESULT($ac_c99_wchar)
+
+ AC_MSG_CHECKING([for enabled ISO C99 support])
+ if test x"$ac_c99_math" = x"no" || test x"$ac_c99_stdio" = x"no" \
+ || test x"$ac_c99_stdlib" = x"no" \
+ || test x"$ac_c99_wchar" = x"no"; then
+ enable_c99=no;
+ fi;
+ AC_MSG_RESULT($enable_c99)
+
+ # Option parsed, now set things appropriately
+ if test x"$enable_c99" = x"yes"; then
+ AC_DEFINE(_GLIBCPP_USE_C99)
fi
+
+ AC_LANG_RESTORE
])
dnl
dnl Check for template specializations for the 'long long' type extension.
+dnl The result determines only whether 'long long' I/O is enabled; things
+dnl like numeric_limits<> specializations are always available.
dnl
dnl GLIBCPP_ENABLE_LONG_LONG
dnl --enable-long-long defines _GLIBCPP_USE_LONG_LONG
dnl --disable-long-long leaves _GLIBCPP_USE_LONG_LONG undefined
dnl + Usage: GLIBCPP_ENABLE_LONG_LONG[(DEFAULT)]
-dnl Where DEFAULT is either `yes' or `no'. If ommitted, it
+dnl Where DEFAULT is either `yes' or `no'. If omitted, it
dnl defaults to `no'.
dnl + If 'long long' stuff is not available, ignores DEFAULT and sets `no'.
dnl
@@ -1322,44 +1389,24 @@ AC_DEFUN(GLIBCPP_ENABLE_LONG_LONG, [dnl
*) AC_MSG_ERROR([Unknown argument to enable/disable long long]) ;;
esac],
enable_long_long=GLIBCPP_ENABLE_LONG_LONG_DEFAULT)dnl
-
- # Allow use of os-dependent settings, so that macros that turn on
- # C99 capabilities can be defined and used in a consistent way.
- OS_INC_PATH=${srcdir}/$os_include_dir
- ac_test_CFLAGS="${CFLAGS+set}"
- ac_save_CFLAGS="$CFLAGS"
- CFLAGS="-I$OS_INC_PATH"
- # Check for the existence of functions used if long long is enabled.
- AC_CHECK_FUNC(strtoll,,ac_strtoll=no)
- AC_CHECK_FUNC(strtoull,,ac_strtoull=no)
-
- # Check for lldiv_t, et. al.
- AC_MSG_CHECKING([for lldiv_t declaration])
- AC_CACHE_VAL(glibcpp_lldiv_t_use, [
- AC_TRY_COMPILE([#include <bits/os_defines.h>
- #include <stdlib.h>],
- [ lldiv_t mydivt;],
- [glibcpp_lldiv_t_use=yes], [glibcpp_lldiv_t_use=no])
- ])
- AC_MSG_RESULT($glibcpp_lldiv_t_use)
- if test x$glibcpp_lldiv_t_use = x"yes"; then
- AC_DEFINE(HAVE_LLDIV_T)
- fi
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
- AC_MSG_CHECKING([for enabled long long])
- if test x"$ac_strtoll" = xno || test x"$ac_strtoull" = xno; then
- enable_long_long=no;
- fi;
- AC_MSG_RESULT($enable_long_long)
+ AC_MSG_CHECKING([for enabled long long I/O support])
+ # iostreams require strtoll, strtoull to compile
+ AC_TRY_COMPILE([#include <stdlib.h>],
+ [char* tmp; strtoll("gnu", &tmp, 10);],,[enable_long_long=no])
+ AC_TRY_COMPILE([#include <stdlib.h>],
+ [char* tmp; strtoull("gnu", &tmp, 10);],,[enable_long_long=no])
# Option parsed, now set things appropriately
if test x"$enable_long_long" = xyes; then
AC_DEFINE(_GLIBCPP_USE_LONG_LONG)
fi
+ AC_MSG_RESULT($enable_long_long)
- # Reset CFLAGS
- CFLAGS="$ac_save_CFLAGS"
+ AC_LANG_RESTORE
])
@@ -1378,8 +1425,7 @@ define([GLIBCPP_ENABLE_CHEADERS_DEFAULT], ifelse($1, c_std, c_std, c_std))dnl
AC_MSG_CHECKING([for c header strategy to use])
AC_ARG_ENABLE(cheaders,
changequote(<<, >>)dnl
-<< --enable-cheaders construct "C" header files for
- g++ [default=>>GLIBCPP_ENABLE_CHEADERS_DEFAULT],
+<< --enable-cheaders construct "C" header files for g++ [default=>>GLIBCPP_ENABLE_CHEADERS_DEFAULT],
changequote([, ])
[case "$enableval" in
c)
@@ -1401,16 +1447,16 @@ changequote([, ])
case "$enable_cheaders" in
c_shadow)
CSHADOW_FLAGS="-fno-builtin"
- C_INCLUDE_DIR='${top_srcdir}/include/c_shadow'
+ C_INCLUDE_DIR='${glibcpp_srcdir}/include/c_shadow'
AC_DEFINE(_GLIBCPP_USE_SHADOW_HEADERS)
;;
c_std)
CSHADOW_FLAGS=""
- C_INCLUDE_DIR='${top_srcdir}/include/c_std'
+ C_INCLUDE_DIR='${glibcpp_srcdir}/include/c_std'
;;
c)
CSHADOW_FLAGS=""
- C_INCLUDE_DIR='${top_srcdir}/include/c'
+ C_INCLUDE_DIR='${glibcpp_srcdir}/include/c'
;;
esac
@@ -1449,25 +1495,19 @@ dnl Option parsed, now other scripts can test enable_c_mbchar for yes/no.
dnl
dnl Set up *_INCLUDES and *_INCLUDE_DIR variables for all sundry Makefile.am's.
dnl
-dnl GLIBCPP_INCLUDE_DIR
-dnl C_INCLUDE_DIR
dnl TOPLEVEL_INCLUDES
dnl LIBMATH_INCLUDES
dnl LIBSUPCXX_INCLUDES
dnl LIBIO_INCLUDES
dnl CSHADOW_INCLUDES
dnl
-dnl GLIBCPP_EXPORT_INCLUDE
+dnl GLIBCPP_EXPORT_INCLUDES
AC_DEFUN(GLIBCPP_EXPORT_INCLUDES, [
- # Root level of the include sources.
- GLIBCPP_INCLUDE_DIR='$(top_srcdir)/include'
+ # Root level of the build directory include sources.
+ GLIBCPP_INCLUDES="-I${glibcpp_builddir}/include/${target_alias} -I${glibcpp_builddir}/include"
- # Can either use include/c or include/c_std to grab "C" headers. This
- # variable is set to the include directory currently in use.
- # set with C_INCLUDE_DIR in GLIBCPP_ENABLE_CHEADERS
-
# Passed down for canadian crosses.
- if test x"$CANADIAN" = xyes; then
+ if test x"$CANADIAN" = xyes; then
TOPLEVEL_INCLUDES='-I$(includedir)'
fi
@@ -1475,26 +1515,16 @@ AC_DEFUN(GLIBCPP_EXPORT_INCLUDES, [
LIBSUPCXX_INCLUDES='-I$(top_srcdir)/libsupc++'
- #if GLIBCPP_NEED_LIBIO
- LIBIO_INCLUDES='-I$(top_builddir)/libio -I$(top_srcdir)/libio'
- #else
- #LIBIO_INCLUDES='-I$(top_srcdir)/libio'
- #endif
-
- #if GLIBCPP_USE_CSHADOW
- # CSHADOW_INCLUDES='-I$(GLIBCPP_INCLUDE_DIR)/std -I$(C_INCLUDE_DIR) \
- # -I$(top_blddir)/cshadow'
- #else
- CSTD_INCLUDES='-I$(GLIBCPP_INCLUDE_DIR)/std -I$(C_INCLUDE_DIR)'
- #endif
+ if test x"$need_libio" = xyes; then
+ LIBIO_INCLUDES='-I$(top_builddir)/libio -I$(top_srcdir)/libio'
+ AC_SUBST(LIBIO_INCLUDES)
+ fi
# Now, export this to all the little Makefiles....
- AC_SUBST(GLIBCPP_INCLUDE_DIR)
+ AC_SUBST(GLIBCPP_INCLUDES)
AC_SUBST(TOPLEVEL_INCLUDES)
AC_SUBST(LIBMATH_INCLUDES)
AC_SUBST(LIBSUPCXX_INCLUDES)
- AC_SUBST(LIBIO_INCLUDES)
- AC_SUBST(CSTD_INCLUDES)
])
@@ -1517,6 +1547,9 @@ dnl GLIBCPP_EXPORT_INSTALL_INFO
dnl calculates gxx_install_dir
dnl exports glibcpp_toolexecdir
dnl exports glibcpp_toolexeclibdir
+dnl exports glibcpp_builddir
+dnl exports glibcpp_srcdir
+dnl exports glibcpp_prefixdir
dnl
dnl Assumes cross_compiling bits already done, and with_cross_host in
dnl particular
@@ -1527,6 +1560,17 @@ AC_DEFUN(GLIBCPP_EXPORT_INSTALL_INFO, [
glibcpp_toolexecdir=no
glibcpp_toolexeclibdir=no
+# Export build and source directories.
+# These need to be absolute paths, yet at the same time need to
+# canonicalize only relative paths, because then amd will not unmount
+# drives. Thus the use of PWDCMD: set it to 'pawd' or 'amq -w' if using amd.
+glibcpp_builddir=`pwd`
+case $srcdir in
+[\\/$]* | ?:[\\/]*) glibcpp_srcdir=${srcdir} ;;
+*) glibcpp_srcdir=`cd "$srcdir" && ${PWDCMD-pwd} || echo "$srcdir"` ;;
+esac
+glibcpp_prefixdir=${prefix}
+
AC_MSG_CHECKING([for interface version number])
libstdcxx_interface=$INTERFACE
AC_MSG_RESULT($libstdcxx_interface)
@@ -1534,7 +1578,7 @@ AC_MSG_RESULT($libstdcxx_interface)
# Process the option --with-gxx-include-dir=<path to include-files directory>
AC_MSG_CHECKING([for --with-gxx-include-dir])
AC_ARG_WITH(gxx-include-dir,
-[ --with-gxx-include-dir the installation directory for include files],
+[ --with-gxx-include-dir the installation directory for include files],
[case "${withval}" in
yes)
AC_MSG_ERROR(Missing directory for --with-gxx-include-dir)
@@ -1553,31 +1597,39 @@ AC_MSG_RESULT($gxx_include_dir)
AC_MSG_CHECKING([for --enable-version-specific-runtime-libs])
AC_ARG_ENABLE(version-specific-runtime-libs,
[ --enable-version-specific-runtime-libs Specify that runtime libraries should be installed in a compiler-specific directory ],
-[ version_specific_libs=yes
-# Need the gcc compiler version to know where to install libraries
-# and header files if --enable-version-specific-runtime-libs option
-# is selected.
-changequote(,)dnl
-gcc_version_trigger=${srcdir}/../gcc/version.c
-gcc_version_full=`grep version_string ${gcc_version_trigger} | sed -e 's/.*\"\([^\"]*\)\".*/\1/'`
-gcc_version=`echo ${gcc_version_full} | sed -e 's/\([^ ]*\) .*/\1/'`
-gxx_include_dir='$(libdir)/gcc-lib/$(target_alias)/'${gcc_version}/include/g++
-glibcpp_toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
-glibcpp_toolexeclibdir='$(toolexecdir)/'${gcc_version}
-changequote([,])dnl
-],version_specific_libs=no)
+[case "$enableval" in
+ yes) version_specific_libs=yes ;;
+ no) version_specific_libs=no ;;
+ *) AC_MSG_ERROR([Unknown argument to enable/disable version-specific libs]);;
+ esac],
+version_specific_libs=no)dnl
+# Option set, now we can test it.
AC_MSG_RESULT($version_specific_libs)
+if test $version_specific_libs = yes; then
+ # Need the gcc compiler version to know where to install libraries
+ # and header files if --enable-version-specific-runtime-libs option
+ # is selected.
+ changequote(,)dnl
+ gcc_version_trigger=${srcdir}/../gcc/version.c
+ gcc_version_full=`grep version_string ${gcc_version_trigger} | sed -e 's/.*\"\([^\"]*\)\".*/\1/'`
+ gcc_version=`echo ${gcc_version_full} | sed -e 's/\([^ ]*\) .*/\1/'`
+ gxx_include_dir='$(libdir)/gcc-lib/$(target_alias)/'${gcc_version}/include/g++
+ glibcpp_toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
+ glibcpp_toolexeclibdir='$(toolexecdir)/'${gcc_version}'$(MULTISUBDIR)'
+ changequote([,])dnl
+fi
+
# Default case for install directory for include files.
-if test x"$version_specific_libs" = x"no" \
- && test x"$gxx_include_dir"=x"no"; then
+if test $version_specific_libs = no &&
+ test $gxx_include_dir = no; then
gxx_include_dir='$(prefix)'/include/g++-${libstdcxx_interface}
fi
# Calculate glibcpp_toolexecdir, glibcpp_toolexeclibdir
# Install a library built with a cross compiler in tooldir, not libdir.
if test x"$glibcpp_toolexecdir" = x"no"; then
- if test x"$with_cross_host" = x"yes"; then
+ if test -n "$with_cross_host" && test x"$with_cross_host" != x"no"; then
glibcpp_toolexecdir='$(exec_prefix)/$(target_alias)'
glibcpp_toolexeclibdir='$(toolexecdir)/lib$(MULTISUBDIR)'
else
@@ -1589,6 +1641,9 @@ fi
AC_MSG_CHECKING([for install location])
AC_MSG_RESULT($gxx_include_dir)
+AC_SUBST(glibcpp_builddir)
+AC_SUBST(glibcpp_srcdir)
+AC_SUBST(glibcpp_prefixdir)
AC_SUBST(gxx_include_dir)
AC_SUBST(glibcpp_toolexecdir)
AC_SUBST(glibcpp_toolexeclibdir)
@@ -1720,6 +1775,62 @@ dnl string, '#' otherwise
AC_SUBST(ifGNUmake)
])
+
+dnl Check for headers for, and arguments to, the setrlimit() function.
+dnl Used only in testsuite_hooks.h.
+AC_DEFUN(GLIBCPP_CHECK_SETRLIMIT_ancilliary, [
+ AC_TRY_COMPILE([#include <sys/resource.h>
+ #include <unistd.h>
+ ], [ int f = RLIMIT_$1 ; ],
+ [glibcpp_mresult=1], [glibcpp_mresult=0])
+ AC_DEFINE_UNQUOTED(HAVE_MEMLIMIT_$1, $glibcpp_mresult,
+ [Only used in build directory testsuite_hooks.h.])
+])
+AC_DEFUN(GLIBCPP_CHECK_SETRLIMIT, [
+ setrlimit_have_headers=yes
+ AC_CHECK_HEADERS(sys/resource.h unistd.h,
+ [],
+ setrlimit_have_headers=no)
+ # If don't have the headers, then we can't run the tests now, and we
+ # won't be seeing any of these during testsuite compilation.
+ if test $setrlimit_have_headers = yes; then
+ # Can't do these in a loop, else the resulting syntax is wrong.
+ GLIBCPP_CHECK_SETRLIMIT_ancilliary(DATA)
+ GLIBCPP_CHECK_SETRLIMIT_ancilliary(RSS)
+ GLIBCPP_CHECK_SETRLIMIT_ancilliary(VMEM)
+ GLIBCPP_CHECK_SETRLIMIT_ancilliary(AS)
+
+ # Check for rlimit, setrlimit.
+ AC_CACHE_VAL(ac_setrlimit, [
+ AC_TRY_COMPILE([#include <sys/resource.h>
+ #include <unistd.h>
+ ],
+ [ struct rlimit r; setrlimit(0, &r);],
+ [ac_setrlimit=yes], [ac_setrlimit=no])
+ ])
+ fi
+
+ AC_MSG_CHECKING([for testsuite memory limit support])
+ if test $setrlimit_have_headers = yes && test $ac_setrlimit = yes; then
+ ac_mem_limits=yes
+ AC_DEFINE(_GLIBCPP_MEM_LIMITS)
+ else
+ ac_mem_limits=no
+ fi
+ AC_MSG_RESULT($ac_mem_limits)
+])
+
+
+dnl
+dnl Does any necessary configuration of the testsuite directory. Generates
+dnl the testsuite_hooks.h header.
+dnl
+dnl GLIBCPP_CONFIGURE_TESTSUITE [no args]
+AC_DEFUN(GLIBCPP_CONFIGURE_TESTSUITE, [
+ GLIBCPP_CHECK_SETRLIMIT
+])
+
+
sinclude(../libtool.m4)
dnl The lines below arrange for aclocal not to bring an installed
dnl libtool.m4 into aclocal.m4, while still arranging for automake to
@@ -1731,6 +1842,7 @@ AC_DEFUN([AC_PROG_LD])
])
+
# Do all the work for Automake. This macro actually does too much --
# some checks are only needed if your package does certain things.
# But this isn't really a big deal.
@@ -1740,7 +1852,7 @@ AC_DEFUN([AC_PROG_LD])
dnl Usage:
dnl AM_INIT_AUTOMAKE(package,version, [no-define])
-AC_DEFUN(AM_INIT_AUTOMAKE,
+AC_DEFUN([AM_INIT_AUTOMAKE],
[AC_REQUIRE([AC_PROG_INSTALL])
PACKAGE=[$1]
AC_SUBST(PACKAGE)
@@ -1768,7 +1880,7 @@ AC_REQUIRE([AC_PROG_MAKE_SET])])
# Check to make sure that the build environment is sane.
#
-AC_DEFUN(AM_SANITY_CHECK,
+AC_DEFUN([AM_SANITY_CHECK],
[AC_MSG_CHECKING([whether build environment is sane])
# Just in case
sleep 1
@@ -1809,7 +1921,7 @@ AC_MSG_RESULT(yes)])
dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
dnl The program must properly implement --version.
-AC_DEFUN(AM_MISSING_PROG,
+AC_DEFUN([AM_MISSING_PROG],
[AC_MSG_CHECKING(for working $2)
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
@@ -1828,7 +1940,7 @@ AC_SUBST($1)])
# serial 1
-AC_DEFUN(AM_MAINTAINER_MODE,
+AC_DEFUN([AM_MAINTAINER_MODE],
[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
dnl maintainer-mode is disabled by default
AC_ARG_ENABLE(maintainer-mode,
@@ -1845,7 +1957,7 @@ AC_DEFUN(AM_MAINTAINER_MODE,
# Define a conditional.
-AC_DEFUN(AM_CONDITIONAL,
+AC_DEFUN([AM_CONDITIONAL],
[AC_SUBST($1_TRUE)
AC_SUBST($1_FALSE)
if $2; then
@@ -1858,7 +1970,7 @@ fi])
# Like AC_CONFIG_HEADER, but automatically create stamp file.
-AC_DEFUN(AM_CONFIG_HEADER,
+AC_DEFUN([AM_CONFIG_HEADER],
[AC_PREREQ([2.12])
AC_CONFIG_HEADER([$1])
dnl When config.status generates a header, we must update the stamp-h file.
diff --git a/libstdc++-v3/config.h.in b/libstdc++-v3/config.h.in
index d424291054a..0a687ed4fe6 100644
--- a/libstdc++-v3/config.h.in
+++ b/libstdc++-v3/config.h.in
@@ -3,34 +3,34 @@
/* Define if you have a working `mmap' system call. */
#undef HAVE_MMAP
-// Define if GCC support for __complex__ float is buggy.
-#undef _GLIBCPP_BUGGY_FLOAT_COMPLEX
+// Define if GCC supports weak symbols.
+#undef _GLIBCPP_SUPPORTS_WEAK
-// Define if GCC support for __complex__ is buggy.
-#undef _GLIBCPP_BUGGY_COMPLEX
+// Define if gthr-default.h exists (meaning that threading support is enabled).
+#undef HAVE_GTHR_DEFAULT
-// Include support for multiple threads, e.g., in the I/O package.
-#undef _GLIBCPP_USE_THREADS
-
-// Include support for 'long long' and 'unsigned long long'.
+// Include I/O support for 'long long' and 'unsigned long long'.
#undef _GLIBCPP_USE_LONG_LONG
+// Define if C99 features such as lldiv_t, llabs, lldiv should be exposed.
+#undef _GLIBCPP_USE_C99
+
// Include support for shadow headers, ie --enable-cshadow-headers.
#undef _GLIBCPP_USE_SHADOW_HEADERS
// Define if code specialized for wchar_t should be used.
#undef _GLIBCPP_USE_WCHAR_T
-// Define if lldiv_t exists in stdlib.h.
-#undef HAVE_LLDIV_T
+// Define if using setrlimit to limit memory usage during 'make check'.
+#undef _GLIBCPP_MEM_LIMITS
-// Define if mbstate_t exists in wchar.h. */
+// Define if mbstate_t exists in wchar.h.
#undef HAVE_MBSTATE_T
-// Define if you have the modff function. */
+// Define if you have the modff function.
#undef HAVE_MODFF
-// Define if you have the modfl function. */
+// Define if you have the modfl function.
#undef HAVE_MODFL
// Define if the compiler/host combination has __builtin_abs
@@ -90,6 +90,9 @@
/* Define if you have the _asinl function. */
#undef HAVE__ASINL
+/* Define if you have the _atan2f function. */
+#undef HAVE__ATAN2F
+
/* Define if you have the _atan2l function. */
#undef HAVE__ATAN2L
@@ -162,6 +165,15 @@
/* Define if you have the _frexpl function. */
#undef HAVE__FREXPL
+/* Define if you have the _hypot function. */
+#undef HAVE__HYPOT
+
+/* Define if you have the _hypotf function. */
+#undef HAVE__HYPOTF
+
+/* Define if you have the _hypotl function. */
+#undef HAVE__HYPOTL
+
/* Define if you have the _isinf function. */
#undef HAVE__ISINF
@@ -276,6 +288,9 @@
/* Define if you have the atanl function. */
#undef HAVE_ATANL
+/* Define if you have the btowc function. */
+#undef HAVE_BTOWC
+
/* Define if you have the ceilf function. */
#undef HAVE_CEILF
@@ -303,8 +318,8 @@
/* Define if you have the cosl function. */
#undef HAVE_COSL
-/* Define if you have the expf function. */
-#undef HAVE_EXPF
+/* Define if you have the drand48 function. */
+#undef HAVE_DRAND48
/* Define if you have the expl function. */
#undef HAVE_EXPL
@@ -315,6 +330,12 @@
/* Define if you have the fabsl function. */
#undef HAVE_FABSL
+/* Define if you have the fgetwc function. */
+#undef HAVE_FGETWC
+
+/* Define if you have the fgetws function. */
+#undef HAVE_FGETWS
+
/* Define if you have the finite function. */
#undef HAVE_FINITE
@@ -339,15 +360,36 @@
/* Define if you have the fpclass function. */
#undef HAVE_FPCLASS
+/* Define if you have the fputwc function. */
+#undef HAVE_FPUTWC
+
+/* Define if you have the fputws function. */
+#undef HAVE_FPUTWS
+
/* Define if you have the frexpf function. */
#undef HAVE_FREXPF
/* Define if you have the frexpl function. */
#undef HAVE_FREXPL
+/* Define if you have the fwide function. */
+#undef HAVE_FWIDE
+
+/* Define if you have the fwprintf function. */
+#undef HAVE_FWPRINTF
+
+/* Define if you have the fwscanf function. */
+#undef HAVE_FWSCANF
+
/* Define if you have the getpagesize function. */
#undef HAVE_GETPAGESIZE
+/* Define if you have the getwc function. */
+#undef HAVE_GETWC
+
+/* Define if you have the getwchar function. */
+#undef HAVE_GETWCHAR
+
/* Define if you have the hypot function. */
#undef HAVE_HYPOT
@@ -402,6 +444,15 @@
/* Define if you have the logl function. */
#undef HAVE_LOGL
+/* Define if you have the mbrlen function. */
+#undef HAVE_MBRLEN
+
+/* Define if you have the mbrtowc function. */
+#undef HAVE_MBRTOWC
+
+/* Define if you have the mbsinit function. */
+#undef HAVE_MBSINIT
+
/* Define if you have the mbsrtowcs function. */
#undef HAVE_MBSRTOWCS
@@ -423,6 +474,12 @@
/* Define if you have the powl function. */
#undef HAVE_POWL
+/* Define if you have the putwc function. */
+#undef HAVE_PUTWC
+
+/* Define if you have the putwchar function. */
+#undef HAVE_PUTWCHAR
+
/* Define if you have the qfpclass function. */
#undef HAVE_QFPCLASS
@@ -456,12 +513,15 @@
/* Define if you have the sqrtl function. */
#undef HAVE_SQRTL
-/* Define if you have the strtof function. */
-#undef HAVE_STRTOF
-
/* Define if you have the strtold function. */
#undef HAVE_STRTOLD
+/* Define if you have the swprintf function. */
+#undef HAVE_SWPRINTF
+
+/* Define if you have the swscanf function. */
+#undef HAVE_SWSCANF
+
/* Define if you have the tanf function. */
#undef HAVE_TANF
@@ -474,12 +534,99 @@
/* Define if you have the tanl function. */
#undef HAVE_TANL
+/* Define if you have the ungetwc function. */
+#undef HAVE_UNGETWC
+
+/* Define if you have the vfwprintf function. */
+#undef HAVE_VFWPRINTF
+
+/* Define if you have the vfwscanf function. */
+#undef HAVE_VFWSCANF
+
+/* Define if you have the vswprintf function. */
+#undef HAVE_VSWPRINTF
+
+/* Define if you have the vswscanf function. */
+#undef HAVE_VSWSCANF
+
+/* Define if you have the vwprintf function. */
+#undef HAVE_VWPRINTF
+
+/* Define if you have the vwscanf function. */
+#undef HAVE_VWSCANF
+
+/* Define if you have the wcrtomb function. */
+#undef HAVE_WCRTOMB
+
+/* Define if you have the wcscat function. */
+#undef HAVE_WCSCAT
+
+/* Define if you have the wcschr function. */
+#undef HAVE_WCSCHR
+
+/* Define if you have the wcscmp function. */
+#undef HAVE_WCSCMP
+
+/* Define if you have the wcscoll function. */
+#undef HAVE_WCSCOLL
+
+/* Define if you have the wcscpy function. */
+#undef HAVE_WCSCPY
+
+/* Define if you have the wcscspn function. */
+#undef HAVE_WCSCSPN
+
+/* Define if you have the wcsftime function. */
+#undef HAVE_WCSFTIME
+
/* Define if you have the wcslen function. */
#undef HAVE_WCSLEN
+/* Define if you have the wcsncat function. */
+#undef HAVE_WCSNCAT
+
+/* Define if you have the wcsncmp function. */
+#undef HAVE_WCSNCMP
+
+/* Define if you have the wcsncpy function. */
+#undef HAVE_WCSNCPY
+
+/* Define if you have the wcspbrk function. */
+#undef HAVE_WCSPBRK
+
+/* Define if you have the wcsrchr function. */
+#undef HAVE_WCSRCHR
+
/* Define if you have the wcsrtombs function. */
#undef HAVE_WCSRTOMBS
+/* Define if you have the wcsspn function. */
+#undef HAVE_WCSSPN
+
+/* Define if you have the wcsstr function. */
+#undef HAVE_WCSSTR
+
+/* Define if you have the wcstod function. */
+#undef HAVE_WCSTOD
+
+/* Define if you have the wcstof function. */
+#undef HAVE_WCSTOF
+
+/* Define if you have the wcstok function. */
+#undef HAVE_WCSTOK
+
+/* Define if you have the wcstol function. */
+#undef HAVE_WCSTOL
+
+/* Define if you have the wcstoul function. */
+#undef HAVE_WCSTOUL
+
+/* Define if you have the wcsxfrm function. */
+#undef HAVE_WCSXFRM
+
+/* Define if you have the wctob function. */
+#undef HAVE_WCTOB
+
/* Define if you have the wmemchr function. */
#undef HAVE_WMEMCHR
@@ -495,6 +642,12 @@
/* Define if you have the wmemset function. */
#undef HAVE_WMEMSET
+/* Define if you have the wprintf function. */
+#undef HAVE_WPRINTF
+
+/* Define if you have the wscanf function. */
+#undef HAVE_WSCANF
+
/* Define if you have the <endian.h> header file. */
#undef HAVE_ENDIAN_H
@@ -525,12 +678,24 @@
/* Define if you have the <nan.h> header file. */
#undef HAVE_NAN_H
+/* Define if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
/* Define if you have the <sys/isa_defs.h> header file. */
#undef HAVE_SYS_ISA_DEFS_H
/* Define if you have the <sys/machine.h> header file. */
#undef HAVE_SYS_MACHINE_H
+/* Define if you have the <sys/resource.h> header file. */
+#undef HAVE_SYS_RESOURCE_H
+
+/* Define if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
/* Define if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
@@ -546,14 +711,28 @@
/* Version number of package */
#undef VERSION
+/* Define if the compiler is configured for setjmp/longjmp exceptions. */
+#undef _GLIBCPP_SJLJ_EXCEPTIONS
+
/* Define if sigsetjmp is available. */
#undef HAVE_SIGSETJMP
+/* Only used in build directory testsuite_hooks.h. */
+#undef HAVE_MEMLIMIT_DATA
+
+/* Only used in build directory testsuite_hooks.h. */
+#undef HAVE_MEMLIMIT_RSS
+
+/* Only used in build directory testsuite_hooks.h. */
+#undef HAVE_MEMLIMIT_VMEM
+
+/* Only used in build directory testsuite_hooks.h. */
+#undef HAVE_MEMLIMIT_AS
+
//
// Systems that have certain non-standard functions prefixed with an
// underscore, we'll handle those here. Must come after config.h.in.
//
-
#if defined (HAVE__ISNAN) && ! defined (HAVE_ISNAN)
# define HAVE_ISNAN 1
# define isnan _isnan
diff --git a/libstdc++-v3/config/basic_file_libio.cc b/libstdc++-v3/config/basic_file_libio.cc
new file mode 100644
index 00000000000..60eb006a847
--- /dev/null
+++ b/libstdc++-v3/config/basic_file_libio.cc
@@ -0,0 +1,194 @@
+// Wrapper of C-language FILE struct -*- C++ -*-
+
+// Copyright (C) 2000, 2001 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.
+
+//
+// ISO C++ 14882: 27.8 File-based streams
+//
+
+#include <bits/basic_file.h>
+
+namespace std
+{
+ // __basic_file<char> definitions
+ __basic_file<char>::__basic_file(__c_lock* __lock)
+ {
+#ifdef _IO_MTSAFE_IO
+ _lock = __lock;
+#endif
+ // Don't set the orientation of the stream when initializing.
+#ifdef _GLIBCPP_USE_WCHAR_T
+ _IO_no_init(this, 0, 0, &_M_wfile, 0);
+#else /* !defined(_GLIBCPP_USE_WCHAR_T) */
+ _IO_no_init(this, 0, 0, NULL, 0);
+#endif /* !defined(_GLIBCPP_USE_WCHAR_T) */
+ _IO_JUMPS((_IO_FILE_plus *) this) = &_IO_file_jumps;
+ _IO_file_init((_IO_FILE_plus*)this);
+ }
+
+ // NB: Unused.
+ int
+ __basic_file<char>::overflow(int __c)
+ { return _IO_file_overflow(this, __c); }
+
+ // NB: Unused.
+ int
+ __basic_file<char>::underflow()
+ { return _IO_file_underflow(this); }
+
+ // NB: Unused.
+ int
+ __basic_file<char>::uflow()
+ { return _IO_default_uflow(this); }
+
+ // NB: Unused.
+ int
+ __basic_file<char>::pbackfail(int __c)
+ { return _IO_default_pbackfail(this, __c); }
+
+ streamsize
+ __basic_file<char>::xsputn(const char* __s, streamsize __n)
+ { return _IO_file_xsputn(this, __s, __n); }
+
+ streamoff
+ __basic_file<char>::seekoff(streamoff __off, ios_base::seekdir __way,
+ ios_base::openmode __mode)
+ { return _IO_file_seekoff(this, __off, __way, __mode); }
+
+ streamoff
+ __basic_file<char>::seekpos(streamoff __pos, ios_base::openmode __mode)
+ { return _IO_file_seekoff(this, __pos, ios_base::beg, __mode); }
+
+ // NB: Unused.
+ streambuf*
+ __basic_file<char>::setbuf(char* __b, int __len)
+ { return (streambuf*) _IO_file_setbuf(this,__b, __len); }
+
+ int
+ __basic_file<char>::sync()
+ { return _IO_file_sync(this); }
+
+ // NB: Unused.
+ int
+ __basic_file<char>::doallocate()
+ { return _IO_file_doallocate(this); }
+
+ // __basic_file<wchar_t> definitions
+#ifdef _GLIBCPP_USE_WCHAR_T
+ __basic_file<wchar_t>::__basic_file(__c_lock* __lock)
+ {
+#ifdef _IO_MTSAFE_IO
+ _lock = __lock;
+#endif
+ // Don't set the orientation of the stream when initializing.
+ _IO_no_init(this, 0, 0, &_M_wfile, &_IO_wfile_jumps);
+ _IO_JUMPS((_IO_FILE_plus *) this) = &_IO_wfile_jumps;
+ _IO_file_init((_IO_FILE_plus*)this);
+
+ // In addition, need to allocate the buffer...
+ _IO_wdoallocbuf(this);
+ // Setup initial positions for this buffer...
+ // if (!(_flags & _IO_NO_READS))
+ _IO_wsetg(this, _wide_data->_IO_buf_base, _wide_data->_IO_buf_base,
+ _wide_data->_IO_buf_base);
+ // if (!(_flags & _IO_NO_WRITES))
+ _IO_wsetp(this, _wide_data->_IO_buf_base, _wide_data->_IO_buf_base);
+
+ // Setup codecvt bits...
+ _codecvt = &__c_libio_codecvt;
+
+ // Do the same for narrow bits...
+ if (_IO_write_base == NULL)
+ {
+ _IO_doallocbuf(this);
+ // if (!(_flags & _IO_NO_READS))
+ _IO_setg(this, _IO_buf_base, _IO_buf_base, _IO_buf_base);
+ // if (!(_flags & _IO_NO_WRITES))
+ _IO_setp(this, _IO_buf_base, _IO_buf_base);
+ }
+ }
+
+ int
+ __basic_file<wchar_t>::overflow(int __c)
+ { return _IO_wfile_overflow(this, __c); }
+
+ int
+ __basic_file<wchar_t>::underflow()
+ { return _IO_wfile_underflow(this); }
+
+ // NB: Unused.
+ int
+ __basic_file<wchar_t>::uflow()
+ { return _IO_wdefault_uflow(this); }
+
+ // NB: Unused.
+ int
+ __basic_file<wchar_t>::pbackfail(int __c)
+ { return _IO_wdefault_pbackfail(this, __c); }
+
+ streamsize
+ __basic_file<wchar_t>::xsputn(const wchar_t* __s, streamsize __n)
+ { return _IO_wfile_xsputn(this, __s, __n); }
+
+ streamoff
+ __basic_file<wchar_t>::seekoff(streamoff __off, ios_base::seekdir __way,
+ ios_base::openmode __mode)
+ { return _IO_wfile_seekoff(this, __off, __way, __mode); }
+
+ streamoff
+ __basic_file<wchar_t>::seekpos(streamoff __pos, ios_base::openmode __mode)
+ { return _IO_wfile_seekoff(this, __pos, ios_base::beg, __mode); }
+
+ streambuf*
+ __basic_file<wchar_t>::setbuf(wchar_t* __b, int __len)
+ { return (streambuf*) _IO_wfile_setbuf(this,__b, __len); }
+
+ int
+ __basic_file<wchar_t>::sync()
+ { return _IO_wfile_sync(this); }
+
+ int
+ __basic_file<wchar_t>::doallocate()
+ { return _IO_wfile_doallocate(this); }
+#endif
+
+ // Need to instantiate base class here for type-info bits, etc
+ template struct __basic_file_base<char>;
+ template class __basic_file<char>;
+#ifdef _GLIBCPP_USE_WCHAR_T
+ template struct __basic_file_base<wchar_t>;
+ template class __basic_file<wchar_t>;
+#endif
+} // namespace std
+
+
+
+
+
+
+
diff --git a/libstdc++-v3/config/c_io_libio.cc b/libstdc++-v3/config/basic_file_libio.h
index 1747ddb3e6d..4c6591fd9f6 100644
--- a/libstdc++-v3/config/c_io_libio.cc
+++ b/libstdc++-v3/config/basic_file_libio.h
@@ -1,6 +1,6 @@
// Wrapper of C-language FILE struct -*- C++ -*-
-// Copyright (C) 2000 Free Software Foundation, Inc.
+// Copyright (C) 2000, 2001 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
@@ -31,11 +31,10 @@
// ISO C++ 14882: 27.8 File-based streams
//
-#include <bits/basic_file.h>
#include <libioP.h>
-namespace std {
-
+namespace std
+{
// __basic_file<char> specializations
template<>
__basic_file<char>::__basic_file(__c_lock* __lock);
@@ -128,12 +127,6 @@ namespace std {
__basic_file<wchar_t>::doallocate();
#endif
- // Generic definitions for __basic_file
- template<typename _CharT>
- int
- __basic_file<_CharT>::get_fileno(void)
- { return _fileno; }
-
template<typename _CharT>
__basic_file<_CharT>::~__basic_file()
{ _IO_file_finish(this, 0); }
@@ -190,9 +183,11 @@ namespace std {
template<typename _CharT>
__basic_file<_CharT>*
- __basic_file<_CharT>::sys_open(int __fd, ios_base::openmode __mode)
+ __basic_file<_CharT>::sys_open(__c_file_type* __f,
+ ios_base::openmode __mode)
{
__basic_file* __ret = NULL;
+ int __fd = fileno(__f);
int __p_mode = 0;
int __rw_mode = _IO_NO_READS + _IO_NO_WRITES;
char __c_mode[4];
@@ -202,7 +197,7 @@ namespace std {
if (!_IO_file_is_open(this))
{
_fileno = __fd;
- _flags &= ~(_IO_NO_READS+_IO_NO_WRITES);
+ _flags &= ~(_IO_NO_READS + _IO_NO_WRITES);
_flags |= _IO_DELETE_DONT_CLOSE;
_offset = _IO_pos_BAD;
int __mask = _IO_NO_READS + _IO_NO_WRITES + _IO_IS_APPENDING;
@@ -287,161 +282,4 @@ namespace std {
template<typename _CharT>
void
__basic_file<_CharT>::imbue(void* /*__v*/) { }
-
- // __basic_file<char> definitions
- __basic_file<char>::__basic_file(__c_lock* __lock)
- {
-#ifdef _IO_MTSAFE_IO
- _lock = __lock;
-#endif
- // Don't set the orientation of the stream when initializing.
-#ifdef _GLIBCPP_USE_WCHAR_T
- _IO_no_init(this, 0, 0, &_M_wfile, 0);
-#else /* !defined(_GLIBCPP_USE_WCHAR_T) */
- _IO_no_init(this, 0, 0, NULL, 0);
-#endif /* !defined(_GLIBCPP_USE_WCHAR_T) */
- _IO_JUMPS((_IO_FILE_plus *) this) = &_IO_file_jumps;
- _IO_file_init((_IO_FILE_plus*)this);
- }
-
- // NB: Unused.
- int
- __basic_file<char>::overflow(int __c)
- { return _IO_file_overflow(this, __c); }
-
- // NB: Unused.
- int
- __basic_file<char>::underflow()
- { return _IO_file_underflow(this); }
-
- // NB: Unused.
- int
- __basic_file<char>::uflow()
- { return _IO_default_uflow(this); }
-
- // NB: Unused.
- int
- __basic_file<char>::pbackfail(int __c)
- { return _IO_default_pbackfail(this, __c); }
-
- streamsize
- __basic_file<char>::xsputn(const char* __s, streamsize __n)
- { return _IO_file_xsputn(this, __s, __n); }
-
- streamoff
- __basic_file<char>::seekoff(streamoff __off, ios_base::seekdir __way,
- ios_base::openmode __mode)
- { return _IO_file_seekoff(this, __off, __way, __mode); }
-
- streamoff
- __basic_file<char>::seekpos(streamoff __pos, ios_base::openmode __mode)
- { return _IO_file_seekoff(this, __pos, ios_base::beg, __mode); }
-
- // NB: Unused.
- streambuf*
- __basic_file<char>::setbuf(char* __b, int __len)
- { return (streambuf*) _IO_file_setbuf(this,__b, __len); }
-
- int
- __basic_file<char>::sync()
- { return _IO_file_sync(this); }
-
- // NB: Unused.
- int
- __basic_file<char>::doallocate()
- { return _IO_file_doallocate(this); }
-
- // __basic_file<wchar_t> definitions
-#ifdef _GLIBCPP_USE_WCHAR_T
- __basic_file<wchar_t>::__basic_file(__c_lock* __lock)
- {
-#ifdef _IO_MTSAFE_IO
- _lock = __lock;
-#endif
- // Don't set the orientation of the stream when initializing.
- _IO_no_init(this, 0, 0, &_M_wfile, &_IO_wfile_jumps);
- _IO_JUMPS((_IO_FILE_plus *) this) = &_IO_wfile_jumps;
- _IO_file_init((_IO_FILE_plus*)this);
-
- // In addition, need to allocate the buffer...
- _IO_wdoallocbuf(this);
- // Setup initial positions for this buffer...
- // if (!(_flags & _IO_NO_READS))
- _IO_wsetg(this, _wide_data->_IO_buf_base, _wide_data->_IO_buf_base,
- _wide_data->_IO_buf_base);
- // if (!(_flags & _IO_NO_WRITES))
- _IO_wsetp(this, _wide_data->_IO_buf_base, _wide_data->_IO_buf_base);
-
- // Setup codecvt bits...
- _codecvt = &__c_libio_codecvt;
-
- // Do the same for narrow bits...
- if (_IO_write_base == NULL)
- {
- _IO_doallocbuf(this);
- // if (!(_flags & _IO_NO_READS))
- _IO_setg(this, _IO_buf_base, _IO_buf_base, _IO_buf_base);
- // if (!(_flags & _IO_NO_WRITES))
- _IO_setp(this, _IO_buf_base, _IO_buf_base);
- }
- }
-
- int
- __basic_file<wchar_t>::overflow(int __c)
- { return _IO_wfile_overflow(this, __c); }
-
- int
- __basic_file<wchar_t>::underflow()
- { return _IO_wfile_underflow(this); }
-
- // NB: Unused.
- int
- __basic_file<wchar_t>::uflow()
- { return _IO_wdefault_uflow(this); }
-
- // NB: Unused.
- int
- __basic_file<wchar_t>::pbackfail(int __c)
- { return _IO_wdefault_pbackfail(this, __c); }
-
- streamsize
- __basic_file<wchar_t>::xsputn(const wchar_t* __s, streamsize __n)
- { return _IO_wfile_xsputn(this, __s, __n); }
-
- streamoff
- __basic_file<wchar_t>::seekoff(streamoff __off, ios_base::seekdir __way,
- ios_base::openmode __mode)
- { return _IO_wfile_seekoff(this, __off, __way, __mode); }
-
- streamoff
- __basic_file<wchar_t>::seekpos(streamoff __pos, ios_base::openmode __mode)
- { return _IO_wfile_seekoff(this, __pos, ios_base::beg, __mode); }
-
- streambuf*
- __basic_file<wchar_t>::setbuf(wchar_t* __b, int __len)
- { return (streambuf*) _IO_wfile_setbuf(this,__b, __len); }
-
- int
- __basic_file<wchar_t>::sync()
- { return _IO_wfile_sync(this); }
-
- int
- __basic_file<wchar_t>::doallocate()
- { return _IO_wfile_doallocate(this); }
-#endif
-
- // Need to instantiate base class here for type-info bits, etc
- template struct __basic_file_base<char>;
- template class __basic_file<char>;
-#ifdef _GLIBCPP_USE_WCHAR_T
- template struct __basic_file_base<wchar_t>;
- template class __basic_file<wchar_t>;
-#endif
} // namespace std
-
-
-
-
-
-
-
diff --git a/libstdc++-v3/config/threads-posix.h b/libstdc++-v3/config/basic_file_stdio.cc
index 46d53f4ecc2..0bfd1c4acf9 100644
--- a/libstdc++-v3/config/threads-posix.h
+++ b/libstdc++-v3/config/basic_file_stdio.cc
@@ -1,6 +1,6 @@
-// thread support (posix case) -*- C++ -*-
+// Wrapper of C-language FILE struct -*- C++ -*-
-// Copyright (C) 2000 Free Software Foundation, Inc.
+// Copyright (C) 2000, 2001 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
@@ -27,65 +27,16 @@
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
-// threads-posix.h - Defines for using posix threads.
-
-// People trying to implement this should look at
-// libjava/include/posix-threads.h for more info on the interface that
-// java is using. It's one worth looking at.
-
-#ifndef _CPP_THREADS_POSIX
-#define _CPP_THREADS_POSIX
-
-#include <bits/c++config.h>
-
-//
-// Includes
-//
-#include <pthread.h>
-
-
-//
-// Defines
-//
-
-// Currently needed for stl/bits/stl_config.h
-# define _PTHREADS
-
-// Currently libio expects this macro
-#define _IO_MTSAFE_IO
-
-// May be needed on solaris.
-//#define PTHREAD_MUTEX_INITIALIZER {{{0},0},{{{0}}},{0}}
-
-
-//
-// Typedefs.
-//
-namespace std {
- typedef pthread_mutex_t __mutext_type;
-} // std
-
-
-//
-// Condition variables.
//
-
-
-//
-// Mutexes.
-//
-
-
+// ISO C++ 14882: 27.8 File-based streams
//
-// Thread creation and manipulation.
-//
-
-#endif // _CPP_THREADS_POSIX
-
-
-
-
-
-
+#include <bits/basic_file.h>
+namespace std
+{
+ template class __basic_file<char>;
+#ifdef _GLIBCPP_USE_WCHAR_T
+ template class __basic_file<wchar_t>;
+#endif
+} // namespace std
diff --git a/libstdc++-v3/config/c_io_stdio.cc b/libstdc++-v3/config/basic_file_stdio.h
index c9ac7705c55..edf4d98baa9 100644
--- a/libstdc++-v3/config/c_io_stdio.cc
+++ b/libstdc++-v3/config/basic_file_stdio.h
@@ -31,22 +31,14 @@
// ISO C++ 14882: 27.8 File-based streams
//
-#include <bits/basic_file.h>
-#include <unistd.h>
-
-namespace std {
-
+namespace std
+{
// Generic definitions for __basic_file
template<typename _CharT>
__basic_file<_CharT>::__basic_file(__c_lock* /*__lock*/)
- : _M_fileno(-1), _M_cfile(NULL) { }
+ : _M_cfile(NULL), _M_cfile_created(false) { }
template<typename _CharT>
- int
- __basic_file<_CharT>::get_fileno(void)
- { return _M_fileno; }
-
- template<typename _CharT>
__basic_file<_CharT>::~__basic_file()
{
if (this->is_open())
@@ -86,28 +78,33 @@ namespace std {
template<typename _CharT>
__basic_file<_CharT>*
- __basic_file<_CharT>::sys_open(int __fd, ios_base::openmode __mode)
+ __basic_file<_CharT>::sys_open(__c_file_type* __file, ios_base::openmode)
{
__basic_file* __ret = NULL;
- int __p_mode = 0;
- int __rw_mode = 0;
- char __c_mode[4];
-
- _M_open_mode(__mode, __p_mode, __rw_mode, __c_mode);
- int __dupfd = dup(__fd);
-
- if (__dupfd != -1 && !this->is_open())
+ if (!this->is_open() && __file)
{
- if ((_M_cfile = fdopen(__dupfd, __c_mode)))
- {
- _M_fileno = __dupfd;
- __ret = this;
- }
+ _M_cfile = __file;
+ _M_cfile_created = false;
+ __ret = this;
}
return __ret;
}
+
+ template<typename _CharT>
+ _CharT
+ __basic_file<_CharT>::sys_getc()
+ {
+ return getc (_M_cfile);
+ }
+
+ template<typename _CharT>
+ _CharT
+ __basic_file<_CharT>::sys_ungetc(_CharT __s)
+ {
+ return ungetc (__s, _M_cfile);
+ }
template<typename _CharT>
__basic_file<_CharT>*
@@ -125,7 +122,7 @@ namespace std {
{
if ((_M_cfile = fopen(__name, __c_mode)))
{
- _M_fileno = fileno(_M_cfile);
+ _M_cfile_created = true;
__ret = this;
}
}
@@ -134,19 +131,15 @@ namespace std {
template<typename _CharT>
bool
- __basic_file<_CharT>::is_open() { return _M_fileno >= 0; }
+ __basic_file<_CharT>::is_open() { return _M_cfile != 0; }
template<typename _CharT>
__basic_file<_CharT>*
__basic_file<_CharT>::close()
{
__basic_file* __retval = static_cast<__basic_file*>(NULL);
- bool __testopen = fclose(_M_cfile);
- if (!__testopen)
- {
- __retval = this;
- _M_fileno = -1;
- }
+ if (_M_cfile_created && fclose(_M_cfile))
+ __retval = this;
return __retval;
}
@@ -256,14 +249,4 @@ namespace std {
template<typename _CharT>
void
__basic_file<_CharT>::imbue(void* /*__v*/) { }
-
- // Need to instantiate base class here for type-info bits, etc
- template struct __basic_file_base<char>;
- template class __basic_file<char>;
-#ifdef _GLIBCPP_USE_WCHAR_T
- template struct __basic_file_base<wchar_t>;
- template class __basic_file<wchar_t>;
-#endif
} // namespace std
-
-
diff --git a/libstdc++-v3/config/c_io_libio.h b/libstdc++-v3/config/c_io_libio.h
index 515a09eafe5..59267985f96 100644
--- a/libstdc++-v3/config/c_io_libio.h
+++ b/libstdc++-v3/config/c_io_libio.h
@@ -1,6 +1,6 @@
// underlying io library -*- C++ -*-
-// Copyright (C) 2000 Free Software Foundation, Inc.
+// Copyright (C) 2000, 2001 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
@@ -34,8 +34,8 @@
#include <libio.h>
-namespace std {
-
+namespace std
+{
// from fpos.h
typedef _IO_ssize_t streamsize; // Signed integral type
typedef _IO_ssize_t wstreamsize;
@@ -43,11 +43,9 @@ namespace std {
#if defined(_G_IO_IO_FILE_VERSION) && _G_IO_IO_FILE_VERSION == 0x20001
typedef _IO_off64_t streamoff;
typedef _IO_fpos64_t __c_streampos;
- typedef _IO_off64_t wstreamoff;
#else
typedef _IO_off_t streamoff;
typedef _IO_fpos_t __c_streampos;
- typedef _IO_off_t wstreamoff;
#endif
#ifdef _GLIBCPP_USE_THREADS
@@ -103,7 +101,6 @@ namespace std {
static const __int_type _S_out = _IOS_OUTPUT;
static const __int_type _S_trunc = _IOS_TRUNC;
};
-
}
#endif // _CPP_IO_LIBIO_H
diff --git a/libstdc++-v3/config/c_io_stdio.h b/libstdc++-v3/config/c_io_stdio.h
index c5f2c9533f8..1ea8b3081fc 100644
--- a/libstdc++-v3/config/c_io_stdio.h
+++ b/libstdc++-v3/config/c_io_stdio.h
@@ -1,6 +1,6 @@
// underlying io library -*- C++ -*-
-// Copyright (C) 2000 Free Software Foundation, Inc.
+// Copyright (C) 2000, 2001 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,26 +32,21 @@
#ifndef _CPP_IO_STDIO_H
#define _CPP_IO_STDIO_H 1
-#include <stdio.h>
-#include <stddef.h>
-#include <bits/c++threads.h>
-
-namespace std {
+#include <cstdio>
+#include <cstddef>
+#include <bits/gthr.h>
+namespace std
+{
// from fpos.h
typedef long streamoff;
typedef ptrdiff_t streamsize; // Signed integral type
#if _GLIBCPP_USE_WCHAR_T
- typedef long wstreamoff;
typedef ptrdiff_t wstreamsize;
#endif
typedef fpos_t __c_streampos;
-#ifdef _GLIBCPP_USE_THREADS
- typedef __mutext_type __c_lock;
-#else
- typedef int __c_lock;
-#endif
+ typedef __gthread_mutex_t __c_lock;
// from basic_file.h
#define _GLIBCPP_BASIC_FILE_ENCAPSULATION 1
@@ -59,52 +54,41 @@ namespace std {
// from ios_base.h
struct __ios_flags
- {
- typedef short __int_type;
-
- static const __int_type _S_boolalpha = 0x0001;
- static const __int_type _S_dec = 0x0002;
- static const __int_type _S_fixed = 0x0004;
- static const __int_type _S_hex = 0x0008;
- static const __int_type _S_internal = 0x0010;
- static const __int_type _S_left = 0x0020;
- static const __int_type _S_oct = 0x0040;
- static const __int_type _S_right = 0x0080;
- static const __int_type _S_scientific = 0x0100;
- static const __int_type _S_showbase = 0x0200;
- static const __int_type _S_showpoint = 0x0400;
- static const __int_type _S_showpos = 0x0800;
- static const __int_type _S_skipws = 0x1000;
- static const __int_type _S_unitbuf = 0x2000;
- static const __int_type _S_uppercase = 0x4000;
- static const __int_type _S_adjustfield = 0x0020 | 0x0080 | 0x0010;
- static const __int_type _S_basefield = 0x0002 | 0x0040 | 0x0008;
- static const __int_type _S_floatfield = 0x0100 | 0x0004;
+ {
+ typedef short __int_type;
+
+ static const __int_type _S_boolalpha = 0x0001;
+ static const __int_type _S_dec = 0x0002;
+ static const __int_type _S_fixed = 0x0004;
+ static const __int_type _S_hex = 0x0008;
+ static const __int_type _S_internal = 0x0010;
+ static const __int_type _S_left = 0x0020;
+ static const __int_type _S_oct = 0x0040;
+ static const __int_type _S_right = 0x0080;
+ static const __int_type _S_scientific = 0x0100;
+ static const __int_type _S_showbase = 0x0200;
+ static const __int_type _S_showpoint = 0x0400;
+ static const __int_type _S_showpos = 0x0800;
+ static const __int_type _S_skipws = 0x1000;
+ static const __int_type _S_unitbuf = 0x2000;
+ static const __int_type _S_uppercase = 0x4000;
+ static const __int_type _S_adjustfield = 0x0020 | 0x0080 | 0x0010;
+ static const __int_type _S_basefield = 0x0002 | 0x0040 | 0x0008;
+ static const __int_type _S_floatfield = 0x0100 | 0x0004;
// 27.4.2.1.3 Type ios_base::iostate
- static const __int_type _S_badbit = 0x01;
- static const __int_type _S_eofbit = 0x02;
- static const __int_type _S_failbit = 0x04;
+ static const __int_type _S_badbit = 0x01;
+ static const __int_type _S_eofbit = 0x02;
+ static const __int_type _S_failbit = 0x04;
// 27.4.2.1.4 Type openmode
- static const __int_type _S_app = 0x01;
- static const __int_type _S_ate = 0x02;
- static const __int_type _S_bin = 0x04;
- static const __int_type _S_in = 0x08;
- static const __int_type _S_out = 0x10;
- static const __int_type _S_trunc = 0x20;
+ static const __int_type _S_app = 0x01;
+ static const __int_type _S_ate = 0x02;
+ static const __int_type _S_bin = 0x04;
+ static const __int_type _S_in = 0x08;
+ static const __int_type _S_out = 0x10;
+ static const __int_type _S_trunc = 0x20;
};
-
}
#endif // _CPP_IO_STDIO_H
-
-
-
-
-
-
-
-
-
-
diff --git a/libstdc++-v3/config/c_locale_gnu.h b/libstdc++-v3/config/c_locale_gnu.h
index eac640a5007..72124ae837b 100644
--- a/libstdc++-v3/config/c_locale_gnu.h
+++ b/libstdc++-v3/config/c_locale_gnu.h
@@ -33,6 +33,8 @@
// Written by Benjamin Kosnik <bkoz@redhat.com>
+#include <clocale>
+
namespace std
{
typedef __locale_t __c_locale;
diff --git a/libstdc++-v3/config/cpu/alpha/bits/atomicity.h b/libstdc++-v3/config/cpu/alpha/bits/atomicity.h
index d2f67bb71a9..3f7b5c8aac4 100644
--- a/libstdc++-v3/config/cpu/alpha/bits/atomicity.h
+++ b/libstdc++-v3/config/cpu/alpha/bits/atomicity.h
@@ -1,21 +1,31 @@
-/* Low-level functions for atomic operations. Alpha version.
- Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public License as
- published by the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
-
- The GNU C 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
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with the GNU C Library; see the file COPYING.LIB. If not,
- write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
+// Low-level functions for atomic operations: Alpha version -*- C++ -*-
+
+// Copyright (C) 1999, 2000, 2001 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.
#ifndef _BITS_ATOMICITY_H
#define _BITS_ATOMICITY_H 1
diff --git a/libstdc++-v3/config/cpu/arm/bits/atomicity.h b/libstdc++-v3/config/cpu/arm/bits/atomicity.h
index e933ca4688c..4bc984c6169 100644
--- a/libstdc++-v3/config/cpu/arm/bits/atomicity.h
+++ b/libstdc++-v3/config/cpu/arm/bits/atomicity.h
@@ -1,21 +1,31 @@
-/* Low-level functions for atomic operations. ARM version.
- Copyright (C) 2000 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
+// Low-level functions for atomic operations: ARM version -*- C++ -*-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public License as
- published by the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
+// Copyright (C) 2000, 2001 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.
- The GNU C 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
- Library General Public License for more details.
+// 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 Library General Public
- License along with the GNU C Library; see the file COPYING.LIB. If not,
- write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
+// 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.
#ifndef _BITS_ATOMICITY_H
#define _BITS_ATOMICITY_H 1
diff --git a/libstdc++-v3/config/cpu/generic/bits/atomicity.h b/libstdc++-v3/config/cpu/generic/bits/atomicity.h
index ee1fc8a1305..36fcaf2de5b 100644
--- a/libstdc++-v3/config/cpu/generic/bits/atomicity.h
+++ b/libstdc++-v3/config/cpu/generic/bits/atomicity.h
@@ -1,21 +1,31 @@
-/* Low-level functions for atomic operations. Stub version.
- Copyright (C) 1997 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public License as
- published by the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
-
- The GNU C 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
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with the GNU C Library; see the file COPYING.LIB. If not,
- write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
+// Low-level functions for atomic operations: Generic version -*- C++ -*-
+
+// Copyright (C) 1999, 2001 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.
#ifndef _BITS_ATOMICITY_H
#define _BITS_ATOMICITY_H 1
diff --git a/libstdc++-v3/config/cpu/generic/bits/limits.h b/libstdc++-v3/config/cpu/generic/bits/limits.h
new file mode 100644
index 00000000000..8fa5a82145f
--- /dev/null
+++ b/libstdc++-v3/config/cpu/generic/bits/limits.h
@@ -0,0 +1,40 @@
+// Copyright (C) 2001 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.
+
+#ifndef _GLIBCPP_CPU_LIMITS
+#define _GLIBCPP_CPU_LIMITS 1
+
+// Nothing is defined in the generic file. In that way, we fall back
+// on the defaults in std_limits.h.
+
+// If you need to override these defaults, you can either use a
+// CPU-specific version (in which case you must modify
+// configure.target) or you must add the overrides to your
+// os_defines.h. In general, if all systems for your CPU use the
+// same values, it is best to use a cpu-specific configuration file.
+
+#endif
diff --git a/libstdc++-v3/config/cpu/i386/bits/atomicity.h b/libstdc++-v3/config/cpu/i386/bits/atomicity.h
index b3e07f754c4..4733503ff44 100644
--- a/libstdc++-v3/config/cpu/i386/bits/atomicity.h
+++ b/libstdc++-v3/config/cpu/i386/bits/atomicity.h
@@ -1,21 +1,31 @@
-/* Low-level functions for atomic operations. ix86 version, x >= 4.
- Copyright (C) 1997 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public License as
- published by the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
-
- The GNU C 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
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with the GNU C Library; see the file COPYING.LIB. If not,
- write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
+// Low-level functions for atomic operations: x86, x < 4 version -*- C++ -*-
+
+// Copyright (C) 1999, 2000, 2001 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.
#ifndef _BITS_ATOMICITY_H
#define _BITS_ATOMICITY_H 1
diff --git a/libstdc++-v3/config/cpu/i386/bits/limits.h b/libstdc++-v3/config/cpu/i386/bits/limits.h
new file mode 100644
index 00000000000..be304e2d805
--- /dev/null
+++ b/libstdc++-v3/config/cpu/i386/bits/limits.h
@@ -0,0 +1,33 @@
+// Copyright (C) 2001 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.
+
+#ifndef _GLIBCPP_CPU_LIMITS
+#define _GLIBCPP_CPU_LIMITS 1
+
+#define __glibcpp_long_double_bits 80
+
+#endif
diff --git a/libstdc++-v3/config/cpu/i486/bits/atomicity.h b/libstdc++-v3/config/cpu/i486/bits/atomicity.h
index 617be5ef659..9dc4e716f3a 100644
--- a/libstdc++-v3/config/cpu/i486/bits/atomicity.h
+++ b/libstdc++-v3/config/cpu/i486/bits/atomicity.h
@@ -1,21 +1,31 @@
-/* Low-level functions for atomic operations. ix86 version, x >= 4.
- Copyright (C) 1997 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public License as
- published by the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
-
- The GNU C 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
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with the GNU C Library; see the file COPYING.LIB. If not,
- write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
+// Low-level functions for atomic operations: x86, x >= 4 version -*- C++ -*-
+
+// Copyright (C) 1999, 2000, 2001 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.
#ifndef _BITS_ATOMICITY_H
#define _BITS_ATOMICITY_H 1
diff --git a/libstdc++-v3/config/cpu/ia64/bits/atomicity.h b/libstdc++-v3/config/cpu/ia64/bits/atomicity.h
index d229331de72..da57f3e84d1 100644
--- a/libstdc++-v3/config/cpu/ia64/bits/atomicity.h
+++ b/libstdc++-v3/config/cpu/ia64/bits/atomicity.h
@@ -1,21 +1,31 @@
-/* Low-level functions for atomic operations.
- Copyright (C) 2000 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public License as
- published by the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
-
- The GNU C 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
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with the GNU C Library; see the file COPYING.LIB. If not,
- write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
+// Low-level functions for atomic operations: IA64 version -*- C++ -*-
+
+// Copyright (C) 2000, 2001 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.
#ifndef _BITS_ATOMICITY_H
#define _BITS_ATOMICITY_H 1
diff --git a/libstdc++-v3/config/cpu/m68k/bits/atomicity.h b/libstdc++-v3/config/cpu/m68k/bits/atomicity.h
new file mode 100644
index 00000000000..c5d339469e3
--- /dev/null
+++ b/libstdc++-v3/config/cpu/m68k/bits/atomicity.h
@@ -0,0 +1,158 @@
+// Low-level functions for atomic operations: m68k version -*- C++ -*-
+
+// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// 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.
+
+#ifndef _BITS_ATOMICITY_H
+#define _BITS_ATOMICITY_H 1
+
+typedef int _Atomic_word;
+
+#if defined(__mc68020__) || defined(__mc68030__) \
+ || defined(__mc68040__) || defined(__mc68060__)
+// These variants support compare-and-swap.
+
+static inline _Atomic_word
+__attribute__ ((__unused__))
+__exchange_and_add (volatile _Atomic_word *__mem, int __val)
+{
+ register _Atomic_word __result = *__mem;
+ register _Atomic_word __temp;
+ __asm__ __volatile__ ("1: move%.l %0,%1\n\t"
+ "add%.l %2,%1\n\t"
+ "cas%.l %0,%1,%3\n\t"
+ "jbne 1b"
+ : "=d" (__result), "=&d" (__temp)
+ : "d" (__val), "m" (*__mem), "0" (__result)
+ : "memory");
+ return __result;
+}
+
+#elif defined(__rtems__)
+ /*
+ * TAS/JBNE is unsafe on systems with strict priority-based scheduling.
+ * Disable interrupts, which we can do only from supervisor mode.
+ */
+static inline _Atomic_word
+__attribute__ ((__unused__))
+__exchange_and_add (volatile _Atomic_word *__mem, int __val)
+{
+ _Atomic_word __result;
+ short __level, __tmpsr;
+ __asm__ __volatile__ ("move%.w %%sr,%0\n\tor%.l %0,%1\n\tmove%.w %1,%%sr"
+ : "=d"(__level), "=d"(__tmpsr) : "1"(0x700));
+
+ __result = *__mem;
+ *__mem = __result + __val;
+
+ __asm__ __volatile__ ("move%.w %0,%%sr" : : "d"(__level));
+
+ return __result;
+}
+
+#elif !defined(__mcf5200__) && !defined(__mcf5300__)
+// 68000, 68010, cpu32 and 5400 support test-and-set.
+
+template <int __inst>
+struct __Atomicity_lock
+{
+ static volatile unsigned char _S_atomicity_lock;
+};
+
+template <int __inst>
+volatile unsigned char __Atomicity_lock<__inst>::_S_atomicity_lock = 0;
+
+template volatile unsigned char __Atomicity_lock<0>::_S_atomicity_lock;
+
+static inline _Atomic_word
+__attribute__ ((__unused__))
+__exchange_and_add (volatile _Atomic_word *__mem, int __val)
+{
+ _Atomic_word __result;
+
+ __asm__ __volatile__("1: tas %0\n\tjbne 1b"
+ : "=m"(__Atomicity_lock<0>::_S_atomicity_lock)
+ : "m"(__Atomicity_lock<0>::_S_atomicity_lock));
+
+ __result = *__mem;
+ *__mem = __result + __val;
+
+ __Atomicity_lock<0>::_S_atomicity_lock = 0;
+
+ return __result;
+}
+
+#elif defined(__vxWorks__) || defined(__embedded__)
+// The best we can hope for is to disable interrupts, which we
+// can only do from supervisor mode.
+
+static inline _Atomic_word
+__attribute__ ((__unused__))
+__exchange_and_add (volatile _Atomic_word *__mem, int __val)
+{
+ _Atomic_word __result;
+ short __level, __tmpsr;
+ __asm__ __volatile__ ("move%.w %%sr,%0\n\tor%.l %0,%1\n\tmove%.w %1,%%sr"
+ : "=d"(__level), "=d"(__tmpsr) : "1"(0x700));
+
+ __result = *__mem;
+ *__mem = __result + __val;
+
+ __asm__ __volatile__ ("move%.w %0,%%sr" : : "d"(__level));
+
+ return __result;
+}
+
+#else
+// These variants do not support any atomic operations at all.
+
+#warning "__exchange_and_add is not atomic for this target"
+
+static inline _Atomic_word
+__attribute__ ((__unused__))
+__exchange_and_add (volatile _Atomic_word *__mem, int __val)
+{
+ _Atomic_word __result;
+
+ __result = *__mem;
+ *__mem = __result + __val;
+
+ return __result;
+}
+
+#endif /* CAS / IRQ / TAS */
+
+static inline void
+__attribute__ ((__unused__))
+__atomic_add (volatile _Atomic_word* __mem, int __val)
+{
+ // Careful: using add.l with a memory destination is not
+ // architecturally guaranteed to be atomic.
+ (void) __exchange_and_add (__mem, __val);
+}
+
+#endif /* atomicity.h */
diff --git a/libstdc++-v3/config/cpu/mips/bits/atomicity.h b/libstdc++-v3/config/cpu/mips/bits/atomicity.h
new file mode 100644
index 00000000000..cab43eb0d26
--- /dev/null
+++ b/libstdc++-v3/config/cpu/mips/bits/atomicity.h
@@ -0,0 +1,105 @@
+// Low-level functions for atomic operations. MIPS II version.
+
+// Copyright (C) 2001 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.
+
+#ifndef _BITS_ATOMICITY_H
+#define _BITS_ATOMICITY_H 1
+
+// #include <sgidefs.h>
+// #ifdef (_MIPS_ISA_MIPS2)
+
+typedef int _Atomic_word;
+
+static inline int
+__attribute__ ((unused))
+__exchange_and_add (volatile _Atomic_word *__mem, int __val)
+{
+ int __result, __tmp;
+
+ __asm__ __volatile__
+ ("/* Inline exchange & add */\n\t"
+ "1:\n\t"
+ "ll %0,%3\n\t"
+ "addu %1,%4,%0\n\t"
+ "sc %1,%2\n\t"
+ "beqz %1,1b\n\t"
+ "/* End exchange & add */"
+ : "=&r"(__result), "=&r"(__tmp), "=m"(*__mem)
+ : "m" (*__mem), "r"(__val)
+ : "memory");
+
+ return __result;
+}
+
+static inline void
+__attribute__ ((unused))
+__atomic_add (volatile _Atomic_word *__mem, int __val)
+{
+ int __result;
+
+ __asm__ __volatile__
+ ("/* Inline atomic add */\n\t"
+ "1:\n\t"
+ "ll %0,%2\n\t"
+ "addu %0,%3,%0\n\t"
+ "sc %0,%1\n\t"
+ "beqz %0,1b\n\t"
+ "/* End atomic add */"
+ : "=&r"(__result), "=m"(*__mem)
+ : "m" (*__mem), "r"(__val)
+ : "memory");
+}
+
+static inline int
+__attribute__ ((unused))
+__compare_and_swap (volatile long int *__p, long int __oldval,
+ long int __newval)
+{
+ long int __ret;
+
+ __asm__ __volatile__
+ ("/* Inline compare & swap */\n\t"
+ "1:\n\t"
+ "ll %0,%4\n\t"
+ ".set push\n"
+ ".set noreorder\n\t"
+ "bne %0,%2,2f\n\t"
+ "move %0,%3\n\t"
+ ".set pop\n\t"
+ "sc %0,%1\n\t"
+ "beqz %0,1b\n"
+ "2:\n\t"
+ "/* End compare & swap */"
+ : "=&r" (__ret), "=m" (*__p)
+ : "r" (__oldval), "r" (__newval), "m" (*__p)
+ : "memory");
+
+ return __ret;
+}
+
+#endif /* atomicity.h */
diff --git a/libstdc++-v3/config/cpu/powerpc/bits/atomicity.h b/libstdc++-v3/config/cpu/powerpc/bits/atomicity.h
index 667572d7d9e..35a84f5f2a0 100644
--- a/libstdc++-v3/config/cpu/powerpc/bits/atomicity.h
+++ b/libstdc++-v3/config/cpu/powerpc/bits/atomicity.h
@@ -1,21 +1,31 @@
-/* Low-level functions for atomic operations. PowerPC version.
- Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
+// Low-level functions for atomic operations: PowerPC version -*- C++ -*-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public License as
- published by the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
+// Copyright (C) 1999, 2000, 2001 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.
- The GNU C 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
- Library General Public License for more details.
+// 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 Library General Public
- License along with the GNU C Library; see the file COPYING.LIB. If not,
- write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
+// 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.
#ifndef _BITS_ATOMICITY_H
#define _BITS_ATOMICITY_H 1
diff --git a/libstdc++-v3/config/cpu/powerpc/bits/limits.h b/libstdc++-v3/config/cpu/powerpc/bits/limits.h
new file mode 100644
index 00000000000..f0ff04dedaa
--- /dev/null
+++ b/libstdc++-v3/config/cpu/powerpc/bits/limits.h
@@ -0,0 +1,33 @@
+// Copyright (C) 2001 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.
+
+#ifndef _GLIBCPP_CPU_LIMITS
+#define _GLIBCPP_CPU_LIMITS 1
+
+#define __glibcpp_long_double_bits 64
+
+#endif
diff --git a/libstdc++-v3/config/cpu/s390/bits/atomicity.h b/libstdc++-v3/config/cpu/s390/bits/atomicity.h
new file mode 100644
index 00000000000..331c29a570a
--- /dev/null
+++ b/libstdc++-v3/config/cpu/s390/bits/atomicity.h
@@ -0,0 +1,60 @@
+// Low-level functions for atomic operations: S/390 version -*- C++ -*-
+
+// Copyright (C) 2001 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.
+
+#ifndef _BITS_ATOMICITY_H
+#define _BITS_ATOMICITY_H 1
+
+typedef int _Atomic_word;
+
+static inline _Atomic_word
+__attribute__ ((__unused__))
+__exchange_and_add (volatile _Atomic_word *__mem, int __val)
+{
+ register _Atomic_word __old_val, __new_val;
+
+ __asm__ __volatile__ (" l %0,0(%2)\n"
+ "0: lr %1,%0\n"
+ " ar %1,%3\n"
+ " cs %0,%1,0(%2)\n"
+ " jl 0b"
+ : "=&d" (__old_val), "=&d" (__new_val)
+ : "a" (__mem), "d" (__val) : "cc", "memory" );
+ return __old_val;
+}
+
+static inline void
+__attribute__ ((__unused__))
+__atomic_add (volatile _Atomic_word *__mem, int __val)
+{
+ __exchange_and_add (__mem, __val);
+}
+
+#endif /* atomicity.h */
+
+
diff --git a/libstdc++-v3/config/cpu/sparc/sparc32/bits/atomicity.h b/libstdc++-v3/config/cpu/sparc/sparc32/bits/atomicity.h
index 9b6690a153e..573c56b3603 100644
--- a/libstdc++-v3/config/cpu/sparc/sparc32/bits/atomicity.h
+++ b/libstdc++-v3/config/cpu/sparc/sparc32/bits/atomicity.h
@@ -1,32 +1,52 @@
-/* Low-level functions for atomic operations. Sparc32 version.
- Copyright (C) 1999 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
+// Low-level functions for atomic operations: Sparc32 version -*- C++ -*-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public License as
- published by the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
+// Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
- The GNU C 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
- Library General Public License for more details.
+// 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 Library General Public
- License along with the GNU C Library; see the file COPYING.LIB. If not,
- write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
+// 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.
#ifndef _BITS_ATOMICITY_H
#define _BITS_ATOMICITY_H 1
typedef int _Atomic_word;
+template <int __inst>
+struct __Atomicity_lock
+{
+ static unsigned char _S_atomicity_lock;
+};
+
+template <int __inst>
+unsigned char __Atomicity_lock<__inst>::_S_atomicity_lock = 0;
+
+template unsigned char __Atomicity_lock<0>::_S_atomicity_lock;
+
static int
__attribute__ ((__unused__))
__exchange_and_add (volatile _Atomic_word* __mem, int __val)
{
- static unsigned char __lock;
_Atomic_word __result, __tmp;
__asm__ __volatile__("1: ldstub [%1], %0\n\t"
@@ -34,13 +54,13 @@ __exchange_and_add (volatile _Atomic_word* __mem, int __val)
" bne 1b\n\t"
" nop"
: "=&r" (__tmp)
- : "r" (&__lock)
+ : "r" (&__Atomicity_lock<0>::_S_atomicity_lock)
: "memory");
__result = *__mem;
*__mem += __val;
__asm__ __volatile__("stb %%g0, [%0]"
: /* no outputs */
- : "r" (&__lock)
+ : "r" (&__Atomicity_lock<0>::_S_atomicity_lock)
: "memory");
return __result;
}
@@ -49,7 +69,6 @@ static void
__attribute__ ((__unused__))
__atomic_add (volatile _Atomic_word* __mem, int __val)
{
- static unsigned char __lock;
_Atomic_word __tmp;
__asm__ __volatile__("1: ldstub [%1], %0\n\t"
@@ -57,12 +76,12 @@ __atomic_add (volatile _Atomic_word* __mem, int __val)
" bne 1b\n\t"
" nop"
: "=&r" (__tmp)
- : "r" (&__lock)
+ : "r" (&__Atomicity_lock<0>::_S_atomicity_lock)
: "memory");
*__mem += __val;
__asm__ __volatile__("stb %%g0, [%0]"
: /* no outputs */
- : "r" (&__lock)
+ : "r" (&__Atomicity_lock<0>::_S_atomicity_lock)
: "memory");
}
diff --git a/libstdc++-v3/config/cpu/sparc/sparc64/bits/atomicity.h b/libstdc++-v3/config/cpu/sparc/sparc64/bits/atomicity.h
index 4257e839171..c2dc0dc69b0 100644
--- a/libstdc++-v3/config/cpu/sparc/sparc64/bits/atomicity.h
+++ b/libstdc++-v3/config/cpu/sparc/sparc64/bits/atomicity.h
@@ -1,21 +1,31 @@
-/* Low-level functions for atomic operations. Sparc64 version.
- Copyright (C) 1999 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
+// Low-level functions for atomic operations: Sparc64 version -*- C++ -*-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public License as
- published by the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
+// Copyright (C) 1999, 2000, 2001 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.
- The GNU C 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
- Library General Public License for more details.
+// 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 Library General Public
- License along with the GNU C Library; see the file COPYING.LIB. If not,
- write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
+// 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.
#ifndef _BITS_ATOMICITY_H
#define _BITS_ATOMICITY_H 1
@@ -61,7 +71,7 @@ static inline int
__attribute__ ((__unused__))
__compare_and_swap (volatile long *__p, long __oldval, long __newval)
{
- register int __tmp,
+ register int __tmp;
register long __tmp2;
__asm__ __volatile__("1: ldx [%4], %0\n\t"
diff --git a/libstdc++-v3/config/os/aix/bits/atomicity.h b/libstdc++-v3/config/os/aix/bits/atomicity.h
index fa8350ab8f7..ecac7dac225 100644
--- a/libstdc++-v3/config/os/aix/bits/atomicity.h
+++ b/libstdc++-v3/config/os/aix/bits/atomicity.h
@@ -1,21 +1,31 @@
-/* Low-level functions for atomic operations. AIX version.
- Copyright (C) 2000, 2001 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public License as
- published by the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
-
- The GNU C 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
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with the GNU C Library; see the file COPYING.LIB. If not,
- write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
+// Low-level functions for atomic operations: AIX version -*- C++ -*-
+
+// Copyright (C) 2000, 2001 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.
#ifndef _BITS_ATOMICITY_H
#define _BITS_ATOMICITY_H 1
diff --git a/libstdc++-v3/config/os/aix/bits/ctype_base.h b/libstdc++-v3/config/os/aix/bits/ctype_base.h
index 166e5d06307..ed414408dbb 100644
--- a/libstdc++-v3/config/os/aix/bits/ctype_base.h
+++ b/libstdc++-v3/config/os/aix/bits/ctype_base.h
@@ -40,7 +40,7 @@
// NB: Offsets into ctype<char>::_M_table force a particular size
// on the mask type. Because of this, we don't use an enum.
- typedef unsigned char mask;
+ typedef unsigned int mask;
static const mask upper = _ISUPPER;
static const mask lower = _ISLOWER;
static const mask alpha = _ISALPHA;
diff --git a/libstdc++-v3/config/os/aix/bits/os_defines.h b/libstdc++-v3/config/os/aix/bits/os_defines.h
index b095e63e7ff..101a0b26f86 100644
--- a/libstdc++-v3/config/os/aix/bits/os_defines.h
+++ b/libstdc++-v3/config/os/aix/bits/os_defines.h
@@ -55,5 +55,15 @@
#undef _G_USING_THUNKS
#define _G_USING_THUNKS 0
+#define __glibcpp_long_double_bits 64
+
+#if !defined(_AIX51) || !defined(__64BIT__)
+#define __glibcpp_wchar_t_bits 16
+#endif
+
+#ifdef __64BIT__
+#define __glibcpp_long_bits 64
+#endif
+
#endif
diff --git a/libstdc++-v3/config/os/bsd/freebsd/bits/os_defines.h b/libstdc++-v3/config/os/bsd/freebsd/bits/os_defines.h
index 1cb71d149ec..3a6803f8f3d 100644
--- a/libstdc++-v3/config/os/bsd/freebsd/bits/os_defines.h
+++ b/libstdc++-v3/config/os/bsd/freebsd/bits/os_defines.h
@@ -35,6 +35,7 @@
/* System-specific #define, typedefs, corrections, etc, go here. This
file will come before all others. */
+#define _GLIBCPP_AVOID_FSEEK 1
#endif
diff --git a/libstdc++-v3/config/os/djgpp/bits/ctype_base.h b/libstdc++-v3/config/os/djgpp/bits/ctype_base.h
index b64f4705d23..018e20e4a4a 100644
--- a/libstdc++-v3/config/os/djgpp/bits/ctype_base.h
+++ b/libstdc++-v3/config/os/djgpp/bits/ctype_base.h
@@ -36,22 +36,21 @@
typedef unsigned short mask;
// Non-standard typedefs.
- typedef unsigned char __to_type;
-
- enum
- {
- space = __dj_ISSPACE, // Whitespace
- print = __dj_ISPRINT, // Printing
- cntrl = __dj_ISCNTRL, // Control character
- upper = __dj_ISUPPER, // UPPERCASE
- lower = __dj_ISLOWER, // lowercase
- alpha = __dj_ISALPHA, // Alphabetic
- digit = __dj_ISDIGIT, // Numeric
- punct = __dj_ISPUNCT, // Punctuation
- xdigit = __dj_ISXDIGIT, // Hexadecimal numeric
- alnum = __dj_ISAL, // Alphanumeric
- graph = __dj_ISGRAPH // Graphical
- };
+ typedef unsigned char * __to_type;
+
+ // NB: Offsets into ctype<char>::_M_table force a particular size
+ // on the mask type. Because of this, we don't use an enum.
+ static const mask space = __dj_ISSPACE; // Whitespace
+ static const mask print = __dj_ISPRINT; // Printing
+ static const mask cntrl = __dj_ISCNTRL; // Control character
+ static const mask upper = __dj_ISUPPER; // UPPERCASE
+ static const mask lower = __dj_ISLOWER; // lowercase
+ static const mask alpha = __dj_ISALPHA; // Alphabetic
+ static const mask digit = __dj_ISDIGIT; // Numeric
+ static const mask punct = __dj_ISPUNCT; // Punctuation
+ static const mask xdigit = __dj_ISXDIGIT; // Hexadecimal numeric
+ static const mask alnum = __dj_ISALPHA; // Alphanumeric
+ static const mask graph = __dj_ISGRAPH; // Graphical
};
diff --git a/libstdc++-v3/config/os/djgpp/bits/ctype_inline.h b/libstdc++-v3/config/os/djgpp/bits/ctype_inline.h
index e17fe6d29ab..21958c43641 100644
--- a/libstdc++-v3/config/os/djgpp/bits/ctype_inline.h
+++ b/libstdc++-v3/config/os/djgpp/bits/ctype_inline.h
@@ -36,21 +36,21 @@
bool
ctype<char>::
- is(mask __m, char __c) const throw()
- { return _M_table[(unsigned char)(__c + 1)] & __m; }
+ is(mask __m, char __c) const
+ { return _M_table[static_cast<unsigned char>(__c + 1)] & __m; }
const char*
ctype<char>::
- is(const char* __low, const char* __high, mask* __vec) const throw()
+ is(const char* __low, const char* __high, mask* __vec) const
{
while (__low < __high)
- *__vec++ = _M_table[(unsigned char)(*__low++)];
+ *__vec++ = _M_table[static_cast<unsigned char>(*__low++)];
return __high;
}
const char*
ctype<char>::
- scan_is(mask __m, const char* __low, const char* __high) const throw()
+ scan_is(mask __m, const char* __low, const char* __high) const
{
while (__low < __high && !this->is(__m, *__low))
++__low;
@@ -59,7 +59,7 @@
const char*
ctype<char>::
- scan_not(mask __m, const char* __low, const char* __high) const throw()
+ scan_not(mask __m, const char* __low, const char* __high) const
{
while (__low < __high && this->is(__m, *__low) != 0)
++__low;
diff --git a/libstdc++-v3/config/os/djgpp/bits/ctype_noninline.h b/libstdc++-v3/config/os/djgpp/bits/ctype_noninline.h
index bbcab083722..dc81d91c9b6 100644
--- a/libstdc++-v3/config/os/djgpp/bits/ctype_noninline.h
+++ b/libstdc++-v3/config/os/djgpp/bits/ctype_noninline.h
@@ -33,31 +33,26 @@
// Information as gleaned from DJGPP <ctype.h>
-// DJGPP specific code
-extern unsigned short __dj_type_cflags[];
-extern unsigned char __dj_ctype_toupper[];
-extern unsigned char __dj_ctype_tolower[];
-
ctype<char>::ctype(const mask* __table = 0, bool __del = false,
size_t __refs = 0)
- : _Ctype_nois<char>(__refs),
+ : __ctype_abstract_base<char>(__refs),
_M_del(__table != 0 && __del),
_M_toupper(__dj_ctype_toupper),
_M_tolower(__dj_ctype_tolower),
_M_ctable(NULL),
- _M_table(__table == 0 ? __dj_type_cflags : __table)
+ _M_table(__table == 0 ? __dj_ctype_flags : __table)
{ }
char
ctype<char>::do_toupper(char __c) const
- { return _M_toupper[(int)(__c)+1]) }
+ { return _M_toupper[static_cast<int>(__c)+1]; }
const char*
ctype<char>::do_toupper(char* __low, const char* __high) const
{
while (__low < __high)
{
- *__low = ::toupper((int) *__low);
+ *__low = ::toupper(static_cast<int> (*__low));
++__low;
}
return __high;
@@ -65,14 +60,14 @@ extern unsigned char __dj_ctype_tolower[];
char
ctype<char>::do_tolower(char __c) const
- { return _M_tolower[(int)(__c)+1]) }
+ { return _M_tolower[static_cast<int>(__c)+1]; }
const char*
ctype<char>::do_tolower(char* __low, const char* __high) const
{
while (__low < __high)
{
- *__low = ::tolower((int) *__low);
+ *__low = ::tolower(static_cast<int> (*__low));
++__low;
}
return __high;
diff --git a/libstdc++-v3/config/os/generic/bits/os_defines.h b/libstdc++-v3/config/os/generic/bits/os_defines.h
index 5c99e09428c..b3984f39a1c 100644
--- a/libstdc++-v3/config/os/generic/bits/os_defines.h
+++ b/libstdc++-v3/config/os/generic/bits/os_defines.h
@@ -34,4 +34,8 @@
// System-specific #define, typedefs, corrections, etc, go here. This
// file will come before all others.
+#ifdef __alpha__
+#define __glibcpp_long_bits 64
+#endif
+
#endif
diff --git a/libstdc++-v3/config/os/gnu-linux/bits/os_defines.h b/libstdc++-v3/config/os/gnu-linux/bits/os_defines.h
index 44c2965d465..2b4375e81eb 100644
--- a/libstdc++-v3/config/os/gnu-linux/bits/os_defines.h
+++ b/libstdc++-v3/config/os/gnu-linux/bits/os_defines.h
@@ -1,6 +1,6 @@
// Specific definitions for GNU/Linux -*- C++ -*-
-// Copyright (C) 2000 Free Software Foundation, Inc.
+// Copyright (C) 2000, 2001 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
@@ -29,13 +29,7 @@
#ifndef _GLIBCPP_OS_DEFINES
-# define _GLIBCPP_OS_DEFINES
-
-// By defining this, all GNU extensions are enabled.
-#define _GNU_SOURCE 1
-
-// By defining this, all ISO C99 functionality is enabled.
-#define _ISOC99_SOURCE 1
+#define _GLIBCPP_OS_DEFINES 1
// This keeps isanum, et al from being propagated as macros.
#define __NO_CTYPE 1
@@ -57,6 +51,11 @@ typedef __loff_t __off64_t;
#undef __THROW
#define __THROW
+// Tell Glibc not to try to provide its own inline versions of
+// some math functions. Those cause assembly-time clashes with
+// our definitions.
+#define __NO_MATH_INLINES
+
#endif /* not glibc 2.1 or higher. */
# if defined __GLIBC__ && __GLIBC__ >= 2
@@ -64,8 +63,21 @@ typedef __loff_t __off64_t;
# define __NO_STRING_INLINES
# endif
+#if defined (__powerpc__) || defined (__s390__)
+#define __glibcpp_wchar_t_is_signed true
+#endif
+
+#if defined (__alpha__) || defined (__powerpc64__) || (defined (__sparc__) && defined(__arch64__)) || defined (__s390x__)
+#define __glibcpp_long_bits 64
#endif
+#if defined (__alpha__) || (defined (__powerpc__) && !defined (__LONG_DOUBLE_128__)) || defined (__s390__)
+#define __glibcpp_long_double_bits 64
+#endif
+#if defined (__mc68000__)
+#define __glibcpp_long_double_bits 96
+#endif
+#endif
diff --git a/libstdc++-v3/config/os/hpux/bits/ctype_base.h b/libstdc++-v3/config/os/hpux/bits/ctype_base.h
index d11e1e51851..12ef91e5415 100644
--- a/libstdc++-v3/config/os/hpux/bits/ctype_base.h
+++ b/libstdc++-v3/config/os/hpux/bits/ctype_base.h
@@ -41,15 +41,15 @@
// NB: Offsets into ctype<char>::_M_table force a particular size
// on the mask type. Because of this, we don't use an enum.
typedef unsigned int mask;
- static const mask upper = 1 << 0;
- static const mask lower = 1 << 1;
- static const mask alpha = 1 << 2;
- static const mask digit = 1 << 3;
- static const mask xdigit = 1 << 4;
- static const mask space = 1 << 5;
- static const mask print = 1 << 6;
- static const mask graph = 1 << 7;
- static const mask cntrl = 1 << 8;
- static const mask punct = 1 << 9;
- static const mask alnum = 1 << 10;
+ static const mask upper = _ISUPPER;
+ static const mask lower = _ISLOWER;
+ static const mask alpha = _ISALPHA;
+ static const mask digit = _ISDIGIT;
+ static const mask xdigit = _ISXDIGIT;
+ static const mask space = _ISSPACE;
+ static const mask print = _ISPRINT;
+ static const mask graph = _ISGRAPH;
+ static const mask cntrl = _ISCNTRL;
+ static const mask punct = _ISPUNCT;
+ static const mask alnum = _ISALNUM;
};
diff --git a/libstdc++-v3/config/os/hpux/bits/os_defines.h b/libstdc++-v3/config/os/hpux/bits/os_defines.h
index 35834395463..cd89301fc71 100644
--- a/libstdc++-v3/config/os/hpux/bits/os_defines.h
+++ b/libstdc++-v3/config/os/hpux/bits/os_defines.h
@@ -39,6 +39,8 @@
#define __off64_t off64_t
#define __ssize_t ssize_t
+#ifdef __LP64__
+#define __glibcpp_long_bits 64
#endif
-
+#endif
diff --git a/libstdc++-v3/config/os/irix/bits/atomicity.h b/libstdc++-v3/config/os/irix/bits/atomicity.h
deleted file mode 100644
index 12dd285b238..00000000000
--- a/libstdc++-v3/config/os/irix/bits/atomicity.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/* Low-level functions for atomic operations. IRIX version.
- Copyright (C) 2000 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public License as
- published by the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
-
- The GNU C 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
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with the GNU C Library; see the file COPYING.LIB. If not,
- write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#ifndef _BITS_ATOMICITY_H
-#define _BITS_ATOMICITY_H 1
-
-#include <mutex.h>
-
-typedef long _Atomic_word;
-
-static inline _Atomic_word
-__exchange_and_add (_Atomic_word* __mem, int __val)
-{
- return (_Atomic_word) test_then_add ((unsigned long*) __mem, __val);
-}
-
-
-static inline void
-__atomic_add (_Atomic_word* __mem, int __val)
-{
- __exchange_and_add (__mem, __val);
-}
-
-#endif /* atomicity.h */
diff --git a/libstdc++-v3/config/os/irix/irix5.2/bits/atomicity.h b/libstdc++-v3/config/os/irix/irix5.2/bits/atomicity.h
new file mode 100644
index 00000000000..bac483e2f16
--- /dev/null
+++ b/libstdc++-v3/config/os/irix/irix5.2/bits/atomicity.h
@@ -0,0 +1,50 @@
+// Low-level functions for atomic operations: IRIX version -*- C++ -*-
+
+// Copyright (C) 2001 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.
+
+#ifndef _BITS_ATOMICITY_H
+#define _BITS_ATOMICITY_H 1
+
+#include <mutex.h>
+
+typedef long _Atomic_word;
+
+static inline _Atomic_word
+__exchange_and_add (_Atomic_word* __mem, int __val)
+{
+ return (_Atomic_word) test_then_add ((unsigned long*) __mem, __val);
+}
+
+
+static inline void
+__atomic_add (_Atomic_word* __mem, int __val)
+{
+ __exchange_and_add (__mem, __val);
+}
+
+#endif /* atomicity.h */
diff --git a/libstdc++-v3/config/os/irix/irix5.2/bits/ctype_base.h b/libstdc++-v3/config/os/irix/irix5.2/bits/ctype_base.h
new file mode 100644
index 00000000000..2626cd3c062
--- /dev/null
+++ b/libstdc++-v3/config/os/irix/irix5.2/bits/ctype_base.h
@@ -0,0 +1,55 @@
+// Locale support -*- C++ -*-
+
+// Copyright (C) 1997-1999, 2001 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.
+
+//
+// ISO C++ 14882: 22.1 Locales
+//
+
+// Information as gleaned from /usr/include/ctype.h on irix 5.2
+
+ struct ctype_base
+ {
+ // Non-standard typedefs.
+ typedef unsigned int* __to_type;
+
+ // NB: Offsets into ctype<char>::_M_table force a particular size
+ // on the mask type. Because of this, we don't use an enum.
+ typedef unsigned char mask;
+ static const mask upper = _U;
+ static const mask lower = _L;
+ static const mask alpha = _U | _L;
+ static const mask digit = _N;
+ static const mask xdigit = _X;
+ static const mask space = _S;
+ static const mask print = _U | _L | _N | _P | _B;
+ static const mask graph = _U | _L | _N | _P;
+ static const mask cntrl = _C;
+ static const mask punct = _P;
+ static const mask alnum = _U | _L | _N;
+ };
diff --git a/libstdc++-v3/config/os/irix/irix5.2/bits/ctype_inline.h b/libstdc++-v3/config/os/irix/irix5.2/bits/ctype_inline.h
new file mode 100644
index 00000000000..400b3a7c391
--- /dev/null
+++ b/libstdc++-v3/config/os/irix/irix5.2/bits/ctype_inline.h
@@ -0,0 +1,72 @@
+// Locale support -*- C++ -*-
+
+// Copyright (C) 2001 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.
+
+//
+// ISO C++ 14882: 22.1 Locales
+//
+
+// ctype bits to be inlined go here. Non-inlinable (ie virtual do_*)
+// functions go in ctype.cc
+
+ bool
+ ctype<char>::
+ is(mask __m, char __c) const
+ { return (_M_table)[__c] & __m; }
+
+ const char*
+ ctype<char>::
+ is(const char* __low, const char* __high, mask* __vec) const
+ {
+ while (__low < __high)
+ *__vec++ = (_M_table)[*__low++];
+ return __high;
+ }
+
+ const char*
+ ctype<char>::
+ scan_is(mask __m, const char* __low, const char* __high) const
+ {
+ while (__low < __high && !((_M_table)[*__low] & __m))
+ ++__low;
+ return __low;
+ }
+
+ const char*
+ ctype<char>::
+ scan_not(mask __m, const char* __low, const char* __high) const
+ {
+ while (__low < __high && ((_M_table + 1)[*__low] & __m) != 0)
+ ++__low;
+ return __low;
+ }
+
+
+
+
+
diff --git a/libstdc++-v3/config/os/irix/irix5.2/bits/ctype_noninline.h b/libstdc++-v3/config/os/irix/irix5.2/bits/ctype_noninline.h
new file mode 100644
index 00000000000..cf4b5273e2b
--- /dev/null
+++ b/libstdc++-v3/config/os/irix/irix5.2/bits/ctype_noninline.h
@@ -0,0 +1,71 @@
+// Locale support -*- C++ -*-
+
+// Copyright (C) 1997-1999, 2001 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.
+
+//
+// ISO C++ 14882: 22.1 Locales
+//
+
+// Information as gleaned from /usr/include/ctype.h
+
+ 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_ctable(NULL),
+ _M_table(!__table ? __ctype : __table)
+ { }
+
+ char
+ ctype<char>::do_toupper(char __c) const
+ { return _toupper(__c); }
+
+ const char*
+ ctype<char>::do_toupper(char* __low, const char* __high) const
+ {
+ while (__low < __high)
+ {
+ *__low = do_toupper(*__low);
+ ++__low;
+ }
+ return __high;
+ }
+
+ char
+ ctype<char>::do_tolower(char __c) const
+ { return _tolower(__c); }
+
+ const char*
+ ctype<char>::do_tolower(char* __low, const char* __high) const
+ {
+ while (__low < __high)
+ {
+ *__low = do_tolower(*__low);
+ ++__low;
+ }
+ return __high;
+ }
+
diff --git a/libstdc++-v3/config/os/irix/bits/os_defines.h b/libstdc++-v3/config/os/irix/irix5.2/bits/os_defines.h
index f4988c1aaeb..b4e2a1f3637 100644
--- a/libstdc++-v3/config/os/irix/bits/os_defines.h
+++ b/libstdc++-v3/config/os/irix/irix5.2/bits/os_defines.h
@@ -1,6 +1,6 @@
// Specific definitions for IRIX -*- C++ -*-
-// Copyright (C) 2000 Free Software Foundation, Inc.
+// Copyright (C) 2001 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
@@ -55,3 +55,4 @@
#endif
+
diff --git a/libstdc++-v3/config/os/irix/irix6.5/bits/atomicity.h b/libstdc++-v3/config/os/irix/irix6.5/bits/atomicity.h
new file mode 100644
index 00000000000..c7f5c83f4ed
--- /dev/null
+++ b/libstdc++-v3/config/os/irix/irix6.5/bits/atomicity.h
@@ -0,0 +1,50 @@
+// Low-level functions for atomic operations: IRIX version -*- C++ -*-
+
+// Copyright (C) 2000, 2001 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.
+
+#ifndef _BITS_ATOMICITY_H
+#define _BITS_ATOMICITY_H 1
+
+#include <mutex.h>
+
+typedef long _Atomic_word;
+
+static inline _Atomic_word
+__exchange_and_add (_Atomic_word* __mem, int __val)
+{
+ return (_Atomic_word) test_then_add ((unsigned long*) __mem, __val);
+}
+
+
+static inline void
+__atomic_add (_Atomic_word* __mem, int __val)
+{
+ __exchange_and_add (__mem, __val);
+}
+
+#endif /* atomicity.h */
diff --git a/libstdc++-v3/config/os/irix/bits/ctype_base.h b/libstdc++-v3/config/os/irix/irix6.5/bits/ctype_base.h
index 08557d158d7..08557d158d7 100644
--- a/libstdc++-v3/config/os/irix/bits/ctype_base.h
+++ b/libstdc++-v3/config/os/irix/irix6.5/bits/ctype_base.h
diff --git a/libstdc++-v3/config/os/irix/bits/ctype_inline.h b/libstdc++-v3/config/os/irix/irix6.5/bits/ctype_inline.h
index 6a20c096cd5..6a20c096cd5 100644
--- a/libstdc++-v3/config/os/irix/bits/ctype_inline.h
+++ b/libstdc++-v3/config/os/irix/irix6.5/bits/ctype_inline.h
diff --git a/libstdc++-v3/config/os/irix/bits/ctype_noninline.h b/libstdc++-v3/config/os/irix/irix6.5/bits/ctype_noninline.h
index 8045feb0890..8045feb0890 100644
--- a/libstdc++-v3/config/os/irix/bits/ctype_noninline.h
+++ b/libstdc++-v3/config/os/irix/irix6.5/bits/ctype_noninline.h
diff --git a/libstdc++-v3/config/os/irix/irix6.5/bits/os_defines.h b/libstdc++-v3/config/os/irix/irix6.5/bits/os_defines.h
new file mode 100644
index 00000000000..87be3e0910b
--- /dev/null
+++ b/libstdc++-v3/config/os/irix/irix6.5/bits/os_defines.h
@@ -0,0 +1,62 @@
+// Specific definitions for IRIX -*- C++ -*-
+
+// Copyright (C) 2000 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.
+
+
+#ifndef _GLIBCPP_OS_DEFINES
+#define _GLIBCPP_OS_DEFINES
+
+/* System-specific #define, typedefs, corrections, etc, go here. This
+ file will come before all others. */
+
+/* We need large file support. There are two ways to turn it on:
+ by defining either _LARGEFILE64_SOURCE or _SGI_SOURCE. However,
+ it does not actually work to define only the former, as then
+ <sys/stat.h> is invalid: `st_blocks' is defined to be a macro,
+ but then used as a field name. So, we have to turn on
+ _SGI_SOURCE. That only works if _POSIX_SOURCE is turned off,
+ so we have to explicitly turn it off. (Some of the libio C files
+ explicitly try to turn it on.) _SGI_SOURCE is actually turned on
+ implicitly via the command-line. */
+#undef _POSIX_SOURCE
+
+#define __off_t off_t
+#define __off64_t off64_t
+#define __ssize_t ssize_t
+
+/* GCC does not use thunks on IRIX. */
+#define _G_USING_THUNKS 0
+
+#define __glibcpp_long_double_bits 64
+
+#if __LONG_MAX__ > 2147483647
+#define __glibcpp_wchar_t_bits 64
+#define __glibcpp_long_bits 64
+#endif
+
+#endif
diff --git a/libstdc++-v3/config/os/solaris/solaris2.5/bits/os_defines.h b/libstdc++-v3/config/os/solaris/solaris2.5/bits/os_defines.h
index c947be7c6c8..5a756b4210d 100644
--- a/libstdc++-v3/config/os/solaris/solaris2.5/bits/os_defines.h
+++ b/libstdc++-v3/config/os/solaris/solaris2.5/bits/os_defines.h
@@ -1,4 +1,4 @@
-// Specific definitions for Solaris 2.6 -*- C++ -*-
+// Specific definitions for Solaris 2.5 -*- C++ -*-
// Copyright (C) 2000 Free Software Foundation, Inc.
//
@@ -31,13 +31,11 @@
#ifndef _GLIBCPP_OS_DEFINES
# define _GLIBCPP_OS_DEFINES
-// Need these to get sane definitions, esp. of 64-bit types and typedefs.
-#define _XOPEN_SOURCE 500
-#define _LARGEFILE64_SOURCE 1
-#define __EXTENSIONS__
-
/* System-specific #define, typedefs, corrections, etc, go here. This
file will come before all others. */
+
+#define _GLIBCPP_AVOID_FSEEK 1
+
// These are typedefs which libio assumes are already in place (because
// they really are, under Linux).
#define __off_t off_t
@@ -48,5 +46,3 @@
#define _G_USING_THUNKS 0
#endif
-
-
diff --git a/libstdc++-v3/config/os/solaris/solaris2.6/bits/os_defines.h b/libstdc++-v3/config/os/solaris/solaris2.6/bits/os_defines.h
index c947be7c6c8..961e29d55d0 100644
--- a/libstdc++-v3/config/os/solaris/solaris2.6/bits/os_defines.h
+++ b/libstdc++-v3/config/os/solaris/solaris2.6/bits/os_defines.h
@@ -31,13 +31,11 @@
#ifndef _GLIBCPP_OS_DEFINES
# define _GLIBCPP_OS_DEFINES
-// Need these to get sane definitions, esp. of 64-bit types and typedefs.
-#define _XOPEN_SOURCE 500
-#define _LARGEFILE64_SOURCE 1
-#define __EXTENSIONS__
-
/* System-specific #define, typedefs, corrections, etc, go here. This
file will come before all others. */
+
+#define _GLIBCPP_AVOID_FSEEK 1
+
// These are typedefs which libio assumes are already in place (because
// they really are, under Linux).
#define __off_t off_t
@@ -48,5 +46,3 @@
#define _G_USING_THUNKS 0
#endif
-
-
diff --git a/libstdc++-v3/config/os/solaris/solaris2.7/bits/os_defines.h b/libstdc++-v3/config/os/solaris/solaris2.7/bits/os_defines.h
index 91e0261bd95..06f6c7268d2 100644
--- a/libstdc++-v3/config/os/solaris/solaris2.7/bits/os_defines.h
+++ b/libstdc++-v3/config/os/solaris/solaris2.7/bits/os_defines.h
@@ -31,10 +31,10 @@
#ifndef _GLIBCPP_OS_DEFINES
# define _GLIBCPP_OS_DEFINES
-// Need these to get sane definitions, esp. of 64-bit types and typedefs.
-#define _XOPEN_SOURCE 500
-#define _LARGEFILE64_SOURCE 1
-#define __EXTENSIONS__
+/* System-specific #define, typedefs, corrections, etc, go here. This
+ file will come before all others. */
+
+#define _GLIBCPP_AVOID_FSEEK 1
// These are typedefs which libio assumes are already in place (because
// they really are, under Linux).
@@ -45,6 +45,8 @@
// Without this all the libio vtbls are offset wrongly.
#define _G_USING_THUNKS 0
-
+#if defined(__sparc_v9) || defined(__arch64__)
+#define __glibcpp_long_bits 64
#endif
+#endif
diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure
index 0f053e5327c..43c6114f616 100755
--- a/libstdc++-v3/configure
+++ b/libstdc++-v3/configure
@@ -36,29 +36,28 @@ ac_help="$ac_help
ac_help="$ac_help
--enable-debug extra debugging, turn off optimization [default=no]"
ac_help="$ac_help
- --enable-cstdio enable stdio for target io package.
- --enable-cstdio=LIB use LIB target-speific io package. [default=stdio]
+ --enable-cstdio enable stdio for target io package.
+ --enable-cstdio=LIB use LIB target-speific io package. [default=stdio]
"
ac_help="$ac_help
- --enable-clocale enable model for target locale package.
- --enable-clocale=MODEL use MODEL target-speific locale package. [default=generic]
+ --enable-clocale enable model for target locale package.
+ --enable-clocale=MODEL use MODEL target-speific locale package. [default=generic]
"
ac_help="$ac_help
--enable-c-mbchar enable multibyte (wide) characters [default=yes]"
ac_help="$ac_help
- --enable-long-long turns on 'long long' [default=no]"
+ --enable-c99 turns on 'ISO/IEC 9899:1999 support' [default=yes]"
ac_help="$ac_help
- --enable-cheaders construct "C" header files for
- g++ [default=c_std]"
+ --enable-long-long turns on 'long long' [default=yes]"
ac_help="$ac_help
- --enable-threads enable thread usage for target GCC.
- --enable-threads=LIB use LIB thread package for target GCC. [default=no]
- "
+ --enable-cheaders construct "C" header files for g++ [default=c_std]"
ac_help="$ac_help
--enable-cxx-flags=FLAGS pass compiler FLAGS when building library;
[default=none]"
ac_help="$ac_help
- --with-gxx-include-dir the installation directory for include files"
+ --enable-sjlj-exceptions force use of builtin_setjmp for exceptions"
+ac_help="$ac_help
+ --with-gxx-include-dir the installation directory for include files"
ac_help="$ac_help
--enable-version-specific-runtime-libs Specify that runtime libraries should be installed in a compiler-specific directory "
@@ -78,7 +77,6 @@ program_suffix=NONE
program_transform_name=s,x,x,
silent=
site=
-sitefile=
srcdir=
target=NONE
verbose=
@@ -193,7 +191,6 @@ Configuration:
--help print this message
--no-create do not create output files
--quiet, --silent do not print \`checking...' messages
- --site-file=FILE use FILE as the site file
--version print the version of autoconf that created configure
Directory and file names:
--prefix=PREFIX install architecture-independent files in PREFIX
@@ -364,11 +361,6 @@ EOF
-site=* | --site=* | --sit=*)
site="$ac_optarg" ;;
- -site-file | --site-file | --site-fil | --site-fi | --site-f)
- ac_prev=sitefile ;;
- -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*)
- sitefile="$ac_optarg" ;;
-
-srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
ac_prev=srcdir ;;
-srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
@@ -534,16 +526,12 @@ fi
srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
# Prefer explicitly selected file to automatically selected ones.
-if test -z "$sitefile"; then
- if test -z "$CONFIG_SITE"; then
- if test "x$prefix" != xNONE; then
- CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
- else
- CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
- fi
+if test -z "$CONFIG_SITE"; then
+ if test "x$prefix" != xNONE; then
+ CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+ else
+ CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
fi
-else
- CONFIG_SITE="$sitefile"
fi
for ac_site_file in $CONFIG_SITE; do
if test -r "$ac_site_file"; then
@@ -590,23 +578,19 @@ fi
# source directory.
if test "${srcdir}" = "."; then
if test -z "${with_target_subdir}"; then
- toplevel_srcdir="\${top_srcdir}/.."
- auxdir="${srcdir}/.."
+ toprel=".."
else
if test "${with_target_subdir}" != "."; then
- toplevel_srcdir="\${top_srcdir}/${with_multisrctop}../.."
- auxdir="${srcdir}/${with_multisrctop}../.."
+ toprel="${with_multisrctop}../.."
else
- toplevel_srcdir="\${top_srcdir}/${with_multisrctop}.."
- auxdir="${srcdir}/${with_multisrctop}.."
+ toprel="${with_multisrctop}.."
fi
fi
else
- toplevel_srcdir="\${top_srcdir}/.."
- auxdir="${srcdir}/.."
+ toprel=".."
fi
ac_aux_dir=
-for ac_dir in $auxdir $srcdir/$auxdir; do
+for ac_dir in ${srcdir}/$toprel $srcdir/${srcdir}/$toprel; do
if test -f $ac_dir/install-sh; then
ac_aux_dir=$ac_dir
ac_install_sh="$ac_aux_dir/install-sh -c"
@@ -618,17 +602,20 @@ for ac_dir in $auxdir $srcdir/$auxdir; do
fi
done
if test -z "$ac_aux_dir"; then
- { echo "configure: error: can not find install-sh or install.sh in $auxdir $srcdir/$auxdir" 1>&2; exit 1; }
+ { echo "configure: error: can not find install-sh or install.sh in ${srcdir}/$toprel $srcdir/${srcdir}/$toprel" 1>&2; exit 1; }
fi
ac_config_guess=$ac_aux_dir/config.guess
ac_config_sub=$ac_aux_dir/config.sub
ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
+toplevel_srcdir=\${top_srcdir}/$toprel
# Gets and sets build, host, target, *_vendor, *_cpu, *_os, etc.
+# AC 2.50 sets target_alias iff the user specified --target, but we use it
+# everywhere, so we set it here just to be sure.
# Do some error checking and defaulting for the host and target type.
# The inputs are:
@@ -657,7 +644,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
fi
echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:661: checking host system type" >&5
+echo "configure:648: checking host system type" >&5
host_alias=$host
case "$host_alias" in
@@ -678,7 +665,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
echo "$ac_t""$host" 1>&6
echo $ac_n "checking target system type""... $ac_c" 1>&6
-echo "configure:682: checking target system type" >&5
+echo "configure:669: checking target system type" >&5
target_alias=$target
case "$target_alias" in
@@ -696,7 +683,7 @@ target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
echo "$ac_t""$target" 1>&6
echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:700: checking build system type" >&5
+echo "configure:687: checking build system type" >&5
build_alias=$build
case "$build_alias" in
@@ -718,6 +705,32 @@ test "$host_alias" != "$target_alias" &&
NONENONEs,x,x, &&
program_prefix=${target_alias}-
+target_alias=${target_alias-$target}
+
+
+# Will set LN_S to either 'ln -s' or 'ln'. With autoconf 2.50+, can also
+# be 'cp -p' if linking isn't available.
+echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
+echo "configure:715: checking whether ln -s works" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ rm -f conftestdata
+if ln -s X conftestdata 2>/dev/null
+then
+ rm -f conftestdata
+ ac_cv_prog_LN_S="ln -s"
+else
+ ac_cv_prog_LN_S=ln
+fi
+fi
+LN_S="$ac_cv_prog_LN_S"
+if test "$ac_cv_prog_LN_S" = "ln -s"; then
+ echo "$ac_t""yes" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
# We use these options to decide which functions to include.
# Check whether --with-target-subdir or --without-target-subdir was given.
@@ -747,7 +760,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:751: checking for a BSD compatible install" >&5
+echo "configure:764: 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
@@ -800,7 +813,7 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
-echo "configure:804: checking whether build environment is sane" >&5
+echo "configure:817: checking whether build environment is sane" >&5
# Just in case
sleep 1
echo timestamp > conftestfile
@@ -857,7 +870,7 @@ test "$program_suffix" != NONE &&
test "$program_transform_name" = "" && program_transform_name="s,x,x,"
echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:861: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:874: 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
@@ -890,12 +903,12 @@ else
fi
echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
-echo "configure:894: checking for Cygwin environment" >&5
+echo "configure:907: checking for Cygwin environment" >&5
if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 899 "configure"
+#line 912 "configure"
#include "confdefs.h"
int main() {
@@ -906,7 +919,7 @@ int main() {
return __CYGWIN__;
; return 0; }
EOF
-if { (eval echo configure:910: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:923: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_cygwin=yes
else
@@ -923,19 +936,19 @@ echo "$ac_t""$ac_cv_cygwin" 1>&6
CYGWIN=
test "$ac_cv_cygwin" = yes && CYGWIN=yes
echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
-echo "configure:927: checking for mingw32 environment" >&5
+echo "configure:940: checking for mingw32 environment" >&5
if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 932 "configure"
+#line 945 "configure"
#include "confdefs.h"
int main() {
return __MINGW32__;
; return 0; }
EOF
-if { (eval echo configure:939: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:952: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_mingw32=yes
else
@@ -964,13 +977,13 @@ else
multilib=yes
fi
- glibcpp_basedir=$auxdir/./libstdc++-v3
+ glibcpp_basedir=$srcdir/$toprel/./libstdc++-v3
PACKAGE=libstdc++
-VERSION=2.90.8
+VERSION=3.0.0
if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
{ echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
@@ -987,7 +1000,7 @@ EOF
missing_dir=`cd $ac_aux_dir && pwd`
echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
-echo "configure:991: checking for working aclocal" >&5
+echo "configure:1004: checking for working aclocal" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh.
@@ -1000,7 +1013,7 @@ else
fi
echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
-echo "configure:1004: checking for working autoconf" >&5
+echo "configure:1017: checking for working autoconf" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh.
@@ -1013,7 +1026,7 @@ else
fi
echo $ac_n "checking for working automake""... $ac_c" 1>&6
-echo "configure:1017: checking for working automake" >&5
+echo "configure:1030: checking for working automake" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh.
@@ -1026,7 +1039,7 @@ else
fi
echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
-echo "configure:1030: checking for working autoheader" >&5
+echo "configure:1043: checking for working autoheader" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh.
@@ -1039,7 +1052,7 @@ else
fi
echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
-echo "configure:1043: checking for working makeinfo" >&5
+echo "configure:1056: checking for working makeinfo" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh.
@@ -1074,7 +1087,7 @@ fi
# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1078: checking for $ac_word" >&5
+echo "configure:1091: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1104,7 +1117,7 @@ if test -z "$CC"; then
# Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1108: checking for $ac_word" >&5
+echo "configure:1121: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1153,7 +1166,7 @@ fi
fi
echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:1157: checking whether we are using GNU C" >&5
+echo "configure:1170: checking whether we are using GNU C" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1162,7 +1175,7 @@ else
yes;
#endif
EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1166: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1179: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
ac_cv_prog_gcc=yes
else
ac_cv_prog_gcc=no
@@ -1177,7 +1190,7 @@ if test $ac_cv_prog_gcc = yes; then
ac_save_CFLAGS="$CFLAGS"
CFLAGS=
echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:1181: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:1194: checking whether ${CC-cc} accepts -g" >&5
if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1212,52 +1225,52 @@ fi
-# Use CXX_libstdcxx so that we do not cause CXX to be cached with the
+# Use glibcpp_CXX so that we do not cause CXX to be cached with the
# flags that come in CXX while configuring libstdc++. They're different
# from those used for all other target libraries. If CXX is set in
# the environment, respect that here.
-CXX_libstdcxx=$CXX
+glibcpp_CXX=$CXX
for ac_prog in $CCC c++ g++ gcc CC cxx cc++
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1226: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_CXX_libstdcxx'+set}'`\" = set"; then
+echo "configure:1239: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_glibcpp_CXX'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
- if test -n "$CXX_libstdcxx"; then
- ac_cv_prog_CXX_libstdcxx="$CXX_libstdcxx" # Let the user override the test.
+ if test -n "$glibcpp_CXX"; then
+ ac_cv_prog_glibcpp_CXX="$glibcpp_CXX" # Let the user override the test.
else
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
ac_dummy="$PATH"
for ac_dir in $ac_dummy; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$ac_word; then
- ac_cv_prog_CXX_libstdcxx="$ac_prog"
+ ac_cv_prog_glibcpp_CXX="$ac_prog"
break
fi
done
IFS="$ac_save_ifs"
fi
fi
-CXX_libstdcxx="$ac_cv_prog_CXX_libstdcxx"
-if test -n "$CXX_libstdcxx"; then
- echo "$ac_t""$CXX_libstdcxx" 1>&6
+glibcpp_CXX="$ac_cv_prog_glibcpp_CXX"
+if test -n "$glibcpp_CXX"; then
+ echo "$ac_t""$glibcpp_CXX" 1>&6
else
echo "$ac_t""no" 1>&6
fi
-test -n "$CXX_libstdcxx" && break
+test -n "$glibcpp_CXX" && break
done
-test -n "$CXX_libstdcxx" || CXX_libstdcxx="gcc"
+test -n "$glibcpp_CXX" || glibcpp_CXX="gcc"
-CXX=$CXX_libstdcxx
-test -z "$CXX" && { echo "configure: error: no acceptable c++ found in \$PATH" 1>&2; exit 1; }
+CXX=$glibcpp_CXX
+test -z "$glibcpp_CXX" && { echo "configure: error: no acceptable c++ found in \$PATH" 1>&2; exit 1; }
echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6
-echo "configure:1261: checking whether we are using GNU C++" >&5
+echo "configure:1274: checking whether we are using GNU C++" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1266,7 +1279,7 @@ else
yes;
#endif
EOF
-if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:1270: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:1283: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
ac_cv_prog_gxx=yes
else
ac_cv_prog_gxx=no
@@ -1281,7 +1294,7 @@ if test $ac_cv_prog_gxx = yes; then
ac_save_CXXFLAGS="$CXXFLAGS"
CXXFLAGS=
echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6
-echo "configure:1285: checking whether ${CXX-g++} accepts -g" >&5
+echo "configure:1298: checking whether ${CXX-g++} accepts -g" >&5
if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1312,7 +1325,7 @@ fi
# Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args.
set dummy ${ac_tool_prefix}as; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1316: checking for $ac_word" >&5
+echo "configure:1329: 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
@@ -1344,7 +1357,7 @@ fi
# Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
set dummy ${ac_tool_prefix}ar; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1348: checking for $ac_word" >&5
+echo "configure:1361: 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
@@ -1376,7 +1389,7 @@ fi
# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
set dummy ${ac_tool_prefix}ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1380: checking for $ac_word" >&5
+echo "configure:1393: 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
@@ -1408,7 +1421,7 @@ if test -n "$ac_tool_prefix"; 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:1412: checking for $ac_word" >&5
+echo "configure:1425: 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
@@ -1425,7 +1438,7 @@ else
fi
done
IFS="$ac_save_ifs"
- test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
+ test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB="ranlib-not-found-in-path-error"
fi
fi
RANLIB="$ac_cv_prog_RANLIB"
@@ -1436,11 +1449,10 @@ else
fi
else
- RANLIB=":"
+ RANLIB="ranlib-not-found-in-path-error"
fi
fi
-
# Find a good install program. We prefer a C program (faster),
# so one script is as good as another. But avoid the broken or
# incompatible versions:
@@ -1453,7 +1465,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:1457: checking for a BSD compatible install" >&5
+echo "configure:1469: 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
@@ -1507,7 +1519,7 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
-echo "configure:1511: checking whether to enable maintainer-specific portions of Makefiles" >&5
+echo "configure:1523: 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"
@@ -1538,10 +1550,14 @@ fi
# automake happy, but we dont execute it, since we dont care about
# the result.
if false; then
+ # autoconf 2.50 runs AC_EXEEXT by default, and the macro expands
+ # to nothing, so nothing would remain between `then' and `fi' if it
+ # were not for the `:' below.
+ :
echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:1545: checking for executable suffix" >&5
+echo "configure:1561: checking for executable suffix" >&5
if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1551,10 +1567,10 @@ else
rm -f conftest*
echo 'int main () { return 0; }' > conftest.$ac_ext
ac_cv_exeext=
- if { (eval echo configure:1555: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+ if { (eval echo configure:1571: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
for file in conftest.*; do
case $file in
- *.c | *.o | *.obj | *.ilk | *.pdb) ;;
+ *.c | *.o | *.obj) ;;
*) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
esac
done
@@ -1573,12 +1589,6 @@ ac_exeext=$EXEEXT
fi
- # configure.host sets the following important variables
- # glibcpp_cflags - host specific C compiler flags
- # glibcpp_cxxflags - host specific C++ compiler flags
- glibcpp_cflags=
- glibcpp_cxxflags=
-
. ${glibcpp_basedir}/configure.host
case ${glibcpp_basedir} in
@@ -1587,26 +1597,20 @@ ac_exeext=$EXEEXT
esac
# This does for the target what configure.host does for the host. In
- # addition to modifying the same flags, it also sets up symlinks.
+ # addition to possibly modifying the same flags, it also sets up symlinks.
. ${glibcpp_basedir}/configure.target
echo "$ac_t""CPU config directory is $cpu_include_dir" 1>&6
echo "$ac_t""OS config directory is $os_include_dir" 1>&6
-
- GLIBCPP_CFLAGS="${glibcpp_cflags}"
- GLIBCPP_CXXFLAGS="${glibcpp_cxxflags}"
-
-
-
# Check whether --enable-shared or --disable-shared was given.
if test "${enable_shared+set}" = set; then
enableval="$enable_shared"
p=${PACKAGE-default}
-case "$enableval" in
+case $enableval in
yes) enable_shared=yes ;;
no) enable_shared=no ;;
*)
@@ -1629,7 +1633,7 @@ fi
if test "${enable_static+set}" = set; then
enableval="$enable_static"
p=${PACKAGE-default}
-case "$enableval" in
+case $enableval in
yes) enable_static=yes ;;
no) enable_static=no ;;
*)
@@ -1652,7 +1656,7 @@ fi
if test "${enable_fast_install+set}" = set; then
enableval="$enable_fast_install"
p=${PACKAGE-default}
-case "$enableval" in
+case $enableval in
yes) enable_fast_install=yes ;;
no) enable_fast_install=no ;;
*)
@@ -1680,10 +1684,10 @@ else
fi
ac_prog=ld
-if test "$ac_cv_prog_gcc" = yes; then
+if test "$GCC" = yes; then
# Check if gcc -print-prog-name=ld gives a path.
echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
-echo "configure:1687: checking for ld used by GCC" >&5
+echo "configure:1691: checking for ld used by GCC" >&5
case $host in
*-*-mingw*)
# gcc leaves a trailing carriage return which upsets mingw
@@ -1691,7 +1695,7 @@ echo "configure:1687: checking for ld used by GCC" >&5
*)
ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
esac
- case "$ac_prog" in
+ case $ac_prog in
# Accept absolute paths.
[\\/]* | [A-Za-z]:[\\/]*)
re_direlt='/[^/][^/]*/\.\./'
@@ -1713,12 +1717,12 @@ echo "configure:1687: checking for ld used by GCC" >&5
esac
elif test "$with_gnu_ld" = yes; then
echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
-echo "configure:1717: checking for GNU ld" >&5
+echo "configure:1721: checking for GNU ld" >&5
else
echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
-echo "configure:1720: checking for non-GNU ld" >&5
+echo "configure:1724: checking for non-GNU ld" >&5
fi
-if eval "test \"`echo '$''{'ac_cv_path_LD'+set}'`\" = set"; then
+if eval "test \"`echo '$''{'lt_cv_path_LD'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test -z "$LD"; then
@@ -1726,11 +1730,11 @@ else
for ac_dir in $PATH; do
test -z "$ac_dir" && ac_dir=.
if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
- ac_cv_path_LD="$ac_dir/$ac_prog"
+ lt_cv_path_LD="$ac_dir/$ac_prog"
# Check to see if the program is GNU ld. I'd rather use --version,
# but apparently some GNU ld's only accept -v.
# Break only if it was the GNU/non-GNU ld that we prefer.
- if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
+ if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
test "$with_gnu_ld" != no && break
else
test "$with_gnu_ld" != yes && break
@@ -1739,11 +1743,11 @@ else
done
IFS="$ac_save_ifs"
else
- ac_cv_path_LD="$LD" # Let the user override the test with a path.
+ lt_cv_path_LD="$LD" # Let the user override the test with a path.
fi
fi
-LD="$ac_cv_path_LD"
+LD="$lt_cv_path_LD"
if test -n "$LD"; then
echo "$ac_t""$LD" 1>&6
else
@@ -1751,24 +1755,24 @@ else
fi
test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
-echo "configure:1755: checking if the linker ($LD) is GNU ld" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_gnu_ld'+set}'`\" = set"; then
+echo "configure:1759: checking if the linker ($LD) is GNU ld" >&5
+if eval "test \"`echo '$''{'lt_cv_prog_gnu_ld'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# I'd rather use --version here, but apparently some GNU ld's only accept -v.
if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
- ac_cv_prog_gnu_ld=yes
+ lt_cv_prog_gnu_ld=yes
else
- ac_cv_prog_gnu_ld=no
+ lt_cv_prog_gnu_ld=no
fi
fi
-echo "$ac_t""$ac_cv_prog_gnu_ld" 1>&6
-with_gnu_ld=$ac_cv_prog_gnu_ld
+echo "$ac_t""$lt_cv_prog_gnu_ld" 1>&6
+with_gnu_ld=$lt_cv_prog_gnu_ld
echo $ac_n "checking for $LD option to reload object files""... $ac_c" 1>&6
-echo "configure:1772: checking for $LD option to reload object files" >&5
+echo "configure:1776: checking for $LD option to reload object files" >&5
if eval "test \"`echo '$''{'lt_cv_ld_reload_flag'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1780,13 +1784,13 @@ reload_flag=$lt_cv_ld_reload_flag
test -n "$reload_flag" && reload_flag=" $reload_flag"
echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
-echo "configure:1784: checking for BSD-compatible nm" >&5
-if eval "test \"`echo '$''{'ac_cv_path_NM'+set}'`\" = set"; then
+echo "configure:1788: checking for BSD-compatible nm" >&5
+if eval "test \"`echo '$''{'lt_cv_path_NM'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test -n "$NM"; then
# Let the user override the test.
- ac_cv_path_NM="$NM"
+ lt_cv_path_NM="$NM"
else
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
@@ -1798,48 +1802,27 @@ else
# nm: unknown option "B" ignored
# Tru64's nm complains that /dev/null is an invalid object file
if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then
- ac_cv_path_NM="$tmp_nm -B"
+ lt_cv_path_NM="$tmp_nm -B"
break
elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
- ac_cv_path_NM="$tmp_nm -p"
+ lt_cv_path_NM="$tmp_nm -p"
break
else
- ac_cv_path_NM=${ac_cv_path_NM="$tmp_nm"} # keep the first match, but
+ lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
continue # so that we can try to find one that supports BSD flags
fi
fi
done
IFS="$ac_save_ifs"
- test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
+ test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
fi
fi
-NM="$ac_cv_path_NM"
+NM="$lt_cv_path_NM"
echo "$ac_t""$NM" 1>&6
-echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:1822: checking whether ln -s works" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- rm -f conftestdata
-if ln -s X conftestdata 2>/dev/null
-then
- rm -f conftestdata
- ac_cv_prog_LN_S="ln -s"
-else
- ac_cv_prog_LN_S=ln
-fi
-fi
-LN_S="$ac_cv_prog_LN_S"
-if test "$ac_cv_prog_LN_S" = "ln -s"; then
- echo "$ac_t""yes" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
echo $ac_n "checking how to recognise dependant libraries""... $ac_c" 1>&6
-echo "configure:1843: checking how to recognise dependant libraries" >&5
+echo "configure:1826: checking how to recognise dependant libraries" >&5
if eval "test \"`echo '$''{'lt_cv_deplibs_check_method'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1857,8 +1840,8 @@ lt_cv_deplibs_check_method='unknown'
# If you have `file' or equivalent on your system and you're not sure
# whether `pass_all' will *always* work, you probably want this one.
-case "$host_os" in
-aix4*)
+case $host_os in
+aix*)
lt_cv_deplibs_check_method=pass_all
;;
@@ -1867,8 +1850,8 @@ beos*)
;;
bsdi4*)
- lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
- lt_cv_file_magic_cmd='/usr/bin/file -L'
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
+ lt_cv_file_magic_cmd='/usr/bin/file -L'
lt_cv_file_magic_test_file=/shlib/libc.so
;;
@@ -1877,14 +1860,27 @@ cygwin* | mingw* |pw32*)
lt_cv_file_magic_cmd='$OBJDUMP -f'
;;
+darwin* | rhapsody*)
+ lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library'
+ lt_cv_file_magic_cmd='/usr/bin/file -L'
+ case "$host_os" in
+ rhapsody* | darwin1.012)
+ lt_cv_file_magic_test_file='/System/Library/Frameworks/System.framework/System'
+ ;;
+ *) # Darwin 1.3 on
+ lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib'
+ ;;
+ esac
+ ;;
+
freebsd* )
if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
- case "$host_cpu" in
+ case $host_cpu in
i*86 )
# Not sure whether the presence of OpenBSD here was a mistake.
# Let's accept both of them until this is cleared up.
- lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library'
- lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library'
+ lt_cv_file_magic_cmd=/usr/bin/file
lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
;;
esac
@@ -1897,29 +1893,28 @@ gnu*)
lt_cv_deplibs_check_method=pass_all
;;
-hpux10.20*)
- # TODO: Does this work for hpux-11 too?
- lt_cv_deplibs_check_method='file_magic (s0-90-90-9|PA-RISC0-9.0-9) shared library'
+hpux10.20*|hpux11*)
+ lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library'
lt_cv_file_magic_cmd=/usr/bin/file
lt_cv_file_magic_test_file=/usr/lib/libc.sl
;;
irix5* | irix6*)
- case "$host_os" in
+ case $host_os in
irix5*)
# this will be overridden with pass_all, but let us keep it just in case
lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1"
;;
*)
- case "$LD" in
+ case $LD in
*-32|*"-32 ") libmagic=32-bit;;
*-n32|*"-n32 ") libmagic=N32;;
*-64|*"-64 ") libmagic=64-bit;;
*) libmagic=never-match;;
esac
# this will be overridden with pass_all, but let us keep it just in case
- lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1"
- ;;
+ lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1"
+ ;;
esac
lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*`
lt_cv_deplibs_check_method=pass_all
@@ -1927,25 +1922,30 @@ irix5* | irix6*)
# This must be Linux ELF.
linux-gnu*)
- case "$host_cpu" in
- alpha* | i*86 | powerpc* | sparc* | ia64* )
+ case $host_cpu in
+ alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* )
lt_cv_deplibs_check_method=pass_all ;;
*)
# glibc up to 2.1.1 does not perform some relocations on ARM
- lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;;
- esac
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;;
+ esac
lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
;;
netbsd*)
- if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then :
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
else
- lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object'
- lt_cv_file_magic_cmd='/usr/bin/file -L'
- lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so$'
fi
;;
+newsos6)
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=/usr/lib/libnls.so
+ ;;
+
osf3* | osf4* | osf5*)
# this will be overridden with pass_all, but let us keep it just in case
lt_cv_deplibs_check_method='file_magic COFF format alpha shared library'
@@ -1962,14 +1962,18 @@ solaris*)
lt_cv_file_magic_test_file=/lib/libc.so
;;
+sysv5uw[78]* | sysv4*uw2*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
- case "$host_vendor" in
+ case $host_vendor in
ncr)
lt_cv_deplibs_check_method=pass_all
;;
motorola)
- lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
- lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
;;
esac
;;
@@ -1982,13 +1986,13 @@ file_magic_cmd=$lt_cv_file_magic_cmd
deplibs_check_method=$lt_cv_deplibs_check_method
echo $ac_n "checking for object suffix""... $ac_c" 1>&6
-echo "configure:1986: checking for object suffix" >&5
+echo "configure:1990: checking for object suffix" >&5
if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
rm -f conftest*
echo 'int i = 1;' > conftest.$ac_ext
-if { (eval echo configure:1992: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1996: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
for ac_file in conftest.*; do
case $ac_file in
*.c) ;;
@@ -2008,15 +2012,15 @@ ac_objext=$ac_cv_objext
# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
# Only perform the check for file, if the check method requires it
-case "$deplibs_check_method" in
+case $deplibs_check_method in
file_magic*)
if test "$file_magic_cmd" = '$MAGIC_CMD'; then
echo $ac_n "checking for ${ac_tool_prefix}file""... $ac_c" 1>&6
-echo "configure:2016: checking for ${ac_tool_prefix}file" >&5
+echo "configure:2020: checking for ${ac_tool_prefix}file" >&5
if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
- case "$MAGIC_CMD" in
+ case $MAGIC_CMD in
/*)
lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
;;
@@ -2032,7 +2036,7 @@ else
if test -f $ac_dir/${ac_tool_prefix}file; then
lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file"
if test -n "$file_magic_test_file"; then
- case "$deplibs_check_method" in
+ case $deplibs_check_method in
"file_magic "*)
file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
@@ -2074,11 +2078,11 @@ fi
if test -z "$lt_cv_path_MAGIC_CMD"; then
if test -n "$ac_tool_prefix"; then
echo $ac_n "checking for file""... $ac_c" 1>&6
-echo "configure:2078: checking for file" >&5
+echo "configure:2082: checking for file" >&5
if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
- case "$MAGIC_CMD" in
+ case $MAGIC_CMD in
/*)
lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
;;
@@ -2094,7 +2098,7 @@ else
if test -f $ac_dir/file; then
lt_cv_path_MAGIC_CMD="$ac_dir/file"
if test -n "$file_magic_test_file"; then
- case "$deplibs_check_method" in
+ case $deplibs_check_method in
"file_magic "*)
file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
@@ -2145,7 +2149,7 @@ esac
# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
set dummy ${ac_tool_prefix}ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2149: checking for $ac_word" >&5
+echo "configure:2153: 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
@@ -2177,7 +2181,7 @@ if test -n "$ac_tool_prefix"; 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:2181: checking for $ac_word" >&5
+echo "configure:2185: 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
@@ -2212,7 +2216,7 @@ fi
# Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
set dummy ${ac_tool_prefix}strip; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2216: checking for $ac_word" >&5
+echo "configure:2220: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2244,7 +2248,7 @@ if test -n "$ac_tool_prefix"; then
# Extract the first word of "strip", so it can be a program name with args.
set dummy strip; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2248: checking for $ac_word" >&5
+echo "configure:2252: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2282,8 +2286,8 @@ libtool_flags="--cache-file=$cache_file"
test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
-test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
-test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
+test "$GCC" = yes && libtool_flags="$libtool_flags --with-gcc"
+test "$lt_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
libtool_flags="$libtool_flags --enable-dlopen"
# Check whether --enable-libtool-lock or --disable-libtool-lock was given.
@@ -2308,12 +2312,12 @@ test x"$pic_mode" = xno && libtool_flags="$libtool_flags --prefer-non-pic"
# Some flags need to be propagated to the compiler or linker for good
# libtool support.
-case "$host" in
+case $host in
*-*-irix6*)
# Find out which ABI we are using.
- echo '#line 2315 "configure"' > conftest.$ac_ext
- if { (eval echo configure:2316: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- case "`/usr/bin/file conftest.o`" in
+ echo '#line 2319 "configure"' > conftest.$ac_ext
+ if { (eval echo configure:2320: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ case `/usr/bin/file conftest.$ac_objext` in
*32-bit*)
LD="${LD-ld} -32"
;;
@@ -2333,7 +2337,7 @@ case "$host" in
SAVE_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -belf"
echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6
-echo "configure:2337: checking whether the C compiler needs -belf" >&5
+echo "configure:2341: checking whether the C compiler needs -belf" >&5
if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2346,14 +2350,14 @@ ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$a
cross_compiling=$ac_cv_prog_cc_cross
cat > conftest.$ac_ext <<EOF
-#line 2350 "configure"
+#line 2354 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
-if { (eval echo configure:2357: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2361: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
lt_cv_cc_needs_belf=yes
else
@@ -2383,7 +2387,7 @@ echo "$ac_t""$lt_cv_cc_needs_belf" 1>&6
esac
echo $ac_n "checking how to run the C++ preprocessor""... $ac_c" 1>&6
-echo "configure:2387: checking how to run the C++ preprocessor" >&5
+echo "configure:2391: checking how to run the C++ preprocessor" >&5
if test -z "$CXXCPP"; then
if eval "test \"`echo '$''{'ac_cv_prog_CXXCPP'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -2396,12 +2400,12 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes
cross_compiling=$ac_cv_prog_cxx_cross
CXXCPP="${CXX-g++} -E"
cat > conftest.$ac_ext <<EOF
-#line 2400 "configure"
+#line 2404 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2405: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2409: \"$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
:
@@ -2508,12 +2512,11 @@ exec 5>>./config.log
-
LIBTOOL_DEPS=$LIBTOOL_DEPS" $ac_aux_dir/ltcf-cxx.sh"
lt_save_CC="$CC"
lt_save_CFLAGS="$CFLAGS"
AR="$AR" LTCC="$CC" CC="$CXX" CXX="$CXX" CFLAGS="$CXXFLAGS" CPPFLAGS="$CPPFLAGS" \
-MAGIC_CMD="$MAGIC_CMD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
+MAGIC_CMD="$MAGIC_CMD" LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" STRIP="$STRIP" \
AS="$AS" DLLTOOL="$DLLTOOL" OBJDUMP="$OBJDUMP" \
objext="$OBJEXT" exeext="$EXEEXT" reload_flag="$reload_flag" \
@@ -2529,7 +2532,6 @@ CFLAGS="$lt_save_CFLAGS"
# clobbered by the next message.
exec 5>>./config.log
-
@@ -2538,7 +2540,7 @@ exec 5>>./config.log
echo $ac_n "checking for GNU make""... $ac_c" 1>&6
-echo "configure:2542: checking for GNU make" >&5
+echo "configure:2544: checking for GNU make" >&5
if eval "test \"`echo '$''{'_cv_gnu_make_command'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2561,9 +2563,7 @@ echo "$ac_t""$_cv_gnu_make_command" 1>&6 ;
fi
- if test "x$_cv_gnu_make_command" = "x"; then
- { echo "configure: error: GNU make not found. Please install it or correct your path." 1>&2; exit 1; }
- fi
+
@@ -2585,21 +2585,24 @@ cross_compiling=$ac_cv_prog_cxx_cross
#line 2586 "configure"
#include "confdefs.h"
- #if (__GNUC__ > 2) || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)
- ok
+int main() {
+
+ #if __GNUC__ < 3
+ not_ok
#endif
+; return 0; }
EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "ok" >/dev/null 2>&1; then
+if { (eval echo configure:2597: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gpp_satisfactory=yes
else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
rm -rf conftest*
- { echo "configure: error: please upgrade to gcc-2.95 or above" 1>&2; exit 1; }
+ { echo "configure: error: please upgrade to GCC 3.0 or above" 1>&2; exit 1; }
fi
rm -f conftest*
-
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
@@ -2636,7 +2639,7 @@ esac
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:2640: checking how to run the C preprocessor" >&5
+echo "configure:2643: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
@@ -2651,13 +2654,13 @@ else
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp.
cat > conftest.$ac_ext <<EOF
-#line 2655 "configure"
+#line 2658 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2661: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2664: \"$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
:
@@ -2668,13 +2671,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
-#line 2672 "configure"
+#line 2675 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2678: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2681: \"$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
:
@@ -2685,13 +2688,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -nologo -E"
cat > conftest.$ac_ext <<EOF
-#line 2689 "configure"
+#line 2692 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2695: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2698: \"$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
:
@@ -2717,7 +2720,7 @@ echo "$ac_t""$CPP" 1>&6
echo $ac_n "checking for cstdio to use""... $ac_c" 1>&6
-echo "configure:2721: checking for cstdio to use" >&5
+echo "configure:2724: checking for cstdio to use" >&5
# Check whether --enable-cstdio or --disable-cstdio was given.
if test "${enable_cstdio+set}" = set; then
enableval="$enable_cstdio"
@@ -2734,23 +2737,24 @@ fi
case x${enable_cstdio_flag} in
xlibio)
CSTDIO_H=config/c_io_libio.h
- CSTDIO_CC=config/c_io_libio.cc
+ BASIC_FILE_H=config/basic_file_libio.h
+ BASIC_FILE_CC=config/basic_file_libio.cc
echo "$ac_t""libio" 1>&6
# see if we are on a system with libio native (ie, linux)
ac_safe=`echo "libio.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for libio.h""... $ac_c" 1>&6
-echo "configure:2744: checking for libio.h" >&5
+echo "configure:2748: checking for libio.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 2749 "configure"
+#line 2753 "configure"
#include "confdefs.h"
#include <libio.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2754: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2758: \"$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*
@@ -2780,9 +2784,9 @@ fi
case "$target" in
*-*-linux*)
echo $ac_n "checking for glibc version >= 2.2""... $ac_c" 1>&6
-echo "configure:2784: checking for glibc version >= 2.2" >&5
+echo "configure:2788: checking for glibc version >= 2.2" >&5
cat > conftest.$ac_ext <<EOF
-#line 2786 "configure"
+#line 2790 "configure"
#include "confdefs.h"
#include <features.h>
@@ -2838,14 +2842,13 @@ rm -f conftest*
xstdio | x | xno | xnone | xyes)
# default
CSTDIO_H=config/c_io_stdio.h
- CSTDIO_CC=config/c_io_stdio.cc
+ BASIC_FILE_H=config/basic_file_stdio.h
+ BASIC_FILE_CC=config/basic_file_stdio.cc
echo "$ac_t""stdio" 1>&6
# We're not using stdio.
need_libio=no
need_wlibio=no
- # Wide characters are not supported with this package.
- enable_c_mbchar=no
;;
*)
echo "$enable_cstdio is an unknown io package" 1>&2
@@ -2854,6 +2857,7 @@ rm -f conftest*
esac
+
# 2000-08-04 bkoz hack
CCODECVT_C=config/c_io_libio_codecvt.c
@@ -2896,7 +2900,7 @@ fi
echo $ac_n "checking for clocale to use""... $ac_c" 1>&6
-echo "configure:2900: checking for clocale to use" >&5
+echo "configure:2904: checking for clocale to use" >&5
# Check whether --enable-clocale or --disable-clocale was given.
if test "${enable_clocale+set}" = set; then
enableval="$enable_clocale"
@@ -2943,168 +2947,626 @@ else
fi
- # Check whether --enable-long-long or --disable-long-long was given.
-if test "${enable_long_long+set}" = set; then
- enableval="$enable_long_long"
+ # Check whether --enable-c99 or --disable-c99 was given.
+if test "${enable_c99+set}" = set; then
+ enableval="$enable_c99"
case "$enableval" in
- yes) enable_long_long=yes ;;
- no) enable_long_long=no ;;
- *) { echo "configure: error: Unknown argument to enable/disable long long" 1>&2; exit 1; } ;;
+ yes) enable_c99=yes ;;
+ no) enable_c99=no ;;
+ *) { echo "configure: error: Unknown argument to enable/disable C99" 1>&2; exit 1; } ;;
esac
else
- enable_long_long=no
+ enable_c99=yes
fi
- # Allow use of os-dependent settings, so that macros that turn on
- # C99 capabilities can be defined and used in a consistent way.
- OS_INC_PATH=${srcdir}/$os_include_dir
- ac_test_CFLAGS="${CFLAGS+set}"
- ac_save_CFLAGS="$CFLAGS"
- CFLAGS="-I$OS_INC_PATH"
+
+ ac_ext=C
+# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cxx_cross
- # Check for the existence of functions used if long long is enabled.
- echo $ac_n "checking for strtoll""... $ac_c" 1>&6
-echo "configure:2968: checking for strtoll" >&5
-if eval "test \"`echo '$''{'ac_cv_func_strtoll'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+
+ # Check for the existence of <math.h> functions used if C99 is enabled.
+ ac_c99_math=yes;
+ echo $ac_n "checking for ISO C99 support in <math.h>""... $ac_c" 1>&6
+echo "configure:2975: checking for ISO C99 support in <math.h>" >&5
+ cat > conftest.$ac_ext <<EOF
+#line 2977 "configure"
+#include "confdefs.h"
+#include <math.h>
+int main() {
+fpclassify(0.0);
+; return 0; }
+EOF
+if { (eval echo configure:2984: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ :
else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_c99_math=no
+fi
+rm -f conftest*
cat > conftest.$ac_ext <<EOF
-#line 2973 "configure"
+#line 2994 "configure"
#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char strtoll(); below. */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char strtoll();
-
+#include <math.h>
int main() {
-
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined (__stub_strtoll) || defined (__stub___strtoll)
-choke me
-#else
-strtoll();
-#endif
-
+isfinite(0.0);
; return 0; }
EOF
-if { (eval echo configure:2996: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3001: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ :
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
rm -rf conftest*
- eval "ac_cv_func_strtoll=yes"
+ ac_c99_math=no
+fi
+rm -f conftest*
+ cat > conftest.$ac_ext <<EOF
+#line 3011 "configure"
+#include "confdefs.h"
+#include <math.h>
+int main() {
+isinf(0.0);
+; return 0; }
+EOF
+if { (eval echo configure:3018: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ :
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
- eval "ac_cv_func_strtoll=no"
+ ac_c99_math=no
fi
rm -f conftest*
+ cat > conftest.$ac_ext <<EOF
+#line 3028 "configure"
+#include "confdefs.h"
+#include <math.h>
+int main() {
+isnan(0.0);
+; return 0; }
+EOF
+if { (eval echo configure:3035: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ :
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_c99_math=no
fi
-
-if eval "test \"`echo '$ac_cv_func_'strtoll`\" = yes"; then
- echo "$ac_t""yes" 1>&6
+rm -f conftest*
+ cat > conftest.$ac_ext <<EOF
+#line 3045 "configure"
+#include "confdefs.h"
+#include <math.h>
+int main() {
+isnormal(0.0);
+; return 0; }
+EOF
+if { (eval echo configure:3052: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
:
else
- echo "$ac_t""no" 1>&6
-ac_strtoll=no
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_c99_math=no
fi
-
- echo $ac_n "checking for strtoull""... $ac_c" 1>&6
-echo "configure:3017: checking for strtoull" >&5
-if eval "test \"`echo '$''{'ac_cv_func_strtoull'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+rm -f conftest*
+ cat > conftest.$ac_ext <<EOF
+#line 3062 "configure"
+#include "confdefs.h"
+#include <math.h>
+int main() {
+signbit(0.0);
+; return 0; }
+EOF
+if { (eval echo configure:3069: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ :
else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_c99_math=no
+fi
+rm -f conftest*
cat > conftest.$ac_ext <<EOF
-#line 3022 "configure"
+#line 3079 "configure"
#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char strtoull(); below. */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char strtoull();
-
+#include <math.h>
+int main() {
+isgreater(0.0,0.0);
+; return 0; }
+EOF
+if { (eval echo configure:3086: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ :
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_c99_math=no
+fi
+rm -f conftest*
+ cat > conftest.$ac_ext <<EOF
+#line 3096 "configure"
+#include "confdefs.h"
+#include <math.h>
int main() {
+isgreaterequal(0.0,0.0);
+; return 0; }
+EOF
+if { (eval echo configure:3103: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ :
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_c99_math=no
+fi
+rm -f conftest*
+ cat > conftest.$ac_ext <<EOF
+#line 3113 "configure"
+#include "confdefs.h"
+#include <math.h>
+int main() {
+isless(0.0,0.0);
+; return 0; }
+EOF
+if { (eval echo configure:3120: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ :
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_c99_math=no
+fi
+rm -f conftest*
+ cat > conftest.$ac_ext <<EOF
+#line 3130 "configure"
+#include "confdefs.h"
+#include <math.h>
+int main() {
+islessequal(0.0,0.0);
+; return 0; }
+EOF
+if { (eval echo configure:3137: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ :
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_c99_math=no
+fi
+rm -f conftest*
+ cat > conftest.$ac_ext <<EOF
+#line 3147 "configure"
+#include "confdefs.h"
+#include <math.h>
+int main() {
+islessgreater(0.0,0.0);
+; return 0; }
+EOF
+if { (eval echo configure:3154: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ :
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_c99_math=no
+fi
+rm -f conftest*
+ cat > conftest.$ac_ext <<EOF
+#line 3164 "configure"
+#include "confdefs.h"
+#include <math.h>
+int main() {
+isunordered(0.0,0.0);
+; return 0; }
+EOF
+if { (eval echo configure:3171: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ :
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_c99_math=no
+fi
+rm -f conftest*
+ echo "$ac_t""$ac_c99_math" 1>&6
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined (__stub_strtoull) || defined (__stub___strtoull)
-choke me
-#else
-strtoull();
-#endif
+ # Check for the existence in <stdio.h> of vscanf, et. al.
+ ac_c99_stdio=yes;
+ echo $ac_n "checking for ISO C99 support in <stdio.h>""... $ac_c" 1>&6
+echo "configure:3185: checking for ISO C99 support in <stdio.h>" >&5
+ cat > conftest.$ac_ext <<EOF
+#line 3187 "configure"
+#include "confdefs.h"
+#include <stdio.h>
+int main() {
+snprintf("12", 0, "%i");
+; return 0; }
+EOF
+if { (eval echo configure:3194: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ :
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_c99_stdio=no
+fi
+rm -f conftest*
+ cat > conftest.$ac_ext <<EOF
+#line 3204 "configure"
+#include "confdefs.h"
+#include <stdio.h>
+ #include <stdarg.h>
+ void foo(char* fmt, ...)
+ {va_list args; va_start(args, fmt);
+ vfscanf(stderr, "%i", args);}
+int main() {
; return 0; }
EOF
-if { (eval echo configure:3045: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3215: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ :
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
rm -rf conftest*
- eval "ac_cv_func_strtoull=yes"
+ ac_c99_stdio=no
+fi
+rm -f conftest*
+ cat > conftest.$ac_ext <<EOF
+#line 3225 "configure"
+#include "confdefs.h"
+#include <stdio.h>
+ #include <stdarg.h>
+ void foo(char* fmt, ...)
+ {va_list args; va_start(args, fmt);
+ vscanf("%i", args);}
+int main() {
+
+; return 0; }
+EOF
+if { (eval echo configure:3236: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ :
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
- eval "ac_cv_func_strtoull=no"
+ ac_c99_stdio=no
fi
rm -f conftest*
-fi
+ cat > conftest.$ac_ext <<EOF
+#line 3246 "configure"
+#include "confdefs.h"
+#include <stdio.h>
+ #include <stdarg.h>
+ void foo(char* fmt, ...)
+ {va_list args; va_start(args, fmt);
+ vsnprintf(fmt, 0, "%i", args);}
+int main() {
-if eval "test \"`echo '$ac_cv_func_'strtoull`\" = yes"; then
- echo "$ac_t""yes" 1>&6
+; return 0; }
+EOF
+if { (eval echo configure:3257: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
:
else
- echo "$ac_t""no" 1>&6
-ac_strtoull=no
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_c99_stdio=no
fi
+rm -f conftest*
+ cat > conftest.$ac_ext <<EOF
+#line 3267 "configure"
+#include "confdefs.h"
+#include <stdio.h>
+ #include <stdarg.h>
+ void foo(char* fmt, ...)
+ {va_list args; va_start(args, fmt);
+ vsscanf(fmt, "%i", args);}
+int main() {
+; return 0; }
+EOF
+if { (eval echo configure:3278: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ :
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_c99_stdio=no
+fi
+rm -f conftest*
+ echo "$ac_t""$ac_c99_stdio" 1>&6
- # Check for lldiv_t, et. al.
+ # Check for the existence in <stdlib.h> of lldiv_t, et. al.
+ ac_c99_stdlib=yes;
echo $ac_n "checking for lldiv_t declaration""... $ac_c" 1>&6
-echo "configure:3068: checking for lldiv_t declaration" >&5
- if eval "test \"`echo '$''{'glibcpp_lldiv_t_use'+set}'`\" = set"; then
+echo "configure:3292: checking for lldiv_t declaration" >&5
+ if eval "test \"`echo '$''{'ac_c99_lldiv_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3074 "configure"
+#line 3298 "configure"
#include "confdefs.h"
-#include <bits/os_defines.h>
- #include <stdlib.h>
+#include <stdlib.h>
int main() {
lldiv_t mydivt;
; return 0; }
EOF
-if { (eval echo configure:3082: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3305: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
- glibcpp_lldiv_t_use=yes
+ ac_c99_lldiv_t=yes
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
- glibcpp_lldiv_t_use=no
+ ac_c99_lldiv_t=no
fi
rm -f conftest*
fi
- echo "$ac_t""$glibcpp_lldiv_t_use" 1>&6
- if test x$glibcpp_lldiv_t_use = x"yes"; then
+ echo "$ac_t""$ac_c99_lldiv_t" 1>&6
+
+ echo $ac_n "checking for ISO C99 support in <stdlib.h>""... $ac_c" 1>&6
+echo "configure:3321: checking for ISO C99 support in <stdlib.h>" >&5
+ cat > conftest.$ac_ext <<EOF
+#line 3323 "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+int main() {
+char* tmp; strtof("gnu", &tmp);
+; return 0; }
+EOF
+if { (eval echo configure:3330: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ :
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_c99_stdlib=no
+fi
+rm -f conftest*
+ cat > conftest.$ac_ext <<EOF
+#line 3340 "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+int main() {
+char* tmp; strtold("gnu", &tmp);
+; return 0; }
+EOF
+if { (eval echo configure:3347: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ :
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_c99_stdlib=no
+fi
+rm -f conftest*
+ cat > conftest.$ac_ext <<EOF
+#line 3357 "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+int main() {
+llabs(10);
+; return 0; }
+EOF
+if { (eval echo configure:3364: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ :
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_c99_stdlib=no
+fi
+rm -f conftest*
+ cat > conftest.$ac_ext <<EOF
+#line 3374 "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+int main() {
+lldiv(10,1);
+; return 0; }
+EOF
+if { (eval echo configure:3381: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ :
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_c99_stdlib=no
+fi
+rm -f conftest*
+ cat > conftest.$ac_ext <<EOF
+#line 3391 "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+int main() {
+atoll("10");
+; return 0; }
+EOF
+if { (eval echo configure:3398: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ :
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_c99_stdlib=no
+fi
+rm -f conftest*
+ cat > conftest.$ac_ext <<EOF
+#line 3408 "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+int main() {
+_Exit(0);
+; return 0; }
+EOF
+if { (eval echo configure:3415: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ :
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_c99_stdlib=no
+fi
+rm -f conftest*
+ if test x"$ac_c99_lldiv_t" = x"no"; then
+ ac_c99_stdlib=no;
+ fi;
+ echo "$ac_t""$ac_c99_stdlib" 1>&6
+
+ # Check for the existence of <wchar.h> functions used if C99 is enabled.
+ # XXX the wchar.h checks should be rolled into the general C99 bits.
+ ac_c99_wchar=yes;
+ echo $ac_n "checking for additional ISO C99 support in <wchar.h>""... $ac_c" 1>&6
+echo "configure:3433: checking for additional ISO C99 support in <wchar.h>" >&5
+ cat > conftest.$ac_ext <<EOF
+#line 3435 "configure"
+#include "confdefs.h"
+#include <wchar.h>
+int main() {
+wcstold(L"10.0", NULL);
+; return 0; }
+EOF
+if { (eval echo configure:3442: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ :
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_c99_wchar=no
+fi
+rm -f conftest*
+ cat > conftest.$ac_ext <<EOF
+#line 3452 "configure"
+#include "confdefs.h"
+#include <wchar.h>
+int main() {
+wcstoll(L"10", NULL, 10);
+; return 0; }
+EOF
+if { (eval echo configure:3459: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ :
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_c99_wchar=no
+fi
+rm -f conftest*
+ cat > conftest.$ac_ext <<EOF
+#line 3469 "configure"
+#include "confdefs.h"
+#include <wchar.h>
+int main() {
+wcstoull(L"10", NULL, 10);
+; return 0; }
+EOF
+if { (eval echo configure:3476: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ :
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_c99_wchar=no
+fi
+rm -f conftest*
+ echo "$ac_t""$ac_c99_wchar" 1>&6
+
+ echo $ac_n "checking for enabled ISO C99 support""... $ac_c" 1>&6
+echo "configure:3488: checking for enabled ISO C99 support" >&5
+ if test x"$ac_c99_math" = x"no" || test x"$ac_c99_stdio" = x"no" \
+ || test x"$ac_c99_stdlib" = x"no" \
+ || test x"$ac_c99_wchar" = x"no"; then
+ enable_c99=no;
+ fi;
+ echo "$ac_t""$enable_c99" 1>&6
+
+ # Option parsed, now set things appropriately
+ if test x"$enable_c99" = x"yes"; then
cat >> confdefs.h <<\EOF
-#define HAVE_LLDIV_T 1
+#define _GLIBCPP_USE_C99 1
EOF
fi
- echo $ac_n "checking for enabled long long""... $ac_c" 1>&6
-echo "configure:3104: checking for enabled long long" >&5
- if test x"$ac_strtoll" = xno || test x"$ac_strtoull" = xno; then
- enable_long_long=no;
- fi;
- echo "$ac_t""$enable_long_long" 1>&6
+ ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+
+
+ # Check whether --enable-long-long or --disable-long-long was given.
+if test "${enable_long_long+set}" = set; then
+ enableval="$enable_long_long"
+ case "$enableval" in
+ yes) enable_long_long=yes ;;
+ no) enable_long_long=no ;;
+ *) { echo "configure: error: Unknown argument to enable/disable long long" 1>&2; exit 1; } ;;
+ esac
+else
+ enable_long_long=yes
+fi
+
+
+ ac_ext=C
+# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cxx_cross
+
+
+ echo $ac_n "checking for enabled long long I/O support""... $ac_c" 1>&6
+echo "configure:3535: checking for enabled long long I/O support" >&5
+ # iostreams require strtoll, strtoull to compile
+ cat > conftest.$ac_ext <<EOF
+#line 3538 "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+int main() {
+char* tmp; strtoll("gnu", &tmp, 10);
+; return 0; }
+EOF
+if { (eval echo configure:3545: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ :
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ enable_long_long=no
+fi
+rm -f conftest*
+ cat > conftest.$ac_ext <<EOF
+#line 3555 "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+int main() {
+char* tmp; strtoull("gnu", &tmp, 10);
+; return 0; }
+EOF
+if { (eval echo configure:3562: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ :
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ enable_long_long=no
+fi
+rm -f conftest*
# Option parsed, now set things appropriately
if test x"$enable_long_long" = xyes; then
@@ -3113,12 +3575,18 @@ echo "configure:3104: checking for enabled long long" >&5
EOF
fi
+ echo "$ac_t""$enable_long_long" 1>&6
+
+ ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
- # Reset CFLAGS
- CFLAGS="$ac_save_CFLAGS"
echo $ac_n "checking for c header strategy to use""... $ac_c" 1>&6
-echo "configure:3122: checking for c header strategy to use" >&5
+echo "configure:3590: checking for c header strategy to use" >&5
# Check whether --enable-cheaders or --disable-cheaders was given.
if test "${enable_cheaders+set}" = set; then
enableval="$enable_cheaders"
@@ -3145,7 +3613,7 @@ fi
case "$enable_cheaders" in
c_shadow)
CSHADOW_FLAGS="-fno-builtin"
- C_INCLUDE_DIR='${top_srcdir}/include/c_shadow'
+ C_INCLUDE_DIR='${glibcpp_srcdir}/include/c_shadow'
cat >> confdefs.h <<\EOF
#define _GLIBCPP_USE_SHADOW_HEADERS 1
EOF
@@ -3153,11 +3621,11 @@ EOF
;;
c_std)
CSHADOW_FLAGS=""
- C_INCLUDE_DIR='${top_srcdir}/include/c_std'
+ C_INCLUDE_DIR='${glibcpp_srcdir}/include/c_std'
;;
c)
CSHADOW_FLAGS=""
- C_INCLUDE_DIR='${top_srcdir}/include/c'
+ C_INCLUDE_DIR='${glibcpp_srcdir}/include/c'
;;
esac
@@ -3174,65 +3642,25 @@ else
fi
- echo $ac_n "checking for threads package to use""... $ac_c" 1>&6
-echo "configure:3179: checking for threads package to use" >&5
- # Check whether --enable-threads or --disable-threads was given.
-if test "${enable_threads+set}" = set; then
- enableval="$enable_threads"
- if test x$enable_threads = xno; then
- enable_threads=''
- fi
-else
- enable_threads=''
-fi
-
-
- enable_threads_flag=$enable_threads
-
- case x${enable_threads_flag} in
- x | xno | xnone)
- # No threads
- target_thread_file='single'
- ;;
- xyes)
- # default
- target_thread_file='posix'
- ;;
- xdecosf1 | xirix | xmach | xos2 | xposix | xpthreads | xsingle | \
- xsolaris | xwin32 | xdce | xvxworks)
- target_thread_file=$enable_threads_flag
- ;;
- *)
- echo "$enable_threads is an unknown thread package" 1>&2
- exit 1
- ;;
- esac
+ echo $ac_n "checking for thread model used by GCC""... $ac_c" 1>&6
+echo "configure:3647: checking for thread model used by GCC" >&5
+ target_thread_file=`$CC -v 2>&1 | sed -n 's/^Thread model: //p'`
+ echo "$ac_t""$target_thread_file" 1>&6
- THREADH=
- case "$target_thread_file" in
- no | none | single)
- THREADH=threads-no.h
- ;;
- posix | pthreads)
- THREADH=threads-posix.h
- ;;
- decosf1 | irix | mach | os2 | solaris | win32 | dce | vxworks)
- { echo "configure: error: thread package $THREADS not yet supported" 1>&2; exit 1; }
- ;;
- *)
- { echo "configure: error: $THREADS is an unsupported/unknown thread package" 1>&2; exit 1; }
- ;;
- esac
- echo "$ac_t""$THREADH" 1>&6
+ if test $target_thread_file != single; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_GTHR_DEFAULT 1
+EOF
-
- if test $THREADH != threads-no.h; then
cat >> confdefs.h <<\EOF
-#define _GLIBCPP_USE_THREADS 1
+#define _GLIBCPP_SUPPORTS_WEAK __GXX_WEAK__
EOF
fi
+ glibcpp_thread_h=gthr-$target_thread_file.h
+
+
# Check whether --enable-cxx-flags or --disable-cxx-flags was given.
if test "${enable_cxx_flags+set}" = set; then
enableval="$enable_cxx_flags"
@@ -3267,22 +3695,80 @@ EXTRA_CXX_FLAGS="$enable_cxx_flags"
-if test -n "$with_cross_host"; then
+ echo $ac_n "checking for exception model to use""... $ac_c" 1>&6
+echo "configure:3700: checking for exception model to use" >&5
+
+ ac_ext=C
+# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cxx_cross
+
+ # Check whether --enable-sjlj-exceptions or --disable-sjlj-exceptions was given.
+if test "${enable_sjlj_exceptions+set}" = set; then
+ enableval="$enable_sjlj_exceptions"
+ :
+else
+ cat > conftest.$ac_ext << EOF
+#line 3715 "configure"
+struct S { ~S(); };
+void bar();
+void foo()
+{
+ S s;
+ bar();
+}
+EOF
+ old_CXXFLAGS="$CXXFLAGS"
+ CXXFLAGS=-S
+ if { (eval echo configure:3726: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ if grep _Unwind_SjLj_Resume conftest.s >/dev/null 2>&1 ; then
+ enable_sjlj_exceptions=yes
+ elif grep _Unwind_Resume conftest.s >/dev/null 2>&1 ; then
+ enable_sjlj_exceptions=no
+ fi
+ fi
+ CXXFLAGS="$old_CXXFLAGS"
+ rm -f conftest*
+fi
+
+ if test x$enable_sjlj_exceptions = xyes; then
+ cat >> confdefs.h <<\EOF
+#define _GLIBCPP_SJLJ_EXCEPTIONS 1
+EOF
+
+ ac_exception_model_name=sjlj
+ elif test x$enable_sjlj_exceptions = xno; then
+ ac_exception_model_name="call frame"
+ else
+ { echo "configure: error: unable to detect exception model" 1>&2; exit 1; }
+ fi
+ ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+ echo "$ac_t""$ac_exception_model_name" 1>&6
+
+
+if test -n "$with_cross_host" || test x"$build" != x"$host"; then
- # We are being configured with a cross compiler. AC_REPLACE_FUNCS
- # may not work correctly, because the compiler may not be able to
- # link executables.
- xcompiling=1
- NATIVE=no
+ # We are being configured with some form of cross compiler.
+ # mknumeric_limits may not work correctly, either because the
+ # compiler may not run on this machine, may not be able to link
+ # executables, or may produce executables we can't run on this
+ # machine.
+ GLIBCPP_IS_CROSS_COMPILING=1
# If Canadian cross, then don't pick up tools from the build
# directory.
- if test x"$build" != x"$with_cross_host" && x"$build" != x"$target"; then
+ if test -n "$with_cross_host" && test x"$build" != x"$with_cross_host"; then
CANADIAN=yes
- NULL_TARGET=yes
else
CANADIAN=no
- NULL_TARGET=no
fi
case "$target_alias" in
@@ -3295,17 +3781,17 @@ if test -n "$with_cross_host"; then
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3299: checking for $ac_hdr" >&5
+echo "configure:3785: 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 3304 "configure"
+#line 3790 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3309: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3795: \"$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*
@@ -3333,16 +3819,14 @@ done
# GLIBCPP_CHECK_COMPILER_FEATURES
- WFMT_FLAGS='-fdiagnostics-show-location=once'
SECTION_FLAGS='-ffunction-sections -fdata-sections'
-
# If we're not using GNU ld, then there's no point in even trying these
# tests. Check for that first. We should have already tested for gld
# by now (in libtool), but require it now just to be safe...
- SECTION_LDFLAGS=''
- OPT_LDFLAGS=''
+ test -z "$SECTION_LDFLAGS" && SECTION_LDFLAGS=''
+ test -z "$OPT_LDFLAGS" && OPT_LDFLAGS=''
# Set --gc-sections.
@@ -3363,12 +3847,12 @@ done
# used sections, first .eh_frame and now some of the glibc sections for
# iconv). Bzzzzt. Thanks for playing, maybe next time.
echo $ac_n "checking for ld that supports -Wl,--gc-sections""... $ac_c" 1>&6
-echo "configure:3367: checking for ld that supports -Wl,--gc-sections" >&5
+echo "configure:3851: checking for ld that supports -Wl,--gc-sections" >&5
if test "$cross_compiling" = yes; then
ac_sectionLDflags=yes
else
cat > conftest.$ac_ext <<EOF
-#line 3372 "configure"
+#line 3856 "configure"
#include "confdefs.h"
int main(void)
@@ -3379,14 +3863,14 @@ else
}
EOF
-if { (eval echo configure:3383: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3867: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_sectionLDflags=yes
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -fr conftest*
- ac_sectionLFflags=no
+ ac_sectionLDflags=no
fi
rm -fr conftest*
fi
@@ -3398,14 +3882,14 @@ fi
CFLAGS=''
fi
if test "$ac_sectionLDflags" = "yes"; then
- SECTION_LDFLAGS='-Wl,--gc-sections'
+ SECTION_LDFLAGS="-Wl,--gc-sections $SECTION_LDFLAGS"
fi
echo "$ac_t""$ac_sectionLDflags" 1>&6
fi
# Set linker optimization flags.
if test x"$ac_cv_prog_gnu_ld" = x"yes" && test x"$enable_debug" = x"no"; then
- OPT_LDFLAGS='-Wl,-O1'
+ OPT_LDFLAGS="-Wl,-O1 $OPT_LDFLAGS"
fi
@@ -3657,7 +4141,7 @@ EOF
fi
echo $ac_n "checking for main in -lm""... $ac_c" 1>&6
-echo "configure:3661: checking for main in -lm" >&5
+echo "configure:4145: checking for main in -lm" >&5
ac_lib_var=`echo m'_'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
@@ -3665,14 +4149,14 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lm $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 3669 "configure"
+#line 4153 "configure"
#include "confdefs.h"
int main() {
main()
; return 0; }
EOF
-if { (eval echo configure:3676: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4160: \"$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
@@ -3699,15 +4183,15 @@ else
echo "$ac_t""no" 1>&6
fi
- for ac_func in nan hypot hypotf atan2f expf copysignf
+ for ac_func in nan copysignf
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3706: checking for $ac_func" >&5
+echo "configure:4190: 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 3711 "configure"
+#line 4195 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -3730,7 +4214,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:3734: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4218: \"$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
@@ -3758,18 +4242,17 @@ done
USE_COMPLEX_LONG_DOUBLE=no
- if test x$ac_cv_func_atan2l = x"yes" \
- && test x$ac_cv_func_copysignl = x"yes"; then
+ if test x$ac_cv_func_copysignl = x"yes"; then
USE_COMPLEX_LONG_DOUBLE=yes
- for ac_func in hypotl signbitl
+ for ac_func in signbitl
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3768: checking for $ac_func" >&5
+echo "configure:4251: 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 3773 "configure"
+#line 4256 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -3792,7 +4275,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:3796: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4279: \"$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
@@ -3823,144 +4306,18 @@ done
-
-
- echo $ac_n "checking for GNU C++ __complex__ support""... $ac_c" 1>&6
-echo "configure:3830: checking for GNU C++ __complex__ support" >&5
- if eval "test \"`echo '$''{'glibcpp_cv_complex'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
-
- cat > conftest.$ac_ext <<EOF
-#line 3844 "configure"
-#include "confdefs.h"
-struct dcomplex { __complex__ double x; }; \
- dcomplex f(const dcomplex& x) { return dcomplex(x); }
-int main() {
-\
- dcomplex x; f(x);
-; return 0; }
-EOF
-if { (eval echo configure:3853: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- glibcpp_cv_complex=ok
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcpp_cv_complex=buggy
-
-fi
-rm -f conftest*
- ac_ext=c
-# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cc_cross
-
-
-fi
-
- echo "$ac_t""$glibcpp_cv_complex" 1>&6
- if test $glibcpp_cv_complex = buggy; then
- cat >> confdefs.h <<\EOF
-#define _GLIBCPP_BUGGY_COMPLEX 1
-EOF
-
- fi
-
- echo $ac_n "checking for GNU C++ __complex__ float support""... $ac_c" 1>&6
-echo "configure:3883: checking for GNU C++ __complex__ float support" >&5
- if eval "test \"`echo '$''{'glibcpp_cv_float_complex'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
-
- rm -f conftest.h
- cat > conftest.h <<EOB
- //
- // Check for buggy __complex__ that causes ICE in most versions of egcs
- // and gcc-2.95.x on certain platforms (eg., x86-win32).
- //
- // See http://gcc.gnu.org/ml/gcc-bugs/1999-07n/msg00845.html for
- // more info on the bug itself.
- //
- struct
- float_complex
- {
- __complex__ float m_value;
- float_complex (float = 0.0f, float = 0.0f);
- float_complex (__complex__ float val) : m_value (val) {}
- float_complex foo (const float_complex &val)
- { return float_complex (~val.m_value); }
- };
-EOB
- cat > conftest.$ac_ext <<EOF
-#line 3916 "configure"
-#include "confdefs.h"
-#include "conftest.h"
-int main() {
-
-; return 0; }
-EOF
-if { (eval echo configure:3923: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- glibcpp_cv_float_complex=ok
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcpp_cv_float_complex=buggy
-
-fi
-rm -f conftest*
- ac_ext=c
-# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cc_cross
-
-
-fi
-
- echo "$ac_t""$glibcpp_cv_float_complex" 1>&6
- if test $glibcpp_cv_float_complex = buggy; then
- cat >> confdefs.h <<\EOF
-#define _GLIBCPP_BUGGY_FLOAT_COMPLEX 1
-EOF
-
- fi
-
-
echo $ac_n "checking for mbstate_t""... $ac_c" 1>&6
-echo "configure:3955: checking for mbstate_t" >&5
+echo "configure:4312: checking for mbstate_t" >&5
cat > conftest.$ac_ext <<EOF
-#line 3957 "configure"
+#line 4314 "configure"
#include "confdefs.h"
#include <wchar.h>
int main() {
mbstate_t teststate;
; return 0; }
EOF
-if { (eval echo configure:3964: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4321: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
have_mbstate_t=yes
else
@@ -3982,17 +4339,17 @@ EOF
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3986: checking for $ac_hdr" >&5
+echo "configure:4343: 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 3991 "configure"
+#line 4348 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3996: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4353: \"$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*
@@ -4021,17 +4378,17 @@ done
ac_safe=`echo "wctype.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for wctype.h""... $ac_c" 1>&6
-echo "configure:4025: checking for wctype.h" >&5
+echo "configure:4382: checking for wctype.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 4030 "configure"
+#line 4387 "configure"
#include "confdefs.h"
#include <wctype.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4035: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4392: \"$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*
@@ -4058,16 +4415,16 @@ fi
&& test x"$enable_c_mbchar" != xno; then
echo $ac_n "checking for WCHAR_MIN and WCHAR_MAX""... $ac_c" 1>&6
-echo "configure:4062: checking for WCHAR_MIN and WCHAR_MAX" >&5
+echo "configure:4419: checking for WCHAR_MIN and WCHAR_MAX" >&5
cat > conftest.$ac_ext <<EOF
-#line 4064 "configure"
+#line 4421 "configure"
#include "confdefs.h"
#include <wchar.h>
int main() {
int i = WCHAR_MIN; int j = WCHAR_MAX;
; return 0; }
EOF
-if { (eval echo configure:4071: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4428: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
has_wchar_minmax=yes
else
@@ -4080,9 +4437,9 @@ rm -f conftest*
echo "$ac_t""$has_wchar_minmax" 1>&6
echo $ac_n "checking for WEOF""... $ac_c" 1>&6
-echo "configure:4084: checking for WEOF" >&5
+echo "configure:4441: checking for WEOF" >&5
cat > conftest.$ac_ext <<EOF
-#line 4086 "configure"
+#line 4443 "configure"
#include "confdefs.h"
#include <wchar.h>
@@ -4091,7 +4448,7 @@ int main() {
wint_t i = WEOF;
; return 0; }
EOF
-if { (eval echo configure:4095: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4452: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
has_weof=yes
else
@@ -4103,16 +4460,16 @@ fi
rm -f conftest*
echo "$ac_t""$has_weof" 1>&6
- for ac_func in wcslen wmemchr wmemcmp wmemcpy wmemmove wmemset \
- wcsrtombs mbsrtowcs
+ ac_wfuncs=yes
+ for ac_func in wcslen wmemchr wmemcmp wmemcpy wmemmove wmemset
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4111: checking for $ac_func" >&5
+echo "configure:4468: 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 4116 "configure"
+#line 4473 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -4135,7 +4492,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:4139: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4496: \"$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
@@ -4153,16 +4510,80 @@ if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
cat >> confdefs.h <<EOF
#define $ac_tr_func 1
EOF
- ac_wfuncs=yes
+
else
echo "$ac_t""no" 1>&6
-ac_wfuncs=no
+\
+ ac_wfuncs=no
fi
done
+ for ac_func in btowc wctob fgetwc fgetwc fgetws fputwc fputws fwide \
+ fwprintf fwscanf swprintf swscanf vfwprintf vfwscanf vswprintf vswscanf \
+ vwprintf vwscanf wprintf wscanf getwc getwchar mbsinit mbrlen mbrtowc \
+ mbsrtowcs wcsrtombs putwc putwchar ungetwc wcrtomb wcstod wcstof wcstol \
+ wcstoul wcscpy wcsncpy wcscat wcsncat wcscmp wcscoll wcsncmp wcsxfrm \
+ wcscspn wcsspn wcstok wcsftime wcschr wcspbrk wcsrchr wcsstr
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:4531: 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 4536 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:4559: \"$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
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+\
+ ac_wfuncs=no
+fi
+done
+
+
echo $ac_n "checking for ISO C99 wchar_t support""... $ac_c" 1>&6
-echo "configure:4166: checking for ISO C99 wchar_t support" >&5
+echo "configure:4587: checking for ISO C99 wchar_t support" >&5
if test x"$has_weof" = xyes && test x"$has_wchar_minmax" = xyes \
&& test x"$ac_wfuncs" = xyes; then
ac_isoC99_wchar_t=yes
@@ -4173,17 +4594,17 @@ echo "configure:4166: checking for ISO C99 wchar_t support" >&5
ac_safe=`echo "iconv.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for iconv.h""... $ac_c" 1>&6
-echo "configure:4177: checking for iconv.h" >&5
+echo "configure:4598: checking for iconv.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 4182 "configure"
+#line 4603 "configure"
#include "confdefs.h"
#include <iconv.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4187: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4608: \"$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*
@@ -4207,17 +4628,17 @@ fi
ac_safe=`echo "langinfo.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for langinfo.h""... $ac_c" 1>&6
-echo "configure:4211: checking for langinfo.h" >&5
+echo "configure:4632: checking for langinfo.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 4216 "configure"
+#line 4637 "configure"
#include "confdefs.h"
#include <langinfo.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4221: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4642: \"$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*
@@ -4241,7 +4662,7 @@ fi
echo $ac_n "checking for iconv in -liconv""... $ac_c" 1>&6
-echo "configure:4245: checking for iconv in -liconv" >&5
+echo "configure:4666: checking for iconv in -liconv" >&5
ac_lib_var=`echo iconv'_'iconv | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -4249,7 +4670,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-liconv $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 4253 "configure"
+#line 4674 "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
@@ -4260,7 +4681,7 @@ int main() {
iconv()
; return 0; }
EOF
-if { (eval echo configure:4264: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4685: \"$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
@@ -4286,12 +4707,12 @@ fi
for ac_func in iconv_open iconv_close iconv nl_langinfo
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4290: checking for $ac_func" >&5
+echo "configure:4711: 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 4295 "configure"
+#line 4716 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -4314,7 +4735,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:4318: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4739: \"$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
@@ -4344,7 +4765,7 @@ done
LIBS="$ac_save_LIBS"
echo $ac_n "checking for XPG2 wchar_t support""... $ac_c" 1>&6
-echo "configure:4348: checking for XPG2 wchar_t support" >&5
+echo "configure:4769: checking for XPG2 wchar_t support" >&5
if test x"$ac_has_iconv_h" = xyes && test x"$ac_has_langinfo_h" = xyes \
&& test x"$ac_XPG2funcs" = xyes; then
ac_XPG2_wchar_t=yes
@@ -4354,21 +4775,17 @@ echo "configure:4348: checking for XPG2 wchar_t support" >&5
echo "$ac_t""$ac_XPG2_wchar_t" 1>&6
echo $ac_n "checking for enabled wchar_t specializations""... $ac_c" 1>&6
-echo "configure:4358: checking for enabled wchar_t specializations" >&5
+echo "configure:4779: checking for enabled wchar_t specializations" >&5
if test x"$ac_isoC99_wchar_t" = xyes \
- && test x"$ac_XPG2_wchar_t" = xyes; then
- libinst_wstring_la="libinst-wstring.la"
+ && test x"$ac_XPG2_wchar_t" = xyes; then
cat >> confdefs.h <<\EOF
#define _GLIBCPP_USE_WCHAR_T 1
EOF
echo "$ac_t"""yes"" 1>&6
else
- libinst_wstring_la=""
echo "$ac_t"""no"" 1>&6
fi
-
-
else
echo "configure: warning: wchar_t support disabled." 1>&2
fi
@@ -4415,14 +4832,6 @@ EOF
os_include_dir="config/os/newlib"
- cat >> confdefs.h <<\EOF
-#define _GLIBCPP_BUGGY_FLOAT_COMPLEX 1
-EOF
-
- cat >> confdefs.h <<\EOF
-#define _GLIBCPP_BUGGY_COMPLEX 1
-EOF
-
# need to check for faster f versions of math functions, ie sinf?
;;
esac
@@ -4431,10 +4840,8 @@ else
# We are being configured natively. We can do more elaborate tests
# that include AC_TRY_COMPILE now, as the linker is assumed to be
# working.
- xcompiling=0
- NATIVE=yes
+ GLIBCPP_IS_CROSS_COMPILING=0
CANADIAN=no
- NULL_TARGET=no
# Check for available headers.
for ac_hdr in nan.h ieeefp.h endian.h sys/isa_defs.h machine/endian.h \
@@ -4442,17 +4849,17 @@ else
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4446: checking for $ac_hdr" >&5
+echo "configure:4853: 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 4451 "configure"
+#line 4858 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4456: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4863: \"$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*
@@ -4481,7 +4888,7 @@ done
# All these tests are for C++; save the language and the compiler flags.
- # The CXXFLAGS thing is suspicious, but based on similar bits
+ # The CXXFLAGS thing is suspicious, but based on similar bits previously
# found in GLIBCPP_CONFIGURE.
ac_ext=C
@@ -4501,46 +4908,12 @@ cross_compiling=$ac_cv_prog_cxx_cross
WERROR='-Werror'
fi
- # Check for more sophisticated diagnostic control.
- echo $ac_n "checking for g++ that supports -fdiagnostics-show-location=once""... $ac_c" 1>&6
-echo "configure:4507: checking for g++ that supports -fdiagnostics-show-location=once" >&5
- CXXFLAGS='-Werror -fdiagnostics-show-location=once'
- cat > conftest.$ac_ext <<EOF
-#line 4510 "configure"
-#include "confdefs.h"
-
-int main() {
-int foo;
-
-; return 0; }
-EOF
-if { (eval echo configure:4518: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- ac_gabydiags=yes
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ac_gabydiags=no
-fi
-rm -f conftest*
- if test "$ac_test_CXXFLAGS" = set; then
- CXXFLAGS="$ac_save_CXXFLAGS"
- else
- # this is the suspicious part
- CXXFLAGS=''
- fi
- if test x"$ac_gabydiags" = x"yes"; then
- WFMT_FLAGS='-fdiagnostics-show-location=once'
- fi
- echo "$ac_t""$ac_gabydiags" 1>&6
-
# Check for -ffunction-sections -fdata-sections
echo $ac_n "checking for g++ that supports -ffunction-sections -fdata-sections""... $ac_c" 1>&6
-echo "configure:4541: checking for g++ that supports -ffunction-sections -fdata-sections" >&5
+echo "configure:4914: checking for g++ that supports -ffunction-sections -fdata-sections" >&5
CXXFLAGS='-Werror -ffunction-sections -fdata-sections'
cat > conftest.$ac_ext <<EOF
-#line 4544 "configure"
+#line 4917 "configure"
#include "confdefs.h"
int main() {
@@ -4548,7 +4921,7 @@ int foo;
; return 0; }
EOF
-if { (eval echo configure:4552: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4925: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_fdsections=yes
else
@@ -4578,14 +4951,13 @@ cross_compiling=$ac_cv_prog_cc_cross
-
# If we're not using GNU ld, then there's no point in even trying these
# tests. Check for that first. We should have already tested for gld
# by now (in libtool), but require it now just to be safe...
- SECTION_LDFLAGS=''
- OPT_LDFLAGS=''
+ test -z "$SECTION_LDFLAGS" && SECTION_LDFLAGS=''
+ test -z "$OPT_LDFLAGS" && OPT_LDFLAGS=''
# Set --gc-sections.
@@ -4606,12 +4978,12 @@ cross_compiling=$ac_cv_prog_cc_cross
# used sections, first .eh_frame and now some of the glibc sections for
# iconv). Bzzzzt. Thanks for playing, maybe next time.
echo $ac_n "checking for ld that supports -Wl,--gc-sections""... $ac_c" 1>&6
-echo "configure:4610: checking for ld that supports -Wl,--gc-sections" >&5
+echo "configure:4982: checking for ld that supports -Wl,--gc-sections" >&5
if test "$cross_compiling" = yes; then
ac_sectionLDflags=yes
else
cat > conftest.$ac_ext <<EOF
-#line 4615 "configure"
+#line 4987 "configure"
#include "confdefs.h"
int main(void)
@@ -4622,14 +4994,14 @@ else
}
EOF
-if { (eval echo configure:4626: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:4998: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_sectionLDflags=yes
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -fr conftest*
- ac_sectionLFflags=no
+ ac_sectionLDflags=no
fi
rm -fr conftest*
fi
@@ -4641,14 +5013,14 @@ fi
CFLAGS=''
fi
if test "$ac_sectionLDflags" = "yes"; then
- SECTION_LDFLAGS='-Wl,--gc-sections'
+ SECTION_LDFLAGS="-Wl,--gc-sections $SECTION_LDFLAGS"
fi
echo "$ac_t""$ac_sectionLDflags" 1>&6
fi
# Set linker optimization flags.
if test x"$ac_cv_prog_gnu_ld" = x"yes" && test x"$enable_debug" = x"no"; then
- OPT_LDFLAGS='-Wl,-O1'
+ OPT_LDFLAGS="-Wl,-O1 $OPT_LDFLAGS"
fi
@@ -4657,7 +5029,7 @@ fi
echo $ac_n "checking for __builtin_abs declaration""... $ac_c" 1>&6
-echo "configure:4661: checking for __builtin_abs declaration" >&5
+echo "configure:5033: checking for __builtin_abs declaration" >&5
if test x${glibcpp_cv_func___builtin_abs_use+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func___builtin_abs_use'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -4672,14 +5044,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 4676 "configure"
+#line 5048 "configure"
#include "confdefs.h"
#include <math.h>
int main() {
__builtin_abs(0);
; return 0; }
EOF
-if { (eval echo configure:4683: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5055: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_cv_func___builtin_abs_use=yes
else
@@ -4703,21 +5075,21 @@ fi
echo "$ac_t""$glibcpp_cv_func___builtin_abs_use" 1>&6
if test x$glibcpp_cv_func___builtin_abs_use = x"yes"; then
echo $ac_n "checking for __builtin_abs linkage""... $ac_c" 1>&6
-echo "configure:4707: checking for __builtin_abs linkage" >&5
+echo "configure:5079: checking for __builtin_abs linkage" >&5
if test x${glibcpp_cv_func___builtin_abs_link+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func___builtin_abs_link'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4714 "configure"
+#line 5086 "configure"
#include "confdefs.h"
#include <math.h>
int main() {
__builtin_abs(0);
; return 0; }
EOF
-if { (eval echo configure:4721: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5093: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
glibcpp_cv_func___builtin_abs_link=yes
else
@@ -4743,7 +5115,7 @@ EOF
echo $ac_n "checking for __builtin_fabsf declaration""... $ac_c" 1>&6
-echo "configure:4747: checking for __builtin_fabsf declaration" >&5
+echo "configure:5119: checking for __builtin_fabsf declaration" >&5
if test x${glibcpp_cv_func___builtin_fabsf_use+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func___builtin_fabsf_use'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -4758,14 +5130,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 4762 "configure"
+#line 5134 "configure"
#include "confdefs.h"
#include <math.h>
int main() {
__builtin_fabsf(0);
; return 0; }
EOF
-if { (eval echo configure:4769: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5141: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_cv_func___builtin_fabsf_use=yes
else
@@ -4789,21 +5161,21 @@ fi
echo "$ac_t""$glibcpp_cv_func___builtin_fabsf_use" 1>&6
if test x$glibcpp_cv_func___builtin_fabsf_use = x"yes"; then
echo $ac_n "checking for __builtin_fabsf linkage""... $ac_c" 1>&6
-echo "configure:4793: checking for __builtin_fabsf linkage" >&5
+echo "configure:5165: checking for __builtin_fabsf linkage" >&5
if test x${glibcpp_cv_func___builtin_fabsf_link+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func___builtin_fabsf_link'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4800 "configure"
+#line 5172 "configure"
#include "confdefs.h"
#include <math.h>
int main() {
__builtin_fabsf(0);
; return 0; }
EOF
-if { (eval echo configure:4807: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5179: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
glibcpp_cv_func___builtin_fabsf_link=yes
else
@@ -4829,7 +5201,7 @@ EOF
echo $ac_n "checking for __builtin_fabs declaration""... $ac_c" 1>&6
-echo "configure:4833: checking for __builtin_fabs declaration" >&5
+echo "configure:5205: checking for __builtin_fabs declaration" >&5
if test x${glibcpp_cv_func___builtin_fabs_use+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func___builtin_fabs_use'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -4844,14 +5216,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 4848 "configure"
+#line 5220 "configure"
#include "confdefs.h"
#include <math.h>
int main() {
__builtin_fabs(0);
; return 0; }
EOF
-if { (eval echo configure:4855: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5227: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_cv_func___builtin_fabs_use=yes
else
@@ -4875,21 +5247,21 @@ fi
echo "$ac_t""$glibcpp_cv_func___builtin_fabs_use" 1>&6
if test x$glibcpp_cv_func___builtin_fabs_use = x"yes"; then
echo $ac_n "checking for __builtin_fabs linkage""... $ac_c" 1>&6
-echo "configure:4879: checking for __builtin_fabs linkage" >&5
+echo "configure:5251: checking for __builtin_fabs linkage" >&5
if test x${glibcpp_cv_func___builtin_fabs_link+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func___builtin_fabs_link'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4886 "configure"
+#line 5258 "configure"
#include "confdefs.h"
#include <math.h>
int main() {
__builtin_fabs(0);
; return 0; }
EOF
-if { (eval echo configure:4893: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5265: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
glibcpp_cv_func___builtin_fabs_link=yes
else
@@ -4915,7 +5287,7 @@ EOF
echo $ac_n "checking for __builtin_fabsl declaration""... $ac_c" 1>&6
-echo "configure:4919: checking for __builtin_fabsl declaration" >&5
+echo "configure:5291: checking for __builtin_fabsl declaration" >&5
if test x${glibcpp_cv_func___builtin_fabsl_use+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func___builtin_fabsl_use'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -4930,14 +5302,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 4934 "configure"
+#line 5306 "configure"
#include "confdefs.h"
#include <math.h>
int main() {
__builtin_fabsl(0);
; return 0; }
EOF
-if { (eval echo configure:4941: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5313: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_cv_func___builtin_fabsl_use=yes
else
@@ -4961,21 +5333,21 @@ fi
echo "$ac_t""$glibcpp_cv_func___builtin_fabsl_use" 1>&6
if test x$glibcpp_cv_func___builtin_fabsl_use = x"yes"; then
echo $ac_n "checking for __builtin_fabsl linkage""... $ac_c" 1>&6
-echo "configure:4965: checking for __builtin_fabsl linkage" >&5
+echo "configure:5337: checking for __builtin_fabsl linkage" >&5
if test x${glibcpp_cv_func___builtin_fabsl_link+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func___builtin_fabsl_link'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4972 "configure"
+#line 5344 "configure"
#include "confdefs.h"
#include <math.h>
int main() {
__builtin_fabsl(0);
; return 0; }
EOF
-if { (eval echo configure:4979: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5351: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
glibcpp_cv_func___builtin_fabsl_link=yes
else
@@ -5001,7 +5373,7 @@ EOF
echo $ac_n "checking for __builtin_labs declaration""... $ac_c" 1>&6
-echo "configure:5005: checking for __builtin_labs declaration" >&5
+echo "configure:5377: checking for __builtin_labs declaration" >&5
if test x${glibcpp_cv_func___builtin_labs_use+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func___builtin_labs_use'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -5016,14 +5388,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 5020 "configure"
+#line 5392 "configure"
#include "confdefs.h"
#include <math.h>
int main() {
__builtin_labs(0);
; return 0; }
EOF
-if { (eval echo configure:5027: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5399: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_cv_func___builtin_labs_use=yes
else
@@ -5047,21 +5419,21 @@ fi
echo "$ac_t""$glibcpp_cv_func___builtin_labs_use" 1>&6
if test x$glibcpp_cv_func___builtin_labs_use = x"yes"; then
echo $ac_n "checking for __builtin_labs linkage""... $ac_c" 1>&6
-echo "configure:5051: checking for __builtin_labs linkage" >&5
+echo "configure:5423: checking for __builtin_labs linkage" >&5
if test x${glibcpp_cv_func___builtin_labs_link+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func___builtin_labs_link'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5058 "configure"
+#line 5430 "configure"
#include "confdefs.h"
#include <math.h>
int main() {
__builtin_labs(0);
; return 0; }
EOF
-if { (eval echo configure:5065: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5437: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
glibcpp_cv_func___builtin_labs_link=yes
else
@@ -5088,7 +5460,7 @@ EOF
echo $ac_n "checking for __builtin_sqrtf declaration""... $ac_c" 1>&6
-echo "configure:5092: checking for __builtin_sqrtf declaration" >&5
+echo "configure:5464: checking for __builtin_sqrtf declaration" >&5
if test x${glibcpp_cv_func___builtin_sqrtf_use+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func___builtin_sqrtf_use'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -5103,14 +5475,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 5107 "configure"
+#line 5479 "configure"
#include "confdefs.h"
#include <math.h>
int main() {
__builtin_sqrtf(0);
; return 0; }
EOF
-if { (eval echo configure:5114: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5486: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_cv_func___builtin_sqrtf_use=yes
else
@@ -5134,21 +5506,21 @@ fi
echo "$ac_t""$glibcpp_cv_func___builtin_sqrtf_use" 1>&6
if test x$glibcpp_cv_func___builtin_sqrtf_use = x"yes"; then
echo $ac_n "checking for __builtin_sqrtf linkage""... $ac_c" 1>&6
-echo "configure:5138: checking for __builtin_sqrtf linkage" >&5
+echo "configure:5510: checking for __builtin_sqrtf linkage" >&5
if test x${glibcpp_cv_func___builtin_sqrtf_link+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func___builtin_sqrtf_link'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5145 "configure"
+#line 5517 "configure"
#include "confdefs.h"
#include <math.h>
int main() {
__builtin_sqrtf(0);
; return 0; }
EOF
-if { (eval echo configure:5152: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5524: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
glibcpp_cv_func___builtin_sqrtf_link=yes
else
@@ -5174,7 +5546,7 @@ EOF
echo $ac_n "checking for __builtin_fsqrt declaration""... $ac_c" 1>&6
-echo "configure:5178: checking for __builtin_fsqrt declaration" >&5
+echo "configure:5550: checking for __builtin_fsqrt declaration" >&5
if test x${glibcpp_cv_func___builtin_fsqrt_use+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func___builtin_fsqrt_use'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -5189,14 +5561,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 5193 "configure"
+#line 5565 "configure"
#include "confdefs.h"
#include <math.h>
int main() {
__builtin_fsqrt(0);
; return 0; }
EOF
-if { (eval echo configure:5200: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5572: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_cv_func___builtin_fsqrt_use=yes
else
@@ -5220,21 +5592,21 @@ fi
echo "$ac_t""$glibcpp_cv_func___builtin_fsqrt_use" 1>&6
if test x$glibcpp_cv_func___builtin_fsqrt_use = x"yes"; then
echo $ac_n "checking for __builtin_fsqrt linkage""... $ac_c" 1>&6
-echo "configure:5224: checking for __builtin_fsqrt linkage" >&5
+echo "configure:5596: checking for __builtin_fsqrt linkage" >&5
if test x${glibcpp_cv_func___builtin_fsqrt_link+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func___builtin_fsqrt_link'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5231 "configure"
+#line 5603 "configure"
#include "confdefs.h"
#include <math.h>
int main() {
__builtin_fsqrt(0);
; return 0; }
EOF
-if { (eval echo configure:5238: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5610: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
glibcpp_cv_func___builtin_fsqrt_link=yes
else
@@ -5260,7 +5632,7 @@ EOF
echo $ac_n "checking for __builtin_sqrtl declaration""... $ac_c" 1>&6
-echo "configure:5264: checking for __builtin_sqrtl declaration" >&5
+echo "configure:5636: checking for __builtin_sqrtl declaration" >&5
if test x${glibcpp_cv_func___builtin_sqrtl_use+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func___builtin_sqrtl_use'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -5275,14 +5647,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 5279 "configure"
+#line 5651 "configure"
#include "confdefs.h"
#include <math.h>
int main() {
__builtin_sqrtl(0);
; return 0; }
EOF
-if { (eval echo configure:5286: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5658: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_cv_func___builtin_sqrtl_use=yes
else
@@ -5306,21 +5678,21 @@ fi
echo "$ac_t""$glibcpp_cv_func___builtin_sqrtl_use" 1>&6
if test x$glibcpp_cv_func___builtin_sqrtl_use = x"yes"; then
echo $ac_n "checking for __builtin_sqrtl linkage""... $ac_c" 1>&6
-echo "configure:5310: checking for __builtin_sqrtl linkage" >&5
+echo "configure:5682: checking for __builtin_sqrtl linkage" >&5
if test x${glibcpp_cv_func___builtin_sqrtl_link+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func___builtin_sqrtl_link'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5317 "configure"
+#line 5689 "configure"
#include "confdefs.h"
#include <math.h>
int main() {
__builtin_sqrtl(0);
; return 0; }
EOF
-if { (eval echo configure:5324: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5696: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
glibcpp_cv_func___builtin_sqrtl_link=yes
else
@@ -5347,7 +5719,7 @@ EOF
echo $ac_n "checking for __builtin_sinf declaration""... $ac_c" 1>&6
-echo "configure:5351: checking for __builtin_sinf declaration" >&5
+echo "configure:5723: checking for __builtin_sinf declaration" >&5
if test x${glibcpp_cv_func___builtin_sinf_use+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func___builtin_sinf_use'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -5362,14 +5734,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 5366 "configure"
+#line 5738 "configure"
#include "confdefs.h"
#include <math.h>
int main() {
__builtin_sinf(0);
; return 0; }
EOF
-if { (eval echo configure:5373: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5745: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_cv_func___builtin_sinf_use=yes
else
@@ -5393,21 +5765,21 @@ fi
echo "$ac_t""$glibcpp_cv_func___builtin_sinf_use" 1>&6
if test x$glibcpp_cv_func___builtin_sinf_use = x"yes"; then
echo $ac_n "checking for __builtin_sinf linkage""... $ac_c" 1>&6
-echo "configure:5397: checking for __builtin_sinf linkage" >&5
+echo "configure:5769: checking for __builtin_sinf linkage" >&5
if test x${glibcpp_cv_func___builtin_sinf_link+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func___builtin_sinf_link'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5404 "configure"
+#line 5776 "configure"
#include "confdefs.h"
#include <math.h>
int main() {
__builtin_sinf(0);
; return 0; }
EOF
-if { (eval echo configure:5411: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5783: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
glibcpp_cv_func___builtin_sinf_link=yes
else
@@ -5433,7 +5805,7 @@ EOF
echo $ac_n "checking for __builtin_sin declaration""... $ac_c" 1>&6
-echo "configure:5437: checking for __builtin_sin declaration" >&5
+echo "configure:5809: checking for __builtin_sin declaration" >&5
if test x${glibcpp_cv_func___builtin_sin_use+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func___builtin_sin_use'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -5448,14 +5820,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 5452 "configure"
+#line 5824 "configure"
#include "confdefs.h"
#include <math.h>
int main() {
__builtin_sin(0);
; return 0; }
EOF
-if { (eval echo configure:5459: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5831: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_cv_func___builtin_sin_use=yes
else
@@ -5479,21 +5851,21 @@ fi
echo "$ac_t""$glibcpp_cv_func___builtin_sin_use" 1>&6
if test x$glibcpp_cv_func___builtin_sin_use = x"yes"; then
echo $ac_n "checking for __builtin_sin linkage""... $ac_c" 1>&6
-echo "configure:5483: checking for __builtin_sin linkage" >&5
+echo "configure:5855: checking for __builtin_sin linkage" >&5
if test x${glibcpp_cv_func___builtin_sin_link+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func___builtin_sin_link'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5490 "configure"
+#line 5862 "configure"
#include "confdefs.h"
#include <math.h>
int main() {
__builtin_sin(0);
; return 0; }
EOF
-if { (eval echo configure:5497: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5869: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
glibcpp_cv_func___builtin_sin_link=yes
else
@@ -5519,7 +5891,7 @@ EOF
echo $ac_n "checking for __builtin_sinl declaration""... $ac_c" 1>&6
-echo "configure:5523: checking for __builtin_sinl declaration" >&5
+echo "configure:5895: checking for __builtin_sinl declaration" >&5
if test x${glibcpp_cv_func___builtin_sinl_use+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func___builtin_sinl_use'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -5534,14 +5906,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 5538 "configure"
+#line 5910 "configure"
#include "confdefs.h"
#include <math.h>
int main() {
__builtin_sinl(0);
; return 0; }
EOF
-if { (eval echo configure:5545: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5917: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_cv_func___builtin_sinl_use=yes
else
@@ -5565,21 +5937,21 @@ fi
echo "$ac_t""$glibcpp_cv_func___builtin_sinl_use" 1>&6
if test x$glibcpp_cv_func___builtin_sinl_use = x"yes"; then
echo $ac_n "checking for __builtin_sinl linkage""... $ac_c" 1>&6
-echo "configure:5569: checking for __builtin_sinl linkage" >&5
+echo "configure:5941: checking for __builtin_sinl linkage" >&5
if test x${glibcpp_cv_func___builtin_sinl_link+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func___builtin_sinl_link'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5576 "configure"
+#line 5948 "configure"
#include "confdefs.h"
#include <math.h>
int main() {
__builtin_sinl(0);
; return 0; }
EOF
-if { (eval echo configure:5583: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5955: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
glibcpp_cv_func___builtin_sinl_link=yes
else
@@ -5606,7 +5978,7 @@ EOF
echo $ac_n "checking for __builtin_cosf declaration""... $ac_c" 1>&6
-echo "configure:5610: checking for __builtin_cosf declaration" >&5
+echo "configure:5982: checking for __builtin_cosf declaration" >&5
if test x${glibcpp_cv_func___builtin_cosf_use+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func___builtin_cosf_use'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -5621,14 +5993,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 5625 "configure"
+#line 5997 "configure"
#include "confdefs.h"
#include <math.h>
int main() {
__builtin_cosf(0);
; return 0; }
EOF
-if { (eval echo configure:5632: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6004: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_cv_func___builtin_cosf_use=yes
else
@@ -5652,21 +6024,21 @@ fi
echo "$ac_t""$glibcpp_cv_func___builtin_cosf_use" 1>&6
if test x$glibcpp_cv_func___builtin_cosf_use = x"yes"; then
echo $ac_n "checking for __builtin_cosf linkage""... $ac_c" 1>&6
-echo "configure:5656: checking for __builtin_cosf linkage" >&5
+echo "configure:6028: checking for __builtin_cosf linkage" >&5
if test x${glibcpp_cv_func___builtin_cosf_link+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func___builtin_cosf_link'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5663 "configure"
+#line 6035 "configure"
#include "confdefs.h"
#include <math.h>
int main() {
__builtin_cosf(0);
; return 0; }
EOF
-if { (eval echo configure:5670: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6042: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
glibcpp_cv_func___builtin_cosf_link=yes
else
@@ -5692,7 +6064,7 @@ EOF
echo $ac_n "checking for __builtin_cos declaration""... $ac_c" 1>&6
-echo "configure:5696: checking for __builtin_cos declaration" >&5
+echo "configure:6068: checking for __builtin_cos declaration" >&5
if test x${glibcpp_cv_func___builtin_cos_use+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func___builtin_cos_use'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -5707,14 +6079,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 5711 "configure"
+#line 6083 "configure"
#include "confdefs.h"
#include <math.h>
int main() {
__builtin_cos(0);
; return 0; }
EOF
-if { (eval echo configure:5718: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6090: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_cv_func___builtin_cos_use=yes
else
@@ -5738,21 +6110,21 @@ fi
echo "$ac_t""$glibcpp_cv_func___builtin_cos_use" 1>&6
if test x$glibcpp_cv_func___builtin_cos_use = x"yes"; then
echo $ac_n "checking for __builtin_cos linkage""... $ac_c" 1>&6
-echo "configure:5742: checking for __builtin_cos linkage" >&5
+echo "configure:6114: checking for __builtin_cos linkage" >&5
if test x${glibcpp_cv_func___builtin_cos_link+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func___builtin_cos_link'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5749 "configure"
+#line 6121 "configure"
#include "confdefs.h"
#include <math.h>
int main() {
__builtin_cos(0);
; return 0; }
EOF
-if { (eval echo configure:5756: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6128: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
glibcpp_cv_func___builtin_cos_link=yes
else
@@ -5778,7 +6150,7 @@ EOF
echo $ac_n "checking for __builtin_cosl declaration""... $ac_c" 1>&6
-echo "configure:5782: checking for __builtin_cosl declaration" >&5
+echo "configure:6154: checking for __builtin_cosl declaration" >&5
if test x${glibcpp_cv_func___builtin_cosl_use+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func___builtin_cosl_use'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -5793,14 +6165,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 5797 "configure"
+#line 6169 "configure"
#include "confdefs.h"
#include <math.h>
int main() {
__builtin_cosl(0);
; return 0; }
EOF
-if { (eval echo configure:5804: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6176: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_cv_func___builtin_cosl_use=yes
else
@@ -5824,21 +6196,21 @@ fi
echo "$ac_t""$glibcpp_cv_func___builtin_cosl_use" 1>&6
if test x$glibcpp_cv_func___builtin_cosl_use = x"yes"; then
echo $ac_n "checking for __builtin_cosl linkage""... $ac_c" 1>&6
-echo "configure:5828: checking for __builtin_cosl linkage" >&5
+echo "configure:6200: checking for __builtin_cosl linkage" >&5
if test x${glibcpp_cv_func___builtin_cosl_link+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func___builtin_cosl_link'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5835 "configure"
+#line 6207 "configure"
#include "confdefs.h"
#include <math.h>
int main() {
__builtin_cosl(0);
; return 0; }
EOF
-if { (eval echo configure:5842: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6214: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
glibcpp_cv_func___builtin_cosl_link=yes
else
@@ -5929,7 +6301,7 @@ EOF
CXXFLAGS='-fno-builtins -D_GNU_SOURCE'
echo $ac_n "checking for sin in -lm""... $ac_c" 1>&6
-echo "configure:5933: checking for sin in -lm" >&5
+echo "configure:6305: checking for sin in -lm" >&5
ac_lib_var=`echo m'_'sin | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -5937,7 +6309,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lm $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 5941 "configure"
+#line 6313 "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
@@ -5948,7 +6320,7 @@ int main() {
sin()
; return 0; }
EOF
-if { (eval echo configure:5952: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6324: \"$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
@@ -5974,7 +6346,7 @@ fi
echo $ac_n "checking for isinf declaration""... $ac_c" 1>&6
-echo "configure:5978: checking for isinf declaration" >&5
+echo "configure:6350: checking for isinf declaration" >&5
if test x${glibcpp_cv_func_isinf_use+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func_isinf_use'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -5989,14 +6361,18 @@ 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 5993 "configure"
+#line 6365 "configure"
#include "confdefs.h"
#include <math.h>
+ #ifdef HAVE_IEEEFP_H
+ #include <ieeefp.h>
+ #endif
+
int main() {
isinf(0);
; return 0; }
EOF
-if { (eval echo configure:6000: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6376: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_cv_func_isinf_use=yes
else
@@ -6023,12 +6399,12 @@ fi
for ac_func in isinf
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6027: checking for $ac_func" >&5
+echo "configure:6403: 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 6032 "configure"
+#line 6408 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -6051,7 +6427,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:6055: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6431: \"$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
@@ -6078,7 +6454,7 @@ done
else
echo $ac_n "checking for _isinf declaration""... $ac_c" 1>&6
-echo "configure:6082: checking for _isinf declaration" >&5
+echo "configure:6458: checking for _isinf declaration" >&5
if test x${glibcpp_cv_func__isinf_use+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func__isinf_use'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -6093,14 +6469,18 @@ 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 6097 "configure"
+#line 6473 "configure"
#include "confdefs.h"
#include <math.h>
+ #ifdef HAVE_IEEEFP_H
+ #include <ieeefp.h>
+ #endif
+
int main() {
_isinf(0);
; return 0; }
EOF
-if { (eval echo configure:6104: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6484: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_cv_func__isinf_use=yes
else
@@ -6127,12 +6507,12 @@ fi
for ac_func in _isinf
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6131: checking for $ac_func" >&5
+echo "configure:6511: 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 6136 "configure"
+#line 6516 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -6155,7 +6535,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:6159: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6539: \"$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
@@ -6185,7 +6565,7 @@ done
echo $ac_n "checking for isnan declaration""... $ac_c" 1>&6
-echo "configure:6189: checking for isnan declaration" >&5
+echo "configure:6569: checking for isnan declaration" >&5
if test x${glibcpp_cv_func_isnan_use+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func_isnan_use'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -6200,14 +6580,18 @@ 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 6204 "configure"
+#line 6584 "configure"
#include "confdefs.h"
#include <math.h>
+ #ifdef HAVE_IEEEFP_H
+ #include <ieeefp.h>
+ #endif
+
int main() {
isnan(0);
; return 0; }
EOF
-if { (eval echo configure:6211: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6595: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_cv_func_isnan_use=yes
else
@@ -6234,12 +6618,12 @@ fi
for ac_func in isnan
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6238: checking for $ac_func" >&5
+echo "configure:6622: 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 6243 "configure"
+#line 6627 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -6262,7 +6646,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:6266: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6650: \"$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
@@ -6289,7 +6673,7 @@ done
else
echo $ac_n "checking for _isnan declaration""... $ac_c" 1>&6
-echo "configure:6293: checking for _isnan declaration" >&5
+echo "configure:6677: checking for _isnan declaration" >&5
if test x${glibcpp_cv_func__isnan_use+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func__isnan_use'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -6304,14 +6688,18 @@ 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 6308 "configure"
+#line 6692 "configure"
#include "confdefs.h"
#include <math.h>
+ #ifdef HAVE_IEEEFP_H
+ #include <ieeefp.h>
+ #endif
+
int main() {
_isnan(0);
; return 0; }
EOF
-if { (eval echo configure:6315: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6703: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_cv_func__isnan_use=yes
else
@@ -6338,12 +6726,12 @@ fi
for ac_func in _isnan
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6342: checking for $ac_func" >&5
+echo "configure:6730: 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 6347 "configure"
+#line 6735 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -6366,7 +6754,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:6370: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6758: \"$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
@@ -6396,7 +6784,7 @@ done
echo $ac_n "checking for finite declaration""... $ac_c" 1>&6
-echo "configure:6400: checking for finite declaration" >&5
+echo "configure:6788: checking for finite declaration" >&5
if test x${glibcpp_cv_func_finite_use+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func_finite_use'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -6411,14 +6799,18 @@ 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 6415 "configure"
+#line 6803 "configure"
#include "confdefs.h"
#include <math.h>
+ #ifdef HAVE_IEEEFP_H
+ #include <ieeefp.h>
+ #endif
+
int main() {
finite(0);
; return 0; }
EOF
-if { (eval echo configure:6422: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6814: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_cv_func_finite_use=yes
else
@@ -6445,12 +6837,12 @@ fi
for ac_func in finite
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6449: checking for $ac_func" >&5
+echo "configure:6841: 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 6454 "configure"
+#line 6846 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -6473,7 +6865,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:6477: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6869: \"$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
@@ -6500,7 +6892,7 @@ done
else
echo $ac_n "checking for _finite declaration""... $ac_c" 1>&6
-echo "configure:6504: checking for _finite declaration" >&5
+echo "configure:6896: checking for _finite declaration" >&5
if test x${glibcpp_cv_func__finite_use+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func__finite_use'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -6515,14 +6907,18 @@ 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 6519 "configure"
+#line 6911 "configure"
#include "confdefs.h"
#include <math.h>
+ #ifdef HAVE_IEEEFP_H
+ #include <ieeefp.h>
+ #endif
+
int main() {
_finite(0);
; return 0; }
EOF
-if { (eval echo configure:6526: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6922: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_cv_func__finite_use=yes
else
@@ -6549,12 +6945,12 @@ fi
for ac_func in _finite
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6553: checking for $ac_func" >&5
+echo "configure:6949: 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 6558 "configure"
+#line 6954 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -6577,7 +6973,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:6581: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6977: \"$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
@@ -6607,7 +7003,7 @@ done
echo $ac_n "checking for copysign declaration""... $ac_c" 1>&6
-echo "configure:6611: checking for copysign declaration" >&5
+echo "configure:7007: checking for copysign declaration" >&5
if test x${glibcpp_cv_func_copysign_use+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func_copysign_use'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -6622,14 +7018,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 6626 "configure"
+#line 7022 "configure"
#include "confdefs.h"
#include <math.h>
int main() {
copysign(0, 0);
; return 0; }
EOF
-if { (eval echo configure:6633: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7029: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_cv_func_copysign_use=yes
else
@@ -6656,12 +7052,12 @@ fi
for ac_func in copysign
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6660: checking for $ac_func" >&5
+echo "configure:7056: 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 6665 "configure"
+#line 7061 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -6684,7 +7080,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:6688: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7084: \"$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
@@ -6711,7 +7107,7 @@ done
else
echo $ac_n "checking for _copysign declaration""... $ac_c" 1>&6
-echo "configure:6715: checking for _copysign declaration" >&5
+echo "configure:7111: checking for _copysign declaration" >&5
if test x${glibcpp_cv_func__copysign_use+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func__copysign_use'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -6726,14 +7122,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 6730 "configure"
+#line 7126 "configure"
#include "confdefs.h"
#include <math.h>
int main() {
_copysign(0, 0);
; return 0; }
EOF
-if { (eval echo configure:6737: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7133: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_cv_func__copysign_use=yes
else
@@ -6760,12 +7156,12 @@ fi
for ac_func in _copysign
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6764: checking for $ac_func" >&5
+echo "configure:7160: 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 6769 "configure"
+#line 7165 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -6788,7 +7184,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:6792: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7188: \"$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
@@ -6818,7 +7214,7 @@ done
echo $ac_n "checking for sincos declaration""... $ac_c" 1>&6
-echo "configure:6822: checking for sincos declaration" >&5
+echo "configure:7218: checking for sincos declaration" >&5
if test x${glibcpp_cv_func_sincos_use+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func_sincos_use'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -6833,14 +7229,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 6837 "configure"
+#line 7233 "configure"
#include "confdefs.h"
#include <math.h>
int main() {
sincos(0, 0, 0);
; return 0; }
EOF
-if { (eval echo configure:6844: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7240: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_cv_func_sincos_use=yes
else
@@ -6867,12 +7263,12 @@ fi
for ac_func in sincos
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6871: checking for $ac_func" >&5
+echo "configure:7267: 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 6876 "configure"
+#line 7272 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -6895,7 +7291,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:6899: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7295: \"$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
@@ -6922,7 +7318,7 @@ done
else
echo $ac_n "checking for _sincos declaration""... $ac_c" 1>&6
-echo "configure:6926: checking for _sincos declaration" >&5
+echo "configure:7322: checking for _sincos declaration" >&5
if test x${glibcpp_cv_func__sincos_use+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func__sincos_use'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -6937,14 +7333,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 6941 "configure"
+#line 7337 "configure"
#include "confdefs.h"
#include <math.h>
int main() {
_sincos(0, 0, 0);
; return 0; }
EOF
-if { (eval echo configure:6948: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7344: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_cv_func__sincos_use=yes
else
@@ -6971,12 +7367,12 @@ fi
for ac_func in _sincos
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6975: checking for $ac_func" >&5
+echo "configure:7371: 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 6980 "configure"
+#line 7376 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -6999,7 +7395,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:7003: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7399: \"$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
@@ -7029,7 +7425,7 @@ done
echo $ac_n "checking for fpclass declaration""... $ac_c" 1>&6
-echo "configure:7033: checking for fpclass declaration" >&5
+echo "configure:7429: checking for fpclass declaration" >&5
if test x${glibcpp_cv_func_fpclass_use+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func_fpclass_use'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -7044,14 +7440,18 @@ 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 7048 "configure"
+#line 7444 "configure"
#include "confdefs.h"
#include <math.h>
+ #ifdef HAVE_IEEEFP_H
+ #include <ieeefp.h>
+ #endif
+
int main() {
fpclass(0);
; return 0; }
EOF
-if { (eval echo configure:7055: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7455: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_cv_func_fpclass_use=yes
else
@@ -7078,12 +7478,12 @@ fi
for ac_func in fpclass
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:7082: checking for $ac_func" >&5
+echo "configure:7482: 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 7087 "configure"
+#line 7487 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -7106,7 +7506,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:7110: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7510: \"$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
@@ -7133,7 +7533,7 @@ done
else
echo $ac_n "checking for _fpclass declaration""... $ac_c" 1>&6
-echo "configure:7137: checking for _fpclass declaration" >&5
+echo "configure:7537: checking for _fpclass declaration" >&5
if test x${glibcpp_cv_func__fpclass_use+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func__fpclass_use'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -7148,14 +7548,18 @@ 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 7152 "configure"
+#line 7552 "configure"
#include "confdefs.h"
#include <math.h>
+ #ifdef HAVE_IEEEFP_H
+ #include <ieeefp.h>
+ #endif
+
int main() {
_fpclass(0);
; return 0; }
EOF
-if { (eval echo configure:7159: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7563: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_cv_func__fpclass_use=yes
else
@@ -7182,12 +7586,12 @@ fi
for ac_func in _fpclass
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:7186: checking for $ac_func" >&5
+echo "configure:7590: 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 7191 "configure"
+#line 7595 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -7210,7 +7614,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:7214: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7618: \"$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
@@ -7240,7 +7644,7 @@ done
echo $ac_n "checking for qfpclass declaration""... $ac_c" 1>&6
-echo "configure:7244: checking for qfpclass declaration" >&5
+echo "configure:7648: checking for qfpclass declaration" >&5
if test x${glibcpp_cv_func_qfpclass_use+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func_qfpclass_use'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -7255,14 +7659,18 @@ 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 7259 "configure"
+#line 7663 "configure"
#include "confdefs.h"
#include <math.h>
+ #ifdef HAVE_IEEEFP_H
+ #include <ieeefp.h>
+ #endif
+
int main() {
qfpclass(0);
; return 0; }
EOF
-if { (eval echo configure:7266: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7674: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_cv_func_qfpclass_use=yes
else
@@ -7289,12 +7697,12 @@ fi
for ac_func in qfpclass
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:7293: checking for $ac_func" >&5
+echo "configure:7701: 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 7298 "configure"
+#line 7706 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -7317,7 +7725,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:7321: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7729: \"$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
@@ -7344,7 +7752,7 @@ done
else
echo $ac_n "checking for _qfpclass declaration""... $ac_c" 1>&6
-echo "configure:7348: checking for _qfpclass declaration" >&5
+echo "configure:7756: checking for _qfpclass declaration" >&5
if test x${glibcpp_cv_func__qfpclass_use+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func__qfpclass_use'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -7359,14 +7767,18 @@ 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 7363 "configure"
+#line 7771 "configure"
#include "confdefs.h"
#include <math.h>
+ #ifdef HAVE_IEEEFP_H
+ #include <ieeefp.h>
+ #endif
+
int main() {
_qfpclass(0);
; return 0; }
EOF
-if { (eval echo configure:7370: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7782: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_cv_func__qfpclass_use=yes
else
@@ -7393,12 +7805,223 @@ fi
for ac_func in _qfpclass
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:7397: checking for $ac_func" >&5
+echo "configure:7809: 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 7814 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:7837: \"$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
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+ fi
+ fi
+
+
+
+ echo $ac_n "checking for hypot declaration""... $ac_c" 1>&6
+echo "configure:7867: checking for hypot declaration" >&5
+ if test x${glibcpp_cv_func_hypot_use+set} != xset; then
+ if eval "test \"`echo '$''{'glibcpp_cv_func_hypot_use'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+
+
+ ac_ext=C
+# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cxx_cross
+
+ cat > conftest.$ac_ext <<EOF
+#line 7882 "configure"
+#include "confdefs.h"
+#include <math.h>
+int main() {
+ hypot(0, 0);
+; return 0; }
+EOF
+if { (eval echo configure:7889: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ glibcpp_cv_func_hypot_use=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ glibcpp_cv_func_hypot_use=no
+fi
+rm -f conftest*
+ ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+
+fi
+
+ fi
+ echo "$ac_t""$glibcpp_cv_func_hypot_use" 1>&6
+
+ if test x$glibcpp_cv_func_hypot_use = x"yes"; then
+ for ac_func in hypot
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:7916: 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 7921 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:7944: \"$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
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+ else
+
+ echo $ac_n "checking for _hypot declaration""... $ac_c" 1>&6
+echo "configure:7971: checking for _hypot declaration" >&5
+ if test x${glibcpp_cv_func__hypot_use+set} != xset; then
+ if eval "test \"`echo '$''{'glibcpp_cv_func__hypot_use'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+
+
+ ac_ext=C
+# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cxx_cross
+
+ cat > conftest.$ac_ext <<EOF
+#line 7986 "configure"
+#include "confdefs.h"
+#include <math.h>
+int main() {
+ _hypot(0, 0);
+; return 0; }
+EOF
+if { (eval echo configure:7993: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ glibcpp_cv_func__hypot_use=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ glibcpp_cv_func__hypot_use=no
+fi
+rm -f conftest*
+ ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+
+fi
+
+ fi
+ echo "$ac_t""$glibcpp_cv_func__hypot_use" 1>&6
+
+ if test x$glibcpp_cv_func__hypot_use = x"yes"; then
+ for ac_func in _hypot
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:8020: 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 7402 "configure"
+#line 8025 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -7421,7 +8044,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:7425: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8048: \"$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
@@ -7451,7 +8074,7 @@ done
echo $ac_n "checking for float trig functions""... $ac_c" 1>&6
-echo "configure:7455: checking for float trig functions" >&5
+echo "configure:8078: checking for float trig functions" >&5
if eval "test \"`echo '$''{'glibcpp_cv_func_float_trig_use'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -7465,7 +8088,7 @@ 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 7469 "configure"
+#line 8092 "configure"
#include "confdefs.h"
#include <math.h>
int main() {
@@ -7474,7 +8097,7 @@ int main() {
coshf sinhf tanhf; do echo "$x (0);"; done`
; return 0; }
EOF
-if { (eval echo configure:7478: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8101: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_cv_func_float_trig_use=yes
else
@@ -7500,12 +8123,12 @@ fi
coshf sinhf tanhf
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:7504: checking for $ac_func" >&5
+echo "configure:8127: 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 7509 "configure"
+#line 8132 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -7528,7 +8151,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:7532: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8155: \"$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
@@ -7556,7 +8179,7 @@ done
echo $ac_n "checking for float round functions""... $ac_c" 1>&6
-echo "configure:7560: checking for float round functions" >&5
+echo "configure:8183: checking for float round functions" >&5
if eval "test \"`echo '$''{'glibcpp_cv_func_float_round_use'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -7570,14 +8193,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 7574 "configure"
+#line 8197 "configure"
#include "confdefs.h"
#include <math.h>
int main() {
`for x in ceilf floorf; do echo "$x (0);"; done`
; return 0; }
EOF
-if { (eval echo configure:7581: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8204: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_cv_func_float_round_use=yes
else
@@ -7601,12 +8224,12 @@ fi
for ac_func in ceilf floorf
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:7605: checking for $ac_func" >&5
+echo "configure:8228: 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 7610 "configure"
+#line 8233 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -7629,7 +8252,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:7633: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8256: \"$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
@@ -7658,7 +8281,7 @@ done
echo $ac_n "checking for isnanf declaration""... $ac_c" 1>&6
-echo "configure:7662: checking for isnanf declaration" >&5
+echo "configure:8285: checking for isnanf declaration" >&5
if test x${glibcpp_cv_func_isnanf_use+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func_isnanf_use'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -7673,14 +8296,18 @@ 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 7677 "configure"
+#line 8300 "configure"
#include "confdefs.h"
#include <math.h>
+ #ifdef HAVE_IEEEFP_H
+ #include <ieeefp.h>
+ #endif
+
int main() {
isnanf(0);
; return 0; }
EOF
-if { (eval echo configure:7684: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8311: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_cv_func_isnanf_use=yes
else
@@ -7707,12 +8334,12 @@ fi
for ac_func in isnanf
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:7711: checking for $ac_func" >&5
+echo "configure:8338: 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 7716 "configure"
+#line 8343 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -7735,7 +8362,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:7739: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8366: \"$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
@@ -7762,7 +8389,7 @@ done
else
echo $ac_n "checking for _isnanf declaration""... $ac_c" 1>&6
-echo "configure:7766: checking for _isnanf declaration" >&5
+echo "configure:8393: checking for _isnanf declaration" >&5
if test x${glibcpp_cv_func__isnanf_use+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func__isnanf_use'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -7777,14 +8404,18 @@ 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 7781 "configure"
+#line 8408 "configure"
#include "confdefs.h"
#include <math.h>
+ #ifdef HAVE_IEEEFP_H
+ #include <ieeefp.h>
+ #endif
+
int main() {
_isnanf(0);
; return 0; }
EOF
-if { (eval echo configure:7788: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8419: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_cv_func__isnanf_use=yes
else
@@ -7811,12 +8442,12 @@ fi
for ac_func in _isnanf
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:7815: checking for $ac_func" >&5
+echo "configure:8446: 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 7820 "configure"
+#line 8451 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -7839,7 +8470,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:7843: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8474: \"$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
@@ -7869,7 +8500,7 @@ done
echo $ac_n "checking for isinff declaration""... $ac_c" 1>&6
-echo "configure:7873: checking for isinff declaration" >&5
+echo "configure:8504: checking for isinff declaration" >&5
if test x${glibcpp_cv_func_isinff_use+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func_isinff_use'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -7884,14 +8515,18 @@ 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 7888 "configure"
+#line 8519 "configure"
#include "confdefs.h"
#include <math.h>
+ #ifdef HAVE_IEEEFP_H
+ #include <ieeefp.h>
+ #endif
+
int main() {
isinff(0);
; return 0; }
EOF
-if { (eval echo configure:7895: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8530: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_cv_func_isinff_use=yes
else
@@ -7918,12 +8553,12 @@ fi
for ac_func in isinff
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:7922: checking for $ac_func" >&5
+echo "configure:8557: 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 7927 "configure"
+#line 8562 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -7946,7 +8581,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:7950: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8585: \"$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
@@ -7973,7 +8608,7 @@ done
else
echo $ac_n "checking for _isinff declaration""... $ac_c" 1>&6
-echo "configure:7977: checking for _isinff declaration" >&5
+echo "configure:8612: checking for _isinff declaration" >&5
if test x${glibcpp_cv_func__isinff_use+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func__isinff_use'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -7988,14 +8623,18 @@ 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 7992 "configure"
+#line 8627 "configure"
#include "confdefs.h"
#include <math.h>
+ #ifdef HAVE_IEEEFP_H
+ #include <ieeefp.h>
+ #endif
+
int main() {
_isinff(0);
; return 0; }
EOF
-if { (eval echo configure:7999: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8638: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_cv_func__isinff_use=yes
else
@@ -8022,12 +8661,119 @@ fi
for ac_func in _isinff
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:8026: checking for $ac_func" >&5
+echo "configure:8665: 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 8670 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:8693: \"$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
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+ fi
+ fi
+
+
+
+ echo $ac_n "checking for atan2f declaration""... $ac_c" 1>&6
+echo "configure:8723: checking for atan2f declaration" >&5
+ if test x${glibcpp_cv_func_atan2f_use+set} != xset; then
+ if eval "test \"`echo '$''{'glibcpp_cv_func_atan2f_use'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+
+
+ ac_ext=C
+# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cxx_cross
+
+ cat > conftest.$ac_ext <<EOF
+#line 8738 "configure"
+#include "confdefs.h"
+#include <math.h>
+int main() {
+ atan2f(0, 0);
+; return 0; }
+EOF
+if { (eval echo configure:8745: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ glibcpp_cv_func_atan2f_use=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ glibcpp_cv_func_atan2f_use=no
+fi
+rm -f conftest*
+ ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+
+fi
+
+ fi
+ echo "$ac_t""$glibcpp_cv_func_atan2f_use" 1>&6
+
+ if test x$glibcpp_cv_func_atan2f_use = x"yes"; then
+ for ac_func in atan2f
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:8772: 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 8031 "configure"
+#line 8777 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -8050,7 +8796,111 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:8054: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8800: \"$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
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+ else
+
+ echo $ac_n "checking for _atan2f declaration""... $ac_c" 1>&6
+echo "configure:8827: checking for _atan2f declaration" >&5
+ if test x${glibcpp_cv_func__atan2f_use+set} != xset; then
+ if eval "test \"`echo '$''{'glibcpp_cv_func__atan2f_use'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+
+
+ ac_ext=C
+# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cxx_cross
+
+ cat > conftest.$ac_ext <<EOF
+#line 8842 "configure"
+#include "confdefs.h"
+#include <math.h>
+int main() {
+ _atan2f(0, 0);
+; return 0; }
+EOF
+if { (eval echo configure:8849: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ glibcpp_cv_func__atan2f_use=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ glibcpp_cv_func__atan2f_use=no
+fi
+rm -f conftest*
+ ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+
+fi
+
+ fi
+ echo "$ac_t""$glibcpp_cv_func__atan2f_use" 1>&6
+
+ if test x$glibcpp_cv_func__atan2f_use = x"yes"; then
+ for ac_func in _atan2f
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:8876: 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 8881 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:8904: \"$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
@@ -8080,7 +8930,7 @@ done
echo $ac_n "checking for fabsf declaration""... $ac_c" 1>&6
-echo "configure:8084: checking for fabsf declaration" >&5
+echo "configure:8934: checking for fabsf declaration" >&5
if test x${glibcpp_cv_func_fabsf_use+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func_fabsf_use'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -8095,14 +8945,18 @@ 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 8099 "configure"
+#line 8949 "configure"
#include "confdefs.h"
#include <math.h>
+ #ifdef HAVE_IEEEFP_H
+ #include <ieeefp.h>
+ #endif
+
int main() {
fabsf(0);
; return 0; }
EOF
-if { (eval echo configure:8106: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8960: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_cv_func_fabsf_use=yes
else
@@ -8129,12 +8983,12 @@ fi
for ac_func in fabsf
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:8133: checking for $ac_func" >&5
+echo "configure:8987: 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 8138 "configure"
+#line 8992 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -8157,7 +9011,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:8161: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9015: \"$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
@@ -8184,7 +9038,7 @@ done
else
echo $ac_n "checking for _fabsf declaration""... $ac_c" 1>&6
-echo "configure:8188: checking for _fabsf declaration" >&5
+echo "configure:9042: checking for _fabsf declaration" >&5
if test x${glibcpp_cv_func__fabsf_use+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func__fabsf_use'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -8199,14 +9053,18 @@ 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 8203 "configure"
+#line 9057 "configure"
#include "confdefs.h"
#include <math.h>
+ #ifdef HAVE_IEEEFP_H
+ #include <ieeefp.h>
+ #endif
+
int main() {
_fabsf(0);
; return 0; }
EOF
-if { (eval echo configure:8210: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:9068: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_cv_func__fabsf_use=yes
else
@@ -8233,12 +9091,12 @@ fi
for ac_func in _fabsf
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:8237: checking for $ac_func" >&5
+echo "configure:9095: 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 8242 "configure"
+#line 9100 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -8261,7 +9119,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:8265: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9123: \"$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
@@ -8291,7 +9149,7 @@ done
echo $ac_n "checking for fmodf declaration""... $ac_c" 1>&6
-echo "configure:8295: checking for fmodf declaration" >&5
+echo "configure:9153: checking for fmodf declaration" >&5
if test x${glibcpp_cv_func_fmodf_use+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func_fmodf_use'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -8306,14 +9164,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 8310 "configure"
+#line 9168 "configure"
#include "confdefs.h"
#include <math.h>
int main() {
fmodf(0, 0);
; return 0; }
EOF
-if { (eval echo configure:8317: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:9175: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_cv_func_fmodf_use=yes
else
@@ -8340,12 +9198,12 @@ fi
for ac_func in fmodf
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:8344: checking for $ac_func" >&5
+echo "configure:9202: 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 8349 "configure"
+#line 9207 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -8368,7 +9226,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:8372: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9230: \"$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
@@ -8395,7 +9253,7 @@ done
else
echo $ac_n "checking for _fmodf declaration""... $ac_c" 1>&6
-echo "configure:8399: checking for _fmodf declaration" >&5
+echo "configure:9257: checking for _fmodf declaration" >&5
if test x${glibcpp_cv_func__fmodf_use+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func__fmodf_use'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -8410,14 +9268,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 8414 "configure"
+#line 9272 "configure"
#include "confdefs.h"
#include <math.h>
int main() {
_fmodf(0, 0);
; return 0; }
EOF
-if { (eval echo configure:8421: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:9279: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_cv_func__fmodf_use=yes
else
@@ -8444,12 +9302,12 @@ fi
for ac_func in _fmodf
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:8448: checking for $ac_func" >&5
+echo "configure:9306: 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 8453 "configure"
+#line 9311 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -8472,7 +9330,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:8476: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9334: \"$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
@@ -8502,7 +9360,7 @@ done
echo $ac_n "checking for frexpf declaration""... $ac_c" 1>&6
-echo "configure:8506: checking for frexpf declaration" >&5
+echo "configure:9364: checking for frexpf declaration" >&5
if test x${glibcpp_cv_func_frexpf_use+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func_frexpf_use'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -8517,14 +9375,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 8521 "configure"
+#line 9379 "configure"
#include "confdefs.h"
#include <math.h>
int main() {
frexpf(0, 0);
; return 0; }
EOF
-if { (eval echo configure:8528: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:9386: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_cv_func_frexpf_use=yes
else
@@ -8551,12 +9409,12 @@ fi
for ac_func in frexpf
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:8555: checking for $ac_func" >&5
+echo "configure:9413: 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 8560 "configure"
+#line 9418 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -8579,7 +9437,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:8583: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9441: \"$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
@@ -8606,7 +9464,7 @@ done
else
echo $ac_n "checking for _frexpf declaration""... $ac_c" 1>&6
-echo "configure:8610: checking for _frexpf declaration" >&5
+echo "configure:9468: checking for _frexpf declaration" >&5
if test x${glibcpp_cv_func__frexpf_use+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func__frexpf_use'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -8621,14 +9479,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 8625 "configure"
+#line 9483 "configure"
#include "confdefs.h"
#include <math.h>
int main() {
_frexpf(0, 0);
; return 0; }
EOF
-if { (eval echo configure:8632: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:9490: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_cv_func__frexpf_use=yes
else
@@ -8655,12 +9513,12 @@ fi
for ac_func in _frexpf
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:8659: checking for $ac_func" >&5
+echo "configure:9517: 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 8664 "configure"
+#line 9522 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -8683,7 +9541,218 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:8687: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9545: \"$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
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+ fi
+ fi
+
+
+
+ echo $ac_n "checking for hypotf declaration""... $ac_c" 1>&6
+echo "configure:9575: checking for hypotf declaration" >&5
+ if test x${glibcpp_cv_func_hypotf_use+set} != xset; then
+ if eval "test \"`echo '$''{'glibcpp_cv_func_hypotf_use'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+
+
+ ac_ext=C
+# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cxx_cross
+
+ cat > conftest.$ac_ext <<EOF
+#line 9590 "configure"
+#include "confdefs.h"
+#include <math.h>
+int main() {
+ hypotf(0, 0);
+; return 0; }
+EOF
+if { (eval echo configure:9597: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ glibcpp_cv_func_hypotf_use=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ glibcpp_cv_func_hypotf_use=no
+fi
+rm -f conftest*
+ ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+
+fi
+
+ fi
+ echo "$ac_t""$glibcpp_cv_func_hypotf_use" 1>&6
+
+ if test x$glibcpp_cv_func_hypotf_use = x"yes"; then
+ for ac_func in hypotf
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:9624: 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 9629 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:9652: \"$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
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+ else
+
+ echo $ac_n "checking for _hypotf declaration""... $ac_c" 1>&6
+echo "configure:9679: checking for _hypotf declaration" >&5
+ if test x${glibcpp_cv_func__hypotf_use+set} != xset; then
+ if eval "test \"`echo '$''{'glibcpp_cv_func__hypotf_use'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+
+
+ ac_ext=C
+# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cxx_cross
+
+ cat > conftest.$ac_ext <<EOF
+#line 9694 "configure"
+#include "confdefs.h"
+#include <math.h>
+int main() {
+ _hypotf(0, 0);
+; return 0; }
+EOF
+if { (eval echo configure:9701: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ glibcpp_cv_func__hypotf_use=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ glibcpp_cv_func__hypotf_use=no
+fi
+rm -f conftest*
+ ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+
+fi
+
+ fi
+ echo "$ac_t""$glibcpp_cv_func__hypotf_use" 1>&6
+
+ if test x$glibcpp_cv_func__hypotf_use = x"yes"; then
+ for ac_func in _hypotf
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:9728: 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 9733 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:9756: \"$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
@@ -8713,7 +9782,7 @@ done
echo $ac_n "checking for ldexpf declaration""... $ac_c" 1>&6
-echo "configure:8717: checking for ldexpf declaration" >&5
+echo "configure:9786: checking for ldexpf declaration" >&5
if test x${glibcpp_cv_func_ldexpf_use+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func_ldexpf_use'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -8728,14 +9797,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 8732 "configure"
+#line 9801 "configure"
#include "confdefs.h"
#include <math.h>
int main() {
ldexpf(0, 0);
; return 0; }
EOF
-if { (eval echo configure:8739: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:9808: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_cv_func_ldexpf_use=yes
else
@@ -8762,12 +9831,12 @@ fi
for ac_func in ldexpf
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:8766: checking for $ac_func" >&5
+echo "configure:9835: 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 8771 "configure"
+#line 9840 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -8790,7 +9859,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:8794: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9863: \"$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
@@ -8817,7 +9886,7 @@ done
else
echo $ac_n "checking for _ldexpf declaration""... $ac_c" 1>&6
-echo "configure:8821: checking for _ldexpf declaration" >&5
+echo "configure:9890: checking for _ldexpf declaration" >&5
if test x${glibcpp_cv_func__ldexpf_use+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func__ldexpf_use'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -8832,14 +9901,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 8836 "configure"
+#line 9905 "configure"
#include "confdefs.h"
#include <math.h>
int main() {
_ldexpf(0, 0);
; return 0; }
EOF
-if { (eval echo configure:8843: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:9912: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_cv_func__ldexpf_use=yes
else
@@ -8866,12 +9935,12 @@ fi
for ac_func in _ldexpf
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:8870: checking for $ac_func" >&5
+echo "configure:9939: 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 8875 "configure"
+#line 9944 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -8894,7 +9963,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:8898: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9967: \"$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
@@ -8924,7 +9993,7 @@ done
echo $ac_n "checking for logf declaration""... $ac_c" 1>&6
-echo "configure:8928: checking for logf declaration" >&5
+echo "configure:9997: checking for logf declaration" >&5
if test x${glibcpp_cv_func_logf_use+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func_logf_use'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -8939,14 +10008,18 @@ 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 8943 "configure"
+#line 10012 "configure"
#include "confdefs.h"
#include <math.h>
+ #ifdef HAVE_IEEEFP_H
+ #include <ieeefp.h>
+ #endif
+
int main() {
logf(0);
; return 0; }
EOF
-if { (eval echo configure:8950: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:10023: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_cv_func_logf_use=yes
else
@@ -8973,12 +10046,12 @@ fi
for ac_func in logf
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:8977: checking for $ac_func" >&5
+echo "configure:10050: 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 8982 "configure"
+#line 10055 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -9001,7 +10074,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:9005: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10078: \"$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
@@ -9028,7 +10101,7 @@ done
else
echo $ac_n "checking for _logf declaration""... $ac_c" 1>&6
-echo "configure:9032: checking for _logf declaration" >&5
+echo "configure:10105: checking for _logf declaration" >&5
if test x${glibcpp_cv_func__logf_use+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func__logf_use'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -9043,14 +10116,18 @@ 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 9047 "configure"
+#line 10120 "configure"
#include "confdefs.h"
#include <math.h>
+ #ifdef HAVE_IEEEFP_H
+ #include <ieeefp.h>
+ #endif
+
int main() {
_logf(0);
; return 0; }
EOF
-if { (eval echo configure:9054: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:10131: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_cv_func__logf_use=yes
else
@@ -9077,12 +10154,12 @@ fi
for ac_func in _logf
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:9081: checking for $ac_func" >&5
+echo "configure:10158: 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 9086 "configure"
+#line 10163 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -9105,7 +10182,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:9109: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10186: \"$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
@@ -9135,7 +10212,7 @@ done
echo $ac_n "checking for log10f declaration""... $ac_c" 1>&6
-echo "configure:9139: checking for log10f declaration" >&5
+echo "configure:10216: checking for log10f declaration" >&5
if test x${glibcpp_cv_func_log10f_use+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func_log10f_use'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -9150,14 +10227,18 @@ 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 9154 "configure"
+#line 10231 "configure"
#include "confdefs.h"
#include <math.h>
+ #ifdef HAVE_IEEEFP_H
+ #include <ieeefp.h>
+ #endif
+
int main() {
log10f(0);
; return 0; }
EOF
-if { (eval echo configure:9161: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:10242: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_cv_func_log10f_use=yes
else
@@ -9184,12 +10265,12 @@ fi
for ac_func in log10f
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:9188: checking for $ac_func" >&5
+echo "configure:10269: 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 9193 "configure"
+#line 10274 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -9212,7 +10293,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:9216: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10297: \"$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
@@ -9239,7 +10320,7 @@ done
else
echo $ac_n "checking for _log10f declaration""... $ac_c" 1>&6
-echo "configure:9243: checking for _log10f declaration" >&5
+echo "configure:10324: checking for _log10f declaration" >&5
if test x${glibcpp_cv_func__log10f_use+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func__log10f_use'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -9254,14 +10335,18 @@ 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 9258 "configure"
+#line 10339 "configure"
#include "confdefs.h"
#include <math.h>
+ #ifdef HAVE_IEEEFP_H
+ #include <ieeefp.h>
+ #endif
+
int main() {
_log10f(0);
; return 0; }
EOF
-if { (eval echo configure:9265: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:10350: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_cv_func__log10f_use=yes
else
@@ -9288,12 +10373,12 @@ fi
for ac_func in _log10f
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:9292: checking for $ac_func" >&5
+echo "configure:10377: 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 9297 "configure"
+#line 10382 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -9316,7 +10401,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:9320: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10405: \"$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
@@ -9346,7 +10431,7 @@ done
echo $ac_n "checking for modff declaration""... $ac_c" 1>&6
-echo "configure:9350: checking for modff declaration" >&5
+echo "configure:10435: checking for modff declaration" >&5
if test x${glibcpp_cv_func_modff_use+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func_modff_use'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -9361,14 +10446,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 9365 "configure"
+#line 10450 "configure"
#include "confdefs.h"
#include <math.h>
int main() {
modff(0, 0);
; return 0; }
EOF
-if { (eval echo configure:9372: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:10457: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_cv_func_modff_use=yes
else
@@ -9395,12 +10480,12 @@ fi
for ac_func in modff
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:9399: checking for $ac_func" >&5
+echo "configure:10484: 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 9404 "configure"
+#line 10489 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -9423,7 +10508,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:9427: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10512: \"$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
@@ -9450,7 +10535,7 @@ done
else
echo $ac_n "checking for _modff declaration""... $ac_c" 1>&6
-echo "configure:9454: checking for _modff declaration" >&5
+echo "configure:10539: checking for _modff declaration" >&5
if test x${glibcpp_cv_func__modff_use+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func__modff_use'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -9465,14 +10550,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 9469 "configure"
+#line 10554 "configure"
#include "confdefs.h"
#include <math.h>
int main() {
_modff(0, 0);
; return 0; }
EOF
-if { (eval echo configure:9476: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:10561: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_cv_func__modff_use=yes
else
@@ -9499,12 +10584,12 @@ fi
for ac_func in _modff
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:9503: checking for $ac_func" >&5
+echo "configure:10588: 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 9508 "configure"
+#line 10593 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -9527,7 +10612,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:9531: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10616: \"$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
@@ -9557,7 +10642,7 @@ done
echo $ac_n "checking for powf declaration""... $ac_c" 1>&6
-echo "configure:9561: checking for powf declaration" >&5
+echo "configure:10646: checking for powf declaration" >&5
if test x${glibcpp_cv_func_powf_use+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func_powf_use'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -9572,14 +10657,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 9576 "configure"
+#line 10661 "configure"
#include "confdefs.h"
#include <math.h>
int main() {
powf(0, 0);
; return 0; }
EOF
-if { (eval echo configure:9583: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:10668: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_cv_func_powf_use=yes
else
@@ -9606,12 +10691,12 @@ fi
for ac_func in powf
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:9610: checking for $ac_func" >&5
+echo "configure:10695: 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 9615 "configure"
+#line 10700 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -9634,7 +10719,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:9638: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10723: \"$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
@@ -9661,7 +10746,7 @@ done
else
echo $ac_n "checking for _powf declaration""... $ac_c" 1>&6
-echo "configure:9665: checking for _powf declaration" >&5
+echo "configure:10750: checking for _powf declaration" >&5
if test x${glibcpp_cv_func__powf_use+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func__powf_use'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -9676,14 +10761,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 9680 "configure"
+#line 10765 "configure"
#include "confdefs.h"
#include <math.h>
int main() {
_powf(0, 0);
; return 0; }
EOF
-if { (eval echo configure:9687: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:10772: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_cv_func__powf_use=yes
else
@@ -9710,12 +10795,12 @@ fi
for ac_func in _powf
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:9714: checking for $ac_func" >&5
+echo "configure:10799: 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 9719 "configure"
+#line 10804 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -9738,7 +10823,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:9742: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10827: \"$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
@@ -9768,7 +10853,7 @@ done
echo $ac_n "checking for sqrtf declaration""... $ac_c" 1>&6
-echo "configure:9772: checking for sqrtf declaration" >&5
+echo "configure:10857: checking for sqrtf declaration" >&5
if test x${glibcpp_cv_func_sqrtf_use+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func_sqrtf_use'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -9783,14 +10868,18 @@ 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 9787 "configure"
+#line 10872 "configure"
#include "confdefs.h"
#include <math.h>
+ #ifdef HAVE_IEEEFP_H
+ #include <ieeefp.h>
+ #endif
+
int main() {
sqrtf(0);
; return 0; }
EOF
-if { (eval echo configure:9794: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:10883: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_cv_func_sqrtf_use=yes
else
@@ -9817,12 +10906,12 @@ fi
for ac_func in sqrtf
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:9821: checking for $ac_func" >&5
+echo "configure:10910: 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 9826 "configure"
+#line 10915 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -9845,7 +10934,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:9849: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10938: \"$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
@@ -9872,7 +10961,7 @@ done
else
echo $ac_n "checking for _sqrtf declaration""... $ac_c" 1>&6
-echo "configure:9876: checking for _sqrtf declaration" >&5
+echo "configure:10965: checking for _sqrtf declaration" >&5
if test x${glibcpp_cv_func__sqrtf_use+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func__sqrtf_use'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -9887,14 +10976,18 @@ 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 9891 "configure"
+#line 10980 "configure"
#include "confdefs.h"
#include <math.h>
+ #ifdef HAVE_IEEEFP_H
+ #include <ieeefp.h>
+ #endif
+
int main() {
_sqrtf(0);
; return 0; }
EOF
-if { (eval echo configure:9898: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:10991: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_cv_func__sqrtf_use=yes
else
@@ -9921,12 +11014,12 @@ fi
for ac_func in _sqrtf
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:9925: checking for $ac_func" >&5
+echo "configure:11018: 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 9930 "configure"
+#line 11023 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -9949,7 +11042,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:9953: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11046: \"$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
@@ -9979,7 +11072,7 @@ done
echo $ac_n "checking for sincosf declaration""... $ac_c" 1>&6
-echo "configure:9983: checking for sincosf declaration" >&5
+echo "configure:11076: checking for sincosf declaration" >&5
if test x${glibcpp_cv_func_sincosf_use+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func_sincosf_use'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -9994,14 +11087,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 9998 "configure"
+#line 11091 "configure"
#include "confdefs.h"
#include <math.h>
int main() {
sincosf(0, 0, 0);
; return 0; }
EOF
-if { (eval echo configure:10005: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:11098: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_cv_func_sincosf_use=yes
else
@@ -10028,12 +11121,12 @@ fi
for ac_func in sincosf
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:10032: checking for $ac_func" >&5
+echo "configure:11125: 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 10037 "configure"
+#line 11130 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -10056,7 +11149,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:10060: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11153: \"$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
@@ -10083,7 +11176,7 @@ done
else
echo $ac_n "checking for _sincosf declaration""... $ac_c" 1>&6
-echo "configure:10087: checking for _sincosf declaration" >&5
+echo "configure:11180: checking for _sincosf declaration" >&5
if test x${glibcpp_cv_func__sincosf_use+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func__sincosf_use'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -10098,14 +11191,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 10102 "configure"
+#line 11195 "configure"
#include "confdefs.h"
#include <math.h>
int main() {
_sincosf(0, 0, 0);
; return 0; }
EOF
-if { (eval echo configure:10109: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:11202: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_cv_func__sincosf_use=yes
else
@@ -10132,12 +11225,12 @@ fi
for ac_func in _sincosf
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:10136: checking for $ac_func" >&5
+echo "configure:11229: 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 10141 "configure"
+#line 11234 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -10160,7 +11253,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:10164: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11257: \"$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
@@ -10190,7 +11283,7 @@ done
echo $ac_n "checking for finitef declaration""... $ac_c" 1>&6
-echo "configure:10194: checking for finitef declaration" >&5
+echo "configure:11287: checking for finitef declaration" >&5
if test x${glibcpp_cv_func_finitef_use+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func_finitef_use'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -10205,14 +11298,18 @@ 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 10209 "configure"
+#line 11302 "configure"
#include "confdefs.h"
#include <math.h>
+ #ifdef HAVE_IEEEFP_H
+ #include <ieeefp.h>
+ #endif
+
int main() {
finitef(0);
; return 0; }
EOF
-if { (eval echo configure:10216: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:11313: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_cv_func_finitef_use=yes
else
@@ -10239,12 +11336,12 @@ fi
for ac_func in finitef
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:10243: checking for $ac_func" >&5
+echo "configure:11340: 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 10248 "configure"
+#line 11345 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -10267,7 +11364,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:10271: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11368: \"$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
@@ -10294,7 +11391,7 @@ done
else
echo $ac_n "checking for _finitef declaration""... $ac_c" 1>&6
-echo "configure:10298: checking for _finitef declaration" >&5
+echo "configure:11395: checking for _finitef declaration" >&5
if test x${glibcpp_cv_func__finitef_use+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func__finitef_use'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -10309,14 +11406,18 @@ 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 10313 "configure"
+#line 11410 "configure"
#include "confdefs.h"
#include <math.h>
+ #ifdef HAVE_IEEEFP_H
+ #include <ieeefp.h>
+ #endif
+
int main() {
_finitef(0);
; return 0; }
EOF
-if { (eval echo configure:10320: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:11421: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_cv_func__finitef_use=yes
else
@@ -10343,12 +11444,12 @@ fi
for ac_func in _finitef
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:10347: checking for $ac_func" >&5
+echo "configure:11448: 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 10352 "configure"
+#line 11453 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -10371,7 +11472,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:10375: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11476: \"$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
@@ -10401,7 +11502,7 @@ done
echo $ac_n "checking for long double trig functions""... $ac_c" 1>&6
-echo "configure:10405: checking for long double trig functions" >&5
+echo "configure:11506: checking for long double trig functions" >&5
if eval "test \"`echo '$''{'glibcpp_cv_func_long_double_trig_use'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -10415,7 +11516,7 @@ 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 10419 "configure"
+#line 11520 "configure"
#include "confdefs.h"
#include <math.h>
int main() {
@@ -10424,7 +11525,7 @@ int main() {
coshl sinhl tanhl; do echo "$x (0);"; done`
; return 0; }
EOF
-if { (eval echo configure:10428: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:11529: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_cv_func_long_double_trig_use=yes
else
@@ -10450,12 +11551,12 @@ fi
coshl sinhl tanhl
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:10454: checking for $ac_func" >&5
+echo "configure:11555: 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 10459 "configure"
+#line 11560 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -10478,7 +11579,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:10482: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11583: \"$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
@@ -10506,7 +11607,7 @@ done
echo $ac_n "checking for long double round functions""... $ac_c" 1>&6
-echo "configure:10510: checking for long double round functions" >&5
+echo "configure:11611: checking for long double round functions" >&5
if eval "test \"`echo '$''{'glibcpp_cv_func_long_double_round_use'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -10520,14 +11621,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 10524 "configure"
+#line 11625 "configure"
#include "confdefs.h"
#include <math.h>
int main() {
`for x in ceill floorl; do echo "$x (0);"; done`
; return 0; }
EOF
-if { (eval echo configure:10531: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:11632: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_cv_func_long_double_round_use=yes
else
@@ -10551,12 +11652,12 @@ fi
for ac_func in ceill floorl
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:10555: checking for $ac_func" >&5
+echo "configure:11656: 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 10560 "configure"
+#line 11661 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -10579,7 +11680,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:10583: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11684: \"$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
@@ -10608,7 +11709,7 @@ done
echo $ac_n "checking for isnanl declaration""... $ac_c" 1>&6
-echo "configure:10612: checking for isnanl declaration" >&5
+echo "configure:11713: checking for isnanl declaration" >&5
if test x${glibcpp_cv_func_isnanl_use+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func_isnanl_use'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -10623,14 +11724,18 @@ 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 10627 "configure"
+#line 11728 "configure"
#include "confdefs.h"
#include <math.h>
+ #ifdef HAVE_IEEEFP_H
+ #include <ieeefp.h>
+ #endif
+
int main() {
isnanl(0);
; return 0; }
EOF
-if { (eval echo configure:10634: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:11739: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_cv_func_isnanl_use=yes
else
@@ -10657,12 +11762,12 @@ fi
for ac_func in isnanl
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:10661: checking for $ac_func" >&5
+echo "configure:11766: 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 10666 "configure"
+#line 11771 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -10685,7 +11790,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:10689: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11794: \"$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
@@ -10712,7 +11817,7 @@ done
else
echo $ac_n "checking for _isnanl declaration""... $ac_c" 1>&6
-echo "configure:10716: checking for _isnanl declaration" >&5
+echo "configure:11821: checking for _isnanl declaration" >&5
if test x${glibcpp_cv_func__isnanl_use+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func__isnanl_use'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -10727,14 +11832,18 @@ 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 10731 "configure"
+#line 11836 "configure"
#include "confdefs.h"
#include <math.h>
+ #ifdef HAVE_IEEEFP_H
+ #include <ieeefp.h>
+ #endif
+
int main() {
_isnanl(0);
; return 0; }
EOF
-if { (eval echo configure:10738: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:11847: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_cv_func__isnanl_use=yes
else
@@ -10761,12 +11870,12 @@ fi
for ac_func in _isnanl
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:10765: checking for $ac_func" >&5
+echo "configure:11874: 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 10770 "configure"
+#line 11879 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -10789,7 +11898,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:10793: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11902: \"$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
@@ -10819,7 +11928,7 @@ done
echo $ac_n "checking for isinfl declaration""... $ac_c" 1>&6
-echo "configure:10823: checking for isinfl declaration" >&5
+echo "configure:11932: checking for isinfl declaration" >&5
if test x${glibcpp_cv_func_isinfl_use+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func_isinfl_use'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -10834,14 +11943,18 @@ 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 10838 "configure"
+#line 11947 "configure"
#include "confdefs.h"
#include <math.h>
+ #ifdef HAVE_IEEEFP_H
+ #include <ieeefp.h>
+ #endif
+
int main() {
isinfl(0);
; return 0; }
EOF
-if { (eval echo configure:10845: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:11958: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_cv_func_isinfl_use=yes
else
@@ -10868,12 +11981,12 @@ fi
for ac_func in isinfl
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:10872: checking for $ac_func" >&5
+echo "configure:11985: 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 10877 "configure"
+#line 11990 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -10896,7 +12009,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:10900: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12013: \"$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
@@ -10923,7 +12036,7 @@ done
else
echo $ac_n "checking for _isinfl declaration""... $ac_c" 1>&6
-echo "configure:10927: checking for _isinfl declaration" >&5
+echo "configure:12040: checking for _isinfl declaration" >&5
if test x${glibcpp_cv_func__isinfl_use+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func__isinfl_use'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -10938,14 +12051,18 @@ 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 10942 "configure"
+#line 12055 "configure"
#include "confdefs.h"
#include <math.h>
+ #ifdef HAVE_IEEEFP_H
+ #include <ieeefp.h>
+ #endif
+
int main() {
_isinfl(0);
; return 0; }
EOF
-if { (eval echo configure:10949: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:12066: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_cv_func__isinfl_use=yes
else
@@ -10972,12 +12089,12 @@ fi
for ac_func in _isinfl
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:10976: checking for $ac_func" >&5
+echo "configure:12093: 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 10981 "configure"
+#line 12098 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -11000,7 +12117,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:11004: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12121: \"$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
@@ -11030,7 +12147,7 @@ done
echo $ac_n "checking for copysignl declaration""... $ac_c" 1>&6
-echo "configure:11034: checking for copysignl declaration" >&5
+echo "configure:12151: checking for copysignl declaration" >&5
if test x${glibcpp_cv_func_copysignl_use+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func_copysignl_use'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -11045,14 +12162,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 11049 "configure"
+#line 12166 "configure"
#include "confdefs.h"
#include <math.h>
int main() {
copysignl(0, 0);
; return 0; }
EOF
-if { (eval echo configure:11056: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:12173: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_cv_func_copysignl_use=yes
else
@@ -11079,12 +12196,12 @@ fi
for ac_func in copysignl
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:11083: checking for $ac_func" >&5
+echo "configure:12200: 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 11088 "configure"
+#line 12205 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -11107,7 +12224,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:11111: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12228: \"$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
@@ -11134,7 +12251,7 @@ done
else
echo $ac_n "checking for _copysignl declaration""... $ac_c" 1>&6
-echo "configure:11138: checking for _copysignl declaration" >&5
+echo "configure:12255: checking for _copysignl declaration" >&5
if test x${glibcpp_cv_func__copysignl_use+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func__copysignl_use'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -11149,14 +12266,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 11153 "configure"
+#line 12270 "configure"
#include "confdefs.h"
#include <math.h>
int main() {
_copysignl(0, 0);
; return 0; }
EOF
-if { (eval echo configure:11160: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:12277: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_cv_func__copysignl_use=yes
else
@@ -11183,12 +12300,12 @@ fi
for ac_func in _copysignl
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:11187: checking for $ac_func" >&5
+echo "configure:12304: 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 11192 "configure"
+#line 12309 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -11211,7 +12328,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:11215: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12332: \"$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
@@ -11241,7 +12358,7 @@ done
echo $ac_n "checking for atan2l declaration""... $ac_c" 1>&6
-echo "configure:11245: checking for atan2l declaration" >&5
+echo "configure:12362: checking for atan2l declaration" >&5
if test x${glibcpp_cv_func_atan2l_use+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func_atan2l_use'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -11256,14 +12373,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 11260 "configure"
+#line 12377 "configure"
#include "confdefs.h"
#include <math.h>
int main() {
atan2l(0, 0);
; return 0; }
EOF
-if { (eval echo configure:11267: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:12384: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_cv_func_atan2l_use=yes
else
@@ -11290,12 +12407,12 @@ fi
for ac_func in atan2l
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:11294: checking for $ac_func" >&5
+echo "configure:12411: 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 11299 "configure"
+#line 12416 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -11318,7 +12435,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:11322: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12439: \"$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
@@ -11345,7 +12462,7 @@ done
else
echo $ac_n "checking for _atan2l declaration""... $ac_c" 1>&6
-echo "configure:11349: checking for _atan2l declaration" >&5
+echo "configure:12466: checking for _atan2l declaration" >&5
if test x${glibcpp_cv_func__atan2l_use+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func__atan2l_use'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -11360,14 +12477,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 11364 "configure"
+#line 12481 "configure"
#include "confdefs.h"
#include <math.h>
int main() {
_atan2l(0, 0);
; return 0; }
EOF
-if { (eval echo configure:11371: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:12488: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_cv_func__atan2l_use=yes
else
@@ -11394,12 +12511,12 @@ fi
for ac_func in _atan2l
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:11398: checking for $ac_func" >&5
+echo "configure:12515: 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 11403 "configure"
+#line 12520 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -11422,7 +12539,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:11426: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12543: \"$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
@@ -11452,7 +12569,7 @@ done
echo $ac_n "checking for expl declaration""... $ac_c" 1>&6
-echo "configure:11456: checking for expl declaration" >&5
+echo "configure:12573: checking for expl declaration" >&5
if test x${glibcpp_cv_func_expl_use+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func_expl_use'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -11467,14 +12584,18 @@ 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 11471 "configure"
+#line 12588 "configure"
#include "confdefs.h"
#include <math.h>
+ #ifdef HAVE_IEEEFP_H
+ #include <ieeefp.h>
+ #endif
+
int main() {
expl(0);
; return 0; }
EOF
-if { (eval echo configure:11478: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:12599: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_cv_func_expl_use=yes
else
@@ -11501,12 +12622,12 @@ fi
for ac_func in expl
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:11505: checking for $ac_func" >&5
+echo "configure:12626: 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 11510 "configure"
+#line 12631 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -11529,7 +12650,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:11533: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12654: \"$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
@@ -11556,7 +12677,7 @@ done
else
echo $ac_n "checking for _expl declaration""... $ac_c" 1>&6
-echo "configure:11560: checking for _expl declaration" >&5
+echo "configure:12681: checking for _expl declaration" >&5
if test x${glibcpp_cv_func__expl_use+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func__expl_use'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -11571,14 +12692,18 @@ 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 11575 "configure"
+#line 12696 "configure"
#include "confdefs.h"
#include <math.h>
+ #ifdef HAVE_IEEEFP_H
+ #include <ieeefp.h>
+ #endif
+
int main() {
_expl(0);
; return 0; }
EOF
-if { (eval echo configure:11582: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:12707: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_cv_func__expl_use=yes
else
@@ -11605,12 +12730,12 @@ fi
for ac_func in _expl
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:11609: checking for $ac_func" >&5
+echo "configure:12734: 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 11614 "configure"
+#line 12739 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -11633,7 +12758,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:11637: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12762: \"$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
@@ -11663,7 +12788,7 @@ done
echo $ac_n "checking for fabsl declaration""... $ac_c" 1>&6
-echo "configure:11667: checking for fabsl declaration" >&5
+echo "configure:12792: checking for fabsl declaration" >&5
if test x${glibcpp_cv_func_fabsl_use+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func_fabsl_use'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -11678,14 +12803,18 @@ 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 11682 "configure"
+#line 12807 "configure"
#include "confdefs.h"
#include <math.h>
+ #ifdef HAVE_IEEEFP_H
+ #include <ieeefp.h>
+ #endif
+
int main() {
fabsl(0);
; return 0; }
EOF
-if { (eval echo configure:11689: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:12818: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_cv_func_fabsl_use=yes
else
@@ -11712,12 +12841,12 @@ fi
for ac_func in fabsl
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:11716: checking for $ac_func" >&5
+echo "configure:12845: 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 11721 "configure"
+#line 12850 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -11740,7 +12869,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:11744: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12873: \"$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
@@ -11767,7 +12896,7 @@ done
else
echo $ac_n "checking for _fabsl declaration""... $ac_c" 1>&6
-echo "configure:11771: checking for _fabsl declaration" >&5
+echo "configure:12900: checking for _fabsl declaration" >&5
if test x${glibcpp_cv_func__fabsl_use+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func__fabsl_use'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -11782,14 +12911,18 @@ 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 11786 "configure"
+#line 12915 "configure"
#include "confdefs.h"
#include <math.h>
+ #ifdef HAVE_IEEEFP_H
+ #include <ieeefp.h>
+ #endif
+
int main() {
_fabsl(0);
; return 0; }
EOF
-if { (eval echo configure:11793: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:12926: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_cv_func__fabsl_use=yes
else
@@ -11816,12 +12949,12 @@ fi
for ac_func in _fabsl
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:11820: checking for $ac_func" >&5
+echo "configure:12953: 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 11825 "configure"
+#line 12958 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -11844,7 +12977,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:11848: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12981: \"$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
@@ -11874,7 +13007,7 @@ done
echo $ac_n "checking for fmodl declaration""... $ac_c" 1>&6
-echo "configure:11878: checking for fmodl declaration" >&5
+echo "configure:13011: checking for fmodl declaration" >&5
if test x${glibcpp_cv_func_fmodl_use+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func_fmodl_use'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -11889,14 +13022,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 11893 "configure"
+#line 13026 "configure"
#include "confdefs.h"
#include <math.h>
int main() {
fmodl(0, 0);
; return 0; }
EOF
-if { (eval echo configure:11900: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:13033: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_cv_func_fmodl_use=yes
else
@@ -11923,12 +13056,12 @@ fi
for ac_func in fmodl
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:11927: checking for $ac_func" >&5
+echo "configure:13060: 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 11932 "configure"
+#line 13065 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -11951,7 +13084,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:11955: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13088: \"$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
@@ -11978,7 +13111,7 @@ done
else
echo $ac_n "checking for _fmodl declaration""... $ac_c" 1>&6
-echo "configure:11982: checking for _fmodl declaration" >&5
+echo "configure:13115: checking for _fmodl declaration" >&5
if test x${glibcpp_cv_func__fmodl_use+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func__fmodl_use'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -11993,14 +13126,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 11997 "configure"
+#line 13130 "configure"
#include "confdefs.h"
#include <math.h>
int main() {
_fmodl(0, 0);
; return 0; }
EOF
-if { (eval echo configure:12004: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:13137: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_cv_func__fmodl_use=yes
else
@@ -12027,12 +13160,12 @@ fi
for ac_func in _fmodl
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:12031: checking for $ac_func" >&5
+echo "configure:13164: 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 12036 "configure"
+#line 13169 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -12055,7 +13188,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:12059: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13192: \"$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
@@ -12085,7 +13218,7 @@ done
echo $ac_n "checking for frexpl declaration""... $ac_c" 1>&6
-echo "configure:12089: checking for frexpl declaration" >&5
+echo "configure:13222: checking for frexpl declaration" >&5
if test x${glibcpp_cv_func_frexpl_use+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func_frexpl_use'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -12100,14 +13233,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 12104 "configure"
+#line 13237 "configure"
#include "confdefs.h"
#include <math.h>
int main() {
frexpl(0, 0);
; return 0; }
EOF
-if { (eval echo configure:12111: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:13244: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_cv_func_frexpl_use=yes
else
@@ -12134,12 +13267,12 @@ fi
for ac_func in frexpl
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:12138: checking for $ac_func" >&5
+echo "configure:13271: 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 12143 "configure"
+#line 13276 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -12162,7 +13295,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:12166: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13299: \"$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
@@ -12189,7 +13322,7 @@ done
else
echo $ac_n "checking for _frexpl declaration""... $ac_c" 1>&6
-echo "configure:12193: checking for _frexpl declaration" >&5
+echo "configure:13326: checking for _frexpl declaration" >&5
if test x${glibcpp_cv_func__frexpl_use+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func__frexpl_use'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -12204,14 +13337,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 12208 "configure"
+#line 13341 "configure"
#include "confdefs.h"
#include <math.h>
int main() {
_frexpl(0, 0);
; return 0; }
EOF
-if { (eval echo configure:12215: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:13348: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_cv_func__frexpl_use=yes
else
@@ -12238,12 +13371,12 @@ fi
for ac_func in _frexpl
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:12242: checking for $ac_func" >&5
+echo "configure:13375: 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 12247 "configure"
+#line 13380 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -12266,7 +13399,218 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:12270: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13403: \"$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
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+ fi
+ fi
+
+
+
+ echo $ac_n "checking for hypotl declaration""... $ac_c" 1>&6
+echo "configure:13433: checking for hypotl declaration" >&5
+ if test x${glibcpp_cv_func_hypotl_use+set} != xset; then
+ if eval "test \"`echo '$''{'glibcpp_cv_func_hypotl_use'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+
+
+ ac_ext=C
+# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cxx_cross
+
+ cat > conftest.$ac_ext <<EOF
+#line 13448 "configure"
+#include "confdefs.h"
+#include <math.h>
+int main() {
+ hypotl(0, 0);
+; return 0; }
+EOF
+if { (eval echo configure:13455: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ glibcpp_cv_func_hypotl_use=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ glibcpp_cv_func_hypotl_use=no
+fi
+rm -f conftest*
+ ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+
+fi
+
+ fi
+ echo "$ac_t""$glibcpp_cv_func_hypotl_use" 1>&6
+
+ if test x$glibcpp_cv_func_hypotl_use = x"yes"; then
+ for ac_func in hypotl
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:13482: 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 13487 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:13510: \"$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
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+ else
+
+ echo $ac_n "checking for _hypotl declaration""... $ac_c" 1>&6
+echo "configure:13537: checking for _hypotl declaration" >&5
+ if test x${glibcpp_cv_func__hypotl_use+set} != xset; then
+ if eval "test \"`echo '$''{'glibcpp_cv_func__hypotl_use'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+
+
+ ac_ext=C
+# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cxx_cross
+
+ cat > conftest.$ac_ext <<EOF
+#line 13552 "configure"
+#include "confdefs.h"
+#include <math.h>
+int main() {
+ _hypotl(0, 0);
+; return 0; }
+EOF
+if { (eval echo configure:13559: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ glibcpp_cv_func__hypotl_use=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ glibcpp_cv_func__hypotl_use=no
+fi
+rm -f conftest*
+ ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+
+fi
+
+ fi
+ echo "$ac_t""$glibcpp_cv_func__hypotl_use" 1>&6
+
+ if test x$glibcpp_cv_func__hypotl_use = x"yes"; then
+ for ac_func in _hypotl
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:13586: 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 13591 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:13614: \"$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
@@ -12296,7 +13640,7 @@ done
echo $ac_n "checking for ldexpl declaration""... $ac_c" 1>&6
-echo "configure:12300: checking for ldexpl declaration" >&5
+echo "configure:13644: checking for ldexpl declaration" >&5
if test x${glibcpp_cv_func_ldexpl_use+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func_ldexpl_use'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -12311,14 +13655,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 12315 "configure"
+#line 13659 "configure"
#include "confdefs.h"
#include <math.h>
int main() {
ldexpl(0, 0);
; return 0; }
EOF
-if { (eval echo configure:12322: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:13666: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_cv_func_ldexpl_use=yes
else
@@ -12345,12 +13689,12 @@ fi
for ac_func in ldexpl
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:12349: checking for $ac_func" >&5
+echo "configure:13693: 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 12354 "configure"
+#line 13698 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -12373,7 +13717,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:12377: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13721: \"$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
@@ -12400,7 +13744,7 @@ done
else
echo $ac_n "checking for _ldexpl declaration""... $ac_c" 1>&6
-echo "configure:12404: checking for _ldexpl declaration" >&5
+echo "configure:13748: checking for _ldexpl declaration" >&5
if test x${glibcpp_cv_func__ldexpl_use+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func__ldexpl_use'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -12415,14 +13759,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 12419 "configure"
+#line 13763 "configure"
#include "confdefs.h"
#include <math.h>
int main() {
_ldexpl(0, 0);
; return 0; }
EOF
-if { (eval echo configure:12426: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:13770: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_cv_func__ldexpl_use=yes
else
@@ -12449,12 +13793,12 @@ fi
for ac_func in _ldexpl
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:12453: checking for $ac_func" >&5
+echo "configure:13797: 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 12458 "configure"
+#line 13802 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -12477,7 +13821,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:12481: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13825: \"$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
@@ -12507,7 +13851,7 @@ done
echo $ac_n "checking for logl declaration""... $ac_c" 1>&6
-echo "configure:12511: checking for logl declaration" >&5
+echo "configure:13855: checking for logl declaration" >&5
if test x${glibcpp_cv_func_logl_use+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func_logl_use'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -12522,14 +13866,18 @@ 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 12526 "configure"
+#line 13870 "configure"
#include "confdefs.h"
#include <math.h>
+ #ifdef HAVE_IEEEFP_H
+ #include <ieeefp.h>
+ #endif
+
int main() {
logl(0);
; return 0; }
EOF
-if { (eval echo configure:12533: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:13881: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_cv_func_logl_use=yes
else
@@ -12556,12 +13904,12 @@ fi
for ac_func in logl
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:12560: checking for $ac_func" >&5
+echo "configure:13908: 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 12565 "configure"
+#line 13913 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -12584,7 +13932,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:12588: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13936: \"$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
@@ -12611,7 +13959,7 @@ done
else
echo $ac_n "checking for _logl declaration""... $ac_c" 1>&6
-echo "configure:12615: checking for _logl declaration" >&5
+echo "configure:13963: checking for _logl declaration" >&5
if test x${glibcpp_cv_func__logl_use+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func__logl_use'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -12626,14 +13974,18 @@ 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 12630 "configure"
+#line 13978 "configure"
#include "confdefs.h"
#include <math.h>
+ #ifdef HAVE_IEEEFP_H
+ #include <ieeefp.h>
+ #endif
+
int main() {
_logl(0);
; return 0; }
EOF
-if { (eval echo configure:12637: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:13989: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_cv_func__logl_use=yes
else
@@ -12660,12 +14012,12 @@ fi
for ac_func in _logl
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:12664: checking for $ac_func" >&5
+echo "configure:14016: 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 12669 "configure"
+#line 14021 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -12688,7 +14040,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:12692: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14044: \"$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
@@ -12718,7 +14070,7 @@ done
echo $ac_n "checking for log10l declaration""... $ac_c" 1>&6
-echo "configure:12722: checking for log10l declaration" >&5
+echo "configure:14074: checking for log10l declaration" >&5
if test x${glibcpp_cv_func_log10l_use+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func_log10l_use'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -12733,14 +14085,18 @@ 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 12737 "configure"
+#line 14089 "configure"
#include "confdefs.h"
#include <math.h>
+ #ifdef HAVE_IEEEFP_H
+ #include <ieeefp.h>
+ #endif
+
int main() {
log10l(0);
; return 0; }
EOF
-if { (eval echo configure:12744: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:14100: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_cv_func_log10l_use=yes
else
@@ -12767,12 +14123,12 @@ fi
for ac_func in log10l
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:12771: checking for $ac_func" >&5
+echo "configure:14127: 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 12776 "configure"
+#line 14132 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -12795,7 +14151,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:12799: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14155: \"$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
@@ -12822,7 +14178,7 @@ done
else
echo $ac_n "checking for _log10l declaration""... $ac_c" 1>&6
-echo "configure:12826: checking for _log10l declaration" >&5
+echo "configure:14182: checking for _log10l declaration" >&5
if test x${glibcpp_cv_func__log10l_use+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func__log10l_use'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -12837,14 +14193,18 @@ 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 12841 "configure"
+#line 14197 "configure"
#include "confdefs.h"
#include <math.h>
+ #ifdef HAVE_IEEEFP_H
+ #include <ieeefp.h>
+ #endif
+
int main() {
_log10l(0);
; return 0; }
EOF
-if { (eval echo configure:12848: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:14208: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_cv_func__log10l_use=yes
else
@@ -12871,12 +14231,12 @@ fi
for ac_func in _log10l
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:12875: checking for $ac_func" >&5
+echo "configure:14235: 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 12880 "configure"
+#line 14240 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -12899,7 +14259,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:12903: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14263: \"$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
@@ -12929,7 +14289,7 @@ done
echo $ac_n "checking for modfl declaration""... $ac_c" 1>&6
-echo "configure:12933: checking for modfl declaration" >&5
+echo "configure:14293: checking for modfl declaration" >&5
if test x${glibcpp_cv_func_modfl_use+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func_modfl_use'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -12944,14 +14304,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 12948 "configure"
+#line 14308 "configure"
#include "confdefs.h"
#include <math.h>
int main() {
modfl(0, 0);
; return 0; }
EOF
-if { (eval echo configure:12955: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:14315: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_cv_func_modfl_use=yes
else
@@ -12978,12 +14338,12 @@ fi
for ac_func in modfl
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:12982: checking for $ac_func" >&5
+echo "configure:14342: 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 12987 "configure"
+#line 14347 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -13006,7 +14366,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:13010: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14370: \"$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
@@ -13033,7 +14393,7 @@ done
else
echo $ac_n "checking for _modfl declaration""... $ac_c" 1>&6
-echo "configure:13037: checking for _modfl declaration" >&5
+echo "configure:14397: checking for _modfl declaration" >&5
if test x${glibcpp_cv_func__modfl_use+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func__modfl_use'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -13048,14 +14408,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 13052 "configure"
+#line 14412 "configure"
#include "confdefs.h"
#include <math.h>
int main() {
_modfl(0, 0);
; return 0; }
EOF
-if { (eval echo configure:13059: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:14419: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_cv_func__modfl_use=yes
else
@@ -13082,12 +14442,12 @@ fi
for ac_func in _modfl
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:13086: checking for $ac_func" >&5
+echo "configure:14446: 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 13091 "configure"
+#line 14451 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -13110,7 +14470,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:13114: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14474: \"$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
@@ -13140,7 +14500,7 @@ done
echo $ac_n "checking for powl declaration""... $ac_c" 1>&6
-echo "configure:13144: checking for powl declaration" >&5
+echo "configure:14504: checking for powl declaration" >&5
if test x${glibcpp_cv_func_powl_use+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func_powl_use'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -13155,14 +14515,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 13159 "configure"
+#line 14519 "configure"
#include "confdefs.h"
#include <math.h>
int main() {
powl(0, 0);
; return 0; }
EOF
-if { (eval echo configure:13166: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:14526: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_cv_func_powl_use=yes
else
@@ -13189,12 +14549,12 @@ fi
for ac_func in powl
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:13193: checking for $ac_func" >&5
+echo "configure:14553: 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 13198 "configure"
+#line 14558 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -13217,7 +14577,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:13221: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14581: \"$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
@@ -13244,7 +14604,7 @@ done
else
echo $ac_n "checking for _powl declaration""... $ac_c" 1>&6
-echo "configure:13248: checking for _powl declaration" >&5
+echo "configure:14608: checking for _powl declaration" >&5
if test x${glibcpp_cv_func__powl_use+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func__powl_use'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -13259,14 +14619,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 13263 "configure"
+#line 14623 "configure"
#include "confdefs.h"
#include <math.h>
int main() {
_powl(0, 0);
; return 0; }
EOF
-if { (eval echo configure:13270: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:14630: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_cv_func__powl_use=yes
else
@@ -13293,12 +14653,12 @@ fi
for ac_func in _powl
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:13297: checking for $ac_func" >&5
+echo "configure:14657: 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 13302 "configure"
+#line 14662 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -13321,7 +14681,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:13325: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14685: \"$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
@@ -13351,7 +14711,7 @@ done
echo $ac_n "checking for sqrtl declaration""... $ac_c" 1>&6
-echo "configure:13355: checking for sqrtl declaration" >&5
+echo "configure:14715: checking for sqrtl declaration" >&5
if test x${glibcpp_cv_func_sqrtl_use+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func_sqrtl_use'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -13366,14 +14726,18 @@ 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 13370 "configure"
+#line 14730 "configure"
#include "confdefs.h"
#include <math.h>
+ #ifdef HAVE_IEEEFP_H
+ #include <ieeefp.h>
+ #endif
+
int main() {
sqrtl(0);
; return 0; }
EOF
-if { (eval echo configure:13377: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:14741: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_cv_func_sqrtl_use=yes
else
@@ -13400,12 +14764,12 @@ fi
for ac_func in sqrtl
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:13404: checking for $ac_func" >&5
+echo "configure:14768: 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 13409 "configure"
+#line 14773 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -13428,7 +14792,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:13432: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14796: \"$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
@@ -13455,7 +14819,7 @@ done
else
echo $ac_n "checking for _sqrtl declaration""... $ac_c" 1>&6
-echo "configure:13459: checking for _sqrtl declaration" >&5
+echo "configure:14823: checking for _sqrtl declaration" >&5
if test x${glibcpp_cv_func__sqrtl_use+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func__sqrtl_use'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -13470,14 +14834,18 @@ 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 13474 "configure"
+#line 14838 "configure"
#include "confdefs.h"
#include <math.h>
+ #ifdef HAVE_IEEEFP_H
+ #include <ieeefp.h>
+ #endif
+
int main() {
_sqrtl(0);
; return 0; }
EOF
-if { (eval echo configure:13481: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:14849: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_cv_func__sqrtl_use=yes
else
@@ -13504,12 +14872,12 @@ fi
for ac_func in _sqrtl
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:13508: checking for $ac_func" >&5
+echo "configure:14876: 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 13513 "configure"
+#line 14881 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -13532,7 +14900,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:13536: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14904: \"$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
@@ -13562,7 +14930,7 @@ done
echo $ac_n "checking for sincosl declaration""... $ac_c" 1>&6
-echo "configure:13566: checking for sincosl declaration" >&5
+echo "configure:14934: checking for sincosl declaration" >&5
if test x${glibcpp_cv_func_sincosl_use+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func_sincosl_use'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -13577,14 +14945,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 13581 "configure"
+#line 14949 "configure"
#include "confdefs.h"
#include <math.h>
int main() {
sincosl(0, 0, 0);
; return 0; }
EOF
-if { (eval echo configure:13588: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:14956: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_cv_func_sincosl_use=yes
else
@@ -13611,12 +14979,12 @@ fi
for ac_func in sincosl
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:13615: checking for $ac_func" >&5
+echo "configure:14983: 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 13620 "configure"
+#line 14988 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -13639,7 +15007,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:13643: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:15011: \"$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
@@ -13666,7 +15034,7 @@ done
else
echo $ac_n "checking for _sincosl declaration""... $ac_c" 1>&6
-echo "configure:13670: checking for _sincosl declaration" >&5
+echo "configure:15038: checking for _sincosl declaration" >&5
if test x${glibcpp_cv_func__sincosl_use+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func__sincosl_use'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -13681,14 +15049,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 13685 "configure"
+#line 15053 "configure"
#include "confdefs.h"
#include <math.h>
int main() {
_sincosl(0, 0, 0);
; return 0; }
EOF
-if { (eval echo configure:13692: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:15060: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_cv_func__sincosl_use=yes
else
@@ -13715,12 +15083,12 @@ fi
for ac_func in _sincosl
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:13719: checking for $ac_func" >&5
+echo "configure:15087: 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 13724 "configure"
+#line 15092 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -13743,7 +15111,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:13747: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:15115: \"$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
@@ -13773,7 +15141,7 @@ done
echo $ac_n "checking for finitel declaration""... $ac_c" 1>&6
-echo "configure:13777: checking for finitel declaration" >&5
+echo "configure:15145: checking for finitel declaration" >&5
if test x${glibcpp_cv_func_finitel_use+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func_finitel_use'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -13788,14 +15156,18 @@ 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 13792 "configure"
+#line 15160 "configure"
#include "confdefs.h"
#include <math.h>
+ #ifdef HAVE_IEEEFP_H
+ #include <ieeefp.h>
+ #endif
+
int main() {
finitel(0);
; return 0; }
EOF
-if { (eval echo configure:13799: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:15171: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_cv_func_finitel_use=yes
else
@@ -13822,12 +15194,12 @@ fi
for ac_func in finitel
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:13826: checking for $ac_func" >&5
+echo "configure:15198: 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 13831 "configure"
+#line 15203 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -13850,7 +15222,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:13854: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:15226: \"$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
@@ -13877,7 +15249,7 @@ done
else
echo $ac_n "checking for _finitel declaration""... $ac_c" 1>&6
-echo "configure:13881: checking for _finitel declaration" >&5
+echo "configure:15253: checking for _finitel declaration" >&5
if test x${glibcpp_cv_func__finitel_use+set} != xset; then
if eval "test \"`echo '$''{'glibcpp_cv_func__finitel_use'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -13892,14 +15264,18 @@ 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 13896 "configure"
+#line 15268 "configure"
#include "confdefs.h"
#include <math.h>
+ #ifdef HAVE_IEEEFP_H
+ #include <ieeefp.h>
+ #endif
+
int main() {
_finitel(0);
; return 0; }
EOF
-if { (eval echo configure:13903: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:15279: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_cv_func__finitel_use=yes
else
@@ -13926,12 +15302,12 @@ fi
for ac_func in _finitel
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:13930: checking for $ac_func" >&5
+echo "configure:15306: 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 13935 "configure"
+#line 15311 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -13954,7 +15330,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:13958: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:15334: \"$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
@@ -13985,7 +15361,7 @@ done
echo $ac_n "checking for _float trig functions""... $ac_c" 1>&6
-echo "configure:13989: checking for _float trig functions" >&5
+echo "configure:15365: checking for _float trig functions" >&5
if eval "test \"`echo '$''{'glibcpp_cv_func__float_trig_use'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -13999,7 +15375,7 @@ 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 14003 "configure"
+#line 15379 "configure"
#include "confdefs.h"
#include <math.h>
int main() {
@@ -14008,7 +15384,7 @@ int main() {
_coshf _sinhf _tanhf; do echo "$x (0);"; done`
; return 0; }
EOF
-if { (eval echo configure:14012: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:15388: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_cv_func__float_trig_use=yes
else
@@ -14034,12 +15410,12 @@ fi
_coshf _sinhf _tanhf
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:14038: checking for $ac_func" >&5
+echo "configure:15414: 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 14043 "configure"
+#line 15419 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -14062,7 +15438,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:14066: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:15442: \"$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
@@ -14090,7 +15466,7 @@ done
echo $ac_n "checking for _float round functions""... $ac_c" 1>&6
-echo "configure:14094: checking for _float round functions" >&5
+echo "configure:15470: checking for _float round functions" >&5
if eval "test \"`echo '$''{'glibcpp_cv_func__float_round_use'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -14104,14 +15480,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 14108 "configure"
+#line 15484 "configure"
#include "confdefs.h"
#include <math.h>
int main() {
`for x in _ceilf _floorf; do echo "$x (0);"; done`
; return 0; }
EOF
-if { (eval echo configure:14115: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:15491: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_cv_func__float_round_use=yes
else
@@ -14135,12 +15511,12 @@ fi
for ac_func in _ceilf _floorf
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:14139: checking for $ac_func" >&5
+echo "configure:15515: 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 14144 "configure"
+#line 15520 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -14163,7 +15539,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:14167: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:15543: \"$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
@@ -14192,7 +15568,7 @@ done
echo $ac_n "checking for _long double trig functions""... $ac_c" 1>&6
-echo "configure:14196: checking for _long double trig functions" >&5
+echo "configure:15572: checking for _long double trig functions" >&5
if eval "test \"`echo '$''{'glibcpp_cv_func__long_double_trig_use'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -14206,7 +15582,7 @@ 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 14210 "configure"
+#line 15586 "configure"
#include "confdefs.h"
#include <math.h>
int main() {
@@ -14215,7 +15591,7 @@ int main() {
_coshl _sinhl _tanhl; do echo "$x (0);"; done`
; return 0; }
EOF
-if { (eval echo configure:14219: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:15595: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_cv_func__long_double_trig_use=yes
else
@@ -14241,12 +15617,12 @@ fi
_coshl _sinhl _tanhl
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:14245: checking for $ac_func" >&5
+echo "configure:15621: 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 14250 "configure"
+#line 15626 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -14269,7 +15645,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:14273: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:15649: \"$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
@@ -14297,7 +15673,7 @@ done
echo $ac_n "checking for _long double round functions""... $ac_c" 1>&6
-echo "configure:14301: checking for _long double round functions" >&5
+echo "configure:15677: checking for _long double round functions" >&5
if eval "test \"`echo '$''{'glibcpp_cv_func__long_double_round_use'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -14311,14 +15687,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 14315 "configure"
+#line 15691 "configure"
#include "confdefs.h"
#include <math.h>
int main() {
`for x in _ceill _floorl; do echo "$x (0);"; done`
; return 0; }
EOF
-if { (eval echo configure:14322: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:15698: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
glibcpp_cv_func__long_double_round_use=yes
else
@@ -14342,12 +15718,12 @@ fi
for ac_func in _ceill _floorl
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:14346: checking for $ac_func" >&5
+echo "configure:15722: 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 14351 "configure"
+#line 15727 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -14370,7 +15746,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:14374: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:15750: \"$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
@@ -14402,7 +15778,7 @@ done
echo $ac_n "checking for main in -lm""... $ac_c" 1>&6
-echo "configure:14406: checking for main in -lm" >&5
+echo "configure:15782: checking for main in -lm" >&5
ac_lib_var=`echo m'_'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
@@ -14410,14 +15786,14 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lm $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 14414 "configure"
+#line 15790 "configure"
#include "confdefs.h"
int main() {
main()
; return 0; }
EOF
-if { (eval echo configure:14421: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:15797: \"$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
@@ -14444,15 +15820,15 @@ else
echo "$ac_t""no" 1>&6
fi
- for ac_func in nan hypot hypotf atan2f expf copysignf
+ for ac_func in nan copysignf
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:14451: checking for $ac_func" >&5
+echo "configure:15827: 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 14456 "configure"
+#line 15832 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -14475,7 +15851,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:14479: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:15855: \"$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
@@ -14503,18 +15879,17 @@ done
USE_COMPLEX_LONG_DOUBLE=no
- if test x$ac_cv_func_atan2l = x"yes" \
- && test x$ac_cv_func_copysignl = x"yes"; then
+ if test x$ac_cv_func_copysignl = x"yes"; then
USE_COMPLEX_LONG_DOUBLE=yes
- for ac_func in hypotl signbitl
+ for ac_func in signbitl
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:14513: checking for $ac_func" >&5
+echo "configure:15888: 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 14518 "configure"
+#line 15893 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -14537,7 +15912,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:14541: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:15916: \"$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
@@ -14568,144 +15943,18 @@ done
-
-
- echo $ac_n "checking for GNU C++ __complex__ support""... $ac_c" 1>&6
-echo "configure:14575: checking for GNU C++ __complex__ support" >&5
- if eval "test \"`echo '$''{'glibcpp_cv_complex'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
-
- cat > conftest.$ac_ext <<EOF
-#line 14589 "configure"
-#include "confdefs.h"
-struct dcomplex { __complex__ double x; }; \
- dcomplex f(const dcomplex& x) { return dcomplex(x); }
-int main() {
-\
- dcomplex x; f(x);
-; return 0; }
-EOF
-if { (eval echo configure:14598: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- glibcpp_cv_complex=ok
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcpp_cv_complex=buggy
-
-fi
-rm -f conftest*
- ac_ext=c
-# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cc_cross
-
-
-fi
-
- echo "$ac_t""$glibcpp_cv_complex" 1>&6
- if test $glibcpp_cv_complex = buggy; then
- cat >> confdefs.h <<\EOF
-#define _GLIBCPP_BUGGY_COMPLEX 1
-EOF
-
- fi
-
- echo $ac_n "checking for GNU C++ __complex__ float support""... $ac_c" 1>&6
-echo "configure:14628: checking for GNU C++ __complex__ float support" >&5
- if eval "test \"`echo '$''{'glibcpp_cv_float_complex'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
-
- rm -f conftest.h
- cat > conftest.h <<EOB
- //
- // Check for buggy __complex__ that causes ICE in most versions of egcs
- // and gcc-2.95.x on certain platforms (eg., x86-win32).
- //
- // See http://gcc.gnu.org/ml/gcc-bugs/1999-07n/msg00845.html for
- // more info on the bug itself.
- //
- struct
- float_complex
- {
- __complex__ float m_value;
- float_complex (float = 0.0f, float = 0.0f);
- float_complex (__complex__ float val) : m_value (val) {}
- float_complex foo (const float_complex &val)
- { return float_complex (~val.m_value); }
- };
-EOB
- cat > conftest.$ac_ext <<EOF
-#line 14661 "configure"
-#include "confdefs.h"
-#include "conftest.h"
-int main() {
-
-; return 0; }
-EOF
-if { (eval echo configure:14668: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- glibcpp_cv_float_complex=ok
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcpp_cv_float_complex=buggy
-
-fi
-rm -f conftest*
- ac_ext=c
-# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cc_cross
-
-
-fi
-
- echo "$ac_t""$glibcpp_cv_float_complex" 1>&6
- if test $glibcpp_cv_float_complex = buggy; then
- cat >> confdefs.h <<\EOF
-#define _GLIBCPP_BUGGY_FLOAT_COMPLEX 1
-EOF
-
- fi
-
-
echo $ac_n "checking for mbstate_t""... $ac_c" 1>&6
-echo "configure:14700: checking for mbstate_t" >&5
+echo "configure:15949: checking for mbstate_t" >&5
cat > conftest.$ac_ext <<EOF
-#line 14702 "configure"
+#line 15951 "configure"
#include "confdefs.h"
#include <wchar.h>
int main() {
mbstate_t teststate;
; return 0; }
EOF
-if { (eval echo configure:14709: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:15958: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
have_mbstate_t=yes
else
@@ -14727,17 +15976,17 @@ EOF
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:14731: checking for $ac_hdr" >&5
+echo "configure:15980: 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 14736 "configure"
+#line 15985 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:14741: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:15990: \"$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*
@@ -14766,17 +16015,17 @@ done
ac_safe=`echo "wctype.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for wctype.h""... $ac_c" 1>&6
-echo "configure:14770: checking for wctype.h" >&5
+echo "configure:16019: checking for wctype.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 14775 "configure"
+#line 16024 "configure"
#include "confdefs.h"
#include <wctype.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:14780: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:16029: \"$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*
@@ -14803,16 +16052,16 @@ fi
&& test x"$enable_c_mbchar" != xno; then
echo $ac_n "checking for WCHAR_MIN and WCHAR_MAX""... $ac_c" 1>&6
-echo "configure:14807: checking for WCHAR_MIN and WCHAR_MAX" >&5
+echo "configure:16056: checking for WCHAR_MIN and WCHAR_MAX" >&5
cat > conftest.$ac_ext <<EOF
-#line 14809 "configure"
+#line 16058 "configure"
#include "confdefs.h"
#include <wchar.h>
int main() {
int i = WCHAR_MIN; int j = WCHAR_MAX;
; return 0; }
EOF
-if { (eval echo configure:14816: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:16065: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
has_wchar_minmax=yes
else
@@ -14825,9 +16074,9 @@ rm -f conftest*
echo "$ac_t""$has_wchar_minmax" 1>&6
echo $ac_n "checking for WEOF""... $ac_c" 1>&6
-echo "configure:14829: checking for WEOF" >&5
+echo "configure:16078: checking for WEOF" >&5
cat > conftest.$ac_ext <<EOF
-#line 14831 "configure"
+#line 16080 "configure"
#include "confdefs.h"
#include <wchar.h>
@@ -14836,7 +16085,7 @@ int main() {
wint_t i = WEOF;
; return 0; }
EOF
-if { (eval echo configure:14840: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:16089: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
has_weof=yes
else
@@ -14848,16 +16097,16 @@ fi
rm -f conftest*
echo "$ac_t""$has_weof" 1>&6
- for ac_func in wcslen wmemchr wmemcmp wmemcpy wmemmove wmemset \
- wcsrtombs mbsrtowcs
+ ac_wfuncs=yes
+ for ac_func in wcslen wmemchr wmemcmp wmemcpy wmemmove wmemset
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:14856: checking for $ac_func" >&5
+echo "configure:16105: 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 14861 "configure"
+#line 16110 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -14880,7 +16129,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:14884: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:16133: \"$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
@@ -14898,16 +16147,80 @@ if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
cat >> confdefs.h <<EOF
#define $ac_tr_func 1
EOF
- ac_wfuncs=yes
+
else
echo "$ac_t""no" 1>&6
-ac_wfuncs=no
+\
+ ac_wfuncs=no
fi
done
+ for ac_func in btowc wctob fgetwc fgetwc fgetws fputwc fputws fwide \
+ fwprintf fwscanf swprintf swscanf vfwprintf vfwscanf vswprintf vswscanf \
+ vwprintf vwscanf wprintf wscanf getwc getwchar mbsinit mbrlen mbrtowc \
+ mbsrtowcs wcsrtombs putwc putwchar ungetwc wcrtomb wcstod wcstof wcstol \
+ wcstoul wcscpy wcsncpy wcscat wcsncat wcscmp wcscoll wcsncmp wcsxfrm \
+ wcscspn wcsspn wcstok wcsftime wcschr wcspbrk wcsrchr wcsstr
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:16168: 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 16173 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:16196: \"$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
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+\
+ ac_wfuncs=no
+fi
+done
+
+
echo $ac_n "checking for ISO C99 wchar_t support""... $ac_c" 1>&6
-echo "configure:14911: checking for ISO C99 wchar_t support" >&5
+echo "configure:16224: checking for ISO C99 wchar_t support" >&5
if test x"$has_weof" = xyes && test x"$has_wchar_minmax" = xyes \
&& test x"$ac_wfuncs" = xyes; then
ac_isoC99_wchar_t=yes
@@ -14918,17 +16231,17 @@ echo "configure:14911: checking for ISO C99 wchar_t support" >&5
ac_safe=`echo "iconv.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for iconv.h""... $ac_c" 1>&6
-echo "configure:14922: checking for iconv.h" >&5
+echo "configure:16235: checking for iconv.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 14927 "configure"
+#line 16240 "configure"
#include "confdefs.h"
#include <iconv.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:14932: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:16245: \"$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*
@@ -14952,17 +16265,17 @@ fi
ac_safe=`echo "langinfo.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for langinfo.h""... $ac_c" 1>&6
-echo "configure:14956: checking for langinfo.h" >&5
+echo "configure:16269: checking for langinfo.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 14961 "configure"
+#line 16274 "configure"
#include "confdefs.h"
#include <langinfo.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:14966: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:16279: \"$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*
@@ -14986,7 +16299,7 @@ fi
echo $ac_n "checking for iconv in -liconv""... $ac_c" 1>&6
-echo "configure:14990: checking for iconv in -liconv" >&5
+echo "configure:16303: checking for iconv in -liconv" >&5
ac_lib_var=`echo iconv'_'iconv | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -14994,7 +16307,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-liconv $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 14998 "configure"
+#line 16311 "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
@@ -15005,7 +16318,7 @@ int main() {
iconv()
; return 0; }
EOF
-if { (eval echo configure:15009: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:16322: \"$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
@@ -15031,12 +16344,12 @@ fi
for ac_func in iconv_open iconv_close iconv nl_langinfo
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:15035: checking for $ac_func" >&5
+echo "configure:16348: 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 15040 "configure"
+#line 16353 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -15059,7 +16372,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:15063: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:16376: \"$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
@@ -15089,7 +16402,7 @@ done
LIBS="$ac_save_LIBS"
echo $ac_n "checking for XPG2 wchar_t support""... $ac_c" 1>&6
-echo "configure:15093: checking for XPG2 wchar_t support" >&5
+echo "configure:16406: checking for XPG2 wchar_t support" >&5
if test x"$ac_has_iconv_h" = xyes && test x"$ac_has_langinfo_h" = xyes \
&& test x"$ac_XPG2funcs" = xyes; then
ac_XPG2_wchar_t=yes
@@ -15099,21 +16412,17 @@ echo "configure:15093: checking for XPG2 wchar_t support" >&5
echo "$ac_t""$ac_XPG2_wchar_t" 1>&6
echo $ac_n "checking for enabled wchar_t specializations""... $ac_c" 1>&6
-echo "configure:15103: checking for enabled wchar_t specializations" >&5
+echo "configure:16416: checking for enabled wchar_t specializations" >&5
if test x"$ac_isoC99_wchar_t" = xyes \
- && test x"$ac_XPG2_wchar_t" = xyes; then
- libinst_wstring_la="libinst-wstring.la"
+ && test x"$ac_XPG2_wchar_t" = xyes; then
cat >> confdefs.h <<\EOF
#define _GLIBCPP_USE_WCHAR_T 1
EOF
echo "$ac_t"""yes"" 1>&6
else
- libinst_wstring_la=""
echo "$ac_t"""no"" 1>&6
fi
-
-
else
echo "configure: warning: wchar_t support disabled." 1>&2
fi
@@ -15123,15 +16432,62 @@ EOF
ac_save_CXXFLAGS="$CXXFLAGS"
CXXFLAGS='-fno-builtins -D_GNU_SOURCE'
- for ac_func in strtof
+
+ echo $ac_n "checking for strtold declaration""... $ac_c" 1>&6
+echo "configure:16438: checking for strtold declaration" >&5
+ if test x${glibcpp_cv_func_strtold_use+set} != xset; then
+ if eval "test \"`echo '$''{'glibcpp_cv_func_strtold_use'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+
+
+ ac_ext=C
+# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cxx_cross
+
+ cat > conftest.$ac_ext <<EOF
+#line 16453 "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+int main() {
+ strtold(0, 0);
+; return 0; }
+EOF
+if { (eval echo configure:16460: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ glibcpp_cv_func_strtold_use=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ glibcpp_cv_func_strtold_use=no
+fi
+rm -f conftest*
+ ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+
+fi
+
+ fi
+ echo "$ac_t""$glibcpp_cv_func_strtold_use" 1>&6
+ if test x$glibcpp_cv_func_strtold_use = x"yes"; then
+ for ac_func in strtold
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:15130: checking for $ac_func" >&5
+echo "configure:16486: 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 15135 "configure"
+#line 16491 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -15154,7 +16510,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:15158: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:16514: \"$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
@@ -15177,63 +16533,18 @@ else
echo "$ac_t""no" 1>&6
fi
done
-
-
- echo $ac_n "checking for strtold declaration""... $ac_c" 1>&6
-echo "configure:15184: checking for strtold declaration" >&5
- if test x${glibcpp_cv_func_strtold_use+set} != xset; then
- if eval "test \"`echo '$''{'glibcpp_cv_func_strtold_use'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
-
-
- ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cxx_cross
-
- cat > conftest.$ac_ext <<EOF
-#line 15199 "configure"
-#include "confdefs.h"
-#include <stdlib.h>
-int main() {
- strtold(0, 0);
-; return 0; }
-EOF
-if { (eval echo configure:15206: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- glibcpp_cv_func_strtold_use=yes
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- glibcpp_cv_func_strtold_use=no
-fi
-rm -f conftest*
- ac_ext=c
-# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cc_cross
-
-fi
-
fi
- echo "$ac_t""$glibcpp_cv_func_strtold_use" 1>&6
- if test x$glibcpp_cv_func_strtold_use = x"yes"; then
- for ac_func in strtold
+
+ for ac_func in drand48
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:15232: checking for $ac_func" >&5
+echo "configure:16543: 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 15237 "configure"
+#line 16548 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -15256,7 +16567,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:15260: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:16571: \"$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
@@ -15279,15 +16590,13 @@ else
echo "$ac_t""no" 1>&6
fi
done
-
- fi
CXXFLAGS="$ac_save_CXXFLAGS"
cat > conftest.$ac_ext <<EOF
-#line 15291 "configure"
+#line 16600 "configure"
#include "confdefs.h"
#include <setjmp.h>
@@ -15296,7 +16605,7 @@ int main() {
sigjmp_buf env; while (! sigsetjmp (env, 1)) siglongjmp (env, 1);
; return 0; }
EOF
-if { (eval echo configure:15300: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:16609: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define HAVE_SIGSETJMP 1
@@ -15308,21 +16617,21 @@ else
fi
rm -f conftest*
- 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
-echo "configure:15316: checking for $ac_hdr" >&5
+echo "configure:16625: 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 15321 "configure"
+#line 16630 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:15326: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:16635: \"$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*
@@ -15351,12 +16660,12 @@ done
for ac_func in getpagesize
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:15355: checking for $ac_func" >&5
+echo "configure:16664: 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 15360 "configure"
+#line 16669 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -15379,7 +16688,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:15383: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:16692: \"$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
@@ -15404,7 +16713,7 @@ fi
done
echo $ac_n "checking for working mmap""... $ac_c" 1>&6
-echo "configure:15408: checking for working mmap" >&5
+echo "configure:16717: checking for working mmap" >&5
if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -15412,7 +16721,7 @@ else
ac_cv_func_mmap_fixed_mapped=no
else
cat > conftest.$ac_ext <<EOF
-#line 15416 "configure"
+#line 16725 "configure"
#include "confdefs.h"
/* Thanks to Mike Haertel and Jim Avera for this test.
@@ -15440,11 +16749,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
@@ -15552,7 +16874,7 @@ main()
}
EOF
-if { (eval echo configure:15556: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:16878: \"$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
@@ -15576,30 +16898,216 @@ fi
fi
-# Now that ctype is determined for all possible targets, we can do this...
+# Enable/configure some pieces which may require knowledge about the
+# compiler situation (native/cross), which we just finished discovering.
+
+
+ setrlimit_have_headers=yes
+ for ac_hdr in sys/resource.h unistd.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:16911: 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 16916 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:16921: \"$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*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+setrlimit_have_headers=no
+fi
+done
+ # If don't have the headers, then we can't run the tests now, and we
+ # won't be seeing any of these during testsuite compilation.
+ if test $setrlimit_have_headers = yes; then
+ # Can't do these in a loop, else the resulting syntax is wrong.
+
+ cat > conftest.$ac_ext <<EOF
+#line 16954 "configure"
+#include "confdefs.h"
+#include <sys/resource.h>
+ #include <unistd.h>
+
+int main() {
+ int f = RLIMIT_DATA ;
+; return 0; }
+EOF
+if { (eval echo configure:16963: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ glibcpp_mresult=1
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ glibcpp_mresult=0
+fi
+rm -f conftest*
+ cat >> confdefs.h <<EOF
+#define HAVE_MEMLIMIT_DATA $glibcpp_mresult
+EOF
+
+ cat > conftest.$ac_ext <<EOF
+#line 16980 "configure"
+#include "confdefs.h"
+#include <sys/resource.h>
+ #include <unistd.h>
+
+int main() {
+ int f = RLIMIT_RSS ;
+; return 0; }
+EOF
+if { (eval echo configure:16989: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ glibcpp_mresult=1
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ glibcpp_mresult=0
+fi
+rm -f conftest*
+ cat >> confdefs.h <<EOF
+#define HAVE_MEMLIMIT_RSS $glibcpp_mresult
+EOF
+
+ cat > conftest.$ac_ext <<EOF
+#line 17006 "configure"
+#include "confdefs.h"
+#include <sys/resource.h>
+ #include <unistd.h>
+
+int main() {
+ int f = RLIMIT_VMEM ;
+; return 0; }
+EOF
+if { (eval echo configure:17015: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ glibcpp_mresult=1
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ glibcpp_mresult=0
+fi
+rm -f conftest*
+ cat >> confdefs.h <<EOF
+#define HAVE_MEMLIMIT_VMEM $glibcpp_mresult
+EOF
-if test "$NULL_TARGET" = yes; then
- NULL_TARGET_TRUE=
- NULL_TARGET_FALSE='#'
+
+ cat > conftest.$ac_ext <<EOF
+#line 17032 "configure"
+#include "confdefs.h"
+#include <sys/resource.h>
+ #include <unistd.h>
+
+int main() {
+ int f = RLIMIT_AS ;
+; return 0; }
+EOF
+if { (eval echo configure:17041: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ glibcpp_mresult=1
else
- NULL_TARGET_TRUE='#'
- NULL_TARGET_FALSE=
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ glibcpp_mresult=0
fi
+rm -f conftest*
+ cat >> confdefs.h <<EOF
+#define HAVE_MEMLIMIT_AS $glibcpp_mresult
+EOF
+
-if test "$NATIVE" = yes || test "$NULL_TARGET" = yes; then
- NATIVE_TRUE=
- NATIVE_FALSE='#'
+ # Check for rlimit, setrlimit.
+ if eval "test \"`echo '$''{'ac_setrlimit'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+
+ cat > conftest.$ac_ext <<EOF
+#line 17063 "configure"
+#include "confdefs.h"
+#include <sys/resource.h>
+ #include <unistd.h>
+
+int main() {
+ struct rlimit r; setrlimit(0, &r);
+; return 0; }
+EOF
+if { (eval echo configure:17072: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_setrlimit=yes
else
- NATIVE_TRUE='#'
- NATIVE_FALSE=
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_setrlimit=no
fi
+rm -f conftest*
+
+fi
+
+ fi
+
+ echo $ac_n "checking for testsuite memory limit support""... $ac_c" 1>&6
+echo "configure:17088: 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
+#define _GLIBCPP_MEM_LIMITS 1
+EOF
+
+ else
+ ac_mem_limits=no
+ fi
+ echo "$ac_t""$ac_mem_limits" 1>&6
+
+
+
+# Propagate the target-specific source directories through the build chain.
+OS_INC_SRCDIR=$os_include_dir/bits
+ATOMICITY_INC_SRCDIR=$ATOMICITYH/bits
+LIMITS_INC_SRCDIR=$LIMITSH/bits
+
+
+
+
+# Set up cross-compile flags
+
if test "$CANADIAN" = yes; then
@@ -15660,17 +17168,17 @@ rm -f confcache
ac_safe=`echo "locale.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for locale.h""... $ac_c" 1>&6
-echo "configure:15664: checking for locale.h" >&5
+echo "configure:17172: checking for locale.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 15669 "configure"
+#line 17177 "configure"
#include "confdefs.h"
#include <locale.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:15674: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:17182: \"$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*
@@ -15688,19 +17196,19 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
echo "$ac_t""yes" 1>&6
echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6
-echo "configure:15692: checking for LC_MESSAGES" >&5
+echo "configure:17200: checking for LC_MESSAGES" >&5
if eval "test \"`echo '$''{'ac_cv_val_LC_MESSAGES'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 15697 "configure"
+#line 17205 "configure"
#include "confdefs.h"
#include <locale.h>
int main() {
return LC_MESSAGES
; return 0; }
EOF
-if { (eval echo configure:15704: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:17212: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_val_LC_MESSAGES=yes
else
@@ -15732,9 +17240,6 @@ else
multilib_arg=
fi
-
-# Generate the various Makefiles, include files, and scripts.
-
# Needed so that g++ can find the correct include subdir automatically.
INTERFACE=v3
@@ -15744,14 +17249,25 @@ INTERFACE=v3
glibcpp_toolexecdir=no
glibcpp_toolexeclibdir=no
+# Export build and source directories.
+# These need to be absolute paths, yet at the same time need to
+# canonicalize only relative paths, because then amd will not unmount
+# drives. Thus the use of PWDCMD: set it to 'pawd' or 'amq -w' if using amd.
+glibcpp_builddir=`pwd`
+case $srcdir in
+\\/$* | ?:\\/*) glibcpp_srcdir=${srcdir} ;;
+*) glibcpp_srcdir=`cd "$srcdir" && ${PWDCMD-pwd} || echo "$srcdir"` ;;
+esac
+glibcpp_prefixdir=${prefix}
+
echo $ac_n "checking for interface version number""... $ac_c" 1>&6
-echo "configure:15749: checking for interface version number" >&5
+echo "configure:17265: checking for interface version number" >&5
libstdcxx_interface=$INTERFACE
echo "$ac_t""$libstdcxx_interface" 1>&6
# 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:15755: checking for --with-gxx-include-dir" >&5
+echo "configure:17271: 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"
@@ -15775,37 +17291,43 @@ 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:15779: checking for --enable-version-specific-runtime-libs" >&5
+echo "configure:17295: 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"
- version_specific_libs=yes
-# Need the gcc compiler version to know where to install libraries
-# and header files if --enable-version-specific-runtime-libs option
-# is selected.
-gcc_version_trigger=${srcdir}/../gcc/version.c
-gcc_version_full=`grep version_string ${gcc_version_trigger} | sed -e 's/.*\"\([^\"]*\)\".*/\1/'`
-gcc_version=`echo ${gcc_version_full} | sed -e 's/\([^ ]*\) .*/\1/'`
-gxx_include_dir='$(libdir)/gcc-lib/$(target_alias)/'${gcc_version}/include/g++
-glibcpp_toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
-glibcpp_toolexeclibdir='$(toolexecdir)/'${gcc_version}
-
+ case "$enableval" in
+ yes) version_specific_libs=yes ;;
+ no) version_specific_libs=no ;;
+ *) { echo "configure: error: Unknown argument to enable/disable version-specific libs" 1>&2; exit 1; };;
+ esac
else
version_specific_libs=no
fi
-
+# Option set, now we can test it.
echo "$ac_t""$version_specific_libs" 1>&6
+if test $version_specific_libs = yes; then
+ # Need the gcc compiler version to know where to install libraries
+ # and header files if --enable-version-specific-runtime-libs option
+ # is selected.
+ gcc_version_trigger=${srcdir}/../gcc/version.c
+ gcc_version_full=`grep version_string ${gcc_version_trigger} | sed -e 's/.*\"\([^\"]*\)\".*/\1/'`
+ gcc_version=`echo ${gcc_version_full} | sed -e 's/\([^ ]*\) .*/\1/'`
+ gxx_include_dir='$(libdir)/gcc-lib/$(target_alias)/'${gcc_version}/include/g++
+ glibcpp_toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
+ glibcpp_toolexeclibdir='$(toolexecdir)/'${gcc_version}'$(MULTISUBDIR)'
+ fi
+
# Default case for install directory for include files.
-if test x"$version_specific_libs" = x"no" \
- && test x"$gxx_include_dir"=x"no"; then
+if test $version_specific_libs = no &&
+ test $gxx_include_dir = no; then
gxx_include_dir='$(prefix)'/include/g++-${libstdcxx_interface}
fi
# Calculate glibcpp_toolexecdir, glibcpp_toolexeclibdir
# Install a library built with a cross compiler in tooldir, not libdir.
if test x"$glibcpp_toolexecdir" = x"no"; then
- if test x"$with_cross_host" = x"yes"; then
+ if test -n "$with_cross_host" && test x"$with_cross_host" != x"no"; then
glibcpp_toolexecdir='$(exec_prefix)/$(target_alias)'
glibcpp_toolexeclibdir='$(toolexecdir)/lib$(MULTISUBDIR)'
else
@@ -15815,7 +17337,7 @@ if test x"$glibcpp_toolexecdir" = x"no"; then
fi
echo $ac_n "checking for install location""... $ac_c" 1>&6
-echo "configure:15819: checking for install location" >&5
+echo "configure:17341: checking for install location" >&5
echo "$ac_t""$gxx_include_dir" 1>&6
@@ -15823,17 +17345,16 @@ echo "$ac_t""$gxx_include_dir" 1>&6
+
+
+
# Export all the include and flag information to makefiles.
- # Root level of the include sources.
- GLIBCPP_INCLUDE_DIR='$(top_srcdir)/include'
+ # Root level of the build directory include sources.
+ GLIBCPP_INCLUDES="-I${glibcpp_builddir}/include/${target_alias} -I${glibcpp_builddir}/include"
- # Can either use include/c or include/c_std to grab "C" headers. This
- # variable is set to the include directory currently in use.
- # set with C_INCLUDE_DIR in GLIBCPP_ENABLE_CHEADERS
-
# Passed down for canadian crosses.
- if test x"$CANADIAN" = xyes; then
+ if test x"$CANADIAN" = xyes; then
TOPLEVEL_INCLUDES='-I$(includedir)'
fi
@@ -15841,26 +17362,16 @@ echo "$ac_t""$gxx_include_dir" 1>&6
LIBSUPCXX_INCLUDES='-I$(top_srcdir)/libsupc++'
- #if GLIBCPP_NEED_LIBIO
- LIBIO_INCLUDES='-I$(top_builddir)/libio -I$(top_srcdir)/libio'
- #else
- #LIBIO_INCLUDES='-I$(top_srcdir)/libio'
- #endif
-
- #if GLIBCPP_USE_CSHADOW
- # CSHADOW_INCLUDES='-I$(GLIBCPP_INCLUDE_DIR)/std -I$(C_INCLUDE_DIR) \
- # -I$(top_blddir)/cshadow'
- #else
- CSTD_INCLUDES='-I$(GLIBCPP_INCLUDE_DIR)/std -I$(C_INCLUDE_DIR)'
- #endif
+ if test x"$need_libio" = xyes; then
+ LIBIO_INCLUDES='-I$(top_builddir)/libio -I$(top_srcdir)/libio'
+
+ fi
# Now, export this to all the little Makefiles....
-
-
# Optimization flags that are probably a good idea for thrill-seekers. Just
@@ -15873,14 +17384,15 @@ echo "$ac_t""$gxx_include_dir" 1>&6
-# This should be done by mkincludedir, but hack around it now.
-blddir=`pwd`
-echo "checking for $blddir/include"
-
-if test ! -d "$blddir/include"; then
- mkdir "$blddir/include"
+if ${CONFIG_SHELL-/bin/sh} ./libtool --tag CXX --features |
+ grep "enable shared" > /dev/null; then
+ LIBSUPCXX_PICFLAGS=-prefer-pic
+else
+ LIBSUPCXX_PICFLAGS=
fi
+
+# 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
@@ -15987,7 +17499,10 @@ done
ac_given_srcdir=$srcdir
ac_given_INSTALL="$INSTALL"
-trap 'rm -fr `echo "tests_flags mkcheck Makefile src/Makefile libmath/Makefile libio/Makefile libsupc++/Makefile config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
+trap 'rm -fr `echo "Makefile \
+ include/Makefile src/Makefile \
+ libmath/Makefile libio/Makefile libsupc++/Makefile \
+ testsuite/Makefile mkcheck testsuite_flags config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
EOF
cat >> $CONFIG_STATUS <<EOF
@@ -16035,6 +17550,7 @@ s%@build_alias@%$build_alias%g
s%@build_cpu@%$build_cpu%g
s%@build_vendor@%$build_vendor%g
s%@build_os@%$build_os%g
+s%@LN_S@%$LN_S%g
s%@glibcpp_basedir@%$glibcpp_basedir%g
s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
@@ -16048,8 +17564,7 @@ s%@AUTOHEADER@%$AUTOHEADER%g
s%@MAKEINFO@%$MAKEINFO%g
s%@SET_MAKE@%$SET_MAKE%g
s%@CC@%$CC%g
-s%@CXX_libstdcxx@%$CXX_libstdcxx%g
-s%@CXX@%$CXX%g
+s%@glibcpp_CXX@%$glibcpp_CXX%g
s%@AS@%$AS%g
s%@AR@%$AR%g
s%@RANLIB@%$RANLIB%g
@@ -16057,9 +17572,6 @@ s%@MAINTAINER_MODE_TRUE@%$MAINTAINER_MODE_TRUE%g
s%@MAINTAINER_MODE_FALSE@%$MAINTAINER_MODE_FALSE%g
s%@MAINT@%$MAINT%g
s%@EXEEXT@%$EXEEXT%g
-s%@GLIBCPP_CFLAGS@%$GLIBCPP_CFLAGS%g
-s%@GLIBCPP_CXXFLAGS@%$GLIBCPP_CXXFLAGS%g
-s%@LN_S@%$LN_S%g
s%@OBJEXT@%$OBJEXT%g
s%@STRIP@%$STRIP%g
s%@LIBTOOL@%$LIBTOOL%g
@@ -16069,6 +17581,9 @@ s%@enable_static@%$enable_static%g
s%@ifGNUmake@%$ifGNUmake%g
s%@DEBUG_FLAGS@%$DEBUG_FLAGS%g
s%@CPP@%$CPP%g
+s%@CSTDIO_H@%$CSTDIO_H%g
+s%@BASIC_FILE_H@%$BASIC_FILE_H%g
+s%@CCODECVT_C@%$CCODECVT_C%g
s%@GLIBCPP_BUILD_LIBIO_TRUE@%$GLIBCPP_BUILD_LIBIO_TRUE%g
s%@GLIBCPP_BUILD_LIBIO_FALSE@%$GLIBCPP_BUILD_LIBIO_FALSE%g
s%@GLIBCPP_NEED_LIBIO_TRUE@%$GLIBCPP_NEED_LIBIO_TRUE%g
@@ -16076,36 +17591,39 @@ s%@GLIBCPP_NEED_LIBIO_FALSE@%$GLIBCPP_NEED_LIBIO_FALSE%g
s%@GLIBCPP_NEED_WLIBIO_TRUE@%$GLIBCPP_NEED_WLIBIO_TRUE%g
s%@GLIBCPP_NEED_WLIBIO_FALSE@%$GLIBCPP_NEED_WLIBIO_FALSE%g
s%@libio_la@%$libio_la%g
+s%@CLOCALE_H@%$CLOCALE_H%g
s%@CSHADOW_FLAGS@%$CSHADOW_FLAGS%g
s%@C_INCLUDE_DIR@%$C_INCLUDE_DIR%g
s%@GLIBCPP_USE_CSHADOW_TRUE@%$GLIBCPP_USE_CSHADOW_TRUE%g
s%@GLIBCPP_USE_CSHADOW_FALSE@%$GLIBCPP_USE_CSHADOW_FALSE%g
+s%@glibcpp_thread_h@%$glibcpp_thread_h%g
s%@EXTRA_CXX_FLAGS@%$EXTRA_CXX_FLAGS%g
-s%@WFMT_FLAGS@%$WFMT_FLAGS%g
s%@SECTION_FLAGS@%$SECTION_FLAGS%g
s%@SECTION_LDFLAGS@%$SECTION_LDFLAGS%g
s%@OPT_LDFLAGS@%$OPT_LDFLAGS%g
s%@LIBMATHOBJS@%$LIBMATHOBJS%g
s%@USE_COMPLEX_LONG_DOUBLE@%$USE_COMPLEX_LONG_DOUBLE%g
-s%@libinst_wstring_la@%$libinst_wstring_la%g
s%@WERROR@%$WERROR%g
-s%@NULL_TARGET_TRUE@%$NULL_TARGET_TRUE%g
-s%@NULL_TARGET_FALSE@%$NULL_TARGET_FALSE%g
-s%@NATIVE_TRUE@%$NATIVE_TRUE%g
-s%@NATIVE_FALSE@%$NATIVE_FALSE%g
+s%@OS_INC_SRCDIR@%$OS_INC_SRCDIR%g
+s%@ATOMICITY_INC_SRCDIR@%$ATOMICITY_INC_SRCDIR%g
+s%@LIMITS_INC_SRCDIR@%$LIMITS_INC_SRCDIR%g
+s%@GLIBCPP_IS_CROSS_COMPILING@%$GLIBCPP_IS_CROSS_COMPILING%g
s%@CANADIAN_TRUE@%$CANADIAN_TRUE%g
s%@CANADIAN_FALSE@%$CANADIAN_FALSE%g
+s%@glibcpp_builddir@%$glibcpp_builddir%g
+s%@glibcpp_srcdir@%$glibcpp_srcdir%g
+s%@glibcpp_prefixdir@%$glibcpp_prefixdir%g
s%@gxx_include_dir@%$gxx_include_dir%g
s%@glibcpp_toolexecdir@%$glibcpp_toolexecdir%g
s%@glibcpp_toolexeclibdir@%$glibcpp_toolexeclibdir%g
-s%@GLIBCPP_INCLUDE_DIR@%$GLIBCPP_INCLUDE_DIR%g
+s%@LIBIO_INCLUDES@%$LIBIO_INCLUDES%g
+s%@GLIBCPP_INCLUDES@%$GLIBCPP_INCLUDES%g
s%@TOPLEVEL_INCLUDES@%$TOPLEVEL_INCLUDES%g
s%@LIBMATH_INCLUDES@%$LIBMATH_INCLUDES%g
s%@LIBSUPCXX_INCLUDES@%$LIBSUPCXX_INCLUDES%g
-s%@LIBIO_INCLUDES@%$LIBIO_INCLUDES%g
-s%@CSTD_INCLUDES@%$CSTD_INCLUDES%g
s%@OPTIMIZE_CXXFLAGS@%$OPTIMIZE_CXXFLAGS%g
s%@WARN_FLAGS@%$WARN_FLAGS%g
+s%@LIBSUPCXX_PICFLAGS@%$LIBSUPCXX_PICFLAGS%g
CEOF
EOF
@@ -16147,7 +17665,10 @@ EOF
cat >> $CONFIG_STATUS <<EOF
-CONFIG_FILES=\${CONFIG_FILES-"tests_flags mkcheck Makefile src/Makefile libmath/Makefile libio/Makefile libsupc++/Makefile"}
+CONFIG_FILES=\${CONFIG_FILES-"Makefile \
+ include/Makefile src/Makefile \
+ libmath/Makefile libio/Makefile libsupc++/Makefile \
+ testsuite/Makefile mkcheck testsuite_flags"}
EOF
cat >> $CONFIG_STATUS <<\EOF
for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
@@ -16316,11 +17837,8 @@ fi; done
EOF
cat >> $CONFIG_STATUS <<EOF
-ac_sources="$os_include_dir/bits/os_defines.h $CSTDIO_H $CSTDIO_CC $CCODECVT_C $CLOCALE_H $CLOCALE_CC config/$THREADH $os_include_dir/bits/ctype_base.h $os_include_dir/bits/ctype_inline.h $os_include_dir/bits/ctype_noninline.h $ATOMICITYH/bits/atomicity.h"
-ac_dests="include/bits/os_defines.h include/bits/c++io.h src/c++io.cc libio/c_codecvt.c include/bits/c++locale.h src/c++locale.cc include/bits/c++threads.h \
-include/bits/ctype_base.h \
-include/bits/ctype_inline.h \
-include/bits/ctype_noninline.h include/bits/atomicity.h"
+ac_sources="$BASIC_FILE_CC $CLOCALE_CC"
+ac_dests="src/basic_file.cc src/c++locale.cc"
EOF
cat >> $CONFIG_STATUS <<\EOF
@@ -16382,8 +17900,8 @@ if test -n "$CONFIG_FILES"; then
grep '^MULTISUBDIR =' Makefile >> src/Makefile
grep '^MULTISUBDIR =' Makefile >> libsupc++/Makefile
fi
-chmod +x tests_flags
chmod +x mkcheck
+chmod +x testsuite_flags
exit 0
EOF
@@ -16393,22 +17911,6 @@ test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
-# Generate bits/c++config.h
-# NB: This must be the first generated file as others include it. . .
-$srcdir/mkc++config $blddir $srcdir
-
-# Generate bits/std_limits.h and src/limitsMEMBERS.cc
-if test ! -f stamp-limits; then
- $srcdir/mknumeric_limits $blddir $srcdir $xcompiling
- if test ! -f include/bits/std_limits.h; then
- echo "mknumeric_limits failed to execute properly: exiting"
- exit 1
- else
- touch stamp-limits
- fi
-fi
-
-
# Sanity checking & User-visible messages.
# Checks down here, otherwise they get scrolled off before
# the user will notice.
diff --git a/libstdc++-v3/configure.host b/libstdc++-v3/configure.host
index 65d256fae74..db3c57a06f8 100644
--- a/libstdc++-v3/configure.host
+++ b/libstdc++-v3/configure.host
@@ -15,8 +15,6 @@
# target_optspace --enable-target-optspace ("yes", "no", "")
# It sets the following shell variables:
-# glibcpp_cflags Special CFLAGS to use when building
-# glibcpp_cxxflags Special CXXFLAGS to use when building
AM_RUNTESTFLAGS=
@@ -25,17 +23,9 @@ AM_RUNTESTFLAGS=
# THIS TABLE IS SORTED. KEEP IT THAT WAY.
-DIVIDESPEC=-fuse-divide-subroutine
-
case "${host}" in
- i686-*|i586-*)
- ;;
- sparc-*)
- ;;
*)
- ;;
+ ;;
esac
-glibcpp_cflags="${glibcpp_cflags} ${libgcj_flags}"
-glibcpp_cxxflags="${glibcpp_cxxflags} ${libgcj_flags}"
diff --git a/libstdc++-v3/configure.in b/libstdc++-v3/configure.in
index 2342adea862..355a447aced 100644
--- a/libstdc++-v3/configure.in
+++ b/libstdc++-v3/configure.in
@@ -11,29 +11,34 @@ AC_INIT(src/ios.cc)
# source directory.
if test "${srcdir}" = "."; then
if test -z "${with_target_subdir}"; then
- toplevel_srcdir="\${top_srcdir}/.."
- auxdir="${srcdir}/.."
+ toprel=".."
else
if test "${with_target_subdir}" != "."; then
- toplevel_srcdir="\${top_srcdir}/${with_multisrctop}../.."
- auxdir="${srcdir}/${with_multisrctop}../.."
+ toprel="${with_multisrctop}../.."
else
- toplevel_srcdir="\${top_srcdir}/${with_multisrctop}.."
- auxdir="${srcdir}/${with_multisrctop}.."
+ toprel="${with_multisrctop}.."
fi
fi
else
- toplevel_srcdir="\${top_srcdir}/.."
- auxdir="${srcdir}/.."
+ toprel=".."
fi
-AC_CONFIG_AUX_DIR($auxdir)
+AC_CONFIG_AUX_DIR(${srcdir}/$toprel)
+toplevel_srcdir=\${top_srcdir}/$toprel
AC_SUBST(toplevel_srcdir)
dnl This is here just to satisfy automake.
ifelse(not,equal,[AC_CONFIG_AUX_DIR(..)])
# Gets and sets build, host, target, *_vendor, *_cpu, *_os, etc.
+# AC 2.50 sets target_alias iff the user specified --target, but we use it
+# everywhere, so we set it here just to be sure.
AC_CANONICAL_SYSTEM
+target_alias=${target_alias-$target}
+AC_SUBST(target_alias)
+
+# Will set LN_S to either 'ln -s' or 'ln'. With autoconf 2.50+, can also
+# be 'cp -p' if linking isn't available.
+AC_PROG_LN_S
# We use these options to decide which functions to include.
AC_ARG_WITH(target-subdir,
@@ -51,9 +56,7 @@ AM_PROG_LIBTOOL
AC_SUBST(enable_shared)
AC_SUBST(enable_static)
GLIBCPP_CHECK_GNU_MAKE
- if test "x$_cv_gnu_make_command" = "x"; then
- AC_MSG_ERROR([GNU make not found. Please install it or correct your path.])
- fi
+
AM_CONFIG_HEADER(config.h)
# Check for c++ or library specific bits that don't require linking.
@@ -64,27 +67,28 @@ GLIBCPP_ENABLE_DEBUG($USE_MAINTAINER_MODE)
GLIBCPP_ENABLE_CSTDIO
GLIBCPP_ENABLE_CLOCALE
GLIBCPP_ENABLE_C_MBCHAR([yes])
-GLIBCPP_ENABLE_LONG_LONG([no])
+GLIBCPP_ENABLE_C99([yes])
+GLIBCPP_ENABLE_LONG_LONG([yes])
GLIBCPP_ENABLE_CHEADERS([c_std])
GLIBCPP_ENABLE_THREADS
GLIBCPP_ENABLE_CXX_FLAGS([none])
+GLIBCPP_ENABLE_SJLJ_EXCEPTIONS
-if test -n "$with_cross_host"; then
+if test -n "$with_cross_host" || test x"$build" != x"$host"; then
- # We are being configured with a cross compiler. AC_REPLACE_FUNCS
- # may not work correctly, because the compiler may not be able to
- # link executables.
- xcompiling=1
- NATIVE=no
+ # We are being configured with some form of cross compiler.
+ # mknumeric_limits may not work correctly, either because the
+ # compiler may not run on this machine, may not be able to link
+ # executables, or may produce executables we can't run on this
+ # machine.
+ GLIBCPP_IS_CROSS_COMPILING=1
# If Canadian cross, then don't pick up tools from the build
# directory.
- if test x"$build" != x"$with_cross_host" && x"$build" != x"$target"; then
+ if test -n "$with_cross_host" && test x"$build" != x"$with_cross_host"; then
CANADIAN=yes
- NULL_TARGET=yes
else
CANADIAN=no
- NULL_TARGET=no
fi
case "$target_alias" in
@@ -96,9 +100,7 @@ if test -n "$with_cross_host"; then
float.h inttypes.h])
# GLIBCPP_CHECK_COMPILER_FEATURES
- WFMT_FLAGS='-fdiagnostics-show-location=once'
SECTION_FLAGS='-ffunction-sections -fdata-sections'
- AC_SUBST(WFMT_FLAGS)
AC_SUBST(SECTION_FLAGS)
GLIBCPP_CHECK_LINKER_FEATURES
# GLIBCPP_CHECK_BUILTIN_MATH_SUPPORT
@@ -169,7 +171,6 @@ if test -n "$with_cross_host"; then
AC_DEFINE(HAVE_TANHL)
fi
GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
- GLIBCPP_CHECK_COMPLEX_MATH_COMPILER_SUPPORT
GLIBCPP_CHECK_WCHAR_T_SUPPORT
os_include_dir="config/os/gnu-linux"
# GLIBCPP_CHECK_STDLIB_SUPPORT
@@ -189,8 +190,6 @@ if test -n "$with_cross_host"; then
os_include_dir="config/os/newlib"
- AC_DEFINE(_GLIBCPP_BUGGY_FLOAT_COMPLEX)
- AC_DEFINE(_GLIBCPP_BUGGY_COMPLEX)
# need to check for faster f versions of math functions, ie sinf?
;;
esac
@@ -199,10 +198,8 @@ else
# We are being configured natively. We can do more elaborate tests
# that include AC_TRY_COMPILE now, as the linker is assumed to be
# working.
- xcompiling=0
- NATIVE=yes
+ GLIBCPP_IS_CROSS_COMPILING=0
CANADIAN=no
- NULL_TARGET=no
# Check for available headers.
AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h machine/endian.h \
@@ -213,7 +210,6 @@ else
GLIBCPP_CHECK_BUILTIN_MATH_SUPPORT
GLIBCPP_CHECK_MATH_SUPPORT
GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
- GLIBCPP_CHECK_COMPLEX_MATH_COMPILER_SUPPORT
GLIBCPP_CHECK_WCHAR_T_SUPPORT
GLIBCPP_CHECK_STDLIB_SUPPORT
@@ -225,17 +221,20 @@ else
AC_FUNC_MMAP
fi
-# Now that ctype is determined for all possible targets, we can do this...
-AC_LINK_FILES($os_include_dir/bits/ctype_base.h, \
-include/bits/ctype_base.h)
-AC_LINK_FILES($os_include_dir/bits/ctype_inline.h, \
-include/bits/ctype_inline.h)
-AC_LINK_FILES($os_include_dir/bits/ctype_noninline.h, \
-include/bits/ctype_noninline.h)
-AC_LINK_FILES($ATOMICITYH/bits/atomicity.h, include/bits/atomicity.h)
-
-AM_CONDITIONAL(NULL_TARGET, test "$NULL_TARGET" = yes)
-AM_CONDITIONAL(NATIVE, test "$NATIVE" = yes || test "$NULL_TARGET" = yes)
+# Enable/configure some pieces which may require knowledge about the
+# compiler situation (native/cross), which we just finished discovering.
+GLIBCPP_CONFIGURE_TESTSUITE
+
+# Propagate the target-specific source directories through the build chain.
+OS_INC_SRCDIR=$os_include_dir/bits
+ATOMICITY_INC_SRCDIR=$ATOMICITYH/bits
+LIMITS_INC_SRCDIR=$LIMITSH/bits
+AC_SUBST(OS_INC_SRCDIR)
+AC_SUBST(ATOMICITY_INC_SRCDIR)
+AC_SUBST(LIMITS_INC_SRCDIR)
+
+# Set up cross-compile flags
+AC_SUBST(GLIBCPP_IS_CROSS_COMPILING)
AM_CONDITIONAL(CANADIAN, test "$CANADIAN" = yes)
AC_CACHE_SAVE
@@ -247,9 +246,6 @@ else
multilib_arg=
fi
-
-# Generate the various Makefiles, include files, and scripts.
-
# Needed so that g++ can find the correct include subdir automatically.
INTERFACE=v3
@@ -260,27 +256,31 @@ GLIBCPP_EXPORT_INSTALL_INFO
GLIBCPP_EXPORT_INCLUDES
GLIBCPP_EXPORT_FLAGS
-# This should be done by mkincludedir, but hack around it now.
-blddir=`pwd`
-echo "checking for $blddir/include"
-
-if test ! -d "$blddir/include"; then
- mkdir "$blddir/include"
+if ${CONFIG_SHELL-/bin/sh} ./libtool --tag CXX --features |
+ grep "enable shared" > /dev/null; then
+ LIBSUPCXX_PICFLAGS=-prefer-pic
+else
+ LIBSUPCXX_PICFLAGS=
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 ->
# top_srcdir/{src,libsupc++}/Makefile.am, manually append it here.
-AC_OUTPUT(tests_flags mkcheck Makefile src/Makefile libmath/Makefile libio/Makefile libsupc++/Makefile,
+AC_OUTPUT(Makefile \
+ include/Makefile src/Makefile \
+ libmath/Makefile libio/Makefile libsupc++/Makefile \
+ testsuite/Makefile mkcheck testsuite_flags,
[if test -n "$CONFIG_FILES"; then
ac_file=Makefile . ${glibcpp_basedir}/../config-ml.in
grep '^MULTISUBDIR =' Makefile >> src/Makefile
grep '^MULTISUBDIR =' Makefile >> libsupc++/Makefile
fi
-chmod +x tests_flags
chmod +x mkcheck
+chmod +x testsuite_flags
],
srcdir=${srcdir}
host=${host}
@@ -294,22 +294,6 @@ CXX="${CXX}"
)
-# Generate bits/c++config.h
-# NB: This must be the first generated file as others include it. . .
-$srcdir/mkc++config $blddir $srcdir
-
-# Generate bits/std_limits.h and src/limitsMEMBERS.cc
-if test ! -f stamp-limits; then
- $srcdir/mknumeric_limits $blddir $srcdir $xcompiling
- if test ! -f include/bits/std_limits.h; then
- echo "mknumeric_limits failed to execute properly: exiting"
- exit 1
- else
- touch stamp-limits
- fi
-fi
-
-
# Sanity checking & User-visible messages.
# Checks down here, otherwise they get scrolled off before
# the user will notice.
diff --git a/libstdc++-v3/configure.target b/libstdc++-v3/configure.target
index f5dae7ca318..1221f267798 100644
--- a/libstdc++-v3/configure.target
+++ b/libstdc++-v3/configure.target
@@ -16,17 +16,8 @@
# target_optspace --enable-target-optspace ("yes", "no", "")
# It possibly modifies the following shell variables:
-# glibcpp_cflags Special CFLAGS to use when building
-# glibcpp_cxxflags Special CXXFLAGS to use when building
# cpu_include_dir CPU-specific include directory, relative to srcdir
# os_include_dir OS-specific include directory, relative to srcdir
-# The first two are set in configure.host and modified here.
-
-
-# These are "local" and should be set in the switch statements below. They
-# will be appended to their real conterparts once the dust settles.
-l_glibcpp_cflags=
-l_glibcpp_cxxflags=
# Set any CPU dependent compiler flags.
@@ -48,9 +39,15 @@ case "${target_cpu}" in
i486 | i586 | i686 | i786)
cpu_include_dir="config/cpu/i486"
;;
+ m68k | m680[246]0)
+ cpu_include_dir="config/cpu/m68k"
+ ;;
powerpc | rs6000)
cpu_include_dir="config/cpu/powerpc"
;;
+ s390 | s390x)
+ cpu_include_dir="config/cpu/s390"
+ ;;
sparc64 | ultrasparc)
cpu_include_dir="config/cpu/sparc/sparc64"
;;
@@ -69,17 +66,7 @@ esac
case "${target_os}" in
aix4.[3456789]* | aix[56789]*)
os_include_dir="config/os/aix"
- case "$CXX" in
- *pthread*)
- enable_threads='posix'
- ;;
- *)
- enable_threads='no'
- ;;
- esac
- ;;
- aix*)
- os_include_dir="config/os/aix"
+ OPT_LDFLAGS="-Wl,-G"
;;
bsd* | freebsd* )
os_include_dir="config/os/bsd/freebsd"
@@ -93,8 +80,12 @@ case "${target_os}" in
linux* | gnu*)
os_include_dir="config/os/gnu-linux"
;;
- irix*)
- os_include_dir="config/os/irix"
+ irix[1-6] | irix[1-5].* | irix6.[0-4])
+ # This is known to work on at least IRIX 5.2 and 6.3.
+ os_include_dir="config/os/irix/irix5.2"
+ ;;
+ irix6.5)
+ os_include_dir="config/os/irix/irix6.5"
;;
netbsd*)
os_include_dir="config/os/bsd/netbsd"
@@ -121,8 +112,15 @@ esac
# THIS TABLE IS SORTED. KEEP IT THAT WAY.
case "${target}" in
+ *-*-aix[456789]*)
+ # We set os_include_dir to config/os/aix only on AIX 4.3 and
+ # newer, but config/os/aix/bits/atomicity.h works on earlier
+ # versions of AIX 4.*, so we explicitly duplicate the directory
+ # here, because os_include_dir.
+ ATOMICITYH=config/os/aix
+ ;;
*-*-aix*)
- ATOMICITYH=$os_include_dir
+ ATOMICITYH=config/cpu/generic
;;
*-*-irix*)
ATOMICITYH=$os_include_dir
@@ -131,11 +129,19 @@ case "${target}" in
ATOMICITYH=$cpu_include_dir
;;
esac
-
-
-# Okay, folks, show's over. Move along, move along.
-
-glibcpp_cflags="${glibcpp_cflags} ${libgcj_flags} ${l_glibcpp_cflags}"
-glibcpp_cxxflags="${glibcpp_cxxflags} ${libgcj_flags} ${l_glibcpp_cxxflags}"
+# Set LIMITSH to the directory where the configuration-dependent
+# limits.h can be found.
+# THIS TABLE IS SORTED. KEEP IT THAT WAY.
+case "${target}" in
+ i?86-*-*)
+ LIMITSH=config/cpu/i386
+ ;;
+ powerpc-*-*)
+ LIMITSH=config/cpu/powerpc
+ ;;
+ *)
+ LIMITSH=config/cpu/generic
+ ;;
+esac
diff --git a/libstdc++-v3/docs/doxygen/mainpage.doxy b/libstdc++-v3/docs/doxygen/mainpage.doxy
new file mode 100644
index 00000000000..a05692b8f78
--- /dev/null
+++ b/libstdc++-v3/docs/doxygen/mainpage.doxy
@@ -0,0 +1,62 @@
+/*! \mainpage
+
+<h2> documentation overview </h2>
+
+<p>
+There are two types of documentation for libstdc++-v3. One is the distribution documentation, which can be read
+<a href="http://gcc.gnu.org/onlinedocs/libstdc++/documentation.html">here</a>.
+</p>
+
+<p>
+The other is the source documentation, of which this is the first page.
+</p>
+
+<h2> generating this file </h2>
+<p>
+This page is automatically generated. The Makefile rule <tt>make
+doxygen</tt> in the libstdc++-v3 build directory generates these pages
+using a tool called, appropriately enough, doxygen. To learn more
+about doxygen, take a look at <a href="http://www.doxygen.org"> the
+doxygen webpage </a>.
+</p>
+
+<p>
+The libstdc++-v3 configuration files needed to generate doxygen output
+are located:
+<p> <tt> docs/doxygen/user.cfg.in</tt> </p>
+<p> <tt> docs/doxygen/maint.cfg.in</tt> </p>
+</p>
+
+<h2> libstdc++-v3 doxygen style guide </h2>
+<p>
+In general, libstdc++-v3 files should be formatted according to the
+GNU C++ Coding Standard rules found in the file <a
+href="http://gcc.gnu.org/onlinedocs/libstdc++/17_intro/C++STYLE">C++STYLE</a>.
+Before any doxygen-specific formatting tweaks are made, please try to
+make sure that the initial formatting is sound.
+</p>
+
+<p>
+The formatting guidelines for using libstdc++-v3 with doxygen are
+still incomplete. There seems to be a marginal preference for the use
+of Java-Doc style formatting, with the idea that the single-line style
+(triple-slash) is the least intrusive mechanism for getting
+libstdc++-v3 documented and cross-referenced while at the same time
+minimizing disruption to the current formatting.
+</p>
+
+<p>
+For the time being, please see <tt>include/bits/char_traits.h</tt>
+which is the test bed for a finished doxygen style guide.
+</p>
+
+*/
+
+
+
+
+
+
+
+
+
diff --git a/libstdc++-v3/docs/doxygen/maint.cfg.in b/libstdc++-v3/docs/doxygen/maint.cfg.in
new file mode 100644
index 00000000000..10c43d41320
--- /dev/null
+++ b/libstdc++-v3/docs/doxygen/maint.cfg.in
@@ -0,0 +1,740 @@
+# Doxyfile 1.2.4
+
+# This file describes the settings to be used by doxygen for a project
+#
+# All text after a hash (#) is considered a comment and will be ignored
+# The format is:
+# TAG = value [value, ...]
+# For lists items can also be appended using:
+# TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ")
+
+#---------------------------------------------------------------------------
+# General configuration options
+#---------------------------------------------------------------------------
+
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
+# by quotes) that should identify the project.
+
+PROJECT_NAME = "libstdc++"
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number.
+# This could be handy for archiving the generated documentation or
+# if some version control system is used.
+
+PROJECT_NUMBER = 3
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
+# base path where the generated documentation will be put.
+# If a relative path is entered, it will be relative to the location
+# where doxygen was started. If left blank the current directory will be used.
+### Currently this is not really run through autoconf; it just looks that way.
+OUTPUT_DIRECTORY = @outdir@
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all constant output in the proper language.
+# The default language is English, other supported languages are:
+# Dutch, French, Italian, Czech, Swedish, German, Finnish, Japanese,
+# Korean, Hungarian, Norwegian, Spanish, Romanian, Russian, Croatian,
+# Polish, Portuguese and Slovene.
+
+OUTPUT_LANGUAGE = English
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
+# documentation are documented, even if no documentation was available.
+# Private class members and static file members will be hidden unless
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+
+#EXTRACT_ALL = NO
+EXTRACT_ALL = YES
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
+# will be included in the documentation.
+
+EXTRACT_PRIVATE = YES
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file
+# will be included in the documentation.
+
+EXTRACT_STATIC = YES
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
+# undocumented members of documented classes, files or namespaces.
+# If set to NO (the default) these members will be included in the
+# various overviews, but no documentation section is generated.
+# This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_MEMBERS = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy.
+# If set to NO (the default) these class will be included in the various
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_CLASSES = NO
+
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
+# include brief member descriptions after the members that are listed in
+# the file and class documentation (similar to JavaDoc).
+# Set to NO to disable this.
+
+BRIEF_MEMBER_DESC = NO
+
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
+# the brief description of a member or function before the detailed description.
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# brief descriptions will be completely suppressed.
+
+REPEAT_BRIEF = YES
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
+# Doxygen will generate a detailed section even if there is only a brief
+# description.
+
+ALWAYS_DETAILED_SEC = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
+# path before files name in the file list and in the header files. If set
+# to NO the shortest path that makes the file name unique will be used.
+
+FULL_PATH_NAMES = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
+# can be used to strip a user defined part of the path. Stripping is
+# only done if one of the specified strings matches the left-hand part of
+# the path. It is allowed to use relative paths in the argument list.
+
+STRIP_FROM_PATH =
+
+# The INTERNAL_DOCS tag determines if documentation
+# that is typed after a \internal command is included. If the tag is set
+# to NO (the default) then the documentation will be excluded.
+# Set it to YES to include the internal documentation.
+
+INTERNAL_DOCS = NO
+
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
+# generate a class diagram (in Html and LaTeX) for classes with base or
+# super classes. Setting the tag to NO turns the diagrams off.
+
+CLASS_DIAGRAMS = NO
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will
+# be generated. Documented entities will be cross-referenced with these sources.
+
+SOURCE_BROWSER = NO
+
+# Setting the INLINE_SOURCES tag to YES will include the body
+# of functions and classes directly in the documentation.
+
+INLINE_SOURCES = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
+# doxygen to hide any special comment blocks from generated source code
+# fragments. Normal C and C++ comments will always remain visible.
+
+STRIP_CODE_COMMENTS = YES
+
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
+# file names in lower case letters. If set to YES upper case letters are also
+# allowed. This is useful if you have classes or files whose names only differ
+# in case and if your file system supports case sensitive file names. Windows
+# users are adviced to set this option to NO.
+
+CASE_SENSE_NAMES = YES
+
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
+# will show members with their full class and namespace scopes in the
+# documentation. If set to YES the scope will be hidden.
+
+HIDE_SCOPE_NAMES = NO
+
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
+# will generate a verbatim copy of the header file for each class for
+# which an include is specified. Set to NO to disable this.
+
+VERBATIM_HEADERS = NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
+# will put list of the files that are included by a file in the documentation
+# of that file.
+
+SHOW_INCLUDE_FILES = YES
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
+# will interpret the first line (until the first dot) of a JavaDoc-style
+# comment as the brief description. If set to NO, the JavaDoc
+# comments will behave just like the Qt-style comments (thus requiring an
+# explict @brief command for a brief description.
+
+JAVADOC_AUTOBRIEF = NO
+
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
+# member inherits the documentation from any documented member that it
+# reimplements.
+
+INHERIT_DOCS = YES
+
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
+# is inserted in the documentation for inline members.
+
+INLINE_INFO = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
+# will sort the (detailed) documentation of file and class members
+# alphabetically by member name. If set to NO the members will appear in
+# declaration order.
+
+SORT_MEMBER_DOCS = NO
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
+# tag is set to YES, then doxygen will reuse the documentation of the first
+# member in the group (if any) for the other members of the group. By default
+# all members of a group must be documented explicitly.
+
+#DISTRIBUTE_GROUP_DOC = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab.
+# Doxygen uses this value to replace tabs by spaces in code fragments.
+
+TAB_SIZE = 4
+
+# The ENABLE_SECTIONS tag can be used to enable conditional
+# documentation sections, marked by \if sectionname ... \endif.
+
+ENABLED_SECTIONS =
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or
+# disable (NO) the todo list. This list is created by putting \todo
+# commands in the documentation.
+
+GENERATE_TODOLIST = YES
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or
+# disable (NO) the test list. This list is created by putting \test
+# commands in the documentation.
+
+GENERATE_TESTLIST = YES
+
+# This tag can be used to specify a number of aliases that acts
+# as commands in the documentation. An alias has the form "name=value".
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to
+# put the command \sideeffect (or @sideeffect) in the documentation, which
+# will result in a user defined paragraph with heading "Side Effects:".
+# You can put \n's in the value part of an alias to insert newlines.
+
+#ALIASES =
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
+
+QUIET = YES
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are
+# generated by doxygen. Possible values are YES and NO. If left blank
+# NO is used.
+
+### pme Turned off; apparently doxygen can't grok templates
+WARNINGS = NO
+
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
+# automatically be disabled.
+
+WARN_IF_UNDOCUMENTED = YES
+
+# The WARN_FORMAT tag determines the format of the warning messages that
+# doxygen can produce. The string should contain the $file, $line, and $text
+# tags, which will be replaced by the file and line number from which the
+# warning originated and the warning text.
+
+WARN_FORMAT = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning
+# and error messages should be written. If left blank the output is written
+# to stderr.
+
+#WARN_LOGFILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain
+# documented source files. You may enter file names like "myfile.cpp" or
+# directories like "/usr/src/myproject". Separate the files or directories
+# with spaces.
+
+INPUT = include src libmath libsupc++ libio config
+
+# If the value of the INPUT tag contains directories, you can use the
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank all files are included.
+
+FILE_PATTERNS = *.cc *.h c++config
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories
+# should be searched for input files as well. Possible values are YES and NO.
+# If left blank NO is used.
+
+RECURSIVE = YES
+
+# The EXCLUDE tag can be used to specify files and/or directories that should
+# excluded from the INPUT source files. This way you can easily exclude a
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+EXCLUDE =
+
+# If the value of the INPUT tag contains directories, you can use the
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
+# certain files from those directories.
+
+EXCLUDE_PATTERNS =
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or
+# directories that contain example code fragments that are included (see
+# the \include command).
+
+EXAMPLE_PATH =
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank all files are included.
+
+EXAMPLE_PATTERNS =
+
+# The IMAGE_PATH tag can be used to specify one or more files or
+# directories that contain image that are included in the documentation (see
+# the \image command).
+
+IMAGE_PATH =
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should
+# invoke to filter for each input file. Doxygen will invoke the filter program
+# by executing (via popen()) the command <filter> <input-file>, where <filter>
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
+# input file. Doxygen will then use the output that the filter program writes
+# to standard output.
+
+INPUT_FILTER =
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
+# INPUT_FILTER) will be used to filter the input files when producing source
+# files to browse.
+
+#FILTER_SOURCE_FILES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
+# of all compounds will be generated. Enable this if the project
+# contains a lot of classes, structs, unions or interfaces.
+
+ALPHABETICAL_INDEX = YES
+
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
+# in which this list will be split (can be a number in the range [1..20])
+
+COLS_IN_ALPHA_INDEX = 5
+
+# In case all classes in a project start with a common prefix, all
+# classes will be put under the same header in the alphabetical index.
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
+# should be ignored while generating the index headers.
+
+IGNORE_PREFIX =
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
+# generate HTML output.
+
+GENERATE_HTML = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `html' will be used as the default path.
+
+HTML_OUTPUT = html_maint
+
+# The HTML_HEADER tag can be used to specify a personal HTML header for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard header.
+
+HTML_HEADER =
+
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard footer.
+
+HTML_FOOTER =
+
+# The HTML_STYLESHEET tag can be used to specify a user defined cascading
+# style sheet that is used by each HTML page. It can be used to
+# fine-tune the look of the HTML output. If the tag is left blank doxygen
+# will generate a default style sheet
+
+HTML_STYLESHEET =
+
+# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
+# files or namespaces will be aligned in HTML using tables. If set to
+# NO a bullet list will be used.
+
+HTML_ALIGN_MEMBERS = YES
+
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files
+# will be generated that can be used as input for tools like the
+# Microsoft HTML help workshop to generate a compressed HTML help file (.chm)
+# of the generated HTML documentation.
+
+GENERATE_HTMLHELP = NO
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
+# top of each HTML page. The value NO (the default) enables the index and
+# the value YES disables it.
+
+DISABLE_INDEX = NO
+
+# This tag can be used to set the number of enum values (range [1..20])
+# that doxygen will group on one line in the generated HTML documentation.
+
+#ENUM_VALUES_PER_LINE = 4
+
+# If the GENERATE_TREEVIEW tag is set to YES, a side pannel will be
+# generated containing a tree-like index structure (just like the one that
+# is generated for HTML Help). For this to work a browser that supports
+# JavaScript and frames is required (for instance Netscape 4.0+
+# or Internet explorer 4.0+).
+
+GENERATE_TREEVIEW = YES
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
+# used to set the initial width (in pixels) of the frame in which the tree
+# is shown.
+
+#TREEVIEW_WIDTH = 250
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
+# generate Latex output.
+
+GENERATE_LATEX = NO
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `latex' will be used as the default path.
+
+LATEX_OUTPUT = latex
+
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
+# LaTeX documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_LATEX = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used
+# by the printer. Possible values are: a4, a4wide, letter, legal and
+# executive. If left blank a4wide will be used.
+
+PAPER_TYPE = letter
+
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
+# packages that should be included in the LaTeX output.
+
+EXTRA_PACKAGES =
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
+# the generated latex document. The header should contain everything until
+# the first chapter. If it is left blank doxygen will generate a
+# standard header. Notice: only use this tag if you know what you are doing!
+
+LATEX_HEADER =
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will
+# contain links (just like the HTML output) instead of page references
+# This makes the output suitable for online browsing using a pdf viewer.
+
+PDF_HYPERLINKS = NO
+
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
+# plain latex in the generated Makefile. Set this option to YES to get a
+# higher quality PDF documentation.
+
+USE_PDFLATEX = NO
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
+# command to the generated LaTeX files. This will instruct LaTeX to keep
+# running if errors occur, instead of asking the user for help.
+# This option is also used when generating formulas in HTML.
+
+LATEX_BATCHMODE = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
+# The RTF output is optimised for Word 97 and may not look very pretty with
+# other RTF readers or editors.
+
+GENERATE_RTF = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `rtf' will be used as the default path.
+
+RTF_OUTPUT = rtf
+
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
+# RTF documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_RTF = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
+# will contain hyperlink fields. The RTF file will
+# contain links (just like the HTML output) instead of page references.
+# This makes the output suitable for online browsing using a WORD or other.
+# programs which support those fields.
+# Note: wordpad (write) and others do not support links.
+
+RTF_HYPERLINKS = NO
+
+# Load stylesheet definitions from file. Syntax is similar to doxygen's
+# config file, i.e. a series of assigments. You only have to provide
+# replacements, missing definitions are set to their default value.
+
+RTF_STYLESHEET_FILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
+# generate man pages
+
+GENERATE_MAN = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `man' will be used as the default path.
+
+MAN_OUTPUT = man
+
+# The MAN_EXTENSION tag determines the extension that is added to
+# the generated man pages (default is the subroutine's section .3)
+
+MAN_EXTENSION = .3
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
+# evaluate all C-preprocessor directives found in the sources and include
+# files.
+
+ENABLE_PREPROCESSING = YES
+
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
+# names in the source code. If set to NO (the default) only conditional
+# compilation will be performed. Macro expansion can be done in a controlled
+# way by setting EXPAND_ONLY_PREDEF to YES.
+
+MACRO_EXPANSION = NO
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
+# then the macro expansion is limited to the macros specified with the
+# PREDEFINED and EXPAND_AS_PREDEFINED tags.
+
+EXPAND_ONLY_PREDEF = NO
+
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
+# in the INCLUDE_PATH (see below) will be search if a #include is found.
+
+SEARCH_INCLUDES = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that
+# contain include files that are not input files but should be processed by
+# the preprocessor.
+
+INCLUDE_PATH =
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
+# patterns (like *.h and *.hpp) to filter out the header-files in the
+# directories. If left blank, the patterns specified with FILE_PATTERNS will
+# be used.
+
+INCLUDE_FILE_PATTERNS =
+
+# The PREDEFINED tag can be used to specify one or more macro names that
+# are defined before the preprocessor is started (similar to the -D option of
+# gcc). The argument of the tag is a list of macros of the form: name
+# or name=definition (no spaces). If the definition and the = are
+# omitted =1 is assumed.
+
+PREDEFINED =
+
+# If the MACRO_EXPANSION and EXPAND_PREDEF_ONLY tags are set to YES then
+# this tag can be used to specify a list of macro names that should be expanded.
+# The macro definition that is found in the sources will be used.
+# Use the PREDEFINED tag if you want to use a different macro definition.
+
+EXPAND_AS_DEFINED =
+
+#---------------------------------------------------------------------------
+# Configuration::addtions related to external references
+#---------------------------------------------------------------------------
+
+# The TAGFILES tag can be used to specify one or more tagfiles.
+
+TAGFILES =
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create
+# a tag file that is based on the input files it reads.
+
+GENERATE_TAGFILE =
+
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed
+# in the class index. If set to NO only the inherited external classes
+# will be listed.
+
+ALLEXTERNALS = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script
+# interpreter (i.e. the result of `which perl').
+
+PERL_PATH = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
+# available from the path. This tool is part of Graphviz, a graph visualization
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section
+# have no effect if this option is set to NO (the default)
+
+HAVE_DOT = NO
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect inheritance relations. Setting this tag to YES will force the
+# the CLASS_DIAGRAMS tag to NO.
+
+CLASS_GRAPH = YES
+
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect implementation dependencies (inheritance, containment, and
+# class references variables) of the class with other documented classes.
+
+COLLABORATION_GRAPH = YES
+
+# If the ENABLE_PREPROCESSING, INCLUDE_GRAPH, and HAVE_DOT tags are set to
+# YES then doxygen will generate a graph for each documented file showing
+# the direct and indirect include dependencies of the file with other
+# documented files.
+
+INCLUDE_GRAPH = YES
+
+# If the ENABLE_PREPROCESSING, INCLUDED_BY_GRAPH, and HAVE_DOT tags are set to
+# YES then doxygen will generate a graph for each documented header file showing
+# the documented files that directly or indirectly include this file
+
+INCLUDED_BY_GRAPH = YES
+
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
+# will graphical hierarchy of all classes instead of a textual one.
+
+GRAPHICAL_HIERARCHY = YES
+
+# The tag DOT_PATH can be used to specify the path where the dot tool can be
+# found. If left blank, it is assumed the dot tool can be found on the path.
+
+DOT_PATH =
+
+# The MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width
+# (in pixels) of the graphs generated by dot. If a graph becomes larger than
+# this value, doxygen will try to truncate the graph, so that it fits within
+# the specified constraint. Beware that most browsers cannot cope with very
+# large images.
+
+MAX_DOT_GRAPH_WIDTH = 1024
+
+# The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height
+# (in pixels) of the graphs generated by dot. If a graph becomes larger than
+# this value, doxygen will try to truncate the graph, so that it fits within
+# the specified constraint. Beware that most browsers cannot cope with very
+# large images.
+
+MAX_DOT_GRAPH_HEIGHT = 1024
+
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
+# generate a legend page explaining the meaning of the various boxes and
+# arrows in the dot generated graphs.
+
+#GENERATE_LEGEND = YES
+
+#---------------------------------------------------------------------------
+# Configuration::addtions related to the search engine
+#---------------------------------------------------------------------------
+
+# The SEARCHENGINE tag specifies whether or not a search engine should be
+# used. If set to NO the values of all tags below this one will be ignored.
+
+SEARCHENGINE = NO
+
+# The CGI_NAME tag should be the name of the CGI script that
+# starts the search engine (doxysearch) with the correct parameters.
+# A script with this name will be generated by doxygen.
+
+CGI_NAME = search.cgi
+
+# The CGI_URL tag should be the absolute URL to the directory where the
+# cgi binaries are located. See the documentation of your http daemon for
+# details.
+
+CGI_URL =
+
+# The DOC_URL tag should be the absolute URL to the directory where the
+# documentation is located. If left blank the absolute path to the
+# documentation, with file:// prepended to it, will be used.
+
+DOC_URL =
+
+# The DOC_ABSPATH tag should be the absolute path to the directory where the
+# documentation is located. If left blank the directory on the local machine
+# will be used.
+
+DOC_ABSPATH =
+
+# The BIN_ABSPATH tag must point to the directory where the doxysearch binary
+# is installed.
+
+BIN_ABSPATH = /usr/local/bin/
+
+# The EXT_DOC_PATHS tag can be used to specify one or more paths to
+# documentation generated for other projects. This allows doxysearch to search
+# the documentation for these projects as well.
+
+EXT_DOC_PATHS =
+
+
+# End of file
+
diff --git a/libstdc++-v3/docs/doxygen/run_doxygen b/libstdc++-v3/docs/doxygen/run_doxygen
index 9585e04afd7..f3c2df450c1 100644
--- a/libstdc++-v3/docs/doxygen/run_doxygen
+++ b/libstdc++-v3/docs/doxygen/run_doxygen
@@ -1,6 +1,143 @@
#!/bin/sh
+# Runs doxygen. Possibly will massage the output files.
+#
+# Synopsis: run_doxygen --mode=[user|maint] v3srcdir v3builddir
+#
+# Originally hacked together by Phil Edwards <pme@sources.redhat.com>
+# $Id: run_doxygen,v 1.1.4.2 2001/06/11 13:06:44 pme Exp $
-# This file is a placeholder to keep the doxygen subdir in place. It
-# will be used to test for the presence of doxygen(1) and run it.
+
+# We can check now that the version of doxygen is >= this variable.
+DOXYVER=1.2.6
+doxygen=
+
+find_doxygen() {
+ v_required=`echo $DOXYVER | \
+ awk -F. '{if(NF<3)$3=0;print ($1*100+$2)*100+$3}'`
+ testing_version=
+ # thank you goat book
+ set `IFS=:; X="$PATH:/usr/local/bin:/bin:/usr/bin"; echo $X`
+ for dir
+ do
+ # AC_EXEEXT could come in useful here
+ maybedoxy="$dir/doxygen"
+ test -f "$maybedoxy" && testing_version=`$maybedoxy --version`
+ if test -n "$testing_version"; then
+ v_found=`echo $testing_version | \
+ awk -F. '{if(NF<3)$3=0;print ($1*100+$2)*100+$3}'`
+ if test $v_found -ge $v_required; then
+ doxygen="$maybedoxy"
+ break
+ fi
+ fi
+ done
+ if test -z "$doxygen"; then
+ echo run_doxygen error: Could not find Doxygen $DOXYVER in path. 1>&2
+ print_usage
+ fi
+}
+
+print_usage() {
+ cat 1>&2 <<EOF
+Usage: run_doxygen --mode=MODE [<options>] <src-dir> <output-dir>
+ MODE is one of:
+ maint Generate maintainers' documentation (lots more;
+ exposes non-public members, etc).
+ user Generate user-level library documentation.
+
+ more options when i think of them
+
+Note: Requires Doxygen ${DOXYVER} or later; get it at
+ ftp://ftp.stack.nl/pub/users/dimitri/doxygen-${DOXYVER}.src.tar.gz
+
+EOF
+ exit 1
+}
+
+parse_options() {
+ for o
+ do
+ # Blatantly ripped from autoconf, er, I mean, "gratefully standing
+ # on the shoulders of those giants who have gone before us."
+ case "$o" in
+ -*=*) arg=`echo "$o" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
+ *) arg= ;;
+ esac
+
+ case "$o" in
+ --mode=*)
+ mode=$arg ;;
+ --mode | --help | -h)
+ print_usage ;;
+ --version | -v)
+ # Aw, that's so cuuuute... don't ask, I needed it.
+ blank=
+ Id=is
+ echo You expect this dinky script to track a version? Okay, here
+ echo it $Id: run_doxygen,v 1.1.4.2 2001/06/11 13:06:44 pme Exp $blank
+ exit 0
+ ;;
+ *)
+ # this turned out to be a mess, maybe change to --srcdir=, etc
+ if test $srcdir = unset; then
+ srcdir=$o
+ elif test $outdir = unset; then
+ outdir=${o}/docs/doxygen
+ else
+ echo run_doxygen error: Too many arguments 1>&2
+ exit 1
+ fi
+ ;;
+ esac
+ done
+}
+
+
+# script begins here
+mode=unset
+srcdir=unset
+outdir=unset
+
+parse_options $*
+find_doxygen
+
+if test $srcdir = unset || test $outdir = unset || test $mode = unset; then
+ # this could be better
+ echo run_doxygen error: You have not given enough information...! 1>&2
+ print_usage
+fi
+
+case x"$mode" in
+ xuser | xmaint) ;; # ochen khorosho
+ *)
+ echo run_doxygen error: $mode is an invalid mode 1>&2
+ exit 1 ;;
+esac
+
+rm -rf $outdir
+mkdir -p $outdir
+chmod u+w $outdir
+(
+ set -e
+ cd $srcdir
+ sed -e "s=@outdir@=${outdir}=" \
+ -e "s=@srcdir@=${srcdir}=" \
+ docs/doxygen/${mode}.cfg.in > ${outdir}/${mode}.cfg
+ echo :: NOTE that this may take some time...
+ echo $doxygen ${outdir}/${mode}.cfg
+ $doxygen ${outdir}/${mode}.cfg
+ echo :: Finished, exit code was $?
+)
+
+# mess with output files here?
+
+echo ::
+echo :: Doxygen output begins with
+echo :: ${outdir}/html_${mode}/index.html
+echo ::
+
+exit 0
+
+# vim:ts=4:et:
diff --git a/libstdc++-v3/docs/doxygen/style.css b/libstdc++-v3/docs/doxygen/style.css
new file mode 100644
index 00000000000..7f8e5b88395
--- /dev/null
+++ b/libstdc++-v3/docs/doxygen/style.css
@@ -0,0 +1,20 @@
+H1 { text-align: center; }
+A.qindex {}
+A.qindexRef {}
+A.el { text-decoration: none; font-weight: bold }
+A.elRef { font-weight: bold }
+A.code { text-decoration: none; font-weight: normal; color: #4444ee }
+A.codeRef { font-weight: normal; color: #4444ee }
+DL.el { margin-left: -1cm }
+DIV.fragment { width: 100%; border: none; background-color: #eeeeee }
+DIV.ah { background-color: black; margin-bottom: 3; margin-top: 3 }
+TD.md { background-color: #f2f2ff }
+DIV.groupHeader { margin-left: 16; margin-top: 12; margin-bottom: 6; font-weight: bold }
+DIV.groupText { margin-left: 16; font-style: italic; font-size: smaller }
+FONT.keyword { color: #008000 }
+FONT.keywordtype { color: #604020 }
+FONT.keywordflow { color: #e08000 }
+FONT.comment { color: #800000 }
+FONT.preprocessor { color: #806020 }
+FONT.stringliteral { color: #002080 }
+FONT.charliteral { color: #008080 }
diff --git a/libstdc++-v3/docs/doxygen/user.cfg.in b/libstdc++-v3/docs/doxygen/user.cfg.in
new file mode 100644
index 00000000000..97c0ca4fcc0
--- /dev/null
+++ b/libstdc++-v3/docs/doxygen/user.cfg.in
@@ -0,0 +1,821 @@
+# Doxyfile 1.2.6
+
+# This file describes the settings to be used by doxygen for a project
+#
+# All text after a hash (#) is considered a comment and will be ignored
+# The format is:
+# TAG = value [value, ...]
+# For lists items can also be appended using:
+# TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ")
+
+### When doxygen is run, the current directory is the top of
+### the libstdc++-v3 source directory. Keep this in mind while
+### writing relative-path directories.
+
+#---------------------------------------------------------------------------
+# General configuration options
+#---------------------------------------------------------------------------
+
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
+# by quotes) that should identify the project.
+
+PROJECT_NAME = "libstdc++-v3 Source"
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number.
+# This could be handy for archiving the generated documentation or
+# if some version control system is used.
+
+PROJECT_NUMBER =
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
+# base path where the generated documentation will be put.
+# If a relative path is entered, it will be relative to the location
+# where doxygen was started. If left blank the current directory will be used.
+### Currently this is not really run through autoconf; it just looks that way.
+OUTPUT_DIRECTORY = @outdir@
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all constant output in the proper language.
+# The default language is English, other supported languages are:
+# Dutch, French, Italian, Czech, Swedish, German, Finnish, Japanese,
+# Korean, Hungarian, Norwegian, Spanish, Romanian, Russian, Croatian,
+# Polish, Portuguese and Slovene.
+
+OUTPUT_LANGUAGE = English
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
+# documentation are documented, even if no documentation was available.
+# Private class members and static file members will be hidden unless
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+
+#EXTRACT_ALL = NO
+EXTRACT_ALL = YES
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
+# will be included in the documentation.
+
+EXTRACT_PRIVATE = YES
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file
+# will be included in the documentation.
+
+EXTRACT_STATIC = YES
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
+# undocumented members of documented classes, files or namespaces.
+# If set to NO (the default) these members will be included in the
+# various overviews, but no documentation section is generated.
+# This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_MEMBERS = YES
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy.
+# If set to NO (the default) these class will be included in the various
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_CLASSES = YES
+
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
+# include brief member descriptions after the members that are listed in
+# the file and class documentation (similar to JavaDoc).
+# Set to NO to disable this.
+
+BRIEF_MEMBER_DESC = YES
+
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
+# the brief description of a member or function before the detailed description.
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# brief descriptions will be completely suppressed.
+
+REPEAT_BRIEF = YES
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
+# Doxygen will generate a detailed section even if there is only a brief
+# description.
+
+ALWAYS_DETAILED_SEC = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
+# path before files name in the file list and in the header files. If set
+# to NO the shortest path that makes the file name unique will be used.
+
+FULL_PATH_NAMES = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
+# can be used to strip a user defined part of the path. Stripping is
+# only done if one of the specified strings matches the left-hand part of
+# the path. It is allowed to use relative paths in the argument list.
+
+STRIP_FROM_PATH =
+
+# The INTERNAL_DOCS tag determines if documentation
+# that is typed after a \internal command is included. If the tag is set
+# to NO (the default) then the documentation will be excluded.
+# Set it to YES to include the internal documentation.
+
+INTERNAL_DOCS = NO
+
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
+# generate a class diagram (in Html and LaTeX) for classes with base or
+# super classes. Setting the tag to NO turns the diagrams off.
+
+CLASS_DIAGRAMS = YES
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will
+# be generated. Documented entities will be cross-referenced with these sources.
+
+SOURCE_BROWSER = YES
+
+# Setting the INLINE_SOURCES tag to YES will include the body
+# of functions and classes directly in the documentation.
+
+INLINE_SOURCES = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
+# doxygen to hide any special comment blocks from generated source code
+# fragments. Normal C and C++ comments will always remain visible.
+
+STRIP_CODE_COMMENTS = YES
+
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
+# file names in lower case letters. If set to YES upper case letters are also
+# allowed. This is useful if you have classes or files whose names only differ
+# in case and if your file system supports case sensitive file names. Windows
+# users are adviced to set this option to NO.
+
+CASE_SENSE_NAMES = NO
+
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
+# will show members with their full class and namespace scopes in the
+# documentation. If set to YES the scope will be hidden.
+
+HIDE_SCOPE_NAMES = NO
+
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
+# will generate a verbatim copy of the header file for each class for
+# which an include is specified. Set to NO to disable this.
+
+VERBATIM_HEADERS = NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
+# will put list of the files that are included by a file in the documentation
+# of that file.
+
+SHOW_INCLUDE_FILES = YES
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
+# will interpret the first line (until the first dot) of a JavaDoc-style
+# comment as the brief description. If set to NO, the JavaDoc
+# comments will behave just like the Qt-style comments (thus requiring an
+# explict @brief command for a brief description.
+
+JAVADOC_AUTOBRIEF = NO
+
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
+# member inherits the documentation from any documented member that it
+# reimplements.
+
+INHERIT_DOCS = YES
+
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
+# is inserted in the documentation for inline members.
+
+INLINE_INFO = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
+# will sort the (detailed) documentation of file and class members
+# alphabetically by member name. If set to NO the members will appear in
+# declaration order.
+
+SORT_MEMBER_DOCS = YES
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
+# tag is set to YES, then doxygen will reuse the documentation of the first
+# member in the group (if any) for the other members of the group. By default
+# all members of a group must be documented explicitly.
+
+DISTRIBUTE_GROUP_DOC = YES
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab.
+# Doxygen uses this value to replace tabs by spaces in code fragments.
+
+TAB_SIZE = 4
+
+# The ENABLE_SECTIONS tag can be used to enable conditional
+# documentation sections, marked by \if sectionname ... \endif.
+
+ENABLED_SECTIONS =
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or
+# disable (NO) the todo list. This list is created by putting \todo
+# commands in the documentation.
+
+GENERATE_TODOLIST = NO
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or
+# disable (NO) the test list. This list is created by putting \test
+# commands in the documentation.
+
+GENERATE_TESTLIST = NO
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or
+# disable (NO) the bug list. This list is created by putting \bug
+# commands in the documentation.
+
+GENERATE_BUGLIST = YES
+
+# This tag can be used to specify a number of aliases that acts
+# as commands in the documentation. An alias has the form "name=value".
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to
+# put the command \sideeffect (or @sideeffect) in the documentation, which
+# will result in a user defined paragraph with heading "Side Effects:".
+# You can put \n's in the value part of an alias to insert newlines.
+
+ALIASES =
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
+# the initial value of a variable or define consist of for it to appear in
+# the documentation. If the initializer consists of more lines than specified
+# here it will be hidden. Use a value of 0 to hide initializers completely.
+# The appearance of the initializer of individual variables and defines in the
+# documentation can be controlled using \showinitializer or \hideinitializer
+# command in the documentation regardless of this setting.
+
+MAX_INITIALIZER_LINES = 30
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources
+# only. Doxygen will then generate output that is more tailored for C.
+# For instance some of the names that are used will be different. The list
+# of all members will be omitted, etc.
+
+OPTIMIZE_OUTPUT_FOR_C = NO
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
+# at the bottom of the documentation of classes and structs. If set to YES the
+# list will mention the files that were used to generate the documentation.
+
+SHOW_USED_FILES = YES
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
+
+QUIET = YES
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are
+# generated by doxygen. Possible values are YES and NO. If left blank
+# NO is used.
+
+WARNINGS = NO
+
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
+# automatically be disabled.
+
+WARN_IF_UNDOCUMENTED = YES
+
+# The WARN_FORMAT tag determines the format of the warning messages that
+# doxygen can produce. The string should contain the $file, $line, and $text
+# tags, which will be replaced by the file and line number from which the
+# warning originated and the warning text.
+
+WARN_FORMAT = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning
+# and error messages should be written. If left blank the output is written
+# to stderr.
+
+WARN_LOGFILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain
+# documented source files. You may enter file names like "myfile.cpp" or
+# directories like "/usr/src/myproject". Separate the files or directories
+# with spaces.
+
+INPUT = docs/doxygen \
+ libsupc++ \
+ include \
+ src \
+libsupc++/exception libsupc++/new libsupc++/typeinfo include/ext/hash_map \
+include/ext/hash_set include/ext/rope include/ext/slist include/std/algorithm \
+include/std/bitset include/std/cassert include/std/cctype \
+include/std/cerrno include/std/cfloat include/std/ciso646 include/std/climits \
+include/std/clocale include/std/cmath include/std/complex include/std/csetjmp \
+include/std/csignal include/std/cstdarg include/std/cstddef \
+include/std/cstdio include/std/cstdlib include/std/cstring \
+include/std/ctime include/std/cwchar include/std/cwctype include/std/deque \
+include/std/fstream include/std/functional include/std/iomanip \
+include/std/ios include/std/iosfwd include/std/iostream include/std/istream \
+include/std/iterator include/std/limits include/std/list include/std/locale \
+include/std/map include/std/memory include/std/numeric include/std/ostream \
+include/std/queue include/std/set include/std/sstream include/std/stack \
+include/std/stdexcept include/std/streambuf include/std/string \
+include/std/utility include/std/valarray include/std/vector
+
+# If the value of the INPUT tag contains directories, you can use the
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank all files are included.
+
+FILE_PATTERNS = *.doxy \
+ *.cc \
+ *.tcc \
+ *.h \
+ c++config
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories
+# should be searched for input files as well. Possible values are YES and NO.
+# If left blank NO is used.
+
+RECURSIVE = YES
+
+# The EXCLUDE tag can be used to specify files and/or directories that should
+# excluded from the INPUT source files. This way you can easily exclude a
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+
+EXCLUDE = include/c \
+ include/c_shadow
+
+# If the value of the INPUT tag contains directories, you can use the
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
+# certain files from those directories.
+
+EXCLUDE_PATTERNS =
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or
+# directories that contain example code fragments that are included (see
+# the \include command).
+
+EXAMPLE_PATH =
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank all files are included.
+
+EXAMPLE_PATTERNS =
+
+# The IMAGE_PATH tag can be used to specify one or more files or
+# directories that contain image that are included in the documentation (see
+# the \image command).
+
+IMAGE_PATH =
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should
+# invoke to filter for each input file. Doxygen will invoke the filter program
+# by executing (via popen()) the command <filter> <input-file>, where <filter>
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
+# input file. Doxygen will then use the output that the filter program writes
+# to standard output.
+
+INPUT_FILTER =
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
+# INPUT_FILTER) will be used to filter the input files when producing source
+# files to browse.
+
+FILTER_SOURCE_FILES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
+# of all compounds will be generated. Enable this if the project
+# contains a lot of classes, structs, unions or interfaces.
+
+ALPHABETICAL_INDEX = YES
+
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
+# in which this list will be split (can be a number in the range [1..20])
+
+COLS_IN_ALPHA_INDEX = 5
+
+# In case all classes in a project start with a common prefix, all
+# classes will be put under the same header in the alphabetical index.
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
+# should be ignored while generating the index headers.
+
+IGNORE_PREFIX =
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
+# generate HTML output.
+
+GENERATE_HTML = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `html' will be used as the default path.
+
+HTML_OUTPUT = html_user
+
+# The HTML_HEADER tag can be used to specify a personal HTML header for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard header.
+
+HTML_HEADER =
+
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard footer.
+
+HTML_FOOTER =
+
+# The HTML_STYLESHEET tag can be used to specify a user defined cascading
+# style sheet that is used by each HTML page. It can be used to
+# fine-tune the look of the HTML output. If the tag is left blank doxygen
+# will generate a default style sheet
+
+HTML_STYLESHEET = docs/doxygen/style.css
+
+# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
+# files or namespaces will be aligned in HTML using tables. If set to
+# NO a bullet list will be used.
+
+HTML_ALIGN_MEMBERS = YES
+
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files
+# will be generated that can be used as input for tools like the
+# Microsoft HTML help workshop to generate a compressed HTML help file (.chm)
+# of the generated HTML documentation.
+
+GENERATE_HTMLHELP = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
+# controls if a separate .chi index file is generated (YES) or that
+# it should be included in the master .chm file (NO).
+
+GENERATE_CHI = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
+# controls whether a binary table of contents is generated (YES) or a
+# normal table of contents (NO) in the .chm file.
+
+BINARY_TOC = NO
+
+# The TOC_EXPAND flag can be set YES to add extra items for group members
+# to the contents of the Html help documentation and to the tree view.
+
+TOC_EXPAND = NO
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
+# top of each HTML page. The value NO (the default) enables the index and
+# the value YES disables it.
+
+DISABLE_INDEX = NO
+
+# This tag can be used to set the number of enum values (range [1..20])
+# that doxygen will group on one line in the generated HTML documentation.
+
+ENUM_VALUES_PER_LINE = 4
+
+# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be
+# generated containing a tree-like index structure (just like the one that
+# is generated for HTML Help). For this to work a browser that supports
+# JavaScript and frames is required (for instance Netscape 4.0+
+# or Internet explorer 4.0+).
+
+GENERATE_TREEVIEW = NO
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
+# used to set the initial width (in pixels) of the frame in which the tree
+# is shown.
+
+TREEVIEW_WIDTH = 250
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
+# generate Latex output.
+
+GENERATE_LATEX = NO
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `latex' will be used as the default path.
+
+LATEX_OUTPUT = latex
+
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
+# LaTeX documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_LATEX = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used
+# by the printer. Possible values are: a4, a4wide, letter, legal and
+# executive. If left blank a4wide will be used.
+
+PAPER_TYPE = letter
+
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
+# packages that should be included in the LaTeX output.
+
+EXTRA_PACKAGES =
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
+# the generated latex document. The header should contain everything until
+# the first chapter. If it is left blank doxygen will generate a
+# standard header. Notice: only use this tag if you know what you are doing!
+
+LATEX_HEADER =
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will
+# contain links (just like the HTML output) instead of page references
+# This makes the output suitable for online browsing using a pdf viewer.
+
+PDF_HYPERLINKS = NO
+
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
+# plain latex in the generated Makefile. Set this option to YES to get a
+# higher quality PDF documentation.
+
+USE_PDFLATEX = NO
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
+# command to the generated LaTeX files. This will instruct LaTeX to keep
+# running if errors occur, instead of asking the user for help.
+# This option is also used when generating formulas in HTML.
+
+LATEX_BATCHMODE = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
+# The RTF output is optimised for Word 97 and may not look very pretty with
+# other RTF readers or editors.
+
+GENERATE_RTF = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `rtf' will be used as the default path.
+
+RTF_OUTPUT = rtf
+
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
+# RTF documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_RTF = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
+# will contain hyperlink fields. The RTF file will
+# contain links (just like the HTML output) instead of page references.
+# This makes the output suitable for online browsing using a WORD or other.
+# programs which support those fields.
+# Note: wordpad (write) and others do not support links.
+
+RTF_HYPERLINKS = NO
+
+# Load stylesheet definitions from file. Syntax is similar to doxygen's
+# config file, i.e. a series of assigments. You only have to provide
+# replacements, missing definitions are set to their default value.
+
+RTF_STYLESHEET_FILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
+# generate man pages
+
+GENERATE_MAN = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `man' will be used as the default path.
+
+MAN_OUTPUT = man
+
+# The MAN_EXTENSION tag determines the extension that is added to
+# the generated man pages (default is the subroutine's section .3)
+
+MAN_EXTENSION = .3
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
+# evaluate all C-preprocessor directives found in the sources and include
+# files.
+
+ENABLE_PREPROCESSING = YES
+
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
+# names in the source code. If set to NO (the default) only conditional
+# compilation will be performed. Macro expansion can be done in a controlled
+# way by setting EXPAND_ONLY_PREDEF to YES.
+
+MACRO_EXPANSION = NO
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
+# then the macro expansion is limited to the macros specified with the
+# PREDEFINED and EXPAND_AS_PREDEFINED tags.
+
+EXPAND_ONLY_PREDEF = NO
+
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
+# in the INCLUDE_PATH (see below) will be search if a #include is found.
+
+SEARCH_INCLUDES = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that
+# contain include files that are not input files but should be processed by
+# the preprocessor.
+
+INCLUDE_PATH =
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
+# patterns (like *.h and *.hpp) to filter out the header-files in the
+# directories. If left blank, the patterns specified with FILE_PATTERNS will
+# be used.
+
+INCLUDE_FILE_PATTERNS =
+
+# The PREDEFINED tag can be used to specify one or more macro names that
+# are defined before the preprocessor is started (similar to the -D option of
+# gcc). The argument of the tag is a list of macros of the form: name
+# or name=definition (no spaces). If the definition and the = are
+# omitted =1 is assumed.
+
+PREDEFINED =
+
+# If the MACRO_EXPANSION and EXPAND_PREDEF_ONLY tags are set to YES then
+# this tag can be used to specify a list of macro names that should be expanded.
+# The macro definition that is found in the sources will be used.
+# Use the PREDEFINED tag if you want to use a different macro definition.
+
+EXPAND_AS_DEFINED =
+
+#---------------------------------------------------------------------------
+# Configuration::addtions related to external references
+#---------------------------------------------------------------------------
+
+# The TAGFILES tag can be used to specify one or more tagfiles.
+
+TAGFILES =
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create
+# a tag file that is based on the input files it reads.
+
+GENERATE_TAGFILE =
+
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed
+# in the class index. If set to NO only the inherited external classes
+# will be listed.
+
+ALLEXTERNALS = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script
+# interpreter (i.e. the result of `which perl').
+
+PERL_PATH = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
+# available from the path. This tool is part of Graphviz, a graph visualization
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section
+# have no effect if this option is set to NO (the default)
+
+HAVE_DOT = YES
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect inheritance relations. Setting this tag to YES will force the
+# the CLASS_DIAGRAMS tag to NO.
+
+CLASS_GRAPH = YES
+
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect implementation dependencies (inheritance, containment, and
+# class references variables) of the class with other documented classes.
+
+COLLABORATION_GRAPH = YES
+
+# If the ENABLE_PREPROCESSING, INCLUDE_GRAPH, and HAVE_DOT tags are set to
+# YES then doxygen will generate a graph for each documented file showing
+# the direct and indirect include dependencies of the file with other
+# documented files.
+
+INCLUDE_GRAPH = YES
+
+# If the ENABLE_PREPROCESSING, INCLUDED_BY_GRAPH, and HAVE_DOT tags are set to
+# YES then doxygen will generate a graph for each documented header file showing
+# the documented files that directly or indirectly include this file
+
+INCLUDED_BY_GRAPH = YES
+
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
+# will graphical hierarchy of all classes instead of a textual one.
+
+GRAPHICAL_HIERARCHY = YES
+
+# The tag DOT_PATH can be used to specify the path where the dot tool can be
+# found. If left blank, it is assumed the dot tool can be found on the path.
+
+DOT_PATH =
+
+# The MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width
+# (in pixels) of the graphs generated by dot. If a graph becomes larger than
+# this value, doxygen will try to truncate the graph, so that it fits within
+# the specified constraint. Beware that most browsers cannot cope with very
+# large images.
+
+MAX_DOT_GRAPH_WIDTH = 1024
+
+# The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height
+# (in pixels) of the graphs generated by dot. If a graph becomes larger than
+# this value, doxygen will try to truncate the graph, so that it fits within
+# the specified constraint. Beware that most browsers cannot cope with very
+# large images.
+
+MAX_DOT_GRAPH_HEIGHT = 1024
+
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
+# generate a legend page explaining the meaning of the various boxes and
+# arrows in the dot generated graphs.
+
+GENERATE_LEGEND = YES
+
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
+# remove the intermedate dot files that are used to generate
+# the various graphs.
+
+DOT_CLEANUP = YES
+
+#---------------------------------------------------------------------------
+# Configuration::addtions related to the search engine
+#---------------------------------------------------------------------------
+
+# The SEARCHENGINE tag specifies whether or not a search engine should be
+# used. If set to NO the values of all tags below this one will be ignored.
+
+SEARCHENGINE = NO
+
+# The CGI_NAME tag should be the name of the CGI script that
+# starts the search engine (doxysearch) with the correct parameters.
+# A script with this name will be generated by doxygen.
+
+CGI_NAME = search.cgi
+
+# The CGI_URL tag should be the absolute URL to the directory where the
+# cgi binaries are located. See the documentation of your http daemon for
+# details.
+
+CGI_URL =
+
+# The DOC_URL tag should be the absolute URL to the directory where the
+# documentation is located. If left blank the absolute path to the
+# documentation, with file:// prepended to it, will be used.
+
+DOC_URL =
+
+# The DOC_ABSPATH tag should be the absolute path to the directory where the
+# documentation is located. If left blank the directory on the local machine
+# will be used.
+
+DOC_ABSPATH =
+
+# The BIN_ABSPATH tag must point to the directory where the doxysearch binary
+# is installed.
+
+BIN_ABSPATH = /usr/local/bin/
+
+# The EXT_DOC_PATHS tag can be used to specify one or more paths to
+# documentation generated for other projects. This allows doxysearch to search
+# the documentation for these projects as well.
+
+EXT_DOC_PATHS =
+
+
+# End of file
+
+
+
diff --git a/libstdc++-v3/docs/html/17_intro/BADNAMES b/libstdc++-v3/docs/html/17_intro/BADNAMES
index 3e9557bc8d9..0a1d7a4e90a 100644
--- a/libstdc++-v3/docs/html/17_intro/BADNAMES
+++ b/libstdc++-v3/docs/html/17_intro/BADNAMES
@@ -25,7 +25,12 @@ _G
MS adds:
_T
-For egcs:
+For GCC:
+
+ [Note that this list is out of date. It applies to the old
+ name-mangling; in G++ 3.0 and higher a different name-mangling is
+ used. In addition, many of the bugs relating to G++ interpreting
+ these names as operators have been fixed.]
The full set of __* identifiers (combined from gcc/cp/lex.c and
gcc/cplus-dem.c) that are either old or new, but are definitely
diff --git a/libstdc++-v3/docs/html/17_intro/BUGS b/libstdc++-v3/docs/html/17_intro/BUGS
index 150503593fe..04e4bc80623 100644
--- a/libstdc++-v3/docs/html/17_intro/BUGS
+++ b/libstdc++-v3/docs/html/17_intro/BUGS
@@ -5,7 +5,7 @@
- _GLIBCPP_HAS_BUILTIN_SINF: We should still hold out for a cleaner solution the is currenly the case in bits/std_cmath.h.
-- there may be one set of remaining string bugs, dependant on final
+- there may be one set of remaining string bugs, dependent on final
clarification of the string::find technicalities when finding in an
empty string or using an empty string for an argument. At the very
least, v-3 has interpreted the standard in a way that is in opposition
diff --git a/libstdc++-v3/docs/html/17_intro/C++STYLE b/libstdc++-v3/docs/html/17_intro/C++STYLE
index c162a1f6ad4..46fe3f3f160 100644
--- a/libstdc++-v3/docs/html/17_intro/C++STYLE
+++ b/libstdc++-v3/docs/html/17_intro/C++STYLE
@@ -91,7 +91,7 @@ Notable areas of divergence from what may be previous local practice
{
space = _ISspace,
print = _ISprint,
- cntrl = _IScntrl,
+ cntrl = _IScntrl
};
-NOT-
enum { space = _ISspace, print = _ISprint, cntrl = _IScntrl };
@@ -122,7 +122,7 @@ Notable areas of divergence from what may be previous local practice
//
}
-09. Member functions declarations and defintions
+09. Member functions declarations and definitions
Keywords such as extern, static, export, explicit, inline, etc
go on the line above the function name. Thus
diff --git a/libstdc++-v3/docs/html/17_intro/CHECKLIST b/libstdc++-v3/docs/html/17_intro/CHECKLIST
index bef9635e850..9d3f80d3e36 100644
--- a/libstdc++-v3/docs/html/17_intro/CHECKLIST
+++ b/libstdc++-v3/docs/html/17_intro/CHECKLIST
@@ -958,7 +958,7 @@ T X* get() const throw();
T X* release() throw();
T void reset(X* p =0) throw();
- // _lib.auto.ptr.conv_ converions:
+ // _lib.auto.ptr.conv_ conversions:
X auto_ptr(auto_ptr_ref<X>) throw();
X template<class Y> operator auto_ptr_ref<Y>() throw();
X template<class Y> operator auto_ptr<Y>() throw();
diff --git a/libstdc++-v3/docs/html/17_intro/COPYING.DOC b/libstdc++-v3/docs/html/17_intro/COPYING.DOC
new file mode 100644
index 00000000000..b42936beb35
--- /dev/null
+++ b/libstdc++-v3/docs/html/17_intro/COPYING.DOC
@@ -0,0 +1,355 @@
+ GNU Free Documentation License
+ Version 1.1, March 2000
+
+ Copyright (C) 2000 Free Software Foundation, Inc.
+ 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+
+0. PREAMBLE
+
+The purpose of this License is to make a manual, textbook, or other
+written document "free" in the sense of freedom: to assure everyone
+the effective freedom to copy and redistribute it, with or without
+modifying it, either commercially or noncommercially. Secondarily,
+this License preserves for the author and publisher a way to get
+credit for their work, while not being considered responsible for
+modifications made by others.
+
+This License is a kind of "copyleft", which means that derivative
+works of the document must themselves be free in the same sense. It
+complements the GNU General Public License, which is a copyleft
+license designed for free software.
+
+We have designed this License in order to use it for manuals for free
+software, because free software needs free documentation: a free
+program should come with manuals providing the same freedoms that the
+software does. But this License is not limited to software manuals;
+it can be used for any textual work, regardless of subject matter or
+whether it is published as a printed book. We recommend this License
+principally for works whose purpose is instruction or reference.
+
+
+1. APPLICABILITY AND DEFINITIONS
+
+This License applies to any manual or other work that contains a
+notice placed by the copyright holder saying it can be distributed
+under the terms of this License. The "Document", below, refers to any
+such manual or work. Any member of the public is a licensee, and is
+addressed as "you".
+
+A "Modified Version" of the Document means any work containing the
+Document or a portion of it, either copied verbatim, or with
+modifications and/or translated into another language.
+
+A "Secondary Section" is a named appendix or a front-matter section of
+the Document that deals exclusively with the relationship of the
+publishers or authors of the Document to the Document's overall subject
+(or to related matters) and contains nothing that could fall directly
+within that overall subject. (For example, if the Document is in part a
+textbook of mathematics, a Secondary Section may not explain any
+mathematics.) The relationship could be a matter of historical
+connection with the subject or with related matters, or of legal,
+commercial, philosophical, ethical or political position regarding
+them.
+
+The "Invariant Sections" are certain Secondary Sections whose titles
+are designated, as being those of Invariant Sections, in the notice
+that says that the Document is released under this License.
+
+The "Cover Texts" are certain short passages of text that are listed,
+as Front-Cover Texts or Back-Cover Texts, in the notice that says that
+the Document is released under this License.
+
+A "Transparent" copy of the Document means a machine-readable copy,
+represented in a format whose specification is available to the
+general public, whose contents can be viewed and edited directly and
+straightforwardly with generic text editors or (for images composed of
+pixels) generic paint programs or (for drawings) some widely available
+drawing editor, and that is suitable for input to text formatters or
+for automatic translation to a variety of formats suitable for input
+to text formatters. A copy made in an otherwise Transparent file
+format whose markup has been designed to thwart or discourage
+subsequent modification by readers is not Transparent. A copy that is
+not "Transparent" is called "Opaque".
+
+Examples of suitable formats for Transparent copies include plain
+ASCII without markup, Texinfo input format, LaTeX input format, SGML
+or XML using a publicly available DTD, and standard-conforming simple
+HTML designed for human modification. Opaque formats include
+PostScript, PDF, proprietary formats that can be read and edited only
+by proprietary word processors, SGML or XML for which the DTD and/or
+processing tools are not generally available, and the
+machine-generated HTML produced by some word processors for output
+purposes only.
+
+The "Title Page" means, for a printed book, the title page itself,
+plus such following pages as are needed to hold, legibly, the material
+this License requires to appear in the title page. For works in
+formats which do not have any title page as such, "Title Page" means
+the text near the most prominent appearance of the work's title,
+preceding the beginning of the body of the text.
+
+
+2. VERBATIM COPYING
+
+You may copy and distribute the Document in any medium, either
+commercially or noncommercially, provided that this License, the
+copyright notices, and the license notice saying this License applies
+to the Document are reproduced in all copies, and that you add no other
+conditions whatsoever to those of this License. You may not use
+technical measures to obstruct or control the reading or further
+copying of the copies you make or distribute. However, you may accept
+compensation in exchange for copies. If you distribute a large enough
+number of copies you must also follow the conditions in section 3.
+
+You may also lend copies, under the same conditions stated above, and
+you may publicly display copies.
+
+
+3. COPYING IN QUANTITY
+
+If you publish printed copies of the Document numbering more than 100,
+and the Document's license notice requires Cover Texts, you must enclose
+the copies in covers that carry, clearly and legibly, all these Cover
+Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
+the back cover. Both covers must also clearly and legibly identify
+you as the publisher of these copies. The front cover must present
+the full title with all words of the title equally prominent and
+visible. You may add other material on the covers in addition.
+Copying with changes limited to the covers, as long as they preserve
+the title of the Document and satisfy these conditions, can be treated
+as verbatim copying in other respects.
+
+If the required texts for either cover are too voluminous to fit
+legibly, you should put the first ones listed (as many as fit
+reasonably) on the actual cover, and continue the rest onto adjacent
+pages.
+
+If you publish or distribute Opaque copies of the Document numbering
+more than 100, you must either include a machine-readable Transparent
+copy along with each Opaque copy, or state in or with each Opaque copy
+a publicly-accessible computer-network location containing a complete
+Transparent copy of the Document, free of added material, which the
+general network-using public has access to download anonymously at no
+charge using public-standard network protocols. If you use the latter
+option, you must take reasonably prudent steps, when you begin
+distribution of Opaque copies in quantity, to ensure that this
+Transparent copy will remain thus accessible at the stated location
+until at least one year after the last time you distribute an Opaque
+copy (directly or through your agents or retailers) of that edition to
+the public.
+
+It is requested, but not required, that you contact the authors of the
+Document well before redistributing any large number of copies, to give
+them a chance to provide you with an updated version of the Document.
+
+
+4. MODIFICATIONS
+
+You may copy and distribute a Modified Version of the Document under
+the conditions of sections 2 and 3 above, provided that you release
+the Modified Version under precisely this License, with the Modified
+Version filling the role of the Document, thus licensing distribution
+and modification of the Modified Version to whoever possesses a copy
+of it. In addition, you must do these things in the Modified Version:
+
+A. Use in the Title Page (and on the covers, if any) a title distinct
+ from that of the Document, and from those of previous versions
+ (which should, if there were any, be listed in the History section
+ of the Document). You may use the same title as a previous version
+ if the original publisher of that version gives permission.
+B. List on the Title Page, as authors, one or more persons or entities
+ responsible for authorship of the modifications in the Modified
+ Version, together with at least five of the principal authors of the
+ Document (all of its principal authors, if it has less than five).
+C. State on the Title page the name of the publisher of the
+ Modified Version, as the publisher.
+D. Preserve all the copyright notices of the Document.
+E. Add an appropriate copyright notice for your modifications
+ adjacent to the other copyright notices.
+F. Include, immediately after the copyright notices, a license notice
+ giving the public permission to use the Modified Version under the
+ terms of this License, in the form shown in the Addendum below.
+G. Preserve in that license notice the full lists of Invariant Sections
+ and required Cover Texts given in the Document's license notice.
+H. Include an unaltered copy of this License.
+I. Preserve the section entitled "History", and its title, and add to
+ it an item stating at least the title, year, new authors, and
+ publisher of the Modified Version as given on the Title Page. If
+ there is no section entitled "History" in the Document, create one
+ stating the title, year, authors, and publisher of the Document as
+ given on its Title Page, then add an item describing the Modified
+ Version as stated in the previous sentence.
+J. Preserve the network location, if any, given in the Document for
+ public access to a Transparent copy of the Document, and likewise
+ the network locations given in the Document for previous versions
+ it was based on. These may be placed in the "History" section.
+ You may omit a network location for a work that was published at
+ least four years before the Document itself, or if the original
+ publisher of the version it refers to gives permission.
+K. In any section entitled "Acknowledgements" or "Dedications",
+ preserve the section's title, and preserve in the section all the
+ substance and tone of each of the contributor acknowledgements
+ and/or dedications given therein.
+L. Preserve all the Invariant Sections of the Document,
+ unaltered in their text and in their titles. Section numbers
+ or the equivalent are not considered part of the section titles.
+M. Delete any section entitled "Endorsements". Such a section
+ may not be included in the Modified Version.
+N. Do not retitle any existing section as "Endorsements"
+ or to conflict in title with any Invariant Section.
+
+If the Modified Version includes new front-matter sections or
+appendices that qualify as Secondary Sections and contain no material
+copied from the Document, you may at your option designate some or all
+of these sections as invariant. To do this, add their titles to the
+list of Invariant Sections in the Modified Version's license notice.
+These titles must be distinct from any other section titles.
+
+You may add a section entitled "Endorsements", provided it contains
+nothing but endorsements of your Modified Version by various
+parties--for example, statements of peer review or that the text has
+been approved by an organization as the authoritative definition of a
+standard.
+
+You may add a passage of up to five words as a Front-Cover Text, and a
+passage of up to 25 words as a Back-Cover Text, to the end of the list
+of Cover Texts in the Modified Version. Only one passage of
+Front-Cover Text and one of Back-Cover Text may be added by (or
+through arrangements made by) any one entity. If the Document already
+includes a cover text for the same cover, previously added by you or
+by arrangement made by the same entity you are acting on behalf of,
+you may not add another; but you may replace the old one, on explicit
+permission from the previous publisher that added the old one.
+
+The author(s) and publisher(s) of the Document do not by this License
+give permission to use their names for publicity for or to assert or
+imply endorsement of any Modified Version.
+
+
+5. COMBINING DOCUMENTS
+
+You may combine the Document with other documents released under this
+License, under the terms defined in section 4 above for modified
+versions, provided that you include in the combination all of the
+Invariant Sections of all of the original documents, unmodified, and
+list them all as Invariant Sections of your combined work in its
+license notice.
+
+The combined work need only contain one copy of this License, and
+multiple identical Invariant Sections may be replaced with a single
+copy. If there are multiple Invariant Sections with the same name but
+different contents, make the title of each such section unique by
+adding at the end of it, in parentheses, the name of the original
+author or publisher of that section if known, or else a unique number.
+Make the same adjustment to the section titles in the list of
+Invariant Sections in the license notice of the combined work.
+
+In the combination, you must combine any sections entitled "History"
+in the various original documents, forming one section entitled
+"History"; likewise combine any sections entitled "Acknowledgements",
+and any sections entitled "Dedications". You must delete all sections
+entitled "Endorsements."
+
+
+6. COLLECTIONS OF DOCUMENTS
+
+You may make a collection consisting of the Document and other documents
+released under this License, and replace the individual copies of this
+License in the various documents with a single copy that is included in
+the collection, provided that you follow the rules of this License for
+verbatim copying of each of the documents in all other respects.
+
+You may extract a single document from such a collection, and distribute
+it individually under this License, provided you insert a copy of this
+License into the extracted document, and follow this License in all
+other respects regarding verbatim copying of that document.
+
+
+7. AGGREGATION WITH INDEPENDENT WORKS
+
+A compilation of the Document or its derivatives with other separate
+and independent documents or works, in or on a volume of a storage or
+distribution medium, does not as a whole count as a Modified Version
+of the Document, provided no compilation copyright is claimed for the
+compilation. Such a compilation is called an "aggregate", and this
+License does not apply to the other self-contained works thus compiled
+with the Document, on account of their being thus compiled, if they
+are not themselves derivative works of the Document.
+
+If the Cover Text requirement of section 3 is applicable to these
+copies of the Document, then if the Document is less than one quarter
+of the entire aggregate, the Document's Cover Texts may be placed on
+covers that surround only the Document within the aggregate.
+Otherwise they must appear on covers around the whole aggregate.
+
+
+8. TRANSLATION
+
+Translation is considered a kind of modification, so you may
+distribute translations of the Document under the terms of section 4.
+Replacing Invariant Sections with translations requires special
+permission from their copyright holders, but you may include
+translations of some or all Invariant Sections in addition to the
+original versions of these Invariant Sections. You may include a
+translation of this License provided that you also include the
+original English version of this License. In case of a disagreement
+between the translation and the original English version of this
+License, the original English version will prevail.
+
+
+9. TERMINATION
+
+You may not copy, modify, sublicense, or distribute the Document except
+as expressly provided for under this License. Any other attempt to
+copy, modify, sublicense or distribute the Document is void, and will
+automatically terminate your rights under this License. However,
+parties who have received copies, or rights, from you under this
+License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+
+10. FUTURE REVISIONS OF THIS LICENSE
+
+The Free Software Foundation may publish new, revised versions
+of the GNU Free Documentation License from time to time. Such new
+versions will be similar in spirit to the present version, but may
+differ in detail to address new problems or concerns. See
+http://www.gnu.org/copyleft/.
+
+Each version of the License is given a distinguishing version number.
+If the Document specifies that a particular numbered version of this
+License "or any later version" applies to it, you have the option of
+following the terms and conditions either of that specified version or
+of any later version that has been published (not as a draft) by the
+Free Software Foundation. If the Document does not specify a version
+number of this License, you may choose any version ever published (not
+as a draft) by the Free Software Foundation.
+
+
+ADDENDUM: How to use this License for your documents
+
+To use this License in a document you have written, include a copy of
+the License in the document and put the following copyright and
+license notices just after the title page:
+
+ Copyright (c) YEAR YOUR NAME.
+ Permission is granted to copy, distribute and/or modify this document
+ under the terms of the GNU Free Documentation License, Version 1.1
+ or any later version published by the Free Software Foundation;
+ with the Invariant Sections being LIST THEIR TITLES, with the
+ Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST.
+ A copy of the license is included in the section entitled "GNU
+ Free Documentation License".
+
+If you have no Invariant Sections, write "with no Invariant Sections"
+instead of saying which ones are invariant. If you have no
+Front-Cover Texts, write "no Front-Cover Texts" instead of
+"Front-Cover Texts being LIST"; likewise for Back-Cover Texts.
+
+If your document contains nontrivial examples of program code, we
+recommend releasing these examples in parallel under your choice of
+free software license, such as the GNU General Public License,
+to permit their use in free software.
diff --git a/libstdc++-v3/docs/html/17_intro/DESIGN b/libstdc++-v3/docs/html/17_intro/DESIGN
index 6979bc40f80..5af3d9aed3b 100644
--- a/libstdc++-v3/docs/html/17_intro/DESIGN
+++ b/libstdc++-v3/docs/html/17_intro/DESIGN
@@ -253,7 +253,7 @@ cases it may actually be excessive.
To implement a library which does not use exceptions directly is
not difficult given minor compiler support (to "turn off" exceptions
-and ignore exception contructs), and results in no great library
+and ignore exception constructs), and results in no great library
maintenance difficulties. To be precise, given "-fno-exceptions",
the compiler should treat "try" blocks as ordinary blocks, and
"catch" blocks as dead code to ignore or eliminate. Compiler
diff --git a/libstdc++-v3/docs/html/17_intro/RELEASE-NOTES b/libstdc++-v3/docs/html/17_intro/RELEASE-NOTES
index 1ebaf66d829..0f834224c01 100644
--- a/libstdc++-v3/docs/html/17_intro/RELEASE-NOTES
+++ b/libstdc++-v3/docs/html/17_intro/RELEASE-NOTES
@@ -1,13 +1,13 @@
-2000-11-29
+2001-04-06
Release Notes
-------------
-The Standard C++ Library v3, or libstdc++-2.90.x, is an ongoing
+The Standard C++ Library v3, or libstdc++-2.9x, is an ongoing
project to implement the ISO 14882 Standard C++ library as described
in chapters 17 through 27 and annex D, as a drop-in replacement
for the current (ARM-conformant) library.
-This is the tenth snapshot of the libstdc++ rewrite. It is still
+This is the eleventh snapshot of the libstdc++ rewrite. It is still
incomplet and incorrekt. It's a lot less incomplete and incorrect than
some of the earlier snapshots though, and quite usable.
@@ -23,55 +23,27 @@ found at the following URL:
New:
---
-- namespace std:: is now on by default.
-- choice of "C" include strategies, including the shadow header work,
- or generic global to std mapping of required "C" types.
-- cpu/atomicity.h tweaks, additions of ia64 and arm support.
-- abstraction of atomicity.h header to support notion of os/atomicity.h files.
-- addition of backward header bits
-- use of system_header pragma
-- Conditional use of -Werror
-- preliminary support for new g++ diagnostics capabilities, including
- -fdiagnostics-show-location=once
-- pedantic and shadow argument warning fixes
-- Ugly, yet correct mechanism for dealing with "C" math adopted,
- including the use of builtins.
-- updates and configure/build work to support new libtool
-- addition of strstream
-- valarray work
-- complex work
-- update to SGI STL 3.3
-- libio sync between glibc/libstdc++-v3. Some divergence since initial
- merge, but sources remain quite close.
-- IO fixes for alpha
-- wide character work for IO when using libio
-- addition of c_io_stdio and "C" IO abstraction layer.
-- auto_ptr fixes, testsuite additions
-- Attempts to use -ffunction-sections -fdata-sections and
- --gc-sections, depending on use of GNU ld and specific features. As of
- late, --gc-sections has been disabled due to problems with it throwing
- away initialization sections. This work is ongoing.
-- long double support
-- sub directory removal, coherent organization of cpu and os-specific
- files, consolidation of include directories, integration of the C++
- support bits for operator new/delete,exceptions, etc. All includes
- are now either in the include/* hierarchy or in libsupc++'s sub directory.
-- Support for more platforms, including irix and bsd variants.
-- filebuf tweaks to deal with variable-size buffers.
-- filebuf implementation for putbackc, etc. al.
-- ctype rewritten. Includes ctype<char>, ctype<wchar_t>, and others.
-- codecvt rewritten. Includes codecvt<char, char, mbstate_t>,
- codecvt<wchar_t, char, mbstate_t>. In addition,
- implementation-defined conversions using iconv are now supported with
- the __enc_traits partial-specialization of the State template
- parameter of the codecvt class. In this manner, conversions between
- encodings such as UCS4, USC2, UNICODE, UNICODEBIG, UNICODELITTLE, etc
- can be performed.
-- preliminary work on named locales
-- preliminary documentation for locale implementation has been established.
-- Many, many bug fixes.
-- Many, many testsuite additions and consistent VERIFY usage.
-- work on mkcheck to make it more flexible, use libtool, etc.
+- preliminary doxygen documentation has been added. Running "make
+ doxygen" in the libstdc++-v3 build directory will generate HTML
+ documentation that can be used to cross-reference names and files in
+ the library.
+- a dejagnu based testing framework has been added
+- a new implementation of the concept checking code has been ported
+ from the boost libraries.
+- support for -fno-exceptions has been added
+- stdexcept was re-written
+- using deprecated or antiquated headers now gives a warning
+- the stdio interface to iostreams has been tweaked, and now works
+ with synchronized c/c++ io
+- new libsupc++ routines implementing the IA-64 C++ ABI.
+- HPUX configuration files
+- support for AIX added
+- a lot of bugs were fixed.
+- preliminary named locales implemented
+- portability improvements made to generation of <limits>
+- speedups to improve configuration time.
+- DJGPP support added.
+- support for dlopening shared libstdc++
What doesn't:
-------------
@@ -108,10 +80,11 @@ Development tools:
------------------
You will need a recent version of gcc to compile the snapshot of
-libstdc++. The use of CVS g++ is strongly recommended. In addition,
-you may need up-to-date tools for modifying Makefiles and regenerating
-configure scripts: automake (version 1.4), autoconf (version 2.13 and
-higher), and libtool.
+libstdc++. The use of CVS gcc, or gcc-3_0-branch is strongly
+recommended, which may introduce additional dependencies for
+up-to-date binutils. In addition, you may need up-to-date tools for
+modifying Makefiles and regenerating configure scripts: automake
+(version 1.4), autoconf (version 2.13 and higher), and libtool.
diff --git a/libstdc++-v3/docs/html/17_intro/TODO b/libstdc++-v3/docs/html/17_intro/TODO
index 4da846277d6..0128b2bb534 100644
--- a/libstdc++-v3/docs/html/17_intro/TODO
+++ b/libstdc++-v3/docs/html/17_intro/TODO
@@ -152,8 +152,6 @@ sources, with macro-guards.
- write filebuf for wide characters
-- replace stl/bits/stl_config
-
- add feature-test macros for non-standard extensions
- move major extensions into separate namespace (e.g. stl::)
@@ -166,8 +164,6 @@ sources, with macro-guards.
facets, and construct them lazily so unused facets need not be constructed
when the locale is.
-- get mknumeric_limits coope with 'exotic' OSes.
-
- <cmath>: provide missing names.
- provide testsuites for numerics.
diff --git a/libstdc++-v3/docs/html/17_intro/concept_check.diff b/libstdc++-v3/docs/html/17_intro/concept_check.diff
new file mode 100644
index 00000000000..afb17f5efd6
--- /dev/null
+++ b/libstdc++-v3/docs/html/17_intro/concept_check.diff
@@ -0,0 +1,382 @@
+
+Changes made while bringing boost/concept_check.hpp to v3's concept_check.h:
+
+1) File format changed from DOS to Unix.
+2) Boost config.hpp and other workaround files dropped (unneeded in g++ v3).
+3) Conditionally-compiled code depending on those "breakage" macros was
+ removed, or not, depending on the macro, so that the macros themselves
+ are gone. Since the same code would always be compiled, let's make it
+ easier on the reader and a few milliseconds faster for cpplib.
+4) Tests for NDEBUG were removed; if NDEBUG is defined, none of the checking
+ code will even be included.
+5) BOOST_CLASS_REQUIRES* changed to accept a namespace parameter.
+6) SameTypeConcept added (simple wrapper around existing code).
+7) An unused variable in OutputIteratorConcept was removed.
+
+At checkin, this was the exact diff, modulo the end-of-line character changes:
+
+
+--- concept_check.hpp.orig Sun Apr 1 08:59:46 2001
++++ boost_concept_check.h Mon Apr 2 18:56:41 2001
+@@ -5,20 +5,15 @@
+ // "as is" without express or implied warranty, and with no claim as
+ // to its suitability for any purpose.
+ //
++
++// GCC Note: based on version 1.12.0 of the Boost library.
+ #ifndef BOOST_CONCEPT_CHECKS_HPP
+ #define BOOST_CONCEPT_CHECKS_HPP
+
+-#include <boost/config.hpp>
+-#include <boost/iterator.hpp>
+-#include <boost/iterator.hpp>
+-#include <utility>
+-#include <boost/pending/limits.hpp>
+-
+-#if (__GNUC__) || defined(__KCC) || defined(__ghs) || defined(__MWERKS__)
+-#define BOOST_FPTR &
+-#else
+-#define BOOST_FPTR
+-#endif
++#pragma GCC system_header
++#include <bits/stl_iterator_base_types.h> // for traits and tags
++#include <utility> // for pair<>
++
+
+ namespace boost {
+
+@@ -27,80 +22,64 @@
+ template <class Concept>
+ void function_requires()
+ {
+-#if !defined(NDEBUG)
+- void (Concept::*x)() = BOOST_FPTR Concept::constraints;
++ void (Concept::*x)() = &Concept::constraints;
+ ignore_unused_variable_warning(x);
+-#endif
+ }
+
+-// The BOOST_CLASS_REQUIRES macros use function pointers as
+-// template parameters, which VC++ does not support.
+-
+-#if defined(BOOST_NO_FUNCTION_PTR_TEMPLATE_PARAMETERS)
+-
+-#define BOOST_CLASS_REQUIRES(type_var, concept)
+-#define BOOST_CLASS_REQUIRES2(type_var1, type_var2, concept)
+-#define BOOST_CLASS_REQUIRES3(type_var1, type_var2, type_var3, concept)
+-#define BOOST_CLASS_REQUIRES4(type_var1, type_var2, type_var3, type_var4, concept)
+
+-#else
+-
+-#define BOOST_CLASS_REQUIRES(type_var, concept) \
+- typedef void (concept <type_var>::* func##type_var##concept)(); \
++#define BOOST_CLASS_REQUIRES(type_var, ns, concept) \
++ typedef void (ns::concept <type_var>::* func##type_var##concept)(); \
+ template <func##type_var##concept _Tp1> \
+ struct concept_checking_##type_var##concept { }; \
+ typedef concept_checking_##type_var##concept< \
+- BOOST_FPTR concept <type_var>::constraints> \
++ &ns::concept <type_var>::constraints> \
+ concept_checking_typedef_##type_var##concept
+
+-#define BOOST_CLASS_REQUIRES2(type_var1, type_var2, concept) \
+- typedef void (concept <type_var1,type_var2>::* func##type_var1##type_var2##concept)(); \
++#define BOOST_CLASS_REQUIRES2(type_var1, type_var2, ns, concept) \
++ typedef void (ns::concept <type_var1,type_var2>::* func##type_var1##type_var2##concept)(); \
+ template <func##type_var1##type_var2##concept _Tp1> \
+ struct concept_checking_##type_var1##type_var2##concept { }; \
+ typedef concept_checking_##type_var1##type_var2##concept< \
+- BOOST_FPTR concept <type_var1,type_var2>::constraints> \
++ &ns::concept <type_var1,type_var2>::constraints> \
+ concept_checking_typedef_##type_var1##type_var2##concept
+
+-#define BOOST_CLASS_REQUIRES3(type_var1, type_var2, type_var3, concept) \
+- typedef void (concept <type_var1,type_var2,type_var3>::* func##type_var1##type_var2##type_var3##concept)(); \
++#define BOOST_CLASS_REQUIRES3(type_var1, type_var2, type_var3, ns, concept) \
++ typedef void (ns::concept <type_var1,type_var2,type_var3>::* func##type_var1##type_var2##type_var3##concept)(); \
+ template <func##type_var1##type_var2##type_var3##concept _Tp1> \
+ struct concept_checking_##type_var1##type_var2##type_var3##concept { }; \
+ typedef concept_checking_##type_var1##type_var2##type_var3##concept< \
+- BOOST_FPTR concept <type_var1,type_var2,type_var3>::constraints> \
++ &ns::concept <type_var1,type_var2,type_var3>::constraints> \
+ concept_checking_typedef_##type_var1##type_var2##type_var3##concept
+
+-#define BOOST_CLASS_REQUIRES4(type_var1, type_var2, type_var3, type_var4, concept) \
+- typedef void (concept <type_var1,type_var2,type_var3,type_var4>::* func##type_var1##type_var2##type_var3##type_var4##concept)(); \
++#define BOOST_CLASS_REQUIRES4(type_var1, type_var2, type_var3, type_var4, ns, concept) \
++ typedef void (ns::concept <type_var1,type_var2,type_var3,type_var4>::* func##type_var1##type_var2##type_var3##type_var4##concept)(); \
+ template <func##type_var1##type_var2##type_var3##type_var4##concept _Tp1> \
+ struct concept_checking_##type_var1##type_var2##type_var3##type_var4##concept { }; \
+ typedef concept_checking_##type_var1##type_var2##type_var3##type_var4##concept< \
+- BOOST_FPTR concept <type_var1,type_var2,type_var3,type_var4>::constraints> \
++ &ns::concept <type_var1,type_var2,type_var3,type_var4>::constraints> \
+ concept_checking_typedef_##type_var1##type_var2##type_var3##type_var4##concept
+
+
+-#endif
+-
+-#if !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ template <class T, class U>
+ struct require_same { };
+
+ template <class T>
+ struct require_same<T,T> { typedef T type; };
+-#else
+-// This version does not perform checking, but will not do any harm.
+-template <class T, class U>
+-struct require_same { typedef T type; };
+-#endif
++
++ template <class T, class U>
++ struct SameTypeConcept
++ {
++ void constraints() {
++ typedef typename require_same<T, U>::type req;
++ }
++ };
+
+ template <class T>
+ struct IntegerConcept {
+ void constraints() {
+-#if !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ errortype_must_be_an_integer_type();
+-#endif
+ }
+ };
+-#if !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ template <> struct IntegerConcept<short> { void constraints() {} };
+ template <> struct IntegerConcept<unsigned short> { void constraints() {} };
+ template <> struct IntegerConcept<int> { void constraints() {} };
+@@ -108,32 +87,24 @@
+ template <> struct IntegerConcept<long> { void constraints() {} };
+ template <> struct IntegerConcept<unsigned long> { void constraints() {} };
+ // etc.
+-#endif
+
+ template <class T>
+ struct SignedIntegerConcept {
+ void constraints() {
+-#if !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ errortype_must_be_a_signed_integer_type();
+-#endif
+ }
+ };
+-#if !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ template <> struct SignedIntegerConcept<short> { void constraints() {} };
+ template <> struct SignedIntegerConcept<int> { void constraints() {} };
+ template <> struct SignedIntegerConcept<long> { void constraints() {} };
+ // etc.
+-#endif
+
+ template <class T>
+ struct UnsignedIntegerConcept {
+ void constraints() {
+-#if !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ errortype_must_be_an_unsigned_integer_type();
+-#endif
+ }
+ };
+-#if !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ template <> struct UnsignedIntegerConcept<unsigned short>
+ { void constraints() {} };
+ template <> struct UnsignedIntegerConcept<unsigned int>
+@@ -141,7 +112,6 @@
+ template <> struct UnsignedIntegerConcept<unsigned long>
+ { void constraints() {} };
+ // etc.
+-#endif
+
+ //===========================================================================
+ // Basic Concepts
+@@ -159,15 +129,11 @@
+ struct AssignableConcept
+ {
+ void constraints() {
+-#if !defined(_ITERATOR_) // back_insert_iterator broken for VC++ STL
+ a = a; // require assignment operator
+-#endif
+ const_constraints(a);
+ }
+ void const_constraints(const TT& b) {
+-#if !defined(_ITERATOR_) // back_insert_iterator broken for VC++ STL
+ a = b; // const required for argument to assignment
+-#endif
+ }
+ TT a;
+ };
+@@ -196,17 +162,13 @@
+ {
+ void constraints() {
+ TT b(a);
+-#if !defined(_ITERATOR_) // back_insert_iterator broken for VC++ STL
+ a = a; // require assignment operator
+-#endif
+ const_constraints(a);
+ ignore_unused_variable_warning(b);
+ }
+ void const_constraints(const TT& b) {
+ TT c(b);
+-#if !defined(_ITERATOR_) // back_insert_iterator broken for VC++ STL
+ a = b; // const required for argument to assignment
+-#endif
+ ignore_unused_variable_warning(c);
+ }
+ TT a;
+@@ -304,6 +266,9 @@
+ BOOST_DEFINE_BINARY_OPERATOR_CONSTRAINT(-, SubtractOpConcept);
+ BOOST_DEFINE_BINARY_OPERATOR_CONSTRAINT(%, ModOpConcept);
+
++#undef BOOST_DEFINE_BINARY_PREDICATE_OP_CONSTRAINT
++#undef BOOST_DEFINE_BINARY_OPERATOR_CONSTRAINT
++
+ //===========================================================================
+ // Function Object Concepts
+
+@@ -318,7 +283,6 @@
+ };
+
+
+-#if !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ template <class Func>
+ struct GeneratorConcept<Func,void>
+ {
+@@ -327,7 +291,6 @@
+ }
+ Func f;
+ };
+-#endif
+
+ template <class Func, class Return, class Arg>
+ struct UnaryFunctionConcept
+@@ -340,7 +303,6 @@
+ Return r;
+ };
+
+-#if !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ template <class Func, class Arg>
+ struct UnaryFunctionConcept<Func, void, Arg> {
+ void constraints() {
+@@ -348,7 +310,6 @@
+ }
+ Func f;
+ };
+-#endif
+
+ template <class Func, class Return, class First, class Second>
+ struct BinaryFunctionConcept
+@@ -362,7 +323,6 @@
+ Return r;
+ };
+
+-#if !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ template <class Func, class First, class Second>
+ struct BinaryFunctionConcept<Func, void, First, Second>
+ {
+@@ -373,7 +333,6 @@
+ First first;
+ Second second;
+ };
+-#endif
+
+ template <class Func, class Arg>
+ struct UnaryPredicateConcept
+@@ -422,9 +381,7 @@
+ function_requires< AssignableConcept<TT> >();
+ function_requires< DefaultConstructibleConcept<TT> >();
+ function_requires< EqualityComparableConcept<TT> >();
+-#ifndef BOOST_NO_STD_ITERATOR_TRAITS
+ typedef typename std::iterator_traits<TT>::value_type V;
+-#endif
+ (void)*i; // require dereference operator
+ }
+ TT i;
+@@ -446,7 +403,6 @@
+ void constraints() {
+ function_requires< TrivialIteratorConcept<TT> >();
+ // require iterator_traits typedef's
+-#ifndef BOOST_NO_STD_ITERATOR_TRAITS
+ typedef typename std::iterator_traits<TT>::difference_type D;
+ function_requires< SignedIntegerConcept<D> >();
+ typedef typename std::iterator_traits<TT>::reference R;
+@@ -455,7 +411,6 @@
+ function_requires< ConvertibleConcept<
+ typename std::iterator_traits<TT>::iterator_category,
+ std::input_iterator_tag> >();
+-#endif
+ ++i; // require preincrement operator
+ i++; // require postincrement operator
+ }
+@@ -471,7 +426,7 @@
+ i++; // require postincrement operator
+ *i++ = t; // require postincrement and assignment
+ }
+- TT i, j;
++ TT i;
+ ValueT t;
+ };
+
+@@ -480,14 +435,12 @@
+ {
+ void constraints() {
+ function_requires< InputIteratorConcept<TT> >();
+-#ifndef BOOST_NO_STD_ITERATOR_TRAITS
+ function_requires< ConvertibleConcept<
+ typename std::iterator_traits<TT>::iterator_category,
+ std::forward_iterator_tag> >();
+ typedef typename std::iterator_traits<TT>::reference reference;
+ reference r = *i;
+ ignore_unused_variable_warning(r);
+-#endif
+ }
+ TT i;
+ };
+@@ -507,11 +460,9 @@
+ {
+ void constraints() {
+ function_requires< ForwardIteratorConcept<TT> >();
+-#ifndef BOOST_NO_STD_ITERATOR_TRAITS
+ function_requires< ConvertibleConcept<
+ typename std::iterator_traits<TT>::iterator_category,
+ std::bidirectional_iterator_tag> >();
+-#endif
+ --i; // require predecrement operator
+ i--; // require postdecrement operator
+ }
+@@ -536,12 +487,10 @@
+ void constraints() {
+ function_requires< BidirectionalIteratorConcept<TT> >();
+ function_requires< ComparableConcept<TT> >();
+-#ifndef BOOST_NO_STD_ITERATOR_TRAITS
+ function_requires< ConvertibleConcept<
+ typename std::iterator_traits<TT>::iterator_category,
+ std::random_access_iterator_tag> >();
+ typedef typename std::iterator_traits<TT>::reference R;
+-#endif
+
+ i += n; // require assignment addition operator
+ i = i + n; i = n + i; // require addition with difference type
+@@ -552,11 +501,7 @@
+ }
+ TT a, b;
+ TT i, j;
+-#ifndef BOOST_NO_STD_ITERATOR_TRAITS
+ typename std::iterator_traits<TT>::difference_type n;
+-#else
+- std::ptrdiff_t n;
+-#endif
+ };
+
+ template <class TT>
+@@ -568,11 +513,7 @@
+ i[n] = *i; // require element access and assignment
+ }
+ TT i;
+-#ifndef BOOST_NO_STD_ITERATOR_TRAITS
+ typename std::iterator_traits<TT>::difference_type n;
+-#else
+- std::ptrdiff_t n;
+-#endif
+ };
+
+ //===========================================================================
+
diff --git a/libstdc++-v3/docs/html/17_intro/headers_cc.txt b/libstdc++-v3/docs/html/17_intro/headers_cc.txt
index d95f17aee68..eb930f1ff00 100644
--- a/libstdc++-v3/docs/html/17_intro/headers_cc.txt
+++ b/libstdc++-v3/docs/html/17_intro/headers_cc.txt
@@ -80,4 +80,4 @@
#include <cwctype>
#endif
-int main() { }
+int main() { return 0; }
diff --git a/libstdc++-v3/docs/html/17_intro/howto.html b/libstdc++-v3/docs/html/17_intro/howto.html
index 707d04ded47..abbeb814d50 100644
--- a/libstdc++-v3/docs/html/17_intro/howto.html
+++ b/libstdc++-v3/docs/html/17_intro/howto.html
@@ -1,156 +1,180 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-<HEAD>
- <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
- <META NAME="AUTHOR" CONTENT="pme@sources.redhat.com (Phil Edwards)">
- <META NAME="KEYWORDS" CONTENT="HOWTO, libstdc++, gcc, g++, libg++, STL">
- <META NAME="DESCRIPTION" CONTENT="HOWTO for libstdc++ chapter 17.">
- <META NAME="GENERATOR" CONTENT="vi and eight fingers">
- <TITLE>libstdc++-v3 HOWTO: Chapter 17</TITLE>
-<LINK REL=StyleSheet HREF="../lib3styles.css">
-<!-- $Id: howto.html,v 1.6 2000/12/03 23:47:47 jsm28 Exp $ -->
-</HEAD>
-<BODY>
-
-<H1 CLASS="centered"><A NAME="top">Chapter 17: Library Introduction</A></H1>
-
-<P>Chapter 17 is actually a list of definitions and descriptions used
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="AUTHOR" content="pme@gcc.gnu.org (Phil Edwards)">
+ <meta name="KEYWORDS" content="HOWTO, libstdc++, gcc, g++, libg++, STL">
+ <meta name="DESCRIPTION" content="HOWTO for libstdc++ chapter 17.">
+ <meta name="GENERATOR" content="vi and eight fingers">
+ <title>libstdc++-v3 HOWTO: Chapter 17</title>
+<link rel="StyleSheet" href="../lib3styles.css">
+</head>
+<body>
+
+<h1 class="centered"><a name="top">Chapter 17: Library Introduction</a></h1>
+
+<p>Chapter 17 is actually a list of definitions and descriptions used
in the following chapters of the Standard when describing the actual
library. Here, we use &quot;Introduction&quot; as an introduction
- to the <EM>GNU implementation of</EM> the ISO Standard C++ Library.
-</P>
+ to the <em>GNU implementation of</em> the ISO Standard C++ Library.
+</p>
<!-- ####################################################### -->
-<HR>
-<H1>Contents</H1>
-<UL>
- <LI><A HREF="#2">The Standard C++ header files</A>
- <LI><A HREF="#3">Thread-safety</A>
- <LI><A HREF="#4"><TT>&lt;foo&gt;</TT> vs <TT>&lt;foo.h&gt;</TT></A>
- <LI><A HREF="porting-howto.html">Porting-howto</A>
-</UL>
+<hr>
+<h1>Contents</h1>
+<ul>
+ <li><a href="#2">The Standard C++ header files</a>
+ <li><a href="#3">The Standard C++ library and multithreading</a>
+ <li><a href="#4"><code>&lt;foo&gt;</code> vs <code>&lt;foo.h&gt;</code></a>
+ <li><a href="porting-howto.html">Porting HOWTO</a>
+</ul>
-<HR>
+<hr>
<!-- ####################################################### -->
-<H2><A NAME="2">The Standard C++ header files</A></H2>
- <P>The Standard C++ Library specifies 50 header files that must be
+<h2><a name="2">The Standard C++ header files</a></h2>
+ <p>The Standard C++ Library specifies 50 header files that must be
available to all hosted implementations. Actually, the word
&quot;files&quot; is a misnomer, since the contents of the headers
don't necessarily have to be in any kind of external file. The
- only rule is that when you <TT>#include</TT> a certain header, the
+ only rule is that when you <code>#include</code> a certain header, the
contents of that header, as defined by the Standard, become
available to you, no matter how.
- </P>
- <P>The names of the headers can be easily seen in
- <A HREF="headers_cc.txt"><TT>testsuite/17_intro/headers.cc</TT></A>,
+ </p>
+ <p>The names of the headers can be easily seen in
+ <a href="headers_cc.txt"><code>testsuite/17_intro/headers.cc</code></a>,
which is a small testbed we use to make certain that the headers
all compile and run.
- </P>
-
-<HR>
-<H2><A NAME="3">Thread-safety</A></H2>
- <P>This is a thorny issue that gets brought up on the libstdc++-v3
- and gcc mailing lists on a regular basis (probably by a cron job).
- This entry will mention a very little bit about the general MT
- issues with libstdc++. The latest status and quick notes will be
- in FAQ 5.6. Some discussion about threadsafe containers will be
- in section 6.8 (the HOWTOs on containers).
- </P>
- <P>The libstdc++ code (all of it, not just the containers) has been
- designed so that thread-safety will be easily possible. The first
- (!) problem is finding a <EM>fast</EM> method of implementation
- portable to all platforms. A minor problem that pops up every so
- often is different interpretations of what &quot;thread-safe&quot;
- means for a library (not a general program). We currently use the
- <A HREF="http://www.sgi.com/Technology/STL/thread_safety.html">same
- definition that SGI</A> uses for their STL subset.
- </P>
- <P>A recent journal article has described &quot;atomic integer
- operations,&quot; which would allow us to, well, perform updates
- on integers atomically, and without requiring an explicit mutex
- lock. This appears promising, but the major difficulty is that
- these operations &quot;may not be available on all systems, and
- if they are, may have different interfaces.&quot; [quoting from
- mailing list messages]
- </P>
- <P>Here is a small link farm to threads (no pun) in the mail archives
+ </p>
+
+<hr>
+<h2><a name="3">The Standard C++ library and multithreading</a></h2>
+ <p>This section discusses issues surrounding the proper compilation
+ of multithreaded applications which use the Standard C++
+ library. This information is gcc-specific since the C++
+ standard does not address matters of multithreaded applications.
+ Unless explicitly prefaced, all information in this section is
+ current as of the gcc 3.0 release and all later point releases.
+ </p>
+ <p>Earlier gcc releases had a somewhat different approach to
+ threading configuration and proper compilation. Before gcc 3.0,
+ configuration of the threading model was dictated by compiler
+ command-line options and macros (both of which were somewhat
+ thread-implementation and port-specific). There were no
+ guarantees related to being able to link code compiled with one
+ set of options and macro setting with another set. For gcc 3.0,
+ configuration of the threading model used with libraries and
+ user-code is performed when gcc is configured and built using
+ the --enable-threads and --disable-threads options. The ABI is
+ stable for symbol name-mangling and limited functional
+ compatibility exists between code compiled under different
+ threading models.
+ </p>
+ <p>All normal disclaimers aside, multithreaded C++ application are
+ only supported when libstdc++ and all user code was built with
+ compilers which report (via <code> gcc/g++ -v </code>) the same thread
+ model and that model is not <em>single</em>. As long as your
+ final application is actually single-threaded, then it should be
+ safe to mix user code built with a thread model of
+ <em>single</em> with a libstdc++ and other C++ libraries built
+ with another thread model useful on the platform. Other mixes
+ may or may not work but are not considered supported. (Thus, if
+ you distribute a shared C++ library in binary form only, it may
+ be best to compile it with a gcc configured with
+ --enable-threads for maximal interchangeability and usefulness
+ with a user population that may have built gcc with either
+ --enable-threads or --disable-threads.)
+ </p>
+ <p>When you link a multithreaded application, you will probably
+ need to add a library or flag to g++. This is a very
+ non-standardized area of GCC across ports. Some ports support a
+ special flag (the spelling isn't even standardized yet) to add
+ all required macros to a compilation (if any such flags are
+ required then you must provide the flag for all compilations not
+ just linking) and link-library additions and/or replacements at
+ link time. The documentation is weak. Here is a quick summary
+ to display how ad hoc this is: On Solaris, both -pthreads and
+ -threads (with subtly different meanings) are honored. On OSF,
+ -pthread and -threads (with subtly different meanings) are
+ honored. On Linux/i386, -pthread is honored. On FreeBSD,
+ -pthread is honored. Some other ports use other switches.
+ AFAIK, none of this is properly documented anywhere other than
+ in ``gcc -dumpspecs'' (look at lib and cpp entries).
+ </p>
+ <p>See <a href="../faq/index.html#3">FAQ</a> (general overview), <a
+ href="../23_containers/howto.html#3">23</a> (containers), and <a
+ href="../27_io/howto.html#9">27</a> (I/O) for more information.
+ </p>
+ <p>The libstdc++-v3 library (unlike libstdc++-v2, all of it, not
+ just the STL) has been designed so that multithreaded
+ applications using it may be written. The first problem is
+ finding a <em>fast</em> method of implementation portable to all
+ platforms. Due to historical reasons, some of the library is
+ written against per-CPU-architecture spinlocks and other parts
+ against the gthr.h abstraction layer which is provided by gcc.
+ A minor problem that pops up every so often is different
+ interpretations of what &quot;thread-safe&quot; means for a
+ library (not a general program). We currently use the <a
+ href="http://www.sgi.com/tech/stl/thread_safety.html">same
+ definition that SGI</a> uses for their STL subset. However, the
+ exception for read-only containers only applies to the STL
+ components.
+ </p>
+ <p>Here is a small link farm to threads (no pun) in the mail archives
that discuss the threading problem. Each link is to the first
- relevent message in the thread; from there you can use
+ relevant message in the thread; from there you can use
&quot;Thread Next&quot; to move down the thread. This farm is in
latest-to-oldest order.
- <UL>
- <LI>
- </UL>
- <BR>
- Here are discussions that took place before the current snapshot;
- they are still relevant and instructive.
- <BR>
- <UL>
- <LI>One way of preventing memory leaks by the old default memory
- allocator in multithreaded code is
- <A HREF="http://gcc.gnu.org/ml/gcc/1999-11n/msg00431.html">discussed here</A>.
- <LI><A HREF="http://gcc.gnu.org/ml/libstdc++/1999-q3/msg00167.html">This thread
- concerns strings</A>.
- <LI><A HREF="http://gcc.gnu.org/ml/libstdc++/1999-q2/msg00339.html">So does this
- one</A>. This initial message also refers to another
- thread in the GCC mailing list...
- <LI><A HREF="http://gcc.gnu.org/ml/gcc/1999-06n/msg00680.html">which is here</A>,
- and goes on for some time. Ironically, the initial message
- in this thread also mentions another threading thread...
- <LI><A HREF="http://gcc.gnu.org/ml/gcc-bugs/1999-04n/msg00777.html">beginning here</A>,
- and talking about pthreads. (Note that a much more recent
- message from the first thread in this list notes that
- <A HREF="http://gcc.gnu.org/ml/libstdc++/1999-q3/msg00176.html">pthreads
- should not be used as a starting point</A> for making
- libstdc++ threadsafe.)
- <LI><A HREF="http://gcc.gnu.org/ml/libstdc++/1999-q2/msg00168.html">This
- message</A>,
- <A HREF="http://gcc.gnu.org/ml/libstdc++/1999-q2/msg00159.html">this one</A>,
- and <A HREF="http://gcc.gnu.org/ml/libstdc++/1999-q2/msg00156.html">this one</A>
- are the tops of related threads (all within the same time
- period) discussing threading and the IO library. Much of it
- is dealing with the C library, but C++ is included as well.
- </UL>
- </P>
- <P>This section will be updated as new and interesting issues come
+ <ul>
+ <li>Our threading expert Loren gives a breakdown of
+ <a href="http://gcc.gnu.org/ml/libstdc++/2001-10/msg00024.html">the
+ six situations involving threads</a> for the 3.0 release series.
+ <li><a href="http://gcc.gnu.org/ml/libstdc++/2001-05/msg00384.html">
+ This message</a> inspired a recent updating of issues with threading
+ and the SGI STL library. It also contains some example
+ POSIX-multithreaded STL code.
+ </ul>
+ (A large selection of links to older messages has been removed; many
+ of the messages from 1999 were lost in a disk crash, and the few
+ people with access to the backup tapes have been too swamped with work
+ to restore them. Many of the points have been superseded anyhow.)
+ </p>
+ <p>This section will be updated as new and interesting issues come
to light.
- </P>
- <P>Return <A HREF="#top">to top of page</A> or
- <A HREF="../faq/index.html">to the FAQ</A>.
- </P>
-
-<HR>
-<H2><A NAME="4"><TT>&lt;foo&gt;</TT> vs <TT>&lt;foo.h&gt;</TT></A></H2>
- <P>The new-style headers are fully supported in libstdc++-v3. The compiler
- itself fully supports namespaces. However, at the moment, the compiler
- treats std:: as the global namespace by default.
- </P>
- <P>For those of you new to ISO C++98, no, that isn't a typo, the headers
+ </p>
+ <p>Return <a href="#top">to top of page</a> or
+ <a href="../faq/index.html">to the FAQ</a>.
+ </p>
+
+<hr>
+<h2><a name="4"><code>&lt;foo&gt;</code> vs <code>&lt;foo.h&gt;</code></a></h2>
+ <p>The new-style headers are fully supported in libstdc++-v3. The compiler
+ itself fully supports namespaces, including <code>std::</code>.
+ </p>
+ <p>For those of you new to ISO C++98, no, that isn't a typo, the headers
really have new names. Marshall Cline's C++ FAQ Lite has a good
explanation in
-<A HREF="http://www.cerfnet.com/~mpcline/On-Line-C++-FAQ/coding-standards.html#[25.4]">item [25.4]</A>.
- </P>
- <P>Return <A HREF="#top">to top of page</A> or
- <A HREF="../faq/index.html">to the FAQ</A>.
- </P>
+<a href="http://www.cerfnet.com/~mpcline/On-Line-C++-FAQ/coding-standards.html#[25.4]">item [25.4]</a>.
+ </p>
+ <p>Return <a href="#top">to top of page</a> or
+ <a href="../faq/index.html">to the FAQ</a>.
+ </p>
<!-- ####################################################### -->
-<HR>
-<P CLASS="fineprint"><EM>
+<hr>
+<p class="fineprint"><em>
+See <a href="license.html">license.html</a> for copying conditions.
Comments and suggestions are welcome, and may be sent to
-<A HREF="mailto:pme@sources.redhat.com">Phil Edwards</A> or
-<A HREF="mailto:gdr@gcc.gnu.org">Gabriel Dos Reis</A>.
-<BR> $Id: howto.html,v 1.6 2000/12/03 23:47:47 jsm28 Exp $
-</EM></P>
+<a href="mailto:libstdc++@gcc.gnu.org">the libstdc++ mailing list</a>.
+</em></p>
-</BODY>
-</HTML>
+</body>
+</html>
diff --git a/libstdc++-v3/docs/html/17_intro/license.html b/libstdc++-v3/docs/html/17_intro/license.html
new file mode 100644
index 00000000000..c3449b1ff2f
--- /dev/null
+++ b/libstdc++-v3/docs/html/17_intro/license.html
@@ -0,0 +1,107 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="AUTHOR" content="pme@gcc.gnu.org (Phil Edwards)">
+ <meta name="KEYWORDS" content="libstdc++, license, licence">
+ <meta name="DESCRIPTION" content="Copying restrictions for libstdc++.">
+ <meta name="GENERATOR" content="vi and eight fingers">
+ <title>libstdc++-v3 copying</title>
+<link rel="StyleSheet" href="../lib3styles.css">
+</head>
+<body>
+
+<h1 class="centered"><a name="top">Licenses for the Library</a></h1>
+
+<p>There are two licenses affecting GNU libstdc++-v3: one for the code, and
+ one for the documentation. Here we will describe both of them, and try
+ to answer some of the widespread questions. If you have more questions,
+ ask the FSF or the
+ <a href="http://gcc.gnu.org/lists.html">gcc mailing list</a>; the person
+ writing this page is a programmer, not a lawyer.
+</p>
+
+<hr>
+
+<h2>The Code: Runtime GPL</h2>
+
+<p>The source code of libstdc++-v3 is distributed under version 2 of the
+ <a href="COPYING">GNU General Public License</a>, with the so-called
+ &quot;runtime exception,&quot; as follows (or see any header or
+ implementation file):
+ <pre>
+ 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.
+ </pre>
+</p>
+
+<p>Hopefully that text is self-explanatory. If it isn't, you need to speak
+ to your lawyer, or the Free Software Foundation.
+</p>
+
+<!-- Most of the Q&A's are based on, paraphrased from, and outright stolen
+ from this thread:
+ http://gcc.gnu.org/ml/libstdc++/2000-q2/subjects.html#00050
+-->
+<p><strong>Q: So any program which uses libstdc++ falls under the GPL?</strong>
+ <br>A: <strong>No.</strong> The special exception permits use of the
+ library in proprietary applications.
+</p>
+
+<p><strong>Q: How is that different from the GNU {Lesser,Library}
+ GPL?</strong>
+ <!-- Quoting Jason Merrill from the thread above: -->
+ <br>A: The LGPL requires that users be able to replace the LGPL code with a
+ modified version; this is trivial if the library in question is a C
+ shared library. But there's no way to make that work with C++, where
+ much of the library consists of inline functions and templates, which
+ are expanded inside the code that uses the library. So to allow people
+ to replace the library code, someone using the library would have to
+ distribute their own source, rendering the LGPL equivalent to the GPL.
+</p>
+
+<p><strong>Q: I see. So, what restrictions <em>are</em> there on
+ programs that use the library?</strong>
+ <br>A: None. We encourage such programs to be released as open source,
+ but we won't punish you or sue you if you choose otherwise.
+</p>
+
+<hr>
+
+<h2>The Docs: FDL</h2>
+
+<p>The documentation shipped with the library and made available over the
+ web, including the pages generated from source comments, are copyrighted
+ by the Free Software Foundation, and placed under
+ the <a href="COPYING.DOC">GNU Free Documentation License version 1.1</a>.
+ There are no Front-Cover Texts, no Back-Cover Texts, and
+ <!-- as far as I know -->
+ no Invariant Sections.
+</p>
+
+<p>If you plan on making copies of the documentation, please let us know.
+ We can probably offer suggestions.
+</p>
+
+
+<!-- ####################################################### -->
+
+<hr>
+<p class="fineprint"><em>
+Comments and suggestions about this page are welcome, and may be sent to
+<a href="mailto:libstdc++@gcc.gnu.org">the libstdc++ mailing list</a>.
+Comments or questions about the licenses themselves are also welcome, and
+should be directed to the GCC list as descibed above.
+</em></p>
+
+
+</body>
+</html>
+
+
diff --git a/libstdc++-v3/docs/html/17_intro/porting-howto.html b/libstdc++-v3/docs/html/17_intro/porting-howto.html
index 54290b328c2..c9a45c3bbfc 100644
--- a/libstdc++-v3/docs/html/17_intro/porting-howto.html
+++ b/libstdc++-v3/docs/html/17_intro/porting-howto.html
@@ -1,726 +1,802 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
- <head>
- <title>Libstdc++-porting-howto</title>
- <meta content="DocBook XSL Stylesheets V1.16" name="generator">
- </head>
- <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
- <div class="article" id="libstdporting">
- <div class="titlepage">
- <h1 class="title">
- <a name="libstdporting">Libstdc++-porting-howto</a>
- </h1>
- <h3 class="author">Felix Natter</h3>
- <p>
- This document can be distributed under the FDL
- (<a href="http://www.gnu.org">www.gnu.org</a>)
- </p>
- <p class="pubdate">what kind of a date ? I don't drink !</p>
- <div class="revhistory">
- <table width="100%" border="1">
- <tr>
- <th colspan="3" valign="top" align="left"><b>Revision History</b></th>
- </tr>
- <tr>
- <td align="left">Revision 0.5</td><td align="left">Thu Jun 1 13:06:50 2000</td><td align="left">fnatter</td>
- </tr>
- <tr>
- <td colspan="3" align="left">First docbook-version.</td>
- </tr>
- <tr>
- <td align="left">Revision 0.8</td><td align="left">Sun Jul 30 20:28:40 2000</td><td align="left">fnatter</td>
- </tr>
- <tr>
- <td colspan="3" align="left">First released version using docbook-xml
- + second upload to libstdc++-page.
- </td>
- </tr>
- <tr>
- <td align="left">Revision 0.9</td><td align="left">Wed Sep 6 02:59:32 2000</td><td align="left">fnatter</td>
- </tr>
- <tr>
- <td colspan="3" align="left">5 new sections.</td>
- </tr>
- </table>
- </div>
- <div class="abstract">
- <p>
- <a name="N2688"></a><b>Abstract</b>
- </p>
- <p>
- Some notes on porting applications from libstdc++-2.90 (or earlier
- versions) to libstdc++-v3. Not speaking in terms of the GNU libstdc++
- implementations, this means porting from earlier versions of the
- C++-Standard to ISO 14882.
- </p>
- </div>
- <hr>
- </div>
- <div class="toc">
- <p>
- <b>Table of Contents</b>
- </p>
- <dl>
- <dt>1. <a href="#sec-nsstd">Namespace std::</a>
- </dt>
- <dd>
- <dl>
- <dt>1.1.1. <a href="#sec-gtkmm-hack">Using <i>namespace
- composition</i> if the project uses a separate
- namespace</a>
- </dt>
- <dt>1.1.2. <a href="#sec-emptyns">Defining an empty namespace std</a>
- </dt>
- <dt>1.1.3. <a href="#sec-avoidfqn">Avoid to use fully qualified names
- (i.e. std::string)</a>
- </dt>
- <dt>1.1.4. <a href="#sec-osprojects">How some open-source-projects deal
- with this</a>
- </dt>
- </dl>
- </dd>
- <dt>2. <a href="#sec-nocreate">there is no ios::nocreate/ios::noreplace
- in ISO 14882</a>
- </dt>
- <dt>3. <a href="#sec-stream::attach"><b>stream::attach(int
- fd)</b> is not in the standard any more</a>
- </dt>
- <dt>4. <a href="#sec-headers">The new headers</a>
- </dt>
- <dd>
- <dl>
- <dt>4.4.1. <a href="#sec-cheaders">New headers replacing C-headers</a>
- </dt>
- <dt>4.4.2. <a href="#sec-fstream-header">
- <tt>&lt;fstream&gt;</tt> does
- not define <b>std::cout</b>,
- <b>std::cin</b> etc.</a>
- </dt>
- </dl>
- </dd>
- <dt>5. <a href="#sec-iterators">Iterators</a>
- </dt>
- <dt>6. <a href="#sec-macros">
- Libc-macros (i.e. <b>isspace</b> from
- <tt>&lt;cctype&gt;</tt>)</a>
- </dt>
- <dt>7. <a href="#sec-stream-state">
- State of streams
- </a>
- </dt>
- <dt>8. <a href="#sec-vector-at">vector::at is missing (i.e. gcc 2.95.2)</a>
- </dt>
- <dt>9. <a href="#sec-eof">Using std::char_traits&lt;char&gt;::eof()</a>
- </dt>
- <dt>10. <a href="#sec-string-clear">Using string::clear()/string::erase()</a>
- </dt>
- <dt>11. <a href="#sec-stringstream">Using stringstream's</a>
- </dt>
- <dt>12. <a href="#sec-about">About...</a>
- </dt>
- </dl>
- </div>
- <p>
- In the following, when I say portable, I will refer to "portable among ISO
- 14882-implementations". On the other hand, if I say "backportable" or
- "conservative", I am talking about "compiles with older
- libstdc++-implementations".
+<head>
+<meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type">
+<title>Libstdc++-porting-howto</title>
+<meta name="generator" content="DocBook XSL Stylesheets V1.29">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div id="libstdc++-porting-howto" class="article">
+<div class="titlepage">
+<div><h1 class="title">
+<a name="libstdc++-porting-howto"></a>Libstdc++-porting-howto</h1></div>
+<div><h3 class="author">Felix Natter</h3></div>
+<div><div class="legalnotice">
+<p class="legalnotice-title"><b>Legal Notice</b></p>
+<p>
+ This document can be distributed under the FDL
+ (<a href="http://www.gnu.org" target="_top">www.gnu.org</a>)
+ </p>
+</div></div>
+<div><p class="pubdate">Tue Jun 5 20:07:49 2001</p></div>
+<div><div class="revhistory"><table border="1" width="100%" summary="Revision history">
+<tr><th align="left" valign="top" colspan="3"><b>Revision History</b></th></tr>
+<tr>
+<td align="left">Revision 0.5</td>
+<td align="left">Thu Jun 1 13:06:50 2000</td>
+<td align="left">fnatter</td>
+</tr>
+<tr><td align="left" colspan="3">First docbook-version.</td></tr>
+<tr>
+<td align="left">Revision 0.8</td>
+<td align="left">Sun Jul 30 20:28:40 2000</td>
+<td align="left">fnatter</td>
+</tr>
+<tr><td align="left" colspan="3">First released version using docbook-xml
+ + second upload to libstdc++-page.
+ </td></tr>
+<tr>
+<td align="left">Revision 0.9</td>
+<td align="left">Wed Sep 6 02:59:32 2000</td>
+<td align="left">fnatter</td>
+</tr>
+<tr><td align="left" colspan="3">5 new sections.</td></tr>
+<tr>
+<td align="left">Revision 0.9.1</td>
+<td align="left">Sat Sep 23 14:20:15 2000</td>
+<td align="left">fnatter</td>
+</tr>
+<tr><td align="left" colspan="3">added information about why file-descriptors are not in the
+ standard</td></tr>
+<tr>
+<td align="left">Revision 0.9.2</td>
+<td align="left">Tue Jun 5 20:07:49 2001</td>
+<td align="left">fnatter</td>
+</tr>
+<tr><td align="left" colspan="3">
+ a fix, added hint on increased portability of C-shadow-headers,
+ added autoconf-test HAVE_CONTAINER_AT
+ </td></tr>
+<tr>
+<td align="left">Revision 0.9.3</td>
+<td align="left">Fri Jun 29 16:15:56 2001</td>
+<td align="left">fnatter</td>
+</tr>
+<tr><td align="left" colspan="3">
+ changed signature of nonstandard filebuf-constructor and
+ update the section on filebuf::attach to point to ../ext/howto.html,
+ added link to ../21/strings/howto.html
+ in sec-stringstream, changed &lt;link&gt;-tags to have content
+ (so that these links work),
+ replace &quot;user-space&quot; by &quot;global namespace&quot;
+ add note about gcc 3.0 and shadow-headers
+ add section about ostream::form and istream::scan
+ sec-vector-at: remove hint to modify headers
+ fix spelling error in sec-stringstream
+ </td></tr>
+<tr>
+<td align="left">Revision 0.9.4</td>
+<td align="left">Mon Nov 5 17:01:04 2001</td>
+<td align="left">fnatter</td>
+</tr>
+<tr><td align="left" colspan="3">
+ rewrite section 1.1.3 because of gnu.gcc.help-post by
+ Juergen Heinzl
+ </td></tr>
+</table></div></div>
+<div><div class="abstract">
+<p>
+<a name="id2697062"></a><b>Abstract</b>
+</p>
+<p>
+ Some notes on porting applications from libstdc++-2.90 (or earlier
+ versions) to libstdc++-v3. Not speaking in terms of the GNU libstdc++
+ implementations, this means porting from earlier versions of the
+ C++-Standard to ISO 14882.
+ </p>
+</div></div>
+<hr>
+</div>
+<div class="toc">
+<p><b>Table of Contents</b></p>
+<dl>
+<dt>1. <a href="#sec-nsstd">Namespace std::</a>
+</dt>
+<dd><dl>
+<dt>1.1.1. <a href="#sec-gtkmm-hack">Using <i>namespace
+ composition</i> if the project uses a separate
+ namespace</a>
+</dt>
+<dt>1.1.2. <a href="#sec-emptyns">Defining an empty namespace std</a>
+</dt>
+<dt>1.1.3. <a href="#sec-avoidfqn">Avoid to use fully qualified names
+ (i.e. std::string)</a>
+</dt>
+<dt>1.1.4. <a href="#sec-osprojects">How some open-source-projects deal
+ with this</a>
+</dt>
+</dl></dd>
+<dt>2. <a href="#sec-nocreate">there is no ios::nocreate/ios::noreplace
+ in ISO 14882</a>
+</dt>
+<dt>3. <a href="#sec-stream::attach"><b>stream::attach(int
+ fd)</b> is not in the standard any more</a>
+</dt>
+<dt>4. <a href="#sec-headers">The new headers</a>
+</dt>
+<dd><dl>
+<dt>4.4.1. <a href="#sec-cheaders">New headers replacing C-headers</a>
+</dt>
+<dt>4.4.2. <a href="#sec-fstream-header">
+ <tt>&lt;fstream&gt;</tt> does
+ not define <b>std::cout</b>,
+ <b>std::cin</b> etc.</a>
+</dt>
+</dl></dd>
+<dt>5. <a href="#sec-iterators">Iterators</a>
+</dt>
+<dt>6. <a href="#sec-macros">
+ Libc-macros (i.e. <b>isspace</b> from
+ <tt>&lt;cctype&gt;</tt>)</a>
+</dt>
+<dt>7. <a href="#sec-stream-state">State of streams</a>
+</dt>
+<dt>8. <a href="#sec-vector-at">vector::at is missing (i.e. gcc 2.95.x)</a>
+</dt>
+<dt>9. <a href="#sec-eof">Using std::char_traits&lt;char&gt;::eof()</a>
+</dt>
+<dt>10. <a href="#sec-string-clear">Using string::clear()/string::erase()</a>
+</dt>
+<dt>11. <a href="#sec-scan-form">GNU Extensions ostream::form and istream::scan</a>
+</dt>
+<dt>12. <a href="#sec-stringstream">Using stringstreams</a>
+</dt>
+<dt>13. <a href="#sec-about">About...</a>
+</dt>
+</dl>
+</div>
+<p>
+ In the following, when I say portable, I will refer to &quot;portable among ISO
+ 14882-implementations&quot;. On the other hand, if I say &quot;backportable&quot; or
+ &quot;conservative&quot;, I am talking about &quot;compiles with older
+ libstdc++-implementations&quot;.
</p>
- <div class="section" id="sec-nsstd">
- <h2 class="title" style="clear: all">
- <a name="sec-nsstd"><b>1. Namespace std::</b></a>
- </h2>
- <p>
- The latest C++-standard (ISO-14882) requires that the standard
- C++-library is defined in namespace std::. Thus, in order to use
- classes from the standard C++-library, you can do one of three
- things:
- <div class="itemizedlist">
- <ul>
- <li>
- <a name="N2712"></a>
- <p>wrap your code in <b>namespace std {
- ... }</b> =&gt; This is not an option because only symbols
- from the standard c++-library are defined in namespace std::.
- </p>
- </li>
- <li>
- <a name="N2721"></a>
- <p>put a kind of
- <i>using-declaration</i> in your source (either
- <b>using namespace std;</b> or i.e. <b>using
- std::string;</b>) =&gt; works well for source-files, but
- cannot be used in header-files.
- </p>
- </li>
- <li>
- <a name="N2736"></a>
- <p>use a <i>fully qualified name</i> for
- each libstdc++-symbol (i.e. <b>std::string</b>,
- <b>std::cout</b>) =&gt; can always be used
- </p>
- </li>
- </ul>
- </div>
- </p>
- <p>
- Because there are many compilers which still use an implementation
- that does not have the standard C++-library in namespace
- <b>std::</b>, some care is required to support these as
- well.
- </p>
- <p>
- Namespace back-portability-issues are generally not a problem with
- g++, because versions of g++ that do not have libstdc++ in
- <b>std::</b> use <b>-fno-honor-std</b>
- (ignore <b>std::</b>, <b>:: = std::</b>) by
- default. That is, the responsibility for enabling or disabling
- <b>std::</b> is on the user; the maintainer does not have
- to care about it. This probably applies to some other compilers as
- well.
- </p>
- <p>
- The following sections list some possible solutions to support compilers
- that cannot ignore std::.
- </p>
- <div class="section" id="sec-gtkmm-hack">
- <h3 class="title">
- <a name="sec-gtkmm-hack"><b>1.1.1. Using <i>namespace
- composition</i> if the project uses a separate
- namespace</b></a>
- </h3>
- <p>
- <a href="http://gtkmm.sourceforge.net">Gtk--</a> defines
- most of its classes in namespace Gtk::. Thus, it was possible to
- adapt Gtk-- to namespace std:: by using a C++-feature called
- <i>namespace composition</i>. This is what happens if
- you put a <i>using</i>-declaration into a
- namespace-definition: the imported symbol(s) gets imported into the
- currently active namespace(s). For example:
- <pre class="programlisting">
- namespace Gtk {
- using std::string;
- class Window { ... }
- }
- </pre>
- In this example, <b>std::string</b> gets imported into
- namespace Gtk::. The result is that you don't have to use
- <b>std::string</b> in this header, but still
- <b>std::string</b> does not get imported into
- user-space (the global namespace ::) unless the user does
- <b>using namespace Gtk;</b> (which is not recommended
- practice for Gtk--, so it is not a problem). Additionally, the
- <b>using</b>-declarations are wrapped in macros that
- are set based on autoconf-tests to either "" or i.e. <b>using
- std::string;</b> (depending on whether the system has
- libstdc++ in <b>std::</b> or not). (ideas from
- <tt>&lt;<a href="mailto:llewelly@dbritsch.dsl.xmission.com">llewelly@dbritsch.dsl.xmission.com</a>&gt;</tt>, Karl Nelson
- <tt>&lt;<a href="mailto:kenelson@ece.ucdavis.edu">kenelson@ece.ucdavis.edu</a>&gt;</tt>)
- </p>
- </div>
- <div class="section" id="sec-emptyns">
- <h3 class="title">
- <a name="sec-emptyns"><b>1.1.2. Defining an empty namespace std</b></a>
- </h3>
- <p>
- By defining an (empty) namespace <b>std::</b> before
- using it, you avoid getting errors on systems where no part of the
- library is in namespace std:
- <pre class="programlisting">
- namespace std { }
- using namespace std;
- </pre>
- </p>
- </div>
- <div class="section" id="sec-avoidfqn">
- <h3 class="title">
- <a name="sec-avoidfqn"><b>1.1.3. Avoid to use fully qualified names
- (i.e. std::string)</b></a>
- </h3>
- <p>
- If some compilers complain about <b>using
- std::string;</b>, and if the "hack" for gtk-- mentioned above
- does not work, then it might be a good idea to define a macro
- NS_STD, which is defined to either "" or "std"
- based on an autoconf-test. Then you should be able to use
- <b>NS_STD::string</b>, which will evaluate to
- <b>::string</b> ("string in the global namespace") on
- systems that do not put string in std::. (This is untested)
- </p>
- </div>
- <div class="section" id="sec-osprojects">
- <h3 class="title">
- <a name="sec-osprojects"><b>1.1.4. How some open-source-projects deal
- with this</b></a>
- </h3>
- <p>
- This information was gathered around May 2000. It may not be correct
- by the time you read this.
- </p>
- <div class="table">
- <p>
- <a name="N2901"></a><b>Table 1. Namespace std:: in Open-Source programs</b>
- </p>
- <table border="1">
- <colgroup>
- <col>
- <col>
- </colgroup>
- <tbody>
- <tr>
- <td><a href="http://www.clanlib.org">clanlib</a></td><td>usual</td>
- </tr>
- <tr>
- <td><a href="http://pingus.seul.org">pingus</a></td><td>usual</td>
- </tr>
- <tr>
- <td><a href="http://www.mozilla.org">mozilla</a></td><td>usual</td>
- </tr>
- <tr>
- <td><a href="http://www.mnemonic.org">mnemonic</a></td><td>none</td>
- </tr>
- <tr>
- <td><a href="http://libsigc.sourceforge.net">
- libsigc++</a></td><td>conservative-impl</td>
- </tr>
- </tbody>
- </table>
- </div>
- <div class="table">
- <p>
- <a name="N2978"></a><b>Table 2. Notations for categories</b>
- </p>
- <table border="1">
- <colgroup>
- <col>
- <col>
- </colgroup>
- <tbody>
- <tr>
- <td>usual</td><td>mostly fully qualified names and some
- using-declarations (but not in headers)</td>
- </tr>
- <tr>
- <td>none</td><td>no namespace std at all</td>
- </tr>
- <tr>
- <td>conservative-impl</td><td>wrap all
- namespace-handling in macros to support compilers without
- namespace-support (no libstdc++ used in headers)</td>
- </tr>
- </tbody>
- </table>
- </div>
- <p>
- As you can see, this currently lacks an example of a project which
- uses libstdc++-symbols in headers in a back-portable way (except
- for Gtk--: see the <a href="#"></a>).
- </p>
- </div>
- </div>
- <div class="section" id="sec-nocreate">
- <h2 class="title" style="clear: all">
- <a name="sec-nocreate"><b>2. there is no ios::nocreate/ios::noreplace
- in ISO 14882</b></a>
- </h2>
- <p>
- I have seen <b>ios::nocreate</b> being used for input-streams,
- most probably because the authors thought it would be more correct
- to specify nocreate "explicitly". So you can simply leave it out
- for input-streams.
- </p>
- <p>
- For output streams, "nocreate" is probably the default, unless you
- specify <b>std::ios::trunc</b> ? To be safe, you can open
- the file for reading, check if it has been opened, and then decide
- whether you want to create/replace or not. To my knowledge, even
- older implementations support <b>app</b>,
- <b>ate</b> and <b>trunc</b> (except for
- <b>app</b> ?).
- </p>
- </div>
- <div class="section" id="sec-stream::attach">
- <h2 class="title" style="clear: all">
- <a name="sec-stream::attach"><b>3. <b>stream::attach(int
- fd)</b> is not in the standard any more</b></a>
- </h2>
- <p>
- When using libstdc++-v3, you can use
- <div id="N3082" class="funcsynopsis">
- <p>
- </p>
- <a name="N3082"></a>
- <pre class="funcsynopsisinfo">
- #include &lt;fstream&gt;
- </pre>
- <p>
- <code><code class="funcdef">int <b class="fsfunc">basic_filebuf</b></code>(<var class="pdparam">__fd</var>, <var class="pdparam">__name</var>, <var class="pdparam">__mode</var>);<br>int <var class="pdparam">__fd</var>;<br>const char* <var class="pdparam">__name</var>;<br>ios_base::openmode <var class="pdparam">__mode</var>;</code>
- </p>
- <p>
- </p>
- </div>
- For a portable solution (if there is one), you need to implement a
- subclass of <b>streambuf</b> which opens a file given a
- descriptor, and then pass an instance of this to the
- stream-constructor (from the Josuttis-book).
- </p>
- </div>
- <div class="section" id="sec-headers">
- <h2 class="title" style="clear: all">
- <a name="sec-headers"><b>4. The new headers</b></a>
- </h2>
- <p>
- All new headers can be seen in this <a href="../../testsuite/17_intro/headers.cc">source-code</a>.
- </p>
- <p>
- I think it is a problem for libstdc++-v3 to add links or wrappers
- for the old headers, because the implementation has changed, and
- the header name-changes indicate this. It might be preferable to
- use the new headers and tell users of old compilers that they
- should create links (which is what they will have to do sometime
- anyway).
- </p>
- <div class="section" id="sec-cheaders">
- <h3 class="title">
- <a name="sec-cheaders"><b>4.4.1. New headers replacing C-headers</b></a>
- </h3>
- <p>
- You should not use the C-headers (except for system-level headers)
- from C++ programs. Instead, you should use a set of headers that
- are named by prepending 'c' and, as usual, ommiting the extension
- (.h). For example, instead of using <tt>&lt;math.h&gt;</tt>, you should use <tt>&lt;cmath&gt;</tt>. The standard
- specifies that if you include the C-style header (<tt>&lt;math.h&gt;</tt> in this case), the symbols
- will be available both in the global namespace and in namespace
- <b>std::</b> (libstdc++-v3, version 2.90.8 currently
- puts them in <b>std::</b> only) On the other hand, if
- you include only the new header (i.e. <tt>&lt;pcmath&gt;</tt>), the symbols will only be
- defined in namespace <b>std::</b> (and macros will be
- converted to inline-functions).
- </p>
- <p>
- For more information on this, and for information on how the GNU
- C++ implementation reuses ("shadows") the C library-functions, have
- a look at <a href="http://www.cantrip.org/cheaders.html">
- www.cantrip.org</a>.
- </p>
- </div>
- <div class="section" id="sec-fstream-header">
- <h3 class="title">
- <a name="sec-fstream-header"><b>4.4.2.
- <tt>&lt;fstream&gt;</tt> does
- not define <b>std::cout</b>,
- <b>std::cin</b> etc.</b></a>
- </h3>
- <p>
- In previous versions of the standard, <tt>&lt;fstream.h&gt;</tt>, <tt>&lt;ostream.h&gt;</tt> and <tt>&lt;istream.h&gt;</tt> used to define
- <b>cout</b>, <b>cin</b> and so on. Because
- of the templatized iostreams in libstdc++-v3, you need to include
- <tt>&lt;iostream&gt;</tt>
- explicitly to define these.
- </p>
- </div>
- </div>
- <div class="section" id="sec-iterators">
- <h2 class="title" style="clear: all">
- <a name="sec-iterators"><b>5. Iterators</b></a>
- </h2>
- <p>
- The following are not proper uses of iterators, but may be working
- fixes for existing uses of iterators.
- <div class="itemizedlist">
- <ul>
- <li>
- <a name="N3282"></a>
- <p>you cannot do
- <b>ostream::operator&lt;&lt;(iterator)</b> to
- print the address of the iterator =&gt; use
- <b>operator&lt;&lt; &amp;*iterator</b> instead ?
- </p>
- </li>
- <li>
- <a name="N3303"></a>
- <p>you cannot clear an iterator's reference
- (<b>iterator = 0</b>) =&gt; use
- <b>iterator = iterator_type();</b> ?
- </p>
- </li>
- <li>
- <a name="N3316"></a>
- <p>
- <b>if (iterator)</b> won't work any
- more =&gt; use <b>if (iterator != iterator_type())</b>
- ?</p>
- </li>
- </ul>
- </div>
- </p>
- </div>
- <div class="section" id="sec-macros">
- <h2 class="title" style="clear: all">
- <a name="sec-macros"><b>6.
- Libc-macros (i.e. <b>isspace</b> from
- <tt>&lt;cctype&gt;</tt>)</b></a>
- </h2>
- <p>
- Glibc 2.0.x and 2.1.x define the <tt>&lt;ctype.h&gt;</tt> -functionality as
- macros (isspace, isalpha etc.). Libstdc++-v3 "shadows" these macros
- as described in the <a href="#"></a>.
- </p>
- <p>
- Older implementations of libstdc++ (g++-2 for egcs 1.x and g++-3
- for gcc 2.95.2), however, keep these functions as macros, and so it
- is not back-portable to use fully qualified names. For example:
- <pre class="programlisting">
- #include &lt;cctype&gt;
- int main() { std::isspace('X'); }
- </pre>
- will result in something like this (unless using g++-v3):
- <pre class="programlisting">
- std:: (__ctype_b[(int) ( ( 'X' ) )] &amp; (unsigned short int)
- _ISspace ) ;
- </pre>
- </p>
- <p>
- One solution I can think of is to test for -v3 using
- autoconf-macros, and define macros for each of the C-functions
- (maybe that is possible with one "wrapper" macro as well ?).
- </p>
- <p>
- Another solution which would fix g++ is to tell the user to modify a
- header-file so that g++-2 (egcs 1.x) and g++-3 (gcc 2.95.2) define a
- macro which tells <tt>&lt;ctype.h&gt;</tt> to define functions
- instead of macros:
- <pre class="programlisting">
- // This keeps isalnum, et al from being propagated as macros.
- #if __linux__
- #define __NO_CTYPE 1
+<div class="section">
+<a name="sec-nsstd"></a><div class="titlepage"><div><h2 class="title" style="clear: all">
+<a name="sec-nsstd"></a><span class="label">1.</span> <span class="title">Namespace std::</span>
+</h2></div></div>
+<p>
+ The latest C++-standard (ISO-14882) requires that the standard
+ C++-library is defined in namespace std::. Thus, in order to use
+ classes from the standard C++-library, you can do one of three
+ things:
+ <div class="itemizedlist"><ul>
+<li><p>
+<a name="id2697113"></a>wrap your code in <b>namespace std {
+ ... }</b> =&gt; This is not an option because only symbols
+ from the standard c++-library are defined in namespace std::.
+ </p></li>
+<li><p>
+<a name="id2697126"></a>put a kind of
+ <i>using-declaration</i> in your source (either
+ <b>using namespace std;</b> or i.e. <b>using
+ std::string;</b>) =&gt; works well for source-files, but
+ cannot be used in header-files.
+ </p></li>
+<li><p>
+<a name="id2697047"></a>use a <i>fully qualified name</i> for
+ each libstdc++-symbol (i.e. <b>std::string</b>,
+ <b>std::cout</b>) =&gt; can always be used
+ </p></li>
+</ul></div>
+ </p>
+<p>
+ Because there are many compilers which still use an implementation
+ that does not have the standard C++-library in namespace
+ <b>std::</b>, some care is required to support these as
+ well.
+ </p>
+<p>
+ Namespace back-portability-issues are generally not a problem with
+ g++, because versions of g++ that do not have libstdc++ in
+ <b>std::</b> use <b>-fno-honor-std</b>
+ (ignore <b>std::</b>, <b>:: = std::</b>) by
+ default. That is, the responsibility for enabling or disabling
+ <b>std::</b> is on the user; the maintainer does not have
+ to care about it. This probably applies to some other compilers as
+ well.
+ </p>
+<p>
+ The following sections list some possible solutions to support compilers
+ that cannot ignore std::.
+ </p>
+<div class="section">
+<a name="sec-gtkmm-hack"></a><div class="titlepage"><div><h3 class="title">
+<a name="sec-gtkmm-hack"></a><span class="label">1.1.1.</span> <span class="title">Using <i>namespace
+ composition</i> if the project uses a separate
+ namespace</span>
+</h3></div></div>
+<p>
+ <a href="http://gtkmm.sourceforge.net" target="_top">Gtk--</a> defines
+ most of its classes in namespace Gtk::. Thus, it was possible to
+ adapt Gtk-- to namespace std:: by using a C++-feature called
+ <i>namespace composition</i>. This is what happens if
+ you put a <i>using</i>-declaration into a
+ namespace-definition: the imported symbol(s) gets imported into the
+ currently active namespace(s). For example:
+ <pre class="programlisting">
+ namespace Gtk {
+ using std::string;
+ class Window { ... }
+ }
+ </pre>
+ In this example, <b>std::string</b> gets imported into
+ namespace Gtk::. The result is that you don't have to use
+ <b>std::string</b> in this header, but still
+ <b>std::string</b> does not get imported into
+ the global namespace (::) unless the user does
+ <b>using namespace Gtk;</b> (which is not recommended
+ practice for Gtk--, so it is not a problem). Additionally, the
+ <b>using</b>-declarations are wrapped in macros that
+ are set based on autoconf-tests to either &quot;&quot; or i.e. <b>using
+ std::string;</b> (depending on whether the system has
+ libstdc++ in <b>std::</b> or not). (ideas from
+ <tt>&lt;<a href="mailto:llewelly@dbritsch.dsl.xmission.com">llewelly@dbritsch.dsl.xmission.com</a>&gt;</tt>, Karl Nelson
+ <tt>&lt;<a href="mailto:kenelson@ece.ucdavis.edu">kenelson@ece.ucdavis.edu</a>&gt;</tt>)
+ </p>
+</div>
+<div class="section">
+<a name="sec-emptyns"></a><div class="titlepage"><div><h3 class="title">
+<a name="sec-emptyns"></a><span class="label">1.1.2.</span> <span class="title">Defining an empty namespace std</span>
+</h3></div></div>
+<p>
+ By defining an (empty) namespace <b>std::</b> before
+ using it, you avoid getting errors on systems where no part of the
+ library is in namespace std:
+ <pre class="programlisting">
+ namespace std { }
+ using namespace std;
+ </pre>
+ </p>
+</div>
+<div class="section">
+<a name="sec-avoidfqn"></a><div class="titlepage"><div><h3 class="title">
+<a name="sec-avoidfqn"></a><span class="label">1.1.3.</span> <span class="title">Avoid to use fully qualified names
+ (i.e. std::string)</span>
+</h3></div></div>
+<p>
+ If some compilers complain about <b>using
+ std::string;</b>, and if the &quot;hack&quot; for gtk-- mentioned above
+ does not work, then I see two solutions:
+
+ <div class="itemizedlist"><ul>
+<li><p>
+<a name="id2698648"></a>
+ Define <b>std::</b> as a macro if the compiler
+ doesn't know about <b>std::</b>.
+ <pre class="programlisting">
+ #ifdef OLD_COMPILER
+ #define std
#endif
+ </pre>
+ (thanks to Juergen Heinzl who posted this solution on
+ gnu.gcc.help)
+ </p></li>
+<li><p>
+<a name="id2698680"></a>
+ Define a macro NS_STD, which is defined to
+ either &quot;&quot; or &quot;std&quot;
+ based on an autoconf-test. Then you should be able to use
+ <b>NS_STD::string</b>, which will evaluate to
+ <b>::string</b> (&quot;string in the global namespace&quot;) on
+ systems that do not put string in std::. (This is untested)
+ </p></li>
+</ul></div>
+
+ </p>
+</div>
+<div class="section">
+<a name="sec-osprojects"></a><div class="titlepage"><div><h3 class="title">
+<a name="sec-osprojects"></a><span class="label">1.1.4.</span> <span class="title">How some open-source-projects deal
+ with this</span>
+</h3></div></div>
+<p>
+ This information was gathered around May 2000. It may not be correct
+ by the time you read this.
+ </p>
+<div class="table">
+<p>
+<a name="id2698746"></a><b>Table 1. Namespace std:: in Open-Source programs</b>
+</p>
+<table summary="Namespace std:: in Open-Source programs" border="1">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<tbody>
+<tr>
+<td><a href="http://www.clanlib.org" target="_top">clanlib</a></td>
+<td>usual</td>
+</tr>
+<tr>
+<td><a href="http://pingus.seul.org" target="_top">pingus</a></td>
+<td>usual</td>
+</tr>
+<tr>
+<td><a href="http://www.mozilla.org" target="_top">mozilla</a></td>
+<td>usual</td>
+</tr>
+<tr>
+<td><a href="http://www.mnemonic.org" target="_top">mnemonic</a></td>
+<td>none</td>
+</tr>
+<tr>
+<td><a href="http://libsigc.sourceforge.net" target="_top">
+ libsigc++</a></td>
+<td>conservative-impl</td>
+</tr>
+</tbody>
+</table>
+</div>
+<div class="table">
+<p>
+<a name="id2698876"></a><b>Table 2. Notations for categories</b>
+</p>
+<table summary="Notations for categories" border="1">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<tbody>
+<tr>
+<td>usual</td>
+<td>mostly fully qualified names and some
+ using-declarations (but not in headers)</td>
+</tr>
+<tr>
+<td>none</td>
+<td>no namespace std at all</td>
+</tr>
+<tr>
+<td>conservative-impl</td>
+<td>wrap all
+ namespace-handling in macros to support compilers without
+ namespace-support (no libstdc++ used in headers)</td>
+</tr>
+</tbody>
+</table>
+</div>
+<p>
+ As you can see, this currently lacks an example of a project
+ which uses libstdc++-symbols in headers in a back-portable way
+ (except for Gtk--: see the <a href="#sec-gtkmm-hack">section on the gtkmm-hack</a>).
+ </p>
+</div>
+</div>
+<div class="section">
+<a name="sec-nocreate"></a><div class="titlepage"><div><h2 class="title" style="clear: all">
+<a name="sec-nocreate"></a><span class="label">2.</span> <span class="title">there is no ios::nocreate/ios::noreplace
+ in ISO 14882</span>
+</h2></div></div>
+<p>
+ I have seen <b>ios::nocreate</b> being used for
+ input-streams, most probably because the author thought it would be
+ more correct to specify nocreate &quot;explicitly&quot;. So you can simply
+ leave it out for input-streams.
+ </p>
+<p>
+ For output streams, &quot;nocreate&quot; is probably the default, unless you
+ specify <b>std::ios::trunc</b> ? To be safe, you can open
+ the file for reading, check if it has been opened, and then decide
+ whether you want to create/replace or not. To my knowledge, even
+ older implementations support <b>app</b>,
+ <b>ate</b> and <b>trunc</b> (except for
+ <b>app</b> ?).
+ </p>
+</div>
+<div class="section">
+<a name="sec-stream::attach"></a><div class="titlepage"><div><h2 class="title" style="clear: all">
+<a name="sec-stream::attach"></a><span class="label">3.</span> <span class="title"><b>stream::attach(int
+ fd)</b> is not in the standard any more</span>
+</h2></div></div>
+<p>
+ Phil Edwards <tt>&lt;<a href="mailto:pedwards@disaster.jaj.com">pedwards@disaster.jaj.com</a>&gt;</tt> writes:
+ It was considered and rejected. Not all environments use file
+ descriptors. Of those that do, not all of them use integers to represent
+ them.
+ </p>
+<p>
+ When using libstdc++-v3, you can use
+ <div class="funcsynopsis" id="id2692860">
+<p>
+<a name="id2692860"></a><pre class="funcsynopsisinfo">
+ #include &lt;fstream&gt;
+ </pre>
+<p><code><code class="funcdef">
+ <b class="fsfunc">basic_filebuf&lt;...&gt;::basic_filebuf&lt;...&gt;
+ </b>
+ </code>(<var class="pdparam">file</var>, <var class="pdparam">mode</var>, <var class="pdparam">size</var>);<br>__c_file_type* <var class="pdparam">file</var>;<br>ios_base::open_mode <var class="pdparam">mode</var>;<br>int <var class="pdparam">size</var>;</code></p>
+<p>
+</div>
+ but the the signature of this constructor has changed often, and
+ it might change again. For the current state of this, check
+ <a href="../ext/howto.html" target="_top">the howto for extensions</a>.
+ </p>
+<p>
+ For a portable solution (among systems which use
+ filedescriptors), you need to implement a subclass of
+ <b>std::streambuf</b> (or
+ <b>std::basic_streambuf&lt;..&gt;</b>) which opens a file
+ given a descriptor, and then pass an instance of this to the
+ stream-constructor (from the Josuttis-book).
+ </p>
+</div>
+<div class="section">
+<a name="sec-headers"></a><div class="titlepage"><div><h2 class="title" style="clear: all">
+<a name="sec-headers"></a><span class="label">4.</span> <span class="title">The new headers</span>
+</h2></div></div>
+<p>
+ All new headers can be seen in this <a href="headers_cc.txt" target="_top">
+ source-code</a>.
+ </p>
+<p>
+ The old C++-headers (iostream.h etc.) are available, but gcc generates
+ a warning that you are using deprecated headers.
+ </p>
+<div class="section">
+<a name="sec-cheaders"></a><div class="titlepage"><div><h3 class="title">
+<a name="sec-cheaders"></a><span class="label">4.4.1.</span> <span class="title">New headers replacing C-headers</span>
+</h3></div></div>
+<p>
+ You should not use the C-headers (except for system-level
+ headers) from C++ programs. Instead, you should use a set of
+ headers that are named by prepending 'c' and, as usual,
+ omitting the extension (.h). For example, instead of using
+ <tt>&lt;math.h&gt;</tt>, you
+ should use <tt>&lt;cmath&gt;</tt>. In some cases this has
+ the advantage that the C++-header is more standardized than
+ the C-header (i.e. <tt>&lt;ctime&gt;</tt> (almost)
+ corresponds to either <tt>&lt;time.h&gt;</tt> or <tt>&lt;sys/time.h&gt;</tt>).
- [ now include &lt;ctype.h&gt; ]
- </pre>
- </p>
- <p>
- Another problem arises if you put a <b>using namespace
- std;</b> declaration at the top, and include <tt>&lt;ctype.h&gt;</tt>. This will result in
- ambiguities between the definitions in the global namespace
- (<tt>&lt;ctype.h&gt;</tt>) and the
- definitions in namespace <b>std::</b>
- (<b>&lt;cctype&gt;</b>).
- </p>
- <p>
- The solution to this problem was posted to the libstdc++-v3
- mailing-list:
- Benjamin Kosnik <tt>&lt;<a href="mailto:bkoz@redhat.com">bkoz@redhat.com</a>&gt;</tt> writes:
- "
- --enable-cshadow-headers is currently broken. As a result, shadow
- headers are not being searched....
- "
- </p>
- </div>
- <div class="section" id="sec-stream-state">
- <h2 class="title" style="clear: all">
- <a name="sec-stream-state"><b>7.
- State of streams
- </b></a>
- </h2>
- <p>
- At least some older implementations don't have
- <b>std::ios_base</b>, so you should use
- <b>std::ios::badbit</b>, <b>std::ios::failbit</b>
- and <b>std::ios::eofbit</b> and
- <b>std::ios::goodbit</b>.
- </p>
- </div>
- <div class="section" id="sec-vector-at">
- <h2 class="title" style="clear: all">
- <a name="sec-vector-at"><b>8. vector::at is missing (i.e. gcc 2.95.2)</b></a>
- </h2>
- <p>
- For my use, I added it to
- <tt>prefix/include/g++-3/stl_vector.h</tt>:
- <pre class="programlisting">
- reference operator[](size_type __n) { return *(begin() + __n); }
- reference at(size_type __n) {
- if (begin() + __n &gt;= end())
- throw out_of_range("vector::at");
- return *(begin() + __n);
- }
- const_reference operator[](size_type __n) const { return *(begin() + __n); }
- const_reference at(size_type __n) const {
- if (begin() + __n &gt;= end())
- throw out_of_range("vector::at");
- return *(begin() + __n);
- }
- </pre>
- </p>
- </div>
- <div class="section" id="sec-eof">
- <h2 class="title" style="clear: all">
- <a name="sec-eof"><b>9. Using std::char_traits&lt;char&gt;::eof()</b></a>
- </h2>
- <p>
- <pre class="programlisting">
- #ifdef HAVE_CHAR_TRAITS
- #define CPP_EOF std::char_traits&lt;char&gt;::eof()
- #else
- #define CPP_EOF EOF
- #endif
- </pre>
- </p>
- </div>
- <div class="section" id="sec-string-clear">
- <h2 class="title" style="clear: all">
- <a name="sec-string-clear"><b>10. Using string::clear()/string::erase()</b></a>
- </h2>
- <p>
- There are two functions for deleting the contents of a string:
- <b>clear</b> and <b>erase</b> (the latter
- returns the string).
- <pre class="programlisting">
- void
- clear() { _M_mutate(0, this-&gt;size(), 0); }
- </pre>
- <pre class="programlisting">
- basic_string&amp;
- erase(size_type __pos = 0, size_type __n = npos)
- {
- return this-&gt;replace(_M_check(__pos), _M_fold(__pos, __n),
- _M_data(), _M_data());
- }
- </pre>
- The implementation of <b>erase</b> seems to be more
- complicated (from libstdc++-v3), but <b>clear</b> is not
- implemented in gcc 2.95.2's libstdc++, so you should use
- <b>erase</b> (which is probably faster than
- <b>operator=(charT*)</b>).
- </p>
- </div>
- <div class="section" id="sec-stringstream">
- <h2 class="title" style="clear: all">
- <a name="sec-stringstream"><b>11. Using stringstream's</b></a>
- </h2>
- <p>
- Libstdc++-v3 includes the new
- <b>i/ostringstream</b>-classes, (<tt>&lt;sstream&gt;</tt>), but with older
- implementations you still have to use <b>i/ostrstream</b>
- (<tt>&lt;strstream&gt;</tt>):
- <pre class="programlisting">
- #ifdef HAVE_SSTREAM
- #include &lt;sstream&gt;
- #else
- #include &lt;strstream&gt;
- #endif
- </pre>
- <div class="itemizedlist">
- <ul>
- <li>
- <a name="N3595"></a>
- <p> <b>strstream</b> is considered to be
- deprecated
- </p>
- </li>
- <li>
- <a name="N3603"></a>
- <p> <b>strstream</b> is limited to
- <b>char</b>
- </p>
- </li>
- <li>
- <a name="N3614"></a>
- <p> with <b>ostringstream</b> you don't
- have to take care of terminating the string or freeing its
- memory
- </p>
- </li>
- <li>
- <a name="N3622"></a>
- <p> <b>istringstream</b> can be re-filled
- (clear(); str(input);)
- </p>
- </li>
- </ul>
- </div>
- </p>
- <p>
- You can then use output-stringstreams like this:
- <pre class="programlisting">
- #ifdef HAVE_SSTREAM
- std::ostringstream oss;
- #else
- std::ostrstream oss;
- #endif
- oss &lt;&lt; "Name=" &lt;&lt; m_name &lt;&lt; ", number=" &lt;&lt; m_number &lt;&lt; std::endl;
- ...
- #ifndef HAVE_SSTREAM
- oss &lt;&lt; std::ends; // terminate the char*-string
- #endif
- // str() returns char* for ostrstream and a string for ostringstream
- // this also causes ostrstream to think that the buffer's memory
- // is yours
- m_label.set_text(oss.str());
- #ifndef HAVE_SSTREAM
- // let the ostrstream take care of freeing the memory
- oss.freeze(false);
- #endif
- </pre>
- </p>
- <p>
- Input-stringstreams can be used similarly:
- <pre class="programlisting">
- std::string input;
- ...
- #ifdef HAVE_SSTREAM
- std::istringstream iss(input);
- #else
- std::istrstream iss(input.c_str());
- #endif
- int i;
- iss &gt;&gt; i;
- </pre>
- One (the only?) restriction is that an istrstream cannot be re-filled:
- <pre class="programlisting">
- std::istringstream iss(numerator);
- iss &gt;&gt; m_num;
- // this is not possible with istrstream
- iss.clear();
- iss.str(denominator);
- iss &gt;&gt; m_den;
- </pre>
- If you don't care about speed, you can put these conversions in
- a template-function:
- <pre class="programlisting">
- template &lt;class X&gt;
- void fromString(const string&amp; input, X&amp; any)
- {
- #ifdef HAVE_SSTREAM
- std::istringstream iss(input);
- #else
- std::istrstream iss(input.c_str());
- #endif
- X temp;
- iss &gt;&gt; temp;
- if (iss.fail())
- throw runtime_error(..)
- any = temp;
- }
- </pre>
- </p>
- <p>
- I have read the Josuttis book on Standard C++, so some information
- comes from there. Additionally, there is information in
- "info iostream", which covers the old implementation that gcc 2.95.2
- uses.
- </p>
- </div>
- <div class="section" id="sec-about">
- <h2 class="title" style="clear: all">
- <a name="sec-about"><b>12. About...</b></a>
- </h2>
- <p>
- Please send any experience, additions, corrections or questions to
- <a href="mailto:fnatter@gmx.net">fnatter@gmx.net</a> or for
- discussion to the libstdc++-v3-mailing-list.
- </p>
- </div>
- </div>
- </body>
+ The standard specifies that if you include the C-style header
+ (<tt>&lt;math.h&gt;</tt> in
+ this case), the symbols will be available both in the global
+ namespace and in namespace <b>std::</b> (but
+ libstdc++ does not yet have fully compliant headers) On the
+ other hand, if you include only the new header (i.e. <tt>&lt;cmath&gt;</tt>), the symbols
+ will only be defined in namespace <b>std::</b>
+ (and macros will be converted to inline-functions).
+ </p>
+<p>
+ For more information on this, and for information on how the
+ GNU C++ implementation might reuse (&quot;shadow&quot;) the C
+ library-functions, have a look at <a href="http://www.cantrip.org/cheaders.html" target="_top">
+ www.cantrip.org</a>.
+ </p>
+</div>
+<div class="section">
+<a name="sec-fstream-header"></a><div class="titlepage"><div><h3 class="title">
+<a name="sec-fstream-header"></a><span class="label">4.4.2.</span> <span class="title">
+ <tt>&lt;fstream&gt;</tt> does
+ not define <b>std::cout</b>,
+ <b>std::cin</b> etc.</span>
+</h3></div></div>
+<p>
+ In earlier versions of the standard,
+ <tt>&lt;fstream.h&gt;</tt>,
+ <tt>&lt;ostream.h&gt;</tt>
+ and <tt>&lt;istream.h&gt;</tt>
+ used to define
+ <b>cout</b>, <b>cin</b> and so on. Because
+ of the templatized iostreams in libstdc++-v3, you need to include
+ <tt>&lt;iostream&gt;</tt>
+ explicitly to define these.
+ </p>
+</div>
+</div>
+<div class="section">
+<a name="sec-iterators"></a><div class="titlepage"><div><h2 class="title" style="clear: all">
+<a name="sec-iterators"></a><span class="label">5.</span> <span class="title">Iterators</span>
+</h2></div></div>
+<p>
+ The following are not proper uses of iterators, but may be working
+ fixes for existing uses of iterators.
+ <div class="itemizedlist"><ul>
+<li><p>
+<a name="id2693156"></a>you cannot do
+ <b>ostream::operator&lt;&lt;(iterator)</b> to
+ print the address of the iterator =&gt; use
+ <b>operator&lt;&lt; &amp;*iterator</b> instead ?
+ </p></li>
+<li><p>
+<a name="id2693255"></a>you cannot clear an iterator's reference
+ (<b>iterator = 0</b>) =&gt; use
+ <b>iterator = iterator_type();</b> ?
+ </p></li>
+<li><p>
+<a name="id2693277"></a><b>if (iterator)</b> won't work any
+ more =&gt; use <b>if (iterator != iterator_type())</b>
+ ?</p></li>
+</ul></div>
+ </p>
+</div>
+<div class="section">
+<a name="sec-macros"></a><div class="titlepage"><div><h2 class="title" style="clear: all">
+<a name="sec-macros"></a><span class="label">6.</span> <span class="title">
+ Libc-macros (i.e. <b>isspace</b> from
+ <tt>&lt;cctype&gt;</tt>)</span>
+</h2></div></div>
+<p>
+ Glibc 2.0.x and 2.1.x define the
+ <tt>&lt;ctype.h&gt;</tt>
+ -functionality as macros (isspace, isalpha etc.). Libstdc++-v3
+ &quot;shadows&quot; these macros as described in the <a href="#sec-cheaders">section about
+ c-headers</a>.
+ </p>
+<p>
+ Older implementations of libstdc++ (g++-2 for egcs 1.x and g++-3
+ for gcc 2.95.x), however, keep these functions as macros, and so it
+ is not back-portable to use fully qualified names. For example:
+ <pre class="programlisting">
+ #include &lt;cctype&gt;
+ int main() { std::isspace('X'); }
+ </pre>
+ will result in something like this (unless using g++-v3):
+ <pre class="programlisting">
+ std:: (__ctype_b[(int) ( ( 'X' ) )] &amp; (unsigned short int)
+ _ISspace ) ;
+ </pre>
+ </p>
+<p>
+ One solution I can think of is to test for -v3 using
+ autoconf-macros, and define macros for each of the C-functions
+ (maybe that is possible with one &quot;wrapper&quot; macro as well ?).
+ </p>
+<p>
+ Another solution which would fix g++ is to tell the user to modify a
+ header-file so that g++-2 (egcs 1.x) and g++-3 (gcc 2.95.x) define a
+ macro which tells <tt>&lt;ctype.h&gt;</tt> to define functions
+ instead of macros:
+ <pre class="programlisting">
+ // This keeps isalnum, et al from being propagated as macros.
+ #if __linux__
+ #define __NO_CTYPE 1
+ #endif
+
+ [ now include &lt;ctype.h&gt; ]
+ </pre>
+ </p>
+<p>
+ Another problem arises if you put a <b>using namespace
+ std;</b> declaration at the top, and include <tt>&lt;ctype.h&gt;</tt>. This will result in
+ ambiguities between the definitions in the global namespace
+ (<tt>&lt;ctype.h&gt;</tt>) and the
+ definitions in namespace <b>std::</b>
+ (<b>&lt;cctype&gt;</b>).
+ </p>
+<p>
+ The solution to this problem was posted to the libstdc++-v3
+ mailing-list:
+ Benjamin Kosnik <tt>&lt;<a href="mailto:bkoz@redhat.com">bkoz@redhat.com</a>&gt;</tt> writes:
+ `
+ --enable-cshadow-headers is currently broken. As a result, shadow
+ headers are not being searched....
+ '
+ This is now outdated, but gcc 3.0 still does not have fully
+ compliant &quot;shadow headers&quot;.
+ </p>
+</div>
+<div class="section">
+<a name="sec-stream-state"></a><div class="titlepage"><div><h2 class="title" style="clear: all">
+<a name="sec-stream-state"></a><span class="label">7.</span> <span class="title">State of streams</span>
+</h2></div></div>
+<p>
+ At least some older implementations don't have
+ <b>std::ios_base</b>, so you should use
+ <b>std::ios::badbit</b>, <b>std::ios::failbit</b>
+ and <b>std::ios::eofbit</b> and
+ <b>std::ios::goodbit</b>.
+ </p>
+</div>
+<div class="section">
+<a name="sec-vector-at"></a><div class="titlepage"><div><h2 class="title" style="clear: all">
+<a name="sec-vector-at"></a><span class="label">8.</span> <span class="title">vector::at is missing (i.e. gcc 2.95.x)</span>
+</h2></div></div>
+<p>
+ One solution is to add an autoconf-test for this:
+ <pre class="programlisting">
+ AC_MSG_CHECKING(for container::at)
+ AC_TRY_COMPILE(
+ [
+ #include &lt;vector&gt;
+ #include &lt;deque&gt;
+ #include &lt;string&gt;
+
+ using namespace std;
+ ],
+ [
+ deque&lt;int&gt; test_deque(3);
+ test_deque.at(2);
+ vector&lt;int&gt; test_vector(2);
+ test_vector.at(1);
+ string test_string(&quot;test_string&quot;);
+ test_string.at(3);
+ ],
+ [AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_CONTAINER_AT)],
+ [AC_MSG_RESULT(no)])
+ </pre>
+ If you are using other (non-GNU) compilers it might be a good idea
+ to check for <b>string::at</b> separately.
+ </p>
+</div>
+<div class="section">
+<a name="sec-eof"></a><div class="titlepage"><div><h2 class="title" style="clear: all">
+<a name="sec-eof"></a><span class="label">9.</span> <span class="title">Using std::char_traits&lt;char&gt;::eof()</span>
+</h2></div></div>
+<p>
+ <pre class="programlisting">
+ #ifdef HAVE_CHAR_TRAITS
+ #define CPP_EOF std::char_traits&lt;char&gt;::eof()
+ #else
+ #define CPP_EOF EOF
+ #endif
+ </pre>
+ </p>
+</div>
+<div class="section">
+<a name="sec-string-clear"></a><div class="titlepage"><div><h2 class="title" style="clear: all">
+<a name="sec-string-clear"></a><span class="label">10.</span> <span class="title">Using string::clear()/string::erase()</span>
+</h2></div></div>
+<p>
+ There are two functions for deleting the contents of a string:
+ <b>clear</b> and <b>erase</b> (the latter
+ returns the string).
+ <pre class="programlisting">
+ void
+ clear() { _M_mutate(0, this-&gt;size(), 0); }
+ </pre>
+ <pre class="programlisting">
+ basic_string&amp;
+ erase(size_type __pos = 0, size_type __n = npos)
+ {
+ return this-&gt;replace(_M_check(__pos), _M_fold(__pos, __n),
+ _M_data(), _M_data());
+ }
+ </pre>
+ The implementation of <b>erase</b> seems to be more
+ complicated (from libstdc++-v3), but <b>clear</b> is not
+ implemented in gcc 2.95.x's libstdc++, so you should use
+ <b>erase</b> (which is probably faster than
+ <b>operator=(charT*)</b>).
+ </p>
+</div>
+<div class="section">
+<a name="sec-scan-form"></a><div class="titlepage"><div><h2 class="title" style="clear: all">
+<a name="sec-scan-form"></a><span class="label">11.</span> <span class="title">GNU Extensions ostream::form and istream::scan</span>
+</h2></div></div>
+<p>
+ These are not supported any more - use
+ <a href="#sec-stringstream">
+ stringstreams</a> instead.
+ </p>
+</div>
+<div class="section">
+<a name="sec-stringstream"></a><div class="titlepage"><div><h2 class="title" style="clear: all">
+<a name="sec-stringstream"></a><span class="label">12.</span> <span class="title">Using stringstreams</span>
+</h2></div></div>
+<p>
+ Libstdc++-v3 provides the new
+ <b>i/ostringstream</b>-classes, (<tt>&lt;sstream&gt;</tt>), but for compatibility
+ with older implementations you still have to use
+ <b>i/ostrstream</b> (<tt>&lt;strstream&gt;</tt>):
+ <pre class="programlisting">
+ #ifdef HAVE_SSTREAM
+ #include &lt;sstream&gt;
+ #else
+ #include &lt;strstream&gt;
+ #endif
+ </pre>
+ <div class="itemizedlist"><ul>
+<li><p>
+<a name="id2693683"></a> <b>strstream</b> is considered to be
+ deprecated
+ </p></li>
+<li><p>
+<a name="id2693629"></a> <b>strstream</b> is limited to
+ <b>char</b>
+ </p></li>
+<li><p>
+<a name="id2693718"></a> with <b>ostringstream</b> you don't
+ have to take care of terminating the string or freeing its
+ memory
+ </p></li>
+<li><p>
+<a name="id2693735"></a> <b>istringstream</b> can be re-filled
+ (clear(); str(input);)
+ </p></li>
+</ul></div>
+ </p>
+<p>
+ You can then use output-stringstreams like this:
+ <pre class="programlisting">
+ #ifdef HAVE_SSTREAM
+ std::ostringstream oss;
+ #else
+ std::ostrstream oss;
+ #endif
+ oss &lt;&lt; &quot;Name=&quot; &lt;&lt; m_name &lt;&lt; &quot;, number=&quot; &lt;&lt; m_number &lt;&lt; std::endl;
+ ...
+ #ifndef HAVE_SSTREAM
+ oss &lt;&lt; std::ends; // terminate the char*-string
+ #endif
+ // str() returns char* for ostrstream and a string for ostringstream
+ // this also causes ostrstream to think that the buffer's memory
+ // is yours
+ m_label.set_text(oss.str());
+ #ifndef HAVE_SSTREAM
+ // let the ostrstream take care of freeing the memory
+ oss.freeze(false);
+ #endif
+ </pre>
+ </p>
+<p>
+ Input-stringstreams can be used similarly:
+ <pre class="programlisting">
+ std::string input;
+ ...
+ #ifdef HAVE_SSTREAM
+ std::istringstream iss(input);
+ #else
+ std::istrstream iss(input.c_str());
+ #endif
+ int i;
+ iss &gt;&gt; i;
+ </pre>
+ One (the only?) restriction is that an istrstream cannot be re-filled:
+ <pre class="programlisting">
+ std::istringstream iss(numerator);
+ iss &gt;&gt; m_num;
+ // this is not possible with istrstream
+ iss.clear();
+ iss.str(denominator);
+ iss &gt;&gt; m_den;
+ </pre>
+ If you don't care about speed, you can put these conversions in
+ a template-function:
+ <pre class="programlisting">
+ template &lt;class X&gt;
+ void fromString(const string&amp; input, X&amp; any)
+ {
+ #ifdef HAVE_SSTREAM
+ std::istringstream iss(input);
+ #else
+ std::istrstream iss(input.c_str());
+ #endif
+ X temp;
+ iss &gt;&gt; temp;
+ if (iss.fail())
+ throw runtime_error(..)
+ any = temp;
+ }
+ </pre>
+ Another example of using stringstreams is in <a href="../21_strings/howto.html" target="_top">this howto</a>.
+ </p>
+<p>
+ I have read the Josuttis book on Standard C++, so some information
+ comes from there. Additionally, there is information in
+ &quot;info iostream&quot;, which covers the old implementation that gcc 2.95.x
+ uses.
+ </p>
+</div>
+<div class="section">
+<a name="sec-about"></a><div class="titlepage"><div><h2 class="title" style="clear: all">
+<a name="sec-about"></a><span class="label">13.</span> <span class="title">About...</span>
+</h2></div></div>
+<p>
+ Please send any experience, additions, corrections or questions to
+ <a href="mailto:fnatter@gmx.net" target="_top">fnatter@gmx.net</a> or for
+ discussion to the libstdc++-v3-mailing-list.
+ </p>
+</div>
+</div></body>
</html>
diff --git a/libstdc++-v3/docs/html/17_intro/porting-howto.xml b/libstdc++-v3/docs/html/17_intro/porting-howto.xml
new file mode 100644
index 00000000000..1c028433355
--- /dev/null
+++ b/libstdc++-v3/docs/html/17_intro/porting-howto.xml
@@ -0,0 +1,787 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.1//EN"
+ "dtd/docbook-4/docbookx.dtd">
+
+<?xml-stylesheet type="text/xsl" href="docbook-xslt/docbook/html/docbook.xsl"?>
+
+<!--
+ This is written using docbook 4.1 xml. HTML is generated using
+ the xslt-stylesheets from http://www.nwalsh.com.
+
+ xsltproc is an xslt-processor included in libxslt:
+ (http://xmlsoft.org/XSLT/ or here:
+ ftp://ftp.gnome.org/pub/GNOME/unstable/sources/libxslt/)
+ (it requires libxml2: http://xmlsoft.org
+ or here: ftp://ftp.gnome.org/pub/GNOME/stable/sources/libxml/)
+
+ You can find the latest version of this document here:
+ http://gcc.gnu.org/onlinedocs/libstdc++/17_intro/porting-howto(.html|.xml)
+-->
+
+<!-- TODO:
+o remove //@label: use automatic numbering
+o make this work: <link linkend="sec-gtkmm-hack" endterm="sec-gtkmm-hack.title"/>.
+o clean up the section-numbering
+-->
+
+<article class = "whitepaper" id = "libstdc++-porting-howto" lang = "en">
+ <articleinfo>
+ <title>Libstdc++-porting-howto</title>
+ <author>
+ <firstname>Felix</firstname>
+ <surname>Natter</surname>
+ </author>
+ <address>
+ <email>fnatter@gmx.net</email>
+ </address>
+ <revhistory>
+ <revision>
+ <revnumber>0.5</revnumber>
+ <date>Thu Jun 1 13:06:50 2000</date>
+ <authorinitials>fnatter</authorinitials>
+ <revremark>First docbook-version.</revremark>
+ </revision>
+ <revision>
+ <revnumber>0.8</revnumber>
+ <date>Sun Jul 30 20:28:40 2000</date>
+ <authorinitials>fnatter</authorinitials>
+ <revremark>First released version using docbook-xml
+ + second upload to libstdc++-page.
+ </revremark>
+ </revision>
+ <revision>
+ <revnumber>0.9</revnumber>
+ <date>Wed Sep 6 02:59:32 2000</date>
+ <authorinitials>fnatter</authorinitials>
+ <revremark>5 new sections.</revremark>
+ </revision>
+ <revision>
+ <revnumber>0.9.1</revnumber>
+ <date>Sat Sep 23 14:20:15 2000</date>
+ <authorinitials>fnatter</authorinitials>
+ <revremark>added information about why file-descriptors are not in the
+ standard</revremark>
+ </revision>
+ <revision>
+ <revnumber>0.9.2</revnumber>
+ <date>Tue Jun 5 20:07:49 2001</date>
+ <authorinitials>fnatter</authorinitials>
+ <revremark>
+ a fix, added hint on increased portability of C-shadow-headers,
+ added autoconf-test HAVE_CONTAINER_AT
+ </revremark>
+ </revision>
+ <revision>
+ <revnumber>0.9.3</revnumber>
+ <date>Fri Jun 29 16:15:56 2001</date>
+ <authorinitials>fnatter</authorinitials>
+ <revremark>
+ changed signature of nonstandard filebuf-constructor and
+ update the section on filebuf::attach to point to ../ext/howto.html,
+ added link to ../21/strings/howto.html
+ in sec-stringstream, changed &lt;link&gt;-tags to have content
+ (so that these links work),
+ replace "user-space" by "global namespace"
+ add note about gcc 3.0 and shadow-headers
+ add section about ostream::form and istream::scan
+ sec-vector-at: remove hint to modify headers
+ fix spelling error in sec-stringstream
+ </revremark>
+ </revision>
+ <revision>
+ <revnumber>0.9.4</revnumber>
+ <date>Mon Nov 5 17:01:04 2001</date>
+ <authorinitials>fnatter</authorinitials>
+ <revremark>
+ rewrite section 1.1.3 because of gnu.gcc.help-post by
+ Juergen Heinzl
+ </revremark>
+ </revision>
+ </revhistory>
+ <legalnotice><title>Legal Notice</title>
+ <para>
+ This document can be distributed under the FDL
+ (<ulink url = "http://www.gnu.org">www.gnu.org</ulink>)
+ </para>
+ </legalnotice>
+
+ <pubdate>Tue Jun 5 20:07:49 2001</pubdate>
+ <abstract>
+ <para>
+ Some notes on porting applications from libstdc++-2.90 (or earlier
+ versions) to libstdc++-v3. Not speaking in terms of the GNU libstdc++
+ implementations, this means porting from earlier versions of the
+ C++-Standard to ISO 14882.
+ </para>
+ </abstract>
+ </articleinfo>
+
+ <para>
+ In the following, when I say portable, I will refer to "portable among ISO
+ 14882-implementations". On the other hand, if I say "backportable" or
+ "conservative", I am talking about "compiles with older
+ libstdc++-implementations".
+ </para>
+
+ <section id="sec-nsstd" label="1"><title>Namespace std::</title>
+ <para>
+ The latest C++-standard (ISO-14882) requires that the standard
+ C++-library is defined in namespace std::. Thus, in order to use
+ classes from the standard C++-library, you can do one of three
+ things:
+ <itemizedlist>
+
+ <listitem><para>wrap your code in <command>namespace std {
+ ... }</command> =&gt; This is not an option because only symbols
+ from the standard c++-library are defined in namespace std::.
+ </para></listitem>
+
+ <listitem><para>put a kind of
+ <emphasis>using-declaration</emphasis> in your source (either
+ <command>using namespace std;</command> or i.e. <command>using
+ std::string;</command>) =&gt; works well for source-files, but
+ cannot be used in header-files.
+ </para></listitem>
+
+ <listitem><para>use a <emphasis>fully qualified name</emphasis> for
+ each libstdc++-symbol (i.e. <command>std::string</command>,
+ <command>std::cout</command>) =&gt; can always be used
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ Because there are many compilers which still use an implementation
+ that does not have the standard C++-library in namespace
+ <command>std::</command>, some care is required to support these as
+ well.
+ </para>
+
+ <para>
+ Namespace back-portability-issues are generally not a problem with
+ g++, because versions of g++ that do not have libstdc++ in
+ <command>std::</command> use <command>-fno-honor-std</command>
+ (ignore <command>std::</command>, <command>:: = std::</command>) by
+ default. That is, the responsibility for enabling or disabling
+ <command>std::</command> is on the user; the maintainer does not have
+ to care about it. This probably applies to some other compilers as
+ well.
+ </para>
+ <para>
+ The following sections list some possible solutions to support compilers
+ that cannot ignore std::.
+ </para>
+
+ <section id = "sec-gtkmm-hack" label = "1.1">
+ <title id="sec-gtkmm-hack.title">Using <emphasis>namespace
+ composition</emphasis> if the project uses a separate
+ namespace</title>
+ <para>
+ <ulink url = "http://gtkmm.sourceforge.net">Gtk--</ulink> defines
+ most of its classes in namespace Gtk::. Thus, it was possible to
+ adapt Gtk-- to namespace std:: by using a C++-feature called
+ <emphasis>namespace composition</emphasis>. This is what happens if
+ you put a <emphasis>using</emphasis>-declaration into a
+ namespace-definition: the imported symbol(s) gets imported into the
+ currently active namespace(s). For example:
+ <programlisting>
+ namespace Gtk {
+ using std::string;
+ class Window { ... }
+ }
+ </programlisting>
+ In this example, <command>std::string</command> gets imported into
+ namespace Gtk::. The result is that you don't have to use
+ <command>std::string</command> in this header, but still
+ <command>std::string</command> does not get imported into
+ the global namespace (::) unless the user does
+ <command>using namespace Gtk;</command> (which is not recommended
+ practice for Gtk--, so it is not a problem). Additionally, the
+ <command>using</command>-declarations are wrapped in macros that
+ are set based on autoconf-tests to either "" or i.e. <command>using
+ std::string;</command> (depending on whether the system has
+ libstdc++ in <command>std::</command> or not). (ideas from
+ <email>llewelly@dbritsch.dsl.xmission.com</email>, Karl Nelson
+ <email>kenelson@ece.ucdavis.edu</email>)
+ </para>
+ </section>
+
+ <section id = "sec-emptyns" label = "1.2">
+ <title id="sec-emptyns.title">Defining an empty namespace std</title>
+ <para>
+ By defining an (empty) namespace <command>std::</command> before
+ using it, you avoid getting errors on systems where no part of the
+ library is in namespace std:
+ <programlisting>
+ namespace std { }
+ using namespace std;
+ </programlisting>
+ </para>
+ </section>
+
+ <section id = "sec-avoidfqn" label = "1.3">
+ <title id="sec-avoidfqn.title">Avoid to use fully qualified names
+ (i.e. std::string)</title>
+ <para>
+ If some compilers complain about <command>using
+ std::string;</command>, and if the "hack" for gtk-- mentioned above
+ does not work, then I see two solutions:
+
+ <itemizedlist>
+ <listitem><para>
+ Define <command>std::</command> as a macro if the compiler
+ doesn't know about <command>std::</command>.
+ <programlisting>
+ #ifdef OLD_COMPILER
+ #define std
+ #endif
+ </programlisting>
+ (thanks to Juergen Heinzl who posted this solution on
+ gnu.gcc.help)
+ </para></listitem>
+
+ <listitem><para>
+ Define a macro <symbol>NS_STD</symbol>, which is defined to
+ either "" or "std"
+ based on an autoconf-test. Then you should be able to use
+ <command>NS_STD::string</command>, which will evaluate to
+ <command>::string</command> ("string in the global namespace") on
+ systems that do not put string in std::. (This is untested)
+ </para></listitem>
+ </itemizedlist>
+
+ </para>
+ </section>
+
+ <section id = "sec-osprojects" label = "1.4">
+ <title id="sec-osprojects.title">How some open-source-projects deal
+ with this</title>
+ <para>
+ This information was gathered around May 2000. It may not be correct
+ by the time you read this.
+ </para>
+ <table><title>Namespace std:: in Open-Source programs</title>
+ <tgroup cols = "2">
+ <tbody>
+ <row>
+ <entry><ulink url = "http://www.clanlib.org">clanlib</ulink>
+ </entry>
+ <entry>usual</entry>
+ </row>
+ <row>
+ <entry><ulink url = "http://pingus.seul.org">pingus</ulink>
+ </entry>
+ <entry>usual</entry>
+ </row>
+ <row>
+ <entry><ulink url = "http://www.mozilla.org">mozilla</ulink>
+ </entry>
+ <entry>usual</entry>
+ </row>
+ <row>
+ <entry><ulink url = "http://www.mnemonic.org">mnemonic</ulink>
+ </entry> <entry>none</entry>
+ </row>
+ <row>
+ <entry><ulink url = "http://libsigc.sourceforge.net">
+ libsigc++</ulink></entry>
+ <entry>conservative-impl</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <table><title>Notations for categories</title>
+ <tgroup cols = "2">
+ <tbody>
+ <row>
+ <entry>usual</entry>
+ <entry>mostly fully qualified names and some
+ using-declarations (but not in headers)</entry>
+ </row>
+ <row>
+ <entry>none</entry> <entry>no namespace std at all</entry>
+ </row>
+ <row>
+ <entry>conservative-impl</entry>
+ <entry>wrap all
+ namespace-handling in macros to support compilers without
+ namespace-support (no libstdc++ used in headers)</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <para>
+ As you can see, this currently lacks an example of a project
+ which uses libstdc++-symbols in headers in a back-portable way
+ (except for Gtk--: see the <link linkend="sec-gtkmm-hack"
+ endterm="sec-gtkmm-hack.title">section on the gtkmm-hack</link>).
+ </para>
+ </section>
+ </section> <!-- end of namespace-section -->
+
+ <section id = "sec-nocreate" label = "2">
+ <title id="sec-nocreate.title">there is no ios::nocreate/ios::noreplace
+ in ISO 14882</title>
+ <para>
+ I have seen <command>ios::nocreate</command> being used for
+ input-streams, most probably because the author thought it would be
+ more correct to specify nocreate "explicitly". So you can simply
+ leave it out for input-streams.
+ </para>
+ <para>
+ For output streams, "nocreate" is probably the default, unless you
+ specify <command>std::ios::trunc</command> ? To be safe, you can open
+ the file for reading, check if it has been opened, and then decide
+ whether you want to create/replace or not. To my knowledge, even
+ older implementations support <command>app</command>,
+ <command>ate</command> and <command>trunc</command> (except for
+ <command>app</command> ?).
+ </para>
+ </section>
+
+ <section id = "sec-stream::attach" label = "3">
+ <title id="sec-stream::attach.title"><command>stream::attach(int
+ fd)</command> is not in the standard any more</title>
+ <para>
+ Phil Edwards <email>pedwards@disaster.jaj.com</email> writes:
+ It was considered and rejected. Not all environments use file
+ descriptors. Of those that do, not all of them use integers to represent
+ them.
+ </para>
+ <para>
+ When using libstdc++-v3, you can use
+ <funcsynopsis>
+ <funcsynopsisinfo format="linespecific">
+ #include &lt;fstream&gt;
+ </funcsynopsisinfo>
+ <funcprototype>
+ <funcdef>
+ <function>basic_filebuf&lt;...&gt;::basic_filebuf&lt;...&gt;
+ </function>
+ </funcdef>
+ <paramdef>__c_file_type* <parameter>file</parameter></paramdef>
+ <paramdef>ios_base::open_mode <parameter>mode</parameter></paramdef>
+ <paramdef>int <parameter>size</parameter></paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ but the the signature of this constructor has changed often, and
+ it might change again. For the current state of this, check
+ <ulink url="../ext/howto.html">the howto for extensions</ulink>.
+ </para>
+ <para>
+ For a portable solution (among systems which use
+ filedescriptors), you need to implement a subclass of
+ <command>std::streambuf</command> (or
+ <command>std::basic_streambuf&lt;..&gt;</command>) which opens a file
+ given a descriptor, and then pass an instance of this to the
+ stream-constructor (from the Josuttis-book).
+ </para>
+ </section>
+
+ <section id = "sec-headers" label = "4">
+ <title id="sec-headers.title">The new headers</title>
+ <para>
+ All new headers can be seen in this <ulink url="headers_cc.txt">
+ source-code</ulink>.
+ </para>
+ <para>
+ The old C++-headers (iostream.h etc.) are available, but gcc generates
+ a warning that you are using deprecated headers.
+ </para>
+
+ <section id = "sec-cheaders" label = "4.1">
+ <title id="sec-cheaders.title">New headers replacing C-headers</title>
+ <para>
+ You should not use the C-headers (except for system-level
+ headers) from C++ programs. Instead, you should use a set of
+ headers that are named by prepending 'c' and, as usual,
+ omitting the extension (.h). For example, instead of using
+ <filename class="headerfile">&lt;math.h&gt;</filename>, you
+ should use <filename class =
+ "headerfile">&lt;cmath&gt;</filename>. In some cases this has
+ the advantage that the C++-header is more standardized than
+ the C-header (i.e. <filename
+ class="headerfile">&lt;ctime&gt;</filename> (almost)
+ corresponds to either <filename class =
+ "headerfile">&lt;time.h&gt;</filename> or <filename class =
+ "headerfile">&lt;sys/time.h&gt;</filename>).
+
+ The standard specifies that if you include the C-style header
+ (<filename class = "headerfile">&lt;math.h&gt;</filename> in
+ this case), the symbols will be available both in the global
+ namespace and in namespace <command>std::</command> (but
+ libstdc++ does not yet have fully compliant headers) On the
+ other hand, if you include only the new header (i.e. <filename
+ class = "headerfile">&lt;cmath&gt;</filename>), the symbols
+ will only be defined in namespace <command>std::</command>
+ (and macros will be converted to inline-functions).
+ </para>
+ <para>
+ For more information on this, and for information on how the
+ GNU C++ implementation might reuse ("shadow") the C
+ library-functions, have a look at <ulink
+ url="http://www.cantrip.org/cheaders.html">
+ www.cantrip.org</ulink>.
+ </para>
+ </section>
+
+ <section id = "sec-fstream-header" label = "4.2">
+ <title id="sec-fstream-header.title">
+ <filename class="headerfile">&lt;fstream&gt;</filename> does
+ not define <command>std::cout</command>,
+ <command>std::cin</command> etc.</title>
+ <para>
+ In earlier versions of the standard,
+ <filename class="headerfile">&lt;fstream.h&gt;</filename>,
+ <filename class="headerfile">&lt;ostream.h&gt;</filename>
+ and <filename class="headerfile">&lt;istream.h&gt;</filename>
+ used to define
+ <command>cout</command>, <command>cin</command> and so on. Because
+ of the templatized iostreams in libstdc++-v3, you need to include
+ <filename class = "headerfile">&lt;iostream&gt;</filename>
+ explicitly to define these.
+ </para>
+ </section>
+ </section>
+
+ <section id = "sec-iterators" label = "5">
+ <title id="sec-iterators.title">Iterators</title>
+ <para>
+ The following are not proper uses of iterators, but may be working
+ fixes for existing uses of iterators.
+ <itemizedlist>
+ <listitem><para>you cannot do
+ <command>ostream::operator&lt;&lt;(iterator)</command> to
+ print the address of the iterator =&gt; use
+ <command>operator&lt;&lt; &amp;*iterator</command> instead ?
+ </para>
+ </listitem>
+ <listitem><para>you cannot clear an iterator's reference
+ (<command>iterator = 0</command>) =&gt; use
+ <command>iterator = iterator_type();</command> ?
+ </para>
+ </listitem>
+ <listitem><para><command>if (iterator)</command> won't work any
+ more => use <command>if (iterator != iterator_type())</command>
+ ?</para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id = "sec-macros" label = "6">
+ <title id="sec-macros.title">
+ Libc-macros (i.e. <command>isspace</command> from
+ <filename class = "headerfile">&lt;cctype&gt;</filename>)</title>
+ <para>
+ Glibc 2.0.x and 2.1.x define the
+ <filename class="headerfile">&lt;ctype.h&gt;</filename>
+ -functionality as macros (isspace, isalpha etc.). Libstdc++-v3
+ "shadows" these macros as described in the <link
+ linkend="sec-cheaders" endterm="sec-cheaders.title">section about
+ c-headers</link>.
+ </para>
+ <para>
+ Older implementations of libstdc++ (g++-2 for egcs 1.x and g++-3
+ for gcc 2.95.x), however, keep these functions as macros, and so it
+ is not back-portable to use fully qualified names. For example:
+ <programlisting>
+ #include &lt;cctype&gt;
+ int main() { std::isspace('X'); }
+ </programlisting>
+ will result in something like this (unless using g++-v3):
+ <programlisting>
+ std:: (__ctype_b[(int) ( ( 'X' ) )] &amp; (unsigned short int)
+ _ISspace ) ;
+ </programlisting>
+ </para>
+ <para>
+ One solution I can think of is to test for -v3 using
+ autoconf-macros, and define macros for each of the C-functions
+ (maybe that is possible with one "wrapper" macro as well ?).
+ </para>
+ <para>
+ Another solution which would fix g++ is to tell the user to modify a
+ header-file so that g++-2 (egcs 1.x) and g++-3 (gcc 2.95.x) define a
+ macro which tells <filename
+ class="headerfile">&lt;ctype.h&gt;</filename> to define functions
+ instead of macros:
+ <programlisting>
+ // This keeps isalnum, et al from being propagated as macros.
+ #if __linux__
+ #define __NO_CTYPE 1
+ #endif
+
+ [ now include &lt;ctype.h&gt; ]
+ </programlisting>
+ </para>
+ <para>
+ Another problem arises if you put a <command>using namespace
+ std;</command> declaration at the top, and include <filename class
+ = "headerfile">&lt;ctype.h&gt;</filename>. This will result in
+ ambiguities between the definitions in the global namespace
+ (<filename class = "headerfile">&lt;ctype.h&gt;</filename>) and the
+ definitions in namespace <command>std::</command>
+ (<command>&lt;cctype&gt;</command>).
+ </para>
+ <para>
+ The solution to this problem was posted to the libstdc++-v3
+ mailing-list:
+ Benjamin Kosnik <email>bkoz@redhat.com</email> writes:
+ <quote>
+ --enable-cshadow-headers is currently broken. As a result, shadow
+ headers are not being searched....
+ </quote>
+ This is now outdated, but gcc 3.0 still does not have fully
+ compliant "shadow headers".
+ </para>
+ </section>
+
+ <section id="sec-stream-state" label="7">
+ <title id="sec-stream-state.title">State of streams</title>
+ <para>
+ At least some older implementations don't have
+ <command>std::ios_base</command>, so you should use
+ <command>std::ios::badbit</command>, <command>std::ios::failbit</command>
+ and <command>std::ios::eofbit</command> and
+ <command>std::ios::goodbit</command>.
+ </para>
+ </section>
+
+ <section id="sec-vector-at" label="8">
+ <title>vector::at is missing (i.e. gcc 2.95.x)</title>
+ <para>
+ One solution is to add an autoconf-test for this:
+ <programlisting>
+ AC_MSG_CHECKING(for container::at)
+ AC_TRY_COMPILE(
+ [
+ #include &lt;vector&gt;
+ #include &lt;deque&gt;
+ #include &lt;string&gt;
+
+ using namespace std;
+ ],
+ [
+ deque&lt;int&gt; test_deque(3);
+ test_deque.at(2);
+ vector&lt;int&gt; test_vector(2);
+ test_vector.at(1);
+ string test_string("test_string");
+ test_string.at(3);
+ ],
+ [AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_CONTAINER_AT)],
+ [AC_MSG_RESULT(no)])
+ </programlisting>
+ If you are using other (non-GNU) compilers it might be a good idea
+ to check for <command>string::at</command> separately.
+ </para>
+ </section>
+
+ <section id="sec-eof" label="9">
+ <title>Using std::char_traits&lt;char&gt;::eof()</title>
+ <para>
+ <programlisting>
+ #ifdef HAVE_CHAR_TRAITS
+ #define CPP_EOF std::char_traits&lt;char&gt;::eof()
+ #else
+ #define CPP_EOF EOF
+ #endif
+ </programlisting>
+ </para>
+ </section>
+
+ <section id="sec-string-clear" label="10">
+ <title>Using string::clear()/string::erase()</title>
+ <para>
+ There are two functions for deleting the contents of a string:
+ <command>clear</command> and <command>erase</command> (the latter
+ returns the string).
+ <programlisting>
+ void
+ clear() { _M_mutate(0, this->size(), 0); }
+ </programlisting>
+ <programlisting>
+ basic_string&amp;
+ erase(size_type __pos = 0, size_type __n = npos)
+ {
+ return this->replace(_M_check(__pos), _M_fold(__pos, __n),
+ _M_data(), _M_data());
+ }
+ </programlisting>
+ The implementation of <command>erase</command> seems to be more
+ complicated (from libstdc++-v3), but <command>clear</command> is not
+ implemented in gcc 2.95.x's libstdc++, so you should use
+ <command>erase</command> (which is probably faster than
+ <command>operator=(charT*)</command>).
+ </para>
+ </section>
+
+ <section id="sec-scan-form" label="11">
+ <title>GNU Extensions ostream::form and istream::scan</title>
+ <para>
+ These are not supported any more - use
+ <link linkend="sec-stringstream" endterm="sec-stringstream.title">
+ stringstreams</link> instead.
+ </para>
+ </section>
+
+ <section id="sec-stringstream" label="12">
+ <title>Using stringstreams</title>
+ <para>
+ Libstdc++-v3 provides the new
+ <command>i/ostringstream</command>-classes, (<filename
+ class="headerfile">&lt;sstream&gt;</filename>), but for compatibility
+ with older implementations you still have to use
+ <command>i/ostrstream</command> (<filename
+ class="headerfile">&lt;strstream&gt;</filename>):
+ <programlisting>
+ #ifdef HAVE_SSTREAM
+ #include &lt;sstream&gt;
+ #else
+ #include &lt;strstream&gt;
+ #endif
+ </programlisting>
+ <itemizedlist>
+ <listitem><para> <command>strstream</command> is considered to be
+ deprecated
+ </para>
+ </listitem>
+ <listitem><para> <command>strstream</command> is limited to
+ <command>char</command>
+ </para>
+ </listitem>
+ <listitem><para> with <command>ostringstream</command> you don't
+ have to take care of terminating the string or freeing its
+ memory
+ </para>
+ </listitem>
+ <listitem><para> <command>istringstream</command> can be re-filled
+ (clear(); str(input);)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ You can then use output-stringstreams like this:
+ <programlisting>
+ #ifdef HAVE_SSTREAM
+ std::ostringstream oss;
+ #else
+ std::ostrstream oss;
+ #endif
+ oss &lt;&lt; "Name=" &lt;&lt; m_name &lt;&lt; ", number=" &lt;&lt; m_number &lt;&lt; std::endl;
+ ...
+ #ifndef HAVE_SSTREAM
+ oss &lt;&lt; std::ends; // terminate the char*-string
+ #endif
+ // str() returns char* for ostrstream and a string for ostringstream
+ // this also causes ostrstream to think that the buffer's memory
+ // is yours
+ m_label.set_text(oss.str());
+ #ifndef HAVE_SSTREAM
+ // let the ostrstream take care of freeing the memory
+ oss.freeze(false);
+ #endif
+ </programlisting>
+ </para>
+ <para>
+ Input-stringstreams can be used similarly:
+ <programlisting>
+ std::string input;
+ ...
+ #ifdef HAVE_SSTREAM
+ std::istringstream iss(input);
+ #else
+ std::istrstream iss(input.c_str());
+ #endif
+ int i;
+ iss >> i;
+ </programlisting>
+ One (the only?) restriction is that an istrstream cannot be re-filled:
+ <programlisting>
+ std::istringstream iss(numerator);
+ iss >> m_num;
+ // this is not possible with istrstream
+ iss.clear();
+ iss.str(denominator);
+ iss >> m_den;
+ </programlisting>
+ If you don't care about speed, you can put these conversions in
+ a template-function:
+ <programlisting>
+ template &lt;class X&gt;
+ void fromString(const string&amp; input, X&amp; any)
+ {
+ #ifdef HAVE_SSTREAM
+ std::istringstream iss(input);
+ #else
+ std::istrstream iss(input.c_str());
+ #endif
+ X temp;
+ iss >> temp;
+ if (iss.fail())
+ throw runtime_error(..)
+ any = temp;
+ }
+ </programlisting>
+ Another example of using stringstreams is in <ulink
+ url="../21_strings/howto.html">this howto</ulink>.
+ </para>
+ <para>
+ I have read the Josuttis book on Standard C++, so some information
+ comes from there. Additionally, there is information in
+ "info iostream", which covers the old implementation that gcc 2.95.x
+ uses.
+ </para>
+ </section>
+
+ <section id = "sec-about" label="13">
+ <title id="sec-about.title">About...</title>
+ <para>
+ Please send any experience, additions, corrections or questions to
+ <ulink url = "mailto:fnatter@gmx.net">fnatter@gmx.net</ulink> or for
+ discussion to the libstdc++-v3-mailing-list.
+ </para>
+ </section>
+
+</article>
+
+ <!-- this is now obsolete, since the nwalsh-stylesheet generates an index
+<para>
+<itemizedlist>
+<listitem><para>
+<link linkend = "sec-nsstd" endterm = "sec-nsstd.title"/>
+</para></listitem>
+<listitem><para>
+<link linkend = "sec-nocreate" endterm = "sec-nocreate.title"/>
+</para></listitem>
+<listitem><para>
+<link linkend = "sec-stream::attach"
+ endterm = "sec-stream::attach.title"/>
+</para></listitem>
+<listitem><para>
+<link linkend = "sec-headers" endterm = "sec-headers.title"/>
+</para></listitem>
+<listitem><para>
+<link linkend = "sec-iterators" endterm = "sec-iterators.title"/>
+</para></listitem>
+<listitem><para>
+<link linkend = "sec-macros" endterm = "sec-macros.title"/>
+</para></listitem>
+<listitem><para>
+<link linkend = "sec-about" endterm = "sec-about.title"/>
+</para></listitem>
+</itemizedlist>
+</para>
+ -->
+
+<!--
+Local Variables:
+compile-command: "xsltproc -o porting-howto.html docbook-xslt/docbook/html/docbook.xsl porting-howto.xml"
+End:
+-->
diff --git a/libstdc++-v3/docs/html/17_intro/porting.html b/libstdc++-v3/docs/html/17_intro/porting.html
new file mode 100644
index 00000000000..344fb4f31b3
--- /dev/null
+++ b/libstdc++-v3/docs/html/17_intro/porting.html
@@ -0,0 +1,841 @@
+<html lang="en">
+<head>
+<title>Porting libstdc++-v3</title>
+<meta http-equiv="Content-Type" content="text/html">
+<meta name=description content="Porting libstdc++-v3">
+<meta name=generator content="makeinfo 4.0b">
+<link href="http://texinfo.org/" rel=generator-home>
+</head>
+
+<body>
+<p><hr>
+Node:<a name="Top">Top</a>,
+Next:<a rel=next href="#Operating%20system">Operating system</a>
+<br>
+
+<h1>Porting libstdc++-v3</h1>
+
+<p>This document explains how to port libstdc++-v3 (the GNU C++ library) to
+a new target.
+
+<p>In order to make the GNU C++ library (libstdc++-v3) work with a new
+target, you must edit some configuration files and provide some new
+header files.
+
+<p>Before you get started, make sure that you have a working C library on
+your target. The C library need not precisely comply with any
+particular standard, but should generally conform to the requirements
+imposed by the ANSI/ISO standard.
+
+<p>In addition, you should try to verify that the C++ compiler generally
+works. It is difficult to test the C++ compiler without a working
+library, but you should at least try some minimal test cases.
+
+<p>Here are the primary steps required to port the library:
+
+<ul>
+<li><a href="#Operating%20system">Operating system</a>: Configuring for your operating system.
+<li><a href="#Character%20types">Character types</a>: Implementing character classification.
+<li><a href="#Thread%20safety">Thread safety</a>: Implementing atomic operations.
+<li><a href="#Numeric%20limits">Numeric limits</a>: Implementing numeric limits.
+<li><a href="#Libtool">Libtool</a>: Using libtool.
+<li><a href="#GNU%20Free%20Documentation%20License">GNU Free Documentation License</a>: How you can copy and share this manual.
+</ul>
+
+<p><hr>
+Node:<a name="Operating%20system">Operating system</a>,
+Next:<a rel=next href="#Character%20types">Character types</a>,
+Previous:<a rel=previous href="#Top">Top</a>,
+Up:<a rel=up href="#Top">Top</a>
+<br>
+
+<h1>Operating system</h1>
+
+<p>If you are porting to a new operating-system (as opposed to a new chip
+using an existing operating system), you will need to create a new
+directory in the <code>config/os</code> hierarchy. For example, the IRIX
+configuration files are all in <code>config/os/irix</code>. There is no set
+way to organize the OS configuration directory. For example,
+<code>config/os/solaris/solaris-2.6</code> and
+<code>config/os/solaris/solaris-2.7</code> are used as configuration
+directories for these two versions of Solaris. On the other hand, both
+Solaris 2.7 and Solaris 2.8 use the <code>config/os/solaris/solaris-2.7</code>
+directory. The important information is that there needs to be a
+directory under <code>config/os</code> to store the files for your operating
+system.
+
+<p>You'll have to change the <code>configure.target</code> file to ensure that
+your new directory is activated. Look for the switch statement that
+sets <code>os_include_dir</code>, and add a pattern to handle your operating
+system. The switch statement switches on only the OS portion of the
+standard target triplet; e.g., the <code>solaris2.8</code> in
+<code>sparc-sun-solaris2.8</code>.
+
+<p>The first file to create in this directory, should be called
+<code>bits/os_defines.h</code>. This file contains basic macro definitions
+that are required to allow the C++ library to work with your C library.
+This file should provide macro definitions for <code>__off_t</code>,
+<code>__off64_t</code>, and <code>__ssize_t</code>. Typically, this just looks
+like:
+
+<pre>#define __off_t off_t
+#define __off64_t off64_t
+#define __ssize_t ssize_t
+</pre>
+
+<p>You don't have to provide these definitions if your system library
+already defines these types - but the only library known to provide
+these types is the GNU C Library, so you will almost certainly have to
+provide these macros. Note that this file does not have to include a
+header file that defines <code>off_t</code>, or the other types; you simply
+have to provide the macros.
+
+<p>In addition, several libstdc++-v3 source files unconditionally define
+the macro <code>_POSIX_SOURCE</code>. On many systems, defining this macro
+causes large portions of the C library header files to be eliminated
+at preprocessing time. Therefore, you may have to <code>#undef</code> this
+macro, or define other macros (like <code>_LARGEFILE_SOURCE</code> or
+<code>__EXTENSIONS__</code>). You won't know what macros to define or
+undefine at this point; you'll have to try compiling the library and
+seeing what goes wrong. If you see errors about calling functions
+that have not been declared, look in your C library headers to see if
+the functions are declared there, and then figure out what macros you
+need to define. You will need to add them to the
+<code>CPLUSPLUS_CPP_SPEC</code> macro in the GCC configuration file for your
+target. It will not work to simply define these macros in
+<code>os_defines.h</code>.
+
+<p>At this time, there are two libstdc++-v3-specific macros which may be
+defined. <code>_G_USING_THUNKS</code> may be defined to 0 to express that the
+port doesn't use thunks (although it is unclear that this is still
+useful since libio support isn't currently working and the g++ v3 ABI
+invalidates the assumption that some ports don't use thunks).
+<code>_GLIBCPP_AVOID_FSEEK</code> may be defined if seeking on an interactive
+stream (or one hooked to a pipe) is not allowed by the OS. In this
+case, getc()/ungetc() will be used at some key locations in the library
+implementation instead of fseek(). Currently, the code path to avoid
+fseek() is only enabled when the seek size is 1 character away from the
+current stream position. This is known to improve *-unknown-freebsd*,
+sparc-sun-solaris2.* and *-*-mingw32*.
+
+<p>Finally, you should bracket the entire file in an include-guard, like
+this:
+
+<pre>#ifndef _GLIBCPP_OS_DEFINES
+#define _GLIBCPP_OS_DEFINES
+...
+#endif
+</pre>
+
+<p>We recommend copying an existing <code>bits/os_defines.h</code> to use as a
+starting point.
+
+<p><hr>
+Node:<a name="Character%20types">Character types</a>,
+Next:<a rel=next href="#Thread%20safety">Thread safety</a>,
+Previous:<a rel=previous href="#Operating%20system">Operating system</a>,
+Up:<a rel=up href="#Top">Top</a>
+<br>
+
+<h1>Character types</h1>
+
+<p>The library requires that you provide three header files to implement
+character classification, analogous to that provided by the C libraries
+<code>&lt;ctype.h&gt;</code> header. You can model these on the files provided in
+<code>config/os/generic/bits</code>. However, these files will almost
+certainly need some modification.
+
+<p>The first file to write is <code>bits/ctype_base.h</code>. This file provides
+some very basic information about character classification. The libstdc++-v3
+library assumes that your C library implements <code>&lt;ctype.h&gt;</code> by using
+a table (indexed by character code) containing integers, where each of
+these integers is a bit-mask indicating whether the character is
+upper-case, lower-case, alphabetic, etc. The <code>bits/ctype_base.h</code>
+file gives the type of the integer, and the values of the various bit
+masks. You will have to peer at your own <code>&lt;ctype.h&gt;</code> to figure out
+how to define the values required by this file.
+
+<p>The <code>bits/ctype_base.h</code> header file does not need include guards.
+It should contain a single <code>struct</code> definition called
+<code>ctype_base</code>. This <code>struct</code> should contain two type
+declarations, and one enumeration declaration, like this example, taken
+from the IRIX configuration:
+
+<pre>struct ctype_base
+{
+ typedef unsigned int mask;
+ typedef int* __to_type;
+
+ enum
+ {
+ space = _ISspace,
+ print = _ISprint,
+ cntrl = _IScntrl,
+ upper = _ISupper,
+ lower = _ISlower,
+ alpha = _ISalpha,
+ digit = _ISdigit,
+ punct = _ISpunct,
+ xdigit = _ISxdigit,
+ alnum = _ISalnum,
+ graph = _ISgraph
+ };
+};
+</pre>
+
+<p>The <code>mask</code> type is the type of the elements in the table. If your
+C library uses a table to map lower-case numbers to upper-case numbers,
+and vice versa, you should define <code>__to_type</code> to be the type of the
+elements in that table. If you don't mind taking a minor performance
+penalty, or if your library doesn't implement <code>toupper</code> and
+<code>tolower</code> in this way, you can pick any pointer-to-integer type,
+but you must still define the type.
+
+<p>The enumeration should give definitions for all the values in the above
+example, using the values from your native <code>&lt;ctype.h&gt;</code>. They can
+be given symbolically (as above), or numerically, if you prefer. You do
+not have to include <code>&lt;ctype.h&gt;</code> in this header; it will always be
+included before <code>bits/ctype_base.h</code> is included.
+
+<p>The next file to write is <code>bits/ctype_noninline.h</code>, which also does
+not require include guards. This file defines a few member functions
+that will be included in <code>include/bits/locale_facets.h</code>. The first
+function that must be written is the <code>ctype&lt;char&gt;::ctype</code>
+constructor. Here is the IRIX example:
+
+<pre>ctype&lt;char&gt;::ctype(const mask* __table = 0, bool __del = false,
+ size_t __refs = 0)
+ : _Ctype_nois&lt;char&gt;(__refs), _M_del(__table != 0 &amp;&amp; __del),
+ _M_toupper(NULL),
+ _M_tolower(NULL),
+ _M_ctable(NULL),
+ _M_table(!__table
+ ? (const mask*) (__libc_attr._ctype_tbl-&gt;_class + 1)
+ : __table)
+ { }
+</pre>
+
+<p>There are two parts of this that you might choose to alter. The first,
+and most important, is the line involving <code>__libc_attr</code>. That is
+IRIX system-dependent code that gets the base of the table mapping
+character codes to attributes. You need to substitute code that obtains
+the address of this table on your system. If you want to use your
+operating system's tables to map upper-case letters to lower-case, and
+vice versa, you should initialize <code>_M_toupper</code> and
+<code>_M_tolower</code> with those tables, in similar fashion.
+
+<p>Now, you have to write two functions to convert from upper-case to
+lower-case, and vice versa. Here are the IRIX versions:
+
+<pre>char
+ctype&lt;char&gt;::do_toupper(char __c) const
+{ return _toupper(__c); }
+
+char
+ctype&lt;char&gt;::do_tolower(char __c) const
+{ return _tolower(__c); }
+</pre>
+
+<p>Your C library provides equivalents to IRIX's <code>_toupper</code> and
+<code>_tolower</code>. If you initialized <code>_M_toupper</code> and
+<code>_M_tolower</code> above, then you could use those tables instead.
+
+<p>Finally, you have to provide two utility functions that convert strings
+of characters. The versions provided here will always work - but you
+could use specialized routines for greater performance if you have
+machinery to do that on your system:
+
+<pre>const char*
+ctype&lt;char&gt;::do_toupper(char* __low, const char* __high) const
+{
+ while (__low &lt; __high)
+ {
+ *__low = do_toupper(*__low);
+ ++__low;
+ }
+ return __high;
+}
+
+const char*
+ctype&lt;char&gt;::do_tolower(char* __low, const char* __high) const
+{
+ while (__low &lt; __high)
+ {
+ *__low = do_tolower(*__low);
+ ++__low;
+ }
+ return __high;
+}
+</pre>
+
+<p>You must also provide the <code>bits/ctype_inline.h</code> file, which
+contains a few more functions. On most systems, you can just copy
+<code>config/os/generic/ctype_inline.h</code> and use it on your system.
+
+<p>In detail, the functions provided test characters for particular
+properties; they are analogous to the functions like <code>isalpha</code> and
+<code>islower</code> provided by the C library.
+
+<p>The first function is implemented like this on IRIX:
+
+<pre>bool
+ctype&lt;char&gt;::
+is(mask __m, char __c) const throw()
+{ return (_M_table)[(unsigned char)(__c)] &amp; __m; }
+</pre>
+
+<p>The <code>_M_table</code> is the table passed in above, in the constructor.
+This is the table that contains the bitmasks for each character. The
+implementation here should work on all systems.
+
+<p>The next function is:
+
+<pre>const char*
+ctype&lt;char&gt;::
+is(const char* __low, const char* __high, mask* __vec) const throw()
+{
+ while (__low &lt; __high)
+ *__vec++ = (_M_table)[(unsigned char)(*__low++)];
+ return __high;
+}
+</pre>
+
+<p>This function is similar; it copies the masks for all the characters
+from <code>__low</code> up until <code>__high</code> into the vector given by
+<code>__vec</code>.
+
+<p>The last two functions again are entirely generic:
+
+<pre>const char*
+ctype&lt;char&gt;::
+scan_is(mask __m, const char* __low, const char* __high) const throw()
+{
+ while (__low &lt; __high &amp;&amp; !this-&gt;is(__m, *__low))
+ ++__low;
+ return __low;
+}
+
+const char*
+ctype&lt;char&gt;::
+scan_not(mask __m, const char* __low, const char* __high) const throw()
+{
+ while (__low &lt; __high &amp;&amp; this-&gt;is(__m, *__low))
+ ++__low;
+ return __low;
+}
+</pre>
+
+<p><hr>
+Node:<a name="Thread%20safety">Thread safety</a>,
+Next:<a rel=next href="#Numeric%20limits">Numeric limits</a>,
+Previous:<a rel=previous href="#Character%20types">Character types</a>,
+Up:<a rel=up href="#Top">Top</a>
+<br>
+
+<h1>Thread safety</h1>
+
+<p>The C++ library string functionality requires a couple of atomic
+operations to provide thread-safety. If you don't take any special
+action, the library will use stub versions of these functions that are
+not thread-safe. They will work fine, unless your applications are
+multi-threaded.
+
+<p>If you want to provide custom, safe, versions of these functions, there
+are two distinct approaches. One is to provide a version for your CPU,
+using assembly language constructs. The other is to use the
+thread-safety primitives in your operating system. In either case, you
+make a file called <code>bits/atomicity.h</code>.
+
+<p>If you are using the assembly-language approach, put this code in
+<code>config/cpu/&lt;chip&gt;/bits/atomicity.h</code>, where chip is the name of
+your processor. In that case, edit the switch statement in
+<code>configure.target</code> to set the <code>cpu_include_dir</code>. In either
+case, set the switch statement that sets <code>ATOMICITYH</code> to be the
+directory containing <code>bits/atomicity.h</code>.
+
+<p>With those bits out of the way, you have to actually write
+<code>bits/atomicity.h</code> itself. This file should be wrapped in an
+include guard named <code>_BITS_ATOMICITY_H</code>. It should define one
+type, and two functions.
+
+<p>The type is <code>_Atomic_word</code>. Here is the version used on IRIX:
+
+<pre>typedef long _Atomic_word;
+</pre>
+
+<p>This type must be a signed integral type supporting atomic operations.
+If you're using the OS approach, use the same type used by your system's
+primitives. Otherwise, use the type for which your CPU provides atomic
+primitives.
+
+<p>Then, you must provide two functions. The bodies of these functions
+must be equivalent to those provided here, but using atomic operations:
+
+<pre>static inline _Atomic_word
+__attribute__ ((__unused__))
+__exchange_and_add (_Atomic_word* __mem, int __val)
+{
+ _Atomic_word __result = *__mem;
+ *__mem += __val;
+ return __result;
+}
+
+static inline void
+__attribute__ ((__unused__))
+__atomic_add (_Atomic_word* __mem, int __val)
+{
+ *__mem += __val;
+}
+</pre>
+
+<p><hr>
+Node:<a name="Numeric%20limits">Numeric limits</a>,
+Next:<a rel=next href="#Libtool">Libtool</a>,
+Previous:<a rel=previous href="#Thread%20safety">Thread safety</a>,
+Up:<a rel=up href="#Top">Top</a>
+<br>
+
+<h1>Numeric limits</h1>
+
+<p>The C++ library requires information about the fundamental data types,
+such as the minimum and maximum representable values of each type.
+You can define each of these values individually, but it is usually
+easiest just to indicate how many bits are used in each of the data
+types and let the library do the rest. For information about the
+macros to define, see the top of <code>include/bits/std_limits.h</code>.
+
+<p>If you need to define any macros, you can do so in
+<code>os_defines.h</code>. However, if all operating systems for your CPU
+are likely to use the same values, you can provide a CPU-specific file
+instead so that you do not have to provide the same definitions for
+each operating system. To take that approach, create a new file
+called <code>limits.h</code> in your CPU configuration directory (e.g.,
+<code>config/cpu/i386/bits</code>) and then modify <code>configure.target</code>
+so that <code>LIMITSH</code> is set to the CPU directory (e.g.,
+<code>config/cpu/i386</code>). Note that <code>LIMITSH</code> should not include
+the <code>bits</code> part of the directory name.
+
+<p><hr>
+Node:<a name="Libtool">Libtool</a>,
+Next:<a rel=next href="#GNU%20Free%20Documentation%20License">GNU Free Documentation License</a>,
+Previous:<a rel=previous href="#Numeric%20limits">Numeric limits</a>,
+Up:<a rel=up href="#Top">Top</a>
+<br>
+
+<h1>Libtool</h1>
+
+<p>The C++ library is compiled, archived and linked with libtool.
+Explaining the full workings of libtool is beyond the scope of this
+document, but there are a few, particular bits that are necessary for
+porting.
+
+<p>Some parts of the libstdc++-v3 library are compiled with the libtool
+<code>--tags CXX</code> option (the C++ definitions for libtool). Therefore,
+<code>ltcf-cxx.sh</code> in the top-level directory needs to have the correct
+logic to compile and archive objects equivalent to the C version of libtool,
+<code>ltcf-c.sh</code>. Some libtool targets have definitions for C but not
+for C++, or C++ definitions which have not been kept up to date.
+
+<p>The C++ run-time library contains initialization code that needs to be
+run as the library is loaded. Often, that requires linking in special
+object files when the C++ library is built as a shared library, or
+taking other system-specific actions.
+
+<p>The libstdc++-v3 library is linked with the C version of libtool, even though it
+is a C++ library. Therefore, the C version of libtool needs to ensure
+that the run-time library initializers are run. The usual way to do
+this is to build the library using <code>gcc -shared</code>.
+
+<p>If you need to change how the library is linked, look at
+<code>ltcf-c.sh</code> in the top-level directory. Find the switch statement
+that sets <code>archive_cmds</code>. Here, adjust the setting for your
+operating system.
+
+<p><hr>
+Node:<a name="GNU%20Free%20Documentation%20License">GNU Free Documentation License</a>,
+Previous:<a rel=previous href="#Libtool">Libtool</a>,
+Up:<a rel=up href="#Top">Top</a>
+<br>
+
+<h1>GNU Free Documentation License</h1>
+
+<div align="center">Version 1.1, March 2000</div>
+<pre>Copyright &copy; 2000 Free Software Foundation, Inc.
+59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
+
+Everyone is permitted to copy and distribute verbatim copies
+of this license document, but changing it is not allowed.
+</pre>
+
+<ol type=1 start=0>
+</p><li>PREAMBLE
+
+<p>The purpose of this License is to make a manual, textbook, or other
+written document <dfn>free</dfn> in the sense of freedom: to assure everyone
+the effective freedom to copy and redistribute it, with or without
+modifying it, either commercially or noncommercially. Secondarily,
+this License preserves for the author and publisher a way to get
+credit for their work, while not being considered responsible for
+modifications made by others.
+
+<p>This License is a kind of "copyleft", which means that derivative
+works of the document must themselves be free in the same sense. It
+complements the GNU General Public License, which is a copyleft
+license designed for free software.
+
+<p>We have designed this License in order to use it for manuals for free
+software, because free software needs free documentation: a free
+program should come with manuals providing the same freedoms that the
+software does. But this License is not limited to software manuals;
+it can be used for any textual work, regardless of subject matter or
+whether it is published as a printed book. We recommend this License
+principally for works whose purpose is instruction or reference.
+
+</p><li>APPLICABILITY AND DEFINITIONS
+
+<p>This License applies to any manual or other work that contains a
+notice placed by the copyright holder saying it can be distributed
+under the terms of this License. The "Document", below, refers to any
+such manual or work. Any member of the public is a licensee, and is
+addressed as "you".
+
+<p>A "Modified Version" of the Document means any work containing the
+Document or a portion of it, either copied verbatim, or with
+modifications and/or translated into another language.
+
+<p>A "Secondary Section" is a named appendix or a front-matter section of
+the Document that deals exclusively with the relationship of the
+publishers or authors of the Document to the Document's overall subject
+(or to related matters) and contains nothing that could fall directly
+within that overall subject. (For example, if the Document is in part a
+textbook of mathematics, a Secondary Section may not explain any
+mathematics.) The relationship could be a matter of historical
+connection with the subject or with related matters, or of legal,
+commercial, philosophical, ethical or political position regarding
+them.
+
+<p>The "Invariant Sections" are certain Secondary Sections whose titles
+are designated, as being those of Invariant Sections, in the notice
+that says that the Document is released under this License.
+
+<p>The "Cover Texts" are certain short passages of text that are listed,
+as Front-Cover Texts or Back-Cover Texts, in the notice that says that
+the Document is released under this License.
+
+<p>A "Transparent" copy of the Document means a machine-readable copy,
+represented in a format whose specification is available to the
+general public, whose contents can be viewed and edited directly and
+straightforwardly with generic text editors or (for images composed of
+pixels) generic paint programs or (for drawings) some widely available
+drawing editor, and that is suitable for input to text formatters or
+for automatic translation to a variety of formats suitable for input
+to text formatters. A copy made in an otherwise Transparent file
+format whose markup has been designed to thwart or discourage
+subsequent modification by readers is not Transparent. A copy that is
+not "Transparent" is called "Opaque".
+
+<p>Examples of suitable formats for Transparent copies include plain
+<small>ASCII</small> without markup, Texinfo input format, LaTeX input format,
+<small>SGML</small> or <small>XML</small> using a publicly available
+<small>DTD</small>, and standard-conforming simple <small>HTML</small> designed
+for human modification. Opaque formats include PostScript,
+<small>PDF</small>, proprietary formats that can be read and edited only by
+proprietary word processors, <small>SGML</small> or <small>XML</small> for which
+the <small>DTD</small> and/or processing tools are not generally available,
+and the machine-generated <small>HTML</small> produced by some word
+processors for output purposes only.
+
+<p>The "Title Page" means, for a printed book, the title page itself,
+plus such following pages as are needed to hold, legibly, the material
+this License requires to appear in the title page. For works in
+formats which do not have any title page as such, "Title Page" means
+the text near the most prominent appearance of the work's title,
+preceding the beginning of the body of the text.
+
+</p><li>VERBATIM COPYING
+
+<p>You may copy and distribute the Document in any medium, either
+commercially or noncommercially, provided that this License, the
+copyright notices, and the license notice saying this License applies
+to the Document are reproduced in all copies, and that you add no other
+conditions whatsoever to those of this License. You may not use
+technical measures to obstruct or control the reading or further
+copying of the copies you make or distribute. However, you may accept
+compensation in exchange for copies. If you distribute a large enough
+number of copies you must also follow the conditions in section 3.
+
+<p>You may also lend copies, under the same conditions stated above, and
+you may publicly display copies.
+
+</p><li>COPYING IN QUANTITY
+
+<p>If you publish printed copies of the Document numbering more than 100,
+and the Document's license notice requires Cover Texts, you must enclose
+the copies in covers that carry, clearly and legibly, all these Cover
+Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
+the back cover. Both covers must also clearly and legibly identify
+you as the publisher of these copies. The front cover must present
+the full title with all words of the title equally prominent and
+visible. You may add other material on the covers in addition.
+Copying with changes limited to the covers, as long as they preserve
+the title of the Document and satisfy these conditions, can be treated
+as verbatim copying in other respects.
+
+<p>If the required texts for either cover are too voluminous to fit
+legibly, you should put the first ones listed (as many as fit
+reasonably) on the actual cover, and continue the rest onto adjacent
+pages.
+
+<p>If you publish or distribute Opaque copies of the Document numbering
+more than 100, you must either include a machine-readable Transparent
+copy along with each Opaque copy, or state in or with each Opaque copy
+a publicly-accessible computer-network location containing a complete
+Transparent copy of the Document, free of added material, which the
+general network-using public has access to download anonymously at no
+charge using public-standard network protocols. If you use the latter
+option, you must take reasonably prudent steps, when you begin
+distribution of Opaque copies in quantity, to ensure that this
+Transparent copy will remain thus accessible at the stated location
+until at least one year after the last time you distribute an Opaque
+copy (directly or through your agents or retailers) of that edition to
+the public.
+
+<p>It is requested, but not required, that you contact the authors of the
+Document well before redistributing any large number of copies, to give
+them a chance to provide you with an updated version of the Document.
+
+</p><li>MODIFICATIONS
+
+<p>You may copy and distribute a Modified Version of the Document under
+the conditions of sections 2 and 3 above, provided that you release
+the Modified Version under precisely this License, with the Modified
+Version filling the role of the Document, thus licensing distribution
+and modification of the Modified Version to whoever possesses a copy
+of it. In addition, you must do these things in the Modified Version:
+
+<ol type=A start=1>
+</p><li>Use in the Title Page (and on the covers, if any) a title distinct
+from that of the Document, and from those of previous versions
+(which should, if there were any, be listed in the History section
+of the Document). You may use the same title as a previous version
+if the original publisher of that version gives permission.
+
+<li>List on the Title Page, as authors, one or more persons or entities
+responsible for authorship of the modifications in the Modified
+Version, together with at least five of the principal authors of the
+Document (all of its principal authors, if it has less than five).
+
+<li>State on the Title page the name of the publisher of the
+Modified Version, as the publisher.
+
+<li>Preserve all the copyright notices of the Document.
+
+<li>Add an appropriate copyright notice for your modifications
+adjacent to the other copyright notices.
+
+<li>Include, immediately after the copyright notices, a license notice
+giving the public permission to use the Modified Version under the
+terms of this License, in the form shown in the Addendum below.
+
+<li>Preserve in that license notice the full lists of Invariant Sections
+and required Cover Texts given in the Document's license notice.
+
+<li>Include an unaltered copy of this License.
+
+<li>Preserve the section entitled "History", and its title, and add to
+it an item stating at least the title, year, new authors, and
+publisher of the Modified Version as given on the Title Page. If
+there is no section entitled "History" in the Document, create one
+stating the title, year, authors, and publisher of the Document as
+given on its Title Page, then add an item describing the Modified
+Version as stated in the previous sentence.
+
+<li>Preserve the network location, if any, given in the Document for
+public access to a Transparent copy of the Document, and likewise
+the network locations given in the Document for previous versions
+it was based on. These may be placed in the "History" section.
+You may omit a network location for a work that was published at
+least four years before the Document itself, or if the original
+publisher of the version it refers to gives permission.
+
+<li>In any section entitled "Acknowledgments" or "Dedications",
+preserve the section's title, and preserve in the section all the
+substance and tone of each of the contributor acknowledgments
+and/or dedications given therein.
+
+<li>Preserve all the Invariant Sections of the Document,
+unaltered in their text and in their titles. Section numbers
+or the equivalent are not considered part of the section titles.
+
+<li>Delete any section entitled "Endorsements". Such a section
+may not be included in the Modified Version.
+
+<li>Do not retitle any existing section as "Endorsements"
+or to conflict in title with any Invariant Section.
+</ol>
+
+<p>If the Modified Version includes new front-matter sections or
+appendices that qualify as Secondary Sections and contain no material
+copied from the Document, you may at your option designate some or all
+of these sections as invariant. To do this, add their titles to the
+list of Invariant Sections in the Modified Version's license notice.
+These titles must be distinct from any other section titles.
+
+<p>You may add a section entitled "Endorsements", provided it contains
+nothing but endorsements of your Modified Version by various
+parties--for example, statements of peer review or that the text has
+been approved by an organization as the authoritative definition of a
+standard.
+
+<p>You may add a passage of up to five words as a Front-Cover Text, and a
+passage of up to 25 words as a Back-Cover Text, to the end of the list
+of Cover Texts in the Modified Version. Only one passage of
+Front-Cover Text and one of Back-Cover Text may be added by (or
+through arrangements made by) any one entity. If the Document already
+includes a cover text for the same cover, previously added by you or
+by arrangement made by the same entity you are acting on behalf of,
+you may not add another; but you may replace the old one, on explicit
+permission from the previous publisher that added the old one.
+
+<p>The author(s) and publisher(s) of the Document do not by this License
+give permission to use their names for publicity for or to assert or
+imply endorsement of any Modified Version.
+
+</p><li>COMBINING DOCUMENTS
+
+<p>You may combine the Document with other documents released under this
+License, under the terms defined in section 4 above for modified
+versions, provided that you include in the combination all of the
+Invariant Sections of all of the original documents, unmodified, and
+list them all as Invariant Sections of your combined work in its
+license notice.
+
+<p>The combined work need only contain one copy of this License, and
+multiple identical Invariant Sections may be replaced with a single
+copy. If there are multiple Invariant Sections with the same name but
+different contents, make the title of each such section unique by
+adding at the end of it, in parentheses, the name of the original
+author or publisher of that section if known, or else a unique number.
+Make the same adjustment to the section titles in the list of
+Invariant Sections in the license notice of the combined work.
+
+<p>In the combination, you must combine any sections entitled "History"
+in the various original documents, forming one section entitled
+"History"; likewise combine any sections entitled "Acknowledgments",
+and any sections entitled "Dedications". You must delete all sections
+entitled "Endorsements."
+
+</p><li>COLLECTIONS OF DOCUMENTS
+
+<p>You may make a collection consisting of the Document and other documents
+released under this License, and replace the individual copies of this
+License in the various documents with a single copy that is included in
+the collection, provided that you follow the rules of this License for
+verbatim copying of each of the documents in all other respects.
+
+<p>You may extract a single document from such a collection, and distribute
+it individually under this License, provided you insert a copy of this
+License into the extracted document, and follow this License in all
+other respects regarding verbatim copying of that document.
+
+</p><li>AGGREGATION WITH INDEPENDENT WORKS
+
+<p>A compilation of the Document or its derivatives with other separate
+and independent documents or works, in or on a volume of a storage or
+distribution medium, does not as a whole count as a Modified Version
+of the Document, provided no compilation copyright is claimed for the
+compilation. Such a compilation is called an "aggregate", and this
+License does not apply to the other self-contained works thus compiled
+with the Document, on account of their being thus compiled, if they
+are not themselves derivative works of the Document.
+
+<p>If the Cover Text requirement of section 3 is applicable to these
+copies of the Document, then if the Document is less than one quarter
+of the entire aggregate, the Document's Cover Texts may be placed on
+covers that surround only the Document within the aggregate.
+Otherwise they must appear on covers around the whole aggregate.
+
+</p><li>TRANSLATION
+
+<p>Translation is considered a kind of modification, so you may
+distribute translations of the Document under the terms of section 4.
+Replacing Invariant Sections with translations requires special
+permission from their copyright holders, but you may include
+translations of some or all Invariant Sections in addition to the
+original versions of these Invariant Sections. You may include a
+translation of this License provided that you also include the
+original English version of this License. In case of a disagreement
+between the translation and the original English version of this
+License, the original English version will prevail.
+
+</p><li>TERMINATION
+
+<p>You may not copy, modify, sublicense, or distribute the Document except
+as expressly provided for under this License. Any other attempt to
+copy, modify, sublicense or distribute the Document is void, and will
+automatically terminate your rights under this License. However,
+parties who have received copies, or rights, from you under this
+License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+</p><li>FUTURE REVISIONS OF THIS LICENSE
+
+<p>The Free Software Foundation may publish new, revised versions
+of the GNU Free Documentation License from time to time. Such new
+versions will be similar in spirit to the present version, but may
+differ in detail to address new problems or concerns. See
+<a href="http://www.gnu.org/copyleft/">http://www.gnu.org/copyleft/</a>.
+
+<p>Each version of the License is given a distinguishing version number.
+If the Document specifies that a particular numbered version of this
+License "or any later version" applies to it, you have the option of
+following the terms and conditions either of that specified version or
+of any later version that has been published (not as a draft) by the
+Free Software Foundation. If the Document does not specify a version
+number of this License, you may choose any version ever published (not
+as a draft) by the Free Software Foundation.
+</ol>
+
+<h2>ADDENDUM: How to use this License for your documents</h2>
+
+<p>To use this License in a document you have written, include a copy of
+the License in the document and put the following copyright and
+license notices just after the title page:
+
+<pre> Copyright (C) <var>year</var> <var>your name</var>.
+ Permission is granted to copy, distribute and/or modify this document
+ under the terms of the GNU Free Documentation License, Version 1.1
+ or any later version published by the Free Software Foundation;
+ with the Invariant Sections being <var>list their titles</var>, with the
+ Front-Cover Texts being <var>list</var>, and with the Back-Cover Texts being <var>list</var>.
+ A copy of the license is included in the section entitled ``GNU
+ Free Documentation License''.
+</pre>
+
+<p>If you have no Invariant Sections, write "with no Invariant Sections"
+instead of saying which ones are invariant. If you have no
+Front-Cover Texts, write "no Front-Cover Texts" instead of
+"Front-Cover Texts being <var>list</var>"; likewise for Back-Cover Texts.
+
+<p>If your document contains nontrivial examples of program code, we
+recommend releasing these examples in parallel under your choice of
+free software license, such as the GNU General Public License,
+to permit their use in free software.
+
+
+<h1>Table of Contents</h1>
+<ul>
+<li><a href="#Top">Porting libstdc++-v3</a>
+<li><a href="#Operating%20system">Operating system</a>
+<li><a href="#Character%20types">Character types</a>
+<li><a href="#Thread%20safety">Thread safety</a>
+<li><a href="#Numeric%20limits">Numeric limits</a>
+<li><a href="#Libtool">Libtool</a>
+<li><a href="#GNU%20Free%20Documentation%20License">GNU Free Documentation License</a>
+<ul>
+<li><a href="#GNU%20Free%20Documentation%20License">ADDENDUM: How to use this License for your documents</a>
+</ul>
+</ul>
+
+</body></html>
+
diff --git a/libstdc++-v3/docs/html/17_intro/porting.texi b/libstdc++-v3/docs/html/17_intro/porting.texi
new file mode 100644
index 00000000000..d5d32b4a2f4
--- /dev/null
+++ b/libstdc++-v3/docs/html/17_intro/porting.texi
@@ -0,0 +1,510 @@
+\input texinfo
+
+@c ---------------------------------------------------------------------
+@c Prologue
+@c ---------------------------------------------------------------------
+
+@setfilename porting.info
+@settitle Porting libstdc++-v3
+@setchapternewpage odd
+
+@ifinfo
+This file explains how to port libstdc++-v3 (the GNU C++ library) to
+a new target.
+
+Copyright (c) 2000, 2001 Free Software Foundation, Inc.
+@end ifinfo
+
+@c ---------------------------------------------------------------------
+@c Titlepage
+@c ---------------------------------------------------------------------
+
+@titlepage
+@title Porting libstdc++-v3
+@author Mark Mitchell
+@page
+@vskip 0pt plus 1filll
+Copyright @copyright{} 2000, 2001 Free Software Foundation, Inc.
+
+Permission is granted to copy, distribute and/or modify this document
+under the terms of the GNU Free Documentation License, Version 1.1 or
+any later version published by the Free Software Foundation; with the
+Invariant Sections being ``GNU General Public License'', the Front-Cover
+texts being (a) (see below), and with the Back-Cover Texts being (b)
+(see below). A copy of the license is included in the section entitled
+``GNU Free Documentation License''.
+
+(a) The FSF's Front-Cover Text is:
+
+ A GNU Manual
+
+(b) The FSF's Back-Cover Text is:
+
+ You have freedom to copy and modify this GNU Manual, like GNU
+ software. Copies published by the Free Software Foundation raise
+ funds for GNU development.
+@end titlepage
+
+@c ---------------------------------------------------------------------
+@c Top
+@c ---------------------------------------------------------------------
+
+@node Top
+@top Porting libstdc++-v3
+
+This document explains how to port libstdc++-v3 (the GNU C++ library) to
+a new target.
+
+In order to make the GNU C++ library (libstdc++-v3) work with a new
+target, you must edit some configuration files and provide some new
+header files.
+
+Before you get started, make sure that you have a working C library on
+your target. The C library need not precisely comply with any
+particular standard, but should generally conform to the requirements
+imposed by the ANSI/ISO standard.
+
+In addition, you should try to verify that the C++ compiler generally
+works. It is difficult to test the C++ compiler without a working
+library, but you should at least try some minimal test cases.
+
+Here are the primary steps required to port the library:
+
+@menu
+* Operating system:: Configuring for your operating system.
+* Character types:: Implementing character classification.
+* Thread safety:: Implementing atomic operations.
+* Numeric limits:: Implementing numeric limits.
+* Libtool:: Using libtool.
+* GNU Free Documentation License:: How you can copy and share this manual.
+@end menu
+
+@c ---------------------------------------------------------------------
+@c Operating system
+@c ---------------------------------------------------------------------
+
+@node Operating system
+@chapter Operating system
+
+If you are porting to a new operating-system (as opposed to a new chip
+using an existing operating system), you will need to create a new
+directory in the @file{config/os} hierarchy. For example, the IRIX
+configuration files are all in @file{config/os/irix}. There is no set
+way to organize the OS configuration directory. For example,
+@file{config/os/solaris/solaris-2.6} and
+@file{config/os/solaris/solaris-2.7} are used as configuration
+directories for these two versions of Solaris. On the other hand, both
+Solaris 2.7 and Solaris 2.8 use the @file{config/os/solaris/solaris-2.7}
+directory. The important information is that there needs to be a
+directory under @file{config/os} to store the files for your operating
+system.
+
+You'll have to change the @file{configure.target} file to ensure that
+your new directory is activated. Look for the switch statement that
+sets @code{os_include_dir}, and add a pattern to handle your operating
+system. The switch statement switches on only the OS portion of the
+standard target triplet; e.g., the @code{solaris2.8} in
+@code{sparc-sun-solaris2.8}.
+
+The first file to create in this directory, should be called
+@file{bits/os_defines.h}. This file contains basic macro definitions
+that are required to allow the C++ library to work with your C library.
+This file should provide macro definitions for @code{__off_t},
+@code{__off64_t}, and @code{__ssize_t}. Typically, this just looks
+like:
+
+@example
+#define __off_t off_t
+#define __off64_t off64_t
+#define __ssize_t ssize_t
+@end example
+
+@noindent
+You don't have to provide these definitions if your system library
+already defines these types -- but the only library known to provide
+these types is the GNU C Library, so you will almost certainly have to
+provide these macros. Note that this file does not have to include a
+header file that defines @code{off_t}, or the other types; you simply
+have to provide the macros.
+
+In addition, several libstdc++-v3 source files unconditionally define
+the macro @code{_POSIX_SOURCE}. On many systems, defining this macro
+causes large portions of the C library header files to be eliminated
+at preprocessing time. Therefore, you may have to @code{#undef} this
+macro, or define other macros (like @code{_LARGEFILE_SOURCE} or
+@code{__EXTENSIONS__}). You won't know what macros to define or
+undefine at this point; you'll have to try compiling the library and
+seeing what goes wrong. If you see errors about calling functions
+that have not been declared, look in your C library headers to see if
+the functions are declared there, and then figure out what macros you
+need to define. You will need to add them to the
+@code{CPLUSPLUS_CPP_SPEC} macro in the GCC configuration file for your
+target. It will not work to simply define these macros in
+@file{os_defines.h}.
+
+At this time, there are two libstdc++-v3-specific macros which may be
+defined. @code{_G_USING_THUNKS} may be defined to 0 to express that the
+port doesn't use thunks (although it is unclear that this is still
+useful since libio support isn't currently working and the g++ v3 ABI
+invalidates the assumption that some ports don't use thunks).
+@code{_GLIBCPP_AVOID_FSEEK} may be defined if seeking on an interactive
+stream (or one hooked to a pipe) is not allowed by the OS. In this
+case, getc()/ungetc() will be used at some key locations in the library
+implementation instead of fseek(). Currently, the code path to avoid
+fseek() is only enabled when the seek size is 1 character away from the
+current stream position. This is known to improve *-unknown-freebsd*,
+sparc-sun-solaris2.* and *-*-mingw32*.
+
+Finally, you should bracket the entire file in an include-guard, like
+this:
+
+@example
+#ifndef _GLIBCPP_OS_DEFINES
+#define _GLIBCPP_OS_DEFINES
+...
+#endif
+@end example
+
+We recommend copying an existing @file{bits/os_defines.h} to use as a
+starting point.
+
+@c ---------------------------------------------------------------------
+@c Character types
+@c ---------------------------------------------------------------------
+
+@node Character types
+@chapter Character types
+
+The library requires that you provide three header files to implement
+character classification, analogous to that provided by the C libraries
+@file{<ctype.h>} header. You can model these on the files provided in
+@file{config/os/generic/bits}. However, these files will almost
+certainly need some modification.
+
+The first file to write is @file{bits/ctype_base.h}. This file provides
+some very basic information about character classification. The libstdc++-v3
+library assumes that your C library implements @file{<ctype.h>} by using
+a table (indexed by character code) containing integers, where each of
+these integers is a bit-mask indicating whether the character is
+upper-case, lower-case, alphabetic, etc. The @file{bits/ctype_base.h}
+file gives the type of the integer, and the values of the various bit
+masks. You will have to peer at your own @file{<ctype.h>} to figure out
+how to define the values required by this file.
+
+The @file{bits/ctype_base.h} header file does not need include guards.
+It should contain a single @code{struct} definition called
+@code{ctype_base}. This @code{struct} should contain two type
+declarations, and one enumeration declaration, like this example, taken
+from the IRIX configuration:
+
+@example
+struct ctype_base
+@{
+ typedef unsigned int mask;
+ typedef int* __to_type;
+
+ enum
+ @{
+ space = _ISspace,
+ print = _ISprint,
+ cntrl = _IScntrl,
+ upper = _ISupper,
+ lower = _ISlower,
+ alpha = _ISalpha,
+ digit = _ISdigit,
+ punct = _ISpunct,
+ xdigit = _ISxdigit,
+ alnum = _ISalnum,
+ graph = _ISgraph
+ @};
+@};
+@end example
+
+@noindent
+The @code{mask} type is the type of the elements in the table. If your
+C library uses a table to map lower-case numbers to upper-case numbers,
+and vice versa, you should define @code{__to_type} to be the type of the
+elements in that table. If you don't mind taking a minor performance
+penalty, or if your library doesn't implement @code{toupper} and
+@code{tolower} in this way, you can pick any pointer-to-integer type,
+but you must still define the type.
+
+The enumeration should give definitions for all the values in the above
+example, using the values from your native @file{<ctype.h>}. They can
+be given symbolically (as above), or numerically, if you prefer. You do
+not have to include @file{<ctype.h>} in this header; it will always be
+included before @file{bits/ctype_base.h} is included.
+
+The next file to write is @file{bits/ctype_noninline.h}, which also does
+not require include guards. This file defines a few member functions
+that will be included in @file{include/bits/locale_facets.h}. The first
+function that must be written is the @code{ctype<char>::ctype}
+constructor. Here is the IRIX example:
+
+@example
+ctype<char>::ctype(const mask* __table = 0, bool __del = false,
+ size_t __refs = 0)
+ : _Ctype_nois<char>(__refs), _M_del(__table != 0 && __del),
+ _M_toupper(NULL),
+ _M_tolower(NULL),
+ _M_ctable(NULL),
+ _M_table(!__table
+ ? (const mask*) (__libc_attr._ctype_tbl->_class + 1)
+ : __table)
+ @{ @}
+@end example
+
+@noindent
+There are two parts of this that you might choose to alter. The first,
+and most important, is the line involving @code{__libc_attr}. That is
+IRIX system-dependent code that gets the base of the table mapping
+character codes to attributes. You need to substitute code that obtains
+the address of this table on your system. If you want to use your
+operating system's tables to map upper-case letters to lower-case, and
+vice versa, you should initialize @code{_M_toupper} and
+@code{_M_tolower} with those tables, in similar fashion.
+
+Now, you have to write two functions to convert from upper-case to
+lower-case, and vice versa. Here are the IRIX versions:
+
+@example
+char
+ctype<char>::do_toupper(char __c) const
+@{ return _toupper(__c); @}
+
+char
+ctype<char>::do_tolower(char __c) const
+@{ return _tolower(__c); @}
+@end example
+
+@noindent
+Your C library provides equivalents to IRIX's @code{_toupper} and
+@code{_tolower}. If you initialized @code{_M_toupper} and
+@code{_M_tolower} above, then you could use those tables instead.
+
+Finally, you have to provide two utility functions that convert strings
+of characters. The versions provided here will always work -- but you
+could use specialized routines for greater performance if you have
+machinery to do that on your system:
+
+@example
+const char*
+ctype<char>::do_toupper(char* __low, const char* __high) const
+@{
+ while (__low < __high)
+ @{
+ *__low = do_toupper(*__low);
+ ++__low;
+ @}
+ return __high;
+@}
+
+const char*
+ctype<char>::do_tolower(char* __low, const char* __high) const
+@{
+ while (__low < __high)
+ @{
+ *__low = do_tolower(*__low);
+ ++__low;
+ @}
+ return __high;
+@}
+@end example
+
+You must also provide the @file{bits/ctype_inline.h} file, which
+contains a few more functions. On most systems, you can just copy
+@file{config/os/generic/ctype_inline.h} and use it on your system.
+
+In detail, the functions provided test characters for particular
+properties; they are analogous to the functions like @code{isalpha} and
+@code{islower} provided by the C library.
+
+The first function is implemented like this on IRIX:
+
+@example
+bool
+ctype<char>::
+is(mask __m, char __c) const throw()
+@{ return (_M_table)[(unsigned char)(__c)] & __m; @}
+@end example
+
+@noindent
+The @code{_M_table} is the table passed in above, in the constructor.
+This is the table that contains the bitmasks for each character. The
+implementation here should work on all systems.
+
+The next function is:
+
+@example
+const char*
+ctype<char>::
+is(const char* __low, const char* __high, mask* __vec) const throw()
+@{
+ while (__low < __high)
+ *__vec++ = (_M_table)[(unsigned char)(*__low++)];
+ return __high;
+@}
+@end example
+
+@noindent
+This function is similar; it copies the masks for all the characters
+from @code{__low} up until @code{__high} into the vector given by
+@code{__vec}.
+
+The last two functions again are entirely generic:
+
+@example
+const char*
+ctype<char>::
+scan_is(mask __m, const char* __low, const char* __high) const throw()
+@{
+ while (__low < __high && !this->is(__m, *__low))
+ ++__low;
+ return __low;
+@}
+
+const char*
+ctype<char>::
+scan_not(mask __m, const char* __low, const char* __high) const throw()
+@{
+ while (__low < __high && this->is(__m, *__low))
+ ++__low;
+ return __low;
+@}
+@end example
+
+@c ---------------------------------------------------------------------
+@c Thread safety
+@c ---------------------------------------------------------------------
+
+@node Thread safety
+@chapter Thread safety
+
+The C++ library string functionality requires a couple of atomic
+operations to provide thread-safety. If you don't take any special
+action, the library will use stub versions of these functions that are
+not thread-safe. They will work fine, unless your applications are
+multi-threaded.
+
+If you want to provide custom, safe, versions of these functions, there
+are two distinct approaches. One is to provide a version for your CPU,
+using assembly language constructs. The other is to use the
+thread-safety primitives in your operating system. In either case, you
+make a file called @file{bits/atomicity.h}.
+
+If you are using the assembly-language approach, put this code in
+@file{config/cpu/<chip>/bits/atomicity.h}, where chip is the name of
+your processor. In that case, edit the switch statement in
+@file{configure.target} to set the @code{cpu_include_dir}. In either
+case, set the switch statement that sets @code{ATOMICITYH} to be the
+directory containing @file{bits/atomicity.h}.
+
+With those bits out of the way, you have to actually write
+@file{bits/atomicity.h} itself. This file should be wrapped in an
+include guard named @code{_BITS_ATOMICITY_H}. It should define one
+type, and two functions.
+
+The type is @code{_Atomic_word}. Here is the version used on IRIX:
+
+@example
+typedef long _Atomic_word;
+@end example
+
+@noindent
+This type must be a signed integral type supporting atomic operations.
+If you're using the OS approach, use the same type used by your system's
+primitives. Otherwise, use the type for which your CPU provides atomic
+primitives.
+
+Then, you must provide two functions. The bodies of these functions
+must be equivalent to those provided here, but using atomic operations:
+
+@example
+static inline _Atomic_word
+__attribute__ ((__unused__))
+__exchange_and_add (_Atomic_word* __mem, int __val)
+@{
+ _Atomic_word __result = *__mem;
+ *__mem += __val;
+ return __result;
+@}
+
+static inline void
+__attribute__ ((__unused__))
+__atomic_add (_Atomic_word* __mem, int __val)
+@{
+ *__mem += __val;
+@}
+@end example
+
+@c ---------------------------------------------------------------------
+@c Numeric limits
+@c ---------------------------------------------------------------------
+
+@node Numeric limits
+@chapter Numeric limits
+
+The C++ library requires information about the fundamental data types,
+such as the minimum and maximum representable values of each type.
+You can define each of these values individually, but it is usually
+easiest just to indicate how many bits are used in each of the data
+types and let the library do the rest. For information about the
+macros to define, see the top of @file{include/bits/std_limits.h}.
+
+If you need to define any macros, you can do so in
+@file{os_defines.h}. However, if all operating systems for your CPU
+are likely to use the same values, you can provide a CPU-specific file
+instead so that you do not have to provide the same definitions for
+each operating system. To take that approach, create a new file
+called @file{limits.h} in your CPU configuration directory (e.g.,
+@file{config/cpu/i386/bits}) and then modify @file{configure.target}
+so that @code{LIMITSH} is set to the CPU directory (e.g.,
+@file{config/cpu/i386}). Note that @code{LIMITSH} should not include
+the @samp{bits} part of the directory name.
+
+@c ---------------------------------------------------------------------
+@c Libtool
+@c ---------------------------------------------------------------------
+
+@node Libtool
+@chapter Libtool
+
+The C++ library is compiled, archived and linked with libtool.
+Explaining the full workings of libtool is beyond the scope of this
+document, but there are a few, particular bits that are necessary for
+porting.
+
+Some parts of the libstdc++-v3 library are compiled with the libtool
+@code{--tags CXX} option (the C++ definitions for libtool). Therefore,
+@file{ltcf-cxx.sh} in the top-level directory needs to have the correct
+logic to compile and archive objects equivalent to the C version of libtool,
+@file{ltcf-c.sh}. Some libtool targets have definitions for C but not
+for C++, or C++ definitions which have not been kept up to date.
+
+The C++ run-time library contains initialization code that needs to be
+run as the library is loaded. Often, that requires linking in special
+object files when the C++ library is built as a shared library, or
+taking other system-specific actions.
+
+The libstdc++-v3 library is linked with the C version of libtool, even though it
+is a C++ library. Therefore, the C version of libtool needs to ensure
+that the run-time library initializers are run. The usual way to do
+this is to build the library using @code{gcc -shared}.
+
+If you need to change how the library is linked, look at
+@file{ltcf-c.sh} in the top-level directory. Find the switch statement
+that sets @code{archive_cmds}. Here, adjust the setting for your
+operating system.
+
+@c ---------------------------------------------------------------------
+@c GFDL
+@c ---------------------------------------------------------------------
+
+@include fdl.texi
+
+@c ---------------------------------------------------------------------
+@c Epilogue
+@c ---------------------------------------------------------------------
+
+@contents
+@bye
diff --git a/libstdc++-v3/docs/html/18_support/howto.html b/libstdc++-v3/docs/html/18_support/howto.html
index 8dbc96c38d7..13adbfd56fc 100644
--- a/libstdc++-v3/docs/html/18_support/howto.html
+++ b/libstdc++-v3/docs/html/18_support/howto.html
@@ -1,66 +1,65 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-<HEAD>
- <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
- <META NAME="AUTHOR" CONTENT="pme@sources.redhat.com (Phil Edwards)">
- <META NAME="KEYWORDS" CONTENT="HOWTO, libstdc++, GCC, g++, libg++, STL">
- <META NAME="DESCRIPTION" CONTENT="HOWTO for the libstdc++ chapter 18.">
- <META NAME="GENERATOR" CONTENT="vi and eight fingers">
- <TITLE>libstdc++-v3 HOWTO: Chapter 18</TITLE>
-<LINK REL=StyleSheet HREF="../lib3styles.css">
-<!-- $Id: howto.html,v 1.7 2000/12/03 23:47:47 jsm28 Exp $ -->
-</HEAD>
-<BODY>
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="AUTHOR" content="pme@gcc.gnu.org (Phil Edwards)">
+ <meta name="KEYWORDS" content="HOWTO, libstdc++, GCC, g++, libg++, STL">
+ <meta name="DESCRIPTION" content="HOWTO for the libstdc++ chapter 18.">
+ <meta name="GENERATOR" content="vi and eight fingers">
+ <title>libstdc++-v3 HOWTO: Chapter 18</title>
+<link rel="StyleSheet" href="../lib3styles.css">
+</head>
+<body>
-<H1 CLASS="centered"><A NAME="top">Chapter 18: Library Support</A></H1>
+<h1 class="centered"><a name="top">Chapter 18: Library Support</a></h1>
-<P>Chapter 18 deals with the functions called and objects created
+<p>Chapter 18 deals with the functions called and objects created
automatically during the course of a program's existence.
-</P>
-<P>While we can't reproduce the contents of the Standard here (you need to
+</p>
+<p>While we can't reproduce the contents of the Standard here (you need to
get your own copy from your nation's member body; see our homepage for
help), we can mention a couple of changes in what kind of support a C++
program gets from the Standard Library.
-</P>
+</p>
<!-- ####################################################### -->
-<HR>
-<H1>Contents</H1>
-<UL>
- <LI><A HREF="#1">Types</A>
- <LI><A HREF="#2">Implementation properties</A>
- <LI><A HREF="#3">Start and Termination</A>
- <LI><A HREF="#4">Dynamic memory management</A>
-</UL>
+<hr>
+<h1>Contents</h1>
+<ul>
+ <li><a href="#1">Types</a>
+ <li><a href="#2">Implementation properties</a>
+ <li><a href="#3">Start and Termination</a>
+ <li><a href="#4">Dynamic memory management</a>
+</ul>
-<HR>
+<hr>
<!-- ####################################################### -->
-<H2><A NAME="1">Types</A></H2>
- <P>All the types that you're used to in C are here in one form or
+<h2><a name="1">Types</a></h2>
+ <p>All the types that you're used to in C are here in one form or
another. The only change that might affect people is the type of
NULL: while it is required to be a macro, the definition of that
- macro is <EM>not</EM> allowed to be <TT>(void*)0</TT>, which is
+ macro is <em>not</em> allowed to be <code>(void*)0</code>, which is
often used in C.
- </P>
- <P>In g++, NULL is #define'd to be <TT>__null</TT>, a magic keyword
+ </p>
+ <p>In g++, NULL is #define'd to be <code>__null</code>, a magic keyword
extension of g++.
- </P>
- <P>The biggest problem of #defining NULL to be something like
+ </p>
+ <p>The biggest problem of #defining NULL to be something like
&quot;0L&quot; is that the compiler will view that as a long integer
before it views it as a pointer, so overloading won't do what you
expect. (This is why g++ has a magic extension, so that NULL is
always a pointer.)
- </P>
- <P>In his book
- <A HREF="http://cseng.aw.com/bookdetail.qry?ISBN=0-201-92488-9&ptype=0"><EM>Effective C++</EM></A>,
+ </p>
+ <p>In his book
+ <a href="http://cseng.aw.com/bookdetail.qry?ISBN=0-201-92488-9&ptype=0"><em>Effective C++</em></a>,
Scott Meyers points out that the best way to solve this problem is to
not overload on pointer-vs-integer types to begin with. He also
offers a way to make your own magic NULL that will match pointers
before it matches integers:
- <PRE>
+ <pre>
const // this is a const object...
class {
public:
@@ -77,42 +76,43 @@
// taken (see Item 27)...
} NULL; // and whose name is NULL
- </PRE>(Cribbed from the published version of
- <A HREF="http://www.awlonline.com/cseng/meyerscddemo/">the
- Effective C++ CD</A>, reproduced here with permission.)
- </P>
- <P>If you aren't using g++ (why?), but you do have a compiler which
+ </pre>(Cribbed from the published version of
+ <a href="http://www.awlonline.com/cseng/meyerscddemo/">the
+ Effective C++ CD</a>, reproduced here with permission.)
+ </p>
+ <p>If you aren't using g++ (why?), but you do have a compiler which
supports member function templates, then you can use this definition
of NULL (be sure to #undef any existing versions). It only helps if
you actually use NULL in function calls, though; if you make a call of
- <TT>foo(0);</TT> instead of <TT>foo(NULL);</TT>, then you're back
+ <code>foo(0);</code> instead of <code>foo(NULL);</code>, then you're back
where you started.
- </P>
- <P><B>Added Note:</B> When we contacted Dr. Meyers to ask permission to
+ </p>
+ <p><strong>Added Note:</strong> When we contacted Dr. Meyers to ask
+ permission to
print this stuff, it prompted him to run this code through current
compilers to see what the state of the art is with respect to member
template functions. He posted
- <A HREF="http://www.deja.com/threadmsg_md.xp?AN=644660779.1&CONTEXT=964036823.871301239">an
- article to Usenet</A> after discovering that the code above is not
+ <a href="http://www.deja.com/threadmsg_md.xp?AN=644660779.1&CONTEXT=964036823.871301239">an
+ article to Usenet</a> after discovering that the code above is not
valid! Even though it has no data members, it still needs a
user-defined constructor (which means that the class needs a type name
after all). The ctor can have an empty body; it just needs to be
there. (Stupid requirement? We think so too, and this will probably
be changed in the language itself.)
- </P>
- <P>Return <A HREF="#top">to top of page</A> or
- <A HREF="../faq/index.html">to the FAQ</A>.
- </P>
+ </p>
+ <p>Return <a href="#top">to top of page</a> or
+ <a href="../faq/index.html">to the FAQ</a>.
+ </p>
-<HR>
-<H2><A NAME="2">Implementation properties</A></H2>
- <P>
- <H3><CODE>&lt;limits&gt;</CODE></H3>
+<hr>
+<h2><a name="2">Implementation properties</a></h2>
+ <p>
+ <h3><code>&lt;limits&gt;</code></h3>
This header mainly defines traits classes to give access to various
implementation defined-aspects of the fundamental types. The
traits classes -- fourteen in total -- are all specilizations of the
- template class <CODE>numeric_limits</CODE> defined as follows:
- <PRE>
+ template class <code>numeric_limits</code> defined as follows:
+ <pre>
template&lt;typename T&gt; struct class {
static const bool is_specialized;
static T max() throw();
@@ -148,31 +148,31 @@
static const bool traps;
static const bool tinyness_before;
static const float_round_style round_style;
- };</PRE>
- </P>
- <P>Return <A HREF="#top">to top of page</A> or
- <A HREF="../faq/index.html">to the FAQ</A>.
- </P>
+ };</pre>
+ </p>
+ <p>Return <a href="#top">to top of page</a> or
+ <a href="../faq/index.html">to the FAQ</a>.
+ </p>
-<HR>
-<H2><A NAME="3">Start and Termination</A></H2>
- <P>Not many changes here to <TT>&lt;cstdlib&gt;</TT> (the old stdlib.h).
- You should note that the <TT>abort()</TT> function does not call
+<hr>
+<h2><a name="3">Start and Termination</a></h2>
+ <p>Not many changes here to <code>&lt;cstdlib&gt;</code> (the old stdlib.h).
+ You should note that the <code>abort()</code> function does not call
the destructors of automatic nor static objects, so if you're depending
on those to do cleanup, it isn't going to happen. (The functions
- registered with <TT>atexit()</TT> don't get called either, so you
+ registered with <code>atexit()</code> don't get called either, so you
can forget about that possibility, too.)
- </P>
- <P>The good old <TT>exit()</TT> function can be a bit funky, too, until
+ </p>
+ <p>The good old <code>exit()</code> function can be a bit funky, too, until
you look closer. Basically, three points to remember are:
- <OL>
- <LI>Static objects are destroyed in reverse order of their creation.
- <LI>Functions registered with <TT>atexit()</TT> are called in
+ <ol>
+ <li>Static objects are destroyed in reverse order of their creation.
+ <li>Functions registered with <code>atexit()</code> are called in
reverse order of registration, once per registration call.
(This isn't actually new.)
- <LI>The previous two actions are &quot;interleaved,&quot; that is,
- given this code:
- <PRE>
+ <li>The previous two actions are &quot;interleaved,&quot; that is,
+ given this pseudocode:
+ <pre>
extern "C or C++" void f1 (void);
extern "C or C++" void f2 (void);
@@ -180,46 +180,51 @@
atexit(f1);
static Thing obj2;
atexit(f2);
- </PRE>then at a call of <TT>exit()</TT>, f2 will be called, then
+ </pre>then at a call of <code>exit()</code>, f2 will be called, then
obj2 will be destroyed, then f1 will be called, and finally obj1
- will be destroyed. If f1 or f2 allow an exception to propogate
+ will be destroyed. If f1 or f2 allow an exception to propagate
out of them, Bad Things happen.
- </OL>
- </P>
- <P>Return <A HREF="#top">to top of page</A> or
- <A HREF="../faq/index.html">to the FAQ</A>.
- </P>
+ </ol>
+ </p>
+ <p>Note also that <code>atexit()</code> is only required to store 32
+ functions, and the compiler/library might already be using some of
+ those slots. If you think you may run out, we recommend using
+ the xatexit/xexit combination from libiberty, which has no such limit.
+ </p>
+ <p>Return <a href="#top">to top of page</a> or
+ <a href="../faq/index.html">to the FAQ</a>.
+ </p>
-<HR>
-<H2><A NAME="4">Dynamic memory management</A></H2>
- <P>There are six flavors each of <TT>new</TT> and <TT>delete</TT>, so
+<hr>
+<h2><a name="4">Dynamic memory management</a></h2>
+ <p>There are six flavors each of <code>new</code> and <code>delete</code>, so
make certain that you're using the right ones! Here are quickie
- descriptions of <TT>new</TT>:
- <UL>
- <LI>single object form, throwing a <TT>bad_alloc</TT> on errors;
+ descriptions of <code>new</code>:
+ <ul>
+ <li>single object form, throwing a <code>bad_alloc</code> on errors;
this is what most people are used to using
- <LI>single object &quot;nothrow&quot; form, returning NULL on errors
- <LI>array new, throwing <TT>bad_alloc</TT> on errors
- <LI>array nothrow new, returning NULL on errors
- <LI>placement new, which does nothing (like it's supposed to)
- <LI>placement array new, which also does nothing
- </UL>
+ <li>single object &quot;nothrow&quot; form, returning NULL on errors
+ <li>array new, throwing <code>bad_alloc</code> on errors
+ <li>array nothrow new, returning NULL on errors
+ <li>placement new, which does nothing (like it's supposed to)
+ <li>placement array new, which also does nothing
+ </ul>
They are distinguished by the parameters that you pass to them, like
- any other overloaded function. The six flavors of <TT>delete</TT>
+ any other overloaded function. The six flavors of <code>delete</code>
are distinguished the same way, but none of them are allowed to throw
an exception under any circumstances anyhow. (They match up for
completeness' sake.)
- </P>
- <P>Remember that it is perfectly okay to call <TT>delete</TT> on a
+ </p>
+ <p>Remember that it is perfectly okay to call <code>delete</code> on a
NULL pointer! Nothing happens, by definition. That is not the
same thing as deleting a pointer twice.
- </P>
- <P>By default, if one of the &quot;throwing <TT>new</TT>s&quot; can't
+ </p>
+ <p>By default, if one of the &quot;throwing <code>new</code>s&quot; can't
allocate the memory requested, it tosses an instance of a
- <TT>bad_alloc</TT> exception (or, technically, some class derived
- from it). You can change this by writing your own function (called
- a new-handler) and then registering it with <TT>set_new_handler()</TT>:
- <PRE>
+ <code>bad_alloc</code> exception (or, technically, some class derived
+ from it). You can change this by writing your own function (called a
+ new-handler) and then registering it with <code>set_new_handler()</code>:
+ <pre>
typedef void (*PFV)(void);
static char* safety;
@@ -238,32 +243,29 @@
int main ()
{
safety = new char[500000];
- old_handler = set_new_handler (&my_new_handler);
+ old_handler = set_new_handler (&amp;my_new_handler);
...
}
- </PRE>
- </P>
- <P><TT>bad_alloc</TT> is derived from the base <TT>exception</TT>
+ </pre>
+ </p>
+ <p><code>bad_alloc</code> is derived from the base <code>exception</code>
class defined in Chapter 19.
- </P>
- <P>Return <A HREF="#top">to top of page</A> or
- <A HREF="../faq/index.html">to the FAQ</A>.
- </P>
-
-
+ </p>
+ <p>Return <a href="#top">to top of page</a> or
+ <a href="../faq/index.html">to the FAQ</a>.
+ </p>
<!-- ####################################################### -->
-<HR>
-<P CLASS="fineprint"><EM>
+<hr>
+<p class="fineprint"><em>
+See <a href="../17_intro/license.html">license.html</a> for copying conditions.
Comments and suggestions are welcome, and may be sent to
-<A HREF="mailto:pme@sources.redhat.com">Phil Edwards</A> or
-<A HREF="mailto:gdr@gcc.gnu.org">Gabriel Dos Reis</A>.
-<BR> $Id: howto.html,v 1.7 2000/12/03 23:47:47 jsm28 Exp $
-</EM></P>
+<a href="mailto:libstdc++@gcc.gnu.org">the libstdc++ mailing list</a>.
+</em></p>
-</BODY>
-</HTML>
+</body>
+</html>
diff --git a/libstdc++-v3/docs/html/19_diagnostics/howto.html b/libstdc++-v3/docs/html/19_diagnostics/howto.html
index 7bfbcdf9bb4..e85d57d3d34 100644
--- a/libstdc++-v3/docs/html/19_diagnostics/howto.html
+++ b/libstdc++-v3/docs/html/19_diagnostics/howto.html
@@ -1,107 +1,180 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-<HEAD>
- <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
- <META NAME="AUTHOR" CONTENT="pme@sources.redhat.com (Phil Edwards)">
- <META NAME="KEYWORDS" CONTENT="HOWTO, libstdc++, GCC, g++, libg++, STL">
- <META NAME="DESCRIPTION" CONTENT="HOWTO for the libstdc++ chapter 19.">
- <META NAME="GENERATOR" CONTENT="vi and eight fingers">
- <TITLE>libstdc++-v3 HOWTO: Chapter 19</TITLE>
-<LINK REL=StyleSheet HREF="../lib3styles.css">
-<!-- $Id: howto.html,v 1.5 2000/12/03 23:47:47 jsm28 Exp $ -->
-</HEAD>
-<BODY>
-
-<H1 CLASS="centered"><A NAME="top">Chapter 19: Diagnostics</A></H1>
-
-<P>Chapter 19 deals with program diagnostics, such as exceptions
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="AUTHOR" content="pme@gcc.gnu.org (Phil Edwards)">
+ <meta name="KEYWORDS" content="HOWTO, libstdc++, GCC, g++, libg++, STL">
+ <meta name="DESCRIPTION" content="HOWTO for the libstdc++ chapter 19.">
+ <meta name="GENERATOR" content="vi and eight fingers">
+ <title>libstdc++-v3 HOWTO: Chapter 19</title>
+<link rel="StyleSheet" href="../lib3styles.css">
+</head>
+<body>
+
+<h1 class="centered"><a name="top">Chapter 19: Diagnostics</a></h1>
+
+<p>Chapter 19 deals with program diagnostics, such as exceptions
and assertions. You know, all the things we wish weren't even
necessary at all.
-</P>
+</p>
<!-- ####################################################### -->
-<HR>
-<H1>Contents</H1>
-<UL>
- <LI><A HREF="#1">Adding data to exceptions</A>
- <LI><A HREF="#2">Exception class hierarchy diagram</A>
- <LI><A HREF="#3">Concept checkers</A>
-</UL>
+<hr>
+<h1>Contents</h1>
+<ul>
+ <li><a href="#1">Adding data to exceptions</a>
+ <li><a href="#2">Exception class hierarchy diagram</a>
+ <li><a href="#3">Concept checkers -- <strong>new and improved!</strong></a>
+ <li><a href="#4">Verbose <code>terminate</code></a>
+</ul>
-<HR>
+<hr>
<!-- ####################################################### -->
-<H2><A NAME="1">Adding data to exceptions</A></H2>
- <P>The standard exception classes carry with them a single string as
+<h2><a name="1">Adding data to exceptions</a></h2>
+ <p>The standard exception classes carry with them a single string as
data (usually describing what went wrong or where the 'throw' took
place). It's good to remember that you can add your own data to
- these exceptions when extending the heirarchy:
- </P>
- <PRE>
- using std::runtime_error;
- struct My_Exception : public runtime_error
+ these exceptions when extending the hierarchy:
+ </p>
+ <pre>
+ struct My_Exception : public std::runtime_error
{
public:
- My_Exception (const string& whatarg)
- : runtime_error(whatarg), e(errno), id(GetDataBaseID()) { }
+ My_Exception (const string&amp; whatarg)
+ : std::runtime_error(whatarg), e(errno), id(GetDataBaseID()) { }
int errno_at_time_of_throw() const { return e; }
DBID id_of_thing_that_threw() const { return id; }
protected:
int e;
DBID id; // some user-defined type
};
- </PRE>
- <P>Return <A HREF="#top">to top of page</A> or
- <A HREF="../faq/index.html">to the FAQ</A>.
- </P>
-
-<HR>
-<H2><A NAME="2">Exception class hierarchy diagram</A></H2>
- <P>The <A HREF="exceptions_hiearchy.pdf">diagram</A> is in PDF, or
- at least it will be once it gets finished.
- </P>
- <P>Return <A HREF="#top">to top of page</A> or
- <A HREF="../faq/index.html">to the FAQ</A>.
- </P>
-
-<HR>
-<H2><A NAME="3">Concept checkers</A></H2>
- <P>As part of their 3.3 release, SGI added some nifty macros which
- perform assertions on type properties. For example, the Standard
- requires that types passed as template parameters to <TT>vector</TT>
- be &quot;Assignable&quot; (which means what you think it means).
- </P>
- <P>The concept checkers allow the source code for <TT>vector</TT> to
- declare
- <PRE>
- __STL_CLASS_REQUIRES(_Tp, _Assignable);
- </PRE>inside the template. <TT>_Tp</TT> is the element type of the
- vector, and <TT>_Assignable</TT> is the concept to be checked (it is
- defined in some back-end header files). When you instantiate
- <TT>vector&lt;MyType&gt;</TT>, compile-time checking can be done on
- whether MyType meets the requirements for vectors.
- </P>
-<P>This is an extension to the library. This documentation needs updating.</P>
- <P>Return <A HREF="#top">to top of page</A> or
- <A HREF="../faq/index.html">to the FAQ</A>.
- </P>
-
-
+ </pre>
+ <p>Return <a href="#top">to top of page</a> or
+ <a href="../faq/index.html">to the FAQ</a>.
+ </p>
+
+<hr>
+<h2><a name="2">Exception class hierarchy diagram</a></h2>
+ <p>At one point we were going to make up a PDF of the exceptions
+ hierarchy, akin to the one done for the I/O class hierarchy.
+ Time was our enemy. Since then we've moved to Doxygen, which has
+ the useful property of not sucking. Specifically, when the source
+ code is changed, the diagrams are automatically brought up to date.
+ For the old way, we had to update the diagrams separately.
+ </p>
+ <p>There are several links to the Doxygen-generated pages from
+ <a href="../documentation.html">here</a>.
+ </p>
+ <p>Return <a href="#top">to top of page</a> or
+ <a href="../faq/index.html">to the FAQ</a>.
+ </p>
+
+<hr>
+<h2><a name="3">Concept checkers -- <strong>new and improved!</strong></a></h2>
+ <p>Better taste! Less fat! Literally!</p>
+ <p>In 1999, SGI added <em>concept checkers</em> to their implementation
+ of the STL: code which checked the template parameters of
+ instantiated pieces of the STL, in order to insure that the parameters
+ being used met the requirements of the standard. For example,
+ the Standard requires that types passed as template parameters to
+ <code>vector</code> be &quot;Assignable&quot; (which means what you think
+ it means). The checking was done during compilation, and none of
+ the code was executed at runtime.
+ </p>
+ <p>Unfortunately, the size of the compiler files grew significantly
+ as a result. The checking code itself was cumbersome. And bugs
+ were found in it on more than one occasion.
+ </p>
+ <p>The primary author of the checking code, Jeremy Siek, had already
+ started work on a replcement implementation. The new code has been
+ formally reviewed and accepted into
+ <a href="http://www.boost.org/libs/concept_check/concept_check.htm">the
+ Boost libraries</a>, and we are pleased to incorporate it into the
+ GNU C++ library.
+ </p>
+ <p>The new version imposes a much smaller space overhead on the generated
+ object file. The checks are also cleaner and easier to read and
+ understand.
+ </p>
+ <p>Right now they are off by default. More will be added once
+ GCC 3.0 is released and we have time to revisit this topic.
+ </p>
+ <p>Return <a href="#top">to top of page</a> or
+ <a href="../faq/index.html">to the FAQ</a>.
+ </p>
+
+<hr>
+<h2><a name="4">Verbose <code>terminate</code></a></h2>
+ <p>If you are having difficulty with uncaught exceptions and want a
+ little bit of help debugging the causes of the core dumps, you can
+ make use of a GNU extension in GCC 3.1 and later:
+ <pre>
+ #include &lt;exception&gt;
+
+ int main()
+ {
+ std::set_terminate (__gnu_cxx::verbose_terminate_handler);
+ ...
+ throw <em>anything</em>;
+ }</pre>
+ </p>
+ <p>The <code> verbose_terminate_handler </code> function obtains the name
+ of the current exception, attempts to demangle it, and prints it to
+ stderr. If the exception is derived from <code> std::exception </code>
+ then the output from <code>what()</code> will be included.
+ </p>
+ <p>Any replacement termination function is required to kill the program
+ without returning; this one calls abort.
+ </p>
+ <p>For example:
+ <pre>
+ #include &lt;exception&gt;
+ #include &lt;stdexcept&gt;
+
+ struct BLARGH : std::runtime_error
+ {
+ BLARGH (const string&amp; whatarg)
+ : std::runtime_error(whatarg) { }
+ };
+ int main (int argc)
+ {
+ std::set_terminate (__gnu_cxx::verbose_terminate_handler);
+ if (argc &gt; 5)
+ throw BLARGH(&quot;argc is greater than 5!&quot;);
+ else
+ throw argc;
+ }</pre>
+ </p>
+ <p>In GCC 3.1 and later, this gives
+ <pre>
+ % ./a.out
+ terminate called after throwing a `int'
+ Aborted
+ % ./a.out f f f f f f f f f f f
+ terminate called after throwing a `BLARGH'
+ what(): argc is greater than 5!
+ Aborted
+ %</pre>
+ The 'Aborted' line comes from the call to abort(), of course.
+ </p>
+ <p>Return <a href="#top">to top of page</a> or
+ <a href="../faq/index.html">to the FAQ</a>.
+ </p>
<!-- ####################################################### -->
-<HR>
-<P CLASS="fineprint"><EM>
+<hr>
+<p class="fineprint"><em>
+See <a href="../17_intro/license.html">license.html</a> for copying conditions.
Comments and suggestions are welcome, and may be sent to
-<A HREF="mailto:pme@sources.redhat.com">Phil Edwards</A> or
-<A HREF="mailto:gdr@gcc.gnu.org">Gabriel Dos Reis</A>.
-<BR> $Id: howto.html,v 1.5 2000/12/03 23:47:47 jsm28 Exp $
-</EM></P>
+<a href="mailto:libstdc++@gcc.gnu.org">the libstdc++ mailing list</a>.
+</em></p>
-</BODY>
-</HTML>
+</body>
+</html>
diff --git a/libstdc++-v3/docs/html/20_util/howto.html b/libstdc++-v3/docs/html/20_util/howto.html
index e642ea79f62..d90b5d6654a 100644
--- a/libstdc++-v3/docs/html/20_util/howto.html
+++ b/libstdc++-v3/docs/html/20_util/howto.html
@@ -1,54 +1,53 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-<HEAD>
- <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
- <META NAME="AUTHOR" CONTENT="pme@sources.redhat.com (Phil Edwards)">
- <META NAME="KEYWORDS" CONTENT="HOWTO, libstdc++, GCC, g++, libg++, STL">
- <META NAME="DESCRIPTION" CONTENT="HOWTO for the libstdc++ chapter 20.">
- <META NAME="GENERATOR" CONTENT="vi and eight fingers">
- <TITLE>libstdc++-v3 HOWTO: Chapter 20</TITLE>
-<LINK REL=StyleSheet HREF="../lib3styles.css">
-<!-- $Id: howto.html,v 1.1 2000/12/10 04:04:54 pme Exp $ -->
-</HEAD>
-<BODY>
-
-<H1 CLASS="centered"><A NAME="top">Chapter 20: General Utilities</A></H1>
-
-<P>Chapter 20 deals with utility classes and functions, such as
- the oft-debated <TT>auto_ptr&lt;&gt;</TT>.
-</P>
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="AUTHOR" content="pme@gcc.gnu.org (Phil Edwards)">
+ <meta name="KEYWORDS" content="HOWTO, libstdc++, GCC, g++, libg++, STL">
+ <meta name="DESCRIPTION" content="HOWTO for the libstdc++ chapter 20.">
+ <meta name="GENERATOR" content="vi and eight fingers">
+ <title>libstdc++-v3 HOWTO: Chapter 20</title>
+<link rel="StyleSheet" href="../lib3styles.css">
+</head>
+<body>
+
+<h1 class="centered"><a name="top">Chapter 20: General Utilities</a></h1>
+
+<p>Chapter 20 deals with utility classes and functions, such as
+ the oft-debated <code>auto_ptr&lt;&gt;</code>.
+</p>
<!-- ####################################################### -->
-<HR>
-<H1>Contents</H1>
-<UL>
- <LI><A HREF="#1"><TT>auto_ptr</TT> is not omnipotent</A>
- <LI><A HREF="#2"><TT>auto_ptr</TT> inside container classes</A>
- <LI><A HREF="#3">Functors</A>
- <LI><A HREF="#4">Pairs</A>
-</UL>
+<hr>
+<h1>Contents</h1>
+<ul>
+ <li><a href="#1"><code>auto_ptr</code> is not omnipotent</a>
+ <li><a href="#2"><code>auto_ptr</code> inside container classes</a>
+ <li><a href="#3">Functors</a>
+ <li><a href="#4">Pairs</a>
+</ul>
-<HR>
+<hr>
<!-- ####################################################### -->
-<H2><A NAME="1"><TT>auto_ptr</TT> is not omnipotent</A></H2>
- <P>I'm not going to try and explain all of the fun and delicious
+<h2><a name="1"><code>auto_ptr</code> is not omnipotent</a></h2>
+ <p>I'm not going to try and explain all of the fun and delicious
things that can happen with misuse of the auto_ptr class template
(called AP here), nor am I going to try and teach you how to use
AP safely in the presence of copying. The AP class is a really
nifty idea for a smart pointer, but it is one of the dumbest of
all the smart pointers -- and that's fine.
- </P>
- <P>AP is not meant to be a supersmart solution to all resource
+ </p>
+ <p>AP is not meant to be a supersmart solution to all resource
leaks everywhere. Neither is it meant to be an effective form
of garbage collection (although it can help, a little bit).
- And it can <EM>not</EM> be used for arrays!
- </P>
- <P>AP <EM>is</EM> meant to prevent nasty leaks in the presence of
- exceptions. That's <EM>all</EM>. This code is AP-friendly:
- <PRE>
+ And it can <em>not</em> be used for arrays!
+ </p>
+ <p>AP <em>is</em> meant to prevent nasty leaks in the presence of
+ exceptions. That's <em>all</em>. This code is AP-friendly:
+ <pre>
// not a recommend naming scheme, but good for web-based FAQs
typedef std::auto_ptr&lt;MyClass&gt; APMC;
@@ -63,160 +62,148 @@
function_taking_MyClass_pointer (ap.get());
}
- </PRE>When an exception gets thrown, the instance of MyClass that's
- been created on the heap will be <TT>delete</TT>'d as the stack is
- unwound past <TT>func()</TT>.
- </P>
- <P>Changing that code as follows is <EM>not</EM> AP-friendly:
- <PRE>
+ </pre>When an exception gets thrown, the instance of MyClass that's
+ been created on the heap will be <code>delete</code>'d as the stack is
+ unwound past <code>func()</code>.
+ </p>
+ <p>Changing that code as follows is <em>not</em> AP-friendly:
+ <pre>
APMC ap (new MyClass[22]);
- </PRE>You will get the same problems as you would without the use
+ </pre>You will get the same problems as you would without the use
of AP:
- <PRE>
+ <pre>
char* array = new char[10]; // array new...
...
delete array; // ...but single-object delete
- </PRE>
- </P>
- <P>AP cannot tell whether the pointer you've passed at creation points
+ </pre>
+ </p>
+ <p>AP cannot tell whether the pointer you've passed at creation points
to one or many things. If it points to many things, you are about
to die. AP is trivial to write, however, so you could write your
- own <TT>auto_array_ptr</TT> for that situation (in fact, this has
+ own <code>auto_array_ptr</code> for that situation (in fact, this has
been done many times; check the mailing lists, Usenet, Boost, etc).
- </P>
- <P>Return <A HREF="#top">to top of page</A> or
- <A HREF="../faq/index.html">to the FAQ</A>.
- </P>
-
-<HR>
-<H2><A NAME="2"><TT>auto_ptr</TT> inside container classes</A></H2>
- <P>All of the <A HREF="../23_containers/howto.html">containers</A>
+ </p>
+ <p>Return <a href="#top">to top of page</a> or
+ <a href="../faq/index.html">to the FAQ</a>.
+ </p>
+
+<hr>
+<h2><a name="2"><code>auto_ptr</code> inside container classes</a></h2>
+ <p>All of the <a href="../23_containers/howto.html">containers</a>
described in the standard library require their contained types
- to have, among other things, a copy contructor like this:
- <PRE>
+ to have, among other things, a copy constructor like this:
+ <pre>
struct My_Type
{
- My_Type (My_Type const&amp;);
+ My_Type (My_Type const&amp;);
};
- </PRE>
+ </pre>
Note the const keyword; the object being copied shouldn't change.
- The template class <TT>auto_ptr</TT> (called AP here) does not
+ The template class <code>auto_ptr</code> (called AP here) does not
meet this requirement. Creating a new AP by copying an existing
one transfers ownership of the pointed-to object, which means that
the AP being copied must change, which in turn means that the
copy ctors of AP do not take const objects.
- </P>
- <P>The resulting rule is simple: <EM>Never ever use a container of
- auto_ptr objects.</EM> The standard says that undefined behavior
- is the result, but it is guaranteed to be messy.
- </P>
- <P>To prevent you from doing this to yourself, the
- <A HREF="../19_diagnostics/howto.html#3">concept checks</A> built
+ </p>
+ <p>The resulting rule is simple: <em>Never ever use a container of
+ auto_ptr objects.</em> The standard says that &quot;undefined&quot;
+ behavior is the result, but it is guaranteed to be messy.
+ </p>
+ <p>To prevent you from doing this to yourself, the
+ <a href="../19_diagnostics/howto.html#3">concept checks</a> built
in to this implementation will issue an error if you try to
compile code like this:
- <PRE>
+ <pre>
#include &lt;vector&gt;
#include &lt;memory&gt;
void f()
{
- std::vector&lt; std::auto_ptr&lt;int&gt; &gt; vec_ap_int;
+ std::vector&lt; std::auto_ptr&lt;int&gt; &gt; vec_ap_int;
}
- </PRE>
- Should you try this, you will see an error along the lines of the
- following (look through the ugly line-wrapping):
- <PRE>
-/installdir/include/g++-v3/bits/concept_checks.h: In
- static member function `static _Type
- <B>_STL_ERROR::__const_parameter_required_for_copy_constructor</B>(_Type, const
- _Type&amp;) [with _Type = std::auto_ptr&lt;int&gt;]':
-/installdir/include/g++-v3/bits/concept_checks.h:383: passing
- `const std::auto_ptr&lt;int&gt;' as `this' argument of
- `std::auto_ptr&lt;_Tp&gt;::operator std::auto_ptr_ref&lt;_Tp1&gt;()
- [with _Tp1 = int, _Tp = int]' discards qualifiers
- </PRE>
- See the highlighted error? It starts with a message in all caps
- to get your attention.
- </P>
- <P>Return <A HREF="#top">to top of page</A> or
- <A HREF="../faq/index.html">to the FAQ</A>.
- </P>
-
-<HR>
-<H2><A NAME="3">Functors</A></H2>
- <P>If you don't know what functors are, you're not alone. Many people
+ </pre>
+ Should you try this with the checks enabled, you will see an error.
+ </p>
+ <p>Return <a href="#top">to top of page</a> or
+ <a href="../faq/index.html">to the FAQ</a>.
+ </p>
+
+<hr>
+<h2><a name="3">Functors</a></h2>
+ <p>If you don't know what functors are, you're not alone. Many people
get slightly the wrong idea. In the interest of not reinventing
the wheel, we will refer you to the introduction to the functor
concept written by SGI as part of their STL, in
- <A HREF="http://www.sgi.com/Technology/STL/functors.html">their
- http://www.sgi.com/Technology/STL/functors.html</A>.
- </P>
- <P>Return <A HREF="#top">to top of page</A> or
- <A HREF="../faq/index.html">to the FAQ</A>.
- </P>
-
-<HR>
-<H2><A NAME="4">Pairs</A></H2>
- <P>The <TT>pair&lt;T1,T2&gt;</TT> is a simple and handy way to
+ <a href="http://www.sgi.com/Technology/STL/functors.html">their
+ http://www.sgi.com/Technology/STL/functors.html</a>.
+ </p>
+ <p>Return <a href="#top">to top of page</a> or
+ <a href="../faq/index.html">to the FAQ</a>.
+ </p>
+
+<hr>
+<h2><a name="4">Pairs</a></h2>
+ <p>The <code>pair&lt;T1,T2&gt;</code> is a simple and handy way to
carry around a pair of objects. One is of type T1, and another of
type T2; they may be the same type, but you don't get anything
extra if they are. The two members can be accessed directly, as
- <TT>.first</TT> and <TT>.second</TT>.
- </P>
- <P>Construction is simple. The default ctor initializes each member
+ <code>.first</code> and <code>.second</code>.
+ </p>
+ <p>Construction is simple. The default ctor initializes each member
with its respective default ctor. The other simple ctor,
- <PRE>
+ <pre>
pair (const T1&amp; x, const T2&amp; y);
- </PRE>does what you think it does, <TT>first</TT> getting <TT>x</TT>
- and <TT>second</TT> getting <TT>y</TT>.
- </P>
- <P>There is a copy constructor, but it requires that your compiler
+ </pre>does what you think it does, <code>first</code> getting <code>x</code>
+ and <code>second</code> getting <code>y</code>.
+ </p>
+ <p>There is a copy constructor, but it requires that your compiler
handle member function templates:
- <PRE>
+ <pre>
template &lt;class U, class V&gt; pain (const pair&lt;U,V&gt;&amp; p);
- </PRE>The compiler will convert as necessary from U to T1 and from
+ </pre>The compiler will convert as necessary from U to T1 and from
V to T2 in order to perform the respective initializations.
- </P>
- <P>The comparison operators are done for you. Equality
- of two <TT>pair&lt;T1,T2&gt;</TT>s is defined as both <TT>first</TT>
- members comparing equal and both <TT>second</TT> members comparing
+ </p>
+ <p>The comparison operators are done for you. Equality
+ of two <code>pair&lt;T1,T2&gt;</code>s is defined as both <code>first</code>
+ members comparing equal and both <code>second</code> members comparing
equal; this simply delegates responsibility to the respective
- <TT>operator==</TT> functions (for types like MyClass) or builtin
+ <code>operator==</code> functions (for types like MyClass) or builtin
comparisons (for types like int, char, etc).
- </P>
- <P>The less-than operator is a bit odd the first time you see it. It
+ </p>
+ <a name="pairlt">
+ <p>The less-than operator is a bit odd the first time you see it. It
is defined as evaluating to:
- <PRE>
+ <pre>
x.first &lt; y.first ||
( !(y.first &lt; x.first) &amp;&amp; x.second &lt; y.second )
- </PRE>
- The other operators are not defined using the <TT>rel_ops</TT>
+ </pre>
+ The other operators are not defined using the <code>rel_ops</code>
functions above, but their semantics are the same.
- </P>
- <P>Finally, there is a template function called <TT>make_pair</TT>
+ </p>
+ </a>
+ <p>Finally, there is a template function called <code>make_pair</code>
that takes two references-to-const objects and returns an
instance of a pair instantiated on their respective types:
- <PRE>
+ <pre>
pair&lt;int,MyClass&gt; p = make_pair(4,myobject);
- </PRE>
- </P>
- <P>Return <A HREF="#top">to top of page</A> or
- <A HREF="../faq/index.html">to the FAQ</A>.
- </P>
+ </pre>
+ </p>
+ <p>Return <a href="#top">to top of page</a> or
+ <a href="../faq/index.html">to the FAQ</a>.
+ </p>
<!-- ####################################################### -->
-<HR>
-<P CLASS="fineprint"><EM>
+<hr>
+<p class="fineprint"><em>
+See <a href="../17_intro/license.html">license.html</a> for copying conditions.
Comments and suggestions are welcome, and may be sent to
-<A HREF="mailto:pme@sources.redhat.com">Phil Edwards</A> or
-<A HREF="mailto:gdr@gcc.gnu.org">Gabriel Dos Reis</A>.
-<BR> $Id: howto.html,v 1.1 2000/12/10 04:04:54 pme Exp $
-</EM></P>
+<a href="mailto:libstdc++@gcc.gnu.org">the libstdc++ mailing list</a>.
+</em></p>
-</BODY>
-</HTML>
+</body>
+</html>
diff --git a/libstdc++-v3/docs/html/21_strings/howto.html b/libstdc++-v3/docs/html/21_strings/howto.html
index cdc83685965..6acd357c959 100644
--- a/libstdc++-v3/docs/html/21_strings/howto.html
+++ b/libstdc++-v3/docs/html/21_strings/howto.html
@@ -1,66 +1,65 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-<HEAD>
- <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
- <META NAME="AUTHOR" CONTENT="pme@sources.redhat.com (Phil Edwards)">
- <META NAME="KEYWORDS" CONTENT="HOWTO, libstdc++, GCC, g++, libg++, STL">
- <META NAME="DESCRIPTION" CONTENT="HOWTO for the libstdc++ chapter 21.">
- <META NAME="GENERATOR" CONTENT="vi and eight fingers">
- <TITLE>libstdc++-v3 HOWTO: Chapter 21</TITLE>
-<LINK REL=StyleSheet HREF="../lib3styles.css">
-<!-- $Id: howto.html,v 1.1 2000/12/10 04:04:55 pme Exp $ -->
-</HEAD>
-<BODY>
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="AUTHOR" content="pme@gcc.gnu.org (Phil Edwards)">
+ <meta name="KEYWORDS" content="HOWTO, libstdc++, GCC, g++, libg++, STL">
+ <meta name="DESCRIPTION" content="HOWTO for the libstdc++ chapter 21.">
+ <meta name="GENERATOR" content="vi and eight fingers">
+ <title>libstdc++-v3 HOWTO: Chapter 21</title>
+<link rel="StyleSheet" href="../lib3styles.css">
+</head>
+<body>
-<H1 CLASS="centered"><A NAME="top">Chapter 21: Strings</A></H1>
+<h1 class="centered"><a name="top">Chapter 21: Strings</a></h1>
-<P>Chapter 21 deals with the C++ strings library (a welcome relief).
-</P>
+<p>Chapter 21 deals with the C++ strings library (a welcome relief).
+</p>
<!-- ####################################################### -->
-<HR>
-<H1>Contents</H1>
-<UL>
- <LI><A HREF="#1">MFC's CString</A>
- <LI><A HREF="#2">A case-insensitive string class</A>
- <LI><A HREF="#3">Breaking a C++ string into tokens</A>
- <LI><A HREF="#4">Simple transformations</A>
-</UL>
+<hr>
+<h1>Contents</h1>
+<ul>
+ <li><a href="#1">MFC's CString</a>
+ <li><a href="#2">A case-insensitive string class</a>
+ <li><a href="#3">Breaking a C++ string into tokens</a>
+ <li><a href="#4">Simple transformations</a>
+</ul>
-<HR>
+<hr>
<!-- ####################################################### -->
-<H2><A NAME="1">MFC's CString</A></H2>
- <P>A common lament seen in various newsgroups deals with the Standard
+<h2><a name="1">MFC's CString</a></h2>
+ <p>A common lament seen in various newsgroups deals with the Standard
string class as opposed to the Microsoft Foundation Class called
CString. Often programmers realize that a standard portable
answer is better than a proprietary nonportable one, but in porting
their application from a Win32 platform, they discover that they
- are relying on special functons offered by the CString class.
- </P>
- <P>Things are not as bad as they seem. In
- <A HREF="http://gcc.gnu.org/ml/gcc/1999-04n/msg00236.html">this
- message</A>, Joe Buck points out a few very important things:
- <UL>
- <LI>The Standard <TT>string</TT> supports all the operations
+ are relying on special functions offered by the CString class.
+ </p>
+ <p>Things are not as bad as they seem. In
+ <a href="http://gcc.gnu.org/ml/gcc/1999-04n/msg00236.html">this
+ message</a>, Joe Buck points out a few very important things:
+ <ul>
+ <li>The Standard <code>string</code> supports all the operations
that CString does, with three exceptions.
- <LI>Two of those exceptions (whitespace trimming and case
+ <li>Two of those exceptions (whitespace trimming and case
conversion) are trivial to implement. In fact, we do so
on this page.
- <LI>The third is <TT>CString::Format</TT>, which allows formatting
- in the style of <TT>sprintf</TT>. This deserves some mention:
- </UL>
- </P>
- <A NAME="1.1internal"> <!-- Coming from Chapter 27 -->
- <P>The old libg++ library had a function called form(), which did much
+ <li>The third is <code>CString::Format</code>, which allows formatting
+ in the style of <code>sprintf</code>. This deserves some mention:
+ </ul>
+ </p>
+ <a name="1.1internal"> <!-- Coming from Chapter 27 -->
+ <p>The old libg++ library had a function called form(), which did much
the same thing. But for a Standard solution, you should use the
stringstream classes. These are the bridge between the iostream
hierarchy and the string class, and they operate with regular
streams seamlessly because they inherit from the iostream
- heirarchy. An quick example:
- <PRE>
+ hierarchy. An quick example:
+ <pre>
#include &lt;iostream&gt;
#include &lt;string&gt;
#include &lt;sstream&gt;
@@ -79,11 +78,11 @@
&lt;&lt; " and 3*N was " &lt;&lt; (3*the_number);
return output_stream.str();
- } </PRE>
- </P></A>
- <P>A serious problem with CString is a design bug in its memory
+ } </pre>
+ </p></a>
+ <p>A serious problem with CString is a design bug in its memory
allocation. Specifically, quoting from that same message:
- <PRE>
+ <pre>
CString suffers from a common programming error that results in
poor performance. Consider the following code:
@@ -104,47 +103,47 @@
If you replace CString with string in the above function, the
performance is O(n).
- </PRE>
- </P>
- <P>Joe Buck also pointed out some other things to keep in mind when
+ </pre>
+ </p>
+ <p>Joe Buck also pointed out some other things to keep in mind when
comparing CString and the Standard string class:
- <UL>
- <LI>CString permits access to its internal representation; coders
- who exploited that may have problems moving to <TT>string</TT>.
- <LI>Microsoft ships the source to CString (in the files
+ <ul>
+ <li>CString permits access to its internal representation; coders
+ who exploited that may have problems moving to <code>string</code>.
+ <li>Microsoft ships the source to CString (in the files
MFC\SRC\Str{core,ex}.cpp), so you could fix the allocation
bug and rebuild your MFC libraries.
- <EM><B>Note:</B> It looks like the the CString shipped with
+ <em><B>Note:</B> It looks like the the CString shipped with
VC++6.0 has fixed this, although it may in fact have been one
- of the VC++ SPs that did it.</EM>
- <LI><TT>string</TT> operations like this have O(n) complexity
- <EM>if the implementors do it correctly</EM>. The libstdc++
+ of the VC++ SPs that did it.</em>
+ <li><code>string</code> operations like this have O(n) complexity
+ <em>if the implementors do it correctly</em>. The libstdc++
implementors did it correctly. Other vendors might not.
- <LI>While parts of the SGI STL are used in libstdc++-v3, their
- string class is not. The SGI <TT>string</TT> is essentially
- <TT>vector&lt;char&gt;</TT> and does not do any reference
+ <li>While parts of the SGI STL are used in libstdc++-v3, their
+ string class is not. The SGI <code>string</code> is essentially
+ <code>vector&lt;char&gt;</code> and does not do any reference
counting like libstdc++-v3's does. (It is O(n), though.)
So if you're thinking about SGI's string or rope classes,
you're now looking at four possibilities: CString, the
libstdc++ string, the SGI string, and the SGI rope, and this
is all before any allocator or traits customizations! (More
choices than you can shake a stick at -- want fries with that?)
- </UL>
- </P>
- <P>Return <A HREF="#top">to top of page</A> or
- <A HREF="../faq/index.html">to the FAQ</A>.
- </P>
+ </ul>
+ </p>
+ <p>Return <a href="#top">to top of page</a> or
+ <a href="../faq/index.html">to the FAQ</a>.
+ </p>
-<HR>
-<H2><A NAME="2">A case-insensitive string class</A></H2>
- <P>The well-known-and-if-it-isn't-well-known-it-ought-to-be
- <A HREF="http://www.peerdirect.com/resources/">Guru of the Week</A>
+<hr>
+<h2><a name="2">A case-insensitive string class</a></h2>
+ <p>The well-known-and-if-it-isn't-well-known-it-ought-to-be
+ <a href="http://www.peerdirect.com/resources/">Guru of the Week</a>
discussions held on Usenet covered this topic in January of 1998.
Briefly, the challenge was, &quot;write a 'ci_string' class which
is identical to the standard 'string' class, but is
case-insensitive in the same way as the (common but nonstandard)
C function stricmp():&quot;
- <PRE>
+ <pre>
ci_string s( "AbCdE" );
// case insensitive
@@ -153,111 +152,112 @@
// still case-preserving, of course
assert( strcmp( s.c_str(), "AbCdE" ) == 0 );
- assert( strcmp( s.c_str(), "abcde" ) != 0 ); </PRE>
- </P>
+ assert( strcmp( s.c_str(), "abcde" ) != 0 ); </pre>
+ </p>
- <P>The solution is surprisingly easy. The original answer pages
+ <p>The solution is surprisingly easy. The original answer pages
on the GotW website were removed into cold storage, in
preparation for
- <A HREF="http://cseng.aw.com/bookpage.taf?ISBN=0-201-61562-2">a
- published book of GotW notes</A>. Before being
+ <a href="http://cseng.aw.com/bookpage.taf?ISBN=0-201-61562-2">a
+ published book of GotW notes</a>. Before being
put on the web, of course, it was posted on Usenet, and that
- posting containing the answer is <A HREF="gotw29a.txt">available
- here</A>.
- </P>
- <P>See? Told you it was easy!</P>
- <P><B>Added June 2000:</B> The May issue of <U>C++ Report</U> contains
- a fascinating article by Matt Austern (yes, <EM>the</EM> Matt Austern)
+ posting containing the answer is <a href="gotw29a.txt">available
+ here</a>.
+ </p>
+ <p>See? Told you it was easy!</p>
+ <p><strong>Added June 2000:</strong> The May issue of <u>C++ Report</u>
+ contains
+ a fascinating article by Matt Austern (yes, <em>the</em> Matt Austern)
on why case-insensitive comparisons are not as easy as they seem,
- and why creating a class is the <EM>wrong</EM> way to go about it in
+ and why creating a class is the <em>wrong</em> way to go about it in
production code. (The GotW answer mentions one of the principle
difficulties; his article mentions more.)
- </P>
- <P>Basically, this is &quot;easy&quot; only if you ignore some things,
+ </p>
+ <p>Basically, this is &quot;easy&quot; only if you ignore some things,
things which may be too important to your program to ignore. (I chose
to ignore them when originally writing this entry, and am surprised
that nobody ever called me on it...) The GotW question and answer
remain useful instructional tools, however.
- </P>
- <P><B>Added September 2000:</B> James Kanze provided a link to a
- <A HREF="http://www.unicode.org/unicode/reports/tr21/">Unicode
- Technical Report discussing case handling</A>, which provides some
+ </p>
+ <p><strong>Added September 2000:</strong> James Kanze provided a link to a
+ <a href="http://www.unicode.org/unicode/reports/tr21/">Unicode
+ Technical Report discussing case handling</a>, which provides some
very good information.
- </P>
- <P>Return <A HREF="#top">to top of page</A> or
- <A HREF="../faq/index.html">to the FAQ</A>.
- </P>
+ </p>
+ <p>Return <a href="#top">to top of page</a> or
+ <a href="../faq/index.html">to the FAQ</a>.
+ </p>
-<HR>
-<H2><A NAME="3">Breaking a C++ string into tokens</A></H2>
- <P>The Standard C (and C++) function <TT>strtok()</TT> leaves a lot to
+<hr>
+<h2><a name="3">Breaking a C++ string into tokens</a></h2>
+ <p>The Standard C (and C++) function <code>strtok()</code> leaves a lot to
be desired in terms of user-friendliness. It's unintuitive, it
destroys the character string on which it operates, and it requires
you to handle all the memory problems. But it does let the client
code decide what to use to break the string into pieces; it allows
you to choose the &quot;whitespace,&quot; so to speak.
- </P>
- <P>A C++ implementation lets us keep the good things and fix those
+ </p>
+ <p>A C++ implementation lets us keep the good things and fix those
annoyances. The implementation here is more intuitive (you only
call it once, not in a loop with varying argument), it does not
affect the original string at all, and all the memory allocation
is handled for you.
- </P>
- <P>It's called stringtok, and it's a template function. It's given
- <A HREF="stringtok_h.txt">in this file</A> in a less-portable form than
+ </p>
+ <p>It's called stringtok, and it's a template function. It's given
+ <a href="stringtok_h.txt">in this file</a> in a less-portable form than
it could be, to keep this example simple (for example, see the
comments on what kind of string it will accept). The author uses
a more general (but less readable) form of it for parsing command
strings and the like. If you compiled and ran this code using it:
- <PRE>
+ <pre>
std::list&lt;string&gt; ls;
stringtok (ls, " this \t is\t\n a test ");
for (std::list&lt;string&gt;const_iterator i = ls.begin();
i != ls.end(); ++i)
{
std::cerr &lt;&lt; ':' &lt;&lt; (*i) &lt;&lt; ":\n";
- }</PRE>
+ }</pre>
You would see this as output:
- <PRE>
+ <pre>
:this:
:is:
:a:
- :test:</PRE>
- with all the whitespace removed. The original <TT>s</TT> is still
- available for use, <TT>ls</TT> will clean up after itself, and
- <TT>ls.size()</TT> will return how many tokens there were.
- </P>
- <P>As always, there is a price paid here, in that stringtok is not
+ :test:</pre>
+ with all the whitespace removed. The original <code>s</code> is still
+ available for use, <code>ls</code> will clean up after itself, and
+ <code>ls.size()</code> will return how many tokens there were.
+ </p>
+ <p>As always, there is a price paid here, in that stringtok is not
as fast as strtok. The other benefits usually outweight that, however.
- <A HREF="stringtok_std_h.txt">Another version of stringtok is given
- here</A>, suggested by Chris King and tweaked by Petr Prikryl,
+ <a href="stringtok_std_h.txt">Another version of stringtok is given
+ here</a>, suggested by Chris King and tweaked by Petr Prikryl,
and this one uses the
transformation functions mentioned below. If you are comfortable
with reading the new function names, this version is recommended
as an example.
- </P>
- <P><B>Added February 2001:</B> Mark Wilden pointed out that the
- standard <TT>std::getline()</TT> function can be used with standard
- <A HREF="../27_io/howto.html">istringstreams</A> to perform
+ </p>
+ <p><strong>Added February 2001:</strong> Mark Wilden pointed out that the
+ standard <code>std::getline()</code> function can be used with standard
+ <a href="../27_io/howto.html">istringstreams</a> to perform
tokenizing as well. Build an istringstream from the input text,
and then use std::getline with varying delimiters (the three-argument
signature) to extract tokens into a string.
- </P>
- <P>Return <A HREF="#top">to top of page</A> or
- <A HREF="../faq/index.html">to the FAQ</A>.
- </P>
+ </p>
+ <p>Return <a href="#top">to top of page</a> or
+ <a href="../faq/index.html">to the FAQ</a>.
+ </p>
-<HR>
-<H2><A NAME="4">Simple transformations</A></H2>
- <P>Here are Standard, simple, and portable ways to perform common
- transformations on a <TT>string</TT> instance, such as &quot;convert
+<hr>
+<h2><a name="4">Simple transformations</a></h2>
+ <p>Here are Standard, simple, and portable ways to perform common
+ transformations on a <code>string</code> instance, such as &quot;convert
to all upper case.&quot; The word transformations is especially
apt, because the standard template function
- <TT>transform&lt;&gt;</TT> is used.
- </P>
- <P>This code will go through some iterations (no pun). Here's the
+ <code>transform&lt;&gt;</code> is used.
+ </p>
+ <p>This code will go through some iterations (no pun). Here's the
simplistic version usually seen on Usenet:
- <PRE>
+ <pre>
#include &lt;string&gt;
#include &lt;algorithm&gt;
#include &lt;cctype&gt; // old &lt;ctype.h&gt;
@@ -274,36 +274,36 @@
// result in a different string
std::string capital_s;
capital_s.reserve(s.size());
- std::transform (s.begin(), s.end(), capital_s.begin(), tolower); </PRE>
- <SPAN CLASS="larger"><B>Note</B></SPAN> that these calls all involve
- the global C locale through the use of the C functions
- <TT>toupper/tolower</TT>. This is absolutely guaranteed to work --
- but <EM>only</EM> if the string contains <EM>only</EM> characters
- from the basic source character set, and there are <EM>only</EM>
+ std::transform (s.begin(), s.end(), capital_s.begin(), tolower); </pre>
+ <span class="larger"><strong>Note</strong></span> that these calls all
+ involve the global C locale through the use of the C functions
+ <code>toupper/tolower</code>. This is absolutely guaranteed to work --
+ but <em>only</em> if the string contains <em>only</em> characters
+ from the basic source character set, and there are <em>only</em>
96 of those. Which means that not even all English text can be
represented (certain British spellings, proper names, and so forth).
So, if all your input forevermore consists of only those 96
characters (hahahahahaha), then you're done.
- </P>
- <P>At minimum, you can write short wrappers like
- <PRE>
+ </p>
+ <p>At minimum, you can write short wrappers like
+ <pre>
char toLower (char c)
{
return tolower(static_cast&lt;unsigned char&gt;(c));
- }</PRE>
- </P>
- <P>The correct method is to use a facet for a particular locale
+ }</pre>
+ </p>
+ <p>The correct method is to use a facet for a particular locale
and call its conversion functions. These are discussed more in
Chapter 22; the specific part is
- <A HREF="../22_locale/howto.html#5">here</A>, which shows the
+ <a href="../22_locale/howto.html#5">here</a>, which shows the
final version of this code. (Thanks to James Kanze for assistance
and suggestions on all of this.)
- </P>
- <P>Another common operation is trimming off excess whitespace. Much
+ </p>
+ <p>Another common operation is trimming off excess whitespace. Much
like transformations, this task is trivial with the use of string's
- <TT>find</TT> family. These examples are broken into multiple
+ <code>find</code> family. These examples are broken into multiple
statements for readability:
- <PRE>
+ <pre>
std::string str (" \t blah blah blah \n ");
// trim leading whitespace
@@ -312,28 +312,26 @@
// trim trailing whitespace
notwhite = str.find_last_not_of(" \t\n");
- str.erase(notwhite+1); </PRE>
- Obviously, the calls to <TT>find</TT> could be inserted directly
- into the calls to <TT>erase</TT>, in case your compiler does not
- optimize named temporaries out of existance.
- </P>
- <P>Return <A HREF="#top">to top of page</A> or
- <A HREF="../faq/index.html">to the FAQ</A>.
- </P>
-
+ str.erase(notwhite+1); </pre>
+ Obviously, the calls to <code>find</code> could be inserted directly
+ into the calls to <code>erase</code>, in case your compiler does not
+ optimize named temporaries out of existence.
+ </p>
+ <p>Return <a href="#top">to top of page</a> or
+ <a href="../faq/index.html">to the FAQ</a>.
+ </p>
<!-- ####################################################### -->
-<HR>
-<P CLASS="fineprint"><EM>
+<hr>
+<p class="fineprint"><em>
+See <a href="../17_intro/license.html">license.html</a> for copying conditions.
Comments and suggestions are welcome, and may be sent to
-<A HREF="mailto:pme@sources.redhat.com">Phil Edwards</A> or
-<A HREF="mailto:gdr@gcc.gnu.org">Gabriel Dos Reis</A>.
-<BR> $Id: howto.html,v 1.1 2000/12/10 04:04:55 pme Exp $
-</EM></P>
+<a href="mailto:libstdc++@gcc.gnu.org">the libstdc++ mailing list</a>.
+</em></p>
-</BODY>
-</HTML>
+</body>
+</html>
diff --git a/libstdc++-v3/docs/html/22_locale/codecvt.html b/libstdc++-v3/docs/html/22_locale/codecvt.html
index 2ce6c95a1e5..46147d90556 100644
--- a/libstdc++-v3/docs/html/22_locale/codecvt.html
+++ b/libstdc++-v3/docs/html/22_locale/codecvt.html
@@ -1,18 +1,18 @@
-<HTML>
-<HEAD>
- <H1>
+<html>
+<head>
+ <h1>
Notes on the codecvt implementation.
- </H1>
-</HEAD>
+ </h1>
+</head>
<I>
prepared by Benjamin Kosnik (bkoz@redhat.com) on August 28, 2000
</I>
-<P>
-<H2>
+<p>
+<h2>
1. Abstract
-</H2>
-<P>
+</h2>
+<p>
The standard class codecvt attempts to address conversions between
different character encoding schemes. In particular, the standard
attempts to detail conversions between the implementation-defined wide
@@ -26,12 +26,12 @@ Unicode and UTF8. Design issues and requirements are addressed, and
examples of correct usage for both the required specializations for
wide and narrow characters and the implementation-provided extended
functionality are given.
-</P>
+</p>
-<P>
-<H2>
+<p>
+<h2>
2. What the standard says
-</H2>
+</h2>
Around page 425 of the C++ Standard, this charming heading comes into view:
<BLOCKQUOTE>
@@ -49,11 +49,11 @@ Unicode and EUC.
</I>
</BLOCKQUOTE>
-<P>
+<p>
Hmm. So, in some unspecified way, Unicode encodings and
translations between other character sets should be handled by this
class.
-</P>
+</p>
<BLOCKQUOTE>
<I>
@@ -61,9 +61,9 @@ class.
</I>
</BLOCKQUOTE>
-<P>
+<p>
Ah ha! Another clue...
-</P>
+</p>
<BLOCKQUOTE>
<I>
@@ -81,24 +81,24 @@ is useful to communicate to or from the specialized do_convert member.
</I>
</BLOCKQUOTE>
-<P>
+<p>
At this point, a couple points become clear:
-<P>
+<p>
One: The standard clearly implies that attempts to add non-required
(yet useful and widely used) conversions need to do so through the
-third template parameter, stateT.</P>
+third template parameter, stateT.</p>
-<P>
+<p>
Two: The required conversions, by specifying mbstate_t as the third
template parameter, imply an implementation strategy that is mostly
(or wholly) based on the underlying C library, and the functions
-mcsrtombs and wcsrtombs in particular.</P>
+mcsrtombs and wcsrtombs in particular.</p>
-<P>
-<H2>
+<p>
+<h2>
3. Some thoughts on what would be useful
-</H2>
+</h2>
Probably the most frequently asked question about code conversion is:
&quot;So dudes, what's the deal with Unicode strings?&quot; The dude part is
optional, but apparently the usefulness of Unicode strings is pretty
@@ -106,7 +106,7 @@ widely appreciated. Sadly, this specific encoding (And other useful
encodings like UTF8, UCS4, ISO 8859-10, etc etc etc) are not mentioned
in the C++ standard.
-<P>
+<p>
In particular, the simple implementation detail of wchar_t's size
seems to repeatedly confound people. Many systems use a two byte,
unsigned integral type to represent wide characters, and use an
@@ -117,20 +117,20 @@ UCS4. (GNU/Linux systems using glibc, in particular.) The C
programming language (and thus C++) does not specify a specific size
for the type wchar_t.
-<P>
+<p>
Thus, portable C++ code cannot assume a byte size (or endianness) either.
-<P>
+<p>
Getting back to the frequently asked question: What about Unicode strings?
-<P>
+<p>
What magic spell will do this conversion?
-<P>
+<p>
A couple of comments:
-</P>
+</p>
-<P>
+<p>
The thought that all one needs to convert between two arbitrary
codesets is two types and some kind of state argument is
unfortunate. In particular, encodings may be stateless. The naming of
@@ -138,101 +138,101 @@ the third parameter as stateT is unfortunate, as what is really needed
is some kind of generalized type that accounts for the issues that
abstract encodings will need. The minimum information that is required
includes:
-</P>
+</p>
-<UL>
-<LI>
-</P>
+<ul>
+<li>
+</p>
Identifiers for each of the codesets involved in the conversion. For
example, using the iconv family of functions from the Single Unix
Specification (what used to be called X/Open) hosted on the GNU/Linux
operating system allows bi-directional mapping between far more than
the following tantalizing possibilities:
-</P>
+</p>
-(An edited list taken from <TT>`iconv --list`</TT> on a Red Hat 6.2/Intel system:
+(An edited list taken from <code>`iconv --list`</code> on a Red Hat 6.2/Intel system:
<BLOCKQUOTE>
<PRE>
8859_1, 8859_9, 10646-1:1993, 10646-1:1993/UCS4, ARABIC, ARABIC7,
-ASCII, EUC-CN, EUC-JP, EUC-KR, EUC-TW, GREEK-CCITT, GREEK, GREEK7-OLD,
+ASCII, EUC-CN, EUC-JP, EUC-KR, EUC-TW, GREEK-CCIcode, GREEK, GREEK7-OLD,
GREEK7, GREEK8, HEBREW, ISO-8859-1, ISO-8859-2, ISO-8859-3,
ISO-8859-4, ISO-8859-5, ISO-8859-6, ISO-8859-7, ISO-8859-8,
ISO-8859-9, ISO-8859-10, ISO-8859-11, ISO-8859-13, ISO-8859-14,
ISO-8859-15, ISO-10646, ISO-10646/UCS2, ISO-10646/UCS4,
ISO-10646/UTF-8, ISO-10646/UTF8, SHIFT-JIS, SHIFT_JIS, UCS-2, UCS-4,
-UCS2, UCS4, UNICODE, UNICODEBIG, UNICODELITTLE, US-ASCII, US, UTF-8,
+UCS2, UCS4, UNICODE, UNICODEBIG, UNICODELIcodeLE, US-ASCII, US, UTF-8,
UTF-16, UTF8, UTF16).
</PRE>
</BLOCKQUOTE>
-<P>
+<p>
For iconv-based implementations, string literals for each of the
encodings (ie. &quot;UCS-2&quot; and &quot;UTF-8&quot;) are necessary,
although for other,
non-iconv implementations a table of enumerated values or some other
mechanism may be required.
-<LI>
+<li>
Maximum length of the identifying string literal.
-<LI>
+<li>
Some encodings are require explicit endian-ness. As such, some kind
of endian marker or other byte-order marker will be necessary. See
&quot;Footnotes for C/C++ developers&quot; in Haible for more information on
UCS-2/Unicode endian issues. (Summary: big endian seems most likely,
however implementations, most notably Microsoft, vary.)
-<LI>
+<li>
Types representing the conversion state, for conversions involving
the machinery in the &quot;C&quot; library, or the conversion descriptor, for
conversions using iconv (such as the type iconv_t.) Note that the
conversion descriptor encodes more information than a simple encoding
state type.
-<LI>
+<li>
Conversion descriptors for both directions of encoding. (ie, both
UCS-2 to UTF-8 and UTF-8 to UCS-2.)
-<LI>
+<li>
Something to indicate if the conversion requested if valid.
-<LI>
+<li>
Something to represent if the conversion descriptors are valid.
-<LI>
+<li>
Some way to enforce strict type checking on the internal and
external types. As part of this, the size of the internal and
external types will need to be known.
-</UL>
+</ul>
-<P>
-<H2>
+<p>
+<h2>
4. Problems with &quot;C&quot; code conversions : thread safety, global
locales, termination.
-</H2>
+</h2>
In addition, multi-threaded and multi-locale environments also impact
the design and requirements for code conversions. In particular, they
affect the required specialization codecvt&lt;wchar_t, char, mbstate_t&gt;
when implemented using standard &quot;C&quot; functions.
-<P>
+<p>
Three problems arise, one big, one of medium importance, and one small.
-<P>
+<p>
First, the small: mcsrtombs and wcsrtombs may not be multithread-safe
on all systems required by the GNU tools. For GNU/Linux and glibc,
this is not an issue.
-<P>
+<p>
Of medium concern, in the grand scope of things, is that the functions
used to implement this specialization work on null-terminated
strings. Buffers, especially file buffers, may not be null-terminated,
thus giving conversions that end prematurely or are otherwise
incorrect. Yikes!
-<P>
+<p>
The last, and fundamental problem, is the assumption of a global
locale for all the &quot;C&quot; functions referenced above. For something like
C++ iostreams (where codecvt is explicitly used) the notion of
@@ -243,43 +243,43 @@ multiple locales and or simultaneous usage with computationally
correct results. In short, libstdc++-v3 is trying to offer, as an
option, a high-quality implementation, damn the additional complexity!
-<P>
+<p>
For the required specialization codecvt&lt;wchar_t, char, mbstate_t&gt; ,
conversions are made between the internal character set (always UCS4
on GNU/Linux) and whatever the currently selected locale for the
LC_CTYPE category implements.
-<P>
-<H2>
+<p>
+<h2>
5. Design
-</H2>
+</h2>
The two required specializations are implemented as follows:
-<P>
-<TT>
+<p>
+<code>
codecvt&lt;char, char, mbstate_t&gt;
-</TT>
-<P>
+</code>
+<p>
This is a degenerate (ie, does nothing) specialization. Implementing
this was a piece of cake.
-<P>
-<TT>
+<p>
+<code>
codecvt&lt;char, wchar_t, mbstate_t&gt;
-</TT>
-<P>
+</code>
+<p>
This specialization, by specifying all the template parameters, pretty
much ties the hands of implementors. As such, the implementation is
straightforward, involving mcsrtombs for the conversions between char
to wchar_t and wcsrtombs for conversions between wchar_t and char.
-<P>
+<p>
Neither of these two required specializations deals with Unicode
characters. As such, libstdc++-v3 implements a partial specialization
of the codecvt class with and iconv wrapper class, __enc_traits as the
third template parameter.
-<P>
+<p>
This implementation should be standards conformant. First of all, the
standard explicitly points out that instantiations on the third
template parameter, stateT, are the proper way to implement
@@ -289,34 +289,34 @@ of all, the requirements for the stateT type elsewhere in the standard
(see 21.1.2 traits typedefs) only indicate that this type be copy
constructible.
-<P>
+<p>
As such, the type __enc_traits is defined as a non-templatized, POD
type to be used as the third type of a codecvt instantiation. This
type is just a wrapper class for iconv, and provides an easy interface
to iconv functionality.
-<P>
+<p>
There are two constructors for __enc_traits:
-<P>
-<TT>
+<p>
+<code>
__enc_traits() : __in_desc(0), __out_desc(0)
-</TT>
-<P>
+</code>
+<p>
This default constructor sets the internal encoding to some default
(currently UCS4) and the external encoding to whatever is returned by
nl_langinfo(CODESET).
-<P>
-<TT>
+<p>
+<code>
__enc_traits(const char* __int, const char* __ext)
-</TT>
-<P>
+</code>
+<p>
This constructor takes as parameters string literals that indicate the
desired internal and external encoding. There are no defaults for
either argument.
-<P>
+<p>
One of the issues with iconv is that the string literals identifying
conversions are not standardized. Because of this, the thought of
mandating and or enforcing some set of pre-determined valid
@@ -326,24 +326,24 @@ inducing) strategy was implemented: end-users can specify any string
encodings. It is up to the user to make sure that these strings are
valid on the target system.
-<P>
-<TT>
+<p>
+<code>
void
_M_init()
-</TT>
-<P>
+</code>
+<p>
Strangely enough, this member function attempts to open conversion
descriptors for a given __enc_traits object. If the conversion
descriptors are not valid, the conversion descriptors returned will
not be valid and the resulting calls to the codecvt conversion
functions will return error.
-<P>
-<TT>
+<p>
+<code>
bool
_M_good()
-</TT>
-<P>
+</code>
+<p>
Provides a way to see if the given __enc_traits object has been
properly initialized. If the string literals describing the desired
internal and external encoding are not valid, initialization will
@@ -352,29 +352,29 @@ encodings are valid, but iconv_open could not allocate conversion
descriptors, this will also return false. Otherwise, the object is
ready to convert and will return true.
-<P>
-<TT>
+<p>
+<code>
__enc_traits(const __enc_traits&amp;)
-</TT>
-<P>
+</code>
+<p>
As iconv allocates memory and sets up conversion descriptors, the copy
constructor can only copy the member data pertaining to the internal
and external code conversions, and not the conversion descriptors
themselves.
-<P>
+<p>
Definitions for all the required codecvt member functions are provided
for this specialization, and usage of codecvt&lt;internal character type,
external character type, __enc_traits&gt; is consistent with other
codecvt usage.
-<P>
-<H2>
+<p>
+<h2>
6. Examples
-</H2>
+</h2>
-<UL>
- <LI>
+<ul>
+ <li>
a. conversions involving string literals
<pre>
@@ -415,106 +415,106 @@ codecvt usage.
VERIFY( efrom_next == e_lit + size );
VERIFY( ito_next == i_arr + size );
</pre>
- <LI>
+ <li>
b. conversions involving std::string
- <LI>
+ <li>
c. conversions involving std::filebuf and std::ostream
-</UL>
+</ul>
More information can be found in the following testcases:
-<UL>
-<LI> testsuite/22_locale/codecvt_char_char.cc
-<LI> testsuite/22_locale/codecvt_unicode_wchar_t.cc
-<LI> testsuite/22_locale/codecvt_unicode_char.cc
-<LI> testsuite/22_locale/codecvt_wchar_t_char.cc
-</UL>
-
-<P>
-<H2>
+<ul>
+<li> testsuite/22_locale/codecvt_char_char.cc
+<li> testsuite/22_locale/codecvt_unicode_wchar_t.cc
+<li> testsuite/22_locale/codecvt_unicode_char.cc
+<li> testsuite/22_locale/codecvt_wchar_t_char.cc
+</ul>
+
+<p>
+<h2>
7. Unresolved Issues
-</H2>
-<UL>
-<LI>
+</h2>
+<ul>
+<li>
a. things that are sketchy, or remain unimplemented:
do_encoding, max_length and length member functions
are only weakly implemented. I have no idea how to do
this correctly, and in a generic manner. Nathan?
-<LI>
+<li>
b. conversions involving std::string
- <UL>
- <LI>
+ <ul>
+ <li>
how should operators != and == work for string of
different/same encoding?
- <LI>
+ <li>
what is equal? A byte by byte comparison or an
encoding then byte comparison?
- <LI>
+ <li>
conversions between narrow, wide, and unicode strings
- </UL>
-<LI>
+ </ul>
+<li>
c. conversions involving std::filebuf and std::ostream
- <UL>
- <LI>
+ <ul>
+ <li>
how to initialize the state object in a
standards-conformant manner?
- <LI>
+ <li>
how to synchronize the &quot;C&quot; and &quot;C++&quot;
conversion information?
- <LI>
+ <li>
wchar_t/char internal buffers and conversions between
internal/external buffers?
- </UL>
-</UL>
+ </ul>
+</ul>
-<P>
-<H2>
+<p>
+<h2>
8. Acknowledgments
-</H2>
+</h2>
Ulrich Drepper for the iconv suggestions and patient answering of
late-night questions, Jason Merrill for the template partial
specialization hints, language clarification, and wchar_t fixes.
-<P>
-<H2>
+<p>
+<h2>
9. Bibliography / Referenced Documents
-</H2>
+</h2>
Drepper, Ulrich, GNU libc (glibc) 2.2 manual. In particular, Chapters &quot;6. Character Set Handling&quot; and &quot;7 Locales and Internationalization&quot;
-<P>
+<p>
Drepper, Ulrich, Numerous, late-night email correspondence
-<P>
+<p>
Feather, Clive, &quot;A brief description of Normative Addendum 1,&quot; in particular the parts on Extended Character Sets
http://www.lysator.liu.se/c/na1.html
-<P>
+<p>
Haible, Bruno, &quot;The Unicode HOWTO&quot; v0.18, 4 August 2000
ftp://ftp.ilog.fr/pub/Users/haible/utf8/Unicode-HOWTO.html
-<P>
+<p>
ISO/IEC 14882:1998 Programming languages - C++
-<P>
+<p>
ISO/IEC 9899:1999 Programming languages - C
-<P>
+<p>
Khun, Markus, &quot;UTF-8 and Unicode FAQ for Unix/Linux&quot;
http://www.cl.cam.ac.uk/~mgk25/unicode.html
-<P>
+<p>
Langer, Angelika and Klaus Kreft, Standard C++ IOStreams and Locales, Advanced Programmer's Guide and Reference, Addison Wesley Longman, Inc. 2000
-<P>
+<p>
Stroustrup, Bjarne, Appendix D, The C++ Programming Language, Special Edition, Addison Wesley, Inc. 2000
-<P>
+<p>
System Interface Definitions, Issue 6 (IEEE Std. 1003.1-200x)
The Open Group/The Institute of Electrical and Electronics Engineers, Inc.
http://www.opennc.org/austin/docreg.html
diff --git a/libstdc++-v3/docs/html/22_locale/ctype.html b/libstdc++-v3/docs/html/22_locale/ctype.html
index 08be102fe26..3568145c92e 100644
--- a/libstdc++-v3/docs/html/22_locale/ctype.html
+++ b/libstdc++-v3/docs/html/22_locale/ctype.html
@@ -1,144 +1,144 @@
-<HTML>
-<HEAD>
- <H1>
+<html>
+<head>
+ <h1>
Notes on the ctype implementation.
- </H1>
-</HEAD>
+ </h1>
+</head>
<I>
prepared by Benjamin Kosnik (bkoz@redhat.com) on August 30, 2000
</I>
-<P>
-<H2>
+<p>
+<h2>
1. Abstract
-</H2>
-<P>
+</h2>
+<p>
Woe is me.
-</P>
+</p>
-<P>
-<H2>
+<p>
+<h2>
2. What the standard says
-</H2>
+</h2>
-<P>
-<H2>
+<p>
+<h2>
3. Problems with &quot;C&quot; ctype : global locales, termination.
-</H2>
+</h2>
-<P>
+<p>
For the required specialization codecvt&lt;wchar_t, char, mbstate_t&gt; ,
conversions are made between the internal character set (always UCS4
on GNU/Linux) and whatever the currently selected locale for the
LC_CTYPE category implements.
-<P>
-<H2>
+<p>
+<h2>
4. Design
-</H2>
+</h2>
The two required specializations are implemented as follows:
-<P>
-<TT>
+<p>
+<code>
ctype&lt;char&gt;
-</TT>
-<P>
+</code>
+<p>
This is simple specialization. Implementing this was a piece of cake.
-<P>
-<TT>
+<p>
+<code>
ctype&lt;wchar_t&gt;
-</TT>
-<P>
+</code>
+<p>
This specialization, by specifying all the template parameters, pretty
much ties the hands of implementors. As such, the implementation is
straightforward, involving mcsrtombs for the conversions between char
to wchar_t and wcsrtombs for conversions between wchar_t and char.
-<P>
+<p>
Neither of these two required specializations deals with Unicode
characters. As such, libstdc++-v3 implements
-<P>
-<H2>
+<p>
+<h2>
5. Examples
-</H2>
+</h2>
<pre>
typedef ctype<char> cctype;
</pre>
More information can be found in the following testcases:
-<UL>
-<LI> testsuite/22_locale/ctype_char_members.cc
-<LI> testsuite/22_locale/ctype_wchar_t_members.cc
-</UL>
+<ul>
+<li> testsuite/22_locale/ctype_char_members.cc
+<li> testsuite/22_locale/ctype_wchar_t_members.cc
+</ul>
-<P>
-<H2>
+<p>
+<h2>
6. Unresolved Issues
-</H2>
+</h2>
-<UL>
- <LI> how to deal with the global locale issue?
+<ul>
+ <li> how to deal with the global locale issue?
- <LI> how to deal with different types than char, wchar_t?
+ <li> how to deal with different types than char, wchar_t?
- <LI> codecvt/ctype overlap: narrow/widen
+ <li> codecvt/ctype overlap: narrow/widen
- <LI> mask typedef in codecvt_base, argument types in codecvt.
+ <li> mask typedef in codecvt_base, argument types in codecvt.
what is know about this type?
- <LI> why mask* argument in codecvt?
+ <li> why mask* argument in codecvt?
- <LI> can this be made (more) generic? is there a simple way to
+ <li> can this be made (more) generic? is there a simple way to
straighten out the configure-time mess that is a by-product of
this class?
- <LI> get the ctype<wchar_t>::mask stuff under control. Need to
+ <li> get the ctype<wchar_t>::mask stuff under control. Need to
make some kind of static table, and not do lookup evertime
somebody hits the do_is... functions. Too bad we can't just
redefine mask for ctype<wchar_t>
- <LI> rename abstract base class. See if just smash-overriding
+ <li> rename abstract base class. See if just smash-overriding
is a better approach. Clarify, add sanity to naming.
-</UL>
+</ul>
-<P>
-<H2>
+<p>
+<h2>
7. Acknowledgments
-</H2>
+</h2>
Ulrich Drepper for patient answering of late-night questions, skeletal
examples, and C language expertise.
-<P>
-<H2>
+<p>
+<h2>
8. Bibliography / Referenced Documents
-</H2>
+</h2>
Drepper, Ulrich, GNU libc (glibc) 2.2 manual. In particular, Chapters &quot;6. Character Set Handling&quot; and &quot;7 Locales and Internationalization&quot;
-<P>
+<p>
Drepper, Ulrich, Numerous, late-night email correspondence
-<P>
+<p>
ISO/IEC 14882:1998 Programming languages - C++
-<P>
+<p>
ISO/IEC 9899:1999 Programming languages - C
-<P>
+<p>
Langer, Angelika and Klaus Kreft, Standard C++ IOStreams and Locales, Advanced Programmer's Guide and Reference, Addison Wesley Longman, Inc. 2000
-<P>
+<p>
Stroustrup, Bjarne, Appendix D, The C++ Programming Language, Special Edition, Addison Wesley, Inc. 2000
-<P>
+<p>
System Interface Definitions, Issue 6 (IEEE Std. 1003.1-200x)
The Open Group/The Institute of Electrical and Electronics Engineers, Inc.
http://www.opennc.org/austin/docreg.html
diff --git a/libstdc++-v3/docs/html/22_locale/howto.html b/libstdc++-v3/docs/html/22_locale/howto.html
index cbf1daf61d3..d8ada0464b1 100644
--- a/libstdc++-v3/docs/html/22_locale/howto.html
+++ b/libstdc++-v3/docs/html/22_locale/howto.html
@@ -1,144 +1,137 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-<HEAD>
- <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
- <META NAME="AUTHOR" CONTENT="pme@sources.redhat.com (Phil Edwards)">
- <META NAME="KEYWORDS" CONTENT="HOWTO, libstdc++, GCC, g++, libg++, STL">
- <META NAME="DESCRIPTION" CONTENT="HOWTO for the libstdc++ chapter 22.">
- <META NAME="GENERATOR" CONTENT="vi and eight fingers">
- <TITLE>libstdc++-v3 HOWTO: Chapter 22</TITLE>
-<LINK REL=StyleSheet HREF="../lib3styles.css">
-<!-- $Id: howto.html,v 1.1 2000/12/10 04:04:55 pme Exp $ -->
-</HEAD>
-<BODY>
-
-<H1 CLASS="centered"><A NAME="top">Chapter 22: Localization</A></H1>
-
-<P>Chapter 22 deals with the C++ localization facilities.
-</P>
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="AUTHOR" content="pme@gcc.gnu.org (Phil Edwards)">
+ <meta name="KEYWORDS" content="HOWTO, libstdc++, GCC, g++, libg++, STL">
+ <meta name="DESCRIPTION" content="HOWTO for the libstdc++ chapter 22.">
+ <meta name="GENERATOR" content="vi and eight fingers">
+ <title>libstdc++-v3 HOWTO: Chapter 22</title>
+<link rel="StyleSheet" href="../lib3styles.css">
+</head>
+<body>
+
+<h1 class="centered"><a name="top">Chapter 22: Localization</a></h1>
+
+<p>Chapter 22 deals with the C++ localization facilities.
+</p>
+<!-- I wanted to write that sentence in something requiring an exotic font,
+ like Cryllic or Kanji. Probably more work than such cuteness is worth,
+ but I still think it'd be funny.
+ -->
<!-- ####################################################### -->
-<HR>
-<H1>Contents</H1>
-<UL>
- <LI><A HREF="#1">Bjarne Stroustrup on Locales</A>
- <LI><A HREF="#2">Nathan Myers on Locales</A>
- <LI><A HREF="#3">class locale</A>
- <LI><A HREF="#4">class codecvt</A>
- <LI><A HREF="#5">class ctype</A>
- <LI><A HREF="#6">Correct Transformations</A>
-</UL>
-
-<HR>
+<hr>
+<h1>Contents</h1>
+<ul>
+ <li><a href="#1">class locale</a>
+ <li><a href="#2">class codecvt</a>
+ <li><a href="#3">class ctype</a>
+ <li><a href="#4">class messages</a>
+ <li><a href="#5">Bjarne Stroustrup on Locales</a>
+ <li><a href="#6">Nathan Myers on Locales</a>
+ <li><a href="#7">Correct Transformations</a>
+</ul>
<!-- ####################################################### -->
-<H2><A NAME="1">Stroustrup on Locales</A></H2>
- <P>Dr. Bjarne Stroustrup has released a
- <A HREF="http://www.research.att.com/~bs/3rd_loc0.html">pointer</A>
+<hr>
+<h2><a name="1">class locale</a></h2>
+ <p>Notes made during the implementation of locales can be found
+ <a href="locale.html">here</a>.
+ </p>
+
+<hr>
+<h2><a name="2">class codecvt</a></h2>
+ <p>Notes made during the implementation of codecvt can be found
+ <a href="codecvt.html">here</a>.
+ </p>
+
+ <p>The following is the abstract from the implementation notes:
+ <blockquote>
+ The standard class codecvt attempts to address conversions between
+ different character encoding schemes. In particular, the standard
+ attempts to detail conversions between the implementation-defined
+ wide characters (hereafter referred to as wchar_t) and the standard
+ type char that is so beloved in classic &quot;C&quot; (which can
+ now be referred to as narrow characters.) This document attempts
+ to describe how the GNU libstdc++-v3 implementation deals with the
+ conversion between wide and narrow characters, and also presents a
+ framework for dealing with the huge number of other encodings that
+ iconv can convert, including Unicode and UTF8. Design issues and
+ requirements are addressed, and examples of correct usage for both
+ the required specializations for wide and narrow characters and the
+ implementation-provided extended functionality are given.
+ </blockquote>
+ </p>
+
+<hr>
+<h2><a name="3">class ctype</a></h2>
+ <p>Notes made during the implementation of ctype can be found
+ <a href="ctype.html">here</a>.
+ </p>
+
+<hr>
+<h2><a name="4">class messages</a></h2>
+ <p>Notes made during the implementation of messages can be found
+ <a href="messages.html">here</a>.
+ </p>
+
+<hr>
+<h2><a name="5">Stroustrup on Locales</a></h2>
+ <p>Dr. Bjarne Stroustrup has released a
+ <a href="http://www.research.att.com/~bs/3rd_loc0.html">pointer</a>
to Appendix D of his book,
- <A HREF="http://www.research.att.com/~bs/3rd.html">The C++
- Programming Language (3rd Edition)</A>. It is a detailed
+ <a href="http://www.research.att.com/~bs/3rd.html">The C++
+ Programming Language (3rd Edition)</a>. It is a detailed
description of locales and how to use them.
- </P>
- <P>He also writes:
- <BLOCKQUOTE><EM>
+ </p>
+ <p>He also writes:
+ <blockquote><em>
Please note that I still consider this detailed description of
- locales beyond the needs of most C++ programmers. It is written
+ locales beyond the needs of most C++ programmers. It is written
with experienced programmers in mind and novices will do best to
avoid it.
- </EM></BLOCKQUOTE>
- </P>
- <P>Return <A HREF="#top">to top of page</A> or
- <A HREF="../faq/index.html">to the FAQ</A>.
- </P>
-
-<HR>
-<H2><A NAME="2">Nathan Myers on Locales</A></H2>
- <P> An article entitled &quot;The Standard C++ Locale&quot; was
- published in Dr. Dobb's Journal and can be found
- <A HREF="http://www.cantrip.org/locale.html">here</A>.
- </P>
- <P>Return <A HREF="#top">to top of page</A> or
- <A HREF="../faq/index.html">to the FAQ</A>.
- </P>
-
-<HR>
-<H2><A NAME="5">class locale</A></H2>
- <P> Notes made during the implementation of locales can be found
- <A HREF="locale.html">here</A>.
- </P>
- <P>Return <A HREF="#top">to top of page</A> or
- <A HREF="../faq/index.html">to the FAQ</A>.
- </P>
-
-<HR>
-<H2><A NAME="4">class codecvt</A></H2>
- <P> Notes made during the implementation of codecvt can be found
- <A HREF="codecvt.html">here</A>.
- </P>
-
- <P> The following is the abstract from the implementation notes:
-<BLOCKQUOTE>
- The standard class codecvt attempts to address conversions
-between different character encoding schemes. In particular, the
-standard attempts to detail conversions between the
-implementation-defined wide characters (hereafter referred to as
-wchar_t) and the standard type char that is so beloved in classic
-&quot;C&quot; (which can now be referred to as narrow characters.)
-This document attempts to describe how the GNU libstdc++-v3
-implementation deals with the conversion between wide and narrow
-characters, and also presents a framework for dealing with the huge
-number of other encodings that iconv can convert, including Unicode
-and UTF8. Design issues and requirements are addressed, and examples
-of correct usage for both the required specializations for wide and
-narrow characters and the implementation-provided extended
-functionality are given.
-</BLOCKQUOTE>
-
- <P>Return <A HREF="#top">to top of page</A> or
- <A HREF="../faq/index.html">to the FAQ</A>.
- </P>
-
-<HR>
-<H2><A NAME="5">class ctype</A></H2>
- <P> Notes made during the implementation of ctype can be found
- <A HREF="ctype.html">here</A>.
- </P>
- <P>Return <A HREF="#top">to top of page</A> or
- <A HREF="../faq/index.html">to the FAQ</A>.
- </P>
-
-<HR>
-<H2><A NAME="6">Correct Transformations</A></H2>
- <!-- Jumping directly here from chapter 21. -->
- <P>A very common question on newsgroups and mailing lists is, &quot;How
+ </em></blockquote>
+ </p>
+
+<hr>
+<h2><a name="6">Nathan Myers on Locales</a></h2>
+ <p>An article entitled &quot;The Standard C++ Locale&quot; was
+ published in Dr. Dobb's Journal and can be found
+ <a href="http://www.cantrip.org/locale.html">here</a>.
+ </p>
+
+<hr>
+<h2><a name="7">Correct Transformations</a></h2>
+ <!-- Jumping directly to here from chapter 21. -->
+ <p>A very common question on newsgroups and mailing lists is, &quot;How
do I do &lt;foo&gt; to a character string?&quot; where &lt;foo&gt; is
a task such as changing all the letters to uppercase, to lowercase,
testing for digits, etc. A skilled and conscientious programmer
will follow the question with another, &quot;And how do I make the
code portable?&quot;
- </P>
- <P>(Poor innocent programmer, you have no idea the depths of trouble
+ </p>
+ <p>(Poor innocent programmer, you have no idea the depths of trouble
you are getting yourself into. 'Twould be best for your sanity if
you dropped the whole idea and took up basket weaving instead. No?
Fine, you asked for it...)
- </P>
- <P>The task of changing the case of a letter or classifying a character
+ </p>
+ <p>The task of changing the case of a letter or classifying a character
as numeric, graphical, etc, all depends on the cultural context of the
program at runtime. So, first you must take the portability question
into account. Once you have localized the program to a particular
natural language, only then can you perform the specific task.
Unfortunately, specializing a function for a human language is not
as simple as declaring
- <TT> extern &quot;Danish&quot; int tolower (int); </TT>.
- </P>
- <P>The C++ code to do all this proceeds in the same way. First, a locale
+ <code> extern &quot;Danish&quot; int tolower (int); </code>.
+ </p>
+ <p>The C++ code to do all this proceeds in the same way. First, a locale
is created. Then member functions of that locale are called to
perform minor tasks. Continuing the example from Chapter 21, we wish
to use the following convenience functions:
- <PRE>
+ <pre>
namespace std {
template &lt;class charT&gt;
charT
@@ -146,22 +139,22 @@ functionality are given.
template &lt;class charT&gt;
charT
tolower (charT c, const locale&amp; loc) const;
- }</PRE>
+ }</pre>
This function extracts the appropriate &quot;facet&quot; from the
- locale <EM>loc</EM> and calls the appropriate member function of that
- facet, passing <EM>c</EM> as its argument. The resulting character
+ locale <em>loc</em> and calls the appropriate member function of that
+ facet, passing <em>c</em> as its argument. The resulting character
is returned.
- </P>
- <P>For the C/POSIX locale, the results are the same as calling the
- classic C <TT>toupper/tolower</TT> function that was used in previous
+ </p>
+ <p>For the C/POSIX locale, the results are the same as calling the
+ classic C <code>toupper/tolower</code> function that was used in previous
examples. For other locales, the code should Do The Right Thing.
- </P>
- <P>Of course, these functions take a second argument, and the
+ </p>
+ <p>Of course, these functions take a second argument, and the
transformation algorithm's operator argument can only take a single
parameter. So we write simple wrapper structs to handle that.
- </P>
- <P>The next-to-final version of the code started in Chapter 21 looks like:
- <PRE>
+ </p>
+ <p>The next-to-final version of the code started in Chapter 21 looks like:
+ <pre>
#include &lt;iterator&gt; // for back_inserter
#include &lt;locale&gt;
#include &lt;string&gt;
@@ -187,7 +180,7 @@ functionality are given.
int main ()
{
std::string s ("Some Kind Of Initial Input Goes Here");
- Toupper up ( std::locale("C") );
+ Toupper up ( std::locale("C") );
Tolower down ( std::locale("C") );
// Change everything into upper case
@@ -206,30 +199,24 @@ functionality are given.
std::transform (s.begin(), s.end(), std::back_inserter(capital_s),
up
);
- }</PRE>
- </P>
- <P>The final version of the code uses <TT>bind2nd</TT> to eliminate
+ }</pre>
+ </p>
+ <p>The final version of the code uses <code>bind2nd</code> to eliminate
the wrapper structs, but the resulting code is tricky. I have not
shown it here because no compilers currently available to me will
handle it.
- </P>
- <P>Return <A HREF="#top">to top of page</A> or
- <A HREF="../faq/index.html">to the FAQ</A>.
- </P>
-
-
+ </p>
<!-- ####################################################### -->
-<HR>
-<P CLASS="fineprint"><EM>
+<hr>
+<p class="fineprint"><em>
+See <a href="../17_intro/license.html">license.html</a> for copying conditions.
Comments and suggestions are welcome, and may be sent to
-<A HREF="mailto:pme@sources.redhat.com">Phil Edwards</A> or
-<A HREF="mailto:gdr@gcc.gnu.org">Gabriel Dos Reis</A>.
-<BR> $Id: howto.html,v 1.1 2000/12/10 04:04:55 pme Exp $
-</EM></P>
+<a href="mailto:libstdc++@gcc.gnu.org">the libstdc++ mailing list</a>.
+</em></p>
-</BODY>
-</HTML>
+</body>
+</html>
diff --git a/libstdc++-v3/docs/html/22_locale/locale.html b/libstdc++-v3/docs/html/22_locale/locale.html
index 2bbb4bd5e9f..859050f23fa 100644
--- a/libstdc++-v3/docs/html/22_locale/locale.html
+++ b/libstdc++-v3/docs/html/22_locale/locale.html
@@ -1,45 +1,45 @@
-<HTML>
-<HEAD>
- <H1>
+<html>
+<head>
+ <h1>
Notes on the locale implementation.
- </H1>
-</HEAD>
+ </h1>
+</head>
<I>
-prepared by Benjamin Kosnik (bkoz@redhat.com) on January 24, 2001
+prepared by Benjamin Kosnik (bkoz@redhat.com) on August 8, 2001
</I>
-<P>
-<H2>
+<p>
+<h2>
1. Abstract Describes the basic locale object, including nested
classes id, facet, and the reference-counted implementation object,
class _Impl.
-</H2>
-<P>
-</P>
+</h2>
+<p>
+</p>
-<P>
-<H2>
+<p>
+<h2>
2. What the standard says
See Chapter 22 of the standard.
-</H2>
+</h2>
-<P>
-<H2>
+<p>
+<h2>
3. Problems with &quot;C&quot; locales : global locales, termination.
-</H2>
+</h2>
-<P>
+<p>
The major problem is fitting an object-orientated and non-global locale
design ontop of POSIX and other relevant stanards, which include the
Single Unix (nee X/Open.)
Because POSIX falls down so completely, portibility is an issue.
-<P>
+<p>
-<H2>
+<h2>
4. Design
-</H2>
+</h2>
Class locale in non-templatized and has three distinct types nested
inside of it:
@@ -48,7 +48,7 @@ class facet
Facets actually implement locale functionality. For instance, a facet
called numpunct is the data objects that can be used to query for the
-thousands seperator is in the German locale.
+thousands separator is in the German locale.
Literally, a facet is strictly defined:
- containing
@@ -69,65 +69,76 @@ Provides an index for looking up specific facets.
class _Impl
-<P>
-<H2>
+<p>
+<h2>
5. Examples
-</H2>
+</h2>
<pre>
typedef __locale_t locale;
</pre>
More information can be found in the following testcases:
-<UL>
-<LI> testsuite/22_locale/ctype_char_members.cc
-<LI> testsuite/22_locale/ctype_wchar_t_members.cc
-</UL>
+<ul>
+<li> testsuite/22_locale/ctype_char_members.cc
+<li> testsuite/22_locale/ctype_wchar_t_members.cc
+</ul>
-<P>
-<H2>
+<p>
+<h2>
6. Unresolved Issues
-</H2>
+</h2>
-<UL>
- <LI> locale -a displays available locales on linux
+<ul>
+ <li> locale -a displays available locales on linux
- <LI> locale initialization: at what point does _S_classic,
+ <li> locale initialization: at what point does _S_classic,
_S_global get initialized? Can named locales assume this
initialization has already taken place?
-</UL>
+ <li> document how named locales error check when filling data
+ members. Ie, a fr_FR locale that doesn't have
+ numpunct::truename(): does it use "true"? Or is it a blank
+ string? What's the convention?
-<P>
-<H2>
+ <li> explain how locale aliasing happens. When does "de_DE"
+ use "de" information? What is the rule for locales composed of
+ just an ISO language code (say, "de") and locales with both an
+ ISO language code and ISO country code (say, "de_DE").
+
+ <li> what should non-required facet instantiations do? If the
+ generic implemenation is provided, then how to end-users
+ provide specializations?
+</ul>
+
+<p>
+<h2>
7. Acknowledgments
-</H2>
+</h2>
-<P>
-<H2>
+<p>
+<h2>
8. Bibliography / Referenced Documents
-</H2>
+</h2>
Drepper, Ulrich, GNU libc (glibc) 2.2 manual. In particular, Chapters &quot;6. Character Set Handling&quot; and &quot;7 Locales and Internationalization&quot;
-<P>
+<p>
Drepper, Ulrich, Numerous, late-night email correspondence
-<P>
+<p>
ISO/IEC 14882:1998 Programming languages - C++
-<P>
+<p>
ISO/IEC 9899:1999 Programming languages - C
-<P>
+<p>
Langer, Angelika and Klaus Kreft, Standard C++ IOStreams and Locales, Advanced Programmer's Guide and Reference, Addison Wesley Longman, Inc. 2000
-<P>
+<p>
Stroustrup, Bjarne, Appendix D, The C++ Programming Language, Special Edition, Addison Wesley, Inc. 2000
-<P>
+<p>
System Interface Definitions, Issue 6 (IEEE Std. 1003.1-200x)
The Open Group/The Institute of Electrical and Electronics Engineers, Inc.
http://www.opennc.org/austin/docreg.html
-
-
diff --git a/libstdc++-v3/docs/html/22_locale/messages.html b/libstdc++-v3/docs/html/22_locale/messages.html
new file mode 100644
index 00000000000..906bff86784
--- /dev/null
+++ b/libstdc++-v3/docs/html/22_locale/messages.html
@@ -0,0 +1,404 @@
+<html>
+<head>
+ <h1>
+ Notes on the messages implementation.
+ </h1>
+</head>
+<I>
+prepared by Benjamin Kosnik (bkoz@redhat.com) on August 8, 2001
+</I>
+
+<p>
+<h2>
+1. Abstract
+</h2>
+<p>
+The std::messages facet implements message retrieval functionality
+equivalent to Java's java.text.MessageFormat .using either GNU gettext
+or IEEE 1003.1-200 functions.
+</p>
+
+<p>
+<h2>
+2. What the standard says
+</h2>
+The std::messages facet is probably the most vaguely defined facet in
+the standard library. It's assumed that this facility was built into
+the standard library in order to convert string literals from one
+locale to the other. For instance, converting the "C" locale's
+<code>const char* c = "please"</code> to a German-localized <code>"bitte"</code>
+during program execution.
+
+<BLOCKQUOTE>
+22.2.7.1 - Template class messages [lib.locale.messages]
+</BLOCKQUOTE>
+
+This class has three public member functions, which directly
+correspond to three protected virtual member functions.
+
+The public member functions are:
+
+<p>
+<code>catalog open(const basic_string<char>&, const locale&) const</code>
+
+<p>
+<code>string_type get(catalog, int, int, const string_type&) const</code>
+
+<p>
+<code>void close(catalog) const</code>
+
+<p>
+While the virtual functions are:
+
+<p>
+<code>catalog do_open(const basic_string<char>&, const locale&) const</code>
+<BLOCKQUOTE>
+<I>
+-1- Returns: A value that may be passed to get() to retrieve a
+message, from the message catalog identified by the string name
+according to an implementation-defined mapping. The result can be used
+until it is passed to close(). Returns a value less than 0 if no such
+catalog can be opened.
+</I>
+</BLOCKQUOTE>
+
+<p>
+<code>string_type do_get(catalog, int, int, const string_type&) const</code>
+<BLOCKQUOTE>
+<I>
+-3- Requires: A catalog cat obtained from open() and not yet closed.
+-4- Returns: A message identified by arguments set, msgid, and dfault,
+according to an implementation-defined mapping. If no such message can
+be found, returns dfault.
+</I>
+</BLOCKQUOTE>
+
+<p>
+<code>void do_close(catalog) const</code>
+<BLOCKQUOTE>
+<I>
+-5- Requires: A catalog cat obtained from open() and not yet closed.
+-6- Effects: Releases unspecified resources associated with cat.
+-7- Notes: The limit on such resources, if any, is implementation-defined.
+</I>
+</BLOCKQUOTE>
+
+
+<p>
+<h2>
+3. Problems with &quot;C&quot; messages: thread safety,
+over-specification, and assumptions.
+</h2>
+A couple of notes on the standard.
+
+<p>
+First, why is <code>messages_base::catalog</code> specified as a typedef
+to int? This makes sense for implementations that use
+<code>catopen</code>, but not for others. Fortunately, it's not heavily
+used and so only a minor irritant.
+
+<p>
+Second, by making the member functions <code>const</code>, it is
+impossible to save state in them. Thus, storing away information used
+in the 'open' member function for use in 'get' is impossible. This is
+unfortunate.
+
+<p>
+The 'open' member function in particular seems to be oddly
+designed. The signature seems quite peculiar. Why specify a <code>const
+string& </code> argument, for instance, instead of just <code>const
+char*</code>? Or, why specify a <code>const locale&</code> argument that is
+to be used in the 'get' member function? How, exactly, is this locale
+argument useful? What was the intent? It might make sense if a locale
+argument was associated with a given default message string in the
+'open' member function, for instance. Quite murky and unclear, on
+reflection.
+
+<p>
+Lastly, it seems odd that messages, which explicitly require code
+conversion, don't use the codecvt facet. Because the messages facet
+has only one template parameter, it is assumed that ctype, and not
+codecvt, is to be used to convert between character sets.
+
+<p>
+It is implicitly assumed that the locale for the default message
+string in 'get' is in the "C" locale. Thus, all source code is assumed
+to be written in English, so translations are always from "en_US" to
+other, explicitly named locales.
+
+<p>
+<h2>
+4. Design and Implementation Details
+</h2>
+This is a relatively simple class, on the face of it. The standard
+specifies very little in concrete terms, so generic implementations
+that are conforming yet do very little are the norm. Adding
+functionality that would be useful to programmers and comparable to
+Java's java.text.MessageFormat takes a bit of work, and is highly
+dependent on the capabilities of the underlying operating system.
+
+<p>
+Three different mechanisms have been provided, selectable via
+configure flags:
+
+<ul>
+ <li> generic
+ <p>
+ This model does very little, and is what is used by default.
+ </p>
+
+ <li> gnu
+ <p>
+ The gnu model is complete and fully tested. It's based on the
+ GNU gettext package, which is part of glibc. It uses the functions
+ <code>textdomain, bindtextdomain, gettext</code>
+ to implement full functionality. Creating message
+ catalogs is a relatively straight-forward process and is
+ lightly documented below, and fully documented in gettext's
+ distributed documentation.
+ </p>
+
+ <li> ieee_1003.1-200x
+ <p>
+ This is a complete, though untested, implementation based on
+ the IEEE standard. The functions
+ <code>catopen, catgets, catclose</code>
+ are used to retrieve locale-specific messages given the
+ appropriate message catalogs that have been constructed for
+ their use. Note, the script <code> po2msg.sed</code> that is part
+ of the gettext distribution can convert gettext catalogs into
+ catalogs that <code>catopen</code> can use.
+ </p>
+</ul>
+
+<p>
+A new, standards-conformant non-virtual member function signature was
+added for 'open' so that a directory could be specified with a given
+message catalog. This simplifies calling conventions for the gnu
+model.
+
+<p>
+The rest of this document discusses details of the GNU model.
+
+<p>
+The messages facet, because it is retrieving and converting between
+characters sets, depends on the ctype and perhaps the codecvt facet in
+a given locale. In addition, underlying "C" library locale support is
+necessary for more than just the <code>LC_MESSAGES</code> mask:
+<code>LC_CTYPE</code> is also necessary. To avoid any unpleasantness, all
+bits of the "C" mask (ie <code>LC_ALL</code>) are set before retrieving
+messages.
+
+<p>
+Making the message catalogs can be initially tricky, but become quite
+simple with practice. For complete info, see the gettext
+documentation. Here's an idea of what is required:
+
+<ul>
+ <LI > Make a source file with the required string literals
+ that need to be translated. See
+ <code>intl/string_literals.cc</code> for an example.
+
+ <p>
+ <li> Make initial catalog (see "4 Making the PO Template File"
+ from the gettext docs).
+ <p>
+ <code> xgettext --c++ --debug string_literals.cc -o libstdc++.pot </code>
+
+ <p>
+ <li> Make language and country-specific locale catalogs.
+ <p>
+ <code>cp libstdc++.pot fr_FR.po</code>
+ <p>
+ <code>cp libstdc++.pot de_DE.po</code>
+
+ <p>
+ <li> Edit localized catalogs in emacs so that strings are
+ translated.
+ <p>
+ <code>emacs fr_FR.po</code>
+
+ <p>
+ <li> Make the binary mo files.
+ <p>
+ <code>msgfmt fr_FR.po -o fr_FR.mo</code>
+ <p>
+ <code>msgfmt de_DE.po -o de_DE.mo</code>
+
+ <p>
+ <li> Copy the binary files into the correct directory structure.
+ <p>
+ <code>cp fr_FR.mo (dir)/fr_FR/LC_MESSAGES/libstdc++-v3.mo</code>
+ <p>
+ <code>cp de_DE.mo (dir)/de_DE/LC_MESSAGES/libstdc++-v3.mo</code>
+
+ <p>
+ <li> Use the new message catalogs.
+ <p>
+ <code>locale loc_de("de_DE");</code>
+ <p>
+ <code>
+ use_facet<messages<char> >(loc_de).open("libstdc++", locale(), dir);
+ </code>
+</ul>
+
+<p>
+<h2>
+5. Examples
+</h2>
+
+<ul>
+ <li> message converting, simple example using the GNU model.
+
+<pre>
+#include <locale>
+
+void test01()
+{
+ using namespace std;
+ typedef std::messages<char>::catalog catalog;
+
+ // Set to the root directory of the libstdc++.mo catalogs.
+ const char* dir = LOCALEDIR;
+ locale loc_de("de_DE");
+
+ // Cache the messages facet.
+ const messages<char>& mssg_de = use_facet<messages<char> >(loc_de);
+
+ // Check German (de_DE) locale.
+ catalog cat_de = mssg_de.open("libstdc++", loc_c, dir);
+ string s01 = mssg_de.get(cat_de, 0, 0, "please");
+ string s02 = mssg_de.get(cat_de, 0, 0, "thank you");
+ // s01 == "bitte"
+ // s02 == "danke"
+ mssg_de.close(cat_de);
+}
+</pre>
+</ul>
+
+More information can be found in the following testcases:
+<ul>
+<li> testsuite/22_locale/messages.cc
+<li> testsuite/22_locale/messages_byname.cc
+<li> testsuite/22_locale/messages_char_members.cc
+</ul>
+
+<p>
+<h2>
+6. Unresolved Issues
+</h2>
+<ul>
+<li> Things that are sketchy, or remain unimplemented:
+ <ul>
+ <li>_M_convert_from_char, _M_convert_to_char are in
+ flux, depending on how the library ends up doing
+ character set conversions. It might not be possible to
+ do a real character set based conversion, due to the
+ fact that the template parameter for messages is not
+ enough to instantiate the codecvt facet (1 supplied,
+ need at least 2 but would prefer 3).
+
+ <li> There are issues with gettext needing the global
+ locale set to extract a message. This dependence on
+ the global locale makes the current "gnu" model non
+ MT-safe. Future versions of glibc, ie glibc 2.3.x will
+ fix this, and the C++ library bits are already in
+ place.
+ </ul>
+
+<p>
+<li> Development versions of the GNU "C" library, glibc 2.3 will allow
+ a more efficient, MT implementation of std::messages, and will
+ allow the removal of the _M_name_messages data member. If this
+ is done, it will change the library ABI. The C++ parts to
+ support glibc 2.3 have already been coded, but are not in use:
+ once this version of the "C" library is released, the marked
+ parts of the messages implementation can be switched over to
+ the new "C" library functionality.
+<p>
+<li> At some point in the near future, std::numpunct will probably use
+ std::messages facilities to implement truename/falename
+ correctly. This is currently not done, but entries in
+ libstdc++.pot have already been made for "true" and "false"
+ string literals, so all that remains is the std::numpunct
+ coding and the configure/make hassles to make the installed
+ library search its own catalog. Currently the libstdc++.mo
+ catalog is only searched for the testsuite cases involving
+ messages members.
+
+<p>
+<li> The following member functions:
+
+ <p>
+ <code>
+ catalog
+ open(const basic_string<char>& __s, const locale& __loc) const
+ </code>
+
+ <p>
+ <code>
+ catalog
+ open(const basic_string<char>&, const locale&, const char*) const;
+ </code>
+
+ <p>
+ Don't actually return a "value less than 0 if no such catalog
+ can be opened" as required by the standard in the "gnu"
+ model. As of this writing, it is unknown how to query to see
+ if a specified message catalog exists using the gettext
+ package.
+</ul>
+
+<p>
+<h2>
+7. Acknowledgments
+</h2>
+Ulrich Drepper for the character set explanations, gettext details,
+and patient answering of late-night questions, Tom Tromey for the java details.
+
+
+<p>
+<h2>
+8. Bibliography / Referenced Documents
+</h2>
+
+Drepper, Ulrich, GNU libc (glibc) 2.2 manual. In particular, Chapters
+&quot;7 Locales and Internationalization&quot;
+
+<p>
+Drepper, Ulrich, Thread-Aware Locale Model, A proposal. This is a
+draft document describing the design of glibc 2.3 MT locale
+functionality.
+
+<p>
+Drepper, Ulrich, Numerous, late-night email correspondence
+
+<p>
+ISO/IEC 9899:1999 Programming languages - C
+
+<p>
+ISO/IEC 14882:1998 Programming languages - C++
+
+<p>
+Java 2 Platform, Standard Edition, v 1.3.1 API Specification. In
+particular, java.util.Properties, java.text.MessageFormat,
+java.util.Locale, java.util.ResourceBundle.
+http://java.sun.com/j2se/1.3/docs/api
+
+<p>
+System Interface Definitions, Issue 7 (IEEE Std. 1003.1-200x)
+The Open Group/The Institute of Electrical and Electronics Engineers, Inc.
+In particular see lines 5268-5427.
+http://www.opennc.org/austin/docreg.html
+
+<p> GNU gettext tools, version 0.10.38, Native Language Support
+Library and Tools.
+http://sources.redhat.com/gettext
+
+<p>
+Langer, Angelika and Klaus Kreft, Standard C++ IOStreams and Locales,
+Advanced Programmer's Guide and Reference, Addison Wesley Longman,
+Inc. 2000. See page 725, Internationalized Messages.
+
+<p>
+Stroustrup, Bjarne, Appendix D, The C++ Programming Language, Special Edition, Addison Wesley, Inc. 2000
diff --git a/libstdc++-v3/docs/html/23_containers/howto.html b/libstdc++-v3/docs/html/23_containers/howto.html
index a6c0afc0d4b..7684bcab5ae 100644
--- a/libstdc++-v3/docs/html/23_containers/howto.html
+++ b/libstdc++-v3/docs/html/23_containers/howto.html
@@ -1,245 +1,408 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-<HEAD>
- <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
- <META NAME="AUTHOR" CONTENT="pme@sources.redhat.com (Phil Edwards)">
- <META NAME="KEYWORDS" CONTENT="HOWTO, libstdc++, GCC, g++, libg++, STL">
- <META NAME="DESCRIPTION" CONTENT="HOWTO for the libstdc++ chapter 23.">
- <META NAME="GENERATOR" CONTENT="vi and eight fingers">
- <TITLE>libstdc++-v3 HOWTO: Chapter 23</TITLE>
-<LINK REL=StyleSheet HREF="../lib3styles.css">
-<!-- $Id: howto.html,v 1.4 2000/12/03 23:47:48 jsm28 Exp $ -->
-</HEAD>
-<BODY>
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="AUTHOR" content="pme@gcc.gnu.org (Phil Edwards)">
+ <meta name="KEYWORDS" content="HOWTO, libstdc++, GCC, g++, libg++, STL">
+ <meta name="DESCRIPTION" content="HOWTO for the libstdc++ chapter 23.">
+ <meta name="GENERATOR" content="vi and eight fingers">
+ <title>libstdc++-v3 HOWTO: Chapter 23</title>
+<link rel="StyleSheet" href="../lib3styles.css">
+</head>
+<body>
-<H1 CLASS="centered"><A NAME="top">Chapter 23: Containers</A></H1>
+<h1 class="centered"><a name="top">Chapter 23: Containers</a></h1>
-<P>Chapter 23 deals with container classes and what they offer.
-</P>
+<p>Chapter 23 deals with container classes and what they offer.
+</p>
<!-- ####################################################### -->
-<HR>
-<H1>Contents</H1>
-<UL>
- <LI><A HREF="#1">Making code unaware of the container/array difference</A>
- <LI><A HREF="#2">Variable-sized bitmasks</A>
- <LI><A HREF="#3">Containers and multithreading</A>
-</UL>
+<hr>
+<h1>Contents</h1>
+<ul>
+ <li><a href="#1">Making code unaware of the container/array difference</a>
+ <li><a href="#2">Variable-sized bitmasks</a>
+ <li><a href="#3">Containers and multithreading</a>
+ <li><a href="#4">&quot;Hinting&quot; during insertion</a>
+ <li><a href="#5">Bitmasks and string arguments</a>
+</ul>
-<HR>
+<hr>
<!-- ####################################################### -->
-<H2><A NAME="1">Making code unaware of the container/array difference</A></H2>
- <P>You're writing some code and can't decide whether to use builtin
+<h2><a name="1">Making code unaware of the container/array difference</a></h2>
+ <p>You're writing some code and can't decide whether to use builtin
arrays or some kind of container. There are compelling reasons
to use one of the container classes, but you're afraid that you'll
eventually run into difficulties, change everything back to arrays,
and then have to change all the code that uses those data types to
keep up with the change.
- </P>
- <P>If your code makes use of the standard algorithms, this isn't as
+ </p>
+ <p>If your code makes use of the standard algorithms, this isn't as
scary as it sounds. The algorithms don't know, nor care, about
the kind of &quot;container&quot; on which they work, since the
algorithms are only given endpoints to work with. For the container
- classes, these are iterators (usually <TT>begin()</TT> and
- <TT>end()</TT>, but not always). For builtin arrays, these are
- the address of the first element and the past-the-end element.
- <!-- a good explanation of the past-the-end rules is in order,
- probably a link somewhere
- -->
- </P>
- <P>Some very simple wrapper functions can hide all of that from the
+ classes, these are iterators (usually <code>begin()</code> and
+ <code>end()</code>, but not always). For builtin arrays, these are
+ the address of the first element and the
+ <a href="../24_iterators/howto.html#2">past-the-end</a> element.
+ </p>
+ <p>Some very simple wrapper functions can hide all of that from the
rest of the code. For example, a pair of functions called
- <TT>beginof</TT> can be written, one that takes an array, another
+ <code>beginof</code> can be written, one that takes an array, another
that takes a vector. The first returns a pointer to the first
- element, and the second returns the vector's <TT>begin()</TT>
+ element, and the second returns the vector's <code>begin()</code>
iterator.
- </P>
- <P>The functions should be made template functions, and should also
+ </p>
+ <p>The functions should be made template functions, and should also
be declared inline. As pointed out in the comments in the code
- below, this can lead to <TT>beginof</TT> being optimized out of
+ below, this can lead to <code>beginof</code> being optimized out of
existence, so you pay absolutely nothing in terms of increased
code size or execution time.
- </P>
- <P>The result is that if all your algorithm calls look like
- <PRE>
- std::transform(beginof(foo), endof(foo), beginof(foo), SomeFunction);</PRE>
+ </p>
+ <p>The result is that if all your algorithm calls look like
+ <pre>
+ std::transform(beginof(foo), endof(foo), beginof(foo), SomeFunction);</pre>
then the type of foo can change from an array of ints to a vector
of ints to a deque of ints and back again, without ever changing any
client code.
- </P>
- <P>This author has a collection of such functions, called &quot;*of&quot;
+ </p>
+ <p>This author has a collection of such functions, called &quot;*of&quot;
because they all extend the builtin &quot;sizeof&quot;. It started
with some Usenet discussions on a transparent way to find the length
of an array. A simplified and much-reduced version for easier
- reading is <A HREF="wrappers_h.txt">given here</A>.
- </P>
- <P>Astute readers will notice two things at once: first, that the
- container class is still a <TT>vector&lt;T&gt;</TT> instead of a
- more general <TT>Container&lt;T&gt;</TT>. This would mean that
- three functions for <TT>deque</TT> would have to be added, another
- three for <TT>list</TT>, and so on. This is due to problems with
+ reading is <a href="wrappers_h.txt">given here</a>.
+ </p>
+ <p>Astute readers will notice two things at once: first, that the
+ container class is still a <code>vector&lt;T&gt;</code> instead of a
+ more general <code>Container&lt;T&gt;</code>. This would mean that
+ three functions for <code>deque</code> would have to be added, another
+ three for <code>list</code>, and so on. This is due to problems with
getting template resolution correct; I find it easier just to
give the extra three lines and avoid confusion.
- </P>
- <P>Second, the line
- <PRE>
- inline unsigned int lengthof (T (&)[sz]) { return sz; } </PRE>
+ </p>
+ <p>Second, the line
+ <pre>
+ inline unsigned int lengthof (T (&amp;)[sz]) { return sz; } </pre>
looks just weird! Hint: unused parameters can be left nameless.
- </P>
- <P>Return <A HREF="#top">to top of page</A> or
- <A HREF="../faq/index.html">to the FAQ</A>.
- </P>
-
-<HR>
-<H2><A NAME="2">Variable-sized bitmasks</A></H2>
- <P>No, you cannot write code of the form
+ </p>
+ <p>Return <a href="#top">to top of page</a> or
+ <a href="../faq/index.html">to the FAQ</a>.
+ </p>
+
+<hr>
+<h2><a name="2">Variable-sized bitmasks</a></h2>
+ <p>No, you cannot write code of the form
<!-- Careful, the leading spaces in PRE show up directly. -->
- <PRE>
+ <pre>
#include &lt;bitset&gt;
void foo (size_t n)
{
std::bitset&lt;n&gt; bits;
....
- } </PRE>
- because <TT>n</TT> must be known at compile time. Your compiler is
+ } </pre>
+ because <code>n</code> must be known at compile time. Your compiler is
correct; it is not a bug. That's the way templates work. (Yes, it
- <EM>is</EM> a feature.)
- </P>
- <P>There are a couple of ways to handle this kind of thing. Please
+ <em>is</em> a feature.)
+ </p>
+ <p>There are a couple of ways to handle this kind of thing. Please
consider all of them before passing judgement. They include, in
no particular order:
- <UL>
- <LI>A very large N in <TT>bitset&lt;N&gt;</TT>.
- <LI>A container&lt;bool&gt;.
- <LI>Extremely weird solutions.
- </UL>
- </P>
- <P><B>A very large N in <TT>bitset&lt;N&gt;</TT>.&nbsp;&nbsp;</B> It has
+ <ul>
+ <li>A very large N in <code>bitset&lt;N&gt;</code>.
+ <li>A container&lt;bool&gt;.
+ <li>Extremely weird solutions.
+ </ul>
+ </p>
+ <p><strong>A very large N in
+ <code>bitset&lt;N&gt;</code>.&nbsp;&nbsp;</strong> It has
been pointed out a few times in newsgroups that N bits only takes up
(N/8) bytes on most systems, and division by a factor of eight is pretty
impressive when speaking of memory. Half a megabyte given over to a
bitset (recall that there is zero space overhead for housekeeping info;
it is known at compile time exactly how large the set is) will hold over
four million bits. If you're using those bits as status flags (e.g.,
- &quot;changed&quot;/&quot;unchanged&quot; flags), that's a <EM>lot</EM>
+ &quot;changed&quot;/&quot;unchanged&quot; flags), that's a <em>lot</em>
of state.
- </P>
- <P>You can then keep track of the &quot;maximum bit used&quot; during some
+ </p>
+ <p>You can then keep track of the &quot;maximum bit used&quot; during some
testing runs on representative data, make note of how many of those bits
really need to be there, and then reduce N to a smaller number. Leave
some extra space, of course. (If you plan to write code like the
incorrect example above, where the bitset is a local variable, then you
may have to talk your compiler into allowing that much stack space;
- there may be zero spae overhead, but it's all allocated inside the
+ there may be zero space overhead, but it's all allocated inside the
object.)
- </P>
- <P><B>A container&lt;bool&gt;.&nbsp;&nbsp;</B> The Committee made provision
+ </p>
+ <p><strong>A container&lt;bool&gt;.&nbsp;&nbsp;</strong> The Committee
+ made provision
for the space savings possible with that (N/8) usage previously mentioned,
so that you don't have to do wasteful things like
- <TT>Container&lt;char&gt;</TT> or <TT>Container&lt;short int&gt;</TT>.
- Specifically, <TT>vector&lt;bool&gt;</TT> is required to be
+ <code>Container&lt;char&gt;</code> or
+ <code>Container&lt;short int&gt;</code>.
+ Specifically, <code>vector&lt;bool&gt;</code> is required to be
specialized for that space savings.
- </P>
- <P>The problem is that <TT>vector&lt;bool&gt;</TT> doesn't behave like a
+ </p>
+ <p>The problem is that <code>vector&lt;bool&gt;</code> doesn't behave like a
normal vector anymore. There have been recent journal articles which
discuss the problems (the ones by Herb Sutter in the May and
July/August 1999 issues of
- <EM>C++ Report</EM> cover it well). Future revisions of the ISO C++
- Standard will change the requirement for <TT>vector&lt;bool&gt;</TT>
- specialization. In the meantime, <TT>deque&lt;bool&gt;</TT> is
+ <u>C++ Report</u> cover it well). Future revisions of the ISO C++
+ Standard will change the requirement for <code>vector&lt;bool&gt;</code>
+ specialization. In the meantime, <code>deque&lt;bool&gt;</code> is
recommended (although its behavior is sane, you probably will not get
the space savings, but the allocation scheme is different than that
of vector).
- </P>
- <P><B>Extremely weird solutions.&nbsp;&nbsp;</B> If you have access to
+ </p>
+ <p><strong>Extremely weird solutions.&nbsp;&nbsp;</strong> If you have
+ access to
the compiler and linker at runtime, you can do something insane, like
figuring out just how many bits you need, then writing a temporary
- source code file. That file contains an instantiation of <TT>bitset</TT>
+ source code file. That file contains an instantiation of
+ <code>bitset</code>
for the required number of bits, inside some wrapper functions with
unchanging signatures. Have your program then call the
- compiler on that file using Position Independant Code, then open the
+ compiler on that file using Position Independent Code, then open the
newly-created object file and load those wrapper functions. You'll have
- an instantiation of <TT>bitset&lt;N&gt;</TT> for the exact <TT>N</TT>
+ an instantiation of <code>bitset&lt;N&gt;</code> for the exact
+ <code>N</code>
that you need at the time. Don't forget to delete the temporary files.
- (Yes, this <EM>can</EM> be, and <EM>has been</EM>, done.)
- </P>
+ (Yes, this <em>can</em> be, and <em>has been</em>, done.)
+ </p>
<!-- I wonder if this next paragraph will get me in trouble... -->
- <P>This would be the approach of either a visionary genius or a raving
+ <p>This would be the approach of either a visionary genius or a raving
lunatic, depending on your programming and management style. Probably
the latter.
- </P>
- <P>Which of the above techniques you use, if any, are up to you and your
+ </p>
+ <p>Which of the above techniques you use, if any, are up to you and your
intended application. Some time/space profiling is indicated if it
really matters (don't just guess). And, if you manage to do anything
along the lines of the third category, the author would love to hear
from you...
- </P>
- <P>Return <A HREF="#top">to top of page</A> or
- <A HREF="../faq/index.html">to the FAQ</A>.
- </P>
-
-<HR>
-<H2><A NAME="3">Containers and multithreading</A></H2>
- <P>This section will mention some of the problems in designing MT
- programs that use Standard containers. For information on other
- aspects of multithreading (e.g., the library as a whole), see
- the Received Wisdom on Chapter 17.
- </P>
- <P>An excellent page to read when working with templatized containers
- and threads is
- <A HREF="http://www.sgi.com/Technology/STL/thread_safety.html">SGI's
- http://www.sgi.com/Technology/STL/thread_safety.html</A>. The
- libstdc++-v3 uses the same definition of thread safety
- when discussing design. A key point that beginners may miss is the
- fourth major paragraph (&quot;For most clients,&quot;...), pointing
- out that locking must nearly always be done outside the container,
- by client code (that'd be you, not us *grin*).
- </P>
- <P>You didn't read it, did you? *sigh* I'm serious, go read the
- SGI page. It's really good and doesn't take long, and makes most
- of the points that would otherwise have to be made here (and does
- a better job).
- </P>
- <P>That's much better. Now, the issue of MT has been brought up on
- the libstdc++-v3 mailing list as well as the main GCC mailing list
- several times. The Chapter 17 HOWTO has some links into the mail
- archives, so you can see what's been thrown around. The usual
- container (or pseudo-container, depending on how you look at it)
- that people have in mind is <TT>string</TT>, which is one of the
- points where libstdc++ departs from the SGI STL. As of the
- 2.90.8 snapshot, the libstdc++-v3 string class is safe for
- certain kinds of multithreaded access.
- </P>
- <P>For implementing a container which does its own locking, it is
- trivial to (as SGI suggests) provide a wrapper class which obtains
- the lock, performs the container operation, then releases the lock.
- This could be templatized <EM>to a certain extent</EM>, on the
- underlying container and/or a locking mechanism. Trying to provide
- a catch-all general template solution would probably be more trouble
- than it's worth.
- </P>
-
- <P>Return <A HREF="#top">to top of page</A> or
- <A HREF="../faq/index.html">to the FAQ</A>.
- </P>
+ </p>
+ <p>Also note that the implementation of bitset used in libstdc++-v3 has
+ <a href="../ext/sgiexts.html#ch23">some extensions</a>.
+ </p>
+ <p>Return <a href="#top">to top of page</a> or
+ <a href="../faq/index.html">to the FAQ</a>.
+ </p>
+<hr>
+<h2><a name="3">Containers and multithreading</a></h2>
+ <p>This section discusses issues surrounding the design of
+ multithreaded applications which use Standard C++ containers.
+ All information in this section is current as of the gcc 3.0
+ release and all later point releases. Although earlier gcc
+ releases had a different approach to threading configuration and
+ proper compilation, the basic code design rules presented here
+ were similar. For information on all other aspects of
+ multithreading as it relates to libstdc++, including details on
+ the proper compilation of threaded code (and compatibility between
+ threaded and non-threaded code), see Chapter 17.
+ </p>
+ <p>Two excellent pages to read when working with the Standard C++
+ containers and threads are
+ <a href="http://www.sgi.com/tech/stl/thread_safety.html">SGI's
+ http://www.sgi.com/tech/stl/thread_safety.html</a> and
+ <a href="http://www.sgi.com/tech/stl/Allocators.html">SGI's
+ http://www.sgi.com/tech/stl/Allocators.html</a>.
+ </p>
+ <p><em>However, please ignore all discussions about the user-level
+ configuration of the lock implementation inside the STL
+ container-memory allocator on those pages. For the sake of this
+ discussion, libstdc++-v3 configures the SGI STL implementation,
+ not you. This is quite different from how gcc pre-3.0 worked.
+ In particular, past advice was for people using g++ to
+ explicitly define _PTHREADS or other macros or port-specific
+ compilation options on the command line to get a thread-safe
+ STL. This is no longer required for any port and should no
+ longer be done unless you really know what you are doing and
+ assume all responsibility.</em>
+ </p>
+ <p>Since the container implementation of libstdc++-v3 uses the SGI
+ code, we use the same definition of thread safety as SGI when
+ discussing design. A key point that beginners may miss is the
+ fourth major paragraph of the first page mentioned above
+ (&quot;For most clients,&quot;...), which points out that
+ locking must nearly always be done outside the container, by
+ client code (that'd be you, not us). There is a notable
+ exceptions to this rule. Allocators called while a container or
+ element is constructed uses an internal lock obtained and
+ released solely within libstdc++-v3 code (in fact, this is the
+ reason STL requires any knowledge of the thread configuration).
+ </p>
+ <p>For implementing a container which does its own locking, it is
+ trivial to provide a wrapper class which obtains the lock (as
+ SGI suggests), performs the container operation, and then
+ releases the lock. This could be templatized <em>to a certain
+ extent</em>, on the underlying container and/or a locking
+ mechanism. Trying to provide a catch-all general template
+ solution would probably be more trouble than it's worth.
+ </p>
+ <p>The STL implementation is currently configured to use the
+ high-speed caching memory allocator. If you absolutely think
+ you must change this on a global basis for your platform to better
+ support multi-threading, then please consult all commentary in
+ include/bits/stl_alloc.h and the allocators link below.
+ <blockquote>
+ <p>(Explicit warning since so many people get confused while
+ attempting this:)
+ </p>
+ <p><strong>Adding -D__USE_MALLOC on the command
+ line is almost certainly a bad idea.</strong> Memory efficiency is
+ almost guaranteed to suffer as a result; this is
+ <a href="http://gcc.gnu.org/ml/libstdc++/2001-05/msg00136.html">why
+ we disabled it for 3.0 in the first place</a>.
+ </p>
+ <p>Related to threading or otherwise, the current recommendation is
+ that users not add any macro defines on the command line to remove or
+ otherwise disable features of libstdc++-v3. There is
+ no condition under which it will help you without causing other
+ issues to perhaps raise up (possible linkage/ABI problems). In
+ particular, __USE_MALLOC should only be added to a libstdc++-v3
+ configuration file, include/bits/c++config (where such user
+ action is cautioned against), and the entire library should be
+ rebuilt. If you do not, then you might be violating the
+ one-definition rule of C/C++ and you might cause yourself untold
+ problems.
+ </p>
+ </blockquote>
+ If you find any platform where gcc reports a
+ threading model other than single, and where libstdc++-v3 builds
+ a buggy container allocator when used with threads unless you
+ define __USE_MALLOC, we want to hear about it ASAP. In the
+ past, correctness was the main reason people were led to believe
+ that they should define __USE_MALLOC when using threads.
+ </p>
+ <p>There is a better way (not standardized yet): It is possible to
+ force the malloc-based allocator on a per-case-basis for some
+ application code. The library team generally believes that this
+ is a better way to tune an application for high-speed using this
+ implementation of the STL. There is
+ <a href="../ext/howto.html#3">more information on allocators here</a>.
+ </p>
+ <p>Return <a href="#top">to top of page</a> or
+ <a href="../faq/index.html">to the FAQ</a>.
+ </p>
+<hr>
+<h2><a name="4">&quot;Hinting&quot; during insertion</a></h2>
+ <p>Section [23.1.2], Table 69, of the C++ standard lists this function
+ for all of the associative containers (map, set, etc):
+ <pre>
+ a.insert(p,t);</pre>
+ where 'p' is an iterator into the container 'a', and 't' is the item
+ to insert. The standard says that &quot;iterator p is a hint
+ pointing to where the insert should start to search,&quot; but
+ specifies nothing more. (LWG Issue #233, currently in review,
+ addresses this topic, but I will ignore it here because it is not yet
+ finalized.)
+ </p>
+ <p>Here we'll describe how the hinting works in the libstdc++-v3
+ implementation, and what you need to do in order to take advantage of
+ it. (Insertions can change from logarithmic complexity to amortized
+ constant time, if the hint is properly used.) Also, since the current
+ implementation is based on the SGI STL one, these points may hold true
+ for other library implementations also, since the HP/SGI code is used
+ in a lot of places.
+ </p>
+ <p>In the following text, the phrases <em>greater than</em> and <em>less
+ than</em> refer to the results of the strict weak ordering imposed on
+ the container by its comparison object, which defaults to (basically)
+ &quot;&lt;&quot;. Using those phrases is semantically sloppy, but I
+ didn't want to get bogged down in syntax. I assume that if you are
+ intelligent enough to use your own comparison objects, you are also
+ intelligent enough to assign &quot;greater&quot; and &quot;lesser&quot;
+ their new meanings in the next paragraph. *grin*
+ </p>
+ <p>If the <code>hint</code> parameter ('p' above) is equivalent to:
+ <ul>
+ <li><code>begin()</code>, then the item being inserted should have a key
+ less than all the other keys in the container. The item will
+ be inserted at the beginning of the container, becoming the new
+ entry at <code>begin()</code>.
+ <li><code>end()</code>, then the item being inserted should have a key
+ greater than all the other keys in the container. The item will
+ be inserted at the end of the container, becoming the new entry
+ at <code>end()</code>.
+ <li>neither <code>begin()</code> nor <code>end()</code>, then: Let <code>h</code>
+ be the entry in the container pointed to by <code>hint</code>, that
+ is, <code>h = *hint</code>. Then the item being inserted should have
+ a key less than that of <code>h</code>, and greater than that of the
+ item preceding <code>h</code>. The new item will be inserted
+ between <code>h</code> and <code>h</code>'s predecessor.
+ </ul>
+ </p>
+ <p>For <code>multimap</code> and <code>multiset</code>, the restrictions are
+ slightly looser: &quot;greater than&quot; should be replaced by
+ &quot;not less than&quot; and &quot;less than&quot; should be replaced
+ by &quot;not greater than.&quot; (Why not replace greater with
+ greater-than-or-equal-to? You probably could in your head, but the
+ mathematicians will tell you that it isn't the same thing.)
+ </p>
+ <p>If the conditions are not met, then the hint is not used, and the
+ insertion proceeds as if you had called <code> a.insert(t) </code>
+ instead. (<strong>Note </strong> that GCC releases prior to 3.0.2
+ had a bug in the case with <code>hint == begin()</code> for the
+ <code>map</code> and <code>set</code> classes. You should not use a hint
+ argument in those releases.)
+ </p>
+ <p>This behavior goes well with other container's <code>insert()</code>
+ functions which take an iterator: if used, the new item will be
+ inserted before the iterator passed as an argument, same as the other
+ containers. The exception
+ (in a sense) is with a hint of <code>end()</code>: the new item will
+ actually be inserted after <code>end()</code>, but it also becomes the
+ new <code>end()</code>.
+ </p>
+ <p><strong>Note </strong> also that the hint in this implementation is a
+ one-shot. The insertion-with-hint routines check the immediately
+ surrounding entries to ensure that the new item would in fact belong
+ there. If the hint does not point to the correct place, then no
+ further local searching is done; the search begins from scratch in
+ logarithmic time. (Further local searching would only increase the
+ time required when the hint is too far off.)
+ </p>
+ <p>Return <a href="#top">to top of page</a> or
+ <a href="../faq/index.html">to the FAQ</a>.
+ </p>
+<hr>
+<h2><a name="5">Bitmasks and string arguments</a></h2>
+ <p>Bitmasks do not take char* nor const char* arguments in their
+ constructors. This is something of an accident, but you can read
+ about the problem: follow the library's &quot;Links&quot; from the
+ homepage, and from the C++ information &quot;defect reflector&quot;
+ link, select the library issues list. Issue number 116 describes the
+ problem.
+ </p>
+ <p>For now you can simply make a temporary string object using the
+ constructor expression:
+ <pre>
+ std::bitset&lt;5&gt; b ( std::string(&quot;10110&quot;) );
+ </pre>
+ instead of
+ <pre>
+ std::bitset&lt;5&gt; b ( &quot;10110&quot; ); // invalid
+ </pre>
+ </p>
+ <p>Return <a href="#top">to top of page</a> or
+ <a href="../faq/index.html">to the FAQ</a>.
+ </p>
+
<!-- ####################################################### -->
-<HR>
-<P CLASS="fineprint"><EM>
+<hr>
+<p class="fineprint"><em>
+See <a href="../17_intro/license.html">license.html</a> for copying conditions.
Comments and suggestions are welcome, and may be sent to
-<A HREF="mailto:pme@sources.redhat.com">Phil Edwards</A> or
-<A HREF="mailto:gdr@gcc.gnu.org">Gabriel Dos Reis</A>.
-<BR> $Id: howto.html,v 1.4 2000/12/03 23:47:48 jsm28 Exp $
-</EM></P>
+<a href="mailto:libstdc++@gcc.gnu.org">the libstdc++ mailing list</a>.
+</em></p>
-</BODY>
-</HTML>
+</body>
+</html>
diff --git a/libstdc++-v3/docs/html/24_iterators/howto.html b/libstdc++-v3/docs/html/24_iterators/howto.html
index a807cf3d8b9..90c53df18ac 100644
--- a/libstdc++-v3/docs/html/24_iterators/howto.html
+++ b/libstdc++-v3/docs/html/24_iterators/howto.html
@@ -1,94 +1,183 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-<HEAD>
- <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
- <META NAME="AUTHOR" CONTENT="pme@sources.redhat.com (Phil Edwards)">
- <META NAME="KEYWORDS" CONTENT="HOWTO, libstdc++, GCC, g++, libg++, STL">
- <META NAME="DESCRIPTION" CONTENT="HOWTO for the libstdc++ chapter 24.">
- <META NAME="GENERATOR" CONTENT="vi and eight fingers">
- <TITLE>libstdc++-v3 HOWTO: Chapter 24</TITLE>
-<LINK REL=StyleSheet HREF="../lib3styles.css">
-<!-- $Id: howto.html,v 1.5 2000/12/03 23:47:48 jsm28 Exp $ -->
-</HEAD>
-<BODY>
-
-<H1 CLASS="centered"><A NAME="top">Chapter 24: Iterators</A></H1>
-
-<P>Chapter 24 deals with the FORTRAN subroutines for automatically
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="AUTHOR" content="pme@gcc.gnu.org (Phil Edwards)">
+ <meta name="KEYWORDS" content="HOWTO, libstdc++, GCC, g++, libg++, STL">
+ <meta name="DESCRIPTION" content="HOWTO for the libstdc++ chapter 24.">
+ <meta name="GENERATOR" content="vi and eight fingers">
+ <title>libstdc++-v3 HOWTO: Chapter 24</title>
+<link rel="StyleSheet" href="../lib3styles.css">
+</head>
+<body>
+
+<h1 class="centered"><a name="top">Chapter 24: Iterators</a></h1>
+
+<p>Chapter 24 deals with the FORTRAN subroutines for automatically
transforming lemmings into gold.
-</P>
+</p>
<!-- ####################################################### -->
-<HR>
-<H1>Contents</H1>
-<UL>
- <LI><A HREF="#1">They ain't pointers!</A>
- <LI><A HREF="#2">It ends <EM>where?</EM></A>
-</UL>
+<hr>
+<h1>Contents</h1>
+<ul>
+ <li><a href="#1">They ain't pointers!</a>
+ <li><a href="#2">It ends <em>where?</em></a>
+</ul>
-<HR>
+<hr>
<!-- ####################################################### -->
-<H2><A NAME="1">They ain't pointers!</A></H2>
- <P><A HREF="../faq/index.html#5_1">FAQ 5.1</A> points out that iterators
+<h2><a name="1">They ain't pointers!</a></h2>
+ <p><a href="../faq/index.html#5_1">FAQ 5.1</a> points out that iterators
are not implemented as pointers. They are a generalization of
pointers, but they are implemented in libstdc++-v3 as separate classes.
- </P>
- <P>Keeping that simple fact in mind as you design your code will
+ </p>
+ <p>Keeping that simple fact in mind as you design your code will
prevent a whole lot of difficult-to-understand bugs.
- </P>
- <P>You can think of it the other way 'round, even. Since iterators
- are a generalization, that means that <EM>pointers</EM> are
- <EM>iterators</EM>, and that pointers can be used whenever an
+ </p>
+ <p>You can think of it the other way 'round, even. Since iterators
+ are a generalization, that means that <em>pointers</em> are
+ <em>iterators</em>, and that pointers can be used whenever an
iterator would be. All those functions in the Algorithms chapter
of the Standard will work just as well on plain arrays and their
pointers.
- </P>
- <P>That doesn't mean that when you pass in a pointer, it gets wrapped
+ </p>
+ <p>That doesn't mean that when you pass in a pointer, it gets wrapped
into some special delegating iterator-to-pointer class with a layer
of overhead. (If you think that's the case anywhere, you don't
understand templates to begin with...) Oh, no; if you pass
in a pointer, then the compiler will instantiate that template
- using T* as a type and good old high-speed pointer arithmetic as
+ using T* as a type, and good old high-speed pointer arithmetic as
its operations, so the resulting code will be doing exactly the same
things as it would be doing if you had hand-coded it yourself (for
the 273rd time).
- </P>
- <P>How much overhead <EM>is</EM> there when using an interator class?
+ </p>
+ <p>How much overhead <em>is</em> there when using an interator class?
Very little. Most of the layering classes contain nothing but
typedefs, and typedefs are &quot;meta-information&quot; that simply
tell the compiler some nicknames; they don't create code. That
information gets passed down through inheritance, so while the
compiler has to do work looking up all the names, your runtime code
does not. (This has been a prime concern from the beginning.)
- </P>
- <P>Return <A HREF="#top">to top of page</A> or
- <A HREF="../faq/index.html">to the FAQ</A>.
- </P>
+ </p>
+ <p>Return <a href="#top">to top of page</a> or
+ <a href="../faq/index.html">to the FAQ</a>.
+ </p>
+
+<hr>
+<h2><a name="2">It ends <em>where?</em></a></h2>
+ <p>This starts off sounding complicated, but is actually very easy,
+ especially towards the end. Trust me.
+ </p>
+ <p>Beginners usually have a little trouble understand the whole
+ 'past-the-end' thing, until they remember their early algebra classes
+ (see, they </em>told</em> you that stuff would come in handy!) and
+ the concept of half-open ranges.
+ </p>
+ <p>First, some history, and a reminder of some of the funkier rules in
+ C and C++ for builtin arrays. The following rules have always been
+ true for both languages:
+ <ol>
+ <li>You can point anywhere in the array, <em>or to the first element
+ past the end of the array</em>. A pointer that points to one
+ past the end of the array is guaranteed to be as unique as a
+ pointer to somewhere inside the array, so that you can compare
+ such pointers safely.
+ <li>You can only dereference a pointer that points into an array.
+ If your array pointer points outside the array -- even to just
+ one past the end -- and you dereference it, Bad Things happen.
+ <li>Strictly speaking, simply pointing anywhere else invokes
+ undefined behavior. Most programs won't puke until such a
+ pointer is actually dereferenced, but the standards leave that
+ up to the platform.
+ </ol>
+ The reason this past-the-end addressing was allowed is to make it
+ easy to write a loop to go over an entire array, e.g.,
+ while (*d++ = *s++);.
+ </p>
+ <p>So, when you think of two pointers delimiting an array, don't think
+ of them as indexing 0 through n-1. Think of them as <em>boundary
+ markers</em>:
+ <pre>
+
+ beginning end
+ | |
+ | | This is bad. Always having to
+ | | remember to add or subtract one.
+ | | Off-by-one bugs very common here.
+ V V
+ array of N elements
+ |---|---|--...--|---|---|
+ | 0 | 1 | ... |N-2|N-1|
+ |---|---|--...--|---|---|
+
+ ^ ^
+ | |
+ | | This is good. This is safe. This
+ | | is guaranteed to work. Just don't
+ | | dereference 'end'.
+ beginning end
-<HR>
-<H2><A NAME="2">It ends <EM>where?</EM></A></H2>
- <P>Blah.
- </P>
- <P>Return <A HREF="#top">to top of page</A> or
- <A HREF="../faq/index.html">to the FAQ</A>.
- </P>
+ </pre>
+ See? Everything between the boundary markers is part of the array.
+ Simple.
+ </p>
+ <p>Now think back to your junior-high school algebra course, when you
+ were learning how to draw graphs. Remember that a graph terminating
+ with a solid dot meant, &quot;Everything up through this point,&quot;
+ and a graph terminating with an open dot meant, &quot;Everything up
+ to, but not including, this point,&quot; respectively called closed
+ and open ranges? Remember how closed ranges were written with
+ brackets, <em>[a,b]</em>, and open ranges were written with parentheses,
+ <em>(a,b)</em>?
+ </p>
+ <p>The boundary markers for arrays describe a <em>half-open range</em>,
+ starting with (and including) the first element, and ending with (but
+ not including) the last element: <em>[beginning,end)</em>. See, I
+ told you it would be simple in the end.
+ </p>
+ <p>Iterators, and everything working with iterators, follows this same
+ time-honored tradition. A container's <code>begin()</code> method returns
+ an iterator referring to the first element, and its <code>end()</code>
+ method returns a past-the-end iterator, which is guaranteed to be
+ unique and comparable against any other iterator pointing into the
+ middle of the container.
+ </p>
+ <p>Container constructors, container methods, and algorithms, all take
+ pairs of iterators describing a range of values on which to operate.
+ All of these ranges are half-open ranges, so you pass the beginning
+ iterator as the starting parameter, and the one-past-the-end iterator
+ as the finishing parameter.
+ </p>
+ <p>This generalizes very well. You can operate on sub-ranges quite
+ easily this way; functions accepting a <em>[first,last)</em> range
+ don't know or care whether they are the boundaries of an entire {array,
+ sequence, container, whatever}, or whether they only enclose a few
+ elements from the center. This approach also makes zero-length
+ sequences very simple to recognize: if the two endpoints compare
+ equal, then the {array, sequence, container, whatever} is empty.
+ </p>
+ <p>Just don't dereference <code>end()</code>.
+ </p>
+ <p>Return <a href="#top">to top of page</a> or
+ <a href="../faq/index.html">to the FAQ</a>.
+ </p>
<!-- ####################################################### -->
-<HR>
-<P CLASS="fineprint"><EM>
+<hr>
+<p class="fineprint"><em>
+See <a href="../17_intro/license.html">license.html</a> for copying conditions.
Comments and suggestions are welcome, and may be sent to
-<A HREF="mailto:pme@sources.redhat.com">Phil Edwards</A> or
-<A HREF="mailto:gdr@gcc.gnu.org">Gabriel Dos Reis</A>.
-<BR> $Id: howto.html,v 1.5 2000/12/03 23:47:48 jsm28 Exp $
-</EM></P>
+<a href="mailto:libstdc++@gcc.gnu.org">the libstdc++ mailing list</a>.
+</em></p>
-</BODY>
-</HTML>
+</body>
+</html>
diff --git a/libstdc++-v3/docs/html/25_algorithms/howto.html b/libstdc++-v3/docs/html/25_algorithms/howto.html
index c161b1871a3..8cdfe94a471 100644
--- a/libstdc++-v3/docs/html/25_algorithms/howto.html
+++ b/libstdc++-v3/docs/html/25_algorithms/howto.html
@@ -1,96 +1,102 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-<HEAD>
- <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
- <META NAME="AUTHOR" CONTENT="pme@sources.redhat.com (Phil Edwards)">
- <META NAME="KEYWORDS" CONTENT="HOWTO, libstdc++, GCC, g++, libg++, STL">
- <META NAME="DESCRIPTION" CONTENT="HOWTO for the libstdc++ chapter 25.">
- <META NAME="GENERATOR" CONTENT="vi and eight fingers">
- <TITLE>libstdc++-v3 HOWTO: Chapter 25</TITLE>
-<LINK REL=StyleSheet HREF="../lib3styles.css">
-<!-- $Id: howto.html,v 1.5 2000/12/03 23:47:48 jsm28 Exp $ -->
-</HEAD>
-<BODY>
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="AUTHOR" content="pme@gcc.gnu.org (Phil Edwards)">
+ <meta name="KEYWORDS" content="HOWTO, libstdc++, GCC, g++, libg++, STL">
+ <meta name="DESCRIPTION" content="HOWTO for the libstdc++ chapter 25.">
+ <meta name="GENERATOR" content="vi and eight fingers">
+ <title>libstdc++-v3 HOWTO: Chapter 25</title>
+<link rel="StyleSheet" href="../lib3styles.css">
+</head>
+<body>
-<H1 CLASS="centered"><A NAME="top">Chapter 25: Algorithms</A></H1>
+<h1 class="centered"><a name="top">Chapter 25: Algorithms</a></h1>
-<P>Chapter 25 deals with the generalized subroutines for automatically
+<p>Chapter 25 deals with the generalized subroutines for automatically
transforming lemmings into gold.
-</P>
+</p>
<!-- ####################################################### -->
-<HR>
-<H1>Contents</H1>
-<UL>
- <LI><A HREF="#1">Prerequisites</A>
- <LI><A HREF="#2">Topic</A>
-</UL>
+<hr>
+<h1>Contents</h1>
+<ul>
+ <li><a href="#1">Prerequisites</a>
+ <li><a href="#2">Special <code>swap</code>s</a>
+</ul>
-<HR>
+<hr>
<!-- ####################################################### -->
-<H2><A NAME="1">Prerequisites</A></H2>
- <P>The neatest accomplishment of the algorithms chapter is that all the
+<h2><a name="1">Prerequisites</a></h2>
+ <p>The neatest accomplishment of the algorithms chapter is that all the
work is done via iterators, not containers directly. This means two
important things:
- <OL>
- <LI>Anything that behaves like an iterator can be used in one of
- these algorithms. Raw pointers make great candidates, thus
- built-in arrays are fine containers. So do your own iterators.
- <LI>The algorithms do not (and cannot) affect the container as a
- whole; only the things between the two iterator endpoints. If
- you pass a range of iterators only enclosing the middle third of
- a container, then anything outside that range is inviolate.
- </OL>
- </P>
- <P>Even strings can be fed through the algorithms here, although the
+ <ol>
+ <li>Anything that behaves like an iterator can be used in one of
+ these algorithms. Raw pointers make great candidates, thus
+ built-in arrays are fine containers, as well as your own iterators.
+ <li>The algorithms do not (and cannot) affect the container as a
+ whole; only the things between the two iterator endpoints. If
+ you pass a range of iterators only enclosing the middle third of
+ a container, then anything outside that range is inviolate.
+ </ol>
+ </p>
+ <p>Even strings can be fed through the algorithms here, although the
string class has specialized versions of many of these functions (for
- example, <TT>string::find()</TT>). Most of the examples on this
+ example, <code>string::find()</code>). Most of the examples on this
page will use simple arrays of integers as a playground for
algorithms, just to keep things simple.
- <A NAME="Nsize">The use of <B>N</B></A> as a size in the examples is
- to keep things easy to read but probably won't be legal code. You can
- use wrappers such as those described in the
- <A HREF="../23_containers/howto.html">containers chapter</A> to keep
+ <a name="Nsize">The use of <strong>N</strong></a> as a size in the
+ examples is to keep things easy to read but probably won't be valid
+ code. You can use wrappers such as those described in the
+ <a href="../23_containers/howto.html">containers chapter</a> to keep
real code readable.
- </P>
- <P>The single thing that trips people up the most is the definition of
- <EM>range</EM> used with iterators; the famous
+ </p>
+ <p>The single thing that trips people up the most is the definition of
+ <em>range</em> used with iterators; the famous
&quot;past-the-end&quot; rule that everybody loves to hate. The
- <A HREF="../24_iterators/howto.html">iterators chapter</A> of this
+ <a href="../24_iterators/howto.html#2">iterators chapter</a> of this
document has a complete explanation of this simple rule that seems to
- cause so much confusion. Once you get <EM>range</EM> into your head
+ cause so much confusion. Once you get <em>range</em> into your head
(it's not that hard, honest!), then the algorithms are a cakewalk.
- </P>
- <P>
- </P>
- <P>Return <A HREF="#top">to top of page</A> or
- <A HREF="../faq/index.html">to the FAQ</A>.
- </P>
+ </p>
+ <p>Return <a href="#top">to top of page</a> or
+ <a href="../faq/index.html">to the FAQ</a>.
+ </p>
-<HR>
-<H2><A NAME="2">Topic</A></H2>
- <P>Blah.
- </P>
- <P>Return <A HREF="#top">to top of page</A> or
- <A HREF="../faq/index.html">to the FAQ</A>.
- </P>
+<hr>
+<h2><a name="2">Special <code>swap</code>s</a></h2>
+ <p>If you call <code> std::swap(x,y); </code> where x and y are standard
+ containers, then the call will automatically be replaced by a call to
+ <code> x.swap(y); </code> instead.
+ </p>
+ <p>This allows member functions of each container class to take over, and
+ containers' swap functions should have O(1) complexity according to
+ the standard. (And while &quot;should&quot; allows implementations to
+ behave otherwise and remain compliant, this implementation does in
+ fact use constant-time swaps.) This should not be surprising, since
+ for two containers of the same type to swap contents, only some
+ internal pointers to storage need to be exchanged.
+ </p>
+ <p>Return <a href="#top">to top of page</a> or
+ <a href="../faq/index.html">to the FAQ</a>.
+ </p>
<!-- ####################################################### -->
-<HR>
-<P CLASS="fineprint"><EM>
+<hr>
+<p class="fineprint"><em>
+See <a href="../17_intro/license.html">license.html</a> for copying conditions.
Comments and suggestions are welcome, and may be sent to
-<A HREF="mailto:pme@sources.redhat.com">Phil Edwards</A> or
-<A HREF="mailto:gdr@gcc.gnu.org">Gabriel Dos Reis</A>.
-<BR> $Id: howto.html,v 1.5 2000/12/03 23:47:48 jsm28 Exp $
-</EM></P>
+<a href="mailto:libstdc++@gcc.gnu.org">the libstdc++ mailing list</a>.
+</em></p>
-</BODY>
-</HTML>
+</body>
+</html>
diff --git a/libstdc++-v3/docs/html/26_numerics/howto.html b/libstdc++-v3/docs/html/26_numerics/howto.html
index c69532dbfcd..e15870f57bf 100644
--- a/libstdc++-v3/docs/html/26_numerics/howto.html
+++ b/libstdc++-v3/docs/html/26_numerics/howto.html
@@ -1,108 +1,108 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-<HEAD>
- <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
- <META NAME="AUTHOR" CONTENT="pme@sources.redhat.com (Phil Edwards)">
- <META NAME="KEYWORDS" CONTENT="HOWTO, libstdc++, GCC, g++, libg++, STL">
- <META NAME="DESCRIPTION" CONTENT="HOWTO for the libstdc++ chapter 26.">
- <META NAME="GENERATOR" CONTENT="vi and eight fingers">
- <TITLE>libstdc++-v3 HOWTO: Chapter 26</TITLE>
-<LINK REL=StyleSheet HREF="../lib3styles.css">
-<!-- $Id: howto.html,v 1.7 2000/12/03 23:47:48 jsm28 Exp $ -->
-</HEAD>
-<BODY>
-
-<H1 CLASS="centered"><A NAME="top">Chapter 26: Numerics</A></H1>
-
-<P>Chapter 26 deals with building block abstractions to aid in
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="AUTHOR" content="pme@gcc.gnu.org (Phil Edwards)">
+ <meta name="KEYWORDS" content="HOWTO, libstdc++, GCC, g++, libg++, STL">
+ <meta name="DESCRIPTION" content="HOWTO for the libstdc++ chapter 26.">
+ <meta name="GENERATOR" content="vi and eight fingers">
+ <title>libstdc++-v3 HOWTO: Chapter 26</title>
+<link rel="StyleSheet" href="../lib3styles.css">
+</head>
+<body>
+
+<h1 class="centered"><a name="top">Chapter 26: Numerics</a></h1>
+
+<p>Chapter 26 deals with building block abstractions to aid in
numerical computing:
- <UL>
- <LI>Template data structures such as <TT>valarray&lt;&gt;</TT>
- and <TT>complex&lt;&gt;</TT>.
- <LI>Template numerical functions such as <TT>accumulate</TT>;
- <TT>inner_product</TT>; <TT>partial_sum</TT> and
- <TT>adjacent_difference</TT>.
- </UL>
+ <ul>
+ <li>Template data structures such as <code>valarray&lt;&gt;</code>
+ and <code>complex&lt;&gt;</code>.
+ <li>Template numerical functions such as <code>accumulate</code>,
+ <code>inner_product</code>, <code>partial_sum</code>, and
+ <code>adjacent_difference</code>.
+ </ul>
All of the Standard C math functions are of course included in C++,
- and overloaded versions for <TT>long</TT>, <TT>float</TT>, and
- <TT>long double</TT> have been added for all of them.
-</P>
+ and overloaded versions for <code>long</code>, <code>float</code>, and
+ <code>long double</code> have been added for all of them.
+</p>
<!-- ####################################################### -->
-<HR>
-<H1>Contents</H1>
-<UL>
- <LI><A HREF="#1">Complex Number Processing</A>
- <LI><A HREF="#2">Array Processing</A>
- <LI><A HREF="#3">Numerical Functions</A>
-</UL>
+<hr>
+<h1>Contents</h1>
+<ul>
+ <li><a href="#1">Complex Number Processing</a>
+ <li><a href="#2">Array Processing</a>
+ <li><a href="#3">Numerical Functions</a>
+ <li><a href="#4">C99</a>
+</ul>
-<HR>
+<hr>
<!-- ####################################################### -->
-<H2><A NAME="1">Complex Number Processing</A></H2>
- <P>Using <TT>complex&lt;&gt;</TT> becomes even more comple- er, sorry,
- <EM>complicated</EM>, with the not-quite-gratuitously-incompatible
+<h2><a name="1">Complex Number Processing</a></h2>
+ <p>Using <code>complex&lt;&gt;</code> becomes even more comple- er, sorry,
+ <em>complicated</em>, with the not-quite-gratuitously-incompatible
addition of complex types to the C language. David Tribble has
compiled a list of C++98 and C99 conflict points; his description of
C's new type versus those of C++ and how to get them playing together
nicely is
-<A HREF="http://home.flash.net/~dtribble/text/cdiffs.htm#C99.complex">here</A>.
- </P>
- <P><TT>complex&lt;&gt;</TT> is intended to be instantiated with a
+<a href="http://david.tribble.com/text/cdiffs.htm#C99-complex">here</a>.
+ </p>
+ <p><code>complex&lt;&gt;</code> is intended to be instantiated with a
floating-point type. As long as you meet that and some other basic
requirements, then the resulting instantiation has all of the usual
- math operators defined, as well as definitions of <TT>op&lt;&lt;</TT>
- and <TT>op&gt;&gt;</TT> that work with iostreams: <TT>op&lt;&lt;</TT>
- prints <TT>(u,v)</TT> and <TT>op&gt;&gt;</TT> can read <TT>u</TT>,
- <TT>(u)</TT>, and <TT>(u,v)</TT>.
- </P>
- <P>Return <A HREF="#top">to top of page</A> or
- <A HREF="../faq/index.html">to the FAQ</A>.
- </P>
-
-<HR>
-<H2><A NAME="2">Array Processing</A></H2>
- <P>One of the major reasons why FORTRAN can chew through numbers so well
+ math operators defined, as well as definitions of <code>op&lt;&lt;</code>
+ and <code>op&gt;&gt;</code> that work with iostreams: <code>op&lt;&lt;</code>
+ prints <code>(u,v)</code> and <code>op&gt;&gt;</code> can read <code>u</code>,
+ <code>(u)</code>, and <code>(u,v)</code>.
+ </p>
+ <p>Return <a href="#top">to top of page</a> or
+ <a href="../faq/index.html">to the FAQ</a>.
+ </p>
+
+<hr>
+<h2><a name="2">Array Processing</a></h2>
+ <p>One of the major reasons why FORTRAN can chew through numbers so well
is that it is defined to be free of pointer aliasing, an assumption
- that C89 is not allowed to make, and neither is C++. C99 adds a new
- keyword, <TT>restrict</TT>, to apply to individual pointers. The C++
- solution is contained in the library rather than the language
+ that C89 is not allowed to make, and neither is C++98. C99 adds a new
+ keyword, <code>restrict</code>, to apply to individual pointers. The
+ C++ solution is contained in the library rather than the language
(although many vendors can be expected to add this to their compilers
as an extension).
- </P>
- <P>That library solution is a set of two classes, five template classes,
+ </p>
+ <p>That library solution is a set of two classes, five template classes,
and &quot;a whole bunch&quot; of functions. The classes are required
to be free of pointer aliasing, so compilers can optimize the
daylights out of them the same way that they have been for FORTRAN.
- They are collectively called <TT>valarray</TT>, although strictly
+ They are collectively called <code>valarray</code>, although strictly
speaking this is only one of the five template classes, and they are
designed to be familiar to people who have worked with the BLAS
libraries before.
- </P>
- <P>Some more stuff should go here once somebody has time to write it.
- </P>
- <P>Return <A HREF="#top">to top of page</A> or
- <A HREF="../faq/index.html">to the FAQ</A>.
- </P>
-
-<HR>
-<H2><A NAME="3">Numerical Functions</A></H2>
- <P>There are four generalized functions in the &lt;numeric&gt; header
+ </p>
+ <p>Some more stuff should go here once somebody has time to write it.
+ </p>
+ <p>Return <a href="#top">to top of page</a> or
+ <a href="../faq/index.html">to the FAQ</a>.
+ </p>
+
+<hr>
+<h2><a name="3">Numerical Functions</a></h2>
+ <p>There are four generalized functions in the &lt;numeric&gt; header
that follow the same conventions as those in &lt;algorithm&gt;. Each
of them is overloaded: one signature for common default operations,
and a second for fully general operations. Their names are
self-explanatory to anyone who works with numerics on a regular basis:
- <UL>
- <LI><TT>accumulate</TT>
- <LI><TT>inner_product</TT>
- <LI><TT>partial_sum</TT>
- <LI><TT>adjacent_difference</TT>
- </UL>
- </P>
- <P>Here is a simple example of the two forms of <TT>accumulate</TT>.
- <PRE>
+ <ul>
+ <li><code>accumulate</code>
+ <li><code>inner_product</code>
+ <li><code>partial_sum</code>
+ <li><code>adjacent_difference</code>
+ </ul>
+ </p>
+ <p>Here is a simple example of the two forms of <code>accumulate</code>.
+ <pre>
int ar[50];
int someval = somefunction();
@@ -111,32 +111,53 @@
int sum = std::accumulate(ar,ar+50,0);
int sum_stuff = std::accumulate(ar,ar+50,someval);
int product = std::accumulate(ar,ar+50,1,std::multiplies&lt;int&gt;());
- </PRE>
+ </pre>
The first call adds all the members of the array, using zero as an
- initial value for <TT>sum</TT>. The second does the same, but uses
- <TT>someval</TT> as the starting value (thus, <TT>sum_stuff == sum +
- someval</TT>). The final call uses the second of the two signatures,
+ initial value for <code>sum</code>. The second does the same, but uses
+ <code>someval</code> as the starting value (thus, <code>sum_stuff == sum +
+ someval</code>). The final call uses the second of the two signatures,
and multiplies all the members of the array; here we must obviously
use 1 as a starting value instead of 0.
- </P>
- <P>The other three functions have similar dual-signature forms.
- </P>
- <P>Return <A HREF="#top">to top of page</A> or
- <A HREF="../faq/index.html">to the FAQ</A>.
- </P>
+ </p>
+ <p>The other three functions have similar dual-signature forms.
+ </p>
+ <p>Return <a href="#top">to top of page</a> or
+ <a href="../faq/index.html">to the FAQ</a>.
+ </p>
+
+<hr>
+<h2><a name="4">C99</a></h2>
+ <p>In addition to the other topics on this page, we'll note here some
+ of the C99 features that appear in libstdc++-v3.
+ </p>
+ <p>The C99 features depend on the <code>--enable-c99</code> configure flag.
+ This flag is already on by default, but it can be disabled by the
+ user. Also, the configuration machinery will disable it if the
+ necessary support for C99 (e.g., header files) cannot be found.
+ </p>
+ <p>As of GCC 3.0, C99 support includes classification functions
+ such as <code>isnormal</code>, <code>isgreater</code>,
+ <code>isnan</code>, etc.
+ The functions used for 'long long' support such as <code>strtoll</code>
+ are supported, as is the <code>lldiv_t</code> typedef. Also supported
+ are the wide character functions using 'long long', like
+ <code>wcstoll</code>.
+ </p>
+ <p>Return <a href="#top">to top of page</a> or
+ <a href="../faq/index.html">to the FAQ</a>.
+ </p>
<!-- ####################################################### -->
-<HR>
-<P CLASS="fineprint"><EM>
+<hr>
+<p class="fineprint"><em>
+See <a href="../17_intro/license.html">license.html</a> for copying conditions.
Comments and suggestions are welcome, and may be sent to
-<A HREF="mailto:pme@sources.redhat.com">Phil Edwards</A> or
-<A HREF="mailto:gdr@gcc.gnu.org">Gabriel Dos Reis</A>.
-<BR> $Id: howto.html,v 1.7 2000/12/03 23:47:48 jsm28 Exp $
-</EM></P>
+<a href="mailto:libstdc++@gcc.gnu.org">the libstdc++ mailing list</a>.
+</em></p>
-</BODY>
-</HTML>
+</body>
+</html>
diff --git a/libstdc++-v3/docs/html/27_io/howto.html b/libstdc++-v3/docs/html/27_io/howto.html
index a6aa045781c..23489525aa4 100644
--- a/libstdc++-v3/docs/html/27_io/howto.html
+++ b/libstdc++-v3/docs/html/27_io/howto.html
@@ -1,85 +1,85 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-<HEAD>
- <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
- <META NAME="AUTHOR" CONTENT="pme@sources.redhat.com (Phil Edwards)">
- <META NAME="KEYWORDS" CONTENT="HOWTO, libstdc++, GCC, g++, libg++, STL">
- <META NAME="DESCRIPTION" CONTENT="HOWTO for the libstdc++ chapter 27.">
- <META NAME="GENERATOR" CONTENT="vi and eight fingers">
- <TITLE>libstdc++-v3 HOWTO: Chapter 27</TITLE>
-<LINK REL=StyleSheet HREF="../lib3styles.css">
-<!-- $Id: howto.html,v 1.2 2001/01/23 17:02:27 pme Exp $ -->
-</HEAD>
-<BODY>
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="AUTHOR" content="pme@gcc.gnu.org (Phil Edwards)">
+ <meta name="KEYWORDS" content="HOWTO, libstdc++, GCC, g++, libg++, STL">
+ <meta name="DESCRIPTION" content="HOWTO for the libstdc++ chapter 27.">
+ <meta name="GENERATOR" content="vi and eight fingers">
+ <title>libstdc++-v3 HOWTO: Chapter 27</title>
+<link rel="StyleSheet" href="../lib3styles.css">
+</head>
+<body>
-<H1 CLASS="centered"><A NAME="top">Chapter 27: Input/Output</A></H1>
+<h1 class="centered"><a name="top">Chapter 27: Input/Output</a></h1>
-<P>Chapter 27 deals with iostreams and all their subcomponents
- and extensions. All <EM>kinds</EM> of fun stuff.
-</P>
+<p>Chapter 27 deals with iostreams and all their subcomponents
+ and extensions. All <em>kinds</em> of fun stuff.
+</p>
<!-- ####################################################### -->
-<HR>
-<H1>Contents</H1>
-<UL>
- <LI><A HREF="#1">Copying a file</A>
- <LI><A HREF="#2">The buffering is screwing up my program!</A>
- <LI><A HREF="#3">Binary I/O</A>
- <LI><A HREF="#4">Iostreams class hierarchy diagram</A>
- <LI><A HREF="#5">What is this &lt;sstream&gt;/stringstreams thing?</A>
- <LI><A HREF="#6">Deriving a stream buffer</A>
- <LI><A HREF="#7">More on binary I/O</A>
-</UL>
+<hr>
+<h1>Contents</h1>
+<ul>
+ <li><a href="#1">Copying a file</a>
+ <li><a href="#2">The buffering is screwing up my program!</a>
+ <li><a href="#3">Binary I/O</a>
+ <li><a href="#5">What is this &lt;sstream&gt;/stringstreams thing?</a>
+ <li><a href="#6">Deriving a stream buffer</a>
+ <li><a href="#7">More on binary I/O</a>
+ <li><a href="#8">Pathetic performance? Ditch C.</a>
+ <li><a href="#9">Threads and I/O</a>
+</ul>
-<HR>
+<hr>
<!-- ####################################################### -->
-<H2><A NAME="1">Copying a file</A></H2>
- <P>So you want to copy a file quickly and easily, and most important,
+<h2><a name="1">Copying a file</a></h2>
+ <p>So you want to copy a file quickly and easily, and most important,
completely portably. And since this is C++, you have an open
ifstream (call it IN) and an open ofstream (call it OUT):
- <PRE>
+ <pre>
#include &lt;fstream&gt;
std::ifstream IN ("input_file");
- std::ofstream OUT ("output_file"); </PRE>
- </P>
- <P>Here's the easiest way to get it completely wrong:
- <PRE>
- OUT &lt;&lt; IN;</PRE>
+ std::ofstream OUT ("output_file"); </pre>
+ </p>
+ <p>Here's the easiest way to get it completely wrong:
+ <pre>
+ OUT &lt;&lt; IN;</pre>
For those of you who don't already know why this doesn't work
(probably from having done it before), I invite you to quickly
create a simple text file called &quot;input_file&quot; containing
the sentence
- <PRE>
- The quick brown fox jumped over the lazy dog.</PRE>
+ <pre>
+ The quick brown fox jumped over the lazy dog.</pre>
surrounded by blank lines. Code it up and try it. The contents
of &quot;output_file&quot; may surprise you.
- </P>
- <P>Seriously, go do it. Get surprised, then come back. It's worth it.
- </P>
- <HR WIDTH="60%">
- <P>The thing to remember is that the <TT>basic_[io]stream</TT> classes
+ </p>
+ <p>Seriously, go do it. Get surprised, then come back. It's worth it.
+ </p>
+ <hr width="60%">
+ <p>The thing to remember is that the <code>basic_[io]stream</code> classes
handle formatting, nothing else. In particular, they break up on
whitespace. The actual reading, writing, and storing of data is
- handled by the <TT>basic_streambuf</TT> family. Fortunately, the
- <TT>operator&lt;&lt;</TT> is overloaded to take an ostream and
+ handled by the <code>basic_streambuf</code> family. Fortunately, the
+ <code>operator&lt;&lt;</code> is overloaded to take an ostream and
a pointer-to-streambuf, in order to help with just this kind of
&quot;dump the data verbatim&quot; situation.
- </P>
- <P>Why a <EM>pointer</EM> to streambuf and not just a streambuf? Well,
+ </p>
+ <p>Why a <em>pointer</em> to streambuf and not just a streambuf? Well,
the [io]streams hold pointers (or references, depending on the
implementation) to their buffers, not the actual
buffers. This allows polymorphic behavior on the part of the buffers
as well as the streams themselves. The pointer is easily retrieved
- using the <TT>rdbuf()</TT> member function. Therefore, the easiest
+ using the <code>rdbuf()</code> member function. Therefore, the easiest
way to copy the file is:
- <PRE>
- OUT &lt;&lt; IN.rdbuf();</PRE>
- </P>
- <P>So what <EM>was</EM> happening with OUT&lt;&lt;IN? Undefined
+ <pre>
+ OUT &lt;&lt; IN.rdbuf();</pre>
+ </p>
+ <p>So what <em>was</em> happening with OUT&lt;&lt;IN? Undefined
behavior, since that particular &lt;&lt; isn't defined by the Standard.
I have seen instances where it is implemented, but the character
extraction process removes all the whitespace, leaving you with no
@@ -88,69 +88,69 @@
member pointers) sometimes gets converted to a void*, and the output
file then contains a perfect text representation of a hexidecimal
address (quite a big surprise). Others don't compile at all.
- </P>
- <P>Also note that none of this is specific to o<B>*f*</B>streams.
+ </p>
+ <p>Also note that none of this is specific to o<B>*f*</B>streams.
The operators shown above are all defined in the parent
basic_ostream class and are therefore available with all possible
descendents.
- </P>
- <P>Return <A HREF="#top">to top of page</A> or
- <A HREF="../faq/index.html">to the FAQ</A>.
- </P>
+ </p>
+ <p>Return <a href="#top">to top of page</a> or
+ <a href="../faq/index.html">to the FAQ</a>.
+ </p>
-<HR>
-<H2><A NAME="2">The buffering is screwing up my program!</A></H2>
+<hr>
+<h2><a name="2">The buffering is screwing up my program!</a></h2>
<!--
This is not written very well. I need to redo this section.
-->
- <P>First, are you sure that you understand buffering? Particularly
+ <p>First, are you sure that you understand buffering? Particularly
the fact that C++ may not, in fact, have anything to do with it?
- </P>
- <P>The rules for buffering can be a little odd, but they aren't any
+ </p>
+ <p>The rules for buffering can be a little odd, but they aren't any
different from those of C. (Maybe that's why they can be a bit
odd.) Many people think that writing a newline to an output
stream automatically flushes the output buffer. This is true only
when the output stream is, in fact, a terminal and not a file
- or some other device -- and <EM>that</EM> may not even be true
+ or some other device -- and <em>that</em> may not even be true
since C++ says nothing about files nor terminals. All of that is
- system-dependant. (The &quot;newline-buffer-flushing only occuring
+ system-dependent. (The &quot;newline-buffer-flushing only occurring
on terminals&quot; thing is mostly true on Unix systems, though.)
- </P>
- <P>Some people also believe that sending <TT>endl</TT> down an
+ </p>
+ <p>Some people also believe that sending <code>endl</code> down an
output stream only writes a newline. This is incorrect; after a
newline is written, the buffer is also flushed. Perhaps this
is the effect you want when writing to a screen -- get the text
out as soon as possible, etc -- but the buffering is largely
wasted when doing this to a file:
- <PRE>
+ <pre>
output &lt;&lt; &quot;a line of text&quot; &lt;&lt; endl;
output &lt;&lt; some_data_variable &lt;&lt; endl;
- output &lt;&lt; &quot;another line of text&quot; &lt;&lt; endl; </PRE>
+ output &lt;&lt; &quot;another line of text&quot; &lt;&lt; endl; </pre>
The proper thing to do in this case to just write the data out
and let the libraries and the system worry about the buffering.
If you need a newline, just write a newline:
- <PRE>
+ <pre>
output &lt;&lt; &quot;a line of text\n&quot;
&lt;&lt; some_data_variable &lt;&lt; '\n'
- &lt;&lt; &quot;another line of text\n&quot;; </PRE>
+ &lt;&lt; &quot;another line of text\n&quot;; </pre>
I have also joined the output statements into a single statement.
You could make the code prettier by moving the single newline to
the start of the quoted text on the thing line, for example.
- </P>
- <P>If you do need to flush the buffer above, you can send an
- <TT>endl</TT> if you also need a newline, or just flush the buffer
+ </p>
+ <p>If you do need to flush the buffer above, you can send an
+ <code>endl</code> if you also need a newline, or just flush the buffer
yourself:
- <PRE>
+ <pre>
output &lt;&lt; ...... &lt;&lt; flush; // can use std::flush manipulator
- output.flush(); // or call a member fn </PRE>
- </P>
- <P>On the other hand, there are times when writing to a file should
+ output.flush(); // or call a member fn </pre>
+ </p>
+ <p>On the other hand, there are times when writing to a file should
be like writing to standard error; no buffering should be done
because the data needs to appear quickly (a prime example is a
log file for security-related information). The way to do this is
- just to turn off the buffering <EM>before any I/O operations at
- all</EM> have been done, i.e., as soon as possible after opening:
- <PRE>
+ just to turn off the buffering <em>before any I/O operations at
+ all</em> have been done, i.e., as soon as possible after opening:
+ <pre>
std::ofstream os (&quot;/foo/bar/baz&quot;);
std::ifstream is (&quot;/qux/quux/quuux&quot;);
int i;
@@ -159,49 +159,52 @@
is.rdbuf()-&gt;pubsetbuf(0,0);
...
os &lt;&lt; &quot;this data is written immediately\n&quot;;
- is &gt;&gt; i; // and this will probably cause a disk read </PRE>
- </P>
- <P>Since all aspects of buffering are handled by a streambuf-derived
- member, it is necessary to get at that member with <TT>rdbuf()</TT>.
- Then the public version of <TT>setbuf</TT> can be called. The
+ is &gt;&gt; i; // and this will probably cause a disk read </pre>
+ </p>
+ <p>Since all aspects of buffering are handled by a streambuf-derived
+ member, it is necessary to get at that member with <code>rdbuf()</code>.
+ Then the public version of <code>setbuf</code> can be called. The
arguments are the same as those for the Standard C I/O Library
function (a buffer area followed by its size).
- </P>
- <P>A great deal of this is implementation-dependant. For example,
- <TT>streambuf</TT> does not specify any actions for its own
- <TT>setbuf()</TT>-ish functions; the classes derived from
- <TT>streambuf</TT> each define behavior that &quot;makes
- sense&quot; for that class: an argument of (0,0) turns off
- buffering for <TT>filebuf</TT> but has undefined behavior for
- its sibling <TT>stringbuf</TT>, and specifying anything other
- than (0,0) has varying effects. Other user-defined class derived
- from streambuf can do whatever they want.
- </P>
- <P>A last reminder: there are usually more buffers involved than
+ </p>
+ <p>A great deal of this is implementation-dependent. For example,
+ <code>streambuf</code> does not specify any actions for its own
+ <code>setbuf()</code>-ish functions; the classes derived from
+ <code>streambuf</code> each define behavior that &quot;makes
+ sense&quot; for that class: an argument of (0,0) turns off buffering
+ for <code>filebuf</code> but has undefined behavior for its sibling
+ <code>stringbuf</code>, and specifying anything other than (0,0) has
+ varying effects. Other user-defined class derived from streambuf can
+ do whatever they want. (For <code>filebuf</code> and arguments for
+ <code>(p,s)</code> other than zeros, libstdc++ does what you'd expect:
+ the first <code>s</code> bytes of <code>p</code> are used as a buffer,
+ which you must allocate and deallocate.)
+ </p>
+ <p>A last reminder: there are usually more buffers involved than
just those at the language/library level. Kernel buffers, disk
buffers, and the like will also have an effect. Inspecting and
- changing those are system-dependant.
- </P>
- <P>Return <A HREF="#top">to top of page</A> or
- <A HREF="../faq/index.html">to the FAQ</A>.
- </P>
+ changing those are system-dependent.
+ </p>
+ <p>Return <a href="#top">to top of page</a> or
+ <a href="../faq/index.html">to the FAQ</a>.
+ </p>
-<HR>
-<H2><A NAME="3">Binary I/O</A></H2>
- <P>The first and most important thing to remember about binary I/O is
- that opening a file with <TT>ios::binary</TT> is not, repeat
- <EM>not</EM>, the only thing you have to do. It is not a silver
- bullet, and will not allow you to use the <TT>&lt;&lt;/&gt;&gt;</TT>
+<hr>
+<h2><a name="3">Binary I/O</a></h2>
+ <p>The first and most important thing to remember about binary I/O is
+ that opening a file with <code>ios::binary</code> is not, repeat
+ <em>not</em>, the only thing you have to do. It is not a silver
+ bullet, and will not allow you to use the <code>&lt;&lt;/&gt;&gt;</code>
operators of the normal fstreams to do binary I/O.
- </P>
- <P>Sorry. Them's the breaks.
- </P>
- <P>This isn't going to try and be a complete tutorial on reading and
+ </p>
+ <p>Sorry. Them's the breaks.
+ </p>
+ <p>This isn't going to try and be a complete tutorial on reading and
writing binary files (because &quot;binary&quot;
- <A HREF="#7">covers a lot of ground)</A>, but we will try and clear
+ <a href="#7">covers a lot of ground)</a>, but we will try and clear
up a couple of misconceptions and common errors.
- </P>
- <P>First, <TT>ios::binary</TT> has exactly one defined effect, no more
+ </p>
+ <p>First, <code>ios::binary</code> has exactly one defined effect, no more
and no less. Normal text mode has to be concerned with the newline
characters, and the runtime system will translate between (for
example) '\n' and the appropriate end-of-line sequence (LF on Unix,
@@ -213,137 +216,129 @@
if it is doing so in your program then you've discovered a bug in
your vendor's compiler (or some other part of the C++ implementation,
possibly the runtime system).
- </P>
- <P>Second, using <TT>&lt;&lt;</TT> to write and <TT>&gt;&gt;</TT> to
+ </p>
+ <p>Second, using <code>&lt;&lt;</code> to write and <code>&gt;&gt;</code> to
read isn't going to work with the standard file stream classes, even
- if you use <TT>skipws</TT> during reading. Why not? Because
- ifstream and ofstream exist for the purpose of <EM>formatting</EM>,
+ if you use <code>skipws</code> during reading. Why not? Because
+ ifstream and ofstream exist for the purpose of <em>formatting</em>,
not reading and writing. Their job is to interpret the data into
text characters, and that's exactly what you don't want to happen
during binary I/O.
- </P>
- <P>Third, using the <TT>get()</TT> and <TT>put()/write()</TT> member
+ </p>
+ <p>Third, using the <code>get()</code> and <code>put()/write()</code> member
functions still aren't guaranteed to help you. These are
&quot;unformatted&quot; I/O functions, but still character-based.
(This may or may not be what you want, see below.)
- </P>
- <P>Notice how all the problems here are due to the inappropriate use
- of <EM>formatting</EM> functions and classes to perform something
- which <EM>requires</EM> that formatting not be done? There are a
+ </p>
+ <p>Notice how all the problems here are due to the inappropriate use
+ of <em>formatting</em> functions and classes to perform something
+ which <em>requires</em> that formatting not be done? There are a
seemingly infinite number of solutions, and a few are listed here:
- <UL>
- <LI>&quot;Derive your own fstream-type classes and write your own
+ <ul>
+ <li>&quot;Derive your own fstream-type classes and write your own
&lt;&lt;/&gt;&gt; operators to do binary I/O on whatever data
types you're using.&quot; This is a Bad Thing, because while
the compiler would probably be just fine with it, other humans
are going to be confused. The overloaded bitshift operators
have a well-defined meaning (formatting), and this breaks it.
- <LI>&quot;Build the file structure in memory, then <TT>mmap()</TT>
+ <li>&quot;Build the file structure in memory, then <code>mmap()</code>
the file and copy the structure.&quot; Well, this is easy to
make work, and easy to break, and is pretty equivalent to
- using <TT>::read()</TT> and <TT>::write()</TT> directly, and
+ using <code>::read()</code> and <code>::write()</code> directly, and
makes no use of the iostream library at all...
- <LI>&quot;Use streambufs, that's what they're there for.&quot;
+ <li>&quot;Use streambufs, that's what they're there for.&quot;
While not trivial for the beginner, this is the best of all
solutions. The streambuf/filebuf layer is the layer that is
responsible for actual I/O. If you want to use the C++
library for binary I/O, this is where you start.
- </UL>
- </P>
- <P>How to go about using streambufs is a bit beyond the scope of this
+ </ul>
+ </p>
+ <p>How to go about using streambufs is a bit beyond the scope of this
document (at least for now), but while streambufs go a long way,
they still leave a couple of things up to you, the programmer.
As an example, byte ordering is completely between you and the
operating system, and you have to handle it yourself.
- </P>
- <P>Deriving a streambuf or filebuf
+ </p>
+ <p>Deriving a streambuf or filebuf
class from the standard ones, one that is specific to your data
types (or an abstraction thereof) is probably a good idea, and
lots of examples exist in journals and on Usenet. Using the
standard filebufs directly (either by declaring your own or by
- using the pointer returned from an fstream's <TT>rdbuf()</TT>)
+ using the pointer returned from an fstream's <code>rdbuf()</code>)
is certainly feasible as well.
- </P>
- <P>One area that causes problems is trying to do bit-by-bit operations
+ </p>
+ <p>One area that causes problems is trying to do bit-by-bit operations
with filebufs. C++ is no different from C in this respect: I/O
must be done at the byte level. If you're trying to read or write
a few bits at a time, you're going about it the wrong way. You
must read/write an integral number of bytes and then process the
bytes. (For example, the streambuf functions take and return
- variables of type <TT>int_type</TT>.)
- </P>
- <P>Another area of problems is opening text files in binary mode.
+ variables of type <code>int_type</code>.)
+ </p>
+ <p>Another area of problems is opening text files in binary mode.
Generally, binary mode is intended for binary files, and opening
text files in binary mode means that you now have to deal with all of
those end-of-line and end-of-file problems that we mentioned before.
An instructive thread from comp.lang.c++.moderated delved off into
this topic starting more or less at
- <A HREF="http://www.deja.com/getdoc.xp?AN=436187505">this</A>
+ <a href="http://www.deja.com/getdoc.xp?AN=436187505">this</a>
article and continuing to the end of the thread. (You'll have to
sort through some flames every couple of paragraphs, but the points
made are good ones.)
- </P>
+ </p>
-<HR>
-<H2><A NAME="4">Iostreams class hierarchy diagram</A></H2>
- <P>The <A HREF="iostreams_hierarchy.pdf">diagram</A> is in PDF. Rumor
- has it that once Benjamin Kosnik has been dead for a few decades,
- this work of his will be hung next to the Mona Lisa in the
- <A HREF="http://www.louvre.fr/">Musee du Louvre</A>.
- </P>
-
-<HR>
-<H2><A NAME="5">What is this &lt;sstream&gt;/stringstreams thing?</A></H2>
- <P>Stringstreams (defined in the header <TT>&lt;sstream&gt;</TT>)
+<hr>
+<h2><a name="5">What is this &lt;sstream&gt;/stringstreams thing?</a></h2>
+ <p>Stringstreams (defined in the header <code>&lt;sstream&gt;</code>)
are in this author's opinion one of the coolest things since
sliced time. An example of their use is in the Received Wisdom
section for Chapter 21 (Strings),
- <A HREF="../21_strings/howto.html#1.1internal"> describing how to
- format strings</A>.
- </P>
- <P>The quick definition is: they are siblings of ifstream and ofstream,
- and they do for <TT>std::string</TT> what their siblings do for
- files. All that work you put into writing <TT>&lt;&lt;</TT> and
- <TT>&gt;&gt;</TT> functions for your classes now pays off
- <EM>again!</EM> Need to format a string before passing the string
- to a function? Send your stuff via <TT>&lt;&lt;</TT> to an
+ <a href="../21_strings/howto.html#1.1internal"> describing how to
+ format strings</a>.
+ </p>
+ <p>The quick definition is: they are siblings of ifstream and ofstream,
+ and they do for <code>std::string</code> what their siblings do for
+ files. All that work you put into writing <code>&lt;&lt;</code> and
+ <code>&gt;&gt;</code> functions for your classes now pays off
+ <em>again!</em> Need to format a string before passing the string
+ to a function? Send your stuff via <code>&lt;&lt;</code> to an
ostringstream. You've read a string as input and need to parse it?
Initialize an istringstream with that string, and then pull pieces
- out of it with <TT>&gt;&gt;</TT>. Have a stringstream and need to
- get a copy of the string inside? Just call the <TT>str()</TT>
+ out of it with <code>&gt;&gt;</code>. Have a stringstream and need to
+ get a copy of the string inside? Just call the <code>str()</code>
member function.
- </P>
- <P>This only works if you've written your
- <TT>&lt;&lt;</TT>/<TT>&gt;&gt;</TT> functions correctly, though,
+ </p>
+ <p>This only works if you've written your
+ <code>&lt;&lt;</code>/<code>&gt;&gt;</code> functions correctly, though,
and correctly means that they take istreams and ostreams as
parameters, not i<B>f</B>streams and o<B>f</B>streams. If they
take the latter, then your I/O operators will work fine with
file streams, but with nothing else -- including stringstreams.
- </P>
- <P>If you are a user of the strstream classes, you need to update
- your code. You don't have to explicitly append <TT>ends</TT> to
+ </p>
+ <p>If you are a user of the strstream classes, you need to update
+ your code. You don't have to explicitly append <code>ends</code> to
terminate the C-style character array, you don't have to mess with
&quot;freezing&quot; functions, and you don't have to manage the
memory yourself. The strstreams have been officially deprecated,
which means that 1) future revisions of the C++ Standard won't
support them, and 2) if you use them, people will laugh at you.
- </P>
+ </p>
-<HR>
-<H2><A NAME="6">Deriving a stream buffer</A></H2>
- <P>Creating your own stream buffers for I/O can be remarkably easy.
+<hr>
+<h2><a name="6">Deriving a stream buffer</a></h2>
+ <p>Creating your own stream buffers for I/O can be remarkably easy.
If you are interested in doing so, we highly recommend two very
- excellent books: <EM>Standard C++ IOStreams and Locales</EM> by
+ excellent books: <em>Standard C++ IOStreams and Locales</em> by
Langer and Kreft, ISBN 0-201-18395-1, and
- <A HREF="http://www.josuttis.com/libbook/">The C++ Standard Library</A>
+ <a href="http://www.josuttis.com/libbook/">The C++ Standard Library</a>
by Nicolai Josuttis, ISBN 0-201-37926-0. Both are published by
Addison-Wesley, who isn't paying us a cent for saying that, honest.
- </P>
- <P>Here is a simple example, io/outbuf1, from the Josuttis text. It
+ </p>
+ <p>Here is a simple example, io/outbuf1, from the Josuttis text. It
transforms everything sent through it to uppercase. This version
assumes many things about the nature of the character type being
used (for more information, read the books or the newsgroups):
- <PRE>
+ <pre>
#include &lt;iostream&gt;
#include &lt;streambuf&gt;
#include &lt;locale&gt;
@@ -374,54 +369,192 @@
// create special output buffer
outbuf ob;
// initialize output stream with that output buffer
- std::ostream out(&ob);
+ std::ostream out(&amp;ob);
out &lt;&lt; "31 hexadecimal: "
&lt;&lt; std::hex &lt;&lt; 31 &lt;&lt; std::endl;
return 0;
}
- </PRE>
+ </pre>
Try it yourself!
- </P>
+ </p>
-<HR>
-<H2><A NAME="7">More on binary I/O</A></H2>
- <P>Towards the beginning of February 2001, the subject of
+<hr>
+<h2><a name="7">More on binary I/O</a></h2>
+ <p>Towards the beginning of February 2001, the subject of
&quot;binary&quot; I/O was brought up in a couple of places at the
same time. One notable place was Usenet, where James Kanze and
Dietmar K&uuml;hl separately posted articles on why attempting
generic binary I/O was not a good idea. (Here are copies of
- <A HREF="binary_iostreams_kanze.txt">Kanze's article</A> and
- <A HREF="binary_iostreams_kuehl.txt">K&uuml;hl's article</A>.)
- </P>
- <P>Briefly, the problems of byte ordering and type sizes mean that
- the unformatted functions like <TT>ostream::put()</TT> and
- <TT>istream::get()</TT> cannot safely be used to communicate
+ <a href="binary_iostreams_kanze.txt">Kanze's article</a> and
+ <a href="binary_iostreams_kuehl.txt">K&uuml;hl's article</a>.)
+ </p>
+ <p>Briefly, the problems of byte ordering and type sizes mean that
+ the unformatted functions like <code>ostream::put()</code> and
+ <code>istream::get()</code> cannot safely be used to communicate
between arbitrary programs, or across a network, or from one
invocation of a program to another invocation of the same program
on a different platform, etc.
- </P>
- <P>The entire Usenet thread is instructive, and took place under the
+ </p>
+ <p>The entire Usenet thread is instructive, and took place under the
subject heading &quot;binary iostreams&quot; on both comp.std.c++
and comp.lang.c++.moderated in parallel. Also in that thread,
Dietmar K&uuml;hl mentioned that he had written a pair of stream
classes that would read and write XDR, which is a good step towards
a portable binary format.
- </P>
+ </p>
+
+<hr>
+<h2><a name="8">Pathetic performance? Ditch C.</a></h2>
+ <p>It sounds like a flame on C, but it isn't. Really. Calm down.
+ I'm just saying it to get your attention.
+ </p>
+ <p>Because the C++ library includes the C library, both C-style and
+ C++-style I/O have to work at the same time. For example:
+ <pre>
+ #include &lt;iostream&gt;
+ #include &lt;cstdio&gt;
+
+ std::cout &lt;&lt; &quot;Hel&quot;;
+ std::printf (&quot;lo, worl&quot;);
+ std::cout &lt;&lt; &quot;d!\n&quot;;
+ </pre>
+ This must do what you think it does.
+ </p>
+ <p>Alert members of the audience will immediately notice that buffering
+ is going to make a hash of the output unless special steps are taken.
+ </p>
+ <p>The special steps taken by libstdc++, at least for version 3.0,
+ involve doing very little buffering for the standard streams, leaving
+ most of the buffering to the underlying C library. (This kind of
+ thing is <a href="../explanations.html#cstdio">tricky to get right</a>.)
+ The upside is that correctness is ensured. The downside is that
+ writing through <code>cout</code> can quite easily lead to awful
+ performance when the C++ I/O library is layered on top of the C I/O
+ library (as it is for 3.0 by default). Some patches are in the
+ works which should improve the situation for 3.1.
+ </p>
+ <p>However, the C and C++ standard streams only need to be kept in sync
+ when both libraries' facilities are in use. If your program only uses
+ C++ I/O, then there's no need to sync with the C streams. The right
+ thing to do in this case is to call
+ <pre>
+ #include <em>any of the I/O headers such as ios, iostream, etc</em>
+
+ std::ios::sync_with_stdio(false);
+ </pre>
+ </p>
+ <p>You must do this before performing any I/O via the C++ stream objects.
+ Once you call this, the C++ streams will operate independently of the
+ (unused) C streams. For GCC 3.0, this means that <code>cout</code> and
+ company will become fully buffered on their own.
+ </p>
+ <p>Note, by the way, that the synchronization requirement only applies to
+ the standard streams (<code>cin</code>, <code>cout</code>,
+ <code>cerr</code>,
+ <code>clog</code>, and their wide-character counterparts). File stream
+ objects that you declare yourself have no such requirement and are fully
+ buffered.
+ </p>
+
+<hr>
+<h2><a name="9">Threads and I/O</a></h2>
+ <p>I'll assume that you have already read the
+ <a href="../17_intro/howto.html#3">general notes on library threads</a>,
+ and the
+ <a href="../23_containers/howto.html#3">notes on threaded container
+ access</a> (you might not think of an I/O stream as a container, but
+ the points made there also hold here). If you have not read them,
+ please do so first.
+ </p>
+ <p>This gets a bit tricky. Please read carefully, and bear with me.
+ </p>
+ <h3>Structure</h3>
+ <p>As described <a href="../explanations.html#cstdio">here</a>, a wrapper
+ type called <code>__basic_file</code> provides our abstraction layer
+ for the <code>std::filebuf</code> classes. Nearly all decisions dealing
+ with actual input and output must be made in <code>__basic_file</code>.
+ </p>
+ <p>A generic locking mechanism is somewhat in place at the filebuf layer,
+ but is not used in the current code. Providing locking at any higher
+ level is akin to providing locking within containers, and is not done
+ for the same reasons (see the links above).
+ </p>
+ <h3>The defaults for 3.0.x</h3>
+ <p>The __basic_file type is simply a collection of small wrappers around
+ the C stdio layer (again, see the link under Structure). We do no
+ locking ourselves, but simply pass through to calls to <code>fopen</code>,
+ <code>fwrite</code>, and so forth.
+ </p>
+ <p>So, for 3.0, the question of &quot;is multithreading safe for I/O&quot;
+ must be answered with, &quot;is your platform's C library threadsafe
+ for I/O?&quot; Some are by default, some are not; many offer multiple
+ implementations of the C library with varying tradeoffs of threadsafety
+ and efficiency. You, the programmer, are always required to take care
+ with multiple threads.
+ </p>
+ <p>(As an example, the POSIX standard requires that C stdio FILE*
+ operations are atomic. POSIX-conforming C libraries (e.g, on Solaris
+ and GNU/Linux) have an internal mutex to serialize operations on
+ FILE*s. However, you still need to not do stupid things like calling
+ <code>fclose(fs)</code> in one thread followed by an access of
+ <code>fs</code> in another.)
+ </p>
+ <p>So, if your platform's C library is threadsafe, then your
+ <code>fstream</code> I/O operations will be threadsafe at the lowest
+ level. For higher-level operations, such as manipulating the data
+ contained in the stream formatting classes (e.g., setting up callbacks
+ inside an <code>std::ofstream</code>), you need to guard such accesses
+ like any other critical shared resource.
+ </p>
+ <h3>The future</h3>
+ <p>As already mentioned <a href="../explanations.html#cstdio">here</a>, a
+ second choice is available for I/O implementations: libio. This is
+ disabled by default, and in fact will not currently work due to other
+ issues. It will be revisited, however.
+ </p>
+ <p>The libio code is a subset of the guts of the GNU libc (glibc) I/O
+ implementation. When libio is in use, the <code>__basic_file</code>
+ type is basically derived from FILE. (The real situation is more
+ complex than that... it's derived from an internal type used to
+ implement FILE. See libio/libioP.h to see scary things done with
+ vtbls.) The result is that there is no &quot;layer&quot; of C stdio
+ to go through; the filebuf makes calls directly into the same
+ functions used to implement <code>fread</code>, <code>fwrite</code>,
+ and so forth, using internal data structures. (And when I say
+ &quot;makes calls directly,&quot; I mean the function is literally
+ replaced by a jump into an internal function. Fast but frightening.
+ *grin*)
+ </p>
+ <p>Also, the libio internal locks are used. This requires pulling in
+ large chunks of glibc, such as a pthreads implementation, and is one
+ of the issues preventing widespread use of libio as the libstdc++
+ cstdio implementation.
+ </p>
+ <p>But we plan to make this work, at least as an option if not a future
+ default. Platforms running a copy of glibc with a recent-enough
+ version will see calls from libstdc++ directly into the glibc already
+ installed. For other platforms, a copy of the libio subsection will
+ be built and included in libstdc++.
+ </p>
+ <h3>Alternatives</h3>
+ <p>Don't forget that other cstdio implemenations are possible. You could
+ easily write one to perform your own forms of locking, to solve your
+ &quot;interesting&quot; problems.
+ </p>
<!-- ####################################################### -->
-<HR>
-<P CLASS="fineprint"><EM>
+<hr>
+<p class="fineprint"><em>
+See <a href="../17_intro/license.html">license.html</a> for copying conditions.
Comments and suggestions are welcome, and may be sent to
-<A HREF="mailto:pme@sources.redhat.com">Phil Edwards</A> or
-<A HREF="mailto:gdr@gcc.gnu.org">Gabriel Dos Reis</A>.
-<BR> $Id: howto.html,v 1.2 2001/01/23 17:02:27 pme Exp $
-</EM></P>
+<a href="mailto:libstdc++@gcc.gnu.org">the libstdc++ mailing list</a>.
+</em></p>
-</BODY>
-</HTML>
+</body>
+</html>
diff --git a/libstdc++-v3/docs/html/27_io/iostreams_hierarchy.pdf b/libstdc++-v3/docs/html/27_io/iostreams_hierarchy.pdf
deleted file mode 100644
index ab889130017..00000000000
--- a/libstdc++-v3/docs/html/27_io/iostreams_hierarchy.pdf
+++ /dev/null
@@ -1 +0,0 @@
-%PDF-1.2 1 0 obj << /Type /Catalog /Pages 2 0 R >> endobj 2 0 obj << /Type /Pages /Count 1 /Kids [3 0 R] >> endobj 3 0 obj << /Type /Page /Parent 2 0 R /MediaBox [0 0 841 595] /Resources 4 0 R /Contents 5 0 R /PieceInfo << /Illustrator7.0 << /LastModified (D:19990723224941+00'00') >> >> >> endobj 4 0 obj << /ProcSet [/PDF /Text] /Font 6 0 R >> endobj 6 0 obj << /F0 7 0 R >> endobj 5 0 obj << /Length 4532 /Filter [/ASCII85Decode /FlateDecode] >> stream GhUtXCMt.N(B"F5&+aY/@Qi]I;%s0lBq&tK!K+"a/W^0g,*/;JNiYL/lXkYFSkBQ+3$VRLAAp6[+Gk2p ]Y$V'q][Ii0`9nKmh=9$qUafIYES-6c9>:0iiB70cd1lN;\^Z5B(On5=3Kp1o4O9Ms/FWC4.r(nFZ"ID e#N8>Y&;s3hk&Gh=oPY>g/R7S`N35&lSnKGJT'N#f3]=I^3Ma7p@ZTLj1W%,c`?_IA&WBR:iYE0/De,) .5tSk?gUfI?gLVJ]B-%RhCB-/&1(hF(H3"13[7AhH6TkcV(T9#\l_XZ&A6prLn^=89]&sO]lO>H;AgG. E*Ffh#_X%&%CJ$hiAQ5#<*ID"b0kT-./,#D&_iK%9J/jH(%lNWYDLdVe&3s]TMfhIS&j#;9I<#\Qb$,7 OX=,>d],8TWGK,=QAXgt=(NL2B`c5r3!;DaCQfNY@HgI98u#(\L+TN8Jl%5*BSV6Z6K9q_Z)(MW:'d`5 CE&^O_Q6P>1m6SXTkQu$46r]!#A8?WKTu\^;IZ(1X`PciW(Q<b9St7$/PmuU"7IFkTf`i@74CZoOg3Q4 -8JdE-Z-UV=F1^S;CfZ6i]+-?S+NOUXBQ[Dd518[C6_gi.RoYa)O&0`>+Lf.<gc3TB7-S8&)o[FGYO:: ROcia<mnX-AkF_'d\6cMjd6.P77UNM>k&6r_R]!C16>/_7.8)ebcN7*<XRq/lq9#dMG&X8*Q+n-"f)Ct -Kq%oVLtt$I/;]D9[N[YMr&Eh1B@i&+(p[L)[%tYK9S&K1_Hg1Yi-H-(2%&c9S,gb6]4hFgU,<m8ak^' ]&^\fXYV8%JH:k*9@#q'?5aFKgm/kELN*O!2P_EA>qjii`eZi1/lL%Sq>dU+ngdD%eur2Ir!M];qA%XP nggM_lW7J!bTqU+1.e,$hd?==gUobOrnIVuqu)sI^0ESJMlYEI^7K1Boq03mjIdgC#]cL-`Mp(D""BX_ 4*ghojioIOq<!)+9$kKa4aA(PrNiLWherkKe6">^$>j-UD`2S$S<loOa*;@3KdYd%KD.'N1@Q=$`*"6! kjVmbD0",E36[]"]n?fB5Im5q3(%r#]Kg"1bi1b_Z<Ws8C9FVsN<L+]Aeuu;nG8U4<F<J4Xl@f./1:6d RN-)+R8\#qj_oST,)[7?B^=.l"1R-L\cseQ$t8Qc1gn;U`IppE4NlE=EL]_%+04(?I<A]"9tY9IH?6Bk (*B!uVYY%"?-]$]W9(]h-\!eHB?qi>)U@SX26/\%YFiKkq]SH'UgFsDKYc3pK<*th-hCrY?5N'BlZta# XuECr[WqMT*<R;XFsjE=npN%^gU$D,I=)FbGjJWIeGC!tSAW.O,`$ik"&/oI#fc)9H!D#6Vt1f?1Gk5I %SXh"[=r[>BHe=_R7LH*hKeO"[W?DCL1*,ub^MT0XZm%bleOB\KK]eSSfp?Yd)Uop%!fsF5729u=_ZrQ 5i@n<m],H'\"P75)O[4Z+pK$V!DNWWo`1*$34aQ%3bC^nrh2D/)$>/UVhOk%R==$MqJL_I=6iS#FhP;d 2Ufpk&(MK2D4[<sGN*=iZh);\o_%i#4skNYE2RAkl9hV^#j_>:eTU]13N@h:pI!M%FR(1,0_QrEs+Q$' Yn2o%b82KoY(S\8Pd88GM)kr+\o3H%i1p+NQ0K1E_t@s\pi$i7GVkCc"r:[KJu^'S\<74km['*s#_\Ft dMtM_6;h@h@Xq':.(O*fP^rU]N.D+#-m,3igY6dHDAg)`Pc^^`PkR6[#7dB$&m<*P$o:\9>RPgW*&XO: =AJ*0Yqp!^F@ld:d@mtqV%U&G7$WCp^tP0cWR`Fi\,aRdr7U!:Cd_.&3$"/Ee0;p&J8WO>BkO<5Vi34m 7O=jKMcj^c`DsuQ7&c/HYmi"_5%_(>kr8t6*NoP5:e2bi&TMLFZW[O#aDk322g:'@0^j[o+dY&WH1=bO .5iY75"c']o1"[T&)?Y&?^*Q!WeRT]g9Bo\<d53IJhS3cr>ocqOAgR@"4h\b^tXf)'7dPL?<H=$+Srn# ="i0(KYM9FHTj.M/_<JuH)E&n\.i2$`O.",IDpWK\0t6@2,q>>[(>+T4=g/*U.0cD''>im=>33CX'CB; 3GJX7QE_7QK=<L:/&BrJ<n,j@q0[Jk]NAu&Rb?eK8),?aISm<$mepQoc0KMc]K003%B[GFhQop>04O^T Y;TT?I\&I@q5g"@TW[#C->uYV^H=klN'`Do:g44"6nm6Tr-GXCpaIu4.!A.l99YQFY7\B@RsIqM*r$L: ctp+YI=*i@S[\K\R_G:Lc+D[,GNc9fCo]L5+7FWa0\DE`.,n0-oYYaG;[jClT-,@fT`A!.$l0]d70>8& B2h**HZlu[*6;P:D\9*7o*f:V!7OpNp^k&9^Du'>a!=G06qosuDO;9WG&PPrhd'UE_5!QLVIXN?3kefN S)$62YNh%W3oAP7T>L9OFFLoL5jrpIjTBg1<sNNT6sBEeeZ&EJFJnPN.%c+XQX;@0<*,">q$o2*oE"*" #MjR0VX;"P?T^dW4f?oH[02C`1F3P*&bn;/$"54+HToa31o9QYBA4E2-MB,p)'7MA_4rcY8H<DjkL:dX j9>6p,*>Ye>MJNe+i?d8NU3c;RgeDM[M7b&\Egn`&g8I+]ePi'UB=X/WH9dDIHtH)X`qkOd%N"&E`qe= ?C"#SYq<"D#I:GXRB6%_QXsi[BhMK^%V-HR10NkrJK&KaWXQnDou/BF*pHQ#n3ORHThoac+*Yb"dV.30 jM4,s=K)(LjAZbj$uIba,:_-`>WX14KH.\GNa%Z91hBVdEouFiBIfLZe'R<"m*r.u[Ss*f^o-97="l59 0;]h"VcRV69',:O:;V@O.ZV.TM.$^-En$cc=3ej,]p"PO[r*65)<Akl+ORFG-bI'=n[/%7F4LUXV0#IQ ql$T9.S:VbVF--?M'4_AgkF+e\.Wt</Z7(pVok:NEb&0'O%:&6O[V%Zp/4r\7j/7Yf:-r*Ki`,)P:\@I Zl,NU49g3Y@laoZ\q`1!d>!\T8[RDOPr?f5mpc-H830fjj?mOD&V2fGJ0;nXLjUYB7S;iW!$qjV;3)2" +p6_sKT,_'lJH#s.$JZoaCQVu3UpW/oCrX:X4?e;6^Bu\FcMQ*oIXa_hQd'=>[o[^$SJ%Da5fBUpW2&o rR<tr#:AjCh7HL>RU_+s_\t&T5Y`>dV]'S-k@"Q_kM?n_.I&4da\chQkMCLk)1%@f4\9GX#!HfnpZSEd 5B4@A0t)n-ciJ-WAjb9Ai!?.?F9;/<=hf^D5%cfket6q?T``S$NEX'@qD/F@qIuIR-.3o33<0"0Z2*C& ](Tdo:@SsHBq*3gY@lfrQ[90l\$q+^c-^g0-3t+"EZa%<[+CI;?,F"&F!tPGJGBK!YuEtS^Mj9R"Iekj ftBa(*OOrY;2DU%`o3kZF#L!cVp0<t&eN:--adY9So2.aS']$kd1+ntV+UsJnIg/UUOu9/M0QLqLGS4$ EpkuEa/iKk"\.Zg:5%)@-1JLiA8%1%FK^6EDUW<+&<MGJ)YkiL(a0h1"l7)I;G&mVE3"u+`sk\s#s,Lr [%Tl("F3&o0X*Pf1UJ$mFT&51K1nUmhJM8C1eg&(=E&i4/(G;n9<^n>L-BKO8n.PU;?r:TE:TE=Ug9K7 !N&L88e(4u=W"i,"cZ<e\#p0['CYG,RQ-#1?mM<ronm.,$#KmF$>?qFSk8.n>E?ad$qUprd3T>7CH16s 4(],a>iE0c7#WqRT.IqDUJll/WsBaY+eHbLpWU#QjTQ0aoa,:UJ=/+5M2!W7E1fE,-t0eH+m<,]+hjGn M'aa8<X=08/S5-G;BsL72iK\X-9>e_U[@eh1I)Cd!4MWnHO2i]&!)gJ`E;)5'Y;lfW-c`Rrm<RGq'./q a*/kcA@NMrM,A+(N"k`2-36dK.,G#\;OkqkV%>h7SCpj.DWjc(`,PSO_oPJbKPG/RJ<c/]ku95/UE47V W2?UPd=Q]G*I&[K[^'EL@XQd1r]Mppe4k,k]#.[uj6`%0C6ID/WV/>6HG&htqbr484ODB,["l69o4n9F i)8b-L%'&bR!>dH;\*!YB"Io8>$Wu.S,QU.iO`0ZY;Mu(')F>_.g?f&Kq^t6a\op<%ifGI2?T1@\fU<N AeKF^p;kt"='2%(Z;G$.FcPt48<3+;0+N$&<4!j=Q,BqL-Gkfno7QW;[HHUra6`$f!)@SU;a@/.VtA.n qUq+gU:!t;Z16Xi]'S^YEej4SdqqPqIac-]&#Zr/\s/F3ok6-H+iqZMk*^`0]SA.8Z92tB+Oa:`.GjYX l5=8#a4F:*m%H^]i`2^=n3RYmPG`I)FnF.\,9.kG&U1dEMH=i'm`H!AjDqim@Z_=aphJkL*M=8;V2eVq i?cA_"IW<6[=gFu8j@%jlI&HHK7FBCeZgG554#Lg.WMC0qXc%@n>!E4Q_?<[Fg&Df40DH29ln?<1(*I( *NMEfeVDBiQ[)(Ind`qAo(c4L3/+\H8?^>$PP"*O-o0p2HN^\%3V9r`NO/"VWSQH=-iXDQ?kBF~> endstream endobj 7 0 obj << /Type /Font /Subtype /Type1 /Name /F0 /BaseFont /Helvetica /Encoding /MacRomanEncoding >> endobj xref 0 8 0000000000 65535 f 0000000009 00000 n 0000000058 00000 n 0000000115 00000 n 0000000298 00000 n 0000000384 00000 n 0000000353 00000 n 0000005005 00000 n trailer << /Root 1 0 R /Size 8 >> startxref 5113 %%EOF \ No newline at end of file
diff --git a/libstdc++-v3/docs/html/Makefile b/libstdc++-v3/docs/html/Makefile
index bedbd883f18..df46f74d7a2 100644
--- a/libstdc++-v3/docs/html/Makefile
+++ b/libstdc++-v3/docs/html/Makefile
@@ -1,5 +1,13 @@
+MAKEINFO=makeinfo
+INC=../../../gcc/doc/include
+
+all: faq/index.txt 17_intro/porting.html
+
faq/index.txt: faq/index.html
- lynx -dump faq/index.html | sed "s%file://localhost`pwd`%..%" > $@
+ lynx -dump $< | sed "s%file://localhost`pwd`%..%" > $@
+
+17_intro/porting.html: 17_intro/porting.texi
+ ${MAKEINFO} -I ${INC} --html --no-split $< -o $@
diff --git a/libstdc++-v3/docs/html/configopts.html b/libstdc++-v3/docs/html/configopts.html
index 78572aa902e..fa1bb29b5ec 100644
--- a/libstdc++-v3/docs/html/configopts.html
+++ b/libstdc++-v3/docs/html/configopts.html
@@ -1,116 +1,141 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-<HEAD>
- <META NAME="AUTHOR" CONTENT="pme@sources.redhat.com (Phil Edwards)">
- <META NAME="KEYWORDS" CONTENT="libstdc++, libstdc++-v3, GCC, g++">
- <META NAME="DESCRIPTION" CONTENT="Configuration options for libstdc++-v3.">
- <META NAME="GENERATOR" CONTENT="vi and eight fingers">
- <TITLE>libstdc++-v3 configure options</TITLE>
-<LINK REL=StyleSheet HREF="lib3styles.css">
-<!-- $Id: configopts.html,v 1.5 2001/01/30 09:18:50 bkoz Exp $ -->
-</HEAD>
-<BODY>
+<html>
+<head>
+ <meta name="AUTHOR" content="pme@gcc.gnu.org (Phil Edwards)">
+ <meta name="KEYWORDS" content="libstdc++, libstdc++-v3, GCC, g++">
+ <meta name="DESCRIPTION" content="Configuration options for libstdc++-v3.">
+ <meta name="GENERATOR" content="vi and eight fingers">
+ <title>libstdc++-v3 configure options</title>
+<link rel="StyleSheet" href="lib3styles.css">
+</head>
+<body>
-<H1 CLASS="centered"><A NAME="top">Interesting <TT>configure</TT>
-options</A></H1>
+<h1 class="centered"><a name="top">Interesting <code>configure</code>
+options</a></h1>
-<P>The latest version of this document is always available at
- <A HREF="http://gcc.gnu.org/onlinedocs/libstdc++/configopts.html">
- http://gcc.gnu.org/onlinedocs/libstdc++/configopts.html</A>.
-</P>
+<p>The latest version of this document is always available at
+ <a href="http://gcc.gnu.org/onlinedocs/libstdc++/configopts.html">
+ http://gcc.gnu.org/onlinedocs/libstdc++/configopts.html</a>.
+</p>
-<P>To the <A HREF="http://gcc.gnu.org/libstdc++/">libstdc++-v3 homepage</A>.
+<p>To the <a href="http://gcc.gnu.org/libstdc++/">libstdc++-v3 homepage</a>.
<!-- ####################################################### -->
-<HR>
-<P>Here are some of the non-obvious options to libstdc++'s configure.
+<hr>
+<p>Here are some of the non-obvious options to libstdc++'s configure.
Keep in mind that
<!-- This SECnn should be the "Choosing Package Options" section. -->
- <A HREF="http://sources.redhat.com/autoconf/autoconf.html#SEC74">they
- all have opposite forms as well</A>
+ <a href="http://sources.redhat.com/autoconf/autoconf.html#SEC74">they
+ all have opposite forms as well</a>
(enable/disable and with/without). The defaults are for current
development sources.
-</P>
-<P>The canonical way to find out the configure options that are
+</p>
+<p>The canonical way to find out the configure options that are
available for a given set of libstdc++ sources is to go to the
- source directory and then type:<TT> ./configure --help</TT>
+ source directory and then type:<code> ./configure --help</code>
-<DL>
- <DT><TT>--enable-multilib </TT>[default]
- <DD><P>This is part of the generic multilib support for building cross
+<dl>
+ <dt><code>--enable-multilib </code>[default]
+ <dd><p>This is part of the generic multilib support for building cross
compilers. As such, targets like &quot;powerpc-elf&quot; will have
libstdc++ built many different ways: &quot;-msoft-float&quot;
and not, etc. A different libstdc++ will be built for each of
the different multilib versions. This option is on by default.
- </P>
-
- <DT><TT>--enable-debug </TT>
- <DD><P>The configure script will automatically detect the highest level
- of optimization that the compiler in use can use (certain
- versions of g++ will ICE if given the <TT>-O2</TT> option, but
- this is fixed in later versions of the compiler). This --enable
- flag will disable all optimizations and instruct the compiler to
- emit as much extra debugging information as it can, for use
- inside GDB.
- </P>
-
- <DT><TT>--enable-cstdio </TT>
- <DD><P>This is an abbreviated form of <TT>'--enable-cstdio=stdio'</TT>
+ </p>
+
+ <dt><code>--enable-debug </code>
+ <dd><p>The configure script will automatically detect the highest
+ level of optimization that the compiler in use can use
+ (certain versions of g++ will ICE if given the <code>-O2</code>
+ option, but this is fixed in later versions of the compiler).
+ This --enable flag will disable all optimizations and instruct
+ the compiler to emit as much extra debugging information as it
+ can, for use inside GDB. Note this make command, executed in
+ the build directory, will do much the same thing, without the
+ configuration difference:<code>make CXXFLAGS='-g -O0' all</code>
+ </p>
+
+ <dt><code>--enable-cstdio </code>
+ <dd><p>This is an abbreviated form of <code>'--enable-cstdio=stdio'</code>
(described next).
- </P>
+ </p>
- <DT><TT>--enable-cstdio=LIB </TT>
- <DD><P>Select a target-specific I/O package. As of libstdc++-v3
+ <dt><code>--enable-cstdio=LIB </code>
+ <dd><p>Select a target-specific I/O package. As of libstdc++-v3
snapshot 2.91, the choices are 'libio' to specify the GNU
I/O package (from
- <A HREF="http://sources.redhat.com/glibc/">glibc</A>, the
+ <a href="http://sources.redhat.com/glibc/">glibc</a>, the
GNU C library), or 'stdio' to use a generic &quot;C&quot;
- abstraction. The default is 'stdio'.
- </P>
-
- <DT><TT>--enable-clocale </TT>
- <DD><P>This is an abbreviated form of <TT>'--enable-clocale=generic'</TT>
+ abstraction. The default is 'stdio'. A longer explanation
+ is <a href="explanations.html#cstdio">here</a>.
+ </p>
+
+ <dt><code>--enable-sjlj-exceptions </code>
+ <dd><p>Forces old, set-jump/long-jump exception handling model. If
+ at all possible, the new, frame unwinding exception handling routines
+ should be used instead, as they significantly reduce both runtime
+ memory usage and executable size.
+ </p>
+
+ <dt><code>--enable-clocale </code>
+ <dd><p>This is an abbreviated form of <code>'--enable-clocale=generic'</code>
(described next).
- </P>
-
- <DT><TT>--enable-clocale=MODEL </TT>
- <DD><P>Select a target-specific underlying locale package. The
- choices are 'gnu' to specify an X/Open (IEEE Std. 1003.1-200x)
- model based on langinfo/iconv (from <A
- HREF="http://sources.redhat.com/glibc/">glibc</A>, the GNU C
+ </p>
+
+ <dt><code>--enable-clocale=MODEL </code>
+ <dd><p>Select a target-specific underlying locale package. The
+ choices are 'ieee_1003.1' to specify an X/Open, Standard Unix
+ (IEEE Std. 1003.1-200x) model based on langinfo/iconv/catgets,
+ 'gnu' to specify a model based on functionality from the GNU C
+ library (langinfo/iconv/gettext) (from <A
+ href="http://sources.redhat.com/glibc/">glibc</a>, the GNU C
library), or 'generic' to use a generic &quot;C&quot;
- abstraction which consists of &quot;C&quot; locale info.
- The default is 'generic'.
- </P>
-
- <DT><TT>--enable-long-long </TT>
- <DD><P>The &quot;long long&quot; type was introduced in C99. It is
+ abstraction which consists of &quot;C&quot; locale info. The
+ default is 'generic'.
+ </p>
+
+ <dt><code>--enable-c99 </code>
+ <dd><p>The &quot;long long&quot; type was introduced in C99, along
+ with many other functions for wide characters, and math
+ classification macros, etc. If enabled, all C99 functions not
+ specified by the C++ standard will be put into <code>namespace
+ __gnu_cxx</code>, and then all these names will
+ be injected into namespace std, so that C99 functions can be
+ used &quot;as if&quot; they were in the C++ standard (as they
+ will eventually be in some future revision of the standard,
+ without a doubt). By default, C99 support is on, assuming the
+ configure probes find all the necessary functions and bits
+ necessary.
+ </p>
+
+ <dt><code>--enable-long-long </code>
+ <dd><p>The &quot;long long&quot; type was introduced in C99. It is
provided as a GNU extension to C++98 in g++. This flag builds
- support for &quot;long long&quot; into the library
- (specialized templates and the like). This option is off by
- default: if enabled, users will have to either use the
- new-style &quot;C&quot; headers by default (ie cmath not math.h)
+ support for &quot;long long&quot; into the library (specialized
+ templates and the like for iostreams). This option is on by default:
+ if enabled, users will have to either use the new-style &quot;C&quot;
+ headers by default (i.e., &lt;cmath&gt; not &lt;math.h&gt;)
or add appropriate compile-time flags to all compile lines to
allow &quot;C&quot; visibility of this feature (on GNU/Linux,
- the flag is -D_ISOC99_SOURCE).
- </P>
-
- <DT><TT>--enable-cheaders=OPTION </TT>
- <DD><P>This allows the user to define what kind of C headers are
- used. Options are: c, c_std, and c_shadow. These correspond
- to the source directory's include/c, include/c_std, and
- include/c_shadow directories.
- The default is c_std.
- </P>
-
- <DT><TT>--enable-threads </TT>
- <DD><P>This is an abbreviated form of <TT>'--enable-threads=yes'</TT>
+ the flag is -D_ISOC99_SOURCE, which is added automatically via
+ CPLUSPLUS_CPP_SPEC's addition of _GNU_SOURCE).
+ </p>
+
+ <dt><code>--enable-cheaders=OPTION </code>
+ <dd><p>This allows the user to define what kind of C headers are
+ used. Options are: c, c_std, and c_shadow. These correspond
+ to the source directory's include/c, include/c_std, and
+ include/c_shadow directories. The default is c_std.
+ </p>
+
+ <dt><code>--enable-threads </code>
+ <dd><p>This is an abbreviated form of <code>'--enable-threads=yes'</code>
(described next).
- </P>
+ </p>
- <DT><TT>--enable-threads=LIB </TT>
- <DD><P>Select a threading library. As of libstdc++-v3 snapshot 2.91,
+ <dt><code>--enable-threads=LIB </code>
+ <dd><p>Select a threading library. As of libstdc++-v3 snapshot 2.91,
the choices are:
'yes' for some kind of default (hmmmmm);
'decosf1', 'irix', 'mach', 'os2', 'posix'/'pthreads'
@@ -119,82 +144,82 @@ options</A></H1>
corresponding interface;
and 'single', 'no', or 'none' for the null-case,
single-threaded library.
- </P>
- <P>All of this is currently undergoing a lot of changes. As of
+ </p>
+ <p>All of this is currently undergoing a lot of changes. As of
2.91, 'single' and 'posix' are the only implemented
models. Default is single.
- </P>
-
- <DT><TT>--enable-version-specific-runtime-libs </TT>
- <DD><P>Specify that run-time libraries should be installed in the
- compiler-specific subdirectory (i.e.,
- <TT>$(libdir)/gcc-lib/$(target_alias)/$(gcc_version)</TT>)
- instead of <TT>$(libdir)</TT>. This option is useful if you
- intend to use several versions of gcc in parallel. In addition,
- libstdc++'s include files will be installed in
- <TT>$(libdir)/gcc-lib/$(target_alias)/$(gcc_version)/include/g++</TT>,
- unless you also specify
- <TT>--with-gxx-include-dir=_dirname_</TT> during configuration.
- </P>
-
- <DT><TT>--with-gxx-include-dir=&lt;include-files dir&gt;</TT>
- <DD><P>Adds support for named libstdc++ include directory. For instance,
+ </p>
+
+ <dt><code>--enable-version-specific-runtime-libs </code>
+ <dd><p>Specify that run-time libraries should be installed in the
+ compiler-specific subdirectory (i.e.,
+ <code>${libdir}/gcc-lib/${target_alias}/${gcc_version}</code>)
+ instead of <code>${libdir}</code>. This option is useful if you
+ intend to use several versions of gcc in parallel. In addition,
+ libstdc++'s include files will be installed in
+ <code>${libdir}/gcc-lib/${target_alias}/${gcc_version}/include/g++</code>,
+ unless you also specify
+ <code>--with-gxx-include-dir=<em>dirname</em></code> during configuration.
+ </p>
+
+ <dt><code>--with-gxx-include-dir=&lt;include-files dir&gt;</code>
+ <dd><p>Adds support for named libstdc++ include directory. For instance,
the following puts all the libstdc++ headers into a directory
called &quot;2.97-20001008&quot; instead of the usual
&quot;g++-v3&quot;.
- <PRE>
- --with-gxx-include-dir=/foo/H-x86-gcc-3-c-gxx-inc/include/2.97-20001008</PRE>
- </P>
+ <pre>
+ --with-gxx-include-dir=/foo/H-x86-gcc-3-c-gxx-inc/include/2.97-20001008</pre>
+ </p>
- <DT><TT>--enable-cxx-flags=FLAGS</TT>
- <DD><P>With this option, you can pass a string of -f (functionality)
+ <dt><code>--enable-cxx-flags=FLAGS</code>
+ <dd><p>With this option, you can pass a string of -f (functionality)
flags to the compiler to use when building libstdc++. FLAGS
is a quoted string of options, like
- <PRE>
- --enable-cxx-flags='-fsquangle -fvtable-gc -ansi'</PRE>
+ <pre>
+ --enable-cxx-flags='-fvtable-gc -fomit-frame-pointer -ansi'</pre>
Note that the flags don't necessarily have to all be -f flags,
as shown, but usually those are the ones that will make sense
for experimentation and configure-time overriding.
- </P>
- <P>The advantage of --enable-cxx-flags over setting CXXFLAGS in
- the 'make' environment is that, if libgcc is automatically
+ </p>
+ <p>The advantage of --enable-cxx-flags over setting CXXFLAGS in
+ the 'make' environment is that, if files are automatically
rebuilt, the same flags will be used when compiling those files
as well, so that everything matches.
- </P>
- <P>Fun flags to try might include combinations of
- <PRE>
+ </p>
+ <p>Fun flags to try might include combinations of
+ <pre>
-fstrict-aliasing
- -fnew-abi
- -fnew-exceptions
+ -fno-exceptions
-ffunction-sections
- -fvtable-gc</PRE>
- and -fno- forms of the same. Tell us (the mailing list) if
- you discover more!
- </P>
+ -fvtable-gc</pre>
+ and opposite forms (-fno-) of the same. Tell us (the libstdc++
+ mailing list) if you discover more!
+ </p>
- <DT><TT>--enable-c-mbchar </TT>[default]
- <DD><P>Certain template specializations are required for wide
+ <dt><code>--enable-c-mbchar </code>[default]
+ <dd><p>Certain template specializations are required for wide
character conversion support. This is tricky and currently
changing rapidly, and can cause problems on new platforms.
Disabling wide character specializations is useful for initial
porting steps, but builds only a subset of what is required by
- ISO. Default is on, but the <TT>--enable-c_stdio=stdio </TT>
- option currently turns it off.
- </P>
-</DL>
-</P>
-<P>Return <A HREF="#top">to the top of the page</A> or
- <A HREF="http://gcc.gnu.org/libstdc++/">to the homepage</A>.
-</P>
+ ISO. By default, this option is on.
+ </p>
+</dl>
+</p>
+<p>Return <a href="#top">to the top of the page</a> or
+ <a href="http://gcc.gnu.org/libstdc++/">to the libstdc++ homepage</a>.
+</p>
<!-- ####################################################### -->
-<HR>
-<P CLASS="fineprint"><EM>
-$Id: configopts.html,v 1.5 2001/01/30 09:18:50 bkoz Exp $
-</EM></P>
+<hr>
+<p class="fineprint"><em>
+See <a href="17_intro/license.html">license.html</a> for copying conditions.
+Comments and suggestions are welcome, and may be sent to
+<a href="mailto:libstdc++@gcc.gnu.org">the libstdc++ mailing list</a>.
+</em></p>
-</BODY>
-</HTML>
+</body>
+</html>
diff --git a/libstdc++-v3/docs/html/documentation.html b/libstdc++-v3/docs/html/documentation.html
index 59cd201ffe8..b1ecdc4b4b0 100644
--- a/libstdc++-v3/docs/html/documentation.html
+++ b/libstdc++-v3/docs/html/documentation.html
@@ -1,74 +1,109 @@
-<HTML>
-<HEAD>
- <META NAME="KEYWORDS" CONTENT="libstdc++, homepage, home, g++, libg++, STL">
- <TITLE>Standard C++ Library v3</TITLE>
-<LINK REL=StyleSheet HREF="lib3styles.css">
-<!-- $Id: documentation.html,v 1.7 2000/12/03 23:47:47 jsm28 Exp $ -->
-</HEAD>
-<BODY>
+<html>
+<head>
+ <meta name="KEYWORDS" content="libstdc++, homepage, home, g++, libg++, STL">
+ <title>Standard C++ Library v3</title>
+<link rel="StyleSheet" href="lib3styles.css">
+</head>
+<body>
-<P><B>All of these documents</B> (in fact, this entire homepage set) are
- bundled with the library source, under the <TT>docs</TT> subdirectory,
- for releases and snapshots.
-</P>
+<p><B>All of these documents</B> (in fact, this entire homepage set) are
+ bundled with the library source, under the <code>docs</code> subdirectory,
+ for releases and snapshots. The sole exception is the
+ automatically-generated source documentation, available separately.
+</p>
-<H2><A NAME="1">Introductory notes for libstdc++</A></H2>
- <P>This is a short list of text files pertaining to this
+<hr>
+<h2><a name="4">Source Documentation</a></h2>
+<p>In addition to the distribution documentation (these pages), we also
+ have a set of HTML documents generated from the sources themselves,
+ using the Doxygen tool. These are useful for examining the signatures
+ of public member functions for the library classes, etc.
+</p>
+<p>
+ The latest collection is for the GCC 3.0 release,
+ <code>libstdc++-doxygen-3.0.tar.gz</code> (3.8MB),
+ <a href="libstdc++-doxygen-3.0/index.html">viewable online</a>.
+ The collection is also available in the libstdc++ snapshots directory at
+ <code>&lt;URL:ftp://gcc.gnu.org/pub/gcc/libstdc++/&gt;</code>. You will
+ almost certainly need to use one of the
+ <a href="http://gcc.gnu.org/mirrors.html">mirror sites</a> to download
+ the tarball. After unpacking, simply load
+ libstdc++-doxygen-3.0/index.html <!-- also update this date -->
+ in a browser. Feedback (and additional documentation!) is welcome.
+</p>
+<!-- another paragraph here for post-release collections -->
+
+<hr>
+<h2><a name="2">Configuring, Building, Installing</a></h2>
+ <ul>
+ <li><a href="configopts.html">Configure options</a>
+ <li><a href="install.html">Getting started: configure, build, install</a><br>
+ </ul>
+
+<hr>
+<h2><a name="1">Introductory notes for libstdc++</a></h2>
+ <p>This is a short list of text files pertaining to this
implementation of ISO 14882. A brief description follows the name
of the file.
- </P>
- <UL>
- <LI><A HREF="17_intro/BADNAMES">BADNAMES</A>
+ </p>
+ <p>
+ <ul>
+ <li><a href="17_intro/BADNAMES">BADNAMES</a>
- names to avoid because of potential collisions
- <LI><A HREF="17_intro/BUGS">BUGS</A>
- <LI><A HREF="17_intro/C++STYLE">C++STYLE</A>
+ <li><a href="17_intro/BUGS">BUGS</a>
+ <li><a href="17_intro/C++STYLE">C++STYLE</a>
- coding style by example
- <LI><A HREF="17_intro/CHECKLIST">CHECKLIST</A>
+ <li><a href="17_intro/CHECKLIST">CHECKLIST</a>
- a list of required features and their status.
- <LI><A HREF="17_intro/COPYING">COPYING</A>
+ <li><a href="17_intro/COPYING">COPYING</a>
- GPL v2 license terms
- <LI><A HREF="17_intro/DESIGN">DESIGN</A>
+ <li><a href="17_intro/DESIGN">DESIGN</a>
- overview of the implementation plan
- <LI><A HREF="17_intro/HEADER_POLICY">HEADER_POLICY</A>
+ <li><a href="17_intro/HEADER_POLICY">HEADER_POLICY</a>
- header naming and sub-include structure
- <LI><A HREF="17_intro/PROBLEMS">PROBLEMS</A>
- <!-- Linking to "../README" doesn't work; we are at the top level
- of the web pages. Punt. -->
- <LI>README - directory structure
- <LI><A HREF="17_intro/RELEASE-NOTES">RELEASE-NOTES</A>
+ <li><a href="17_intro/PROBLEMS">PROBLEMS</a>
+ <!-- Linking to "../README" doesn't work; we are at the top level
+ of the web pages. Punt. -->
+ <li>README - directory structure
+ <li><a href="17_intro/RELEASE-NOTES">RELEASE-NOTES</a>
- instructions for building, using
- <LI><A HREF="17_intro/TODO">TODO</A>
+ <li><a href="17_intro/TODO">TODO</a>
- tasks and known bugs
- <LI><A HREF="17_intro/organization">organization</A>
- <LI><A HREF="17_intro/contribute.html">Contributor checklist</A>
- <LI><A HREF="17_intro/libstdc++-assign.txt">Copyright assignment form for libstdc++-v3</A>
- </UL>
+ <li><a href="17_intro/organization">organization</a>
+ <li><a href="17_intro/contribute.html">Contributor checklist</a>
+ <li><a href="17_intro/libstdc++-assign.txt">Copyright assignment form for libstdc++-v3</a>
+ </ul>
+ </p>
+
+<hr>
+<h2><a name="3">Chapter-Specific Information, Extensions, Notes and Advice</a></h2>
+ <ol>
+ <li><a href="17_intro/howto.html">Chapter 17 (Intro)</a>
+ <li><a href="18_support/howto.html">Chapter 18 (Library Support)</a>
+ <li><a href="19_diagnostics/howto.html">Chapter 19 (Diagnostics)</a>
+ <li><a href="20_util/howto.html">Chapter 20 (Utilities)</a>
+ <li><a href="21_strings/howto.html">Chapter 21 (Strings)</a>
+ <li><a href="22_locale/howto.html">Chapter 22 (Localization)</a>
+ <li><a href="23_containers/howto.html">Chapter 23 (Containers)</a>
+ <li><a href="24_iterators/howto.html">Chapter 24 (Iterators)</a>
+ <li><a href="25_algorithms/howto.html">Chapter 25 (Algorithms)</a>
+ <li><a href="26_numerics/howto.html">Chapter 26 (Numerics)</a>
+ <li><a href="27_io/howto.html">Chapter 27 (I/O)</a>
+ <li><a href="ext/howto.html">Extensions to the Standard Library</a>
+ </ol>
+
-<HR>
-<H2><A NAME="2">Configuring, Building, Installing</A></H2>
- <UL>
- <LI><A HREF="configopts.html">Configure options</A>
- <LI><A HREF="install.html">Getting started: configure, build, install</A><BR>
- </UL>
+<!-- ####################################################### -->
-<HR>
-<H2><A NAME="3">Chapter-Specific Information, Extensions, Notes and Advice</A></H2>
- <OL>
- <LI><A HREF="17_intro/howto.html">Chapter 17 (Intro)</A>
- <LI><A HREF="18_support/howto.html">Chapter 18 (Library Support)</A>
- <LI><A HREF="19_diagnostics/howto.html">Chapter 19 (Diagnostics)</A>
- <LI><A HREF="20_util/howto.html">Chapter 20 (Utilities)</A>
- <LI><A HREF="21_strings/howto.html">Chapter 21 (Strings)</A>
- <LI><A HREF="22_locale/howto.html">Chapter 22 (Localization)</A>
- <LI><A HREF="23_containers/howto.html">Chapter 23 (Containers)</A>
- <LI><A HREF="24_iterators/howto.html">Chapter 24 (Iterators)</A>
- <LI><A HREF="25_algorithms/howto.html">Chapter 25 (Algorithms)</A>
- <LI><A HREF="26_numerics/howto.html">Chapter 26 (Numerics)</A>
- <LI><A HREF="27_io/howto.html">Chapter 27 (I/O)</A>
- <LI><A HREF="ext/howto.html">Extensions to the Standard Library</A>
- </OL>
+<p>Return <a href="http://gcc.gnu.org/libstdc++/">to the libstdc++ homepage</a>.</p>
+<hr>
+<p class="fineprint"><em>
+See <a href="17_intro/license.html">license.html</a> for copying conditions.
+Comments and suggestions are welcome, and may be sent to
+<a href="mailto:libstdc++@gcc.gnu.org">the libstdc++ mailing list</a>.
+</em></p>
-</BODY>
-</HTML>
+</body>
+</html>
diff --git a/libstdc++-v3/docs/html/explanations.html b/libstdc++-v3/docs/html/explanations.html
new file mode 100644
index 00000000000..164a5a1cf8e
--- /dev/null
+++ b/libstdc++-v3/docs/html/explanations.html
@@ -0,0 +1,84 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
+<html>
+<head>
+ <meta name="AUTHOR" content="pme@gcc.gnu.org (Phil Edwards)">
+ <meta name="KEYWORDS" content="libstdc++, libstdc++-v3, GCC, g++">
+ <meta name="DESCRIPTION" content="Explanatory notes about libstdc++-v3.">
+ <meta name="GENERATOR" content="vi and eight fingers">
+ <title>Explanatory notes about libstdc++-v3 design</title>
+<link rel="StyleSheet" href="lib3styles.css">
+</head>
+<body>
+
+<h1 class="centered"><a name="top">Explanatory notes about libstdc++-v3
+design</a></h1>
+
+<p>The latest version of this document is always available at
+ <a href="http://gcc.gnu.org/onlinedocs/libstdc++/explanations.html">
+ http://gcc.gnu.org/onlinedocs/libstdc++/explanations.html</a>.
+</p>
+
+<p>To the <a href="http://gcc.gnu.org/libstdc++/">libstdc++-v3 homepage</a>.
+
+
+<!-- ####################################################### -->
+<hr>
+<a name="cstdio"><h3>&quot;I/O packages&quot;, <code>--enable-cstdio</code></h3></a>
+<p>In addition to all the nifty things which C++ can do for I/O, its library
+ also includes all of the I/O capabilites of C. Making them work together
+ can be a challenge, not only
+ <a href="27_io/howto.html#8">for the programmer</a> but for the
+ implementors as well.
+</p>
+<p>There are two ways to do a C++ library: the cool way, and the easy way.
+ More specifically, the cool-but-easy-to-get-wrong way, and the
+ easy-to-guarantee-correct-behavior way. For 3.0, the easy way is used.
+</p>
+<p>Choosing 'stdio' is the easy way. It builds a C++ library which forwards
+ all operations to the C library. Many of the C++ I/O functions are
+ specified in the standard 'as if' they called a certain C function; the
+ easiest way to get it correct is to actually call that function. The
+ disadvantage is that the C++ code will run slower (fortunately, the layer
+ is thin).
+</p>
+<p>Choosing 'libio' is the cool way; it allows C++ and C to share some
+ buffers. It's disabled because of tricky synchronization issues. Other
+ cool ways (various methods of sharing resources between C and C++
+ facilities, instead of layering) are possible. This approach can speed
+ up I/O significantly.
+</p>
+<p>Other packages are possible. For a new package, a header must be
+ written to provide types like streamsize (usually just a typedef), as
+ well as some internal types like<code> __c_file_type </code> and
+ <code> __c_lock </code> (for the stdio case, these are FILE (as in
+ &quot;FILE*&quot;) and a simple POSIX mutex, respectively). An
+ interface class called <code> __basic_file </code> must also be filled in;
+ as an example, for the stdio case, these member functions are all
+ inline calles to fread, fwrite, etc.
+</p>
+<p>Return <a href="#top">to the top of the page</a> or
+ <a href="http://gcc.gnu.org/libstdc++/">to the homepage</a>.
+</p>
+
+
+<hr>
+<a name="alloc"><h3>Internal Allocators</h3></a>
+<p>
+</p>
+<p>Return <a href="#top">to the top of the page</a> or
+ <a href="http://gcc.gnu.org/libstdc++/">to the homepage</a>.
+</p>
+
+
+<!-- ####################################################### -->
+
+<hr>
+<p class="fineprint"><em>
+See <a href="17_intro/license.html">license.html</a> for copying conditions.
+Comments and suggestions are welcome, and may be sent to
+<a href="mailto:libstdc++@gcc.gnu.org">the libstdc++ mailing list</a>.
+</em></p>
+
+
+</body>
+</html>
diff --git a/libstdc++-v3/docs/html/ext/howto.html b/libstdc++-v3/docs/html/ext/howto.html
index 8806e8a1198..aadbedd70ce 100644
--- a/libstdc++-v3/docs/html/ext/howto.html
+++ b/libstdc++-v3/docs/html/ext/howto.html
@@ -1,156 +1,544 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-<HEAD>
- <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
- <META NAME="AUTHOR" CONTENT="pme@sources.redhat.com (Phil Edwards)">
- <META NAME="KEYWORDS" CONTENT="HOWTO, libstdc++, GCC, g++, libg++, STL">
- <META NAME="DESCRIPTION" CONTENT="Notes for the libstdc++ extensions.">
- <META NAME="GENERATOR" CONTENT="vi and eight fingers">
- <TITLE>libstdc++-v3 HOWTO: Extensions</TITLE>
-<LINK REL=StyleSheet HREF="../lib3styles.css">
-<!-- $Id: howto.html,v 1.4 2000/12/03 23:47:49 jsm28 Exp $ -->
-</HEAD>
-<BODY>
-
-<H1 CLASS="centered"><A NAME="top">Extensions</A></H1>
-
-<P>Here we will make an attempt at describing the non-Standard extensions to
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="AUTHOR" content="pme@gcc.gnu.org (Phil Edwards)">
+ <meta name="KEYWORDS" content="HOWTO, libstdc++, GCC, g++, libg++, STL">
+ <meta name="DESCRIPTION" content="Notes for the libstdc++ extensions.">
+ <meta name="GENERATOR" content="vi and eight fingers">
+ <title>libstdc++-v3 HOWTO: Extensions</title>
+<link rel="StyleSheet" href="../lib3styles.css">
+</head>
+<body>
+
+<h1 class="centered"><a name="top">Extensions</a></h1>
+
+<p>Here we will make an attempt at describing the non-Standard extensions to
the library. Some of these are from SGI's STL, some of these are GNU's,
and some just seemed to appear on the doorstep.
-</P>
-<P><B>Before you leap in and use these</B>, be aware of two things:
- <OL>
- <LI>Non-Standard means exactly that. The behavior, and the very
+</p>
+<p><strong>Before you leap in and use these</strong>, be aware of two things:
+ <ol>
+ <li>Non-Standard means exactly that. The behavior, and the very
existence, of these extensions may change with little or no
warning. (Ideally, the really good ones will appear in the next
revision of C++.) Also, other platforms, other compilers, other
versions of g++ or libstdc++-v3 may not recognize these names, or
treat them differently, or...
- <LI>You should know how to <A HREF="../faq/index.html#5_4">access
- these headers properly</A>.
- </OL>
-</P>
+ <li>You should know how to <a href="../faq/index.html#5_4">access
+ these headers properly</a>.
+ </ol>
+</p>
<!-- ####################################################### -->
-<HR>
-<H1>Contents</H1>
-<UL>
- <LI><A HREF="#1">Ropes and trees and hashes, oh my!</A>
- <LI><A HREF="#2">Added members</A>
- <LI><A HREF="#3">Allocators</A>
-</UL>
+<hr>
+<h1>Contents</h1>
+<ul>
+ <li><a href="#1">Ropes and trees and hashes, oh my!</a>
+ <li><a href="#2">Added members and types</a>
+ <li><a href="#3">Allocators</a>
+ <li><a href="#4">Compile-time checks</a>
+ <li><a href="#5">LWG Issues</a>
+</ul>
-<HR>
+<hr>
<!-- ####################################################### -->
-<H2><A NAME="1">Ropes and trees and hashes, oh my!</A></H2>
- <P>The SGI headers
- <PRE>
+<h2><a name="1">Ropes and trees and hashes, oh my!</a></h2>
+ <p>The SGI headers
+ <pre>
&lt;bvector&gt;
&lt;hash_map&gt;
&lt;hash_set&gt;
&lt;rope&gt;
&lt;slist&gt;
&lt;tree&gt;
- </PRE> are all here; <TT>&lt;bvector&gt;</TT> exposes the old bit_vector
+ </pre> are all here; <code>&lt;bvector&gt;</code> exposes the old bit_vector
class that was used before specialization of vector&lt;bool&gt; was
- available. <TT>&lt;hash_map&gt;</TT> and <TT>&lt;hash_set&gt;</TT>
- are discussed further below. <TT>&lt;rope&gt;</TT> is the SGI
+ available (it's actually a typedef for the specialization now).
+ <code>&lt;hash_map&gt;</code> and <code>&lt;hash_set&gt;</code>
+ are discussed further below. <code>&lt;rope&gt;</code> is the SGI
specialization for large strings (&quot;rope,&quot; &quot;large
strings,&quot; get it? love those SGI folks).
- <TT>&lt;slist&gt;</TT> is a singly-linked list, for when the
- doubly-linked <TT>list&lt;&gt;</TT> is too much space overhead, and
- <TT>&lt;tree&gt;</TT> exposes the red-black tree classes used in the
+ <code>&lt;slist&gt;</code> is a singly-linked list, for when the
+ doubly-linked <code>list&lt;&gt;</code> is too much space overhead, and
+ <code>&lt;tree&gt;</code> exposes the red-black tree classes used in the
implementation of the standard maps and sets.
- </P>
- <P>Okay, about those hashing classes... I'm going to foist most of the
+ </p>
+ <p>Okay, about those hashing classes... I'm going to foist most of the
work off onto SGI's own site.
- </P>
- <P>Each of the associative containers map, multimap, set, and multiset
+ </p>
+ <p>Each of the associative containers map, multimap, set, and multiset
have a counterpart which uses a
- <A HREF="http://www.sgi.com/Technology/STL/HashFunction.html">hashing
- function</A> to do the arranging, instead of a strict weak ordering
+ <a href="http://www.sgi.com/Technology/STL/HashFunction.html">hashing
+ function</a> to do the arranging, instead of a strict weak ordering
function. The classes take as one of their template parameters a
function object that will return the hash value; by default, an
instantiation of
- <A HREF="http://www.sgi.com/Technology/STL/hash.html">hash</A>.
+ <a href="http://www.sgi.com/Technology/STL/hash.html">hash</a>.
You should specialize this functor for your class, or define your own,
before trying to use one of the hashing classes.
- </P>
- <P>The hashing classes support all the usual associative container
+ </p>
+ <p>The hashing classes support all the usual associative container
functions, as well as some extra constructors specifying the number
of buckets, etc.
- </P>
- <P>Why would you want to use a hashing class instead of the
+ </p>
+ <p>Why would you want to use a hashing class instead of the
&quot;normal&quot; implementations? Matt Austern writes:
- <BLOCKQUOTE><EM>[W]ith a well chosen hash function, hash tables
+ <blockquote><em>[W]ith a well chosen hash function, hash tables
generally provide much better average-case performance than binary
search trees, and much worse worst-case performance. So if your
implementation has hash_map, if you don't mind using nonstandard
components, and if you aren't scared about the possibility of
pathological cases, you'll probably get better performance from
- hash_map.</EM></BLOCKQUOTE>
- </P>
- <P>(Side note: for those of you wondering, <B>&quot;Why wasn't a hash
- table included in the Standard in the first #!$@ place?&quot;</B> I'll
- give a quick answer: it was proposed, but too late and in too
- unorganized a fashion. Some sort of hashing will undoubtably be
+ hash_map.</em></blockquote>
+ </p>
+ <p>(Side note: for those of you wondering, <strong>&quot;Why wasn't a hash
+ table included in the Standard in the first #!$@ place?&quot;</strong>
+ I'll give a quick answer: it was proposed, but too late and in too
+ unorganized a fashion. Some sort of hashing will undoubtedly be
included in a future Standard.
- </P>
- <P>Return <A HREF="#top">to top of page</A> or
- <A HREF="../faq/index.html">to the FAQ</A>.
- </P>
-
-<HR>
-<H2><A NAME="2">Added members</A></H2>
- <P>Some of the classes in the Standard Library have additional
- publicly-available members. Of those, some are intended purely for
- the implementors, for example, additional typedefs. Those won't be
- described here (or anywhere else). This list will grow slowly, since
- we expect it to be rare -- most extensions will be self-contained.
- </P>
- <P>
- <UL>
- <LI><TT>filebuf</TT>s have another ctor with this signature:<BR>
-<TT>basic_filebuf(int __fd, const char* __name, ios_base::openmode __mode);</TT>
- <BR>This comes in very handy in a number of places, such as
+ </p>
+ <p>Return <a href="#top">to top of page</a> or
+ <a href="../faq/index.html">to the FAQ</a>.
+ </p>
+
+<hr>
+<h2><a name="2">Added members and types</a></h2>
+ <p>Some of the classes in the Standard Library have additional
+ publicly-available members, and some classes are themselves not in
+ the standard. Of those, some are intended purely for the implementors,
+ for example, additional typedefs. Those won't be described here
+ (or anywhere else).
+ </p>
+ <p>
+ <ul>
+ <li>The extensions added by SGI are so numerous that they have
+ <a href="sgiexts.html">their own page</a>. Since the SGI STL is no
+ longer actively maintained, we will try and keep this code working
+ ourselves.
+ <li><code>filebuf</code>s have another ctor with this signature:<br>
+<code>basic_filebuf(__c_file_type*, ios_base::openmode, int_type);</code>
+ <br>This comes in very handy in a number of places, such as
attaching Unix sockets, pipes, and anything else which uses file
descriptors, into the IOStream buffering classes. The three
- arguments are as follows:<BR>
- <TT>int __fd, </TT>// open file descriptor<BR>
- <TT>const char* __name, </TT><BR>
- <TT>ios_base::openmode __mode </TT>// same as the other openmode uses
- </UL>
- </P>
- <P>Return <A HREF="#top">to top of page</A> or
- <A HREF="../faq/index.html">to the FAQ</A>.
- </P>
+ arguments are as follows:
+ <ul>
+ <li><code>__c_file_type* F </code>
+ // the __c_file_type typedef usually boils down to stdio's FILE
+ <li><code>ios_base::openmode M </code>
+ // same as all the other uses of openmode
+ <li><code>int_type B </code>
+ // buffer size, defaults to BUFSIZ
+ </ul>
+ For those wanting to use file descriptors instead of FILE*'s, I
+ invite you to contemplate the mysteries of C's <code>fdopen()</code>.
+ </ul>
+ </p>
+ <p>Return <a href="#top">to top of page</a> or
+ <a href="../faq/index.html">to the FAQ</a>.
+ </p>
+
+<hr>
+<h2><a name="3">Allocators</a></h2>
+ <p>Thread-safety, space efficiency, high speed, portability... this is a
+ mess. Where to begin?
+ </p>
+ <h3>The Rules</h3>
+ <p>The C++ standard only gives a few directives in this area:
+ <ul>
+ <li>When you add elements to a container, and the container must allocate
+ more memory to hold them, the container makes the request via its
+ <code>Allocator</code> template parameter. This includes adding
+ char's to the string class, which acts as a regular STL container
+ in this respect.
+ <li>The default <code>Allocator</code> of every container-of-T is
+ <code>std::allocator&lt;T&gt;</code>.
+ <li>The interface of the <code>allocator&lt;T&gt;</code> class is
+ extremely simple. It has about 20 public declarations (nested
+ typedefs, member functions, etc), but the two which concern us most
+ are:
+ <pre>
+ T* allocate (size_type n, const void* hint = 0);
+ void deallocate (T* p, size_type n);</pre>
+ (This is a simplicifcation; the real signatures use nested typedefs.)
+ The <code>&quot;n&quot;</code> arguments in both those functions is a
+ <em>count</em> of the number of T's to allocate space for,
+ <em>not their total size</em>.
+ <li>&quot;The storage is obtained by calling
+ <code>::operator new(size_t)</code>, but it is unspecified when or
+ how often this function is called. The use of <code>hint</code>
+ is unspecified, but intended as an aid to locality if an
+ implementation so desires.&quot; [20.4.1.1]/6
+ </ul>
+ </p>
+ <h3>Problems and Possibilities</h3>
+ <p>The easiest way of fulfilling the requirements is to call operator new
+ each time a container needs memory, and to call operator delete each
+ time the container releases memory. <strong>BUT</strong>
+ <a href="http://gcc.gnu.org/ml/libstdc++/2001-05/msg00105.html">this
+ method is horribly slow</a>.
+ </p>
+ <p>Or we can keep old memory around, and reuse it in a pool to save time.
+ The old libstdc++-v2 used a memory pool, and so do we. As of 3.0,
+ <a href="http://gcc.gnu.org/ml/libstdc++/2001-05/msg00136.html">it's
+ on by default</a>. The pool is shared among all the containers in the
+ program: when your program's std::vector&lt;int&gt; gets cut in half
+ and frees a bunch of its storage, that memory can be reused by the
+ private std::list&lt;WonkyWidget&gt; brought in from a KDE library
+ that you linked against. And we don't have to call operator's new and
+ delete to pass the memory on, ether, which is a speed bonus.
+ <strong>BUT</strong>...
+ </p>
+ <p>What about threads? No problem: in a threadsafe environment, the
+ memory pool is manipulated atomically, so you can grow a container in
+ one thread and shrink it in another, etc. <strong>BUT</strong> what
+ if threads in libstdc++-v3 aren't set up properly?
+ <a href="../faq/index.html#5_6">That's been answered already</a>.
+ </p>
+ <p><strong>BUT</strong> what if you want to use your own allocator? What
+ if you plan on using a runtime-loadable version of malloc() which uses
+ shared telepathic anonymous mmap'd sections serializable over a
+ network, so that memory requests <em>should</em> go through malloc?
+ And what if you need to debug it?
+ </p>
+ <p>Well then:
+ </p>
+ <h3>Available allocators in namespace std</h3>
+ <p>First I'll describe the situation as it exists for the code which will
+ be released in GCC 3.1. This situation is extremely fluid. Then I'll
+ describe the differences for 3.0.x, which will not change much in
+ this respect.
+ </p>
+ <p>As a general rule of thumb, users are not allowed to use names which
+ begin with an underscore. This means that to be portable between
+ compilers, none of the following may be used in your program directly.
+ (If you decide to be unportable, then you're free do do what you want,
+ but it's not our fault if stuff breaks.) They are presented here for
+ information for maintainers and contributors in addition to users, but
+ we will probably make them available for users in 3.1 somehow.
+ </p>
+ <p>These classes are always available:
+ <ul>
+ <li><code>__new_alloc</code> simply wraps <code>::operator new</code>
+ and <code>::operator delete</code>.
+ <li><code>__malloc_alloc_template&lt;int inst&gt;</code> simply wraps
+ <code>malloc</code> and <code>free</code>. There is also a hook
+ for an out-of-memory handler (for new/delete this is taken care of
+ elsewhere). The <code>inst</code> parameter is described below.
+ This class was called <code>malloc_alloc</code> in earlier versions.
+ <li><code>allocator&lt;T&gt;</code> has already been described; it is
+ The Standard Allocator for instances of T. It uses the internal
+ <code>__alloc</code> typedef (see below) to satisy its requests.
+ <li><code>__simple_alloc&lt;T,A&gt;</code> is a wrapper around another
+ allocator, A, which itself is an allocator for instances of T.
+ This is primarily used in an internal &quot;allocator traits&quot;
+ class which helps encapsulate the different styles of allocators.
+ <li><code>__debug_alloc&lt;A&gt;</code> is also a wrapper around an
+ arbitrary allocator A. It passes on slightly increased size
+ requests to A, and uses the extra memory to store size information.
+ When a pointer is passed to <code>deallocate()</code>, the stored
+ size is checked, and assert() is used to guarantee they match.
+ <li><code>__allocator&lt;T,A&gt;</code> is an adaptor. Many of these
+ allocator classes have a consistent yet non-standard interface.
+ Such classes can be changed to a conforming interface with this
+ wrapper: <code>__allocator&lt;T, __alloc&gt;</code> is thus the
+ same as <code>allocator&lt;T&gt;</code>.
+ </ul>
+ </p>
+ <p>An internal typedef, <code> __mem_interface </code>, is defined to be
+ <code>__new_alloc</code> by default.
+ </p>
+ <p>Normally,
+ <code> __default_alloc_template&lt;bool thr, int inst&gt; </code>
+ is also available. This is the high-speed pool, called the default
+ node allocator. The reusable memory is shared among identical
+ instantiations of
+ this type. It calls through <code>__mem_interface</code> to obtain
+ new memory when its lists run out. If a client container requests a
+ block larger than a certain threshold size, then the pool is bypassed,
+ and the allocate/deallocate request is passed to
+ <code>__mem_interface</code> directly.
+ </p>
+ <p>Its <code>inst</code> parameter is described below. The
+ <code>thr</code> boolean determines whether the pool should be
+ manipulated atomically or not. Two typedefs are provided:
+ <code>__alloc</code> is defined as this node allocator with thr=true,
+ and therefore is threadsafe, while <code>__single_client_alloc</code>
+ defines thr=false, and is slightly faster but unsafe for multiple
+ threads.
+ </p>
+ <p>(Note that the GCC thread abstraction layer allows us to provide safe
+ zero-overhead stubs for the threading routines, if threads were
+ disabled at configuration time. In this situation,
+ <code>__alloc</code> should not be noticably slower than
+ <code>__single_client_alloc</code>.)
+ </p>
+ <p>[Another threadsafe allocator where each thread keeps its own free
+ list, so that no locking is needed, might be described here.]
+ </p>
+ <h3>A cannon to swat a fly:<code> __USE_MALLOC</code></h3>
+ <p>If you've already read <a href="../23_containers/howto.html#3">this
+ advice</a> and decided to define this macro, then the situation changes
+ thusly:
+ <ol>
+ <li><code>__mem_interface</code>, and
+ <li><code>__alloc</code>, and
+ <li><code>__single_client_alloc</code> are all typedef'd to
+ <code>__malloc_alloc_template</code>.
+ <li><code>__default_alloc_template</code> is no longer available.
+ At all. Anywhere. <!-- might change? -->
+ </ol>
+ </p>
+ <h3>Writing your own allocators</h3>
+ <p>Depending on your application (a specific program, a generic library,
+ etc), allocator classes tend to be one of two styles: &quot;SGI&quot;
+ or &quot;standard&quot;. See the comments in stl_alloc.h for more
+ information on this crucial difference.
+ </p>
+ <p>At the bottom of that header is a helper type,
+ <code>_Alloc_traits</code>, and various specializations of it. This
+ allows the container classes to make possible compile-time
+ optimizations based on features of the allocator. You should provide
+ a specialization of this type for your allocator (doing so takes only
+ two or three statements).
+ </p>
+ <h3>Using non-default allocators</h3>
+ <p>You can specify different memory management schemes on a per-container
+ basis, by overriding the default <code>Allocator</code> template
+ parameter. For example, an easy
+ (but nonportable)
+ method of specifying that only malloc/free should be used instead of
+ the default node allocator is:
+ <pre>
+ std::list &lt;my_type, std::__malloc_alloc_template&lt;0&gt; &gt; my_malloc_based_list;</pre>
+ Likewise, a debugging form of whichever allocator is currently in use:
+ <pre>
+ std::deque &lt;my_type, std::__debug_alloc&lt;std::__alloc&gt; &gt; debug_deque;</pre>
+ </p>
+ <h3><code>inst</code></h3>
+ <p>The <code>__malloc_alloc_template</code> and
+ <code>__default_alloc_template</code> classes take an integer parameter,
+ called inst here. This number is completely unused.
+ </p>
+ <p>The point of the number is to allow multiple instantiations of the
+ classes without changing the semantics at all. All three of
+ <pre>
+ typedef __default_alloc_template&lt;true,0&gt; normal;
+ typedef __default_alloc_template&lt;true,1&gt; private;
+ typedef __default_alloc_template&lt;true,42&gt; also_private;</pre>
+ behave exactly the same way. However, the memory pool for each type
+ (and remember that different instantiations result in different types)
+ remains separate.
+ </p>
+ <p>The library uses <strong>0</strong> in all its instantiations. If you
+ wish to keep separate free lists for a particular purpose, use a
+ different number.
+ </p>
+ <h3>3.0.x</h3>
+ <p>For 3.0.x, many of the names were incorrectly <em>not</em> prefixed
+ with underscores. So symbols such as &quot;std::single_client_alloc&quot;
+ are present. Be very careful to not depend on these names any more
+ than you would depend on implementation-only names.
+ </p>
+ <p>Certain macros like <code>_NOTHREADS</code> and <code>__STL_THREADS</code>
+ can affect the 3.0.x allocators. Do not use them. Those macros have
+ been completely removed for 3.1.
+ </p>
+ <p>More notes as we remember them...
+ </p>
+ <p>Return <a href="#top">to top of page</a> or
+ <a href="../faq/index.html">to the FAQ</a>.
+ </p>
+
+<hr>
+<h2><a name="4">Compile-time checks</a></h2>
+ <p>Currently libstdc++-v3 uses the concept checkers from the Boost
+ library to perform <a href="../19_diagnostics/howto.html#3">optional
+ compile-time checking</a> of template instantiations of the standard
+ containers. They are described in the linked-to page.
+ </p>
+ <p>Return <a href="#top">to top of page</a> or
+ <a href="../faq/index.html">to the FAQ</a>.
+ </p>
+
+<hr>
+<h2><a name="5">LWG Issues</a></h2>
+ <p>Everybody's got issues. Even the C++ Standard Library.
+ </p>
+ <p>The Library Working Group, or LWG, is the ISO subcommittee responsible
+ for making changes to the library. They periodically publish an
+ Issues List containing problems and possible solutions. As they reach
+ a consensus on proposed solutions, we often incorporate the solution
+ into libstdc++-v3.
+ </p>
+ <p>Here are the issues which have resulted in code changes to the library.
+ The links are to the specific defect reports from a <strong>partial
+ copy</strong> of the Issues List. You can read the full version online
+ at the <a href="http://www.dkuug.dk/jtc1/sc22/wg21/">ISO C++
+ Committee homepage</a>, linked to on the
+ <a href="http://gcc.gnu.org/readings.html">GCC &quot;Readings&quot;
+ page</a>. If
+ you spend a lot of time reading the issues, we recommend downloading
+ the ZIP file and reading them locally.
+ </p>
+ <p>(NB: <strong>partial copy</strong> means that not all links within
+ the lwg-*.html pages will work.
+ Specifically, links to defect reports that have not been accorded full
+ DR status will probably break. Rather than trying to mirror the
+ entire issues list on our overworked web server, we recommend you go
+ to the LWG homepage instead.)
+ </p>
+ <p>
+ If a DR is not listed here, we may simply not have gotten to it yet;
+ feel free to submit a patch. Search the include/bits and src
+ directories for appearances of _GLIBCPP_RESOLVE_LIB_DEFECTS for
+ examples of style. Note that we usually do not make changes to the code
+ until an issue has reached <a href="lwg-active.html#DR">DR</a> status.
+ </p>
+ <p><dl>
+ <dt><a href="lwg-defects.html#5">5</a>:
+ <em>string::compare specification questionable</em>
+ <dd>This should be two overloaded functions rather than a single function.
+
+ <dt><a href="lwg-defects.html#17">17</a>:
+ <em>Bad bool parsing</em>
+ <dd>Apparently extracting Boolean values was messed up...
+
+ <dt><a href="lwg-defects.html#22">22</a>:
+ <em>Member open vs flags</em>
+ <dd>Re-opening a file stream does <em>not</em> clear the state flags.
+
+ <dt><a href="lwg-defects.html#25">25</a>:
+ <em>String operator&lt;&lt; uses width() value wrong</em>
+ <dd>Padding issues.
+
+ <dt><a href="lwg-defects.html#48">48</a>:
+ <em>Use of non-existent exception constructor</em>
+ <dd>An instance of <code>ios_base::failure</code> is constructed instead.
+
+ <dt><a href="lwg-defects.html#49">49</a>:
+ <em>Underspecification of ios_base::sync_with_stdio</em>
+ <dd>The return type is the <em>previous</em> state of synchronization.
+
+ <dt><a href="lwg-defects.html#50">50</a>:
+ <em>Copy constructor and assignment operator of ios_base</em>
+ <dd>These members functions are declared <code>private</code> and are
+ thus inaccessible. Specifying the correct semantics of
+ &quot;copying stream state&quot; was deemed too complicated.
+
+ <dt><a href="lwg-defects.html#68">68</a>:
+ <em>Extractors for char* should store null at end</em>
+ <dd>And they do now. An editing glitch in the last item in the list of
+ [27.6.1.2.3]/7.
+
+ <dt><a href="lwg-defects.html#74">74</a>:
+ <em>Garbled text for codecvt::do_max_length</em>
+ <dd>The text of the standard was gibberish. Typos gone rampant.
+
+ <dt><a href="lwg-defects.html#83">83</a>:
+ <em>string::npos vs. string::max_size()</em>
+ <dd>Safety checks on the size of the string should test against
+ <code>max_size()</code> rather than <code>npos</code>.
+
+ <dt><a href="lwg-defects.html#109">109</a>:
+ <em>Missing binders for non-const sequence elements</em>
+ <dd>The <code>binder1st</code> and <code>binder2nd</code> didn't have an
+ <code>operator()</code> taking a non-const parameter.
+
+ <dt><a href="lwg-defects.html#110">110</a>:
+ <em>istreambuf_iterator::equal not const</em>
+ <dd>This was not a const member function. Note that the DR says to
+ replace the function with a const one; we have instead provided an
+ overloaded version with identical contents.
+
+ <dt><a href="lwg-defects.html#117">117</a>:
+ <em>basic_ostream uses nonexistent num_put member functions</em>
+ <dd><code>num_put::put()</code> was overloaded on the wrong types.
+
+ <dt><a href="lwg-defects.html#118">118</a>:
+ <em>basic_istream uses nonexistent num_get member functions</em>
+ <dd>Same as 117, but for <code>num_get::get()</code>.
+
+ <dt><a href="lwg-defects.html#129">129</a>:
+ <em>Need error indication from seekp() and seekg()</em>
+ <dd>These functions set <code>failbit</code> on error now.
+
+ <dt><a href="lwg-defects.html#136">136</a>:
+ <em>seekp, seekg setting wrong streams?</em>
+ <dd><code>seekp</code> should only set the output stream, and
+ <code>seekg</code> should only set the input stream.
+
+<!--<dt><a href="lwg-defects.html#159">159</a>:
+ <em>Strange use of underflow()</em>
+ <dd>In fstream.tcc, the basic_filebuf&lt;&gt;::showmanyc() function
+ should probably not be calling <code>underflow()</code>.-->
+
+ <dt><a href="lwg-active.html#167">167</a>:
+ <em>Improper use of traits_type::length()</em>
+ <dd><code>op&lt;&lt;</code> with a <code>const char*</code> was
+ calculating an incorrect number of characters to write.
+
+ <dt><a href="lwg-defects.html#181">181</a>:
+ <em>make_pair() unintended behavior</em>
+ <dd>This function used to take its arguments as reference-to-const, now
+ it copies them (pass by value).
+
+ <dt><a href="lwg-defects.html#195">195</a>:
+ <em>Should basic_istream::sentry's constructor ever set eofbit?</em>
+ <dd>Yes, it can, specifically if EOF is reached while skipping whitespace.
+
+ <dt><a href="lwg-defects.html#211">211</a>:
+ <em>operator&gt;&gt;(istream&amp;, string&amp;) doesn't set failbit</em>
+ <dd>If nothing is extracted into the string, <code>op&gt;&gt;</code> now
+ sets <code>failbit</code> (which can cause an exception, etc, etc).
+
+ <dt><a href="lwg-defects.html#214">214</a>:
+ <em>set::find() missing const overload</em>
+ <dd>Both <code>set</code> and <code>multiset</code> were missing
+ overloaded find, lower_bound, upper_bound, and equal_range functions
+ for const instances.
+
+ <dt><a href="lwg-defects.html#251">251</a>:
+ <em>basic_stringbuf missing allocator_type</em>
+ <dd>This nested typdef was originally not specified.
+
+ <dt><a href="lwg-defects.html#265">265</a>:
+ <em>std::pair::pair() effects overly restrictive</em>
+ <dd>The default ctor would build its members from copies of temporaries;
+ now it simply uses their respective default ctors.
-<HR>
-<H2><A NAME="3">Allocators</A></H2>
- <P>This will be blank for a while. It will describe all of the different
- memory allocators, most inherited from SGI's code. Input is solicited.
- </P>
- <P>Return <A HREF="#top">to top of page</A> or
- <A HREF="../faq/index.html">to the FAQ</A>.
- </P>
+ <dt><a href="lwg-defects.html#266">266</a>:
+ <em>bad_exception::~bad_exception() missing Effects clause</em>
+ <dd>The <code>bad_</code>* classes no longer have destructors (they
+ are trivial), since no description of them was ever given.
+ <dt><a href="lwg-defects.html#275">275</a>:
+ <em>Wrong type in num_get::get() overloads</em>
+ <dd>Similar to 118.
+<!--
+ <dt><a href="lwg-defects.html#"></a>:
+ <em></em>
+ <dd>
+-->
+ </dl></p>
+ <p>Return <a href="#top">to top of page</a> or
+ <a href="../faq/index.html">to the FAQ</a>.
<!-- ####################################################### -->
-<HR>
-<P CLASS="fineprint"><EM>
+<hr>
+<p class="fineprint"><em>
+See <a href="../17_intro/license.html">license.html</a> for copying conditions.
Comments and suggestions are welcome, and may be sent to
-<A HREF="mailto:pme@sources.redhat.com">Phil Edwards</A> or
-<A HREF="mailto:gdr@gcc.gnu.org">Gabriel Dos Reis</A>.
-<BR> $Id: howto.html,v 1.4 2000/12/03 23:47:49 jsm28 Exp $
-</EM></P>
+<a href="mailto:libstdc++@gcc.gnu.org">the libstdc++ mailing list</a>.
+</em></p>
-</BODY>
-</HTML>
+</body>
+</html>
diff --git a/libstdc++-v3/docs/html/ext/lwg-active.html b/libstdc++-v3/docs/html/ext/lwg-active.html
new file mode 100644
index 00000000000..977df966b5a
--- /dev/null
+++ b/libstdc++-v3/docs/html/ext/lwg-active.html
@@ -0,0 +1,5603 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
+<html>
+<head><title>C++ Standard Library Active Issues List</title></head>
+<body bgcolor="#ffffff" text="#000000">
+<table>
+<tr>
+<td align="left">Doc. no.</td>
+<td align="left">J16/01-0052 = WG21 N1337</td>
+</tr>
+<tr>
+<td align="left">Date:</td>
+<td align="left">09 Nov 2001</td>
+</tr>
+<tr>
+<td align="left">Project:</td>
+<td align="left">Programming Language C++</td>
+</tr>
+<tr>
+<td align="left">Reply to:</td>
+<td align="left">Matt Austern &lt;austern@research.att.com&gt;</td>
+</tr>
+</table>
+<h1>C++ Standard Library Active Issues List (Revision 20)</h1>
+ <p>Reference ISO/IEC IS 14882:1998(E)</p>
+ <p>Also see:</p>
+ <ul>
+ <li>
+<a href="lwg-toc.html">Table of Contents</a> for all library issues.</li>
+ <li>
+<a href="lwg-index.html">Index by Section</a> for all library issues.</li>
+ <li>
+<a href="lwg-status.html">Index by Status</a> for all library issues.</li>
+ <li><a href="lwg-defects.html">Library Defect Reports List</a></li>
+ <li><a href="lwg-closed.html">Library Closed Issues List</a></li>
+ </ul>
+ <p>The purpose of this document is to record the status of issues
+ which have come before the Library Working Group (LWG) of the ANSI
+ (J16) and ISO (WG21) C++ Standards Committee. Issues represent
+ potential defects in the ISO/IEC IS 14882:1998(E) document. Issues
+ are not to be used to request new features or other extensions. </p>
+
+ <p>This document contains only library issues which are actively being
+ considered by the Library Working Group. That is, issues which have a
+ status of <a href="lwg-active.html#New">New</a>, <a href="lwg-active.html#Open">Open</a>,
+ <a href="lwg-active.html#Ready">Ready</a>, and <a href="lwg-active.html#Review">Review</a>. See
+ <a href="lwg-defects.html">Library Defect Reports List</a> for issues considered defects and
+ <a href="lwg-closed.html">Library Closed Issues List</a> for issues considered closed.</p>
+
+ <p>The issues in these lists are not necessarily formal ISO Defect
+ Reports (DR's). While some issues will eventually be elevated to
+ official Defect Report status, other issues will be disposed of in
+ other ways. See <a href="#Status">Issue Status</a>.</p>
+
+ <p>This document is in an experimental format designed for both
+ viewing via a world-wide web browser and hard-copy printing. It
+ is available as an HTML file for browsing or PDF file for
+ printing.</p>
+
+ <p>Prior to Revision 14, library issues lists existed in two slightly
+ different versions; a Committee Version and a Public
+ Version. Beginning with Revision 14 the two versions were combined
+ into a single version.</p>
+
+ <p>This document includes <i>[bracketed italicized notes]</i> as a
+ reminder to the LWG of current progress on issues. Such notes are
+ strictly unofficial and should be read with caution as they may be
+ incomplete or incorrect. Be aware that LWG support for a particular
+ resolution can quickly change if new viewpoints or killer examples are
+ presented in subsequent discussions.</p>
+
+ <p>For the most current official version of this document see
+ <a href="http://www.dkuug.dk/jtc1/sc22/wg21">http://www.dkuug.dk/jtc1/sc22/wg21</a>.
+ Requests for further information about this document should include
+ the document number above, reference ISO/IEC 14882:1998(E), and be
+ submitted to Information Technology Industry Council (ITI), 1250 Eye
+ Street NW, Washington, DC 20005.</p>
+
+ <p>Public information as to how to obtain a copy of the C++ Standard,
+ join the standards committee, submit an issue, or comment on an issue
+ can be found in the C++ FAQ at <a href="http://www.research.att.com/~austern/csc/faq.html">http://www.research.att.com/~austern/csc/faq.html</a>.
+ Public discussion of C++ Standard related issues occurs on <a href="news:comp.std.c++">news:comp.std.c++</a>.
+ </p>
+
+ <p>For committee members, files available on the committee's private
+ web site include the HTML version of the Standard itself. HTML
+ hyperlinks from this issues list to those files will only work for
+ committee members who have downloaded them into the same disk
+ directory as the issues list files. </p>
+<h2>Revision History</h2>
+<ul>
+<li>R20:
+Post-Redmond mailing; reflects actions taken in Redmond. Added
+new issues <a href="lwg-active.html#336">336</a>-<a href="lwg-active.html#350">350</a>, of which issues
+<a href="lwg-active.html#347">347</a>-<a href="lwg-active.html#350">350</a> were added since Redmond, hence
+not discussed at the meeting.
+
+All Ready issues were moved to DR status, with the exception of issues
+<a href="lwg-active.html#284">284</a>, <a href="lwg-active.html#241">241</a>, and <a href="lwg-closed.html#267">267</a>.
+
+Noteworthy issues discussed at Redmond include
+<a href="lwg-active.html#120">120</a> <a href="lwg-active.html#202">202</a>, <a href="lwg-active.html#226">226</a>, <a href="lwg-active.html#233">233</a>,
+<a href="lwg-active.html#270">270</a>, <a href="lwg-active.html#253">253</a>, <a href="lwg-active.html#254">254</a>, <a href="lwg-active.html#323">323</a>.
+</li>
+<li>R19:
+Pre-Redmond mailing. Added new issues
+<a href="lwg-active.html#323">323</a>-<a href="lwg-active.html#335">335</a>.
+</li>
+<li>R18:
+Post-Copenhagen mailing; reflects actions taken in Copenhagen.
+Added new issues <a href="lwg-defects.html#312">312</a>-<a href="lwg-active.html#317">317</a>, and discussed
+new issues <a href="lwg-defects.html#271">271</a>-<a href="lwg-closed.html#314">314</a>.
+
+Changed status of issues
+<a href="lwg-defects.html#103">103</a> <a href="lwg-defects.html#118">118</a> <a href="lwg-defects.html#136">136</a> <a href="lwg-defects.html#153">153</a>
+<a href="lwg-defects.html#165">165</a> <a href="lwg-defects.html#171">171</a> <a href="lwg-defects.html#183">183</a> <a href="lwg-defects.html#184">184</a>
+<a href="lwg-defects.html#185">185</a> <a href="lwg-defects.html#186">186</a> <a href="lwg-defects.html#214">214</a> <a href="lwg-defects.html#221">221</a>
+<a href="lwg-defects.html#234">234</a> <a href="lwg-defects.html#237">237</a> <a href="lwg-defects.html#243">243</a> <a href="lwg-defects.html#248">248</a>
+<a href="lwg-defects.html#251">251</a> <a href="lwg-defects.html#252">252</a> <a href="lwg-defects.html#256">256</a> <a href="lwg-defects.html#260">260</a>
+<a href="lwg-defects.html#261">261</a> <a href="lwg-defects.html#262">262</a> <a href="lwg-defects.html#263">263</a> <a href="lwg-defects.html#265">265</a>
+<a href="lwg-defects.html#268">268</a>
+to DR.
+
+Changed status of issues
+<a href="lwg-defects.html#49">49</a> <a href="lwg-defects.html#109">109</a> <a href="lwg-defects.html#117">117</a> <a href="lwg-defects.html#182">182</a>
+<a href="lwg-defects.html#228">228</a> <a href="lwg-defects.html#230">230</a> <a href="lwg-defects.html#232">232</a> <a href="lwg-defects.html#235">235</a>
+<a href="lwg-defects.html#238">238</a> <a href="lwg-active.html#241">241</a> <a href="lwg-defects.html#242">242</a> <a href="lwg-defects.html#250">250</a>
+<a href="lwg-defects.html#259">259</a> <a href="lwg-defects.html#264">264</a> <a href="lwg-defects.html#266">266</a> <a href="lwg-closed.html#267">267</a>
+<a href="lwg-defects.html#271">271</a> <a href="lwg-defects.html#272">272</a> <a href="lwg-defects.html#273">273</a> <a href="lwg-defects.html#275">275</a>
+<a href="lwg-defects.html#281">281</a> <a href="lwg-active.html#284">284</a> <a href="lwg-defects.html#285">285</a> <a href="lwg-defects.html#286">286</a>
+<a href="lwg-defects.html#288">288</a> <a href="lwg-defects.html#292">292</a> <a href="lwg-defects.html#295">295</a> <a href="lwg-defects.html#297">297</a>
+<a href="lwg-defects.html#298">298</a> <a href="lwg-defects.html#301">301</a> <a href="lwg-defects.html#303">303</a> <a href="lwg-defects.html#306">306</a>
+<a href="lwg-defects.html#307">307</a> <a href="lwg-defects.html#308">308</a> <a href="lwg-defects.html#312">312</a>
+to Ready.
+
+Closed issues
+<a href="lwg-closed.html#111">111</a> <a href="lwg-closed.html#277">277</a> <a href="lwg-closed.html#279">279</a> <a href="lwg-closed.html#287">287</a>
+<a href="lwg-closed.html#289">289</a> <a href="lwg-closed.html#293">293</a> <a href="lwg-closed.html#302">302</a> <a href="lwg-closed.html#313">313</a>
+<a href="lwg-closed.html#314">314</a>
+as NAD.
+
+</li>
+<li>R17:
+Pre-Copenhagen mailing. Converted issues list to XML. Added proposed
+resolutions for issues <a href="lwg-defects.html#49">49</a>, <a href="lwg-active.html#76">76</a>, <a href="lwg-active.html#91">91</a>, <a href="lwg-defects.html#235">235</a>, <a href="lwg-defects.html#250">250</a>, <a href="lwg-closed.html#267">267</a>.
+Added new issues <a href="lwg-active.html#278">278</a>-<a href="lwg-active.html#311">311</a>.
+</li>
+<li>R16:
+post-Toronto mailing; reflects actions taken in Toronto. Added new
+issues <a href="lwg-defects.html#265">265</a>-<a href="lwg-closed.html#277">277</a>. Changed status of issues
+<a href="lwg-defects.html#3">3</a>, <a href="lwg-defects.html#8">8</a>, <a href="lwg-defects.html#9">9</a>, <a href="lwg-defects.html#19">19</a>,
+<a href="lwg-defects.html#26">26</a>, <a href="lwg-defects.html#31">31</a>, <a href="lwg-defects.html#61">61</a>,
+<a href="lwg-defects.html#63">63</a>, <a href="lwg-defects.html#86">86</a>, <a href="lwg-defects.html#108">108</a>,
+<a href="lwg-defects.html#112">112</a>, <a href="lwg-defects.html#114">114</a>, <a href="lwg-defects.html#115">115</a>,
+<a href="lwg-defects.html#122">122</a>, <a href="lwg-defects.html#127">127</a>, <a href="lwg-defects.html#129">129</a>,
+<a href="lwg-defects.html#134">134</a>, <a href="lwg-defects.html#137">137</a>, <a href="lwg-defects.html#142">142</a>,
+<a href="lwg-defects.html#144">144</a>, <a href="lwg-defects.html#146">146</a>, <a href="lwg-defects.html#147">147</a>,
+<a href="lwg-defects.html#159">159</a>, <a href="lwg-defects.html#164">164</a>, <a href="lwg-defects.html#170">170</a>,
+<a href="lwg-defects.html#181">181</a>, <a href="lwg-defects.html#199">199</a>, <a href="lwg-defects.html#208">208</a>,
+<a href="lwg-defects.html#209">209</a>, <a href="lwg-defects.html#210">210</a>, <a href="lwg-defects.html#211">211</a>,
+<a href="lwg-defects.html#212">212</a>, <a href="lwg-defects.html#217">217</a>, <a href="lwg-defects.html#220">220</a>,
+<a href="lwg-defects.html#222">222</a>, <a href="lwg-defects.html#223">223</a>, <a href="lwg-defects.html#224">224</a>,
+<a href="lwg-defects.html#227">227</a> to &quot;DR&quot;. Reopened issue <a href="lwg-active.html#23">23</a>. Reopened
+issue <a href="lwg-active.html#187">187</a>. Changed issues <a href="lwg-closed.html#2">2</a> and
+<a href="lwg-closed.html#4">4</a> to NAD. Fixed a typo in issue <a href="lwg-defects.html#17">17</a>. Fixed
+issue <a href="lwg-defects.html#70">70</a>: signature should be changed both places it
+appears. Fixed issue <a href="lwg-defects.html#160">160</a>: previous version didn't fix
+the bug in enough places.
+</li>
+<li>R15:
+pre-Toronto mailing. Added issues
+<a href="lwg-active.html#233">233</a>-<a href="lwg-defects.html#264">264</a>. Some small HTML formatting
+changes so that we pass Weblint tests.
+</li>
+<li>R14:
+post-Tokyo II mailing; reflects committee actions taken in
+Tokyo. Added issues <a href="lwg-defects.html#228">228</a> to <a href="lwg-defects.html#232">232</a>. (00-0019R1/N1242)
+</li>
+<li>R13:
+pre-Tokyo II updated: Added issues <a href="lwg-defects.html#212">212</a> to <a href="lwg-defects.html#227">227</a>.
+</li>
+<li>R12:
+pre-Tokyo II mailing: Added issues <a href="lwg-defects.html#199">199</a> to
+<a href="lwg-defects.html#211">211</a>. Added &quot;and paragraph 5&quot; to the proposed resolution
+of issue <a href="lwg-defects.html#29">29</a>. Add further rationale to issue
+<a href="lwg-closed.html#178">178</a>.
+</li>
+<li>R11:
+post-Kona mailing: Updated to reflect LWG and full committee actions
+in Kona (99-0048/N1224). Note changed resolution of issues
+<a href="lwg-closed.html#4">4</a> and <a href="lwg-defects.html#38">38</a>. Added issues <a href="lwg-closed.html#196">196</a>
+to <a href="lwg-active.html#198">198</a>. Closed issues list split into &quot;defects&quot; and
+&quot;closed&quot; documents. Changed the proposed resolution of issue
+<a href="lwg-closed.html#4">4</a> to NAD, and changed the wording of proposed resolution
+of issue <a href="lwg-defects.html#38">38</a>.
+</li>
+<li>R10:
+pre-Kona updated. Added proposed resolutions <a href="lwg-defects.html#83">83</a>,
+<a href="lwg-defects.html#86">86</a>, <a href="lwg-active.html#91">91</a>, <a href="lwg-active.html#92">92</a>,
+<a href="lwg-defects.html#109">109</a>. Added issues <a href="lwg-closed.html#190">190</a> to
+<a href="lwg-defects.html#195">195</a>. (99-0033/D1209, 14 Oct 99)
+</li>
+<li>R9:
+pre-Kona mailing. Added issues <a href="lwg-closed.html#140">140</a> to
+<a href="lwg-defects.html#189">189</a>. Issues list split into separate &quot;active&quot; and
+&quot;closed&quot; documents. (99-0030/N1206, 25 Aug 99)
+</li>
+<li>R8:
+post-Dublin mailing. Updated to reflect LWG and full committee actions
+in Dublin. (99-0016/N1193, 21 Apr 99)
+</li>
+<li>R7:
+pre-Dublin updated: Added issues <a href="lwg-closed.html#130">130</a>, <a href="lwg-closed.html#131">131</a>,
+<a href="lwg-defects.html#132">132</a>, <a href="lwg-defects.html#133">133</a>, <a href="lwg-defects.html#134">134</a>,
+<a href="lwg-closed.html#135">135</a>, <a href="lwg-defects.html#136">136</a>, <a href="lwg-defects.html#137">137</a>,
+<a href="lwg-closed.html#138">138</a>, <a href="lwg-defects.html#139">139</a> (31 Mar 99)
+</li>
+<li>R6:
+pre-Dublin mailing. Added issues <a href="lwg-defects.html#127">127</a>, <a href="lwg-closed.html#128">128</a>,
+and <a href="lwg-defects.html#129">129</a>. (99-0007/N1194, 22 Feb 99)
+</li>
+<li>R5:
+update issues <a href="lwg-defects.html#103">103</a>, <a href="lwg-defects.html#112">112</a>; added issues
+<a href="lwg-defects.html#114">114</a> to <a href="lwg-defects.html#126">126</a>. Format revisions to prepare
+for making list public. (30 Dec 98)
+</li>
+<li>R4:
+post-Santa Cruz II updated: Issues <a href="lwg-defects.html#110">110</a>,
+<a href="lwg-closed.html#111">111</a>, <a href="lwg-defects.html#112">112</a>, <a href="lwg-closed.html#113">113</a> added, several
+issues corrected. (22 Oct 98)
+</li>
+<li>R3:
+post-Santa Cruz II: Issues <a href="lwg-closed.html#94">94</a> to <a href="lwg-defects.html#109">109</a>
+added, many issues updated to reflect LWG consensus (12 Oct 98)
+</li>
+<li>R2:
+pre-Santa Cruz II: Issues <a href="lwg-closed.html#73">73</a> to <a href="lwg-closed.html#93">93</a> added,
+issue <a href="lwg-defects.html#17">17</a> updated. (29 Sep 98)
+</li>
+<li>R1:
+Correction to issue <a href="lwg-defects.html#55">55</a> resolution, <a href="lwg-defects.html#60">60</a> code
+format, <a href="lwg-defects.html#64">64</a> title. (17 Sep 98)
+</li>
+</ul>
+<h2>
+<a name="Status"></a>Issue Status</h2>
+ <p>
+<b><a name="New">New</a></b> - The issue has not yet been
+ reviewed by the LWG. Any <b>Proposed Resolution</b> is purely a
+ suggestion from the issue submitter, and should not be construed as
+ the view of LWG.</p>
+
+ <p>
+<b><a name="Open">Open</a></b> - The LWG has discussed the issue
+ but is not yet ready to move the issue forward. There are several
+ possible reasons for open status:</p>
+ <ul>
+ <li>Consensus may have not yet have been reached as to how to deal
+ with the issue.</li>
+ <li>Informal consensus may have been reached, but the LWG awaits
+ exact <b>Proposed Resolution</b> wording for review.</li>
+ <li>The LWG wishes to consult additional technical experts before
+ proceeding.</li>
+ <li>The issue may require further study.</li>
+ </ul>
+
+ <p>A <b>Proposed Resolution</b> for an open issue is still not be
+ construed as the view of LWG. Comments on the current state of
+ discussions are often given at the end of open issues in an italic
+ font. Such comments are for information only and should not be given
+ undue importance.</p>
+
+ <p>
+<b><a name="Dup">Dup</a></b> - The LWG has reached consensus that
+ the issue is a duplicate of another issue, and will not be further
+ dealt with. A <b>Rationale</b> identities the duplicated issue's
+ issue number. </p>
+
+ <p>
+<b><a name="NAD">NAD</a></b> - The LWG has reached consensus that
+ the issue is not a defect in the Standard, and the issue is ready to
+ forward to the full committee as a proposed record of response. A
+ <b>Rationale</b> discusses the LWG's reasoning.</p>
+
+ <p>
+<b><a name="Review">Review</a></b> - Exact wording of a
+ <b>Proposed Resolution</b> is now available for review on an issue
+ for which the LWG previously reached informal consensus.</p>
+
+ <p>
+<b><a name="Ready">Ready</a></b> - The LWG has reached consensus
+ that the issue is a defect in the Standard, the <b>Proposed
+ Resolution</b> is correct, and the issue is ready to forward to the
+ full committee for further action as a Defect Report (DR).</p>
+
+ <p>
+<b><a name="DR">DR</a></b> - (Defect Report) - The full J16
+ committee has voted to forward the issue to the Project Editor to be
+ processed as a Potential Defect Report. The Project Editor reviews
+ the issue, and then forwards it to the WG21 Convenor, who returns it
+ to the full committee for final disposition. This issues list
+ accords the status of DR to all these Defect Reports regardless of
+ where they are in that process.</p>
+
+ <p>
+<b><a name="TC">TC</a></b> - (Technical Corrigenda) - The full
+ WG21 committee has voted to accept the Defect Report's Proposed
+ Resolution as a Technical Corrigenda. Action on this issue is thus
+ complete and no further action is possible under ISO rules.</p>
+
+ <p>
+<b><a name="RR">RR</a></b> - (Record of Response) - The full WG21
+ committee has determined that this issue is not a defect in the
+ Standard. Action on this issue is thus complete and no further
+ action is possible under ISO rules.</p>
+
+ <p>
+<b><a name="Future">Future</a></b> - In addition to the regular
+ status, the LWG believes that this issue should be revisited at the
+ next revision of the standard. It is usually paired with NAD.</p>
+
+ <p>Issues are always given the status of <a href="lwg-active.html#New">New</a> when
+ they first appear on the issues list. They may progress to
+ <a href="lwg-active.html#Open">Open</a> or <a href="lwg-active.html#Review">Review</a> while the LWG
+ is actively working on them. When the LWG has reached consensus on
+ the disposition of an issue, the status will then change to
+ <a href="lwg-active.html#Dup">Dup</a>, <a href="lwg-active.html#NAD">NAD</a>, or <a href="lwg-active.html#Ready">Ready</a> as appropriate. Once the full J16 committee votes to
+ forward Ready issues to the Project Editor, they are given the
+ status of Defect Report ( <a href="lwg-active.html#DR">DR</a>). These in turn may
+ become the basis for Technical Corrigenda (<a href="lwg-active.html#TC">TC</a>),
+ or are closed without action other than a Record of Response
+ (<a href="lwg-active.html#RR">RR</a> ). The intent of this LWG process is that
+ only issues which are truly defects in the Standard move to the
+ formal ISO DR status.
+ </p>
+
+<h2>Active Issues</h2>
+<hr>
+<a name="23"><h3>23.&nbsp;Num_get overflow result</h3></a><p>
+<b>Section:</b>&nbsp;22.2.2.1.2 <a href="lib-locales.html#lib.facet.num.get.virtuals"> [lib.facet.num.get.virtuals]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#Open">Open</a>&nbsp; <b>Submitter:</b>&nbsp;Nathan Myers&nbsp; <b>Date:</b>&nbsp;6 Aug 1998</p>
+<p>The current description of numeric input does not account for the possibility of
+overflow. This is an implicit result of changing the description to rely on the definition
+of scanf() (which fails to report overflow), and conflicts with the documented behavior of
+traditional and current implementations. </p>
+
+<p>Users expect, when reading a character sequence that results in a value unrepresentable
+in the specified type, to have an error reported. The standard as written does not permit
+this. </p>
+
+<p><b>Further comments from Dietmar:</b></p>
+
+<p>
+I don't feel comfortable with the proposed resolution to issue 23: It
+kind of simplifies the issue to much. Here is what is going on:
+</p>
+
+<p>
+Currently, the behavior of numeric overflow is rather counter intuitive
+and hard to trace, so I will describe it briefly:
+</p>
+
+<ul>
+ <li>
+ According to 22.2.2.1.2 <a href="lib-locales.html#lib.facet.num.get.virtuals"> [lib.facet.num.get.virtuals]</a>
+ paragraph 11 <tt>failbit</tt> is set if <tt>scanf()</tt> would
+ return an input error; otherwise a value is converted to the rules
+ of <tt>scanf</tt>.
+ </li>
+ <li>
+ <tt>scanf()</tt> is defined in terms of <tt>fscanf()</tt>.
+ </li>
+ <li>
+ <tt>fscanf()</tt> returns an input failure if during conversion no
+ character matching the conversion specification could be extracted
+ before reaching EOF. This is the only reason for <tt>fscanf()</tt>
+ to fail due to an input error and clearly does not apply to the case
+ of overflow.
+ </li>
+ <li>
+ Thus, the conversion is performed according to the rules of
+ <tt>fscanf()</tt> which basically says that <tt>strtod</tt>,
+ <tt>strtol()</tt>, etc. are to be used for the conversion.
+ </li>
+ <li>
+ The <tt>strtod()</tt>, <tt>strtol()</tt>, etc. functions consume as
+ many matching characters as there are and on overflow continue to
+ consume matching characters but also return a value identical to
+ the maximum (or minimum for signed types if there was a leading minus)
+ value of the corresponding type and set <tt>errno</tt> to <tt>ERANGE</tt>.
+ </li>
+ <li>
+ Thus, according to the current wording in the standard, overflows
+ can be detected! All what is to be done is to check <tt>errno</tt>
+ after reading an element and, of course, clearing <tt>errno</tt>
+ before trying a conversion. With the current wording, it can be
+ detected whether the overflow was due to a positive or negative
+ number for signed types.
+ </li>
+</ul>
+
+<p><b>Further discussion from Redmond:</b></p>
+
+<p>The basic problem is that we've defined our behavior,
+including our error-reporting behavior, in terms of C90. However,
+C90's method of reporting overflow in scanf is not technically an
+&quot;input error&quot;. The <tt>strto_*</tt> functions are more precise.</p>
+
+<p>There was general consensus that <tt>failbit</tt> should be set
+upon overflow. We considered three options based on this:</p>
+<ol>
+<li>Set failbit upon conversion error (including overflow), and
+ don't store any value.</li>
+<li>Set failbit upon conversion error, and also set <tt>errno</tt> to
+ indicated the precise nature of the error.</li>
+<li>Set failbit upon conversion error. If the error was due to
+ overflow, store +-numeric_limits&lt;T&gt;::max() as an
+ overflow indication.</li>
+</ol>
+
+<p>Straw poll: (1) 5; (2) 0; (3) 8.</p>
+
+<p>PJP will provide wording.</p>
+
+<p><b>Proposed resolution:</b></p>
+<hr>
+<a name="44"><h3>44.&nbsp;Iostreams use operator== on int_type values</h3></a><p>
+<b>Section:</b>&nbsp;27 <a href="lib-iostreams.html#lib.input.output"> [lib.input.output]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#Open">Open</a>&nbsp; <b>Submitter:</b>&nbsp;Nathan Myers&nbsp; <b>Date:</b>&nbsp;6 Aug 1998</p>
+<p>Many of the specifications for iostreams specify that character
+values or their int_type equivalents are compared using operators ==
+or !=, though in other places traits::eq() or traits::eq_int_type is
+specified to be used throughout. This is an inconsistency; we should
+change uses of == and != to use the traits members instead. </p>
+<p><b>Proposed resolution:</b></p>
+
+<p><i>[Kona: Nathan to supply proposed wording]</i></p>
+
+<p><i>[
+Tokyo: the LWG reaffirmed that this is a defect, and requires careful
+review of clause 27 as the changes are context sensitive.
+]</i></p>
+
+<hr>
+<a name="76"><h3>76.&nbsp;Can a <tt>codecvt</tt> facet always convert one internal character at a time?</h3></a><p>
+<b>Section:</b>&nbsp;22.2.1.5 <a href="lib-locales.html#lib.locale.codecvt"> [lib.locale.codecvt]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#Ready">Ready</a>&nbsp; <b>Submitter:</b>&nbsp;Matt Austern&nbsp; <b>Date:</b>&nbsp;25 Sep 1998</p>
+<p>This issue concerns the requirements on classes derived from
+<tt>codecvt</tt>, including user-defined classes. What are the
+restrictions on the conversion from external characters
+(e.g. <tt>char</tt>) to internal characters (e.g. <tt>wchar_t</tt>)?
+Or, alternatively, what assumptions about <tt>codecvt</tt> facets can
+the I/O library make? </p>
+
+<p>The question is whether it's possible to convert from internal
+characters to external characters one internal character at a time,
+and whether, given a valid sequence of external characters, it's
+possible to pick off internal characters one at a time. Or, to put it
+differently: given a sequence of external characters and the
+corresponding sequence of internal characters, does a position in the
+internal sequence correspond to some position in the external
+sequence? </p>
+
+<p>To make this concrete, suppose that <tt>[first, last)</tt> is a
+sequence of <i>M</i> external characters and that <tt>[ifirst,
+ilast)</tt> is the corresponding sequence of <i>N</i> internal
+characters, where <i>N &gt; 1</i>. That is, <tt>my_encoding.in()</tt>,
+applied to <tt>[first, last)</tt>, yields <tt>[ifirst,
+ilast)</tt>. Now the question: does there necessarily exist a
+subsequence of external characters, <tt>[first, last_1)</tt>, such
+that the corresponding sequence of internal characters is the single
+character <tt>*ifirst</tt>?
+</p>
+
+<p>(What a &quot;no&quot; answer would mean is that
+<tt>my_encoding</tt> translates sequences only as blocks. There's a
+sequence of <i>M</i> external characters that maps to a sequence of
+<i>N</i> internal characters, but that external sequence has no
+subsequence that maps to <i>N-1</i> internal characters.) </p>
+
+<p>Some of the wording in the standard, such as the description of
+<tt>codecvt::do_max_length</tt> (22.2.1.5.2 <a href="lib-locales.html#lib.locale.codecvt.virtuals"> [lib.locale.codecvt.virtuals]</a>,
+paragraph 11) and <tt>basic_filebuf::underflow</tt> (27.8.1.4 <a href="lib-iostreams.html#lib.filebuf.virtuals"> [lib.filebuf.virtuals]</a>, paragraph 3) suggests that it must always be
+possible to pick off internal characters one at a time from a sequence
+of external characters. However, this is never explicitly stated one
+way or the other. </p>
+
+<p>This issue seems (and is) quite technical, but it is important if
+we expect users to provide their own encoding facets. This is an area
+where the standard library calls user-supplied code, so a well-defined
+set of requirements for the user-supplied code is crucial. Users must
+be aware of the assumptions that the library makes. This issue affects
+positioning operations on <tt>basic_filebuf</tt>, unbuffered input,
+and several of <tt>codecvt</tt>'s member functions. </p>
+<p><b>Proposed resolution:</b></p>
+<p>Add the following text as a new paragraph, following 22.2.1.5.2 <a href="lib-locales.html#lib.locale.codecvt.virtuals"> [lib.locale.codecvt.virtuals]</a> paragraph 2:</p>
+
+<blockquote>
+<p>A <tt>codecvt</tt> facet that is used by <tt>basic_filebuf</tt>
+(27.8 <a href="lib-iostreams.html#lib.file.streams"> [lib.file.streams]</a>) must have the property that if</p>
+<pre>
+ do_out(state, from, from_end, from_next, to, to_lim, to_next)
+</pre>
+would return <tt>ok</tt>, where <tt>from != from_end</tt>, then
+<pre>
+ do_out(state, from, from + 1, from_next, to, to_end, to_next)
+</pre>
+must also return <tt>ok</tt>, and that if
+<pre>
+ do_in(state, from, from_end, from_next, to, to_lim, to_next)
+</pre>
+would return <tt>ok</tt>, where <tt>to != to_lim</tt>, then
+<pre>
+ do_in(state, from, from_end, from_next, to, to + 1, to_next)
+</pre>
+<p>must also return <tt>ok</tt>. [<i>Footnote:</i> Informally, this
+means that <tt>basic_filebuf</tt> assumes that the mapping from
+internal to external characters is 1 to N: a <tt>codecvt</tt> that is
+used by <tt>basic_filebuf</tt> must be able to translate characters
+one internal character at a time. <i>--End Footnote</i>]</p>
+</blockquote>
+
+<p><i>[Redmond: Minor change in proposed resolution. Original
+proposed resolution talked about &quot;success&quot;, with a parenthetical
+comment that success meant returning <tt>ok</tt>. New wording
+removes all talk about &quot;success&quot;, and just talks about the
+return value.]</i></p>
+
+<p><b>Rationale:</b></p>
+
+ <p>The proposed resoluion says that conversions can be performed one
+ internal character at a time. This rules out some encodings that
+ would otherwise be legal. The alternative answer would mean there
+ would be some internal positions that do not correspond to any
+ external file position.</p>
+ <p>
+ An example of an encoding that this rules out is one where the
+ <tt>internT</tt> and <tt>externT</tt> are of the same type, and
+ where the internal sequence <tt>c1 c2</tt> corresponds to the
+ external sequence <tt>c2 c1</tt>.
+ </p>
+ <p>It was generally agreed that <tt>basic_filebuf</tt> relies
+ on this property: it was designed under the assumption that
+ the external-to-internal mapping is N-to-1, and it is not clear
+ that <tt>basic_filebuf</tt> is implementable without that
+ restriction.
+ </p>
+ <p>
+ The proposed resolution is expressed as a restriction on
+ <tt>codecvt</tt> when used by <tt>basic_filebuf</tt>, rather
+ than a blanket restriction on all <tt>codecvt</tt> facets,
+ because <tt>basic_filebuf</tt> is the only other part of the
+ library that uses <tt>codecvt</tt>. If a user wants to define
+ a <tt>codecvt</tt> facet that implements a more general N-to-M
+ mapping, there is no reason to prohibit it, so long as the user
+ does not expect <tt>basic_filebuf</tt> to be able to use it.
+ </p>
+<hr>
+<a name="91"><h3>91.&nbsp;Description of operator&gt;&gt; and getline() for string&lt;&gt; might cause endless loop</h3></a><p>
+<b>Section:</b>&nbsp;21.3.7.9 <a href="lib-strings.html#lib.string.io"> [lib.string.io]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#Review">Review</a>&nbsp; <b>Submitter:</b>&nbsp;Nico Josuttis&nbsp; <b>Date:</b>&nbsp;29 Sep 1998</p>
+<p>Operator &gt;&gt; and getline() for strings read until eof()
+in the input stream is true. However, this might never happen, if the
+stream can't read anymore without reaching EOF. So shouldn't it be
+changed into that it reads until !good() ? </p>
+<p><b>Proposed resolution:</b></p>
+<p>In 21.3.7.9 <a href="lib-strings.html#lib.string.io"> [lib.string.io]</a>, paragraph 1, replace:</p>
+<blockquote>
+Effects: Begins by constructing a sentry object k as if k were
+constructed by typename basic_istream&lt;charT,traits&gt;::sentry k( is). If
+bool( k) is true, it calls str.erase() and then extracts characters
+from is and appends them to str as if by calling str.append(1, c). If
+is.width() is greater than zero, the maximum number n of characters
+appended is is.width(); otherwise n is str.max_size(). Characters are
+extracted and appended until any of the following occurs:
+</blockquote>
+<p>with:</p>
+<blockquote>
+Effects: Behaves as a formatted input function (27.6.1.2.1 <a href="lib-iostreams.html#lib.istream.formatted.reqmts"> [lib.istream.formatted.reqmts]</a>). After constructing a sentry object, if the
+sentry converts to true, calls str.erase() and then extracts
+characters from is and appends them to str as if by calling
+str.append(1,c). If is.width() is greater than zero, the maximum
+number n of characters appended is is.width(); otherwise n is
+str.max_size(). Characters are extracted and appended until any of the
+following occurs:
+</blockquote>
+
+<p>In 21.3.7.9 <a href="lib-strings.html#lib.string.io"> [lib.string.io]</a>, paragraph 6, replace</p>
+<blockquote>
+Effects: Begins by constructing a sentry object k as if by typename
+basic_istream&lt;charT,traits&gt;::sentry k( is, true). If bool( k) is true,
+it calls str.erase() and then extracts characters from is and appends
+them to str as if by calling str.append(1, c) until any of the
+following occurs:
+</blockquote>
+<p>with:</p>
+<blockquote>
+Effects: Behaves as an unformatted input function (27.6.1.3 <a href="lib-iostreams.html#lib.istream.unformatted"> [lib.istream.unformatted]</a>), except that it does not affect the value returned
+by subsequent calls to basic_istream&lt;&gt;::gcount(). After
+constructing a sentry object, if the sentry converts to true, calls
+str.erase() and then extracts characters from is and appends them to
+str as if by calling str.append(1,c) until any of the following
+occurs:
+</blockquote>
+
+<p><i>[Redmond: Made changes in proposed resolution. <tt>operator&gt;&gt;</tt>
+should be a formatted input function, not an unformatted input function.
+<tt>getline</tt> should not be required to set <tt>gcount</tt>, since
+there is no mechanism for <tt>gcount</tt> to be set except by one of
+<tt>basic_istream</tt>'s member functions.]</i></p>
+
+<p><b>Rationale:</b></p>
+<p>The real issue here is whether or not these string input functions
+get their characters from a streambuf, rather than by calling an
+istream's member functions, a streambuf signals failure either by
+returning eof or by throwing an exception; there are no other
+possibilities. The proposed resolution makes it clear that these two
+functions do get characters from a streambuf.</p>
+<hr>
+<a name="92"><h3>92.&nbsp;Incomplete Algorithm Requirements</h3></a><p>
+<b>Section:</b>&nbsp;25 <a href="lib-algorithms.html#lib.algorithms"> [lib.algorithms]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#Open">Open</a>&nbsp; <b>Submitter:</b>&nbsp;Nico Josuttis&nbsp; <b>Date:</b>&nbsp;29 Sep 1998</p>
+<p>The standard does not state, how often a function object is copied,
+called, or the order of calls inside an algorithm. This may lead to
+surprising/buggy behavior. Consider the following example: </p>
+
+<pre>class Nth { // function object that returns true for the nth element
+ private:
+ int nth; // element to return true for
+ int count; // element counter
+ public:
+ Nth (int n) : nth(n), count(0) {
+ }
+ bool operator() (int) {
+ return ++count == nth;
+ }
+};
+....
+// remove third element
+ list&lt;int&gt;::iterator pos;
+ pos = remove_if(coll.begin(),coll.end(), // range
+ Nth(3)), // remove criterion
+ coll.erase(pos,coll.end()); </pre>
+
+<p>This call, in fact removes the 3rd <b>AND the 6th</b> element. This
+happens because the usual implementation of the algorithm copies the
+function object internally: </p>
+
+<pre>template &lt;class ForwIter, class Predicate&gt;
+ForwIter std::remove_if(ForwIter beg, ForwIter end, Predicate op)
+{
+ beg = find_if(beg, end, op);
+ if (beg == end) {
+ return beg;
+ }
+ else {
+ ForwIter next = beg;
+ return remove_copy_if(++next, end, beg, op);
+ }
+} </pre>
+
+<p>The algorithm uses find_if() to find the first element that should
+be removed. However, it then uses a copy of the passed function object
+to process the resulting elements (if any). Here, Nth is used again
+and removes also the sixth element. This behavior compromises the
+advantage of function objects being able to have a state. Without any
+cost it could be avoided (just implement it directly instead of
+calling find_if()). </p>
+<p><b>Proposed resolution:</b></p>
+<p> In [lib.function.objects] 20.3 Function objects add as new
+paragraph 6 (or insert after paragraph 1): </p>
+
+<p>Option 1: </p>
+<blockquote>
+Predicates are functions or function objects that fulfill the
+following requirements:<br> &nbsp; - They return a Boolean value (bool
+or a value convertible to bool)<br> &nbsp; - It doesn't matter for the
+behavior of a predicate how often it is copied or assigned and how
+often it is called.
+</blockquote>
+
+<p>Option 2: </p>
+<blockquote>
+- if it's a function:<br> &nbsp; - All calls with the same
+argument values yield the same result.<br> - if it's a function
+object:<br> &nbsp; - In any sequence of calls to operator () without
+calling any non-constant member function, all calls with the same
+argument values yield the same result.&nbsp;<br> - After an assignment
+or copy both objects return the same result for the same values.
+</blockquote>
+
+<p><i>[Santa Cruz: The LWG believes that there may be more to this than
+meets the eye. It applies to all function objects, particularly
+predicates. Two questions: (1) must a function object be
+copyable? (2) how many times is a function object called?&nbsp; These
+are in effect questions about state.&nbsp; Function objects appear to
+require special copy semantics to make state work, and may fail if
+calling alters state and calling occurs an unexpected number of
+times.]</i></p>
+
+<p><i>[Dublin: Pete Becker felt that this may not be a defect,
+but rather something that programmers need to be educated about.
+There was discussion of adding wording to the effect that the number
+and order of calls to function objects, including predicates, not
+affect the behavior of the function object.]</i></p>
+
+<p><i>[Pre-Kona: Nico comments: It seems the problem is that we don't
+have a clear statement of &quot;predicate&quot; in the
+standard. People including me seemed to think &quot;a function
+returning a Boolean value and being able to be called by an STL
+algorithm or be used as sorting criterion or ... is a
+predicate&quot;. But a predicate has more requirements: It should
+never change its behavior due to a call or being copied. IMHO we have
+to state this in the standard. If you like, see section 8.1.4 of my
+library book for a detailed discussion.]</i></p>
+
+<p><i>[Kona: Nico will provide wording to the effect that &quot;unless
+otherwise specified, the number of copies of and calls to function
+objects by algorithms is unspecified&quot;.&nbsp; Consider placing in
+25 <a href="lib-algorithms.html#lib.algorithms"> [lib.algorithms]</a> after paragraph 9.]</i></p>
+
+<p><i>[Pre-Tokyo: Angelika Langer comments: if the resolution is
+that algorithms are free to copy and pass around any function objects,
+then it is a valid question whether they are also allowed to change
+the type information from reference type to value type.]</i></p>
+
+<p><i>[Tokyo: Nico will discuss this further with Matt as there are
+multiple problems beyond the underlying problem of no definition of
+&quot;Predicate&quot;.]</i></p>
+
+<p><i>[Post-Tokyo: Nico provided the above proposed
+resolutions.]</i></p>
+
+<hr>
+<a name="96"><h3>96.&nbsp;Vector&lt;bool&gt; is not a container</h3></a><p>
+<b>Section:</b>&nbsp;23.2.5 <a href="lib-containers.html#lib.vector.bool"> [lib.vector.bool]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#Open">Open</a>&nbsp; <b>Submitter:</b>&nbsp;AFNOR&nbsp; <b>Date:</b>&nbsp;7 Oct 1998</p>
+<p>
+<tt>vector&lt;bool&gt;</tt> is not a container as its reference and
+pointer types are not references and pointers. </p>
+
+<p>Also it forces everyone to have a space optimization instead of a
+speed one.</p>
+
+<p>
+<b>See also:</b> 99-0008 == N1185 Vector&lt;bool&gt; is
+Nonconforming, Forces Optimization Choice.</p>
+<p><b>Proposed resolution:</b></p>
+
+<p><i>[In Santa Cruz the LWG felt that this was Not A Defect.]</i></p>
+
+<p><i>[In Dublin many present felt that failure to meet Container
+requirements was a defect. There was disagreement as to whether
+or not the optimization requirements constituted a defect.]</i></p>
+
+<p><i>[The LWG looked at the following resolutions in some detail:
+<br>
+&nbsp;&nbsp;&nbsp;&nbsp; * Not A Defect.<br>
+&nbsp;&nbsp;&nbsp;&nbsp; * Add a note explaining that vector&lt;bool&gt; does not meet
+Container requirements.<br>
+&nbsp;&nbsp;&nbsp;&nbsp; * Remove vector&lt;bool&gt;.<br>
+&nbsp;&nbsp;&nbsp;&nbsp; * Add a new category of container requirements which
+vector&lt;bool&gt; would meet.<br>
+&nbsp;&nbsp;&nbsp;&nbsp; * Rename vector&lt;bool&gt;.<br>
+<br>
+No alternative had strong, wide-spread, support and every alternative
+had at least one &quot;over my dead body&quot; response.<br>
+<br>
+There was also mention of a transition scheme something like (1) add
+vector_bool and deprecate vector&lt;bool&gt; in the next standard. (2)
+Remove vector&lt;bool&gt; in the following standard.]</i></p>
+
+<p><i>[Modifying container requirements to permit returning proxies
+(thus allowing container requirements conforming vector&lt;bool&gt;)
+was also discussed.]</i></p>
+
+<p><i>[It was also noted that there is a partial but ugly workaround in
+that vector&lt;bool&gt; may be further specialized with a customer
+allocator.]</i></p>
+
+<p><i>[Kona: Herb Sutter presented his paper J16/99-0035==WG21/N1211,
+vector&lt;bool&gt;: More Problems, Better Solutions. Much discussion
+of a two step approach: a) deprecate, b) provide replacement under a
+new name. LWG straw vote on that: 1-favor, 11-could live with, 2-over
+my dead body. This resolution was mentioned in the LWG report to the
+full committee, where several additional committee members indicated
+over-my-dead-body positions.]</i></p>
+
+<p><i>[Tokyo: Not discussed by the full LWG; no one claimed new
+insights and so time was more productively spent on other issues. In
+private discussions it was asserted that requirements for any solution
+include 1) Increasing the full committee's understanding of the
+problem, and 2) providing compiler vendors, authors, teachers, and of
+course users with specific suggestions as to how to apply the eventual
+solution.]</i></p>
+
+<hr>
+<a name="98"><h3>98.&nbsp;Input iterator requirements are badly written</h3></a><p>
+<b>Section:</b>&nbsp;24.1.1 <a href="lib-iterators.html#lib.input.iterators"> [lib.input.iterators]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#Open">Open</a>&nbsp; <b>Submitter:</b>&nbsp;AFNOR&nbsp; <b>Date:</b>&nbsp;7 Oct 1998</p>
+<p>Table 72 in 24.1.1 <a href="lib-iterators.html#lib.input.iterators"> [lib.input.iterators]</a> specifies semantics for
+<tt>*r++</tt> of:</p>
+
+<p>&nbsp;&nbsp; <tt>{ T tmp = *r; ++r; return tmp; }</tt>
+</p>
+
+<p>There are two problems with this. First, the return type is
+specified to be &quot;T&quot;, as opposed to something like &quot;convertible to T&quot;.
+This is too specific: we want to allow *r++ to return an lvalue.</p>
+
+<p>Second, writing the semantics in terms of code misleadingly
+suggests that the effects *r++ should precisely replicate the behavior
+of this code, including side effects. (What if it's a user-defined
+type whose copy constructor has observable behavior?) We should
+replace the code with words, or else put some blanket statement in
+clause 17 saying that code samples aren't intended to specify exactly
+how many times a copy constructor is called, even if the copy
+constructor has observable behavior. (See issue <a href="lwg-active.html#334">334</a>
+for a similar problem.)</p>
+
+<p><b>Proposed resolution:</b></p>
+<hr>
+<a name="120"><h3>120.&nbsp;Can an implementor add specializations?</h3></a><p>
+<b>Section:</b>&nbsp;17.4.3.1 <a href="lib-intro.html#lib.reserved.names"> [lib.reserved.names]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#Open">Open</a>&nbsp; <b>Submitter:</b>&nbsp;Judy Ward&nbsp; <b>Date:</b>&nbsp;15 Dec 1998</p>
+
+<p>The original issue asked whether a library implementor could
+specialize standard library templates for built-in types. (This was
+an issue because users are permitted to explicitly instantiate
+standard library templates.)</p>
+
+<p>Specializations are no longer a problem, because of the resolution
+to core issue 259. Under the proposed resolution, it will be legal
+for a translation unit to contain both a specialization and an
+explicit instantiation of the same template, provided that the
+specialization comes first. In such a case, the explicit
+instantiation will be ignored. Further discussion of library issue
+120 assumes that the core 259 resolution will be adopted.</p>
+
+<p>However, as noted in lib-7047, one piece of this issue still
+remains: what happens if a standard library implementor explicitly
+instantiates a standard library templates? It's illegal for a program
+to contain two different explicit instantiations of the same template
+for the same type in two different translation units (ODR violation),
+and the core working group doesn't believe it is practical to relax
+that restriction.</p>
+
+<p>The issue, then, is: are users allowed to implicitly instantiate
+standard library templates for non-user defined types? The status quo
+answer is 'yes'. Changing it to 'no' would give library implementors
+more freedom.</p>
+
+<p>This is an issue because, for performance reasons, library
+implementors often need to explicitly instantiate standard library
+templates. (for example, std::basic_string&lt;char&gt;) Does giving
+users freedom to explicitly instantiate standard library templates for
+non-user defined types make it impossible or painfully difficult for
+library implementors to do this?</p>
+
+<p>John Spicer suggests, in lib-8957, that library implementors have a
+mechanism they can use for explicit instantiations that doesn't
+prevent users from performing their own explicit instantiations: put
+each explicit instantiation in its own object file. (Different
+solutions might be necessary for Unix DSOs or MS-Windows DLLs.) On
+some platforms, library implementors might not need to do anything
+special: the &quot;undefined behavior&quot; that results from having two
+different explicit instantiations might be harmless.</p>
+
+<p><b>Proposed resolution:</b></p>
+<p>Option 1.</p>
+<blockquote>
+ <p>Append to 17.4.3.1 <a href="lib-intro.html#lib.reserved.names"> [lib.reserved.names]</a> paragraph 1: </p>
+ <blockquote>
+ A program may explicitly instantiate any templates in the standard
+ library only if the declaration depends on a user-defined name of
+ external linkage and the instantiation meets the standard library
+ requirements for the original template.
+ </blockquote>
+</blockquote>
+
+<p>Option 2.</p>
+<blockquote>
+ <p>In light of the resolution to core issue 259, no normative changes
+ in the library clauses are necessary. Add the following non-normative
+ note to the end of 17.4.3.1 <a href="lib-intro.html#lib.reserved.names"> [lib.reserved.names]</a> paragraph 1:</p>
+ <blockquote>
+ [<i>Note:</i> A program may explicitly instantiate standard library
+ templates, even when an explicit instantiation does not depend on
+ a user-defined name. <i>--end note</i>]
+ </blockquote>
+</blockquote>
+
+<p><i>[Copenhagen: LWG discussed three options. (A) Users may not
+explicitly instantiate standard library templates, except on
+user-defined types. Consequence: library implementors may freely
+specialize or instantiate templates. (B) It is implementation defined
+whether users may explicitly instantiate standard library templates on
+non-user-defined types. Consequence: library implementors may freely
+specialize or instantiate templates, but may need to document some or
+all templates that have been explicitly instantiated. (C) Users may
+explicitly instantiate any standard library template.
+]</i></p>
+
+<p><i>[Straw poll (first number is favor, second is strongly oppose):
+A - 4, 0; B - 0, 9; C - 9, 1. Proposed resolution 1, above, is
+option A. (It is the original proposed resolution.) Proposed
+resolution 2, above, is option C. Because there was no support
+for option B, no wording is provided.]</i></p>
+
+<p><i>[Redmond: discussed again; straw poll had results similar to
+those of Copenhagen (A - 1, 3; B - 6, 2; C - 8, 4). Most people said
+they could live with any option. The only objection to option A is
+potential implementation difficulty. Steve Clamage volunteered do a
+survey to see if there are any popular platforms where option A would
+present a real problem for implementors. See his reflector message,
+c++std-lib-9002.
+]</i></p>
+
+<hr>
+<a name="123"><h3>123.&nbsp;Should valarray helper arrays fill functions be const?</h3></a><p>
+<b>Section:</b>&nbsp;26.3.5.4 <a href="lib-numerics.html#lib.slice.arr.fill"> [lib.slice.arr.fill]</a>, 26.3.7.4 <a href="lib-numerics.html#lib.gslice.array.fill"> [lib.gslice.array.fill]</a>, 26.3.8.4 <a href="lib-numerics.html#lib.mask.array.fill"> [lib.mask.array.fill]</a>, 26.3.9.4 <a href="lib-numerics.html#lib.indirect.array.fill"> [lib.indirect.array.fill]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#Review">Review</a>&nbsp; <b>Submitter:</b>&nbsp;Judy Ward&nbsp; <b>Date:</b>&nbsp;15 Dec 1998 </p>
+<p>One of the operator= in the valarray helper arrays is const and one
+is not. For example, look at slice_array. This operator= in Section
+26.3.5.2 <a href="lib-numerics.html#lib.slice.arr.assign"> [lib.slice.arr.assign]</a> is const: </p>
+
+<p>&nbsp;&nbsp;&nbsp; <tt>void operator=(const valarray&lt;T&gt;&amp;) const;</tt> </p>
+
+<p>but this one in Section 26.3.5.4 <a href="lib-numerics.html#lib.slice.arr.fill"> [lib.slice.arr.fill]</a> is not: </p>
+
+<p>&nbsp;&nbsp;&nbsp; <tt>void operator=(const T&amp;); </tt>
+</p>
+
+<p>The description of the semantics for these two functions is similar. </p>
+<p><b>Proposed resolution:</b></p>
+
+<p>26.3.5 <a href="lib-numerics.html#lib.template.slice.array"> [lib.template.slice.array]</a> Template class slice_array</p>
+<blockquote>
+
+ <p>In the class template definition for slice_array, replace the member
+ function declaration</p>
+ <pre>
+ void operator=(const T&amp;);
+ </pre>
+ <p>with</p>
+ <pre>
+ void operator=(const T&amp;) const;
+ </pre>
+</blockquote>
+
+<p>26.3.5.4 <a href="lib-numerics.html#lib.slice.arr.fill"> [lib.slice.arr.fill]</a> slice_array fill function</p>
+<blockquote>
+
+ <p>Change the function declaration</p>
+ <pre>
+ void operator=(const T&amp;);
+ </pre>
+ <p>to</p>
+ <pre>
+ void operator=(const T&amp;) const;
+ </pre>
+</blockquote>
+
+<p>26.3.7 <a href="lib-numerics.html#lib.template.gslice.array"> [lib.template.gslice.array]</a> Template class gslice_array</p>
+<blockquote>
+
+ <p>In the class template definition for gslice_array, replace the member
+ function declaration</p>
+ <pre>
+ void operator=(const T&amp;);
+ </pre>
+ <p>with</p>
+ <pre>
+ void operator=(const T&amp;) const;
+ </pre>
+</blockquote>
+
+<p>26.3.7.4 <a href="lib-numerics.html#lib.gslice.array.fill"> [lib.gslice.array.fill]</a> gslice_array fill function</p>
+<blockquote>
+
+ <p>Change the function declaration</p>
+ <pre>
+ void operator=(const T&amp;);
+ </pre>
+ <p>to</p>
+ <pre>
+ void operator=(const T&amp;) const;
+ </pre>
+</blockquote>
+
+<p>26.3.8 <a href="lib-numerics.html#lib.template.mask.array"> [lib.template.mask.array]</a> Template class mask_array</p>
+<blockquote>
+
+ <p>In the class template definition for mask_array, replace the member
+ function declaration</p>
+ <pre>
+ void operator=(const T&amp;);
+ </pre>
+ <p>with</p>
+ <pre>
+ void operator=(const T&amp;) const;
+ </pre>
+</blockquote>
+
+<p>26.3.8.4 <a href="lib-numerics.html#lib.mask.array.fill"> [lib.mask.array.fill]</a> mask_array fill function</p>
+<blockquote>
+
+ <p>Change the function declaration</p>
+ <pre>
+ void operator=(const T&amp;);
+ </pre>
+ <p>to</p>
+ <pre>
+ void operator=(const T&amp;) const;
+ </pre>
+</blockquote>
+
+<p>26.3.9 <a href="lib-numerics.html#lib.template.indirect.array"> [lib.template.indirect.array]</a> Template class indirect_array</p>
+<blockquote>
+
+ <p>In the class template definition for indirect_array, replace the member
+ function declaration</p>
+ <pre>
+ void operator=(const T&amp;);
+ </pre>
+ <p>with</p>
+ <pre>
+ void operator=(const T&amp;) const;
+ </pre>
+</blockquote>
+
+<p>26.3.9.4 <a href="lib-numerics.html#lib.indirect.array.fill"> [lib.indirect.array.fill]</a> indirect_array fill function</p>
+<blockquote>
+
+ <p>Change the function declaration</p>
+ <pre>
+ void operator=(const T&amp;);
+ </pre>
+ <p>to</p>
+ <pre>
+ void operator=(const T&amp;) const;
+ </pre>
+</blockquote>
+
+
+<p><i>[Redmond: Robert provided wording.]</i></p>
+
+<p><b>Rationale:</b></p>
+<p>There's no good reason for one version of operator= being const and
+another one not. Because of issue <a href="lwg-active.html#253">253</a>, this now
+matters: these functions are now callable in more circumstances. In
+many existing implementations, both versions are already const.</p>
+<hr>
+<a name="167"><h3>167.&nbsp;Improper use of <tt>traits_type::length()</tt>
+</h3></a><p>
+<b>Section:</b>&nbsp;27.6.2.5.4 <a href="lib-iostreams.html#lib.ostream.inserters.character"> [lib.ostream.inserters.character]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#Open">Open</a>&nbsp; <b>Submitter:</b>&nbsp;Dietmar K&uuml;hl&nbsp; <b>Date:</b>&nbsp;20 Jul 1999</p>
+<p>Paragraph 4 states that the length is determined using
+<tt>traits::length(s)</tt>. Unfortunately, this function is not
+defined for example if the character type is <tt>wchar_t</tt> and the
+type of <tt>s</tt> is <tt>char const*</tt>. Similar problems exist if
+the character type is <tt>char</tt> and the type of <tt>s</tt> is
+either <tt>signed char const*</tt> or <tt>unsigned char
+const*</tt>.</p>
+<p><b>Proposed resolution:</b></p>
+<p>Change 27.6.2.5.4 <a href="lib-iostreams.html#lib.ostream.inserters.character"> [lib.ostream.inserters.character]</a> paragraph 4 from:</p>
+<blockquote>
+ <p>Effects: Behaves like an formatted inserter (as described in
+ lib.ostream.formatted.reqmts) of out. After a sentry object is
+ constructed it inserts characters. The number of characters starting
+ at s to be inserted is traits::length(s). Padding is determined as
+ described in lib.facet.num.put.virtuals. The traits::length(s)
+ characters starting at s are widened using out.widen
+ (lib.basic.ios.members). The widened characters and any required
+ padding are inserted into out. Calls width(0).</p>
+</blockquote>
+<p>to:</p>
+<blockquote>
+ <p>Effects: Behaves like an formatted inserter (as described in
+ lib.ostream.formatted.reqmts) of out. After a sentry object is
+ constructed it inserts characters. The number len of characters
+ starting at s to be inserted is</p>
+ <p>
+ - traits::length((const char*)s) if the second argument is of type
+ const charT*<br>
+ - char_traits&lt;char&gt;::length(s) if the second argument is of
+ type const char*, const signed char*, or const unsigned char* and
+ and charT is not char.<br>
+ </p>
+ <p>Padding is determined as described in
+ lib.facet.num.put.virtuals. The len characters starting at s are
+ widened using out.widen (lib.basic.ios.members). The widened
+ characters and any required padding are inserted into out. Calls
+ width(0).</p>
+</blockquote>
+
+<p><i>[Kona: It is clear to the LWG there is a defect here.
+Dietmar will supply specific wording.]</i></p>
+
+<p><i>[Post-Tokyo: Dietmar supplied the above wording.]</i></p>
+
+<p><i>[Toronto: The original proposed resolution involved
+char_traits&lt;signed char&gt; and char_traits&lt;unsigned char&gt;.
+There was strong opposition to requiring that library implementors
+provide those specializations of char_traits.]</i></p>
+
+<p><i>[Copenhagen: This still isn't quite right: proposed resolution
+text got garbled when the signed char/unsigned char specializations
+were removed. Dietmar will provide revised wording.]</i></p>
+<hr>
+<a name="179"><h3>179.&nbsp;Comparison of const_iterators to iterators doesn't work</h3></a><p>
+<b>Section:</b>&nbsp;23.1 <a href="lib-containers.html#lib.container.requirements"> [lib.container.requirements]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#Review">Review</a>&nbsp; <b>Submitter:</b>&nbsp;Judy Ward&nbsp; <b>Date:</b>&nbsp;2 Jul 1998</p>
+<p>Currently the following will not compile on two well-known standard
+library implementations:</p>
+
+<blockquote>
+ <pre>#include &lt;set&gt;
+using namespace std;
+
+void f(const set&lt;int&gt; &amp;s)
+{
+ set&lt;int&gt;::iterator i;
+ if (i==s.end()); // s.end() returns a const_iterator
+}</pre>
+</blockquote>
+
+<p>
+The reason this doesn't compile is because operator== was implemented
+as a member function of the nested classes set:iterator and
+set::const_iterator, and there is no conversion from const_iterator to
+iterator. Surprisingly, (s.end() == i) does work, though, because of
+the conversion from iterator to const_iterator.
+</p>
+
+<p>
+I don't see a requirement anywhere in the standard that this must
+work. Should there be one? If so, I think the requirement would need
+to be added to the tables in section 24.1.1. I'm not sure about the
+wording. If this requirement existed in the standard, I would think
+that implementors would have to make the comparison operators
+non-member functions.</p>
+
+<p>This issues was also raised on comp.std.c++ by Darin
+Adler.&nbsp; The example given was:</p>
+
+<blockquote>
+ <pre>bool check_equal(std::deque&lt;int&gt;::iterator i,
+std::deque&lt;int&gt;::const_iterator ci)
+{
+return i == ci;
+}</pre>
+</blockquote>
+
+<p>Comment from John Potter:</p>
+<blockquote>
+ <p>
+ In case nobody has noticed, accepting it will break reverse_iterator.
+ </p>
+
+ <p>
+ The fix is to make the comparison operators templated on two types.
+ </p>
+
+ <pre>
+ template &lt;class Iterator1, class Iterator2&gt;
+ bool operator== (reverse_iterator&lt;Iterator1&gt; const&amp; x,
+ reverse_iterator&lt;Iterator2&gt; const&amp; y);
+ </pre>
+
+ <p>
+ Obviously: return x.base() == y.base();
+ </p>
+
+ <p>
+ Currently, no reverse_iterator to const_reverse_iterator compares are
+ valid.
+ </p>
+
+ <p>
+ BTW, I think the issue is in support of bad code. Compares should be
+ between two iterators of the same type. All std::algorithms require
+ the begin and end iterators to be of the same type.
+ </p>
+</blockquote>
+<p><b>Proposed resolution:</b></p>
+<p>Insert this paragraph after 23.1 <a href="lib-containers.html#lib.container.requirements"> [lib.container.requirements]</a> paragraph 7:</p>
+<blockquote>
+ <p>In the expressions</p>
+ <pre>
+ i == j
+ i != j
+ i &lt; j
+ i &lt;= j
+ i &gt;= j
+ i &gt; j
+ i - j
+ </pre>
+ <p>Where i and j denote objects of a container's iterator type,
+ either or both may be replaced by an object of the container's
+ const_iterator type referring to the same element with no
+ change in semantics.</p>
+</blockquote>
+
+<p><i>[post-Toronto: Judy supplied a proposed resolution saying that
+<tt>iterator</tt> and <tt>const_iterator</tt> could be freely mixed in
+iterator comparison and difference operations.]</i></p>
+
+<p><i>[Redmond: Dave and Howard supplied a new proposed resolution which
+explicitly listed expressions; there was concern that the previous
+proposed resolution was too informal.]</i></p>
+<p><b>Rationale:</b></p>
+<p>
+The LWG believes it is clear that the above wording applies only to
+the nested types <tt>X::iterator</tt> and <tt>X::const_iterator</tt>,
+where <tt>X</tt> is a container. There is no requirement that
+<tt>X::reverse_iterator</tt> and <tt>X::const_reverse_iterator</tt>
+can be mixed. If mixing them is considered important, that's a
+separate issue. (Issue <a href="lwg-active.html#280">280</a>.)
+</p>
+<hr>
+<a name="187"><h3>187.&nbsp;iter_swap underspecified</h3></a><p>
+<b>Section:</b>&nbsp;25.2.2 <a href="lib-algorithms.html#lib.alg.swap"> [lib.alg.swap]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#Open">Open</a>&nbsp; <b>Submitter:</b>&nbsp;Andrew Koenig&nbsp; <b>Date:</b>&nbsp;14 Aug 1999</p>
+<p>The description of iter_swap in 25.2.2 paragraph 7,says that it ``exchanges the values''
+of the objects to which two iterators refer.<br>
+<br>
+What it doesn't say is whether it does so using swap or using the assignment operator and copy constructor.<br>
+<br>
+This question is an important one to answer, because swap is specialized to work efficiently for standard containers.<br>
+For example:</p>
+<blockquote>
+<pre>vector&lt;int&gt; v1, v2;
+iter_swap(&amp;v1, &amp;v2);</pre>
+</blockquote>
+<p>Is this call to iter_swap equivalent to calling swap(v1, v2)?&nbsp; Or is it equivalent to</p>
+<blockquote>
+<pre>{
+vector&lt;int&gt; temp = v1;
+v1 = v2;
+v2 = temp;
+}</pre>
+</blockquote>
+<p>The first alternative is O(1); the second is O(n).</p>
+<p>A LWG member, Dave Abrahams, comments:</p>
+<blockquote>
+<p>Not an objection necessarily, but I want to point out the cost of that requirement:</p>
+ <blockquote>
+<p><tt>iter_swap(list&lt;T&gt;::iterator, list&lt;T&gt;::iterator)</tt></p>
+ </blockquote>
+<p>can currently be specialized to be more efficient than iter_swap(T*,T*) for many T (by using splicing). Your proposal would make that optimization
+illegal.&nbsp;</p>
+</blockquote>
+
+<p><i>[Kona: The LWG notes the original need for iter_swap was proxy iterators
+which are no longer permitted.]</i></p>
+<p><b>Proposed resolution:</b></p>
+<p>Change the effect clause of iter_swap in 25.2.2 paragraph 7 from:</p>
+<blockquote>
+<p>Exchanges the values pointed to by the two iterators a and b.</p>
+</blockquote>
+<p>to</p>
+<blockquote>
+<p>
+<tt>swap(*a, *b)</tt>.</p>
+</blockquote>
+
+<p><i>[post-Toronto: The LWG is concerned about possible
+overspecification: there may be cases, such as Dave Abrahams's example
+above, and such as vector&lt;bool&gt;'s iterators, where it makes more
+sense for iter_swap to do something other than swap. If performance
+is a concern, it may be better to have explicit complexity
+requirements than to say how iter_swap should be implemented.]</i></p>
+
+<p><i>[Redmond: Discussed, with no consensus. There was very little
+support for the proposed resolution. Some people favored closing this
+issue as NAD. Others favored a more complicated specification of
+<tt>iter_swap</tt>, which might distinguish between ordinary iterators
+and proxies. A possible new issue: how do we know that the iterators
+passed to <tt>iter_swap</tt> have Assignable value types? (If this
+new issue is real, it extends far beyond just
+<tt>iter_swap</tt>.)]</i></p>
+
+<hr>
+<a name="197"><h3>197.&nbsp;max_size() underspecified</h3></a><p>
+<b>Section:</b>&nbsp;20.1.5 <a href="lib-utilities.html#lib.allocator.requirements"> [lib.allocator.requirements]</a>, 23.1 <a href="lib-containers.html#lib.container.requirements"> [lib.container.requirements]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#Open">Open</a>&nbsp; <b>Submitter:</b>&nbsp;Andy Sawyer&nbsp; <b>Date:</b>&nbsp;21 Oct 1999</p>
+<p>Must the value returned by max_size() be unchanged from call to call? </p>
+
+<p>Must the value returned from max_size() be meaningful? </p>
+
+<p>Possible meanings identified in lib-6827: </p>
+
+<p>1) The largest container the implementation can support given &quot;best
+case&quot; conditions - i.e. assume the run-time platform is &quot;configured to
+the max&quot;, and no overhead from the program itself. This may possibly
+be determined at the point the library is written, but certainly no
+later than compile time.<br>
+<br>
+2) The largest container the program could create, given &quot;best case&quot;
+conditions - i.e. same platform assumptions as (1), but take into
+account any overhead for executing the program itself. (or, roughly
+&quot;storage=storage-sizeof(program)&quot;). This does NOT include any resource
+allocated by the program. This may (or may not) be determinable at
+compile time.<br>
+<br>
+3) The largest container the current execution of the program could
+create, given knowledge of the actual run-time platform, but again,
+not taking into account any currently allocated resource. This is
+probably best determined at program start-up.<br>
+<br>
+4) The largest container the current execution program could create at
+the point max_size() is called (or more correctly at the point
+max_size() returns :-), given it's current environment (i.e. taking
+into account the actual currently available resources). This,
+obviously, has to be determined dynamically each time max_size() is
+called. </p>
+<p><b>Proposed resolution:</b></p>
+<p>Change 20.1.5 <a href="lib-utilities.html#lib.allocator.requirements"> [lib.allocator.requirements]</a> table 32 max_size() wording from:<br>
+<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; the largest value that can meaningfully be
+passed to X::allocate<br>
+to:<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; the value of the largest constant expression
+(5.19 <a href="expr.html#expr.const"> [expr.const]</a>) that could ever meaningfully be passed to X::allocate</p>
+
+<p>
+Change 23.1 <a href="lib-containers.html#lib.container.requirements"> [lib.container.requirements]</a> table 65 max_size() wording from:<br>
+<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; size() of the largest possible container.<br>
+to:<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; the value of the largest constant expression
+(5.19 <a href="expr.html#expr.const"> [expr.const]</a>) that could ever meaningfully be returned by X::size().
+</p>
+
+<p><i>[Kona: The LWG informally discussed this and asked Andy Sawyer to submit
+an issue.]</i></p>
+
+<p><i>[Tokyo: The LWG believes (1) above is the intended meaning.]</i></p>
+
+<p><i>[Post-Tokyo: Beman Dawes supplied the above resolution at the
+request of the LWG. 21.3.3 <a href="lib-strings.html#lib.string.capacity"> [lib.string.capacity]</a> was not changed because it
+references max_size() in 23.1. The term &quot;compile-time&quot; was
+avoided because it is not defined anywhere in the standard (even
+though it is used several places in the library clauses).]</i></p>
+
+<p><i>[Copenhagen: Exactly what <tt>max_size</tt> means is still
+unclear. It may have a different meaning as a container member
+function than as an allocator member function. For the latter,
+it is probably best thought of as an architectural limit.
+Nathan will provide new wording.]</i></p>
+<hr>
+<a name="198"><h3>198.&nbsp;Validity of pointers and references unspecified after iterator destruction</h3></a><p>
+<b>Section:</b>&nbsp;24.1 <a href="lib-iterators.html#lib.iterator.requirements"> [lib.iterator.requirements]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#Ready">Ready</a>&nbsp; <b>Submitter:</b>&nbsp;Beman Dawes&nbsp; <b>Date:</b>&nbsp;3 Nov 1999</p>
+<p>
+Is a pointer or reference obtained from an iterator still valid after
+destruction of the iterator?
+</p>
+<p>
+Is a pointer or reference obtained from an iterator still valid after the value
+of the iterator changes?
+</p>
+<blockquote>
+<pre>
+#include &lt;iostream&gt;
+#include &lt;vector&gt;
+#include &lt;iterator&gt;
+
+int main()
+{
+ typedef std::vector&lt;int&gt; vec_t;
+ vec_t v;
+ v.push_back( 1 );
+
+ // Is a pointer or reference obtained from an iterator still
+ // valid after destruction of the iterator?
+ int * p = &amp;*v.begin();
+ std::cout &lt;&lt; *p &lt;&lt; '\n'; // OK?
+
+ // Is a pointer or reference obtained from an iterator still
+ // valid after the value of the iterator changes?
+ vec_t::iterator iter( v.begin() );
+ p = &amp;*iter++;
+ std::cout &lt;&lt; *p &lt;&lt; '\n'; // OK?
+
+ return 0;
+}
+</pre>
+</blockquote>
+
+<p>The standard doesn't appear to directly address these
+questions. The standard needs to be clarified. At least two real-world
+cases have been reported where library implementors wasted
+considerable effort because of the lack of clarity in the
+standard. The question is important because requiring pointers and
+references to remain valid has the effect for practical purposes of
+prohibiting iterators from pointing to cached rather than actual
+elements of containers.</p>
+
+<p>The standard itself assumes that pointers and references obtained
+from an iterator are still valid after iterator destruction or
+change. The definition of reverse_iterator::operator*(), 24.4.1.3.3 <a href="lib-iterators.html#lib.reverse.iter.op.star"> [lib.reverse.iter.op.star]</a>, which returns a reference, defines
+effects:</p>
+
+<blockquote>
+ <pre>Iterator tmp = current;
+return *--tmp;</pre>
+</blockquote>
+<p>The definition of reverse_iterator::operator-&gt;(), 24.4.1.3.4 <a href="lib-iterators.html#lib.reverse.iter.opref"> [lib.reverse.iter.opref]</a>, which returns a pointer, defines effects:</p>
+<blockquote>
+ <pre>return &amp;(operator*());</pre>
+</blockquote>
+
+<p>Because the standard itself assumes pointers and references remain
+valid after iterator destruction or change, the standard should say so
+explicitly. This will also reduce the chance of user code breaking
+unexpectedly when porting to a different standard library
+implementation.</p>
+<p><b>Proposed resolution:</b></p>
+<p>Add a new paragraph to 24.1 <a href="lib-iterators.html#lib.iterator.requirements"> [lib.iterator.requirements]</a>:</p>
+<blockquote>
+Destruction of an iterator may invalidate pointers and references
+previously obtained from that iterator.
+</blockquote>
+
+<p>Replace paragraph 1 of 24.4.1.3.3 <a href="lib-iterators.html#lib.reverse.iter.op.star"> [lib.reverse.iter.op.star]</a> with:</p>
+
+<blockquote>
+<p><b>Effects:</b></p>
+<pre>
+ this-&gt;tmp = current;
+ --this-&gt;tmp;
+ return *this-&gt;tmp;
+</pre>
+
+<p>
+[<i>Note:</i> This operation must use an auxiliary member variable,
+rather than a temporary variable, to avoid returning a reference that
+persists beyond the lifetime of its associated iterator. (See
+24.1 <a href="lib-iterators.html#lib.iterator.requirements"> [lib.iterator.requirements]</a>.) The name of this member variable is shown for
+exposition only. <i>--end note</i>]
+</p>
+</blockquote>
+
+<p><i>[Post-Tokyo: The issue has been reformulated purely
+in terms of iterators.]</i></p>
+
+<p><i>[Pre-Toronto: Steve Cleary pointed out the no-invalidation
+assumption by reverse_iterator. The issue and proposed resolution was
+reformulated yet again to reflect this reality.]</i></p>
+
+<p><i>[Copenhagen: Steve Cleary pointed out that reverse_iterator
+assumes its underlying iterator has persistent pointers and
+references. Andy Koenig pointed out that it is possible to rewrite
+reverse_iterator so that it no longer makes such an assupmption.
+However, this issue is related to issue <a href="lwg-active.html#299">299</a>. If we
+decide it is intentional that <tt>p[n]</tt> may return by value
+instead of reference when <tt>p</tt> is a Random Access Iterator,
+other changes in reverse_iterator will be necessary.]</i></p>
+<p><b>Rationale:</b></p>
+<p>This issue has been discussed extensively. Note that it is
+<i>not</i> an issue about the behavior of predefined iterators. It is
+asking whether or not user-defined iterators are permitted to have
+transient pointers and references. Several people presented examples
+of useful user-defined iterators that have such a property; examples
+include a B-tree iterator, and an &quot;iota iterator&quot; that doesn't point
+to memory. Library implementors already seem to be able to cope with
+such iterators: they take pains to avoid forming references to memory
+that gets iterated past. The only place where this is a problem is
+<tt>reverse_iterator</tt>, so this issue changes
+<tt>reverse_iterator</tt> to make it work.</p>
+
+<p>This resolution does not weaken any guarantees provided by
+predefined iterators like <tt>list&lt;int&gt;::iterator</tt>.
+Clause 23 should be reviewed to make sure that guarantees for
+predefined iterators are as strong as users expect.</p>
+
+<hr>
+<a name="200"><h3>200.&nbsp;Forward iterator requirements don't allow constant iterators</h3></a><p>
+<b>Section:</b>&nbsp;24.1.3 <a href="lib-iterators.html#lib.forward.iterators"> [lib.forward.iterators]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#Review">Review</a>&nbsp; <b>Submitter:</b>&nbsp;Matt Austern&nbsp; <b>Date:</b>&nbsp;19 Nov 1999</p>
+<p>
+In table 74, the return type of the expression <tt>*a</tt> is given
+as <tt>T&amp;</tt>, where <tt>T</tt> is the iterator's value type.
+For constant iterators, however, this is wrong. (&quot;Value type&quot;
+is never defined very precisely, but it is clear that the value type
+of, say, <tt>std::list&lt;int&gt;::const_iterator</tt> is supposed to be
+<tt>int</tt>, not <tt>const int</tt>.)
+</p>
+<p><b>Proposed resolution:</b></p>
+<p>
+In table 74, in the <tt>*a</tt> and <tt>*r++</tt> rows, change the
+return type from &quot;<tt>T&amp;</tt>&quot; to &quot;<tt>T&amp;</tt>
+if <tt>X</tt> is mutable, otherwise <tt>const T&amp;</tt>&quot;.
+In the <tt>a-&gt;m</tt> row, change the return type from
+&quot;<tt>U&amp;</tt>&quot; to &quot;<tt>U&amp;</tt> if <tt>X</tt> is mutable,
+otherwise <tt>const U&amp;</tt>&quot;.
+</p>
+
+<p><i>[Tokyo: The LWG believes this is the tip of a larger iceberg;
+there are multiple const problems with the STL portion of the library
+and that these should be addressed as a single package.&nbsp; Note
+that issue <a href="lwg-closed.html#180">180</a> has already been declared NAD Future for
+that very reason.]</i></p>
+
+<p><i>[Redmond: the LWG thinks this is separable from other constness
+issues. This issue is just cleanup; it clarifies language that was
+written before we had iterator_traits. Proposed resolution was
+modified: the original version only discussed *a. It was pointed out
+that we also need to worry about *r++ and a-&gt;m.]</i></p>
+
+<hr>
+<a name="201"><h3>201.&nbsp;Numeric limits terminology wrong</h3></a><p>
+<b>Section:</b>&nbsp;18.2.1 <a href="lib-support.html#lib.limits"> [lib.limits]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#Open">Open</a>&nbsp; <b>Submitter:</b>&nbsp;Stephen Cleary&nbsp; <b>Date:</b>&nbsp;21 Dec 1999</p>
+<p>
+In some places in this section, the terms &quot;fundamental types&quot; and
+&quot;scalar types&quot; are used when the term &quot;arithmetic types&quot; is intended.
+The current usage is incorrect because void is a fundamental type and
+pointers are scalar types, neither of which should have
+specializations of numeric_limits.
+</p>
+<p><b>Proposed resolution:</b></p>
+<p>Change 18.2 [lib.support.limits] para 1 from:</p>
+<blockquote>
+
+<p> The headers &lt;limits&gt;, &lt;climits&gt;, and &lt;cfloat&gt; supply characteristics of implementation-dependent fundamental types (3.9.1).</p>
+</blockquote>
+
+<p>to:</p>
+<blockquote>
+
+<p> The headers &lt;limits&gt;, &lt;climits&gt;, and &lt;cfloat&gt; supply characteristics of implementation-dependent arithmetic types (3.9.1).</p>
+</blockquote>
+
+<p>Change 18.2.1 [lib.limits] para 1 from:</p>
+<blockquote>
+
+<p> The numeric_limits component provides a C++ program with information about various properties of the implementation's representation of the fundamental
+types.</p>
+</blockquote>
+
+<p>to:</p>
+<blockquote>
+
+<p> The numeric_limits component provides a C++ program with information about various properties of the implementation's representation of the arithmetic
+types.</p>
+</blockquote>
+
+<p>Change 18.2.1 [lib.limits] para 2 from:</p>
+<blockquote>
+
+<p> Specializations shall be provided for each fundamental type. . .</p>
+</blockquote>
+
+<p>to:</p>
+<blockquote>
+
+<p> Specializations shall be provided for each arithmetic type. . .</p>
+</blockquote>
+
+<p>Change 18.2.1 [lib.limits] para 4 from:</p>
+<blockquote>
+
+<p> Non-fundamental standard types. . .</p>
+</blockquote>
+
+<p>to:</p>
+<blockquote>
+
+<p> Non-arithmetic standard types. . .</p>
+</blockquote>
+
+<p>Change 18.2.1.1 [lib.numeric.limits] para 1 from:</p>
+<blockquote>
+
+<p> The member is_specialized makes it possible to distinguish between fundamental types, which have specializations, and non-scalar types, which
+do not.</p>
+</blockquote>
+
+<p>to:</p>
+<blockquote>
+
+<p> The member is_specialized makes it possible to distinguish between arithmetic types, which have specializations, and non-arithmetic types,
+which do not.</p>
+</blockquote>
+
+<p><i>[post-Toronto: The opinion of the LWG is that the wording in the
+standard, as well as the wording of the proposed resolution, is
+flawed. The term &quot;arithmetic types&quot; is well defined in C
+and C++, and it is not clear that the term is being used correctly.
+It is also not clear that the term &quot;implementation
+dependent&quot; has any useful meaning in this context. The biggest
+problem is that numeric_limits seems to be intended both for built-in
+types and for user-defined types, and the standard doesn't make it
+clear how numeric_limits applies to each of those cases. A wholesale
+review of numeric_limits is needed. A paper would be welcome.]</i></p>
+<hr>
+<a name="202"><h3>202.&nbsp;unique() effects unclear when predicate not an equivalence relation</h3></a><p>
+<b>Section:</b>&nbsp;25.2.8 <a href="lib-algorithms.html#lib.alg.unique"> [lib.alg.unique]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#Review">Review</a>&nbsp; <b>Submitter:</b>&nbsp;Andrew Koenig&nbsp; <b>Date:</b>&nbsp;13 Jan 2000</p>
+<p>
+What should unique() do if you give it a predicate that is not an
+equivalence relation? There are at least two plausible answers:
+</p>
+
+<blockquote>
+
+<p>
+ 1. You can't, because 25.2.8 says that it it &quot;eliminates all but
+ the first element from every consecutive group of equal
+ elements...&quot; and it wouldn't make sense to interpret &quot;equal&quot; as
+ meaning anything but an equivalence relation. [It also doesn't
+ make sense to interpret &quot;equal&quot; as meaning ==, because then there
+ would never be any sense in giving a predicate as an argument at
+ all.]
+</p>
+
+<p>
+ 2. The word &quot;equal&quot; should be interpreted to mean whatever the
+ predicate says, even if it is not an equivalence relation
+ (and in particular, even if it is not transitive).
+</p>
+
+</blockquote>
+
+<p>
+The example that raised this question is from Usenet:
+</p>
+
+<blockquote>
+
+<pre>int f[] = { 1, 3, 7, 1, 2 };
+int* z = unique(f, f+5, greater&lt;int&gt;());</pre>
+
+</blockquote>
+
+<p>
+If one blindly applies the definition using the predicate
+greater&lt;int&gt;, and ignore the word &quot;equal&quot;, you get:
+</p>
+
+<blockquote>
+
+<p>
+ Eliminates all but the first element from every consecutive group
+ of elements referred to by the iterator i in the range [first, last)
+ for which *i &gt; *(i - 1).
+</p>
+
+</blockquote>
+
+<p>
+The first surprise is the order of the comparison. If we wanted to
+allow for the predicate not being an equivalence relation, then we
+should surely compare elements the other way: pred(*(i - 1), *i). If
+we do that, then the description would seem to say: &quot;Break the
+sequence into subsequences whose elements are in strictly increasing
+order, and keep only the first element of each subsequence&quot;. So the
+result would be 1, 1, 2. If we take the description at its word, it
+would seem to call for strictly DEcreasing order, in which case the
+result should be 1, 3, 7, 2.<br>
+<br>
+In fact, the SGI implementation of unique() does neither: It yields 1,
+3, 7.
+</p>
+<p><b>Proposed resolution:</b></p>
+<p>Change 25.2.8 <a href="lib-algorithms.html#lib.alg.unique"> [lib.alg.unique]</a> paragraph 1 to:</p>
+<blockquote>
+For a nonempty range, eliminates all but the first element from every
+consecutive group of equivalent elements referred to by the iterator
+<tt>i</tt> in the range (first, last) for which the following
+conditions hold: <tt>*(i-1) == *i</tt> or <tt>pred(*(i-1), *i) !=
+false</tt>.
+</blockquote>
+
+<p>
+Also insert a new paragraph, paragraph 2a, that reads: &quot;Requires: The
+comparison function must be an equivalence relation.&quot;
+</p>
+
+<p><i>[Redmond: discussed arguments for and against requiring the
+comparison function to be an equivalence relation. Straw poll:
+14-2-5. First number is to require that it be an equivalence
+relation, second number is to explicitly not require that it be an
+equivalence relation, third number is people who believe they need
+more time to consider the issue. A separate issue: Andy Sawyer
+pointed out that &quot;i-1&quot; is incorrect, since &quot;i&quot; can refer to the first
+iterator in the range. Matt provided wording to address this
+problem.]</i></p>
+
+<p><b>Rationale:</b></p>
+<p>The LWG also considered an alternative resolution: change
+25.2.8 <a href="lib-algorithms.html#lib.alg.unique"> [lib.alg.unique]</a> paragraph 1 to:</p>
+
+<blockquote>
+For a nonempty range, eliminates all but the first element from every
+consecutive group of elements referred to by the iterator
+<tt>i</tt> in the range (first, last) for which the following
+conditions hold: <tt>*(i-1) == *i</tt> or <tt>pred(*(i-1), *i) !=
+false</tt>.
+</blockquote>
+
+<p>
+Also insert a new paragraph, paragraph 1a, that reads: &quot;Notes: The
+comparison function need not be an equivalence relation.&quot;
+</p>
+
+
+<p>Informally: the proposed resolution imposes an explicit requirement
+that the comparison function be an equivalence relation. The
+alternative resolution does not, and it gives enough information so
+that the behavior of unique() for a non-equivalence relation is
+specified. Both resolutions are consistent with the behavior of
+existing implementations.</p>
+<hr>
+<a name="225"><h3>225.&nbsp;std:: algorithms use of other unqualified algorithms</h3></a><p>
+<b>Section:</b>&nbsp;17.4.4.3 <a href="lib-intro.html#lib.global.functions"> [lib.global.functions]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#Open">Open</a>&nbsp; <b>Submitter:</b>&nbsp;Dave Abrahams&nbsp; <b>Date:</b>&nbsp;01 Apr 2000</p>
+<p>Are algorithms in std:: allowed to use other algorithms without qualification, so functions in
+user namespaces might be found through Koenig lookup?</p>
+<p>For example, a popular standard library implementation includes this
+implementation of std::unique:</p>
+<blockquote>
+<pre>namespace std {
+ template &lt;class _ForwardIter&gt;
+ _ForwardIter unique(_ForwardIter __first, _ForwardIter __last) {
+ __first = adjacent_find(__first, __last);
+ return unique_copy(__first, __last, __first);
+ }
+ }</pre>
+</blockquote>
+<p>Imagine two users on opposite sides of town, each using unique on his own
+sequences bounded by my_iterators . User1 looks at his standard library
+implementation and says, &quot;I know how to implement a more efficient
+unique_copy for my_iterators&quot;, and writes:</p>
+<blockquote>
+<pre>namespace user1 {
+ class my_iterator;
+ // faster version for my_iterator
+ my_iterator unique_copy(my_iterator, my_iterator, my_iterator);
+ }</pre>
+</blockquote>
+<p>user1::unique_copy() is selected by Koenig lookup, as he intended.</p>
+<p>User2 has other needs, and writes:</p>
+<blockquote>
+<pre>namespace user2 {
+ class my_iterator;
+ // Returns true iff *c is a unique copy of *a and *b.
+ bool unique_copy(my_iterator a, my_iterator b, my_iterator c);
+ }</pre>
+</blockquote>
+<p>User2 is shocked to find later that his fully-qualified use of
+std::unique(user2::my_iterator, user2::my_iterator, user2::my_iterator) fails to
+compile (if he's lucky). Looking in the standard, he sees the following Effects
+clause for unique():</p>
+<blockquote>
+ <p>Effects: Eliminates all but the first element from every consecutive group
+ of equal elements referred to by the iterator i in the range [first, last) for
+ which the following corresponding conditions hold: *i == *(i - 1) or pred(*i,
+ *(i - 1)) != false</p>
+</blockquote>
+<p>The standard gives user2 absolutely no reason to think he can interfere with
+std::unique by defining names in namespace user2. His standard library has been
+built with the template export feature, so he is unable to inspect the
+implementation. User1 eventually compiles his code with another compiler, and
+his version of unique_copy silently stops being called. Eventually, he realizes
+that he was depending on an implementation detail of his library and had no
+right to expect his unique_copy() to be called portably.</p>
+<p>On the face of it, and given above scenario, it may seem obvious that the
+implementation of unique() shown is non-conforming because it uses unique_copy()
+rather than ::std::unique_copy(). Most standard library implementations,
+however, seem to disagree with this notion.</p>
+<p> <i>[Tokyo:&nbsp; Steve Adamczyk from
+the core working group indicates that &quot;std::&quot; is sufficient;&nbsp;
+leading &quot;::&quot; qualification is not required because any namespace
+qualification is sufficient to suppress Koenig lookup.]</i>
+</p>
+<p><b>Proposed resolution:</b></p>
+<p>Add a paragraph and a note at the end of
+17.4.4.3 <a href="lib-intro.html#lib.global.functions"> [lib.global.functions]</a>:</p>
+<blockquote>
+
+<p>Unless otherwise specified, no global or non-member function in the
+standard library shall use a function from another namespace which is
+found through <i>argument-dependent name lookup</i> (3.4.2 <a href="basic.html#basic.lookup.koenig"> [basic.lookup.koenig]</a>).</p>
+
+<p>[Note: the phrase &quot;unless otherwise specified&quot; is intended to
+allow Koenig lookup in cases like that of ostream_iterators:<br>
+
+<br>
+ Effects:</p>
+ <blockquote>
+<p>*out_stream &lt;&lt; value;<br>
+ if(delim != 0) *out_stream &lt;&lt; delim;<br>
+ return (*this);</p>
+ <p>--end note]</p>
+ </blockquote>
+</blockquote>
+
+<p><i>[Tokyo: The LWG agrees that this is a defect in the standard, but
+is as yet unsure if the proposed resolution is the best
+solution. Furthermore, the LWG believes that the same problem of
+unqualified library names applies to wording in the standard itself,
+and has opened issue <a href="lwg-active.html#229">229</a> accordingly. Any resolution of
+issue <a href="lwg-active.html#225">225</a> should be coordinated with the resolution of
+issue <a href="lwg-active.html#229">229</a>.]</i></p>
+
+<p><i>[Toronto: The LWG is not sure if this is a defect in the
+standard. Most LWG members believe that an implementation of
+<tt>std::unique</tt> like the one quoted in this issue is already
+illegal, since, under certain circumstances, its semantics are not
+those specified in the standard. The standard's description of
+<tt>unique</tt> does not say that overloading <tt>adjacent_find</tt>
+should have any effect.]</i></p>
+<hr>
+<a name="226"><h3>226.&nbsp;User supplied specializations or overloads of namespace std function templates</h3></a><p>
+<b>Section:</b>&nbsp;17.4.3.1 <a href="lib-intro.html#lib.reserved.names"> [lib.reserved.names]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#Open">Open</a>&nbsp; <b>Submitter:</b>&nbsp;Dave Abrahams&nbsp; <b>Date:</b>&nbsp;01 Apr 2000</p>
+<p>The issues are:&nbsp;</p>
+<p>1. How can a 3rd party library implementor (lib1) write a version of a standard
+algorithm which is specialized to work with his own class template?&nbsp;</p>
+<p>2. How can another library implementor (lib2) write a generic algorithm which
+will take advantage of the specialized algorithm in lib1?</p>
+<p>This appears to be the only viable answer under current language rules:</p>
+<blockquote>
+ <pre>namespace lib1
+{
+ // arbitrary-precision numbers using T as a basic unit
+ template &lt;class T&gt;
+ class big_num { //...
+ };
+ </pre>
+ <pre> // defining this in namespace std is illegal (it would be an
+ // overload), so we hope users will rely on Koenig lookup
+ template &lt;class T&gt;
+ void swap(big_int&lt;T&gt;&amp;, big_int&lt;T&gt;&amp;);
+}</pre>
+ <pre>#include &lt;algorithm&gt;
+namespace lib2
+{
+ template &lt;class T&gt;
+ void generic_sort(T* start, T* end)
+ {
+ ...
+ // using-declaration required so we can work on built-in types
+ using std::swap;
+ // use Koenig lookup to find specialized algorithm if available
+ swap(*x, *y);
+ }
+}</pre>
+</blockquote>
+<p>This answer has some drawbacks. First of all, it makes writing lib2 difficult
+and somewhat slippery. The implementor needs to remember to write the
+using-declaration, or generic_sort will fail to compile when T is a built-in
+type. The second drawback is that the use of this style in lib2 effectively
+&quot;reserves&quot; names in any namespace which defines types which may
+eventually be used with lib2. This may seem innocuous at first when applied to
+names like swap, but consider more ambiguous names like unique_copy() instead.
+It is easy to imagine the user wanting to define these names differently in his
+own namespace. A definition with semantics incompatible with the standard
+library could cause serious problems (see issue <a href="lwg-active.html#225">225</a>).</p>
+<p>Why, you may ask, can't we just partially specialize std::swap()? It's
+because the language doesn't allow for partial specialization of function
+templates. If you write:</p>
+<blockquote>
+ <pre>namespace std
+{
+ template &lt;class T&gt;
+ void swap(lib1::big_int&lt;T&gt;&amp;, lib1::big_int&lt;T&gt;&amp;);
+}</pre>
+</blockquote>
+<p>You have just overloaded std::swap, which is illegal under the current
+language rules. On the other hand, the following full specialization is legal:</p>
+<blockquote>
+ <pre>namespace std
+{
+ template &lt;&gt;
+ void swap(lib1::other_type&amp;, lib1::other_type&amp;);
+}</pre>
+</blockquote>
+
+<p>This issue reflects concerns raised by the &quot;Namespace issue
+with specialized swap&quot; thread on comp.lang.c++.moderated. A
+similar set of concerns was earlier raised on the boost.org mailing
+list and the ACCU-general mailing list. Also see library reflector
+message c++std-lib-7354.</p>
+
+<p><b>Proposed resolution:</b></p>
+
+<p><i>[Tokyo: Summary, &quot;There is no conforming way to extend
+std::swap for user defined templates.&quot;&nbsp; The LWG agrees that
+there is a problem.&nbsp; Would like more information before
+proceeding. This may be a core issue. Core issue 229 has been opened
+to discuss the core aspects of this problem. It was also noted that
+submissions regarding this issue have been received from several
+sources, but too late to be integrated into the issues list.
+]</i></p>
+
+<p><i>[Post-Tokyo: A paper with several proposed resolutions,
+J16/00-0029==WG21/N1252, &quot;Shades of namespace std functions
+&quot; by Alan Griffiths, is in the Post-Tokyo mailing. It
+should be considered a part of this issue.]</i></p>
+
+<p><i>[Toronto: Dave Abrahams and Peter Dimov have proposed a
+resolution that involves core changes: it would add partial
+specialization of function template. The Core Working Group is
+reluctant to add partial specialization of function templates. It is
+viewed as a large change, CWG believes that proposal presented leaves
+some syntactic issues unanswered; if the CWG does add partial
+specialization of function templates, it wishes to develop its own
+proposal. The LWG continues to believe that there is a serious
+problem: there is no good way for users to force the library to use
+user specializations of generic standard library functions, and in
+certain cases (e.g. transcendental functions called by
+<tt>valarray</tt> and <tt>complex</tt>) this is important. Koenig
+lookup isn't adequate, since names within the library must be
+qualified with <tt>std</tt> (see issue 225), specialization doesn't
+work (we don't have partial specialization of function templates), and
+users aren't permitted to add overloads within namespace std.
+]</i></p>
+
+<p><i>[Copenhagen: Discussed at length, with no consensus. Relevant
+papers in the pre-Copenhagen mailing: N1289, N1295, N1296. Discussion
+focused on four options. (1) Relax restrictions on overloads within
+namespace std. (2) Mandate that the standard library use unqualified
+calls for <tt>swap</tt> and possibly other functions. (3) Introduce
+helper class templates for <tt>swap</tt> and possibly other functions.
+(4) Introduce partial specialization of function templates. Every
+option had both support and opposition. Straw poll (first number is
+support, second is strongly opposed): (1) 6, 4; (2) 6, 7; (3) 3, 8;
+(4) 4, 4.]</i></p>
+
+<p><i>[Redmond: Discussed, again no consensus. Herb presented an
+argument that a user who is defining a type <tt>T</tt> with an
+associated <tt>swap</tt> should not be expected to put that
+<tt>swap</tt> in namespace std, either by overloading or by partial
+specialization. The argument is that <tt>swap</tt> is part of
+<tt>T</tt>'s interface, and thus should to in the same namespace as
+<tt>T</tt> and only in that namespace. If we accept this argument,
+the consequence is that standard library functions should use
+unqualified call of <tt>swap</tt>. (And which other functions? Any?)
+A small group (Nathan, Howard, Jeremy, Dave, Matt, Walter, Marc) will
+try to put together a proposal before the next meeting.]</i></p>
+
+<hr>
+<a name="229"><h3>229.&nbsp;Unqualified references of other library entities</h3></a><p>
+<b>Section:</b>&nbsp;17.4.1.1 <a href="lib-intro.html#lib.contents"> [lib.contents]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#Open">Open</a>&nbsp; <b>Submitter:</b>&nbsp;Steve Clamage&nbsp; <b>Date:</b>&nbsp;19 Apr 2000</p>
+<p>Throughout the library chapters, the descriptions of library entities refer
+to other library entities without necessarily qualifying the names.</p>
+
+<p>For example, section 25.2.2 &quot;Swap&quot; describes the effect of
+swap_ranges in terms of the unqualified name &quot;swap&quot;. This section
+could reasonably be interpreted to mean that the library must be implemented so
+as to do a lookup of the unqualified name &quot;swap&quot;, allowing users to
+override any ::std::swap function when Koenig lookup applies.</p>
+
+<p>Although it would have been best to use explicit qualification with
+&quot;::std::&quot; throughout, too many lines in the standard would have to be
+adjusted to make that change in a Technical Corrigendum.</p>
+
+<p>Issue <a href="lwg-defects.html#182">182</a>, which addresses qualification of
+<tt>size_t</tt>, is a special case of this.
+</p>
+<p><b>Proposed resolution:</b></p>
+<p>To section 17.4.1.1 &quot;Library contents&quot; Add the following paragraph:</p>
+<blockquote>
+ <p>Whenever a name x defined in the standard library is mentioned, the name x
+ is assumed to be fully qualified as ::std::x, unless explicitly described
+ otherwise. For example, if the Effects section for library function F is
+ described as calling library function G, the function ::std::G is meant.</p>
+</blockquote>
+
+<p><i>[Post-Tokyo: Steve Clamage submitted this issue at the request of
+the LWG to solve a problem in the standard itself similar to the
+problem within implementations of library identified by issue <a href="lwg-active.html#225">225</a>. Any resolution of issue <a href="lwg-active.html#225">225</a> should be
+coordinated with the resolution of this issue.]</i></p>
+
+<p><i>[post-Toronto: Howard is undecided about whether it is
+appropriate for all standard library function names referred to in
+other standard library functions to be explicitly qualified by
+<tt>std</tt>: it is common advice that users should define global
+functions that operate on their class in the same namespace as the
+class, and this requires argument-dependent lookup if those functions
+are intended to be called by library code. Several LWG members are
+concerned that valarray appears to require argument-dependent lookup,
+but that the wording may not be clear enough to fall under
+&quot;unless explicitly described otherwise&quot;.]</i></p>
+<hr>
+<a name="231"><h3>231.&nbsp;Precision in iostream?</h3></a><p>
+<b>Section:</b>&nbsp;22.2.2.2.2 <a href="lib-locales.html#lib.facet.num.put.virtuals"> [lib.facet.num.put.virtuals]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#Ready">Ready</a>&nbsp; <b>Submitter:</b>&nbsp;James Kanze, Stephen Clamage&nbsp; <b>Date:</b>&nbsp; 25 Apr 2000</p>
+<p>What is the following program supposed to output?</p>
+<pre>#include &lt;iostream&gt;
+
+ int
+ main()
+ {
+ std::cout.setf( std::ios::scientific , std::ios::floatfield ) ;
+ std::cout.precision( 0 ) ;
+ std::cout &lt;&lt; 1.00 &lt;&lt; '\n' ;
+ return 0 ;
+ }</pre>
+<p>From my C experience, I would expect &quot;1e+00&quot;; this is what
+<tt>printf(&quot;%.0e&quot; , 1.00 );</tt> does. G++ outputs
+&quot;1.000000e+00&quot;.</p>
+
+<p>The only indication I can find in the standard is 22.2.2.2.2/11,
+where it says &quot;For conversion from a floating-point type, if
+(flags &amp; fixed) != 0 or if str.precision() &gt; 0, then
+str.precision() is specified in the conversion specification.&quot;
+This is an obvious error, however, fixed is not a mask for a field,
+but a value that a multi-bit field may take -- the results of and'ing
+fmtflags with ios::fixed are not defined, at least not if
+ios::scientific has been set. G++'s behavior corresponds to what might
+happen if you do use (flags &amp; fixed) != 0 with a typical
+implementation (floatfield == 3 &lt;&lt; something, fixed == 1
+&lt;&lt; something, and scientific == 2 &lt;&lt; something).</p>
+
+<p>Presumably, the intent is either (flags &amp; floatfield) != 0, or
+(flags &amp; floatfield) == fixed; the first gives something more or
+less like the effect of precision in a printf floating point
+conversion. Only more or less, of course. In order to implement printf
+formatting correctly, you must know whether the precision was
+explicitly set or not. Say by initializing it to -1, instead of 6, and
+stating that for floating point conversions, if precision &lt; -1, 6
+will be used, for fixed point, if precision &lt; -1, 1 will be used,
+etc. Plus, of course, if precision == 0 and flags &amp; floatfield ==
+0, 1 should be = used. But it probably isn't necessary to emulate all
+of the anomalies of printf:-).</p>
+<p><b>Proposed resolution:</b></p>
+<p>
+In 22.2.2.2.2 <a href="lib-locales.html#lib.facet.num.put.virtuals"> [lib.facet.num.put.virtuals]</a>, paragraph 11, change
+&quot;if <tt>(flags &amp; fixed) != 0</tt>&quot; to
+&quot;if <tt>(flags &amp; floatfield) == fixed ||
+ (flags &amp; floatfield) == scientific</tt>&quot;
+</p>
+<p><b>Rationale:</b></p>
+<p>The floatfield determines whether numbers are formatted as if
+with %f, %e, or %g. If the <tt>fixed</tt> bit is set, it's %f,
+if <tt>scientific</tt> it's %e, and if both bits are set, or
+neither, it's %e.</p>
+<p>Turning to the C standard, a precision of 0 is meaningful
+for %f and %e, but not for %g: for %g, precision 0 is taken
+to be the same as precision 1.</p>
+<p>The proposed resolution has the effect that the output of
+the above program will be &quot;1e+00&quot;.</p>
+<hr>
+<a name="233"><h3>233.&nbsp;Insertion hints in associative containers</h3></a><p>
+<b>Section:</b>&nbsp;23.1.2 <a href="lib-containers.html#lib.associative.reqmts"> [lib.associative.reqmts]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#Review">Review</a>&nbsp; <b>Submitter:</b>&nbsp;Andrew Koenig&nbsp; <b>Date:</b>&nbsp;30 Apr 2000</p>
+<p>
+If <tt>mm</tt> is a multimap and <tt>p</tt> is an iterator
+into the multimap, then <tt>mm.insert(p, x)</tt> inserts
+<tt>x</tt> into <tt>mm</tt> with <tt>p</tt> as a hint as
+to where it should go. Table 69 claims that the execution time is
+amortized constant if the insert winds up taking place adjacent to
+<tt>p</tt>, but does not say when, if ever, this is guaranteed to
+happen. All it says it that <tt>p</tt> is a hint as to where to
+insert.
+</p>
+<p>
+The question is whether there is any guarantee about the relationship
+between <tt>p</tt> and the insertion point, and, if so, what it
+is.
+</p>
+<p>
+I believe the present state is that there is no guarantee: The user
+can supply <tt>p</tt>, and the implementation is allowed to
+disregard it entirely.
+</p>
+
+<p>
+<b>Additional comments from Nathan:</b><br>
+
+The vote [in Redmond] was on whether to elaborately specify the use of
+the hint, or to require behavior only if the value could be inserted
+adjacent to the hint. I would like to ensure that we have a chance to
+vote for a deterministic treatment: &quot;before, if possible, otherwise
+after, otherwise anywhere appropriate&quot;, as an alternative to the
+proposed &quot;before or after, if possible, otherwise [...]&quot;.
+</p>
+
+
+<p><b>Proposed resolution:</b></p>
+
+<p>In table 69 &quot;Associative Container Requirements&quot; in 23.1.2 <a href="lib-containers.html#lib.associative.reqmts"> [lib.associative.reqmts]</a>, in the row for <tt>a.insert(p, t)</tt>,
+change</p>
+
+<blockquote>
+iterator p is a hint pointing to where the insert
+should start to search.
+</blockquote>
+
+<p>to</p>
+
+<blockquote>
+insertion adjacent to iterator p is preferred if
+more than one insertion point is valid.
+</blockquote>
+
+<p>and change</p>
+
+<blockquote>
+logarithmic in general, but amortized constant if
+t is inserted right after p.
+</blockquote>
+
+<p>to</p>
+
+<blockquote>
+logarithmic in general, but amortized constant if
+t is inserted adjacent to iterator p.
+</blockquote>
+
+<p><i>[Toronto: there was general agreement that this is a real defect:
+when inserting an element x into a multiset that already contains
+several copies of x, there is no way to know whether the hint will be
+used. There was some support for an alternative resolution: we check
+on both sides of the hint (both before and after, in that order). If
+either is the correct location, the hint is used; otherwise it is not.
+This would be different from the original proposed resolution, because
+in the proposed resolution the hint will be used even if it is very
+far from the insertion point. JC van Winkel supplied precise wording
+for both options.]</i></p>
+
+<p><i>[Copenhagen: the LWG looked at both options, and preferred the
+original. This preference is contingent on seeing a reference
+implementation showing that it is possible to implement this
+requirement without loss of efficiency.]</i></p>
+
+<p><i>[Redmond: The LWG was reluctant to adopt the proposal that
+emerged from Copenhagen: it seemed excessively complicated, and went
+beyond fixing the defect that we identified in Toronto. PJP provided
+the new wording described in this issue. Nathan agrees that we
+shouldn't adopt the more detailed semantics, and notes: &quot;we know that
+you can do it efficiently enough with a red-black tree, but there are
+other (perhaps better) balanced tree techniques that might differ
+enough to make the detailed semantics hard to satisfy.&quot;]</i></p>
+
+<hr>
+<a name="239"><h3>239.&nbsp;Complexity of unique() and/or unique_copy incorrect</h3></a><p>
+<b>Section:</b>&nbsp;25.2.8 <a href="lib-algorithms.html#lib.alg.unique"> [lib.alg.unique]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#Review">Review</a>&nbsp; <b>Submitter:</b>&nbsp;Angelika Langer&nbsp; <b>Date:</b>&nbsp;May 15 2000</p>
+<p>The complexity of unique and unique_copy are inconsistent with each
+other and inconsistent with the implementations.&nbsp; The standard
+specifies:</p>
+
+<p>for unique():</p>
+
+<blockquote>-3- Complexity: If the range (last - first) is not empty, exactly
+(last - first) - 1 applications of the corresponding predicate, otherwise
+no applications of the predicate.</blockquote>
+
+<p>for unique_copy():</p>
+
+<blockquote>-7- Complexity: Exactly last - first applications of the corresponding
+predicate.</blockquote>
+
+<p>
+The implementations do it the other way round: unique() applies the
+predicate last-first times and unique_copy() applies it last-first-1
+times.</p>
+
+<p>As both algorithms use the predicate for pair-wise comparison of
+sequence elements I don't see a justification for unique_copy()
+applying the predicate last-first times, especially since it is not
+specified to which pair in the sequence the predicate is applied
+twice.</p>
+<p><b>Proposed resolution:</b></p>
+<p>Change both complexity sections in 25.2.8 <a href="lib-algorithms.html#lib.alg.unique"> [lib.alg.unique]</a> to:</p>
+
+<blockquote>Complexity: For nonempty ranges, exactly last - first - 1
+applications of the corresponding predicate.</blockquote>
+
+<hr>
+<a name="240"><h3>240.&nbsp;Complexity of adjacent_find() is meaningless</h3></a><p>
+<b>Section:</b>&nbsp;25.1.5 <a href="lib-algorithms.html#lib.alg.adjacent.find"> [lib.alg.adjacent.find]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#Ready">Ready</a>&nbsp; <b>Submitter:</b>&nbsp;Angelika Langer&nbsp; <b>Date:</b>&nbsp;May 15 2000</p>
+<p>The complexity section of adjacent_find is defective:</p>
+
+<blockquote>
+<pre>
+template &lt;class ForwardIterator&gt;
+ForwardIterator adjacent_find(ForwardIterator first, ForwardIterator last
+ BinaryPredicate pred);
+</pre>
+
+<p>-1- Returns: The first iterator i such that both i and i + 1 are in
+the range [first, last) for which the following corresponding
+conditions hold: *i == *(i + 1), pred(*i, *(i + 1)) != false. Returns
+last if no such iterator is found.</p>
+
+<p>-2- Complexity: Exactly find(first, last, value) - first applications
+of the corresponding predicate.
+</p>
+</blockquote>
+
+<p>In the Complexity section, it is not defined what &quot;value&quot;
+is supposed to mean. My best guess is that &quot;value&quot; means an
+object for which one of the conditions pred(*i,value) or
+pred(value,*i) is true, where i is the iterator defined in the Returns
+section. However, the value type of the input sequence need not be
+equality-comparable and for this reason the term find(first, last,
+value) - first is meaningless.</p>
+
+<p>A term such as find_if(first, last, bind2nd(pred,*i)) - first or
+find_if(first, last, bind1st(pred,*i)) - first might come closer to
+the intended specification. Binders can only be applied to function
+objects that have the function call operator declared const, which is
+not required of predicates because they can have non-const data
+members. For this reason, a specification using a binder could only be
+an &quot;as-if&quot; specification.</p>
+<p><b>Proposed resolution:</b></p>
+<p>Change the complexity section in 25.1.5 <a href="lib-algorithms.html#lib.alg.adjacent.find"> [lib.alg.adjacent.find]</a> to:</p>
+<blockquote>
+For a nonempty range, exactly <tt>min((<i>i</i> - <i>first</i>) + 1,
+(<i>last</i> - <i>first</i>) - 1)</tt> applications of the
+corresponding predicate, where <i>i</i> is <tt>adjacent_find</tt>'s
+return value.
+</blockquote>
+
+<p><i>[Copenhagen: the original resolution specified an upper
+bound. The LWG preferred an exact count.]</i></p>
+
+<hr>
+<a name="241"><h3>241.&nbsp;Does unique_copy() require CopyConstructible and Assignable?</h3></a><p>
+<b>Section:</b>&nbsp;25.2.8 <a href="lib-algorithms.html#lib.alg.unique"> [lib.alg.unique]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#Review">Review</a>&nbsp; <b>Submitter:</b>&nbsp;Angelika Langer&nbsp; <b>Date:</b>&nbsp;May 15 2000</p>
+
+<p>Some popular implementations of unique_copy() create temporary
+copies of values in the input sequence, at least if the input iterator
+is a pointer. Such an implementation is built on the assumption that
+the value type is CopyConstructible and Assignable.</p>
+
+<p>It is common practice in the standard that algorithms explicitly
+specify any additional requirements that they impose on any of the
+types used by the algorithm. An example of an algorithm that creates
+temporary copies and correctly specifies the additional requirements
+is accumulate(), 26.4.1 <a href="lib-numerics.html#lib.accumulate"> [lib.accumulate]</a>.</p>
+
+<p>Since the specifications of unique() and unique_copy() do not
+require CopyConstructible and Assignable of the InputIterator's value
+type the above mentioned implementations are not standard-compliant. I
+cannot judge whether this is a defect in the standard or a defect in
+the implementations.</p>
+<p><b>Proposed resolution:</b></p>
+<p>In 25.2.8 change:</p>
+
+<blockquote>
+-4- Requires: The ranges [first, last) and [result, result+(last-first))
+shall not overlap.
+</blockquote>
+
+<p>to:</p>
+
+<blockquote>
+-4- Requires: The ranges [first, last) and [result, result+(last-first))
+shall not overlap. The expression *result = *first must be valid. If
+both InputIterator and OutputIterator do not meet the requirements of
+forward iterator then the value type of InputIterator must be copy
+constructible. Otherwise copy constructible is not required.
+</blockquote>
+
+<p><i>[Redmond: the original proposed resolution didn't impose an
+explicit requirement that the iterator's value type must be copy
+constructible, on the grounds that an input iterator's value type must
+always be copy constructible. Not everyone in the LWG thought that
+this requirement was clear from table 72. It has been suggested that
+it might be possible to implement <tt>unique_copy</tt> without
+requiring assignability, although current implementations do impose
+that requirement. Howard provided new wording.]</i></p>
+
+<hr>
+<a name="247"><h3>247.&nbsp;<tt>vector</tt>, <tt>deque::insert</tt> complexity</h3></a><p>
+<b>Section:</b>&nbsp;23.2.4.3 <a href="lib-containers.html#lib.vector.modifiers"> [lib.vector.modifiers]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#Open">Open</a>&nbsp; <b>Submitter:</b>&nbsp;Lisa Lippincott&nbsp; <b>Date:</b>&nbsp;06 June 2000</p>
+<p>Paragraph 2 of 23.2.4.3 [lib.vector.modifiers] describes the complexity
+of <tt>vector::insert</tt>:</p>
+
+ <blockquote>
+ Complexity: If first and last are forward iterators, bidirectional
+ iterators, or random access iterators, the complexity is linear in
+ the number of elements in the range [first, last) plus the distance
+ to the end of the vector. If they are input iterators, the complexity
+ is proportional to the number of elements in the range [first, last)
+ times the distance to the end of the vector.
+ </blockquote>
+
+<p>First, this fails to address the non-iterator forms of
+<tt>insert</tt>.</p>
+
+<p>Second, the complexity for input iterators misses an edge case --
+it requires that an arbitrary number of elements can be added at
+the end of a <tt>vector</tt> in constant time.</p>
+
+<p>At the risk of strengthening the requirement, I suggest simply</p>
+
+ <blockquote>
+ Complexity: The complexity is linear in the number of elements
+ inserted plus the distance to the end of the vector.
+ </blockquote>
+
+<p>For input iterators, one may achieve this complexity by first
+inserting at the end of the <tt>vector</tt>, and then using
+<tt>rotate</tt>.</p>
+
+<p>I looked to see if <tt>deque</tt> had a similar problem, and was
+surprised to find that <tt>deque</tt> places no requirement on the
+complexity of inserting multiple elements (23.2.1.3 <a href="lib-containers.html#lib.deque.modifiers"> [lib.deque.modifiers]</a>,
+paragraph 3):</p>
+
+ <blockquote>
+ Complexity: In the worst case, inserting a single element into a
+ deque takes time linear in the minimum of the distance from the
+ insertion point to the beginning of the deque and the distance
+ from the insertion point to the end of the deque. Inserting a
+ single element either at the beginning or end of a deque always
+ takes constant time and causes a single call to the copy constructor
+ of T.
+ </blockquote>
+
+<p>I suggest:</p>
+
+ <blockquote>
+ Complexity: The complexity is linear in the number of elements
+ inserted plus the shorter of the distances to the beginning and
+ end of the deque. Inserting a single element at either the
+ beginning or the end of a deque causes a single call to the copy
+ constructor of T.
+ </blockquote>
+<p><b>Proposed resolution:</b></p>
+
+<p><i>[Toronto: It's agreed that there is a defect in complexity of
+multi-element insert for vector and deque. For vector, the complexity
+should probably be something along the lines of <tt>c<sub>1</sub> * N
++ c<sub>2</sub> * distance(i, end())</tt>. However, there is some
+concern about whether it is reasonable to amortize away the copies
+that we get from a reallocation whenever we exceed the vector's
+capacity. For deque, the situation is somewhat less clear. Deque is
+notoriously complicated, and we may not want to impose complexity
+requirements that would imply any implementation technique more
+complicated than a while loop whose body is a single-element
+insert.]</i></p>
+<hr>
+<a name="253"><h3>253.&nbsp;valarray helper functions are almost entirely useless</h3></a><p>
+<b>Section:</b>&nbsp;26.3.2.1 <a href="lib-numerics.html#lib.valarray.cons"> [lib.valarray.cons]</a>, 26.3.2.2 <a href="lib-numerics.html#lib.valarray.assign"> [lib.valarray.assign]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#Review">Review</a>&nbsp; <b>Submitter:</b>&nbsp;Robert Klarer&nbsp; <b>Date:</b>&nbsp;31 Jul 2000</p>
+<p>This discussion is adapted from message c++std-lib-7056 posted
+November 11, 1999. I don't think that anyone can reasonably claim
+that the problem described below is NAD.</p>
+
+<p>These valarray constructors can never be called:</p>
+
+<pre>
+ template &lt;class T&gt;
+ valarray&lt;T&gt;::valarray(const slice_array&lt;T&gt; &amp;);
+ template &lt;class T&gt;
+ valarray&lt;T&gt;::valarray(const gslice_array&lt;T&gt; &amp;);
+ template &lt;class T&gt;
+ valarray&lt;T&gt;::valarray(const mask_array&lt;T&gt; &amp;);
+ template &lt;class T&gt;
+ valarray&lt;T&gt;::valarray(const indirect_array&lt;T&gt; &amp;);
+</pre>
+
+<p>Similarly, these valarray assignment operators cannot be
+called:</p>
+
+<pre>
+ template &lt;class T&gt;
+ valarray&lt;T&gt; valarray&lt;T&gt;::operator=(const slice_array&lt;T&gt; &amp;);
+ template &lt;class T&gt;
+ valarray&lt;T&gt; valarray&lt;T&gt;::operator=(const gslice_array&lt;T&gt; &amp;);
+ template &lt;class T&gt;
+ valarray&lt;T&gt; valarray&lt;T&gt;::operator=(const mask_array&lt;T&gt; &amp;);
+ template &lt;class T&gt;
+ valarray&lt;T&gt; valarray&lt;T&gt;::operator=(const indirect_array&lt;T&gt; &amp;);
+</pre>
+
+<p>Please consider the following example:</p>
+
+<pre>
+ #include &lt;valarray&gt;
+ using namespace std;
+
+ int main()
+ {
+ valarray&lt;double&gt; va1(12);
+ valarray&lt;double&gt; va2(va1[slice(1,4,3)]); // line 1
+ }
+</pre>
+
+
+<p>Since the valarray va1 is non-const, the result of the sub-expression
+va1[slice(1,4,3)] at line 1 is an rvalue of type const
+std::slice_array&lt;double&gt;. This slice_array rvalue is then used to
+construct va2. The constructor that is used to construct va2 is
+declared like this:</p>
+
+<pre>
+ template &lt;class T&gt;
+ valarray&lt;T&gt;::valarray(const slice_array&lt;T&gt; &amp;);
+</pre>
+
+<p>Notice the constructor's const reference parameter. When the
+constructor is called, a slice_array must be bound to this reference.
+The rules for binding an rvalue to a const reference are in 8.5.3,
+paragraph 5 (see also 13.3.3.1.4). Specifically, paragraph 5
+indicates that a second slice_array rvalue is constructed (in this
+case copy-constructed) from the first one; it is this second rvalue
+that is bound to the reference parameter. Paragraph 5 also requires
+that the constructor that is used for this purpose be callable,
+regardless of whether the second rvalue is elided. The
+copy-constructor in this case is not callable, however, because it is
+private. Therefore, the compiler should report an error.</p>
+
+<p>Since slice_arrays are always rvalues, the valarray constructor that has a
+parameter of type const slice_array&lt;T&gt; &amp; can never be called. The
+same reasoning applies to the three other constructors and the four
+assignment operators that are listed at the beginning of this post.
+Furthermore, since these functions cannot be called, the valarray helper
+classes are almost entirely useless.</p>
+<p><b>Proposed resolution:</b></p>
+<p>slice_array:</p>
+<ul>
+<li> remove the copy constructor and copy-assignment operator declarations
+ from the slice_array class template definition in 26.3.5 <a href="lib-numerics.html#lib.template.slice.array"> [lib.template.slice.array]</a> </li>
+<li> remove paragraph 3 of 26.3.5 <a href="lib-numerics.html#lib.template.slice.array"> [lib.template.slice.array]</a>
+</li>
+<li> remove the copy constructor declaration from 26.3.5.1 <a href="lib-numerics.html#lib.cons.slice.arr"> [lib.cons.slice.arr]</a>
+</li>
+<li> change paragraph 1 of 26.3.5.1 <a href="lib-numerics.html#lib.cons.slice.arr"> [lib.cons.slice.arr]</a> to read &quot;This constructor is declared
+ to be private. This constructor need not be defined.&quot;</li>
+<li> remove the copy-assignment operator declaration from 26.3.5.2 <a href="lib-numerics.html#lib.slice.arr.assign"> [lib.slice.arr.assign]</a>
+</li>
+<li> remove the first sentence of paragraph 1 of 26.3.5.2 <a href="lib-numerics.html#lib.slice.arr.assign"> [lib.slice.arr.assign]</a>
+</li>
+<li> Change the first two words of the second sentence of paragraph 1 of
+ 26.3.5.2 <a href="lib-numerics.html#lib.slice.arr.assign"> [lib.slice.arr.assign]</a> to &quot;This function.&quot;</li>
+</ul>
+
+<p>gslice_array:</p>
+<ul>
+<li> remove the copy constructor and copy-assignment operator declarations
+ from the gslice_array class template definition in 26.3.7 <a href="lib-numerics.html#lib.template.gslice.array"> [lib.template.gslice.array]</a> </li>
+<li> remove the note in paragraph 3 of 26.3.7 <a href="lib-numerics.html#lib.template.gslice.array"> [lib.template.gslice.array]</a>
+</li>
+<li> remove the copy constructor declaration from 26.3.7.1 <a href="lib-numerics.html#lib.gslice.array.cons"> [lib.gslice.array.cons]</a>
+</li>
+<li> change paragraph 1 of 26.3.7.1 <a href="lib-numerics.html#lib.gslice.array.cons"> [lib.gslice.array.cons]</a> to read &quot;This constructor is declared
+ to be private. This constructor need not be defined.&quot;</li>
+<li> remove the copy-assignment operator declaration from 26.3.7.2 <a href="lib-numerics.html#lib.gslice.array.assign"> [lib.gslice.array.assign]</a>
+</li>
+<li> remove the first sentence of paragraph 1 of 26.3.7.2 <a href="lib-numerics.html#lib.gslice.array.assign"> [lib.gslice.array.assign]</a>
+</li>
+<li> Change the first two words of the second sentence of paragraph 1 of
+ 26.3.7.2 <a href="lib-numerics.html#lib.gslice.array.assign"> [lib.gslice.array.assign]</a> to &quot;This function.&quot;</li>
+</ul>
+
+<p>mask_array:</p>
+<ul>
+<li> remove the copy constructor and copy-assignment operator declarations
+ from the mask_array class template definition in 26.3.8 <a href="lib-numerics.html#lib.template.mask.array"> [lib.template.mask.array]</a> </li>
+<li> remove the note in paragraph 2 of 26.3.8 <a href="lib-numerics.html#lib.template.mask.array"> [lib.template.mask.array]</a>
+</li>
+<li> remove the copy constructor declaration from 26.3.8.1 <a href="lib-numerics.html#lib.mask.array.cons"> [lib.mask.array.cons]</a>
+</li>
+<li> change paragraph 1 of 26.3.8.1 <a href="lib-numerics.html#lib.mask.array.cons"> [lib.mask.array.cons]</a> to read &quot;This constructor is declared
+ to be private. This constructor need not be defined.&quot;</li>
+<li> remove the first sentence of paragraph 1 of 26.3.8.2 <a href="lib-numerics.html#lib.mask.array.assign"> [lib.mask.array.assign]</a>
+</li>
+<li> Change the first two words of the second sentence of paragraph 1 of
+ 26.3.8.2 <a href="lib-numerics.html#lib.mask.array.assign"> [lib.mask.array.assign]</a> to &quot;This function.&quot;</li>
+</ul>
+
+<p>indirect_array:</p>
+<ul>
+<li>remove the copy constructor and copy-assignment operator declarations
+ from the indirect_array class definition in 26.3.9 <a href="lib-numerics.html#lib.template.indirect.array"> [lib.template.indirect.array]</a>
+</li>
+<li> remove the note in paragraph 2 of 26.3.9 <a href="lib-numerics.html#lib.template.indirect.array"> [lib.template.indirect.array]</a>
+</li>
+<li> remove the copy constructor declaration from 26.3.9.1 <a href="lib-numerics.html#lib.indirect.array.cons"> [lib.indirect.array.cons]</a>
+</li>
+<li> change the descriptive text in 26.3.9.1 <a href="lib-numerics.html#lib.indirect.array.cons"> [lib.indirect.array.cons]</a> to read &quot;This constructor is
+ declared to be private. This constructor need not be defined.&quot;</li>
+<li> remove the first sentence of paragraph 1 of 26.3.9.2 <a href="lib-numerics.html#lib.indirect.array.assign"> [lib.indirect.array.assign]</a>
+</li>
+<li> Change the first two words of the second sentence of paragraph 1 of
+ 26.3.9.2 <a href="lib-numerics.html#lib.indirect.array.assign"> [lib.indirect.array.assign]</a> to &quot;This function.&quot;</li>
+</ul>
+<p><i>[This wording is taken from Robert Klarer's reflector message,
+c++std-lib-7827. Gabriel Dos Reis agrees that this general solution
+is correct.]</i></p>
+<p><b>Rationale:</b></p>
+<p>Keeping the valarray constructors private is untenable. Merely
+making valarray a friend of the helper classes isn't good enough,
+because access to the copy constructor is checked in the user's
+environment.</p>
+
+<p>Making the assignment operator public is not strictly necessary to
+solve this problem. A majority of the LWG <i>(straw poll: 13-4)</i>
+believed we should make the assignment operators public, in addition
+to the copy constructors, for reasons of symmetry and user
+expectation.</p>
+<hr>
+<a name="254"><h3>254.&nbsp;Exception types in clause 19 are constructed from <tt>std::string</tt>
+</h3></a><p>
+<b>Section:</b>&nbsp;19.1 <a href="lib-diagnostics.html#lib.std.exceptions"> [lib.std.exceptions]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#Open">Open</a>&nbsp; <b>Submitter:</b>&nbsp;Dave Abrahams&nbsp; <b>Date:</b>&nbsp;01 Aug 2000</p>
+<p>
+Many of the standard exception types which implementations are
+required to throw are constructed with a const std::string&amp;
+parameter. For example:
+</p>
+
+<pre>
+ 19.1.5 Class out_of_range [lib.out.of.range]
+ namespace std {
+ class out_of_range : public logic_error {
+ public:
+ explicit out_of_range(const string&amp; what_arg);
+ };
+ }
+
+ 1 The class out_of_range defines the type of objects thrown as excep-
+ tions to report an argument value not in its expected range.
+
+ out_of_range(const string&amp; what_arg);
+
+ Effects:
+ Constructs an object of class out_of_range.
+ Postcondition:
+ strcmp(what(), what_arg.c_str()) == 0.
+</pre>
+
+<p>
+There are at least two problems with this:
+</p>
+<ol>
+<li>A program which is low on memory may end up throwing
+std::bad_alloc instead of out_of_range because memory runs out while
+constructing the exception object.</li>
+<li>An obvious implementation which stores a std::string data member
+may end up invoking terminate() during exception unwinding because the
+exception object allocates memory (or rather fails to) as it is being
+copied.</li>
+</ol>
+
+<p>
+There may be no cure for (1) other than changing the interface to
+out_of_range, though one could reasonably argue that (1) is not a
+defect. Personally I don't care that much if out-of-memory is reported
+when I only have 20 bytes left, in the case when out_of_range would
+have been reported. People who use exception-specifications might care
+a lot, though.
+</p>
+
+<p>
+There is a cure for (2), but it isn't completely obvious. I think a
+note for implementors should be made in the standard. Avoiding
+possible termination in this case shouldn't be left up to chance. The
+cure is to use a reference-counted &quot;string&quot; implementation
+in the exception object. I am not necessarily referring to a
+std::string here; any simple reference-counting scheme for a NTBS
+would do.
+</p>
+
+<p><b>Further discussion, in email:</b></p>
+
+<p>
+...I'm not so concerned about (1). After all, a library implementation
+can add const char* constructors as an extension, and users don't
+<i>need</i> to avail themselves of the standard exceptions, though this is
+a lame position to be forced into. FWIW, std::exception and
+std::bad_alloc don't require a temporary basic_string.
+</p>
+
+<p>
+...I don't think the fixed-size buffer is a solution to the problem,
+strictly speaking, because you can't satisfy the postcondition
+<br>
+ <tt>&nbsp;&nbsp;strcmp(what(), what_arg.c_str()) == 0</tt>
+<br>
+For all values of what_arg (i.e. very long values). That means that
+the only truly conforming solution requires a dynamic allocation.
+</p>
+
+<p><b>Further discussion, from Redmond:</b></p>
+
+<p>The most important progress we made at the Redmond meeting was
+realizing that there are two separable issues here: the const
+string&amp; constructor, and the copy constructor. If a user writes
+something like <tt>throw std::out_of_range(&quot;foo&quot;)</tt>, the const
+string&amp; constructor is invoked before anything gets thrown. The
+copy constructor is potentially invoked during stack unwinding.</p>
+
+<p>The copy constructor is a more serious problem, becuase failure
+during stack unwinding invokes <tt>terminate</tt>. The copy
+constructor must be nothrow.</p>
+
+<p>The fundamental problem is that it's difficult to get the nothrow
+requirement to work well with the requirement that the exception
+objects store a string of unbounded size, particularly if you also try
+to make the const string&amp; constructor nothrow. Options discussed
+include:</p>
+
+<ul>
+<li>Limit the size of a string that exception objects are required to
+throw: change the postconditions of 19.1.2 <a href="lib-diagnostics.html#lib.domain.error"> [lib.domain.error]</a> paragraph 3
+and 19.1.6 <a href="lib-diagnostics.html#lib.runtime.error"> [lib.runtime.error]</a> paragraph 3 to something like this:
+&quot;strncmp(what(), what_arg._str(), N) == 0, where N is an
+implementation defined constant no smaller than 256&quot;.</li>
+<li>Allow the const string&amp; constructor to throw, but not the
+copy constructor. It's the implementor's responsibility to get it
+right. (An implementor might use a simple refcount class.)</li>
+<li>Compromise between the two: an implementation is not allowed to
+throw if the string's length is less than some N, but, if it doesn't
+throw, the string must compare equal to the argument.</li>
+<li>Add a new constructor that takes a const char*</li>
+</ul>
+
+<p>(Not all of these options are mutually exclusive.)</p>
+
+<p><b>Proposed resolution:</b></p>
+
+<p><i>[Toronto: some LWG members thought this was merely a QoI issue,
+but most believed that it was at least a borderline defect. There was
+more support for nonnormative advice to implementors than for a
+normative change.]</i></p>
+
+<p><i>[Redmond: discussed, without definite conclusion. Most LWG
+members thought there was a real defect lurking here. A small group
+(Herb, Kevlin, Howard, Martin, Dave) will try to make a
+recommendation.]</i></p>
+
+<hr>
+<a name="258"><h3>258.&nbsp;Missing allocator requirement</h3></a><p>
+<b>Section:</b>&nbsp;20.1.5 <a href="lib-utilities.html#lib.allocator.requirements"> [lib.allocator.requirements]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#Open">Open</a>&nbsp; <b>Submitter:</b>&nbsp;Matt Austern&nbsp; <b>Date:</b>&nbsp;22 Aug 2000</p>
+<p>
+From lib-7752:
+</p>
+
+<p>
+I've been assuming (and probably everyone else has been assuming) that
+allocator instances have a particular property, and I don't think that
+property can be deduced from anything in Table 32.
+</p>
+
+<p>
+I think we have to assume that allocator type conversion is a
+homomorphism. That is, if x1 and x2 are of type X, where
+X::value_type is T, and if type Y is X::template
+rebind&lt;U&gt;::other, then Y(x1) == Y(x2) if and only if x1 == x2.
+</p>
+
+<p>
+Further discussion: Howard Hinnant writes, in lib-7757:
+</p>
+
+<p>
+I think I can prove that this is not provable by Table 32. And I agree
+it needs to be true except for the &quot;and only if&quot;. If x1 != x2, I see no
+reason why it can't be true that Y(x1) == Y(x2). Admittedly I can't
+think of a practical instance where this would happen, or be valuable.
+But I also don't see a need to add that extra restriction. I think we
+only need:
+</p>
+
+<blockquote>
+ if (x1 == x2) then Y(x1) == Y(x2)
+</blockquote>
+
+<p>
+If we decide that == on allocators is transitive, then I think I can
+prove the above. But I don't think == is necessarily transitive on
+allocators. That is:
+</p>
+
+<p>
+Given x1 == x2 and x2 == x3, this does not mean x1 == x3.
+</p>
+
+<p>Example:</p>
+
+<blockquote>
+<p>
+x1 can deallocate pointers from: x1, x2, x3 <br>
+x2 can deallocate pointers from: x1, x2, x4 <br>
+x3 can deallocate pointers from: x1, x3 <br>
+x4 can deallocate pointers from: x2, x4
+</p>
+
+<p>
+x1 == x2, and x2 == x4, but x1 != x4
+</p>
+</blockquote>
+<p><b>Proposed resolution:</b></p>
+
+<p><i>[Toronto: LWG members offered multiple opinions. One
+opinion is that it should not be required that <tt>x1 == x2</tt>
+implies <tt>Y(x1) == Y(x2)</tt>, and that it should not even be
+required that <tt>X(x1) == x1</tt>. Another opinion is that
+the second line from the bottom in table 32 already implies the
+desired property. This issue should be considered in light of
+other issues related to allocator instances.]</i></p>
+<hr>
+<a name="270"><h3>270.&nbsp;Binary search requirements overly strict</h3></a><p>
+<b>Section:</b>&nbsp;25.3.3 <a href="lib-algorithms.html#lib.alg.binary.search"> [lib.alg.binary.search]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#Ready">Ready</a>&nbsp; <b>Submitter:</b>&nbsp;Matt Austern&nbsp; <b>Date:</b>&nbsp;18 Oct 2000</p>
+<p>
+Each of the four binary search algorithms (lower_bound, upper_bound,
+equal_range, binary_search) has a form that allows the user to pass a
+comparison function object. According to 25.3, paragraph 2, that
+comparison function object has to be a strict weak ordering.
+</p>
+
+<p>
+This requirement is slightly too strict. Suppose we are searching
+through a sequence containing objects of type X, where X is some
+large record with an integer key. We might reasonably want to look
+up a record by key, in which case we would want to write something
+like this:
+</p>
+<pre>
+ struct key_comp {
+ bool operator()(const X&amp; x, int n) const {
+ return x.key() &lt; n;
+ }
+ }
+
+ std::lower_bound(first, last, 47, key_comp());
+</pre>
+
+<p>
+key_comp is not a strict weak ordering, but there is no reason to
+prohibit its use in lower_bound.
+</p>
+
+<p>
+There's no difficulty in implementing lower_bound so that it allows
+the use of something like key_comp. (It will probably work unless an
+implementor takes special pains to forbid it.) What's difficult is
+formulating language in the standard to specify what kind of
+comparison function is acceptable. We need a notion that's slightly
+more general than that of a strict weak ordering, one that can encompass
+a comparison function that involves different types. Expressing that
+notion may be complicated.
+</p>
+
+<p><i>Additional questions raised at the Toronto meeting:</i></p>
+<ul>
+<li> Do we really want to specify what ordering the implementor must
+ use when calling the function object? The standard gives
+ specific expressions when describing these algorithms, but it also
+ says that other expressions (with different argument order) are
+ equivalent.</li>
+<li> If we are specifying ordering, note that the standard uses both
+ orderings when describing <tt>equal_range</tt>.</li>
+<li> Are we talking about requiring these algorithms to work properly
+ when passed a binary function object whose two argument types
+ are not the same, or are we talking about requirements when
+ they are passed a binary function object with several overloaded
+ versions of <tt>operator()</tt>?</li>
+<li> The definition of a strict weak ordering does not appear to give
+ any guidance on issues of overloading; it only discusses expressions,
+ and all of the values in these expressions are of the same type.
+ Some clarification would seem to be in order.</li>
+</ul>
+
+<p><i>Additional discussion from Copenhagen:</i></p>
+<ul>
+<li>It was generally agreed that there is a real defect here: if
+the predicate is merely required to be a Strict Weak Ordering, then
+it's possible to pass in a function object with an overloaded
+operator(), where the version that's actually called does something
+completely inappropriate. (Such as returning a random value.)</li>
+
+<li>An alternative formulation was presented in a paper distributed by
+David Abrahams at the meeting, &quot;Binary Search with Heterogeneous
+Comparison&quot;, J16-01/0027 = WG21 N1313: Instead of viewing the
+predicate as a Strict Weak Ordering acting on a sorted sequence, view
+the predicate/value pair as something that partitions a sequence.
+This is almost equivalent to saying that we should view binary search
+as if we are given a unary predicate and a sequence, such that f(*p)
+is true for all p below a specific point and false for all p above it.
+The proposed resolution is based on that alternative formulation.</li>
+</ul>
+<p><b>Proposed resolution:</b></p>
+
+<p>Change 25.3 [lib.alg.sorting] paragraph 3 from:</p>
+
+<blockquote>
+ 3 For all algorithms that take Compare, there is a version that uses
+ operator&lt; instead. That is, comp(*i, *j) != false defaults to *i &lt;
+ *j != false. For the algorithms to work correctly, comp has to
+ induce a strict weak ordering on the values.
+</blockquote>
+
+<p>to:</p>
+
+<blockquote>
+ 3 For all algorithms that take Compare, there is a version that uses
+ operator&lt; instead. That is, comp(*i, *j) != false defaults to *i
+ &lt; *j != false. For algorithms other than those described in
+ lib.alg.binary.search (25.3.3) to work correctly, comp has to induce
+ a strict weak ordering on the values.
+</blockquote>
+
+<p>Add the following paragraph after 25.3 [lib.alg.sorting] paragraph 5:</p>
+
+<blockquote>
+ -6- A sequence [start, finish) is partitioned with respect to an
+ expression f(e) if there exists an integer n such that
+ for all 0 &lt;= i &lt; distance(start, finish), f(*(begin+i)) is true if
+ and only if i &lt; n.
+</blockquote>
+
+<p>Change 25.3.3 [lib.alg.binary.search] paragraph 1 from:</p>
+
+<blockquote>
+ -1- All of the algorithms in this section are versions of binary
+ search and assume that the sequence being searched is in order
+ according to the implied or explicit comparison function. They work
+ on non-random access iterators minimizing the number of
+ comparisons, which will be logarithmic for all types of
+ iterators. They are especially appropriate for random access
+ iterators, because these algorithms do a logarithmic number of
+ steps through the data structure. For non-random access iterators
+ they execute a linear number of steps.
+</blockquote>
+
+<p>to:</p>
+
+<blockquote>
+ -1- All of the algorithms in this section are versions of binary
+ search and assume that the sequence being searched is partitioned
+ with respect to an expression formed by binding the search key to
+ an argument of the implied or explicit comparison function. They
+ work on non-random access iterators minimizing the number of
+ comparisons, which will be logarithmic for all types of
+ iterators. They are especially appropriate for random access
+ iterators, because these algorithms do a logarithmic number of
+ steps through the data structure. For non-random access iterators
+ they execute a linear number of steps.
+</blockquote>
+
+<p>Change 25.3.3.1 [lib.lower.bound] paragraph 1 from:</p>
+
+<blockquote>
+ -1- Requires: Type T is LessThanComparable
+ (lib.lessthancomparable).
+</blockquote>
+
+<p>to:</p>
+
+<blockquote>
+ -1- Requires: The elements e of [first, last) are partitioned with
+ respect to the expression e &lt; value or comp(e, value)
+</blockquote>
+
+
+<p>Remove 25.3.3.1 [lib.lower.bound] paragraph 2:</p>
+
+<blockquote>
+ -2- Effects: Finds the first position into which value can be
+ inserted without violating the ordering.
+</blockquote>
+
+<p>Change 25.3.3.2 [lib.upper.bound] paragraph 1 from:</p>
+
+<blockquote>
+ -1- Requires: Type T is LessThanComparable (lib.lessthancomparable).
+</blockquote>
+
+<p>to:</p>
+
+<blockquote>
+ -1- Requires: The elements e of [first, last) are partitioned with
+ respect to the expression !(value &lt; e) or !comp(value, e)
+</blockquote>
+
+<p>Remove 25.3.3.2 [lib.upper.bound] paragraph 2:</p>
+
+<blockquote>
+ -2- Effects: Finds the furthermost position into which value can be
+ inserted without violating the ordering.
+</blockquote>
+
+<p>Change 25.3.3.3 [lib.equal.range] paragraph 1 from:</p>
+
+<blockquote>
+ -1- Requires: Type T is LessThanComparable
+ (lib.lessthancomparable).
+</blockquote>
+
+<p>to:</p>
+
+<blockquote>
+ -1- Requires: The elements e of [first, last) are partitioned with
+ respect to the expressions e &lt; value and !(value &lt; e) or
+ comp(e, value) and !comp(value, e). Also, for all elements e of
+ [first, last), e &lt; value implies !(value &lt; e) or comp(e,
+ value) implies !comp(value, e)
+</blockquote>
+
+<p>Change 25.3.3.3 [lib.equal.range] paragraph 2 from:</p>
+
+<blockquote>
+ -2- Effects: Finds the largest subrange [i, j) such that the value
+ can be inserted at any iterator k in it without violating the
+ ordering. k satisfies the corresponding conditions: !(*k &lt; value)
+ &amp;&amp; !(value &lt; *k) or comp(*k, value) == false &amp;&amp; comp(value, *k) ==
+ false.
+</blockquote>
+
+<p>to:</p>
+
+<pre>
+ -2- Returns:
+ make_pair(lower_bound(first, last, value),
+ upper_bound(first, last, value))
+ or
+ make_pair(lower_bound(first, last, value, comp),
+ upper_bound(first, last, value, comp))
+</pre>
+
+<p>Change 25.3.3.3 [lib.binary.search] paragraph 1 from:</p>
+
+<blockquote>
+ -1- Requires: Type T is LessThanComparable
+ (lib.lessthancomparable).
+</blockquote>
+
+<p>to:</p>
+
+<blockquote>
+ -1- Requires: The elements e of [first, last) are partitioned with
+ respect to the expressions e &lt; value and !(value &lt; e) or comp(e,
+ value) and !comp(value, e). Also, for all elements e of [first,
+ last), e &lt; value implies !(value &lt; e) or comp(e, value) implies
+ !comp(value, e)
+</blockquote>
+
+<p><i>[Copenhagen: Dave Abrahams provided this wording]</i></p>
+
+<p><i>[Redmond: Minor changes in wording. (Removed &quot;non-negative&quot;, and
+changed the &quot;other than those described in&quot; wording.) Also, the LWG
+decided to accept the &quot;optional&quot; part.]</i></p>
+
+<p><b>Rationale:</b></p>
+<p>The proposed resolution reinterprets binary search. Instead of
+thinking about searching for a value in a sorted range, we view that
+as an important special case of a more general algorithm: searching
+for the partition point in a partitioned range.</p>
+
+<p>We also add a guarantee that the old wording did not: we ensure
+that the upper bound is no earlier than the lower bound, that
+the pair returned by equal_range is a valid range, and that the first
+part of that pair is the lower bound.</p>
+<hr>
+<a name="274"><h3>274.&nbsp;a missing/impossible allocator requirement</h3></a><p>
+<b>Section:</b>&nbsp;20.1.5 <a href="lib-utilities.html#lib.allocator.requirements"> [lib.allocator.requirements]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#Ready">Ready</a>&nbsp; <b>Submitter:</b>&nbsp;Martin Sebor&nbsp; <b>Date:</b>&nbsp;02 Nov 2000</p>
+<p>
+I see that table 31 in 20.1.5, p3 allows T in std::allocator&lt;T&gt; to be of
+any type. But the synopsis in 20.4.1 calls for allocator&lt;&gt;::address() to
+be overloaded on reference and const_reference, which is ill-formed for
+all T = const U. In other words, this won't work:
+</p>
+
+<p>
+template class std::allocator&lt;const int&gt;;
+</p>
+
+<p>
+The obvious solution is to disallow specializations of allocators on
+const types. However, while containers' elements are required to be
+assignable (which rules out specializations on const T's), I think that
+allocators might perhaps be potentially useful for const values in other
+contexts. So if allocators are to allow const types a partial
+specialization of std::allocator&lt;const T&gt; would probably have to be
+provided.
+</p>
+<p><b>Proposed resolution:</b></p>
+<p>Change the text in row 1, column 2 of table 32 in 20.1.5, p3 from</p>
+
+ <blockquote>
+ any type
+ </blockquote>
+
+<p>to</p>
+ <blockquote>
+ any non-const, non-reference type
+ </blockquote>
+
+<p><i>[Redmond: previous proposed resolution was &quot;any non-const,
+non-volatile, non-reference type&quot;. Got rid of the &quot;non-volatile&quot;.]</i></p>
+
+<p><b>Rationale:</b></p>
+<p>
+Two resolutions were originally proposed: one that partially
+specialized std::allocator for const types, and one that said an
+allocator's value type may not be const. The LWG chose the second.
+The first wouldn't be appropriate, because allocators are intended for
+use by containers, and const value types don't work in containers.
+Encouraging the use of allocators with const value types would only
+lead to unsafe code.
+</p>
+<p>
+The original text for proposed resolution 2 was modified so that it
+also forbids volatile types and reference types.
+</p>
+<hr>
+<a name="276"><h3>276.&nbsp;Assignable requirement for container value type overly strict</h3></a><p>
+<b>Section:</b>&nbsp;23.1 <a href="lib-containers.html#lib.container.requirements"> [lib.container.requirements]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#Ready">Ready</a>&nbsp; <b>Submitter:</b>&nbsp;Peter Dimov&nbsp; <b>Date:</b>&nbsp;07 Nov 2000</p>
+<p>
+23.1/3 states that the objects stored in a container must be
+Assignable. 23.3.1 <a href="lib-containers.html#lib.map"> [lib.map]</a>, paragraph 2,
+states that map satisfies all requirements for a container, while in
+the same time defining value_type as pair&lt;const Key, T&gt; - a type
+that is not Assignable.
+</p>
+
+<p>
+It should be noted that there exists a valid and non-contradictory
+interpretation of the current text. The wording in 23.1/3 avoids
+mentioning value_type, referring instead to &quot;objects stored in a
+container.&quot; One might argue that map does not store objects of
+type map::value_type, but of map::mapped_type instead, and that the
+Assignable requirement applies to map::mapped_type, not
+map::value_type.
+</p>
+
+<p>
+However, this makes map a special case (other containers store objects of
+type value_type) and the Assignable requirement is needlessly restrictive in
+general.
+</p>
+
+<p>
+For example, the proposed resolution of active library issue
+<a href="lwg-defects.html#103">103</a> is to make set::iterator a constant iterator; this
+means that no set operations can exploit the fact that the stored
+objects are Assignable.
+</p>
+
+<p>
+This is related to, but slightly broader than, closed issue
+<a href="lwg-closed.html#140">140</a>.
+</p>
+<p><b>Proposed resolution:</b></p>
+<p>23.1/3: Strike the trailing part of the sentence:</p>
+ <blockquote>
+ , and the additional requirements of Assignable types from 23.1/3
+ </blockquote>
+<p>so that it reads:</p>
+ <blockquote>
+ -3- The type of objects stored in these components must meet the
+ requirements of CopyConstructible types (lib.copyconstructible).
+ </blockquote>
+
+<p>23.1/4: Modify to make clear that this requirement is not for all
+containers. Change to:</p>
+
+<blockquote>
+-4- Table 64 defines the Assignable requirement. Some containers
+require this property of the types to be stored in the container. T is
+the type used to instantiate the container. t is a value of T, and u is
+a value of (possibly const) T.
+</blockquote>
+
+<p>23.1, Table 65: in the first row, change &quot;T is Assignable&quot; to &quot;T is
+CopyConstructible&quot;.</p>
+
+<p>23.2.1/2: Add sentence for Assignable requirement. Change to:</p>
+
+<blockquote>
+-2- A deque satisfies all of the requirements of a container and of a
+reversible container (given in tables in lib.container.requirements) and
+of a sequence, including the optional sequence requirements
+(lib.sequence.reqmts). In addition to the requirements on the stored
+object described in 23.1[lib.container.requirements], the stored object
+must also meet the requirements of Assignable. Descriptions are
+provided here only for operations on deque that are not described in one
+of these tables or for operations where there is additional semantic
+information.
+</blockquote>
+
+<p>23.2.2/2: Add Assignable requirement to specific methods of list.
+Change to:</p>
+
+<blockquote>
+<p>-2- A list satisfies all of the requirements of a container and of a
+reversible container (given in two tables in lib.container.requirements)
+and of a sequence, including most of the the optional sequence
+requirements (lib.sequence.reqmts). The exceptions are the operator[]
+and at member functions, which are not provided.
+
+[Footnote: These member functions are only provided by containers whose
+iterators are random access iterators. --- end foonote]
+</p>
+
+<p>list does not require the stored type T to be Assignable unless the
+following methods are instantiated:
+
+[Footnote: Implementors are permitted but not required to take advantage
+of T's Assignable properties for these methods. -- end foonote]
+</p>
+<pre>
+ list&lt;T,Allocator&gt;&amp; operator=(const list&lt;T,Allocator&gt;&amp; x );
+ template &lt;class InputIterator&gt;
+ void assign(InputIterator first, InputIterator last);
+ void assign(size_type n, const T&amp; t);
+</pre>
+
+
+<p>Descriptions are provided here only for operations on list that are not
+described in one of these tables or for operations where there is
+additional semantic information.</p>
+</blockquote>
+
+<p>23.2.4/2: Add sentence for Assignable requirement. Change to:</p>
+
+<blockquote>
+-2- A vector satisfies all of the requirements of a container and of a
+reversible container (given in two tables in lib.container.requirements)
+and of a sequence, including most of the optional sequence requirements
+(lib.sequence.reqmts). The exceptions are the push_front and pop_front
+member functions, which are not provided. In addition to the
+requirements on the stored object described in
+23.1[lib.container.requirements], the stored object must also meet the
+requirements of Assignable. Descriptions are provided here only for
+operations on vector that are not described in one of these tables or
+for operations where there is additional semantic information.
+</blockquote>
+<p><b>Rationale:</b></p>
+<p>list, set, multiset, map, multimap are able to store non-Assignables.
+However, there is some concern about <tt>list&lt;T&gt;</tt>:
+although in general there's no reason for T to be Assignable, some
+implementations of the member functions <tt>operator=</tt> and
+<tt>assign</tt> do rely on that requirement. The LWG does not want
+to forbid such implementations.</p>
+
+<p>Note that the type stored in a standard container must still satisfy
+the requirements of the container's allocator; this rules out, for
+example, such types as &quot;const int&quot;. See issue <a href="lwg-active.html#274">274</a>
+for more details.
+</p>
+
+<p>In principle we could also relax the &quot;Assignable&quot; requirement for
+individual <tt>vector</tt> member functions, such as
+<tt>push_back</tt>. However, the LWG did not see great value in such
+selective relaxation. Doing so would remove implementors' freedom to
+implement <tt>vector::push_back</tt> in terms of
+<tt>vector::insert</tt>.</p>
+
+<hr>
+<a name="278"><h3>278.&nbsp;What does iterator validity mean?</h3></a><p>
+<b>Section:</b>&nbsp;23.2.2.4 <a href="lib-containers.html#lib.list.ops"> [lib.list.ops]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#Review">Review</a>&nbsp; <b>Submitter:</b>&nbsp;P.J. Plauger&nbsp; <b>Date:</b>&nbsp;27 Nov 2000</p>
+<p>
+Section 23.2.2.4 [lib.list.ops] states that
+</p>
+<pre>
+ void splice(iterator position, list&lt;T, Allocator&gt;&amp; x);
+</pre>
+<p>
+<i>invalidates</i> all iterators and references to list <tt>x</tt>.
+</p>
+
+<p>
+But what does the C++ Standard mean by &quot;invalidate&quot;? You
+can still dereference the iterator to a spliced list element, but
+you'd better not use it to delimit a range within the original
+list. For the latter operation, it has definitely lost some of its
+validity.
+</p>
+
+<p>
+If we accept the proposed resolution to issue <a href="lwg-defects.html#250">250</a>,
+then we'd better clarify that a &quot;valid&quot; iterator need no
+longer designate an element within the same container as it once did.
+We then have to clarify what we mean by invalidating a past-the-end
+iterator, as when a vector or string grows by reallocation. Clearly,
+such an iterator has a different kind of validity. Perhaps we should
+introduce separate terms for the two kinds of &quot;validity.&quot;
+</p>
+<p><b>Proposed resolution:</b></p>
+<p>Add the following text to the end of section 24.1 <a href="lib-iterators.html#lib.iterator.requirements"> [lib.iterator.requirements]</a>,
+after paragraph 5:</p>
+<blockquote>
+An <i>invalid</i> iterator is an iterator that may be
+singular. [Footnote: This definition applies to pointers, since
+pointers are iterators. The effect of dereferencing an iterator that
+has been invalidated is undefined.]
+</blockquote>
+
+<p><i>[post-Copenhagen: Matt provided wording.]</i></p>
+
+<p><i>[Redmond: General agreement with the intent, some objections to
+the wording. Dave provided new wording.]</i></p>
+
+<hr>
+<a name="280"><h3>280.&nbsp;Comparison of reverse_iterator to const reverse_iterator</h3></a><p>
+<b>Section:</b>&nbsp;24.4.1 <a href="lib-iterators.html#lib.reverse.iterators"> [lib.reverse.iterators]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#Open">Open</a>&nbsp; <b>Submitter:</b>&nbsp;Steve Cleary&nbsp; <b>Date:</b>&nbsp;27 Nov 2000</p>
+<p>
+This came from an email from Steve Cleary to Fergus in reference to
+issue <a href="lwg-active.html#179">179</a>. The library working group briefly discussed
+this in Toronto and believed it should be a separate issue. There was
+also some reservations about whether this was a worthwhile problem to
+fix.
+</p>
+
+<p>
+Steve said: &quot;Fixing reverse_iterator. std::reverse_iterator can
+(and should) be changed to preserve these additional
+requirements.&quot; He also said in email that it can be done without
+breaking user's code: &quot;If you take a look at my suggested
+solution, reverse_iterator doesn't have to take two parameters; there
+is no danger of breaking existing code, except someone taking the
+address of one of the reverse_iterator global operator functions, and
+I have to doubt if anyone has ever done that. . . <i>But</i>, just in
+case they have, you can leave the old global functions in as well --
+they won't interfere with the two-template-argument functions. With
+that, I don't see how <i>any</i> user code could break.&quot;
+</p>
+<p><b>Proposed resolution:</b></p>
+<p>
+<b>Section:</b> 24.4.1.1 <a href="lib-iterators.html#lib.reverse.iterator"> [lib.reverse.iterator]</a>
+add/change the following declarations:</p>
+<pre>
+ A) Add a templated assignment operator, after the same manner
+ as the templated copy constructor, i.e.:
+
+ template &lt; class U &gt;
+ reverse_iterator &lt; Iterator &gt;&amp; operator=(const reverse_iterator&lt; U &gt;&amp; u);
+
+ B) Make all global functions (except the operator+) have
+ two template parameters instead of one, that is, for
+ operator ==, !=, &lt;, &gt;, &lt;=, &gt;=, - replace:
+
+ template &lt; class Iterator &gt;
+ typename reverse_iterator&lt; Iterator &gt;::difference_type operator-(
+ const reverse_iterator&lt; Iterator &gt;&amp; x,
+ const reverse_iterator&lt; Iterator &gt;&amp; y);
+
+ with:
+
+ template &lt; class Iterator1, class Iterator2 &gt;
+ typename reverse_iterator &lt; Iterator1 &gt;::difference_type operator-(
+ const reverse_iterator &lt; Iterator1 &gt; &amp; x,
+ const reverse_iterator &lt; Iterator2 &gt; &amp; y);
+</pre>
+<p>
+Also make the addition/changes for these signatures in
+24.4.1.3 <a href="lib-iterators.html#lib.reverse.iter.ops"> [lib.reverse.iter.ops]</a>.
+</p>
+
+<p><i>[
+Copenhagen: The LWG is concerned that the proposed resolution
+introduces new overloads. Experience shows that introducing
+overloads is always risky, and that it would be inappropriate to
+make this change without implementation experience. It may be
+desirable to provide this feature in a different way.
+]</i></p>
+
+<hr>
+<a name="282"><h3>282.&nbsp;What types does numpunct grouping refer to?</h3></a><p>
+<b>Section:</b>&nbsp;22.2.2.2.2 <a href="lib-locales.html#lib.facet.num.put.virtuals"> [lib.facet.num.put.virtuals]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#Open">Open</a>&nbsp; <b>Submitter:</b>&nbsp;Howard Hinnant&nbsp; <b>Date:</b>&nbsp;5 Dec 2000</p>
+<p>
+Paragraph 16 mistakenly singles out integral types for inserting
+thousands_sep() characters. This conflicts with the syntax for floating
+point numbers described under 22.2.3.1/2.
+</p>
+<p><b>Proposed resolution:</b></p>
+<p>Change paragraph 16 from:</p>
+
+<blockquote>
+For integral types, punct.thousands_sep() characters are inserted into
+the sequence as determined by the value returned by punct.do_grouping()
+using the method described in 22.2.3.1.2 <a href="lib-locales.html#lib.facet.numpunct.virtuals"> [lib.facet.numpunct.virtuals]</a>.
+</blockquote>
+
+<p>To:</p>
+
+<blockquote>
+For arithmetic types, punct.thousands_sep() characters are inserted into
+the sequence as determined by the value returned by punct.do_grouping()
+using the method described in 22.2.3.1.2 <a href="lib-locales.html#lib.facet.numpunct.virtuals"> [lib.facet.numpunct.virtuals]</a>.
+</blockquote>
+
+<p><i>[
+Copenhagen: Opinions were divided about whether this is actually an
+inconsistency, but at best it seems to have been unintentional. This
+is only an issue for floating-point output: The standard is
+unambiguous that implementations must parse thousands_sep characters
+when performing floating-point. The standard is also unambiguous that
+this requirement does not apply to the &quot;C&quot; locale.
+]</i></p>
+
+<p><i>[
+A survey of existing practice is needed; it is believed that some
+implementations do insert thousands_sep characters for floating-point
+output and others fail to insert thousands_sep characters for
+floating-point input even though this is unambiguously required by the
+standard.
+]</i></p>
+
+<hr>
+<a name="283"><h3>283.&nbsp;std::replace() requirement incorrect/insufficient</h3></a><p>
+<b>Section:</b>&nbsp;25.2.4 <a href="lib-algorithms.html#lib.alg.replace"> [lib.alg.replace]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#Review">Review</a>&nbsp; <b>Submitter:</b>&nbsp;Martin Sebor&nbsp; <b>Date:</b>&nbsp;15 Dec 2000</p>
+<p>
+The requirements in 25.2.4 <a href="lib-algorithms.html#lib.alg.replace"> [lib.alg.replace]</a>, p1 that <tt>T</tt> to be
+<tt>Assignable</tt> (23.1 <a href="lib-containers.html#lib.container.requirements"> [lib.container.requirements]</a>) is not necessary or
+sufficient for either of the algorithms. The algorithms require that
+<tt>std::iterator_traits&lt;ForwardIterator&gt;::value_type</tt> be
+<tt>Assignable</tt> and that both
+<tt>std::iterator_traits&lt;ForwardIterator&gt;::value_type</tt> and be
+<tt>EqualityComparable</tt> (20.1.1 <a href="lib-utilities.html#lib.equalitycomparable"> [lib.equalitycomparable]</a>) with respect to
+one another.
+</p>
+
+<p>
+<b>Further discussion, from Jeremy</b>:
+</p>
+
+<p>There are a number of problems with the requires clauses for the
+algorithms in 25.1 <a href="lib-algorithms.html#lib.alg.nonmodifying"> [lib.alg.nonmodifying]</a> and 25.2 <a href="lib-algorithms.html#lib.alg.modifying.operations"> [lib.alg.modifying.operations]</a>. The requires
+clause of each algorithm should describe the necessary and sufficient
+requirements on the inputs to the algorithm such that the algorithm
+compiles and runs properly. Many of the requires clauses fail to do
+this. Here is a summary of the kinds of mistakes:</p>
+
+<ol>
+<li> Use of EqualityComparable, which only puts requirements on a single
+ type, when in fact an equality operator is required between two
+ different types, typically either T and the iterators value_type
+ or between the value_type's of two different iterators.</li>
+
+<li> Use of Assignable for T when in fact what was needed is Assignable
+ for the value_type of the iterator, and convertability from T to the
+ value_type of the iterator. Or for output iterators, the requirement
+ should be that T is writable to the iterator (output iterators do
+ not have value types; see issue <a href="lwg-active.html#324">324</a>).</li>
+
+<li> Lack of a requires clause.</li>
+</ol>
+
+<p>Here is the list of algorithms that contain mistakes:</p>
+<ul>
+<li>25.1.2 <a href="lib-algorithms.html#lib.alg.find"> [lib.alg.find]</a>
+</li>
+<li>25.1.3 <a href="lib-algorithms.html#lib.alg.find.end"> [lib.alg.find.end]</a>
+</li>
+<li>25.1.4 <a href="lib-algorithms.html#lib.alg.find.first.of"> [lib.alg.find.first.of]</a>
+</li>
+<li>25.1.6 <a href="lib-algorithms.html#lib.alg.count"> [lib.alg.count]</a>
+</li>
+<li>25.1.7 <a href="lib-algorithms.html#lib.mismatch"> [lib.mismatch]</a>
+</li>
+<li>25.1.8 <a href="lib-algorithms.html#lib.alg.equal"> [lib.alg.equal]</a>
+</li>
+<li>25.1.9 <a href="lib-algorithms.html#lib.alg.search"> [lib.alg.search]</a>
+</li>
+<li>25.2.4 <a href="lib-algorithms.html#lib.alg.replace"> [lib.alg.replace]</a>
+</li>
+<li>25.2.5 <a href="lib-algorithms.html#lib.alg.fill"> [lib.alg.fill]</a>
+</li>
+<li>25.2.7 <a href="lib-algorithms.html#lib.alg.remove"> [lib.alg.remove]</a>
+</li>
+</ul>
+
+<p>Also, in the requirements for EqualityComparable, the requirement that
+the operator be defined for const objects is lacking.</p>
+<p><b>Proposed resolution:</b></p>
+<p>20.1.1 <a href="lib-utilities.html#lib.equalitycomparable"> [lib.equalitycomparable]</a> Change p1 from</p>
+
+<blockquote>
+In Table 28, T is a type to be supplied by a C++ program instantiating
+a template, a, b, and c are values of type T.
+</blockquote>
+
+<p>to</p>
+
+<blockquote>
+In Table 28, T is a type to be supplied by a C++ program instantiating
+a template, a, b, and c are values of type const T.
+</blockquote>
+
+<p>25.1.2 <a href="lib-algorithms.html#lib.alg.find"> [lib.alg.find]</a> Change p1 from</p>
+
+<blockquote>
+Requires: Type T is EqualityComparable (20.1.1).
+</blockquote>
+
+<p>to </p>
+
+<blockquote>
+Requires: There must be a equality operator defined that accepts type
+std::iterator_traits&lt;InputIterator&gt;::reference for the left operand
+and const T for the right operand.
+</blockquote>
+
+
+<p>25.1.3 <a href="lib-algorithms.html#lib.alg.find.end"> [lib.alg.find.end]</a> Add the following requires clause</p>
+
+<blockquote>
+Requires: There must be an equality operator defined that accepts
+type const std::iterator_traits&lt;ForwardIterator1&gt;::value_type for the
+left operand and const
+std::iterator_traits&lt;ForwardIterator2&gt;::value_type for the right
+operand.
+</blockquote>
+
+<p>25.1.4 <a href="lib-algorithms.html#lib.alg.find.first.of"> [lib.alg.find.first.of]</a> Add the following requires clause</p>
+
+<blockquote>
+Requires: There must be an equality operator defined that accepts
+type const std::iterator_traits&lt;ForwardIterator1&gt;::value_type for the
+left operand and const
+std::iterator_traits&lt;ForwardIterator2&gt;::value_type for the right
+operand.
+</blockquote>
+
+
+<p>25.1.5 <a href="lib-algorithms.html#lib.alg.adjacent.find"> [lib.alg.adjacent.find]</a> Add the following requires clause</p>
+
+<blockquote>
+Requires: T must be EqualityComparable (20.1.1).
+</blockquote>
+
+<p>25.1.6 <a href="lib-algorithms.html#lib.alg.count"> [lib.alg.count]</a> Change p1 from</p>
+
+<blockquote>
+Requires: Type T is EqualityComparable (20.1.1).
+</blockquote>
+
+<p>to</p>
+
+<blockquote>
+Requires: There must be a equality operator defined that accepts type
+std::iterator_traits&lt;InputIterator&gt;::reference for the left operand
+and const T for the right operand.
+</blockquote>
+
+<p>25.1.7 <a href="lib-algorithms.html#lib.mismatch"> [lib.mismatch]</a> Add the following requires clause</p>
+
+<blockquote>
+Requires: There must be an equality operator defined that accepts type
+std::iterator_traits&lt;InputIterator1&gt;::reference for the left operand
+and std::iterator_traits&lt;InputIterator2&gt;::reference for the right operand.
+</blockquote>
+
+
+<p>25.1.8 <a href="lib-algorithms.html#lib.alg.equal"> [lib.alg.equal]</a> Add the following requires clause</p>
+
+<blockquote>
+Requires: There must be an equality operator defined that accepts type
+std::iterator_traits&lt;InputIterator1&gt;::reference for the left operand
+and std::iterator_traits&lt;InputIterator2&gt;::reference for the right operand.
+</blockquote>
+
+<p>25.1.9 <a href="lib-algorithms.html#lib.alg.search"> [lib.alg.search]</a> Add the following requires clause</p>
+
+<blockquote>
+Requires: There must be an equality operator defined that accepts
+type const std::iterator_traits&lt;ForwardIterator1&gt;::value_type for
+the left operand and const
+std::iterator_traits&lt;ForwardIterator2&gt;::value_type for the right
+operand.
+</blockquote>
+
+<p>Change change p4 from</p>
+
+<blockquote>
+Requires: Type T is EqualityComparable (20.1.1), type Size is
+convertible to integral type (4.7.12.3).
+</blockquote>
+
+<p>to</p>
+
+<blockquote>
+Requires: There must be an equality operator defined that accepts
+const std::iterator_traits&lt;ForwardIterator&gt;::value_type for the left
+operand and const T for the right operand. The type Size is convertible to
+integral type (4.7.12.3).
+</blockquote>
+
+<p>25.2.4 <a href="lib-algorithms.html#lib.alg.replace"> [lib.alg.replace]</a> Change p1 from</p>
+
+<blockquote>
+Requires: Type T is Assignable (23.1 <a href="lib-containers.html#lib.container.requirements"> [lib.container.requirements]</a>) (and, for replace(),
+EqualityComparable (20.1.1 <a href="lib-utilities.html#lib.equalitycomparable"> [lib.equalitycomparable]</a>)).
+</blockquote>
+
+<p>to</p>
+
+<blockquote>
+Requires: Type std::iterator_traits&lt;ForwardIterator&gt;::value_type
+is Assignable (23.1 <a href="lib-containers.html#lib.container.requirements"> [lib.container.requirements]</a>) and the type const T is convertible to
+std::iterator_traits&lt;ForwardIterator&gt;::value_type. For replace(), an
+equality operator must be defined that accepts type
+std::iterator_traits&lt;ForwardIterator&gt;::reference for the left operand
+and const T for the right operand.
+</blockquote>
+
+<p>and change p4 from</p>
+
+<blockquote>
+Requires: Type T is Assignable (23.1 <a href="lib-containers.html#lib.container.requirements"> [lib.container.requirements]</a>) (and, for replace_copy(),
+EqualityComparable (20.1.1 <a href="lib-utilities.html#lib.equalitycomparable"> [lib.equalitycomparable]</a>)). The ranges [first, last) and [result,
+result + (last - first)) shall not overlap.
+</blockquote>
+
+<p>to</p>
+
+<blockquote>
+Requires: Both types const T and
+std::iterator_traits&lt;InputIterator&gt;::reference are writable to the
+OutputIterator type. For replace_copy() an equality operator must be
+defined that accepts type
+std::iterator_traits&lt;InputIterator&gt;::reference for the left operand
+and const T for the right operand. The ranges [first, last) and [result,
+result + (last - first)) shall not overlap.
+</blockquote>
+
+<p>25.2.5 <a href="lib-algorithms.html#lib.alg.fill"> [lib.alg.fill]</a> Change p1 from</p>
+
+<blockquote>
+Requires: Type T is Assignable (23.1 <a href="lib-containers.html#lib.container.requirements"> [lib.container.requirements]</a> ). Size is convertible to an integral
+ type (3.9.1 <a href="basic.html#basic.fundamental"> [basic.fundamental]</a> ).
+</blockquote>
+
+<p>to</p>
+
+<blockquote>
+Requires: Type const T is writable to the OutputIterator. Size is
+convertible to an integral type (3.9.1 <a href="basic.html#basic.fundamental"> [basic.fundamental]</a> ).
+</blockquote>
+
+
+<p>25.2.7 <a href="lib-algorithms.html#lib.alg.remove"> [lib.alg.remove]</a> Change p1 from</p>
+
+<blockquote>
+Requires: Type T is EqualityComparable (20.1.1 <a href="lib-utilities.html#lib.equalitycomparable"> [lib.equalitycomparable]</a>).
+</blockquote>
+
+<p>to</p>
+
+<blockquote>
+Requires: There must be an equality operator defined that accepts
+type const std::iterator_traits&lt;ForwardIterator&gt;::value_type for the left
+operand and const T for the right operand. The type
+std::iterator_traits&lt;ForwardIterator&gt;::value_type must be Assignable
+(23.1 <a href="lib-containers.html#lib.container.requirements"> [lib.container.requirements]</a>).
+</blockquote>
+
+<hr>
+<a name="284"><h3>284.&nbsp;unportable example in 20.3.7, p6</h3></a><p>
+<b>Section:</b>&nbsp;20.3.7 <a href="lib-utilities.html#lib.function.pointer.adaptors"> [lib.function.pointer.adaptors]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#Ready">Ready</a>&nbsp; <b>Submitter:</b>&nbsp;Martin Sebor&nbsp; <b>Date:</b>&nbsp;26 Dec 2000</p>
+<p>The example in 20.3.7 <a href="lib-utilities.html#lib.function.pointer.adaptors"> [lib.function.pointer.adaptors]</a>, p6 shows how to use the C
+library function <tt>strcmp()</tt> with the function pointer adapter
+<tt>ptr_fun()</tt>. But since it's unspecified whether the C library
+functions have <tt>extern &quot;C&quot;</tt> or <tt>extern
+&quot;C++&quot;</tt> linkage [17.4.2.2 <a href="lib-intro.html#lib.using.linkage"> [lib.using.linkage]</a>], and since
+function pointers with different the language linkage specifications
+(7.5 <a href="dcl.html#dcl.link"> [dcl.link]</a>) are incompatible, whether this example is
+well-formed is unspecified.
+</p>
+<p><b>Proposed resolution:</b></p>
+<p>Change 20.3.7 <a href="lib-utilities.html#lib.function.pointer.adaptors"> [lib.function.pointer.adaptors]</a> paragraph 6 from:</p>
+<blockquote>
+ <p>[<i>Example:</i>
+</p>
+ <pre>
+ replace_if(v.begin(), v.end(), not1(bind2nd(ptr_fun(strcmp), &quot;C&quot;)), &quot;C++&quot;);
+ </pre>
+ <p>replaces each <tt>C</tt> with <tt>C++</tt> in sequence <tt>v</tt>.</p>
+</blockquote>
+
+
+<p>to:</p>
+<blockquote>
+ <p>[<i>Example:</i>
+</p>
+ <pre>
+ int compare(const char*, const char*);
+ replace_if(v.begin(), v.end(),
+ not1(bind2nd(ptr_fun(compare), &quot;abc&quot;)), &quot;def&quot;);
+ </pre>
+ <p>replaces each <tt>abc</tt> with <tt>def</tt> in sequence <tt>v</tt>.</p>
+</blockquote>
+
+<p>Also, remove footnote 215 in that same paragraph.</p>
+
+<p><i>[Copenhagen: Minor change in the proposed resolution. Since this
+issue deals in part with C and C++ linkage, it was believed to be too
+confusing for the strings in the example to be &quot;C&quot; and &quot;C++&quot;.
+]</i></p>
+
+<p><i>[Redmond: More minor changes. Got rid of the footnote (which
+seems to make a sweeping normative requirement, even though footnotes
+aren't normative), and changed the sentence after the footnote so that
+it corresponds to the new code fragment.]</i></p>
+
+<hr>
+<a name="290"><h3>290.&nbsp;Requirements to for_each and its function object</h3></a><p>
+<b>Section:</b>&nbsp;25.1.1 <a href="lib-algorithms.html#lib.alg.foreach"> [lib.alg.foreach]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#Open">Open</a>&nbsp; <b>Submitter:</b>&nbsp;Angelika Langer&nbsp; <b>Date:</b>&nbsp;03 Jan 2001</p>
+<p>The specification of the for_each algorithm does not have a
+&quot;Requires&quot; section, which means that there are no
+restrictions imposed on the function object whatsoever. In essence it
+means that I can provide any function object with arbitrary side
+effects and I can still expect a predictable result. In particular I
+can expect that the function object is applied exactly last - first
+times, which is promised in the &quot;Complexity&quot; section.
+</p>
+
+<p>I don't see how any implementation can give such a guarantee
+without imposing requirements on the function object.
+</p>
+
+<p>Just as an example: consider a function object that removes
+elements from the input sequence. In that case, what does the
+complexity guarantee (applies f exactly last - first times) mean?
+</p>
+
+<p>One can argue that this is obviously a nonsensical application and
+a theoretical case, which unfortunately it isn't. I have seen
+programmers shooting themselves in the foot this way, and they did not
+understand that there are restrictions even if the description of the
+algorithm does not say so.
+</p>
+<p><b>Proposed resolution:</b></p>
+<p>Add a &quot;Requires&quot; section to section 25.1.1 similar to those
+proposed for transform and the numeric algorithms (see issue
+<a href="lwg-defects.html#242">242</a>):
+</p>
+
+<blockquote>
+ -2- <b>Requires</b>: In the range [first, last], f shall not invalidate
+ iterators or subranges.
+</blockquote>
+
+<p><i>[Copenhagen: The LWG agrees that a function object passed to an
+algorithm should not invalidate iterators in the range that the
+algorithm is operating on. The LWG believes that this should be a
+blanket statement in Clause 25, not just a special requirement for
+<tt>for_each</tt>.
+]</i></p>
+
+<hr>
+<a name="291"><h3>291.&nbsp;Underspecification of set algorithms</h3></a><p>
+<b>Section:</b>&nbsp;25.3.5 <a href="lib-algorithms.html#lib.alg.set.operations"> [lib.alg.set.operations]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#Open">Open</a>&nbsp; <b>Submitter:</b>&nbsp;Matt Austern&nbsp; <b>Date:</b>&nbsp;03 Jan 2001</p>
+<p>
+The standard library contains four algorithms that compute set
+operations on sorted ranges: <tt>set_union</tt>, <tt>set_intersection</tt>,
+<tt>set_difference</tt>, and <tt>set_symmetric_difference</tt>. Each
+of these algorithms takes two sorted ranges as inputs, and writes the
+output of the appropriate set operation to an output range. The elements
+in the output range are sorted.
+</p>
+
+<p>
+The ordinary mathematical definitions are generalized so that they
+apply to ranges containing multiple copies of a given element. Two
+elements are considered to be &quot;the same&quot; if, according to an
+ordering relation provided by the user, neither one is less than the
+other. So, for example, if one input range contains five copies of an
+element and another contains three, the output range of <tt>set_union</tt>
+will contain five copies, the output range of
+<tt>set_intersection</tt> will contain three, the output range of
+<tt>set_difference</tt> will contain two, and the output range of
+<tt>set_symmetric_difference</tt> will contain two.
+</p>
+
+<p>
+Because two elements can be &quot;the same&quot; for the purposes
+of these set algorithms, without being identical in other respects
+(consider, for example, strings under case-insensitive comparison),
+this raises a number of unanswered questions:
+</p>
+
+<ul>
+<li>If we're copying an element that's present in both of the
+input ranges, which one do we copy it from?</li>
+<li>If there are <i>n</i> copies of an element in the relevant
+input range, and the output range will contain fewer copies (say
+<i>m</i>) which ones do we choose? The first <i>m</i>, or the last
+<i>m</i>, or something else?</li>
+<li>Are these operations stable? That is, does a run of equivalent
+elements appear in the output range in the same order as as it
+appeared in the input range(s)?</li>
+</ul>
+
+<p>
+The standard should either answer these questions, or explicitly
+say that the answers are unspecified. I prefer the former option,
+since, as far as I know, all existing implementations behave the
+same way.
+</p>
+
+<p><b>Proposed resolution:</b></p>
+<p><i>[The LWG agrees that the standard should answer these questions.
+Matt will provide wording.]</i></p>
+<hr>
+<a name="294"><h3>294.&nbsp;User defined macros and standard headers</h3></a><p>
+<b>Section:</b>&nbsp;17.4.3.1.1 <a href="lib-intro.html#lib.macro.names"> [lib.macro.names]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#Open">Open</a>&nbsp; <b>Submitter:</b>&nbsp;James Kanze&nbsp; <b>Date:</b>&nbsp;11 Jan 2001</p>
+<p>Paragraph 2 of 17.4.3.1.1 <a href="lib-intro.html#lib.macro.names"> [lib.macro.names]</a> reads: &quot;A
+translation unit that includes a header shall not contain any macros
+that define names declared in that header.&quot; As I read this, it
+would mean that the following program is legal:</p>
+
+<pre>
+ #define npos 3.14
+ #include &lt;sstream&gt;
+</pre>
+
+<p>since npos is not defined in &lt;sstream&gt;. It is, however, defined
+in &lt;string&gt;, and it is hard to imagine an implementation in
+which &lt;sstream&gt; didn't include &lt;string&gt;.</p>
+
+<p>I think that this phrase was probably formulated before it was
+decided that a standard header may freely include other standard
+headers. The phrase would be perfectly appropriate for C, for
+example. In light of 17.4.4.1 <a href="lib-intro.html#lib.res.on.headers"> [lib.res.on.headers]</a> paragraph 1, however,
+it isn't stringent enough.</p>
+<p><b>Proposed resolution:</b></p>
+<p>In paragraph 2 of 17.4.3.1.1 <a href="lib-intro.html#lib.macro.names"> [lib.macro.names]</a>, change &quot;A
+translation unit that includes a header shall not contain any macros
+that define names declared in that header.&quot; to &quot;A
+translation unit that includes a header shall not contain any macros
+that define names declared in any standard header.&quot;</p>
+
+<p><i>[Copenhagen: the general idea is clearly correct, but there is
+concern about making sure that the two paragraphs in 17.4.3.1.1 <a href="lib-intro.html#lib.macro.names"> [lib.macro.names]</a> remain consistent. Nathan will provide new
+wording.]</i></p>
+
+<hr>
+<a name="299"><h3>299.&nbsp;Incorrect return types for iterator dereference</h3></a><p>
+<b>Section:</b>&nbsp;24.1.4 <a href="lib-iterators.html#lib.bidirectional.iterators"> [lib.bidirectional.iterators]</a>, 24.1.5 <a href="lib-iterators.html#lib.random.access.iterators"> [lib.random.access.iterators]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#Open">Open</a>&nbsp; <b>Submitter:</b>&nbsp;John Potter&nbsp; <b>Date:</b>&nbsp;22 Jan 2001</p>
+<p>
+In section 24.1.4 <a href="lib-iterators.html#lib.bidirectional.iterators"> [lib.bidirectional.iterators]</a>,
+Table 75 gives the return type of *r-- as convertible to T. This is
+not consistent with Table 74 which gives the return type of *r++ as
+T&amp;. *r++ = t is valid while *r-- = t is invalid.
+</p>
+
+<p>
+In section 24.1.5 <a href="lib-iterators.html#lib.random.access.iterators"> [lib.random.access.iterators]</a>,
+Table 76 gives the return type of a[n] as convertible to T. This is
+not consistent with the semantics of *(a + n) which returns T&amp; by
+Table 74. *(a + n) = t is valid while a[n] = t is invalid.
+</p>
+
+<p>
+Discussion from the Copenhagen meeting: the first part is
+uncontroversial. The second part, operator[] for Random Access
+Iterators, requires more thought. There are reasonable arguments on
+both sides. Return by value from operator[] enables some potentially
+useful iterators, e.g. a random access &quot;iota iterator&quot; (a.k.a
+&quot;counting iterator&quot; or &quot;int iterator&quot;). There isn't any obvious way
+to do this with return-by-reference, since the reference would be to a
+temporary. On the other hand, <tt>reverse_iterator</tt> takes an
+arbitrary Random Access Iterator as template argument, and its
+operator[] returns by reference. If we decided that the return type
+in Table 76 was correct, we would have to change
+<tt>reverse_iterator</tt>. This change would probably affect user
+code.
+</p>
+
+<p>
+History: the contradiction between <tt>reverse_iterator</tt> and the
+Random Access Iterator requirements has been present from an early
+stage. In both the STL proposal adopted by the committee
+(N0527==94-0140) and the STL technical report (HPL-95-11 (R.1), by
+Stepanov and Lee), the Random Access Iterator requirements say that
+operator[]'s return value is &quot;convertible to T&quot;. In N0527
+reverse_iterator's operator[] returns by value, but in HPL-95-11
+(R.1), and in the STL implementation that HP released to the public,
+reverse_iterator's operator[] returns by reference. In 1995, the
+standard was amended to reflect the contents of HPL-95-11 (R.1). The
+original intent for operator[] is unclear.
+</p>
+
+<p>
+In the long term it may be desirable to add more fine-grained
+iterator requirements, so that access method and traversal strategy
+can be decoupled. (See &quot;Improved Iterator Categories and
+Requirements&quot;, N1297 = 01-0011, by Jeremy Siek.) Any decisions
+about issue 299 should keep this possibility in mind.
+</p>
+
+<p><b>Proposed resolution:</b></p>
+<p>In section 24.1.4 <a href="lib-iterators.html#lib.bidirectional.iterators"> [lib.bidirectional.iterators]</a>, change the return type in table
+75 from &quot;convertible to T&quot; to T&amp;.</p>
+
+<p>In section 24.1.5 <a href="lib-iterators.html#lib.random.access.iterators"> [lib.random.access.iterators]</a>, change the return type in table
+76 from &quot;convertible to T&quot; to T&amp;.</p>
+
+<hr>
+<a name="300"><h3>300.&nbsp;list::merge() specification incomplete</h3></a><p>
+<b>Section:</b>&nbsp;23.2.2.4 <a href="lib-containers.html#lib.list.ops"> [lib.list.ops]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#Open">Open</a>&nbsp; <b>Submitter:</b>&nbsp;John Pedretti&nbsp; <b>Date:</b>&nbsp;23 Jan 2001</p>
+<p>
+The &quot;Effects&quot; clause for list::merge() (23.2.2.4, p23)
+appears to be incomplete: it doesn't cover the case where the argument
+list is identical to *this (i.e., this == &amp;x). The requirement in the
+note in p24 (below) is that x be empty after the merge which is surely
+unintended in this case.
+</p>
+<p><b>Proposed resolution:</b></p>
+<p>
+Change 23.2.2.4, p23 to:
+</p>
+<blockquote>
+<b>Effects</b>: If &amp;x == this, does nothing; otherwise, merges the
+argument list into the list.
+</blockquote>
+
+<p><i>[Copenhagen: The proposed resolution does not fix all of the
+problems in 23.2.2.4 <a href="lib-containers.html#lib.list.ops"> [lib.list.ops]</a>, p22-25. Three different
+paragraphs (23, 24, 25) describe the effects of <tt>merge</tt>.
+Changing p23, without changing the other two, appears to introduce
+contradictions. Additionally, &quot;merges the argument list into the
+list&quot; is excessively vague.]</i></p>
+
+<hr>
+<a name="304"><h3>304.&nbsp;Must <tt>*a</tt> return an lvalue when <tt>a</tt> is an input iterator?</h3></a><p>
+<b>Section:</b>&nbsp;24.1 <a href="lib-iterators.html#lib.iterator.requirements"> [lib.iterator.requirements]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#Open">Open</a>&nbsp; <b>Submitter:</b>&nbsp;Dave Abrahams&nbsp; <b>Date:</b>&nbsp;5 Feb 2001</p>
+<p>
+We all &quot;know&quot; that input iterators are allowed to produce
+values when dereferenced of which there is no other in-memory copy.
+</p>
+
+<p>
+But: Table 72, with a careful reading, seems to imply that this can only be
+the case if the value_type has no members (e.g. is a built-in type).
+</p>
+
+<p>The problem occurs in the following entry:</p>
+
+<pre>
+ a-&gt;m pre: (*a).m is well-defined
+ Equivalent to (*a).m
+</pre>
+
+<p>
+<tt>*a.m</tt> can be well-defined if <tt>*a</tt> is not a reference
+type, but since <tt>operator-&gt;()</tt> must return a pointer for
+<tt>a-&gt;m</tt> to be well-formed, it needs something to return a
+pointer <i>to</i>. This seems to indicate that <tt>*a</tt> must be
+buffered somewhere to make a legal input iterator.
+</p>
+
+<p>I don't think this was intentional.</p>
+<p><b>Proposed resolution:</b></p>
+<p><i>[Copenhagen: the two obvious possibilities are to keep the
+<tt>operator-&gt;</tt> requirement for Input Iterators, and put
+in a non-normative note describing how it can be implemented with
+proxies, or else moving the <tt>operator-&gt;</tt> requirement
+from Input Iterator to Forward Iterator. If we do the former
+we'll also have to change <tt>istreambuf_iterator</tt>, because
+it has no <tt>operator-&gt;</tt>. A straw poll showed roughly equal
+support for the two options.]</i></p>
+<hr>
+<a name="305"><h3>305.&nbsp;Default behavior of codecvt&lt;wchar_t, char, mbstate_t&gt;::length()</h3></a><p>
+<b>Section:</b>&nbsp;22.2.1.5.2 <a href="lib-locales.html#lib.locale.codecvt.virtuals"> [lib.locale.codecvt.virtuals]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#Review">Review</a>&nbsp; <b>Submitter:</b>&nbsp;Howard Hinnant&nbsp; <b>Date:</b>&nbsp;24 Jan 2001</p>
+<p>22.2.1.5/3 introduces codecvt in part with:</p>
+
+<blockquote>
+ codecvt&lt;wchar_t,char,mbstate_t&gt; converts between the native
+ character sets for tiny and wide characters. Instantiations on
+ mbstate_t perform conversion between encodings known to the library
+ implementor.
+</blockquote>
+
+<p>But 22.2.1.5.2/10 describes do_length in part with:</p>
+
+<blockquote>
+ ... codecvt&lt;wchar_t, char, mbstate_t&gt; ... return(s) the lesser of max and
+ (from_end-from).
+</blockquote>
+
+<p>
+The semantics of do_in and do_length are linked. What one does must
+be consistent with what the other does. 22.2.1.5/3 leads me to
+believe that the vendor is allowed to choose the algorithm that
+codecvt&lt;wchar_t,char,mbstate_t&gt;::do_in performs so that it makes
+his customers happy on a given platform. But 22.2.1.5.2/10 explicitly
+says what codecvt&lt;wchar_t,char,mbstate_t&gt;::do_length must
+return. And thus indirectly specifies the algorithm that
+codecvt&lt;wchar_t,char,mbstate_t&gt;::do_in must perform. I believe
+that this is not what was intended and is a defect.
+</p>
+
+<p>Discussion from the -lib reflector:
+
+<br>This proposal would have the effect of making the semantics of
+all of the virtual functions in <tt>codecvt&lt;wchar_t, char,
+mbstate_t&gt;</tt> implementation specified. Is that what we want, or
+do we want to mandate specific behavior for the base class virtuals
+and leave the implementation specified behavior for the codecvt_byname
+derived class? The tradeoff is that former allows implementors to
+write a base class that actually does something useful, while the
+latter gives users a way to get known and specified---albeit
+useless---behavior, and is consistent with the way the standard
+handles other facets. It is not clear what the original intention
+was.</p>
+
+<p>
+Nathan has suggest a compromise: a character that is a widened version
+of the characters in the basic execution character set must be
+converted to a one-byte sequence, but there is no such requirement
+for characters that are not part of the basic execution character set.
+</p>
+<p><b>Proposed resolution:</b></p>
+<p>
+Change 22.2.1.5.2/5 from:
+</p>
+<p>
+The instantiations required in Table 51 (lib.locale.category), namely
+codecvt&lt;wchar_t,char,mbstate_t&gt; and
+codecvt&lt;char,char,mbstate_t&gt;, store no characters. Stores no more
+than (to_limit-to) destination elements. It always leaves the to_next
+pointer pointing one beyond the last element successfully stored.
+</p>
+<p>
+to:
+</p>
+<p>
+Stores no more than (to_limit-to) destination elements, and leaves the
+to_next pointer pointing one beyond the last element successfully
+stored. codecvt&lt;char,char,mbstate_t&gt; stores no characters.
+</p>
+
+<p>Change 22.2.1.5.2/10 from:</p>
+
+<blockquote>
+-10- Returns: (from_next-from) where from_next is the largest value in
+the range [from,from_end] such that the sequence of values in the
+range [from,from_next) represents max or fewer valid complete
+characters of type internT. The instantiations required in Table 51
+(21.1.1.1.1), namely codecvt&lt;wchar_t, char, mbstate_t&gt; and
+codecvt&lt;char, char, mbstate_t&gt;, return the lesser of max and
+(from_end-from).
+</blockquote>
+
+<p>to:</p>
+
+<blockquote>
+-10- Returns: (from_next-from) where from_next is the largest value in
+the range [from,from_end] such that the sequence of values in the range
+[from,from_next) represents max or fewer valid complete characters of
+type internT. The instantiation codecvt&lt;char, char, mbstate_t&gt; returns
+the lesser of max and (from_end-from).
+</blockquote>
+
+<p><i>[Redmond: Nathan suggested an alternative resolution: same as
+above, but require that, in the default encoding, a character from the
+basic execution character set would map to a single external
+character. The straw poll was 8-1 in favor of the proposed
+resolution.]</i></p>
+
+<p><b>Rationale:</b></p>
+<p>The default encoding should be whatever users of a given platform
+would expect to be the most natural. This varies from platform to
+platform. In many cases there is a preexisting C library, and users
+would expect the default encoding to be whatever C uses in the default
+&quot;C&quot; locale. We could impose a guarantee like the one Nathan suggested
+(a character from the basic execution character set must map to a
+single external character), but this would rule out important
+encodings that are in common use: it would rule out Shift-JIS, for
+example, and it would rule out a fixed-width encoding of UCS-4.</p>
+<hr>
+<a name="309"><h3>309.&nbsp;Does sentry catch exceptions?</h3></a><p>
+<b>Section:</b>&nbsp;27.6 <a href="lib-iostreams.html#lib.iostream.format"> [lib.iostream.format]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#Open">Open</a>&nbsp; <b>Submitter:</b>&nbsp;Martin Sebor&nbsp; <b>Date:</b>&nbsp;19 Mar 2001</p>
+<p>
+The descriptions of the constructors of basic_istream&lt;&gt;::sentry
+(27.6.1.1.2 <a href="lib-iostreams.html#lib.istream::sentry"> [lib.istream::sentry]</a>) and basic_ostream&lt;&gt;::sentry
+(27.6.2.3 <a href="lib-iostreams.html#lib.ostream::sentry"> [lib.ostream::sentry]</a>) do not explain what the functions do in
+case an exception is thrown while they execute. Some current
+implementations allow all exceptions to propagate, others catch them
+and set ios_base::badbit instead, still others catch some but let
+others propagate.
+</p>
+
+<p>
+The text also mentions that the functions may call setstate(failbit)
+(without actually saying on what object, but presumably the stream
+argument is meant). That may have been fine for
+basic_istream&lt;&gt;::sentry prior to issue <a href="lwg-defects.html#195">195</a>, since
+the function performs an input operation which may fail. However,
+issue <a href="lwg-defects.html#195">195</a> amends 27.6.1.1.2 <a href="lib-iostreams.html#lib.istream::sentry"> [lib.istream::sentry]</a>, p2 to
+clarify that the function should actually call setstate(failbit |
+eofbit), so the sentence in p3 is redundant or even somewhat
+contradictory.
+</p>
+
+<p>
+The same sentence that appears in 27.6.2.3 <a href="lib-iostreams.html#lib.ostream::sentry"> [lib.ostream::sentry]</a>, p3
+doesn't seem to be very meaningful for basic_istream&lt;&gt;::sentry
+which performs no input. It is actually rather misleading since it
+would appear to guide library implementers to calling
+setstate(failbit) when os.tie()-&gt;flush(), the only called function,
+throws an exception (typically, it's badbit that's set in response to
+such an event).
+</p>
+<p><b>Proposed resolution:</b></p>
+<p>Add the following paragraph immediately after
+27.6.1.1.2 <a href="lib-iostreams.html#lib.istream::sentry"> [lib.istream::sentry]</a>, p5</p>
+
+<blockquote>
+ <p>
+ If an exception is thrown during the preparation then ios::badbit
+ is turned on* in is's error state.
+ </p>
+
+ <p>
+ [Footnote: This is done without causing an ios::failure to be thrown.
+ --- end footnote]
+ </p>
+
+ <p>
+ If (is.exceptions() &amp; ios_base::badbit)!= 0 then the exception is
+ rethrown.
+ </p>
+</blockquote>
+
+<p>And strike the following sentence from 27.6.1.1.2 <a href="lib-iostreams.html#lib.istream::sentry"> [lib.istream::sentry]</a>, p5</p>
+
+<blockquote>
+ During preparation, the constructor may call setstate(failbit)
+ (which may throw ios_base::failure (lib.iostate.flags))
+</blockquote>
+
+<p>Add the following paragraph immediately after
+27.6.2.3 <a href="lib-iostreams.html#lib.ostream::sentry"> [lib.ostream::sentry]</a>, p3</p>
+
+<blockquote>
+ <p>
+ If an exception is thrown during the preparation then ios::badbit
+ is turned on* in os's error state.
+ </p>
+
+ <p>
+ [Footnote: This is done without causing an ios::failure to be
+ thrown. --- end footnote]
+ </p>
+
+ <p>
+ If (os.exceptions() &amp; ios_base::badbit)!= 0 then the exception
+ is rethrown.
+ </p>
+</blockquote>
+
+<p>And strike the following sentence from 27.6.2.3 <a href="lib-iostreams.html#lib.ostream::sentry"> [lib.ostream::sentry]</a>, p3</p>
+
+<blockquote>
+ During preparation, the constructor may call setstate(failbit)
+ (which may throw ios_base::failure (lib.iostate.flags))
+</blockquote>
+
+<p>(Note that the removal of the two sentences means that the ctors
+will not be able to report the failure of any implementation-dependent
+operations referred to in footnotes 280 and 293, unless such
+operations throw an exception.)</p>
+
+<p><i>[
+Copenhagen: It was agreed that there was an issue here, but there was
+disagreement about the resolution. Some LWG members argued that a
+sentry's constructor should not catch exceptions, because sentries
+should only be used within (un)formatted input functions and that
+exception handling is the responsibility of those functions, not of
+the sentries.
+]</i></p>
+
+<hr>
+<a name="310"><h3>310.&nbsp;Is errno a macro?</h3></a><p>
+<b>Section:</b>&nbsp;17.4.1.2 <a href="lib-intro.html#lib.headers"> [lib.headers]</a>, 19.3 <a href="lib-diagnostics.html#lib.errno"> [lib.errno]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#Ready">Ready</a>&nbsp; <b>Submitter:</b>&nbsp;Steve Clamage&nbsp; <b>Date:</b>&nbsp;21 Mar 2001</p>
+ <p>
+ Exactly how should errno be declared in a conforming C++ header?
+ </p>
+
+ <p>
+ The C standard says in 7.1.4 that it is unspecified whether errno is a
+ macro or an identifier with external linkage. In some implementations
+ it can be either, depending on compile-time options. (E.g., on
+ Solaris in multi-threading mode, errno is a macro that expands to a
+ function call, but is an extern int otherwise. &quot;Unspecified&quot; allows
+ such variability.)
+ </p>
+
+ <p>The C++ standard:</p>
+ <ul>
+ <li>17.4.1.2 says in a note that errno must be macro in C. (false)</li>
+ <li>17.4.3.1.3 footnote 166 says errno is reserved as an external
+ name (true), and implies that it is an identifier.</li>
+ <li>19.3 simply lists errno as a macro (by what reasoning?) and goes
+ on to say that the contents of of C++ &lt;errno.h&gt; are the
+ same as in C, begging the question.</li>
+ <li>C.2, table 95 lists errno as a macro, without comment.</li>
+ </ul>
+
+ <p>I find no other references to errno.</p>
+
+ <p>We should either explicitly say that errno must be a macro, even
+ though it need not be a macro in C, or else explicitly leave it
+ unspecified. We also need to say something about namespace std.
+ A user who includes &lt;cerrno&gt; needs to know whether to write
+ <tt>errno</tt>, or <tt>::errno</tt>, or <tt>std::errno</tt>, or
+ else &lt;cerrno&gt; is useless.</p>
+
+ <p>Two acceptable fixes:</p>
+ <ul>
+ <li><p>errno must be a macro. This is trivially satisfied by adding<br>
+ &nbsp;&nbsp;#define errno (::std::errno)<br>
+ to the headers if errno is not already a macro. You then always
+ write errno without any scope qualification, and it always expands
+ to a correct reference. Since it is always a macro, you know to
+ avoid using errno as a local identifer.</p></li>
+ <li><p>errno is in the global namespace. This fix is inferior, because
+ ::errno is not guaranteed to be well-formed.</p></li>
+ </ul>
+
+ <p><i>[
+ This issue was first raised in 1999, but it slipped through
+ the cracks.
+ ]</i></p>
+<p><b>Proposed resolution:</b></p>
+ <p>Change the Note in section 17.4.1.2p5 from</p>
+
+ <blockquote>
+ Note: the names defined as macros in C include the following:
+ assert, errno, offsetof, setjmp, va_arg, va_end, and va_start.
+ </blockquote>
+
+ <p>to</p>
+
+ <blockquote>
+ Note: the names defined as macros in C include the following:
+ assert, offsetof, setjmp, va_arg, va_end, and va_start.
+ </blockquote>
+
+ <p>In section 19.3, change paragraph 2 from</p>
+
+ <blockquote>
+ The contents are the same as the Standard C library header
+ &lt;errno.h&gt;.
+ </blockquote>
+
+ <p>to</p>
+
+ <blockquote>
+ The contents are the same as the Standard C library header
+ &lt;errno.h&gt;, except that errno shall be defined as a macro.
+ </blockquote>
+<p><b>Rationale:</b></p>
+<p>C++ must not leave it up to the implementation to decide whether
+or not a name is a macro; it must explicitly specify exactly which
+names are required to be macros.</p>
+<hr>
+<a name="311"><h3>311.&nbsp;Incorrect wording in basic_ostream class synopsis</h3></a><p>
+<b>Section:</b>&nbsp;27.6.2.1 <a href="lib-iostreams.html#lib.ostream"> [lib.ostream]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#Ready">Ready</a>&nbsp; <b>Submitter:</b>&nbsp;Andy Sawyer&nbsp; <b>Date:</b>&nbsp;21 Mar 2001</p>
+
+<p>In 27.6.2.1 <a href="lib-iostreams.html#lib.ostream"> [lib.ostream]</a>, the synopsis of class basic_ostream says:</p>
+
+<pre>
+ // partial specializationss
+ template&lt;class traits&gt;
+ basic_ostream&lt;char,traits&gt;&amp; operator&lt;&lt;( basic_ostream&lt;char,traits&gt;&amp;,
+ const char * );
+</pre>
+
+<p>Problems:</p>
+<ul>
+<li>Too many 's's at the end of &quot;specializationss&quot; </li>
+<li>This is an overload, not a partial specialization</li>
+</ul>
+
+<p><b>Proposed resolution:</b></p>
+<p>In the synopsis in 27.6.2.1 <a href="lib-iostreams.html#lib.ostream"> [lib.ostream]</a>, remove the
+<i>// partial specializationss</i> comment. Also remove the same
+comment (correctly spelled, but still incorrect) from the synopsis in
+27.6.2.5.4 <a href="lib-iostreams.html#lib.ostream.inserters.character"> [lib.ostream.inserters.character]</a>.
+</p>
+
+<p><i>[
+Pre-Redmond: added 27.6.2.5.4 <a href="lib-iostreams.html#lib.ostream.inserters.character"> [lib.ostream.inserters.character]</a> because of Martin's
+comment in c++std-lib-8939.
+]</i></p>
+
+<hr>
+<a name="315"><h3>315.&nbsp;Bad &quot;range&quot; in list::unique complexity</h3></a><p>
+<b>Section:</b>&nbsp;23.2.2.4 <a href="lib-containers.html#lib.list.ops"> [lib.list.ops]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#Ready">Ready</a>&nbsp; <b>Submitter:</b>&nbsp;Andy Sawyer&nbsp; <b>Date:</b>&nbsp;1 May 2001</p>
+<p>
+23.2.2.4 <a href="lib-containers.html#lib.list.ops"> [lib.list.ops]</a>, Para 21 describes the complexity of
+list::unique as: &quot;If the range (last - first) is not empty, exactly
+(last - first) -1 applications of the corresponding predicate,
+otherwise no applications of the predicate)&quot;.
+</p>
+
+<p>
+&quot;(last - first)&quot; is not a range.
+</p>
+<p><b>Proposed resolution:</b></p>
+<p>
+Change the &quot;range&quot; from (last - first) to [first, last).
+</p>
+<hr>
+<a name="316"><h3>316.&nbsp;Vague text in Table 69</h3></a><p>
+<b>Section:</b>&nbsp;23.1.2 <a href="lib-containers.html#lib.associative.reqmts"> [lib.associative.reqmts]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#Ready">Ready</a>&nbsp; <b>Submitter:</b>&nbsp;Martin Sebor&nbsp; <b>Date:</b>&nbsp;4 May 2001</p>
+<p>Table 69 says this about a_uniq.insert(t):</p>
+
+<blockquote>
+inserts t if and only if there is no element in the container with key
+equivalent to the key of t. The bool component of the returned pair
+indicates whether the insertion takes place and the iterator component of the
+pair points to the element with key equivalent to the key of t.
+</blockquote>
+
+<p>The description should be more specific about exactly how the bool component
+indicates whether the insertion takes place.</p>
+<p><b>Proposed resolution:</b></p>
+<p>Change the text in question to</p>
+
+<blockquote>
+...The bool component of the returned pair is true if and only if the insertion
+takes place...
+</blockquote>
+<hr>
+<a name="317"><h3>317.&nbsp;Instantiation vs. specialization of facets</h3></a><p>
+<b>Section:</b>&nbsp;22 <a href="lib-locales.html#lib.localization"> [lib.localization]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#Ready">Ready</a>&nbsp; <b>Submitter:</b>&nbsp;Martin Sebor&nbsp; <b>Date:</b>&nbsp;4 May 2001</p>
+<p>
+The localization section of the standard refers to specializations of
+the facet templates as instantiations even though the required facets
+are typically specialized rather than explicitly (or implicitly)
+instantiated. In the case of ctype&lt;char&gt; and
+ctype_byname&lt;char&gt; (and the wchar_t versions), these facets are
+actually required to be specialized. The terminology should be
+corrected to make it clear that the standard doesn't mandate explicit
+instantiation (the term specialization encompasses both explicit
+instantiations and specializations).
+</p>
+<p><b>Proposed resolution:</b></p>
+<p>
+In the following paragraphs, replace all occurrences of the word
+instantiation or instantiations with specialization or specializations,
+respectively:
+</p>
+
+<blockquote>
+22.1.1.1.1, p4, Table 52, 22.2.1.1, p2, 22.2.1.5, p3, 22.2.1.5.1, p5,
+22.2.1.5.2, p10, 22.2.2, p2, 22.2.3.1, p1, 22.2.3.1.2, p1, p2 and p3,
+22.2.4.1, p1, 22.2.4.1.2, p1, 22,2,5, p1, 22,2,6, p2, 22.2.6.3.2, p7, and
+Footnote 242.
+</blockquote>
+
+<p>And change the text in 22.1.1.1.1, p4 from</p>
+
+<blockquote>
+ An implementation is required to provide those instantiations
+ for facet templates identified as members of a category, and
+ for those shown in Table 52:
+</blockquote>
+
+<p>to</p>
+
+<blockquote>
+ An implementation is required to provide those specializations...
+</blockquote>
+
+<p><i>[Nathan will review these changes, and will look for places where
+explicit specialization is necessary.]</i></p>
+
+<p><b>Rationale:</b></p>
+<p>This is a simple matter of outdated language. The language to
+describe templates was clarified during the standardization process,
+but the wording in clause 22 was never updated to reflect that
+change.</p>
+<hr>
+<a name="318"><h3>318.&nbsp;Misleading comment in definition of numpunct_byname</h3></a><p>
+<b>Section:</b>&nbsp;22.2.3.2 <a href="lib-locales.html#lib.locale.numpunct.byname"> [lib.locale.numpunct.byname]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#Ready">Ready</a>&nbsp; <b>Submitter:</b>&nbsp;Martin Sebor&nbsp; <b>Date:</b>&nbsp;12 May 2001</p>
+<p>The definition of the numpunct_byname template contains the following
+comment:</p>
+
+<pre>
+ namespace std {
+ template &lt;class charT&gt;
+ class numpunct_byname : public numpunct&lt;charT&gt; {
+ // this class is specialized for char and wchar_t.
+ ...
+</pre>
+
+<p>There is no documentation of the specializations and it seems
+conceivable that an implementation will not explicitly specialize the
+template at all, but simply provide the primary template.</p>
+<p><b>Proposed resolution:</b></p>
+<p>Remove the comment from the text in 22.2.3.2 and from the proposed
+resolution of library issue <a href="lwg-defects.html#228">228</a>.</p>
+<hr>
+<a name="319"><h3>319.&nbsp;Storage allocation wording confuses &quot;Required behavior&quot;, &quot;Requires&quot;</h3></a><p>
+<b>Section:</b>&nbsp;18.4.1.1 <a href="lib-support.html#lib.new.delete.single"> [lib.new.delete.single]</a>, 18.4.1.2 <a href="lib-support.html#lib.new.delete.array"> [lib.new.delete.array]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#Ready">Ready</a>&nbsp; <b>Submitter:</b>&nbsp;Beman Dawes&nbsp; <b>Date:</b>&nbsp;15 May 2001</p>
+<p>The standard specifies 17.3.1.3 <a href="lib-intro.html#lib.structure.specifications"> [lib.structure.specifications]</a> that &quot;Required
+behavior&quot; elements describe &quot;the semantics of a function definition
+provided by either the implementation or a C++ program.&quot;</p>
+
+<p>The standard specifies 17.3.1.3 <a href="lib-intro.html#lib.structure.specifications"> [lib.structure.specifications]</a> that &quot;Requires&quot;
+elements describe &quot;the preconditions for calling the function.&quot;</p>
+
+<p>In the sections noted below, the current wording specifies
+&quot;Required Behavior&quot; for what are actually preconditions, and thus
+should be specified as &quot;Requires&quot;.</p>
+
+<p><b>Proposed resolution:</b></p>
+
+<p>In 18.4.1.1 <a href="lib-support.html#lib.new.delete.single"> [lib.new.delete.single]</a> Para 12 Change:</p>
+<blockquote>
+ <p>Required behavior: accept a value of ptr that is null or that was
+ returned by an earlier call ...</p>
+</blockquote>
+<p>to:</p>
+<blockquote>
+ <p>Requires: the value of ptr is null or the value returned by an
+ earlier call ...</p>
+</blockquote>
+
+<p>In 18.4.1.2 <a href="lib-support.html#lib.new.delete.array"> [lib.new.delete.array]</a> Para 11 Change:</p>
+<blockquote>
+ <p>Required behavior: accept a value of ptr that is null or that was
+ returned by an earlier call ...</p>
+</blockquote>
+<p>to:</p>
+<blockquote>
+ <p>Requires: the value of ptr is null or the value returned by an
+ earlier call ...</p>
+</blockquote>
+
+<hr>
+<a name="320"><h3>320.&nbsp;list::assign overspecified</h3></a><p>
+<b>Section:</b>&nbsp;23.2.2.1 <a href="lib-containers.html#lib.list.cons"> [lib.list.cons]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#Review">Review</a>&nbsp; <b>Submitter:</b>&nbsp;Howard Hinnant&nbsp; <b>Date:</b>&nbsp;17 May 2001</p>
+<p>
+Section 23.2.2.1, paragraphs 6-8 specify that list assign (both forms) have
+the &quot;effects&quot; of a call to erase followed by a call to insert.
+</p>
+
+<p>
+I would like to document that implementers have the freedom to implement
+assign by other methods, as long as the end result is the same and the
+exception guarantee is as good or better than the basic guarantee.
+</p>
+
+<p>
+The motivation for this is to use T's assignment operator to recycle
+existing nodes in the list instead of erasing them and reallocating
+them with new values. It is also worth noting that, with careful
+coding, most common cases of assign (everything but assignment with
+true input iterators) can elevate the exception safety to strong if
+T's assignment has a nothrow guarantee (with no extra memory cost).
+Metrowerks does this. However I do not propose that this subtlety be
+standardized. It is a QoI issue. </p>
+
+<p>Existing practise:
+Metrowerks and SGI recycle nodes, Dinkumware and Rogue Wave don't.
+</p>
+<p><b>Proposed resolution:</b></p>
+<p>Change 23.2.2.1/7 from:</p>
+
+<blockquote>
+<p>Effects:</p>
+
+<pre>
+ erase(begin(), end());
+ insert(begin(), first, last);
+</pre>
+</blockquote>
+
+<p>to:</p>
+
+<blockquote>
+<p>Effects: Replaces the contents of the list with the range [first, last).</p>
+</blockquote>
+
+<p>In 23.1.1 <a href="lib-containers.html#lib.sequence.reqmts"> [lib.sequence.reqmts]</a>, in Table 67 (sequence requirements),
+add a new row:</p>
+<pre>
+ a.assign(i,j) void pre: i,j are not iterators into a.
+ Replaces elements in a with copies
+ of elements in [i, j).
+</pre>
+
+<p>Change 23.2.2.1/8 from:</p>
+
+<blockquote>
+<p>Effects:</p>
+<pre>
+ erase(begin(), end());
+ insert(begin(), n, t);
+</pre>
+</blockquote>
+<p>to:</p>
+
+<blockquote>
+<p>Effects: Replaces the contents of the list with n copies of t.</p>
+</blockquote>
+
+<p><i>[Redmond: Proposed resolution was changed slightly. Previous
+version made explicit statement about exception safety, which wasn't
+consistent with the way exception safety is expressed elsewhere.
+Also, the change in the sequence requirements is new. Without that
+change, the proposed resolution would have required that assignment of
+a subrange would have to work. That too would have been
+overspecification; it would effectively mandate that assignment use a
+temporary.
+]</i></p>
+
+<hr>
+<a name="321"><h3>321.&nbsp;Typo in num_get</h3></a><p>
+<b>Section:</b>&nbsp;22.2.2.1.2 <a href="lib-locales.html#lib.facet.num.get.virtuals"> [lib.facet.num.get.virtuals]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#Ready">Ready</a>&nbsp; <b>Submitter:</b>&nbsp;Kevin Djang&nbsp; <b>Date:</b>&nbsp;17 May 2001</p>
+<p>
+Section 22.2.2.1.2 at p7 states that &quot;A length specifier is added to
+the conversion function, if needed, as indicated in Table 56.&quot;
+However, Table 56 uses the term &quot;length modifier&quot;, not &quot;length
+specifier&quot;.
+</p>
+<p><b>Proposed resolution:</b></p>
+<p>
+In 22.2.2.1.2 at p7, change the text &quot;A length specifier is added ...&quot;
+to be &quot;A length modifier is added ...&quot;
+</p>
+<p><b>Rationale:</b></p>
+<p>C uses the term &quot;length modifier&quot;. We should be consistent.</p>
+<hr>
+<a name="322"><h3>322.&nbsp;iterator and const_iterator should have the same value type</h3></a><p>
+<b>Section:</b>&nbsp;23.1 <a href="lib-containers.html#lib.container.requirements"> [lib.container.requirements]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#Ready">Ready</a>&nbsp; <b>Submitter:</b>&nbsp;Matt Austern&nbsp; <b>Date:</b>&nbsp;17 May 2001</p>
+<p>
+It's widely assumed that, if X is a container,
+iterator_traits&lt;X::iterator&gt;::value_type and
+iterator_traits&lt;X::const_iterator&gt;::value_type should both be
+X::value_type. However, this is nowhere stated. The language in
+Table 65 is not precise about the iterators' value types (it predates
+iterator_traits), and could even be interpreted as saying that
+iterator_traits&lt;X::const_iterator&gt;::value_type should be &quot;const
+X::value_type&quot;.
+</p>
+
+<p>Related issue: <a href="lwg-closed.html#279">279</a>.</p>
+<p><b>Proposed resolution:</b></p>
+<p>In Table 65 (&quot;Container Requirements&quot;), change the return type for
+X::iterator to &quot;iterator type whose value type is T&quot;. Change the
+return type for X::const_iterator to &quot;constant iterator type whose
+value type is T&quot;.</p>
+<p><b>Rationale:</b></p>
+<p>
+This belongs as a container requirement, rather than an iterator
+requirement, because the whole notion of iterator/const_iterator
+pairs is specific to containers' iterator.
+</p>
+<p>
+It is existing practice that (for example)
+iterator_traits&lt;list&lt;int&gt;::const_iterator&gt;::value_type
+is &quot;int&quot;, rather than &quot;const int&quot;. This is consistent with
+the way that const pointers are handled: the standard already
+requires that iterator_traits&lt;const int*&gt;::value_type is int.
+</p>
+<hr>
+<a name="323"><h3>323.&nbsp;abs() overloads in different headers</h3></a><p>
+<b>Section:</b>&nbsp;26.5 <a href="lib-numerics.html#lib.c.math"> [lib.c.math]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#Open">Open</a>&nbsp; <b>Submitter:</b>&nbsp;Dave Abrahams&nbsp; <b>Date:</b>&nbsp;4 June 2001</p>
+<p>Currently the standard mandates the following overloads of
+abs():</p>
+
+<pre>
+ abs(long), abs(int) in &lt;cstdlib&gt;
+
+ abs(float), abs(double), abs(long double) in &lt;cmath&gt;
+
+ template&lt;class T&gt; T abs(const complex&lt;T&gt;&amp;) in &lt;complex&gt;
+
+ template&lt;class T&gt; valarray&lt;T&gt; abs(const valarray&lt;T&gt;&amp;); in &lt;valarray&gt;
+</pre>
+
+<p>
+The problem is that having only some overloads visible of a function
+that works on &quot;implicitly inter-convertible&quot; types is dangerous in
+practice. The headers that get included at any point in a translation
+unit can change unpredictably during program
+development/maintenance. The wrong overload might be unintentionally
+selected.
+</p>
+
+<p>
+Currently, there is nothing that mandates the simultaneous visibility
+of these overloads. Indeed, some vendors have begun fastidiously
+reducing dependencies among their (public) headers as a QOI issue: it
+helps people to write portable code by refusing to compile unless all
+the correct headers are #included.
+</p>
+
+<p>The same issue may exist for other functions in the library.</p>
+
+<p>Redmond: PJP reports that C99 adds two new kinds of abs: comples,
+and int_max_abs.</p>
+
+<p>Related issue: <a href="lwg-closed.html#343">343</a>.</p>
+
+<p><b>Proposed resolution:</b></p>
+
+<p><i>[Redmond: General agreement that the current situation is
+somewhat fragile. No consensus on whether it's more fragile than any
+number of other things, or whether there's any good way to fix it.
+Walter suggests that <tt>abs</tt> should be defined for all built-in
+types in both &lt;cmath&gt; and &lt;cstdlib&gt;, but that no effort
+should be made to put all overloads for class types in one place.
+Beman suggests closing this issue as &quot;NAD Future&quot;, and adding a
+&lt;all&gt; header as an extension. The &lt;all&gt; header would
+solve a more general problem: users who can't remember which names are
+defined in which headers. (See issue <a href="lwg-closed.html#343">343</a>)]</i></p>
+
+<hr>
+<a name="324"><h3>324.&nbsp;Do output iterators have value types?</h3></a><p>
+<b>Section:</b>&nbsp;24.1.2 <a href="lib-iterators.html#lib.output.iterators"> [lib.output.iterators]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#Review">Review</a>&nbsp; <b>Submitter:</b>&nbsp;Dave Abrahams&nbsp; <b>Date:</b>&nbsp;7 June 2001</p>
+
+<p>Table 73 suggests that output iterators have value types. It
+requires the expression &quot;*a = t&quot;. Additionally, although Table 73
+never lists &quot;a = t&quot; or &quot;X(a) = t&quot; in the &quot;expressions&quot; column, it
+contains a note saying that &quot;a = t&quot; and &quot;X(a) = t&quot; have equivalent
+(but nowhere specified!) semantics.</p>
+
+<p>According to 24.1/9, t is supposed to be &quot;a value of value type
+T&quot;:</p>
+
+ <blockquote>
+ In the following sections, a and b denote values of X, n denotes a
+ value of the difference type Distance, u, tmp, and m denote
+ identifiers, r denotes a value of X&amp;, t denotes a value of
+ value type T.
+ </blockquote>
+
+<p>Two other parts of the standard that are relevant to whether
+output iterators have value types:</p>
+
+<ul>
+ <li>24.1/1 says &quot;All iterators i support the expression *i,
+ resulting in a value of some class, enumeration, or built-in type
+ T, called the value type of the iterator&quot;.</li>
+
+ <li>
+ 24.3.1/1, which says &quot;In the case of an output iterator, the types
+ iterator_traits&lt;Iterator&gt;::difference_type
+ iterator_traits&lt;Iterator&gt;::value_type are both defined as void.&quot;
+ </li>
+</ul>
+
+<p>The first of these passages suggests that &quot;*i&quot; is supposed to
+return a useful value, which contradicts the note in 24.1.2/2 saying
+that the only valid use of &quot;*i&quot; for output iterators is in an
+expression of the form &quot;*i = t&quot;. The second of these passages appears
+to contradict Table 73, because it suggests that &quot;*i&quot;'s return value
+should be void. The second passage is also broken in the case of a an
+iterator type, like non-const pointers, that satisfies both the output
+iterator requirements and the forward iterator requirements.</p>
+
+<p>What should the standard say about <tt>*i</tt>'s return value when
+i is an output iterator, and what should it say about that t is in the
+expression &quot;*i = t&quot;? Finally, should the standard say anything about
+output iterators' pointer and reference types?</p>
+
+<p><b>Proposed resolution:</b></p>
+<p>24.1 p1, change</p>
+
+<blockquote>
+<p>All iterators <tt>i</tt> support the expression <tt>*i</tt>, resulting
+in a value of some class, enumeration, or built-in type <tt>T</tt>,
+called the value type of the itereator.</p>
+</blockquote>
+
+<p>to</p>
+
+<blockquote>
+<p>All input iterators <tt>i</tt> support the expression <tt>*i</tt>,
+resulting in a value of some class, enumeration, or built-in type
+<tt>T</tt>, called the value type of the iterator. All output
+iterators support the expression <tt>*i = o</tt> where <tt>o</tt> is a
+value of some type that is in the set of types that are <i>writable</i> to
+the particular iterator type of <tt>i</tt>.
+</p>
+</blockquote>
+
+<p>24.1 p9, add</p>
+
+<blockquote>
+<p>
+<tt>o</tt> denotes a value of some type that is writable to the
+output iterator.
+</p>
+</blockquote>
+
+<p>Table 73, change</p>
+
+<blockquote>
+<pre>
+*a = t
+</pre>
+</blockquote>
+
+<p>to</p>
+
+<blockquote>
+<pre>
+*r = o
+</pre>
+</blockquote>
+
+<p>and change</p>
+
+<blockquote>
+<pre>
+*r++ = t
+</pre>
+</blockquote>
+
+<p>to</p>
+
+<blockquote>
+<pre>
+*r++ = o
+</pre>
+</blockquote>
+
+<p><i>[post-Redmond: Jeremy provided wording]</i></p>
+
+<p><b>Rationale:</b></p>
+<p>The LWG considered two options: change all of the language that
+seems to imply that output iterators have value types, thus making it
+clear that output iterators have no value types, or else define value
+types for output iterator consistently. The LWG chose the former
+option, because it seems clear that output iterators were never
+intended to have value types. This was a deliberate design decision,
+and any language suggesting otherwise is simply a mistake.</p>
+
+<p>A future revision of the standard may wish to revisit this design
+decision.</p>
+<hr>
+<a name="325"><h3>325.&nbsp;Misleading text in moneypunct&lt;&gt;::do_grouping</h3></a><p>
+<b>Section:</b>&nbsp;22.2.6.3.2 <a href="lib-locales.html#lib.locale.moneypunct.virtuals"> [lib.locale.moneypunct.virtuals]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#Review">Review</a>&nbsp; <b>Submitter:</b>&nbsp;Martin Sebor&nbsp; <b>Date:</b>&nbsp;02 Jul 2001</p>
+<p>The Returns clause in 22.2.6.3.2, p3 says about
+moneypunct&lt;charT&gt;::do_grouping()
+</p>
+
+<blockquote>
+ Returns: A pattern defined identically as the result of
+ numpunct&lt;charT&gt;::do_grouping().241)
+</blockquote>
+
+<p>Footnote 241 then reads</p>
+
+<blockquote>
+ This is most commonly the value &quot;\003&quot; (not &quot;3&quot;).
+</blockquote>
+
+<p>
+The returns clause seems to imply that the two member functions must
+return an identical value which in reality may or may not be true,
+since the facets are usually implemented in terms of struct std::lconv
+and return the value of the grouping and mon_grouping, respectively.
+The footnote also implies that the member function of the moneypunct
+facet (rather than the overridden virtual functions in moneypunct_byname)
+most commonly return &quot;\003&quot;, which contradicts the C standard which
+specifies the value of &quot;&quot; for the (most common) C locale.
+</p>
+
+<p><b>Proposed resolution:</b></p>
+<p>Replace the text in Returns clause in 22.2.6.3.2, p3 with the following:</p>
+
+<blockquote>
+ Returns: A pattern defined identically as, but not necessarily
+ equal to, the result of numpunct&lt;charT&gt;::do_grouping().241)
+</blockquote>
+
+<p>and replace the text in Footnote 241 with the following:</p>
+
+<blockquote>
+ To specify grouping by 3s the value is &quot;\003&quot;, not &quot;3&quot;.
+</blockquote>
+<p><b>Rationale:</b></p>
+<p>
+The fundamental problem is that the description of the locale facet
+virtuals serves two purposes: describing the behavior of the base
+class, and describing the meaning of and constraints on the behavior
+in arbitrary derived classes. The new wording makes that separation a
+little bit clearer. The footnote (which is nonnormative) is not
+supposed to say what the grouping is in the &quot;C&quot; locale or in any other
+locale. It is just a reminder that the values are interpreted as small
+integers, not ASCII characters.
+</p>
+<hr>
+<a name="327"><h3>327.&nbsp;Typo in time_get facet in table 52</h3></a><p>
+<b>Section:</b>&nbsp;22.1.1.1.1 <a href="lib-locales.html#lib.locale.category"> [lib.locale.category]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#Ready">Ready</a>&nbsp; <b>Submitter:</b>&nbsp;Tiki Wan&nbsp; <b>Date:</b>&nbsp;06 Jul 2001</p>
+<p>The <tt>wchar_t</tt> versions of <tt>time_get</tt> and
+<tt>time_get_byname</tt> are listed incorrectly in table 52,
+required instantiations. In both cases the second template
+parameter is given as OutputIterator. It should instead be
+InputIterator, since these are input facets.</p>
+<p><b>Proposed resolution:</b></p>
+<p>
+In table 52, required instantiations, in
+22.1.1.1.1 <a href="lib-locales.html#lib.locale.category"> [lib.locale.category]</a>, change</p>
+<pre>
+ time_get&lt;wchar_t, OutputIterator&gt;
+ time_get_byname&lt;wchar_t, OutputIterator&gt;
+</pre>
+<p>to</p>
+<pre>
+ time_get&lt;wchar_t, InputIterator&gt;
+ time_get_byname&lt;wchar_t, InputIterator&gt;
+</pre>
+
+<p><i>[Redmond: Very minor change in proposed resolution. Original had
+a typo, wchart instead of wchar_t.]</i></p>
+
+<hr>
+<a name="328"><h3>328.&nbsp;Bad sprintf format modifier in money_put&lt;&gt;::do_put()</h3></a><p>
+<b>Section:</b>&nbsp;22.2.6.2.2 <a href="lib-locales.html#lib.locale.money.put.virtuals"> [lib.locale.money.put.virtuals]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#Ready">Ready</a>&nbsp; <b>Submitter:</b>&nbsp;Martin Sebor&nbsp; <b>Date:</b>&nbsp;07 Jul 2001</p>
+<p>The sprintf format string , &quot;%.01f&quot; (that's the digit one), in the
+description of the do_put() member functions of the money_put facet in
+22.2.6.2.2, p1 is incorrect. First, the f format specifier is wrong
+for values of type long double, and second, the precision of 01
+doesn't seem to make sense. What was most likely intended was
+&quot;%.0Lf&quot;., that is a precision of zero followed by the L length
+modifier.</p>
+<p><b>Proposed resolution:</b></p>
+<p>Change the format string to &quot;%.0Lf&quot;.</p>
+<p><b>Rationale:</b></p>
+<p>Fixes an obvious typo</p>
+<hr>
+<a name="329"><h3>329.&nbsp;vector capacity, reserve and reallocation</h3></a><p>
+<b>Section:</b>&nbsp;23.2.4.2 <a href="lib-containers.html#lib.vector.capacity"> [lib.vector.capacity]</a>, 23.2.4.3 <a href="lib-containers.html#lib.vector.modifiers"> [lib.vector.modifiers]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#Review">Review</a>&nbsp; <b>Submitter:</b>&nbsp;Anthony Williams&nbsp; <b>Date:</b>&nbsp;13 Jul 2001</p>
+<p>
+There is an apparent contradiction about which circumstances can cause
+a reallocation of a vector in Section 23.2.4.2 <a href="lib-containers.html#lib.vector.capacity"> [lib.vector.capacity]</a> and
+section 23.2.4.3 <a href="lib-containers.html#lib.vector.modifiers"> [lib.vector.modifiers]</a>.
+</p>
+
+<p>23.2.4.2p5 says:</p>
+<blockquote>
+Notes: Reallocation invalidates all the references, pointers, and iterators
+referring to the elements in the sequence. It is guaranteed that no
+reallocation takes place during insertions that happen after a call to
+reserve() until the time when an insertion would make the size of the vector
+greater than the size specified in the most recent call to reserve().
+</blockquote>
+
+<p>Which implies if I do</p>
+
+<pre>
+ std::vector&lt;int&gt; vec;
+ vec.reserve(23);
+ vec.reserve(0);
+ vec.insert(vec.end(),1);
+</pre>
+
+<p>then the implementation may reallocate the vector for the insert,
+as the size specified in the previous call to reserve was zero.</p>
+
+<p>However, the previous paragraphs (23.2.4.2, p1-2) state:</p>
+<blockquote>
+<p>
+(capacity) Returns: The total number of elements the vector
+can hold without requiring reallocation
+</p>
+<p>
+...After reserve(), capacity() is greater or equal to the
+argument of reserve if reallocation happens; and equal to the previous value
+of capacity() otherwise...
+</p>
+</blockquote>
+
+<p>
+This implies that vec.capacity() is still 23, and so the insert()
+should not require a reallocation, as vec.size() is 0. This is backed
+up by 23.2.4.3p1:
+</p>
+<blockquote>
+(insert) Notes: Causes reallocation if the new size is greater than the old
+capacity.
+</blockquote>
+
+<p>
+Though this doesn't rule out reallocation if the new size is less
+than the old capacity, I think the intent is clear.
+</p>
+
+<p><b>Proposed resolution:</b></p>
+<p>Change the wording of 23.2.4.2 <a href="lib-containers.html#lib.vector.capacity"> [lib.vector.capacity]</a> paragraph 5 to:</p>
+
+<blockquote>
+Notes: Reallocation invalidates all the references, pointers, and
+iterators referring to the elements in the sequence. It is guaranteed
+that no reallocation takes place during insertions that happen after a
+call to reserve() until the time when an insertion would make the size
+of the vector greater than the value of capacity().
+</blockquote>
+
+<p><i>[Redmond: original proposed resolution was modified slightly. In
+the original, the guarantee was that there would be no reallocation
+until the size would be greater than the value of capacity() after the
+most recent call to reserve(). The LWG did not believe that the
+&quot;after the most recent call to reserve()&quot; added any useful
+information.]</i></p>
+
+<p><b>Rationale:</b></p>
+<p>There was general agreement that, when reserve() is called twice in
+succession and the argument to the second invocation is smaller than
+the argument to the first, the intent was for the second invocation to
+have no effect. Wording implying that such cases have an effect on
+reallocation guarantees was inadvertant.</p>
+<hr>
+<a name="331"><h3>331.&nbsp;bad declaration of destructor for ios_base::failure</h3></a><p>
+<b>Section:</b>&nbsp;27.4.2.1.1 <a href="lib-iostreams.html#lib.ios::failure"> [lib.ios::failure]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#Ready">Ready</a>&nbsp; <b>Submitter:</b>&nbsp;PremAnand M. Rao&nbsp; <b>Date:</b>&nbsp;23 Aug 2001</p>
+<p>
+With the change in 17.4.4.8 <a href="lib-intro.html#lib.res.on.exception.handling"> [lib.res.on.exception.handling]</a> to state
+ &quot;An implementation may strengthen the exception-specification for a
+ non-virtual function by removing listed exceptions.&quot;
+(issue <a href="lwg-defects.html#119">119</a>)
+and the following declaration of ~failure() in ios_base::failure
+</p>
+<pre>
+ namespace std {
+ class ios_base::failure : public exception {
+ public:
+ ...
+ virtual ~failure();
+ ...
+ };
+ }
+</pre>
+<p>the class failure cannot be implemented since in 18.6.1 <a href="lib-support.html#lib.exception"> [lib.exception]</a> the destructor of class exception has an empty
+exception specification:</p>
+<pre>
+ namespace std {
+ class exception {
+ public:
+ ...
+ virtual ~exception() throw();
+ ...
+ };
+ }
+</pre>
+<p><b>Proposed resolution:</b></p>
+<p>Remove the declaration of ~failure().</p>
+<p><b>Rationale:</b></p>
+<p>The proposed resolution is consistent with the way that destructors
+of other classes derived from <tt>exception</tt> are handled.</p>
+<hr>
+<a name="333"><h3>333.&nbsp;does endl imply synchronization with the device?</h3></a><p>
+<b>Section:</b>&nbsp;27.6.2.7 <a href="lib-iostreams.html#lib.ostream.manip"> [lib.ostream.manip]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#Review">Review</a>&nbsp; <b>Submitter:</b>&nbsp;PremAnand M. Rao&nbsp; <b>Date:</b>&nbsp;27 Aug 2001</p>
+<p>A footnote in 27.6.2.7 <a href="lib-iostreams.html#lib.ostream.manip"> [lib.ostream.manip]</a> states:</p>
+<blockquote>
+ [Footnote: The effect of executing cout &lt;&lt; endl is to insert a
+ newline character in the output sequence controlled by cout, then
+ synchronize it with any external file with which it might be
+ associated. --- end foonote]
+</blockquote>
+
+<p>
+Does the term &quot;file&quot; here refer to the external device?
+This leads to some implementation ambiguity on systems with fully
+buffered files where a newline does not cause a flush to the device.
+</p>
+
+<p>
+Choosing to sync with the device leads to significant performance
+penalties for each call to endl, while not sync-ing leads to
+errors under special circumstances.
+</p>
+
+<p>
+I could not find any other statement that explicitly defined
+the behavior one way or the other.
+</p>
+<p><b>Proposed resolution:</b></p>
+<p>Remove footnote 300 from section 27.6.2.7 <a href="lib-iostreams.html#lib.ostream.manip"> [lib.ostream.manip]</a>.</p>
+<p><b>Rationale:</b></p>
+<p>We already have normative text saying what <tt>endl</tt> does: it
+inserts a newline character and calls <tt>flush</tt>. This footnote
+is at best redundant, at worst (as this issue says) misleading,
+because it appears to make promises about what <tt>flush</tt>
+does.</p>
+<hr>
+<a name="334"><h3>334.&nbsp;map::operator[] specification forces inefficient implementation</h3></a><p>
+<b>Section:</b>&nbsp;23.3.1.2 <a href="lib-containers.html#lib.map.access"> [lib.map.access]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#Review">Review</a>&nbsp; <b>Submitter:</b>&nbsp;Andrea Griffini&nbsp; <b>Date:</b>&nbsp;02 Sep 2001</p>
+<p>
+The current standard describes map::operator[] using a
+code example. That code example is however quite
+inefficient because it requires several useless copies
+of both the passed key_type value and of default
+constructed mapped_type instances.
+My opinion is that was not meant by the comitee to
+require all those temporary copies.
+</p>
+
+<p>Currently map::operator[] behaviour is specified as: </p>
+<pre>
+ Returns:
+ (*((insert(make_pair(x, T()))).first)).second.
+</pre>
+
+<p>
+This specification however uses make_pair that is a
+template function of which parameters in this case
+will be deduced being of type const key_type&amp; and
+const T&amp;. This will create a pair&lt;key_type,T&gt; that
+isn't the correct type expected by map::insert so
+another copy will be required using the template
+conversion constructor available in pair to build
+the required pair&lt;const key_type,T&gt; instance.
+</p>
+
+<p>If we consider calling of key_type copy constructor
+and mapped_type default constructor and copy
+constructor as observable behaviour (as I think we
+should) then the standard is in this place requiring
+two copies of a key_type element plus a default
+construction and two copy construction of a mapped_type
+(supposing the addressed element is already present
+in the map; otherwise at least another copy
+construction for each type).
+</p>
+
+<p>A simple (half) solution would be replacing the description with:</p>
+<pre>
+ Returns:
+ (*((insert(value_type(x, T()))).first)).second.
+</pre>
+
+<p>This will remove the wrong typed pair construction that
+requires one extra copy of both key and value.</p>
+
+<p>However still the using of map::insert requires temporary
+objects while the operation, from a logical point of view,
+doesn't require any. </p>
+
+<p>I think that a better solution would be leaving free an
+implementer to use a different approach than map::insert
+that, because of its interface, forces default constructed
+temporaries and copies in this case.
+The best solution in my opinion would be just requiring
+map::operator[] to return a reference to the mapped_type
+part of the contained element creating a default element
+with the specified key if no such an element is already
+present in the container. Also a logarithmic complexity
+requirement should be specified for the operation.
+</p>
+
+<p>
+This would allow library implementers to write alternative
+implementations not using map::insert and reaching optimal
+performance in both cases of the addressed element being
+present or absent from the map (no temporaries at all and
+just the creation of a new pair inside the container if
+the element isn't present).
+Some implementer has already taken this option but I think
+that the current wording of the standard rules that as
+non-conforming.
+</p>
+
+<p><b>Proposed resolution:</b></p>
+
+<p>
+Replace 23.3.1.2 <a href="lib-containers.html#lib.map.access"> [lib.map.access]</a> paragraph 1 with
+</p>
+<blockquote>
+<p>
+-1- Effects: If there is no key equivalent to x in the map, inserts
+value_type(x, T()) into the map.
+</p>
+<p>
+-2- Returns: A reference to the mapped_type corresponding to x in *this.
+</p>
+<p>
+-3- Complexity: logarithmic.
+</p>
+</blockquote>
+
+<p><i>[This is the second option mentioned above. Howard provided
+wording. We may also wish to have a blanket statement somewhere in
+clause 17 saying that we do not intend the semantics of sample code
+fragments to be interpreted as specifing exactly how many copies are
+made. See issue <a href="lwg-active.html#98">98</a> for a similar problem.]</i></p>
+
+<hr>
+<a name="335"><h3>335.&nbsp;minor issue with char_traits, table 37</h3></a><p>
+<b>Section:</b>&nbsp;21.1.1 <a href="lib-strings.html#lib.char.traits.require"> [lib.char.traits.require]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#Ready">Ready</a>&nbsp; <b>Submitter:</b>&nbsp;Andy Sawyer&nbsp; <b>Date:</b>&nbsp;06 Sep 2001</p>
+<p>
+Table 37, in 21.1.1 <a href="lib-strings.html#lib.char.traits.require"> [lib.char.traits.require]</a>, descibes char_traits::assign
+as:
+</p>
+<pre>
+ X::assign(c,d) assigns c = d.
+</pre>
+
+<p>And para 1 says:</p>
+
+<blockquote>
+ [...] c and d denote values of type CharT [...]
+</blockquote>
+
+<p>
+Naturally, if c and d are <i>values</i>, then the assignment is
+(effectively) meaningless. It's clearly intended that (in the case of
+assign, at least), 'c' is intended to be a reference type.
+</p>
+
+<p>I did a quick survey of the four implementations I happened to have
+lying around, and sure enough they all have signatures:</p>
+<pre>
+ assign( charT&amp;, const charT&amp; );
+</pre>
+
+<p>(or the equivalent). It's also described this way in Nico's book.
+(Not to mention the synopses of char_traits&lt;char&gt; in 21.1.3.1
+and char_traits&lt;wchar_t&gt; in 21.1.3.2...)
+</p>
+<p><b>Proposed resolution:</b></p>
+<p>Add the following to 21.1.1 para 1:</p>
+<blockquote>
+ r denotes an lvalue of CharT
+</blockquote>
+
+<p>and change the description of assign in the table to:</p>
+<pre>
+ X::assign(r,d) assigns r = d
+</pre>
+<hr>
+<a name="336"><h3>336.&nbsp;Clause 17 lack of references to deprecated headers</h3></a><p>
+<b>Section:</b>&nbsp;17 <a href="lib-intro.html#lib.library"> [lib.library]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#Open">Open</a>&nbsp; <b>Submitter:</b>&nbsp;Detlef Vollmann&nbsp; <b>Date:</b>&nbsp;05 Sep 2001</p>
+<p>From c++std-edit-873:</p>
+
+<p>17.4.1.2 <a href="lib-intro.html#lib.headers"> [lib.headers]</a>, Table 11. In this table, the header
+&lt;strstream&gt; is missing.</p>
+
+<p>This shows a general problem: The whole clause 17 refers quite
+often to clauses 18 through 27, but D.7 is also a part of the standard
+library (though a deprecated one).</p>
+
+<p><b>Proposed resolution:</b></p>
+<p><i>[Redmond: The LWG agrees that &lt;strstream&gt; should be added
+to table 11. A review is needed to determine whether there are any
+other places in clause 17 where clause D material should be referred
+to. Beman will review clause 17.]</i></p>
+<hr>
+<a name="337"><h3>337.&nbsp;replace_copy_if's template parameter should be InputIterator</h3></a><p>
+<b>Section:</b>&nbsp;25.2.4 <a href="lib-algorithms.html#lib.alg.replace"> [lib.alg.replace]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#Ready">Ready</a>&nbsp; <b>Submitter:</b>&nbsp;Detlef Vollmann&nbsp; <b>Date:</b>&nbsp;07 Sep 2001</p>
+<p>From c++std-edit-876:</p>
+
+<p>
+In section 25.2.4 <a href="lib-algorithms.html#lib.alg.replace"> [lib.alg.replace]</a> before p4: The name of the first
+parameter of template replace_copy_if should be &quot;InputIterator&quot;
+instead of &quot;Iterator&quot;. According to 17.3.2.1 <a href="lib-intro.html#lib.type.descriptions"> [lib.type.descriptions]</a> p1 the
+parameter name conveys real normative meaning.
+</p>
+<p><b>Proposed resolution:</b></p>
+<p>Change <tt>Iterator</tt> to <tt>InputIterator</tt>.</p>
+<hr>
+<a name="338"><h3>338.&nbsp; is whitespace allowed between `-' and a digit?</h3></a><p>
+<b>Section:</b>&nbsp;22.2 <a href="lib-locales.html#lib.locale.categories"> [lib.locale.categories]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#Review">Review</a>&nbsp; <b>Submitter:</b>&nbsp;Martin Sebor&nbsp; <b>Date:</b>&nbsp;17 Sep 2001</p>
+<p>
+From Stage 2 processing in 22.2.2.1.2 <a href="lib-locales.html#lib.facet.num.get.virtuals"> [lib.facet.num.get.virtuals]</a>, p8 and 9 (the
+original text or the text corrected by the proposed resolution of
+issue <a href="lwg-defects.html#221">221</a>) it seems clear that no whitespace is allowed
+within a number, but 22.2.3.1 <a href="lib-locales.html#lib.locale.numpunct"> [lib.locale.numpunct]</a>, p2, which gives the
+format for integer and floating point values, says that whitespace is
+optional between a plusminus and a sign.
+</p>
+
+<p>
+The text needs to be clarified to either consistently allow or
+disallow whitespace between a plusminus and a sign. It might be
+worthwhile to consider the fact that the C library stdio facility does
+not permit whitespace embedded in numbers and neither does the C or
+C++ core language (the syntax of integer-literals is given in 2.13.1 <a href="lex.html#lex.icon"> [lex.icon]</a>, that of floating-point-literals in 2.13.3 <a href="lex.html#lex.fcon"> [lex.fcon]</a> of the C++ standard).
+</p>
+<p><b>Proposed resolution:</b></p>
+<p>Change the first part of 22.2.3.1 <a href="lib-locales.html#lib.locale.numpunct"> [lib.locale.numpunct]</a> paragraph 2 from:</p>
+<blockquote>
+<p>
+The syntax for number formats is as follows, where <tt>digit</tt>
+represents the radix set specified by the <tt>fmtflags</tt> argument
+value, <tt>whitespace</tt> is as determined by the facet
+<tt>ctype&lt;charT&gt;</tt> (22.2.1.1), and <tt>thousands-sep</tt> and
+<tt>decimal-point</tt> are the results of corresponding
+<tt>numpunct&lt;charT&gt;</tt> members. Integer values have the
+format:
+</p>
+<pre>
+ integer ::= [sign] units
+ sign ::= plusminus [whitespace]
+ plusminus ::= '+' | '-'
+ units ::= digits [thousands-sep units]
+ digits ::= digit [digits]
+</pre>
+</blockquote>
+<p>to:</p>
+<blockquote>
+<p>
+The syntax for number formats is as follows, where <tt>digit</tt>
+represents the radix set specified by the <tt>fmtflags</tt> argument
+value, and <tt>thousands-sep</tt> and <tt>decimal-point</tt> are the
+results of corresponding <tt>numpunct&lt;charT&gt;</tt> members.
+Integer values have the format:
+</p>
+<pre>
+ integer ::= [sign] units
+ sign ::= plusminus
+ plusminus ::= '+' | '-'
+ units ::= digits [thousands-sep units]
+ digits ::= digit [digits]
+</pre>
+</blockquote>
+<p><b>Rationale:</b></p>
+<p>It's not clear whether the format described in 22.2.3.1 <a href="lib-locales.html#lib.locale.numpunct"> [lib.locale.numpunct]</a> paragraph 2 has any normative weight: nothing in the
+standard says how, or whether, it's used. However, there's no reason
+for it to differ gratuitously from the very specific description of
+numeric processing in 22.2.2.1.2 <a href="lib-locales.html#lib.facet.num.get.virtuals"> [lib.facet.num.get.virtuals]</a>. The proposed
+resolution removes all mention of &quot;whitespace&quot; from that format.</p>
+<hr>
+<a name="339"><h3>339.&nbsp;definition of bitmask type restricted to clause 27</h3></a><p>
+<b>Section:</b>&nbsp;22.2.1 <a href="lib-locales.html#lib.category.ctype"> [lib.category.ctype]</a>, 17.3.2.1.2 <a href="lib-intro.html#lib.bitmask.types"> [lib.bitmask.types]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#Review">Review</a>&nbsp; <b>Submitter:</b>&nbsp;Martin Sebor&nbsp; <b>Date:</b>&nbsp;17 September 2001</p>
+<p>
+The ctype_category::mask type is declared to be an enum in 22.2.1 <a href="lib-locales.html#lib.category.ctype"> [lib.category.ctype]</a> with p1 then stating that it is a bitmask type, most
+likely referring to the definition of bitmask type in 17.3.2.1.2 <a href="lib-intro.html#lib.bitmask.types"> [lib.bitmask.types]</a>, p1. However, the said definition only applies to
+clause 27, making the reference in 22.2.1 somewhat dubious.
+</p>
+<p><b>Proposed resolution:</b></p>
+<p>Clarify 17.3.2.1.2, p1 by changing the current text from</p>
+ <blockquote>
+ Several types defined in clause 27 are bitmask types. Each bitmask type
+ can be implemented as an enumerated type that overloads certain operators,
+ as an integer type, or as a bitset (23.3.5 <a href="lib-containers.html#lib.template.bitset"> [lib.template.bitset]</a>).
+ </blockquote>
+<p>to read</p>
+ <blockquote>
+ Several types defined in clauses lib.language.support through
+ lib.input.output and Annex D are bitmask types. Each bitmask type can
+ be implemented as an enumerated type that overloads certain operators,
+ as an integer type, or as a bitset (lib.template.bitset).
+ </blockquote>
+
+<p>
+Additionally, change the definition in 22.2.1 to adopt the same
+convention as in clause 27 by replacing the existing text with the
+following (note, in particluar, the cross-reference to 17.3.2.1.2 in
+22.2.1, p1):
+</p>
+
+<blockquote>
+<p>22.2.1 The ctype category [lib.category.ctype]</p>
+<pre>
+namespace std {
+ class ctype_base {
+ public:
+ typedef T mask;
+
+ // numeric values are for exposition only.
+ static const mask space = 1 &lt;&lt; 0;
+ static const mask print = 1 &lt;&lt; 1;
+ static const mask cntrl = 1 &lt;&lt; 2;
+ static const mask upper = 1 &lt;&lt; 3;
+ static const mask lower = 1 &lt;&lt; 4;
+ static const mask alpha = 1 &lt;&lt; 5;
+ static const mask digit = 1 &lt;&lt; 6;
+ static const mask punct = 1 &lt;&lt; 7;
+ static const mask xdigit = 1 &lt;&lt; 8;
+ static const mask alnum = alpha | digit;
+ static const mask graph = alnum | punct;
+ };
+}
+</pre>
+
+<p>The type <tt>mask</tt> is a bitmask type (17.3.2.1.2 <a href="lib-intro.html#lib.bitmask.types"> [lib.bitmask.types]</a>).</p>
+</blockquote>
+
+<hr>
+<a name="340"><h3>340.&nbsp;interpretation of <tt>has_facet&lt;Facet&gt;(loc)</tt>
+</h3></a><p>
+<b>Section:</b>&nbsp;22.1.1.1.1 <a href="lib-locales.html#lib.locale.category"> [lib.locale.category]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#Review">Review</a>&nbsp; <b>Submitter:</b>&nbsp;Martin Sebor&nbsp; <b>Date:</b>&nbsp;18 Sep 2001</p>
+<p>
+It's unclear whether 22.1.1.1.1, p3 says that
+<tt>has_facet&lt;Facet&gt;(loc)</tt> returns true for any <tt>Facet</tt>
+from Table 51 or whether it includes Table 52 as well:
+</p>
+
+<blockquote>
+For any locale <tt>loc</tt> either constructed, or returned by
+locale::classic(), and any facet <tt>Facet</tt> that is a member of a
+standard category, <tt>has_facet&lt;Facet&gt;(loc)</tt> is true. Each
+locale member function which takes a <tt>locale::category</tt>
+argument operates on the corresponding set of facets.
+</blockquote>
+
+<p>
+It seems that it comes down to which facets are considered to be members of a
+standard category. Intuitively, I would classify all the facets in Table 52 as
+members of their respective standard categories, but there are an unbounded set
+of them...
+</p>
+
+<p>
+The paragraph implies that, for instance, <tt>has_facet&lt;num_put&lt;C,
+OutputIterator&gt; &gt;(loc)</tt> must always return true. I don't think that's
+possible. If it were, then <tt>use_facet&lt;num_put&lt;C, OutputIterator&gt;
+&gt;(loc)</tt> would have to return a reference to a distinct object for each
+valid specialization of <tt>num_put&lt;C, OutputIteratory&gt;</tt>, which is
+clearly impossible.
+</p>
+
+<p>
+On the other hand, if none of the facets in Table 52 is a member of a standard
+category then none of the locale member functions that operate on entire
+categories of facets will work properly.
+</p>
+
+<p>
+It seems that what p3 should mention that it's required (permitted?)
+to hold only for specializations of <tt>Facet</tt> from Table 52 on
+<tt>C</tt> from the set { <tt>char</tt>, <tt>wchar_t</tt> }, and
+<tt>InputIterator</tt> and <tt>OutputIterator</tt> from the set of
+{
+{i,o}<tt>streambuf_iterator</tt>&lt;{<tt>char</tt>,<tt>wchar_t</tt>}<tt>&gt;</tt>
+}.
+</p>
+<p><b>Proposed resolution:</b></p>
+<p>In 22.1.1.1.1 <a href="lib-locales.html#lib.locale.category"> [lib.locale.category]</a>, paragraph 3, change
+&quot;that is a member of a standard category&quot; to &quot;shown in Table 51&quot;.</p>
+<p><b>Rationale:</b></p>
+<p>The facets in Table 52 are an unbounded set. Locales should not be
+required to contain an infinite number of facets.</p>
+
+<p>It's not necessary to talk about which values of InputIterator and
+OutputIterator must be supported. Table 51 already contains a
+complete list of the ones we need.</p>
+<hr>
+<a name="341"><h3>341.&nbsp;Vector reallocation and swap</h3></a><p>
+<b>Section:</b>&nbsp;23.2.4.2 <a href="lib-containers.html#lib.vector.capacity"> [lib.vector.capacity]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#Review">Review</a>&nbsp; <b>Submitter:</b>&nbsp;Anthony Williams&nbsp; <b>Date:</b>&nbsp;27 Sep 2001</p>
+<p>It is a common idiom to reduce the capacity of a vector by swapping it with
+an empty one:</p>
+<pre>
+ std::vector&lt;SomeType&gt; vec;
+ // fill vec with data
+ std::vector&lt;SomeType&gt;().swap(vec);
+ // vec is now empty, with minimal capacity
+</pre>
+
+<p>However, the wording of 23.2.4.2 <a href="lib-containers.html#lib.vector.capacity"> [lib.vector.capacity]</a>paragraph 5 prevents
+the capacity of a vector being reduced, following a call to
+reserve(). This invalidates the idiom, as swap() is thus prevented
+from reducing the capacity. The proposed wording for issue <a href="lwg-active.html#329">329</a> does not affect this. Consequently, the example above
+requires the temporary to be expanded to cater for the contents of
+vec, and the contents be copied across. This is a linear-time
+operation.</p>
+
+<p>However, the container requirements state that swap must have constant
+complexity (23.1 <a href="lib-containers.html#lib.container.requirements"> [lib.container.requirements]</a> note to table 65).</p>
+
+<p>This is an important issue, as reallocation affects the validity of
+references and iterators.</p>
+
+<p>If the wording of 23.2.4.2p5 is taken to be the desired intent, then
+references and iterators remain valid after a call to swap, if they refer to
+an element before the new end() of the vector into which they originally
+pointed, in which case they refer to the element at the same index position.
+Iterators and references that referred to an element whose index position
+was beyond the new end of the vector are invalidated.</p>
+
+<p>If the note to table 65 is taken as the desired intent, then there are two
+possibilities with regard to iterators and references:</p>
+
+<ol>
+<li>All Iterators and references into both vectors are invalidated.</li>
+<li>Iterators and references into either vector remain valid, and remain
+pointing to the same element. Consequently iterators and references that
+referred to one vector now refer to the other, and vice-versa.</li>
+</ol>
+<p><b>Proposed resolution:</b></p>
+<p>Add a new paragraph after 23.2.4.2 <a href="lib-containers.html#lib.vector.capacity"> [lib.vector.capacity]</a> paragraph 5:</p>
+<blockquote>
+<pre>
+ void swap(vector&lt;T,Allocator&gt;&amp; x);
+</pre>
+<p>
+<b>Effects:</b> Exchanges the contents and capacity() of <tt>*this</tt>
+with that of <tt>x</tt>.</p>
+<p>
+<b>Complexity:</b> Constant time.</p>
+</blockquote>
+
+<p><i>[This solves the problem reported for this issue. We may also
+have a problem with a circular definition of swap() for other
+containers.]</i></p>
+
+<p><b>Rationale:</b></p>
+<p>
+swap should be constant time. The clear intent is that it should just
+do pointer twiddling, and that it should exchange all properties of
+the two vectors, including their reallocation guarantees.
+ay be useful.
+</p>
+<hr>
+<a name="342"><h3>342.&nbsp;seek and eofbit</h3></a><p>
+<b>Section:</b>&nbsp;27.6.1.3 <a href="lib-iostreams.html#lib.istream.unformatted"> [lib.istream.unformatted]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#Open">Open</a>&nbsp; <b>Submitter:</b>&nbsp;Howard Hinnant&nbsp; <b>Date:</b>&nbsp;09 Oct 201</p>
+<p>I think we have a defect.</p>
+
+<p>According to lwg issue <a href="lwg-defects.html#60">60</a> which is now a dr, the
+description of seekg in 27.6.1.3 <a href="lib-iostreams.html#lib.istream.unformatted"> [lib.istream.unformatted]</a> paragraph 38 now looks
+like:</p>
+
+<blockquote>
+Behaves as an unformatted input function (as described in 27.6.1.3,
+paragraph 1), except that it does not count the number of characters
+extracted and does not affect the value returned by subsequent calls to
+gcount(). After constructing a sentry object, if fail() != true,
+executes rdbuf()&shy;&gt;pubseekpos( pos).
+</blockquote>
+
+<p>And according to lwg issue <a href="lwg-defects.html#243">243</a> which is also now a dr,
+27.6.1.3, paragraph 1 looks like:</p>
+
+<blockquote>
+Each unformatted input function begins execution by constructing an
+object of class sentry with the default argument noskipws (second)
+argument true. If the sentry object returns true, when converted to a
+value of type bool, the function endeavors to obtain the requested
+input. Otherwise, if the sentry constructor exits by throwing an
+exception or if the sentry object returns false, when converted to a
+value of type bool, the function returns without attempting to obtain
+any input. In either case the number of extracted characters is set to
+0; unformatted input functions taking a character array of non-zero
+size as an argument shall also store a null character (using charT())
+in the first location of the array. If an exception is thrown during
+input then ios::badbit is turned on in *this'ss error state. If
+(exception()&amp;badbit)!= 0 then the exception is rethrown. It also counts
+the number of characters extracted. If no exception has been thrown it
+ends by storing the count in a member object and returning the value
+specified. In any event the sentry object is destroyed before leaving
+the unformatted input function.
+</blockquote>
+
+<p>And finally 27.6.1.1.2/5 says this about sentry:</p>
+
+<blockquote>
+If, after any preparation is completed, is.good() is true, ok_ != false
+otherwise, ok_ == false.
+</blockquote>
+
+<p>
+So although the seekg paragraph says that the operation proceeds if
+!fail(), the behavior of unformatted functions says the operation
+proceeds only if good(). The two statements are contradictory when only
+eofbit is set. I don't think the current text is clear which condition
+should be respected.
+</p>
+
+<p><b>Further discussion from Redmond:</b></p>
+
+<p>PJP: It doesn't seem quite right to say that <tt>seekg</tt> is
+&quot;unformatted&quot;. That makes specific claims about sentry that
+aren't quite appropriate for seeking, which has less fragile failure
+modes than actual input. If we do really mean that it's unformatted
+input, it should behave the same way as other unformatted input. On
+the other hand, &quot;principle of least surprise&quot; is that seeking from EOF
+ought to be OK.</p>
+
+<p>Dietmar: nothing should depend on eofbit. Eofbit should only be
+examined by the user to determine why something failed.</p>
+
+<p><i>[Taken from c++std-lib-8873, c++std-lib-8874, c++std-lib-8876]</i></p>
+
+<p><b>Proposed resolution:</b></p>
+<p><i>[Howard will do a survey to find out if there are any other
+places where we have a problem, where the difference between
+<tt>fail()</tt> and <tt>!good()</tt> is important.]</i></p>
+<hr>
+<a name="345"><h3>345.&nbsp;type tm in &lt;cwchar&gt;</h3></a><p>
+<b>Section:</b>&nbsp;21.4 <a href="lib-strings.html#lib.c.strings"> [lib.c.strings]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#Ready">Ready</a>&nbsp; <b>Submitter:</b>&nbsp;Clark Nelson&nbsp; <b>Date:</b>&nbsp;19 Oct 2001</p>
+<p>
+C99, and presumably amendment 1 to C90, specify that &lt;wchar.h&gt;
+declares struct tm as an incomplete type. However, table 48 in 21.4 <a href="lib-strings.html#lib.c.strings"> [lib.c.strings]</a> does not mention the type tm as being declared in
+&lt;cwchar&gt;. Is this omission intentional or accidental?
+</p>
+<p><b>Proposed resolution:</b></p>
+<p>In section 21.4 <a href="lib-strings.html#lib.c.strings"> [lib.c.strings]</a>, add &quot;tm&quot; to table 48.</p>
+<hr>
+<a name="346"><h3>346.&nbsp;Some iterator member functions should be const</h3></a><p>
+<b>Section:</b>&nbsp;24.1 <a href="lib-iterators.html#lib.iterator.requirements"> [lib.iterator.requirements]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#Ready">Ready</a>&nbsp; <b>Submitter:</b>&nbsp;Jeremy Siek&nbsp; <b>Date:</b>&nbsp;20 Oct 2001</p>
+<p>Iterator member functions and operators that do not change the state
+of the iterator should be defined as const member functions or as
+functions that take iterators either by const reference or by
+value. The standard does not explicitly state which functions should
+be const. Since this a fairly common mistake, the following changes
+are suggested to make this explicit.</p>
+
+<p>The tables almost indicate constness properly through naming: r
+for non-const and a,b for const iterators. The following changes
+make this more explicit and also fix a couple problems.</p>
+<p><b>Proposed resolution:</b></p>
+<p>In 24.1 <a href="lib-iterators.html#lib.iterator.requirements"> [lib.iterator.requirements]</a> Change the first section of p9 from
+&quot;In the following sections, a and b denote values of X...&quot; to
+&quot;In the following sections, a and b denote values of type const X...&quot;.</p>
+
+<p>In Table 73, change</p>
+<pre>
+ a-&gt;m U&amp; ...
+</pre>
+
+<p>to</p>
+
+<pre>
+ a-&gt;m const U&amp; ...
+ r-&gt;m U&amp; ...
+</pre>
+
+<p>In Table 73 expression column, change</p>
+
+<pre>
+ *a = t
+</pre>
+
+<p>to</p>
+
+<pre>
+ *r = t
+</pre>
+
+<p><i>[Redmond: The container requirements should be reviewed to see if
+the same problem appears there.]</i></p>
+
+<hr>
+<a name="347"><h3>347.&nbsp;locale::category and bitmask requirements</h3></a><p>
+<b>Section:</b>&nbsp;22.1.1.1.1 <a href="lib-locales.html#lib.locale.category"> [lib.locale.category]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#New">New</a>&nbsp; <b>Submitter:</b>&nbsp;P.J. Plauger, Nathan Myers&nbsp; <b>Date:</b>&nbsp;23 Oct 2001</p>
+<p>
+In 22.1.1.1.1 <a href="lib-locales.html#lib.locale.category"> [lib.locale.category]</a> paragraph 1, the category members
+are described as bitmask elements. In fact, the bitmask requirements
+in 17.3.2.1.2 <a href="lib-intro.html#lib.bitmask.types"> [lib.bitmask.types]</a> don't seem quite right: <tt>none</tt>
+and <tt>all</tt> are bitmask constants, not bitmask elements.</p>
+
+<p>In particular, the requirements for <tt>none</tt> interact poorly
+with the requirement that the LC_* constants from the C library must
+be recognizable as C++ locale category constants. LC_* values should
+not be mixed with these values to make category values.</p>
+
+<p>We have two options for the proposed resolution. Informally:
+option 1 removes the requirement that LC_* values be recognized as
+category arguments. Option 2 changes the category type so that this
+requirement is implementable, by allowing <tt>none</tt> to be some
+value such as 0x1000 instead of 0.</p>
+
+<p>Nathan writes: &quot;I believe my proposed resolution [Option 2] merely
+re-expresses the status quo more clearly, without introducing any
+changes beyond resolving the DR.</p>
+
+<p><b>Proposed resolution:</b></p>
+<p>
+<b>Option 1:</b> <br>
+Replace the first two paragraphs of 22.1.1.1 <a href="lib-locales.html#lib.locale.types"> [lib.locale.types]</a> with:</p>
+<blockquote>
+<pre>
+ typedef int category;
+</pre>
+
+<p>Valid category values include the <tt>locale</tt> member bitmask
+elements <tt>collate</tt>, <tt>ctype</tt>, <tt>monetary</tt>,
+<tt>numeric</tt>, <tt>time</tt>, and <tt>messages</tt>, each of which
+represents a single locale category. In addition, <tt>locale</tt> member
+bitmask constant <tt>none</tt> is defined as zero and represents no
+category. And locale member bitmask constant <tt>all</tt> is defined such that
+the expression</p>
+<pre>
+ (collate | ctype | monetary | numeric | time | messages | all) == all
+</pre>
+<p>
+is <tt>true</tt>, and represents the union of all categories. Further
+the expression <tt>(X | Y)</tt>, where <tt>X</tt> and <tt>Y</tt> each
+represent a single category, represents the union of the two
+categories.
+</p>
+
+<p>
+<tt>locale</tt> member functions expecting a <tt>category</tt>
+argument require one of the <tt>category</tt> values defined above, or
+the union of two or more such values. Such a <tt>category</tt>
+argument identifies a set of locale categories. Each locale category,
+in turn, identifies a set of locale facets, including at least those
+shown in Table 51:
+</p>
+</blockquote>
+
+<p>
+<b>Option 2:</b> <br>
+Replace the first paragraph of 22.1.1.1 <a href="lib-locales.html#lib.locale.types"> [lib.locale.types]</a> with:</p>
+<blockquote>
+<p>
+Valid category values include the enumerated values. In addition, the
+result of applying commutative operators | and &amp; to any two valid
+values is valid, and results in the setwise union and intersection,
+respectively, of the argument categories. The values <tt>all</tt> and
+<tt>none</tt> are defined such that for any valid value <tt>cat</tt>, the
+expressions <tt>(cat | all == all)</tt>, <tt>(cat &amp; all == cat)</tt>,
+<tt>(cat | none == cat)</tt> and <tt>(cat &amp; none == none)</tt> are
+true. For non-equal values <tt>cat1</tt> and <tt>cat2</tt> of the
+remaining enumerated values, <tt>(cat1 &amp; cat2 == none)</tt> is true.
+For any valid categories <tt>cat1</tt> and <tt>cat2</tt>, the result
+of <tt>(cat1 &amp; ~cat2)</tt> is valid, and equals the setwise union of
+those categories found in <tt>cat1</tt> but not found in <tt>cat2</tt>.
+[Footnote: it is not required that <tt>all</tt> equal the setwise union
+of the other enumerated values; implementations may add extra categories.]
+</p>
+</blockquote>
+
+<hr>
+<a name="348"><h3>348.&nbsp;Minor issue with std::pair operator&lt;</h3></a><p>
+<b>Section:</b>&nbsp;20.2.2 <a href="lib-utilities.html#lib.pairs"> [lib.pairs]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#New">New</a>&nbsp; <b>Submitter:</b>&nbsp;Andy Sawyer&nbsp; <b>Date:</b>&nbsp;23 Oct 2001</p>
+<p>
+The current wording of 20.2.2 [lib.pairs] p6 precludes the use of
+operator&lt; on any pair type which contains a pointer.
+</p>
+<p><b>Proposed resolution:</b></p>
+<p>In 20.2.2 <a href="lib-utilities.html#lib.pairs"> [lib.pairs]</a> paragraph 6, replace:</p>
+<pre>
+ Returns: x.first &lt; y.first || (!(y.first &lt; x.first) &amp;&amp; x.second &lt;
+ y.second).
+</pre>
+<p>With:</p>
+<pre>
+ Returns: std::less&lt;T1&gt;()( x.first, y.first ) ||
+ (!std::less&lt;T1&gt;()( y.first, x.first) &amp;&amp;
+ std::less&lt;T2&gt;()( x.second, y.second ) )
+</pre>
+<hr>
+<a name="349"><h3>349.&nbsp;Minor typographical error in ostream_iterator</h3></a><p>
+<b>Section:</b>&nbsp;24.5.2 <a href="lib-iterators.html#lib.ostream.iterator"> [lib.ostream.iterator]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#New">New</a>&nbsp; <b>Submitter:</b>&nbsp;Andy Sawyer&nbsp; <b>Date:</b>&nbsp;24 Oct 2001</p>
+<p>24.5.2 [lib.ostream.iterator] states:</p>
+<pre>
+ [...]
+
+ private:
+ // basic_ostream&lt;charT,traits&gt;* out_stream; exposition only
+ // const char* delim; exposition only
+</pre>
+
+<p>Whilst it's clearly marked &quot;exposition only&quot;, I suspect 'delim'
+should be of type 'const charT*'.</p>
+<p><b>Proposed resolution:</b></p>
+<p>
+In 24.5.2 <a href="lib-iterators.html#lib.ostream.iterator"> [lib.ostream.iterator]</a>, replace <tt>const char* delim</tt> with
+<tt>const charT* delim</tt>.
+</p>
+<hr>
+<a name="350"><h3>350.&nbsp;allocator&lt;&gt;::address</h3></a><p>
+<b>Section:</b>&nbsp;20.4.1.1 <a href="lib-utilities.html#lib.allocator.members"> [lib.allocator.members]</a>, 20.1.5 <a href="lib-utilities.html#lib.allocator.requirements"> [lib.allocator.requirements]</a>, 17.4.1.1 <a href="lib-intro.html#lib.contents"> [lib.contents]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#New">New</a>&nbsp; <b>Submitter:</b>&nbsp;Nathan Myers&nbsp; <b>Date:</b>&nbsp;25 Oct 2001</p>
+<p>See c++std-lib-9006 and c++std-lib-9007. This issue is taken
+verbatim from -9007.</p>
+
+<p>
+The core language feature allowing definition of operator&amp;() applied
+to any non-builtin type makes that operator often unsafe to use in
+implementing libraries, including the Standard Library. The result
+is that many library facilities fail for legal user code, such as
+the fragment</p>
+<pre>
+ class A { private: A* operator&amp;(); };
+ std::vector&lt;A&gt; aa;
+
+ class B { };
+ B* operator&amp;(B&amp;) { return 0; }
+ std::vector&lt;B&gt; ba;
+</pre>
+
+<p>
+In particular, the requirements table for Allocator (Table 32) specifies
+no semantics at all for member address(), and allocator&lt;&gt;::address is
+defined in terms of unadorned operator &amp;.
+</p>
+
+<p><b>Proposed resolution:</b></p>
+<p>
+In 20.4.1.1, Change the definition of allocator&lt;&gt;::address from:</p>
+<blockquote>
+ Returns: &amp;x
+</blockquote>
+
+<p>to:</p>
+
+<p>
+ Returns: The value that the built in operator&amp;(x) would return if not
+ overloaded.
+</p>
+
+<p>
+In 20.1.5, Table 32, add to the Notes column of the a.address(r) and
+a.address(s) lines, respectively:
+</p>
+
+<pre>
+ allocator&lt;T&gt;::address(r)
+ allocator&lt;T&gt;::address(s)
+</pre>
+
+<p>In addition, in clause 17.4.1.1, add a statement:</p>
+
+<blockquote>
+ The Standard Library does not apply operator&amp; to any type for which
+ operator&amp; may be overloaded.
+</blockquote>
+
+<p><b>Rationale:</b></p>
+<p>The obvious implementations for std::allocator&lt;&gt;::address are</p>
+<pre>
+ T* reinterpret_cast&lt;T*&gt;(&amp;static_cast&lt;char&amp;&gt;(o));
+</pre>
+
+<p>and</p>
+
+<pre>
+ T const* reinterpret_cast&lt;T const*&gt;(&amp;static_cast&lt;char const&amp;&gt;(o));
+</pre>
+
+<p>
+but to define them formally in terms of reinterpret_cast&lt;&gt; seems
+to introduce semantic difficulties best avoided. Using a.address()
+should not introduce unspecified or implementation-defined semantics
+into a user program.</p>
+<p>----- End of document -----</p>
+</body>
+</html>
diff --git a/libstdc++-v3/docs/html/ext/lwg-defects.html b/libstdc++-v3/docs/html/ext/lwg-defects.html
new file mode 100644
index 00000000000..bd3af811383
--- /dev/null
+++ b/libstdc++-v3/docs/html/ext/lwg-defects.html
@@ -0,0 +1,6708 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
+<html>
+<head><title>C++ Standard Library Defect Report List</title></head>
+<body bgcolor="#ffffff" text="#000000">
+<table>
+<tr>
+<td align="left">Doc. no.</td>
+<td align="left">J16/01-0053 = WG21 N1338</td>
+</tr>
+<tr>
+<td align="left">Date:</td>
+<td align="left">09 Nov 2001</td>
+</tr>
+<tr>
+<td align="left">Project:</td>
+<td align="left">Programming Language C++</td>
+</tr>
+<tr>
+<td align="left">Reply to:</td>
+<td align="left">Matt Austern &lt;austern@research.att.com&gt;</td>
+</tr>
+</table>
+<h1>C++ Standard Library Defect Report List (Revision 20)</h1>
+ <p>Reference ISO/IEC IS 14882:1998(E)</p>
+ <p>Also see:</p>
+ <ul>
+ <li>
+<a href="lwg-toc.html">Table of Contents</a> for all library issues.</li>
+ <li>
+<a href="lwg-index.html">Index by Section</a> for all library issues.</li>
+ <li>
+<a href="lwg-status.html">Index by Status</a> for all library issues.</li>
+ <li><a href="lwg-active.html">Library Active Issues List</a></li>
+ <li><a href="lwg-closed.html">Library Closed Issues List</a></li>
+ </ul>
+ <p>This document contains only library issues which have been closed
+ by the Library Working Group (LWG) after being found to be defects
+ in the standard. That is, issues which have a status of <a href="lwg-active.html#DR">DR</a>, <a href="lwg-active.html#TC">TC</a>, or <a href="lwg-active.html#RR">RR</a>. See the
+ <a href="lwg-closed.html">Library Closed Issues List</a> for issues closed as non-defects. See the
+ <a href="lwg-active.html">Library Active Issues List</a> for active issues and more information. The
+ introductory material in that document also applies to this
+ document.</p>
+<h2>Revision History</h2>
+<ul>
+<li>R20:
+Post-Redmond mailing; reflects actions taken in Redmond. Added
+new issues <a href="lwg-active.html#336">336</a>-<a href="lwg-active.html#350">350</a>, of which issues
+<a href="lwg-active.html#347">347</a>-<a href="lwg-active.html#350">350</a> were added since Redmond, hence
+not discussed at the meeting.
+
+All Ready issues were moved to DR status, with the exception of issues
+<a href="lwg-active.html#284">284</a>, <a href="lwg-active.html#241">241</a>, and <a href="lwg-closed.html#267">267</a>.
+
+Noteworthy issues discussed at Redmond include
+<a href="lwg-active.html#120">120</a> <a href="lwg-active.html#202">202</a>, <a href="lwg-active.html#226">226</a>, <a href="lwg-active.html#233">233</a>,
+<a href="lwg-active.html#270">270</a>, <a href="lwg-active.html#253">253</a>, <a href="lwg-active.html#254">254</a>, <a href="lwg-active.html#323">323</a>.
+</li>
+<li>R19:
+Pre-Redmond mailing. Added new issues
+<a href="lwg-active.html#323">323</a>-<a href="lwg-active.html#335">335</a>.
+</li>
+<li>R18:
+Post-Copenhagen mailing; reflects actions taken in Copenhagen.
+Added new issues <a href="lwg-defects.html#312">312</a>-<a href="lwg-active.html#317">317</a>, and discussed
+new issues <a href="lwg-defects.html#271">271</a>-<a href="lwg-closed.html#314">314</a>.
+
+Changed status of issues
+<a href="lwg-defects.html#103">103</a> <a href="lwg-defects.html#118">118</a> <a href="lwg-defects.html#136">136</a> <a href="lwg-defects.html#153">153</a>
+<a href="lwg-defects.html#165">165</a> <a href="lwg-defects.html#171">171</a> <a href="lwg-defects.html#183">183</a> <a href="lwg-defects.html#184">184</a>
+<a href="lwg-defects.html#185">185</a> <a href="lwg-defects.html#186">186</a> <a href="lwg-defects.html#214">214</a> <a href="lwg-defects.html#221">221</a>
+<a href="lwg-defects.html#234">234</a> <a href="lwg-defects.html#237">237</a> <a href="lwg-defects.html#243">243</a> <a href="lwg-defects.html#248">248</a>
+<a href="lwg-defects.html#251">251</a> <a href="lwg-defects.html#252">252</a> <a href="lwg-defects.html#256">256</a> <a href="lwg-defects.html#260">260</a>
+<a href="lwg-defects.html#261">261</a> <a href="lwg-defects.html#262">262</a> <a href="lwg-defects.html#263">263</a> <a href="lwg-defects.html#265">265</a>
+<a href="lwg-defects.html#268">268</a>
+to DR.
+
+Changed status of issues
+<a href="lwg-defects.html#49">49</a> <a href="lwg-defects.html#109">109</a> <a href="lwg-defects.html#117">117</a> <a href="lwg-defects.html#182">182</a>
+<a href="lwg-defects.html#228">228</a> <a href="lwg-defects.html#230">230</a> <a href="lwg-defects.html#232">232</a> <a href="lwg-defects.html#235">235</a>
+<a href="lwg-defects.html#238">238</a> <a href="lwg-active.html#241">241</a> <a href="lwg-defects.html#242">242</a> <a href="lwg-defects.html#250">250</a>
+<a href="lwg-defects.html#259">259</a> <a href="lwg-defects.html#264">264</a> <a href="lwg-defects.html#266">266</a> <a href="lwg-closed.html#267">267</a>
+<a href="lwg-defects.html#271">271</a> <a href="lwg-defects.html#272">272</a> <a href="lwg-defects.html#273">273</a> <a href="lwg-defects.html#275">275</a>
+<a href="lwg-defects.html#281">281</a> <a href="lwg-active.html#284">284</a> <a href="lwg-defects.html#285">285</a> <a href="lwg-defects.html#286">286</a>
+<a href="lwg-defects.html#288">288</a> <a href="lwg-defects.html#292">292</a> <a href="lwg-defects.html#295">295</a> <a href="lwg-defects.html#297">297</a>
+<a href="lwg-defects.html#298">298</a> <a href="lwg-defects.html#301">301</a> <a href="lwg-defects.html#303">303</a> <a href="lwg-defects.html#306">306</a>
+<a href="lwg-defects.html#307">307</a> <a href="lwg-defects.html#308">308</a> <a href="lwg-defects.html#312">312</a>
+to Ready.
+
+Closed issues
+<a href="lwg-closed.html#111">111</a> <a href="lwg-closed.html#277">277</a> <a href="lwg-closed.html#279">279</a> <a href="lwg-closed.html#287">287</a>
+<a href="lwg-closed.html#289">289</a> <a href="lwg-closed.html#293">293</a> <a href="lwg-closed.html#302">302</a> <a href="lwg-closed.html#313">313</a>
+<a href="lwg-closed.html#314">314</a>
+as NAD.
+
+</li>
+<li>R17:
+Pre-Copenhagen mailing. Converted issues list to XML. Added proposed
+resolutions for issues <a href="lwg-defects.html#49">49</a>, <a href="lwg-active.html#76">76</a>, <a href="lwg-active.html#91">91</a>, <a href="lwg-defects.html#235">235</a>, <a href="lwg-defects.html#250">250</a>, <a href="lwg-closed.html#267">267</a>.
+Added new issues <a href="lwg-active.html#278">278</a>-<a href="lwg-active.html#311">311</a>.
+</li>
+<li>R16:
+post-Toronto mailing; reflects actions taken in Toronto. Added new
+issues <a href="lwg-defects.html#265">265</a>-<a href="lwg-closed.html#277">277</a>. Changed status of issues
+<a href="lwg-defects.html#3">3</a>, <a href="lwg-defects.html#8">8</a>, <a href="lwg-defects.html#9">9</a>, <a href="lwg-defects.html#19">19</a>,
+<a href="lwg-defects.html#26">26</a>, <a href="lwg-defects.html#31">31</a>, <a href="lwg-defects.html#61">61</a>,
+<a href="lwg-defects.html#63">63</a>, <a href="lwg-defects.html#86">86</a>, <a href="lwg-defects.html#108">108</a>,
+<a href="lwg-defects.html#112">112</a>, <a href="lwg-defects.html#114">114</a>, <a href="lwg-defects.html#115">115</a>,
+<a href="lwg-defects.html#122">122</a>, <a href="lwg-defects.html#127">127</a>, <a href="lwg-defects.html#129">129</a>,
+<a href="lwg-defects.html#134">134</a>, <a href="lwg-defects.html#137">137</a>, <a href="lwg-defects.html#142">142</a>,
+<a href="lwg-defects.html#144">144</a>, <a href="lwg-defects.html#146">146</a>, <a href="lwg-defects.html#147">147</a>,
+<a href="lwg-defects.html#159">159</a>, <a href="lwg-defects.html#164">164</a>, <a href="lwg-defects.html#170">170</a>,
+<a href="lwg-defects.html#181">181</a>, <a href="lwg-defects.html#199">199</a>, <a href="lwg-defects.html#208">208</a>,
+<a href="lwg-defects.html#209">209</a>, <a href="lwg-defects.html#210">210</a>, <a href="lwg-defects.html#211">211</a>,
+<a href="lwg-defects.html#212">212</a>, <a href="lwg-defects.html#217">217</a>, <a href="lwg-defects.html#220">220</a>,
+<a href="lwg-defects.html#222">222</a>, <a href="lwg-defects.html#223">223</a>, <a href="lwg-defects.html#224">224</a>,
+<a href="lwg-defects.html#227">227</a> to &quot;DR&quot;. Reopened issue <a href="lwg-active.html#23">23</a>. Reopened
+issue <a href="lwg-active.html#187">187</a>. Changed issues <a href="lwg-closed.html#2">2</a> and
+<a href="lwg-closed.html#4">4</a> to NAD. Fixed a typo in issue <a href="lwg-defects.html#17">17</a>. Fixed
+issue <a href="lwg-defects.html#70">70</a>: signature should be changed both places it
+appears. Fixed issue <a href="lwg-defects.html#160">160</a>: previous version didn't fix
+the bug in enough places.
+</li>
+<li>R15:
+pre-Toronto mailing. Added issues
+<a href="lwg-active.html#233">233</a>-<a href="lwg-defects.html#264">264</a>. Some small HTML formatting
+changes so that we pass Weblint tests.
+</li>
+<li>R14:
+post-Tokyo II mailing; reflects committee actions taken in
+Tokyo. Added issues <a href="lwg-defects.html#228">228</a> to <a href="lwg-defects.html#232">232</a>. (00-0019R1/N1242)
+</li>
+<li>R13:
+pre-Tokyo II updated: Added issues <a href="lwg-defects.html#212">212</a> to <a href="lwg-defects.html#227">227</a>.
+</li>
+<li>R12:
+pre-Tokyo II mailing: Added issues <a href="lwg-defects.html#199">199</a> to
+<a href="lwg-defects.html#211">211</a>. Added &quot;and paragraph 5&quot; to the proposed resolution
+of issue <a href="lwg-defects.html#29">29</a>. Add further rationale to issue
+<a href="lwg-closed.html#178">178</a>.
+</li>
+<li>R11:
+post-Kona mailing: Updated to reflect LWG and full committee actions
+in Kona (99-0048/N1224). Note changed resolution of issues
+<a href="lwg-closed.html#4">4</a> and <a href="lwg-defects.html#38">38</a>. Added issues <a href="lwg-closed.html#196">196</a>
+to <a href="lwg-active.html#198">198</a>. Closed issues list split into &quot;defects&quot; and
+&quot;closed&quot; documents. Changed the proposed resolution of issue
+<a href="lwg-closed.html#4">4</a> to NAD, and changed the wording of proposed resolution
+of issue <a href="lwg-defects.html#38">38</a>.
+</li>
+<li>R10:
+pre-Kona updated. Added proposed resolutions <a href="lwg-defects.html#83">83</a>,
+<a href="lwg-defects.html#86">86</a>, <a href="lwg-active.html#91">91</a>, <a href="lwg-active.html#92">92</a>,
+<a href="lwg-defects.html#109">109</a>. Added issues <a href="lwg-closed.html#190">190</a> to
+<a href="lwg-defects.html#195">195</a>. (99-0033/D1209, 14 Oct 99)
+</li>
+<li>R9:
+pre-Kona mailing. Added issues <a href="lwg-closed.html#140">140</a> to
+<a href="lwg-defects.html#189">189</a>. Issues list split into separate &quot;active&quot; and
+&quot;closed&quot; documents. (99-0030/N1206, 25 Aug 99)
+</li>
+<li>R8:
+post-Dublin mailing. Updated to reflect LWG and full committee actions
+in Dublin. (99-0016/N1193, 21 Apr 99)
+</li>
+<li>R7:
+pre-Dublin updated: Added issues <a href="lwg-closed.html#130">130</a>, <a href="lwg-closed.html#131">131</a>,
+<a href="lwg-defects.html#132">132</a>, <a href="lwg-defects.html#133">133</a>, <a href="lwg-defects.html#134">134</a>,
+<a href="lwg-closed.html#135">135</a>, <a href="lwg-defects.html#136">136</a>, <a href="lwg-defects.html#137">137</a>,
+<a href="lwg-closed.html#138">138</a>, <a href="lwg-defects.html#139">139</a> (31 Mar 99)
+</li>
+<li>R6:
+pre-Dublin mailing. Added issues <a href="lwg-defects.html#127">127</a>, <a href="lwg-closed.html#128">128</a>,
+and <a href="lwg-defects.html#129">129</a>. (99-0007/N1194, 22 Feb 99)
+</li>
+<li>R5:
+update issues <a href="lwg-defects.html#103">103</a>, <a href="lwg-defects.html#112">112</a>; added issues
+<a href="lwg-defects.html#114">114</a> to <a href="lwg-defects.html#126">126</a>. Format revisions to prepare
+for making list public. (30 Dec 98)
+</li>
+<li>R4:
+post-Santa Cruz II updated: Issues <a href="lwg-defects.html#110">110</a>,
+<a href="lwg-closed.html#111">111</a>, <a href="lwg-defects.html#112">112</a>, <a href="lwg-closed.html#113">113</a> added, several
+issues corrected. (22 Oct 98)
+</li>
+<li>R3:
+post-Santa Cruz II: Issues <a href="lwg-closed.html#94">94</a> to <a href="lwg-defects.html#109">109</a>
+added, many issues updated to reflect LWG consensus (12 Oct 98)
+</li>
+<li>R2:
+pre-Santa Cruz II: Issues <a href="lwg-closed.html#73">73</a> to <a href="lwg-closed.html#93">93</a> added,
+issue <a href="lwg-defects.html#17">17</a> updated. (29 Sep 98)
+</li>
+<li>R1:
+Correction to issue <a href="lwg-defects.html#55">55</a> resolution, <a href="lwg-defects.html#60">60</a> code
+format, <a href="lwg-defects.html#64">64</a> title. (17 Sep 98)
+</li>
+</ul>
+<h2>Defect Reports</h2>
+<hr>
+<a name="1"><h3>1.&nbsp;C library linkage editing oversight</h3></a><p>
+<b>Section:</b>&nbsp;17.4.2.2 <a href="lib-intro.html#lib.using.linkage"> [lib.using.linkage]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Beman Dawes&nbsp; <b>Date:</b>&nbsp;16 Nov 1997</p>
+<p>The change specified in the proposed resolution below did not make
+it into the Standard. This change was accepted in principle at the
+London meeting, and the exact wording below was accepted at the
+Morristown meeting.</p>
+<p><b>Proposed resolution:</b></p>
+<p>Change 17.4.2.2 <a href="lib-intro.html#lib.using.linkage"> [lib.using.linkage]</a> paragraph 2
+from:</p>
+
+<blockquote>
+ <p>It is unspecified whether a name from the Standard C library
+ declared with external linkage has either extern &quot;C&quot; or
+ extern &quot;C++&quot; linkage.</p>
+</blockquote>
+
+<p>to:</p>
+
+<blockquote>
+ <p>Whether a name from the Standard C library declared with external
+ linkage has extern &quot;C&quot; or extern &quot;C++&quot; linkage
+ is implementation defined. It is recommended that an implementation
+ use extern &quot;C++&quot; linkage for this purpose.</p>
+</blockquote>
+<hr>
+<a name="3"><h3>3.&nbsp;Atexit registration during atexit() call is not described</h3></a><p>
+<b>Section:</b>&nbsp;18.3 <a href="lib-support.html#lib.support.start.term"> [lib.support.start.term]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Steve Clamage&nbsp; <b>Date:</b>&nbsp;12 Dec 1997</p>
+<p>We appear not to have covered all the possibilities of
+ exit processing with respect to
+atexit registration. <br>
+<br>
+Example 1: (C and C++)</p>
+
+<pre> #include &lt;stdlib.h&gt;
+ void f1() { }
+ void f2() { atexit(f1); }
+
+ int main()
+ {
+ atexit(f2); // the only use of f2
+ return 0; // for C compatibility
+ }</pre>
+
+<p>At program exit, f2 gets called due to its registration in
+main. Running f2 causes f1 to be newly registered during the exit
+processing. Is this a valid program? If so, what are its
+semantics?</p>
+
+<p>
+Interestingly, neither the C standard, nor the C++ draft standard nor
+the forthcoming C9X Committee Draft says directly whether you can
+register a function with atexit during exit processing.</p>
+
+<p>
+All 3 standards say that functions are run in reverse order of their
+registration. Since f1 is registered last, it ought to be run first,
+but by the time it is registered, it is too late to be first.</p>
+
+<p>If the program is valid, the standards are self-contradictory about
+its semantics.</p>
+
+<p>Example 2: (C++ only)</p>
+
+<pre>
+ void F() { static T t; } // type T has a destructor
+
+ int main()
+ {
+ atexit(F); // the only use of F
+ }
+</pre>
+
+<p>Function F registered with atexit has a local static variable t,
+and F is called for the first time during exit processing. A local
+static object is initialized the first time control flow passes
+through its definition, and all static objects are destroyed during
+exit processing. Is the code valid? If so, what are its semantics?</p>
+
+<p>
+Section 18.3 &quot;Start and termination&quot; says that if a function
+F is registered with atexit before a static object t is initialized, F
+will not be called until after t's destructor completes.</p>
+
+<p>
+In example 2, function F is registered with atexit before its local
+static object O could possibly be initialized. On that basis, it must
+not be called by exit processing until after O's destructor
+completes. But the destructor cannot be run until after F is called,
+since otherwise the object could not be constructed in the first
+place.</p>
+
+<p>If the program is valid, the standard is self-contradictory about
+its semantics.</p>
+
+<p>I plan to submit Example 1 as a public comment on the C9X CD, with
+a recommendation that the results be undefined. (Alternative: make it
+unspecified. I don't think it is worthwhile to specify the case where
+f1 itself registers additional functions, each of which registers
+still more functions.)</p>
+
+<p>I think we should resolve the situation in the whatever way the C
+committee decides. </p>
+
+<p>For Example 2, I recommend we declare the results undefined.</p>
+
+<p><i>[See reflector message lib-6500 for further discussion.]</i></p>
+
+<p><b>Proposed resolution:</b></p>
+<p>Change section 18.3/8 from:</p>
+<blockquote>
+ First, objects with static storage duration are destroyed and
+ functions registered by calling atexit are called. Objects with
+ static storage duration are destroyed in the reverse order of the
+ completion of their constructor. (Automatic objects are not
+ destroyed as a result of calling exit().) Functions registered with
+ atexit are called in the reverse order of their registration. A
+ function registered with atexit before an object obj1 of static
+ storage duration is initialized will not be called until obj1's
+ destruction has completed. A function registered with atexit after
+ an object obj2 of static storage duration is initialized will be
+ called before obj2's destruction starts.
+</blockquote>
+<p>to:</p>
+<blockquote>
+ First, objects with static storage duration are destroyed and
+ functions registered by calling atexit are called. Non-local objects
+ with static storage duration are destroyed in the reverse order of
+ the completion of their constructor. (Automatic objects are not
+ destroyed as a result of calling exit().) Functions registered with
+ atexit are called in the reverse order of their registration, except
+ that a function is called after any previously registered functions
+ that had already been called at the time it was registered. A
+ function registered with atexit before a non-local object obj1 of
+ static storage duration is initialized will not be called until
+ obj1's destruction has completed. A function registered with atexit
+ after a non-local object obj2 of static storage duration is
+ initialized will be called before obj2's destruction starts. A local
+ static object obj3 is destroyed at the same time it would be if a
+ function calling the obj3 destructor were registered with atexit at
+ the completion of the obj3 constructor.
+</blockquote>
+<p><b>Rationale:</b></p>
+<p>See 99-0039/N1215, October 22, 1999, by Stephen D. Clamage for the analysis
+supporting to the proposed resolution.</p>
+<hr>
+<a name="5"><h3>5.&nbsp;String::compare specification questionable</h3></a><p>
+<b>Section:</b>&nbsp;21.3.6.8 <a href="lib-strings.html#lib.string::compare"> [lib.string::compare]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Jack Reeves&nbsp; <b>Date:</b>&nbsp;11 Dec 1997</p>
+<p>At the very end of the basic_string class definition is the signature: int
+compare(size_type pos1, size_type n1, const charT* s, size_type n2 = npos) const; In the
+following text this is defined as: returns
+basic_string&lt;charT,traits,Allocator&gt;(*this,pos1,n1).compare(
+basic_string&lt;charT,traits,Allocator&gt;(s,n2); </p>
+
+<p>Since the constructor basic_string(const charT* s, size_type n, const Allocator&amp; a
+= Allocator()) clearly requires that s != NULL and n &lt; npos and further states that it
+throws length_error if n == npos, it appears the compare() signature above should always
+throw length error if invoked like so: str.compare(1, str.size()-1, s); where 's' is some
+null terminated character array. </p>
+
+<p>This appears to be a typo since the obvious intent is to allow either the call above or
+something like: str.compare(1, str.size()-1, s, strlen(s)-1); </p>
+
+<p>This would imply that what was really intended was two signatures int compare(size_type
+pos1, size_type n1, const charT* s) const int compare(size_type pos1, size_type n1, const
+charT* s, size_type n2) const; each defined in terms of the corresponding constructor. </p>
+<p><b>Proposed resolution:</b></p>
+<p>Replace the compare signature in 21.3 <a href="lib-strings.html#lib.basic.string"> [lib.basic.string]</a>
+(at the very end of the basic_string synopsis) which reads:</p>
+
+<blockquote>
+ <p><tt>int compare(size_type pos1, size_type n1,<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; const charT* s,
+ size_type n2 = npos) const;</tt></p>
+</blockquote>
+
+<p>with:</p>
+
+<blockquote>
+ <p><tt>int compare(size_type pos1, size_type n1,<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; const charT* s) const;<br>
+ int compare(size_type pos1, size_type n1,<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; const charT* s,
+ size_type n2) const;</tt></p>
+</blockquote>
+
+<p>Replace the portion of 21.3.6.8 <a href="lib-strings.html#lib.string::compare"> [lib.string::compare]</a>
+paragraphs 5 and 6 which read:</p>
+
+<blockquote>
+ <p>
+<tt>int compare(size_type pos, size_type n1,<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; charT * s, size_type n2
+ = npos) const;<br>
+ </tt>Returns:<tt><br>
+ basic_string&lt;charT,traits,Allocator&gt;(*this, pos, n1).compare(<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ basic_string&lt;charT,traits,Allocator&gt;( s, n2))</tt>
+</p>
+</blockquote>
+
+<p>with:</p>
+
+<blockquote>
+ <p>
+<tt>int compare(size_type pos, size_type n1,<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; const charT * s) const;<br>
+ </tt>Returns:<tt><br>
+ basic_string&lt;charT,traits,Allocator&gt;(*this, pos, n1).compare(<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ basic_string&lt;charT,traits,Allocator&gt;( s ))<br>
+ <br>
+ int compare(size_type pos, size_type n1,<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; const charT * s,
+ size_type n2) const;<br>
+ </tt>Returns:<tt><br>
+ basic_string&lt;charT,traits,Allocator&gt;(*this, pos, n1).compare(<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ basic_string&lt;charT,traits,Allocator&gt;( s, n2))</tt>
+</p>
+</blockquote>
+
+<p>Editors please note that in addition to splitting the signature, the third argument
+becomes const, matching the existing synopsis.</p>
+<p><b>Rationale:</b></p>
+<p>While the LWG dislikes adding signatures, this is a clear defect in
+the Standard which must be fixed.&nbsp; The same problem was also
+identified in issues 7 (item 5) and 87.</p>
+<hr>
+<a name="7"><h3>7.&nbsp;String clause minor problems</h3></a><p>
+<b>Section:</b>&nbsp;21 <a href="lib-strings.html#lib.strings"> [lib.strings]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Matt Austern&nbsp; <b>Date:</b>&nbsp;15 Dec 1997</p>
+<p>(1) In 21.3.5.4 <a href="lib-strings.html#lib.string::insert"> [lib.string::insert]</a>, the description of template
+&lt;class InputIterator&gt; insert(iterator, InputIterator,
+InputIterator) makes no sense. It refers to a member function that
+doesn't exist. It also talks about the return value of a void
+function. </p>
+
+<p>(2) Several versions of basic_string::replace don't appear in the
+class synopsis. </p>
+
+<p>(3) basic_string::push_back appears in the synopsis, but is never
+described elsewhere. In the synopsis its argument is const charT,
+which doesn't makes much sense; it should probably be charT, or
+possible const charT&amp;. </p>
+
+<p>(4) basic_string::pop_back is missing. </p>
+
+<p>(5) int compare(size_type pos, size_type n1, charT* s, size_type n2
+= npos) make no sense. First, it's const charT* in the synopsis and
+charT* in the description. Second, given what it says in RETURNS,
+leaving out the final argument will always result in an exception
+getting thrown. This is paragraphs 5 and 6 of
+21.3.6.8 <a href="lib-strings.html#lib.string::compare"> [lib.string::compare]</a>
+</p>
+
+<p>(6) In table 37, in section 21.1.1 <a href="lib-strings.html#lib.char.traits.require"> [lib.char.traits.require]</a>,
+there's a note for X::move(s, p, n). It says &quot;Copies correctly
+even where p is in [s, s+n)&quot;. This is correct as far as it goes,
+but it doesn't go far enough; it should also guarantee that the copy
+is correct even where s in in [p, p+n). These are two orthogonal
+guarantees, and neither one follows from the other. Both guarantees
+are necessary if X::move is supposed to have the same sort of
+semantics as memmove (which was clearly the intent), and both
+guarantees are necessary if X::move is actually supposed to be
+useful. </p>
+<p><b>Proposed resolution:</b></p>
+<p>ITEM 1: In 21.3.5.4 [lib.string::insert], change paragraph 16 to <br>
+<br>
+&nbsp;&nbsp;&nbsp; EFFECTS: Equivalent to insert(p - begin(), basic_string(first, last)).<br>
+<br>
+ITEM 2:&nbsp; Not a defect; the Standard is clear.. There are ten versions of replace() in
+the synopsis, and ten versions in 21.3.5.6 [lib.string::replace].<br>
+<br>
+ITEM 3: Change the declaration of push_back in the string synopsis (21.3,
+[lib.basic.string]) from:</p>
+
+<p>&nbsp;&nbsp;&nbsp;&nbsp; void push_back(const charT)<br>
+<br>
+to<br>
+<br>
+&nbsp;&nbsp;&nbsp;&nbsp; void push_back(charT)<br>
+<br>
+Add the following text immediately after 21.3.5.2 [lib.string::append], paragraph 10.<br>
+<br>
+&nbsp;&nbsp;&nbsp; void basic_string::push_back(charT c);<br>
+&nbsp;&nbsp;&nbsp; EFFECTS: Equivalent to append(static_cast&lt;size_type&gt;(1), c);<br>
+<br>
+ITEM 4: Not a defect. The omission appears to have been deliberate.<br>
+<br>
+ITEM 5: Duplicate; see issue 5 (and 87).<br>
+<br>
+ITEM 6: In table 37, Replace:<br>
+<br>
+&nbsp;&nbsp;&nbsp; &quot;Copies correctly even where p is in [s, s+n).&quot;<br>
+<br>
+with:<br>
+<br>
+&nbsp;&nbsp;&nbsp;&nbsp; &quot;Copies correctly even where the ranges [p, p+n) and [s,
+s+n) overlap.&quot;</p>
+<hr>
+<a name="8"><h3>8.&nbsp;Locale::global lacks guarantee</h3></a><p>
+<b>Section:</b>&nbsp;22.1.1.5 <a href="lib-locales.html#lib.locale.statics"> [lib.locale.statics]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Matt Austern&nbsp; <b>Date:</b>&nbsp;24 Dec 1997</p>
+<p>It appears there's an important guarantee missing from clause
+22. We're told that invoking locale::global(L) sets the C locale if L
+has a name. However, we're not told whether or not invoking
+setlocale(s) sets the global C++ locale. </p>
+
+<p>The intent, I think, is that it should not, but I can't find any
+such words anywhere. </p>
+<p><b>Proposed resolution:</b></p>
+<p>Add a sentence at the end of 22.1.1.5 <a href="lib-locales.html#lib.locale.statics"> [lib.locale.statics]</a>,
+paragraph 2:&nbsp; </p>
+
+<blockquote>
+ <p>No library function other than <tt>locale::global()</tt> shall affect
+ the value returned by <tt>locale()</tt>. </p>
+
+</blockquote>
+<hr>
+<a name="9"><h3>9.&nbsp;Operator new(0) calls should not yield the same pointer</h3></a><p>
+<b>Section:</b>&nbsp;18.4.1 <a href="lib-support.html#lib.new.delete"> [lib.new.delete]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Steve Clamage&nbsp; <b>Date:</b>&nbsp;4 Jan 1998</p>
+<p>Scott Meyers, in a comp.std.c++ posting: I just noticed that
+section 3.7.3.1 of CD2 seems to allow for the possibility that all
+calls to operator new(0) yield the same pointer, an implementation
+technique specifically prohibited by ARM 5.3.3.Was this prohibition
+really lifted? Does the FDIS agree with CD2 in the regard? [Issues
+list maintainer's note: the IS is the same.]</p>
+<p><b>Proposed resolution:</b></p>
+<p>Change the last paragraph of 3.7.3 from:</p>
+<blockquote>
+ <p>Any allocation and/or deallocation functions defined in a C++ program shall
+ conform to the semantics specified in 3.7.3.1 and 3.7.3.2.</p>
+</blockquote>
+<p>to:</p>
+<blockquote>
+ <p>Any allocation and/or deallocation functions defined in a C++ program,
+ including the default versions in the library, shall conform to the semantics
+ specified in 3.7.3.1 and 3.7.3.2.</p>
+</blockquote>
+<p>Change 3.7.3.1/2, next-to-last sentence, from :</p>
+<blockquote>
+ <p>If the size of the space requested is zero, the value returned shall not be
+ a null pointer value (4.10).</p>
+</blockquote>
+<p>to:</p>
+<blockquote>
+ <p>Even if the size of the space requested is zero, the request can fail. If
+ the request succeeds, the value returned shall be a non-null pointer value
+ (4.10) p0 different from any previously returned value p1, unless that value
+ p1 was since passed to an operator delete.</p>
+</blockquote>
+<p>5.3.4/7 currently reads:</p>
+<blockquote>
+ <p>When the value of the expression in a direct-new-declarator is zero, the
+ allocation function is called to allocate an array with no elements. The
+ pointer returned by the new-expression is non-null. [Note: If the library
+ allocation function is called, the pointer returned is distinct from the
+ pointer to any other object.]</p>
+</blockquote>
+<p>Retain the first sentence, and delete the remainder.</p>
+<p>18.4.1 currently has no text. Add the following:</p>
+<blockquote>
+ <p>Except where otherwise specified, the provisions of 3.7.3 apply to the
+ library versions of operator new and operator delete.</p>
+</blockquote>
+<p>To 18.4.1.3, add the following text:</p>
+<blockquote>
+ <p>The provisions of 3.7.3 do not apply to these reserved placement forms of
+ operator new and operator delete.</p>
+</blockquote>
+<p><b>Rationale:</b></p>
+<p>See 99-0040/N1216, October 22, 1999, by Stephen D. Clamage for the analysis
+supporting to the proposed resolution.</p>
+<hr>
+<a name="11"><h3>11.&nbsp;Bitset minor problems</h3></a><p>
+<b>Section:</b>&nbsp;23.3.5 <a href="lib-containers.html#lib.template.bitset"> [lib.template.bitset]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Matt Austern&nbsp; <b>Date:</b>&nbsp;22 Jan 1998</p>
+<p>(1) bitset&lt;&gt;::operator[] is mentioned in the class synopsis (23.3.5), but it is
+not documented in 23.3.5.2. </p>
+
+<p>(2) The class synopsis only gives a single signature for bitset&lt;&gt;::operator[],
+reference operator[](size_t pos). This doesn't make much sense. It ought to be overloaded
+on const. reference operator[](size_t pos); bool operator[](size_t pos) const. </p>
+
+<p>(3) Bitset's stream input function (23.3.5.3) ought to skip all whitespace before
+trying to extract 0s and 1s. The standard doesn't explicitly say that, though. This should
+go in the Effects clause.</p>
+<p><b>Proposed resolution:</b></p>
+<p>ITEMS 1 AND 2:<br>
+<br>
+In the bitset synopsis (23.3.5 <a href="lib-containers.html#lib.template.bitset"> [lib.template.bitset]</a>),
+replace the member function <br>
+<br>
+<tt>&nbsp;&nbsp;&nbsp; reference operator[](size_t pos);<br>
+</tt><br>
+with the two member functions<br>
+<br>
+<tt>&nbsp;&nbsp;&nbsp; bool operator[](size_t pos) const; <br>
+&nbsp;&nbsp;&nbsp; reference operator[](size_t pos); <br>
+</tt><br>
+Add the following text at the end of 23.3.5.2 <a href="lib-containers.html#lib.bitset.members"> [lib.bitset.members]</a>,
+immediately after paragraph 45:</p>
+
+<blockquote>
+ <p>
+<tt>bool operator[](size_t pos) const;</tt><br>
+ Requires: pos is valid<br>
+ Throws: nothing<br>
+ Returns: <tt>test(pos)</tt><br>
+ <br>
+ <tt>bitset&lt;N&gt;::reference operator[](size_t pos);</tt> <br>
+ Requires: pos is valid<br>
+ Throws: nothing<br>
+ Returns: An object of type <tt>bitset&lt;N&gt;::reference</tt> such that <tt>(*this)[pos]
+ == this-&gt;test(pos)</tt>, and such that <tt>(*this)[pos] = val</tt> is equivalent to <tt>this-&gt;set(pos,
+ val);</tt>
+</p>
+</blockquote>
+<p><b>Rationale:</b></p>
+<p>The LWG believes Item 3 is not a defect. &quot;Formatted
+input&quot; implies the desired semantics. See 27.6.1.2 <a href="lib-iostreams.html#lib.istream.formatted"> [lib.istream.formatted]</a>.
+</p>
+<hr>
+<a name="13"><h3>13.&nbsp;Eos refuses to die</h3></a><p>
+<b>Section:</b>&nbsp;27.6.1.2.3 <a href="lib-iostreams.html#lib.istream::extractors"> [lib.istream::extractors]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;William M. Miller&nbsp; <b>Date:</b>&nbsp;3 Mar 1998</p>
+<p>In 27.6.1.2.3, there is a reference to &quot;eos&quot;, which is
+the only one in the whole draft (at least using Acrobat search), so
+it's undefined. </p>
+<p><b>Proposed resolution:</b></p>
+<p>In 27.6.1.2.3 <a href="lib-iostreams.html#lib.istream::extractors"> [lib.istream::extractors]</a>, replace &quot;eos&quot; with
+&quot;charT()&quot;</p>
+<hr>
+<a name="14"><h3>14.&nbsp;Locale::combine should be const</h3></a><p>
+<b>Section:</b>&nbsp;22.1.1.3 <a href="lib-locales.html#lib.locale.members"> [lib.locale.members]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Nathan Myers&nbsp; <b>Date:</b>&nbsp;6 Aug 1998</p>
+<p>locale::combine is the only member function of locale (other than constructors and
+destructor) that is not const. There is no reason for it not to be const, and good reasons
+why it should have been const. Furthermore, leaving it non-const conflicts with 22.1.1
+paragraph 6: &quot;An instance of a locale is immutable.&quot; </p>
+
+<p>History: this member function originally was a constructor. it happened that the
+interface it specified had no corresponding language syntax, so it was changed to a member
+function. As constructors are never const, there was no &quot;const&quot; in the interface
+which was transformed into member &quot;combine&quot;. It should have been added at that
+time, but the omission was not noticed. </p>
+<p><b>Proposed resolution:</b></p>
+<p>In 22.1.1 <a href="lib-locales.html#lib.locale"> [lib.locale]</a> and also in 22.1.1.3 <a href="lib-locales.html#lib.locale.members"> [lib.locale.members]</a>, add
+&quot;const&quot; to the declaration of member combine: </p>
+<blockquote>
+ <pre>template &lt;class Facet&gt; locale combine(const locale&amp; other) const; </pre>
+</blockquote>
+<hr>
+<a name="15"><h3>15.&nbsp;Locale::name requirement inconsistent</h3></a><p>
+<b>Section:</b>&nbsp;22.1.1.3 <a href="lib-locales.html#lib.locale.members"> [lib.locale.members]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Nathan Myers&nbsp; <b>Date:</b>&nbsp;6 Aug 1998</p>
+<p>locale::name() is described as returning a string that can be passed to a locale
+constructor, but there is no matching constructor. </p>
+<p><b>Proposed resolution:</b></p>
+<p>In 22.1.1.3 <a href="lib-locales.html#lib.locale.members"> [lib.locale.members]</a>, paragraph 5, replace
+&quot;<tt>locale(name())</tt>&quot; with
+&quot;<tt>locale(name().c_str())</tt>&quot;.
+</p>
+<hr>
+<a name="16"><h3>16.&nbsp;Bad ctype_byname&lt;char&gt; decl</h3></a><p>
+<b>Section:</b>&nbsp;22.2.1.4 <a href="lib-locales.html#lib.locale.ctype.byname.special"> [lib.locale.ctype.byname.special]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Nathan Myers&nbsp; <b>Date:</b>&nbsp;6 Aug 1998</p>
+<p>The new virtual members ctype_byname&lt;char&gt;::do_widen and do_narrow did not get
+edited in properly. Instead, the member do_widen appears four times, with wrong argument
+lists. </p>
+<p><b>Proposed resolution:</b></p>
+<p>The correct declarations for the overloaded members
+<tt>do_narrow</tt> and <tt>do_widen</tt> should be copied
+from 22.2.1.3 <a href="lib-locales.html#lib.facet.ctype.special"> [lib.facet.ctype.special]</a>.</p>
+<hr>
+<a name="17"><h3>17.&nbsp;Bad bool parsing</h3></a><p>
+<b>Section:</b>&nbsp;22.2.2.1.2 <a href="lib-locales.html#lib.facet.num.get.virtuals"> [lib.facet.num.get.virtuals]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Nathan Myers&nbsp; <b>Date:</b>&nbsp;6 Aug 1998</p>
+<p>This section describes the process of parsing a text boolean value from the input
+stream. It does not say it recognizes either of the sequences &quot;true&quot; or
+&quot;false&quot; and returns the corresponding bool value; instead, it says it recognizes
+only one of those sequences, and chooses which according to the received value of a
+reference argument intended for returning the result, and reports an error if the other
+sequence is found. (!) Furthermore, it claims to get the names from the ctype&lt;&gt;
+facet rather than the numpunct&lt;&gt; facet, and it examines the &quot;boolalpha&quot;
+flag wrongly; it doesn't define the value &quot;loc&quot;; and finally, it computes
+wrongly whether to use numeric or &quot;alpha&quot; parsing.<br>
+<br>
+I believe the correct algorithm is &quot;as if&quot;: </p>
+
+<pre> // in, err, val, and str are arguments.
+ err = 0;
+ const numpunct&lt;charT&gt;&amp; np = use_facet&lt;numpunct&lt;charT&gt; &gt;(str.getloc());
+ const string_type t = np.truename(), f = np.falsename();
+ bool tm = true, fm = true;
+ size_t pos = 0;
+ while (tm &amp;&amp; pos &lt; t.size() || fm &amp;&amp; pos &lt; f.size()) {
+ if (in == end) { err = str.eofbit; }
+ bool matched = false;
+ if (tm &amp;&amp; pos &lt; t.size()) {
+ if (!err &amp;&amp; t[pos] == *in) matched = true;
+ else tm = false;
+ }
+ if (fm &amp;&amp; pos &lt; f.size()) {
+ if (!err &amp;&amp; f[pos] == *in) matched = true;
+ else fm = false;
+ }
+ if (matched) { ++in; ++pos; }
+ if (pos &gt; t.size()) tm = false;
+ if (pos &gt; f.size()) fm = false;
+ }
+ if (tm == fm || pos == 0) { err |= str.failbit; }
+ else { val = tm; }
+ return in;</pre>
+
+<p>Notice this works reasonably when the candidate strings are both empty, or equal, or
+when one is a substring of the other. The proposed text below captures the logic of the
+code above.</p>
+<p><b>Proposed resolution:</b></p>
+<p>In 22.2.2.1.2 <a href="lib-locales.html#lib.facet.num.get.virtuals"> [lib.facet.num.get.virtuals]</a>, in the first line of paragraph 14,
+change &quot;&amp;&amp;&quot; to &quot;&amp;&quot;.</p>
+
+<p>Then, replace paragraphs 15 and 16 as follows:</p>
+
+<blockquote>
+
+ <p>Otherwise target sequences are determined &quot;as if&quot; by
+ calling the members <tt>falsename()</tt> and
+ <tt>truename()</tt> of the facet obtained by
+ <tt>use_facet&lt;numpunct&lt;charT&gt;&nbsp;&gt;(str.getloc())</tt>.
+ Successive characters in the range <tt>[in,end)</tt> (see
+ [lib.sequence.reqmts]) are obtained and matched against
+ corresponding positions in the target sequences only as necessary to
+ identify a unique match. The input iterator <tt>in</tt> is
+ compared to <tt>end</tt> only when necessary to obtain a
+ character. If and only if a target sequence is uniquely matched,
+ <tt>val</tt> is set to the corresponding value.</p>
+
+</blockquote>
+
+<blockquote>
+ <p>The <tt>in</tt> iterator is always left pointing one position beyond the last character
+ successfully matched. If <tt>val</tt> is set, then err is set to <tt>str.goodbit</tt>; or to
+ <tt>str.eofbit</tt> if, when seeking another character to match, it is found that
+ <tt>(in==end)</tt>. If <tt>val</tt> is not set, then <i>err</i> is set to <tt>str.failbit</tt>; or to
+ <tt>(str.failbit|str.eofbit)</tt>if
+ the reason for the failure was that <tt>(in==end)</tt>. [Example: for targets
+ <tt>true</tt>:&quot;a&quot; and <tt>false</tt>:&quot;abb&quot;, the input sequence &quot;a&quot; yields
+ <tt>val==true</tt> and <tt>err==str.eofbit</tt>; the input sequence &quot;abc&quot; yields
+ <tt>err=str.failbit</tt>, with <tt>in</tt> ending at the 'c' element. For targets
+ <tt>true</tt>:&quot;1&quot;
+ and <tt>false</tt>:&quot;0&quot;, the input sequence &quot;1&quot; yields <tt>val==true</tt>
+ and <tt>err=str.goodbit</tt>. For empty targets (&quot;&quot;), any input sequence yields
+ <tt>err==str.failbit</tt>. --end example]</p>
+</blockquote>
+<hr>
+<a name="18"><h3>18.&nbsp;Get(...bool&amp;) omitted</h3></a><p>
+<b>Section:</b>&nbsp;22.2.2.1.1 <a href="lib-locales.html#lib.facet.num.get.members"> [lib.facet.num.get.members]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Nathan Myers&nbsp; <b>Date:</b>&nbsp;6 Aug 1998</p>
+<p>In the list of num_get&lt;&gt; non-virtual members on page 22-23, the member
+that parses bool values was omitted from the list of definitions of non-virtual
+members, though it is listed in the class definition and the corresponding
+virtual is listed everywhere appropriate. </p>
+<p><b>Proposed resolution:</b></p>
+<p>Add at the beginning of 22.2.2.1.1 <a href="lib-locales.html#lib.facet.num.get.members"> [lib.facet.num.get.members]</a>
+another get member for bool&amp;, copied from the entry in
+22.2.2.1 <a href="lib-locales.html#lib.locale.num.get"> [lib.locale.num.get]</a>.</p>
+<hr>
+<a name="19"><h3>19.&nbsp;&quot;Noconv&quot; definition too vague</h3></a><p>
+<b>Section:</b>&nbsp;22.2.1.5.2 <a href="lib-locales.html#lib.locale.codecvt.virtuals"> [lib.locale.codecvt.virtuals]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Nathan Myers&nbsp; <b>Date:</b>&nbsp;6 Aug 1998</p>
+<p>
+In the definitions of codecvt&lt;&gt;::do_out and do_in, they are
+specified to return noconv if &quot;no conversion is
+needed&quot;. This definition is too vague, and does not say
+normatively what is done with the buffers.
+</p>
+<p><b>Proposed resolution:</b></p>
+<p>
+Change the entry for noconv in the table under paragraph 4 in section
+22.2.1.5.2 <a href="lib-locales.html#lib.locale.codecvt.virtuals"> [lib.locale.codecvt.virtuals]</a> to read:
+</p>
+<blockquote>
+ <p>
+<tt>noconv</tt>: <tt>internT</tt> and <tt>externT</tt> are the same type,
+ and input sequence is identical to converted sequence.</p>
+</blockquote>
+<p>Change the Note in paragraph 2 to normative text as follows:</p>
+<blockquote>
+ <p>If returns <tt>noconv</tt>, <tt>internT</tt> and <tt>externT</tt> are the
+ same type and the converted sequence is identical to the input sequence <tt>[from,from_next)</tt>.
+ <tt>to_next</tt> is set equal to <tt>to</tt>, the value of <tt>state</tt> is
+ unchanged, and there are no changes to the values in <tt>[to, to_limit)</tt>.</p>
+</blockquote>
+<hr>
+<a name="20"><h3>20.&nbsp;Thousands_sep returns wrong type</h3></a><p>
+<b>Section:</b>&nbsp;22.2.3.1.2 <a href="lib-locales.html#lib.facet.numpunct.virtuals"> [lib.facet.numpunct.virtuals]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Nathan Myers&nbsp; <b>Date:</b>&nbsp;6 Aug 1998</p>
+<p>The synopsis for numpunct&lt;&gt;::do_thousands_sep, and the
+definition of numpunct&lt;&gt;::thousands_sep which calls it, specify
+that it returns a value of type char_type. Here it is erroneously
+described as returning a &quot;string_type&quot;. </p>
+<p><b>Proposed resolution:</b></p>
+<p>In 22.2.3.1.2 <a href="lib-locales.html#lib.facet.numpunct.virtuals"> [lib.facet.numpunct.virtuals]</a>, above paragraph 2, change
+&quot;string_type&quot; to &quot;char_type&quot;. </p>
+<hr>
+<a name="21"><h3>21.&nbsp;Codecvt_byname&lt;&gt; instantiations</h3></a><p>
+<b>Section:</b>&nbsp;22.1.1.1.1 <a href="lib-locales.html#lib.locale.category"> [lib.locale.category]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Nathan Myers&nbsp; <b>Date:</b>&nbsp;6 Aug 1998</p>
+<p>In the second table in the section, captioned &quot;Required
+instantiations&quot;, the instantiations for codecvt_byname&lt;&gt;
+have been omitted. These are necessary to allow users to construct a
+locale by name from facets. </p>
+<p><b>Proposed resolution:</b></p>
+<p>Add in 22.1.1.1.1 <a href="lib-locales.html#lib.locale.category"> [lib.locale.category]</a> to the table captioned
+&quot;Required instantiations&quot;, in the category &quot;ctype&quot;
+the lines </p>
+
+<blockquote>
+ <pre>codecvt_byname&lt;char,char,mbstate_t&gt;,
+codecvt_byname&lt;wchar_t,char,mbstate_t&gt; </pre>
+</blockquote>
+<hr>
+<a name="22"><h3>22.&nbsp;Member open vs. flags</h3></a><p>
+<b>Section:</b>&nbsp;27.8.1.7 <a href="lib-iostreams.html#lib.ifstream.members"> [lib.ifstream.members]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Nathan Myers&nbsp; <b>Date:</b>&nbsp;6 Aug 1998</p>
+<p>The description of basic_istream&lt;&gt;::open leaves unanswered questions about how it
+responds to or changes flags in the error status for the stream. A strict reading
+indicates that it ignores the bits and does not change them, which confuses users who do
+not expect eofbit and failbit to remain set after a successful open. There are three
+reasonable resolutions: 1) status quo 2) fail if fail(), ignore eofbit 3) clear failbit
+and eofbit on call to open(). </p>
+<p><b>Proposed resolution:</b></p>
+<p>In 27.8.1.7 <a href="lib-iostreams.html#lib.ifstream.members"> [lib.ifstream.members]</a> paragraph 3, <i>and</i> in 27.8.1.10 <a href="lib-iostreams.html#lib.ofstream.members"> [lib.ofstream.members]</a> paragraph 3, under open() effects, add a footnote:
+</p>
+
+<blockquote>
+ <p>A successful open does not change the error state.</p>
+</blockquote>
+<p><b>Rationale:</b></p>
+<p>This may seem surprising to some users, but it's just an instance
+of a general rule: error flags are never cleared by the
+implementation. The only way error flags are are ever cleared is if
+the user explicitly clears them by hand.</p>
+
+<p>The LWG believed that preserving this general rule was
+important enough so that an exception shouldn't be made just for this
+one case. The resolution of this issue clarifies what the LWG
+believes to have been the original intent.</p>
+
+<hr>
+<a name="24"><h3>24.&nbsp;&quot;do_convert&quot; doesn't exist</h3></a><p>
+<b>Section:</b>&nbsp;22.2.1.5.2 <a href="lib-locales.html#lib.locale.codecvt.virtuals"> [lib.locale.codecvt.virtuals]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Nathan Myers&nbsp; <b>Date:</b>&nbsp;6 Aug 1998</p>
+<p>The description of codecvt&lt;&gt;::do_out and do_in mentions a
+symbol &quot;do_convert&quot; which is not defined in the
+standard. This is a leftover from an edit, and should be &quot;do_in
+and do_out&quot;. </p>
+<p><b>Proposed resolution:</b></p>
+<p>In 22.2.1.5 <a href="lib-locales.html#lib.locale.codecvt"> [lib.locale.codecvt]</a>, paragraph 3, change
+&quot;do_convert&quot; to &quot;do_in or do_out&quot;. Also, in 22.2.1.5.2 <a href="lib-locales.html#lib.locale.codecvt.virtuals"> [lib.locale.codecvt.virtuals]</a>, change &quot;do_convert()&quot; to &quot;do_in
+or do_out&quot;. </p>
+<hr>
+<a name="25"><h3>25.&nbsp;String operator&lt;&lt; uses width() value wrong</h3></a><p>
+<b>Section:</b>&nbsp;21.3.7.9 <a href="lib-strings.html#lib.string.io"> [lib.string.io]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Nathan Myers&nbsp; <b>Date:</b>&nbsp;6 Aug 1998</p>
+<p>In the description of operator&lt;&lt; applied to strings, the standard says that uses
+the smaller of os.width() and str.size(), to pad &quot;as described in stage 3&quot;
+elsewhere; but this is inconsistent, as this allows no possibility of space for padding. </p>
+<p><b>Proposed resolution:</b></p>
+<p>Change 21.3.7.9 <a href="lib-strings.html#lib.string.io"> [lib.string.io]</a> paragraph 4 from:<br>
+<br>
+&nbsp;&nbsp;&nbsp; &quot;... where <tt>n</tt> is the smaller of <tt>os.width()</tt> and <tt>str.size()</tt>;
+...&quot;<br>
+<br>
+to: <br>
+<br>
+&nbsp;&nbsp;&nbsp; &quot;... where <tt>n</tt> is the larger of <tt>os.width()</tt> and <tt>str.size()</tt>;
+...&quot;</p>
+<hr>
+<a name="26"><h3>26.&nbsp;Bad sentry example</h3></a><p>
+<b>Section:</b>&nbsp;27.6.1.1.2 <a href="lib-iostreams.html#lib.istream::sentry"> [lib.istream::sentry]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Nathan Myers&nbsp; <b>Date:</b>&nbsp;6 Aug 1998</p>
+<p>In paragraph 6, the code in the example: </p>
+
+<pre> template &lt;class charT, class traits = char_traits&lt;charT&gt; &gt;
+ basic_istream&lt;charT,traits&gt;::sentry(
+ basic_istream&lt;charT,traits&gt;&amp; is, bool noskipws = false) {
+ ...
+ int_type c;
+ typedef ctype&lt;charT&gt; ctype_type;
+ const ctype_type&amp; ctype = use_facet&lt;ctype_type&gt;(is.getloc());
+ while ((c = is.rdbuf()-&gt;snextc()) != traits::eof()) {
+ if (ctype.is(ctype.space,c)==0) {
+ is.rdbuf()-&gt;sputbackc (c);
+ break;
+ }
+ }
+ ...
+ }</pre>
+
+<p>fails to demonstrate correct use of the facilities described. In
+particular, it fails to use traits operators, and specifies incorrect
+semantics. (E.g. it specifies skipping over the first character in the
+sequence without examining it.) </p>
+<p><b>Proposed resolution:</b></p>
+<p>Remove the example above from 27.6.1.1.2 <a href="lib-iostreams.html#lib.istream::sentry"> [lib.istream::sentry]</a>
+paragraph 6.</p>
+<p><b>Rationale:</b></p>
+<p>The originally proposed replacement code for the example was not
+correct. The LWG tried in Kona and again in Tokyo to correct it
+without success. In Tokyo, an implementor reported that actual working
+code ran over one page in length and was quite complicated. The LWG
+decided that it would be counter-productive to include such a lengthy
+example, which might well still contain errors.</p>
+<hr>
+<a name="27"><h3>27.&nbsp;String::erase(range) yields wrong iterator</h3></a><p>
+<b>Section:</b>&nbsp;21.3.5.5 <a href="lib-strings.html#lib.string::erase"> [lib.string::erase]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Nathan Myers&nbsp; <b>Date:</b>&nbsp;6 Aug 1998</p>
+<p>The string::erase(iterator first, iterator last) is specified to return an element one
+place beyond the next element after the last one erased. E.g. for the string
+&quot;abcde&quot;, erasing the range ['b'..'d') would yield an iterator for element 'e',
+while 'd' has not been erased. </p>
+<p><b>Proposed resolution:</b></p>
+<p>In 21.3.5.5 <a href="lib-strings.html#lib.string::erase"> [lib.string::erase]</a>, paragraph 10, change: </p>
+
+<blockquote>
+ <p>Returns: an iterator which points to the element immediately following _last_ prior to
+ the element being erased. </p>
+</blockquote>
+
+<p>to read </p>
+
+<blockquote>
+ <p>Returns: an iterator which points to the element pointed to by _last_ prior to the
+ other elements being erased. </p>
+</blockquote>
+<hr>
+<a name="28"><h3>28.&nbsp;Ctype&lt;char&gt;is ambiguous</h3></a><p>
+<b>Section:</b>&nbsp;22.2.1.3.2 <a href="lib-locales.html#lib.facet.ctype.char.members"> [lib.facet.ctype.char.members]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Nathan Myers&nbsp; <b>Date:</b>&nbsp;6 Aug 1998</p>
+<p>The description of the vector form of ctype&lt;char&gt;::is can be interpreted to mean
+something very different from what was intended. Paragraph 4 says </p>
+
+<blockquote>
+ <p>Effects: The second form, for all *p in the range [low, high), assigns vec[p-low] to
+ table()[(unsigned char)*p]. </p>
+</blockquote>
+
+<p>This is intended to copy the value indexed from table()[] into the place identified in
+vec[]. </p>
+<p><b>Proposed resolution:</b></p>
+<p>Change 22.2.1.3.2 <a href="lib-locales.html#lib.facet.ctype.char.members"> [lib.facet.ctype.char.members]</a>, paragraph 4, to read </p>
+
+<blockquote>
+ <p>Effects: The second form, for all *p in the range [low, high), assigns into vec[p-low]
+ the value table()[(unsigned char)*p]. </p>
+</blockquote>
+<hr>
+<a name="29"><h3>29.&nbsp;Ios_base::init doesn't exist</h3></a><p>
+<b>Section:</b>&nbsp;27.3.1 <a href="lib-iostreams.html#lib.narrow.stream.objects"> [lib.narrow.stream.objects]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Nathan Myers&nbsp; <b>Date:</b>&nbsp;6 Aug 1998</p>
+<p>Sections 27.3.1 <a href="lib-iostreams.html#lib.narrow.stream.objects"> [lib.narrow.stream.objects]</a> and 27.3.2 <a href="lib-iostreams.html#lib.wide.stream.objects"> [lib.wide.stream.objects]</a> mention
+a function ios_base::init, which is not defined. Probably they mean
+basic_ios&lt;&gt;::init, defined in 27.4.4.1 <a href="lib-iostreams.html#lib.basic.ios.cons"> [lib.basic.ios.cons]</a>,
+paragraph 3. </p>
+<p><b>Proposed resolution:</b></p>
+<p>[R12: modified to include paragraph 5.]</p>
+
+<p>In 27.3.1 <a href="lib-iostreams.html#lib.narrow.stream.objects"> [lib.narrow.stream.objects]</a> paragraph 2 and 5, change </p>
+
+<blockquote>
+ <p>ios_base::init </p>
+</blockquote>
+
+<p>to </p>
+
+<blockquote>
+ <p>basic_ios&lt;char&gt;::init </p>
+</blockquote>
+
+<p>Also, make a similar change in 27.3.2 <a href="lib-iostreams.html#lib.wide.stream.objects"> [lib.wide.stream.objects]</a> except it
+should read </p>
+
+<blockquote>
+ <p>basic_ios&lt;wchar_t&gt;::init </p>
+</blockquote>
+<hr>
+<a name="30"><h3>30.&nbsp;Wrong header for LC_*</h3></a><p>
+<b>Section:</b>&nbsp;22.1.1.1.1 <a href="lib-locales.html#lib.locale.category"> [lib.locale.category]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Nathan Myers&nbsp; <b>Date:</b>&nbsp;6 Aug 1998</p>
+<p>Paragraph 2 implies that the C macros LC_CTYPE etc. are defined in &lt;cctype&gt;,
+where they are in fact defined elsewhere to appear in &lt;clocale&gt;. </p>
+<p><b>Proposed resolution:</b></p>
+<p>In 22.1.1.1.1 <a href="lib-locales.html#lib.locale.category"> [lib.locale.category]</a>, paragraph 2, change
+&quot;&lt;cctype&gt;&quot; to read &quot;&lt;clocale&gt;&quot;. </p>
+<hr>
+<a name="31"><h3>31.&nbsp;Immutable locale values</h3></a><p>
+<b>Section:</b>&nbsp;22.1.1 <a href="lib-locales.html#lib.locale"> [lib.locale]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Nathan Myers&nbsp; <b>Date:</b>&nbsp;6 Aug 1998</p>
+<p>Paragraph 6, says &quot;An instance of <tt>locale</tt> is
+<i>immutable</i>; once a facet reference is obtained from it,
+...&quot;. This has caused some confusion, because locale variables
+are manifestly assignable. </p>
+<p><b>Proposed resolution:</b></p>
+<p>In 22.1.1 <a href="lib-locales.html#lib.locale"> [lib.locale]</a> replace paragraph 6</p>
+
+<blockquote>
+ <p>An instance of <tt>locale</tt> is immutable; once a facet
+ reference is obtained from it, that reference remains usable as long
+ as the locale value itself exists.</p>
+</blockquote>
+
+<p>with</p>
+
+<blockquote>
+ <p>Once a facet reference is obtained from a locale object by
+ calling use_facet&lt;&gt;, that reference remains usable, and the
+ results from member functions of it may be cached and re-used, as
+ long as some locale object refers to that facet.</p>
+</blockquote>
+<hr>
+<a name="32"><h3>32.&nbsp;Pbackfail description inconsistent</h3></a><p>
+<b>Section:</b>&nbsp;27.5.2.4.4 <a href="lib-iostreams.html#lib.streambuf.virt.pback"> [lib.streambuf.virt.pback]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Nathan Myers&nbsp; <b>Date:</b>&nbsp;6 Aug 1998</p>
+<p>The description of the required state before calling virtual member
+basic_streambuf&lt;&gt;::pbackfail requirements is inconsistent with the conditions
+described in 27.5.2.2.4 [lib.streambuf.pub.pback] where member sputbackc calls it.
+Specifically, the latter says it calls pbackfail if: </p>
+
+<p>&nbsp;&nbsp;&nbsp; traits::eq(c,gptr()[-1]) is false </p>
+
+<p>where pbackfail claims to require: </p>
+
+<p>&nbsp;&nbsp;&nbsp; traits::eq(*gptr(),traits::to_char_type(c)) returns false </p>
+
+<p>It appears that the pbackfail description is wrong. </p>
+<p><b>Proposed resolution:</b></p>
+<p>In 27.5.2.4.4 <a href="lib-iostreams.html#lib.streambuf.virt.pback"> [lib.streambuf.virt.pback]</a>, paragraph 1, change:</p>
+
+<blockquote>
+ <p>&quot;<tt>traits::eq(*gptr(),traits::to_char_type( c))</tt>&quot;</p>
+</blockquote>
+
+<p>to </p>
+
+<blockquote>
+ <p>&quot;<tt>traits::eq(traits::to_char_type(c),gptr()[-1])</tt>&quot;
+ </p>
+</blockquote>
+<p><b>Rationale:</b></p>
+<p>Note deliberate reordering of arguments for clarity in addition to the correction of
+the argument value.</p>
+<hr>
+<a name="33"><h3>33.&nbsp;Codecvt&lt;&gt; mentions from_type</h3></a><p>
+<b>Section:</b>&nbsp;22.2.1.5.2 <a href="lib-locales.html#lib.locale.codecvt.virtuals"> [lib.locale.codecvt.virtuals]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Nathan Myers&nbsp; <b>Date:</b>&nbsp;6 Aug 1998</p>
+<p>In the table defining the results from do_out and do_in, the specification for the
+result <i>error</i> says </p>
+
+<blockquote>
+ <p>encountered a from_type character it could not convert </p>
+</blockquote>
+
+<p>but from_type is not defined. This clearly is intended to be an externT for do_in, or
+an internT for do_out. </p>
+<p><b>Proposed resolution:</b></p>
+<p>In 22.2.1.5.2 <a href="lib-locales.html#lib.locale.codecvt.virtuals"> [lib.locale.codecvt.virtuals]</a> paragraph 4, replace the definition
+in the table for the case of _error_ with </p>
+
+<blockquote>
+ <p>encountered a character in <tt>[from,from_end)</tt> that it could not convert. </p>
+</blockquote>
+<hr>
+<a name="34"><h3>34.&nbsp;True/falsename() not in ctype&lt;&gt;</h3></a><p>
+<b>Section:</b>&nbsp;22.2.2.2.2 <a href="lib-locales.html#lib.facet.num.put.virtuals"> [lib.facet.num.put.virtuals]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Nathan Myers&nbsp; <b>Date:</b>&nbsp;6 Aug 1998</p>
+<p>In paragraph 19, Effects:, members truename() and falsename are used from facet
+ctype&lt;charT&gt;, but it has no such members. Note that this is also a problem in
+22.2.2.1.2, addressed in (4). </p>
+<p><b>Proposed resolution:</b></p>
+<p>In 22.2.2.2.2 <a href="lib-locales.html#lib.facet.num.put.virtuals"> [lib.facet.num.put.virtuals]</a>, paragraph 19, in the Effects:
+clause for member put(...., bool), replace the initialization of the
+string_type value s as follows: </p>
+
+<blockquote>
+ <pre>const numpunct&amp; np = use_facet&lt;numpunct&lt;charT&gt; &gt;(loc);
+string_type s = val ? np.truename() : np.falsename(); </pre>
+</blockquote>
+<hr>
+<a name="35"><h3>35.&nbsp;No manipulator unitbuf in synopsis</h3></a><p>
+<b>Section:</b>&nbsp;27.4 <a href="lib-iostreams.html#lib.iostreams.base"> [lib.iostreams.base]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Nathan Myers&nbsp; <b>Date:</b>&nbsp;6 Aug 1998</p>
+<p>In 27.4.5.1 <a href="lib-iostreams.html#lib.fmtflags.manip"> [lib.fmtflags.manip]</a>, we have a definition for a manipulator
+named &quot;unitbuf&quot;. Unlike other manipulators, it's not listed
+in synopsis. Similarly for &quot;nounitbuf&quot;. </p>
+<p><b>Proposed resolution:</b></p>
+<p>Add to the synopsis for &lt;ios&gt; in 27.4 <a href="lib-iostreams.html#lib.iostreams.base"> [lib.iostreams.base]</a>, after
+the entry for &quot;nouppercase&quot;, the prototypes: </p>
+
+<blockquote>
+ <pre>ios_base&amp; unitbuf(ios_base&amp; str);
+ios_base&amp; nounitbuf(ios_base&amp; str); </pre>
+</blockquote>
+<hr>
+<a name="36"><h3>36.&nbsp;Iword &amp; pword storage lifetime omitted</h3></a><p>
+<b>Section:</b>&nbsp;27.4.2.5 <a href="lib-iostreams.html#lib.ios.base.storage"> [lib.ios.base.storage]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Nathan Myers&nbsp; <b>Date:</b>&nbsp;6 Aug 1998</p>
+<p>In the definitions for ios_base::iword and pword, the lifetime of the storage is
+specified badly, so that an implementation which only keeps the last value stored appears
+to conform. In particular, it says: </p>
+
+<p>The reference returned may become invalid after another call to the object's iword
+member with a different index ... </p>
+
+<p>This is not idle speculation; at least one implementation was done this way. </p>
+<p><b>Proposed resolution:</b></p>
+<p>Add in 27.4.2.5 <a href="lib-iostreams.html#lib.ios.base.storage"> [lib.ios.base.storage]</a>, in both paragraph 2 and also in
+paragraph 4, replace the sentence: </p>
+
+<blockquote>
+ <p>The reference returned may become invalid after another call to the object's iword
+ [pword] member with a different index, after a call to its copyfmt member, or when the
+ object is destroyed. </p>
+</blockquote>
+
+<p>with: </p>
+
+<blockquote>
+ <p>The reference returned is invalid after any other operations on the object. However,
+ the value of the storage referred to is retained, so that until the next call to copyfmt,
+ calling iword [pword] with the same index yields another reference to the same value. </p>
+</blockquote>
+
+<p>substituting &quot;iword&quot; or &quot;pword&quot; as appropriate. </p>
+<hr>
+<a name="37"><h3>37.&nbsp;Leftover &quot;global&quot; reference</h3></a><p>
+<b>Section:</b>&nbsp;22.1.1 <a href="lib-locales.html#lib.locale"> [lib.locale]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Nathan Myers&nbsp; <b>Date:</b>&nbsp;6 Aug 1998</p>
+<p>In the overview of locale semantics, paragraph 4, is the sentence </p>
+
+<blockquote>
+ <p>If Facet is not present in a locale (or, failing that, in the global locale), it throws
+ the standard exception bad_cast. </p>
+</blockquote>
+
+<p>This is not supported by the definition of use_facet&lt;&gt;, and represents semantics
+from an old draft. </p>
+<p><b>Proposed resolution:</b></p>
+<p>In 22.1.1 <a href="lib-locales.html#lib.locale"> [lib.locale]</a>, paragraph 4, delete the parenthesized
+expression </p>
+
+<blockquote>
+ <p>(or, failing that, in the global locale) </p>
+</blockquote>
+<hr>
+<a name="38"><h3>38.&nbsp;Facet definition incomplete</h3></a><p>
+<b>Section:</b>&nbsp;22.1.2 <a href="lib-locales.html#lib.locale.global.templates"> [lib.locale.global.templates]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Nathan Myers&nbsp; <b>Date:</b>&nbsp;6 Aug 1998</p>
+<p>It has been noticed by Esa Pulkkinen that the definition of
+&quot;facet&quot; is incomplete. In particular, a class derived from
+another facet, but which does not define a member <i>id</i>, cannot
+safely serve as the argument <i>F</i> to use_facet&lt;F&gt;(loc),
+because there is no guarantee that a reference to the facet instance
+stored in <i>loc</i> is safely convertible to <i>F</i>. </p>
+<p><b>Proposed resolution:</b></p>
+<p>In the definition of std::use_facet&lt;&gt;(), replace the text in paragraph 1 which
+reads: </p>
+
+<blockquote>
+ <p>Get a reference to a facet of a locale. </p>
+</blockquote>
+
+<p>with: </p>
+
+<blockquote>
+ <p>Requires: <tt>Facet</tt> is a facet class whose definition
+ contains the public static member <tt>id</tt> as defined in 22.1.1.1.2 <a href="lib-locales.html#lib.locale.facet"> [lib.locale.facet]</a>. </p>
+</blockquote>
+
+<p><i>[
+Kona: strike as overspecification the text &quot;(not inherits)&quot;
+from the original resolution, which read &quot;... whose definition
+contains (not inherits) the public static member
+<tt>id</tt>...&quot;
+]</i></p>
+
+<hr>
+<a name="39"><h3>39.&nbsp;istreambuf_iterator&lt;&gt;::operator++(int) definition garbled</h3></a><p>
+<b>Section:</b>&nbsp;24.5.3.4 <a href="lib-iterators.html#lib.istreambuf.iterator::op++"> [lib.istreambuf.iterator::op++]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Nathan Myers&nbsp; <b>Date:</b>&nbsp;6 Aug 1998</p>
+<p>Following the definition of istreambuf_iterator&lt;&gt;::operator++(int) in paragraph
+3, the standard contains three lines of garbage text left over from a previous edit. </p>
+
+<blockquote>
+ <pre>istreambuf_iterator&lt;charT,traits&gt; tmp = *this;
+sbuf_-&gt;sbumpc();
+return(tmp); </pre>
+</blockquote>
+<p><b>Proposed resolution:</b></p>
+<p>In 24.5.3.4 <a href="lib-iterators.html#lib.istreambuf.iterator::op++"> [lib.istreambuf.iterator::op++]</a>, delete the three lines of code at the
+end of paragraph 3. </p>
+<hr>
+<a name="40"><h3>40.&nbsp;Meaningless normative paragraph in examples</h3></a><p>
+<b>Section:</b>&nbsp;22.2.8 <a href="lib-locales.html#lib.facets.examples"> [lib.facets.examples]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Nathan Myers&nbsp; <b>Date:</b>&nbsp;6 Aug 1998</p>
+<p>Paragraph 3 of the locale examples is a description of part of an
+implementation technique that has lost its referent, and doesn't mean
+anything. </p>
+<p><b>Proposed resolution:</b></p>
+<p>Delete 22.2.8 <a href="lib-locales.html#lib.facets.examples"> [lib.facets.examples]</a> paragraph 3 which begins &quot;This
+initialization/identification system depends...&quot;, or (at the
+editor's option) replace it with a place-holder to keep the paragraph
+numbering the same. </p>
+<hr>
+<a name="41"><h3>41.&nbsp;Ios_base needs clear(), exceptions()</h3></a><p>
+<b>Section:</b>&nbsp;27.4.2 <a href="lib-iostreams.html#lib.ios.base"> [lib.ios.base]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Nathan Myers&nbsp; <b>Date:</b>&nbsp;6 Aug 1998</p>
+<p>The description of ios_base::iword() and pword() in 27.4.2.4 <a href="lib-iostreams.html#lib.ios.members.static"> [lib.ios.members.static]</a>, say that if they fail, they &quot;set badbit,
+which may throw an exception&quot;. However, ios_base offers no
+interface to set or to test badbit; those interfaces are defined in
+basic_ios&lt;&gt;. </p>
+<p><b>Proposed resolution:</b></p>
+<p>Change the description in 27.4.2.5 <a href="lib-iostreams.html#lib.ios.base.storage"> [lib.ios.base.storage]</a> in
+paragraph 2, and also in paragraph 4, as follows. Replace</p>
+
+<blockquote>
+ <p>If the function fails it sets badbit, which may throw an exception.</p>
+</blockquote>
+
+<p>with</p>
+
+<blockquote>
+ <p>If the function fails, and <tt>*this</tt> is a base sub-object of
+ a <tt>basic_ios&lt;&gt;</tt> object or sub-object, the effect is
+ equivalent to calling <tt>basic_ios&lt;&gt;::setstate(badbit)</tt>
+ on the derived object (which may throw <tt>failure</tt>).</p>
+</blockquote>
+
+<p><i>[Kona: LWG reviewed wording; setstate(failbit) changed to
+setstate(badbit).]</i></p>
+
+<hr>
+<a name="42"><h3>42.&nbsp;String ctors specify wrong default allocator</h3></a><p>
+<b>Section:</b>&nbsp;21.3 <a href="lib-strings.html#lib.basic.string"> [lib.basic.string]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Nathan Myers&nbsp; <b>Date:</b>&nbsp;6 Aug 1998</p>
+<p>The basic_string&lt;&gt; copy constructor: </p>
+
+<pre>basic_string(const basic_string&amp; str, size_type pos = 0,
+ size_type n = npos, const Allocator&amp; a = Allocator()); </pre>
+
+<p>specifies an Allocator argument default value that is
+counter-intuitive. The natural choice for a the allocator to copy from
+is str.get_allocator(). Though this cannot be expressed in
+default-argument notation, overloading suffices. </p>
+
+<p>Alternatively, the other containers in Clause 23 (deque, list,
+vector) do not have this form of constructor, so it is inconsistent,
+and an evident source of confusion, for basic_string&lt;&gt; to have
+it, so it might better be removed. </p>
+<p><b>Proposed resolution:</b></p>
+<p> In 21.3 <a href="lib-strings.html#lib.basic.string"> [lib.basic.string]</a>, replace the declaration of the copy
+constructor as follows: </p>
+
+<blockquote>
+ <pre>basic_string(const basic_string&amp; str);
+basic_string(const basic_string&amp; str, size_type pos, size_type n = npos,
+ const Allocator&amp; a = Allocator());</pre>
+</blockquote>
+
+<p>In 21.3.1 <a href="lib-strings.html#lib.string.cons"> [lib.string.cons]</a>, replace the copy constructor declaration
+as above. Add to paragraph 5, Effects:</p>
+
+<blockquote>
+ <p>In the first form, the Allocator value used is copied from
+ <tt>str.get_allocator()</tt>.</p>
+</blockquote>
+<p><b>Rationale:</b></p>
+<p>The LWG believes the constructor is actually broken, rather than
+just an unfortunate design choice.</p>
+
+<p>The LWG considered two other possible resolutions:</p>
+
+<p>A. In 21.3 <a href="lib-strings.html#lib.basic.string"> [lib.basic.string]</a>, replace the declaration of the copy
+constructor as follows:</p>
+
+<blockquote>
+ <pre>basic_string(const basic_string&amp; str, size_type pos = 0,
+ size_type n = npos);
+basic_string(const basic_string&amp; str, size_type pos,
+ size_type n, const Allocator&amp; a); </pre>
+</blockquote>
+
+<p>In 21.3.1 <a href="lib-strings.html#lib.string.cons"> [lib.string.cons]</a>, replace the copy constructor declaration
+as above. Add to paragraph 5, Effects: </p>
+
+<blockquote>
+ <p>When no <tt>Allocator</tt> argument is provided, the string is constructed using the
+ value <tt>str.get_allocator()</tt>. </p>
+</blockquote>
+
+<p>B. In 21.3 <a href="lib-strings.html#lib.basic.string"> [lib.basic.string]</a>, and also in 21.3.1 <a href="lib-strings.html#lib.string.cons"> [lib.string.cons]</a>, replace
+the declaration of the copy constructor as follows: </p>
+
+<blockquote>
+ <pre>basic_string(const basic_string&amp; str, size_type pos = 0,
+ size_type n = npos); </pre>
+</blockquote>
+
+<p>The proposed resolution reflects the original intent of the LWG. It
+was also noted by Pete Becker that this fix &quot;will cause
+a small amount of existing code to now work correctly.&quot;</p>
+
+<p><i>[
+Kona: issue editing snafu fixed - the proposed resolution now correctly
+reflects the LWG consensus.
+]</i></p>
+<hr>
+<a name="46"><h3>46.&nbsp;Minor Annex D errors</h3></a><p>
+<b>Section:</b>&nbsp;D.7 <a href="future.html#depr.str.strstreams"> [depr.str.strstreams]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Brendan Kehoe&nbsp; <b>Date:</b>&nbsp; 1 Jun 1998</p>
+<p>See lib-6522 and edit-814.</p>
+<p><b>Proposed resolution:</b></p>
+<p>Change D.7.1 <a href="future.html#depr.strstreambuf"> [depr.strstreambuf]</a> (since streambuf is a typedef of
+basic_streambuf&lt;char&gt;) from:</p>
+
+<pre> virtual streambuf&lt;char&gt;* setbuf(char* s, streamsize n);</pre>
+
+<p>to:</p>
+
+<pre> virtual streambuf* setbuf(char* s, streamsize n);</pre>
+
+<p>In D.7.4 <a href="future.html#depr.strstream"> [depr.strstream]</a> insert the semicolon now missing after
+int_type:</p>
+
+<pre> namespace std {
+ class strstream
+ : public basic_iostream&lt;char&gt; {
+ public:
+ // Types
+ typedef char char_type;
+ typedef typename char_traits&lt;char&gt;::int_type int_type
+ typedef typename char_traits&lt;char&gt;::pos_type pos_type;</pre>
+<hr>
+<a name="47"><h3>47.&nbsp;Imbue() and getloc() Returns clauses swapped</h3></a><p>
+<b>Section:</b>&nbsp;27.4.2.3 <a href="lib-iostreams.html#lib.ios.base.locales"> [lib.ios.base.locales]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Matt Austern&nbsp; <b>Date:</b>&nbsp;21 Jun 1998</p>
+<p>Section 27.4.2.3 specifies how imbue() and getloc() work. That
+section has two RETURNS clauses, and they make no sense as
+stated. They make perfect sense, though, if you swap them. Am I
+correct in thinking that paragraphs 2 and 4 just got mixed up by
+accident?</p>
+<p><b>Proposed resolution:</b></p>
+<p>In 27.4.2.3 <a href="lib-iostreams.html#lib.ios.base.locales"> [lib.ios.base.locales]</a> swap paragraphs 2 and 4.</p>
+<hr>
+<a name="48"><h3>48.&nbsp;Use of non-existent exception constructor</h3></a><p>
+<b>Section:</b>&nbsp;27.4.2.1.1 <a href="lib-iostreams.html#lib.ios::failure"> [lib.ios::failure]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Matt Austern&nbsp; <b>Date:</b>&nbsp;21 Jun 1998</p>
+<p>27.4.2.1.1, paragraph 2, says that class failure initializes the
+base class, exception, with exception(msg). Class exception (see
+18.6.1) has no such constructor.</p>
+<p><b>Proposed resolution:</b></p>
+<p>Replace 27.4.2.1.1 <a href="lib-iostreams.html#lib.ios::failure"> [lib.ios::failure]</a>, paragraph 2, with</p>
+
+<blockquote>
+ <p>EFFECTS: Constructs an object of class <tt>failure</tt>.</p>
+</blockquote>
+<hr>
+<a name="49"><h3>49.&nbsp;Underspecification of ios_base::sync_with_stdio</h3></a><p>
+<b>Section:</b>&nbsp;27.4.2.4 <a href="lib-iostreams.html#lib.ios.members.static"> [lib.ios.members.static]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Matt Austern&nbsp; <b>Date:</b>&nbsp;21 Jun 1998</p>
+<p>Two problems</p>
+
+<p>(1) 27.4.2.4 doesn't say what ios_base::sync_with_stdio(f)
+returns. Does it return f, or does it return the previous
+synchronization state? My guess is the latter, but the standard
+doesn't say so.</p>
+
+<p>(2) 27.4.2.4 doesn't say what it means for streams to be
+synchronized with stdio. Again, of course, I can make some
+guesses. (And I'm unhappy about the performance implications of those
+guesses, but that's another matter.)</p>
+<p><b>Proposed resolution:</b></p>
+<p>Change the following sentence in 27.4.2.4 <a href="lib-iostreams.html#lib.ios.members.static"> [lib.ios.members.static]</a>
+returns clause from:</p>
+
+<blockquote>
+ <p>
+<tt>true</tt> if the standard iostream objects (27.3) are
+ synchronized and otherwise returns <tt>false</tt>.</p>
+</blockquote>
+
+<p>to:</p>
+
+<blockquote>
+ <p>
+<tt>true</tt> if the previous state of the standard iostream
+ objects (27.3) was synchronized and otherwise returns
+ <tt>false</tt>.</p>
+</blockquote>
+
+<p>Add the following immediately after 27.4.2.4 <a href="lib-iostreams.html#lib.ios.members.static"> [lib.ios.members.static]</a>,
+paragraph 2:</p>
+
+<blockquote>
+<p>When a standard iostream object str is <i>synchronized</i> with a
+standard stdio stream f, the effect of inserting a character c by</p>
+<pre>
+ fputc(f, c);
+</pre>
+
+<p>is the same as the effect of</p>
+<pre>
+ str.rdbuf()-&gt;sputc(c);
+</pre>
+
+<p>for any sequence of characters; the effect of extracting a
+character c by</p>
+<pre>
+ c = fgetc(f);
+</pre>
+
+<p>is the same as the effect of:</p>
+<pre>
+ c = str.rdbuf()-&gt;sbumpc(c);
+</pre>
+
+<p>for any sequences of characters; and the effect of pushing
+back a character c by</p>
+<pre>
+ ungetc(c, f);
+</pre>
+
+<p>is the same as the effect of</p>
+<pre>
+ str.rdbuf()-&gt;sputbackc(c);
+</pre>
+
+<p>for any sequence of characters. [<i>Footnote</i>: This implies
+that operations on a standard iostream object can be mixed arbitrarily
+with operations on the corresponding stdio stream. In practical
+terms, synchronization usually means that a standard iostream object
+and a standard stdio object share a buffer. <i>--End Footnote</i>]</p>
+</blockquote>
+
+<p><i>[pre-Copenhagen: PJP and Matt contributed the definition
+of &quot;synchronization&quot;]</i></p>
+
+<p><i>[post-Copenhagen: proposed resolution was revised slightly:
+text was added in the non-normative footnote to say that operations
+on the two streams can be mixed arbitrarily.]</i></p>
+<hr>
+<a name="50"><h3>50.&nbsp;Copy constructor and assignment operator of ios_base</h3></a><p>
+<b>Section:</b>&nbsp;27.4.2 <a href="lib-iostreams.html#lib.ios.base"> [lib.ios.base]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Matt Austern&nbsp; <b>Date:</b>&nbsp;21 Jun 1998</p>
+<p>As written, ios_base has a copy constructor and an assignment
+operator. (Nothing in the standard says it doesn't have one, and all
+classes have copy constructors and assignment operators unless you
+take specific steps to avoid them.) However, nothing in 27.4.2 says
+what the copy constructor and assignment operator do. </p>
+
+<p>My guess is that this was an oversight, that ios_base is, like
+basic_ios, not supposed to have a copy constructor or an assignment
+operator.</p>
+
+<p>
+Jerry Schwarz comments: Yes, its an oversight, but in the opposite
+sense to what you're suggesting. At one point there was a definite
+intention that you could copy ios_base. It's an easy way to save the
+entire state of a stream for future use. As you note, to carry out
+that intention would have required a explicit description of the
+semantics (e.g. what happens to the iarray and parray stuff).
+</p>
+<p><b>Proposed resolution:</b></p>
+<p>In 27.4.2 <a href="lib-iostreams.html#lib.ios.base"> [lib.ios.base]</a>, class ios_base, specify the copy
+constructor and operator= members as being private.</p>
+<p><b>Rationale:</b></p>
+<p>The LWG believes the difficulty of specifying correct semantics
+outweighs any benefit of allowing ios_base objects to be copyable.</p>
+<hr>
+<a name="51"><h3>51.&nbsp;Requirement to not invalidate iterators missing</h3></a><p>
+<b>Section:</b>&nbsp;23.1 <a href="lib-containers.html#lib.container.requirements"> [lib.container.requirements]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;David Vandevoorde&nbsp; <b>Date:</b>&nbsp;23 Jun 1998</p>
+<p>The std::sort algorithm can in general only sort a given sequence
+by moving around values. The list&lt;&gt;::sort() member on the other
+hand could move around values or just update internal pointers. Either
+method can leave iterators into the list&lt;&gt; dereferencable, but
+they would point to different things. </p>
+
+<p>Does the FDIS mandate anywhere which method should be used for
+list&lt;&gt;::sort()?</p>
+
+<p>Matt Austern comments:</p>
+
+<p>I think you've found an omission in the standard. </p>
+
+<p>The library working group discussed this point, and there was
+supposed to be a general requirement saying that list, set, map,
+multiset, and multimap may not invalidate iterators, or change the
+values that iterators point to, except when an operation does it
+explicitly. So, for example, insert() doesn't invalidate any iterators
+and erase() and remove() only invalidate iterators pointing to the
+elements that are being erased. </p>
+
+<p>I looked for that general requirement in the FDIS, and, while I
+found a limited form of it for the sorted associative containers, I
+didn't find it for list. It looks like it just got omitted. </p>
+
+<p>The intention, though, is that list&lt;&gt;::sort does not
+invalidate any iterators and does not change the values that any
+iterator points to. There would be no reason to have the member
+function otherwise.</p>
+<p><b>Proposed resolution:</b></p>
+<p>Add a new paragraph at the end of 23.1:</p>
+
+<blockquote>
+ <p>Unless otherwise specified (either explicitly or by defining a function in terms of
+ other functions), invoking a container member function or passing a container as an
+ argument to a library function shall not invalidate iterators to, or change the values of,
+ objects within that container. </p>
+</blockquote>
+<p><b>Rationale:</b></p>
+<p>This was US issue CD2-23-011; it was accepted in London but the
+change was not made due to an editing oversight. The wording in the
+proposed resolution below is somewhat updated from CD2-23-011,
+particularly the addition of the phrase &quot;or change the values
+of&quot;</p>
+<hr>
+<a name="52"><h3>52.&nbsp;Small I/O problems</h3></a><p>
+<b>Section:</b>&nbsp;27.4.3.2 <a href="lib-iostreams.html#lib.fpos.operations"> [lib.fpos.operations]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Matt Austern&nbsp; <b>Date:</b>&nbsp;23 Jun 1998</p>
+<p>First, 27.4.4.1 <a href="lib-iostreams.html#lib.basic.ios.cons"> [lib.basic.ios.cons]</a>, table 89. This is pretty obvious:
+it should be titled &quot;basic_ios&lt;&gt;() effects&quot;, not
+&quot;ios_base() effects&quot;. </p>
+
+<p>[The second item is a duplicate; see issue <a href="lwg-closed.html#6">6</a> for
+resolution.]</p>
+
+<p>Second, 27.4.3.2 <a href="lib-iostreams.html#lib.fpos.operations"> [lib.fpos.operations]</a> table 88 . There are a couple
+different things wrong with it, some of which I've already discussed
+with Jerry, but the most obvious mechanical sort of error is that it
+uses expressions like P(i) and p(i), without ever defining what sort
+of thing &quot;i&quot; is.
+</p>
+
+<p>(The other problem is that it requires support for streampos
+arithmetic. This is impossible on some systems, i.e. ones where file
+position is a complicated structure rather than just a number. Jerry
+tells me that the intention was to require syntactic support for
+streampos arithmetic, but that it wasn't actually supposed to do
+anything meaningful except on platforms, like Unix, where genuine
+arithmetic is possible.) </p>
+<p><b>Proposed resolution:</b></p>
+<p>Change 27.4.4.1 <a href="lib-iostreams.html#lib.basic.ios.cons"> [lib.basic.ios.cons]</a> table 89 title from
+&quot;ios_base() effects&quot; to &quot;basic_ios&lt;&gt;()
+effects&quot;. </p>
+<hr>
+<a name="53"><h3>53.&nbsp;Basic_ios destructor unspecified</h3></a><p>
+<b>Section:</b>&nbsp;27.4.4.1 <a href="lib-iostreams.html#lib.basic.ios.cons"> [lib.basic.ios.cons]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Matt Austern&nbsp; <b>Date:</b>&nbsp;23 Jun 1998</p>
+<p>There's nothing in 27.4.4 saying what basic_ios's destructor does.
+The important question is whether basic_ios::~basic_ios() destroys
+rdbuf().</p>
+<p><b>Proposed resolution:</b></p>
+<p>Add after 27.4.4.1 <a href="lib-iostreams.html#lib.basic.ios.cons"> [lib.basic.ios.cons]</a> paragraph 2:</p>
+
+<blockquote>
+ <p><tt>virtual ~basic_ios();</tt></p>
+ <p>
+<b>Notes</b>: The destructor does not destroy <tt>rdbuf()</tt>.</p>
+</blockquote>
+<p><b>Rationale:</b></p>
+<p>The LWG reviewed the additional question of whether or not
+<tt>rdbuf(0)</tt> may set <tt>badbit</tt>. The answer is
+clearly yes; it may be set via <tt>clear()</tt>. See 27.4.4.2 <a href="lib-iostreams.html#lib.basic.ios.members"> [lib.basic.ios.members]</a>, paragraph 6. This issue was reviewed at length
+by the LWG, which removed from the original proposed resolution a
+footnote which incorrectly said &quot;<tt>rdbuf(0)</tt> does not set
+<tt>badbit</tt>&quot;.</p>
+<hr>
+<a name="54"><h3>54.&nbsp;Basic_streambuf's destructor</h3></a><p>
+<b>Section:</b>&nbsp;27.5.2.1 <a href="lib-iostreams.html#lib.streambuf.cons"> [lib.streambuf.cons]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Matt Austern&nbsp; <b>Date:</b>&nbsp;25 Jun 1998</p>
+<p>The class synopsis for basic_streambuf shows a (virtual)
+destructor, but the standard doesn't say what that destructor does. My
+assumption is that it does nothing, but the standard should say so
+explicitly. </p>
+<p><b>Proposed resolution:</b></p>
+<p>Add after 27.5.2.1 <a href="lib-iostreams.html#lib.streambuf.cons"> [lib.streambuf.cons]</a> paragraph 2:</p>
+
+<blockquote>
+ <p><tt>virtual&nbsp; ~basic_streambuf();</tt></p>
+ <p>
+<b>Effects</b>: None.</p>
+</blockquote>
+<hr>
+<a name="55"><h3>55.&nbsp;Invalid stream position is undefined</h3></a><p>
+<b>Section:</b>&nbsp;27 <a href="lib-iostreams.html#lib.input.output"> [lib.input.output]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Matt Austern&nbsp; <b>Date:</b>&nbsp;26 Jun 1998</p>
+<p>Several member functions in clause 27 are defined in certain
+circumstances to return an &quot;invalid stream position&quot;, a term
+that is defined nowhere in the standard. Two places (27.5.2.4.2,
+paragraph 4, and 27.8.1.4, paragraph 15) contain a cross-reference to
+a definition in _lib.iostreams.definitions_, a nonexistent
+section. </p>
+
+<p>I suspect that the invalid stream position is just supposed to be
+pos_type(-1). Probably best to say explicitly in (for example)
+27.5.2.4.2 that the return value is pos_type(-1), rather than to use
+the term &quot;invalid stream position&quot;, define that term
+somewhere, and then put in a cross-reference. </p>
+
+<p>The phrase &quot;invalid stream position&quot; appears ten times in
+the C++ Standard. In seven places it refers to a return value, and it
+should be changed. In three places it refers to an argument, and it
+should not be changed. Here are the three places where &quot;invalid
+stream position&quot; should not be changed:</p>
+
+<blockquote>
+ <p>27.7.1.3 <a href="lib-iostreams.html#lib.stringbuf.virtuals"> [lib.stringbuf.virtuals]</a>, paragraph 14<br>
+ 27.8.1.4 <a href="lib-iostreams.html#lib.filebuf.virtuals"> [lib.filebuf.virtuals]</a>, paragraph 14<br>
+ D.7.1.3 <a href="future.html#depr.strstreambuf.virtuals"> [depr.strstreambuf.virtuals]</a>, paragraph 17
+ </p>
+</blockquote>
+<p><b>Proposed resolution:</b></p>
+<p>In 27.5.2.4.2 <a href="lib-iostreams.html#lib.streambuf.virt.buffer"> [lib.streambuf.virt.buffer]</a>, paragraph 4, change &quot;Returns an
+object of class pos_type that stores an invalid stream position
+(_lib.iostreams.definitions_)&quot; to &quot;Returns
+<tt>pos_type(off_type(-1))</tt>&quot;.
+</p>
+
+<p>In 27.5.2.4.2 <a href="lib-iostreams.html#lib.streambuf.virt.buffer"> [lib.streambuf.virt.buffer]</a>, paragraph 6, change &quot;Returns
+an object of class pos_type that stores an invalid stream
+position&quot; to &quot;Returns <tt>pos_type(off_type(-1))</tt>&quot;.</p>
+
+<p>In 27.7.1.3 <a href="lib-iostreams.html#lib.stringbuf.virtuals"> [lib.stringbuf.virtuals]</a>, paragraph 13, change &quot;the object
+stores an invalid stream position&quot; to &quot;the return value is
+<tt>pos_type(off_type(-1))</tt>&quot;. </p>
+
+<p>In 27.8.1.4 <a href="lib-iostreams.html#lib.filebuf.virtuals"> [lib.filebuf.virtuals]</a>, paragraph 13, change &quot;returns an
+invalid stream position (27.4.3)&quot; to &quot;returns
+<tt>pos_type(off_type(-1))</tt>&quot; </p>
+
+<p>In 27.8.1.4 <a href="lib-iostreams.html#lib.filebuf.virtuals"> [lib.filebuf.virtuals]</a>, paragraph 15, change &quot;Otherwise
+returns an invalid stream position (_lib.iostreams.definitions_)&quot;
+to &quot;Otherwise returns <tt>pos_type(off_type(-1))</tt>&quot;
+</p>
+
+<p>In D.7.1.3 <a href="future.html#depr.strstreambuf.virtuals"> [depr.strstreambuf.virtuals]</a>, paragraph 15, change &quot;the object
+stores an invalid stream position&quot; to &quot;the return value is
+<tt>pos_type(off_type(-1))</tt>&quot; </p>
+
+<p>In D.7.1.3 <a href="future.html#depr.strstreambuf.virtuals"> [depr.strstreambuf.virtuals]</a>, paragraph 18, change &quot;the object
+stores an invalid stream position&quot; to &quot;the return value is
+<tt>pos_type(off_type(-1))</tt>&quot;</p>
+<hr>
+<a name="56"><h3>56.&nbsp;Showmanyc's return type</h3></a><p>
+<b>Section:</b>&nbsp;27.5.2 <a href="lib-iostreams.html#lib.streambuf"> [lib.streambuf]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Matt Austern&nbsp; <b>Date:</b>&nbsp;29 Jun 1998</p>
+<p>The class summary for basic_streambuf&lt;&gt;, in 27.5.2, says that
+showmanyc has return type int. However, 27.5.2.4.3 says that its
+return type is streamsize. </p>
+<p><b>Proposed resolution:</b></p>
+<p>Change <tt>showmanyc</tt>'s return type in the
+27.5.2 <a href="lib-iostreams.html#lib.streambuf"> [lib.streambuf]</a> class summary to <tt>streamsize</tt>.</p>
+<hr>
+<a name="57"><h3>57.&nbsp;Mistake in char_traits</h3></a><p>
+<b>Section:</b>&nbsp;21.1.3.2 <a href="lib-strings.html#lib.char.traits.specializations.wchar.t"> [lib.char.traits.specializations.wchar.t]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Matt Austern&nbsp; <b>Date:</b>&nbsp;1 Jul 1998</p>
+<p>21.1.3.2, paragraph 3, says &quot;The types streampos and
+wstreampos may be different if the implementation supports no shift
+encoding in narrow-oriented iostreams but supports one or more shift
+encodings in wide-oriented streams&quot;. </p>
+
+<p>That's wrong: the two are the same type. The &lt;iosfwd&gt; summary
+in 27.2 says that streampos and wstreampos are, respectively, synonyms
+for fpos&lt;char_traits&lt;char&gt;::state_type&gt; and
+fpos&lt;char_traits&lt;wchar_t&gt;::state_type&gt;, and, flipping back
+to clause 21, we see in 21.1.3.1 and 21.1.3.2 that
+char_traits&lt;char&gt;::state_type and
+char_traits&lt;wchar_t&gt;::state_type must both be mbstate_t. </p>
+<p><b>Proposed resolution:</b></p>
+<p>Remove the sentence in 21.1.3.2 <a href="lib-strings.html#lib.char.traits.specializations.wchar.t"> [lib.char.traits.specializations.wchar.t]</a> paragraph 3 which
+begins &quot;The types streampos and wstreampos may be
+different...&quot; . </p>
+<hr>
+<a name="59"><h3>59.&nbsp;Ambiguity in specification of gbump</h3></a><p>
+<b>Section:</b>&nbsp;27.5.2.3.1 <a href="lib-iostreams.html#lib.streambuf.get.area"> [lib.streambuf.get.area]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Matt Austern&nbsp; <b>Date:</b>&nbsp;28 Jul 1998</p>
+<p>27.5.2.3.1 says that basic_streambuf::gbump() &quot;Advances the
+next pointer for the input sequence by n.&quot; </p>
+
+<p>The straightforward interpretation is that it is just gptr() +=
+n. An alternative interpretation, though, is that it behaves as if it
+calls sbumpc n times. (The issue, of course, is whether it might ever
+call underflow.) There is a similar ambiguity in the case of
+pbump. </p>
+
+<p>(The &quot;classic&quot; AT&amp;T implementation used the
+former interpretation.)</p>
+<p><b>Proposed resolution:</b></p>
+<p>Change 27.5.2.3.1 <a href="lib-iostreams.html#lib.streambuf.get.area"> [lib.streambuf.get.area]</a> paragraph 4 gbump effects from:</p>
+
+<blockquote>
+ <p>Effects: Advances the next pointer for the input sequence by n.</p>
+</blockquote>
+
+<p>to:</p>
+
+<blockquote>
+ <p>Effects: Adds <tt>n</tt> to the next pointer for the input sequence.</p>
+</blockquote>
+
+<p>Make the same change to 27.5.2.3.2 <a href="lib-iostreams.html#lib.streambuf.put.area"> [lib.streambuf.put.area]</a> paragraph 4 pbump
+effects.</p>
+<hr>
+<a name="60"><h3>60.&nbsp;What is a formatted input function?</h3></a><p>
+<b>Section:</b>&nbsp;27.6.1.2.1 <a href="lib-iostreams.html#lib.istream.formatted.reqmts"> [lib.istream.formatted.reqmts]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Matt Austern&nbsp; <b>Date:</b>&nbsp;3 Aug 1998</p>
+<p>Paragraph 1 of 27.6.1.2.1 contains general requirements for all
+formatted input functions. Some of the functions defined in section
+27.6.1.2 explicitly say that those requirements apply (&quot;Behaves
+like a formatted input member (as described in 27.6.1.2.1)&quot;), but
+others don't. The question: is 27.6.1.2.1 supposed to apply to
+everything in 27.6.1.2, or only to those member functions that
+explicitly say &quot;behaves like a formatted input member&quot;? Or
+to put it differently: are we to assume that everything that appears
+in a section called &quot;Formatted input functions&quot; really is a
+formatted input function? I assume that 27.6.1.2.1 is intended to
+apply to the arithmetic extractors (27.6.1.2.2), but I assume that it
+is not intended to apply to extractors like </p>
+
+<pre> basic_istream&amp; operator&gt;&gt;(basic_istream&amp; (*pf)(basic_istream&amp;));</pre>
+
+<p>and </p>
+
+<pre> basic_istream&amp; operator&gt;&gt;(basic_streammbuf*);</pre>
+
+<p>There is a similar ambiguity for unformatted input, formatted output, and unformatted
+output. </p>
+
+<p>Comments from Judy Ward: It seems like the problem is that the
+basic_istream and basic_ostream operator &lt;&lt;()'s that are used
+for the manipulators and streambuf* are in the wrong section and
+should have their own separate section or be modified to make it clear
+that the &quot;Common requirements&quot; listed in section 27.6.1.2.1
+(for basic_istream) and section 27.6.2.5.1 (for basic_ostream) do not
+apply to them. </p>
+
+<p>Additional comments from Dietmar K&uuml;hl: It appears to be somewhat
+nonsensical to consider the functions defined in 27.6.1.2.3 <a href="lib-iostreams.html#lib.istream::extractors"> [lib.istream::extractors]</a> paragraphs 1 to 5 to be &quot;Formatted input
+function&quot; but since these functions are defined in a section
+labeled &quot;Formatted input functions&quot; it is unclear to me
+whether these operators are considered formatted input functions which
+have to conform to the &quot;common requirements&quot; from 27.6.1.2.1 <a href="lib-iostreams.html#lib.istream.formatted.reqmts"> [lib.istream.formatted.reqmts]</a>: If this is the case, all manipulators, not
+just <tt>ws</tt>, would skip whitespace unless <tt>noskipws</tt> is
+set (... but setting <tt>noskipws</tt> using the manipulator syntax
+would also skip whitespace :-)</p> <p>It is not clear which functions
+are to be considered unformatted input functions. As written, it seems
+that all functions in 27.6.1.3 <a href="lib-iostreams.html#lib.istream.unformatted"> [lib.istream.unformatted]</a> are unformatted input
+functions. However, it does not really make much sense to construct a
+sentry object for <tt>gcount()</tt>, <tt>sync()</tt>, ... Also it is
+unclear what happens to the <tt>gcount()</tt> if
+eg. <tt>gcount()</tt>, <tt>putback()</tt>, <tt>unget()</tt>, or
+<tt>sync()</tt> is called: These functions don't extract characters,
+some of them even &quot;unextract&quot; a character. Should this still
+be reflected in <tt>gcount()</tt>? Of course, it could be read as if
+after a call to <tt>gcount()</tt> <tt>gcount()</tt> return <tt>0</tt>
+(the last unformatted input function, <tt>gcount()</tt>, didn't
+extract any character) and after a call to <tt>putback()</tt>
+<tt>gcount()</tt> returns <tt>-1</tt> (the last unformatted input
+function <tt>putback()</tt> did &quot;extract&quot; back into the
+stream). Correspondingly for <tt>unget()</tt>. Is this what is
+intended? If so, this should be clarified. Otherwise, a corresponding
+clarification should be used.</p>
+<p><b>Proposed resolution:</b></p>
+<p>
+In 27.6.1.2.2 [lib.istream.formatted.arithmetic], paragraph 1.
+Change the beginning of the second sentence from &quot;The conversion
+occurs&quot; to &quot;These extractors behave as formatted input functions (as
+described in 27.6.1.2.1). After a sentry object is constructed,
+the conversion occurs&quot;
+</p>
+
+<p>
+In 27.6.1.2.3, [lib.istream::extractors], before paragraph 1.
+Add an effects clause. &quot;Effects: None. This extractor does
+not behave as a formatted input function (as described in
+27.6.1.2.1).
+</p>
+
+<p>
+In 27.6.1.2.3, [lib.istream::extractors], paragraph 2. Change the
+effects clause to &quot;Effects: Calls pf(*this). This extractor does not
+behave as a formatted input function (as described in 27.6.1.2.1).
+</p>
+
+<p>
+In 27.6.1.2.3, [lib.istream::extractors], paragraph 4. Change the
+effects clause to &quot;Effects: Calls pf(*this). This extractor does not
+behave as a formatted input function (as described in 27.6.1.2.1).
+</p>
+
+<p>
+In 27.6.1.2.3, [lib.istream::extractors], paragraph 12. Change the
+first two sentences from &quot;If sb is null, calls setstate(failbit),
+which may throw ios_base::failure (27.4.4.3). Extracts characters
+from *this...&quot; to &quot;Behaves as a formatted input function (as described
+in 27.6.1.2.1). If sb is null, calls setstate(failbit), which may
+throw ios_base::failure (27.4.4.3). After a sentry object is
+constructed, extracts characters from *this...&quot;.
+</p>
+
+<p>
+In 27.6.1.3, [lib.istream.unformatted], before paragraph 2. Add an
+effects clause. &quot;Effects: none. This member function does not behave
+as an unformatted input function (as described in 27.6.1.3, paragraph 1).&quot;
+</p>
+
+<p>
+In 27.6.1.3, [lib.istream.unformatted], paragraph 3. Change the
+beginning of the first sentence of the effects clause from &quot;Extracts a
+character&quot; to &quot;Behaves as an unformatted input function (as described
+in 27.6.1.3, paragraph 1). After constructing a sentry object, extracts a
+character&quot;
+</p>
+
+<p>
+In 27.6.1.3, [lib.istream.unformatted], paragraph 5. Change the
+beginning of the first sentence of the effects clause from &quot;Extracts a
+character&quot; to &quot;Behaves as an unformatted input function (as described
+in 27.6.1.3, paragraph 1). After constructing a sentry object, extracts a
+character&quot;
+</p>
+
+<p>
+In 27.6.1.3, [lib.istream.unformatted], paragraph 5. Change the
+beginning of the first sentence of the effects clause from &quot;Extracts
+characters&quot; to &quot;Behaves as an unformatted input function (as described
+in 27.6.1.3, paragraph 1). After constructing a sentry object, extracts
+characters&quot;
+</p>
+
+<p>
+[No change needed in paragraph 10, because it refers to paragraph 7.]
+</p>
+
+<p>
+In 27.6.1.3, [lib.istream.unformatted], paragraph 12. Change the
+beginning of the first sentence of the effects clause from &quot;Extracts
+characters&quot; to &quot;Behaves as an unformatted input function (as described
+in 27.6.1.3, paragraph 1). After constructing a sentry object, extracts
+characters&quot;
+</p>
+
+<p>
+[No change needed in paragraph 15.]
+</p>
+
+<p>
+In 27.6.1.3, [lib.istream.unformatted], paragraph 17. Change the
+beginning of the first sentence of the effects clause from &quot;Extracts
+characters&quot; to &quot;Behaves as an unformatted input function (as described
+in 27.6.1.3, paragraph 1). After constructing a sentry object, extracts
+characters&quot;
+</p>
+
+<p>
+[No change needed in paragraph 23.]
+</p>
+
+<p>
+In 27.6.1.3, [lib.istream.unformatted], paragraph 24. Change the
+beginning of the first sentence of the effects clause from &quot;Extracts
+characters&quot; to &quot;Behaves as an unformatted input function (as described
+in 27.6.1.3, paragraph 1). After constructing a sentry object, extracts
+characters&quot;
+</p>
+
+<p>
+In 27.6.1.3, [lib.istream.unformatted], before paragraph 27. Add an
+Effects clause: &quot;Effects: Behaves as an unformatted input function (as
+described in 27.6.1.3, paragraph 1). After constructing a sentry
+object, reads but does not extract the current input character.&quot;
+</p>
+
+<p>
+In 27.6.1.3, [lib.istream.unformatted], paragraph 28. Change the
+first sentence of the Effects clause from &quot;If !good() calls&quot; to
+Behaves as an unformatted input function (as described in 27.6.1.3,
+paragraph 1). After constructing a sentry object, if !good() calls&quot;
+</p>
+
+<p>
+In 27.6.1.3, [lib.istream.unformatted], paragraph 30. Change the
+first sentence of the Effects clause from &quot;If !good() calls&quot; to
+&quot;Behaves as an unformatted input function (as described in 27.6.1.3,
+paragraph 1). After constructing a sentry object, if !good() calls&quot;
+</p>
+
+<p>
+In 27.6.1.3, [lib.istream.unformatted], paragraph 32. Change the
+first sentence of the Effects clause from &quot;If !good() calls...&quot; to
+&quot;Behaves as an unformatted input function (as described in 27.6.1.3,
+paragraph 1). After constructing a sentry object, if !good()
+calls...&quot; Add a new sentence to the end of the Effects clause:
+&quot;[Note: this function extracts no characters, so the value returned
+by the next call to gcount() is 0.]&quot;
+</p>
+
+<p>
+In 27.6.1.3, [lib.istream.unformatted], paragraph 34. Change the
+first sentence of the Effects clause from &quot;If !good() calls&quot; to
+&quot;Behaves as an unformatted input function (as described in 27.6.1.3,
+paragraph 1). After constructing a sentry object, if !good() calls&quot;.
+Add a new sentence to the end of the Effects clause: &quot;[Note: this
+function extracts no characters, so the value returned by the next
+call to gcount() is 0.]&quot;
+</p>
+
+<p>
+In 27.6.1.3, [lib.istream.unformatted], paragraph 36. Change the
+first sentence of the Effects clause from &quot;If !rdbuf() is&quot; to &quot;Behaves
+as an unformatted input function (as described in 27.6.1.3, paragraph
+1), except that it does not count the number of characters extracted
+and does not affect the value returned by subsequent calls to
+gcount(). After constructing a sentry object, if rdbuf() is&quot;
+</p>
+
+<p>
+In 27.6.1.3, [lib.istream.unformatted], before paragraph 37. Add an
+Effects clause: &quot;Effects: Behaves as an unformatted input function (as
+described in 27.6.1.3, paragraph 1), except that it does not count the
+number of characters extracted and does not affect the value returned
+by subsequent calls to gcount().&quot; Change the first sentence of
+paragraph 37 from &quot;if fail()&quot; to &quot;after constructing a sentry object,
+if fail()&quot;.
+</p>
+
+<p>
+In 27.6.1.3, [lib.istream.unformatted], paragraph 38. Change the
+first sentence of the Effects clause from &quot;If fail()&quot; to &quot;Behaves
+as an unformatted input function (as described in 27.6.1.3, paragraph
+1), except that it does not count the number of characters extracted
+and does not affect the value returned by subsequent calls to
+gcount(). After constructing a sentry object, if fail()
+</p>
+
+<p>
+In 27.6.1.3, [lib.istream.unformatted], paragraph 40. Change the
+first sentence of the Effects clause from &quot;If fail()&quot; to &quot;Behaves
+as an unformatted input function (as described in 27.6.1.3, paragraph
+1), except that it does not count the number of characters extracted
+and does not affect the value returned by subsequent calls to
+gcount(). After constructing a sentry object, if fail()
+</p>
+
+<p>
+In 27.6.2.5.2 [lib.ostream.inserters.arithmetic], paragraph 1. Change
+the beginning of the third sentence from &quot;The formatting conversion&quot;
+to &quot;These extractors behave as formatted output functions (as
+described in 27.6.2.5.1). After the sentry object is constructed, the
+conversion occurs&quot;.
+</p>
+
+<p>
+In 27.6.2.5.3 [lib.ostream.inserters], before paragraph 1. Add an
+effects clause: &quot;Effects: None. Does not behave as a formatted output
+function (as described in 27.6.2.5.1).&quot;.
+</p>
+
+<p>
+In 27.6.2.5.3 [lib.ostream.inserters], paragraph 2. Change the
+effects clause to &quot;Effects: calls pf(*this). This extractor does not
+behave as a formatted output function (as described in 27.6.2.5.1).&quot;.
+</p>
+
+<p>
+In 27.6.2.5.3 [lib.ostream.inserters], paragraph 4. Change the
+effects clause to &quot;Effects: calls pf(*this). This extractor does not
+behave as a formatted output function (as described in 27.6.2.5.1).&quot;.
+</p>
+
+<p>
+In 27.6.2.5.3 [lib.ostream.inserters], paragraph 6. Change the first
+sentence from &quot;If sb&quot; to &quot;Behaves as a formatted output function (as
+described in 27.6.2.5.1). After the sentry object is constructed, if
+sb&quot;.
+</p>
+
+<p>
+In 27.6.2.6 [lib.ostream.unformatted], paragraph 2. Change the first
+sentence from &quot;Inserts the character&quot; to &quot;Behaves as an unformatted
+output function (as described in 27.6.2.6, paragraph 1). After
+constructing a sentry object, inserts the character&quot;.
+</p>
+
+<p>
+In 27.6.2.6 [lib.ostream.unformatted], paragraph 5. Change the first
+sentence from &quot;Obtains characters&quot; to &quot;Behaves as an unformatted
+output function (as described in 27.6.2.6, paragraph 1). After
+constructing a sentry object, obtains characters&quot;.
+</p>
+
+<p>
+In 27.6.2.6 [lib.ostream.unformatted], paragraph 7. Add a new
+sentence at the end of the paragraph: &quot;Does not behave as an
+unformatted output function (as described in 27.6.2.6, paragraph 1).&quot;
+</p>
+<p><b>Rationale:</b></p>
+<p>See J16/99-0043==WG21/N1219, Proposed Resolution to Library Issue 60,
+by Judy Ward and Matt Austern. This proposed resolution is section
+VI of that paper.</p>
+<hr>
+<a name="61"><h3>61.&nbsp;Ambiguity in iostreams exception policy</h3></a><p>
+<b>Section:</b>&nbsp;27.6.1.3 <a href="lib-iostreams.html#lib.istream.unformatted"> [lib.istream.unformatted]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Matt Austern&nbsp; <b>Date:</b>&nbsp;6 Aug 1998</p>
+<p>The introduction to the section on unformatted input (27.6.1.3)
+says that every unformatted input function catches all exceptions that
+were thrown during input, sets badbit, and then conditionally rethrows
+the exception. That seems clear enough. Several of the specific
+functions, however, such as get() and read(), are documented in some
+circumstances as setting eofbit and/or failbit. (The standard notes,
+correctly, that setting eofbit or failbit can sometimes result in an
+exception being thrown.) The question: if one of these functions
+throws an exception triggered by setting failbit, is this an exception
+&quot;thrown during input&quot; and hence covered by 27.6.1.3, or does
+27.6.1.3 only refer to a limited class of exceptions? Just to make
+this concrete, suppose you have the following snippet. </p>
+
+<pre>
+ char buffer[N];
+ istream is;
+ ...
+ is.exceptions(istream::failbit); // Throw on failbit but not on badbit.
+ is.read(buffer, N);</pre>
+
+<p>Now suppose we reach EOF before we've read N characters. What
+iostate bits can we expect to be set, and what exception (if any) will
+be thrown? </p>
+<p><b>Proposed resolution:</b></p>
+<p>
+In 27.6.1.3, paragraph 1, after the sentence that begins
+&quot;If an exception is thrown...&quot;, add the following
+parenthetical comment: &quot;(Exceptions thrown from
+<tt>basic_ios&lt;&gt;::clear()</tt> are not caught or rethrown.)&quot;
+</p>
+<p><b>Rationale:</b></p>
+<p>The LWG looked to two alternative wordings, and choose the proposed
+resolution as better standardese.</p>
+<hr>
+<a name="62"><h3>62.&nbsp;<tt>Sync</tt>'s return value</h3></a><p>
+<b>Section:</b>&nbsp;27.6.1.3 <a href="lib-iostreams.html#lib.istream.unformatted"> [lib.istream.unformatted]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Matt Austern&nbsp; <b>Date:</b>&nbsp;6 Aug 1998</p>
+<p>The Effects clause for sync() (27.6.1.3, paragraph 36) says that it
+&quot;calls rdbuf()-&gt;pubsync() and, if that function returns -1
+... returns traits::eof().&quot; </p>
+
+<p>That looks suspicious, because traits::eof() is of type
+traits::int_type while the return type of sync() is int. </p>
+<p><b>Proposed resolution:</b></p>
+<p>In 27.6.1.3 <a href="lib-iostreams.html#lib.istream.unformatted"> [lib.istream.unformatted]</a>, paragraph 36, change &quot;returns
+<tt>traits::eof()</tt>&quot; to &quot;returns <tt>-1</tt>&quot;.
+</p>
+<hr>
+<a name="63"><h3>63.&nbsp;Exception-handling policy for unformatted output</h3></a><p>
+<b>Section:</b>&nbsp;27.6.2.6 <a href="lib-iostreams.html#lib.ostream.unformatted"> [lib.ostream.unformatted]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Matt Austern&nbsp; <b>Date:</b>&nbsp;11 Aug 1998</p>
+<p>Clause 27 details an exception-handling policy for formatted input,
+unformatted input, and formatted output. It says nothing for
+unformatted output (27.6.2.6). 27.6.2.6 should either include the same
+kind of exception-handling policy as in the other three places, or
+else it should have a footnote saying that the omission is
+deliberate. </p>
+<p><b>Proposed resolution:</b></p>
+<p>
+In 27.6.2.6, paragraph 1, replace the last sentence (&quot;In any
+case, the unformatted output function ends by destroying the sentry
+object, then returning the value specified for the formatted output
+function.&quot;) with the following text:
+</p>
+<blockquote>
+If an exception is thrown during output, then <tt>ios::badbit</tt> is
+turned on [Footnote: without causing an <tt>ios::failure</tt> to be
+thrown.] in <tt>*this</tt>'s error state. If <tt>(exceptions() &amp;
+badbit) != 0</tt> then the exception is rethrown. In any case, the
+unformatted output function ends by destroying the sentry object,
+then, if no exception was thrown, returning the value specified for
+the formatted output function.
+</blockquote>
+<p><b>Rationale:</b></p>
+<p>
+This exception-handling policy is consistent with that of formatted
+input, unformatted input, and formatted output.
+</p>
+<hr>
+<a name="64"><h3>64.&nbsp;Exception handling in <tt>basic_istream::operator&gt;&gt;(basic_streambuf*)</tt>
+</h3></a><p>
+<b>Section:</b>&nbsp;27.6.1.2.3 <a href="lib-iostreams.html#lib.istream::extractors"> [lib.istream::extractors]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Matt Austern&nbsp; <b>Date:</b>&nbsp;11 Aug 1998 </p>
+<p>27.6.1.2.3, paragraph 13, is ambiguous. It can be interpreted two
+different ways, depending on whether the second sentence is read as an
+elaboration of the first. </p>
+<p><b>Proposed resolution:</b></p>
+<p>Replace 27.6.1.2.3 <a href="lib-iostreams.html#lib.istream::extractors"> [lib.istream::extractors]</a>, paragraph 13, which begins
+&quot;If the function inserts no characters ...&quot; with:</p>
+
+<blockquote>
+ <p>If the function inserts no characters, it calls
+ <tt>setstate(failbit)</tt>, which may throw
+ <tt>ios_base::failure</tt> (27.4.4.3). If it inserted no characters
+ because it caught an exception thrown while extracting characters
+ from <tt>sb</tt> and <tt>failbit</tt> is on in <tt>exceptions()</tt>
+ (27.4.4.3), then the caught exception is rethrown. </p>
+</blockquote>
+<hr>
+<a name="66"><h3>66.&nbsp;Strstreambuf::setbuf</h3></a><p>
+<b>Section:</b>&nbsp;D.7.1.3 <a href="future.html#depr.strstreambuf.virtuals"> [depr.strstreambuf.virtuals]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Matt Austern&nbsp; <b>Date:</b>&nbsp;18 Aug 1998</p>
+<p>D.7.1.3, paragraph 19, says that strstreambuf::setbuf
+&quot;Performs an operation that is defined separately for each class
+derived from strstreambuf&quot;. This is obviously an incorrect
+cut-and-paste from basic_streambuf. There are no classes derived from
+strstreambuf. </p>
+<p><b>Proposed resolution:</b></p>
+<p>D.7.1.3 <a href="future.html#depr.strstreambuf.virtuals"> [depr.strstreambuf.virtuals]</a>, paragraph 19, replace the setbuf effects
+clause which currently says &quot;Performs an operation that is
+defined separately for each class derived from strstreambuf&quot;
+with:</p>
+
+<blockquote>
+ <p>
+<b>Effects</b>: implementation defined, except that
+ <tt>setbuf(0,0)</tt> has no effect.</p>
+</blockquote>
+<hr>
+<a name="68"><h3>68.&nbsp;Extractors for char* should store null at end</h3></a><p>
+<b>Section:</b>&nbsp;27.6.1.2.3 <a href="lib-iostreams.html#lib.istream::extractors"> [lib.istream::extractors]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Angelika Langer&nbsp; <b>Date:</b>&nbsp;14 Jul 1998</p>
+<p>Extractors for char* (27.6.1.2.3) do not store a null character
+after the extracted character sequence whereas the unformatted
+functions like get() do. Why is this?</p>
+
+<p>Comment from Jerry Schwarz: There is apparently an editing
+glitch. You'll notice that the last item of the list of what stops
+extraction doesn't make any sense. It was supposed to be the line that
+said a null is stored.</p>
+<p><b>Proposed resolution:</b></p>
+<p>27.6.1.2.3 <a href="lib-iostreams.html#lib.istream::extractors"> [lib.istream::extractors]</a>, paragraph 7, change the last list
+item from:</p>
+
+<blockquote>
+ A null byte (<tt>charT()</tt>) in the next position, which may be
+ the first position if no characters were extracted.
+</blockquote>
+
+<p>to become a new paragraph which reads:</p>
+
+<blockquote>
+ Operator&gt;&gt; then stores a null byte (<tt>charT()</tt>) in the
+ next position, which may be the first position if no characters were
+ extracted.
+</blockquote>
+<hr>
+<a name="69"><h3>69.&nbsp;Must elements of a vector be contiguous?</h3></a><p>
+<b>Section:</b>&nbsp;23.2.4 <a href="lib-containers.html#lib.vector"> [lib.vector]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Andrew Koenig&nbsp; <b>Date:</b>&nbsp;29 Jul 1998</p>
+<p>The issue is this: Must the elements of a vector be in contiguous memory?</p>
+
+<p>(Please note that this is entirely separate from the question of
+whether a vector iterator is required to be a pointer; the answer to
+that question is clearly &quot;no,&quot; as it would rule out
+debugging implementations)</p>
+<p><b>Proposed resolution:</b></p>
+<p>Add the following text to the end of 23.2.4 <a href="lib-containers.html#lib.vector"> [lib.vector]</a>,
+paragraph 1. </p>
+
+<blockquote>
+ <p>The elements of a vector are stored contiguously, meaning that if
+ v is a <tt>vector&lt;T, Allocator&gt;</tt> where T is some type
+ other than <tt>bool</tt>, then it obeys the identity <tt>&amp;v[n]
+ == &amp;v[0] + n</tt> for all <tt>0 &lt;= n &lt; v.size()</tt>.</p>
+</blockquote>
+<p><b>Rationale:</b></p>
+<p>The LWG feels that as a practical matter the answer is clearly
+&quot;yes&quot;. There was considerable discussion as to the best way
+to express the concept of &quot;contiguous&quot;, which is not
+directly defined in the standard. Discussion included:</p>
+
+<ul>
+ <li>An operational definition similar to the above proposed resolution is
+ already used for valarray (26.3.2.3 <a href="lib-numerics.html#lib.valarray.access"> [lib.valarray.access]</a>).</li>
+ <li>There is no need to explicitly consider a user-defined operator&amp;
+ because elements must be copyconstructible (23.1 <a href="lib-containers.html#lib.container.requirements"> [lib.container.requirements]</a> para 3)
+ and copyconstructible (20.1.3 <a href="lib-utilities.html#lib.copyconstructible"> [lib.copyconstructible]</a>) specifies
+ requirements for operator&amp;.</li>
+ <li>There is no issue of one-past-the-end because of language rules.</li>
+</ul>
+<hr>
+<a name="70"><h3>70.&nbsp;Uncaught_exception() missing throw() specification</h3></a><p>
+<b>Section:</b>&nbsp;18.6 <a href="lib-support.html#lib.support.exception"> [lib.support.exception]</a>, 18.6.4 <a href="lib-support.html#lib.uncaught"> [lib.uncaught]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Steve Clamage&nbsp; <b>Date:</b>&nbsp;Unknown</p>
+<p>In article 3E04@pratique.fr, Valentin Bonnard writes: </p>
+
+<p>uncaught_exception() doesn't have a throw specification.</p>
+
+<p>It is intentional ? Does it means that one should be prepared to
+handle exceptions thrown from uncaught_exception() ?</p>
+
+<p>uncaught_exception() is called in exception handling contexts where
+exception safety is very important.</p>
+<p><b>Proposed resolution:</b></p>
+<p>In 15.5.3 <a href="except.html#except.uncaught"> [except.uncaught]</a>, paragraph 1, 18.6 <a href="lib-support.html#lib.support.exception"> [lib.support.exception]</a>, and 18.6.4 <a href="lib-support.html#lib.uncaught"> [lib.uncaught]</a>, add &quot;throw()&quot; to uncaught_exception().</p>
+<hr>
+<a name="71"><h3>71.&nbsp;Do_get_monthname synopsis missing argument</h3></a><p>
+<b>Section:</b>&nbsp;22.2.5.1 <a href="lib-locales.html#lib.locale.time.get"> [lib.locale.time.get]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Nathan Myers&nbsp; <b>Date:</b>&nbsp;13 Aug 1998</p>
+<p>The locale facet member <tt>time_get&lt;&gt;::do_get_monthname</tt>
+is described in 22.2.5.1.2 <a href="lib-locales.html#lib.locale.time.get.virtuals"> [lib.locale.time.get.virtuals]</a> with five arguments,
+consistent with do_get_weekday and with its specified use by member
+get_monthname. However, in the synopsis, it is specified instead with
+four arguments. The missing argument is the &quot;end&quot; iterator
+value.</p>
+<p><b>Proposed resolution:</b></p>
+<p>In 22.2.5.1 <a href="lib-locales.html#lib.locale.time.get"> [lib.locale.time.get]</a>, add an &quot;end&quot; argument to
+the declaration of member do_monthname as follows:</p>
+
+<pre> virtual iter_type do_get_monthname(iter_type s, iter_type end, ios_base&amp;,
+ ios_base::iostate&amp; err, tm* t) const;</pre>
+<hr>
+<a name="74"><h3>74.&nbsp;Garbled text for <tt>codecvt::do_max_length</tt>
+</h3></a><p>
+<b>Section:</b>&nbsp;22.2.1.5.2 <a href="lib-locales.html#lib.locale.codecvt.virtuals"> [lib.locale.codecvt.virtuals]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Matt Austern&nbsp; <b>Date:</b>&nbsp;8 Sep 1998</p>
+<p>The text of <tt>codecvt::do_max_length</tt>'s &quot;Returns&quot;
+clause (22.2.1.5.2, paragraph 11) is garbled. It has unbalanced
+parentheses and a spurious <b>n</b>.</p>
+<p><b>Proposed resolution:</b></p>
+<p>Replace 22.2.1.5.2 <a href="lib-locales.html#lib.locale.codecvt.virtuals"> [lib.locale.codecvt.virtuals]</a> paragraph 11 with the
+following:</p>
+
+<blockquote>
+ <b>Returns</b>: The maximum value that
+ <tt>do_length(state, from, from_end, 1)</tt> can return for any
+ valid range <tt>[from, from_end)</tt> and <tt>stateT</tt> value
+ <tt>state</tt>. The specialization <tt>codecvt&lt;char, char,
+ mbstate_t&gt;::do_max_length()</tt> returns 1.
+</blockquote>
+<hr>
+<a name="75"><h3>75.&nbsp;Contradiction in <tt>codecvt::length</tt>'s argument types</h3></a><p>
+<b>Section:</b>&nbsp;22.2.1.5 <a href="lib-locales.html#lib.locale.codecvt"> [lib.locale.codecvt]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp; Matt
+Austern&nbsp; <b>Date:</b>&nbsp; 18 Sep 1998</p>
+<p>The class synopses for classes <tt>codecvt&lt;&gt;</tt> (22.2.1.5)
+and <tt>codecvt_byname&lt;&gt;</tt> (22.2.1.6) say that the first
+parameter of the member functions <tt>length</tt> and
+<tt>do_length</tt> is of type <tt>const stateT&amp;</tt>. The member
+function descriptions, however (22.2.1.5.1, paragraph 6; 22.2.1.5.2,
+paragraph 9) say that the type is <tt>stateT&amp;</tt>. Either the
+synopsis or the summary must be changed. </p>
+
+<p>If (as I believe) the member function descriptions are correct,
+then we must also add text saying how <tt>do_length</tt> changes its
+<tt>stateT</tt> argument. </p>
+<p><b>Proposed resolution:</b></p>
+<p>In 22.2.1.5 <a href="lib-locales.html#lib.locale.codecvt"> [lib.locale.codecvt]</a>, and also in 22.2.1.6 <a href="lib-locales.html#lib.locale.codecvt.byname"> [lib.locale.codecvt.byname]</a>,
+change the <tt>stateT</tt> argument type on both member
+<tt>length()</tt> and member <tt>do_length()</tt> from </p>
+
+<blockquote>
+ <p><tt>const stateT&amp;</tt></p>
+</blockquote>
+
+<p>to</p>
+
+<blockquote>
+ <p><tt>stateT&amp;</tt></p>
+</blockquote>
+
+<p>In 22.2.1.5.2 <a href="lib-locales.html#lib.locale.codecvt.virtuals"> [lib.locale.codecvt.virtuals]</a>, add to the definition for member
+<tt>do_length</tt> a paragraph:</p>
+
+<blockquote>
+ <p>Effects: The effect on the <tt>state</tt> argument is ``as if''
+ it called <tt>do_in(state, from, from_end, from, to, to+max,
+ to)</tt> for <tt>to</tt> pointing to a buffer of at least
+ <tt>max</tt> elements.</p>
+</blockquote>
+<hr>
+<a name="78"><h3>78.&nbsp;Typo: event_call_back</h3></a><p>
+<b>Section:</b>&nbsp;27.4.2 <a href="lib-iostreams.html#lib.ios.base"> [lib.ios.base]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Nico Josuttis&nbsp; <b>Date:</b>&nbsp;29 Sep 1998</p>
+<p>typo: event_call_back should be event_callback &nbsp; </p>
+<p><b>Proposed resolution:</b></p>
+<p>In the 27.4.2 <a href="lib-iostreams.html#lib.ios.base"> [lib.ios.base]</a> synopsis change
+&quot;event_call_back&quot; to &quot;event_callback&quot;. </p>
+<hr>
+<a name="79"><h3>79.&nbsp;Inconsistent declaration of polar()</h3></a><p>
+<b>Section:</b>&nbsp;26.2.1 <a href="lib-numerics.html#lib.complex.synopsis"> [lib.complex.synopsis]</a>, 26.2.7 <a href="lib-numerics.html#lib.complex.value.ops"> [lib.complex.value.ops]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Nico Josuttis&nbsp; <b>Date:</b>&nbsp;29 Sep 1998</p>
+<p>In 26.2.1 <a href="lib-numerics.html#lib.complex.synopsis"> [lib.complex.synopsis]</a> polar is declared as follows:</p>
+<pre> template&lt;class T&gt; complex&lt;T&gt; polar(const T&amp;, const T&amp;); </pre>
+
+<p>In 26.2.7 <a href="lib-numerics.html#lib.complex.value.ops"> [lib.complex.value.ops]</a> it is declared as follows:</p>
+<pre> template&lt;class T&gt; complex&lt;T&gt; polar(const T&amp; rho, const T&amp; theta = 0); </pre>
+
+<p>Thus whether the second parameter is optional is not clear. </p>
+<p><b>Proposed resolution:</b></p>
+<p>In 26.2.1 <a href="lib-numerics.html#lib.complex.synopsis"> [lib.complex.synopsis]</a> change:</p>
+<pre> template&lt;class T&gt; complex&lt;T&gt; polar(const T&amp;, const T&amp;);</pre>
+
+<p>to:</p>
+<pre> template&lt;class T&gt; complex&lt;T&gt; polar(const T&amp; rho, const T&amp; theta = 0); </pre>
+<hr>
+<a name="80"><h3>80.&nbsp;Global Operators of complex declared twice</h3></a><p>
+<b>Section:</b>&nbsp;26.2.1 <a href="lib-numerics.html#lib.complex.synopsis"> [lib.complex.synopsis]</a>, 26.2.2 <a href="lib-numerics.html#lib.complex"> [lib.complex]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Nico Josuttis&nbsp; <b>Date:</b>&nbsp;29 Sep 1998</p>
+<p>Both 26.2.1 and 26.2.2 contain declarations of global operators for
+class complex. This redundancy should be removed.</p>
+<p><b>Proposed resolution:</b></p>
+<p>Reduce redundancy according to the general style of the standard. </p>
+<hr>
+<a name="83"><h3>83.&nbsp;String::npos vs. string::max_size()</h3></a><p>
+<b>Section:</b>&nbsp;21.3 <a href="lib-strings.html#lib.basic.string"> [lib.basic.string]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Nico Josuttis&nbsp; <b>Date:</b>&nbsp;29 Sep 1998</p>
+<p>Many string member functions throw if size is getting or exceeding
+npos. However, I wonder why they don't throw if size is getting or
+exceeding max_size() instead of npos. May be npos is known at compile
+time, while max_size() is known at runtime. However, what happens if
+size exceeds max_size() but not npos, then? It seems the standard
+lacks some clarifications here.</p>
+<p><b>Proposed resolution:</b></p>
+<p>After 21.3 <a href="lib-strings.html#lib.basic.string"> [lib.basic.string]</a> paragraph 4 (&quot;The functions
+described in this clause...&quot;) add a new paragraph:</p>
+
+<blockquote>
+ <p>For any string operation, if as a result of the operation, <tt> size()</tt> would exceed
+ <tt> max_size()</tt> then
+ the operation throws <tt>length_error</tt>.</p>
+</blockquote>
+<p><b>Rationale:</b></p>
+<p>The LWG believes length_error is the correct exception to throw.</p>
+<hr>
+<a name="86"><h3>86.&nbsp;String constructors don't describe exceptions</h3></a><p>
+<b>Section:</b>&nbsp;21.3.1 <a href="lib-strings.html#lib.string.cons"> [lib.string.cons]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Nico Josuttis&nbsp; <b>Date:</b>&nbsp;29 Sep 1998</p>
+<p>The constructor from a range:</p>
+
+<pre>template&lt;class InputIterator&gt;
+ basic_string(InputIterator begin, InputIterator end,
+ const Allocator&amp; a = Allocator());</pre>
+
+<p>lacks a throws clause. However, I would expect that it throws
+according to the other constructors if the numbers of characters in
+the range equals npos (or exceeds max_size(), see above). </p>
+<p><b>Proposed resolution:</b></p>
+<p>In 21.3.1 <a href="lib-strings.html#lib.string.cons"> [lib.string.cons]</a>, Strike throws paragraphs for
+constructors which say &quot;Throws: length_error if n ==
+npos.&quot;</p>
+<p><b>Rationale:</b></p>
+<p>Throws clauses for length_error if n == npos are no longer needed
+because they are subsumed by the general wording added by the
+resolution for issue <a href="lwg-defects.html#83">83</a>.</p>
+<hr>
+<a name="90"><h3>90.&nbsp;Incorrect description of operator &gt;&gt; for strings</h3></a><p>
+<b>Section:</b>&nbsp;21.3.7.9 <a href="lib-strings.html#lib.string.io"> [lib.string.io]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Nico Josuttis&nbsp; <b>Date:</b>&nbsp;29 Sep 1998</p>
+<p>The effect of operator &gt;&gt; for strings contain the following item:</p>
+
+<p>&nbsp;&nbsp;&nbsp; <tt>isspace(c,getloc())</tt> is true for the next available input
+character c.</p>
+
+<p>Here <tt>getloc()</tt> has to be replaced by <tt>is.getloc()</tt>. </p>
+<p><b>Proposed resolution:</b></p>
+<p>In 21.3.7.9 <a href="lib-strings.html#lib.string.io"> [lib.string.io]</a> paragraph 1 Effects clause replace:</p>
+
+<blockquote>
+ <p>
+<tt>isspace(c,getloc())</tt> is true for the next available input character c.</p>
+</blockquote>
+
+<p>with:</p>
+
+<blockquote>
+ <p>
+<tt>isspace(c,is.getloc())</tt> is true for the next available input character c.</p>
+</blockquote>
+<hr>
+<a name="103"><h3>103.&nbsp;set::iterator is required to be modifiable, but this allows modification of keys</h3></a><p>
+<b>Section:</b>&nbsp;23.1.2 <a href="lib-containers.html#lib.associative.reqmts"> [lib.associative.reqmts]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;AFNOR&nbsp; <b>Date:</b>&nbsp;7 Oct 1998</p>
+<p>Set::iterator is described as implementation-defined with a
+reference to the container requirement; the container requirement says
+that const_iterator is an iterator pointing to const T and iterator an
+iterator pointing to T.</p>
+
+<p>23.1.2 paragraph 2 implies that the keys should not be modified to
+break the ordering of elements. But that is not clearly
+specified. Especially considering that the current standard requires
+that iterator for associative containers be different from
+const_iterator. Set, for example, has the following: </p>
+
+<p><tt>typedef implementation defined iterator;<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // See _lib.container.requirements_</tt></p>
+
+<p>23.1 <a href="lib-containers.html#lib.container.requirements"> [lib.container.requirements]</a> actually requires that iterator type pointing
+to T (table 65). Disallowing user modification of keys by changing the
+standard to require an iterator for associative container to be the
+same as const_iterator would be overkill since that will unnecessarily
+significantly restrict the usage of associative container. A class to
+be used as elements of set, for example, can no longer be modified
+easily without either redesigning the class (using mutable on fields
+that have nothing to do with ordering), or using const_cast, which
+defeats requiring iterator to be const_iterator. The proposed solution
+goes in line with trusting user knows what he is doing. </p>
+
+<p>
+<b>Other Options Evaluated:</b> </p>
+
+<p>Option A.&nbsp;&nbsp; In 23.1.2 <a href="lib-containers.html#lib.associative.reqmts"> [lib.associative.reqmts]</a>, paragraph 2, after
+first sentence, and before &quot;In addition,...&quot;, add one line:
+</p>
+
+<blockquote>
+ <p>Modification of keys shall not change their strict weak ordering. </p>
+</blockquote>
+
+<p>Option B.&nbsp;Add three new sentences to 23.1.2 <a href="lib-containers.html#lib.associative.reqmts"> [lib.associative.reqmts]</a>:</p>
+
+<blockquote>
+ <p>At the end of paragraph 5: &quot;Keys in an associative container
+ are immutable.&quot; At the end of paragraph 6: &quot;For
+ associative containers where the value type is the same as the key
+ type, both <tt>iterator</tt> and <tt>const_iterator</tt> are
+ constant iterators. It is unspecified whether or not
+ <tt>iterator</tt> and <tt>const_iterator</tt> are the same
+ type.&quot;</p>
+</blockquote>
+
+<p>Option C.&nbsp;To 23.1.2 <a href="lib-containers.html#lib.associative.reqmts"> [lib.associative.reqmts]</a>, paragraph 3, which
+currently reads:</p>
+
+<blockquote>
+ <p>The phrase ``equivalence of keys'' means the equivalence relation imposed by the
+ comparison and not the operator== on keys. That is, two keys k1 and k2 in the same
+ container are considered to be equivalent if for the comparison object comp, comp(k1, k2)
+ == false &amp;&amp; comp(k2, k1) == false.</p>
+</blockquote>
+
+<p>&nbsp; add the following:</p>
+
+<blockquote>
+ <p>For any two keys k1 and k2 in the same container, comp(k1, k2) shall return the same
+ value whenever it is evaluated. [Note: If k2 is removed from the container and later
+ reinserted, comp(k1, k2) must still return a consistent value but this value may be
+ different than it was the first time k1 and k2 were in the same container. This is
+ intended to allow usage like a string key that contains a filename, where comp compares
+ file contents; if k2 is removed, the file is changed, and the same k2 (filename) is
+ reinserted, comp(k1, k2) must again return a consistent value but this value may be
+ different than it was the previous time k2 was in the container.]</p>
+</blockquote>
+<p><b>Proposed resolution:</b></p>
+<p>Add the following to 23.1.2 <a href="lib-containers.html#lib.associative.reqmts"> [lib.associative.reqmts]</a> at
+the indicated location:</p>
+
+<blockquote>
+ <p>At the end of paragraph 3: &quot;For any two keys k1 and k2 in the same container,
+ calling comp(k1, k2) shall always return the same
+ value.&quot;</p>
+ <p>At the end of paragraph 5: &quot;Keys in an associative container are immutable.&quot;</p>
+ <p>At the end of paragraph 6: &quot;For associative containers where the value type is the
+ same as the key type, both <tt>iterator</tt> and <tt>const_iterator</tt> are constant
+ iterators. It is unspecified whether or not <tt>iterator</tt> and <tt>const_iterator</tt>
+ are the same type.&quot;</p>
+</blockquote>
+<p><b>Rationale:</b></p>
+<p>Several arguments were advanced for and against allowing set elements to be
+mutable as long as the ordering was not effected. The argument which swayed the
+LWG was one of safety; if elements were mutable, there would be no compile-time
+way to detect of a simple user oversight which caused ordering to be
+modified. There was a report that this had actually happened in practice,
+and had been painful to diagnose. If users need to modify elements,
+it is possible to use mutable members or const_cast.</p>
+
+<p>Simply requiring that keys be immutable is not sufficient, because the comparison
+object may indirectly (via pointers) operate on values outside of the keys.</p>
+
+<p>
+The types <tt>iterator</tt> and <tt>const_iterator</tt> are permitted
+to be different types to allow for potential future work in which some
+member functions might be overloaded between the two types. No such
+member functions exist now, and the LWG believes that user functionality
+will not be impaired by permitting the two types to be the same. A
+function that operates on both iterator types can be defined for
+<tt>const_iterator</tt> alone, and can rely on the automatic
+conversion from <tt>iterator</tt> to <tt>const_iterator</tt>.
+</p>
+
+<p><i>[Tokyo: The LWG crafted the proposed resolution and rationale.]</i></p>
+<hr>
+<a name="106"><h3>106.&nbsp;Numeric library private members are implementation defined</h3></a><p>
+<b>Section:</b>&nbsp;26.3.5 <a href="lib-numerics.html#lib.template.slice.array"> [lib.template.slice.array]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;AFNOR&nbsp; <b>Date:</b>&nbsp;7 Oct 1998</p>
+<p>This is the only place in the whole standard where the implementation has to document
+something private.</p>
+<p><b>Proposed resolution:</b></p>
+<p>
+Remove the comment which says &quot;// remainder implementation defined&quot; from:
+</p>
+
+<ul>
+ <li>26.3.5 <a href="lib-numerics.html#lib.template.slice.array"> [lib.template.slice.array]</a>
+</li>
+ <li>26.3.7 <a href="lib-numerics.html#lib.template.gslice.array"> [lib.template.gslice.array]</a>
+</li>
+ <li>26.3.8 <a href="lib-numerics.html#lib.template.mask.array"> [lib.template.mask.array]</a>
+</li>
+ <li>26.3.9 <a href="lib-numerics.html#lib.template.indirect.array"> [lib.template.indirect.array]</a>
+</li>
+</ul>
+<hr>
+<a name="108"><h3>108.&nbsp;Lifetime of exception::what() return unspecified</h3></a><p>
+<b>Section:</b>&nbsp;18.6.1 <a href="lib-support.html#lib.exception"> [lib.exception]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;AFNOR&nbsp; <b>Date:</b>&nbsp;7 Oct 1998</p>
+<p>In 18.6.1, paragraphs 8-9, the lifetime of the return value of
+exception::what() is left unspecified. This issue has implications
+with exception safety of exception handling: some exceptions should
+not throw bad_alloc.</p>
+<p><b>Proposed resolution:</b></p>
+<p>Add to 18.6.1 <a href="lib-support.html#lib.exception"> [lib.exception]</a> paragraph 9 (exception::what notes
+clause) the sentence:</p>
+
+<blockquote>
+ <p>The return value remains valid until the exception object from which it is obtained is
+ destroyed or a non-const member function of the exception object is called.</p>
+</blockquote>
+<p><b>Rationale:</b></p>
+<p>If an exception object has non-const members, they may be used
+to set internal state that should affect the contents of the string
+returned by <tt>what()</tt>.
+</p>
+<hr>
+<a name="109"><h3>109.&nbsp;Missing binders for non-const sequence elements</h3></a><p>
+<b>Section:</b>&nbsp;20.3.6 <a href="lib-utilities.html#lib.binders"> [lib.binders]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Bjarne Stroustrup&nbsp; <b>Date:</b>&nbsp;7 Oct 1998</p>
+
+<p>There are no versions of binders that apply to non-const elements
+of a sequence. This makes examples like for_each() using bind2nd() on
+page 521 of &quot;The C++ Programming Language (3rd)&quot;
+non-conforming. Suitable versions of the binders need to be added.</p>
+
+<p>Further discussion from Nico:</p>
+
+<p>What is probably meant here is shown in the following example:</p>
+
+<pre>class Elem {
+ public:
+ void print (int i) const { }
+ void modify (int i) { }
+}; </pre>
+<pre>int main()
+{
+ vector&lt;Elem&gt; coll(2);
+ for_each (coll.begin(), coll.end(), bind2nd(mem_fun_ref(&amp;Elem::print),42)); // OK
+ for_each (coll.begin(), coll.end(), bind2nd(mem_fun_ref(&amp;Elem::modify),42)); // ERROR
+}</pre>
+
+<p>The error results from the fact that bind2nd() passes its first
+argument (the argument of the sequence) as constant reference. See the
+following typical implementation:</p>
+
+<blockquote>
+ <pre>template &lt;class Operation&gt;
+class binder2nd
+ : public unary_function&lt;typename Operation::first_argument_type,
+ typename Operation::result_type&gt; {
+protected:
+ Operation op;
+ typename Operation::second_argument_type value;
+public:
+ binder2nd(const Operation&amp; o,
+ const typename Operation::second_argument_type&amp; v)
+ : op(o), value(v) {} </pre>
+ <pre> typename Operation::result_type
+ operator()(const typename Operation::first_argument_type&amp; x) const {
+ return op(x, value);
+ }
+};</pre>
+</blockquote>
+
+<p>The solution is to overload operator () of bind2nd for non-constant arguments:</p>
+
+<blockquote>
+ <pre>template &lt;class Operation&gt;
+class binder2nd
+ : public unary_function&lt;typename Operation::first_argument_type,
+ typename Operation::result_type&gt; {
+protected:
+ Operation op;
+ typename Operation::second_argument_type value;
+public:
+ binder2nd(const Operation&amp; o,
+ const typename Operation::second_argument_type&amp; v)
+ : op(o), value(v) {} </pre>
+ <pre> typename Operation::result_type
+ operator()(const typename Operation::first_argument_type&amp; x) const {
+ return op(x, value);
+ }
+ typename Operation::result_type
+ operator()(typename Operation::first_argument_type&amp; x) const {
+ return op(x, value);
+ }
+};</pre>
+</blockquote>
+<p><b>Proposed resolution:</b></p>
+
+<p>
+<b>Howard believes there is a flaw</b> in this resolution.
+See c++std-lib-9127. We may need to reopen this issue.</p>
+
+<p>In 20.3.6.1 <a href="lib-utilities.html#lib.binder.1st"> [lib.binder.1st]</a> in the declaration of binder1st after:</p>
+<blockquote>
+ <p><tt>typename Operation::result_type<br>
+ &nbsp;operator()(const typename Operation::second_argument_type&amp; x) const;</tt></p>
+</blockquote>
+<p>insert:</p>
+<blockquote>
+ <p><tt>typename Operation::result_type<br>
+ &nbsp;operator()(typename Operation::second_argument_type&amp; x) const;</tt></p>
+</blockquote>
+<p>In 20.3.6.3 <a href="lib-utilities.html#lib.binder.2nd"> [lib.binder.2nd]</a> in the declaration of binder2nd after:</p>
+<blockquote>
+ <p><tt>typename Operation::result_type<br>
+ &nbsp;operator()(const typename Operation::first_argument_type&amp; x) const;</tt></p>
+</blockquote>
+<p>insert:</p>
+<blockquote>
+ <p><tt>typename Operation::result_type<br>
+ &nbsp;operator()(typename Operation::first_argument_type&amp; x) const;</tt></p>
+</blockquote>
+
+<p><i>[Kona: The LWG discussed this at some length.It was agreed that
+this is a mistake in the design, but there was no consensus on whether
+it was a defect in the Standard. Straw vote: NAD - 5. Accept
+proposed resolution - 3. Leave open - 6.]</i></p>
+
+<p><i>[Copenhagen: It was generally agreed that this was a defect.
+Strap poll: NAD - 0. Accept proposed resolution - 10.
+Leave open - 1.]</i></p>
+
+<hr>
+<a name="110"><h3>110.&nbsp;istreambuf_iterator::equal not const</h3></a><p>
+<b>Section:</b>&nbsp;24.5.3 <a href="lib-iterators.html#lib.istreambuf.iterator"> [lib.istreambuf.iterator]</a>, 24.5.3.5 <a href="lib-iterators.html#lib.istreambuf.iterator::equal"> [lib.istreambuf.iterator::equal]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Nathan Myers&nbsp; <b>Date:</b>&nbsp;15 Oct 1998</p>
+<p>Member istreambuf_iterator&lt;&gt;::equal is not declared
+&quot;const&quot;, yet 24.5.3.6 <a href="lib-iterators.html#lib.istreambuf.iterator::op=="> [lib.istreambuf.iterator::op==]</a> says that operator==,
+which is const, calls it. This is contradictory. </p>
+<p><b>Proposed resolution:</b></p>
+<p>In 24.5.3 <a href="lib-iterators.html#lib.istreambuf.iterator"> [lib.istreambuf.iterator]</a> and also in 24.5.3.5 <a href="lib-iterators.html#lib.istreambuf.iterator::equal"> [lib.istreambuf.iterator::equal]</a>,
+replace:</p>
+
+<blockquote>
+ <pre>bool equal(istreambuf_iterator&amp; b);</pre>
+</blockquote>
+
+<p>with:</p>
+
+<blockquote>
+ <pre>bool equal(const istreambuf_iterator&amp; b) const;</pre>
+</blockquote>
+<hr>
+<a name="112"><h3>112.&nbsp;Minor typo in <tt>ostreambuf_iterator</tt> constructor</h3></a><p>
+<b>Section:</b>&nbsp;24.5.4.1 <a href="lib-iterators.html#lib.ostreambuf.iter.cons"> [lib.ostreambuf.iter.cons]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Matt Austern&nbsp; <b>Date:</b>&nbsp;20 Oct 1998</p>
+<p>The <b>requires</b> clause for <tt>ostreambuf_iterator</tt>'s
+constructor from an <tt>ostream_type</tt> (24.5.4.1, paragraph 1)
+reads &quot;<i>s</i> is not null&quot;. However, <i>s</i> is a
+reference, and references can't be null. </p>
+<p><b>Proposed resolution:</b></p>
+<p>In 24.5.4.1 <a href="lib-iterators.html#lib.ostreambuf.iter.cons"> [lib.ostreambuf.iter.cons]</a>:</p>
+
+<p>Move the current paragraph 1, which reads &quot;Requires: s is not
+null.&quot;, from the first constructor to the second constructor.</p>
+
+<p>Insert a new paragraph 1 Requires clause for the first constructor
+reading:</p>
+
+<blockquote>
+ <p>
+<b>Requires</b>: <tt>s.rdbuf()</tt> is not null.</p>
+</blockquote>
+<hr>
+<a name="114"><h3>114.&nbsp;Placement forms example in error twice</h3></a><p>
+<b>Section:</b>&nbsp;18.4.1.3 <a href="lib-support.html#lib.new.delete.placement"> [lib.new.delete.placement]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Steve Clamage&nbsp; <b>Date:</b>&nbsp;28 Oct 1998</p>
+<p>Section 18.4.1.3 contains the following example: </p>
+
+<pre>[Example: This can be useful for constructing an object at a known address:
+ char place[sizeof(Something)];
+ Something* p = new (place) Something();
+ -end example]</pre>
+
+<p>First code line: &quot;place&quot; need not have any special alignment, and the
+following constructor could fail due to misaligned data.</p>
+
+<p>Second code line: Aren't the parens on Something() incorrect?&nbsp; [Dublin: the LWG
+believes the () are correct.]</p>
+
+<p>Examples are not normative, but nevertheless should not show code that is invalid or
+likely to fail.</p>
+<p><b>Proposed resolution:</b></p>
+<p>Replace the <u> first line of code</u> in the example in
+18.4.1.3 <a href="lib-support.html#lib.new.delete.placement"> [lib.new.delete.placement]</a> with:
+</p>
+
+<blockquote>
+ <pre>void* place = operator new(sizeof(Something));</pre>
+</blockquote>
+<hr>
+<a name="115"><h3>115.&nbsp;Typo in strstream constructors</h3></a><p>
+<b>Section:</b>&nbsp;D.7.4.1 <a href="future.html#depr.strstream.cons"> [depr.strstream.cons]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Steve Clamage&nbsp; <b>Date:</b>&nbsp;2 Nov 1998</p>
+<p>D.7.4.1 strstream constructors paragraph 2 says: </p>
+
+<blockquote>
+ <p>Effects: Constructs an object of class strstream, initializing the base class with
+ iostream(&amp; sb) and initializing sb with one of the two constructors: </p>
+ <p>- If mode&amp;app==0, then s shall designate the first element of an array of n
+ elements. The constructor is strstreambuf(s, n, s). </p>
+ <p>- If mode&amp;app==0, then s shall designate the first element of an array of n
+ elements that contains an NTBS whose first element is designated by s. The constructor is
+ strstreambuf(s, n, s+std::strlen(s)).</p>
+</blockquote>
+
+<p>Notice the second condition is the same as the first. I think the second condition
+should be &quot;If mode&amp;app==app&quot;, or &quot;mode&amp;app!=0&quot;, meaning that
+the append bit is set.</p>
+<p><b>Proposed resolution:</b></p>
+<p>In D.7.3.1 <a href="future.html#depr.ostrstream.cons"> [depr.ostrstream.cons]</a> paragraph 2 and D.7.4.1 <a href="future.html#depr.strstream.cons"> [depr.strstream.cons]</a>
+paragraph 2, change the first condition to <tt>(mode&amp;app)==0</tt>
+and the second condition to <tt>(mode&amp;app)!=0</tt>.</p>
+<hr>
+<a name="117"><h3>117.&nbsp;<tt>basic_ostream</tt> uses nonexistent <tt>num_put</tt> member functions</h3></a><p>
+<b>Section:</b>&nbsp;27.6.2.5.2 <a href="lib-iostreams.html#lib.ostream.inserters.arithmetic"> [lib.ostream.inserters.arithmetic]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Matt Austern&nbsp; <b>Date:</b>&nbsp;20 Nov 1998</p>
+<p>The <b>effects</b> clause for numeric inserters says that
+insertion of a value <tt>x</tt>, whose type is either <tt>bool</tt>,
+<tt>short</tt>, <tt>unsigned short</tt>, <tt>int</tt>, <tt>unsigned
+int</tt>, <tt>long</tt>, <tt>unsigned long</tt>, <tt>float</tt>,
+<tt>double</tt>, <tt>long double</tt>, or <tt>const void*</tt>, is
+delegated to <tt>num_put</tt>, and that insertion is performed as if
+through the following code fragment: </p>
+
+<pre>bool failed = use_facet&lt;
+ num_put&lt;charT,ostreambuf_iterator&lt;charT,traits&gt; &gt;
+ &gt;(getloc()).put(*this, *this, fill(), val). failed();</pre>
+
+<p>This doesn't work, because <tt>num_put&lt;&gt;</tt>::put is only
+overloaded for the types <tt>bool</tt>, <tt>long</tt>, <tt>unsigned
+long</tt>, <tt>double</tt>, <tt>long double</tt>, and <tt>const
+void*</tt>. That is, the code fragment in the standard is incorrect
+(it is diagnosed as ambiguous at compile time) for the types
+<tt>short</tt>, <tt>unsigned short</tt>, <tt>int</tt>, <tt>unsigned
+int</tt>, and <tt>float</tt>. </p>
+
+<p>We must either add new member functions to <tt>num_put</tt>, or
+else change the description in <tt>ostream</tt> so that it only calls
+functions that are actually there. I prefer the latter. </p>
+<p><b>Proposed resolution:</b></p>
+<p>Replace 27.6.2.5.2, paragraph 1 with the following: </p>
+
+<blockquote>
+<p>
+The classes num_get&lt;&gt; and num_put&lt;&gt; handle locale&shy;dependent numeric
+formatting and parsing. These inserter functions use the imbued
+locale value to perform numeric formatting. When val is of type bool,
+long, unsigned long, double, long double, or const void*, the
+formatting conversion occurs as if it performed the following code
+fragment:
+</p>
+
+<pre>
+bool failed = use_facet&lt;
+ num_put&lt;charT,ostreambuf_iterator&lt;charT,traits&gt; &gt;
+ &gt;(getloc()).put(*this, *this, fill(), val). failed();
+</pre>
+
+<p>
+When val is of type short the formatting conversion occurs as if it
+performed the following code fragment:
+</p>
+
+<pre>
+ios_base::fmtflags baseflags = ios_base::flags() &amp; ios_base::basefield;
+bool failed = use_facet&lt;
+ num_put&lt;charT,ostreambuf_iterator&lt;charT,traits&gt; &gt;
+ &gt;(getloc()).put(*this, *this, fill(),
+ baseflags == ios_base::oct || baseflags == ios_base::hex
+ ? static_cast&lt;long&gt;(static_cast&lt;unsigned short&gt;(val))
+ : static_cast&lt;long&gt;(val)). failed();
+</pre>
+
+<p>
+When val is of type int the formatting conversion occurs as if it performed
+the following code fragment:
+</p>
+
+<pre>
+ios_base::fmtflags baseflags = ios_base::flags() &amp; ios_base::basefield;
+bool failed = use_facet&lt;
+ num_put&lt;charT,ostreambuf_iterator&lt;charT,traits&gt; &gt;
+ &gt;(getloc()).put(*this, *this, fill(),
+ baseflags == ios_base::oct || baseflags == ios_base::hex
+ ? static_cast&lt;long&gt;(static_cast&lt;unsigned int&gt;(val))
+ : static_cast&lt;long&gt;(val)). failed();
+</pre>
+
+<p>
+When val is of type unsigned short or unsigned int the formatting conversion
+occurs as if it performed the following code fragment:
+</p>
+
+<pre>
+bool failed = use_facet&lt;
+ num_put&lt;charT,ostreambuf_iterator&lt;charT,traits&gt; &gt;
+ &gt;(getloc()).put(*this, *this, fill(), static_cast&lt;unsigned long&gt;(val)).
+failed();
+</pre>
+
+<p>
+When val is of type float the formatting conversion occurs as if it
+performed the following code fragment:
+</p>
+
+<pre>
+bool failed = use_facet&lt;
+ num_put&lt;charT,ostreambuf_iterator&lt;charT,traits&gt; &gt;
+ &gt;(getloc()).put(*this, *this, fill(), static_cast&lt;double&gt;(val)).
+failed();
+</pre>
+
+</blockquote>
+
+<p><i>[post-Toronto: This differs from the previous proposed
+resolution; PJP provided the new wording. The differences are in
+signed short and int output.]</i></p>
+<p><b>Rationale:</b></p>
+<p>The original proposed resolution was to cast int and short to long,
+unsigned int and unsigned short to unsigned long, and float to double,
+thus ensuring that we don't try to use nonexistent num_put&lt;&gt;
+member functions. The current proposed resolution is more
+complicated, but gives more expected results for hex and octal output
+of signed short and signed int. (On a system with 16-bit short, for
+example, printing short(-1) in hex format should yield 0xffff.)</p>
+<hr>
+<a name="118"><h3>118.&nbsp;<tt>basic_istream</tt> uses nonexistent <tt>num_get</tt> member functions</h3></a><p>
+<b>Section:</b>&nbsp;27.6.1.2.2 <a href="lib-iostreams.html#lib.istream.formatted.arithmetic"> [lib.istream.formatted.arithmetic]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Matt Austern&nbsp; <b>Date:</b>&nbsp;20 Nov 1998</p>
+<p>Formatted input is defined for the types <tt>short</tt>, <tt>unsigned short</tt>, <tt>int</tt>,
+<tt>unsigned int</tt>, <tt>long</tt>, <tt>unsigned long</tt>, <tt>float</tt>, <tt>double</tt>,
+<tt>long double</tt>, <tt>bool</tt>, and <tt>void*</tt>. According to section 27.6.1.2.2,
+formatted input of a value <tt>x</tt> is done as if by the following code fragment: </p>
+
+<pre>typedef num_get&lt; charT,istreambuf_iterator&lt;charT,traits&gt; &gt; numget;
+iostate err = 0;
+use_facet&lt; numget &gt;(loc).get(*this, 0, *this, err, val);
+setstate(err);</pre>
+
+<p>According to section 22.2.2.1.1 <a href="lib-locales.html#lib.facet.num.get.members"> [lib.facet.num.get.members]</a>, however,
+<tt>num_get&lt;&gt;::get()</tt> is only overloaded for the types
+<tt>bool</tt>, <tt>long</tt>, <tt>unsigned short</tt>, <tt>unsigned
+int</tt>, <tt>unsigned long</tt>, <tt>unsigned long</tt>,
+<tt>float</tt>, <tt>double</tt>, <tt>long double</tt>, and
+<tt>void*</tt>. Comparing the lists from the two sections, we find
+that 27.6.1.2.2 is using a nonexistent function for types
+<tt>short</tt> and <tt>int</tt>. </p>
+<p><b>Proposed resolution:</b></p>
+<p>In 27.6.1.2.2 <a href="lib-iostreams.html#lib.istream.formatted.arithmetic"> [lib.istream.formatted.arithmetic]</a> Arithmetic Extractors, remove the
+two lines (1st and 3rd) which read:</p>
+<blockquote>
+ <pre>operator&gt;&gt;(short&amp; val);
+...
+operator&gt;&gt;(int&amp; val);</pre>
+</blockquote>
+
+<p>And add the following at the end of that section (27.6.1.2.2) :</p>
+
+<blockquote>
+ <pre>operator&gt;&gt;(short&amp; val);</pre>
+ <p>The conversion occurs as if performed by the following code fragment (using
+ the same notation as for the preceding code fragment):</p>
+ <pre> typedef num_get&lt; charT,istreambuf_iterator&lt;charT,traits&gt; &gt; numget;
+ iostate err = 0;
+ long lval;
+ use_facet&lt; numget &gt;(loc).get(*this, 0, *this, err, lval);
+ if (err == 0
+ &amp;&amp; (lval &lt; numeric_limits&lt;short&gt;::min() || numeric_limits&lt;short&gt;::max() &lt; lval))
+ err = ios_base::failbit;
+ setstate(err);</pre>
+ <pre>operator&gt;&gt;(int&amp; val);</pre>
+ <p>The conversion occurs as if performed by the following code fragment (using
+ the same notation as for the preceding code fragment):</p>
+ <pre> typedef num_get&lt; charT,istreambuf_iterator&lt;charT,traits&gt; &gt; numget;
+ iostate err = 0;
+ long lval;
+ use_facet&lt; numget &gt;(loc).get(*this, 0, *this, err, lval);
+ if (err == 0
+ &amp;&amp; (lval &lt; numeric_limits&lt;int&gt;::min() || numeric_limits&lt;int&gt;::max() &lt; lval))
+ err = ios_base::failbit;
+ setstate(err);</pre>
+</blockquote>
+
+<p><i>[Post-Tokyo: PJP provided the above wording.]</i></p>
+<hr>
+<a name="119"><h3>119.&nbsp;Should virtual functions be allowed to strengthen the exception specification?</h3></a><p>
+<b>Section:</b>&nbsp;17.4.4.8 <a href="lib-intro.html#lib.res.on.exception.handling"> [lib.res.on.exception.handling]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Judy Ward&nbsp; <b>Date:</b>&nbsp;15 Dec 1998</p>
+<p>Section 17.4.4.8 <a href="lib-intro.html#lib.res.on.exception.handling"> [lib.res.on.exception.handling]</a> states: </p>
+
+<p>&quot;An implementation may strengthen the exception-specification
+for a function by removing listed exceptions.&quot; </p>
+
+<p>The problem is that if an implementation is allowed to do this for
+virtual functions, then a library user cannot write a class that
+portably derives from that class. </p>
+
+<p>For example, this would not compile if ios_base::failure::~failure
+had an empty exception specification: </p>
+
+<pre>#include &lt;ios&gt;
+#include &lt;string&gt;
+
+class D : public std::ios_base::failure {
+public:
+ D(const std::string&amp;);
+ ~D(); // error - exception specification must be compatible with
+ // overridden virtual function ios_base::failure::~failure()
+};</pre>
+<p><b>Proposed resolution:</b></p>
+<p>Change Section 17.4.4.8 <a href="lib-intro.html#lib.res.on.exception.handling"> [lib.res.on.exception.handling]</a> from:</p>
+
+<p>&nbsp;&nbsp;&nbsp;&nbsp; &quot;may strengthen the
+exception-specification for a function&quot;</p>
+
+<p>to:</p>
+
+<p>&nbsp;&nbsp;&nbsp;&nbsp; &quot;may strengthen the
+exception-specification for a non-virtual function&quot;. </p>
+<hr>
+<a name="122"><h3>122.&nbsp;streambuf/wstreambuf description should not say they are specializations</h3></a><p>
+<b>Section:</b>&nbsp;27.5.2 <a href="lib-iostreams.html#lib.streambuf"> [lib.streambuf]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Judy Ward&nbsp; <b>Date:</b>&nbsp;15 Dec 1998</p>
+<p>Section 27.5.2 describes the streambuf classes this way: </p>
+
+<blockquote>
+
+<p>The class streambuf is a specialization of the template class basic_streambuf
+specialized for the type char. </p>
+
+<p>The class wstreambuf is a specialization of the template class basic_streambuf
+specialized for the type wchar_t. </p>
+
+</blockquote>
+
+<p>This implies that these classes must be template specializations, not typedefs. </p>
+
+<p>It doesn't seem this was intended, since Section 27.5 has them declared as typedefs. </p>
+<p><b>Proposed resolution:</b></p>
+<p>Remove 27.5.2 <a href="lib-iostreams.html#lib.streambuf"> [lib.streambuf]</a> paragraphs 2 and 3 (the above two
+sentences). </p>
+<p><b>Rationale:</b></p>
+<p>The <tt>streambuf</tt> synopsis already has a declaration for the
+typedefs and that is sufficient. </p>
+<hr>
+<a name="124"><h3>124.&nbsp;ctype_byname&lt;charT&gt;::do_scan_is &amp; do_scan_not return type should be const charT*</h3></a><p>
+<b>Section:</b>&nbsp;22.2.1.2 <a href="lib-locales.html#lib.locale.ctype.byname"> [lib.locale.ctype.byname]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Judy Ward&nbsp; <b>Date:</b>&nbsp;15 Dec 1998</p>
+<p>In Section 22.2.1.2 <a href="lib-locales.html#lib.locale.ctype.byname"> [lib.locale.ctype.byname]</a>
+ctype_byname&lt;charT&gt;::do_scan_is() and do_scan_not() are declared
+to return a const char* not a const charT*. </p>
+<p><b>Proposed resolution:</b></p>
+<p>Change Section 22.2.1.2 <a href="lib-locales.html#lib.locale.ctype.byname"> [lib.locale.ctype.byname]</a> <tt>do_scan_is()</tt> and
+<tt>do_scan_not()</tt> to return a <tt> const
+charT*</tt>. </p>
+<hr>
+<a name="125"><h3>125.&nbsp;valarray&lt;T&gt;::operator!() return type is inconsistent</h3></a><p>
+<b>Section:</b>&nbsp;26.3.2 <a href="lib-numerics.html#lib.template.valarray"> [lib.template.valarray]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Judy Ward&nbsp; <b>Date:</b>&nbsp;15 Dec 1998</p>
+<p>In Section 26.3.2 <a href="lib-numerics.html#lib.template.valarray"> [lib.template.valarray]</a> valarray&lt;T&gt;::operator!() is
+declared to return a valarray&lt;T&gt;, but in Section 26.3.2.5 <a href="lib-numerics.html#lib.valarray.unary"> [lib.valarray.unary]</a> it is declared to return a valarray&lt;bool&gt;. The
+latter appears to be correct. </p>
+<p><b>Proposed resolution:</b></p>
+<p>Change in Section 26.3.2 <a href="lib-numerics.html#lib.template.valarray"> [lib.template.valarray]</a> the declaration of
+<tt>operator!()</tt> so that the return type is
+<tt>valarray&lt;bool&gt;</tt>. </p>
+<hr>
+<a name="126"><h3>126.&nbsp;typos in Effects clause of ctype::do_narrow()</h3></a><p>
+<b>Section:</b>&nbsp;22.2.1.1.2 <a href="lib-locales.html#lib.locale.ctype.virtuals"> [lib.locale.ctype.virtuals]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Judy Ward&nbsp; <b>Date:</b>&nbsp;15 Dec 1998</p>
+<p>Typos in 22.2.1.1.2 need to be fixed.</p>
+<p><b>Proposed resolution:</b></p>
+<p>In Section 22.2.1.1.2 <a href="lib-locales.html#lib.locale.ctype.virtuals"> [lib.locale.ctype.virtuals]</a> change: </p>
+
+<pre> do_widen(do_narrow(c),0) == c</pre>
+
+<p>to:</p>
+
+<pre> do_widen(do_narrow(c,0)) == c</pre>
+
+<p>and change:</p>
+
+<pre> (is(M,c) || !ctc.is(M, do_narrow(c),dfault) )</pre>
+
+<p>to:</p>
+
+<pre> (is(M,c) || !ctc.is(M, do_narrow(c,dfault)) )</pre>
+<hr>
+<a name="127"><h3>127.&nbsp;auto_ptr&lt;&gt; conversion issues</h3></a><p>
+<b>Section:</b>&nbsp;20.4.5 <a href="lib-utilities.html#lib.auto.ptr"> [lib.auto.ptr]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Greg Colvin&nbsp; <b>Date:</b>&nbsp;17 Feb 1999</p>
+<p>There are two problems with the current <tt>auto_ptr</tt> wording
+in the standard: </p>
+
+<p>First, the <tt>auto_ptr_ref</tt> definition cannot be nested
+because <tt>auto_ptr&lt;Derived&gt;::auto_ptr_ref</tt> is unrelated to
+<tt>auto_ptr&lt;Base&gt;::auto_ptr_ref</tt>. <i>Also submitted by
+Nathan Myers, with the same proposed resolution.</i>
+</p>
+
+<p>Second, there is no <tt>auto_ptr</tt> assignment operator taking an
+<tt>auto_ptr_ref</tt> argument. </p>
+
+<p>I have discussed these problems with my proposal coauthor, Bill
+Gibbons, and with some compiler and library implementors, and we
+believe that these problems are not desired or desirable implications
+of the standard. </p>
+
+<p>25 Aug 1999: The proposed resolution now reflects changes suggested
+by Dave Abrahams, with Greg Colvin's concurrence; 1) changed
+&quot;assignment operator&quot; to &quot;public assignment
+operator&quot;, 2) changed effects to specify use of release(), 3)
+made the conversion to auto_ptr_ref const. </p>
+
+<p>2 Feb 2000: Lisa Lippincott comments: [The resolution of] this issue
+states that the conversion from auto_ptr to auto_ptr_ref should
+be const. This is not acceptable, because it would allow
+initialization and assignment from _any_ const auto_ptr! It also
+introduces an implementation difficulty in writing this conversion
+function -- namely, somewhere along the line, a const_cast will be
+necessary to remove that const so that release() may be called. This
+may result in undefined behavior [7.1.5.1/4]. The conversion
+operator does not have to be const, because a non-const implicit
+object parameter may be bound to an rvalue [13.3.3.1.4/3]
+[13.3.1/5]. </p>
+
+ <p>Tokyo: The LWG removed the following from the proposed resolution:</p>
+
+ <p>In 20.4.5 <a href="lib-utilities.html#lib.auto.ptr"> [lib.auto.ptr]</a>, paragraph 2, and 20.4.5.3 <a href="lib-utilities.html#lib.auto.ptr.conv"> [lib.auto.ptr.conv]</a>,
+ paragraph 2, make the conversion to auto_ptr_ref const:</p>
+ <blockquote>
+ <pre>template&lt;class Y&gt; operator auto_ptr_ref&lt;Y&gt;() const throw();</pre>
+ </blockquote>
+<p><b>Proposed resolution:</b></p>
+<p>In 20.4.5 <a href="lib-utilities.html#lib.auto.ptr"> [lib.auto.ptr]</a>, paragraph 2, move
+the <tt>auto_ptr_ref</tt> definition to namespace scope.</p>
+
+<p>In 20.4.5 <a href="lib-utilities.html#lib.auto.ptr"> [lib.auto.ptr]</a>, paragraph 2, add
+a public assignment operator to the <tt>auto_ptr</tt> definition: </p>
+
+<blockquote>
+ <pre>auto_ptr&amp; operator=(auto_ptr_ref&lt;X&gt; r) throw();</pre>
+</blockquote>
+
+<p>Also add the assignment operator to 20.4.5.3 <a href="lib-utilities.html#lib.auto.ptr.conv"> [lib.auto.ptr.conv]</a>: </p>
+
+<blockquote>
+ <pre>auto_ptr&amp; operator=(auto_ptr_ref&lt;X&gt; r) throw()</pre>
+
+ <b>Effects:</b> Calls <tt>reset(p.release())</tt> for the <tt>auto_ptr
+ p</tt> that <tt>r</tt> holds a reference to.<br>
+ <b>Returns: </b><tt>*this</tt>.
+
+</blockquote>
+<hr>
+<a name="129"><h3>129.&nbsp;Need error indication from seekp() and seekg()</h3></a><p>
+<b>Section:</b>&nbsp;27.6.1.3 <a href="lib-iostreams.html#lib.istream.unformatted"> [lib.istream.unformatted]</a>, 27.6.2.4 <a href="lib-iostreams.html#lib.ostream.seeks"> [lib.ostream.seeks]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Angelika Langer&nbsp; <b>Date:</b>&nbsp;22 Feb 1999</p>
+<p>Currently, the standard does not specify how seekg() and seekp()
+indicate failure. They are not required to set failbit, and they can't
+return an error indication because they must return *this, i.e. the
+stream. Hence, it is undefined what happens if they fail. And they
+<i>can</i> fail, for instance, when a file stream is disconnected from the
+underlying file (is_open()==false) or when a wide character file
+stream must perform a state-dependent code conversion, etc. </p>
+
+<p>The stream functions seekg() and seekp() should set failbit in the
+stream state in case of failure.</p>
+<p><b>Proposed resolution:</b></p>
+<p>Add to the Effects: clause of&nbsp; seekg() in
+27.6.1.3 <a href="lib-iostreams.html#lib.istream.unformatted"> [lib.istream.unformatted]</a> and to the Effects: clause of seekp() in
+27.6.2.4 <a href="lib-iostreams.html#lib.ostream.seeks"> [lib.ostream.seeks]</a>: </p>
+
+<blockquote>
+ <p>In case of failure, the function calls <tt>setstate(failbit)</tt> (which may throw <tt>ios_base::failure</tt>).
+ </p>
+</blockquote>
+<p><b>Rationale:</b></p>
+<p>Setting failbit is the usual error reporting mechanism for streams</p>
+<hr>
+<a name="132"><h3>132.&nbsp;list::resize description uses random access iterators</h3></a><p>
+<b>Section:</b>&nbsp;23.2.2.2 <a href="lib-containers.html#lib.list.capacity"> [lib.list.capacity]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Howard Hinnant&nbsp; <b>Date:</b>&nbsp;6 Mar 1999</p>
+<p>The description reads:</p>
+
+<p>-1- Effects:</p>
+
+<pre> if (sz &gt; size())
+ insert(end(), sz-size(), c);
+ else if (sz &lt; size())
+ erase(begin()+sz, end());
+ else
+ ; // do nothing</pre>
+
+<p>Obviously list::resize should not be specified in terms of random access iterators.</p>
+<p><b>Proposed resolution:</b></p>
+<p>Change 23.2.2.2 paragraph 1 to:</p>
+
+<p>Effects:</p>
+
+<pre> if (sz &gt; size())
+ insert(end(), sz-size(), c);
+ else if (sz &lt; size())
+ {
+ iterator i = begin();
+ advance(i, sz);
+ erase(i, end());
+ }</pre>
+
+<p><i>[Dublin: The LWG asked Howard to discuss exception safety offline
+with David Abrahams. They had a discussion and believe there is
+no issue of exception safety with the proposed resolution.]</i></p>
+<hr>
+<a name="133"><h3>133.&nbsp;map missing get_allocator()</h3></a><p>
+<b>Section:</b>&nbsp;23.3.1 <a href="lib-containers.html#lib.map"> [lib.map]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Howard Hinnant&nbsp; <b>Date:</b>&nbsp;6 Mar 1999</p>
+<p>The title says it all.</p>
+<p><b>Proposed resolution:</b></p>
+<p>Insert in 23.3.1 <a href="lib-containers.html#lib.map"> [lib.map]</a>, paragraph 2,
+after operator= in the map declaration:</p>
+
+<pre> allocator_type get_allocator() const;</pre>
+<hr>
+<a name="134"><h3>134.&nbsp;vector constructors over specified</h3></a><p>
+<b>Section:</b>&nbsp;23.2.4.1 <a href="lib-containers.html#lib.vector.cons"> [lib.vector.cons]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Howard Hinnant&nbsp; <b>Date:</b>&nbsp;6 Mar 1999</p>
+<p>The complexity description says: &quot;It does at most 2N calls to the copy constructor
+of T and logN reallocations if they are just input iterators ...&quot;.</p>
+
+<p>This appears to be overly restrictive, dictating the precise memory/performance
+tradeoff for the implementor.</p>
+<p><b>Proposed resolution:</b></p>
+<p>Change 23.2.4.1 <a href="lib-containers.html#lib.vector.cons"> [lib.vector.cons]</a>, paragraph 1 to:</p>
+
+<p>-1- Complexity: The constructor template &lt;class
+InputIterator&gt; vector(InputIterator first, InputIterator last)
+makes only N calls to the copy constructor of T (where N is the
+distance between first and last) and no reallocations if iterators
+first and last are of forward, bidirectional, or random access
+categories. It makes order N calls to the copy constructor of T and
+order logN reallocations if they are just input iterators.
+</p>
+<p><b>Rationale:</b></p>
+<p>&quot;at most 2N calls&quot; is correct only if the growth factor
+is greater than or equal to 2.
+</p>
+<hr>
+<a name="136"><h3>136.&nbsp;seekp, seekg setting wrong streams?</h3></a><p>
+<b>Section:</b>&nbsp;27.6.1.3 <a href="lib-iostreams.html#lib.istream.unformatted"> [lib.istream.unformatted]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Howard Hinnant&nbsp; <b>Date:</b>&nbsp;6 Mar 1999</p>
+<p>I may be misunderstanding the intent, but should not seekg set only
+the input stream and seekp set only the output stream? The description
+seems to say that each should set both input and output streams. If
+that's really the intent, I withdraw this proposal.</p>
+<p><b>Proposed resolution:</b></p>
+<p>In section 27.6.1.3 change:</p>
+
+<pre>basic_istream&lt;charT,traits&gt;&amp; seekg(pos_type pos);
+Effects: If fail() != true, executes rdbuf()-&gt;pubseekpos(pos). </pre>
+
+<p>To:</p>
+
+<pre>basic_istream&lt;charT,traits&gt;&amp; seekg(pos_type pos);
+Effects: If fail() != true, executes rdbuf()-&gt;pubseekpos(pos, ios_base::in). </pre>
+
+<p>In section 27.6.1.3 change:</p>
+
+<pre>basic_istream&lt;charT,traits&gt;&amp; seekg(off_type&amp; off, ios_base::seekdir dir);
+Effects: If fail() != true, executes rdbuf()-&gt;pubseekoff(off, dir). </pre>
+
+<p>To:</p>
+
+<pre>basic_istream&lt;charT,traits&gt;&amp; seekg(off_type&amp; off, ios_base::seekdir dir);
+Effects: If fail() != true, executes rdbuf()-&gt;pubseekoff(off, dir, ios_base::in). </pre>
+
+<p>In section 27.6.2.4, paragraph 2 change:</p>
+
+<pre>-2- Effects: If fail() != true, executes rdbuf()-&gt;pubseekpos(pos). </pre>
+
+<p>To:</p>
+
+<pre>-2- Effects: If fail() != true, executes rdbuf()-&gt;pubseekpos(pos, ios_base::out). </pre>
+
+<p>In section 27.6.2.4, paragraph 4 change:</p>
+
+<pre>-4- Effects: If fail() != true, executes rdbuf()-&gt;pubseekoff(off, dir). </pre>
+
+<p>To:</p>
+
+<pre>-4- Effects: If fail() != true, executes rdbuf()-&gt;pubseekoff(off, dir, ios_base::out). </pre>
+
+<p><i>[Dublin: Dietmar K&uuml;hl thinks this is probably correct, but would
+like the opinion of more iostream experts before taking action.]</i></p>
+
+<p><i>[Tokyo: Reviewed by the LWG. PJP noted that although his docs are
+incorrect, his implementation already implements the Proposed
+Resolution.]</i></p>
+
+<p><i>[Post-Tokyo: Matt Austern comments:<br>
+Is it a problem with basic_istream and basic_ostream, or is it a problem
+with basic_stringbuf?
+We could resolve the issue either by changing basic_istream and
+basic_ostream, or by changing basic_stringbuf. I prefer the latter
+change (or maybe both changes): I don't see any reason for the standard to
+require that std::stringbuf s(std::string(&quot;foo&quot;), std::ios_base::in);
+s.pubseekoff(0, std::ios_base::beg); must fail.<br>
+This requirement is a bit weird. There's no similar requirement
+for basic_streambuf&lt;&gt;::seekpos, or for basic_filebuf&lt;&gt;::seekoff or
+basic_filebuf&lt;&gt;::seekpos.]</i></p>
+<hr>
+<a name="137"><h3>137.&nbsp;Do use_facet and has_facet look in the global locale?</h3></a><p>
+<b>Section:</b>&nbsp;22.1.1 <a href="lib-locales.html#lib.locale"> [lib.locale]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Angelika Langer&nbsp; <b>Date:</b>&nbsp;17 Mar 1999</p>
+<p>Section 22.1.1 <a href="lib-locales.html#lib.locale"> [lib.locale]</a> says:</p>
+
+<p>-4- In the call to use_facet&lt;Facet&gt;(loc), the type argument
+chooses a facet, making available all members of the named type. If
+Facet is not present in a locale (or, failing that, in the global
+locale), it throws the standard exception bad_cast. A C++ program can
+check if a locale implements a particular facet with the template
+function has_facet&lt;Facet&gt;(). </p>
+
+<p>This contradicts the specification given in section
+22.1.2 <a href="lib-locales.html#lib.locale.global.templates"> [lib.locale.global.templates]</a>:
+<br><br>
+template &lt;class&nbsp; Facet&gt; const&nbsp; Facet&amp; use_facet(const
+locale&amp;&nbsp; loc); <br>
+<br>
+-1- Get a reference to a facet of a locale. <br>
+-2- Returns: a reference to the corresponding facet of loc, if present. <br>
+-3- Throws: bad_cast if has_facet&lt;Facet&gt;(loc) is false. <br>
+-4- Notes: The reference returned remains valid at least as long as any copy of loc exists
+</p>
+<p><b>Proposed resolution:</b></p>
+<p>Remove the phrase &quot;(or, failing that, in the global locale)&quot;
+from section 22.1.1. </p>
+<p><b>Rationale:</b></p>
+<p>Needed for consistency with the way locales are handled elsewhere
+in the standard.</p>
+<hr>
+<a name="139"><h3>139.&nbsp;Optional sequence operation table description unclear</h3></a><p>
+<b>Section:</b>&nbsp;23.1.1 <a href="lib-containers.html#lib.sequence.reqmts"> [lib.sequence.reqmts]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Andrew Koenig&nbsp; <b>Date:</b>&nbsp;30 Mar 1999</p>
+<p>The sentence introducing the Optional sequence operation table
+(23.1.1 paragraph 12) has two problems:</p>
+
+<p>A. It says ``The operations in table 68 are provided only for the containers for which
+they take constant time.''<br>
+<br>
+That could be interpreted in two ways, one of them being ``Even though table 68 shows
+particular operations as being provided, implementations are free to omit them if they
+cannot implement them in constant time.''<br>
+<br>
+B. That paragraph says nothing about amortized constant time, and it should.&nbsp;</p>
+<p><b>Proposed resolution:</b></p>
+<p>Replace the wording in 23.1.1 paragraph 12&nbsp; which begins ``The operations in table 68 are provided only...&quot;
+with:</p>
+
+<blockquote>
+ <p>Table 68 lists sequence operations that are provided for some types of sequential
+ containers but not others. An implementation shall provide these operations for all
+ container types shown in the ``container'' column, and shall implement them so as to take
+ amortized constant time.</p>
+</blockquote>
+<hr>
+<a name="141"><h3>141.&nbsp;basic_string::find_last_of, find_last_not_of say pos instead of xpos</h3></a><p>
+<b>Section:</b>&nbsp;21.3.6.4 <a href="lib-strings.html#lib.string::find.last.of"> [lib.string::find.last.of]</a>, 21.3.6.6 <a href="lib-strings.html#lib.string::find.last.not.of"> [lib.string::find.last.not.of]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Arch Robison&nbsp; <b>Date:</b>&nbsp;28 Apr 1999</p>
+<p>Sections 21.3.6.4 paragraph 1 and 21.3.6.6 paragraph 1 surely have misprints where they
+say:<br>
+<br>
+&#x97; <tt>xpos &lt;= pos</tt> and <tt>pos &lt; size();</tt>
+</p>
+
+<p>Surely the document meant to say ``<tt>xpos &lt; size()</tt>'' in both places.</p>
+
+<p><i>[Judy Ward also sent in this issue for 21.3.6.4 with the same
+proposed resolution.]</i></p>
+<p><b>Proposed resolution:</b></p>
+<p>Change Sections 21.3.6.4 paragraph 1 and 21.3.6.6 paragraph 1, the line which says:<br>
+<br>
+&#x97; <tt>xpos &lt;= pos</tt> and <tt>pos &lt; size();<br>
+<br>
+</tt>to:<br>
+<tt><br>
+</tt>&#x97; <tt>xpos &lt;= pos</tt> and <tt>xpos &lt; size();</tt>
+</p>
+<hr>
+<a name="142"><h3>142.&nbsp;lexicographical_compare complexity wrong</h3></a><p>
+<b>Section:</b>&nbsp;25.3.8 <a href="lib-algorithms.html#lib.alg.lex.comparison"> [lib.alg.lex.comparison]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Howard Hinnant&nbsp; <b>Date:</b>&nbsp;20 Jun 1999</p>
+<p>The lexicographical_compare complexity is specified as:<br>
+<br>
+&nbsp;&nbsp;&nbsp;&nbsp; &quot;At most min((last1 - first1), (last2 - first2))
+applications of the corresponding comparison.&quot;<br>
+<br>
+The best I can do is twice that expensive.</p>
+
+<p>Nicolai Josuttis comments in lib-6862: You mean, to check for
+equality you have to check both &lt; and &gt;? Yes, IMO you are
+right! (and Matt states this complexity in his book)</p>
+
+<p><b>Proposed resolution:</b></p>
+<p>Change 25.3.8 <a href="lib-algorithms.html#lib.alg.lex.comparison"> [lib.alg.lex.comparison]</a> complexity to:</p>
+ <blockquote>
+ At most <tt>2*min((last1 - first1), (last2 - first2))</tt>
+ applications of the corresponding comparison.
+ </blockquote>
+
+<p>Change the example at the end of paragraph 3 to read:</p>
+ <blockquote>
+ [Example:<br>
+ <br>
+ &nbsp;&nbsp;&nbsp; for ( ; first1 != last1 &amp;&amp; first2 != last2 ;
+ ++first1, ++first2) {<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (*first1 &lt; *first2) return true;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (*first2 &lt; *first1) return false;<br>
+ &nbsp;&nbsp;&nbsp; }<br>
+ &nbsp;&nbsp;&nbsp; return first1 == last1 &amp;&amp; first2 != last2;<br>
+ &nbsp;&nbsp;&nbsp;<br>
+ --end example]
+ </blockquote>
+<hr>
+<a name="144"><h3>144.&nbsp;Deque constructor complexity wrong </h3></a><p>
+<b>Section:</b>&nbsp;23.2.1.1 <a href="lib-containers.html#lib.deque.cons"> [lib.deque.cons]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Herb Sutter&nbsp; <b>Date:</b>&nbsp;9 May 1999</p>
+<p>In 23.2.1.1 paragraph 6, the deque ctor that takes an iterator range appears
+to have complexity requirements which are incorrect, and which contradict the
+complexity requirements for insert(). I suspect that the text in question,
+below, was taken from vector:</p>
+<blockquote>
+ <p>Complexity: If the iterators first and last are forward iterators,
+ bidirectional iterators, or random access iterators the constructor makes only
+ N calls to the copy constructor, and performs no reallocations, where N is
+ last - first.</p>
+</blockquote>
+<p>The word &quot;reallocations&quot; does not really apply to deque. Further,
+all of the following appears to be spurious:</p>
+<blockquote>
+ <p>It makes at most 2N calls to the copy constructor of T and log N
+ reallocations if they are input iterators.1)</p>
+ <p>1) The complexity is greater in the case of input iterators because each
+ element must be added individually: it is impossible to determine the distance
+ between first abd last before doing the copying.</p>
+</blockquote>
+<p>This makes perfect sense for vector, but not for deque. Why should deque gain
+an efficiency advantage from knowing in advance the number of elements to
+insert?</p>
+<p><b>Proposed resolution:</b></p>
+<p>In 23.2.1.1 paragraph 6, replace the Complexity description, including the
+footnote, with the following text (which also corrects the &quot;abd&quot;
+typo):</p>
+<blockquote>
+ <p>Complexity: Makes last - first calls to the copy constructor of T.</p>
+</blockquote>
+<hr>
+<a name="146"><h3>146.&nbsp;complex&lt;T&gt; Inserter and Extractor need sentries</h3></a><p>
+<b>Section:</b>&nbsp;26.2.6 <a href="lib-numerics.html#lib.complex.ops"> [lib.complex.ops]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Angelika Langer&nbsp; <b>Date:</b>&nbsp;12 May 1999</p>
+<p>The <u> extractor</u> for complex numbers is specified as:&nbsp;</p>
+
+<blockquote>
+
+<p> template&lt;class T, class charT, class traits&gt;&nbsp;<br>
+ basic_istream&lt;charT, traits&gt;&amp;&nbsp;<br>
+ operator&gt;&gt;(basic_istream&lt;charT, traits&gt;&amp; is, complex&lt;T&gt;&amp; x);<br>
+&nbsp;<br>
+Effects: Extracts a complex number x of the form: u, (u), or (u,v),
+where u is the real part and v is the imaginary part
+(lib.istream.formatted).&nbsp;<br>
+Requires: The input values be convertible to T. If bad input is
+encountered, calls is.setstate(ios::failbit) (which may throw
+ios::failure (lib.iostate.flags).&nbsp;<br>
+Returns: is .</p>
+
+</blockquote>
+<p>Is it intended that the extractor for complex numbers does not skip
+whitespace, unlike all other extractors in the standard library do?
+Shouldn't a sentry be used?&nbsp;<br>
+<br>
+The <u>inserter</u> for complex numbers is specified as:</p>
+
+<blockquote>
+
+<p> template&lt;class T, class charT, class traits&gt;&nbsp;<br>
+ basic_ostream&lt;charT, traits&gt;&amp;&nbsp;<br>
+ operator&lt;&lt;(basic_ostream&lt;charT, traits&gt;&amp; o, const complex&lt;T&gt;&amp; x);<br>
+<br>
+Effects: inserts the complex number x onto the stream o as if it were implemented as follows:<br>
+<br>
+ template&lt;class T, class charT, class traits&gt;&nbsp;<br>
+ basic_ostream&lt;charT, traits&gt;&amp;&nbsp;<br>
+ operator&lt;&lt;(basic_ostream&lt;charT, traits&gt;&amp; o, const complex&lt;T&gt;&amp; x)&nbsp;<br>
+ {&nbsp;<br>
+ basic_ostringstream&lt;charT, traits&gt; s;&nbsp;<br>
+ s.flags(o.flags());&nbsp;<br>
+ s.imbue(o.getloc());&nbsp;<br>
+ s.precision(o.precision());&nbsp;<br>
+ s &lt;&lt; '(' &lt;&lt; x.real() &lt;&lt; &quot;,&quot; &lt;&lt; x.imag() &lt;&lt; ')';&nbsp;<br>
+ return o &lt;&lt; s.str();&nbsp;<br>
+ }</p>
+
+</blockquote>
+
+<p>Is it intended that the inserter for complex numbers ignores the
+field width and does not do any padding? If, with the suggested
+implementation above, the field width were set in the stream then the
+opening parentheses would be adjusted, but the rest not, because the
+field width is reset to zero after each insertion.</p>
+
+<p>I think that both operations should use sentries, for sake of
+consistency with the other inserters and extractors in the
+library. Regarding the issue of padding in the inserter, I don't know
+what the intent was.&nbsp;</p>
+<p><b>Proposed resolution:</b></p>
+<p>After 26.2.6 <a href="lib-numerics.html#lib.complex.ops"> [lib.complex.ops]</a> paragraph 14 (operator&gt;&gt;), add a
+Notes clause:</p>
+
+<blockquote>
+
+<p>Notes: This extraction is performed as a series of simpler
+extractions. Therefore, the skipping of whitespace is specified to be the
+same for each of the simpler extractions.</p>
+
+</blockquote>
+<p><b>Rationale:</b></p>
+<p>For extractors, the note is added to make it clear that skipping whitespace
+follows an &quot;all-or-none&quot; rule.</p>
+
+<p>For inserters, the LWG believes there is no defect; the standard is correct
+as written.</p>
+<hr>
+<a name="147"><h3>147.&nbsp;Library Intro refers to global functions that aren't global</h3></a><p>
+<b>Section:</b>&nbsp;17.4.4.3 <a href="lib-intro.html#lib.global.functions"> [lib.global.functions]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Lois Goldthwaite&nbsp; <b>Date:</b>&nbsp;4 Jun 1999</p>
+<p>The library had many global functions until 17.4.1.1 [lib.contents]
+paragraph 2 was added: </p>
+
+<blockquote>
+
+<p>All library entities except macros, operator new and operator
+delete are defined within the namespace std or namespaces nested
+within namespace std. </p>
+
+</blockquote>
+
+<p>It appears &quot;global function&quot; was never updated in the following: </p>
+
+<blockquote>
+
+<p>17.4.4.3 - Global functions [lib.global.functions]<br>
+<br>
+-1- It is unspecified whether any global functions in the C++ Standard
+Library are defined as inline (dcl.fct.spec).<br>
+<br>
+-2- A call to a global function signature described in Clauses
+lib.language.support through lib.input.output behaves the same as if
+the implementation declares no additional global function
+signatures.*<br>
+<br>
+ [Footnote: A valid C++ program always calls the expected library
+ global function. An implementation may also define additional
+ global functions that would otherwise not be called by a valid C++
+ program. --- end footnote]<br>
+<br>
+-3- A global function cannot be declared by the implementation as
+taking additional default arguments.&nbsp;<br>
+<br>
+17.4.4.4 - Member functions [lib.member.functions]<br>
+<br>
+-2- An implementation can declare additional non-virtual member
+function signatures within a class: </p>
+
+ <blockquote>
+
+<p>-- by adding arguments with default values to a member function
+signature; The same latitude does not extend to the implementation of
+virtual or global functions, however. </p>
+
+ </blockquote>
+</blockquote>
+<p><b>Proposed resolution:</b></p>
+<p> Change &quot;global&quot; to &quot;global or non-member&quot; in:</p>
+<blockquote>
+ <p>17.4.4.3 [lib.global.functions] section title,<br>
+ 17.4.4.3 [lib.global.functions] para 1,<br>
+ 17.4.4.3 [lib.global.functions] para 2 in 2 places plus 2
+ places in the footnote,<br>
+ 17.4.4.3 [lib.global.functions] para 3,<br>
+ 17.4.4.4 [lib.member.functions] para 2</p>
+</blockquote>
+<p><b>Rationale:</b></p>
+<p>
+Because operator new and delete are global, the proposed resolution
+was changed from &quot;non-member&quot; to &quot;global or non-member.
+</p>
+<hr>
+<a name="148"><h3>148.&nbsp;Functions in the example facet BoolNames should be const</h3></a><p>
+<b>Section:</b>&nbsp;22.2.8 <a href="lib-locales.html#lib.facets.examples"> [lib.facets.examples]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Jeremy Siek&nbsp; <b>Date:</b>&nbsp;3 Jun 1999</p>
+<p>In 22.2.8 <a href="lib-locales.html#lib.facets.examples"> [lib.facets.examples]</a> paragraph 13, the do_truename() and
+do_falsename() functions in the example facet BoolNames should be
+const. The functions they are overriding in
+numpunct_byname&lt;char&gt; are const. </p>
+<p><b>Proposed resolution:</b></p>
+<p>In 22.2.8 <a href="lib-locales.html#lib.facets.examples"> [lib.facets.examples]</a> paragraph 13, insert &quot;const&quot; in
+two places:</p>
+<blockquote>
+ <p><tt>string do_truename() const { return &quot;Oui Oui!&quot;; }<br>
+ string do_falsename() const { return &quot;Mais Non!&quot;; }</tt></p>
+</blockquote>
+<hr>
+<a name="150"><h3>150.&nbsp;Find_first_of says integer instead of iterator </h3></a><p>
+<b>Section:</b>&nbsp;25.1.4 <a href="lib-algorithms.html#lib.alg.find.first.of"> [lib.alg.find.first.of]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Matt McClure&nbsp; <b>Date:</b>&nbsp;30 Jun 1999</p>
+<p><b>Proposed resolution:</b></p>
+<p>Change 25.1.4 <a href="lib-algorithms.html#lib.alg.find.first.of"> [lib.alg.find.first.of]</a> paragraph 2 from:</p>
+
+<blockquote>
+<p>Returns: The first iterator i in the range [first1, last1) such
+that for some <u>integer</u> j in the range [first2, last2) ...</p>
+</blockquote>
+
+<p>to:</p>
+
+<blockquote>
+<p>Returns: The first iterator i in the range [first1, last1) such
+that for some iterator j in the range [first2, last2) ...</p>
+</blockquote>
+<hr>
+<a name="151"><h3>151.&nbsp;Can't currently clear() empty container</h3></a><p>
+<b>Section:</b>&nbsp;23.1.1 <a href="lib-containers.html#lib.sequence.reqmts"> [lib.sequence.reqmts]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Ed Brey&nbsp; <b>Date:</b>&nbsp;21 Jun 1999</p>
+<p>For both sequences and associative containers, a.clear() has the
+semantics of erase(a.begin(),a.end()), which is undefined for an empty
+container since erase(q1,q2) requires that q1 be dereferenceable
+(23.1.1,3 and 23.1.2,7). When the container is empty, a.begin() is
+not dereferenceable.<br>
+<br>
+The requirement that q1 be unconditionally dereferenceable causes many
+operations to be intuitively undefined, of which clearing an empty
+container is probably the most dire.<br>
+<br>
+Since q1 and q2 are only referenced in the range [q1, q2), and [q1,
+q2) is required to be a valid range, stating that q1 and q2 must be
+iterators or certain kinds of iterators is unnecessary.
+</p>
+<p><b>Proposed resolution:</b></p>
+<p>In 23.1.1, paragraph 3, change:</p>
+<blockquote>
+ <p>p and q2 denote valid iterators to a, q <u> and q1</u> denote valid dereferenceable iterators to a, [q1, q2) denotes a valid range</p>
+</blockquote>
+<p>to:</p>
+<blockquote>
+ <p>p denotes a valid iterator to a, q denotes a valid dereferenceable iterator to a, [q1, q2) denotes a valid range<u>
+ in a</u>
+</p>
+</blockquote>
+<p>In 23.1.2, paragraph 7, change:</p>
+<blockquote>
+ <p>p and q2 are valid iterators to a, q <u> and q1</u> are valid dereferenceable
+ iterators to a, [q1, q2) is a valid range</p>
+</blockquote>
+<p>to</p>
+<blockquote>
+ <p>p is a valid iterator to a, q is a valid dereferenceable iterator to a, [q1, q2) is a valid range
+ <u>into a</u>
+</p>
+</blockquote>
+<hr>
+<a name="152"><h3>152.&nbsp;Typo in <tt>scan_is()</tt> semantics</h3></a><p>
+<b>Section:</b>&nbsp;22.2.1.1.2 <a href="lib-locales.html#lib.locale.ctype.virtuals"> [lib.locale.ctype.virtuals]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Dietmar K&uuml;hl&nbsp; <b>Date:</b>&nbsp;20 Jul 1999</p>
+<p>The semantics of <tt>scan_is()</tt> (paragraphs 4 and 6) is not exactly described
+because there is no function <tt>is()</tt> which only takes a character as
+argument. Also, in the effects clause (paragraph 3), the semantic is also kept
+vague.</p>
+<p><b>Proposed resolution:</b></p>
+<p>In 22.2.1.1.2 <a href="lib-locales.html#lib.locale.ctype.virtuals"> [lib.locale.ctype.virtuals]</a> paragraphs 4 and 6, change the returns
+clause from:</p>
+<blockquote>
+ <p>&quot;... such that <tt>is(*p)</tt>
+would...&quot;</p>
+</blockquote>
+<p>to:&nbsp; &quot;... such that <tt>is(m, *p)</tt>
+ would....&quot;</p>
+<hr>
+<a name="153"><h3>153.&nbsp;Typo in <tt>narrow()</tt> semantics</h3></a><p>
+<b>Section:</b>&nbsp;22.2.1.3.2 <a href="lib-locales.html#lib.facet.ctype.char.members"> [lib.facet.ctype.char.members]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Dietmar K&uuml;hl&nbsp; <b>Date:</b>&nbsp;20 Jul 1999</p>
+<p>The description of the array version of <tt>narrow()</tt> (in
+paragraph 11) is flawed: There is no member <tt>do_narrow()</tt> which
+takes only three arguments because in addition to the range a default
+character is needed.</p>
+
+<p>Additionally, for both <tt>widen</tt> and <tt>narrow</tt> we have
+two signatures followed by a <b>Returns</b> clause that only addresses
+one of them.</p>
+
+<p><b>Proposed resolution:</b></p>
+<p>Change the returns clause in 22.2.1.3.2 <a href="lib-locales.html#lib.facet.ctype.char.members"> [lib.facet.ctype.char.members]</a>
+paragraph 10 from:</p>
+<p>&nbsp;&nbsp;&nbsp; Returns: do_widen(low, high, to).</p>
+
+<p>to:</p>
+<p>&nbsp;&nbsp;&nbsp; Returns: do_widen(c) or do_widen(low, high, to),
+respectively.</p>
+
+<p>Change 22.2.1.3.2 <a href="lib-locales.html#lib.facet.ctype.char.members"> [lib.facet.ctype.char.members]</a> paragraph 10 and 11 from:</p>
+<pre> char narrow(char c, char /*dfault*/) const;
+ const char* narrow(const char* low, const char* high,
+ char /*dfault*/, char* to) const;</pre>
+<pre> Returns: do_narrow(low, high, to).</pre>
+<p>to:</p>
+<pre> char narrow(char c, char dfault) const;
+ const char* narrow(const char* low, const char* high,
+ char dfault, char* to) const;</pre>
+<pre> Returns: do_narrow(c, dfault) or
+ do_narrow(low, high, dfault, to), respectively.</pre>
+
+<p><i>[Kona: 1) the problem occurs in additional places, 2) a user
+defined version could be different.]</i></p>
+
+<p><i>[Post-Tokyo: Dietmar provided the above wording at the request of
+the LWG. He could find no other places the problem occurred. He
+asks for clarification of the Kona &quot;a user defined
+version...&quot; comment above. Perhaps it was a circuitous way of
+saying &quot;dfault&quot; needed to be uncommented?]</i></p>
+
+<p><i>[Post-Toronto: the issues list maintainer has merged in the
+proposed resolution from issue <a href="lwg-closed.html#207">207</a>, which addresses the
+same paragraphs.]</i></p>
+<hr>
+<a name="154"><h3>154.&nbsp;Missing <tt>double</tt> specifier for <tt>do_get()</tt>
+</h3></a><p>
+<b>Section:</b>&nbsp;22.2.2.1.2 <a href="lib-locales.html#lib.facet.num.get.virtuals"> [lib.facet.num.get.virtuals]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Dietmar K&uuml;hl&nbsp; <b>Date:</b>&nbsp;20 Jul 1999</p>
+<p>The table in paragraph 7 for the length modifier does not list the length
+modifier <tt>l</tt> to be applied if the type is <tt>double</tt>. Thus, the
+standard asks the implementation to do undefined things when using <tt>scanf()</tt>
+(the missing length modifier for <tt>scanf()</tt> when scanning <tt>double</tt>s
+is actually a problem I found quite often in production code, too).</p>
+<p><b>Proposed resolution:</b></p>
+<p>In 22.2.2.1.2 <a href="lib-locales.html#lib.facet.num.get.virtuals"> [lib.facet.num.get.virtuals]</a>, paragraph 7, add a row in the Length
+Modifier table to say that for <tt>double</tt> a length modifier
+<tt>l</tt> is to be used.</p>
+<p><b>Rationale:</b></p>
+<p>The standard makes an embarrassing beginner's mistake.</p>
+<hr>
+<a name="155"><h3>155.&nbsp;Typo in naming the class defining the class <tt>Init</tt>
+</h3></a><p>
+<b>Section:</b>&nbsp;27.3 <a href="lib-iostreams.html#lib.iostream.objects"> [lib.iostream.objects]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Dietmar K&uuml;hl&nbsp; <b>Date:</b>&nbsp;20 Jul 1999</p>
+<p>There are conflicting statements about where the class
+<tt>Init</tt> is defined. According to 27.3 <a href="lib-iostreams.html#lib.iostream.objects"> [lib.iostream.objects]</a> paragraph 2
+it is defined as <tt>basic_ios::Init</tt>, according to 27.4.2 <a href="lib-iostreams.html#lib.ios.base"> [lib.ios.base]</a> it is defined as <tt>ios_base::Init</tt>.</p>
+<p><b>Proposed resolution:</b></p>
+<p>Change 27.3 <a href="lib-iostreams.html#lib.iostream.objects"> [lib.iostream.objects]</a> paragraph 2 from
+&quot;<tt>basic_ios::Init&quot;</tt> to
+&quot;<tt>ios_base::Init&quot;</tt>.</p>
+<p><b>Rationale:</b></p>
+<p>Although not strictly wrong, the standard was misleading enough to warrant
+the change.</p>
+<hr>
+<a name="156"><h3>156.&nbsp;Typo in <tt>imbue()</tt> description</h3></a><p>
+<b>Section:</b>&nbsp;27.4.2.3 <a href="lib-iostreams.html#lib.ios.base.locales"> [lib.ios.base.locales]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Dietmar K&uuml;hl&nbsp; <b>Date:</b>&nbsp;20 Jul 1999</p>
+<p>There is a small discrepancy between the declarations of
+<tt>imbue()</tt>: in 27.4.2 <a href="lib-iostreams.html#lib.ios.base"> [lib.ios.base]</a> the argument is passed as
+<tt>locale const&amp;</tt> (correct), in 27.4.2.3 <a href="lib-iostreams.html#lib.ios.base.locales"> [lib.ios.base.locales]</a> it
+is passed as <tt>locale const</tt> (wrong).</p>
+<p><b>Proposed resolution:</b></p>
+<p>In 27.4.2.3 <a href="lib-iostreams.html#lib.ios.base.locales"> [lib.ios.base.locales]</a> change the <tt>imbue</tt> argument
+from &quot;<tt>locale const&quot; to &quot;locale
+const&amp;&quot;.</tt>
+</p>
+<hr>
+<a name="158"><h3>158.&nbsp;Underspecified semantics for <tt>setbuf()</tt>
+</h3></a><p>
+<b>Section:</b>&nbsp;27.5.2.4.2 <a href="lib-iostreams.html#lib.streambuf.virt.buffer"> [lib.streambuf.virt.buffer]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Dietmar K&uuml;hl&nbsp; <b>Date:</b>&nbsp;20 Jul 1999</p>
+<p>The default behavior of <tt>setbuf()</tt> is described only for the
+situation that <tt>gptr() != 0 &amp;&amp; gptr() != egptr()</tt>:
+namely to do nothing. What has to be done in other situations&nbsp;
+is not described although there is actually only one reasonable
+approach, namely to do nothing, too.</p>
+
+<p>Since changing the buffer would almost certainly mess up most
+buffer management of derived classes unless these classes do it
+themselves, the default behavior of <tt>setbuf()</tt> should always be
+to do nothing.</p>
+<p><b>Proposed resolution:</b></p>
+<p>Change 27.5.2.4.2 <a href="lib-iostreams.html#lib.streambuf.virt.buffer"> [lib.streambuf.virt.buffer]</a>, paragraph 3, Default behavior,
+to: &quot;Default behavior: Does nothing. Returns this.&quot;</p>
+<hr>
+<a name="159"><h3>159.&nbsp;Strange use of <tt>underflow()</tt>
+</h3></a><p>
+<b>Section:</b>&nbsp;27.5.2.4.3 <a href="lib-iostreams.html#lib.streambuf.virt.get"> [lib.streambuf.virt.get]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Dietmar K&uuml;hl&nbsp; <b>Date:</b>&nbsp;20 Jul 1999</p>
+<p>The description of the meaning of the result of
+<tt>showmanyc()</tt> seems to be rather strange: It uses calls to
+<tt>underflow()</tt>. Using <tt>underflow()</tt> is strange because
+this function only reads the current character but does not extract
+it, <tt>uflow()</tt> would extract the current character. This should
+be fixed to use <tt>sbumpc()</tt> instead.</p>
+<p><b>Proposed resolution:</b></p>
+<p>Change 27.5.2.4.3 <a href="lib-iostreams.html#lib.streambuf.virt.get"> [lib.streambuf.virt.get]</a> paragraph 1,
+<tt>showmanyc()</tt>returns clause, by replacing the word
+&quot;supplied&quot; with the words &quot;extracted from the
+stream&quot;.</p>
+<hr>
+<a name="160"><h3>160.&nbsp;Typo: Use of non-existing function <tt>exception()</tt>
+</h3></a><p>
+<b>Section:</b>&nbsp;27.6.1.1 <a href="lib-iostreams.html#lib.istream"> [lib.istream]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Dietmar K&uuml;hl&nbsp; <b>Date:</b>&nbsp;20 Jul 1999</p>
+<p>The paragraph 4 refers to the function <tt>exception()</tt> which
+is not defined. Probably, the referred function is
+<tt>basic_ios&lt;&gt;::exceptions()</tt>.</p>
+<p><b>Proposed resolution:</b></p>
+<p>In 27.6.1.1 <a href="lib-iostreams.html#lib.istream"> [lib.istream]</a>, 27.6.1.3 <a href="lib-iostreams.html#lib.istream.unformatted"> [lib.istream.unformatted]</a>, paragraph 1,
+27.6.2.1 <a href="lib-iostreams.html#lib.ostream"> [lib.ostream]</a>, paragraph 3, and 27.6.2.5.1 <a href="lib-iostreams.html#lib.ostream.formatted.reqmts"> [lib.ostream.formatted.reqmts]</a>,
+paragraph 1, change &quot;<tt>exception()&quot; to
+&quot;exceptions()&quot;</tt>.</p>
+
+<p><i>[Note to Editor: &quot;exceptions&quot; with an &quot;s&quot;
+is the correct spelling.]</i></p>
+<hr>
+<a name="161"><h3>161.&nbsp;Typo: <tt>istream_iterator</tt> vs. <tt>istreambuf_iterator</tt>
+</h3></a><p>
+<b>Section:</b>&nbsp;27.6.1.2.2 <a href="lib-iostreams.html#lib.istream.formatted.arithmetic"> [lib.istream.formatted.arithmetic]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Dietmar K&uuml;hl&nbsp; <b>Date:</b>&nbsp;20 Jul 1999</p>
+<p>The note in the second paragraph pretends that the first argument
+is an object of type <tt>istream_iterator</tt>. This is wrong: It is
+an object of type <tt>istreambuf_iterator</tt>.</p>
+<p><b>Proposed resolution:</b></p>
+<p>Change 27.6.1.2.2 <a href="lib-iostreams.html#lib.istream.formatted.arithmetic"> [lib.istream.formatted.arithmetic]</a> from:</p>
+<blockquote>
+ <p>The first argument provides an object of the istream_iterator class...</p>
+</blockquote>
+<p>to</p>
+<blockquote>
+ <p>The first argument provides an object of the istreambuf_iterator class...</p>
+</blockquote>
+<hr>
+<a name="164"><h3>164.&nbsp;do_put() has apparently unused fill argument</h3></a><p>
+<b>Section:</b>&nbsp;22.2.5.3.2 <a href="lib-locales.html#lib.locale.time.put.virtuals"> [lib.locale.time.put.virtuals]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Angelika Langer&nbsp; <b>Date:</b>&nbsp;23 Jul 1999</p>
+<p>In 22.2.5.3.2 <a href="lib-locales.html#lib.locale.time.put.virtuals"> [lib.locale.time.put.virtuals]</a> the do_put() function is specified
+as taking a fill character as an argument, but the description of the
+function does not say whether the character is used at all and, if so,
+in which way. The same holds for any format control parameters that
+are accessible through the ios_base&amp; argument, such as the
+adjustment or the field width. Is strftime() supposed to use the fill
+character in any way? In any case, the specification of
+time_put.do_put() looks inconsistent to me.<br> <br> Is the
+signature of do_put() wrong, or is the effects clause incomplete?</p>
+<p><b>Proposed resolution:</b></p>
+<p>Add the following note after 22.2.5.3.2 <a href="lib-locales.html#lib.locale.time.put.virtuals"> [lib.locale.time.put.virtuals]</a>
+paragraph 2:</p>
+<blockquote>
+ <p> [Note: the <tt>fill</tt> argument may be used in the implementation-defined formats, or by derivations. A space character is a reasonable default
+ for this argument. --end Note]</p>
+</blockquote>
+<p><b>Rationale:</b></p>
+<p>The LWG felt that while the normative text was correct,
+users need some guidance on what to pass for the <tt>fill</tt>
+argument since the standard doesn't say how it's used.</p>
+<hr>
+<a name="165"><h3>165.&nbsp;<tt>xsputn()</tt>, <tt>pubsync()</tt> never called by <tt>basic_ostream</tt> members?</h3></a><p>
+<b>Section:</b>&nbsp;27.6.2.1 <a href="lib-iostreams.html#lib.ostream"> [lib.ostream]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Dietmar K&uuml;hl&nbsp; <b>Date:</b>&nbsp;20 Jul 1999</p>
+<p>Paragraph 2 explicitly states that none of the <tt>basic_ostream</tt>
+functions falling into one of the groups &quot;formatted output functions&quot;
+and &quot;unformatted output functions&quot; calls any stream buffer function
+which might call a virtual function other than <tt>overflow()</tt>. Basically
+this is fine but this implies that <tt>sputn()</tt> (this function would call
+the virtual function <tt>xsputn()</tt>) is never called by any of the standard
+output functions. Is this really intended? At minimum it would be convenient to
+call <tt>xsputn()</tt> for strings... Also, the statement that <tt>overflow()</tt>
+is the only virtual member of <tt>basic_streambuf</tt> called is in conflict
+with the definition of <tt>flush()</tt> which calls <tt>rdbuf()-&gt;pubsync()</tt>
+and thereby the virtual function <tt>sync()</tt> (<tt>flush()</tt> is listed
+under &quot;unformatted output functions&quot;).</p>
+<p>In addition, I guess that the sentence starting with &quot;They may use other
+public members of <tt>basic_ostream</tt> ...&quot; probably was intended to
+start with &quot;They may use other public members of <tt>basic_streamuf</tt>...&quot;
+although the problem with the virtual members exists in both cases.</p>
+<p>I see two obvious resolutions:</p>
+<ol>
+ <li>state in a footnote that this means that <tt>xsputn()</tt> will never be
+ called by any ostream member and that this is intended.</li>
+ <li>relax the restriction and allow calling <tt>overflow()</tt> and <tt>xsputn()</tt>.
+ Of course, the problem with <tt>flush()</tt> has to be resolved in some way.</li>
+</ol>
+<p><b>Proposed resolution:</b></p>
+<p>Change the last sentence of 27.6.2.1 (lib.ostream) paragraph 2 from:</p>
+<blockquote>
+ <p>They may use other public members of basic_ostream except that they do not
+ invoke any virtual members of rdbuf() except overflow().</p>
+</blockquote>
+<p>to:</p>
+<blockquote>
+ <p>They may use other public members of basic_ostream except that they shall
+ not invoke any virtual members of rdbuf() except overflow(), xsputn(), and
+ sync().</p>
+</blockquote>
+
+<p><i>[Kona: the LWG believes this is a problem. Wish to ask Jerry or
+PJP why the standard is written this way.]</i></p>
+
+<p><i>[Post-Tokyo: Dietmar supplied wording at the request of the
+LWG. He comments: The rules can be made a little bit more specific if
+necessary be explicitly spelling out what virtuals are allowed to be
+called from what functions and eg to state specifically that flush()
+is allowed to call sync() while other functions are not.]</i></p>
+<hr>
+<a name="168"><h3>168.&nbsp;Typo: formatted vs. unformatted</h3></a><p>
+<b>Section:</b>&nbsp;27.6.2.6 <a href="lib-iostreams.html#lib.ostream.unformatted"> [lib.ostream.unformatted]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Dietmar K&uuml;hl&nbsp; <b>Date:</b>&nbsp;20 Jul 1999</p>
+<p>The first paragraph begins with a descriptions what has to be done
+in <i>formatted</i> output functions. Probably this is a typo and the
+paragraph really want to describe unformatted output functions...</p>
+<p><b>Proposed resolution:</b></p>
+<p>In 27.6.2.6 <a href="lib-iostreams.html#lib.ostream.unformatted"> [lib.ostream.unformatted]</a> paragraph 1, the first and last
+sentences, change the word &quot;formatted&quot; to
+&quot;unformatted&quot;:</p>
+<blockquote>
+ <p>&quot;Each <b>unformatted </b> output function begins ...&quot;<br>
+ &quot;... value specified for the <b>unformatted </b> output
+ function.&quot;</p>
+</blockquote>
+<hr>
+<a name="169"><h3>169.&nbsp;Bad efficiency of <tt>overflow()</tt> mandated</h3></a><p>
+<b>Section:</b>&nbsp;27.7.1.3 <a href="lib-iostreams.html#lib.stringbuf.virtuals"> [lib.stringbuf.virtuals]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Dietmar K&uuml;hl&nbsp; <b>Date:</b>&nbsp;20 Jul 1999</p>
+<p>Paragraph 8, Notes, of this section seems to mandate an extremely
+inefficient way of buffer handling for <tt>basic_stringbuf</tt>,
+especially in view of the restriction that <tt>basic_ostream</tt>
+member functions are not allowed to use <tt>xsputn()</tt> (see 27.6.2.1 <a href="lib-iostreams.html#lib.ostream"> [lib.ostream]</a>): For each character to be inserted, a new buffer
+is to be created.</p>
+<p>Of course, the resolution below requires some handling of
+simultaneous input and output since it is no longer possible to update
+<tt>egptr()</tt> whenever <tt>epptr()</tt> is changed. A possible
+solution is to handle this in <tt>underflow()</tt>.</p>
+<p><b>Proposed resolution:</b></p>
+<p>In 27.7.1.3 <a href="lib-iostreams.html#lib.stringbuf.virtuals"> [lib.stringbuf.virtuals]</a> paragraph 8, Notes, insert the words
+&quot;at least&quot; as in the following:</p>
+<blockquote>
+ <p>To make a write position available, the function reallocates (or initially
+ allocates) an array object with a sufficient number of elements to hold the
+ current array object (if any), plus <b>at least</b> one additional write
+ position.</p>
+</blockquote>
+<hr>
+<a name="170"><h3>170.&nbsp;Inconsistent definition of <tt>traits_type</tt>
+</h3></a><p>
+<b>Section:</b>&nbsp;27.7.4 <a href="lib-iostreams.html#lib.stringstream"> [lib.stringstream]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Dietmar K&uuml;hl&nbsp; <b>Date:</b>&nbsp;20 Jul 1999</p>
+<p>The classes <tt>basic_stringstream</tt> (27.7.4 <a href="lib-iostreams.html#lib.stringstream"> [lib.stringstream]</a>),
+<tt>basic_istringstream</tt> (27.7.2 <a href="lib-iostreams.html#lib.istringstream"> [lib.istringstream]</a>), and
+<tt>basic_ostringstream</tt> (27.7.3 <a href="lib-iostreams.html#lib.ostringstream"> [lib.ostringstream]</a>) are inconsistent
+in their definition of the type <tt>traits_type</tt>: For
+<tt>istringstream</tt>, this type is defined, for the other two it is
+not. This should be consistent.</p>
+<p><b>Proposed resolution:</b></p>
+<p><b>Proposed resolution:</b></p> <p>To the declarations of
+<tt>basic_ostringstream</tt> (27.7.3 <a href="lib-iostreams.html#lib.ostringstream"> [lib.ostringstream]</a>) and
+<tt>basic_stringstream</tt> (27.7.4 <a href="lib-iostreams.html#lib.stringstream"> [lib.stringstream]</a>) add:</p>
+<blockquote>
+<pre>typedef traits traits_type;</pre>
+</blockquote>
+<hr>
+<a name="171"><h3>171.&nbsp;Strange <tt>seekpos()</tt> semantics due to joint position</h3></a><p>
+<b>Section:</b>&nbsp;27.8.1.4 <a href="lib-iostreams.html#lib.filebuf.virtuals"> [lib.filebuf.virtuals]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Dietmar K&uuml;hl&nbsp; <b>Date:</b>&nbsp;20 Jul 1999</p>
+<p>Overridden virtual functions, seekpos()</p> <p>In 27.8.1.1 <a href="lib-iostreams.html#lib.filebuf"> [lib.filebuf]</a> paragraph 3, it is stated that a joint input and
+output position is maintained by <tt>basic_filebuf</tt>. Still, the
+description of <tt>seekpos()</tt> seems to talk about different file
+positions. In particular, it is unclear (at least to me) what is
+supposed to happen to the output buffer (if there is one) if only the
+input position is changed. The standard seems to mandate that the
+output buffer is kept and processed as if there was no positioning of
+the output position (by changing the input position). Of course, this
+can be exactly what you want if the flag <tt>ios_base::ate</tt> is
+set. However, I think, the standard should say something like
+this:</p>
+<ul>
+ <li>If <tt>(which &amp; mode) == 0</tt> neither read nor write position is
+ changed and the call fails. Otherwise, the joint read and write position is
+ altered to correspond to <tt>sp</tt>.</li>
+ <li>If there is an output buffer, the output sequences is updated and any
+ unshift sequence is written before the position is altered.</li>
+ <li>If there is an input buffer, the input sequence is updated after the
+ position is altered.</li>
+</ul>
+<p>Plus the appropriate error handling, that is...</p>
+<p><b>Proposed resolution:</b></p>
+<p>Change the unnumbered paragraph in 27.8.1.4 (lib.filebuf.virtuals) before
+paragraph 14 from:</p>
+<blockquote>
+ <p>pos_type seekpos(pos_type sp, ios_base::openmode = ios_base::in |
+ ios_base::out);</p>
+ <p>Alters the file position, if possible, to correspond to the position stored
+ in sp (as described below).</p>
+ <p>- if (which&amp;ios_base::in)!=0, set the file position to sp, then update
+ the input sequence</p>
+ <p>- if (which&amp;ios_base::out)!=0, then update the output sequence, write
+ any unshift sequence, and set the file position to sp.</p>
+</blockquote>
+<p>to:</p>
+<blockquote>
+ <p>pos_type seekpos(pos_type sp, ios_base::openmode = ios_base::in |
+ ios_base::out);</p>
+ <p>Alters the file position, if possible, to correspond to the position stored
+ in sp (as described below). Altering the file position performs as follows:</p>
+ <p>1. if (om &amp; ios_base::out)!=0, then update the output sequence and
+ write any unshift sequence;</p>
+ <p>2. set the file position to sp;</p>
+ <p>3. if (om &amp; ios_base::in)!=0, then update the input sequence;</p>
+ <p>where om is the open mode passed to the last call to open(). The operation
+ fails if is_open() returns false.</p>
+</blockquote>
+
+<p><i>[Kona: Dietmar is working on a proposed resolution.]</i></p>
+<p><i>[Post-Tokyo: Dietmar supplied the above wording.]</i></p>
+<hr>
+<a name="172"><h3>172.&nbsp;Inconsistent types for <tt>basic_istream::ignore()</tt>
+</h3></a><p>
+<b>Section:</b>&nbsp;27.6.1.3 <a href="lib-iostreams.html#lib.istream.unformatted"> [lib.istream.unformatted]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Greg Comeau, Dietmar K&uuml;hl&nbsp; <b>Date:</b>&nbsp;23 Jul 1999</p>
+<p>In 27.6.1.1 <a href="lib-iostreams.html#lib.istream"> [lib.istream]</a> the function
+<tt>ignore()</tt> gets an object of type <tt>streamsize</tt> as first
+argument. However, in 27.6.1.3 <a href="lib-iostreams.html#lib.istream.unformatted"> [lib.istream.unformatted]</a>
+paragraph 23 the first argument is of type <tt>int.</tt>
+</p>
+
+<p>As far as I can see this is not really a contradiction because
+everything is consistent if <tt>streamsize</tt> is typedef to be
+<tt>int</tt>. However, this is almost certainly not what was
+intended. The same thing happened to <tt>basic_filebuf::setbuf()</tt>,
+as described in issue <a href="lwg-defects.html#173">173</a>.</p>
+
+<p>Darin Adler also
+submitted this issue, commenting: Either 27.6.1.1 should be modified
+to show a first parameter of type int, or 27.6.1.3 should be modified
+to show a first parameter of type streamsize and use
+numeric_limits&lt;streamsize&gt;::max.</p>
+<p><b>Proposed resolution:</b></p>
+<p>In 27.6.1.3 <a href="lib-iostreams.html#lib.istream.unformatted"> [lib.istream.unformatted]</a> paragraph 23 and 24, change both uses
+of <tt>int</tt> in the description of <tt>ignore()</tt> to
+<tt>streamsize</tt>.</p>
+<hr>
+<a name="173"><h3>173.&nbsp;Inconsistent types for <tt>basic_filebuf::setbuf()</tt>
+</h3></a><p>
+<b>Section:</b>&nbsp;27.8.1.4 <a href="lib-iostreams.html#lib.filebuf.virtuals"> [lib.filebuf.virtuals]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Greg Comeau, Dietmar K&uuml;hl&nbsp; <b>Date:</b>&nbsp;23 Jul 1999</p>
+
+<p>
+In 27.8.1.1 <a href="lib-iostreams.html#lib.filebuf"> [lib.filebuf]</a> the function <tt>setbuf()</tt> gets an
+object of type <tt>streamsize</tt> as second argument. However, in
+27.8.1.4 <a href="lib-iostreams.html#lib.filebuf.virtuals"> [lib.filebuf.virtuals]</a> paragraph 9 the second argument is of type
+<tt>int</tt>.
+</p>
+
+<p>
+As far as I can see this is not really a contradiction because
+everything is consistent if <tt>streamsize</tt> is typedef to be
+<tt>int</tt>. However, this is almost certainly not what was
+intended. The same thing happened to <tt>basic_istream::ignore()</tt>,
+as described in issue <a href="lwg-defects.html#172">172</a>.
+</p>
+
+<p><b>Proposed resolution:</b></p>
+<p>In 27.8.1.4 <a href="lib-iostreams.html#lib.filebuf.virtuals"> [lib.filebuf.virtuals]</a> paragraph 9, change all uses of
+<tt>int</tt> in the description of <tt>setbuf()</tt> to
+<tt>streamsize</tt>.</p>
+<hr>
+<a name="174"><h3>174.&nbsp;Typo: <tt>OFF_T</tt> vs. <tt>POS_T</tt>
+</h3></a><p>
+<b>Section:</b>&nbsp;D.6 <a href="future.html#depr.ios.members"> [depr.ios.members]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Dietmar K&uuml;hl&nbsp; <b>Date:</b>&nbsp;23 Jul 1999</p>
+<p>According to paragraph 1 of this section, <tt>streampos</tt> is the
+type <tt>OFF_T</tt>, the same type as <tt>streamoff</tt>. However, in
+paragraph 6 the <tt>streampos</tt> gets the type <tt>POS_T</tt>
+</p>
+<p><b>Proposed resolution:</b></p>
+<p>Change D.6 <a href="future.html#depr.ios.members"> [depr.ios.members]</a> paragraph 1 from &quot;<tt>typedef
+OFF_T streampos;</tt>&quot; to &quot;<tt>typedef POS_T
+streampos;</tt>&quot;</p>
+<hr>
+<a name="175"><h3>175.&nbsp;Ambiguity for <tt>basic_streambuf::pubseekpos()</tt> and a few other functions.</h3></a><p>
+<b>Section:</b>&nbsp;D.6 <a href="future.html#depr.ios.members"> [depr.ios.members]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Dietmar K&uuml;hl&nbsp; <b>Date:</b>&nbsp;23 Jul 1999</p>
+<p>According to paragraph 8 of this section, the methods
+<tt>basic_streambuf::pubseekpos()</tt>,
+<tt>basic_ifstream::open()</tt>, and <tt>basic_ofstream::open</tt>
+&quot;may&quot; be overloaded by a version of this function taking the
+type <tt>ios_base::open_mode</tt> as last argument argument instead of
+<tt>ios_base::openmode</tt> (<tt>ios_base::open_mode</tt> is defined
+in this section to be an alias for one of the integral types). The
+clause specifies, that the last argument has a default argument in
+three cases. However, this generates an ambiguity with the overloaded
+version because now the arguments are absolutely identical if the last
+argument is not specified.</p>
+<p><b>Proposed resolution:</b></p>
+<p>In D.6 <a href="future.html#depr.ios.members"> [depr.ios.members]</a> paragraph 8, remove the default arguments for
+<tt>basic_streambuf::pubseekpos()</tt>,
+<tt>basic_ifstream::open()</tt>, and
+<tt>basic_ofstream::open().</tt>
+</p>
+<hr>
+<a name="176"><h3>176.&nbsp;<tt>exceptions()</tt> in <tt>ios_base</tt>...?</h3></a><p>
+<b>Section:</b>&nbsp;D.6 <a href="future.html#depr.ios.members"> [depr.ios.members]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Dietmar K&uuml;hl&nbsp; <b>Date:</b>&nbsp;23 Jul 1999</p>
+<p>The &quot;overload&quot; for the function <tt>exceptions()</tt> in
+paragraph 8 gives the impression that there is another function of
+this function defined in class <tt>ios_base</tt>. However, this is not
+the case. Thus, it is hard to tell how the semantics (paragraph 9) can
+be implemented: &quot;Call the corresponding member function specified
+in clause 27 <a href="lib-iostreams.html#lib.input.output"> [lib.input.output]</a>.&quot;</p>
+<p><b>Proposed resolution:</b></p>
+<p>In D.6 <a href="future.html#depr.ios.members"> [depr.ios.members]</a> paragraph 8, move the declaration of the
+function <tt>exceptions()</tt>into class <tt>basic_ios</tt>.</p>
+<hr>
+<a name="181"><h3>181.&nbsp;make_pair() unintended behavior</h3></a><p>
+<b>Section:</b>&nbsp;20.2.2 <a href="lib-utilities.html#lib.pairs"> [lib.pairs]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Andrew Koenig&nbsp; <b>Date:</b>&nbsp;3 Aug 1999</p>
+<p>The claim has surfaced in Usenet that expressions such as<br>
+<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <tt>make_pair(&quot;abc&quot;, 3)</tt><br>
+<br>
+are illegal, notwithstanding their use in examples, because template instantiation tries to bind the first template
+parameter to <tt> const char (&amp;)[4]</tt>, which type is uncopyable.<br>
+<br>
+I doubt anyone intended that behavior...
+</p>
+<p><b>Proposed resolution:</b></p>
+<p>In 20.2 <a href="lib-utilities.html#lib.utility"> [lib.utility]</a>, paragraph 1 change the following
+declaration of make_pair():</p>
+<blockquote>
+ <pre>template &lt;class T1, class T2&gt; pair&lt;T1,T2&gt; make_pair(const T1&amp;, const T2&amp;);</pre>
+</blockquote>
+<p>to:</p>
+<blockquote>
+ <pre>template &lt;class T1, class T2&gt; pair&lt;T1,T2&gt; make_pair(T1, T2);</pre>
+</blockquote>
+<p> In 20.2.2 <a href="lib-utilities.html#lib.pairs"> [lib.pairs]</a> paragraph 7 and the line before, change:</p>
+<blockquote>
+<pre>template &lt;class T1, class T2&gt;
+pair&lt;T1, T2&gt; make_pair(const T1&amp; x, const T2&amp; y);</pre>
+</blockquote>
+<p>to:</p>
+<blockquote>
+<pre>template &lt;class T1, class T2&gt;
+pair&lt;T1, T2&gt; make_pair(T1 x, T2 y);</pre>
+</blockquote>
+<p>and add the following footnote to the effects clause:</p>
+<blockquote>
+ <p> According to 12.8 [class.copy], an implementation is permitted
+ to not perform a copy of an argument, thus avoiding unnecessary
+ copies.</p>
+</blockquote>
+<p><b>Rationale:</b></p>
+<p>Two potential fixes were suggested by Matt Austern and Dietmar
+K&uuml;hl, respectively, 1) overloading with array arguments, and 2) use of
+a reference_traits class with a specialization for arrays. Andy
+Koenig suggested changing to pass by value. In discussion, it appeared
+that this was a much smaller change to the standard that the other two
+suggestions, and any efficiency concerns were more than offset by the
+advantages of the solution. Two implementors reported that the
+proposed resolution passed their test suites.</p>
+<hr>
+<a name="182"><h3>182.&nbsp;Ambiguous references to size_t</h3></a><p>
+<b>Section:</b>&nbsp;17 <a href="lib-intro.html#lib.library"> [lib.library]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Al Stevens&nbsp; <b>Date:</b>&nbsp;15 Aug 1999</p>
+<p>Many references to <tt> size_t</tt> throughout the document
+omit the <tt> std::</tt> namespace qualification.</p> <p>For
+example, 17.4.3.4 <a href="lib-intro.html#lib.replacement.functions"> [lib.replacement.functions]</a> paragraph 2:</p>
+<blockquote>
+<pre>&#x97; operator new(size_t)
+&#x97; operator new(size_t, const std::nothrow_t&amp;)
+&#x97; operator new[](size_t)
+&#x97; operator new[](size_t, const std::nothrow_t&amp;)</pre>
+</blockquote>
+<p><b>Proposed resolution:</b></p>
+<p> In 17.4.3.4 <a href="lib-intro.html#lib.replacement.functions"> [lib.replacement.functions]</a> paragraph 2: replace:</p>
+<blockquote>
+<p><tt> - operator new(size_t)<br>
+ - operator new(size_t, const std::nothrow_t&amp;)<br>
+ - operator new[](size_t)<br>
+ - operator new[](size_t, const std::nothrow_t&amp;)</tt></p>
+</blockquote>
+<p> by:</p>
+<blockquote>
+<pre>- operator new(std::size_t)
+- operator new(std::size_t, const std::nothrow_t&amp;)
+- operator new[](std::size_t)
+- operator new[](std::size_t, const std::nothrow_t&amp;)</pre>
+</blockquote>
+<p>In [lib.allocator.requirements] 20.1.5, paragraph 4: replace:</p>
+<blockquote>
+ <p>The typedef members pointer, const_pointer, size_type, and difference_type
+ are required to be T*, T const*, size_t, and ptrdiff_t, respectively.</p>
+</blockquote>
+<p>&nbsp;by:</p>
+<blockquote>
+ <p>The typedef members pointer, const_pointer, size_type, and difference_type
+ are required to be T*, T const*, std::size_t, and std::ptrdiff_t,
+ respectively.</p>
+</blockquote>
+<p>In [lib.allocator.members] 20.4.1.1, paragraphs 3 and 6: replace:</p>
+<blockquote>
+ <p>3 Notes: Uses ::operator new(size_t) (18.4.1).</p>
+ <p>6 Note: the storage is obtained by calling ::operator new(size_t), but it
+ is unspecified when or how often this function is called. The use of hint is
+ unspecified, but intended as an aid to locality if an implementation so
+ desires.</p>
+</blockquote>
+<p>by:</p>
+<blockquote>
+ <p>3 Notes: Uses ::operator new(std::size_t) (18.4.1).</p>
+ <p>6 Note: the storage is obtained by calling ::operator new(std::size_t), but
+ it is unspecified when or how often this function is called. The use of hint
+ is unspecified, but intended as an aid to locality if an implementation so
+ desires.</p>
+</blockquote>
+<p>In [lib.char.traits.require] 21.1.1, paragraph 1: replace:</p>
+<blockquote>
+ <p>In Table 37, X denotes a Traits class defining types and functions for the
+ character container type CharT; c and d denote values of type CharT; p and q
+ denote values of type const CharT*; s denotes a value of type CharT*; n, i and
+ j denote values of type size_t; e and f denote values of type X::int_type; pos
+ denotes a value of type X::pos_type; and state denotes a value of type X::state_type.</p>
+</blockquote>
+<p>by:</p>
+<blockquote>
+ <p>In Table 37, X denotes a Traits class defining types and functions for the
+ character container type CharT; c and d denote values of type CharT; p and q
+ denote values of type const CharT*; s denotes a value of type CharT*; n, i and
+ j denote values of type std::size_t; e and f denote values of type X::int_type;
+ pos denotes a value of type X::pos_type; and state denotes a value of type X::state_type.</p>
+</blockquote>
+<p>In [lib.char.traits.require] 21.1.1, table 37: replace the return type of
+X::length(p): &quot;size_t&quot; by &quot;std::size_t&quot;.</p>
+<p> In [lib.std.iterator.tags] 24.3.3, paragraph 2: replace:<br>
+&nbsp;&nbsp;&nbsp; typedef ptrdiff_t difference_type;<br>
+ by:<br>
+&nbsp;&nbsp;&nbsp; typedef std::ptrdiff_t difference_type;</p>
+<p> In [lib.locale.ctype] 22.2.1.1 put namespace std { ...} around the declaration of template &lt;class charT&gt; class ctype.<br>
+<br>
+ In [lib.iterator.traits] 24.3.1, paragraph 2 put namespace std { ...} around the declaration of:<br>
+<br>
+&nbsp;&nbsp;&nbsp; template&lt;class Iterator&gt; struct iterator_traits<br>
+&nbsp;&nbsp;&nbsp; template&lt;class T&gt; struct iterator_traits&lt;T*&gt;<br>
+&nbsp;&nbsp;&nbsp; template&lt;class T&gt; struct iterator_traits&lt;const T*&gt;</p>
+<p><b>Rationale:</b></p>
+<p>The LWG believes correcting names like <tt>size_t</tt> and
+<tt>ptrdiff_t</tt> to <tt>std::size_t</tt> and <tt>std::ptrdiff_t</tt>
+to be essentially editorial. There there can't be another size_t or
+ptrdiff_t meant anyway because, according to 17.4.3.1.4 <a href="lib-intro.html#lib.extern.types"> [lib.extern.types]</a>,</p>
+
+<blockquote>
+For each type T from the Standard C library, the types ::T and std::T
+are reserved to the implementation and, when defined, ::T shall be
+identical to std::T.
+</blockquote>
+
+<p>The issue is treated as a Defect Report to make explicit the Project
+Editor's authority to make this change.</p>
+
+<p><i>[Post-Tokyo: Nico Josuttis provided the above wording at the
+request of the LWG.]</i></p>
+
+<p><i>[Toronto: This is tangentially related to issue <a href="lwg-active.html#229">229</a>, but only tangentially: the intent of this issue is to
+address use of the name <tt>size_t</tt> in contexts outside of
+namespace std, such as in the description of <tt>::operator new</tt>.
+The proposed changes should be reviewed to make sure they are
+correct.]</i></p>
+
+<p><i>[pre-Copenhagen: Nico has reviewed the changes and believes
+them to be correct.]</i></p>
+
+<hr>
+<a name="183"><h3>183.&nbsp;I/O stream manipulators don't work for wide character streams</h3></a><p>
+<b>Section:</b>&nbsp;27.6.3 <a href="lib-iostreams.html#lib.std.manip"> [lib.std.manip]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Andy Sawyer&nbsp; <b>Date:</b>&nbsp;7 Jul 1999</p>
+<p>27.6.3 <a href="lib-iostreams.html#lib.std.manip"> [lib.std.manip]</a> paragraph 3 says (clause numbering added for
+exposition):</p>
+<blockquote>
+<p>Returns: An object s of unspecified type such that if [1] out is an (instance
+of) basic_ostream then the expression out&lt;&lt;s behaves as if f(s) were
+called, and if [2] in is an (instance of) basic_istream then the expression
+in&gt;&gt;s behaves as if f(s) were called. Where f can be defined as: ios_base&amp;
+f(ios_base&amp; str, ios_base::fmtflags mask) { // reset specified flags
+str.setf(ios_base::fmtflags(0), mask); return str; } [3] The expression
+out&lt;&lt;s has type ostream&amp; and value out. [4] The expression in&gt;&gt;s
+has type istream&amp; and value in.</p>
+</blockquote>
+<p>Given the definitions [1] and [2] for out and in, surely [3] should read:
+&quot;The expression out &lt;&lt; s has type basic_ostream&amp; ...&quot; and
+[4] should read: &quot;The expression in &gt;&gt; s has type basic_istream&amp;
+...&quot;</p>
+<p>If the wording in the standard is correct, I can see no way of implementing
+any of the manipulators so that they will work with wide character streams.</p>
+<p>e.g. wcout &lt;&lt; setbase( 16 );</p>
+<p>Must have value 'wcout' (which makes sense) and type 'ostream&amp;' (which
+doesn't).</p>
+<p>The same &quot;cut'n'paste&quot; type also seems to occur in Paras 4,5,7 and
+8. In addition, Para 6 [setfill] has a similar error, but relates only to
+ostreams.</p>
+<p>I'd be happier if there was a better way of saying this, to make it clear
+that the value of the expression is &quot;the same specialization of
+basic_ostream as out&quot;&amp;</p>
+<p><b>Proposed resolution:</b></p>
+<p>Replace section 27.6.3 <a href="lib-iostreams.html#lib.std.manip"> [lib.std.manip]</a> except paragraph 1 with the
+following:</p>
+<blockquote>
+<p>2- The type designated smanip in each of the following function descriptions is implementation-specified and may be different for each
+function.<br>
+<br>
+<tt>smanip resetiosflags(ios_base::fmtflags mask);</tt><br>
+<br>
+-3- Returns: An object s of unspecified type such that if out is an instance of basic_ostream&lt;charT,traits&gt; then the expression out&lt;&lt;s behaves
+as if f(s, mask) were called, or if in is an instance of basic_istream&lt;charT,traits&gt; then the expression in&gt;&gt;s behaves as if
+f(s, mask) were called. The function f can be defined as:*<br>
+<br>
+[Footnote: The expression cin &gt;&gt; resetiosflags(ios_base::skipws) clears ios_base::skipws in the format flags stored in the
+basic_istream&lt;charT,traits&gt; object cin (the same as cin &gt;&gt; noskipws), and the expression cout &lt;&lt; resetiosflags(ios_base::showbase) clears
+ios_base::showbase in the format flags stored in the basic_ostream&lt;charT,traits&gt; object cout (the same as cout &lt;&lt;
+noshowbase). --- end footnote]<br>
+<br>
+&nbsp;&nbsp;&nbsp;&nbsp; <tt>ios_base&amp; f(ios_base&amp; str, ios_base::fmtflags mask)<br>
+&nbsp;&nbsp; {<br>
+&nbsp;&nbsp; // reset specified flags<br>
+&nbsp;&nbsp; str.setf(ios_base::fmtflags(0), mask);<br>
+&nbsp;&nbsp; return str;<br>
+&nbsp;&nbsp; }<br>
+</tt><br>
+The expression out&lt;&lt;s has type basic_ostream&lt;charT,traits&gt;&amp; and value out.
+The expression in&gt;&gt;s has type basic_istream&lt;charT,traits&gt;&amp; and value in.<br>
+<br>
+&nbsp;<tt>smanip setiosflags(ios_base::fmtflags mask);</tt><br>
+<br>
+-4- Returns: An object s of unspecified type such that if out is an instance of basic_ostream&lt;charT,traits&gt; then the expression out&lt;&lt;s behaves
+as if f(s, mask) were called, or if in is an instance of basic_istream&lt;charT,traits&gt; then the expression in&gt;&gt;s behaves as if f(s,
+mask) were called. The function f can be defined as:<br>
+<br>
+&nbsp;&nbsp;&nbsp;&nbsp; <tt>ios_base&amp; f(ios_base&amp; str, ios_base::fmtflags mask)<br>
+&nbsp;&nbsp; {<br>
+&nbsp;&nbsp; // set specified flags<br>
+&nbsp;&nbsp; str.setf(mask);<br>
+&nbsp;&nbsp; return str;<br>
+&nbsp;&nbsp; }<br>
+</tt><br>
+The expression out&lt;&lt;s has type basic_ostream&lt;charT,traits&gt;&amp; and value out.
+The expression in&gt;&gt;s has type basic_istream&lt;charT,traits&gt;&amp; and value in.<br>
+<br>
+<tt>smanip setbase(int base);</tt><br>
+<br>
+-5- Returns: An object s of unspecified type such that if out is an instance of basic_ostream&lt;charT,traits&gt; then the expression out&lt;&lt;s behaves
+as if f(s, base) were called, or if in is an instance of basic_istream&lt;charT,traits&gt; then the expression in&gt;&gt;s behaves as if f(s,
+base) were called. The function f can be defined as:<br>
+<br>
+&nbsp;&nbsp;&nbsp;&nbsp; <tt>ios_base&amp; f(ios_base&amp; str, int base)<br>
+&nbsp;&nbsp; {<br>
+&nbsp;&nbsp; // set basefield<br>
+&nbsp;&nbsp; str.setf(base == 8 ? ios_base::oct :<br>
+&nbsp;&nbsp; base == 10 ? ios_base::dec :<br>
+&nbsp;&nbsp; base == 16 ? ios_base::hex :<br>
+&nbsp;&nbsp; ios_base::fmtflags(0), ios_base::basefield);<br>
+&nbsp;&nbsp; return str;<br>
+&nbsp;&nbsp; }<br>
+</tt><br>
+The expression out&lt;&lt;s has type basic_ostream&lt;charT,traits&gt;&amp; and value out.
+The expression in&gt;&gt;s has type basic_istream&lt;charT,traits&gt;&amp; and value in.<br>
+<br>
+<tt>smanip setfill(char_type c);<br>
+</tt><br>
+-6- Returns: An object s of unspecified type such that if out is (or is derived from) basic_ostream&lt;charT,traits&gt; and c has type charT then the
+expression out&lt;&lt;s behaves as if f(s, c) were called. The function f can be
+defined as:<br>
+<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <tt>template&lt;class charT, class traits&gt;<br>
+&nbsp;&nbsp; basic_ios&lt;charT,traits&gt;&amp; f(basic_ios&lt;charT,traits&gt;&amp; str, charT c)<br>
+&nbsp;&nbsp; {<br>
+&nbsp;&nbsp; // set fill character<br>
+&nbsp;&nbsp; str.fill(c);<br>
+&nbsp;&nbsp; return str;<br>
+&nbsp;&nbsp; }<br>
+</tt><br>
+The expression out&lt;&lt;s has type basic_ostream&lt;charT,traits&gt;&amp; and value out.<br>
+<br>
+<tt>smanip setprecision(int n);</tt><br>
+<br>
+-7- Returns: An object s of unspecified type such that if out is an instance of basic_ostream&lt;charT,traits&gt; then the expression out&lt;&lt;s behaves
+as if f(s, n) were called, or if in is an instance of basic_istream&lt;charT,traits&gt; then the expression in&gt;&gt;s behaves as if f(s, n)
+were called. The function f can be defined as:<br>
+<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <tt>ios_base&amp; f(ios_base&amp; str, int n)<br>
+&nbsp;&nbsp; {<br>
+&nbsp;&nbsp; // set precision<br>
+&nbsp;&nbsp; str.precision(n);<br>
+&nbsp;&nbsp; return str;<br>
+&nbsp;&nbsp; }<br>
+</tt><br>
+The expression out&lt;&lt;s has type basic_ostream&lt;charT,traits&gt;&amp; and value out.
+The expression in&gt;&gt;s has type basic_istream&lt;charT,traits&gt;&amp; and value in<br>
+.<br>
+<tt>smanip setw(int n);<br>
+</tt><br>
+-8- Returns: An object s of unspecified type such that if out is an instance of basic_ostream&lt;charT,traits&gt; then the expression out&lt;&lt;s behaves
+as if f(s, n) were called, or if in is an instance of basic_istream&lt;charT,traits&gt; then the expression in&gt;&gt;s behaves as if f(s, n)
+were called. The function f can be defined as:<br>
+<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <tt>ios_base&amp; f(ios_base&amp; str, int n)<br>
+&nbsp;&nbsp; {<br>
+&nbsp;&nbsp; // set width<br>
+&nbsp;&nbsp; str.width(n);<br>
+&nbsp;&nbsp; return str;<br>
+&nbsp;&nbsp; }<br>
+</tt><br>
+The expression out&lt;&lt;s has type
+basic_ostream&lt;charT,traits&gt;&amp; and value out. The expression
+in&gt;&gt;s has type basic_istream&lt;charT,traits&gt;&amp; and value
+in.
+</p>
+</blockquote>
+
+<p><i>[Kona: Andy Sawyer and Beman Dawes will work to improve the wording of
+the proposed resolution.]</i></p>
+
+<p><i>[Tokyo - The LWG noted that issue <a href="lwg-closed.html#216">216</a> involves
+the same paragraphs.]</i></p>
+
+<p><i>[Post-Tokyo: The issues list maintainer combined the proposed
+resolution of this issue with the proposed resolution for issue <a href="lwg-closed.html#216">216</a> as they both involved the same paragraphs, and were so
+intertwined that dealing with them separately appear fraught with
+error. The full text was supplied by Bill Plauger; it was cross
+checked against changes supplied by Andy Sawyer. It should be further
+checked by the LWG.]</i></p>
+<hr>
+<a name="184"><h3>184.&nbsp;numeric_limits&lt;bool&gt; wording problems</h3></a><p>
+<b>Section:</b>&nbsp;18.2.1.5 <a href="lib-support.html#lib.numeric.special"> [lib.numeric.special]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Gabriel Dos Reis&nbsp; <b>Date:</b>&nbsp;21 Jul 1999</p>
+<p>bools are defined by the standard to be of integer types, as per
+3.9.1 <a href="basic.html#basic.fundamental"> [basic.fundamental]</a> paragraph 7. However &quot;integer types&quot;
+seems to have a special meaning for the author of 18.2. The net effect
+is an unclear and confusing specification for
+numeric_limits&lt;bool&gt; as evidenced below.</p>
+
+<p>18.2.1.2/7 says numeric_limits&lt;&gt;::digits is, for built-in integer
+types, the number of non-sign bits in the representation.</p>
+
+<p>4.5/4 states that a bool promotes to int ; whereas 4.12/1 says any non zero
+arithmetical value converts to true.</p>
+
+<p>I don't think it makes sense at all to require
+numeric_limits&lt;bool&gt;::digits and numeric_limits&lt;bool&gt;::digits10 to
+be meaningful.</p>
+
+<p>The standard defines what constitutes a signed (resp. unsigned) integer
+types. It doesn't categorize bool as being signed or unsigned. And the set of
+values of bool type has only two elements.</p>
+
+<p>I don't think it makes sense to require numeric_limits&lt;bool&gt;::is_signed
+to be meaningful.</p>
+
+<p>18.2.1.2/18 for numeric_limits&lt;integer_type&gt;::radix&nbsp; says:</p>
+<blockquote>
+ <p>For integer types, specifies the base of the representation.186)</p>
+</blockquote>
+
+<p>This disposition is at best misleading and confusing for the standard
+requires a &quot;pure binary numeration system&quot; for integer types as per
+3.9.1/7</p>
+
+<p>The footnote 186) says: &quot;Distinguishes types with base other than 2 (e.g
+BCD).&quot;&nbsp; This also erroneous as the standard never defines any integer
+types with base representation other than 2.</p>
+
+<p>Furthermore, numeric_limits&lt;bool&gt;::is_modulo and
+numeric_limits&lt;bool&gt;::is_signed have similar problems.</p>
+<p><b>Proposed resolution:</b></p>
+<p>Append to the end of 18.2.1.5 <a href="lib-support.html#lib.numeric.special"> [lib.numeric.special]</a>:</p>
+<blockquote>
+ <p>The specialization for bool shall be provided as follows:</p>
+ <pre> namespace std {
+ template&lt;&gt; class numeric_limits&lt;bool&gt; {
+ public:
+ static const bool is_specialized = true;
+ static bool min() throw() { return false; }
+ static bool max() throw() { return true; }
+
+ static const int digits = 1;
+ static const int digits10 = 0;
+ static const bool is_signed = false;
+ static const bool is_integer = true;
+ static const bool is_exact = true;
+ static const int radix = 2;
+ static bool epsilon() throw() { return 0; }
+ static bool round_error() throw() { return 0; }
+
+ static const int min_exponent = 0;
+ static const int min_exponent10 = 0;
+ static const int max_exponent = 0;
+ static const int max_exponent10 = 0;
+
+ static const bool has_infinity = false;
+ static const bool has_quiet_NaN = false;
+ static const bool has_signaling_NaN = false;
+ static const float_denorm_style has_denorm = denorm_absent;
+ static const bool has_denorm_loss = false;
+ static bool infinity() throw() { return 0; }
+ static bool quiet_NaN() throw() { return 0; }
+ static bool signaling_NaN() throw() { return 0; }
+ static bool denorm_min() throw() { return 0; }
+
+ static const bool is_iec559 = false;
+ static const bool is_bounded = true;
+ static const bool is_modulo = false;
+
+ static const bool traps = false;
+ static const bool tinyness_before = false;
+ static const float_round_style round_style = round_toward_zero;
+ };
+ }</pre>
+</blockquote>
+
+<p><i>[Tokyo:&nbsp; The LWG desires wording that specifies exact values
+rather than more general wording in the original proposed
+resolution.]</i></p>
+
+<p><i>[Post-Tokyo:&nbsp; At the request of the LWG in Tokyo, Nico
+Josuttis provided the above wording.]</i></p>
+<hr>
+<a name="185"><h3>185.&nbsp;Questionable use of term &quot;inline&quot;</h3></a><p>
+<b>Section:</b>&nbsp;20.3 <a href="lib-utilities.html#lib.function.objects"> [lib.function.objects]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;UK Panel&nbsp; <b>Date:</b>&nbsp;26 Jul 1999</p>
+<p>Paragraph 4 of 20.3 <a href="lib-utilities.html#lib.function.objects"> [lib.function.objects]</a> says:</p>
+<blockquote>
+ <p>&nbsp;[Example: To negate every element of a: transform(a.begin(), a.end(),
+ a.begin(), negate&lt;double&gt;()); The corresponding functions will inline
+ the addition and the negation. end example]</p>
+</blockquote>
+<p>(Note: The &quot;addition&quot; referred to in the above is in para 3) we can
+find no other wording, except this (non-normative) example which suggests that
+any &quot;inlining&quot; will take place in this case.</p>
+<p>Indeed both:</p>
+<blockquote>
+ <p>17.4.4.3 Global Functions [lib.global.functions] 1 It is
+ unspecified whether any global functions in the C++ Standard Library
+ are defined as inline (7.1.2).</p>
+</blockquote>
+<p>and</p>
+<blockquote>
+ <p>17.4.4.4 Member Functions [lib.member.functions] 1 It is
+ unspecified whether any member functions in the C++ Standard Library
+ are defined as inline (7.1.2).</p>
+</blockquote>
+<p>take care to state that this may indeed NOT be the case.</p>
+<p>Thus the example &quot;mandates&quot; behavior that is explicitly
+not required elsewhere.</p>
+<p><b>Proposed resolution:</b></p>
+<p>In 20.3 <a href="lib-utilities.html#lib.function.objects"> [lib.function.objects]</a> paragraph 1, remove the sentence:</p>
+<blockquote>
+<p>They are important for the effective use of the library.</p>
+</blockquote>
+<p>Remove 20.3 <a href="lib-utilities.html#lib.function.objects"> [lib.function.objects]</a> paragraph 2, which reads:</p>
+<blockquote>
+ <p> Using function objects together with function templates
+ increases the expressive power of the library as well as making the
+ resulting code much more efficient.</p>
+</blockquote>
+<p>In 20.3 <a href="lib-utilities.html#lib.function.objects"> [lib.function.objects]</a> paragraph 4, remove the sentence:</p>
+<blockquote>
+ <p>The corresponding functions will inline the addition and the
+ negation.</p>
+</blockquote>
+
+<p><i>[Kona: The LWG agreed there was a defect.]</i></p>
+<p><i>[Tokyo: The LWG crafted the proposed resolution.]</i></p>
+<hr>
+<a name="186"><h3>186.&nbsp;bitset::set() second parameter should be bool</h3></a><p>
+<b>Section:</b>&nbsp;23.3.5.2 <a href="lib-containers.html#lib.bitset.members"> [lib.bitset.members]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Darin Adler&nbsp; <b>Date:</b>&nbsp;13 Aug 1999</p>
+<p>In section 23.3.5.2 <a href="lib-containers.html#lib.bitset.members"> [lib.bitset.members]</a>, paragraph 13 defines the
+bitset::set operation to take a second parameter of type int. The
+function tests whether this value is non-zero to determine whether to
+set the bit to true or false. The type of this second parameter should
+be bool. For one thing, the intent is to specify a Boolean value. For
+another, the result type from test() is bool. In addition, it's
+possible to slice an integer that's larger than an int. This can't
+happen with bool, since conversion to bool has the semantic of
+translating 0 to false and any non-zero value to true.</p>
+<p><b>Proposed resolution:</b></p>
+<p>In 23.3.5 <a href="lib-containers.html#lib.template.bitset"> [lib.template.bitset]</a> Para 1 Replace:</p>
+<blockquote>
+<pre>bitset&lt;N&gt;&amp; set(size_t pos, int val = true ); </pre>
+</blockquote>
+<p>With:</p>
+<blockquote>
+ <pre>bitset&lt;N&gt;&amp; set(size_t pos, bool val = true );</pre>
+</blockquote>
+<p>In 23.3.5.2 <a href="lib-containers.html#lib.bitset.members"> [lib.bitset.members]</a> Para 12(.5) Replace:</p>
+<blockquote>
+ <pre>bitset&lt;N&gt;&amp; set(size_t pos, int val = 1 );</pre>
+</blockquote>
+<p>With:</p>
+<blockquote>
+ <pre>bitset&lt;N&gt;&amp; set(size_t pos, bool val = true );</pre>
+</blockquote>
+
+<p><i>[Kona: The LWG agrees with the description.&nbsp; Andy Sawyer will work
+on better P/R wording.]</i></p>
+<p><i>[Post-Tokyo: Andy provided the above wording.]</i></p>
+<p><b>Rationale:</b></p>
+<p>
+<tt>bool</tt> is a better choice. It is believed that binary
+compatibility is not an issue, because this member function is
+usually implemented as <tt>inline</tt>, and because it is already
+the case that users cannot rely on the type of a pointer to a
+nonvirtual member of a standard library class.</p>
+<hr>
+<a name="189"><h3>189.&nbsp;setprecision() not specified correctly</h3></a><p>
+<b>Section:</b>&nbsp;27.4.2.2 <a href="lib-iostreams.html#lib.fmtflags.state"> [lib.fmtflags.state]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Andrew Koenig&nbsp; <b>Date:</b>&nbsp;25 Aug 1999</p>
+<p>27.4.2.2 paragraph 9 claims that setprecision() sets the precision,
+and includes a parenthetical note saying that it is the number of
+digits after the decimal point.<br>
+<br>
+This claim is not strictly correct. For example, in the default
+floating-point output format, setprecision sets the number of
+significant digits printed, not the number of digits after the decimal
+point.<br>
+<br>
+I would like the committee to look at the definition carefully and
+correct the statement in 27.4.2.2</p>
+<p><b>Proposed resolution:</b></p>
+<p>Remove from 27.4.2.2 <a href="lib-iostreams.html#lib.fmtflags.state"> [lib.fmtflags.state]</a>, paragraph 9, the text
+&quot;(number of digits after the decimal point)&quot;.</p>
+<hr>
+<a name="193"><h3>193.&nbsp;Heap operations description incorrect</h3></a><p>
+<b>Section:</b>&nbsp;25.3.6 <a href="lib-algorithms.html#lib.alg.heap.operations"> [lib.alg.heap.operations]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Markus Mauhart&nbsp; <b>Date:</b>&nbsp;24 Sep 1999</p>
+<p>25.3.6 [lib.alg.heap.operations] states two key properties of a heap [a,b), the first of them
+is<br>
+<br>
+&nbsp;&nbsp;&nbsp; `&quot;(1) *a is the largest element&quot;<br>
+<br>
+I think this is incorrect and should be changed to the wording in the proposed
+resolution.</p>
+<p>Actually there are two independent changes:</p>
+<blockquote>
+ <p>A-&quot;part of largest equivalence class&quot; instead of &quot;largest&quot;, cause 25.3
+ [lib.alg.sorting] asserts &quot;strict weak ordering&quot; for all its sub clauses.</p>
+ <p>B-Take 'an oldest' from that equivalence class, otherwise the heap functions could not be used for a
+ priority queue as explained in 23.2.3.2.2 [lib.priqueue.members] (where I assume that a &quot;priority queue&quot; respects priority AND time).</p>
+</blockquote>
+<p><b>Proposed resolution:</b></p>
+<p>Change 25.3.6 <a href="lib-algorithms.html#lib.alg.heap.operations"> [lib.alg.heap.operations]</a> property (1) from:</p>
+<blockquote>
+ <p>(1) *a is the largest element</p>
+</blockquote>
+<p>to:</p>
+<blockquote>
+ <p>(1) There is no element greater than <tt>*a</tt>
+</p>
+</blockquote>
+<hr>
+<a name="195"><h3>195.&nbsp;Should <tt>basic_istream::sentry</tt>'s constructor ever set eofbit?</h3></a><p>
+<b>Section:</b>&nbsp;27.6.1.1.2 <a href="lib-iostreams.html#lib.istream::sentry"> [lib.istream::sentry]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Matt Austern&nbsp; <b>Date:</b>&nbsp;13 Oct 1999</p>
+<p>Suppose that <tt>is.flags() &amp; ios_base::skipws</tt> is nonzero.
+What should <tt>basic_istream&lt;&gt;::sentry</tt>'s constructor do if it
+reaches eof while skipping whitespace? 27.6.1.1.2/5 suggests it
+should set failbit. Should it set eofbit as well? The standard
+doesn't seem to answer that question.</p>
+
+<p>On the one hand, nothing in 27.6.1.1.2 <a href="lib-iostreams.html#lib.istream::sentry"> [lib.istream::sentry]</a> says that
+<tt>basic_istream&lt;&gt;::sentry</tt> should ever set eofbit. On the
+other hand, 27.6.1.1 <a href="lib-iostreams.html#lib.istream"> [lib.istream]</a> paragraph 4 says that if
+extraction from a <tt>streambuf</tt> &quot;returns
+<tt>traits::eof()</tt>, then the input function, except as explicitly
+noted otherwise, completes its actions and does
+<tt>setstate(eofbit)&quot;</tt>. So the question comes down to
+whether <tt>basic_istream&lt;&gt;::sentry</tt>'s constructor is an
+input function.</p>
+
+<p>Comments from Jerry Schwarz:</p>
+<blockquote>
+<p>It was always my intention that eofbit should be set any time that a
+virtual returned something to indicate eof, no matter what reason
+iostream code had for calling the virtual.</p>
+<p>
+The motivation for this is that I did not want to require streambufs
+to behave consistently if their virtuals are called after they have
+signaled eof.</p>
+<p>
+The classic case is a streambuf reading from a UNIX file. EOF isn't
+really a state for UNIX file descriptors. The convention is that a
+read on UNIX returns 0 bytes to indicate &quot;EOF&quot;, but the file
+descriptor isn't shut down in any way and future reads do not
+necessarily also return 0 bytes. In particular, you can read from
+tty's on UNIX even after they have signaled &quot;EOF&quot;. (It
+isn't always understood that a ^D on UNIX is not an EOF indicator, but
+an EOL indicator. By typing a &quot;line&quot; consisting solely of
+^D you cause a read to return 0 bytes, and by convention this is
+interpreted as end of file.)</p>
+</blockquote>
+<p><b>Proposed resolution:</b></p>
+<p>Add a sentence to the end of 27.6.1.1.2 paragraph 2:</p>
+<blockquote>
+<p>If <tt>is.rdbuf()-&gt;sbumpc()</tt> or <tt>is.rdbuf()-&gt;sgetc()</tt>
+returns <tt>traits::eof()</tt>, the function calls
+<tt>setstate(failbit | eofbit)</tt> (which may throw
+<tt>ios_base::failure</tt>).
+</p>
+</blockquote>
+<hr>
+<a name="199"><h3>199.&nbsp;What does <tt>allocate(0)</tt> return?</h3></a><p>
+<b>Section:</b>&nbsp;20.1.5 <a href="lib-utilities.html#lib.allocator.requirements"> [lib.allocator.requirements]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Matt Austern&nbsp; <b>Date:</b>&nbsp;19 Nov 1999</p>
+<p>
+Suppose that <tt>A</tt> is a class that conforms to the
+Allocator requirements of Table 32, and <tt>a</tt> is an
+object of class <tt>A</tt> What should be the return
+value of <tt>a.allocate(0)</tt>? Three reasonable
+possibilities: forbid the argument <tt>0</tt>, return
+a null pointer, or require that the return value be a
+unique non-null pointer.
+</p>
+<p><b>Proposed resolution:</b></p>
+<p>
+Add a note to the <tt>allocate</tt> row of Table 32:
+&quot;[<i>Note:</i> If <tt>n == 0</tt>, the return value is unspecified. <i>--end note</i>]&quot;</p>
+<p><b>Rationale:</b></p>
+<p>A key to understanding this issue is that the ultimate use of
+allocate() is to construct an iterator, and that iterator for zero
+length sequences must be the container's past-the-end
+representation. Since this already implies special case code, it
+would be over-specification to mandate the return value.
+</p>
+<hr>
+<a name="208"><h3>208.&nbsp;Unnecessary restriction on past-the-end iterators</h3></a><p>
+<b>Section:</b>&nbsp;24.1 <a href="lib-iterators.html#lib.iterator.requirements"> [lib.iterator.requirements]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Stephen Cleary&nbsp; <b>Date:</b>&nbsp;02 Feb 2000</p>
+<p>In 24.1 paragraph 5, it is stated &quot;. . . Dereferenceable and
+past-the-end values are always non-singular.&quot;</p>
+<p>This places an unnecessary restriction on past-the-end iterators for
+containers with forward iterators (for example, a singly-linked list). If the
+past-the-end value on such a container was a well-known singular value, it would
+still satisfy all forward iterator requirements.</p>
+<p>Removing this restriction would allow, for example, a singly-linked list
+without a &quot;footer&quot; node.</p>
+<p>This would have an impact on existing code that expects past-the-end
+iterators obtained from different (generic) containers being not equal.</p>
+<p><b>Proposed resolution:</b></p>
+<p>Change 24.1 <a href="lib-iterators.html#lib.iterator.requirements"> [lib.iterator.requirements]</a> paragraph 5, the last sentence, from:</p>
+<blockquote>
+<p>Dereferenceable and past-the-end values are always non-singular.</p>
+</blockquote>
+<p>to:</p>
+<blockquote>
+<p>Dereferenceable values are always non-singular.&nbsp;</p>
+</blockquote>
+<p><b>Rationale:</b></p>
+<p>For some kinds of containers, including singly linked lists and
+zero-length vectors, null pointers are perfectly reasonable past-the-end
+iterators. Null pointers are singular.
+</p>
+<hr>
+<a name="209"><h3>209.&nbsp;basic_string declarations inconsistent</h3></a><p>
+<b>Section:</b>&nbsp;21.3 <a href="lib-strings.html#lib.basic.string"> [lib.basic.string]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Igor Stauder&nbsp; <b>Date:</b>&nbsp;11 Feb 2000</p>
+<p>In Section 21.3 <a href="lib-strings.html#lib.basic.string"> [lib.basic.string]</a> the basic_string member function
+declarations use a consistent style except for the following functions:</p>
+<blockquote>
+ <pre>void push_back(const charT);
+basic_string&amp; assign(const basic_string&amp;);
+void swap(basic_string&lt;charT,traits,Allocator&gt;&amp;);</pre>
+</blockquote>
+<p>- push_back, assign, swap: missing argument name&nbsp;<br>
+- push_back: use of const with charT (i.e. POD type passed by value
+not by reference - should be charT or const charT&amp; )<br>
+- swap: redundant use of template parameters in argument
+basic_string&lt;charT,traits,Allocator&gt;&amp;</p>
+<p><b>Proposed resolution:</b></p>
+<p>In Section 21.3 <a href="lib-strings.html#lib.basic.string"> [lib.basic.string]</a> change the basic_string member
+function declarations push_back, assign, and swap to:</p>
+<blockquote>
+ <pre>void push_back(charT c);
+
+basic_string&amp; assign(const basic_string&amp; str);
+void swap(basic_string&amp; str);</pre>
+</blockquote>
+<p><b>Rationale:</b></p>
+<p>Although the standard is in general not consistent in declaration
+style, the basic_string declarations are consistent other than the
+above. The LWG felt that this was sufficient reason to merit the
+change.
+</p>
+<hr>
+<a name="210"><h3>210.&nbsp;distance first and last confused</h3></a><p>
+<b>Section:</b>&nbsp;25 <a href="lib-algorithms.html#lib.algorithms"> [lib.algorithms]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Lisa Lippincott&nbsp; <b>Date:</b>&nbsp;15 Feb 2000</p>
+<p>In paragraph 9 of section 25 <a href="lib-algorithms.html#lib.algorithms"> [lib.algorithms]</a>, it is written:</p>
+<blockquote>
+ <p> In the description of the algorithms operators + and - are used
+ for some of the iterator categories for which they do not have to
+ be defined. In these cases the semantics of [...] a-b is the same
+ as of<br>
+ <br>
+ &nbsp;&nbsp;&nbsp;&nbsp; <tt>return distance(a, b);</tt>
+</p>
+</blockquote>
+<p><b>Proposed resolution:</b></p>
+<p>On the last line of paragraph 9 of section 25 <a href="lib-algorithms.html#lib.algorithms"> [lib.algorithms]</a> change
+<tt>&quot;a-b&quot;</tt> to <tt>&quot;b-a&quot;.</tt>
+</p>
+<p><b>Rationale:</b></p>
+<p>There are two ways to fix the defect; change the description to b-a
+or change the return to distance(b,a). The LWG preferred the
+former for consistency.</p>
+<hr>
+<a name="211"><h3>211.&nbsp;operator&gt;&gt;(istream&amp;, string&amp;) doesn't set failbit</h3></a><p>
+<b>Section:</b>&nbsp;21.3.7.9 <a href="lib-strings.html#lib.string.io"> [lib.string.io]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Scott Snyder&nbsp; <b>Date:</b>&nbsp;4 Feb 2000</p>
+<p>The description of the stream extraction operator for std::string (section
+21.3.7.9 [lib.string.io]) does not contain a requirement that failbit be set in
+the case that the operator fails to extract any characters from the input
+stream.</p>
+<p>This implies that the typical construction</p>
+<blockquote>
+ <pre>std::istream is;
+std::string str;
+...
+while (is &gt;&gt; str) ... ;</pre>
+</blockquote>
+<p>(which tests failbit) is not required to terminate at EOF.</p>
+<p>Furthermore, this is inconsistent with other extraction operators,
+which do include this requirement. (See sections 27.6.1.2 <a href="lib-iostreams.html#lib.istream.formatted"> [lib.istream.formatted]</a> and 27.6.1.3 <a href="lib-iostreams.html#lib.istream.unformatted"> [lib.istream.unformatted]</a>), where this
+requirement is present, either explicitly or implicitly, for the
+extraction operators. It is also present explicitly in the description
+of getline (istream&amp;, string&amp;, charT) in section 21.3.7.9 <a href="lib-strings.html#lib.string.io"> [lib.string.io]</a> paragraph 8.)</p>
+<p><b>Proposed resolution:</b></p>
+<p>Insert new paragraph after paragraph 2 in section 21.3.7.9 <a href="lib-strings.html#lib.string.io"> [lib.string.io]</a>:</p>
+<blockquote>
+
+<p>If the function extracts no characters, it calls
+is.setstate(ios::failbit) which may throw ios_base::failure
+(27.4.4.3).</p>
+</blockquote>
+<hr>
+<a name="212"><h3>212.&nbsp;Empty range behavior unclear for several algorithms</h3></a><p>
+<b>Section:</b>&nbsp;25.3.7 <a href="lib-algorithms.html#lib.alg.min.max"> [lib.alg.min.max]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Nico Josuttis&nbsp; <b>Date:</b>&nbsp;26 Feb 2000</p>
+<p>The standard doesn't specify what min_element() and max_element() shall
+return if the range is empty (first equals last). The usual implementations
+return last. This problem seems also apply to partition(), stable_partition(),
+next_permutation(), and prev_permutation().</p>
+<p><b>Proposed resolution:</b></p>
+<p>In 25.3.7 <a href="lib-algorithms.html#lib.alg.min.max"> [lib.alg.min.max]</a> - Minimum and maximum, paragraphs 7 and
+9, append: Returns last if first==last.</p>
+<p><b>Rationale:</b></p>
+<p>The LWG looked in some detail at all of the above mentioned
+algorithms, but believes that except for min_element() and
+max_element() it is already clear that last is returned if first ==
+last.</p>
+<hr>
+<a name="214"><h3>214.&nbsp;set::find() missing const overload</h3></a><p>
+<b>Section:</b>&nbsp;23.3.3 <a href="lib-containers.html#lib.set"> [lib.set]</a>, 23.3.4 <a href="lib-containers.html#lib.multiset"> [lib.multiset]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Judy Ward&nbsp; <b>Date:</b>&nbsp;28 Feb 2000</p>
+<p>The specification for the associative container requirements in
+Table 69 state that the find member function should &quot;return
+iterator; const_iterator for constant a&quot;. The map and multimap
+container descriptions have two overloaded versions of find, but set
+and multiset do not, all they have is:</p>
+<blockquote>
+ <pre>iterator find(const key_type &amp; x) const;</pre>
+</blockquote>
+<p><b>Proposed resolution:</b></p>
+<p>Change the prototypes for find(), lower_bound(), upper_bound(), and
+equal_range() in section 23.3.3 <a href="lib-containers.html#lib.set"> [lib.set]</a> and section 23.3.4 <a href="lib-containers.html#lib.multiset"> [lib.multiset]</a> to each have two overloads:</p>
+<blockquote>
+ <pre>iterator find(const key_type &amp; x);
+const_iterator find(const key_type &amp; x) const;</pre>
+ <pre>iterator lower_bound(const key_type &amp; x);
+const_iterator lower_bound(const key_type &amp; x) const;</pre>
+ <pre>iterator upper_bound(const key_type &amp; x);
+const_iterator upper_bound(const key_type &amp; x) const;</pre>
+ <pre>pair&lt;iterator, iterator&gt; equal_range(const key_type &amp; x);
+pair&lt;const_iterator, const_iterator&gt; equal_range(const key_type &amp; x) const;</pre>
+</blockquote>
+
+<p><i>[Tokyo: At the request of the LWG, Judy Ward provided wording
+extending the proposed resolution to lower_bound, upper_bound, and
+equal_range.]</i></p>
+<hr>
+<a name="217"><h3>217.&nbsp;Facets example (Classifying Japanese characters) contains errors</h3></a><p>
+<b>Section:</b>&nbsp;22.2.8 <a href="lib-locales.html#lib.facets.examples"> [lib.facets.examples]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Martin Sebor&nbsp; <b>Date:</b>&nbsp;29 Feb 2000</p>
+<p>The example in 22.2.8, paragraph 11 contains the following errors:</p>
+<p>1) The member function `My::JCtype::is_kanji()' is non-const; the function
+must be const in order for it to be callable on a const object (a reference to
+which which is what std::use_facet&lt;&gt;() returns).</p>
+<p>2) In file filt.C, the definition of `JCtype::id' must be qualified with the
+name of the namespace `My'.</p>
+<p>3) In the definition of `loc' and subsequently in the call to use_facet&lt;&gt;()
+in main(), the name of the facet is misspelled: it should read `My::JCtype'
+rather than `My::JCType'.</p>
+<p><b>Proposed resolution:</b></p>
+<p>Replace the &quot;Classifying Japanese characters&quot; example in 22.2.8,
+paragraph 11 with the following:</p>
+<pre>#include &lt;locale&gt;</pre>
+<pre>namespace My {
+ using namespace std;
+ class JCtype : public locale::facet {
+ public:
+ static locale::id id; // required for use as a new locale facet
+ bool is_kanji (wchar_t c) const;
+ JCtype() {}
+ protected:
+ ~JCtype() {}
+ };
+}</pre>
+<pre>// file: filt.C
+#include &lt;iostream&gt;
+#include &lt;locale&gt;
+#include &quot;jctype&quot; // above
+std::locale::id My::JCtype::id; // the static JCtype member
+declared above.</pre>
+<pre>int main()
+{
+ using namespace std;
+ typedef ctype&lt;wchar_t&gt; wctype;
+ locale loc(locale(&quot;&quot;), // the user's preferred locale...
+ new My::JCtype); // and a new feature ...
+ wchar_t c = use_facet&lt;wctype&gt;(loc).widen('!');
+ if (!use_facet&lt;My::JCtype&gt;(loc).is_kanji(c))
+ cout &lt;&lt; &quot;no it isn't!&quot; &lt;&lt; endl;
+ return 0;
+}</pre>
+<hr>
+<a name="220"><h3>220.&nbsp;~ios_base() usage valid?</h3></a><p>
+<b>Section:</b>&nbsp;27.4.2.7 <a href="lib-iostreams.html#lib.ios.base.cons"> [lib.ios.base.cons]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Jonathan Schilling, Howard Hinnant&nbsp; <b>Date:</b>&nbsp;13 Mar 2000</p>
+<p>The pre-conditions for the ios_base destructor are described in 27.4.2.7
+paragraph 2:</p>
+<blockquote>
+ <p>Effects: Destroys an object of class ios_base. Calls each registered
+ callback pair (fn,index) (27.4.2.6) as (*fn)(erase_event,*this,index) at such
+ time that any ios_base member function called from within fn has well defined
+ results.</p>
+</blockquote>
+<p>But what is not clear is: If no callback functions were ever registered, does
+it matter whether the ios_base members were ever initialized?</p>
+<p>For instance, does this program have defined behavior:</p>
+<blockquote>
+ <pre>#include &lt;ios&gt;</pre>
+ <pre>class D : public std::ios_base { };</pre>
+ <pre>int main() { D d; }</pre>
+</blockquote>
+<p>It seems that registration of a callback function would surely affect the
+state of an ios_base. That is, when you register a callback function with an
+ios_base, the ios_base must record that fact somehow.</p>
+<p>But if after construction the ios_base is in an indeterminate state, and that
+state is not made determinate before the destructor is called, then how would
+the destructor know if any callbacks had indeed been registered? And if the
+number of callbacks that had been registered is indeterminate, then is not the
+behavior of the destructor undefined?</p>
+<p>By comparison, the basic_ios class description in 27.4.4.1 paragraph 2 makes
+it explicit that destruction before initialization results in undefined
+behavior.</p>
+<p><b>Proposed resolution:</b></p>
+<p>Modify 27.4.2.7 paragraph 1 from</p>
+<blockquote>
+ <p>Effects: Each ios_base member has an indeterminate value after
+ construction.</p>
+</blockquote>
+<p>to</p>
+<blockquote>
+ <p>Effects: Each ios_base member has an indeterminate value after
+ construction. These members must be initialized by calling basic_ios::init. If an ios_base object is destroyed before these initializations
+ have taken place, the behavior is undefined.</p>
+</blockquote>
+<hr>
+<a name="221"><h3>221.&nbsp;num_get&lt;&gt;::do_get stage 2 processing broken</h3></a><p>
+<b>Section:</b>&nbsp;22.2.2.1.2 <a href="lib-locales.html#lib.facet.num.get.virtuals"> [lib.facet.num.get.virtuals]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Matt Austern&nbsp; <b>Date:</b>&nbsp;14 Mar 2000</p>
+<p>Stage 2 processing of numeric conversion is broken.</p>
+
+<p>Table 55 in 22.2.2.1.2 says that when basefield is 0 the integral
+conversion specifier is %i. A %i specifier determines a number's base
+by its prefix (0 for octal, 0x for hex), so the intention is clearly
+that a 0x prefix is allowed. Paragraph 8 in the same section,
+however, describes very precisely how characters are processed. (It
+must be done &quot;as if&quot; by a specified code fragment.) That
+description does not allow a 0x prefix to be recognized.</p>
+
+<p>Very roughly, stage 2 processing reads a char_type ct. It converts
+ct to a char, not by using narrow but by looking it up in a
+translation table that was created by widening the string literal
+&quot;0123456789abcdefABCDEF+-&quot;. The character &quot;x&quot; is
+not found in that table, so it can't be recognized by stage 2
+processing.</p>
+<p><b>Proposed resolution:</b></p>
+<p>In 22.2.2.1.2 paragraph 8, replace the line:</p>
+<blockquote>
+ <pre>static const char src[] = &quot;0123456789abcdefABCDEF+-&quot;;</pre>
+</blockquote>
+<p>with the line:</p>
+<blockquote>
+ <pre>static const char src[] = &quot;0123456789abcdefxABCDEFX+-&quot;;</pre>
+</blockquote>
+<p><b>Rationale:</b></p>
+<p>If we're using the technique of widening a string literal, the
+string literal must contain every character we wish to recognize.
+This technique has the consequence that alternate representations
+of digits will not be recognized. This design decision was made
+deliberately, with full knowledge of that limitation.</p>
+<hr>
+<a name="222"><h3>222.&nbsp;Are throw clauses necessary if a throw is already implied by the effects clause?</h3></a><p>
+<b>Section:</b>&nbsp;17.3.1.3 <a href="lib-intro.html#lib.structure.specifications"> [lib.structure.specifications]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Judy Ward&nbsp; <b>Date:</b>&nbsp;17 Mar 2000</p>
+<p>Section 21.3.6.8 describes the basic_string::compare function this way:</p>
+<blockquote>
+ <pre>21.3.6.8 - basic_string::compare [lib.string::compare]
+
+int compare(size_type pos1, size_type n1,
+ const basic_string&lt;charT,traits,Allocator&gt;&amp; str ,
+ size_type pos2 , size_type n2 ) const;
+
+-4- Returns:
+
+ basic_string&lt;charT,traits,Allocator&gt;(*this,pos1,n1).compare(
+ basic_string&lt;charT,traits,Allocator&gt;(str,pos2,n2)) .</pre>
+</blockquote>
+<p>and the constructor that's implicitly called by the above is
+defined to throw an out-of-range exception if pos &gt; str.size(). See
+section 21.3.1 <a href="lib-strings.html#lib.string.cons"> [lib.string.cons]</a> paragraph 4.</p>
+
+<p>On the other hand, the compare function descriptions themselves don't have
+&quot;Throws: &quot; clauses and according to 17.3.1.3, paragraph 3, elements
+that do not apply to a function are omitted.</p>
+<p>So it seems there is an inconsistency in the standard -- are the
+&quot;Effects&quot; clauses correct, or are the &quot;Throws&quot; clauses
+missing?</p>
+<p><b>Proposed resolution:</b></p>
+<p>In 17.3.1.3 <a href="lib-intro.html#lib.structure.specifications"> [lib.structure.specifications]</a> paragraph 3, the footnote 148 attached to
+the sentence &quot;Descriptions of function semantics contain the
+following elements (as appropriate):&quot;, insert the word
+&quot;further&quot; so that the foot note reads:</p>
+<blockquote>
+ <p>To save space, items that do not apply to a function are
+ omitted. For example, if a function does not specify any further
+ preconditions, there will be no &quot;Requires&quot; paragraph.</p>
+</blockquote>
+<p><b>Rationale:</b></p>
+<p>The standard is somewhat inconsistent, but a failure to note a
+throw condition in a throws clause does not grant permission not to
+throw. The inconsistent wording is in a footnote, and thus
+non-normative. The proposed resolution from the LWG clarifies the
+footnote.</p>
+<hr>
+<a name="223"><h3>223.&nbsp;reverse algorithm should use iter_swap rather than swap</h3></a><p>
+<b>Section:</b>&nbsp;25.2.9 <a href="lib-algorithms.html#lib.alg.reverse"> [lib.alg.reverse]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Dave Abrahams&nbsp; <b>Date:</b>&nbsp;21 Mar 2000</p>
+<p>Shouldn't the effects say &quot;applies iter_swap to all pairs...&quot;?</p>
+<p><b>Proposed resolution:</b></p>
+<p>In 25.2.9 <a href="lib-algorithms.html#lib.alg.reverse"> [lib.alg.reverse]</a>, replace:</p>
+ <blockquote>
+ Effects: For each non-negative integer i &lt;= (last - first)/2,
+ applies swap to all pairs of iterators first + i, (last - i) - 1.
+ </blockquote>
+<p>with:</p>
+ <blockquote>
+ Effects: For each non-negative integer i &lt;= (last - first)/2,
+ applies iter_swap to all pairs of iterators first + i, (last - i) - 1.
+ </blockquote>
+<hr>
+<a name="224"><h3>224.&nbsp;clear() complexity for associative containers refers to undefined N</h3></a><p>
+<b>Section:</b>&nbsp;23.1.2 <a href="lib-containers.html#lib.associative.reqmts"> [lib.associative.reqmts]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Ed Brey&nbsp; <b>Date:</b>&nbsp;23 Mar 2000</p>
+<p>In the associative container requirements table in 23.1.2 paragraph 7,
+a.clear() has complexity &quot;log(size()) + N&quot;. However, the meaning of N
+is not defined.</p>
+<p><b>Proposed resolution:</b></p>
+<p>In the associative container requirements table in 23.1.2 paragraph
+7, the complexity of a.clear(), change &quot;log(size()) + N&quot; to
+&quot;linear in <tt>size()</tt>&quot;.</p>
+<p><b>Rationale:</b></p>
+<p>It's the &quot;log(size())&quot;, not the &quot;N&quot;, that is in
+error: there's no difference between <i>O(N)</i> and <i>O(N +
+log(N))</i>. The text in the standard is probably an incorrect
+cut-and-paste from the range version of <tt>erase</tt>.</p>
+<hr>
+<a name="227"><h3>227.&nbsp;std::swap() should require CopyConstructible or DefaultConstructible arguments</h3></a><p>
+<b>Section:</b>&nbsp;25.2.2 <a href="lib-algorithms.html#lib.alg.swap"> [lib.alg.swap]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Dave Abrahams&nbsp; <b>Date:</b>&nbsp;09 Apr 2000</p>
+<p>25.2.2 reads:</p>
+<blockquote>
+ <p>
+<tt> template&lt;class T&gt; void swap(T&amp; a, T&amp; b);</tt><br>
+ <br>
+ Requires: Type T is Assignable (_lib.container.requirements_).<br>
+ Effects: Exchanges values stored in two locations.</p>
+</blockquote>
+<p>The only reasonable** generic implementation of swap requires construction of a
+ new temporary copy of one of its arguments:</p>
+<blockquote>
+<pre>template&lt;class T&gt; void swap(T&amp; a, T&amp; b);
+ {
+ T tmp(a);
+ a = b;
+ b = tmp;
+ }</pre>
+</blockquote>
+<p>But a type which is only Assignable cannot be swapped by this implementation.</p>
+<p>**Yes, there's also an unreasonable implementation which would require T to be
+ DefaultConstructible instead of CopyConstructible. I don't think this is worthy
+ of consideration:</p>
+<blockquote>
+<pre>template&lt;class T&gt; void swap(T&amp; a, T&amp; b);
+{
+ T tmp;
+ tmp = a;
+ a = b;
+ b = tmp;
+}</pre>
+</blockquote>
+<p><b>Proposed resolution:</b></p>
+<p>Change 25.2.2 paragraph 1 from:</p>
+<blockquote>
+<p> Requires: Type T is Assignable (23.1).</p>
+</blockquote>
+<p>to:</p>
+<blockquote>
+<p> Requires: Type T is CopyConstructible (20.1.3) and Assignable (23.1)</p>
+</blockquote>
+<hr>
+<a name="228"><h3>228.&nbsp;Incorrect specification of &quot;..._byname&quot; facets</h3></a><p>
+<b>Section:</b>&nbsp;22.2 <a href="lib-locales.html#lib.locale.categories"> [lib.locale.categories]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Dietmar K&uuml;hl&nbsp; <b>Date:</b>&nbsp;20 Apr 2000</p>
+<p>The sections 22.2.1.2 <a href="lib-locales.html#lib.locale.ctype.byname"> [lib.locale.ctype.byname]</a>, 22.2.1.4 <a href="lib-locales.html#lib.locale.ctype.byname.special"> [lib.locale.ctype.byname.special]</a>,
+22.2.1.6 <a href="lib-locales.html#lib.locale.codecvt.byname"> [lib.locale.codecvt.byname]</a>, 22.2.3.2 <a href="lib-locales.html#lib.locale.numpunct.byname"> [lib.locale.numpunct.byname]</a>, 22.2.4.2 <a href="lib-locales.html#lib.locale.collate.byname"> [lib.locale.collate.byname]</a>, 22.2.5.4 <a href="lib-locales.html#lib.locale.time.put.byname"> [lib.locale.time.put.byname]</a>, 22.2.6.4 <a href="lib-locales.html#lib.locale.moneypunct.byname"> [lib.locale.moneypunct.byname]</a>, and 22.2.7.2 <a href="lib-locales.html#lib.locale.messages.byname"> [lib.locale.messages.byname]</a> overspecify the
+definitions of the &quot;..._byname&quot; classes by listing a bunch
+of virtual functions. At the same time, no semantics of these
+functions are defined. Real implementations do not define these
+functions because the functional part of the facets is actually
+implemented in the corresponding base classes and the constructor of
+the &quot;..._byname&quot; version just provides suitable date used by
+these implementations. For example, the 'numpunct' methods just return
+values from a struct. The base class uses a statically initialized
+struct while the derived version reads the contents of this struct
+from a table. However, no virtual function is defined in
+'numpunct_byname'.</p>
+
+<p>For most classes this does not impose a problem but specifically
+for 'ctype' it does: The specialization for 'ctype_byname&lt;char&gt;'
+is required because otherwise the semantics would change due to the
+virtual functions defined in the general version for 'ctype_byname':
+In 'ctype&lt;char&gt;' the method 'do_is()' is not virtual but it is
+made virtual in both 'ctype&lt;cT&gt;' and 'ctype_byname&lt;cT&gt;'.
+Thus, a class derived from 'ctype_byname&lt;char&gt;' can tell whether
+this class is specialized or not under the current specification:
+Without the specialization, 'do_is()' is virtual while with
+specialization it is not virtual.</p>
+<p><b>Proposed resolution:</b></p>
+<p>&nbsp; Change section 22.2.1.2 (lib.locale.ctype.byname) to become:</p>
+<pre> namespace std {
+ template &lt;class charT&gt;
+ class ctype_byname : public ctype&lt;charT&gt; {
+ public:
+ typedef ctype&lt;charT&gt;::mask mask;
+ explicit ctype_byname(const char*, size_t refs = 0);
+ protected:
+ ~ctype_byname(); // virtual
+ };
+ }</pre>
+<p>&nbsp; Change section 22.2.1.6 (lib.locale.codecvt.byname) to become:</p>
+<pre> namespace std {
+ template &lt;class internT, class externT, class stateT&gt;
+ class codecvt_byname : public codecvt&lt;internT, externT, stateT&gt; {
+ public:
+ explicit codecvt_byname(const char*, size_t refs = 0);
+ protected:
+ ~codecvt_byname(); // virtual
+ };
+ }
+</pre>
+<p>&nbsp; Change section 22.2.3.2 (lib.locale.numpunct.byname) to become:</p>
+<pre> namespace std {
+ template &lt;class charT&gt;
+ class numpunct_byname : public numpunct&lt;charT&gt; {
+ // this class is specialized for char and wchar_t.
+ public:
+ typedef charT char_type;
+ typedef basic_string&lt;charT&gt; string_type;
+ explicit numpunct_byname(const char*, size_t refs = 0);
+ protected:
+ ~numpunct_byname(); // virtual
+ };
+ }</pre>
+<p>&nbsp; Change section 22.2.4.2 (lib.locale.collate.byname) to become:</p>
+<pre> namespace std {
+ template &lt;class charT&gt;
+ class collate_byname : public collate&lt;charT&gt; {
+ public:
+ typedef basic_string&lt;charT&gt; string_type;
+ explicit collate_byname(const char*, size_t refs = 0);
+ protected:
+ ~collate_byname(); // virtual
+ };
+ }</pre>
+<p>&nbsp; Change section 22.2.5.2 (lib.locale.time.get.byname) to become:</p>
+<pre> namespace std {
+ template &lt;class charT, class InputIterator = istreambuf_iterator&lt;charT&gt; &gt;
+ class time_get_byname : public time_get&lt;charT, InputIterator&gt; {
+ public:
+ typedef time_base::dateorder dateorder;
+ typedef InputIterator iter_type</pre>
+<pre> explicit time_get_byname(const char*, size_t refs = 0);
+ protected:
+ ~time_get_byname(); // virtual
+ };
+ }</pre>
+<p>&nbsp; Change section 22.2.5.4 (lib.locale.time.put.byname) to become:</p>
+<pre> namespace std {
+ template &lt;class charT, class OutputIterator = ostreambuf_iterator&lt;charT&gt; &gt;
+ class time_put_byname : public time_put&lt;charT, OutputIterator&gt;
+ {
+ public:
+ typedef charT char_type;
+ typedef OutputIterator iter_type;</pre>
+<pre> explicit time_put_byname(const char*, size_t refs = 0);
+ protected:
+ ~time_put_byname(); // virtual
+ };
+ }&quot;</pre>
+<p>&nbsp; Change section 22.2.6.4 (lib.locale.moneypunct.byname) to become:</p>
+<pre> namespace std {
+ template &lt;class charT, bool Intl = false&gt;
+ class moneypunct_byname : public moneypunct&lt;charT, Intl&gt; {
+ public:
+ typedef money_base::pattern pattern;
+ typedef basic_string&lt;charT&gt; string_type;</pre>
+<pre> explicit moneypunct_byname(const char*, size_t refs = 0);
+ protected:
+ ~moneypunct_byname(); // virtual
+ };
+ }</pre>
+<p>&nbsp; Change section 22.2.7.2 (lib.locale.messages.byname) to become:</p>
+<pre> namespace std {
+ template &lt;class charT&gt;
+ class messages_byname : public messages&lt;charT&gt; {
+ public:
+ typedef messages_base::catalog catalog;
+ typedef basic_string&lt;charT&gt; string_type;</pre>
+<pre> explicit messages_byname(const char*, size_t refs = 0);
+ protected:
+ ~messages_byname(); // virtual
+ };
+ }</pre>
+<p>Remove section 22.2.1.4 <a href="lib-locales.html#lib.locale.ctype.byname.special"> [lib.locale.ctype.byname.special]</a> completely (because in
+this case only those members are defined to be virtual which are
+defined to be virtual in 'ctype&lt;cT&gt;'.)</p>
+
+<p><i>[Post-Tokyo: Dietmar K&uuml;hl submitted this issue at the request of
+the LWG to solve the underlying problems raised by issue <a href="lwg-closed.html#138">138</a>.]</i></p>
+
+<p><i>[Copenhagen: proposed resolution was revised slightly, to remove
+three last virtual functions from <tt>messages_byname</tt>.]</i></p>
+
+<hr>
+<a name="230"><h3>230.&nbsp;Assignable specified without also specifying CopyConstructible</h3></a><p>
+<b>Section:</b>&nbsp;17 <a href="lib-intro.html#lib.library"> [lib.library]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Beman Dawes&nbsp; <b>Date:</b>&nbsp;26 Apr 2000</p>
+<p>Issue <a href="lwg-defects.html#227">227</a> identified an instance (std::swap) where
+Assignable was specified without also specifying
+CopyConstructible. The LWG asked that the standard be searched to
+determine if the same defect existed elsewhere.</p>
+
+<p>There are a number of places (see proposed resolution below) where
+Assignable is specified without also specifying
+CopyConstructible. There are also several cases where both are
+specified. For example, 26.4.1 <a href="lib-numerics.html#lib.accumulate"> [lib.accumulate]</a>.</p>
+<p><b>Proposed resolution:</b></p>
+<p>In 23.1 <a href="lib-containers.html#lib.container.requirements"> [lib.container.requirements]</a> table 65 for value_type:
+change &quot;T is Assignable&quot; to &quot;T is CopyConstructible and
+Assignable&quot;
+</p>
+
+<p>In 23.1.2 <a href="lib-containers.html#lib.associative.reqmts"> [lib.associative.reqmts]</a> table 69 X::key_type; change
+&quot;Key is Assignable&quot; to &quot;Key is
+CopyConstructible and Assignable&quot;<br>
+</p>
+
+<p>In 24.1.2 <a href="lib-iterators.html#lib.output.iterators"> [lib.output.iterators]</a> paragraph 1, change:
+</p>
+<blockquote>
+<p> A class or a built-in type X satisfies the requirements of an
+output iterator if X is an Assignable type (23.1) and also the
+following expressions are valid, as shown in Table 73:
+</p>
+</blockquote>
+<p>to:
+</p>
+<blockquote>
+<p> A class or a built-in type X satisfies the requirements of an
+output iterator if X is a CopyConstructible (20.1.3) and Assignable
+type (23.1) and also the following expressions are valid, as shown in
+Table 73:
+</p>
+</blockquote>
+
+<p><i>[Post-Tokyo: Beman Dawes submitted this issue at the request of
+the LWG. He asks that the 25.2.4 <a href="lib-algorithms.html#lib.alg.replace"> [lib.alg.replace]</a> and 25.2.5 <a href="lib-algorithms.html#lib.alg.fill"> [lib.alg.fill]</a> changes be studied carefully, as it is not clear that
+CopyConstructible is really a requirement and may be
+overspecification.]</i></p>
+<p><b>Rationale:</b></p>
+<p>The original proposed resolution also included changes to input
+iterator, fill, and replace. The LWG believes that those changes are
+not necessary. The LWG considered some blanket statement, where an
+Assignable type was also required to be Copy Constructible, but
+decided against this because fill and replace really don't require the
+Copy Constructible property.</p>
+<hr>
+<a name="232"><h3>232.&nbsp;&quot;depends&quot; poorly defined in 17.4.3.1</h3></a><p>
+<b>Section:</b>&nbsp;17.4.3.1 <a href="lib-intro.html#lib.reserved.names"> [lib.reserved.names]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Peter Dimov&nbsp; <b>Date:</b>&nbsp;18 Apr 2000</p>
+<p>17.4.3.1/1 uses the term &quot;depends&quot; to limit the set of allowed
+specializations of standard templates to those that &quot;depend on a
+user-defined name of external linkage.&quot;</p>
+<p>This term, however, is not adequately defined, making it possible to
+construct a specialization that is, I believe, technically legal according to
+17.4.3.1/1, but that specializes a standard template for a built-in type such as
+'int'.</p>
+<p>The following code demonstrates the problem:</p>
+<blockquote>
+ <pre>#include &lt;algorithm&gt;</pre>
+ <pre>template&lt;class T&gt; struct X
+{
+ typedef T type;
+};</pre>
+ <pre>namespace std
+{
+ template&lt;&gt; void swap(::X&lt;int&gt;::type&amp; i, ::X&lt;int&gt;::type&amp; j);
+}</pre>
+</blockquote>
+<p><b>Proposed resolution:</b></p>
+<p>Change &quot;user-defined name&quot; to &quot;user-defined
+type&quot;.</p>
+<p><b>Rationale:</b></p>
+<p>This terminology is used in section 2.5.2 and 4.1.1 of <i>The C++
+Programming Language</i>. It disallows the example in the issue,
+since the underlying type itself is not user-defined. The only
+possible problem I can see is for non-type templates, but there's no
+possible way for a user to come up with a specialization for bitset,
+for example, that might not have already been specialized by the
+implementor?</p>
+
+<p><i>[Toronto: this may be related to issue <a href="lwg-active.html#120">120</a>.]</i></p>
+
+<p><i>[post-Toronto: Judy provided the above proposed resolution and
+rationale.]</i></p>
+<hr>
+<a name="234"><h3>234.&nbsp;Typos in allocator definition</h3></a><p>
+<b>Section:</b>&nbsp;20.4.1.1 <a href="lib-utilities.html#lib.allocator.members"> [lib.allocator.members]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Dietmar K&uuml;hl&nbsp; <b>Date:</b>&nbsp;24 Apr 2000</p>
+<p>In paragraphs 12 and 13 the effects of <tt>construct()</tt> and
+<tt>destruct()</tt> are described as returns but the functions actually
+return <tt>void</tt>.</p>
+<p><b>Proposed resolution:</b></p>
+<p>Substitute &quot;Returns&quot; by &quot;Effect&quot;.</p>
+<hr>
+<a name="235"><h3>235.&nbsp;No specification of default ctor for reverse_iterator</h3></a><p>
+<b>Section:</b>&nbsp;24.4.1.1 <a href="lib-iterators.html#lib.reverse.iterator"> [lib.reverse.iterator]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Dietmar K&uuml;hl&nbsp; <b>Date:</b>&nbsp;24 Apr 2000</p>
+<p>The declaration of <tt>reverse_iterator</tt> lists a default
+constructor. However, no specification is given what this constructor
+should do.</p>
+<p><b>Proposed resolution:</b></p>
+ <p>In section 24.4.1.3.1 <a href="lib-iterators.html#lib.reverse.iter.cons"> [lib.reverse.iter.cons]</a> add the following
+ paragraph:</p>
+ <blockquote>
+ <p><tt>reverse_iterator()</tt></p>
+
+ <p>Default initializes <tt>current</tt>. Iterator operations
+ applied to the resulting iterator have defined behavior if and
+ only if the corresponding operations are defined on a default
+ constructed iterator of type <tt>Iterator</tt>.</p>
+ </blockquote>
+ <p><i>[pre-Copenhagen: Dietmar provide wording for proposed
+ resolution.]</i></p>
+<hr>
+<a name="237"><h3>237.&nbsp;Undefined expression in complexity specification</h3></a><p>
+<b>Section:</b>&nbsp;23.2.2.1 <a href="lib-containers.html#lib.list.cons"> [lib.list.cons]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Dietmar K&uuml;hl&nbsp; <b>Date:</b>&nbsp;24 Apr 2000</p>
+<p>The complexity specification in paragraph 6 says that the complexity
+is linear in <tt>first - last</tt>. Even if <tt>operator-()</tt> is
+defined on iterators this term is in general undefined because it
+would have to be <tt>last - first</tt>.</p>
+<p><b>Proposed resolution:</b></p>
+ <p>Change paragraph 6 from</p>
+ <blockquote>Linear in <i>first - last</i>.</blockquote>
+ <p>to become</p>
+ <blockquote>Linear in <i>distance(first, last)</i>.</blockquote>
+<hr>
+<a name="238"><h3>238.&nbsp;Contradictory results of stringbuf initialization.</h3></a><p>
+<b>Section:</b>&nbsp;27.7.1.1 <a href="lib-iostreams.html#lib.stringbuf.cons"> [lib.stringbuf.cons]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Dietmar K&uuml;hl&nbsp; <b>Date:</b>&nbsp;11 May 2000</p>
+<p>In 27.7.1.1 paragraph 4 the results of calling the constructor of
+'basic_stringbuf' are said to be <tt>str() == str</tt>. This is fine
+that far but consider this code:</p>
+
+<pre>
+ std::basic_stringbuf&lt;char&gt; sbuf(&quot;hello, world&quot;, std::ios_base::openmode(0));
+ std::cout &lt;&lt; &quot;'&quot; &lt;&lt; sbuf.str() &lt;&lt; &quot;'\n&quot;;
+</pre>
+
+<p>Paragraph 3 of 27.7.1.1 basically says that in this case neither
+the output sequence nor the input sequence is initialized and
+paragraph 2 of 27.7.1.2 basically says that <tt>str()</tt> either
+returns the input or the output sequence. None of them is initialized,
+ie. both are empty, in which case the return from <tt>str()</tt> is
+defined to be <tt>basic_string&lt;cT&gt;()</tt>.</p>
+
+<p>However, probably only test cases in some testsuites will detect this
+&quot;problem&quot;...</p>
+<p><b>Proposed resolution:</b></p>
+<p>Remove 27.7.1.1 paragraph 4.</p>
+<p><b>Rationale:</b></p>
+<p>We could fix 27.7.1.1 paragraph 4, but there would be no point. If
+we fixed it, it would say just the same thing as text that's already
+in the standard.</p>
+<hr>
+<a name="242"><h3>242.&nbsp;Side effects of function objects</h3></a><p>
+<b>Section:</b>&nbsp;25.2.3 <a href="lib-algorithms.html#lib.alg.transform"> [lib.alg.transform]</a>, 26.4 <a href="lib-numerics.html#lib.numeric.ops"> [lib.numeric.ops]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Angelika Langer&nbsp; <b>Date:</b>&nbsp;May 15 2000</p>
+<p>The algorithms transform(), accumulate(), inner_product(),
+partial_sum(), and adjacent_difference() require that the function
+object supplied to them shall not have any side effects.</p>
+
+<p>The standard defines a side effect in 1.9 <a href="intro.html#intro.execution"> [intro.execution]</a> as:</p>
+<blockquote>-7- Accessing an object designated by a volatile lvalue (basic.lval),
+modifying an object, calling a library I/O function, or calling a function
+that does any of those operations are all side effects, which are changes
+in the state of the execution environment.</blockquote>
+
+<p>As a consequence, the function call operator of a function object supplied
+to any of the algorithms listed above cannot modify data members, cannot
+invoke any function that has a side effect, and cannot even create and
+modify temporary objects.&nbsp; It is difficult to imagine a function object
+that is still useful under these severe limitations. For instance, any
+non-trivial transformator supplied to transform() might involve creation
+and modification of temporaries, which is prohibited according to the current
+wording of the standard.</p>
+
+<p>On the other hand, popular implementations of these algorithms exhibit
+uniform and predictable behavior when invoked with a side-effect-producing
+function objects. It looks like the strong requirement is not needed for
+efficient implementation of these algorithms.</p>
+
+<p>The requirement of&nbsp; side-effect-free function objects could be
+replaced by a more relaxed basic requirement (which would hold for all
+function objects supplied to any algorithm in the standard library):</p>
+<blockquote>A function objects supplied to an algorithm shall not invalidate
+any iterator or sequence that is used by the algorithm. Invalidation of
+the sequence includes destruction of the sorting order if the algorithm
+relies on the sorting order (see section 25.3 - Sorting and related operations
+[lib.alg.sorting]).</blockquote>
+
+<p>I can't judge whether it is intended that the function objects supplied
+to transform(), accumulate(), inner_product(), partial_sum(), or adjacent_difference()
+shall not modify sequence elements through dereferenced iterators.</p>
+
+<p>It is debatable whether this issue is a defect or a change request.
+Since the consequences for user-supplied function objects are drastic and
+limit the usefulness of the algorithms significantly I would consider it
+a defect.</p>
+<p><b>Proposed resolution:</b></p>
+
+<p><i>Things to notice about these changes:</i></p>
+
+<ol>
+<li> <i>The fully-closed (&quot;[]&quot; as opposed to half-closed &quot;[)&quot; ranges
+ are intentional. we want to prevent side-effects from
+ invalidating the end iterators.</i>
+</li>
+
+<li> <i>That has the unintentional side-effect of prohibiting
+ modification of the end element as a side-effect. This could
+ conceivably be significant in some cases.</i>
+</li>
+
+<li> <i>The wording also prevents side-effects from modifying elements
+ of the output sequence. I can't imagine why anyone would want
+ to do this, but it is arguably a restriction that implementors
+ don't need to place on users.</i>
+</li>
+
+<li> <i>Lifting the restrictions imposed in #2 and #3 above is possible
+ and simple, but would require more verbiage.</i>
+</li>
+</ol>
+
+<p>Change 25.2.3/2 from:</p>
+
+<blockquote>
+ -2- Requires: op and binary_op shall not have any side effects.
+</blockquote>
+
+<p>to:</p>
+
+<blockquote>
+ -2- Requires: in the ranges [first1, last1], [first2, first2 +
+ (last1 - first1)] and [result, result + (last1- first1)], op and
+ binary_op shall neither modify elements nor invalidate iterators or
+ subranges.
+ [Footnote: The use of fully closed ranges is intentional --end footnote]
+</blockquote>
+
+
+<p>Change 25.2.3/2 from:</p>
+
+<blockquote>
+ -2- Requires: op and binary_op shall not have any side effects.
+</blockquote>
+
+<p>to:</p>
+
+<blockquote>
+ -2- Requires: op and binary_op shall not invalidate iterators or
+ subranges, or modify elements in the ranges [first1, last1],
+ [first2, first2 + (last1 - first1)], and [result, result + (last1
+ - first1)].
+ [Footnote: The use of fully closed ranges is intentional --end footnote]
+</blockquote>
+
+
+<p>Change 26.4.1/2 from:</p>
+
+<blockquote>
+ -2- Requires: T must meet the requirements of CopyConstructible
+ (lib.copyconstructible) and Assignable (lib.container.requirements)
+ types. binary_op shall not cause side effects.
+</blockquote>
+
+<p>to:</p>
+
+<blockquote>
+ -2- Requires: T must meet the requirements of CopyConstructible
+ (lib.copyconstructible) and Assignable
+ (lib.container.requirements) types. In the range [first, last],
+ binary_op shall neither modify elements nor invalidate iterators
+ or subranges.
+ [Footnote: The use of a fully closed range is intentional --end footnote]
+</blockquote>
+
+<p>Change 26.4.2/2 from:</p>
+
+<blockquote>
+ -2- Requires: T must meet the requirements of CopyConstructible
+ (lib.copyconstructible) and Assignable (lib.container.requirements)
+ types. binary_op1 and binary_op2 shall not cause side effects.
+</blockquote>
+
+<p>to:</p>
+
+<blockquote>
+ -2- Requires: T must meet the requirements of CopyConstructible
+ (lib.copyconstructible) and Assignable (lib.container.requirements)
+ types. In the ranges [first, last] and [first2, first2 + (last -
+ first)], binary_op1 and binary_op2 shall neither modify elements
+ nor invalidate iterators or subranges.
+ [Footnote: The use of fully closed ranges is intentional --end footnote]
+</blockquote>
+
+
+<p>Change 26.4.3/4 from:</p>
+
+<blockquote>
+ -4- Requires: binary_op is expected not to have any side effects.
+</blockquote>
+
+<p>to:</p>
+
+<blockquote>
+ -4- Requires: In the ranges [first, last] and [result, result +
+ (last - first)], binary_op shall neither modify elements nor
+ invalidate iterators or subranges.
+ [Footnote: The use of fully closed ranges is intentional --end footnote]
+</blockquote>
+
+<p>Change 26.4.4/2 from:</p>
+
+<blockquote>
+ -2- Requires: binary_op shall not have any side effects.
+</blockquote>
+
+<p>to:</p>
+
+<blockquote>
+ -2- Requires: In the ranges [first, last] and [result, result +
+ (last - first)], binary_op shall neither modify elements nor
+ invalidate iterators or subranges.
+ [Footnote: The use of fully closed ranges is intentional --end footnote]
+</blockquote>
+
+<p><i>[Toronto: Dave Abrahams supplied wording.]</i></p>
+
+<p><i>[Copenhagen: Proposed resolution was modified slightly. Matt
+added footnotes pointing out that the use of closed ranges was
+intentional.]</i></p>
+
+<hr>
+<a name="243"><h3>243.&nbsp;<tt>get</tt> and <tt>getline</tt> when sentry reports failure</h3></a><p>
+<b>Section:</b>&nbsp;27.6.1.3 <a href="lib-iostreams.html#lib.istream.unformatted"> [lib.istream.unformatted]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Martin Sebor&nbsp; <b>Date:</b>&nbsp;May 15 2000</p>
+<p>basic_istream&lt;&gt;::get(), and basic_istream&lt;&gt;::getline(),
+are unclear with respect to the behavior and side-effects of the named
+functions in case of an error.</p>
+
+<p>27.6.1.3, p1 states that &quot;... If the sentry object returns
+true, when converted to a value of type bool, the function endeavors
+to obtain the requested input...&quot; It is not clear from this (or
+the rest of the paragraph) what precisely the behavior should be when
+the sentry ctor exits by throwing an exception or when the sentry
+object returns false. In particular, what is the number of characters
+extracted that gcount() returns supposed to be?</p>
+
+<p>27.6.1.3 p8 and p19 say about the effects of get() and getline():
+&quot;... In any case, it then stores a null character (using
+charT()) into the next successive location of the array.&quot; Is not
+clear whether this sentence applies if either of the conditions above
+holds (i.e., when sentry fails).</p>
+<p><b>Proposed resolution:</b></p>
+<p>Add to 27.6.1.3, p1 after the sentence</p>
+
+<blockquote>
+&quot;... If the sentry object returns true, when converted to a value of
+type bool, the function endeavors to obtain the requested input.&quot;
+</blockquote>
+
+<p>the following</p>
+
+
+<blockquote>
+&quot;Otherwise, if the sentry constructor exits by throwing an exception or
+if the sentry object returns false, when converted to a value of type
+bool, the function returns without attempting to obtain any input. In
+either case the number of extracted characters is set to 0; unformatted
+input functions taking a character array of non-zero size as an argument
+shall also store a null character (using charT()) in the first location
+of the array.&quot;
+</blockquote>
+<p><b>Rationale:</b></p>
+<p>Although the general philosophy of the input functions is that the
+argument should not be modified upon failure, <tt>getline</tt>
+historically added a terminating null unconditionally. Most
+implementations still do that. Earlier versions of the draft standard
+had language that made this an unambiguous requirement; those words
+were moved to a place where their context made them less clear. See
+Jerry Schwarz's message c++std-lib-7618.</p>
+<hr>
+<a name="248"><h3>248.&nbsp;time_get fails to set eofbit</h3></a><p>
+<b>Section:</b>&nbsp;22.2.5 <a href="lib-locales.html#lib.category.time"> [lib.category.time]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Martin Sebor&nbsp; <b>Date:</b>&nbsp;22 June 2000</p>
+<p>There is no requirement that any of time_get member functions set
+ios::eofbit when they reach the end iterator while parsing their input.
+Since members of both the num_get and money_get facets are required to
+do so (22.2.2.1.2, and 22.2.6.1.2, respectively), time_get members
+should follow the same requirement for consistency.</p>
+<p><b>Proposed resolution:</b></p>
+<p>Add paragraph 2 to section 22.2.5.1 with the following text:</p>
+
+<blockquote>
+If the end iterator is reached during parsing by any of the get()
+member functions, the member sets ios_base::eofbit in err.
+</blockquote>
+<p><b>Rationale:</b></p>
+<p>Two alternative resolutions were proposed. The LWG chose this one
+because it was more consistent with the way eof is described for other
+input facets.</p>
+<hr>
+<a name="250"><h3>250.&nbsp;splicing invalidates iterators</h3></a><p>
+<b>Section:</b>&nbsp;23.2.2.4 <a href="lib-containers.html#lib.list.ops"> [lib.list.ops]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Brian Parker &nbsp; <b>Date:</b>&nbsp;14 Jul 2000</p>
+<p>
+Section 23.2.2.4 [lib.list.ops] states that
+</p>
+<pre>
+ void splice(iterator position, list&lt;T, Allocator&gt;&amp; x);
+</pre>
+<p>
+<i>invalidates</i> all iterators and references to list <tt>x</tt>.
+</p>
+
+<p>
+This is unnecessary and defeats an important feature of splice. In
+fact, the SGI STL guarantees that iterators to <tt>x</tt> remain valid
+after <tt>splice</tt>.
+</p>
+<p><b>Proposed resolution:</b></p>
+
+<p>Add a footnote to 23.2.2.4 <a href="lib-containers.html#lib.list.ops"> [lib.list.ops]</a>, paragraph 1:</p>
+<blockquote>
+[<i>Footnote:</i> As specified in 20.1.5 <a href="lib-utilities.html#lib.allocator.requirements"> [lib.allocator.requirements]</a>, paragraphs
+4-5, the semantics described in this clause applies only to the case
+where allocators compare equal. --end footnote]
+</blockquote>
+
+<p>In 23.2.2.4 <a href="lib-containers.html#lib.list.ops"> [lib.list.ops]</a>, replace paragraph 4 with:</p>
+<blockquote>
+Effects: Inserts the contents of x before position and x becomes
+empty. Pointers and references to the moved elements of x now refer to
+those same elements but as members of *this. Iterators referring to the
+moved elements will continue to refer to their elements, but they now
+behave as iterators into *this, not into x.
+</blockquote>
+
+<p>In 23.2.2.4 <a href="lib-containers.html#lib.list.ops"> [lib.list.ops]</a>, replace paragraph 7 with:</p>
+<blockquote>
+Effects: Inserts an element pointed to by i from list x before
+position and removes the element from x. The result is unchanged if
+position == i or position == ++i. Pointers and references to *i continue
+to refer to this same element but as a member of *this. Iterators to *i
+(including i itself) continue to refer to the same element, but now
+behave as iterators into *this, not into x.
+</blockquote>
+
+<p>In 23.2.2.4 <a href="lib-containers.html#lib.list.ops"> [lib.list.ops]</a>, replace paragraph 12 with:</p>
+<blockquote>
+Requires: [first, last) is a valid range in x. The result is
+undefined if position is an iterator in the range [first, last).
+Pointers and references to the moved elements of x now refer to those
+same elements but as members of *this. Iterators referring to the moved
+elements will continue to refer to their elements, but they now behave as
+iterators into *this, not into x.
+</blockquote>
+
+<p><i>[pre-Copenhagen: Howard provided wording.]</i></p>
+<p><b>Rationale:</b></p>
+<p>The original proposed resolution said that iterators and references
+would remain &quot;valid&quot;. The new proposed resolution clarifies what that
+means. Note that this only applies to the case of equal allocators.
+From 20.1.5 <a href="lib-utilities.html#lib.allocator.requirements"> [lib.allocator.requirements]</a> paragraph 4, the behavior of list when
+allocators compare nonequal is outside the scope of the standard.</p>
+<hr>
+<a name="251"><h3>251.&nbsp;basic_stringbuf missing allocator_type</h3></a><p>
+<b>Section:</b>&nbsp;27.7.1 <a href="lib-iostreams.html#lib.stringbuf"> [lib.stringbuf]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Martin Sebor&nbsp; <b>Date:</b>&nbsp;28 Jul 2000</p>
+<p>The synopsis for the template class <tt>basic_stringbuf</tt>
+doesn't list a typedef for the template parameter
+<tt>Allocator</tt>. This makes it impossible to determine the type of
+the allocator at compile time. It's also inconsistent with all other
+template classes in the library that do provide a typedef for the
+<tt>Allocator</tt> parameter.</p>
+<p><b>Proposed resolution:</b></p>
+<p>Add to the synopses of the class templates basic_stringbuf (27.7.1),
+basic_istringstream (27.7.2), basic_ostringstream (27.7.3), and
+basic_stringstream (27.7.4) the typedef:</p>
+<pre>
+ typedef Allocator allocator_type;
+</pre>
+<hr>
+<a name="252"><h3>252.&nbsp;missing casts/C-style casts used in iostreams</h3></a><p>
+<b>Section:</b>&nbsp;27.7 <a href="lib-iostreams.html#lib.string.streams"> [lib.string.streams]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Martin Sebor&nbsp; <b>Date:</b>&nbsp;28 Jul 2000</p>
+<p>27.7.2.2, p1 uses a C-style cast rather than the more appropriate
+const_cast&lt;&gt; in the Returns clause for basic_istringstream&lt;&gt;::rdbuf().
+The same C-style cast is being used in 27.7.3.2, p1, D.7.2.2, p1, and
+D.7.3.2, p1, and perhaps elsewhere. 27.7.6, p1 and D.7.2.2, p1 are missing
+the cast altogether.</p>
+
+<p>C-style casts have not been deprecated, so the first part of this
+issue is stylistic rather than a matter of correctness.</p>
+<p><b>Proposed resolution:</b></p>
+<p>In 27.7.2.2, p1 replace </p>
+<pre> -1- Returns: (basic_stringbuf&lt;charT,traits,Allocator&gt;*)&amp;sb.</pre>
+
+<p>with</p>
+<pre> -1- Returns: const_cast&lt;basic_stringbuf&lt;charT,traits,Allocator&gt;*&gt;(&amp;sb).</pre>
+
+
+<p>In 27.7.3.2, p1 replace</p>
+<pre> -1- Returns: (basic_stringbuf&lt;charT,traits,Allocator&gt;*)&amp;sb.</pre>
+
+<p>with</p>
+<pre> -1- Returns: const_cast&lt;basic_stringbuf&lt;charT,traits,Allocator&gt;*&gt;(&amp;sb).</pre>
+
+<p>In 27.7.6, p1, replace</p>
+<pre> -1- Returns: &amp;sb</pre>
+
+<p>with</p>
+<pre> -1- Returns: const_cast&lt;basic_stringbuf&lt;charT,traits,Allocator&gt;*&gt;(&amp;sb).</pre>
+
+<p>In D.7.2.2, p1 replace</p>
+<pre> -2- Returns: &amp;sb. </pre>
+
+<p>with</p>
+<pre> -2- Returns: const_cast&lt;strstreambuf*&gt;(&amp;sb).</pre>
+<hr>
+<a name="256"><h3>256.&nbsp;typo in 27.4.4.2, p17: copy_event does not exist</h3></a><p>
+<b>Section:</b>&nbsp;27.4.4.2 <a href="lib-iostreams.html#lib.basic.ios.members"> [lib.basic.ios.members]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Martin Sebor&nbsp; <b>Date:</b>&nbsp;21 Aug 2000</p>
+<p>
+27.4.4.2, p17 says
+</p>
+
+<blockquote>
+-17- Before copying any parts of rhs, calls each registered callback
+pair (fn,index) as (*fn)(erase_event,*this,index). After all parts but
+exceptions() have been replaced, calls each callback pair that was
+copied from rhs as (*fn)(copy_event,*this,index).
+</blockquote>
+
+<p>
+The name copy_event isn't defined anywhere. The intended name was
+copyfmt_event.
+</p>
+<p><b>Proposed resolution:</b></p>
+<p>Replace copy_event with copyfmt_event in the named paragraph.</p>
+<hr>
+<a name="259"><h3>259.&nbsp;<tt>basic_string::operator[]</tt> and const correctness</h3></a><p>
+<b>Section:</b>&nbsp;21.3.4 <a href="lib-strings.html#lib.string.access"> [lib.string.access]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Chris Newton &nbsp; <b>Date:</b>&nbsp;27 Aug 2000</p>
+<p>
+<i>Paraphrased from a message that Chris Newton posted to comp.std.c++:</i>
+</p>
+
+<p>
+The standard's description of <tt>basic_string&lt;&gt;::operator[]</tt>
+seems to violate const correctness.
+</p>
+
+<p>
+The standard (21.3.4/1) says that &quot;If <tt>pos &lt; size()</tt>,
+returns <tt>data()[pos]</tt>.&quot; The types don't work. The
+return value of <tt>data()</tt> is <tt>const charT*</tt>, but
+<tt>operator[]</tt> has a non-const version whose return type is <tt>reference</tt>.
+</p>
+<p><b>Proposed resolution:</b></p>
+<p>
+In section 21.3.4, paragraph 1, change
+&quot;<tt>data()[<i>pos</i>]</tt>&quot; to &quot;<tt>*(begin() +
+<i>pos</i>)</tt>&quot;.
+</p>
+<hr>
+<a name="260"><h3>260.&nbsp;Inconsistent return type of <tt>istream_iterator::operator++(int)</tt>
+</h3></a><p>
+<b>Section:</b>&nbsp;24.5.1.2 <a href="lib-iterators.html#lib.istream.iterator.ops"> [lib.istream.iterator.ops]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Martin Sebor&nbsp; <b>Date:</b>&nbsp;27 Aug 2000</p>
+<p>The synopsis of istream_iterator::operator++(int) in 24.5.1 shows
+it as returning the iterator by value. 24.5.1.2, p5 shows the same
+operator as returning the iterator by reference. That's incorrect
+given the Effects clause below (since a temporary is returned). The
+`&amp;' is probably just a typo.</p>
+<p><b>Proposed resolution:</b></p>
+<p>Change the declaration in 24.5.1.2, p5 from</p>
+ <pre>
+ istream_iterator&lt;T,charT,traits,Distance&gt;&amp; operator++(int);
+ </pre>
+<p>to</p>
+ <pre>
+ istream_iterator&lt;T,charT,traits,Distance&gt; operator++(int);
+ </pre>
+<p>(that is, remove the `&amp;').</p>
+<hr>
+<a name="261"><h3>261.&nbsp;Missing description of <tt>istream_iterator::operator!=</tt>
+</h3></a><p>
+<b>Section:</b>&nbsp;24.5.1.2 <a href="lib-iterators.html#lib.istream.iterator.ops"> [lib.istream.iterator.ops]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Martin Sebor&nbsp; <b>Date:</b>&nbsp;27 Aug 2000</p>
+<p>
+24.5.1, p3 lists the synopsis for
+</p>
+
+<pre>
+ template &lt;class T, class charT, class traits, class Distance&gt;
+ bool operator!=(const istream_iterator&lt;T,charT,traits,Distance&gt;&amp; x,
+ const istream_iterator&lt;T,charT,traits,Distance&gt;&amp; y);
+</pre>
+
+<p>
+but there is no description of what the operator does (i.e., no Effects
+or Returns clause) in 24.5.1.2.
+</p>
+<p><b>Proposed resolution:</b></p>
+<p>
+Add paragraph 7 to the end of section 24.5.1.2 with the following text:
+</p>
+
+<pre>
+ template &lt;class T, class charT, class traits, class Distance&gt;
+ bool operator!=(const istream_iterator&lt;T,charT,traits,Distance&gt;&amp; x,
+ const istream_iterator&lt;T,charT,traits,Distance&gt;&amp; y);
+</pre>
+
+<p>-7- Returns: !(x == y).</p>
+<hr>
+<a name="262"><h3>262.&nbsp;Bitmask operator ~ specified incorrectly</h3></a><p>
+<b>Section:</b>&nbsp;17.3.2.1.2 <a href="lib-intro.html#lib.bitmask.types"> [lib.bitmask.types]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Beman Dawes&nbsp; <b>Date:</b>&nbsp;03 Sep 2000</p>
+<p>
+The ~ operation should be applied after the cast to int_type.
+</p>
+<p><b>Proposed resolution:</b></p>
+<p>
+Change 17.3.2.1.2 [lib.bitmask.types] operator~ from:
+</p>
+
+<pre>
+ bitmask operator~ ( bitmask X )
+ { return static_cast&lt; bitmask&gt;(static_cast&lt;int_type&gt;(~ X)); }
+</pre>
+
+<p>
+to:
+</p>
+
+<pre>
+ bitmask operator~ ( bitmask X )
+ { return static_cast&lt; bitmask&gt;(~static_cast&lt;int_type&gt;(X)); }
+</pre>
+<hr>
+<a name="263"><h3>263.&nbsp;Severe restriction on <tt>basic_string</tt> reference counting</h3></a><p>
+<b>Section:</b>&nbsp;21.3 <a href="lib-strings.html#lib.basic.string"> [lib.basic.string]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Kevlin Henney&nbsp; <b>Date:</b>&nbsp;04 Sep 2000</p>
+<p>
+The note in paragraph 6 suggests that the invalidation rules for
+references, pointers, and iterators in paragraph 5 permit a reference-
+counted implementation (actually, according to paragraph 6, they permit
+a &quot;reference counted implementation&quot;, but this is a minor editorial fix).
+</p>
+
+<p>
+However, the last sub-bullet is so worded as to make a reference-counted
+implementation unviable. In the following example none of the
+conditions for iterator invalidation are satisfied:
+</p>
+
+<pre>
+ // first example: &quot;*******************&quot; should be printed twice
+ string original = &quot;some arbitrary text&quot;, copy = original;
+ const string &amp; alias = original;
+
+ string::const_iterator i = alias.begin(), e = alias.end();
+ for(string::iterator j = original.begin(); j != original.end(); ++j)
+ *j = '*';
+ while(i != e)
+ cout &lt;&lt; *i++;
+ cout &lt;&lt; endl;
+ cout &lt;&lt; original &lt;&lt; endl;
+</pre>
+
+<p>
+Similarly, in the following example:
+</p>
+
+<pre>
+ // second example: &quot;some arbitrary text&quot; should be printed out
+ string original = &quot;some arbitrary text&quot;, copy = original;
+ const string &amp; alias = original;
+
+ string::const_iterator i = alias.begin();
+ original.begin();
+ while(i != alias.end())
+ cout &lt;&lt; *i++;
+</pre>
+
+<p>
+I have tested this on three string implementations, two of which were
+reference counted. The reference-counted implementations gave
+&quot;surprising behavior&quot; because they invalidated iterators on
+the first call to non-const begin since construction. The current
+wording does not permit such invalidation because it does not take
+into account the first call since construction, only the first call
+since various member and non-member function calls.
+</p>
+<p><b>Proposed resolution:</b></p>
+<p>
+Change the following sentence in 21.3 paragraph 5 from
+</p>
+
+<blockquote>
+ Subsequent to any of the above uses except the forms of insert() and
+ erase() which return iterators, the first call to non-const member
+ functions operator[](), at(), begin(), rbegin(), end(), or rend().
+</blockquote>
+
+<p>to</p>
+
+<blockquote>
+ Following construction or any of the above uses, except the forms of
+ insert() and erase() that return iterators, the first call to non-
+ const member functions operator[](), at(), begin(), rbegin(), end(),
+ or rend().
+</blockquote>
+<hr>
+<a name="264"><h3>264.&nbsp;Associative container <tt>insert(i, j)</tt> complexity requirements are not feasible.</h3></a><p>
+<b>Section:</b>&nbsp;23.1.2 <a href="lib-containers.html#lib.associative.reqmts"> [lib.associative.reqmts]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;John Potter&nbsp; <b>Date:</b>&nbsp;07 Sep 2000</p>
+<p>
+Table 69 requires linear time if [i, j) is sorted. Sorted is necessary but not sufficient.
+Consider inserting a sorted range of even integers into a set&lt;int&gt; containing the odd
+integers in the same range.
+</p>
+
+<p><i>Related issue: <a href="lwg-closed.html#102">102</a></i></p>
+<p><b>Proposed resolution:</b></p>
+<p>
+In Table 69, in section 23.1.2, change the complexity clause for
+insertion of a range from &quot;N log(size() + N) (N is the distance
+from i to j) in general; linear if [i, j) is sorted according to
+value_comp()&quot; to &quot;N log(size() + N), where N is the distance
+from i to j&quot;.
+</p>
+
+<p><i>[Copenhagen: Minor fix in proposed resolution: fixed unbalanced
+parens in the revised wording.]</i></p>
+
+<p><b>Rationale:</b></p>
+<p>
+Testing for valid insertions could be less efficient than simply
+inserting the elements when the range is not both sorted and between
+two adjacent existing elements; this could be a QOI issue.
+</p>
+
+<p>
+The LWG considered two other options: (a) specifying that the
+complexity was linear if [i, j) is sorted according to value_comp()
+and between two adjacent existing elements; or (b) changing to
+Klog(size() + N) + (N - K) (N is the distance from i to j and K is the
+number of elements which do not insert immediately after the previous
+element from [i, j) including the first). The LWG felt that, since
+we can't guarantee linear time complexity whenever the range to be
+inserted is sorted, it's more trouble than it's worth to say that it's
+linear in some special cases.
+</p>
+<hr>
+<a name="265"><h3>265.&nbsp;std::pair::pair() effects overly restrictive</h3></a><p>
+<b>Section:</b>&nbsp;20.2.2 <a href="lib-utilities.html#lib.pairs"> [lib.pairs]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Martin Sebor&nbsp; <b>Date:</b>&nbsp;11 Sep 2000</p>
+<p>
+I don't see any requirements on the types of the elements of the
+std::pair container in 20.2.2. From the descriptions of the member
+functions it appears that they must at least satisfy the requirements of
+20.1.3 [lib.copyconstructible] and 20.1.4 [lib.default.con.req], and in
+the case of the [in]equality operators also the requirements of 20.1.1
+[lib.equalitycomparable] and 20.1.2 [lib.lessthancomparable].
+</p>
+
+<p>
+I believe that the the CopyConstructible requirement is unnecessary in
+the case of 20.2.2, p2.
+</p>
+<p><b>Proposed resolution:</b></p>
+<p>Change the Effects clause in 20.2.2, p2 from</p>
+
+<blockquote>
+-2- <b>Effects</b>: Initializes its members as if implemented: <tt> pair() :
+first(T1()), second(T2()) {} </tt>
+</blockquote>
+
+<p>to</p>
+
+<blockquote>
+-2- <b>Effects</b>: Initializes its members as if implemented: <tt> pair() :
+first(), second() {} </tt>
+</blockquote>
+<p><b>Rationale:</b></p>
+<p>The existing specification of pair's constructor appears to be a
+historical artifact: there was concern that pair's members be properly
+zero-initialized when they are built-in types. At one time there was
+uncertainty about whether they would be zero-initialized if the
+default constructor was written the obvious way. This has been
+clarified by core issue 178, and there is no longer any doubt that
+the straightforward implementation is correct.</p>
+<hr>
+<a name="266"><h3>266.&nbsp;bad_exception::~bad_exception() missing Effects clause</h3></a><p>
+<b>Section:</b>&nbsp;18.6.2.1 <a href="lib-support.html#lib.bad.exception"> [lib.bad.exception]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Martin Sebor&nbsp; <b>Date:</b>&nbsp;24 Sep 2000</p>
+<p>
+The synopsis for std::bad_exception lists the function ~bad_exception()
+but there is no description of what the function does (the Effects
+clause is missing).
+</p>
+<p><b>Proposed resolution:</b></p>
+<p>
+Remove the destructor from the class synopses of
+<tt>bad_alloc</tt> (18.4.2.1 <a href="lib-support.html#lib.bad.alloc"> [lib.bad.alloc]</a>),
+<tt>bad_cast</tt> (18.5.2 <a href="lib-support.html#lib.bad.cast"> [lib.bad.cast]</a>),
+<tt>bad_typeid</tt> (18.5.3 <a href="lib-support.html#lib.bad.typeid"> [lib.bad.typeid]</a>),
+and <tt>bad_exception</tt> (18.6.2.1 <a href="lib-support.html#lib.bad.exception"> [lib.bad.exception]</a>).
+</p>
+<p><b>Rationale:</b></p>
+<p>
+This is a general problem with the exception classes in clause 18.
+The proposed resolution is to remove the destructors from the class
+synopses, rather than to document the destructors' behavior, because
+removing them is more consistent with how exception classes are
+described in clause 19.
+</p>
+<hr>
+<a name="268"><h3>268.&nbsp;Typo in locale synopsis</h3></a><p>
+<b>Section:</b>&nbsp;22.1.1 <a href="lib-locales.html#lib.locale"> [lib.locale]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Martin Sebor&nbsp; <b>Date:</b>&nbsp;5 Oct 2000</p>
+<p>The synopsis of the class std::locale in 22.1.1 contains two typos:
+the semicolons after the declarations of the default ctor
+locale::locale() and the copy ctor locale::locale(const locale&amp;)
+are missing.</p>
+<p><b>Proposed resolution:</b></p>
+<p>Add the missing semicolons, i.e., change</p>
+
+<pre>
+ // construct/copy/destroy:
+ locale() throw()
+ locale(const locale&amp; other) throw()
+</pre>
+
+<p>in the synopsis in 22.1.1 to</p>
+
+<pre>
+ // construct/copy/destroy:
+ locale() throw();
+ locale(const locale&amp; other) throw();
+</pre>
+<hr>
+<a name="271"><h3>271.&nbsp;basic_iostream missing typedefs</h3></a><p>
+<b>Section:</b>&nbsp;27.6.1.5 <a href="lib-iostreams.html#lib.iostreamclass"> [lib.iostreamclass]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Martin Sebor&nbsp; <b>Date:</b>&nbsp;02 Nov 2000</p>
+<p>
+Class template basic_iostream has no typedefs. The typedefs it
+inherits from its base classes can't be used, since (for example)
+basic_iostream&lt;T&gt;::traits_type is ambiguous.
+</p>
+<p><b>Proposed resolution:</b></p>
+
+<p>Add the following to basic_iostream's class synopsis in
+27.6.1.5 <a href="lib-iostreams.html#lib.iostreamclass"> [lib.iostreamclass]</a>, immediately after <tt>public</tt>:</p>
+
+<pre>
+ // types:
+ typedef charT char_type;
+ typedef typename traits::int_type int_type;
+ typedef typename traits::pos_type pos_type;
+ typedef typename traits::off_type off_type;
+ typedef traits traits_type;
+</pre>
+<hr>
+<a name="272"><h3>272.&nbsp;Missing parentheses around subexpression</h3></a><p>
+<b>Section:</b>&nbsp;27.4.4.3 <a href="lib-iostreams.html#lib.iostate.flags"> [lib.iostate.flags]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Martin Sebor&nbsp; <b>Date:</b>&nbsp;02 Nov 2000</p>
+<p>
+27.4.4.3, p4 says about the postcondition of the function: If
+rdbuf()!=0 then state == rdstate(); otherwise
+rdstate()==state|ios_base::badbit.
+</p>
+
+<p>
+The expression on the right-hand-side of the operator==() needs to be
+parenthesized in order for the whole expression to ever evaluate to
+anything but non-zero.
+</p>
+<p><b>Proposed resolution:</b></p>
+<p>
+Add parentheses like so: rdstate()==(state|ios_base::badbit).
+</p>
+<hr>
+<a name="273"><h3>273.&nbsp;Missing ios_base qualification on members of a dependent class</h3></a><p>
+<b>Section:</b>&nbsp;27 <a href="lib-iostreams.html#lib.input.output"> [lib.input.output]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Martin Sebor&nbsp; <b>Date:</b>&nbsp;02 Nov 2000</p>
+<p>27.5.2.4.2, p4, and 27.8.1.6, p2, 27.8.1.7, p3, 27.8.1.9, p2,
+27.8.1.10, p3 refer to in and/or out w/o ios_base:: qualification.
+That's incorrect since the names are members of a dependent base
+class (14.6.2 [temp.dep]) and thus not visible.</p>
+<p><b>Proposed resolution:</b></p>
+<p>Qualify the names with the name of the class of which they are
+members, i.e., ios_base.</p>
+<hr>
+<a name="275"><h3>275.&nbsp;Wrong type in num_get::get() overloads</h3></a><p>
+<b>Section:</b>&nbsp;22.2.2.1.1 <a href="lib-locales.html#lib.facet.num.get.members"> [lib.facet.num.get.members]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Matt Austern&nbsp; <b>Date:</b>&nbsp;02 Nov 2000</p>
+<p>
+In 22.2.2.1.1, we have a list of overloads for num_get&lt;&gt;::get().
+There are eight overloads, all of which are identical except for the
+last parameter. The overloads are:
+</p>
+<ul>
+<li> long&amp; </li>
+<li> unsigned short&amp; </li>
+<li> unsigned int&amp; </li>
+<li> unsigned long&amp; </li>
+<li> short&amp; </li>
+<li> double&amp; </li>
+<li> long double&amp; </li>
+<li> void*&amp; </li>
+</ul>
+
+<p>
+There is a similar list, in 22.2.2.1.2, of overloads for
+num_get&lt;&gt;::do_get(). In this list, the last parameter has
+the types:
+</p>
+<ul>
+<li> long&amp; </li>
+<li> unsigned short&amp; </li>
+<li> unsigned int&amp; </li>
+<li> unsigned long&amp; </li>
+<li> float&amp; </li>
+<li> double&amp; </li>
+<li> long double&amp; </li>
+<li> void*&amp; </li>
+</ul>
+
+<p>
+These two lists are not identical. They should be, since
+<tt>get</tt> is supposed to call <tt>do_get</tt> with exactly
+the arguments it was given.
+</p>
+<p><b>Proposed resolution:</b></p>
+<p>In 22.2.2.1.1 <a href="lib-locales.html#lib.facet.num.get.members"> [lib.facet.num.get.members]</a>, change</p>
+<pre>
+ iter_type get(iter_type in, iter_type end, ios_base&amp; str,
+ ios_base::iostate&amp; err, short&amp; val) const;
+</pre>
+<p>to</p>
+<pre>
+ iter_type get(iter_type in, iter_type end, ios_base&amp; str,
+ ios_base::iostate&amp; err, float&amp; val) const;
+</pre>
+<hr>
+<a name="281"><h3>281.&nbsp;std::min() and max() requirements overly restrictive</h3></a><p>
+<b>Section:</b>&nbsp;25.3.7 <a href="lib-algorithms.html#lib.alg.min.max"> [lib.alg.min.max]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Martin Sebor&nbsp; <b>Date:</b>&nbsp;02 Dec 2000</p>
+<p>The requirements in 25.3.7, p1 and 4 call for T to satisfy the
+requirements of <tt>LessThanComparable</tt> (20.1.2 <a href="lib-utilities.html#lib.lessthancomparable"> [lib.lessthancomparable]</a>)
+and <tt>CopyConstructible</tt> (20.1.3 <a href="lib-utilities.html#lib.copyconstructible"> [lib.copyconstructible]</a>).
+Since the functions take and return their arguments and result by
+const reference, I believe the <tt>CopyConstructible</tt> requirement
+is unnecessary.
+</p>
+<p><b>Proposed resolution:</b></p>
+<p>Remove the <tt>CopyConstructible</tt> requirement. Specifically, replace
+25.3.7, p1 with</p>
+<p>
+<b>-1- Requires:</b> Type T is <tt>LessThanComparable</tt>
+(20.1.2 <a href="lib-utilities.html#lib.lessthancomparable"> [lib.lessthancomparable]</a>).
+</p>
+<p>and replace 25.3.7, p4 with</p>
+<p>
+<b>-4- Requires:</b> Type T is <tt>LessThanComparable</tt>
+(20.1.2 <a href="lib-utilities.html#lib.lessthancomparable"> [lib.lessthancomparable]</a>).
+</p>
+<hr>
+<a name="285"><h3>285.&nbsp;minor editorial errors in fstream ctors</h3></a><p>
+<b>Section:</b>&nbsp;27.8.1.6 <a href="lib-iostreams.html#lib.ifstream.cons"> [lib.ifstream.cons]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Martin Sebor&nbsp; <b>Date:</b>&nbsp;31 Dec 2000</p>
+<p>27.8.1.6 <a href="lib-iostreams.html#lib.ifstream.cons"> [lib.ifstream.cons]</a>, p2, 27.8.1.9 <a href="lib-iostreams.html#lib.ofstream.cons"> [lib.ofstream.cons]</a>, p2, and
+27.8.1.12 <a href="lib-iostreams.html#lib.fstream.cons"> [lib.fstream.cons]</a>, p2 say about the effects of each constructor:
+</p>
+
+<p>... If that function returns a null pointer, calls
+<tt>setstate(failbit)</tt> (which may throw <tt>ios_base::failure</tt>).
+</p>
+
+<p>The parenthetical note doesn't apply since the ctors cannot throw an
+exception due to the requirement in 27.4.4.1 <a href="lib-iostreams.html#lib.basic.ios.cons"> [lib.basic.ios.cons]</a>, p3
+that <tt>exceptions()</tt> be initialized to <tt>ios_base::goodbit</tt>.
+</p>
+<p><b>Proposed resolution:</b></p>
+<p>
+Strike the parenthetical note from the Effects clause in each of the
+paragraphs mentioned above.
+</p>
+<hr>
+<a name="286"><h3>286.&nbsp;&lt;cstdlib&gt; requirements missing size_t typedef</h3></a><p>
+<b>Section:</b>&nbsp;25.4 <a href="lib-algorithms.html#lib.alg.c.library"> [lib.alg.c.library]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Judy Ward&nbsp; <b>Date:</b>&nbsp;30 Dec 2000</p>
+<p>
+The &lt;cstdlib&gt; header file contains prototypes for bsearch and
+qsort (C++ Standard section 25.4 paragraphs 3 and 4) and other
+prototypes (C++ Standard section 21.4 paragraph 1 table 49) that
+require the typedef size_t. Yet size_t is not listed in the
+&lt;cstdlib&gt; synopsis table 78 in section 25.4.
+</p>
+<p><b>Proposed resolution:</b></p>
+<p>
+Add the type size_t to Table 78 (section 25.4) and add
+the type size_t &lt;cstdlib&gt; to Table 97 (section C.2).
+</p>
+<p><b>Rationale:</b></p>
+<p>Since size_t is in &lt;stdlib.h&gt;, it must also be in &lt;cstdlib&gt;.</p>
+<hr>
+<a name="288"><h3>288.&nbsp;&lt;cerrno&gt; requirements missing macro EILSEQ</h3></a><p>
+<b>Section:</b>&nbsp;19.3 <a href="lib-diagnostics.html#lib.errno"> [lib.errno]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Judy Ward&nbsp; <b>Date:</b>&nbsp;30 Dec 2000</p>
+<p>
+ISO/IEC 9899:1990/Amendment1:1994 Section 4.3 States: &quot;The list
+of macros defined in &lt;errno.h&gt; is adjusted to include a new
+macro, EILSEQ&quot;
+</p>
+
+<p>
+ISO/IEC 14882:1998(E) section 19.3 does not refer
+to the above amendment.
+</p>
+
+<p><b>Proposed resolution:</b></p>
+<p>
+Update Table 26 (section 19.3) &quot;Header &lt;cerrno&gt; synopsis&quot;
+and Table 95 (section C.2) &quot;Standard Macros&quot; to include EILSEQ.
+</p>
+<hr>
+<a name="292"><h3>292.&nbsp;effects of a.copyfmt (a)</h3></a><p>
+<b>Section:</b>&nbsp;27.4.4.2 <a href="lib-iostreams.html#lib.basic.ios.members"> [lib.basic.ios.members]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Martin Sebor&nbsp; <b>Date:</b>&nbsp;05 Jan 2001</p>
+<p>The Effects clause of the member function <tt>copyfmt()</tt> in
+27.4.4.2, p15 doesn't consider the case where the left-hand side
+argument is identical to the argument on the right-hand side, that is
+<tt>(this == &amp;rhs)</tt>. If the two arguments are identical there
+is no need to copy any of the data members or call any callbacks
+registered with <tt>register_callback()</tt>. Also, as Howard Hinnant
+points out in message c++std-lib-8149 it appears to be incorrect to
+allow the object to fire <tt>erase_event</tt> followed by
+<tt>copyfmt_event</tt> since the callback handling the latter event
+may inadvertently attempt to access memory freed by the former.
+</p>
+<p><b>Proposed resolution:</b></p>
+<p>Change the Effects clause in 27.4.4.2, p15 from</p>
+
+<blockquote>
+<b>-15- Effects:</b>Assigns to the member objects of <tt>*this</tt>
+the corresponding member objects of <tt>rhs</tt>, except that...
+</blockquote>
+
+<p>to</p>
+
+<blockquote>
+<b>-15- Effects:</b>If <tt>(this == &amp;rhs)</tt> does nothing. Otherwise
+assigns to the member objects of <tt>*this</tt> the corresponding member
+objects of <tt>rhs</tt>, except that...
+</blockquote>
+<hr>
+<a name="295"><h3>295.&nbsp;Is abs defined in &lt;cmath&gt;?</h3></a><p>
+<b>Section:</b>&nbsp;26.5 <a href="lib-numerics.html#lib.c.math"> [lib.c.math]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Jens Maurer&nbsp; <b>Date:</b>&nbsp;12 Jan 2001</p>
+<p>
+Table 80 lists the contents of the &lt;cmath&gt; header. It does not
+list <tt>abs()</tt>. However, 26.5, paragraph 6, which lists added
+signatures present in &lt;cmath&gt;, does say that several overloads
+of <tt>abs()</tt> should be defined in &lt;cmath&gt;.
+</p>
+<p><b>Proposed resolution:</b></p>
+<p>
+Add <tt>abs</tt> to Table 80. Also, remove the parenthetical list
+of functions &quot;(abs(), div(), rand(), srand())&quot; from 26.5 <a href="lib-numerics.html#lib.c.math"> [lib.c.math]</a>,
+paragraph 1.
+</p>
+
+<p><i>[Copenhagen: Modified proposed resolution so that it also gets
+rid of that vestigial list of functions in paragraph 1.]</i></p>
+
+<p><b>Rationale:</b></p>
+<p>All this DR does is fix a typo; it's uncontroversial. A
+separate question is whether we're doing the right thing in
+putting some overloads in &lt;cmath&gt; that we aren't also
+putting in &lt;cstdlib&gt;. That's issue <a href="lwg-active.html#323">323</a>.</p>
+<hr>
+<a name="297"><h3>297.&nbsp;const_mem_fun_t&lt;&gt;::argument_type should be const T*</h3></a><p>
+<b>Section:</b>&nbsp;20.3.8 <a href="lib-utilities.html#lib.member.pointer.adaptors"> [lib.member.pointer.adaptors]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Martin Sebor&nbsp; <b>Date:</b>&nbsp;6 Jan 2001</p>
+<p>The class templates <tt>const_mem_fun_t</tt> in 20.3.8, p8 and
+<tt>const_mem_fun1_t</tt>
+in 20.3.8, p9 derive from <tt>unary_function&lt;T*, S&gt;</tt>, and
+<tt>binary_function&lt;T*,
+A, S&gt;</tt>, respectively. Consequently, their <tt>argument_type</tt>, and
+<tt>first_argument_type</tt>
+members, respectively, are both defined to be <tt>T*</tt> (non-const).
+However, their function call member operator takes a <tt>const T*</tt>
+argument. It is my opinion that <tt>argument_type</tt> should be <tt>const
+T*</tt> instead, so that one can easily refer to it in generic code. The
+example below derived from existing code fails to compile due to the
+discrepancy:
+</p>
+
+<p>
+<tt>template &lt;class T&gt;</tt>
+<br><tt>void foo (typename T::argument_type arg)&nbsp;&nbsp; // #1</tt>
+<br><tt>{</tt>
+<br><tt>&nbsp;&nbsp;&nbsp; typename T::result_type (T::*pf) (typename
+T::argument_type)
+const =&nbsp;&nbsp; // #2</tt>
+<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &amp;T::operator();</tt>
+<br><tt>}</tt>
+</p>
+
+<p><tt>struct X { /* ... */ };</tt></p>
+
+<p>
+<tt>int main ()</tt>
+<br><tt>{</tt>
+<br><tt>&nbsp;&nbsp;&nbsp; const X x;</tt>
+<br><tt>&nbsp;&nbsp;&nbsp; foo&lt;std::const_mem_fun_t&lt;void, X&gt;
+&gt;(&amp;x);&nbsp;&nbsp;
+// #3</tt>
+<br><tt>}</tt>
+</p>
+
+<p>#1 <tt>foo()</tt> takes a plain unqualified <tt>X*</tt> as an argument
+<br>#2 the type of the pointer is incompatible with the type of the member
+function
+<br>#3 the address of a constant being passed to a function taking a non-const
+<tt>X*</tt>
+</p>
+<p><b>Proposed resolution:</b></p>
+<p>Replace the top portion of the definition of the class template
+const_mem_fun_t in 20.3.8, p8
+</p>
+<p>
+<tt>template &lt;class S, class T&gt; class const_mem_fun_t</tt>
+<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : public
+unary_function&lt;T*, S&gt; {</tt>
+</p>
+<p>with</p>
+<p>
+<tt>template &lt;class S, class T&gt; class const_mem_fun_t</tt>
+<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : public
+unary_function&lt;<b>const</b> T*, S&gt; {</tt>
+</p>
+<p>Also replace the top portion of the definition of the class template
+const_mem_fun1_t in 20.3.8, p9</p>
+<p>
+<tt>template &lt;class S, class T, class A&gt; class const_mem_fun1_t</tt>
+<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : public
+binary_function&lt;T*, A, S&gt; {</tt>
+</p>
+<p>with</p>
+<p>
+<tt>template &lt;class S, class T, class A&gt; class const_mem_fun1_t</tt>
+<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : public
+binary_function&lt;<b>const</b> T*, A, S&gt; {</tt>
+</p>
+<p><b>Rationale:</b></p>
+<p>This is simply a contradiction: the <tt>argument_type</tt> typedef,
+and the argument type itself, are not the same.</p>
+<hr>
+<a name="298"><h3>298.&nbsp;::operator delete[] requirement incorrect/insufficient</h3></a><p>
+<b>Section:</b>&nbsp;18.4.1.2 <a href="lib-support.html#lib.new.delete.array"> [lib.new.delete.array]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;John A. Pedretti&nbsp; <b>Date:</b>&nbsp;10 Jan 2001</p>
+<p>
+The default behavior of <tt>operator delete[]</tt> described in 18.4.1.2, p12 -
+namely that for non-null value of <i>ptr</i>, the operator reclaims storage
+allocated by the earlier call to the default <tt>operator new[]</tt> - is not
+correct in all cases. Since the specified <tt>operator new[]</tt> default
+behavior is to call <tt>operator new</tt> (18.4.1.2, p4, p8), which can be
+replaced, along with <tt>operator delete</tt>, by the user, to implement their
+own memory management, the specified default behavior of<tt> operator
+delete[]</tt> must be to call <tt>operator delete</tt>.
+</p>
+<p><b>Proposed resolution:</b></p>
+<p>Change 18.4.1.2, p12 from</p>
+<blockquote>
+<b>-12-</b> <b>Default behavior:</b>
+<ul>
+<li>
+For a null value of <i><tt>ptr</tt></i> , does nothing.
+</li>
+<li>
+Any other value of <i><tt>ptr</tt></i> shall be a value returned
+earlier by a call to the default <tt>operator new[](std::size_t)</tt>.
+[Footnote: The value must not have been invalidated by an intervening
+call to <tt>operator delete[](void*)</tt> (17.4.3.7 <a href="lib-intro.html#lib.res.on.arguments"> [lib.res.on.arguments]</a>).
+--- end footnote]
+For such a non-null value of <i><tt>ptr</tt></i> , reclaims storage
+allocated by the earlier call to the default <tt>operator new[]</tt>.
+</li>
+</ul>
+</blockquote>
+
+<p>to</p>
+
+<blockquote>
+<b>-12-</b> <b>Default behavior: </b>Calls <tt>operator
+delete(</tt><i>ptr</i>)
+or <tt>operator delete(<i>ptr</i>, std::nothrow)</tt> respectively.
+</blockquote>
+<p>and expunge paragraph 13.</p>
+<hr>
+<a name="301"><h3>301.&nbsp;basic_string template ctor effects clause omits allocator argument</h3></a><p>
+<b>Section:</b>&nbsp;21.3.1 <a href="lib-strings.html#lib.string.cons"> [lib.string.cons]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Martin Sebor&nbsp; <b>Date:</b>&nbsp;27 Jan 2001</p>
+<p>
+The effects clause for the basic_string template ctor in 21.3.1, p15
+leaves out the third argument of type Allocator. I believe this to be
+a mistake.
+</p>
+<p><b>Proposed resolution:</b></p>
+<p>Replace</p>
+
+<blockquote>
+ <p>
+<b>-15- Effects:</b> If <i><tt>InputIterator</tt></i> is an integral
+ type, equivalent to</p>
+
+ <blockquote><tt>basic_string(static_cast&lt;size_type&gt;(begin),
+ static_cast&lt;value_type&gt;(end))</tt></blockquote>
+</blockquote>
+
+<p>with</p>
+
+<blockquote>
+ <p>
+<b>-15- Effects:</b> If <i><tt>InputIterator</tt></i> is an integral
+ type, equivalent to</p>
+
+ <blockquote><tt>basic_string(static_cast&lt;size_type&gt;(begin),
+ static_cast&lt;value_type&gt;(end), <b>a</b>)</tt></blockquote>
+</blockquote>
+<hr>
+<a name="303"><h3>303.&nbsp;Bitset input operator underspecified</h3></a><p>
+<b>Section:</b>&nbsp;23.3.5.3 <a href="lib-containers.html#lib.bitset.operators"> [lib.bitset.operators]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Matt Austern&nbsp; <b>Date:</b>&nbsp;5 Feb 2001</p>
+<p>
+In 23.3.5.3, we are told that <tt>bitset</tt>'s input operator
+&quot;Extracts up to <i>N</i> (single-byte) characters from
+<i>is</i>.&quot;, where <i>is</i> is a stream of type
+<tt>basic_istream&lt;charT, traits&gt;</tt>.
+</p>
+
+<p>
+The standard does not say what it means to extract single byte
+characters from a stream whose character type, <tt>charT</tt>, is in
+general not a single-byte character type. Existing implementations
+differ.
+</p>
+
+<p>
+A reasonable solution will probably involve <tt>widen()</tt> and/or
+<tt>narrow()</tt>, since they are the supplied mechanism for
+converting a single character between <tt>char</tt> and
+arbitrary <tt>charT</tt>.
+</p>
+
+<p>Narrowing the input characters is not the same as widening the
+literals <tt>'0'</tt> and <tt>'1'</tt>, because there may be some
+locales in which more than one wide character maps to the narrow
+character <tt>'0'</tt>. Narrowing means that alternate
+representations may be used for bitset input, widening means that
+they may not be.</p>
+
+<p>Note that for numeric input, <tt>num_get&lt;&gt;</tt>
+(22.2.2.1.2/8) compares input characters to widened version of narrow
+character literals.</p>
+
+<p>From Pete Becker, in c++std-lib-8224:</p>
+<blockquote>
+<p>
+Different writing systems can have different representations for the
+digits that represent 0 and 1. For example, in the Unicode representation
+of the Devanagari script (used in many of the Indic languages) the digit 0
+is 0x0966, and the digit 1 is 0x0967. Calling narrow would translate those
+into '0' and '1'. But Unicode also provides the ASCII values 0x0030 and
+0x0031 for for the Latin representations of '0' and '1', as well as code
+points for the same numeric values in several other scripts (Tamil has no
+character for 0, but does have the digits 1-9), and any of these values
+would also be narrowed to '0' and '1'.
+</p>
+
+<p>...</p>
+
+<p>
+It's fairly common to intermix both native and Latin
+representations of numbers in a document. So I think the rule has to be
+that if a wide character represents a digit whose value is 0 then the bit
+should be cleared; if it represents a digit whose value is 1 then the bit
+should be set; otherwise throw an exception. So in a Devanagari locale,
+both 0x0966 and 0x0030 would clear the bit, and both 0x0967 and 0x0031
+would set it. Widen can't do that. It would pick one of those two values,
+and exclude the other one.
+</p>
+
+</blockquote>
+
+<p>From Jens Maurer, in c++std-lib-8233:</p>
+
+<blockquote>
+<p>
+Whatever we decide, I would find it most surprising if
+bitset conversion worked differently from int conversion
+with regard to alternate local representations of
+numbers.
+</p>
+
+<p>Thus, I think the options are:</p>
+<ul>
+ <li> Have a new defect issue for 22.2.2.1.2/8 so that it will
+require the use of narrow().</li>
+
+ <li> Have a defect issue for bitset() which describes clearly
+that widen() is to be used.</li>
+</ul>
+</blockquote>
+<p><b>Proposed resolution:</b></p>
+
+ <p>Replace the first two sentences of paragraph 5 with:</p>
+
+ <blockquote>
+ Extracts up to <i>N</i> characters from <i>is</i>. Stores these
+ characters in a temporary object <i>str</i> of type
+ <tt>basic_string&lt;charT, traits&gt;</tt>, then evaluates the
+ expression <tt><i>x</i> = bitset&lt;N&gt;(<i>str</i>)</tt>.
+ </blockquote>
+
+ <p>Replace the third bullet item in paragraph 5 with:</p>
+ <ul><li>
+ the next input character is neither <tt><i>is</i>.widen(0)</tt>
+ nor <tt><i>is</i>.widen(1)</tt> (in which case the input character
+ is not extracted).
+ </li></ul>
+
+<p><b>Rationale:</b></p>
+<p>Input for <tt>bitset</tt> should work the same way as numeric
+input. Using <tt>widen</tt> does mean that alternative digit
+representations will not be recognized, but this was a known
+consequence of the design choice.</p>
+<hr>
+<a name="306"><h3>306.&nbsp;offsetof macro and non-POD types</h3></a><p>
+<b>Section:</b>&nbsp;18.1 <a href="lib-support.html#lib.support.types"> [lib.support.types]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Steve Clamage&nbsp; <b>Date:</b>&nbsp;21 Feb 2001</p>
+<p>Spliced together from reflector messages c++std-lib-8294 and -8295:</p>
+
+<p>18.1, paragraph 5, reads: &quot;The macro <tt>offsetof</tt>
+accepts a restricted set of <i>type</i> arguments in this
+International Standard. <i>type</i> shall be a POD structure or a POD
+union (clause 9). The result of applying the offsetof macro to a field
+that is a static data member or a function member is
+undefined.&quot;</p>
+
+<p>For the POD requirement, it doesn't say &quot;no diagnostic
+required&quot; or &quot;undefined behavior&quot;. I read 1.4 <a href="intro.html#intro.compliance"> [intro.compliance]</a>, paragraph 1, to mean that a diagnostic is required.
+It's not clear whether this requirement was intended. While it's
+possible to provide such a diagnostic, the extra complication doesn't
+seem to add any value.
+</p>
+<p><b>Proposed resolution:</b></p>
+<p>Change 18.1, paragraph 5, to &quot;If <i>type</i> is not a POD
+structure or a POD union the results are undefined.&quot;</p>
+
+<p><i>[Copenhagen: straw poll was 7-4 in favor. It was generally
+agreed that requiring a diagnostic was inadvertent, but some LWG
+members thought that diagnostics should be required whenever
+possible.]</i></p>
+
+<hr>
+<a name="307"><h3>307.&nbsp;Lack of reference typedefs in container adaptors</h3></a><p>
+<b>Section:</b>&nbsp;23.2.3 <a href="lib-containers.html#lib.container.adaptors"> [lib.container.adaptors]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Howard Hinnant&nbsp; <b>Date:</b>&nbsp;13 Mar 2001</p>
+
+<p>From reflector message c++std-lib-8330. See also lib-8317.</p>
+
+<p>
+The standard is currently inconsistent in 23.2.3.2 <a href="lib-containers.html#lib.priority.queue"> [lib.priority.queue]</a>
+paragraph 1 and 23.2.3.3 <a href="lib-containers.html#lib.stack"> [lib.stack]</a> paragraph 1.
+23.2.3.3/1, for example, says:
+</p>
+
+<blockquote>
+-1- Any sequence supporting operations back(), push_back() and pop_back()
+can be used to instantiate stack. In particular, vector (lib.vector), list
+(lib.list) and deque (lib.deque) can be used.
+</blockquote>
+
+<p>But this is false: vector&lt;bool&gt; can not be used, because the
+container adaptors return a T&amp; rather than using the underlying
+container's reference type.</p>
+
+<p>This is a contradiction that can be fixed by:</p>
+
+<ol>
+<li>Modifying these paragraphs to say that vector&lt;bool&gt;
+ is an exception.</li>
+<li>Removing the vector&lt;bool&gt; specialization.</li>
+<li>Changing the return types of stack and priority_queue to use
+ reference typedef's.</li>
+</ol>
+
+<p>
+I propose 3. This does not preclude option 2 if we choose to do it
+later (see issue <a href="lwg-active.html#96">96</a>); the issues are independent. Option
+3 offers a small step towards support for proxied containers. This
+small step fixes a current contradiction, is easy for vendors to
+implement, is already implemented in at least one popular lib, and
+does not break any code.
+</p>
+
+<p><b>Proposed resolution:</b></p>
+<p>Summary: Add reference and const_reference typedefs to queue,
+priority_queue and stack. Change return types of &quot;value_type&amp;&quot; to
+&quot;reference&quot;. Change return types of &quot;const value_type&amp;&quot; to
+&quot;const_reference&quot;. Details:</p>
+
+<p>Change 23.2.3.1/1 from:</p>
+
+<pre>
+ namespace std {
+ template &lt;class T, class Container = deque&lt;T&gt; &gt;
+ class queue {
+ public:
+ typedef typename Container::value_type value_type;
+ typedef typename Container::size_type size_type;
+ typedef Container container_type;
+ protected:
+ Container c;
+
+ public:
+ explicit queue(const Container&amp; = Container());
+
+ bool empty() const { return c.empty(); }
+ size_type size() const { return c.size(); }
+ value_type&amp; front() { return c.front(); }
+ const value_type&amp; front() const { return c.front(); }
+ value_type&amp; back() { return c.back(); }
+ const value_type&amp; back() const { return c.back(); }
+ void push(const value_type&amp; x) { c.push_back(x); }
+ void pop() { c.pop_front(); }
+ };
+</pre>
+
+<p>to:</p>
+
+<pre>
+ namespace std {
+ template &lt;class T, class Container = deque&lt;T&gt; &gt;
+ class queue {
+ public:
+ typedef typename Container::value_type value_type;
+ typedef typename Container::reference reference;
+ typedef typename Container::const_reference const_reference;
+ typedef typename Container::value_type value_type;
+ typedef typename Container::size_type size_type;
+ typedef Container container_type;
+ protected:
+ Container c;
+
+ public:
+ explicit queue(const Container&amp; = Container());
+
+ bool empty() const { return c.empty(); }
+ size_type size() const { return c.size(); }
+ reference front() { return c.front(); }
+ const_reference front() const { return c.front(); }
+ reference back() { return c.back(); }
+ const_reference back() const { return c.back(); }
+ void push(const value_type&amp; x) { c.push_back(x); }
+ void pop() { c.pop_front(); }
+ };
+</pre>
+
+<p>Change 23.2.3.2/1 from:</p>
+
+<pre>
+ namespace std {
+ template &lt;class T, class Container = vector&lt;T&gt;,
+ class Compare = less&lt;typename Container::value_type&gt; &gt;
+ class priority_queue {
+ public:
+ typedef typename Container::value_type value_type;
+ typedef typename Container::size_type size_type;
+ typedef Container container_type;
+ protected:
+ Container c;
+ Compare comp;
+
+ public:
+ explicit priority_queue(const Compare&amp; x = Compare(),
+ const Container&amp; = Container());
+ template &lt;class InputIterator&gt;
+ priority_queue(InputIterator first, InputIterator last,
+ const Compare&amp; x = Compare(),
+ const Container&amp; = Container());
+
+ bool empty() const { return c.empty(); }
+ size_type size() const { return c.size(); }
+ const value_type&amp; top() const { return c.front(); }
+ void push(const value_type&amp; x);
+ void pop();
+ };
+ // no equality is provided
+ }
+</pre>
+
+<p>to:</p>
+
+<pre>
+ namespace std {
+ template &lt;class T, class Container = vector&lt;T&gt;,
+ class Compare = less&lt;typename Container::value_type&gt; &gt;
+ class priority_queue {
+ public:
+ typedef typename Container::value_type value_type;
+ typedef typename Container::reference reference;
+ typedef typename Container::const_reference const_reference;
+ typedef typename Container::size_type size_type;
+ typedef Container container_type;
+ protected:
+ Container c;
+ Compare comp;
+
+ public:
+ explicit priority_queue(const Compare&amp; x = Compare(),
+ const Container&amp; = Container());
+ template &lt;class InputIterator&gt;
+ priority_queue(InputIterator first, InputIterator last,
+ const Compare&amp; x = Compare(),
+ const Container&amp; = Container());
+
+ bool empty() const { return c.empty(); }
+ size_type size() const { return c.size(); }
+ const_reference top() const { return c.front(); }
+ void push(const value_type&amp; x);
+ void pop();
+ };
+ // no equality is provided
+ }
+</pre>
+
+<p>And change 23.2.3.3/1 from:</p>
+
+<pre>
+ namespace std {
+ template &lt;class T, class Container = deque&lt;T&gt; &gt;
+ class stack {
+ public:
+ typedef typename Container::value_type value_type;
+ typedef typename Container::size_type size_type;
+ typedef Container container_type;
+ protected:
+ Container c;
+
+ public:
+ explicit stack(const Container&amp; = Container());
+
+ bool empty() const { return c.empty(); }
+ size_type size() const { return c.size(); }
+ value_type&amp; top() { return c.back(); }
+ const value_type&amp; top() const { return c.back(); }
+ void push(const value_type&amp; x) { c.push_back(x); }
+ void pop() { c.pop_back(); }
+ };
+
+ template &lt;class T, class Container&gt;
+ bool operator==(const stack&lt;T, Container&gt;&amp; x,
+ const stack&lt;T, Container&gt;&amp; y);
+ template &lt;class T, class Container&gt;
+ bool operator&lt; (const stack&lt;T, Container&gt;&amp; x,
+ const stack&lt;T, Container&gt;&amp; y);
+ template &lt;class T, class Container&gt;
+ bool operator!=(const stack&lt;T, Container&gt;&amp; x,
+ const stack&lt;T, Container&gt;&amp; y);
+ template &lt;class T, class Container&gt;
+ bool operator&gt; (const stack&lt;T, Container&gt;&amp; x,
+ const stack&lt;T, Container&gt;&amp; y);
+ template &lt;class T, class Container&gt;
+ bool operator&gt;=(const stack&lt;T, Container&gt;&amp; x,
+ const stack&lt;T, Container&gt;&amp; y);
+ template &lt;class T, class Container&gt;
+ bool operator&lt;=(const stack&lt;T, Container&gt;&amp; x,
+ const stack&lt;T, Container&gt;&amp; y);
+ }
+</pre>
+
+<p>to:</p>
+
+<pre>
+ namespace std {
+ template &lt;class T, class Container = deque&lt;T&gt; &gt;
+ class stack {
+ public:
+ typedef typename Container::value_type value_type;
+ typedef typename Container::reference reference;
+ typedef typename Container::const_reference const_reference;
+ typedef typename Container::size_type size_type;
+ typedef Container container_type;
+ protected:
+ Container c;
+
+ public:
+ explicit stack(const Container&amp; = Container());
+
+ bool empty() const { return c.empty(); }
+ size_type size() const { return c.size(); }
+ reference top() { return c.back(); }
+ const_reference top() const { return c.back(); }
+ void push(const value_type&amp; x) { c.push_back(x); }
+ void pop() { c.pop_back(); }
+ };
+
+ template &lt;class T, class Container&gt;
+ bool operator==(const stack&lt;T, Container&gt;&amp; x,
+ const stack&lt;T, Container&gt;&amp; y);
+ template &lt;class T, class Container&gt;
+ bool operator&lt; (const stack&lt;T, Container&gt;&amp; x,
+ const stack&lt;T, Container&gt;&amp; y);
+ template &lt;class T, class Container&gt;
+ bool operator!=(const stack&lt;T, Container&gt;&amp; x,
+ const stack&lt;T, Container&gt;&amp; y);
+ template &lt;class T, class Container&gt;
+ bool operator&gt; (const stack&lt;T, Container&gt;&amp; x,
+ const stack&lt;T, Container&gt;&amp; y);
+ template &lt;class T, class Container&gt;
+ bool operator&gt;=(const stack&lt;T, Container&gt;&amp; x,
+ const stack&lt;T, Container&gt;&amp; y);
+ template &lt;class T, class Container&gt;
+ bool operator&lt;=(const stack&lt;T, Container&gt;&amp; x,
+ const stack&lt;T, Container&gt;&amp; y);
+ }
+</pre>
+
+<p><i>[Copenhagen: This change was discussed before the IS was released
+and it was deliberately not adopted. Nevertheless, the LWG believes
+(straw poll: 10-2) that it is a genuine defect.]</i></p>
+
+<hr>
+<a name="308"><h3>308.&nbsp;Table 82 mentions unrelated headers</h3></a><p>
+<b>Section:</b>&nbsp;27 <a href="lib-iostreams.html#lib.input.output"> [lib.input.output]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Martin Sebor&nbsp; <b>Date:</b>&nbsp;15 Mar 2001</p>
+<p>
+Table 82 in section 27 mentions the header &lt;cstdlib&gt; for String
+streams (27.7 <a href="lib-iostreams.html#lib.string.streams"> [lib.string.streams]</a>) and the headers &lt;cstdio&gt; and
+&lt;cwchar&gt; for File streams (27.8 <a href="lib-iostreams.html#lib.file.streams"> [lib.file.streams]</a>). It's not clear
+why these headers are mentioned in this context since they do not
+define any of the library entities described by the
+subclauses. According to 17.4.1.1 <a href="lib-intro.html#lib.contents"> [lib.contents]</a>, only such headers
+are to be listed in the summary.
+</p>
+<p><b>Proposed resolution:</b></p>
+<p>Remove &lt;cstdlib&gt; and &lt;cwchar&gt; from
+Table 82.</p>
+
+<p><i>[Copenhagen: changed the proposed resolution slightly. The
+original proposed resolution also said to remove &lt;cstdio&gt; from
+Table 82. However, &lt;cstdio&gt; is mentioned several times within
+section 27.8 <a href="lib-iostreams.html#lib.file.streams"> [lib.file.streams]</a>, including 27.8.2 <a href="lib-iostreams.html#lib.c.files"> [lib.c.files]</a>.]</i></p>
+
+<hr>
+<a name="312"><h3>312.&nbsp;Table 27 is missing headers</h3></a><p>
+<b>Section:</b>&nbsp;20 <a href="lib-utilities.html#lib.utilities"> [lib.utilities]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Martin Sebor&nbsp; <b>Date:</b>&nbsp;29 Mar 2001</p>
+<p>Table 27 in section 20 lists the header &lt;memory&gt; (only) for
+Memory (lib.memory) but neglects to mention the headers
+&lt;cstdlib&gt; and &lt;cstring&gt; that are discussed in 20.4.6 <a href="lib-utilities.html#lib.c.malloc"> [lib.c.malloc]</a>.</p>
+<p><b>Proposed resolution:</b></p>
+<p>Add &lt;cstdlib&gt; and &lt;cstring&gt; to Table 27, in the same row
+as &lt;memory&gt;.</p>
+<p>----- End of document -----</p>
+</body>
+</html>
diff --git a/libstdc++-v3/docs/html/ext/sgiexts.html b/libstdc++-v3/docs/html/ext/sgiexts.html
new file mode 100644
index 00000000000..1d73eaff2f7
--- /dev/null
+++ b/libstdc++-v3/docs/html/ext/sgiexts.html
@@ -0,0 +1,237 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
+<html>
+<head>
+ <meta name="AUTHOR" content="pme@gcc.gnu.org (Phil Edwards)">
+ <meta name="KEYWORDS" content="libstdc++, libstdc++-v3, GCC, g++, STL, SGI">
+ <meta name="DESCRIPTION" content="SGI extensions preserved in libstdc++-v3.">
+ <meta name="GENERATOR" content="vi and eight fingers">
+ <title>SGI extensions to the library in libstdc++-v3</title>
+<link rel="StyleSheet" href="lib3styles.css">
+</head>
+<body>
+
+<h1 class="centered"><a name="top">SGI extensions to the library in
+libstdc++-v3</a></h1>
+
+<p>This page describes the extensions that SGI made to their version of the
+ STL subset of the Standard C++ Library. For a time we
+ <a href="../faq/index.html#5_3">tracked and imported changes and updates
+ from most of the SGI STL</a>, up through their (apparently) final release.
+ Their extensions were mostly preserved.
+</p>
+
+<p>They are listed according to the chapters of the library that they
+ extend (see <a href="../documentation.html#3">the chapter-specific notes</a>
+ for a description). Not every chapter may have extensions, and the
+ extensions may come and go. Also, this page is incomplete because the
+ author is pressed for time. Check back often; the latest change was on
+ $Date: 2001/11/28 00:02:04 $ (UTC).
+</p>
+
+<p>Descriptions range from the scanty to the verbose. You should also check
+ the <a href="../documentation.html#4">generated documentation</a> for notes
+ and comments, especially for entries marked with '*'. For more complete
+ doumentation, see the SGI website. For <em>really</em> complete
+ documentation, buy a copy of Matt Austern's book. *grin*
+</p>
+
+<p>Back to the <a href="howto.html">libstdc++-v3 extensions</a>.
+
+
+<!-- ####################################################### -->
+<hr>
+<a name="ch20"><h3>Chapter 20</h3></a>
+<p>The &lt;functional&gt; header contains many additional functors and
+ helper functions, extending section 20.3. They are implemented in the
+ file stl_function.h:
+ <ul>
+ <li><code>identity_element</code> for addition and multiplication. *
+ <li>The functor <code>identity</code>, whose op() returns the argument
+ unchanged. *
+ <li>Composition functors <code>unary_function</code> and
+ <code>binary_function</code>, and their helpers <code>compose1</code>
+ and <code>compose2</code>. *
+ <li><code>select1st</code> and <code>select2nd</code>, to strip pairs. *
+ <li><code>project1st</code> and <code>project2nd</code>. *
+ <li>A set of functors/functions which always return the same result. They
+ are <code>constant_void_fun, constant_binary_fun, constant_unary_fun,
+ constant0, constant1, and constant2. *
+ <li>The class <code>subtractive_rng</code>. *
+ <li>mem_fun adaptor helpers mem_fun1 and mem_fun1_ref are provided for
+ backwards compatibility.
+</ul></p>
+<p>20.4.1 can use several different allocators; they are described on the
+ main extensions page.
+</p>
+<p>20.4.3 is extended with a special version of
+ <code>get_temporary_buffer</code> taking a second argument. The argument
+ is a pointer, which is ignored, but can be used to specify the template
+ type (instead of using explicit function template arguments like the
+ standard version does). That is, in addition to
+ <pre>
+ get_temporary_buffer&lt;int&gt;(5);</pre>
+ you can also use
+ <pre>
+ get_temporary_buffer(5, (int*)0);</pre>
+</p>
+<p>A class <code>temporary_buffer</code> is given in stl_tempbuf.h. *
+</p>
+<p>The specialized algorithms of section 20.4.4 are extended with
+ <code>uninitialized_copy_n</code>. *
+</p>
+<p>Return <a href="howto.html">to the main extensions page</a> or
+ <a href="http://gcc.gnu.org/libstdc++/">to the homepage</a>.
+</p>
+
+
+<hr>
+<a name="ch23"><h3>Chapter 23</h3></a>
+<p>A few extensions and nods to backwards-compatibility have been made with
+ containers. Those dealing with older SGI-style allocators are dealt with
+ elsewhere. The remaining ones all deal with bits:
+</p>
+<p>The old pre-standard <code>bit_vector</code> class is present for
+ backwards compatibility. It is simply a typedef for the
+ <code>vector&lt;bool&gt;</code> specialization.
+</p>
+<p>The <code>bitset</code> class has a number of extensions, described in the
+ rest of this item. First, we'll mention that this implementation of
+ <code>bitset&lt;N&gt;</code> is specialized for cases where N number of
+ bits will fit into a single word of storage. If your choice of N is
+ within that range (&lt;=32 on i686-pc-linux-gnu, for example), then all
+ of the operations will be faster.
+</p>
+<p>There are
+ versions of single-bit test, set, reset, and flip member functions which
+ do no range-checking. If we call them member functions of an instantiation
+ of &quot;bitset&lt;N&gt;,&quot; then their names and signatures are:
+ <pre>
+ bitset&lt;N&gt;&amp; _Unchecked_set (size_t pos);
+ bitset&lt;N&gt;&amp; _Unchecked_set (size_t pos, int val);
+ bitset&lt;N&gt;&amp; _Unchecked_reset (size_t pos);
+ bitset&lt;N&gt;&amp; _Unchecked_flip (size_t pos);
+ bool _Unchecked_test (size_t pos);</pre>
+ Note that these may in fact be removed in the future, although we have
+ no present plans to do so (and there doesn't seem to be any immediate
+ reason to).
+</p>
+<p>
+ The semantics of member function <code>operator[]</code> are not specified
+ in the C++ standard. A long-standing defect report calls for sensible
+ obvious semantics, which are already implemented here: <code>op[]</code>
+ on a const bitset returns a bool, and for a non-const bitset returns a
+ <code>reference</code> (a nested type). However, this implementation does
+ no range-checking on the index argument, which is in keeping with other
+ containers' <code>op[]</code> requirements. The defect report's proposed
+ resolution calls for range-checking to be done. We'll just wait and see...
+</p>
+<p>Finally, two additional searching functions have been added. They return
+ the index of the first &quot;on&quot; bit, and the index of the first
+ &quot;on&quot; bit that is after <code>prev</code>, respectively:
+ <pre>
+ size_t _Find_first() const;
+ size_t _Find_next (size_t prev) const;</pre>
+ The same caveat given for the _Unchecked_* functions applies here also.
+</p>
+<p>Return <a href="howto.html">to the main extensions page</a> or
+ <a href="http://gcc.gnu.org/libstdc++/">to the homepage</a>.
+</p>
+
+
+<hr>
+<a name="ch24"><h3>Chapter 24</h3></a>
+<p>24.3.2 describes <code>struct iterator</code>, which didn't exist in the
+ original HP STL implementation (the language wasn't rich enough at the
+ time). For backwards compatibility, base classes are provided which
+ declare the same nested typedefs:
+ <ul>
+ <li>input_iterator
+ <li>output_iterator
+ <li>forward_iterator
+ <li>bidirectional_iterator
+ <li>random_access_iterator
+ </ul>
+</p>
+<p>24.3.4 describes iterator operation <code>distance</code>, which takes
+ two iterators and returns a result. It is extended by another signature
+ which takes two iterators and a reference to a result. The result is
+ modified, and the function returns nothing.
+</p>
+<p>Return <a href="howto.html">to the main extensions page</a> or
+ <a href="http://gcc.gnu.org/libstdc++/">to the homepage</a>.
+</p>
+
+
+<hr>
+<a name="ch25"><h3>Chapter 25</h3></a>
+<p>25.1.6 (count, count_if) is extended with two more versions of count
+ and count_if. The standard versions return their results. The
+ additional signatures return void, but take a final parameter by
+ reference to which they assign their results, e.g.,
+ <pre>
+ void count (first, last, value, n);</pre>
+</p>
+<p>25.2 (mutating algorithms) is extended with two families of signatures,
+ random_sample and random_sample_n.
+</p>
+<p>25.2.1 (copy) is extended with
+ <pre>
+ copy_n (_InputIter first, _Size count, _OutputIter result);</pre>
+ which copies the first 'count' elements at 'first' into 'result'.
+</p>
+<p>25.3 (sorting 'n' heaps 'n' stuff) is extended with some helper
+ predicates. Look in the doxygen-generated pages for notes on these.
+ <ul>
+ <li><code>is_heap</code> tests whether or not a range is a heap.
+ <li><code>is_sorted</code> tests whether or not a range is sorted in
+ nondescending order.
+ </ul>
+</p>
+<p>25.3.8 (lexigraphical_compare) is extended with
+ <pre>
+ lexicographical_compare_3way(_InputIter1 first1, _InputIter1 last1,
+ _InputIter2 first2, _InputIter2 last2)</pre>
+ which does... what?
+</p>
+<p>Return <a href="howto.html">to the main extensions page</a> or
+ <a href="http://gcc.gnu.org/libstdc++/">to the homepage</a>.
+</p>
+
+
+<hr>
+<a name="ch26"><h3>Chapter 26</h3></a>
+<p>26.4, the generalized numeric operations such as accumulate, are extended
+ with the following functions:
+ <pre>
+ power (x, n);
+ power (x, n, moniod_operation);</pre>
+ Returns, in FORTRAN syntax, &quot;x ** n&quot; where n&gt;=0. In the
+ case of n == 0, returns the <a href="#ch20">identity element</a> for the
+ monoid operation. The two-argument signature uses multiplication (for
+ a true &quot;power&quot; implementation), but addition is supported as well.
+ The operation functor must be associative.
+</p>
+<p>The <code>iota</code> function wins the award for Extension With the
+ Coolest Name. It &quot;assigns sequentially increasing values to a range.
+ That is, it assigns value to *first, value + 1 to *(first + 1) and so
+ on.&quot; Quoted from SGI documentation.
+ <pre>
+ void iota(_ForwardIter first, _ForwardIter last, _Tp value);</pre>
+</p>
+<p>Return <a href="howto.html">to the main extensions page</a> or
+ <a href="http://gcc.gnu.org/libstdc++/">to the homepage</a>.
+</p>
+
+
+<!-- ####################################################### -->
+
+<hr>
+<p class="fineprint"><em>
+See <a href="../17_intro/license.html">license.html</a> for copying conditions.
+Comments and suggestions are welcome, and may be sent to
+<a href="mailto:libstdc++@gcc.gnu.org">the libstdc++ mailing list</a>.
+</em></p>
+
+
+</body>
+</html>
diff --git a/libstdc++-v3/docs/html/faq/index.html b/libstdc++-v3/docs/html/faq/index.html
index a9b82250505..f9f00a1ee77 100644
--- a/libstdc++-v3/docs/html/faq/index.html
+++ b/libstdc++-v3/docs/html/faq/index.html
@@ -1,208 +1,221 @@
-<HTML>
-<HEAD>
- <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
- <META NAME="KEYWORDS" CONTENT="libstdc++, libstdc++-v3, GCC, g++, libg++, STL">
- <META NAME="DESCRIPTION" CONTENT="FAQ for the GNU libstdc++ effort.">
- <TITLE>libstdc++-v3 FAQ</TITLE>
-<LINK REL=StyleSheet HREF="../lib3styles.css">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="KEYWORDS" content="libstdc++, libstdc++-v3, GCC, g++, libg++, STL">
+ <meta name="DESCRIPTION" content="FAQ for the GNU libstdc++ effort.">
+ <title>libstdc++-v3 FAQ</title>
+<link rel="StyleSheet" href="../lib3styles.css">
<!--
** Locations of "the most recent snapshot is the Nth" text are
** answers 1_1, 1_4, 4_1, 5_6.
-->
-<!-- $Id: index.html,v 1.1 2000/12/10 04:04:56 pme Exp $ -->
-</HEAD>
-<BODY>
+</head>
+<body>
-<H1 CLASS="centered">libstdc++ Frequently Asked Questions</H1>
+<h1 class="centered">libstdc++ Frequently Asked Questions</h1>
-<P>The latest version of this document is always available at
-<A HREF="http://gcc.gnu.org/onlinedocs/libstdc++/faq/">
-http://gcc.gnu.org/onlinedocs/libstdc++/faq/</A>.</P>
+<p>The latest version of this document is always available at
+<a href="http://gcc.gnu.org/onlinedocs/libstdc++/faq/">
+http://gcc.gnu.org/onlinedocs/libstdc++/faq/</a>.</p>
-<P>To the <A HREF="http://gcc.gnu.org/libstdc++/">libstdc++-v3 homepage</A>.
+<p>To the <a href="http://gcc.gnu.org/libstdc++/">libstdc++-v3 homepage</a>.
<!-- ####################################################### -->
-<HR>
-<H1>Questions</H1>
-<OL>
- <LI><A HREF="#1_0">General Information</A>
+<hr>
+<h1>Questions</h1>
+<ol>
+ <li><a href="#1_0">General Information</a>
<!-- I suspect these will mostly be links to/into existing documents. -->
- <OL>
- <LI><A HREF="#1_1">What is libstdc++-v3?</A>
- <LI><A HREF="#1_2">Why should I use libstdc++?</A>
- <LI><A HREF="#1_3">Who's in charge of it?</A>
- <LI><A HREF="#1_4">How do I get libstdc++?</A>
- <LI><A HREF="#1_5">When is libstdc++ going to be finished?</A>
- <LI><A HREF="#1_6">How do I contribute to the effort?</A>
- <LI><A HREF="#1_7">What happened to libg++? I need that!</A>
- <LI><A HREF="#1_8">What if I have more questions?</A>
- </OL>
-
- <LI><A HREF="#2_0">Installation</A>
- <OL>
- <LI><A HREF="#2_1">How do I install libstdc++-v3?</A>
- <LI><A HREF="#2_2">Is this a drop-in replacement for the
- libstdc++ that's shipped with g++?</A>
- <LI><A HREF="#2_3">What is this CVS thing that you keep
- mentioning?</A>
- <LI><A HREF="#2_4">How do I know if it works?</A>
- </OL>
-
- <LI><A HREF="#3_0">Platform-Specific Issues</A>
- <OL>
- <LI><A HREF="#3_1">Can libstdc++-v3 be used with &lt;my
- favorite compiler&gt;?</A>
- <LI><A HREF="#3_2">Building under Cygwin hangs/explodes!?</A>
- <LI><A HREF="#3_3">Building under DEC OSF kills the assembler</A>
- </OL>
-
- <LI><A HREF="#4_0">Known Bugs and Non-Bugs</A>
- <OL>
- <LI><A HREF="#4_1">What works already?</A>
- <LI><A HREF="#4_2">Bugs in gcc/g++ (not libstdc++-v3)</A>
- <LI><A HREF="#4_3">Bugs in the C++ language/lib specification</A>
- <LI><A HREF="#4_4">Things in libstdc++ that look like bugs</A>
- <BR><A HREF="#4_4_interface">The g++-3 headers are
- <STRONG>not ours</STRONG></A>
- <LI><A HREF="#4_5">Aw, that's easy to fix!</A>
- </OL>
-
- <LI><A HREF="#5_0">Miscellaneous</A>
- <OL>
- <LI><A HREF="#5_1">string::iterator is not char*;
- vector&lt;T&gt;::iterator is not T*</A>
- <LI><A HREF="#5_2">What's next after libstdc++-v3?</A>
- <LI><A HREF="#5_3">What about the STL from SGI?</A>
- <LI><A HREF="#5_4">Extensions and Backward Compatibility</A>
- <LI><A HREF="#5_5">Compiling with &quot;-fnew-abi&quot;</A>
- <LI><A HREF="#5_6">Is libstdc++-v3 thread-safe?</A>
- <LI><A HREF="#5_7">How do I get a copy of the ISO C++ Standard?</A>
- </OL>
-
-</OL>
-
-<HR>
+ <ol>
+ <li><a href="#1_1">What is libstdc++-v3?</a>
+ <li><a href="#1_2">Why should I use libstdc++?</a>
+ <li><a href="#1_3">Who's in charge of it?</a>
+ <li><a href="#1_4">How do I get libstdc++?</a>
+ <li><a href="#1_5">When is libstdc++ going to be finished?</a>
+ <li><a href="#1_6">How do I contribute to the effort?</a>
+ <li><a href="#1_7">What happened to libg++? I need that!</a>
+ <li><a href="#1_8">What if I have more questions?</a>
+ <li><a href="#1_9">What are the license terms for libstdc++-v3?</a>
+ </ol>
+
+ <li><a href="#2_0">Installation</a>
+ <ol>
+ <li><a href="#2_1">How do I install libstdc++-v3?</a>
+ <li><a href="#2_2">[removed]</a>
+ <li><a href="#2_3">What is this CVS thing that you keep
+ mentioning?</a>
+ <li><a href="#2_4">How do I know if it works?</a>
+ <li><a href="#2_5">This library is HUGE! And what's libsupc++?</a>
+ </ol>
+
+ <li><a href="#3_0">Platform-Specific Issues</a>
+ <ol>
+ <li><a href="#3_1">Can libstdc++-v3 be used with &lt;my
+ favorite compiler&gt;?</a>
+ <li><a href="#3_2">[removed]</a>
+ <li><a href="#3_3">Building under DEC OSF kills the assembler</a>
+ <li><a href="#3_4">I can't use 'long long' on Solaris</a>
+ </ol>
+
+ <li><a href="#4_0">Known Bugs and Non-Bugs</a>
+ <ol>
+ <li><a href="#4_1">What works already?</a>
+ <li><a href="#4_2">Bugs in gcc/g++ (not libstdc++-v3)</a>
+ <li><a href="#4_3">Bugs in the C++ language/lib specification</a>
+ <li><a href="#4_4">Things in libstdc++ that look like bugs</a>
+ <ul>
+ <li><a href="#4_4_iostreamclear">reopening a stream fails</a>
+ <li><a href="#4_4_Weff">-Weffc++ complains too much</a>
+ <li><a href="#4_4_rel_ops">&quot;ambiguous overloads&quot;
+ after including an old-style header</a>
+ <li><a href="#4_4_interface">The g++-3 headers are
+ <strong>not ours</strong></a>
+ <li><a href="#4_4_glibc">compilation errors from streambuf.h</a>
+ <li><a href="#4_4_checks">errors about <em>*Cconcept</em> and
+ <em>constraints</em> in the STL...</a>
+ </ul>
+ <li><a href="#4_5">Aw, that's easy to fix!</a>
+ </ol>
+
+ <li><a href="#5_0">Miscellaneous</a>
+ <ol>
+ <li><a href="#5_1">string::iterator is not char*;
+ vector&lt;T&gt;::iterator is not T*</a>
+ <li><a href="#5_2">What's next after libstdc++-v3?</a>
+ <li><a href="#5_3">What about the STL from SGI?</a>
+ <li><a href="#5_4">Extensions and Backward Compatibility</a>
+ <li><a href="#5_5">[removed]</a>
+ <li><a href="#5_6">Is libstdc++-v3 thread-safe?</a>
+ <li><a href="#5_7">How do I get a copy of the ISO C++ Standard?</a>
+ <li><a href="#5_8">What's an ABI and why is it so messy?</a>
+ </ol>
+
+</ol>
+
+<hr>
<!-- ####################################################### -->
-<H1><A NAME="1_0">1.0 General Information</A></H1>
+<h1><a name="1_0">1.0 General Information</a></h1>
<!-- I suspect these will mostly be links to/into existing documents. -->
- <H2><A NAME="1_1">1.1 What is libstdc++-v3?</A></H2>
- <P>The GNU Standard C++ Library v3, or libstdc++-2.90.x/2.9x, is an
+ <h2><a name="1_1">1.1 What is libstdc++-v3?</a></h2>
+ <p>The GNU Standard C++ Library v3 is an
ongoing project to implement the ISO 14882 Standard C++ library
as described in chapters 17 through 27 and annex D. As the
library reaches stable plateaus, it is captured in a snapshot
- and released. The current release is <A
-HREF="ftp://gcc.gnu.org/pub/libstdc++/libstdc++-2.91.tar.gz">the
- tenth snapshot</A>. For those who want to see exactly how
+ and released. The current release is
+ <a href="http://gcc.gnu.org/libstdc++/download.html">the
+ eleventh snapshot</a>. For those who want to see exactly how
far the project has come, or just want the latest
bleeding-edge code, the up-to-date source is available over
anonymous CVS, and can even be browsed over the Web (see below).
- </P>
- <P>A more formal description of the V3 goals can be found in the
- official <A HREF="../17_intro/DESIGN">design document</A>.
- </P>
-
-<HR>
- <H2><A NAME="1_2">1.2 Why should I use libstdc++?</A></H2>
- <P>The completion of the ISO C++ standardization gave the
+ </p>
+ <p>The older libstdc++-v2 project is no longer maintained; the code
+ has been completely replaced and rewritten.
+ <a href="#4_4_interface">If you are using V2</a>, then you need to
+ report bugs to your system vendor, not to the V3 list.
+ </p>
+ <p>A more formal description of the V3 goals can be found in the
+ official <a href="../17_intro/DESIGN">design document</a>.
+ </p>
+
+<hr>
+ <h2><a name="1_2">1.2 Why should I use libstdc++?</a></h2>
+ <p>The completion of the ISO C++ standardization gave the
C++ community a powerful set of reuseable tools in the form
of the C++ Standard Library. However, all existing C++
implementations are (as the Draft Standard used to say)
&quot;incomplet and incorrekt,&quot; and many suffer from
limitations of the compilers that use them.
- </P>
- <P>The GNU C/C++/FORTRAN/&lt;pick-a-language&gt; compiler
- (<TT>gcc</TT>, <TT>g++</TT>, etc) is widely considered to be
+ </p>
+ <p>The GNU C/C++/FORTRAN/&lt;pick-a-language&gt; compiler
+ (<code>gcc</code>, <code>g++</code>, etc) is widely considered to be
one of the leading compilers in the world. Its development
has recently been taken over by the
- <A HREF="http://gcc.gnu.org/">GCC team</A>. All of
+ <a href="http://gcc.gnu.org/">GCC team</a>. All of
the rapid development and near-legendary
- <A
-HREF="http://gcc.gnu.org/gcc-2.95/buildstat.html">portability</A>
+ <a href="http://gcc.gnu.org/gcc-2.95/buildstat.html">portability</a>
that are the hallmarks of an open-source project are being
applied to libstdc++.
- </P>
- <P>That means that all of the Standard classes and functions
- (such as <TT>string</TT>, <TT>vector&lt;&gt;</TT>, iostreams,
+ </p>
+ <p>That means that all of the Standard classes and functions
+ (such as <code>string</code>, <code>vector&lt;&gt;</code>, iostreams,
and algorithms) will be freely available and fully compliant.
Programmers will no longer need to &quot;roll their own&quot;
- nor be worried about platform-specific incompatabilities.
- </P>
+ nor be worried about platform-specific incompatibilities.
+ </p>
-<HR>
- <H2><A NAME="1_3">1.3 Who's in charge of it?</A></H2>
- <P>The libstdc++ project is contributed to by several developers
+<hr>
+ <h2><a name="1_3">1.3 Who's in charge of it?</a></h2>
+ <p>The libstdc++ project is contributed to by several developers
all over the world, in the same way as GCC or Linux.
Benjamin Kosnik, Gabriel Dos Reis, Phil Edwards, and Ulrich
Drepper are the lead maintainers of the CVS archive.
- </P>
- <P>Development and discussion is held on the libstdc++ mailing
- list. Subscribing to the list, or searching the list
+ </p>
+ <p>Development and discussion is held on the libstdc++ mailing
+ list. Subscribing to the list, or searching the list
archives, is open to everyone. You can read instructions for
- doing so on the <A HREF="http://gcc.gnu.org/libstdc++/">homepage</A>. If you
- have questions, ideas, code, or are just curious, sign up!
- </P>
-
-<HR>
- <H2><A NAME="1_4">1.4 How do I get libstdc++?</A></H2>
- <P>The tenth (and latest) snapshot of libstdc++-v3 is <A
-HREF="ftp://gcc.gnu.org/pub/libstdc++/libstdc++-2.91.tar.gz">
- available via ftp</A>.
- </P>
- <P>The <A HREF="http://gcc.gnu.org/libstdc++/">homepage</A>
+ doing so on the <a href="http://gcc.gnu.org/libstdc++/">homepage</a>.
+ If you have questions, ideas, code, or are just curious, sign up!
+ </p>
+
+<hr>
+ <h2><a name="1_4">1.4 How do I get libstdc++?</a></h2>
+ <p>The eleventh (and latest) snapshot of libstdc++-v3 is
+ <a href="http://gcc.gnu.org/libstdc++/download.html">available via
+ ftp</a>. The filename is libstdc++-2.92.tar.gz.
+ </p>
+ <p>The <a href="http://gcc.gnu.org/libstdc++/">homepage</a>
has instructions for retrieving the latest CVS sources, and for
browsing the CVS sources over the web.
- </P>
- <P>The subset commonly known as the Standard Template Library
- (chapters 23 through 25, mostly) is adapted from the SGI STL,
- which is also an ongoing work.<!-- Possibly a link to SGI's
- STL here. -->
- </P>
-
-<HR>
- <H2><A NAME="1_5">1.5 When is libstdc++ going to be finished?</A></H2>
-<!-- <P>Nathan Myers gave the best of all possible answers in <A
- HREF="http://www.deja.com/getdoc.xp?AN=469581698&fmt=text">a
- Usenet article</A>.</P>
+ </p>
+ <p>The subset commonly known as the Standard Template Library
+ (chapters 23 through 25, mostly) is adapted from the final release
+ of the SGI STL.
+ </p>
+
+<hr>
+ <h2><a name="1_5">1.5 When is libstdc++ going to be finished?</a></h2>
+<!-- <p>Nathan Myers gave the best of all possible answers in <A
+ href="http://www.deja.com/getdoc.xp?AN=469581698&fmt=text">a
+ Usenet article</a>.</p>
which is no longer available, thanks deja...-->
- <P>Nathan Myers gave the best of all possible answers, responding
- to a Usenet article asking this question: Sooner, if you help.
- </P>
-
-
-<HR>
- <H2><A NAME="1_6">1.6 How do I contribute to the effort?</A></H2>
- <P>Here is <A HREF="../17_intro/contribute.html">a
- page devoted to this topic</A>. Subscribing to the mailing
+ <p>Nathan Myers gave the best of all possible answers, responding to a
+ Usenet article asking this question: <em>Sooner, if you help.</em>
+ </p>
+
+<hr>
+ <h2><a name="1_6">1.6 How do I contribute to the effort?</a></h2>
+ <p>Here is <a href="../17_intro/contribute.html">a
+ page devoted to this topic</a>. Subscribing to the mailing
list (see above, or the homepage) is a very good idea if you
have something to contribute, or if you have spare time and
want to help. Contributions don't have to be in the form of
source code; anybody who is willing to help write
documentation, for example, or has found a bug in code that
we all thought was working, is more than welcome!
- </P>
+ </p>
-<HR>
- <H2><A NAME="1_7">1.7 What happened to libg++? I need that!</A></H2>
- <P>The most recent libg++ README states that libg++ is no longer
+<hr>
+ <h2><a name="1_7">1.7 What happened to libg++? I need that!</a></h2>
+ <p>The most recent libg++ README states that libg++ is no longer
being actively maintained. It should not be used for new
projects, and is only being kicked along to support older code.
- </P>
- <P>The libg++ was designed and created when there was no Standard
+ </p>
+ <p>The libg++ was designed and created when there was no Standard
to provide guidance. Classes like linked lists are now provided
- for by <TT>list&lt;T&gt;</TT> and do not need to be created by
- <TT>genclass</TT>. (For that matter, templates exist now and
+ for by <code>list&lt;T&gt;</code> and do not need to be created by
+ <code>genclass</code>. (For that matter, templates exist now and
are well-supported, whereas genclass (mostly) predates them.)
- </P>
- <P>There are other classes in libg++ that are not specified in the
+ </p>
+ <p>There are other classes in libg++ that are not specified in the
ISO Standard (e.g., statistical analysis). While there are a
lot of really useful things that are used by a lot of people
(e.g., statistics :-), the Standards Committee couldn't include
everything, and so a lot of those &quot;obvious&quot; classes
didn't get included.
- </P>
- <P>Since libstdc++ is an implementation of the Standard Library, we
+ </p>
+ <p>Since libstdc++ is an implementation of the Standard Library, we
have no plans at this time to include non-Standard utilities
in the implementation, however handy they are. (The extensions
provided in the SGI STL aren't maintained by us and don't get
@@ -210,477 +223,660 @@ which is no longer available, thanks deja...-->
time.) It is entirely plausable that the &quot;useful stuff&quot;
from libg++ might be extracted into an updated utilities library,
but nobody has stated such a project yet.
- </P>
+ </p>
<!-- The advertisement, so to speak, might have to go. Hmmmmm. -->
- <P>(The <A HREF="http://www.boost.org/">Boost</A> site houses free
+ <p>(The <a href="http://www.boost.org/">Boost</a> site houses free
C++ libraries that do varying things, and happened to be started
by members of the Standards Committee. Certain &quot;useful
stuff&quot; classes will probably migrate there.)
- </P>
- <P>For the bold and/or desperate, the
- <A HREF="http://gcc.gnu.org/fom_serv/cache/33.html">GCC FAQ</A>
+ </p>
+ <p>For the bold and/or desperate, the
+ <a href="http://gcc.gnu.org/fom_serv/cache/33.html">GCC FAQ</a>
describes where to find the last libg++ source.
- </P>
+ </p>
-<HR>
- <H2><A NAME="1_8">1.8 What if I have more questions?</A></H2>
- <P>If you have read the README and RELEASE-NOTES files, and your
+<hr>
+ <h2><a name="1_8">1.8 What if I have more questions?</a></h2>
+ <p>If you have read the README and RELEASE-NOTES files, and your
question remains unanswered, then just ask the mailing list.
At present, you do not need to be subscribed to the list to
send a message to it. More information is available on the
homepage (including how to browse the list archives); to send
- to the list, use <A HREF="mailto:libstdc++@gcc.gnu.org">
- <CODE>libstdc++@gcc.gnu.org</CODE></A>.
- </P>
- <P>If you have a question that you think should be included here,
- or if you have a question <EM>about</EM> a question/answer here,
- contact <A HREF="mailto:pme@sources.redhat.com">Phil Edwards</A>
- or <A HREF="mailto:gdr@gcc.gnu.org">Gabriel Dos Reis</A>.
- </P>
-
-<HR>
-
-<H1><A NAME="2_0">2.0 Installation</A></H1>
- <H2><A NAME="2_1">2.1 How do I install libstdc++-v3?</A></H2>
- <P>Complete instructions are not given here (this is a FAQ, not
+ to the list, use <a href="mailto:libstdc++@gcc.gnu.org">
+ <code>libstdc++@gcc.gnu.org</code></a>.
+ </p>
+ <p>If you have a question that you think should be included here,
+ or if you have a question <em>about</em> a question/answer here,
+ contact <a href="mailto:pme@gcc.gnu.org">Phil Edwards</a>
+ or <a href="mailto:gdr@gcc.gnu.org">Gabriel Dos Reis</a>.
+ </p>
+
+<hr>
+ <h2><a name="1_9">1.9 What are the license terms for libstdc++-v3?</a></h2>
+ <p>See <a href="../17_intro/license.html">our license description</a>
+ for these and related questions.
+ </p>
+
+<hr>
+<h1><a name="2_0">2.0 Installation</a></h1>
+ <h2><a name="2_1">2.1 How do I install libstdc++-v3?</a></h2>
+ <p>Complete instructions are not given here (this is a FAQ, not
an installation document), but the tools required are few:
- </P>
- <UL>
- <LI> A release of libstdc++.
- <LI> A recent release of GCC (version 2.95 works). Note
- that building GCC is much easier and more automated
- than building the GCC 2.[78] series was.
- <LI> If you plan on hacking around with the makefiles, you
- will need the tools <A
-HREF="http://sources.redhat.com/autoconf/">autoconf</A>and <A
-HREF="http://sources.redhat.com/automake/">automake</A>.
- <LI> GNU Make is the only make that supports these makefiles.
- </UL>
- <P>The file <A HREF="../documentation.html">documentation.html</A>
+ </p>
+ <ul>
+ <li> A 3.x release of GCC. Note that building GCC is much
+ easier and more automated than building the GCC 2.[78]
+ series was. If you are using GCC 2.95, you can still
+ build earlier snapshots of libstdc++.
+ <li> GNU Make is recommended, but should not be required.
+ <li> The GNU Autotools are needed if you are messing with
+ the configury or makefiles.
+ </ul>
+ <p>The file <a href="../documentation.html">documentation.html</a>
provides a good overview of the steps necessary to build, install,
and use the library. Instructions for configuring the library
- with new flags such as --enable-threads are there also.
- </P>
- <P>The top-level install.html and
- <A HREF="../17_intro/RELEASE-NOTES">RELEASE-NOTES</A> files contain
+ with new flags such as --enable-threads are there also, as well as
+ patches and instructions for working with GCC 2.95.
+ </p>
+ <p>The top-level install.html and
+ <a href="../17_intro/RELEASE-NOTES">RELEASE-NOTES</a> files contain
the exact build and installation instructions. You may wish to
browse those files over CVSweb ahead of time to get a feel for
what's required. RELEASE-NOTES is located in the
&quot;.../docs/17_intro/&quot; directory of the distribution.
- </P>
-
-<HR>
- <H2><A NAME="2_2">2.2 Is this a drop-in replacement for the
- libstdc++ that's shipped with g++?</A></H2>
- <P>Yes, as of 2.90.8, it is intended as such. And as of 2.91,
- libstdc++-v3 <EM>is</EM> the library that's shipped with
- g++, so much of this answer has become moot.
- </P>
-
-<HR>
- <H2><A NAME="2_3">2.3 What is this CVS thing that you
- keep mentioning?</A></H2>
- <P>The <EM>Concurrent Versions System</EM> is one of several revision
+ </p>
+
+<hr>
+ <h2><a name="2_2">2.2 [removed]</a></h2>
+ <p>This question has become moot and has been removed. The stub
+ is here to preserve numbering (and hence links/bookmarks).
+ </p>
+
+<hr>
+ <h2><a name="2_3">2.3 What is this CVS thing that you
+ keep mentioning?</a></h2>
+ <p>The <em>Concurrent Versions System</em> is one of several revision
control packages. It was selected for GNU projects because it's
- free (speech), free (beer), and very high quality. The <A
- HREF="http://www.gnu.org/software/cvs/cvs.html">CVS entry in
- the GNU software catalogue</A> has a better description as
+ free (speech), free (beer), and very high quality. The <A
+ href="http://www.gnu.org/software/cvs/cvs.html">CVS entry in
+ the GNU software catalogue</a> has a better description as
well as a
- <A HREF="http://www.cyclic.com/">link to the makers of CVS</A>.
- </P>
- <P>The &quot;anonymous client checkout&quot; feature of CVS is
+ <a href="http://www.cvshome.org/">link to the makers of CVS</a>.
+ </p>
+ <p>The &quot;anonymous client checkout&quot; feature of CVS is
similar to anonymous FTP in that it allows anyone to retrieve
the latest libstdc++ sources.
- </P>
- <P>After the first of April, American users will have a
+ </p>
+ <p>After the first of April, American users will have a
&quot;/pharmacy&quot; command-line option...
<!-- wonder how long that'll live -->
- </P>
-
-<HR>
- <H2><A NAME="2_4">2.4 How do I know if it works?</A></H2>
- <P>libstdc++-v3 comes with its own testsuite. You do not need
- to actually install the library (&quot;<TT>gmake
- install</TT>&quot;) to run the testsuite. Note that 2.91 does
- not use DejaGNU yet.
- </P>
- <P>To run the testsuite on the library after building it, use
- &quot;gmake check&quot; while in your build directory. To run
+ </p>
+
+<hr>
+ <h2><a name="2_4">2.4 How do I know if it works?</a></h2>
+ <p>libstdc++-v3 comes with its own testsuite. You do not need
+ to actually install the library (&quot;<code>make
+ install</code>&quot;) to run the testsuite.
+ </p>
+ <p>To run the testsuite on the library after building it, use
+ &quot;make check&quot; while in your build directory. To run
the testsuite on the library after building and installing it,
- use &quot;gmake check-install&quot; instead.
- </P>
- <P>The testsuite subdirectory in your build directory will then
- contain three files of the form YYYYMMDD-mkcheck*.txt. One of
- them (-mkcheck.txt itself) contains the results of the tests;
- this can be mailed to the list. The other files (-mkchecklog.txt
- and -mkcheckfiles.txt) contain messages from the compiler while
- building the test programs, and a list of the tests to be run,
- respectively.
- </P>
- <P>If you find bugs in the testsuite programs themselves, or if
- you think of a new test program that should be added to the
- suite, <B>please</B> write up your idea and send it to the list!
- </P>
-
-<HR>
-<H1><A NAME="3_0">3.0 Platform-Specific Issues</A></H1>
- <H2><A NAME="3_1">3.1 Can libstdc++-v3 be used with &lt;my
- favorite compiler&gt;?</A></H2>
- <P>Probably not. Yet.</P>
- <P>Because GCC advances so rapidly, development and testing of
+ use &quot;make check-install&quot; instead.
+ </p>
+ <p>If you find bugs in the testsuite programs themselves, or if you
+ think of a new test program that should be added to the suite,
+ <strong>please</strong> write up your idea and send it to the list!
+ </p>
+
+<hr>
+ <h2><a name="2_5">2.4 This library is HUGE! And what's libsupc++?</a></h2>
+ <p>Usually the size of libraries on disk isn't noticeable. When a
+ link editor (or simply &quot;linker&quot;) pulls things from a
+ static archive library, only the necessary object files are copied
+ into your executable, not the entire library. Unfortunately, even
+ if you only need a single function or variable from an object file,
+ the entire object file is extracted. (There's nothing unique to C++
+ or libstdc++-v3 about this; it's just common behavior, given here
+ for background reasons.)
+ </p>
+ <p>Some of the object files which make up libstdc++.a are rather large.
+ If you create a statically-linked executable with
+ <code> -static</code>, those large object files are suddenly part
+ of your executable. Historically the best way around this was to
+ only place a very few functions (often only a single one) in each
+ source/object file; then extracting a single function is the same
+ as extracting a single .o file. For libstdc++-v3 this is only
+ possible to a certain extent; the object files in question contain
+ template classes and template functions, pre-instantiated, and
+ splitting those up causes severe maintenance headaches.
+ </p>
+ <p>It's not a bug, and it's not really a problem. Nevertheless, some
+ people don't like it, so here are two pseudo-solutions:
+ </p>
+ <p>If the only functions from libstdc++.a which you need are language
+ support functions (those listed in
+ <a href="../18_support/howto.html">clause 18</a> of the standard,
+ e.g., <code>new</code> and <code>delete</code>), then try linking
+ against <code>libsupc++.a</code> (usually specifying
+ <code>-lsupc++</code> when calling g++ for the final link step will
+ do it). This library contains only those support routines, one per
+ object file. But if you are using anything from the rest of the
+ library, such as IOStreams or vectors, then you'll still need
+ pieces from <code>libstdc++.a</code>.
+ </p>
+ <p>The second method is one we hope to incorporate into the library
+ build process. Some platforms can place each function and variable
+ into its own section in a .o file. The GNU linker can then perform
+ garbage collection on unused sections; this reduces the situation
+ to only copying needed functions into the executable, as before,
+ but all happens automatically.
+ </p>
+ <p>Unfortunately the garbage collection in GNU ld is buggy; sections
+ (corresponding to functions and variables) which <em>are</em> used
+ are mistakenly removed, leading to horrible crashes when your
+ executable starts up. For the time being, this feature is not used
+ when building the library.
+ </p>
+
+<hr>
+<h1><a name="3_0">3.0 Platform-Specific Issues</a></h1>
+ <h2><a name="3_1">3.1 Can libstdc++-v3 be used with &lt;my
+ favorite compiler&gt;?</a></h2>
+ <p>Probably not. Yet.</p>
+ <p>Because GCC advances so rapidly, development and testing of
libstdc++ is being done almost entirely under that compiler.
If you are curious about whether other, lesser compilers
(*grin*) support libstdc++, you are more than welcome to try.
Configuring and building the library (see above) will still
require certain tools, however. Also keep in mind that
- <EM>building</EM> libstdc++ does not imply that your compiler
- will be able to <EM>use</EM> all of the features found in the
+ <em>building</em> libstdc++ does not imply that your compiler
+ will be able to <em>use</em> all of the features found in the
C++ Standard Library.
- </P>
- <P>Since the goal of ISO Standardization is for all C++
+ </p>
+ <p>Since the goal of ISO Standardization is for all C++
implementations to be able to share code, the final libstdc++
- should, in theory, be useable under any ISO-compliant
+ should, in theory, be usable under any ISO-compliant
compiler. It will still be targeted and optimized for
GCC/g++, however.
- </P>
-
-<HR>
- <H2><A NAME="3_2">3.2 Building under Cygwin hangs/explodes!?</A></H2>
- <P>Sometimes, yes. You're probably in the middle of generating
- the <TT>numeric_limits</TT> specializations when it hangs,
- right? Thought so...
- </P>
- <P>The <TT>&lt;limits&gt;</TT> header and its associated library
- code are platform-specific. These files get generated from
- scratch during installation, and it is this generator that is
- hanging. More specifically, the only sure way to determine
- what the <TT>numeric_limits&lt;T&gt;::traps</TT> boolean
- should be is to actually divide by zero and see if it is
- trapped or not.
- </P>
- <P>Under NT, this will occasionally just hang. On those
- occasions when the test does not hang, the zero-division is
- in fact trapped. That doesn't prevent hanging elsewhere.
- </P>
- <P>You have two options. You can get a newer cygwin1.dll (see the
- Cygwin paragraph in the
- <A HREF="../install.html">installation instructions</A>).
- Or you can get a prebuilt set of bits/std_limits.h and
- src/limitsMEMBERS.cc files from Mumit Khan's
- <A HREF="http://www.xraylith.wisc.edu/~khan/software/gnu-win32/libstdc++-v3.html">Cygwin-related website</A>.
- </P>
-
-<HR>
- <H2><A NAME="3_3">3.3 Building DEC OSF kills the assembler</A></H2>
- <P>The <TT>atomicity.h</TT> header for the Alpha processor
+ </p>
+
+<hr>
+ <h2><a name="3_2">3.2 [removed]</a></h2>
+ <p>This question has become moot and has been removed. The stub
+ is here to preserve numbering (and hence links/bookmarks).
+ </p>
+
+<hr>
+ <h2><a name="3_3">3.3 Building DEC OSF kills the assembler</a></h2>
+ <p>The <code>atomicity.h</code> header for the Alpha processor
currently uses pseudo-operators which the DEC assembler
- doesn't understand (in particular, .subsection and .previous).
- The simple solution is to install GNU <TT>as</TT> and arrange
- for the GCC build to use it (or merge the sources and build
- it during the bootstrap).
- </P>
- <P>Anyone who
- <A HREF="http://gcc.gnu.org/ml/libstdc++/2000-12/msg00279.html">knows
- the DEC assembler well enough</A> to provide the equivalent of
- these two pseudos would win praise and accolades from many.
- </P>
-
-
-<HR>
-<H1><A NAME="4_0">4.0 Known Bugs and Non-Bugs</A></H1>
- <EM>Note that this section can get rapdily outdated -- such is the
+ doesn't understand (in particular, .subsection and .previous).
+ The simple solution is to install GNU <code>as</code> and arrange
+ for the GCC build to use it (or merge the sources and build
+ it during the bootstrap).
+ </p>
+ <p>Anyone who
+ <a href="http://gcc.gnu.org/ml/libstdc++/2000-12/msg00279.html">knows
+ the DEC assembler well enough</a> to provide the equivalent of
+ these two pseudos would win praise and accolades from many.
+ </p>
+
+<hr>
+ <h2><a name="3_4">3.4 I can't use 'long long' on Solaris</a></h2>
+ <p>By default we try to support the C99 <code>long long</code> type.
+ This requires that certain functions from your C library be present.
+ </p>
+ <p>Up through release 3.0.2 the tests performed were too general, and
+ this feature was disabled when it did not need to be. The most
+ commonly reported platform affected was Solaris.
+ </p>
+ <p>This has been fixed for 3.0.3 and onwards.
+ </p>
+
+<hr>
+<h1><a name="4_0">4.0 Known Bugs and Non-Bugs</a></h1>
+ <em>Note that this section can get rapdily outdated -- such is the
nature of an open-source project. For the latest information, join
the mailing list or look through recent archives. The RELEASE-
- NOTES and BUGS files are generally kept up-to-date.</EM>
-
- <H2><A NAME="4_1">4.1 What works already?</A></H2>
- <P>This is a verbatim clip from the &quot;Status&quot; section
- of the RELEASE-NOTES for the latest snapshot.
- </P>
+ NOTES and BUGS files are generally kept up-to-date.</em>
+
+ <p>For 3.0.1, the most common &quot;bug&quot; is an apparently missing
+ &quot;<code>../</code>&quot; in include/Makefile, resulting in files
+ like gthr.h and gthr-single.h not being found.
+ </p>
+ <p>Please read
+ <a href="http://gcc.gnu.org/install/configure.html">the configuration
+ instructions for GCC</a>,
+ specifically the part about configuring in a separate build directory,
+ and how strongly recommended it is. Building in the source directory
+ is fragile, is rarely tested, and tends to break, as in this case.
+ This was fixed for 3.0.2.
+ </p>
+ <p><strong>Please do not report these as bugs. We know about them.</strong>
+ Reporting this -- or any other problem that's already been fixed --
+ hinders the development of GCC, because we have to take time to
+ respond to your report. Thank you.
+ </p>
+
+ <h2><a name="4_1">4.1 What works already?</a></h2>
+ <p>This is a verbatim clip from the &quot;Status&quot; section
+ of the RELEASE-NOTES for the latest snapshot.
+ </p>
<!-- Yeah, I meant that "verbatim clip" thing literally... :-) -->
<pre>
-New:
-- namespace std:: is now on by default.
-- choice of "C" include strategies, including the shadow header work,
- or generic global to std mapping of required "C" types.
-- cpu/atomicity.h tweaks, additions of ia64 and arm support.
-- abstraction of atomicity.h header to support notion of os/atomicity.h files.
-- addition of backward header bits
-- use of system_header pragma
-- Conditional use of -Werror
-- preliminary support for new g++ diagnostics capabilities, including
- -fdiagnostics-show-location=once
-- pedantic and shadow argument warning fixes
-- Ugly, yet correct mechanism for dealing with "C" math adopted,
- including the use of builtins.
-- updates and configure/build work to support new libtool
-- addition of strstream
-- valarray work
-- complex work
-- update to SGI STL 3.3
-- libio sync between glibc/libstdc++-v3. Some divergence since initial
- merge, but sources remain quite close.
-- IO fixes for alpha
-- wide character work for IO when using libio
-- addition of c_io_stdio and "C" IO abstraction layer.
-- auto_ptr fixes, testsuite additions
-- Attempts to use -ffunction-sections -fdata-sections and
- --gc-sections, depending on use of GNU ld and specific features. As of
- late, --gc-sections has been disabled due to problems with it throwing
- away initialization sections. This work is ongoing.
-- long double support
-- sub directory removal, coherent organization of cpu and os-specific
- files, consolidation of include directories, integration of the C++
- support bits for operator new/delete,exceptions, etc. All includes
- are now either in the include/* hierarchy or in libsupc++'s sub directory.
-- Support for more platforms, including irix and bsd variants.
-- filebuf tweaks to deal with variable-size buffers.
-- filebuf implementation for putbackc, etc. al.
-- ctype rewritten. Includes ctype<char>, ctype<wchar_t>, and others.
-- codecvt rewritten. Includes codecvt<char, char, mbstate_t>,
- codecvt<wchar_t, char, mbstate_t>. In addition,
- implementation-defined conversions using iconv are now supported with
- the __enc_traits partial-specialization of the State template
- parameter of the codecvt class. In this manner, conversions between
- encodings such as UCS4, USC2, UNICODE, UNICODEBIG, UNICODELITTLE, etc
- can be performed.
-- preliminary work on named locales
-- preliminary documentation for locale implementation has been established.
-- Many, many bug fixes.
-- Many, many testsuite additions and consistent VERIFY usage.
-- work on mkcheck to make it more flexible, use libtool, etc.
+New:
+---
+- preliminary doxygen documentation has been added. Running &quot;make
+ doxygen&quot; in the libstdc++-v3 build directory will generate HTML
+ documentation that can be used to cross-reference names and files in
+ the library.
+- a dejagnu based testing framework has been added
+- a new implementation of the concept checking code has been ported
+ from the boost libraries.
+- support for -fno-exceptions has been added
+- stdexcept was re-written
+- using deprecated or antiquated headers now gives a warning
+- the stdio interface to iostreams has been tweaked, and now works
+ with synchronized c/c++ io
+- new libsupc++ routines implementing the IA-64 C++ ABI.
+- HPUX configuration files
+- support for AIX added
+- a lot of bugs were fixed.
+- preliminary named locales implemented
+- portability improvements made to generation of &lt;limits&gt;
+- speedups to improve configuration time.
+- DJGPP support added.
+- support for dlopening shared libstdc++
</pre>
-<HR>
- <H2><A NAME="4_2">4.2 Bugs in gcc/g++ (not libstdc++-v3)</A></H2>
- <P>This is by no means meant to be complete nor exhaustive, but
+<hr>
+ <h2><a name="4_2">4.2 Bugs in gcc/g++ (not libstdc++-v3)</a></h2>
+ <p>This is by no means meant to be complete nor exhaustive, but
mentions some problems that users may encounter when building
or using libstdc++. If you are experiencing one of these
problems, you can find more information on the libstdc++ and
the GCC mailing lists.
- </P>
- <UL>
- <LI>As of 2.91, these bugs have all been fixed. We look forward
+ </p>
+ <ul>
+ <li>As of 2.91, these bugs have all been fixed. We look forward
to new ones, well, not exactly...
- </UL>
+ </ul>
-<HR>
- <H2><A NAME="4_3">4.3 Bugs in the C++ language/lib specification</A></H2>
- <P>Yes, unfortunately, there are some. In a <A
-HREF="http://gcc.gnu.org/ml/libstdc++/1998/msg00006.html">message
-to the list</A>, Nathan Myers announced that he has started a list of
+<hr>
+ <h2><a name="4_3">4.3 Bugs in the C++ language/lib specification</a></h2>
+ <p>Yes, unfortunately, there are some. In a
+ <a href="http://gcc.gnu.org/ml/libstdc++/1998/msg00006.html">message
+ to the list</a>, Nathan Myers announced that he has started a list of
problems in the ISO C++ Standard itself, especially with
regard to the chapters that concern the library. The list
- itself is <A
- HREF="http://www.cantrip.org/draft-bugs.txt">posted on his
- website</A>. Developers who are having problems interpreting
+ itself is
+ <a href="http://www.cantrip.org/draft-bugs.txt">posted on his
+ website</a>. Developers who are having problems interpreting
the Standard may wish to consult his notes.
- </P>
- <P>For those people who are not part of the ISO Library Group
+ </p>
+ <p>For those people who are not part of the ISO Library Group
(i.e., nearly all of us needing to read this page in the first
place :-), a public list of the library defects is occasionally
- published <A HREF="http://anubis.dkuug.dk/jtc1/sc22/wg21/">here</A>.
- </P>
+ published <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/">here</a>.
+ Some of these have resulted in <a href="#5_2">code changes</a>.
+ </p>
-<HR>
- <H2><A NAME="4_4">4.4 Things in libstdc++ that look like bugs</A></H2>
- <P>There are things which are not bugs in the compiler (4.2) nor
+<hr>
+ <h2><a name="4_4">4.4 Things in libstdc++ that look like bugs</a></h2>
+ <p>There are things which are not bugs in the compiler (4.2) nor
the language specification (4.3), but aren't really bugs in
- libstdc++, either. Really!
- </P>
- <P>The biggest of these is the quadzillions of warnings about the
- library headers emitted when <TT>-Weffc++</TT> is used. Making
- libstdc++ &quot;-Weffc++-clean&quot; is not a goal of the project,
- for a few reasons. Mainly, that option tries to enforce
- object-oriented programming, while the Standard Library isn't
- necessarily trying to be OO. There are multiple solutions
- under discussion.
- </P>
- <P>Another is the <TT>rel_ops</TT> namespace and the template
- comparison operator functions contained therein. If they become
- visible in the same namespace as other comparison functions
- (e.g., '<TT>using</TT>' them and the &lt;iterator&gt; header),
- then you will suddenly be faced with huge numbers of ambiguity
- errors. This was discussed on the -v3 list; Nathan Myers
- <A HREF="http://gcc.gnu.org/ml/libstdc++/2001-01/msg00247.html">sums
- things up here</A>.
- </P>
- <H3><A NAME="4_4_interface">The g++-3 headers are
- <EM>not ours</EM></A></H3>
- <P>If you have found an extremely broken header file which is
- causing problems for you, look carefully before submitting a
- &quot;high&quot; priority bug report (which you probably shouldn't
- do anyhow; see the last paragraph of the page describing
- <A HREF="http://gcc.gnu.org/gnatswrite.html">the GCC bug database</A>).
- </P>
- <P>If the headers are in <CODE>${prefix}/include/g++-3</CODE>, then
- you are using the old libstdc++-v2 library, which is nonstandard
- and unmaintained. Do not report problems with -v2 to the -v3
- mailing list.
- </P>
- <P>Currently our header files are installed in
- <CODE>${prefix}/include/g++-v3</CODE> (see the 'v'?). This may
- change with the next release of GCC, as it may be too confusing,
- but <A HREF="http://gcc.gnu.org/ml/gcc/2000-10/msg00732.html">the
- question has not yet been decided</A>.
- </P>
-
-<HR>
- <H2><A NAME="4_5">4.5 Aw, that's easy to fix!</A></H2>
- <P>If you have found a bug in the library and you think you have
+ libstdc++, either. Really! Please do not report these as bugs.
+ </p>
+ <a name="4_4_Weff">
+ <p><strong>-Weffc++</strong>
+ The biggest of these is the quadzillions of warnings about the
+ library headers emitted when <code>-Weffc++</code> is used. Making
+ libstdc++ &quot;-Weffc++-clean&quot; is not a goal of the project,
+ for a few reasons. Mainly, that option tries to enforce
+ object-oriented programming, while the Standard Library isn't
+ necessarily trying to be OO. There are multiple solutions
+ under discussion.
+ </p>
+ </a>
+ <a name="4_4_iostreamclear">
+ <p><strong>reopening a stream fails</strong>
+ Did I just say that -Weffc++ was our biggest false-bug report? I
+ lied. (It used to be.) Today it seems to be reports that after
+ executing a sequence like
+ <pre>
+ #include &lt;fstream&gt;
+ ...
+ std::fstream fs(&quot;a_file&quot;);
+ // .
+ // . do things with fs...
+ // .
+ fs.close();
+ fs.open(&quot;a_new_file&quot;);</pre>
+ all operations on the re-opened <code>fs</code> will fail, or at
+ least act very strangely. Yes, they often will, especially if
+ <code>fs</code> reached the EOF state on the previous file. The
+ reason is that the state flags are <strong>not</strong> cleared
+ on a successful call to open(). The standard unfortunately did
+ not specify behavior in this case, and to everybody's great sorrow,
+ the <a href="../ext/howto.html#5">proposed LWG resolution</a> (see
+ DR #22) is to leave the flags unchanged. You must insert a call
+ to <code>fs.clear()</code> between the calls to close() and open(),
+ and then everything will work like we all expect it to work.
+ </p>
+ </a>
+ <a name="4_4_rel_ops">
+ <p><strong>rel_ops</strong>
+ Another is the <code>rel_ops</code> namespace and the template
+ comparison operator functions contained therein. If they become
+ visible in the same namespace as other comparison functions
+ (e.g., '<code>using</code>' them and the &lt;iterator&gt; header),
+ then you will suddenly be faced with huge numbers of ambiguity
+ errors. This was discussed on the -v3 list; Nathan Myers
+ <a href="http://gcc.gnu.org/ml/libstdc++/2001-01/msg00247.html">sums
+ things up here</a>.
+ </p>
+ </a>
+ <a name="4_4_interface"><h3>The g++-3 headers are
+ <em>not ours</em></h3>
+ <p>If you have found an extremely broken header file which is
+ causing problems for you, look carefully before submitting a
+ &quot;high&quot; priority bug report (which you probably shouldn't
+ do anyhow; see the last paragraph of the page describing
+ <a href="http://gcc.gnu.org/gnatswrite.html">the GCC bug database</a>).
+ </p>
+ <p>If the headers are in <code>${prefix}/include/g++-3</code>, or if
+ the installed library's name looks like <code>libstdc++-2.10.a</code>
+ or <code>libstdc++-libc6-2.10.so</code>,
+ then you are using the old libstdc++-v2 library, which is nonstandard
+ and unmaintained. Do not report problems with -v2 to the -v3
+ mailing list.
+ </p>
+ <p>Currently our header files are installed in
+ <code>${prefix}/include/g++-v3</code> (see the 'v'?). This may
+ change with the next release of GCC, as it may be too confusing,
+ but <a href="http://gcc.gnu.org/ml/gcc/2000-10/msg00732.html">the
+ question has not yet been decided</a>.
+ </p>
+ </a>
+ <a name="4_4_glibc">
+ <p><strong>glibc</strong>
+ If you're on a GNU/Linux system and have just upgraded to
+ glibc 2.2, but are still using gcc 2.95.2, then you should have
+ read the glibc FAQ, specifically 2.34:
+ <pre>
+2.34. When compiling C++ programs, I get a compilation error in streambuf.h.
+
+{BH} You are using g++ 2.95.2? After upgrading to glibc 2.2, you need to
+apply a patch to the include files in /usr/include/g++, because the fpos_t
+type has changed in glibc 2.2. The patch is at
+http://clisp.cons.org/~haible/gccinclude-glibc-2.2-compat.diff
+ </pre>
+ Note that 2.95.x shipped with the
+ <a href="#4_4_interface">old v2 library</a> which is no longer
+ maintained. Also note that gcc 2.95.3 fixes this problem, but
+ requires a separate patch for libstdc++-v3.
+ </p>
+ </a>
+ <a name="4_4_checks">
+ <p><strong>concept checks</strong>
+ If you see compilation errors containing messages about
+ <code> <em>foo</em>Concept </code>and a<code> constraints </code>
+ member function, then most likely you have violated one of the
+ requirements for types used during instantiation of template
+ containers and functions. For example, EqualityComparableConcept
+ appears if your types must be comparable with == and you have not
+ provided this capability (a typo, or wrong visibility, or you
+ just plain forgot, etc).
+ </p>
+ <p>More information, including how to optionally enable/disable the
+ checks, is available
+ <a href="../19_diagnostics/howto.html#3">here</a>.
+ </p>
+ </a>
+
+<hr>
+ <h2><a name="4_5">4.5 Aw, that's easy to fix!</a></h2>
+ <p>If you have found a bug in the library and you think you have
a working fix, then send it in! The main GCC site has a page
- on <A HREF="http://gcc.gnu.org/contribute.html">submitting
- patches</A> that covers the procedure, but for libstdc++ you
- should of course send the patch to our mailing list, not the
- GCC mailing list. The libstdc++
- <A HREF="../17_intro/contribute.html">contributors' page</A>
+ on <a href="http://gcc.gnu.org/contribute.html">submitting
+ patches</a> that covers the procedure, but for libstdc++ you
+ should also send the patch to our mailing list in addition to
+ the GCC patches mailing list. The libstdc++
+ <a href="../17_intro/contribute.html">contributors' page</a>
also talks about how to submit patches.
- </P>
- <P>In addition to the description, the patch, and the ChangeLog
+ </p>
+ <p>In addition to the description, the patch, and the ChangeLog
entry, it is a Good Thing if you can additionally create a small
test program to test for the presence of the bug that your
patch fixes. Bugs have a way of being reintroduced; if an old
bug creeps back in, it will be caught immediately by the
- <A HREF="#2_4">testsuite</A> -- but only if such a test exists.
- </P>
-
-<HR>
-<H1><A NAME="5_0">5.0 Miscellaneous</A></H1>
- <H2><A NAME="5_1">5.1 string::iterator is not char*;
- vector&lt;T&gt;::iterator is not T*</A></H2>
- <P>If you have code that depends on container&lt;T&gt; iterators
+ <a href="#2_4">testsuite</a> -- but only if such a test exists.
+ </p>
+
+<hr>
+<h1><a name="5_0">5.0 Miscellaneous</a></h1>
+ <h2><a name="5_1">5.1 string::iterator is not char*;
+ vector&lt;T&gt;::iterator is not T*</a></h2>
+ <p>If you have code that depends on container&lt;T&gt; iterators
being implemented as pointer-to-T, your code is broken.
- </P>
- <P>While there are arguments for iterators to be implemented in
+ </p>
+ <p>While there are arguments for iterators to be implemented in
that manner, A) they aren't very good ones in the long term,
and B) they were never guaranteed by the Standard anyway. The
type-safety achieved by making iterators a real class rather
- than a typedef for <TT>T*</TT> outweighs nearly all opposing
+ than a typedef for <code>T*</code> outweighs nearly all opposing
arguments.
- </P>
-
-<HR>
- <H2><A NAME="5_2">5.2 What's next after libstdc++-v3?</A></H2>
- <P>Hopefully, not much. The goal of libstdc++-v3 is to produce
+ </p>
+ <p>Code which does assume that a vector iterator <code> i </code>
+ is a pointer can often be fixed by changing <code> i </code> in
+ certain expressions to <code> &amp;*i </code>. Future revisions
+ of the Standard are expected to bless this usage for
+ vector&lt;&gt; (but not for basic_string&lt;&gt;).
+ </p>
+
+<hr>
+ <h2><a name="5_2">5.2 What's next after libstdc++-v3?</a></h2>
+ <p>Hopefully, not much. The goal of libstdc++-v3 is to produce
a fully-compliant, fully-portable Standard Library. After that,
- we're mostly done: there won't <EM>be</EM> any more compliance
- work to do.
- </P>
- <P>The ISO Committee will meet periodically to review Defect Reports
- in the C++ Standard. Undoubtably some of these will result in
+ we're mostly done: there won't <em>be</em> any more compliance
+ work to do. However:
+ </p>
+ <ol>
+ <li><p>The ISO Committee will meet periodically to review Defect Reports
+ in the C++ Standard. Undoubtedly some of these will result in
changes to the Standard, which will be reflected in patches to
libstdc++. Some of that is already happening, see 4.2. Some of
those changes are being predicted by the library maintainers, and
we add code to the library based on what the current proposed
- resolution specifies.
- </P>
- <P>The current libstdc++ contains extensions to the Library which
+ resolution specifies. Those additions are listed in
+ <a href="../ext/howto.html#5">the extensions page</a>.
+ </p>
+ <li><p>Performance tuning. Lots of performance tuning. This too is
+ already underway for post-3.0 releases, starting with memory
+ expansion in container classes and buffer usage in synchronized
+ stream objects.
+ </p>
+ <li><p>An ABI for libstdc++ will eventually be developed, so that
+ multiple binary-incompatible copies of the library can be replaced
+ with a single backwards-compatible library, like libgcc_s.so is.
+ </p>
+ <li><p>The current libstdc++ contains extensions to the Library which
must be explicitly requested by client code (for example, the
hash tables from SGI). Other extensions may be added to
libstdc++-v3 if they seem to be &quot;standard&quot; enough.
(For example, the &quot;long long&quot; type from C99.)
Bugfixes and rewrites (to improve or fix thread safety, for
instance) will of course be a continuing task.
- </P>
- <P><A
-HREF="http://gcc.gnu.org/ml/libstdc++/1999/msg00080.html">This
- question</A> about the next libstdc++ prompted some brief but
- interesting <A
-HREF="http://gcc.gnu.org/ml/libstdc++/1999/msg00084.html">speculation</A>.
- </P>
-
-<HR>
- <H2><A NAME="5_3">5.3 What about the STL from SGI?</A></H2>
- <P>The <A HREF="http://www.sgi.com/Technology/STL/">STL from SGI</A>
- is merged into libstdc++-v3 with changes as necessary.
- Currently release 3.3 is being used. Changes in the STL
- usually produce some weird bugs and lots of changes in the
- rest of the libstdc++ source as we scramble to keep up. :-)
- </P>
- <P>In particular, <TT>string</TT> is not from SGI and makes no
+ </p>
+ </ol>
+ <p><a href="http://gcc.gnu.org/ml/libstdc++/1999/msg00080.html">This
+ question</a> about the next libstdc++ prompted some brief but
+ interesting
+ <a href="http://gcc.gnu.org/ml/libstdc++/1999/msg00084.html">speculation</a>.
+ </p>
+
+<hr>
+ <h2><a name="5_3">5.3 What about the STL from SGI?</a></h2>
+ <p>The <a href="http://www.sgi.com/Technology/STL/">STL from SGI</a>,
+ version 3.3, was the most recent merge of the STL codebase. The
+ code in libstdc++ contains many fixes and changes, and it is
+ very likely that the SGI code is no longer under active
+ development. We expect that no future merges will take place.
+ </p>
+ <p>In particular, <code>string</code> is not from SGI and makes no
use of their &quot;rope&quot; class (which is included as an
- optional extension), nor is <TT>valarray</TT> and some others.
- Classes like <TT>vector&lt;&gt;</TT> are, however.
- </P>
- <P>The FAQ for SGI's STL (one jump off of their main page) is
+ optional extension), nor is <code>valarray</code> and some others.
+ Classes like <code>vector&lt;&gt;</code> are, however.
+ </p>
+ <p>The FAQ for SGI's STL (one jump off of their main page) is
recommended reading.
- </P>
+ </p>
-<HR>
- <H2><A NAME="5_4">5.4 Extensions and Backward Compatibility</A></H2>
- <P>Although you can specify <TT>-I</TT> options to make the
+<hr>
+ <h2><a name="5_4">5.4 Extensions and Backward Compatibility</a></h2>
+ <p>Although you can specify <code>-I</code> options to make the
preprocessor search the g++-v3/ext and /backward directories,
it is better to refer to files there by their path, as in:
<!-- Careful, the leading spaces in PRE show up directly. -->
- </P>
- <PRE>
+ </p>
+ <pre>
#include &lt;ext/hash_map&gt;
- </PRE>
- <P>Extensions to the library have
- <A HREF="../ext/howto.html">their own page</A>.
- </P>
-
-<HR>
- <H2><A NAME="5_5">5.5 Compiling with &quot;-fnew-abi&quot;</A></H2>
- <P>Towards the end of July 1999, this subject was brought up again
- on the mailing list under a different name. The related
- <A HREF="http://gcc.gnu.org/ml/libstdc++/1999-q3/msg00066.html">thread</A>
- (by the name HOWTO-honor-std) is very instructive. More info
- is at the end of RELEASE-NOTES.
- </P>
- <P>This functionality is now automated and turned on by default.
- </P>
-
-<HR>
- <H2><A NAME="5_6">5.6 Is libstdc++-v3 thread-safe?</A></H2>
- <P>Quick answer: no, as of 2.91 (tenth snapshot), the
- library is not appropriate for multithreaded access. The
- string class is MT-safe.
- </P>
- <P>This is assuming that your idea of &quot;multithreaded&quot;
- is the same as ours... The general question of multithreading
- and libstdc++-v3 is addressed in the chapter-specific advice for
-<A HREF="http://gcc.gnu.org/libstdc++/17_intro/howto.html#3">Library
- Introduction</A>. Threadsafe containers are covered in
- more detail in
-<A HREF="http://gcc.gnu.org/libstdc++/23_containers/howto.html">the
- Received Wisdom section on containers</A>.
- <!-- I have successfully evaded the topic; my work here is
- done- no, wait, I have to write those other sections... -->
- </P>
-
-<HR>
- <H2><A NAME="5_7">5.7 How do I get a copy of the ISO C++ Standard?</A></H2>
- <P>Copies of the full ISO 14882 standard are available on line
- via the ISO mirror site for committee members. Non-members,
- or those who have not paid for the privilege of sitting on
- the committee and sustained their two-meeting commitment for
- voting rights, may get a copy of the standard from their
- respective national standards organization. In the USA,
- this national standards organization is ANSI and their
- website is right <A HREF="http://www.ansi.org">here</A>.
- (And if you've already registered with them, clicking this
- link will take you to directly to the place where you can
-<A HREF="http://webstore.ansi.org/ansidocstore/product.asp?sku=ISO%2FIEC+14882%2D1998">buy
- the standard on-line</A>.
- </P>
- <P>Who is your country's member body? Visit the
- <A HREF="http://www.iso.ch/">ISO homepage</A> and find out!
- </P>
+ </pre>
+ <p>Extensions to the library have
+ <a href="../ext/howto.html">their own page</a>.
+ </p>
+
+<hr>
+ <h2><a name="5_5">5.5 [removed]</a></h2>
+ <p>This question has become moot and has been removed. The stub
+ is here to preserve numbering (and hence links/bookmarks).
+ </p>
+
+<hr>
+ <h2><a name="5_6">5.6 Is libstdc++-v3 thread-safe?</a></h2>
+ <p>When the system's libc is itself thread-safe, a non-generic
+ implementation of atomicity.h exists for the architecture, and gcc
+ itself reports a thread model other than single; libstdc++-v3
+ strives to be thread-safe. The user-code must guard against
+ concurrent method calls which may access any particular library
+ object's state. Typically, the application programmer may infer
+ what object locks must be held based on the objects referenced in
+ a method call. Without getting into great detail, here is an
+ example which requires user-level locks:
+ <pre>
+ library_class_a shared_object_a;
+
+ thread_main () {
+ library_class_b *object_b = new library_class_b;
+ shared_object_a.add_b (object_b); // must hold lock for shared_object_a
+ shared_object_a.mutate (); // must hold lock for shared_object_a
+ }
+
+ // Multiple copies of thread_main() are started in independent threads.</pre>
+ </p>
+ <p>Under the assumption that object_a and object_b are never exposed to
+ another thread, here is an example that should not require any
+ user-level locks:
+ <pre>
+ thread_main () {
+ library_class_a object_a;
+ library_class_b *object_b = new library_class_b;
+ object_a.add_b (object_b);
+ object_a.mutate ();
+ } </pre>
+ </p>
+ <p>All library objects are safe to use in a multithreaded program as
+ long as each thread carefully locks out access by any other thread
+ while it uses any object visible to another thread. In general,
+ this requirement includes both read and write access to objects;
+ unless otherwise documented as safe, do not assume that two
+ threads may access a shared standard library object at the
+ same time.
+ </p>
+ <p>See chapters <a href="../17_intro/howto.html#3">17</a> (library
+ introduction), <a href="../23_containers/howto.html#3">23</a>
+ (containers), and <a href="../27_io/howto.html#9">27</a> (I/O) for
+ more information.
+ </p>
+
+<hr>
+ <h2><a name="5_7">5.7 How do I get a copy of the ISO C++ Standard?</a></h2>
+ <p>Copies of the full ISO 14882 standard are available on line via the
+ ISO mirror site for committee members. Non-members, or those who
+ have not paid for the privilege of sitting on the committee and
+ sustained their two-meeting commitment for voting rights, may get a
+ copy of the standard from their respective national standards
+ organization. In the USA, this national standards organization is
+ ANSI and their website is right <a href="http://www.ansi.org">here</a>.
+ (And if you've already registered with them, clicking this link will
+ take you to directly to the place where you can
+<a href="http://webstore.ansi.org/ansidocstore/product.asp?sku=ISO%2FIEC+14882%2D1998">buy
+ the standard on-line</a>.
+ </p>
+ <p>Who is your country's member body? Visit the
+ <a href="http://www.iso.ch/">ISO homepage</a> and find out!
+ </p>
+
+<hr>
+ <h2><a name="5_8">5.8 What's an ABI and why is it so messy?</a></h2>
+ <p>&quot;ABI&quot; stands for &quot;Application Binary Interface.&quot;
+ Conventionally, it refers to a great mass of details about how
+ arguments are arranged on the call stack and/or in registers, and
+ how various types are arranged and padded in structs. A single CPU
+ design may suffer multiple ABIs designed by different development
+ tool vendors who made different choices, or even by the same vendor
+ for different target applications or compiler versions. In ideal
+ circumstances the CPU designer presents one ABI and all the OSes and
+ compilers use it. In practice every ABI omits details that compiler
+ implementers (consciously or accidentally) must choose for themselves.
+ </p>
+ <p>That ABI definition suffices for compilers to generate code so a
+ program can interact safely with an OS and its lowest-level libraries.
+ Users usually want an ABI to encompass more detail, allowing libraries
+ built with different compilers (or different releases of the same
+ compiler!) to be linked together. For C++, this includes many more
+ details than for C, and CPU designers (for good reasons elaborated
+ below) have not stepped up to publish C++ ABIs. The details include
+ virtual function implementation, struct inheritance layout, name
+ mangling, and exception handling. Such an ABI has been defined for
+ GNU C++, and is immediately useful for embedded work relying only on
+ a &quot;free-standing implementation&quot; that doesn't include (much
+ of) the standard library. It is a good basis for the work to come.
+ </p>
+ <p>A useful C++ ABI must also incorporate many details of the standard
+ library implementation. For a C ABI, the layouts of a few structs
+ (such as FILE, stat, jmpbuf, and the like) and a few macros suffice.
+ For C++, the details include the complete set of names of functions
+ and types used, the offsets of class members and virtual functions,
+ and the actual definitions of all inlines. C++ exposes many more
+ library details to the caller than C does. It makes defining
+ a complete ABI a much bigger undertaking, and requires not just
+ documenting library implementation details, but carefully designing
+ those details so that future bug fixes and optimizations don't
+ force breaking the ABI.
+ </p>
+ <p>There are ways to help isolate library implementation details from the
+ ABI, but they trade off against speed. Library details used in
+ inner loops (e.g., getchar) must be exposed and frozen for all
+ time, but many others may reasonably be kept hidden from user code,
+ so they may later be changed. Deciding which, and implementing
+ the decisions, must happen before you can reasonably document a
+ candidate C++ ABI that encompasses the standard library.
+ </p>
<!-- ####################################################### -->
-<HR>
-<P CLASS="fineprint"><EM>
+<hr>
+<p class="fineprint"><em>
+See <a href="../17_intro/license.html">license.html</a> for copying conditions.
Comments and suggestions are welcome, and may be sent to
-<A HREF="mailto:pme@sources.redhat.com">Phil Edwards</A> or
-<A HREF="mailto:gdr@gcc.gnu.org">Gabriel Dos Reis</A>.
-<BR> $Id: index.html,v 1.1 2000/12/10 04:04:56 pme Exp $
-</EM></P>
+<a href="mailto:libstdc++@gcc.gnu.org">the libstdc++ mailing list</a>.
+</em></p>
+
+</body>
+</html>
-</BODY>
-</HTML>
diff --git a/libstdc++-v3/docs/html/faq/index.txt b/libstdc++-v3/docs/html/faq/index.txt
index e1a8e388244..356d31cc678 100644
--- a/libstdc++-v3/docs/html/faq/index.txt
+++ b/libstdc++-v3/docs/html/faq/index.txt
@@ -18,49 +18,62 @@
6. [9]How do I contribute to the effort?
7. [10]What happened to libg++? I need that!
8. [11]What if I have more questions?
- 2. [12]Installation
- 1. [13]How do I install libstdc++-v3?
- 2. [14]Is this a drop-in replacement for the libstdc++ that's
- shipped with g++?
- 3. [15]What is this CVS thing that you keep mentioning?
- 4. [16]How do I know if it works?
- 3. [17]Platform-Specific Issues
- 1. [18]Can libstdc++-v3 be used with <my favorite compiler>?
- 2. [19]Building under Cygwin hangs/explodes!?
- 3. [20]Building under DEC OSF kills the assembler
- 4. [21]Known Bugs and Non-Bugs
- 1. [22]What works already?
- 2. [23]Bugs in gcc/g++ (not libstdc++-v3)
- 3. [24]Bugs in the C++ language/lib specification
- 4. [25]Things in libstdc++ that look like bugs
- [26]The g++-3 headers are not ours
- 5. [27]Aw, that's easy to fix!
- 5. [28]Miscellaneous
- 1. [29]string::iterator is not char*; vector<T>::iterator is not
+ 9. [12]What are the license terms for libstdc++-v3?
+ 2. [13]Installation
+ 1. [14]How do I install libstdc++-v3?
+ 2. [15][removed]
+ 3. [16]What is this CVS thing that you keep mentioning?
+ 4. [17]How do I know if it works?
+ 5. [18]This library is HUGE! And what's libsupc++?
+ 3. [19]Platform-Specific Issues
+ 1. [20]Can libstdc++-v3 be used with <my favorite compiler>?
+ 2. [21][removed]
+ 3. [22]Building under DEC OSF kills the assembler
+ 4. [23]I can't use 'long long' on Solaris
+ 4. [24]Known Bugs and Non-Bugs
+ 1. [25]What works already?
+ 2. [26]Bugs in gcc/g++ (not libstdc++-v3)
+ 3. [27]Bugs in the C++ language/lib specification
+ 4. [28]Things in libstdc++ that look like bugs
+ o [29]reopening a stream fails
+ o [30]-Weffc++ complains too much
+ o [31]"ambiguous overloads" after including an old-style
+ header
+ o [32]The g++-3 headers are not ours
+ o [33]compilation errors from streambuf.h
+ o [34]errors about *Cconcept and constraints in the STL...
+ 5. [35]Aw, that's easy to fix!
+ 5. [36]Miscellaneous
+ 1. [37]string::iterator is not char*; vector<T>::iterator is not
T*
- 2. [30]What's next after libstdc++-v3?
- 3. [31]What about the STL from SGI?
- 4. [32]Extensions and Backward Compatibility
- 5. [33]Compiling with "-fnew-abi"
- 6. [34]Is libstdc++-v3 thread-safe?
- 7. [35]How do I get a copy of the ISO C++ Standard?
+ 2. [38]What's next after libstdc++-v3?
+ 3. [39]What about the STL from SGI?
+ 4. [40]Extensions and Backward Compatibility
+ 5. [41][removed]
+ 6. [42]Is libstdc++-v3 thread-safe?
+ 7. [43]How do I get a copy of the ISO C++ Standard?
+ 8. [44]What's an ABI and why is it so messy?
_________________________________________________________________
1.0 General Information
1.1 What is libstdc++-v3?
- The GNU Standard C++ Library v3, or libstdc++-2.90.x/2.9x, is an
- ongoing project to implement the ISO 14882 Standard C++ library as
- described in chapters 17 through 27 and annex D. As the library
- reaches stable plateaus, it is captured in a snapshot and released.
- The current release is [36]the tenth snapshot. For those who want to
- see exactly how far the project has come, or just want the latest
- bleeding-edge code, the up-to-date source is available over anonymous
- CVS, and can even be browsed over the Web (see below).
+ The GNU Standard C++ Library v3 is an ongoing project to implement the
+ ISO 14882 Standard C++ library as described in chapters 17 through 27
+ and annex D. As the library reaches stable plateaus, it is captured in
+ a snapshot and released. The current release is [45]the eleventh
+ snapshot. For those who want to see exactly how far the project has
+ come, or just want the latest bleeding-edge code, the up-to-date
+ source is available over anonymous CVS, and can even be browsed over
+ the Web (see below).
+
+ The older libstdc++-v2 project is no longer maintained; the code has
+ been completely replaced and rewritten. [46]If you are using V2, then
+ you need to report bugs to your system vendor, not to the V3 list.
A more formal description of the V3 goals can be found in the official
- [37]design document.
+ [47]design document.
_________________________________________________________________
1.2 Why should I use libstdc++?
@@ -73,14 +86,14 @@
The GNU C/C++/FORTRAN/<pick-a-language> compiler (gcc, g++, etc) is
widely considered to be one of the leading compilers in the world. Its
- development has recently been taken over by the [38]GCC team. All of
- the rapid development and near-legendary [39]portability that are the
+ development has recently been taken over by the [48]GCC team. All of
+ the rapid development and near-legendary [49]portability that are the
hallmarks of an open-source project are being applied to libstdc++.
That means that all of the Standard classes and functions (such as
string, vector<>, iostreams, and algorithms) will be freely available
and fully compliant. Programmers will no longer need to "roll their
- own" nor be worried about platform-specific incompatabilities.
+ own" nor be worried about platform-specific incompatibilities.
_________________________________________________________________
1.3 Who's in charge of it?
@@ -92,21 +105,21 @@
Development and discussion is held on the libstdc++ mailing list.
Subscribing to the list, or searching the list archives, is open to
- everyone. You can read instructions for doing so on the [40]homepage.
+ everyone. You can read instructions for doing so on the [50]homepage.
If you have questions, ideas, code, or are just curious, sign up!
_________________________________________________________________
1.4 How do I get libstdc++?
- The tenth (and latest) snapshot of libstdc++-v3 is [41]available via
- ftp.
+ The eleventh (and latest) snapshot of libstdc++-v3 is [51]available
+ via ftp. The filename is libstdc++-2.92.tar.gz.
- The [42]homepage has instructions for retrieving the latest CVS
+ The [52]homepage has instructions for retrieving the latest CVS
sources, and for browsing the CVS sources over the web.
The subset commonly known as the Standard Template Library (chapters
- 23 through 25, mostly) is adapted from the SGI STL, which is also an
- ongoing work.
+ 23 through 25, mostly) is adapted from the final release of the SGI
+ STL.
_________________________________________________________________
1.5 When is libstdc++ going to be finished?
@@ -117,7 +130,7 @@
1.6 How do I contribute to the effort?
- Here is [43]a page devoted to this topic. Subscribing to the mailing
+ Here is [53]a page devoted to this topic. Subscribing to the mailing
list (see above, or the homepage) is a very good idea if you have
something to contribute, or if you have spare time and want to help.
Contributions don't have to be in the form of source code; anybody who
@@ -152,11 +165,11 @@
extracted into an updated utilities library, but nobody has stated
such a project yet.
- (The [44]Boost site houses free C++ libraries that do varying things,
+ (The [54]Boost site houses free C++ libraries that do varying things,
and happened to be started by members of the Standards Committee.
Certain "useful stuff" classes will probably migrate there.)
- For the bold and/or desperate, the [45]GCC FAQ describes where to find
+ For the bold and/or desperate, the [55]GCC FAQ describes where to find
the last libg++ source.
_________________________________________________________________
@@ -166,11 +179,16 @@
remains unanswered, then just ask the mailing list. At present, you do
not need to be subscribed to the list to send a message to it. More
information is available on the homepage (including how to browse the
- list archives); to send to the list, use [46]libstdc++@gcc.gnu.org.
+ list archives); to send to the list, use [56]libstdc++@gcc.gnu.org.
If you have a question that you think should be included here, or if
- you have a question about a question/answer here, contact [47]Phil
- Edwards or [48]Gabriel Dos Reis.
+ you have a question about a question/answer here, contact [57]Phil
+ Edwards or [58]Gabriel Dos Reis.
+ _________________________________________________________________
+
+1.9 What are the license terms for libstdc++-v3?
+
+ See [59]our license description for these and related questions.
_________________________________________________________________
2.0 Installation
@@ -179,39 +197,39 @@
Complete instructions are not given here (this is a FAQ, not an
installation document), but the tools required are few:
- * A release of libstdc++.
- * A recent release of GCC (version 2.95 works). Note that building
- GCC is much easier and more automated than building the GCC 2.[78]
- series was.
- * If you plan on hacking around with the makefiles, you will need
- the tools [49]autoconfand [50]automake.
- * GNU Make is the only make that supports these makefiles.
-
- The file [51]documentation.html provides a good overview of the steps
+ * A 3.x release of GCC. Note that building GCC is much easier and
+ more automated than building the GCC 2.[78] series was. If you are
+ using GCC 2.95, you can still build earlier snapshots of
+ libstdc++.
+ * GNU Make is recommended, but should not be required.
+ * The GNU Autotools are needed if you are messing with the configury
+ or makefiles.
+
+ The file [60]documentation.html provides a good overview of the steps
necessary to build, install, and use the library. Instructions for
configuring the library with new flags such as --enable-threads are
- there also.
+ there also, as well as patches and instructions for working with GCC
+ 2.95.
- The top-level install.html and [52]RELEASE-NOTES files contain the
+ The top-level install.html and [61]RELEASE-NOTES files contain the
exact build and installation instructions. You may wish to browse
those files over CVSweb ahead of time to get a feel for what's
required. RELEASE-NOTES is located in the ".../docs/17_intro/"
directory of the distribution.
_________________________________________________________________
-2.2 Is this a drop-in replacement for the libstdc++ that's shipped with g++?
+2.2 [removed]
- Yes, as of 2.90.8, it is intended as such. And as of 2.91,
- libstdc++-v3 is the library that's shipped with g++, so much of this
- answer has become moot.
+ This question has become moot and has been removed. The stub is here
+ to preserve numbering (and hence links/bookmarks).
_________________________________________________________________
2.3 What is this CVS thing that you keep mentioning?
The Concurrent Versions System is one of several revision control
packages. It was selected for GNU projects because it's free (speech),
- free (beer), and very high quality. The [53]CVS entry in the GNU
- software catalogue has a better description as well as a [54]link to
+ free (beer), and very high quality. The [62]CVS entry in the GNU
+ software catalogue has a better description as well as a [63]link to
the makers of CVS.
The "anonymous client checkout" feature of CVS is similar to anonymous
@@ -224,26 +242,66 @@
2.4 How do I know if it works?
libstdc++-v3 comes with its own testsuite. You do not need to actually
- install the library ("gmake install") to run the testsuite. Note that
- 2.91 does not use DejaGNU yet.
+ install the library ("make install") to run the testsuite.
- To run the testsuite on the library after building it, use "gmake
+ To run the testsuite on the library after building it, use "make
check" while in your build directory. To run the testsuite on the
- library after building and installing it, use "gmake check-install"
+ library after building and installing it, use "make check-install"
instead.
- The testsuite subdirectory in your build directory will then contain
- three files of the form YYYYMMDD-mkcheck*.txt. One of them
- (-mkcheck.txt itself) contains the results of the tests; this can be
- mailed to the list. The other files (-mkchecklog.txt and
- -mkcheckfiles.txt) contain messages from the compiler while building
- the test programs, and a list of the tests to be run, respectively.
-
If you find bugs in the testsuite programs themselves, or if you think
of a new test program that should be added to the suite, please write
up your idea and send it to the list!
_________________________________________________________________
+2.4 This library is HUGE! And what's libsupc++?
+
+ Usually the size of libraries on disk isn't noticeable. When a link
+ editor (or simply "linker") pulls things from a static archive
+ library, only the necessary object files are copied into your
+ executable, not the entire library. Unfortunately, even if you only
+ need a single function or variable from an object file, the entire
+ object file is extracted. (There's nothing unique to C++ or
+ libstdc++-v3 about this; it's just common behavior, given here for
+ background reasons.)
+
+ Some of the object files which make up libstdc++.a are rather large.
+ If you create a statically-linked executable with -static, those large
+ object files are suddenly part of your executable. Historically the
+ best way around this was to only place a very few functions (often
+ only a single one) in each source/object file; then extracting a
+ single function is the same as extracting a single .o file. For
+ libstdc++-v3 this is only possible to a certain extent; the object
+ files in question contain template classes and template functions,
+ pre-instantiated, and splitting those up causes severe maintenance
+ headaches.
+
+ It's not a bug, and it's not really a problem. Nevertheless, some
+ people don't like it, so here are two pseudo-solutions:
+
+ If the only functions from libstdc++.a which you need are language
+ support functions (those listed in [64]clause 18 of the standard,
+ e.g., new and delete), then try linking against libsupc++.a (usually
+ specifying -lsupc++ when calling g++ for the final link step will do
+ it). This library contains only those support routines, one per object
+ file. But if you are using anything from the rest of the library, such
+ as IOStreams or vectors, then you'll still need pieces from
+ libstdc++.a.
+
+ The second method is one we hope to incorporate into the library build
+ process. Some platforms can place each function and variable into its
+ own section in a .o file. The GNU linker can then perform garbage
+ collection on unused sections; this reduces the situation to only
+ copying needed functions into the executable, as before, but all
+ happens automatically.
+
+ Unfortunately the garbage collection in GNU ld is buggy; sections
+ (corresponding to functions and variables) which are used are
+ mistakenly removed, leading to horrible crashes when your executable
+ starts up. For the time being, this feature is not used when building
+ the library.
+ _________________________________________________________________
+
3.0 Platform-Specific Issues
3.1 Can libstdc++-v3 be used with <my favorite compiler>?
@@ -260,30 +318,14 @@
Since the goal of ISO Standardization is for all C++ implementations
to be able to share code, the final libstdc++ should, in theory, be
- useable under any ISO-compliant compiler. It will still be targeted
- and optimized for GCC/g++, however.
+ usable under any ISO-compliant compiler. It will still be targeted and
+ optimized for GCC/g++, however.
_________________________________________________________________
-3.2 Building under Cygwin hangs/explodes!?
-
- Sometimes, yes. You're probably in the middle of generating the
- numeric_limits specializations when it hangs, right? Thought so...
+3.2 [removed]
- The <limits> header and its associated library code are
- platform-specific. These files get generated from scratch during
- installation, and it is this generator that is hanging. More
- specifically, the only sure way to determine what the
- numeric_limits<T>::traps boolean should be is to actually divide by
- zero and see if it is trapped or not.
-
- Under NT, this will occasionally just hang. On those occasions when
- the test does not hang, the zero-division is in fact trapped. That
- doesn't prevent hanging elsewhere.
-
- You have two options. You can get a newer cygwin1.dll (see the Cygwin
- paragraph in the [55]installation instructions). Or you can get a
- prebuilt set of bits/std_limits.h and src/limitsMEMBERS.cc files from
- Mumit Khan's [56]Cygwin-related website.
+ This question has become moot and has been removed. The stub is here
+ to preserve numbering (and hence links/bookmarks).
_________________________________________________________________
3.3 Building DEC OSF kills the assembler
@@ -294,11 +336,23 @@
install GNU as and arrange for the GCC build to use it (or merge the
sources and build it during the bootstrap).
- Anyone who [57]knows the DEC assembler well enough to provide the
+ Anyone who [65]knows the DEC assembler well enough to provide the
equivalent of these two pseudos would win praise and accolades from
many.
_________________________________________________________________
+3.4 I can't use 'long long' on Solaris
+
+ By default we try to support the C99 long long type. This requires
+ that certain functions from your C library be present.
+
+ Up through release 3.0.2 the tests performed were too general, and
+ this feature was disabled when it did not need to be. The most
+ commonly reported platform affected was Solaris.
+
+ This has been fixed for 3.0.3 and onwards.
+ _________________________________________________________________
+
4.0 Known Bugs and Non-Bugs
Note that this section can get rapdily outdated -- such is the nature
@@ -306,60 +360,48 @@
mailing list or look through recent archives. The RELEASE- NOTES and
BUGS files are generally kept up-to-date.
+ For 3.0.1, the most common "bug" is an apparently missing "../" in
+ include/Makefile, resulting in files like gthr.h and gthr-single.h not
+ being found.
+
+ Please read [66]the configuration instructions for GCC, specifically
+ the part about configuring in a separate build directory, and how
+ strongly recommended it is. Building in the source directory is
+ fragile, is rarely tested, and tends to break, as in this case. This
+ was fixed for 3.0.2.
+
+ Please do not report these as bugs. We know about them. Reporting this
+ -- or any other problem that's already been fixed -- hinders the
+ development of GCC, because we have to take time to respond to your
+ report. Thank you.
+
4.1 What works already?
This is a verbatim clip from the "Status" section of the RELEASE-NOTES
for the latest snapshot.
New:
-- namespace std:: is now on by default.
-- choice of "C" include strategies, including the shadow header work,
- or generic global to std mapping of required "C" types.
-- cpu/atomicity.h tweaks, additions of ia64 and arm support.
-- abstraction of atomicity.h header to support notion of os/atomicity.h files.
-- addition of backward header bits
-- use of system_header pragma
-- Conditional use of -Werror
-- preliminary support for new g++ diagnostics capabilities, including
- -fdiagnostics-show-location=once
-- pedantic and shadow argument warning fixes
-- Ugly, yet correct mechanism for dealing with "C" math adopted,
- including the use of builtins.
-- updates and configure/build work to support new libtool
-- addition of strstream
-- valarray work
-- complex work
-- update to SGI STL 3.3
-- libio sync between glibc/libstdc++-v3. Some divergence since initial
- merge, but sources remain quite close.
-- IO fixes for alpha
-- wide character work for IO when using libio
-- addition of c_io_stdio and "C" IO abstraction layer.
-- auto_ptr fixes, testsuite additions
-- Attempts to use -ffunction-sections -fdata-sections and
- --gc-sections, depending on use of GNU ld and specific features. As of
- late, --gc-sections has been disabled due to problems with it throwing
- away initialization sections. This work is ongoing.
-- long double support
-- sub directory removal, coherent organization of cpu and os-specific
- files, consolidation of include directories, integration of the C++
- support bits for operator new/delete,exceptions, etc. All includes
- are now either in the include/* hierarchy or in libsupc++'s sub directory.
-- Support for more platforms, including irix and bsd variants.
-- filebuf tweaks to deal with variable-size buffers.
-- filebuf implementation for putbackc, etc. al.
-- ctype rewritten. Includes ctype, ctype, and others.
-- codecvt rewritten. Includes codecvt,
- codecvt. In addition,
- implementation-defined conversions using iconv are now supported with
- the __enc_traits partial-specialization of the State template
- parameter of the codecvt class. In this manner, conversions between
- encodings such as UCS4, USC2, UNICODE, UNICODEBIG, UNICODELITTLE, etc
- can be performed.
-- preliminary work on named locales
-- preliminary documentation for locale implementation has been established.
-- Many, many bug fixes.
-- Many, many testsuite additions and consistent VERIFY usage.
-- work on mkcheck to make it more flexible, use libtool, etc.
+---
+- preliminary doxygen documentation has been added. Running "make
+ doxygen" in the libstdc++-v3 build directory will generate HTML
+ documentation that can be used to cross-reference names and files in
+ the library.
+- a dejagnu based testing framework has been added
+- a new implementation of the concept checking code has been ported
+ from the boost libraries.
+- support for -fno-exceptions has been added
+- stdexcept was re-written
+- using deprecated or antiquated headers now gives a warning
+- the stdio interface to iostreams has been tweaked, and now works
+ with synchronized c/c++ io
+- new libsupc++ routines implementing the IA-64 C++ ABI.
+- HPUX configuration files
+- support for AIX added
+- a lot of bugs were fixed.
+- preliminary named locales implemented
+- portability improvements made to generation of <limits>
+- speedups to improve configuration time.
+- DJGPP support added.
+- support for dlopening shared libstdc++
_________________________________________________________________
4.2 Bugs in gcc/g++ (not libstdc++-v3)
@@ -374,68 +416,119 @@ New:
4.3 Bugs in the C++ language/lib specification
- Yes, unfortunately, there are some. In a [58]message to the list,
+ Yes, unfortunately, there are some. In a [67]message to the list,
Nathan Myers announced that he has started a list of problems in the
ISO C++ Standard itself, especially with regard to the chapters that
- concern the library. The list itself is [59]posted on his website.
+ concern the library. The list itself is [68]posted on his website.
Developers who are having problems interpreting the Standard may wish
to consult his notes.
For those people who are not part of the ISO Library Group (i.e.,
nearly all of us needing to read this page in the first place :-), a
- public list of the library defects is occasionally published [60]here.
+ public list of the library defects is occasionally published [69]here.
+ Some of these have resulted in [70]code changes.
_________________________________________________________________
4.4 Things in libstdc++ that look like bugs
There are things which are not bugs in the compiler (4.2) nor the
language specification (4.3), but aren't really bugs in libstdc++,
- either. Really!
+ either. Really! Please do not report these as bugs.
- The biggest of these is the quadzillions of warnings about the library
- headers emitted when -Weffc++ is used. Making libstdc++
+ -Weffc++ The biggest of these is the quadzillions of warnings about
+ the library headers emitted when -Weffc++ is used. Making libstdc++
"-Weffc++-clean" is not a goal of the project, for a few reasons.
Mainly, that option tries to enforce object-oriented programming,
while the Standard Library isn't necessarily trying to be OO. There
are multiple solutions under discussion.
- Another is the rel_ops namespace and the template comparison operator
- functions contained therein. If they become visible in the same
- namespace as other comparison functions (e.g., 'using' them and the
- <iterator> header), then you will suddenly be faced with huge numbers
- of ambiguity errors. This was discussed on the -v3 list; Nathan Myers
- [61]sums things up here.
+ reopening a stream fails Did I just say that -Weffc++ was our biggest
+ false-bug report? I lied. (It used to be.) Today it seems to be
+ reports that after executing a sequence like
+ #include <fstream>
+ ...
+ std::fstream fs("a_file");
+ // .
+ // . do things with fs...
+ // .
+ fs.close();
+ fs.open("a_new_file");
+
+ all operations on the re-opened fs will fail, or at least act very
+ strangely. Yes, they often will, especially if fs reached the EOF
+ state on the previous file. The reason is that the state flags are not
+ cleared on a successful call to open(). The standard unfortunately did
+ not specify behavior in this case, and to everybody's great sorrow,
+ the [71]proposed LWG resolution (see DR #22) is to leave the flags
+ unchanged. You must insert a call to fs.clear() between the calls to
+ close() and open(), and then everything will work like we all expect
+ it to work.
+
+ rel_ops Another is the rel_ops namespace and the template comparison
+ operator functions contained therein. If they become visible in the
+ same namespace as other comparison functions (e.g., 'using' them and
+ the <iterator> header), then you will suddenly be faced with huge
+ numbers of ambiguity errors. This was discussed on the -v3 list;
+ Nathan Myers [72]sums things up here.
The g++-3 headers are not ours
If you have found an extremely broken header file which is causing
problems for you, look carefully before submitting a "high" priority
bug report (which you probably shouldn't do anyhow; see the last
- paragraph of the page describing [62]the GCC bug database).
+ paragraph of the page describing [73]the GCC bug database).
- If the headers are in ${prefix}/include/g++-3, then you are using the
- old libstdc++-v2 library, which is nonstandard and unmaintained. Do
- not report problems with -v2 to the -v3 mailing list.
+ If the headers are in ${prefix}/include/g++-3, or if the installed
+ library's name looks like libstdc++-2.10.a or libstdc++-libc6-2.10.so,
+ then you are using the old libstdc++-v2 library, which is nonstandard
+ and unmaintained. Do not report problems with -v2 to the -v3 mailing
+ list.
Currently our header files are installed in ${prefix}/include/g++-v3
(see the 'v'?). This may change with the next release of GCC, as it
- may be too confusing, but [63]the question has not yet been decided.
+ may be too confusing, but [74]the question has not yet been decided.
+
+ glibc If you're on a GNU/Linux system and have just upgraded to glibc
+ 2.2, but are still using gcc 2.95.2, then you should have read the
+ glibc FAQ, specifically 2.34:
+2.34. When compiling C++ programs, I get a compilation error in streambuf.h.
+
+{BH} You are using g++ 2.95.2? After upgrading to glibc 2.2, you need to
+apply a patch to the include files in /usr/include/g++, because the fpos_t
+type has changed in glibc 2.2. The patch is at
+http://clisp.cons.org/~haible/gccinclude-glibc-2.2-compat.diff
+
+
+ Note that 2.95.x shipped with the [75]old v2 library which is no
+ longer maintained. Also note that gcc 2.95.3 fixes this problem, but
+ requires a separate patch for libstdc++-v3.
+
+ concept checks If you see compilation errors containing messages about
+ fooConcept and a constraints member function, then most likely you
+ have violated one of the requirements for types used during
+ instantiation of template containers and functions. For example,
+ EqualityComparableConcept appears if your types must be comparable
+ with == and you have not provided this capability (a typo, or wrong
+ visibility, or you just plain forgot, etc).
+
+ More information, including how to optionally enable/disable the
+ checks, is available [76]here.
_________________________________________________________________
4.5 Aw, that's easy to fix!
If you have found a bug in the library and you think you have a
working fix, then send it in! The main GCC site has a page on
- [64]submitting patches that covers the procedure, but for libstdc++
- you should of course send the patch to our mailing list, not the GCC
- mailing list. The libstdc++ [65]contributors' page also talks about
- how to submit patches.
+ [77]submitting patches that covers the procedure, but for libstdc++
+ you should also send the patch to our mailing list in addition to the
+ GCC patches mailing list. The libstdc++ [78]contributors' page also
+ talks about how to submit patches.
In addition to the description, the patch, and the ChangeLog entry, it
is a Good Thing if you can additionally create a small test program to
test for the presence of the bug that your patch fixes. Bugs have a
way of being reintroduced; if an old bug creeps back in, it will be
- caught immediately by the [66]testsuite -- but only if such a test
+ caught immediately by the [79]testsuite -- but only if such a test
exists.
_________________________________________________________________
@@ -451,38 +544,50 @@ New:
were never guaranteed by the Standard anyway. The type-safety achieved
by making iterators a real class rather than a typedef for T*
outweighs nearly all opposing arguments.
+
+ Code which does assume that a vector iterator i is a pointer can often
+ be fixed by changing i in certain expressions to &*i . Future
+ revisions of the Standard are expected to bless this usage for
+ vector<> (but not for basic_string<>).
_________________________________________________________________
5.2 What's next after libstdc++-v3?
Hopefully, not much. The goal of libstdc++-v3 is to produce a
fully-compliant, fully-portable Standard Library. After that, we're
- mostly done: there won't be any more compliance work to do.
-
- The ISO Committee will meet periodically to review Defect Reports in
- the C++ Standard. Undoubtably some of these will result in changes to
- the Standard, which will be reflected in patches to libstdc++. Some of
- that is already happening, see 4.2. Some of those changes are being
- predicted by the library maintainers, and we add code to the library
- based on what the current proposed resolution specifies.
-
- The current libstdc++ contains extensions to the Library which must be
- explicitly requested by client code (for example, the hash tables from
- SGI). Other extensions may be added to libstdc++-v3 if they seem to be
- "standard" enough. (For example, the "long long" type from C99.)
- Bugfixes and rewrites (to improve or fix thread safety, for instance)
- will of course be a continuing task.
-
- [67]This question about the next libstdc++ prompted some brief but
- interesting [68]speculation.
+ mostly done: there won't be any more compliance work to do. However:
+ 1. The ISO Committee will meet periodically to review Defect Reports
+ in the C++ Standard. Undoubtedly some of these will result in
+ changes to the Standard, which will be reflected in patches to
+ libstdc++. Some of that is already happening, see 4.2. Some of
+ those changes are being predicted by the library maintainers, and
+ we add code to the library based on what the current proposed
+ resolution specifies. Those additions are listed in [80]the
+ extensions page.
+ 2. Performance tuning. Lots of performance tuning. This too is
+ already underway for post-3.0 releases, starting with memory
+ expansion in container classes and buffer usage in synchronized
+ stream objects.
+ 3. An ABI for libstdc++ will eventually be developed, so that
+ multiple binary-incompatible copies of the library can be replaced
+ with a single backwards-compatible library, like libgcc_s.so is.
+ 4. The current libstdc++ contains extensions to the Library which
+ must be explicitly requested by client code (for example, the hash
+ tables from SGI). Other extensions may be added to libstdc++-v3 if
+ they seem to be "standard" enough. (For example, the "long long"
+ type from C99.) Bugfixes and rewrites (to improve or fix thread
+ safety, for instance) will of course be a continuing task.
+
+ [81]This question about the next libstdc++ prompted some brief but
+ interesting [82]speculation.
_________________________________________________________________
5.3 What about the STL from SGI?
- The [69]STL from SGI is merged into libstdc++-v3 with changes as
- necessary. Currently release 3.3 is being used. Changes in the STL
- usually produce some weird bugs and lots of changes in the rest of the
- libstdc++ source as we scramble to keep up. :-)
+ The [83]STL from SGI, version 3.3, was the most recent merge of the
+ STL codebase. The code in libstdc++ contains many fixes and changes,
+ and it is very likely that the SGI code is no longer under active
+ development. We expect that no future merges will take place.
In particular, string is not from SGI and makes no use of their "rope"
class (which is included as an optional extension), nor is valarray
@@ -500,29 +605,57 @@ New:
#include <ext/hash_map>
- Extensions to the library have [70]their own page.
+ Extensions to the library have [84]their own page.
_________________________________________________________________
-5.5 Compiling with "-fnew-abi"
+5.5 [removed]
- Towards the end of July 1999, this subject was brought up again on the
- mailing list under a different name. The related [71]thread (by the
- name HOWTO-honor-std) is very instructive. More info is at the end of
- RELEASE-NOTES.
-
- This functionality is now automated and turned on by default.
+ This question has become moot and has been removed. The stub is here
+ to preserve numbering (and hence links/bookmarks).
_________________________________________________________________
5.6 Is libstdc++-v3 thread-safe?
- Quick answer: no, as of 2.91 (tenth snapshot), the library is not
- appropriate for multithreaded access. The string class is MT-safe.
-
- This is assuming that your idea of "multithreaded" is the same as
- ours... The general question of multithreading and libstdc++-v3 is
- addressed in the chapter-specific advice for [72]Library Introduction.
- Threadsafe containers are covered in more detail in [73]the Received
- Wisdom section on containers.
+ When the system's libc is itself thread-safe, a non-generic
+ implementation of atomicity.h exists for the architecture, and gcc
+ itself reports a thread model other than single; libstdc++-v3 strives
+ to be thread-safe. The user-code must guard against concurrent method
+ calls which may access any particular library object's state.
+ Typically, the application programmer may infer what object locks must
+ be held based on the objects referenced in a method call. Without
+ getting into great detail, here is an example which requires
+ user-level locks:
+ library_class_a shared_object_a;
+
+ thread_main () {
+ library_class_b *object_b = new library_class_b;
+ shared_object_a.add_b (object_b); // must hold lock for shared_object_
+a
+ shared_object_a.mutate (); // must hold lock for shared_object_
+a
+ }
+
+ // Multiple copies of thread_main() are started in independent threads.
+
+ Under the assumption that object_a and object_b are never exposed to
+ another thread, here is an example that should not require any
+ user-level locks:
+ thread_main () {
+ library_class_a object_a;
+ library_class_b *object_b = new library_class_b;
+ object_a.add_b (object_b);
+ object_a.mutate ();
+ }
+
+ All library objects are safe to use in a multithreaded program as long
+ as each thread carefully locks out access by any other thread while it
+ uses any object visible to another thread. In general, this
+ requirement includes both read and write access to objects; unless
+ otherwise documented as safe, do not assume that two threads may
+ access a shared standard library object at the same time.
+
+ See chapters [85]17 (library introduction), [86]23 (containers), and
+ [87]27 (I/O) for more information.
_________________________________________________________________
5.7 How do I get a copy of the ISO C++ Standard?
@@ -533,17 +666,63 @@ New:
their two-meeting commitment for voting rights, may get a copy of the
standard from their respective national standards organization. In the
USA, this national standards organization is ANSI and their website is
- right [74]here. (And if you've already registered with them, clicking
- this link will take you to directly to the place where you can [75]buy
+ right [88]here. (And if you've already registered with them, clicking
+ this link will take you to directly to the place where you can [89]buy
the standard on-line.
- Who is your country's member body? Visit the [76]ISO homepage and find
+ Who is your country's member body? Visit the [90]ISO homepage and find
out!
_________________________________________________________________
- Comments and suggestions are welcome, and may be sent to [77]Phil
- Edwards or [78]Gabriel Dos Reis.
- $Id: index.html,v 1.1 2000/12/10 04:04:56 pme Exp $
+5.8 What's an ABI and why is it so messy?
+
+ "ABI" stands for "Application Binary Interface." Conventionally, it
+ refers to a great mass of details about how arguments are arranged on
+ the call stack and/or in registers, and how various types are arranged
+ and padded in structs. A single CPU design may suffer multiple ABIs
+ designed by different development tool vendors who made different
+ choices, or even by the same vendor for different target applications
+ or compiler versions. In ideal circumstances the CPU designer presents
+ one ABI and all the OSes and compilers use it. In practice every ABI
+ omits details that compiler implementers (consciously or accidentally)
+ must choose for themselves.
+
+ That ABI definition suffices for compilers to generate code so a
+ program can interact safely with an OS and its lowest-level libraries.
+ Users usually want an ABI to encompass more detail, allowing libraries
+ built with different compilers (or different releases of the same
+ compiler!) to be linked together. For C++, this includes many more
+ details than for C, and CPU designers (for good reasons elaborated
+ below) have not stepped up to publish C++ ABIs. The details include
+ virtual function implementation, struct inheritance layout, name
+ mangling, and exception handling. Such an ABI has been defined for GNU
+ C++, and is immediately useful for embedded work relying only on a
+ "free-standing implementation" that doesn't include (much of) the
+ standard library. It is a good basis for the work to come.
+
+ A useful C++ ABI must also incorporate many details of the standard
+ library implementation. For a C ABI, the layouts of a few structs
+ (such as FILE, stat, jmpbuf, and the like) and a few macros suffice.
+ For C++, the details include the complete set of names of functions
+ and types used, the offsets of class members and virtual functions,
+ and the actual definitions of all inlines. C++ exposes many more
+ library details to the caller than C does. It makes defining a
+ complete ABI a much bigger undertaking, and requires not just
+ documenting library implementation details, but carefully designing
+ those details so that future bug fixes and optimizations don't force
+ breaking the ABI.
+
+ There are ways to help isolate library implementation details from the
+ ABI, but they trade off against speed. Library details used in inner
+ loops (e.g., getchar) must be exposed and frozen for all time, but
+ many others may reasonably be kept hidden from user code, so they may
+ later be changed. Deciding which, and implementing the decisions, must
+ happen before you can reasonably document a candidate C++ ABI that
+ encompasses the standard library.
+ _________________________________________________________________
+
+ See [91]license.html for copying conditions. Comments and suggestions
+ are welcome, and may be sent to [92]the libstdc++ mailing list.
References
@@ -558,70 +737,84 @@ References
9. ../faq/index.html#1_6
10. ../faq/index.html#1_7
11. ../faq/index.html#1_8
- 12. ../faq/index.html#2_0
- 13. ../faq/index.html#2_1
- 14. ../faq/index.html#2_2
- 15. ../faq/index.html#2_3
- 16. ../faq/index.html#2_4
- 17. ../faq/index.html#3_0
- 18. ../faq/index.html#3_1
- 19. ../faq/index.html#3_2
- 20. ../faq/index.html#3_3
- 21. ../faq/index.html#4_0
- 22. ../faq/index.html#4_1
- 23. ../faq/index.html#4_2
- 24. ../faq/index.html#4_3
- 25. ../faq/index.html#4_4
- 26. ../faq/index.html#4_4_interface
- 27. ../faq/index.html#4_5
- 28. ../faq/index.html#5_0
- 29. ../faq/index.html#5_1
- 30. ../faq/index.html#5_2
- 31. ../faq/index.html#5_3
- 32. ../faq/index.html#5_4
- 33. ../faq/index.html#5_5
- 34. ../faq/index.html#5_6
- 35. ../faq/index.html#5_7
- 36. ftp://gcc.gnu.org/pub/libstdc++/libstdc++-2.91.tar.gz
- 37. ../17_intro/DESIGN
- 38. http://gcc.gnu.org/
- 39. http://gcc.gnu.org/gcc-2.95/buildstat.html
- 40. http://gcc.gnu.org/libstdc++/
- 41. ftp://gcc.gnu.org/pub/libstdc++/libstdc++-2.91.tar.gz
- 42. http://gcc.gnu.org/libstdc++/
- 43. ../17_intro/contribute.html
- 44. http://www.boost.org/
- 45. http://gcc.gnu.org/fom_serv/cache/33.html
- 46. mailto:libstdc++@gcc.gnu.org
- 47. mailto:pme@sources.redhat.com
- 48. mailto:gdr@gcc.gnu.org
- 49. http://sources.redhat.com/autoconf/
- 50. http://sources.redhat.com/automake/
- 51. ../documentation.html
- 52. ../17_intro/RELEASE-NOTES
- 53. http://www.gnu.org/software/cvs/cvs.html
- 54. http://www.cyclic.com/
- 55. ../install.html
- 56. http://www.xraylith.wisc.edu/~khan/software/gnu-win32/libstdc++-v3.html
- 57. http://gcc.gnu.org/ml/libstdc++/2000-12/msg00279.html
- 58. http://gcc.gnu.org/ml/libstdc++/1998/msg00006.html
- 59. http://www.cantrip.org/draft-bugs.txt
- 60. http://anubis.dkuug.dk/jtc1/sc22/wg21/
- 61. http://gcc.gnu.org/ml/libstdc++/2001-01/msg00247.html
- 62. http://gcc.gnu.org/gnatswrite.html
- 63. http://gcc.gnu.org/ml/gcc/2000-10/msg00732.html
- 64. http://gcc.gnu.org/contribute.html
- 65. ../17_intro/contribute.html
- 66. ../faq/index.html#2_4
- 67. http://gcc.gnu.org/ml/libstdc++/1999/msg00080.html
- 68. http://gcc.gnu.org/ml/libstdc++/1999/msg00084.html
- 69. http://www.sgi.com/Technology/STL/
- 70. ../ext/howto.html
- 71. http://gcc.gnu.org/ml/libstdc++/1999-q3/msg00066.html
- 72. http://gcc.gnu.org/libstdc++/17_intro/howto.html#3
- 73. http://gcc.gnu.org/libstdc++/23_containers/howto.html
- 74. http://www.ansi.org/
- 75. http://webstore.ansi.org/ansidocstore/product.asp?sku=ISO%2FIEC+14882%2D1998
- 76. http://www.iso.ch/
- 77. mailto:pme@sources.redhat.com
- 78. mailto:gdr@gcc.gnu.org
+ 12. ../faq/index.html#1_9
+ 13. ../faq/index.html#2_0
+ 14. ../faq/index.html#2_1
+ 15. ../faq/index.html#2_2
+ 16. ../faq/index.html#2_3
+ 17. ../faq/index.html#2_4
+ 18. ../faq/index.html#2_5
+ 19. ../faq/index.html#3_0
+ 20. ../faq/index.html#3_1
+ 21. ../faq/index.html#3_2
+ 22. ../faq/index.html#3_3
+ 23. ../faq/index.html#3_4
+ 24. ../faq/index.html#4_0
+ 25. ../faq/index.html#4_1
+ 26. ../faq/index.html#4_2
+ 27. ../faq/index.html#4_3
+ 28. ../faq/index.html#4_4
+ 29. ../faq/index.html#4_4_iostreamclear
+ 30. ../faq/index.html#4_4_Weff
+ 31. ../faq/index.html#4_4_rel_ops
+ 32. ../faq/index.html#4_4_interface
+ 33. ../faq/index.html#4_4_glibc
+ 34. ../faq/index.html#4_4_checks
+ 35. ../faq/index.html#4_5
+ 36. ../faq/index.html#5_0
+ 37. ../faq/index.html#5_1
+ 38. ../faq/index.html#5_2
+ 39. ../faq/index.html#5_3
+ 40. ../faq/index.html#5_4
+ 41. ../faq/index.html#5_5
+ 42. ../faq/index.html#5_6
+ 43. ../faq/index.html#5_7
+ 44. ../faq/index.html#5_8
+ 45. http://gcc.gnu.org/libstdc++/download.html
+ 46. ../faq/index.html#4_4_interface
+ 47. ../17_intro/DESIGN
+ 48. http://gcc.gnu.org/
+ 49. http://gcc.gnu.org/gcc-2.95/buildstat.html
+ 50. http://gcc.gnu.org/libstdc++/
+ 51. http://gcc.gnu.org/libstdc++/download.html
+ 52. http://gcc.gnu.org/libstdc++/
+ 53. ../17_intro/contribute.html
+ 54. http://www.boost.org/
+ 55. http://gcc.gnu.org/fom_serv/cache/33.html
+ 56. mailto:libstdc++@gcc.gnu.org
+ 57. mailto:pme@gcc.gnu.org
+ 58. mailto:gdr@gcc.gnu.org
+ 59. ../17_intro/license.html
+ 60. ../documentation.html
+ 61. ../17_intro/RELEASE-NOTES
+ 62. http://www.gnu.org/software/cvs/cvs.html
+ 63. http://www.cvshome.org/
+ 64. ../18_support/howto.html
+ 65. http://gcc.gnu.org/ml/libstdc++/2000-12/msg00279.html
+ 66. http://gcc.gnu.org/install/configure.html
+ 67. http://gcc.gnu.org/ml/libstdc++/1998/msg00006.html
+ 68. http://www.cantrip.org/draft-bugs.txt
+ 69. http://anubis.dkuug.dk/jtc1/sc22/wg21/
+ 70. ../faq/index.html#5_2
+ 71. ../ext/howto.html#5
+ 72. http://gcc.gnu.org/ml/libstdc++/2001-01/msg00247.html
+ 73. http://gcc.gnu.org/gnatswrite.html
+ 74. http://gcc.gnu.org/ml/gcc/2000-10/msg00732.html
+ 75. ../faq/index.html#4_4_interface
+ 76. ../19_diagnostics/howto.html#3
+ 77. http://gcc.gnu.org/contribute.html
+ 78. ../17_intro/contribute.html
+ 79. ../faq/index.html#2_4
+ 80. ../ext/howto.html#5
+ 81. http://gcc.gnu.org/ml/libstdc++/1999/msg00080.html
+ 82. http://gcc.gnu.org/ml/libstdc++/1999/msg00084.html
+ 83. http://www.sgi.com/Technology/STL/
+ 84. ../ext/howto.html
+ 85. ../17_intro/howto.html#3
+ 86. ../23_containers/howto.html#3
+ 87. ../27_io/howto.html#9
+ 88. http://www.ansi.org/
+ 89. http://webstore.ansi.org/ansidocstore/product.asp?sku=ISO%2FIEC+14882%2D1998
+ 90. http://www.iso.ch/
+ 91. ../17_intro/license.html
+ 92. mailto:libstdc++@gcc.gnu.org
diff --git a/libstdc++-v3/docs/html/install.html b/libstdc++-v3/docs/html/install.html
index fcc0c0dcdce..16b49d34c68 100644
--- a/libstdc++-v3/docs/html/install.html
+++ b/libstdc++-v3/docs/html/install.html
@@ -1,344 +1,292 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-<HEAD>
- <META NAME="AUTHOR" CONTENT="pme@sources.redhat.com (Phil Edwards)">
- <META NAME="KEYWORDS" CONTENT="libstdc++, libstdc++-v3, GCC, g++">
- <META NAME="DESCRIPTION" CONTENT="README for the GNU libstdc++ effort.">
- <META NAME="GENERATOR" CONTENT="vi and eight fingers">
- <TITLE>libstdc++-v3 Installation Instructions</TITLE>
-<LINK REL=StyleSheet HREF="lib3styles.css">
-<!-- $Id: install.html,v 1.3 2001/01/23 17:02:26 pme Exp $ -->
-</HEAD>
-<BODY>
+<html>
+<head>
+ <meta name="AUTHOR" content="pme@gcc.gnu.org (Phil Edwards)">
+ <meta name="KEYWORDS" content="libstdc++, libstdc++-v3, GCC, g++">
+ <meta name="DESCRIPTION" content="README for the GNU libstdc++ effort.">
+ <meta name="GENERATOR" content="vi and eight fingers">
+ <title>libstdc++-v3 Installation Instructions</title>
+<link rel="StyleSheet" href="lib3styles.css">
+</head>
+<body>
-<H1 CLASS="centered"><A NAME="top">libstdc++-v3 INSTALL</A></H1>
+<h1 class="centered"><a name="top">libstdc++-v3 INSTALL</a></h1>
-<P>The latest version of this document is always available at
- <A HREF="http://gcc.gnu.org/onlinedocs/libstdc++/install.html">
- http://gcc.gnu.org/onlinedocs/libstdc++/install.html</A>.
-</P>
+<p>The latest version of this document is always available at
+ <a href="http://gcc.gnu.org/onlinedocs/libstdc++/install.html">
+ http://gcc.gnu.org/onlinedocs/libstdc++/install.html</a>.
+</p>
-<P>To the <A HREF="http://gcc.gnu.org/libstdc++/">libstdc++-v3 homepage</A>.
+<p>To the <a href="http://gcc.gnu.org/libstdc++/">libstdc++-v3 homepage</a>.
<!-- ####################################################### -->
-<HR>
-<H2>Contents</H2>
-<UL>
- <LI><A HREF="#prereqs">Tools you will need beforehand</A>
- <LI><A HREF="#srcsetup">Setting up the source directories</A>
- <LI><A HREF="#config">Configuring</A>
- <LI><A HREF="#install">Building and installing the library</A>
- <LI><A HREF="#postinstall">Post-installation</A>
- <LI><A HREF="#usage">Using the library</A>
-</UL>
-
-<HR>
+<hr>
+<h2>Contents</h2>
+<ul>
+ <li><a href="#prereqs">Tools you will need beforehand</a>
+ <li><a href="#srcsetup">Setting up the source directories</a>
+ <li><a href="#config">Configuring</a>
+ <li><a href="#install">Building and installing the library</a>
+ <li><a href="#postinstall">Post-installation</a>
+ <li><a href="#usage">Using the library</a>
+</ul>
+
+<hr>
<!-- ####################################################### -->
-<H2><A NAME="prereqs">Tools you will need beforehand</A></H2>
- <P>You will need a recent version of g++ to compile the snapshot of
- libstdc++, one of the post-2.95.2 GCC
- snapshots (insert standard caveat about using snapshots rather
- than formal releases). You will need the full source
+<h2><a name="prereqs">Tools you will need beforehand</a></h2>
+ <p>You will need a recent version of g++ to compile the snapshot of
+ libstdc++, such as one of the GCC 3.x snapshots (insert standard
+ caveat about using snapshots rather than formal releases). You
+ will need the full source
distribution to whatever compiler release you are using. The
GCC snapshots can be had from one of the sites on their
- <A HREF="http://gcc.gnu.org/mirrors.html">mirror list</A>.
- </P>
-
- <P>In addition, if you plan to modify the makefiles or regenerate
- the configure scripts you'll need the nuevo automake, libtool
- and autoconf to regenerate the Makefiles and configure
- scripts. These tools are all required to be installed in the
- same location (most linux distributions install these tools by
- default, so no worries.)
- </P>
-
- <P>If you don't have bash, and want to run <TT>'make check'</TT> to
- test your build, you'll need to get bash 2.x. Also recommended
- is GNU Make, since it is the only 'make' that will parse these
- makefiles correctly. We are moving to DejaGNU, so you'll
- probably want to get that.
- </P>
-
- <P>As of June 19, 2000, libstdc++ attempts to use tricky and
+ <a href="http://gcc.gnu.org/mirrors.html">mirror list</a>.
+ </p>
+
+ <p>In addition, if you plan to modify the makefiles or regenerate the
+ configure scripts you'll need recent versions of the GNU Autotools:
+ autoconf (version 2.50 or later),
+ automake (version 1.4 or later), <!-- special version? -->
+ and libtool (multilanguage, version 1.4 or later), <!-- really? -->
+ in order to rebuild the files.
+ These tools are all required to be installed in the same location
+ (most linux distributions install these tools by default, so no
+ worries as long as the versions are correct).
+ </p>
+
+ <p>GNU Make is the only 'make' that will parse the makefiles correctly.
+ </p>
+
+ <p>To test your build, you will need either DejaGNU 1.4 (to run
+ <code>'make check'</code> like
+ <a href="http://gcc.gnu.org/install/test.html">the rest of GCC</a>),
+ or Bash 2.x (to run <code>'make check-script'</code>).
+ </p>
+
+ <p>As of June 19, 2000, libstdc++ attempts to use tricky and
space-saving features of the GNU toolchain, enabled with
- <TT>-ffunction-sections -fdata-sections -Wl,--gc-sections</TT>.
+ <code>-ffunction-sections -fdata-sections -Wl,--gc-sections</code>.
To obtain maximum benefit from this, binutils after this date
should also be used (bugs were fixed with C++ exception handling
related to this change in libstdc++-v3). The version of these
- tools should be <TT>2.10.90</TT>, and you can get snapshots (as
+ tools should be <code>2.10.90</code>, and you can get snapshots (as
well as releases) of binutils
- <A HREF="ftp://sources.redhat.com/pub/binutils">here</A>.
- </P>
+ <a href="ftp://sources.redhat.com/pub/binutils">here</a>.
+ </p>
- <P>Finally, a few system-specific requirements:
- <DL>
- <DT>Cygwin
- <DD>If you are using Cygwin to compile libstdc++-v3 on Win32, you'll
- have to get a version of the cygwin1.dll that is dated on or
- after February 1, 2000. This is necessary to successfully run
- the script &quot;mknumeric_limits&quot; which probes the
- floating-point
- environment of the host in question -- before this date, Cygwin
- would freeze when running this script. In addition, you may
- want to get a current version of libtool (say libtool-1.3.4
- and above) as earlier versions supposedly had problems creating
- shared libraries.
-
- </DL>
- </P>
-
-<HR>
-
-<H2><A NAME="srcsetup">Setting up the source directories</A></H2>
- <P><EM>As the libstdc++-v3 sources and the core GCC sources have
- converged, more and more effort goes to building the
- library as the default version to be shipped with g++. With the
- 2.90.8 snapshot, and especially for CVS versions after this
- release, this is treated as the usual scenario. If you want to
- build the library all by itself, you will need to explicitly
- disable certain features (like namespaces) since the core GCC
- library, libgcc.a, will not be rebuilt with those same features.
- </EM>
- </P>
-
- <P>By default, all configurations of libstdc++-v3 now have namespaces
- enabled. Being able to select/de-select this option was a complex task
- that had hopelessly confused many otherwise intelligent people, and
- provided an endless stream of silent cursing and cries for help.
- Because of this, gcc sources are required, and are no longer optional.
- </P>
-
- <P>The following definitions will be used throughout the rest of this
+ <!-- Commented until some system-specific requirements appear.
+ <p>Finally, a few system-specific requirements:
+ <dl>
+ <dt>Cygwin
+ <dd>If you are using Cygwin to compile libstdc++-v3 on Win32, you'll
+ [snip]
+
+ </dl>
+ </p>
+-->
+
+<hr>
+
+<h2><a name="srcsetup">Setting up the source directories</a></h2>
+ <p>The following definitions will be used throughout the rest of this
document:
- <UL>
- <LI><EM>gccsrcdir</EM>: The directory holding the source of the
+ <ul>
+ <li><em>gccsrcdir</em>: The directory holding the source of the
compiler. It should have several subdirectories like
- <EM>gccsrcdir</EM>/libio and <EM>gccsrcdir</EM>/gcc.
- <LI><EM>libsrcdir</EM>: The directory holding the source of the
+ <em>gccsrcdir</em>/libio and <em>gccsrcdir</em>/gcc.
+ <li><em>libsrcdir</em>: The directory holding the source of the
C++ library.
- <LI><EM>gccbuilddir</EM>: The build directory for the compiler
- in <EM>gccsrcdir</EM>. GCC requires that it be built in
+ <li><em>gccbuilddir</em>: The build directory for the compiler
+ in <em>gccsrcdir</em>. GCC requires that it be built in
a different directory than its sources.
- <LI><EM>libbuilddir</EM>: The build directory for libstdc++.
- <LI><EM>destdir</EM>: The eventual installation directory for
+ <li><em>libbuilddir</em>: The build directory for libstdc++.
+ <li><em>destdir</em>: The eventual installation directory for
the compiler/libraries, set with the --prefix option to
the configure script.
- </UL>
+ </ul>
Note:
- <OL>
- <LI>The .91 snapshot and following are intended to replace the
- library that comes with the compiler, so <EM>libsrcdir</EM>
- and <EM>libbuilddir</EM> must be contained under
- <EM>gccsrcdir</EM> and <EM>gccbuilddir</EM>, respectively.
- <LI>The source, build, and installation directories should
+ <ol>
+ <li>The 3.0 version and following are intended to replace the
+ library that comes with the compiler, so <em>libsrcdir</em>
+ and <em>libbuilddir</em> must be contained under
+ <em>gccsrcdir</em> and <em>gccbuilddir</em>, respectively.
+ <li>The source, build, and installation directories should
not be parents of one another; i.e., these should all be
separate directories. Please don't build out of the
source directory.
- </OL>
- </P>
-
- <P>Since the release of libstdc++-2.90.8, configuration patches have gone
- into CVS gcc that make the management of the various libstdc++ source
- trees a bit easier. Because of this, both libstdc++-v2 and
- libstdc++-v3 and live together in peace, without the need
- for soft linking. The setup instructions are slightly different,
- depending on whether you want to use CVS gcc or a snapshot. Please
- choose the appropriate scenario:
- </P>
-
- <P><B>...with a gcc-2.9[67] snapshot</B>
- <P>Unpack the <EM>gccsrcdir</EM> and go into that directory. For
- instance, <TT>gcc-2.95.2</TT> is a valid <EM>gccsrcdir</EM>.
- Once in <EM>gccsrcdir</EM>, you'll need to rename or delete
- the libstdc++-v3 directory which comes with that snapshot:
- <PRE>
- mv libstdc++-v3 libstdc++-v3-previous <STRONG>[OR]</STRONG>
- rm -r libstdc++-v3</PRE>
- </P>
- <P>Next, unpack the libstdc++-v3 library tarball into the
- <EM>gccsrcdir</EM> directory; it will create a
- <EM>libsrcdir</EM> called <TT>libstdc++-<EM>version</EM></TT>:
- <PRE>
- gzip -dc libstdc++-version.tar.gz | tar xf -</PRE>
- </P>
- <P>Finally, make a soft link between <EM>libsrcdir</EM> and
- <TT>libstdc++-v3</TT> so that libstdc++-v3 will be the default C++
- library used.
- <PRE>
- ln -s <EM>libsrcdir</EM> libstdc++-v3</PRE>
- </P>
- </P>
-
- <P><B>...with CVS gcc</B>
- <P>Check out or download the gcc sources: the resulting source
- directory is <EM>gccsrcdir</EM>. Once in <EM>gccsrcdir</EM>,
- you'll need to rename or delete the libstdc++-v3 directory
- which comes with that snapshot:
- <PRE>
- mv libstdc++-v3 libstdc++-v3-previous <STRONG>[OR]</STRONG>
- rm -r libstdc++-v3</PRE>
- </P>
- <P>Next, unpack the libstdc++-v3 library tarball into this
- <EM>gccsrcdir</EM> directory; it will create a
- <EM>libsrcdir</EM> called <TT>libstdc++-<EM>version</EM></TT>:
- <PRE>
- gzip -dc libstdc++-version.tar.gz | tar xf -</PRE>
- </P>
- <P>Finally, rename <EM>libsrcdir</EM> to <TT>libstdc++-v3</TT> so that
- gcc's configure flags will be able to deal with the new library.
- <PRE>
- mv <EM>libsrcdir</EM> libstdc++-v3</PRE>
- </P>
- </P>
-
-
-<HR>
-<H2><A NAME="config">Configuring</A></H2>
- <P>If you have never done this before, you should read the basic
- <A HREF="http://gcc.gnu.org/install/">GCC Installation
- Instructions</A> first.
- </P>
- <P>Due to namespaces, when building libstdc++-v3 you'll have to configure
- the entire <EM>gccsrcdir</EM> directory. The full list of libstdc++-v3
+ </ol>
+ </p>
+
+ <p>Check out or download the gcc sources: the resulting source directory
+ (<code>gcc</code> or <code>gcc-3.0</code>, for example) is <em>gccsrcdir</em>.
+ Once in <em>gccsrcdir</em>, you'll need to rename or delete the
+ libstdc++-v3 directory which comes with that snapshot:
+ <pre>
+ mv libstdc++-v3 libstdc++-v3-previous <strong>[OR]</strong>
+ rm -r libstdc++-v3</pre>
+ </p>
+ <p>Next, unpack the libstdc++-v3 library tarball into this
+ <em>gccsrcdir</em> directory; it will create a
+ <em>libsrcdir</em> called <code>libstdc++-<em>version</em></code>:
+ <pre>
+ gzip -dc libstdc++-version.tar.gz | tar xf -</pre>
+ </p>
+ <p>Finally, rename <em>libsrcdir</em> to <code>libstdc++-v3</code> so that
+ gcc's configure flags will be able to deal with the new library.
+ <pre>
+ mv <em>libsrcdir</em> libstdc++-v3</pre>
+ </p>
+
+
+<hr>
+<h2><a name="config">Configuring</a></h2>
+ <p>If you have never done this before, you should read the basic
+ <a href="http://gcc.gnu.org/install/">GCC Installation
+ Instructions</a> first.
+ </p>
+ <p>When building libstdc++-v3 you'll have to configure
+ the entire <em>gccsrcdir</em> directory. The full list of libstdc++-v3
specific configuration options, not dependent on the specific compiler
- release being used, can be found <A HREF="configopts.html">here</A>.
- </P>
- <P>Consider possibly using --enable-languages=c++ to save time by only
+ release being used, can be found <a href="configopts.html">here</a>.
+ </p>
+ <p>Consider possibly using --enable-languages=c++ to save time by only
building the C++ language parts.
- </P>
+ </p>
- <P><PRE>
- cd <EM>gccbuilddir</EM>
- <EM>gccsrcdir</EM>/configure --prefix=<EM>destdir</EM> --other-opts...</PRE>
- </P>
+ <p><pre>
+ cd <em>gccbuilddir</em>
+ <em>gccsrcdir</em>/configure --prefix=<em>destdir</em> --other-opts...</pre>
+ </p>
-<HR>
-<H2><A NAME="install">Building and installing the library</A></H2>
- <P>Now you have a few options:</P>
- <H3>[re]building <EM>everything</EM></H3>
- <P>If you're building GCC from scratch, you can do the usual
- <TT> 'make bootstrap' </TT> here, and libstdc++-v3 will be built
+<hr>
+<h2><a name="install">Building and installing the library</a></h2>
+ <p>Now you have a few options:</p>
+ <h3>[re]building <em>everything</em></h3>
+ <p>If you're building GCC from scratch, you can do the usual
+ <code> 'make bootstrap' </code> here, and libstdc++-v3 will be built
as its default C++ library. The generated g++ will magically
use the correct headers, link against the correct library
binary, and in general using libstdc++-v3 will be a piece of
- cake. You're done; run <TT>'make install'</TT> (see the GCC
+ cake. You're done; run <code>'make install'</code> (see the GCC
installation instructions) to put the new compiler and libraries
into place.
- </P>
+ </p>
- <H3>[re]building only libstdc++</H3>
- <P>To rebuild just libstdc++, use:
- <PRE>
- make all-target-<EM>libstdc++-v3</EM></PRE>
+ <h3>[re]building only libstdc++</h3>
+ <p>To rebuild just libstdc++, use:
+ <pre>
+ make all-target-<em>libstdc++-v3</em></pre>
This will configure and build the C++ library in the
- <EM>gccbuilddir/cpu-vendor-OS/</EM>libstdc++ directory.
- </P>
- <P>If you are rebuilding from a previous build [attempt], some
+ <em>gccbuilddir/cpu-vendor-os/</em>libstdc++ directory.
+ </p>
+ <p>If you are rebuilding from a previous build [attempt], some
information is kept in a cache file. This is stored in
- <EM>gccbuilddir/cpu-vendor-OS/</EM> if you are building with
+ <em>gccbuilddir/cpu-vendor-os/</em> if you are building with
multilibs (the default), or in
- <EM>gccbuilddir/cpu-vendor-OS/</EM>libstdc++-v3 if you have
+ <em>gccbuilddir/cpu-vendor-os/</em>libstdc++-v3 if you have
multilibs disabled. The filename is config.cache; if previous
information is causing problems, you can delete it entirely, or
simply edit it and remove lines.
- </P>
- <P>You're done. Now install the rebuilt pieces with
- <PRE>
- make install</PRE>
+ </p>
+ <p>You're done. Now install the rebuilt pieces with
+ <pre>
+ make install</pre>
or
- <PRE>
+ <pre>
make install-gcc
- make install-target-libstdc++-v3</PRE>
- </P>
+ make install-target-libstdc++-v3</pre>
+ </p>
-<HR>
-<H2><A NAME="postinstall">Post-installation</A></H2>
- <P>Installation will create the <EM>destdir</EM> directory and
+<hr>
+<h2><a name="postinstall">Post-installation</a></h2>
+ <p>Installation will create the <em>destdir</em> directory and
populate it with subdirectories:
- <PRE>
+ <pre>
lib/
include/g++-v3/
+ backward/
bits/
- ext/
- CPU-vendor-OS/include/g++-v3/
- bits/
- ext/</PRE>
- </P>
- <P>You can check the status of the build without installing it using
- <PRE>
- make check</PRE>
+ <em>cpu-vendor-os</em>/bits/
+ ext/</pre>
+ </p>
+ <p>You can check the status of the build without installing it using
+ <pre>
+ make check</pre>
or you can check the status of the installed library using
- <PRE>
- make check-install</PRE>
- in the <EM>libbuilddir</EM> directory.
+ <pre>
+ make check-install</pre>
+ in the <em>libbuilddir</em> directory.
These commands will create a 'testsuite' directory underneath
- <EM>libbuilddir</EM> containing the results of the tests. We are
+ <em>libbuilddir</em> containing the results of the tests. We are
interested in any strange failures of the testsuite; please see
- <A HREF="faq/index.html#2_4">FAQ 2.4</A> for which files to examine.
- </P>
+ <a href="faq/index.html#2_4">FAQ 2.4</a> for which files to examine.
+ </p>
-<HR>
-<H2><A NAME="usage">Using the library</A></H2>
- <LI><B>Find the new library at runtime (shared linking only)</B>
- <P>If you only built a static library (libstdc++.a), or if you
+<hr>
+<h2><a name="usage">Using the library</a></h2>
+ <li><B>Find the new library at runtime (shared linking only)</B>
+ <p>If you only built a static library (libstdc++.a), or if you
specified static linking, you don't have to worry about this.
But if you built a shared library (libstdc++.so) and linked
against it, then you will need to find that library when you
run the executable.
- </P>
- <P>Methods vary for different platforms and different styles, but
+ </p>
+ <p>Methods vary for different platforms and different styles, but
the usual ones are printed to the screen during installation.
They include:
- <UL>
- <LI>At runtime set LD_LIBRARY_PATH in your environment correctly,
+ <ul>
+ <li>At runtime set LD_LIBRARY_PATH in your environment correctly,
so that the shared library for libstdc++ can be found and
loaded. Be certain that you understand all of the other
implications and behavior of LD_LIBRARY_PATH first (few
people do, and they get into trouble).
- <LI>Compile the path to find the library at runtime into the
+ <li>Compile the path to find the library at runtime into the
program. This can be done by passing certain options to g++,
which will in turn pass them on to the linker. The exact
format of the options is dependent on which linker you use:
- <UL>
- <LI>GNU ld (default on Linux):<TT> -Wl,--rpath,<EM>destdir</EM>/lib</TT>
- <LI>IRIX ld:<TT> -Wl,-rpath,<EM>destdir</EM>/lib</TT>
- <LI>Solaris ld:<TT> -Wl,-R<EM>destdir</EM>/lib</TT>
- <LI>More...?
- </UL>
- </UL>
- </P>
- <P>Use the <TT>ldd(1)</TT> utility to show which library the system
+ <ul>
+ <li>GNU ld (default on Linux):<code> -Wl,--rpath,<em>destdir</em>/lib</code>
+ <li>IRIX ld:<code> -Wl,-rpath,<em>destdir</em>/lib</code>
+ <li>Solaris ld:<code> -Wl,-R<em>destdir</em>/lib</code>
+ <li>More...?
+ </ul>
+ </ul>
+ </p>
+ <p>Use the <code>ldd(1)</code> utility to show which library the system
thinks it will get at runtime.
- </P>
- </OL>
- </P>
+ </p>
+ <p>A libstdc++.la file is also installed, for use with Libtool. If
+ you use Libtool to create your executables, these details are
+ taken care of for you.
+ </p>
+ </ol>
+ </p>
<!--
-<HR>
-<H2><A NAME=""></A></H2>
- <P>
- </P>
+<hr>
+<h2><a name=""></a></h2>
+ <p>
+ </p>
-->
<!-- ####################################################### -->
-<HR>
-<P CLASS="fineprint"><EM>
+<hr>
+<p class="fineprint"><em>
+See <a href="17_intro/license.html">license.html</a> for copying conditions.
Comments and suggestions are welcome, and may be sent to
-<A HREF="mailto:pme@sources.redhat.com">Phil Edwards</A> or
-<A HREF="mailto:gdr@gcc.gnu.org">Gabriel Dos Reis</A>.
-<BR> $Id: install.html,v 1.3 2001/01/23 17:02:26 pme Exp $
-</EM></P>
+<a href="mailto:libstdc++@gcc.gnu.org">the libstdc++ mailing list</a>.
+</em></p>
-</BODY>
-</HTML>
+</body>
+</html>
diff --git a/libstdc++-v3/include/Makefile.am b/libstdc++-v3/include/Makefile.am
new file mode 100644
index 00000000000..3b5589f6e56
--- /dev/null
+++ b/libstdc++-v3/include/Makefile.am
@@ -0,0 +1,447 @@
+## Makefile for the include subdirectory of the GNU C++ Standard library.
+##
+## Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+##
+## This file is part of the libstdc++ version 3 distribution.
+## Process this file with automake to produce Makefile.in.
+
+## 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.
+
+## $Id: Makefile.am,v 1.1.6.6 2001/08/29 00:41:56 ljrittle Exp $
+
+AUTOMAKE_OPTIONS = 1.3 gnits
+MAINT_CHARSET = latin1
+
+mkinstalldirs = $(SHELL) $(toplevel_srcdir)/mkinstalldirs
+
+# Cross compiler and multilib support.
+CXX = @glibcpp_CXX@
+glibcpp_srcdir=@glibcpp_srcdir@
+glibcpp_builddir=@glibcpp_builddir@
+
+bits_srcdir = ${glibcpp_srcdir}/include/bits
+bits_builddir = ./bits
+bits_headers = \
+ ${bits_srcdir}/basic_file.h \
+ ${bits_srcdir}/basic_ios.h \
+ ${bits_srcdir}/basic_ios.tcc \
+ ${bits_srcdir}/basic_string.h \
+ ${bits_srcdir}/basic_string.tcc \
+ ${bits_srcdir}/boost_concept_check.h \
+ ${bits_srcdir}/char_traits.h \
+ ${bits_srcdir}/codecvt.h \
+ ${bits_srcdir}/concept_check.h \
+ ${bits_srcdir}/cpp_type_traits.h \
+ ${bits_srcdir}/fpos.h \
+ ${bits_srcdir}/fstream.tcc \
+ ${bits_srcdir}/functexcept.h \
+ ${bits_srcdir}/generic_shadow.h \
+ ${bits_srcdir}/gslice.h \
+ ${bits_srcdir}/gslice_array.h \
+ ${bits_srcdir}/indirect_array.h \
+ ${bits_srcdir}/ios_base.h \
+ ${bits_srcdir}/istream.tcc \
+ ${bits_srcdir}/locale_facets.h \
+ ${bits_srcdir}/locale_facets.tcc \
+ ${bits_srcdir}/localefwd.h \
+ ${bits_srcdir}/mask_array.h \
+ ${bits_srcdir}/ostream.tcc \
+ ${bits_srcdir}/pthread_allocimpl.h \
+ ${bits_srcdir}/sbuf_iter.h \
+ ${bits_srcdir}/slice.h \
+ ${bits_srcdir}/slice_array.h \
+ ${bits_srcdir}/sstream.tcc \
+ ${bits_srcdir}/std_algorithm.h \
+ ${bits_srcdir}/std_bitset.h \
+ ${bits_srcdir}/std_complex.h \
+ ${bits_srcdir}/std_deque.h \
+ ${bits_srcdir}/std_fstream.h \
+ ${bits_srcdir}/std_functional.h \
+ ${bits_srcdir}/std_iomanip.h \
+ ${bits_srcdir}/std_ios.h \
+ ${bits_srcdir}/std_iosfwd.h \
+ ${bits_srcdir}/std_iostream.h \
+ ${bits_srcdir}/std_istream.h \
+ ${bits_srcdir}/std_iterator.h \
+ ${bits_srcdir}/std_limits.h \
+ ${bits_srcdir}/std_list.h \
+ ${bits_srcdir}/std_locale.h \
+ ${bits_srcdir}/std_map.h \
+ ${bits_srcdir}/std_memory.h \
+ ${bits_srcdir}/std_numeric.h \
+ ${bits_srcdir}/std_ostream.h \
+ ${bits_srcdir}/std_queue.h \
+ ${bits_srcdir}/std_set.h \
+ ${bits_srcdir}/std_sstream.h \
+ ${bits_srcdir}/std_stack.h \
+ ${bits_srcdir}/std_stdexcept.h \
+ ${bits_srcdir}/std_streambuf.h \
+ ${bits_srcdir}/std_string.h \
+ ${bits_srcdir}/std_utility.h \
+ ${bits_srcdir}/std_valarray.h \
+ ${bits_srcdir}/std_vector.h \
+ ${bits_srcdir}/stl_algo.h \
+ ${bits_srcdir}/stl_algobase.h \
+ ${bits_srcdir}/stl_alloc.h \
+ ${bits_srcdir}/stl_bvector.h \
+ ${bits_srcdir}/stl_construct.h \
+ ${bits_srcdir}/stl_deque.h \
+ ${bits_srcdir}/stl_function.h \
+ ${bits_srcdir}/stl_heap.h \
+ ${bits_srcdir}/stl_iterator.h \
+ ${bits_srcdir}/stl_iterator_base_funcs.h \
+ ${bits_srcdir}/stl_iterator_base_types.h \
+ ${bits_srcdir}/stl_list.h \
+ ${bits_srcdir}/stl_map.h \
+ ${bits_srcdir}/stl_multimap.h \
+ ${bits_srcdir}/stl_multiset.h \
+ ${bits_srcdir}/stl_numeric.h \
+ ${bits_srcdir}/stl_pair.h \
+ ${bits_srcdir}/stl_pthread_alloc.h \
+ ${bits_srcdir}/stl_queue.h \
+ ${bits_srcdir}/stl_raw_storage_iter.h \
+ ${bits_srcdir}/stl_relops.h \
+ ${bits_srcdir}/stl_set.h \
+ ${bits_srcdir}/stl_stack.h \
+ ${bits_srcdir}/stl_tempbuf.h \
+ ${bits_srcdir}/stl_threads.h \
+ ${bits_srcdir}/stl_tree.h \
+ ${bits_srcdir}/stl_uninitialized.h \
+ ${bits_srcdir}/stl_vector.h \
+ ${bits_srcdir}/streambuf.tcc \
+ ${bits_srcdir}/stringfwd.h \
+ ${bits_srcdir}/type_traits.h \
+ ${bits_srcdir}/valarray_array.h \
+ ${bits_srcdir}/valarray_array.tcc \
+ ${bits_srcdir}/valarray_meta.h
+
+backward_srcdir = ${glibcpp_srcdir}/include/backward
+backward_builddir = ./backward
+backward_headers = \
+ ${backward_srcdir}/complex.h \
+ ${backward_srcdir}/iomanip.h \
+ ${backward_srcdir}/istream.h \
+ ${backward_srcdir}/ostream.h \
+ ${backward_srcdir}/stream.h \
+ ${backward_srcdir}/streambuf.h \
+ ${backward_srcdir}/algo.h \
+ ${backward_srcdir}/algobase.h \
+ ${backward_srcdir}/alloc.h \
+ ${backward_srcdir}/bvector.h \
+ ${backward_srcdir}/defalloc.h \
+ ${backward_srcdir}/deque.h \
+ ${backward_srcdir}/function.h \
+ ${backward_srcdir}/hash_map.h \
+ ${backward_srcdir}/hash_set.h \
+ ${backward_srcdir}/hashtable.h \
+ ${backward_srcdir}/heap.h \
+ ${backward_srcdir}/iostream.h \
+ ${backward_srcdir}/iterator.h \
+ ${backward_srcdir}/list.h \
+ ${backward_srcdir}/map.h \
+ ${backward_srcdir}/multimap.h \
+ ${backward_srcdir}/new.h \
+ ${backward_srcdir}/multiset.h \
+ ${backward_srcdir}/pair.h \
+ ${backward_srcdir}/queue.h \
+ ${backward_srcdir}/rope.h \
+ ${backward_srcdir}/set.h \
+ ${backward_srcdir}/slist.h \
+ ${backward_srcdir}/stack.h \
+ ${backward_srcdir}/tempbuf.h \
+ ${backward_srcdir}/tree.h \
+ ${backward_srcdir}/vector.h \
+ ${backward_srcdir}/fstream.h \
+ ${backward_srcdir}/strstream.h \
+ ${backward_srcdir}/strstream \
+ ${backward_srcdir}/backward_warning.h
+
+ext_srcdir = ${glibcpp_srcdir}/include/ext
+ext_builddir = ./ext
+ext_headers = \
+ ${ext_srcdir}/rope \
+ ${ext_srcdir}/ropeimpl.h \
+ ${ext_srcdir}/stl_rope.h \
+ ${ext_srcdir}/slist \
+ ${ext_srcdir}/hash_map \
+ ${ext_srcdir}/hash_set \
+ ${ext_srcdir}/stl_hashtable.h \
+ ${ext_srcdir}/stl_hash_fun.h
+
+# This is the common subset of files that all three "C" header models use.
+c_base_srcdir = @C_INCLUDE_DIR@/bits
+c_base_builddir = ./bits
+c_base_headers = \
+ ${c_base_srcdir}/std_cassert.h \
+ ${c_base_srcdir}/std_cctype.h \
+ ${c_base_srcdir}/std_cerrno.h \
+ ${c_base_srcdir}/std_cfloat.h \
+ ${c_base_srcdir}/std_climits.h \
+ ${c_base_srcdir}/std_clocale.h \
+ ${c_base_srcdir}/std_cmath.h \
+ ${c_base_srcdir}/std_csetjmp.h \
+ ${c_base_srcdir}/std_csignal.h \
+ ${c_base_srcdir}/std_cstdarg.h \
+ ${c_base_srcdir}/std_cstddef.h \
+ ${c_base_srcdir}/std_cstdio.h \
+ ${c_base_srcdir}/std_cstdlib.h \
+ ${c_base_srcdir}/std_cstring.h \
+ ${c_base_srcdir}/std_ctime.h \
+ ${c_base_srcdir}/std_cwchar.h \
+ ${c_base_srcdir}/std_cwctype.h \
+ ${c_base_srcdir}/cmath.tcc
+
+##c_compatibility_srcdir = ${glibcpp_srcdir}/include/c_compatibility
+##c_compatibility_builddir = ./
+##c_compatibility_headers = \
+## ${c_compatibility_srcdir}/assert.h \
+## ${c_compatibility_srcdir}/ctype.h \
+## ${c_compatibility_srcdir}/errno.h \
+## ${c_compatibility_srcdir}/float.h \
+## ${c_compatibility_srcdir}/limits.h \
+## ${c_compatibility_srcdir}/locale.h \
+## ${c_compatibility_srcdir}/math.h \
+## ${c_compatibility_srcdir}/setjmp.h \
+## ${c_compatibility_srcdir}/signal.h \
+## ${c_compatibility_srcdir}/stdarg.h \
+## ${c_compatibility_srcdir}/stddef.h \
+## ${c_compatibility_srcdir}/stdio.h \
+## ${c_compatibility_srcdir}/stdlib.h \
+## ${c_compatibility_srcdir}/string.h \
+## ${c_compatibility_srcdir}/time.h \
+## ${c_compatibility_srcdir}/wchar.h \
+## ${c_compatibility_srcdir}/wctype.h
+
+std_srcdir = ${glibcpp_srcdir}/include/std
+std_builddir = ./
+std_headers = \
+ ${std_srcdir}/algorithm \
+ ${std_srcdir}/bitset \
+ ${std_srcdir}/complex \
+ ${std_srcdir}/deque \
+ ${std_srcdir}/fstream \
+ ${std_srcdir}/functional \
+ ${std_srcdir}/iomanip \
+ ${std_srcdir}/ios \
+ ${std_srcdir}/iosfwd \
+ ${std_srcdir}/iostream \
+ ${std_srcdir}/istream \
+ ${std_srcdir}/iterator \
+ ${std_srcdir}/limits \
+ ${std_srcdir}/list \
+ ${std_srcdir}/locale \
+ ${std_srcdir}/map \
+ ${std_srcdir}/memory \
+ ${std_srcdir}/numeric \
+ ${std_srcdir}/ostream \
+ ${std_srcdir}/queue \
+ ${std_srcdir}/set \
+ ${std_srcdir}/sstream \
+ ${std_srcdir}/stack \
+ ${std_srcdir}/stdexcept \
+ ${std_srcdir}/streambuf \
+ ${std_srcdir}/string \
+ ${std_srcdir}/utility \
+ ${std_srcdir}/valarray \
+ ${std_srcdir}/vector \
+ ${std_srcdir}/cassert \
+ ${std_srcdir}/cctype \
+ ${std_srcdir}/cerrno \
+ ${std_srcdir}/cfloat \
+ ${std_srcdir}/climits \
+ ${std_srcdir}/clocale \
+ ${std_srcdir}/ciso646 \
+ ${std_srcdir}/cmath \
+ ${std_srcdir}/csetjmp \
+ ${std_srcdir}/csignal \
+ ${std_srcdir}/cstdarg \
+ ${std_srcdir}/cstddef \
+ ${std_srcdir}/cstdio \
+ ${std_srcdir}/cstdlib \
+ ${std_srcdir}/cstring \
+ ${std_srcdir}/ctime \
+ ${std_srcdir}/cwchar \
+ ${std_srcdir}/cwctype
+
+target_srcdir = ${glibcpp_srcdir}/@OS_INC_SRCDIR@
+target_builddir = ./${target_alias}/bits
+target_headers = \
+ ${target_srcdir}/ctype_base.h \
+ ${target_srcdir}/ctype_inline.h \
+ ${target_srcdir}/ctype_noninline.h \
+ ${target_srcdir}/os_defines.h \
+ ${glibcpp_srcdir}/@ATOMICITY_INC_SRCDIR@/atomicity.h \
+ ${glibcpp_srcdir}/@LIMITS_INC_SRCDIR@/limits.h
+extra_target_headers = \
+ ${target_builddir}/basic_file_model.h \
+ ${target_builddir}/c++config.h \
+ ${target_builddir}/c++io.h \
+ ${target_builddir}/c++locale.h
+
+thread_builddir = ./${target_alias}/bits
+thread_headers = \
+ ${thread_builddir}/gthr.h \
+ ${thread_builddir}/gthr-single.h \
+ ${thread_builddir}/gthr-default.h
+
+# List of all timestamp files. By keeping only one copy of this list, both
+# CLEANFILES and all-local are kept up-to-date.
+# XXX stamp-c_compatibility
+allstamps = stamp-std stamp-bits stamp-c_base stamp-backward stamp-ext \
+ stamp-target stamp-thread stamp-file_model stamp-io stamp-locale
+
+# By adding these files here, automake will remove them for 'make clean'
+CLEANFILES = ${allstamps}
+
+# Here are the rules for building the headers
+all-local: \
+ ${target_builddir}/c++config.h \
+ ${allstamps}
+
+stamp-std: ${std_headers}
+ @if [ ! -d "${std_builddir}" ]; then \
+ mkdir -p ${std_builddir} ;\
+ fi ;\
+ (cd ${std_builddir} && @LN_S@ $? . || true) ;\
+ echo `date` > stamp-std
+
+stamp-bits: ${bits_headers}
+ @if [ ! -d "${bits_builddir}" ]; then \
+ mkdir -p ${bits_builddir} ;\
+ fi ;\
+ (cd ${bits_builddir} && @LN_S@ $? . || true) ;\
+ echo `date` > stamp-bits
+
+stamp-c_base: ${c_base_headers}
+ @if [ ! -d "${c_base_builddir}" ]; then \
+ mkdir -p ${c_base_builddir} ;\
+ fi ;\
+ (cd ${c_base_builddir} && @LN_S@ $? . || true) ;\
+ echo `date` > stamp-c_base
+
+stamp-c_compatibility: ${c_compatibility_headers}
+ @if [ ! -d "${c_compatibility_builddir}" ]; then \
+ mkdir -p ${c_compatibility_builddir} ;\
+ fi ;\
+ (cd ${c_compatibility_builddir} && @LN_S@ $? . || true) ;\
+ echo `date` > stamp-c_compatibility
+
+stamp-backward: ${backward_headers}
+ @if [ ! -d "${backward_builddir}" ]; then \
+ mkdir -p ${backward_builddir} ;\
+ fi ;\
+ (cd ${backward_builddir} && @LN_S@ $? . || true) ;\
+ echo `date` > stamp-backward
+
+stamp-ext: ${ext_headers}
+ @if [ ! -d "${ext_builddir}" ]; then \
+ mkdir -p ${ext_builddir} ;\
+ fi ;\
+ (cd ${ext_builddir} && @LN_S@ $? . || true) ;\
+ echo `date` > stamp-ext
+
+# Can't use $? in command, otherwise target_builddir will trigger it, and
+# we get bizarre symlinks mazes.
+stamp-target: ${target_headers} ${target_builddir}
+ @(cd ${target_builddir} && @LN_S@ ${target_headers} . || true) ;\
+ echo `date` > stamp-target
+
+stamp-thread: ${thread_headers} ${thread_builddir}
+ @echo `date` > stamp-thread
+
+stamp-file_model: ${glibcpp_srcdir}/@BASIC_FILE_H@ ${target_builddir}
+ @(cd ${target_builddir} && @LN_S@ ${glibcpp_srcdir}/@BASIC_FILE_H@ basic_file_model.h || true) ;\
+ echo `date` > stamp-file_model
+
+stamp-io: ${glibcpp_srcdir}/@CSTDIO_H@ ${target_builddir}
+ @(cd ${target_builddir} && @LN_S@ ${glibcpp_srcdir}/@CSTDIO_H@ c++io.h || true) ;\
+ echo `date` > stamp-io
+
+stamp-locale: ${glibcpp_srcdir}/@CLOCALE_H@ ${target_builddir}
+ @(cd ${target_builddir} && @LN_S@ ${glibcpp_srcdir}/@CLOCALE_H@ c++locale.h || true) ;\
+ echo `date` > stamp-locale
+
+# This target is kinda special. The timestamp on a directory gets modified
+# whenever a file it contains gets modified, and that'll throw off all the
+# build dependencies that need this target. On the other hand, someone
+# could delete the directory and not the stamp file, faking out the make.
+${target_builddir}: stamp-${target_alias}
+
+stamp-${target_alias}:
+ @if [ ! -d ${target_builddir} ]; then \
+ mkdir -p ${target_builddir} ;\
+ fi
+ echo `date` > stamp-${target_alias}
+
+${target_builddir}/c++config.h: ../config.h \
+ ${glibcpp_srcdir}/include/bits/c++config \
+ ${target_builddir}
+ @cat ${glibcpp_srcdir}/include/bits/c++config > $@ ;\
+ sed -e 's/HAVE_/_GLIBCPP_HAVE_/g' \
+ -e 's/PACKAGE/_GLIBCPP_PACKAGE/g' \
+ -e 's/VERSION/_GLIBCPP_VERSION/g' \
+ -e 's/WORDS_/_GLIBCPP_WORDS_/g' \
+ < ${glibcpp_builddir}/config.h >> $@ ;\
+ echo "#endif // _CPP_CPPCONFIG_" >>$@
+
+glibcpp_thread_h = @glibcpp_thread_h@
+uppercase = [ABCDEFGHIJKLMNOPQRSTUVWXYZ_]
+
+${thread_builddir}/gthr.h:
+ sed -e '/^#/s/\(${uppercase}${uppercase}*\)/_GLIBCPP_\1/g' \
+ -e 's,^#include "\(.*\)",#include <bits/\1>,g' \
+ < ${toplevel_srcdir}/gcc/gthr.h > $@
+
+${thread_builddir}/gthr-single.h:
+ sed -e 's/\(UNUSED\)/_GLIBCPP_\1/g' \
+ -e 's/\(GCC${uppercase}*_H\)/_GLIBCPP_\1/g' \
+ < ${toplevel_srcdir}/gcc/gthr-single.h > $@
+
+${thread_builddir}/gthr-default.h:
+ sed -e 's/\(UNUSED\)/_GLIBCPP_\1/g' \
+ -e 's/\(GCC${uppercase}*_H\)/_GLIBCPP_\1/g' \
+ -e 's/\(${uppercase}*WEAK\)/_GLIBCPP_\1/g' \
+ < ${toplevel_srcdir}/gcc/${glibcpp_thread_h} > $@
+
+# For robustness sake (in light of junk files or in-source
+# configuration), copy from the build tree to the install tree using
+# only the human-maintained file lists and directory components.
+gxx_include_dir = @gxx_include_dir@
+
+install-data-local:
+ $(INSTALL) -d ${gxx_include_dir}
+ $(INSTALL) -d ${gxx_include_dir}/${bits_builddir}
+ for file in ${bits_headers}; do \
+ $(INSTALL_DATA) $${file} ${gxx_include_dir}/${bits_builddir}; done
+ $(INSTALL) -d ${gxx_include_dir}/${backward_builddir}
+ for file in ${backward_headers}; do \
+ $(INSTALL_DATA) $${file} ${gxx_include_dir}/${backward_builddir}; done
+ $(INSTALL) -d ${gxx_include_dir}/${ext_builddir}
+ for file in ${ext_headers}; do \
+ $(INSTALL_DATA) $${file} ${gxx_include_dir}/${ext_builddir}; done
+ $(INSTALL) -d ${gxx_include_dir}/${c_base_builddir}
+ for file in ${c_base_headers}; do \
+ $(INSTALL_DATA) $${file} ${gxx_include_dir}/${c_base_builddir}; done
+ $(INSTALL) -d ${gxx_include_dir}/${std_builddir}
+ for file in ${std_headers}; do \
+ $(INSTALL_DATA) $${file} ${gxx_include_dir}/${std_builddir}; done
+ $(INSTALL) -d ${gxx_include_dir}/${target_builddir}
+ for file in ${target_headers} ${extra_target_headers}; do \
+ $(INSTALL_DATA) $${file} ${gxx_include_dir}/${target_builddir}; done
+ $(INSTALL) -d ${gxx_include_dir}/${thread_builddir}
+ for file in ${thread_headers}; do \
+ $(INSTALL_DATA) $${file} ${gxx_include_dir}/${thread_builddir}; done
diff --git a/libstdc++-v3/include/Makefile.in b/libstdc++-v3/include/Makefile.in
new file mode 100644
index 00000000000..dba4895c985
--- /dev/null
+++ b/libstdc++-v3/include/Makefile.in
@@ -0,0 +1,634 @@
+# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am
+
+# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+
+SHELL = @SHELL@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+
+bindir = @bindir@
+sbindir = @sbindir@
+libexecdir = @libexecdir@
+datadir = @datadir@
+sysconfdir = @sysconfdir@
+sharedstatedir = @sharedstatedir@
+localstatedir = @localstatedir@
+libdir = @libdir@
+infodir = @infodir@
+mandir = @mandir@
+includedir = @includedir@
+oldincludedir = /usr/include
+
+DESTDIR =
+
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+
+top_builddir = ..
+
+ACLOCAL = @ACLOCAL@
+AUTOCONF = @AUTOCONF@
+AUTOMAKE = @AUTOMAKE@
+AUTOHEADER = @AUTOHEADER@
+
+INSTALL = @INSTALL@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+transform = @program_transform_name@
+
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_alias = @build_alias@
+build_triplet = @build@
+host_alias = @host_alias@
+host_triplet = @host@
+target_alias = @target_alias@
+target_triplet = @target@
+AR = @AR@
+AS = @AS@
+ATOMICITY_INC_SRCDIR = @ATOMICITY_INC_SRCDIR@
+BASIC_FILE_H = @BASIC_FILE_H@
+CC = @CC@
+CCODECVT_C = @CCODECVT_C@
+CLOCALE_H = @CLOCALE_H@
+CPP = @CPP@
+CSHADOW_FLAGS = @CSHADOW_FLAGS@
+CSTDIO_H = @CSTDIO_H@
+CXXCPP = @CXXCPP@
+C_INCLUDE_DIR = @C_INCLUDE_DIR@
+DEBUG_FLAGS = @DEBUG_FLAGS@
+DLLTOOL = @DLLTOOL@
+EXEEXT = @EXEEXT@
+EXTRA_CXX_FLAGS = @EXTRA_CXX_FLAGS@
+GCJ = @GCJ@
+GCJFLAGS = @GCJFLAGS@
+GLIBCPP_INCLUDES = @GLIBCPP_INCLUDES@
+GLIBCPP_IS_CROSS_COMPILING = @GLIBCPP_IS_CROSS_COMPILING@
+LIBIO_INCLUDES = @LIBIO_INCLUDES@
+LIBMATHOBJS = @LIBMATHOBJS@
+LIBMATH_INCLUDES = @LIBMATH_INCLUDES@
+LIBSTRINGOBJS = @LIBSTRINGOBJS@
+LIBSUPCXX_INCLUDES = @LIBSUPCXX_INCLUDES@
+LIBSUPCXX_PICFLAGS = @LIBSUPCXX_PICFLAGS@
+LIBTOOL = @LIBTOOL@
+LIMITS_INC_SRCDIR = @LIMITS_INC_SRCDIR@
+LN_S = @LN_S@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OPTIMIZE_CXXFLAGS = @OPTIMIZE_CXXFLAGS@
+OPT_LDFLAGS = @OPT_LDFLAGS@
+OS_INC_SRCDIR = @OS_INC_SRCDIR@
+PACKAGE = @PACKAGE@
+RANLIB = @RANLIB@
+SECTION_FLAGS = @SECTION_FLAGS@
+SECTION_LDFLAGS = @SECTION_LDFLAGS@
+STRIP = @STRIP@
+TOPLEVEL_INCLUDES = @TOPLEVEL_INCLUDES@
+USE_COMPLEX_LONG_DOUBLE = @USE_COMPLEX_LONG_DOUBLE@
+VERSION = @VERSION@
+WARN_FLAGS = @WARN_FLAGS@
+WERROR = @WERROR@
+enable_shared = @enable_shared@
+enable_static = @enable_static@
+glibcpp_CXX = @glibcpp_CXX@
+glibcpp_basedir = @glibcpp_basedir@
+glibcpp_prefixdir = @glibcpp_prefixdir@
+glibcpp_toolexecdir = @glibcpp_toolexecdir@
+glibcpp_toolexeclibdir = @glibcpp_toolexeclibdir@
+ifGNUmake = @ifGNUmake@
+libio_la = @libio_la@
+toplevel_srcdir = @toplevel_srcdir@
+
+AUTOMAKE_OPTIONS = 1.3 gnits
+MAINT_CHARSET = latin1
+
+mkinstalldirs = $(SHELL) $(toplevel_srcdir)/mkinstalldirs
+
+# Cross compiler and multilib support.
+CXX = @glibcpp_CXX@
+glibcpp_srcdir = @glibcpp_srcdir@
+glibcpp_builddir = @glibcpp_builddir@
+
+bits_srcdir = ${glibcpp_srcdir}/include/bits
+bits_builddir = ./bits
+bits_headers = \
+ ${bits_srcdir}/basic_file.h \
+ ${bits_srcdir}/basic_ios.h \
+ ${bits_srcdir}/basic_ios.tcc \
+ ${bits_srcdir}/basic_string.h \
+ ${bits_srcdir}/basic_string.tcc \
+ ${bits_srcdir}/boost_concept_check.h \
+ ${bits_srcdir}/char_traits.h \
+ ${bits_srcdir}/codecvt.h \
+ ${bits_srcdir}/concept_check.h \
+ ${bits_srcdir}/cpp_type_traits.h \
+ ${bits_srcdir}/fpos.h \
+ ${bits_srcdir}/fstream.tcc \
+ ${bits_srcdir}/functexcept.h \
+ ${bits_srcdir}/generic_shadow.h \
+ ${bits_srcdir}/gslice.h \
+ ${bits_srcdir}/gslice_array.h \
+ ${bits_srcdir}/indirect_array.h \
+ ${bits_srcdir}/ios_base.h \
+ ${bits_srcdir}/istream.tcc \
+ ${bits_srcdir}/locale_facets.h \
+ ${bits_srcdir}/locale_facets.tcc \
+ ${bits_srcdir}/localefwd.h \
+ ${bits_srcdir}/mask_array.h \
+ ${bits_srcdir}/ostream.tcc \
+ ${bits_srcdir}/pthread_allocimpl.h \
+ ${bits_srcdir}/sbuf_iter.h \
+ ${bits_srcdir}/slice.h \
+ ${bits_srcdir}/slice_array.h \
+ ${bits_srcdir}/sstream.tcc \
+ ${bits_srcdir}/std_algorithm.h \
+ ${bits_srcdir}/std_bitset.h \
+ ${bits_srcdir}/std_complex.h \
+ ${bits_srcdir}/std_deque.h \
+ ${bits_srcdir}/std_fstream.h \
+ ${bits_srcdir}/std_functional.h \
+ ${bits_srcdir}/std_iomanip.h \
+ ${bits_srcdir}/std_ios.h \
+ ${bits_srcdir}/std_iosfwd.h \
+ ${bits_srcdir}/std_iostream.h \
+ ${bits_srcdir}/std_istream.h \
+ ${bits_srcdir}/std_iterator.h \
+ ${bits_srcdir}/std_limits.h \
+ ${bits_srcdir}/std_list.h \
+ ${bits_srcdir}/std_locale.h \
+ ${bits_srcdir}/std_map.h \
+ ${bits_srcdir}/std_memory.h \
+ ${bits_srcdir}/std_numeric.h \
+ ${bits_srcdir}/std_ostream.h \
+ ${bits_srcdir}/std_queue.h \
+ ${bits_srcdir}/std_set.h \
+ ${bits_srcdir}/std_sstream.h \
+ ${bits_srcdir}/std_stack.h \
+ ${bits_srcdir}/std_stdexcept.h \
+ ${bits_srcdir}/std_streambuf.h \
+ ${bits_srcdir}/std_string.h \
+ ${bits_srcdir}/std_utility.h \
+ ${bits_srcdir}/std_valarray.h \
+ ${bits_srcdir}/std_vector.h \
+ ${bits_srcdir}/stl_algo.h \
+ ${bits_srcdir}/stl_algobase.h \
+ ${bits_srcdir}/stl_alloc.h \
+ ${bits_srcdir}/stl_bvector.h \
+ ${bits_srcdir}/stl_construct.h \
+ ${bits_srcdir}/stl_deque.h \
+ ${bits_srcdir}/stl_function.h \
+ ${bits_srcdir}/stl_heap.h \
+ ${bits_srcdir}/stl_iterator.h \
+ ${bits_srcdir}/stl_iterator_base_funcs.h \
+ ${bits_srcdir}/stl_iterator_base_types.h \
+ ${bits_srcdir}/stl_list.h \
+ ${bits_srcdir}/stl_map.h \
+ ${bits_srcdir}/stl_multimap.h \
+ ${bits_srcdir}/stl_multiset.h \
+ ${bits_srcdir}/stl_numeric.h \
+ ${bits_srcdir}/stl_pair.h \
+ ${bits_srcdir}/stl_pthread_alloc.h \
+ ${bits_srcdir}/stl_queue.h \
+ ${bits_srcdir}/stl_raw_storage_iter.h \
+ ${bits_srcdir}/stl_relops.h \
+ ${bits_srcdir}/stl_set.h \
+ ${bits_srcdir}/stl_stack.h \
+ ${bits_srcdir}/stl_tempbuf.h \
+ ${bits_srcdir}/stl_threads.h \
+ ${bits_srcdir}/stl_tree.h \
+ ${bits_srcdir}/stl_uninitialized.h \
+ ${bits_srcdir}/stl_vector.h \
+ ${bits_srcdir}/streambuf.tcc \
+ ${bits_srcdir}/stringfwd.h \
+ ${bits_srcdir}/type_traits.h \
+ ${bits_srcdir}/valarray_array.h \
+ ${bits_srcdir}/valarray_array.tcc \
+ ${bits_srcdir}/valarray_meta.h
+
+
+backward_srcdir = ${glibcpp_srcdir}/include/backward
+backward_builddir = ./backward
+backward_headers = \
+ ${backward_srcdir}/complex.h \
+ ${backward_srcdir}/iomanip.h \
+ ${backward_srcdir}/istream.h \
+ ${backward_srcdir}/ostream.h \
+ ${backward_srcdir}/stream.h \
+ ${backward_srcdir}/streambuf.h \
+ ${backward_srcdir}/algo.h \
+ ${backward_srcdir}/algobase.h \
+ ${backward_srcdir}/alloc.h \
+ ${backward_srcdir}/bvector.h \
+ ${backward_srcdir}/defalloc.h \
+ ${backward_srcdir}/deque.h \
+ ${backward_srcdir}/function.h \
+ ${backward_srcdir}/hash_map.h \
+ ${backward_srcdir}/hash_set.h \
+ ${backward_srcdir}/hashtable.h \
+ ${backward_srcdir}/heap.h \
+ ${backward_srcdir}/iostream.h \
+ ${backward_srcdir}/iterator.h \
+ ${backward_srcdir}/list.h \
+ ${backward_srcdir}/map.h \
+ ${backward_srcdir}/multimap.h \
+ ${backward_srcdir}/new.h \
+ ${backward_srcdir}/multiset.h \
+ ${backward_srcdir}/pair.h \
+ ${backward_srcdir}/queue.h \
+ ${backward_srcdir}/rope.h \
+ ${backward_srcdir}/set.h \
+ ${backward_srcdir}/slist.h \
+ ${backward_srcdir}/stack.h \
+ ${backward_srcdir}/tempbuf.h \
+ ${backward_srcdir}/tree.h \
+ ${backward_srcdir}/vector.h \
+ ${backward_srcdir}/fstream.h \
+ ${backward_srcdir}/strstream.h \
+ ${backward_srcdir}/strstream \
+ ${backward_srcdir}/backward_warning.h
+
+
+ext_srcdir = ${glibcpp_srcdir}/include/ext
+ext_builddir = ./ext
+ext_headers = \
+ ${ext_srcdir}/rope \
+ ${ext_srcdir}/ropeimpl.h \
+ ${ext_srcdir}/stl_rope.h \
+ ${ext_srcdir}/slist \
+ ${ext_srcdir}/hash_map \
+ ${ext_srcdir}/hash_set \
+ ${ext_srcdir}/stl_hashtable.h \
+ ${ext_srcdir}/stl_hash_fun.h
+
+
+# This is the common subset of files that all three "C" header models use.
+c_base_srcdir = @C_INCLUDE_DIR@/bits
+c_base_builddir = ./bits
+c_base_headers = \
+ ${c_base_srcdir}/std_cassert.h \
+ ${c_base_srcdir}/std_cctype.h \
+ ${c_base_srcdir}/std_cerrno.h \
+ ${c_base_srcdir}/std_cfloat.h \
+ ${c_base_srcdir}/std_climits.h \
+ ${c_base_srcdir}/std_clocale.h \
+ ${c_base_srcdir}/std_cmath.h \
+ ${c_base_srcdir}/std_csetjmp.h \
+ ${c_base_srcdir}/std_csignal.h \
+ ${c_base_srcdir}/std_cstdarg.h \
+ ${c_base_srcdir}/std_cstddef.h \
+ ${c_base_srcdir}/std_cstdio.h \
+ ${c_base_srcdir}/std_cstdlib.h \
+ ${c_base_srcdir}/std_cstring.h \
+ ${c_base_srcdir}/std_ctime.h \
+ ${c_base_srcdir}/std_cwchar.h \
+ ${c_base_srcdir}/std_cwctype.h \
+ ${c_base_srcdir}/cmath.tcc
+
+
+std_srcdir = ${glibcpp_srcdir}/include/std
+std_builddir = ./
+std_headers = \
+ ${std_srcdir}/algorithm \
+ ${std_srcdir}/bitset \
+ ${std_srcdir}/complex \
+ ${std_srcdir}/deque \
+ ${std_srcdir}/fstream \
+ ${std_srcdir}/functional \
+ ${std_srcdir}/iomanip \
+ ${std_srcdir}/ios \
+ ${std_srcdir}/iosfwd \
+ ${std_srcdir}/iostream \
+ ${std_srcdir}/istream \
+ ${std_srcdir}/iterator \
+ ${std_srcdir}/limits \
+ ${std_srcdir}/list \
+ ${std_srcdir}/locale \
+ ${std_srcdir}/map \
+ ${std_srcdir}/memory \
+ ${std_srcdir}/numeric \
+ ${std_srcdir}/ostream \
+ ${std_srcdir}/queue \
+ ${std_srcdir}/set \
+ ${std_srcdir}/sstream \
+ ${std_srcdir}/stack \
+ ${std_srcdir}/stdexcept \
+ ${std_srcdir}/streambuf \
+ ${std_srcdir}/string \
+ ${std_srcdir}/utility \
+ ${std_srcdir}/valarray \
+ ${std_srcdir}/vector \
+ ${std_srcdir}/cassert \
+ ${std_srcdir}/cctype \
+ ${std_srcdir}/cerrno \
+ ${std_srcdir}/cfloat \
+ ${std_srcdir}/climits \
+ ${std_srcdir}/clocale \
+ ${std_srcdir}/ciso646 \
+ ${std_srcdir}/cmath \
+ ${std_srcdir}/csetjmp \
+ ${std_srcdir}/csignal \
+ ${std_srcdir}/cstdarg \
+ ${std_srcdir}/cstddef \
+ ${std_srcdir}/cstdio \
+ ${std_srcdir}/cstdlib \
+ ${std_srcdir}/cstring \
+ ${std_srcdir}/ctime \
+ ${std_srcdir}/cwchar \
+ ${std_srcdir}/cwctype
+
+
+target_srcdir = ${glibcpp_srcdir}/@OS_INC_SRCDIR@
+target_builddir = ./${target_alias}/bits
+target_headers = \
+ ${target_srcdir}/ctype_base.h \
+ ${target_srcdir}/ctype_inline.h \
+ ${target_srcdir}/ctype_noninline.h \
+ ${target_srcdir}/os_defines.h \
+ ${glibcpp_srcdir}/@ATOMICITY_INC_SRCDIR@/atomicity.h \
+ ${glibcpp_srcdir}/@LIMITS_INC_SRCDIR@/limits.h
+
+extra_target_headers = ${target_builddir}/basic_file_model.h ${target_builddir}/c++config.h ${target_builddir}/c++io.h ${target_builddir}/c++locale.h
+
+
+thread_builddir = ./${target_alias}/bits
+thread_headers = \
+ ${thread_builddir}/gthr.h \
+ ${thread_builddir}/gthr-single.h \
+ ${thread_builddir}/gthr-default.h
+
+
+# List of all timestamp files. By keeping only one copy of this list, both
+# CLEANFILES and all-local are kept up-to-date.
+# XXX stamp-c_compatibility
+allstamps = stamp-std stamp-bits stamp-c_base stamp-backward stamp-ext \
+ stamp-target stamp-thread stamp-file_model stamp-io stamp-locale
+
+
+# By adding these files here, automake will remove them for 'make clean'
+CLEANFILES = ${allstamps}
+
+glibcpp_thread_h = @glibcpp_thread_h@
+uppercase = [ABCDEFGHIJKLMNOPQRSTUVWXYZ_]
+
+# For robustness sake (in light of junk files or in-source
+# configuration), copy from the build tree to the install tree using
+# only the human-maintained file lists and directory components.
+gxx_include_dir = @gxx_include_dir@
+CONFIG_HEADER = ../config.h
+CONFIG_CLEAN_FILES =
+DIST_COMMON = Makefile.am Makefile.in
+
+
+DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+
+TAR = tar
+GZIP_ENV = --best
+all: all-redirect
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+ cd $(top_srcdir) && $(AUTOMAKE) --cygnus include/Makefile
+
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ cd $(top_builddir) \
+ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+tags: TAGS
+TAGS:
+
+
+distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
+
+subdir = include
+
+distdir: $(DISTFILES)
+ @for file in $(DISTFILES); do \
+ if test -f $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ cp -pr $$d/$$file $(distdir)/$$file; \
+ else \
+ test -f $(distdir)/$$file \
+ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
+ || cp -p $$d/$$file $(distdir)/$$file || :; \
+ fi; \
+ done
+info-am:
+info: info-am
+dvi-am:
+dvi: dvi-am
+check-am:
+check: check-am
+installcheck-am:
+installcheck: installcheck-am
+install-info-am:
+install-info: install-info-am
+install-exec-am:
+install-exec: install-exec-am
+
+install-data-am: install-data-local
+install-data: install-data-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+install: install-am
+uninstall-am:
+uninstall: uninstall-am
+all-am: Makefile all-local
+all-redirect: all-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
+installdirs:
+
+
+mostlyclean-generic:
+
+clean-generic:
+ -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+ -rm -f Makefile $(CONFIG_CLEAN_FILES)
+ -rm -f config.cache config.log stamp-h stamp-h[0-9]*
+
+maintainer-clean-generic:
+mostlyclean-am: mostlyclean-generic
+
+mostlyclean: mostlyclean-am
+
+clean-am: clean-generic mostlyclean-am
+
+clean: clean-am
+
+distclean-am: distclean-generic clean-am
+ -rm -f libtool
+
+distclean: distclean-am
+
+maintainer-clean-am: maintainer-clean-generic distclean-am
+ @echo "This command is intended for maintainers to use;"
+ @echo "it deletes files that may require special tools to rebuild."
+
+maintainer-clean: maintainer-clean-am
+
+.PHONY: tags distdir info-am info dvi-am dvi check check-am \
+installcheck-am installcheck install-info-am install-info \
+install-exec-am install-exec install-data-local 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
+
+
+# Here are the rules for building the headers
+all-local: \
+ ${target_builddir}/c++config.h \
+ ${allstamps}
+
+stamp-std: ${std_headers}
+ @if [ ! -d "${std_builddir}" ]; then \
+ mkdir -p ${std_builddir} ;\
+ fi ;\
+ (cd ${std_builddir} && @LN_S@ $? . || true) ;\
+ echo `date` > stamp-std
+
+stamp-bits: ${bits_headers}
+ @if [ ! -d "${bits_builddir}" ]; then \
+ mkdir -p ${bits_builddir} ;\
+ fi ;\
+ (cd ${bits_builddir} && @LN_S@ $? . || true) ;\
+ echo `date` > stamp-bits
+
+stamp-c_base: ${c_base_headers}
+ @if [ ! -d "${c_base_builddir}" ]; then \
+ mkdir -p ${c_base_builddir} ;\
+ fi ;\
+ (cd ${c_base_builddir} && @LN_S@ $? . || true) ;\
+ echo `date` > stamp-c_base
+
+stamp-c_compatibility: ${c_compatibility_headers}
+ @if [ ! -d "${c_compatibility_builddir}" ]; then \
+ mkdir -p ${c_compatibility_builddir} ;\
+ fi ;\
+ (cd ${c_compatibility_builddir} && @LN_S@ $? . || true) ;\
+ echo `date` > stamp-c_compatibility
+
+stamp-backward: ${backward_headers}
+ @if [ ! -d "${backward_builddir}" ]; then \
+ mkdir -p ${backward_builddir} ;\
+ fi ;\
+ (cd ${backward_builddir} && @LN_S@ $? . || true) ;\
+ echo `date` > stamp-backward
+
+stamp-ext: ${ext_headers}
+ @if [ ! -d "${ext_builddir}" ]; then \
+ mkdir -p ${ext_builddir} ;\
+ fi ;\
+ (cd ${ext_builddir} && @LN_S@ $? . || true) ;\
+ echo `date` > stamp-ext
+
+# Can't use $? in command, otherwise target_builddir will trigger it, and
+# we get bizarre symlinks mazes.
+stamp-target: ${target_headers} ${target_builddir}
+ @(cd ${target_builddir} && @LN_S@ ${target_headers} . || true) ;\
+ echo `date` > stamp-target
+
+stamp-thread: ${thread_headers} ${thread_builddir}
+ @echo `date` > stamp-thread
+
+stamp-file_model: ${glibcpp_srcdir}/@BASIC_FILE_H@ ${target_builddir}
+ @(cd ${target_builddir} && @LN_S@ ${glibcpp_srcdir}/@BASIC_FILE_H@ basic_file_model.h || true) ;\
+ echo `date` > stamp-file_model
+
+stamp-io: ${glibcpp_srcdir}/@CSTDIO_H@ ${target_builddir}
+ @(cd ${target_builddir} && @LN_S@ ${glibcpp_srcdir}/@CSTDIO_H@ c++io.h || true) ;\
+ echo `date` > stamp-io
+
+stamp-locale: ${glibcpp_srcdir}/@CLOCALE_H@ ${target_builddir}
+ @(cd ${target_builddir} && @LN_S@ ${glibcpp_srcdir}/@CLOCALE_H@ c++locale.h || true) ;\
+ echo `date` > stamp-locale
+
+# This target is kinda special. The timestamp on a directory gets modified
+# whenever a file it contains gets modified, and that'll throw off all the
+# build dependencies that need this target. On the other hand, someone
+# could delete the directory and not the stamp file, faking out the make.
+${target_builddir}: stamp-${target_alias}
+
+stamp-${target_alias}:
+ @if [ ! -d ${target_builddir} ]; then \
+ mkdir -p ${target_builddir} ;\
+ fi
+ echo `date` > stamp-${target_alias}
+
+${target_builddir}/c++config.h: ../config.h \
+ ${glibcpp_srcdir}/include/bits/c++config \
+ ${target_builddir}
+ @cat ${glibcpp_srcdir}/include/bits/c++config > $@ ;\
+ sed -e 's/HAVE_/_GLIBCPP_HAVE_/g' \
+ -e 's/PACKAGE/_GLIBCPP_PACKAGE/g' \
+ -e 's/VERSION/_GLIBCPP_VERSION/g' \
+ -e 's/WORDS_/_GLIBCPP_WORDS_/g' \
+ < ${glibcpp_builddir}/config.h >> $@ ;\
+ echo "#endif // _CPP_CPPCONFIG_" >>$@
+
+${thread_builddir}/gthr.h:
+ sed -e '/^#/s/\(${uppercase}${uppercase}*\)/_GLIBCPP_\1/g' \
+ -e 's,^#include "\(.*\)",#include <bits/\1>,g' \
+ < ${toplevel_srcdir}/gcc/gthr.h > $@
+
+${thread_builddir}/gthr-single.h:
+ sed -e 's/\(UNUSED\)/_GLIBCPP_\1/g' \
+ -e 's/\(GCC${uppercase}*_H\)/_GLIBCPP_\1/g' \
+ < ${toplevel_srcdir}/gcc/gthr-single.h > $@
+
+${thread_builddir}/gthr-default.h:
+ sed -e 's/\(UNUSED\)/_GLIBCPP_\1/g' \
+ -e 's/\(GCC${uppercase}*_H\)/_GLIBCPP_\1/g' \
+ -e 's/\(${uppercase}*WEAK\)/_GLIBCPP_\1/g' \
+ < ${toplevel_srcdir}/gcc/${glibcpp_thread_h} > $@
+
+install-data-local:
+ $(INSTALL) -d ${gxx_include_dir}
+ $(INSTALL) -d ${gxx_include_dir}/${bits_builddir}
+ for file in ${bits_headers}; do \
+ $(INSTALL_DATA) $${file} ${gxx_include_dir}/${bits_builddir}; done
+ $(INSTALL) -d ${gxx_include_dir}/${backward_builddir}
+ for file in ${backward_headers}; do \
+ $(INSTALL_DATA) $${file} ${gxx_include_dir}/${backward_builddir}; done
+ $(INSTALL) -d ${gxx_include_dir}/${ext_builddir}
+ for file in ${ext_headers}; do \
+ $(INSTALL_DATA) $${file} ${gxx_include_dir}/${ext_builddir}; done
+ $(INSTALL) -d ${gxx_include_dir}/${c_base_builddir}
+ for file in ${c_base_headers}; do \
+ $(INSTALL_DATA) $${file} ${gxx_include_dir}/${c_base_builddir}; done
+ $(INSTALL) -d ${gxx_include_dir}/${std_builddir}
+ for file in ${std_headers}; do \
+ $(INSTALL_DATA) $${file} ${gxx_include_dir}/${std_builddir}; done
+ $(INSTALL) -d ${gxx_include_dir}/${target_builddir}
+ for file in ${target_headers} ${extra_target_headers}; do \
+ $(INSTALL_DATA) $${file} ${gxx_include_dir}/${target_builddir}; done
+ $(INSTALL) -d ${gxx_include_dir}/${thread_builddir}
+ for file in ${thread_headers}; do \
+ $(INSTALL_DATA) $${file} ${gxx_include_dir}/${thread_builddir}; done
+
+# 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.
+.NOEXPORT:
diff --git a/libstdc++-v3/include/backward/algo.h b/libstdc++-v3/include/backward/algo.h
index b46d3242309..3f53f0554b4 100644
--- a/libstdc++-v3/include/backward/algo.h
+++ b/libstdc++-v3/include/backward/algo.h
@@ -1,3 +1,32 @@
+// Backward-compat support -*- C++ -*-
+
+// Copyright (C) 2001 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.
+
/*
*
* Copyright (c) 1994
@@ -27,85 +56,83 @@
#ifndef _CPP_BACKWARD_ALGO_H
#define _CPP_BACKWARD_ALGO_H 1
+#include "backward_warning.h"
#include "algobase.h"
#include "tempbuf.h"
+#include "iterator.h"
#include <bits/stl_algo.h>
#include <bits/stl_numeric.h>
-#ifdef __STL_USE_NAMESPACES
-
// Names from <stl_algo.h>
-using __STD::for_each;
-using __STD::find;
-using __STD::find_if;
-using __STD::adjacent_find;
-using __STD::count;
-using __STD::count_if;
-using __STD::search;
-using __STD::search_n;
-using __STD::swap_ranges;
-using __STD::transform;
-using __STD::replace;
-using __STD::replace_if;
-using __STD::replace_copy;
-using __STD::replace_copy_if;
-using __STD::generate;
-using __STD::generate_n;
-using __STD::remove;
-using __STD::remove_if;
-using __STD::remove_copy;
-using __STD::remove_copy_if;
-using __STD::unique;
-using __STD::unique_copy;
-using __STD::reverse;
-using __STD::reverse_copy;
-using __STD::rotate;
-using __STD::rotate_copy;
-using __STD::random_shuffle;
-using __STD::random_sample;
-using __STD::random_sample_n;
-using __STD::partition;
-using __STD::stable_partition;
-using __STD::sort;
-using __STD::stable_sort;
-using __STD::partial_sort;
-using __STD::partial_sort_copy;
-using __STD::nth_element;
-using __STD::lower_bound;
-using __STD::upper_bound;
-using __STD::equal_range;
-using __STD::binary_search;
-using __STD::merge;
-using __STD::inplace_merge;
-using __STD::includes;
-using __STD::set_union;
-using __STD::set_intersection;
-using __STD::set_difference;
-using __STD::set_symmetric_difference;
-using __STD::min_element;
-using __STD::max_element;
-using __STD::next_permutation;
-using __STD::prev_permutation;
-using __STD::find_first_of;
-using __STD::find_end;
-using __STD::is_sorted;
-using __STD::is_heap;
+using std::for_each;
+using std::find;
+using std::find_if;
+using std::adjacent_find;
+using std::count;
+using std::count_if;
+using std::search;
+using std::search_n;
+using std::swap_ranges;
+using std::transform;
+using std::replace;
+using std::replace_if;
+using std::replace_copy;
+using std::replace_copy_if;
+using std::generate;
+using std::generate_n;
+using std::remove;
+using std::remove_if;
+using std::remove_copy;
+using std::remove_copy_if;
+using std::unique;
+using std::unique_copy;
+using std::reverse;
+using std::reverse_copy;
+using std::rotate;
+using std::rotate_copy;
+using std::random_shuffle;
+using std::random_sample;
+using std::random_sample_n;
+using std::partition;
+using std::stable_partition;
+using std::sort;
+using std::stable_sort;
+using std::partial_sort;
+using std::partial_sort_copy;
+using std::nth_element;
+using std::lower_bound;
+using std::upper_bound;
+using std::equal_range;
+using std::binary_search;
+using std::merge;
+using std::inplace_merge;
+using std::includes;
+using std::set_union;
+using std::set_intersection;
+using std::set_difference;
+using std::set_symmetric_difference;
+using std::min_element;
+using std::max_element;
+using std::next_permutation;
+using std::prev_permutation;
+using std::find_first_of;
+using std::find_end;
+using std::is_sorted;
+using std::is_heap;
// Names from stl_heap.h
-using __STD::push_heap;
-using __STD::pop_heap;
-using __STD::make_heap;
-using __STD::sort_heap;
+using std::push_heap;
+using std::pop_heap;
+using std::make_heap;
+using std::sort_heap;
// Names from stl_numeric.h
-using __STD::accumulate;
-using __STD::inner_product;
-using __STD::partial_sum;
-using __STD::adjacent_difference;
-using __STD::power;
-using __STD::iota;
-
-#endif /* __STL_USE_NAMESPACES */
+using std::accumulate;
+using std::inner_product;
+using std::partial_sum;
+using std::adjacent_difference;
+using std::power;
+using std::iota;
#endif /* _CPP_BACKWARD_ALGO_H */
diff --git a/libstdc++-v3/include/backward/algobase.h b/libstdc++-v3/include/backward/algobase.h
index b5c807a882f..3818c768d2a 100644
--- a/libstdc++-v3/include/backward/algobase.h
+++ b/libstdc++-v3/include/backward/algobase.h
@@ -1,3 +1,32 @@
+// Backward-compat support -*- C++ -*-
+
+// Copyright (C) 2001 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.
+
/*
*
* Copyright (c) 1994
@@ -26,43 +55,32 @@
#ifndef _CPP_BACKWARD_ALGOBASE_H
#define _CPP_BACKWARD_ALGOBASE_H 1
-#ifndef _CPP_BACKWARD_PAIR_H
+#include "backward_warning.h"
#include "pair.h"
-#endif
-#ifndef _CPP_BACKWARD_ITERATOR_H
#include "iterator.h"
-#endif
-#ifndef _CPP_BITS_STL__ALGOBASE_H
#include <bits/stl_algobase.h>
-#endif
-#ifndef _CPP_BITS_STL_UNINITIALIZED_H
#include <bits/stl_uninitialized.h>
-#endif
-
-#ifdef __STL_USE_NAMESPACES
// Names from stl_algobase.h
-using __STD::iter_swap;
-using __STD::swap;
-using __STD::min;
-using __STD::max;
-using __STD::copy;
-using __STD::copy_backward;
-using __STD::copy_n;
-using __STD::fill;
-using __STD::fill_n;
-using __STD::mismatch;
-using __STD::equal;
-using __STD::lexicographical_compare;
-using __STD::lexicographical_compare_3way;
+using std::iter_swap;
+using std::swap;
+using std::min;
+using std::max;
+using std::copy;
+using std::copy_backward;
+using std::copy_n;
+using std::fill;
+using std::fill_n;
+using std::mismatch;
+using std::equal;
+using std::lexicographical_compare;
+using std::lexicographical_compare_3way;
// Names from stl_uninitialized.h
-using __STD::uninitialized_copy;
-using __STD::uninitialized_copy_n;
-using __STD::uninitialized_fill;
-using __STD::uninitialized_fill_n;
-
-#endif /* __STL_USE_NAMESPACES */
+using std::uninitialized_copy;
+using std::uninitialized_copy_n;
+using std::uninitialized_fill;
+using std::uninitialized_fill_n;
#endif /* _CPP_BACKWARD_ALGOBASE_H */
diff --git a/libstdc++-v3/include/backward/alloc.h b/libstdc++-v3/include/backward/alloc.h
index 3ec1304a8e7..094ccd9e260 100644
--- a/libstdc++-v3/include/backward/alloc.h
+++ b/libstdc++-v3/include/backward/alloc.h
@@ -1,3 +1,32 @@
+// Backward-compat support -*- C++ -*-
+
+// Copyright (C) 2001 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.
+
/*
* Copyright (c) 1996-1997
* Silicon Graphics Computer Systems, Inc.
@@ -14,32 +43,20 @@
#ifndef _CPP_BACKWARD_ALLOC_H
#define _CPP_BACKWARD_ALLOC_H 1
-#ifndef _CPP_BITS_STL_CONFIG_H
-#include <bits/stl_config.h>
-#endif
-#ifndef _CPP_BITS_STL_ALLOC_H
+#include "backward_warning.h"
+#include <bits/c++config.h>
#include <bits/stl_alloc.h>
-#endif
-
-#ifdef __STL_USE_NAMESPACES
-using __STD::__malloc_alloc_template;
-using __STD::malloc_alloc;
-using __STD::simple_alloc;
-using __STD::debug_alloc;
+using std::__malloc_alloc_template;
+using std::malloc_alloc;
+using std::simple_alloc;
+using std::debug_alloc;
#ifndef __USE_MALLOC
-using __STD::__default_alloc_template;
+using std::__default_alloc_template;
#endif
-using __STD::alloc;
-using __STD::single_client_alloc;
-#ifdef __STL_STATIC_TEMPLATE_MEMBER_BUG
-using __STD::__malloc_alloc_oom_handler;
-#endif /* __STL_STATIC_TEMPLATE_MEMBER_BUG */
-#ifdef __STL_USE_STD_ALLOCATORS
-using __STD::allocator;
-#endif /* __STL_USE_STD_ALLOCATORS */
-
-#endif /* __STL_USE_NAMESPACES */
+using std::alloc;
+using std::single_client_alloc;
+using std::allocator;
#endif /* _CPP_BACKWARD_ALLOC_H */
diff --git a/libstdc++-v3/include/backward/backward_warning.h b/libstdc++-v3/include/backward/backward_warning.h
new file mode 100644
index 00000000000..991541553de
--- /dev/null
+++ b/libstdc++-v3/include/backward/backward_warning.h
@@ -0,0 +1,38 @@
+// Copyright (C) 2001 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.
+
+#ifndef _CPP_BACKWARD_BACKWARD_WARNING_H
+#define _CPP_BACKWARD_BACKWARD_WARNING_H 1
+
+#ifdef __DEPRECATED
+#warning This file includes at least one deprecated or antiquated header. \
+ Please use the <X> header instead of <X.h> header for 'C++' includes \
+ and use the <cX> header instead of <X.h> header for 'C' includes. \
+ To disable this warning use -Wno-deprecated.
+#endif
+
+#endif
diff --git a/libstdc++-v3/include/backward/bvector.h b/libstdc++-v3/include/backward/bvector.h
index ed922540485..4a04ca691d7 100644
--- a/libstdc++-v3/include/backward/bvector.h
+++ b/libstdc++-v3/include/backward/bvector.h
@@ -1,3 +1,32 @@
+// Backward-compat support -*- C++ -*-
+
+// Copyright (C) 2001 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.
+
/*
*
* Copyright (c) 1994
@@ -24,25 +53,16 @@
* purpose. It is provided "as is" without express or implied warranty.
*/
-#ifndef _CPP_BACKWARD_BVECTOR_H
-#define _CPP_BACKWARD_BVECTOR_H 1
-
-#ifdef __STL_CLASS_PARTIAL_SPECIALIZATION
-#include "vector.h"
-#else
-#include "algobase.h"
-#include "alloc.h"
-#endif
-
-#include <bits/stl_bvector.h>
+#ifndef __SGI_STL_BVECTOR_H
+#define __SGI_STL_BVECTOR_H
-#ifdef __STL_USE_NAMESPACES
-using __STD::bit_vector;
+#include "backward_warning.h"
+#include <bits/std_vector.h>
-#endif /* __STL_USE_NAMESPACES */
+using std::bit_vector;
-#endif /* _CPP_BACKWARD_BVECTOR_H */
+#endif /* __SGI_STL_BVECTOR_H */
// Local Variables:
// mode:C++
diff --git a/libstdc++-v3/include/backward/complex.h b/libstdc++-v3/include/backward/complex.h
index 055eef9af11..c7e1d1c1bec 100644
--- a/libstdc++-v3/include/backward/complex.h
+++ b/libstdc++-v3/include/backward/complex.h
@@ -28,6 +28,7 @@
#ifndef _CPP_BACKWARD_COMPLEX_H
#define _CPP_BACKWARD_COMPLEX_H 1
+#include "backward_warning.h"
#include <bits/std_complex.h>
using std::complex;
diff --git a/libstdc++-v3/include/backward/defalloc.h b/libstdc++-v3/include/backward/defalloc.h
index 8edee690bc6..264e2967c3c 100644
--- a/libstdc++-v3/include/backward/defalloc.h
+++ b/libstdc++-v3/include/backward/defalloc.h
@@ -1,3 +1,32 @@
+// Backward-compat support -*- C++ -*-
+
+// Copyright (C) 2001 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.
+
/*
*
* Copyright (c) 1994
@@ -26,6 +55,7 @@
#ifndef _CPP_BACKWARD_DEFALLOC_H
#define _CPP_BACKWARD_DEFALLOC_H 1
+#include "backward_warning.h"
#include "new.h"
#include <stddef.h>
#include <stdlib.h>
diff --git a/libstdc++-v3/include/backward/deque.h b/libstdc++-v3/include/backward/deque.h
index fc47056c5ee..de4bf6a9a33 100644
--- a/libstdc++-v3/include/backward/deque.h
+++ b/libstdc++-v3/include/backward/deque.h
@@ -1,3 +1,32 @@
+// Backward-compat support -*- C++ -*-
+
+// Copyright (C) 2001 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.
+
/*
*
* Copyright (c) 1994
@@ -27,13 +56,12 @@
#ifndef _CPP_BACKWARD_DEQUE_H
#define _CPP_BACKWARD_DEQUE_H 1
+#include "backward_warning.h"
#include "algobase.h"
#include "alloc.h"
#include <bits/std_deque.h>
-#ifdef __STL_USE_NAMESPACES
-using __STD::deque;
-#endif /* __STL_USE_NAMESPACES */
+using std::deque;
#endif /* _CPP_BACKWARD_DEQUE_H */
diff --git a/libstdc++-v3/include/backward/fstream.h b/libstdc++-v3/include/backward/fstream.h
index b98ee3c4c40..4f03e4c6c84 100644
--- a/libstdc++-v3/include/backward/fstream.h
+++ b/libstdc++-v3/include/backward/fstream.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2000 Free Software Foundation, Inc.
+// Copyright (C) 2000, 2001 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
@@ -28,16 +28,21 @@
#ifndef _CPP_BACKWARD_FSTREAM_H
#define _CPP_BACKWARD_FSTREAM_H 1
+#include "backward_warning.h"
#include <bits/std_fstream.h>
+using std::filebuf;
using std::ifstream;
using std::ofstream;
using std::fstream;
+using std::streampos;
#ifdef _GLIBCPP_USE_WCHAR_T
+using std::wfilebuf;
using std::wifstream;
using std::wofstream;
using std::wfstream;
+using std::wstreampos;
#endif
#endif
diff --git a/libstdc++-v3/include/backward/function.h b/libstdc++-v3/include/backward/function.h
index 7988ae99c2b..219126d8825 100644
--- a/libstdc++-v3/include/backward/function.h
+++ b/libstdc++-v3/include/backward/function.h
@@ -1,3 +1,32 @@
+// Backward-compat support -*- C++ -*-
+
+// Copyright (C) 2001 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.
+
/*
*
* Copyright (c) 1994
@@ -27,89 +56,69 @@
#ifndef _CPP_BACKWARD_FUNCTION_H
#define _CPP_BACKWARD_FUNCTION_H 1
-#ifndef _CPP_BITS_STL_CONFIG_H
-#include <bits/stl_config.h>
-#endif
-#ifndef _CPP_BITS_STL_RELOPS
-#include <bits/stl_relops.h>
-#endif
+#include "backward_warning.h"
+#include <bits/c++config.h>
#include <stddef.h>
-#ifndef _CPP_BITS_STL_FUNCTION_H
#include <bits/stl_function.h>
-#endif
-
-#ifdef __STL_USE_NAMESPACE_FOR_RELOPS
-
-// Names from stl_relops.h
-using __STD_RELOPS::operator!=;
-using __STD_RELOPS::operator>;
-using __STD_RELOPS::operator<=;
-using __STD_RELOPS::operator>=;
-
-#endif /* __STL_USE_NAMESPACE_FOR_RELOPS */
-
-#ifdef __STL_USE_NAMESPACES
// Names from stl_function.h
-using __STD::unary_function;
-using __STD::binary_function;
-using __STD::plus;
-using __STD::minus;
-using __STD::multiplies;
-using __STD::divides;
-using __STD::identity_element;
-using __STD::modulus;
-using __STD::negate;
-using __STD::equal_to;
-using __STD::not_equal_to;
-using __STD::greater;
-using __STD::less;
-using __STD::greater_equal;
-using __STD::less_equal;
-using __STD::logical_and;
-using __STD::logical_or;
-using __STD::logical_not;
-using __STD::unary_negate;
-using __STD::binary_negate;
-using __STD::not1;
-using __STD::not2;
-using __STD::binder1st;
-using __STD::binder2nd;
-using __STD::bind1st;
-using __STD::bind2nd;
-using __STD::unary_compose;
-using __STD::binary_compose;
-using __STD::compose1;
-using __STD::compose2;
-using __STD::pointer_to_unary_function;
-using __STD::pointer_to_binary_function;
-using __STD::ptr_fun;
-using __STD::identity;
-using __STD::select1st;
-using __STD::select2nd;
-using __STD::project1st;
-using __STD::project2nd;
-using __STD::constant_void_fun;
-using __STD::constant_unary_fun;
-using __STD::constant_binary_fun;
-using __STD::constant0;
-using __STD::constant1;
-using __STD::constant2;
-using __STD::subtractive_rng;
-using __STD::mem_fun_t;
-using __STD::const_mem_fun_t;
-using __STD::mem_fun_ref_t;
-using __STD::const_mem_fun_ref_t;
-using __STD::mem_fun1_t;
-using __STD::const_mem_fun1_t;
-using __STD::mem_fun1_ref_t;
-using __STD::const_mem_fun1_ref_t;
-using __STD::mem_fun;
-using __STD::mem_fun_ref;
-using __STD::mem_fun1;
-using __STD::mem_fun1_ref;
-
-#endif /* __STL_USE_NAMESPACES */
+using std::unary_function;
+using std::binary_function;
+using std::plus;
+using std::minus;
+using std::multiplies;
+using std::divides;
+using std::identity_element;
+using std::modulus;
+using std::negate;
+using std::equal_to;
+using std::not_equal_to;
+using std::greater;
+using std::less;
+using std::greater_equal;
+using std::less_equal;
+using std::logical_and;
+using std::logical_or;
+using std::logical_not;
+using std::unary_negate;
+using std::binary_negate;
+using std::not1;
+using std::not2;
+using std::binder1st;
+using std::binder2nd;
+using std::bind1st;
+using std::bind2nd;
+using std::unary_compose;
+using std::binary_compose;
+using std::compose1;
+using std::compose2;
+using std::pointer_to_unary_function;
+using std::pointer_to_binary_function;
+using std::ptr_fun;
+using std::identity;
+using std::select1st;
+using std::select2nd;
+using std::project1st;
+using std::project2nd;
+using std::constant_void_fun;
+using std::constant_unary_fun;
+using std::constant_binary_fun;
+using std::constant0;
+using std::constant1;
+using std::constant2;
+using std::subtractive_rng;
+using std::mem_fun_t;
+using std::const_mem_fun_t;
+using std::mem_fun_ref_t;
+using std::const_mem_fun_ref_t;
+using std::mem_fun1_t;
+using std::const_mem_fun1_t;
+using std::mem_fun1_ref_t;
+using std::const_mem_fun1_ref_t;
+using std::mem_fun;
+using std::mem_fun_ref;
+using std::mem_fun1;
+using std::mem_fun1_ref;
#endif /* _CPP_BACKWARD_FUNCTION_H */
diff --git a/libstdc++-v3/include/backward/hash_map.h b/libstdc++-v3/include/backward/hash_map.h
index ebf0cb8f84b..7976bb3c48e 100644
--- a/libstdc++-v3/include/backward/hash_map.h
+++ b/libstdc++-v3/include/backward/hash_map.h
@@ -1,3 +1,32 @@
+// Backward-compat support -*- C++ -*-
+
+// Copyright (C) 2001 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.
+
/*
* Copyright (c) 1996
* Silicon Graphics Computer Systems, Inc.
@@ -27,20 +56,14 @@
#ifndef _CPP_BACKWARD_HASH_MAP_H
#define _CPP_BACKWARD_HASH_MAP_H 1
-#ifndef _CPP_BITS_STL_HASHTABLE_H
-#include <bits/stl_hashtable.h>
-#endif
-
+#include "backward_warning.h"
#include "algobase.h"
-#include <bits/stl_hash_map.h>
-
-#ifdef __STL_USE_NAMESPACES
-using __STD::hash;
-using __STD::hashtable;
-using __STD::hash_map;
-using __STD::hash_multimap;
-#endif /* __STL_USE_NAMESPACES */
+#include <ext/hash_map>
+using std::hash;
+using std::hashtable;
+using std::hash_map;
+using std::hash_multimap;
#endif /* _CPP_BACKWARD_HASH_MAP_H */
diff --git a/libstdc++-v3/include/backward/hash_set.h b/libstdc++-v3/include/backward/hash_set.h
index 140ce6048c6..ce4539b73f4 100644
--- a/libstdc++-v3/include/backward/hash_set.h
+++ b/libstdc++-v3/include/backward/hash_set.h
@@ -1,3 +1,32 @@
+// Backward-compat support -*- C++ -*-
+
+// Copyright (C) 2001 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.
+
/*
* Copyright (c) 1996
* Silicon Graphics Computer Systems, Inc.
@@ -27,18 +56,14 @@
#ifndef _CPP_BACKWARD_HASH_SET_H
#define _CPP_BACKWARD_HASH_SET_H 1
-#ifndef _CPP_BITS_STL_HASHTABLE_H
-#include <bits/stl_hashtable.h>
-#endif
-
+#include "backward_warning.h"
#include "algobase.h"
-#include <bits/stl_hash_set.h>
+#include <ext/hash_set>
-#ifdef __STL_USE_NAMESPACES
-using __STD::hash;
-using __STD::hashtable;
-using __STD::hash_set;
-using __STD::hash_multiset;
-#endif /* __STL_USE_NAMESPACES */
+using std::hash;
+using std::hashtable;
+using std::hash_set;
+using std::hash_multiset;
#endif /* _CPP_BACKWARD_HASH_SET_H */
+
diff --git a/libstdc++-v3/include/backward/hashtable.h b/libstdc++-v3/include/backward/hashtable.h
index bd0f4f47433..06d60986306 100644
--- a/libstdc++-v3/include/backward/hashtable.h
+++ b/libstdc++-v3/include/backward/hashtable.h
@@ -1,3 +1,32 @@
+// Backward-compat support -*- C++ -*-
+
+// Copyright (C) 2001 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.
+
/*
* Copyright (c) 1996,1997
* Silicon Graphics Computer Systems, Inc.
@@ -31,15 +60,14 @@
#ifndef _CPP_BACKWARD_HASHTABLE_H
#define _CPP_BACKWARD_HASHTABLE_H 1
-#include <bits/stl_hashtable.h>
+#include "backward_warning.h"
+#include <ext/stl_hashtable.h>
#include "algo.h"
#include "alloc.h"
#include "vector.h"
-#ifdef __STL_USE_NAMESPACES
-using __STD::hash;
-using __STD::hashtable;
-#endif /* __STL_USE_NAMESPACES */
+using std::hash;
+using std::hashtable;
#endif /* _CPP_BACKWARD_HASHTABLE_H */
diff --git a/libstdc++-v3/include/backward/heap.h b/libstdc++-v3/include/backward/heap.h
index 0256fc62e7e..9308f0e7267 100644
--- a/libstdc++-v3/include/backward/heap.h
+++ b/libstdc++-v3/include/backward/heap.h
@@ -1,3 +1,32 @@
+// Backward-compat support -*- C++ -*-
+
+// Copyright (C) 2001 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.
+
/*
*
* Copyright (c) 1994
@@ -26,18 +55,14 @@
#ifndef _CPP_BACKWARD_HEAP_H
#define _CPP_BACKWARD_HEAP_H 1
-#include <bits/stl_config.h>
+#include "backward_warning.h"
+#include <bits/c++config.h>
#include <bits/stl_heap.h>
-#ifdef __STL_USE_NAMESPACES
-
-using __STD::push_heap;
-using __STD::pop_heap;
-using __STD::make_heap;
-using __STD::sort_heap;
-
-#endif /* __STL_USE_NAMESPACES */
-
+using std::push_heap;
+using std::pop_heap;
+using std::make_heap;
+using std::sort_heap;
#endif /* _CPP_BACKWARD_HEAP_H */
diff --git a/libstdc++-v3/include/backward/iomanip.h b/libstdc++-v3/include/backward/iomanip.h
index 432252c5914..dad183edde1 100644
--- a/libstdc++-v3/include/backward/iomanip.h
+++ b/libstdc++-v3/include/backward/iomanip.h
@@ -28,9 +28,34 @@
#ifndef _CPP_BACKWARD_IOMANIP_H
#define _CPP_BACKWARD_IOMANIP_H 1
-#include <iostream.h>
+#include "backward_warning.h"
+#include "iostream.h"
#include <bits/std_iomanip.h>
+// These are from <ios> as per [27.4].
+using std::boolalpha;
+using std::noboolalpha;
+using std::showbase;
+using std::noshowbase;
+using std::showpoint;
+using std::noshowpoint;
+using std::showpos;
+using std::noshowpos;
+using std::skipws;
+using std::noskipws;
+using std::uppercase;
+using std::nouppercase;
+using std::internal;
+using std::left;
+using std::right;
+using std::dec;
+using std::hex;
+using std::oct;
+using std::fixed;
+using std::scientific;
+
+// These are from <iomanip> as per [27.6]. Manipulators from <istream>
+// and <ostream> (e.g., endl) are made available via <iostream.h>.
using std::resetiosflags;
using std::setiosflags;
using std::setbase;
diff --git a/libstdc++-v3/include/backward/iostream.h b/libstdc++-v3/include/backward/iostream.h
index 7656bce6638..0d258af1434 100644
--- a/libstdc++-v3/include/backward/iostream.h
+++ b/libstdc++-v3/include/backward/iostream.h
@@ -28,6 +28,7 @@
#ifndef _CPP_BACKWARD_IOSTREAM_H
#define _CPP_BACKWARD_IOSTREAM_H 1
+#include "backward_warning.h"
#include <bits/std_iostream.h>
using std::iostream;
@@ -47,8 +48,10 @@ using std::wcerr;
using std::wclog;
#endif
+using std::ws;
using std::endl;
using std::ends;
+using std::flush;
#endif
diff --git a/libstdc++-v3/include/backward/istream.h b/libstdc++-v3/include/backward/istream.h
index 57ea07e95de..059e7742e2f 100644
--- a/libstdc++-v3/include/backward/istream.h
+++ b/libstdc++-v3/include/backward/istream.h
@@ -28,7 +28,8 @@
#ifndef _CPP_BACKWARD_ISTREAM_H
#define _CPP_BACKWARD_ISTREAM_H 1
-#include <iostream.h>
+#include "backward_warning.h"
+#include "iostream.h"
#endif
diff --git a/libstdc++-v3/include/backward/iterator.h b/libstdc++-v3/include/backward/iterator.h
index 40185036b3b..8403d95abe8 100644
--- a/libstdc++-v3/include/backward/iterator.h
+++ b/libstdc++-v3/include/backward/iterator.h
@@ -1,3 +1,32 @@
+// Backward-compat support -*- C++ -*-
+
+// Copyright (C) 2001 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.
+
/*
*
* Copyright (c) 1994
@@ -27,75 +56,59 @@
#ifndef _CPP_BACKWARD_ITERATOR_H
#define _CPP_BACKWARD_ITERATOR_H 1
-#ifndef _CPP_BACKWARD_FUNCTION_H
+#include "backward_warning.h"
#include "function.h"
-#endif
#include <stddef.h>
#include "iostream.h"
-#ifndef _CPP_BITS_STL_ITERATOR_H
-#include <bits/stl_iterator.h>
-#endif
-#ifndef _CPP_BITS_TYPE_TRAITS_H
-#include <bits/type_traits.h>
-#endif
-#ifndef _CPP_BITS_STL_CONSTRUCT_H
+#include "iterator.h"
+
#include <bits/stl_construct.h>
-#endif
-#ifndef _CPP_BITS_STL_RAW_STORAGE_ITERATOR_H
#include <bits/stl_raw_storage_iter.h>
-#endif
-
-#ifdef __STL_USE_NAMESPACES
// Names from stl_iterator.h
-
-using __STD::input_iterator_tag;
-using __STD::output_iterator_tag;
-using __STD::forward_iterator_tag;
-using __STD::bidirectional_iterator_tag;
-using __STD::random_access_iterator_tag;
+using std::input_iterator_tag;
+using std::output_iterator_tag;
+using std::forward_iterator_tag;
+using std::bidirectional_iterator_tag;
+using std::random_access_iterator_tag;
#if 0
-using __STD::iterator;
-#endif
-using __STD::input_iterator;
-using __STD::output_iterator;
-using __STD::forward_iterator;
-using __STD::bidirectional_iterator;
-using __STD::random_access_iterator;
-
-#ifdef __STL_CLASS_PARTIAL_SPECIALIZATION
-using __STD::iterator_traits;
+using std::iterator;
#endif
+using std::input_iterator;
+using std::output_iterator;
+using std::forward_iterator;
+using std::bidirectional_iterator;
+using std::random_access_iterator;
+
+using std::iterator_traits;
-using __STD::iterator_category;
-using __STD::distance_type;
-using __STD::value_type;
+using std::iterator_category;
+using std::distance_type;
+using std::value_type;
-using __STD::distance;
-using __STD::advance;
+using std::distance;
+using std::advance;
-using __STD::insert_iterator;
-using __STD::front_insert_iterator;
-using __STD::back_insert_iterator;
-using __STD::inserter;
-using __STD::front_inserter;
-using __STD::back_inserter;
+using std::insert_iterator;
+using std::front_insert_iterator;
+using std::back_insert_iterator;
+using std::inserter;
+using std::front_inserter;
+using std::back_inserter;
-using __STD::reverse_iterator;
-using __STD::reverse_bidirectional_iterator;
+using std::reverse_iterator;
+using std::reverse_bidirectional_iterator;
-using __STD::istream_iterator;
-using __STD::ostream_iterator;
+using std::istream_iterator;
+using std::ostream_iterator;
// Names from stl_construct.h
-using __STD::construct;
-using __STD::destroy;
+using std::construct;
+using std::destroy;
// Names from stl_raw_storage_iter.h
-using __STD::raw_storage_iterator;
-
-#endif /* __STL_USE_NAMESPACES */
+using std::raw_storage_iterator;
#endif /* _CPP_BACKWARD_ITERATOR_H */
diff --git a/libstdc++-v3/include/backward/list.h b/libstdc++-v3/include/backward/list.h
index 9a719ff9594..e9db48cb9b8 100644
--- a/libstdc++-v3/include/backward/list.h
+++ b/libstdc++-v3/include/backward/list.h
@@ -1,3 +1,32 @@
+// Backward-compat support -*- C++ -*-
+
+// Copyright (C) 2001 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.
+
/*
*
* Copyright (c) 1994
@@ -27,13 +56,12 @@
#ifndef _CPP_BACKWARD_LIST_H
#define _CPP_BACKWARD_LIST_H 1
-#include <bits/stl_algobase.h>
+#include "backward_warning.h"
+#include "algobase.h"
#include "alloc.h"
#include <bits/std_list.h>
-#ifdef __STL_USE_NAMESPACES
-using __STD::list;
-#endif /* __STL_USE_NAMESPACES */
+using std::list;
#endif /* _CPP_BACKWARD_LIST_H */
diff --git a/libstdc++-v3/include/backward/map.h b/libstdc++-v3/include/backward/map.h
index cf0fe2bc638..fb7911a370a 100644
--- a/libstdc++-v3/include/backward/map.h
+++ b/libstdc++-v3/include/backward/map.h
@@ -1,3 +1,32 @@
+// Backward-compat support -*- C++ -*-
+
+// Copyright (C) 2001 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.
+
/*
*
* Copyright (c) 1994
@@ -27,12 +56,11 @@
#ifndef _CPP_BACKWARD_MAP_H
#define _CPP_BACKWARD_MAP_H 1
+#include "backward_warning.h"
#include "tree.h"
-#include <bits/stl_map.h>
+#include <bits/std_map.h>
-#ifdef __STL_USE_NAMESPACES
-using __STD::map;
-#endif /* __STL_USE_NAMESPACES */
+using std::map;
#endif /* _CPP_BACKWARD_MAP_H */
diff --git a/libstdc++-v3/include/backward/multimap.h b/libstdc++-v3/include/backward/multimap.h
index 157e3331aa9..2b36dd3121a 100644
--- a/libstdc++-v3/include/backward/multimap.h
+++ b/libstdc++-v3/include/backward/multimap.h
@@ -1,3 +1,32 @@
+// Backward-compat support -*- C++ -*-
+
+// Copyright (C) 2001 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.
+
/*
*
* Copyright (c) 1994
@@ -27,12 +56,11 @@
#ifndef _CPP_BACKWARD_MULTIMAP_H
#define _CPP_BACKWARD_MULTIMAP_H 1
+#include "backward_warning.h"
#include "tree.h"
-#include <bits/stl_multimap.h>
+#include <bits/std_map.h>
-#ifdef __STL_USE_NAMESPACES
-using __STD::multimap;
-#endif /* __STL_USE_NAMESPACES */
+using std::multimap;
#endif /* _CPP_BACKWARD_MULTIMAP_H */
diff --git a/libstdc++-v3/include/backward/multiset.h b/libstdc++-v3/include/backward/multiset.h
index 270a5da8ca3..fb2c02c9ea2 100644
--- a/libstdc++-v3/include/backward/multiset.h
+++ b/libstdc++-v3/include/backward/multiset.h
@@ -1,3 +1,32 @@
+// Backward-compat support -*- C++ -*-
+
+// Copyright (C) 2001 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.
+
/*
*
* Copyright (c) 1994
@@ -27,12 +56,11 @@
#ifndef _CPP_BACKWARD_MULTISET_H
#define _CPP_BACKWARD_MULTISET_H 1
+#include "backward_warning.h"
#include "tree.h"
-#include <bits/stl_multiset.h>
+#include <bits/std_set.h>
-#ifdef __STL_USE_NAMESPACES
-using __STD::multiset;
-#endif /* __STL_USE_NAMESPACES */
+using std::multiset;
#endif /* _CPP_BACKWARD_MULTISET_H */
diff --git a/libstdc++-v3/include/backward/new.h b/libstdc++-v3/include/backward/new.h
index e888126cf77..8e4c5c93997 100644
--- a/libstdc++-v3/include/backward/new.h
+++ b/libstdc++-v3/include/backward/new.h
@@ -30,6 +30,7 @@
#ifndef _CPP_BACKWARD_NEW_H
#define _CPP_BACKWARD_NEW_H 1
+#include "backward_warning.h"
#include <new>
using std::bad_alloc;
diff --git a/libstdc++-v3/include/backward/ostream.h b/libstdc++-v3/include/backward/ostream.h
index 7b4878563de..4c74756192e 100644
--- a/libstdc++-v3/include/backward/ostream.h
+++ b/libstdc++-v3/include/backward/ostream.h
@@ -28,7 +28,8 @@
#ifndef _CPP_BACKWARD_OSTREAM_H
#define _CPP_BACKWARD_OSTREAM_H 1
-#include <iostream.h>
+#include "backward_warning.h"
+#include "iostream.h"
#endif
diff --git a/libstdc++-v3/include/backward/pair.h b/libstdc++-v3/include/backward/pair.h
index 275a205bb6e..f0ff7d7d689 100644
--- a/libstdc++-v3/include/backward/pair.h
+++ b/libstdc++-v3/include/backward/pair.h
@@ -1,3 +1,32 @@
+// Backward-compat support -*- C++ -*-
+
+// Copyright (C) 2001 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.
+
/*
*
* Copyright (c) 1994
@@ -27,22 +56,12 @@
#ifndef _CPP_BACKWARD_PAIR_H
#define _CPP_BACKWARD_PAIR_H 1
-#ifndef _CPP_BITS_STL_CONFIG_H
-#include <bits/stl_config.h>
-#endif
-#ifndef _CPP_BITS_STL_RELOPS_H
-#include <bits/stl_relops.h>
-#endif
-#ifndef _CPP_BITS_STL_PAIR_H
+#include "backward_warning.h"
+#include <bits/c++config.h>
#include <bits/stl_pair.h>
-#endif
-
-#ifdef __STL_USE_NAMESPACES
-
-using __STD::pair;
-using __STD::make_pair;
-#endif /* __STL_USE_NAMESPACES */
+using std::pair;
+using std::make_pair;
#endif /* _CPP_BACKWARD_PAIR_H */
diff --git a/libstdc++-v3/include/backward/queue.h b/libstdc++-v3/include/backward/queue.h
new file mode 100644
index 00000000000..6eaf246a18b
--- /dev/null
+++ b/libstdc++-v3/include/backward/queue.h
@@ -0,0 +1,41 @@
+// Copyright (C) 2001 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.
+
+#ifndef _CPP_BACKWARD_QUEUE_H
+#define _CPP_BACKWARD_QUEUE_H 1
+
+#include "backward_warning.h"
+#include <bits/std_queue.h>
+
+using std::queue;
+using std::priority_queue;
+
+#endif
+
+// Local Variables:
+// mode:C++
+// End:
diff --git a/libstdc++-v3/include/backward/rope.h b/libstdc++-v3/include/backward/rope.h
index 7d32f87497e..bcb43ec748a 100644
--- a/libstdc++-v3/include/backward/rope.h
+++ b/libstdc++-v3/include/backward/rope.h
@@ -1,3 +1,32 @@
+// Backward-compat support -*- C++ -*-
+
+// Copyright (C) 2001 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.
+
/*
* Copyright (c) 1997
* Silicon Graphics Computer Systems, Inc.
@@ -14,18 +43,15 @@
#ifndef _CPP_BACKWARD_ROPE_H
#define _CPP_BACKWARD_ROPE_H 1
+#include "backward_warning.h"
#include "hashtable.h"
-#include <bits/stl_rope.h>
-
-#ifdef __STL_USE_NAMESPACES
-
-using __STD::char_producer;
-using __STD::sequence_buffer;
-using __STD::rope;
-using __STD::crope;
-using __STD::wrope;
+#include <ext/rope>
-#endif /* __STL_USE_NAMESPACES */
+using std::char_producer;
+using std::sequence_buffer;
+using std::rope;
+using std::crope;
+using std::wrope;
#endif /* _CPP_BACKWARD_ROPE_H */
diff --git a/libstdc++-v3/include/backward/set.h b/libstdc++-v3/include/backward/set.h
index e05890e046e..ae4011a1dae 100644
--- a/libstdc++-v3/include/backward/set.h
+++ b/libstdc++-v3/include/backward/set.h
@@ -1,3 +1,32 @@
+// Backward-compat support -*- C++ -*-
+
+// Copyright (C) 2001 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.
+
/*
*
* Copyright (c) 1994
@@ -27,12 +56,11 @@
#ifndef _CPP_BACKWARD_SET_H
#define _CPP_BACKWARD_SET_H 1
+#include "backward_warning.h"
#include "tree.h"
-#include <bits/stl_set.h>
+#include <bits/std_set.h>
-#ifdef __STL_USE_NAMESPACES
-using __STD::set;
-#endif /* __STL_USE_NAMESPACES */
+using std::set;
#endif /* _CPP_BACKWARD_SET_H */
diff --git a/libstdc++-v3/include/backward/slist.h b/libstdc++-v3/include/backward/slist.h
index 8c63282d1ca..aee3f80e892 100644
--- a/libstdc++-v3/include/backward/slist.h
+++ b/libstdc++-v3/include/backward/slist.h
@@ -1,3 +1,32 @@
+// Backward-compat support -*- C++ -*-
+
+// Copyright (C) 2001 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.
+
/*
* Copyright (c) 1997
* Silicon Graphics Computer Systems, Inc.
@@ -15,11 +44,10 @@
#ifndef _CPP_BACKWARD_SLIST_H
#define _CPP_BACKWARD_SLIST_H 1
+#include "backward_warning.h"
#include <ext/slist>
-#ifdef __STL_USE_NAMESPACES
-using __STD::slist;
-#endif /* __STL_USE_NAMESPACES */
+using std::slist;
#endif /* _CPP_BACKWARD_SLIST_H */
diff --git a/libstdc++-v3/include/backward/stack.h b/libstdc++-v3/include/backward/stack.h
index 4140f409970..19e8cd17534 100644
--- a/libstdc++-v3/include/backward/stack.h
+++ b/libstdc++-v3/include/backward/stack.h
@@ -1,3 +1,32 @@
+// Backward-compat support -*- C++ -*-
+
+// Copyright (C) 2001 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.
+
/*
*
* Copyright (c) 1994
@@ -27,17 +56,14 @@
#ifndef _CPP_BACKWARD_STACK_H
#define _CPP_BACKWARD_STACK_H 1
+#include "backward_warning.h"
#include "vector.h"
#include "deque.h"
#include "heap.h"
-#include <bits/stl_stack.h>
-#include <bits/stl_queue.h>
-
-#ifdef __STL_USE_NAMESPACES
-using __STD::stack;
-using __STD::queue;
-using __STD::priority_queue;
-#endif /* __STL_USE_NAMESPACES */
+#include "queue.h"
+#include <bits/std_stack.h>
+
+using std::stack;
#endif /* _CPP_BACKWARD_STACK_H */
diff --git a/libstdc++-v3/include/backward/stream.h b/libstdc++-v3/include/backward/stream.h
index 15c32b821f1..21a851decd8 100644
--- a/libstdc++-v3/include/backward/stream.h
+++ b/libstdc++-v3/include/backward/stream.h
@@ -28,7 +28,8 @@
#ifndef _CPP_BACKWARD_STREAM_H
#define _CPP_BACKWARD_STREAM_H 1
-#include <iostream.h>
+#include "backward_warning.h"
+#include "iostream.h"
#endif
diff --git a/libstdc++-v3/include/backward/streambuf.h b/libstdc++-v3/include/backward/streambuf.h
index a0df9f6440d..3965816dc45 100644
--- a/libstdc++-v3/include/backward/streambuf.h
+++ b/libstdc++-v3/include/backward/streambuf.h
@@ -28,6 +28,7 @@
#ifndef _CPP_BACKWARD_STREAMBUF_H
#define _CPP_BACKWARD_STREAMBUF_H 1
+#include "backward_warning.h"
#include <bits/std_streambuf.h>
using std::streambuf;
diff --git a/libstdc++-v3/include/backward/strstream b/libstdc++-v3/include/backward/strstream
index 0a6a129f4ef..f60010c4712 100644
--- a/libstdc++-v3/include/backward/strstream
+++ b/libstdc++-v3/include/backward/strstream
@@ -1,3 +1,32 @@
+// Backward-compat support -*- C++ -*-
+
+// Copyright (C) 2001 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.
+
/*
* Copyright (c) 1998
* Silicon Graphics Computer Systems, Inc.
@@ -19,17 +48,15 @@
#ifndef __SGI_STL_STRSTREAM
#define __SGI_STL_STRSTREAM
-#if defined(__sgi) && !defined(__GNUC__) && !defined(_STANDARD_C_PLUS_PLUS)
-#error This header file requires the -LANG:std option
-#endif
-
+#include "backward_warning.h"
#include <bits/std_iosfwd.h>
#include <bits/std_ios.h>
#include <bits/std_istream.h>
#include <bits/std_ostream.h>
#include <bits/std_string.h>
-__STL_BEGIN_NAMESPACE
+namespace std
+{
//----------------------------------------------------------------------
// Class strstreambuf, a streambuf class that manages an array of char.
@@ -150,7 +177,7 @@ private:
strstreambuf _M_buf;
};
-__STL_END_NAMESPACE
+} // namespace std
#endif /* __SGI_STL_STRSTREAM */
diff --git a/libstdc++-v3/include/backward/strstream.h b/libstdc++-v3/include/backward/strstream.h
index 3918141a14b..82802d2f86a 100644
--- a/libstdc++-v3/include/backward/strstream.h
+++ b/libstdc++-v3/include/backward/strstream.h
@@ -30,7 +30,7 @@
#ifndef _CPP_BACKWARD_STRSTREAM_H
#define _CPP_BACKWARD_STRSTREAM_H 1
-#include <strstream>
+#include "strstream"
using std::strstreambuf;
using std::istrstream;
diff --git a/libstdc++-v3/include/backward/tempbuf.h b/libstdc++-v3/include/backward/tempbuf.h
index 82e5c8e811b..eb46ea88f2b 100644
--- a/libstdc++-v3/include/backward/tempbuf.h
+++ b/libstdc++-v3/include/backward/tempbuf.h
@@ -1,3 +1,32 @@
+// Backward-compat support -*- C++ -*-
+
+// Copyright (C) 2001 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.
+
/*
*
* Copyright (c) 1994
@@ -27,33 +56,20 @@
#ifndef _CPP_BACKWARD_TEMPBUF_H
#define _CPP_BACKWARD_TEMPBUF_H 1
-#ifndef _CPP_BACKWARD_PAIR_H
+#include "backward_warning.h"
#include "pair.h"
-#endif
-#include <iterator.h>
+#include "iterator.h"
#include <limits.h>
#include <stddef.h>
#include <stdlib.h>
-#ifndef _CPP_BITS_TYPE_TRAITS_H
#include <bits/type_traits.h>
-#endif
-#ifndef _CPP_BITS_STL_CONSTRUCT_H
#include <bits/stl_construct.h>
-#endif
-#ifndef _CPP_BITS_STL_UNINITIALIZED_H
#include <bits/stl_uninitialized.h>
-#endif
-#ifndef _CPP_BITS_STL_TEMPBUF_H
#include <bits/stl_tempbuf.h>
-#endif
-
-#ifdef __STL_USE_NAMESPACES
-
-using __STD::get_temporary_buffer;
-using __STD::return_temporary_buffer;
-using __STD::_Temporary_buffer;
-#endif /* __STL_USE_NAMESPACES */
+using std::get_temporary_buffer;
+using std::return_temporary_buffer;
+using std::temporary_buffer;
#endif /* _CPP_BACKWARD_TEMPBUF_H */
diff --git a/libstdc++-v3/include/backward/tree.h b/libstdc++-v3/include/backward/tree.h
index 64e89ad36fe..d88dbcb4441 100644
--- a/libstdc++-v3/include/backward/tree.h
+++ b/libstdc++-v3/include/backward/tree.h
@@ -1,6 +1,34 @@
+// Backward-compat support -*- C++ -*-
+
+// Copyright (C) 2001 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.
+
/*
- *
- * Copyright (c) 1996,1997
+ * Copyright (c) 1997
* Silicon Graphics Computer Systems, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
@@ -11,36 +39,17 @@
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*
- *
- * Copyright (c) 1994
- * Hewlett-Packard Company
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Hewlett-Packard Company makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- *
*/
-#ifndef _CPP_BACKWARD_TREE_H
-#define _CPP_BACKWARD_TREE_H 1
+#ifndef _CPP_EXT_TREE
+#define _CPP_EXT_TREE 1
-#ifndef _CPP_BITS_STL_TREE_H
+#include "backward_warning.h"
#include <bits/stl_tree.h>
-#endif
-#include "algobase.h"
-#include "alloc.h"
-
-#ifdef __STL_USE_NAMESPACES
-using __STD::rb_tree;
-#endif /* __STL_USE_NAMESPACES */
-#endif /* _CPP_BACKWARD_TREE_H */
+using std::rb_tree;
+#endif
// Local Variables:
// mode:C++
// End:
diff --git a/libstdc++-v3/include/backward/vector.h b/libstdc++-v3/include/backward/vector.h
index 8a7e8f94040..1746cb25f27 100644
--- a/libstdc++-v3/include/backward/vector.h
+++ b/libstdc++-v3/include/backward/vector.h
@@ -1,3 +1,32 @@
+// Backward-compat support -*- C++ -*-
+
+// Copyright (C) 2001 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.
+
/*
*
* Copyright (c) 1994
@@ -27,13 +56,12 @@
#ifndef _CPP_BACKWARD_VECTOR_H
#define _CPP_BACKWARD_VECTOR_H 1
+#include "backward_warning.h"
#include "algobase.h"
#include "alloc.h"
-#include <bits/stl_vector.h>
+#include <bits/std_vector.h>
-#ifdef __STL_USE_NAMESPACES
-using __STD::vector;
-#endif /* __STL_USE_NAMESPACES */
+using std::vector;
#endif /* _CPP_BACKWARD_VECTOR_H */
diff --git a/libstdc++-v3/include/bits/basic_file.h b/libstdc++-v3/include/bits/basic_file.h
index f3fb4735647..65081a0af10 100644
--- a/libstdc++-v3/include/bits/basic_file.h
+++ b/libstdc++-v3/include/bits/basic_file.h
@@ -1,6 +1,6 @@
// Wrapper of C-language FILE struct -*- C++ -*-
-// Copyright (C) 1999, 2000 Free Software Foundation, Inc.
+// Copyright (C) 1999, 2000, 2001 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
@@ -34,97 +34,100 @@
#ifndef _CPP_BASIC_FILE
#define _CPP_BASIC_FILE 1
+#pragma GCC system_header
+
#include <bits/c++config.h>
#include <bits/std_ios.h>
-namespace std {
-
+namespace std
+{
// Ulrich is going to make some detailed comment here, explaining
// all this unpleasantness, providing detailed performance analysis
// as to why we have to do all this lame vtable hacking instead of a
- // sane, function-based approach. This verbage will provide a clear
+ // sane, function-based approach. This verbiage will provide a clear
// and detailed description of the whole object-layout,
// vtable-swapping, sordid history of this hack.
template<typename _CharT>
- struct __basic_file_base: public __c_file_type
- {
- virtual
- ~__basic_file_base() { };
+ struct __basic_file_base: public __c_file_type
+ {
+ virtual
+ ~__basic_file_base() { };
- virtual int
- overflow(int __c = EOF) = 0;
+ virtual int
+ overflow(int __c = EOF) = 0;
- virtual int
- underflow() = 0;
+ virtual int
+ underflow() = 0;
- virtual int
- uflow() = 0;
+ virtual int
+ uflow() = 0;
- virtual int
- pbackfail(int __c) = 0;
+ virtual int
+ pbackfail(int __c) = 0;
- virtual streamsize
- xsputn(const _CharT* __s, streamsize __n) = 0;
+ virtual streamsize
+ xsputn(const _CharT* __s, streamsize __n) = 0;
- virtual streamsize
- xsgetn(_CharT* __s, streamsize __n) = 0;
+ virtual streamsize
+ xsgetn(_CharT* __s, streamsize __n) = 0;
- virtual streamoff
- seekoff(streamoff __off, ios_base::seekdir __way,
- ios_base::openmode __mode = ios_base::in | ios_base::out) = 0;
+ virtual streamoff
+ seekoff(streamoff __off, ios_base::seekdir __way,
+ ios_base::openmode __mode = ios_base::in | ios_base::out) = 0;
- virtual streamoff
- seekpos(streamoff __pos,
- ios_base::openmode __mode = ios_base::in | ios_base::out) = 0;
+ virtual streamoff
+ seekpos(streamoff __pos,
+ ios_base::openmode __mode = ios_base::in | ios_base::out) = 0;
- virtual streambuf*
- setbuf(_CharT* __b, int __len) = 0;
+ virtual streambuf*
+ setbuf(_CharT* __b, int __len) = 0;
- virtual int
- sync() = 0;
+ virtual int
+ sync() = 0;
- virtual int
- doallocate() = 0;
+ virtual int
+ doallocate() = 0;
- virtual streamsize
- sys_read(_CharT* __s, streamsize __n) = 0;
+ virtual streamsize
+ sys_read(_CharT* __s, streamsize __n) = 0;
- virtual streamsize
- sys_write(const _CharT* __s, streamsize __n) = 0;
+ virtual streamsize
+ sys_write(const _CharT* __s, streamsize __n) = 0;
- virtual streamoff
- sys_seek(streamoff __off, ios_base::seekdir __way) = 0;
+ virtual streamoff
+ sys_seek(streamoff __off, ios_base::seekdir __way) = 0;
- virtual int
- sys_close() = 0;
+ virtual int
+ sys_close() = 0;
- virtual int
- sys_stat(void* __v) = 0;
+ virtual int
+ sys_stat(void* __v) = 0;
- virtual int
- showmanyc() = 0;
+ virtual int
+ showmanyc() = 0;
- virtual void
- imbue(void* __v) = 0;
- };
+ virtual void
+ imbue(void* __v) = 0;
+ };
// Some of these member functions are based on libio/filebuf.cc.
// Also note that the order and number of virtual functions has to precisely
// match the order and number in the _IO_jump_t struct defined in libioP.h.
template<typename _CharT>
-#if _GLIBCPP_BASIC_FILE_INHERITANCE
+#ifdef _GLIBCPP_BASIC_FILE_INHERITANCE
class __basic_file: public __basic_file_base<_CharT>
#else
class __basic_file
#endif
{
#if _GLIBCPP_BASIC_FILE_ENCAPSULATION
- int _M_fileno;
__c_file_type* _M_cfile;
-#endif
-#ifdef _GLIBCPP_USE_WCHAR_T
+ bool _M_cfile_created;
+#else
+# ifdef _GLIBCPP_USE_WCHAR_T
__c_wfile_type _M_wfile;
-#endif /* !defined(_GLIBCPP_USE_WCHAR_T) */
+# endif
+#endif
public:
__basic_file(__c_lock* __lock = 0);
@@ -133,7 +136,7 @@ namespace std {
_M_open_mode(ios_base::openmode __mode, int& __p_mode, int& __rw_mode,
char* __c_mode);
- // Eqivalent to the normal fopen function.
+ // Equivalent to the normal fopen function.
__basic_file*
open(const char* __name, ios_base::openmode __mode, int __prot = 0664);
@@ -142,7 +145,13 @@ namespace std {
// just sets __c_file_type->_fileno and the respective _flags bits, and
// returns.
__basic_file*
- sys_open(int __fd, ios_base::openmode __mode);
+ sys_open(__c_file_type* __file, ios_base::openmode __mode);
+
+ _CharT
+ sys_getc();
+
+ _CharT
+ sys_ungetc(_CharT);
__basic_file*
close();
@@ -150,9 +159,6 @@ namespace std {
bool
is_open();
- // Needed by ios_base::sync_with_stdio.
- int get_fileno(void);
-
// NB: Must match FILE specific jump table starting here--this
// means all virtual functions starting with the dtor must match,
// slot by slot. For glibc-based dystems, this means the _IO_FILE
@@ -173,26 +179,26 @@ namespace std {
pbackfail(int __c);
// A complex "write" function that sets all of __c_file_type's
- // ponters and associated data members correctly and manages it's
+ // pointers and associated data members correctly and manages its
// relation to the external byte sequence.
virtual streamsize
xsputn(const _CharT* __s, streamsize __n);
// A complex "read" function that sets all of __c_file_type's
- // ponters and associated data members correctly and manages it's
+ // pointers and associated data members correctly and manages its
// relation to the external byte sequence.
virtual streamsize
xsgetn(_CharT* __s, streamsize __n);
// A complex "seekoff" function that sets all of __c_file_type's
- // ponters and associated data members correctly and manages it's
+ // pointers and associated data members correctly and manages its
// relation to the external byte sequence.
virtual streamoff
seekoff(streamoff __off, ios_base::seekdir __way,
ios_base::openmode __mode = ios_base::in | ios_base::out);
// A complex "seekpos" function that sets all of __c_file_type's
- // pointers and associated data members correctly and manages it's
+ // pointers and associated data members correctly and manages its
// relation to the external byte sequence.
virtual streamoff
seekpos(streamoff __pos,
@@ -239,12 +245,8 @@ namespace std {
};
} // namespace std
-#endif /* _CPP_BASIC_FILE */
-
-
-
-
-
-
-
+// Now include the bits that are dependant on the underlying I/O
+// model chosen at configure time.
+#include <bits/basic_file_model.h>
+#endif // _CPP_BASIC_FILE
diff --git a/libstdc++-v3/include/bits/basic_ios.h b/libstdc++-v3/include/bits/basic_ios.h
index 7cac68b74c2..7eb6d7a2244 100644
--- a/libstdc++-v3/include/bits/basic_ios.h
+++ b/libstdc++-v3/include/bits/basic_ios.h
@@ -1,6 +1,6 @@
// Iostreams base classes -*- C++ -*-
-// Copyright (C) 1997-1999 Free Software Foundation, Inc.
+// Copyright (C) 1997, 1998, 1999, 2001 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
@@ -30,16 +30,18 @@
#ifndef _CPP_BITS_BASICIOS_H
#define _CPP_BITS_BASICIOS_H 1
-#include <bits/sbuf_iter.h>
+#pragma GCC system_header
-namespace std {
+#include <bits/sbuf_iter.h>
+#include <bits/locale_facets.h>
+namespace std
+{
// 27.4.5 Template class basic_ios
template<typename _CharT, typename _Traits>
class basic_ios : public ios_base
{
public:
-
// Types:
typedef _CharT char_type;
typedef typename _Traits::int_type int_type;
@@ -48,11 +50,10 @@ namespace std {
typedef _Traits traits_type;
// Non-standard Types:
- typedef ctype<_CharT> __ctype_type;
- // From ostream
- typedef ostreambuf_iterator<_CharT> __ostreambuf_iter;
+ typedef ctype<_CharT> __ctype_type;
+ typedef ostreambuf_iterator<_CharT, _Traits> __ostreambuf_iter;
typedef num_put<_CharT, __ostreambuf_iter> __numput_type;
- typedef istreambuf_iterator<_CharT> __istreambuf_iter;
+ typedef istreambuf_iterator<_CharT, _Traits> __istreambuf_iter;
typedef num_get<_CharT, __istreambuf_iter> __numget_type;
// Data members:
@@ -73,19 +74,10 @@ namespace std {
const __numget_type* _M_fnumget;
public:
-
inline const __ctype_type*
_M_get_fctype_ios(void)
{ return _M_ios_fctype; }
- inline const __numget_type*
- _M_get_fnumget(void)
- { return _M_fnumget; }
-
- inline const __numput_type*
- _M_get_fnumput(void)
- { return _M_fnumput; }
-
operator void*() const
{ return this->fail() ? 0 : const_cast<basic_ios*>(this); }
@@ -105,7 +97,7 @@ namespace std {
else
_M_streambuf_state = __state | badbit;
if ((this->rdstate() & this->exceptions()))
- throw failure("basic_ios::clear(iostate) caused exception");
+ __throw_ios_failure("basic_ios::clear(iostate) caused exception");
}
inline void
@@ -199,18 +191,28 @@ namespace std {
void
init(basic_streambuf<_CharT, _Traits>* __sb);
+
+ bool
+ _M_check_facet(const locale::facet* __f)
+ {
+ bool __ret = false;
+ if (__f)
+ __ret = true;
+ else
+ __throw_bad_cast();
+ return __ret;
+ }
+
+ void
+ _M_cache_facets(const locale& __loc);
};
-
} // namespace std
#ifdef _GLIBCPP_NO_TEMPLATE_EXPORT
# define export
-//#include <bits/basic_ios.tcc>
+#include <bits/basic_ios.tcc>
#endif
#endif /* _CPP_BITS_BASICIOS_H */
-
-
-
diff --git a/libstdc++-v3/include/bits/basic_ios.tcc b/libstdc++-v3/include/bits/basic_ios.tcc
index 2b9d6f87aaa..47d940bd69c 100644
--- a/libstdc++-v3/include/bits/basic_ios.tcc
+++ b/libstdc++-v3/include/bits/basic_ios.tcc
@@ -1,6 +1,6 @@
// basic_ios locale and locale-related member functions -*- C++ -*-
-// Copyright (C) 1999 Free Software Foundation, Inc.
+// Copyright (C) 1999, 2001 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
@@ -30,8 +30,8 @@
#ifndef _CPP_BITS_BASICIOS_TCC
#define _CPP_BITS_BASICIOS_TCC 1
-namespace std {
-
+namespace std
+{
template<typename _CharT, typename _Traits>
basic_streambuf<_CharT, _Traits>*
basic_ios<_CharT, _Traits>::rdbuf(basic_streambuf<_CharT, _Traits>* __sb)
@@ -105,9 +105,7 @@ namespace std {
{
locale __old(this->getloc());
ios_base::imbue(__loc);
- _M_ios_fctype = &use_facet<__ctype_type>(__loc);
- _M_fnumput = &use_facet<__numput_type>(__loc);
- _M_fnumget = &use_facet<__numget_type>(__loc);
+ _M_cache_facets(__loc);
if (this->rdbuf() != 0)
this->rdbuf()->pubimbue(__loc);
return __old;
@@ -119,10 +117,7 @@ namespace std {
{
// NB: This may be called more than once on the same object.
ios_base::_M_init();
- _M_ios_fctype = &use_facet<__ctype_type>(_M_ios_locale);
- // Should be filled in by ostream and istream, respectively.
- _M_fnumput = &use_facet<__numput_type>(_M_ios_locale);
- _M_fnumget = &use_facet<__numget_type>(_M_ios_locale);
+ _M_cache_facets(_M_ios_locale);
_M_tie = 0;
_M_fill = this->widen(' ');
_M_exception = goodbit;
@@ -130,11 +125,21 @@ namespace std {
_M_streambuf_state = __sb ? goodbit : badbit;
}
+ template<typename _CharT, typename _Traits>
+ void
+ basic_ios<_CharT, _Traits>::_M_cache_facets(const locale& __loc)
+ {
+ if (has_facet<__ctype_type>(__loc))
+ _M_ios_fctype = &use_facet<__ctype_type>(__loc);
+ // Should be filled in by ostream and istream, respectively.
+ if (has_facet<__numput_type>(__loc))
+ _M_fnumput = &use_facet<__numput_type>(__loc);
+ if (has_facet<__numget_type>(__loc))
+ _M_fnumget = &use_facet<__numget_type>(__loc);
+ }
} // namespace std
-#endif /* _CPP_BITS_BASICIOS_TCC */
-
-
+#endif // _CPP_BITS_BASICIOS_TCC
diff --git a/libstdc++-v3/include/bits/basic_string.h b/libstdc++-v3/include/bits/basic_string.h
index b678dd27fd3..dc62a542e5e 100644
--- a/libstdc++-v3/include/bits/basic_string.h
+++ b/libstdc++-v3/include/bits/basic_string.h
@@ -34,10 +34,12 @@
#ifndef _CPP_BITS_STRING_H
#define _CPP_BITS_STRING_H 1
-#include <bits/exception_support.h>
+#pragma GCC system_header
+
#include <bits/atomicity.h>
-namespace std {
+namespace std
+{
// Documentation? What's that?
// Nathan Myers <ncm@cantrip.org>.
@@ -116,7 +118,7 @@ namespace std {
struct _Rep
{
// Types:
- typedef typename _Alloc::rebind<char>::other _Raw_bytes_alloc;
+ typedef typename _Alloc::template rebind<char>::other _Raw_bytes_alloc;
// (Public) Data members:
@@ -261,7 +263,8 @@ namespace std {
iterator
_M_check(size_type __pos) const
{
- __OUTOFRANGE(__pos > this->size());
+ if (__pos > this->size())
+ __throw_out_of_range("basic_string::_M_check");
return _M_ibegin() + __pos;
}
@@ -432,14 +435,16 @@ namespace std {
const_reference
at(size_type __n) const
{
- __OUTOFRANGE(__n >= this->size());
+ if (__n >= this->size())
+ __throw_out_of_range("basic_string::at");
return _M_data()[__n];
}
reference
at(size_type __n)
{
- __OUTOFRANGE(__n >= size());
+ if (__n >= size())
+ __throw_out_of_range("basic_string::at");
_M_leak();
return _M_data()[__n];
}
@@ -809,7 +814,8 @@ namespace std {
basic_string
substr(size_type __pos = 0, size_type __n = npos) const
{
- __OUTOFRANGE(__pos > this->size());
+ if (__pos > this->size())
+ __throw_out_of_range("basic_string::substr");
return basic_string(*this, __pos, __n);
}
@@ -836,9 +842,15 @@ namespace std {
int
compare(const _CharT* __s) const;
+#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
+// 5. String::compare specification questionable
+ int
+ compare(size_type __pos, size_type __n1, const _CharT* __s) const;
+
int
compare(size_type __pos, size_type __n1, const _CharT* __s,
- size_type __n2 = npos) const;
+ size_type __n2) const;
+#endif
};
diff --git a/libstdc++-v3/include/bits/basic_string.tcc b/libstdc++-v3/include/bits/basic_string.tcc
index 27b0faddd8c..e6abfbacbc5 100644
--- a/libstdc++-v3/include/bits/basic_string.tcc
+++ b/libstdc++-v3/include/bits/basic_string.tcc
@@ -87,44 +87,46 @@ namespace std
_Rep* __r = _Rep::_S_create(__i, __a);
traits_type::copy(__r->_M_refdata(), __buf, __i);
__r->_M_length = __i;
- try {
- // NB: this loop looks precisely this way because
- // it avoids comparing __beg != __end any more
- // than strictly necessary; != might be expensive!
- for (;;)
- {
- _CharT* __p = __r->_M_refdata() + __r->_M_length;
- _CharT* __last = __r->_M_refdata() + __r->_M_capacity;
- for (;;)
- {
- if (__beg == __end)
- {
- __r->_M_length = __p - __r->_M_refdata();
- *__p = _Rep::_S_terminal; // grrr.
- return __r->_M_refdata();
- }
- if (__p == __last)
- break;
- *__p++ = *__beg;
- ++__beg;
- }
- // Allocate more space.
- size_type __len = __p - __r->_M_refdata();
- _Rep* __another = _Rep::_S_create(__len + 1, __a);
- traits_type::copy(__another->_M_refdata(),
- __r->_M_refdata(), __len);
- __r->_M_destroy(__a);
- __r = __another;
- __r->_M_length = __len;
- }
- }
- catch (...) {
+ try
+ {
+ // NB: this loop looks precisely this way because
+ // it avoids comparing __beg != __end any more
+ // than strictly necessary; != might be expensive!
+ for (;;)
+ {
+ _CharT* __p = __r->_M_refdata() + __r->_M_length;
+ _CharT* __last = __r->_M_refdata() + __r->_M_capacity;
+ for (;;)
+ {
+ if (__beg == __end)
+ {
+ __r->_M_length = __p - __r->_M_refdata();
+ *__p = _Rep::_S_terminal; // grrr.
+ return __r->_M_refdata();
+ }
+ if (__p == __last)
+ break;
+ *__p++ = *__beg;
+ ++__beg;
+ }
+ // Allocate more space.
+ size_type __len = __p - __r->_M_refdata();
+ _Rep* __another = _Rep::_S_create(__len + 1, __a);
+ traits_type::copy(__another->_M_refdata(),
+ __r->_M_refdata(), __len);
+ __r->_M_destroy(__a);
+ __r = __another;
+ __r->_M_length = __len;
+ }
+ }
+ catch(...)
+ {
__r->_M_destroy(__a);
- throw;
- }
+ __throw_exception_again;
+ }
return 0;
}
-
+
template<typename _CharT, typename _Traits, typename _Alloc>
template <class _InIter>
_CharT*
@@ -139,13 +141,13 @@ namespace std
// Check for out_of_range and length_error exceptions.
_Rep* __r = _Rep::_S_create(__dnew, __a);
- try {
- _S_copy_chars(__r->_M_refdata(), __beg, __end);
- }
- catch (...) {
- __r->_M_destroy(__a);
- throw;
- }
+ try
+ { _S_copy_chars(__r->_M_refdata(), __beg, __end); }
+ catch(...)
+ {
+ __r->_M_destroy(__a);
+ __throw_exception_again;
+ }
__r->_M_length = __dnew;
__r->_M_refdata()[__dnew] = _Rep::_S_terminal; // grrr.
@@ -162,14 +164,16 @@ namespace std
// Check for out_of_range and length_error exceptions.
_Rep* __r = _Rep::_S_create(__n, __a);
- try {
- if (__n)
- traits_type::assign(__r->_M_refdata(), __n, __c);
- }
- catch (...) {
- __r->_M_destroy(__a);
- throw;
- }
+ try
+ {
+ if (__n)
+ traits_type::assign(__r->_M_refdata(), __n, __c);
+ }
+ catch(...)
+ {
+ __r->_M_destroy(__a);
+ __throw_exception_again;
+ }
__r->_M_length = __n;
__r->_M_refdata()[__n] = _Rep::_S_terminal; // grrr
return __r->_M_refdata();
@@ -276,17 +280,19 @@ namespace std
// Must reallocate.
allocator_type __a = get_allocator();
_Rep* __r = _Rep::_S_create(__new_size, __a);
- try {
- if (__pos)
- traits_type::copy(__r->_M_refdata(), _M_data(), __pos);
- if (__how_much)
- traits_type::copy(__r->_M_refdata() + __pos + __len2,
- __src, __how_much);
- }
- catch (...) {
- __r->_M_dispose(get_allocator());
- throw;
- }
+ try
+ {
+ if (__pos)
+ traits_type::copy(__r->_M_refdata(), _M_data(), __pos);
+ if (__how_much)
+ traits_type::copy(__r->_M_refdata() + __pos + __len2,
+ __src, __how_much);
+ }
+ catch(...)
+ {
+ __r->_M_dispose(get_allocator());
+ __throw_exception_again;
+ }
_M_rep()->_M_dispose(__a);
_M_data(__r->_M_refdata());
}
@@ -307,7 +313,11 @@ namespace std
{
if (__res > this->capacity() || _M_rep()->_M_is_shared())
{
- __LENGTHERROR(__res > this->max_size());
+ if (__res > this->max_size())
+ __throw_length_error("basic_string::reserve");
+ // Make sure we don't shrink below the current size
+ if (__res < this->size())
+ __res = this->size();
allocator_type __a = get_allocator();
_CharT* __tmp = _M_rep()->_M_clone(__a, __res - this->size());
_M_rep()->_M_dispose(__a);
@@ -347,17 +357,18 @@ namespace std
#endif
template<typename _CharT, typename _Traits, typename _Alloc>
- basic_string<_CharT, _Traits, _Alloc>::_Rep*
+ typename basic_string<_CharT, _Traits, _Alloc>::_Rep*
basic_string<_CharT, _Traits, _Alloc>::_Rep::
_S_create(size_t __capacity, const _Alloc& __alloc)
{
+ typedef basic_string<_CharT, _Traits, _Alloc> __string_type;
#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
// 83. String::npos vs. string::max_size()
- typedef basic_string<_CharT, _Traits, _Alloc> __string_type;
- __LENGTHERROR(__capacity > _S_max_size);
+ if (__capacity > _S_max_size)
#else
- __LENGTHERROR(__capacity == npos);
+ if (__capacity == npos)
#endif
+ __throw_length_error("basic_string::_S_create");
// NB: Need an array of char_type[__capacity], plus a
// terminating null char_type() element, plus enough for the
@@ -381,13 +392,13 @@ namespace std
_Rep* __r = _Rep::_S_create(_M_length + __res, __alloc);
if (_M_length)
{
- try {
- traits_type::copy(__r->_M_refdata(), _M_refdata(), _M_length);
- }
- catch (...) {
- __r->_M_destroy(__alloc);
- throw;
- }
+ try
+ { traits_type::copy(__r->_M_refdata(), _M_refdata(), _M_length); }
+ catch(...)
+ {
+ __r->_M_destroy(__alloc);
+ __throw_exception_again;
+ }
}
__r->_M_length = _M_length;
return __r->_M_refdata();
@@ -410,7 +421,8 @@ namespace std
void
basic_string<_CharT, _Traits, _Alloc>::resize(size_type __n, _CharT __c)
{
- __LENGTHERROR(__n > max_size());
+ if (__n > max_size())
+ __throw_length_error("basic_string::resize");
size_type __size = this->size();
if (__size < __n)
this->append(__n - __size, __c);
@@ -441,7 +453,8 @@ namespace std
size_type __dmax = this->max_size();
size_type __dnew = static_cast<size_type>(distance(__k1, __k2));
- __LENGTHERROR(__dmax <= __dnew);
+ if (__dmax <= __dnew)
+ __throw_length_error("basic_string::_M_replace");
size_type __off = __i1 - _M_ibegin();
_M_mutate(__off, __dold, __dnew);
// Invalidated __i1, __i2
@@ -539,7 +552,7 @@ namespace std
__string_type __str;
__size_type __len = __rhs.size();
__str.reserve(__len + 1);
- __str.append(__string_type::size_type(1), __lhs);
+ __str.append(__size_type(1), __lhs);
__str.append(__rhs);
return __str;
}
@@ -551,7 +564,8 @@ namespace std
{
size_type __n1 = __i2 - __i1;
size_type __off1 = __i1 - _M_ibegin();
- __LENGTHERROR(max_size() - (this->size() - __n1) <= __n2);
+ if (max_size() - (this->size() - __n1) <= __n2)
+ __throw_length_error("basic_string::replace");
_M_mutate (__off1, __n1, __n2);
// Invalidated __i1, __i2
if (__n2)
@@ -560,11 +574,12 @@ namespace std
}
template<typename _CharT, typename _Traits, typename _Alloc>
- basic_string<_CharT, _Traits, _Alloc>::size_type
+ typename basic_string<_CharT, _Traits, _Alloc>::size_type
basic_string<_CharT, _Traits, _Alloc>::
copy(_CharT* __s, size_type __n, size_type __pos) const
{
- __OUTOFRANGE(__pos > this->size());
+ if (__pos > this->size())
+ __throw_out_of_range("basic_string::copy");
if (__n > this->size() - __pos)
__n = this->size() - __pos;
@@ -575,7 +590,7 @@ namespace std
}
template<typename _CharT, typename _Traits, typename _Alloc>
- basic_string<_CharT, _Traits, _Alloc>::size_type
+ typename basic_string<_CharT, _Traits, _Alloc>::size_type
basic_string<_CharT, _Traits, _Alloc>::
find(const _CharT* __s, size_type __pos, size_type __n) const
{
@@ -589,7 +604,7 @@ namespace std
}
template<typename _CharT, typename _Traits, typename _Alloc>
- basic_string<_CharT, _Traits, _Alloc>::size_type
+ typename basic_string<_CharT, _Traits, _Alloc>::size_type
basic_string<_CharT, _Traits, _Alloc>::
find(_CharT __c, size_type __pos) const
{
@@ -608,7 +623,7 @@ namespace std
template<typename _CharT, typename _Traits, typename _Alloc>
- basic_string<_CharT, _Traits, _Alloc>::size_type
+ typename basic_string<_CharT, _Traits, _Alloc>::size_type
basic_string<_CharT, _Traits, _Alloc>::
rfind(const _CharT* __s, size_type __pos, size_type __n) const
{
@@ -628,7 +643,7 @@ namespace std
}
template<typename _CharT, typename _Traits, typename _Alloc>
- basic_string<_CharT, _Traits, _Alloc>::size_type
+ typename basic_string<_CharT, _Traits, _Alloc>::size_type
basic_string<_CharT, _Traits, _Alloc>::
rfind(_CharT __c, size_type __pos) const
{
@@ -647,7 +662,7 @@ namespace std
}
template<typename _CharT, typename _Traits, typename _Alloc>
- basic_string<_CharT, _Traits, _Alloc>::size_type
+ typename basic_string<_CharT, _Traits, _Alloc>::size_type
basic_string<_CharT, _Traits, _Alloc>::
find_first_of(const _CharT* __s, size_type __pos, size_type __n) const
{
@@ -661,7 +676,7 @@ namespace std
}
template<typename _CharT, typename _Traits, typename _Alloc>
- basic_string<_CharT, _Traits, _Alloc>::size_type
+ typename basic_string<_CharT, _Traits, _Alloc>::size_type
basic_string<_CharT, _Traits, _Alloc>::
find_last_of(const _CharT* __s, size_type __pos, size_type __n) const
{
@@ -681,7 +696,7 @@ namespace std
}
template<typename _CharT, typename _Traits, typename _Alloc>
- basic_string<_CharT, _Traits, _Alloc>::size_type
+ typename basic_string<_CharT, _Traits, _Alloc>::size_type
basic_string<_CharT, _Traits, _Alloc>::
find_first_not_of(const _CharT* __s, size_type __pos, size_type __n) const
{
@@ -693,7 +708,7 @@ namespace std
}
template<typename _CharT, typename _Traits, typename _Alloc>
- basic_string<_CharT, _Traits, _Alloc>::size_type
+ typename basic_string<_CharT, _Traits, _Alloc>::size_type
basic_string<_CharT, _Traits, _Alloc>::
find_first_not_of(_CharT __c, size_type __pos) const
{
@@ -705,7 +720,7 @@ namespace std
}
template<typename _CharT, typename _Traits, typename _Alloc>
- basic_string<_CharT, _Traits, _Alloc>::size_type
+ typename basic_string<_CharT, _Traits, _Alloc>::size_type
basic_string<_CharT, _Traits, _Alloc>::
find_last_not_of(const _CharT* __s, size_type __pos, size_type __n) const
{
@@ -725,7 +740,7 @@ namespace std
}
template<typename _CharT, typename _Traits, typename _Alloc>
- basic_string<_CharT, _Traits, _Alloc>::size_type
+ typename basic_string<_CharT, _Traits, _Alloc>::size_type
basic_string<_CharT, _Traits, _Alloc>::
find_last_not_of(_CharT __c, size_type __pos) const
{
@@ -751,7 +766,8 @@ namespace std
{
size_type __size = this->size();
size_type __osize = __str.size();
- __OUTOFRANGE(__pos > __size);
+ if (__pos > __size)
+ __throw_out_of_range("basic_string::compare");
size_type __rsize= min(__size - __pos, __n);
size_type __len = min(__rsize, __osize);
@@ -769,8 +785,8 @@ namespace std
{
size_type __size = this->size();
size_type __osize = __str.size();
- __OUTOFRANGE(__pos1 > __size);
- __OUTOFRANGE(__pos2 > __osize);
+ if (__pos1 > __size || __pos2 > __osize)
+ __throw_out_of_range("basic_string::compare");
size_type __rsize = min(__size - __pos1, __n1);
size_type __rosize = min(__osize - __pos2, __n2);
@@ -799,11 +815,30 @@ namespace std
template<typename _CharT, typename _Traits, typename _Alloc>
int
basic_string <_CharT,_Traits,_Alloc>::
+ compare(size_type __pos, size_type __n1, const _CharT* __s) const
+ {
+ size_type __size = this->size();
+ if (__pos > __size)
+ __throw_out_of_range("basic_string::compare");
+
+ size_type __osize = traits_type::length(__s);
+ size_type __rsize = min(__size - __pos, __n1);
+ size_type __len = min(__rsize, __osize);
+ int __r = traits_type::compare(_M_data() + __pos, __s, __len);
+ if (!__r)
+ __r = __rsize - __osize;
+ return __r;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ int
+ basic_string <_CharT,_Traits,_Alloc>::
compare(size_type __pos, size_type __n1, const _CharT* __s,
size_type __n2) const
{
size_type __size = this->size();
- __OUTOFRANGE(__pos > __size);
+ if (__pos > __size)
+ __throw_out_of_range("basic_string::compare");
size_type __osize = min(traits_type::length(__s), __n2);
size_type __rsize = min(__size - __pos, __n1);
@@ -825,7 +860,6 @@ namespace std
_Traits::copy(__buf, __str.data(), __bytes);
__buf[__bytes] = _CharT();
}
+} // namespace std
-} // std::
-
-#endif /* _CPP_BITS_STRING_TCC */
+#endif
diff --git a/libstdc++-v3/include/bits/boost_concept_check.h b/libstdc++-v3/include/bits/boost_concept_check.h
new file mode 100644
index 00000000000..9d9480d857e
--- /dev/null
+++ b/libstdc++-v3/include/bits/boost_concept_check.h
@@ -0,0 +1,889 @@
+//
+// (C) Copyright Jeremy Siek 2000. Permission to copy, use, modify,
+// sell and distribute this software is granted provided this
+// copyright notice appears in all copies. This software is provided
+// "as is" without express or implied warranty, and with no claim as
+// to its suitability for any purpose.
+//
+
+// GCC Note: based on version 1.12.0 of the Boost library.
+#ifndef _GLIBCPP_BOOST_CONCEPT_CHECK
+#define _GLIBCPP_BOOST_CONCEPT_CHECK 1
+
+#pragma GCC system_header
+#include <bits/stl_iterator_base_types.h> // for traits and tags
+#include <utility> // for pair<>
+
+
+namespace __gnu_cxx
+{
+
+#define _IsUnused __attribute__ ((__unused__))
+
+template <class _Concept>
+void __function_requires()
+{
+ void (_Concept::*__x)() _IsUnused = &_Concept::__constraints;
+}
+
+
+// ??? Should the "concept_checking*" structs begin with more than _ ?
+#define _GLIBCPP_CLASS_REQUIRES(_type_var, _ns, _concept) \
+ typedef void (_ns::_concept <_type_var>::* _func##_type_var##_concept)(); \
+ template <_func##_type_var##_concept _Tp1> \
+ struct _concept_checking##_type_var##_concept { }; \
+ typedef _concept_checking##_type_var##_concept< \
+ &_ns::_concept <_type_var>::__constraints> \
+ _concept_checking_typedef##_type_var##_concept
+
+#define _GLIBCPP_CLASS_REQUIRES2(_type_var1, _type_var2, _ns, _concept) \
+ typedef void (_ns::_concept <_type_var1,_type_var2>::* _func##_type_var1##_type_var2##_concept)(); \
+ template <_func##_type_var1##_type_var2##_concept _Tp1> \
+ struct _concept_checking##_type_var1##_type_var2##_concept { }; \
+ typedef _concept_checking##_type_var1##_type_var2##_concept< \
+ &_ns::_concept <_type_var1,_type_var2>::__constraints> \
+ _concept_checking_typedef##_type_var1##_type_var2##_concept
+
+#define _GLIBCPP_CLASS_REQUIRES3(_type_var1, _type_var2, _type_var3, _ns, _concept) \
+ typedef void (_ns::_concept <_type_var1,_type_var2,_type_var3>::* _func##_type_var1##_type_var2##_type_var3##_concept)(); \
+ template <_func##_type_var1##_type_var2##_type_var3##_concept _Tp1> \
+ struct _concept_checking##_type_var1##_type_var2##_type_var3##_concept { }; \
+ typedef _concept_checking##_type_var1##_type_var2##_type_var3##_concept< \
+ &_ns::_concept <_type_var1,_type_var2,_type_var3>::__constraints> \
+ _concept_checking_typedef##_type_var1##_type_var2##_type_var3##_concept
+
+#define _GLIBCPP_CLASS_REQUIRES4(_type_var1, _type_var2, _type_var3, _type_var4, _ns, _concept) \
+ typedef void (_ns::_concept <_type_var1,_type_var2,_type_var3,_type_var4>::* _func##_type_var1##_type_var2##_type_var3##_type_var4##_concept)(); \
+ template <_func##_type_var1##_type_var2##_type_var3##_type_var4##_concept _Tp1> \
+ struct _concept_checking##_type_var1##_type_var2##_type_var3##_type_var4##_concept { }; \
+ typedef _concept_checking##_type_var1##_type_var2##_type_var3##_type_var4##_concept< \
+ &_ns::_concept <_type_var1,_type_var2,_type_var3,_type_var4>::__constraints> \
+ _concept_checking_typedef##_type_var1##_type_var2##_type_var3##_type_var4##_concept
+
+
+template <class _Tp1, class _Tp2>
+struct _Aux_require_same { };
+
+template <class _Tp>
+struct _Aux_require_same<_Tp,_Tp> { typedef _Tp _Type; };
+
+ template <class _Tp1, class _Tp2>
+ struct _SameTypeConcept
+ {
+ void __constraints() {
+ typedef typename _Aux_require_same<_Tp1, _Tp2>::_Type _Required;
+ }
+ };
+
+ template <class _Tp>
+ struct _IntegerConcept {
+ void __constraints() {
+ __error_type_must_be_an_integer_type();
+ }
+ };
+ template <> struct _IntegerConcept<short> { void __constraints() {} };
+ template <> struct _IntegerConcept<unsigned short> { void __constraints(){} };
+ template <> struct _IntegerConcept<int> { void __constraints() {} };
+ template <> struct _IntegerConcept<unsigned int> { void __constraints() {} };
+ template <> struct _IntegerConcept<long> { void __constraints() {} };
+ template <> struct _IntegerConcept<unsigned long> { void __constraints() {} };
+ template <> struct _IntegerConcept<long long> { void __constraints() {} };
+ template <> struct _IntegerConcept<unsigned long long>
+ { void __constraints() {} };
+
+ template <class _Tp>
+ struct _SignedIntegerConcept {
+ void __constraints() {
+ __error_type_must_be_a_signed_integer_type();
+ }
+ };
+ template <> struct _SignedIntegerConcept<short> { void __constraints() {} };
+ template <> struct _SignedIntegerConcept<int> { void __constraints() {} };
+ template <> struct _SignedIntegerConcept<long> { void __constraints() {} };
+ template <> struct _SignedIntegerConcept<long long> { void __constraints(){}};
+
+ template <class _Tp>
+ struct _UnsignedIntegerConcept {
+ void __constraints() {
+ __error_type_must_be_an_unsigned_integer_type();
+ }
+ };
+ template <> struct _UnsignedIntegerConcept<unsigned short>
+ { void __constraints() {} };
+ template <> struct _UnsignedIntegerConcept<unsigned int>
+ { void __constraints() {} };
+ template <> struct _UnsignedIntegerConcept<unsigned long>
+ { void __constraints() {} };
+ template <> struct _UnsignedIntegerConcept<unsigned long long>
+ { void __constraints() {} };
+
+ //===========================================================================
+ // Basic Concepts
+
+ template <class _Tp>
+ struct _DefaultConstructibleConcept
+ {
+ void __constraints() {
+ _Tp __a _IsUnused; // require default constructor
+ }
+ };
+
+ template <class _Tp>
+ struct _AssignableConcept
+ {
+ void __constraints() {
+ __a = __a; // require assignment operator
+ __const_constraints(__a);
+ }
+ void __const_constraints(const _Tp& __b) {
+ __a = __b; // const required for argument to assignment
+ }
+ _Tp __a;
+ };
+
+ template <class _Tp>
+ struct _CopyConstructibleConcept
+ {
+ void __constraints() {
+ _Tp __a(__b); // require copy constructor
+ _Tp* __ptr _IsUnused = &__a; // require address of operator
+ __const_constraints(__a);
+ }
+ void __const_constraints(const _Tp& __a) {
+ _Tp __c(__a) _IsUnused; // require const copy constructor
+ const _Tp* __ptr _IsUnused = &__a; // require const address of operator
+ }
+ _Tp __b;
+ };
+
+ // The SGI STL version of Assignable requires copy constructor and operator=
+ template <class _Tp>
+ struct _SGIAssignableConcept
+ {
+ void __constraints() {
+ _Tp __b(__a) _IsUnused;
+ __a = __a; // require assignment operator
+ __const_constraints(__a);
+ }
+ void __const_constraints(const _Tp& __b) {
+ _Tp __c(__b) _IsUnused;
+ __a = __b; // const required for argument to assignment
+ }
+ _Tp __a;
+ };
+
+ template <class _From, class _To>
+ struct _ConvertibleConcept
+ {
+ void __constraints() {
+ _To __y _IsUnused = __x;
+ }
+ _From __x;
+ };
+
+ // The C++ standard requirements for many concepts talk about return
+ // types that must be "convertible to bool". The problem with this
+ // requirement is that it leaves the door open for evil proxies that
+ // define things like operator|| with strange return types. Two
+ // possible solutions are:
+ // 1) require the return type to be exactly bool
+ // 2) stay with convertible to bool, and also
+ // specify stuff about all the logical operators.
+ // For now we just test for convertible to bool.
+ template <class _Tp>
+ void __aux_require_boolean_expr(const _Tp& __t) {
+ bool __x _IsUnused = __t;
+ }
+
+// FIXME
+ template <class _Tp>
+ struct _EqualityComparableConcept
+ {
+ void __constraints() {
+ __aux_require_boolean_expr(__a == __b);
+ __aux_require_boolean_expr(__a != __b);
+ }
+ _Tp __a, __b;
+ };
+
+ template <class _Tp>
+ struct _LessThanComparableConcept
+ {
+ void __constraints() {
+ __aux_require_boolean_expr(__a < __b);
+ }
+ _Tp __a, __b;
+ };
+
+ // This is equivalent to SGI STL's LessThanComparable.
+ template <class _Tp>
+ struct _ComparableConcept
+ {
+ void __constraints() {
+ __aux_require_boolean_expr(__a < __b);
+ __aux_require_boolean_expr(__a > __b);
+ __aux_require_boolean_expr(__a <= __b);
+ __aux_require_boolean_expr(__a >= __b);
+ }
+ _Tp __a, __b;
+ };
+
+#define _GLIBCPP_DEFINE_BINARY_PREDICATE_OP_CONSTRAINT(_OP,_NAME) \
+ template <class _First, class _Second> \
+ struct _NAME { \
+ void __constraints() { (void)__constraints_(); } \
+ bool __constraints_() { \
+ return __a _OP __b; \
+ } \
+ _First __a; \
+ _Second __b; \
+ }
+
+#define _GLIBCPP_DEFINE_BINARY_OPERATOR_CONSTRAINT(_OP,_NAME) \
+ template <class _Ret, class _First, class _Second> \
+ struct _NAME { \
+ void __constraints() { (void)__constraints_(); } \
+ _Ret __constraints_() { \
+ return __a _OP __b; \
+ } \
+ _First __a; \
+ _Second __b; \
+ }
+
+ _GLIBCPP_DEFINE_BINARY_PREDICATE_OP_CONSTRAINT(==, _EqualOpConcept);
+ _GLIBCPP_DEFINE_BINARY_PREDICATE_OP_CONSTRAINT(!=, _NotEqualOpConcept);
+ _GLIBCPP_DEFINE_BINARY_PREDICATE_OP_CONSTRAINT(<, _LessThanOpConcept);
+ _GLIBCPP_DEFINE_BINARY_PREDICATE_OP_CONSTRAINT(<=, _LessEqualOpConcept);
+ _GLIBCPP_DEFINE_BINARY_PREDICATE_OP_CONSTRAINT(>, _GreaterThanOpConcept);
+ _GLIBCPP_DEFINE_BINARY_PREDICATE_OP_CONSTRAINT(>=, _GreaterEqualOpConcept);
+
+ _GLIBCPP_DEFINE_BINARY_OPERATOR_CONSTRAINT(+, _PlusOpConcept);
+ _GLIBCPP_DEFINE_BINARY_OPERATOR_CONSTRAINT(*, _TimesOpConcept);
+ _GLIBCPP_DEFINE_BINARY_OPERATOR_CONSTRAINT(/, _DivideOpConcept);
+ _GLIBCPP_DEFINE_BINARY_OPERATOR_CONSTRAINT(-, _SubtractOpConcept);
+ _GLIBCPP_DEFINE_BINARY_OPERATOR_CONSTRAINT(%, _ModOpConcept);
+
+#undef _GLIBCPP_DEFINE_BINARY_PREDICATE_OP_CONSTRAINT
+#undef _GLIBCPP_DEFINE_BINARY_OPERATOR_CONSTRAINT
+
+ //===========================================================================
+ // Function Object Concepts
+
+ template <class _Func, class _Return>
+ struct _GeneratorConcept
+ {
+ void __constraints() {
+ const _Return& __r _IsUnused = __f();// require operator() member function
+ }
+ _Func __f;
+ };
+
+
+ template <class _Func>
+ struct _GeneratorConcept<_Func,void>
+ {
+ void __constraints() {
+ __f(); // require operator() member function
+ }
+ _Func __f;
+ };
+
+ template <class _Func, class _Return, class _Arg>
+ struct _UnaryFunctionConcept
+ {
+ void __constraints() {
+ __r = __f(__arg); // require operator()
+ }
+ _Func __f;
+ _Arg __arg;
+ _Return __r;
+ };
+
+ template <class _Func, class _Arg>
+ struct _UnaryFunctionConcept<_Func, void, _Arg> {
+ void __constraints() {
+ __f(__arg); // require operator()
+ }
+ _Func __f;
+ _Arg __arg;
+ };
+
+ template <class _Func, class _Return, class _First, class _Second>
+ struct _BinaryFunctionConcept
+ {
+ void __constraints() {
+ __r = __f(__first, __second); // require operator()
+ }
+ _Func __f;
+ _First __first;
+ _Second __second;
+ _Return __r;
+ };
+
+ template <class _Func, class _First, class _Second>
+ struct _BinaryFunctionConcept<_Func, void, _First, _Second>
+ {
+ void __constraints() {
+ __f(__first, __second); // require operator()
+ }
+ _Func __f;
+ _First __first;
+ _Second __second;
+ };
+
+ template <class _Func, class _Arg>
+ struct _UnaryPredicateConcept
+ {
+ void __constraints() {
+ __aux_require_boolean_expr(__f(__arg)); // require op() returning bool
+ }
+ _Func __f;
+ _Arg __arg;
+ };
+
+ template <class _Func, class _First, class _Second>
+ struct _BinaryPredicateConcept
+ {
+ void __constraints() {
+ __aux_require_boolean_expr(__f(__a, __b)); // require op() returning bool
+ }
+ _Func __f;
+ _First __a;
+ _Second __b;
+ };
+
+ // use this when functor is used inside a container class like std::set
+ template <class _Func, class _First, class _Second>
+ struct _Const_BinaryPredicateConcept {
+ void __constraints() {
+ __const_constraints(__f);
+ }
+ void __const_constraints(const _Func& __fun) {
+ __function_requires<_BinaryPredicateConcept<_Func, _First, _Second> >();
+ // operator() must be a const member function
+ __aux_require_boolean_expr(__fun(__a, __b));
+ }
+ _Func __f;
+ _First __a;
+ _Second __b;
+ };
+
+ //===========================================================================
+ // Iterator Concepts
+
+ template <class _Tp>
+ struct _TrivialIteratorConcept
+ {
+ void __constraints() {
+ __function_requires< _DefaultConstructibleConcept<_Tp> >();
+ __function_requires< _AssignableConcept<_Tp> >();
+ __function_requires< _EqualityComparableConcept<_Tp> >();
+ typedef typename std::iterator_traits<_Tp>::value_type _V;
+ (void)*__i; // require dereference operator
+ }
+ _Tp __i;
+ };
+
+ template <class _Tp>
+ struct _Mutable_TrivialIteratorConcept
+ {
+ void __constraints() {
+ __function_requires< _TrivialIteratorConcept<_Tp> >();
+ *__i = *__j; // require dereference and assignment
+ }
+ _Tp __i, __j;
+ };
+
+ template <class _Tp>
+ struct _InputIteratorConcept
+ {
+ 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>::pointer _Pt;
+ typedef typename std::iterator_traits<_Tp>::iterator_category _Cat;
+ __function_requires< _ConvertibleConcept<
+ typename std::iterator_traits<_Tp>::iterator_category,
+ std::input_iterator_tag> >();
+ ++__i; // require preincrement operator
+ __i++; // require postincrement operator
+ }
+ _Tp __i;
+ };
+
+ template <class _Tp, class _ValueT>
+ struct _OutputIteratorConcept
+ {
+ void __constraints() {
+ __function_requires< _AssignableConcept<_Tp> >();
+ ++__i; // require preincrement operator
+ __i++; // require postincrement operator
+ *__i++ = __t; // require postincrement and assignment
+ }
+ _Tp __i;
+ _ValueT __t;
+ };
+
+ template <class _Tp>
+ struct _ForwardIteratorConcept
+ {
+ void __constraints() {
+ __function_requires< _InputIteratorConcept<_Tp> >();
+ __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;
+ }
+ _Tp __i;
+ };
+
+ template <class _Tp>
+ struct _Mutable_ForwardIteratorConcept
+ {
+ void __constraints() {
+ __function_requires< _ForwardIteratorConcept<_Tp> >();
+ *__i++ = *__i; // require postincrement and assignment
+ }
+ _Tp __i;
+ };
+
+ template <class _Tp>
+ struct _BidirectionalIteratorConcept
+ {
+ void __constraints() {
+ __function_requires< _ForwardIteratorConcept<_Tp> >();
+ __function_requires< _ConvertibleConcept<
+ typename std::iterator_traits<_Tp>::iterator_category,
+ std::bidirectional_iterator_tag> >();
+ --__i; // require predecrement operator
+ __i--; // require postdecrement operator
+ }
+ _Tp __i;
+ };
+
+ template <class _Tp>
+ struct _Mutable_BidirectionalIteratorConcept
+ {
+ void __constraints() {
+ __function_requires< _BidirectionalIteratorConcept<_Tp> >();
+ __function_requires< _Mutable_ForwardIteratorConcept<_Tp> >();
+ *__i-- = *__i; // require postdecrement and assignment
+ }
+ _Tp __i;
+ };
+
+
+ template <class _Tp>
+ struct _RandomAccessIteratorConcept
+ {
+ void __constraints() {
+ __function_requires< _BidirectionalIteratorConcept<_Tp> >();
+ __function_requires< _ComparableConcept<_Tp> >();
+ __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;
+
+ __i += __n; // require assignment addition operator
+ __i = __i + __n; __i = __n + __i; // require addition with difference type
+ __i -= __n; // require assignment subtraction op
+ __i = __i - __n; // require subtraction with
+ // difference type
+ __n = __i - __j; // require difference operator
+ (void)__i[__n]; // require element access operator
+ }
+ _Tp __a, __b;
+ _Tp __i, __j;
+ typename std::iterator_traits<_Tp>::difference_type __n;
+ };
+
+ template <class _Tp>
+ struct _Mutable_RandomAccessIteratorConcept
+ {
+ void __constraints() {
+ __function_requires< _RandomAccessIteratorConcept<_Tp> >();
+ __function_requires< _Mutable_BidirectionalIteratorConcept<_Tp> >();
+ __i[__n] = *__i; // require element access and assignment
+ }
+ _Tp __i;
+ typename std::iterator_traits<_Tp>::difference_type __n;
+ };
+
+ //===========================================================================
+ // Container Concepts
+
+ template <class _Container>
+ struct _ContainerConcept
+ {
+ typedef typename _Container::value_type _Value_type;
+ typedef typename _Container::difference_type _Difference_type;
+ typedef typename _Container::size_type _Size_type;
+ typedef typename _Container::const_reference _Const_reference;
+ typedef typename _Container::const_pointer _Const_pointer;
+ typedef typename _Container::const_iterator _Const_iterator;
+
+ void __constraints() {
+ __function_requires< _InputIteratorConcept<_Const_iterator> >();
+ __function_requires< _AssignableConcept<_Container> >();
+ const _Container __c;
+ __i = __c.begin();
+ __i = __c.end();
+ __n = __c.size();
+ __n = __c.max_size();
+ __b = __c.empty();
+ }
+ bool __b;
+ _Const_iterator __i;
+ _Size_type __n;
+ };
+
+ template <class _Container>
+ struct _Mutable_ContainerConcept
+ {
+ typedef typename _Container::value_type _Value_type;
+ typedef typename _Container::reference _Reference;
+ typedef typename _Container::iterator _Iterator;
+ typedef typename _Container::pointer _Pointer;
+
+ void __constraints() {
+ __function_requires< _ContainerConcept<_Container> >();
+ __function_requires< _AssignableConcept<_Value_type> >();
+ __function_requires< _InputIteratorConcept<_Iterator> >();
+
+ __i = __c.begin();
+ __i = __c.end();
+ __c.swap(__c2);
+ }
+ _Iterator __i;
+ _Container __c, __c2;
+ };
+
+ template <class _ForwardContainer>
+ struct _ForwardContainerConcept
+ {
+ void __constraints() {
+ __function_requires< _ContainerConcept<_ForwardContainer> >();
+ typedef typename _ForwardContainer::const_iterator _Const_iterator;
+ __function_requires< _ForwardIteratorConcept<_Const_iterator> >();
+ }
+ };
+
+ template <class _ForwardContainer>
+ struct _Mutable_ForwardContainerConcept
+ {
+ void __constraints() {
+ __function_requires< _ForwardContainerConcept<_ForwardContainer> >();
+ __function_requires< _Mutable_ContainerConcept<_ForwardContainer> >();
+ typedef typename _ForwardContainer::iterator _Iterator;
+ __function_requires< _Mutable_ForwardIteratorConcept<_Iterator> >();
+ }
+ };
+
+ template <class _ReversibleContainer>
+ struct _ReversibleContainerConcept
+ {
+ typedef typename _ReversibleContainer::const_iterator _Const_iterator;
+ typedef typename _ReversibleContainer::const_reverse_iterator
+ _Const_reverse_iterator;
+
+ void __constraints() {
+ __function_requires< _ForwardContainerConcept<_ReversibleContainer> >();
+ __function_requires< _BidirectionalIteratorConcept<_Const_iterator> >();
+ __function_requires<
+ _BidirectionalIteratorConcept<_Const_reverse_iterator> >();
+
+ const _ReversibleContainer __c;
+ _Const_reverse_iterator __i = __c.rbegin();
+ __i = __c.rend();
+ }
+ };
+
+ template <class _ReversibleContainer>
+ struct _Mutable_ReversibleContainerConcept
+ {
+ typedef typename _ReversibleContainer::iterator _Iterator;
+ typedef typename _ReversibleContainer::reverse_iterator _Reverse_iterator;
+
+ void __constraints() {
+ __function_requires<_ReversibleContainerConcept<_ReversibleContainer> >();
+ __function_requires<
+ _Mutable_ForwardContainerConcept<_ReversibleContainer> >();
+ __function_requires<_Mutable_BidirectionalIteratorConcept<_Iterator> >();
+ __function_requires<
+ _Mutable_BidirectionalIteratorConcept<_Reverse_iterator> >();
+
+ _Reverse_iterator __i = __c.rbegin();
+ __i = __c.rend();
+ }
+ _ReversibleContainer __c;
+ };
+
+ template <class _RandomAccessContainer>
+ struct _RandomAccessContainerConcept
+ {
+ typedef typename _RandomAccessContainer::size_type _Size_type;
+ typedef typename _RandomAccessContainer::const_reference _Const_reference;
+ typedef typename _RandomAccessContainer::const_iterator _Const_iterator;
+ typedef typename _RandomAccessContainer::const_reverse_iterator
+ _Const_reverse_iterator;
+
+ void __constraints() {
+ __function_requires<
+ _ReversibleContainerConcept<_RandomAccessContainer> >();
+ __function_requires< _RandomAccessIteratorConcept<_Const_iterator> >();
+ __function_requires<
+ _RandomAccessIteratorConcept<_Const_reverse_iterator> >();
+
+ const _RandomAccessContainer __c;
+ _Const_reference __r _IsUnused = __c[__n];
+ }
+ _Size_type __n;
+ };
+
+ template <class _RandomAccessContainer>
+ struct _Mutable_RandomAccessContainerConcept
+ {
+ typedef typename _RandomAccessContainer::size_type _Size_type;
+ typedef typename _RandomAccessContainer::reference _Reference;
+ typedef typename _RandomAccessContainer::iterator _Iterator;
+ typedef typename _RandomAccessContainer::reverse_iterator _Reverse_iterator;
+
+ void __constraints() {
+ __function_requires<
+ _RandomAccessContainerConcept<_RandomAccessContainer> >();
+ __function_requires<
+ _Mutable_ReversibleContainerConcept<_RandomAccessContainer> >();
+ __function_requires< _Mutable_RandomAccessIteratorConcept<_Iterator> >();
+ __function_requires<
+ _Mutable_RandomAccessIteratorConcept<_Reverse_iterator> >();
+
+ _Reference __r _IsUnused = __c[__i];
+ }
+ _Size_type __i;
+ _RandomAccessContainer __c;
+ };
+
+ // A Sequence is inherently mutable
+ template <class _Sequence>
+ struct _SequenceConcept
+ {
+ typedef typename _Sequence::reference _Reference;
+ typedef typename _Sequence::const_reference _Const_reference;
+
+ void __constraints() {
+ // Matt Austern's book puts DefaultConstructible here, the C++
+ // standard places it in Container
+ // function_requires< DefaultConstructible<Sequence> >();
+ __function_requires< _Mutable_ForwardContainerConcept<_Sequence> >();
+ __function_requires< _DefaultConstructibleConcept<_Sequence> >();
+
+ _Sequence
+ __c(__n) _IsUnused,
+ __c2(__n, __t) _IsUnused,
+ __c3(__first, __last) _IsUnused;
+
+ __c.insert(__p, __t);
+ __c.insert(__p, __n, __t);
+ __c.insert(__p, __first, __last);
+
+ __c.erase(__p);
+ __c.erase(__p, __q);
+
+ _Reference __r _IsUnused = __c.front();
+
+ __const_constraints(__c);
+ }
+ void __const_constraints(const _Sequence& __c) {
+ _Const_reference __r _IsUnused = __c.front();
+ }
+ typename _Sequence::value_type __t;
+ typename _Sequence::size_type __n;
+ typename _Sequence::value_type *__first, *__last;
+ typename _Sequence::iterator __p, __q;
+ };
+
+ template <class _FrontInsertionSequence>
+ struct _FrontInsertionSequenceConcept
+ {
+ void __constraints() {
+ __function_requires< _SequenceConcept<_FrontInsertionSequence> >();
+
+ __c.push_front(__t);
+ __c.pop_front();
+ }
+ _FrontInsertionSequence __c;
+ typename _FrontInsertionSequence::value_type __t;
+ };
+
+ template <class _BackInsertionSequence>
+ struct _BackInsertionSequenceConcept
+ {
+ typedef typename _BackInsertionSequence::reference _Reference;
+ typedef typename _BackInsertionSequence::const_reference _Const_reference;
+
+ void __constraints() {
+ __function_requires< _SequenceConcept<_BackInsertionSequence> >();
+
+ __c.push_back(__t);
+ __c.pop_back();
+ _Reference __r _IsUnused = __c.back();
+ }
+ void __const_constraints(const _BackInsertionSequence& __c) {
+ _Const_reference __r _IsUnused = __c.back();
+ };
+ _BackInsertionSequence __c;
+ typename _BackInsertionSequence::value_type __t;
+ };
+
+ template <class _AssociativeContainer>
+ struct _AssociativeContainerConcept
+ {
+ void __constraints() {
+ __function_requires< _ForwardContainerConcept<_AssociativeContainer> >();
+ __function_requires<
+ _DefaultConstructibleConcept<_AssociativeContainer> >();
+
+ __i = __c.find(__k);
+ __r = __c.equal_range(__k);
+ __c.erase(__k);
+ __c.erase(__i);
+ __c.erase(__r.first, __r.second);
+ __const_constraints(__c);
+ }
+ void __const_constraints(const _AssociativeContainer& __c) {
+ __ci = __c.find(__k);
+ __n = __c.count(__k);
+ __cr = __c.equal_range(__k);
+ }
+ typedef typename _AssociativeContainer::iterator _Iterator;
+ typedef typename _AssociativeContainer::const_iterator _Const_iterator;
+
+ _AssociativeContainer __c;
+ _Iterator __i;
+ std::pair<_Iterator,_Iterator> __r;
+ _Const_iterator __ci;
+ std::pair<_Const_iterator,_Const_iterator> __cr;
+ typename _AssociativeContainer::key_type __k;
+ typename _AssociativeContainer::size_type __n;
+ };
+
+ template <class _UniqueAssociativeContainer>
+ struct _UniqueAssociativeContainerConcept
+ {
+ void __constraints() {
+ __function_requires<
+ _AssociativeContainerConcept<_UniqueAssociativeContainer> >();
+
+ _UniqueAssociativeContainer __c(__first, __last);
+
+ __pos_flag = __c.insert(__t);
+ __c.insert(__first, __last);
+ }
+ std::pair<typename _UniqueAssociativeContainer::iterator, bool> __pos_flag;
+ typename _UniqueAssociativeContainer::value_type __t;
+ typename _UniqueAssociativeContainer::value_type *__first, *__last;
+ };
+
+ template <class _MultipleAssociativeContainer>
+ struct _MultipleAssociativeContainerConcept
+ {
+ void __constraints() {
+ __function_requires<
+ _AssociativeContainerConcept<_MultipleAssociativeContainer> >();
+
+ _MultipleAssociativeContainer __c(__first, __last);
+
+ __pos = __c.insert(__t);
+ __c.insert(__first, __last);
+
+ }
+ typename _MultipleAssociativeContainer::iterator __pos _IsUnused;
+ typename _MultipleAssociativeContainer::value_type __t;
+ typename _MultipleAssociativeContainer::value_type *__first, *__last;
+ };
+
+ template <class _SimpleAssociativeContainer>
+ struct _SimpleAssociativeContainerConcept
+ {
+ void __constraints() {
+ __function_requires<
+ _AssociativeContainerConcept<_SimpleAssociativeContainer> >();
+ 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;
+ }
+ };
+
+ template <class _SimpleAssociativeContainer>
+ struct _PairAssociativeContainerConcept
+ {
+ void __constraints() {
+ __function_requires<
+ _AssociativeContainerConcept<_SimpleAssociativeContainer> >();
+ typedef typename _SimpleAssociativeContainer::key_type _Key_type;
+ typedef typename _SimpleAssociativeContainer::value_type _Value_type;
+ typedef typename _SimpleAssociativeContainer::mapped_type _Mapped_type;
+ typedef std::pair<const _Key_type, _Mapped_type> _Required_value_type;
+ typedef typename _Aux_require_same<_Value_type,
+ _Required_value_type>::_Type _Required;
+ }
+ };
+
+ template <class _SortedAssociativeContainer>
+ struct _SortedAssociativeContainerConcept
+ {
+ void __constraints() {
+ __function_requires<
+ _AssociativeContainerConcept<_SortedAssociativeContainer> >();
+ __function_requires<
+ _ReversibleContainerConcept<_SortedAssociativeContainer> >();
+
+ _SortedAssociativeContainer
+ __c(__kc) _IsUnused,
+ __c2(__first, __last) _IsUnused,
+ __c3(__first, __last, __kc) _IsUnused;
+
+ __p = __c.upper_bound(__k);
+ __p = __c.lower_bound(__k);
+ __r = __c.equal_range(__k);
+
+ __c.insert(__p, __t);
+ }
+ void __const_constraints(const _SortedAssociativeContainer& __c) {
+ __kc = __c.key_comp();
+ __vc = __c.value_comp();
+
+ __cp = __c.upper_bound(__k);
+ __cp = __c.lower_bound(__k);
+ __cr = __c.equal_range(__k);
+ }
+ typename _SortedAssociativeContainer::key_compare __kc;
+ typename _SortedAssociativeContainer::value_compare __vc;
+ typename _SortedAssociativeContainer::value_type __t;
+ typename _SortedAssociativeContainer::key_type __k;
+ typedef typename _SortedAssociativeContainer::iterator _Iterator;
+ typedef typename _SortedAssociativeContainer::const_iterator
+ _Const_iterator;
+
+ _Iterator __p;
+ _Const_iterator __cp;
+ std::pair<_Iterator,_Iterator> __r;
+ std::pair<_Const_iterator,_Const_iterator> __cr;
+ typename _SortedAssociativeContainer::value_type *__first, *__last;
+ };
+
+ // HashedAssociativeContainer
+
+} // namespace __gnu_cxx
+
+#undef _IsUnused
+
+#endif // _GLIBCPP_BOOST_CONCEPT_CHECK
+
+
diff --git a/libstdc++-v3/include/bits/c++config b/libstdc++-v3/include/bits/c++config
index 30fc80456e5..3626e56fd1b 100644
--- a/libstdc++-v3/include/bits/c++config
+++ b/libstdc++-v3/include/bits/c++config
@@ -32,15 +32,11 @@
// Pick up any OS-specific definitions.
#include <bits/os_defines.h>
+// And any CPU-specific definitions.
+#include <bits/limits.h>
// The current version of the C++ library in compressed ISO date format.
-#define __GLIBCPP__ 20010102
-
-// This flag controls the error handling in string, and perhaps other
-// bits as time goes on: check out bits/basic_string.h for more
-// info. It also helps alleviate the circular dependency between
-// string and exception.
-# define _GLIBCPP_USE_EXCEPTIONS 1
+#define __GLIBCPP__ 20020220
// This is necessary until GCC supports separate template
// compilation.
@@ -53,21 +49,70 @@
// types. For the io library, this means that larger, out-of-line
// member functions are only declared, and definitions are not parsed
// by the compiler, but instead instantiated into the library binary.
-//#define _GLIBCPP_FULLY_COMPLIANT_HEADERS 1
+#define _GLIBCPP_FULLY_COMPLIANT_HEADERS 1
+
+// Define this to permit user-level control of the expansion of string
+// buffers (via a fn pointer), see basic_string.* for more.
+//#define _GLIBCPP_ALLOC_CONTROL
// To enable older, ARM-style iostreams and other anachronisms use this.
//#define _GLIBCPP_DEPRECATED 1
// Use corrected code from the committee library group's issues list.
-# define _GLIBCPP_RESOLVE_LIB_DEFECTS 1
-
-
-
-
-
-
-
-
-
-
-
+#define _GLIBCPP_RESOLVE_LIB_DEFECTS 1
+
+// Enable concept checking code from the boost libraries.
+//#define _GLIBCPP_CONCEPT_CHECKS 1
+
+// Map gthr.h abstraction to that required for STL. Do not key off of
+// __GTHREADS at this point since we haven't seen the correct symbol
+// yet, instead setup so that include/bits/stl_threads.h will know to
+// include gthr.h instead of any other type of thread support. Note:
+// that gthr.h may well map to gthr-single.h which is a correct way to
+// express no threads support in gcc. As a user, do not define
+// _NOTHREADS without consideration of the consequences (e.g. it is an
+// internal ABI change).
+#define __STL_GTHREADS
+#define __STL_THREADS
+#define __STL_VOLATILE volatile
+
+// This is also a user hook, but via -f[no-]exceptions, not direct #defines.
+#ifdef __EXCEPTIONS
+# define __STL_USE_EXCEPTIONS
+# define __STL_TRY try
+# define __STL_CATCH_ALL catch(...)
+# define __STL_THROW(x) throw x
+# define __STL_RETHROW throw
+# define __STL_NOTHROW throw()
+# define __STL_UNWIND(action) catch(...) { action; throw; }
+#else
+# define __STL_TRY
+# define __STL_CATCH_ALL if (false)
+# define __STL_THROW(x)
+# define __STL_RETHROW
+# define __STL_NOTHROW
+# define __STL_UNWIND(action)
+#endif
+
+// Default to the typically high-speed, pool-based allocator (as
+// libstdc++-v2) instead of the malloc-based allocator (libstdc++-v3
+// snapshots). See libstdc++-v3/docs/html/17_intro/howto.html for
+// details on why you don't want to override this setting. Ensure
+// that threads are properly configured on your platform before
+// assigning blame to the STL container-memory allocator. After doing
+// so, please report any possible issues to libstdc++@gcc.gnu.org .
+// Do not blindly #define __USE_MALLOC here or on the command line.
+
+// The remainder of the prewritten config is mostly automatic; all the
+// user hooks are listed above.
+
+// XXX
+// Only used in the SGI rope extensions; this is from stl_config.h and
+// should be cleaned up.
+# define __stl_assert(expr)
+
+/** @namespace std
+ * @brief Everything defined by the ISO C++ Standard is within namespace std.
+ */
+
+// End of prewritten config; the discovered settings follow.
diff --git a/libstdc++-v3/include/bits/char_traits.h b/libstdc++-v3/include/bits/char_traits.h
index caa90e985f9..a468bed90af 100644
--- a/libstdc++-v3/include/bits/char_traits.h
+++ b/libstdc++-v3/include/bits/char_traits.h
@@ -34,28 +34,16 @@
#ifndef _CPP_BITS_CHAR_TRAITS_H
#define _CPP_BITS_CHAR_TRAITS_H 1
-#include <bits/std_cwchar.h> // For mbstate_t.
-#include <bits/std_cstring.h> // For memmove, memset, memchr
-#include <bits/fpos.h> // For streamoff, streamsize
-
-namespace std {
-
- // Same as iosfwd
-#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
- // Can't have self-recursive types for streampos.
- // 21.1.3.1 char_traits sets size_type to streampos
- // 27.4.1
- // And here, where streampos is typedefed to fpos<traits::state_type>
- typedef fpos<mbstate_t> streampos;
-# ifdef _GLIBCPP_USE_WCHAR_T
- typedef fpos<mbstate_t> wstreampos;
-# endif
-#endif
+#pragma GCC system_header
- // 21.1.2 Basis for explicit _Traits specialization
- // NB: That for any given actual character type this definition is
- // probably wrong.
+#include <bits/std_cstring.h> // For memmove, memset, memchr
+#include <bits/fpos.h> // For streampos
+namespace std
+{
+ /// 21.1.2 Basis for explicit _Traits specialization
+ /// NB: That for any given actual character type this definition is
+ /// probably wrong.
template<class _CharT>
struct char_traits
{
@@ -130,22 +118,16 @@ namespace std {
eq_int_type(const int_type& __c1, const int_type& __c2)
{ return __c1 == __c2; }
- static state_type
- _S_get_state(const pos_type& __pos) { return __pos.state(); }
-
static int_type
eof() { return static_cast<int_type>(-1); }
static int_type
- _S_eos() { return char_type(); }
-
- static int_type
not_eof(const int_type& __c)
{ return eq_int_type(__c, eof()) ? int_type(0) : __c; }
};
- // 21.1.4 char_traits specializations
+ /// 21.1.4 char_traits specializations
template<>
struct char_traits<char>
{
@@ -205,16 +187,10 @@ namespace std {
eq_int_type(const int_type& __c1, const int_type& __c2)
{ return __c1 == __c2; }
- static state_type
- _S_get_state(const pos_type& __pos) { return __pos.state(); }
-
static int_type
eof() { return static_cast<int_type>(EOF); }
static int_type
- _S_eos() { return char_type(); }
-
- static int_type
not_eof(const int_type& __c)
{ return (__c == eof()) ? 0 : __c; }
};
@@ -226,7 +202,7 @@ namespace std {
{
typedef wchar_t char_type;
typedef wint_t int_type;
- typedef wstreamoff off_type;
+ typedef streamoff off_type;
typedef wstreampos pos_type;
typedef mbstate_t state_type;
@@ -276,16 +252,10 @@ namespace std {
eq_int_type(const int_type& __c1, const int_type& __c2)
{ return __c1 == __c2; }
- static state_type
- _S_get_state(const pos_type& __pos) { return __pos.state(); }
-
static int_type
eof() { return static_cast<int_type>(WEOF); }
static int_type
- _S_eos() { return char_type(); }
-
- static int_type
not_eof(const int_type& __c)
{ return eq_int_type(__c, eof()) ? 0 : __c; }
};
@@ -300,9 +270,6 @@ namespace std {
bool
operator()(_CharT const& __a) { return _Traits::eq(_M_c, __a); }
};
-
} // namespace std
-
-#endif /* _CPP_BITS_CHAR_TRAITS_H */
-
+#endif
diff --git a/libstdc++-v3/include/bits/codecvt.h b/libstdc++-v3/include/bits/codecvt.h
index 8873298e476..badc7fbf129 100644
--- a/libstdc++-v3/include/bits/codecvt.h
+++ b/libstdc++-v3/include/bits/codecvt.h
@@ -1,6 +1,6 @@
// Locale support (codecvt) -*- C++ -*-
-// Copyright (C) 2000 Free Software Foundation, Inc.
+// Copyright (C) 2000, 2001 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
@@ -38,6 +38,8 @@
#ifndef _CPP_BITS_CODECVT_H
#define _CPP_BITS_CODECVT_H 1
+#pragma GCC system_header
+
// XXX
// __enc_traits may need to move up the locale header hierarchy,
// depending on if ctype ends up using it.
@@ -417,7 +419,7 @@
if (__int_bom)
{
size_t __size = __from_end - __from;
- intern_type __cfixed[__size + 1];
+ intern_type* __cfixed = static_cast<intern_type*>(__builtin_alloca(sizeof(intern_type) * (__size + 1)));
__cfixed[0] = static_cast<intern_type>(__int_bom);
char_traits<intern_type>::copy(__cfixed + 1, __from, __size);
__cfrom = reinterpret_cast<char*>(__cfixed);
@@ -440,7 +442,7 @@
}
else
{
- if (__flen < __from_end - __from)
+ if (__flen < static_cast<size_t>(__from_end - __from))
{
__from_next = reinterpret_cast<const intern_type*>(__cfrom);
__to_next = reinterpret_cast<extern_type*>(__cto);
@@ -522,7 +524,7 @@
if (__ext_bom)
{
size_t __size = __from_end - __from;
- extern_type __cfixed[__size + 1];
+ extern_type* __cfixed = static_cast<extern_type*>(__builtin_alloca(sizeof(extern_type) * (__size + 1)));
__cfixed[0] = static_cast<extern_type>(__ext_bom);
char_traits<extern_type>::copy(__cfixed + 1, __from, __size);
__cfrom = reinterpret_cast<char*>(__cfixed);
@@ -546,7 +548,7 @@
}
else
{
- if (__flen < __from_end - __from)
+ if (__flen < static_cast<size_t>(__from_end - __from))
{
__from_next = reinterpret_cast<const extern_type*>(__cfrom);
__to_next = reinterpret_cast<intern_type*>(__cto);
@@ -574,7 +576,7 @@
template<typename _InternT, typename _ExternT>
int
codecvt<_InternT, _ExternT, __enc_traits>::
- do_length(const state_type& __state, const extern_type* __from,
+ do_length(const state_type&, const extern_type* __from,
const extern_type* __end, size_t __max) const
{ return min(__max, static_cast<size_t>(__end - __from)); }
diff --git a/libstdc++-v3/include/bits/concept_check.h b/libstdc++-v3/include/bits/concept_check.h
new file mode 100644
index 00000000000..2a02bd8c8b3
--- /dev/null
+++ b/libstdc++-v3/include/bits/concept_check.h
@@ -0,0 +1,81 @@
+// Concept-checking control -*- C++ -*-
+
+// Copyright (C) 2001 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.
+
+#ifndef _GLIBCPP_CONCEPT_CHECK
+#define _GLIBCPP_CONCEPT_CHECK 1
+
+#pragma GCC system_header
+
+#include <bits/c++config.h>
+
+// All places in libstdc++-v3 where these are used, or /might/ be used, or
+// don't need to be used, or perhaps /should/ be used, are commented with
+// "concept requirements" (and maybe some more text). So grep like crazy
+// if you're looking for additional places to use these.
+
+// Concept-checking code is off by default unless users turn it on via
+// configure options or editing c++config.h.
+
+#ifndef _GLIBCPP_CONCEPT_CHECKS
+
+#define __glibcpp_function_requires(...)
+#define __glibcpp_class_requires(_a,_b)
+#define __glibcpp_class_requires2(_a,_b,_c)
+#define __glibcpp_class_requires3(_a,_b,_c,_d)
+#define __glibcpp_class_requires4(_a,_b,_c,_d,_e)
+
+#else // the checks are on
+
+#include <bits/boost_concept_check.h>
+
+// Note that the obvious and elegant approach of
+//
+//#define glibcpp_function_requires(C) \
+// boost::function_requires< boost::C >()
+//
+// won't work due to concept templates with more than one parameter, e.g.,
+// BinaryPredicateConcept. The preprocessor tries to split things up on
+// the commas in the template argument list. We can't use an inner pair of
+// parenthesis to hide the commas, because "boost::(Temp<Foo,Bar>)" isn't
+// a valid instantiation pattern. Thus, we steal a feature from C99.
+
+#define __glibcpp_function_requires(...) \
+ __gnu_cxx::__function_requires< __gnu_cxx::__VA_ARGS__ >()
+#define __glibcpp_class_requires(_a,_C) \
+ _GLIBCPP_CLASS_REQUIRES(_a, __gnu_cxx, _C)
+#define __glibcpp_class_requires2(_a,_b,_C) \
+ _GLIBCPP_CLASS_REQUIRES2(_a, _b, __gnu_cxx, _C)
+#define __glibcpp_class_requires3(_a,_b,_c,_C) \
+ _GLIBCPP_CLASS_REQUIRES3(_a, _b, _c, __gnu_cxx, _C)
+#define __glibcpp_class_requires4(_a,_b,_c,_d,_C) \
+ _GLIBCPP_CLASS_REQUIRES4(_a, _b, _c, _d, __gnu_cxx, _C)
+
+#endif // enable/disable
+
+#endif // _GLIBCPP_CONCEPT_CHECK
diff --git a/libstdc++-v3/include/bits/cpp_type_traits.h b/libstdc++-v3/include/bits/cpp_type_traits.h
index ae232ad095b..df621c59534 100644
--- a/libstdc++-v3/include/bits/cpp_type_traits.h
+++ b/libstdc++-v3/include/bits/cpp_type_traits.h
@@ -1,6 +1,6 @@
// The -*- C++ -*- type traits classes for internal use in libstdc++
-// Copyright (C) 2000 Free Software Foundation, Inc.
+// Copyright (C) 2000-2001 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,6 +32,8 @@
#ifndef _CPP_BITS_CPP_TYPE_TRAITS_H
#define _CPP_BITS_CPP_TYPE_TRAITS_H 1
+#pragma GCC system_header
+
//
// This file provides some compile-time information about various types.
// These representations were designed, on purpose, to be constant-expressions
@@ -193,7 +195,6 @@ namespace std
};
};
-# ifdef _GLIBCPP_USE_LONG_LONG
template<>
struct __is_integer<long long>
{
@@ -211,7 +212,6 @@ namespace std
_M_type = 1
};
};
-# endif
//
// Floating point types
diff --git a/libstdc++-v3/include/bits/exception_support.h b/libstdc++-v3/include/bits/exception_support.h
deleted file mode 100644
index e4d033c9ada..00000000000
--- a/libstdc++-v3/include/bits/exception_support.h
+++ /dev/null
@@ -1,79 +0,0 @@
-// Methods and support infrastructure for exceptions -*- C++ -*-
-
-// Copyright (C) 2000 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.
-
-//
-// ISO C++ 14882: 15 Exception handling
-//
-
-// This file declares functions whose only purpose is to throw an
-// exception. They help break a circularity between <string> and
-// <stdexcept>. See src/stdexcept.cc, where these functions are
-// defined.
-
-// XXX: These functions serve a similar purpose to those in
-// stl/bits/stl_range_errors.h . Eventually the two approaches should
-// be merged.
-
-#ifndef _CPP_EXCEPTION_SUPPORT_H
-#define _CPP_EXCEPTION_SUPPORT_H 1
-
-namespace std {
-
-#if _GLIBCPP_USE_EXCEPTIONS
- // Internal functions for string implementation.
- extern void __out_of_range(const char *__str);
- extern void __length_error(const char *__str);
-
-# define __OUTOFRANGE(__cond) \
- do { if (__cond) __out_of_range(#__cond); } while (0)
-# define __LENGTHERROR(__cond) \
- do { if (__cond) __length_error(#__cond); } while (0)
-#else
-# include <bits/std_cassert.h>
-# define __OUTOFRANGE(__cond) assert(!(__cond))
-# define __LENGTHERROR(__cond) assert(!(__cond))
-#endif
-
-} // namespace std
-
-#endif /* _CPP_EXCEPTION_SUPPORT_H */
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/libstdc++-v3/include/bits/fpos.h b/libstdc++-v3/include/bits/fpos.h
index 197b80eaf71..86eb5c38e49 100644
--- a/libstdc++-v3/include/bits/fpos.h
+++ b/libstdc++-v3/include/bits/fpos.h
@@ -34,13 +34,13 @@
#ifndef _CPP_BITS_FPOS_H
#define _CPP_BITS_FPOS_H 1
-// Need this here as well as in std_ios because fpos is used in
-// char_traits, and char_traits is used by string, which may or may
-// not have included the std_ios file.
-#include <bits/c++io.h>
+#pragma GCC system_header
-namespace std {
+#include <bits/c++io.h>
+#include <bits/std_cwchar.h> // For mbstate_t.
+namespace std
+{
// 27.4.1 Types
// 27.4.3 Template class fpos
@@ -52,8 +52,8 @@ namespace std {
typedef _StateT __state_type;
private:
- __state_type _M_st;
streamoff _M_off;
+ __state_type _M_st;
public:
__state_type
@@ -64,10 +64,10 @@ namespace std {
// NB: The standard defines only the implicit copy ctor and the
// previous two members. The rest is a "conforming extension".
- fpos(): _M_st(__state_type()), _M_off(streamoff()) { }
+ fpos(): _M_off(streamoff()), _M_st(__state_type()) { }
fpos(streamoff __off, __state_type __st = __state_type())
- : _M_st(__st), _M_off(__off) { }
+ : _M_off(__off), _M_st(__st) { }
operator streamoff() const { return _M_off; }
@@ -77,11 +77,29 @@ namespace std {
fpos&
operator-=(streamoff __off) { _M_off -= __off; return *this; }
+ fpos
+ operator+(streamoff __off)
+ {
+ fpos __t(*this);
+ __t += __off;
+ return __t;
+ }
+
+ fpos
+ operator-(streamoff __off)
+ {
+ fpos __t(*this);
+ __t -= __off;
+ return __t;
+ }
+
bool
- operator==(const fpos& __pos) const { return _M_off == __pos._M_off; }
+ operator==(const fpos& __pos) const
+ { return _M_off == __pos._M_off; }
bool
- operator!=(const fpos& __pos) const { return _M_off != __pos._M_off; }
+ operator!=(const fpos& __pos) const
+ { return _M_off != __pos._M_off; }
streamoff
_M_position() const { return _M_off; }
@@ -90,29 +108,14 @@ namespace std {
_M_position(streamoff __off) { _M_off = __off; }
};
- template<typename _State>
- inline fpos<_State>
- operator+(const fpos<_State>& __pos, streamoff __off)
- {
- fpos<_State> t(__pos);
- return t += __off;
- }
-
- template<typename _State>
- inline fpos<_State>
- operator-(const fpos<_State>& __pos, streamoff __off)
- {
- fpos<_State> t(__pos);
- return t -= __off;
- }
-
- template<typename _State>
- inline streamoff
- operator-(const fpos<_State>& __pos1, const fpos<_State>& __pos2)
- { return __pos1._M_position() - __pos2._M_position(); }
-
+ // 27.2, paragraph 10 about fpos/char_traits circularity
+ typedef fpos<mbstate_t> streampos;
+# ifdef _GLIBCPP_USE_WCHAR_T
+ typedef fpos<mbstate_t> wstreampos;
+# endif
} // namespace std
-#endif /* _CPP_BITS_FPOS_H */
+#endif
+
diff --git a/libstdc++-v3/include/bits/fstream.tcc b/libstdc++-v3/include/bits/fstream.tcc
index f1ffda23eee..54c70463d64 100644
--- a/libstdc++-v3/include/bits/fstream.tcc
+++ b/libstdc++-v3/include/bits/fstream.tcc
@@ -39,7 +39,7 @@ namespace std
template<typename _CharT, typename _Traits>
void
basic_filebuf<_CharT, _Traits>::
- _M_filebuf_init()
+ _M_allocate_file()
{
if (!_M_file)
{
@@ -49,7 +49,7 @@ namespace std
catch(...)
{
delete _M_file;
- throw;
+ __throw_exception_again;
}
}
}
@@ -57,26 +57,53 @@ namespace std
template<typename _CharT, typename _Traits>
void
basic_filebuf<_CharT, _Traits>::
- _M_allocate_buffers()
+ _M_allocate_internal_buffer()
{
- if (!_M_buf)
+ if (!_M_buf && _M_buf_size_opt)
{
_M_buf_size = _M_buf_size_opt;
+
// Allocate internal buffer.
try { _M_buf = new char_type[_M_buf_size]; }
catch(...)
{
delete [] _M_buf;
- throw;
+ __throw_exception_again;
}
-
+ _M_buf_allocated = true;
+ }
+ }
+
+ // Both close and setbuf need to deallocate internal buffers, if it exists.
+ template<typename _CharT, typename _Traits>
+ void
+ basic_filebuf<_CharT, _Traits>::
+ _M_destroy_internal_buffer()
+ {
+ if (_M_buf_allocated)
+ {
+ delete [] _M_buf;
+ _M_buf = NULL;
+ _M_buf_allocated = false;
+ this->setg(NULL, NULL, NULL);
+ this->setp(NULL, NULL);
+ }
+ }
+
+ template<typename _CharT, typename _Traits>
+ void
+ basic_filebuf<_CharT, _Traits>::
+ _M_allocate_pback_buffer()
+ {
+ if (!_M_pback && _M_pback_size)
+ {
// Allocate pback buffer.
try
{ _M_pback = new char_type[_M_pback_size]; }
catch(...)
{
delete [] _M_pback;
- throw;
+ __throw_exception_again;
}
}
}
@@ -85,45 +112,46 @@ namespace std
basic_filebuf<_CharT, _Traits>::
basic_filebuf()
: __streambuf_type(), _M_file(NULL), _M_state_cur(__state_type()),
- _M_state_beg(__state_type()), _M_last_overflowed(false)
- { _M_fcvt = &use_facet<__codecvt_type>(this->getloc()); }
+ _M_state_beg(__state_type()), _M_buf_allocated(false),
+ _M_last_overflowed(false)
+ { }
template<typename _CharT, typename _Traits>
basic_filebuf<_CharT, _Traits>::
- basic_filebuf(int __fd, const char* /*__name*/, ios_base::openmode __mode)
+ basic_filebuf(__c_file_type* __f, ios_base::openmode __mode, int_type __s)
: __streambuf_type(), _M_file(NULL), _M_state_cur(__state_type()),
- _M_state_beg(__state_type()), _M_last_overflowed(false)
+ _M_state_beg(__state_type()), _M_buf_allocated(false),
+ _M_last_overflowed(false)
{
- _M_fcvt = &use_facet<__codecvt_type>(this->getloc());
- _M_filebuf_init();
- _M_file->sys_open(__fd, __mode);
+ _M_allocate_file();
+ _M_file->sys_open(__f, __mode);
if (this->is_open())
{
- _M_allocate_buffers();
_M_mode = __mode;
-
- // XXX So that istream::getc() will only need to get 1 char,
- // as opposed to BUF_SIZE.
- if (__fd == 0)
- _M_buf_size = 1;
-
- this->_M_set_indeterminate();
+ if (__s)
+ {
+ _M_buf_size_opt = __s;
+ _M_allocate_internal_buffer();
+ _M_set_indeterminate();
+ }
+ _M_allocate_pback_buffer();
}
- }
+ }
template<typename _CharT, typename _Traits>
- basic_filebuf<_CharT, _Traits>::__filebuf_type*
+ typename basic_filebuf<_CharT, _Traits>::__filebuf_type*
basic_filebuf<_CharT, _Traits>::
open(const char* __s, ios_base::openmode __mode)
{
__filebuf_type *__ret = NULL;
if (!this->is_open())
{
- _M_filebuf_init();
+ _M_allocate_file();
_M_file->open(__s, __mode);
if (this->is_open())
{
- _M_allocate_buffers();
+ _M_allocate_internal_buffer();
+ _M_allocate_pback_buffer();
_M_mode = __mode;
// For time being, set both (in/out) sets of pointers.
@@ -138,7 +166,7 @@ namespace std
}
template<typename _CharT, typename _Traits>
- basic_filebuf<_CharT, _Traits>::__filebuf_type*
+ typename basic_filebuf<_CharT, _Traits>::__filebuf_type*
basic_filebuf<_CharT, _Traits>::
close()
{
@@ -162,14 +190,12 @@ namespace std
#endif
_M_mode = ios_base::openmode(0);
- if (_M_buf)
+ _M_destroy_internal_buffer();
+
+ if (_M_pback)
{
- delete [] _M_buf;
- _M_buf = NULL;
delete [] _M_pback;
_M_pback = NULL;
- this->setg(NULL, NULL, NULL);
- this->setp(NULL, NULL);
}
__ret = this;
}
@@ -206,13 +232,15 @@ namespace std
}
template<typename _CharT, typename _Traits>
- basic_filebuf<_CharT, _Traits>::int_type
+ typename basic_filebuf<_CharT, _Traits>::int_type
basic_filebuf<_CharT, _Traits>::
underflow()
{
int_type __ret = traits_type::eof();
bool __testin = _M_mode & ios_base::in;
-
+ bool __testout = _M_mode & ios_base::out;
+
+ // XXX Should re-enable codecvt bits disabled after 2.90.8.
if (__testin)
{
// Check for pback madness, and if so swich back to the
@@ -227,14 +255,16 @@ namespace std
bool __testget = _M_in_cur && _M_in_beg < _M_in_cur;
bool __testinit = _M_is_indeterminate();
- bool __testout = _M_mode & ios_base::out;
-
// Sync internal and external buffers.
// NB: __testget -> __testput as _M_buf_unified here.
if (__testget)
{
if (__testout)
_M_really_overflow();
+#if _GLIBCPP_AVOID_FSEEK
+ else if ((_M_in_cur - _M_in_beg) == 1)
+ _M_file->sys_getc();
+#endif
else
_M_file->seekoff(_M_in_cur - _M_in_beg,
ios_base::cur, ios_base::in);
@@ -242,7 +272,7 @@ namespace std
if (__testinit || __testget)
{
-#if 1
+ // Assume buffered case, need to refill internal buffers.
streamsize __size = _M_file->xsgetn(_M_in_beg, _M_buf_size);
if (0 < __size)
{
@@ -250,59 +280,22 @@ namespace std
if (__testout)
_M_out_cur = _M_in_cur;
__ret = traits_type::to_int_type(*_M_in_cur);
+#if _GLIBCPP_AVOID_FSEEK
+ if (__size == 1)
+ _M_file->sys_ungetc(*_M_in_cur);
+ else
+ {
+#endif
streamoff __p = _M_file->seekoff(0 - __size, ios_base::cur,
ios_base::in);
if (__p == -1)
{
// XXX Something is wrong, do error checking.
}
- }
-#else
- // 2000-08-04 bkoz disable
- // Part one: (Re)fill external buf (_M_file->_IO_*) from
- // external byte sequence (whatever physical byte sink or
- // FILE actually is.)
- char_type __conv_buf[_M_buf_size];
- streamsize __size = _M_file->xsgetn(__conv_buf, _M_buf_size);
-
- // Part two: (Re)fill internal buf contents from external buf.
- if (0 < __size)
- {
- _M_set_determinate(__size);
-
- char* __conv_cur = __conv_buf;
- _M_state_beg = _M_state_cur;
- __res_type __r = _M_fcvt->in(_M_state_cur,
- __conv_buf,
- __conv_buf + __size,
- const_cast<const char*&>(__conv_cur),
- _M_in_beg, _M_in_end, _M_in_cur);
-
- if (__r == codecvt_base::partial)
- {
- // XXX Retry with larger _M_buf size.
- }
-
- // Set pointers to internal and external buffers
- // correctly. . .
- if (__r != codecvt_base::error)
- {
- if (__testout)
- _M_out_cur = _M_in_cur;
- __ret = traits_type::to_int_type(*_M_in_cur);
+#if _GLIBCPP_AVOID_FSEEK
}
-
- // Part three: Sync the current internal buffer
- // position with the (now overshot) external buffer
- // position.
- streamoff __p = _M_file->seekoff(0 - __size, ios_base::cur,
- ios_base::in);
- if (__p == -1)
- {
- // XXX Something is wrong, do error checking.
- }
- }
-#endif
+#endif
+ }
}
}
_M_last_overflowed = false;
@@ -310,7 +303,7 @@ namespace std
}
template<typename _CharT, typename _Traits>
- basic_filebuf<_CharT, _Traits>::int_type
+ typename basic_filebuf<_CharT, _Traits>::int_type
basic_filebuf<_CharT, _Traits>::
pbackfail(int_type __i)
{
@@ -378,17 +371,17 @@ namespace std
}
template<typename _CharT, typename _Traits>
- basic_filebuf<_CharT, _Traits>::int_type
+ typename basic_filebuf<_CharT, _Traits>::int_type
basic_filebuf<_CharT, _Traits>::
overflow(int_type __c)
{
int_type __ret = traits_type::eof();
- bool __testpos = _M_out_cur && _M_out_cur >= _M_buf + _M_buf_size;
+ bool __testput = _M_out_cur && _M_out_cur < _M_buf + _M_buf_size;
bool __testout = _M_mode & ios_base::out;
if (__testout)
{
- if (!__testpos)
+ if (__testput)
{
*_M_out_cur = traits_type::to_char_type(__c);
_M_out_cur_move(1);
@@ -403,26 +396,30 @@ namespace std
}
template<typename _CharT, typename _Traits>
- basic_filebuf<_CharT, _Traits>::int_type
+ typename basic_filebuf<_CharT, _Traits>::int_type
basic_filebuf<_CharT, _Traits>::
_M_really_overflow(int_type __c)
{
int_type __ret = traits_type::eof();
bool __testput = _M_out_cur && _M_out_beg < _M_out_end;
-
- if (__testput)
+ bool __testunbuffered = _M_file && !_M_buf_size;
+
+ if (__testput || __testunbuffered)
{
- bool __testeof = traits_type::eq_int_type(__c, traits_type::eof());
#if 1
int __plen = _M_out_end - _M_out_beg;
- streamsize __len = _M_file->xsputn(_M_out_beg, __plen);
- if (!__testeof)
+ streamsize __len = 0;
+
+ if (__plen)
+ __len = _M_file->xsputn(_M_out_beg, __plen);
+
+ if (__c !=traits_type::eof())
{
- char_type __pending = traits_type::to_char_type(__c);
- __len += _M_file->xsputn(&__pending, 1);
- ++__plen;
+ char_type __pending = traits_type::to_char_type(__c);
+ __len += _M_file->xsputn(&__pending, 1);
+ ++__plen;
}
- traits_type::to_char_type(__c);
+
// NB: Need this so that external byte sequence reflects
// internal buffer.
_M_file->sync();
@@ -436,7 +433,7 @@ namespace std
// stack. Convert internal buffer plus __c (ie,
// "pending sequence") to temporary conversion buffer.
int __plen = _M_out_end - _M_out_beg;
- char_type __pbuf[__plen + 1];
+ char_type* __pbuf = static_cast<char_type*>(__builtin_alloca(sizeof(char_type) * __plen + 1));
traits_type::copy(__pbuf, this->pbase(), __plen);
if (!__testeof)
{
@@ -445,7 +442,7 @@ namespace std
}
char_type* __pend;
- char __conv_buf[__plen];
+ char* __conv_buf = static_cast<char*>(__builtin_alloca(__plen));
char* __conv_end;
_M_state_beg = _M_state_cur;
@@ -478,7 +475,35 @@ namespace std
}
template<typename _CharT, typename _Traits>
- basic_filebuf<_CharT, _Traits>::pos_type
+ typename basic_filebuf<_CharT, _Traits>::__streambuf_type*
+ basic_filebuf<_CharT, _Traits>::
+ setbuf(char_type* __s, streamsize __n)
+ {
+ if (!this->is_open() && __s == 0 && __n == 0)
+ _M_buf_size_opt = 0;
+ else if (__s && __n)
+ {
+ // 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.
+ // Step 1: Destroy the current internal array.
+ _M_destroy_internal_buffer();
+
+ // Step 2: Use the external array.
+ _M_buf = __s;
+ _M_buf_size_opt = _M_buf_size = __n;
+ _M_set_indeterminate();
+
+ // Step 3: Make sure a pback buffer is allocated.
+ _M_allocate_pback_buffer();
+ }
+ _M_last_overflowed = false;
+ return this;
+ }
+
+ template<typename _CharT, typename _Traits>
+ typename basic_filebuf<_CharT, _Traits>::pos_type
basic_filebuf<_CharT, _Traits>::
seekoff(off_type __off, ios_base::seekdir __way, ios_base::openmode __mode)
{
@@ -486,7 +511,9 @@ namespace std
bool __testopen = this->is_open();
bool __testin = __mode & ios_base::in && _M_mode & ios_base::in;
bool __testout = __mode & ios_base::out && _M_mode & ios_base::out;
- int __width = _M_fcvt->encoding();
+
+ // Should probably do has_facet checks here.
+ int __width = use_facet<__codecvt_type>(_M_buf_locale).encoding();
if (__width < 0)
__width = 0;
bool __testfail = __off != 0 && __width <= 0;
@@ -532,7 +559,7 @@ namespace std
}
template<typename _CharT, typename _Traits>
- basic_filebuf<_CharT, _Traits>::pos_type
+ typename basic_filebuf<_CharT, _Traits>::pos_type
basic_filebuf<_CharT, _Traits>::
seekpos(pos_type __pos, ios_base::openmode __mode)
{
@@ -557,17 +584,13 @@ namespace std
imbue(const locale& __loc)
{
bool __testbeg = gptr() == eback() && pptr() == pbase();
- bool __teststate = _M_fcvt->encoding() == -1;
-
- _M_buf_locale_init = true;
- if (__testbeg && !__teststate && _M_buf_locale != __loc)
+
+ if (__testbeg && _M_buf_locale != __loc)
{
- // XXX Will need to save these older values.
_M_buf_locale = __loc;
- _M_fcvt = &use_facet<__codecvt_type>(_M_buf_locale);
- // XXX Necessary?
- _M_buf_fctype = &use_facet<__ctype_type>(_M_buf_locale);
+ _M_buf_locale_init = true;
}
+
// NB this may require the reconversion of previously
// converted chars. This in turn may cause the reconstruction
// of the original file. YIKES!!
@@ -580,11 +603,3 @@ namespace std
#endif // _CPP_BITS_FSTREAM_TCC
-
-
-
-
-
-
-
-
diff --git a/libstdc++-v3/include/bits/functexcept.h b/libstdc++-v3/include/bits/functexcept.h
new file mode 100644
index 00000000000..eac2c95b432
--- /dev/null
+++ b/libstdc++-v3/include/bits/functexcept.h
@@ -0,0 +1,85 @@
+// Function-Based Exception Support -*- C++ -*-
+
+// Copyright (C) 2001 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.
+
+//
+// ISO C++ 14882: 19.1 Exception classes
+//
+
+#include <exception_defines.h>
+
+namespace std
+{
+ // Helper for exception objects in <except>
+ void
+ __throw_bad_exception(void);
+
+ // Helper for exception objects in <new>
+ void
+ __throw_bad_alloc(void);
+
+ // Helper for exception objects in <typeinfo>
+ void
+ __throw_bad_cast(void);
+
+ void
+ __throw_bad_typeid(void);
+
+ // Helpers for exception objects in <stdexcept>
+ void
+ __throw_logic_error(const char* __s);
+
+ void
+ __throw_domain_error(const char* __s);
+
+ void
+ __throw_invalid_argument(const char* __s);
+
+ void
+ __throw_length_error(const char* __s);
+
+ void
+ __throw_out_of_range(const char* __s);
+
+ void
+ __throw_runtime_error(const char* __s);
+
+ void
+ __throw_range_error(const char* __s);
+
+ void
+ __throw_overflow_error(const char* __s);
+
+ void
+ __throw_underflow_error(const char* __s);
+
+ // Helpers for exception objects in basic_ios
+ void
+ __throw_ios_failure(const char* __s);
+} // namespace std
+
diff --git a/libstdc++-v3/include/bits/gslice.h b/libstdc++-v3/include/bits/gslice.h
index 737254c9da7..df8ecbe8be9 100644
--- a/libstdc++-v3/include/bits/gslice.h
+++ b/libstdc++-v3/include/bits/gslice.h
@@ -1,6 +1,6 @@
// The template and inlines for the -*- C++ -*- gslice class.
-// Copyright (C) 1997-1999 Free Software Foundation, Inc.
+// Copyright (C) 1997-2001 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
@@ -30,7 +30,9 @@
// Written by Gabriel Dos Reis <Gabriel.Dos-Reis@DPTMaths.ENS-Cachan.Fr>
#ifndef _CPP_BITS_GSLICE_H
-#define _CPP_BITS_GSLICE_H
+#define _CPP_BITS_GSLICE_H 1
+
+#pragma GCC system_header
namespace std {
diff --git a/libstdc++-v3/include/bits/gslice_array.h b/libstdc++-v3/include/bits/gslice_array.h
index 23a1f6d438b..3e2d12fd04d 100644
--- a/libstdc++-v3/include/bits/gslice_array.h
+++ b/libstdc++-v3/include/bits/gslice_array.h
@@ -1,6 +1,6 @@
// The template and inlines for the -*- C++ -*- gslice_array class.
-// Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc.
+// Copyright (C) 1997-2001 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,6 +32,8 @@
#ifndef _CPP_BITS_GSLICE_ARRAY
#define _CPP_BITS_GSLICE_ARRAY 1
+#pragma GCC system_header
+
namespace std {
template<typename _Tp> class gslice_array
diff --git a/libstdc++-v3/include/bits/indirect_array.h b/libstdc++-v3/include/bits/indirect_array.h
index 1ad3b911f6b..e0324b3df24 100644
--- a/libstdc++-v3/include/bits/indirect_array.h
+++ b/libstdc++-v3/include/bits/indirect_array.h
@@ -1,6 +1,6 @@
// The template and inlines for the -*- C++ -*- indirect_array class.
-// Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc.
+// Copyright (C) 1997-2001 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
@@ -30,7 +30,9 @@
// Written by Gabriel Dos Reis <Gabriel.Dos-Reis@DPTMaths.ENS-Cachan.Fr>
#ifndef _CPP_BITS_INDIRECT_ARRAY_H
-#define _CPP_BITS_INDIRECT_ARRAY_H
+#define _CPP_BITS_INDIRECT_ARRAY_H 1
+
+#pragma GCC system_header
namespace std {
diff --git a/libstdc++-v3/include/bits/ios_base.h b/libstdc++-v3/include/bits/ios_base.h
index 12177dafe0f..381e1cb00d7 100644
--- a/libstdc++-v3/include/bits/ios_base.h
+++ b/libstdc++-v3/include/bits/ios_base.h
@@ -34,8 +34,10 @@
#ifndef _CPP_BITS_IOSBASE_H
#define _CPP_BITS_IOSBASE_H 1
-namespace std {
+#pragma GCC system_header
+namespace std
+{
// The following definitions of bitmask types are enums, not ints,
// as permitted (but not required) in the standard, in order to provide
// better type safety in iostream calls. A side effect is that
@@ -292,17 +294,16 @@ namespace std {
public:
Init();
~Init();
+
+ static void
+ _S_ios_create(bool __sync);
+
+ static void
+ _S_ios_destroy();
+
private:
static int _S_ios_base_init;
static bool _S_synced_with_stdio;
- filebuf* _M_cout;
- filebuf* _M_cin;
- filebuf* _M_cerr;
-#ifdef _GLIBCPP_USE_WCHAR_T
- wfilebuf* _M_wcout;
- wfilebuf* _M_wcin;
- wfilebuf* _M_wcerr;
-#endif
};
// Fmtflags state:
@@ -566,11 +567,3 @@ namespace std {
#endif /* _CPP_BITS_IOSBASE_H */
-
-
-
-
-
-
-
-
diff --git a/libstdc++-v3/include/bits/istream.tcc b/libstdc++-v3/include/bits/istream.tcc
index a8da096ae06..a2df71f9440 100644
--- a/libstdc++-v3/include/bits/istream.tcc
+++ b/libstdc++-v3/include/bits/istream.tcc
@@ -30,9 +30,10 @@
//
#include <bits/std_locale.h>
+#include <bits/std_ostream.h> // for flush()
-namespace std {
-
+namespace std
+{
template<typename _CharT, typename _Traits>
basic_istream<_CharT, _Traits>::sentry::
sentry(basic_istream<_CharT, _Traits>& __in, bool __noskipws)
@@ -44,24 +45,16 @@ namespace std {
if (!__noskipws && (__in.flags() & ios_base::skipws))
{
const __int_type __eof = traits_type::eof();
- __int_type __c = __int_type(0);
- __streambuf_type* __sb = __in.rdbuf();
const __ctype_type* __ctype = __in._M_get_fctype_ios();
- bool __testsp = true;
- bool __testeof = false;
-
- while (!__testeof && __testsp)
- {
- __c = __sb->sbumpc();
- __testeof = __c == __eof;
- __testsp = __ctype->is(ctype_base::space, __c);
- }
+ __streambuf_type* __sb = __in.rdbuf();
+ __int_type __c = __sb->sgetc();
- if (!__testeof && !__testsp)
- __sb->sputbackc(__c);
+ while (__c != __eof && __ctype->is(ctype_base::space, __c))
+ __c = __sb->snextc();
+
#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
//195. Should basic_istream::sentry's constructor ever set eofbit?
- else
+ if (__c == __eof)
__in.setstate(ios_base::eofbit);
#endif
}
@@ -81,20 +74,7 @@ namespace std {
basic_istream<_CharT, _Traits>::
operator>>(__istream_type& (*__pf)(__istream_type&))
{
- sentry __cerb(*this, false);
- if (__cerb)
- {
- try {
- __pf(*this);
- }
- catch(exception& __fail){
- // 27.6.1.2.1 Common requirements.
- // Turn this on without causing an ios::failure to be thrown.
- this->setstate(ios_base::badbit);
- if ((this->exceptions() & ios_base::badbit) != 0)
- throw;
- }
- }
+ __pf(*this);
return *this;
}
@@ -103,20 +83,7 @@ namespace std {
basic_istream<_CharT, _Traits>::
operator>>(__ios_type& (*__pf)(__ios_type&))
{
- sentry __cerb(*this, false);
- if (__cerb)
- {
- try {
- __pf(*this);
- }
- catch(exception& __fail){
- // 27.6.1.2.1 Common requirements.
- // Turn this on without causing an ios::failure to be thrown.
- this->setstate(ios_base::badbit);
- if ((this->exceptions() & ios_base::badbit) != 0)
- throw;
- }
- }
+ __pf(*this);
return *this;
}
@@ -125,20 +92,7 @@ namespace std {
basic_istream<_CharT, _Traits>::
operator>>(ios_base& (*__pf)(ios_base&))
{
- sentry __cerb(*this, false);
- if (__cerb)
- {
- try {
- __pf(*this);
- }
- catch(exception& __fail){
- // 27.6.1.2.1 Common requirements.
- // Turn this on without causing an ios::failure to be thrown.
- this->setstate(ios_base::badbit);
- if ((this->exceptions() & ios_base::badbit) != 0)
- throw;
- }
- }
+ __pf(*this);
return *this;
}
@@ -150,18 +104,21 @@ namespace std {
sentry __cerb(*this, false);
if (__cerb)
{
- try {
- iostate __err = iostate(ios_base::goodbit);
- _M_fnumget->get(*this, 0, *this, __err, __n);
- this->setstate(__err);
- }
- catch(exception& __fail){
- // 27.6.1.2.1 Common requirements.
- // Turn this on without causing an ios::failure to be thrown.
- this->setstate(ios_base::badbit);
- if ((this->exceptions() & ios_base::badbit) != 0)
- throw;
- }
+ try
+ {
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ if (_M_check_facet(_M_fnumget))
+ _M_fnumget->get(*this, 0, *this, __err, __n);
+ this->setstate(__err);
+ }
+ catch(exception& __fail)
+ {
+ // 27.6.1.2.1 Common requirements.
+ // Turn this on without causing an ios::failure to be thrown.
+ this->setstate(ios_base::badbit);
+ if ((this->exceptions() & ios_base::badbit) != 0)
+ __throw_exception_again;
+ }
}
return *this;
}
@@ -174,18 +131,21 @@ namespace std {
sentry __cerb(*this, false);
if (__cerb)
{
- try {
- iostate __err = iostate(ios_base::goodbit);
- _M_fnumget->get(*this, 0, *this, __err, __n);
- this->setstate(__err);
- }
- catch(exception& __fail){
- // 27.6.1.2.1 Common requirements.
- // Turn this on without causing an ios::failure to be thrown.
- this->setstate(ios_base::badbit);
- if ((this->exceptions() & ios_base::badbit) != 0)
- throw;
- }
+ try
+ {
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ if (_M_check_facet(_M_fnumget))
+ _M_fnumget->get(*this, 0, *this, __err, __n);
+ this->setstate(__err);
+ }
+ catch(exception& __fail)
+ {
+ // 27.6.1.2.1 Common requirements.
+ // Turn this on without causing an ios::failure to be thrown.
+ this->setstate(ios_base::badbit);
+ if ((this->exceptions() & ios_base::badbit) != 0)
+ __throw_exception_again;
+ }
}
return *this;
}
@@ -198,18 +158,21 @@ namespace std {
sentry __cerb(*this, false);
if (__cerb)
{
- try {
- iostate __err = iostate(ios_base::goodbit);
- _M_fnumget->get(*this, 0, *this, __err, __n);
- this->setstate(__err);
- }
- catch(exception& __fail){
- // 27.6.1.2.1 Common requirements.
- // Turn this on without causing an ios::failure to be thrown.
- this->setstate(ios_base::badbit);
- if ((this->exceptions() & ios_base::badbit) != 0)
- throw;
- }
+ try
+ {
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ if (_M_check_facet(_M_fnumget))
+ _M_fnumget->get(*this, 0, *this, __err, __n);
+ this->setstate(__err);
+ }
+ catch(exception& __fail)
+ {
+ // 27.6.1.2.1 Common requirements.
+ // Turn this on without causing an ios::failure to be thrown.
+ this->setstate(ios_base::badbit);
+ if ((this->exceptions() & ios_base::badbit) != 0)
+ __throw_exception_again;
+ }
}
return *this;
}
@@ -222,18 +185,21 @@ namespace std {
sentry __cerb(*this, false);
if (__cerb)
{
- try {
- iostate __err = iostate(ios_base::goodbit);
- _M_fnumget->get(*this, 0, *this, __err, __n);
- this->setstate(__err);
- }
- catch(exception& __fail){
- // 27.6.1.2.1 Common requirements.
- // Turn this on without causing an ios::failure to be thrown.
- this->setstate(ios_base::badbit);
- if ((this->exceptions() & ios_base::badbit) != 0)
- throw;
- }
+ try
+ {
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ if (_M_check_facet(_M_fnumget))
+ _M_fnumget->get(*this, 0, *this, __err, __n);
+ this->setstate(__err);
+ }
+ catch(exception& __fail)
+ {
+ // 27.6.1.2.1 Common requirements.
+ // Turn this on without causing an ios::failure to be thrown.
+ this->setstate(ios_base::badbit);
+ if ((this->exceptions() & ios_base::badbit) != 0)
+ __throw_exception_again;
+ }
}
return *this;
}
@@ -246,18 +212,21 @@ namespace std {
sentry __cerb(*this, false);
if (__cerb)
{
- try {
- iostate __err = iostate(ios_base::goodbit);
- _M_fnumget->get(*this, 0, *this, __err, __n);
- this->setstate(__err);
- }
- catch(exception& __fail){
- // 27.6.1.2.1 Common requirements.
- // Turn this on without causing an ios::failure to be thrown.
- this->setstate(ios_base::badbit);
- if ((this->exceptions() & ios_base::badbit) != 0)
- throw;
- }
+ try
+ {
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ if (_M_check_facet(_M_fnumget))
+ _M_fnumget->get(*this, 0, *this, __err, __n);
+ this->setstate(__err);
+ }
+ catch(exception& __fail)
+ {
+ // 27.6.1.2.1 Common requirements.
+ // Turn this on without causing an ios::failure to be thrown.
+ this->setstate(ios_base::badbit);
+ if ((this->exceptions() & ios_base::badbit) != 0)
+ __throw_exception_again;
+ }
}
return *this;
}
@@ -270,18 +239,21 @@ namespace std {
sentry __cerb(*this, false);
if (__cerb)
{
- try {
- iostate __err = iostate(ios_base::goodbit);
- _M_fnumget->get(*this, 0, *this, __err, __n);
- this->setstate(__err);
- }
- catch(exception& __fail){
- // 27.6.1.2.1 Common requirements.
- // Turn this on without causing an ios::failure to be thrown.
- this->setstate(ios_base::badbit);
- if ((this->exceptions() & ios_base::badbit) != 0)
- throw;
- }
+ try
+ {
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ if (_M_check_facet(_M_fnumget))
+ _M_fnumget->get(*this, 0, *this, __err, __n);
+ this->setstate(__err);
+ }
+ catch(exception& __fail)
+ {
+ // 27.6.1.2.1 Common requirements.
+ // Turn this on without causing an ios::failure to be thrown.
+ this->setstate(ios_base::badbit);
+ if ((this->exceptions() & ios_base::badbit) != 0)
+ __throw_exception_again;
+ }
}
return *this;
}
@@ -294,18 +266,21 @@ namespace std {
sentry __cerb(*this, false);
if (__cerb)
{
- try {
- iostate __err = iostate(ios_base::goodbit);
- _M_fnumget->get(*this, 0, *this, __err, __n);
- this->setstate(__err);
- }
- catch(exception& __fail){
- // 27.6.1.2.1 Common requirements.
- // Turn this on without causing an ios::failure to be thrown.
- this->setstate(ios_base::badbit);
- if ((this->exceptions() & ios_base::badbit) != 0)
- throw;
- }
+ try
+ {
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ if (_M_check_facet(_M_fnumget))
+ _M_fnumget->get(*this, 0, *this, __err, __n);
+ this->setstate(__err);
+ }
+ catch(exception& __fail)
+ {
+ // 27.6.1.2.1 Common requirements.
+ // Turn this on without causing an ios::failure to be thrown.
+ this->setstate(ios_base::badbit);
+ if ((this->exceptions() & ios_base::badbit) != 0)
+ __throw_exception_again;
+ }
}
return *this;
}
@@ -319,18 +294,21 @@ namespace std {
sentry __cerb(*this, false);
if (__cerb)
{
- try {
- iostate __err = iostate(ios_base::goodbit);
- _M_fnumget->get(*this, 0, *this, __err, __n);
- this->setstate(__err);
- }
- catch(exception& __fail){
- // 27.6.1.2.1 Common requirements.
- // Turn this on without causing an ios::failure to be thrown.
- this->setstate(ios_base::badbit);
- if ((this->exceptions() & ios_base::badbit) != 0)
- throw;
- }
+ try
+ {
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ if (_M_check_facet(_M_fnumget))
+ _M_fnumget->get(*this, 0, *this, __err, __n);
+ this->setstate(__err);
+ }
+ catch(exception& __fail)
+ {
+ // 27.6.1.2.1 Common requirements.
+ // Turn this on without causing an ios::failure to be thrown.
+ this->setstate(ios_base::badbit);
+ if ((this->exceptions() & ios_base::badbit) != 0)
+ __throw_exception_again;
+ }
}
return *this;
}
@@ -343,18 +321,21 @@ namespace std {
sentry __cerb(*this, false);
if (__cerb)
{
- try {
- iostate __err = iostate(ios_base::goodbit);
- _M_fnumget->get(*this, 0, *this, __err, __n);
- this->setstate(__err);
- }
- catch(exception& __fail){
- // 27.6.1.2.1 Common requirements.
- // Turn this on without causing an ios::failure to be thrown.
- this->setstate(ios_base::badbit);
- if ((this->exceptions() & ios_base::badbit) != 0)
- throw;
- }
+ try
+ {
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ if (_M_check_facet(_M_fnumget))
+ _M_fnumget->get(*this, 0, *this, __err, __n);
+ this->setstate(__err);
+ }
+ catch(exception& __fail)
+ {
+ // 27.6.1.2.1 Common requirements.
+ // Turn this on without causing an ios::failure to be thrown.
+ this->setstate(ios_base::badbit);
+ if ((this->exceptions() & ios_base::badbit) != 0)
+ __throw_exception_again;
+ }
}
return *this;
}
@@ -368,18 +349,21 @@ namespace std {
sentry __cerb(*this, false);
if (__cerb)
{
- try {
- iostate __err = iostate(ios_base::goodbit);
- _M_fnumget->get(*this, 0, *this, __err, __n);
- this->setstate(__err);
- }
- catch(exception& __fail){
- // 27.6.1.2.1 Common requirements.
- // Turn this on without causing an ios::failure to be thrown.
- this->setstate(ios_base::badbit);
- if ((this->exceptions() & ios_base::badbit) != 0)
- throw;
- }
+ try
+ {
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ if (_M_check_facet(_M_fnumget))
+ _M_fnumget->get(*this, 0, *this, __err, __n);
+ this->setstate(__err);
+ }
+ catch(exception& __fail)
+ {
+ // 27.6.1.2.1 Common requirements.
+ // Turn this on without causing an ios::failure to be thrown.
+ this->setstate(ios_base::badbit);
+ if ((this->exceptions() & ios_base::badbit) != 0)
+ __throw_exception_again;
+ }
}
return *this;
}
@@ -392,18 +376,21 @@ namespace std {
sentry __cerb(*this, false);
if (__cerb)
{
- try {
- iostate __err = iostate(ios_base::goodbit);
- _M_fnumget->get(*this, 0, *this, __err, __n);
- this->setstate(__err);
- }
- catch(exception& __fail){
- // 27.6.1.2.1 Common requirements.
- // Turn this on without causing an ios::failure to be thrown.
- this->setstate(ios_base::badbit);
- if ((this->exceptions() & ios_base::badbit) != 0)
- throw;
- }
+ try
+ {
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ if (_M_check_facet(_M_fnumget))
+ _M_fnumget->get(*this, 0, *this, __err, __n);
+ this->setstate(__err);
+ }
+ catch(exception& __fail)
+ {
+ // 27.6.1.2.1 Common requirements.
+ // Turn this on without causing an ios::failure to be thrown.
+ this->setstate(ios_base::badbit);
+ if ((this->exceptions() & ios_base::badbit) != 0)
+ __throw_exception_again;
+ }
}
return *this;
}
@@ -416,18 +403,21 @@ namespace std {
sentry __cerb(*this, false);
if (__cerb)
{
- try {
- iostate __err = iostate(ios_base::goodbit);
- _M_fnumget->get(*this, 0, *this, __err, __n);
- this->setstate(__err);
- }
- catch(exception& __fail){
- // 27.6.1.2.1 Common requirements.
- // Turn this on without causing an ios::failure to be thrown.
- this->setstate(ios_base::badbit);
- if ((this->exceptions() & ios_base::badbit) != 0)
- throw;
- }
+ try
+ {
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ if (_M_check_facet(_M_fnumget))
+ _M_fnumget->get(*this, 0, *this, __err, __n);
+ this->setstate(__err);
+ }
+ catch(exception& __fail)
+ {
+ // 27.6.1.2.1 Common requirements.
+ // Turn this on without causing an ios::failure to be thrown.
+ this->setstate(ios_base::badbit);
+ if ((this->exceptions() & ios_base::badbit) != 0)
+ __throw_exception_again;
+ }
}
return *this;
}
@@ -440,18 +430,21 @@ namespace std {
sentry __cerb(*this, false);
if (__cerb)
{
- try {
- iostate __err = iostate(ios_base::goodbit);
- _M_fnumget->get(*this, 0, *this, __err, __n);
- this->setstate(__err);
- }
- catch(exception& __fail){
- // 27.6.1.2.1 Common requirements.
- // Turn this on without causing an ios::failure to be thrown.
- this->setstate(ios_base::badbit);
- if ((this->exceptions() & ios_base::badbit) != 0)
- throw;
- }
+ try
+ {
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ if (_M_check_facet(_M_fnumget))
+ _M_fnumget->get(*this, 0, *this, __err, __n);
+ this->setstate(__err);
+ }
+ catch(exception& __fail)
+ {
+ // 27.6.1.2.1 Common requirements.
+ // Turn this on without causing an ios::failure to be thrown.
+ this->setstate(ios_base::badbit);
+ if ((this->exceptions() & ios_base::badbit) != 0)
+ __throw_exception_again;
+ }
}
return *this;
}
@@ -472,7 +465,7 @@ namespace std {
}
template<typename _CharT, typename _Traits>
- basic_istream<_CharT, _Traits>::int_type
+ typename basic_istream<_CharT, _Traits>::int_type
basic_istream<_CharT, _Traits>::
get(void)
{
@@ -482,21 +475,23 @@ namespace std {
sentry __cerb(*this, true);
if (__cerb)
{
- try {
- __c = this->rdbuf()->sbumpc();
- // 27.6.1.1 paragraph 3
- if (__c != __eof)
- _M_gcount = 1;
- else
- this->setstate(ios_base::eofbit | ios_base::failbit);
- }
- catch(exception& __fail){
- // 27.6.1.3 paragraph 1
- // Turn this on without causing an ios::failure to be thrown.
- this->setstate(ios_base::badbit);
- if ((this->exceptions() & ios_base::badbit) != 0)
- throw;
- }
+ try
+ {
+ __c = this->rdbuf()->sbumpc();
+ // 27.6.1.1 paragraph 3
+ if (__c != __eof)
+ _M_gcount = 1;
+ else
+ this->setstate(ios_base::eofbit | ios_base::failbit);
+ }
+ catch(exception& __fail)
+ {
+ // 27.6.1.3 paragraph 1
+ // Turn this on without causing an ios::failure to be thrown.
+ this->setstate(ios_base::badbit);
+ if ((this->exceptions() & ios_base::badbit) != 0)
+ __throw_exception_again;
+ }
}
return __c;
}
@@ -510,25 +505,27 @@ namespace std {
sentry __cerb(*this, true);
if (__cerb)
{
- try {
- const int_type __eof = traits_type::eof();
- int_type __bufval = this->rdbuf()->sbumpc();
- // 27.6.1.1 paragraph 3
- if (__bufval != __eof)
- {
- _M_gcount = 1;
- __c = traits_type::to_char_type(__bufval);
- }
- else
- this->setstate(ios_base::eofbit | ios_base::failbit);
- }
- catch(exception& __fail){
- // 27.6.1.3 paragraph 1
- // Turn this on without causing an ios::failure to be thrown.
- this->setstate(ios_base::badbit);
- if ((this->exceptions() & ios_base::badbit) != 0)
- throw;
- }
+ try
+ {
+ const int_type __eof = traits_type::eof();
+ int_type __bufval = this->rdbuf()->sbumpc();
+ // 27.6.1.1 paragraph 3
+ if (__bufval != __eof)
+ {
+ _M_gcount = 1;
+ __c = traits_type::to_char_type(__bufval);
+ }
+ else
+ this->setstate(ios_base::eofbit | ios_base::failbit);
+ }
+ catch(exception& __fail)
+ {
+ // 27.6.1.3 paragraph 1
+ // Turn this on without causing an ios::failure to be thrown.
+ this->setstate(ios_base::badbit);
+ if ((this->exceptions() & ios_base::badbit) != 0)
+ __throw_exception_again;
+ }
}
return *this;
}
@@ -542,36 +539,38 @@ namespace std {
sentry __cerb(*this, true);
if (__cerb && __n > 1)
{
- try {
- const int_type __idelim = traits_type::to_int_type(__delim);
- const int_type __eof = traits_type::eof();
- __streambuf_type* __sb = this->rdbuf();
- int_type __c = __sb->sbumpc();
- bool __testdelim = __c == __idelim;
- bool __testeof = __c == __eof;
-
- while (_M_gcount < __n - 1 && !__testeof && !__testdelim)
- {
- *__s++ = traits_type::to_char_type(__c);
- ++_M_gcount;
- __c = __sb->sbumpc();
- __testeof = __c == __eof;
- __testdelim = __c == __idelim;
- }
- if (__testdelim || _M_gcount == __n - 1)
- __sb->sputbackc(__c);
- if (__testeof)
- this->setstate(ios_base::eofbit);
- }
- catch(exception& __fail){
- // 27.6.1.3 paragraph 1
- // Turn this on without causing an ios::failure to be thrown.
- this->setstate(ios_base::badbit);
- if ((this->exceptions() & ios_base::badbit) != 0)
- throw;
- }
+ try
+ {
+ const int_type __idelim = traits_type::to_int_type(__delim);
+ const int_type __eof = traits_type::eof();
+ __streambuf_type* __sb = this->rdbuf();
+ int_type __c = __sb->sbumpc();
+ bool __testdelim = __c == __idelim;
+ bool __testeof = __c == __eof;
+
+ while (_M_gcount < __n - 1 && !__testeof && !__testdelim)
+ {
+ *__s++ = traits_type::to_char_type(__c);
+ ++_M_gcount;
+ __c = __sb->sbumpc();
+ __testeof = __c == __eof;
+ __testdelim = __c == __idelim;
+ }
+ if (__testdelim || _M_gcount == __n - 1)
+ __sb->sputbackc(__c);
+ if (__testeof)
+ this->setstate(ios_base::eofbit);
+ }
+ catch(exception& __fail)
+ {
+ // 27.6.1.3 paragraph 1
+ // Turn this on without causing an ios::failure to be thrown.
+ this->setstate(ios_base::badbit);
+ if ((this->exceptions() & ios_base::badbit) != 0)
+ __throw_exception_again;
+ }
}
- *__s = char_type(NULL);
+ *__s = char_type();
if (!_M_gcount)
this->setstate(ios_base::failbit);
return *this;
@@ -588,32 +587,34 @@ namespace std {
{
int_type __c;
__streambuf_type* __this_sb = this->rdbuf();
- try {
- const int_type __idelim = traits_type::to_int_type(__delim);
- const int_type __eof = traits_type::eof();
- __c = __this_sb->sbumpc();
- bool __testdelim = __c == __idelim;
- bool __testeof = __c == __eof;
- bool __testput = true;
-
- while (!__testeof && !__testdelim
- && (__testput = __sb.sputc(traits_type::to_char_type(__c))
- != __eof))
- {
- ++_M_gcount;
- __c = __this_sb->sbumpc();
- __testeof = __c == __eof;
- __testdelim = __c == __idelim;
- }
- if (__testdelim || !__testput)
+ try
+ {
+ const int_type __idelim = traits_type::to_int_type(__delim);
+ const int_type __eof = traits_type::eof();
+ __c = __this_sb->sbumpc();
+ bool __testdelim = __c == __idelim;
+ bool __testeof = __c == __eof;
+ bool __testput = true;
+
+ while (!__testeof && !__testdelim
+ && (__testput = __sb.sputc(traits_type::to_char_type(__c))
+ != __eof))
+ {
+ ++_M_gcount;
+ __c = __this_sb->sbumpc();
+ __testeof = __c == __eof;
+ __testdelim = __c == __idelim;
+ }
+ if (__testdelim || !__testput)
+ __this_sb->sputbackc(traits_type::to_char_type(__c));
+ if (__testeof)
+ this->setstate(ios_base::eofbit);
+ }
+ catch(exception& __fail)
+ {
+ // Exception may result from sputc->overflow.
__this_sb->sputbackc(traits_type::to_char_type(__c));
- if (__testeof)
- this->setstate(ios_base::eofbit);
- }
- catch(exception& __fail){
- // Exception may result from sputc->overflow.
- __this_sb->sputbackc(traits_type::to_char_type(__c));
- }
+ }
}
if (!_M_gcount)
this->setstate(ios_base::failbit);
@@ -629,45 +630,47 @@ namespace std {
sentry __cerb(*this, true);
if (__cerb)
{
- try {
- __streambuf_type* __sb = this->rdbuf();
- int_type __c = __sb->sbumpc();
- ++_M_gcount;
- const int_type __idelim = traits_type::to_int_type(__delim);
- const int_type __eof = traits_type::eof();
- bool __testdelim = __c == __idelim;
- bool __testeof = __c == __eof;
-
- while (_M_gcount < __n && !__testeof && !__testdelim)
- {
- *__s++ = traits_type::to_char_type(__c);
- __c = __sb->sbumpc();
- ++_M_gcount;
- __testeof = __c == __eof;
- __testdelim = __c == __idelim;
- }
+ try
+ {
+ __streambuf_type* __sb = this->rdbuf();
+ int_type __c = __sb->sbumpc();
+ ++_M_gcount;
+ const int_type __idelim = traits_type::to_int_type(__delim);
+ const int_type __eof = traits_type::eof();
+ bool __testdelim = __c == __idelim;
+ bool __testeof = __c == __eof;
- if (__testeof)
- {
- --_M_gcount;
- this->setstate(ios_base::eofbit);
- }
- else if (!__testdelim)
- {
- --_M_gcount;
- __sb->sputbackc(traits_type::to_char_type(__c));
- this->setstate(ios_base::failbit);
- }
- }
- catch(exception& __fail){
- // 27.6.1.3 paragraph 1
- // Turn this on without causing an ios::failure to be thrown.
- this->setstate(ios_base::badbit);
- if ((this->exceptions() & ios_base::badbit) != 0)
- throw;
- }
+ while (_M_gcount < __n && !__testeof && !__testdelim)
+ {
+ *__s++ = traits_type::to_char_type(__c);
+ __c = __sb->sbumpc();
+ ++_M_gcount;
+ __testeof = __c == __eof;
+ __testdelim = __c == __idelim;
+ }
+
+ if (__testeof)
+ {
+ --_M_gcount;
+ this->setstate(ios_base::eofbit);
+ }
+ else if (!__testdelim)
+ {
+ --_M_gcount;
+ __sb->sputbackc(traits_type::to_char_type(__c));
+ this->setstate(ios_base::failbit);
+ }
+ }
+ catch(exception& __fail)
+ {
+ // 27.6.1.3 paragraph 1
+ // Turn this on without causing an ios::failure to be thrown.
+ this->setstate(ios_base::badbit);
+ if ((this->exceptions() & ios_base::badbit) != 0)
+ __throw_exception_again;
+ }
}
- *__s = char_type(NULL);
+ *__s = char_type();
if (!_M_gcount)
this->setstate(ios_base::failbit);
return *this;
@@ -682,40 +685,42 @@ namespace std {
sentry __cerb(*this, true);
if (__cerb && __n > 0)
{
- try {
- const int_type __idelim = traits_type::to_int_type(__delim);
- const int_type __eof = traits_type::eof();
- __streambuf_type* __sb = this->rdbuf();
- int_type __c = __sb->sbumpc();
- bool __testdelim = __c == __idelim;
- bool __testeof = __c == __eof;
-
- __n = min(__n, numeric_limits<streamsize>::max());
- while (_M_gcount < __n - 1 && !__testeof && !__testdelim)
- {
+ try
+ {
+ const int_type __idelim = traits_type::to_int_type(__delim);
+ const int_type __eof = traits_type::eof();
+ __streambuf_type* __sb = this->rdbuf();
+ int_type __c = __sb->sbumpc();
+ bool __testdelim = __c == __idelim;
+ bool __testeof = __c == __eof;
+
+ __n = min(__n, numeric_limits<streamsize>::max());
+ while (_M_gcount < __n - 1 && !__testeof && !__testdelim)
+ {
+ ++_M_gcount;
+ __c = __sb->sbumpc();
+ __testeof = __c == __eof;
+ __testdelim = __c == __idelim;
+ }
+ if ((_M_gcount == __n - 1 && !__testeof) || __testdelim)
++_M_gcount;
- __c = __sb->sbumpc();
- __testeof = __c == __eof;
- __testdelim = __c == __idelim;
- }
- if ((_M_gcount == __n - 1 && !__testeof) || __testdelim)
- ++_M_gcount;
- if (__testeof)
- this->setstate(ios_base::eofbit);
- }
- catch(exception& __fail){
- // 27.6.1.3 paragraph 1
- // Turn this on without causing an ios::failure to be thrown.
- this->setstate(ios_base::badbit);
- if ((this->exceptions() & ios_base::badbit) != 0)
- throw;
- }
+ if (__testeof)
+ this->setstate(ios_base::eofbit);
+ }
+ catch(exception& __fail)
+ {
+ // 27.6.1.3 paragraph 1
+ // Turn this on without causing an ios::failure to be thrown.
+ this->setstate(ios_base::badbit);
+ if ((this->exceptions() & ios_base::badbit) != 0)
+ __throw_exception_again;
+ }
}
return *this;
}
template<typename _CharT, typename _Traits>
- basic_istream<_CharT, _Traits>::int_type
+ typename basic_istream<_CharT, _Traits>::int_type
basic_istream<_CharT, _Traits>::
peek(void)
{
@@ -724,16 +729,16 @@ namespace std {
sentry __cerb(*this, true);
if (__cerb)
{
- try {
- __c = this->rdbuf()->sgetc();
- }
- catch(exception& __fail){
- // 27.6.1.3 paragraph 1
- // Turn this on without causing an ios::failure to be thrown.
- this->setstate(ios_base::badbit);
- if ((this->exceptions() & ios_base::badbit) != 0)
- throw;
- }
+ try
+ { __c = this->rdbuf()->sgetc(); }
+ catch(exception& __fail)
+ {
+ // 27.6.1.3 paragraph 1
+ // Turn this on without causing an ios::failure to be thrown.
+ this->setstate(ios_base::badbit);
+ if ((this->exceptions() & ios_base::badbit) != 0)
+ __throw_exception_again;
+ }
}
return __c;
}
@@ -749,35 +754,37 @@ namespace std {
{
if (__n > 0)
{
- try {
- const int_type __eof = traits_type::eof();
- __streambuf_type* __sb = this->rdbuf();
- int_type __c = __sb->sbumpc();
- bool __testeof = __c == __eof;
-
- while (_M_gcount < __n - 1 && !__testeof)
- {
- *__s++ = traits_type::to_char_type(__c);
- ++_M_gcount;
- __c = __sb->sbumpc();
- __testeof = __c == __eof;
- }
- if (__testeof)
- this->setstate(ios_base::eofbit | ios_base::failbit);
- else
- {
- // _M_gcount == __n - 1
- *__s++ = traits_type::to_char_type(__c);
- ++_M_gcount;
- }
- }
- catch(exception& __fail){
- // 27.6.1.3 paragraph 1
- // Turn this on without causing an ios::failure to be thrown.
- this->setstate(ios_base::badbit);
- if ((this->exceptions() & ios_base::badbit) != 0)
- throw;
- }
+ try
+ {
+ const int_type __eof = traits_type::eof();
+ __streambuf_type* __sb = this->rdbuf();
+ int_type __c = __sb->sbumpc();
+ bool __testeof = __c == __eof;
+
+ while (_M_gcount < __n - 1 && !__testeof)
+ {
+ *__s++ = traits_type::to_char_type(__c);
+ ++_M_gcount;
+ __c = __sb->sbumpc();
+ __testeof = __c == __eof;
+ }
+ if (__testeof)
+ this->setstate(ios_base::eofbit | ios_base::failbit);
+ else
+ {
+ // _M_gcount == __n - 1
+ *__s++ = traits_type::to_char_type(__c);
+ ++_M_gcount;
+ }
+ }
+ catch(exception& __fail)
+ {
+ // 27.6.1.3 paragraph 1
+ // Turn this on without causing an ios::failure to be thrown.
+ this->setstate(ios_base::badbit);
+ if ((this->exceptions() & ios_base::badbit) != 0)
+ __throw_exception_again;
+ }
}
}
else
@@ -797,24 +804,25 @@ namespace std {
{
if (__n > 0)
{
- try {
- streamsize __num = this->rdbuf()->in_avail();
- if (__num != static_cast<streamsize>(__eof))
- {
- __num = min(__num, __n);
- _M_gcount = this->rdbuf()->sgetn(__s, __num);
- }
- else
- this->setstate(ios_base::eofbit);
- }
-
- catch(exception& __fail){
- // 27.6.1.3 paragraph 1
- // Turn this on without causing an ios::failure to be thrown.
- this->setstate(ios_base::badbit);
- if ((this->exceptions() & ios_base::badbit) != 0)
- throw;
- }
+ try
+ {
+ streamsize __num = this->rdbuf()->in_avail();
+ if (__num != static_cast<streamsize>(__eof))
+ {
+ __num = min(__num, __n);
+ _M_gcount = this->rdbuf()->sgetn(__s, __num);
+ }
+ else
+ this->setstate(ios_base::eofbit);
+ }
+ catch(exception& __fail)
+ {
+ // 27.6.1.3 paragraph 1
+ // Turn this on without causing an ios::failure to be thrown.
+ this->setstate(ios_base::badbit);
+ if ((this->exceptions() & ios_base::badbit) != 0)
+ __throw_exception_again;
+ }
}
}
else
@@ -830,19 +838,21 @@ namespace std {
sentry __cerb(*this, true);
if (__cerb)
{
- try {
- const int_type __eof = traits_type::eof();
- __streambuf_type* __sb = this->rdbuf();
- if (!__sb || __sb->sputbackc(__c) == __eof)
- this->setstate(ios_base::badbit);
- }
- catch(exception& __fail){
- // 27.6.1.3 paragraph 1
- // Turn this on without causing an ios::failure to be thrown.
- this->setstate(ios_base::badbit);
- if ((this->exceptions() & ios_base::badbit) != 0)
- throw;
- }
+ try
+ {
+ const int_type __eof = traits_type::eof();
+ __streambuf_type* __sb = this->rdbuf();
+ if (!__sb || __sb->sputbackc(__c) == __eof)
+ this->setstate(ios_base::badbit);
+ }
+ catch(exception& __fail)
+ {
+ // 27.6.1.3 paragraph 1
+ // Turn this on without causing an ios::failure to be thrown.
+ this->setstate(ios_base::badbit);
+ if ((this->exceptions() & ios_base::badbit) != 0)
+ __throw_exception_again;
+ }
}
else
this->setstate(ios_base::failbit);
@@ -858,19 +868,21 @@ namespace std {
sentry __cerb(*this, true);
if (__cerb)
{
- try {
- const int_type __eof = traits_type::eof();
- __streambuf_type* __sb = this->rdbuf();
- if (!__sb || __eof == __sb->sungetc())
- this->setstate(ios_base::badbit);
- }
- catch(exception& __fail){
- // 27.6.1.3 paragraph 1
- // Turn this on without causing an ios::failure to be thrown.
- this->setstate(ios_base::badbit);
- if ((this->exceptions() & ios_base::badbit) != 0)
- throw;
- }
+ try
+ {
+ const int_type __eof = traits_type::eof();
+ __streambuf_type* __sb = this->rdbuf();
+ if (!__sb || __eof == __sb->sungetc())
+ this->setstate(ios_base::badbit);
+ }
+ catch(exception& __fail)
+ {
+ // 27.6.1.3 paragraph 1
+ // Turn this on without causing an ios::failure to be thrown.
+ this->setstate(ios_base::badbit);
+ if ((this->exceptions() & ios_base::badbit) != 0)
+ __throw_exception_again;
+ }
}
else
this->setstate(ios_base::failbit);
@@ -887,20 +899,22 @@ namespace std {
sentry __cerb(*this, true);
if (__cerb)
{
- try {
- __streambuf_type* __sb = this->rdbuf();
- if (!__sb || __ret == __sb->pubsync())
- this->setstate(ios_base::badbit);
- else
- __ret = 0;
- }
- catch(exception& __fail){
- // 27.6.1.3 paragraph 1
- // Turn this on without causing an ios::failure to be thrown.
- this->setstate(ios_base::badbit);
- if ((this->exceptions() & ios_base::badbit) != 0)
- throw;
- }
+ try
+ {
+ __streambuf_type* __sb = this->rdbuf();
+ if (!__sb || __ret == __sb->pubsync())
+ this->setstate(ios_base::badbit);
+ else
+ __ret = 0;
+ }
+ catch(exception& __fail)
+ {
+ // 27.6.1.3 paragraph 1
+ // Turn this on without causing an ios::failure to be thrown.
+ this->setstate(ios_base::badbit);
+ if ((this->exceptions() & ios_base::badbit) != 0)
+ __throw_exception_again;
+ }
}
return __ret;
}
@@ -915,16 +929,18 @@ namespace std {
sentry __cerb(*this, true);
if (__cerb)
{
- try {
- __ret = this->rdbuf()->pubseekoff(0, ios_base::cur, ios_base::in);
- }
- catch(exception& __fail){
- // 27.6.1.3 paragraph 1
- // Turn this on without causing an ios::failure to be thrown.
- this->setstate(ios_base::badbit);
- if ((this->exceptions() & ios_base::badbit) != 0)
- throw;
- }
+ try
+ {
+ __ret = this->rdbuf()->pubseekoff(0, ios_base::cur, ios_base::in);
+ }
+ catch(exception& __fail)
+ {
+ // 27.6.1.3 paragraph 1
+ // Turn this on without causing an ios::failure to be thrown.
+ this->setstate(ios_base::badbit);
+ if ((this->exceptions() & ios_base::badbit) != 0)
+ __throw_exception_again;
+ }
}
return __ret;
}
@@ -939,19 +955,25 @@ namespace std {
sentry __cerb(*this, true);
if (__cerb)
{
- try {
+ try
+ {
#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
// 136. seekp, seekg setting wrong streams?
- this->rdbuf()->pubseekpos(__pos, ios_base::in);
+ pos_type __err = this->rdbuf()->pubseekpos(__pos, ios_base::in);
+
+// 129. Need error indication from seekp() and seekg()
+ if (__err == pos_type(off_type(-1)))
+ this->setstate(failbit);
#endif
- }
- catch(exception& __fail){
- // 27.6.1.3 paragraph 1
- // Turn this on without causing an ios::failure to be thrown.
- this->setstate(ios_base::badbit);
- if ((this->exceptions() & ios_base::badbit) != 0)
- throw;
- }
+ }
+ catch(exception& __fail)
+ {
+ // 27.6.1.3 paragraph 1
+ // Turn this on without causing an ios::failure to be thrown.
+ this->setstate(ios_base::badbit);
+ if ((this->exceptions() & ios_base::badbit) != 0)
+ __throw_exception_again;
+ }
}
return *this;
}
@@ -965,19 +987,26 @@ namespace std {
sentry __cerb(*this, true);
if (__cerb)
{
- try {
+ try
+ {
#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
// 136. seekp, seekg setting wrong streams?
- this->rdbuf()->pubseekoff(__off, __dir, ios_base::in);
+ pos_type __err = this->rdbuf()->pubseekoff(__off, __dir,
+ ios_base::in);
+
+// 129. Need error indication from seekp() and seekg()
+ if (__err == pos_type(off_type(-1)))
+ this->setstate(failbit);
#endif
- }
- catch(exception& __fail){
- // 27.6.1.3 paragraph 1
- // Turn this on without causing an ios::failure to be thrown.
- this->setstate(ios_base::badbit);
- if ((this->exceptions() & ios_base::badbit) != 0)
- throw;
- }
+ }
+ catch(exception& __fail)
+ {
+ // 27.6.1.3 paragraph 1
+ // Turn this on without causing an ios::failure to be thrown.
+ this->setstate(ios_base::badbit);
+ if ((this->exceptions() & ios_base::badbit) != 0)
+ __throw_exception_again;
+ }
}
return *this;
}
@@ -988,19 +1017,19 @@ namespace std {
operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c)
{
typedef basic_istream<_CharT, _Traits> __istream_type;
- __istream_type::sentry __cerb(__in, false);
+ typename __istream_type::sentry __cerb(__in, false);
if (__cerb)
{
- try {
- __in.get(__c);
- }
- catch(exception& __fail){
- // 27.6.1.2.1 Common requirements.
- // Turn this on without causing an ios::failure to be thrown.
- __in.setstate(ios_base::badbit);
- if ((__in.exceptions() & ios_base::badbit) != 0)
- throw;
- }
+ try
+ { __in.get(__c); }
+ catch(exception& __fail)
+ {
+ // 27.6.1.2.1 Common requirements.
+ // Turn this on without causing an ios::failure to be thrown.
+ __in.setstate(ios_base::badbit);
+ if ((__in.exceptions() & ios_base::badbit) != 0)
+ __throw_exception_again;
+ }
}
else
__in.setstate(ios_base::failbit);
@@ -1016,51 +1045,53 @@ namespace std {
typedef typename _Traits::int_type int_type;
typedef _CharT char_type;
typedef ctype<_CharT> __ctype_type;
- int_type __extracted = 0;
+ streamsize __extracted = 0;
- __istream_type::sentry __cerb(__in, false);
+ typename __istream_type::sentry __cerb(__in, false);
if (__cerb)
{
- try {
- // Figure out how many characters to extract.
- int_type __num = static_cast<int_type>(__in.width());
- if (__num <= 0)
- __num = basic_string<_CharT, _Traits>::npos;
-
- __streambuf_type* __sb = __in.rdbuf();
- const __ctype_type* __ctype = __in._M_get_fctype_ios();
- int_type __c = __sb->sbumpc();
- const int_type __eof = _Traits::eof();
- bool __testsp = __ctype->is(ctype_base::space, __c);
- bool __testeof = __c == __eof;
-
- while (__extracted < __num - 1 && !__testeof && !__testsp)
- {
- *__s++ = __c;
- ++__extracted;
- __c = __sb->sbumpc();
- __testeof = __c == __eof;
- __testsp = __ctype->is(ctype_base::space, __c);
- }
-
- if (!__testeof)
- __sb->sputbackc(__c);
- else
- __in.setstate(ios_base::eofbit);
+ try
+ {
+ // Figure out how many characters to extract.
+ streamsize __num = __in.width();
+ if (__num == 0)
+ __num = numeric_limits<streamsize>::max();
+
+ __streambuf_type* __sb = __in.rdbuf();
+ const __ctype_type* __ctype = __in._M_get_fctype_ios();
+ int_type __c = __sb->sbumpc();
+ const int_type __eof = _Traits::eof();
+ bool __testsp = __ctype->is(ctype_base::space, __c);
+ bool __testeof = __c == __eof;
+
+ while (__extracted < __num - 1 && !__testeof && !__testsp)
+ {
+ *__s++ = __c;
+ ++__extracted;
+ __c = __sb->sbumpc();
+ __testeof = __c == __eof;
+ __testsp = __ctype->is(ctype_base::space, __c);
+ }
+
+ if (!__testeof)
+ __sb->sputbackc(__c);
+ else
+ __in.setstate(ios_base::eofbit);
#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
//68. Extractors for char* should store null at end
- *__s = char_type();
+ *__s = char_type();
#endif
- __in.width(0);
- }
- catch(exception& __fail){
- // 27.6.1.2.1 Common requirements.
- // Turn this on without causing an ios::failure to be thrown.
- __in.setstate(ios_base::badbit);
- if ((__in.exceptions() & ios_base::badbit) != 0)
- throw;
- }
+ __in.width(0);
+ }
+ catch(exception& __fail)
+ {
+ // 27.6.1.2.1 Common requirements.
+ // Turn this on without causing an ios::failure to be thrown.
+ __in.setstate(ios_base::badbit);
+ if ((__in.exceptions() & ios_base::badbit) != 0)
+ __throw_exception_again;
+ }
}
if (!__extracted)
__in.setstate(ios_base::failbit);
@@ -1113,9 +1144,9 @@ namespace std {
typedef typename __istream_type::__ctype_type __ctype_type;
typedef basic_string<_CharT, _Traits, _Alloc> __string_type;
typedef typename __string_type::size_type __size_type;
- __int_type __extracted = 0;
+ __size_type __extracted = 0;
- __istream_type::sentry __cerb(__in, false);
+ typename __istream_type::sentry __cerb(__in, false);
if (__cerb)
{
__str.erase();
@@ -1166,7 +1197,7 @@ namespace std {
__size_type __extracted = 0;
bool __testdelim = false;
- __istream_type::sentry __cerb(__in, true);
+ typename __istream_type::sentry __cerb(__in, true);
if (__cerb)
{
__str.erase();
@@ -1200,23 +1231,9 @@ namespace std {
getline(basic_istream<_CharT, _Traits>& __in,
basic_string<_CharT,_Traits,_Alloc>& __str)
{ return getline(__in, __str, __in.widen('\n')); }
-
} // namespace std
// Local Variables:
// mode:C++
// End:
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/libstdc++-v3/include/bits/limits_generic.h b/libstdc++-v3/include/bits/limits_generic.h
index 45fcccb12dc..a5dd2996310 100644
--- a/libstdc++-v3/include/bits/limits_generic.h
+++ b/libstdc++-v3/include/bits/limits_generic.h
@@ -1,6 +1,6 @@
// The template and inlines for the -*- C++ -*- numeric_limits classes.
-// Copyright (C) 2000 Free Software Foundation, Inc.
+// Copyright (C) 2000-2001 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
@@ -35,9 +35,16 @@
// 18.2.1
//
+/** @file limits_generic.h
+ * ISO 14882:1998
+ * 18.2.1
+ */
+
#ifndef _CPP_NUMERIC_LIMITS
#define _CPP_NUMERIC_LIMITS 1
+#pragma GCC system_header
+
#include <bits/c++config.h>
#include <bits/std_cfloat.h>
#include <bits/std_climits.h>
@@ -47,6 +54,7 @@
namespace std {
+ /// Rounding style determines the behavior of floating-point calculations.
enum float_round_style {
round_indeterminate = -1,
round_toward_zero = 0,
@@ -55,12 +63,20 @@ namespace std {
round_toward_neg_infinity = 3
};
+ /// This enum signals whether a type has denormalization.
enum float_denorm_style {
denorm_indeterminate = -1,
denorm_absent = 0,
denorm_present = 1
};
+ /**
+ * [18.2.1]/1: "The numeric_limits component provides a C++ program
+ * with information about various properties of the implementation's
+ * representation of the fundamental types." All of the standard
+ * fundamental types have specializations of this class template.
+ * @brief Properties of fundamental types on a per-platform basis.
+ */
template<typename _T> struct numeric_limits {
static const bool is_specialized = false;
@@ -115,8 +131,8 @@ namespace std {
static bool max() throw()
{ return true; }
- static const int digits = 8;
- static const int digits10 = 2;
+ static const int digits = 1;
+ static const int digits10 = 0;
static const bool is_signed = false;
static const bool is_integer = true;
static const bool is_exact = true;
@@ -146,9 +162,9 @@ namespace std {
static bool denorm_min() throw()
{ return static_cast<bool>(0); }
- static const bool is_iec559 = true;
+ static const bool is_iec559 = false;
static const bool is_bounded = true;
- static const bool is_modulo = true;
+ static const bool is_modulo = false;
static const bool traps = false;
static const bool tinyness_before = false;
@@ -453,8 +469,13 @@ namespace std {
static int max() throw()
{ return INT_MAX; }
+#if INT_MAX > 32767
static const int digits = 31;
static const int digits10 = 9;
+#else
+ static const int digits = 15;
+ static const int digits10 = 4;
+#endif
static const bool is_signed = true;
static const bool is_integer = true;
static const bool is_exact = true;
@@ -501,8 +522,13 @@ namespace std {
static unsigned int max() throw()
{ return UINT_MAX; }
+#if INT_MAX > 32767
static const int digits = 32;
static const int digits10 = 9;
+#else
+ static const int digits = 16;
+ static const int digits10 = 4;
+#endif
static const bool is_signed = false;
static const bool is_integer = true;
static const bool is_exact = true;
@@ -549,8 +575,16 @@ namespace std {
static long max() throw()
{ return LONG_MAX; }
+#if LONG_MAX > 2147483647
+ static const int digits = 63;
+ static const int digits10 = 18;
+#elif LONG_MAX > 32767
static const int digits = 31;
static const int digits10 = 9;
+#else
+ static const int digits = 15;
+ static const int digits10 = 4;
+#endif
static const bool is_signed = true;
static const bool is_integer = true;
static const bool is_exact = true;
@@ -597,8 +631,16 @@ namespace std {
static unsigned long max() throw()
{ return ULONG_MAX; }
+#if LONG_MAX > 2147483647
+ static const int digits = 64;
+ static const int digits10 = 19;
+#elif LONG_MAX > 32767
static const int digits = 32;
static const int digits10 = 9;
+#else
+ static const int digits = 16;
+ static const int digits10 = 4;
+#endif
static const bool is_signed = false;
static const bool is_integer = true;
static const bool is_exact = true;
diff --git a/libstdc++-v3/include/bits/locale_facets.h b/libstdc++-v3/include/bits/locale_facets.h
index 6d71b81bd82..70db9ffca4e 100644
--- a/libstdc++-v3/include/bits/locale_facets.h
+++ b/libstdc++-v3/include/bits/locale_facets.h
@@ -36,6 +36,8 @@
#ifndef _CPP_BITS_LOCFACETS_H
#define _CPP_BITS_LOCFACETS_H 1
+#pragma GCC system_header
+
#include <bits/std_ctime.h> // For struct tm
#include <bits/std_ios.h> // For ios_base
#ifdef _GLIBCPP_USE_WCHAR_T
@@ -79,33 +81,33 @@ namespace std
{ return this->do_toupper(__c); }
const char_type*
- toupper(char_type *__low, const char_type* __high) const
- { return this->do_toupper(__low, __high); }
+ toupper(char_type *__lo, const char_type* __hi) const
+ { return this->do_toupper(__lo, __hi); }
char_type
tolower(char_type __c) const
{ return this->do_tolower(__c); }
const char_type*
- tolower(char_type* __low, const char_type* __high) const
- { return this->do_tolower(__low, __high); }
+ tolower(char_type* __lo, const char_type* __hi) const
+ { return this->do_tolower(__lo, __hi); }
char_type
widen(char __c) const
{ return this->do_widen(__c); }
const char*
- widen(const char* __low, const char* __high, char_type* __to) const
- { return this->do_widen(__low, __high, __to); }
+ widen(const char* __lo, const char* __hi, char_type* __to) const
+ { return this->do_widen(__lo, __hi, __to); }
char
narrow(char_type __c, char __dfault) const
{ return this->do_narrow(__c, __dfault); }
const char_type*
- narrow(const char_type* __low, const char_type* __high,
+ narrow(const char_type* __lo, const char_type* __hi,
char __dfault, char *__to) const
- { return this->do_narrow(__low, __high, __dfault, __to); }
+ { return this->do_narrow(__lo, __hi, __dfault, __to); }
protected:
explicit
@@ -122,7 +124,7 @@ namespace std
mask* __vec) const = 0;
virtual const char_type*
- do_scan_is(mask __m, const char_type* __lo,
+ do_scan_is(mask __m, const char_type* __lo,
const char_type* __hi) const = 0;
virtual const char_type*
@@ -133,26 +135,26 @@ namespace std
do_toupper(char_type) const = 0;
virtual const char_type*
- do_toupper(char_type* __low, const char_type* __high) const = 0;
+ do_toupper(char_type* __lo, const char_type* __hi) const = 0;
virtual char_type
do_tolower(char_type) const = 0;
virtual const char_type*
- do_tolower(char_type* __low, const char_type* __high) const = 0;
+ do_tolower(char_type* __lo, const char_type* __hi) const = 0;
virtual char_type
do_widen(char) const = 0;
virtual const char*
- do_widen(const char* __low, const char* __high,
+ do_widen(const char* __lo, const char* __hi,
char_type* __dest) const = 0;
virtual char
do_narrow(char_type, char __dfault) const = 0;
virtual const char_type*
- do_narrow(const char_type* __low, const char_type* __high,
+ do_narrow(const char_type* __lo, const char_type* __hi,
char __dfault, char* __dest) const = 0;
};
@@ -173,6 +175,56 @@ namespace std
protected:
virtual
~ctype() { }
+
+ virtual bool
+ do_is(mask __m, char_type __c) const
+ { return false; }
+
+ virtual const char_type*
+ do_is(const char_type* __lo, const char_type* __hi, mask* __vec) const
+ { return __hi; }
+
+ virtual const char_type*
+ do_scan_is(mask __m, const char_type* __lo, const char_type* __hi) const
+ { return __hi; }
+
+ virtual const char_type*
+ do_scan_not(mask __m, const char_type* __lo,
+ const char_type* __hi) const
+ { return __hi; }
+
+ virtual char_type
+ do_toupper(char_type __c) const
+ { return __c; }
+
+ virtual const char_type*
+ do_toupper(char_type* __lo, const char_type* __hi) const
+ { return __hi; }
+
+ virtual char_type
+ do_tolower(char_type __c) const
+ { return __c; }
+
+ virtual const char_type*
+ do_tolower(char_type* __lo, const char_type* __hi) const
+ { return __hi; }
+
+ virtual char_type
+ do_widen(char __c) const
+ { return char_type(); }
+
+ virtual const char*
+ do_widen(const char* __lo, const char* __hi, char_type* __dest) const
+ { return __hi; }
+
+ virtual char
+ do_narrow(char_type, char __dfault) const
+ { return __dfault; }
+
+ virtual const char_type*
+ do_narrow(const char_type* __lo, const char_type* __hi,
+ char __dfault, char* __dest) const
+ { return __hi; }
};
template<typename _CharT>
@@ -205,13 +257,13 @@ namespace std
is(mask __m, char __c) const;
inline const char*
- is(const char* __low, const char* __high, mask* __vec) const;
+ is(const char* __lo, const char* __hi, mask* __vec) const;
inline const char*
- scan_is(mask __m, const char* __low, const char* __high) const;
+ scan_is(mask __m, const char* __lo, const char* __hi) const;
inline const char*
- scan_not(mask __m, const char* __low, const char* __high) const;
+ scan_not(mask __m, const char* __lo, const char* __hi) const;
protected:
virtual
@@ -229,12 +281,10 @@ namespace std
do_is(mask __m, char_type __c) const;
virtual const char_type*
- do_is(const char_type* __lo, const char_type* __hi,
- mask* __vec) const;
+ do_is(const char_type* __lo, const char_type* __hi, mask* __vec) const;
virtual const char_type*
- do_scan_is(mask __m, const char_type* __lo,
- const char_type* __hi) const;
+ do_scan_is(mask __m, const char_type* __lo, const char_type* __hi) const;
virtual const char_type*
do_scan_not(mask __m, const char_type* __lo,
@@ -244,26 +294,25 @@ namespace std
do_toupper(char_type) const;
virtual const char_type*
- do_toupper(char_type* __low, const char_type* __high) const;
+ do_toupper(char_type* __lo, const char_type* __hi) const;
virtual char_type
do_tolower(char_type) const;
virtual const char_type*
- do_tolower(char_type* __low, const char_type* __high) const;
+ do_tolower(char_type* __lo, const char_type* __hi) const;
virtual char_type
do_widen(char) const;
virtual const char*
- do_widen(const char* __low, const char* __high,
- char_type* __dest) const;
+ do_widen(const char* __lo, const char* __hi, char_type* __dest) const;
virtual char
do_narrow(char_type, char __dfault) const;
virtual const char_type*
- do_narrow(const char_type* __low, const char_type* __high,
+ do_narrow(const char_type* __lo, const char_type* __hi,
char __dfault, char* __dest) const;
};
@@ -298,12 +347,10 @@ namespace std
do_is(mask __m, char_type __c) const;
virtual const char_type*
- do_is(const char_type* __lo, const char_type* __hi,
- mask* __vec) const;
+ do_is(const char_type* __lo, const char_type* __hi, mask* __vec) const;
virtual const char_type*
- do_scan_is(mask __m, const char_type* __lo,
- const char_type* __hi) const;
+ do_scan_is(mask __m, const char_type* __lo, const char_type* __hi) const;
virtual const char_type*
do_scan_not(mask __m, const char_type* __lo,
@@ -313,26 +360,25 @@ namespace std
do_toupper(char_type) const;
virtual const char_type*
- do_toupper(char_type* __low, const char_type* __high) const;
+ do_toupper(char_type* __lo, const char_type* __hi) const;
virtual char_type
do_tolower(char_type) const;
virtual const char_type*
- do_tolower(char_type* __low, const char_type* __high) const;
+ do_tolower(char_type* __lo, const char_type* __hi) const;
virtual char_type
do_widen(char) const;
virtual const char*
- do_widen(const char* __low, const char* __high,
- char_type* __dest) const;
+ do_widen(const char* __lo, const char* __hi, char_type* __dest) const;
virtual char
do_narrow(char_type, char __dfault) const;
virtual const char_type*
- do_narrow(const char_type* __low, const char_type* __high,
+ do_narrow(const char_type* __lo, const char_type* __hi,
char __dfault, char* __dest) const;
};
@@ -515,6 +561,9 @@ namespace std
_M_get_digits(iter_type __in, iter_type __end) const;
};
+ // This is the size of the buffer passed to _M_extract
+ const int _M_extract_buffer_length = 32;
+
template<typename _CharT, typename _InIter>
class num_get : public locale::facet
{
diff --git a/libstdc++-v3/include/bits/locale_facets.tcc b/libstdc++-v3/include/bits/locale_facets.tcc
index 8d02641b580..e533ede9644 100644
--- a/libstdc++-v3/include/bits/locale_facets.tcc
+++ b/libstdc++-v3/include/bits/locale_facets.tcc
@@ -70,12 +70,11 @@ namespace std
use_facet(const locale& __loc)
{
typedef locale::_Impl::__vec_facet __vec_facet;
- locale::id& __id = _Facet::id;
- size_t __i = __id._M_index;
+ size_t __i = _Facet::id._M_index;
__vec_facet* __facet = __loc._M_impl->_M_facets;
const locale::facet* __fp = (*__facet)[__i];
if (__fp == 0 || __i >= __facet->size())
- throw bad_cast();
+ __throw_bad_cast();
return static_cast<const _Facet&>(*__fp);
}
@@ -84,8 +83,7 @@ namespace std
has_facet(const locale& __loc) throw()
{
typedef locale::_Impl::__vec_facet __vec_facet;
- locale::id& __id = _Facet::id;
- size_t __i = __id._M_index;
+ size_t __i = _Facet::id._M_index;
__vec_facet* __facet = __loc._M_impl->_M_facets;
return (__i < __facet->size() && (*__facet)[__i] != 0);
}
@@ -110,47 +108,44 @@ namespace std
size_t __pos = 0;
do
{
- {
- int __ti = 0;
- for (;__ti < __remain &&
- __pos == __targets[__matches[__ti]].size(); ++__ti)
- { }
- if (__ti == __remain)
- {
- if (__pos == 0) __remain = 0;
- return __s;
- }
- }
+ int __ti = 0;
+ while (__ti < __remain && __pos == __targets[__matches[__ti]].size())
+ ++__ti;
+ if (__ti == __remain)
+ {
+ if (__pos == 0) __remain = 0;
+ return __s;
+ }
if (__s == __end)
__eof = true;
bool __matched = false;
- for (int __ti = 0; __ti < __remain; )
+ for (int __ti2 = 0; __ti2 < __remain; )
{
- const __string_type& __target = __targets[__matches[__ti]];
+ const __string_type& __target = __targets[__matches[__ti2]];
if (__pos < __target.size())
{
if (__eof || __target[__pos] != *__s)
{
- __matches[__ti] = __matches[--__remain];
+ __matches[__ti2] = __matches[--__remain];
continue;
}
__matched = true;
}
- ++__ti;
+ ++__ti2;
}
if (__matched)
{
++__s;
++__pos;
}
- for (int __ti = 0; __ti < __remain;)
+ for (int __ti3 = 0; __ti3 < __remain;)
{
- if (__pos > __targets[__matches[__ti]].size())
+ if (__pos > __targets[__matches[__ti3]].size())
{
- __matches[__ti] = __matches[--__remain];
+ __matches[__ti3] = __matches[--__remain];
continue;
}
- ++__ti;
+ ++__ti3;
}
}
while (__remain);
@@ -194,15 +189,15 @@ namespace std
switch (__ev)
{
case ios_base::erase_event:
- delete static_cast<_Format_cache<_CharT>*> (__p); __p = 0;
+ delete static_cast<_Format_cache<_CharT>*>(__p);
+ __p = 0;
break;
case ios_base::copyfmt_event:
// If just stored zero, the callback would get registered again.
- try {
- __p = new _Format_cache<_CharT>;
- }
- catch(...) {
- }
+ try
+ { __p = new _Format_cache<_CharT>; }
+ catch(...)
+ { }
break;
case ios_base::imbue_event:
static_cast<_Format_cache<_CharT>*>(__p)->_M_valid = false;
@@ -287,7 +282,7 @@ namespace std
// Stage 1: extract and determine the conversion specifier.
// Assuming leading zeros eliminated, thus the size of 32 for
// integral types.
- char __xtrc[32] = {'\0'};
+ char __xtrc[_M_extract_buffer_length] = {'\0'};
int __base;
_M_extract(__beg, __end, __io, __err, __xtrc, __base, false);
@@ -352,7 +347,7 @@ namespace std
// Stage 1: extract and determine the conversion specifier.
// Assuming leading zeros eliminated, thus the size of 32 for
// integral types.
- char __xtrc[32]= {'\0'};
+ char __xtrc[_M_extract_buffer_length]= {'\0'};
int __base;
_M_extract(__beg, __end, __io, __err, __xtrc, __base, false);
@@ -379,7 +374,7 @@ namespace std
// Stage 1: extract and determine the conversion specifier.
// Assuming leading zeros eliminated, thus the size of 32 for
// integral types.
- char __xtrc[32] = {'\0'};
+ char __xtrc[_M_extract_buffer_length] = {'\0'};
int __base;
_M_extract(__beg, __end, __io, __err, __xtrc, __base, false);
@@ -407,7 +402,7 @@ namespace std
// Stage 1: extract and determine the conversion specifier.
// Assuming leading zeros eliminated, thus the size of 32 for
// integral types.
- char __xtrc[32]= {'\0'};
+ char __xtrc[_M_extract_buffer_length]= {'\0'};
int __base;
_M_extract(__beg, __end, __io, __err, __xtrc, __base, false);
@@ -434,7 +429,7 @@ namespace std
// Stage 1: extract and determine the conversion specifier.
// Assuming leading zeros eliminated, thus the size of 32 for
// integral types.
- char __xtrc[32]= {'\0'};
+ char __xtrc[_M_extract_buffer_length]= {'\0'};
int __base;
_M_extract(__beg, __end, __io, __err, __xtrc, __base, false);
@@ -461,7 +456,7 @@ namespace std
// Stage 1: extract and determine the conversion specifier.
// Assuming leading zeros eliminated, thus the size of 32 for
// integral types.
- char __xtrc[32]= {'\0'};
+ char __xtrc[_M_extract_buffer_length]= {'\0'};
int __base;
_M_extract(__beg, __end, __io, __err, __xtrc, __base, false);
@@ -488,7 +483,7 @@ namespace std
// Stage 1: extract and determine the conversion specifier.
// Assuming leading zeros eliminated, thus the size of 32 for
// integral types.
- char __xtrc[32]= {'\0'};
+ char __xtrc[_M_extract_buffer_length]= {'\0'};
int __base;
_M_extract(__beg, __end, __io, __err, __xtrc, __base, false);
@@ -515,7 +510,7 @@ namespace std
// Stage 1: extract and determine the conversion specifier.
// Assuming leading zeros eliminated, thus the size of 32 for
// integral types.
- char __xtrc[32] = {'\0'};
+ char __xtrc[_M_extract_buffer_length] = {'\0'};
int __base;
_M_extract(__beg, __end, __io, __err, __xtrc, __base, false);
@@ -542,7 +537,7 @@ namespace std
// Stage 1: extract and determine the conversion specifier.
// Assuming leading zeros eliminated, thus the size of 32 for
// integral types.
- char __xtrc[32]= {'\0'};
+ char __xtrc[_M_extract_buffer_length]= {'\0'};
int __base;
_M_extract(__beg, __end, __io, __err, __xtrc, __base, false);
@@ -569,14 +564,14 @@ namespace std
// Stage 1: extract and determine the conversion specifier.
// Assuming leading zeros eliminated, thus the size of 256 for
// floating-point types.
- char __xtrc[32]= {'\0'};
+ char __xtrc[_M_extract_buffer_length]= {'\0'};
int __base;
_M_extract(__beg, __end, __io, __err, __xtrc, __base, true);
// Stage 2: convert and store results.
char* __sanity;
errno = 0;
-#ifdef _GLIBCPP_HAVE_STRTOF
+#ifdef _GLIBCPP_USE_C99
float __f = strtof(__xtrc, &__sanity);
#else
float __f = static_cast<float>(strtod(__xtrc, &__sanity));
@@ -599,7 +594,7 @@ namespace std
// Stage 1: extract and determine the conversion specifier.
// Assuming leading zeros eliminated, thus the size of 256 for
// floating-point types.
- char __xtrc[32]= {'\0'};
+ char __xtrc[_M_extract_buffer_length]= {'\0'};
int __base;
_M_extract(__beg, __end, __io, __err, __xtrc, __base, true);
@@ -616,7 +611,7 @@ namespace std
return __beg;
}
-#if defined(_GLIBCPP_HAVE_STRTOLD) && !defined(__hpux)
+#if defined(_GLIBCPP_USE_C99) && !defined(__hpux)
template<typename _CharT, typename _InIter>
_InIter
num_get<_CharT, _InIter>::
@@ -626,7 +621,7 @@ namespace std
// Stage 1: extract and determine the conversion specifier.
// Assuming leading zeros eliminated, thus the size of 256 for
// floating-point types.
- char __xtrc[32]= {'\0'};
+ char __xtrc[_M_extract_buffer_length]= {'\0'};
int __base;
_M_extract(__beg, __end, __io, __err, __xtrc, __base, true);
@@ -650,7 +645,7 @@ namespace std
ios_base::iostate& __err, long double& __v) const
{
// Stage 1: extract
- char __xtrc[32]= {'\0'};
+ char __xtrc[_M_extract_buffer_length]= {'\0'};
int __base;
_M_extract(__beg, __end, __io, __err, __xtrc, __base, true);
@@ -696,7 +691,7 @@ namespace std
// Stage 1: extract and determine the conversion specifier.
// Assuming leading zeros eliminated, thus the size of 32 for
// integral types.
- char __xtrc[32]= {'\0'};
+ char __xtrc[_M_extract_buffer_length]= {'\0'};
int __base;
_M_extract(__beg, __end, __io, __err, __xtrc, __base, false);
@@ -722,8 +717,8 @@ namespace std
template <typename _CharT, typename _RaIter>
_RaIter
- __pad(_RaIter __s, _CharT __fill, int __padding,
- random_access_iterator_tag)
+ __pad(_RaIter __s, _CharT __fill, int __padding,
+ random_access_iterator_tag)
{
fill_n(__s, __fill);
return __s + __padding;
@@ -741,8 +736,8 @@ namespace std
inline _OutIter
__pad(_OutIter __s, _CharT __fill, int __padding)
{
- return __pad(__s, __fill, __padding,
- iterator_traits<_OutIter>::iterator_category());
+ return __pad(__s, __fill, __padding,
+ typename iterator_traits<_OutIter>::iterator_category());
}
template <typename _CharT, typename _OutIter>
@@ -969,7 +964,7 @@ namespace std
#endif
// Generic helper function
- template<typename _CharT, typename _OutIter>
+ template<typename _CharT, typename _Traits, typename _OutIter>
_OutIter
__output_float(_OutIter __s, ios_base& __io, _CharT __fill,
const char* __sptr, size_t __slen)
@@ -979,10 +974,10 @@ namespace std
}
// Partial specialization for ostreambuf_iterator.
- template<typename _CharT>
- ostreambuf_iterator<_CharT>
- __output_float(ostreambuf_iterator<_CharT> __s, ios_base& __io,
- _CharT __fill, const char* __sptr, size_t __slen)
+ template<typename _CharT, typename _Traits>
+ ostreambuf_iterator<_CharT, _Traits>
+ __output_float(ostreambuf_iterator<_CharT, _Traits> __s, ios_base& __io,
+ _CharT __fill, const char* __sptr, size_t __slen)
{
size_t __padding = __io.width() > streamsize(__slen) ?
__io.width() -__slen : 0;
@@ -1042,7 +1037,7 @@ namespace std
if (__prec > __max_prec)
__prec = __max_prec;
// The *2 provides for signs, exp, 'E', and pad.
- char __sbuf[__max_prec*2];
+ char __sbuf[__max_prec * 2];
size_t __slen;
// Long enough for the max format spec.
char __fbuf[16];
@@ -1066,7 +1061,7 @@ namespace std
if (__prec > __max_prec)
__prec = __max_prec;
// The *2 provides for signs, exp, 'E', and pad.
- char __sbuf[__max_prec*2];
+ char __sbuf[__max_prec * 2];
size_t __slen;
// Long enough for the max format spec.
char __fbuf[16];
@@ -1098,7 +1093,7 @@ namespace std
}
catch (...) {
__io.flags(__fmt);
- throw;
+ __throw_exception_again;
}
}
diff --git a/libstdc++-v3/include/bits/localefwd.h b/libstdc++-v3/include/bits/localefwd.h
index 5e08c7ec8af..dd5cddc44b9 100644
--- a/libstdc++-v3/include/bits/localefwd.h
+++ b/libstdc++-v3/include/bits/localefwd.h
@@ -34,11 +34,14 @@
#ifndef _CPP_BITS_LOCCORE_H
#define _CPP_BITS_LOCCORE_H 1
+#pragma GCC system_header
+
#include <bits/c++config.h>
+#include <bits/c++locale.h> // Defines __c_locale.
#include <bits/std_climits.h> // For CHAR_BIT
#include <bits/std_string.h> // For string
#include <bits/std_cctype.h> // For isspace, etc.
-#include <bits/c++locale.h> // Defines __c_locale.
+#include <bits/functexcept.h>
namespace std
{
@@ -49,35 +52,6 @@ namespace std
# define _GLIBCPP_NUM_FACETS 13
#endif
- // _Count_ones: compile-time computation of number of 1-bits in a value N
- // This takes only 5 (or 6) instantiations, doing recursive descent
- // in parallel -- ncm
- template<unsigned int _Num, int _Shift = (sizeof(unsigned) * CHAR_BIT)/2,
- unsigned int _Mask = (~0u >> _Shift) >
- struct _Count_ones;
-
- // It is preferable to use enumerators instead of integral static data
- // members to avoid emission of superflous variables -- gdr.
- template<unsigned int _Num, unsigned int _Mask>
- struct _Count_ones<_Num, 0, _Mask>
- {
- enum
- {
- _M_count = _Num
- };
- };
-
- template<unsigned int _Num, int _Shift, unsigned int _Mask>
- struct _Count_ones
- {
- enum
- {
- _M_halfcount = _Count_ones<_Num, _Shift/2,
- (_Mask^((~_Mask)>>(_Shift/2))) >::_M_count,
- _M_count = (_M_halfcount&_Mask) + ((_M_halfcount>>_Shift)&_Mask)
- };
- };
-
// 22.1.1 Locale
template<typename _Tp, typename _Alloc>
class vector;
@@ -294,7 +268,7 @@ namespace std
// Current global reference locale
static _Impl* _S_global;
- static const size_t _S_num_categories = _Count_ones<all>::_M_count;
+ static const size_t _S_num_categories = 6;
static const size_t _S_num_facets = _GLIBCPP_NUM_FACETS;
explicit
@@ -396,7 +370,7 @@ namespace std
{
_M_impl = new _Impl(*__other._M_impl, 1);
_M_impl->_M_install_facet(&_Facet::id, __f);
- for (int __i = 0; __i < _S_num_categories; ++__i)
+ for (size_t __i = 0; __i < _S_num_categories; ++__i)
_M_impl->_M_names[__i] = "*";
}
diff --git a/libstdc++-v3/include/bits/mask_array.h b/libstdc++-v3/include/bits/mask_array.h
index 5a15f7a5e97..b2399ba1fa7 100644
--- a/libstdc++-v3/include/bits/mask_array.h
+++ b/libstdc++-v3/include/bits/mask_array.h
@@ -1,6 +1,6 @@
// The template and inlines for the -*- C++ -*- mask_array class.
-// Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc.
+// Copyright (C) 1997-2001 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,6 +32,8 @@
#ifndef _CPP_BITS_MASK_ARRAY_H
#define _CPP_BITS_MASK_ARRAY_H 1
+#pragma GCC system_header
+
namespace std {
template <class _Tp> class mask_array
diff --git a/libstdc++-v3/include/bits/ostream.tcc b/libstdc++-v3/include/bits/ostream.tcc
index b6b27bfa8aa..735482522ee 100644
--- a/libstdc++-v3/include/bits/ostream.tcc
+++ b/libstdc++-v3/include/bits/ostream.tcc
@@ -31,8 +31,8 @@
#include <bits/std_locale.h>
-namespace std {
-
+namespace std
+{
template<typename _CharT, typename _Traits>
basic_ostream<_CharT, _Traits>::sentry::
sentry(basic_ostream<_CharT,_Traits>& __os)
@@ -51,16 +51,16 @@ namespace std {
sentry __cerb(*this);
if (__cerb)
{
- try {
- __pf(*this);
- }
- catch(exception& __fail){
- // 27.6.2.5.1 Common requirements.
- // Turn this on without causing an ios::failure to be thrown.
- this->setstate(ios_base::badbit);
- if ((this->exceptions() & ios_base::badbit) != 0)
- throw;
- }
+ try
+ { __pf(*this); }
+ catch(exception& __fail)
+ {
+ // 27.6.2.5.1 Common requirements.
+ // Turn this on without causing an ios::failure to be thrown.
+ this->setstate(ios_base::badbit);
+ if ((this->exceptions() & ios_base::badbit) != 0)
+ __throw_exception_again;
+ }
}
return *this;
}
@@ -73,16 +73,16 @@ namespace std {
sentry __cerb(*this);
if (__cerb)
{
- try {
- __pf(*this);
- }
- catch(exception& __fail){
- // 27.6.2.5.1 Common requirements.
- // Turn this on without causing an ios::failure to be thrown.
- this->setstate(ios_base::badbit);
- if ((this->exceptions() & ios_base::badbit) != 0)
- throw;
- }
+ try
+ { __pf(*this); }
+ catch(exception& __fail)
+ {
+ // 27.6.2.5.1 Common requirements.
+ // Turn this on without causing an ios::failure to be thrown.
+ this->setstate(ios_base::badbit);
+ if ((this->exceptions() & ios_base::badbit) != 0)
+ __throw_exception_again;
+ }
}
return *this;
}
@@ -95,16 +95,16 @@ namespace std {
sentry __cerb(*this);
if (__cerb)
{
- try {
- __pf(*this);
- }
- catch(exception& __fail){
- // 27.6.2.5.1 Common requirements.
- // Turn this on without causing an ios::failure to be thrown.
- this->setstate(ios_base::badbit);
- if ((this->exceptions() & ios_base::badbit) != 0)
- throw;
- }
+ try
+ { __pf(*this); }
+ catch(exception& __fail)
+ {
+ // 27.6.2.5.1 Common requirements.
+ // Turn this on without causing an ios::failure to be thrown.
+ this->setstate(ios_base::badbit);
+ if ((this->exceptions() & ios_base::badbit) != 0)
+ __throw_exception_again;
+ }
}
return *this;
}
@@ -116,17 +116,20 @@ namespace std {
sentry __cerb(*this);
if (__cerb)
{
- try {
- if (_M_fnumput->put(*this, *this, this->fill(), __n).failed())
+ try
+ {
+ if (_M_check_facet(_M_fnumput))
+ if (_M_fnumput->put(*this, *this, this->fill(), __n).failed())
+ this->setstate(ios_base::badbit);
+ }
+ catch(exception& __fail)
+ {
+ // 27.6.1.2.1 Common requirements.
+ // Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
- }
- catch(exception& __fail){
- // 27.6.1.2.1 Common requirements.
- // Turn this on without causing an ios::failure to be thrown.
- this->setstate(ios_base::badbit);
- if ((this->exceptions() & ios_base::badbit) != 0)
- throw;
- }
+ if ((this->exceptions() & ios_base::badbit) != 0)
+ __throw_exception_again;
+ }
}
return *this;
}
@@ -138,25 +141,32 @@ namespace std {
sentry __cerb(*this);
if (__cerb)
{
- try {
- bool __f;
- ios_base::fmtflags __fmt = this->flags() & ios_base::basefield;
- if (__fmt & ios_base::oct || __fmt & ios_base::hex)
- __f = _M_fnumput->put(*this, *this, this->fill(),
- static_cast<unsigned long>(__n)).failed();
- else
- __f = _M_fnumput->put(*this, *this, this->fill(), __n).failed();
-
- if (__f)
+ try
+ {
+ char_type __c = this->fill();
+ ios_base::fmtflags __fmt = this->flags() & ios_base::basefield;
+ if (_M_check_facet(_M_fnumput))
+ {
+ bool __b = false;
+ if (__fmt & ios_base::oct || __fmt & ios_base::hex)
+ {
+ unsigned long __l = static_cast<unsigned long>(__n);
+ __b = _M_fnumput->put(*this, *this, __c, __l).failed();
+ }
+ else
+ __b = _M_fnumput->put(*this, *this, __c, __n).failed();
+ if (__b)
+ this->setstate(ios_base::badbit);
+ }
+ }
+ catch(exception& __fail)
+ {
+ // 27.6.1.2.1 Common requirements.
+ // Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
- }
- catch(exception& __fail){
- // 27.6.1.2.1 Common requirements.
- // Turn this on without causing an ios::failure to be thrown.
- this->setstate(ios_base::badbit);
- if ((this->exceptions() & ios_base::badbit) != 0)
- throw;
- }
+ if ((this->exceptions() & ios_base::badbit) != 0)
+ __throw_exception_again;
+ }
}
return *this;
}
@@ -168,17 +178,20 @@ namespace std {
sentry __cerb(*this);
if (__cerb)
{
- try {
- if (_M_fnumput->put(*this, *this, this->fill(), __n).failed())
+ try
+ {
+ if (_M_check_facet(_M_fnumput))
+ if (_M_fnumput->put(*this, *this, this->fill(), __n).failed())
+ this->setstate(ios_base::badbit);
+ }
+ catch(exception& __fail)
+ {
+ // 27.6.1.2.1 Common requirements.
+ // Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
- }
- catch(exception& __fail){
- // 27.6.1.2.1 Common requirements.
- // Turn this on without causing an ios::failure to be thrown.
- this->setstate(ios_base::badbit);
- if ((this->exceptions() & ios_base::badbit) != 0)
- throw;
- }
+ if ((this->exceptions() & ios_base::badbit) != 0)
+ __throw_exception_again;
+ }
}
return *this;
}
@@ -191,23 +204,33 @@ namespace std {
sentry __cerb(*this);
if (__cerb)
{
- try {
- bool __f;
- ios_base::fmtflags __fmt = this->flags() & ios_base::basefield;
- if (__fmt & ios_base::oct || __fmt & ios_base::hex)
- __f = _M_fnumput->put(*this, *this, this->fill(),
- static_cast<unsigned long long>(__n)).failed();
- else
- __f = _M_fnumput->put(*this, *this, this->fill(), __n).failed();
-
- }
- catch(exception& __fail){
- // 27.6.1.2.1 Common requirements.
- // Turn this on without causing an ios::failure to be thrown.
- this->setstate(ios_base::badbit);
- if ((this->exceptions() & ios_base::badbit) != 0)
- throw;
- }
+ try
+ {
+ char_type __c = this->fill();
+ ios_base::fmtflags __fmt = this->flags() & ios_base::basefield;
+ if (_M_check_facet(_M_fnumput))
+ {
+ bool __b = false;
+ if (__fmt & ios_base::oct || __fmt & ios_base::hex)
+ {
+ unsigned long long __l;
+ __l = static_cast<unsigned long long>(__n);
+ __b = _M_fnumput->put(*this, *this, __c, __l).failed();
+ }
+ else
+ __b = _M_fnumput->put(*this, *this, __c, __n).failed();
+ if (__b)
+ this->setstate(ios_base::badbit);
+ }
+ }
+ catch(exception& __fail)
+ {
+ // 27.6.1.2.1 Common requirements.
+ // Turn this on without causing an ios::failure to be thrown.
+ this->setstate(ios_base::badbit);
+ if ((this->exceptions() & ios_base::badbit) != 0)
+ __throw_exception_again;
+ }
}
return *this;
}
@@ -219,22 +242,25 @@ namespace std {
sentry __cerb(*this);
if (__cerb)
{
- try {
- if (_M_fnumput->put(*this, *this, this->fill(), __n).failed())
+ try
+ {
+ if (_M_check_facet(_M_fnumput))
+ if (_M_fnumput->put(*this, *this, this->fill(), __n).failed())
+ this->setstate(ios_base::badbit);
+ }
+ catch(exception& __fail)
+ {
+ // 27.6.1.2.1 Common requirements.
+ // Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
- }
- catch(exception& __fail){
- // 27.6.1.2.1 Common requirements.
- // Turn this on without causing an ios::failure to be thrown.
- this->setstate(ios_base::badbit);
- if ((this->exceptions() & ios_base::badbit) != 0)
- throw;
- }
+ if ((this->exceptions() & ios_base::badbit) != 0)
+ __throw_exception_again;
+ }
}
return *this;
}
#endif
-
+
template<typename _CharT, typename _Traits>
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::operator<<(double __n)
@@ -242,21 +268,24 @@ namespace std {
sentry __cerb(*this);
if (__cerb)
{
- try {
- if (_M_fnumput->put(*this, *this, this->fill(), __n).failed())
+ try
+ {
+ if (_M_check_facet(_M_fnumput))
+ if (_M_fnumput->put(*this, *this, this->fill(), __n).failed())
+ this->setstate(ios_base::badbit);
+ }
+ catch(exception& __fail)
+ {
+ // 27.6.1.2.1 Common requirements.
+ // Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
- }
- catch(exception& __fail){
- // 27.6.1.2.1 Common requirements.
- // Turn this on without causing an ios::failure to be thrown.
- this->setstate(ios_base::badbit);
- if ((this->exceptions() & ios_base::badbit) != 0)
- throw;
- }
+ if ((this->exceptions() & ios_base::badbit) != 0)
+ __throw_exception_again;
+ }
}
return *this;
}
-
+
template<typename _CharT, typename _Traits>
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::operator<<(long double __n)
@@ -264,17 +293,20 @@ namespace std {
sentry __cerb(*this);
if (__cerb)
{
- try {
- if (_M_fnumput->put(*this, *this, this->fill(), __n).failed())
+ try
+ {
+ if (_M_check_facet(_M_fnumput))
+ if (_M_fnumput->put(*this, *this, this->fill(), __n).failed())
+ this->setstate(ios_base::badbit);
+ }
+ catch(exception& __fail)
+ {
+ // 27.6.1.2.1 Common requirements.
+ // Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
- }
- catch(exception& __fail){
- // 27.6.1.2.1 Common requirements.
- // Turn this on without causing an ios::failure to be thrown.
- this->setstate(ios_base::badbit);
- if ((this->exceptions() & ios_base::badbit) != 0)
- throw;
- }
+ if ((this->exceptions() & ios_base::badbit) != 0)
+ __throw_exception_again;
+ }
}
return *this;
}
@@ -286,17 +318,20 @@ namespace std {
sentry __cerb(*this);
if (__cerb)
{
- try {
- if (_M_fnumput->put(*this, *this, this->fill(), __n).failed())
+ try
+ {
+ if (_M_check_facet(_M_fnumput))
+ if (_M_fnumput->put(*this, *this, this->fill(), __n).failed())
+ this->setstate(ios_base::badbit);
+ }
+ catch(exception& __fail)
+ {
+ // 27.6.1.2.1 Common requirements.
+ // Turn this on without causing an ios::failure to be thrown.
this->setstate(ios_base::badbit);
- }
- catch(exception& __fail){
- // 27.6.1.2.1 Common requirements.
- // Turn this on without causing an ios::failure to be thrown.
- this->setstate(ios_base::badbit);
- if ((this->exceptions() & ios_base::badbit) != 0)
- throw;
- }
+ if ((this->exceptions() & ios_base::badbit) != 0)
+ __throw_exception_again;
+ }
}
return *this;
}
@@ -376,10 +411,16 @@ namespace std {
bool __testok = this->fail() != true;
if (__testok)
+ {
#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
// 136. seekp, seekg setting wrong streams?
- this->rdbuf()->pubseekpos(__pos, ios_base::out);
+ pos_type __err = this->rdbuf()->pubseekpos(__pos, ios_base::out);
+
+// 129. Need error indication from seekp() and seekg()
+ if (__err == pos_type(off_type(-1)))
+ this->setstate(failbit);
#endif
+ }
return *this;
}
@@ -391,9 +432,16 @@ namespace std {
bool __testok = this->fail() != true;
if (__testok)
+ {
#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
// 136. seekp, seekg setting wrong streams?
- rdbuf()->pubseekoff(__off, __d, ios_base::out);
+ pos_type __err = this->rdbuf()->pubseekoff(__off, __d,
+ ios_base::out);
+
+// 129. Need error indication from seekp() and seekg()
+ if (__err == pos_type(off_type(-1)))
+ this->setstate(failbit);
+ }
#endif
return *this;
}
@@ -417,7 +465,7 @@ namespace std {
typedef typename traits_type::int_type int_type;
int_type __plen = static_cast<size_t>(__newlen - __oldlen);
- char_type __pads[__plen];
+ char_type* __pads = static_cast<char_type*>(__builtin_alloca(sizeof(char_type) * __plen));
traits_type::assign(__pads, __plen, __ios.fill());
char_type* __beg;
@@ -439,11 +487,11 @@ namespace std {
// Pad after 0[xX], if there is one.
// Who came up with these rules, anyway? Jeeze.
typedef _Format_cache<_CharT> __cache_type;
- __cache_type const* __fmt = __cache_type::_S_get(__ios);
+ __cache_type const* __lfmt = __cache_type::_S_get(__ios);
const char_type* __minus = traits_type::find(__olds, __oldlen,
- __fmt->_S_minus);
+ __lfmt->_S_minus);
const char_type* __plus = traits_type::find(__olds, __oldlen,
- __fmt->_S_plus);
+ __lfmt->_S_plus);
bool __testsign = __minus || __plus;
bool __testhex = __olds[0] == '0'
&& (__olds[1] == 'x' || __olds[1] == 'X');
@@ -491,62 +539,66 @@ namespace std {
operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c)
{
typedef basic_ostream<_CharT, _Traits> __ostream_type;
- __ostream_type::sentry __cerb(__out);
+ typename __ostream_type::sentry __cerb(__out);
if (__cerb)
{
- try {
- streamsize __w = __out.width();
- _CharT __pads[__w];
- __pads[0] = __c;
- streamsize __len = 1;
- if (__w > __len)
- {
- __pad_char(__out, __pads, &__c, __w, __len);
- __len = __w;
- }
- __out.write(__pads, __len);
- __out.width(0);
- }
- catch(exception& __fail){
- // 27.6.1.2.1 Common requirements.
- // Turn this on without causing an ios::failure to be thrown.
- __out.setstate(ios_base::badbit);
- if ((__out.exceptions() & ios_base::badbit) != 0)
- throw;
- }
+ try
+ {
+ streamsize __w = __out.width();
+ _CharT* __pads = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT) * __w));
+ __pads[0] = __c;
+ streamsize __len = 1;
+ if (__w > __len)
+ {
+ __pad_char(__out, __pads, &__c, __w, __len);
+ __len = __w;
+ }
+ __out.write(__pads, __len);
+ __out.width(0);
+ }
+ catch(exception& __fail)
+ {
+ // 27.6.1.2.1 Common requirements.
+ // Turn this on without causing an ios::failure to be thrown.
+ __out.setstate(ios_base::badbit);
+ if ((__out.exceptions() & ios_base::badbit) != 0)
+ __throw_exception_again;
+ }
}
return __out;
}
-
+
// Specialization
template <class _Traits>
basic_ostream<char, _Traits>&
operator<<(basic_ostream<char, _Traits>& __out, char __c)
{
typedef basic_ostream<char, _Traits> __ostream_type;
- __ostream_type::sentry __cerb(__out);
+ typename __ostream_type::sentry __cerb(__out);
if (__cerb)
{
- try {
- streamsize __w = __out.width();
- char __pads[__w + 1];
- __pads[0] = __c;
- streamsize __len = 1;
- if (__w > __len)
- {
- __pad_char(__out, __pads, &__c, __w, __len);
- __len = __w;
- }
- __out.write(__pads, __len);
- __out.width(0);
- }
- catch(exception& __fail){
- // 27.6.1.2.1 Common requirements.
- // Turn this on without causing an ios::failure to be thrown.
- __out.setstate(ios_base::badbit);
- if ((__out.exceptions() & ios_base::badbit) != 0)
- throw;
- }
+ try
+ {
+ streamsize __w = __out.width();
+ char* __pads = static_cast<char*>(__builtin_alloca(__w + 1));
+ __pads[0] = __c;
+ streamsize __len = 1;
+ if (__w > __len)
+ {
+ __pad_char(__out, __pads, &__c, __w, __len);
+ __len = __w;
+ }
+ __out.write(__pads, __len);
+ __out.width(0);
+ }
+ catch(exception& __fail)
+ {
+ // 27.6.1.2.1 Common requirements.
+ // Turn this on without causing an ios::failure to be thrown.
+ __out.setstate(ios_base::badbit);
+ if ((__out.exceptions() & ios_base::badbit) != 0)
+ __throw_exception_again;
+ }
}
return __out;
}
@@ -556,29 +608,31 @@ namespace std {
operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s)
{
typedef basic_ostream<_CharT, _Traits> __ostream_type;
- __ostream_type::sentry __cerb(__out);
+ typename __ostream_type::sentry __cerb(__out);
if (__cerb)
{
- try {
- streamsize __w = __out.width();
- _CharT __pads[__w];
- streamsize __len = static_cast<streamsize>(_Traits::length(__s));
- if (__w > __len)
- {
- __pad_char(__out, __pads, __s, __w, __len);
- __s = __pads;
- __len = __w;
- }
- __out.write(__s, __len);
- __out.width(0);
- }
- catch(exception& __fail){
- // 27.6.1.2.1 Common requirements.
- // Turn this on without causing an ios::failure to be thrown.
- __out.setstate(ios_base::badbit);
- if ((__out.exceptions() & ios_base::badbit) != 0)
- throw;
- }
+ try
+ {
+ streamsize __w = __out.width();
+ _CharT* __pads = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT) * __w));
+ streamsize __len = static_cast<streamsize>(_Traits::length(__s));
+ if (__w > __len)
+ {
+ __pad_char(__out, __pads, __s, __w, __len);
+ __s = __pads;
+ __len = __w;
+ }
+ __out.write(__s, __len);
+ __out.width(0);
+ }
+ catch(exception& __fail)
+ {
+ // 27.6.1.2.1 Common requirements.
+ // Turn this on without causing an ios::failure to be thrown.
+ __out.setstate(ios_base::badbit);
+ if ((__out.exceptions() & ios_base::badbit) != 0)
+ __throw_exception_again;
+ }
}
return __out;
}
@@ -592,36 +646,38 @@ namespace std {
// 167. Improper use of traits_type::length()
typedef char_traits<char> __ctraits_type;
#endif
- __ostream_type::sentry __cerb(__out);
+ typename __ostream_type::sentry __cerb(__out);
if (__cerb)
{
size_t __clen = __ctraits_type::length(__s);
- _CharT __ws[__clen + 1];
+ _CharT* __ws = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT) * (__clen + 1)));
for (size_t __i = 0; __i <= __clen; ++__i)
__ws[__i] = __out.widen(__s[__i]);
_CharT* __str = __ws;
- try {
- streamsize __len = static_cast<streamsize>(__clen);
- streamsize __w = __out.width();
- _CharT __pads[__w];
-
- if (__w > __len)
- {
- __pad_char(__out, __pads, __ws, __w, __len);
- __str = __pads;
- __len = __w;
- }
- __out.write(__str, __len);
- __out.width(0);
- }
- catch(exception& __fail){
- // 27.6.1.2.1 Common requirements.
- // Turn this on without causing an ios::failure to be thrown.
- __out.setstate(ios_base::badbit);
- if ((__out.exceptions() & ios_base::badbit) != 0)
- throw;
- }
+ try
+ {
+ streamsize __len = static_cast<streamsize>(__clen);
+ streamsize __w = __out.width();
+ _CharT* __pads = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT) * __w));
+
+ if (__w > __len)
+ {
+ __pad_char(__out, __pads, __ws, __w, __len);
+ __str = __pads;
+ __len = __w;
+ }
+ __out.write(__str, __len);
+ __out.width(0);
+ }
+ catch(exception& __fail)
+ {
+ // 27.6.1.2.1 Common requirements.
+ // Turn this on without causing an ios::failure to be thrown.
+ __out.setstate(ios_base::badbit);
+ if ((__out.exceptions() & ios_base::badbit) != 0)
+ __throw_exception_again;
+ }
}
return __out;
}
@@ -632,52 +688,68 @@ namespace std {
operator<<(basic_ostream<char, _Traits>& __out, const char* __s)
{
typedef basic_ostream<char, _Traits> __ostream_type;
- __ostream_type::sentry __cerb(__out);
+ typename __ostream_type::sentry __cerb(__out);
if (__cerb)
{
- try {
- streamsize __w = __out.width();
- char __pads[__w];
- streamsize __len = static_cast<streamsize>(_Traits::length(__s));
- if (__w > __len)
- {
- __pad_char(__out, __pads, __s, __w, __len);
- __s = __pads;
- __len = __w;
- }
- __out.write(__s, __len);
- __out.width(0);
- }
- catch(exception& __fail){
- // 27.6.1.2.1 Common requirements.
- // Turn this on without causing an ios::failure to be thrown.
- __out.setstate(ios_base::badbit);
- if ((__out.exceptions() & ios_base::badbit) != 0)
- throw;
- }
+ try
+ {
+ streamsize __w = __out.width();
+ char* __pads = static_cast<char*>(__builtin_alloca(__w));
+ streamsize __len = static_cast<streamsize>(_Traits::length(__s));
+ if (__w > __len)
+ {
+ __pad_char(__out, __pads, __s, __w, __len);
+ __s = __pads;
+ __len = __w;
+ }
+ __out.write(__s, __len);
+ __out.width(0);
+ }
+ catch(exception& __fail)
+ {
+ // 27.6.1.2.1 Common requirements.
+ // Turn this on without causing an ios::failure to be thrown.
+ __out.setstate(ios_base::badbit);
+ if ((__out.exceptions() & ios_base::badbit) != 0)
+ __throw_exception_again;
+ }
}
return __out;
}
- // 21.3.7.8 basic_string::operator<<
+ // 21.3.7.9 basic_string::operator<<
template<typename _CharT, typename _Traits, typename _Alloc>
basic_ostream<_CharT, _Traits>&
operator<<(basic_ostream<_CharT, _Traits>& __out,
- const basic_string<_CharT, _Traits, _Alloc>& __s)
- { return (__out << __s.c_str()); }
-
+ const basic_string<_CharT, _Traits, _Alloc>& __str)
+ {
+ typedef basic_ostream<_CharT, _Traits> __ostream_type;
+ typename __ostream_type::sentry __cerb(__out);
+ if (__cerb)
+ {
+ const _CharT* __s = __str.data();
+ streamsize __w = __out.width();
+ _CharT* __pads = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT) * __w));
+ streamsize __len = static_cast<streamsize>(__str.size());
+#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
+ // 25. String operator<< uses width() value wrong
+#endif
+ if (__w > __len)
+ {
+ __pad_char(__out, __pads, __s, __w, __len);
+ __s = __pads;
+ __len = __w;
+ }
+ streamsize __res = __out.rdbuf()->sputn(__s, __len);
+ __out.width(0);
+ if (__res != __len)
+ __out.setstate(ios_base::failbit);
+ }
+ return __out;
+ }
} // namespace std
// Local Variables:
// mode:C++
// End:
-
-
-
-
-
-
-
-
-
diff --git a/libstdc++-v3/include/bits/pthread_allocimpl.h b/libstdc++-v3/include/bits/pthread_allocimpl.h
index dd99150b2c7..5585a3b3017 100644
--- a/libstdc++-v3/include/bits/pthread_allocimpl.h
+++ b/libstdc++-v3/include/bits/pthread_allocimpl.h
@@ -1,3 +1,32 @@
+// POSIX thread-related memory allocation -*- C++ -*-
+
+// Copyright (C) 2001 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.
+
/*
* Copyright (c) 1996
* Silicon Graphics Computer Systems, Inc.
@@ -27,18 +56,17 @@
// cache lines among processors, with potentially serious performance
// consequences.
+#include <bits/c++config.h>
#include <bits/std_cerrno.h>
-#include <bits/stl_config.h>
#include <bits/stl_alloc.h>
#ifndef __RESTRICT
# define __RESTRICT
#endif
-#ifndef __STL_NO_BAD_ALLOC
-# include <new>
-#endif
+#include <new>
-__STL_BEGIN_NAMESPACE
+namespace std
+{
#define __STL_DATA_ALIGNMENT 8
@@ -213,7 +241,7 @@ _Pthread_alloc_template<_Max_size>::_S_get_per_thread_state()
_Pthread_alloc_per_thread_state<_Max_size> * __result;
if (!_S_key_initialized) {
if (pthread_key_create(&_S_key, _S_destructor)) {
- __THROW_BAD_ALLOC; // defined in stl_alloc.h
+ std::__throw_bad_alloc(); // defined in funcexcept.h
}
_S_key_initialized = true;
}
@@ -221,7 +249,7 @@ _Pthread_alloc_template<_Max_size>::_S_get_per_thread_state()
__ret_code = pthread_setspecific(_S_key, __result);
if (__ret_code) {
if (__ret_code == ENOMEM) {
- __THROW_BAD_ALLOC;
+ std::__throw_bad_alloc();
} else {
// EINVAL
abort();
@@ -377,7 +405,6 @@ template <size_t _Max_size>
size_t _Pthread_alloc_template<_Max_size>
::_S_heap_size = 0;
-#ifdef __STL_USE_STD_ALLOCATORS
template <class _Tp>
class pthread_allocator {
@@ -484,9 +511,7 @@ struct _Alloc_traits<_Tp, pthread_allocator<_Atype> >
};
-#endif /* __STL_USE_STD_ALLOCATORS */
-
-__STL_END_NAMESPACE
+} // namespace std
#endif /* _CPP_BITS_PTHREAD_ALLOCIMPL_H */
diff --git a/libstdc++-v3/include/bits/sbuf_iter.h b/libstdc++-v3/include/bits/sbuf_iter.h
index 7a0e1d5db22..0f2c36db30a 100644
--- a/libstdc++-v3/include/bits/sbuf_iter.h
+++ b/libstdc++-v3/include/bits/sbuf_iter.h
@@ -1,6 +1,6 @@
// Streambuf iterators
-// Copyright (C) 1997-1999 Free Software Foundation, Inc.
+// Copyright (C) 1997-2001 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,31 +32,32 @@
#ifndef _CPP_BITS_SBUF_ITER_H
#define _CPP_BITS_SBUF_ITER_H 1
+#pragma GCC system_header
+
namespace std
{
-
template<typename _CharT, typename _Traits>
class ostreambuf_iterator
-#if 0 // XXX this is standard:
- : public iterator<output_iterator_tag, _CharT, void, void, void>
-#else
- : public output_iterator
-#endif
+ : public iterator<output_iterator_tag, void, void, void, void>
{
public:
-
// Types:
- typedef _CharT char_type;
+ typedef _CharT char_type;
typedef _Traits traits_type;
typedef basic_streambuf<_CharT, _Traits> streambuf_type;
typedef basic_ostream<_CharT, _Traits> ostream_type;
-
+
+ private:
+ streambuf_type* _M_sbuf;
+ bool _M_failed;
+
+ public:
inline
ostreambuf_iterator(ostream_type& __s) throw ()
- : _M_sbuf(__s.rdbuf()), _M_failed(false) { }
+ : _M_sbuf(__s.rdbuf()), _M_failed(!_M_sbuf) { }
ostreambuf_iterator(streambuf_type* __s) throw ()
- : _M_sbuf(__s), _M_failed(false) { }
+ : _M_sbuf(__s), _M_failed(!_M_sbuf) { }
ostreambuf_iterator&
operator=(_CharT __c);
@@ -76,69 +77,26 @@ namespace std
bool
failed() const throw()
{ return _M_failed; }
-
- private:
- streambuf_type* _M_sbuf;
- bool _M_failed;
-
-#if 0
- template<>
- friend char const*
- copy(char const* __first, char const* __last,
- ostreambuf_iterator<char,char_traits<char> > __to);
- template<>
- friend wchar_t const*
- copy(wchar_t const* __first, wchar_t const* __last,
- ostreambuf_iterator<wchar_t,char_traits<wchar_t> > __to);
-#endif
};
template<typename _CharT, typename _Traits>
inline ostreambuf_iterator<_CharT, _Traits>&
ostreambuf_iterator<_CharT, _Traits>::operator=(_CharT __c)
{
- if (!_M_failed &&
+ if (!_M_failed &&
_Traits::eq_int_type(_M_sbuf->sputc(__c),_Traits::eof()))
_M_failed = true;
return *this;
}
-#if 0
- // Optimized specializations of standard algorithms
- // These are specialized only for standard types
- // (with no unbound arguments) to avoid creating
- // overload problems with user specializations.
-
- template<>
- char const*
- copy(char const* __first, char const* __last,
- ostreambuf_iterator<char,char_traits<char> > __to)
- {
- if (!__to._M_failed)
- __to._M_sbuf->sputn(__first, __last-__first);
- return __last;
- }
-
- template<>
- wchar_t const*
- copy(wchar_t const* __first, wchar_t const* __last,
- ostreambuf_iterator<whar_t,char_traits<wchar_t> > __to)
- {
- if (!__to._M_failed)
- __to._M_sbuf->sputn(__first, __last-__first);
- return __last;
- }
-#endif
-
// 24.5.3 Template class istreambuf_iterator
- template<class _CharT, class _Traits>
+ template<typename _CharT, typename _Traits>
class istreambuf_iterator
: public iterator<input_iterator_tag, _CharT, typename _Traits::off_type,
_CharT*, _CharT&>
{
public:
-
// Types:
typedef _CharT char_type;
typedef _Traits traits_type;
@@ -148,14 +106,26 @@ namespace std
// Non-standard Types:
typedef istreambuf_iterator<_CharT, _Traits> __istreambufiter_type;
+ private:
+ // 24.5.3 istreambuf_iterator
+ // p 1
+ // If the end of stream is reached (streambuf_type::sgetc()
+ // returns traits_type::eof()), the iterator becomes equal to
+ // the "end of stream" iterator value.
+ // NB: This implementation assumes the "end of stream" value
+ // is EOF, or -1.
+ streambuf_type* _M_sbuf;
+ int_type _M_c;
+
+ public:
istreambuf_iterator() throw()
- : _M_istreambuf(NULL), _M_c(-2) { }
+ : _M_sbuf(NULL), _M_c(-2) { }
istreambuf_iterator(istream_type& __s) throw()
- : _M_istreambuf(__s.rdbuf()), _M_c(-2) { }
+ : _M_sbuf(__s.rdbuf()), _M_c(-2) { }
istreambuf_iterator(streambuf_type* __s) throw()
- : _M_istreambuf(__s), _M_c(-2) { }
+ : _M_sbuf(__s), _M_c(-2) { }
// NB: This should really have an int_type return
// value, so "end of stream" postion can be checked without
@@ -165,10 +135,10 @@ namespace std
{
// The result of operator*() on an end of stream is undefined.
char_type __ret;
- if (_M_istreambuf && _M_c != static_cast<int_type>(-2))
+ if (_M_sbuf && _M_c != static_cast<int_type>(-2))
__ret = _M_c;
- else if (_M_istreambuf)
- __ret = traits_type::to_char_type(_M_istreambuf->sgetc());
+ else if (_M_sbuf)
+ __ret = traits_type::to_char_type(_M_sbuf->sgetc());
else
__ret = static_cast<char_type>(traits_type::eof());
return __ret;
@@ -177,32 +147,29 @@ namespace std
__istreambufiter_type&
operator++()
{
- if (_M_istreambuf)
- _M_istreambuf->sbumpc();
+ if (_M_sbuf)
+ _M_sbuf->sbumpc();
_M_c = -2;
return *this;
}
-#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
- // 14882 says return a proxy object. It should be a const
- // proxy object, but since this class is not mandated, it
- // should allow this signature:
- const __istreambufiter_type
+ __istreambufiter_type
operator++(int)
{
- if (_M_istreambuf)
- _M_c = _M_istreambuf->sbumpc();
- return *this;
+ __istreambufiter_type __old = *this;
+ if (_M_sbuf)
+ __old._M_c = _M_sbuf->sbumpc();
+ _M_c = -2;
+ return __old;
}
-#endif
bool
equal(const __istreambufiter_type& __b)
{
int_type __eof = traits_type::eof();
- bool __thiseof = !_M_istreambuf || _M_istreambuf->sgetc() == __eof;
- bool __beof = !__b._M_istreambuf
- || __b._M_istreambuf->sgetc() == __eof;
+ bool __thiseof = !_M_sbuf || _M_sbuf->sgetc() == __eof;
+ bool __beof = !__b._M_sbuf
+ || __b._M_sbuf->sgetc() == __eof;
return (__thiseof && __beof || (!__thiseof && !__beof));
}
@@ -213,23 +180,12 @@ namespace std
equal(const __istreambufiter_type& __b) const
{
int_type __eof = traits_type::eof();
- bool __thiseof = !_M_istreambuf || _M_istreambuf->sgetc() == __eof;
- bool __beof = !__b._M_istreambuf
- || __b._M_istreambuf->sgetc() == __eof;
+ bool __thiseof = !_M_sbuf || _M_sbuf->sgetc() == __eof;
+ bool __beof = !__b._M_sbuf
+ || __b._M_sbuf->sgetc() == __eof;
return (__thiseof && __beof || (!__thiseof && !__beof));
}
#endif
-
- private:
- // 24.5.3 istreambuf_iterator
- // p 1
- // If the end of stream is reached (streambuf_type::sgetc()
- // returns traits_type::eof()), the iterator becomes equal to
- // the "end of stream" iterator value.
- // NB: This implementation assumes the "end of stream" value
- // is EOF, or -1.
- streambuf_type* _M_istreambuf;
- int_type _M_c;
};
template<typename _CharT, typename _Traits>
@@ -243,22 +199,5 @@ namespace std
operator!=(const istreambuf_iterator<_CharT, _Traits>& __a,
const istreambuf_iterator<_CharT, _Traits>& __b)
{ return !__a.equal(__b); }
-
-} // std::
-
-#endif /* _CPP_BITS_SBUF_ITER_H */
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+} // namespace std
+#endif
diff --git a/libstdc++-v3/include/bits/sequence_concepts.h b/libstdc++-v3/include/bits/sequence_concepts.h
index af582fb3345..f251e2e26eb 100644
--- a/libstdc++-v3/include/bits/sequence_concepts.h
+++ b/libstdc++-v3/include/bits/sequence_concepts.h
@@ -11,8 +11,10 @@
* purpose. It is provided "as is" without express or implied warranty.
*/
-#ifndef STL_SEQUENCE_CONCEPTS_H
-#define STL_SEQUENCE_CONCEPTS_H
+#ifndef _STL_SEQUENCE_CONCEPTS_H
+#define _STL_SEQUENCE_CONCEPTS_H 1
+
+#pragma GCC system_header
#include <bits/container_concepts.h>
@@ -201,4 +203,4 @@ _BackInsertionSequence_requirement_violation(_BackInsertionSequence __s) {
#endif /* if __STL_USE_CONCEPT_CHECKS */
-#endif /* STL_SEQUENCE_CONCEPTS_H */
+#endif /* _STL_SEQUENCE_CONCEPTS_H */
diff --git a/libstdc++-v3/include/bits/slice.h b/libstdc++-v3/include/bits/slice.h
index 3e4f7a743f6..5efb6e8cf4c 100644
--- a/libstdc++-v3/include/bits/slice.h
+++ b/libstdc++-v3/include/bits/slice.h
@@ -1,6 +1,6 @@
// The template and inlines for the -*- C++ -*- slice class.
-// Copyright (C) 1997-1999 Free Software Foundation, Inc.
+// Copyright (C) 1997-1999, 2001 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
@@ -30,9 +30,12 @@
// Written by Gabriel Dos Reis <Gabriel.Dos-Reis@DPTMaths.ENS-Cachan.Fr>
#ifndef _CPP_BITS_SLICE_H
-#define _CPP_BITS_SLICE_H
+#define _CPP_BITS_SLICE_H 1
-namespace std {
+#pragma GCC system_header
+
+namespace std
+{
class slice
{
diff --git a/libstdc++-v3/include/bits/slice_array.h b/libstdc++-v3/include/bits/slice_array.h
index 4681cb590dc..a38da2a837c 100644
--- a/libstdc++-v3/include/bits/slice_array.h
+++ b/libstdc++-v3/include/bits/slice_array.h
@@ -1,6 +1,6 @@
// The template and inlines for the -*- C++ -*- slice_array class.
-// Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc.
+// Copyright (C) 1997-1999, 2000, 2001 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,7 +32,10 @@
#ifndef _CPP_BITS_SLICE_ARRAY_H
#define _CPP_BITS_SLICE_ARRAY_H 1
-namespace std {
+#pragma GCC system_header
+
+namespace std
+{
template<typename _Tp>
class slice_array
diff --git a/libstdc++-v3/include/bits/sstream.tcc b/libstdc++-v3/include/bits/sstream.tcc
index 5c737b4fa2e..2a03ff0de58 100644
--- a/libstdc++-v3/include/bits/sstream.tcc
+++ b/libstdc++-v3/include/bits/sstream.tcc
@@ -1,6 +1,6 @@
// String based streams -*- C++ -*-
-// Copyright (C) 1997-1999 Free Software Foundation, Inc.
+// Copyright (C) 1997-1999, 2001 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
@@ -36,10 +36,11 @@
#include <bits/std_sstream.h>
-namespace std {
+namespace std
+{
template <class _CharT, class _Traits, class _Alloc>
- basic_stringbuf<_CharT, _Traits, _Alloc>::int_type
+ typename basic_stringbuf<_CharT, _Traits, _Alloc>::int_type
basic_stringbuf<_CharT, _Traits, _Alloc>::
pbackfail(int_type __c)
{
@@ -73,7 +74,7 @@ namespace std {
}
template <class _CharT, class _Traits, class _Alloc>
- basic_stringbuf<_CharT, _Traits, _Alloc>::int_type
+ typename basic_stringbuf<_CharT, _Traits, _Alloc>::int_type
basic_stringbuf<_CharT, _Traits, _Alloc>::
overflow(int_type __c)
{
@@ -113,7 +114,7 @@ namespace std {
}
template <class _CharT, class _Traits, class _Alloc>
- basic_stringbuf<_CharT, _Traits, _Alloc>::pos_type
+ 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)
{
@@ -171,7 +172,7 @@ namespace std {
}
template <class _CharT, class _Traits, class _Alloc>
- basic_stringbuf<_CharT, _Traits, _Alloc>::pos_type
+ typename basic_stringbuf<_CharT, _Traits, _Alloc>::pos_type
basic_stringbuf<_CharT, _Traits, _Alloc>::
seekpos(pos_type __sp, ios_base::openmode __mode)
{
@@ -210,11 +211,3 @@ namespace std {
#endif /* _CPP_BITS_SSTREAM_TCC */
-
-
-
-
-
-
-
-
diff --git a/libstdc++-v3/include/bits/std_algorithm.h b/libstdc++-v3/include/bits/std_algorithm.h
index 3f084265506..4914e1da75f 100644
--- a/libstdc++-v3/include/bits/std_algorithm.h
+++ b/libstdc++-v3/include/bits/std_algorithm.h
@@ -1,3 +1,32 @@
+// <algorithm> -*- C++ -*-
+
+// Copyright (C) 2001 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.
+
/*
*
* Copyright (c) 1994
@@ -27,6 +56,8 @@
#ifndef _CPP_ALGORITHM
#define _CPP_ALGORITHM 1
+#pragma GCC system_header
+
#include <bits/stl_algobase.h>
#include <bits/stl_construct.h>
#include <bits/stl_uninitialized.h>
diff --git a/libstdc++-v3/include/bits/std_bitset.h b/libstdc++-v3/include/bits/std_bitset.h
index d4bf10c45e0..ef8649ca61b 100644
--- a/libstdc++-v3/include/bits/std_bitset.h
+++ b/libstdc++-v3/include/bits/std_bitset.h
@@ -1,3 +1,32 @@
+// <bitset> -*- C++ -*-
+
+// Copyright (C) 2001 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.
+
/*
* Copyright (c) 1998
* Silicon Graphics Computer Systems, Inc.
@@ -14,6 +43,8 @@
#ifndef __SGI_STL_BITSET
#define __SGI_STL_BITSET
+#pragma GCC system_header
+
// A bitset of size N has N % (sizeof(unsigned long) * CHAR_BIT) unused
// bits. (They are the high- order bits in the highest word.) It is
// a class invariant of class bitset<> that those unused bits are
@@ -36,21 +67,15 @@
#include <bits/std_stdexcept.h> // for invalid_argument, out_of_range,
// overflow_error
-#ifdef __STL_USE_NEW_IOSTREAMS
-#include <iostream>
-#else
-#include <bits/std_iostream.h> // for istream, ostream
-#endif
+#include <bits/std_ostream.h> // for ostream (operator<<)
+#include <bits/std_istream.h> // for istream (operator>>)
#define _GLIBCPP_BITSET_BITS_PER_WORD (CHAR_BIT*sizeof(unsigned long))
#define __BITSET_WORDS(__n) \
((__n) < 1 ? 1 : ((__n) + _GLIBCPP_BITSET_BITS_PER_WORD - 1)/_GLIBCPP_BITSET_BITS_PER_WORD)
-__STL_BEGIN_NAMESPACE
-
-#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
-#pragma set woff 1209
-#endif
+namespace std
+{
// structure to aid in counting bits
template<bool __dummy>
@@ -313,7 +338,7 @@ _Base_bitset<_Nw>::_M_do_find_next(size_t __prev, size_t __not_found) const
// Base class: specialization for a single word.
//
-__STL_TEMPLATE_NULL struct _Base_bitset<1> {
+template<> struct _Base_bitset<1> {
typedef unsigned long _WordT;
_WordT _M_w;
@@ -379,7 +404,7 @@ template <size_t _Extrabits> struct _Sanitize {
{ __val &= ~((~static_cast<unsigned long>(0)) << _Extrabits); }
};
-__STL_TEMPLATE_NULL struct _Sanitize<0> {
+template<> struct _Sanitize<0> {
static void _M_do_sanitize(unsigned long) {}
};
@@ -464,7 +489,6 @@ public:
bitset(unsigned long __val) : _Base_bitset<__BITSET_WORDS(_Nb)>(__val)
{ _M_do_sanitize(); }
-#ifdef __STL_MEMBER_TEMPLATES
template<class _CharT, class _Traits, class _Alloc>
explicit bitset(const basic_string<_CharT, _Traits, _Alloc>& __s,
size_t __pos = 0)
@@ -485,17 +509,6 @@ public:
__STL_THROW(out_of_range("bitset"));
_M_copy_from_string(__s, __pos, __n);
}
-#else /* __STL_MEMBER_TEMPLATES */
- explicit bitset(const basic_string<char>& __s,
- size_t __pos = 0,
- size_t __n = basic_string<char>::npos)
- : _Base()
- {
- if (__pos > __s.size())
- __STL_THROW(out_of_range("bitset"));
- _M_copy_from_string(__s, __pos, __n);
- }
-#endif /* __STL_MEMBER_TEMPLATES */
// 23.3.5.2 bitset operations:
bitset<_Nb>& operator&=(const bitset<_Nb>& __rhs) {
@@ -567,14 +580,7 @@ public:
return *this;
}
- bitset<_Nb>& set(size_t __pos) {
- if (__pos >= _Nb)
- __STL_THROW(out_of_range("bitset"));
-
- return _Unchecked_set(__pos);
- }
-
- bitset<_Nb>& set(size_t __pos, int __val) {
+ bitset<_Nb>& set(size_t __pos, bool __val = true) {
if (__pos >= _Nb)
__STL_THROW(out_of_range("bitset"));
@@ -617,18 +623,14 @@ public:
unsigned long to_ulong() const { return this->_M_do_to_ulong(); }
-#if defined(__STL_MEMBER_TEMPLATES) && \
- defined(__STL_EXPLICIT_FUNCTION_TMPL_ARGS)
template <class _CharT, class _Traits, class _Alloc>
basic_string<_CharT, _Traits, _Alloc> to_string() const {
basic_string<_CharT, _Traits, _Alloc> __result;
_M_copy_to_string(__result);
return __result;
}
-#endif /* member templates and explicit function template args */
// Helper functions for string operations.
-#ifdef __STL_MEMBER_TEMPLATES
template<class _CharT, class _Traits, class _Alloc>
void _M_copy_from_string(const basic_string<_CharT,_Traits,_Alloc>& __s,
size_t,
@@ -636,10 +638,6 @@ public:
template<class _CharT, class _Traits, class _Alloc>
void _M_copy_to_string(basic_string<_CharT,_Traits,_Alloc>&) const;
-#else /* __STL_MEMBER_TEMPLATES */
- void _M_copy_from_string(const basic_string<char>&, size_t, size_t);
- void _M_copy_to_string(basic_string<char>&) const;
-#endif /* __STL_MEMBER_TEMPLATES */
size_t count() const { return this->_M_do_count(); }
@@ -653,7 +651,7 @@ public:
}
bool test(size_t __pos) const {
- if (__pos > _Nb)
+ if (__pos >= _Nb)
__STL_THROW(out_of_range("bitset"));
return _Unchecked_test(__pos);
@@ -687,8 +685,6 @@ public:
// Definitions of non-inline member functions.
//
-#ifdef __STL_MEMBER_TEMPLATES
-
template <size_t _Nb>
template<class _CharT, class _Traits, class _Alloc>
void bitset<_Nb>
@@ -723,40 +719,6 @@ void bitset<_Nb>
__s[_Nb - 1 - __i] = '1';
}
-#else /* __STL_MEMBER_TEMPLATES */
-
-template <size_t _Nb>
-void bitset<_Nb>::_M_copy_from_string(const basic_string<char>& __s,
- size_t __pos, size_t __n)
-{
- reset();
- size_t __tmp = _Nb;
- const size_t __nbits = min(__tmp, min(__n, __s.size() - __pos));
- for (size_t __i = 0; __i < __nbits; ++__i) {
- switch(__s[__pos + __nbits - __i - 1]) {
- case '0':
- break;
- case '1':
- set(__i);
- break;
- default:
- __STL_THROW(invalid_argument("bitset"));
- }
- }
-}
-
-template <size_t _Nb>
-void bitset<_Nb>::_M_copy_to_string(basic_string<char>& __s) const
-{
- __s.assign(_Nb, '0');
-
- for (size_t __i = 0; __i < _Nb; ++__i)
- if (_Unchecked_test(__i))
- __s[_Nb - 1 - __i] = '1';
-}
-
-#endif /* __STL_MEMBER_TEMPLATES */
-
// ------------------------------------------------------------
//
@@ -785,8 +747,6 @@ inline bitset<_Nb> operator^(const bitset<_Nb>& __x, const bitset<_Nb>& __y) {
return __result;
}
-#ifdef __STL_USE_NEW_IOSTREAMS
-
template <class _CharT, class _Traits, size_t _Nb>
basic_istream<_CharT, _Traits>&
operator>>(basic_istream<_CharT, _Traits>& __is, bitset<_Nb>& __x)
@@ -800,7 +760,7 @@ operator>>(basic_istream<_CharT, _Traits>& __is, bitset<_Nb>& __x)
if (__sentry) {
basic_streambuf<_CharT, _Traits>* __buf = __is.rdbuf();
for (size_t __i = 0; __i < _Nb; ++__i) {
- static _Traits::int_type __eof = _Traits::eof();
+ static typename _Traits::int_type __eof = _Traits::eof();
typename _Traits::int_type __c1 = __buf->sbumpc();
if (_Traits::eq_int_type(__c1, __eof)) {
@@ -838,59 +798,7 @@ operator<<(basic_ostream<_CharT, _Traits>& __os, const bitset<_Nb>& __x)
return __os << __tmp;
}
-#else /* __STL_USE_NEW_IOSTREAMS */
-
-template <size_t _Nb>
-istream& operator>>(istream& __is, bitset<_Nb>& __x) {
- string __tmp;
- __tmp.reserve(_Nb);
-
- if (__is.flags() & ios::skipws) {
- char __c;
- do
- __is.get(__c);
- while (__is && isspace(__c));
- if (__is)
- __is.putback(__c);
- }
-
- for (size_t __i = 0; __i < _Nb; ++__i) {
- char __c;
- __is.get(__c);
-
- if (!__is)
- break;
- else if (__c != '0' && __c != '1') {
- __is.putback(__c);
- break;
- }
- else
- __tmp.push_back(__c);
- }
-
- if (__tmp.empty())
- __is.clear(__is.rdstate() | ios::failbit);
- else
- __x._M_copy_from_string(__tmp, static_cast<size_t>(0), _Nb);
-
- return __is;
-}
-
-template <size_t _Nb>
-ostream& operator<<(ostream& __os, const bitset<_Nb>& __x) {
- string __tmp;
- __x._M_copy_to_string(__tmp);
- return __os << __tmp;
-}
-
-#endif /* __STL_USE_NEW_IOSTREAMS */
-
-
-#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
-#pragma reset woff 1209
-#endif
-
-__STL_END_NAMESPACE
+} // namespace std
#undef __BITSET_WORDS
diff --git a/libstdc++-v3/include/bits/std_complex.h b/libstdc++-v3/include/bits/std_complex.h
index 1cc836e40dc..0eca499be4a 100644
--- a/libstdc++-v3/include/bits/std_complex.h
+++ b/libstdc++-v3/include/bits/std_complex.h
@@ -37,13 +37,15 @@
#ifndef _CPP_COMPLEX
#define _CPP_COMPLEX 1
+#pragma GCC system_header
+
#include <bits/c++config.h>
+#include <bits/cpp_type_traits.h>
#include <bits/std_cmath.h>
-#include <bits/std_iosfwd.h>
+#include <bits/std_sstream.h>
namespace std
{
-
// Forward declarations
template<typename _Tp> class complex;
template<> class complex<float>;
@@ -236,7 +238,7 @@ namespace std
{
const _Tp __r = _M_real * __z.real() + _M_imag * __z.imag();
const _Tp __n = norm(__z);
- _M_imag = (_M_real * __z.imag() - _M_imag * __z.real()) / __n;
+ _M_imag = (_M_imag * __z.real() - _M_real * __z.imag()) / __n;
_M_real = __r / __n;
return *this;
}
@@ -344,11 +346,47 @@ namespace std
template<typename _Tp, typename _CharT, class _Traits>
basic_istream<_CharT, _Traits>&
- operator>>(basic_istream<_CharT, _Traits>&, complex<_Tp>&);
+ operator>>(basic_istream<_CharT, _Traits>& __is, complex<_Tp>& __x)
+ {
+ _Tp __re_x, __im_x;
+ _CharT __ch;
+ __is >> __ch;
+ if (__ch == '(')
+ {
+ __is >> __re_x >> __ch;
+ if (__ch == ',')
+ {
+ __is >> __im_x >> __ch;
+ if (__ch == ')')
+ __x = complex<_Tp>(__re_x, __im_x);
+ else
+ __is.setstate(ios_base::failbit);
+ }
+ else if (__ch == ')')
+ __x = complex<_Tp>(__re_x, _Tp(0));
+ else
+ __is.setstate(ios_base::failbit);
+ }
+ else
+ {
+ __is.putback(__ch);
+ __is >> __re_x;
+ __x = complex<_Tp>(__re_x, _Tp(0));
+ }
+ return __is;
+ }
template<typename _Tp, typename _CharT, class _Traits>
basic_ostream<_CharT, _Traits>&
- operator<<(basic_ostream<_CharT, _Traits>&, const complex<_Tp>&);
+ operator<<(basic_ostream<_CharT, _Traits>& __os, const complex<_Tp>& __x)
+ {
+ basic_ostringstream<_CharT, _Traits> __s;
+ __s.flags(__os.flags());
+ __s.imbue(__os.getloc());
+ __s.precision(__os.precision());
+ __s << '(' << __x.real() << "," << __x.imag() << ')';
+ return __os << __s.str();
+ }
// Values
template<typename _Tp>
@@ -367,7 +405,7 @@ namespace std
{
_Tp __x = __z.real();
_Tp __y = __z.imag();
- const _Tp __s = abs(__x) + abs(__y);
+ const _Tp __s = max(abs(__x), abs(__y));
if (__s == _Tp()) // well ...
return __s;
__x /= __s;
@@ -380,12 +418,39 @@ namespace std
arg(const complex<_Tp>& __z)
{ return atan2(__z.imag(), __z.real()); }
+ // 26.2.7/5: norm(__z) returns the squared magintude of __z.
+ // As defined, norm() is -not- a norm is the common mathematical
+ // sens used in numerics. The helper class _Norm_helper<> tries to
+ // distinguish between builtin floating point and the rest, so as
+ // to deliver an answer as close as possible to the real value.
+ template<bool>
+ struct _Norm_helper
+ {
+ template<typename _Tp>
+ static inline _Tp _S_do_it(const complex<_Tp>& __z)
+ {
+ const _Tp __x = __z.real();
+ const _Tp __y = __z.imag();
+ return __x * __x + __y * __y;
+ }
+ };
+
+ template<>
+ struct _Norm_helper<true>
+ {
+ template<typename _Tp>
+ static inline _Tp _S_do_it(const complex<_Tp>& __z)
+ {
+ _Tp __res = abs(__z);
+ return __res * __res;
+ }
+ };
+
template<typename _Tp>
inline _Tp
norm(const complex<_Tp>& __z)
{
- _Tp __res = abs(__z);
- return __res * __res;
+ return _Norm_helper<__is_floating<_Tp>::_M_type>::_S_do_it(__z);
}
template<typename _Tp>
@@ -893,14 +958,14 @@ namespace std
inline complex<long double>&
complex<long double>::operator*=(long double __r)
{
- __real__ _M_value *= __r;
+ _M_value *= __r;
return *this;
}
inline complex<long double>&
complex<long double>::operator/=(long double __r)
{
- __real__ _M_value /= __r;
+ _M_value /= __r;
return *this;
}
diff --git a/libstdc++-v3/include/bits/std_deque.h b/libstdc++-v3/include/bits/std_deque.h
index 574ab313755..2ac8f88353a 100644
--- a/libstdc++-v3/include/bits/std_deque.h
+++ b/libstdc++-v3/include/bits/std_deque.h
@@ -1,3 +1,32 @@
+// <deque> -*- C++ -*-
+
+// Copyright (C) 2001 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.
+
/*
*
* Copyright (c) 1994
@@ -27,7 +56,9 @@
#ifndef _CPP_DEQUE
#define _CPP_DEQUE 1
-#include <bits/stl_range_errors.h>
+#pragma GCC system_header
+
+#include <bits/functexcept.h>
#include <bits/stl_algobase.h>
#include <bits/stl_alloc.h>
#include <bits/stl_construct.h>
diff --git a/libstdc++-v3/include/bits/std_fstream.h b/libstdc++-v3/include/bits/std_fstream.h
index 4cafb2d9ee3..a0604abbe0d 100644
--- a/libstdc++-v3/include/bits/std_fstream.h
+++ b/libstdc++-v3/include/bits/std_fstream.h
@@ -1,6 +1,6 @@
// File based streams -*- C++ -*-
-// Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc.
+// Copyright (C) 1997, 1998, 1999, 2000, 2001 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
@@ -34,14 +34,16 @@
#ifndef _CPP_FSTREAM
#define _CPP_FSTREAM 1
+#pragma GCC system_header
+
#include <bits/std_istream.h>
#include <bits/std_ostream.h>
#include <bits/basic_file.h>
#include <bits/std_locale.h> // For codecvt
-#include <bits/c++threads.h> // For __mutext_type
-
-namespace std {
+#include <bits/gthr.h>
+namespace std
+{
template<typename _CharT, typename _Traits>
class basic_filebuf : public basic_streambuf<_CharT, _Traits>
{
@@ -60,7 +62,8 @@ namespace std {
typedef typename traits_type::state_type __state_type;
typedef codecvt<char_type, char, __state_type> __codecvt_type;
typedef typename __codecvt_type::result __res_type;
-
+ typedef ctype<char_type> __ctype_type;
+
friend class ios_base; // For sync_with_stdio.
private:
@@ -72,12 +75,12 @@ namespace std {
__state_type _M_state_cur;
__state_type _M_state_beg;
- // Cached value from use_facet.
- const __codecvt_type* _M_fcvt;
-
// MT lock inherited from libio or other low-level io library.
__c_lock _M_lock;
+ // Set iff _M_buf is allocated memory from _M_allocate_internal_buffer..
+ bool _M_buf_allocated;
+
// XXX Needed?
bool _M_last_overflowed;
@@ -86,13 +89,13 @@ namespace std {
basic_filebuf();
// Non-standard ctor:
- basic_filebuf(int __fd, const char* __name, ios_base::openmode __mode);
-
+ basic_filebuf(__c_file_type* __f, ios_base::openmode __mode,
+ int_type __s = static_cast<int_type>(BUFSIZ));
+
virtual
~basic_filebuf()
{
this->close();
- _M_fcvt = NULL;
_M_last_overflowed = false;
}
@@ -107,13 +110,18 @@ namespace std {
close(void);
protected:
- // Allocate up pback and internal buffers.
void
- _M_allocate_buffers();
+ _M_allocate_internal_buffer();
+
+ void
+ _M_destroy_internal_buffer();
+
+ void
+ _M_allocate_pback_buffer();
// Create __file_type object and initialize it properly.
void
- _M_filebuf_init();
+ _M_allocate_file();
// Overridden virtual functions:
virtual streamsize
@@ -151,16 +159,7 @@ namespace std {
_M_really_overflow(int_type __c = _Traits::eof());
virtual __streambuf_type*
- setbuf(char_type* __s, streamsize __n)
- {
- if (!this->is_open() && __s == 0 && __n == 0)
- {
- _M_buf_size = 0;
- _M_buf_size_opt = 0;
- }
- _M_last_overflowed = false;
- return this;
- }
+ setbuf(char_type* __s, streamsize __n);
virtual pos_type
seekoff(off_type __off, ios_base::seekdir __way,
@@ -245,41 +244,45 @@ namespace std {
typedef basic_filebuf<char_type, traits_type> __filebuf_type;
typedef basic_istream<char_type, traits_type> __istream_type;
- // Constructors/Destructors:
+ private:
+ __filebuf_type _M_filebuf;
+
+ public:
+ // Constructors/Destructors:
basic_ifstream()
- : __istream_type(new __filebuf_type())
- { }
+ : __istream_type(NULL), _M_filebuf()
+ { this->init(&_M_filebuf); }
explicit
basic_ifstream(const char* __s, ios_base::openmode __mode = ios_base::in)
- : __istream_type(new __filebuf_type())
- { this->open(__s, __mode); }
-
- ~basic_ifstream()
+ : __istream_type(NULL), _M_filebuf()
{
- delete _M_streambuf;
- _M_streambuf = NULL;
+ this->init(&_M_filebuf);
+ this->open(__s, __mode);
}
+
+ ~basic_ifstream()
+ { }
// Members:
__filebuf_type*
rdbuf() const
- { return static_cast<__filebuf_type*>(_M_streambuf); }
+ { return const_cast<__filebuf_type*>(&_M_filebuf); }
bool
- is_open(void) { return rdbuf()->is_open(); }
+ is_open(void) { return _M_filebuf.is_open(); }
void
open(const char* __s, ios_base::openmode __mode = ios_base::in)
{
- if (rdbuf()->open(__s, __mode | ios_base::in) == NULL)
+ if (_M_filebuf.open(__s, __mode | ios_base::in) == NULL)
this->setstate(ios_base::failbit);
}
void
close(void)
{
- if (!rdbuf()->close())
+ if (!_M_filebuf.close())
this->setstate(ios_base::failbit);
}
};
@@ -301,43 +304,47 @@ namespace std {
typedef basic_filebuf<char_type, traits_type> __filebuf_type;
typedef basic_ostream<char_type, traits_type> __ostream_type;
+ private:
+ __filebuf_type _M_filebuf;
+
+ public:
// Constructors:
basic_ofstream()
- : __ostream_type(new __filebuf_type())
- { }
+ : __ostream_type(NULL), _M_filebuf()
+ { this->init(&_M_filebuf); }
explicit
basic_ofstream(const char* __s,
ios_base::openmode __mode = ios_base::out|ios_base::trunc)
- : __ostream_type(new __filebuf_type())
- { this->open(__s, __mode); }
-
- ~basic_ofstream()
+ : __ostream_type(NULL), _M_filebuf()
{
- delete _M_streambuf;
- _M_streambuf = NULL;
+ this->init(&_M_filebuf);
+ this->open(__s, __mode);
}
+ ~basic_ofstream()
+ { }
+
// Members:
__filebuf_type*
rdbuf(void) const
- { return static_cast<__filebuf_type*>(_M_streambuf); }
+ { return const_cast<__filebuf_type*>(&_M_filebuf); }
bool
- is_open(void) { return rdbuf()->is_open(); }
+ is_open(void) { return _M_filebuf.is_open(); }
void
open(const char* __s,
ios_base::openmode __mode = ios_base::out | ios_base::trunc)
{
- if (!rdbuf()->open(__s, __mode | ios_base::out))
+ if (!_M_filebuf.open(__s, __mode | ios_base::out))
this->setstate(ios_base::failbit);
}
void
close(void)
{
- if (!rdbuf()->close())
+ if (!_M_filebuf.close())
setstate(ios_base::failbit);
}
};
@@ -360,47 +367,50 @@ namespace std {
typedef basic_ios<char_type, traits_type> __ios_type;
typedef basic_iostream<char_type, traits_type> __iostream_type;
+ private:
+ __filebuf_type _M_filebuf;
+
+ public:
// Constructors/destructor:
basic_fstream()
- : __iostream_type(new __filebuf_type())
- { }
+ : __iostream_type(NULL), _M_filebuf()
+ { this->init(&_M_filebuf); }
explicit
basic_fstream(const char* __s,
ios_base::openmode __mode = ios_base::in | ios_base::out)
- : __iostream_type(new __filebuf_type())
- { this->open(__s, __mode); }
-
- ~basic_fstream()
+ : __iostream_type(NULL), _M_filebuf()
{
- delete _M_streambuf;
- _M_streambuf = NULL;
+ this->init(&_M_filebuf);
+ this->open(__s, __mode);
}
+
+ ~basic_fstream()
+ { }
// Members:
__filebuf_type*
rdbuf(void) const
- { return static_cast<__filebuf_type*>(_M_streambuf); }
+ { return const_cast<__filebuf_type*>(&_M_filebuf); }
bool
- is_open(void) { return rdbuf()->is_open(); }
+ is_open(void) { return _M_filebuf.is_open(); }
void
open(const char* __s,
ios_base::openmode __mode = ios_base::in | ios_base::out)
{
- if (!rdbuf()->open(__s, __mode))
- setstate (ios_base::failbit);
+ if (!_M_filebuf.open(__s, __mode))
+ setstate(ios_base::failbit);
}
void
close(void)
{
- if (!rdbuf()->close())
- setstate (ios_base::failbit);
+ if (!_M_filebuf.close())
+ setstate(ios_base::failbit);
}
};
-
} // namespace std
@@ -411,10 +421,5 @@ namespace std {
#endif
#endif
-#endif /* _CPP_FSTREAM */
-
-
-
-
-
+#endif
diff --git a/libstdc++-v3/include/bits/std_functional.h b/libstdc++-v3/include/bits/std_functional.h
index 0336c2aedab..bf67c3a0c18 100644
--- a/libstdc++-v3/include/bits/std_functional.h
+++ b/libstdc++-v3/include/bits/std_functional.h
@@ -1,3 +1,32 @@
+// <functional> -*- C++ -*-
+
+// Copyright (C) 2001 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.
+
/*
* Copyright (c) 1997
* Silicon Graphics Computer Systems, Inc.
@@ -13,9 +42,10 @@
*/
#ifndef _CPP_FUNCTIONAL
-#define _CPP_FUNCTIONAL
+#define _CPP_FUNCTIONAL 1
-#include <bits/stl_config.h>
+#pragma GCC system_header
+#include <bits/c++config.h>
#include <bits/std_cstddef.h>
#include <bits/stl_function.h>
diff --git a/libstdc++-v3/include/bits/std_iomanip.h b/libstdc++-v3/include/bits/std_iomanip.h
index 6fa49386b67..5e0cb91bdc1 100644
--- a/libstdc++-v3/include/bits/std_iomanip.h
+++ b/libstdc++-v3/include/bits/std_iomanip.h
@@ -1,6 +1,6 @@
// Standard stream manipulators -*- C++ -*-
-// Copyright (C) 1997-1999 Free Software Foundation, Inc.
+// Copyright (C) 1997-1999, 2001 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
@@ -34,11 +34,14 @@
#ifndef _CPP_IOMANIP
#define _CPP_IOMANIP 1
+#pragma GCC system_header
+
#include <bits/c++config.h>
#include <bits/std_istream.h>
#include <bits/std_functional.h>
-namespace std {
+namespace std
+{
struct _Resetiosflags { ios_base::fmtflags _M_mask; };
@@ -213,7 +216,3 @@ namespace std {
#endif /* __IOMANIP */
-
-
-
-
diff --git a/libstdc++-v3/include/bits/std_ios.h b/libstdc++-v3/include/bits/std_ios.h
index 1471c1ca619..abedfe6abc4 100644
--- a/libstdc++-v3/include/bits/std_ios.h
+++ b/libstdc++-v3/include/bits/std_ios.h
@@ -34,6 +34,8 @@
#ifndef _CPP_IOS
#define _CPP_IOS 1
+#pragma GCC system_header
+
#include <bits/std_iosfwd.h>
#include <exception> // For ios_base::failure
#include <bits/char_traits.h> // For char_traits, streamoff, streamsize, fpos
@@ -45,7 +47,3 @@
#endif /* _CPP_IOS */
-
-
-
-
diff --git a/libstdc++-v3/include/bits/std_iosfwd.h b/libstdc++-v3/include/bits/std_iosfwd.h
index 15631a29e2b..9d2dbc2a2d1 100644
--- a/libstdc++-v3/include/bits/std_iosfwd.h
+++ b/libstdc++-v3/include/bits/std_iosfwd.h
@@ -1,6 +1,6 @@
// Forwarding declarations -*- C++ -*-
-// Copyright (C) 1997-1999 Free Software Foundation, Inc.
+// Copyright (C) 1997, 1998, 1999, 2001 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
@@ -34,18 +34,15 @@
#ifndef _CPP_IOSFWD
#define _CPP_IOSFWD 1
+#pragma GCC system_header
+
#include <bits/c++config.h>
-#include <bits/std_cwchar.h> // For mbstate_t
#include <bits/stringfwd.h> // For string forward declarations.
+#include <bits/fpos.h>
+#include <bits/functexcept.h>
namespace std
{
- // Forward declarations
- template<> class char_traits<char>;
-#ifdef _GLIBCPP_USE_WCHAR_T
- template<> class char_traits<wchar_t>;
-#endif
-
template<typename _CharT, typename _Traits = char_traits<_CharT> >
class basic_ios;
@@ -100,18 +97,6 @@ namespace std
class ios_base;
#endif
- template<class _State> struct fpos;
-#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
- // Can't have self-recursive types for streampos.
- // 21.1.3.1 char_traits sets size_type to streampos
- // 27.4.1
- // And here, where streampos is typedefed to fpos<traits::state_type>
- typedef fpos<mbstate_t> streampos;
-# ifdef _GLIBCPP_USE_WCHAR_T
- typedef fpos<mbstate_t> wstreampos;
-# endif
-#endif
-
typedef basic_ios<char> ios;
typedef basic_streambuf<char> streambuf;
typedef basic_istream<char> istream;
@@ -144,3 +129,8 @@ namespace std
} // namespace std
#endif // _CPP_IOSFWD
+
+
+
+
+
diff --git a/libstdc++-v3/include/bits/std_iostream.h b/libstdc++-v3/include/bits/std_iostream.h
index 191e09d03ec..8c1411f5d50 100644
--- a/libstdc++-v3/include/bits/std_iostream.h
+++ b/libstdc++-v3/include/bits/std_iostream.h
@@ -34,6 +34,8 @@
#ifndef _CPP_IOSTREAM
#define _CPP_IOSTREAM 1
+#pragma GCC system_header
+
#include <bits/c++config.h>
#include <bits/std_ostream.h>
#include <bits/std_istream.h>
diff --git a/libstdc++-v3/include/bits/std_istream.h b/libstdc++-v3/include/bits/std_istream.h
index 4a0f6602d02..c4e6a9f9b3e 100644
--- a/libstdc++-v3/include/bits/std_istream.h
+++ b/libstdc++-v3/include/bits/std_istream.h
@@ -1,6 +1,6 @@
// Input streams -*- C++ -*-
-// Copyright (C) 1997-1999 Free Software Foundation, Inc.
+// Copyright (C) 1997-1999, 2001 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
@@ -34,17 +34,18 @@
#ifndef _CPP_ISTREAM
#define _CPP_ISTREAM 1
+#pragma GCC system_header
+
#include <bits/std_ios.h>
#include <bits/std_limits.h> // For numeric_limits
-namespace std {
-
+namespace std
+{
// 27.6.1.1 Template class basic_istream
template<typename _CharT, typename _Traits>
class basic_istream : virtual public basic_ios<_CharT, _Traits>
{
public:
-
// Types (inherited from basic_ios (27.4.4)):
typedef _CharT char_type;
typedef typename _Traits::int_type int_type;
@@ -56,7 +57,7 @@ namespace std {
typedef basic_streambuf<_CharT, _Traits> __streambuf_type;
typedef basic_ios<_CharT, _Traits> __ios_type;
typedef basic_istream<_CharT, _Traits> __istream_type;
- typedef istreambuf_iterator<_CharT> __istreambuf_iter;
+ typedef istreambuf_iterator<_CharT, _Traits> __istreambuf_iter;
typedef num_get<_CharT, __istreambuf_iter> __numget_type;
typedef ctype<_CharT> __ctype_type;
@@ -75,10 +76,7 @@ namespace std {
virtual
~basic_istream()
- {
- _M_gcount = streamsize(0);
- _M_fnumget = NULL;
- }
+ { _M_gcount = streamsize(0); }
// 27.6.1.1.2 Prefix/suffix:
class sentry;
@@ -216,11 +214,10 @@ namespace std {
class basic_istream<_CharT, _Traits>::sentry
{
public:
-
typedef _Traits traits_type;
typedef basic_streambuf<_CharT, _Traits> __streambuf_type;
typedef basic_istream<_CharT, _Traits> __istream_type;
- typedef __istream_type::__ctype_type __ctype_type;
+ typedef typename __istream_type::__ctype_type __ctype_type;
typedef typename _Traits::int_type __int_type;
explicit
@@ -268,7 +265,6 @@ namespace std {
public basic_ostream<_CharT, _Traits>
{
public:
-
// Non-standard Types:
typedef basic_istream<_CharT, _Traits> __istream_type;
typedef basic_ostream<_CharT, _Traits> __ostream_type;
@@ -286,7 +282,6 @@ namespace std {
template<typename _CharT, typename _Traits>
basic_istream<_CharT, _Traits>&
ws(basic_istream<_CharT, _Traits>& __is);
-
} // namespace std
#ifdef _GLIBCPP_NO_TEMPLATE_EXPORT
@@ -298,10 +293,3 @@ namespace std {
#endif /* _CPP_ISTREAM */
-
-
-
-
-
-
-
diff --git a/libstdc++-v3/include/bits/std_iterator.h b/libstdc++-v3/include/bits/std_iterator.h
index 65eda060737..95a5a14ff19 100644
--- a/libstdc++-v3/include/bits/std_iterator.h
+++ b/libstdc++-v3/include/bits/std_iterator.h
@@ -1,3 +1,32 @@
+// <iterator> -*- C++ -*-
+
+// Copyright (C) 2001 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.
+
/*
*
* Copyright (c) 1994
@@ -27,10 +56,12 @@
#ifndef _CPP_ITERATOR
#define _CPP_ITERATOR 1
-#include <bits/stl_config.h>
+#pragma GCC system_header
+#include <bits/c++config.h>
#include <bits/std_cstddef.h>
#include <bits/std_iosfwd.h>
-#include <bits/stl_iterator_base.h>
+#include <bits/stl_iterator_base_types.h>
+#include <bits/stl_iterator_base_funcs.h>
#include <bits/stl_iterator.h>
#endif /* _CPP_ITERATOR */
@@ -39,7 +70,3 @@
// mode:C++
// End:
-
-
-
-
diff --git a/libstdc++-v3/include/bits/std_limits.h b/libstdc++-v3/include/bits/std_limits.h
new file mode 100644
index 00000000000..628909f7ec7
--- /dev/null
+++ b/libstdc++-v3/include/bits/std_limits.h
@@ -0,0 +1,1982 @@
+// The template and inlines for the -*- C++ -*- numeric_limits classes.
+
+// Copyright (C) 1999-2001 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.
+
+// Note: this is not a conforming implementation.
+// Written by Gabriel Dos Reis <gdr@codesourcery.com>
+
+//
+// ISO 14882:1998
+// 18.2.1
+//
+
+#ifndef _CPP_NUMERIC_LIMITS
+#define _CPP_NUMERIC_LIMITS 1
+
+#pragma GCC system_header
+
+#include <bits/c++config.h>
+
+//
+// The numeric_limits<> traits document implementation-defined aspects
+// of fundamental arithmetic data types (integers and floating points).
+// From Standard C++ point of view, there are 13 such types:
+// * integers
+// bool (1)
+// char, signed char, unsigned char (3)
+// short, unsigned short (2)
+// int, unsigned (2)
+// long, unsigned long (2)
+//
+// * floating points
+// float (1)
+// double (1)
+// long double (1)
+//
+// GNU C++ undertstands (where supported by the host C-library)
+// * integer
+// long long, unsigned long long (2)
+//
+// which brings us to 15 fundamental arithmetic data types in GNU C++.
+//
+//
+// Since a numeric_limits<> is a bit tricky to get right, we rely on
+// an interface composed of macros which should be defined in config/os
+// or config/cpu when they differ from the generic (read arbitrary)
+// definitions given here.
+//
+
+// These values can be overridden in the target configuration file.
+// The default values are appropriate for many 32-bit targets.
+
+#ifndef __glibcpp_char_bits
+#define __glibcpp_char_bits 8
+#endif
+#ifdef __CHAR_UNSIGNED__
+#define __glibcpp_plain_char_is_signed false
+#else
+#define __glibcpp_plain_char_is_signed true
+#endif
+#ifndef __glibcpp_short_bits
+#define __glibcpp_short_bits 16
+#endif
+#ifndef __glibcpp_int_bits
+#define __glibcpp_int_bits 32
+#endif
+#ifndef __glibcpp_long_bits
+#define __glibcpp_long_bits 32
+#endif
+#ifndef __glibcpp_wchar_t_bits
+#define __glibcpp_wchar_t_bits 32
+#endif
+#ifndef __glibcpp_wchar_t_is_signed
+#define __glibcpp_wchar_t_is_signed __glibcpp_plain_char_is_signed
+#endif
+#ifndef __glibcpp_long_long_bits
+#define __glibcpp_long_long_bits 64
+#endif
+#ifndef __glibcpp_float_bits
+#define __glibcpp_float_bits 32
+#endif
+#ifndef __glibcpp_double_bits
+#define __glibcpp_double_bits 64
+#endif
+#ifndef __glibcpp_long_double_bits
+#define __glibcpp_long_double_bits 128
+#endif
+
+#ifndef __glibcpp_char_traps
+#define __glibcpp_char_traps true
+#endif
+#ifndef __glibcpp_short_traps
+#define __glibcpp_short_traps true
+#endif
+#ifndef __glibcpp_int_traps
+#define __glibcpp_int_traps true
+#endif
+#ifndef __glibcpp_long_traps
+#define __glibcpp_long_traps true
+#endif
+#ifndef __glibcpp_wchar_t_traps
+#define __glibcpp_wchar_t_traps true
+#endif
+#ifndef __glibcpp_long_long_traps
+#define __glibcpp_long_long_traps true
+#endif
+
+// You should not need to define any macros below this point, unless
+// you have a machine with non-standard bit-widths.
+
+// These values are the minimums and maximums for standard data types
+// of common widths.
+
+#define __glibcpp_s8_max 127
+#define __glibcpp_s8_min (-__glibcpp_s8_max - 1)
+#define __glibcpp_s8_digits 7
+#define __glibcpp_s8_digits10 3
+#define __glibcpp_u8_min 0U
+#define __glibcpp_u8_max (__glibcpp_s8_max * 2 + 1)
+#define __glibcpp_u8_digits 8
+#define __glibcpp_u8_digits10 3
+#define __glibcpp_s16_max 32767
+#define __glibcpp_s16_min (-__glibcpp_s16_max - 1)
+#define __glibcpp_s16_digits 15
+#define __glibcpp_s16_digits10 5
+#define __glibcpp_u16_min 0U
+#define __glibcpp_u16_max (__glibcpp_s16_max * 2 + 1)
+#define __glibcpp_u16_digits 16
+#define __glibcpp_u16_digits10 5
+#define __glibcpp_s32_max 2147483647L
+#define __glibcpp_s32_min (-__glibcpp_s32_max - 1)
+#define __glibcpp_s32_digits 31
+#define __glibcpp_s32_digits10 10
+#define __glibcpp_u32_min 0UL
+#define __glibcpp_u32_max (__glibcpp_s32_max * 2U + 1)
+#define __glibcpp_u32_digits 32
+#define __glibcpp_u32_digits10 10
+#define __glibcpp_s64_max 9223372036854775807LL
+#define __glibcpp_s64_min (-__glibcpp_s64_max - 1)
+#define __glibcpp_s64_digits 63
+#define __glibcpp_s64_digits10 19
+#define __glibcpp_u64_min 0ULL
+#define __glibcpp_u64_max (__glibcpp_s64_max * 2ULL + 1)
+#define __glibcpp_u64_digits 64
+#define __glibcpp_u64_digits10 19
+
+#define __glibcpp_f32_min 1.17549435e-38F
+#define __glibcpp_f32_max 3.40282347e+38F
+#define __glibcpp_f32_digits 24
+#define __glibcpp_f32_digits10 6
+#define __glibcpp_f32_radix 2
+#define __glibcpp_f32_epsilon 1.19209290e-07F
+#define __glibcpp_f32_round_error 1.0F
+#define __glibcpp_f32_min_exponent -125
+#define __glibcpp_f32_min_exponent10 -37
+#define __glibcpp_f32_max_exponent 128
+#define __glibcpp_f32_max_exponent10 38
+#define __glibcpp_f64_min 2.2250738585072014e-308
+#define __glibcpp_f64_max 1.7976931348623157e+308
+#define __glibcpp_f64_digits 53
+#define __glibcpp_f64_digits10 15
+#define __glibcpp_f64_radix 2
+#define __glibcpp_f64_epsilon 2.2204460492503131e-16
+#define __glibcpp_f64_round_error 1.0
+#define __glibcpp_f64_min_exponent -1021
+#define __glibcpp_f64_min_exponent10 -307
+#define __glibcpp_f64_max_exponent 1024
+#define __glibcpp_f64_max_exponent10 308
+#define __glibcpp_f80_min 3.36210314311209350626e-4932L
+#define __glibcpp_f80_max 1.18973149535723176502e+4932L
+#define __glibcpp_f80_digits 64
+#define __glibcpp_f80_digits10 18
+#define __glibcpp_f80_radix 2
+#define __glibcpp_f80_epsilon 1.08420217248550443401e-19L
+#define __glibcpp_f80_round_error 1.0L
+#define __glibcpp_f80_min_exponent -16381
+#define __glibcpp_f80_min_exponent10 -4931
+#define __glibcpp_f80_max_exponent 16384
+#define __glibcpp_f80_max_exponent10 4932
+#define __glibcpp_f96_min 1.68105157155604675313e-4932L
+#define __glibcpp_f96_max 1.18973149535723176502e+4932L
+#define __glibcpp_f96_digits 64
+#define __glibcpp_f96_digits10 18
+#define __glibcpp_f96_radix 2
+#define __glibcpp_f96_epsilon 1.08420217248550443401e-19L
+#define __glibcpp_f96_round_error 1.0L
+#define __glibcpp_f96_min_exponent -16382
+#define __glibcpp_f96_min_exponent10 -4931
+#define __glibcpp_f96_max_exponent 16384
+#define __glibcpp_f96_max_exponent10 4932
+#define __glibcpp_f128_min 3.362103143112093506262677817321752603E-4932L
+#define __glibcpp_f128_max 1.189731495357231765085759326628007016E+4932L
+#define __glibcpp_f128_digits 113
+#define __glibcpp_f128_digits10 33
+#define __glibcpp_f128_radix 2
+#define __glibcpp_f128_epsilon 1.925929944387235853055977942584927319E-34L
+#define __glibcpp_f128_round_error 1.0L
+#define __glibcpp_f128_min_exponent -16381
+#define __glibcpp_f128_min_exponent10 -4931
+#define __glibcpp_f128_max_exponent 16384
+#define __glibcpp_f128_max_exponent10 4932
+
+// bool-specific hooks:
+// __glibcpp_bool_digits __glibcpp_int_traps __glibcpp_long_traps
+
+// This is actually CHAR_BITS because the new ABI says a bool
+// is one (1) byte wide.
+
+#ifndef __glibcpp_bool_digits
+#define __glibcpp_bool_digits __glibcpp_char_bits
+#endif
+
+// char.
+
+#define __glibcpp_plain_char_traps true
+#define __glibcpp_signed_char_traps true
+#define __glibcpp_unsigned_char_traps true
+#if __glibcpp_char_bits == 8
+#define __glibcpp_signed_char_min __glibcpp_s8_min
+#define __glibcpp_signed_char_max __glibcpp_s8_max
+#define __glibcpp_signed_char_digits __glibcpp_s8_digits
+#define __glibcpp_signed_char_digits10 __glibcpp_s8_digits10
+#define __glibcpp_unsigned_char_min __glibcpp_u8_min
+#define __glibcpp_unsigned_char_max __glibcpp_u8_max
+#define __glibcpp_unsigned_char_digits __glibcpp_u8_digits
+#define __glibcpp_unsigned_char_digits10 __glibcpp_u8_digits10
+#elif __glibcpp_char_bits == 16
+#define __glibcpp_signed_char_min __glibcpp_s16_min
+#define __glibcpp_signed_char_max __glibcpp_s16_max
+#define __glibcpp_signed_char_digits __glibcpp_s16_digits
+#define __glibcpp_signed_char_digits10 __glibcpp_s16_digits10
+#define __glibcpp_unsigned_char_min __glibcpp_u16_min
+#define __glibcpp_unsigned_char_max __glibcpp_u16_max
+#define __glibcpp_unsigned_char_digits __glibcpp_u16_digits
+#define __glibcpp_unsigned_char_digits10 __glibcpp_u16_digits10
+#elif __glibcpp_char_bits == 32
+#define __glibcpp_signed_char_min (signed char)__glibcpp_s32_min
+#define __glibcpp_signed_char_max (signed char)__glibcpp_s32_max
+#define __glibcpp_signed_char_digits __glibcpp_s32_digits
+#define __glibcpp_signed_char_digits10 __glibcpp_s32_digits10
+#define __glibcpp_unsigned_char_min (unsigned char)__glibcpp_u32_min
+#define __glibcpp_unsigned_char_max (unsigned char)__glibcpp_u32_max
+#define __glibcpp_unsigned_char_digits __glibcpp_u32_digits
+#define __glibcpp_unsigned_char_digits10 __glibcpp_u32_digits10
+#elif __glibcpp_char_bits == 64
+#define __glibcpp_signed_char_min (signed char)__glibcpp_s64_min
+#define __glibcpp_signed_char_max (signed char)__glibcpp_s64_max
+#define __glibcpp_signed_char_digits __glibcpp_s64_digits
+#define __glibcpp_signed_char_digits10 __glibcpp_s64_digits10
+#define __glibcpp_unsigned_char_min (unsigned char)__glibcpp_u64_min
+#define __glibcpp_unsigned_char_max (unsigned char)__glibcpp_u64_max
+#define __glibcpp_unsigned_char_digits __glibcpp_u64_digits
+#define __glibcpp_unsigned_char_digits10 __glibcpp_u64_digits10
+#else
+// You must define these macros in the configuration file.
+#endif
+
+#if __glibcpp_plain_char_is_signed
+#define __glibcpp_char_min (char)__glibcpp_signed_char_min
+#define __glibcpp_char_max (char)__glibcpp_signed_char_max
+#define __glibcpp_char_digits __glibcpp_signed_char_digits
+#define __glibcpp_char_digits10 __glibcpp_signed_char_digits
+#else
+#define __glibcpp_char_min (char)__glibcpp_unsigned_char_min
+#define __glibcpp_char_max (char)__glibcpp_unsigned_char_max
+#define __glibcpp_char_digits __glibcpp_unsigned_char_digits
+#define __glibcpp_char_digits10 __glibcpp_unsigned_char_digits
+#endif
+
+// short
+
+#define __glibcpp_signed_short_traps true
+#define __glibcpp_unsigned_short_traps true
+#if __glibcpp_short_bits == 8
+#define __glibcpp_signed_short_min __glibcpp_s8_min
+#define __glibcpp_signed_short_max __glibcpp_s8_max
+#define __glibcpp_signed_short_digits __glibcpp_s8_digits
+#define __glibcpp_signed_short_digits10 __glibcpp_s8_digits10
+#define __glibcpp_unsigned_short_min __glibcpp_u8_min
+#define __glibcpp_unsigned_short_max __glibcpp_u8_max
+#define __glibcpp_unsigned_short_digits __glibcpp_u8_digits
+#define __glibcpp_unsigned_short_digits10 __glibcpp_u8_digits10
+#elif __glibcpp_short_bits == 16
+#define __glibcpp_signed_short_min __glibcpp_s16_min
+#define __glibcpp_signed_short_max __glibcpp_s16_max
+#define __glibcpp_signed_short_digits __glibcpp_s16_digits
+#define __glibcpp_signed_short_digits10 __glibcpp_s16_digits10
+#define __glibcpp_unsigned_short_min __glibcpp_u16_min
+#define __glibcpp_unsigned_short_max __glibcpp_u16_max
+#define __glibcpp_unsigned_short_digits __glibcpp_u16_digits
+#define __glibcpp_unsigned_short_digits10 __glibcpp_u16_digits10
+#elif __glibcpp_short_bits == 32
+#define __glibcpp_signed_short_min (short)__glibcpp_s32_min
+#define __glibcpp_signed_short_max (short)__glibcpp_s32_max
+#define __glibcpp_signed_short_digits __glibcpp_s32_digits
+#define __glibcpp_signed_short_digits10 __glibcpp_s32_digits10
+#define __glibcpp_unsigned_short_min (unsigned short)__glibcpp_u32_min
+#define __glibcpp_unsigned_short_max (unsigned short)__glibcpp_u32_max
+#define __glibcpp_unsigned_short_digits __glibcpp_u32_digits
+#define __glibcpp_unsigned_short_digits10 __glibcpp_u32_digits10
+#elif __glibcpp_short_bits == 64
+#define __glibcpp_signed_short_min (short)__glibcpp_s64_min
+#define __glibcpp_signed_short_max (short)__glibcpp_s64_max
+#define __glibcpp_signed_short_digits __glibcpp_s64_digits
+#define __glibcpp_signed_short_digits10 __glibcpp_s64_digits10
+#define __glibcpp_unsigned_short_min (unsigned short)__glibcpp_u64_min
+#define __glibcpp_unsigned_short_max (unsigned short)__glibcpp_u64_max
+#define __glibcpp_unsigned_short_digits __glibcpp_u64_digits
+#define __glibcpp_unsigned_short_digits10 __glibcpp_u64_digits10
+#else
+// You must define these macros in the configuration file.
+#endif
+
+// int
+
+#define __glibcpp_signed_int_traps true
+#define __glibcpp_unsigned_int_traps true
+#if __glibcpp_int_bits == 8
+#define __glibcpp_signed_int_min __glibcpp_s8_min
+#define __glibcpp_signed_int_max __glibcpp_s8_max
+#define __glibcpp_signed_int_digits __glibcpp_s8_digits
+#define __glibcpp_signed_int_digits10 __glibcpp_s8_digits10
+#define __glibcpp_unsigned_int_min __glibcpp_u8_min
+#define __glibcpp_unsigned_int_max __glibcpp_u8_max
+#define __glibcpp_unsigned_int_digits __glibcpp_u8_digits
+#define __glibcpp_unsigned_int_digits10 __glibcpp_u8_digits10
+#elif __glibcpp_int_bits == 16
+#define __glibcpp_signed_int_min __glibcpp_s16_min
+#define __glibcpp_signed_int_max __glibcpp_s16_max
+#define __glibcpp_signed_int_digits __glibcpp_s16_digits
+#define __glibcpp_signed_int_digits10 __glibcpp_s16_digits10
+#define __glibcpp_unsigned_int_min __glibcpp_u16_min
+#define __glibcpp_unsigned_int_max __glibcpp_u16_max
+#define __glibcpp_unsigned_int_digits __glibcpp_u16_digits
+#define __glibcpp_unsigned_int_digits10 __glibcpp_u16_digits10
+#elif __glibcpp_int_bits == 32
+#define __glibcpp_signed_int_min (int)__glibcpp_s32_min
+#define __glibcpp_signed_int_max (int)__glibcpp_s32_max
+#define __glibcpp_signed_int_digits __glibcpp_s32_digits
+#define __glibcpp_signed_int_digits10 __glibcpp_s32_digits10
+#define __glibcpp_unsigned_int_min (unsigned)__glibcpp_u32_min
+#define __glibcpp_unsigned_int_max (unsigned)__glibcpp_u32_max
+#define __glibcpp_unsigned_int_digits __glibcpp_u32_digits
+#define __glibcpp_unsigned_int_digits10 __glibcpp_u32_digits10
+#elif __glibcpp_int_bits == 64
+#define __glibcpp_signed_int_min (int)__glibcpp_s64_min
+#define __glibcpp_signed_int_max (int)__glibcpp_s64_max
+#define __glibcpp_signed_int_digits __glibcpp_s64_digits
+#define __glibcpp_signed_int_digits10 __glibcpp_s64_digits10
+#define __glibcpp_unsigned_int_min (unsigned)__glibcpp_u64_min
+#define __glibcpp_unsigned_int_max (unsigned)__glibcpp_u64_max
+#define __glibcpp_unsigned_int_digits __glibcpp_u64_digits
+#define __glibcpp_unsigned_int_digits10 __glibcpp_u64_digits10
+#else
+// You must define these macros in the configuration file.
+#endif
+
+// long
+
+#define __glibcpp_signed_long_traps true
+#define __glibcpp_unsigned_long_traps true
+#if __glibcpp_long_bits == 8
+#define __glibcpp_signed_long_min __glibcpp_s8_min
+#define __glibcpp_signed_long_max __glibcpp_s8_max
+#define __glibcpp_signed_long_digits __glibcpp_s8_digits
+#define __glibcpp_signed_long_digits10 __glibcpp_s8_digits10
+#define __glibcpp_unsigned_long_min __glibcpp_u8_min
+#define __glibcpp_unsigned_long_max __glibcpp_u8_max
+#define __glibcpp_unsigned_long_digits __glibcpp_u8_digits
+#define __glibcpp_unsigned_long_digits10 __glibcpp_u8_digits10
+#elif __glibcpp_long_bits == 16
+#define __glibcpp_signed_long_min __glibcpp_s16_min
+#define __glibcpp_signed_long_max __glibcpp_s16_max
+#define __glibcpp_signed_long_digits __glibcpp_s16_digits
+#define __glibcpp_signed_long_digits10 __glibcpp_s16_digits10
+#define __glibcpp_unsigned_long_min __glibcpp_u16_min
+#define __glibcpp_unsigned_long_max __glibcpp_u16_max
+#define __glibcpp_unsigned_long_digits __glibcpp_u16_digits
+#define __glibcpp_unsigned_long_digits10 __glibcpp_u16_digits10
+#elif __glibcpp_long_bits == 32
+#define __glibcpp_signed_long_min __glibcpp_s32_min
+#define __glibcpp_signed_long_max __glibcpp_s32_max
+#define __glibcpp_signed_long_digits __glibcpp_s32_digits
+#define __glibcpp_signed_long_digits10 __glibcpp_s32_digits10
+#define __glibcpp_unsigned_long_min __glibcpp_u32_min
+#define __glibcpp_unsigned_long_max __glibcpp_u32_max
+#define __glibcpp_unsigned_long_digits __glibcpp_u32_digits
+#define __glibcpp_unsigned_long_digits10 __glibcpp_u32_digits10
+#elif __glibcpp_long_bits == 64
+#define __glibcpp_signed_long_min (long)__glibcpp_s64_min
+#define __glibcpp_signed_long_max (long)__glibcpp_s64_max
+#define __glibcpp_signed_long_digits __glibcpp_s64_digits
+#define __glibcpp_signed_long_digits10 __glibcpp_s64_digits10
+#define __glibcpp_unsigned_long_min (unsigned long)__glibcpp_u64_min
+#define __glibcpp_unsigned_long_max (unsigned long)__glibcpp_u64_max
+#define __glibcpp_unsigned_long_digits __glibcpp_u64_digits
+#define __glibcpp_unsigned_long_digits10 __glibcpp_u64_digits10
+#else
+// You must define these macros in the configuration file.
+#endif
+
+// long long
+
+#define __glibcpp_signed_long_long_traps true
+#define __glibcpp_signed_long_long_traps true
+#if __glibcpp_long_long_bits == 8
+#define __glibcpp_signed_long_long_min __glibcpp_s8_min
+#define __glibcpp_signed_long_long_max __glibcpp_s8_max
+#define __glibcpp_signed_long_long_digits __glibcpp_s8_digits
+#define __glibcpp_signed_long_long_digits10 __glibcpp_s8_digits10
+#define __glibcpp_unsigned_long_long_min __glibcpp_u8_min
+#define __glibcpp_unsigned_long_long_max __glibcpp_u8_max
+#define __glibcpp_unsigned_long_long_digits __glibcpp_u8_digits
+#define __glibcpp_unsigned_long_long_digits10 __glibcpp_u8_digits10
+#elif __glibcpp_long_long_bits == 16
+#define __glibcpp_signed_long_long_min __glibcpp_s16_min
+#define __glibcpp_signed_long_long_max __glibcpp_s16_max
+#define __glibcpp_signed_long_long_digits __glibcpp_s16_digits
+#define __glibcpp_signed_long_long_digits10 __glibcpp_s16_digits10
+#define __glibcpp_unsigned_long_long_min __glibcpp_u16_min
+#define __glibcpp_unsigned_long_long_max __glibcpp_u16_max
+#define __glibcpp_unsigned_long_long_digits __glibcpp_u16_digits
+#define __glibcpp_unsigned_long_long_digits10 __glibcpp_u16_digits10
+#elif __glibcpp_long_long_bits == 32
+#define __glibcpp_signed_long_long_min __glibcpp_s32_min
+#define __glibcpp_signed_long_long_max __glibcpp_s32_max
+#define __glibcpp_signed_long_long_digits __glibcpp_s32_digits
+#define __glibcpp_signed_long_long_digits10 __glibcpp_s32_digits10
+#define __glibcpp_unsigned_long_long_min __glibcpp_u32_min
+#define __glibcpp_unsigned_long_long_max __glibcpp_u32_max
+#define __glibcpp_unsigned_long_long_digits __glibcpp_u32_digits
+#define __glibcpp_unsigned_long_long_digits10 __glibcpp_u32_digits10
+#elif __glibcpp_long_long_bits == 64
+#define __glibcpp_signed_long_long_min __glibcpp_s64_min
+#define __glibcpp_signed_long_long_max __glibcpp_s64_max
+#define __glibcpp_signed_long_long_digits __glibcpp_s64_digits
+#define __glibcpp_signed_long_long_digits10 __glibcpp_s64_digits10
+#define __glibcpp_signed_long_long_traps true
+#define __glibcpp_unsigned_long_long_min __glibcpp_u64_min
+#define __glibcpp_unsigned_long_long_max __glibcpp_u64_max
+#define __glibcpp_unsigned_long_long_digits __glibcpp_u64_digits
+#define __glibcpp_unsigned_long_long_digits10 __glibcpp_u64_digits10
+#define __glibcpp_unsigned_long_long_traps true
+#else
+// You must define these macros in the configuration file.
+#endif
+
+// wchar_t
+
+#define __glibcpp_wchar_t_traps true
+#if __glibcpp_wchar_t_is_signed
+#if __glibcpp_wchar_t_bits == 8
+#define __glibcpp_wchar_t_min __glibcpp_s8_min
+#define __glibcpp_wchar_t_max __glibcpp_s8_max
+#define __glibcpp_wchar_t_digits __glibcpp_s8_digits
+#define __glibcpp_wchar_t_digits10 __glibcpp_s8_digits10
+#elif __glibcpp_wchar_t_bits == 16
+#define __glibcpp_wchar_t_min __glibcpp_s16_min
+#define __glibcpp_wchar_t_max __glibcpp_s16_max
+#define __glibcpp_wchar_t_digits __glibcpp_s16_digits
+#define __glibcpp_wchar_t_digits10 __glibcpp_s16_digits10
+#elif __glibcpp_wchar_t_bits == 32
+#define __glibcpp_wchar_t_min (wchar_t)__glibcpp_s32_min
+#define __glibcpp_wchar_t_max (wchar_t)__glibcpp_s32_max
+#define __glibcpp_wchar_t_digits __glibcpp_s32_digits
+#define __glibcpp_wchar_t_digits10 __glibcpp_s32_digits10
+#elif __glibcpp_wchar_t_bits == 64
+#define __glibcpp_wchar_t_min (wchar_t)__glibcpp_s64_min
+#define __glibcpp_wchar_t_max (wchar_t)__glibcpp_s64_max
+#define __glibcpp_wchar_t_digits __glibcpp_s64_digits
+#define __glibcpp_wchar_t_digits10 __glibcpp_s64_digits10
+#else
+// You must define these macros in the configuration file.
+#endif
+#else
+#if __glibcpp_wchar_t_bits == 8
+#define __glibcpp_wchar_t_min __glibcpp_u8_min
+#define __glibcpp_wchar_t_max __glibcpp_u8_max
+#define __glibcpp_wchar_t_digits __glibcpp_u8_digits
+#define __glibcpp_wchar_t_digits10 __glibcpp_u8_digits10
+#elif __glibcpp_wchar_t_bits == 16
+#define __glibcpp_wchar_t_min __glibcpp_u16_min
+#define __glibcpp_wchar_t_max __glibcpp_u16_max
+#define __glibcpp_wchar_t_digits __glibcpp_u16_digits
+#define __glibcpp_wchar_t_digits10 __glibcpp_u16_digits10
+#elif __glibcpp_wchar_t_bits == 32
+#define __glibcpp_wchar_t_min (wchar_t)__glibcpp_u32_min
+#define __glibcpp_wchar_t_max (wchar_t)__glibcpp_u32_max
+#define __glibcpp_wchar_t_digits __glibcpp_u32_digits
+#define __glibcpp_wchar_t_digits10 __glibcpp_u32_digits10
+#elif __glibcpp_wchar_t_bits == 64
+#define __glibcpp_wchar_t_min (wchar_t)__glibcpp_u64_min
+#define __glibcpp_wchar_t_max (wchar_t)__glibcpp_u64_max
+#define __glibcpp_wchar_t_digits __glibcpp_u64_digits
+#define __glibcpp_wchar_t_digits10 __glibcpp_u64_digits10
+#else
+// You must define these macros in the configuration file.
+#endif
+#endif
+
+// float
+//
+
+#if __glibcpp_float_bits == 32
+#define __glibcpp_float_min __glibcpp_f32_min
+#define __glibcpp_float_max __glibcpp_f32_max
+#define __glibcpp_float_digits __glibcpp_f32_digits
+#define __glibcpp_float_digits10 __glibcpp_f32_digits10
+#define __glibcpp_float_radix __glibcpp_f32_radix
+#define __glibcpp_float_epsilon __glibcpp_f32_epsilon
+#define __glibcpp_float_round_error __glibcpp_f32_round_error
+#define __glibcpp_float_min_exponent __glibcpp_f32_min_exponent
+#define __glibcpp_float_min_exponent10 __glibcpp_f32_min_exponent10
+#define __glibcpp_float_max_exponent __glibcpp_f32_max_exponent
+#define __glibcpp_float_max_exponent10 __glibcpp_f32_max_exponent10
+#elif __glibcpp_float_bits == 64
+#define __glibcpp_float_min __glibcpp_f64_min
+#define __glibcpp_float_max __glibcpp_f64_max
+#define __glibcpp_float_digits __glibcpp_f64_digits
+#define __glibcpp_float_digits10 __glibcpp_f64_digits10
+#define __glibcpp_float_radix __glibcpp_f64_radix
+#define __glibcpp_float_epsilon __glibcpp_f64_epsilon
+#define __glibcpp_float_round_error __glibcpp_f64_round_error
+#define __glibcpp_float_min_exponent __glibcpp_f64_min_exponent
+#define __glibcpp_float_min_exponent10 __glibcpp_f64_min_exponent10
+#define __glibcpp_float_max_exponent __glibcpp_f64_max_exponent
+#define __glibcpp_float_max_exponent10 __glibcpp_f64_max_exponent10
+#elif __glibcpp_float_bits == 80
+#define __glibcpp_float_min __glibcpp_f80_min
+#define __glibcpp_float_max __glibcpp_f80_max
+#define __glibcpp_float_digits __glibcpp_f80_digits
+#define __glibcpp_float_digits10 __glibcpp_f80_digits10
+#define __glibcpp_float_radix __glibcpp_f80_radix
+#define __glibcpp_float_epsilon __glibcpp_f80_epsilon
+#define __glibcpp_float_round_error __glibcpp_f80_round_error
+#define __glibcpp_float_min_exponent __glibcpp_f80_min_exponent
+#define __glibcpp_float_min_exponent10 __glibcpp_f80_min_exponent10
+#define __glibcpp_float_max_exponent __glibcpp_f80_max_exponent
+#define __glibcpp_float_max_exponent10 __glibcpp_f80_max_exponent10
+#else
+// You must define these macros in the configuration file.
+#endif
+
+// FIXME: These are just stubs and inkorrect
+
+#ifndef __glibcpp_float_has_infinity
+#define __glibcpp_float_has_infinity false
+#endif
+
+#ifndef __glibcpp_float_has_quiet_NaM
+#define __glibcpp_float_has_quiet_NaN false
+#endif
+
+#ifndef __glibcpp_float_has_signaling_NaN
+#define __glibcpp_float_has_signaling_NaN false
+#endif
+
+#ifndef __glibcpp_float_has_denorm
+#define __glibcpp_float_has_denorm denorm_absent
+#endif
+
+#ifndef __glibcpp_float_has_denorm_loss
+#define __glibcpp_float_has_denorm_loss false
+#endif
+
+#ifndef __glibcpp_float_infinity
+#define __glibcpp_float_infinity 0.0F
+#endif
+
+#ifndef __glibcpp_float_quiet_NaN
+#define __glibcpp_float_quiet_NaN 0.0F
+#endif
+
+#ifndef __glibcpp_float_signaling_NaN
+#define __glibcpp_float_signaling_NaN 0.0F
+#endif
+
+#ifndef __glibcpp_float_denorm_min
+#define __glibcpp_float_denorm_min 0.0F
+#endif
+
+#ifndef __glibcpp_float_is_iec559
+#define __glibcpp_float_is_iec559 false
+#endif
+
+#ifndef __glibcpp_float_is_bounded
+#define __glibcpp_float_is_bounded true
+#endif
+
+#ifndef __glibcpp_float_is_modulo
+#define __glibcpp_float_is_modulo false
+#endif
+
+#ifndef __glibcpp_float_traps
+#define __glibcpp_float_traps false
+#endif
+
+#ifndef __glibcpp_float_tinyness_before
+#define __glibcpp_float_tinyness_before false
+#endif
+
+#ifndef __glibcpp_float_round_style
+#define __glibcpp_float_round_style round_toward_zero
+#endif
+
+// double
+
+#if __glibcpp_double_bits == 32
+#define __glibcpp_double_min __glibcpp_f32_min
+#define __glibcpp_double_max __glibcpp_f32_max
+#define __glibcpp_double_digits __glibcpp_f32_digits
+#define __glibcpp_double_digits10 __glibcpp_f32_digits10
+#define __glibcpp_double_radix __glibcpp_f32_radix
+#define __glibcpp_double_epsilon __glibcpp_f32_epsilon
+#define __glibcpp_double_round_error __glibcpp_f32_round_error
+#define __glibcpp_double_min_exponent __glibcpp_f32_min_exponent
+#define __glibcpp_double_min_exponent10 __glibcpp_f32_min_exponent10
+#define __glibcpp_double_max_exponent __glibcpp_f32_max_exponent
+#define __glibcpp_double_max_exponent10 __glibcpp_f32_max_exponent10
+#elif __glibcpp_double_bits == 64
+#define __glibcpp_double_min __glibcpp_f64_min
+#define __glibcpp_double_max __glibcpp_f64_max
+#define __glibcpp_double_digits __glibcpp_f64_digits
+#define __glibcpp_double_digits10 __glibcpp_f64_digits10
+#define __glibcpp_double_radix __glibcpp_f64_radix
+#define __glibcpp_double_epsilon __glibcpp_f64_epsilon
+#define __glibcpp_double_round_error __glibcpp_f64_round_error
+#define __glibcpp_double_min_exponent __glibcpp_f64_min_exponent
+#define __glibcpp_double_min_exponent10 __glibcpp_f64_min_exponent10
+#define __glibcpp_double_max_exponent __glibcpp_f64_max_exponent
+#define __glibcpp_double_max_exponent10 __glibcpp_f64_max_exponent10
+#elif __glibcpp_double_bits == 80
+#define __glibcpp_double_min __glibcpp_f80_min
+#define __glibcpp_double_max __glibcpp_f80_max
+#define __glibcpp_double_digits __glibcpp_f80_digits
+#define __glibcpp_double_digits10 __glibcpp_f80_digits10
+#define __glibcpp_double_radix __glibcpp_f80_radix
+#define __glibcpp_double_epsilon __glibcpp_f80_epsilon
+#define __glibcpp_double_round_error __glibcpp_f80_round_error
+#define __glibcpp_double_min_exponent __glibcpp_f80_min_exponent
+#define __glibcpp_double_min_exponent10 __glibcpp_f80_min_exponent10
+#define __glibcpp_double_max_exponent __glibcpp_f80_max_exponent
+#define __glibcpp_double_max_exponent10 __glibcpp_f80_max_exponent10
+#else
+// You must define these macros in the configuration file.
+#endif
+
+// FIXME: These are just stubs and inkorrect
+
+#ifndef __glibcpp_double_has_infinity
+#define __glibcpp_double_has_infinity false
+#endif
+
+#ifndef __glibcpp_double_has_quiet_NaM
+#define __glibcpp_double_has_quiet_NaN false
+#endif
+
+#ifndef __glibcpp_double_has_signaling_NaN
+#define __glibcpp_double_has_signaling_NaN false
+#endif
+
+#ifndef __glibcpp_double_has_denorm
+#define __glibcpp_double_has_denorm denorm_absent
+#endif
+
+#ifndef __glibcpp_double_has_denorm_loss
+#define __glibcpp_double_has_denorm_loss false
+#endif
+
+#ifndef __glibcpp_double_infinity
+#define __glibcpp_double_infinity 0.0
+#endif
+
+#ifndef __glibcpp_double_quiet_NaN
+#define __glibcpp_double_quiet_NaN 0.0
+#endif
+
+#ifndef __glibcpp_double_signaling_NaN
+#define __glibcpp_double_signaling_NaN 0.0
+#endif
+
+#ifndef __glibcpp_double_denorm_min
+#define __glibcpp_double_denorm_min 0.0
+#endif
+
+#ifndef __glibcpp_double_is_iec559
+#define __glibcpp_double_is_iec559 false
+#endif
+
+#ifndef __glibcpp_double_is_bounded
+#define __glibcpp_double_is_bounded true
+#endif
+
+#ifndef __glibcpp_double_is_modulo
+#define __glibcpp_double_is_modulo false
+#endif
+
+#ifndef __glibcpp_double_traps
+#define __glibcpp_double_traps false
+#endif
+
+#ifndef __glibcpp_double_tinyness_before
+#define __glibcpp_double_tinyness_before false
+#endif
+
+#ifndef __glibcpp_double_round_style
+#define __glibcpp_double_round_style round_toward_zero
+#endif
+
+// long double
+
+#if __glibcpp_long_double_bits == 32
+#define __glibcpp_long_double_min __glibcpp_f32_min
+#define __glibcpp_long_double_max __glibcpp_f32_max
+#define __glibcpp_long_double_digits __glibcpp_f32_digits
+#define __glibcpp_long_double_digits10 __glibcpp_f32_digits10
+#define __glibcpp_long_double_radix __glibcpp_f32_radix
+#define __glibcpp_long_double_epsilon __glibcpp_f32_epsilon
+#define __glibcpp_long_double_round_error __glibcpp_f32_round_error
+#define __glibcpp_long_double_min_exponent __glibcpp_f32_min_exponent
+#define __glibcpp_long_double_min_exponent10 __glibcpp_f32_min_exponent10
+#define __glibcpp_long_double_max_exponent __glibcpp_f32_max_exponent
+#define __glibcpp_long_double_max_exponent10 __glibcpp_f32_max_exponent10
+#elif __glibcpp_long_double_bits == 64
+#define __glibcpp_long_double_min __glibcpp_f64_min
+#define __glibcpp_long_double_max __glibcpp_f64_max
+#define __glibcpp_long_double_digits __glibcpp_f64_digits
+#define __glibcpp_long_double_digits10 __glibcpp_f64_digits10
+#define __glibcpp_long_double_radix __glibcpp_f64_radix
+#define __glibcpp_long_double_epsilon __glibcpp_f64_epsilon
+#define __glibcpp_long_double_round_error __glibcpp_f64_round_error
+#define __glibcpp_long_double_min_exponent __glibcpp_f64_min_exponent
+#define __glibcpp_long_double_min_exponent10 __glibcpp_f64_min_exponent10
+#define __glibcpp_long_double_max_exponent __glibcpp_f64_max_exponent
+#define __glibcpp_long_double_max_exponent10 __glibcpp_f64_max_exponent10
+#elif __glibcpp_long_double_bits == 80
+#define __glibcpp_long_double_min __glibcpp_f80_min
+#define __glibcpp_long_double_max __glibcpp_f80_max
+#define __glibcpp_long_double_digits __glibcpp_f80_digits
+#define __glibcpp_long_double_digits10 __glibcpp_f80_digits10
+#define __glibcpp_long_double_radix __glibcpp_f80_radix
+#define __glibcpp_long_double_epsilon __glibcpp_f80_epsilon
+#define __glibcpp_long_double_round_error __glibcpp_f80_round_error
+#define __glibcpp_long_double_min_exponent __glibcpp_f80_min_exponent
+#define __glibcpp_long_double_min_exponent10 __glibcpp_f80_min_exponent10
+#define __glibcpp_long_double_max_exponent __glibcpp_f80_max_exponent
+#define __glibcpp_long_double_max_exponent10 __glibcpp_f80_max_exponent10
+#elif __glibcpp_long_double_bits == 96
+#define __glibcpp_long_double_min __glibcpp_f96_min
+#define __glibcpp_long_double_max __glibcpp_f96_max
+#define __glibcpp_long_double_digits __glibcpp_f96_digits
+#define __glibcpp_long_double_digits10 __glibcpp_f96_digits10
+#define __glibcpp_long_double_radix __glibcpp_f96_radix
+#define __glibcpp_long_double_epsilon __glibcpp_f96_epsilon
+#define __glibcpp_long_double_round_error __glibcpp_f96_round_error
+#define __glibcpp_long_double_min_exponent __glibcpp_f96_min_exponent
+#define __glibcpp_long_double_min_exponent10 __glibcpp_f96_min_exponent10
+#define __glibcpp_long_double_max_exponent __glibcpp_f96_max_exponent
+#define __glibcpp_long_double_max_exponent10 __glibcpp_f96_max_exponent10
+#elif __glibcpp_long_double_bits == 128
+#define __glibcpp_long_double_min __glibcpp_f128_min
+#define __glibcpp_long_double_max __glibcpp_f128_max
+#define __glibcpp_long_double_digits __glibcpp_f128_digits
+#define __glibcpp_long_double_digits10 __glibcpp_f128_digits10
+#define __glibcpp_long_double_radix __glibcpp_f128_radix
+#define __glibcpp_long_double_epsilon __glibcpp_f128_epsilon
+#define __glibcpp_long_double_round_error __glibcpp_f128_round_error
+#define __glibcpp_long_double_min_exponent __glibcpp_f128_min_exponent
+#define __glibcpp_long_double_min_exponent10 __glibcpp_f128_min_exponent10
+#define __glibcpp_long_double_max_exponent __glibcpp_f128_max_exponent
+#define __glibcpp_long_double_max_exponent10 __glibcpp_f128_max_exponent10
+#else
+// You must define these macros in the configuration file.
+#endif
+
+// FIXME: These are just stubs and inkorrect
+
+#ifndef __glibcpp_long_double_has_infinity
+#define __glibcpp_long_double_has_infinity false
+#endif
+
+#ifndef __glibcpp_long_double_has_quiet_NaN
+#define __glibcpp_long_double_has_quiet_NaN false
+#endif
+
+#ifndef __glibcpp_long_double_has_signaling_NaN
+#define __glibcpp_long_double_has_signaling_NaN false
+#endif
+
+#ifndef __glibcpp_long_double_has_denorm
+#define __glibcpp_long_double_has_denorm denorm_absent
+#endif
+
+#ifndef __glibcpp_long_double_has_denorm_loss
+#define __glibcpp_long_double_has_denorm_loss false
+#endif
+
+#ifndef __glibcpp_long_double_infinity
+#define __glibcpp_long_double_infinity 0.0L
+#endif
+
+#ifndef __glibcpp_long_double_quiet_NaN
+#define __glibcpp_long_double_quiet_NaN 0.0L
+#endif
+
+#ifndef __glibcpp_long_double_signaling_NaN
+#define __glibcpp_long_double_signaling_NaN 0.0L
+#endif
+
+#ifndef __glibcpp_long_double_denorm_min
+#define __glibcpp_long_double_denorm_min 0.0L
+#endif
+
+#ifndef __glibcpp_long_double_is_iec559
+#define __glibcpp_long_double_is_iec559 false
+#endif
+
+#ifndef __glibcpp_long_double_is_bounded
+#define __glibcpp_long_double_is_bounded false
+#endif
+
+#ifndef __glibcpp_long_double_is_modulo
+#define __glibcpp_long_double_is_modulo false
+#endif
+
+#ifndef __glibcpp_long_double_traps
+#define __glibcpp_long_double_traps false
+#endif
+
+#ifndef __glibcpp_long_double_tinyness_before
+#define __glibcpp_long_double_tinyness_before false
+#endif
+
+#ifndef __glibcpp_long_double_round_style
+#define __glibcpp_long_double_round_style round_toward_zero
+#endif
+
+
+namespace std
+{
+ enum float_round_style
+ {
+ round_indeterminate = -1,
+ round_toward_zero = 0,
+ round_to_nearest = 1,
+ round_toward_infinity = 2,
+ round_toward_neg_infinity = 3
+ };
+
+ enum float_denorm_style
+ {
+ denorm_indeterminate = -1,
+ denorm_absent = 0,
+ denorm_present = 1
+ };
+
+ //
+ // The primary class traits
+ //
+ template<typename _Tp>
+ struct numeric_limits
+ {
+ static const bool is_specialized = false;
+
+ static _Tp min() throw() { return static_cast<_Tp>(0); }
+ static _Tp max() throw() { return static_cast<_Tp>(0); }
+
+ static const int digits = 0;
+ static const int digits10 = 0;
+ static const bool is_signed = false;
+ static const bool is_integer = false;
+ static const bool is_exact = false;
+ static const int radix = 0;
+
+ static _Tp epsilon() throw() { return static_cast<_Tp>(0); }
+ static _Tp round_error() throw() { return static_cast<_Tp>(0); }
+
+ static const int min_exponent = 0;
+ static const int min_exponent10 = 0;
+ static const int max_exponent = 0;
+ static const int max_exponent10 = 0;
+
+ static const bool has_infinity = false;
+ static const bool has_quiet_NaN = false;
+ static const bool has_signaling_NaN = false;
+ static const float_denorm_style has_denorm = denorm_absent;
+ static const bool has_denorm_loss = false;
+
+ static _Tp infinity() throw() { return static_cast<_Tp>(0); }
+ static _Tp quiet_NaN() throw() { return static_cast<_Tp>(0); }
+ static _Tp signaling_NaN() throw() { return static_cast<_Tp>(0); }
+ static _Tp denorm_min() throw() { return static_cast<_Tp>(0); }
+
+ static const bool is_iec559 = false;
+ static const bool is_bounded = false;
+ static const bool is_modulo = false;
+
+ static const bool traps = false;
+ static const bool tinyness_before = false;
+ static const float_round_style round_style = round_toward_zero;
+ };
+
+ template<typename _Tp>
+ const bool
+ numeric_limits<_Tp>::is_specialized;
+
+ template<typename _Tp>
+ const int
+ numeric_limits<_Tp>::digits;
+
+ template<typename _Tp>
+ const int
+ numeric_limits<_Tp>::digits10;
+
+ template<typename _Tp>
+ const bool
+ numeric_limits<_Tp>::is_signed;
+
+ template<typename _Tp>
+ const bool
+ numeric_limits<_Tp>::is_integer;
+
+ template<typename _Tp>
+ const bool
+ numeric_limits<_Tp>::is_exact;
+
+ template<typename _Tp>
+ const int
+ numeric_limits<_Tp>::radix;
+
+ template<typename _Tp>
+ const int
+ numeric_limits<_Tp>::min_exponent;
+
+ template<typename _Tp>
+ const int
+ numeric_limits<_Tp>::min_exponent10;
+
+ template<typename _Tp>
+ const int
+ numeric_limits<_Tp>::max_exponent;
+
+ template<typename _Tp>
+ const int
+ numeric_limits<_Tp>::max_exponent10;
+
+ template<typename _Tp>
+ const bool
+ numeric_limits<_Tp>::has_infinity;
+
+ template<typename _Tp>
+ const bool
+ numeric_limits<_Tp>::has_quiet_NaN;
+
+ template<typename _Tp>
+ const bool
+ numeric_limits<_Tp>::has_signaling_NaN;
+
+ template<typename _Tp>
+ const float_denorm_style
+ numeric_limits<_Tp>::has_denorm;
+
+ template<typename _Tp>
+ const bool
+ numeric_limits<_Tp>::has_denorm_loss;
+
+ template<typename _Tp>
+ const bool
+ numeric_limits<_Tp>::is_iec559;
+
+ template<typename _Tp>
+ const bool
+ numeric_limits<_Tp>::is_bounded;
+
+ template<typename _Tp>
+ const bool
+ numeric_limits<_Tp>::is_modulo;
+
+ template<typename _Tp>
+ const bool
+ numeric_limits<_Tp>::traps;
+
+ template<typename _Tp>
+ const bool
+ numeric_limits<_Tp>::tinyness_before;
+
+ template<typename _Tp>
+ const float_round_style
+ numeric_limits<_Tp>::round_style;
+
+ // Now there follow 15 explicit specializations. Yes, 15. Make sure
+ // you get the count right.
+
+ template<>
+ struct numeric_limits<bool>
+ {
+ static const bool is_specialized = true;
+
+ static bool min() throw()
+ { return false; }
+
+ static bool max() throw()
+ { return true; }
+
+ static const int digits = __glibcpp_bool_digits;
+ static const int digits10 = 1;
+ static const bool is_signed = false;
+ static const bool is_integer = true;
+ static const bool is_exact = true;
+ static const int radix = 2;
+ static bool epsilon() throw()
+ { return false; }
+ static bool round_error() throw()
+ { return false; }
+
+ static const int min_exponent = 0;
+ static const int min_exponent10 = 0;
+ static const int max_exponent = 0;
+ static const int max_exponent10 = 0;
+
+ static const bool has_infinity = false;
+ static const bool has_quiet_NaN = false;
+ static const bool has_signaling_NaN = false;
+ static const float_denorm_style has_denorm = denorm_absent;
+ static const bool has_denorm_loss = false;
+
+ static bool infinity() throw()
+ { return false; }
+ static bool quiet_NaN() throw()
+ { return false; }
+ static bool signaling_NaN() throw()
+ { return false; }
+ static bool denorm_min() throw()
+ { return false; }
+
+ static const bool is_iec559 = true;
+ static const bool is_bounded = true;
+ static const bool is_modulo = true;
+
+ // It is not clear what it means for a boolean type to trap.
+ // This is a DR on the LWG issue list. Here, I use integer
+ // promotion semantics.
+ static const bool traps = __glibcpp_signed_int_traps
+ || __glibcpp_signed_long_traps;
+ static const bool tinyness_before = false;
+ static const float_round_style round_style = round_toward_zero;
+ };
+
+#undef __glibcpp_bool_digits
+
+ template<>
+ struct numeric_limits<char>
+ {
+ static const bool is_specialized = true;
+
+ static char min() throw()
+ { return __glibcpp_char_min; }
+ static char max() throw()
+ { return __glibcpp_char_max; }
+
+ static const int digits = __glibcpp_char_digits;
+ static const int digits10 = __glibcpp_char_digits10;
+ static const bool is_signed = __glibcpp_plain_char_is_signed;
+ static const bool is_integer = true;
+ static const bool is_exact = true;
+ static const int radix = 2;
+ static char epsilon() throw()
+ { return char(); }
+ static char round_error() throw()
+ { return char(); }
+
+ static const int min_exponent = 0;
+ static const int min_exponent10 = 0;
+ static const int max_exponent = 0;
+ static const int max_exponent10 = 0;
+
+ static const bool has_infinity = false;
+ static const bool has_quiet_NaN = false;
+ static const bool has_signaling_NaN = false;
+ static const float_denorm_style has_denorm = denorm_absent;
+ static const bool has_denorm_loss = false;
+
+ static char infinity() throw()
+ { return char(); }
+ static char quiet_NaN() throw()
+ { return char(); }
+ static char signaling_NaN() throw()
+ { return char(); }
+ static char denorm_min() throw()
+ { return static_cast<char>(0); }
+
+ static const bool is_iec559 = false;
+ static const bool is_bounded = true;
+ static const bool is_modulo = false;
+
+ static const bool traps = __glibcpp_signed_char_traps;
+ static const bool tinyness_before = false;
+ static const float_round_style round_style = round_toward_zero;
+ };
+
+#undef __glibcpp_char_min
+#undef __glibcpp_char_max
+#undef __glibcpp_char_digits
+#undef __glibcpp_char_digits10
+#undef __glibcpp_char_is_signed
+#undef __glibcpp_char_traps
+
+
+ template<>
+ struct numeric_limits<signed char>
+ {
+ static const bool is_specialized = true;
+
+ static signed char min() throw()
+ { return __glibcpp_signed_char_min; }
+ static signed char max() throw()
+ { return __glibcpp_signed_char_max; }
+
+ static const int digits = __glibcpp_signed_char_digits;
+ static const int digits10 = __glibcpp_signed_char_digits10;
+ static const bool is_signed = true;
+ static const bool is_integer = true;
+ static const bool is_exact = true;
+ static const int radix = 2;
+ static signed char epsilon() throw()
+ { return 0; }
+ static signed char round_error() throw()
+ { return 0; }
+
+ static const int min_exponent = 0;
+ static const int min_exponent10 = 0;
+ static const int max_exponent = 0;
+ static const int max_exponent10 = 0;
+
+ static const bool has_infinity = false;
+ static const bool has_quiet_NaN = false;
+ static const bool has_signaling_NaN = false;
+ static const float_denorm_style has_denorm = denorm_absent;
+ static const bool has_denorm_loss = false;
+
+ static signed char infinity() throw()
+ { return static_cast<signed char>(0); }
+ static signed char quiet_NaN() throw()
+ { return static_cast<signed char>(0); }
+ static signed char signaling_NaN() throw()
+ { return static_cast<signed char>(0); }
+ static signed char denorm_min() throw()
+ { return static_cast<signed char>(0); }
+
+ static const bool is_iec559 = false;
+ static const bool is_bounded = true;
+ static const bool is_modulo = false;
+
+ static const bool traps = __glibcpp_signed_char_traps;
+ static const bool tinyness_before = false;
+ static const float_round_style round_style = round_toward_zero;
+ };
+
+#undef __glibcpp_signed_char_min
+#undef __glibcpp_signed_char_max
+#undef __glibcpp_signed_char_digits
+#undef __glibcpp_signed_char_digits10
+#undef __glibcpp_signed_char_traps
+
+ template<>
+ struct numeric_limits<unsigned char>
+ {
+ static const bool is_specialized = true;
+
+ static unsigned char min() throw()
+ { return 0; }
+ static unsigned char max() throw()
+ { return __glibcpp_unsigned_char_max; }
+
+ static const int digits = __glibcpp_unsigned_char_digits;
+ static const int digits10 = __glibcpp_unsigned_char_digits10;
+ static const bool is_signed = false;
+ static const bool is_integer = true;
+ static const bool is_exact = true;
+ static const int radix = 2;
+ static unsigned char epsilon() throw()
+ { return 0; }
+ static unsigned char round_error() throw()
+ { return 0; }
+
+ static const int min_exponent = 0;
+ static const int min_exponent10 = 0;
+ static const int max_exponent = 0;
+ static const int max_exponent10 = 0;
+
+ static const bool has_infinity = false;
+ static const bool has_quiet_NaN = false;
+ static const bool has_signaling_NaN = false;
+ static const float_denorm_style has_denorm = denorm_absent;
+ static const bool has_denorm_loss = false;
+
+ static unsigned char infinity() throw()
+ { return static_cast<unsigned char>(0); }
+ static unsigned char quiet_NaN() throw()
+ { return static_cast<unsigned char>(0); }
+ static unsigned char signaling_NaN() throw()
+ { return static_cast<unsigned char>(0); }
+ static unsigned char denorm_min() throw()
+ { return static_cast<unsigned char>(0); }
+
+ static const bool is_iec559 = false;
+ static const bool is_bounded = true;
+ static const bool is_modulo = true;
+
+ static const bool traps = __glibcpp_unsigned_char_traps;
+ static const bool tinyness_before = false;
+ static const float_round_style round_style = round_toward_zero;
+ };
+
+#undef __glibcpp_unsigned_char_max
+#undef __glibcpp_unsigned_char_digits
+#undef __glibcpp_unsigned_char_digits10
+#undef __glibcpp_unsigned_char_traps
+
+ template<>
+ struct numeric_limits<wchar_t>
+ {
+ static const bool is_specialized = true;
+
+ static wchar_t min() throw()
+ { return __glibcpp_wchar_t_min; }
+ static wchar_t max() throw()
+ { return __glibcpp_wchar_t_max; }
+
+ static const int digits = __glibcpp_wchar_t_digits;
+ static const int digits10 = __glibcpp_wchar_t_digits10;
+ static const bool is_signed = __glibcpp_wchar_t_is_signed;
+ static const bool is_integer = true;
+ static const bool is_exact = true;
+ static const int radix = 2;
+ static wchar_t epsilon() throw()
+ { return 0; }
+ static wchar_t round_error() throw()
+ { return 0; }
+
+ static const int min_exponent = 0;
+ static const int min_exponent10 = 0;
+ static const int max_exponent = 0;
+ static const int max_exponent10 = 0;
+
+ static const bool has_infinity = false;
+ static const bool has_quiet_NaN = false;
+ static const bool has_signaling_NaN = false;
+ static const float_denorm_style has_denorm = denorm_absent;
+ static const bool has_denorm_loss = false;
+
+ static wchar_t infinity() throw()
+ { return wchar_t(); }
+ static wchar_t quiet_NaN() throw()
+ { return wchar_t(); }
+ static wchar_t signaling_NaN() throw()
+ { return wchar_t(); }
+ static wchar_t denorm_min() throw()
+ { return wchar_t(); }
+
+ static const bool is_iec559 = false;
+ static const bool is_bounded = true;
+ static const bool is_modulo = false;
+
+ static const bool traps = __glibcpp_wchar_t_traps;
+ static const bool tinyness_before = false;
+ static const float_round_style round_style = round_toward_zero;
+ };
+
+#undef __glibcpp_wchar_t_min
+#undef __glibcpp_wchar_t_max
+#undef __glibcpp_wchar_t_digits
+#undef __glibcpp_wchar_t_digits10
+#undef __glibcpp_wchar_t_is_signed
+#undef __glibcpp_wchar_t_traps
+
+ template<>
+ struct numeric_limits<short>
+ {
+ static const bool is_specialized = true;
+
+ static short min() throw()
+ { return __glibcpp_signed_short_min; }
+ static short max() throw()
+ { return __glibcpp_signed_short_max; }
+
+ static const int digits = __glibcpp_signed_short_digits;
+ static const int digits10 = __glibcpp_signed_short_digits10;
+ static const bool is_signed = true;
+ static const bool is_integer = true;
+ static const bool is_exact = true;
+ static const int radix = 2;
+ static short epsilon() throw()
+ { return 0; }
+ static short round_error() throw()
+ { return 0; }
+
+ static const int min_exponent = 0;
+ static const int min_exponent10 = 0;
+ static const int max_exponent = 0;
+ static const int max_exponent10 = 0;
+
+ static const bool has_infinity = false;
+ static const bool has_quiet_NaN = false;
+ static const bool has_signaling_NaN = false;
+ static const float_denorm_style has_denorm = denorm_absent;
+ static const bool has_denorm_loss = false;
+
+ static short infinity() throw()
+ { return short(); }
+ static short quiet_NaN() throw()
+ { return short(); }
+ static short signaling_NaN() throw()
+ { return short(); }
+ static short denorm_min() throw()
+ { return short(); }
+
+ static const bool is_iec559 = true;
+ static const bool is_bounded = true;
+ static const bool is_modulo = false;
+
+ static const bool traps = __glibcpp_signed_short_traps;
+ static const bool tinyness_before = false;
+ static const float_round_style round_style = round_toward_zero;
+ };
+
+#undef __glibcpp_signed_short_min
+#undef __glibcpp_signed_short_max
+#undef __glibcpp_signed_short_digits
+#undef __glibcpp_signed_short_digits10
+#undef __glibcpp_signed_short_traps
+
+ template<>
+ struct numeric_limits<unsigned short>
+ {
+ static const bool is_specialized = true;
+
+ static unsigned short min() throw()
+ { return 0; }
+ static unsigned short max() throw()
+ { return __glibcpp_unsigned_short_max; }
+
+ static const int digits = __glibcpp_unsigned_short_digits;
+ static const int digits10 = __glibcpp_unsigned_short_digits10;
+ static const bool is_signed = false;
+ static const bool is_integer = true;
+ static const bool is_exact = true;
+ static const int radix = 2;
+ static unsigned short epsilon() throw()
+ { return 0; }
+ static unsigned short round_error() throw()
+ { return 0; }
+
+ static const int min_exponent = 0;
+ static const int min_exponent10 = 0;
+ static const int max_exponent = 0;
+ static const int max_exponent10 = 0;
+
+ static const bool has_infinity = false;
+ static const bool has_quiet_NaN = false;
+ static const bool has_signaling_NaN = false;
+ static const float_denorm_style has_denorm = denorm_absent;
+ static const bool has_denorm_loss = false;
+
+ static unsigned short infinity() throw()
+ { return static_cast<unsigned short>(0); }
+ static unsigned short quiet_NaN() throw()
+ { return static_cast<unsigned short>(0); }
+ static unsigned short signaling_NaN() throw()
+ { return static_cast<unsigned short>(0); }
+ static unsigned short denorm_min() throw()
+ { return static_cast<unsigned short>(0); }
+
+ static const bool is_iec559 = true;
+ static const bool is_bounded = true;
+ static const bool is_modulo = true;
+
+ static const bool traps = __glibcpp_unsigned_short_traps;
+ static const bool tinyness_before = false;
+ static const float_round_style round_style = round_toward_zero;
+ };
+
+#undef __glibcpp_unsigned_short_max
+#undef __glibcpp_unsigned_short_digits
+#undef __glibcpp_unsigned_short_digits10
+#undef __glibcpp_unsigned_short_traps
+
+ template<>
+ struct numeric_limits<int>
+ {
+ static const bool is_specialized = true;
+
+ static int min() throw()
+ { return __glibcpp_signed_int_min; }
+ static int max() throw()
+ { return __glibcpp_signed_int_max; }
+
+ static const int digits = __glibcpp_signed_int_digits;
+ static const int digits10 = __glibcpp_signed_int_digits10;
+ static const bool is_signed = true;
+ static const bool is_integer = true;
+ static const bool is_exact = true;
+ static const int radix = 2;
+ static int epsilon() throw()
+ { return 0; }
+ static int round_error() throw()
+ { return 0; }
+
+ static const int min_exponent = 0;
+ static const int min_exponent10 = 0;
+ static const int max_exponent = 0;
+ static const int max_exponent10 = 0;
+
+ static const bool has_infinity = false;
+ static const bool has_quiet_NaN = false;
+ static const bool has_signaling_NaN = false;
+ static const float_denorm_style has_denorm = denorm_absent;
+ static const bool has_denorm_loss = false;
+
+ static int infinity() throw()
+ { return static_cast<int>(0); }
+ static int quiet_NaN() throw()
+ { return static_cast<int>(0); }
+ static int signaling_NaN() throw()
+ { return static_cast<int>(0); }
+ static int denorm_min() throw()
+ { return static_cast<int>(0); }
+
+ static const bool is_iec559 = true;
+ static const bool is_bounded = true;
+ static const bool is_modulo = false;
+
+ static const bool traps = __glibcpp_signed_int_traps;
+ static const bool tinyness_before = false;
+ static const float_round_style round_style = round_toward_zero;
+ };
+
+#undef __glibcpp_signed_int_min
+#undef __glibcpp_signed_int_max
+#undef __glibcpp_signed_int_digits
+#undef __glibcpp_signed_int_digits10
+#undef __glibcpp_signed_int_traps
+
+ template<>
+ struct numeric_limits<unsigned int>
+ {
+ static const bool is_specialized = true;
+
+ static unsigned int min() throw()
+ { return 0; }
+ static unsigned int max() throw()
+ { return __glibcpp_unsigned_int_max; }
+
+ static const int digits = __glibcpp_unsigned_int_digits;
+ static const int digits10 = __glibcpp_unsigned_int_digits10;
+ static const bool is_signed = false;
+ static const bool is_integer = true;
+ static const bool is_exact = true;
+ static const int radix = 2;
+ static unsigned int epsilon() throw()
+ { return 0; }
+ static unsigned int round_error() throw()
+ { return 0; }
+
+ static const int min_exponent = 0;
+ static const int min_exponent10 = 0;
+ static const int max_exponent = 0;
+ static const int max_exponent10 = 0;
+
+ static const bool has_infinity = false;
+ static const bool has_quiet_NaN = false;
+ static const bool has_signaling_NaN = false;
+ static const float_denorm_style has_denorm = denorm_absent;
+ static const bool has_denorm_loss = false;
+
+ static unsigned int infinity() throw()
+ { return static_cast<unsigned int>(0); }
+ static unsigned int quiet_NaN() throw()
+ { return static_cast<unsigned int>(0); }
+ static unsigned int signaling_NaN() throw()
+ { return static_cast<unsigned int>(0); }
+ static unsigned int denorm_min() throw()
+ { return static_cast<unsigned int>(0); }
+
+ static const bool is_iec559 = true;
+ static const bool is_bounded = true;
+ static const bool is_modulo = true;
+
+ static const bool traps = __glibcpp_unsigned_int_traps;
+ static const bool tinyness_before = false;
+ static const float_round_style round_style = round_toward_zero;
+ };
+
+#undef __glibcpp_unsigned_int_max
+#undef __glibcpp_unsigned_int_digits
+#undef __glibcpp_unsigned_int_digits10
+#undef __glibcpp_unsigned_int_traps
+
+ template<>
+ struct numeric_limits<long>
+ {
+ static const bool is_specialized = true;
+
+ static long min() throw()
+ { return __glibcpp_signed_long_min; }
+ static long max() throw()
+ { return __glibcpp_signed_long_max; }
+
+ static const int digits = __glibcpp_signed_long_digits;
+ static const int digits10 = __glibcpp_signed_long_digits10;
+ static const bool is_signed = true;
+ static const bool is_integer = true;
+ static const bool is_exact = true;
+ static const int radix = 2;
+ static long epsilon() throw()
+ { return 0; }
+ static long round_error() throw()
+ { return 0; }
+
+ static const int min_exponent = 0;
+ static const int min_exponent10 = 0;
+ static const int max_exponent = 0;
+ static const int max_exponent10 = 0;
+
+ static const bool has_infinity = false;
+ static const bool has_quiet_NaN = false;
+ static const bool has_signaling_NaN = false;
+ static const float_denorm_style has_denorm = denorm_absent;
+ static const bool has_denorm_loss = false;
+
+ static long infinity() throw()
+ { return static_cast<long>(0); }
+ static long quiet_NaN() throw()
+ { return static_cast<long>(0); }
+ static long signaling_NaN() throw()
+ { return static_cast<long>(0); }
+ static long denorm_min() throw()
+ { return static_cast<long>(0); }
+
+ static const bool is_iec559 = true;
+ static const bool is_bounded = true;
+ static const bool is_modulo = false;
+
+ static const bool traps = __glibcpp_signed_long_traps;
+ static const bool tinyness_before = false;
+ static const float_round_style round_style = round_toward_zero;
+ };
+
+#undef __glibcpp_signed_long_min
+#undef __glibcpp_signed_long_max
+#undef __glibcpp_signed_long_digits
+#undef __glibcpp_signed_long_digits10
+#undef __glibcpp_signed_long_traps
+
+ template<>
+ struct numeric_limits<unsigned long>
+ {
+ static const bool is_specialized = true;
+
+ static unsigned long min() throw()
+ { return 0; }
+ static unsigned long max() throw()
+ { return __glibcpp_unsigned_long_max; }
+
+ static const int digits = __glibcpp_unsigned_long_digits;
+ static const int digits10 = __glibcpp_unsigned_long_digits10;
+ static const bool is_signed = false;
+ static const bool is_integer = true;
+ static const bool is_exact = true;
+ static const int radix = 2;
+ static unsigned long epsilon() throw()
+ { return 0; }
+ static unsigned long round_error() throw()
+ { return 0; }
+
+ static const int min_exponent = 0;
+ static const int min_exponent10 = 0;
+ static const int max_exponent = 0;
+ static const int max_exponent10 = 0;
+
+ static const bool has_infinity = false;
+ static const bool has_quiet_NaN = false;
+ static const bool has_signaling_NaN = false;
+ static const float_denorm_style has_denorm = denorm_absent;
+ static const bool has_denorm_loss = false;
+
+ static unsigned long infinity() throw()
+ { return static_cast<unsigned long>(0); }
+ static unsigned long quiet_NaN() throw()
+ { return static_cast<unsigned long>(0); }
+ static unsigned long signaling_NaN() throw()
+ { return static_cast<unsigned long>(0); }
+ static unsigned long denorm_min() throw()
+ { return static_cast<unsigned long>(0); }
+
+ static const bool is_iec559 = true;
+ static const bool is_bounded = true;
+ static const bool is_modulo = true;
+
+ static const bool traps = __glibcpp_unsigned_long_traps;
+ static const bool tinyness_before = false;
+ static const float_round_style round_style = round_toward_zero;
+ };
+
+#undef __glibcpp_unsigned_long_max
+#undef __glibcpp_unsigned_long_digits
+#undef __glibcpp_unsigned_long_digits10
+#undef __glibcpp_unsigned_long_traps
+
+ template<>
+ struct numeric_limits<long long>
+ {
+ static const bool is_specialized = true;
+
+ static long long min() throw()
+ { return __glibcpp_signed_long_long_min; }
+ static long long max() throw()
+ { return __glibcpp_signed_long_long_max; }
+
+ static const int digits = __glibcpp_signed_long_long_digits;
+ static const int digits10 = __glibcpp_signed_long_long_digits10;
+ static const bool is_signed = true;
+ static const bool is_integer = true;
+ static const bool is_exact = true;
+ static const int radix = 2;
+ static long long epsilon() throw()
+ { return 0; }
+ static long long round_error() throw()
+ { return 0; }
+
+ static const int min_exponent = 0;
+ static const int min_exponent10 = 0;
+ static const int max_exponent = 0;
+ static const int max_exponent10 = 0;
+
+ static const bool has_infinity = false;
+ static const bool has_quiet_NaN = false;
+ static const bool has_signaling_NaN = false;
+ static const float_denorm_style has_denorm = denorm_absent;
+ static const bool has_denorm_loss = false;
+
+ static long long infinity() throw()
+ { return static_cast<long long>(0); }
+ static long long quiet_NaN() throw()
+ { return static_cast<long long>(0); }
+ static long long signaling_NaN() throw()
+ { return static_cast<long long>(0); }
+ static long long denorm_min() throw()
+ { return static_cast<long long>(0); }
+
+ static const bool is_iec559 = true;
+ static const bool is_bounded = true;
+ static const bool is_modulo = false;
+
+ static const bool traps = __glibcpp_signed_long_long_traps;
+ static const bool tinyness_before = false;
+ static const float_round_style round_style = round_toward_zero;
+ };
+
+#undef __glibcpp_signed_long_long_min
+#undef __glibcpp_signed_long_long_max
+#undef __glibcpp_signed_long_long_digits
+#undef __glibcpp_signed_long_long_digits10
+#undef __glibcpp_signed_long_long_traps
+
+ template<>
+ struct numeric_limits<unsigned long long>
+ {
+ static const bool is_specialized = true;
+
+ static unsigned long long min() throw()
+ { return 0; }
+ static unsigned long long max() throw()
+ { return __glibcpp_unsigned_long_long_max; }
+
+ static const int digits = __glibcpp_unsigned_long_long_digits;
+ static const int digits10 = __glibcpp_unsigned_long_long_digits10;
+ static const bool is_signed = false;
+ static const bool is_integer = true;
+ static const bool is_exact = true;
+ static const int radix = 2;
+ static unsigned long long epsilon() throw()
+ { return 0; }
+ static unsigned long long round_error() throw()
+ { return 0; }
+
+ static const int min_exponent = 0;
+ static const int min_exponent10 = 0;
+ static const int max_exponent = 0;
+ static const int max_exponent10 = 0;
+
+ static const bool has_infinity = false;
+ static const bool has_quiet_NaN = false;
+ static const bool has_signaling_NaN = false;
+ static const float_denorm_style has_denorm = denorm_absent;
+ static const bool has_denorm_loss = false;
+
+ static unsigned long long infinity() throw()
+ { return static_cast<unsigned long long>(0); }
+ static unsigned long long quiet_NaN() throw()
+ { return static_cast<unsigned long long>(0); }
+ static unsigned long long signaling_NaN() throw()
+ { return static_cast<unsigned long long>(0); }
+ static unsigned long long denorm_min() throw()
+ { return static_cast<unsigned long long>(0); }
+
+ static const bool is_iec559 = true;
+ static const bool is_bounded = true;
+ static const bool is_modulo = true;
+
+ static const bool traps = true;
+ static const bool tinyness_before = false;
+ static const float_round_style round_style = round_toward_zero;
+ };
+
+#undef __glibcpp_unsigned_long_long_max
+#undef __glibcpp_unsigned_long_long_digits
+#undef __glibcpp_unsigned_long_long_digits10
+#undef __glibcpp_unsigned_long_long_traps
+
+ template<>
+ struct numeric_limits<float>
+ {
+ static const bool is_specialized = true;
+
+ static float min() throw()
+ { return __glibcpp_float_min; }
+ static float max() throw()
+ { return __glibcpp_float_max; }
+
+ static const int digits = __glibcpp_float_digits;
+ static const int digits10 = __glibcpp_float_digits10;
+ static const bool is_signed = true;
+ static const bool is_integer = false;
+ static const bool is_exact = false;
+ static const int radix = __glibcpp_float_radix;
+ static float epsilon() throw()
+ { return __glibcpp_float_epsilon; }
+ static float round_error() throw()
+ { return __glibcpp_float_round_error; }
+
+ static const int min_exponent = __glibcpp_float_min_exponent;
+ static const int min_exponent10 = __glibcpp_float_min_exponent10;
+ static const int max_exponent = __glibcpp_float_max_exponent;
+ static const int max_exponent10 = __glibcpp_float_max_exponent10;
+
+ static const bool has_infinity = __glibcpp_float_has_infinity;
+ static const bool has_quiet_NaN = __glibcpp_float_has_quiet_NaN;
+ static const bool has_signaling_NaN = __glibcpp_float_has_signaling_NaN;
+ static const float_denorm_style has_denorm = __glibcpp_float_has_denorm;
+ static const bool has_denorm_loss = __glibcpp_float_has_denorm_loss;
+
+ static float infinity() throw()
+ { return __glibcpp_float_infinity; }
+ static float quiet_NaN() throw()
+ { return __glibcpp_float_quiet_NaN; }
+ static float signaling_NaN() throw()
+ { return __glibcpp_float_signaling_NaN; }
+ static float denorm_min() throw()
+ { return __glibcpp_float_denorm_min; }
+
+ static const bool is_iec559 = __glibcpp_float_is_iec559;
+ static const bool is_bounded = __glibcpp_float_is_bounded;
+ static const bool is_modulo = __glibcpp_float_is_modulo;
+
+ static const bool traps = __glibcpp_float_traps;
+ static const bool tinyness_before = __glibcpp_float_tinyness_before;
+ static const float_round_style round_style = __glibcpp_float_round_style;
+ };
+
+#undef __glibcpp_float_min
+#undef __glibcpp_float_max
+#undef __glibcpp_float_digits
+#undef __glibcpp_float_digits10
+#undef __glibcpp_float_radix
+#undef __glibcpp_float_round_error
+#undef __glibcpp_float_min_exponent
+#undef __glibcpp_float_min_exponent10
+#undef __glibcpp_float_max_exponent
+#undef __glibcpp_float_max_exponent10
+#undef __glibcpp_float_has_infinity
+#undef __glibcpp_float_has_quiet_NaN
+#undef __glibcpp_float_has_signaling_NaN
+#undef __glibcpp_float_has_denorm
+#undef __glibcpp_float_has_denorm_loss
+#undef __glibcpp_float_infinity
+#undef __glibcpp_float_quiet_NaN
+#undef __glibcpp_float_signaling_NaN
+#undef __glibcpp_float_denorm_min
+#undef __glibcpp_float_is_iec559
+#undef __glibcpp_float_is_bounded
+#undef __glibcpp_float_is_modulo
+#undef __glibcpp_float_traps
+#undef __glibcpp_float_tinyness_before
+#undef __glibcpp_float_round_style
+
+ template<>
+ struct numeric_limits<double>
+ {
+ static const bool is_specialized = true;
+
+ static double min() throw()
+ { return __glibcpp_double_min; }
+ static double max() throw()
+ { return __glibcpp_double_max; }
+
+ static const int digits = __glibcpp_double_digits;
+ static const int digits10 = __glibcpp_double_digits10;
+ static const bool is_signed = true;
+ static const bool is_integer = false;
+ static const bool is_exact = false;
+ static const int radix = __glibcpp_double_radix;
+ static double epsilon() throw()
+ { return __glibcpp_double_epsilon; }
+ static double round_error() throw()
+ { return __glibcpp_double_round_error; }
+
+ static const int min_exponent = __glibcpp_double_min_exponent;
+ static const int min_exponent10 = __glibcpp_double_min_exponent10;
+ static const int max_exponent = __glibcpp_double_max_exponent;
+ static const int max_exponent10 = __glibcpp_double_max_exponent10;
+
+ static const bool has_infinity = __glibcpp_double_has_infinity;
+ static const bool has_quiet_NaN = __glibcpp_double_has_quiet_NaN;
+ static const bool has_signaling_NaN = __glibcpp_double_has_signaling_NaN;
+ static const float_denorm_style has_denorm =
+ __glibcpp_double_has_denorm;;
+ static const bool has_denorm_loss = __glibcpp_double_has_denorm_loss;;
+
+ static double infinity() throw()
+ { return __glibcpp_double_infinity; }
+ static double quiet_NaN() throw()
+ { return __glibcpp_double_quiet_NaN; }
+ static double signaling_NaN() throw()
+ { return __glibcpp_double_signaling_NaN; }
+ static double denorm_min() throw()
+ { return __glibcpp_double_denorm_min; }
+
+ static const bool is_iec559 = __glibcpp_double_is_iec559;
+ static const bool is_bounded = __glibcpp_double_is_bounded;
+ static const bool is_modulo = __glibcpp_double_is_modulo;
+
+ static const bool traps = __glibcpp_double_traps;
+ static const bool tinyness_before = __glibcpp_double_tinyness_before;
+ static const float_round_style round_style =
+ __glibcpp_double_round_style;
+ };
+
+#undef __glibcpp_double_min
+#undef __glibcpp_double_max
+#undef __glibcpp_double_digits
+#undef __glibcpp_double_digits10
+#undef __glibcpp_double_radix
+#undef __glibcpp_double_round_error
+#undef __glibcpp_double_min_exponent
+#undef __glibcpp_double_min_exponent10
+#undef __glibcpp_double_max_exponent
+#undef __glibcpp_double_max_exponent10
+#undef __glibcpp_double_has_infinity
+#undef __glibcpp_double_has_quiet_NaN
+#undef __glibcpp_double_has_signaling_NaN
+#undef __glibcpp_double_has_denorm
+#undef __glibcpp_double_has_denorm_loss
+#undef __glibcpp_double_infinity
+#undef __glibcpp_double_quiet_NaN
+#undef __glibcpp_double_signaling_NaN
+#undef __glibcpp_double_denorm_min
+#undef __glibcpp_double_is_iec559
+#undef __glibcpp_double_is_bounded
+#undef __glibcpp_double_is_modulo
+#undef __glibcpp_double_traps
+#undef __glibcpp_double_tinyness_before
+#undef __glibcpp_double_round_style
+
+
+ template<>
+ struct numeric_limits<long double>
+ {
+ static const bool is_specialized = true;
+
+ static long double min() throw()
+ { return __glibcpp_long_double_min; }
+ static long double max() throw()
+ { return __glibcpp_long_double_max; }
+
+ static const int digits = __glibcpp_long_double_digits;
+ static const int digits10 = __glibcpp_long_double_digits10;
+ static const bool is_signed = true;
+ static const bool is_integer = false;
+ static const bool is_exact = false;
+ static const int radix = __glibcpp_long_double_radix;
+ static long double epsilon() throw()
+ { return __glibcpp_long_double_epsilon; }
+ static long double round_error() throw()
+ { return __glibcpp_long_double_round_error; }
+
+ static const int min_exponent = __glibcpp_long_double_min_exponent;
+ static const int min_exponent10 = __glibcpp_long_double_min_exponent10;
+ static const int max_exponent = __glibcpp_long_double_max_exponent;
+ static const int max_exponent10 = __glibcpp_long_double_max_exponent10;
+
+ static const bool has_infinity = __glibcpp_long_double_has_infinity;
+ static const bool has_quiet_NaN = __glibcpp_long_double_has_quiet_NaN;
+ static const bool has_signaling_NaN =
+ __glibcpp_long_double_has_signaling_NaN;
+ static const float_denorm_style has_denorm =
+ __glibcpp_long_double_has_denorm;
+ static const bool has_denorm_loss =
+ __glibcpp_long_double_has_denorm_loss;
+
+ static long double infinity() throw()
+ { return __glibcpp_long_double_infinity; }
+ static long double quiet_NaN() throw()
+ { return __glibcpp_long_double_quiet_NaN; }
+ static long double signaling_NaN() throw()
+ { return __glibcpp_long_double_signaling_NaN; }
+ static long double denorm_min() throw()
+ { return __glibcpp_long_double_denorm_min; }
+
+ static const bool is_iec559 = __glibcpp_long_double_is_iec559;
+ static const bool is_bounded = __glibcpp_long_double_is_bounded;
+ static const bool is_modulo = __glibcpp_long_double_is_modulo;
+
+ static const bool traps = __glibcpp_long_double_traps;
+ static const bool tinyness_before = __glibcpp_long_double_tinyness_before;
+ static const float_round_style round_style =
+ __glibcpp_long_double_round_style;
+ };
+
+#undef __glibcpp_long_double_min
+#undef __glibcpp_long_double_max
+#undef __glibcpp_long_double_digits
+#undef __glibcpp_long_double_digits10
+#undef __glibcpp_long_double_radix
+#undef __glibcpp_long_double_round_error
+#undef __glibcpp_long_double_min_exponent
+#undef __glibcpp_long_double_min_exponent10
+#undef __glibcpp_long_double_max_exponent
+#undef __glibcpp_long_double_max_exponent10
+#undef __glibcpp_long_double_has_infinity
+#undef __glibcpp_long_double_has_quiet_NaN
+#undef __glibcpp_long_double_has_signaling_NaN
+#undef __glibcpp_long_double_has_denorm
+#undef __glibcpp_long_double_has_denorm_loss
+#undef __glibcpp_long_double_infinity
+#undef __glibcpp_long_double_quiet_NaN
+#undef __glibcpp_long_double_signaling_NaN
+#undef __glibcpp_long_double_denorm_min
+#undef __glibcpp_long_double_is_iec559
+#undef __glibcpp_long_double_is_bounded
+#undef __glibcpp_long_double_is_modulo
+#undef __glibcpp_long_double_traps
+#undef __glibcpp_long_double_tinyness_before
+#undef __glibcpp_long_double_round_style
+
+} // namespace std
+
+#endif // _CPP_NUMERIC_LIMITS
diff --git a/libstdc++-v3/include/bits/std_list.h b/libstdc++-v3/include/bits/std_list.h
index eaf1258cca6..98224057678 100644
--- a/libstdc++-v3/include/bits/std_list.h
+++ b/libstdc++-v3/include/bits/std_list.h
@@ -1,3 +1,32 @@
+// <list> -*- C++ -*-
+
+// Copyright (C) 2001 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.
+
/*
*
* Copyright (c) 1994
@@ -27,6 +56,8 @@
#ifndef _CPP_LIST
#define _CPP_LIST 1
+#pragma GCC system_header
+
#include <bits/stl_algobase.h>
#include <bits/stl_alloc.h>
#include <bits/stl_construct.h>
diff --git a/libstdc++-v3/include/bits/std_locale.h b/libstdc++-v3/include/bits/std_locale.h
index 739e755a826..1b3b58f22d9 100644
--- a/libstdc++-v3/include/bits/std_locale.h
+++ b/libstdc++-v3/include/bits/std_locale.h
@@ -34,6 +34,8 @@
#ifndef _CPP_LOCALE
#define _CPP_LOCALE 1
+#pragma GCC system_header
+
#include <bits/localefwd.h>
#include <bits/locale_facets.h>
#include <bits/locale_facets.tcc>
diff --git a/libstdc++-v3/include/bits/std_map.h b/libstdc++-v3/include/bits/std_map.h
index d7fe92d3ee0..4a6043090c5 100644
--- a/libstdc++-v3/include/bits/std_map.h
+++ b/libstdc++-v3/include/bits/std_map.h
@@ -1,3 +1,32 @@
+// <map> -*- C++ -*-
+
+// Copyright (C) 2001 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.
+
/*
*
* Copyright (c) 1994
@@ -27,6 +56,8 @@
#ifndef _CPP_MAP
#define _CPP_MAP 1
+#pragma GCC system_header
+
#ifndef _CPP_BITS_STL_TREE_H
#include <bits/stl_tree.h>
#endif
diff --git a/libstdc++-v3/include/bits/std_memory.h b/libstdc++-v3/include/bits/std_memory.h
index 5ee126bd8e9..fa9c90dc323 100644
--- a/libstdc++-v3/include/bits/std_memory.h
+++ b/libstdc++-v3/include/bits/std_memory.h
@@ -1,3 +1,32 @@
+// <memory> -*- C++ -*-
+
+// Copyright (C) 2001 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.
+
/*
* Copyright (c) 1997-1999
* Silicon Graphics Computer Systems, Inc.
@@ -15,26 +44,24 @@
#ifndef _CPP_MEMORY
#define _CPP_MEMORY 1
+#pragma GCC system_header
+
#include <bits/stl_algobase.h>
#include <bits/stl_alloc.h>
#include <bits/stl_construct.h>
-#include <bits/stl_iterator_base.h> //for iterator_traits
+#include <bits/stl_iterator_base_types.h> //for iterator_traits
#include <bits/stl_tempbuf.h>
#include <bits/stl_uninitialized.h>
#include <bits/stl_raw_storage_iter.h>
-__STL_BEGIN_NAMESPACE
+namespace std
+{
-#if defined(__SGI_STL_USE_AUTO_PTR_CONVERSIONS) && \
- defined(__STL_MEMBER_TEMPLATES)
-
template<class _Tp1> struct auto_ptr_ref {
_Tp1* _M_ptr;
auto_ptr_ref(_Tp1* __p) : _M_ptr(__p) {}
};
-#endif
-
template <class _Tp> class auto_ptr {
private:
_Tp* _M_ptr;
@@ -45,23 +72,19 @@ public:
explicit auto_ptr(_Tp* __p = 0) __STL_NOTHROW : _M_ptr(__p) {}
auto_ptr(auto_ptr& __a) __STL_NOTHROW : _M_ptr(__a.release()) {}
-#ifdef __STL_MEMBER_TEMPLATES
template <class _Tp1> auto_ptr(auto_ptr<_Tp1>& __a) __STL_NOTHROW
: _M_ptr(__a.release()) {}
-#endif /* __STL_MEMBER_TEMPLATES */
auto_ptr& operator=(auto_ptr& __a) __STL_NOTHROW {
reset(__a.release());
return *this;
}
-#ifdef __STL_MEMBER_TEMPLATES
template <class _Tp1>
auto_ptr& operator=(auto_ptr<_Tp1>& __a) __STL_NOTHROW {
reset(__a.release());
return *this;
}
-#endif /* __STL_MEMBER_TEMPLATES */
// Note: The C++ standard says there is supposed to be an empty throw
// specification here, but omitting it is standard conforming. Its
@@ -94,10 +117,6 @@ public:
// present-day compilers, however, do not enforce that requirement---and,
// in fact, most present-day compilers do not support the language
// features that these conversions rely on.
-
-#if defined(__SGI_STL_USE_AUTO_PTR_CONVERSIONS) && \
- defined(__STL_MEMBER_TEMPLATES)
-
public:
auto_ptr(auto_ptr_ref<_Tp> __ref) __STL_NOTHROW
: _M_ptr(__ref._M_ptr) {}
@@ -114,11 +133,9 @@ public:
{ return auto_ptr_ref<_Tp>(this->release()); }
template <class _Tp1> operator auto_ptr<_Tp1>() __STL_NOTHROW
{ return auto_ptr<_Tp1>(this->release()); }
-
-#endif /* auto ptr conversions && member templates */
};
-__STL_END_NAMESPACE
+} // namespace std
#endif /* _CPP_MEMORY */
diff --git a/libstdc++-v3/include/bits/std_numeric.h b/libstdc++-v3/include/bits/std_numeric.h
index e9cd42de828..88304156cee 100644
--- a/libstdc++-v3/include/bits/std_numeric.h
+++ b/libstdc++-v3/include/bits/std_numeric.h
@@ -1,3 +1,32 @@
+// <numeric> -*- C++ -*-
+
+// Copyright (C) 2001 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.
+
/*
*
* Copyright (c) 1994
@@ -27,7 +56,8 @@
#ifndef _CPP_NUMERIC
#define _CPP_NUMERIC 1
-#include <bits/stl_config.h>
+#pragma GCC system_header
+#include <bits/c++config.h>
#include <bits/std_cstddef.h>
#include <bits/std_iterator.h>
#include <bits/stl_function.h>
diff --git a/libstdc++-v3/include/bits/std_ostream.h b/libstdc++-v3/include/bits/std_ostream.h
index eb63e93623a..e8efb3b249e 100644
--- a/libstdc++-v3/include/bits/std_ostream.h
+++ b/libstdc++-v3/include/bits/std_ostream.h
@@ -1,6 +1,6 @@
// Output streams -*- C++ -*-
-// Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc.
+// Copyright (C) 1997, 1998, 1999, 2000, 2001 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
@@ -34,10 +34,12 @@
#ifndef _CPP_OSTREAM
#define _CPP_OSTREAM 1
+#pragma GCC system_header
+
#include <bits/std_ios.h>
-namespace std {
-
+namespace std
+{
// 27.6.2.1 Template class basic_ostream
template<typename _CharT, typename _Traits>
class basic_ostream : virtual public basic_ios<_CharT, _Traits>
@@ -55,7 +57,7 @@ namespace std {
typedef basic_streambuf<_CharT, _Traits> __streambuf_type;
typedef basic_ios<_CharT, _Traits> __ios_type;
typedef basic_ostream<_CharT, _Traits> __ostream_type;
- typedef ostreambuf_iterator<_CharT> __ostreambuf_iter;
+ typedef ostreambuf_iterator<_CharT, _Traits> __ostreambuf_iter;
typedef num_put<_CharT, __ostreambuf_iter> __numput_type;
typedef ctype<_CharT> __ctype_type;
@@ -65,8 +67,7 @@ namespace std {
{ this->init(__sb); }
virtual
- ~basic_ostream()
- { _M_fnumput = NULL; }
+ ~basic_ostream() { }
// 27.6.2.3 Prefix/suffix:
class sentry;
@@ -262,7 +263,7 @@ namespace std {
template<typename _CharT, typename _Traits>
basic_ostream<_CharT, _Traits>&
ends(basic_ostream<_CharT, _Traits>& __os)
- { return __os.put(_Traits::_S_eos()); }
+ { return __os.put(_CharT()); }
template<typename _CharT, typename _Traits>
basic_ostream<_CharT, _Traits>&
@@ -280,9 +281,3 @@ namespace std {
#endif /* _CPP_OSTREAM */
-
-
-
-
-
-
diff --git a/libstdc++-v3/include/bits/std_queue.h b/libstdc++-v3/include/bits/std_queue.h
index 198b2c03508..88a7803539f 100644
--- a/libstdc++-v3/include/bits/std_queue.h
+++ b/libstdc++-v3/include/bits/std_queue.h
@@ -1,3 +1,32 @@
+// <queue> -*- C++ -*-
+
+// Copyright (C) 2001 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.
+
/*
*
* Copyright (c) 1994
@@ -27,12 +56,13 @@
#ifndef _CPP_QUEUE
#define _CPP_QUEUE 1
+#pragma GCC system_header
+#include <bits/c++config.h>
#include <bits/stl_algobase.h>
#include <bits/stl_alloc.h>
#include <bits/stl_construct.h>
#include <bits/stl_uninitialized.h>
#include <bits/stl_vector.h>
-#include <ext/stl_bvector.h>
#include <bits/stl_heap.h>
#include <bits/stl_deque.h>
#include <bits/stl_function.h>
diff --git a/libstdc++-v3/include/bits/std_set.h b/libstdc++-v3/include/bits/std_set.h
index 7a5f5c5b4ec..f60defc380c 100644
--- a/libstdc++-v3/include/bits/std_set.h
+++ b/libstdc++-v3/include/bits/std_set.h
@@ -1,3 +1,32 @@
+// <set> -*- C++ -*-
+
+// Copyright (C) 2001 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.
+
/*
*
* Copyright (c) 1994
@@ -27,6 +56,8 @@
#ifndef _CPP_SET
#define _CPP_SET 1
+#pragma GCC system_header
+
#ifndef _CPP_BITS_STL_TREE_H /* XXX is this guard needed? */
#include <bits/stl_tree.h>
#endif
diff --git a/libstdc++-v3/include/bits/std_sstream.h b/libstdc++-v3/include/bits/std_sstream.h
index f3207110d2d..8baeb06c493 100644
--- a/libstdc++-v3/include/bits/std_sstream.h
+++ b/libstdc++-v3/include/bits/std_sstream.h
@@ -34,11 +34,13 @@
#ifndef _CPP_SSTREAM
#define _CPP_SSTREAM 1
+#pragma GCC system_header
+
#include <bits/std_istream.h>
#include <bits/std_ostream.h>
-namespace std {
-
+namespace std
+{
template<typename _CharT, typename _Traits, typename _Alloc>
class basic_stringbuf : public basic_streambuf<_CharT, _Traits>
{
@@ -46,6 +48,10 @@ namespace std {
// Types:
typedef _CharT char_type;
typedef _Traits traits_type;
+#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
+// 251. basic_stringbuf missing allocator_type
+ typedef _Alloc allocator_type;
+#endif
typedef typename traits_type::int_type int_type;
typedef typename traits_type::pos_type pos_type;
typedef typename traits_type::off_type off_type;
@@ -69,18 +75,16 @@ namespace std {
explicit
basic_stringbuf(const __string_type& __str,
ios_base::openmode __mode = ios_base::in | ios_base::out)
- : __streambuf_type(), _M_string(__str)
+ : __streambuf_type(), _M_string(__str.data(), __str.size())
{ _M_stringbuf_init(__mode); }
// Get and set:
__string_type
str() const
{
- if (_M_mode & ios_base::in && !(_M_mode & ios_base::out))
- return _M_string;
- else
+ if (_M_mode & ios_base::out)
{
- // This is the deal: _M_string.size() is value that
+ // This is the deal: _M_string.size() is a value that
// represents the size of the intial string that makes
// _M_string, and may not be the correct size of the
// current stringbuf internal buffer.
@@ -89,6 +93,8 @@ namespace std {
__len = max(__size_type(_M_out_end - _M_out_beg), __len);
return __string_type(_M_out_beg, _M_out_beg + __len);
}
+ else
+ return _M_string;
}
void
@@ -110,7 +116,7 @@ namespace std {
// re-allocation of the internal string object, _M_string.
_M_buf_size = _M_string.size();
- // NB: Start ostringstream buffers at 1024 bytes. This is an
+ // NB: Start ostringstream buffers at 512 bytes. This is an
// experimental value (pronounced "arbitrary" in some of the
// hipper english-speaking countries), and can be changed to
// suite particular needs.
@@ -119,7 +125,7 @@ namespace std {
if (_M_mode & ios_base::ate)
_M_really_sync(0, _M_buf_size);
else
- _M_really_sync(0, 0);
+ _M_really_sync(0, 0);
}
// Overridden virtual functions:
@@ -141,7 +147,7 @@ namespace std {
virtual __streambuf_type*
setbuf(char_type* __s, streamsize __n)
{
- if (__n)
+ if (__s && __n)
{
_M_string = __string_type(__s, __n);
_M_really_sync(0, 0);
@@ -192,6 +198,10 @@ namespace std {
// Types:
typedef _CharT char_type;
typedef _Traits traits_type;
+#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
+// 251. basic_stringbuf missing allocator_type
+ typedef _Alloc allocator_type;
+#endif
typedef typename traits_type::int_type int_type;
typedef typename traits_type::pos_type pos_type;
typedef typename traits_type::off_type off_type;
@@ -201,37 +211,37 @@ namespace std {
typedef basic_stringbuf<_CharT, _Traits, _Alloc> __stringbuf_type;
typedef basic_istream<char_type, traits_type> __istream_type;
+ private:
+ __stringbuf_type _M_stringbuf;
+
+ public:
// Constructors:
explicit
basic_istringstream(ios_base::openmode __mode = ios_base::in)
- : __istream_type(new __stringbuf_type(__mode | ios_base::in))
- { }
+ : __istream_type(NULL), _M_stringbuf(__mode | ios_base::in)
+ { this->init(&_M_stringbuf); }
explicit
basic_istringstream(const __string_type& __str,
ios_base::openmode __mode = ios_base::in)
- : __istream_type(new __stringbuf_type(__str, __mode | ios_base::in))
- { }
+ : __istream_type(NULL), _M_stringbuf(__str, __mode | ios_base::in)
+ { this->init(&_M_stringbuf); }
~basic_istringstream()
- {
- delete _M_streambuf;
- _M_streambuf = NULL;
- }
+ { }
// Members:
__stringbuf_type*
rdbuf() const
- { return static_cast<__stringbuf_type*>(_M_streambuf); }
+ { return const_cast<__stringbuf_type*>(&_M_stringbuf); }
__string_type
str() const
- { return this->rdbuf()->str(); }
+ { return _M_stringbuf.str(); }
void
str(const __string_type& __s)
- { rdbuf()->str(__s); }
-
+ { _M_stringbuf.str(__s); }
};
@@ -243,6 +253,10 @@ namespace std {
// Types:
typedef _CharT char_type;
typedef _Traits traits_type;
+#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
+// 251. basic_stringbuf missing allocator_type
+ typedef _Alloc allocator_type;
+#endif
typedef typename traits_type::int_type int_type;
typedef typename traits_type::pos_type pos_type;
typedef typename traits_type::off_type off_type;
@@ -252,37 +266,37 @@ namespace std {
typedef basic_stringbuf<_CharT, _Traits, _Alloc> __stringbuf_type;
typedef basic_ostream<char_type, traits_type> __ostream_type;
- // Constructors/destructor:
+ private:
+ __stringbuf_type _M_stringbuf;
+
+ public:
+ // Constructors/destructor:
explicit
basic_ostringstream(ios_base::openmode __mode = ios_base::out)
- : __ostream_type(new __stringbuf_type(__mode | ios_base::out))
- { }
+ : __ostream_type(NULL), _M_stringbuf(__mode | ios_base::out)
+ { this->init(&_M_stringbuf); }
explicit
basic_ostringstream(const __string_type __str,
ios_base::openmode __mode = ios_base::out)
- : __ostream_type(new __stringbuf_type(__str, __mode | ios_base::out))
- { }
+ : __ostream_type(NULL), _M_stringbuf(__str, __mode | ios_base::out)
+ { this->init(&_M_stringbuf); }
~basic_ostringstream()
- {
- delete _M_streambuf;
- _M_streambuf = NULL;
- }
+ { }
// Members:
__stringbuf_type*
rdbuf() const
- { return static_cast<__stringbuf_type*>(_M_streambuf); }
+ { return const_cast<__stringbuf_type*>(&_M_stringbuf); }
__string_type
str() const
- { return this->rdbuf()->str(); }
+ { return _M_stringbuf.str(); }
void
str(const __string_type& __s)
- { rdbuf()->str(__s); }
-
+ { _M_stringbuf.str(__s); }
};
@@ -294,6 +308,10 @@ namespace std {
// Types:
typedef _CharT char_type;
typedef _Traits traits_type;
+#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
+// 251. basic_stringbuf missing allocator_type
+ typedef _Alloc allocator_type;
+#endif
typedef typename traits_type::int_type int_type;
typedef typename traits_type::pos_type pos_type;
typedef typename traits_type::off_type off_type;
@@ -302,41 +320,39 @@ namespace std {
typedef basic_string<_CharT, _Traits, _Alloc> __string_type;
typedef basic_stringbuf<_CharT, _Traits, _Alloc> __stringbuf_type;
typedef basic_iostream<char_type, traits_type> __iostream_type;
-
+
+ private:
+ __stringbuf_type _M_stringbuf;
+
+ public:
// Constructors/destructors
explicit
- basic_stringstream(ios_base::openmode __mode =
- ios_base::out | ios_base::in)
- : __iostream_type(new __stringbuf_type(__mode))
- { }
+ basic_stringstream(ios_base::openmode __m = ios_base::out | ios_base::in)
+ : __iostream_type(NULL), _M_stringbuf(__m)
+ { this->init(&_M_stringbuf); }
explicit
basic_stringstream(const __string_type& __str,
- ios_base::openmode __mode =
- ios_base::out | ios_base::in)
- : __iostream_type(new __stringbuf_type(__str, __mode))
- { }
+ ios_base::openmode __m = ios_base::out | ios_base::in)
+ : __iostream_type(NULL), _M_stringbuf(__str, __m)
+ { this->init(&_M_stringbuf); }
~basic_stringstream()
- {
- delete _M_streambuf;
- _M_streambuf = NULL;
- }
+ { }
// Members:
__stringbuf_type*
rdbuf() const
- { return static_cast<__stringbuf_type*>(_M_streambuf); }
+ { return const_cast<__stringbuf_type*>(&_M_stringbuf); }
__string_type
str() const
- { return rdbuf()->str(); }
+ { return _M_stringbuf.str(); }
void
str(const __string_type& __s)
- { rdbuf()->str(__s); }
+ { _M_stringbuf.str(__s); }
};
-
} // namespace std
@@ -348,19 +364,4 @@ namespace std {
#endif
#endif
-
-#endif /* _CPP_SSTREAM */
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+#endif // _CPP_SSTREAM
diff --git a/libstdc++-v3/include/bits/std_stack.h b/libstdc++-v3/include/bits/std_stack.h
index 53e7e21f0ec..32b1971e5fa 100644
--- a/libstdc++-v3/include/bits/std_stack.h
+++ b/libstdc++-v3/include/bits/std_stack.h
@@ -1,3 +1,32 @@
+// <stack> -*- C++ -*-
+
+// Copyright (C) 2001 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.
+
/*
*
* Copyright (c) 1994
@@ -27,6 +56,8 @@
#ifndef _CPP_STACK
#define _CPP_STACK 1
+#pragma GCC system_header
+
#include <bits/stl_algobase.h>
#include <bits/stl_alloc.h>
#include <bits/stl_construct.h>
diff --git a/libstdc++-v3/include/bits/std_stdexcept.h b/libstdc++-v3/include/bits/std_stdexcept.h
index b9c5dccf74a..66bac5011be 100644
--- a/libstdc++-v3/include/bits/std_stdexcept.h
+++ b/libstdc++-v3/include/bits/std_stdexcept.h
@@ -31,80 +31,115 @@
// ISO C++ 19.1 Exception classes
//
+/** @file std_stdexcept.h
+ * The Standard C++ library provides classes to be used to report certain
+ * errors (17.4.4.8) in C++ programs. In the error model reflected in these
+ * classes, errors are divided into two broad categories: logic errors and
+ * runtime errors.
+ */
+
#ifndef _CPP_STDEXCEPT
#define _CPP_STDEXCEPT 1
+#pragma GCC system_header
+
#include <exception>
-#include <bits/stringfwd.h>
+#include <string>
namespace std
{
+ /** Logic errors represent problems in the internal logic of a program;
+ * in theory, these are preventable, and even detectable before the
+ * program runs (e.g., violations of class invariants).
+ * @brief One of two subclasses of exception.
+ */
class logic_error : public exception
{
- const string& _M_msg;
+ string _M_msg;
public:
+ /** Takes a character string describing the error. */
explicit
logic_error(const string& __arg);
virtual
~logic_error() throw();
+ /** Returns a C-style character string describing the general cause of
+ * the current error (the same string passed to the ctor). */
virtual const char*
what() const throw();
};
+ /** Thrown by the library, or by you, to report domain errors (domain in
+ * the mathmatical sense). */
class domain_error : public logic_error
{
public:
explicit domain_error(const string& __arg);
};
+ /** Thrown to report invalid arguments to functions. */
class invalid_argument : public logic_error
{
public:
explicit invalid_argument(const string& __arg);
};
+ /** Thrown when an object is constructed that would exceed its maximum
+ * permitted size (e.g., a basic_string instance). */
class length_error : public logic_error
{
public:
explicit length_error(const string& __arg);
};
+ /** This represents an argument whose value is not within the expected
+ * range (e.g., boundary checks in basic_string). */
class out_of_range : public logic_error
{
public:
explicit out_of_range(const string& __arg);
};
+ /** Runtime errors represent problems outside the scope of a program;
+ * they cannot be easily predicted and can generally only be caught as
+ * the program executes.
+ * @brief One of two subclasses of exception.
+ */
class runtime_error : public exception
{
- const string& _M_msg;
+ string _M_msg;
public:
+ /** Takes a character string describing the error. */
explicit
runtime_error(const string& __arg);
virtual
~runtime_error() throw();
+ /** Returns a C-style character string describing the general cause of
+ * the current error (the same string passed to the ctor). */
virtual const char*
what() const throw();
};
+ /** Thrown to indicate range errors in internal computations. */
class range_error : public runtime_error
{
public:
explicit range_error(const string& __arg);
};
+ /** Thrown to indicate arithmetic overflow. */
class overflow_error : public runtime_error
{
public:
explicit overflow_error(const string& __arg);
};
+ /** Thrown to indicate arithmetic underflow. */
class underflow_error : public runtime_error
{
public:
diff --git a/libstdc++-v3/include/bits/std_streambuf.h b/libstdc++-v3/include/bits/std_streambuf.h
index 2e3c6dc1d2b..8cc674d7039 100644
--- a/libstdc++-v3/include/bits/std_streambuf.h
+++ b/libstdc++-v3/include/bits/std_streambuf.h
@@ -34,14 +34,16 @@
#ifndef _CPP_STREAMBUF
#define _CPP_STREAMBUF 1
+#pragma GCC system_header
+
#include <bits/c++config.h>
#include <bits/std_iosfwd.h>
#include <bits/std_cstdio.h> // For SEEK_SET, SEEK_CUR, SEEK_END
#include <bits/localefwd.h>
#include <bits/ios_base.h>
-namespace std {
-
+namespace std
+{
template<typename _CharT, typename _Traits>
streamsize
__copy_streambufs(basic_ios<_CharT, _Traits>& _ios,
@@ -114,9 +116,6 @@ namespace std {
// True iff locale is initialized.
bool _M_buf_locale_init;
- // Cached use_facet<ctype>, which is based on the current locale info.
- const __ctype_type* _M_buf_fctype;
-
// Necessary bits for putback buffer management. Only used in
// the basic_filebuf class, as necessary for the standard
// requirements. The only basic_streambuf member function that
@@ -252,17 +251,20 @@ namespace std {
this->setg(_M_buf, _M_buf, _M_buf + __off);
if (__testout)
this->setp(_M_buf, _M_buf + __off);
-
}
bool
_M_is_indeterminate(void)
{
bool __ret = false;
- if (_M_mode & ios_base::in)
- __ret = _M_in_beg == _M_in_cur && _M_in_cur == _M_in_end;
- if (_M_mode & ios_base::out)
- __ret = _M_out_beg == _M_out_cur && _M_out_cur == _M_out_end;
+ // Don't return true if unbuffered.
+ if (_M_buf)
+ {
+ if (_M_mode & ios_base::in)
+ __ret = _M_in_beg == _M_in_cur && _M_in_cur == _M_in_end;
+ if (_M_mode & ios_base::out)
+ __ret = _M_out_beg == _M_out_cur && _M_out_cur == _M_out_end;
+ }
return __ret;
}
@@ -274,9 +276,7 @@ namespace std {
_M_buf_size = 0;
_M_buf_size_opt = 0;
_M_mode = ios_base::openmode(0);
- _M_buf_fctype = NULL;
_M_buf_locale_init = false;
-
}
// Locales:
@@ -352,7 +352,7 @@ namespace std {
{
int_type __ret;
if (_M_in_cur && _M_in_cur < _M_in_end)
- __ret = traits_type::to_int_type(*gptr());
+ __ret = traits_type::to_int_type(*(this->gptr()));
else
__ret = this->underflow();
return __ret;
@@ -385,7 +385,7 @@ namespace std {
_M_out_end(0), _M_mode(ios_base::openmode(0)), _M_buf_locale(locale()),
_M_buf_locale_init(false), _M_pback_size(1), _M_pback(NULL),
_M_pback_cur_save(NULL), _M_pback_end_save(NULL), _M_pback_init(false)
- { _M_buf_fctype = &use_facet<__ctype_type>(this->getloc()); }
+ { }
// Get area:
char_type*
@@ -439,10 +439,7 @@ namespace std {
{
_M_buf_locale_init = true;
if (_M_buf_locale != __loc)
- {
- _M_buf_locale = __loc;
- _M_buf_fctype = &use_facet<__ctype_type>(_M_buf_locale);
- }
+ _M_buf_locale = __loc;
}
// Buffer management and positioning:
@@ -535,13 +532,3 @@ namespace std {
#endif /* _CPP_STREAMBUF */
-
-
-
-
-
-
-
-
-
-
diff --git a/libstdc++-v3/include/bits/std_string.h b/libstdc++-v3/include/bits/std_string.h
index 0a2da3ae729..b781b43a64a 100644
--- a/libstdc++-v3/include/bits/std_string.h
+++ b/libstdc++-v3/include/bits/std_string.h
@@ -34,6 +34,8 @@
#ifndef _CPP_STRING
#define _CPP_STRING 1
+#pragma GCC system_header
+
#include <bits/c++config.h>
#include <bits/stringfwd.h>
#include <bits/char_traits.h>
@@ -50,15 +52,3 @@
#endif /* _CPP_STRING */
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/libstdc++-v3/include/bits/std_utility.h b/libstdc++-v3/include/bits/std_utility.h
index e10dae35b6a..505f5266af3 100644
--- a/libstdc++-v3/include/bits/std_utility.h
+++ b/libstdc++-v3/include/bits/std_utility.h
@@ -1,3 +1,32 @@
+// <utility> -*- C++ -*-
+
+// Copyright (C) 2001 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.
+
/*
*
* Copyright (c) 1994
@@ -27,7 +56,8 @@
#ifndef _CPP_UTILITY
#define _CPP_UTILITY 1
-#include <bits/stl_config.h>
+#pragma GCC system_header
+#include <bits/c++config.h>
#include <bits/stl_relops.h>
#include <bits/stl_pair.h>
diff --git a/libstdc++-v3/include/bits/std_valarray.h b/libstdc++-v3/include/bits/std_valarray.h
index 9b45cdf1884..a250dfd122e 100644
--- a/libstdc++-v3/include/bits/std_valarray.h
+++ b/libstdc++-v3/include/bits/std_valarray.h
@@ -1,6 +1,6 @@
// The template and inlines for the -*- C++ -*- valarray class.
-// Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc.
+// Copyright (C) 1997-1999, 2000, 2001 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,6 +32,8 @@
#ifndef _CPP_VALARRAY
#define _CPP_VALARRAY 1
+#pragma GCC system_header
+
#include <bits/c++config.h>
#include <bits/std_cstddef.h>
#include <bits/std_cmath.h>
@@ -40,8 +42,8 @@
#include <bits/std_functional.h>
#include <bits/std_algorithm.h>
-namespace std {
-
+namespace std
+{
template<class _Clos, typename _Tp> class _Expr;
template<typename _Tp1, typename _Tp2> class _ValArray;
@@ -80,13 +82,13 @@ namespace std {
template<class _Tp> class mask_array; // masked array
template<class _Tp> class indirect_array; // indirected array
-}
+} // namespace std
#include <bits/valarray_array.h>
#include <bits/valarray_meta.h>
-namespace std {
-
+namespace std
+{
template<class _Tp> class valarray
{
public:
@@ -118,7 +120,8 @@ namespace std {
operator= (const _Expr<_Dom,_Tp>&);
// _lib.valarray.access_ element access:
- _Tp operator[](size_t) const;
+ // XXX: LWG to be resolved.
+ const _Tp& operator[](size_t) const;
_Tp& operator[](size_t);
// _lib.valarray.sub_ subset operations:
_Expr<_SClos<_ValArray,_Tp>, _Tp> operator[](slice) const;
@@ -234,12 +237,12 @@ namespace std {
template<typename _Tp>
- inline _Tp
+ inline const _Tp&
valarray<_Tp>::operator[] (size_t __i) const
{ return _M_data[__i]; }
template<typename _Tp>
- _Tp&
+ inline _Tp&
valarray<_Tp>::operator[] (size_t __i)
{ return _M_data[__i]; }
@@ -252,8 +255,8 @@ namespace std {
#include <bits/mask_array.h>
#include <bits/indirect_array.h>
-namespace std {
-
+namespace std
+{
template<typename _Tp>
inline valarray<_Tp>::valarray () : _M_size (0), _M_data (0) {}
@@ -625,7 +628,8 @@ _DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT(>>, shift_right)
} // std::
-namespace std {
+namespace std
+{
#define _DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT(_Op, _Name) \
template<class _Tp> template<class _Dom> \
diff --git a/libstdc++-v3/include/bits/std_vector.h b/libstdc++-v3/include/bits/std_vector.h
index 08ac4bd69de..6177b740ae3 100644
--- a/libstdc++-v3/include/bits/std_vector.h
+++ b/libstdc++-v3/include/bits/std_vector.h
@@ -1,3 +1,32 @@
+// <vector> -*- C++ -*-
+
+// Copyright (C) 2001 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.
+
/*
*
* Copyright (c) 1994
@@ -27,13 +56,15 @@
#ifndef _CPP_VECTOR
#define _CPP_VECTOR 1
-#include <bits/stl_range_errors.h>
+#pragma GCC system_header
+
+#include <bits/functexcept.h>
#include <bits/stl_algobase.h>
#include <bits/stl_alloc.h>
#include <bits/stl_construct.h>
#include <bits/stl_uninitialized.h>
#include <bits/stl_vector.h>
-#include <ext/stl_bvector.h>
+#include <bits/stl_bvector.h>
#endif /* _CPP_VECTOR */
diff --git a/libstdc++-v3/include/bits/stl_algo.h b/libstdc++-v3/include/bits/stl_algo.h
index c432d3d3ebc..8498ca58fee 100644
--- a/libstdc++-v3/include/bits/stl_algo.h
+++ b/libstdc++-v3/include/bits/stl_algo.h
@@ -1,3 +1,32 @@
+// Algorithm implimentation -*- C++ -*-
+
+// Copyright (C) 2001 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.
+
/*
*
* Copyright (c) 1994
@@ -33,21 +62,18 @@
#include <bits/stl_heap.h>
-// See concept_checks.h for the concept-checking macros
-// __STL_REQUIRES, __STL_CONVERTIBLE, etc.
-
+// See concept_check.h for the __glibcpp_*_requires macros.
-__STL_BEGIN_NAMESPACE
-
-#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
-#pragma set woff 1209
-#endif
+namespace std
+{
// __median (an extension, not present in the C++ standard).
template <class _Tp>
-inline const _Tp& __median(const _Tp& __a, const _Tp& __b, const _Tp& __c) {
- __STL_REQUIRES(_Tp, _LessThanComparable);
+inline const _Tp& __median(const _Tp& __a, const _Tp& __b, const _Tp& __c)
+{
+ // concept requirements
+ __glibcpp_function_requires(_LessThanComparableConcept<_Tp>);
if (__a < __b)
if (__b < __c)
return __b;
@@ -65,8 +91,10 @@ inline const _Tp& __median(const _Tp& __a, const _Tp& __b, const _Tp& __c) {
template <class _Tp, class _Compare>
inline const _Tp&
-__median(const _Tp& __a, const _Tp& __b, const _Tp& __c, _Compare __comp) {
- __STL_BINARY_FUNCTION_CHECK(_Compare, bool, _Tp, _Tp);
+__median(const _Tp& __a, const _Tp& __b, const _Tp& __c, _Compare __comp)
+{
+ // concept requirements
+ __glibcpp_function_requires(_BinaryFunctionConcept<_Compare, bool, _Tp, _Tp>);
if (__comp(__a, __b))
if (__comp(__b, __c))
return __b;
@@ -84,8 +112,10 @@ __median(const _Tp& __a, const _Tp& __b, const _Tp& __c, _Compare __comp) {
// for_each. Apply a function to every element of a range.
template <class _InputIter, class _Function>
-_Function for_each(_InputIter __first, _InputIter __last, _Function __f) {
- __STL_REQUIRES(_InputIter, _InputIterator);
+_Function for_each(_InputIter __first, _InputIter __last, _Function __f)
+{
+ // concept requirements
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIter>);
for ( ; __first != __last; ++__first)
__f(*__first);
return __f;
@@ -113,8 +143,6 @@ inline _InputIter find_if(_InputIter __first, _InputIter __last,
return __first;
}
-#ifdef __STL_CLASS_PARTIAL_SPECIALIZATION
-
template <class _RandomAccessIter, class _Tp>
_RandomAccessIter find(_RandomAccessIter __first, _RandomAccessIter __last,
const _Tp& __val,
@@ -191,34 +219,37 @@ _RandomAccessIter find_if(_RandomAccessIter __first, _RandomAccessIter __last,
}
}
-#endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */
-
template <class _InputIter, class _Tp>
inline _InputIter find(_InputIter __first, _InputIter __last,
const _Tp& __val)
{
- __STL_REQUIRES(_InputIter, _InputIterator);
- __STL_REQUIRES_BINARY_OP(_OP_EQUAL, bool,
- typename iterator_traits<_InputIter>::value_type, _Tp);
- return find(__first, __last, __val, __ITERATOR_CATEGORY(__first));
+ // concept requirements
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIter>);
+ __glibcpp_function_requires(_EqualOpConcept<
+ typename iterator_traits<_InputIter>::value_type, _Tp>);
+ return find(__first, __last, __val, __iterator_category(__first));
}
template <class _InputIter, class _Predicate>
inline _InputIter find_if(_InputIter __first, _InputIter __last,
- _Predicate __pred) {
- __STL_REQUIRES(_InputIter, _InputIterator);
- __STL_UNARY_FUNCTION_CHECK(_Predicate, bool,
- typename iterator_traits<_InputIter>::value_type);
- return find_if(__first, __last, __pred, __ITERATOR_CATEGORY(__first));
+ _Predicate __pred)
+{
+ // concept requirements
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIter>);
+ __glibcpp_function_requires(_UnaryPredicateConcept<_Predicate,
+ typename iterator_traits<_InputIter>::value_type>);
+ return find_if(__first, __last, __pred, __iterator_category(__first));
}
// adjacent_find.
template <class _ForwardIter>
-_ForwardIter adjacent_find(_ForwardIter __first, _ForwardIter __last) {
- __STL_REQUIRES(_ForwardIter, _ForwardIterator);
- __STL_REQUIRES(typename iterator_traits<_ForwardIter>::value_type,
- _EqualityComparable);
+_ForwardIter adjacent_find(_ForwardIter __first, _ForwardIter __last)
+{
+ // concept requirements
+ __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>);
+ __glibcpp_function_requires(_EqualityComparableConcept<
+ typename iterator_traits<_ForwardIter>::value_type>);
if (__first == __last)
return __last;
_ForwardIter __next = __first;
@@ -232,11 +263,13 @@ _ForwardIter adjacent_find(_ForwardIter __first, _ForwardIter __last) {
template <class _ForwardIter, class _BinaryPredicate>
_ForwardIter adjacent_find(_ForwardIter __first, _ForwardIter __last,
- _BinaryPredicate __binary_pred) {
- __STL_REQUIRES(_ForwardIter, _ForwardIterator);
- __STL_BINARY_FUNCTION_CHECK(_BinaryPredicate, bool,
- typename iterator_traits<_ForwardIter>::value_type,
- typename iterator_traits<_ForwardIter>::value_type);
+ _BinaryPredicate __binary_pred)
+{
+ // concept requirements
+ __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>);
+ __glibcpp_function_requires(_BinaryPredicateConcept<_BinaryPredicate,
+ typename iterator_traits<_ForwardIter>::value_type,
+ typename iterator_traits<_ForwardIter>::value_type>);
if (__first == __last)
return __last;
_ForwardIter __next = __first;
@@ -256,11 +289,13 @@ _ForwardIter adjacent_find(_ForwardIter __first, _ForwardIter __last,
template <class _InputIter, class _Tp, class _Size>
void count(_InputIter __first, _InputIter __last, const _Tp& __value,
- _Size& __n) {
- __STL_REQUIRES(_InputIter, _InputIterator);
- __STL_REQUIRES(typename iterator_traits<_InputIter>::value_type,
- _EqualityComparable);
- __STL_REQUIRES(_Tp, _EqualityComparable);
+ _Size& __n)
+{
+ // concept requirements
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIter>);
+ __glibcpp_function_requires(_EqualityComparableConcept<
+ typename iterator_traits<_InputIter>::value_type >);
+ __glibcpp_function_requires(_EqualityComparableConcept<_Tp>);
for ( ; __first != __last; ++__first)
if (*__first == __value)
++__n;
@@ -268,24 +303,26 @@ void count(_InputIter __first, _InputIter __last, const _Tp& __value,
template <class _InputIter, class _Predicate, class _Size>
void count_if(_InputIter __first, _InputIter __last, _Predicate __pred,
- _Size& __n) {
- __STL_REQUIRES(_InputIter, _InputIterator);
- __STL_UNARY_FUNCTION_CHECK(_Predicate, bool,
- typename iterator_traits<_InputIter>::value_type);
+ _Size& __n)
+{
+ // concept requirements
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIter>);
+ __glibcpp_function_requires(_UnaryPredicateConcept<_Predicate,
+ typename iterator_traits<_InputIter>::value_type>);
for ( ; __first != __last; ++__first)
if (__pred(*__first))
++__n;
}
-#ifdef __STL_CLASS_PARTIAL_SPECIALIZATION
-
template <class _InputIter, class _Tp>
typename iterator_traits<_InputIter>::difference_type
-count(_InputIter __first, _InputIter __last, const _Tp& __value) {
- __STL_REQUIRES(_InputIter, _InputIterator);
- __STL_REQUIRES(typename iterator_traits<_InputIter>::value_type,
- _EqualityComparable);
- __STL_REQUIRES(_Tp, _EqualityComparable);
+count(_InputIter __first, _InputIter __last, const _Tp& __value)
+{
+ // concept requirements
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIter>);
+ __glibcpp_function_requires(_EqualityComparableConcept<
+ typename iterator_traits<_InputIter>::value_type >);
+ __glibcpp_function_requires(_EqualityComparableConcept<_Tp>);
typename iterator_traits<_InputIter>::difference_type __n = 0;
for ( ; __first != __last; ++__first)
if (*__first == __value)
@@ -295,10 +332,12 @@ count(_InputIter __first, _InputIter __last, const _Tp& __value) {
template <class _InputIter, class _Predicate>
typename iterator_traits<_InputIter>::difference_type
-count_if(_InputIter __first, _InputIter __last, _Predicate __pred) {
- __STL_REQUIRES(_InputIter, _InputIterator);
- __STL_UNARY_FUNCTION_CHECK(_Predicate, bool,
- typename iterator_traits<_InputIter>::value_type);
+count_if(_InputIter __first, _InputIter __last, _Predicate __pred)
+{
+ // concept requirements
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIter>);
+ __glibcpp_function_requires(_UnaryPredicateConcept<_Predicate,
+ typename iterator_traits<_InputIter>::value_type>);
typename iterator_traits<_InputIter>::difference_type __n = 0;
for ( ; __first != __last; ++__first)
if (__pred(*__first))
@@ -307,19 +346,18 @@ count_if(_InputIter __first, _InputIter __last, _Predicate __pred) {
}
-#endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */
-
// search.
template <class _ForwardIter1, class _ForwardIter2>
_ForwardIter1 search(_ForwardIter1 __first1, _ForwardIter1 __last1,
_ForwardIter2 __first2, _ForwardIter2 __last2)
{
- __STL_REQUIRES(_ForwardIter1, _ForwardIterator);
- __STL_REQUIRES(_ForwardIter2, _ForwardIterator);
- __STL_REQUIRES_BINARY_OP(_OP_EQUAL, bool,
- typename iterator_traits<_ForwardIter1>::value_type,
- typename iterator_traits<_ForwardIter2>::value_type);
+ // concept requirements
+ __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter1>);
+ __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter2>);
+ __glibcpp_function_requires(_EqualOpConcept<
+ typename iterator_traits<_ForwardIter1>::value_type,
+ typename iterator_traits<_ForwardIter2>::value_type>);
// Test for empty ranges
if (__first1 == __last1 || __first2 == __last2)
@@ -366,11 +404,12 @@ _ForwardIter1 search(_ForwardIter1 __first1, _ForwardIter1 __last1,
_ForwardIter2 __first2, _ForwardIter2 __last2,
_BinaryPred __predicate)
{
- __STL_REQUIRES(_ForwardIter1, _ForwardIterator);
- __STL_REQUIRES(_ForwardIter2, _ForwardIterator);
- __STL_BINARY_FUNCTION_CHECK(_BinaryPred, bool,
- typename iterator_traits<_ForwardIter1>::value_type,
- typename iterator_traits<_ForwardIter2>::value_type);
+ // concept requirements
+ __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter1>);
+ __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter2>);
+ __glibcpp_function_requires(_BinaryPredicateConcept<_BinaryPred,
+ typename iterator_traits<_ForwardIter1>::value_type,
+ typename iterator_traits<_ForwardIter2>::value_type>);
// Test for empty ranges
if (__first1 == __last1 || __first2 == __last2)
@@ -424,11 +463,13 @@ _ForwardIter1 search(_ForwardIter1 __first1, _ForwardIter1 __last1,
template <class _ForwardIter, class _Integer, class _Tp>
_ForwardIter search_n(_ForwardIter __first, _ForwardIter __last,
- _Integer __count, const _Tp& __val) {
- __STL_REQUIRES(_ForwardIter, _ForwardIterator);
- __STL_REQUIRES(typename iterator_traits<_ForwardIter>::value_type,
- _EqualityComparable);
- __STL_REQUIRES(_Tp, _EqualityComparable);
+ _Integer __count, const _Tp& __val)
+{
+ // concept requirements
+ __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>);
+ __glibcpp_function_requires(_EqualityComparableConcept<
+ typename iterator_traits<_ForwardIter>::value_type>);
+ __glibcpp_function_requires(_EqualityComparableConcept<_Tp>);
if (__count <= 0)
return __first;
@@ -454,10 +495,13 @@ _ForwardIter search_n(_ForwardIter __first, _ForwardIter __last,
template <class _ForwardIter, class _Integer, class _Tp, class _BinaryPred>
_ForwardIter search_n(_ForwardIter __first, _ForwardIter __last,
_Integer __count, const _Tp& __val,
- _BinaryPred __binary_pred) {
- __STL_REQUIRES(_ForwardIter, _ForwardIterator);
- __STL_BINARY_FUNCTION_CHECK(_BinaryPred, bool,
- typename iterator_traits<_ForwardIter>::value_type, _Tp);
+ _BinaryPred __binary_pred)
+{
+ // concept requirements
+ __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>);
+ __glibcpp_function_requires(_BinaryPredicateConcept<_BinaryPred,
+ typename iterator_traits<_ForwardIter>::value_type, _Tp>);
+
if (__count <= 0)
return __first;
else {
@@ -493,13 +537,18 @@ _ForwardIter search_n(_ForwardIter __first, _ForwardIter __last,
template <class _ForwardIter1, class _ForwardIter2>
_ForwardIter2 swap_ranges(_ForwardIter1 __first1, _ForwardIter1 __last1,
- _ForwardIter2 __first2) {
- __STL_REQUIRES(_ForwardIter1, _Mutable_ForwardIterator);
- __STL_REQUIRES(_ForwardIter2, _Mutable_ForwardIterator);
- __STL_CONVERTIBLE(typename iterator_traits<_ForwardIter1>::value_type,
- typename iterator_traits<_ForwardIter2>::value_type);
- __STL_CONVERTIBLE(typename iterator_traits<_ForwardIter2>::value_type,
- typename iterator_traits<_ForwardIter1>::value_type);
+ _ForwardIter2 __first2)
+{
+ // concept requirements
+ __glibcpp_function_requires(_Mutable_ForwardIteratorConcept<_ForwardIter1>);
+ __glibcpp_function_requires(_Mutable_ForwardIteratorConcept<_ForwardIter2>);
+ __glibcpp_function_requires(_ConvertibleConcept<
+ typename iterator_traits<_ForwardIter1>::value_type,
+ typename iterator_traits<_ForwardIter2>::value_type>);
+ __glibcpp_function_requires(_ConvertibleConcept<
+ typename iterator_traits<_ForwardIter2>::value_type,
+ typename iterator_traits<_ForwardIter1>::value_type>);
+
for ( ; __first1 != __last1; ++__first1, ++__first2)
iter_swap(__first1, __first2);
return __first2;
@@ -509,9 +558,15 @@ _ForwardIter2 swap_ranges(_ForwardIter1 __first1, _ForwardIter1 __last1,
template <class _InputIter, class _OutputIter, class _UnaryOperation>
_OutputIter transform(_InputIter __first, _InputIter __last,
- _OutputIter __result, _UnaryOperation __unary_op) {
- __STL_REQUIRES(_InputIter, _InputIterator);
- __STL_REQUIRES(_OutputIter, _OutputIterator);
+ _OutputIter __result, _UnaryOperation __unary_op)
+{
+ // concept requirements
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIter>);
+/* XXX
+ __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter,
+ // should be "the type returned by _UnaryOperation"
+ typename iterator_traits<_InputIter>::value_type>);
+*/
for ( ; __first != __last; ++__first, ++__result)
*__result = __unary_op(*__first);
@@ -522,10 +577,17 @@ template <class _InputIter1, class _InputIter2, class _OutputIter,
class _BinaryOperation>
_OutputIter transform(_InputIter1 __first1, _InputIter1 __last1,
_InputIter2 __first2, _OutputIter __result,
- _BinaryOperation __binary_op) {
- __STL_REQUIRES(_InputIter1, _InputIterator);
- __STL_REQUIRES(_InputIter2, _InputIterator);
- __STL_REQUIRES(_OutputIter, _OutputIterator);
+ _BinaryOperation __binary_op)
+{
+ // concept requirements
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIter1>);
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIter2>);
+/* XXX
+ __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter,
+ // should be "the type returned by _BinaryOperation"
+ typename iterator_traits<_InputIter1>::value_type>);
+*/
+
for ( ; __first1 != __last1; ++__first1, ++__first2, ++__result)
*__result = __binary_op(*__first1, *__first2);
return __result;
@@ -535,11 +597,15 @@ _OutputIter transform(_InputIter1 __first1, _InputIter1 __last1,
template <class _ForwardIter, class _Tp>
void replace(_ForwardIter __first, _ForwardIter __last,
- const _Tp& __old_value, const _Tp& __new_value) {
- __STL_REQUIRES(_ForwardIter, _Mutable_ForwardIterator);
- __STL_REQUIRES_BINARY_OP(_OP_EQUAL, bool,
- typename iterator_traits<_ForwardIter>::value_type, _Tp);
- __STL_CONVERTIBLE(_Tp, typename iterator_traits<_ForwardIter>::value_type);
+ const _Tp& __old_value, const _Tp& __new_value)
+{
+ // concept requirements
+ __glibcpp_function_requires(_Mutable_ForwardIteratorConcept<_ForwardIter>);
+ __glibcpp_function_requires(_EqualOpConcept<
+ typename iterator_traits<_ForwardIter>::value_type, _Tp>);
+ __glibcpp_function_requires(_ConvertibleConcept<_Tp,
+ typename iterator_traits<_ForwardIter>::value_type>);
+
for ( ; __first != __last; ++__first)
if (*__first == __old_value)
*__first = __new_value;
@@ -547,11 +613,15 @@ void replace(_ForwardIter __first, _ForwardIter __last,
template <class _ForwardIter, class _Predicate, class _Tp>
void replace_if(_ForwardIter __first, _ForwardIter __last,
- _Predicate __pred, const _Tp& __new_value) {
- __STL_REQUIRES(_ForwardIter, _Mutable_ForwardIterator);
- __STL_CONVERTIBLE(_Tp, typename iterator_traits<_ForwardIter>::value_type);
- __STL_UNARY_FUNCTION_CHECK(_Predicate, bool,
- typename iterator_traits<_ForwardIter>::value_type);
+ _Predicate __pred, const _Tp& __new_value)
+{
+ // concept requirements
+ __glibcpp_function_requires(_Mutable_ForwardIteratorConcept<_ForwardIter>);
+ __glibcpp_function_requires(_ConvertibleConcept<_Tp,
+ typename iterator_traits<_ForwardIter>::value_type>);
+ __glibcpp_function_requires(_UnaryPredicateConcept<_Predicate,
+ typename iterator_traits<_ForwardIter>::value_type>);
+
for ( ; __first != __last; ++__first)
if (__pred(*__first))
*__first = __new_value;
@@ -560,11 +630,15 @@ void replace_if(_ForwardIter __first, _ForwardIter __last,
template <class _InputIter, class _OutputIter, class _Tp>
_OutputIter replace_copy(_InputIter __first, _InputIter __last,
_OutputIter __result,
- const _Tp& __old_value, const _Tp& __new_value) {
- __STL_REQUIRES(_InputIter, _InputIterator);
- __STL_REQUIRES(_OutputIter, _OutputIterator);
- __STL_REQUIRES_BINARY_OP(_OP_EQUAL, bool,
- typename iterator_traits<_InputIter>::value_type, _Tp);
+ const _Tp& __old_value, const _Tp& __new_value)
+{
+ // concept requirements
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIter>);
+ __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter,
+ typename iterator_traits<_InputIter>::value_type>);
+ __glibcpp_function_requires(_EqualOpConcept<
+ typename iterator_traits<_InputIter>::value_type, _Tp>);
+
for ( ; __first != __last; ++__first, ++__result)
*__result = *__first == __old_value ? __new_value : *__first;
return __result;
@@ -573,11 +647,15 @@ _OutputIter replace_copy(_InputIter __first, _InputIter __last,
template <class _InputIter, class _OutputIter, class _Predicate, class _Tp>
_OutputIter replace_copy_if(_InputIter __first, _InputIter __last,
_OutputIter __result,
- _Predicate __pred, const _Tp& __new_value) {
- __STL_REQUIRES(_InputIter, _InputIterator);
- __STL_REQUIRES(_OutputIter, _OutputIterator);
- __STL_UNARY_FUNCTION_CHECK(_Predicate, bool,
- typename iterator_traits<_InputIter>::value_type);
+ _Predicate __pred, const _Tp& __new_value)
+{
+ // concept requirements
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIter>);
+ __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter,
+ typename iterator_traits<_InputIter>::value_type>);
+ __glibcpp_function_requires(_UnaryPredicateConcept<_Predicate,
+ typename iterator_traits<_InputIter>::value_type>);
+
for ( ; __first != __last; ++__first, ++__result)
*__result = __pred(*__first) ? __new_value : *__first;
return __result;
@@ -586,17 +664,26 @@ _OutputIter replace_copy_if(_InputIter __first, _InputIter __last,
// generate and generate_n
template <class _ForwardIter, class _Generator>
-void generate(_ForwardIter __first, _ForwardIter __last, _Generator __gen) {
- __STL_REQUIRES(_ForwardIter, _ForwardIterator);
- __STL_GENERATOR_CHECK(_Generator,
- typename iterator_traits<_ForwardIter>::value_type);
+void generate(_ForwardIter __first, _ForwardIter __last, _Generator __gen)
+{
+ // concept requirements
+ __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>);
+ __glibcpp_function_requires(_GeneratorConcept<_Generator,
+ typename iterator_traits<_ForwardIter>::value_type>);
+
for ( ; __first != __last; ++__first)
*__first = __gen();
}
template <class _OutputIter, class _Size, class _Generator>
-_OutputIter generate_n(_OutputIter __first, _Size __n, _Generator __gen) {
- __STL_REQUIRES(_OutputIter, _OutputIterator);
+_OutputIter generate_n(_OutputIter __first, _Size __n, _Generator __gen)
+{
+/*
+ // XXX concept requirements
+ __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter,
+ "the return type of _Generator" ?? >);
+*/
+
for ( ; __n > 0; --__n, ++__first)
*__first = __gen();
return __first;
@@ -606,11 +693,15 @@ _OutputIter generate_n(_OutputIter __first, _Size __n, _Generator __gen) {
template <class _InputIter, class _OutputIter, class _Tp>
_OutputIter remove_copy(_InputIter __first, _InputIter __last,
- _OutputIter __result, const _Tp& __value) {
- __STL_REQUIRES(_InputIter, _InputIterator);
- __STL_REQUIRES(_OutputIter, _OutputIterator);
- __STL_REQUIRES_BINARY_OP(_OP_EQUAL, bool,
- typename iterator_traits<_InputIter>::value_type, _Tp);
+ _OutputIter __result, const _Tp& __value)
+{
+ // concept requirements
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIter>);
+ __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter,
+ typename iterator_traits<_InputIter>::value_type>);
+ __glibcpp_function_requires(_EqualOpConcept<
+ typename iterator_traits<_InputIter>::value_type, _Tp>);
+
for ( ; __first != __last; ++__first)
if (!(*__first == __value)) {
*__result = *__first;
@@ -621,11 +712,15 @@ _OutputIter remove_copy(_InputIter __first, _InputIter __last,
template <class _InputIter, class _OutputIter, class _Predicate>
_OutputIter remove_copy_if(_InputIter __first, _InputIter __last,
- _OutputIter __result, _Predicate __pred) {
- __STL_REQUIRES(_InputIter, _InputIterator);
- __STL_REQUIRES(_OutputIter, _OutputIterator);
- __STL_UNARY_FUNCTION_CHECK(_Predicate, bool,
- typename iterator_traits<_InputIter>::value_type);
+ _OutputIter __result, _Predicate __pred)
+{
+ // concept requirements
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIter>);
+ __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter,
+ typename iterator_traits<_InputIter>::value_type>);
+ __glibcpp_function_requires(_UnaryPredicateConcept<_Predicate,
+ typename iterator_traits<_InputIter>::value_type>);
+
for ( ; __first != __last; ++__first)
if (!__pred(*__first)) {
*__result = *__first;
@@ -636,11 +731,15 @@ _OutputIter remove_copy_if(_InputIter __first, _InputIter __last,
template <class _ForwardIter, class _Tp>
_ForwardIter remove(_ForwardIter __first, _ForwardIter __last,
- const _Tp& __value) {
- __STL_REQUIRES(_ForwardIter, _Mutable_ForwardIterator);
- __STL_REQUIRES_BINARY_OP(_OP_EQUAL, bool,
- typename iterator_traits<_ForwardIter>::value_type, _Tp);
- __STL_CONVERTIBLE(_Tp, typename iterator_traits<_ForwardIter>::value_type);
+ const _Tp& __value)
+{
+ // concept requirements
+ __glibcpp_function_requires(_Mutable_ForwardIteratorConcept<_ForwardIter>);
+ __glibcpp_function_requires(_ConvertibleConcept<_Tp,
+ typename iterator_traits<_ForwardIter>::value_type>);
+ __glibcpp_function_requires(_EqualOpConcept<
+ typename iterator_traits<_ForwardIter>::value_type, _Tp>);
+
__first = find(__first, __last, __value);
_ForwardIter __i = __first;
return __first == __last ? __first
@@ -649,10 +748,13 @@ _ForwardIter remove(_ForwardIter __first, _ForwardIter __last,
template <class _ForwardIter, class _Predicate>
_ForwardIter remove_if(_ForwardIter __first, _ForwardIter __last,
- _Predicate __pred) {
- __STL_REQUIRES(_ForwardIter, _Mutable_ForwardIterator);
- __STL_UNARY_FUNCTION_CHECK(_Predicate, bool,
- typename iterator_traits<_ForwardIter>::value_type);
+ _Predicate __pred)
+{
+ // concept requirements
+ __glibcpp_function_requires(_Mutable_ForwardIteratorConcept<_ForwardIter>);
+ __glibcpp_function_requires(_UnaryPredicateConcept<_Predicate,
+ typename iterator_traits<_ForwardIter>::value_type>);
+
__first = find_if(__first, __last, __pred);
_ForwardIter __i = __first;
return __first == __last ? __first
@@ -663,7 +765,9 @@ _ForwardIter remove_if(_ForwardIter __first, _ForwardIter __last,
template <class _InputIter, class _OutputIter, class _Tp>
_OutputIter __unique_copy(_InputIter __first, _InputIter __last,
- _OutputIter __result, _Tp*) {
+ _OutputIter __result, _Tp*)
+{
+ // concept requirements -- taken care of in dispatching function
_Tp __value = *__first;
*__result = __value;
while (++__first != __last)
@@ -677,13 +781,17 @@ _OutputIter __unique_copy(_InputIter __first, _InputIter __last,
template <class _InputIter, class _OutputIter>
inline _OutputIter __unique_copy(_InputIter __first, _InputIter __last,
_OutputIter __result,
- output_iterator_tag) {
- return __unique_copy(__first, __last, __result, __VALUE_TYPE(__first));
+ output_iterator_tag)
+{
+ // concept requirements -- taken care of in dispatching function
+ return __unique_copy(__first, __last, __result, __value_type(__first));
}
template <class _InputIter, class _ForwardIter>
_ForwardIter __unique_copy(_InputIter __first, _InputIter __last,
- _ForwardIter __result, forward_iterator_tag) {
+ _ForwardIter __result, forward_iterator_tag)
+{
+ // concept requirements -- taken care of in dispatching function
*__result = *__first;
while (++__first != __last)
if (!(*__result == *__first))
@@ -693,22 +801,29 @@ _ForwardIter __unique_copy(_InputIter __first, _InputIter __last,
template <class _InputIter, class _OutputIter>
inline _OutputIter unique_copy(_InputIter __first, _InputIter __last,
- _OutputIter __result) {
- __STL_REQUIRES(_InputIter, _InputIterator);
- __STL_REQUIRES(_OutputIter, _OutputIterator);
- __STL_REQUIRES(typename iterator_traits<_InputIter>::value_type,
- _EqualityComparable);
+ _OutputIter __result)
+{
+ // concept requirements
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIter>);
+ __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter,
+ typename iterator_traits<_InputIter>::value_type>);
+ __glibcpp_function_requires(_EqualityComparableConcept<
+ typename iterator_traits<_InputIter>::value_type>);
+
if (__first == __last) return __result;
return __unique_copy(__first, __last, __result,
- __ITERATOR_CATEGORY(__result));
+ __iterator_category(__result));
}
template <class _InputIter, class _OutputIter, class _BinaryPredicate,
class _Tp>
_OutputIter __unique_copy(_InputIter __first, _InputIter __last,
_OutputIter __result,
- _BinaryPredicate __binary_pred, _Tp*) {
- __STL_BINARY_FUNCTION_CHECK(_BinaryPredicate, bool, _Tp, _Tp);
+ _BinaryPredicate __binary_pred, _Tp*)
+{
+ // concept requirements -- iterators already checked
+ __glibcpp_function_requires(_BinaryPredicateConcept<_BinaryPredicate, _Tp, _Tp>);
+
_Tp __value = *__first;
*__result = __value;
while (++__first != __last)
@@ -723,19 +838,24 @@ template <class _InputIter, class _OutputIter, class _BinaryPredicate>
inline _OutputIter __unique_copy(_InputIter __first, _InputIter __last,
_OutputIter __result,
_BinaryPredicate __binary_pred,
- output_iterator_tag) {
+ output_iterator_tag)
+{
+ // concept requirements -- taken care of in dispatching function
return __unique_copy(__first, __last, __result, __binary_pred,
- __VALUE_TYPE(__first));
+ __value_type(__first));
}
template <class _InputIter, class _ForwardIter, class _BinaryPredicate>
_ForwardIter __unique_copy(_InputIter __first, _InputIter __last,
_ForwardIter __result,
_BinaryPredicate __binary_pred,
- forward_iterator_tag) {
- __STL_BINARY_FUNCTION_CHECK(_BinaryPredicate, bool,
- typename iterator_traits<_ForwardIter>::value_type,
- typename iterator_traits<_InputIter>::value_type);
+ forward_iterator_tag)
+{
+ // concept requirements -- iterators already checked
+ __glibcpp_function_requires(_BinaryPredicateConcept<_BinaryPredicate,
+ typename iterator_traits<_ForwardIter>::value_type,
+ typename iterator_traits<_InputIter>::value_type>);
+
*__result = *__first;
while (++__first != __last)
if (!__binary_pred(*__result, *__first)) *++__result = *__first;
@@ -745,30 +865,40 @@ _ForwardIter __unique_copy(_InputIter __first, _InputIter __last,
template <class _InputIter, class _OutputIter, class _BinaryPredicate>
inline _OutputIter unique_copy(_InputIter __first, _InputIter __last,
_OutputIter __result,
- _BinaryPredicate __binary_pred) {
- __STL_REQUIRES(_InputIter, _InputIterator);
- __STL_REQUIRES(_OutputIter, _OutputIterator);
+ _BinaryPredicate __binary_pred)
+{
+ // concept requirements -- predicates checked later
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIter>);
+ __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter,
+ typename iterator_traits<_InputIter>::value_type>);
+
if (__first == __last) return __result;
return __unique_copy(__first, __last, __result, __binary_pred,
- __ITERATOR_CATEGORY(__result));
+ __iterator_category(__result));
}
template <class _ForwardIter>
-_ForwardIter unique(_ForwardIter __first, _ForwardIter __last) {
- __STL_REQUIRES(_ForwardIter, _Mutable_ForwardIterator);
- __STL_REQUIRES(typename iterator_traits<_ForwardIter>::value_type,
- _EqualityComparable);
+_ForwardIter unique(_ForwardIter __first, _ForwardIter __last)
+{
+ // concept requirements
+ __glibcpp_function_requires(_Mutable_ForwardIteratorConcept<_ForwardIter>);
+ __glibcpp_function_requires(_EqualityComparableConcept<
+ typename iterator_traits<_ForwardIter>::value_type>);
+
__first = adjacent_find(__first, __last);
return unique_copy(__first, __last, __first);
}
template <class _ForwardIter, class _BinaryPredicate>
_ForwardIter unique(_ForwardIter __first, _ForwardIter __last,
- _BinaryPredicate __binary_pred) {
- __STL_REQUIRES(_ForwardIter, _Mutable_ForwardIterator);
- __STL_BINARY_FUNCTION_CHECK(_BinaryPredicate, bool,
- typename iterator_traits<_ForwardIter>::value_type,
- typename iterator_traits<_ForwardIter>::value_type);
+ _BinaryPredicate __binary_pred)
+{
+ // concept requirements
+ __glibcpp_function_requires(_Mutable_ForwardIteratorConcept<_ForwardIter>);
+ __glibcpp_function_requires(_BinaryPredicateConcept<_BinaryPredicate,
+ typename iterator_traits<_ForwardIter>::value_type,
+ typename iterator_traits<_ForwardIter>::value_type>);
+
__first = adjacent_find(__first, __last, __binary_pred);
return unique_copy(__first, __last, __first, __binary_pred);
}
@@ -793,17 +923,24 @@ void __reverse(_RandomAccessIter __first, _RandomAccessIter __last,
}
template <class _BidirectionalIter>
-inline void reverse(_BidirectionalIter __first, _BidirectionalIter __last) {
- __STL_REQUIRES(_BidirectionalIter, _Mutable_BidirectionalIterator);
- __reverse(__first, __last, __ITERATOR_CATEGORY(__first));
+inline void reverse(_BidirectionalIter __first, _BidirectionalIter __last)
+{
+ // concept requirements
+ __glibcpp_function_requires(_Mutable_BidirectionalIteratorConcept<
+ _BidirectionalIter>);
+ __reverse(__first, __last, __iterator_category(__first));
}
template <class _BidirectionalIter, class _OutputIter>
_OutputIter reverse_copy(_BidirectionalIter __first,
_BidirectionalIter __last,
- _OutputIter __result) {
- __STL_REQUIRES(_BidirectionalIter, _BidirectionalIterator);
- __STL_REQUIRES(_OutputIter, _OutputIterator);
+ _OutputIter __result)
+{
+ // concept requirements
+ __glibcpp_function_requires(_BidirectionalIteratorConcept<_BidirectionalIter>);
+ __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter,
+ typename iterator_traits<_BidirectionalIter>::value_type>);
+
while (__first != __last) {
--__last;
*__result = *__last;
@@ -831,7 +968,8 @@ _ForwardIter __rotate(_ForwardIter __first,
_ForwardIter __middle,
_ForwardIter __last,
_Distance*,
- forward_iterator_tag) {
+ forward_iterator_tag)
+{
if (__first == __middle)
return __last;
if (__last == __middle)
@@ -865,8 +1003,12 @@ _BidirectionalIter __rotate(_BidirectionalIter __first,
_BidirectionalIter __middle,
_BidirectionalIter __last,
_Distance*,
- bidirectional_iterator_tag) {
- __STL_REQUIRES(_BidirectionalIter, _Mutable_BidirectionalIterator);
+ bidirectional_iterator_tag)
+{
+ // concept requirements
+ __glibcpp_function_requires(_Mutable_BidirectionalIteratorConcept<
+ _BidirectionalIter>);
+
if (__first == __middle)
return __last;
if (__last == __middle)
@@ -892,8 +1034,12 @@ template <class _RandomAccessIter, class _Distance, class _Tp>
_RandomAccessIter __rotate(_RandomAccessIter __first,
_RandomAccessIter __middle,
_RandomAccessIter __last,
- _Distance *, _Tp *) {
- __STL_REQUIRES(_RandomAccessIter, _Mutable_RandomAccessIterator);
+ _Distance *, _Tp *)
+{
+ // concept requirements
+ __glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept<
+ _RandomAccessIter>);
+
_Distance __n = __last - __first;
_Distance __k = __middle - __first;
_Distance __l = __n - __k;
@@ -946,31 +1092,37 @@ _RandomAccessIter __rotate(_RandomAccessIter __first,
template <class _ForwardIter>
inline _ForwardIter rotate(_ForwardIter __first, _ForwardIter __middle,
- _ForwardIter __last) {
- __STL_REQUIRES(_ForwardIter, _Mutable_ForwardIterator);
+ _ForwardIter __last)
+{
+ // concept requirements
+ __glibcpp_function_requires(_Mutable_ForwardIteratorConcept<_ForwardIter>);
+
return __rotate(__first, __middle, __last,
- __DISTANCE_TYPE(__first),
- __ITERATOR_CATEGORY(__first));
+ __distance_type(__first),
+ __iterator_category(__first));
}
template <class _ForwardIter, class _OutputIter>
_OutputIter rotate_copy(_ForwardIter __first, _ForwardIter __middle,
- _ForwardIter __last, _OutputIter __result) {
- __STL_REQUIRES(_ForwardIter, _ForwardIterator);
- __STL_REQUIRES(_OutputIter, _OutputIterator);
+ _ForwardIter __last, _OutputIter __result)
+{
+ // concept requirements
+ __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>);
+ __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter,
+ typename iterator_traits<_ForwardIter>::value_type>);
+
return copy(__first, __middle, copy(__middle, __last, __result));
}
// Return a random number in the range [0, __n). This function encapsulates
// whether we're using rand (part of the standard C library) or lrand48
// (not standard, but a much better choice whenever it's available).
-
template <class _Distance>
inline _Distance __random_number(_Distance __n) {
-#ifdef __STL_NO_DRAND48
- return rand() % __n;
-#else
+#ifdef _GLIBCPP_HAVE_DRAND48
return lrand48() % __n;
+#else
+ return rand() % __n;
#endif
}
@@ -978,8 +1130,12 @@ inline _Distance __random_number(_Distance __n) {
template <class _RandomAccessIter>
inline void random_shuffle(_RandomAccessIter __first,
- _RandomAccessIter __last) {
- __STL_REQUIRES(_RandomAccessIter, _Mutable_RandomAccessIterator);
+ _RandomAccessIter __last)
+{
+ // concept requirements
+ __glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept<
+ _RandomAccessIter>);
+
if (__first == __last) return;
for (_RandomAccessIter __i = __first + 1; __i != __last; ++__i)
iter_swap(__i, __first + __random_number((__i - __first) + 1));
@@ -987,8 +1143,12 @@ inline void random_shuffle(_RandomAccessIter __first,
template <class _RandomAccessIter, class _RandomNumberGenerator>
void random_shuffle(_RandomAccessIter __first, _RandomAccessIter __last,
- _RandomNumberGenerator& __rand) {
- __STL_REQUIRES(_RandomAccessIter, _Mutable_RandomAccessIterator);
+ _RandomNumberGenerator& __rand)
+{
+ // concept requirements
+ __glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept<
+ _RandomAccessIter>);
+
if (__first == __last) return;
for (_RandomAccessIter __i = __first + 1; __i != __last; ++__i)
iter_swap(__i, __first + __rand((__i - __first) + 1));
@@ -1000,8 +1160,11 @@ template <class _ForwardIter, class _OutputIter, class _Distance>
_OutputIter random_sample_n(_ForwardIter __first, _ForwardIter __last,
_OutputIter __out, const _Distance __n)
{
- __STL_REQUIRES(_ForwardIter, _ForwardIterator);
- __STL_REQUIRES(_OutputIter, _OutputIterator);
+ // concept requirements
+ __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>);
+ __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter,
+ typename iterator_traits<_ForwardIter>::value_type>);
+
_Distance __remaining = 0;
distance(__first, __last, __remaining);
_Distance __m = min(__n, __remaining);
@@ -1025,9 +1188,13 @@ _OutputIter random_sample_n(_ForwardIter __first, _ForwardIter __last,
_OutputIter __out, const _Distance __n,
_RandomNumberGenerator& __rand)
{
- __STL_REQUIRES(_ForwardIter, _ForwardIterator);
- __STL_REQUIRES(_OutputIter, _OutputIterator);
- __STL_UNARY_FUNCTION_CHECK(_RandomNumberGenerator, _Distance, _Distance);
+ // concept requirements
+ __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>);
+ __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter,
+ typename iterator_traits<_ForwardIter>::value_type>);
+ __glibcpp_function_requires(_UnaryFunctionConcept<
+ _RandomNumberGenerator, _Distance, _Distance>);
+
_Distance __remaining = 0;
distance(__first, __last, __remaining);
_Distance __m = min(__n, __remaining);
@@ -1073,7 +1240,10 @@ _RandomAccessIter __random_sample(_InputIter __first, _InputIter __last,
_RandomNumberGenerator& __rand,
const _Distance __n)
{
- __STL_UNARY_FUNCTION_CHECK(_RandomNumberGenerator, _Distance, _Distance);
+ // concept requirements
+ __glibcpp_function_requires(_UnaryFunctionConcept<
+ _RandomNumberGenerator, _Distance, _Distance>);
+
_Distance __m = 0;
_Distance __t = __n;
for ( ; __first != __last && __m < __n; ++__m, ++__first)
@@ -1095,8 +1265,11 @@ inline _RandomAccessIter
random_sample(_InputIter __first, _InputIter __last,
_RandomAccessIter __out_first, _RandomAccessIter __out_last)
{
- __STL_REQUIRES(_InputIter, _InputIterator);
- __STL_REQUIRES(_RandomAccessIter, _Mutable_RandomAccessIterator);
+ // concept requirements
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIter>);
+ __glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept<
+ _RandomAccessIter>);
+
return __random_sample(__first, __last,
__out_first, __out_last - __out_first);
}
@@ -1109,8 +1282,11 @@ random_sample(_InputIter __first, _InputIter __last,
_RandomAccessIter __out_first, _RandomAccessIter __out_last,
_RandomNumberGenerator& __rand)
{
- __STL_REQUIRES(_InputIter, _InputIterator);
- __STL_REQUIRES(_RandomAccessIter, _Mutable_RandomAccessIterator);
+ // concept requirements
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIter>);
+ __glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept<
+ _RandomAccessIter>);
+
return __random_sample(__first, __last,
__out_first, __rand,
__out_last - __out_first);
@@ -1122,7 +1298,8 @@ template <class _ForwardIter, class _Predicate>
_ForwardIter __partition(_ForwardIter __first,
_ForwardIter __last,
_Predicate __pred,
- forward_iterator_tag) {
+ forward_iterator_tag)
+{
if (__first == __last) return __first;
while (__pred(*__first))
@@ -1143,7 +1320,8 @@ template <class _BidirectionalIter, class _Predicate>
_BidirectionalIter __partition(_BidirectionalIter __first,
_BidirectionalIter __last,
_Predicate __pred,
- bidirectional_iterator_tag) {
+ bidirectional_iterator_tag)
+{
while (true) {
while (true)
if (__first == __last)
@@ -1168,18 +1346,22 @@ _BidirectionalIter __partition(_BidirectionalIter __first,
template <class _ForwardIter, class _Predicate>
inline _ForwardIter partition(_ForwardIter __first,
_ForwardIter __last,
- _Predicate __pred) {
- __STL_REQUIRES(_ForwardIter, _Mutable_ForwardIterator);
- __STL_UNARY_FUNCTION_CHECK(_Predicate, bool,
- typename iterator_traits<_ForwardIter>::value_type);
- return __partition(__first, __last, __pred, __ITERATOR_CATEGORY(__first));
+ _Predicate __pred)
+{
+ // concept requirements
+ __glibcpp_function_requires(_Mutable_ForwardIteratorConcept<_ForwardIter>);
+ __glibcpp_function_requires(_UnaryPredicateConcept<_Predicate,
+ typename iterator_traits<_ForwardIter>::value_type>);
+
+ return __partition(__first, __last, __pred, __iterator_category(__first));
}
template <class _ForwardIter, class _Predicate, class _Distance>
_ForwardIter __inplace_stable_partition(_ForwardIter __first,
_ForwardIter __last,
- _Predicate __pred, _Distance __len) {
+ _Predicate __pred, _Distance __len)
+{
if (__len == 1)
return __pred(*__first) ? __last : __first;
_ForwardIter __middle = __first;
@@ -1245,16 +1427,19 @@ __stable_partition_aux(_ForwardIter __first, _ForwardIter __last,
template <class _ForwardIter, class _Predicate>
inline _ForwardIter stable_partition(_ForwardIter __first,
_ForwardIter __last,
- _Predicate __pred) {
- __STL_REQUIRES(_ForwardIter, _Mutable_ForwardIterator);
- __STL_UNARY_FUNCTION_CHECK(_Predicate, bool,
- typename iterator_traits<_ForwardIter>::value_type);
+ _Predicate __pred)
+{
+ // concept requirements
+ __glibcpp_function_requires(_Mutable_ForwardIteratorConcept<_ForwardIter>);
+ __glibcpp_function_requires(_UnaryPredicateConcept<_Predicate,
+ typename iterator_traits<_ForwardIter>::value_type>);
+
if (__first == __last)
return __first;
else
return __stable_partition_aux(__first, __last, __pred,
- __VALUE_TYPE(__first),
- __DISTANCE_TYPE(__first));
+ __value_type(__first),
+ __distance_type(__first));
}
template <class _RandomAccessIter, class _Tp>
@@ -1298,7 +1483,8 @@ const int __stl_threshold = 16;
// sort() and its auxiliary functions.
template <class _RandomAccessIter, class _Tp>
-void __unguarded_linear_insert(_RandomAccessIter __last, _Tp __val) {
+void __unguarded_linear_insert(_RandomAccessIter __last, _Tp __val)
+{
_RandomAccessIter __next = __last;
--__next;
while (__val < *__next) {
@@ -1311,7 +1497,8 @@ void __unguarded_linear_insert(_RandomAccessIter __last, _Tp __val) {
template <class _RandomAccessIter, class _Tp, class _Compare>
void __unguarded_linear_insert(_RandomAccessIter __last, _Tp __val,
- _Compare __comp) {
+ _Compare __comp)
+{
_RandomAccessIter __next = __last;
--__next;
while (__comp(__val, *__next)) {
@@ -1324,7 +1511,8 @@ void __unguarded_linear_insert(_RandomAccessIter __last, _Tp __val,
template <class _RandomAccessIter, class _Tp>
inline void __linear_insert(_RandomAccessIter __first,
- _RandomAccessIter __last, _Tp*) {
+ _RandomAccessIter __last, _Tp*)
+{
_Tp __val = *__last;
if (__val < *__first) {
copy_backward(__first, __last, __last + 1);
@@ -1336,7 +1524,8 @@ inline void __linear_insert(_RandomAccessIter __first,
template <class _RandomAccessIter, class _Tp, class _Compare>
inline void __linear_insert(_RandomAccessIter __first,
- _RandomAccessIter __last, _Tp*, _Compare __comp) {
+ _RandomAccessIter __last, _Tp*, _Compare __comp)
+{
_Tp __val = *__last;
if (__comp(__val, *__first)) {
copy_backward(__first, __last, __last + 1);
@@ -1347,23 +1536,26 @@ inline void __linear_insert(_RandomAccessIter __first,
}
template <class _RandomAccessIter>
-void __insertion_sort(_RandomAccessIter __first, _RandomAccessIter __last) {
+void __insertion_sort(_RandomAccessIter __first, _RandomAccessIter __last)
+{
if (__first == __last) return;
for (_RandomAccessIter __i = __first + 1; __i != __last; ++__i)
- __linear_insert(__first, __i, __VALUE_TYPE(__first));
+ __linear_insert(__first, __i, __value_type(__first));
}
template <class _RandomAccessIter, class _Compare>
void __insertion_sort(_RandomAccessIter __first,
- _RandomAccessIter __last, _Compare __comp) {
+ _RandomAccessIter __last, _Compare __comp)
+{
if (__first == __last) return;
for (_RandomAccessIter __i = __first + 1; __i != __last; ++__i)
- __linear_insert(__first, __i, __VALUE_TYPE(__first), __comp);
+ __linear_insert(__first, __i, __value_type(__first), __comp);
}
template <class _RandomAccessIter, class _Tp>
void __unguarded_insertion_sort_aux(_RandomAccessIter __first,
- _RandomAccessIter __last, _Tp*) {
+ _RandomAccessIter __last, _Tp*)
+{
for (_RandomAccessIter __i = __first; __i != __last; ++__i)
__unguarded_linear_insert(__i, _Tp(*__i));
}
@@ -1371,13 +1563,14 @@ void __unguarded_insertion_sort_aux(_RandomAccessIter __first,
template <class _RandomAccessIter>
inline void __unguarded_insertion_sort(_RandomAccessIter __first,
_RandomAccessIter __last) {
- __unguarded_insertion_sort_aux(__first, __last, __VALUE_TYPE(__first));
+ __unguarded_insertion_sort_aux(__first, __last, __value_type(__first));
}
template <class _RandomAccessIter, class _Tp, class _Compare>
void __unguarded_insertion_sort_aux(_RandomAccessIter __first,
_RandomAccessIter __last,
- _Tp*, _Compare __comp) {
+ _Tp*, _Compare __comp)
+{
for (_RandomAccessIter __i = __first; __i != __last; ++__i)
__unguarded_linear_insert(__i, _Tp(*__i), __comp);
}
@@ -1385,14 +1578,16 @@ void __unguarded_insertion_sort_aux(_RandomAccessIter __first,
template <class _RandomAccessIter, class _Compare>
inline void __unguarded_insertion_sort(_RandomAccessIter __first,
_RandomAccessIter __last,
- _Compare __comp) {
- __unguarded_insertion_sort_aux(__first, __last, __VALUE_TYPE(__first),
+ _Compare __comp)
+{
+ __unguarded_insertion_sort_aux(__first, __last, __value_type(__first),
__comp);
}
template <class _RandomAccessIter>
void __final_insertion_sort(_RandomAccessIter __first,
- _RandomAccessIter __last) {
+ _RandomAccessIter __last)
+{
if (__last - __first > __stl_threshold) {
__insertion_sort(__first, __first + __stl_threshold);
__unguarded_insertion_sort(__first + __stl_threshold, __last);
@@ -1403,7 +1598,8 @@ void __final_insertion_sort(_RandomAccessIter __first,
template <class _RandomAccessIter, class _Compare>
void __final_insertion_sort(_RandomAccessIter __first,
- _RandomAccessIter __last, _Compare __comp) {
+ _RandomAccessIter __last, _Compare __comp)
+{
if (__last - __first > __stl_threshold) {
__insertion_sort(__first, __first + __stl_threshold, __comp);
__unguarded_insertion_sort(__first + __stl_threshold, __last, __comp);
@@ -1413,7 +1609,8 @@ void __final_insertion_sort(_RandomAccessIter __first,
}
template <class _Size>
-inline _Size __lg(_Size __n) {
+inline _Size __lg(_Size __n)
+{
_Size __k;
for (__k = 0; __n != 1; __n >>= 1) ++__k;
return __k;
@@ -1463,13 +1660,17 @@ void __introsort_loop(_RandomAccessIter __first,
}
template <class _RandomAccessIter>
-inline void sort(_RandomAccessIter __first, _RandomAccessIter __last) {
- __STL_REQUIRES(_RandomAccessIter, _Mutable_RandomAccessIterator);
- __STL_REQUIRES(typename iterator_traits<_RandomAccessIter>::value_type,
- _LessThanComparable);
+inline void sort(_RandomAccessIter __first, _RandomAccessIter __last)
+{
+ // concept requirements
+ __glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept<
+ _RandomAccessIter>);
+ __glibcpp_function_requires(_LessThanComparableConcept<
+ typename iterator_traits<_RandomAccessIter>::value_type>);
+
if (__first != __last) {
__introsort_loop(__first, __last,
- __VALUE_TYPE(__first),
+ __value_type(__first),
__lg(__last - __first) * 2);
__final_insertion_sort(__first, __last);
}
@@ -1477,14 +1678,18 @@ inline void sort(_RandomAccessIter __first, _RandomAccessIter __last) {
template <class _RandomAccessIter, class _Compare>
inline void sort(_RandomAccessIter __first, _RandomAccessIter __last,
- _Compare __comp) {
- __STL_REQUIRES(_RandomAccessIter, _Mutable_RandomAccessIterator);
- __STL_BINARY_FUNCTION_CHECK(_Compare, bool,
- typename iterator_traits<_RandomAccessIter>::value_type,
- typename iterator_traits<_RandomAccessIter>::value_type);
+ _Compare __comp)
+{
+ // concept requirements
+ __glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept<
+ _RandomAccessIter>);
+ __glibcpp_function_requires(_BinaryPredicateConcept<_Compare,
+ typename iterator_traits<_RandomAccessIter>::value_type,
+ typename iterator_traits<_RandomAccessIter>::value_type>);
+
if (__first != __last) {
__introsort_loop(__first, __last,
- __VALUE_TYPE(__first),
+ __value_type(__first),
__lg(__last - __first) * 2,
__comp);
__final_insertion_sort(__first, __last, __comp);
@@ -1495,7 +1700,8 @@ inline void sort(_RandomAccessIter __first, _RandomAccessIter __last,
template <class _RandomAccessIter>
void __inplace_stable_sort(_RandomAccessIter __first,
- _RandomAccessIter __last) {
+ _RandomAccessIter __last)
+{
if (__last - __first < 15) {
__insertion_sort(__first, __last);
return;
@@ -1510,7 +1716,8 @@ void __inplace_stable_sort(_RandomAccessIter __first,
template <class _RandomAccessIter, class _Compare>
void __inplace_stable_sort(_RandomAccessIter __first,
- _RandomAccessIter __last, _Compare __comp) {
+ _RandomAccessIter __last, _Compare __comp)
+{
if (__last - __first < 15) {
__insertion_sort(__first, __last, __comp);
return;
@@ -1528,7 +1735,8 @@ template <class _RandomAccessIter1, class _RandomAccessIter2,
class _Distance>
void __merge_sort_loop(_RandomAccessIter1 __first,
_RandomAccessIter1 __last,
- _RandomAccessIter2 __result, _Distance __step_size) {
+ _RandomAccessIter2 __result, _Distance __step_size)
+{
_Distance __two_step = 2 * __step_size;
while (__last - __first >= __two_step) {
@@ -1548,7 +1756,8 @@ template <class _RandomAccessIter1, class _RandomAccessIter2,
void __merge_sort_loop(_RandomAccessIter1 __first,
_RandomAccessIter1 __last,
_RandomAccessIter2 __result, _Distance __step_size,
- _Compare __comp) {
+ _Compare __comp)
+{
_Distance __two_step = 2 * __step_size;
while (__last - __first >= __two_step) {
@@ -1594,7 +1803,8 @@ void __chunk_insertion_sort(_RandomAccessIter __first,
template <class _RandomAccessIter, class _Pointer, class _Distance>
void __merge_sort_with_buffer(_RandomAccessIter __first,
_RandomAccessIter __last,
- _Pointer __buffer, _Distance*) {
+ _Pointer __buffer, _Distance*)
+{
_Distance __len = __last - __first;
_Pointer __buffer_last = __buffer + __len;
@@ -1613,7 +1823,8 @@ template <class _RandomAccessIter, class _Pointer, class _Distance,
class _Compare>
void __merge_sort_with_buffer(_RandomAccessIter __first,
_RandomAccessIter __last, _Pointer __buffer,
- _Distance*, _Compare __comp) {
+ _Distance*, _Compare __comp)
+{
_Distance __len = __last - __first;
_Pointer __buffer_last = __buffer + __len;
@@ -1631,7 +1842,8 @@ void __merge_sort_with_buffer(_RandomAccessIter __first,
template <class _RandomAccessIter, class _Pointer, class _Distance>
void __stable_sort_adaptive(_RandomAccessIter __first,
_RandomAccessIter __last, _Pointer __buffer,
- _Distance __buffer_size) {
+ _Distance __buffer_size)
+{
_Distance __len = (__last - __first + 1) / 2;
_RandomAccessIter __middle = __first + __len;
if (__len > __buffer_size) {
@@ -1650,7 +1862,8 @@ template <class _RandomAccessIter, class _Pointer, class _Distance,
class _Compare>
void __stable_sort_adaptive(_RandomAccessIter __first,
_RandomAccessIter __last, _Pointer __buffer,
- _Distance __buffer_size, _Compare __comp) {
+ _Distance __buffer_size, _Compare __comp)
+{
_Distance __len = (__last - __first + 1) / 2;
_RandomAccessIter __middle = __first + __len;
if (__len > __buffer_size) {
@@ -1672,7 +1885,8 @@ void __stable_sort_adaptive(_RandomAccessIter __first,
template <class _RandomAccessIter, class _Tp, class _Distance>
inline void __stable_sort_aux(_RandomAccessIter __first,
- _RandomAccessIter __last, _Tp*, _Distance*) {
+ _RandomAccessIter __last, _Tp*, _Distance*)
+{
_Temporary_buffer<_RandomAccessIter, _Tp> buf(__first, __last);
if (buf.begin() == 0)
__inplace_stable_sort(__first, __last);
@@ -1684,7 +1898,8 @@ inline void __stable_sort_aux(_RandomAccessIter __first,
template <class _RandomAccessIter, class _Tp, class _Distance, class _Compare>
inline void __stable_sort_aux(_RandomAccessIter __first,
_RandomAccessIter __last, _Tp*, _Distance*,
- _Compare __comp) {
+ _Compare __comp)
+{
_Temporary_buffer<_RandomAccessIter, _Tp> buf(__first, __last);
if (buf.begin() == 0)
__inplace_stable_sort(__first, __last, __comp);
@@ -1696,25 +1911,33 @@ inline void __stable_sort_aux(_RandomAccessIter __first,
template <class _RandomAccessIter>
inline void stable_sort(_RandomAccessIter __first,
- _RandomAccessIter __last) {
- __STL_REQUIRES(_RandomAccessIter, _Mutable_RandomAccessIterator);
- __STL_REQUIRES(typename iterator_traits<_RandomAccessIter>::value_type,
- _LessThanComparable);
+ _RandomAccessIter __last)
+{
+ // concept requirements
+ __glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept<
+ _RandomAccessIter>);
+ __glibcpp_function_requires(_LessThanComparableConcept<
+ typename iterator_traits<_RandomAccessIter>::value_type>);
+
__stable_sort_aux(__first, __last,
- __VALUE_TYPE(__first),
- __DISTANCE_TYPE(__first));
+ __value_type(__first),
+ __distance_type(__first));
}
template <class _RandomAccessIter, class _Compare>
inline void stable_sort(_RandomAccessIter __first,
- _RandomAccessIter __last, _Compare __comp) {
- __STL_REQUIRES(_RandomAccessIter, _Mutable_RandomAccessIterator);
- __STL_BINARY_FUNCTION_CHECK(_Compare, bool,
- typename iterator_traits<_RandomAccessIter>::value_type,
- typename iterator_traits<_RandomAccessIter>::value_type);
+ _RandomAccessIter __last, _Compare __comp)
+{
+ // concept requirements
+ __glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept<
+ _RandomAccessIter>);
+ __glibcpp_function_requires(_BinaryPredicateConcept<_Compare,
+ typename iterator_traits<_RandomAccessIter>::value_type,
+ typename iterator_traits<_RandomAccessIter>::value_type>);
+
__stable_sort_aux(__first, __last,
- __VALUE_TYPE(__first),
- __DISTANCE_TYPE(__first),
+ __value_type(__first),
+ __distance_type(__first),
__comp);
}
@@ -1722,45 +1945,55 @@ inline void stable_sort(_RandomAccessIter __first,
template <class _RandomAccessIter, class _Tp>
void __partial_sort(_RandomAccessIter __first, _RandomAccessIter __middle,
- _RandomAccessIter __last, _Tp*) {
+ _RandomAccessIter __last, _Tp*)
+{
make_heap(__first, __middle);
for (_RandomAccessIter __i = __middle; __i < __last; ++__i)
if (*__i < *__first)
__pop_heap(__first, __middle, __i, _Tp(*__i),
- __DISTANCE_TYPE(__first));
+ __distance_type(__first));
sort_heap(__first, __middle);
}
template <class _RandomAccessIter>
inline void partial_sort(_RandomAccessIter __first,
_RandomAccessIter __middle,
- _RandomAccessIter __last) {
- __STL_REQUIRES(_RandomAccessIter, _Mutable_RandomAccessIterator);
- __STL_REQUIRES(typename iterator_traits<_RandomAccessIter>::value_type,
- _LessThanComparable);
- __partial_sort(__first, __middle, __last, __VALUE_TYPE(__first));
+ _RandomAccessIter __last)
+{
+ // concept requirements
+ __glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept<
+ _RandomAccessIter>);
+ __glibcpp_function_requires(_LessThanComparableConcept<
+ typename iterator_traits<_RandomAccessIter>::value_type>);
+
+ __partial_sort(__first, __middle, __last, __value_type(__first));
}
template <class _RandomAccessIter, class _Tp, class _Compare>
void __partial_sort(_RandomAccessIter __first, _RandomAccessIter __middle,
- _RandomAccessIter __last, _Tp*, _Compare __comp) {
+ _RandomAccessIter __last, _Tp*, _Compare __comp)
+{
make_heap(__first, __middle, __comp);
for (_RandomAccessIter __i = __middle; __i < __last; ++__i)
if (__comp(*__i, *__first))
__pop_heap(__first, __middle, __i, _Tp(*__i), __comp,
- __DISTANCE_TYPE(__first));
+ __distance_type(__first));
sort_heap(__first, __middle, __comp);
}
template <class _RandomAccessIter, class _Compare>
inline void partial_sort(_RandomAccessIter __first,
_RandomAccessIter __middle,
- _RandomAccessIter __last, _Compare __comp) {
- __STL_REQUIRES(_RandomAccessIter, _Mutable_RandomAccessIterator);
- __STL_BINARY_FUNCTION_CHECK(_Compare, bool,
- typename iterator_traits<_RandomAccessIter>::value_type,
- typename iterator_traits<_RandomAccessIter>::value_type);
- __partial_sort(__first, __middle, __last, __VALUE_TYPE(__first), __comp);
+ _RandomAccessIter __last, _Compare __comp)
+{
+ // concept requirements
+ __glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept<
+ _RandomAccessIter>);
+ __glibcpp_function_requires(_BinaryPredicateConcept<_Compare,
+ typename iterator_traits<_RandomAccessIter>::value_type,
+ typename iterator_traits<_RandomAccessIter>::value_type>);
+
+ __partial_sort(__first, __middle, __last, __value_type(__first), __comp);
}
template <class _InputIter, class _RandomAccessIter, class _Distance,
@@ -1769,7 +2002,8 @@ _RandomAccessIter __partial_sort_copy(_InputIter __first,
_InputIter __last,
_RandomAccessIter __result_first,
_RandomAccessIter __result_last,
- _Distance*, _Tp*) {
+ _Distance*, _Tp*)
+{
if (__result_first == __result_last) return __result_last;
_RandomAccessIter __result_real_last = __result_first;
while(__first != __last && __result_real_last != __result_last) {
@@ -1793,18 +2027,21 @@ template <class _InputIter, class _RandomAccessIter>
inline _RandomAccessIter
partial_sort_copy(_InputIter __first, _InputIter __last,
_RandomAccessIter __result_first,
- _RandomAccessIter __result_last) {
- __STL_REQUIRES(_InputIter, _InputIterator);
- __STL_REQUIRES(_RandomAccessIter, _Mutable_RandomAccessIterator);
- __STL_CONVERTIBLE(typename iterator_traits<_InputIter>::value_type,
- typename iterator_traits<_RandomAccessIter>::value_type);
- __STL_REQUIRES(typename iterator_traits<_RandomAccessIter>::value_type,
- _LessThanComparable);
- __STL_REQUIRES(typename iterator_traits<_InputIter>::value_type,
- _LessThanComparable);
+ _RandomAccessIter __result_last)
+{
+ // concept requirements
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIter>);
+ __glibcpp_function_requires(_ConvertibleConcept<
+ typename iterator_traits<_InputIter>::value_type,
+ typename iterator_traits<_RandomAccessIter>::value_type>);
+ __glibcpp_function_requires(_LessThanComparableConcept<
+ typename iterator_traits<_RandomAccessIter>::value_type>);
+ __glibcpp_function_requires(_LessThanComparableConcept<
+ typename iterator_traits<_InputIter>::value_type>);
+
return __partial_sort_copy(__first, __last, __result_first, __result_last,
- __DISTANCE_TYPE(__result_first),
- __VALUE_TYPE(__first));
+ __distance_type(__result_first),
+ __value_type(__first));
}
template <class _InputIter, class _RandomAccessIter, class _Compare,
@@ -1813,7 +2050,8 @@ _RandomAccessIter __partial_sort_copy(_InputIter __first,
_InputIter __last,
_RandomAccessIter __result_first,
_RandomAccessIter __result_last,
- _Compare __comp, _Distance*, _Tp*) {
+ _Compare __comp, _Distance*, _Tp*)
+{
if (__result_first == __result_last) return __result_last;
_RandomAccessIter __result_real_last = __result_first;
while(__first != __last && __result_real_last != __result_last) {
@@ -1838,25 +2076,31 @@ template <class _InputIter, class _RandomAccessIter, class _Compare>
inline _RandomAccessIter
partial_sort_copy(_InputIter __first, _InputIter __last,
_RandomAccessIter __result_first,
- _RandomAccessIter __result_last, _Compare __comp) {
- __STL_REQUIRES(_InputIter, _InputIterator);
- __STL_REQUIRES(_RandomAccessIter, _Mutable_RandomAccessIterator);
- __STL_CONVERTIBLE(typename iterator_traits<_InputIter>::value_type,
- typename iterator_traits<_RandomAccessIter>::value_type);
- __STL_BINARY_FUNCTION_CHECK(_Compare, bool,
- typename iterator_traits<_RandomAccessIter>::value_type,
- typename iterator_traits<_RandomAccessIter>::value_type);
+ _RandomAccessIter __result_last, _Compare __comp)
+{
+ // concept requirements
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIter>);
+ __glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept<
+ _RandomAccessIter>);
+ __glibcpp_function_requires(_ConvertibleConcept<
+ typename iterator_traits<_InputIter>::value_type,
+ typename iterator_traits<_RandomAccessIter>::value_type>);
+ __glibcpp_function_requires(_BinaryPredicateConcept<_Compare,
+ typename iterator_traits<_RandomAccessIter>::value_type,
+ typename iterator_traits<_RandomAccessIter>::value_type>);
+
return __partial_sort_copy(__first, __last, __result_first, __result_last,
__comp,
- __DISTANCE_TYPE(__result_first),
- __VALUE_TYPE(__first));
+ __distance_type(__result_first),
+ __value_type(__first));
}
// nth_element() and its auxiliary functions.
template <class _RandomAccessIter, class _Tp>
void __nth_element(_RandomAccessIter __first, _RandomAccessIter __nth,
- _RandomAccessIter __last, _Tp*) {
+ _RandomAccessIter __last, _Tp*)
+{
while (__last - __first > 3) {
_RandomAccessIter __cut =
__unguarded_partition(__first, __last,
@@ -1873,16 +2117,21 @@ void __nth_element(_RandomAccessIter __first, _RandomAccessIter __nth,
template <class _RandomAccessIter>
inline void nth_element(_RandomAccessIter __first, _RandomAccessIter __nth,
- _RandomAccessIter __last) {
- __STL_REQUIRES(_RandomAccessIter, _Mutable_RandomAccessIterator);
- __STL_REQUIRES(typename iterator_traits<_RandomAccessIter>::value_type,
- _LessThanComparable);
- __nth_element(__first, __nth, __last, __VALUE_TYPE(__first));
+ _RandomAccessIter __last)
+{
+ // concept requirements
+ __glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept<
+ _RandomAccessIter>);
+ __glibcpp_function_requires(_LessThanComparableConcept<
+ typename iterator_traits<_RandomAccessIter>::value_type>);
+
+ __nth_element(__first, __nth, __last, __value_type(__first));
}
template <class _RandomAccessIter, class _Tp, class _Compare>
void __nth_element(_RandomAccessIter __first, _RandomAccessIter __nth,
- _RandomAccessIter __last, _Tp*, _Compare __comp) {
+ _RandomAccessIter __last, _Tp*, _Compare __comp)
+{
while (__last - __first > 3) {
_RandomAccessIter __cut =
__unguarded_partition(__first, __last,
@@ -1901,12 +2150,16 @@ void __nth_element(_RandomAccessIter __first, _RandomAccessIter __nth,
template <class _RandomAccessIter, class _Compare>
inline void nth_element(_RandomAccessIter __first, _RandomAccessIter __nth,
- _RandomAccessIter __last, _Compare __comp) {
- __STL_REQUIRES(_RandomAccessIter, _Mutable_RandomAccessIterator);
- __STL_BINARY_FUNCTION_CHECK(_Compare, bool,
- typename iterator_traits<_RandomAccessIter>::value_type,
- typename iterator_traits<_RandomAccessIter>::value_type);
- __nth_element(__first, __nth, __last, __VALUE_TYPE(__first), __comp);
+ _RandomAccessIter __last, _Compare __comp)
+{
+ // concept requirements
+ __glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept<
+ _RandomAccessIter>);
+ __glibcpp_function_requires(_BinaryPredicateConcept<_Compare,
+ typename iterator_traits<_RandomAccessIter>::value_type,
+ typename iterator_traits<_RandomAccessIter>::value_type>);
+
+ __nth_element(__first, __nth, __last, __value_type(__first), __comp);
}
@@ -1938,13 +2191,16 @@ _ForwardIter __lower_bound(_ForwardIter __first, _ForwardIter __last,
template <class _ForwardIter, class _Tp>
inline _ForwardIter lower_bound(_ForwardIter __first, _ForwardIter __last,
- const _Tp& __val) {
- __STL_REQUIRES(_ForwardIter, _ForwardIterator);
- __STL_REQUIRES_SAME_TYPE(_Tp,
- typename iterator_traits<_ForwardIter>::value_type);
- __STL_REQUIRES(_Tp, _LessThanComparable);
+ const _Tp& __val)
+{
+ // concept requirements
+ __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>);
+ __glibcpp_function_requires(_SameTypeConcept<_Tp,
+ typename iterator_traits<_ForwardIter>::value_type>);
+ __glibcpp_function_requires(_LessThanComparableConcept<_Tp>);
+
return __lower_bound(__first, __last, __val,
- __DISTANCE_TYPE(__first));
+ __distance_type(__first));
}
template <class _ForwardIter, class _Tp, class _Compare, class _Distance>
@@ -1973,13 +2229,16 @@ _ForwardIter __lower_bound(_ForwardIter __first, _ForwardIter __last,
template <class _ForwardIter, class _Tp, class _Compare>
inline _ForwardIter lower_bound(_ForwardIter __first, _ForwardIter __last,
- const _Tp& __val, _Compare __comp) {
- __STL_REQUIRES(_ForwardIter, _ForwardIterator);
- __STL_REQUIRES_SAME_TYPE(_Tp,
- typename iterator_traits<_ForwardIter>::value_type);
- __STL_BINARY_FUNCTION_CHECK(_Compare, bool, _Tp, _Tp);
+ const _Tp& __val, _Compare __comp)
+{
+ // concept requirements
+ __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>);
+ __glibcpp_function_requires(_SameTypeConcept<_Tp,
+ typename iterator_traits<_ForwardIter>::value_type>);
+ __glibcpp_function_requires(_BinaryPredicateConcept<_Compare, _Tp, _Tp>);
+
return __lower_bound(__first, __last, __val, __comp,
- __DISTANCE_TYPE(__first));
+ __distance_type(__first));
}
template <class _ForwardIter, class _Tp, class _Distance>
@@ -2008,13 +2267,16 @@ _ForwardIter __upper_bound(_ForwardIter __first, _ForwardIter __last,
template <class _ForwardIter, class _Tp>
inline _ForwardIter upper_bound(_ForwardIter __first, _ForwardIter __last,
- const _Tp& __val) {
- __STL_REQUIRES(_ForwardIter, _ForwardIterator);
- __STL_REQUIRES_SAME_TYPE(_Tp,
- typename iterator_traits<_ForwardIter>::value_type);
- __STL_REQUIRES(_Tp, _LessThanComparable);
+ const _Tp& __val)
+{
+ // concept requirements
+ __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>);
+ __glibcpp_function_requires(_SameTypeConcept<_Tp,
+ typename iterator_traits<_ForwardIter>::value_type>);
+ __glibcpp_function_requires(_LessThanComparableConcept<_Tp>);
+
return __upper_bound(__first, __last, __val,
- __DISTANCE_TYPE(__first));
+ __distance_type(__first));
}
template <class _ForwardIter, class _Tp, class _Compare, class _Distance>
@@ -2043,13 +2305,16 @@ _ForwardIter __upper_bound(_ForwardIter __first, _ForwardIter __last,
template <class _ForwardIter, class _Tp, class _Compare>
inline _ForwardIter upper_bound(_ForwardIter __first, _ForwardIter __last,
- const _Tp& __val, _Compare __comp) {
- __STL_REQUIRES(_ForwardIter, _ForwardIterator);
- __STL_REQUIRES_SAME_TYPE(_Tp,
- typename iterator_traits<_ForwardIter>::value_type);
- __STL_BINARY_FUNCTION_CHECK(_Compare, bool, _Tp, _Tp);
+ const _Tp& __val, _Compare __comp)
+{
+ // concept requirements
+ __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>);
+ __glibcpp_function_requires(_SameTypeConcept<_Tp,
+ typename iterator_traits<_ForwardIter>::value_type>);
+ __glibcpp_function_requires(_BinaryPredicateConcept<_Compare, _Tp, _Tp>);
+
return __upper_bound(__first, __last, __val, __comp,
- __DISTANCE_TYPE(__first));
+ __distance_type(__first));
}
template <class _ForwardIter, class _Tp, class _Distance>
@@ -2085,13 +2350,16 @@ __equal_range(_ForwardIter __first, _ForwardIter __last, const _Tp& __val,
template <class _ForwardIter, class _Tp>
inline pair<_ForwardIter, _ForwardIter>
-equal_range(_ForwardIter __first, _ForwardIter __last, const _Tp& __val) {
- __STL_REQUIRES(_ForwardIter, _ForwardIterator);
- __STL_REQUIRES_SAME_TYPE(_Tp,
- typename iterator_traits<_ForwardIter>::value_type);
- __STL_REQUIRES(_Tp, _LessThanComparable);
+equal_range(_ForwardIter __first, _ForwardIter __last, const _Tp& __val)
+{
+ // concept requirements
+ __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>);
+ __glibcpp_function_requires(_SameTypeConcept<_Tp,
+ typename iterator_traits<_ForwardIter>::value_type>);
+ __glibcpp_function_requires(_LessThanComparableConcept<_Tp>);
+
return __equal_range(__first, __last, __val,
- __DISTANCE_TYPE(__first));
+ __distance_type(__first));
}
template <class _ForwardIter, class _Tp, class _Compare, class _Distance>
@@ -2128,22 +2396,28 @@ __equal_range(_ForwardIter __first, _ForwardIter __last, const _Tp& __val,
template <class _ForwardIter, class _Tp, class _Compare>
inline pair<_ForwardIter, _ForwardIter>
equal_range(_ForwardIter __first, _ForwardIter __last, const _Tp& __val,
- _Compare __comp) {
- __STL_REQUIRES(_ForwardIter, _ForwardIterator);
- __STL_REQUIRES_SAME_TYPE(_Tp,
- typename iterator_traits<_ForwardIter>::value_type);
- __STL_BINARY_FUNCTION_CHECK(_Compare, bool, _Tp, _Tp);
+ _Compare __comp)
+{
+ // concept requirements
+ __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>);
+ __glibcpp_function_requires(_SameTypeConcept<_Tp,
+ typename iterator_traits<_ForwardIter>::value_type>);
+ __glibcpp_function_requires(_BinaryPredicateConcept<_Compare, _Tp, _Tp>);
+
return __equal_range(__first, __last, __val, __comp,
- __DISTANCE_TYPE(__first));
+ __distance_type(__first));
}
template <class _ForwardIter, class _Tp>
bool binary_search(_ForwardIter __first, _ForwardIter __last,
- const _Tp& __val) {
- __STL_REQUIRES(_ForwardIter, _ForwardIterator);
- __STL_REQUIRES_SAME_TYPE(_Tp,
- typename iterator_traits<_ForwardIter>::value_type);
- __STL_REQUIRES(_Tp, _LessThanComparable);
+ const _Tp& __val)
+{
+ // concept requirements
+ __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>);
+ __glibcpp_function_requires(_SameTypeConcept<_Tp,
+ typename iterator_traits<_ForwardIter>::value_type>);
+ __glibcpp_function_requires(_LessThanComparableConcept<_Tp>);
+
_ForwardIter __i = lower_bound(__first, __last, __val);
return __i != __last && !(__val < *__i);
}
@@ -2151,11 +2425,14 @@ bool binary_search(_ForwardIter __first, _ForwardIter __last,
template <class _ForwardIter, class _Tp, class _Compare>
bool binary_search(_ForwardIter __first, _ForwardIter __last,
const _Tp& __val,
- _Compare __comp) {
- __STL_REQUIRES(_ForwardIter, _ForwardIterator);
- __STL_REQUIRES_SAME_TYPE(_Tp,
- typename iterator_traits<_ForwardIter>::value_type);
- __STL_BINARY_FUNCTION_CHECK(_Compare, bool, _Tp, _Tp);
+ _Compare __comp)
+{
+ // concept requirements
+ __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>);
+ __glibcpp_function_requires(_SameTypeConcept<_Tp,
+ typename iterator_traits<_ForwardIter>::value_type>);
+ __glibcpp_function_requires(_BinaryPredicateConcept<_Compare, _Tp, _Tp>);
+
_ForwardIter __i = lower_bound(__first, __last, __val, __comp);
return __i != __last && !__comp(__val, *__i);
}
@@ -2165,15 +2442,19 @@ bool binary_search(_ForwardIter __first, _ForwardIter __last,
template <class _InputIter1, class _InputIter2, class _OutputIter>
_OutputIter merge(_InputIter1 __first1, _InputIter1 __last1,
_InputIter2 __first2, _InputIter2 __last2,
- _OutputIter __result) {
- __STL_REQUIRES(_InputIter1, _InputIterator);
- __STL_REQUIRES(_InputIter2, _InputIterator);
- __STL_REQUIRES(_OutputIter, _OutputIterator);
- __STL_REQUIRES_SAME_TYPE(
- typename iterator_traits<_InputIter1>::value_type,
- typename iterator_traits<_InputIter2>::value_type);
- __STL_REQUIRES(typename iterator_traits<_InputIter1>::value_type,
- _LessThanComparable);
+ _OutputIter __result)
+{
+ // concept requirements
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIter1>);
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIter2>);
+ __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter,
+ typename iterator_traits<_InputIter1>::value_type>);
+ __glibcpp_function_requires(_SameTypeConcept<
+ typename iterator_traits<_InputIter1>::value_type,
+ typename iterator_traits<_InputIter2>::value_type>);
+ __glibcpp_function_requires(_LessThanComparableConcept<
+ typename iterator_traits<_InputIter1>::value_type>);
+
while (__first1 != __last1 && __first2 != __last2) {
if (*__first2 < *__first1) {
*__result = *__first2;
@@ -2192,16 +2473,20 @@ template <class _InputIter1, class _InputIter2, class _OutputIter,
class _Compare>
_OutputIter merge(_InputIter1 __first1, _InputIter1 __last1,
_InputIter2 __first2, _InputIter2 __last2,
- _OutputIter __result, _Compare __comp) {
- __STL_REQUIRES(_InputIter1, _InputIterator);
- __STL_REQUIRES(_InputIter2, _InputIterator);
- __STL_REQUIRES_SAME_TYPE(
- typename iterator_traits<_InputIter1>::value_type,
- typename iterator_traits<_InputIter2>::value_type);
- __STL_REQUIRES(_OutputIter, _OutputIterator);
- __STL_BINARY_FUNCTION_CHECK(_Compare, bool,
- typename iterator_traits<_InputIter1>::value_type,
- typename iterator_traits<_InputIter1>::value_type);
+ _OutputIter __result, _Compare __comp)
+{
+ // concept requirements
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIter1>);
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIter2>);
+ __glibcpp_function_requires(_SameTypeConcept<
+ typename iterator_traits<_InputIter1>::value_type,
+ typename iterator_traits<_InputIter2>::value_type>);
+ __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter,
+ typename iterator_traits<_InputIter1>::value_type>);
+ __glibcpp_function_requires(_BinaryPredicateConcept<_Compare,
+ typename iterator_traits<_InputIter1>::value_type,
+ typename iterator_traits<_InputIter2>::value_type>);
+
while (__first1 != __last1 && __first2 != __last2) {
if (__comp(*__first2, *__first1)) {
*__result = *__first2;
@@ -2222,7 +2507,8 @@ template <class _BidirectionalIter, class _Distance>
void __merge_without_buffer(_BidirectionalIter __first,
_BidirectionalIter __middle,
_BidirectionalIter __last,
- _Distance __len1, _Distance __len2) {
+ _Distance __len1, _Distance __len2)
+{
if (__len1 == 0 || __len2 == 0)
return;
if (__len1 + __len2 == 2) {
@@ -2259,7 +2545,8 @@ void __merge_without_buffer(_BidirectionalIter __first,
_BidirectionalIter __middle,
_BidirectionalIter __last,
_Distance __len1, _Distance __len2,
- _Compare __comp) {
+ _Compare __comp)
+{
if (__len1 == 0 || __len2 == 0)
return;
if (__len1 + __len2 == 2) {
@@ -2298,7 +2585,8 @@ _BidirectionalIter1 __rotate_adaptive(_BidirectionalIter1 __first,
_BidirectionalIter1 __last,
_Distance __len1, _Distance __len2,
_BidirectionalIter2 __buffer,
- _Distance __buffer_size) {
+ _Distance __buffer_size)
+{
_BidirectionalIter2 __buffer_end;
if (__len1 > __len2 && __len2 <= __buffer_size) {
__buffer_end = copy(__middle, __last, __buffer);
@@ -2320,7 +2608,8 @@ _BidirectionalIter3 __merge_backward(_BidirectionalIter1 __first1,
_BidirectionalIter1 __last1,
_BidirectionalIter2 __first2,
_BidirectionalIter2 __last2,
- _BidirectionalIter3 __result) {
+ _BidirectionalIter3 __result)
+{
if (__first1 == __last1)
return copy_backward(__first2, __last2, __result);
if (__first2 == __last2)
@@ -2350,7 +2639,8 @@ _BidirectionalIter3 __merge_backward(_BidirectionalIter1 __first1,
_BidirectionalIter2 __first2,
_BidirectionalIter2 __last2,
_BidirectionalIter3 __result,
- _Compare __comp) {
+ _Compare __comp)
+{
if (__first1 == __last1)
return copy_backward(__first2, __last2, __result);
if (__first2 == __last2)
@@ -2378,7 +2668,8 @@ void __merge_adaptive(_BidirectionalIter __first,
_BidirectionalIter __middle,
_BidirectionalIter __last,
_Distance __len1, _Distance __len2,
- _Pointer __buffer, _Distance __buffer_size) {
+ _Pointer __buffer, _Distance __buffer_size)
+{
if (__len1 <= __len2 && __len1 <= __buffer_size) {
_Pointer __buffer_end = copy(__first, __middle, __buffer);
merge(__buffer, __buffer_end, __middle, __last, __first);
@@ -2421,7 +2712,8 @@ void __merge_adaptive(_BidirectionalIter __first,
_BidirectionalIter __last,
_Distance __len1, _Distance __len2,
_Pointer __buffer, _Distance __buffer_size,
- _Compare __comp) {
+ _Compare __comp)
+{
if (__len1 <= __len2 && __len1 <= __buffer_size) {
_Pointer __buffer_end = copy(__first, __middle, __buffer);
merge(__buffer, __buffer_end, __middle, __last, __first, __comp);
@@ -2461,7 +2753,8 @@ void __merge_adaptive(_BidirectionalIter __first,
template <class _BidirectionalIter, class _Tp, class _Distance>
inline void __inplace_merge_aux(_BidirectionalIter __first,
_BidirectionalIter __middle,
- _BidirectionalIter __last, _Tp*, _Distance*) {
+ _BidirectionalIter __last, _Tp*, _Distance*)
+{
_Distance __len1 = 0;
distance(__first, __middle, __len1);
_Distance __len2 = 0;
@@ -2480,7 +2773,8 @@ template <class _BidirectionalIter, class _Tp,
inline void __inplace_merge_aux(_BidirectionalIter __first,
_BidirectionalIter __middle,
_BidirectionalIter __last, _Tp*, _Distance*,
- _Compare __comp) {
+ _Compare __comp)
+{
_Distance __len1 = 0;
distance(__first, __middle, __len1);
_Distance __len2 = 0;
@@ -2498,28 +2792,36 @@ inline void __inplace_merge_aux(_BidirectionalIter __first,
template <class _BidirectionalIter>
inline void inplace_merge(_BidirectionalIter __first,
_BidirectionalIter __middle,
- _BidirectionalIter __last) {
- __STL_REQUIRES(_BidirectionalIter, _Mutable_BidirectionalIterator);
- __STL_REQUIRES(typename iterator_traits<_BidirectionalIter>::value_type,
- _LessThanComparable);
+ _BidirectionalIter __last)
+{
+ // concept requirements
+ __glibcpp_function_requires(_Mutable_BidirectionalIteratorConcept<
+ _BidirectionalIter>);
+ __glibcpp_function_requires(_LessThanComparableConcept<
+ typename iterator_traits<_BidirectionalIter>::value_type>);
+
if (__first == __middle || __middle == __last)
return;
__inplace_merge_aux(__first, __middle, __last,
- __VALUE_TYPE(__first), __DISTANCE_TYPE(__first));
+ __value_type(__first), __distance_type(__first));
}
template <class _BidirectionalIter, class _Compare>
inline void inplace_merge(_BidirectionalIter __first,
_BidirectionalIter __middle,
- _BidirectionalIter __last, _Compare __comp) {
- __STL_REQUIRES(_BidirectionalIter, _Mutable_BidirectionalIterator);
- __STL_BINARY_FUNCTION_CHECK(_Compare, bool,
- typename iterator_traits<_BidirectionalIter>::value_type,
- typename iterator_traits<_BidirectionalIter>::value_type);
+ _BidirectionalIter __last, _Compare __comp)
+{
+ // concept requirements
+ __glibcpp_function_requires(_Mutable_BidirectionalIteratorConcept<
+ _BidirectionalIter>);
+ __glibcpp_function_requires(_BinaryPredicateConcept<_Compare,
+ typename iterator_traits<_BidirectionalIter>::value_type,
+ typename iterator_traits<_BidirectionalIter>::value_type>);
+
if (__first == __middle || __middle == __last)
return;
__inplace_merge_aux(__first, __middle, __last,
- __VALUE_TYPE(__first), __DISTANCE_TYPE(__first),
+ __value_type(__first), __distance_type(__first),
__comp);
}
@@ -2530,14 +2832,17 @@ inline void inplace_merge(_BidirectionalIter __first,
template <class _InputIter1, class _InputIter2>
bool includes(_InputIter1 __first1, _InputIter1 __last1,
- _InputIter2 __first2, _InputIter2 __last2) {
- __STL_REQUIRES(_InputIter1, _InputIterator);
- __STL_REQUIRES(_InputIter2, _InputIterator);
- __STL_REQUIRES_SAME_TYPE(
- typename iterator_traits<_InputIter1>::value_type,
- typename iterator_traits<_InputIter2>::value_type);
- __STL_REQUIRES(typename iterator_traits<_InputIter1>::value_type,
- _LessThanComparable);
+ _InputIter2 __first2, _InputIter2 __last2)
+{
+ // concept requirements
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIter1>);
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIter2>);
+ __glibcpp_function_requires(_SameTypeConcept<
+ typename iterator_traits<_InputIter1>::value_type,
+ typename iterator_traits<_InputIter2>::value_type>);
+ __glibcpp_function_requires(_LessThanComparableConcept<
+ typename iterator_traits<_InputIter1>::value_type>);
+
while (__first1 != __last1 && __first2 != __last2)
if (*__first2 < *__first1)
return false;
@@ -2551,15 +2856,18 @@ bool includes(_InputIter1 __first1, _InputIter1 __last1,
template <class _InputIter1, class _InputIter2, class _Compare>
bool includes(_InputIter1 __first1, _InputIter1 __last1,
- _InputIter2 __first2, _InputIter2 __last2, _Compare __comp) {
- __STL_REQUIRES(_InputIter1, _InputIterator);
- __STL_REQUIRES(_InputIter2, _InputIterator);
- __STL_REQUIRES_SAME_TYPE(
- typename iterator_traits<_InputIter1>::value_type,
- typename iterator_traits<_InputIter2>::value_type);
- __STL_BINARY_FUNCTION_CHECK(_Compare, bool,
- typename iterator_traits<_InputIter1>::value_type,
- typename iterator_traits<_InputIter2>::value_type);
+ _InputIter2 __first2, _InputIter2 __last2, _Compare __comp)
+{
+ // concept requirements
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIter1>);
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIter2>);
+ __glibcpp_function_requires(_SameTypeConcept<
+ typename iterator_traits<_InputIter1>::value_type,
+ typename iterator_traits<_InputIter2>::value_type>);
+ __glibcpp_function_requires(_BinaryPredicateConcept<_Compare,
+ typename iterator_traits<_InputIter1>::value_type,
+ typename iterator_traits<_InputIter2>::value_type>);
+
while (__first1 != __last1 && __first2 != __last2)
if (__comp(*__first2, *__first1))
return false;
@@ -2574,15 +2882,19 @@ bool includes(_InputIter1 __first1, _InputIter1 __last1,
template <class _InputIter1, class _InputIter2, class _OutputIter>
_OutputIter set_union(_InputIter1 __first1, _InputIter1 __last1,
_InputIter2 __first2, _InputIter2 __last2,
- _OutputIter __result) {
- __STL_REQUIRES(_InputIter1, _InputIterator);
- __STL_REQUIRES(_InputIter2, _InputIterator);
- __STL_REQUIRES(_OutputIter, _OutputIterator);
- __STL_REQUIRES_SAME_TYPE(
- typename iterator_traits<_InputIter1>::value_type,
- typename iterator_traits<_InputIter2>::value_type);
- __STL_REQUIRES(typename iterator_traits<_InputIter1>::value_type,
- _LessThanComparable);
+ _OutputIter __result)
+{
+ // concept requirements
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIter1>);
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIter2>);
+ __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter,
+ typename iterator_traits<_InputIter1>::value_type>);
+ __glibcpp_function_requires(_SameTypeConcept<
+ typename iterator_traits<_InputIter1>::value_type,
+ typename iterator_traits<_InputIter2>::value_type>);
+ __glibcpp_function_requires(_LessThanComparableConcept<
+ typename iterator_traits<_InputIter1>::value_type>);
+
while (__first1 != __last1 && __first2 != __last2) {
if (*__first1 < *__first2) {
*__result = *__first1;
@@ -2606,16 +2918,20 @@ template <class _InputIter1, class _InputIter2, class _OutputIter,
class _Compare>
_OutputIter set_union(_InputIter1 __first1, _InputIter1 __last1,
_InputIter2 __first2, _InputIter2 __last2,
- _OutputIter __result, _Compare __comp) {
- __STL_REQUIRES(_InputIter1, _InputIterator);
- __STL_REQUIRES(_InputIter2, _InputIterator);
- __STL_REQUIRES(_OutputIter, _OutputIterator);
- __STL_REQUIRES_SAME_TYPE(
- typename iterator_traits<_InputIter1>::value_type,
- typename iterator_traits<_InputIter2>::value_type);
- __STL_BINARY_FUNCTION_CHECK(_Compare, bool,
- typename iterator_traits<_InputIter1>::value_type,
- typename iterator_traits<_InputIter2>::value_type);
+ _OutputIter __result, _Compare __comp)
+{
+ // concept requirements
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIter1>);
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIter2>);
+ __glibcpp_function_requires(_SameTypeConcept<
+ typename iterator_traits<_InputIter1>::value_type,
+ typename iterator_traits<_InputIter2>::value_type>);
+ __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter,
+ typename iterator_traits<_InputIter1>::value_type>);
+ __glibcpp_function_requires(_BinaryPredicateConcept<_Compare,
+ typename iterator_traits<_InputIter1>::value_type,
+ typename iterator_traits<_InputIter2>::value_type>);
+
while (__first1 != __last1 && __first2 != __last2) {
if (__comp(*__first1, *__first2)) {
*__result = *__first1;
@@ -2638,15 +2954,19 @@ _OutputIter set_union(_InputIter1 __first1, _InputIter1 __last1,
template <class _InputIter1, class _InputIter2, class _OutputIter>
_OutputIter set_intersection(_InputIter1 __first1, _InputIter1 __last1,
_InputIter2 __first2, _InputIter2 __last2,
- _OutputIter __result) {
- __STL_REQUIRES(_InputIter1, _InputIterator);
- __STL_REQUIRES(_InputIter2, _InputIterator);
- __STL_REQUIRES(_OutputIter, _OutputIterator);
- __STL_REQUIRES_SAME_TYPE(
- typename iterator_traits<_InputIter1>::value_type,
- typename iterator_traits<_InputIter2>::value_type);
- __STL_REQUIRES(typename iterator_traits<_InputIter1>::value_type,
- _LessThanComparable);
+ _OutputIter __result)
+{
+ // concept requirements
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIter1>);
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIter2>);
+ __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter,
+ typename iterator_traits<_InputIter1>::value_type>);
+ __glibcpp_function_requires(_SameTypeConcept<
+ typename iterator_traits<_InputIter1>::value_type,
+ typename iterator_traits<_InputIter2>::value_type>);
+ __glibcpp_function_requires(_LessThanComparableConcept<
+ typename iterator_traits<_InputIter1>::value_type>);
+
while (__first1 != __last1 && __first2 != __last2)
if (*__first1 < *__first2)
++__first1;
@@ -2665,16 +2985,19 @@ template <class _InputIter1, class _InputIter2, class _OutputIter,
class _Compare>
_OutputIter set_intersection(_InputIter1 __first1, _InputIter1 __last1,
_InputIter2 __first2, _InputIter2 __last2,
- _OutputIter __result, _Compare __comp) {
- __STL_REQUIRES(_InputIter1, _InputIterator);
- __STL_REQUIRES(_InputIter2, _InputIterator);
- __STL_REQUIRES(_OutputIter, _OutputIterator);
- __STL_REQUIRES_SAME_TYPE(
- typename iterator_traits<_InputIter1>::value_type,
- typename iterator_traits<_InputIter2>::value_type);
- __STL_BINARY_FUNCTION_CHECK(_Compare, bool,
- typename iterator_traits<_InputIter1>::value_type,
- typename iterator_traits<_InputIter2>::value_type);
+ _OutputIter __result, _Compare __comp)
+{
+ // concept requirements
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIter1>);
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIter2>);
+ __glibcpp_function_requires(_SameTypeConcept<
+ typename iterator_traits<_InputIter1>::value_type,
+ typename iterator_traits<_InputIter2>::value_type>);
+ __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter,
+ typename iterator_traits<_InputIter1>::value_type>);
+ __glibcpp_function_requires(_BinaryPredicateConcept<_Compare,
+ typename iterator_traits<_InputIter1>::value_type,
+ typename iterator_traits<_InputIter2>::value_type>);
while (__first1 != __last1 && __first2 != __last2)
if (__comp(*__first1, *__first2))
@@ -2693,15 +3016,19 @@ _OutputIter set_intersection(_InputIter1 __first1, _InputIter1 __last1,
template <class _InputIter1, class _InputIter2, class _OutputIter>
_OutputIter set_difference(_InputIter1 __first1, _InputIter1 __last1,
_InputIter2 __first2, _InputIter2 __last2,
- _OutputIter __result) {
- __STL_REQUIRES(_InputIter1, _InputIterator);
- __STL_REQUIRES(_InputIter2, _InputIterator);
- __STL_REQUIRES(_OutputIter, _OutputIterator);
- __STL_REQUIRES_SAME_TYPE(
- typename iterator_traits<_InputIter1>::value_type,
- typename iterator_traits<_InputIter2>::value_type);
- __STL_REQUIRES(typename iterator_traits<_InputIter1>::value_type,
- _LessThanComparable);
+ _OutputIter __result)
+{
+ // concept requirements
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIter1>);
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIter2>);
+ __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter,
+ typename iterator_traits<_InputIter1>::value_type>);
+ __glibcpp_function_requires(_SameTypeConcept<
+ typename iterator_traits<_InputIter1>::value_type,
+ typename iterator_traits<_InputIter2>::value_type>);
+ __glibcpp_function_requires(_LessThanComparableConcept<
+ typename iterator_traits<_InputIter1>::value_type>);
+
while (__first1 != __last1 && __first2 != __last2)
if (*__first1 < *__first2) {
*__result = *__first1;
@@ -2721,16 +3048,19 @@ template <class _InputIter1, class _InputIter2, class _OutputIter,
class _Compare>
_OutputIter set_difference(_InputIter1 __first1, _InputIter1 __last1,
_InputIter2 __first2, _InputIter2 __last2,
- _OutputIter __result, _Compare __comp) {
- __STL_REQUIRES(_InputIter1, _InputIterator);
- __STL_REQUIRES(_InputIter2, _InputIterator);
- __STL_REQUIRES(_OutputIter, _OutputIterator);
- __STL_REQUIRES_SAME_TYPE(
- typename iterator_traits<_InputIter1>::value_type,
- typename iterator_traits<_InputIter2>::value_type);
- __STL_BINARY_FUNCTION_CHECK(_Compare, bool,
- typename iterator_traits<_InputIter1>::value_type,
- typename iterator_traits<_InputIter2>::value_type);
+ _OutputIter __result, _Compare __comp)
+{
+ // concept requirements
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIter1>);
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIter2>);
+ __glibcpp_function_requires(_SameTypeConcept<
+ typename iterator_traits<_InputIter1>::value_type,
+ typename iterator_traits<_InputIter2>::value_type>);
+ __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter,
+ typename iterator_traits<_InputIter1>::value_type>);
+ __glibcpp_function_requires(_BinaryPredicateConcept<_Compare,
+ typename iterator_traits<_InputIter1>::value_type,
+ typename iterator_traits<_InputIter2>::value_type>);
while (__first1 != __last1 && __first2 != __last2)
if (__comp(*__first1, *__first2)) {
@@ -2751,15 +3081,19 @@ template <class _InputIter1, class _InputIter2, class _OutputIter>
_OutputIter
set_symmetric_difference(_InputIter1 __first1, _InputIter1 __last1,
_InputIter2 __first2, _InputIter2 __last2,
- _OutputIter __result) {
- __STL_REQUIRES(_InputIter1, _InputIterator);
- __STL_REQUIRES(_InputIter2, _InputIterator);
- __STL_REQUIRES(_OutputIter, _OutputIterator);
- __STL_REQUIRES_SAME_TYPE(
- typename iterator_traits<_InputIter1>::value_type,
- typename iterator_traits<_InputIter2>::value_type);
- __STL_REQUIRES(typename iterator_traits<_InputIter1>::value_type,
- _LessThanComparable);
+ _OutputIter __result)
+{
+ // concept requirements
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIter1>);
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIter2>);
+ __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter,
+ typename iterator_traits<_InputIter1>::value_type>);
+ __glibcpp_function_requires(_SameTypeConcept<
+ typename iterator_traits<_InputIter1>::value_type,
+ typename iterator_traits<_InputIter2>::value_type>);
+ __glibcpp_function_requires(_LessThanComparableConcept<
+ typename iterator_traits<_InputIter1>::value_type>);
+
while (__first1 != __last1 && __first2 != __last2)
if (*__first1 < *__first2) {
*__result = *__first1;
@@ -2784,16 +3118,20 @@ _OutputIter
set_symmetric_difference(_InputIter1 __first1, _InputIter1 __last1,
_InputIter2 __first2, _InputIter2 __last2,
_OutputIter __result,
- _Compare __comp) {
- __STL_REQUIRES(_InputIter1, _InputIterator);
- __STL_REQUIRES(_InputIter2, _InputIterator);
- __STL_REQUIRES(_OutputIter, _OutputIterator);
- __STL_REQUIRES_SAME_TYPE(
- typename iterator_traits<_InputIter1>::value_type,
- typename iterator_traits<_InputIter2>::value_type);
- __STL_BINARY_FUNCTION_CHECK(_Compare, bool,
- typename iterator_traits<_InputIter1>::value_type,
- typename iterator_traits<_InputIter2>::value_type);
+ _Compare __comp)
+{
+ // concept requirements
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIter1>);
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIter2>);
+ __glibcpp_function_requires(_SameTypeConcept<
+ typename iterator_traits<_InputIter1>::value_type,
+ typename iterator_traits<_InputIter2>::value_type>);
+ __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter,
+ typename iterator_traits<_InputIter1>::value_type>);
+ __glibcpp_function_requires(_BinaryPredicateConcept<_Compare,
+ typename iterator_traits<_InputIter1>::value_type,
+ typename iterator_traits<_InputIter2>::value_type>);
+
while (__first1 != __last1 && __first2 != __last2)
if (__comp(*__first1, *__first2)) {
*__result = *__first1;
@@ -2816,10 +3154,13 @@ set_symmetric_difference(_InputIter1 __first1, _InputIter1 __last1,
// comparison function.
template <class _ForwardIter>
-_ForwardIter max_element(_ForwardIter __first, _ForwardIter __last) {
- __STL_REQUIRES(_ForwardIter, _ForwardIterator);
- __STL_REQUIRES(typename iterator_traits<_ForwardIter>::value_type,
- _LessThanComparable);
+_ForwardIter max_element(_ForwardIter __first, _ForwardIter __last)
+{
+ // concept requirements
+ __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>);
+ __glibcpp_function_requires(_LessThanComparableConcept<
+ typename iterator_traits<_ForwardIter>::value_type>);
+
if (__first == __last) return __first;
_ForwardIter __result = __first;
while (++__first != __last)
@@ -2830,11 +3171,14 @@ _ForwardIter max_element(_ForwardIter __first, _ForwardIter __last) {
template <class _ForwardIter, class _Compare>
_ForwardIter max_element(_ForwardIter __first, _ForwardIter __last,
- _Compare __comp) {
- __STL_REQUIRES(_ForwardIter, _ForwardIterator);
- __STL_BINARY_FUNCTION_CHECK(_Compare, bool,
- typename iterator_traits<_ForwardIter>::value_type,
- typename iterator_traits<_ForwardIter>::value_type);
+ _Compare __comp)
+{
+ // concept requirements
+ __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>);
+ __glibcpp_function_requires(_BinaryPredicateConcept<_Compare,
+ typename iterator_traits<_ForwardIter>::value_type,
+ typename iterator_traits<_ForwardIter>::value_type>);
+
if (__first == __last) return __first;
_ForwardIter __result = __first;
while (++__first != __last)
@@ -2843,10 +3187,13 @@ _ForwardIter max_element(_ForwardIter __first, _ForwardIter __last,
}
template <class _ForwardIter>
-_ForwardIter min_element(_ForwardIter __first, _ForwardIter __last) {
- __STL_REQUIRES(_ForwardIter, _ForwardIterator);
- __STL_REQUIRES(typename iterator_traits<_ForwardIter>::value_type,
- _LessThanComparable);
+_ForwardIter min_element(_ForwardIter __first, _ForwardIter __last)
+{
+ // concept requirements
+ __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>);
+ __glibcpp_function_requires(_LessThanComparableConcept<
+ typename iterator_traits<_ForwardIter>::value_type>);
+
if (__first == __last) return __first;
_ForwardIter __result = __first;
while (++__first != __last)
@@ -2857,11 +3204,14 @@ _ForwardIter min_element(_ForwardIter __first, _ForwardIter __last) {
template <class _ForwardIter, class _Compare>
_ForwardIter min_element(_ForwardIter __first, _ForwardIter __last,
- _Compare __comp) {
- __STL_REQUIRES(_ForwardIter, _ForwardIterator);
- __STL_BINARY_FUNCTION_CHECK(_Compare, bool,
- typename iterator_traits<_ForwardIter>::value_type,
- typename iterator_traits<_ForwardIter>::value_type);
+ _Compare __comp)
+{
+ // concept requirements
+ __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>);
+ __glibcpp_function_requires(_BinaryPredicateConcept<_Compare,
+ typename iterator_traits<_ForwardIter>::value_type,
+ typename iterator_traits<_ForwardIter>::value_type>);
+
if (__first == __last) return __first;
_ForwardIter __result = __first;
while (++__first != __last)
@@ -2874,10 +3224,13 @@ _ForwardIter min_element(_ForwardIter __first, _ForwardIter __last,
// supplied comparison function.
template <class _BidirectionalIter>
-bool next_permutation(_BidirectionalIter __first, _BidirectionalIter __last) {
- __STL_REQUIRES(_BidirectionalIter, _BidirectionalIterator);
- __STL_REQUIRES(typename iterator_traits<_BidirectionalIter>::value_type,
- _LessThanComparable);
+bool next_permutation(_BidirectionalIter __first, _BidirectionalIter __last)
+{
+ // concept requirements
+ __glibcpp_function_requires(_BidirectionalIteratorConcept<_BidirectionalIter>);
+ __glibcpp_function_requires(_LessThanComparableConcept<
+ typename iterator_traits<_BidirectionalIter>::value_type>);
+
if (__first == __last)
return false;
_BidirectionalIter __i = __first;
@@ -2907,11 +3260,14 @@ bool next_permutation(_BidirectionalIter __first, _BidirectionalIter __last) {
template <class _BidirectionalIter, class _Compare>
bool next_permutation(_BidirectionalIter __first, _BidirectionalIter __last,
- _Compare __comp) {
- __STL_REQUIRES(_BidirectionalIter, _BidirectionalIterator);
- __STL_BINARY_FUNCTION_CHECK(_Compare, bool,
- typename iterator_traits<_BidirectionalIter>::value_type,
- typename iterator_traits<_BidirectionalIter>::value_type);
+ _Compare __comp)
+{
+ // concept requirements
+ __glibcpp_function_requires(_BidirectionalIteratorConcept<_BidirectionalIter>);
+ __glibcpp_function_requires(_BinaryPredicateConcept<_Compare,
+ typename iterator_traits<_BidirectionalIter>::value_type,
+ typename iterator_traits<_BidirectionalIter>::value_type>);
+
if (__first == __last)
return false;
_BidirectionalIter __i = __first;
@@ -2940,10 +3296,13 @@ bool next_permutation(_BidirectionalIter __first, _BidirectionalIter __last,
}
template <class _BidirectionalIter>
-bool prev_permutation(_BidirectionalIter __first, _BidirectionalIter __last) {
- __STL_REQUIRES(_BidirectionalIter, _BidirectionalIterator);
- __STL_REQUIRES(typename iterator_traits<_BidirectionalIter>::value_type,
- _LessThanComparable);
+bool prev_permutation(_BidirectionalIter __first, _BidirectionalIter __last)
+{
+ // concept requirements
+ __glibcpp_function_requires(_BidirectionalIteratorConcept<_BidirectionalIter>);
+ __glibcpp_function_requires(_LessThanComparableConcept<
+ typename iterator_traits<_BidirectionalIter>::value_type>);
+
if (__first == __last)
return false;
_BidirectionalIter __i = __first;
@@ -2973,11 +3332,14 @@ bool prev_permutation(_BidirectionalIter __first, _BidirectionalIter __last) {
template <class _BidirectionalIter, class _Compare>
bool prev_permutation(_BidirectionalIter __first, _BidirectionalIter __last,
- _Compare __comp) {
- __STL_REQUIRES(_BidirectionalIter, _BidirectionalIterator);
- __STL_BINARY_FUNCTION_CHECK(_Compare, bool,
- typename iterator_traits<_BidirectionalIter>::value_type,
- typename iterator_traits<_BidirectionalIter>::value_type);
+ _Compare __comp)
+{
+ // concept requirements
+ __glibcpp_function_requires(_BidirectionalIteratorConcept<_BidirectionalIter>);
+ __glibcpp_function_requires(_BinaryPredicateConcept<_Compare,
+ typename iterator_traits<_BidirectionalIter>::value_type,
+ typename iterator_traits<_BidirectionalIter>::value_type>);
+
if (__first == __last)
return false;
_BidirectionalIter __i = __first;
@@ -3011,11 +3373,12 @@ template <class _InputIter, class _ForwardIter>
_InputIter find_first_of(_InputIter __first1, _InputIter __last1,
_ForwardIter __first2, _ForwardIter __last2)
{
- __STL_REQUIRES(_InputIter, _InputIterator);
- __STL_REQUIRES(_ForwardIter, _ForwardIterator);
- __STL_REQUIRES_BINARY_OP(_OP_EQUAL, bool,
- typename iterator_traits<_InputIter>::value_type,
- typename iterator_traits<_ForwardIter>::value_type);
+ // concept requirements
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIter>);
+ __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>);
+ __glibcpp_function_requires(_EqualOpConcept<
+ typename iterator_traits<_InputIter>::value_type,
+ typename iterator_traits<_ForwardIter>::value_type>);
for ( ; __first1 != __last1; ++__first1)
for (_ForwardIter __iter = __first2; __iter != __last2; ++__iter)
@@ -3029,11 +3392,15 @@ _InputIter find_first_of(_InputIter __first1, _InputIter __last1,
_ForwardIter __first2, _ForwardIter __last2,
_BinaryPredicate __comp)
{
- __STL_REQUIRES(_InputIter, _InputIterator);
- __STL_REQUIRES(_ForwardIter, _ForwardIterator);
- __STL_BINARY_FUNCTION_CHECK(_BinaryPredicate, bool,
- typename iterator_traits<_InputIter>::value_type,
- typename iterator_traits<_ForwardIter>::value_type);
+ // concept requirements
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIter>);
+ __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>);
+ __glibcpp_function_requires(_EqualOpConcept<
+ typename iterator_traits<_InputIter>::value_type,
+ typename iterator_traits<_ForwardIter>::value_type>);
+ __glibcpp_function_requires(_BinaryPredicateConcept<_BinaryPredicate,
+ typename iterator_traits<_InputIter>::value_type,
+ typename iterator_traits<_ForwardIter>::value_type>);
for ( ; __first1 != __last1; ++__first1)
for (_ForwardIter __iter = __first2; __iter != __last2; ++__iter)
@@ -3098,16 +3465,16 @@ _ForwardIter1 __find_end(_ForwardIter1 __first1, _ForwardIter1 __last1,
}
// find_end for bidirectional iterators. Requires partial specialization.
-#ifdef __STL_CLASS_PARTIAL_SPECIALIZATION
-
template <class _BidirectionalIter1, class _BidirectionalIter2>
_BidirectionalIter1
__find_end(_BidirectionalIter1 __first1, _BidirectionalIter1 __last1,
_BidirectionalIter2 __first2, _BidirectionalIter2 __last2,
bidirectional_iterator_tag, bidirectional_iterator_tag)
{
- __STL_REQUIRES(_BidirectionalIter1, _BidirectionalIterator);
- __STL_REQUIRES(_BidirectionalIter2, _BidirectionalIterator);
+ // concept requirements
+ __glibcpp_function_requires(_BidirectionalIteratorConcept<_BidirectionalIter1>);
+ __glibcpp_function_requires(_BidirectionalIteratorConcept<_BidirectionalIter2>);
+
typedef reverse_iterator<_BidirectionalIter1> _RevIter1;
typedef reverse_iterator<_BidirectionalIter2> _RevIter2;
@@ -3133,8 +3500,10 @@ __find_end(_BidirectionalIter1 __first1, _BidirectionalIter1 __last1,
bidirectional_iterator_tag, bidirectional_iterator_tag,
_BinaryPredicate __comp)
{
- __STL_REQUIRES(_BidirectionalIter1, _BidirectionalIterator);
- __STL_REQUIRES(_BidirectionalIter2, _BidirectionalIterator);
+ // concept requirements
+ __glibcpp_function_requires(_BidirectionalIteratorConcept<_BidirectionalIter1>);
+ __glibcpp_function_requires(_BidirectionalIteratorConcept<_BidirectionalIter2>);
+
typedef reverse_iterator<_BidirectionalIter1> _RevIter1;
typedef reverse_iterator<_BidirectionalIter2> _RevIter2;
@@ -3152,7 +3521,6 @@ __find_end(_BidirectionalIter1 __first1, _BidirectionalIter1 __last1,
return __result;
}
}
-#endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */
// Dispatching functions for find_end.
@@ -3161,14 +3529,16 @@ inline _ForwardIter1
find_end(_ForwardIter1 __first1, _ForwardIter1 __last1,
_ForwardIter2 __first2, _ForwardIter2 __last2)
{
- __STL_REQUIRES(_ForwardIter1, _ForwardIterator);
- __STL_REQUIRES(_ForwardIter2, _ForwardIterator);
- __STL_REQUIRES_BINARY_OP(_OP_EQUAL, bool,
- typename iterator_traits<_ForwardIter1>::value_type,
- typename iterator_traits<_ForwardIter2>::value_type);
+ // concept requirements
+ __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter1>);
+ __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter2>);
+ __glibcpp_function_requires(_EqualOpConcept<
+ typename iterator_traits<_ForwardIter1>::value_type,
+ typename iterator_traits<_ForwardIter2>::value_type>);
+
return __find_end(__first1, __last1, __first2, __last2,
- __ITERATOR_CATEGORY(__first1),
- __ITERATOR_CATEGORY(__first2));
+ __iterator_category(__first1),
+ __iterator_category(__first2));
}
template <class _ForwardIter1, class _ForwardIter2,
@@ -3178,15 +3548,16 @@ find_end(_ForwardIter1 __first1, _ForwardIter1 __last1,
_ForwardIter2 __first2, _ForwardIter2 __last2,
_BinaryPredicate __comp)
{
- __STL_REQUIRES(_ForwardIter1, _ForwardIterator);
- __STL_REQUIRES(_ForwardIter2, _ForwardIterator);
- __STL_BINARY_FUNCTION_CHECK(_BinaryPredicate, bool,
- typename iterator_traits<_ForwardIter1>::value_type,
- typename iterator_traits<_ForwardIter2>::value_type);
+ // concept requirements
+ __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter1>);
+ __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter2>);
+ __glibcpp_function_requires(_BinaryPredicateConcept<_BinaryPredicate,
+ typename iterator_traits<_ForwardIter1>::value_type,
+ typename iterator_traits<_ForwardIter2>::value_type>);
return __find_end(__first1, __last1, __first2, __last2,
- __ITERATOR_CATEGORY(__first1),
- __ITERATOR_CATEGORY(__first2),
+ __iterator_category(__first1),
+ __iterator_category(__first2),
__comp);
}
@@ -3224,9 +3595,11 @@ bool __is_heap(_RandomAccessIter __first, _StrictWeakOrdering __comp,
template <class _RandomAccessIter>
inline bool is_heap(_RandomAccessIter __first, _RandomAccessIter __last)
{
- __STL_REQUIRES(_RandomAccessIter, _RandomAccessIterator);
- __STL_REQUIRES(typename iterator_traits<_RandomAccessIter>::value_type,
- _LessThanComparable);
+ // concept requirements
+ __glibcpp_function_requires(_RandomAccessIteratorConcept<_RandomAccessIter>);
+ __glibcpp_function_requires(_LessThanComparableConcept<
+ typename iterator_traits<_RandomAccessIter>::value_type>);
+
return __is_heap(__first, __last - __first);
}
@@ -3235,10 +3608,12 @@ template <class _RandomAccessIter, class _StrictWeakOrdering>
inline bool is_heap(_RandomAccessIter __first, _RandomAccessIter __last,
_StrictWeakOrdering __comp)
{
- __STL_REQUIRES(_RandomAccessIter, _RandomAccessIterator);
- __STL_BINARY_FUNCTION_CHECK(_StrictWeakOrdering, bool,
- typename iterator_traits<_RandomAccessIter>::value_type,
- typename iterator_traits<_RandomAccessIter>::value_type);
+ // concept requirements
+ __glibcpp_function_requires(_RandomAccessIteratorConcept<_RandomAccessIter>);
+ __glibcpp_function_requires(_BinaryPredicateConcept<_StrictWeakOrdering,
+ typename iterator_traits<_RandomAccessIter>::value_type,
+ typename iterator_traits<_RandomAccessIter>::value_type>);
+
return __is_heap(__first, __comp, __last - __first);
}
@@ -3249,9 +3624,11 @@ inline bool is_heap(_RandomAccessIter __first, _RandomAccessIter __last,
template <class _ForwardIter>
bool is_sorted(_ForwardIter __first, _ForwardIter __last)
{
- __STL_REQUIRES(_ForwardIter, _ForwardIterator);
- __STL_REQUIRES(typename iterator_traits<_ForwardIter>::value_type,
- _LessThanComparable);
+ // concept requirements
+ __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>);
+ __glibcpp_function_requires(_LessThanComparableConcept<
+ typename iterator_traits<_ForwardIter>::value_type>);
+
if (__first == __last)
return true;
@@ -3268,10 +3645,12 @@ template <class _ForwardIter, class _StrictWeakOrdering>
bool is_sorted(_ForwardIter __first, _ForwardIter __last,
_StrictWeakOrdering __comp)
{
- __STL_REQUIRES(_ForwardIter, _ForwardIterator);
- __STL_BINARY_FUNCTION_CHECK(_StrictWeakOrdering, bool,
- typename iterator_traits<_ForwardIter>::value_type,
- typename iterator_traits<_ForwardIter>::value_type);
+ // concept requirements
+ __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>);
+ __glibcpp_function_requires(_BinaryPredicateConcept<_StrictWeakOrdering,
+ typename iterator_traits<_ForwardIter>::value_type,
+ typename iterator_traits<_ForwardIter>::value_type>);
+
if (__first == __last)
return true;
@@ -3284,11 +3663,7 @@ bool is_sorted(_ForwardIter __first, _ForwardIter __last,
return true;
}
-#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
-#pragma reset woff 1209
-#endif
-
-__STL_END_NAMESPACE
+} // namespace std
#endif /* __SGI_STL_INTERNAL_ALGO_H */
diff --git a/libstdc++-v3/include/bits/stl_algobase.h b/libstdc++-v3/include/bits/stl_algobase.h
index a9ab37bcfad..23679d08120 100644
--- a/libstdc++-v3/include/bits/stl_algobase.h
+++ b/libstdc++-v3/include/bits/stl_algobase.h
@@ -1,3 +1,32 @@
+// Bits and pieces used in algorithms -*- C++ -*-
+
+// Copyright (C) 2001 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.
+
/*
*
* Copyright (c) 1994
@@ -32,7 +61,7 @@
#ifndef __SGI_STL_INTERNAL_ALGOBASE_H
#define __SGI_STL_INTERNAL_ALGOBASE_H
-#include <bits/stl_config.h>
+#include <bits/c++config.h>
#ifndef __SGI_STL_INTERNAL_PAIR_H
#include <bits/stl_pair.h>
#endif
@@ -45,42 +74,47 @@
#include <bits/std_cstddef.h>
#include <new>
-#ifdef __STL_USE_NEW_IOSTREAMS
-#include <iosfwd>
-#else /* __STL_USE_NEW_IOSTREAMS */
#include <bits/std_iosfwd.h>
-#endif /* __STL_USE_NEW_IOSTREAMS */
-
-#include <bits/stl_iterator_base.h>
+#include <bits/stl_iterator_base_types.h>
+#include <bits/stl_iterator_base_funcs.h>
#include <bits/stl_iterator.h>
+#include <bits/concept_check.h>
-// We pick up concept_checks.h from stl_iterator_base.h.
-
-__STL_BEGIN_NAMESPACE
+namespace std
+{
// swap and iter_swap
template <class _ForwardIter1, class _ForwardIter2, class _Tp>
-inline void __iter_swap(_ForwardIter1 __a, _ForwardIter2 __b, _Tp*) {
+inline void __iter_swap(_ForwardIter1 __a, _ForwardIter2 __b, _Tp*)
+{
_Tp __tmp = *__a;
*__a = *__b;
*__b = __tmp;
}
template <class _ForwardIter1, class _ForwardIter2>
-inline void iter_swap(_ForwardIter1 __a, _ForwardIter2 __b) {
- __STL_REQUIRES(_ForwardIter1, _Mutable_ForwardIterator);
- __STL_REQUIRES(_ForwardIter2, _Mutable_ForwardIterator);
- __STL_CONVERTIBLE(typename iterator_traits<_ForwardIter1>::value_type,
- typename iterator_traits<_ForwardIter2>::value_type);
- __STL_CONVERTIBLE(typename iterator_traits<_ForwardIter2>::value_type,
- typename iterator_traits<_ForwardIter1>::value_type);
- __iter_swap(__a, __b, __VALUE_TYPE(__a));
+inline void iter_swap(_ForwardIter1 __a, _ForwardIter2 __b)
+{
+ // concept requirements
+ __glibcpp_function_requires(_Mutable_ForwardIteratorConcept<_ForwardIter1>);
+ __glibcpp_function_requires(_Mutable_ForwardIteratorConcept<_ForwardIter2>);
+ __glibcpp_function_requires(_ConvertibleConcept<
+ typename iterator_traits<_ForwardIter1>::value_type,
+ typename iterator_traits<_ForwardIter2>::value_type>);
+ __glibcpp_function_requires(_ConvertibleConcept<
+ typename iterator_traits<_ForwardIter2>::value_type,
+ typename iterator_traits<_ForwardIter1>::value_type>);
+
+ __iter_swap(__a, __b, __value_type(__a));
}
template <class _Tp>
-inline void swap(_Tp& __a, _Tp& __b) {
- __STL_REQUIRES(_Tp, _Assignable);
+inline void swap(_Tp& __a, _Tp& __b)
+{
+ // concept requirements
+ __glibcpp_function_requires(_SGIAssignableConcept<_Tp>);
+
_Tp __tmp = __a;
__a = __b;
__b = __tmp;
@@ -89,27 +123,25 @@ inline void swap(_Tp& __a, _Tp& __b) {
//--------------------------------------------------
// min and max
-#if !defined(__BORLANDC__) || __BORLANDC__ >= 0x540 /* C++ Builder 4.0 */
-
#undef min
#undef max
template <class _Tp>
inline const _Tp& min(const _Tp& __a, const _Tp& __b) {
- __STL_REQUIRES(_Tp, _LessThanComparable);
+ // concept requirements
+ __glibcpp_function_requires(_LessThanComparableConcept<_Tp>);
//return __b < __a ? __b : __a;
if (__b < __a) return __b; return __a;
}
template <class _Tp>
inline const _Tp& max(const _Tp& __a, const _Tp& __b) {
- __STL_REQUIRES(_Tp, _LessThanComparable);
+ // concept requirements
+ __glibcpp_function_requires(_LessThanComparableConcept<_Tp>);
//return __a < __b ? __b : __a;
if (__a < __b) return __b; return __a;
}
-#endif /* __BORLANDC__ */
-
template <class _Tp, class _Compare>
inline const _Tp& min(const _Tp& __a, const _Tp& __b, _Compare __comp) {
//return __comp(__b, __a) ? __b : __a;
@@ -156,49 +188,50 @@ __copy(_RandomAccessIter __first, _RandomAccessIter __last,
template <class _Tp>
inline _Tp*
-__copy_trivial(const _Tp* __first, const _Tp* __last, _Tp* __result) {
+__copy_trivial(const _Tp* __first, const _Tp* __last, _Tp* __result)
+{
memmove(__result, __first, sizeof(_Tp) * (__last - __first));
return __result + (__last - __first);
}
-#if defined(__STL_FUNCTION_TMPL_PARTIAL_ORDER)
template <class _InputIter, class _OutputIter>
inline _OutputIter __copy_aux2(_InputIter __first, _InputIter __last,
- _OutputIter __result, __false_type) {
+ _OutputIter __result, __false_type)
+{
return __copy(__first, __last, __result,
- __ITERATOR_CATEGORY(__first),
- __DISTANCE_TYPE(__first));
+ __iterator_category(__first),
+ __distance_type(__first));
}
template <class _InputIter, class _OutputIter>
inline _OutputIter __copy_aux2(_InputIter __first, _InputIter __last,
- _OutputIter __result, __true_type) {
+ _OutputIter __result, __true_type)
+{
return __copy(__first, __last, __result,
- __ITERATOR_CATEGORY(__first),
- __DISTANCE_TYPE(__first));
+ __iterator_category(__first),
+ __distance_type(__first));
}
-#ifndef __USLC__
-
template <class _Tp>
inline _Tp* __copy_aux2(_Tp* __first, _Tp* __last, _Tp* __result,
- __true_type) {
+ __true_type)
+{
return __copy_trivial(__first, __last, __result);
}
-#endif /* __USLC__ */
-
template <class _Tp>
inline _Tp* __copy_aux2(const _Tp* __first, const _Tp* __last, _Tp* __result,
- __true_type) {
+ __true_type)
+{
return __copy_trivial(__first, __last, __result);
}
template <class _InputIter, class _OutputIter, class _Tp>
inline _OutputIter __copy_aux(_InputIter __first, _InputIter __last,
- _OutputIter __result, _Tp*) {
+ _OutputIter __result, _Tp*)
+{
typedef typename __type_traits<_Tp>::has_trivial_assignment_operator
_Trivial;
return __copy_aux2(__first, __last, __result, _Trivial());
@@ -206,124 +239,47 @@ inline _OutputIter __copy_aux(_InputIter __first, _InputIter __last,
template<typename _InputIter, typename _OutputIter>
inline _OutputIter __copy_ni2(_InputIter __first, _InputIter __last,
- _OutputIter __result, __true_type) {
+ _OutputIter __result, __true_type)
+{
return _OutputIter(__copy_aux(__first, __last, __result.base(),
- __VALUE_TYPE(__first)));
+ __value_type(__first)));
}
template<typename _InputIter, typename _OutputIter>
inline _OutputIter __copy_ni2(_InputIter __first, _InputIter __last,
- _OutputIter __result, __false_type) {
- return __copy_aux(__first, __last, __result, __VALUE_TYPE(__first));
+ _OutputIter __result, __false_type)
+{
+ return __copy_aux(__first, __last, __result, __value_type(__first));
}
template<typename _InputIter, typename _OutputIter>
inline _OutputIter __copy_ni1(_InputIter __first, _InputIter __last,
- _OutputIter __result, __true_type) {
+ _OutputIter __result, __true_type)
+{
typedef typename _Is_normal_iterator<_OutputIter>::_Normal __Normal;
return __copy_ni2(__first.base(), __last.base(), __result, __Normal());
}
template<typename _InputIter, typename _OutputIter>
inline _OutputIter __copy_ni1(_InputIter __first, _InputIter __last,
- _OutputIter __result, __false_type) {
+ _OutputIter __result, __false_type)
+{
typedef typename _Is_normal_iterator<_OutputIter>::_Normal __Normal;
return __copy_ni2(__first, __last, __result, __Normal());
}
template <class _InputIter, class _OutputIter>
inline _OutputIter copy(_InputIter __first, _InputIter __last,
- _OutputIter __result) {
- __STL_REQUIRES(_InputIter, _InputIterator);
- __STL_REQUIRES(_OutputIter, _OutputIterator);
- typedef typename _Is_normal_iterator<_InputIter>::_Normal __Normal;
- return __copy_ni1(__first, __last, __result, __Normal());
-}
-
-// Hack for compilers that don't have partial ordering of function templates
-// but do have partial specialization of class templates.
-#elif defined(__STL_CLASS_PARTIAL_SPECIALIZATION)
-
-template <class _InputIter, class _OutputIter, class _BoolType>
-struct __copy_dispatch {
- static _OutputIter copy(_InputIter __first, _InputIter __last,
- _OutputIter __result) {
- typedef typename iterator_traits<_InputIter>::iterator_category _Category;
- typedef typename iterator_traits<_InputIter>::difference_type _Distance;
- return __copy(__first, __last, __result, _Category(), (_Distance*) 0);
- }
-};
-
-template <class _Tp>
-struct __copy_dispatch<_Tp*, _Tp*, __true_type>
-{
- static _Tp* copy(const _Tp* __first, const _Tp* __last, _Tp* __result) {
- return __copy_trivial(__first, __last, __result);
- }
-};
-
-template <class _Tp>
-struct __copy_dispatch<const _Tp*, _Tp*, __true_type>
-{
- static _Tp* copy(const _Tp* __first, const _Tp* __last, _Tp* __result) {
- return __copy_trivial(__first, __last, __result);
- }
-};
-
-template <class _InputIter, class _OutputIter>
-inline _OutputIter copy(_InputIter __first, _InputIter __last,
- _OutputIter __result) {
- __STL_REQUIRES(_InputIter, _InputIterator);
- __STL_REQUIRES(_OutputIter, _OutputIterator);
- typedef typename iterator_traits<_InputIter>::value_type _Tp;
- typedef typename __type_traits<_Tp>::has_trivial_assignment_operator
- _Trivial;
- return __copy_dispatch<_InputIter, _OutputIter, _Trivial>
- ::copy(__first, __last, __result);
-}
-
-// Fallback for compilers with neither partial ordering nor partial
-// specialization. Define the faster version for the basic builtin
-// types.
-#else /* __STL_CLASS_PARTIAL_SPECIALIZATION */
-
-template <class _InputIter, class _OutputIter>
-inline _OutputIter copy(_InputIter __first, _InputIter __last,
_OutputIter __result)
{
- return __copy(__first, __last, __result,
- __ITERATOR_CATEGORY(__first),
- __DISTANCE_TYPE(__first));
-}
-
-#define __SGI_STL_DECLARE_COPY_TRIVIAL(_Tp) \
- inline _Tp* copy(const _Tp* __first, const _Tp* __last, _Tp* __result) { \
- memmove(__result, __first, sizeof(_Tp) * (__last - __first)); \
- return __result + (__last - __first); \
- }
+ // concept requirements
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIter>);
+ __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter,
+ typename iterator_traits<_InputIter>::value_type>);
-__SGI_STL_DECLARE_COPY_TRIVIAL(char)
-__SGI_STL_DECLARE_COPY_TRIVIAL(signed char)
-__SGI_STL_DECLARE_COPY_TRIVIAL(unsigned char)
-__SGI_STL_DECLARE_COPY_TRIVIAL(short)
-__SGI_STL_DECLARE_COPY_TRIVIAL(unsigned short)
-__SGI_STL_DECLARE_COPY_TRIVIAL(int)
-__SGI_STL_DECLARE_COPY_TRIVIAL(unsigned int)
-__SGI_STL_DECLARE_COPY_TRIVIAL(long)
-__SGI_STL_DECLARE_COPY_TRIVIAL(unsigned long)
-#ifdef __STL_HAS_WCHAR_T
-__SGI_STL_DECLARE_COPY_TRIVIAL(wchar_t)
-#endif
-#ifdef _STL_LONG_LONG
-__SGI_STL_DECLARE_COPY_TRIVIAL(long long)
-__SGI_STL_DECLARE_COPY_TRIVIAL(unsigned long long)
-#endif
-__SGI_STL_DECLARE_COPY_TRIVIAL(float)
-__SGI_STL_DECLARE_COPY_TRIVIAL(double)
-__SGI_STL_DECLARE_COPY_TRIVIAL(long double)
-
-#undef __SGI_STL_DECLARE_COPY_TRIVIAL
-#endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */
+ typedef typename _Is_normal_iterator<_InputIter>::_Normal __Normal;
+ return __copy_ni1(__first, __last, __result, __Normal());
+}
//--------------------------------------------------
// copy_backward
@@ -353,7 +309,6 @@ inline _BidirectionalIter __copy_backward(_RandomAccessIter __first,
return __result;
}
-#ifdef __STL_CLASS_PARTIAL_SPECIALIZATION
// This dispatch class is a workaround for compilers that do not
// have partial ordering of function templates. All we're doing is
@@ -433,27 +388,20 @@ inline _BI2 __copy_backward_input_normal_iterator(_BI1 __first, _BI1 __last,
}
template <typename _BI1, typename _BI2>
-inline _BI2 copy_backward(_BI1 __first, _BI1 __last, _BI2 __result) {
- __STL_REQUIRES(_BI1, _BidirectionalIterator);
- __STL_REQUIRES(_BI2, _Mutable_BidirectionalIterator);
- __STL_CONVERTIBLE(typename iterator_traits<_BI1>::value_type,
- typename iterator_traits<_BI2>::value_type);
+inline _BI2 copy_backward(_BI1 __first, _BI1 __last, _BI2 __result)
+{
+ // concept requirements
+ __glibcpp_function_requires(_BidirectionalIteratorConcept<_BI1>);
+ __glibcpp_function_requires(_Mutable_BidirectionalIteratorConcept<_BI2>);
+ __glibcpp_function_requires(_ConvertibleConcept<
+ typename iterator_traits<_BI1>::value_type,
+ typename iterator_traits<_BI2>::value_type>);
+
typedef typename _Is_normal_iterator<_BI1>::_Normal __Normal;
return __copy_backward_input_normal_iterator(__first, __last, __result,
__Normal());
}
-#else /* __STL_CLASS_PARTIAL_SPECIALIZATION */
-
-template <class _BI1, class _BI2>
-inline _BI2 copy_backward(_BI1 __first, _BI1 __last, _BI2 __result) {
- return __copy_backward(__first, __last, __result,
- __ITERATOR_CATEGORY(__first),
- __DISTANCE_TYPE(__first));
-}
-
-#endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */
-
//--------------------------------------------------
// copy_n (not part of the C++ standard)
@@ -482,14 +430,18 @@ template <class _InputIter, class _Size, class _OutputIter>
inline pair<_InputIter, _OutputIter>
__copy_n(_InputIter __first, _Size __count, _OutputIter __result) {
return __copy_n(__first, __count, __result,
- __ITERATOR_CATEGORY(__first));
+ __iterator_category(__first));
}
template <class _InputIter, class _Size, class _OutputIter>
inline pair<_InputIter, _OutputIter>
-copy_n(_InputIter __first, _Size __count, _OutputIter __result) {
- __STL_REQUIRES(_InputIter, _InputIterator);
- __STL_REQUIRES(_OutputIter, _OutputIterator);
+copy_n(_InputIter __first, _Size __count, _OutputIter __result)
+{
+ // concept requirements
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIter>);
+ __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter,
+ typename iterator_traits<_InputIter>::value_type>);
+
return __copy_n(__first, __count, __result);
}
@@ -498,15 +450,21 @@ copy_n(_InputIter __first, _Size __count, _OutputIter __result) {
template <class _ForwardIter, class _Tp>
-void fill(_ForwardIter __first, _ForwardIter __last, const _Tp& __value) {
- __STL_REQUIRES(_ForwardIter, _Mutable_ForwardIterator);
+void fill(_ForwardIter __first, _ForwardIter __last, const _Tp& __value)
+{
+ // concept requirements
+ __glibcpp_function_requires(_Mutable_ForwardIteratorConcept<_ForwardIter>);
+
for ( ; __first != __last; ++__first)
*__first = __value;
}
template <class _OutputIter, class _Size, class _Tp>
-_OutputIter fill_n(_OutputIter __first, _Size __n, const _Tp& __value) {
- __STL_REQUIRES(_OutputIter, _OutputIterator);
+_OutputIter fill_n(_OutputIter __first, _Size __n, const _Tp& __value)
+{
+ // concept requirements
+ __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter,_Tp>);
+
for ( ; __n > 0; --__n, ++__first)
*__first = __value;
return __first;
@@ -515,45 +473,48 @@ _OutputIter fill_n(_OutputIter __first, _Size __n, const _Tp& __value) {
// Specialization: for one-byte types we can use memset.
inline void fill(unsigned char* __first, unsigned char* __last,
- const unsigned char& __c) {
+ const unsigned char& __c)
+{
unsigned char __tmp = __c;
memset(__first, __tmp, __last - __first);
}
inline void fill(signed char* __first, signed char* __last,
- const signed char& __c) {
+ const signed char& __c)
+{
signed char __tmp = __c;
memset(__first, static_cast<unsigned char>(__tmp), __last - __first);
}
-inline void fill(char* __first, char* __last, const char& __c) {
+inline void fill(char* __first, char* __last, const char& __c)
+{
char __tmp = __c;
memset(__first, static_cast<unsigned char>(__tmp), __last - __first);
}
-#ifdef __STL_FUNCTION_TMPL_PARTIAL_ORDER
-
template <class _Size>
inline unsigned char* fill_n(unsigned char* __first, _Size __n,
- const unsigned char& __c) {
+ const unsigned char& __c)
+{
fill(__first, __first + __n, __c);
return __first + __n;
}
template <class _Size>
inline signed char* fill_n(char* __first, _Size __n,
- const signed char& __c) {
+ const signed char& __c)
+{
fill(__first, __first + __n, __c);
return __first + __n;
}
template <class _Size>
-inline char* fill_n(char* __first, _Size __n, const char& __c) {
+inline char* fill_n(char* __first, _Size __n, const char& __c)
+{
fill(__first, __first + __n, __c);
return __first + __n;
}
-#endif /* __STL_FUNCTION_TMPL_PARTIAL_ORDER */
//--------------------------------------------------
// equal and mismatch
@@ -561,13 +522,16 @@ inline char* fill_n(char* __first, _Size __n, const char& __c) {
template <class _InputIter1, class _InputIter2>
pair<_InputIter1, _InputIter2> mismatch(_InputIter1 __first1,
_InputIter1 __last1,
- _InputIter2 __first2) {
- __STL_REQUIRES(_InputIter1, _InputIterator);
- __STL_REQUIRES(_InputIter2, _InputIterator);
- __STL_REQUIRES(typename iterator_traits<_InputIter1>::value_type,
- _EqualityComparable);
- __STL_REQUIRES(typename iterator_traits<_InputIter2>::value_type,
- _EqualityComparable);
+ _InputIter2 __first2)
+{
+ // concept requirements
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIter1>);
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIter2>);
+ __glibcpp_function_requires(_EqualityComparableConcept<
+ typename iterator_traits<_InputIter1>::value_type>);
+ __glibcpp_function_requires(_EqualityComparableConcept<
+ typename iterator_traits<_InputIter2>::value_type>);
+
while (__first1 != __last1 && *__first1 == *__first2) {
++__first1;
++__first2;
@@ -579,9 +543,12 @@ template <class _InputIter1, class _InputIter2, class _BinaryPredicate>
pair<_InputIter1, _InputIter2> mismatch(_InputIter1 __first1,
_InputIter1 __last1,
_InputIter2 __first2,
- _BinaryPredicate __binary_pred) {
- __STL_REQUIRES(_InputIter1, _InputIterator);
- __STL_REQUIRES(_InputIter2, _InputIterator);
+ _BinaryPredicate __binary_pred)
+{
+ // concept requirements
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIter1>);
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIter2>);
+
while (__first1 != __last1 && __binary_pred(*__first1, *__first2)) {
++__first1;
++__first2;
@@ -591,24 +558,29 @@ pair<_InputIter1, _InputIter2> mismatch(_InputIter1 __first1,
template <class _InputIter1, class _InputIter2>
inline bool equal(_InputIter1 __first1, _InputIter1 __last1,
- _InputIter2 __first2) {
- __STL_REQUIRES(_InputIter1, _InputIterator);
- __STL_REQUIRES(_InputIter2, _InputIterator);
- __STL_REQUIRES(typename iterator_traits<_InputIter1>::value_type,
- _EqualityComparable);
- __STL_REQUIRES(typename iterator_traits<_InputIter2>::value_type,
- _EqualityComparable);
+ _InputIter2 __first2)
+{
+ // concept requirements
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIter1>);
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIter2>);
+ __glibcpp_function_requires(_EqualOpConcept<
+ typename iterator_traits<_InputIter1>::value_type,
+ typename iterator_traits<_InputIter2>::value_type>);
+
for ( ; __first1 != __last1; ++__first1, ++__first2)
- if (*__first1 != *__first2)
+ if (!(*__first1 == *__first2))
return false;
return true;
}
template <class _InputIter1, class _InputIter2, class _BinaryPredicate>
inline bool equal(_InputIter1 __first1, _InputIter1 __last1,
- _InputIter2 __first2, _BinaryPredicate __binary_pred) {
- __STL_REQUIRES(_InputIter1, _InputIterator);
- __STL_REQUIRES(_InputIter2, _InputIterator);
+ _InputIter2 __first2, _BinaryPredicate __binary_pred)
+{
+ // concept requirements
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIter1>);
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIter2>);
+
for ( ; __first1 != __last1; ++__first1, ++__first2)
if (!__binary_pred(*__first1, *__first2))
return false;
@@ -621,13 +593,16 @@ inline bool equal(_InputIter1 __first1, _InputIter1 __last1,
template <class _InputIter1, class _InputIter2>
bool lexicographical_compare(_InputIter1 __first1, _InputIter1 __last1,
- _InputIter2 __first2, _InputIter2 __last2) {
- __STL_REQUIRES(_InputIter1, _InputIterator);
- __STL_REQUIRES(_InputIter2, _InputIterator);
- __STL_REQUIRES(typename iterator_traits<_InputIter1>::value_type,
- _LessThanComparable);
- __STL_REQUIRES(typename iterator_traits<_InputIter2>::value_type,
- _LessThanComparable);
+ _InputIter2 __first2, _InputIter2 __last2)
+{
+ // concept requirements
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIter1>);
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIter2>);
+ __glibcpp_function_requires(_LessThanComparableConcept<
+ typename iterator_traits<_InputIter1>::value_type>);
+ __glibcpp_function_requires(_LessThanComparableConcept<
+ typename iterator_traits<_InputIter2>::value_type>);
+
for ( ; __first1 != __last1 && __first2 != __last2
; ++__first1, ++__first2) {
if (*__first1 < *__first2)
@@ -641,9 +616,12 @@ bool lexicographical_compare(_InputIter1 __first1, _InputIter1 __last1,
template <class _InputIter1, class _InputIter2, class _Compare>
bool lexicographical_compare(_InputIter1 __first1, _InputIter1 __last1,
_InputIter2 __first2, _InputIter2 __last2,
- _Compare __comp) {
- __STL_REQUIRES(_InputIter1, _InputIterator);
- __STL_REQUIRES(_InputIter2, _InputIterator);
+ _Compare __comp)
+{
+ // concept requirements
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIter1>);
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIter2>);
+
for ( ; __first1 != __last1 && __first2 != __last2
; ++__first1, ++__first2) {
if (__comp(*__first1, *__first2))
@@ -737,16 +715,18 @@ template <class _InputIter1, class _InputIter2>
int lexicographical_compare_3way(_InputIter1 __first1, _InputIter1 __last1,
_InputIter2 __first2, _InputIter2 __last2)
{
- __STL_REQUIRES(_InputIter1, _InputIterator);
- __STL_REQUIRES(_InputIter2, _InputIterator);
- __STL_REQUIRES(typename iterator_traits<_InputIter1>::value_type,
- _LessThanComparable);
- __STL_REQUIRES(typename iterator_traits<_InputIter2>::value_type,
- _LessThanComparable);
+ // concept requirements
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIter1>);
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIter2>);
+ __glibcpp_function_requires(_LessThanComparableConcept<
+ typename iterator_traits<_InputIter1>::value_type>);
+ __glibcpp_function_requires(_LessThanComparableConcept<
+ typename iterator_traits<_InputIter2>::value_type>);
+
return __lexicographical_compare_3way(__first1, __last1, __first2, __last2);
}
-__STL_END_NAMESPACE
+} // namespace std
#endif /* __SGI_STL_INTERNAL_ALGOBASE_H */
diff --git a/libstdc++-v3/include/bits/stl_alloc.h b/libstdc++-v3/include/bits/stl_alloc.h
index c8332167f01..eeecadf029b 100644
--- a/libstdc++-v3/include/bits/stl_alloc.h
+++ b/libstdc++-v3/include/bits/stl_alloc.h
@@ -1,3 +1,32 @@
+// Allocators -*- C++ -*-
+
+// Copyright (C) 2001 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.
+
/*
* Copyright (c) 1996-1997
* Silicon Graphics Computer Systems, Inc.
@@ -18,19 +47,6 @@
#ifndef __SGI_STL_INTERNAL_ALLOC_H
#define __SGI_STL_INTERNAL_ALLOC_H
-#ifdef __SUNPRO_CC
-# define __PRIVATE public
- // Extra access restrictions prevent us from really making some things
- // private.
-#else
-# define __PRIVATE private
-#endif
-
-#ifdef __STL_STATIC_TEMPLATE_MEMBER_BUG
-# define __USE_MALLOC
-#endif
-
-
// This implements some standard node allocators. These are
// NOT the same as the allocators in the C++ draft standard or in
// in the original STL. They do not encapsulate different pointer
@@ -38,17 +54,7 @@
// The allocation primitives are intended to allocate individual objects,
// not larger arenas as with the original STL allocators.
-#ifndef __THROW_BAD_ALLOC
-# if defined(__STL_NO_BAD_ALLOC) || !defined(__STL_USE_EXCEPTIONS)
-# include <bits/std_cstdio.h>
-# include <bits/std_cstdlib.h>
-# define __THROW_BAD_ALLOC fprintf(stderr, "out of memory\n"); exit(1)
-# else /* Standard conforming out-of-memory handling */
-# include <new>
-# define __THROW_BAD_ALLOC throw std::bad_alloc()
-# endif
-#endif
-
+#include <bits/functexcept.h> // for __throw_bad_alloc
#include <bits/std_cstddef.h>
#include <bits/std_cstdlib.h>
#include <bits/std_cstring.h>
@@ -88,23 +94,11 @@
# define __NODE_ALLOCATOR_THREADS false
#endif
-__STL_BEGIN_NAMESPACE
-
-#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
-#pragma set woff 1174
-#endif
+namespace std
+{
// Malloc-based allocator. Typically slower than default alloc below.
// Typically thread-safe and more storage efficient.
-#ifdef __STL_STATIC_TEMPLATE_MEMBER_BUG
-# ifdef __DECLARE_GLOBALS_HERE
- void (* __malloc_alloc_oom_handler)() = 0;
- // g++ 2.7.2 does not handle static template data members.
-# else
- extern void (* __malloc_alloc_oom_handler)();
-# endif
-#endif
-
template <int __inst>
class __malloc_alloc_template {
@@ -112,10 +106,7 @@ private:
static void* _S_oom_malloc(size_t);
static void* _S_oom_realloc(void*, size_t);
-
-#ifndef __STL_STATIC_TEMPLATE_MEMBER_BUG
static void (* __malloc_alloc_oom_handler)();
-#endif
public:
@@ -149,10 +140,8 @@ public:
// malloc_alloc out-of-memory handling
-#ifndef __STL_STATIC_TEMPLATE_MEMBER_BUG
template <int __inst>
void (* __malloc_alloc_template<__inst>::__malloc_alloc_oom_handler)() = 0;
-#endif
template <int __inst>
void*
@@ -163,7 +152,7 @@ __malloc_alloc_template<__inst>::_S_oom_malloc(size_t __n)
for (;;) {
__my_malloc_handler = __malloc_alloc_oom_handler;
- if (0 == __my_malloc_handler) { __THROW_BAD_ALLOC; }
+ if (0 == __my_malloc_handler) { std::__throw_bad_alloc(); }
(*__my_malloc_handler)();
__result = malloc(__n);
if (__result) return(__result);
@@ -178,7 +167,7 @@ void* __malloc_alloc_template<__inst>::_S_oom_realloc(void* __p, size_t __n)
for (;;) {
__my_malloc_handler = __malloc_alloc_oom_handler;
- if (0 == __my_malloc_handler) { __THROW_BAD_ALLOC; }
+ if (0 == __my_malloc_handler) { std::__throw_bad_alloc(); }
(*__my_malloc_handler)();
__result = realloc(__p, __n);
if (__result) return(__result);
@@ -278,40 +267,26 @@ typedef malloc_alloc single_client_alloc;
// Node that containers built on different allocator instances have
// different types, limiting the utility of this approach.
-#if defined(__SUNPRO_CC) || defined(__GNUC__)
-// breaks if we make these template class members:
- enum {_ALIGN = 8};
- enum {_MAX_BYTES = 128};
- enum {_NFREELISTS = 16}; // _MAX_BYTES/_ALIGN
-#endif
-
template <bool threads, int inst>
class __default_alloc_template {
private:
// Really we should use static const int x = N
// instead of enum { x = N }, but few compilers accept the former.
-#if ! (defined(__SUNPRO_CC) || defined(__GNUC__))
- enum {_ALIGN = 8};
- enum {_MAX_BYTES = 128};
- enum {_NFREELISTS = 16}; // _MAX_BYTES/_ALIGN
-# endif
+ enum {_ALIGN = 8};
+ enum {_MAX_BYTES = 128};
+ enum {_NFREELISTS = 16}; // _MAX_BYTES/_ALIGN
static size_t
_S_round_up(size_t __bytes)
{ return (((__bytes) + (size_t) _ALIGN-1) & ~((size_t) _ALIGN - 1)); }
-__PRIVATE:
union _Obj {
union _Obj* _M_free_list_link;
char _M_client_data[1]; /* The client sees this. */
};
-private:
-# if defined(__SUNPRO_CC) || defined(__GNUC__) || defined(__HP_aCC)
- static _Obj* __STL_VOLATILE _S_free_list[];
+
+ static _Obj* __STL_VOLATILE _S_free_list[];
// Specifying a size results in duplicate def for 4.1
-# else
- static _Obj* __STL_VOLATILE _S_free_list[_NFREELISTS];
-# endif
static size_t _S_freelist_index(size_t __bytes) {
return (((__bytes) + (size_t)_ALIGN-1)/(size_t)_ALIGN - 1);
}
@@ -409,14 +384,12 @@ inline bool operator==(const __default_alloc_template<__threads, __inst>&,
return true;
}
-# ifdef __STL_FUNCTION_TMPL_PARTIAL_ORDER
template <bool __threads, int __inst>
inline bool operator!=(const __default_alloc_template<__threads, __inst>&,
const __default_alloc_template<__threads, __inst>&)
{
return false;
}
-# endif /* __STL_FUNCTION_TMPL_PARTIAL_ORDER */
@@ -563,11 +536,7 @@ size_t __default_alloc_template<__threads, __inst>::_S_heap_size = 0;
template <bool __threads, int __inst>
typename __default_alloc_template<__threads, __inst>::_Obj* __STL_VOLATILE
__default_alloc_template<__threads, __inst> ::_S_free_list[
-# if defined(__SUNPRO_CC) || defined(__GNUC__) || defined(__HP_aCC)
- _NFREELISTS
-# else
__default_alloc_template<__threads, __inst>::_NFREELISTS
-# endif
] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, };
// The 16 zeros are necessary to make version 4.1 of the SunPro
// compiler happy. Otherwise it appears to allocate too little
@@ -583,8 +552,6 @@ __default_alloc_template<__threads, __inst> ::_S_free_list[
// templates, the typename keyword, and the use of the template keyword
// to refer to a template member of a dependent type.
-#ifdef __STL_USE_STD_ALLOCATORS
-
template <class _Tp>
class allocator {
typedef alloc _Alloc; // The underlying allocator.
@@ -726,14 +693,12 @@ inline bool operator==(const __allocator<_Tp, _Alloc>& __a1,
return __a1.__underlying_alloc == __a2.__underlying_alloc;
}
-#ifdef __STL_FUNCTION_TMPL_PARTIAL_ORDER
template <class _Tp, class _Alloc>
inline bool operator!=(const __allocator<_Tp, _Alloc>& __a1,
const __allocator<_Tp, _Alloc>& __a2)
{
return __a1.__underlying_alloc != __a2.__underlying_alloc;
}
-#endif /* __STL_FUNCTION_TMPL_PARTIAL_ORDER */
// Comparison operators for all of the predifined SGI-style allocators.
// This ensures that __allocator<malloc_alloc> (for example) will
@@ -746,14 +711,12 @@ inline bool operator==(const __malloc_alloc_template<inst>&,
return true;
}
-#ifdef __STL_FUNCTION_TMPL_PARTIAL_ORDER
template <int __inst>
inline bool operator!=(const __malloc_alloc_template<__inst>&,
const __malloc_alloc_template<__inst>&)
{
return false;
}
-#endif /* __STL_FUNCTION_TMPL_PARTIAL_ORDER */
template <class _Alloc>
inline bool operator==(const debug_alloc<_Alloc>&,
@@ -761,13 +724,11 @@ inline bool operator==(const debug_alloc<_Alloc>&,
return true;
}
-#ifdef __STL_FUNCTION_TMPL_PARTIAL_ORDER
template <class _Alloc>
inline bool operator!=(const debug_alloc<_Alloc>&,
const debug_alloc<_Alloc>&) {
return false;
}
-#endif /* __STL_FUNCTION_TMPL_PARTIAL_ORDER */
// Another allocator adaptor: _Alloc_traits. This serves two
// purposes. First, make it possible to write containers that can use
@@ -801,8 +762,7 @@ template <class _Tp, class _Allocator>
struct _Alloc_traits
{
static const bool _S_instanceless = false;
- typedef typename _Allocator::__STL_TEMPLATE rebind<_Tp>::other
- allocator_type;
+ typedef typename _Allocator::template rebind<_Tp>::other allocator_type;
};
template <class _Tp, class _Allocator>
@@ -882,16 +842,7 @@ struct _Alloc_traits<_Tp, __allocator<_Tp1, debug_alloc<_Alloc> > >
typedef __allocator<_Tp, debug_alloc<_Alloc> > allocator_type;
};
-
-#endif /* __STL_USE_STD_ALLOCATORS */
-
-#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
-#pragma reset woff 1174
-#endif
-
-__STL_END_NAMESPACE
-
-#undef __PRIVATE
+} // namespace std
#endif /* __SGI_STL_INTERNAL_ALLOC_H */
diff --git a/libstdc++-v3/include/bits/stl_bvector.h b/libstdc++-v3/include/bits/stl_bvector.h
new file mode 100644
index 00000000000..9a46cf56589
--- /dev/null
+++ b/libstdc++-v3/include/bits/stl_bvector.h
@@ -0,0 +1,727 @@
+// bit_vector and vector<bool> specialization -*- C++ -*-
+
+// Copyright (C) 2001 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.
+
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1996-1999
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/* NOTE: This is an internal header file, included by other STL headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef __SGI_STL_INTERNAL_BVECTOR_H
+#define __SGI_STL_INTERNAL_BVECTOR_H
+
+namespace std
+{
+
+static const int __WORD_BIT = int(CHAR_BIT*sizeof(unsigned int));
+
+struct _Bit_reference {
+ unsigned int* _M_p;
+ unsigned int _M_mask;
+ _Bit_reference(unsigned int* __x, unsigned int __y)
+ : _M_p(__x), _M_mask(__y) {}
+
+public:
+ _Bit_reference() : _M_p(0), _M_mask(0) {}
+ operator bool() const { return !(!(*_M_p & _M_mask)); }
+ _Bit_reference& operator=(bool __x)
+ {
+ if (__x) *_M_p |= _M_mask;
+ else *_M_p &= ~_M_mask;
+ return *this;
+ }
+ _Bit_reference& operator=(const _Bit_reference& __x)
+ { return *this = bool(__x); }
+ bool operator==(const _Bit_reference& __x) const
+ { return bool(*this) == bool(__x); }
+ bool operator<(const _Bit_reference& __x) const {
+ return !bool(*this) && bool(__x);
+ }
+ void flip() { *_M_p ^= _M_mask; }
+};
+
+inline void swap(_Bit_reference __x, _Bit_reference __y)
+{
+ bool __tmp = __x;
+ __x = __y;
+ __y = __tmp;
+}
+
+struct _Bit_iterator_base : public random_access_iterator<bool, ptrdiff_t>
+{
+ unsigned int* _M_p;
+ unsigned int _M_offset;
+
+ _Bit_iterator_base(unsigned int* __x, unsigned int __y)
+ : _M_p(__x), _M_offset(__y) {}
+
+ void _M_bump_up() {
+ if (_M_offset++ == __WORD_BIT - 1) {
+ _M_offset = 0;
+ ++_M_p;
+ }
+ }
+ void _M_bump_down() {
+ if (_M_offset-- == 0) {
+ _M_offset = __WORD_BIT - 1;
+ --_M_p;
+ }
+ }
+
+ void _M_incr(ptrdiff_t __i) {
+ difference_type __n = __i + _M_offset;
+ _M_p += __n / __WORD_BIT;
+ __n = __n % __WORD_BIT;
+ if (__n < 0) {
+ _M_offset = (unsigned int) __n + __WORD_BIT;
+ --_M_p;
+ } else
+ _M_offset = (unsigned int) __n;
+ }
+
+ bool operator==(const _Bit_iterator_base& __i) const {
+ return _M_p == __i._M_p && _M_offset == __i._M_offset;
+ }
+ bool operator<(const _Bit_iterator_base& __i) const {
+ return _M_p < __i._M_p || (_M_p == __i._M_p && _M_offset < __i._M_offset);
+ }
+ bool operator!=(const _Bit_iterator_base& __i) const {
+ return !(*this == __i);
+ }
+ bool operator>(const _Bit_iterator_base& __i) const {
+ return __i < *this;
+ }
+ bool operator<=(const _Bit_iterator_base& __i) const {
+ return !(__i < *this);
+ }
+ bool operator>=(const _Bit_iterator_base& __i) const {
+ return !(*this < __i);
+ }
+};
+
+inline ptrdiff_t
+operator-(const _Bit_iterator_base& __x, const _Bit_iterator_base& __y) {
+ return __WORD_BIT * (__x._M_p - __y._M_p) + __x._M_offset - __y._M_offset;
+}
+
+
+struct _Bit_iterator : public _Bit_iterator_base
+{
+ typedef _Bit_reference reference;
+ typedef _Bit_reference* pointer;
+ typedef _Bit_iterator iterator;
+
+ _Bit_iterator() : _Bit_iterator_base(0, 0) {}
+ _Bit_iterator(unsigned int* __x, unsigned int __y)
+ : _Bit_iterator_base(__x, __y) {}
+
+ reference operator*() const { return reference(_M_p, 1U << _M_offset); }
+ iterator& operator++() {
+ _M_bump_up();
+ return *this;
+ }
+ iterator operator++(int) {
+ iterator __tmp = *this;
+ _M_bump_up();
+ return __tmp;
+ }
+ iterator& operator--() {
+ _M_bump_down();
+ return *this;
+ }
+ iterator operator--(int) {
+ iterator __tmp = *this;
+ _M_bump_down();
+ return __tmp;
+ }
+ iterator& operator+=(difference_type __i) {
+ _M_incr(__i);
+ return *this;
+ }
+ iterator& operator-=(difference_type __i) {
+ *this += -__i;
+ return *this;
+ }
+ iterator operator+(difference_type __i) const {
+ iterator __tmp = *this;
+ return __tmp += __i;
+ }
+ iterator operator-(difference_type __i) const {
+ iterator __tmp = *this;
+ return __tmp -= __i;
+ }
+
+ reference operator[](difference_type __i) { return *(*this + __i); }
+};
+
+inline _Bit_iterator
+operator+(ptrdiff_t __n, const _Bit_iterator& __x) { return __x + __n; }
+
+
+struct _Bit_const_iterator : public _Bit_iterator_base
+{
+ typedef bool reference;
+ typedef bool const_reference;
+ typedef const bool* pointer;
+ typedef _Bit_const_iterator const_iterator;
+
+ _Bit_const_iterator() : _Bit_iterator_base(0, 0) {}
+ _Bit_const_iterator(unsigned int* __x, unsigned int __y)
+ : _Bit_iterator_base(__x, __y) {}
+ _Bit_const_iterator(const _Bit_iterator& __x)
+ : _Bit_iterator_base(__x._M_p, __x._M_offset) {}
+
+ const_reference operator*() const {
+ return _Bit_reference(_M_p, 1U << _M_offset);
+ }
+ const_iterator& operator++() {
+ _M_bump_up();
+ return *this;
+ }
+ const_iterator operator++(int) {
+ const_iterator __tmp = *this;
+ _M_bump_up();
+ return __tmp;
+ }
+ const_iterator& operator--() {
+ _M_bump_down();
+ return *this;
+ }
+ const_iterator operator--(int) {
+ const_iterator __tmp = *this;
+ _M_bump_down();
+ return __tmp;
+ }
+ const_iterator& operator+=(difference_type __i) {
+ _M_incr(__i);
+ return *this;
+ }
+ const_iterator& operator-=(difference_type __i) {
+ *this += -__i;
+ return *this;
+ }
+ const_iterator operator+(difference_type __i) const {
+ const_iterator __tmp = *this;
+ return __tmp += __i;
+ }
+ const_iterator operator-(difference_type __i) const {
+ const_iterator __tmp = *this;
+ return __tmp -= __i;
+ }
+ const_reference operator[](difference_type __i) {
+ return *(*this + __i);
+ }
+};
+
+inline _Bit_const_iterator
+operator+(ptrdiff_t __n, const _Bit_const_iterator& __x) { return __x + __n; }
+
+
+// Bit-vector base class, which encapsulates the difference between
+// old SGI-style allocators and standard-conforming allocators.
+
+// Base class for ordinary allocators.
+template <class _Allocator, bool __is_static>
+class _Bvector_alloc_base {
+public:
+ typedef typename _Alloc_traits<bool, _Allocator>::allocator_type
+ allocator_type;
+ allocator_type get_allocator() const { return _M_data_allocator; }
+
+ _Bvector_alloc_base(const allocator_type& __a)
+ : _M_data_allocator(__a), _M_start(), _M_finish(), _M_end_of_storage(0) {}
+
+protected:
+ unsigned int* _M_bit_alloc(size_t __n)
+ { return _M_data_allocator.allocate((__n + __WORD_BIT - 1)/__WORD_BIT); }
+ void _M_deallocate() {
+ if (_M_start._M_p)
+ _M_data_allocator.deallocate(_M_start._M_p,
+ _M_end_of_storage - _M_start._M_p);
+ }
+
+ typename _Alloc_traits<unsigned int, _Allocator>::allocator_type
+ _M_data_allocator;
+ _Bit_iterator _M_start;
+ _Bit_iterator _M_finish;
+ unsigned int* _M_end_of_storage;
+};
+
+// Specialization for instanceless allocators.
+template <class _Allocator>
+class _Bvector_alloc_base<_Allocator, true> {
+public:
+ typedef typename _Alloc_traits<bool, _Allocator>::allocator_type
+ allocator_type;
+ allocator_type get_allocator() const { return allocator_type(); }
+
+ _Bvector_alloc_base(const allocator_type&)
+ : _M_start(), _M_finish(), _M_end_of_storage(0) {}
+
+protected:
+ typedef typename _Alloc_traits<unsigned int, _Allocator>::_Alloc_type
+ _Alloc_type;
+
+ unsigned int* _M_bit_alloc(size_t __n)
+ { return _Alloc_type::allocate((__n + __WORD_BIT - 1)/__WORD_BIT); }
+ void _M_deallocate() {
+ if (_M_start._M_p)
+ _Alloc_type::deallocate(_M_start._M_p,
+ _M_end_of_storage - _M_start._M_p);
+ }
+
+ _Bit_iterator _M_start;
+ _Bit_iterator _M_finish;
+ unsigned int* _M_end_of_storage;
+};
+
+template <class _Alloc>
+class _Bvector_base
+ : public _Bvector_alloc_base<_Alloc,
+ _Alloc_traits<bool, _Alloc>::_S_instanceless>
+{
+ typedef _Bvector_alloc_base<_Alloc,
+ _Alloc_traits<bool, _Alloc>::_S_instanceless>
+ _Base;
+public:
+ typedef typename _Base::allocator_type allocator_type;
+
+ _Bvector_base(const allocator_type& __a) : _Base(__a) {}
+ ~_Bvector_base() { _Base::_M_deallocate(); }
+};
+
+} // namespace std
+
+// Declare a partial specialization of vector<T, Alloc>.
+#include <bits/stl_vector.h>
+namespace std
+{
+
+template <typename _Alloc>
+ class vector<bool, _Alloc> : public _Bvector_base<_Alloc>
+ {
+ public:
+ typedef bool value_type;
+ typedef size_t size_type;
+ typedef ptrdiff_t difference_type;
+ typedef _Bit_reference reference;
+ typedef bool const_reference;
+ typedef _Bit_reference* pointer;
+ typedef const bool* const_pointer;
+
+ typedef _Bit_iterator iterator;
+ typedef _Bit_const_iterator const_iterator;
+
+ typedef reverse_iterator<const_iterator> const_reverse_iterator;
+ typedef reverse_iterator<iterator> reverse_iterator;
+
+ typedef typename _Bvector_base<_Alloc>::allocator_type allocator_type;
+ allocator_type get_allocator() const {
+ return _Bvector_base<_Alloc>::get_allocator();
+ }
+
+ protected:
+ using _Bvector_base<_Alloc>::_M_bit_alloc;
+ using _Bvector_base<_Alloc>::_M_deallocate;
+ using _Bvector_base<_Alloc>::_M_start;
+ using _Bvector_base<_Alloc>::_M_finish;
+ using _Bvector_base<_Alloc>::_M_end_of_storage;
+
+ protected:
+ void _M_initialize(size_type __n) {
+ unsigned int* __q = _M_bit_alloc(__n);
+ _M_end_of_storage = __q + (__n + __WORD_BIT - 1)/__WORD_BIT;
+ _M_start = iterator(__q, 0);
+ _M_finish = _M_start + difference_type(__n);
+ }
+ void _M_insert_aux(iterator __position, bool __x) {
+ if (_M_finish._M_p != _M_end_of_storage) {
+ copy_backward(__position, _M_finish, _M_finish + 1);
+ *__position = __x;
+ ++_M_finish;
+ }
+ else {
+ size_type __len = size() ? 2 * size() : __WORD_BIT;
+ unsigned int* __q = _M_bit_alloc(__len);
+ iterator __i = copy(begin(), __position, iterator(__q, 0));
+ *__i++ = __x;
+ _M_finish = copy(__position, end(), __i);
+ _M_deallocate();
+ _M_end_of_storage = __q + (__len + __WORD_BIT - 1)/__WORD_BIT;
+ _M_start = iterator(__q, 0);
+ }
+ }
+
+ template <class _InputIterator>
+ void _M_initialize_range(_InputIterator __first, _InputIterator __last,
+ input_iterator_tag) {
+ _M_start = iterator();
+ _M_finish = iterator();
+ _M_end_of_storage = 0;
+ for ( ; __first != __last; ++__first)
+ push_back(*__first);
+ }
+
+ template <class _ForwardIterator>
+ void _M_initialize_range(_ForwardIterator __first, _ForwardIterator __last,
+ forward_iterator_tag) {
+ size_type __n = 0;
+ distance(__first, __last, __n);
+ _M_initialize(__n);
+ copy(__first, __last, _M_start);
+ }
+
+ template <class _InputIterator>
+ void _M_insert_range(iterator __pos,
+ _InputIterator __first, _InputIterator __last,
+ input_iterator_tag) {
+ for ( ; __first != __last; ++__first) {
+ __pos = insert(__pos, *__first);
+ ++__pos;
+ }
+ }
+
+ template <class _ForwardIterator>
+ void _M_insert_range(iterator __position,
+ _ForwardIterator __first, _ForwardIterator __last,
+ forward_iterator_tag) {
+ if (__first != __last) {
+ size_type __n = 0;
+ distance(__first, __last, __n);
+ if (capacity() - size() >= __n) {
+ copy_backward(__position, end(), _M_finish + difference_type(__n));
+ copy(__first, __last, __position);
+ _M_finish += difference_type(__n);
+ }
+ else {
+ size_type __len = size() + max(size(), __n);
+ unsigned int* __q = _M_bit_alloc(__len);
+ iterator __i = copy(begin(), __position, iterator(__q, 0));
+ __i = copy(__first, __last, __i);
+ _M_finish = copy(__position, end(), __i);
+ _M_deallocate();
+ _M_end_of_storage = __q + (__len + __WORD_BIT - 1)/__WORD_BIT;
+ _M_start = iterator(__q, 0);
+ }
+ }
+ }
+
+ public:
+ iterator begin() { return _M_start; }
+ const_iterator begin() const { return _M_start; }
+ iterator end() { return _M_finish; }
+ const_iterator end() const { return _M_finish; }
+
+ reverse_iterator rbegin() { return reverse_iterator(end()); }
+ const_reverse_iterator rbegin() const {
+ return const_reverse_iterator(end());
+ }
+ reverse_iterator rend() { return reverse_iterator(begin()); }
+ const_reverse_iterator rend() const {
+ return const_reverse_iterator(begin());
+ }
+
+ size_type size() const { return size_type(end() - begin()); }
+ size_type max_size() const { return size_type(-1); }
+ size_type capacity() const {
+ return size_type(const_iterator(_M_end_of_storage, 0) - begin());
+ }
+ bool empty() const { return begin() == end(); }
+
+ reference operator[](size_type __n)
+ { return *(begin() + difference_type(__n)); }
+ const_reference operator[](size_type __n) const
+ { return *(begin() + difference_type(__n)); }
+
+ void _M_range_check(size_type __n) const {
+ if (__n >= this->size())
+ __throw_range_error("vector<bool>");
+ }
+
+ reference at(size_type __n)
+ { _M_range_check(__n); return (*this)[__n]; }
+ const_reference at(size_type __n) const
+ { _M_range_check(__n); return (*this)[__n]; }
+
+ explicit vector(const allocator_type& __a = allocator_type())
+ : _Bvector_base<_Alloc>(__a) {}
+
+ vector(size_type __n, bool __value,
+ const allocator_type& __a = allocator_type())
+ : _Bvector_base<_Alloc>(__a)
+ {
+ _M_initialize(__n);
+ fill(_M_start._M_p, _M_end_of_storage, __value ? ~0 : 0);
+ }
+
+ explicit vector(size_type __n)
+ : _Bvector_base<_Alloc>(allocator_type())
+ {
+ _M_initialize(__n);
+ fill(_M_start._M_p, _M_end_of_storage, 0);
+ }
+
+ vector(const vector& __x) : _Bvector_base<_Alloc>(__x.get_allocator()) {
+ _M_initialize(__x.size());
+ copy(__x.begin(), __x.end(), _M_start);
+ }
+
+ // Check whether it's an integral type. If so, it's not an iterator.
+
+ template <class _Integer>
+ void _M_initialize_dispatch(_Integer __n, _Integer __x, __true_type) {
+ _M_initialize(__n);
+ fill(_M_start._M_p, _M_end_of_storage, __x ? ~0 : 0);
+ }
+
+ template <class _InputIterator>
+ void _M_initialize_dispatch(_InputIterator __first, _InputIterator __last,
+ __false_type) {
+ _M_initialize_range(__first, __last, __iterator_category(__first));
+ }
+
+ template <class _InputIterator>
+ vector(_InputIterator __first, _InputIterator __last,
+ const allocator_type& __a = allocator_type())
+ : _Bvector_base<_Alloc>(__a)
+ {
+ typedef typename _Is_integer<_InputIterator>::_Integral _Integral;
+ _M_initialize_dispatch(__first, __last, _Integral());
+ }
+
+ ~vector() { }
+
+ vector& operator=(const vector& __x) {
+ if (&__x == this) return *this;
+ if (__x.size() > capacity()) {
+ _M_deallocate();
+ _M_initialize(__x.size());
+ }
+ copy(__x.begin(), __x.end(), begin());
+ _M_finish = begin() + difference_type(__x.size());
+ return *this;
+ }
+
+ // assign(), a generalized assignment member function. Two
+ // versions: one that takes a count, and one that takes a range.
+ // The range version is a member template, so we dispatch on whether
+ // or not the type is an integer.
+
+ void _M_fill_assign(size_t __n, bool __x) {
+ if (__n > size()) {
+ fill(_M_start._M_p, _M_end_of_storage, __x ? ~0 : 0);
+ insert(end(), __n - size(), __x);
+ }
+ else {
+ erase(begin() + __n, end());
+ fill(_M_start._M_p, _M_end_of_storage, __x ? ~0 : 0);
+ }
+ }
+
+ void assign(size_t __n, bool __x) { _M_fill_assign(__n, __x); }
+
+ template <class _InputIterator>
+ void assign(_InputIterator __first, _InputIterator __last) {
+ typedef typename _Is_integer<_InputIterator>::_Integral _Integral;
+ _M_assign_dispatch(__first, __last, _Integral());
+ }
+
+ template <class _Integer>
+ void _M_assign_dispatch(_Integer __n, _Integer __val, __true_type)
+ { _M_fill_assign((size_t) __n, (bool) __val); }
+
+ template <class _InputIter>
+ void _M_assign_dispatch(_InputIter __first, _InputIter __last, __false_type)
+ { _M_assign_aux(__first, __last, __iterator_category(__first)); }
+
+ template <class _InputIterator>
+ void _M_assign_aux(_InputIterator __first, _InputIterator __last,
+ input_iterator_tag) {
+ iterator __cur = begin();
+ for ( ; __first != __last && __cur != end(); ++__cur, ++__first)
+ *__cur = *__first;
+ if (__first == __last)
+ erase(__cur, end());
+ else
+ insert(end(), __first, __last);
+ }
+
+ template <class _ForwardIterator>
+ void _M_assign_aux(_ForwardIterator __first, _ForwardIterator __last,
+ forward_iterator_tag) {
+ size_type __len = 0;
+ distance(__first, __last, __len);
+ if (__len < size())
+ erase(copy(__first, __last, begin()), end());
+ else {
+ _ForwardIterator __mid = __first;
+ advance(__mid, size());
+ copy(__first, __mid, begin());
+ insert(end(), __mid, __last);
+ }
+ }
+
+ void reserve(size_type __n) {
+ if (capacity() < __n) {
+ unsigned int* __q = _M_bit_alloc(__n);
+ _M_finish = copy(begin(), end(), iterator(__q, 0));
+ _M_deallocate();
+ _M_start = iterator(__q, 0);
+ _M_end_of_storage = __q + (__n + __WORD_BIT - 1)/__WORD_BIT;
+ }
+ }
+
+ reference front() { return *begin(); }
+ const_reference front() const { return *begin(); }
+ reference back() { return *(end() - 1); }
+ const_reference back() const { return *(end() - 1); }
+ void push_back(bool __x) {
+ if (_M_finish._M_p != _M_end_of_storage)
+ *_M_finish++ = __x;
+ else
+ _M_insert_aux(end(), __x);
+ }
+ void swap(vector<bool, _Alloc>& __x) {
+ std::swap(_M_start, __x._M_start);
+ std::swap(_M_finish, __x._M_finish);
+ std::swap(_M_end_of_storage, __x._M_end_of_storage);
+ }
+ iterator insert(iterator __position, bool __x = bool()) {
+ difference_type __n = __position - begin();
+ if (_M_finish._M_p != _M_end_of_storage && __position == end())
+ *_M_finish++ = __x;
+ else
+ _M_insert_aux(__position, __x);
+ return begin() + __n;
+ }
+
+ // Check whether it's an integral type. If so, it's not an iterator.
+
+ template <class _Integer>
+ void _M_insert_dispatch(iterator __pos, _Integer __n, _Integer __x,
+ __true_type) {
+ _M_fill_insert(__pos, __n, __x);
+ }
+
+ template <class _InputIterator>
+ void _M_insert_dispatch(iterator __pos,
+ _InputIterator __first, _InputIterator __last,
+ __false_type) {
+ _M_insert_range(__pos, __first, __last, __iterator_category(__first));
+ }
+
+ template <class _InputIterator>
+ void insert(iterator __position,
+ _InputIterator __first, _InputIterator __last) {
+ typedef typename _Is_integer<_InputIterator>::_Integral _Integral;
+ _M_insert_dispatch(__position, __first, __last, _Integral());
+ }
+
+ void _M_fill_insert(iterator __position, size_type __n, bool __x) {
+ if (__n == 0) return;
+ if (capacity() - size() >= __n) {
+ copy_backward(__position, end(), _M_finish + difference_type(__n));
+ fill(__position, __position + difference_type(__n), __x);
+ _M_finish += difference_type(__n);
+ }
+ else {
+ size_type __len = size() + max(size(), __n);
+ unsigned int* __q = _M_bit_alloc(__len);
+ iterator __i = copy(begin(), __position, iterator(__q, 0));
+ fill_n(__i, __n, __x);
+ _M_finish = copy(__position, end(), __i + difference_type(__n));
+ _M_deallocate();
+ _M_end_of_storage = __q + (__len + __WORD_BIT - 1)/__WORD_BIT;
+ _M_start = iterator(__q, 0);
+ }
+ }
+
+ void insert(iterator __position, size_type __n, bool __x) {
+ _M_fill_insert(__position, __n, __x);
+ }
+
+ void pop_back() { --_M_finish; }
+ iterator erase(iterator __position) {
+ if (__position + 1 != end())
+ copy(__position + 1, end(), __position);
+ --_M_finish;
+ return __position;
+ }
+ iterator erase(iterator __first, iterator __last) {
+ _M_finish = copy(__last, end(), __first);
+ return __first;
+ }
+ void resize(size_type __new_size, bool __x = bool()) {
+ if (__new_size < size())
+ erase(begin() + difference_type(__new_size), end());
+ else
+ insert(end(), __new_size - size(), __x);
+ }
+ void flip() {
+ for (unsigned int* __p = _M_start._M_p; __p != _M_end_of_storage; ++__p)
+ *__p = ~*__p;
+ }
+
+ void clear() { erase(begin(), end()); }
+ };
+
+// This typedef is non-standard. It is provided for backward compatibility.
+typedef vector<bool, alloc> bit_vector;
+
+} // namespace std
+
+#endif /* __SGI_STL_INTERNAL_BVECTOR_H */
+
+// Local Variables:
+// mode:C++
+// End:
diff --git a/libstdc++-v3/include/bits/stl_config.h b/libstdc++-v3/include/bits/stl_config.h
index d5301e2a5a3..afeddad71bb 100644
--- a/libstdc++-v3/include/bits/stl_config.h
+++ b/libstdc++-v3/include/bits/stl_config.h
@@ -265,7 +265,9 @@
# define __SGI_STL_USE_AUTO_PTR_CONVERSIONS
# define __STL_HAS_NAMESPACES
# define __STL_USE_NAMESPACES
-# define __STL_USE_EXCEPTIONS
+# ifdef __EXCEPTIONS
+# define __STL_USE_EXCEPTIONS
+# endif
# define __STL_THROW_RANGE_ERRORS
# define __STL_CAN_THROW_RANGE_ERRORS
# define __STL_USE_STD_ALLOCATORS
@@ -554,12 +556,15 @@
# define __STL_VOLATILE
#endif
+// Because concept-checks do not presently work correctly, they
+// are disabled.
+#if 0
#if defined(__STL_CLASS_PARTIAL_SPECIALIZATION) \
&& defined(__STL_MEMBER_TEMPLATES) \
&& !defined(_STL_NO_CONCEPT_CHECKS)
# define __STL_USE_CONCEPT_CHECKS
#endif
-
+#endif
#endif /* __STL_CONFIG_H */
diff --git a/libstdc++-v3/include/bits/stl_construct.h b/libstdc++-v3/include/bits/stl_construct.h
index c23b77ea993..92f4b1ae004 100644
--- a/libstdc++-v3/include/bits/stl_construct.h
+++ b/libstdc++-v3/include/bits/stl_construct.h
@@ -1,3 +1,32 @@
+// nonstandard construct and destroy functions -*- C++ -*-
+
+// Copyright (C) 2001 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.
+
/*
*
* Copyright (c) 1994
@@ -33,7 +62,8 @@
#include <new>
-__STL_BEGIN_NAMESPACE
+namespace std
+{
// construct and destroy. These functions are not part of the C++ standard,
// and are provided for backward compatibility with the HP STL. We also
@@ -80,7 +110,7 @@ __destroy(_ForwardIterator __first, _ForwardIterator __last, _Tp*)
template <class _ForwardIterator>
inline void _Destroy(_ForwardIterator __first, _ForwardIterator __last) {
- __destroy(__first, __last, __VALUE_TYPE(__first));
+ __destroy(__first, __last, __value_type(__first));
}
inline void _Destroy(char*, char*) {}
@@ -88,9 +118,7 @@ inline void _Destroy(int*, int*) {}
inline void _Destroy(long*, long*) {}
inline void _Destroy(float*, float*) {}
inline void _Destroy(double*, double*) {}
-#ifdef __STL_HAS_WCHAR_T
inline void _Destroy(wchar_t*, wchar_t*) {}
-#endif /* __STL_HAS_WCHAR_T */
// --------------------------------------------------
// Old names from the HP STL.
@@ -115,7 +143,7 @@ inline void destroy(_ForwardIterator __first, _ForwardIterator __last) {
_Destroy(__first, __last);
}
-__STL_END_NAMESPACE
+} // namespace std
#endif /* _CPP_BITS_STL_CONSTRUCT_H */
diff --git a/libstdc++-v3/include/bits/stl_deque.h b/libstdc++-v3/include/bits/stl_deque.h
index 0ad596eb3b9..a0095ade4ee 100644
--- a/libstdc++-v3/include/bits/stl_deque.h
+++ b/libstdc++-v3/include/bits/stl_deque.h
@@ -1,3 +1,32 @@
+// deque implementation -*- C++ -*-
+
+// Copyright (C) 2001 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.
+
/*
*
* Copyright (c) 1994
@@ -28,7 +57,9 @@
* You should not attempt to use it directly.
*/
-#include <bits/concept_checks.h>
+#include <bits/concept_check.h>
+#include <bits/stl_iterator_base_types.h>
+#include <bits/stl_iterator_base_funcs.h>
#ifndef __SGI_STL_INTERNAL_DEQUE_H
#define __SGI_STL_INTERNAL_DEQUE_H
@@ -67,12 +98,8 @@
* template template parameters), and it has been removed.
*/
-__STL_BEGIN_NAMESPACE
-
-#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
-#pragma set woff 1174
-#pragma set woff 1375
-#endif
+namespace std
+{
// Note: this function is simply a kludge to work around several compilers'
// bugs in handling constant expressions.
@@ -110,9 +137,7 @@ struct _Deque_iterator {
_M_last(__x._M_last), _M_node(__x._M_node) {}
reference operator*() const { return *_M_cur; }
-#ifndef __SGI_STL_NO_ARROW_OPERATOR
pointer operator->() const { return _M_cur; }
-#endif /* __SGI_STL_NO_ARROW_OPERATOR */
difference_type operator-(const _Self& __x) const {
return difference_type(_S_buffer_size()) * (_M_node - __x._M_node - 1) +
@@ -202,24 +227,6 @@ operator+(ptrdiff_t __n, const _Deque_iterator<_Tp, _Ref, _Ptr>& __x)
return __x + __n;
}
-#ifndef __STL_CLASS_PARTIAL_SPECIALIZATION
-
-template <class _Tp, class _Ref, class _Ptr>
-inline random_access_iterator_tag
-iterator_category(const _Deque_iterator<_Tp,_Ref,_Ptr>&)
-{
- return random_access_iterator_tag();
-}
-
-template <class _Tp, class _Ref, class _Ptr>
-inline _Tp* value_type(const _Deque_iterator<_Tp,_Ref,_Ptr>&) { return 0; }
-
-template <class _Tp, class _Ref, class _Ptr>
-inline ptrdiff_t* distance_type(const _Deque_iterator<_Tp,_Ref,_Ptr>&) {
- return 0;
-}
-
-#endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */
// Deque base class. It has two purposes. First, its constructor
// and destructor allocate (but don't initialize) storage. This makes
@@ -227,8 +234,6 @@ inline ptrdiff_t* distance_type(const _Deque_iterator<_Tp,_Ref,_Ptr>&) {
// the differences between SGI-style allocators and standard-conforming
// allocators.
-#ifdef __STL_USE_STD_ALLOCATORS
-
// Base class for ordinary allocators.
template <class _Tp, class _Alloc, bool __is_static>
class _Deque_alloc_base {
@@ -323,52 +328,6 @@ protected:
iterator _M_finish;
};
-#else /* __STL_USE_STD_ALLOCATORS */
-
-template <class _Tp, class _Alloc>
-class _Deque_base {
-public:
- typedef _Deque_iterator<_Tp,_Tp&,_Tp*> iterator;
- typedef _Deque_iterator<_Tp,const _Tp&,const _Tp*> const_iterator;
-
- typedef _Alloc allocator_type;
- allocator_type get_allocator() const { return allocator_type(); }
-
- _Deque_base(const allocator_type&, size_t __num_elements)
- : _M_map(0), _M_map_size(0), _M_start(), _M_finish() {
- _M_initialize_map(__num_elements);
- }
- _Deque_base(const allocator_type&)
- : _M_map(0), _M_map_size(0), _M_start(), _M_finish() {}
- ~_Deque_base();
-
-protected:
- void _M_initialize_map(size_t);
- void _M_create_nodes(_Tp** __nstart, _Tp** __nfinish);
- void _M_destroy_nodes(_Tp** __nstart, _Tp** __nfinish);
- enum { _S_initial_map_size = 8 };
-
-protected:
- _Tp** _M_map;
- size_t _M_map_size;
- iterator _M_start;
- iterator _M_finish;
-
- typedef simple_alloc<_Tp, _Alloc> _Node_alloc_type;
- typedef simple_alloc<_Tp*, _Alloc> _Map_alloc_type;
-
- _Tp* _M_allocate_node()
- { return _Node_alloc_type::allocate(__deque_buf_size(sizeof(_Tp))); }
- void _M_deallocate_node(_Tp* __p)
- { _Node_alloc_type::deallocate(__p, __deque_buf_size(sizeof(_Tp))); }
- _Tp** _M_allocate_map(size_t __n)
- { return _Map_alloc_type::allocate(__n); }
- void _M_deallocate_map(_Tp** __p, size_t __n)
- { _Map_alloc_type::deallocate(__p, __n); }
-};
-
-#endif /* __STL_USE_STD_ALLOCATORS */
-
// Non-inline member functions from _Deque_base.
template <class _Tp, class _Alloc>
@@ -423,12 +382,11 @@ _Deque_base<_Tp,_Alloc>::_M_destroy_nodes(_Tp** __nstart, _Tp** __nfinish)
_M_deallocate_node(*__n);
}
-template <class _Tp, class _Alloc = __STL_DEFAULT_ALLOCATOR(_Tp) >
+template <class _Tp, class _Alloc = allocator<_Tp> >
class deque : protected _Deque_base<_Tp, _Alloc> {
- // requirements:
-
- __STL_CLASS_REQUIRES(_Tp, _Assignable);
+ // concept requirements
+ __glibcpp_class_requires(_Tp, _SGIAssignableConcept);
typedef _Deque_base<_Tp, _Alloc> _Base;
public: // Basic types
@@ -447,23 +405,14 @@ public: // Iterators
typedef typename _Base::iterator iterator;
typedef typename _Base::const_iterator const_iterator;
-#ifdef __STL_CLASS_PARTIAL_SPECIALIZATION
typedef reverse_iterator<const_iterator> const_reverse_iterator;
typedef reverse_iterator<iterator> reverse_iterator;
-#else /* __STL_CLASS_PARTIAL_SPECIALIZATION */
- typedef reverse_iterator<const_iterator, value_type, const_reference,
- difference_type>
- const_reverse_iterator;
- typedef reverse_iterator<iterator, value_type, reference, difference_type>
- reverse_iterator;
-#endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */
protected: // Internal typedefs
typedef pointer* _Map_pointer;
static size_t _S_buffer_size() { return __deque_buf_size(sizeof(_Tp)); }
protected:
-#ifdef __STL_USE_NAMESPACES
using _Base::_M_initialize_map;
using _Base::_M_create_nodes;
using _Base::_M_destroy_nodes;
@@ -476,7 +425,6 @@ protected:
using _Base::_M_map_size;
using _Base::_M_start;
using _Base::_M_finish;
-#endif /* __STL_USE_NAMESPACES */
public: // Basic accessors
iterator begin() { return _M_start; }
@@ -496,17 +444,15 @@ public: // Basic accessors
const_reference operator[](size_type __n) const
{ return _M_start[difference_type(__n)]; }
-#ifdef __STL_THROW_RANGE_ERRORS
void _M_range_check(size_type __n) const {
if (__n >= this->size())
- __stl_throw_range_error("deque");
+ __throw_range_error("deque");
}
reference at(size_type __n)
{ _M_range_check(__n); return (*this)[__n]; }
const_reference at(size_type __n) const
{ _M_range_check(__n); return (*this)[__n]; }
-#endif /* __STL_THROW_RANGE_ERRORS */
reference front() { return *_M_start; }
reference back() {
@@ -536,8 +482,6 @@ public: // Constructor, destructor.
explicit deque(size_type __n) : _Base(allocator_type(), __n)
{ _M_fill_initialize(value_type()); }
-#ifdef __STL_MEMBER_TEMPLATES
-
// Check whether it's an integral type. If so, it's not an iterator.
template <class _InputIterator>
deque(_InputIterator __first, _InputIterator __last,
@@ -555,22 +499,9 @@ public: // Constructor, destructor.
template <class _InputIter>
void _M_initialize_dispatch(_InputIter __first, _InputIter __last,
__false_type) {
- _M_range_initialize(__first, __last, __ITERATOR_CATEGORY(__first));
+ _M_range_initialize(__first, __last, __iterator_category(__first));
}
-#else /* __STL_MEMBER_TEMPLATES */
-
- deque(const value_type* __first, const value_type* __last,
- const allocator_type& __a = allocator_type())
- : _Base(__a, __last - __first)
- { uninitialized_copy(__first, __last, _M_start); }
- deque(const_iterator __first, const_iterator __last,
- const allocator_type& __a = allocator_type())
- : _Base(__a, __last - __first)
- { uninitialized_copy(__first, __last, _M_start); }
-
-#endif /* __STL_MEMBER_TEMPLATES */
-
~deque() { destroy(_M_start, _M_finish); }
deque& operator= (const deque& __x) {
@@ -588,10 +519,10 @@ public: // Constructor, destructor.
}
void swap(deque& __x) {
- __STD::swap(_M_start, __x._M_start);
- __STD::swap(_M_finish, __x._M_finish);
- __STD::swap(_M_map, __x._M_map);
- __STD::swap(_M_map_size, __x._M_map_size);
+ std::swap(_M_start, __x._M_start);
+ std::swap(_M_finish, __x._M_finish);
+ std::swap(_M_map, __x._M_map);
+ std::swap(_M_map_size, __x._M_map_size);
}
public:
@@ -615,8 +546,6 @@ public:
_M_fill_assign(__n, __val);
}
-#ifdef __STL_MEMBER_TEMPLATES
-
template <class _InputIterator>
void assign(_InputIterator __first, _InputIterator __last) {
typedef typename _Is_integer<_InputIterator>::_Integral _Integral;
@@ -632,7 +561,7 @@ private: // helper functions for assign()
template <class _InputIterator>
void _M_assign_dispatch(_InputIterator __first, _InputIterator __last,
__false_type) {
- _M_assign_aux(__first, __last, __ITERATOR_CATEGORY(__first));
+ _M_assign_aux(__first, __last, __iterator_category(__first));
}
template <class _InputIterator>
@@ -654,8 +583,6 @@ private: // helper functions for assign()
erase(copy(__first, __last, begin()), end());
}
-#endif /* __STL_MEMBER_TEMPLATES */
-
public: // push_* and pop_*
void push_back(const value_type& __t) {
@@ -739,8 +666,6 @@ public: // Insert
void _M_fill_insert(iterator __pos, size_type __n, const value_type& __x);
-#ifdef __STL_MEMBER_TEMPLATES
-
// Check whether it's an integral type. If so, it's not an iterator.
template <class _InputIterator>
void insert(iterator __pos, _InputIterator __first, _InputIterator __last) {
@@ -758,18 +683,9 @@ public: // Insert
void _M_insert_dispatch(iterator __pos,
_InputIterator __first, _InputIterator __last,
__false_type) {
- insert(__pos, __first, __last, __ITERATOR_CATEGORY(__first));
+ insert(__pos, __first, __last, __iterator_category(__first));
}
-#else /* __STL_MEMBER_TEMPLATES */
-
- void insert(iterator __pos,
- const value_type* __first, const value_type* __last);
- void insert(iterator __pos,
- const_iterator __first, const_iterator __last);
-
-#endif /* __STL_MEMBER_TEMPLATES */
-
void resize(size_type __new_size, const value_type& __x) {
const size_type __len = size();
if (__new_size < __len)
@@ -803,8 +719,6 @@ protected: // Internal construction/destruction
void _M_fill_initialize(const value_type& __value);
-#ifdef __STL_MEMBER_TEMPLATES
-
template <class _InputIterator>
void _M_range_initialize(_InputIterator __first, _InputIterator __last,
input_iterator_tag);
@@ -813,8 +727,6 @@ protected: // Internal construction/destruction
void _M_range_initialize(_ForwardIterator __first, _ForwardIterator __last,
forward_iterator_tag);
-#endif /* __STL_MEMBER_TEMPLATES */
-
protected: // Internal push_* and pop_*
void _M_push_back_aux(const value_type&);
@@ -826,8 +738,6 @@ protected: // Internal push_* and pop_*
protected: // Internal insert functions
-#ifdef __STL_MEMBER_TEMPLATES
-
template <class _InputIterator>
void insert(iterator __pos, _InputIterator __first, _InputIterator __last,
input_iterator_tag);
@@ -837,31 +747,15 @@ protected: // Internal insert functions
_ForwardIterator __first, _ForwardIterator __last,
forward_iterator_tag);
-#endif /* __STL_MEMBER_TEMPLATES */
-
iterator _M_insert_aux(iterator __pos, const value_type& __x);
iterator _M_insert_aux(iterator __pos);
void _M_insert_aux(iterator __pos, size_type __n, const value_type& __x);
-#ifdef __STL_MEMBER_TEMPLATES
-
template <class _ForwardIterator>
void _M_insert_aux(iterator __pos,
_ForwardIterator __first, _ForwardIterator __last,
size_type __n);
-#else /* __STL_MEMBER_TEMPLATES */
-
- void _M_insert_aux(iterator __pos,
- const value_type* __first, const value_type* __last,
- size_type __n);
-
- void _M_insert_aux(iterator __pos,
- const_iterator __first, const_iterator __last,
- size_type __n);
-
-#endif /* __STL_MEMBER_TEMPLATES */
-
iterator _M_reserve_elements_at_front(size_type __n) {
size_type __vacancies = _M_start._M_cur - _M_start._M_first;
if (__n > __vacancies)
@@ -900,8 +794,6 @@ protected: // Allocation of _M_map and nodes
// Non-inline member functions
-#ifdef __STL_MEMBER_TEMPLATES
-
template <class _Tp, class _Alloc>
template <class _InputIter>
void deque<_Tp, _Alloc>
@@ -916,8 +808,6 @@ void deque<_Tp, _Alloc>
insert(end(), __first, __last);
}
-#endif /* __STL_MEMBER_TEMPLATES */
-
template <class _Tp, class _Alloc>
void deque<_Tp, _Alloc>::_M_fill_insert(iterator __pos,
size_type __n, const value_type& __x)
@@ -943,62 +833,6 @@ void deque<_Tp, _Alloc>::_M_fill_insert(iterator __pos,
_M_insert_aux(__pos, __n, __x);
}
-#ifndef __STL_MEMBER_TEMPLATES
-
-template <class _Tp, class _Alloc>
-void deque<_Tp, _Alloc>::insert(iterator __pos,
- const value_type* __first,
- const value_type* __last) {
- size_type __n = __last - __first;
- if (__pos._M_cur == _M_start._M_cur) {
- iterator __new_start = _M_reserve_elements_at_front(__n);
- __STL_TRY {
- uninitialized_copy(__first, __last, __new_start);
- _M_start = __new_start;
- }
- __STL_UNWIND(_M_destroy_nodes(__new_start._M_node, _M_start._M_node));
- }
- else if (__pos._M_cur == _M_finish._M_cur) {
- iterator __new_finish = _M_reserve_elements_at_back(__n);
- __STL_TRY {
- uninitialized_copy(__first, __last, _M_finish);
- _M_finish = __new_finish;
- }
- __STL_UNWIND(_M_destroy_nodes(_M_finish._M_node + 1,
- __new_finish._M_node + 1));
- }
- else
- _M_insert_aux(__pos, __first, __last, __n);
-}
-
-template <class _Tp, class _Alloc>
-void deque<_Tp,_Alloc>::insert(iterator __pos,
- const_iterator __first, const_iterator __last)
-{
- size_type __n = __last - __first;
- if (__pos._M_cur == _M_start._M_cur) {
- iterator __new_start = _M_reserve_elements_at_front(__n);
- __STL_TRY {
- uninitialized_copy(__first, __last, __new_start);
- _M_start = __new_start;
- }
- __STL_UNWIND(_M_destroy_nodes(__new_start._M_node, _M_start._M_node));
- }
- else if (__pos._M_cur == _M_finish._M_cur) {
- iterator __new_finish = _M_reserve_elements_at_back(__n);
- __STL_TRY {
- uninitialized_copy(__first, __last, _M_finish);
- _M_finish = __new_finish;
- }
- __STL_UNWIND(_M_destroy_nodes(_M_finish._M_node + 1,
- __new_finish._M_node + 1));
- }
- else
- _M_insert_aux(__pos, __first, __last, __n);
-}
-
-#endif /* __STL_MEMBER_TEMPLATES */
-
template <class _Tp, class _Alloc>
typename deque<_Tp,_Alloc>::iterator
deque<_Tp,_Alloc>::erase(iterator __first, iterator __last)
@@ -1014,7 +848,7 @@ deque<_Tp,_Alloc>::erase(iterator __first, iterator __last)
copy_backward(_M_start, __first, __last);
iterator __new_start = _M_start + __n;
destroy(_M_start, __new_start);
- _M_destroy_nodes(__new_start._M_node, _M_start._M_node);
+ _M_destroy_nodes(_M_start._M_node, __new_start._M_node);
_M_start = __new_start;
}
else {
@@ -1062,8 +896,6 @@ void deque<_Tp,_Alloc>::_M_fill_initialize(const value_type& __value) {
__STL_UNWIND(destroy(_M_start, iterator(*__cur, __cur)));
}
-#ifdef __STL_MEMBER_TEMPLATES
-
template <class _Tp, class _Alloc> template <class _InputIterator>
void deque<_Tp,_Alloc>::_M_range_initialize(_InputIterator __first,
_InputIterator __last,
@@ -1101,8 +933,6 @@ void deque<_Tp,_Alloc>::_M_range_initialize(_ForwardIterator __first,
__STL_UNWIND(destroy(_M_start, iterator(*__cur_node, __cur_node)));
}
-#endif /* __STL_MEMBER_TEMPLATES */
-
// Called only if _M_finish._M_cur == _M_finish._M_last - 1.
template <class _Tp, class _Alloc>
void deque<_Tp,_Alloc>::_M_push_back_aux(const value_type& __t)
@@ -1184,8 +1014,6 @@ void deque<_Tp,_Alloc>::_M_pop_front_aux()
_M_start._M_cur = _M_start._M_first;
}
-#ifdef __STL_MEMBER_TEMPLATES
-
template <class _Tp, class _Alloc> template <class _InputIterator>
void deque<_Tp,_Alloc>::insert(iterator __pos,
_InputIterator __first, _InputIterator __last,
@@ -1222,8 +1050,6 @@ deque<_Tp,_Alloc>::insert(iterator __pos,
_M_insert_aux(__pos, __first, __last, __n);
}
-#endif /* __STL_MEMBER_TEMPLATES */
-
template <class _Tp, class _Alloc>
typename deque<_Tp, _Alloc>::iterator
deque<_Tp,_Alloc>::_M_insert_aux(iterator __pos, const value_type& __x)
@@ -1338,8 +1164,6 @@ void deque<_Tp,_Alloc>::_M_insert_aux(iterator __pos,
}
}
-#ifdef __STL_MEMBER_TEMPLATES
-
template <class _Tp, class _Alloc> template <class _ForwardIterator>
void deque<_Tp,_Alloc>::_M_insert_aux(iterator __pos,
_ForwardIterator __first,
@@ -1398,122 +1222,6 @@ void deque<_Tp,_Alloc>::_M_insert_aux(iterator __pos,
}
}
-#else /* __STL_MEMBER_TEMPLATES */
-
-template <class _Tp, class _Alloc>
-void deque<_Tp,_Alloc>::_M_insert_aux(iterator __pos,
- const value_type* __first,
- const value_type* __last,
- size_type __n)
-{
- const difference_type __elemsbefore = __pos - _M_start;
- size_type __length = size();
- if (__elemsbefore < __length / 2) {
- iterator __new_start = _M_reserve_elements_at_front(__n);
- iterator __old_start = _M_start;
- __pos = _M_start + __elemsbefore;
- __STL_TRY {
- if (__elemsbefore >= difference_type(__n)) {
- iterator __start_n = _M_start + difference_type(__n);
- uninitialized_copy(_M_start, __start_n, __new_start);
- _M_start = __new_start;
- copy(__start_n, __pos, __old_start);
- copy(__first, __last, __pos - difference_type(__n));
- }
- else {
- const value_type* __mid =
- __first + (difference_type(__n) - __elemsbefore);
- __uninitialized_copy_copy(_M_start, __pos, __first, __mid,
- __new_start);
- _M_start = __new_start;
- copy(__mid, __last, __old_start);
- }
- }
- __STL_UNWIND(_M_destroy_nodes(__new_start._M_node, _M_start._M_node));
- }
- else {
- iterator __new_finish = _M_reserve_elements_at_back(__n);
- iterator __old_finish = _M_finish;
- const difference_type __elemsafter =
- difference_type(__length) - __elemsbefore;
- __pos = _M_finish - __elemsafter;
- __STL_TRY {
- if (__elemsafter > difference_type(__n)) {
- iterator __finish_n = _M_finish - difference_type(__n);
- uninitialized_copy(__finish_n, _M_finish, _M_finish);
- _M_finish = __new_finish;
- copy_backward(__pos, __finish_n, __old_finish);
- copy(__first, __last, __pos);
- }
- else {
- const value_type* __mid = __first + __elemsafter;
- __uninitialized_copy_copy(__mid, __last, __pos, _M_finish, _M_finish);
- _M_finish = __new_finish;
- copy(__first, __mid, __pos);
- }
- }
- __STL_UNWIND(_M_destroy_nodes(_M_finish._M_node + 1,
- __new_finish._M_node + 1));
- }
-}
-
-template <class _Tp, class _Alloc>
-void deque<_Tp,_Alloc>::_M_insert_aux(iterator __pos,
- const_iterator __first,
- const_iterator __last,
- size_type __n)
-{
- const difference_type __elemsbefore = __pos - _M_start;
- size_type __length = size();
- if (__elemsbefore < __length / 2) {
- iterator __new_start = _M_reserve_elements_at_front(__n);
- iterator __old_start = _M_start;
- __pos = _M_start + __elemsbefore;
- __STL_TRY {
- if (__elemsbefore >= __n) {
- iterator __start_n = _M_start + __n;
- uninitialized_copy(_M_start, __start_n, __new_start);
- _M_start = __new_start;
- copy(__start_n, __pos, __old_start);
- copy(__first, __last, __pos - difference_type(__n));
- }
- else {
- const_iterator __mid = __first + (__n - __elemsbefore);
- __uninitialized_copy_copy(_M_start, __pos, __first, __mid,
- __new_start);
- _M_start = __new_start;
- copy(__mid, __last, __old_start);
- }
- }
- __STL_UNWIND(_M_destroy_nodes(__new_start._M_node, _M_start._M_node));
- }
- else {
- iterator __new_finish = _M_reserve_elements_at_back(__n);
- iterator __old_finish = _M_finish;
- const difference_type __elemsafter = __length - __elemsbefore;
- __pos = _M_finish - __elemsafter;
- __STL_TRY {
- if (__elemsafter > __n) {
- iterator __finish_n = _M_finish - difference_type(__n);
- uninitialized_copy(__finish_n, _M_finish, _M_finish);
- _M_finish = __new_finish;
- copy_backward(__pos, __finish_n, __old_finish);
- copy(__first, __last, __pos);
- }
- else {
- const_iterator __mid = __first + __elemsafter;
- __uninitialized_copy_copy(__mid, __last, __pos, _M_finish, _M_finish);
- _M_finish = __new_finish;
- copy(__first, __mid, __pos);
- }
- }
- __STL_UNWIND(_M_destroy_nodes(_M_finish._M_node + 1,
- __new_finish._M_node + 1));
- }
-}
-
-#endif /* __STL_MEMBER_TEMPLATES */
-
template <class _Tp, class _Alloc>
void deque<_Tp,_Alloc>::_M_new_elements_at_front(size_type __new_elems)
{
@@ -1606,8 +1314,6 @@ inline bool operator<(const deque<_Tp, _Alloc>& __x,
__y.begin(), __y.end());
}
-#ifdef __STL_FUNCTION_TMPL_PARTIAL_ORDER
-
template <class _Tp, class _Alloc>
inline bool operator!=(const deque<_Tp, _Alloc>& __x,
const deque<_Tp, _Alloc>& __y) {
@@ -1636,14 +1342,7 @@ inline void swap(deque<_Tp,_Alloc>& __x, deque<_Tp,_Alloc>& __y) {
__x.swap(__y);
}
-#endif /* __STL_FUNCTION_TMPL_PARTIAL_ORDER */
-
-#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
-#pragma reset woff 1174
-#pragma reset woff 1375
-#endif
-
-__STL_END_NAMESPACE
+} // namespace std
#endif /* __SGI_STL_INTERNAL_DEQUE_H */
diff --git a/libstdc++-v3/include/bits/stl_function.h b/libstdc++-v3/include/bits/stl_function.h
index fcaafac5668..c4396350873 100644
--- a/libstdc++-v3/include/bits/stl_function.h
+++ b/libstdc++-v3/include/bits/stl_function.h
@@ -1,3 +1,32 @@
+// Functor implementations -*- C++ -*-
+
+// Copyright (C) 2001 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.
+
/*
*
* Copyright (c) 1994
@@ -31,7 +60,8 @@
#ifndef __SGI_STL_INTERNAL_FUNCTION_H
#define __SGI_STL_INTERNAL_FUNCTION_H
-__STL_BEGIN_NAMESPACE
+namespace std
+{
template <class _Arg, class _Result>
struct unary_function {
@@ -198,6 +228,13 @@ public:
operator()(const typename _Operation::second_argument_type& __x) const {
return op(value, __x);
}
+#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
+ // 109. Missing binders for non-const sequence elements
+ typename _Operation::result_type
+ operator()(typename _Operation::second_argument_type& __x) const {
+ return op(value, __x);
+ }
+#endif
};
template <class _Operation, class _Tp>
@@ -223,6 +260,13 @@ public:
operator()(const typename _Operation::first_argument_type& __x) const {
return op(__x, value);
}
+#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
+ // 109. Missing binders for non-const sequence elements
+ typename _Operation::result_type
+ operator()(typename _Operation::first_argument_type& __x) const {
+ return op(__x, value);
+ }
+#endif
};
template <class _Operation, class _Tp>
@@ -589,8 +633,6 @@ private:
_Ret (_Tp::*_M_f)(_Arg) const;
};
-#ifdef __STL_CLASS_PARTIAL_SPECIALIZATION
-
template <class _Tp>
class mem_fun_t<void, _Tp> : public unary_function<_Tp*,void> {
public:
@@ -666,7 +708,6 @@ private:
void (_Tp::*_M_f)(_Arg) const;
};
-#endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */
// Mem_fun adaptor helper functions. There are only two:
// mem_fun and mem_fun_ref. (mem_fun1 and mem_fun1_ref
@@ -723,7 +764,7 @@ inline const_mem_fun1_ref_t<_Ret,_Tp,_Arg>
mem_fun1_ref(_Ret (_Tp::*__f)(_Arg) const)
{ return const_mem_fun1_ref_t<_Ret,_Tp,_Arg>(__f); }
-__STL_END_NAMESPACE
+} // namespace std
#endif /* __SGI_STL_INTERNAL_FUNCTION_H */
diff --git a/libstdc++-v3/include/bits/stl_heap.h b/libstdc++-v3/include/bits/stl_heap.h
index 3e7eaa456e5..20d0f000d1a 100644
--- a/libstdc++-v3/include/bits/stl_heap.h
+++ b/libstdc++-v3/include/bits/stl_heap.h
@@ -1,3 +1,32 @@
+// Heap implementation -*- C++ -*-
+
+// Copyright (C) 2001 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.
+
/*
*
* Copyright (c) 1994
@@ -30,11 +59,8 @@
#ifndef _CPP_BITS_STL_HEAP_H
#define _CPP_BITS_STL_HEAP_H 1
-__STL_BEGIN_NAMESPACE
-
-#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
-#pragma set woff 1209
-#endif
+namespace std
+{
// Heap-manipulation functions: push_heap, pop_heap, make_heap, sort_heap.
@@ -65,11 +91,14 @@ template <class _RandomAccessIterator>
inline void
push_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
{
- __STL_REQUIRES(_RandomAccessIterator, _Mutable_RandomAccessIterator);
- __STL_REQUIRES(typename iterator_traits<_RandomAccessIterator>::value_type,
- _LessThanComparable);
+ // concept requirements
+ __glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept<
+ _RandomAccessIterator>);
+ __glibcpp_function_requires(_LessThanComparableConcept<
+ typename iterator_traits<_RandomAccessIterator>::value_type>);
+
__push_heap_aux(__first, __last,
- __DISTANCE_TYPE(__first), __VALUE_TYPE(__first));
+ __distance_type(__first), __value_type(__first));
}
template <class _RandomAccessIterator, class _Distance, class _Tp,
@@ -103,9 +132,12 @@ inline void
push_heap(_RandomAccessIterator __first, _RandomAccessIterator __last,
_Compare __comp)
{
- __STL_REQUIRES(_RandomAccessIterator, _Mutable_RandomAccessIterator);
+ // concept requirements
+ __glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept<
+ _RandomAccessIterator>);
+
__push_heap_aux(__first, __last, __comp,
- __DISTANCE_TYPE(__first), __VALUE_TYPE(__first));
+ __distance_type(__first), __value_type(__first));
}
template <class _RandomAccessIterator, class _Distance, class _Tp>
@@ -144,17 +176,20 @@ __pop_heap_aux(_RandomAccessIterator __first, _RandomAccessIterator __last,
_Tp*)
{
__pop_heap(__first, __last - 1, __last - 1,
- _Tp(*(__last - 1)), __DISTANCE_TYPE(__first));
+ _Tp(*(__last - 1)), __distance_type(__first));
}
template <class _RandomAccessIterator>
inline void pop_heap(_RandomAccessIterator __first,
_RandomAccessIterator __last)
{
- __STL_REQUIRES(_RandomAccessIterator, _Mutable_RandomAccessIterator);
- __STL_REQUIRES(typename iterator_traits<_RandomAccessIterator>::value_type,
- _LessThanComparable);
- __pop_heap_aux(__first, __last, __VALUE_TYPE(__first));
+ // concept requirements
+ __glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept<
+ _RandomAccessIterator>);
+ __glibcpp_function_requires(_LessThanComparableConcept<
+ typename iterator_traits<_RandomAccessIterator>::value_type>);
+
+ __pop_heap_aux(__first, __last, __value_type(__first));
}
template <class _RandomAccessIterator, class _Distance,
@@ -197,7 +232,7 @@ __pop_heap_aux(_RandomAccessIterator __first,
_RandomAccessIterator __last, _Tp*, _Compare __comp)
{
__pop_heap(__first, __last - 1, __last - 1, _Tp(*(__last - 1)), __comp,
- __DISTANCE_TYPE(__first));
+ __distance_type(__first));
}
template <class _RandomAccessIterator, class _Compare>
@@ -205,8 +240,11 @@ inline void
pop_heap(_RandomAccessIterator __first,
_RandomAccessIterator __last, _Compare __comp)
{
- __STL_REQUIRES(_RandomAccessIterator, _Mutable_RandomAccessIterator);
- __pop_heap_aux(__first, __last, __VALUE_TYPE(__first), __comp);
+ // concept requirements
+ __glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept<
+ _RandomAccessIterator>);
+
+ __pop_heap_aux(__first, __last, __value_type(__first), __comp);
}
template <class _RandomAccessIterator, class _Tp, class _Distance>
@@ -229,11 +267,14 @@ template <class _RandomAccessIterator>
inline void
make_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
{
- __STL_REQUIRES(_RandomAccessIterator, _Mutable_RandomAccessIterator);
- __STL_REQUIRES(typename iterator_traits<_RandomAccessIterator>::value_type,
- _LessThanComparable);
+ // concept requirements
+ __glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept<
+ _RandomAccessIterator>);
+ __glibcpp_function_requires(_LessThanComparableConcept<
+ typename iterator_traits<_RandomAccessIterator>::value_type>);
+
__make_heap(__first, __last,
- __VALUE_TYPE(__first), __DISTANCE_TYPE(__first));
+ __value_type(__first), __distance_type(__first));
}
template <class _RandomAccessIterator, class _Compare,
@@ -259,17 +300,23 @@ inline void
make_heap(_RandomAccessIterator __first,
_RandomAccessIterator __last, _Compare __comp)
{
- __STL_REQUIRES(_RandomAccessIterator, _Mutable_RandomAccessIterator);
+ // concept requirements
+ __glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept<
+ _RandomAccessIterator>);
+
__make_heap(__first, __last, __comp,
- __VALUE_TYPE(__first), __DISTANCE_TYPE(__first));
+ __value_type(__first), __distance_type(__first));
}
template <class _RandomAccessIterator>
void sort_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
{
- __STL_REQUIRES(_RandomAccessIterator, _Mutable_RandomAccessIterator);
- __STL_REQUIRES(typename iterator_traits<_RandomAccessIterator>::value_type,
- _LessThanComparable);
+ // concept requirements
+ __glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept<
+ _RandomAccessIterator>);
+ __glibcpp_function_requires(_LessThanComparableConcept<
+ typename iterator_traits<_RandomAccessIterator>::value_type>);
+
while (__last - __first > 1)
pop_heap(__first, __last--);
}
@@ -279,16 +326,15 @@ void
sort_heap(_RandomAccessIterator __first,
_RandomAccessIterator __last, _Compare __comp)
{
- __STL_REQUIRES(_RandomAccessIterator, _Mutable_RandomAccessIterator);
+ // concept requirements
+ __glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept<
+ _RandomAccessIterator>);
+
while (__last - __first > 1)
pop_heap(__first, __last--, __comp);
}
-#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
-#pragma reset woff 1209
-#endif
-
-__STL_END_NAMESPACE
+} // namespace std
#endif /* _CPP_BITS_STL_HEAP_H */
diff --git a/libstdc++-v3/include/bits/stl_iterator.h b/libstdc++-v3/include/bits/stl_iterator.h
index ae8b0886653..b98c2dfb4c6 100644
--- a/libstdc++-v3/include/bits/stl_iterator.h
+++ b/libstdc++-v3/include/bits/stl_iterator.h
@@ -1,3 +1,32 @@
+// Iterators -*- C++ -*-
+
+// Copyright (C) 2001 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.
+
/*
*
* Copyright (c) 1994
@@ -31,8 +60,8 @@
#ifndef __SGI_STL_INTERNAL_ITERATOR_H
#define __SGI_STL_INTERNAL_ITERATOR_H
-__STL_BEGIN_NAMESPACE
-
+namespace std
+{
template <class _Container>
class back_insert_iterator {
@@ -57,17 +86,6 @@ public:
back_insert_iterator<_Container>& operator++(int) { return *this; }
};
-#ifndef __STL_CLASS_PARTIAL_SPECIALIZATION
-
-template <class _Container>
-inline output_iterator_tag
-iterator_category(const back_insert_iterator<_Container>&)
-{
- return output_iterator_tag();
-}
-
-#endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */
-
template <class _Container>
inline back_insert_iterator<_Container> back_inserter(_Container& __x) {
return back_insert_iterator<_Container>(__x);
@@ -96,17 +114,6 @@ public:
front_insert_iterator<_Container>& operator++(int) { return *this; }
};
-#ifndef __STL_CLASS_PARTIAL_SPECIALIZATION
-
-template <class _Container>
-inline output_iterator_tag
-iterator_category(const front_insert_iterator<_Container>&)
-{
- return output_iterator_tag();
-}
-
-#endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */
-
template <class _Container>
inline front_insert_iterator<_Container> front_inserter(_Container& __x) {
return front_insert_iterator<_Container>(__x);
@@ -138,17 +145,6 @@ public:
insert_iterator<_Container>& operator++(int) { return *this; }
};
-#ifndef __STL_CLASS_PARTIAL_SPECIALIZATION
-
-template <class _Container>
-inline output_iterator_tag
-iterator_category(const insert_iterator<_Container>&)
-{
- return output_iterator_tag();
-}
-
-#endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */
-
template <class _Container, class _Iterator>
inline
insert_iterator<_Container> inserter(_Container& __x, _Iterator __i)
@@ -179,9 +175,7 @@ public:
_BidirectionalIterator __tmp = current;
return *--__tmp;
}
-#ifndef __SGI_STL_NO_ARROW_OPERATOR
pointer operator->() const { return &(operator*()); }
-#endif /* __SGI_STL_NO_ARROW_OPERATOR */
_Self& operator++() {
--current;
return *this;
@@ -202,39 +196,6 @@ public:
}
};
-#ifndef __STL_CLASS_PARTIAL_SPECIALIZATION
-
-template <class _BidirectionalIterator, class _Tp, class _Reference,
- class _Distance>
-inline bidirectional_iterator_tag
-iterator_category(const reverse_bidirectional_iterator<_BidirectionalIterator,
- _Tp, _Reference,
- _Distance>&)
-{
- return bidirectional_iterator_tag();
-}
-
-template <class _BidirectionalIterator, class _Tp, class _Reference,
- class _Distance>
-inline _Tp*
-value_type(const reverse_bidirectional_iterator<_BidirectionalIterator, _Tp,
- _Reference, _Distance>&)
-{
- return (_Tp*) 0;
-}
-
-template <class _BidirectionalIterator, class _Tp, class _Reference,
- class _Distance>
-inline _Distance*
-distance_type(const reverse_bidirectional_iterator<_BidirectionalIterator,
- _Tp,
- _Reference, _Distance>&)
-{
- return (_Distance*) 0;
-}
-
-#endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */
-
template <class _BiIter, class _Tp, class _Ref, class _Distance>
inline bool operator==(
const reverse_bidirectional_iterator<_BiIter, _Tp, _Ref, _Distance>& __x,
@@ -243,8 +204,6 @@ inline bool operator==(
return __x.base() == __y.base();
}
-#ifdef __STL_FUNCTION_TMPL_PARTIAL_ORDER
-
template <class _BiIter, class _Tp, class _Ref, class _Distance>
inline bool operator!=(
const reverse_bidirectional_iterator<_BiIter, _Tp, _Ref, _Distance>& __x,
@@ -253,10 +212,6 @@ inline bool operator!=(
return !(__x == __y);
}
-#endif /* __STL_FUNCTION_TMPL_PARTIAL_ORDER */
-
-
-#ifdef __STL_CLASS_PARTIAL_SPECIALIZATION
// This is the new version of reverse_iterator, as defined in the
// draft C++ standard. It relies on the iterator_traits template,
@@ -289,20 +244,16 @@ public:
explicit reverse_iterator(iterator_type __x) : current(__x) {}
reverse_iterator(const _Self& __x) : current(__x.current) {}
-#ifdef __STL_MEMBER_TEMPLATES
template <class _Iter>
reverse_iterator(const reverse_iterator<_Iter>& __x)
: current(__x.base()) {}
-#endif /* __STL_MEMBER_TEMPLATES */
iterator_type base() const { return current; }
reference operator*() const {
_Iterator __tmp = current;
return *--__tmp;
}
-#ifndef __SGI_STL_NO_ARROW_OPERATOR
pointer operator->() const { return &(operator*()); }
-#endif /* __SGI_STL_NO_ARROW_OPERATOR */
_Self& operator++() {
--current;
@@ -352,8 +303,6 @@ inline bool operator<(const reverse_iterator<_Iterator>& __x,
return __y.base() < __x.base();
}
-#ifdef __STL_FUNCTION_TMPL_PARTIAL_ORDER
-
template <class _Iterator>
inline bool operator!=(const reverse_iterator<_Iterator>& __x,
const reverse_iterator<_Iterator>& __y) {
@@ -378,8 +327,6 @@ inline bool operator>=(const reverse_iterator<_Iterator>& __x,
return !(__x < __y);
}
-#endif /* __STL_FUNCTION_TMPL_PARTIAL_ORDER */
-
template <class _Iterator>
inline typename reverse_iterator<_Iterator>::difference_type
operator-(const reverse_iterator<_Iterator>& __x,
@@ -394,186 +341,6 @@ operator+(typename reverse_iterator<_Iterator>::difference_type __n,
return reverse_iterator<_Iterator>(__x.base() - __n);
}
-#else /* __STL_CLASS_PARTIAL_SPECIALIZATION */
-
-// This is the old version of reverse_iterator, as found in the original
-// HP STL. It does not use partial specialization.
-
-template <class _RandomAccessIterator, class _Tp, class _Reference = _Tp&,
- class _Distance = ptrdiff_t>
-class reverse_iterator {
- typedef reverse_iterator<_RandomAccessIterator, _Tp, _Reference, _Distance>
- _Self;
-protected:
- _RandomAccessIterator current;
-public:
- typedef random_access_iterator_tag iterator_category;
- typedef _Tp value_type;
- typedef _Distance difference_type;
- typedef _Tp* pointer;
- typedef _Reference reference;
-
- reverse_iterator() {}
- explicit reverse_iterator(_RandomAccessIterator __x) : current(__x) {}
- _RandomAccessIterator base() const { return current; }
- _Reference operator*() const { return *(current - 1); }
-#ifndef __SGI_STL_NO_ARROW_OPERATOR
- pointer operator->() const { return &(operator*()); }
-#endif /* __SGI_STL_NO_ARROW_OPERATOR */
- _Self& operator++() {
- --current;
- return *this;
- }
- _Self operator++(int) {
- _Self __tmp = *this;
- --current;
- return __tmp;
- }
- _Self& operator--() {
- ++current;
- return *this;
- }
- _Self operator--(int) {
- _Self __tmp = *this;
- ++current;
- return __tmp;
- }
- _Self operator+(_Distance __n) const {
- return _Self(current - __n);
- }
- _Self& operator+=(_Distance __n) {
- current -= __n;
- return *this;
- }
- _Self operator-(_Distance __n) const {
- return _Self(current + __n);
- }
- _Self& operator-=(_Distance __n) {
- current += __n;
- return *this;
- }
- _Reference operator[](_Distance __n) const { return *(*this + __n); }
-};
-
-template <class _RandomAccessIterator, class _Tp,
- class _Reference, class _Distance>
-inline random_access_iterator_tag
-iterator_category(const reverse_iterator<_RandomAccessIterator, _Tp,
- _Reference, _Distance>&)
-{
- return random_access_iterator_tag();
-}
-
-template <class _RandomAccessIterator, class _Tp,
- class _Reference, class _Distance>
-inline _Tp* value_type(const reverse_iterator<_RandomAccessIterator, _Tp,
- _Reference, _Distance>&)
-{
- return (_Tp*) 0;
-}
-
-template <class _RandomAccessIterator, class _Tp,
- class _Reference, class _Distance>
-inline _Distance*
-distance_type(const reverse_iterator<_RandomAccessIterator,
- _Tp, _Reference, _Distance>&)
-{
- return (_Distance*) 0;
-}
-
-
-template <class _RandomAccessIterator, class _Tp,
- class _Reference, class _Distance>
-inline bool
-operator==(const reverse_iterator<_RandomAccessIterator, _Tp,
- _Reference, _Distance>& __x,
- const reverse_iterator<_RandomAccessIterator, _Tp,
- _Reference, _Distance>& __y)
-{
- return __x.base() == __y.base();
-}
-
-template <class _RandomAccessIterator, class _Tp,
- class _Reference, class _Distance>
-inline bool
-operator<(const reverse_iterator<_RandomAccessIterator, _Tp,
- _Reference, _Distance>& __x,
- const reverse_iterator<_RandomAccessIterator, _Tp,
- _Reference, _Distance>& __y)
-{
- return __y.base() < __x.base();
-}
-
-#ifdef __STL_FUNCTION_TMPL_PARTIAL_ORDER
-
-template <class _RandomAccessIterator, class _Tp,
- class _Reference, class _Distance>
-inline bool
-operator!=(const reverse_iterator<_RandomAccessIterator, _Tp,
- _Reference, _Distance>& __x,
- const reverse_iterator<_RandomAccessIterator, _Tp,
- _Reference, _Distance>& __y) {
- return !(__x == __y);
-}
-
-template <class _RandomAccessIterator, class _Tp,
- class _Reference, class _Distance>
-inline bool
-operator>(const reverse_iterator<_RandomAccessIterator, _Tp,
- _Reference, _Distance>& __x,
- const reverse_iterator<_RandomAccessIterator, _Tp,
- _Reference, _Distance>& __y) {
- return __y < __x;
-}
-
-template <class _RandomAccessIterator, class _Tp,
- class _Reference, class _Distance>
-inline bool
-operator<=(const reverse_iterator<_RandomAccessIterator, _Tp,
- _Reference, _Distance>& __x,
- const reverse_iterator<_RandomAccessIterator, _Tp,
- _Reference, _Distance>& __y) {
- return !(__y < __x);
-}
-
-template <class _RandomAccessIterator, class _Tp,
- class _Reference, class _Distance>
-inline bool
-operator>=(const reverse_iterator<_RandomAccessIterator, _Tp,
- _Reference, _Distance>& __x,
- const reverse_iterator<_RandomAccessIterator, _Tp,
- _Reference, _Distance>& __y) {
- return !(__x < __y);
-}
-
-#endif /* __STL_FUNCTION_TMPL_PARTIAL_ORDER */
-
-template <class _RandomAccessIterator, class _Tp,
- class _Reference, class _Distance>
-inline _Distance
-operator-(const reverse_iterator<_RandomAccessIterator, _Tp,
- _Reference, _Distance>& __x,
- const reverse_iterator<_RandomAccessIterator, _Tp,
- _Reference, _Distance>& __y)
-{
- return __y.base() - __x.base();
-}
-
-template <class _RandAccIter, class _Tp, class _Ref, class _Dist>
-inline reverse_iterator<_RandAccIter, _Tp, _Ref, _Dist>
-operator+(_Dist __n,
- const reverse_iterator<_RandAccIter, _Tp, _Ref, _Dist>& __x)
-{
- return reverse_iterator<_RandAccIter, _Tp, _Ref, _Dist>(__x.base() - __n);
-}
-
-#endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */
-
-// istream_iterator and ostream_iterator look very different if we're
-// using new, templatized iostreams than if we're using the old cfront
-// version.
-
-#ifdef __STL_USE_NEW_IOSTREAMS
template <class _Tp,
class _CharT = char, class _Traits = char_traits<_CharT>,
@@ -630,8 +397,6 @@ operator==(const istream_iterator<_Tp, _CharT, _Traits, _Dist>& __x,
return __x._M_equal(__y);
}
-#ifdef __STL_FUNCTION_TMPL_PARTIAL_ORDER
-
template <class _Tp, class _CharT, class _Traits, class _Dist>
inline bool
operator!=(const istream_iterator<_Tp, _CharT, _Traits, _Dist>& __x,
@@ -639,7 +404,6 @@ operator!=(const istream_iterator<_Tp, _CharT, _Traits, _Dist>& __x,
return !__x._M_equal(__y);
}
-#endif /* __STL_FUNCTION_TMPL_PARTIAL_ORDER */
template <class _Tp,
class _CharT = char, class _Traits = char_traits<_CharT> >
@@ -671,282 +435,9 @@ private:
const _CharT* _M_string;
};
-// The default template argument is declared in iosfwd
-
-// We do not read any characters until operator* is called. The first
-// time operator* is called, it calls getc. Subsequent calls to getc
-// return a cached character, and calls to operator++ use snextc. Before
-// operator* or operator++ has been called, _M_is_initialized is false.
-template<class _CharT, class _Traits>
-class istreambuf_iterator
- : public iterator<input_iterator_tag, _CharT,
- typename _Traits::off_type, _CharT*, _CharT&>
-{
-public:
- typedef _CharT char_type;
- typedef _Traits traits_type;
- typedef typename _Traits::int_type int_type;
- typedef basic_streambuf<_CharT, _Traits> streambuf_type;
- typedef basic_istream<_CharT, _Traits> istream_type;
-
-public:
- istreambuf_iterator(streambuf_type* __p = 0) { this->_M_init(__p); }
- istreambuf_iterator(istream_type& __is) { this->_M_init(__is.rdbuf()); }
-
- char_type operator*() const
- { return _M_is_initialized ? _M_c : _M_dereference_aux(); }
-
- istreambuf_iterator& operator++() { this->_M_nextc(); return *this; }
- istreambuf_iterator operator++(int) {
- if (!_M_is_initialized)
- _M_postincr_aux();
- istreambuf_iterator __tmp = *this;
- this->_M_nextc();
- return __tmp;
- }
-
- bool equal(const istreambuf_iterator& __i) const {
- return this->_M_is_initialized && __i._M_is_initialized
- ? this->_M_eof == __i._M_eof
- : this->_M_equal_aux(__i);
- }
-
-private:
- void _M_init(streambuf_type* __p) {
- _M_buf = __p;
- _M_eof = !__p;
- _M_is_initialized = _M_eof;
- }
-
- char_type _M_dereference_aux() const;
- bool _M_equal_aux(const istreambuf_iterator&) const;
- void _M_postincr_aux();
-
- void _M_nextc() {
- int_type __c = _M_buf->snextc();
- _M_c = traits_type::to_char_type(__c);
- _M_eof = traits_type::eq_int_type(__c, traits_type::eof());
- _M_is_initialized = true;
- }
-
- void _M_getc() const {
- int_type __c = _M_buf->sgetc();
- _M_c = traits_type::to_char_type(__c);
- _M_eof = traits_type::eq_int_type(__c, traits_type::eof());
- _M_is_initialized = true;
- }
-
-private:
- streambuf_type* _M_buf;
- mutable _CharT _M_c;
- mutable bool _M_eof : 1;
- mutable bool _M_is_initialized : 1;
-};
-
-template<class _CharT, class _Traits>
-_CharT istreambuf_iterator<_CharT, _Traits>::_M_dereference_aux() const
-{
- this->_M_getc();
- return _M_c;
-}
-
-template<class _CharT, class _Traits>
-bool istreambuf_iterator<_CharT, _Traits>
- ::_M_equal_aux(const istreambuf_iterator& __i) const
-{
- if (!this->_M_is_initialized)
- this->_M_getc();
- if (!__i._M_is_initialized)
- __i._M_getc();
-
- return this->_M_eof == __i._M_eof;
-}
-
-template<class _CharT, class _Traits>
-void istreambuf_iterator<_CharT, _Traits>::_M_postincr_aux()
-{
- this->_M_getc();
-}
-
-template<class _CharT, class _Traits>
-inline bool operator==(const istreambuf_iterator<_CharT, _Traits>& __x,
- const istreambuf_iterator<_CharT, _Traits>& __y) {
- return __x.equal(__y);
-}
-
-#ifdef __STL_FUNCTION_TMPL_PARTIAL_ORDER
-
-template<class _CharT, class _Traits>
-inline bool operator!=(const istreambuf_iterator<_CharT, _Traits>& __x,
- const istreambuf_iterator<_CharT, _Traits>& __y) {
- return !__x.equal(__y);
-}
-
-#endif /* __STL_FUNCTION_TMPL_PARTIAL_ORDER */
-
-// The default template argument is declared in iosfwd
-template<class _CharT, class _Traits>
-class ostreambuf_iterator
- : public iterator<output_iterator_tag, void, void, void, void>
-{
-public:
- typedef _CharT char_type;
- typedef _Traits traits_type;
- typedef typename _Traits::int_type int_type;
- typedef basic_streambuf<_CharT, _Traits> streambuf_type;
- typedef basic_ostream<_CharT, _Traits> ostream_type;
-
-public:
- ostreambuf_iterator(streambuf_type* __buf) : _M_buf(__buf), _M_ok(__buf) {}
- ostreambuf_iterator(ostream_type& __o)
- : _M_buf(__o.rdbuf()), _M_ok(__o.rdbuf() != 0) {}
-
- ostreambuf_iterator& operator=(char_type __c) {
- _M_ok = _M_ok && !traits_type::eq_int_type(_M_buf->sputc(__c),
- traits_type::eof());
- return *this;
- }
-
- ostreambuf_iterator& operator*() { return *this; }
- ostreambuf_iterator& operator++() { return *this; }
- ostreambuf_iterator& operator++(int) { return *this; }
-
- bool failed() const { return !_M_ok; }
-
-private:
- streambuf_type* _M_buf;
- bool _M_ok;
-};
-
-#else /* __STL_USE_NEW_IOSTREAMS */
-
-template <class _Tp, class _Dist = ptrdiff_t> class istream_iterator;
-
-template <class _Tp, class _Dist>
-inline bool operator==(const istream_iterator<_Tp, _Dist>&,
- const istream_iterator<_Tp, _Dist>&);
-
-template <class _Tp, class _Dist>
-class istream_iterator {
-#ifdef __STL_TEMPLATE_FRIENDS
- template <class _T1, class _D1>
- friend bool operator==(const istream_iterator<_T1, _D1>&,
- const istream_iterator<_T1, _D1>&);
-#else /* __STL_TEMPLATE_FRIENDS */
- friend bool __STD_QUALIFIER
- operator== __STL_NULL_TMPL_ARGS (const istream_iterator&,
- const istream_iterator&);
-#endif /* __STL_TEMPLATE_FRIENDS */
-
-protected:
- istream* _M_stream;
- _Tp _M_value;
- bool _M_end_marker;
- void _M_read() {
- _M_end_marker = (*_M_stream) ? true : false;
- if (_M_end_marker) *_M_stream >> _M_value;
- _M_end_marker = (*_M_stream) ? true : false;
- }
-public:
- typedef input_iterator_tag iterator_category;
- typedef _Tp value_type;
- typedef _Dist difference_type;
- typedef const _Tp* pointer;
- typedef const _Tp& reference;
-
- istream_iterator() : _M_stream(&cin), _M_end_marker(false) {}
- istream_iterator(istream& __s) : _M_stream(&__s) { _M_read(); }
- reference operator*() const { return _M_value; }
-#ifndef __SGI_STL_NO_ARROW_OPERATOR
- pointer operator->() const { return &(operator*()); }
-#endif /* __SGI_STL_NO_ARROW_OPERATOR */
- istream_iterator<_Tp, _Dist>& operator++() {
- _M_read();
- return *this;
- }
- istream_iterator<_Tp, _Dist> operator++(int) {
- istream_iterator<_Tp, _Dist> __tmp = *this;
- _M_read();
- return __tmp;
- }
-};
-
-#ifndef __STL_CLASS_PARTIAL_SPECIALIZATION
-
-template <class _Tp, class _Dist>
-inline input_iterator_tag
-iterator_category(const istream_iterator<_Tp, _Dist>&)
-{
- return input_iterator_tag();
-}
-
-template <class _Tp, class _Dist>
-inline _Tp*
-value_type(const istream_iterator<_Tp, _Dist>&) { return (_Tp*) 0; }
-
-template <class _Tp, class _Dist>
-inline _Dist*
-distance_type(const istream_iterator<_Tp, _Dist>&) { return (_Dist*)0; }
-
-#endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */
-
-template <class _Tp, class _Distance>
-inline bool operator==(const istream_iterator<_Tp, _Distance>& __x,
- const istream_iterator<_Tp, _Distance>& __y) {
- return (__x._M_stream == __y._M_stream &&
- __x._M_end_marker == __y._M_end_marker) ||
- __x._M_end_marker == false && __y._M_end_marker == false;
-}
-
-#ifdef __STL_FUNCTION_TMPL_PARTIAL_ORDER
-
-template <class _Tp, class _Distance>
-inline bool operator!=(const istream_iterator<_Tp, _Distance>& __x,
- const istream_iterator<_Tp, _Distance>& __y) {
- return !(__x == __y);
-}
-
-#endif /* __STL_FUNCTION_TMPL_PARTIAL_ORDER */
-
-template <class _Tp>
-class ostream_iterator {
-protected:
- ostream* _M_stream;
- const char* _M_string;
-public:
- typedef output_iterator_tag iterator_category;
- typedef void value_type;
- typedef void difference_type;
- typedef void pointer;
- typedef void reference;
-
- ostream_iterator(ostream& __s) : _M_stream(&__s), _M_string(0) {}
- ostream_iterator(ostream& __s, const char* __c)
- : _M_stream(&__s), _M_string(__c) {}
- ostream_iterator<_Tp>& operator=(const _Tp& __value) {
- *_M_stream << __value;
- if (_M_string) *_M_stream << _M_string;
- return *this;
- }
- ostream_iterator<_Tp>& operator*() { return *this; }
- ostream_iterator<_Tp>& operator++() { return *this; }
- ostream_iterator<_Tp>& operator++(int) { return *this; }
-};
-
-#ifndef __STL_CLASS_PARTIAL_SPECIALIZATION
-
-template <class _Tp>
-inline output_iterator_tag
-iterator_category(const ostream_iterator<_Tp>&) {
- return output_iterator_tag();
-}
-
-#endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */
-
-#endif /* __STL_USE_NEW_IOSTREAMS */
// This iterator adapter is 'normal' in the sense that it does not
-// change the semantics of any of the operators of its itererator
+// change the semantics of any of the operators of its iterator
// parameter. Its primary purpose is to convert an iterator that is
// not a class, e.g. a pointer, into an iterator that is a class.
// The _Container parameter exists solely so that different containers
@@ -1073,11 +564,11 @@ operator>=(const __normal_iterator<_IteratorL, _Container>& __lhs,
template<typename _Iterator, typename _Container>
inline __normal_iterator<_Iterator, _Container>
-operator+(__normal_iterator<_Iterator, _Container>::difference_type __n,
+operator+(typename __normal_iterator<_Iterator, _Container>::difference_type __n,
const __normal_iterator<_Iterator, _Container>& __i)
{ return __normal_iterator<_Iterator, _Container>(__i.base() + __n); }
-__STL_END_NAMESPACE
+} // namespace std
#endif /* __SGI_STL_INTERNAL_ITERATOR_H */
diff --git a/libstdc++-v3/include/bits/stl_iterator_base_funcs.h b/libstdc++-v3/include/bits/stl_iterator_base_funcs.h
new file mode 100644
index 00000000000..5d3816fa839
--- /dev/null
+++ b/libstdc++-v3/include/bits/stl_iterator_base_funcs.h
@@ -0,0 +1,181 @@
+// Functions used by iterators -*- C++ -*-
+
+// Copyright (C) 2001 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.
+
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1996-1998
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/* NOTE: This is an internal header file, included by other STL headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef __SGI_STL_INTERNAL_ITERATOR_BASE_FUNCS_H
+#define __SGI_STL_INTERNAL_ITERATOR_BASE_FUNCS_H
+
+// This file contains all of the general iterator-related utility
+// functions, such as distance() and advance().
+// The internal file stl_iterator.h contains predefined iterators,
+// such as front_insert_iterator and istream_iterator.
+
+#pragma GCC system_header
+#include <bits/concept_check.h>
+
+namespace std
+{
+
+// There are two signatures for distance. In addition to the one taking
+// two iterators and returning a result, there is another taking two
+// iterators and a reference-to-result variable, and returning nothing.
+// The latter seems to be an SGI extension. -- pedwards
+template <class _InputIterator, class _Distance>
+inline void __distance(_InputIterator __first, _InputIterator __last,
+ _Distance& __n, input_iterator_tag)
+{
+ // concept requirements
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIterator>);
+ while (__first != __last) { ++__first; ++__n; }
+}
+
+template <class _RandomAccessIterator, class _Distance>
+inline void __distance(_RandomAccessIterator __first,
+ _RandomAccessIterator __last,
+ _Distance& __n, random_access_iterator_tag)
+{
+ // concept requirements
+ __glibcpp_function_requires(_RandomAccessIteratorConcept<_RandomAccessIterator>);
+ __n += __last - __first;
+}
+
+template <class _InputIterator, class _Distance>
+inline void distance(_InputIterator __first,
+ _InputIterator __last, _Distance& __n)
+{
+ // concept requirements -- taken care of in __distance
+ __distance(__first, __last, __n, iterator_category(__first));
+}
+
+template <class _InputIterator>
+inline typename iterator_traits<_InputIterator>::difference_type
+__distance(_InputIterator __first, _InputIterator __last, input_iterator_tag)
+{
+ // concept requirements
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIterator>);
+ typename iterator_traits<_InputIterator>::difference_type __n = 0;
+ while (__first != __last) {
+ ++__first; ++__n;
+ }
+ return __n;
+}
+
+template <class _RandomAccessIterator>
+inline typename iterator_traits<_RandomAccessIterator>::difference_type
+__distance(_RandomAccessIterator __first, _RandomAccessIterator __last,
+ random_access_iterator_tag)
+{
+ // concept requirements
+ __glibcpp_function_requires(_RandomAccessIteratorConcept<_RandomAccessIterator>);
+ return __last - __first;
+}
+
+template <class _InputIterator>
+inline typename iterator_traits<_InputIterator>::difference_type
+distance(_InputIterator __first, _InputIterator __last)
+{
+ // concept requirements -- taken care of in __distance
+ typedef typename iterator_traits<_InputIterator>::iterator_category
+ _Category;
+ return __distance(__first, __last, _Category());
+}
+
+template <class _InputIter, class _Distance>
+inline void __advance(_InputIter& __i, _Distance __n, input_iterator_tag)
+{
+ // concept requirements
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIter>);
+ while (__n--) ++__i;
+}
+
+template <class _BidirectionalIterator, class _Distance>
+inline void __advance(_BidirectionalIterator& __i, _Distance __n,
+ bidirectional_iterator_tag)
+{
+ // concept requirements
+__glibcpp_function_requires(_BidirectionalIteratorConcept<_BidirectionalIterator>);
+ if (__n > 0)
+ while (__n--) ++__i;
+ else
+ while (__n++) --__i;
+}
+
+template <class _RandomAccessIterator, class _Distance>
+inline void __advance(_RandomAccessIterator& __i, _Distance __n,
+ random_access_iterator_tag)
+{
+ // concept requirements
+ __glibcpp_function_requires(_RandomAccessIteratorConcept<_RandomAccessIterator>);
+ __i += __n;
+}
+
+template <class _InputIterator, class _Distance>
+inline void advance(_InputIterator& __i, _Distance __n)
+{
+ // concept requirements -- taken care of in __advance
+ __advance(__i, __n, iterator_category(__i));
+}
+
+} // namespace std
+
+#endif /* __SGI_STL_INTERNAL_ITERATOR_BASE_FUNCS_H */
+
+
+// Local Variables:
+// mode:C++
+// End:
diff --git a/libstdc++-v3/include/bits/stl_iterator_base_types.h b/libstdc++-v3/include/bits/stl_iterator_base_types.h
new file mode 100644
index 00000000000..a5539d1495d
--- /dev/null
+++ b/libstdc++-v3/include/bits/stl_iterator_base_types.h
@@ -0,0 +1,214 @@
+// Types used in iterator implementation -*- C++ -*-
+
+// Copyright (C) 2001 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.
+
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1996-1998
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/* NOTE: This is an internal header file, included by other STL headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef __SGI_STL_INTERNAL_ITERATOR_BASE_TYPES_H
+#define __SGI_STL_INTERNAL_ITERATOR_BASE_TYPES_H
+
+// This file contains all of the general iterator-related utility
+// types, such as iterator_traits and struct iterator.
+// The internal file stl_iterator.h contains predefined iterators,
+// such as front_insert_iterator and istream_iterator.
+
+#pragma GCC system_header
+
+#include <bits/std_cstddef.h> // for ptrdiff_t
+
+
+namespace std
+{
+
+struct input_iterator_tag {};
+struct output_iterator_tag {};
+struct forward_iterator_tag : public input_iterator_tag {};
+struct bidirectional_iterator_tag : public forward_iterator_tag {};
+struct random_access_iterator_tag : public bidirectional_iterator_tag {};
+
+// The base classes input_iterator, output_iterator, forward_iterator,
+// bidirectional_iterator, and random_access_iterator are not part of
+// the C++ standard. (They have been replaced by struct iterator.)
+// They are included for backward compatibility with the HP STL.
+
+template <class _Tp, class _Distance> struct input_iterator {
+ typedef input_iterator_tag iterator_category;
+ typedef _Tp value_type;
+ typedef _Distance difference_type;
+ typedef _Tp* pointer;
+ typedef _Tp& reference;
+};
+
+struct output_iterator {
+ typedef output_iterator_tag iterator_category;
+ typedef void value_type;
+ typedef void difference_type;
+ typedef void pointer;
+ typedef void reference;
+};
+
+template <class _Tp, class _Distance> struct forward_iterator {
+ typedef forward_iterator_tag iterator_category;
+ typedef _Tp value_type;
+ typedef _Distance difference_type;
+ typedef _Tp* pointer;
+ typedef _Tp& reference;
+};
+
+
+template <class _Tp, class _Distance> struct bidirectional_iterator {
+ typedef bidirectional_iterator_tag iterator_category;
+ typedef _Tp value_type;
+ typedef _Distance difference_type;
+ typedef _Tp* pointer;
+ typedef _Tp& reference;
+};
+
+template <class _Tp, class _Distance> struct random_access_iterator {
+ typedef random_access_iterator_tag iterator_category;
+ typedef _Tp value_type;
+ typedef _Distance difference_type;
+ typedef _Tp* pointer;
+ typedef _Tp& reference;
+};
+
+template <class _Category, class _Tp, class _Distance = ptrdiff_t,
+ class _Pointer = _Tp*, class _Reference = _Tp&>
+struct iterator {
+ typedef _Category iterator_category;
+ typedef _Tp value_type;
+ typedef _Distance difference_type;
+ typedef _Pointer pointer;
+ typedef _Reference reference;
+};
+
+template <class _Iterator>
+struct iterator_traits {
+ typedef typename _Iterator::iterator_category iterator_category;
+ typedef typename _Iterator::value_type value_type;
+ typedef typename _Iterator::difference_type difference_type;
+ typedef typename _Iterator::pointer pointer;
+ typedef typename _Iterator::reference reference;
+};
+
+template <class _Tp>
+struct iterator_traits<_Tp*> {
+ typedef random_access_iterator_tag iterator_category;
+ typedef _Tp value_type;
+ typedef ptrdiff_t difference_type;
+ typedef _Tp* pointer;
+ typedef _Tp& reference;
+};
+
+template <class _Tp>
+struct iterator_traits<const _Tp*> {
+ typedef random_access_iterator_tag iterator_category;
+ typedef _Tp value_type;
+ typedef ptrdiff_t difference_type;
+ typedef const _Tp* pointer;
+ typedef const _Tp& reference;
+};
+
+// The overloaded functions iterator_category, distance_type, and
+// value_type are not part of the C++ standard. (They have been
+// replaced by struct iterator_traits.) They are included for
+// backward compatibility with the HP STL.
+
+// We introduce internal names for these functions.
+
+template <class _Iter>
+inline typename iterator_traits<_Iter>::iterator_category
+__iterator_category(const _Iter&)
+{
+ typedef typename iterator_traits<_Iter>::iterator_category _Category;
+ return _Category();
+}
+
+template <class _Iter>
+inline typename iterator_traits<_Iter>::difference_type*
+__distance_type(const _Iter&)
+{
+ return static_cast<typename iterator_traits<_Iter>::difference_type*>(0);
+}
+
+template <class _Iter>
+inline typename iterator_traits<_Iter>::value_type*
+__value_type(const _Iter&)
+{
+ return static_cast<typename iterator_traits<_Iter>::value_type*>(0);
+}
+
+template <class _Iter>
+inline typename iterator_traits<_Iter>::iterator_category
+iterator_category(const _Iter& __i) { return __iterator_category(__i); }
+
+
+template <class _Iter>
+inline typename iterator_traits<_Iter>::difference_type*
+distance_type(const _Iter& __i) { return __distance_type(__i); }
+
+template <class _Iter>
+inline typename iterator_traits<_Iter>::value_type*
+value_type(const _Iter& __i) { return __value_type(__i); }
+
+} // namespace std
+
+#endif /* __SGI_STL_INTERNAL_ITERATOR_BASE_TYPES_H */
+
+
+// Local Variables:
+// mode:C++
+// End:
diff --git a/libstdc++-v3/include/bits/stl_list.h b/libstdc++-v3/include/bits/stl_list.h
index 1967a7a933d..7e9ad8f307b 100644
--- a/libstdc++-v3/include/bits/stl_list.h
+++ b/libstdc++-v3/include/bits/stl_list.h
@@ -1,3 +1,32 @@
+// List implementation -*- C++ -*-
+
+// Copyright (C) 2001 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.
+
/*
*
* Copyright (c) 1994
@@ -31,14 +60,10 @@
#ifndef __SGI_STL_INTERNAL_LIST_H
#define __SGI_STL_INTERNAL_LIST_H
-#include <bits/concept_checks.h>
-
-__STL_BEGIN_NAMESPACE
+#include <bits/concept_check.h>
-#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
-#pragma set woff 1174
-#pragma set woff 1375
-#endif
+namespace std
+{
struct _List_node_base {
_List_node_base* _M_next;
@@ -87,10 +112,7 @@ struct _List_iterator : public _List_iterator_base {
_List_iterator(const iterator& __x) : _List_iterator_base(__x._M_node) {}
reference operator*() const { return ((_Node*) _M_node)->_M_data; }
-
-#ifndef __SGI_STL_NO_ARROW_OPERATOR
pointer operator->() const { return &(operator*()); }
-#endif /* __SGI_STL_NO_ARROW_OPERATOR */
_Self& operator++() {
this->_M_incr();
@@ -112,29 +134,6 @@ struct _List_iterator : public _List_iterator_base {
}
};
-#ifndef __STL_CLASS_PARTIAL_SPECIALIZATION
-
-inline bidirectional_iterator_tag
-iterator_category(const _List_iterator_base&)
-{
- return bidirectional_iterator_tag();
-}
-
-template <class _Tp, class _Ref, class _Ptr>
-inline _Tp*
-value_type(const _List_iterator<_Tp, _Ref, _Ptr>&)
-{
- return 0;
-}
-
-inline ptrdiff_t*
-distance_type(const _List_iterator_base&)
-{
- return 0;
-}
-
-#endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */
-
// Base class that encapsulates details of allocators. Three cases:
// an ordinary standard-conforming allocator, a standard-conforming
@@ -143,7 +142,6 @@ distance_type(const _List_iterator_base&)
// compatibility and because we want to avoid wasting storage on an
// allocator instance if it isn't necessary.
-#ifdef __STL_USE_STD_ALLOCATORS
// Base for general standard-conforming allocators.
template <class _Tp, class _Allocator, bool _IsStatic>
@@ -212,37 +210,6 @@ public:
void clear();
};
-#else /* __STL_USE_STD_ALLOCATORS */
-
-template <class _Tp, class _Alloc>
-class _List_base
-{
-public:
- typedef _Alloc allocator_type;
- allocator_type get_allocator() const { return allocator_type(); }
-
- _List_base(const allocator_type&) {
- _M_node = _M_get_node();
- _M_node->_M_next = _M_node;
- _M_node->_M_prev = _M_node;
- }
- ~_List_base() {
- clear();
- _M_put_node(_M_node);
- }
-
- void clear();
-
-protected:
- typedef simple_alloc<_List_node<_Tp>, _Alloc> _Alloc_type;
- _List_node<_Tp>* _M_get_node() { return _Alloc_type::allocate(1); }
- void _M_put_node(_List_node<_Tp>* __p) { _Alloc_type::deallocate(__p, 1); }
-
-protected:
- _List_node<_Tp>* _M_node;
-};
-
-#endif /* __STL_USE_STD_ALLOCATORS */
template <class _Tp, class _Alloc>
void
@@ -260,10 +227,10 @@ _List_base<_Tp,_Alloc>::clear()
}
template <class _Tp, class _Alloc = allocator<_Tp> >
-class list : protected _List_base<_Tp, _Alloc> {
- // requirements:
-
- __STL_CLASS_REQUIRES(_Tp, _Assignable);
+class list : protected _List_base<_Tp, _Alloc>
+{
+ // concept requirements
+ __glibcpp_class_requires(_Tp, _SGIAssignableConcept);
typedef _List_base<_Tp, _Alloc> _Base;
protected:
@@ -286,24 +253,13 @@ public:
typedef _List_iterator<_Tp,_Tp&,_Tp*> iterator;
typedef _List_iterator<_Tp,const _Tp&,const _Tp*> const_iterator;
-#ifdef __STL_CLASS_PARTIAL_SPECIALIZATION
typedef reverse_iterator<const_iterator> const_reverse_iterator;
typedef reverse_iterator<iterator> reverse_iterator;
-#else /* __STL_CLASS_PARTIAL_SPECIALIZATION */
- typedef reverse_bidirectional_iterator<const_iterator,value_type,
- const_reference,difference_type>
- const_reverse_iterator;
- typedef reverse_bidirectional_iterator<iterator,value_type,reference,
- difference_type>
- reverse_iterator;
-#endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */
protected:
-#ifdef __STL_HAS_NAMESPACES
using _Base::_M_node;
using _Base::_M_put_node;
using _Base::_M_get_node;
-#endif /* __STL_HAS_NAMESPACES */
protected:
_Node* _M_create_node(const _Tp& __x)
@@ -358,7 +314,7 @@ public:
reference back() { return *(--end()); }
const_reference back() const { return *(--end()); }
- void swap(list<_Tp, _Alloc>& __x) { __STD::swap(_M_node, __x._M_node); }
+ void swap(list<_Tp, _Alloc>& __x) { std::swap(_M_node, __x._M_node); }
iterator insert(iterator __position, const _Tp& __x) {
_Node* __tmp = _M_create_node(__x);
@@ -369,9 +325,8 @@ public:
return __tmp;
}
iterator insert(iterator __position) { return insert(__position, _Tp()); }
-#ifdef __STL_MEMBER_TEMPLATES
- // Check whether it's an integral type. If so, it's not an iterator.
+ // Check whether it's an integral type. If so, it's not an iterator.
template<class _Integer>
void _M_insert_dispatch(iterator __pos, _Integer __n, _Integer __x,
__true_type) {
@@ -389,11 +344,6 @@ public:
_M_insert_dispatch(__pos, __first, __last, _Integral());
}
-#else /* __STL_MEMBER_TEMPLATES */
- void insert(iterator __position, const _Tp* __first, const _Tp* __last);
- void insert(iterator __position,
- const_iterator __first, const_iterator __last);
-#endif /* __STL_MEMBER_TEMPLATES */
void insert(iterator __pos, size_type __n, const _Tp& __x)
{ _M_fill_insert(__pos, __n, __x); }
void _M_fill_insert(iterator __pos, size_type __n, const _Tp& __x);
@@ -432,8 +382,6 @@ public:
: _Base(allocator_type())
{ insert(begin(), __n, _Tp()); }
-#ifdef __STL_MEMBER_TEMPLATES
-
// We don't need any dispatching tricks here, because insert does all of
// that anyway.
template <class _InputIterator>
@@ -442,18 +390,6 @@ public:
: _Base(__a)
{ insert(begin(), __first, __last); }
-#else /* __STL_MEMBER_TEMPLATES */
-
- list(const _Tp* __first, const _Tp* __last,
- const allocator_type& __a = allocator_type())
- : _Base(__a)
- { this->insert(begin(), __first, __last); }
- list(const_iterator __first, const_iterator __last,
- const allocator_type& __a = allocator_type())
- : _Base(__a)
- { this->insert(begin(), __first, __last); }
-
-#endif /* __STL_MEMBER_TEMPLATES */
list(const list<_Tp, _Alloc>& __x) : _Base(__x.get_allocator())
{ insert(begin(), __x.begin(), __x.end()); }
@@ -471,8 +407,6 @@ public:
void _M_fill_assign(size_type __n, const _Tp& __val);
-#ifdef __STL_MEMBER_TEMPLATES
-
template <class _InputIterator>
void assign(_InputIterator __first, _InputIterator __last) {
typedef typename _Is_integer<_InputIterator>::_Integral _Integral;
@@ -487,8 +421,6 @@ public:
void _M_assign_dispatch(_InputIterator __first, _InputIterator __last,
__false_type);
-#endif /* __STL_MEMBER_TEMPLATES */
-
protected:
void transfer(iterator __position, iterator __first, iterator __last) {
if (__position != __last) {
@@ -526,12 +458,10 @@ public:
void reverse();
void sort();
-#ifdef __STL_MEMBER_TEMPLATES
template <class _Predicate> void remove_if(_Predicate);
template <class _BinaryPredicate> void unique(_BinaryPredicate);
template <class _StrictWeakOrdering> void merge(list&, _StrictWeakOrdering);
template <class _StrictWeakOrdering> void sort(_StrictWeakOrdering);
-#endif /* __STL_MEMBER_TEMPLATES */
};
template <class _Tp, class _Alloc>
@@ -559,8 +489,6 @@ inline bool operator<(const list<_Tp,_Alloc>& __x,
__y.begin(), __y.end());
}
-#ifdef __STL_FUNCTION_TMPL_PARTIAL_ORDER
-
template <class _Tp, class _Alloc>
inline bool operator!=(const list<_Tp,_Alloc>& __x,
const list<_Tp,_Alloc>& __y) {
@@ -592,10 +520,6 @@ swap(list<_Tp, _Alloc>& __x, list<_Tp, _Alloc>& __y)
__x.swap(__y);
}
-#endif /* __STL_FUNCTION_TMPL_PARTIAL_ORDER */
-
-#ifdef __STL_MEMBER_TEMPLATES
-
template <class _Tp, class _Alloc> template <class _InputIter>
void
list<_Tp, _Alloc>::_M_insert_dispatch(iterator __position,
@@ -606,28 +530,6 @@ list<_Tp, _Alloc>::_M_insert_dispatch(iterator __position,
insert(__position, *__first);
}
-#else /* __STL_MEMBER_TEMPLATES */
-
-template <class _Tp, class _Alloc>
-void
-list<_Tp, _Alloc>::insert(iterator __position,
- const _Tp* __first, const _Tp* __last)
-{
- for ( ; __first != __last; ++__first)
- insert(__position, *__first);
-}
-
-template <class _Tp, class _Alloc>
-void
-list<_Tp, _Alloc>::insert(iterator __position,
- const_iterator __first, const_iterator __last)
-{
- for ( ; __first != __last; ++__first)
- insert(__position, *__first);
-}
-
-#endif /* __STL_MEMBER_TEMPLATES */
-
template <class _Tp, class _Alloc>
void
list<_Tp, _Alloc>::_M_fill_insert(iterator __position,
@@ -688,8 +590,6 @@ void list<_Tp, _Alloc>::_M_fill_assign(size_type __n, const _Tp& __val) {
erase(__i, end());
}
-#ifdef __STL_MEMBER_TEMPLATES
-
template <class _Tp, class _Alloc> template <class _InputIter>
void
list<_Tp, _Alloc>::_M_assign_dispatch(_InputIter __first2, _InputIter __last2,
@@ -705,8 +605,6 @@ list<_Tp, _Alloc>::_M_assign_dispatch(_InputIter __first2, _InputIter __last2,
insert(__last1, __first2, __last2);
}
-#endif /* __STL_MEMBER_TEMPLATES */
-
template <class _Tp, class _Alloc>
void list<_Tp, _Alloc>::remove(const _Tp& __value)
{
@@ -758,7 +656,7 @@ inline void __List_base_reverse(_List_node_base* __p)
{
_List_node_base* __tmp = __p;
do {
- __STD::swap(__tmp->_M_next, __tmp->_M_prev);
+ std::swap(__tmp->_M_next, __tmp->_M_prev);
__tmp = __tmp->_M_prev; // Old next node is now prev.
} while (__tmp != __p);
}
@@ -794,8 +692,6 @@ void list<_Tp, _Alloc>::sort()
}
}
-#ifdef __STL_MEMBER_TEMPLATES
-
template <class _Tp, class _Alloc> template <class _Predicate>
void list<_Tp, _Alloc>::remove_if(_Predicate __pred)
{
@@ -869,14 +765,7 @@ void list<_Tp, _Alloc>::sort(_StrictWeakOrdering __comp)
}
}
-#endif /* __STL_MEMBER_TEMPLATES */
-
-#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
-#pragma reset woff 1174
-#pragma reset woff 1375
-#endif
-
-__STL_END_NAMESPACE
+} // namespace std
#endif /* __SGI_STL_INTERNAL_LIST_H */
diff --git a/libstdc++-v3/include/bits/stl_map.h b/libstdc++-v3/include/bits/stl_map.h
index 0b7a06d4b8b..97850026872 100644
--- a/libstdc++-v3/include/bits/stl_map.h
+++ b/libstdc++-v3/include/bits/stl_map.h
@@ -1,3 +1,32 @@
+// Map implementation -*- C++ -*-
+
+// Copyright (C) 2001 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.
+
/*
*
* Copyright (c) 1994
@@ -31,27 +60,21 @@
#ifndef _CPP_BITS_STL_MAP_H
#define _CPP_BITS_STL_MAP_H 1
-#include <bits/concept_checks.h>
-
-__STL_BEGIN_NAMESPACE
+#include <bits/concept_check.h>
-#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
-#pragma set woff 1174
-#pragma set woff 1375
-#endif
+namespace std
+{
template <class _Key, class _Tp, class _Compare = less<_Key>,
class _Alloc = allocator<pair<const _Key, _Tp> > >
-class map {
-public:
-
-// requirements:
-
- __STL_CLASS_REQUIRES(_Tp, _Assignable);
- __STL_CLASS_BINARY_FUNCTION_CHECK(_Compare, bool, _Key, _Key);
-
-// typedefs:
+class map
+{
+ // concept requirements
+ __glibcpp_class_requires(_Tp, _SGIAssignableConcept);
+ __glibcpp_class_requires4(_Compare, bool, _Key, _Key, _BinaryFunctionConcept);
+public:
+ // typedefs:
typedef _Key key_type;
typedef _Tp data_type;
typedef _Tp mapped_type;
@@ -94,7 +117,6 @@ public:
const allocator_type& __a = allocator_type())
: _M_t(__comp, __a) {}
-#ifdef __STL_MEMBER_TEMPLATES
template <class _InputIterator>
map(_InputIterator __first, _InputIterator __last)
: _M_t(_Compare(), allocator_type())
@@ -104,27 +126,8 @@ public:
map(_InputIterator __first, _InputIterator __last, const _Compare& __comp,
const allocator_type& __a = allocator_type())
: _M_t(__comp, __a) { _M_t.insert_unique(__first, __last); }
-#else
- map(const value_type* __first, const value_type* __last)
- : _M_t(_Compare(), allocator_type())
- { _M_t.insert_unique(__first, __last); }
-
- map(const value_type* __first,
- const value_type* __last, const _Compare& __comp,
- const allocator_type& __a = allocator_type())
- : _M_t(__comp, __a) { _M_t.insert_unique(__first, __last); }
-
- map(const_iterator __first, const_iterator __last)
- : _M_t(_Compare(), allocator_type())
- { _M_t.insert_unique(__first, __last); }
-
- map(const_iterator __first, const_iterator __last, const _Compare& __comp,
- const allocator_type& __a = allocator_type())
- : _M_t(__comp, __a) { _M_t.insert_unique(__first, __last); }
-
-#endif /* __STL_MEMBER_TEMPLATES */
-
map(const map<_Key,_Tp,_Compare,_Alloc>& __x) : _M_t(__x._M_t) {}
+
map<_Key,_Tp,_Compare,_Alloc>&
operator=(const map<_Key, _Tp, _Compare, _Alloc>& __x)
{
@@ -164,19 +167,10 @@ public:
{ return _M_t.insert_unique(__x); }
iterator insert(iterator position, const value_type& __x)
{ return _M_t.insert_unique(position, __x); }
-#ifdef __STL_MEMBER_TEMPLATES
template <class _InputIterator>
void insert(_InputIterator __first, _InputIterator __last) {
_M_t.insert_unique(__first, __last);
}
-#else
- void insert(const value_type* __first, const value_type* __last) {
- _M_t.insert_unique(__first, __last);
- }
- void insert(const_iterator __first, const_iterator __last) {
- _M_t.insert_unique(__first, __last);
- }
-#endif /* __STL_MEMBER_TEMPLATES */
void erase(iterator __position) { _M_t.erase(__position); }
size_type erase(const key_type& __x) { return _M_t.erase(__x); }
@@ -207,19 +201,12 @@ public:
return _M_t.equal_range(__x);
}
-#ifdef __STL_TEMPLATE_FRIENDS
template <class _K1, class _T1, class _C1, class _A1>
friend bool operator== (const map<_K1, _T1, _C1, _A1>&,
const map<_K1, _T1, _C1, _A1>&);
template <class _K1, class _T1, class _C1, class _A1>
friend bool operator< (const map<_K1, _T1, _C1, _A1>&,
const map<_K1, _T1, _C1, _A1>&);
-#else /* __STL_TEMPLATE_FRIENDS */
- friend bool __STD_QUALIFIER
- operator== __STL_NULL_TMPL_ARGS (const map&, const map&);
- friend bool __STD_QUALIFIER
- operator< __STL_NULL_TMPL_ARGS (const map&, const map&);
-#endif /* __STL_TEMPLATE_FRIENDS */
};
template <class _Key, class _Tp, class _Compare, class _Alloc>
@@ -234,8 +221,6 @@ inline bool operator<(const map<_Key,_Tp,_Compare,_Alloc>& __x,
return __x._M_t < __y._M_t;
}
-#ifdef __STL_FUNCTION_TMPL_PARTIAL_ORDER
-
template <class _Key, class _Tp, class _Compare, class _Alloc>
inline bool operator!=(const map<_Key,_Tp,_Compare,_Alloc>& __x,
const map<_Key,_Tp,_Compare,_Alloc>& __y) {
@@ -266,14 +251,7 @@ inline void swap(map<_Key,_Tp,_Compare,_Alloc>& __x,
__x.swap(__y);
}
-#endif /* __STL_FUNCTION_TMPL_PARTIAL_ORDER */
-
-#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
-#pragma reset woff 1174
-#pragma reset woff 1375
-#endif
-
-__STL_END_NAMESPACE
+} // namespace std
#endif /* _CPP_BITS_STL_MAP_H */
diff --git a/libstdc++-v3/include/bits/stl_multimap.h b/libstdc++-v3/include/bits/stl_multimap.h
index 1c5401b378a..a535e73bba8 100644
--- a/libstdc++-v3/include/bits/stl_multimap.h
+++ b/libstdc++-v3/include/bits/stl_multimap.h
@@ -1,3 +1,32 @@
+// Multimap implementation -*- C++ -*-
+
+// Copyright (C) 2001 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.
+
/*
*
* Copyright (c) 1994
@@ -31,14 +60,10 @@
#ifndef __SGI_STL_INTERNAL_MULTIMAP_H
#define __SGI_STL_INTERNAL_MULTIMAP_H
-#include <bits/concept_checks.h>
-
-__STL_BEGIN_NAMESPACE
+#include <bits/concept_check.h>
-#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
-#pragma set woff 1174
-#pragma set woff 1375
-#endif
+namespace std
+{
// Forward declaration of operators < and ==, needed for friend declaration.
@@ -56,11 +81,11 @@ inline bool operator<(const multimap<_Key,_Tp,_Compare,_Alloc>& __x,
const multimap<_Key,_Tp,_Compare,_Alloc>& __y);
template <class _Key, class _Tp, class _Compare, class _Alloc>
-class multimap {
- // requirements:
-
- __STL_CLASS_REQUIRES(_Tp, _Assignable);
- __STL_CLASS_BINARY_FUNCTION_CHECK(_Compare, bool, _Key, _Key);
+class multimap
+{
+ // concept requirements
+ __glibcpp_class_requires(_Tp, _SGIAssignableConcept);
+ __glibcpp_class_requires4(_Compare, bool, _Key, _Key, _BinaryFunctionConcept);
public:
@@ -107,7 +132,6 @@ public:
const allocator_type& __a = allocator_type())
: _M_t(__comp, __a) { }
-#ifdef __STL_MEMBER_TEMPLATES
template <class _InputIterator>
multimap(_InputIterator __first, _InputIterator __last)
: _M_t(_Compare(), allocator_type())
@@ -118,25 +142,8 @@ public:
const _Compare& __comp,
const allocator_type& __a = allocator_type())
: _M_t(__comp, __a) { _M_t.insert_equal(__first, __last); }
-#else
- multimap(const value_type* __first, const value_type* __last)
- : _M_t(_Compare(), allocator_type())
- { _M_t.insert_equal(__first, __last); }
- multimap(const value_type* __first, const value_type* __last,
- const _Compare& __comp,
- const allocator_type& __a = allocator_type())
- : _M_t(__comp, __a) { _M_t.insert_equal(__first, __last); }
-
- multimap(const_iterator __first, const_iterator __last)
- : _M_t(_Compare(), allocator_type())
- { _M_t.insert_equal(__first, __last); }
- multimap(const_iterator __first, const_iterator __last,
- const _Compare& __comp,
- const allocator_type& __a = allocator_type())
- : _M_t(__comp, __a) { _M_t.insert_equal(__first, __last); }
-#endif /* __STL_MEMBER_TEMPLATES */
-
multimap(const multimap<_Key,_Tp,_Compare,_Alloc>& __x) : _M_t(__x._M_t) { }
+
multimap<_Key,_Tp,_Compare,_Alloc>&
operator=(const multimap<_Key,_Tp,_Compare,_Alloc>& __x) {
_M_t = __x._M_t;
@@ -168,19 +175,10 @@ public:
iterator insert(iterator __position, const value_type& __x) {
return _M_t.insert_equal(__position, __x);
}
-#ifdef __STL_MEMBER_TEMPLATES
template <class _InputIterator>
void insert(_InputIterator __first, _InputIterator __last) {
_M_t.insert_equal(__first, __last);
}
-#else
- void insert(const value_type* __first, const value_type* __last) {
- _M_t.insert_equal(__first, __last);
- }
- void insert(const_iterator __first, const_iterator __last) {
- _M_t.insert_equal(__first, __last);
- }
-#endif /* __STL_MEMBER_TEMPLATES */
void erase(iterator __position) { _M_t.erase(__position); }
size_type erase(const key_type& __x) { return _M_t.erase(__x); }
void erase(iterator __first, iterator __last)
@@ -207,19 +205,12 @@ public:
return _M_t.equal_range(__x);
}
-#ifdef __STL_TEMPLATE_FRIENDS
template <class _K1, class _T1, class _C1, class _A1>
friend bool operator== (const multimap<_K1, _T1, _C1, _A1>&,
const multimap<_K1, _T1, _C1, _A1>&);
template <class _K1, class _T1, class _C1, class _A1>
friend bool operator< (const multimap<_K1, _T1, _C1, _A1>&,
const multimap<_K1, _T1, _C1, _A1>&);
-#else /* __STL_TEMPLATE_FRIENDS */
- friend bool __STD_QUALIFIER
- operator== __STL_NULL_TMPL_ARGS (const multimap&, const multimap&);
- friend bool __STD_QUALIFIER
- operator< __STL_NULL_TMPL_ARGS (const multimap&, const multimap&);
-#endif /* __STL_TEMPLATE_FRIENDS */
};
template <class _Key, class _Tp, class _Compare, class _Alloc>
@@ -234,8 +225,6 @@ inline bool operator<(const multimap<_Key,_Tp,_Compare,_Alloc>& __x,
return __x._M_t < __y._M_t;
}
-#ifdef __STL_FUNCTION_TMPL_PARTIAL_ORDER
-
template <class _Key, class _Tp, class _Compare, class _Alloc>
inline bool operator!=(const multimap<_Key,_Tp,_Compare,_Alloc>& __x,
const multimap<_Key,_Tp,_Compare,_Alloc>& __y) {
@@ -266,14 +255,7 @@ inline void swap(multimap<_Key,_Tp,_Compare,_Alloc>& __x,
__x.swap(__y);
}
-#endif /* __STL_FUNCTION_TMPL_PARTIAL_ORDER */
-
-#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
-#pragma reset woff 1174
-#pragma reset woff 1375
-#endif
-
-__STL_END_NAMESPACE
+} // namespace std
#endif /* __SGI_STL_INTERNAL_MULTIMAP_H */
diff --git a/libstdc++-v3/include/bits/stl_multiset.h b/libstdc++-v3/include/bits/stl_multiset.h
index 7e75ec3cd0a..edeedd16160 100644
--- a/libstdc++-v3/include/bits/stl_multiset.h
+++ b/libstdc++-v3/include/bits/stl_multiset.h
@@ -1,3 +1,32 @@
+// Multiset implementation -*- C++ -*-
+
+// Copyright (C) 2001 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.
+
/*
*
* Copyright (c) 1994
@@ -31,14 +60,10 @@
#ifndef __SGI_STL_INTERNAL_MULTISET_H
#define __SGI_STL_INTERNAL_MULTISET_H
-#include <bits/concept_checks.h>
-
-__STL_BEGIN_NAMESPACE
+#include <bits/concept_check.h>
-#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
-#pragma set woff 1174
-#pragma set woff 1375
-#endif
+namespace std
+{
// Forward declaration of operators < and ==, needed for friend declaration.
@@ -55,11 +80,11 @@ inline bool operator<(const multiset<_Key,_Compare,_Alloc>& __x,
const multiset<_Key,_Compare,_Alloc>& __y);
template <class _Key, class _Compare, class _Alloc>
-class multiset {
- // requirements:
-
- __STL_CLASS_REQUIRES(_Key, _Assignable);
- __STL_CLASS_BINARY_FUNCTION_CHECK(_Compare, bool, _Key, _Key);
+class multiset
+{
+ // concept requirements
+ __glibcpp_class_requires(_Key, _SGIAssignableConcept);
+ __glibcpp_class_requires4(_Compare, bool, _Key, _Key, _BinaryFunctionConcept);
public:
@@ -93,8 +118,6 @@ public:
const allocator_type& __a = allocator_type())
: _M_t(__comp, __a) {}
-#ifdef __STL_MEMBER_TEMPLATES
-
template <class _InputIterator>
multiset(_InputIterator __first, _InputIterator __last)
: _M_t(_Compare(), allocator_type())
@@ -106,29 +129,8 @@ public:
const allocator_type& __a = allocator_type())
: _M_t(__comp, __a) { _M_t.insert_equal(__first, __last); }
-#else
-
- multiset(const value_type* __first, const value_type* __last)
- : _M_t(_Compare(), allocator_type())
- { _M_t.insert_equal(__first, __last); }
-
- multiset(const value_type* __first, const value_type* __last,
- const _Compare& __comp,
- const allocator_type& __a = allocator_type())
- : _M_t(__comp, __a) { _M_t.insert_equal(__first, __last); }
-
- multiset(const_iterator __first, const_iterator __last)
- : _M_t(_Compare(), allocator_type())
- { _M_t.insert_equal(__first, __last); }
-
- multiset(const_iterator __first, const_iterator __last,
- const _Compare& __comp,
- const allocator_type& __a = allocator_type())
- : _M_t(__comp, __a) { _M_t.insert_equal(__first, __last); }
-
-#endif /* __STL_MEMBER_TEMPLATES */
-
multiset(const multiset<_Key,_Compare,_Alloc>& __x) : _M_t(__x._M_t) {}
+
multiset<_Key,_Compare,_Alloc>&
operator=(const multiset<_Key,_Compare,_Alloc>& __x) {
_M_t = __x._M_t;
@@ -159,19 +161,10 @@ public:
return _M_t.insert_equal((_Rep_iterator&)__position, __x);
}
-#ifdef __STL_MEMBER_TEMPLATES
template <class _InputIterator>
void insert(_InputIterator __first, _InputIterator __last) {
_M_t.insert_equal(__first, __last);
}
-#else
- void insert(const value_type* __first, const value_type* __last) {
- _M_t.insert_equal(__first, __last);
- }
- void insert(const_iterator __first, const_iterator __last) {
- _M_t.insert_equal(__first, __last);
- }
-#endif /* __STL_MEMBER_TEMPLATES */
void erase(iterator __position) {
typedef typename _Rep_type::iterator _Rep_iterator;
_M_t.erase((_Rep_iterator&)__position);
@@ -187,8 +180,32 @@ public:
// multiset operations:
- iterator find(const key_type& __x) const { return _M_t.find(__x); }
size_type count(const key_type& __x) const { return _M_t.count(__x); }
+
+#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
+//214. set::find() missing const overload
+ iterator find(const key_type& __x) { return _M_t.find(__x); }
+ const_iterator find(const key_type& __x) const { return _M_t.find(__x); }
+ iterator lower_bound(const key_type& __x) {
+ return _M_t.lower_bound(__x);
+ }
+ const_iterator lower_bound(const key_type& __x) const {
+ return _M_t.lower_bound(__x);
+ }
+ iterator upper_bound(const key_type& __x) {
+ return _M_t.upper_bound(__x);
+ }
+ const_iterator upper_bound(const key_type& __x) const {
+ return _M_t.upper_bound(__x);
+ }
+ pair<iterator,iterator> equal_range(const key_type& __x) {
+ return _M_t.equal_range(__x);
+ }
+ pair<const_iterator,const_iterator> equal_range(const key_type& __x) const {
+ return _M_t.equal_range(__x);
+ }
+#else
+ iterator find(const key_type& __x) const { return _M_t.find(__x); }
iterator lower_bound(const key_type& __x) const {
return _M_t.lower_bound(__x);
}
@@ -198,20 +215,14 @@ public:
pair<iterator,iterator> equal_range(const key_type& __x) const {
return _M_t.equal_range(__x);
}
+#endif
-#ifdef __STL_TEMPLATE_FRIENDS
template <class _K1, class _C1, class _A1>
friend bool operator== (const multiset<_K1,_C1,_A1>&,
const multiset<_K1,_C1,_A1>&);
template <class _K1, class _C1, class _A1>
friend bool operator< (const multiset<_K1,_C1,_A1>&,
const multiset<_K1,_C1,_A1>&);
-#else /* __STL_TEMPLATE_FRIENDS */
- friend bool __STD_QUALIFIER
- operator== __STL_NULL_TMPL_ARGS (const multiset&, const multiset&);
- friend bool __STD_QUALIFIER
- operator< __STL_NULL_TMPL_ARGS (const multiset&, const multiset&);
-#endif /* __STL_TEMPLATE_FRIENDS */
};
template <class _Key, class _Compare, class _Alloc>
@@ -226,8 +237,6 @@ inline bool operator<(const multiset<_Key,_Compare,_Alloc>& __x,
return __x._M_t < __y._M_t;
}
-#ifdef __STL_FUNCTION_TMPL_PARTIAL_ORDER
-
template <class _Key, class _Compare, class _Alloc>
inline bool operator!=(const multiset<_Key,_Compare,_Alloc>& __x,
const multiset<_Key,_Compare,_Alloc>& __y) {
@@ -258,14 +267,7 @@ inline void swap(multiset<_Key,_Compare,_Alloc>& __x,
__x.swap(__y);
}
-#endif /* __STL_FUNCTION_TMPL_PARTIAL_ORDER */
-
-#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
-#pragma reset woff 1174
-#pragma reset woff 1375
-#endif
-
-__STL_END_NAMESPACE
+} // namespace std
#endif /* __SGI_STL_INTERNAL_MULTISET_H */
diff --git a/libstdc++-v3/include/bits/stl_numeric.h b/libstdc++-v3/include/bits/stl_numeric.h
index 0b1742bc9d9..500a2653c6b 100644
--- a/libstdc++-v3/include/bits/stl_numeric.h
+++ b/libstdc++-v3/include/bits/stl_numeric.h
@@ -1,3 +1,32 @@
+// Numeric functions implementation -*- C++ -*-
+
+// Copyright (C) 2001 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.
+
/*
*
* Copyright (c) 1994
@@ -32,12 +61,15 @@
#ifndef _CPP_BITS_STL_NUMERIC_H
#define _CPP_BITS_STL_NUMERIC_H 1
-__STL_BEGIN_NAMESPACE
+namespace std
+{
template <class _InputIterator, class _Tp>
_Tp accumulate(_InputIterator __first, _InputIterator __last, _Tp __init)
{
- __STL_REQUIRES(_InputIterator, _InputIterator);
+ // concept requirements
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIterator>);
+
for ( ; __first != __last; ++__first)
__init = __init + *__first;
return __init;
@@ -47,7 +79,9 @@ template <class _InputIterator, class _Tp, class _BinaryOperation>
_Tp accumulate(_InputIterator __first, _InputIterator __last, _Tp __init,
_BinaryOperation __binary_op)
{
- __STL_REQUIRES(_InputIterator, _InputIterator);
+ // concept requirements
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIterator>);
+
for ( ; __first != __last; ++__first)
__init = __binary_op(__init, *__first);
return __init;
@@ -57,8 +91,10 @@ template <class _InputIterator1, class _InputIterator2, class _Tp>
_Tp inner_product(_InputIterator1 __first1, _InputIterator1 __last1,
_InputIterator2 __first2, _Tp __init)
{
- __STL_REQUIRES(_InputIterator2, _InputIterator);
- __STL_REQUIRES(_InputIterator2, _InputIterator);
+ // concept requirements
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIterator1>);
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIterator2>);
+
for ( ; __first1 != __last1; ++__first1, ++__first2)
__init = __init + (*__first1 * *__first2);
return __init;
@@ -71,8 +107,10 @@ _Tp inner_product(_InputIterator1 __first1, _InputIterator1 __last1,
_BinaryOperation1 __binary_op1,
_BinaryOperation2 __binary_op2)
{
- __STL_REQUIRES(_InputIterator2, _InputIterator);
- __STL_REQUIRES(_InputIterator2, _InputIterator);
+ // concept requirements
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIterator1>);
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIterator2>);
+
for ( ; __first1 != __last1; ++__first1, ++__first2)
__init = __binary_op1(__init, __binary_op2(*__first1, *__first2));
return __init;
@@ -96,11 +134,14 @@ _OutputIterator
partial_sum(_InputIterator __first, _InputIterator __last,
_OutputIterator __result)
{
- __STL_REQUIRES(_InputIterator, _InputIterator);
- __STL_REQUIRES(_OutputIterator, _OutputIterator);
+ // concept requirements
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIterator>);
+ __glibcpp_function_requires(_OutputIteratorConcept<_OutputIterator,
+ typename iterator_traits<_InputIterator>::value_type>);
+
if (__first == __last) return __result;
*__result = *__first;
- return __partial_sum(__first, __last, __result, __VALUE_TYPE(__first));
+ return __partial_sum(__first, __last, __result, __value_type(__first));
}
template <class _InputIterator, class _OutputIterator, class _Tp,
@@ -122,11 +163,14 @@ _OutputIterator
partial_sum(_InputIterator __first, _InputIterator __last,
_OutputIterator __result, _BinaryOperation __binary_op)
{
- __STL_REQUIRES(_InputIterator, _InputIterator);
- __STL_REQUIRES(_OutputIterator, _OutputIterator);
+ // concept requirements
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIterator>);
+ __glibcpp_function_requires(_OutputIteratorConcept<_OutputIterator,
+ typename iterator_traits<_InputIterator>::value_type>);
+
if (__first == __last) return __result;
*__result = *__first;
- return __partial_sum(__first, __last, __result, __VALUE_TYPE(__first),
+ return __partial_sum(__first, __last, __result, __value_type(__first),
__binary_op);
}
@@ -149,12 +193,15 @@ _OutputIterator
adjacent_difference(_InputIterator __first,
_InputIterator __last, _OutputIterator __result)
{
- __STL_REQUIRES(_InputIterator, _InputIterator);
- __STL_REQUIRES(_OutputIterator, _OutputIterator);
+ // concept requirements
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIterator>);
+ __glibcpp_function_requires(_OutputIteratorConcept<_OutputIterator,
+ typename iterator_traits<_InputIterator>::value_type>);
+
if (__first == __last) return __result;
*__result = *__first;
return __adjacent_difference(__first, __last, __result,
- __VALUE_TYPE(__first));
+ __value_type(__first));
}
template <class _InputIterator, class _OutputIterator, class _Tp,
@@ -177,12 +224,15 @@ _OutputIterator
adjacent_difference(_InputIterator __first, _InputIterator __last,
_OutputIterator __result, _BinaryOperation __binary_op)
{
- __STL_REQUIRES(_InputIterator, _InputIterator);
- __STL_REQUIRES(_OutputIterator, _OutputIterator);
+ // concept requirements
+ __glibcpp_function_requires(_InputIteratorConcept<_InputIterator>);
+ __glibcpp_function_requires(_OutputIteratorConcept<_OutputIterator,
+ typename iterator_traits<_InputIterator>::value_type>);
+
if (__first == __last) return __result;
*__result = *__first;
return __adjacent_difference(__first, __last, __result,
- __VALUE_TYPE(__first),
+ __value_type(__first),
__binary_op);
}
@@ -240,13 +290,16 @@ template <class _ForwardIter, class _Tp>
void
iota(_ForwardIter __first, _ForwardIter __last, _Tp __value)
{
- __STL_REQUIRES(_ForwardIter, _Mutable_ForwardIterator);
- __STL_CONVERTIBLE(_Tp, typename iterator_traits<_ForwardIter>::value_type);
+ // concept requirements
+ __glibcpp_function_requires(_Mutable_ForwardIteratorConcept<_ForwardIter>);
+ __glibcpp_function_requires(_ConvertibleConcept<_Tp,
+ typename iterator_traits<_ForwardIter>::value_type>);
+
while (__first != __last)
*__first++ = __value++;
}
-__STL_END_NAMESPACE
+} // namespace std
#endif /* _CPP_BITS_STL_NUMERIC_H */
diff --git a/libstdc++-v3/include/bits/stl_pair.h b/libstdc++-v3/include/bits/stl_pair.h
index 236f916394f..b10f96545f4 100644
--- a/libstdc++-v3/include/bits/stl_pair.h
+++ b/libstdc++-v3/include/bits/stl_pair.h
@@ -1,3 +1,32 @@
+// Pair implementation -*- C++ -*-
+
+// Copyright (C) 2001 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.
+
/*
*
* Copyright (c) 1994
@@ -24,37 +53,49 @@
* purpose. It is provided "as is" without express or implied warranty.
*/
-/* NOTE: This is an internal header file, included by other STL headers.
- * You should not attempt to use it directly.
+/** @file stl_pair.h
+ * This is an internal header file, included by other STL headers. You
+ * should not attempt to use it directly.
*/
#ifndef __SGI_STL_INTERNAL_PAIR_H
#define __SGI_STL_INTERNAL_PAIR_H
-__STL_BEGIN_NAMESPACE
+namespace std
+{
+/// pair holds two objects of arbitrary type.
template <class _T1, class _T2>
struct pair {
- typedef _T1 first_type;
- typedef _T2 second_type;
+ typedef _T1 first_type; ///< @c first_type is the first bound type
+ typedef _T2 second_type; ///< @c second_type is the second bound type
- _T1 first;
- _T2 second;
+ _T1 first; ///< @c first is a copy of the first object
+ _T2 second; ///< @c second is a copy of the second object
+#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
+//265. std::pair::pair() effects overly restrictive
+ /** The default constructor creates @c first and @c second using their
+ * respective default constructors. */
+ pair() : first(), second() {}
+#else
pair() : first(_T1()), second(_T2()) {}
+#endif
+ /** Two objects may be passed to a @c pair constructor to be copied. */
pair(const _T1& __a, const _T2& __b) : first(__a), second(__b) {}
-#ifdef __STL_MEMBER_TEMPLATES
+ /** There is also a templated copy ctor for the @c pair class itself. */
template <class _U1, class _U2>
pair(const pair<_U1, _U2>& __p) : first(__p.first), second(__p.second) {}
-#endif
};
+/// Two pairs of the same type are equal iff their members are equal.
template <class _T1, class _T2>
inline bool operator==(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
{
return __x.first == __y.first && __x.second == __y.second;
}
+/// ...put link to onlinedocs here...
template <class _T1, class _T2>
inline bool operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
{
@@ -62,34 +103,43 @@ inline bool operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
(!(__y.first < __x.first) && __x.second < __y.second);
}
-#ifdef __STL_FUNCTION_TMPL_PARTIAL_ORDER
-
+/// Uses @c operator== to find the result.
template <class _T1, class _T2>
inline bool operator!=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) {
return !(__x == __y);
}
+/// Uses @c operator< to find the result.
template <class _T1, class _T2>
inline bool operator>(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) {
return __y < __x;
}
+/// Uses @c operator< to find the result.
template <class _T1, class _T2>
inline bool operator<=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) {
return !(__y < __x);
}
+/// Uses @c operator< to find the result.
template <class _T1, class _T2>
inline bool operator>=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) {
return !(__x < __y);
}
-#endif /* __STL_FUNCTION_TMPL_PARTIAL_ORDER */
-
+/**
+ * @brief A convenience wrapper for creating a pair from two objects.
+ * @param x The first object.
+ * @param y The second object.
+ * @return A newly-constructed pair<> object of the appropriate type.
+ *
+ * The standard requires that the objects be passed by reference-to-const,
+ * but LWG issue #181 says they should be passed by const value.
+ */
template <class _T1, class _T2>
#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
//181. make_pair() unintended behavior
-inline pair<_T1, _T2> make_pair(const _T1 __x, const _T2 __y)
+inline pair<_T1, _T2> make_pair(_T1 __x, _T2 __y)
#else
inline pair<_T1, _T2> make_pair(const _T1& __x, const _T2& __y)
#endif
@@ -97,7 +147,7 @@ inline pair<_T1, _T2> make_pair(const _T1& __x, const _T2& __y)
return pair<_T1, _T2>(__x, __y);
}
-__STL_END_NAMESPACE
+} // namespace std
#endif /* __SGI_STL_INTERNAL_PAIR_H */
diff --git a/libstdc++-v3/include/bits/stl_pthread_alloc.h b/libstdc++-v3/include/bits/stl_pthread_alloc.h
index c1488b1ef6a..af77be4999a 100644
--- a/libstdc++-v3/include/bits/stl_pthread_alloc.h
+++ b/libstdc++-v3/include/bits/stl_pthread_alloc.h
@@ -1,3 +1,32 @@
+// Wrapper of pthread allocation header -*- C++ -*-
+
+// Copyright (C) 2001 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.
+
/*
* Copyright (c) 1996-1997
* Silicon Graphics Computer Systems, Inc.
@@ -16,13 +45,8 @@
#include <bits/pthread_allocimpl.h>
-#ifdef __STL_USE_NAMESPACES
-
-using __STD::_Pthread_alloc_template;
-using __STD::pthread_alloc;
-
-#endif /* __STL_USE_NAMESPACES */
-
+using std::_Pthread_alloc_template;
+using std::pthread_alloc;
#endif /* _CPP_BITS_STL_PTHREAD_ALLOC_H */
diff --git a/libstdc++-v3/include/bits/stl_queue.h b/libstdc++-v3/include/bits/stl_queue.h
index e42666e5662..1538ca2a977 100644
--- a/libstdc++-v3/include/bits/stl_queue.h
+++ b/libstdc++-v3/include/bits/stl_queue.h
@@ -1,3 +1,32 @@
+// Queue implementation -*- C++ -*-
+
+// Copyright (C) 2001 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.
+
/*
*
* Copyright (c) 1994
@@ -31,9 +60,10 @@
#ifndef __SGI_STL_INTERNAL_QUEUE_H
#define __SGI_STL_INTERNAL_QUEUE_H
-#include <bits/sequence_concepts.h>
+#include <bits/concept_check.h>
-__STL_BEGIN_NAMESPACE
+namespace std
+{
// Forward declarations of operators < and ==, needed for friend declaration.
@@ -49,31 +79,21 @@ inline bool operator<(const queue<_Tp, _Seq>&, const queue<_Tp, _Seq>&);
template <class _Tp, class _Sequence>
-class queue {
-
- // requirements:
-
- __STL_CLASS_REQUIRES(_Tp, _Assignable);
- __STL_CLASS_REQUIRES(_Sequence, _FrontInsertionSequence);
- __STL_CLASS_REQUIRES(_Sequence, _BackInsertionSequence);
+class queue
+{
+ // concept requirements
+ __glibcpp_class_requires(_Tp, _SGIAssignableConcept);
+ __glibcpp_class_requires(_Sequence, _FrontInsertionSequenceConcept);
+ __glibcpp_class_requires(_Sequence, _BackInsertionSequenceConcept);
typedef typename _Sequence::value_type _Sequence_value_type;
- __STL_CLASS_REQUIRES_SAME_TYPE(_Tp, _Sequence_value_type);
-
+ __glibcpp_class_requires2(_Tp, _Sequence_value_type, _SameTypeConcept);
-#ifdef __STL_MEMBER_TEMPLATES
template <class _Tp1, class _Seq1>
friend bool operator== (const queue<_Tp1, _Seq1>&,
const queue<_Tp1, _Seq1>&);
template <class _Tp1, class _Seq1>
friend bool operator< (const queue<_Tp1, _Seq1>&,
const queue<_Tp1, _Seq1>&);
-#else /* __STL_MEMBER_TEMPLATES */
- friend bool __STD_QUALIFIER
- operator== __STL_NULL_TMPL_ARGS (const queue&, const queue&);
- friend bool __STD_QUALIFIER
- operator< __STL_NULL_TMPL_ARGS (const queue&, const queue&);
-#endif /* __STL_MEMBER_TEMPLATES */
-
public:
typedef typename _Sequence::value_type value_type;
typedef typename _Sequence::size_type size_type;
@@ -84,8 +104,7 @@ public:
protected:
_Sequence c;
public:
- queue() : c() {}
- explicit queue(const _Sequence& __c) : c(__c) {}
+ explicit queue(const _Sequence& __c = _Sequence()) : c(__c) {}
bool empty() const { return c.empty(); }
size_type size() const { return c.size(); }
@@ -111,8 +130,6 @@ operator<(const queue<_Tp, _Sequence>& __x, const queue<_Tp, _Sequence>& __y)
return __x.c < __y.c;
}
-#ifdef __STL_FUNCTION_TMPL_PARTIAL_ORDER
-
template <class _Tp, class _Sequence>
bool
operator!=(const queue<_Tp, _Sequence>& __x, const queue<_Tp, _Sequence>& __y)
@@ -141,23 +158,20 @@ operator>=(const queue<_Tp, _Sequence>& __x, const queue<_Tp, _Sequence>& __y)
return !(__x < __y);
}
-#endif /* __STL_FUNCTION_TMPL_PARTIAL_ORDER */
-
template <class _Tp,
- class _Sequence __STL_DEPENDENT_DEFAULT_TMPL(vector<_Tp>),
- class _Compare
- __STL_DEPENDENT_DEFAULT_TMPL(less<typename _Sequence::value_type>) >
-class priority_queue {
-public:
-
- // requirements:
- __STL_CLASS_REQUIRES(_Tp, _Assignable);
- __STL_CLASS_REQUIRES(_Sequence, _Sequence);
- __STL_CLASS_REQUIRES(_Sequence, _RandomAccessContainer);
+ class _Sequence = vector<_Tp>,
+ class _Compare = less<typename _Sequence::value_type> >
+class priority_queue
+{
+ // concept requirements
+ __glibcpp_class_requires(_Tp, _SGIAssignableConcept);
+ __glibcpp_class_requires(_Sequence, _SequenceConcept);
+ __glibcpp_class_requires(_Sequence, _RandomAccessContainerConcept);
typedef typename _Sequence::value_type _Sequence_value_type;
- __STL_CLASS_REQUIRES_SAME_TYPE(_Tp, _Sequence_value_type);
- __STL_CLASS_BINARY_FUNCTION_CHECK(_Compare, bool, _Tp, _Tp);
+ __glibcpp_class_requires2(_Tp, _Sequence_value_type, _SameTypeConcept);
+ __glibcpp_class_requires4(_Compare, bool, _Tp, _Tp, _BinaryFunctionConcept);
+public:
typedef typename _Sequence::value_type value_type;
typedef typename _Sequence::size_type size_type;
typedef _Sequence container_type;
@@ -168,50 +182,21 @@ protected:
_Sequence c;
_Compare comp;
public:
- priority_queue() : c() {}
- explicit priority_queue(const _Compare& __x) : c(), comp(__x) {}
- priority_queue(const _Compare& __x, const _Sequence& __s)
+ explicit priority_queue(const _Compare& __x = _Compare(),
+ const _Sequence& __s = _Sequence())
: c(__s), comp(__x)
{ make_heap(c.begin(), c.end(), comp); }
-#ifdef __STL_MEMBER_TEMPLATES
- template <class _InputIterator>
- priority_queue(_InputIterator __first, _InputIterator __last)
- : c(__first, __last) { make_heap(c.begin(), c.end(), comp); }
-
- template <class _InputIterator>
- priority_queue(_InputIterator __first,
- _InputIterator __last, const _Compare& __x)
- : c(__first, __last), comp(__x)
- { make_heap(c.begin(), c.end(), comp); }
-
template <class _InputIterator>
priority_queue(_InputIterator __first, _InputIterator __last,
- const _Compare& __x, const _Sequence& __s)
+ const _Compare& __x = _Compare(),
+ const _Sequence& __s = _Sequence())
: c(__s), comp(__x)
{
c.insert(c.end(), __first, __last);
make_heap(c.begin(), c.end(), comp);
}
-#else /* __STL_MEMBER_TEMPLATES */
- priority_queue(const value_type* __first, const value_type* __last)
- : c(__first, __last) { make_heap(c.begin(), c.end(), comp); }
-
- priority_queue(const value_type* __first, const value_type* __last,
- const _Compare& __x)
- : c(__first, __last), comp(__x)
- { make_heap(c.begin(), c.end(), comp); }
-
- priority_queue(const value_type* __first, const value_type* __last,
- const _Compare& __x, const _Sequence& __c)
- : c(__c), comp(__x)
- {
- c.insert(c.end(), __first, __last);
- make_heap(c.begin(), c.end(), comp);
- }
-#endif /* __STL_MEMBER_TEMPLATES */
-
bool empty() const { return c.empty(); }
size_type size() const { return c.size(); }
const_reference top() const { return c.front(); }
@@ -233,7 +218,7 @@ public:
// no equality is provided
-__STL_END_NAMESPACE
+} // namespace std
#endif /* __SGI_STL_INTERNAL_QUEUE_H */
diff --git a/libstdc++-v3/include/bits/stl_range_errors.h b/libstdc++-v3/include/bits/stl_range_errors.h
deleted file mode 100644
index c5ddfe63cbb..00000000000
--- a/libstdc++-v3/include/bits/stl_range_errors.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 1999
- * Silicon Graphics
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Silicon Graphics makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- */
-
-#ifndef __STL_RANGE_ERRORS_H
-#define __STL_RANGE_ERRORS_H
-
-// A few places in the STL throw range errors, using standard exception
-// classes defined in <stdexcept>. This header file provides functions
-// to throw those exception objects.
-
-// __STL_DONT_THROW_RANGE_ERRORS is a hook so that users can disable
-// this exception throwing.
-
-#include <bits/stl_config.h>
-
-#if defined(__STL_CAN_THROW_RANGE_ERRORS) && \
- defined(__STL_USE_EXCEPTIONS) && \
- !defined(__STL_DONT_THROW_RANGE_ERRORS)
-# define __STL_THROW_RANGE_ERRORS
-#endif
-
-// For the SGI 7.3 compiler, declare these functions here and define them
-// elsewhere.
-#if defined(__STL_THROW_RANGE_ERRORS) && \
- defined(__sgi) && !defined(__GNUC__) && \
- _COMPILER_VERSION >= 730 && defined(_STANDARD_C_PLUS_PLUS) \
- || defined(__GNUC__) && defined(__STL_THROW_RANGE_ERRORS)
-
-__STL_BEGIN_NAMESPACE
-void __stl_throw_range_error(const char* __msg);
-void __stl_throw_length_error(const char* __msg);
-__STL_END_NAMESPACE
-
-// For other compilers where we're throwing range errors, include the
-// stdexcept header and throw the appropriate exceptions directly.
-#elif defined(__STL_THROW_RANGE_ERRORS)
-
-#include <bits/std_stdexcept.h>
-
-__STL_BEGIN_NAMESPACE
-inline void __stl_throw_range_error(const char* __msg)
- { throw range_error(__msg); }
-inline void __stl_throw_length_error(const char* __msg)
- { throw length_error(__msg); }
-__STL_END_NAMESPACE
-
-// Otherwise, define inline functions that do nothing.
-#else
-
-__STL_BEGIN_NAMESPACE
-inline void __stl_throw_range_error(const char*) {}
-inline void __stl_throw_length_error(const char*) {}
-__STL_END_NAMESPACE
-
-#endif
-
-#endif /* __STL_RANGE_ERRORS_H */
-
-// Local Variables:
-// mode:C++
-// End:
-
-
diff --git a/libstdc++-v3/include/bits/stl_raw_storage_iter.h b/libstdc++-v3/include/bits/stl_raw_storage_iter.h
index 007acd032ed..20157dbb65c 100644
--- a/libstdc++-v3/include/bits/stl_raw_storage_iter.h
+++ b/libstdc++-v3/include/bits/stl_raw_storage_iter.h
@@ -1,3 +1,32 @@
+// -*- C++ -*-
+
+// Copyright (C) 2001 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.
+
/*
*
* Copyright (c) 1994
@@ -31,7 +60,8 @@
#ifndef _CPP_BITS_STL_RAW_STORAGE_ITERATOR_H
#define _CPP_BITS_STL_RAW_STORAGE_ITERATOR_H 1
-__STL_BEGIN_NAMESPACE
+namespace std
+{
template <class _ForwardIterator, class _Tp>
class raw_storage_iterator {
@@ -61,18 +91,8 @@ public:
}
};
-#ifndef __STL_CLASS_PARTIAL_SPECIALIZATION
-
-template <class _ForwardIterator, class _Tp>
-inline output_iterator_tag
-iterator_category(const raw_storage_iterator<_ForwardIterator, _Tp>&)
-{
- return output_iterator_tag();
-}
-
-#endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */
-__STL_END_NAMESPACE
+} // namespace std
#endif /* _CPP_BITS_STL_RAW_STORAGE_ITERATOR_H */
diff --git a/libstdc++-v3/include/bits/stl_relops.h b/libstdc++-v3/include/bits/stl_relops.h
index 338194b5187..567edcfbb0a 100644
--- a/libstdc++-v3/include/bits/stl_relops.h
+++ b/libstdc++-v3/include/bits/stl_relops.h
@@ -1,3 +1,32 @@
+// std::rel_ops implementation -*- C++ -*-
+
+// Copyright (C) 2001 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.
+
/*
*
* Copyright (c) 1994
@@ -41,7 +70,10 @@
#ifndef _CPP_BITS_STL_RELOPS_H
#define _CPP_BITS_STL_RELOPS_H 1
-__STL_BEGIN_RELOPS_NAMESPACE
+namespace std
+{
+ namespace rel_ops
+ {
template <class _Tp>
inline bool operator!=(const _Tp& __x, const _Tp& __y) {
@@ -63,7 +95,8 @@ inline bool operator>=(const _Tp& __x, const _Tp& __y) {
return !(__x < __y);
}
-__STL_END_RELOPS_NAMESPACE
+ } // namespace rel_ops
+} // namespace std
#endif /* _CPP_BITS_STL_RELOPS_H */
diff --git a/libstdc++-v3/include/bits/stl_set.h b/libstdc++-v3/include/bits/stl_set.h
index 435ca38b16e..a9705c56980 100644
--- a/libstdc++-v3/include/bits/stl_set.h
+++ b/libstdc++-v3/include/bits/stl_set.h
@@ -1,3 +1,32 @@
+// Set implementation -*- C++ -*-
+
+// Copyright (C) 2001 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.
+
/*
*
* Copyright (c) 1994
@@ -31,14 +60,10 @@
#ifndef __SGI_STL_INTERNAL_SET_H
#define __SGI_STL_INTERNAL_SET_H
-#include <bits/concept_checks.h>
-
-__STL_BEGIN_NAMESPACE
+#include <bits/concept_check.h>
-#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
-#pragma set woff 1174
-#pragma set woff 1375
-#endif
+namespace std
+{
// Forward declarations of operators < and ==, needed for friend declaration.
@@ -56,15 +81,14 @@ inline bool operator<(const set<_Key,_Compare,_Alloc>& __x,
template <class _Key, class _Compare, class _Alloc>
-class set {
- // requirements:
-
- __STL_CLASS_REQUIRES(_Key, _Assignable);
- __STL_CLASS_BINARY_FUNCTION_CHECK(_Compare, bool, _Key, _Key);
+class set
+{
+ // concept requirements
+ __glibcpp_class_requires(_Key, _SGIAssignableConcept);
+ __glibcpp_class_requires4(_Compare, bool, _Key, _Key, _BinaryFunctionConcept);
public:
// typedefs:
-
typedef _Key key_type;
typedef _Key value_type;
typedef _Compare key_compare;
@@ -93,7 +117,6 @@ public:
const allocator_type& __a = allocator_type())
: _M_t(__comp, __a) {}
-#ifdef __STL_MEMBER_TEMPLATES
template <class _InputIterator>
set(_InputIterator __first, _InputIterator __last)
: _M_t(_Compare(), allocator_type())
@@ -103,24 +126,6 @@ public:
set(_InputIterator __first, _InputIterator __last, const _Compare& __comp,
const allocator_type& __a = allocator_type())
: _M_t(__comp, __a) { _M_t.insert_unique(__first, __last); }
-#else
- set(const value_type* __first, const value_type* __last)
- : _M_t(_Compare(), allocator_type())
- { _M_t.insert_unique(__first, __last); }
-
- set(const value_type* __first,
- const value_type* __last, const _Compare& __comp,
- const allocator_type& __a = allocator_type())
- : _M_t(__comp, __a) { _M_t.insert_unique(__first, __last); }
-
- set(const_iterator __first, const_iterator __last)
- : _M_t(_Compare(), allocator_type())
- { _M_t.insert_unique(__first, __last); }
-
- set(const_iterator __first, const_iterator __last, const _Compare& __comp,
- const allocator_type& __a = allocator_type())
- : _M_t(__comp, __a) { _M_t.insert_unique(__first, __last); }
-#endif /* __STL_MEMBER_TEMPLATES */
set(const set<_Key,_Compare,_Alloc>& __x) : _M_t(__x._M_t) {}
set<_Key,_Compare,_Alloc>& operator=(const set<_Key, _Compare, _Alloc>& __x)
@@ -153,19 +158,10 @@ public:
typedef typename _Rep_type::iterator _Rep_iterator;
return _M_t.insert_unique((_Rep_iterator&)__position, __x);
}
-#ifdef __STL_MEMBER_TEMPLATES
template <class _InputIterator>
void insert(_InputIterator __first, _InputIterator __last) {
_M_t.insert_unique(__first, __last);
}
-#else
- void insert(const_iterator __first, const_iterator __last) {
- _M_t.insert_unique(__first, __last);
- }
- void insert(const value_type* __first, const value_type* __last) {
- _M_t.insert_unique(__first, __last);
- }
-#endif /* __STL_MEMBER_TEMPLATES */
void erase(iterator __position) {
typedef typename _Rep_type::iterator _Rep_iterator;
_M_t.erase((_Rep_iterator&)__position);
@@ -181,10 +177,34 @@ public:
// set operations:
- iterator find(const key_type& __x) const { return _M_t.find(__x); }
size_type count(const key_type& __x) const {
return _M_t.find(__x) == _M_t.end() ? 0 : 1;
}
+
+#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
+//214. set::find() missing const overload
+ iterator find(const key_type& __x) { return _M_t.find(__x); }
+ const_iterator find(const key_type& __x) const { return _M_t.find(__x); }
+ iterator lower_bound(const key_type& __x) {
+ return _M_t.lower_bound(__x);
+ }
+ const_iterator lower_bound(const key_type& __x) const {
+ return _M_t.lower_bound(__x);
+ }
+ iterator upper_bound(const key_type& __x) {
+ return _M_t.upper_bound(__x);
+ }
+ const_iterator upper_bound(const key_type& __x) const {
+ return _M_t.upper_bound(__x);
+ }
+ pair<iterator,iterator> equal_range(const key_type& __x) {
+ return _M_t.equal_range(__x);
+ }
+ pair<const_iterator,const_iterator> equal_range(const key_type& __x) const {
+ return _M_t.equal_range(__x);
+ }
+#else
+ iterator find(const key_type& __x) const { return _M_t.find(__x); }
iterator lower_bound(const key_type& __x) const {
return _M_t.lower_bound(__x);
}
@@ -194,18 +214,12 @@ public:
pair<iterator,iterator> equal_range(const key_type& __x) const {
return _M_t.equal_range(__x);
}
+#endif
-#ifdef __STL_TEMPLATE_FRIENDS
template <class _K1, class _C1, class _A1>
friend bool operator== (const set<_K1,_C1,_A1>&, const set<_K1,_C1,_A1>&);
template <class _K1, class _C1, class _A1>
friend bool operator< (const set<_K1,_C1,_A1>&, const set<_K1,_C1,_A1>&);
-#else /* __STL_TEMPLATE_FRIENDS */
- friend bool __STD_QUALIFIER
- operator== __STL_NULL_TMPL_ARGS (const set&, const set&);
- friend bool __STD_QUALIFIER
- operator< __STL_NULL_TMPL_ARGS (const set&, const set&);
-#endif /* __STL_TEMPLATE_FRIENDS */
};
template <class _Key, class _Compare, class _Alloc>
@@ -220,8 +234,6 @@ inline bool operator<(const set<_Key,_Compare,_Alloc>& __x,
return __x._M_t < __y._M_t;
}
-#ifdef __STL_FUNCTION_TMPL_PARTIAL_ORDER
-
template <class _Key, class _Compare, class _Alloc>
inline bool operator!=(const set<_Key,_Compare,_Alloc>& __x,
const set<_Key,_Compare,_Alloc>& __y) {
@@ -252,14 +264,7 @@ inline void swap(set<_Key,_Compare,_Alloc>& __x,
__x.swap(__y);
}
-#endif /* __STL_FUNCTION_TMPL_PARTIAL_ORDER */
-
-#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
-#pragma reset woff 1174
-#pragma reset woff 1375
-#endif
-
-__STL_END_NAMESPACE
+} // namespace std
#endif /* __SGI_STL_INTERNAL_SET_H */
diff --git a/libstdc++-v3/include/bits/stl_stack.h b/libstdc++-v3/include/bits/stl_stack.h
index aa80f8730ee..5353e4318b9 100644
--- a/libstdc++-v3/include/bits/stl_stack.h
+++ b/libstdc++-v3/include/bits/stl_stack.h
@@ -1,3 +1,32 @@
+// Stack implementation -*- C++ -*-
+
+// Copyright (C) 2001 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.
+
/*
*
* Copyright (c) 1994
@@ -31,9 +60,10 @@
#ifndef __SGI_STL_INTERNAL_STACK_H
#define __SGI_STL_INTERNAL_STACK_H
-#include <bits/sequence_concepts.h>
+#include <bits/concept_check.h>
-__STL_BEGIN_NAMESPACE
+namespace std
+{
// Forward declarations of operators == and <, needed for friend declaration.
@@ -49,30 +79,20 @@ bool operator<(const stack<_Tp,_Seq>& __x, const stack<_Tp,_Seq>& __y);
template <class _Tp, class _Sequence>
-class stack {
-
- // requirements:
-
- __STL_CLASS_REQUIRES(_Tp, _Assignable);
- __STL_CLASS_REQUIRES(_Sequence, _BackInsertionSequence);
+class stack
+{
+ // concept requirements
+ __glibcpp_class_requires(_Tp, _SGIAssignableConcept);
+ __glibcpp_class_requires(_Sequence, _BackInsertionSequenceConcept);
typedef typename _Sequence::value_type _Sequence_value_type;
- __STL_CLASS_REQUIRES_SAME_TYPE(_Tp, _Sequence_value_type);
+ __glibcpp_class_requires2(_Tp, _Sequence_value_type, _SameTypeConcept);
-
-#ifdef __STL_MEMBER_TEMPLATES
template <class _Tp1, class _Seq1>
friend bool operator== (const stack<_Tp1, _Seq1>&,
const stack<_Tp1, _Seq1>&);
template <class _Tp1, class _Seq1>
friend bool operator< (const stack<_Tp1, _Seq1>&,
const stack<_Tp1, _Seq1>&);
-#else /* __STL_MEMBER_TEMPLATES */
- friend bool __STD_QUALIFIER
- operator== __STL_NULL_TMPL_ARGS (const stack&, const stack&);
- friend bool __STD_QUALIFIER
- operator< __STL_NULL_TMPL_ARGS (const stack&, const stack&);
-#endif /* __STL_MEMBER_TEMPLATES */
-
public:
typedef typename _Sequence::value_type value_type;
typedef typename _Sequence::size_type size_type;
@@ -106,8 +126,6 @@ bool operator<(const stack<_Tp,_Seq>& __x, const stack<_Tp,_Seq>& __y)
return __x.c < __y.c;
}
-#ifdef __STL_FUNCTION_TMPL_PARTIAL_ORDER
-
template <class _Tp, class _Seq>
bool operator!=(const stack<_Tp,_Seq>& __x, const stack<_Tp,_Seq>& __y)
{
@@ -132,9 +150,7 @@ bool operator>=(const stack<_Tp,_Seq>& __x, const stack<_Tp,_Seq>& __y)
return !(__x < __y);
}
-#endif /* __STL_FUNCTION_TMPL_PARTIAL_ORDER */
-
-__STL_END_NAMESPACE
+} // namespace std
#endif /* __SGI_STL_INTERNAL_STACK_H */
diff --git a/libstdc++-v3/include/bits/stl_tempbuf.h b/libstdc++-v3/include/bits/stl_tempbuf.h
index cdc0dd27df0..5d3030fe69f 100644
--- a/libstdc++-v3/include/bits/stl_tempbuf.h
+++ b/libstdc++-v3/include/bits/stl_tempbuf.h
@@ -1,3 +1,32 @@
+// Temporary buffer implementation -*- C++ -*-
+
+// Copyright (C) 2001 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.
+
/*
*
* Copyright (c) 1994
@@ -31,7 +60,8 @@
#ifndef __SGI_STL_INTERNAL_TEMPBUF_H
#define __SGI_STL_INTERNAL_TEMPBUF_H
-__STL_BEGIN_NAMESPACE
+namespace std
+{
template <class _Tp>
pair<_Tp*, ptrdiff_t>
@@ -50,15 +80,11 @@ __get_temporary_buffer(ptrdiff_t __len, _Tp*)
return pair<_Tp*, ptrdiff_t>((_Tp*)0, 0);
}
-#ifdef __STL_EXPLICIT_FUNCTION_TMPL_ARGS
-
template <class _Tp>
inline pair<_Tp*, ptrdiff_t> get_temporary_buffer(ptrdiff_t __len) {
return __get_temporary_buffer(__len, (_Tp*) 0);
}
-#endif /* __STL_EXPLICIT_FUNCTION_TMPL_ARGS */
-
// This overload is not required by the standard; it is an extension.
// It is supported for backward compatibility with the HP STL, and
// because not all compilers support the language feature (explicit
@@ -109,12 +135,8 @@ public:
_Temporary_buffer(_ForwardIterator __first, _ForwardIterator __last) {
// Workaround for a __type_traits bug in the pre-7.3 compiler.
-# if defined(__sgi) && !defined(__GNUC__) && _COMPILER_VERSION < 730
- typedef typename __type_traits<_Tp>::is_POD_type _Trivial;
-# else
typedef typename __type_traits<_Tp>::has_trivial_default_constructor
_Trivial;
-# endif
__STL_TRY {
_M_len = 0;
@@ -141,9 +163,7 @@ private:
template <class _ForwardIterator,
class _Tp
-#ifdef __STL_CLASS_PARTIAL_SPECIALIZATION
= typename iterator_traits<_ForwardIterator>::value_type
-#endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */
>
struct temporary_buffer : public _Temporary_buffer<_ForwardIterator, _Tp>
{
@@ -152,7 +172,7 @@ struct temporary_buffer : public _Temporary_buffer<_ForwardIterator, _Tp>
~temporary_buffer() {}
};
-__STL_END_NAMESPACE
+} // namespace std
#endif /* __SGI_STL_INTERNAL_TEMPBUF_H */
diff --git a/libstdc++-v3/include/bits/stl_threads.h b/libstdc++-v3/include/bits/stl_threads.h
index b897a0ea277..b1278c1817f 100644
--- a/libstdc++-v3/include/bits/stl_threads.h
+++ b/libstdc++-v3/include/bits/stl_threads.h
@@ -1,3 +1,32 @@
+// Threading support -*- C++ -*-
+
+// Copyright (C) 2001 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.
+
/*
* Copyright (c) 1997-1999
* Silicon Graphics Computer Systems, Inc.
@@ -24,6 +53,15 @@
// threads standard), and Win32 threads. Uithread support by Jochen
// Schlick, 1999.
+// GCC extension begin
+// In order to present a stable threading configuration, in all cases,
+// gcc looks for it's own abstraction layer before all others. All
+// modifications to this file are marked to allow easier importation of
+// STL upgrades.
+#if defined(__STL_GTHREADS)
+#include "bits/gthr.h"
+#else
+// GCC extension end
#if defined(__STL_SGI_THREADS)
#include <mutex.h>
#include <time.h>
@@ -35,9 +73,12 @@
#elif defined(__STL_WIN32THREADS)
#include <windows.h>
#endif
+// GCC extension begin
+#endif
+// GCC extension end
-__STL_BEGIN_NAMESPACE
-
+namespace std
+{
// Class _Refcount_Base provides a type, _RC_t, a data member,
// _M_ref_count, and member functions _M_incr and _M_decr, which perform
@@ -64,6 +105,22 @@ struct _Refcount_Base
volatile _RC_t _M_ref_count;
// Constructor
+// GCC extension begin
+#ifdef __STL_GTHREADS
+ __gthread_mutex_t _M_ref_count_lock;
+ _Refcount_Base(_RC_t __n) : _M_ref_count(__n)
+ {
+#ifdef __GTHREAD_MUTEX_INIT
+ __gthread_mutex_t __tmp = __GTHREAD_MUTEX_INIT;
+ _M_ref_count_lock = __tmp;
+#elif defined(__GTHREAD_MUTEX_INIT_FUNCTION)
+ __GTHREAD_MUTEX_INIT_FUNCTION (&_M_ref_count_lock);
+#else
+#error __GTHREAD_MUTEX_INIT or __GTHREAD_MUTEX_INIT_FUNCTION should be defined by gthr.h abstraction layer, report problem to libstdc++@gcc.gnu.org.
+#endif
+ }
+#else
+// GCC extension end
# ifdef __STL_PTHREADS
pthread_mutex_t _M_ref_count_lock;
_Refcount_Base(_RC_t __n) : _M_ref_count(__n)
@@ -75,7 +132,25 @@ struct _Refcount_Base
# else
_Refcount_Base(_RC_t __n) : _M_ref_count(__n) {}
# endif
+// GCC extension begin
+#endif
+// GCC extension end
+// GCC extension begin
+#ifdef __STL_GTHREADS
+ void _M_incr() {
+ __gthread_mutex_lock(&_M_ref_count_lock);
+ ++_M_ref_count;
+ __gthread_mutex_unlock(&_M_ref_count_lock);
+ }
+ _RC_t _M_decr() {
+ __gthread_mutex_lock(&_M_ref_count_lock);
+ volatile _RC_t __tmp = --_M_ref_count;
+ __gthread_mutex_unlock(&_M_ref_count_lock);
+ return __tmp;
+ }
+#else
+// GCC extension end
// _M_incr and _M_decr
# ifdef __STL_SGI_THREADS
void _M_incr() { __add_and_fetch(&_M_ref_count, 1); }
@@ -111,12 +186,24 @@ struct _Refcount_Base
void _M_incr() { ++_M_ref_count; }
_RC_t _M_decr() { return --_M_ref_count; }
# endif
+// GCC extension begin
+#endif
+// GCC extension end
};
// Atomic swap on unsigned long
// This is guaranteed to behave as though it were atomic only if all
// possibly concurrent updates use _Atomic_swap.
// In some cases the operation is emulated with a lock.
+// GCC extension begin
+#ifdef __STL_GTHREADS
+// We don't provide an _Atomic_swap in this configuration. This only
+// affects the use of ext/rope with threads. Someone could add this
+// later, if required. You can start by cloning the __STL_PTHREADS
+// path while making the obvious changes. Later it could be optimized
+// to use the atomicity.h abstraction layer from libstdc++-v3.
+#else
+// GCC extension end
# ifdef __STL_SGI_THREADS
inline unsigned long _Atomic_swap(unsigned long * __p, unsigned long __q) {
# if __mips < 3 || !(defined (_ABIN32) || defined(_ABI64))
@@ -205,6 +292,9 @@ struct _Refcount_Base
return __result;
}
# endif
+// GCC extension begin
+#endif
+// GCC extension end
// Locking class. Note that this class *does not have a constructor*.
// It must be initialized either statically, with __STL_MUTEX_INITIALIZER,
@@ -235,8 +325,64 @@ unsigned _STL_mutex_spin<__inst>::__max = _STL_mutex_spin<__inst>::__low_max;
template <int __inst>
unsigned _STL_mutex_spin<__inst>::__last = 0;
+// GCC extension begin
+#if defined(__STL_GTHREADS)
+#if !defined(__GTHREAD_MUTEX_INIT) && defined(__GTHREAD_MUTEX_INIT_FUNCTION)
+extern __gthread_mutex_t _GLIBCPP_mutex;
+extern __gthread_mutex_t *_GLIBCPP_mutex_address;
+extern __gthread_once_t _GLIBCPP_once;
+extern void _GLIBCPP_mutex_init (void);
+extern void _GLIBCPP_mutex_address_init (void);
+#endif
+#endif
+// GCC extension end
+
struct _STL_mutex_lock
{
+// GCC extension begin
+#if defined(__STL_GTHREADS)
+ // The class must be statically initialized with __STL_MUTEX_INITIALIZER.
+#if !defined(__GTHREAD_MUTEX_INIT) && defined(__GTHREAD_MUTEX_INIT_FUNCTION)
+ volatile int _M_init_flag;
+ __gthread_once_t _M_once;
+#endif
+ __gthread_mutex_t _M_lock;
+ void _M_initialize() {
+#ifdef __GTHREAD_MUTEX_INIT
+ // There should be no code in this path given the usage rules above.
+#elif defined(__GTHREAD_MUTEX_INIT_FUNCTION)
+ if (_M_init_flag) return;
+ if (__gthread_once (&_GLIBCPP_once, _GLIBCPP_mutex_init) != 0
+ && __gthread_active_p ())
+ abort ();
+ __gthread_mutex_lock (&_GLIBCPP_mutex);
+ if (!_M_init_flag) {
+ // Even though we have a global lock, we use __gthread_once to be
+ // absolutely certain the _M_lock mutex is only initialized once on
+ // multiprocessor systems.
+ _GLIBCPP_mutex_address = &_M_lock;
+ if (__gthread_once (&_M_once, _GLIBCPP_mutex_address_init) != 0
+ && __gthread_active_p ())
+ abort ();
+ _M_init_flag = 1;
+ }
+ __gthread_mutex_unlock (&_GLIBCPP_mutex);
+#endif
+ }
+ void _M_acquire_lock() {
+#if !defined(__GTHREAD_MUTEX_INIT) && defined(__GTHREAD_MUTEX_INIT_FUNCTION)
+ if (!_M_init_flag) _M_initialize();
+#endif
+ __gthread_mutex_lock(&_M_lock);
+ }
+ void _M_release_lock() {
+#if !defined(__GTHREAD_MUTEX_INIT) && defined(__GTHREAD_MUTEX_INIT_FUNCTION)
+ if (!_M_init_flag) _M_initialize();
+#endif
+ __gthread_mutex_unlock(&_M_lock);
+ }
+#else
+// GCC extension end
#if defined(__STL_SGI_THREADS) || defined(__STL_WIN32THREADS)
// It should be relatively easy to get this to work on any modern Unix.
volatile unsigned long _M_lock;
@@ -330,8 +476,25 @@ struct _STL_mutex_lock
void _M_acquire_lock() {}
void _M_release_lock() {}
#endif
+// GCC extension begin
+#endif
+// GCC extension end
};
+// GCC extension begin
+#if defined(__STL_GTHREADS)
+#ifdef __GTHREAD_MUTEX_INIT
+#define __STL_MUTEX_INITIALIZER = { __GTHREAD_MUTEX_INIT }
+#elif defined(__GTHREAD_MUTEX_INIT_FUNCTION)
+#ifdef __GTHREAD_MUTEX_INIT_DEFAULT
+#define __STL_MUTEX_INITIALIZER \
+ = { 0, __GTHREAD_ONCE_INIT, __GTHREAD_MUTEX_INIT_DEFAULT }
+#else
+#define __STL_MUTEX_INITIALIZER = { 0, __GTHREAD_ONCE_INIT }
+#endif
+#endif
+#else
+// GCC extension end
#ifdef __STL_PTHREADS
// Pthreads locks must be statically initialized to something other than
// the default value of zero.
@@ -345,6 +508,9 @@ struct _STL_mutex_lock
#else
# define __STL_MUTEX_INITIALIZER
#endif
+// GCC extension begin
+#endif
+// GCC extension end
// A locking class that uses _STL_mutex_lock. The constructor takes a
@@ -365,7 +531,7 @@ private:
_STL_auto_lock(const _STL_auto_lock&);
};
-__STL_END_NAMESPACE
+} // namespace std
#endif /* __SGI_STL_INTERNAL_THREADS_H */
@@ -373,7 +539,3 @@ __STL_END_NAMESPACE
// mode:C++
// End:
-
-
-
-
diff --git a/libstdc++-v3/include/bits/stl_tree.h b/libstdc++-v3/include/bits/stl_tree.h
index f82f21c3c07..a9772c3e32e 100644
--- a/libstdc++-v3/include/bits/stl_tree.h
+++ b/libstdc++-v3/include/bits/stl_tree.h
@@ -1,3 +1,32 @@
+// RB tree implementation -*- C++ -*-
+
+// Copyright (C) 2001 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.
+
/*
*
* Copyright (c) 1996,1997
@@ -58,11 +87,8 @@ iterators invalidated are those referring to the deleted node.
#include <bits/stl_construct.h>
#include <bits/stl_function.h>
-__STL_BEGIN_NAMESPACE
-
-#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
-#pragma set woff 1375
-#endif
+namespace std
+{
typedef bool _Rb_tree_Color_type;
const _Rb_tree_Color_type _S_rb_tree_red = false;
@@ -165,9 +191,7 @@ struct _Rb_tree_iterator : public _Rb_tree_base_iterator
_Rb_tree_iterator(const iterator& __it) { _M_node = __it._M_node; }
reference operator*() const { return _Link_type(_M_node)->_M_value_field; }
-#ifndef __SGI_STL_NO_ARROW_OPERATOR
pointer operator->() const { return &(operator*()); }
-#endif /* __SGI_STL_NO_ARROW_OPERATOR */
_Self& operator++() { _M_increment(); return *this; }
_Self operator++(int) {
@@ -220,25 +244,6 @@ inline bool operator!=(const _Rb_tree_iterator<_Value, _Value&, _Value*>& __x,
return __x._M_node != __y._M_node;
}
-#ifndef __STL_CLASS_PARTIAL_SPECIALIZATION
-
-inline bidirectional_iterator_tag
-iterator_category(const _Rb_tree_base_iterator&) {
- return bidirectional_iterator_tag();
-}
-
-inline _Rb_tree_base_iterator::difference_type*
-distance_type(const _Rb_tree_base_iterator&) {
- return (_Rb_tree_base_iterator::difference_type*) 0;
-}
-
-template <class _Value, class _Ref, class _Ptr>
-inline _Value* value_type(const _Rb_tree_iterator<_Value, _Ref, _Ptr>&) {
- return (_Value*) 0;
-}
-
-#endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */
-
inline void
_Rb_tree_rotate_left(_Rb_tree_node_base* __x, _Rb_tree_node_base*& __root)
{
@@ -361,7 +366,7 @@ _Rb_tree_rebalance_for_erase(_Rb_tree_node_base* __z,
else
__z->_M_parent->_M_right = __y;
__y->_M_parent = __z->_M_parent;
- __STD::swap(__y->_M_color, __z->_M_color);
+ std::swap(__y->_M_color, __z->_M_color);
__y = __z;
// __y now points to node to be actually deleted
}
@@ -459,8 +464,6 @@ _Rb_tree_rebalance_for_erase(_Rb_tree_node_base* __z,
// having an empty base class, we arbitrarily move one of rb_tree's
// data members into the base class.
-#ifdef __STL_USE_STD_ALLOCATORS
-
// _Base for general standard-conforming allocators.
template <class _Tp, class _Alloc, bool _S_instanceless>
class _Rb_tree_alloc_base {
@@ -519,30 +522,6 @@ struct _Rb_tree_base
};
-#else /* __STL_USE_STD_ALLOCATORS */
-
-template <class _Tp, class _Alloc>
-struct _Rb_tree_base
-{
- typedef _Alloc allocator_type;
- allocator_type get_allocator() const { return allocator_type(); }
-
- _Rb_tree_base(const allocator_type&)
- : _M_header(0) { _M_header = _M_get_node(); }
- ~_Rb_tree_base() { _M_put_node(_M_header); }
-
-protected:
- _Rb_tree_node<_Tp>* _M_header;
-
- typedef simple_alloc<_Rb_tree_node<_Tp>, _Alloc> _Alloc_type;
-
- _Rb_tree_node<_Tp>* _M_get_node()
- { return _Alloc_type::allocate(1); }
- void _M_put_node(_Rb_tree_node<_Tp>* __p)
- { _Alloc_type::deallocate(__p, 1); }
-};
-
-#endif /* __STL_USE_STD_ALLOCATORS */
template <class _Key, class _Value, class _KeyOfValue, class _Compare,
class _Alloc = allocator<_Value> >
@@ -567,11 +546,9 @@ public:
allocator_type get_allocator() const { return _Base::get_allocator(); }
protected:
-#ifdef __STL_USE_NAMESPACES
using _Base::_M_get_node;
using _Base::_M_put_node;
using _Base::_M_header;
-#endif /* __STL_USE_NAMESPACES */
protected:
@@ -648,17 +625,8 @@ public:
typedef _Rb_tree_iterator<value_type, const_reference, const_pointer>
const_iterator;
-#ifdef __STL_CLASS_PARTIAL_SPECIALIZATION
typedef reverse_iterator<const_iterator> const_reverse_iterator;
typedef reverse_iterator<iterator> reverse_iterator;
-#else /* __STL_CLASS_PARTIAL_SPECIALIZATION */
- typedef reverse_bidirectional_iterator<iterator, value_type, reference,
- difference_type>
- reverse_iterator;
- typedef reverse_bidirectional_iterator<const_iterator, value_type,
- const_reference, difference_type>
- const_reverse_iterator;
-#endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */
private:
iterator _M_insert(_Base_ptr __x, _Base_ptr __y, const value_type& __v);
@@ -726,9 +694,9 @@ public:
size_type max_size() const { return size_type(-1); }
void swap(_Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>& __t) {
- __STD::swap(_M_header, __t._M_header);
- __STD::swap(_M_node_count, __t._M_node_count);
- __STD::swap(_M_key_compare, __t._M_key_compare);
+ std::swap(_M_header, __t._M_header);
+ std::swap(_M_node_count, __t._M_node_count);
+ std::swap(_M_key_compare, __t._M_key_compare);
}
public:
@@ -739,17 +707,10 @@ public:
iterator insert_unique(iterator __position, const value_type& __x);
iterator insert_equal(iterator __position, const value_type& __x);
-#ifdef __STL_MEMBER_TEMPLATES
template <class _InputIterator>
void insert_unique(_InputIterator __first, _InputIterator __last);
template <class _InputIterator>
void insert_equal(_InputIterator __first, _InputIterator __last);
-#else /* __STL_MEMBER_TEMPLATES */
- void insert_unique(const_iterator __first, const_iterator __last);
- void insert_unique(const value_type* __first, const value_type* __last);
- void insert_equal(const_iterator __first, const_iterator __last);
- void insert_equal(const value_type* __first, const value_type* __last);
-#endif /* __STL_MEMBER_TEMPLATES */
void erase(iterator __position);
size_type erase(const key_type& __x);
@@ -802,8 +763,6 @@ operator<(const _Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>& __x,
__y.begin(), __y.end());
}
-#ifdef __STL_FUNCTION_TMPL_PARTIAL_ORDER
-
template <class _Key, class _Value, class _KeyOfValue,
class _Compare, class _Alloc>
inline bool
@@ -846,8 +805,6 @@ swap(_Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>& __x,
__x.swap(__y);
}
-#endif /* __STL_FUNCTION_TMPL_PARTIAL_ORDER */
-
template <class _Key, class _Value, class _KeyOfValue,
class _Compare, class _Alloc>
@@ -963,7 +920,7 @@ _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>
{
if (__position._M_node == _M_header->_M_left) { // begin()
if (size() > 0 &&
- _M_key_compare(_S_key(__position._M_node), _KeyOfValue()(__v)))
+ _M_key_compare(_KeyOfValue()(__v), _S_key(__position._M_node)))
return _M_insert(__position._M_node, __position._M_node, __v);
// first argument just needs to be non-null
else
@@ -1021,8 +978,6 @@ _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>
}
}
-#ifdef __STL_MEMBER_TEMPLATES
-
template <class _Key, class _Val, class _KoV, class _Cmp, class _Alloc>
template<class _II>
void _Rb_tree<_Key,_Val,_KoV,_Cmp,_Alloc>
@@ -1040,45 +995,6 @@ void _Rb_tree<_Key,_Val,_KoV,_Cmp,_Alloc>
insert_unique(*__first);
}
-#else /* __STL_MEMBER_TEMPLATES */
-
-template <class _Key, class _Val, class _KoV, class _Cmp, class _Alloc>
-void
-_Rb_tree<_Key,_Val,_KoV,_Cmp,_Alloc>
- ::insert_equal(const _Val* __first, const _Val* __last)
-{
- for ( ; __first != __last; ++__first)
- insert_equal(*__first);
-}
-
-template <class _Key, class _Val, class _KoV, class _Cmp, class _Alloc>
-void
-_Rb_tree<_Key,_Val,_KoV,_Cmp,_Alloc>
- ::insert_equal(const_iterator __first, const_iterator __last)
-{
- for ( ; __first != __last; ++__first)
- insert_equal(*__first);
-}
-
-template <class _Key, class _Val, class _KoV, class _Cmp, class _Alloc>
-void
-_Rb_tree<_Key,_Val,_KoV,_Cmp,_Alloc>
- ::insert_unique(const _Val* __first, const _Val* __last)
-{
- for ( ; __first != __last; ++__first)
- insert_unique(*__first);
-}
-
-template <class _Key, class _Val, class _KoV, class _Cmp, class _Alloc>
-void _Rb_tree<_Key,_Val,_KoV,_Cmp,_Alloc>
- ::insert_unique(const_iterator __first, const_iterator __last)
-{
- for ( ; __first != __last; ++__first)
- insert_unique(*__first);
-}
-
-#endif /* __STL_MEMBER_TEMPLATES */
-
template <class _Key, class _Value, class _KeyOfValue,
class _Compare, class _Alloc>
inline void _Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>
@@ -1381,11 +1297,7 @@ struct rb_tree : public _Rb_tree<_Key, _Value, _KeyOfValue, _Compare, _Alloc>
~rb_tree() {}
};
-#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
-#pragma reset woff 1375
-#endif
-
-__STL_END_NAMESPACE
+} // namespace std
#endif /* __SGI_STL_INTERNAL_TREE_H */
diff --git a/libstdc++-v3/include/bits/stl_uninitialized.h b/libstdc++-v3/include/bits/stl_uninitialized.h
index a9b196be347..f4dbac48f17 100644
--- a/libstdc++-v3/include/bits/stl_uninitialized.h
+++ b/libstdc++-v3/include/bits/stl_uninitialized.h
@@ -1,3 +1,32 @@
+// Raw memory manipulators -*- C++ -*-
+
+// Copyright (C) 2001 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.
+
/*
*
* Copyright (c) 1994
@@ -33,7 +62,8 @@
#include <bits/std_cstring.h>
-__STL_BEGIN_NAMESPACE
+namespace std
+{
// uninitialized_copy
@@ -79,7 +109,7 @@ inline _ForwardIter
_ForwardIter __result)
{
return __uninitialized_copy(__first, __last, __result,
- __VALUE_TYPE(__result));
+ __value_type(__result));
}
inline char* uninitialized_copy(const char* __first, const char* __last,
@@ -129,7 +159,7 @@ inline pair<_InputIter, _ForwardIter>
__uninitialized_copy_n(_InputIter __first, _Size __count,
_ForwardIter __result) {
return __uninitialized_copy_n(__first, __count, __result,
- __ITERATOR_CATEGORY(__first));
+ __iterator_category(__first));
}
template <class _InputIter, class _Size, class _ForwardIter>
@@ -137,7 +167,7 @@ inline pair<_InputIter, _ForwardIter>
uninitialized_copy_n(_InputIter __first, _Size __count,
_ForwardIter __result) {
return __uninitialized_copy_n(__first, __count, __result,
- __ITERATOR_CATEGORY(__first));
+ __iterator_category(__first));
}
// Valid if copy construction is equivalent to assignment, and if the
@@ -177,7 +207,7 @@ inline void uninitialized_fill(_ForwardIter __first,
_ForwardIter __last,
const _Tp& __x)
{
- __uninitialized_fill(__first, __last, __x, __VALUE_TYPE(__first));
+ __uninitialized_fill(__first, __last, __x, __value_type(__first));
}
// Valid if copy construction is equivalent to assignment, and if the
@@ -216,7 +246,7 @@ template <class _ForwardIter, class _Size, class _Tp>
inline _ForwardIter
uninitialized_fill_n(_ForwardIter __first, _Size __n, const _Tp& __x)
{
- return __uninitialized_fill_n(__first, __n, __x, __VALUE_TYPE(__first));
+ return __uninitialized_fill_n(__first, __n, __x, __value_type(__first));
}
// Extensions: __uninitialized_copy_copy, __uninitialized_copy_fill,
@@ -272,7 +302,7 @@ __uninitialized_copy_fill(_InputIter __first1, _InputIter __last1,
__STL_UNWIND(_Destroy(__first2, __mid2));
}
-__STL_END_NAMESPACE
+} // namespace std
#endif /* _CPP_BITS_STL_UNINITIALIZED_H */
diff --git a/libstdc++-v3/include/bits/stl_vector.h b/libstdc++-v3/include/bits/stl_vector.h
index 0727df6fac1..485503c0acb 100644
--- a/libstdc++-v3/include/bits/stl_vector.h
+++ b/libstdc++-v3/include/bits/stl_vector.h
@@ -1,3 +1,32 @@
+// Vector implementation -*- C++ -*-
+
+// Copyright (C) 2001 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.
+
/*
*
* Copyright (c) 1994
@@ -31,16 +60,12 @@
#ifndef __SGI_STL_INTERNAL_VECTOR_H
#define __SGI_STL_INTERNAL_VECTOR_H
-#include <bits/exception_support.h>
-
-#include <bits/concept_checks.h>
-
-__STL_BEGIN_NAMESPACE
+#include <bits/stl_iterator_base_funcs.h>
+#include <bits/functexcept.h>
+#include <bits/concept_check.h>
-#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
-#pragma set woff 1174
-#pragma set woff 1375
-#endif
+namespace std
+{
// The vector base class serves two purposes. First, its constructor
// and destructor allocate (but don't initialize) storage. This makes
@@ -48,8 +73,6 @@ __STL_BEGIN_NAMESPACE
// the differences between SGI-style allocators and standard-conforming
// allocators.
-#ifdef __STL_USE_STD_ALLOCATORS
-
// Base class for ordinary allocators.
template <class _Tp, class _Allocator, bool _IsStatic>
class _Vector_alloc_base {
@@ -119,46 +142,12 @@ struct _Vector_base
~_Vector_base() { _M_deallocate(_M_start, _M_end_of_storage - _M_start); }
};
-#else /* __STL_USE_STD_ALLOCATORS */
-
-template <class _Tp, class _Alloc>
-class _Vector_base {
-public:
- typedef _Alloc allocator_type;
- allocator_type get_allocator() const { return allocator_type(); }
-
- _Vector_base(const _Alloc&)
- : _M_start(0), _M_finish(0), _M_end_of_storage(0) {}
- _Vector_base(size_t __n, const _Alloc&)
- : _M_start(0), _M_finish(0), _M_end_of_storage(0)
- {
- _M_start = _M_allocate(__n);
- _M_finish = _M_start;
- _M_end_of_storage = _M_start + __n;
- }
-
- ~_Vector_base() { _M_deallocate(_M_start, _M_end_of_storage - _M_start); }
-
-protected:
- _Tp* _M_start;
- _Tp* _M_finish;
- _Tp* _M_end_of_storage;
-
- typedef simple_alloc<_Tp, _Alloc> _M_data_allocator;
- _Tp* _M_allocate(size_t __n)
- { return _M_data_allocator::allocate(__n); }
- void _M_deallocate(_Tp* __p, size_t __n)
- { _M_data_allocator::deallocate(__p, __n); }
-};
-
-#endif /* __STL_USE_STD_ALLOCATORS */
template <class _Tp, class _Alloc = allocator<_Tp> >
class vector : protected _Vector_base<_Tp, _Alloc>
{
- // requirements:
-
- __STL_CLASS_REQUIRES(_Tp, _Assignable);
+ // concept requirements
+ __glibcpp_class_requires(_Tp, _SGIAssignableConcept);
private:
typedef _Vector_base<_Tp, _Alloc> _Base;
@@ -177,24 +166,15 @@ public:
typedef typename _Base::allocator_type allocator_type;
allocator_type get_allocator() const { return _Base::get_allocator(); }
-#ifdef __STL_CLASS_PARTIAL_SPECIALIZATION
typedef reverse_iterator<const_iterator> const_reverse_iterator;
typedef reverse_iterator<iterator> reverse_iterator;
-#else /* __STL_CLASS_PARTIAL_SPECIALIZATION */
- typedef reverse_iterator<const_iterator, value_type, const_reference,
- difference_type> const_reverse_iterator;
- typedef reverse_iterator<iterator, value_type, reference, difference_type>
- reverse_iterator;
-#endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */
protected:
-#ifdef __STL_HAS_NAMESPACES
using _Base::_M_allocate;
using _Base::_M_deallocate;
using _Base::_M_start;
using _Base::_M_finish;
using _Base::_M_end_of_storage;
-#endif /* __STL_HAS_NAMESPACES */
protected:
void _M_insert_aux(iterator __position, const _Tp& __x);
@@ -228,17 +208,15 @@ public:
reference operator[](size_type __n) { return *(begin() + __n); }
const_reference operator[](size_type __n) const { return *(begin() + __n); }
-#ifdef __STL_THROW_RANGE_ERRORS
void _M_range_check(size_type __n) const {
if (__n >= this->size())
- __out_of_range("vector");
+ __throw_out_of_range("vector");
}
reference at(size_type __n)
{ _M_range_check(__n); return (*this)[__n]; }
const_reference at(size_type __n) const
{ _M_range_check(__n); return (*this)[__n]; }
-#endif /* __STL_THROW_RANGE_ERRORS */
explicit vector(const allocator_type& __a = allocator_type())
: _Base(__a) {}
@@ -256,7 +234,6 @@ public:
: _Base(__x.size(), __x.get_allocator())
{ _M_finish = uninitialized_copy(__x.begin(), __x.end(), _M_start); }
-#ifdef __STL_MEMBER_TEMPLATES
// Check whether it's an integral type. If so, it's not an iterator.
template <class _InputIterator>
vector(_InputIterator __first, _InputIterator __last,
@@ -275,16 +252,9 @@ public:
template <class _InputIterator>
void _M_initialize_aux(_InputIterator __first, _InputIterator __last,
__false_type) {
- _M_range_initialize(__first, __last, __ITERATOR_CATEGORY(__first));
+ _M_range_initialize(__first, __last, __iterator_category(__first));
}
-#else
- vector(const _Tp* __first, const _Tp* __last,
- const allocator_type& __a = allocator_type())
- : _Base(__last - __first, __a)
- { _M_finish = uninitialized_copy(__first, __last, _M_start); }
-#endif /* __STL_MEMBER_TEMPLATES */
-
~vector() { destroy(_M_start, _M_finish); }
vector<_Tp, _Alloc>& operator=(const vector<_Tp, _Alloc>& __x);
@@ -308,8 +278,6 @@ public:
void assign(size_type __n, const _Tp& __val) { _M_fill_assign(__n, __val); }
void _M_fill_assign(size_type __n, const _Tp& __val);
-#ifdef __STL_MEMBER_TEMPLATES
-
template <class _InputIterator>
void assign(_InputIterator __first, _InputIterator __last) {
typedef typename _Is_integer<_InputIterator>::_Integral _Integral;
@@ -322,7 +290,7 @@ public:
template <class _InputIter>
void _M_assign_dispatch(_InputIter __first, _InputIter __last, __false_type)
- { _M_assign_aux(__first, __last, __ITERATOR_CATEGORY(__first)); }
+ { _M_assign_aux(__first, __last, __iterator_category(__first)); }
template <class _InputIterator>
void _M_assign_aux(_InputIterator __first, _InputIterator __last,
@@ -332,8 +300,6 @@ public:
void _M_assign_aux(_ForwardIterator __first, _ForwardIterator __last,
forward_iterator_tag);
-#endif /* __STL_MEMBER_TEMPLATES */
-
reference front() { return *begin(); }
const_reference front() const { return *begin(); }
reference back() { return *(end() - 1); }
@@ -356,9 +322,9 @@ public:
_M_insert_aux(end());
}
void swap(vector<_Tp, _Alloc>& __x) {
- __STD::swap(_M_start, __x._M_start);
- __STD::swap(_M_finish, __x._M_finish);
- __STD::swap(_M_end_of_storage, __x._M_end_of_storage);
+ std::swap(_M_start, __x._M_start);
+ std::swap(_M_finish, __x._M_finish);
+ std::swap(_M_end_of_storage, __x._M_end_of_storage);
}
iterator insert(iterator __position, const _Tp& __x) {
@@ -381,7 +347,6 @@ public:
_M_insert_aux(iterator(__position));
return begin() + __n;
}
-#ifdef __STL_MEMBER_TEMPLATES
// Check whether it's an integral type. If so, it's not an iterator.
template <class _InputIterator>
void insert(iterator __pos, _InputIterator __first, _InputIterator __last) {
@@ -398,12 +363,8 @@ public:
void _M_insert_dispatch(iterator __pos,
_InputIterator __first, _InputIterator __last,
__false_type) {
- _M_range_insert(__pos, __first, __last, __ITERATOR_CATEGORY(__first));
+ _M_range_insert(__pos, __first, __last, __iterator_category(__first));
}
-#else /* __STL_MEMBER_TEMPLATES */
- void insert(iterator __position,
- const_iterator __first, const_iterator __last);
-#endif /* __STL_MEMBER_TEMPLATES */
void insert (iterator __pos, size_type __n, const _Tp& __x)
{ _M_fill_insert(__pos, __n, __x); }
@@ -439,33 +400,18 @@ public:
protected:
-#ifdef __STL_MEMBER_TEMPLATES
template <class _ForwardIterator>
pointer _M_allocate_and_copy(size_type __n, _ForwardIterator __first,
_ForwardIterator __last)
-{
- pointer __result = _M_allocate(__n);
- __STL_TRY {
- uninitialized_copy(__first, __last, __result);
- return __result;
- }
- __STL_UNWIND(_M_deallocate(__result, __n));
- }
-#else /* __STL_MEMBER_TEMPLATES */
- pointer _M_allocate_and_copy(size_type __n, const_iterator __first,
- const_iterator __last)
{
- iterator __result(_M_allocate(__n));
+ pointer __result = _M_allocate(__n);
__STL_TRY {
uninitialized_copy(__first, __last, __result);
return __result;
}
__STL_UNWIND(_M_deallocate(__result, __n));
}
-#endif /* __STL_MEMBER_TEMPLATES */
-
-#ifdef __STL_MEMBER_TEMPLATES
template <class _InputIterator>
void _M_range_initialize(_InputIterator __first,
_InputIterator __last, input_iterator_tag)
@@ -495,8 +441,6 @@ protected:
void _M_range_insert(iterator __pos,
_ForwardIterator __first, _ForwardIterator __last,
forward_iterator_tag);
-
-#endif /* __STL_MEMBER_TEMPLATES */
};
template <class _Tp, class _Alloc>
@@ -515,8 +459,6 @@ operator<(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
__y.begin(), __y.end());
}
-#ifdef __STL_FUNCTION_TMPL_PARTIAL_ORDER
-
template <class _Tp, class _Alloc>
inline void swap(vector<_Tp, _Alloc>& __x, vector<_Tp, _Alloc>& __y)
{
@@ -547,8 +489,6 @@ operator>=(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y) {
return !(__x < __y);
}
-#endif /* __STL_FUNCTION_TMPL_PARTIAL_ORDER */
-
template <class _Tp, class _Alloc>
vector<_Tp,_Alloc>&
vector<_Tp,_Alloc>::operator=(const vector<_Tp, _Alloc>& __x)
@@ -590,8 +530,6 @@ void vector<_Tp, _Alloc>::_M_fill_assign(size_t __n, const value_type& __val)
erase(fill_n(begin(), __n, __val), end());
}
-#ifdef __STL_MEMBER_TEMPLATES
-
template <class _Tp, class _Alloc> template <class _InputIter>
void vector<_Tp, _Alloc>::_M_assign_aux(_InputIter __first, _InputIter __last,
input_iterator_tag) {
@@ -631,8 +569,6 @@ vector<_Tp, _Alloc>::_M_assign_aux(_ForwardIter __first, _ForwardIter __last,
}
}
-#endif /* __STL_MEMBER_TEMPLATES */
-
template <class _Tp, class _Alloc>
void
vector<_Tp, _Alloc>::_M_insert_aux(iterator __position, const _Tp& __x)
@@ -746,8 +682,6 @@ void vector<_Tp, _Alloc>::_M_fill_insert(iterator __position, size_type __n,
}
}
-#ifdef __STL_MEMBER_TEMPLATES
-
template <class _Tp, class _Alloc> template <class _InputIterator>
void
vector<_Tp, _Alloc>::_M_range_insert(iterator __pos,
@@ -813,64 +747,7 @@ vector<_Tp, _Alloc>::_M_range_insert(iterator __position,
}
}
-#else /* __STL_MEMBER_TEMPLATES */
-
-template <class _Tp, class _Alloc>
-void
-vector<_Tp, _Alloc>::insert(iterator __position,
- const_iterator __first,
- const_iterator __last)
-{
- if (__first != __last) {
- size_type __n = 0;
- distance(__first, __last, __n);
- if (size_type(_M_end_of_storage - _M_finish) >= __n) {
- const size_type __elems_after = _M_finish - __position;
- iterator __old_finish(_M_finish);
- if (__elems_after > __n) {
- uninitialized_copy(_M_finish - __n, _M_finish, _M_finish);
- _M_finish += __n;
- copy_backward(__position, __old_finish - __n, __old_finish);
- copy(__first, __last, __position);
- }
- else {
- uninitialized_copy(__first + __elems_after, __last, _M_finish);
- _M_finish += __n - __elems_after;
- uninitialized_copy(__position, __old_finish, _M_finish);
- _M_finish += __elems_after;
- copy(__first, __first + __elems_after, __position);
- }
- }
- else {
- const size_type __old_size = size();
- const size_type __len = __old_size + max(__old_size, __n);
- iterator __new_start(_M_allocate(__len));
- iterator __new_finish(__new_start);
- __STL_TRY {
- __new_finish = uninitialized_copy(_M_start, __position, __new_start);
- __new_finish = uninitialized_copy(__first, __last, __new_finish);
- __new_finish
- = uninitialized_copy(__position, _M_finish, __new_finish);
- }
- __STL_UNWIND((destroy(__new_start,__new_finish),
- _M_deallocate(__new_start,__len)));
- destroy(_M_start, _M_finish);
- _M_deallocate(_M_start, _M_end_of_storage - _M_start);
- _M_start = __new_start;
- _M_finish = __new_finish;
- _M_end_of_storage = __new_start + __len;
- }
- }
-}
-
-#endif /* __STL_MEMBER_TEMPLATES */
-
-#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
-#pragma reset woff 1174
-#pragma reset woff 1375
-#endif
-
-__STL_END_NAMESPACE
+} // namespace std
#endif /* __SGI_STL_INTERNAL_VECTOR_H */
diff --git a/libstdc++-v3/include/bits/streambuf.tcc b/libstdc++-v3/include/bits/streambuf.tcc
index 85111508699..843348c95c4 100644
--- a/libstdc++-v3/include/bits/streambuf.tcc
+++ b/libstdc++-v3/include/bits/streambuf.tcc
@@ -37,7 +37,7 @@
namespace std {
template<typename _CharT, typename _Traits>
- basic_streambuf<_CharT, _Traits>::int_type
+ typename basic_streambuf<_CharT, _Traits>::int_type
basic_streambuf<_CharT, _Traits>::
sbumpc()
{
@@ -54,7 +54,7 @@ namespace std {
}
template<typename _CharT, typename _Traits>
- basic_streambuf<_CharT, _Traits>::int_type
+ typename basic_streambuf<_CharT, _Traits>::int_type
basic_streambuf<_CharT, _Traits>::
sputbackc(char_type __c)
{
@@ -72,7 +72,7 @@ namespace std {
}
template<typename _CharT, typename _Traits>
- basic_streambuf<_CharT, _Traits>::int_type
+ typename basic_streambuf<_CharT, _Traits>::int_type
basic_streambuf<_CharT, _Traits>::
sungetc()
{
@@ -93,7 +93,7 @@ namespace std {
// buffers will still be valid. (This happens if setp is used to set
// the internal buffer to say some externally-allocated sequence.)
template<typename _CharT, typename _Traits>
- basic_streambuf<_CharT, _Traits>::int_type
+ typename basic_streambuf<_CharT, _Traits>::int_type
basic_streambuf<_CharT, _Traits>::
sputc(char_type __c)
{
@@ -131,10 +131,13 @@ namespace std {
if (__ret < __n)
{
int_type __c = this->uflow();
- if (traits_type::eq_int_type(__c, traits_type::eof()))
+ if (__c != traits_type::eof())
+ {
+ traits_type::assign(*__s++, traits_type::to_char_type(__c));
+ ++__ret;
+ }
+ else
break;
- traits_type::assign(*__s++, traits_type::to_char_type(__c));
- ++__ret;
}
}
return __ret;
@@ -166,12 +169,14 @@ namespace std {
if (__ret < __n)
{
- int_type __c = traits_type::to_int_type(*__s);
- int_type __overfc = this->overflow(__c);
- if (traits_type::eq_int_type(__overfc, traits_type::eof()))
+ int_type __c = this->overflow(traits_type::to_int_type(*__s));
+ if (__c != traits_type::eof())
+ {
+ ++__ret;
+ ++__s;
+ }
+ else
break;
- ++__ret;
- ++__s;
}
}
return __ret;
@@ -201,12 +206,8 @@ namespace std {
__sbin->_M_in_cur_move(__xtrct);
if (__xtrct == __bufsize)
{
- int_type __c = __sbin->sgetc();
- if (__c == _Traits::eof())
- {
- __ios.setstate(ios_base::eofbit);
- break;
- }
+ if (__sbin->sgetc() == _Traits::eof())
+ break;
__bufsize = __sbin->in_avail();
}
else
@@ -215,7 +216,7 @@ namespace std {
}
catch(exception& __fail) {
if ((__ios.exceptions() & ios_base::failbit) != 0)
- throw;
+ __throw_exception_again;
}
return __ret;
}
@@ -223,7 +224,3 @@ namespace std {
#endif // _CPP_BITS_STREAMBUF_TCC
-
-
-
-
diff --git a/libstdc++-v3/include/bits/stringfwd.h b/libstdc++-v3/include/bits/stringfwd.h
index 020257437ff..dd8bbe56c0b 100644
--- a/libstdc++-v3/include/bits/stringfwd.h
+++ b/libstdc++-v3/include/bits/stringfwd.h
@@ -34,12 +34,19 @@
#ifndef _CPP_BITS_STRINGFWD_H
#define _CPP_BITS_STRINGFWD_H 1
+#pragma GCC system_header
+
#include <bits/c++config.h>
namespace std
{
template<class _CharT>
struct char_traits;
+
+ template<> struct char_traits<char>;
+#ifdef _GLIBCPP_USE_WCHAR_T
+ template<> struct char_traits<wchar_t>;
+#endif
template<typename _Alloc>
class allocator;
diff --git a/libstdc++-v3/include/bits/type_traits.h b/libstdc++-v3/include/bits/type_traits.h
index dbcaa2a619f..2aedb0b485f 100644
--- a/libstdc++-v3/include/bits/type_traits.h
+++ b/libstdc++-v3/include/bits/type_traits.h
@@ -1,3 +1,32 @@
+// Type traits implementation -*- C++ -*-
+
+// Copyright (C) 2001 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.
+
/*
*
* Copyright (c) 1997
@@ -15,9 +44,9 @@
#ifndef _CPP_BITS_TYPE_TRAITS_H
#define _CPP_BITS_TYPE_TRAITS_H 1
-#ifndef _CPP_BITS_STL_CONFIG_H
-#include <bits/stl_config.h>
-#endif
+#pragma GCC system_header
+
+#include <bits/c++config.h>
/*
This header file provides a framework for allowing compile time dispatch
@@ -86,14 +115,9 @@ struct __type_traits {
};
+// Provide some specializations.
-// Provide some specializations. This is harmless for compilers that
-// have built-in __types_traits support, and essential for compilers
-// that don't.
-
-#ifndef __STL_NO_BOOL
-
-__STL_TEMPLATE_NULL struct __type_traits<bool> {
+template<> struct __type_traits<bool> {
typedef __true_type has_trivial_default_constructor;
typedef __true_type has_trivial_copy_constructor;
typedef __true_type has_trivial_assignment_operator;
@@ -101,9 +125,7 @@ __STL_TEMPLATE_NULL struct __type_traits<bool> {
typedef __true_type is_POD_type;
};
-#endif /* __STL_NO_BOOL */
-
-__STL_TEMPLATE_NULL struct __type_traits<char> {
+template<> struct __type_traits<char> {
typedef __true_type has_trivial_default_constructor;
typedef __true_type has_trivial_copy_constructor;
typedef __true_type has_trivial_assignment_operator;
@@ -111,7 +133,7 @@ __STL_TEMPLATE_NULL struct __type_traits<char> {
typedef __true_type is_POD_type;
};
-__STL_TEMPLATE_NULL struct __type_traits<signed char> {
+template<> struct __type_traits<signed char> {
typedef __true_type has_trivial_default_constructor;
typedef __true_type has_trivial_copy_constructor;
typedef __true_type has_trivial_assignment_operator;
@@ -119,7 +141,7 @@ __STL_TEMPLATE_NULL struct __type_traits<signed char> {
typedef __true_type is_POD_type;
};
-__STL_TEMPLATE_NULL struct __type_traits<unsigned char> {
+template<> struct __type_traits<unsigned char> {
typedef __true_type has_trivial_default_constructor;
typedef __true_type has_trivial_copy_constructor;
typedef __true_type has_trivial_assignment_operator;
@@ -127,9 +149,7 @@ __STL_TEMPLATE_NULL struct __type_traits<unsigned char> {
typedef __true_type is_POD_type;
};
-#ifdef __STL_HAS_WCHAR_T
-
-__STL_TEMPLATE_NULL struct __type_traits<wchar_t> {
+template<> struct __type_traits<wchar_t> {
typedef __true_type has_trivial_default_constructor;
typedef __true_type has_trivial_copy_constructor;
typedef __true_type has_trivial_assignment_operator;
@@ -137,9 +157,7 @@ __STL_TEMPLATE_NULL struct __type_traits<wchar_t> {
typedef __true_type is_POD_type;
};
-#endif /* __STL_HAS_WCHAR_T */
-
-__STL_TEMPLATE_NULL struct __type_traits<short> {
+template<> struct __type_traits<short> {
typedef __true_type has_trivial_default_constructor;
typedef __true_type has_trivial_copy_constructor;
typedef __true_type has_trivial_assignment_operator;
@@ -147,7 +165,7 @@ __STL_TEMPLATE_NULL struct __type_traits<short> {
typedef __true_type is_POD_type;
};
-__STL_TEMPLATE_NULL struct __type_traits<unsigned short> {
+template<> struct __type_traits<unsigned short> {
typedef __true_type has_trivial_default_constructor;
typedef __true_type has_trivial_copy_constructor;
typedef __true_type has_trivial_assignment_operator;
@@ -155,7 +173,7 @@ __STL_TEMPLATE_NULL struct __type_traits<unsigned short> {
typedef __true_type is_POD_type;
};
-__STL_TEMPLATE_NULL struct __type_traits<int> {
+template<> struct __type_traits<int> {
typedef __true_type has_trivial_default_constructor;
typedef __true_type has_trivial_copy_constructor;
typedef __true_type has_trivial_assignment_operator;
@@ -163,7 +181,7 @@ __STL_TEMPLATE_NULL struct __type_traits<int> {
typedef __true_type is_POD_type;
};
-__STL_TEMPLATE_NULL struct __type_traits<unsigned int> {
+template<> struct __type_traits<unsigned int> {
typedef __true_type has_trivial_default_constructor;
typedef __true_type has_trivial_copy_constructor;
typedef __true_type has_trivial_assignment_operator;
@@ -171,7 +189,7 @@ __STL_TEMPLATE_NULL struct __type_traits<unsigned int> {
typedef __true_type is_POD_type;
};
-__STL_TEMPLATE_NULL struct __type_traits<long> {
+template<> struct __type_traits<long> {
typedef __true_type has_trivial_default_constructor;
typedef __true_type has_trivial_copy_constructor;
typedef __true_type has_trivial_assignment_operator;
@@ -179,7 +197,7 @@ __STL_TEMPLATE_NULL struct __type_traits<long> {
typedef __true_type is_POD_type;
};
-__STL_TEMPLATE_NULL struct __type_traits<unsigned long> {
+template<> struct __type_traits<unsigned long> {
typedef __true_type has_trivial_default_constructor;
typedef __true_type has_trivial_copy_constructor;
typedef __true_type has_trivial_assignment_operator;
@@ -187,9 +205,7 @@ __STL_TEMPLATE_NULL struct __type_traits<unsigned long> {
typedef __true_type is_POD_type;
};
-#ifdef __STL_LONG_LONG
-
-__STL_TEMPLATE_NULL struct __type_traits<long long> {
+template<> struct __type_traits<long long> {
typedef __true_type has_trivial_default_constructor;
typedef __true_type has_trivial_copy_constructor;
typedef __true_type has_trivial_assignment_operator;
@@ -197,7 +213,7 @@ __STL_TEMPLATE_NULL struct __type_traits<long long> {
typedef __true_type is_POD_type;
};
-__STL_TEMPLATE_NULL struct __type_traits<unsigned long long> {
+template<> struct __type_traits<unsigned long long> {
typedef __true_type has_trivial_default_constructor;
typedef __true_type has_trivial_copy_constructor;
typedef __true_type has_trivial_assignment_operator;
@@ -205,9 +221,7 @@ __STL_TEMPLATE_NULL struct __type_traits<unsigned long long> {
typedef __true_type is_POD_type;
};
-#endif /* __STL_LONG_LONG */
-
-__STL_TEMPLATE_NULL struct __type_traits<float> {
+template<> struct __type_traits<float> {
typedef __true_type has_trivial_default_constructor;
typedef __true_type has_trivial_copy_constructor;
typedef __true_type has_trivial_assignment_operator;
@@ -215,7 +229,7 @@ __STL_TEMPLATE_NULL struct __type_traits<float> {
typedef __true_type is_POD_type;
};
-__STL_TEMPLATE_NULL struct __type_traits<double> {
+template<> struct __type_traits<double> {
typedef __true_type has_trivial_default_constructor;
typedef __true_type has_trivial_copy_constructor;
typedef __true_type has_trivial_assignment_operator;
@@ -223,7 +237,7 @@ __STL_TEMPLATE_NULL struct __type_traits<double> {
typedef __true_type is_POD_type;
};
-__STL_TEMPLATE_NULL struct __type_traits<long double> {
+template<> struct __type_traits<long double> {
typedef __true_type has_trivial_default_constructor;
typedef __true_type has_trivial_copy_constructor;
typedef __true_type has_trivial_assignment_operator;
@@ -231,8 +245,6 @@ __STL_TEMPLATE_NULL struct __type_traits<long double> {
typedef __true_type is_POD_type;
};
-#ifdef __STL_CLASS_PARTIAL_SPECIALIZATION
-
template <class _Tp>
struct __type_traits<_Tp*> {
typedef __true_type has_trivial_default_constructor;
@@ -242,58 +254,6 @@ struct __type_traits<_Tp*> {
typedef __true_type is_POD_type;
};
-#else /* __STL_CLASS_PARTIAL_SPECIALIZATION */
-
-__STL_TEMPLATE_NULL struct __type_traits<char*> {
- typedef __true_type has_trivial_default_constructor;
- typedef __true_type has_trivial_copy_constructor;
- typedef __true_type has_trivial_assignment_operator;
- typedef __true_type has_trivial_destructor;
- typedef __true_type is_POD_type;
-};
-
-__STL_TEMPLATE_NULL struct __type_traits<signed char*> {
- typedef __true_type has_trivial_default_constructor;
- typedef __true_type has_trivial_copy_constructor;
- typedef __true_type has_trivial_assignment_operator;
- typedef __true_type has_trivial_destructor;
- typedef __true_type is_POD_type;
-};
-
-__STL_TEMPLATE_NULL struct __type_traits<unsigned char*> {
- typedef __true_type has_trivial_default_constructor;
- typedef __true_type has_trivial_copy_constructor;
- typedef __true_type has_trivial_assignment_operator;
- typedef __true_type has_trivial_destructor;
- typedef __true_type is_POD_type;
-};
-
-__STL_TEMPLATE_NULL struct __type_traits<const char*> {
- typedef __true_type has_trivial_default_constructor;
- typedef __true_type has_trivial_copy_constructor;
- typedef __true_type has_trivial_assignment_operator;
- typedef __true_type has_trivial_destructor;
- typedef __true_type is_POD_type;
-};
-
-__STL_TEMPLATE_NULL struct __type_traits<const signed char*> {
- typedef __true_type has_trivial_default_constructor;
- typedef __true_type has_trivial_copy_constructor;
- typedef __true_type has_trivial_assignment_operator;
- typedef __true_type has_trivial_destructor;
- typedef __true_type is_POD_type;
-};
-
-__STL_TEMPLATE_NULL struct __type_traits<const unsigned char*> {
- typedef __true_type has_trivial_default_constructor;
- typedef __true_type has_trivial_copy_constructor;
- typedef __true_type has_trivial_assignment_operator;
- typedef __true_type has_trivial_destructor;
- typedef __true_type is_POD_type;
-};
-
-#endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */
-
// The following could be written in terms of numeric_limits.
// We're doing it separately to reduce the number of dependencies.
@@ -302,70 +262,58 @@ template <class _Tp> struct _Is_integer {
typedef __false_type _Integral;
};
-#ifndef __STL_NO_BOOL
-
-__STL_TEMPLATE_NULL struct _Is_integer<bool> {
+template<> struct _Is_integer<bool> {
typedef __true_type _Integral;
};
-#endif /* __STL_NO_BOOL */
-
-__STL_TEMPLATE_NULL struct _Is_integer<char> {
+template<> struct _Is_integer<char> {
typedef __true_type _Integral;
};
-__STL_TEMPLATE_NULL struct _Is_integer<signed char> {
+template<> struct _Is_integer<signed char> {
typedef __true_type _Integral;
};
-__STL_TEMPLATE_NULL struct _Is_integer<unsigned char> {
+template<> struct _Is_integer<unsigned char> {
typedef __true_type _Integral;
};
-#ifdef __STL_HAS_WCHAR_T
-
-__STL_TEMPLATE_NULL struct _Is_integer<wchar_t> {
+template<> struct _Is_integer<wchar_t> {
typedef __true_type _Integral;
};
-#endif /* __STL_HAS_WCHAR_T */
-
-__STL_TEMPLATE_NULL struct _Is_integer<short> {
+template<> struct _Is_integer<short> {
typedef __true_type _Integral;
};
-__STL_TEMPLATE_NULL struct _Is_integer<unsigned short> {
+template<> struct _Is_integer<unsigned short> {
typedef __true_type _Integral;
};
-__STL_TEMPLATE_NULL struct _Is_integer<int> {
+template<> struct _Is_integer<int> {
typedef __true_type _Integral;
};
-__STL_TEMPLATE_NULL struct _Is_integer<unsigned int> {
+template<> struct _Is_integer<unsigned int> {
typedef __true_type _Integral;
};
-__STL_TEMPLATE_NULL struct _Is_integer<long> {
+template<> struct _Is_integer<long> {
typedef __true_type _Integral;
};
-__STL_TEMPLATE_NULL struct _Is_integer<unsigned long> {
+template<> struct _Is_integer<unsigned long> {
typedef __true_type _Integral;
};
-#ifdef __STL_LONG_LONG
-
-__STL_TEMPLATE_NULL struct _Is_integer<long long> {
+template<> struct _Is_integer<long long> {
typedef __true_type _Integral;
};
-__STL_TEMPLATE_NULL struct _Is_integer<unsigned long long> {
+template<> struct _Is_integer<unsigned long long> {
typedef __true_type _Integral;
};
-#endif /* __STL_LONG_LONG */
-
template<typename _Tp> struct _Is_normal_iterator {
typedef __false_type _Normal;
};
diff --git a/libstdc++-v3/include/bits/valarray_array.h b/libstdc++-v3/include/bits/valarray_array.h
index a97bec9856f..741f646d2b0 100644
--- a/libstdc++-v3/include/bits/valarray_array.h
+++ b/libstdc++-v3/include/bits/valarray_array.h
@@ -32,6 +32,8 @@
#ifndef _CPP_BITS_ARRAY_H
#define _CPP_BITS_ARRAY_H 1
+#pragma GCC system_header
+
#include <bits/c++config.h>
#include <bits/cpp_type_traits.h>
#include <bits/std_cstdlib.h>
diff --git a/libstdc++-v3/include/bits/valarray_meta.h b/libstdc++-v3/include/bits/valarray_meta.h
index da4c93f95cd..002fe5f901b 100644
--- a/libstdc++-v3/include/bits/valarray_meta.h
+++ b/libstdc++-v3/include/bits/valarray_meta.h
@@ -1,6 +1,6 @@
// The template and inlines for the -*- C++ -*- internal _Meta class.
-// Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc.
+// Copyright (C) 1997-1999, 2000, 2001 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,7 +32,10 @@
#ifndef _CPP_VALARRAY_META_H
#define _CPP_VALARRAY_META_H 1
-namespace std {
+#pragma GCC system_header
+
+namespace std
+{
//
// Implementing a loosened valarray return value is tricky.
@@ -652,16 +655,16 @@ namespace std {
valarray<value_type> operator[] (const valarray<bool>&) const;
valarray<value_type> operator[] (const valarray<size_t>&) const;
- _Expr<_UnClos<_Unary_plus,_Expr,_Clos>, value_type>
+ _Expr<_UnClos<_Unary_plus,std::_Expr,_Clos>, value_type>
operator+ () const;
- _Expr<_UnClos<negate,_Expr,_Clos>, value_type>
+ _Expr<_UnClos<negate,std::_Expr,_Clos>, value_type>
operator- () const;
- _Expr<_UnClos<_Bitwise_not,_Expr,_Clos>, value_type>
+ _Expr<_UnClos<_Bitwise_not,std::_Expr,_Clos>, value_type>
operator~ () const;
- _Expr<_UnClos<logical_not,_Expr,_Clos>, bool>
+ _Expr<_UnClos<logical_not,std::_Expr,_Clos>, bool>
operator! () const;
size_t size () const;
@@ -766,16 +769,16 @@ namespace std {
inline _Expr<_UnClos<logical_not,_Expr,_Dom>, bool>
_Expr<_Dom,_Tp>::operator! () const
{
- typedef _UnClos<logical_not,_Expr,_Dom> _Closure;
+ typedef _UnClos<logical_not,std::_Expr,_Dom> _Closure;
return _Expr<_Closure,_Tp> (_Closure(this->_M_closure));
}
#define _DEFINE_EXPR_UNARY_OPERATOR(_Op, _Name) \
template<class _Dom, typename _Tp> \
-inline _Expr<_UnClos<_Name,_Expr,_Dom>,_Tp> \
+inline _Expr<_UnClos<_Name,std::_Expr,_Dom>,_Tp> \
_Expr<_Dom,_Tp>::operator _Op () const \
{ \
- typedef _UnClos<_Name,_Expr,_Dom> _Closure; \
+ typedef _UnClos<_Name,std::_Expr,_Dom> _Closure; \
return _Expr<_Closure,_Tp> (_Closure (this->_M_closure)); \
}
diff --git a/libstdc++-v3/include/c_shadow/bits/std_cstdlib.h b/libstdc++-v3/include/c_shadow/bits/std_cstdlib.h
index bc41c489960..d219efd6750 100644
--- a/libstdc++-v3/include/c_shadow/bits/std_cstdlib.h
+++ b/libstdc++-v3/include/c_shadow/bits/std_cstdlib.h
@@ -87,7 +87,7 @@ namespace _C_legacy {
# undef div
# undef labs
# undef ldiv
-#ifdef _GLIBCPP_USE_LONG_LONG
+#ifdef _GLIBCPP_USE_C99
# undef llabs
# undef lldiv
#endif
@@ -101,7 +101,7 @@ namespace std {
struct div_t : _C_legacy::_CPP_div_t_capture { };
struct ldiv_t : _C_legacy::_CPP_ldiv_t_capture { };
-#ifdef _GLIBCPP_USE_LONG_LONG
+#ifdef _GLIBCPP_USE_C99
# ifdef _GLIBCPP_HAVE_LLDIV_T
struct lldiv_t : _C_legacy::_CPP_lldiv_t_capture { };
# else
@@ -173,7 +173,7 @@ namespace std {
div(long __n, long __d)
{ ldiv_t __q; __q.quot = __n / __d; __q.rem = __n % __d; return __q; }
-#ifdef _GLIBCPP_USE_LONG_LONG
+#ifdef _GLIBCPP_USE_C99
inline long long
llabs(long long __x) { return __x >= 0 ? __x : -__x; }
diff --git a/libstdc++-v3/include/c_shadow/stdlib.h b/libstdc++-v3/include/c_shadow/stdlib.h
index c75cc5c068f..9740b57b3fc 100644
--- a/libstdc++-v3/include/c_shadow/stdlib.h
+++ b/libstdc++-v3/include/c_shadow/stdlib.h
@@ -47,7 +47,7 @@
// some names and types with the std:: C++ version.
using std::div_t;
using std::ldiv_t;
-#ifdef _GLIBCPP_USE_LONG_LONG
+#ifdef _GLIBCPP_USE_C99
using std::lldiv_t;
#endif
diff --git a/libstdc++-v3/include/c_std/bits/cmath.tcc b/libstdc++-v3/include/c_std/bits/cmath.tcc
index c61df979bfa..9b86bbb9da6 100644
--- a/libstdc++-v3/include/c_std/bits/cmath.tcc
+++ b/libstdc++-v3/include/c_std/bits/cmath.tcc
@@ -32,7 +32,8 @@
#ifndef _CPP_BITS_CMATH_TCC
#define _CPP_BITS_CMATH_TCC 1
-namespace std {
+namespace std
+{
export template<typename _Tp>
_Tp
__cmath_power(_Tp __x, unsigned int __n)
diff --git a/libstdc++-v3/include/c_std/bits/std_cctype.h b/libstdc++-v3/include/c_std/bits/std_cctype.h
index e03a4fd086b..189f4f5384e 100644
--- a/libstdc++-v3/include/c_std/bits/std_cctype.h
+++ b/libstdc++-v3/include/c_std/bits/std_cctype.h
@@ -31,20 +31,15 @@
// ISO C++ 14882: <ccytpe>
//
-// Note: This is not a conforming implementation.
-
#ifndef _CPP_CCTYPE
#define _CPP_CCTYPE 1
-#include <bits/c++config.h>
-
#pragma GCC system_header
#include <ctype.h>
// Get rid of those macros defined in <ctype.h> in lieu of real functions.
#undef isalnum
#undef isalpha
-#undef isblank
#undef iscntrl
#undef isdigit
#undef isgraph
@@ -59,32 +54,19 @@
namespace std
{
- extern "C" int isalnum(int __c);
- extern "C" int isalpha(int __c);
- extern "C" int isblank(int __c);
- extern "C" int iscntrl(int __c);
- extern "C" int isdigit(int __c);
- extern "C" int isgraph(int __c);
- extern "C" int islower(int __c);
- extern "C" int isprint(int __c);
- extern "C" int ispunct(int __c);
- extern "C" int isspace(int __c);
- extern "C" int isupper(int __c);
- extern "C" int isxdigit(int __c);
- extern "C" int tolower(int __c);
- extern "C" int toupper(int __c);
+ using ::isalnum;
+ using ::isalpha;
+ using ::iscntrl;
+ using ::isdigit;
+ using ::isgraph;
+ using ::islower;
+ using ::isprint;
+ using ::ispunct;
+ using ::isspace;
+ using ::isupper;
+ using ::isxdigit;
+ using ::tolower;
+ using ::toupper;
}
#endif
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/libstdc++-v3/include/c_std/bits/std_cerrno.h b/libstdc++-v3/include/c_std/bits/std_cerrno.h
index 1dc2d137e39..7f1cdf66565 100644
--- a/libstdc++-v3/include/c_std/bits/std_cerrno.h
+++ b/libstdc++-v3/include/c_std/bits/std_cerrno.h
@@ -1,6 +1,6 @@
// The -*- C++ -*- error number header.
-// Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc.
+// Copyright (C) 1997, 1998, 1999, 2001 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
@@ -31,21 +31,15 @@
// ISO C++ 14882: 19.3 Error numbers
//
-// Note: This is not a conforming implementation.
-
#ifndef _CPP_CERRNO
#define _CPP_CERRNO 1
#pragma GCC system_header
#include <errno.h>
-namespace std
-{
- extern "C" int errno;
-}
-
+// Adhere to section 17.4.1.2 clause 5 of ISO 14882:1998
+#ifndef errno
+#define errno errno
#endif
-
-
-
+#endif
diff --git a/libstdc++-v3/include/c_std/bits/std_cfloat.h b/libstdc++-v3/include/c_std/bits/std_cfloat.h
index e121c8d685a..80f5ea5c4ab 100644
--- a/libstdc++-v3/include/c_std/bits/std_cfloat.h
+++ b/libstdc++-v3/include/c_std/bits/std_cfloat.h
@@ -31,8 +31,6 @@
// ISO C++ 14882: 18.2.2 Implementation properties: C library
//
-// Note: This is not a conforming implementation.
-
#ifndef _CPP_CFLOAT
#define _CPP_CFLOAT 1
@@ -40,4 +38,3 @@
#include <float.h>
#endif
-
diff --git a/libstdc++-v3/include/c_std/bits/std_climits.h b/libstdc++-v3/include/c_std/bits/std_climits.h
index 87406e68d31..48f6acf4d86 100644
--- a/libstdc++-v3/include/c_std/bits/std_climits.h
+++ b/libstdc++-v3/include/c_std/bits/std_climits.h
@@ -31,8 +31,6 @@
// ISO C++ 14882: 18.2.2 Implementation properties: C library
//
-// Note: This is not a conforming implementation.
-
#ifndef _CPP_CLIMITS
#define _CPP_CLIMITS 1
@@ -40,8 +38,3 @@
#include <limits.h>
#endif
-
-
-
-
-
diff --git a/libstdc++-v3/include/c_std/bits/std_clocale.h b/libstdc++-v3/include/c_std/bits/std_clocale.h
index 9fb5a1e02a2..02eb8fcc90c 100644
--- a/libstdc++-v3/include/c_std/bits/std_clocale.h
+++ b/libstdc++-v3/include/c_std/bits/std_clocale.h
@@ -31,13 +31,9 @@
// ISO C++ 14882: 18.2.2 Implementation properties: C library
//
-// Note: This is not a conforming implementation.
-
#ifndef _CPP_CLOCALE
#define _CPP_CLOCALE 1
-#include <bits/c++config.h>
-
#pragma GCC system_header
#include <locale.h>
@@ -48,11 +44,8 @@
namespace std
{
using ::lconv;
- extern "C" char* setlocale(int, const char*);
- extern "C" struct lconv* localeconv(void);
+ using ::setlocale;
+ using ::localeconv;
}
#endif
-
-
-
diff --git a/libstdc++-v3/include/c_std/bits/std_cmath.h b/libstdc++-v3/include/c_std/bits/std_cmath.h
index 3648b20a5c6..fedc5fb1a98 100644
--- a/libstdc++-v3/include/c_std/bits/std_cmath.h
+++ b/libstdc++-v3/include/c_std/bits/std_cmath.h
@@ -31,14 +31,11 @@
// ISO C++ 14882: 26.5 C library
//
-// Note: This is not a conforming implementation.
-
#ifndef _CPP_CMATH
#define _CPP_CMATH 1
#include <bits/c++config.h>
-#include <bits/std_cstdlib.h>
-
+
#pragma GCC system_header
#include <math.h>
@@ -64,6 +61,7 @@
#undef pow
#undef sin
#undef sinh
+#undef sqrt
#undef tan
#undef tanh
@@ -80,22 +78,17 @@ namespace std
return __x < _Tp() ? -__x : __x;
}
- inline long
- abs(long __i) { return ::labs(__i); }
+ inline float
+ abs(float __x)
+ { return __builtin_fabsf(__x); }
- inline ldiv_t
- div(long __i, long __j) { return ::ldiv(__i, __j); }
+ inline double
+ abs(double __x)
+ { return __builtin_fabs(__x); }
-#if _GLIBCPP_HAVE___BUILTIN_FABSF
- inline float
- abs(float __x) { return __builtin_fabsf(__x); }
-#elif _GLIBCPP_HAVE_FABSF
- inline float
- abs(float __x) { return ::fabsf(__x); }
-#else
- inline float
- abs(float __x) { return __cmath_abs(__x); }
-#endif
+ inline long double
+ abs(long double __x)
+ { return __builtin_fabsl(__x); }
#if _GLIBCPP_HAVE_ACOSF
inline float
@@ -105,6 +98,16 @@ namespace std
acos(float __x) { return ::acos(static_cast<double>(__x)); }
#endif
+ using ::acos;
+
+#if _GLIBCPP_HAVE_ACOSL
+ inline long double
+ acos(long double __x) { return ::acosl(__x); }
+#else
+ inline long double
+ acos(long double __x) { return ::acos(static_cast<double>(__x)); }
+#endif
+
#if _GLIBCPP_HAVE_ASINF
inline float
asin(float __x) { return ::asinf(__x); }
@@ -113,6 +116,16 @@ namespace std
asin(float __x) { return ::asin(static_cast<double>(__x)); }
#endif
+ using ::asin;
+
+#if _GLIBCPP_HAVE_ASINL
+ inline long double
+ asin(long double __x) { return ::asinl(__x); }
+#else
+ inline long double
+ asin(long double __x) { return ::asin(static_cast<double>(__x)); }
+#endif
+
#if _GLIBCPP_HAVE_ATANF
inline float
atan(float __x) { return ::atanf(__x); }
@@ -121,6 +134,16 @@ namespace std
atan(float __x) { return ::atan(static_cast<double>(__x)); }
#endif
+ using ::atan;
+
+#if _GLIBCPP_HAVE_ATANL
+ inline long double
+ atan(long double __x) { return ::atanl(__x); }
+#else
+ inline long double
+ atan(long double __x) { return ::atan(static_cast<double>(__x)); }
+#endif
+
#if _GLIBCPP_HAVE_ATAN2F
inline float
atan2(float __y, float __x) { return ::atan2f(__y, __x); }
@@ -130,6 +153,17 @@ namespace std
{ return ::atan2(static_cast<double>(__y), static_cast<double>(__x)); }
#endif
+ using ::atan2;
+
+#if _GLIBCPP_HAVE_ATAN2L
+ inline long double
+ atan2(long double __y, long double __x) { return ::atan2l(__y, __x); }
+#else
+ inline long double
+ atan2(long double __y, long double __x)
+ { return ::atan2(static_cast<double>(__y), static_cast<double>(__x)); }
+#endif
+
#if _GLIBCPP_HAVE_CEILF
inline float
ceil(float __x) { return ::ceilf(__x); }
@@ -138,17 +172,26 @@ namespace std
ceil(float __x) { return ::ceil(static_cast<double>(__x)); }
#endif
-#if _GLIBCPP_HAVE___BUILTIN_COSF
- inline float
- cos(float __x) { return __builtin_cosf(__x); }
-#elif _GLIBCPP_HAVE_COSF
- inline float
- cos(float __x) { return ::cosf(__x); }
+ using ::ceil;
+
+#if _GLIBCPP_HAVE_CEILL
+ inline long double
+ ceil(long double __x) { return ::ceill(__x); }
#else
- inline float
- cos(float __x) { return ::cos(static_cast<double>(__x)); }
+ inline long double
+ ceil(long double __x) { return ::ceil(static_cast<double>(__x)); }
#endif
+ inline float
+ cos(float __x)
+ { return __builtin_cosf(__x); }
+
+ using ::cos;
+
+ inline long double
+ cos(long double __x)
+ { return __builtin_cosl(__x); }
+
#if _GLIBCPP_HAVE_COSHF
inline float
cosh(float __x) { return ::coshf(__x); }
@@ -157,6 +200,16 @@ namespace std
cosh(float __x) { return ::cosh(static_cast<double>(__x)); }
#endif
+ using ::cosh;
+
+#if _GLIBCPP_HAVE_COSHL
+ inline long double
+ cosh(long double __x) { return ::coshl(__x); }
+#else
+ inline long double
+ cosh(long double __x) { return ::cosh(static_cast<double>(__x)); }
+#endif
+
#if _GLIBCPP_HAVE_EXPF
inline float
exp(float __x) { return ::expf(__x); }
@@ -165,17 +218,26 @@ namespace std
exp(float __x) { return ::exp(static_cast<double>(__x)); }
#endif
-#if _GLIBCPP_HAVE___BUILTIN_FABSF
- inline float
- fabs(float __x) { return __builtin_fabsf(__x); }
-#elif _GLIBCPP_HAVE_FABSF
- inline float
- fabs(float __x) { return ::fabsf(__x); }
+ using ::exp;
+
+#if _GLIBCPP_HAVE_EXPL
+ inline long double
+ exp(long double __x) { return ::expl(__x); }
#else
- inline float
- fabs(float __x) { return __cmath_abs(__x); }
+ inline long double
+ exp(long double __x) { return ::exp(static_cast<double>(__x)); }
#endif
+ inline float
+ fabs(float __x)
+ { return __builtin_fabsf(__x); }
+
+ using ::fabs;
+
+ inline long double
+ fabs(long double __x)
+ { return __builtin_fabsl(__x); }
+
#if _GLIBCPP_HAVE_FLOORF
inline float
floor(float __x) { return ::floorf(__x); }
@@ -184,6 +246,16 @@ namespace std
floor(float __x) { return ::floor(static_cast<double>(__x)); }
#endif
+ using ::floor;
+
+#if _GLIBCPP_HAVE_FLOORL
+ inline long double
+ floor(long double __x) { return ::floorl(__x); }
+#else
+ inline long double
+ floor(long double __x) { return ::floor(static_cast<double>(__x)); }
+#endif
+
#if _GLIBCPP_HAVE_FMODF
inline float
fmod(float __x, float __y) { return ::fmodf(__x, __y); }
@@ -193,6 +265,17 @@ namespace std
{ return ::fmod(static_cast<double>(__x), static_cast<double>(__y)); }
#endif
+ using ::fmod;
+
+#if _GLIBCPP_HAVE_FMODL
+ inline long double
+ fmod(long double __x, long double __y) { return ::fmodl(__x, __y); }
+#else
+ inline long double
+ fmod(long double __x, long double __y)
+ { return ::fmod(static_cast<double>(__x), static_cast<double>(__y)); }
+#endif
+
#if _GLIBCPP_HAVE_FREXPF
inline float
frexp(float __x, int* __exp) { return ::frexpf(__x, __exp); }
@@ -201,6 +284,17 @@ namespace std
frexp(float __x, int* __exp) { return ::frexp(__x, __exp); }
#endif
+ using ::frexp;
+
+#if _GLIBCPP_HAVE_FREXPL
+ inline long double
+ frexp(long double __x, int* __exp) { return ::frexpl(__x, __exp); }
+#else
+ inline long double
+ frexp(long double __x, int* __exp)
+ { return ::frexp(static_cast<double>(__x), __exp); }
+#endif
+
#if _GLIBCPP_HAVE_LDEXPF
inline float
ldexp(float __x, int __exp) { return ::ldexpf(__x, __exp); }
@@ -210,6 +304,17 @@ namespace std
{ return ::ldexp(static_cast<double>(__x), __exp); }
#endif
+ using ::ldexp;
+
+#if _GLIBCPP_HAVE_LDEXPL
+ inline long double
+ ldexp(long double __x, int __exp) { return ::ldexpl(__x, __exp); }
+#else
+ inline long double
+ ldexp(long double __x, int __exp)
+ { return ::ldexp(static_cast<double>(__x), __exp); }
+#endif
+
#if _GLIBCPP_HAVE_LOGF
inline float
log(float __x) { return ::logf(__x); }
@@ -218,6 +323,16 @@ namespace std
{ return ::log(static_cast<double>(__x)); }
#endif
+ using ::log;
+
+#if _GLIBCPP_HAVE_LOGL
+ inline long double
+ log(long double __x) { return ::logl(__x); }
+#else
+ inline long double
+ log(long double __x) { return ::log(static_cast<double>(__x)); }
+#endif
+
#if _GLIBCPP_HAVE_LOG10F
inline float
log10(float __x) { return ::log10f(__x); }
@@ -226,6 +341,16 @@ namespace std
log10(float __x) { return ::log10(static_cast<double>(__x)); }
#endif
+ using ::log10;
+
+#if _GLIBCPP_HAVE_LOG10L
+ inline long double
+ log10(long double __x) { return ::log10l(__x); }
+#else
+ inline long double
+ log10(long double __x) { return ::log10(static_cast<double>(__x)); }
+#endif
+
#if _GLIBCPP_HAVE_MODFF
inline float
modf(float __x, float* __iptr) { return ::modff(__x, __iptr); }
@@ -240,6 +365,22 @@ namespace std
}
#endif
+ using ::modf;
+
+#if _GLIBCPP_HAVE_MODFL
+ inline long double
+ modf(long double __x, long double* __iptr) { return ::modfl(__x, __iptr); }
+#else
+ inline long double
+ modf(long double __x, long double* __iptr)
+ {
+ double __tmp;
+ double __res = ::modf(static_cast<double>(__x), &__tmp);
+ * __iptr = static_cast<long double>(__tmp);
+ return __res;
+ }
+#endif
+
template<typename _Tp>
inline _Tp
__pow_helper(_Tp __x, int __n)
@@ -258,23 +399,39 @@ namespace std
{ return ::pow(static_cast<double>(__x), static_cast<double>(__y)); }
#endif
- inline float
- pow(float __x, int __n)
- {
- return __pow_helper(__x, __n);
- }
+ using ::pow;
-#if _GLIBCPP_HAVE___BUILTIN_SINF
- inline float
- sin(float __x) { return __builtin_sinf(__x); }
-#elif _GLIBCPP_HAVE_SINF
- inline float
- sin(float __x) { return ::sinf(__x); }
+#if _GLIBCPP_HAVE_POWL
+ inline long double
+ pow(long double __x, long double __y) { return ::powl(__x, __y); }
#else
- inline float
- sin(float __x) { return ::sin(static_cast<double>(__x)); }
+ inline long double
+ pow(long double __x, long double __y)
+ { return ::pow(static_cast<double>(__x), static_cast<double>(__y)); }
#endif
+ inline float
+ pow(float __x, int __n)
+ { return __pow_helper(__x, __n); }
+
+ inline double
+ pow(double __x, int __i)
+ { return __pow_helper(__x, __i); }
+
+ inline long double
+ pow(long double __x, int __n)
+ { return __pow_helper(__x, __n); }
+
+ inline float
+ sin(float __x)
+ { return __builtin_sinf(__x); }
+
+ using ::sin;
+
+ inline long double
+ sin(long double __x)
+ { return __builtin_sinl(__x); }
+
#if _GLIBCPP_HAVE_SINHF
inline float
sinh(float __x) { return ::sinhf(__x); }
@@ -283,17 +440,26 @@ namespace std
sinh(float __x) { return ::sinh(static_cast<double>(__x)); }
#endif
-#if _GLIBCPP_HAVE___BUILTIN_SQRTF
- inline float
- sqrt(float __x) { return __builtin_sqrtf(__x); }
-#elif _GLIBCPP_HAVE_SQRTF
- inline float
- sqrt(float __x) { return ::sqrtf(__x); }
+ using ::sinh;
+
+#if _GLIBCPP_HAVE_SINHL
+ inline long double
+ sinh(long double __x) { return ::sinhl(__x); }
#else
- inline float
- sqrt(float __x) { return ::sqrt(static_cast<double>(__x)); }
+ inline long double
+ sinh(long double __x) { return ::sinh(static_cast<double>(__x)); }
#endif
+ inline float
+ sqrt(float __x)
+ { return __builtin_sqrtf(__x); }
+
+ using ::sqrt;
+
+ inline long double
+ sqrt(long double __x)
+ { return __builtin_sqrtl(__x); }
+
#if _GLIBCPP_HAVE_TANF
inline float
tan(float __x) { return ::tanf(__x); }
@@ -302,6 +468,16 @@ namespace std
tan(float __x) { return ::tan(static_cast<double>(__x)); }
#endif
+ using ::tan;
+
+#if _GLIBCPP_HAVE_TANL
+ inline long double
+ tan(long double __x) { return ::tanl(__x); }
+#else
+ inline long double
+ tan(long double __x) { return ::tan(static_cast<double>(__x)); }
+#endif
+
#if _GLIBCPP_HAVE_TANHF
inline float
tanh(float __x) { return ::tanhf(__x); }
@@ -310,306 +486,171 @@ namespace std
tanh(float __x) { return ::tanh(static_cast<double>(__x)); }
#endif
+ using ::tanh;
- extern "C" double acos(double __x);
-
- extern "C" double asin(double __x);
-
- extern "C" double atan(double __x);
-
- extern "C" double atan2(double __y, double __x);
-
- extern "C" double ceil(double __x);
-
-#if _GLIBCPP_HAVE___BUILTIN_COS
- inline double
- cos(double __x) { return __builtin_cos(__x); }
-#else
- extern "C" double cos(double __x);
-#endif
-
- extern "C" double cosh(double __x);
-
- extern "C" double exp(double __x);
-
-#if _GLIBCPP_HAVE___BUILTIN_FABS
- inline double
- fabs(double __x) { return __builtin_fabs(__x); }
-#else
- extern "C" double fabs(double __x);
-#endif
-
-#if _GLIBCPP_HAVE___BUILTIN_FABS
- inline double
- abs(double __x) { return __builtin_fabs(__x); }
-#else
- inline double
- abs(double __x) { return fabs(__x); }
-#endif
-
- extern "C" double floor(double __x);
-
- extern "C" double fmod(double __x, double __y);
-
- extern "C" double frexp(double __x, int* __exp);
-
- extern "C" double ldexp(double __x, int __exp);
-
- extern "C" double log(double __x);
-
- extern "C" double log10(double __x);
-
- extern "C" double modf(double __x, double* __iptr);
-
- extern "C" double pow(double __x, double __y);
-
- inline double
- pow(double __x, int __i)
- {
- return __pow_helper(__x, __i);
- }
-
-#if _GLIBCPP_HAVE___BUILTIN_SIN
- inline double
- sin(double __x) { return __builtin_sin(__x); }
-#else
- extern "C" double sin(double __x);
-#endif
-
- extern "C" double sinh(double __x);
-
-#if _GLIBCPP_HAVE___BUILTIN_SQRT
- inline double
- sqrt(double __x) { return __builtin_fsqrt(__x); }
-#else
- extern "C" double sqrt(double __x);
-#endif
-
- extern "C" double tan(double __x);
-
- extern "C" double tanh(double __x);
-
-
-#if _GLIBCPP_HAVE___BUILTIN_FABSL
- inline long double
- abs(long double __x) { return __builtin_fabsl(__x); }
-#elif _GLIBCPP_HAVE_FABSL
+#if _GLIBCPP_HAVE_TANHL
inline long double
- abs(long double __x) { return ::fabsl(__x); }
+ tanh(long double __x) { return ::tanhl(__x); }
#else
inline long double
- abs(long double __x) { return __cmath_abs(__x); }
+ tanh(long double __x) { return ::tanh(static_cast<double>(__x)); }
#endif
+}
-#if _GLIBCPP_HAVE_ACOSL
- inline long double
- acos(long double __x) { return ::acosl(__x); }
-#else
- inline long double
- acos(long double __x) { return ::acos(static_cast<double>(__x)); }
-#endif
-#if _GLIBCPP_HAVE_ASINL
- inline long double
- asin(long double __x) { return ::asinl(__x); }
-#else
- inline long double
- asin(long double __x) { return ::asin(static_cast<double>(__x)); }
-#endif
+#if _GLIBCPP_USE_C99
+// These are possible macros imported from C99-land. For strict
+// conformance, remove possible C99-injected names from the global
+// namespace, and sequester them in the __gnu_cxx extension namespace.
+namespace __gnu_cxx
+{
+ template<typename _Tp>
+ int
+ __capture_fpclassify(_Tp __f) { return fpclassify(__f); }
-#if _GLIBCPP_HAVE_ATANL
- inline long double
- atan(long double __x) { return ::atanl(__x); }
-#else
- inline long double
- atan(long double __x) { return ::atan(static_cast<double>(__x)); }
-#endif
+ template<typename _Tp>
+ int
+ __capture_isfinite(_Tp __f) { return isfinite(__f); }
-#if _GLIBCPP_HAVE_ATAN2L
- inline long double
- atan2(long double __y, long double __x) { return ::atan2l(__y, __x); }
-#else
- inline long double
- atan2(long double __y, long double __x)
- { return ::atan2(static_cast<double>(__y), static_cast<double>(__x)); }
-#endif
+ template<typename _Tp>
+ int
+ __capture_isinf(_Tp __f) { return isinf(__f); }
-#if _GLIBCPP_HAVE_CEILL
- inline long double
- ceil(long double __x) { return ::ceill(__x); }
-#else
- inline long double
- ceil(long double __x) { return ::ceil(static_cast<double>(__x)); }
-#endif
+ template<typename _Tp>
+ int
+ __capture_isnan(_Tp __f) { return isnan(__f); }
-#if _GLIBCPP_HAVE___BUILTIN_COSL
- inline long double
- cos(long double __x) { return __builtin_cosl(__x); }
-#elif _GLIBCPP_HAVE_COSL
- inline long double
- cos(long double __x) { return ::cosl(__x); }
-#else
- inline long double
- cos(long double __x) { return ::cos(static_cast<double>(__x)); }
-#endif
+ template<typename _Tp>
+ int
+ __capture_isnormal(_Tp __f) { return isnormal(__f); }
-#if _GLIBCPP_HAVE_COSHL
- inline long double
- cosh(long double __x) { return ::coshl(__x); }
-#else
- inline long double
- cosh(long double __x) { return ::cosh(static_cast<double>(__x)); }
-#endif
+ template<typename _Tp>
+ int
+ __capture_signbit(_Tp __f) { return signbit(__f); }
-#if _GLIBCPP_HAVE_EXPL
- inline long double
- exp(long double __x) { return ::expl(__x); }
-#else
- inline long double
- exp(long double __x) { return ::exp(static_cast<double>(__x)); }
-#endif
+ template<typename _Tp>
+ int
+ __capture_isgreater(_Tp __f1, _Tp __f2)
+ { return isgreater(__f1, __f2); }
-#if _GLIBCPP_HAVE___BUILTIN_FABSL
- inline long double
- fabs(long double __x) { return __builtin_fabsl(__x); }
-#elif _GLIBCPP_HAVE_FABSL
- inline long double
- fabs(long double __x) { return ::fabsl(__x); }
-#else
- inline long double
- fabs(long double __x) { return __cmath_abs(__x); }
-#endif
+ template<typename _Tp>
+ int
+ __capture_isgreaterequal(_Tp __f1, _Tp __f2)
+ { return isgreaterequal(__f1, __f2); }
-#if _GLIBCPP_HAVE_FLOORL
- inline long double
- floor(long double __x) { return ::floorl(__x); }
-#else
- inline long double
- floor(long double __x) { return ::floor(static_cast<double>(__x)); }
-#endif
+ template<typename _Tp>
+ int
+ __capture_isless(_Tp __f1, _Tp __f2) { return isless(__f1, __f2); }
-#if _GLIBCPP_HAVE_FMODL
- inline long double
- fmod(long double __x, long double __y) { return ::fmodl(__x, __y); }
-#else
- inline long double
- fmod(long double __x, long double __y)
- { return ::fmod(static_cast<double>(__x), static_cast<double>(__y)); }
-#endif
+ template<typename _Tp>
+ int
+ __capture_islessequal(_Tp __f1, _Tp __f2)
+ { return islessequal(__f1, __f2); }
-#if _GLIBCPP_HAVE_FREXPL
- inline long double
- frexp(long double __x, int* __exp) { return ::frexpl(__x, __exp); }
-#else
- inline long double
- frexp(long double __x, int* __exp)
- { return ::frexp(static_cast<double>(__x), __exp); }
-#endif
+ template<typename _Tp>
+ int
+ __capture_islessgreater(_Tp __f1, _Tp __f2)
+ { return islessgreater(__f1, __f2); }
-#if _GLIBCPP_HAVE_LDEXPL
- inline long double
- ldexp(long double __x, int __exp) { return ::ldexpl(__x, __exp); }
-#else
- inline long double
- ldexp(long double __x, int __exp)
- { return ::ldexp(static_cast<double>(__x), __exp); }
-#endif
+ template<typename _Tp>
+ int
+ __capture_isunordered(_Tp __f1, _Tp __f2)
+ { return isunordered(__f1, __f2); }
+}
+#endif
+
+#undef fpclassify
+#undef isfinite
+#undef isinf
+#undef isnan
+#undef isnormal
+#undef signbit
+#undef isgreater
+#undef isgreaterequal
+#undef isless
+#undef islessequal
+#undef islessgreater
+#undef isunordered
+
+#if _GLIBCPP_USE_C99
+namespace __gnu_cxx
+{
+ template<typename _Tp>
+ int
+ fpclassify(_Tp __f) { return __capture_fpclassify(__f); }
-#if _GLIBCPP_HAVE_LOGL
- inline long double
- log(long double __x) { return ::logl(__x); }
-#else
- inline long double
- log(long double __x) { return ::log(static_cast<double>(__x)); }
-#endif
+ template<typename _Tp>
+ int
+ isfinite(_Tp __f) { return __capture_isfinite(__f); }
-#if _GLIBCPP_HAVE_LOG10L
- inline long double
- log10(long double __x) { return ::log10l(__x); }
-#else
- inline long double
- log10(long double __x) { return ::log10(static_cast<double>(__x)); }
-#endif
+ template<typename _Tp>
+ int
+ isinf(_Tp __f) { return __capture_isinf(__f); }
-#if _GLIBCPP_HAVE_MODFL
- inline long double
- modf(long double __x, long double* __iptr) { return ::modfl(__x, __iptr); }
-#else
- inline long double
- modf(long double __x, long double* __iptr)
- {
- double __tmp;
- double __res = ::modf(static_cast<double>(__x), &__tmp);
- * __iptr = static_cast<long double>(__tmp);
- return __res;
- }
-#endif
+ template<typename _Tp>
+ int
+ isnan(_Tp __f) { return __capture_isnan(__f); }
-#if _GLIBCPP_HAVE_POWL
- inline long double
- pow(long double __x, long double __y) { return ::powl(__x, __y); }
-#else
- inline long double
- pow(long double __x, long double __y)
- { return ::pow(static_cast<double>(__x), static_cast<double>(__y)); }
-#endif
+ template<typename _Tp>
+ int
+ isnormal(_Tp __f) { return __capture_isnormal(__f); }
- inline long double
- pow(long double __x, int __n)
- {
- return __pow_helper(__x, __n);
- }
+ template<typename _Tp>
+ int
+ signbit(_Tp __f) { return __capture_signbit(__f); }
-#if _GLIBCPP_HAVE___BUILTIN_SINL
- inline long double
- sin(long double __x) { return __builtin_sinl(__x); }
-#elif _GLIBCPP_HAVE_SINL
- inline long double
- sin(long double __x) { return ::sinl(__x); }
-#else
- inline long double
- sin(long double __x) { return ::sin(static_cast<double>(__x)); }
-#endif
+ template<typename _Tp>
+ int
+ isgreater(_Tp __f1, _Tp __f2) { return __capture_isgreater(__f1, __f2); }
-#if _GLIBCPP_HAVE_SINHL
- inline long double
- sinh(long double __x) { return ::sinhl(__x); }
-#else
- inline long double
- sinh(long double __x) { return ::sinh(static_cast<double>(__x)); }
-#endif
+ template<typename _Tp>
+ int
+ isgreaterequal(_Tp __f1, _Tp __f2)
+ { return __capture_isgreaterequal(__f1, __f2); }
-#if _GLIBCPP_HAVE___BUILTIN_SQRTL
- inline long double
- sqrt(long double __x) { return __builtin_sqrtl(__x); }
-#elif _GLIBCPP_HAVE_SQRTL
- inline long double
- sqrt(long double __x) { return ::sqrtl(__x); }
-#else
- inline long double
- sqrt(long double __x) { return ::sqrt(static_cast<double>(__x)); }
-#endif
+ template<typename _Tp>
+ int
+ isless(_Tp __f1, _Tp __f2) { return __capture_isless(__f1, __f2); }
-#if _GLIBCPP_HAVE_TANL
- inline long double
- tan(long double __x) { return ::tanl(__x); }
-#else
- inline long double
- tan(long double __x) { return ::tan(static_cast<double>(__x)); }
-#endif
+ template<typename _Tp>
+ int
+ islessequal(_Tp __f1, _Tp __f2)
+ { return __capture_islessequal(__f1, __f2); }
-#if _GLIBCPP_HAVE_TANHL
- inline long double
- tanh(long double __x) { return ::tanhl(__x); }
-#else
- inline long double
- tanh(long double __x) { return ::tanh(static_cast<double>(__x)); }
-#endif
-} // std
+ template<typename _Tp>
+ int
+ islessgreater(_Tp __f1, _Tp __f2)
+ { return __capture_islessgreater(__f1, __f2); }
+
+ template<typename _Tp>
+ int
+ isunordered(_Tp __f1, _Tp __f2)
+ { return __capture_isunordered(__f1, __f2); }
+}
+namespace std
+{
+ using __gnu_cxx::fpclassify;
+ using __gnu_cxx::isfinite;
+ using __gnu_cxx::isinf;
+ using __gnu_cxx::isnan;
+ using __gnu_cxx::isnormal;
+ using __gnu_cxx::signbit;
+ using __gnu_cxx::isgreater;
+ using __gnu_cxx::isgreaterequal;
+ using __gnu_cxx::isless;
+ using __gnu_cxx::islessequal;
+ using __gnu_cxx::islessgreater;
+ using __gnu_cxx::isunordered;
+}
+#endif
+
#ifdef _GLIBCPP_NO_TEMPLATE_EXPORT
# define export
# include <bits/cmath.tcc>
#endif
#endif
+
+
+
diff --git a/libstdc++-v3/include/c_std/bits/std_csetjmp.h b/libstdc++-v3/include/c_std/bits/std_csetjmp.h
index b8c319ce0a7..5db98e7b97e 100644
--- a/libstdc++-v3/include/c_std/bits/std_csetjmp.h
+++ b/libstdc++-v3/include/c_std/bits/std_csetjmp.h
@@ -31,8 +31,6 @@
// ISO C++ 14882: 20.4.6 C library
//
-// Note: This is not a conforming implementation.
-
#ifndef _CPP_CSETJMP
#define _CPP_CSETJMP 1
@@ -42,10 +40,15 @@
// Get rid of those macros defined in <setjmp.h> in lieu of real functions.
#undef longjmp
+// Adhere to section 17.4.1.2 clause 5 of ISO 14882:1998
+#ifndef setjmp
+#define setjmp(env) setjmp (env)
+#endif
+
namespace std
{
using ::jmp_buf;
- extern "C" void longjmp(jmp_buf, int);
+ using ::longjmp;
}
#endif
diff --git a/libstdc++-v3/include/c_std/bits/std_csignal.h b/libstdc++-v3/include/c_std/bits/std_csignal.h
index 437590f7f38..818e7bbbc9c 100644
--- a/libstdc++-v3/include/c_std/bits/std_csignal.h
+++ b/libstdc++-v3/include/c_std/bits/std_csignal.h
@@ -31,8 +31,6 @@
// ISO C++ 14882: 20.4.6 C library
//
-// Note: This is not a conforming implementation.
-
#ifndef _CPP_CSIGNAL
#define _CPP_CSIGNAL 1
@@ -45,8 +43,8 @@
namespace std
{
using ::sig_atomic_t;
- extern "C" void (*signal(int, void (*__func)(int)))(int);
- extern "C" int raise(int);
+ using ::signal;
+ using ::raise;
}
#endif
diff --git a/libstdc++-v3/include/c_std/bits/std_cstdarg.h b/libstdc++-v3/include/c_std/bits/std_cstdarg.h
index 39018be29f2..58faa3b9876 100644
--- a/libstdc++-v3/include/c_std/bits/std_cstdarg.h
+++ b/libstdc++-v3/include/c_std/bits/std_cstdarg.h
@@ -31,14 +31,17 @@
// ISO C++ 14882: 20.4.6 C library
//
-// Note: This is not a conforming implementation.
-
#ifndef _CPP_CSTDARG
#define _CPP_CSTDARG 1
#pragma GCC system_header
#include <stdarg.h>
+// Adhere to section 17.4.1.2 clause 5 of ISO 14882:1998
+#ifndef va_end
+#define va_end(ap) va_end (ap)
+#endif
+
namespace std
{
using ::va_list;
diff --git a/libstdc++-v3/include/c_std/bits/std_cstddef.h b/libstdc++-v3/include/c_std/bits/std_cstddef.h
index d03c899b27e..deb2db4448c 100644
--- a/libstdc++-v3/include/c_std/bits/std_cstddef.h
+++ b/libstdc++-v3/include/c_std/bits/std_cstddef.h
@@ -31,8 +31,6 @@
// ISO C++ 14882: 18.1 Types
//
-// Note: This is not a conforming implementation.
-
#ifndef _CPP_CSTDDEF
#define _CPP_CSTDDEF 1
diff --git a/libstdc++-v3/include/c_std/bits/std_cstdio.h b/libstdc++-v3/include/c_std/bits/std_cstdio.h
index ba731a6af28..a4c67d22acd 100644
--- a/libstdc++-v3/include/c_std/bits/std_cstdio.h
+++ b/libstdc++-v3/include/c_std/bits/std_cstdio.h
@@ -31,125 +31,131 @@
// ISO C++ 14882: 27.8.2 C Library files
//
-// Note: This is not a conforming implementation.
-
#ifndef _CPP_CSTDIO
#define _CPP_CSTDIO 1
#include <bits/c++config.h>
-#include <bits/std_cstdarg.h>
#include <bits/std_cstddef.h>
#pragma GCC system_header
#include <stdio.h>
// Get rid of those macros defined in <stdio.h> in lieu of real functions.
-#undef remove
-#undef rename
-#undef tmpfile
-#undef tmpnam
+#undef clearerr
#undef fclose
+#undef feof
+#undef ferror
#undef fflush
-#undef fopen
-#undef freopen
-#undef setbuf
-#undef setvbuf
-#undef fprintf
-#undef fscanf
-#undef printf
-#undef scanf
-#undef snprintf
-#undef sprintf
-#undef sscanf
-#undef vfprintf
-#undef vfscanf
-#undef vprintf
-#undef vscanf
-#undef vsnprintf
-#undef vsprintf
-#undef vsscanf
#undef fgetc
+#undef fgetpos
#undef fgets
+#undef fopen
+#undef fprintf
#undef fputc
#undef fputs
+#undef fread
+#undef freopen
+#undef fscanf
+#undef fseek
+#undef fsetpos
+#undef ftell
+#undef fwrite
#undef getc
#undef getchar
#undef gets
+#undef perror
+#undef printf
#undef putc
#undef putchar
#undef puts
-#undef ungetc
-#undef fread
-#undef fwrite
-#undef fgetpos
-#undef fseek
-#undef fsetpos
-#undef ftell
+#undef remove
+#undef rename
#undef rewind
-#undef clearerr
-#undef feof
-#undef ferror
-#undef perror
+#undef scanf
+#undef setbuf
+#undef setvbuf
+#undef sprintf
+#undef sscanf
+#undef tmpfile
+#undef tmpnam
+#undef ungetc
+#undef vfprintf
+#undef vprintf
+#undef vsprintf
namespace std
{
using ::FILE;
using ::fpos_t;
- extern "C" int remove(const char*);
- extern "C" int rename(const char*, const char*);
- extern "C" FILE* tmpfile(void);
- extern "C" char* tmpnam(char*);
- extern "C" int fclose(FILE*);
- extern "C" int fflush(FILE*);
- extern "C" FILE* fopen(const char*, const char*);
- extern "C" FILE* freopen(const char*, const char*, FILE*);
- extern "C" void setbuf(FILE*, char*);
- extern "C" int setvbuf(FILE*, char*, int, size_t);
- extern "C" int fprintf(FILE*, const char*, ...);
- extern "C" int fscanf(FILE*, const char*, ...);
- extern "C" int printf(const char*, ...);
- extern "C" int scanf(const char*, ...);
- extern "C" int snprintf(char *, size_t, const char*, ...);
- extern "C" int sprintf(char *, const char*, ...);
- extern "C" int sscanf(const char*, const char*, ...);
- extern "C" int vfprintf(FILE*, const char*, va_list);
- extern "C" int vfscanf(FILE*, const char*, va_list);
- extern "C" int vprintf(const char*, va_list);
- extern "C" int vscanf(const char*, va_list);
- extern "C" int vsnprintf(char*, size_t, const char*, va_list);
- extern "C" int vsprintf(char*, const char*, va_list);
- extern "C" int vsscanf(const char*, const char*, va_list);
- extern "C" int fgetc(FILE *);
- extern "C" char *fgets(char*, int, FILE*);
- extern "C" int fputc(int, FILE*);
- extern "C" int fputs(const char*, FILE*);
- extern "C" int getc(FILE*);
- extern "C" int getchar(void);
- extern "C" char *gets(char*);
- extern "C" int putc(int, FILE*);
- extern "C" int putchar(int);
- extern "C" int puts(const char*);
- extern "C" int ungetc(int, FILE*);
- extern "C" size_t fread(void*, size_t, size_t, FILE*);
- extern "C" size_t fwrite(const void*, size_t, size_t, FILE*);
- extern "C" int fgetpos(FILE*, fpos_t*);
- extern "C" int fseek(FILE*, long int, int);
- extern "C" int fsetpos(FILE*, const fpos_t*);
- extern "C" long int ftell(FILE*);
- extern "C" void rewind(FILE*);
- extern "C" void clearerr(FILE*);
- extern "C" int feof(FILE*);
- extern "C" int ferror(FILE*);
- extern "C" void perror(const char*);
+ using ::clearerr;
+ using ::fclose;
+ using ::feof;
+ using ::ferror;
+ using ::fflush;
+ using ::fgetc;
+ using ::fgetpos;
+ using ::fgets;
+ using ::fopen;
+ using ::fprintf;
+ using ::fputc;
+ using ::fputs;
+ using ::fread;
+ using ::freopen;
+ using ::fscanf;
+ using ::fseek;
+ using ::fsetpos;
+ using ::ftell;
+ using ::fwrite;
+ using ::getc;
+ using ::getchar;
+ using ::gets;
+ using ::perror;
+ using ::printf;
+ using ::putc;
+ using ::putchar;
+ using ::puts;
+ using ::remove;
+ using ::rename;
+ using ::rewind;
+ using ::scanf;
+ using ::setbuf;
+ using ::setvbuf;
+ using ::sprintf;
+ using ::sscanf;
+ using ::tmpfile;
+ using ::tmpnam;
+ using ::ungetc;
+ using ::vfprintf;
+ using ::vprintf;
+ using ::vsprintf;
}
-#endif
-
-
-
-
+#if _GLIBCPP_USE_C99
+#undef snprintf
+#undef vfscanf
+#undef vscanf
+#undef vsnprintf
+#undef vsscanf
+namespace __gnu_cxx
+{
+ using ::snprintf;
+ using ::vfscanf;
+ using ::vscanf;
+ using ::vsnprintf;
+ using ::vsscanf;
+}
+namespace std
+{
+ using __gnu_cxx::snprintf;
+ using __gnu_cxx::vfscanf;
+ using __gnu_cxx::vscanf;
+ using __gnu_cxx::vsnprintf;
+ using __gnu_cxx::vsscanf;
+}
+#endif
+#endif
diff --git a/libstdc++-v3/include/c_std/bits/std_cstdlib.h b/libstdc++-v3/include/c_std/bits/std_cstdlib.h
index 5ee0b7e9b6e..b67ce44f937 100644
--- a/libstdc++-v3/include/c_std/bits/std_cstdlib.h
+++ b/libstdc++-v3/include/c_std/bits/std_cstdlib.h
@@ -31,8 +31,6 @@
// ISO C++ 14882: 20.4.6 C library
//
-// Note: This is not a conforming implementation.
-
#ifndef _CPP_CSTDLIB
#define _CPP_CSTDLIB 1
@@ -43,94 +41,92 @@
#include <stdlib.h>
// Get rid of those macros defined in <stdlib.h> in lieu of real functions.
+#undef abort
+#undef abs
+#undef atexit
#undef atof
#undef atoi
#undef atol
-#undef strtod
-#undef strtof
-#undef strtol
-#undef strtoul
-#undef rand
-#undef srand
+#undef bsearch
#undef calloc
-#undef free
-#undef malloc
-#undef realloc
-#undef abort
-#undef atexit
+#undef div
#undef exit
-#undef _Exit
+#undef free
#undef getenv
-#undef system
-#undef bsearch
-#undef qsort
-#undef abs
#undef labs
-#undef llabs
-#undef div
#undef ldiv
-#undef lldiv
+#undef malloc
#undef mblen
-#undef mbtowc
-#undef wctomb
#undef mbstowcs
+#undef mbtowc
+#undef qsort
+#undef rand
+#undef realloc
+#undef srand
+#undef strtod
+#undef strtol
+#undef strtoul
+#undef system
#undef wcstombs
-#undef atoll
-#undef strtoll
-#undef strtoull
-#undef strtold
+#undef wctomb
namespace std
{
using ::div_t;
using ::ldiv_t;
-#ifdef _GLIBCPP_USE_LONG_LONG
-# ifdef _GLIBCPP_HAVE_LLDIV_T
+ using ::abort;
+ using ::abs;
+ using ::atexit;
+ using ::atof;
+ using ::atoi;
+ using ::atol;
+ using ::bsearch;
+ using ::calloc;
+ using ::div;
+ using ::exit;
+ using ::free;
+ using ::getenv;
+ using ::labs;
+ using ::ldiv;
+ using ::malloc;
+ using ::mblen;
+ using ::mbstowcs;
+ using ::mbtowc;
+ using ::qsort;
+ using ::rand;
+ using ::realloc;
+ using ::srand;
+ using ::strtod;
+ using ::strtol;
+ using ::strtoul;
+ using ::system;
+ using ::wcstombs;
+ using ::wctomb;
+
+ inline long
+ abs(long __i) { return labs(__i); }
+
+ inline ldiv_t
+ div(long __i, long __j) { return ldiv(__i, __j); }
+}
+
+#if _GLIBCPP_USE_C99
+
+#undef _Exit
+#undef llabs
+#undef lldiv
+#undef atoll
+#undef strtoll
+#undef strtoull
+#undef strtof
+#undef strtold
+
+namespace __gnu_cxx
+{
using ::lldiv_t;
-# else
- struct lldiv_t
- {
- long long quot;
- long long rem;
- };
-# endif
-#endif
+ using ::_Exit;
- extern "C" double atof(const char*);
- extern "C" int atoi(const char*);
- extern "C" long int atol(const char*);
- extern "C" double strtod(const char*, char**);
- extern "C" float strtof(const char*, char**);
- extern "C" long int strtol(const char*, char**, int);
- extern "C" unsigned long int strtoul(const char*, char**, int);
- extern "C" int rand(void);
- extern "C" void srand(unsigned int);
- extern "C" void* calloc(size_t, size_t);
- extern "C" void free(void*);
- extern "C" void* malloc(size_t);
- extern "C" void* realloc(void*, size_t);
- extern "C" void abort(void);
- extern "C" int atexit(void (*func)(void));
- extern "C" void exit(int);
- extern "C" void _Exit(int);
- extern "C" char*getenv(const char*);
- extern "C" int system(const char*);
- extern "C" void* bsearch(const void*, const void*, size_t, size_t,
- int (*comp)(const void *, const void *));
- extern "C" void qsort(void*, size_t, size_t,
- int (*comp)(const void *, const void *));
- extern "C" int abs(int);
- extern "C" long int labs(long int);
- extern "C" div_t div(int, int);
- extern "C" ldiv_t ldiv(long int, long int);
- extern "C" int mblen(const char*, size_t);
- extern "C" int mbtowc(wchar_t*, const char*, size_t);
- extern "C" int wctomb(char*, wchar_t);
- extern "C" size_t mbstowcs(wchar_t*, const char*, size_t);
- extern "C" size_t wcstombs(char*, const wchar_t*, size_t);
-
-#ifdef _GLIBCPP_USE_LONG_LONG
inline long long
abs(long long __x) { return __x >= 0 ? __x : -__x; }
@@ -145,21 +141,27 @@ namespace std
lldiv(long long __n, long long __d)
{ lldiv_t __q; __q.quot = __n / __d; __q.rem = __n % __d; return __q; }
- extern "C" long long int atoll(const char*);
- extern "C" long long int strtoll(const char*, char**, int);
- extern "C" unsigned long long int strtoull(const char*, char**, int);
-#endif
+ using ::atoll;
+ using ::strtof;
+ using ::strtoll;
+ using ::strtoull;
+ using ::strtold;
+}
-#ifdef _GLIBCPP_HAVE_STRTOLD
- extern "C" long double strtold(const char*, char**);
-#endif
+namespace std
+{
+ using __gnu_cxx::lldiv_t;
+ using __gnu_cxx::_Exit;
+ using __gnu_cxx::abs;
+ using __gnu_cxx::llabs;
+ using __gnu_cxx::div;
+ using __gnu_cxx::lldiv;
+ using __gnu_cxx::atoll;
+ using __gnu_cxx::strtof;
+ using __gnu_cxx::strtoll;
+ using __gnu_cxx::strtoull;
+ using __gnu_cxx::strtold;
}
+#endif
#endif
-
-
-
-
-
-
-
diff --git a/libstdc++-v3/include/c_std/bits/std_cstring.h b/libstdc++-v3/include/c_std/bits/std_cstring.h
index 7429e6570e2..ab6a6a66c4d 100644
--- a/libstdc++-v3/include/c_std/bits/std_cstring.h
+++ b/libstdc++-v3/include/c_std/bits/std_cstring.h
@@ -31,12 +31,9 @@
// ISO C++ 14882: 20.4.6 C library
//
-// Note: This is not a conforming implementation.
-
#ifndef _CPP_CSTRING
#define _CPP_CSTRING 1
-#include <bits/c++config.h>
#include <bits/std_cstddef.h>
#pragma GCC system_header
@@ -68,31 +65,53 @@
namespace std
{
- extern "C" void* memcpy(void*, const void*, size_t);
- extern "C" void* memmove(void*, const void*, size_t);
- extern "C" char* strcpy(char*, const char*);
- extern "C" char* strncpy(char*, const char*, size_t);
- extern "C" char* strcat(char*, const char*);
- extern "C" char* strncat(char*, const char*, size_t);
- extern "C" int memcmp(const void*, const void*, size_t);
- extern "C" int strcmp(const char*, const char*);
- extern "C" int strcoll(const char*, const char*);
- extern "C" int strncmp(const char*, const char*, size_t);
- extern "C" size_t strxfrm(char*, const char*, size_t);
- extern "C" void* memchr(const void*, int, size_t);
- extern "C" char* strchr(const char*, int);
- extern "C" size_t strcspn(const char*, const char*);
- extern "C" char* strpbrk(const char*, const char*);
- extern "C" char* strrchr(const char*, int);
- extern "C" size_t strspn(const char*, const char*);
- extern "C" char* strstr(const char*, const char*);
- extern "C" char* strtok(char*, const char*);
- extern "C" void* memset(void*, int, size_t);
- extern "C" char* strerror(int);
- extern "C" size_t strlen(const char*);
-}
+ using ::memcpy;
+ using ::memmove;
+ using ::strcpy;
+ using ::strncpy;
+ using ::strcat;
+ using ::strncat;
+ using ::memcmp;
+ using ::strcmp;
+ using ::strcoll;
+ using ::strncmp;
+ using ::strxfrm;
+ using ::strcspn;
+ using ::strspn;
+ using ::strtok;
+ using ::memset;
+ using ::strerror;
+ using ::strlen;
-#endif
+ using ::memchr;
+
+ inline void*
+ memchr(void* __p, int __c, size_t __n)
+ { return memchr(const_cast<const void*>(__p), __c, __n); }
+
+ using ::strchr;
+
+ inline char*
+ strchr(char* __s1, int __n)
+ { return __builtin_strchr(const_cast<const char*>(__s1), __n); }
+ using ::strpbrk;
+ inline char*
+ strpbrk(char* __s1, const char* __s2)
+ { return __builtin_strpbrk(const_cast<const char*>(__s1), __s2); }
+ using ::strrchr;
+
+ inline char*
+ strrchr(char* __s1, int __n)
+ { return __builtin_strrchr(const_cast<const char*>(__s1), __n); }
+
+ using ::strstr;
+
+ inline char*
+ strstr(char* __s1, const char* __s2)
+ { return __builtin_strstr(const_cast<const char*>(__s1), __s2); }
+}
+
+#endif
diff --git a/libstdc++-v3/include/c_std/bits/std_ctime.h b/libstdc++-v3/include/c_std/bits/std_ctime.h
index d4bb28d50d2..a9051b49735 100644
--- a/libstdc++-v3/include/c_std/bits/std_ctime.h
+++ b/libstdc++-v3/include/c_std/bits/std_ctime.h
@@ -31,12 +31,9 @@
// ISO C++ 14882: 20.5 Date and time
//
-// Note: This is not a conforming implementation.
-
#ifndef _CPP_CTIME
#define _CPP_CTIME 1
-#include <bits/c++config.h>
#include <bits/std_cstddef.h>
#pragma GCC system_header
@@ -59,15 +56,15 @@ namespace std
using ::time_t;
using ::tm;
- extern "C" clock_t clock(void);
- extern "C" double difftime(time_t, time_t);
- extern "C" time_t mktime(struct tm*);
- extern "C" time_t time(time_t*);
- extern "C" char* asctime(const struct tm*);
- extern "C" char* ctime(const time_t*);
- extern "C" struct tm* gmtime(const time_t*);
- extern "C" struct tm* localtime(const time_t*);
- extern "C" size_t strftime(char*, size_t, const char*, const struct tm*);
+ using ::clock;
+ using ::difftime;
+ using ::mktime;
+ using ::time;
+ using ::asctime;
+ using ::ctime;
+ using ::gmtime;
+ using ::localtime;
+ using ::strftime;
}
#endif
diff --git a/libstdc++-v3/include/c_std/bits/std_cwchar.h b/libstdc++-v3/include/c_std/bits/std_cwchar.h
index d2ac5bbdda3..b19cfeaadc2 100644
--- a/libstdc++-v3/include/c_std/bits/std_cwchar.h
+++ b/libstdc++-v3/include/c_std/bits/std_cwchar.h
@@ -28,25 +28,21 @@
// the GNU General Public License.
//
-// ISO C++ 14882: ???
+// ISO C++ 14882: 21.4
//
-// Note: This is not a conforming implementation.
-
#ifndef _CPP_CWCHAR
#define _CPP_CWCHAR 1
#include <bits/c++config.h>
#include <bits/std_cstddef.h>
-#include <bits/std_cstdio.h>
-#include <bits/std_cstdarg.h>
+#include <bits/std_ctime.h>
#if _GLIBCPP_HAVE_WCHAR_H
#pragma GCC system_header
#include <wchar.h>
#endif
-
// Need to do a bit of trickery here with mbstate_t as char_traits
// assumes it is in wchar.h, regardless of wchar_t specializations.
#ifndef _GLIBCPP_HAVE_MBSTATE_T
@@ -65,121 +61,172 @@ namespace std
}
// Get rid of those macros defined in <wchar.h> in lieu of real functions.
-#undef vwprintf
-#undef vwscanf
-#undef wprintf
-#undef wscanf
+#undef btowc
+#undef fgetwc
+#undef fgetws
+#undef fputwc
+#undef fputws
+#undef fwide
+#undef fwprintf
+#undef fwscanf
#undef getwc
#undef getwchar
-#undef mbsinit
#undef mbrlen
#undef mbrtowc
+#undef mbsinit
#undef mbsrtowcs
-#undef wcsrtombs
#undef putwc
#undef putwchar
+#undef swprintf
+#undef swscanf
#undef ungetwc
+#undef vfwprintf
+#undef vfwscanf
+#undef vswprintf
+#undef vswscanf
+#undef vwprintf
+#undef vwscanf
#undef wcrtomb
-#undef wcstod
-#undef wcstof
-#undef wcstol
-#undef wcstoul
-#undef wcscpy
-#undef wcsncpy
#undef wcscat
-#undef wcsncat
+#undef wcschr
#undef wcscmp
#undef wcscoll
-#undef wcsncmp
-#undef wcsxfrm
-#undef wcschr
+#undef wcscpy
#undef wcscspn
+#undef wcsftime
#undef wcslen
+#undef wcsncat
+#undef wcsncmp
+#undef wcsncpy
#undef wcspbrk
#undef wcsrchr
+#undef wcsrtombs
#undef wcsspn
#undef wcsstr
+#undef wcstod
+#undef wcstof
#undef wcstok
+#undef wcstol
+#undef wcstoul
+#undef wcsxfrm
+#undef wctob
#undef wmemchr
#undef wmemcmp
#undef wmemcpy
#undef wmemmove
#undef wmemset
-#undef wcsftime
-#undef wcstold
-#undef wcstoll
-#undef wcstoull
+#undef wprintf
+#undef wscanf
#if _GLIBCPP_USE_WCHAR_T
namespace std
{
using ::wint_t;
- extern "C" wint_t btowc(int);
- extern "C" int wctob(wint_t);
- extern "C" wint_t fgetwc(FILE*);
- extern "C" wchar_t* fgetws(wchar_t*, int, FILE*);
- extern "C" wint_t fputwc(wchar_t, FILE*);
- extern "C" int fputws(const wchar_t*, FILE*);
- extern "C" int fwide(FILE*, int);
- extern "C" int fwprintf(FILE*, const wchar_t*, ...);
- extern "C" int fwscanf(FILE*, const wchar_t*, ...);
- extern "C" int swprintf(wchar_t*, size_t, const wchar_t*, ...);
- extern "C" int swscanf(const wchar_t*, const wchar_t*, ...);
- extern "C" int vfwprintf(FILE*, const wchar_t*, va_list);
- extern "C" int vfwscanf(FILE*, const wchar_t*, va_list);
- extern "C" int vswprintf(wchar_t*, size_t, const wchar_t*, va_list);
- extern "C" int vswscanf(const wchar_t*, const wchar_t*, va_list);
- extern "C" int vwprintf(const wchar_t*, va_list);
- extern "C" int vwscanf(const wchar_t*, va_list);
- extern "C" int wprintf(const wchar_t*, ...);
- extern "C" int wscanf(const wchar_t*, ...);
- extern "C" wint_t getwc(FILE* stream);
- extern "C" wint_t getwchar(void);
- extern "C" int mbsinit(const mbstate_t*);
- extern "C" size_t mbrlen(const char*, size_t, mbstate_t*);
- extern "C" size_t mbrtowc(wchar_t*, const char*, size_t, mbstate_t*);
- extern "C" size_t mbsrtowcs(wchar_t*, const char**, size_t, mbstate_t*);
- extern "C" size_t wcsrtombs(char*, const wchar_t **, size_t, mbstate_t*);
- extern "C" wint_t putwc(wchar_t, FILE*);
- extern "C" wint_t putwchar(wchar_t);
- extern "C" wint_t ungetwc(wint_t, FILE*);
- extern "C" size_t wcrtomb(char*, wchar_t, mbstate_t*);
- extern "C" double wcstod(const wchar_t*, wchar_t**);
- extern "C" float wcstof(const wchar_t*, wchar_t**);
- extern "C" long int wcstol(const wchar_t*, wchar_t**, int);
- extern "C" unsigned long int wcstoul(const wchar_t*, wchar_t**, int);
- extern "C" wchar_t* wcscpy(wchar_t* s1, const wchar_t*);
- extern "C" wchar_t* wcsncpy(wchar_t*, const wchar_t*, size_t);
- extern "C" wchar_t* wcscat(wchar_t*, const wchar_t*);
- extern "C" wchar_t* wcsncat(wchar_t*, const wchar_t*, size_t);
- extern "C" int wcscmp(const wchar_t*, const wchar_t*);
- extern "C" int wcscoll(const wchar_t*, const wchar_t*);
- extern "C" int wcsncmp(const wchar_t*, const wchar_t*, size_t);
- extern "C" size_t wcsxfrm(wchar_t*, const wchar_t*, size_t);
- extern "C" wchar_t* wcschr(const wchar_t*, wchar_t);
- extern "C" size_t wcscspn(const wchar_t*, const wchar_t*);
- extern "C" size_t wcslen(const wchar_t*);
- extern "C" wchar_t* wcspbrk(const wchar_t*, const wchar_t*);
- extern "C" wchar_t* wcsrchr(const wchar_t*, wchar_t);
- extern "C" size_t wcsspn(const wchar_t*, const wchar_t*);
- extern "C" wchar_t* wcsstr(const wchar_t*, const wchar_t*);
- extern "C" wchar_t* wcstok(wchar_t*, const wchar_t*, wchar_t**);
- extern "C" wchar_t* wmemchr(const wchar_t*, wchar_t, size_t);
- extern "C" int wmemcmp(const wchar_t*, const wchar_t*, size_t);
- //extern "C" int wmemcmp(wchar_t*, const wchar_t*, size_t);
- extern "C" wchar_t* wmemcpy(wchar_t*, const wchar_t*, size_t);
- extern "C" wchar_t* wmemmove(wchar_t*, const wchar_t*, size_t);
- extern "C" wchar_t* wmemset(wchar_t*, wchar_t, size_t);
- extern "C" size_t wcsftime(wchar_t*, size_t, const wchar_t*, const struct tm*);
-
-#if 0
- // Full C99 listing
- extern "C" long double wcstold(const wchar_t*, wchar_t**);
- extern "C" long long int wcstoll(const wchar_t*, wchar_t**, int);
- extern "C" unsigned long long int wcstoull(const wchar_t*, wchar_t**, int);
-#endif
+ using ::btowc;
+ using ::fgetwc;
+ using ::fgetws;
+ using ::fputwc;
+ using ::fputws;
+ using ::fwide;
+ using ::fwprintf;
+ using ::fwscanf;
+ using ::getwc;
+ using ::getwchar;
+ using ::mbrlen;
+ using ::mbrtowc;
+ using ::mbsinit;
+ using ::mbsrtowcs;
+ using ::putwc;
+ using ::putwchar;
+ using ::swprintf;
+ using ::swscanf;
+ using ::ungetwc;
+ using ::vfwprintf;
+ using ::vfwscanf;
+ using ::vswprintf;
+ using ::vswscanf;
+ using ::vwprintf;
+ using ::vwscanf;
+ using ::wcrtomb;
+ using ::wcscat;
+ using ::wcscmp;
+ using ::wcscoll;
+ using ::wcscpy;
+ using ::wcscspn;
+ using ::wcsftime;
+ using ::wcslen;
+ using ::wcsncat;
+ using ::wcsncmp;
+ using ::wcsncpy;
+ using ::wcsrtombs;
+ using ::wcsspn;
+ using ::wcstod;
+ using ::wcstof;
+ using ::wcstok;
+ using ::wcstol;
+ using ::wcstoul;
+ using ::wcsxfrm;
+ using ::wctob;
+ using ::wmemcmp;
+ using ::wmemcpy;
+ using ::wmemmove;
+ using ::wmemset;
+ using ::wprintf;
+ using ::wscanf;
+
+ using ::wcschr;
+
+ inline wchar_t*
+ wcschr(wchar_t* __p, wchar_t __c)
+ { return wcschr(const_cast<const wchar_t*>(__p), __c); }
+
+ using ::wcspbrk;
+
+ inline wchar_t*
+ wcspbrk(wchar_t* __s1, wchar_t* __s2)
+ { return wcspbrk(const_cast<const wchar_t*>(__s1), __s2); }
+
+ using ::wcsrchr;
+
+ inline wchar_t*
+ wcsrchr(wchar_t* __p, wchar_t __c)
+ { return wcsrchr(const_cast<const wchar_t*>(__p), __c); }
+
+ using ::wcsstr;
+
+ inline wchar_t*
+ wcsstr(wchar_t* __s1, wchar_t* __s2)
+ { return wcsstr(const_cast<const wchar_t*>(__s1), __s2); }
+
+ using ::wmemchr;
+
+ inline wchar_t*
+ wmemchr(wchar_t* __p, wchar_t __c, size_t __n)
+ { return wmemchr(const_cast<const wchar_t*>(__p), __c, __n); }
}
+
+#if _GLIBCPP_USE_C99
+
+#undef wcstold
+#undef wcstoll
+#undef wcstoull
+
+namespace __gnu_cxx
+{
+ using ::wcstold;
+ using ::wcstoll;
+ using ::wcstoull;
+}
+
+namespace std
+{
+ using __gnu_cxx::wcstold;
+ using __gnu_cxx::wcstoll;
+ using __gnu_cxx::wcstoull;
+}
+#endif
+
#endif //_GLIBCPP_USE_WCHAR_T
#endif
diff --git a/libstdc++-v3/include/c_std/bits/std_cwctype.h b/libstdc++-v3/include/c_std/bits/std_cwctype.h
index 9544a824fe9..39ae0767663 100644
--- a/libstdc++-v3/include/c_std/bits/std_cwctype.h
+++ b/libstdc++-v3/include/c_std/bits/std_cwctype.h
@@ -31,13 +31,9 @@
// ISO C++ 14882: <cwctype>
//
-// Note: This is not a conforming implementation.
-
#ifndef _CPP_CWCTYPE
#define _CPP_CWCTYPE 1
-#include <bits/std_cwchar.h>
-
#pragma GCC system_header
#include <wctype.h>
@@ -60,37 +56,34 @@
#undef towupper
#undef towctrans
#undef wctrans
+#undef wctype
namespace std
{
+ using ::wint_t; // cwchar
+
using ::wctype_t;
using ::wctrans_t;
- extern "C" int iswalnum(wint_t);
- extern "C" int iswalpha(wint_t);
- extern "C" int iswblank(wint_t);
- extern "C" int iswcntrl(wint_t);
- extern "C" int iswdigit(wint_t);
- extern "C" int iswgraph(wint_t);
- extern "C" int iswlower(wint_t);
- extern "C" int iswprint(wint_t);
- extern "C" int iswpunct(wint_t);
- extern "C" int iswspace(wint_t);
- extern "C" int iswupper(wint_t);
- extern "C" int iswxdigit(wint_t);
- extern "C" int iswctype(wint_t, wctype_t);
- extern "C" wctype_t wctype(const char *);
- extern "C" wint_t towlower(wint_t);
- extern "C" wint_t towupper(wint_t);
- extern "C" wint_t towctrans(wint_t, wctrans_t);
- extern "C" wctrans_t wctrans(const char*);
+ using ::iswalnum;
+ using ::iswalpha;
+ using ::iswblank;
+ using ::iswcntrl;
+ using ::iswdigit;
+ using ::iswgraph;
+ using ::iswlower;
+ using ::iswprint;
+ using ::iswprint;
+ using ::iswpunct;
+ using ::iswspace;
+ using ::iswupper;
+ using ::iswxdigit;
+ using ::iswctype;
+ using ::towlower;
+ using ::towupper;
+ using ::towctrans;
+ using ::wctrans;
+ using ::wctype;
}
#endif
-
-
-
-
-
-
-
diff --git a/libstdc++-v3/include/ext/bvector b/libstdc++-v3/include/ext/bvector
index 2ece99c7160..32a06d21be1 100644
--- a/libstdc++-v3/include/ext/bvector
+++ b/libstdc++-v3/include/ext/bvector
@@ -27,14 +27,8 @@
#ifndef __SGI_STL_BVECTOR_H
#define __SGI_STL_BVECTOR_H
-#include <bits/stl_range_errors.h>
-#ifdef __STL_CLASS_PARTIAL_SPECIALIZATION
-#include <bits/std_vector.h>
-#else
-#include <bits/std_algobase.h>
-#include <bits/atl_alloc.h>
-#endif
+#include <bits/std_vector.h>
#include <ext/stl_bvector.h>
#ifdef __STL_USE_NAMESPACES
diff --git a/libstdc++-v3/include/ext/hash_map b/libstdc++-v3/include/ext/hash_map
index ae3cf2672bc..65c1c9bc50e 100644
--- a/libstdc++-v3/include/ext/hash_map
+++ b/libstdc++-v3/include/ext/hash_map
@@ -1,3 +1,32 @@
+// Hashing map implementation -*- C++ -*-
+
+// Copyright (C) 2001 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.
+
/*
* Copyright (c) 1996
* Silicon Graphics Computer Systems, Inc.
@@ -32,13 +61,10 @@
#define __SGI_STL_INTERNAL_HASH_MAP_H
#include <ext/stl_hashtable.h>
+#include <bits/concept_check.h>
-__STL_BEGIN_NAMESPACE
-
-#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
-#pragma set woff 1174
-#pragma set woff 1375
-#endif
+namespace std
+{
// Forward declaration of equality operator; needed for friend declaration.
@@ -95,7 +121,6 @@ public:
const allocator_type& __a = allocator_type())
: _M_ht(__n, __hf, __eql, __a) {}
-#ifdef __STL_MEMBER_TEMPLATES
template <class _InputIterator>
hash_map(_InputIterator __f, _InputIterator __l)
: _M_ht(100, hasher(), key_equal(), allocator_type())
@@ -116,56 +141,15 @@ public:
: _M_ht(__n, __hf, __eql, __a)
{ _M_ht.insert_unique(__f, __l); }
-#else
- hash_map(const value_type* __f, const value_type* __l)
- : _M_ht(100, hasher(), key_equal(), allocator_type())
- { _M_ht.insert_unique(__f, __l); }
- hash_map(const value_type* __f, const value_type* __l, size_type __n)
- : _M_ht(__n, hasher(), key_equal(), allocator_type())
- { _M_ht.insert_unique(__f, __l); }
- hash_map(const value_type* __f, const value_type* __l, size_type __n,
- const hasher& __hf)
- : _M_ht(__n, __hf, key_equal(), allocator_type())
- { _M_ht.insert_unique(__f, __l); }
- hash_map(const value_type* __f, const value_type* __l, size_type __n,
- const hasher& __hf, const key_equal& __eql,
- const allocator_type& __a = allocator_type())
- : _M_ht(__n, __hf, __eql, __a)
- { _M_ht.insert_unique(__f, __l); }
-
- hash_map(const_iterator __f, const_iterator __l)
- : _M_ht(100, hasher(), key_equal(), allocator_type())
- { _M_ht.insert_unique(__f, __l); }
- hash_map(const_iterator __f, const_iterator __l, size_type __n)
- : _M_ht(__n, hasher(), key_equal(), allocator_type())
- { _M_ht.insert_unique(__f, __l); }
- hash_map(const_iterator __f, const_iterator __l, size_type __n,
- const hasher& __hf)
- : _M_ht(__n, __hf, key_equal(), allocator_type())
- { _M_ht.insert_unique(__f, __l); }
- hash_map(const_iterator __f, const_iterator __l, size_type __n,
- const hasher& __hf, const key_equal& __eql,
- const allocator_type& __a = allocator_type())
- : _M_ht(__n, __hf, __eql, __a)
- { _M_ht.insert_unique(__f, __l); }
-#endif /*__STL_MEMBER_TEMPLATES */
-
public:
size_type size() const { return _M_ht.size(); }
size_type max_size() const { return _M_ht.max_size(); }
bool empty() const { return _M_ht.empty(); }
void swap(hash_map& __hs) { _M_ht.swap(__hs._M_ht); }
-#ifdef __STL_MEMBER_TEMPLATES
template <class _K1, class _T1, class _HF, class _EqK, class _Al>
friend bool operator== (const hash_map<_K1, _T1, _HF, _EqK, _Al>&,
const hash_map<_K1, _T1, _HF, _EqK, _Al>&);
-#else /* __STL_MEMBER_TEMPLATES */
- friend bool __STD_QUALIFIER
- operator== __STL_NULL_TMPL_ARGS (const hash_map&, const hash_map&);
-#endif /* __STL_MEMBER_TEMPLATES */
-
-#include <bits/concept_checks.h>
iterator begin() { return _M_ht.begin(); }
iterator end() { return _M_ht.end(); }
@@ -175,17 +159,9 @@ public:
public:
pair<iterator,bool> insert(const value_type& __obj)
{ return _M_ht.insert_unique(__obj); }
-#ifdef __STL_MEMBER_TEMPLATES
template <class _InputIterator>
void insert(_InputIterator __f, _InputIterator __l)
{ _M_ht.insert_unique(__f,__l); }
-#else
- void insert(const value_type* __f, const value_type* __l) {
- _M_ht.insert_unique(__f,__l);
- }
- void insert(const_iterator __f, const_iterator __l)
- { _M_ht.insert_unique(__f, __l); }
-#endif /*__STL_MEMBER_TEMPLATES */
pair<iterator,bool> insert_noresize(const value_type& __obj)
{ return _M_ht.insert_unique_noresize(__obj); }
@@ -225,8 +201,6 @@ operator==(const hash_map<_Key,_Tp,_HashFcn,_EqlKey,_Alloc>& __hm1,
return __hm1._M_ht == __hm2._M_ht;
}
-#ifdef __STL_FUNCTION_TMPL_PARTIAL_ORDER
-
template <class _Key, class _Tp, class _HashFcn, class _EqlKey, class _Alloc>
inline bool
operator!=(const hash_map<_Key,_Tp,_HashFcn,_EqlKey,_Alloc>& __hm1,
@@ -242,8 +216,6 @@ swap(hash_map<_Key,_Tp,_HashFcn,_EqlKey,_Alloc>& __hm1,
__hm1.swap(__hm2);
}
-#endif /* __STL_FUNCTION_TMPL_PARTIAL_ORDER */
-
// Forward declaration of equality operator; needed for friend declaration.
template <class _Key, class _Tp,
@@ -260,11 +232,11 @@ operator==(const hash_multimap<_Key,_Tp,_HF,_EqKey,_Alloc>& __hm1,
template <class _Key, class _Tp, class _HashFcn, class _EqualKey, class _Alloc>
class hash_multimap
{
- // requirements:
- __STL_CLASS_REQUIRES(_Key, _Assignable);
- __STL_CLASS_REQUIRES(_Tp, _Assignable);
- __STL_CLASS_UNARY_FUNCTION_CHECK(_HashFcn, size_t, _Key);
- __STL_CLASS_BINARY_FUNCTION_CHECK(_EqualKey, bool, _Key, _Key);
+ // concept requirements
+ __glibcpp_class_requires(_Key, _SGIAssignableConcept);
+ __glibcpp_class_requires(_Tp, _SGIAssignableConcept);
+ __glibcpp_class_requires3(_HashFcn, size_t, _Key, _UnaryFunctionConcept);
+ __glibcpp_class_requires3(_EqualKey, _Key, _Key, _BinaryPredicateConcept);
private:
typedef hashtable<pair<const _Key, _Tp>, _Key, _HashFcn,
@@ -306,7 +278,6 @@ public:
const allocator_type& __a = allocator_type())
: _M_ht(__n, __hf, __eql, __a) {}
-#ifdef __STL_MEMBER_TEMPLATES
template <class _InputIterator>
hash_multimap(_InputIterator __f, _InputIterator __l)
: _M_ht(100, hasher(), key_equal(), allocator_type())
@@ -327,54 +298,15 @@ public:
: _M_ht(__n, __hf, __eql, __a)
{ _M_ht.insert_equal(__f, __l); }
-#else
- hash_multimap(const value_type* __f, const value_type* __l)
- : _M_ht(100, hasher(), key_equal(), allocator_type())
- { _M_ht.insert_equal(__f, __l); }
- hash_multimap(const value_type* __f, const value_type* __l, size_type __n)
- : _M_ht(__n, hasher(), key_equal(), allocator_type())
- { _M_ht.insert_equal(__f, __l); }
- hash_multimap(const value_type* __f, const value_type* __l, size_type __n,
- const hasher& __hf)
- : _M_ht(__n, __hf, key_equal(), allocator_type())
- { _M_ht.insert_equal(__f, __l); }
- hash_multimap(const value_type* __f, const value_type* __l, size_type __n,
- const hasher& __hf, const key_equal& __eql,
- const allocator_type& __a = allocator_type())
- : _M_ht(__n, __hf, __eql, __a)
- { _M_ht.insert_equal(__f, __l); }
-
- hash_multimap(const_iterator __f, const_iterator __l)
- : _M_ht(100, hasher(), key_equal(), allocator_type())
- { _M_ht.insert_equal(__f, __l); }
- hash_multimap(const_iterator __f, const_iterator __l, size_type __n)
- : _M_ht(__n, hasher(), key_equal(), allocator_type())
- { _M_ht.insert_equal(__f, __l); }
- hash_multimap(const_iterator __f, const_iterator __l, size_type __n,
- const hasher& __hf)
- : _M_ht(__n, __hf, key_equal(), allocator_type())
- { _M_ht.insert_equal(__f, __l); }
- hash_multimap(const_iterator __f, const_iterator __l, size_type __n,
- const hasher& __hf, const key_equal& __eql,
- const allocator_type& __a = allocator_type())
- : _M_ht(__n, __hf, __eql, __a)
- { _M_ht.insert_equal(__f, __l); }
-#endif /*__STL_MEMBER_TEMPLATES */
-
public:
size_type size() const { return _M_ht.size(); }
size_type max_size() const { return _M_ht.max_size(); }
bool empty() const { return _M_ht.empty(); }
void swap(hash_multimap& __hs) { _M_ht.swap(__hs._M_ht); }
-#ifdef __STL_MEMBER_TEMPLATES
template <class _K1, class _T1, class _HF, class _EqK, class _Al>
friend bool operator== (const hash_multimap<_K1, _T1, _HF, _EqK, _Al>&,
const hash_multimap<_K1, _T1, _HF, _EqK, _Al>&);
-#else /* __STL_MEMBER_TEMPLATES */
- friend bool __STD_QUALIFIER
- operator== __STL_NULL_TMPL_ARGS (const hash_multimap&,const hash_multimap&);
-#endif /* __STL_MEMBER_TEMPLATES */
iterator begin() { return _M_ht.begin(); }
iterator end() { return _M_ht.end(); }
@@ -384,17 +316,9 @@ public:
public:
iterator insert(const value_type& __obj)
{ return _M_ht.insert_equal(__obj); }
-#ifdef __STL_MEMBER_TEMPLATES
template <class _InputIterator>
void insert(_InputIterator __f, _InputIterator __l)
{ _M_ht.insert_equal(__f,__l); }
-#else
- void insert(const value_type* __f, const value_type* __l) {
- _M_ht.insert_equal(__f,__l);
- }
- void insert(const_iterator __f, const_iterator __l)
- { _M_ht.insert_equal(__f, __l); }
-#endif /*__STL_MEMBER_TEMPLATES */
iterator insert_noresize(const value_type& __obj)
{ return _M_ht.insert_equal_noresize(__obj); }
@@ -431,8 +355,6 @@ operator==(const hash_multimap<_Key,_Tp,_HF,_EqKey,_Alloc>& __hm1,
return __hm1._M_ht == __hm2._M_ht;
}
-#ifdef __STL_FUNCTION_TMPL_PARTIAL_ORDER
-
template <class _Key, class _Tp, class _HF, class _EqKey, class _Alloc>
inline bool
operator!=(const hash_multimap<_Key,_Tp,_HF,_EqKey,_Alloc>& __hm1,
@@ -448,13 +370,10 @@ swap(hash_multimap<_Key,_Tp,_HashFcn,_EqlKey,_Alloc>& __hm1,
__hm1.swap(__hm2);
}
-#endif /* __STL_FUNCTION_TMPL_PARTIAL_ORDER */
// Specialization of insert_iterator so that it will work for hash_map
// and hash_multimap.
-#ifdef __STL_CLASS_PARTIAL_SPECIALIZATION
-
template <class _Key, class _Tp, class _HashFn, class _EqKey, class _Alloc>
class insert_iterator<hash_map<_Key, _Tp, _HashFn, _EqKey, _Alloc> > {
protected:
@@ -508,14 +427,7 @@ public:
insert_iterator<_Container>& operator++(int) { return *this; }
};
-#endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */
-
-#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
-#pragma reset woff 1174
-#pragma reset woff 1375
-#endif
-
-__STL_END_NAMESPACE
+} // namespace std
#endif /* __SGI_STL_INTERNAL_HASH_MAP_H */
diff --git a/libstdc++-v3/include/ext/hash_set b/libstdc++-v3/include/ext/hash_set
index 24869cd030c..a0246807705 100644
--- a/libstdc++-v3/include/ext/hash_set
+++ b/libstdc++-v3/include/ext/hash_set
@@ -1,3 +1,32 @@
+// Hashing set implementation -*- C++ -*-
+
+// Copyright (C) 2001 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.
+
/*
* Copyright (c) 1996
* Silicon Graphics Computer Systems, Inc.
@@ -32,15 +61,10 @@
#define __SGI_STL_INTERNAL_HASH_SET_H
#include <ext/stl_hashtable.h>
+#include <bits/concept_check.h>
-#include <bits/concept_checks.h>
-
-__STL_BEGIN_NAMESPACE
-
-#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
-#pragma set woff 1174
-#pragma set woff 1375
-#endif
+namespace std
+{
// Forward declaration of equality operator; needed for friend declaration.
@@ -58,11 +82,10 @@ operator==(const hash_set<_Value,_HashFcn,_EqualKey,_Alloc>& __hs1,
template <class _Value, class _HashFcn, class _EqualKey, class _Alloc>
class hash_set
{
- // requirements:
-
- __STL_CLASS_REQUIRES(_Value, _Assignable);
- __STL_CLASS_UNARY_FUNCTION_CHECK(_HashFcn, size_t, _Value);
- __STL_CLASS_BINARY_FUNCTION_CHECK(_EqualKey, bool, _Value, _Value);
+ // concept requirements
+ __glibcpp_class_requires(_Value, _SGIAssignableConcept);
+ __glibcpp_class_requires3(_HashFcn, size_t, _Value, _UnaryFunctionConcept);
+ __glibcpp_class_requires3(_EqualKey, _Value, _Value, _BinaryPredicateConcept);
private:
typedef hashtable<_Value, _Value, _HashFcn, _Identity<_Value>,
@@ -102,7 +125,6 @@ public:
const allocator_type& __a = allocator_type())
: _M_ht(__n, __hf, __eql, __a) {}
-#ifdef __STL_MEMBER_TEMPLATES
template <class _InputIterator>
hash_set(_InputIterator __f, _InputIterator __l)
: _M_ht(100, hasher(), key_equal(), allocator_type())
@@ -122,40 +144,6 @@ public:
const allocator_type& __a = allocator_type())
: _M_ht(__n, __hf, __eql, __a)
{ _M_ht.insert_unique(__f, __l); }
-#else
-
- hash_set(const value_type* __f, const value_type* __l)
- : _M_ht(100, hasher(), key_equal(), allocator_type())
- { _M_ht.insert_unique(__f, __l); }
- hash_set(const value_type* __f, const value_type* __l, size_type __n)
- : _M_ht(__n, hasher(), key_equal(), allocator_type())
- { _M_ht.insert_unique(__f, __l); }
- hash_set(const value_type* __f, const value_type* __l, size_type __n,
- const hasher& __hf)
- : _M_ht(__n, __hf, key_equal(), allocator_type())
- { _M_ht.insert_unique(__f, __l); }
- hash_set(const value_type* __f, const value_type* __l, size_type __n,
- const hasher& __hf, const key_equal& __eql,
- const allocator_type& __a = allocator_type())
- : _M_ht(__n, __hf, __eql, __a)
- { _M_ht.insert_unique(__f, __l); }
-
- hash_set(const_iterator __f, const_iterator __l)
- : _M_ht(100, hasher(), key_equal(), allocator_type())
- { _M_ht.insert_unique(__f, __l); }
- hash_set(const_iterator __f, const_iterator __l, size_type __n)
- : _M_ht(__n, hasher(), key_equal(), allocator_type())
- { _M_ht.insert_unique(__f, __l); }
- hash_set(const_iterator __f, const_iterator __l, size_type __n,
- const hasher& __hf)
- : _M_ht(__n, __hf, key_equal(), allocator_type())
- { _M_ht.insert_unique(__f, __l); }
- hash_set(const_iterator __f, const_iterator __l, size_type __n,
- const hasher& __hf, const key_equal& __eql,
- const allocator_type& __a = allocator_type())
- : _M_ht(__n, __hf, __eql, __a)
- { _M_ht.insert_unique(__f, __l); }
-#endif /*__STL_MEMBER_TEMPLATES */
public:
size_type size() const { return _M_ht.size(); }
@@ -163,14 +151,9 @@ public:
bool empty() const { return _M_ht.empty(); }
void swap(hash_set& __hs) { _M_ht.swap(__hs._M_ht); }
-#ifdef __STL_MEMBER_TEMPLATES
template <class _Val, class _HF, class _EqK, class _Al>
friend bool operator== (const hash_set<_Val, _HF, _EqK, _Al>&,
const hash_set<_Val, _HF, _EqK, _Al>&);
-#else /* __STL_MEMBER_TEMPLATES */
- friend bool __STD_QUALIFIER
- operator== __STL_NULL_TMPL_ARGS (const hash_set&, const hash_set&);
-#endif /* __STL_MEMBER_TEMPLATES */
iterator begin() const { return _M_ht.begin(); }
iterator end() const { return _M_ht.end(); }
@@ -181,17 +164,9 @@ public:
pair<typename _Ht::iterator, bool> __p = _M_ht.insert_unique(__obj);
return pair<iterator,bool>(__p.first, __p.second);
}
-#ifdef __STL_MEMBER_TEMPLATES
template <class _InputIterator>
void insert(_InputIterator __f, _InputIterator __l)
{ _M_ht.insert_unique(__f,__l); }
-#else
- void insert(const value_type* __f, const value_type* __l) {
- _M_ht.insert_unique(__f,__l);
- }
- void insert(const_iterator __f, const_iterator __l)
- {_M_ht.insert_unique(__f, __l); }
-#endif /*__STL_MEMBER_TEMPLATES */
pair<iterator, bool> insert_noresize(const value_type& __obj)
{
pair<typename _Ht::iterator, bool> __p =
@@ -227,8 +202,6 @@ operator==(const hash_set<_Value,_HashFcn,_EqualKey,_Alloc>& __hs1,
return __hs1._M_ht == __hs2._M_ht;
}
-#ifdef __STL_FUNCTION_TMPL_PARTIAL_ORDER
-
template <class _Value, class _HashFcn, class _EqualKey, class _Alloc>
inline bool
operator!=(const hash_set<_Value,_HashFcn,_EqualKey,_Alloc>& __hs1,
@@ -244,8 +217,6 @@ swap(hash_set<_Val,_HashFcn,_EqualKey,_Alloc>& __hs1,
__hs1.swap(__hs2);
}
-#endif /* __STL_FUNCTION_TMPL_PARTIAL_ORDER */
-
template <class _Value,
class _HashFcn = hash<_Value>,
@@ -262,11 +233,10 @@ operator==(const hash_multiset<_Val,_HashFcn,_EqualKey,_Alloc>& __hs1,
template <class _Value, class _HashFcn, class _EqualKey, class _Alloc>
class hash_multiset
{
- // requirements:
-
- __STL_CLASS_REQUIRES(_Value, _Assignable);
- __STL_CLASS_UNARY_FUNCTION_CHECK(_HashFcn, size_t, _Value);
- __STL_CLASS_BINARY_FUNCTION_CHECK(_EqualKey, bool, _Value, _Value);
+ // concept requirements
+ __glibcpp_class_requires(_Value, _SGIAssignableConcept);
+ __glibcpp_class_requires3(_HashFcn, size_t, _Value, _UnaryFunctionConcept);
+ __glibcpp_class_requires3(_EqualKey, _Value, _Value, _BinaryPredicateConcept);
private:
typedef hashtable<_Value, _Value, _HashFcn, _Identity<_Value>,
@@ -306,7 +276,6 @@ public:
const allocator_type& __a = allocator_type())
: _M_ht(__n, __hf, __eql, __a) {}
-#ifdef __STL_MEMBER_TEMPLATES
template <class _InputIterator>
hash_multiset(_InputIterator __f, _InputIterator __l)
: _M_ht(100, hasher(), key_equal(), allocator_type())
@@ -326,40 +295,6 @@ public:
const allocator_type& __a = allocator_type())
: _M_ht(__n, __hf, __eql, __a)
{ _M_ht.insert_equal(__f, __l); }
-#else
-
- hash_multiset(const value_type* __f, const value_type* __l)
- : _M_ht(100, hasher(), key_equal(), allocator_type())
- { _M_ht.insert_equal(__f, __l); }
- hash_multiset(const value_type* __f, const value_type* __l, size_type __n)
- : _M_ht(__n, hasher(), key_equal(), allocator_type())
- { _M_ht.insert_equal(__f, __l); }
- hash_multiset(const value_type* __f, const value_type* __l, size_type __n,
- const hasher& __hf)
- : _M_ht(__n, __hf, key_equal(), allocator_type())
- { _M_ht.insert_equal(__f, __l); }
- hash_multiset(const value_type* __f, const value_type* __l, size_type __n,
- const hasher& __hf, const key_equal& __eql,
- const allocator_type& __a = allocator_type())
- : _M_ht(__n, __hf, __eql, __a)
- { _M_ht.insert_equal(__f, __l); }
-
- hash_multiset(const_iterator __f, const_iterator __l)
- : _M_ht(100, hasher(), key_equal(), allocator_type())
- { _M_ht.insert_equal(__f, __l); }
- hash_multiset(const_iterator __f, const_iterator __l, size_type __n)
- : _M_ht(__n, hasher(), key_equal(), allocator_type())
- { _M_ht.insert_equal(__f, __l); }
- hash_multiset(const_iterator __f, const_iterator __l, size_type __n,
- const hasher& __hf)
- : _M_ht(__n, __hf, key_equal(), allocator_type())
- { _M_ht.insert_equal(__f, __l); }
- hash_multiset(const_iterator __f, const_iterator __l, size_type __n,
- const hasher& __hf, const key_equal& __eql,
- const allocator_type& __a = allocator_type())
- : _M_ht(__n, __hf, __eql, __a)
- { _M_ht.insert_equal(__f, __l); }
-#endif /*__STL_MEMBER_TEMPLATES */
public:
size_type size() const { return _M_ht.size(); }
@@ -367,14 +302,9 @@ public:
bool empty() const { return _M_ht.empty(); }
void swap(hash_multiset& hs) { _M_ht.swap(hs._M_ht); }
-#ifdef __STL_MEMBER_TEMPLATES
template <class _Val, class _HF, class _EqK, class _Al>
friend bool operator== (const hash_multiset<_Val, _HF, _EqK, _Al>&,
const hash_multiset<_Val, _HF, _EqK, _Al>&);
-#else /* __STL_MEMBER_TEMPLATES */
- friend bool __STD_QUALIFIER
- operator== __STL_NULL_TMPL_ARGS (const hash_multiset&,const hash_multiset&);
-#endif /* __STL_MEMBER_TEMPLATES */
iterator begin() const { return _M_ht.begin(); }
iterator end() const { return _M_ht.end(); }
@@ -382,17 +312,9 @@ public:
public:
iterator insert(const value_type& __obj)
{ return _M_ht.insert_equal(__obj); }
-#ifdef __STL_MEMBER_TEMPLATES
template <class _InputIterator>
void insert(_InputIterator __f, _InputIterator __l)
{ _M_ht.insert_equal(__f,__l); }
-#else
- void insert(const value_type* __f, const value_type* __l) {
- _M_ht.insert_equal(__f,__l);
- }
- void insert(const_iterator __f, const_iterator __l)
- { _M_ht.insert_equal(__f, __l); }
-#endif /*__STL_MEMBER_TEMPLATES */
iterator insert_noresize(const value_type& __obj)
{ return _M_ht.insert_equal_noresize(__obj); }
@@ -424,8 +346,6 @@ operator==(const hash_multiset<_Val,_HashFcn,_EqualKey,_Alloc>& __hs1,
return __hs1._M_ht == __hs2._M_ht;
}
-#ifdef __STL_FUNCTION_TMPL_PARTIAL_ORDER
-
template <class _Val, class _HashFcn, class _EqualKey, class _Alloc>
inline bool
operator!=(const hash_multiset<_Val,_HashFcn,_EqualKey,_Alloc>& __hs1,
@@ -440,13 +360,9 @@ swap(hash_multiset<_Val,_HashFcn,_EqualKey,_Alloc>& __hs1,
__hs1.swap(__hs2);
}
-#endif /* __STL_FUNCTION_TMPL_PARTIAL_ORDER */
-
// Specialization of insert_iterator so that it will work for hash_set
// and hash_multiset.
-#ifdef __STL_CLASS_PARTIAL_SPECIALIZATION
-
template <class _Value, class _HashFcn, class _EqualKey, class _Alloc>
class insert_iterator<hash_set<_Value, _HashFcn, _EqualKey, _Alloc> > {
protected:
@@ -500,14 +416,7 @@ public:
insert_iterator<_Container>& operator++(int) { return *this; }
};
-#endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */
-
-#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
-#pragma reset woff 1174
-#pragma reset woff 1375
-#endif
-
-__STL_END_NAMESPACE
+} // namespace std
#endif /* __SGI_STL_INTERNAL_HASH_SET_H */
diff --git a/libstdc++-v3/include/ext/rope b/libstdc++-v3/include/ext/rope
index 3779defea2b..ca0d63d9de6 100644
--- a/libstdc++-v3/include/ext/rope
+++ b/libstdc++-v3/include/ext/rope
@@ -1,3 +1,32 @@
+// SGI's rope class -*- C++ -*-
+
+// Copyright (C) 2001 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.
+
/*
* Copyright (c) 1997
* Silicon Graphics Computer Systems, Inc.
diff --git a/libstdc++-v3/include/ext/ropeimpl.h b/libstdc++-v3/include/ext/ropeimpl.h
index cc4d7bc679e..8373538a539 100644
--- a/libstdc++-v3/include/ext/ropeimpl.h
+++ b/libstdc++-v3/include/ext/ropeimpl.h
@@ -1,3 +1,32 @@
+// SGI's rope class implementation -*- C++ -*-
+
+// Copyright (C) 2001 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.
+
/*
* Copyright (c) 1997
* Silicon Graphics Computer Systems, Inc.
@@ -15,23 +44,15 @@
* You should not attempt to use it directly.
*/
-# include <bits/std_cstdio.h>
-
-#ifdef __STL_USE_NEW_IOSTREAMS
-# include <iostream>
-#else /* __STL_USE_NEW_IOSTREAMS */
-# include <bits/std_iostream.h>
-#endif /* __STL_USE_NEW_IOSTREAMS */
+#include <bits/std_cstdio.h>
+#include <bits/std_iostream.h>
#ifdef __STL_USE_EXCEPTIONS
# include <bits/std_stdexcept.h>
#endif
-__STL_BEGIN_NAMESPACE
-
-#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
-#pragma set woff 1174
-#endif
+namespace std
+{
// Set buf_start, buf_end, and buf_ptr appropriately, filling tmp_buf
// if necessary. Assumes _M_path_end[leaf_index] and leaf_pos are correct.
@@ -303,26 +324,16 @@ inline void _Rope_RopeRep<_CharT,_Alloc>::_M_free_c_string()
template <class _CharT, class _Alloc>
-#ifdef __STL_USE_STD_ALLOCATORS
inline void _Rope_RopeRep<_CharT,_Alloc>::_S_free_string(_CharT* __s,
size_t __n,
allocator_type __a)
-#else
- inline void _Rope_RopeRep<_CharT,_Alloc>::_S_free_string(_CharT* __s,
- size_t __n)
-#endif
{
if (!_S_is_basic_char_type((_CharT*)0)) {
destroy(__s, __s + __n);
}
// This has to be a static member, so this gets a bit messy
-# ifdef __STL_USE_STD_ALLOCATORS
__a.deallocate(
__s, _Rope_RopeLeaf<_CharT,_Alloc>::_S_rounded_up_size(__n));
-# else
- _Data_deallocate(
- __s, _Rope_RopeLeaf<_CharT,_Alloc>::_S_rounded_up_size(__n));
-# endif
}
@@ -375,13 +386,8 @@ void _Rope_RopeRep<_CharT,_Alloc>::_M_free_tree()
#else
template <class _CharT, class _Alloc>
-#ifdef __STL_USE_STD_ALLOCATORS
inline void _Rope_RopeRep<_CharT,_Alloc>::_S_free_string
(const _CharT*, size_t, allocator_type)
-#else
- inline void _Rope_RopeRep<_CharT,_Alloc>::_S_free_string
- (const _CharT*, size_t)
-#endif
{}
#endif
@@ -456,9 +462,7 @@ rope<_CharT,_Alloc>::_S_tree_concat (_RopeRep* __left, _RopeRep* __right)
_S_new_RopeConcatenation(__left, __right, __left->get_allocator());
size_t __depth = __result->_M_depth;
-# ifdef __STL_USE_STD_ALLOCATORS
__stl_assert(__left->get_allocator() == __right->get_allocator());
-# endif
if (__depth > 20 && (__result->_M_size < 1000 ||
__depth > _RopeRep::_S_max_rope_depth)) {
_RopeRep* __balanced;
@@ -791,22 +795,11 @@ class _Rope_find_char_char_consumer : public _Rope_char_consumer<_CharT> {
}
};
-#ifdef __STL_USE_NEW_IOSTREAMS
template<class _CharT, class _Traits>
// Here _CharT is both the stream and rope character type.
-#else
- template<class _CharT>
- // Here _CharT is the rope character type. Unlike in the
- // above case, we somewhat handle the case in which it doesn't
- // match the stream character type, i.e. char.
-#endif
class _Rope_insert_char_consumer : public _Rope_char_consumer<_CharT> {
private:
-# ifdef __STL_USE_NEW_IOSTREAMS
typedef basic_ostream<_CharT,_Traits> _Insert_ostream;
-# else
- typedef ostream _Insert_ostream;
-# endif
_Insert_ostream& _M_o;
public:
_Rope_insert_char_consumer(_Insert_ostream& __writer)
@@ -817,38 +810,15 @@ class _Rope_insert_char_consumer : public _Rope_char_consumer<_CharT> {
// Returns true to continue traversal.
};
-#ifdef __STL_USE_NEW_IOSTREAMS
- template<class _CharT, class _Traits>
- bool _Rope_insert_char_consumer<_CharT, _Traits>::operator()
- (const _CharT* __leaf, size_t __n)
- {
- size_t __i;
- // We assume that formatting is set up correctly for each element.
- for (__i = 0; __i < __n; __i++) _M_o.put(__leaf[__i]);
- return true;
- }
-
-#else
- template<class _CharT>
- bool _Rope_insert_char_consumer<_CharT>::operator()
- (const _CharT* __leaf, size_t __n)
- {
- size_t __i;
- // We assume that formatting is set up correctly for each element.
- for (__i = 0; __i < __n; __i++) _M_o << __leaf[__i];
- return true;
- }
-
-
- __STL_TEMPLATE_NULL
- inline bool _Rope_insert_char_consumer<char>::operator()
- (const char* __leaf, size_t __n)
- {
- size_t __i;
- for (__i = 0; __i < __n; __i++) _M_o.put(__leaf[__i]);
- return true;
- }
-#endif
+template<class _CharT, class _Traits>
+bool _Rope_insert_char_consumer<_CharT, _Traits>::operator()
+ (const _CharT* __leaf, size_t __n)
+{
+ size_t __i;
+ // We assume that formatting is set up correctly for each element.
+ for (__i = 0; __i < __n; __i++) _M_o.put(__leaf[__i]);
+ return true;
+}
template <class _CharT, class _Alloc>
bool rope<_CharT, _Alloc>::_S_apply_to_pieces(
@@ -908,12 +878,8 @@ bool rope<_CharT, _Alloc>::_S_apply_to_pieces(
}
}
-#ifdef __STL_USE_NEW_IOSTREAMS
template<class _CharT, class _Traits>
inline void _Rope_fill(basic_ostream<_CharT, _Traits>& __o, size_t __n)
-#else
- inline void _Rope_fill(ostream& __o, size_t __n)
-#endif
{
char __f = __o.fill();
size_t __i;
@@ -926,25 +892,15 @@ template <class _CharT> inline bool _Rope_is_simple(_CharT*) { return false; }
inline bool _Rope_is_simple(char*) { return true; }
inline bool _Rope_is_simple(wchar_t*) { return true; }
-#ifdef __STL_USE_NEW_IOSTREAMS
- template<class _CharT, class _Traits, class _Alloc>
- basic_ostream<_CharT, _Traits>& operator<<
- (basic_ostream<_CharT, _Traits>& __o,
- const rope<_CharT, _Alloc>& __r)
-#else
- template<class _CharT, class _Alloc>
- ostream& operator<< (ostream& __o, const rope<_CharT, _Alloc>& __r)
-#endif
+template<class _CharT, class _Traits, class _Alloc>
+basic_ostream<_CharT, _Traits>& operator<< (basic_ostream<_CharT, _Traits>& __o,
+ const rope<_CharT, _Alloc>& __r)
{
size_t __w = __o.width();
bool __left = bool(__o.flags() & ios::left);
size_t __pad_len;
size_t __rope_len = __r.size();
-# ifdef __STL_USE_NEW_IOSTREAMS
_Rope_insert_char_consumer<_CharT, _Traits> __c(__o);
-# else
- _Rope_insert_char_consumer<_CharT> __c(__o);
-# endif
bool __is_simple = _Rope_is_simple((_CharT*)0);
if (__rope_len < __w) {
@@ -1575,12 +1531,7 @@ inline void rotate(
}
# endif
-
-#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
-#pragma reset woff 1174
-#endif
-
-__STL_END_NAMESPACE
+} // namespace std
// Local Variables:
// mode:C++
diff --git a/libstdc++-v3/include/ext/slist b/libstdc++-v3/include/ext/slist
index ef0906279a9..0c114e9e947 100644
--- a/libstdc++-v3/include/ext/slist
+++ b/libstdc++-v3/include/ext/slist
@@ -1,3 +1,32 @@
+// Singly-linked list implementation -*- C++ -*-
+
+// Copyright (C) 2001 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.
+
/*
* Copyright (c) 1997
* Silicon Graphics Computer Systems, Inc.
@@ -19,14 +48,14 @@
#ifndef __SGI_STL_INTERNAL_SLIST_H
#define __SGI_STL_INTERNAL_SLIST_H
-#include <bits/concept_checks.h>
-
-__STL_BEGIN_NAMESPACE
+#include <bits/stl_algobase.h>
+#include <bits/stl_alloc.h>
+#include <bits/stl_construct.h>
+#include <bits/stl_uninitialized.h>
+#include <bits/concept_check.h>
-#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
-#pragma set woff 1174
-#pragma set woff 1375
-#endif
+namespace std
+{
struct _Slist_node_base
{
@@ -149,9 +178,7 @@ struct _Slist_iterator : public _Slist_iterator_base
_Slist_iterator(const iterator& __x) : _Slist_iterator_base(__x._M_node) {}
reference operator*() const { return ((_Node*) _M_node)->_M_data; }
-#ifndef __SGI_STL_NO_ARROW_OPERATOR
pointer operator->() const { return &(operator*()); }
-#endif /* __SGI_STL_NO_ARROW_OPERATOR */
_Self& operator++()
{
@@ -166,22 +193,6 @@ struct _Slist_iterator : public _Slist_iterator_base
}
};
-#ifndef __STL_CLASS_PARTIAL_SPECIALIZATION
-
-inline ptrdiff_t* distance_type(const _Slist_iterator_base&) {
- return 0;
-}
-
-inline forward_iterator_tag iterator_category(const _Slist_iterator_base&) {
- return forward_iterator_tag();
-}
-
-template <class _Tp, class _Ref, class _Ptr>
-inline _Tp* value_type(const _Slist_iterator<_Tp, _Ref, _Ptr>&) {
- return 0;
-}
-
-#endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */
// Base class that encapsulates details of allocators. Three cases:
// an ordinary standard-conforming allocator, a standard-conforming
@@ -190,8 +201,6 @@ inline _Tp* value_type(const _Slist_iterator<_Tp, _Ref, _Ptr>&) {
// compatibility and because we want to avoid wasting storage on an
// allocator instance if it isn't necessary.
-#ifdef __STL_USE_STD_ALLOCATORS
-
// Base for general standard-conforming allocators.
template <class _Tp, class _Allocator, bool _IsStatic>
class _Slist_alloc_base {
@@ -263,38 +272,6 @@ protected:
_Slist_node_base* _M_erase_after(_Slist_node_base*, _Slist_node_base*);
};
-#else /* __STL_USE_STD_ALLOCATORS */
-
-template <class _Tp, class _Alloc>
-struct _Slist_base {
- typedef _Alloc allocator_type;
- allocator_type get_allocator() const { return allocator_type(); }
-
- _Slist_base(const allocator_type&) { _M_head._M_next = 0; }
- ~_Slist_base() { _M_erase_after(&_M_head, 0); }
-
-protected:
- typedef simple_alloc<_Slist_node<_Tp>, _Alloc> _Alloc_type;
- _Slist_node<_Tp>* _M_get_node() { return _Alloc_type::allocate(1); }
- void _M_put_node(_Slist_node<_Tp>* __p) { _Alloc_type::deallocate(__p, 1); }
-
- _Slist_node_base* _M_erase_after(_Slist_node_base* __pos)
- {
- _Slist_node<_Tp>* __next = (_Slist_node<_Tp>*) (__pos->_M_next);
- _Slist_node_base* __next_next = __next->_M_next;
- __pos->_M_next = __next_next;
- destroy(&__next->_M_data);
- _M_put_node(__next);
- return __next_next;
- }
- _Slist_node_base* _M_erase_after(_Slist_node_base*, _Slist_node_base*);
-
-protected:
- _Slist_node_base _M_head;
-};
-
-#endif /* __STL_USE_STD_ALLOCATORS */
-
template <class _Tp, class _Alloc>
_Slist_node_base*
_Slist_base<_Tp,_Alloc>::_M_erase_after(_Slist_node_base* __before_first,
@@ -310,12 +287,11 @@ _Slist_base<_Tp,_Alloc>::_M_erase_after(_Slist_node_base* __before_first,
return __last_node;
}
-template <class _Tp, class _Alloc = __STL_DEFAULT_ALLOCATOR(_Tp) >
+template <class _Tp, class _Alloc = allocator<_Tp> >
class slist : private _Slist_base<_Tp,_Alloc>
{
- // requirements:
-
- __STL_CLASS_REQUIRES(_Tp, _Assignable);
+ // concept requirements
+ __glibcpp_class_requires(_Tp, _SGIAssignableConcept);
private:
typedef _Slist_base<_Tp,_Alloc> _Base;
@@ -369,7 +345,6 @@ public:
explicit slist(size_type __n) : _Base(allocator_type())
{ _M_insert_after_fill(&this->_M_head, __n, value_type()); }
-#ifdef __STL_MEMBER_TEMPLATES
// We don't need any dispatching tricks here, because _M_insert_after_range
// already does them.
template <class _InputIterator>
@@ -377,15 +352,6 @@ public:
const allocator_type& __a = allocator_type()) : _Base(__a)
{ _M_insert_after_range(&this->_M_head, __first, __last); }
-#else /* __STL_MEMBER_TEMPLATES */
- slist(const_iterator __first, const_iterator __last,
- const allocator_type& __a = allocator_type()) : _Base(__a)
- { _M_insert_after_range(&this->_M_head, __first, __last); }
- slist(const value_type* __first, const value_type* __last,
- const allocator_type& __a = allocator_type()) : _Base(__a)
- { _M_insert_after_range(&this->_M_head, __first, __last); }
-#endif /* __STL_MEMBER_TEMPLATES */
-
slist(const slist& __x) : _Base(__x.get_allocator())
{ _M_insert_after_range(&this->_M_head, __x.begin(), __x.end()); }
@@ -404,9 +370,6 @@ public:
void _M_fill_assign(size_type __n, const _Tp& __val);
-
-#ifdef __STL_MEMBER_TEMPLATES
-
template <class _InputIterator>
void assign(_InputIterator __first, _InputIterator __last) {
typedef typename _Is_integer<_InputIterator>::_Integral _Integral;
@@ -421,8 +384,6 @@ public:
void _M_assign_dispatch(_InputIterator __first, _InputIterator __last,
__false_type);
-#endif /* __STL_MEMBER_TEMPLATES */
-
public:
iterator begin() { return iterator((_Node*)this->_M_head._M_next); }
@@ -450,7 +411,7 @@ public:
bool empty() const { return this->_M_head._M_next == 0; }
void swap(slist& __x)
- { __STD::swap(this->_M_head._M_next, __x._M_head._M_next); }
+ { std::swap(this->_M_head._M_next, __x._M_head._M_next); }
public:
@@ -491,8 +452,6 @@ private:
__pos = __slist_make_link(__pos, _M_create_node(__x));
}
-#ifdef __STL_MEMBER_TEMPLATES
-
// Check whether it's an integral type. If so, it's not an iterator.
template <class _InIter>
void _M_insert_after_range(_Node_base* __pos,
@@ -517,26 +476,6 @@ private:
}
}
-#else /* __STL_MEMBER_TEMPLATES */
-
- void _M_insert_after_range(_Node_base* __pos,
- const_iterator __first, const_iterator __last) {
- while (__first != __last) {
- __pos = __slist_make_link(__pos, _M_create_node(*__first));
- ++__first;
- }
- }
- void _M_insert_after_range(_Node_base* __pos,
- const value_type* __first,
- const value_type* __last) {
- while (__first != __last) {
- __pos = __slist_make_link(__pos, _M_create_node(*__first));
- ++__first;
- }
- }
-
-#endif /* __STL_MEMBER_TEMPLATES */
-
public:
iterator insert_after(iterator __pos, const value_type& __x) {
@@ -551,8 +490,6 @@ public:
_M_insert_after_fill(__pos._M_node, __n, __x);
}
-#ifdef __STL_MEMBER_TEMPLATES
-
// We don't need any dispatching tricks here, because _M_insert_after_range
// already does them.
template <class _InIter>
@@ -560,19 +497,6 @@ public:
_M_insert_after_range(__pos._M_node, __first, __last);
}
-#else /* __STL_MEMBER_TEMPLATES */
-
- void insert_after(iterator __pos,
- const_iterator __first, const_iterator __last) {
- _M_insert_after_range(__pos._M_node, __first, __last);
- }
- void insert_after(iterator __pos,
- const value_type* __first, const value_type* __last) {
- _M_insert_after_range(__pos._M_node, __first, __last);
- }
-
-#endif /* __STL_MEMBER_TEMPLATES */
-
iterator insert(iterator __pos, const value_type& __x) {
return iterator(_M_insert_after(__slist_previous(&this->_M_head,
__pos._M_node),
@@ -590,8 +514,6 @@ public:
__n, __x);
}
-#ifdef __STL_MEMBER_TEMPLATES
-
// We don't need any dispatching tricks here, because _M_insert_after_range
// already does them.
template <class _InIter>
@@ -600,21 +522,6 @@ public:
__first, __last);
}
-#else /* __STL_MEMBER_TEMPLATES */
-
- void insert(iterator __pos, const_iterator __first, const_iterator __last) {
- _M_insert_after_range(__slist_previous(&this->_M_head, __pos._M_node),
- __first, __last);
- }
- void insert(iterator __pos, const value_type* __first,
- const value_type* __last) {
- _M_insert_after_range(__slist_previous(&this->_M_head, __pos._M_node),
- __first, __last);
- }
-
-#endif /* __STL_MEMBER_TEMPLATES */
-
-
public:
iterator erase_after(iterator __pos) {
return iterator((_Node*) this->_M_erase_after(__pos._M_node));
@@ -700,7 +607,6 @@ public:
void merge(slist& __x);
void sort();
-#ifdef __STL_MEMBER_TEMPLATES
template <class _Predicate>
void remove_if(_Predicate __pred);
@@ -712,7 +618,6 @@ public:
template <class _StrictWeakOrdering>
void sort(_StrictWeakOrdering __comp);
-#endif /* __STL_MEMBER_TEMPLATES */
};
template <class _Tp, class _Alloc>
@@ -752,8 +657,6 @@ void slist<_Tp, _Alloc>::_M_fill_assign(size_type __n, const _Tp& __val) {
this->_M_erase_after(__prev, 0);
}
-#ifdef __STL_MEMBER_TEMPLATES
-
template <class _Tp, class _Alloc> template <class _InputIter>
void
slist<_Tp, _Alloc>::_M_assign_dispatch(_InputIter __first, _InputIter __last,
@@ -773,8 +676,6 @@ slist<_Tp, _Alloc>::_M_assign_dispatch(_InputIter __first, _InputIter __last,
this->_M_erase_after(__prev, 0);
}
-#endif /* __STL_MEMBER_TEMPLATES */
-
template <class _Tp, class _Alloc>
inline bool
operator==(const slist<_Tp,_Alloc>& _SL1, const slist<_Tp,_Alloc>& _SL2)
@@ -801,8 +702,6 @@ operator<(const slist<_Tp,_Alloc>& _SL1, const slist<_Tp,_Alloc>& _SL2)
_SL2.begin(), _SL2.end());
}
-#ifdef __STL_FUNCTION_TMPL_PARTIAL_ORDER
-
template <class _Tp, class _Alloc>
inline bool
operator!=(const slist<_Tp,_Alloc>& _SL1, const slist<_Tp,_Alloc>& _SL2) {
@@ -832,8 +731,6 @@ inline void swap(slist<_Tp,_Alloc>& __x, slist<_Tp,_Alloc>& __y) {
__x.swap(__y);
}
-#endif /* __STL_FUNCTION_TMPL_PARTIAL_ORDER */
-
template <class _Tp, class _Alloc>
void slist<_Tp,_Alloc>::resize(size_type __len, const _Tp& __x)
@@ -919,8 +816,6 @@ void slist<_Tp,_Alloc>::sort()
}
}
-#ifdef __STL_MEMBER_TEMPLATES
-
template <class _Tp, class _Alloc>
template <class _Predicate>
void slist<_Tp,_Alloc>::remove_if(_Predicate __pred)
@@ -993,13 +888,9 @@ void slist<_Tp,_Alloc>::sort(_StrictWeakOrdering __comp)
}
}
-#endif /* __STL_MEMBER_TEMPLATES */
-
// Specialization of insert_iterator so that insertions will be constant
// time rather than linear time.
-#ifdef __STL_CLASS_PARTIAL_SPECIALIZATION
-
template <class _Tp, class _Alloc>
class insert_iterator<slist<_Tp, _Alloc> > {
protected:
@@ -1032,14 +923,7 @@ public:
insert_iterator<_Container>& operator++(int) { return *this; }
};
-#endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */
-
-#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
-#pragma reset woff 1174
-#pragma reset woff 1375
-#endif
-
-__STL_END_NAMESPACE
+} // namespace std
#endif /* __SGI_STL_INTERNAL_SLIST_H */
diff --git a/libstdc++-v3/include/ext/stl_bvector.h b/libstdc++-v3/include/ext/stl_bvector.h
index 5e64f3889c8..90787012898 100644
--- a/libstdc++-v3/include/ext/stl_bvector.h
+++ b/libstdc++-v3/include/ext/stl_bvector.h
@@ -522,7 +522,7 @@ public:
#ifdef __STL_THROW_RANGE_ERRORS
void _M_range_check(size_type __n) const {
if (__n >= this->size())
- __stl_throw_range_error("vector<bool>");
+ __throw_range_error("vector<bool>");
}
reference at(size_type __n)
diff --git a/libstdc++-v3/include/ext/stl_hash_fun.h b/libstdc++-v3/include/ext/stl_hash_fun.h
index 3144e6a07f1..0ebfbbc1b89 100644
--- a/libstdc++-v3/include/ext/stl_hash_fun.h
+++ b/libstdc++-v3/include/ext/stl_hash_fun.h
@@ -1,3 +1,32 @@
+// 'struct hash' from SGI -*- C++ -*-
+
+// Copyright (C) 2001 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.
+
/*
* Copyright (c) 1996-1998
* Silicon Graphics Computer Systems, Inc.
@@ -33,7 +62,8 @@
#include <bits/std_cstddef.h>
-__STL_BEGIN_NAMESPACE
+namespace std
+{
template <class _Key> struct hash { };
@@ -46,45 +76,45 @@ inline size_t __stl_hash_string(const char* __s)
return size_t(__h);
}
-__STL_TEMPLATE_NULL struct hash<char*>
+template<> struct hash<char*>
{
size_t operator()(const char* __s) const { return __stl_hash_string(__s); }
};
-__STL_TEMPLATE_NULL struct hash<const char*>
+template<> struct hash<const char*>
{
size_t operator()(const char* __s) const { return __stl_hash_string(__s); }
};
-__STL_TEMPLATE_NULL struct hash<char> {
+template<> struct hash<char> {
size_t operator()(char __x) const { return __x; }
};
-__STL_TEMPLATE_NULL struct hash<unsigned char> {
+template<> struct hash<unsigned char> {
size_t operator()(unsigned char __x) const { return __x; }
};
-__STL_TEMPLATE_NULL struct hash<signed char> {
+template<> struct hash<signed char> {
size_t operator()(unsigned char __x) const { return __x; }
};
-__STL_TEMPLATE_NULL struct hash<short> {
+template<> struct hash<short> {
size_t operator()(short __x) const { return __x; }
};
-__STL_TEMPLATE_NULL struct hash<unsigned short> {
+template<> struct hash<unsigned short> {
size_t operator()(unsigned short __x) const { return __x; }
};
-__STL_TEMPLATE_NULL struct hash<int> {
+template<> struct hash<int> {
size_t operator()(int __x) const { return __x; }
};
-__STL_TEMPLATE_NULL struct hash<unsigned int> {
+template<> struct hash<unsigned int> {
size_t operator()(unsigned int __x) const { return __x; }
};
-__STL_TEMPLATE_NULL struct hash<long> {
+template<> struct hash<long> {
size_t operator()(long __x) const { return __x; }
};
-__STL_TEMPLATE_NULL struct hash<unsigned long> {
+template<> struct hash<unsigned long> {
size_t operator()(unsigned long __x) const { return __x; }
};
-__STL_END_NAMESPACE
+} // namespace std
#endif /* _CPP_BITS_STL_HASH_FUN_H */
diff --git a/libstdc++-v3/include/ext/stl_hashtable.h b/libstdc++-v3/include/ext/stl_hashtable.h
index ab5cf5203b1..12074e7da47 100644
--- a/libstdc++-v3/include/ext/stl_hashtable.h
+++ b/libstdc++-v3/include/ext/stl_hashtable.h
@@ -1,3 +1,32 @@
+// Hashtable implementation used by containers -*- C++ -*-
+
+// Copyright (C) 2001 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.
+
/*
* Copyright (c) 1996,1997
* Silicon Graphics Computer Systems, Inc.
@@ -44,7 +73,8 @@
#include <bits/stl_vector.h>
#include <ext/stl_hash_fun.h>
-__STL_BEGIN_NAMESPACE
+namespace std
+{
template <class _Val>
struct _Hashtable_node
@@ -92,9 +122,7 @@ struct _Hashtable_iterator {
: _M_cur(__n), _M_ht(__tab) {}
_Hashtable_iterator() {}
reference operator*() const { return _M_cur->_M_val; }
-#ifndef __SGI_STL_NO_ARROW_OPERATOR
pointer operator->() const { return &(operator*()); }
-#endif /* __SGI_STL_NO_ARROW_OPERATOR */
iterator& operator++();
iterator operator++(int);
bool operator==(const iterator& __it) const
@@ -133,9 +161,7 @@ struct _Hashtable_const_iterator {
_Hashtable_const_iterator(const iterator& __it)
: _M_cur(__it._M_cur), _M_ht(__it._M_ht) {}
reference operator*() const { return _M_cur->_M_val; }
-#ifndef __SGI_STL_NO_ARROW_OPERATOR
pointer operator->() const { return &(operator*()); }
-#endif /* __SGI_STL_NO_ARROW_OPERATOR */
const_iterator& operator++();
const_iterator operator++(int);
bool operator==(const const_iterator& __it) const
@@ -205,7 +231,6 @@ public:
private:
typedef _Hashtable_node<_Val> _Node;
-#ifdef __STL_USE_STD_ALLOCATORS
public:
typedef typename _Alloc_traits<_Val,_Alloc>::allocator_type allocator_type;
allocator_type get_allocator() const { return _M_node_allocator; }
@@ -213,17 +238,6 @@ private:
typename _Alloc_traits<_Node, _Alloc>::allocator_type _M_node_allocator;
_Node* _M_get_node() { return _M_node_allocator.allocate(1); }
void _M_put_node(_Node* __p) { _M_node_allocator.deallocate(__p, 1); }
-# define __HASH_ALLOC_INIT(__a) _M_node_allocator(__a),
-#else /* __STL_USE_STD_ALLOCATORS */
-public:
- typedef _Alloc allocator_type;
- allocator_type get_allocator() const { return allocator_type(); }
-private:
- typedef simple_alloc<_Node, _Alloc> _M_node_allocator_type;
- _Node* _M_get_node() { return _M_node_allocator_type::allocate(1); }
- void _M_put_node(_Node* __p) { _M_node_allocator_type::deallocate(__p, 1); }
-# define __HASH_ALLOC_INIT(__a)
-#endif /* __STL_USE_STD_ALLOCATORS */
private:
hasher _M_hash;
@@ -250,7 +264,7 @@ public:
const _EqualKey& __eql,
const _ExtractKey& __ext,
const allocator_type& __a = allocator_type())
- : __HASH_ALLOC_INIT(__a)
+ : _M_node_allocator(__a),
_M_hash(__hf),
_M_equals(__eql),
_M_get_key(__ext),
@@ -264,7 +278,7 @@ public:
const _HashFcn& __hf,
const _EqualKey& __eql,
const allocator_type& __a = allocator_type())
- : __HASH_ALLOC_INIT(__a)
+ : _M_node_allocator(__a),
_M_hash(__hf),
_M_equals(__eql),
_M_get_key(_ExtractKey()),
@@ -275,7 +289,7 @@ public:
}
hashtable(const hashtable& __ht)
- : __HASH_ALLOC_INIT(__ht.get_allocator())
+ : _M_node_allocator(__ht.get_allocator()),
_M_hash(__ht._M_hash),
_M_equals(__ht._M_equals),
_M_get_key(__ht._M_get_key),
@@ -285,8 +299,6 @@ public:
_M_copy_from(__ht);
}
-#undef __HASH_ALLOC_INIT
-
hashtable& operator= (const hashtable& __ht)
{
if (&__ht != this) {
@@ -307,11 +319,11 @@ public:
void swap(hashtable& __ht)
{
- __STD::swap(_M_hash, __ht._M_hash);
- __STD::swap(_M_equals, __ht._M_equals);
- __STD::swap(_M_get_key, __ht._M_get_key);
+ std::swap(_M_hash, __ht._M_hash);
+ std::swap(_M_equals, __ht._M_equals);
+ std::swap(_M_get_key, __ht._M_get_key);
_M_buckets.swap(__ht._M_buckets);
- __STD::swap(_M_num_elements, __ht._M_num_elements);
+ std::swap(_M_num_elements, __ht._M_num_elements);
}
iterator begin()
@@ -334,15 +346,9 @@ public:
const_iterator end() const { return const_iterator(0, this); }
-#ifdef __STL_MEMBER_TEMPLATES
template <class _Vl, class _Ky, class _HF, class _Ex, class _Eq, class _Al>
friend bool operator== (const hashtable<_Vl, _Ky, _HF, _Ex, _Eq, _Al>&,
const hashtable<_Vl, _Ky, _HF, _Ex, _Eq, _Al>&);
-#else /* __STL_MEMBER_TEMPLATES */
- friend bool __STD_QUALIFIER
- operator== __STL_NULL_TMPL_ARGS (const hashtable&, const hashtable&);
-#endif /* __STL_MEMBER_TEMPLATES */
-
public:
size_type bucket_count() const { return _M_buckets.size(); }
@@ -373,17 +379,16 @@ public:
pair<iterator, bool> insert_unique_noresize(const value_type& __obj);
iterator insert_equal_noresize(const value_type& __obj);
-#ifdef __STL_MEMBER_TEMPLATES
template <class _InputIterator>
void insert_unique(_InputIterator __f, _InputIterator __l)
{
- insert_unique(__f, __l, __ITERATOR_CATEGORY(__f));
+ insert_unique(__f, __l, __iterator_category(__f));
}
template <class _InputIterator>
void insert_equal(_InputIterator __f, _InputIterator __l)
{
- insert_equal(__f, __l, __ITERATOR_CATEGORY(__f));
+ insert_equal(__f, __l, __iterator_category(__f));
}
template <class _InputIterator>
@@ -424,42 +429,6 @@ public:
insert_equal_noresize(*__f);
}
-#else /* __STL_MEMBER_TEMPLATES */
- void insert_unique(const value_type* __f, const value_type* __l)
- {
- size_type __n = __l - __f;
- resize(_M_num_elements + __n);
- for ( ; __n > 0; --__n, ++__f)
- insert_unique_noresize(*__f);
- }
-
- void insert_equal(const value_type* __f, const value_type* __l)
- {
- size_type __n = __l - __f;
- resize(_M_num_elements + __n);
- for ( ; __n > 0; --__n, ++__f)
- insert_equal_noresize(*__f);
- }
-
- void insert_unique(const_iterator __f, const_iterator __l)
- {
- size_type __n = 0;
- distance(__f, __l, __n);
- resize(_M_num_elements + __n);
- for ( ; __n > 0; --__n, ++__f)
- insert_unique_noresize(*__f);
- }
-
- void insert_equal(const_iterator __f, const_iterator __l)
- {
- size_type __n = 0;
- distance(__f, __l, __n);
- resize(_M_num_elements + __n);
- for ( ; __n > 0; --__n, ++__f)
- insert_equal_noresize(*__f);
- }
-#endif /*__STL_MEMBER_TEMPLATES */
-
reference find_or_insert(const value_type& __obj);
iterator find(const key_type& __key)
@@ -617,59 +586,6 @@ _Hashtable_const_iterator<_Val,_Key,_HF,_ExK,_EqK,_All>::operator++(int)
return __tmp;
}
-#ifndef __STL_CLASS_PARTIAL_SPECIALIZATION
-
-template <class _Val, class _Key, class _HF, class _ExK, class _EqK,
- class _All>
-inline forward_iterator_tag
-iterator_category(const _Hashtable_iterator<_Val,_Key,_HF,_ExK,_EqK,_All>&)
-{
- return forward_iterator_tag();
-}
-
-template <class _Val, class _Key, class _HF, class _ExK, class _EqK,
- class _All>
-inline _Val*
-value_type(const _Hashtable_iterator<_Val,_Key,_HF,_ExK,_EqK,_All>&)
-{
- return (_Val*) 0;
-}
-
-template <class _Val, class _Key, class _HF, class _ExK, class _EqK,
- class _All>
-inline hashtable<_Val,_Key,_HF,_ExK,_EqK,_All>::difference_type*
-distance_type(const _Hashtable_iterator<_Val,_Key,_HF,_ExK,_EqK,_All>&)
-{
- return (hashtable<_Val,_Key,_HF,_ExK,_EqK,_All>::difference_type*) 0;
-}
-
-template <class _Val, class _Key, class _HF, class _ExK, class _EqK,
- class _All>
-inline forward_iterator_tag
-iterator_category(const _Hashtable_const_iterator<_Val,_Key,_HF,
- _ExK,_EqK,_All>&)
-{
- return forward_iterator_tag();
-}
-
-template <class _Val, class _Key, class _HF, class _ExK, class _EqK,
- class _All>
-inline _Val*
-value_type(const _Hashtable_const_iterator<_Val,_Key,_HF,_ExK,_EqK,_All>&)
-{
- return (_Val*) 0;
-}
-
-template <class _Val, class _Key, class _HF, class _ExK, class _EqK,
- class _All>
-inline hashtable<_Val,_Key,_HF,_ExK,_EqK,_All>::difference_type*
-distance_type(const _Hashtable_const_iterator<_Val,_Key,_HF,_ExK,_EqK,_All>&)
-{
- return (hashtable<_Val,_Key,_HF,_ExK,_EqK,_All>::difference_type*) 0;
-}
-
-#endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */
-
template <class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
bool operator==(const hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>& __ht1,
const hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>& __ht2)
@@ -677,7 +593,7 @@ bool operator==(const hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>& __ht1,
typedef typename hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>::_Node _Node;
if (__ht1._M_buckets.size() != __ht2._M_buckets.size())
return false;
- for (int __n = 0; __n < __ht1._M_buckets.size(); ++__n) {
+ for (size_t __n = 0; __n < __ht1._M_buckets.size(); ++__n) {
_Node* __cur1 = __ht1._M_buckets[__n];
_Node* __cur2 = __ht2._M_buckets[__n];
for ( ; __cur1 && __cur2 && __cur1->_M_val == __cur2->_M_val;
@@ -689,8 +605,6 @@ bool operator==(const hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>& __ht1,
return true;
}
-#ifdef __STL_FUNCTION_TMPL_PARTIAL_ORDER
-
template <class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
inline bool operator!=(const hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>& __ht1,
const hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>& __ht2) {
@@ -704,8 +618,6 @@ inline void swap(hashtable<_Val, _Key, _HF, _Extract, _EqKey, _All>& __ht1,
__ht1.swap(__ht2);
}
-#endif /* __STL_FUNCTION_TMPL_PARTIAL_ORDER */
-
template <class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
pair<typename hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>::iterator, bool>
@@ -1045,7 +957,7 @@ void hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>
__STL_UNWIND(clear());
}
-__STL_END_NAMESPACE
+} // namespace std
#endif /* __SGI_STL_INTERNAL_HASHTABLE_H */
diff --git a/libstdc++-v3/include/ext/stl_rope.h b/libstdc++-v3/include/ext/stl_rope.h
index f317f3a6fbc..70fad2515db 100644
--- a/libstdc++-v3/include/ext/stl_rope.h
+++ b/libstdc++-v3/include/ext/stl_rope.h
@@ -1,3 +1,32 @@
+// SGI's rope implementation -*- C++ -*-
+
+// Copyright (C) 2001 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.
+
/*
* Copyright (c) 1997-1998
* Silicon Graphics Computer Systems, Inc.
@@ -34,11 +63,8 @@
# include <mutex.h>
# endif
-__STL_BEGIN_NAMESPACE
-
-#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
-#pragma set woff 1174
-#endif
+namespace std
+{
// The _S_eos function is used for those functions that
// convert to/from C-like strings to detect the end of the string.
@@ -97,20 +123,10 @@ class char_producer {
// behave a little like basic_ostringstream<sequence::value_type> and a
// little like containers.
-template<class _Sequence, size_t _Buf_sz = 100
-# if defined(__sgi) && !defined(__GNUC__)
-# define __TYPEDEF_WORKAROUND
- ,class _V = typename _Sequence::value_type
-# endif
- >
-// The 3rd parameter works around a common compiler bug.
+template<class _Sequence, size_t _Buf_sz = 100>
class sequence_buffer : public output_iterator {
public:
-# ifndef __TYPEDEF_WORKAROUND
- typedef typename _Sequence::value_type value_type;
-# else
- typedef _V value_type;
-# endif
+ typedef typename _Sequence::value_type value_type;
protected:
_Sequence* _M_prefix;
value_type _M_buffer[_Buf_sz];
@@ -208,7 +224,7 @@ class _Rope_char_consumer {
// First a lot of forward declarations. The standard seems to require
// much stricter "declaration before use" than many of the implementations
// that preceded it.
-template<class _CharT, class _Alloc=__STL_DEFAULT_ALLOCATOR(_CharT)> class rope;
+template<class _CharT, class _Alloc=allocator<_CharT> > class rope;
template<class _CharT, class _Alloc> struct _Rope_RopeConcatenation;
template<class _CharT, class _Alloc> struct _Rope_RopeLeaf;
template<class _CharT, class _Alloc> struct _Rope_RopeFunction;
@@ -374,8 +390,6 @@ identity_element(_Rope_Concat_fn<_CharT, _Alloc>)
// the differences between SGI-style allocators and standard-conforming
// allocators.
-#ifdef __STL_USE_STD_ALLOCATORS
-
#define __STATIC_IF_SGI_ALLOC /* not static */
// Base class for ordinary allocators.
@@ -445,32 +459,6 @@ struct _Rope_rep_base
: _Base(__size, __a) {}
};
-#else /* !__STL_USE_STD_ALLOCATORS */
-
-#define __STATIC_IF_SGI_ALLOC static
-
-template <class _CharT, class _Alloc>
-class _Rope_rep_base {
-public:
- typedef _Alloc allocator_type;
- static allocator_type get_allocator() { return allocator_type(); }
- _Rope_rep_base(size_t __size, const allocator_type&) : _M_size(__size) {}
- size_t _M_size;
-
-protected:
-
-# define __ROPE_DEFINE_ALLOC(_Tp, __name) \
- typedef simple_alloc<_Tp, _Alloc> __name##Alloc; \
- static _Tp* __name##_allocate(size_t __n) \
- { return __name##Alloc::allocate(__n); } \
- static void __name##_deallocate(_Tp* __p, size_t __n) \
- { __name##Alloc::deallocate(__p, __n); }
- __ROPE_DEFINE_ALLOCS(_Alloc);
-# undef __ROPE_DEFINE_ALLOC
-};
-
-#endif /* __STL_USE_STD_ALLOCATORS */
-
template<class _CharT, class _Alloc>
struct _Rope_RopeRep : public _Rope_rep_base<_CharT,_Alloc>
@@ -504,14 +492,9 @@ struct _Rope_RopeRep : public _Rope_rep_base<_CharT,_Alloc>
# ifdef __GC
void _M_incr () {}
# endif
-# ifdef __STL_USE_STD_ALLOCATORS
static void _S_free_string(__GC_CONST _CharT*, size_t __len,
allocator_type __a);
# define __STL_FREE_STRING(__s, __l, __a) _S_free_string(__s, __l, __a);
-# else
- static void _S_free_string(__GC_CONST _CharT*, size_t __len);
-# define __STL_FREE_STRING(__s, __l, __a) _S_free_string(__s, __l);
-# endif
// Deallocate data section of a leaf.
// This shouldn't be a member function.
// But its hard to do anything else at the
@@ -814,32 +797,13 @@ class _Rope_char_ref_proxy {
}
};
-#ifdef __STL_FUNCTION_TMPL_PARTIAL_ORDER
- template<class _CharT, class __Alloc>
- inline void swap(_Rope_char_ref_proxy <_CharT, __Alloc > __a,
- _Rope_char_ref_proxy <_CharT, __Alloc > __b) {
- _CharT __tmp = __a;
- __a = __b;
- __b = __tmp;
- }
-#else
-// There is no really acceptable way to handle this. The default
-// definition of swap doesn't work for proxy references.
-// It can't really be made to work, even with ugly hacks, since
-// the only unusual operation it uses is the copy constructor, which
-// is needed for other purposes. We provide a macro for
-// full specializations, and instantiate the most common case.
-# define _ROPE_SWAP_SPECIALIZATION(_CharT, __Alloc) \
- inline void swap(_Rope_char_ref_proxy <_CharT, __Alloc > __a, \
- _Rope_char_ref_proxy <_CharT, __Alloc > __b) { \
- _CharT __tmp = __a; \
- __a = __b; \
- __b = __tmp; \
- }
-
-_ROPE_SWAP_SPECIALIZATION(char,__STL_DEFAULT_ALLOCATOR(char))
-
-#endif /* !__STL_FUNCTION_TMPL_PARTIAL_ORDER */
+template<class _CharT, class __Alloc>
+inline void swap(_Rope_char_ref_proxy <_CharT, __Alloc > __a,
+ _Rope_char_ref_proxy <_CharT, __Alloc > __b) {
+ _CharT __tmp = __a;
+ __a = __b;
+ __b = __tmp;
+}
template<class _CharT, class _Alloc>
class _Rope_char_ptr_proxy {
@@ -862,15 +826,9 @@ class _Rope_char_ptr_proxy {
_M_root = __x._M_root;
return *this;
}
-#ifdef __STL_MEMBER_TEMPLATES
template<class _CharT2, class _Alloc2>
friend bool operator== (const _Rope_char_ptr_proxy<_CharT2,_Alloc2>& __x,
const _Rope_char_ptr_proxy<_CharT2,_Alloc2>& __y);
-#else
- friend bool operator== __STL_NULL_TMPL_ARGS
- (const _Rope_char_ptr_proxy<_CharT,_Alloc>& __x,
- const _Rope_char_ptr_proxy<_CharT,_Alloc>& __y);
-#endif
_Rope_char_ref_proxy<_CharT,_Alloc> operator*() const {
return _Rope_char_ref_proxy<_CharT,_Alloc>(_M_root, _M_pos);
}
@@ -886,10 +844,6 @@ class _Rope_char_ptr_proxy {
// Iterators are assumed to be thread private. Ropes can
// be shared.
-#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
-#pragma set woff 1375
-#endif
-
template<class _CharT, class _Alloc>
class _Rope_iterator_base
: public random_access_iterator<_CharT, ptrdiff_t> {
@@ -966,10 +920,8 @@ template<class _CharT, class _Alloc>
class _Rope_const_iterator : public _Rope_iterator_base<_CharT,_Alloc> {
friend class rope<_CharT,_Alloc>;
protected:
-# ifdef __STL_HAS_NAMESPACES
typedef _Rope_RopeRep<_CharT,_Alloc> _RopeRep;
// The one from the base class may not be directly visible.
-# endif
_Rope_const_iterator(const _RopeRep* __root, size_t __pos):
_Rope_iterator_base<_CharT,_Alloc>(
const_cast<_RopeRep*>(__root), __pos)
@@ -1045,7 +997,6 @@ class _Rope_const_iterator : public _Rope_iterator_base<_CharT,_Alloc> {
_M_decr(1);
return _Rope_const_iterator<_CharT,_Alloc>(_M_root, __old_pos);
}
-#if defined(__STL_MEMBER_TEMPLATES) && defined(__STL_FUNCTION_TMPL_PARTIAL_ORDER)
template<class _CharT2, class _Alloc2>
friend _Rope_const_iterator<_CharT2,_Alloc2> operator-
(const _Rope_const_iterator<_CharT2,_Alloc2>& __x,
@@ -1058,23 +1009,10 @@ class _Rope_const_iterator : public _Rope_iterator_base<_CharT,_Alloc> {
friend _Rope_const_iterator<_CharT2,_Alloc2> operator+
(ptrdiff_t __n,
const _Rope_const_iterator<_CharT2,_Alloc2>& __x);
-#else
- friend _Rope_const_iterator<_CharT,_Alloc> operator- __STL_NULL_TMPL_ARGS
- (const _Rope_const_iterator<_CharT,_Alloc>& __x,
- ptrdiff_t __n);
- friend _Rope_const_iterator<_CharT,_Alloc> operator+ __STL_NULL_TMPL_ARGS
- (const _Rope_const_iterator<_CharT,_Alloc>& __x,
- ptrdiff_t __n);
- friend _Rope_const_iterator<_CharT,_Alloc> operator+ __STL_NULL_TMPL_ARGS
- (ptrdiff_t __n,
- const _Rope_const_iterator<_CharT,_Alloc>& __x);
-#endif
-
reference operator[](size_t __n) {
return rope<_CharT,_Alloc>::_S_fetch(_M_root, _M_current_pos + __n);
}
-#if defined(__STL_MEMBER_TEMPLATES) && defined(__STL_FUNCTION_TMPL_PARTIAL_ORDER)
template<class _CharT2, class _Alloc2>
friend bool operator==
(const _Rope_const_iterator<_CharT2,_Alloc2>& __x,
@@ -1087,17 +1025,6 @@ class _Rope_const_iterator : public _Rope_iterator_base<_CharT,_Alloc> {
friend ptrdiff_t operator-
(const _Rope_const_iterator<_CharT2,_Alloc2>& __x,
const _Rope_const_iterator<_CharT2,_Alloc2>& __y);
-#else
- friend bool operator== __STL_NULL_TMPL_ARGS
- (const _Rope_const_iterator<_CharT,_Alloc>& __x,
- const _Rope_const_iterator<_CharT,_Alloc>& __y);
- friend bool operator< __STL_NULL_TMPL_ARGS
- (const _Rope_const_iterator<_CharT,_Alloc>& __x,
- const _Rope_const_iterator<_CharT,_Alloc>& __y);
- friend ptrdiff_t operator- __STL_NULL_TMPL_ARGS
- (const _Rope_const_iterator<_CharT,_Alloc>& __x,
- const _Rope_const_iterator<_CharT,_Alloc>& __y);
-#endif
};
template<class _CharT, class _Alloc>
@@ -1201,7 +1128,6 @@ class _Rope_iterator : public _Rope_iterator_base<_CharT,_Alloc> {
_M_root_rope, _M_current_pos + __n);
}
-#if defined(__STL_MEMBER_TEMPLATES) && defined(__STL_FUNCTION_TMPL_PARTIAL_ORDER)
template<class _CharT2, class _Alloc2>
friend bool operator==
(const _Rope_iterator<_CharT2,_Alloc2>& __x,
@@ -1226,38 +1152,12 @@ class _Rope_iterator : public _Rope_iterator_base<_CharT,_Alloc> {
friend _Rope_iterator<_CharT2,_Alloc2> operator+
(ptrdiff_t __n,
const _Rope_iterator<_CharT2,_Alloc2>& __x);
-#else
- friend bool operator== __STL_NULL_TMPL_ARGS
- (const _Rope_iterator<_CharT,_Alloc>& __x,
- const _Rope_iterator<_CharT,_Alloc>& __y);
- friend bool operator< __STL_NULL_TMPL_ARGS
- (const _Rope_iterator<_CharT,_Alloc>& __x,
- const _Rope_iterator<_CharT,_Alloc>& __y);
- friend ptrdiff_t operator- __STL_NULL_TMPL_ARGS
- (const _Rope_iterator<_CharT,_Alloc>& __x,
- const _Rope_iterator<_CharT,_Alloc>& __y);
- friend _Rope_iterator<_CharT,_Alloc> operator- __STL_NULL_TMPL_ARGS
- (const _Rope_iterator<_CharT,_Alloc>& __x,
- ptrdiff_t __n);
- friend _Rope_iterator<_CharT,_Alloc> operator+ __STL_NULL_TMPL_ARGS
- (const _Rope_iterator<_CharT,_Alloc>& __x,
- ptrdiff_t __n);
- friend _Rope_iterator<_CharT,_Alloc> operator+ __STL_NULL_TMPL_ARGS
- (ptrdiff_t __n,
- const _Rope_iterator<_CharT,_Alloc>& __x);
-#endif
};
-#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
-#pragma reset woff 1375
-#endif
-
// The rope base class encapsulates
// the differences between SGI-style allocators and standard-conforming
// allocators.
-#ifdef __STL_USE_STD_ALLOCATORS
-
// Base class for ordinary allocators.
template <class _CharT, class _Allocator, bool _IsStatic>
class _Rope_alloc_base {
@@ -1332,33 +1232,6 @@ struct _Rope_base
_Rope_base(const allocator_type& __a) : _Base(__a) {}
};
-#else /* !__STL_USE_STD_ALLOCATORS */
-
-template <class _CharT, class _Alloc>
-class _Rope_base {
-public:
- typedef _Rope_RopeRep<_CharT, _Alloc> _RopeRep;
- typedef _Alloc allocator_type;
- static allocator_type get_allocator() { return allocator_type(); }
- _Rope_base(_RopeRep * __t, const allocator_type&) : _M_tree_ptr(__t) {}
- _Rope_base(const allocator_type&) {}
-
-protected:
- // The only data member of a rope:
- _RopeRep* _M_tree_ptr;
-
-# define __ROPE_DEFINE_ALLOC(_Tp, __name) \
- typedef simple_alloc<_Tp, _Alloc> __name##Alloc; \
- static _Tp* __name##_allocate(size_t __n) \
- { return __name##Alloc::allocate(__n); } \
- static void __name##_deallocate(_Tp *__p, size_t __n) \
- { __name##Alloc::deallocate(__p, __n); }
- __ROPE_DEFINE_ALLOCS(_Alloc)
-# undef __ROPE_DEFINE_ALLOC
-};
-
-#endif /* __STL_USE_STD_ALLOCATORS */
-
template <class _CharT, class _Alloc>
class rope : public _Rope_base<_CharT,_Alloc> {
@@ -1384,9 +1257,7 @@ class rope : public _Rope_base<_CharT,_Alloc> {
protected:
typedef _Rope_base<_CharT,_Alloc> _Base;
typedef typename _Base::allocator_type allocator_type;
-# ifdef __STL_USE_NAMESPACES
- using _Base::_M_tree_ptr;
-# endif
+ using _Base::_M_tree_ptr;
typedef __GC_CONST _CharT* _Cstrptr;
static _CharT _S_empty_c_str[1];
@@ -1494,11 +1365,7 @@ class rope : public _Rope_base<_CharT,_Alloc> {
static _RopeLeaf* _S_new_RopeLeaf(__GC_CONST _CharT *__s,
size_t __size, allocator_type __a)
{
-# ifdef __STL_USE_STD_ALLOCATORS
- _RopeLeaf* __space = _LAllocator(__a).allocate(1);
-# else
- _RopeLeaf* __space = _L_allocate(1);
-# endif
+ _RopeLeaf* __space = _LAllocator(__a).allocate(1);
return new(__space) _RopeLeaf(__s, __size, __a);
}
@@ -1506,22 +1373,14 @@ class rope : public _Rope_base<_CharT,_Alloc> {
_RopeRep* __left, _RopeRep* __right,
allocator_type __a)
{
-# ifdef __STL_USE_STD_ALLOCATORS
- _RopeConcatenation* __space = _CAllocator(__a).allocate(1);
-# else
- _RopeConcatenation* __space = _C_allocate(1);
-# endif
+ _RopeConcatenation* __space = _CAllocator(__a).allocate(1);
return new(__space) _RopeConcatenation(__left, __right, __a);
}
static _RopeFunction* _S_new_RopeFunction(char_producer<_CharT>* __f,
size_t __size, bool __d, allocator_type __a)
{
-# ifdef __STL_USE_STD_ALLOCATORS
- _RopeFunction* __space = _FAllocator(__a).allocate(1);
-# else
- _RopeFunction* __space = _F_allocate(1);
-# endif
+ _RopeFunction* __space = _FAllocator(__a).allocate(1);
return new(__space) _RopeFunction(__f, __size, __d, __a);
}
@@ -1529,35 +1388,18 @@ class rope : public _Rope_base<_CharT,_Alloc> {
_Rope_RopeRep<_CharT,_Alloc>* __b, size_t __s,
size_t __l, allocator_type __a)
{
-# ifdef __STL_USE_STD_ALLOCATORS
- _RopeSubstring* __space = _SAllocator(__a).allocate(1);
-# else
- _RopeSubstring* __space = _S_allocate(1);
-# endif
+ _RopeSubstring* __space = _SAllocator(__a).allocate(1);
return new(__space) _RopeSubstring(__b, __s, __l, __a);
}
-# ifdef __STL_USE_STD_ALLOCATORS
static
_RopeLeaf* _S_RopeLeaf_from_unowned_char_ptr(const _CharT *__s,
size_t __size, allocator_type __a)
# define __STL_ROPE_FROM_UNOWNED_CHAR_PTR(__s, __size, __a) \
_S_RopeLeaf_from_unowned_char_ptr(__s, __size, __a)
-# else
- static
- _RopeLeaf* _S_RopeLeaf_from_unowned_char_ptr2(const _CharT* __s,
- size_t __size)
-# define __STL_ROPE_FROM_UNOWNED_CHAR_PTR(__s, __size, __a) \
- _S_RopeLeaf_from_unowned_char_ptr2(__s, __size)
-# endif
{
if (0 == __size) return 0;
-# ifdef __STL_USE_STD_ALLOCATORS
- _CharT* __buf = __a.allocate(_S_rounded_up_size(__size));
-# else
- _CharT* __buf = _Data_allocate(_S_rounded_up_size(__size));
- allocator_type __a = allocator_type();
-# endif
+ _CharT* __buf = __a.allocate(_S_rounded_up_size(__size));
uninitialized_copy_n(__s, __size, __buf);
_S_cond_store_eos(__buf[__size]);
@@ -1734,9 +1576,7 @@ class rope : public _Rope_base<_CharT,_Alloc> {
rope& operator=(const rope& __x)
{
_RopeRep* __old = _M_tree_ptr;
-# ifdef __STL_USE_STD_ALLOCATORS
- __stl_assert(get_allocator() == __x.get_allocator());
-# endif
+ __stl_assert(get_allocator() == __x.get_allocator());
_M_tree_ptr = __x._M_tree_ptr;
_S_ref(_M_tree_ptr);
_S_unref(__old);
@@ -1893,12 +1733,7 @@ class rope : public _Rope_base<_CharT,_Alloc> {
// but it's harder to make guarantees.
}
-# ifdef __STL_CLASS_PARTIAL_SPECIALIZATION
typedef reverse_iterator<const_iterator> const_reverse_iterator;
-# else /* __STL_CLASS_PARTIAL_SPECIALIZATION */
- typedef reverse_iterator<const_iterator, value_type, const_reference,
- difference_type> const_reverse_iterator;
-# endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */
const_reverse_iterator rbegin() const {
return const_reverse_iterator(end());
@@ -1916,7 +1751,6 @@ class rope : public _Rope_base<_CharT,_Alloc> {
return const_reverse_iterator(begin());
}
-#if defined(__STL_MEMBER_TEMPLATES) && defined(__STL_FUNCTION_TMPL_PARTIAL_ORDER)
template<class _CharT2, class _Alloc2>
friend rope<_CharT2,_Alloc2>
operator+ (const rope<_CharT2,_Alloc2>& __left,
@@ -1930,19 +1764,6 @@ class rope : public _Rope_base<_CharT,_Alloc> {
template<class _CharT2, class _Alloc2>
friend rope<_CharT2,_Alloc2>
operator+ (const rope<_CharT2,_Alloc2>& __left, _CharT2 __right);
-#else
- friend rope<_CharT,_Alloc> __STD_QUALIFIER
- operator+ __STL_NULL_TMPL_ARGS (const rope<_CharT,_Alloc>& __left,
- const rope<_CharT,_Alloc>& __right);
-
- friend rope<_CharT,_Alloc> __STD_QUALIFIER
- operator+ __STL_NULL_TMPL_ARGS (const rope<_CharT,_Alloc>& __left,
- const _CharT* __right);
-
- friend rope<_CharT,_Alloc> __STD_QUALIFIER
- operator+ __STL_NULL_TMPL_ARGS (const rope<_CharT,_Alloc>& __left,
- _CharT __right);
-#endif
// The symmetric cases are intentionally omitted, since they're presumed
// to be less common, and we don't handle them as well.
@@ -1973,9 +1794,7 @@ class rope : public _Rope_base<_CharT,_Alloc> {
rope& append(const_iterator __s, const_iterator __e) {
__stl_assert(__s._M_root == __e._M_root);
-# ifdef __STL_USE_STD_ALLOCATORS
- __stl_assert(get_allocator() == __s._M_root->get_allocator());
-# endif
+ __stl_assert(get_allocator() == __s._M_root->get_allocator());
_Self_destruct_ptr __appendee(_S_substring(
__s._M_root, __s._M_current_pos, __e._M_current_pos));
_RopeRep* __result =
@@ -1996,9 +1815,7 @@ class rope : public _Rope_base<_CharT,_Alloc> {
rope& append() { return append(_CharT()); } // XXX why?
rope& append(const rope& __y) {
-# ifdef __STL_USE_STD_ALLOCATORS
- __stl_assert(__y.get_allocator() == get_allocator());
-# endif
+ __stl_assert(__y.get_allocator() == get_allocator());
_RopeRep* __result = _S_concat(_M_tree_ptr, __y._M_tree_ptr);
_S_unref(_M_tree_ptr);
_M_tree_ptr = __result;
@@ -2011,9 +1828,7 @@ class rope : public _Rope_base<_CharT,_Alloc> {
}
void swap(rope& __b) {
-# ifdef __STL_USE_STD_ALLOCATORS
- __stl_assert(get_allocator() == __b.get_allocator());
-# endif
+ __stl_assert(get_allocator() == __b.get_allocator());
_RopeRep* __tmp = _M_tree_ptr;
_M_tree_ptr = __b._M_tree_ptr;
__b._M_tree_ptr = __tmp;
@@ -2031,9 +1846,7 @@ class rope : public _Rope_base<_CharT,_Alloc> {
_S_substring(__old, __pos2, __old->_M_size));
_RopeRep* __result;
-# ifdef __STL_USE_STD_ALLOCATORS
- __stl_assert(__old->get_allocator() == __r->get_allocator());
-# endif
+ __stl_assert(__old->get_allocator() == __r->get_allocator());
if (0 == __r) {
__result = _S_concat(__left, __right);
} else {
@@ -2047,9 +1860,7 @@ class rope : public _Rope_base<_CharT,_Alloc> {
void insert(size_t __p, const rope& __r) {
_RopeRep* __result =
replace(_M_tree_ptr, __p, __p, __r._M_tree_ptr);
-# ifdef __STL_USE_STD_ALLOCATORS
- __stl_assert(get_allocator() == __r.get_allocator());
-# endif
+ __stl_assert(get_allocator() == __r.get_allocator());
_S_unref(_M_tree_ptr);
_M_tree_ptr = __result;
}
@@ -2314,12 +2125,7 @@ class rope : public _Rope_base<_CharT,_Alloc> {
return(iterator(this, size()));
}
-# ifdef __STL_CLASS_PARTIAL_SPECIALIZATION
typedef reverse_iterator<iterator> reverse_iterator;
-# else /* __STL_CLASS_PARTIAL_SPECIALIZATION */
- typedef reverse_iterator<iterator, value_type, reference,
- difference_type> reverse_iterator;
-# endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */
reverse_iterator mutable_rbegin() {
return reverse_iterator(mutable_end());
@@ -2397,8 +2203,6 @@ inline bool operator< (const _Rope_const_iterator<_CharT,_Alloc>& __x,
return (__x._M_current_pos < __y._M_current_pos);
}
-#ifdef __STL_FUNCTION_TMPL_PARTIAL_ORDER
-
template <class _CharT, class _Alloc>
inline bool operator!= (const _Rope_const_iterator<_CharT,_Alloc>& __x,
const _Rope_const_iterator<_CharT,_Alloc>& __y) {
@@ -2423,8 +2227,6 @@ inline bool operator>= (const _Rope_const_iterator<_CharT,_Alloc>& __x,
return !(__x < __y);
}
-#endif /* __STL_FUNCTION_TMPL_PARTIAL_ORDER */
-
template <class _CharT, class _Alloc>
inline ptrdiff_t operator-(const _Rope_const_iterator<_CharT,_Alloc>& __x,
const _Rope_const_iterator<_CharT,_Alloc>& __y) {
@@ -2465,8 +2267,6 @@ inline bool operator< (const _Rope_iterator<_CharT,_Alloc>& __x,
return (__x._M_current_pos < __y._M_current_pos);
}
-#ifdef __STL_FUNCTION_TMPL_PARTIAL_ORDER
-
template <class _CharT, class _Alloc>
inline bool operator!= (const _Rope_iterator<_CharT,_Alloc>& __x,
const _Rope_iterator<_CharT,_Alloc>& __y) {
@@ -2491,8 +2291,6 @@ inline bool operator>= (const _Rope_iterator<_CharT,_Alloc>& __x,
return !(__x < __y);
}
-#endif /* __STL_FUNCTION_TMPL_PARTIAL_ORDER */
-
template <class _CharT, class _Alloc>
inline ptrdiff_t operator-(const _Rope_iterator<_CharT,_Alloc>& __x,
const _Rope_iterator<_CharT,_Alloc>& __y) {
@@ -2528,9 +2326,7 @@ rope<_CharT,_Alloc>
operator+ (const rope<_CharT,_Alloc>& __left,
const rope<_CharT,_Alloc>& __right)
{
-# ifdef __STL_USE_STD_ALLOCATORS
- __stl_assert(__left.get_allocator() == __right.get_allocator());
-# endif
+ __stl_assert(__left.get_allocator() == __right.get_allocator());
return rope<_CharT,_Alloc>(
rope<_CharT,_Alloc>::_S_concat(__left._M_tree_ptr, __right._M_tree_ptr));
// Inlining this should make it possible to keep __left and
@@ -2604,8 +2400,6 @@ inline bool operator== (const _Rope_char_ptr_proxy<_CharT,_Alloc>& __x,
return (__x._M_pos == __y._M_pos && __x._M_root == __y._M_root);
}
-#ifdef __STL_FUNCTION_TMPL_PARTIAL_ORDER
-
template <class _CharT, class _Alloc>
inline bool
operator!= (const rope<_CharT,_Alloc>& __x, const rope<_CharT,_Alloc>& __y) {
@@ -2636,18 +2430,11 @@ inline bool operator!= (const _Rope_char_ptr_proxy<_CharT,_Alloc>& __x,
return !(__x == __y);
}
-#endif /* __STL_FUNCTION_TMPL_PARTIAL_ORDER */
-
-#ifdef __STL_USE_NEW_IOSTREAMS
- template<class _CharT, class _Traits, class _Alloc>
- basic_ostream<_CharT, _Traits>& operator<<
+template<class _CharT, class _Traits, class _Alloc>
+basic_ostream<_CharT, _Traits>& operator<<
(basic_ostream<_CharT, _Traits>& __o,
const rope<_CharT, _Alloc>& __r);
-#else
- template<class _CharT, class _Alloc>
- ostream& operator<< (ostream& __o, const rope<_CharT, _Alloc>& __r);
-#endif
-
+
typedef rope<char> crope;
typedef rope<wchar_t> wrope;
@@ -2661,22 +2448,13 @@ inline wrope::reference __mutable_reference_at(wrope& __c, size_t __i)
return __c.mutable_reference_at(__i);
}
-#ifdef __STL_FUNCTION_TMPL_PARTIAL_ORDER
-
template <class _CharT, class _Alloc>
inline void swap(rope<_CharT,_Alloc>& __x, rope<_CharT,_Alloc>& __y) {
__x.swap(__y);
}
-#else
-
-inline void swap(crope __x, crope __y) { __x.swap(__y); }
-inline void swap(wrope __x, wrope __y) { __x.swap(__y); }
-
-#endif /* __STL_FUNCTION_TMPL_PARTIAL_ORDER */
-
// Hash functions should probably be revisited later:
-__STL_TEMPLATE_NULL struct hash<crope>
+template<> struct hash<crope>
{
size_t operator()(const crope& __str) const
{
@@ -2688,7 +2466,7 @@ __STL_TEMPLATE_NULL struct hash<crope>
};
-__STL_TEMPLATE_NULL struct hash<wrope>
+template<> struct hash<wrope>
{
size_t operator()(const wrope& __str) const
{
@@ -2699,11 +2477,7 @@ __STL_TEMPLATE_NULL struct hash<wrope>
}
};
-#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
-#pragma reset woff 1174
-#endif
-
-__STL_END_NAMESPACE
+} // namespace std
# include <ext/ropeimpl.h>
diff --git a/libstdc++-v3/include/std/algorithm b/libstdc++-v3/include/std/algorithm
index eebcdf22977..06a553fdddb 100644
--- a/libstdc++-v3/include/std/algorithm
+++ b/libstdc++-v3/include/std/algorithm
@@ -1,3 +1,32 @@
+// -*- C++ -*- std header.
+
+// Copyright (C) 2001 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.
+
#ifndef _CPP_ALGORITHM
#include <bits/std_algorithm.h>
#endif
diff --git a/libstdc++-v3/include/std/bitset b/libstdc++-v3/include/std/bitset
index e334ec96451..9ce6c7962da 100644
--- a/libstdc++-v3/include/std/bitset
+++ b/libstdc++-v3/include/std/bitset
@@ -1,3 +1,32 @@
+// -*- C++ -*- std header.
+
+// Copyright (C) 2001 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.
+
#ifndef _CPP_BITSET
#include <bits/std_bitset.h>
#endif
diff --git a/libstdc++-v3/include/std/cassert b/libstdc++-v3/include/std/cassert
index bee254d55f1..fe0b8b5b645 100644
--- a/libstdc++-v3/include/std/cassert
+++ b/libstdc++-v3/include/std/cassert
@@ -1,3 +1,32 @@
+// -*- C++ -*- std header.
+
+// Copyright (C) 2001 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.
+
// This one should not have include guards.
#include <bits/std_cassert.h>
diff --git a/libstdc++-v3/include/std/cctype b/libstdc++-v3/include/std/cctype
index d888a3f80ed..868e4be335c 100644
--- a/libstdc++-v3/include/std/cctype
+++ b/libstdc++-v3/include/std/cctype
@@ -1,3 +1,32 @@
+// -*- C++ -*- std header.
+
+// Copyright (C) 2001 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.
+
#ifndef _CPP_CCTYPE
#include <bits/std_cctype.h>
#endif
diff --git a/libstdc++-v3/include/std/cerrno b/libstdc++-v3/include/std/cerrno
index 5d2cf1f61a4..b7bfe3a393d 100644
--- a/libstdc++-v3/include/std/cerrno
+++ b/libstdc++-v3/include/std/cerrno
@@ -1,3 +1,32 @@
+// -*- C++ -*- std header.
+
+// Copyright (C) 2001 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.
+
#ifndef _CPP_CERRNO
#include <bits/std_cerrno.h>
#endif
diff --git a/libstdc++-v3/include/std/cfloat b/libstdc++-v3/include/std/cfloat
index c6cb35731a8..d91824d38ae 100644
--- a/libstdc++-v3/include/std/cfloat
+++ b/libstdc++-v3/include/std/cfloat
@@ -1,3 +1,32 @@
+// -*- C++ -*- std header.
+
+// Copyright (C) 2001 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.
+
#ifndef _CPP_CFLOAT
#include <bits/std_cfloat.h>
#endif
diff --git a/libstdc++-v3/include/std/ciso646 b/libstdc++-v3/include/std/ciso646
index e69de29bb2d..f5dd444bd17 100644
--- a/libstdc++-v3/include/std/ciso646
+++ b/libstdc++-v3/include/std/ciso646
@@ -0,0 +1,28 @@
+// -*- C++ -*- std header.
+
+// Copyright (C) 2001 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.
diff --git a/libstdc++-v3/include/std/climits b/libstdc++-v3/include/std/climits
index b7614847bbe..afadc6403d5 100644
--- a/libstdc++-v3/include/std/climits
+++ b/libstdc++-v3/include/std/climits
@@ -1,3 +1,32 @@
+// -*- C++ -*- std header.
+
+// Copyright (C) 2001 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.
+
#ifndef _CPP_CLIMITS
#include <bits/std_climits.h>
#endif
diff --git a/libstdc++-v3/include/std/clocale b/libstdc++-v3/include/std/clocale
index 6ac636f8786..8a62dfa886d 100644
--- a/libstdc++-v3/include/std/clocale
+++ b/libstdc++-v3/include/std/clocale
@@ -1,3 +1,32 @@
+// -*- C++ -*- std header.
+
+// Copyright (C) 2001 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.
+
#ifndef _CPP_CLOCALE
#include <bits/std_clocale.h>
#endif
diff --git a/libstdc++-v3/include/std/cmath b/libstdc++-v3/include/std/cmath
index 783e76af1c5..95da649724a 100644
--- a/libstdc++-v3/include/std/cmath
+++ b/libstdc++-v3/include/std/cmath
@@ -1,3 +1,32 @@
+// -*- C++ -*- std header.
+
+// Copyright (C) 2001 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.
+
#ifndef _CPP_CMATH
#include <bits/std_cmath.h>
#endif
diff --git a/libstdc++-v3/include/std/complex b/libstdc++-v3/include/std/complex
index 2cc52f5531d..dfc144ffdc3 100644
--- a/libstdc++-v3/include/std/complex
+++ b/libstdc++-v3/include/std/complex
@@ -1,3 +1,32 @@
+// -*- C++ -*- std header.
+
+// Copyright (C) 2001 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.
+
#ifndef _CPP_COMPLEX
#include <bits/std_complex.h>
#endif
diff --git a/libstdc++-v3/include/std/csetjmp b/libstdc++-v3/include/std/csetjmp
index 79531e3607a..ce6fb32c957 100644
--- a/libstdc++-v3/include/std/csetjmp
+++ b/libstdc++-v3/include/std/csetjmp
@@ -1,3 +1,31 @@
+// -*- C++ -*- std header.
+
+// Copyright (C) 2001 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.
#ifndef _CPP_CSETJMP
#include <bits/std_csetjmp.h>
diff --git a/libstdc++-v3/include/std/csignal b/libstdc++-v3/include/std/csignal
index e5c1837a4a5..b3da42a9a73 100644
--- a/libstdc++-v3/include/std/csignal
+++ b/libstdc++-v3/include/std/csignal
@@ -1,3 +1,31 @@
+// -*- C++ -*- std header.
+
+// Copyright (C) 2001 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.
#ifndef _CPP_CSIGNAL
#include <bits/std_csignal.h>
diff --git a/libstdc++-v3/include/std/cstdarg b/libstdc++-v3/include/std/cstdarg
index 37b2459f6a5..36032b22c23 100644
--- a/libstdc++-v3/include/std/cstdarg
+++ b/libstdc++-v3/include/std/cstdarg
@@ -1,3 +1,31 @@
+// -*- C++ -*- std header.
+
+// Copyright (C) 2001 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.
#ifndef _CPP_CSTDARG
#include <bits/std_cstdarg.h>
diff --git a/libstdc++-v3/include/std/cstddef b/libstdc++-v3/include/std/cstddef
index fab421423ba..086bb726b2b 100644
--- a/libstdc++-v3/include/std/cstddef
+++ b/libstdc++-v3/include/std/cstddef
@@ -1,3 +1,32 @@
+// -*- C++ -*- std header.
+
+// Copyright (C) 2001 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.
+
#ifndef _CPP_CSTDDEF
#include <bits/std_cstddef.h>
#endif
diff --git a/libstdc++-v3/include/std/cstdio b/libstdc++-v3/include/std/cstdio
index f2a0135e65a..4d8aced1f8c 100644
--- a/libstdc++-v3/include/std/cstdio
+++ b/libstdc++-v3/include/std/cstdio
@@ -1,3 +1,32 @@
+// -*- C++ -*- std header.
+
+// Copyright (C) 2001 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.
+
#ifndef _CPP_CSTDIO
#include <bits/std_cstdio.h>
#endif
diff --git a/libstdc++-v3/include/std/cstdlib b/libstdc++-v3/include/std/cstdlib
index 98230261186..7796c6b3254 100644
--- a/libstdc++-v3/include/std/cstdlib
+++ b/libstdc++-v3/include/std/cstdlib
@@ -1,3 +1,32 @@
+// -*- C++ -*- std header.
+
+// Copyright (C) 2001 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.
+
#ifndef _CPP_CSTDLIB
#include <bits/std_cstdlib.h>
#endif
diff --git a/libstdc++-v3/include/std/cstring b/libstdc++-v3/include/std/cstring
index b6a3bd9b53f..8d30ba8a9cb 100644
--- a/libstdc++-v3/include/std/cstring
+++ b/libstdc++-v3/include/std/cstring
@@ -1,3 +1,32 @@
+// -*- C++ -*- std header.
+
+// Copyright (C) 2001 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.
+
#ifndef _CPP_CSTRING
#include <bits/std_cstring.h>
#endif
diff --git a/libstdc++-v3/include/std/ctime b/libstdc++-v3/include/std/ctime
index 838fd4360ef..b19136e87a6 100644
--- a/libstdc++-v3/include/std/ctime
+++ b/libstdc++-v3/include/std/ctime
@@ -1,3 +1,32 @@
+// -*- C++ -*- std header.
+
+// Copyright (C) 2001 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.
+
#ifndef _CPP_CTIME
#include <bits/std_ctime.h>
#endif
diff --git a/libstdc++-v3/include/std/cwchar b/libstdc++-v3/include/std/cwchar
index 2cfc330637c..311b2e9e31f 100644
--- a/libstdc++-v3/include/std/cwchar
+++ b/libstdc++-v3/include/std/cwchar
@@ -1,3 +1,32 @@
+// -*- C++ -*- std header.
+
+// Copyright (C) 2001 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.
+
#ifndef _CPP_CWCHAR
#include <bits/std_cwchar.h>
#endif
diff --git a/libstdc++-v3/include/std/cwctype b/libstdc++-v3/include/std/cwctype
index ccd49086901..4cf2e7dfe77 100644
--- a/libstdc++-v3/include/std/cwctype
+++ b/libstdc++-v3/include/std/cwctype
@@ -1,3 +1,32 @@
+// -*- C++ -*- std header.
+
+// Copyright (C) 2001 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.
+
#ifndef _CPP_CWCTYPE
#include <bits/std_cwctype.h>
#endif
diff --git a/libstdc++-v3/include/std/deque b/libstdc++-v3/include/std/deque
index 2215fd02de1..c8ee81e9e6b 100644
--- a/libstdc++-v3/include/std/deque
+++ b/libstdc++-v3/include/std/deque
@@ -1,3 +1,32 @@
+// -*- C++ -*- std header.
+
+// Copyright (C) 2001 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.
+
#ifndef _CPP_DEQUE
#include <bits/std_deque.h>
#endif
diff --git a/libstdc++-v3/include/std/fstream b/libstdc++-v3/include/std/fstream
index afe99e98da9..1a68f5ab19f 100644
--- a/libstdc++-v3/include/std/fstream
+++ b/libstdc++-v3/include/std/fstream
@@ -1,3 +1,32 @@
+// -*- C++ -*- std header.
+
+// Copyright (C) 2001 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.
+
#ifndef _CPP_FSTREAM
#include <bits/std_fstream.h>
#endif
diff --git a/libstdc++-v3/include/std/functional b/libstdc++-v3/include/std/functional
index 700c211ba23..ea48352643e 100644
--- a/libstdc++-v3/include/std/functional
+++ b/libstdc++-v3/include/std/functional
@@ -1,3 +1,32 @@
+// -*- C++ -*- std header.
+
+// Copyright (C) 2001 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.
+
#ifndef _CPP_FUNCTIONAL
#include <bits/std_functional.h>
#endif
diff --git a/libstdc++-v3/include/std/iomanip b/libstdc++-v3/include/std/iomanip
index d3c2aa84177..2aa00fa9de9 100644
--- a/libstdc++-v3/include/std/iomanip
+++ b/libstdc++-v3/include/std/iomanip
@@ -1,3 +1,32 @@
+// -*- C++ -*- std header.
+
+// Copyright (C) 2001 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.
+
#ifndef _CPP_IOMANIP
#include <bits/std_iomanip.h>
#endif
diff --git a/libstdc++-v3/include/std/ios b/libstdc++-v3/include/std/ios
index 7132eadfa33..ff398de0681 100644
--- a/libstdc++-v3/include/std/ios
+++ b/libstdc++-v3/include/std/ios
@@ -1,3 +1,32 @@
+// -*- C++ -*- std header.
+
+// Copyright (C) 2001 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.
+
#ifndef _CPP_IOS
#include <bits/std_ios.h>
#endif
diff --git a/libstdc++-v3/include/std/iosfwd b/libstdc++-v3/include/std/iosfwd
index 6a97d3d2d32..3756982abe1 100644
--- a/libstdc++-v3/include/std/iosfwd
+++ b/libstdc++-v3/include/std/iosfwd
@@ -1,3 +1,32 @@
+// -*- C++ -*- std header.
+
+// Copyright (C) 2001 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.
+
#ifndef _CPP_IOSFWD
#include <bits/std_iosfwd.h>
#endif
diff --git a/libstdc++-v3/include/std/iostream b/libstdc++-v3/include/std/iostream
index f94fd058a55..a85fd08ca5a 100644
--- a/libstdc++-v3/include/std/iostream
+++ b/libstdc++-v3/include/std/iostream
@@ -1,3 +1,32 @@
+// -*- C++ -*- std header.
+
+// Copyright (C) 2001 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.
+
#ifndef _CPP_IOSTREAM
#include <bits/std_iostream.h>
#endif
diff --git a/libstdc++-v3/include/std/istream b/libstdc++-v3/include/std/istream
index 9594261aa61..9c6bc55eb3c 100644
--- a/libstdc++-v3/include/std/istream
+++ b/libstdc++-v3/include/std/istream
@@ -1,3 +1,32 @@
+// -*- C++ -*- std header.
+
+// Copyright (C) 2001 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.
+
#ifndef _CPP_ISTREAM
#include <bits/std_istream.h>
#endif
diff --git a/libstdc++-v3/include/std/iterator b/libstdc++-v3/include/std/iterator
index eb22c69746c..2560439638a 100644
--- a/libstdc++-v3/include/std/iterator
+++ b/libstdc++-v3/include/std/iterator
@@ -1,3 +1,32 @@
+// -*- C++ -*- std header.
+
+// Copyright (C) 2001 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.
+
#ifndef _CPP_ITERATOR
#include <bits/std_iterator.h>
#endif
diff --git a/libstdc++-v3/include/std/limits b/libstdc++-v3/include/std/limits
index ba86fe0cba7..8a52c9cfb81 100644
--- a/libstdc++-v3/include/std/limits
+++ b/libstdc++-v3/include/std/limits
@@ -1,3 +1,32 @@
+// -*- C++ -*- std header.
+
+// Copyright (C) 2001 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.
+
#ifndef _CPP_LIMITS
#include <bits/std_limits.h>
#endif
diff --git a/libstdc++-v3/include/std/list b/libstdc++-v3/include/std/list
index ea1883639fa..a32e18d127d 100644
--- a/libstdc++-v3/include/std/list
+++ b/libstdc++-v3/include/std/list
@@ -1,3 +1,32 @@
+// -*- C++ -*- std header.
+
+// Copyright (C) 2001 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.
+
#ifndef _CPP_LIST
#include <bits/std_list.h>
#endif
diff --git a/libstdc++-v3/include/std/locale b/libstdc++-v3/include/std/locale
index 5452ae81040..56c416d8c5d 100644
--- a/libstdc++-v3/include/std/locale
+++ b/libstdc++-v3/include/std/locale
@@ -1,3 +1,32 @@
+// -*- C++ -*- std header.
+
+// Copyright (C) 2001 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.
+
#ifndef _CPP_LOCALE
#include <bits/std_locale.h>
#endif
diff --git a/libstdc++-v3/include/std/map b/libstdc++-v3/include/std/map
index 16d24f8ee61..06c638d5444 100644
--- a/libstdc++-v3/include/std/map
+++ b/libstdc++-v3/include/std/map
@@ -1,3 +1,32 @@
+// -*- C++ -*- std header.
+
+// Copyright (C) 2001 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.
+
#ifndef _CPP_MAP
#include <bits/std_map.h>
#endif
diff --git a/libstdc++-v3/include/std/memory b/libstdc++-v3/include/std/memory
index f905b4d1d51..ca98df6dadd 100644
--- a/libstdc++-v3/include/std/memory
+++ b/libstdc++-v3/include/std/memory
@@ -1,3 +1,32 @@
+// -*- C++ -*- std header.
+
+// Copyright (C) 2001 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.
+
#ifndef _CPP_MEMORY
#include <bits/std_memory.h>
#endif
diff --git a/libstdc++-v3/include/std/numeric b/libstdc++-v3/include/std/numeric
index b3817a838cb..32ba67d1a05 100644
--- a/libstdc++-v3/include/std/numeric
+++ b/libstdc++-v3/include/std/numeric
@@ -1,3 +1,32 @@
+// -*- C++ -*- std header.
+
+// Copyright (C) 2001 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.
+
#ifndef _CPP_NUMERIC
#include <bits/std_numeric.h>
#endif
diff --git a/libstdc++-v3/include/std/ostream b/libstdc++-v3/include/std/ostream
index beed8c58a3d..4564be746ab 100644
--- a/libstdc++-v3/include/std/ostream
+++ b/libstdc++-v3/include/std/ostream
@@ -1,3 +1,32 @@
+// -*- C++ -*- std header.
+
+// Copyright (C) 2001 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.
+
#ifndef _CPP_OSTREAM
#include <bits/std_ostream.h>
#endif
diff --git a/libstdc++-v3/include/std/queue b/libstdc++-v3/include/std/queue
index 278270cfdff..c4464bf9b8f 100644
--- a/libstdc++-v3/include/std/queue
+++ b/libstdc++-v3/include/std/queue
@@ -1,3 +1,32 @@
+// -*- C++ -*- std header.
+
+// Copyright (C) 2001 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.
+
#ifndef _CPP_QUEUE
#include <bits/std_queue.h>
#endif
diff --git a/libstdc++-v3/include/std/set b/libstdc++-v3/include/std/set
index 7aa6a388d41..62d67185339 100644
--- a/libstdc++-v3/include/std/set
+++ b/libstdc++-v3/include/std/set
@@ -1,3 +1,32 @@
+// -*- C++ -*- std header.
+
+// Copyright (C) 2001 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.
+
#ifndef _CPP_SET
#include <bits/std_set.h>
#endif
diff --git a/libstdc++-v3/include/std/sstream b/libstdc++-v3/include/std/sstream
index 92c57cb46bf..1a393ed67ee 100644
--- a/libstdc++-v3/include/std/sstream
+++ b/libstdc++-v3/include/std/sstream
@@ -1,3 +1,32 @@
+// -*- C++ -*- std header.
+
+// Copyright (C) 2001 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.
+
#ifndef _CPP_SSTREAM
#include <bits/std_sstream.h>
#endif
diff --git a/libstdc++-v3/include/std/stack b/libstdc++-v3/include/std/stack
index db3771e7adb..793a003237c 100644
--- a/libstdc++-v3/include/std/stack
+++ b/libstdc++-v3/include/std/stack
@@ -1,3 +1,32 @@
+// -*- C++ -*- std header.
+
+// Copyright (C) 2001 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.
+
#ifndef _CPP_STACK
#include <bits/std_stack.h>
#endif
diff --git a/libstdc++-v3/include/std/stdexcept b/libstdc++-v3/include/std/stdexcept
index da75270e682..d9e93f2ef9a 100644
--- a/libstdc++-v3/include/std/stdexcept
+++ b/libstdc++-v3/include/std/stdexcept
@@ -1,3 +1,32 @@
+// -*- C++ -*- std header.
+
+// Copyright (C) 2001 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.
+
#ifndef _CPP_STDEXCEPT
#include <bits/std_stdexcept.h>
#endif
diff --git a/libstdc++-v3/include/std/streambuf b/libstdc++-v3/include/std/streambuf
index 0a58fbdd8ff..ec6c7b57e18 100644
--- a/libstdc++-v3/include/std/streambuf
+++ b/libstdc++-v3/include/std/streambuf
@@ -1,3 +1,32 @@
+// -*- C++ -*- std header.
+
+// Copyright (C) 2001 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.
+
#ifndef _CPP_STREAMBUF
#include <bits/std_streambuf.h>
#endif
diff --git a/libstdc++-v3/include/std/string b/libstdc++-v3/include/std/string
index 8e3cd42715e..a766cddc81e 100644
--- a/libstdc++-v3/include/std/string
+++ b/libstdc++-v3/include/std/string
@@ -1,3 +1,32 @@
+// -*- C++ -*- std header.
+
+// Copyright (C) 2001 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.
+
#ifndef _CPP_STRING
#include <bits/std_string.h>
#endif
diff --git a/libstdc++-v3/include/std/utility b/libstdc++-v3/include/std/utility
index 924a85398cb..787e7997340 100644
--- a/libstdc++-v3/include/std/utility
+++ b/libstdc++-v3/include/std/utility
@@ -1,3 +1,32 @@
+// -*- C++ -*- std header.
+
+// Copyright (C) 2001 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.
+
#ifndef _CPP_UTILITY
#include <bits/std_utility.h>
#endif
diff --git a/libstdc++-v3/include/std/valarray b/libstdc++-v3/include/std/valarray
index e98bbcef168..cb13d82f692 100644
--- a/libstdc++-v3/include/std/valarray
+++ b/libstdc++-v3/include/std/valarray
@@ -1,3 +1,32 @@
+// -*- C++ -*- std header.
+
+// Copyright (C) 2001 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.
+
#ifndef _CPP_VALARRAY
#include <bits/std_valarray.h>
#endif
diff --git a/libstdc++-v3/include/std/vector b/libstdc++-v3/include/std/vector
index c074b77a886..ce2f51e7b22 100644
--- a/libstdc++-v3/include/std/vector
+++ b/libstdc++-v3/include/std/vector
@@ -1,3 +1,32 @@
+// -*- C++ -*- std header.
+
+// Copyright (C) 2001 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.
+
#ifndef _CPP_VECTOR
#include <bits/std_vector.h>
#endif
diff --git a/libstdc++-v3/libio/ChangeLog b/libstdc++-v3/libio/ChangeLog
index 86c09034435..654618e77f2 100644
--- a/libstdc++-v3/libio/ChangeLog
+++ b/libstdc++-v3/libio/ChangeLog
@@ -1,3 +1,27 @@
+2002-02-20 Release Manager
+
+ * GCC 3.0.4 Released.
+
+2001-12-20 Release Manager
+
+ * GCC 3.0.3 Released.
+
+2001-10-23 Release Manager
+
+ * GCC 3.0.2 Released.
+
+2001-08-19 Release Manager
+
+ * GCC 3.0.1 Released.
+
+2001-08-19 Release Manager
+
+ * GCC 3.0.1 Released.
+
+20010617 Release Manager
+
+ * GCC 3.0 Released.
+
2001-02-03 Alexandre Oliva <aoliva@redhat.com>
Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
diff --git a/libstdc++-v3/libio/Makefile.am b/libstdc++-v3/libio/Makefile.am
index 3d81530a2ff..dbba6ff51d7 100644
--- a/libstdc++-v3/libio/Makefile.am
+++ b/libstdc++-v3/libio/Makefile.am
@@ -32,18 +32,13 @@ noinst_LTLIBRARIES =
endif
# Use common includes from acinclude.m4/GLIBCPP_EXPORT_INCLUDES
-GLIBCPP_INCLUDE_DIR = @GLIBCPP_INCLUDE_DIR@
-C_INCLUDE_DIR = @C_INCLUDE_DIR@
+GLIBCPP_INCLUDES = @GLIBCPP_INCLUDES@
TOPLEVEL_INCLUDES = @TOPLEVEL_INCLUDES@
-LIBMATH_INCLUDES = @LIBMATH_INCLUDES@
-LIBSUPCXX_INCLUDES = @LIBSUPCXX_INCLUDES@
LIBIO_INCLUDES = @LIBIO_INCLUDES@
-CSHADOW_INCLUDES = @CSHADOW_INCLUDES@
INCLUDES = \
-nostdinc++ \
- -I$(top_builddir)/include -I$(GLIBCPP_INCLUDE_DIR) \
- $(LIBIO_INCLUDES) $(TOPLEVEL_INCLUDES)
+ $(GLIBCPP_INCLUDES) $(LIBIO_INCLUDES) $(TOPLEVEL_INCLUDES)
libio_headers = \
libio.h libioP.h iolibio.h
diff --git a/libstdc++-v3/libio/Makefile.in b/libstdc++-v3/libio/Makefile.in
index cf94e053aea..0889fcd8e2b 100644
--- a/libstdc++-v3/libio/Makefile.in
+++ b/libstdc++-v3/libio/Makefile.in
@@ -1,6 +1,6 @@
-# Makefile.in generated automatically by automake 1.4 from Makefile.am
+# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am
-# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
+# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -65,24 +65,31 @@ target_alias = @target_alias@
target_triplet = @target@
AR = @AR@
AS = @AS@
+ATOMICITY_INC_SRCDIR = @ATOMICITY_INC_SRCDIR@
+BASIC_FILE_H = @BASIC_FILE_H@
CC = @CC@
+CCODECVT_C = @CCODECVT_C@
+CLOCALE_H = @CLOCALE_H@
CPP = @CPP@
CSHADOW_FLAGS = @CSHADOW_FLAGS@
-CSTD_INCLUDES = @CSTD_INCLUDES@
+CSTDIO_H = @CSTDIO_H@
CXX = @CXX@
CXXCPP = @CXXCPP@
-CXX_libstdcxx = @CXX_libstdcxx@
+C_INCLUDE_DIR = @C_INCLUDE_DIR@
DEBUG_FLAGS = @DEBUG_FLAGS@
DLLTOOL = @DLLTOOL@
EXEEXT = @EXEEXT@
EXTRA_CXX_FLAGS = @EXTRA_CXX_FLAGS@
GCJ = @GCJ@
GCJFLAGS = @GCJFLAGS@
-GLIBCPP_CFLAGS = @GLIBCPP_CFLAGS@
-GLIBCPP_CXXFLAGS = @GLIBCPP_CXXFLAGS@
+GLIBCPP_IS_CROSS_COMPILING = @GLIBCPP_IS_CROSS_COMPILING@
LIBMATHOBJS = @LIBMATHOBJS@
+LIBMATH_INCLUDES = @LIBMATH_INCLUDES@
LIBSTRINGOBJS = @LIBSTRINGOBJS@
+LIBSUPCXX_INCLUDES = @LIBSUPCXX_INCLUDES@
+LIBSUPCXX_PICFLAGS = @LIBSUPCXX_PICFLAGS@
LIBTOOL = @LIBTOOL@
+LIMITS_INC_SRCDIR = @LIMITS_INC_SRCDIR@
LN_S = @LN_S@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
@@ -90,6 +97,7 @@ OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OPTIMIZE_CXXFLAGS = @OPTIMIZE_CXXFLAGS@
OPT_LDFLAGS = @OPT_LDFLAGS@
+OS_INC_SRCDIR = @OS_INC_SRCDIR@
PACKAGE = @PACKAGE@
RANLIB = @RANLIB@
SECTION_FLAGS = @SECTION_FLAGS@
@@ -99,41 +107,46 @@ USE_COMPLEX_LONG_DOUBLE = @USE_COMPLEX_LONG_DOUBLE@
VERSION = @VERSION@
WARN_FLAGS = @WARN_FLAGS@
WERROR = @WERROR@
-WFMT_FLAGS = @WFMT_FLAGS@
enable_shared = @enable_shared@
enable_static = @enable_static@
+glibcpp_CXX = @glibcpp_CXX@
glibcpp_basedir = @glibcpp_basedir@
+glibcpp_builddir = @glibcpp_builddir@
+glibcpp_prefixdir = @glibcpp_prefixdir@
+glibcpp_srcdir = @glibcpp_srcdir@
+glibcpp_thread_h = @glibcpp_thread_h@
glibcpp_toolexecdir = @glibcpp_toolexecdir@
glibcpp_toolexeclibdir = @glibcpp_toolexeclibdir@
gxx_include_dir = @gxx_include_dir@
ifGNUmake = @ifGNUmake@
-libinst_wstring_la = @libinst_wstring_la@
libio_la = @libio_la@
toplevel_srcdir = @toplevel_srcdir@
AUTOMAKE_OPTIONS = 1.3 cygnus
mkinstalldirs = $(SHELL) $(toplevel_srcdir)/mkinstalldirs
-@GLIBCPP_BUILD_LIBIO_TRUE@noinst_LTLIBRARIES = libio.la
+@GLIBCPP_BUILD_LIBIO_TRUE@noinst_LTLIBRARIES = @GLIBCPP_BUILD_LIBIO_TRUE@libio.la
@GLIBCPP_BUILD_LIBIO_FALSE@noinst_LTLIBRARIES =
# Use common includes from acinclude.m4/GLIBCPP_EXPORT_INCLUDES
-GLIBCPP_INCLUDE_DIR = @GLIBCPP_INCLUDE_DIR@
-C_INCLUDE_DIR = @C_INCLUDE_DIR@
+GLIBCPP_INCLUDES = @GLIBCPP_INCLUDES@
TOPLEVEL_INCLUDES = @TOPLEVEL_INCLUDES@
-LIBMATH_INCLUDES = @LIBMATH_INCLUDES@
-LIBSUPCXX_INCLUDES = @LIBSUPCXX_INCLUDES@
LIBIO_INCLUDES = @LIBIO_INCLUDES@
-CSHADOW_INCLUDES = @CSHADOW_INCLUDES@
-INCLUDES = -nostdinc++ -I$(top_builddir)/include -I$(GLIBCPP_INCLUDE_DIR) $(LIBIO_INCLUDES) $(TOPLEVEL_INCLUDES)
+INCLUDES = \
+ -nostdinc++ \
+ $(GLIBCPP_INCLUDES) $(LIBIO_INCLUDES) $(TOPLEVEL_INCLUDES)
-libio_headers = libio.h libioP.h iolibio.h
+libio_headers = \
+ libio.h libioP.h iolibio.h
-@GLIBCPP_NEED_LIBIO_TRUE@LIBIO_SRCS = filedoalloc.c genops.c fileops.c stdfiles.c c_codecvt.c iofclose.c iofopen.c
+@GLIBCPP_NEED_LIBIO_TRUE@LIBIO_SRCS = @GLIBCPP_NEED_LIBIO_TRUE@\
+@GLIBCPP_NEED_LIBIO_TRUE@ filedoalloc.c genops.c fileops.c stdfiles.c c_codecvt.c \
+@GLIBCPP_NEED_LIBIO_TRUE@ iofclose.c iofopen.c
@GLIBCPP_NEED_LIBIO_FALSE@LIBIO_SRCS =
-@GLIBCPP_NEED_WLIBIO_TRUE@LIBIO_WSRCS = wfiledoalloc.c wfileops.c wgenops.c iofwide.c
+@GLIBCPP_NEED_WLIBIO_TRUE@LIBIO_WSRCS = @GLIBCPP_NEED_WLIBIO_TRUE@\
+@GLIBCPP_NEED_WLIBIO_TRUE@ wfiledoalloc.c wfileops.c wgenops.c iofwide.c
@GLIBCPP_NEED_WLIBIO_FALSE@LIBIO_WSRCS =
EXTRA_DIST = iostreamP.h
diff --git a/libstdc++-v3/libmath/Makefile.am b/libstdc++-v3/libmath/Makefile.am
index f8554b66abd..c0cea3ce35f 100644
--- a/libstdc++-v3/libmath/Makefile.am
+++ b/libstdc++-v3/libmath/Makefile.am
@@ -1,6 +1,6 @@
## Makefile for the math subdirectory of the GNU C++ Standard library.
##
-## Copyright (C) 1997, 1998, 1999, 2000 Cygnus Solutions
+## Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
##
## This file is part of the libstdc++ version 3 distribution.
## Process this file with automake to produce Makefile.in.
@@ -27,12 +27,9 @@ mkinstalldirs = $(SHELL) $(toplevel_srcdir)/mkinstalldirs
noinst_LTLIBRARIES = libmath.la
-EXTRA_LONG_DOUBLE_yes = \
- hypotl.c signbitl.c
+EXTRA_LONG_DOUBLE_yes = signbitl.c
-EXTRA_DIST = \
- hypot.c hypotf.c atan2f.c expf.c \
- $(EXTRA_LONG_DOUBLE_yes)
+EXTRA_DIST = $(EXTRA_LONG_DOUBLE_yes)
libmath_la_LIBADD = \
@LIBMATHOBJS@ \
@@ -40,21 +37,13 @@ libmath_la_LIBADD = \
libmath_la_DEPENDENCIES = $(libmath_la_LIBADD)
-libmath_la_SOURCES = \
- signbit.c signbitf.c
+libmath_la_SOURCES = signbit.c signbitf.c stubs.c
LINK = $(LIBTOOL) --mode=link "$(CCLD)" $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
# Use common includes from acinclude.m4/GLIBCPP_EXPORT_INCLUDES
-GLIBCPP_INCLUDE_DIR = @GLIBCPP_INCLUDE_DIR@
-C_INCLUDE_DIR = @C_INCLUDE_DIR@
TOPLEVEL_INCLUDES = @TOPLEVEL_INCLUDES@
-LIBMATH_INCLUDES = @LIBMATH_INCLUDES@
-LIBSUPCXX_INCLUDES = @LIBSUPCXX_INCLUDES@
-LIBIO_INCLUDES = @LIBIO_INCLUDES@
-CSHADOW_INCLUDES = @CSHADOW_INCLUDES@
INCLUDES = \
- -I$(GLIBCPP_INCLUDE_DIR) -I$(top_builddir)/include \
$(TOPLEVEL_INCLUDES)
diff --git a/libstdc++-v3/libmath/Makefile.in b/libstdc++-v3/libmath/Makefile.in
index d6c8cd85b38..a2848541684 100644
--- a/libstdc++-v3/libmath/Makefile.in
+++ b/libstdc++-v3/libmath/Makefile.in
@@ -1,6 +1,6 @@
-# Makefile.in generated automatically by automake 1.4 from Makefile.am
+# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am
-# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
+# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -65,24 +65,33 @@ target_alias = @target_alias@
target_triplet = @target@
AR = @AR@
AS = @AS@
+ATOMICITY_INC_SRCDIR = @ATOMICITY_INC_SRCDIR@
+BASIC_FILE_H = @BASIC_FILE_H@
CC = @CC@
+CCODECVT_C = @CCODECVT_C@
+CLOCALE_H = @CLOCALE_H@
CPP = @CPP@
CSHADOW_FLAGS = @CSHADOW_FLAGS@
-CSTD_INCLUDES = @CSTD_INCLUDES@
+CSTDIO_H = @CSTDIO_H@
CXX = @CXX@
CXXCPP = @CXXCPP@
-CXX_libstdcxx = @CXX_libstdcxx@
+C_INCLUDE_DIR = @C_INCLUDE_DIR@
DEBUG_FLAGS = @DEBUG_FLAGS@
DLLTOOL = @DLLTOOL@
EXEEXT = @EXEEXT@
EXTRA_CXX_FLAGS = @EXTRA_CXX_FLAGS@
GCJ = @GCJ@
GCJFLAGS = @GCJFLAGS@
-GLIBCPP_CFLAGS = @GLIBCPP_CFLAGS@
-GLIBCPP_CXXFLAGS = @GLIBCPP_CXXFLAGS@
+GLIBCPP_INCLUDES = @GLIBCPP_INCLUDES@
+GLIBCPP_IS_CROSS_COMPILING = @GLIBCPP_IS_CROSS_COMPILING@
+LIBIO_INCLUDES = @LIBIO_INCLUDES@
LIBMATHOBJS = @LIBMATHOBJS@
+LIBMATH_INCLUDES = @LIBMATH_INCLUDES@
LIBSTRINGOBJS = @LIBSTRINGOBJS@
+LIBSUPCXX_INCLUDES = @LIBSUPCXX_INCLUDES@
+LIBSUPCXX_PICFLAGS = @LIBSUPCXX_PICFLAGS@
LIBTOOL = @LIBTOOL@
+LIMITS_INC_SRCDIR = @LIMITS_INC_SRCDIR@
LN_S = @LN_S@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
@@ -90,6 +99,7 @@ OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OPTIMIZE_CXXFLAGS = @OPTIMIZE_CXXFLAGS@
OPT_LDFLAGS = @OPT_LDFLAGS@
+OS_INC_SRCDIR = @OS_INC_SRCDIR@
PACKAGE = @PACKAGE@
RANLIB = @RANLIB@
SECTION_FLAGS = @SECTION_FLAGS@
@@ -99,15 +109,18 @@ USE_COMPLEX_LONG_DOUBLE = @USE_COMPLEX_LONG_DOUBLE@
VERSION = @VERSION@
WARN_FLAGS = @WARN_FLAGS@
WERROR = @WERROR@
-WFMT_FLAGS = @WFMT_FLAGS@
enable_shared = @enable_shared@
enable_static = @enable_static@
+glibcpp_CXX = @glibcpp_CXX@
glibcpp_basedir = @glibcpp_basedir@
+glibcpp_builddir = @glibcpp_builddir@
+glibcpp_prefixdir = @glibcpp_prefixdir@
+glibcpp_srcdir = @glibcpp_srcdir@
+glibcpp_thread_h = @glibcpp_thread_h@
glibcpp_toolexecdir = @glibcpp_toolexecdir@
glibcpp_toolexeclibdir = @glibcpp_toolexeclibdir@
gxx_include_dir = @gxx_include_dir@
ifGNUmake = @ifGNUmake@
-libinst_wstring_la = @libinst_wstring_la@
libio_la = @libio_la@
toplevel_srcdir = @toplevel_srcdir@
@@ -117,32 +130,26 @@ mkinstalldirs = $(SHELL) $(toplevel_srcdir)/mkinstalldirs
noinst_LTLIBRARIES = libmath.la
-EXTRA_LONG_DOUBLE_yes = hypotl.c signbitl.c
-
-
-EXTRA_DIST = hypot.c hypotf.c atan2f.c expf.c $(EXTRA_LONG_DOUBLE_yes)
+EXTRA_LONG_DOUBLE_yes = signbitl.c
+EXTRA_DIST = $(EXTRA_LONG_DOUBLE_yes)
-libmath_la_LIBADD = @LIBMATHOBJS@ $(EXTRA_LONG_DOUBLE_$(USE_COMPLEX_LONG_DOUBLE))
+libmath_la_LIBADD = \
+ @LIBMATHOBJS@ \
+ $(EXTRA_LONG_DOUBLE_$(USE_COMPLEX_LONG_DOUBLE))
libmath_la_DEPENDENCIES = $(libmath_la_LIBADD)
-libmath_la_SOURCES = signbit.c signbitf.c
-
+libmath_la_SOURCES = signbit.c signbitf.c stubs.c
LINK = $(LIBTOOL) --mode=link "$(CCLD)" $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
# Use common includes from acinclude.m4/GLIBCPP_EXPORT_INCLUDES
-GLIBCPP_INCLUDE_DIR = @GLIBCPP_INCLUDE_DIR@
-C_INCLUDE_DIR = @C_INCLUDE_DIR@
TOPLEVEL_INCLUDES = @TOPLEVEL_INCLUDES@
-LIBMATH_INCLUDES = @LIBMATH_INCLUDES@
-LIBSUPCXX_INCLUDES = @LIBSUPCXX_INCLUDES@
-LIBIO_INCLUDES = @LIBIO_INCLUDES@
-CSHADOW_INCLUDES = @CSHADOW_INCLUDES@
-INCLUDES = -I$(GLIBCPP_INCLUDE_DIR) -I$(top_builddir)/include $(TOPLEVEL_INCLUDES)
+INCLUDES = \
+ $(TOPLEVEL_INCLUDES)
CONFIG_HEADER = ../config.h
CONFIG_CLEAN_FILES =
@@ -154,7 +161,7 @@ CPPFLAGS = @CPPFLAGS@
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
libmath_la_LDFLAGS =
-libmath_la_OBJECTS = signbit.lo signbitf.lo
+libmath_la_OBJECTS = signbit.lo signbitf.lo stubs.lo
CFLAGS = @CFLAGS@
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
diff --git a/libstdc++-v3/libmath/atan2f.c b/libstdc++-v3/libmath/atan2f.c
deleted file mode 100644
index 1c59dae7a9a..00000000000
--- a/libstdc++-v3/libmath/atan2f.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/* Compute arc tangent. */
-
-/* Copyright (C) 1997-1999 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. */
-
-
-#include <math.h>
-#include "mathconf.h"
-
-float
-atan2f (float x, float y)
-{
- /* We use the double version. */
- return atan2 (x, y);
-}
diff --git a/libstdc++-v3/libmath/expf.c b/libstdc++-v3/libmath/expf.c
deleted file mode 100644
index a597502f8a0..00000000000
--- a/libstdc++-v3/libmath/expf.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/* Compute exponential function. */
-
-/* Copyright (C) 1997-1999 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. */
-
-
-#include <math.h>
-#include "mathconf.h"
-
-float
-expf (float x)
-{
- /* We use the double version. */
- return exp (x);
-}
diff --git a/libstdc++-v3/libmath/hypot.c b/libstdc++-v3/libmath/hypot.c
deleted file mode 100644
index 9e3c07b0222..00000000000
--- a/libstdc++-v3/libmath/hypot.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/* Compute hypothenuse. */
-
-/* Copyright (C) 1997-1999 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 the platform is so pathetic that is has no hypot function it does
- not deserve it better than getting this version. */
-extern double sqrt (double);
-
-double
-hypot (double x, double y)
-{
- return sqrt (x * x + y * y);
-}
diff --git a/libstdc++-v3/libmath/hypotf.c b/libstdc++-v3/libmath/hypotf.c
deleted file mode 100644
index 29d1681f5cc..00000000000
--- a/libstdc++-v3/libmath/hypotf.c
+++ /dev/null
@@ -1,48 +0,0 @@
-/* Compute hypothenuse. */
-
-/* Copyright (C) 1997-1999 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. */
-
-#include <config.h>
-
-/* If there is a `double' version use it. Otherwise make it simply and
- stupid. */
-extern double hypot (double, double);
-extern double sqrt (double);
-extern float sqrtf (float);
-
-float
-hypotf (float x, float y)
-{
-#ifdef HAVE_HYPOT
- return hypot (x, y);
-#elif HAVE_SQRTF
- return sqrtf (x * x + y * y);
-#else
- return sqrt (x * x + y * y);
-#endif
-}
diff --git a/libstdc++-v3/libmath/hypotl.c b/libstdc++-v3/libmath/hypotl.c
deleted file mode 100644
index 1ec8a9ce7ee..00000000000
--- a/libstdc++-v3/libmath/hypotl.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/* Compute hypothenuse. */
-
-/* Copyright (C) 1997-1999 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. */
-
-/* The platform supports some long double functions but not hypotl. Blarg. */
-extern long double sqrtl (long double);
-
-long double
-hypotl (long double x, long double y)
-{
- return sqrtl (x * x + y * y);
-}
diff --git a/libstdc++-v3/libmath/mathconf.h b/libstdc++-v3/libmath/mathconf.h
index c66fca7e0bf..382fca4a91e 100644
--- a/libstdc++-v3/libmath/mathconf.h
+++ b/libstdc++-v3/libmath/mathconf.h
@@ -1,6 +1,6 @@
/* Configuration data for libmath subpart of libstdc++. */
-/* Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1997-1999, 2000, 2001 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
@@ -28,23 +28,26 @@
the GNU General Public License. */
-#include <bits/c++config.h>
+#include <config.h>
-#ifdef _GLIBCPP_HAVE_ENDIAN_H
+#ifdef HAVE_ENDIAN_H
# include <endian.h>
#else
-# ifdef _GLIBCPP_HAVE_MACHINE_ENDIAN_H
+# ifdef HAVE_MACHINE_ENDIAN_H
+# ifdef __OpenBSD__
+# include <sys/types.h>
+# endif
# include <machine/endian.h>
# else
-# ifdef _GLIBCPP_HAVE_SYS_MACHINE_H
+# ifdef HAVE_SYS_MACHINE_H
# include <sys/machine.h>
# else
-# if defined _GLIBCPP_HAVE_SYS_ISA_DEFS_H || defined _GLIBCPP_HAVE_MACHINE_PARAM_H
+# if defined HAVE_SYS_ISA_DEFS_H || defined HAVE_MACHINE_PARAM_H
/* This is on Solaris. */
-# ifdef _GLIBCPP_HAVE_SYS_ISA_DEFS_H
+# ifdef HAVE_SYS_ISA_DEFS_H
# include <sys/isa_defs.h>
# endif
-# ifdef _GLIBCPP_HAVE_MACHINE_PARAM_H
+# ifdef HAVE_MACHINE_PARAM_H
# include <machine/param.h>
# endif
# ifdef _LITTLE_ENDIAN
@@ -70,9 +73,9 @@
typedef unsigned int U_int32_t __attribute ((mode (SI)));
typedef int Int32_t __attribute ((mode (SI)));
typedef unsigned int U_int64_t __attribute ((mode (DI)));
-typedef int Uint64_t __attribute ((mode (DI)));
+typedef int Int64_t __attribute ((mode (DI)));
-#ifdef _GLIBCPP_HAVE_NAN_H
+#ifdef HAVE_NAN_H
# include <nan.h>
#endif
@@ -81,15 +84,15 @@ typedef int Uint64_t __attribute ((mode (DI)));
double nan (void);
#endif
-#ifdef _GLIBCPP_HAVE_IEEEFP_H
+#ifdef HAVE_IEEEFP_H
# include <ieeefp.h>
#endif
-#ifdef _GLIBCPP_HAVE_FP_H
+#ifdef HAVE_FP_H
# include <fp.h>
#endif
-#ifdef _GLIBCPP_HAVE_FLOAT_H
+#ifdef HAVE_FLOAT_H
# include <float.h>
#endif
@@ -128,100 +131,6 @@ double nan (void);
# define M_PI 3.14159265358979323846
#endif
-/* Test whether number is finite. */
-#ifdef isfinite
-/* This is an ISO C99 function. */
-# define FINITE_P(X) isfinite (X)
-# define FINITEF_P(X) isfinite (X)
-# define FINITEL_P(X) isfinite (X)
-#else
-# ifdef IsNANorINF
-/* This is for Solaris, which does not have special macros for other
- types. */
-# define FINITE_P(X) (!IsNANorINF (X))
-# define FINITEF_P(X) (!IsNANorINF (X))
-# define FINITEL_P(X) (!IsNANorINF (X))
-# else
-# if defined _GLIBCPP_HAVE_ISINF && defined _GLIBCPP_HAVE_ISNAN
-# define FINITE_P(X) ({ double __x = (X); !isinf (__x) && !isnan (__x); })
-# else
-# ifdef _GLIBCPP_HAVE_FINITE
-# define FINITE_P(X) finite (X)
-# else
-# error "We need FINITE_P"
-# endif
-# endif
-# if defined _GLIBCPP_HAVE_ISINFF && defined _GLIBCPP_HAVE_ISNANF
-# define FINITEF_P(X) ({ float __x = (X); !isinff (__x) && !isnanf (__x); })
-# else
-# ifdef _GLIBCPP_HAVE_FINITE
-# define FINITEF_P(X) finite (X)
-# else
-# define FINITEF_P(X) FINITE_P (X)
-# endif
-# endif
-# if defined _GLIBCPP_HAVE_ISINFL && defined _GLIBCPP_HAVE_ISNANL
-# define FINITEL_P(X) ({ long double __x = (X); \
- !isinfl (__x) && !isnanl (__x); })
-# else
-# ifdef _GLIBCPP_HAVE_QFINITE
-# define FINITEL_P(X) qfinite (X)
-# else
-# define FINITEL_P(X) FINITE_P (X)
-# endif
-# endif
-# endif
-#endif
-
-/* Test whether number is infinite. */
-#ifdef isinf
-/* This is an ISO C99 macro. */
-# define INFINITE_P(X) isinf (X)
-# define INFINITEF_P(X) isinf (X)
-# define INFINITEL_P(X) isinf (X)
-#else
-# ifdef IsINF
-/* This is for Solaris, which does not have special macros for other
- types. */
-# define INFINITE_P(X) IsINF (X)
-# define INFINITEF_P(X) IsINF (X)
-# define INFINITEL_P(X) IsINF (X)
-# else
-# if defined _GLIBCPP_HAVE_ISINF
-# define INFINITE_P(X) isinf (X)
-# else
-# ifdef _GLIBCPP_HAVE_FPCLASS
-# ifdef _FPCLASS_PINF
-/* Mingw defines _FPCLASS_PINF. */
-# define FP_PINF _FPCLASS_PINF
-# endif
-/* This is for Irix and Mingw. */
-# define INFINITE_P(X) (fpclass (fabs (X)) == FP_PINF)
-# else
-# ifdef IS_INF
-/* This is for AIX. */
-# define INFINITE_P(X) ({ double __d = (X); IS_INF (__d); })
-# else
-# error "We need INFINITE_P"
-# endif
-# endif
-# endif
-# if defined _GLIBCPP_HAVE_ISINFF
-# define INFINITEF_P(X) isinff (X)
-# else
-# define INFINITEF_P(X) INFINITE_P (X)
-# endif
-# if defined _GLIBCPP_HAVE_ISINFL
-# define INFINITEL_P(X) isinfl (X)
-# else
-# ifdef _GLIBCPP_HAVE_QFPCLASS
-# define INFINITEL_P(X) (qfpclass (fabsl (X)) == FP_PINF)
-# else
-# define INFINITEL_P(X) INFINITE_P (X)
-# endif
-# endif
-# endif
-#endif
#ifdef __cplusplus
extern "C" {
@@ -354,51 +263,52 @@ typedef union
do { \
ieee_quad_double_shape_type qw_u; \
qw_u.value = (d); \
- (ix0) = qw_u.parts64.msw; \
+ (msw) = qw_u.parts64.msw; \
} while (0)
-
+
/* Replacement for non-existing float functions. */
-#if !defined(_GLIBCPP_HAVE_FABSF) && !defined(_GLIBCPP_HAVE___BUILTIN_FABSF)
+#if !defined(HAVE_FABSF) && !defined(HAVE___BUILTIN_FABSF)
# define fabsf(x) fabs (x)
#endif
-#if !defined(_GLIBCPP_HAVE_COSF) && !defined(_GLIBCPP_HAVE___BUILTIN_COSF)
+#if !defined(HAVE_COSF) && !defined(HAVE___BUILTIN_COSF)
# define cosf(x) cos (x)
#endif
-#ifndef _GLIBCPP_HAVE_COSHF
+#ifndef HAVE_COSHF
# define coshf(x) cosh (x)
#endif
-#ifndef _GLIBCPP_HAVE_EXPF
+#ifndef HAVE_EXPF
# define expf(x) expf (x)
#endif
-#ifndef _GLIBCPP_HAVE_LOGF
+#ifndef HAVE_LOGF
# define logf(x) log(x)
#endif
-#ifndef _GLIBCPP_HAVE_LOG10F
+#ifndef HAVE_LOG10F
# define log10f(x) log10 (x)
#endif
-#ifndef _GLIBCPP_HAVE_POWF
+#ifndef HAVE_POWF
# define powf(x, y) pow (x, y)
#endif
-#if !defined(_GLIBCPP_HAVE_SINF) && !defined(_GLIBCPP_HAVE___BUILTIN_SINF)
+#if !defined(HAVE_SINF) && !defined(HAVE___BUILTIN_SINF)
# define sinf(x) sin (x)
#endif
-#ifndef _GLIBCPP_HAVE_SINHF
+#ifndef HAVE_SINHF
# define sinhf(x) sinh (x)
#endif
-#if !defined(_GLIBCPP_HAVE_SQRTF) && !defined(_GLIBCPP_HAVE___BUILTIN_SQRTF)
+#if !defined(HAVE_SQRTF) && !defined(HAVE___BUILTIN_SQRTF)
# define sqrtf(x) sqrt (x)
#endif
-#ifndef _GLIBCPP_HAVE_TANF
+#ifndef HAVE_TANF
# define tanf(x) tan (x)
#endif
-#ifndef _GLIBCPP_HAVE_TANHF
+#ifndef HAVE_TANHF
# define tanhf(x) tanh (x)
#endif
-#ifndef _GLIBCPP_HAVE_STRTOF
+#ifndef HAVE_STRTOF
# define strtof(s, e) strtod (s, e)
#endif
#ifdef __cplusplus
}
#endif
+
diff --git a/libstdc++-v3/libmath/stubs.c b/libstdc++-v3/libmath/stubs.c
new file mode 100644
index 00000000000..203feeed82c
--- /dev/null
+++ b/libstdc++-v3/libmath/stubs.c
@@ -0,0 +1,271 @@
+/* Stub definitions for libmath subpart of libstdc++. */
+
+/* Copyright (C) 2001 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. */
+
+#include <math.h>
+#include "config.h"
+
+/* For targets which do not have support for long double versions,
+ we use the crude approximation. We'll do better later. */
+
+
+#ifndef HAVE_ATAN2F
+float
+atan2f(float x, float y)
+{
+ return (float) atan2(x, y);
+}
+#endif
+
+#ifndef HAVE_ATAN2L
+long double
+atan2l(long double x, long double y)
+{
+ return atan2((double) x, (double) y);
+}
+#endif
+
+
+#if !defined(HAVE_COSF) && !defined(HAVE___BUILTIN_COSF)
+float
+cosf(float x)
+{
+ return (float) cos(x);
+}
+#endif
+
+#ifndef HAVE_COSL
+long double
+cosl(long double x)
+{
+ return cos((double) x);
+}
+#endif
+
+
+#ifndef HAVE_COSHF
+float
+coshf(float x)
+{
+ return (float) cosh(x);
+}
+#endif
+
+#ifndef HAVE_COSHL
+long double
+coshl(long double x)
+{
+ return cosh((double) x);
+}
+#endif
+
+
+#ifndef HAVE_EXPF
+float
+expf(float x)
+{
+ return (float) exp(x);
+}
+#endif
+
+#ifndef HAVE_EXPL
+long double
+expl(long double x)
+{
+ return exp((double) x);
+}
+#endif
+
+
+/* Compute the hypothenuse of a right triangle with side x and y. */
+#ifndef HAVE_HYPOTF
+float
+hypotf(float x, float y)
+{
+ float s = fabsf(x) + fabsf(y);
+ x /= s; y /= s;
+ return s * sqrtf(x * x + y * y);
+}
+#endif
+
+#ifndef HAVE_HYPOT
+double
+hypot(double x, double y)
+{
+ double s = fabs(x) + fabs(y);
+ x /= s; y /= s;
+ return s * sqrt(x * x + y * y);
+}
+#endif
+
+#ifndef HAVE_HYPOTL
+long double
+hypotl(long double x, long double y)
+{
+ long double s = fabsl(x) + fabsl(y);
+ x /= s; y /= s;
+ return s * sqrtl(x * x + y * y);
+}
+#endif
+
+
+
+#ifndef HAVE_LOGF
+float
+logf(float x)
+{
+ return (float) log(x);
+}
+#endif
+
+#ifndef HAVE_LOGL
+long double
+logl(long double x)
+{
+ return log((double) x);
+}
+#endif
+
+
+#ifndef HAVE_LOG10F
+float
+log10f(float x)
+{
+ return (float) log10(x);
+}
+#endif
+
+#ifndef HAVE_LOG10L
+long double
+log10l(long double x)
+{
+ return log10((double) x);
+}
+#endif
+
+
+#ifndef HAVE_POWF
+float
+powf(float x, float y)
+{
+ return (float) pow(x, y);
+}
+#endif
+
+#ifndef HAVE_POWL
+long double
+powl(long double x, long double y)
+{
+ return pow((double) x, (double) y);
+}
+#endif
+
+
+#if !defined(HAVE_SINF) && !defined(HAVE___BUILTIN_SINF)
+float
+sinf(float x)
+{
+ return (float) sin(x);
+}
+#endif
+
+#ifndef HAVE_SINL
+long double
+sinl(long double x)
+{
+ return sin((double) x);
+}
+#endif
+
+
+#ifndef HAVE_SINHF
+float
+sinhf(float x)
+{
+ return (float) sinh(x);
+}
+#endif
+
+#ifndef HAVE_SINHL
+long double
+sinhl(long double x)
+{
+ return sinh((double) x);
+}
+#endif
+
+
+#ifndef HAVE_SQRTF
+float
+sqrtf(float x)
+{
+ return (float) sqrt(x);
+}
+#endif
+
+#ifndef HAVE_SQRTL
+long double
+sqrtl(long double x)
+{
+ return sqrt((double) x);
+}
+#endif
+
+
+#ifndef HAVE_TANF
+float
+tanf(float x)
+{
+ return (float) tan(x);
+}
+#endif
+
+#ifndef HAVE_TANL
+long double
+tanl(long double x)
+{
+ return tan((double) x);
+}
+#endif
+
+
+#ifndef HAVE_TANHF
+float
+tanhf(float x)
+{
+ return (float) tanh(x);
+}
+#endif
+
+#ifndef HAVE_TANHL
+long double
+tanhl(long double x)
+{
+ return tanh((double) x);
+}
+#endif
diff --git a/libstdc++-v3/libsupc++/Makefile.am b/libstdc++-v3/libsupc++/Makefile.am
index d80defd1674..c6981a05b29 100644
--- a/libstdc++-v3/libsupc++/Makefile.am
+++ b/libstdc++-v3/libsupc++/Makefile.am
@@ -27,6 +27,7 @@ MAINT_CHARSET = latin1
mkinstalldirs = $(SHELL) $(toplevel_srcdir)/mkinstalldirs
# Cross compiler and multilib support.
+CXX = @glibcpp_CXX@
toolexecdir = @glibcpp_toolexecdir@
toolexeclibdir = @glibcpp_toolexeclibdir@
@@ -51,31 +52,32 @@ CONFIG_CXXFLAGS = \
# Warning flags to use.
WARN_CXXFLAGS = \
- @WARN_FLAGS@ $(WERROR) @WFMT_FLAGS@
+ @WARN_FLAGS@ $(WERROR) -fdiagnostics-show-location=once
# Use common includes from acinclude.m4/GLIBCPP_EXPORT_INCLUDES
-GLIBCPP_INCLUDE_DIR = @GLIBCPP_INCLUDE_DIR@
-C_INCLUDE_DIR = @C_INCLUDE_DIR@
-CSTD_INCLUDES = @CSTD_INCLUDES@
-LIBMATH_INCLUDES = @LIBMATH_INCLUDES@
+GLIBCPP_INCLUDES = @GLIBCPP_INCLUDES@
LIBSUPCXX_INCLUDES = @LIBSUPCXX_INCLUDES@
-LIBIO_INCLUDES = @LIBIO_INCLUDES@
-TOPLEVEL_INCLUDES = @TOPLEVEL_INCLUDES@
INCLUDES = \
-I$(toplevel_srcdir)/gcc -I$(toplevel_srcdir)/include \
- -I$(GLIBCPP_INCLUDE_DIR) $(CSTD_INCLUDES) -I$(top_builddir)/include \
- $(LIBSUPCXX_INCLUDES)
+ $(GLIBCPP_INCLUDES) $(LIBSUPCXX_INCLUDES)
headers = \
- cxxabi.h exception new typeinfo
+ exception new typeinfo cxxabi.h exception_defines.h
sources = \
del_op.cc \
del_opnt.cc \
del_opv.cc \
del_opvnt.cc \
- exception_support.cc \
+ eh_alloc.cc \
+ eh_aux_runtime.cc \
+ eh_catch.cc \
+ eh_exception.cc \
+ eh_globals.cc \
+ eh_personality.cc \
+ eh_terminate.cc \
+ eh_throw.cc \
new_handler.cc \
new_op.cc \
new_opnt.cc \
@@ -92,9 +94,7 @@ libsupc__convenience_la_SOURCES = $(sources)
glibcppinstalldir = @gxx_include_dir@
glibcppinstall_HEADERS = $(headers)
-# Flags to force separate libtool library to be static only.
-LIBTOOL = @LIBTOOL@ --tag disable-shared
-LIBSUPCXX_CXXFLAGS = -prefer-pic
+LIBSUPCXX_CXXFLAGS = $(LIBSUPCXX_PICFLAGS)
# AM_CXXFLAGS needs to be in each subdirectory so that it can be
# modified in a per-library or per-sub-library way. Need to manually
@@ -133,15 +133,31 @@ LTCXXCOMPILE = $(LIBTOOL) --tag CXX --tag disable-shared \
--mode=compile $(CXX) $(INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(AM_CXXFLAGS)
-# 3) We have a problem when building the shared libstdc++ object if
-# the rules automake generates would be used. We cannot allow CXX to
-# be used in libtool since this would add -lstdc++ to the link line
-# which of course is problematic at this point.
-CXXLINK = $(LIBTOOL) --mode=link "$(CC)" \
- @OPT_LDFLAGS@ @SECTION_LDFLAGS@ $(AM_CXXFLAGS) $(LDFLAGS) -o $@
-
-
-
-
-
-
+# 3) We'd have a problem when building the shared libstdc++ object if
+# the rules automake generates would be used. We cannot allow g++ to
+# be used since this would add -lstdc++ to the link line which of
+# course is problematic at this point. So, we get the top-level
+# directory to configure libstdc++-v3 to use gcc as the C++
+# compilation driver.
+CXXLINK = $(LIBTOOL) --tag CXX --tag disable-shared \
+ --mode=link $(CXX) \
+ @OPT_LDFLAGS@ @SECTION_LDFLAGS@ $(AM_CXXFLAGS) $(LDFLAGS) -o $@
+
+# We have to have rules modified from the default to counteract SUN make
+# prepending each of $(glibcppinstall_HEADERS) with VPATH below.
+install-glibcppinstallHEADERS: $(glibcppinstall_HEADERS)
+ @$(NORMAL_INSTALL)
+ $(mkinstalldirs) $(DESTDIR)$(glibcppinstalldir)
+ @list='$(glibcppinstall_HEADERS)'; for p in $$list; do \
+ q=`echo $$p | sed -e 's,.*/,,'`; \
+ if test -f "$$p"; then d= ; else d="$(srcdir)/"; fi; \
+ echo " $(INSTALL_DATA) $$d$$p $(DESTDIR)$(glibcppinstalldir)/$$q"; \
+ $(INSTALL_DATA) $$d$$p $(DESTDIR)$(glibcppinstalldir)/$$q; \
+ done
+
+uninstall-glibcppinstallHEADERS:
+ @$(NORMAL_UNINSTALL)
+ list='$(glibcppinstall_HEADERS)'; for p in $$list; do \
+ q=`echo $$p | sed -e 's,.*/,,'`; \
+ rm -f $(DESTDIR)$(glibcppinstalldir)/$$q; \
+ done
diff --git a/libstdc++-v3/libsupc++/Makefile.in b/libstdc++-v3/libsupc++/Makefile.in
index 5b8d2f28c9e..6eef07899c0 100644
--- a/libstdc++-v3/libsupc++/Makefile.in
+++ b/libstdc++-v3/libsupc++/Makefile.in
@@ -1,6 +1,6 @@
-# Makefile.in generated automatically by automake 1.4 from Makefile.am
+# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am
-# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
+# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -65,46 +65,59 @@ target_alias = @target_alias@
target_triplet = @target@
AR = @AR@
AS = @AS@
+ATOMICITY_INC_SRCDIR = @ATOMICITY_INC_SRCDIR@
+BASIC_FILE_H = @BASIC_FILE_H@
CC = @CC@
+CCODECVT_C = @CCODECVT_C@
+CLOCALE_H = @CLOCALE_H@
CPP = @CPP@
CSHADOW_FLAGS = @CSHADOW_FLAGS@
-CXX = @CXX@
+CSTDIO_H = @CSTDIO_H@
CXXCPP = @CXXCPP@
-CXX_libstdcxx = @CXX_libstdcxx@
+C_INCLUDE_DIR = @C_INCLUDE_DIR@
DEBUG_FLAGS = @DEBUG_FLAGS@
DLLTOOL = @DLLTOOL@
EXEEXT = @EXEEXT@
EXTRA_CXX_FLAGS = @EXTRA_CXX_FLAGS@
GCJ = @GCJ@
GCJFLAGS = @GCJFLAGS@
-GLIBCPP_CFLAGS = @GLIBCPP_CFLAGS@
-GLIBCPP_CXXFLAGS = @GLIBCPP_CXXFLAGS@
+GLIBCPP_IS_CROSS_COMPILING = @GLIBCPP_IS_CROSS_COMPILING@
+LIBIO_INCLUDES = @LIBIO_INCLUDES@
LIBMATHOBJS = @LIBMATHOBJS@
+LIBMATH_INCLUDES = @LIBMATH_INCLUDES@
LIBSTRINGOBJS = @LIBSTRINGOBJS@
+LIBSUPCXX_PICFLAGS = @LIBSUPCXX_PICFLAGS@
+LIBTOOL = @LIBTOOL@
+LIMITS_INC_SRCDIR = @LIMITS_INC_SRCDIR@
LN_S = @LN_S@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OPT_LDFLAGS = @OPT_LDFLAGS@
+OS_INC_SRCDIR = @OS_INC_SRCDIR@
PACKAGE = @PACKAGE@
RANLIB = @RANLIB@
SECTION_FLAGS = @SECTION_FLAGS@
SECTION_LDFLAGS = @SECTION_LDFLAGS@
STRIP = @STRIP@
+TOPLEVEL_INCLUDES = @TOPLEVEL_INCLUDES@
USE_COMPLEX_LONG_DOUBLE = @USE_COMPLEX_LONG_DOUBLE@
VERSION = @VERSION@
WARN_FLAGS = @WARN_FLAGS@
WERROR = @WERROR@
-WFMT_FLAGS = @WFMT_FLAGS@
enable_shared = @enable_shared@
enable_static = @enable_static@
+glibcpp_CXX = @glibcpp_CXX@
glibcpp_basedir = @glibcpp_basedir@
+glibcpp_builddir = @glibcpp_builddir@
+glibcpp_prefixdir = @glibcpp_prefixdir@
+glibcpp_srcdir = @glibcpp_srcdir@
+glibcpp_thread_h = @glibcpp_thread_h@
glibcpp_toolexecdir = @glibcpp_toolexecdir@
glibcpp_toolexeclibdir = @glibcpp_toolexeclibdir@
gxx_include_dir = @gxx_include_dir@
ifGNUmake = @ifGNUmake@
-libinst_wstring_la = @libinst_wstring_la@
libio_la = @libio_la@
toplevel_srcdir = @toplevel_srcdir@
@@ -114,6 +127,7 @@ MAINT_CHARSET = latin1
mkinstalldirs = $(SHELL) $(toplevel_srcdir)/mkinstalldirs
# Cross compiler and multilib support.
+CXX = @glibcpp_CXX@
toolexecdir = @glibcpp_toolexecdir@
toolexeclibdir = @glibcpp_toolexeclibdir@
@@ -131,29 +145,50 @@ OPTIMIZE_CXXFLAGS = @OPTIMIZE_CXXFLAGS@
# These bits are all figured out from configure. Look in acinclude.m4
# or configure.in to see how they are set. See GLIBCPP_EXPORT_FLAGS
# NB: DEBUGFLAGS have to be at the end so that -O2 can be overridden.
-CONFIG_CXXFLAGS = @EXTRA_CXX_FLAGS@ @SECTION_FLAGS@ @CSHADOW_FLAGS@ @DEBUG_FLAGS@
+CONFIG_CXXFLAGS = \
+ @EXTRA_CXX_FLAGS@ @SECTION_FLAGS@ @CSHADOW_FLAGS@ @DEBUG_FLAGS@
# Warning flags to use.
-WARN_CXXFLAGS = @WARN_FLAGS@ $(WERROR) @WFMT_FLAGS@
+WARN_CXXFLAGS = \
+ @WARN_FLAGS@ $(WERROR) -fdiagnostics-show-location=once
# Use common includes from acinclude.m4/GLIBCPP_EXPORT_INCLUDES
-GLIBCPP_INCLUDE_DIR = @GLIBCPP_INCLUDE_DIR@
-C_INCLUDE_DIR = @C_INCLUDE_DIR@
-CSTD_INCLUDES = @CSTD_INCLUDES@
-LIBMATH_INCLUDES = @LIBMATH_INCLUDES@
+GLIBCPP_INCLUDES = @GLIBCPP_INCLUDES@
LIBSUPCXX_INCLUDES = @LIBSUPCXX_INCLUDES@
-LIBIO_INCLUDES = @LIBIO_INCLUDES@
-TOPLEVEL_INCLUDES = @TOPLEVEL_INCLUDES@
-
-INCLUDES = -I$(toplevel_srcdir)/gcc -I$(toplevel_srcdir)/include -I$(GLIBCPP_INCLUDE_DIR) $(CSTD_INCLUDES) -I$(top_builddir)/include $(LIBSUPCXX_INCLUDES)
-
-headers = cxxabi.h exception new typeinfo
-
-
-sources = del_op.cc del_opnt.cc del_opv.cc del_opvnt.cc exception_support.cc new_handler.cc new_op.cc new_opnt.cc new_opv.cc new_opvnt.cc pure.cc tinfo.cc tinfo2.cc vec.cc
+INCLUDES = \
+ -I$(toplevel_srcdir)/gcc -I$(toplevel_srcdir)/include \
+ $(GLIBCPP_INCLUDES) $(LIBSUPCXX_INCLUDES)
+
+
+headers = \
+ exception new typeinfo cxxabi.h exception_defines.h
+
+
+sources = \
+ del_op.cc \
+ del_opnt.cc \
+ del_opv.cc \
+ del_opvnt.cc \
+ eh_alloc.cc \
+ eh_aux_runtime.cc \
+ eh_catch.cc \
+ eh_exception.cc \
+ eh_globals.cc \
+ eh_personality.cc \
+ eh_terminate.cc \
+ eh_throw.cc \
+ new_handler.cc \
+ new_op.cc \
+ new_opnt.cc \
+ new_opv.cc \
+ new_opvnt.cc \
+ pure.cc \
+ tinfo.cc \
+ tinfo2.cc \
+ vec.cc
libsupc___la_SOURCES = $(sources)
@@ -162,16 +197,19 @@ libsupc__convenience_la_SOURCES = $(sources)
glibcppinstalldir = @gxx_include_dir@
glibcppinstall_HEADERS = $(headers)
-# Flags to force separate libtool library to be static only.
-LIBTOOL = @LIBTOOL@ --tag disable-shared
-LIBSUPCXX_CXXFLAGS = -prefer-pic
+LIBSUPCXX_CXXFLAGS = $(LIBSUPCXX_PICFLAGS)
# AM_CXXFLAGS needs to be in each subdirectory so that it can be
# modified in a per-library or per-sub-library way. Need to manually
# set this option because CONFIG_CXXFLAGS has to be after
# OPTIMIZE_CXXFLAGS on the compile line so that -O2 can be overridden
# as the occasion call for it. (ie, --enable-debug)
-AM_CXXFLAGS = -fno-implicit-templates $(LIBSUPCXX_CXXFLAGS) $(WARN_CXXFLAGS) $(OPTIMIZE_CXXFLAGS) $(CONFIG_CXXFLAGS)
+AM_CXXFLAGS = \
+ -fno-implicit-templates \
+ $(LIBSUPCXX_CXXFLAGS) \
+ $(WARN_CXXFLAGS) \
+ $(OPTIMIZE_CXXFLAGS) \
+ $(CONFIG_CXXFLAGS)
# libstdc++ libtool notes
@@ -195,14 +233,20 @@ AM_CXXFLAGS = -fno-implicit-templates $(LIBSUPCXX_CXXFLAGS) $(WARN_CXXFLAGS)
#
# We have to put --tag disable-shared after --tag CXX lest things
# CXX undo the affect of disable-shared.
-LTCXXCOMPILE = $(LIBTOOL) --tag CXX --tag disable-shared --mode=compile $(CXX) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(AM_CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag CXX --tag disable-shared \
+ --mode=compile $(CXX) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(AM_CXXFLAGS)
-# 3) We have a problem when building the shared libstdc++ object if
-# the rules automake generates would be used. We cannot allow CXX to
-# be used in libtool since this would add -lstdc++ to the link line
-# which of course is problematic at this point.
-CXXLINK = $(LIBTOOL) --mode=link "$(CC)" @OPT_LDFLAGS@ @SECTION_LDFLAGS@ $(AM_CXXFLAGS) $(LDFLAGS) -o $@
+# 3) We'd have a problem when building the shared libstdc++ object if
+# the rules automake generates would be used. We cannot allow g++ to
+# be used since this would add -lstdc++ to the link line which of
+# course is problematic at this point. So, we get the top-level
+# directory to configure libstdc++-v3 to use gcc as the C++
+# compilation driver.
+CXXLINK = $(LIBTOOL) --tag CXX --tag disable-shared \
+ --mode=link $(CXX) \
+ @OPT_LDFLAGS@ @SECTION_LDFLAGS@ $(AM_CXXFLAGS) $(LDFLAGS) -o $@
CONFIG_HEADER = ../config.h
CONFIG_CLEAN_FILES =
@@ -216,13 +260,16 @@ LIBS = @LIBS@
libsupc__convenience_la_LDFLAGS =
libsupc__convenience_la_LIBADD =
libsupc__convenience_la_OBJECTS = del_op.lo del_opnt.lo del_opv.lo \
-del_opvnt.lo exception_support.lo new_handler.lo new_op.lo new_opnt.lo \
-new_opv.lo new_opvnt.lo pure.lo tinfo.lo tinfo2.lo vec.lo
+del_opvnt.lo eh_alloc.lo eh_aux_runtime.lo eh_catch.lo eh_exception.lo \
+eh_globals.lo eh_personality.lo eh_terminate.lo eh_throw.lo \
+new_handler.lo new_op.lo new_opnt.lo new_opv.lo new_opvnt.lo pure.lo \
+tinfo.lo tinfo2.lo vec.lo
libsupc___la_LDFLAGS =
libsupc___la_LIBADD =
libsupc___la_OBJECTS = del_op.lo del_opnt.lo del_opv.lo del_opvnt.lo \
-exception_support.lo new_handler.lo new_op.lo new_opnt.lo new_opv.lo \
-new_opvnt.lo pure.lo tinfo.lo tinfo2.lo vec.lo
+eh_alloc.lo eh_aux_runtime.lo eh_catch.lo eh_exception.lo eh_globals.lo \
+eh_personality.lo eh_terminate.lo eh_throw.lo new_handler.lo new_op.lo \
+new_opnt.lo new_opv.lo new_opvnt.lo pure.lo tinfo.lo tinfo2.lo vec.lo
CXXFLAGS = @CXXFLAGS@
CXXCOMPILE = $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
CXXLD = $(CXX)
@@ -339,21 +386,6 @@ libsupc++.la: $(libsupc___la_OBJECTS) $(libsupc___la_DEPENDENCIES)
.cc.lo:
$(LTCXXCOMPILE) -c $<
-install-glibcppinstallHEADERS: $(glibcppinstall_HEADERS)
- @$(NORMAL_INSTALL)
- $(mkinstalldirs) $(DESTDIR)$(glibcppinstalldir)
- @list='$(glibcppinstall_HEADERS)'; for p in $$list; do \
- if test -f "$$p"; then d= ; else d="$(srcdir)/"; fi; \
- echo " $(INSTALL_DATA) $$d$$p $(DESTDIR)$(glibcppinstalldir)/$$p"; \
- $(INSTALL_DATA) $$d$$p $(DESTDIR)$(glibcppinstalldir)/$$p; \
- done
-
-uninstall-glibcppinstallHEADERS:
- @$(NORMAL_UNINSTALL)
- list='$(glibcppinstall_HEADERS)'; for p in $$list; do \
- rm -f $(DESTDIR)$(glibcppinstalldir)/$$p; \
- done
-
tags: TAGS
ID: $(HEADERS) $(SOURCES) $(LISP)
@@ -486,6 +518,25 @@ mostlyclean-generic distclean-generic clean-generic \
maintainer-clean-generic clean mostlyclean distclean maintainer-clean
+# We have to have rules modified from the default to counteract SUN make
+# prepending each of $(glibcppinstall_HEADERS) with VPATH below.
+install-glibcppinstallHEADERS: $(glibcppinstall_HEADERS)
+ @$(NORMAL_INSTALL)
+ $(mkinstalldirs) $(DESTDIR)$(glibcppinstalldir)
+ @list='$(glibcppinstall_HEADERS)'; for p in $$list; do \
+ q=`echo $$p | sed -e 's,.*/,,'`; \
+ if test -f "$$p"; then d= ; else d="$(srcdir)/"; fi; \
+ echo " $(INSTALL_DATA) $$d$$p $(DESTDIR)$(glibcppinstalldir)/$$q"; \
+ $(INSTALL_DATA) $$d$$p $(DESTDIR)$(glibcppinstalldir)/$$q; \
+ done
+
+uninstall-glibcppinstallHEADERS:
+ @$(NORMAL_UNINSTALL)
+ list='$(glibcppinstall_HEADERS)'; for p in $$list; do \
+ q=`echo $$p | sed -e 's,.*/,,'`; \
+ rm -f $(DESTDIR)$(glibcppinstalldir)/$$q; \
+ done
+
# 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.
.NOEXPORT:
diff --git a/libstdc++-v3/libsupc++/cxxabi.h b/libstdc++-v3/libsupc++/cxxabi.h
index 908d7c467fe..1d4464a274e 100644
--- a/libstdc++-v3/libsupc++/cxxabi.h
+++ b/libstdc++-v3/libsupc++/cxxabi.h
@@ -1,8 +1,7 @@
-/* new abi support -*- C++ -*-
- Copyright (C) 2000
- Free Software Foundation, Inc.
- Written by Nathan Sidwell, Codesourcery LLC, <nathan@codesourcery.com> */
-
+// new abi support -*- C++ -*-
+
+// Copyright (C) 2000 Free Software Foundation, Inc.
+//
// This file is part of GNU CC.
//
// GNU CC is free software; you can redistribute it and/or modify
@@ -29,6 +28,8 @@
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
+// Written by Nathan Sidwell, Codesourcery LLC, <nathan@codesourcery.com>
+
/* This file declares the new abi entry points into the runtime. It is not
normally necessary for user programs to include this header, or use the
entry points directly. However, this header is available should that be
@@ -41,12 +42,6 @@
#ifndef __CXXABI_H
#define __CXXABI_H 1
-#if defined(__cplusplus) && (!defined(__GXX_ABI_VERSION) || __GXX_ABI_VERSION < 100)
-/* These structures only make sense when targeting the new abi, catch a
- bonehead error early rather than let the user get very confused. */
-#error "Not targetting the new abi, supply -fnew-abi"
-#endif
-
#ifdef __cplusplus
// We use the compiler builtins __SIZE_TYPE__ and __PTRDIFF_TYPE__ instead of
@@ -478,6 +473,13 @@ void __cxa_vec_dtor (void *__array_address,
__SIZE_TYPE__ __element_size,
void (*__destructor) (void *));
+/* destruct array */
+extern "C"
+void __cxa_vec_cleanup (void *__array_address,
+ __SIZE_TYPE__ __element_count,
+ __SIZE_TYPE__ __element_size,
+ void (*__destructor) (void *));
+
/* destruct and release array */
extern "C"
void __cxa_vec_delete (void *__array_address,
diff --git a/libstdc++-v3/libsupc++/del_op.cc b/libstdc++-v3/libsupc++/del_op.cc
index c009a1637c6..f43302496d5 100644
--- a/libstdc++-v3/libsupc++/del_op.cc
+++ b/libstdc++-v3/libsupc++/del_op.cc
@@ -1,4 +1,5 @@
// Boilerplate support routines for -*- C++ -*- dynamic memory management.
+
// Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation
//
// This file is part of GNU CC.
diff --git a/libstdc++-v3/libsupc++/del_opnt.cc b/libstdc++-v3/libsupc++/del_opnt.cc
index d5d619e803d..032ea680cb3 100644
--- a/libstdc++-v3/libsupc++/del_opnt.cc
+++ b/libstdc++-v3/libsupc++/del_opnt.cc
@@ -1,4 +1,5 @@
// Boilerplate support routines for -*- C++ -*- dynamic memory management.
+
// Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation
//
// This file is part of GNU CC.
diff --git a/libstdc++-v3/libsupc++/del_opv.cc b/libstdc++-v3/libsupc++/del_opv.cc
index b43d45a35a1..47d78428dfd 100644
--- a/libstdc++-v3/libsupc++/del_opv.cc
+++ b/libstdc++-v3/libsupc++/del_opv.cc
@@ -1,4 +1,5 @@
// Boilerplate support routines for -*- C++ -*- dynamic memory management.
+
// Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation
//
// This file is part of GNU CC.
diff --git a/libstdc++-v3/libsupc++/del_opvnt.cc b/libstdc++-v3/libsupc++/del_opvnt.cc
index e91096c4af6..3504d99a0b3 100644
--- a/libstdc++-v3/libsupc++/del_opvnt.cc
+++ b/libstdc++-v3/libsupc++/del_opvnt.cc
@@ -1,4 +1,5 @@
// Boilerplate support routines for -*- C++ -*- dynamic memory management.
+
// Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation
//
// This file is part of GNU CC.
diff --git a/libstdc++-v3/libsupc++/eh_alloc.cc b/libstdc++-v3/libsupc++/eh_alloc.cc
new file mode 100644
index 00000000000..8b55d6c6083
--- /dev/null
+++ b/libstdc++-v3/libsupc++/eh_alloc.cc
@@ -0,0 +1,163 @@
+// -*- C++ -*- Allocate exception objects.
+// Copyright (C) 2001 Free Software Foundation, Inc.
+//
+// This file is part of GNU CC.
+//
+// GNU CC is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2, or (at your option)
+// any later version.
+//
+// GNU CC is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with GNU CC; see the file COPYING. If not, write to
+// the Free Software Foundation, 59 Temple Place - Suite 330,
+// Boston, MA 02111-1307, USA.
+
+// 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.
+
+// This is derived from the C++ ABI for IA-64. Where we diverge
+// for cross-architecture compatibility are noted with "@@@".
+
+#include <exception>
+#include <cstdlib>
+#include <cstring>
+#include <limits.h>
+#include "unwind-cxx.h"
+#include "bits/c++config.h"
+#include "bits/gthr.h"
+
+using namespace __cxxabiv1;
+
+
+// ??? How to control these parameters.
+
+// Guess from the size of basic types how large a buffer is reasonable.
+// Note that the basic c++ exception header has 13 pointers and 2 ints,
+// so on a system with PSImode pointers we're talking about 56 bytes
+// just for overhead.
+
+#if INT_MAX == 32767
+# define EMERGENCY_OBJ_SIZE 128
+# define EMERGENCY_OBJ_COUNT 16
+#elif LONG_MAX == 2147483647
+# define EMERGENCY_OBJ_SIZE 512
+# define EMERGENCY_OBJ_COUNT 32
+#else
+# define EMERGENCY_OBJ_SIZE 1024
+# define EMERGENCY_OBJ_COUNT 64
+#endif
+
+#ifndef __GTHREADS
+# undef EMERGENCY_OBJ_COUNT
+# define EMERGENCY_OBJ_COUNT 4
+#endif
+
+#if INT_MAX == 32767 || EMERGENCY_OBJ_COUNT <= 32
+typedef unsigned int bitmask_type;
+#else
+typedef unsigned long bitmask_type;
+#endif
+
+
+typedef char one_buffer[EMERGENCY_OBJ_SIZE] __attribute__((aligned));
+static one_buffer emergency_buffer[EMERGENCY_OBJ_COUNT];
+static bitmask_type emergency_used;
+
+
+#ifdef __GTHREADS
+#ifdef __GTHREAD_MUTEX_INIT
+static __gthread_mutex_t emergency_mutex =__GTHREAD_MUTEX_INIT;
+#else
+static __gthread_mutex_t emergency_mutex;
+#endif
+
+#ifdef __GTHREAD_MUTEX_INIT_FUNCTION
+static void
+emergency_mutex_init ()
+{
+ __GTHREAD_MUTEX_INIT_FUNCTION (&emergency_mutex);
+}
+#endif
+#endif
+
+
+extern "C" void *
+__cxa_allocate_exception(std::size_t thrown_size)
+{
+ void *ret;
+
+ thrown_size += sizeof (__cxa_exception);
+ ret = std::malloc (thrown_size);
+
+ if (! ret)
+ {
+#ifdef __GTHREADS
+#ifdef __GTHREAD_MUTEX_INIT_FUNCTION
+ static __gthread_once_t once = __GTHREAD_ONCE_INIT;
+ __gthread_once (&once, emergency_mutex_init);
+#endif
+ __gthread_mutex_lock (&emergency_mutex);
+#endif
+
+ bitmask_type used = emergency_used;
+ unsigned int which = 0;
+
+ if (thrown_size > EMERGENCY_OBJ_SIZE)
+ goto failed;
+ while (used & 1)
+ {
+ used >>= 1;
+ if (++which >= EMERGENCY_OBJ_COUNT)
+ goto failed;
+ }
+
+ emergency_used |= (bitmask_type)1 << which;
+ ret = &emergency_buffer[which][0];
+
+ failed:;
+#ifdef __GTHREADS
+ __gthread_mutex_unlock (&emergency_mutex);
+#endif
+ if (!ret)
+ std::terminate ();
+ }
+
+ std::memset (ret, 0, sizeof (__cxa_exception));
+
+ return (void *)((char *)ret + sizeof (__cxa_exception));
+}
+
+
+extern "C" void
+__cxa_free_exception(void *vptr)
+{
+ char *ptr = (char *) vptr;
+ if (ptr >= &emergency_buffer[0][0]
+ && ptr < &emergency_buffer[0][0] + sizeof (emergency_buffer))
+ {
+ unsigned int which
+ = (unsigned)(ptr - &emergency_buffer[0][0]) / EMERGENCY_OBJ_SIZE;
+
+#ifdef __GTHREADS
+ __gthread_mutex_lock (&emergency_mutex);
+ emergency_used &= ~((bitmask_type)1 << which);
+ __gthread_mutex_unlock (&emergency_mutex);
+#else
+ emergency_used &= ~((bitmask_type)1 << which);
+#endif
+ }
+ else
+ std::free (ptr - sizeof (__cxa_exception));
+}
diff --git a/libstdc++-v3/libsupc++/eh_aux_runtime.cc b/libstdc++-v3/libsupc++/eh_aux_runtime.cc
new file mode 100644
index 00000000000..b10a21986e6
--- /dev/null
+++ b/libstdc++-v3/libsupc++/eh_aux_runtime.cc
@@ -0,0 +1,56 @@
+// -*- C++ -*- Common throw conditions.
+// Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+// Free Software Foundation
+//
+// This file is part of GNU CC.
+//
+// GNU CC is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2, or (at your option)
+// any later version.
+//
+// GNU CC is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with GNU CC; see the file COPYING. If not, write to
+// the Free Software Foundation, 59 Temple Place - Suite 330,
+// Boston, MA 02111-1307, USA.
+
+// 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.
+
+#include "typeinfo"
+#include "exception"
+#include <cstddef>
+#include "unwind-cxx.h"
+#include "exception_defines.h"
+
+
+extern "C" void
+__cxa_bad_cast ()
+{
+#ifdef __EXCEPTIONS
+ throw std::bad_cast();
+#else
+ std::abort();
+#endif
+}
+
+extern "C" void
+__cxa_bad_typeid ()
+{
+#ifdef __EXCEPTIONS
+ throw std::bad_typeid();
+#else
+ std::abort();
+#endif
+}
diff --git a/libstdc++-v3/libsupc++/eh_catch.cc b/libstdc++-v3/libsupc++/eh_catch.cc
new file mode 100644
index 00000000000..f6879075602
--- /dev/null
+++ b/libstdc++-v3/libsupc++/eh_catch.cc
@@ -0,0 +1,103 @@
+// -*- C++ -*- Exception handling routines for catching.
+// Copyright (C) 2001 Free Software Foundation, Inc.
+//
+// This file is part of GNU CC.
+//
+// GNU CC is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2, or (at your option)
+// any later version.
+//
+// GNU CC is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with GNU CC; see the file COPYING. If not, write to
+// the Free Software Foundation, 59 Temple Place - Suite 330,
+// Boston, MA 02111-1307, USA.
+
+// 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.
+
+
+#include <cstdlib>
+#include "unwind-cxx.h"
+
+using namespace __cxxabiv1;
+
+
+extern "C" void *
+__cxa_begin_catch (_Unwind_Exception *exceptionObject)
+{
+ // ??? Foreign exceptions can't be stacked here, and there doesn't
+ // appear to be any place to store for __cxa_end_catch to destroy.
+
+ __cxa_exception *header = __get_exception_header_from_ue (exceptionObject);
+ __cxa_eh_globals *globals = __cxa_get_globals ();
+ __cxa_exception *prev = globals->caughtExceptions;
+ int count = header->handlerCount;
+
+ if (count < 0)
+ // This exception was rethrown from an immediately enclosing region.
+ count = -count + 1;
+ else
+ count += 1;
+ header->handlerCount = count;
+
+ globals->uncaughtExceptions -= 1;
+ if (header != prev)
+ {
+ header->nextException = prev;
+ globals->caughtExceptions = header;
+ }
+
+ return header->adjustedPtr;
+}
+
+
+extern "C" void
+__cxa_end_catch ()
+{
+ __cxa_eh_globals *globals = __cxa_get_globals_fast ();
+ __cxa_exception *header = globals->caughtExceptions;
+ int count = header->handlerCount;
+
+ if (count < 0)
+ {
+ // This exception was rethrown. Decrement the (inverted) catch
+ // count and remove it from the chain when it reaches zero.
+ if (++count == 0)
+ {
+ globals->uncaughtExceptions += 1;
+ globals->caughtExceptions = header->nextException;
+ }
+ }
+ else if (--count == 0)
+ {
+ // Handling for this exception is complete. Destroy the object.
+ globals->caughtExceptions = header->nextException;
+ _Unwind_DeleteException (&header->unwindHeader);
+ return;
+ }
+ else if (count < 0)
+ // A bug in the exception handling library or compiler.
+ std::abort ();
+
+ header->handlerCount = count;
+}
+
+
+bool
+std::uncaught_exception() throw()
+{
+ __cxa_eh_globals *globals = __cxa_get_globals ();
+ return globals->uncaughtExceptions != 0;
+}
diff --git a/libstdc++-v3/libsupc++/eh_exception.cc b/libstdc++-v3/libsupc++/eh_exception.cc
new file mode 100644
index 00000000000..3c1a7a44ccb
--- /dev/null
+++ b/libstdc++-v3/libsupc++/eh_exception.cc
@@ -0,0 +1,44 @@
+// -*- C++ -*- std::exception implementation.
+// Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+// Free Software Foundation
+//
+// This file is part of GNU CC.
+//
+// GNU CC is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2, or (at your option)
+// any later version.
+//
+// GNU CC is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with GNU CC; see the file COPYING. If not, write to
+// the Free Software Foundation, 59 Temple Place - Suite 330,
+// Boston, MA 02111-1307, USA.
+
+// 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.
+
+
+#include "typeinfo"
+#include "exception"
+#include "unwind-cxx.h"
+
+std::exception::~exception() throw() { }
+
+std::bad_exception::~bad_exception() throw() { }
+
+const char*
+std::exception::what() const throw()
+{
+ return typeid (*this).name ();
+}
diff --git a/libstdc++-v3/libsupc++/eh_globals.cc b/libstdc++-v3/libsupc++/eh_globals.cc
new file mode 100644
index 00000000000..3033619b12a
--- /dev/null
+++ b/libstdc++-v3/libsupc++/eh_globals.cc
@@ -0,0 +1,118 @@
+// -*- C++ -*- Manage the thread-local exception globals.
+// Copyright (C) 2001 Free Software Foundation, Inc.
+//
+// This file is part of GNU CC.
+//
+// GNU CC is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2, or (at your option)
+// any later version.
+//
+// GNU CC is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with GNU CC; see the file COPYING. If not, write to
+// the Free Software Foundation, 59 Temple Place - Suite 330,
+// Boston, MA 02111-1307, USA.
+
+// 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.
+
+
+#include <exception>
+#include <cstdlib>
+#include "unwind-cxx.h"
+#include "bits/c++config.h"
+#include "bits/gthr.h"
+
+using namespace __cxxabiv1;
+
+
+// Single-threaded fallback buffer.
+static __cxa_eh_globals globals_static;
+
+#if __GTHREADS
+static __gthread_key_t globals_key;
+static int use_thread_key = -1;
+
+static void
+get_globals_dtor (void *ptr)
+{
+ __gthread_key_dtor (globals_key, ptr);
+ if (ptr)
+ std::free (ptr);
+}
+
+static void
+get_globals_init ()
+{
+ use_thread_key =
+ (__gthread_key_create (&globals_key, get_globals_dtor) == 0);
+}
+
+static void
+get_globals_init_once ()
+{
+ static __gthread_once_t once = __GTHREAD_ONCE_INIT;
+ if (__gthread_once (&once, get_globals_init) != 0
+ || use_thread_key < 0)
+ use_thread_key = 0;
+}
+#endif
+
+extern "C" __cxa_eh_globals *
+__cxa_get_globals_fast ()
+{
+#if __GTHREADS
+ if (use_thread_key)
+ return (__cxa_eh_globals *) __gthread_getspecific (globals_key);
+ else
+ return &globals_static;
+#else
+ return &globals_static;
+#endif
+}
+
+extern "C" __cxa_eh_globals *
+__cxa_get_globals ()
+{
+#if __GTHREADS
+ __cxa_eh_globals *g;
+
+ if (use_thread_key == 0)
+ return &globals_static;
+
+ if (use_thread_key < 0)
+ {
+ get_globals_init_once ();
+
+ // Make sure use_thread_key got initialized.
+ if (use_thread_key == 0)
+ return &globals_static;
+ }
+
+ g = (__cxa_eh_globals *) __gthread_getspecific (globals_key);
+ if (! g)
+ {
+ if ((g = (__cxa_eh_globals *)
+ std::malloc (sizeof (__cxa_eh_globals))) == 0
+ || __gthread_setspecific (globals_key, (void *) g) != 0)
+ std::terminate ();
+ g->caughtExceptions = 0;
+ g->uncaughtExceptions = 0;
+ }
+
+ return g;
+#else
+ return &globals_static;
+#endif
+}
diff --git a/libstdc++-v3/libsupc++/eh_personality.cc b/libstdc++-v3/libsupc++/eh_personality.cc
new file mode 100644
index 00000000000..044212832a6
--- /dev/null
+++ b/libstdc++-v3/libsupc++/eh_personality.cc
@@ -0,0 +1,443 @@
+// -*- C++ -*- The GNU C++ exception personality routine.
+// Copyright (C) 2001 Free Software Foundation, Inc.
+//
+// This file is part of GNU CC.
+//
+// GNU CC is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2, or (at your option)
+// any later version.
+//
+// GNU CC is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with GNU CC; see the file COPYING. If not, write to
+// the Free Software Foundation, 59 Temple Place - Suite 330,
+// Boston, MA 02111-1307, USA.
+
+// 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.
+
+
+#include <bits/c++config.h>
+#include <cstdlib>
+#include "unwind-cxx.h"
+
+using namespace __cxxabiv1;
+
+#include "unwind-pe.h"
+
+
+struct lsda_header_info
+{
+ _Unwind_Ptr Start;
+ _Unwind_Ptr LPStart;
+ _Unwind_Ptr ttype_base;
+ const unsigned char *TType;
+ const unsigned char *action_table;
+ unsigned char ttype_encoding;
+ unsigned char call_site_encoding;
+};
+
+static const unsigned char *
+parse_lsda_header (_Unwind_Context *context, const unsigned char *p,
+ lsda_header_info *info)
+{
+ _Unwind_Ptr tmp;
+ unsigned char lpstart_encoding;
+
+ info->Start = (context ? _Unwind_GetRegionStart (context) : 0);
+
+ // Find @LPStart, the base to which landing pad offsets are relative.
+ lpstart_encoding = *p++;
+ if (lpstart_encoding != DW_EH_PE_omit)
+ p = read_encoded_value (context, lpstart_encoding, p, &info->LPStart);
+ else
+ info->LPStart = info->Start;
+
+ // Find @TType, the base of the handler and exception spec type data.
+ info->ttype_encoding = *p++;
+ if (info->ttype_encoding != DW_EH_PE_omit)
+ {
+ p = read_uleb128 (p, &tmp);
+ info->TType = p + tmp;
+ }
+ else
+ info->TType = 0;
+
+ // The encoding and length of the call-site table; the action table
+ // immediately follows.
+ info->call_site_encoding = *p++;
+ p = read_uleb128 (p, &tmp);
+ info->action_table = p + tmp;
+
+ return p;
+}
+
+static const std::type_info *
+get_ttype_entry (lsda_header_info *info, long i)
+{
+ _Unwind_Ptr ptr;
+
+ i *= size_of_encoded_value (info->ttype_encoding);
+ read_encoded_value_with_base (info->ttype_encoding, info->ttype_base,
+ info->TType - i, &ptr);
+
+ return reinterpret_cast<const std::type_info *>(ptr);
+}
+
+static bool
+check_exception_spec (lsda_header_info *info, const std::type_info *throw_type,
+ long filter_value)
+{
+ const unsigned char *e = info->TType - filter_value - 1;
+
+ while (1)
+ {
+ const std::type_info *catch_type;
+ _Unwind_Ptr tmp;
+ void *dummy;
+
+ e = read_uleb128 (e, &tmp);
+
+ // Zero signals the end of the list. If we've not found
+ // a match by now, then we've failed the specification.
+ if (tmp == 0)
+ return false;
+
+ // Match a ttype entry.
+ catch_type = get_ttype_entry (info, tmp);
+ if (catch_type->__do_catch (throw_type, &dummy, 1))
+ return true;
+ }
+}
+
+// Using a different personality function name causes link failures
+// when trying to mix code using different exception handling models.
+#ifdef _GLIBCPP_SJLJ_EXCEPTIONS
+#define PERSONALITY_FUNCTION __gxx_personality_sj0
+#define __builtin_eh_return_data_regno(x) x
+#else
+#define PERSONALITY_FUNCTION __gxx_personality_v0
+#endif
+
+extern "C" _Unwind_Reason_Code
+PERSONALITY_FUNCTION (int version,
+ _Unwind_Action actions,
+ _Unwind_Exception_Class exception_class,
+ struct _Unwind_Exception *ue_header,
+ struct _Unwind_Context *context)
+{
+ __cxa_exception *xh = __get_exception_header_from_ue (ue_header);
+
+ enum found_handler_type
+ {
+ found_nothing,
+ found_terminate,
+ found_cleanup,
+ found_handler
+ } found_type;
+
+ lsda_header_info info;
+ const unsigned char *language_specific_data;
+ const unsigned char *action_record;
+ const unsigned char *p;
+ _Unwind_Ptr landing_pad, ip;
+ int handler_switch_value;
+ void *adjusted_ptr = xh + 1;
+
+ // Interface version check.
+ if (version != 1)
+ return _URC_FATAL_PHASE1_ERROR;
+
+ // Shortcut for phase 2 found handler for domestic exception.
+ if (actions == (_UA_CLEANUP_PHASE | _UA_HANDLER_FRAME)
+ && exception_class == __gxx_exception_class)
+ {
+ handler_switch_value = xh->handlerSwitchValue;
+ landing_pad = (_Unwind_Ptr) xh->catchTemp;
+ found_type = (landing_pad == 0 ? found_terminate : found_handler);
+ goto install_context;
+ }
+
+ language_specific_data = (const unsigned char *)
+ _Unwind_GetLanguageSpecificData (context);
+
+ // If no LSDA, then there are no handlers or cleanups.
+ if (! language_specific_data)
+ return _URC_CONTINUE_UNWIND;
+
+ // Parse the LSDA header.
+ p = parse_lsda_header (context, language_specific_data, &info);
+ info.ttype_base = base_of_encoded_value (info.ttype_encoding, context);
+ ip = _Unwind_GetIP (context) - 1;
+ landing_pad = 0;
+ action_record = 0;
+ handler_switch_value = 0;
+
+#ifdef _GLIBCPP_SJLJ_EXCEPTIONS
+ // The given "IP" is an index into the call-site table, with two
+ // exceptions -- -1 means no-action, and 0 means terminate. But
+ // since we're using uleb128 values, we've not got random access
+ // to the array.
+ if ((int) ip < 0)
+ return _URC_CONTINUE_UNWIND;
+ else if (ip == 0)
+ {
+ // Fall through to set found_terminate.
+ }
+ else
+ {
+ _Unwind_Ptr cs_lp, cs_action;
+ do
+ {
+ p = read_uleb128 (p, &cs_lp);
+ p = read_uleb128 (p, &cs_action);
+ }
+ while (--ip);
+
+ // Can never have null landing pad for sjlj -- that would have
+ // been indicated by a -1 call site index.
+ landing_pad = cs_lp + 1;
+ if (cs_action)
+ action_record = info.action_table + cs_action - 1;
+ goto found_something;
+ }
+#else
+ // Search the call-site table for the action associated with this IP.
+ while (p < info.action_table)
+ {
+ _Unwind_Ptr cs_start, cs_len, cs_lp, cs_action;
+
+ // Note that all call-site encodings are "absolute" displacements.
+ p = read_encoded_value (0, info.call_site_encoding, p, &cs_start);
+ p = read_encoded_value (0, info.call_site_encoding, p, &cs_len);
+ p = read_encoded_value (0, info.call_site_encoding, p, &cs_lp);
+ p = read_uleb128 (p, &cs_action);
+
+ // The table is sorted, so if we've passed the ip, stop.
+ if (ip < info.Start + cs_start)
+ p = info.action_table;
+ else if (ip < info.Start + cs_start + cs_len)
+ {
+ if (cs_lp)
+ landing_pad = info.LPStart + cs_lp;
+ if (cs_action)
+ action_record = info.action_table + cs_action - 1;
+ goto found_something;
+ }
+ }
+#endif // _GLIBCPP_SJLJ_EXCEPTIONS
+
+ // If ip is not present in the table, call terminate. This is for
+ // a destructor inside a cleanup, or a library routine the compiler
+ // was not expecting to throw.
+ found_type = (actions & _UA_FORCE_UNWIND ? found_nothing : found_terminate);
+ goto do_something;
+
+ found_something:
+ if (landing_pad == 0)
+ {
+ // If ip is present, and has a null landing pad, there are
+ // no cleanups or handlers to be run.
+ found_type = found_nothing;
+ }
+ else if (action_record == 0)
+ {
+ // If ip is present, has a non-null landing pad, and a null
+ // action table offset, then there are only cleanups present.
+ // Cleanups use a zero switch value, as set above.
+ found_type = found_cleanup;
+ }
+ else
+ {
+ // Otherwise we have a catch handler or exception specification.
+
+ signed long ar_filter, ar_disp;
+ const std::type_info *throw_type, *catch_type;
+ bool saw_cleanup = false;
+ bool saw_handler = false;
+
+ // During forced unwinding, we only run cleanups. With a foreign
+ // exception class, there's no exception type.
+ // ??? What to do about GNU Java and GNU Ada exceptions.
+
+ if ((actions & _UA_FORCE_UNWIND)
+ || exception_class != __gxx_exception_class)
+ throw_type = 0;
+ else
+ throw_type = xh->exceptionType;
+
+ while (1)
+ {
+ _Unwind_Ptr tmp;
+
+ p = action_record;
+ p = read_sleb128 (p, &tmp); ar_filter = tmp;
+ read_sleb128 (p, &tmp); ar_disp = tmp;
+
+ if (ar_filter == 0)
+ {
+ // Zero filter values are cleanups.
+ saw_cleanup = true;
+ }
+ else if (ar_filter > 0)
+ {
+ // Positive filter values are handlers.
+ catch_type = get_ttype_entry (&info, ar_filter);
+ adjusted_ptr = xh + 1;
+
+ // Null catch type is a catch-all handler. We can catch
+ // foreign exceptions with this.
+ if (! catch_type)
+ {
+ if (!(actions & _UA_FORCE_UNWIND))
+ {
+ saw_handler = true;
+ break;
+ }
+ }
+ else if (throw_type)
+ {
+ // Pointer types need to adjust the actual pointer, not
+ // the pointer to pointer that is the exception object.
+ // This also has the effect of passing pointer types
+ // "by value" through the __cxa_begin_catch return value.
+ if (throw_type->__is_pointer_p ())
+ adjusted_ptr = *(void **) adjusted_ptr;
+
+ if (catch_type->__do_catch (throw_type, &adjusted_ptr, 1))
+ {
+ saw_handler = true;
+ break;
+ }
+ }
+ }
+ else
+ {
+ // Negative filter values are exception specifications.
+ // ??? How do foreign exceptions fit in? As far as I can
+ // see we can't match because there's no __cxa_exception
+ // object to stuff bits in for __cxa_call_unexpected to use.
+ if (throw_type
+ && ! check_exception_spec (&info, throw_type, ar_filter))
+ {
+ saw_handler = true;
+ break;
+ }
+ }
+
+ if (ar_disp == 0)
+ break;
+ action_record = p + ar_disp;
+ }
+
+ if (saw_handler)
+ {
+ handler_switch_value = ar_filter;
+ found_type = found_handler;
+ }
+ else
+ found_type = (saw_cleanup ? found_cleanup : found_nothing);
+ }
+
+ do_something:
+ if (found_type == found_nothing)
+ return _URC_CONTINUE_UNWIND;
+
+ if (actions & _UA_SEARCH_PHASE)
+ {
+ if (found_type == found_cleanup)
+ return _URC_CONTINUE_UNWIND;
+
+ // For domestic exceptions, we cache data from phase 1 for phase 2.
+ if (exception_class == __gxx_exception_class)
+ {
+ xh->handlerSwitchValue = handler_switch_value;
+ xh->actionRecord = action_record;
+ xh->languageSpecificData = language_specific_data;
+ xh->adjustedPtr = adjusted_ptr;
+
+ // ??? Completely unknown what this field is supposed to be for.
+ // ??? Need to cache TType encoding base for call_unexpected.
+ xh->catchTemp = (void *) (_Unwind_Ptr) landing_pad;
+ }
+ return _URC_HANDLER_FOUND;
+ }
+
+ install_context:
+ if (found_type == found_terminate)
+ {
+ __cxa_begin_catch (&xh->unwindHeader);
+ __terminate (xh->terminateHandler);
+ }
+
+ // Cache the TType base value for __cxa_call_unexpected, as we won't
+ // have an _Unwind_Context then.
+ if (handler_switch_value < 0)
+ {
+ parse_lsda_header (context, xh->languageSpecificData, &info);
+ xh->catchTemp = (void *) base_of_encoded_value (info.ttype_encoding,
+ context);
+ }
+
+ _Unwind_SetGR (context, __builtin_eh_return_data_regno (0),
+ (_Unwind_Ptr) &xh->unwindHeader);
+ _Unwind_SetGR (context, __builtin_eh_return_data_regno (1),
+ handler_switch_value);
+ _Unwind_SetIP (context, landing_pad);
+ return _URC_INSTALL_CONTEXT;
+}
+
+extern "C" void
+__cxa_call_unexpected (_Unwind_Exception *exc_obj)
+{
+ __cxa_begin_catch (exc_obj);
+
+ // This function is a handler for our exception argument. If we exit
+ // by throwing a different exception, we'll need the original cleaned up.
+ struct end_catch_protect
+ {
+ end_catch_protect() { }
+ ~end_catch_protect() { __cxa_end_catch(); }
+ } end_catch_protect_obj;
+
+ __cxa_exception *xh = __get_exception_header_from_ue (exc_obj);
+
+ try {
+ __unexpected (xh->unexpectedHandler);
+ } catch (...) {
+ // Get the exception thrown from unexpected.
+ // ??? Foreign exceptions can't be stacked this way.
+
+ __cxa_eh_globals *globals = __cxa_get_globals_fast ();
+ __cxa_exception *new_xh = globals->caughtExceptions;
+
+ // We don't quite have enough stuff cached; re-parse the LSDA.
+ lsda_header_info info;
+ parse_lsda_header (0, xh->languageSpecificData, &info);
+ info.ttype_base = (_Unwind_Ptr) xh->catchTemp;
+
+ // If this new exception meets the exception spec, allow it.
+ if (check_exception_spec (&info, new_xh->exceptionType,
+ xh->handlerSwitchValue))
+ throw;
+
+ // If the exception spec allows std::bad_exception, throw that.
+ const std::type_info &bad_exc = typeid (std::bad_exception);
+ if (check_exception_spec (&info, &bad_exc, xh->handlerSwitchValue))
+ throw std::bad_exception ();
+
+ // Otherwise, die.
+ __terminate(xh->terminateHandler);
+ }
+}
diff --git a/libstdc++-v3/libsupc++/eh_terminate.cc b/libstdc++-v3/libsupc++/eh_terminate.cc
new file mode 100644
index 00000000000..58a6ea46b34
--- /dev/null
+++ b/libstdc++-v3/libsupc++/eh_terminate.cc
@@ -0,0 +1,87 @@
+// -*- C++ -*- std::terminate, std::unexpected and friends.
+// Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+// Free Software Foundation
+//
+// This file is part of GNU CC.
+//
+// GNU CC is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2, or (at your option)
+// any later version.
+//
+// GNU CC is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with GNU CC; see the file COPYING. If not, write to
+// the Free Software Foundation, 59 Temple Place - Suite 330,
+// Boston, MA 02111-1307, USA.
+
+// 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.
+
+#include "typeinfo"
+#include "exception"
+#include <cstdlib>
+#include "unwind-cxx.h"
+#include "exception_defines.h"
+
+using namespace __cxxabiv1;
+
+/* The current installed user handlers. */
+std::terminate_handler __cxxabiv1::__terminate_handler = std::abort;
+std::unexpected_handler __cxxabiv1::__unexpected_handler = std::terminate;
+
+void
+__cxxabiv1::__terminate (std::terminate_handler handler)
+{
+ try {
+ handler ();
+ std::abort ();
+ } catch (...) {
+ std::abort ();
+ }
+}
+
+void
+std::terminate ()
+{
+ __terminate (__terminate_handler);
+}
+
+void
+__cxxabiv1::__unexpected (std::unexpected_handler handler)
+{
+ handler();
+ std::terminate ();
+}
+
+void
+std::unexpected ()
+{
+ __unexpected (__unexpected_handler);
+}
+
+std::terminate_handler
+std::set_terminate (std::terminate_handler func) throw()
+{
+ std::terminate_handler old = __terminate_handler;
+ __terminate_handler = func;
+ return old;
+}
+
+std::unexpected_handler
+std::set_unexpected (std::unexpected_handler func) throw()
+{
+ std::unexpected_handler old = __unexpected_handler;
+ __unexpected_handler = func;
+ return old;
+}
diff --git a/libstdc++-v3/libsupc++/eh_throw.cc b/libstdc++-v3/libsupc++/eh_throw.cc
new file mode 100644
index 00000000000..a8e9ba34557
--- /dev/null
+++ b/libstdc++-v3/libsupc++/eh_throw.cc
@@ -0,0 +1,102 @@
+// -*- C++ -*- Exception handling routines for throwing.
+// Copyright (C) 2001 Free Software Foundation, Inc.
+//
+// This file is part of GNU CC.
+//
+// GNU CC is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2, or (at your option)
+// any later version.
+//
+// GNU CC is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with GNU CC; see the file COPYING. If not, write to
+// the Free Software Foundation, 59 Temple Place - Suite 330,
+// Boston, MA 02111-1307, USA.
+
+// 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.
+
+
+#include <bits/c++config.h>
+#include "unwind-cxx.h"
+
+
+using namespace __cxxabiv1;
+
+
+static void
+__gxx_exception_cleanup (_Unwind_Reason_Code code, _Unwind_Exception *exc)
+{
+ __cxa_exception *header = __get_exception_header_from_ue (exc);
+
+ // If we havn't been caught by a foreign handler, then this is
+ // some sort of unwind error. In that case just die immediately.
+ if (code != _URC_FOREIGN_EXCEPTION_CAUGHT)
+ __terminate (header->terminateHandler);
+
+ if (header->exceptionDestructor)
+ header->exceptionDestructor (header + 1);
+
+ __cxa_free_exception (header + 1);
+}
+
+
+extern "C" void
+__cxa_throw (void *obj, std::type_info *tinfo, void (*dest) (void *))
+{
+ __cxa_exception *header = __get_exception_header_from_obj (obj);
+ header->exceptionType = tinfo;
+ header->exceptionDestructor = dest;
+ header->unexpectedHandler = __unexpected_handler;
+ header->terminateHandler = __terminate_handler;
+ header->unwindHeader.exception_class = __gxx_exception_class;
+ header->unwindHeader.exception_cleanup = __gxx_exception_cleanup;
+
+ __cxa_eh_globals *globals = __cxa_get_globals ();
+ globals->uncaughtExceptions += 1;
+
+#ifdef _GLIBCPP_SJLJ_EXCEPTIONS
+ _Unwind_SjLj_RaiseException (&header->unwindHeader);
+#else
+ _Unwind_RaiseException (&header->unwindHeader);
+#endif
+
+ // Some sort of unwinding error. Note that terminate is a handler.
+ __cxa_begin_catch (&header->unwindHeader);
+ std::terminate ();
+}
+
+extern "C" void
+__cxa_rethrow ()
+{
+ __cxa_eh_globals *globals = __cxa_get_globals ();
+ __cxa_exception *header = globals->caughtExceptions;
+
+ // Watch for luser rethrowing with no active exception.
+ if (header)
+ {
+ // Tell __cxa_end_catch this is a rethrow.
+ header->handlerCount = -header->handlerCount;
+
+#ifdef _GLIBCPP_SJLJ_EXCEPTIONS
+ _Unwind_SjLj_RaiseException (&header->unwindHeader);
+#else
+ _Unwind_RaiseException (&header->unwindHeader);
+#endif
+
+ // Some sort of unwinding error. Note that terminate is a handler.
+ __cxa_begin_catch (&header->unwindHeader);
+ }
+ std::terminate ();
+}
diff --git a/libstdc++-v3/libsupc++/exception b/libstdc++-v3/libsupc++/exception
index e48d2160a60..a1daf8811cc 100644
--- a/libstdc++-v3/libsupc++/exception
+++ b/libstdc++-v3/libsupc++/exception
@@ -1,7 +1,7 @@
// Exception Handling support header for -*- C++ -*-
// Copyright (C) 1995, 1996, 1997, 1998, 2000, 2001 Free Software Foundation
-
+//
// This file is part of GNU CC.
//
// GNU CC is free software; you can redistribute it and/or modify
@@ -28,39 +28,70 @@
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
+/** @file exception
+ * This header defines several types and functions relating to the
+ * handling of exceptions in a C++ program.
+ */
+
#ifndef __EXCEPTION__
#define __EXCEPTION__
-#pragma interface "exception"
-
extern "C++" {
namespace std
{
+ /** This is the base class for all exceptions thrown by the standard
+ * library, and by certain language expressions. You are free to derive
+ * your own %exception classes, or use a different hierarchy, or to
+ * throw non-class data (e.g., fundamental types).
+ * @brief Base class for all library exceptions.
+ */
class exception
{
public:
exception() throw() { }
- virtual ~exception() throw() { }
+ virtual ~exception() throw();
+ /** Returns a C-style character string describing the general cause
+ * of the current error. */
virtual const char* what() const throw();
};
+ /** If an %exception is thrown which is not listed in a function's
+ * %exception specification, one of these may be thrown. */
class bad_exception : public exception
{
public:
bad_exception() throw() { }
- virtual ~bad_exception() throw() { }
+ virtual ~bad_exception() throw();
};
+ /// If you write a replacement %terminate handler, it must be of this type.
typedef void (*terminate_handler) ();
+ /// If you write a replacement %unexpected handler, it must be of this type.
typedef void (*unexpected_handler) ();
+ /// Takes a new handler function as an argument, returns the old function.
terminate_handler set_terminate(terminate_handler) throw();
+ /** The runtime will call this function if %exception handling must be
+ * abandoned for any reason. */
void terminate() __attribute__ ((__noreturn__));
+ /// Takes a new handler function as an argument, returns the old function.
unexpected_handler set_unexpected(unexpected_handler) throw();
+ /** The runtime will call this function if an %exception is thrown which
+ * violates the function's %exception specification. */
void unexpected() __attribute__ ((__noreturn__));
+ /** [18.6.4]/1: "Returns true after completing evaluation of a
+ * throw-expression until either completing initialization of the
+ * exception-declaration in the matching handler or entering @c unexpected()
+ * due to the throw; or after entering @c terminate() for any reason
+ * other than an explicit call to @c terminate(). [Note: This includes
+ * stack unwinding [15.2]. end note]"
+ *
+ * 2: "When @c uncaught_exception() is true, throwing an %exception can
+ * result in a call of @c terminate() (15.5.1)."
+ */
bool uncaught_exception() throw();
} // namespace std
diff --git a/libstdc++-v3/libsupc++/exception_defines.h b/libstdc++-v3/libsupc++/exception_defines.h
new file mode 100644
index 00000000000..fca2d835f41
--- /dev/null
+++ b/libstdc++-v3/libsupc++/exception_defines.h
@@ -0,0 +1,42 @@
+// -fno-exceptions Support -*- C++ -*-
+
+// Copyright (C) 2001 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.
+
+//
+// ISO C++ 14882: 19.1 Exception classes
+//
+
+#ifndef __EXCEPTIONS
+// Iff -fno-exceptions, transform error handling code to work without it.
+# define try if (true)
+# define catch(X) if (false)
+# define __throw_exception_again
+#else
+// Else proceed normally.
+# define __throw_exception_again throw
+#endif
diff --git a/libstdc++-v3/libsupc++/exception_support.cc b/libstdc++-v3/libsupc++/exception_support.cc
deleted file mode 100644
index 3f82a1a3d92..00000000000
--- a/libstdc++-v3/libsupc++/exception_support.cc
+++ /dev/null
@@ -1,391 +0,0 @@
-// Functions for Exception Support for -*- C++ -*-
-
-// Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-// 2001 Free Software Foundation
-
-// This file is part of GNU CC.
-
-// GNU CC is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2, or (at your option)
-// any later version.
-
-// GNU CC is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with GNU CC; see the file COPYING. If not, write to
-// the Free Software Foundation, 59 Temple Place - Suite 330,
-// Boston, MA 02111-1307, USA.
-
-// 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.
-
-#pragma implementation "exception"
-
-#include "typeinfo"
-#include "exception"
-#include <cstddef>
-#include "exception_support.h"
-
-/* Define terminate, unexpected, set_terminate, set_unexpected as
- well as the default terminate func and default unexpected func. */
-
-/* __terminate and __terminate_set_func, defined in libgcc2. */
-typedef void (*__terminate_func_ptr)(void) __attribute__ ((__noreturn__));
-extern "C" void __terminate (void) __attribute__ ((__noreturn__));
-extern "C" __terminate_func_ptr __terminate_set_func (__terminate_func_ptr);
-
-using std::terminate;
-
-void
-std::terminate ()
-{
- __terminate ();
-}
-
-void
-__default_unexpected ()
-{
- terminate ();
-}
-
-static std::unexpected_handler __unexpected_func __attribute__((__noreturn__))
- = __default_unexpected;
-
-std::terminate_handler
-std::set_terminate (std::terminate_handler func) throw()
-{
- return __terminate_set_func (func);
-}
-
-std::unexpected_handler
-std::set_unexpected (std::unexpected_handler func) throw()
-{
- std::unexpected_handler old = __unexpected_func;
-
- __unexpected_func = func;
- return old;
-}
-
-void
-std::unexpected ()
-{
- __unexpected_func ();
-}
-
-/* Language-specific EH info pointer, defined in libgcc2. */
-
-extern "C" cp_eh_info **__get_eh_info (); // actually void **
-
-/* Exception allocate and free, defined in libgcc2. */
-extern "C" void *__eh_alloc(std::size_t);
-extern "C" void __eh_free(void *);
-
-/* Is P the type_info node for a pointer of some kind? */
-
-extern bool __is_pointer (void *);
-
-
-/* OLD Compiler hook to return a pointer to the info for the current exception.
- Used by get_eh_info (). This fudges the actualy returned value to
- point to the beginning of what USE to be the cp_eh_info structure.
- THis is so that old code that dereferences this pointer will find
- things where it expects it to be.*/
-extern "C" void *
-__cp_exception_info (void)
-{
- return &((*__get_eh_info ())->value);
-}
-
-#define CP_EH_INFO ((cp_eh_info *) *__get_eh_info ())
-
-/* Old Compiler hook to return a pointer to the info for the current exception.
- Used by get_eh_info (). */
-
-extern "C" cp_eh_info *
-__cp_eh_info (void)
-{
- cp_eh_info *p = CP_EH_INFO;
- return p;
-}
-
-/* Compiler hook to return a pointer to the info for the current exception,
- Set the caught bit, and increment the number of handlers that are
- looking at this exception. This makes handlers smaller. */
-
-extern "C" cp_eh_info *
-__start_cp_handler (void)
-{
- cp_eh_info *p = CP_EH_INFO;
- p->caught = 1;
- p->handlers++;
- return p;
-}
-
-extern "C" int __throw_type_match_rtti_2 (const void *, const void *,
- void *, void **);
-
-extern "C" void *
-__cplus_type_matcher (__eh_info *info_, void *match_info,
- exception_descriptor *exception_table)
-{
- cp_eh_info *info = (cp_eh_info *)info_;
-
- /* No exception table implies the old style mechanism, so don't check. */
- if (exception_table != NULL
- && exception_table->lang.language != EH_LANG_C_plus_plus)
- return NULL;
-
- if (match_info == CATCH_ALL_TYPE)
- return (void *)1;
-
- /* we don't worry about version info yet, there is only one version! */
-
- void *match_type = match_info;
-
-#if !defined (__GXX_ABI_VERSION) || __GXX_ABI_VERSION < 100
- match_type = ((void *(*)())match_type) ();
-#endif
-
- if (__throw_type_match_rtti_2 (match_type, info->type,
- info->original_value, &info->value))
- // Arbitrary non-null pointer.
- return (void *)1;
- else
- return NULL;
-}
-
-/* Compiler hook to push a new exception onto the stack.
- Used by expand_throw(). */
-
-extern "C" void
-__cp_push_exception (void *value, void *type, cleanup_fn cleanup)
-{
- cp_eh_info *p = (cp_eh_info *) __eh_alloc (sizeof (cp_eh_info));
-
- p->value = value;
- p->type = type;
- p->cleanup = cleanup;
- p->handlers = 0;
- p->caught = false;
- p->original_value = value;
-
- p->eh_info.match_function = __cplus_type_matcher;
- p->eh_info.language = EH_LANG_C_plus_plus;
- p->eh_info.version = 1;
-
- cp_eh_info **q = __get_eh_info ();
-
- p->next = *q;
- *q = p;
-}
-
-/* Compiler hook to pop an exception that has been finalized. Used by
- push_eh_cleanup(). P is the info for the exception caught by the
- current catch block. */
-
-extern "C" void
-__cp_pop_exception (void* p_)
-{
- cp_eh_info *p = static_cast <cp_eh_info *> (p_);
- cp_eh_info **stack = __get_eh_info ();
- cp_eh_info **q = stack;
-
- --p->handlers;
-
- /* Do nothing if our exception is being rethrown (i.e. if the active
- exception is our exception and it is uncaught). */
- if (p == *q && !p->caught)
- return;
-
- /* Don't really pop if there are still active handlers for our exception;
- rather, push it down past any uncaught exceptions. */
- if (p->handlers != 0)
- {
- if (p == *q && p->next && !p->next->caught)
- {
- q = &(p->next);
- while (1)
- {
- if (*q == 0 || (*q)->caught)
- break;
-
- q = &((*q)->next);
- }
- *stack = p->next;
- p->next = *q;
- *q = p;
- }
- return;
- }
-
- for (; *q; q = &((*q)->next))
- if (*q == p)
- break;
-
- if (! *q)
- terminate ();
-
- *q = p->next;
-
- if (p->cleanup)
- // value may have been adjusted.
- CALL_CLEANUP (p->cleanup, p->original_value);
-
- if (! __is_pointer (p->type))
- __eh_free (p->original_value); // value may have been adjusted.
-
- __eh_free (p);
-}
-
-/* We're doing a rethrow. Find the currently handled exception, mark it
- uncaught, and move it to the top of the EH stack. */
-
-extern "C" cp_eh_info *
-__uncatch_exception (void)
-{
- cp_eh_info **stack = __get_eh_info ();
- cp_eh_info **q = stack;
- cp_eh_info *p;
-
- while (1)
- {
- p = *q;
-
- if (p == 0)
- terminate ();
- if (p->caught)
- break;
-
- q = &(p->next);
- }
-
- if (q != stack)
- {
- *q = p->next;
- p->next = *stack;
- *stack = p;
- }
-
- p->caught = false;
-
- return p;
-}
-
-/* Mark P as caught after we previously marked it as uncaught. */
-
-extern "C" void
-__recatch_exception (cp_eh_info *p)
-{
- p->caught = true;
-}
-
-/* As per [except.unexpected]:
- If an exception is thrown, we check it against the spec. If it doesn't
- match, we call unexpected (). If unexpected () throws, we check that
- exception against the spec. If it doesn't match, if the spec allows
- bad_exception we throw that; otherwise we call terminate ().
-
- The compiler treats an exception spec as a try block with a generic
- handler that just calls this function with a list of the allowed
- exception types, so we have an active exception that can be rethrown.
-
- This function does not return. */
-
-extern "C" void
-__check_eh_spec (int n, const void **spec)
-{
- cp_eh_info *p = CP_EH_INFO;
- void *d;
-
- for (int i = 0; i < n; ++i)
- {
- if (__throw_type_match_rtti_2 (spec[i], p->type, p->value, &d))
- throw;
- }
-
- try
- {
- std::unexpected ();
- }
- catch (...)
- {
- // __exception_info is an artificial var pushed into each catch block.
- if (p != __exception_info)
- {
- p = __exception_info;
- for (int i = 0; i < n; ++i)
- {
- if (__throw_type_match_rtti_2 (spec[i], p->type, p->value, &d))
- throw;
- }
- }
-
- const std::type_info &bad_exc = typeid (std::bad_exception);
- for (int i = 0; i < n; ++i)
- {
- if (__throw_type_match_rtti_2 (spec[i], &bad_exc, p->value, &d))
- throw std::bad_exception ();
- }
-
- terminate ();
- }
-}
-
-/* Special case of the above for throw() specs. */
-
-extern "C" void
-__check_null_eh_spec (void)
-{
- __check_eh_spec (0, 0);
-}
-
-// Helpers for rtti. Although these don't return, we give them return types so
-// that the type system is not broken.
-
-#if !defined(__GXX_ABI_VERSION) || __GXX_ABI_VERSION < 100
-#define THROW_BAD_CAST __throw_bad_cast
-#define THROW_BAD_TYPEID __throw_bad_typeid
-#else
-#define THROW_BAD_CAST __cxa_bad_cast
-#define THROW_BAD_TYPEID __cxa_bad_typeid
-#endif
-
-extern "C" void *
-THROW_BAD_CAST ()
-{
- throw std::bad_cast ();
- return 0;
-}
-
-extern "C" std::type_info const &
-THROW_BAD_TYPEID ()
-{
- throw std::bad_typeid ();
- return typeid (void);
-}
-
-/* Has the current exception been caught? */
-
-bool
-std::uncaught_exception () throw()
-{
- cp_eh_info *p = CP_EH_INFO;
- return p && ! p->caught;
-}
-
-const char *
-std::exception::
-what () const throw()
-{
- return typeid (*this).name ();
-}
diff --git a/libstdc++-v3/libsupc++/exception_support.h b/libstdc++-v3/libsupc++/exception_support.h
deleted file mode 100644
index 2b08388490b..00000000000
--- a/libstdc++-v3/libsupc++/exception_support.h
+++ /dev/null
@@ -1,66 +0,0 @@
-// Copyright (C) 2000
-// Free Software Foundation, Inc.
-//
-// GNU CC is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2, or (at your option)
-// any later version.
-
-// GNU CC is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with GNU CC; see the file COPYING. If not, write to
-// the Free Software Foundation, 59 Temple Place - Suite 330,
-// Boston, MA 02111-1307, USA.
-
-// 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.
-
-#include "gansidecl.h" /* Needed to support macros used in eh-common.h. */
-#include "eh-common.h"
-
-/* The type of a function called to clean up an exception object.
- (These will be destructors.) Under the old ABI, these take a
- second argument (the `in-charge' argument), that indicates whether
- or not do delete the object, and whether or not to destroy virtual
- bases. Under the new ABI, there is no second argument. */
-#if !defined (__GXX_ABI_VERSION) || __GXX_ABI_VERSION < 100
-typedef void (*cleanup_fn)(void *, int);
-/* The `2' is the value for the in-charge parameter that indicates
- that virtual bases should be destroyed. */
-#define CALL_CLEANUP(FN, THIS) FN (THIS, 2)
-#else
-typedef void (*cleanup_fn)(void *);
-#define CALL_CLEANUP(FN, THIS) FN (THIS)
-#endif
-
-/* C++-specific state about the current exception. This must match
- init_exception_processing().
-
- Note that handlers and caught are not redundant; when rethrown, an
- exception can have multiple active handlers and still be considered
- uncaught. */
-
-struct cp_eh_info
-{
- __eh_info eh_info;
- void *value;
- void *type;
- cleanup_fn cleanup;
- bool caught;
- cp_eh_info *next;
- long handlers;
- void *original_value;
-};
-
-extern "C" cp_eh_info *__uncatch_exception (void);
-extern "C" void __recatch_exception (cp_eh_info *);
diff --git a/libstdc++-v3/libsupc++/new b/libstdc++-v3/libsupc++/new
index 87c9d712f37..0d1810c6207 100644
--- a/libstdc++-v3/libsupc++/new
+++ b/libstdc++-v3/libsupc++/new
@@ -28,10 +28,15 @@
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
+/** @file new
+ * This header defines several functions to manage dynamic memory and
+ * handling memory allocation errors; see
+ * http://gcc.gnu.org/onlinedocs/libstdc++/18_support/howto.html#4 for more.
+ */
+
#ifndef __NEW__
#define __NEW__
-#pragma interface "new"
#include <cstddef>
#include <exception>
@@ -39,19 +44,35 @@ extern "C++" {
namespace std
{
+ /** @c bad_alloc (or classes derived from it) is used to report allocation
+ * errors from the throwing forms of @c new. */
class bad_alloc : public exception
{
public:
- virtual const char* what() const throw() { return "bad_alloc"; }
+ bad_alloc() throw() { }
+ virtual ~bad_alloc() throw();
};
struct nothrow_t { };
extern const nothrow_t nothrow;
+ /** If you write your own error handler to be called by @c new, it must
+ * be of this type. */
typedef void (*new_handler)();
+ /// Takes a replacement handler as the argument, returns the previous handler.
new_handler set_new_handler(new_handler);
} // namespace std
-// Replaceable signatures.
+//@{
+/** These are replaceable signatures:
+ * - normal single new and delete (no arguments, throw @c bad_alloc on error)
+ * - normal array new and delete (same)
+ * - @c nothrow single new and delete (take a @c nothrow argument, return
+ * @c NULL on error)
+ * - @c nothrow array new and delete (same)
+ *
+ * Placement new and delete signatures (take a memory address argument,
+ * does nothing) may not be replaced by a user's program.
+*/
void *operator new(std::size_t) throw (std::bad_alloc);
void *operator new[](std::size_t) throw (std::bad_alloc);
void operator delete(void *) throw();
@@ -64,6 +85,7 @@ void operator delete[](void *, const std::nothrow_t&) throw();
// Default placement versions of operator new.
inline void *operator new(std::size_t, void *place) throw() { return place; }
inline void *operator new[](std::size_t, void *place) throw() { return place; }
+//@}
} // extern "C++"
#endif
diff --git a/libstdc++-v3/libsupc++/new_handler.cc b/libstdc++-v3/libsupc++/new_handler.cc
index 183d1b29882..8c1628f4f71 100644
--- a/libstdc++-v3/libsupc++/new_handler.cc
+++ b/libstdc++-v3/libsupc++/new_handler.cc
@@ -1,4 +1,5 @@
// Implementation file for the -*- C++ -*- dynamic memory management header.
+
// Copyright (C) 1996, 1997, 1998, 2000 Free Software Foundation
//
// This file is part of GNU CC.
@@ -27,7 +28,6 @@
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
-#pragma implementation "new"
#include "new"
const std::nothrow_t std::nothrow = { };
@@ -42,3 +42,5 @@ std::set_new_handler (new_handler handler)
__new_handler = handler;
return prev_handler;
}
+
+std::bad_alloc::~bad_alloc() throw() { }
diff --git a/libstdc++-v3/libsupc++/new_op.cc b/libstdc++-v3/libsupc++/new_op.cc
index 26be6ddb2e3..6b52df7f5ad 100644
--- a/libstdc++-v3/libsupc++/new_op.cc
+++ b/libstdc++-v3/libsupc++/new_op.cc
@@ -1,5 +1,5 @@
// Support routines for the -*- C++ -*- dynamic memory management.
-// Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation
+// Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation
//
// This file is part of GNU CC.
//
@@ -28,6 +28,8 @@
// the GNU General Public License.
#include "new"
+#include <exception_defines.h>
+
using std::new_handler;
using std::bad_alloc;
@@ -47,7 +49,11 @@ operator new (std::size_t sz) throw (std::bad_alloc)
{
new_handler handler = __new_handler;
if (! handler)
- throw bad_alloc ();
+#ifdef __EXCEPTIONS
+ throw bad_alloc();
+#else
+ std::abort();
+#endif
handler ();
p = (void *) malloc (sz);
}
diff --git a/libstdc++-v3/libsupc++/new_opnt.cc b/libstdc++-v3/libsupc++/new_opnt.cc
index d7aa91d8545..e97ac986ab0 100644
--- a/libstdc++-v3/libsupc++/new_opnt.cc
+++ b/libstdc++-v3/libsupc++/new_opnt.cc
@@ -1,5 +1,5 @@
// Support routines for the -*- C++ -*- dynamic memory management.
-// Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation
+// Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation
//
// This file is part of GNU CC.
//
@@ -28,6 +28,8 @@
// the GNU General Public License.
#include "new"
+#include <exception_defines.h>
+
using std::new_handler;
using std::bad_alloc;
diff --git a/libstdc++-v3/libsupc++/new_opv.cc b/libstdc++-v3/libsupc++/new_opv.cc
index 98df6c9d8ea..7b1b1ca768e 100644
--- a/libstdc++-v3/libsupc++/new_opv.cc
+++ b/libstdc++-v3/libsupc++/new_opv.cc
@@ -1,4 +1,5 @@
// Boilerplate support routines for -*- C++ -*- dynamic memory management.
+
// Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation
//
// This file is part of GNU CC.
diff --git a/libstdc++-v3/libsupc++/new_opvnt.cc b/libstdc++-v3/libsupc++/new_opvnt.cc
index 12a3c2fc22e..ad5fbf48b92 100644
--- a/libstdc++-v3/libsupc++/new_opvnt.cc
+++ b/libstdc++-v3/libsupc++/new_opvnt.cc
@@ -1,4 +1,5 @@
// Boilerplate support routines for -*- C++ -*- dynamic memory management.
+
// Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation
//
// This file is part of GNU CC.
diff --git a/libstdc++-v3/libsupc++/pure.cc b/libstdc++-v3/libsupc++/pure.cc
index 7ada0666856..5f9b3c868cc 100644
--- a/libstdc++-v3/libsupc++/pure.cc
+++ b/libstdc++-v3/libsupc++/pure.cc
@@ -1,5 +1,5 @@
// -*- C++ -*-
-// Copyright (C) 2000 Free Software Foundation
+// Copyright (C) 2000, 2001 Free Software Foundation
//
// This file is part of GNU CC.
//
@@ -28,6 +28,7 @@
// the GNU General Public License.
#include <bits/c++config.h>
+#include "unwind-cxx.h"
#ifdef _GLIBCPP_HAVE_UNISTD_H
# include <unistd.h>
@@ -42,23 +43,9 @@
# define writestr(str) fputs(str, stderr)
#endif
-extern "C" {
-
-extern void __terminate(void) __attribute__ ((__noreturn__));
-
-// The name of the function to be placed in vtables in place of a pure
-// virtual function is different in the two ABIs.
-#if !defined(__GXX_ABI_VERSION) || __GXX_ABI_VERSION < 100
-#define PURE_VIRTUAL_NAME __pure_virtual
-#else
-#define PURE_VIRTUAL_NAME __cxa_pure_virtual
-#endif
-
-void
-PURE_VIRTUAL_NAME (void)
+extern "C" void
+__cxa_pure_virtual (void)
{
writestr ("pure virtual method called\n");
- __terminate ();
-}
-
+ std::terminate ();
}
diff --git a/libstdc++-v3/libsupc++/tinfo.cc b/libstdc++-v3/libsupc++/tinfo.cc
index fefc815e759..732609cf048 100644
--- a/libstdc++-v3/libsupc++/tinfo.cc
+++ b/libstdc++-v3/libsupc++/tinfo.cc
@@ -1,8 +1,8 @@
// Methods for type_info for -*- C++ -*- Run Time Type Identification.
-// Copyright (C) 1994, 1996, 1998, 1999, 2000 Free Software Foundation
-
+// Copyright (C) 1994, 1996, 1998, 1999, 2000, 2001 Free Software Foundation
+//
// This file is part of GNU CC.
-
+//
// GNU CC is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2, or (at your option)
@@ -27,8 +27,6 @@
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
-#pragma implementation "typeinfo"
-
#include <cstddef>
#include "tinfo.h"
#include "new" // for placement new
@@ -41,6 +39,9 @@ std::type_info::
~type_info ()
{ }
+std::bad_cast::~bad_cast() throw() { }
+std::bad_typeid::~bad_typeid() throw() { }
+
#if !__GXX_MERGED_TYPEINFO_NAMES
// We can't rely on common symbols being shared between shared objects.
@@ -52,500 +53,6 @@ operator== (const std::type_info& arg) const
#endif
-#if !defined(__GXX_ABI_VERSION) || __GXX_ABI_VERSION < 100
-// original (old) abi
-
-namespace
-{
-// ADDR is a pointer to an object. Convert it to a pointer to a base,
-// using OFFSET.
-inline void*
-convert_to_base (void *addr, bool is_virtual, myint32 offset)
-{
- if (!addr)
- return NULL;
-
- if (!is_virtual)
- return (char *) addr + offset;
-
- // Under the old ABI, the offset gives us the address of a pointer
- // to the virtual base.
- return *((void **) ((char *) addr + offset));
-}
-
-}
-
-extern "C" void
-__rtti_class (void *addr, const char *name,
- const __class_type_info::base_info *bl, std::size_t bn)
-{ new (addr) __class_type_info (name, bl, bn); }
-
-extern "C" void
-__rtti_si (void *addr, const char *n, const std::type_info *ti)
-{
- new (addr) __si_type_info
- (n, static_cast <const __user_type_info &> (*ti));
-}
-
-extern "C" void
-__rtti_user (void *addr, const char *name)
-{ new (addr) __user_type_info (name); }
-
-// Upcast for catch checking. OBJPTR points to the thrown object and might be
-// NULL. Return 0 on failure, non-zero on success. Set *ADJPTR to adjusted
-// object pointer.
-int __user_type_info::
-upcast (const type_info &target, void *objptr,
- void **adjptr) const
-{
- upcast_result result;
-
- if (do_upcast (contained_public, target, objptr, result))
- return 0;
- *adjptr = result.target_obj;
- return contained_public_p (result.whole2target);
-}
-
-// Down or cross cast for dynamic_cast. OBJPTR points to the most derrived
-// object, SUBPTR points to the static base object. Both must not be NULL.
-// TARGET specifies the desired target type, SUBTYPE specifies the static
-// type. Both must be defined. Returns adjusted object pointer on success,
-// NULL on failure. [expr.dynamic.cast]/8 says 'unambiguous public base'. This
-// itself is an ambiguous statement. We choose it to mean the base must be
-// separately unambiguous and public, rather than unambiguous considering only
-// public bases.
-void *__user_type_info::
-dyncast (int boff,
- const type_info &target, void *objptr,
- const type_info &subtype, void *subptr) const
-{
- dyncast_result result;
-
- do_dyncast (boff, contained_public,
- target, objptr, subtype, subptr, result);
- if (!result.target_obj)
- return NULL;
- if (contained_public_p (result.target2sub))
- return result.target_obj;
- if (contained_public_p (sub_kind (result.whole2sub & result.whole2target)))
- // Found a valid cross cast
- return result.target_obj;
- if (contained_nonvirtual_p (result.whole2sub))
- // Found an invalid cross cast, which cannot also be a down cast
- return NULL;
- if (result.target2sub == unknown)
- result.target2sub = static_cast <const __user_type_info &> (target)
- .find_public_subobj (boff, subtype,
- result.target_obj, subptr);
- if (contained_public_p (result.target2sub))
- // Found a valid down cast
- return result.target_obj;
- // Must be an invalid down cast, or the cross cast wasn't bettered
- return NULL;
-}
-
-// Catch cast helper. ACCESS_PATH is the access from the complete thrown
-// object to this base. TARGET is the desired type we want to catch. OBJPTR
-// points to this base within the throw object, it might be NULL. Fill in
-// RESULT with what we find. Return true, should we determine catch must fail.
-bool __user_type_info::
-do_upcast (sub_kind access_path,
- const type_info &target, void *objptr,
- upcast_result &__restrict result) const
-{
- if (*this == target)
- {
- result.target_obj = objptr;
- result.base_type = nonvirtual_base_type;
- result.whole2target = access_path;
- return contained_nonpublic_p (access_path);
- }
- return false;
-}
-
-// dynamic cast helper. ACCESS_PATH gives the access from the most derived
-// object to this base. TARGET indicates the desired type we want. OBJPTR
-// points to this base within the object. SUBTYPE indicates the static type
-// started from and SUBPTR points to that base within the most derived object.
-// Fill in RESULT with what we find. Return true if we have located an
-// ambiguous match.
-bool __user_type_info::
-do_dyncast (int, sub_kind access_path,
- const type_info &target, void *objptr,
- const type_info &subtype, void *subptr,
- dyncast_result &__restrict result) const
-{
- if (objptr == subptr && *this == subtype)
- {
- // The subobject we started from. Indicate how we are accessible from
- // the most derived object.
- result.whole2sub = access_path;
- return false;
- }
- if (*this == target)
- {
- result.target_obj = objptr;
- result.whole2target = access_path;
- result.target2sub = not_contained;
- return false;
- }
- return false;
-}
-
-// find_public_subobj helper. Return contained_public if we are the desired
-// subtype. OBJPTR points to this base type, SUBPTR points to the desired base
-// object.
-__user_type_info::sub_kind __user_type_info::
-do_find_public_subobj (int, const type_info &, void *objptr, void *subptr) const
-{
- if (subptr == objptr)
- // Must be our type, as the pointers match.
- return contained_public;
- return not_contained;
-}
-
-// catch helper for single public inheritance types. See
-// __user_type_info::do_upcast for semantics.
-bool __si_type_info::
-do_upcast (sub_kind access_path,
- const type_info &target, void *objptr,
- upcast_result &__restrict result) const
-{
- if (*this == target)
- {
- result.target_obj = objptr;
- result.base_type = nonvirtual_base_type;
- result.whole2target = access_path;
- return contained_nonpublic_p (access_path);
- }
- return base.do_upcast (access_path, target, objptr, result);
-}
-
-// dynamic cast helper for single public inheritance types. See
-// __user_type_info::do_dyncast for semantics. BOFF indicates how SUBTYPE
-// types are inherited by TARGET types.
-bool __si_type_info::
-do_dyncast (int boff, sub_kind access_path,
- const type_info &target, void *objptr,
- const type_info &subtype, void *subptr,
- dyncast_result &__restrict result) const
-{
- if (objptr == subptr && *this == subtype)
- {
- // The subobject we started from. Indicate how we are accessible from
- // the most derived object.
- result.whole2sub = access_path;
- return false;
- }
- if (*this == target)
- {
- result.target_obj = objptr;
- result.whole2target = access_path;
- if (boff >= 0)
- result.target2sub = ((char *)subptr - (char *)objptr) == boff
- ? contained_public : not_contained;
- else if (boff == -2)
- result.target2sub = not_contained;
- return false;
- }
- return base.do_dyncast (boff, access_path,
- target, objptr, subtype, subptr, result);
-}
-
-// find_public_subobj helper. See __user_type_info::do_find_public_subobj or
-// semantics. BOFF indicates how SUBTYPE types are inherited by the original
-// target object.
-__user_type_info::sub_kind __si_type_info::
-do_find_public_subobj (int boff, const type_info &subtype, void *objptr, void *subptr) const
-{
- if (subptr == objptr && subtype == *this)
- return contained_public;
- return base.do_find_public_subobj (boff, subtype, objptr, subptr);
-}
-
-// catch helper for multiple or non-public inheritance types. See
-// __user_type_info::do_upcast for semantics.
-bool __class_type_info::
-do_upcast (sub_kind access_path,
- const type_info &target, void *objptr,
- upcast_result &__restrict result) const
-{
- if (*this == target)
- {
- result.target_obj = objptr;
- result.base_type = nonvirtual_base_type;
- result.whole2target = access_path;
- return contained_nonpublic_p (access_path);
- }
-
- for (std::size_t i = n_bases; i--;)
- {
- upcast_result result2;
- void *p = objptr;
- sub_kind sub_access = access_path;
- p = convert_to_base (p,
- base_list[i].is_virtual,
- base_list[i].offset);
- if (base_list[i].is_virtual)
- sub_access = sub_kind (sub_access | contained_virtual_mask);
- if (base_list[i].access != PUBLIC)
- sub_access = sub_kind (sub_access & ~contained_public_mask);
- if (base_list[i].base->do_upcast (sub_access, target, p, result2)
- && !contained_virtual_p (result2.whole2target))
- return true; // must fail
- if (result2.base_type)
- {
- if (result2.base_type == nonvirtual_base_type
- && base_list[i].is_virtual)
- result2.base_type = base_list[i].base;
- if (!result.base_type)
- result = result2;
- else if (result.target_obj != result2.target_obj)
- {
- // Found an ambiguity.
- result.target_obj = NULL;
- result.whole2target = contained_ambig;
- return true;
- }
- else if (result.target_obj)
- {
- // Ok, found real object via a virtual path.
- result.whole2target
- = sub_kind (result.whole2target | result2.whole2target);
- }
- else
- {
- // Dealing with a null pointer, need to check vbase
- // containing each of the two choices.
- if (result2.base_type == nonvirtual_base_type
- || result.base_type == nonvirtual_base_type
- || !(*result2.base_type == *result.base_type))
- {
- // Already ambiguous, not virtual or via different virtuals.
- // Cannot match.
- result.whole2target = contained_ambig;
- return true;
- }
- result.whole2target
- = sub_kind (result.whole2target | result2.whole2target);
- }
- }
- }
- return false;
-}
-
-// dynamic cast helper for non-public or multiple inheritance types. See
-// __user_type_info::do_dyncast for overall semantics.
-// This is a big hairy function. Although the run-time behaviour of
-// dynamic_cast is simple to describe, it gives rise to some non-obvious
-// behaviour. We also desire to determine as early as possible any definite
-// answer we can get. Because it is unknown what the run-time ratio of
-// succeeding to failing dynamic casts is, we do not know in which direction
-// to bias any optimizations. To that end we make no particular effort towards
-// early fail answers or early success answers. Instead we try to minimize
-// work by filling in things lazily (when we know we need the information),
-// and opportunisticly take early success or failure results.
-bool __class_type_info::
-do_dyncast (int boff, sub_kind access_path,
- const type_info &target, void *objptr,
- const type_info &subtype, void *subptr,
- dyncast_result &__restrict result) const
-{
- if (objptr == subptr && *this == subtype)
- {
- // The subobject we started from. Indicate how we are accessible from
- // the most derived object.
- result.whole2sub = access_path;
- return false;
- }
- if (*this == target)
- {
- result.target_obj = objptr;
- result.whole2target = access_path;
- if (boff >= 0)
- result.target2sub = ((char *)subptr - (char *)objptr) == boff
- ? contained_public : not_contained;
- else if (boff == -2)
- result.target2sub = not_contained;
- return false;
- }
- bool result_ambig = false;
- for (std::size_t i = n_bases; i--;)
- {
- dyncast_result result2;
- void *p;
- sub_kind sub_access = access_path;
- p = convert_to_base (objptr,
- base_list[i].is_virtual,
- base_list[i].offset);
- if (base_list[i].is_virtual)
- sub_access = sub_kind (sub_access | contained_virtual_mask);
- if (base_list[i].access != PUBLIC)
- sub_access = sub_kind (sub_access & ~contained_public_mask);
-
- bool result2_ambig
- = base_list[i].base->do_dyncast (boff, sub_access,
- target, p, subtype, subptr, result2);
- result.whole2sub = sub_kind (result.whole2sub | result2.whole2sub);
- if (result2.target2sub == contained_public
- || result2.target2sub == contained_ambig)
- {
- result.target_obj = result2.target_obj;
- result.whole2target = result2.whole2target;
- result.target2sub = result2.target2sub;
- // Found a downcast which can't be bettered or an ambiguous downcast
- // which can't be disambiguated
- return result2_ambig;
- }
-
- if (!result_ambig && !result.target_obj)
- {
- // Not found anything yet.
- result.target_obj = result2.target_obj;
- result.whole2target = result2.whole2target;
- result_ambig = result2_ambig;
- }
- else if (result.target_obj && result.target_obj == result2.target_obj)
- {
- // Found at same address, must be via virtual. Pick the most
- // accessible path.
- result.whole2target =
- sub_kind (result.whole2target | result2.whole2target);
- }
- else if ((result.target_obj && result2.target_obj)
- || (result_ambig && result2.target_obj)
- || (result2_ambig && result.target_obj))
- {
- // Found two different TARGET bases, or a valid one and a set of
- // ambiguous ones, must disambiguate. See whether SUBOBJ is
- // contained publicly within one of the non-ambiguous choices.
- // If it is in only one, then that's the choice. If it is in
- // both, then we're ambiguous and fail. If it is in neither,
- // we're ambiguous, but don't yet fail as we might later find a
- // third base which does contain SUBPTR.
-
- sub_kind new_sub_kind = result2.target2sub;
- sub_kind old_sub_kind = result.target2sub;
-
- if (contained_nonvirtual_p (result.whole2sub))
- {
- // We already found SUBOBJ as a non-virtual base of most
- // derived. Therefore if it is in either choice, it can only be
- // in one of them, and we will already know.
- if (old_sub_kind == unknown)
- old_sub_kind = not_contained;
- if (new_sub_kind == unknown)
- new_sub_kind = not_contained;
- }
- else
- {
- const __user_type_info &t =
- static_cast <const __user_type_info &> (target);
-
- if (old_sub_kind >= not_contained)
- ;// already calculated
- else if (contained_nonvirtual_p (new_sub_kind))
- // Already found non-virtually inside the other choice,
- // cannot be in this.
- old_sub_kind = not_contained;
- else
- old_sub_kind = t.find_public_subobj (boff, subtype,
- result.target_obj, subptr);
-
- if (new_sub_kind >= not_contained)
- ;// already calculated
- else if (contained_nonvirtual_p (old_sub_kind))
- // Already found non-virtually inside the other choice,
- // cannot be in this.
- new_sub_kind = not_contained;
- else
- new_sub_kind = t.find_public_subobj (boff, subtype,
- result2.target_obj, subptr);
- }
-
- // Neither sub_kind can be contained_ambig -- we bail out early
- // when we find those.
- if (contained_p (sub_kind (new_sub_kind ^ old_sub_kind)))
- {
- // Only on one choice, not ambiguous.
- if (contained_p (new_sub_kind))
- {
- // Only in new.
- result.target_obj = result2.target_obj;
- result.whole2target = result2.whole2target;
- result_ambig = false;
- old_sub_kind = new_sub_kind;
- }
- result.target2sub = old_sub_kind;
- if (result.target2sub == contained_public)
- return false; // Can't be an ambiguating downcast for later discovery.
- }
- else if (contained_p (sub_kind (new_sub_kind & old_sub_kind)))
- {
- // In both.
- result.target_obj = NULL;
- result.target2sub = contained_ambig;
- return true; // Fail.
- }
- else
- {
- // In neither publicly, ambiguous for the moment, but keep
- // looking. It is possible that it was private in one or
- // both and therefore we should fail, but that's just tough.
- result.target_obj = NULL;
- result.target2sub = not_contained;
- result_ambig = true;
- }
- }
-
- if (result.whole2sub == contained_private)
- // We found SUBOBJ as a private non-virtual base, therefore all
- // cross casts will fail. We have already found a down cast, if
- // there is one.
- return result_ambig;
- }
-
- return result_ambig;
-}
-
-// find_public_subobj helper for non-public or multiple inheritance types. See
-// __user_type_info::do_find_public_subobj for semantics. We make use of BOFF
-// to prune the base class walk.
-__user_type_info::sub_kind __class_type_info::
-do_find_public_subobj (int boff, const type_info &subtype, void *objptr, void *subptr) const
-{
- if (objptr == subptr && subtype == *this)
- return contained_public;
-
- for (std::size_t i = n_bases; i--;)
- {
- if (base_list[i].access != PUBLIC)
- continue; // Not public, can't be here.
- void *p;
-
- if (base_list[i].is_virtual && boff == -3)
- // Not a virtual base, so can't be here.
- continue;
-
- p = convert_to_base (objptr,
- base_list[i].is_virtual,
- base_list[i].offset);
-
- sub_kind base_kind = base_list[i].base->do_find_public_subobj
- (boff, subtype, p, subptr);
- if (contained_p (base_kind))
- {
- if (base_list[i].is_virtual)
- base_kind = sub_kind (base_kind | contained_virtual_mask);
- return base_kind;
- }
- }
-
- return not_contained;
-}
-#else
-// new abi
-
namespace std {
// return true if this is a type_info for a pointer type
@@ -1211,4 +718,3 @@ __dynamic_cast (const void *src_ptr, // object started from
}
}; // namespace __cxxabiv1
-#endif
diff --git a/libstdc++-v3/libsupc++/tinfo.h b/libstdc++-v3/libsupc++/tinfo.h
index 456f715eeb3..e5cb63aa8d3 100644
--- a/libstdc++-v3/libsupc++/tinfo.h
+++ b/libstdc++-v3/libsupc++/tinfo.h
@@ -1,224 +1,9 @@
// RTTI support internals for -*- C++ -*-
-// Copyright (C) 1994, 1995, 1996, 1998, 1999, 2000 Free Software Foundation
-
+// Copyright (C) 1994, 1995, 1996, 1998, 1999, 2000, 2001 Free Software Foundation
#include "typeinfo"
#include <cstddef>
// Class declarations shared between the typeinfo implementation files.
-#if !defined(__GXX_ABI_VERSION) || __GXX_ABI_VERSION < 100
-// original (old) abi
-
-// type_info for a class with no base classes (or an enum).
-
-struct __user_type_info : public std::type_info {
- __user_type_info (const char *n) : type_info (n) {}
-
- // If our type can be upcast to a public and unambiguous base, then return
- // non-zero and set RES to point to the base object. OBJ points to the throw
- // object and can be NULL, if there is no object to adjust.
- int upcast (const type_info &target, void *obj, void **res) const;
-
- // If our type can be dynamicly cast to the target type, then return
- // pointer to the target object. OBJ is the pointer to the most derived
- // type and cannot be NULL. SUBTYPE and SUBOBJ indicate the static type
- // base object from whence we came, it cannot be NULL. SUBTYPE cannot be
- // the same as TARGET. TARGET cannot be a base of SUBTYPE.
- // BOFF indicates how SUBTYPE is related to TARGET.
- // BOFF >= 0, there is only one public non-virtual SUBTYPE base at offset
- // BOFF, and there are no public virtual SUBTYPE bases.
- // Therefore check if SUBOBJ is at offset BOFF when we find a target
- // BOFF == -1, SUBTYPE occurs as multiple public virtual or non-virtual bases.
- // Lazily search all the bases of TARGET.
- // BOFF == -2, SUBTYPE is not a public base.
- // BOFF == -3, SUBTYPE occurs as multiple public non-virtual bases.
- // Lazily search the non-virtual bases of TARGET.
- // For backwards compatibility set BOFF to -1, that is the safe "unknown"
- // value. We do not care about SUBTYPES as private bases of TARGET, as they
- // can never succeed as downcasts, only as crosscasts -- and then only if
- // they are virtual. This is more complicated that it might seem.
- void *dyncast (int boff,
- const type_info &target, void *obj,
- const type_info &subtype, void *subobj) const;
-
- // non_virtual_base_type is used to indicate that a base class is via a
- // non-virtual access path.
- static const type_info *const nonvirtual_base_type
- = static_cast <const type_info *> (0) + 1;
-
- // sub_kind tells us about how a base object is contained within a derived
- // object. We often do this lazily, hence the UNKNOWN value. At other times
- // we may use NOT_CONTAINED to mean not publicly contained.
- enum sub_kind
- {
- unknown = 0, // we have no idea
- not_contained, // not contained within us (in some
- // circumstances this might mean not contained
- // publicly)
- contained_ambig, // contained ambiguously
- contained_mask = 4, // contained within us
- contained_virtual_mask = 1, // via a virtual path
- contained_public_mask = 2, // via a public path
- contained_private = contained_mask,
- contained_public = contained_mask | contained_public_mask
- };
- // some predicate functions for sub_kind
- static inline bool contained_p (sub_kind access_path)
- {
- return access_path >= contained_mask;
- }
- static inline bool contained_public_p (sub_kind access_path)
- {
- return access_path >= contained_public;
- }
- static inline bool contained_nonpublic_p (sub_kind access_path)
- {
- return (access_path & contained_public) == contained_mask;
- }
- static inline bool contained_nonvirtual_p (sub_kind access_path)
- {
- return (access_path & (contained_mask | contained_virtual_mask))
- == contained_mask;
- }
- static inline bool contained_virtual_p (sub_kind access_path)
- {
- return (access_path & (contained_mask | contained_virtual_mask))
- == (contained_mask | contained_virtual_mask);
- }
-
- struct upcast_result
- {
- void *target_obj; // pointer to target object or NULL (init NULL)
- sub_kind whole2target; // path from most derived object to target
- const type_info *base_type; // where we found the target, (init NULL)
- // if in vbase the __user_type_info of vbase)
- // if a non-virtual base then 1
- // else NULL
- public:
- upcast_result ()
- :target_obj (NULL), whole2target (unknown), base_type (NULL)
- {}
- };
- struct dyncast_result
- {
- void *target_obj; // pointer to target object or NULL (init NULL)
- sub_kind whole2target; // path from most derived object to target
- sub_kind whole2sub; // path from most derived object to sub object
- sub_kind target2sub; // path from target to sub object
-
- public:
- dyncast_result ()
- :target_obj (NULL), whole2target (unknown),
- whole2sub (unknown), target2sub (unknown)
- {}
- };
-
- public:
- // Helper for upcast. See if TARGET is us, or one of our bases. ACCESS_PATH
- // gives the access from the start object. Return TRUE if we know the catch
- // fails.
- virtual bool do_upcast (sub_kind access_path,
- const type_info &target, void *obj,
- upcast_result &__restrict result) const;
- // Helper for dyncast. BOFF indicates how the SUBTYPE is related to TARGET.
- // ACCESS_PATH indicates the access from the most derived object. It is
- // used to prune the DAG walk. All information about what we find is put
- // into RESULT. Return true, if the match we have found is ambiguous.
- virtual bool do_dyncast (int boff, sub_kind access_path,
- const type_info &target, void *obj,
- const type_info &subtype, void *subptr,
- dyncast_result &__restrict result) const;
- public:
- // Indicate whether SUBPTR of type SUBTYPE is contained publicly within
- // OBJPTR. OBJPTR points to this base object. BOFF indicates how SUBTYPE
- // objects might be contained within this type. If SUBPTR is one of our
- // SUBTYPE bases, indicate virtuality. Returns not_contained for non
- // containment or private containment.
- sub_kind find_public_subobj (int boff, const type_info &subtype,
- void *objptr, void *subptr) const
- {
- if (boff >= 0)
- return ((char *)subptr - (char *)objptr) == boff
- ? contained_public : not_contained;
- if (boff == -2)
- return not_contained;
- return do_find_public_subobj (boff, subtype, objptr, subptr);
- }
-
- public:
- // Helper for find_subobj. BOFF indicates how SUBTYPE bases are inherited by
- // the type started from -- which is not necessarily the current type.
- // OBJPTR points to the current base.
- virtual sub_kind do_find_public_subobj (int boff, const type_info &subtype,
- void *objptr, void *subptr) const;
-};
-
-// type_info for a class with one public, nonvirtual base class.
-
-class __si_type_info : public __user_type_info {
- const __user_type_info &base;
-
-public:
- __si_type_info (const char *n, const __user_type_info &b)
- : __user_type_info (n), base (b) { }
-
- private:
- virtual bool do_upcast (sub_kind access_path,
- const type_info &target, void *obj,
- upcast_result &__restrict result) const;
- virtual bool do_dyncast (int boff, sub_kind access_path,
- const type_info &target, void *obj,
- const type_info &subtype, void *subptr,
- dyncast_result &__restrict result) const;
- virtual sub_kind do_find_public_subobj (int boff, const type_info &subtype,
- void *objptr, void *subptr) const;
-};
-
-// type_info for a general class.
-
-#include <climits>
-
-#if INT_MAX == 2147483647
-typedef int myint32;
-#elif SHRT_MAX == 2147483647
-typedef short myint32;
-#elif SCHAR_MAX == 2147483647
-typedef signed char myint32;
-#elif LONG_MAX == 2147483647
-typedef long myint32;
-#else
-# error "No 32-bit data type?"
-#endif
-
-struct __class_type_info : public __user_type_info {
- enum access { PUBLIC = 1, PROTECTED = 2, PRIVATE = 3 };
-
- struct base_info {
- const __user_type_info *base;
- myint32 offset: 29;
- bool is_virtual: 1;
- enum access access: 2;
- };
-
- const base_info *base_list;
- std::size_t n_bases;
-
- __class_type_info (const char *name, const base_info *bl, std::size_t bn)
- : __user_type_info (name), base_list (bl), n_bases (bn) {}
-
- public:
- virtual bool do_upcast (sub_kind access_path,
- const type_info &target, void *obj,
- upcast_result &__restrict result) const;
- virtual bool do_dyncast (int boff, sub_kind access_path,
- const type_info &target, void *obj,
- const type_info &subtype, void *subptr,
- dyncast_result &__restrict result) const;
- virtual sub_kind do_find_public_subobj (int boff, const type_info &subtype,
- void *objptr, void *subptr) const;
-};
-#else
-// new abi
#include <cxxabi.h>
-#endif
diff --git a/libstdc++-v3/libsupc++/tinfo2.cc b/libstdc++-v3/libsupc++/tinfo2.cc
index 53e0fdf2784..8f3d6319c38 100644
--- a/libstdc++-v3/libsupc++/tinfo2.cc
+++ b/libstdc++-v3/libsupc++/tinfo2.cc
@@ -1,8 +1,10 @@
// Methods for type_info for -*- C++ -*- Run Time Type Identification.
-// Copyright (C) 1994, 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation
+// Copyright (C) 1994, 1996, 1997, 1998, 1999, 2000, 2001
+// Free Software Foundation
+//
// This file is part of GNU CC.
-
+//
// GNU CC is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2, or (at your option)
@@ -46,65 +48,8 @@ type_info::before (const type_info &arg) const
#endif
-#if !defined(__GXX_ABI_VERSION) || __GXX_ABI_VERSION < 100
-
-// type info for pointer type.
-
-struct __pointer_type_info : public type_info {
- const type_info& type;
-
- __pointer_type_info (const char *n, const type_info& ti)
- : type_info (n), type (ti) {}
-};
-
-// type info for attributes
-
-struct __attr_type_info : public type_info {
- enum cv { NONE = 0, CONST = 1, VOLATILE = 2, CONSTVOL = 1 | 2 };
-
- const type_info& type;
- cv attr;
-
- __attr_type_info (const char *n, cv a, const type_info& t)
- : type_info (n), type (t), attr (a) {}
-};
-
-// type_info for builtin type
-
-struct __builtin_type_info : public type_info {
- __builtin_type_info (const char *n): type_info (n) {}
-};
-
-// type info for function.
-
-struct __func_type_info : public type_info {
- __func_type_info (const char *n) : type_info (n) {}
-};
-
-// type info for pointer to member function.
-
-struct __ptmf_type_info : public type_info {
- __ptmf_type_info (const char *n) : type_info (n) {}
-};
-
-// type info for pointer to data member.
-
-struct __ptmd_type_info : public type_info {
- __ptmd_type_info (const char *n): type_info (n) {}
-};
-
-// type info for array.
-
-struct __array_type_info : public type_info {
- __array_type_info (const char *n): type_info (n) {}
-};
-
-#else
-
#include <cxxabi.h>
-#endif
-#if defined(__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100
namespace __cxxabiv1 {
using namespace std;
@@ -220,238 +165,3 @@ __pointer_catch (const __pbase_type_info *thr_type,
}
} // namespace std
-#endif
-
-// Entry points for the compiler.
-
-/* Low level match routine used by compiler to match types of catch
- variables and thrown objects. */
-
-extern "C" int
-__throw_type_match_rtti_2 (const void *catch_type_r, const void *throw_type_r,
- void *objptr, void **valp)
-{
- const type_info &catch_type = *(const type_info *)catch_type_r;
- const type_info &throw_type = *(const type_info *)throw_type_r;
-
- *valp = objptr;
-
-#if !defined(__GXX_ABI_VERSION) || __GXX_ABI_VERSION < 100
-// old abi
- if (catch_type == throw_type)
- return 1;
-
- if (const __user_type_info *p
- = dynamic_cast <const __user_type_info *> (&throw_type))
- {
- return p->upcast (catch_type, objptr, valp);
- }
- else if (const __pointer_type_info *fr =
- dynamic_cast <const __pointer_type_info *> (&throw_type))
- {
- const __pointer_type_info *to =
- dynamic_cast <const __pointer_type_info *> (&catch_type);
-
- if (! to)
- return 0;
-
- const type_info *subfr = &fr->type, *subto = &to->type;
- __attr_type_info::cv cvfrom, cvto;
-
- if (const __attr_type_info *at
- = dynamic_cast <const __attr_type_info *> (subfr))
- {
- cvfrom = at->attr;
- subfr = &at->type;
- }
- else
- cvfrom = __attr_type_info::NONE;
-
- if (const __attr_type_info *at
- = dynamic_cast <const __attr_type_info *> (subto))
- {
- cvto = at->attr;
- subto = &at->type;
- }
- else
- cvto = __attr_type_info::NONE;
-
- if (((cvfrom & __attr_type_info::CONST)
- > (cvto & __attr_type_info::CONST))
- || ((cvfrom & __attr_type_info::VOLATILE)
- > (cvto & __attr_type_info::VOLATILE)))
- return 0;
-
- if (*subto == *subfr)
- return 1;
- else if (*subto == typeid (void)
- && dynamic_cast <const __func_type_info *> (subfr) == 0)
- return 1;
- else if (const __user_type_info *p
- = dynamic_cast <const __user_type_info *> (subfr))
- return p->upcast (*subto, objptr, valp);
- else if (const __pointer_type_info *pfr
- = dynamic_cast <const __pointer_type_info *> (subfr))
- {
- // Multi-level pointer conversion.
-
- const __pointer_type_info *pto
- = dynamic_cast <const __pointer_type_info *> (subto);
-
- if (! pto)
- return 0;
-
- bool constp = (cvto & __attr_type_info::CONST);
- for (subto = &pto->type, subfr = &pfr->type; ;
- subto = &pto->type, subfr = &pfr->type)
- {
- if (const __attr_type_info *at
- = dynamic_cast <const __attr_type_info *> (subfr))
- {
- cvfrom = at->attr;
- subfr = &at->type;
- }
- else
- cvfrom = __attr_type_info::NONE;
-
- if (const __attr_type_info *at
- = dynamic_cast <const __attr_type_info *> (subto))
- {
- cvto = at->attr;
- subto = &at->type;
- }
- else
- cvto = __attr_type_info::NONE;
-
- if (((cvfrom & __attr_type_info::CONST)
- > (cvto & __attr_type_info::CONST))
- || ((cvfrom & __attr_type_info::VOLATILE)
- > (cvto & __attr_type_info::VOLATILE)))
- return 0;
-
- if (! constp
- && (((cvfrom & __attr_type_info::CONST)
- < (cvto & __attr_type_info::CONST))
- || ((cvfrom & __attr_type_info::VOLATILE)
- < (cvto & __attr_type_info::VOLATILE))))
- return 0;
-
- if (*subto == *subfr)
- return 1;
-
- pto = dynamic_cast <const __pointer_type_info *> (subto);
- pfr = dynamic_cast <const __pointer_type_info *> (subfr);
- if (! pto || ! pfr)
- return 0;
-
- if (! (cvto & __attr_type_info::CONST))
- constp = false;
- }
- }
- }
-#else
-// new abi
-
- return catch_type.__do_catch (&throw_type, valp, 1);
-#endif
- return 0;
-}
-
-#if !defined(__GXX_ABI_VERSION) || __GXX_ABI_VERSION < 100
-/* Backward compatibility wrapper. */
-
-extern "C" void*
-__throw_type_match_rtti (const void *catch_type_r, const void *throw_type_r,
- void *objptr)
-{
- void *ret;
- if (__throw_type_match_rtti_2 (catch_type_r, throw_type_r, objptr, &ret))
- return ret;
- return NULL;
-}
-#endif
-
-/* Called from __cp_pop_exception. Is P the type_info node for a pointer
- of some kind? */
-
-bool
-__is_pointer (void *p)
-{
- const type_info *t = reinterpret_cast <const type_info *>(p);
-#if !defined(__GXX_ABI_VERSION) || __GXX_ABI_VERSION < 100
-// old abi
- const __pointer_type_info *pt =
- dynamic_cast <const __pointer_type_info *> (t);
- return pt != 0;
-#else
-// new abi
- return t->__is_pointer_p ();
-#endif
-}
-
-#if !defined(__GXX_ABI_VERSION) || __GXX_ABI_VERSION < 100
-// old abi
-
-extern "C" void
-__rtti_ptr (void *addr, const char *n, const type_info *ti)
-{ new (addr) __pointer_type_info (n, *ti); }
-
-extern "C" void
-__rtti_attr (void *addr, const char *n, int attrval, const type_info *ti)
-{
- new (addr) __attr_type_info
- (n, static_cast <__attr_type_info::cv> (attrval), *ti);
-}
-
-extern "C" void
-__rtti_func (void *addr, const char *name)
-{ new (addr) __func_type_info (name); }
-
-extern "C" void
-__rtti_ptmf (void *addr, const char *name)
-{ new (addr) __ptmf_type_info (name); }
-
-extern "C" void
-__rtti_ptmd (void *addr, const char *name)
-{ new (addr) __ptmd_type_info (name); }
-
-extern "C" void
-__rtti_array (void *addr, const char *name)
-{ new (addr) __array_type_info (name); }
-
-extern "C" void *
-__dynamic_cast (const type_info& (*from)(void), const type_info& (*to)(void),
- int require_public, void *address, const type_info & (*sub)(void), void *subptr)
-{
- if (!require_public) abort();
- return static_cast <__user_type_info const &> (from ()).dyncast
- (/*boff=*/-1, to (), address, sub (), subptr);
-}
-
-extern "C" void *
-__dynamic_cast_2 (const type_info& (*from)(void), const type_info& (*to)(void),
- int boff,
- void *address, const type_info & (*sub)(void), void *subptr)
-{
- return static_cast <__user_type_info const &> (from ()).dyncast
- (boff, to (), address, sub (), subptr);
-}
-
-// type_info nodes and functions for the builtin types. The mangling here
-// must match the mangling in gcc/cp/rtti.c.
-
-#define BUILTIN(mangled) \
-unsigned char __ti##mangled [sizeof (__builtin_type_info)] \
- __attribute__ ((aligned (__alignof__ (void *)))); \
-extern "C" const type_info &__tf##mangled (void) { \
- if ((*(void **) __ti##mangled) == 0) \
- new (__ti##mangled) __builtin_type_info (#mangled); \
- return *(type_info *)__ti##mangled; \
-}
-
-BUILTIN (v); BUILTIN (x); BUILTIN (l); BUILTIN (i); BUILTIN (s); BUILTIN (b);
-BUILTIN (c); BUILTIN (w); BUILTIN (r); BUILTIN (d); BUILTIN (f);
-BUILTIN (Ui); BUILTIN (Ul); BUILTIN (Ux); BUILTIN (Us); BUILTIN (Uc);
-BUILTIN (Sc);
-
-#endif
diff --git a/libstdc++-v3/libsupc++/typeinfo b/libstdc++-v3/libsupc++/typeinfo
index 949c6d81e2f..6cabf7508eb 100644
--- a/libstdc++-v3/libsupc++/typeinfo
+++ b/libstdc++-v3/libsupc++/typeinfo
@@ -1,6 +1,6 @@
// RTTI support for -*- C++ -*-
-// Copyright (C) 1994, 1995, 1996, 1997, 1998, 2000 Free Software Foundation
-
+// Copyright (C) 1994, 1995, 1996, 1997, 1998, 2000, 2001 Free Software Foundation
+//
// This file is part of GNU CC.
//
// GNU CC is free software; you can redistribute it and/or modify
@@ -27,53 +27,46 @@
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
-// __GXX_ABI_VERSION distinguishes the ABI that is being used. Values <100
-// indicate the `old' abi, which grew as C++ was defined. Values >=100
-// indicate the `new' abi, which is a cross vendor C++ abi, documented at
-// `http://reality.sgi.com/dehnert_engr/cxx/'.
+/** @file typeinfo
+ * This header provides RTTI support.
+ */
#ifndef __TYPEINFO__
#define __TYPEINFO__
-#pragma interface "typeinfo"
-
#include <exception>
extern "C++" {
-#if defined(__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100
namespace __cxxabiv1
{
class __class_type_info;
} // namespace __cxxabiv1
-#endif
-
-#if !defined(__GXX_ABI_VERSION) || __GXX_ABI_VERSION < 100
- // In the old ABI, typeinfo name strings were not merged.
- #define __GXX_MERGED_TYPEINFO_NAMES 0
-#elif !__GXX_WEAK__
- // If weak symbols are not supported, they are still not merged.
+#if !__GXX_WEAK__
+ // If weak symbols are not supported, typeinfo names are not merged.
#define __GXX_MERGED_TYPEINFO_NAMES 0
#else
- // In the new ABI, on platforms that support weak symbols, they are
- // merged.
+ // On platforms that support weak symbols, typeinfo names are merged.
#define __GXX_MERGED_TYPEINFO_NAMES 1
#endif
namespace std
{
+ /** The @c type_info class describes type information generated by
+ * an implementation.
+ * @brief Used in RTTI. */
class type_info
{
public:
- // Destructor. Being the first non-inline virtual function, this
- // controls in which translation unit the vtable is emitted. The
- // compiler makes use of that information to know where to emit
- // the runtime-mandated type_info structures in the new-abi.
+ /** Destructor. Being the first non-inline virtual function, this
+ * controls in which translation unit the vtable is emitted. The
+ * compiler makes use of that information to know where to emit
+ * the runtime-mandated type_info structures in the new-abi. */
virtual ~type_info();
private:
- // Assigning type_info is not supported. made private.
+ /// Assigning type_info is not supported. Made private.
type_info& operator=(const type_info&);
type_info(const type_info&);
@@ -85,13 +78,10 @@ namespace std
public:
// the public interface
-#if !defined(__GXX_ABI_VERSION) || __GXX_ABI_VERSION < 100
+ /** Returns an \e implementation-defined byte string; this is not
+ * portable between compilers! */
const char* name() const
{ return __name; }
-#else
- const char* name() const
- { return __name; }
-#endif
#if !__GXX_MERGED_TYPEINFO_NAMES
bool before(const type_info& arg) const;
@@ -100,6 +90,8 @@ namespace std
// type. Uniqueness must use the _name value, not object address.
bool operator==(const type_info& __arg) const;
#else
+ /** Returns true if @c *this preceeds @c __arg in the implementation's
+ * collation order. */
// In new abi we can rely on type_info's NTBS being unique,
// and therefore address comparisons are sufficient.
bool before(const type_info& __arg) const
@@ -111,7 +103,6 @@ namespace std
{ return !operator==(__arg); }
// the internal interface
-#if defined(__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100
public:
// return true if this is a pointer type of some kind
virtual bool __is_pointer_p() const;
@@ -130,21 +121,23 @@ namespace std
// internally used during catch matching
virtual bool __do_upcast(const __cxxabiv1::__class_type_info *__target,
void **__obj_ptr) const;
-#endif
};
+ /** If you attempt an invalid @c dynamic_cast expression, an instance of
+ * this class (or something derived from this class) is thrown. */
class bad_cast : public exception
{
public:
bad_cast() throw() { }
- virtual ~bad_cast() throw() { }
+ virtual ~bad_cast() throw();
};
+ /** If you use a NULL pointer in a @c typeid expression, this is thrown. */
class bad_typeid : public exception
{
public:
bad_typeid () throw() { }
- virtual ~bad_typeid () throw() { }
+ virtual ~bad_typeid () throw();
};
} // namespace std
diff --git a/libstdc++-v3/libsupc++/unwind-cxx.h b/libstdc++-v3/libsupc++/unwind-cxx.h
new file mode 100644
index 00000000000..ce897b91f8c
--- /dev/null
+++ b/libstdc++-v3/libsupc++/unwind-cxx.h
@@ -0,0 +1,163 @@
+// -*- C++ -*- Exception handling and frame unwind runtime interface routines.
+// Copyright (C) 2001 Free Software Foundation, Inc.
+//
+// This file is part of GNU CC.
+//
+// GNU CC is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2, or (at your option)
+// any later version.
+//
+// GNU CC is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with GNU CC; see the file COPYING. If not, write to
+// the Free Software Foundation, 59 Temple Place - Suite 330,
+// Boston, MA 02111-1307, USA.
+
+// This is derived from the C++ ABI for IA-64. Where we diverge
+// for cross-architecture compatibility are noted with "@@@".
+
+#ifndef __UNWIND_CXX_H
+#define __UNWIND_CXX_H 1
+
+// Level 2: C++ ABI
+
+#include <typeinfo>
+#include <exception>
+#include <cstddef>
+#include "unwind.h"
+
+namespace __cxxabiv1
+{
+
+// A C++ exception object consists of a header, which is a wrapper around
+// an unwind object header with additional C++ specific information,
+// followed by the exception object itself.
+
+struct __cxa_exception
+{
+ // Manage the exception object itself.
+ std::type_info *exceptionType;
+ void (*exceptionDestructor)(void *);
+
+ // The C++ standard has entertaining rules wrt calling set_terminate
+ // and set_unexpected in the middle of the exception cleanup process.
+ std::unexpected_handler unexpectedHandler;
+ std::terminate_handler terminateHandler;
+
+ // The caught exception stack threads through here.
+ __cxa_exception *nextException;
+
+ // How many nested handlers have caught this exception. A negated
+ // value is a signal that this object has been rethrown.
+ int handlerCount;
+
+ // Cache parsed handler data from the personality routine Phase 1
+ // for Phase 2 and __cxa_call_unexpected.
+ int handlerSwitchValue;
+ const unsigned char *actionRecord;
+ const unsigned char *languageSpecificData;
+ void *catchTemp;
+ void *adjustedPtr;
+
+ // The generic exception header. Must be last.
+ _Unwind_Exception unwindHeader;
+};
+
+// Each thread in a C++ program has access to a __cxa_eh_globals object.
+struct __cxa_eh_globals
+{
+ __cxa_exception *caughtExceptions;
+ unsigned int uncaughtExceptions;
+};
+
+
+// The __cxa_eh_globals for the current thread can be obtained by using
+// either of the following functions. The "fast" version assumes at least
+// one prior call of __cxa_get_globals has been made from the current
+// thread, so no initialization is necessary.
+extern "C" __cxa_eh_globals *__cxa_get_globals () throw();
+extern "C" __cxa_eh_globals *__cxa_get_globals_fast () throw();
+
+// Allocate memory for the exception plus the thown object.
+extern "C" void *__cxa_allocate_exception(std::size_t thrown_size) throw();
+
+// Free the space allocated for the exception.
+extern "C" void __cxa_free_exception(void *thrown_exception) throw();
+
+// Throw the exception.
+extern "C" void __cxa_throw (void *thrown_exception,
+ std::type_info *tinfo,
+ void (*dest) (void *))
+ __attribute__((noreturn));
+
+// Used to implement exception handlers.
+extern "C" void *__cxa_begin_catch (_Unwind_Exception *) throw();
+extern "C" void __cxa_end_catch ();
+extern "C" void __cxa_rethrow () __attribute__((noreturn));
+
+// These facilitate code generation for recurring situations.
+extern "C" void __cxa_bad_cast ();
+extern "C" void __cxa_bad_typeid ();
+
+// @@@ These are not directly specified by the IA-64 C++ ABI.
+
+// Handles re-checking the exception specification if unexpectedHandler
+// throws, and if bad_exception needs to be thrown. Called from the
+// compiler.
+extern "C" void __cxa_call_unexpected (_Unwind_Exception *)
+ __attribute__((noreturn));
+
+// Invokes given handler, dying appropriately if the user handler was
+// so inconsiderate as to return.
+extern void __terminate(std::terminate_handler) __attribute__((noreturn));
+extern void __unexpected(std::unexpected_handler) __attribute__((noreturn));
+
+// The current installed user handlers.
+extern std::terminate_handler __terminate_handler;
+extern std::unexpected_handler __unexpected_handler;
+
+// These are explicitly GNU C++ specific.
+
+// This is the exception class we report -- "GNUCC++\0".
+const _Unwind_Exception_Class __gxx_exception_class
+= ((((((((_Unwind_Exception_Class) 'G'
+ << 8 | (_Unwind_Exception_Class) 'N')
+ << 8 | (_Unwind_Exception_Class) 'U')
+ << 8 | (_Unwind_Exception_Class) 'C')
+ << 8 | (_Unwind_Exception_Class) 'C')
+ << 8 | (_Unwind_Exception_Class) '+')
+ << 8 | (_Unwind_Exception_Class) '+')
+ << 8 | (_Unwind_Exception_Class) '\0');
+
+// GNU C++ personality routine, Version 0.
+extern "C" _Unwind_Reason_Code __gxx_personality_v0
+ (int, _Unwind_Action, _Unwind_Exception_Class,
+ struct _Unwind_Exception *, struct _Unwind_Context *);
+
+// GNU C++ sjlj personality routine, Version 0.
+extern "C" _Unwind_Reason_Code __gxx_personality_sj0
+ (int, _Unwind_Action, _Unwind_Exception_Class,
+ struct _Unwind_Exception *, struct _Unwind_Context *);
+
+// Acquire the C++ exception header from the C++ object.
+static inline __cxa_exception *
+__get_exception_header_from_obj (void *ptr)
+{
+ return reinterpret_cast<__cxa_exception *>(ptr) - 1;
+}
+
+// Acquire the C++ exception header from the generic exception header.
+static inline __cxa_exception *
+__get_exception_header_from_ue (_Unwind_Exception *exc)
+{
+ return reinterpret_cast<__cxa_exception *>(exc + 1) - 1;
+}
+
+} /* namespace __cxxabiv1 */
+
+#endif // __UNWIND_CXX_H
diff --git a/libstdc++-v3/libsupc++/vec.cc b/libstdc++-v3/libsupc++/vec.cc
index f00d3c11b23..5bd8ec8a47b 100644
--- a/libstdc++-v3/libsupc++/vec.cc
+++ b/libstdc++-v3/libsupc++/vec.cc
@@ -1,8 +1,9 @@
-// new abi support -*- C++ -*-
-// Copyright (C) 2000
-// Free Software Foundation, Inc.
-// Written by Nathan Sidwell, Codesourcery LLC, <nathan@codesourcery.com>
-//
+// New abi Support -*- C++ -*-
+
+// Copyright (C) 2000, 2001 Free Software Foundation, Inc.
+//
+// This file is part of GNU CC.
+//
// GNU CC is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2, or (at your option)
@@ -27,276 +28,310 @@
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
-#if defined(__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100
+// Written by Nathan Sidwell, Codesourcery LLC, <nathan@codesourcery.com>
+
#include <cxxabi.h>
#include <new>
#include <exception>
+#include <exception_defines.h>
-#include "exception_support.h"
+#include "unwind-cxx.h"
namespace __cxxabiv1
{
+ namespace
+ {
+ struct uncatch_exception
+ {
+ uncatch_exception ();
+ ~uncatch_exception () { __cxa_begin_catch (&p->unwindHeader); }
+
+ __cxa_exception *p;
+ };
-namespace
-{
-struct uncatch_exception {
- uncatch_exception () { p = __uncatch_exception (); }
- ~uncatch_exception () { __recatch_exception (p); }
+ uncatch_exception::uncatch_exception ()
+ {
+ __cxa_eh_globals *globals = __cxa_get_globals_fast ();
- cp_eh_info *p;
-};
-}
+ p = globals->caughtExceptions;
+ p->handlerCount -= 1;
+ globals->caughtExceptions = p->nextException;
+ globals->uncaughtExceptions += 1;
+ }
+ }
-/* allocate and construct array */
-extern "C" void *
-__cxa_vec_new (std::size_t element_count,
- std::size_t element_size,
- std::size_t padding_size,
- void (*constructor) (void *),
- void (*destructor) (void *))
-{
- return __cxa_vec_new2 (element_count, element_size, padding_size,
- constructor, destructor,
- &operator new[], &operator delete []);
-}
+ // Allocate and construct array.
+ extern "C" void *
+ __cxa_vec_new(std::size_t element_count,
+ std::size_t element_size,
+ std::size_t padding_size,
+ void (*constructor) (void *),
+ void (*destructor) (void *))
+ {
+ return __cxa_vec_new2(element_count, element_size, padding_size,
+ constructor, destructor,
+ &operator new[], &operator delete []);
+ }
-extern "C" void *
-__cxa_vec_new2 (std::size_t element_count,
- std::size_t element_size,
- std::size_t padding_size,
- void (*constructor) (void *),
- void (*destructor) (void *),
- void *(*alloc) (size_t),
- void (*dealloc) (void *))
-{
- std::size_t size = element_count * element_size + padding_size;
- char *base = static_cast <char *> (alloc (size));
+ extern "C" void *
+ __cxa_vec_new2(std::size_t element_count,
+ std::size_t element_size,
+ std::size_t padding_size,
+ void (*constructor) (void *),
+ void (*destructor) (void *),
+ void *(*alloc) (std::size_t),
+ void (*dealloc) (void *))
+ {
+ std::size_t size = element_count * element_size + padding_size;
+ char *base = static_cast <char *> (alloc (size));
+
+ if (padding_size)
+ {
+ base += padding_size;
+ reinterpret_cast <std::size_t *> (base)[-1] = element_count;
+ }
+ try
+ {
+ __cxa_vec_ctor(base, element_count, element_size,
+ constructor, destructor);
+ }
+ catch (...)
+ {
+ {
+ uncatch_exception ue;
+ dealloc(base - padding_size);
+ }
+ __throw_exception_again;
+ }
+ return base;
+ }
- if (padding_size)
- {
- base += padding_size;
- reinterpret_cast <std::size_t *> (base)[-1] = element_count;
- }
- try
- {
- __cxa_vec_ctor (base, element_count, element_size,
- constructor, destructor);
- }
- catch (...)
- {
+ extern "C" void *
+ __cxa_vec_new3(std::size_t element_count,
+ std::size_t element_size,
+ std::size_t padding_size,
+ void (*constructor) (void *),
+ void (*destructor) (void *),
+ void *(*alloc) (std::size_t),
+ void (*dealloc) (void *, std::size_t))
+ {
+ std::size_t size = element_count * element_size + padding_size;
+ char *base = static_cast<char *>(alloc (size));
+
+ if (padding_size)
{
- uncatch_exception ue;
- dealloc (base - padding_size);
+ base += padding_size;
+ reinterpret_cast<std::size_t *>(base)[-1] = element_count;
}
- throw;
- }
- return base;
-}
-
-extern "C" void *
-__cxa_vec_new3 (std::size_t element_count,
- std::size_t element_size,
- std::size_t padding_size,
- void (*constructor) (void *),
- void (*destructor) (void *),
- void *(*alloc) (std::size_t),
- void (*dealloc) (void *, std::size_t))
-{
- std::size_t size = element_count * element_size + padding_size;
- char *base = static_cast <char *> (alloc (size));
+ try
+ {
+ __cxa_vec_ctor(base, element_count, element_size,
+ constructor, destructor);
+ }
+ catch (...)
+ {
+ {
+ uncatch_exception ue;
+ dealloc(base - padding_size, size);
+ }
+ __throw_exception_again;
+ }
+ return base;
+ }
- if (padding_size)
- {
- base += padding_size;
- reinterpret_cast <std::size_t *> (base)[-1] = element_count;
- }
- try
- {
- __cxa_vec_ctor (base, element_count, element_size,
- constructor, destructor);
- }
- catch (...)
- {
+ // Construct array.
+ extern "C" void
+ __cxa_vec_ctor(void *array_address,
+ std::size_t element_count,
+ std::size_t element_size,
+ void (*constructor) (void *),
+ void (*destructor) (void *))
+ {
+ std::size_t ix = 0;
+ char *ptr = static_cast<char *>(array_address);
+
+ try
{
- uncatch_exception ue;
- dealloc (base - padding_size, size);
+ if (constructor)
+ for (; ix != element_count; ix++, ptr += element_size)
+ constructor(ptr);
}
- throw;
- }
- return base;
-}
-
-/* construct array */
-extern "C" void
-__cxa_vec_ctor (void *array_address,
- std::size_t element_count,
- std::size_t element_size,
- void (*constructor) (void *),
- void (*destructor) (void *))
-{
- std::size_t ix = 0;
- char *ptr = static_cast <char *> (array_address);
+ catch (...)
+ {
+ {
+ uncatch_exception ue;
+ __cxa_vec_cleanup(array_address, ix, element_size, destructor);
+ }
+ __throw_exception_again;
+ }
+ }
- try
- {
- if (constructor)
- for (; ix != element_count; ix++, ptr += element_size)
- constructor (ptr);
- }
- catch (...)
- {
+ // Construct an array by copying.
+ extern "C" void
+ __cxa_vec_cctor(void *dest_array,
+ void *src_array,
+ std::size_t element_count,
+ std::size_t element_size,
+ void (*constructor) (void *, void *),
+ void (*destructor) (void *))
+ {
+ std::size_t ix = 0;
+ char *dest_ptr = static_cast<char *>(dest_array);
+ char *src_ptr = static_cast<char *>(src_array);
+
+ try
{
- uncatch_exception ue;
- __cxa_vec_dtor (array_address, ix, element_size, destructor);
+ if (constructor)
+ for (; ix != element_count;
+ ix++, src_ptr += element_size, dest_ptr += element_size)
+ constructor(dest_ptr, src_ptr);
}
- throw;
- }
-}
-
-/* construct an array by copying */
-
-extern "C" void
-__cxa_vec_cctor (void *dest_array,
- void *src_array,
+ catch (...)
+ {
+ {
+ uncatch_exception ue;
+ __cxa_vec_cleanup(dest_array, ix, element_size, destructor);
+ }
+ __throw_exception_again;
+ }
+ }
+
+ // Destruct array.
+ extern "C" void
+ __cxa_vec_dtor(void *array_address,
std::size_t element_count,
std::size_t element_size,
- void (*constructor) (void *, void *),
void (*destructor) (void *))
-{
- std::size_t ix = 0;
- char *dest_ptr = static_cast <char *> (dest_array);
- char *src_ptr = static_cast <char *> (src_array);
-
- try
- {
- if (constructor)
- for (; ix != element_count;
- ix++, src_ptr += element_size, dest_ptr += element_size)
- constructor (dest_ptr, src_ptr);
- }
- catch (...)
- {
+ {
+ if (destructor)
{
- uncatch_exception ue;
- __cxa_vec_dtor (dest_array, ix, element_size, destructor);
- }
- throw;
- }
-}
+ char *ptr = static_cast<char *>(array_address);
+ std::size_t ix = element_count;
-/* destruct array */
-extern "C" void
-__cxa_vec_dtor (void *array_address,
- std::size_t element_count,
- std::size_t element_size,
- void (*destructor) (void *))
-{
- if (destructor)
- {
- char *ptr = static_cast <char *> (array_address);
- std::size_t ix = element_count;
- bool unwinding = std::uncaught_exception ();
-
- ptr += element_count * element_size;
-
- try
- {
- while (ix--)
- {
- ptr -= element_size;
- destructor (ptr);
- }
- }
- catch (...)
- {
- if (unwinding)
- // [except.ctor]/3 If a destructor called during stack unwinding
- // exits with an exception, terminate is called.
- std::terminate ();
+ ptr += element_count * element_size;
+
+ try
{
- uncatch_exception ue;
- __cxa_vec_dtor (array_address, ix, element_size,
- destructor);
+ while (ix--)
+ {
+ ptr -= element_size;
+ destructor(ptr);
+ }
}
- throw;
- }
- }
-}
+ catch (...)
+ {
+ {
+ uncatch_exception ue;
+ __cxa_vec_cleanup(array_address, ix, element_size, destructor);
+ }
+ __throw_exception_again;
+ }
+ }
+ }
-/* destruct and release array */
-extern "C" void
-__cxa_vec_delete (void *array_address,
- std::size_t element_size,
- std::size_t padding_size,
- void (*destructor) (void *))
-{
- __cxa_vec_delete2 (array_address, element_size, padding_size,
- destructor,
- &operator delete []);
-}
+ // Destruct array as a result of throwing an exception.
+ // [except.ctor]/3 If a destructor called during stack unwinding
+ // exits with an exception, terminate is called.
+ extern "C" void
+ __cxa_vec_cleanup(void *array_address,
+ std::size_t element_count,
+ std::size_t element_size,
+ void (*destructor) (void *))
+ {
+ if (destructor)
+ {
+ char *ptr = static_cast <char *> (array_address);
+ std::size_t ix = element_count;
-extern "C" void
-__cxa_vec_delete2 (void *array_address,
- std::size_t element_size,
- std::size_t padding_size,
- void (*destructor) (void *),
- void (*dealloc) (void *))
-{
- char *base = static_cast <char *> (array_address);
-
- if (padding_size)
- {
- std::size_t element_count = reinterpret_cast <std::size_t *> (base)[-1];
- base -= padding_size;
- try
- {
- __cxa_vec_dtor (array_address, element_count, element_size,
- destructor);
- }
- catch (...)
- {
+ ptr += element_count * element_size;
+
+ try
{
- uncatch_exception ue;
- dealloc (base);
+ while (ix--)
+ {
+ ptr -= element_size;
+ destructor(ptr);
+ }
}
- throw;
- }
- }
- dealloc (base);
-}
+ catch (...)
+ {
+ std::terminate();
+ }
+ }
+ }
-extern "C" void
-__cxa_vec_delete3 (void *array_address,
- std::size_t element_size,
- std::size_t padding_size,
- void (*destructor) (void *),
- void (*dealloc) (void *, std::size_t))
-{
- char *base = static_cast <char *> (array_address);
- std::size_t size = 0;
+ // Destruct and release array.
+ extern "C" void
+ __cxa_vec_delete(void *array_address,
+ std::size_t element_size,
+ std::size_t padding_size,
+ void (*destructor) (void *))
+ {
+ __cxa_vec_delete2(array_address, element_size, padding_size,
+ destructor,
+ &operator delete []);
+ }
+
+ extern "C" void
+ __cxa_vec_delete2(void *array_address,
+ std::size_t element_size,
+ std::size_t padding_size,
+ void (*destructor) (void *),
+ void (*dealloc) (void *))
+ {
+ char *base = static_cast<char *>(array_address);
- if (padding_size)
- {
- std::size_t element_count = reinterpret_cast <std::size_t *> (base)[-1];
- base -= padding_size;
- size = element_count * element_size + padding_size;
- try
- {
- __cxa_vec_dtor (array_address, element_count, element_size,
- destructor);
- }
- catch (...)
- {
+ if (padding_size)
+ {
+ std::size_t element_count = reinterpret_cast<std::size_t *>(base)[-1];
+ base -= padding_size;
+ try
{
- uncatch_exception ue;
- dealloc (base, size);
+ __cxa_vec_dtor(array_address, element_count, element_size,
+ destructor);
}
- throw;
- }
- }
- dealloc (base, size);
-}
+ catch (...)
+ {
+ {
+ uncatch_exception ue;
+ dealloc(base);
+ }
+ __throw_exception_again;
+ }
+ }
+ dealloc(base);
+ }
+ extern "C" void
+ __cxa_vec_delete3(void *array_address,
+ std::size_t element_size,
+ std::size_t padding_size,
+ void (*destructor) (void *),
+ void (*dealloc) (void *, std::size_t))
+ {
+ char *base = static_cast <char *> (array_address);
+ std::size_t size = 0;
+
+ if (padding_size)
+ {
+ std::size_t element_count = reinterpret_cast<std::size_t *> (base)[-1];
+ base -= padding_size;
+ size = element_count * element_size + padding_size;
+ try
+ {
+ __cxa_vec_dtor(array_address, element_count, element_size,
+ destructor);
+ }
+ catch (...)
+ {
+ {
+ uncatch_exception ue;
+ dealloc(base, size);
+ }
+ __throw_exception_again;
+ }
+ }
+ dealloc(base, size);
+ }
} // namespace __cxxabiv1
-#endif // defined(__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100
diff --git a/libstdc++-v3/mkcheck.in b/libstdc++-v3/mkcheck.in
index d97289e21b3..6d9ef1df914 100755
--- a/libstdc++-v3/mkcheck.in
+++ b/libstdc++-v3/mkcheck.in
@@ -1,6 +1,5 @@
#!/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
@@ -9,15 +8,7 @@
# has been enabled.
# Invocation
-# mkcheck [01] (path to build) (path to src) (path to install)
-
-### XXX There are a lot of tests in here for OS-specific stuff. If we
-### move to a 'configure.target' method of determining those extra
-### flags and whatnot, we can take out all those things and source
-### that file from here. (Write that file with this in mind...)
-
-### XXX Note that breaking out of this with ^C will not work. Dunno why.
-
+# mkcheck [01]
# 1: variables
#
@@ -25,17 +16,15 @@
# (0) testing the build binary and headers, or
# (1) testing the installed binary and headers, or
WHICH=$1
-if [ "$WHICH"x = 0x ] && [ $# -eq 3 ]; then
+if [ "$WHICH"x = 0x ]; then
echo "running mkcheck"
echo "$0: testing the build directory"
- query="--built-library"
-elif [ "$WHICH"x = 1x ] && [ $# -eq 4 ]; then
+elif [ "$WHICH"x = 1x ]; then
echo "running mkcheck"
- echo "$0: testing the install directory $4"
- query="--installed-library"
+ echo "$0: testing the install directory"
else
- echo 'Usage: mkcheck 0 (path to build) (path to src)'
- echo ' mkcheck 1 (path to build) (path to src) (path to install)'
+ echo 'Usage: mkcheck 0 /* test the build directory */'
+ echo ' mkcheck 1 /* test the install directory */'
exit 1;
fi
@@ -49,32 +38,32 @@ case $BASH_VERSION in
*) ;; # ??
esac
-# Compute the flags necessary to run the testsuite.
-saved_ifs=$IFS
-IFS=':'
-set `../tests_flags ${query} $*` || exit 1
-BUILD_DIR=$1; SRC_DIR=$2; PREFIX_DIR=$3; CXX=$4; CXXFLAGS=$5; INCLUDES=$6; LIBS=$7;
-IFS=$saved_ifs
-
-# Build libtoolized surrogates to compile and run testcases. Also,
-# adjust CXX so that the newly built compiler can find headers.
-if [ x$WHICH = x0 ] ; then
- CXX="$CXX -B`dirname $CXX`/"
+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 $LIBS"
+#LTCXX="$LIBTOOL --tag=CXX --mode=link $CXX $CXXFLAGS $INCLUDES"
+LTCXX="$CXX $CXXFLAGS $INCLUDES"
-# specific libtool flag(s) to force the use of shared libraries, if any
-SH_FLAG=
+# 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 force the use of static libraries, if any
+# 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='.'
+TEST_DIR="$BUILD_DIR/testsuite"
# help libtool keep quiet
if [ ! -d ${TEST_DIR}/.libs ]; then
mkdir $TEST_DIR/.libs
@@ -99,6 +88,7 @@ MAX_MEM_USAGE=16384
# 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*
@@ -194,9 +184,9 @@ setup_size_command()
function size_command()
{
case $1 in
- TEXT) TEXT=$(size -A $EXENAME | grep ^.text | awk '{print $2}') ;;
- DATA) DATA=$(size -A $EXENAME | grep -w ^.data | awk '{print $2}') ;;
- SIZE) SIZE=$(size -A $EXENAME | grep otal | awk '{print $2}') ;;
+ 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
@@ -214,6 +204,16 @@ setup_size_command()
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()
{
@@ -318,6 +318,7 @@ test_file()
# eventually have to calculate time_t anyhow. Or 3) just grab two
# time_t's (no more overhead than grabbing two date(1)'s).
compiler_invocation="$LTCXX $S_FLAG $SRC_NAME -o $EXENAME"
+ echo $compiler_invocation >> compile.out 2>&1
COMP_TIME_START=$($TIMER_COMMAND)
$compiler_invocation >> compile.out 2>&1
COMP_TIME_END=$($TIMER_COMMAND)
@@ -329,7 +330,7 @@ test_file()
fi
if [ -f $EXENAME ]; then
- rm compile.out
+# rm compile.out
size_command TEXT
size_command DATA
size_command SIZE
@@ -367,8 +368,8 @@ test_file()
else
# the file did not compile/link.
printf "\n" >> $LOG_FILE
- `cat compile.out >> $LOG_FILE`
- rm compile.out
+# `cat compile.out >> $LOG_FILE`
+# rm compile.out
RESULT="-b"
TEXT="0"
DATA="0"
@@ -392,8 +393,7 @@ test_file()
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 "$S_FLAG" \
- >> $RESULTS_FILE
+ "$RESULT" $C_TIME $E_TIME $TEXT $DATA $SIZE $NAME >> $RESULTS_FILE
}
setup_size_command
@@ -436,7 +436,7 @@ TEST_TIME_END=$($TIMER_COMMAND)
# 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: ${shared_pass}/${shared_fail} shared + ${static_pass}/${static_fail} static = ${total_successes}/${total_failures} total"
+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
@@ -451,5 +451,3 @@ if [ $TEST_TIME_START -lt $TEST_TIME_END ]; then
fi
exit 0
-
-
diff --git a/libstdc++-v3/mknumeric_limits b/libstdc++-v3/mknumeric_limits
index 918743f30d3..220d8f0ac0d 100755
--- a/libstdc++-v3/mknumeric_limits
+++ b/libstdc++-v3/mknumeric_limits
@@ -8,21 +8,6 @@
echo "running mknumeric_limits"
-case `uname` in
- CYGWIN*)
- LDFLAGS='-nodefaultlibs -lcygwin -lc -lkernel32 -lgcc' ;;
- AIX*)
- case $CXX in
- *pthread*)
- LDFLAGS='-nodefaultlibs -lgcc -L/usr/lib/threads -lpthreads -lc_r /usr/lib/libc.a' ;;
- *)
- LDFLAGS='-nodefaultlibs -lgcc -lc' ;;
- esac
- ;;
- *)
- LDFLAGS='-nodefaultlibs -lgcc -lc' ;;
-esac
-
BUILD_DIR=$1
if [ ! -d "$BUILD_DIR" ]; then
echo "build directory $BUILD_DIR not found, exiting."
@@ -62,14 +47,14 @@ if [ $XCOMPILE -eq 1 ]; then
exit 0;
fi
-: ${CXX:="$BUILD_DIR/../../gcc/g++ -B$BUILD_DIR/../../gcc/"}
+CC=${CC="$BUILD_DIR/../../gcc/xgcc -B$BUILD_DIR/../../gcc/"}
# We output to a temporary file, so that we don't appear to have
# succeeded unless we actually do.
cat <<EOF > $OUT_H-t
// The template and inlines for the -*- C++ -*- numeric_limits classes.
-// Copyright (C) 1999, 2000 Free Software Foundation, Inc.
+// Copyright (C) 1999-2001 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
@@ -178,19 +163,22 @@ namespace std {
EOF
-echo "$CXX -I. $CPPFLAGS -I$BUILD_DIR/include -DHAVE_CONFIG_H \
- -o "$BUILD_DIR/src/gen-num-limits" "$SRC_DIR/src/gen-num-limits.cc" \
- $LDFLAGS"
+# Must turn off exceptions, because the C++ exception handling support
+# routines have not been built yet.
+echo "$CC -I$BUILD_DIR -fno-exceptions \
+ -o $BUILD_DIR/src/gen-num-limits $SRC_DIR/src/gen-num-limits.cc"
-{ $CXX -I. $CPPFLAGS -I$BUILD_DIR/include -DHAVE_CONFIG_H \
- -o "$BUILD_DIR/src/gen-num-limits" "$SRC_DIR/src/gen-num-limits.cc" \
- $LDFLAGS
+{ $CC -I$BUILD_DIR -fno-exceptions \
+ -o "$BUILD_DIR/src/gen-num-limits" "$SRC_DIR/src/gen-num-limits.cc"
} || {
echo "gen-num-limits failed to build, exiting."
exit 1
}
-"$BUILD_DIR/src/gen-num-limits" >> $OUT_H-t
+"$BUILD_DIR/src/gen-num-limits" >> $OUT_H-t || {
+ echo "gen-num-limits failed to execute, exiting."
+ exit 1
+}
cat <<EOF >> $OUT_H-t
} // namespace std
diff --git a/libstdc++-v3/porting.texi b/libstdc++-v3/porting.texi
index 166876c3315..9114806b63f 100644
--- a/libstdc++-v3/porting.texi
+++ b/libstdc++-v3/porting.texi
@@ -1,15 +1,3 @@
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% File: porting.texi
-% Author: Mark Mitchell
-% Date: 11/21/2000
-%
-% Contents:
-%
-% Copyright (c) 2000 by Free Software Foundation, Inc.
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
\input texinfo
@c ---------------------------------------------------------------------
@@ -24,7 +12,7 @@
This file explains how to port libstdc++-v3 (the GNU C++ library) to
a new target.
-Copyright (c) 2000 Free Software Foundation, Inc.
+Copyright (c) 2000, 2001 Free Software Foundation, Inc.
@end ifinfo
@c ---------------------------------------------------------------------
@@ -36,7 +24,25 @@ Copyright (c) 2000 Free Software Foundation, Inc.
@author Mark Mitchell
@page
@vskip 0pt plus 1filll
-Copyright @copyright{} 2000 Free Software Foundation, Inc.
+Copyright @copyright{} 2000, 2001 Free Software Foundation, Inc.
+
+Permission is granted to copy, distribute and/or modify this document
+under the terms of the GNU Free Documentation License, Version 1.1 or
+any later version published by the Free Software Foundation; with the
+Invariant Sections being ``GNU General Public License'', the Front-Cover
+texts being (a) (see below), and with the Back-Cover Texts being (b)
+(see below). A copy of the license is included in the section entitled
+``GNU Free Documentation License''.
+
+(a) The FSF's Front-Cover Text is:
+
+ A GNU Manual
+
+(b) The FSF's Back-Cover Text is:
+
+ You have freedom to copy and modify this GNU Manual, like GNU
+ software. Copies published by the Free Software Foundation raise
+ funds for GNU development.
@end titlepage
@c ---------------------------------------------------------------------
@@ -68,7 +74,9 @@ Here are the primary steps required to port the library:
* Operating system:: Configuring for your operating system.
* Character types:: Implementing character classification.
* Thread safety:: Implementing atomic operations.
+* Numeric limits:: Implementing numeric limits.
* Libtool:: Using libtool.
+* GNU Free Documentation License:: How you can copy and share this manual.
@end menu
@c ---------------------------------------------------------------------
@@ -119,17 +127,33 @@ provide these macros. Note that this file does not have to include a
header file that defines @code{off_t}, or the other types; you simply
have to provide the macros.
-In addition, several libstdc++-v3 source files unconditionally define the macro
-@code{_POSIX_SOURCE}. On many systems, defining this macro causes large
-portions of the C library header files to be eliminated at preprocessing
-time. Therefore, you may have to @code{#undef} this macro, or define
-other macros (like @code{_LARGEFILE_SOURCE} or @code{__EXTENSIONS__}).
-You won't know what macros to define or undefine at this point; you'll
-have to try compiling the library and seeing what goes wrong. If you
-see errors about calling functions that have not been declared, look in
-your C library headers to see if the functions are declared there, and
-then figure out what macros you should but in @file{bits/os_defines.h}
-to make these declarations available.
+In addition, several libstdc++-v3 source files unconditionally define
+the macro @code{_POSIX_SOURCE}. On many systems, defining this macro
+causes large portions of the C library header files to be eliminated
+at preprocessing time. Therefore, you may have to @code{#undef} this
+macro, or define other macros (like @code{_LARGEFILE_SOURCE} or
+@code{__EXTENSIONS__}). You won't know what macros to define or
+undefine at this point; you'll have to try compiling the library and
+seeing what goes wrong. If you see errors about calling functions
+that have not been declared, look in your C library headers to see if
+the functions are declared there, and then figure out what macros you
+need to define. You will need to add them to the
+@code{CPLUSPLUS_CPP_SPEC} macro in the GCC configuration file for your
+target. It will not work to simply define these macros in
+@file{os_defines.h}.
+
+At this time, there are two libstdc++-v3-specific macros which may be
+defined. @code{_G_USING_THUNKS} may be defined to 0 to express that the
+port doesn't use thunks (although it is unclear that this is still
+useful since libio support isn't currently working and the g++ v3 ABI
+invalidates the assumption that some ports don't use thunks).
+@code{_GLIBCPP_AVOID_FSEEK} may be defined if seeking on an interactive
+stream (or one hooked to a pipe) is not allowed by the OS. In this
+case, getc()/ungetc() will be used at some key locations in the library
+implementation instead of fseek(). Currently, the code path to avoid
+fseek() is only enabled when the seek size is 1 character away from the
+current stream position. This is known to improve *-unknown-freebsd*
+and sparc-sun-solaris2.*.
Finally, you should bracket the entire file in an include-guard, like
this:
@@ -414,6 +438,31 @@ __atomic_add (_Atomic_word* __mem, int __val)
@end example
@c ---------------------------------------------------------------------
+@c Numeric limits
+@c ---------------------------------------------------------------------
+
+@node Numeric limits
+@chapter Numeric limits
+
+The C++ library requires information about the fundamental data types,
+such as the minimum and maximum representable values of each type.
+You can define each of these values individually, but it is usually
+easiest just to indicate how many bits are used in each of the data
+types and let the library do the rest. For information about the
+macros to define, see the top of @file{include/bits/std_limits.h}.
+
+If you need to define any macros, you can do so in
+@file{os_defines.h}. However, if all operating systems for your CPU
+are likely to use the same values, you can provide a CPU-specific file
+instead so that you do not have to provide the same definitions for
+each operating system. To take that approach, create a new file
+called @file{limits.h} in your CPU configuration directory (e.g.,
+@file{config/cpu/i386/bits}) and then modify @file{configure.target}
+so that @code{LIMITSH} is set to the CPU directory (e.g.,
+@file{config/cpu/i386}). Note that @code{LIMITSH} should not include
+the @samp{bits} part of the directory name.
+
+@c ---------------------------------------------------------------------
@c Libtool
@c ---------------------------------------------------------------------
@@ -448,6 +497,12 @@ that sets @code{archive_cmds}. Here, adjust the setting for your
operating system.
@c ---------------------------------------------------------------------
+@c GFDL
+@c ---------------------------------------------------------------------
+
+@include fdl.texi
+
+@c ---------------------------------------------------------------------
@c Epilogue
@c ---------------------------------------------------------------------
diff --git a/libstdc++-v3/src/Makefile.am b/libstdc++-v3/src/Makefile.am
index 788f968fe4b..651f2972282 100644
--- a/libstdc++-v3/src/Makefile.am
+++ b/libstdc++-v3/src/Makefile.am
@@ -1,4 +1,4 @@
-## Makefile for the src subdirectory of the GNU C++ Standard library.
+# Makefile for the src subdirectory of the GNU C++ Standard library.
##
## Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
##
@@ -21,7 +21,7 @@
## Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
## USA.
-## $Id: Makefile.am,v 1.70 2001/02/07 01:54:21 bkoz Exp $
+## $Id: Makefile.am,v 1.71.2.13 2001/09/10 20:11:06 bkoz Exp $
AUTOMAKE_OPTIONS = 1.3 gnits
MAINT_CHARSET = latin1
@@ -29,11 +29,10 @@ MAINT_CHARSET = latin1
mkinstalldirs = $(SHELL) $(toplevel_srcdir)/mkinstalldirs
# Cross compiler and multilib support.
+CXX = @glibcpp_CXX@
toolexecdir = @glibcpp_toolexecdir@
toolexeclibdir = @glibcpp_toolexeclibdir@
toolexeclib_LTLIBRARIES = libstdc++.la
-EXTRA_LTLIBRARIES = libinst-string.la libinst-wstring.la
-
# Compile flags that should be constant throughout the build, both for
# SUBDIRS and for libstdc++-v3 in general.
@@ -47,12 +46,10 @@ CONFIG_CXXFLAGS = \
# Warning flags to use.
WARN_CXXFLAGS = \
- @WARN_FLAGS@ $(WERROR) @WFMT_FLAGS@
+ @WARN_FLAGS@ $(WERROR) -fdiagnostics-show-location=once
# Use common includes from acinclude.m4/GLIBCPP_EXPORT_INCLUDES
-GLIBCPP_INCLUDE_DIR = @GLIBCPP_INCLUDE_DIR@
-C_INCLUDE_DIR = @C_INCLUDE_DIR@
-CSTD_INCLUDES = @CSTD_INCLUDES@
+GLIBCPP_INCLUDES = @GLIBCPP_INCLUDES@
LIBMATH_INCLUDES = @LIBMATH_INCLUDES@
LIBSUPCXX_INCLUDES = @LIBSUPCXX_INCLUDES@
LIBIO_INCLUDES = @LIBIO_INCLUDES@
@@ -60,261 +57,49 @@ TOPLEVEL_INCLUDES = @TOPLEVEL_INCLUDES@
INCLUDES = \
-nostdinc++ \
- -I$(GLIBCPP_INCLUDE_DIR) $(CSTD_INCLUDES) -I$(top_builddir)/include \
+ $(GLIBCPP_INCLUDES) \
$(LIBSUPCXX_INCLUDES) $(LIBIO_INCLUDES) $(LIBMATH_INCLUDES) \
- $(TOPLEVEL_INCLUDES)
-
-base_headers = \
- bits/cpp_type_traits.h bits/char_traits.h bits/codecvt.h \
- bits/stringfwd.h bits/std_string.h bits/basic_string.h \
- bits/basic_string.tcc \
- bits/generic_shadow.h bits/std_utility.h \
- bits/std_complex.h \
- bits/valarray_array.h bits/valarray_array.tcc bits/valarray_meta.h \
- bits/std_valarray.h bits/mask_array.h bits/slice.h bits/slice_array.h \
- bits/gslice.h bits/gslice_array.h bits/indirect_array.h \
- bits/exception_support.h \
- bits/std_fstream.h bits/std_iomanip.h \
- bits/ios_base.h bits/fpos.h bits/basic_ios.h bits/basic_ios.tcc \
- bits/std_ios.h bits/std_iosfwd.h bits/std_iostream.h \
- bits/std_istream.h bits/istream.tcc bits/std_locale.h \
- bits/fstream.tcc bits/ostream.tcc bits/sbuf_iter.h bits/sstream.tcc \
- bits/std_ostream.h bits/std_sstream.h bits/std_streambuf.h \
- bits/streambuf.tcc bits/basic_file.h \
- bits/locale_facets.h bits/locale_facets.tcc bits/localefwd.h \
- bits/stl_pthread_alloc.h bits/pthread_allocimpl.h \
- bits/stl_threads.h bits/stl_iterator_base.h \
- bits/std_bitset.h bits/std_deque.h bits/std_functional.h \
- bits/std_iterator.h bits/std_list.h \
- bits/std_map.h bits/std_memory.h bits/std_numeric.h \
- bits/std_queue.h bits/std_set.h bits/std_stack.h \
- bits/std_stdexcept.h bits/std_vector.h \
- bits/stl_algo.h bits/stl_algobase.h bits/stl_alloc.h \
- bits/stl_deque.h bits/stl_function.h \
- bits/stl_heap.h bits/stl_iterator.h bits/stl_list.h bits/stl_map.h \
- bits/stl_multimap.h bits/stl_multiset.h bits/stl_numeric.h \
- bits/stl_pair.h bits/stl_queue.h bits/stl_raw_storage_iter.h \
- bits/stl_relops.h bits/stl_set.h \
- bits/stl_stack.h bits/stl_tempbuf.h \
- bits/stl_tree.h bits/stl_uninitialized.h bits/stl_vector.h \
- bits/type_traits.h bits/stl_range_errors.h bits/std_algorithm.h \
- bits/concept_checks.h bits/container_concepts.h \
- bits/sequence_concepts.h bits/stl_config.h bits/stl_construct.h
-
-backward_headers = \
- backward/complex.h backward/iomanip.h backward/istream.h \
- backward/ostream.h backward/stream.h backward/streambuf.h \
- backward/algo.h backward/algobase.h backward/alloc.h \
- backward/bvector.h backward/defalloc.h backward/deque.h \
- backward/function.h backward/hash_map.h backward/hash_set.h \
- backward/hashtable.h backward/heap.h backward/iterator.h \
- backward/list.h backward/map.h backward/multimap.h backward/new.h \
- backward/multiset.h backward/pair.h backward/iostream.h \
- backward/rope.h backward/set.h backward/slist.h backward/stack.h \
- backward/tempbuf.h backward/tree.h backward/vector.h \
- backward/fstream.h backward/strstream.h backward/strstream
-
-ext_headers = \
- ext/ropeimpl.h ext/stl_rope.h \
- ext/stl_bvector.h ext/stl_hashtable.h ext/stl_hash_fun.h \
- ext/hash_map ext/hash_set ext/rope ext/slist \
- ext/tree ext/bvector
-
-c_base_headers = \
- bits/std_cassert.h bits/std_cctype.h bits/std_cerrno.h \
- bits/std_cfloat.h bits/std_climits.h bits/std_clocale.h \
- bits/std_cmath.h bits/std_csetjmp.h bits/std_csignal.h \
- bits/std_cstdarg.h bits/std_cstddef.h bits/std_cstdio.h \
- bits/std_cstdlib.h bits/std_cstring.h bits/std_ctime.h \
- bits/std_cwchar.h bits/std_cwctype.h bits/cmath.tcc
-
-if GLIBCPP_USE_CSHADOW
-c_shadow_headers = \
- assert.h ctype.h errno.h float.h limits.h locale.h math.h setjmp.h \
- signal.h stdarg.h stddef.h stdio.h stdlib.h string.h time.h wchar.h \
- wctype.h fcntl.h libio.h iolibio.h libioP.h pthread.h iconv.h \
- features.h langinfo.h \
- bits/wrap_libio.h bits/wrap_iolibio.h bits/wrap_libioP.h \
- bits/wrap_iconv.h bits/wrap_fcntl.h bits/wrap_pthread.h \
- bits/wrap_features.h bits/wrap_langinfo.h \
- sys/cdefs.h
-else
-c_shadow_headers =
-endif
-
-std_headers = \
- algorithm bitset complex deque fstream functional \
- iomanip ios iosfwd iostream istream iterator limits list locale \
- map memory numeric ostream queue set sstream stack stdexcept \
- streambuf string utility valarray vector \
- cassert cctype cerrno cfloat climits clocale ciso646 \
- cmath csetjmp csignal cstdarg cstddef cstdio cstdlib \
- cstring ctime cwchar cwctype
-
-if GLIBCPP_NEED_LIBIO
-libio_headers = \
- $(top_srcdir)/libio/_G_config.h $(top_srcdir)/libio/libio.h
-else
-libio_headers =
-endif
-
-build_headers = \
- bits/std_limits.h \
- bits/c++config.h bits/c++io.h bits/c++locale.h bits/c++threads.h \
- bits/atomicity.h bits/os_defines.h \
- bits/ctype_base.h bits/ctype_noninline.h bits/ctype_inline.h
+ $(TOPLEVEL_INCLUDES)
sources = \
- limitsMEMBERS.cc \
- complex_io.cc \
- stdexcept.cc bitset.cc \
- globals.cc \
- c++io.cc ios.cc strstream.cc \
- c++locale.cc locale.cc localename.cc codecvt.cc \
- locale-inst.cc stl-inst.cc misc-inst.cc valarray-inst.cc string-inst.cc
-
-wstring_sources = \
+ basic_file.cc bitset.cc c++locale.cc cmath.cc codecvt.cc \
+ complex_io.cc functexcept.cc globals.cc ios.cc limits.cc \
+ locale.cc locale-inst.cc localename.cc misc-inst.cc stdexcept.cc \
+ stl-inst.cc string-inst.cc strstream.cc valarray-inst.cc \
wstring-inst.cc
-VPATH += $(top_srcdir) $(top_srcdir)/src
-VPATH += $(GLIBCPP_INCLUDE_DIR)
-VPATH += $(GLIBCPP_INCLUDE_DIR)/std $(C_INCLUDE_DIR)
-# Actual sources for the distro, but don't build these.
-#EXTRA_sources = string-inst.cc
+VPATH = $(top_srcdir):$(top_srcdir)/src
libstdc___la_SOURCES = $(sources)
-libinst_wstring_la_SOURCES = $(wstring_sources)
-
libstdc___la_LIBADD = \
../libmath/libmath.la @libio_la@ \
- ../libsupc++/libsupc++convenience.la \
- @libinst_wstring_la@
+ ../libsupc++/libsupc++convenience.la
-libstdc___la_LDFLAGS = -version-info 3:0:0 -lm
+libstdc___la_LDFLAGS = -version-info 3:4:0 -lm
libstdc___la_DEPENDENCIES = $(libstdc___la_LIBADD)
-# Make sure cshadow headers are built first.
-if GLIBCPP_USE_CSHADOW
-CSHADOW_H = $(top_builddir)/stamp-cshadow
-else
-CSHADOW_H =
-endif
-
-# Specify that all *.o's depend on this.
-$(libstdc___la_OBJECTS): $(CSHADOW_H)
-
-$(top_builddir)/stamp-cshadow: $(top_srcdir)/mkinclosure \
- $(top_srcdir)/mkcshadow
- $(top_srcdir)/mkinclosure \
- "-I $(top_builddir)/../../gcc/include -I /usr/include -G fcntl.h unistd.h" | $(top_srcdir)/mkcshadow;
- rm -f $(top_builddir)/stamp-cshadow
- echo "done" > $(top_builddir)/stamp-cshadow
-
-
-# Check for various configure bits that change where the headers get installed.
-gxx_include_dir = @gxx_include_dir@
-gxx_target_include_dir = $(gxx_include_dir)/$(target_alias)
-
-# We have our own special, ridiculously complicated installation routine
-# here, as automake/autoconf is currently brain-damaged when it comes
-# to installing sub-directories of headers. In particular, we want to
-# 1) install build headers from (blddir)/include/bits -> (install)/bits
-# 2) install source headers from
-# (srcdir)/include/bits -> (install)/bits
-# (srcdir)/include/ext -> (install)/ext
-# (srcdir)/include/backward -> (install)/backward
-# ... and the always entertaining "C" compatibility bits
-# where * represents configure-time directory switching
-# (srcdir)/include/c* -> (install)/
-# (srcdir)/include/c*/bits -> (install)/bits
-# (srcdir)/include/c*/sys -> (install)/sys
-install-data-local: myinstalldirs myinstallheaders
-
-# NB: installation of shadow header directories is not attempted.
-myinstalldirs:
- if test -z "$(MULTISUBDIR)"; then \
- $(mkinstalldirs) $(DESTDIR)$(gxx_include_dir)/bits; \
- $(mkinstalldirs) $(DESTDIR)$(gxx_include_dir)/ext; \
- $(mkinstalldirs) $(DESTDIR)$(gxx_target_include_dir)/bits; \
- fi
-
-# NB: As libio_headers may be empty, need this to make sure bash doesn't
-# choke on an empty for... loop by using libio_headers_install
-# NB: installation of shadow headers is not attempted.
-src_incdir = @GLIBCPP_INCLUDE_DIR@
-bld_incdir = $(top_builddir)/include
-c_incdir = @C_INCLUDE_DIR@
-myinstallheaders:
- if test -z "$(MULTISUBDIR)"; then \
- for i in $(base_headers); do \
- echo "$(INSTALL_DATA) $(src_incdir)/$$i $(gxx_include_dir)/bits/"; \
- $(INSTALL_DATA) $(src_incdir)/$$i $(gxx_include_dir)/bits/; \
- done; \
- for i in $(ext_headers); do \
- echo "$(INSTALL_DATA) $(src_incdir)/$$i $(gxx_include_dir)/ext/"; \
- $(INSTALL_DATA) $(src_incdir)/$$i $(gxx_include_dir)/ext/; \
- done; \
- for i in $(backward_headers); do \
- echo "$(INSTALL_DATA) $(src_incdir)/$$i $(gxx_include_dir)"; \
- $(INSTALL_DATA) $(src_incdir)/$$i $(gxx_include_dir); \
- done; \
- for i in $(c_base_headers); do \
- echo "$(INSTALL_DATA) $(c_incdir)/$$i $(gxx_include_dir)/bits/"; \
- $(INSTALL_DATA) $(c_incdir)/$$i $(gxx_include_dir)/bits/; \
- done; \
- for i in $(std_headers); do \
- echo "$(INSTALL_DATA) $(src_incdir)/std/$$i $(gxx_include_dir)";\
- $(INSTALL_DATA) $(src_incdir)/std/$$i $(gxx_include_dir); \
- done; \
- for i in $(build_headers); do \
- echo "$(INSTALL_DATA) $(bld_incdir)/$$i $(gxx_target_include_dir)/bits/"; \
- $(INSTALL_DATA) $(bld_incdir)/$$i $(gxx_target_include_dir)/bits/; \
- done; \
- libio_headers_install='$(libio_headers)'; \
- for i in $$libio_headers_install; do \
- echo "$(INSTALL_DATA) $$i $(gxx_include_dir)"; \
- $(INSTALL_DATA) $$i $(gxx_include_dir); \
- done; \
- fi;
-
-
# Use special rules for the deprecated source files so that they find
# deprecated include files.
+GLIBCPP_INCLUDE_DIR=@glibcpp_builddir@/include
strstream.lo: strstream.cc
$(LTCXXCOMPILE) -I$(GLIBCPP_INCLUDE_DIR)/backward -c $<
strstream.o: strstream.cc
$(CXXCOMPILE) -I$(GLIBCPP_INCLUDE_DIR)/backward -c $<
-# Make wstring-inst.cc from string-inst.cc
-wstring-inst.o: string-inst.cc
- $(CXXCOMPILE) -c -DC=wchar_t $< -o $@
-wstring-inst.lo: string-inst.cc
- $(LTCXXCOMPILE) -c -DC=wchar_t $< -o $@
-
-
-# Alexandre put this in here for some libtool-related reason.
-all: libstdc++.INC
-libstdc++.INC: Makefile
- $(MAKE) \
- top_builddir=`CDPATH=:. && cd $(top_builddir) && pwd` \
- top_srcdir=`CDPATH=:. && cd $(top_srcdir) && pwd` \
- tmp-$@
- -rm -f $@
- mv tmp-$@ $@
-
-tmp-libstdc++.INC: Makefile
- echo $(INCLUDES) > $@
-
# AM_CXXFLAGS needs to be in each subdirectory so that it can be
# modified in a per-library or per-sub-library way. Need to manually
# set this option because CONFIG_CXXFLAGS has to be after
# OPTIMIZE_CXXFLAGS on the compile line so that -O2 can be overridden
# as the occasion call for it. (ie, --enable-debug)
+#
+# The no-implicit-templates flag will generate unresolved references to
+# the concept-checking symbols. So we must disable the checks while
+# actually building the library.
AM_CXXFLAGS = \
-fno-implicit-templates \
$(LIBSUPCXX_CXXFLAGS) \
@@ -344,9 +129,11 @@ AM_CXXFLAGS = \
LTCXXCOMPILE = $(LIBTOOL) --tag CXX --mode=compile $(CXX) $(INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(AM_CXXFLAGS)
-# 3) We have a problem when building the shared libstdc++ object if
-# the rules automake generates would be used. We cannot allow CXX to
-# be used in libtool since this would add -lstdc++ to the link line
-# which of course is problematic at this point.
-CXXLINK = $(LIBTOOL) --mode=link "$(CC)" \
+# 3) We'd have a problem when building the shared libstdc++ object if
+# the rules automake generates would be used. We cannot allow g++ to
+# be used since this would add -lstdc++ to the link line which of
+# course is problematic at this point. So, we get the top-level
+# directory to configure libstdc++-v3 to use gcc as the C++
+# compilation driver.
+CXXLINK = $(LIBTOOL) --tag CXX --mode=link $(CXX) \
@OPT_LDFLAGS@ @SECTION_LDFLAGS@ $(AM_CXXFLAGS) $(LDFLAGS) -o $@
diff --git a/libstdc++-v3/src/Makefile.in b/libstdc++-v3/src/Makefile.in
index f197451be7f..743cb6e9865 100644
--- a/libstdc++-v3/src/Makefile.in
+++ b/libstdc++-v3/src/Makefile.in
@@ -1,6 +1,6 @@
-# Makefile.in generated automatically by automake 1.4 from Makefile.am
+# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am
-# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
+# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -10,6 +10,8 @@
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
+# Makefile for the src subdirectory of the GNU C++ Standard library.
+
SHELL = @SHELL@
@@ -64,29 +66,35 @@ target_alias = @target_alias@
target_triplet = @target@
AR = @AR@
AS = @AS@
+ATOMICITY_INC_SRCDIR = @ATOMICITY_INC_SRCDIR@
+BASIC_FILE_H = @BASIC_FILE_H@
CC = @CC@
+CCODECVT_C = @CCODECVT_C@
+CLOCALE_H = @CLOCALE_H@
CPP = @CPP@
CSHADOW_FLAGS = @CSHADOW_FLAGS@
-CXX = @CXX@
+CSTDIO_H = @CSTDIO_H@
CXXCPP = @CXXCPP@
-CXX_libstdcxx = @CXX_libstdcxx@
+C_INCLUDE_DIR = @C_INCLUDE_DIR@
DEBUG_FLAGS = @DEBUG_FLAGS@
DLLTOOL = @DLLTOOL@
EXEEXT = @EXEEXT@
EXTRA_CXX_FLAGS = @EXTRA_CXX_FLAGS@
GCJ = @GCJ@
GCJFLAGS = @GCJFLAGS@
-GLIBCPP_CFLAGS = @GLIBCPP_CFLAGS@
-GLIBCPP_CXXFLAGS = @GLIBCPP_CXXFLAGS@
+GLIBCPP_IS_CROSS_COMPILING = @GLIBCPP_IS_CROSS_COMPILING@
LIBMATHOBJS = @LIBMATHOBJS@
LIBSTRINGOBJS = @LIBSTRINGOBJS@
+LIBSUPCXX_PICFLAGS = @LIBSUPCXX_PICFLAGS@
LIBTOOL = @LIBTOOL@
+LIMITS_INC_SRCDIR = @LIMITS_INC_SRCDIR@
LN_S = @LN_S@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OPT_LDFLAGS = @OPT_LDFLAGS@
+OS_INC_SRCDIR = @OS_INC_SRCDIR@
PACKAGE = @PACKAGE@
RANLIB = @RANLIB@
SECTION_FLAGS = @SECTION_FLAGS@
@@ -96,14 +104,18 @@ USE_COMPLEX_LONG_DOUBLE = @USE_COMPLEX_LONG_DOUBLE@
VERSION = @VERSION@
WARN_FLAGS = @WARN_FLAGS@
WERROR = @WERROR@
-WFMT_FLAGS = @WFMT_FLAGS@
enable_shared = @enable_shared@
enable_static = @enable_static@
+glibcpp_CXX = @glibcpp_CXX@
glibcpp_basedir = @glibcpp_basedir@
+glibcpp_builddir = @glibcpp_builddir@
+glibcpp_prefixdir = @glibcpp_prefixdir@
+glibcpp_srcdir = @glibcpp_srcdir@
+glibcpp_thread_h = @glibcpp_thread_h@
glibcpp_toolexecdir = @glibcpp_toolexecdir@
glibcpp_toolexeclibdir = @glibcpp_toolexeclibdir@
+gxx_include_dir = @gxx_include_dir@
ifGNUmake = @ifGNUmake@
-libinst_wstring_la = @libinst_wstring_la@
libio_la = @libio_la@
toplevel_srcdir = @toplevel_srcdir@
@@ -113,10 +125,10 @@ MAINT_CHARSET = latin1
mkinstalldirs = $(SHELL) $(toplevel_srcdir)/mkinstalldirs
# Cross compiler and multilib support.
+CXX = @glibcpp_CXX@
toolexecdir = @glibcpp_toolexecdir@
toolexeclibdir = @glibcpp_toolexeclibdir@
toolexeclib_LTLIBRARIES = libstdc++.la
-EXTRA_LTLIBRARIES = libinst-string.la libinst-wstring.la
# Compile flags that should be constant throughout the build, both for
# SUBDIRS and for libstdc++-v3 in general.
@@ -125,87 +137,69 @@ OPTIMIZE_CXXFLAGS = @OPTIMIZE_CXXFLAGS@
# These bits are all figured out from configure. Look in acinclude.m4
# or configure.in to see how they are set. See GLIBCPP_EXPORT_FLAGS
# NB: DEBUGFLAGS have to be at the end so that -O2 can be overridden.
-CONFIG_CXXFLAGS = @EXTRA_CXX_FLAGS@ @SECTION_FLAGS@ @CSHADOW_FLAGS@ @DEBUG_FLAGS@
+CONFIG_CXXFLAGS = \
+ @EXTRA_CXX_FLAGS@ @SECTION_FLAGS@ @CSHADOW_FLAGS@ @DEBUG_FLAGS@
# Warning flags to use.
-WARN_CXXFLAGS = @WARN_FLAGS@ $(WERROR) @WFMT_FLAGS@
+WARN_CXXFLAGS = \
+ @WARN_FLAGS@ $(WERROR) -fdiagnostics-show-location=once
# Use common includes from acinclude.m4/GLIBCPP_EXPORT_INCLUDES
-GLIBCPP_INCLUDE_DIR = @GLIBCPP_INCLUDE_DIR@
-C_INCLUDE_DIR = @C_INCLUDE_DIR@
-CSTD_INCLUDES = @CSTD_INCLUDES@
+GLIBCPP_INCLUDES = @GLIBCPP_INCLUDES@
LIBMATH_INCLUDES = @LIBMATH_INCLUDES@
LIBSUPCXX_INCLUDES = @LIBSUPCXX_INCLUDES@
LIBIO_INCLUDES = @LIBIO_INCLUDES@
TOPLEVEL_INCLUDES = @TOPLEVEL_INCLUDES@
-INCLUDES = -nostdinc++ -I$(GLIBCPP_INCLUDE_DIR) $(CSTD_INCLUDES) -I$(top_builddir)/include $(LIBSUPCXX_INCLUDES) $(LIBIO_INCLUDES) $(LIBMATH_INCLUDES) $(TOPLEVEL_INCLUDES)
-
-
-base_headers = bits/cpp_type_traits.h bits/char_traits.h bits/codecvt.h bits/stringfwd.h bits/std_string.h bits/basic_string.h bits/basic_string.tcc bits/generic_shadow.h bits/std_utility.h bits/std_complex.h bits/valarray_array.h bits/valarray_array.tcc bits/valarray_meta.h bits/std_valarray.h bits/mask_array.h bits/slice.h bits/slice_array.h bits/gslice.h bits/gslice_array.h bits/indirect_array.h bits/exception_support.h bits/std_fstream.h bits/std_iomanip.h bits/ios_base.h bits/fpos.h bits/basic_ios.h bits/basic_ios.tcc bits/std_ios.h bits/std_iosfwd.h bits/std_iostream.h bits/std_istream.h bits/istream.tcc bits/std_locale.h bits/fstream.tcc bits/ostream.tcc bits/sbuf_iter.h bits/sstream.tcc bits/std_ostream.h bits/std_sstream.h bits/std_streambuf.h bits/streambuf.tcc bits/basic_file.h bits/locale_facets.h bits/locale_facets.tcc bits/localefwd.h bits/stl_pthread_alloc.h bits/pthread_allocimpl.h bits/stl_threads.h bits/stl_iterator_base.h bits/std_bitset.h bits/std_deque.h bits/std_functional.h bits/std_iterator.h bits/std_list.h bits/std_map.h bits/std_memory.h bits/std_numeric.h bits/std_queue.h bits/std_set.h bits/std_stack.h bits/std_stdexcept.h bits/std_vector.h bits/stl_algo.h bits/stl_algobase.h bits/stl_alloc.h bits/stl_deque.h bits/stl_function.h bits/stl_heap.h bits/stl_iterator.h bits/stl_list.h bits/stl_map.h bits/stl_multimap.h bits/stl_multiset.h bits/stl_numeric.h bits/stl_pair.h bits/stl_queue.h bits/stl_raw_storage_iter.h bits/stl_relops.h bits/stl_set.h bits/stl_stack.h bits/stl_tempbuf.h bits/stl_tree.h bits/stl_uninitialized.h bits/stl_vector.h bits/type_traits.h bits/stl_range_errors.h bits/std_algorithm.h bits/concept_checks.h bits/container_concepts.h bits/sequence_concepts.h bits/stl_config.h bits/stl_construct.h
-
-
-backward_headers = backward/complex.h backward/iomanip.h backward/istream.h backward/ostream.h backward/stream.h backward/streambuf.h backward/algo.h backward/algobase.h backward/alloc.h backward/bvector.h backward/defalloc.h backward/deque.h backward/function.h backward/hash_map.h backward/hash_set.h backward/hashtable.h backward/heap.h backward/iterator.h backward/list.h backward/map.h backward/multimap.h backward/new.h backward/multiset.h backward/pair.h backward/iostream.h backward/rope.h backward/set.h backward/slist.h backward/stack.h backward/tempbuf.h backward/tree.h backward/vector.h backward/fstream.h backward/strstream.h backward/strstream
-
-
-ext_headers = ext/ropeimpl.h ext/stl_rope.h ext/stl_bvector.h ext/stl_hashtable.h ext/stl_hash_fun.h ext/hash_map ext/hash_set ext/rope ext/slist ext/tree ext/bvector
-
-
-c_base_headers = bits/std_cassert.h bits/std_cctype.h bits/std_cerrno.h bits/std_cfloat.h bits/std_climits.h bits/std_clocale.h bits/std_cmath.h bits/std_csetjmp.h bits/std_csignal.h bits/std_cstdarg.h bits/std_cstddef.h bits/std_cstdio.h bits/std_cstdlib.h bits/std_cstring.h bits/std_ctime.h bits/std_cwchar.h bits/std_cwctype.h bits/cmath.tcc
-
-@GLIBCPP_USE_CSHADOW_TRUE@c_shadow_headers = assert.h ctype.h errno.h float.h limits.h locale.h math.h setjmp.h signal.h stdarg.h stddef.h stdio.h stdlib.h string.h time.h wchar.h wctype.h fcntl.h libio.h iolibio.h libioP.h pthread.h iconv.h features.h langinfo.h bits/wrap_libio.h bits/wrap_iolibio.h bits/wrap_libioP.h bits/wrap_iconv.h bits/wrap_fcntl.h bits/wrap_pthread.h bits/wrap_features.h bits/wrap_langinfo.h sys/cdefs.h
-@GLIBCPP_USE_CSHADOW_FALSE@c_shadow_headers =
-
-std_headers = algorithm bitset complex deque fstream functional iomanip ios iosfwd iostream istream iterator limits list locale map memory numeric ostream queue set sstream stack stdexcept streambuf string utility valarray vector cassert cctype cerrno cfloat climits clocale ciso646 cmath csetjmp csignal cstdarg cstddef cstdio cstdlib cstring ctime cwchar cwctype
+INCLUDES = \
+ -nostdinc++ \
+ $(GLIBCPP_INCLUDES) \
+ $(LIBSUPCXX_INCLUDES) $(LIBIO_INCLUDES) $(LIBMATH_INCLUDES) \
+ $(TOPLEVEL_INCLUDES)
-@GLIBCPP_NEED_LIBIO_TRUE@libio_headers = $(top_srcdir)/libio/_G_config.h $(top_srcdir)/libio/libio.h
-@GLIBCPP_NEED_LIBIO_FALSE@libio_headers =
-build_headers = bits/std_limits.h bits/c++config.h bits/c++io.h bits/c++locale.h bits/c++threads.h bits/atomicity.h bits/os_defines.h bits/ctype_base.h bits/ctype_noninline.h bits/ctype_inline.h
+sources = \
+ basic_file.cc bitset.cc c++locale.cc cmath.cc codecvt.cc \
+ complex_io.cc functexcept.cc globals.cc ios.cc limits.cc \
+ locale.cc locale-inst.cc localename.cc misc-inst.cc stdexcept.cc \
+ stl-inst.cc string-inst.cc strstream.cc valarray-inst.cc \
+ wstring-inst.cc
-sources = limitsMEMBERS.cc complex_io.cc stdexcept.cc bitset.cc globals.cc c++io.cc ios.cc strstream.cc c++locale.cc locale.cc localename.cc codecvt.cc locale-inst.cc stl-inst.cc misc-inst.cc valarray-inst.cc string-inst.cc
-
-
-wstring_sources = wstring-inst.cc
-
-VPATH = $(top_srcdir) $(top_srcdir)/src $(GLIBCPP_INCLUDE_DIR) $(GLIBCPP_INCLUDE_DIR)/std $(C_INCLUDE_DIR)
-
-# Actual sources for the distro, but don't build these.
-#EXTRA_sources = string-inst.cc
+VPATH = $(top_srcdir):$(top_srcdir)/src
libstdc___la_SOURCES = $(sources)
-libinst_wstring_la_SOURCES = $(wstring_sources)
+libstdc___la_LIBADD = \
+ ../libmath/libmath.la @libio_la@ \
+ ../libsupc++/libsupc++convenience.la
-libstdc___la_LIBADD = ../libmath/libmath.la @libio_la@ ../libsupc++/libsupc++convenience.la @libinst_wstring_la@
-
-libstdc___la_LDFLAGS = -version-info 3:0:0 -lm
+libstdc___la_LDFLAGS = -version-info 3:4:0 -lm
libstdc___la_DEPENDENCIES = $(libstdc___la_LIBADD)
-@GLIBCPP_USE_CSHADOW_TRUE@CSHADOW_H = $(top_builddir)/stamp-cshadow
-@GLIBCPP_USE_CSHADOW_FALSE@CSHADOW_H =
-
-# Check for various configure bits that change where the headers get installed.
-gxx_include_dir = @gxx_include_dir@
-gxx_target_include_dir = $(gxx_include_dir)/$(target_alias)
-# NB: As libio_headers may be empty, need this to make sure bash doesn't
-# choke on an empty for... loop by using libio_headers_install
-# NB: installation of shadow headers is not attempted.
-src_incdir = @GLIBCPP_INCLUDE_DIR@
-bld_incdir = $(top_builddir)/include
-c_incdir = @C_INCLUDE_DIR@
+# Use special rules for the deprecated source files so that they find
+# deprecated include files.
+GLIBCPP_INCLUDE_DIR = @glibcpp_builddir@/include
# AM_CXXFLAGS needs to be in each subdirectory so that it can be
# modified in a per-library or per-sub-library way. Need to manually
# set this option because CONFIG_CXXFLAGS has to be after
# OPTIMIZE_CXXFLAGS on the compile line so that -O2 can be overridden
# as the occasion call for it. (ie, --enable-debug)
-AM_CXXFLAGS = -fno-implicit-templates $(LIBSUPCXX_CXXFLAGS) $(WARN_CXXFLAGS) $(OPTIMIZE_CXXFLAGS) $(CONFIG_CXXFLAGS)
+#
+# The no-implicit-templates flag will generate unresolved references to
+# the concept-checking symbols. So we must disable the checks while
+# actually building the library.
+AM_CXXFLAGS = \
+ -fno-implicit-templates \
+ $(LIBSUPCXX_CXXFLAGS) \
+ $(WARN_CXXFLAGS) \
+ $(OPTIMIZE_CXXFLAGS) \
+ $(CONFIG_CXXFLAGS)
# libstdc++ libtool notes
@@ -226,14 +220,18 @@ AM_CXXFLAGS = -fno-implicit-templates $(LIBSUPCXX_CXXFLAGS) $(WARN_CXXFLAGS)
# correct solution is to add `--tag CXX' to LTCXXCOMPILE and maybe
# CXXLINK, just after $(LIBTOOL), so that libtool doesn't have to
# attempt to infer which configuration to use
-LTCXXCOMPILE = $(LIBTOOL) --tag CXX --mode=compile $(CXX) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(AM_CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag CXX --mode=compile $(CXX) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(AM_CXXFLAGS)
-# 3) We have a problem when building the shared libstdc++ object if
-# the rules automake generates would be used. We cannot allow CXX to
-# be used in libtool since this would add -lstdc++ to the link line
-# which of course is problematic at this point.
-CXXLINK = $(LIBTOOL) --mode=link "$(CC)" @OPT_LDFLAGS@ @SECTION_LDFLAGS@ $(AM_CXXFLAGS) $(LDFLAGS) -o $@
+# 3) We'd have a problem when building the shared libstdc++ object if
+# the rules automake generates would be used. We cannot allow g++ to
+# be used since this would add -lstdc++ to the link line which of
+# course is problematic at this point. So, we get the top-level
+# directory to configure libstdc++-v3 to use gcc as the C++
+# compilation driver.
+CXXLINK = $(LIBTOOL) --tag CXX --mode=link $(CXX) \
+ @OPT_LDFLAGS@ @SECTION_LDFLAGS@ $(AM_CXXFLAGS) $(LDFLAGS) -o $@
CONFIG_HEADER = ../config.h
CONFIG_CLEAN_FILES =
@@ -244,25 +242,14 @@ DEFS = @DEFS@ -I. -I$(srcdir) -I..
CPPFLAGS = @CPPFLAGS@
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
-libinst_string_la_LDFLAGS =
-libinst_string_la_LIBADD =
-libinst_string_la_SOURCES = libinst-string.la.c
-libinst_string_la_OBJECTS = libinst-string.la.lo
-libinst_wstring_la_LDFLAGS =
-libinst_wstring_la_LIBADD =
-libinst_wstring_la_OBJECTS = wstring-inst.lo
-libstdc___la_OBJECTS = limitsMEMBERS.lo complex_io.lo stdexcept.lo \
-bitset.lo globals.lo c++io.lo ios.lo strstream.lo c++locale.lo \
-locale.lo localename.lo codecvt.lo locale-inst.lo stl-inst.lo \
-misc-inst.lo valarray-inst.lo string-inst.lo
+libstdc___la_OBJECTS = basic_file.lo bitset.lo c++locale.lo cmath.lo \
+codecvt.lo complex_io.lo functexcept.lo globals.lo ios.lo limits.lo \
+locale.lo locale-inst.lo localename.lo misc-inst.lo stdexcept.lo \
+stl-inst.lo string-inst.lo strstream.lo valarray-inst.lo \
+wstring-inst.lo
CXXFLAGS = @CXXFLAGS@
CXXCOMPILE = $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
CXXLD = $(CXX)
-CFLAGS = @CFLAGS@
-COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
-LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
DIST_COMMON = Makefile.am Makefile.in
@@ -270,8 +257,8 @@ DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = gtar
GZIP_ENV = --best
-SOURCES = libinst-string.la.c $(libinst_wstring_la_SOURCES) $(libstdc___la_SOURCES)
-OBJECTS = libinst-string.la.lo $(libinst_wstring_la_OBJECTS) $(libstdc___la_OBJECTS)
+SOURCES = $(libstdc___la_SOURCES)
+OBJECTS = $(libstdc___la_OBJECTS)
all: all-redirect
.SUFFIXES:
@@ -353,12 +340,6 @@ distclean-libtool:
maintainer-clean-libtool:
-libinst-string.la: $(libinst_string_la_OBJECTS) $(libinst_string_la_DEPENDENCIES)
- $(LINK) $(libinst_string_la_LDFLAGS) $(libinst_string_la_OBJECTS) $(libinst_string_la_LIBADD) $(LIBS)
-
-libinst-wstring.la: $(libinst_wstring_la_OBJECTS) $(libinst_wstring_la_DEPENDENCIES)
- $(CXXLINK) $(libinst_wstring_la_LDFLAGS) $(libinst_wstring_la_OBJECTS) $(libinst_wstring_la_LIBADD) $(LIBS)
-
libstdc++.la: $(libstdc___la_OBJECTS) $(libstdc___la_DEPENDENCIES)
$(CXXLINK) -rpath $(toolexeclibdir) $(libstdc___la_LDFLAGS) $(libstdc___la_OBJECTS) $(libstdc___la_LIBADD) $(LIBS)
.cc.o:
@@ -425,7 +406,7 @@ install-info: install-info-am
install-exec-am: install-toolexeclibLTLIBRARIES
install-exec: install-exec-am
-install-data-am: install-data-local
+install-data-am:
install-data: install-data-am
install-am: all-am
@@ -486,104 +467,16 @@ maintainer-clean-compile mostlyclean-libtool distclean-libtool \
clean-libtool maintainer-clean-libtool tags mostlyclean-tags \
distclean-tags clean-tags maintainer-clean-tags distdir info-am info \
dvi-am dvi check check-am installcheck-am installcheck install-info-am \
-install-info install-exec-am install-exec install-data-local \
-install-data-am install-data install-am install uninstall-am uninstall \
-all-redirect all-am all installdirs mostlyclean-generic \
-distclean-generic clean-generic maintainer-clean-generic clean \
-mostlyclean distclean maintainer-clean
-
-
-# Specify that all *.o's depend on this.
-$(libstdc___la_OBJECTS): $(CSHADOW_H)
-
-$(top_builddir)/stamp-cshadow: $(top_srcdir)/mkinclosure \
- $(top_srcdir)/mkcshadow
- $(top_srcdir)/mkinclosure \
- "-I $(top_builddir)/../../gcc/include -I /usr/include -G fcntl.h unistd.h" | $(top_srcdir)/mkcshadow;
- rm -f $(top_builddir)/stamp-cshadow
- echo "done" > $(top_builddir)/stamp-cshadow
-
-# We have our own special, ridiculously complicated installation routine
-# here, as automake/autoconf is currently brain-damaged when it comes
-# to installing sub-directories of headers. In particular, we want to
-# 1) install build headers from (blddir)/include/bits -> (install)/bits
-# 2) install source headers from
-# (srcdir)/include/bits -> (install)/bits
-# (srcdir)/include/ext -> (install)/ext
-# (srcdir)/include/backward -> (install)/backward
-# ... and the always entertaining "C" compatibility bits
-# where * represents configure-time directory switching
-# (srcdir)/include/c* -> (install)/
-# (srcdir)/include/c*/bits -> (install)/bits
-# (srcdir)/include/c*/sys -> (install)/sys
-install-data-local: myinstalldirs myinstallheaders
-
-# NB: installation of shadow header directories is not attempted.
-myinstalldirs:
- if test -z "$(MULTISUBDIR)"; then \
- $(mkinstalldirs) $(DESTDIR)$(gxx_include_dir)/bits; \
- $(mkinstalldirs) $(DESTDIR)$(gxx_include_dir)/ext; \
- $(mkinstalldirs) $(DESTDIR)$(gxx_target_include_dir)/bits; \
- fi
-myinstallheaders:
- if test -z "$(MULTISUBDIR)"; then \
- for i in $(base_headers); do \
- echo "$(INSTALL_DATA) $(src_incdir)/$$i $(gxx_include_dir)/bits/"; \
- $(INSTALL_DATA) $(src_incdir)/$$i $(gxx_include_dir)/bits/; \
- done; \
- for i in $(ext_headers); do \
- echo "$(INSTALL_DATA) $(src_incdir)/$$i $(gxx_include_dir)/ext/"; \
- $(INSTALL_DATA) $(src_incdir)/$$i $(gxx_include_dir)/ext/; \
- done; \
- for i in $(backward_headers); do \
- echo "$(INSTALL_DATA) $(src_incdir)/$$i $(gxx_include_dir)"; \
- $(INSTALL_DATA) $(src_incdir)/$$i $(gxx_include_dir); \
- done; \
- for i in $(c_base_headers); do \
- echo "$(INSTALL_DATA) $(c_incdir)/$$i $(gxx_include_dir)/bits/"; \
- $(INSTALL_DATA) $(c_incdir)/$$i $(gxx_include_dir)/bits/; \
- done; \
- for i in $(std_headers); do \
- echo "$(INSTALL_DATA) $(src_incdir)/std/$$i $(gxx_include_dir)";\
- $(INSTALL_DATA) $(src_incdir)/std/$$i $(gxx_include_dir); \
- done; \
- for i in $(build_headers); do \
- echo "$(INSTALL_DATA) $(bld_incdir)/$$i $(gxx_target_include_dir)/bits/"; \
- $(INSTALL_DATA) $(bld_incdir)/$$i $(gxx_target_include_dir)/bits/; \
- done; \
- libio_headers_install='$(libio_headers)'; \
- for i in $$libio_headers_install; do \
- echo "$(INSTALL_DATA) $$i $(gxx_include_dir)"; \
- $(INSTALL_DATA) $$i $(gxx_include_dir); \
- done; \
- fi;
+install-info install-exec-am install-exec install-data-am install-data \
+install-am install uninstall-am uninstall all-redirect all-am all \
+installdirs mostlyclean-generic distclean-generic clean-generic \
+maintainer-clean-generic clean mostlyclean distclean maintainer-clean
-# Use special rules for the deprecated source files so that they find
-# deprecated include files.
strstream.lo: strstream.cc
$(LTCXXCOMPILE) -I$(GLIBCPP_INCLUDE_DIR)/backward -c $<
strstream.o: strstream.cc
$(CXXCOMPILE) -I$(GLIBCPP_INCLUDE_DIR)/backward -c $<
-# Make wstring-inst.cc from string-inst.cc
-wstring-inst.o: string-inst.cc
- $(CXXCOMPILE) -c -DC=wchar_t $< -o $@
-wstring-inst.lo: string-inst.cc
- $(LTCXXCOMPILE) -c -DC=wchar_t $< -o $@
-
-# Alexandre put this in here for some libtool-related reason.
-all: libstdc++.INC
-libstdc++.INC: Makefile
- $(MAKE) \
- top_builddir=`CDPATH=:. && cd $(top_builddir) && pwd` \
- top_srcdir=`CDPATH=:. && cd $(top_srcdir) && pwd` \
- tmp-$@
- -rm -f $@
- mv tmp-$@ $@
-
-tmp-libstdc++.INC: Makefile
- echo $(INCLUDES) > $@
-
# 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.
.NOEXPORT:
diff --git a/libstdc++-v3/src/bitset.cc b/libstdc++-v3/src/bitset.cc
index 599a399c461..0c3fc5f4073 100644
--- a/libstdc++-v3/src/bitset.cc
+++ b/libstdc++-v3/src/bitset.cc
@@ -1,3 +1,33 @@
+// Bitset definitions -*- C++ -*-
+
+// Copyright (C) 2001 Free Software Foundation
+//
+// This file is part of GNU CC.
+//
+// GNU CC is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2, or (at your option)
+// any later version.
+//
+// GNU CC is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with GNU CC; see the file COPYING. If not, write to
+// the Free Software Foundation, 59 Temple Place - Suite 330,
+// Boston, MA 02111-1307, USA.
+
+// 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.
+
/*
* Copyright (c) 1998
* Silicon Graphics Computer Systems, Inc.
@@ -18,14 +48,14 @@
// _Base_bitset.
//
-size_t
-std::_Base_bitset<1>::_M_do_find_first(size_t __not_found) const
+std::size_t
+std::_Base_bitset<1>::_M_do_find_first(std::size_t __not_found) const
{
_WordT __thisword = _M_w;
if ( __thisword != static_cast<_WordT>(0) ) {
// find byte within word
- for ( size_t __j = 0; __j < sizeof(_WordT); __j++ ) {
+ for (std::size_t __j = 0; __j < sizeof(_WordT); __j++ ) {
unsigned char __this_byte
= static_cast<unsigned char>(__thisword & (~(unsigned char)0));
if ( __this_byte )
@@ -38,8 +68,9 @@ std::_Base_bitset<1>::_M_do_find_first(size_t __not_found) const
return __not_found;
}
-size_t
-std::_Base_bitset<1>::_M_do_find_next(size_t __prev, size_t __not_found) const
+std::size_t
+std::_Base_bitset<1>::_M_do_find_next(std::size_t __prev,
+ std::size_t __not_found) const
{
// make bound inclusive
++__prev;
@@ -58,7 +89,7 @@ std::_Base_bitset<1>::_M_do_find_next(size_t __prev, size_t __not_found) const
// find byte within word
// get first byte into place
__thisword >>= _S_whichbyte(__prev) * CHAR_BIT;
- for ( size_t __j = _S_whichbyte(__prev); __j < sizeof(_WordT); __j++ ) {
+ for ( std::size_t __j = _S_whichbyte(__prev); __j < sizeof(_WordT); __j++ ) {
unsigned char __this_byte
= static_cast<unsigned char>(__thisword & (~(unsigned char)0));
if ( __this_byte )
@@ -194,4 +225,3 @@ template unsigned char std::_Bit_count<true>::_S_bit_count[];
template unsigned char std::_First_one<false>::_S_first_one[];
template unsigned char std::_First_one<true>::_S_first_one[];
-
diff --git a/libstdc++-v3/src/cmath.cc b/libstdc++-v3/src/cmath.cc
new file mode 100644
index 00000000000..6442e0cda4e
--- /dev/null
+++ b/libstdc++-v3/src/cmath.cc
@@ -0,0 +1,48 @@
+// Explicit instantiation file for -*- C++ -*- math library.
+
+// Copyright (C) 2001 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.
+
+
+// These are explicit instantiations of the behind-the-scenes internal
+// helper functions used in the math routines of libstdc++.
+
+
+#include <bits/std_cmath.h>
+
+namespace std
+{
+ // This function is only declared/used in the cheaders=c_std case.
+ template float
+ __cmath_power<float>(float, unsigned int);
+ template double
+ __cmath_power<double>(double, unsigned int);
+ template long double
+ __cmath_power<long double>(long double, unsigned int);
+
+} // namespace std
+
diff --git a/libstdc++-v3/src/complex_io.cc b/libstdc++-v3/src/complex_io.cc
index 8b8854c6254..c4b8a95b5f8 100644
--- a/libstdc++-v3/src/complex_io.cc
+++ b/libstdc++-v3/src/complex_io.cc
@@ -1,6 +1,6 @@
// The template and inlines for the -*- C++ -*- complex number classes.
-// Copyright (C) 2000 Free Software Foundation, Inc.
+// Copyright (C) 2000, 2001 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
@@ -28,134 +28,69 @@
// the GNU General Public License.
#include <bits/std_complex.h>
-#include <bits/std_istream.h>
-#include <bits/std_ostream.h>
-#include <bits/std_sstream.h>
namespace std
{
-
- template<typename _Tp, typename _CharT, class _Traits>
- basic_istream <_CharT, _Traits> &
- operator>>(basic_istream<_CharT, _Traits>& __is, complex<_Tp>& __x)
- {
-#if !defined(_GLIBCPP_BUGGY_FLOAT_COMPLEX) && !defined(_GLIBCPP_BUGGY_COMPLEX)
- _Tp __re_x, __im_x;
- _CharT __ch;
- __is >> __ch;
- if (__ch == '(')
- {
- __is >> __re_x >> __ch;
- if (__ch == ',')
- {
- __is >> __im_x >> __ch;
- if (__ch == ')')
- {
- __x = complex<_Tp>(__re_x, __im_x);
- return __is;
- }
- }
- else if (__ch == ')')
- {
- __x = complex<_Tp>(__re_x, _Tp(0));
- return __is;
- }
- }
- else
- {
- __is.putback(__ch);
- __is >> __re_x;
- __x = complex<_Tp>(__re_x, _Tp(0));
- return __is;
- }
- __is.setstate(ios_base::failbit);
-#else
- __x = complex<_Tp>(_Tp(0), _Tp(0));
-#endif
- return __is;
- }
-
- template<typename _Tp, typename _CharT, class _Traits>
- basic_ostream<_CharT, _Traits>&
- operator<<(basic_ostream<_CharT, _Traits>& __os, const complex<_Tp>& __x)
- {
- basic_ostringstream<_CharT, _Traits> __s;
- __s.flags(__os.flags());
- __s.imbue(__os.getloc());
- __s.precision (__os.precision());
- __s << '(' << __x.real() << "," << __x.imag() << ')' << ends;
- return __os << __s.str();
- }
-
-
template
basic_istream<char, char_traits<char> >&
- operator>>(basic_istream< char, char_traits<char> >&,
- complex<float>&);
+ operator>>(basic_istream<char, char_traits<char> >&, complex<float>&);
template
basic_ostream<char, char_traits<char> >&
- operator<<(basic_ostream< char, char_traits<char> >&,
- const complex<float>&);
+ operator<<(basic_ostream<char, char_traits<char> >&,
+ const complex<float>&);
template
basic_istream<char, char_traits<char> >&
- operator>>(basic_istream< char, char_traits<char> >&,
- complex<double>&);
+ operator>>(basic_istream<char, char_traits<char> >&, complex<double>&);
template
basic_ostream<char, char_traits<char> >&
- operator<<(basic_ostream< char, char_traits<char> >&,
- const complex<double>&);
+ operator<<(basic_ostream<char, char_traits<char> >&,
+ const complex<double>&);
template
basic_istream<char, char_traits<char> >&
- operator>>(basic_istream< char, char_traits<char> >&,
- complex<long double>&);
+ operator>>(basic_istream<char, char_traits<char> >&,
+ complex<long double>&);
template
basic_ostream<char, char_traits<char> >&
- operator<<(basic_ostream< char, char_traits<char> >&,
+ operator<<(basic_ostream<char, char_traits<char> >&,
const complex<long double>&);
#ifdef _GLIBCPP_USE_WCHAR_T
template
basic_istream<wchar_t, char_traits<wchar_t> >&
- operator>>(basic_istream< wchar_t, char_traits<wchar_t> >&,
+ operator>>(basic_istream<wchar_t, char_traits<wchar_t> >&,
complex<float>&);
template
basic_ostream<wchar_t, char_traits<wchar_t> >&
- operator<<(basic_ostream< wchar_t, char_traits<wchar_t> >&,
+ operator<<(basic_ostream<wchar_t, char_traits<wchar_t> >&,
const complex<float>&);
template
basic_istream<wchar_t, char_traits<wchar_t> >&
- operator>>(basic_istream< wchar_t, char_traits<wchar_t> >&,
+ operator>>(basic_istream<wchar_t, char_traits<wchar_t> >&,
complex<double>&);
template
basic_ostream<wchar_t, char_traits<wchar_t> >&
- operator<<(basic_ostream< wchar_t, char_traits<wchar_t> >&,
+ operator<<(basic_ostream<wchar_t, char_traits<wchar_t> >&,
const complex<double>&);
template
basic_istream<wchar_t, char_traits<wchar_t> >&
- operator>>(basic_istream< wchar_t, char_traits<wchar_t> >&,
+ operator>>(basic_istream<wchar_t, char_traits<wchar_t> >&,
complex<long double>&);
template
basic_ostream<wchar_t, char_traits<wchar_t> >&
- operator<<(basic_ostream< wchar_t, char_traits<wchar_t> >&,
+ operator<<(basic_ostream<wchar_t, char_traits<wchar_t> >&,
const complex<long double>&);
#endif //_GLIBCPP_USE_WCHAR_T
-}
-
-
-
-
-
-
+} // namespace std
diff --git a/libstdc++-v3/src/functexcept.cc b/libstdc++-v3/src/functexcept.cc
new file mode 100644
index 00000000000..8cfaaac7ec9
--- /dev/null
+++ b/libstdc++-v3/src/functexcept.cc
@@ -0,0 +1,152 @@
+// Copyright (C) 2001 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.
+
+#include <bits/functexcept.h>
+#include <cstdlib>
+#include <exception>
+#include <new>
+#include <typeinfo>
+#include <stdexcept>
+#include <ios>
+#include <string>
+
+namespace std
+{
+#if __EXCEPTIONS
+ void
+ __throw_bad_exception(void)
+ { throw bad_exception(); }
+
+ void
+ __throw_bad_alloc(void)
+ { throw bad_alloc(); }
+
+ void
+ __throw_bad_cast(void)
+ { throw bad_cast(); }
+
+ void
+ __throw_bad_typeid(void)
+ { throw bad_typeid(); }
+
+ void
+ __throw_logic_error(const char* __s)
+ { throw logic_error(__s); }
+
+ void
+ __throw_domain_error(const char* __s)
+ { throw domain_error(__s); }
+
+ void
+ __throw_invalid_argument(const char* __s)
+ { throw invalid_argument(__s); }
+
+ void
+ __throw_length_error(const char* __s)
+ { throw length_error(__s); }
+
+ void
+ __throw_out_of_range(const char* __s)
+ { throw out_of_range(__s); }
+
+ void
+ __throw_runtime_error(const char* __s)
+ { throw runtime_error(__s); }
+
+ void
+ __throw_range_error(const char* __s)
+ { throw range_error(__s); }
+
+ void
+ __throw_overflow_error(const char* __s)
+ { throw overflow_error(__s); }
+
+ void
+ __throw_underflow_error(const char* __s)
+ { throw underflow_error(__s); }
+
+ void
+ __throw_ios_failure(const char* __s)
+ { throw ios_base::failure(__s); }
+#else
+ void
+ __throw_bad_exception(void)
+ { abort(); }
+
+ void
+ __throw_bad_alloc(void)
+ { abort(); }
+
+ void
+ __throw_bad_cast(void)
+ { abort(); }
+
+ void
+ __throw_bad_typeid(void)
+ { abort(); }
+
+ void
+ __throw_logic_error(const char* __s)
+ { abort(); }
+
+ void
+ __throw_domain_error(const char* __s)
+ { abort(); }
+
+ void
+ __throw_invalid_argument(const char* __s)
+ { abort(); }
+
+ void
+ __throw_length_error(const char* __s)
+ { abort(); }
+
+ void
+ __throw_out_of_range(const char* __s)
+ { abort(); }
+
+ void
+ __throw_runtime_error(const char* __s)
+ { abort(); }
+
+ void
+ __throw_range_error(const char* __s)
+ { abort(); }
+
+ void
+ __throw_overflow_error(const char* __s)
+ { abort(); }
+
+ void
+ __throw_underflow_error(const char* __s)
+ { abort(); }
+
+ void
+ __throw_ios_failure(const char* __s)
+ { abort(); }
+#endif //__EXCEPTIONS
+}
diff --git a/libstdc++-v3/src/gen-num-limits.cc b/libstdc++-v3/src/gen-num-limits.cc
index 7a1416cd768..6fbfdb73fff 100644
--- a/libstdc++-v3/src/gen-num-limits.cc
+++ b/libstdc++-v3/src/gen-num-limits.cc
@@ -33,24 +33,7 @@
// Do not compile with optimization turned on.
//
-#include <bits/c++config.h>
-
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-//
-// Force Linux <limits.h> to define the *LONG_LONG*
-//
-#if __linux__ && _GLIBCPP_USE_LONG_LONG
-# ifndef __USE_GNU
-# define __USE_GNU 1
-# endif
-# ifndef _GNU_SOURCE
-# define _GNU_SOURCE 1
-# endif
-#endif
-
+#include <config.h>
#include <limits.h>
#include <float.h>
#include <stdio.h>
@@ -114,8 +97,16 @@ template <typename signal_handler_type, typename signal_number_type>
inline void (*signal_adapter (signal_handler_type
(*signal_func)(signal_number_type,
signal_handler_type),
- signal_number_type arg,
- void (*handler)(int)))(int)
+ signal_number_type arg,
+ void (*handler)(int)))(int)
+{
+ return (void (*)(int))(*signal_func)(arg, (signal_handler_type)handler);
+}
+
+template <typename signal_handler_type, typename signal_number_type>
+inline void (*signal_adapter (signal_handler_type (*signal_func)(...),
+ signal_number_type arg,
+ void (*handler)(int)))(int)
{
return (void (*)(int))(*signal_func)(arg, (signal_handler_type)handler);
}
@@ -139,49 +130,62 @@ bool trapping(const Operation& op)
return false;
}
-template<typename T> struct division_by_zero {
+template<typename T>
+ struct division_by_zero
+ {
void operator() () const
{
- volatile T zero = T();
- volatile T one = T(1);
- volatile T infinity = one / zero;
+ volatile T zero = T();
+ volatile T one = T(1);
+ volatile T infinity = one / zero;
}
-};
+ };
-template<typename T> struct overflow {
+template<typename T>
+ struct overflow
+ {
void operator() () const
{
- T i = T(1);
- T j = T();
- while (i>j) {
- j = i;
- i = i * 2 + 1;
- }
+ T i = T(1);
+ T j = T();
+ while (i>j) {
+ j = i;
+ i = i * 2 + 1;
+ }
}
-};
+ };
-template<typename T> struct underflow {};
+template<typename T> struct underflow { };
+
+
+// Set various signals handler for trapping aritmetic ops.
+void set_signals_handler()
+{
+ signal_adapter(signal, SIGFPE, signal_handler);
+ signal_adapter(signal, SIGTRAP, signal_handler);
+ // This is necessary for Linux/SPARC.
+ signal_adapter(signal, SIGILL, signal_handler);
+}
// traps
template<typename T> void traps()
{
- signal_adapter (signal, SIGFPE, signal_handler);
- signal_adapter (signal, SIGTRAP, signal_handler);
- bool trap_flag = trapping(division_by_zero<T>());
- signal_adapter (signal, SIGFPE, signal_handler);
- signal_adapter (signal, SIGTRAP, signal_handler);
- trap_flag = trap_flag || trapping(overflow<T>());
- const char* p = bool_alpha[trap_flag];
- printf("%s%s = %s;\n", tab2, "static const bool traps", p);
+ fflush(NULL);
+ set_signals_handler();
+ bool trap_flag = trapping(division_by_zero<T>());
+ set_signals_handler();
+ trap_flag = trap_flag || trapping(overflow<T>());
+ const char* p = bool_alpha[trap_flag];
+ printf("%s%s = %s;\n", tab2, "static const bool traps", p);
}
#define SPECIALIZE_TRAPPING(T) \
template<> void traps< T >() \
-{ \
- signal_adapter (signal, SIGFPE, signal_handler); \
- signal_adapter (signal, SIGTRAP, signal_handler); \
- const char* p = bool_alpha[trapping(division_by_zero<T>())]; \
- printf("%s%s = %s;\n", tab2, "static const bool traps", p); \
+{ \
+ fflush(NULL); \
+ set_signals_handler(); \
+ const char* p = bool_alpha[trapping(division_by_zero<T>())]; \
+ printf("%s%s = %s;\n", tab2, "static const bool traps", p); \
}
SPECIALIZE_TRAPPING(unsigned char);
@@ -194,13 +198,17 @@ SPECIALIZE_TRAPPING(unsigned long long);
#undef SPECIALIZE_TRAPPING
-template<typename T> struct type_name_trait {
+template<typename T>
+ struct type_name_trait
+ {
static const char type_name[];
static const char trait_name[];
-};
+ };
#define DEFINED_TYPE_NAME(T) \
+template<> \
const char type_name_trait< T >::type_name[] = #T; \
+template<> \
const char type_name_trait< T >::trait_name[] = "numeric_limits<" #T ">";
DEFINED_TYPE_NAME(bool);
@@ -225,40 +233,41 @@ DEFINED_TYPE_NAME(long double);
#undef DEFINED_TYPE_NAME
// declarator
-template<typename T> struct declarator : type_name_trait<T> {
+template<typename T>
+ struct declarator : type_name_trait<T>
+ {
typedef type_name_trait<T> base;
static void start()
- {
- printf("%s%s %s %s\n", tab, "template<> struct",
- base::trait_name, "{");
+ {
+ printf("%s%s %s %s\n", tab, "template<> struct", base::trait_name, "{");
}
-
+
static void end()
- {
- printf("%s};\n\n", tab);
- }
-};
+ { printf("%s};\n\n", tab); }
+ };
//
// Predicates
//
-template<typename T> struct predicate {
+template<typename T>
+ struct predicate
+ {
static const bool is_signed;
static const bool is_integer;
static const bool is_exact;
-
+
static const bool has_infinity;
static const bool has_quiet_nan;
static const bool has_signaling_nan;
static const bool has_denorm;
static const bool has_denorm_loss;
-
+
static const bool is_iec559;
static const bool is_bounded;
-
+
static const bool traps;
-};
+ };
template<typename T>
const bool predicate<T>::is_signed = T(-1) < 0;
@@ -272,7 +281,9 @@ template<typename T>
const bool predicate<T>::is_exact = true;
#define SPECIALIZE_EXACTNESS(T) \
+template<> \
const bool predicate< T >::is_integer = false; \
+template<> \
const bool predicate< T >::is_exact = false
SPECIALIZE_EXACTNESS(float);
@@ -304,6 +315,7 @@ template<typename T>
const bool predicate<T>::is_iec559 = false;
#define SPECIALIZE_IEC559(T) \
+template<> \
const bool predicate< T >::is_iec559 = true
SPECIALIZE_IEC559(bool);
@@ -321,27 +333,30 @@ SPECIALIZE_IEC559(unsigned long long);
//
// Values
//
-
-template<typename T> struct value {
+template<typename T>
+ struct value
+ {
static const char min[];
static const char max[];
-
+
static const int digits;
static const int digits10;
static const int radix;
static const char epsilon[];
static const char round_error[];
-
+
static const int min_exponent;
static const int min_exponent10;
static const int max_exponent;
static const int max_exponent10;
-};
+ };
#define DEFINE_EXTREMA(T, m, M) DO_DEFINE_EXTREMA(T, m, M)
#define DO_DEFINE_EXTREMA(T, m, M) \
+template<> \
const char value< T >::min[] = #m; \
+template<> \
const char value< T >::max[] = #M
DEFINE_EXTREMA(bool, false, true);
@@ -358,8 +373,8 @@ DEFINE_EXTREMA(unsigned int, 0, UINT_MAX);
DEFINE_EXTREMA(long, LONG_MIN, LONG_MAX);
DEFINE_EXTREMA(unsigned long, 0, ULONG_MAX);
#ifdef _GLIBCPP_USE_LONG_LONG
-DEFINE_EXTREMA(long long, LONG_LONG_MIN, LONG_LONG_MAX);
-DEFINE_EXTREMA(unsigned long long, 0, ULONG_LONG_MAX);
+DEFINE_EXTREMA(long long, (-__LONG_LONG_MAX__-1), __LONG_LONG_MAX__);
+DEFINE_EXTREMA(unsigned long long, 0, (__LONG_LONG_MAX__ * 2ULL + 1));
#endif
DEFINE_EXTREMA(float, FLT_MIN, FLT_MAX);
DEFINE_EXTREMA(double, DBL_MIN, DBL_MAX);
@@ -378,8 +393,10 @@ const int value<T>::digits =
template<typename T>
const int value<T>::radix = 2;
-#define SPECIALIZE_DIGITS(T, D, D10) \
-const int value< T >::digits = D; \
+#define SPECIALIZE_DIGITS(T, D, D10) \
+template<> \
+const int value< T >::digits = D; \
+template<> \
const int value< T >::digits10 = D10
SPECIALIZE_DIGITS(float, FLT_MANT_DIG, FLT_DIG);
@@ -389,7 +406,9 @@ SPECIALIZE_DIGITS(long double, LDBL_MANT_DIG, LDBL_DIG);
#undef SPECIALIZE_DIGITS
-#define SPECIALIZE_RADIX(T, R) const int value< T >::radix = R
+#define SPECIALIZE_RADIX(T, R) \
+template<> \
+const int value< T >::radix = R
SPECIALIZE_RADIX(float, FLT_RADIX);
SPECIALIZE_RADIX(double, FLT_RADIX);
@@ -410,7 +429,9 @@ const char value<T>::epsilon[] = "0";
#endif
#define SPECIALIZE_EPSILON(T, E) DO_SPECIALIZE_EPSILON(T, E)
-#define DO_SPECIALIZE_EPSILON(T, E) const char value< T >::epsilon[] = #E
+#define DO_SPECIALIZE_EPSILON(T, E) \
+template<> \
+const char value< T >::epsilon[] = #E
// unsophisticated, gross method
#if 1
@@ -449,7 +470,9 @@ template<typename T>
const char value<T>::round_error[] = "0";
#endif
-#define SPECIALIZE_ROUND_ERROR(T, R) const char value< T >::round_error[] = #R
+#define SPECIALIZE_ROUND_ERROR(T, R) \
+template<> \
+const char value< T >::round_error[] = #R
// unsophisticated, gross method
#if 1
SPECIALIZE_ROUND_ERROR(bool, 0);
@@ -486,10 +509,14 @@ const int value<T>::max_exponent = 0;
template<typename T>
const int value<T>::max_exponent10 = 0;
-#define SPECIALIZE_EXPONENTS(T, m, m10, M, M10) \
-const int value< T >::min_exponent = m; \
-const int value< T >::min_exponent10 = m10; \
-const int value< T >::max_exponent = M; \
+#define SPECIALIZE_EXPONENTS(T, m, m10, M, M10) \
+template<> \
+const int value< T >::min_exponent = m; \
+template<> \
+const int value< T >::min_exponent10 = m10; \
+template<> \
+const int value< T >::max_exponent = M; \
+template<> \
const int value< T >::max_exponent10 = M10
SPECIALIZE_EXPONENTS(float, FLT_MIN_EXP, FLT_MIN_10_EXP,
@@ -507,283 +534,285 @@ SPECIALIZE_EXPONENTS(long double, LDBL_MIN_EXP, LDBL_MIN_10_EXP,
template<typename T> void is_signed()
{
- printf("%s%s = %s;\n", tab2, "static const bool is_signed",
- bool_alpha[predicate<T>::is_signed]);
+ printf("%s%s = %s;\n", tab2, "static const bool is_signed",
+ bool_alpha[predicate<T>::is_signed]);
}
// a fundamental type is modulo iff it isn't signed
template<typename T> void is_modulo()
{
- printf("%s%s = %s;\n", tab2, "static const bool is_modulo",
- bool_alpha[! predicate<T>::is_signed]);
+ printf("%s%s = %s;\n", tab2, "static const bool is_modulo",
+ bool_alpha[! predicate<T>::is_signed]);
}
template<typename T>
void min()
{
- printf("%s%s%s%s\n%s%s%s%s\n", tab2, "static ", declarator<T>::type_name,
- " min() throw()", tab2, "{ return ", value<T>::min, "; }");
+ printf("%s%s%s%s\n%s%s%s%s\n", tab2, "static ", declarator<T>::type_name,
+ " min() throw()", tab2, "{ return ", value<T>::min, "; }");
}
template<typename T>
void max()
{
- printf("%s%s%s%s\n%s%s%s%s\n", tab2, "static ", declarator<T>::type_name,
- " max() throw()", tab2, "{ return ", value<T>::max, "; }");
+ printf("%s%s%s%s\n%s%s%s%s\n", tab2, "static ", declarator<T>::type_name,
+ " max() throw()", tab2, "{ return ", value<T>::max, "; }");
}
template<typename T>
void is_integer()
{
- printf("%s%s = %s;\n", tab2, "static const bool is_integer",
- bool_alpha[predicate<T>::is_integer]);
+ printf("%s%s = %s;\n", tab2, "static const bool is_integer",
+ bool_alpha[predicate<T>::is_integer]);
}
template<typename T>
void is_exact()
{
- printf("%s%s = %s;\n", tab2, "static const bool is_exact",
- bool_alpha[predicate<T>::is_exact]);
+ printf("%s%s = %s;\n", tab2, "static const bool is_exact",
+ bool_alpha[predicate<T>::is_exact]);
}
template<typename T>
void digits()
{
- printf("%s%s = %d;\n", tab2, "static const int digits",
- value<T>::digits);
+ printf("%s%s = %d;\n", tab2, "static const int digits",
+ value<T>::digits);
}
template<typename T>
void digits10()
{
- printf("%s%s = %d;\n", tab2, "static const int digits10",
- int(log10_of_two * value<T>::digits));
+ printf("%s%s = %d;\n", tab2, "static const int digits10",
+ int(log10_of_two * value<T>::digits) + 1);
}
template<typename T>
void radix()
{
- printf("%s%s = %d;\n", tab2, "static const int radix",
- value<T>::radix);
+ printf("%s%s = %d;\n", tab2, "static const int radix",
+ value<T>::radix);
}
template<typename T>
void epsilon()
{
- printf("%s%s %s %s\n%s%s %s%s\n", tab2, "static",
- declarator<T>::type_name, "epsilon() throw()",
- tab2, "{ return", value<T>::epsilon, "; }");
+ printf("%s%s %s %s\n%s%s %s%s\n", tab2, "static",
+ declarator<T>::type_name, "epsilon() throw()",
+ tab2, "{ return", value<T>::epsilon, "; }");
}
template<typename T>
void round_error()
{
- printf("%s%s %s %s\n%s%s %s%s\n", tab2, "static",
- declarator<T>::type_name, "round_error() throw()",
- tab2, "{ return", value<T>::round_error, "; }");
+ printf("%s%s %s %s\n%s%s %s%s\n", tab2, "static",
+ declarator<T>::type_name, "round_error() throw()",
+ tab2, "{ return", value<T>::round_error, "; }");
}
template<typename T>
void min_exponent()
{
- printf("%s%s = %d;\n", tab2, "static const int min_exponent",
- value<T>::min_exponent);
+ printf("%s%s = %d;\n", tab2, "static const int min_exponent",
+ value<T>::min_exponent);
}
template<typename T>
void min_exponent10()
{
- printf("%s%s = %d;\n", tab2, "static const int min_exponent10",
- value<T>::min_exponent10);
+ printf("%s%s = %d;\n", tab2, "static const int min_exponent10",
+ value<T>::min_exponent10);
}
template<typename T>
void max_exponent()
{
- printf("%s%s = %d;\n", tab2, "static const int max_exponent",
- value<T>::max_exponent);
+ printf("%s%s = %d;\n", tab2, "static const int max_exponent",
+ value<T>::max_exponent);
}
template<typename T>
void max_exponent10()
{
- printf("%s%s = %d;\n", tab2, "static const int max_exponent10",
- value<T>::max_exponent10);
+ printf("%s%s = %d;\n", tab2, "static const int max_exponent10",
+ value<T>::max_exponent10);
}
template<typename T>
void has_infinity()
{
- printf("%s%s = %s;\n", tab2, "static const bool has_infinity",
- bool_alpha[predicate<T>::has_infinity]);
+ printf("%s%s = %s;\n", tab2, "static const bool has_infinity",
+ bool_alpha[predicate<T>::has_infinity]);
}
template<typename T>
void has_quiet_nan()
{
- printf("%s%s = %s;\n", tab2, "static const bool has_quiet_NaN",
- bool_alpha[predicate<T>::has_quiet_nan]);
+ printf("%s%s = %s;\n", tab2, "static const bool has_quiet_NaN",
+ bool_alpha[predicate<T>::has_quiet_nan]);
}
template<typename T>
void has_signaling_nan()
{
- printf("%s%s = %s;\n", tab2, "static const bool has_signaling_NaN",
- bool_alpha[predicate<T>::has_signaling_nan]);
+ printf("%s%s = %s;\n", tab2, "static const bool has_signaling_NaN",
+ bool_alpha[predicate<T>::has_signaling_nan]);
}
template<typename T>
void has_denorm_loss()
{
- printf("%s%s = %s;\n", tab2, "static const bool has_denorm_loss",
- bool_alpha[predicate<T>::has_denorm_loss]);
+ printf("%s%s = %s;\n", tab2, "static const bool has_denorm_loss",
+ bool_alpha[predicate<T>::has_denorm_loss]);
}
-template<typename T> struct infinity_trait {
+template<typename T>
+ struct infinity_trait
+ {
static void has_denorm()
{
- printf("%s%s;\n", tab2, "static const float_denorm_style "
- "has_denorm = denorm_absent");
+ printf("%s%s;\n", tab2, "static const float_denorm_style "
+ "has_denorm = denorm_absent");
}
-
+
static void infinity()
{
- printf("%s%s %s %s\n%s%s%s%s\n", tab2, "static",
- declarator<T>::type_name, "infinity() throw()",
- tab2, "{ return static_cast<", declarator<T>::type_name,
- ">(0); }");
+ printf("%s%s %s %s\n%s%s%s%s\n", tab2, "static",
+ declarator<T>::type_name, "infinity() throw()", tab2,
+ "{ return static_cast<", declarator<T>::type_name, ">(0); }");
}
static void quiet_NaN()
{
- printf("%s%s %s %s\n%s%s%s%s\n", tab2, "static",
- declarator<T>::type_name, "quiet_NaN() throw()",
- tab2, "{ return static_cast<", declarator<T>::type_name,
- ">(0); }");
+ printf("%s%s %s %s\n%s%s%s%s\n", tab2, "static",
+ declarator<T>::type_name, "quiet_NaN() throw()",
+ tab2, "{ return static_cast<", declarator<T>::type_name,
+ ">(0); }");
}
-
+
static void signaling_NaN()
{
- printf("%s%s %s %s\n%s%s%s%s\n", tab2, "static",
- declarator<T>::type_name, "signaling_NaN() throw()",
- tab2, "{ return static_cast<", declarator<T>::type_name,
- ">(0); }");
+ printf("%s%s %s %s\n%s%s%s%s\n", tab2, "static",
+ declarator<T>::type_name, "signaling_NaN() throw()",
+ tab2, "{ return static_cast<", declarator<T>::type_name,
+ ">(0); }");
}
static void denorm_min()
{
- printf("%s%s %s %s\n%s%s%s%s\n", tab2, "static",
- declarator<T>::type_name, "denorm_min() throw()",
- tab2, "{ return static_cast<", declarator<T>::type_name,
- ">(0); }");
+ printf("%s%s %s %s\n%s%s%s%s\n", tab2, "static",
+ declarator<T>::type_name, "denorm_min() throw()",
+ tab2, "{ return static_cast<", declarator<T>::type_name,
+ ">(0); }");
}
-};
+ };
template<typename T>
void is_iec559()
{
- printf("%s%s = %s;\n", tab2, "static const bool is_iec559",
- bool_alpha[predicate<T>::is_iec559]);
+ printf("%s%s = %s;\n", tab2, "static const bool is_iec559",
+ bool_alpha[predicate<T>::is_iec559]);
}
// tinyness_before
template<typename T>
void tinyness_before()
{
- printf("%s%s;\n", tab2, "static const bool tinyness_before = false");
+ printf("%s%s;\n", tab2, "static const bool tinyness_before = false");
}
// round style
template<typename T>
void round_style()
{
- printf("%s%s;\n", tab2, "static const float_round_style "
- "round_style = round_toward_zero");
+ printf("%s%s;\n", tab2, "static const float_round_style "
+ "round_style = round_toward_zero");
}
// type traits
-template<typename T> struct type_trait {
-
+template<typename T>
+ struct type_trait
+ {
type_trait()
{
- declarator<T>::start();
- printf("%s%s;\n\n", tab2, "static const bool is_specialized = true");
- min<T>();
- max<T>();
- printf("\n");
- digits<T>();
- digits10<T>();
- is_signed<T>();
- is_integer<T>();
- is_exact<T>();
- radix<T>();
- epsilon<T>();
- round_error<T>();
- printf("\n");
- min_exponent<T>();
- min_exponent10<T>();
- max_exponent<T>();
- max_exponent10<T>();
- printf("\n");
- has_infinity<T>();
- has_quiet_nan<T>();
- has_signaling_nan<T>();
- infinity_trait<T>::has_denorm();
- has_denorm_loss<T>();
- printf("\n");
- infinity_trait<T>::infinity();
- infinity_trait<T>::quiet_NaN();
- infinity_trait<T>::signaling_NaN();
- infinity_trait<T>::denorm_min();
- printf("\n");
- is_iec559<T>();
- printf("%s%s;\n", tab2, "static const bool is_bounded = true");
- is_modulo<T>();
- printf("\n");
- traps<T>();
- tinyness_before<T>();
- round_style<T>();
- declarator<T>::end();
+ declarator<T>::start();
+ printf("%s%s;\n\n", tab2, "static const bool is_specialized = true");
+ min<T>();
+ max<T>();
+ printf("\n");
+ digits<T>();
+ digits10<T>();
+ is_signed<T>();
+ is_integer<T>();
+ is_exact<T>();
+ radix<T>();
+ epsilon<T>();
+ round_error<T>();
+ printf("\n");
+ min_exponent<T>();
+ min_exponent10<T>();
+ max_exponent<T>();
+ max_exponent10<T>();
+ printf("\n");
+ has_infinity<T>();
+ has_quiet_nan<T>();
+ has_signaling_nan<T>();
+ infinity_trait<T>::has_denorm();
+ has_denorm_loss<T>();
+ printf("\n");
+ infinity_trait<T>::infinity();
+ infinity_trait<T>::quiet_NaN();
+ infinity_trait<T>::signaling_NaN();
+ infinity_trait<T>::denorm_min();
+ printf("\n");
+ is_iec559<T>();
+ printf("%s%s;\n", tab2, "static const bool is_bounded = true");
+ is_modulo<T>();
+ printf("\n");
+ traps<T>();
+ tinyness_before<T>();
+ round_style<T>();
+ declarator<T>::end();
}
-};
+ };
int main()
{
- type_trait<bool>();
-
- type_trait<char>();
- type_trait<signed char>();
- type_trait<unsigned char>();
+ type_trait<bool>();
+
+ type_trait<char>();
+ type_trait<signed char>();
+ type_trait<unsigned char>();
#if defined( _GLIBCPP_USE_WCHAR_T)
- type_trait<wchar_t>();
+ type_trait<wchar_t>();
#endif
-
- type_trait<short>();
- type_trait<unsigned short>();
-
- type_trait<int>();
- type_trait<unsigned int>();
-
- type_trait<long>();
- type_trait<unsigned long>();
-
+
+ type_trait<short>();
+ type_trait<unsigned short>();
+
+ type_trait<int>();
+ type_trait<unsigned int>();
+
+ type_trait<long>();
+ type_trait<unsigned long>();
+
#ifdef _GLIBCPP_USE_LONG_LONG
- type_trait<long long>();
- type_trait<unsigned long long>();
+ type_trait<long long>();
+ type_trait<unsigned long long>();
#endif
- type_trait<float>();
- type_trait<double>();
- type_trait<long double>();
-
- // x86/linux gets this weirdness for the min/max functions:
- // static long double min() throw()
- // { return (__extension__ ((union __convert_long_double)
- // {__convert_long_double_i: {0x0, 0x80000000, 0x1, 0x0}})
- // .__convert_long_double_d); }
+ type_trait<float>();
+ type_trait<double>();
+ type_trait<long double>();
+
+ // x86/linux gets this weirdness for the min/max functions:
+ // static long double min() throw()
+ // { return (__extension__ ((union __convert_long_double)
+ // {__convert_long_double_i: {0x0, 0x80000000, 0x1, 0x0}})
+ // .__convert_long_double_d); }
}
// G++ doesn't have support for automatic instantiation of static data
@@ -810,4 +839,6 @@ INSTANTIATIONS (unsigned long);
INSTANTIATIONS (float);
INSTANTIATIONS (double);
INSTANTIATIONS (long double);
-
+#ifdef _GLIBCPP_USE_WCHAR_T
+INSTANTIATIONS (wchar_t);
+#endif
diff --git a/libstdc++-v3/src/globals.cc b/libstdc++-v3/src/globals.cc
index bd24d8fa00d..d70cc295407 100644
--- a/libstdc++-v3/src/globals.cc
+++ b/libstdc++-v3/src/globals.cc
@@ -25,37 +25,81 @@
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
-// On AIX, and perhaps other systems, library initialization order
-// is not guaranteed. For example, the static initializers for the
-// main program might run before the static initializers for this
-// library. That means that we cannot rely on static initialization in
-// the library; there is no guarantee that things will get initialized
-// in time. This file contains definitions of all global variables
-// that require initialization as arrays of characters.
-
+#include "bits/c++config.h"
+#include "bits/gthr.h"
+#include <fstream>
#include <istream>
#include <ostream>
-namespace std {
- typedef char fake_istream[sizeof (istream)]
- __attribute__ ((aligned (__alignof__ (istream))));
- typedef char fake_ostream[sizeof (ostream)]
- __attribute__ ((aligned (__alignof__ (ostream))));
+// On AIX, and perhaps other systems, library initialization order is
+// not guaranteed. For example, the static initializers for the main
+// program might run before the static initializers for this library.
+// That means that we cannot rely on static initialization in the
+// library; there is no guarantee that things will get initialized in
+// time. This file contains definitions of all global variables that
+// require initialization as arrays of characters.
+// Because <iostream> declares the standard streams to be [io]stream
+// types instead of say [io]fstream types, it is also necessary to
+// allocate the actual file buffers in this file.
+namespace std
+{
+ typedef char fake_istream[sizeof(istream)]
+ __attribute__ ((aligned(__alignof__(istream))));
+ typedef char fake_ostream[sizeof(ostream)]
+ __attribute__ ((aligned(__alignof__(ostream))));
fake_istream cin;
fake_ostream cout;
fake_ostream cerr;
fake_ostream clog;
-#ifdef _GLIBCPP_USE_WCHAR_T
- typedef char fake_wistream[sizeof (wistream)]
- __attribute__ ((aligned (__alignof__ (wistream))));
- typedef char fake_wostream[sizeof (wostream)]
- __attribute__ ((aligned (__alignof__ (wostream))));
+ typedef char fake_filebuf[sizeof(filebuf)]
+ __attribute__ ((aligned(__alignof__(filebuf))));
+ fake_filebuf buf_cout;
+ fake_filebuf buf_cin;
+ fake_filebuf buf_cerr;
+#ifdef _GLIBCPP_USE_WCHAR_T
+ typedef char fake_wistream[sizeof(wistream)]
+ __attribute__ ((aligned(__alignof__(wistream))));
+ typedef char fake_wostream[sizeof(wostream)]
+ __attribute__ ((aligned(__alignof__(wostream))));
fake_wistream wcin;
fake_wostream wcout;
fake_wostream wcerr;
fake_wostream wclog;
+
+ typedef char fake_wfilebuf[sizeof(wfilebuf)]
+ __attribute__ ((aligned(__alignof__(wfilebuf))));
+ fake_wfilebuf buf_wcout;
+ fake_wfilebuf buf_wcin;
+ fake_wfilebuf buf_wcerr;
+#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.
+#if __GTHREADS
+#ifdef __GTHREAD_MUTEX_INIT
+// This path is not needed since static initialization of mutexs works
+// on this platform.
+#elif defined(__GTHREAD_MUTEX_INIT_FUNCTION)
+__gthread_once_t _GLIBCPP_once = __GTHREAD_ONCE_INIT;
+__gthread_mutex_t _GLIBCPP_mutex;
+__gthread_mutex_t *_GLIBCPP_mutex_address;
+
+// Once-only initializer function for _GLIBCPP_mutex.
+void
+_GLIBCPP_mutex_init ()
+{
+ __GTHREAD_MUTEX_INIT_FUNCTION (&_GLIBCPP_mutex);
+}
+// Once-only initializer function for _GLIBCPP_mutex_address.
+void
+_GLIBCPP_mutex_address_init ()
+{
+ __GTHREAD_MUTEX_INIT_FUNCTION (_GLIBCPP_mutex_address);
+}
+#endif
#endif
}
diff --git a/libstdc++-v3/src/ios.cc b/libstdc++-v3/src/ios.cc
index b6ab7663ed0..244585e9884 100644
--- a/libstdc++-v3/src/ios.cc
+++ b/libstdc++-v3/src/ios.cc
@@ -38,6 +38,25 @@
namespace std
{
+ // Extern declarations for global objects in src/globals.cc.
+ extern istream cin;
+ extern ostream cout;
+ extern ostream cerr;
+ extern ostream clog;
+ extern filebuf buf_cout;
+ extern filebuf buf_cin;
+ extern filebuf buf_cerr;
+
+#ifdef _GLIBCPP_USE_WCHAR_T
+ extern wistream wcin;
+ extern wostream wcout;
+ extern wostream wcerr;
+ extern wostream wclog;
+ extern wfilebuf buf_wcout;
+ extern wfilebuf buf_wcin;
+ extern wfilebuf buf_wcerr;
+#endif
+
// Definitions for static const data members of __ios_flags.
const __ios_flags::__int_type __ios_flags::_S_boolalpha;
const __ios_flags::__int_type __ios_flags::_S_dec;
@@ -109,17 +128,6 @@ namespace std
int ios_base::Init::_S_ios_base_init = 0;
bool ios_base::Init::_S_synced_with_stdio = true;
- extern istream cin;
- extern ostream cout;
- extern ostream cerr;
- extern ostream clog;
-#ifdef _GLIBCPP_USE_WCHAR_T
- extern wistream wcin;
- extern wostream wcout;
- extern wostream wcerr;
- extern wostream wclog;
-#endif
-
ios_base::failure::failure(const string& __str) throw()
{
strncpy(_M_name, __str.c_str(), _M_bufsize);
@@ -133,63 +141,73 @@ namespace std
ios_base::failure::what() const throw()
{ return _M_name; }
- ios_base::Init::Init()
+ void
+ ios_base::Init::_S_ios_create(bool __sync)
{
- if (++_S_ios_base_init == 1)
- {
- // NB: std_iostream.h creates the four standard files with
- // NULL buffers. At this point, we swap out these placeholder
- // objects for the properly-constructed ones
- _M_cout = new filebuf(1, "stdout", ios_base::out);
- _M_cin = new filebuf(0, "stdin", ios_base::in);
- _M_cerr = new filebuf(2, "stderr", ios_base::out);
- new (&cout) ostream(_M_cout);
- new (&cin) istream(_M_cin);
- new (&cerr) ostream(_M_cerr);
- new (&clog) ostream(_M_cerr);
- cin.tie(&cout);
- cerr.flags(ios_base::unitbuf);
+ int __bufsize = __sync ? 0 : static_cast<int>(BUFSIZ);
+
+ // NB: The file globals.cc creates the four standard files
+ // with NULL buffers. At this point, we swap out the dummy NULL
+ // [io]stream objects and buffers with the real deal.
+ new (&buf_cout) filebuf(stdout, ios_base::out, __bufsize);
+ new (&buf_cin) filebuf(stdin, ios_base::in, 1);
+ new (&buf_cerr) filebuf(stderr, ios_base::out, __bufsize);
+ new (&cout) ostream(&buf_cout);
+ new (&cin) istream(&buf_cin);
+ new (&cerr) ostream(&buf_cerr);
+ new (&clog) ostream(&buf_cerr);
+ cin.tie(&cout);
+ cerr.flags(ios_base::unitbuf);
+
+#ifdef _GLIBCPP_USE_WCHAR_T
+ new (&buf_wcout) wfilebuf(stdout, ios_base::out, __bufsize);
+ new (&buf_wcin) wfilebuf(stdin, ios_base::in, 1);
+ new (&buf_wcerr) wfilebuf(stderr, ios_base::out, __bufsize);
+ new (&wcout) wostream(&buf_wcout);
+ new (&wcin) wistream(&buf_wcin);
+ new (&wcerr) wostream(&buf_wcerr);
+ new (&wclog) wostream(&buf_wcerr);
+ wcin.tie(&wcout);
+ wcerr.flags(ios_base::unitbuf);
+#endif
+ }
+ void
+ ios_base::Init::_S_ios_destroy()
+ {
+ // Explicitly call dtors to free any memory that is dynamically
+ // allocated by filebuf ctor or member functions, but don't
+ // deallocate all memory by calling operator delete.
+ cout.flush();
+ cerr.flush();
+ clog.flush();
+ buf_cout.~filebuf();
+ buf_cin.~filebuf();
+ buf_cerr.~filebuf();
#ifdef _GLIBCPP_USE_WCHAR_T
- _M_wcout = new wfilebuf(1, "stdout", ios_base::out);
- _M_wcin = new wfilebuf(0, "stdin", ios_base::in);
- _M_wcerr = new wfilebuf(2, "stderr", ios_base::out);
- new (&wcout) wostream(_M_wcout);
- new (&wcin) wistream(_M_wcin);
- new (&wcerr) wostream(_M_wcerr);
- new (&wclog) wostream(_M_wcerr);
- wcin.tie(&wcout);
- wcerr.flags(ios_base::unitbuf);
+ wcout.flush();
+ wcerr.flush();
+ wclog.flush();
+ buf_wcout.~wfilebuf();
+ buf_wcin.~wfilebuf();
+ buf_wcerr.~wfilebuf();
#endif
+ }
+
+ ios_base::Init::Init()
+ {
+ if (++_S_ios_base_init == 1)
+ {
+ // Standard streams default to synced with "C" operations.
ios_base::Init::_S_synced_with_stdio = true;
+ _S_ios_create(ios_base::Init::_S_synced_with_stdio);
}
}
ios_base::Init::~Init()
{
if (--_S_ios_base_init == 0)
- {
- cout.flush();
- cerr.flush();
- clog.flush();
- delete _M_cout;
- delete _M_cin;
- delete _M_cerr;
- _M_cout = NULL;
- _M_cin = NULL;
- _M_cerr = NULL;
-#ifdef _GLIBCPP_USE_WCHAR_T
- wcout.flush();
- wcerr.flush();
- wclog.flush();
- delete _M_wcout;
- delete _M_wcin;
- delete _M_wcerr;
- _M_wcout = NULL;
- _M_wcin = NULL;
- _M_wcerr = NULL;
-#endif
- }
+ _S_ios_destroy();
}
// 27.4.2.5 ios_base storage functions
@@ -323,42 +341,11 @@ namespace std
// currently synchronized.
if (!__sync && __ret)
{
-#if 0
- // no longer need to do this
- // Need to dispose of the buffers created at initialization.
- __ioinit._M_cout->~filebuf();
- __ioinit._M_cin->~filebuf();
- __ioinit._M_cerr->~filebuf();
- __ioinit._M_cout = new filebuf();
- __ioinit._M_cin = new filebuf();
- __ioinit._M_cerr = new filebuf();
- __ioinit._M_cout->open("stdout", ios_base::out);
- __ioinit._M_cin->open("stdin", ios_base::in);
- __ioinit._M_cerr->open("stderr", ios_base::out);
- cout.rdbuf(__ioinit._M_cout);
- cin.rdbuf(__ioinit._M_cin);
- cerr.rdbuf(__ioinit._M_cerr);
- cerr.flags(ios_base::unitbuf);
- clog.rdbuf(__ioinit._M_cerr);
-#endif
-#ifdef _GLIBCPP_USE_WCHAR_T
-#endif
ios_base::Init::_S_synced_with_stdio = false;
+ ios_base::Init::_S_ios_destroy();
+ ios_base::Init::_S_ios_create(ios_base::Init::_S_synced_with_stdio);
}
-
return __ret;
}
-
} // namespace std
-
-
-
-
-
-
-
-
-
-
-
diff --git a/libstdc++-v3/src/limits.cc b/libstdc++-v3/src/limits.cc
new file mode 100644
index 00000000000..96a10f9d048
--- /dev/null
+++ b/libstdc++-v3/src/limits.cc
@@ -0,0 +1,427 @@
+// Static data members of -*- C++ -*- numeric_limits classes
+
+// Copyright (C) 1999, 2001 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.
+
+// Written by Gabriel Dos Reis <Gabriel.Dos-Reis@cmla.ens-cachan.fr>
+
+//
+// ISO C++ 14882:1998
+// 18.2.1
+//
+
+#include <bits/std_limits.h>
+namespace std
+{
+ // bool
+ const bool numeric_limits<bool>::is_specialized;
+ const int numeric_limits<bool>::digits;
+ const int numeric_limits<bool>::digits10;
+ const bool numeric_limits<bool>::is_signed;
+ const bool numeric_limits<bool>::is_integer;
+ const bool numeric_limits<bool>::is_exact;
+ const int numeric_limits<bool>::radix;
+ const int numeric_limits<bool>::min_exponent;
+ const int numeric_limits<bool>::min_exponent10;
+ const int numeric_limits<bool>::max_exponent;
+ const int numeric_limits<bool>::max_exponent10;
+ const bool numeric_limits<bool>::has_infinity;
+ const bool numeric_limits<bool>::has_quiet_NaN;
+ const bool numeric_limits<bool>::has_signaling_NaN;
+ const float_denorm_style numeric_limits<bool>::has_denorm;
+ const bool numeric_limits<bool>::has_denorm_loss;
+ const bool numeric_limits<bool>::is_iec559;
+ const bool numeric_limits<bool>::is_bounded;
+ const bool numeric_limits<bool>::is_modulo;
+ const bool numeric_limits<bool>::traps;
+ const bool numeric_limits<bool>::tinyness_before;
+ const float_round_style numeric_limits<bool>::round_style;
+
+ // char
+ const bool numeric_limits<char>::is_specialized;
+ const int numeric_limits<char>::digits;
+ const int numeric_limits<char>::digits10;
+ const bool numeric_limits<char>::is_signed;
+ const bool numeric_limits<char>::is_integer;
+ const bool numeric_limits<char>::is_exact;
+ const int numeric_limits<char>::radix;
+ const int numeric_limits<char>::min_exponent;
+ const int numeric_limits<char>::min_exponent10;
+ const int numeric_limits<char>::max_exponent;
+ const int numeric_limits<char>::max_exponent10;
+ const bool numeric_limits<char>::has_infinity;
+ const bool numeric_limits<char>::has_quiet_NaN;
+ const bool numeric_limits<char>::has_signaling_NaN;
+ const float_denorm_style numeric_limits<char>::has_denorm;
+ const bool numeric_limits<char>::has_denorm_loss;
+ const bool numeric_limits<char>::is_iec559;
+ const bool numeric_limits<char>::is_bounded;
+ const bool numeric_limits<char>::is_modulo;
+ const bool numeric_limits<char>::traps;
+ const bool numeric_limits<char>::tinyness_before;
+ const float_round_style numeric_limits<char>::round_style;
+
+ // signed char
+ const bool numeric_limits<signed char>::is_specialized;
+ const int numeric_limits<signed char>::digits;
+ const int numeric_limits<signed char>::digits10;
+ const bool numeric_limits<signed char>::is_signed;
+ const bool numeric_limits<signed char>::is_integer;
+ const bool numeric_limits<signed char>::is_exact;
+ const int numeric_limits<signed char>::radix;
+ const int numeric_limits<signed char>::min_exponent;
+ const int numeric_limits<signed char>::min_exponent10;
+ const int numeric_limits<signed char>::max_exponent;
+ const int numeric_limits<signed char>::max_exponent10;
+ const bool numeric_limits<signed char>::has_infinity;
+ const bool numeric_limits<signed char>::has_quiet_NaN;
+ const bool numeric_limits<signed char>::has_signaling_NaN;
+ const float_denorm_style numeric_limits<signed char>::has_denorm;
+ const bool numeric_limits<signed char>::has_denorm_loss;
+ const bool numeric_limits<signed char>::is_iec559;
+ const bool numeric_limits<signed char>::is_bounded;
+ const bool numeric_limits<signed char>::is_modulo;
+ const bool numeric_limits<signed char>::traps;
+ const bool numeric_limits<signed char>::tinyness_before;
+ const float_round_style numeric_limits<signed char>::round_style;
+
+ // unsigned char
+ const bool numeric_limits<unsigned char>::is_specialized;
+ const int numeric_limits<unsigned char>::digits;
+ const int numeric_limits<unsigned char>::digits10;
+ const bool numeric_limits<unsigned char>::is_signed;
+ const bool numeric_limits<unsigned char>::is_integer;
+ const bool numeric_limits<unsigned char>::is_exact;
+ const int numeric_limits<unsigned char>::radix;
+ const int numeric_limits<unsigned char>::min_exponent;
+ const int numeric_limits<unsigned char>::min_exponent10;
+ const int numeric_limits<unsigned char>::max_exponent;
+ const int numeric_limits<unsigned char>::max_exponent10;
+ const bool numeric_limits<unsigned char>::has_infinity;
+ const bool numeric_limits<unsigned char>::has_quiet_NaN;
+ const bool numeric_limits<unsigned char>::has_signaling_NaN;
+ const float_denorm_style numeric_limits<unsigned char>::has_denorm;
+ const bool numeric_limits<unsigned char>::has_denorm_loss;
+ const bool numeric_limits<unsigned char>::is_iec559;
+ const bool numeric_limits<unsigned char>::is_bounded;
+ const bool numeric_limits<unsigned char>::is_modulo;
+ const bool numeric_limits<unsigned char>::traps;
+ const bool numeric_limits<unsigned char>::tinyness_before;
+ const float_round_style numeric_limits<unsigned char>::round_style;
+
+ // wchar_t
+ // This used to be problematic...
+#ifdef _GLIBCPP_USE_WCHAR_T
+ const bool numeric_limits<wchar_t>::is_specialized;
+ const int numeric_limits<wchar_t>::digits;
+ const int numeric_limits<wchar_t>::digits10;
+ const bool numeric_limits<wchar_t>::is_signed;
+ const bool numeric_limits<wchar_t>::is_integer;
+ const bool numeric_limits<wchar_t>::is_exact;
+ const int numeric_limits<wchar_t>::radix;
+ const int numeric_limits<wchar_t>::min_exponent;
+ const int numeric_limits<wchar_t>::min_exponent10;
+ const int numeric_limits<wchar_t>::max_exponent;
+ const int numeric_limits<wchar_t>::max_exponent10;
+ const bool numeric_limits<wchar_t>::has_infinity;
+ const bool numeric_limits<wchar_t>::has_quiet_NaN;
+ const bool numeric_limits<wchar_t>::has_signaling_NaN;
+ const float_denorm_style numeric_limits<wchar_t>::has_denorm;
+ const bool numeric_limits<wchar_t>::has_denorm_loss;
+ const bool numeric_limits<wchar_t>::is_iec559;
+ const bool numeric_limits<wchar_t>::is_bounded;
+ const bool numeric_limits<wchar_t>::is_modulo;
+ const bool numeric_limits<wchar_t>::traps;
+ const bool numeric_limits<wchar_t>::tinyness_before;
+ const float_round_style numeric_limits<wchar_t>::round_style;
+#endif // _GLIBCPP_USE_WCHAR_T
+
+ // short
+ const bool numeric_limits<short>::is_specialized;
+ const int numeric_limits<short>::digits;
+ const int numeric_limits<short>::digits10;
+ const bool numeric_limits<short>::is_signed;
+ const bool numeric_limits<short>::is_integer;
+ const bool numeric_limits<short>::is_exact;
+ const int numeric_limits<short>::radix;
+ const int numeric_limits<short>::min_exponent;
+ const int numeric_limits<short>::min_exponent10;
+ const int numeric_limits<short>::max_exponent;
+ const int numeric_limits<short>::max_exponent10;
+ const bool numeric_limits<short>::has_infinity;
+ const bool numeric_limits<short>::has_quiet_NaN;
+ const bool numeric_limits<short>::has_signaling_NaN;
+ const float_denorm_style numeric_limits<short>::has_denorm;
+ const bool numeric_limits<short>::has_denorm_loss;
+ const bool numeric_limits<short>::is_iec559;
+ const bool numeric_limits<short>::is_bounded;
+ const bool numeric_limits<short>::is_modulo;
+ const bool numeric_limits<short>::traps;
+ const bool numeric_limits<short>::tinyness_before;
+ const float_round_style numeric_limits<short>::round_style;
+
+ // unsigned short
+ const bool numeric_limits<unsigned short>::is_specialized;
+ const int numeric_limits<unsigned short>::digits;
+ const int numeric_limits<unsigned short>::digits10;
+ const bool numeric_limits<unsigned short>::is_signed;
+ const bool numeric_limits<unsigned short>::is_integer;
+ const bool numeric_limits<unsigned short>::is_exact;
+ const int numeric_limits<unsigned short>::radix;
+ const int numeric_limits<unsigned short>::min_exponent;
+ const int numeric_limits<unsigned short>::min_exponent10;
+ const int numeric_limits<unsigned short>::max_exponent;
+ const int numeric_limits<unsigned short>::max_exponent10;
+ const bool numeric_limits<unsigned short>::has_infinity;
+ const bool numeric_limits<unsigned short>::has_quiet_NaN;
+ const bool numeric_limits<unsigned short>::has_signaling_NaN;
+ const float_denorm_style numeric_limits<unsigned short>::has_denorm;
+ const bool numeric_limits<unsigned short>::has_denorm_loss;
+ const bool numeric_limits<unsigned short>::is_iec559;
+ const bool numeric_limits<unsigned short>::is_bounded;
+ const bool numeric_limits<unsigned short>::is_modulo;
+ const bool numeric_limits<unsigned short>::traps;
+ const bool numeric_limits<unsigned short>::tinyness_before;
+ const float_round_style numeric_limits<unsigned short>::round_style;
+
+ // int
+ const bool numeric_limits<int>::is_specialized;
+ const int numeric_limits<int>::digits;
+ const int numeric_limits<int>::digits10;
+ const bool numeric_limits<int>::is_signed;
+ const bool numeric_limits<int>::is_integer;
+ const bool numeric_limits<int>::is_exact;
+ const int numeric_limits<int>::radix;
+ const int numeric_limits<int>::min_exponent;
+ const int numeric_limits<int>::min_exponent10;
+ const int numeric_limits<int>::max_exponent;
+ const int numeric_limits<int>::max_exponent10;
+ const bool numeric_limits<int>::has_infinity;
+ const bool numeric_limits<int>::has_quiet_NaN;
+ const bool numeric_limits<int>::has_signaling_NaN;
+ const float_denorm_style numeric_limits<int>::has_denorm;
+ const bool numeric_limits<int>::has_denorm_loss;
+ const bool numeric_limits<int>::is_iec559;
+ const bool numeric_limits<int>::is_bounded;
+ const bool numeric_limits<int>::is_modulo;
+ const bool numeric_limits<int>::traps;
+ const bool numeric_limits<int>::tinyness_before;
+ const float_round_style numeric_limits<int>::round_style;
+
+ // unsigned int
+ const bool numeric_limits<unsigned int>::is_specialized;
+ const int numeric_limits<unsigned int>::digits;
+ const int numeric_limits<unsigned int>::digits10;
+ const bool numeric_limits<unsigned int>::is_signed;
+ const bool numeric_limits<unsigned int>::is_integer;
+ const bool numeric_limits<unsigned int>::is_exact;
+ const int numeric_limits<unsigned int>::radix;
+ const int numeric_limits<unsigned int>::min_exponent;
+ const int numeric_limits<unsigned int>::min_exponent10;
+ const int numeric_limits<unsigned int>::max_exponent;
+ const int numeric_limits<unsigned int>::max_exponent10;
+ const bool numeric_limits<unsigned int>::has_infinity;
+ const bool numeric_limits<unsigned int>::has_quiet_NaN;
+ const bool numeric_limits<unsigned int>::has_signaling_NaN;
+ const float_denorm_style numeric_limits<unsigned int>::has_denorm;
+ const bool numeric_limits<unsigned int>::has_denorm_loss;
+ const bool numeric_limits<unsigned int>::is_iec559;
+ const bool numeric_limits<unsigned int>::is_bounded;
+ const bool numeric_limits<unsigned int>::is_modulo;
+ const bool numeric_limits<unsigned int>::traps;
+ const bool numeric_limits<unsigned int>::tinyness_before;
+ const float_round_style numeric_limits<unsigned int>::round_style;
+
+ // long
+ const bool numeric_limits<long>::is_specialized;
+ const int numeric_limits<long>::digits;
+ const int numeric_limits<long>::digits10;
+ const bool numeric_limits<long>::is_signed;
+ const bool numeric_limits<long>::is_integer;
+ const bool numeric_limits<long>::is_exact;
+ const int numeric_limits<long>::radix;
+ const int numeric_limits<long>::min_exponent;
+ const int numeric_limits<long>::min_exponent10;
+ const int numeric_limits<long>::max_exponent;
+ const int numeric_limits<long>::max_exponent10;
+ const bool numeric_limits<long>::has_infinity;
+ const bool numeric_limits<long>::has_quiet_NaN;
+ const bool numeric_limits<long>::has_signaling_NaN;
+ const float_denorm_style numeric_limits<long>::has_denorm;
+ const bool numeric_limits<long>::has_denorm_loss;
+ const bool numeric_limits<long>::is_iec559;
+ const bool numeric_limits<long>::is_bounded;
+ const bool numeric_limits<long>::is_modulo;
+ const bool numeric_limits<long>::traps;
+ const bool numeric_limits<long>::tinyness_before;
+ const float_round_style numeric_limits<long>::round_style;
+
+ // unsigned long
+ const bool numeric_limits<unsigned long>::is_specialized;
+ const int numeric_limits<unsigned long>::digits;
+ const int numeric_limits<unsigned long>::digits10;
+ const bool numeric_limits<unsigned long>::is_signed;
+ const bool numeric_limits<unsigned long>::is_integer;
+ const bool numeric_limits<unsigned long>::is_exact;
+ const int numeric_limits<unsigned long>::radix;
+ const int numeric_limits<unsigned long>::min_exponent;
+ const int numeric_limits<unsigned long>::min_exponent10;
+ const int numeric_limits<unsigned long>::max_exponent;
+ const int numeric_limits<unsigned long>::max_exponent10;
+ const bool numeric_limits<unsigned long>::has_infinity;
+ const bool numeric_limits<unsigned long>::has_quiet_NaN;
+ const bool numeric_limits<unsigned long>::has_signaling_NaN;
+ const float_denorm_style numeric_limits<unsigned long>::has_denorm;
+ const bool numeric_limits<unsigned long>::has_denorm_loss;
+ const bool numeric_limits<unsigned long>::is_iec559;
+ const bool numeric_limits<unsigned long>::is_bounded;
+ const bool numeric_limits<unsigned long>::is_modulo;
+ const bool numeric_limits<unsigned long>::traps;
+ const bool numeric_limits<unsigned long>::tinyness_before;
+ const float_round_style numeric_limits<unsigned long>::round_style;
+
+ // NOTA BENE: long long is an extension
+ const bool numeric_limits<long long>::is_specialized;
+ const int numeric_limits<long long>::digits;
+ const int numeric_limits<long long>::digits10;
+ const bool numeric_limits<long long>::is_signed;
+ const bool numeric_limits<long long>::is_integer;
+ const bool numeric_limits<long long>::is_exact;
+ const int numeric_limits<long long>::radix;
+ const int numeric_limits<long long>::min_exponent;
+ const int numeric_limits<long long>::min_exponent10;
+ const int numeric_limits<long long>::max_exponent;
+ const int numeric_limits<long long>::max_exponent10;
+ const bool numeric_limits<long long>::has_infinity;
+ const bool numeric_limits<long long>::has_quiet_NaN;
+ const bool numeric_limits<long long>::has_signaling_NaN;
+ const float_denorm_style numeric_limits<long long>::has_denorm;
+ const bool numeric_limits<long long>::has_denorm_loss;
+ const bool numeric_limits<long long>::is_iec559;
+ const bool numeric_limits<long long>::is_bounded;
+ const bool numeric_limits<long long>::is_modulo;
+ const bool numeric_limits<long long>::traps;
+ const bool numeric_limits<long long>::tinyness_before;
+ const float_round_style numeric_limits<long long>::round_style;
+
+ const bool numeric_limits<unsigned long long>::is_specialized;
+ const int numeric_limits<unsigned long long>::digits;
+ const int numeric_limits<unsigned long long>::digits10;
+ const bool numeric_limits<unsigned long long>::is_signed;
+ const bool numeric_limits<unsigned long long>::is_integer;
+ const bool numeric_limits<unsigned long long>::is_exact;
+ const int numeric_limits<unsigned long long>::radix;
+ const int numeric_limits<unsigned long long>::min_exponent;
+ const int numeric_limits<unsigned long long>::min_exponent10;
+ const int numeric_limits<unsigned long long>::max_exponent;
+ const int numeric_limits<unsigned long long>::max_exponent10;
+ const bool numeric_limits<unsigned long long>::has_infinity;
+ const bool numeric_limits<unsigned long long>::has_quiet_NaN;
+ const bool numeric_limits<unsigned long long>::has_signaling_NaN;
+ const float_denorm_style numeric_limits<unsigned long long>::has_denorm;
+ const bool numeric_limits<unsigned long long>::has_denorm_loss;
+ const bool numeric_limits<unsigned long long>::is_iec559;
+ const bool numeric_limits<unsigned long long>::is_bounded;
+ const bool numeric_limits<unsigned long long>::is_modulo;
+ const bool numeric_limits<unsigned long long>::traps;
+ const bool numeric_limits<unsigned long long>::tinyness_before;
+ const float_round_style numeric_limits<unsigned long long>::round_style;
+
+ // float
+ const bool numeric_limits<float>::is_specialized;
+ const int numeric_limits<float>::digits;
+ const int numeric_limits<float>::digits10;
+ const bool numeric_limits<float>::is_signed;
+ const bool numeric_limits<float>::is_integer;
+ const bool numeric_limits<float>::is_exact;
+ const int numeric_limits<float>::radix;
+ const int numeric_limits<float>::min_exponent;
+ const int numeric_limits<float>::min_exponent10;
+ const int numeric_limits<float>::max_exponent;
+ const int numeric_limits<float>::max_exponent10;
+ const bool numeric_limits<float>::has_infinity;
+ const bool numeric_limits<float>::has_quiet_NaN;
+ const bool numeric_limits<float>::has_signaling_NaN;
+ const float_denorm_style numeric_limits<float>::has_denorm;
+ const bool numeric_limits<float>::has_denorm_loss;
+ const bool numeric_limits<float>::is_iec559;
+ const bool numeric_limits<float>::is_bounded;
+ const bool numeric_limits<float>::is_modulo;
+ const bool numeric_limits<float>::traps;
+ const bool numeric_limits<float>::tinyness_before;
+ const float_round_style numeric_limits<float>::round_style;
+
+ // double
+ const bool numeric_limits<double>::is_specialized;
+ const int numeric_limits<double>::digits;
+ const int numeric_limits<double>::digits10;
+ const bool numeric_limits<double>::is_signed;
+ const bool numeric_limits<double>::is_integer;
+ const bool numeric_limits<double>::is_exact;
+ const int numeric_limits<double>::radix;
+ const int numeric_limits<double>::min_exponent;
+ const int numeric_limits<double>::min_exponent10;
+ const int numeric_limits<double>::max_exponent;
+ const int numeric_limits<double>::max_exponent10;
+ const bool numeric_limits<double>::has_infinity;
+ const bool numeric_limits<double>::has_quiet_NaN;
+ const bool numeric_limits<double>::has_signaling_NaN;
+ const float_denorm_style numeric_limits<double>::has_denorm;
+ const bool numeric_limits<double>::has_denorm_loss;
+ const bool numeric_limits<double>::is_iec559;
+ const bool numeric_limits<double>::is_bounded;
+ const bool numeric_limits<double>::is_modulo;
+ const bool numeric_limits<double>::traps;
+ const bool numeric_limits<double>::tinyness_before;
+ const float_round_style numeric_limits<double>::round_style;
+
+ // long double
+ const bool numeric_limits<long double>::is_specialized;
+ const int numeric_limits<long double>::digits;
+ const int numeric_limits<long double>::digits10;
+ const bool numeric_limits<long double>::is_signed;
+ const bool numeric_limits<long double>::is_integer;
+ const bool numeric_limits<long double>::is_exact;
+ const int numeric_limits<long double>::radix;
+ const int numeric_limits<long double>::min_exponent;
+ const int numeric_limits<long double>::min_exponent10;
+ const int numeric_limits<long double>::max_exponent;
+ const int numeric_limits<long double>::max_exponent10;
+ const bool numeric_limits<long double>::has_infinity;
+ const bool numeric_limits<long double>::has_quiet_NaN;
+ const bool numeric_limits<long double>::has_signaling_NaN;
+ const float_denorm_style numeric_limits<long double>::has_denorm;
+ const bool numeric_limits<long double>::has_denorm_loss;
+ const bool numeric_limits<long double>::is_iec559;
+ const bool numeric_limits<long double>::is_bounded;
+ const bool numeric_limits<long double>::is_modulo;
+ const bool numeric_limits<long double>::traps;
+ const bool numeric_limits<long double>::tinyness_before;
+ const float_round_style numeric_limits<long double>::round_style;
+} // namespace std
+
+
diff --git a/libstdc++-v3/src/locale-inst.cc b/libstdc++-v3/src/locale-inst.cc
index b6cd5252be3..0b9cf7564ea 100644
--- a/libstdc++-v3/src/locale-inst.cc
+++ b/libstdc++-v3/src/locale-inst.cc
@@ -42,8 +42,8 @@
#include <bits/std_istream.h>
#include <bits/std_ostream.h>
-namespace std {
-
+namespace std
+{
typedef ostreambuf_iterator<char, char_traits<char> > obuf_iterator;
typedef istreambuf_iterator<char, char_traits<char> > ibuf_iterator;
typedef ostreambuf_iterator<wchar_t, char_traits<wchar_t> > wobuf_iterator;
@@ -170,11 +170,30 @@ namespace std {
// has_facet
template
bool
- has_facet<numpunct<char> >(const locale &);
+ has_facet<numpunct<char> >(const locale&);
+ template
+ bool
+ has_facet<num_put<char> >(const locale&);
+ template
+ bool
+ has_facet<num_get<char> >(const locale&);
+ template
+ bool
+ has_facet<ctype<char> >(const locale&);
+
#ifdef _GLIBCPP_USE_WCHAR_T
template
bool
- has_facet<numpunct<wchar_t> >(const locale &);
+ has_facet<numpunct<wchar_t> >(const locale&);
+ template
+ bool
+ has_facet<num_put<wchar_t> >(const locale&);
+ template
+ bool
+ has_facet<num_get<wchar_t> >(const locale&);
+ template
+ bool
+ has_facet<ctype<wchar_t> >(const locale&);
#endif
//
@@ -285,9 +304,6 @@ namespace std {
#endif
#endif // _GLIBCPP_USE_WCHAR_T
- template
- void __sink_unused_warning<locale::facet*>(locale::facet*);
-
template
locale::facet**
fill_n<locale::facet**, size_t, locale::facet*>
@@ -303,5 +319,5 @@ namespace std {
fill(__normal_iterator<locale::facet**, vector<locale::facet*> >,
__normal_iterator<locale::facet**, vector<locale::facet*> >,
locale::facet* const&);
-}
+} // namespace std
diff --git a/libstdc++-v3/src/locale.cc b/libstdc++-v3/src/locale.cc
index 5b276a2c931..caa6bdc148f 100644
--- a/libstdc++-v3/src/locale.cc
+++ b/libstdc++-v3/src/locale.cc
@@ -61,32 +61,10 @@ namespace std
// Definitions for locale::id of standard facets.
locale::id ctype<char>::id;
locale::id codecvt<char, char, mbstate_t>::id;
- locale::id num_get<char>::id;
- locale::id num_put<char>::id;
- locale::id numpunct<char>::id;
- locale::id collate<char>::id;
- locale::id time_get<char>::id;
- locale::id time_put<char>::id;
- locale::id money_get<char>::id;
- locale::id money_put<char>::id;
- locale::id moneypunct<char, false>::id;
- locale::id moneypunct<char, true>::id;
- locale::id messages<char>::id;
#ifdef _GLIBCPP_USE_WCHAR_T
locale::id ctype<wchar_t>::id;
locale::id codecvt<wchar_t, char, mbstate_t>::id;
- locale::id num_get<wchar_t>::id;
- locale::id num_put<wchar_t>::id;
- locale::id numpunct<wchar_t>::id;
- locale::id collate<wchar_t>::id;
- locale::id time_get<wchar_t>::id;
- locale::id time_put<wchar_t>::id;
- locale::id money_get<wchar_t>::id;
- locale::id money_put<wchar_t>::id;
- locale::id moneypunct<wchar_t, false>::id;
- locale::id moneypunct<wchar_t, true>::id;
- locale::id messages<wchar_t>::id;
#endif
// Definitions for static const data members of locale::id
@@ -371,7 +349,7 @@ namespace std
catch (...)
{
_M_impl->_M_remove_reference();
- throw;
+ __throw_exception_again;
}
}
@@ -398,7 +376,7 @@ namespace std
_M_impl = new _Impl(__s, 1);
}
else
- throw runtime_error("attempt to create locale from NULL name");
+ __throw_runtime_error("attempt to create locale from NULL name");
}
locale::locale(const locale& __base, const char* __s, category __cat)
@@ -490,7 +468,7 @@ namespace std
}
_S_classic = _S_global = 0;
// XXX MT
- throw;
+ __throw_exception_again;
}
}
return *__classic_locale;
@@ -499,7 +477,7 @@ namespace std
locale::category
locale::_S_normalize_category(category __cat)
{
- int __ret;
+ int __ret = 0;
if (__cat == none || (__cat & all) && !(__cat & ~all))
__ret = __cat;
else
@@ -531,7 +509,7 @@ namespace std
__ret = all;
break;
default:
- throw runtime_error("bad locale category");
+ __throw_runtime_error("bad locale category");
}
}
return __ret;
@@ -605,11 +583,10 @@ namespace std
{ return __c; }
const char*
- ctype<char>::do_widen(const char* __low, const char* __high,
- char* __dest) const
+ ctype<char>::do_widen(const char* __lo, const char* __hi, char* __dest) const
{
- memcpy(__dest, __low, __high - __low);
- return __high;
+ memcpy(__dest, __lo, __hi - __lo);
+ return __hi;
}
char
@@ -617,13 +594,14 @@ namespace std
{ return __c; }
const char*
- ctype<char>::do_narrow(const char* __low, const char* __high,
+ ctype<char>::do_narrow(const char* __lo, const char* __hi,
char /*__dfault*/, char* __dest) const
{
- memcpy(__dest, __low, __high - __low);
- return __high;
+ memcpy(__dest, __lo, __hi - __lo);
+ return __hi;
}
+ template<>
ctype_byname<char>::ctype_byname(const char* /*__s*/, size_t __refs)
: ctype<char>(new mask[table_size], true, __refs)
{ }
@@ -668,6 +646,12 @@ namespace std
}
#endif
+ // This interface passes a fixed size buffer. The function cannot handle
+ // input longer than the buffer and sets failbit in that case. This is
+ // not strictly compliant since the input may be valid, but we are stuck
+ // with this ABI on the 3.0 branch. Since leading zeros are discarded all
+ // valid integer input should be OK, only floating point input can exceed
+ // the buffer.
template<>
void
num_get<char, istreambuf_iterator<char> >::
@@ -698,9 +682,9 @@ namespace std
// Stage 2: extract characters.
__cache_type const* __fmt = __cache_type::_S_get(__io);
- bool __valid = __beg != __end;
+
// Fail quickly if !__valid
- if (!__valid)
+ if (__beg == __end)
{
__err |= (ios_base::eofbit | ios_base::failbit);
return;
@@ -716,14 +700,19 @@ namespace std
// Check first for sign
bool __testsign = false;
if ((__c == __lits[__cache_type::_S_minus])
- || (__c == __lits[__cache_type::_S_plus]))
+ || (__c == __lits[__cache_type::_S_plus]))
{
+ __testsign = true;
__xtrc[__pos++] = __c;
++__beg;
- __testsign = true;
- // whitespace may follow a sign
- while ((__beg != __end) && (isspace(*__beg)))
- ++__beg;
+ __c = * __beg;
+
+ // Whitespace may follow a sign
+ while ((__beg != __end) && (isspace(__c)))
+ {
+ ++__beg;
+ __c = *__beg;
+ }
// There had better be more to come...
if (__beg == __end)
@@ -734,20 +723,19 @@ namespace std
}
}
- bool __testzero = false; // Has there been a leading zero?
-
- // Now check if first character is a zero
- __c = *__beg;
+ // Now check if first character is a zero.
+ bool __testzero = false;
if (__c == __lits[__cache_type::_S_digits])
{
__testzero = true;
++__beg;
+ __c = *__beg;
// We have to check for __beg == __end here. If so,
// a plain '0' (possibly with a sign) can be got rid of now
if (__beg == __end)
{
- __xtrc[__pos++] = __c;
+ __xtrc[__pos++] = __lits[__cache_type::_S_digits];
__xtrc[__pos] = '\0';
__err |= ios_base::eofbit;
return;
@@ -758,11 +746,11 @@ namespace std
if (!__fp && __base != 10 && __base != 8)
{
// Here, __base == 0 or 16
- __c = *__beg;
if ((__c == __lits[__cache_type::_S_x])
|| (__c == __lits[__cache_type::_S_X]))
{
++__beg;
+ __c = *__beg;
__base = 16;
__testzero = false; // "0x" is not a leading zero
}
@@ -773,9 +761,10 @@ namespace std
// Remove any more leading zeros
while (__beg != __end)
{
- if (*__beg == __lits[__cache_type::_S_digits])
+ if (__c == __lits[__cache_type::_S_digits])
{
++__beg;
+ __c = *__beg;
__testzero = true;
}
else
@@ -789,44 +778,53 @@ namespace std
// We may need to know if anything is found here. A leading zero
// (removed by now) would count.
bool __testunits = __testzero;
- while (__valid && __beg != __end)
+ while (__beg != __end)
{
- __valid = false;
- __c = *__beg;
- const char* __p = strchr(__fmt->_S_literals, __c);
+ const char* __p = strchr(__lits, __c);
// NB: strchr returns true for __c == 0x0
- if (__p && __c)
- {
- // Try first for acceptable digit; record it if found
- if ((__p >= &__lits[__cache_type::_S_digits]
- && __p < &__lits[__cache_type::_S_digits + __base])
- || (__p >= &__lits[__cache_type::_S_udigits]
- && __p < &__lits[__cache_type::_S_udigits + __base]))
+ if (__p && __c
+ &&((__p >= &__lits[__cache_type::_S_digits]
+ && __p < &__lits[__cache_type::_S_digits + __base])
+ || (__p >= &__lits[__cache_type::_S_udigits]
+ && __p < &__lits[__cache_type::_S_udigits + __base])))
+ {
+ // Try first for acceptable digit; record it if found.
+ __xtrc[__pos++] = __c;
+ if (__pos == _M_extract_buffer_length)
{
- __xtrc[__pos++] = __c;
- ++__sep_pos;
- __valid = true;
- __testunits = true;
+ // XXX This is non-compliant, but our fixed-size
+ // buffer is full.
+ __xtrc[_M_extract_buffer_length-1] = '\0';
+ __err |= ios_base::failbit;
+ return;
}
- }
- else if (__c == __fmt->_M_thousands_sep
- && __fmt->_M_use_grouping)
- {
+ ++__sep_pos;
+ __testunits = true;
+ ++__beg;
+ __c = *__beg;
+ }
+ else if (__c == __fmt->_M_thousands_sep && __fmt->_M_use_grouping)
+ {
// NB: Thousands separator at the beginning of a string
// is a no-no, as is two consecutive thousands
- // separators
+ // separators.
if (__sep_pos)
{
__grp += static_cast<char>(__sep_pos);
__sep_pos = 0;
- __valid = true;
+ ++__beg;
+ __c = *__beg;
}
else
- __err |= ios_base::failbit;
+ {
+ __err |= ios_base::failbit;
+ break;
+ }
}
- if (__valid)
- ++__beg;
+ else
+ // Not a valid input item.
+ break;
}
// Digit grouping is checked. If _M_groupings() doesn't
@@ -874,7 +872,6 @@ namespace std
// That's it for integer types. Remaining code is for floating point
if (__fp && __beg != __end)
{
- __c = *__beg;
// Check first for decimal point. There MUST be one if
// __testunits is false.
bool __testdec = false; // Is there a decimal point
@@ -882,20 +879,38 @@ namespace std
if (__c == __fmt->_M_decimal_point)
{
__xtrc[__pos++] = '.';
+ if (__pos == _M_extract_buffer_length)
+ {
+ // XXX This is non-compliant, but our fixed-size
+ // buffer is full.
+ __xtrc[_M_extract_buffer_length-1] = '\0';
+ __err |= ios_base::failbit;
+ return;
+ }
++__beg;
+ __c = *__beg;
+
// Now we get any digits after the decimal point
// There MUST be some if __testunits is false.
while (__beg != __end)
{
- __c = *__beg;
- const char* __p = strchr(__fmt->_S_literals, __c);
+ const char* __p = strchr(__lits, __c);
if ((__p >= &__lits[__cache_type::_S_digits]
&& __p < &__lits[__cache_type::_S_digits + __base])
|| (__p >= &__lits[__cache_type::_S_udigits]
&& __p < &__lits[__cache_type::_S_udigits + __base]))
{
__xtrc[__pos++] = __c;
+ if (__pos == _M_extract_buffer_length)
+ {
+ // XXX This is non-compliant, but our fixed-size
+ // buffer is full.
+ __xtrc[_M_extract_buffer_length-1] = '\0';
+ __err |= ios_base::failbit;
+ return;
+ }
++__beg;
+ __c = *__beg;
__testdec = true;
}
else
@@ -914,25 +929,44 @@ namespace std
// Now we may find an exponent
if (__beg != __end)
{
- __c = *__beg;
if ((__c == __lits[__cache_type::_S_ee])
|| (__c == __lits[__cache_type::_S_Ee]))
{
__xtrc[__pos++] = __c;
+ if (__pos == _M_extract_buffer_length)
+ {
+ // XXX This is non-compliant, but our fixed-size
+ // buffer is full.
+ __xtrc[_M_extract_buffer_length-1] = '\0';
+ __err |= ios_base::failbit;
+ return;
+ }
++__beg;
+ __c = *__beg;
+
// Now there may be a sign
if (__beg != __end)
{
- __c = *__beg;
if ((__c == __lits[__cache_type::_S_minus])
|| (__c == __lits[__cache_type::_S_plus]))
{
__xtrc[__pos++] = __c;
+ if (__pos == _M_extract_buffer_length)
+ {
+ // XXX This is non-compliant, but our fixed-size
+ // buffer is full.
+ __xtrc[_M_extract_buffer_length-1] = '\0';
+ __err |= ios_base::failbit;
+ return;
+ }
++__beg;
+ __c = *__beg;
// whitespace may follow a sign
- while ((__beg != __end) && (isspace(*__beg)))
- ++__beg;
-
+ while ((__beg != __end) && (isspace(__c)))
+ {
+ ++__beg;
+ __c = *__beg;
+ }
}
}
// And now there must be some digits
@@ -944,15 +978,23 @@ namespace std
}
while (__beg != __end)
{
- __c = *__beg;
- const char* __p = strchr(__fmt->_S_literals, __c);
+ const char* __p = strchr(__lits, __c);
if ((__p >= &__lits[__cache_type::_S_digits]
&& __p < &__lits[__cache_type::_S_digits + __base])
|| (__p >= &__lits[__cache_type::_S_udigits]
&& __p < &__lits[__cache_type::_S_udigits + __base]))
{
__xtrc[__pos++] = __c;
+ if (__pos == _M_extract_buffer_length)
+ {
+ // XXX This is non-compliant, but our fixed-size
+ // buffer is full.
+ __xtrc[_M_extract_buffer_length-1] = '\0';
+ __err |= ios_base::failbit;
+ return;
+ }
++__beg;
+ __c = *__beg;
}
else
break;
@@ -1013,11 +1055,14 @@ namespace std
return __incl_prec;
}
+ template <>
collate<char>::collate(size_t __refs)
: locale::facet(__refs) { }
+ template<>
collate<char>::~collate() { }
+ template<>
int
collate<char>::do_compare(const char* __lo1, const char* __hi1,
const char* __lo2, const char* __hi2) const
@@ -1033,11 +1078,13 @@ namespace std
return 0;
}
+ template<>
string
collate<char>::
do_transform(const char* __lo, const char* __hi) const
{ return string(__lo, __hi - __lo); }
+ template<>
long
collate<char>::
do_hash(const char* __lo, const char* __hi) const
@@ -1048,18 +1095,22 @@ namespace std
(__val >> (numeric_limits<unsigned long>::digits - 1)));
return __val;
}
-
+
+ template<>
collate_byname<char>::collate_byname(const char* /*__s*/, size_t __refs)
: collate<char>(__refs) { }
+ template<>
moneypunct_byname<char, false>::moneypunct_byname(const char* /*__s*/,
size_t __refs)
: moneypunct<char, false>(__refs) { }
+ template<>
moneypunct_byname<char, true>::moneypunct_byname(const char* /*__s*/,
size_t __refs)
: moneypunct<char, true>(__refs) { }
+ template<>
messages_byname<char>::
messages_byname(const char* /*__s*/, size_t __refs)
: messages<char>(__refs) { }
@@ -1122,14 +1173,14 @@ namespace std
{ return towupper(__c); }
const wchar_t*
- ctype<wchar_t>::do_toupper(wchar_t* __low, const wchar_t* __high) const
+ ctype<wchar_t>::do_toupper(wchar_t* __lo, const wchar_t* __hi) const
{
- while (__low < __high)
+ while (__lo < __hi)
{
- *__low = towupper(*__low);
- ++__low;
+ *__lo = towupper(*__lo);
+ ++__lo;
}
- return __high;
+ return __hi;
}
wchar_t
@@ -1137,14 +1188,14 @@ namespace std
{ return towlower(__c); }
const wchar_t*
- ctype<wchar_t>::do_tolower(wchar_t* __low, const wchar_t* __high) const
+ ctype<wchar_t>::do_tolower(wchar_t* __lo, const wchar_t* __hi) const
{
- while (__low < __high)
+ while (__lo < __hi)
{
- *__low = towlower(*__low);
- ++__low;
+ *__lo = towlower(*__lo);
+ ++__lo;
}
- return __high;
+ return __hi;
}
bool
@@ -1154,29 +1205,29 @@ namespace std
const wchar_t*
ctype<wchar_t>::
- do_is(const wchar_t* __low, const wchar_t* __high, mask* __m) const
+ do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __m) const
{
- while (__low < __high && !this->is(*__m, *__low))
- ++__low;
- return __low;
+ while (__lo < __hi && !this->is(*__m, *__lo))
+ ++__lo;
+ return __lo;
}
const wchar_t*
ctype<wchar_t>::
- do_scan_is(mask __m, const wchar_t* __low, const wchar_t* __high) const
+ do_scan_is(mask __m, const wchar_t* __lo, const wchar_t* __hi) const
{
- while (__low < __high && !this->is(__m, *__low))
- ++__low;
- return __low;
+ while (__lo < __hi && !this->is(__m, *__lo))
+ ++__lo;
+ return __lo;
}
const wchar_t*
ctype<wchar_t>::
- do_scan_not(mask __m, const char_type* __low, const char_type* __high) const
+ do_scan_not(mask __m, const char_type* __lo, const char_type* __hi) const
{
- while (__low < __high && this->is(__m, *__low) != 0)
- ++__low;
- return __low;
+ while (__lo < __hi && this->is(__m, *__lo) != 0)
+ ++__lo;
+ return __lo;
}
wchar_t
@@ -1186,12 +1237,12 @@ namespace std
const char*
ctype<wchar_t>::
- do_widen(const char* __low, const char* __high, wchar_t* __dest) const
+ do_widen(const char* __lo, const char* __hi, wchar_t* __dest) const
{
mbstate_t __state;
memset(static_cast<void*>(&__state), 0, sizeof(mbstate_t));
- mbsrtowcs(__dest, &__low, __high - __low, &__state);
- return __high;
+ mbsrtowcs(__dest, &__lo, __hi - __lo, &__state);
+ return __hi;
}
char
@@ -1204,28 +1255,32 @@ namespace std
const wchar_t*
ctype<wchar_t>::
- do_narrow(const wchar_t* __low, const wchar_t* __high, char __dfault,
+ do_narrow(const wchar_t* __lo, const wchar_t* __hi, char __dfault,
char* __dest) const
{
mbstate_t __state;
memset(static_cast<void*>(&__state), 0, sizeof(mbstate_t));
- size_t __len = __high - __low;
- size_t __conv = wcsrtombs(__dest, &__low, __len, &__state);
+ size_t __len = __hi - __lo;
+ size_t __conv = wcsrtombs(__dest, &__lo, __len, &__state);
if (__conv == __len)
*__dest = __dfault;
- return __high;
+ return __hi;
}
+ template<>
ctype_byname<wchar_t>::
ctype_byname(const char* /*__s*/, size_t __refs)
: ctype<wchar_t>(__refs) { }
+ template<>
collate<wchar_t>::
collate(size_t __refs): locale::facet(__refs) { }
+ template<>
collate<wchar_t>::
~collate() { }
+ template<>
int
collate<wchar_t>::
do_compare(const wchar_t* /*__lo1*/, const wchar_t* /*__hi1*/,
@@ -1233,31 +1288,30 @@ namespace std
{
return 0; // XXX not done
}
-
+
+ template<>
wstring collate<wchar_t>::
do_transform(const wchar_t* /*__lo*/, const wchar_t* /*__hi*/) const
{
return wstring(); // XXX not done
}
+ template<>
long collate<wchar_t>::
do_hash(const wchar_t* /*__lo*/, const wchar_t* /*__hi*/) const
{
return 0; // XXX not done
}
+ template<>
collate_byname<wchar_t>::
collate_byname(const char* /*__s*/, size_t __refs)
: collate<wchar_t> (__refs) { }
+ template<>
messages_byname<wchar_t>::
messages_byname(const char* /*__s*/, size_t __refs)
: messages<wchar_t> (__refs) { }
#endif // _GLIBCPP_USE_WCHAR_T
} // namespace std
-
-
-
-
-
diff --git a/libstdc++-v3/src/localename.cc b/libstdc++-v3/src/localename.cc
index 867b063fbfb..e4bc18fefe6 100644
--- a/libstdc++-v3/src/localename.cc
+++ b/libstdc++-v3/src/localename.cc
@@ -31,7 +31,8 @@
#include <bits/std_vector.h>
#include <bits/std_stdexcept.h>
-namespace std {
+namespace std
+{
locale::_Impl::
~_Impl() throw()
{
@@ -53,7 +54,7 @@ namespace std {
catch(...)
{
delete _M_facets;
- throw;
+ __throw_exception_again;
}
for (size_t i = 0; i < _S_num_categories; ++i)
@@ -83,7 +84,7 @@ namespace std {
catch(...)
{
delete _M_facets;
- throw;
+ __throw_exception_again;
}
// Name all the categories.
@@ -159,7 +160,7 @@ namespace std {
if (__index == 0
|| __imp->_M_facets->size() <= __index
|| (*(__imp->_M_facets))[__index] == 0)
- throw runtime_error("no locale facet");
+ __throw_runtime_error("no locale facet");
_M_install_facet(__idp, (*(__imp->_M_facets))[__index]);
}
@@ -196,8 +197,5 @@ namespace std {
}
}
}
-}
-
-
-
+} // namespace std
diff --git a/libstdc++-v3/src/misc-inst.cc b/libstdc++-v3/src/misc-inst.cc
index eb3f5efd0b9..3c3b9f1582e 100644
--- a/libstdc++-v3/src/misc-inst.cc
+++ b/libstdc++-v3/src/misc-inst.cc
@@ -54,7 +54,8 @@
#include <bits/ostream.tcc>
#endif
-namespace std {
+namespace std
+{
//
// streambuf
@@ -242,26 +243,6 @@ namespace std {
template
void
- __sink_unused_warning<char>(char);
-#ifdef _GLIBCPP_USE_WCHAR_T
- template
- void
- __sink_unused_warning<wchar_t>(wchar_t);
-#endif
-
- template
- void
- __sink_unused_warning<ostreambuf_iterator<char> >
- (ostreambuf_iterator<char>);
-#ifdef _GLIBCPP_USE_WCHAR_T
- template
- void
- __sink_unused_warning<ostreambuf_iterator<wchar_t> >
- (ostreambuf_iterator<wchar_t>);
-#endif
-
- template
- void
__pad_char(basic_ios<char>&, char*, const char*,
const streamsize, const streamsize);
#ifdef _GLIBCPP_USE_WCHAR_T
@@ -295,14 +276,12 @@ namespace std {
template
streamsize
- __copy_streambufs(basic_ios<char>&,
- basic_streambuf<char>*,
+ __copy_streambufs(basic_ios<char>&, basic_streambuf<char>*,
basic_streambuf<char>*);
#ifdef _GLIBCPP_USE_WCHAR_T
template
- int
- __copy_streambufs(basic_ios<wchar_t>&,
- basic_streambuf<wchar_t>*,
+ streamsize
+ __copy_streambufs(basic_ios<wchar_t>&, basic_streambuf<wchar_t>*,
basic_streambuf<wchar_t>*);
#endif
} //std
diff --git a/libstdc++-v3/src/stdexcept.cc b/libstdc++-v3/src/stdexcept.cc
index af22c9e0fa8..32ebd265f89 100644
--- a/libstdc++-v3/src/stdexcept.cc
+++ b/libstdc++-v3/src/stdexcept.cc
@@ -33,9 +33,6 @@
#include <bits/std_string.h>
#include <bits/std_stdexcept.h>
-#if 1
-#include <bits/stl_range_errors.h>
-#endif
namespace std
{
@@ -77,29 +74,5 @@ namespace std
underflow_error::underflow_error(const string& __arg)
: runtime_error(__arg) { }
-
-#if 1
- // XXX need to deal with this.
- void
- __out_of_range(const char *str)
- { throw out_of_range(str); }
-
- void
- __length_error(const char *str)
- { throw length_error(str); }
-
- // XXX: From stl_range_errors.h, eventually these approaches need to
- // be merged.
- void
- __stl_throw_range_error(const char* __msg)
- { throw range_error(__msg); }
-
- void
- __stl_throw_length_error(const char* __msg)
- { throw length_error(__msg); }
-#endif
} // namespace std
-
-
-
diff --git a/libstdc++-v3/src/stl-inst.cc b/libstdc++-v3/src/stl-inst.cc
index e64e5d04c93..2dfc2537804 100644
--- a/libstdc++-v3/src/stl-inst.cc
+++ b/libstdc++-v3/src/stl-inst.cc
@@ -1,6 +1,6 @@
// Explicit instantiation file.
-// Copyright (C) 1999 Free Software Foundation, Inc.
+// Copyright (C) 1999, 2001 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,11 +32,12 @@
//
#include <bits/c++config.h>
-#include <bits/stl_config.h>
#include <bits/stl_alloc.h>
#include <bits/std_vector.h>
+#include <bits/std_ostream.h>
-namespace std {
+namespace std
+{
template class __malloc_alloc_template<0>;
@@ -49,8 +50,27 @@ namespace std {
vector<unsigned int>::
_M_insert_aux(vector<unsigned int>::iterator, unsigned int const &);
+#ifdef _GLIBCPP_CONCEPT_CHECKS
template
- void
- __sink_unused_warning<unsigned int>(unsigned int);
+ void __sink_unused_warning<unsigned int>(unsigned int);
+
+ template
+ void __sink_unused_warning<locale::facet*>(locale::facet*);
+ template
+ void __sink_unused_warning<char>(char);
+
+ template
+ void __sink_unused_warning<ostreambuf_iterator<char> >
+ (ostreambuf_iterator<char>);
+
+# ifdef _GLIBCPP_USE_WCHAR_T
+ template
+ void __sink_unused_warning<wchar_t>(wchar_t);
+
+ template
+ void __sink_unused_warning<ostreambuf_iterator<wchar_t> >
+ (ostreambuf_iterator<wchar_t>);
+# endif
+#endif
} //std
diff --git a/libstdc++-v3/src/string-inst.cc b/libstdc++-v3/src/string-inst.cc
index 920311254ed..5c0e5552cc4 100644
--- a/libstdc++-v3/src/string-inst.cc
+++ b/libstdc++-v3/src/string-inst.cc
@@ -46,6 +46,7 @@ namespace std
typedef basic_string<C> S;
template class basic_string<C>;
+ template S::size_type S::_Rep::_S_max_size;
template S operator+(const C*, const S&);
template S operator+(C, const S&);
@@ -100,7 +101,3 @@ namespace std
void
__destroy_aux<S*>(S*, S*, _Bool<false>);
} // namespace std
-
-
-
-
diff --git a/libstdc++-v3/src/strstream.cc b/libstdc++-v3/src/strstream.cc
index 57310177655..2160c440be2 100644
--- a/libstdc++-v3/src/strstream.cc
+++ b/libstdc++-v3/src/strstream.cc
@@ -1,3 +1,33 @@
+// strstream definitions -*- C++ -*-
+
+// Copyright (C) 2001 Free Software Foundation
+//
+// This file is part of GNU CC.
+//
+// GNU CC is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2, or (at your option)
+// any later version.
+//
+// GNU CC is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with GNU CC; see the file COPYING. If not, write to
+// the Free Software Foundation, 59 Temple Place - Suite 330,
+// Boston, MA 02111-1307, USA.
+
+// 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.
+
/*
* Copyright (c) 1998
* Silicon Graphics Computer Systems, Inc.
@@ -24,7 +54,8 @@
#include <string.h>
#include <limits.h>
-__STL_BEGIN_NAMESPACE
+namespace std
+{
// strstreambuf constructor, destructor.
@@ -175,7 +206,7 @@ strstreambuf::int_type strstreambuf::pbackfail(int_type c)
gbump(-1);
return _Traits::not_eof(c);
}
- else if (c == (unsigned int)(gptr()[-1])) { // (u int) added KLUDGE
+ else if (c == static_cast<int_type>(gptr()[-1])) { // KLUDGE
gbump(-1);
return c;
}
@@ -420,7 +451,7 @@ char* strstream::str()
return _M_buf.str();
}
-__STL_END_NAMESPACE
+} // namespace std
// Local Variables:
// mode:C++
diff --git a/libstdc++-v3/src/valarray-inst.cc b/libstdc++-v3/src/valarray-inst.cc
index 9950fbadd0b..c5f56164d11 100644
--- a/libstdc++-v3/src/valarray-inst.cc
+++ b/libstdc++-v3/src/valarray-inst.cc
@@ -1,3 +1,36 @@
+// Explicit instantiation file.
+
+// Copyright (C) 2001 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.
+
+//
+// ISO C++ 14882:
+//
+
#include <bits/std_valarray.h>
namespace std
@@ -63,13 +96,13 @@ namespace std
// Process the next multi-index. The loop ought to be
// backward since we're making a lexicagraphical visit.
- ++__t[__n-1];
- for (size_t __k=__n-1; __k; --__k)
+ ++__t[__n - 1];
+ for (size_t __k2 = __n - 1; __k2; --__k2)
{
- if (__t[__k] >= __l[__k])
+ if (__t[__k2] >= __l[__k2])
{
- __t[__k] = 0;
- ++__t[__k-1];
+ __t[__k2] = 0;
+ ++__t[__k2 - 1];
}
}
}
@@ -81,4 +114,5 @@ namespace std
_M_index(__l.size() == 0 ? 0 : __valarray_product(__l))
{ __gslice_to_index(__o, __l, __s, _M_index); }
-}
+} // namespace std
+
diff --git a/libstdc++-v3/src/wstring-inst.cc b/libstdc++-v3/src/wstring-inst.cc
new file mode 100644
index 00000000000..0200fd42d67
--- /dev/null
+++ b/libstdc++-v3/src/wstring-inst.cc
@@ -0,0 +1,6 @@
+#include <bits/c++config.h>
+
+#ifdef _GLIBCPP_USE_WCHAR_T
+#define C wchar_t
+#include "string-inst.cc"
+#endif
diff --git a/libstdc++-v3/tests_flags.in b/libstdc++-v3/tests_flags.in
deleted file mode 100644
index c012cbb097f..00000000000
--- a/libstdc++-v3/tests_flags.in
+++ /dev/null
@@ -1,160 +0,0 @@
-#!/bin/sh
-
-#
-# This script computes the various flags needed to run GNU C++ testsuites
-# (compiler specific as well as library specific). It is based on
-# the file ./mkcheck.in, which in the long will be removed in favor of a
-# DejaGnu-based framework.
-#
-# Written by Gabriel Dos Reis <gdr@codesourcery.com>
-#
-
-#
-# Synopsis
-# * tests_flags --compiler build-dir src-dir
-#
-# Returns a space-separated list of flags needed to run front-end
-# specific tests.
-#
-# * tests_flags --built-library build-dir src-dir
-# * tests_flags --installed-library build-dir src-dir install-dir
-#
-# Returns a colon-separated list of space-separated list of flags,
-# needed to run library specific tests,
-# BUILD_DIR:SRC_DIR:PREFIX_DIR:CXX:CXXFLAGS:INCLUDES:LIBS
-# the meaning of which is as follows:
-# BUILD_DIR build-dir
-# SRC_DIR src-dir
-# PREFIX_DIR install-dir (meaningful only with --installed-library)
-# CXX which C++ compiler is being used
-# CXXFLAGS special flags to pass to g++
-# INCLUDES paths to headers
-# LIBS flags to pass to the linker
-#
-
-##
-## Utility functions
-##
-
-# Print a message saying how this script is intended to be invoked
-print_usage() {
- cat <<EOF
-Usage:
- tests_flags --compiler <build-dir> <src-dir>
- --built-library <build-dir> <src-dir>
- --installed-library <build-dir> <src-dir> <install-dir>
-EOF
- exit 1
-}
-
-# Check for command line option
-check_options() {
- # First, check for number of command line arguments
- if [ \( $1 -ne 3 \) -a \( $1 -ne 4 \) ]; then
- print_usage;
- fi
-
- # Then, see if we understand the job we're asked for
- case $2 in
- --compiler|--built-library|--installed-library)
- # OK
- ;;
- *)
- print_usage
- ;;
- esac
-}
-
-# Directory sanity check
-check_directory() {
- if [ ! -d $2 ]; then
- echo "$1 '$2' directory not found, exiting."
- exit 1
- fi
-}
-
-##
-## Main processing
-##
-
-# Command line options sanity check
-check_options $# $1
-
-query=$1
-
-# Check for build, source and install directories
-BUILD_DIR=$2; SRC_DIR=$3
-check_directory 'Build' ${BUILD_DIR}
-check_directory 'Source' ${SRC_DIR}
-case ${query} in
- --installed-library)
- PREFIX_DIR=$4
- check_directory 'Install' ${PREFIX_DIR}
- ;;
- *)
- PREFIX_DIR=
- ;;
-esac
-
-# Compute include paths
-# INCLUDES == include path to new headers for use on gcc command-line
-C_DIR="`basename @C_INCLUDE_DIR@`"
-case ${query} in
- --installed-library)
- INCLUDES="-I${SRC_DIR}/testsuite"
- ;;
- *)
- INCLUDES="-nostdinc++ @CSHADOW_FLAGS@ -I${BUILD_DIR}/include
- -I${SRC_DIR}/include/std -I${SRC_DIR}/include/$C_DIR
- -I${SRC_DIR}/include -I${SRC_DIR}/libsupc++ -I${SRC_DIR}/libio
- -I${SRC_DIR}/testsuite"
- ;;
-esac
-
-# If called for compiler tests, just output appropriate include paths
-case ${query} in
- --compiler)
- echo ${INCLUDES} -I${SRC_DIR}/include/backward -I${SRC_DIR}/include/ext
- exit 0
- ;;
-esac
-
-# For built or installed libraries, we need to get right OS-specific bits.
-. ${SRC_DIR}/configure.target
-
-# LIB_PATH == where to find the build libraries for libtool's use
-# CXX == the full pathname of the compiler
-case ${query} in
- --built-library)
- LIB_PATH=${BUILD_DIR}/src
- CXX="${BUILD_DIR}/../../gcc/g++"
- ;;
- --installed-library)
- LIB_PATH=${PREFIX_DIR}/lib
- CXX=${PREFIX_DIR}/bin/g++
- ;;
-esac
-
-# gcc compiler flags (maybe use glibcpp_cxxflags from configure.target,
-# but thst's really meant for building the library itself, not using it)
-CXXFLAGS="-ggdb3 -DDEBUG_ASSERT @SECTION_FLAGS@ @SECTION_LDFLAGS@"
-
-# LIBS == any extra needed -l switches, etc (may need more libs, lose lose)
-case ${query} in
- --built-library)
- LIBS="${LIB_PATH}/../libsupc++/libsupc++.la ${LIB_PATH}/libstdc++.la
- -no-install"
- case @target_os@ in
- *cygwin*) LIBS="${LIBS} -nodefaultlibs -lgcc -lcygwin -luser32
- -lkernel32 -ladvapi32 -lshell32" ;;
- *) LIBS="${LIBS} -nodefaultlibs -lc -lgcc -lc" ;;
- esac
- ;;
- --installed-library)
- LIBS="-L${LIB_PATH} ${LIB_PATH}/libstdc++.la -no-install
- -rpath ${LIB_PATH}"
- ;;
-esac
-
-echo -n ${BUILD_DIR}:${SRC_DIR}:${PREFIX_DIR}:${CXX}:${CXXFLAGS}:${INCLUDES}:${LIBS}
-exit 0
diff --git a/libstdc++-v3/testsuite/17_intro/header_cassert.cc b/libstdc++-v3/testsuite/17_intro/header_cassert.cc
new file mode 100644
index 00000000000..f232bacc65e
--- /dev/null
+++ b/libstdc++-v3/testsuite/17_intro/header_cassert.cc
@@ -0,0 +1,40 @@
+// 2001-02-06 Benjamin Kosnik <bkoz@redhat.com>
+
+// Copyright (C) 2001 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.
+
+// 17.4.1.2 Headers, cassert
+
+#include <cassert>
+
+namespace gnu
+{
+ void test01()
+ {
+ assert (true);
+#ifndef assert
+ #error "assert_must_be_a_macro"
+#endif
+ }
+}
+
+int main()
+{
+ gnu::test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/17_intro/header_cerrno.cc b/libstdc++-v3/testsuite/17_intro/header_cerrno.cc
new file mode 100644
index 00000000000..bfd869e8685
--- /dev/null
+++ b/libstdc++-v3/testsuite/17_intro/header_cerrno.cc
@@ -0,0 +1,40 @@
+// 2001-02-06 Benjamin Kosnik <bkoz@redhat.com>
+
+// Copyright (C) 2001 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.
+
+// 17.4.1.2 Headers, cerrno
+
+#include <cerrno>
+
+namespace gnu
+{
+ void test01()
+ {
+ int i = errno;
+#ifndef errno
+ #error "errno_must_be_a_macro"
+#endif
+ }
+}
+
+int main()
+{
+ gnu::test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/17_intro/header_ciso646.cc b/libstdc++-v3/testsuite/17_intro/header_ciso646.cc
index 30a8982fa39..8513b0864ef 100644
--- a/libstdc++-v3/testsuite/17_intro/header_ciso646.cc
+++ b/libstdc++-v3/testsuite/17_intro/header_ciso646.cc
@@ -23,7 +23,7 @@
// { dg-do link }
#include <ciso646>
-#include <debug_assert.h>
+#include <testsuite_hooks.h>
// 2.11 Keywords
@@ -125,11 +125,3 @@ int main(void)
return 0;
}
-
-
-
-
-
-
-
-
diff --git a/libstdc++-v3/testsuite/17_intro/header_csetjmp.cc b/libstdc++-v3/testsuite/17_intro/header_csetjmp.cc
new file mode 100644
index 00000000000..4e2610de4f2
--- /dev/null
+++ b/libstdc++-v3/testsuite/17_intro/header_csetjmp.cc
@@ -0,0 +1,41 @@
+// 2001-02-06 Benjamin Kosnik <bkoz@redhat.com>
+
+// Copyright (C) 2001 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.
+
+// 17.4.1.2 Headers, csetjmp
+
+#include <csetjmp>
+
+namespace gnu
+{
+ void test01()
+ {
+ std::jmp_buf env;
+ int i = setjmp(env);
+#ifndef setjmp
+ #error "setjmp_must_be_a_macro"
+#endif
+ }
+}
+
+int main()
+{
+ gnu::test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/17_intro/header_cstdarg.cc b/libstdc++-v3/testsuite/17_intro/header_cstdarg.cc
new file mode 100644
index 00000000000..260e92905cb
--- /dev/null
+++ b/libstdc++-v3/testsuite/17_intro/header_cstdarg.cc
@@ -0,0 +1,46 @@
+// 2001-02-06 Benjamin Kosnik <bkoz@redhat.com>
+
+// Copyright (C) 2001 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.
+
+// 17.4.1.2 Headers, cstdarg
+
+#include <cstdarg>
+
+namespace gnu
+{
+ void test01()
+ {
+ std::va_list list;
+#ifndef va_arg
+ #error "va_arg_must_be_a_macro"
+#endif
+#ifndef va_end
+ #error "va_end_must_be_a_macro"
+#endif
+#ifndef va_start
+ #error "va_start_must_be_a_macro"
+#endif
+ }
+}
+
+int main()
+{
+ gnu::test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/17_intro/header_cstddef.cc b/libstdc++-v3/testsuite/17_intro/header_cstddef.cc
new file mode 100644
index 00000000000..eab1c75386a
--- /dev/null
+++ b/libstdc++-v3/testsuite/17_intro/header_cstddef.cc
@@ -0,0 +1,46 @@
+// 2001-02-06 Benjamin Kosnik <bkoz@redhat.com>
+
+// Copyright (C) 2001 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.
+
+// 17.4.1.2 Headers, cstddef
+
+#include <cstddef>
+
+namespace gnu
+{
+ struct test_type
+ {
+ int i;
+ int j;
+ };
+
+ void test01()
+ {
+ std::size_t i = offsetof(struct test_type, i);
+#ifndef offsetof
+ #error "offsetof_must_be_a_macro"
+#endif
+ }
+}
+
+int main()
+{
+ gnu::test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/17_intro/header_cstdio.cc b/libstdc++-v3/testsuite/17_intro/header_cstdio.cc
index 38d7cd565a3..383cc0a5293 100644
--- a/libstdc++-v3/testsuite/17_intro/header_cstdio.cc
+++ b/libstdc++-v3/testsuite/17_intro/header_cstdio.cc
@@ -22,14 +22,9 @@
#include <cstdio>
-
int main(void)
{
// Make sure size_t is in namespace std
- std::size_t i = 5; // { dg-do compile }
+ std::size_t i = 5;
return 0;
}
-
-
-
-
diff --git a/libstdc++-v3/testsuite/17_intro/header_cstdlib.cc b/libstdc++-v3/testsuite/17_intro/header_cstdlib.cc
index 3a4664e6779..32827cfbca0 100644
--- a/libstdc++-v3/testsuite/17_intro/header_cstdlib.cc
+++ b/libstdc++-v3/testsuite/17_intro/header_cstdlib.cc
@@ -22,14 +22,22 @@
#include <cstdlib>
+// libstdc++/2190
+void test01()
+{
+ long a = std::abs(1L);
+ ldiv_t b = std::div(2L, 1L);
+}
-int main(void)
+void test02()
{
// Make sure size_t is in namespace std
- std::size_t i = 5; // { dg-do compile }
- return 0;
+ std::size_t i = 5;
}
-
-
-
+int main()
+{
+ test01();
+ test02();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/17_intro/header_cstring.cc b/libstdc++-v3/testsuite/17_intro/header_cstring.cc
index 02d51eae697..ae8852a43e0 100644
--- a/libstdc++-v3/testsuite/17_intro/header_cstring.cc
+++ b/libstdc++-v3/testsuite/17_intro/header_cstring.cc
@@ -26,11 +26,6 @@
int main(void)
{
// Make sure size_t is in namespace std
- // { dg-do compile }
std::size_t i = std::strlen("tibet shop/san francisco (415) 982-0326");
return 0;
}
-
-
-
-
diff --git a/libstdc++-v3/testsuite/17_intro/header_ctime.cc b/libstdc++-v3/testsuite/17_intro/header_ctime.cc
index 98f48b7e879..03f8294cda6 100644
--- a/libstdc++-v3/testsuite/17_intro/header_ctime.cc
+++ b/libstdc++-v3/testsuite/17_intro/header_ctime.cc
@@ -26,10 +26,6 @@
int main(void)
{
// Make sure size_t is in namespace std
- std::size_t i = 5; // { dg-do compile }
+ std::size_t i = 5;
return 0;
}
-
-
-
-
diff --git a/libstdc++-v3/testsuite/17_intro/header_cwchar.cc b/libstdc++-v3/testsuite/17_intro/header_cwchar.cc
index 0b421ee1d2a..0f9974ddb13 100644
--- a/libstdc++-v3/testsuite/17_intro/header_cwchar.cc
+++ b/libstdc++-v3/testsuite/17_intro/header_cwchar.cc
@@ -26,6 +26,9 @@
int main(void)
{
// Make sure size_t is in namespace std
- std::size_t i = 5; // { dg-do compile }
+ std::size_t i = 5;
+
+ std::tm mytime;
+
return 0;
}
diff --git a/libstdc++-v3/testsuite/17_intro/header_cwctype.cc b/libstdc++-v3/testsuite/17_intro/header_cwctype.cc
index e5db1b53756..ba315b49ce0 100644
--- a/libstdc++-v3/testsuite/17_intro/header_cwctype.cc
+++ b/libstdc++-v3/testsuite/17_intro/header_cwctype.cc
@@ -22,8 +22,29 @@
#if _GLIBCPP_USE_WCHAR_T
#include <cwctype>
- // Make sure wint_t is in namespace std
- std::wint_t i = 5; // { dg-do compile }
+// Make sure wint_t is in namespace std
+std::wint_t i = 5;
+
+// Make sure table 46 is in namespace std.
+using std::wctype_t;
+using std::wctrans_t;
+using std::iswalpha;
+using std::iswupper;
+using std::iswlower;
+using std::iswdigit;
+using std::iswxdigit;
+using std::iswalnum;
+using std::iswspace;
+using std::iswpunct;
+using std::iswprint;
+using std::iswgraph;
+using std::iswcntrl;
+using std::iswctype;
+using std::towctrans;
+using std::towlower;
+using std::towupper;
+using std::wctrans;
+using std::wctype;
#endif
int main(void)
@@ -31,6 +52,3 @@ int main(void)
return 0;
}
-
-
-
diff --git a/libstdc++-v3/testsuite/17_intro/header_fstream.cc b/libstdc++-v3/testsuite/17_intro/header_fstream.cc
index 1163fd11944..9f41f505719 100644
--- a/libstdc++-v3/testsuite/17_intro/header_fstream.cc
+++ b/libstdc++-v3/testsuite/17_intro/header_fstream.cc
@@ -20,15 +20,11 @@
// 17.4.1.2 Headers, fstream
-#include <fstream> // { dg-do compile }
-#include <debug_assert.h>
+#include <fstream>
+#include <testsuite_hooks.h>
int main(void)
{
return 0;
}
-
-
-
-
diff --git a/libstdc++-v3/testsuite/17_intro/header_iomanip.cc b/libstdc++-v3/testsuite/17_intro/header_iomanip.cc
index d9929f4d671..130e9767753 100644
--- a/libstdc++-v3/testsuite/17_intro/header_iomanip.cc
+++ b/libstdc++-v3/testsuite/17_intro/header_iomanip.cc
@@ -20,15 +20,11 @@
// 17.4.1.2 Headers, iomanip
-#include <iomanip> // { dg-do compile }
-#include <debug_assert.h>
+#include <iomanip>
+#include <testsuite_hooks.h>
int main(void)
{
return 0;
}
-
-
-
-
diff --git a/libstdc++-v3/testsuite/17_intro/header_ios.cc b/libstdc++-v3/testsuite/17_intro/header_ios.cc
index facbecba65b..bde8a85c6f4 100644
--- a/libstdc++-v3/testsuite/17_intro/header_ios.cc
+++ b/libstdc++-v3/testsuite/17_intro/header_ios.cc
@@ -20,15 +20,11 @@
// 17.4.1.2 Headers, ios
-#include <ios> // { dg-do compile }
-#include <debug_assert.h>
+#include <ios>
+#include <testsuite_hooks.h>
int main(void)
{
return 0;
}
-
-
-
-
diff --git a/libstdc++-v3/testsuite/17_intro/header_iosfwd.cc b/libstdc++-v3/testsuite/17_intro/header_iosfwd.cc
index 695b832df55..d9846702774 100644
--- a/libstdc++-v3/testsuite/17_intro/header_iosfwd.cc
+++ b/libstdc++-v3/testsuite/17_intro/header_iosfwd.cc
@@ -20,15 +20,11 @@
// 17.4.1.2 Headers, iosfwd
-#include <iosfwd> // { dg-do compile }
-#include <debug_assert.h>
+#include <iosfwd>
+#include <testsuite_hooks.h>
int main(void)
{
return 0;
}
-
-
-
-
diff --git a/libstdc++-v3/testsuite/17_intro/header_iostream.cc b/libstdc++-v3/testsuite/17_intro/header_iostream.cc
index 790846f188e..59b72fcce7b 100644
--- a/libstdc++-v3/testsuite/17_intro/header_iostream.cc
+++ b/libstdc++-v3/testsuite/17_intro/header_iostream.cc
@@ -20,15 +20,11 @@
// 17.4.1.2 Headers, iostream
-#include <iostream> // { dg-do compile }
-#include <debug_assert.h>
+#include <iostream>
+#include <testsuite_hooks.h>
int main(void)
{
return 0;
}
-
-
-
-
diff --git a/libstdc++-v3/testsuite/17_intro/header_istream.cc b/libstdc++-v3/testsuite/17_intro/header_istream.cc
index 72eb2243600..daa7f16d1aa 100644
--- a/libstdc++-v3/testsuite/17_intro/header_istream.cc
+++ b/libstdc++-v3/testsuite/17_intro/header_istream.cc
@@ -20,15 +20,11 @@
// 17.4.1.2 Headers, istream
-#include <istream> // { dg-do compile }
-#include <debug_assert.h>
+#include <istream>
+#include <testsuite_hooks.h>
int main(void)
{
return 0;
}
-
-
-
-
diff --git a/libstdc++-v3/testsuite/17_intro/header_ostream.cc b/libstdc++-v3/testsuite/17_intro/header_ostream.cc
index d365105b78b..7af23d55800 100644
--- a/libstdc++-v3/testsuite/17_intro/header_ostream.cc
+++ b/libstdc++-v3/testsuite/17_intro/header_ostream.cc
@@ -20,15 +20,11 @@
// 17.4.1.2 Headers, ostream
-#include <ostream> // { dg-do compile }
-#include <debug_assert.h>
+#include <ostream>
+#include <testsuite_hooks.h>
int main(void)
{
return 0;
}
-
-
-
-
diff --git a/libstdc++-v3/testsuite/17_intro/header_sstream.cc b/libstdc++-v3/testsuite/17_intro/header_sstream.cc
index bdbf0c46197..b546c5498ce 100644
--- a/libstdc++-v3/testsuite/17_intro/header_sstream.cc
+++ b/libstdc++-v3/testsuite/17_intro/header_sstream.cc
@@ -20,15 +20,11 @@
// 17.4.1.2 Headers, sstream
-#include <sstream> // { dg-do compile }
-#include <debug_assert.h>
+#include <sstream>
+#include <testsuite_hooks.h>
int main(void)
{
return 0;
}
-
-
-
-
diff --git a/libstdc++-v3/testsuite/17_intro/header_streambuf.cc b/libstdc++-v3/testsuite/17_intro/header_streambuf.cc
index 50234a65443..de5b8abfd86 100644
--- a/libstdc++-v3/testsuite/17_intro/header_streambuf.cc
+++ b/libstdc++-v3/testsuite/17_intro/header_streambuf.cc
@@ -20,8 +20,8 @@
// 17.4.1.2 Headers, streambuf
-#include <streambuf> // { dg-do compile }
-#include <debug_assert.h>
+#include <streambuf>
+#include <testsuite_hooks.h>
int main(void)
diff --git a/libstdc++-v3/testsuite/17_intro/headers.cc b/libstdc++-v3/testsuite/17_intro/headers.cc
index 2ec4041dd10..eb930f1ff00 100644
--- a/libstdc++-v3/testsuite/17_intro/headers.cc
+++ b/libstdc++-v3/testsuite/17_intro/headers.cc
@@ -80,4 +80,4 @@
#include <cwctype>
#endif
-int main() { } // { dg-do compile }
+int main() { return 0; }
diff --git a/libstdc++-v3/testsuite/17_intro/headers_c++.cc b/libstdc++-v3/testsuite/17_intro/headers_c++.cc
index d5c01a83d58..cb6a71d9e13 100644
--- a/libstdc++-v3/testsuite/17_intro/headers_c++.cc
+++ b/libstdc++-v3/testsuite/17_intro/headers_c++.cc
@@ -67,4 +67,18 @@
#include <wctype.h>
#endif
-int main() { } // { dg-do compile }
+// libstdc++/2992
+namespace bar
+{
+ int foo(const char *x)
+ { return strlen(x); }
+};
+
+
+int main() { return 0; }
+
+
+
+
+
+
diff --git a/libstdc++-v3/testsuite/17_intro/headers_c.cc b/libstdc++-v3/testsuite/17_intro/headers_c.cc
index 406bc9802e4..b4fe65895d9 100644
--- a/libstdc++-v3/testsuite/17_intro/headers_c.cc
+++ b/libstdc++-v3/testsuite/17_intro/headers_c.cc
@@ -67,4 +67,12 @@
#include <cwctype>
#endif
-int main() { } // { dg-do compile }
+// libstdc++/2992
+namespace bar
+{
+ int foo(const char *x)
+ { return strlen(x); }
+};
+
+
+int main() { return 0; }
diff --git a/libstdc++-v3/testsuite/18_support/numeric_limits.cc b/libstdc++-v3/testsuite/18_support/numeric_limits.cc
index fce32abb2b0..6252f507e02 100644
--- a/libstdc++-v3/testsuite/18_support/numeric_limits.cc
+++ b/libstdc++-v3/testsuite/18_support/numeric_limits.cc
@@ -21,7 +21,7 @@
// 18.2.1.1 template class numeric_limits
#include <limits>
-#include <debug_assert.h>
+#include <testsuite_hooks.h>
template<typename T>
@@ -86,8 +86,3 @@ int main()
return 0;
}
-
-
-
-
-
diff --git a/libstdc++-v3/testsuite/19_diagnostics/stdexceptions.cc b/libstdc++-v3/testsuite/19_diagnostics/stdexceptions.cc
new file mode 100644
index 00000000000..c118580ce50
--- /dev/null
+++ b/libstdc++-v3/testsuite/19_diagnostics/stdexceptions.cc
@@ -0,0 +1,116 @@
+// 2001-02-26 Benjamin Kosnik <bkoz@redhat.com>
+
+// Copyright (C) 2001 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.
+
+// 19.1 Exception classes
+
+#include <string>
+#include <stdexcept>
+#include <testsuite_hooks.h>
+
+// libstdc++/1972
+void test01()
+{
+ bool test = true;
+ std::string s("lack of sunlight, no water error");
+ // XXX work around long-standing, pathalogical, hostility-inducing parser bug
+ // std::logic_error obj(std::string(strlit));
+
+ // 1
+ std::logic_error obj = std::logic_error(s);
+
+ // 2
+ // std::logic_error obj((std::string)strlit);
+
+ VERIFY( std::strcmp(obj.what(), s.data()) == 0 );
+}
+
+void test02()
+{
+ bool test = true;
+ std::string s("lack of sunlight error");
+ std::domain_error x(s);
+
+ VERIFY( std::strcmp(x.what(), s.data()) == 0 );
+}
+
+// libstdc++/2089
+class fuzzy_logic : public std::logic_error
+{
+public:
+ fuzzy_logic() : std::logic_error("whoa") { }
+};
+
+void test03()
+{
+ bool test = true;
+
+ try
+ { throw fuzzy_logic(); }
+ catch(const fuzzy_logic& obj)
+ { VERIFY( std::strcmp("whoa", obj.what()) == 0 ); }
+ catch(...)
+ { VERIFY( false ); }
+}
+
+// test copy ctors and assignment operators
+// libstdc++/1972
+// via Greg Bumgardner <bumgard@roguewave.com>
+void allocate_on_stack(void)
+{
+ const size_t num = 512;
+ __extension__ char array[num];
+ for (size_t i = 0; i < num; i++)
+ array[i]=0;
+}
+void test04()
+{
+ const std::string s("CA ISO emergency once again:immediate power down");
+ const char* strlit1 = "wish I lived in Palo Alto";
+ const char* strlit2 = "...or Santa Barbara";
+ std::runtime_error obj1(s);
+
+ // block 01
+ {
+ const std::string s2(strlit1);
+ std::runtime_error obj2(s2);
+ obj1 = obj2;
+ }
+ allocate_on_stack();
+ VERIFY( std::strcmp(strlit1, obj1.what()) == 0 );
+
+ // block 02
+ {
+ const std::string s3(strlit2);
+ std::runtime_error obj3 = std::runtime_error(s3);
+ obj1 = obj3;
+ }
+ allocate_on_stack();
+ VERIFY( std::strcmp(strlit2, obj1.what()) == 0 );
+}
+
+int main(void)
+{
+ test01();
+ test02();
+ test03();
+ test04();
+
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/20_util/auto_ptr.cc b/libstdc++-v3/testsuite/20_util/auto_ptr.cc
index 95d8fd0ee1c..a1c3de2374e 100644
--- a/libstdc++-v3/testsuite/20_util/auto_ptr.cc
+++ b/libstdc++-v3/testsuite/20_util/auto_ptr.cc
@@ -19,7 +19,7 @@
// 20.4.5 Template class auto_ptr [lib.auto.ptr]
#include <memory>
-#include <debug_assert.h>
+#include <testsuite_hooks.h>
struct A
{
diff --git a/libstdc++-v3/testsuite/20_util/binders.cc b/libstdc++-v3/testsuite/20_util/binders.cc
new file mode 100644
index 00000000000..6dd45e3ff96
--- /dev/null
+++ b/libstdc++-v3/testsuite/20_util/binders.cc
@@ -0,0 +1,51 @@
+// 2001-06-11 Benjamin Kosnik <bkoz@redhat.com>
+
+// Copyright (C) 2001 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.
+
+// 20.3.6 Binders
+
+#include <vector>
+#include <algorithm> // for_each
+#include <functional>
+
+class Elem
+{
+public:
+ void print(int i) const { }
+ void modify(int i) { }
+};
+
+// libstdc++/3113
+void test01()
+{
+ std::vector<Elem> coll(2);
+ // OK
+ std::for_each(coll.begin(), coll.end(),
+ std::bind2nd(std::mem_fun_ref(&Elem::print), 42));
+ // OK
+ std::for_each(coll.begin(), coll.end(),
+ std::bind2nd(std::mem_fun_ref(&Elem::modify), 42));
+}
+
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/21_strings/append.cc b/libstdc++-v3/testsuite/21_strings/append.cc
index 07b170674a4..c518e952671 100644
--- a/libstdc++-v3/testsuite/21_strings/append.cc
+++ b/libstdc++-v3/testsuite/21_strings/append.cc
@@ -22,7 +22,7 @@
#include <string>
#include <stdexcept>
-#include <debug_assert.h>
+#include <testsuite_hooks.h>
bool test01(void)
{
@@ -160,9 +160,5 @@ bool test01(void)
int main()
{
test01();
+ return 0;
}
-
-
-
-
-
diff --git a/libstdc++-v3/testsuite/21_strings/c_strings.cc b/libstdc++-v3/testsuite/21_strings/c_strings.cc
new file mode 100644
index 00000000000..63041779a83
--- /dev/null
+++ b/libstdc++-v3/testsuite/21_strings/c_strings.cc
@@ -0,0 +1,91 @@
+// 2001-04-02 Benjamin Kosnik <bkoz@redhat.com>
+
+// Copyright (C) 2001 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.
+
+// 21.4: null-terminiated sequence utilities
+
+#include <string>
+#include <cstring>
+#include <cwchar>
+
+void test01()
+{
+ bool test = true;
+ char c = 'a';
+ const char cc = 'b';
+ char* c1 = &c;
+ const char* cc1 = &cc;
+ const char* ccarray1 = "san francisco roof garden inspectors";
+ const char* ccarray2 = "san francisco sunny-day park inspectors";
+ char carray[50];
+ std::strcpy(carray, ccarray1);
+ void* v = carray;
+ const void* cv = ccarray1;
+
+ // const char* strchr(const char* s, int c);
+ // char* strchr(char* s, int c);
+ cc1 = std::strchr(ccarray1, 'c');
+ c1 = std::strchr(carray, 'c');
+
+ // const char* strpbrk(const char* s1, const char* s2);
+ // char* strpbrk(char* s1, const char* s2);
+ cc1 = std::strpbrk(ccarray1, ccarray2);
+ c1 = std::strpbrk(carray, ccarray2);
+
+ // const char* strrchr(const char* s, int c);
+ // char* strrchr(char* s, int c);
+ cc1 = std::strrchr(ccarray1, 'c');
+ c1 = std::strrchr(carray, 'c');
+
+ // const char* strstr(const char* s1, const char* s2);
+ // char* strstr(char* s1, const char* s2);
+ cc1 = std::strstr(ccarray1, ccarray2);
+ c1 = std::strstr(carray, carray);
+
+ // const void* memchr(const void* s, int c, size_t n);
+ // void* memchr( void* s, int c, size_t n);
+ cv = std::memchr(cv, 'a', 3);
+ v = std::memchr(v, 'a', 3);
+}
+
+void test02()
+{
+ using namespace std;
+
+ const char* ccarray1 = "san francisco roof garden inspectors";
+ const char* ccarray2 = "san francisco sunny-day park inspectors";
+ char carray[50];
+ strcpy(carray, ccarray1);
+ void* v = carray;
+ const void* cv = ccarray1;
+
+ memchr(cv, '/', 3);
+ strchr(ccarray1, '/');
+ strpbrk(ccarray1, ccarray2);
+ strrchr(ccarray1, 'c');
+ strstr(carray, carray);
+}
+
+int main()
+{
+ test01();
+ test02();
+
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/21_strings/capacity.cc b/libstdc++-v3/testsuite/21_strings/capacity.cc
index b93e6fe64c8..8239f1b6488 100644
--- a/libstdc++-v3/testsuite/21_strings/capacity.cc
+++ b/libstdc++-v3/testsuite/21_strings/capacity.cc
@@ -22,7 +22,7 @@
#include <string>
#include <cstdio>
-#include <debug_assert.h>
+#include <testsuite_hooks.h>
template<typename T>
struct A { };
@@ -169,11 +169,30 @@ bool test01()
return test;
}
+// libstdc++/4548
+// http://gcc.gnu.org/ml/libstdc++/2001-11/msg00150.html
+bool test02()
+{
+ bool test = true;
+
+ std::string str01 = "twelve chars";
+ // str01 becomes shared
+ std::string str02 = str01;
+ str01.reserve(1);
+ VERIFY( str01.capacity() == 12 );
+
+#ifdef DEBUG_ASSERT
+ assert(test);
+#endif
+
+ return test;
+}
+
+
int main()
{
test01();
+ test02();
return 0;
}
-
-
diff --git a/libstdc++-v3/testsuite/21_strings/char_traits.cc b/libstdc++-v3/testsuite/21_strings/char_traits_requirements.cc
index 1978bda41b3..d2406ed3599 100644
--- a/libstdc++-v3/testsuite/21_strings/char_traits.cc
+++ b/libstdc++-v3/testsuite/21_strings/char_traits_requirements.cc
@@ -1,6 +1,6 @@
// 1999-06-03 bkoz
-// Copyright (C) 1999, 2000 Free Software Foundation, Inc.
+// Copyright (C) 1999, 2000, 2001 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
@@ -18,10 +18,10 @@
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
-// 21.1 Characher traits
+// 21.1.1 Characher traits requirements
#include <string>
-#include <debug_assert.h>
+#include <testsuite_hooks.h>
int test01(void)
{
@@ -200,9 +200,5 @@ int main()
#if _GLIBCPP_USE_WCHAR_T
test02();
#endif
+ return 0;
}
-
-
-
-
-
diff --git a/libstdc++-v3/testsuite/21_strings/char_traits-int_type.C b/libstdc++-v3/testsuite/21_strings/char_traits_typedefs.cc
index 40b05a9c36c..699a479fa83 100644
--- a/libstdc++-v3/testsuite/21_strings/char_traits-int_type.C
+++ b/libstdc++-v3/testsuite/21_strings/char_traits_typedefs.cc
@@ -1,7 +1,7 @@
// 2001-02-11 gdr
// Origin: Craig Rodrigues <rodrigc@mediaone.net>
-// Copyright (C) 1999, 2000 Free Software Foundation, Inc.
+// Copyright (C) 2001 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
@@ -19,13 +19,14 @@
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
-// 21.1.3.1/2: char_traits<char>::int_type == int
+// 21.1.2: char_traits typedefs
#include <string>
int main()
{
- // dg-options -ansi -pedantic-errors
+ // 21.1.3: char_traits<char>::int_type == int
+ // dg-options -ansi -pedantic-err
std::char_traits<char>::int_type* p = 0;
int* q = p; // dg-do compile
diff --git a/libstdc++-v3/testsuite/21_strings/compare.cc b/libstdc++-v3/testsuite/21_strings/compare.cc
index ba10e61f5cf..d06dbfda4f9 100644
--- a/libstdc++-v3/testsuite/21_strings/compare.cc
+++ b/libstdc++-v3/testsuite/21_strings/compare.cc
@@ -31,7 +31,7 @@
// things would be sorted in a dictionary.
#include <string>
-#include <debug_assert.h>
+#include <testsuite_hooks.h>
enum want_value {lt=0, z=1, gt=2};
@@ -135,9 +135,3 @@ main()
return 0;
}
-
-
-
-
-
-
diff --git a/libstdc++-v3/testsuite/21_strings/ctor_copy_dtor.cc b/libstdc++-v3/testsuite/21_strings/ctor_copy_dtor.cc
index f38c42df944..355ce4d5dcd 100644
--- a/libstdc++-v3/testsuite/21_strings/ctor_copy_dtor.cc
+++ b/libstdc++-v3/testsuite/21_strings/ctor_copy_dtor.cc
@@ -1,6 +1,6 @@
// 1999-06-04 bkoz
-// Copyright (C) 1999, 2000 Free Software Foundation, Inc.
+// Copyright (C) 1999, 2000, 2001 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
@@ -23,7 +23,7 @@
#include <new>
#include <string>
#include <stdexcept>
-#include <debug_assert.h>
+#include <testsuite_hooks.h>
int test01(void)
{
@@ -176,16 +176,29 @@ void test02()
#endif
}
+void test03()
+{
+ bool test = true;
+ const char* with_nulls = "This contains \0 a zero byte.";
+
+ // These are tests to see how basic_string handles data with NUL
+ // bytes. Obviously basic_string(char*) will halt at the first one, but
+ // nothing else should.
+ std::string s1 (with_nulls, 28);
+ VERIFY( s1.size() == 28 );
+ std::string s2 (s1);
+ VERIFY( s2.size() == 28 );
+
+#ifdef DEBUG_ASSERT
+ assert(test);
+#endif
+}
+
int main()
{
+ __set_testsuite_memlimit();
test01();
test02();
+ test03();
+ return 0;
}
-
-
-
-
-
-
-
-
diff --git a/libstdc++-v3/testsuite/21_strings/element_access.cc b/libstdc++-v3/testsuite/21_strings/element_access.cc
index 34d63923a94..072f5ac85e7 100644
--- a/libstdc++-v3/testsuite/21_strings/element_access.cc
+++ b/libstdc++-v3/testsuite/21_strings/element_access.cc
@@ -22,7 +22,7 @@
#include <string>
#include <stdexcept>
-#include <debug_assert.h>
+#include <testsuite_hooks.h>
bool test01(void)
{
@@ -89,12 +89,6 @@ bool test01(void)
int main()
{
-
-
test01();
+ return 0;
}
-
-
-
-
-
diff --git a/libstdc++-v3/testsuite/21_strings/find.cc b/libstdc++-v3/testsuite/21_strings/find.cc
index 8bafeb4ab10..c6a4c1cbac8 100644
--- a/libstdc++-v3/testsuite/21_strings/find.cc
+++ b/libstdc++-v3/testsuite/21_strings/find.cc
@@ -22,7 +22,7 @@
#include <string>
#include <stdexcept>
-#include <debug_assert.h>
+#include <testsuite_hooks.h>
bool test01(void)
{
@@ -194,9 +194,5 @@ bool test01(void)
int main()
{
test01();
+ return 0;
}
-
-
-
-
-
diff --git a/libstdc++-v3/testsuite/21_strings/insert.cc b/libstdc++-v3/testsuite/21_strings/insert.cc
index da51000bd08..3c8dff0d5dc 100644
--- a/libstdc++-v3/testsuite/21_strings/insert.cc
+++ b/libstdc++-v3/testsuite/21_strings/insert.cc
@@ -22,7 +22,7 @@
#include <string>
#include <stdexcept>
-#include <debug_assert.h>
+#include <testsuite_hooks.h>
int test01(void)
{
@@ -189,10 +189,7 @@ int test01(void)
int main()
{
+ __set_testsuite_memlimit();
test01();
+ return 0;
}
-
-
-
-
-
diff --git a/libstdc++-v3/testsuite/21_strings/inserters_extractors.cc b/libstdc++-v3/testsuite/21_strings/inserters_extractors.cc
index 559598d8e8a..b83e5aa4e60 100644
--- a/libstdc++-v3/testsuite/21_strings/inserters_extractors.cc
+++ b/libstdc++-v3/testsuite/21_strings/inserters_extractors.cc
@@ -30,7 +30,7 @@
#include <fstream>
#include <iostream>
#include <iomanip>
-#include <debug_assert.h>
+#include <testsuite_hooks.h>
bool test01(void)
{
@@ -41,9 +41,8 @@ bool test01(void)
csize_type npos = std::string::npos;
csize_type csz01, csz02;
- const char str_lit01[] = "sailing grand traverse bay
- from Elk Rapids to the point reminds me of miles";
- const std::string str01(str_lit01);
+ const std::string str01("sailing grand traverse bay\n"
+ "\t\t\t from Elk Rapids to the point reminds me of miles");
const std::string str02("sailing");
const std::string str03("grand");
const std::string str04("traverse");
@@ -124,7 +123,7 @@ bool test01(void)
getline(istrs02, str10);
VERIFY( istrs02.fail() );
VERIFY( istrs02.eof() );
- VERIFY( str10 == "\t from Elk Rapids to the point reminds me of miles" );
+ VERIFY( str10 =="\t from Elk Rapids to the point reminds me of miles" );
}
catch(std::exception& fail) {
VERIFY( false ); // shouldn't throw
@@ -305,6 +304,26 @@ void test08()
VERIFY( year == 2001 );
}
+// libstdc++/2830
+void test09()
+{
+ bool test = true;
+ std::string blanks( 3, '\0');
+ std::string foo = "peace";
+ foo += blanks;
+ foo += "& love";
+
+ std::ostringstream oss1;
+ oss1 << foo;
+ VERIFY( oss1.str() == foo );
+
+ std::ostringstream oss2;
+ oss2.width(20);
+ oss2 << foo;
+ VERIFY( oss2.str() != foo );
+ VERIFY( oss2.str().size() == 20 );
+}
+
int main()
{
test01();
@@ -321,12 +340,7 @@ int main()
test07();
test08();
+
+ test09();
return 0;
}
-
-
-
-
-
-
-
diff --git a/libstdc++-v3/testsuite/21_strings/invariants.cc b/libstdc++-v3/testsuite/21_strings/invariants.cc
index 5a00281170f..d6dd05d6831 100644
--- a/libstdc++-v3/testsuite/21_strings/invariants.cc
+++ b/libstdc++-v3/testsuite/21_strings/invariants.cc
@@ -22,7 +22,7 @@
#include <string>
#include <stdexcept>
-#include <debug_assert.h>
+#include <testsuite_hooks.h>
// Do a quick sanity check on known problems with element access and
// ref-counted strings. These should all pass, regardless of the
@@ -171,9 +171,5 @@ int main()
{
test01();
test02();
+ return 0;
}
-
-
-
-
-
diff --git a/libstdc++-v3/testsuite/21_strings/nonmember.cc b/libstdc++-v3/testsuite/21_strings/nonmember.cc
index 61704fda6cc..451611e94f0 100644
--- a/libstdc++-v3/testsuite/21_strings/nonmember.cc
+++ b/libstdc++-v3/testsuite/21_strings/nonmember.cc
@@ -111,7 +111,7 @@ template<class charT, class traits, class Allocator>
*/
#include <string>
-#include <debug_assert.h>
+#include <testsuite_hooks.h>
int test01(void)
{
@@ -293,12 +293,8 @@ template<class charT, class traits, class Allocator>
return 0;
}
-int main() {
+int main()
+{
test01();
+ return 0;
}
-
-
-
-
-
-
diff --git a/libstdc++-v3/testsuite/21_strings/operations.cc b/libstdc++-v3/testsuite/21_strings/operations.cc
index 996d7d566ef..b6c68ebcb9e 100644
--- a/libstdc++-v3/testsuite/21_strings/operations.cc
+++ b/libstdc++-v3/testsuite/21_strings/operations.cc
@@ -22,7 +22,7 @@
#include <string>
#include <cstdio>
-#include <debug_assert.h>
+#include <testsuite_hooks.h>
int test01(void)
{
@@ -52,5 +52,5 @@ int test01(void)
int main()
{
test01();
+ return 0;
}
-
diff --git a/libstdc++-v3/testsuite/21_strings/replace.cc b/libstdc++-v3/testsuite/21_strings/replace.cc
index 2ad1ab61a65..b4aac625ea1 100644
--- a/libstdc++-v3/testsuite/21_strings/replace.cc
+++ b/libstdc++-v3/testsuite/21_strings/replace.cc
@@ -22,7 +22,7 @@
#include <string>
#include <stdexcept>
-#include <debug_assert.h>
+#include <testsuite_hooks.h>
bool test01(void)
{
@@ -86,9 +86,5 @@ bool test01(void)
int main()
{
test01();
+ return 0;
}
-
-
-
-
-
diff --git a/libstdc++-v3/testsuite/21_strings/rfind.cc b/libstdc++-v3/testsuite/21_strings/rfind.cc
index cf826dda52c..af720f3820d 100644
--- a/libstdc++-v3/testsuite/21_strings/rfind.cc
+++ b/libstdc++-v3/testsuite/21_strings/rfind.cc
@@ -20,7 +20,7 @@
#include <string>
#include <stdexcept>
-#include <debug_assert.h>
+#include <testsuite_hooks.h>
// 21.3.6.2 basic_string rfind
bool test01(void)
@@ -121,4 +121,5 @@ int main()
test01();
test02();
test03();
+ return 0;
}
diff --git a/libstdc++-v3/testsuite/21_strings/substr.cc b/libstdc++-v3/testsuite/21_strings/substr.cc
index 5c643576276..0ec6ee35453 100644
--- a/libstdc++-v3/testsuite/21_strings/substr.cc
+++ b/libstdc++-v3/testsuite/21_strings/substr.cc
@@ -22,7 +22,7 @@
#include <string>
#include <stdexcept>
-#include <debug_assert.h>
+#include <testsuite_hooks.h>
bool test01(void)
{
@@ -76,9 +76,5 @@ bool test01(void)
int main()
{
test01();
+ return 0;
}
-
-
-
-
-
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt_char_char.cc b/libstdc++-v3/testsuite/22_locale/codecvt_char_char.cc
index a86e7ff9ef8..01542666ebe 100644
--- a/libstdc++-v3/testsuite/22_locale/codecvt_char_char.cc
+++ b/libstdc++-v3/testsuite/22_locale/codecvt_char_char.cc
@@ -21,7 +21,7 @@
// 22.2.1.5 - Template class codecvt [lib.locale.codecvt]
#include <locale>
-#include <debug_assert.h>
+#include <testsuite_hooks.h>
// Required instantiation, degenerate conversion.
// codecvt<char, char, mbstate_t>
@@ -85,6 +85,3 @@ int main ()
return 0;
}
-
-
-
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt_unicode_char.cc b/libstdc++-v3/testsuite/22_locale/codecvt_unicode_char.cc
index 86fbc69376a..8118c176a0b 100644
--- a/libstdc++-v3/testsuite/22_locale/codecvt_unicode_char.cc
+++ b/libstdc++-v3/testsuite/22_locale/codecvt_unicode_char.cc
@@ -21,7 +21,7 @@
// 22.2.1.5 - Template class codecvt [lib.locale.codecvt]
#include <locale>
-#include <debug_assert.h>
+#include <testsuite_hooks.h>
using namespace std;
@@ -237,6 +237,3 @@ int main ()
return 0;
}
-
-
-
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt_unicode_wchar_t.cc b/libstdc++-v3/testsuite/22_locale/codecvt_unicode_wchar_t.cc
index 606c7168b57..4547e01cee5 100644
--- a/libstdc++-v3/testsuite/22_locale/codecvt_unicode_wchar_t.cc
+++ b/libstdc++-v3/testsuite/22_locale/codecvt_unicode_wchar_t.cc
@@ -21,7 +21,7 @@
// 22.2.1.5 - Template class codecvt [lib.locale.codecvt]
#include <locale>
-#include <debug_assert.h>
+#include <testsuite_hooks.h>
using namespace std;
@@ -130,6 +130,3 @@ int main ()
return 0;
}
-
-
-
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt_wchar_t_char.cc b/libstdc++-v3/testsuite/22_locale/codecvt_wchar_t_char.cc
index 8ea65743a1f..92235e8486f 100644
--- a/libstdc++-v3/testsuite/22_locale/codecvt_wchar_t_char.cc
+++ b/libstdc++-v3/testsuite/22_locale/codecvt_wchar_t_char.cc
@@ -22,7 +22,7 @@
#include <cwchar> // for mbstate_t
#include <locale>
-#include <debug_assert.h>
+#include <testsuite_hooks.h>
// Need to explicitly set the state(mbstate_t) to zero.
@@ -121,6 +121,3 @@ int main ()
return 0;
}
-
-
-
diff --git a/libstdc++-v3/testsuite/22_locale/ctor_copy_dtor.cc b/libstdc++-v3/testsuite/22_locale/ctor_copy_dtor.cc
index cbac8843187..21e1f26b1e5 100644
--- a/libstdc++-v3/testsuite/22_locale/ctor_copy_dtor.cc
+++ b/libstdc++-v3/testsuite/22_locale/ctor_copy_dtor.cc
@@ -23,7 +23,7 @@
#include <cwchar> // for mbstate_t
#include <locale>
#include <stdexcept>
-#include <debug_assert.h>
+#include <testsuite_hooks.h>
#if _GLIBCPP_USE_WCHAR_T
typedef std::codecvt<char, char, std::mbstate_t> c_codecvt;
diff --git a/libstdc++-v3/testsuite/22_locale/ctype.cc b/libstdc++-v3/testsuite/22_locale/ctype.cc
index b51ee70932b..54a6a4e2e03 100644
--- a/libstdc++-v3/testsuite/22_locale/ctype.cc
+++ b/libstdc++-v3/testsuite/22_locale/ctype.cc
@@ -153,8 +153,21 @@ test01()
m01 ^= m02;
}
+class gnu_obj
+{ };
+
+class gnu_ctype2: public std::ctype<gnu_obj>
+{ };
+
+// libstdc++/3017
+void test02()
+{
+ gnu_ctype2 obj;
+}
+
int main()
{
test01();
+ test02();
return 0;
}
diff --git a/libstdc++-v3/testsuite/22_locale/ctype_char_members.cc b/libstdc++-v3/testsuite/22_locale/ctype_char_members.cc
index 93eedd171ce..d13f97e13d9 100644
--- a/libstdc++-v3/testsuite/22_locale/ctype_char_members.cc
+++ b/libstdc++-v3/testsuite/22_locale/ctype_char_members.cc
@@ -31,7 +31,7 @@
#include <locale>
// NB: Don't include any other headers in this file.
-#include <debug_assert.h>
+#include <testsuite_hooks.h>
class gnu_ctype: public std::ctype<char> { };
@@ -172,5 +172,3 @@ int main() {
test01();
return 0;
}
-
-
diff --git a/libstdc++-v3/testsuite/22_locale/ctype_wchar_t_members.cc b/libstdc++-v3/testsuite/22_locale/ctype_wchar_t_members.cc
index f4a104e25ce..107a4d5e3c3 100644
--- a/libstdc++-v3/testsuite/22_locale/ctype_wchar_t_members.cc
+++ b/libstdc++-v3/testsuite/22_locale/ctype_wchar_t_members.cc
@@ -31,7 +31,7 @@
#include <locale>
// NB: Don't include any other headers in this file.
-#include <debug_assert.h>
+#include <testsuite_hooks.h>
#if _GLIBCPP_USE_WCHAR_T
class gnu_ctype: public std::ctype<wchar_t> {};
@@ -105,5 +105,3 @@ int main() {
#endif /* !defined(_GLIBCPP_USE_WCHAR_T) */
return 0;
}
-
-
diff --git a/libstdc++-v3/testsuite/22_locale/facet.cc b/libstdc++-v3/testsuite/22_locale/facet.cc
index 1f1a42fa914..7f4d9953da4 100644
--- a/libstdc++-v3/testsuite/22_locale/facet.cc
+++ b/libstdc++-v3/testsuite/22_locale/facet.cc
@@ -25,7 +25,7 @@
#include <stdexcept>
#include <string>
#include <iterator>
-#include <debug_assert.h>
+#include <testsuite_hooks.h>
// 1 a class if a facet if it is publicly derived from another facet
typedef std::istreambuf_iterator<char> input_iterator;
@@ -239,11 +239,3 @@ int main ()
return 0;
}
-
-
-
-
-
-
-
-
diff --git a/libstdc++-v3/testsuite/22_locale/global_templates.cc b/libstdc++-v3/testsuite/22_locale/global_templates.cc
index afd00b060b5..49886aa18bf 100644
--- a/libstdc++-v3/testsuite/22_locale/global_templates.cc
+++ b/libstdc++-v3/testsuite/22_locale/global_templates.cc
@@ -22,7 +22,7 @@
#include <cwchar> // for mbstate_t
#include <locale>
-#include <debug_assert.h>
+#include <testsuite_hooks.h>
typedef std::codecvt<char, char, std::mbstate_t> ccodecvt;
diff --git a/libstdc++-v3/testsuite/22_locale/members.cc b/libstdc++-v3/testsuite/22_locale/members.cc
index c474a17ee87..16bc6c587e9 100644
--- a/libstdc++-v3/testsuite/22_locale/members.cc
+++ b/libstdc++-v3/testsuite/22_locale/members.cc
@@ -22,7 +22,7 @@
#include <locale>
#include <string>
-#include <debug_assert.h>
+#include <testsuite_hooks.h>
// creating unnamed locales 1 using new + combine
void
@@ -135,6 +135,3 @@ int main()
test02();
return 0;
}
-
-
-
diff --git a/libstdc++-v3/testsuite/22_locale/numpunct_byname.cc b/libstdc++-v3/testsuite/22_locale/numpunct_byname.cc
index 444f364a2e5..5fbbcc251be 100644
--- a/libstdc++-v3/testsuite/22_locale/numpunct_byname.cc
+++ b/libstdc++-v3/testsuite/22_locale/numpunct_byname.cc
@@ -21,7 +21,7 @@
// 22.2.3.2 Template class numpunct_byname
#include <locale>
-#include <debug_assert.h>
+#include <testsuite_hooks.h>
void test01()
{
@@ -68,6 +68,3 @@ int main()
return 0;
}
-
-
-
diff --git a/libstdc++-v3/testsuite/22_locale/numpunct_char_members.cc b/libstdc++-v3/testsuite/22_locale/numpunct_char_members.cc
index 64c329fee19..87409fe583d 100644
--- a/libstdc++-v3/testsuite/22_locale/numpunct_char_members.cc
+++ b/libstdc++-v3/testsuite/22_locale/numpunct_char_members.cc
@@ -21,7 +21,7 @@
// 22.2.3.1.1 nunpunct members
#include <locale>
-#include <debug_assert.h>
+#include <testsuite_hooks.h>
void test01()
{
@@ -88,4 +88,3 @@ int main()
return 0;
}
-
diff --git a/libstdc++-v3/testsuite/22_locale/operators.cc b/libstdc++-v3/testsuite/22_locale/operators.cc
index e876748d302..2b9cd337da7 100644
--- a/libstdc++-v3/testsuite/22_locale/operators.cc
+++ b/libstdc++-v3/testsuite/22_locale/operators.cc
@@ -22,7 +22,7 @@
#include <cwchar> // for mbstate_t
#include <locale>
-#include <debug_assert.h>
+#include <testsuite_hooks.h>
typedef std::codecvt<char, char, std::mbstate_t> ccodecvt;
class gnu_codecvt: public ccodecvt { };
diff --git a/libstdc++-v3/testsuite/22_locale/static_members.cc b/libstdc++-v3/testsuite/22_locale/static_members.cc
index 7f951d81ff8..16e856a2ee4 100644
--- a/libstdc++-v3/testsuite/22_locale/static_members.cc
+++ b/libstdc++-v3/testsuite/22_locale/static_members.cc
@@ -22,7 +22,7 @@
#include <cwchar> // for mbstate_t
#include <locale>
-#include <debug_assert.h>
+#include <testsuite_hooks.h>
typedef std::codecvt<char, char, std::mbstate_t> ccodecvt;
class gnu_codecvt: public ccodecvt { };
diff --git a/libstdc++-v3/testsuite/23_containers/bitset_ctor.cc b/libstdc++-v3/testsuite/23_containers/bitset_ctor.cc
index 9741f24b463..8f9008ff058 100644
--- a/libstdc++-v3/testsuite/23_containers/bitset_ctor.cc
+++ b/libstdc++-v3/testsuite/23_containers/bitset_ctor.cc
@@ -22,7 +22,7 @@
#include <string>
#include <bitset>
-#include <debug_assert.h>
+#include <testsuite_hooks.h>
bool test01(void)
{
diff --git a/libstdc++-v3/testsuite/23_containers/bitset_members.cc b/libstdc++-v3/testsuite/23_containers/bitset_members.cc
new file mode 100644
index 00000000000..cef2cf99e52
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/bitset_members.cc
@@ -0,0 +1,59 @@
+// 2001-06-03 pme
+
+// Copyright (C) 2001 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.
+
+// 23.3.5.2 bitset members
+
+#include <bitset>
+#include <testsuite_hooks.h>
+
+bool test01(void)
+{
+ bool test = true;
+ const size_t n1 = 5;
+
+// the other 22 member functions should be in here too...
+
+
+ // test()
+ try {
+ std::bitset<n1> five_bits;
+ bool unused = five_bits.test(n1); // should throw
+ VERIFY( false );
+ }
+ catch(std::out_of_range& fail) {
+ VERIFY( true );
+ }
+ catch(...) {
+ VERIFY( false );
+ }
+
+
+#ifdef DEBUG_ASSERT
+ assert(test);
+#endif
+ return test;
+}
+
+int main()
+{
+ test01();
+
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/bitset_shift.cc b/libstdc++-v3/testsuite/23_containers/bitset_shift.cc
index 3ca2ee3db18..35531bf5b4c 100644
--- a/libstdc++-v3/testsuite/23_containers/bitset_shift.cc
+++ b/libstdc++-v3/testsuite/23_containers/bitset_shift.cc
@@ -22,7 +22,7 @@
#include <set>
#include <bitset>
-#include <debug_assert.h>
+#include <testsuite_hooks.h>
static char original_bits[1024];
static char left_shifted[1024];
diff --git a/libstdc++-v3/testsuite/23_containers/map_insert.cc b/libstdc++-v3/testsuite/23_containers/map_insert.cc
new file mode 100644
index 00000000000..d870897a6c7
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/map_insert.cc
@@ -0,0 +1,69 @@
+// 2001-08-23 pme & Sylvain.Pion@sophia.inria.fr
+
+// Copyright (C) 2001 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.
+
+// 23.3.1.2, table 69 -- map::insert(p,t)
+
+#include <map>
+#include <testsuite_hooks.h>
+
+// { dg-do run }
+
+// libstdc++/3349 and
+// http://gcc.gnu.org/ml/gcc-patches/2001-08/msg01375.html
+void test01()
+{
+ typedef std::map<int, int> Map;
+ Map M;
+ Map::iterator hint;
+
+ hint = M.insert(Map::value_type(7, 0)).first;
+
+ M.insert(hint, Map::value_type(8, 1));
+ M.insert(M.begin(), Map::value_type(9, 2));
+
+#if 0
+ // The tree's __rb_verify() member must be exposed in map<> before this
+ // will even compile. It's good test to see that "missing" entries are
+ // in fact present in the {map,tree}, but in the wrong place.
+ if (0)
+ {
+ Map::iterator i = M.begin();
+ while (i != M.end()) {
+ std::cerr << '(' << i->first << ',' << i->second << ")\n";
+ ++i;
+ }
+ std::cerr << "tree internal verify: "
+ << std::boolalpha << M.__rb_verify() << "\n";
+ }
+#endif
+
+ VERIFY ( M.find(7) != M.end() );
+ VERIFY ( M.find(8) != M.end() );
+ VERIFY ( M.find(9) != M.end() );
+}
+
+
+int main()
+{
+ test01();
+
+ return 0;
+}
+
diff --git a/libstdc++-v3/testsuite/23_containers/map_operators.cc b/libstdc++-v3/testsuite/23_containers/map_operators.cc
index 4def7aa79aa..6df8a2b7c01 100644
--- a/libstdc++-v3/testsuite/23_containers/map_operators.cc
+++ b/libstdc++-v3/testsuite/23_containers/map_operators.cc
@@ -1,6 +1,6 @@
// 2000-09-07 bgarcia@laurelnetworks.com
-// Copyright (C) 2000 Free Software Foundation, Inc.
+// Copyright (C) 2000, 2001 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
@@ -24,9 +24,10 @@
#include <string>
#include <iostream>
-// map and set
+// { dg-do compile }
+// { dg-excess-errors "" }
+
// libstdc++/86: map & set iterator comparisons are not type-safe
-// XXX this is XFAIL for the time being, ie this should not compile
void test01()
{
bool test = true;
@@ -37,28 +38,27 @@ void test01()
mapByIndex.insert(std::pair<unsigned, int>(6, 5));
std::map<unsigned, int>::iterator itr(mapByIndex.begin());
-
- test &= itr != mapByName.end(); // XXX - notice, it's not mapByIndex!!
- test &= itr == mapByName.end(); // XXX - notice, it's not mapByIndex!!
- return 0;
+ // NB: notice, it's not mapByIndex!!
+ test &= itr != mapByName.end(); // { dg-error "match" "" { xfail *-*-* } }
+ test &= itr == mapByName.end(); // { dg-error "match" "" { xfail *-*-* } }
}
// http://gcc.gnu.org/ml/libstdc++/2000-11/msg00093.html
void test02()
{
- typedef std::map<int,const int> MapInt;
-
- MapInt m;
-
- for (unsigned i=0;i<10;++i)
- m.insert(MapInt::value_type(i,i));
-
- for (MapInt::const_iterator i=m.begin();i!=m.end();++i)
- std::cerr << i->second << ' ';
-
- for (MapInt::const_iterator i=m.begin();m.end()!=i;++i)
- std::cerr << i->second << ' ';
+ typedef std::map<int,const int> MapInt;
+
+ MapInt m;
+
+ for (unsigned i=0;i<10;++i)
+ m.insert(MapInt::value_type(i,i));
+
+ for (MapInt::const_iterator i=m.begin();i!=m.end();++i)
+ std::cerr << i->second << ' ';
+
+ for (MapInt::const_iterator i=m.begin();m.end()!=i;++i)
+ std::cerr << i->second << ' ';
}
int main()
diff --git a/libstdc++-v3/testsuite/23_containers/multiset.cc b/libstdc++-v3/testsuite/23_containers/multiset.cc
index 5e9c195c84c..90cd1c6d5df 100644
--- a/libstdc++-v3/testsuite/23_containers/multiset.cc
+++ b/libstdc++-v3/testsuite/23_containers/multiset.cc
@@ -70,4 +70,3 @@ int main ()
69 9
69 4
*/
-
diff --git a/libstdc++-v3/testsuite/23_containers/set_operators.cc b/libstdc++-v3/testsuite/23_containers/set_operators.cc
index 42e01e9de4a..5bf9dba18f9 100644
--- a/libstdc++-v3/testsuite/23_containers/set_operators.cc
+++ b/libstdc++-v3/testsuite/23_containers/set_operators.cc
@@ -1,6 +1,6 @@
// 2000-09-07 bgarcia@laurelnetworks.com
-// Copyright (C) 2000 Free Software Foundation, Inc.
+// Copyright (C) 2000, 2001 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
@@ -22,10 +22,11 @@
#include <set>
#include <string>
+make
+// { dg-do compile }
+// { dg-excess-errors "" }
-// map and set
// libstdc++/86: map & set iterator comparisons are not type-safe
-// XXX this is XFAIL for the time being, ie this should not compile
int main(void)
{
bool test = true;
@@ -35,8 +36,11 @@ int main(void)
std::set<unsigned int>::iterator itr(setByIndex.begin());
- test &= itr != setByName.end(); // XXX - notice, it's not setByIndex!!
- test &= itr == setByName.end(); // XXX - notice, it's not setByIndex!!
+ // NB: it's not setByIndex!!
+ test &= itr != setByName.end();
+ // { dg-error "no match for" "" { xfail *-*-* } 41 }
+ test &= itr == setByName.end();
+ // { dg-error "no match for" "" { xfail *-*-* } 43 }
return 0;
}
diff --git a/libstdc++-v3/testsuite/23_containers/vector_capacity.cc b/libstdc++-v3/testsuite/23_containers/vector_capacity.cc
index b69e2abf1bb..a56f2ef40c4 100644
--- a/libstdc++-v3/testsuite/23_containers/vector_capacity.cc
+++ b/libstdc++-v3/testsuite/23_containers/vector_capacity.cc
@@ -22,7 +22,7 @@
// 23.2.4.2 vector capacity
#include <vector>
-#include <debug_assert.h>
+#include <testsuite_hooks.h>
template<typename T>
struct A { };
diff --git a/libstdc++-v3/testsuite/23_containers/vector_ctor.cc b/libstdc++-v3/testsuite/23_containers/vector_ctor.cc
index 10a244f533b..63f8325a30e 100644
--- a/libstdc++-v3/testsuite/23_containers/vector_ctor.cc
+++ b/libstdc++-v3/testsuite/23_containers/vector_ctor.cc
@@ -22,7 +22,7 @@
// 23.2.4.1 vector constructors, copy, and assignment
#include <vector>
-#include <debug_assert.h>
+#include <testsuite_hooks.h>
template<typename T>
struct A { };
@@ -64,6 +64,3 @@ int main()
test02();
return 0;
}
-
-
-
diff --git a/libstdc++-v3/testsuite/23_containers/vector_element_access.cc b/libstdc++-v3/testsuite/23_containers/vector_element_access.cc
index 016310b9d3b..5f5b5d231de 100644
--- a/libstdc++-v3/testsuite/23_containers/vector_element_access.cc
+++ b/libstdc++-v3/testsuite/23_containers/vector_element_access.cc
@@ -23,7 +23,7 @@
#include <vector>
#include <stdexcept>
-#include <debug_assert.h>
+#include <testsuite_hooks.h>
template<typename T>
struct A { };
@@ -66,6 +66,3 @@ int main()
return 0;
}
-
-
-
diff --git a/libstdc++-v3/testsuite/23_containers/vector_modifiers.cc b/libstdc++-v3/testsuite/23_containers/vector_modifiers.cc
index f1ba0229d61..5660f54933f 100644
--- a/libstdc++-v3/testsuite/23_containers/vector_modifiers.cc
+++ b/libstdc++-v3/testsuite/23_containers/vector_modifiers.cc
@@ -21,7 +21,7 @@
// 23.2.4.3 vector modifiers
#include <vector>
-#include <debug_assert.h>
+#include <testsuite_hooks.h>
template<typename T>
struct A { };
@@ -63,7 +63,3 @@ int main()
return 0;
}
-
-
-
-
diff --git a/libstdc++-v3/testsuite/24_iterators/istreambuf_iterator.cc b/libstdc++-v3/testsuite/24_iterators/istreambuf_iterator.cc
index 78d36331604..d908e2344ef 100644
--- a/libstdc++-v3/testsuite/24_iterators/istreambuf_iterator.cc
+++ b/libstdc++-v3/testsuite/24_iterators/istreambuf_iterator.cc
@@ -1,6 +1,6 @@
// 1999-06-28 bkoz
-// Copyright (C) 1999 Free Software Foundation, Inc.
+// Copyright (C) 1999, 2001 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
@@ -22,7 +22,7 @@
#include <sstream>
#include <iterator>
-#include <debug_assert.h>
+#include <testsuite_hooks.h>
bool test01(void)
{
@@ -102,7 +102,7 @@ bool test01(void)
std::istringstream istrs02(str01);
cistreambuf_iter istrb_it28(istrs02);
- for (int i = 0; i < sizeof(slit01) - 3;)
+ for (int i = 0; i < sizeof(slit01) - 2;)
{
c = *++istrb_it28;
VERIFY( c == slit01[++i] );
@@ -115,11 +115,46 @@ bool test01(void)
return test;
}
+// libstdc++/2627
+void test02()
+{
+ bool test = true;
+ const std::string s("free the vieques");
+
+ // 1
+ std::string res_postfix;
+ std::istringstream iss01(s);
+ std::istreambuf_iterator<char> isbufit01(iss01);
+ for (int j = 0; j < s.size(); ++j, isbufit01++)
+ res_postfix += *isbufit01;
+
+ // 2
+ std::string res_prefix;
+ std::istringstream iss02(s);
+ std::istreambuf_iterator<char> isbufit02(iss02);
+ for (int j = 0; j < s.size(); ++j, ++isbufit02)
+ res_prefix += *isbufit02;
+
+ // 3 mixed
+ std::string res_mixed;
+ std::istringstream iss03(s);
+ std::istreambuf_iterator<char> isbufit03(iss03);
+ for (int j = 0; j < int(s.size() / 2); ++j)
+ {
+ res_mixed += *isbufit03;
+ ++isbufit03;
+ res_mixed += *isbufit03;
+ isbufit03++;
+ }
+
+ VERIFY ( res_postfix == res_prefix );
+ VERIFY ( res_mixed == res_prefix );
+}
+
int main()
{
test01();
+ test02();
return 0;
}
-
-
diff --git a/libstdc++-v3/testsuite/24_iterators/iterator.cc b/libstdc++-v3/testsuite/24_iterators/iterator.cc
index 4930f149a0b..a5a6974f80a 100644
--- a/libstdc++-v3/testsuite/24_iterators/iterator.cc
+++ b/libstdc++-v3/testsuite/24_iterators/iterator.cc
@@ -21,7 +21,7 @@
#include <string>
#include <vector>
-#include <debug_assert.h>
+#include <testsuite_hooks.h>
int
string_stuff()
@@ -594,6 +594,5 @@ main(int argc, char **argv)
assert (failures == 0);
#endif
- return failures ? 1 : 0;
+ return 0;
}
-
diff --git a/libstdc++-v3/testsuite/24_iterators/ostreambuf_iterator.cc b/libstdc++-v3/testsuite/24_iterators/ostreambuf_iterator.cc
new file mode 100644
index 00000000000..29bf0d944c2
--- /dev/null
+++ b/libstdc++-v3/testsuite/24_iterators/ostreambuf_iterator.cc
@@ -0,0 +1,98 @@
+// 2001-04-30 Benjamin Kosnik <bkoz@redhat.com>
+
+// Copyright (C) 2001 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.
+
+// 24.5.4 template class ostreambuf_iterator
+
+#include <sstream>
+#include <iterator>
+#include <testsuite_hooks.h>
+
+bool test01(void)
+{
+ typedef std::ostreambuf_iterator<char> costreambuf_iter;
+ typedef costreambuf_iter::streambuf_type cstreambuf_type;
+ bool test = true;
+ const char slit01[] = "playa hermosa, liberia, guanacaste";
+ const char slit02[] = "bodega bay, lost coast, california";
+ std::string str01(slit01);
+ std::string str02(slit02);
+ std::string tmp;
+ std::stringbuf strbuf01;
+ std::stringbuf strbuf02(str01);
+ std::ostringstream ostrs00(str01);
+ std::ostringstream ostrs01(str01);
+
+ // ctor sanity checks
+ costreambuf_iter ostrb_it01(ostrs00);
+ VERIFY( !ostrb_it01.failed() );
+ ostrb_it01++;
+ ++ostrb_it01;
+ VERIFY( !ostrb_it01.failed() );
+ ostrb_it01 = 'a';
+ VERIFY( !ostrb_it01.failed() );
+ *ostrb_it01;
+ VERIFY( !ostrb_it01.failed() );
+
+ costreambuf_iter ostrb_it02(NULL);
+ VERIFY( ostrb_it02.failed() );
+ ostrb_it02++;
+ ++ostrb_it02;
+ VERIFY( ostrb_it02.failed() );
+ *ostrb_it02;
+ VERIFY( ostrb_it02.failed() );
+ ostrb_it02 = 'a';
+ VERIFY( ostrb_it02.failed() );
+
+ // charT operator*() const
+ // ostreambuf_iterator& operator++();
+ // ostreambuf_iterator& operator++(int);
+ costreambuf_iter ostrb_it27(ostrs01);
+ VERIFY( !ostrb_it27.failed() );
+ int j = str02.size();
+ for (int i = 0; i < j; ++i)
+ ostrb_it27 = str02[i];
+ VERIFY( !ostrb_it27.failed() );
+ tmp = ostrs01.str();
+ VERIFY ( tmp != str01 );
+ VERIFY ( tmp == str02 );
+
+ costreambuf_iter ostrb_it28(ostrs00);
+ VERIFY( !ostrb_it28.failed() );
+ j = ostrs00.str().size();
+ for (int i = 0; i < j + 2; ++i)
+ ostrb_it28 = 'b';
+ VERIFY( !ostrb_it28.failed() );
+ tmp = ostrs00.str();
+ VERIFY ( tmp != str01 );
+ VERIFY ( tmp != str02 );
+
+#ifdef DEBUG_ASSERT
+ assert(test);
+#endif
+
+ return test;
+}
+
+int main()
+{
+ test01();
+
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/25_algorithms/equal.cc b/libstdc++-v3/testsuite/25_algorithms/equal.cc
new file mode 100644
index 00000000000..b4a322f4dff
--- /dev/null
+++ b/libstdc++-v3/testsuite/25_algorithms/equal.cc
@@ -0,0 +1,41 @@
+// 2001-04-06 gdr
+
+// Copyright (C) 2000 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.
+
+#include <vector>
+#include <algorithm>
+
+//
+// 25.1.8 Make sure std::equal doesn't make any extra assumption
+// about operator== and operator!=
+//
+
+struct X { };
+
+bool operator==(X, X) { return true; }
+
+// Not implemented on purpose. { dg-do link }
+bool operator!=(X, X);
+
+int main()
+{
+ std::vector<X> v, w;
+
+ return !std::equal(v.begin(), v.end(), w.begin());
+}
diff --git a/libstdc++-v3/testsuite/25_algorithms/lower_bound.cc b/libstdc++-v3/testsuite/25_algorithms/lower_bound.cc
index 714d4557f5c..f6bf336597c 100644
--- a/libstdc++-v3/testsuite/25_algorithms/lower_bound.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/lower_bound.cc
@@ -17,7 +17,7 @@
// USA.
#include <algorithm>
-#include <debug_assert.h>
+#include <testsuite_hooks.h>
// http://gcc.gnu.org/ml/libstdc++/2000-06/msg00316.html
struct foo { };
@@ -43,6 +43,3 @@ int main()
{
return 0;
}
-
-
-
diff --git a/libstdc++-v3/testsuite/25_algorithms/min_max.cc b/libstdc++-v3/testsuite/25_algorithms/min_max.cc
index 04cd6302a34..198247b6f9e 100644
--- a/libstdc++-v3/testsuite/25_algorithms/min_max.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/min_max.cc
@@ -19,7 +19,7 @@
// USA.
#include <algorithm>
-#include <debug_assert.h>
+#include <testsuite_hooks.h>
void test01()
{
@@ -44,6 +44,3 @@ int main()
test01();
return 0;
}
-
-
-
diff --git a/libstdc++-v3/testsuite/26_numerics/binary_closure.cc b/libstdc++-v3/testsuite/26_numerics/binary_closure.cc
index f670d4ac3c8..7dbcfbd5228 100644
--- a/libstdc++-v3/testsuite/26_numerics/binary_closure.cc
+++ b/libstdc++-v3/testsuite/26_numerics/binary_closure.cc
@@ -33,4 +33,5 @@ int main()
d = (a + 2.0* b );
std::cout << "d[4] = " << d[4] << std::endl;
+ return 0;
}
diff --git a/libstdc++-v3/testsuite/26_numerics/buggy_complex.cc b/libstdc++-v3/testsuite/26_numerics/buggy_complex.cc
index ebe8e98bdb8..37930fc5b0b 100644
--- a/libstdc++-v3/testsuite/26_numerics/buggy_complex.cc
+++ b/libstdc++-v3/testsuite/26_numerics/buggy_complex.cc
@@ -34,4 +34,3 @@ int main()
return 0;
}
-
diff --git a/libstdc++-v3/testsuite/26_numerics/c99_classification_macros_c++.cc b/libstdc++-v3/testsuite/26_numerics/c99_classification_macros_c++.cc
new file mode 100644
index 00000000000..132cebf5ab7
--- /dev/null
+++ b/libstdc++-v3/testsuite/26_numerics/c99_classification_macros_c++.cc
@@ -0,0 +1,91 @@
+// 2001-04-06 gdr
+
+// Copyright (C) 2001 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.
+
+// { dg-do compile }
+
+#include <cmath>
+
+void fpclassify() { }
+
+void isfinite() { }
+
+void isinf() { }
+
+void isnan() { }
+
+void isnormal() { }
+
+void signbit() { }
+
+void isgreater() { }
+
+void isgreaterequal() { }
+
+void isless() { }
+
+void islessequal() { }
+
+void islessgreater() { }
+
+void isunordered() { }
+
+#if _GLIBCPP_USE_C99
+template <typename _Tp>
+ void test_c99_classify()
+ {
+ bool test = true;
+
+ typedef _Tp fp_type;
+ fp_type f1 = 1.0;
+ fp_type f2 = 3.0;
+ int res = 0;
+
+ res = std::fpclassify(f1);
+ res = std::isfinite(f2);
+ res = std::isinf(f1);
+ res = std::isnan(f2);
+ res = std::isnormal(f1);
+ res = std::signbit(f2);
+ res = std::isgreater(f1, f2);
+ res = std::isgreaterequal(f1, f2);
+ res = std::isless(f1, f2);
+ res = std::islessequal(f1,f2);
+ res = std::islessgreater(f1, f2);
+ res = std::isunordered(f1, f2);
+ }
+#endif
+
+int main()
+{
+#if _GLIBCPP_USE_C99
+ test_c99_classify<float>();
+ //test_c99_classify<double>();
+#endif
+ return 0;
+}
diff --git a/libstdc++-v3/config/threads-no.h b/libstdc++-v3/testsuite/26_numerics/c99_classification_macros_c.cc
index c2de0f1ef4c..fdd424426cb 100644
--- a/libstdc++-v3/config/threads-no.h
+++ b/libstdc++-v3/testsuite/26_numerics/c99_classification_macros_c.cc
@@ -1,6 +1,6 @@
-// thread support (null case) -*- C++ -*-
+// 2001-04-06 gdr
-// Copyright (C) 2000 Free Software Foundation, Inc.
+// Copyright (C) 2001 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
@@ -27,52 +27,32 @@
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
-// threads-no.h - Defines for using no threads.
+// { dg-do compile }
+// { dg-excess-errors "" }
-#ifndef _CPP_THREADS_NO
-#define _CPP_THREADS_NO
+#include <math.h>
-//
-// Includes
-//
-
-
-//
-// Defines
-//
-
-
-//
-// Typedefs.
-//
-namespace std {
-
- struct __null_mutext { };
- typedef __null_mutext __mutext_type;
+void fpclassify() { } // { dg-error "parse error" "" { xfail *-*-* } }
-} // std
+void isfinite() { }
+void isinf() { }
-//
-// Condition variables.
-//
-
-
-//
-// Mutexes.
-//
-
-
-//
-// Thread creation and manipulation.
-//
+void isnan() { }
-#endif // _CPP_THREADS_NO
+void isnormal() { }
+void signbit() { }
+void isgreater() { }
+void isgreaterequal() { }
+void isless() { }
+void islessequal() { }
+void islessgreater() { }
+void isunordered() { }
diff --git a/libstdc++-v3/testsuite/26_numerics/c_math.cc b/libstdc++-v3/testsuite/26_numerics/c_math.cc
index 119c0d37f0a..f01e4868b44 100644
--- a/libstdc++-v3/testsuite/26_numerics/c_math.cc
+++ b/libstdc++-v3/testsuite/26_numerics/c_math.cc
@@ -20,7 +20,7 @@
// USA.
#include <cmath>
-#include <debug_assert.h>
+#include <testsuite_hooks.h>
// test compilation.
int
@@ -69,4 +69,3 @@ main()
test04();
return 0;
}
-
diff --git a/libstdc++-v3/testsuite/26_numerics/complex_inserters_extractors.cc b/libstdc++-v3/testsuite/26_numerics/complex_inserters_extractors.cc
index e195651160f..8161ee1aeb5 100644
--- a/libstdc++-v3/testsuite/26_numerics/complex_inserters_extractors.cc
+++ b/libstdc++-v3/testsuite/26_numerics/complex_inserters_extractors.cc
@@ -24,7 +24,7 @@
#include <string>
#include <sstream>
#include <complex>
-#include <debug_assert.h>
+#include <testsuite_hooks.h>
#include <cmath>
template<typename R>
@@ -88,12 +88,58 @@ testall()
return 0;
}
+// libstdc++/2970
+void test01()
+{
+ using namespace std;
+ bool test = true;
+
+ complex<float> cf01(-1.1, -333.2);
+ stringstream ss;
+ ss << cf01;
+ string str = ss.str();
+ VERIFY( str == "(-1.1,-333.2)" );
+}
+
+// libstdc++/2985
+struct gnu_char_traits : public std::char_traits<char>
+{ };
+
+typedef std::basic_ostringstream<char, gnu_char_traits> gnu_sstream;
+
+void test02()
+{
+ bool test = true;
+
+ // Construct locale with specialized facets.
+ typedef gnu_sstream::__numput_type numput_type;
+ typedef gnu_sstream::__numget_type numget_type;
+ std::locale loc_c = std::locale::classic();
+ std::locale loc_1(loc_c, new numput_type);
+ std::locale loc_2(loc_1, new numget_type);
+ VERIFY( std::has_facet<numput_type>(loc_2) );
+ VERIFY( std::has_facet<numget_type>(loc_2) );
+
+ gnu_sstream sstr;
+ std::basic_ios<char, gnu_char_traits>* pios = &sstr;
+ sstr.imbue(loc_2);
+
+
+ std::complex<double> x(3, 4);
+ sstr << x;
+ VERIFY( sstr.str() == "(3,4)" );
+}
+
int
main()
{
testall<float>();
testall<double>();
testall<long double>();
+
+ test01();
+ test02();
+
return 0;
}
diff --git a/libstdc++-v3/testsuite/26_numerics/complex_value.cc b/libstdc++-v3/testsuite/26_numerics/complex_value.cc
index c6105c36f6d..99f477a5fa1 100644
--- a/libstdc++-v3/testsuite/26_numerics/complex_value.cc
+++ b/libstdc++-v3/testsuite/26_numerics/complex_value.cc
@@ -20,7 +20,7 @@
// USA.
#include <complex>
-#include <debug_assert.h>
+#include <testsuite_hooks.h>
void test01()
{
diff --git a/libstdc++-v3/testsuite/26_numerics/fabs_inline.cc b/libstdc++-v3/testsuite/26_numerics/fabs_inline.cc
new file mode 100644
index 00000000000..bb84a5809f3
--- /dev/null
+++ b/libstdc++-v3/testsuite/26_numerics/fabs_inline.cc
@@ -0,0 +1,37 @@
+// Copyright (C) 1999 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.
+
+// Test to see whether the host provides its own (inline) view of fabs.
+// Origin: Kurt Garloff <kurt@garloff.de>, 2001-05-24
+// dg-do link
+
+#include <cmath>
+#include <cstdio>
+
+typedef double (*realfn) (double);
+
+using std::fabs;
+
+int main ()
+{
+ double a = fabs (-2.4);
+ realfn myfn = fabs;
+ double b = myfn (-2.5);
+ printf ("%f, %f, %p\n", a, b, myfn);
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/26_numerics/valarray.cc b/libstdc++-v3/testsuite/26_numerics/valarray.cc
index 8702198ca35..f2348f018ab 100644
--- a/libstdc++-v3/testsuite/26_numerics/valarray.cc
+++ b/libstdc++-v3/testsuite/26_numerics/valarray.cc
@@ -41,6 +41,3 @@ int main()
return 0;
}
-
-
-
diff --git a/libstdc++-v3/testsuite/26_numerics/valarray_const_bracket.cc b/libstdc++-v3/testsuite/26_numerics/valarray_const_bracket.cc
new file mode 100644
index 00000000000..53819f43ad1
--- /dev/null
+++ b/libstdc++-v3/testsuite/26_numerics/valarray_const_bracket.cc
@@ -0,0 +1,48 @@
+// 20010518 gdr
+
+// Copyright (C) 2001 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.
+
+#include <valarray>
+
+// dg-do compile
+
+template<typename P>
+ void copy(P, std::size_t) { }
+
+template<typename T>
+ void test(const std::valarray<T>& v)
+ {
+ copy(&v[0], v.size());
+ }
+
+int main()
+{
+ std::valarray<double> v(190);
+ test(v);
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/filebuf.cc b/libstdc++-v3/testsuite/27_io/filebuf.cc
index 4cfd9277b57..87410d01e6d 100644
--- a/libstdc++-v3/testsuite/27_io/filebuf.cc
+++ b/libstdc++-v3/testsuite/27_io/filebuf.cc
@@ -1,6 +1,6 @@
// 990117 bkoz test functionality of basic_filebuf for char_type == char
-// Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc.
+// Copyright (C) 1997-1999, 2000, 2001 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
@@ -26,7 +26,7 @@
// @diff@ %-*.tst %*.txt
#include <fstream>
-#include <debug_assert.h>
+#include <testsuite_hooks.h>
const char carray_01[] = "santa cruz or sandiego?";
const char carray_02[] = "memphis, new orleans, and savanah";
@@ -524,6 +524,53 @@ bool test04()
return test;
}
+// test05
+// libstdc++/1886
+// should be able to instantiate basic_filebuf for non-standard types.
+template class std::basic_filebuf<short, std::char_traits<short> >;
+
+// test06
+// libstdc++/2020
+// should be able to use custom char_type
+class gnu_char_type
+{
+ unsigned long character;
+public:
+ // operator ==
+ bool
+ operator==(const gnu_char_type& __lhs)
+ { return character == __lhs.character; }
+
+ // operator <
+ bool
+ operator<(const gnu_char_type& __lhs)
+ { return character < __lhs.character; }
+
+ // default ctor
+ gnu_char_type() { }
+
+ // to_char_type
+ gnu_char_type(const unsigned long& __l) : character(__l) { }
+
+ // to_int_type
+ operator unsigned long() const { return character; }
+};
+
+bool test06()
+{
+ bool test = true;
+ typedef std::basic_filebuf<gnu_char_type> gnu_filebuf;
+
+ try
+ { gnu_filebuf obj; }
+ catch(std::exception& obj)
+ {
+ test = false;
+ VERIFY( test );
+ }
+ return test;
+}
+
int main()
{
test00();
@@ -532,19 +579,10 @@ int main()
test03();
test04();
+ test06();
return 0;
}
// more surf!!!
-
-
-
-
-
-
-
-
-
-
diff --git a/libstdc++-v3/testsuite/27_io/filebuf_members.cc b/libstdc++-v3/testsuite/27_io/filebuf_members.cc
index 3b028a5221a..4d61ec10a23 100644
--- a/libstdc++-v3/testsuite/27_io/filebuf_members.cc
+++ b/libstdc++-v3/testsuite/27_io/filebuf_members.cc
@@ -27,7 +27,7 @@
#include <cassert>
#include <unistd.h>
#include <fcntl.h>
-#include <debug_assert.h>
+#include <testsuite_hooks.h>
// verify that std::filebuf doesn't close files that it didn't open
// when using the following std::filebuf ctor:
@@ -49,28 +49,24 @@ test_01()
int close_num;
// read (ext)
- int fd = open(name_01, O_RDONLY);
- VERIFY( fd >= 0 );
-
+ FILE* f2 = fopen(name_01, "r");
+ VERIFY( f2 != NULL );
{
- std::filebuf fb(fd, "double_read", std::ios_base::in);
+ std::filebuf fb(f2, std::ios_base::in, 512);
}
-
- close_num = close(fd);
+ close_num = fclose(f2);
VERIFY( close_num == 0 );
// read (standard)
FILE* f = fopen(name_01, "r");
VERIFY( f != NULL );
-
{
std::ifstream ifstream1(name_01);
VERIFY( ifstream1.is_open() );
std::ios_base::iostate st01 = ifstream1.rdstate();
VERIFY( st01 == std::ios_base::goodbit );
}
-
close_num = fclose(f);
VERIFY( close_num == 0 );
@@ -89,7 +85,3 @@ main()
test_01();
return 0;
}
-
-
-
-
diff --git a/libstdc++-v3/testsuite/27_io/filebuf_virtuals.cc b/libstdc++-v3/testsuite/27_io/filebuf_virtuals.cc
new file mode 100644
index 00000000000..2b72f56e51e
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/filebuf_virtuals.cc
@@ -0,0 +1,62 @@
+// 2001-05-21 Benjamin Kosnik <bkoz@redhat.com>
+
+// Copyright (C) 2001 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>
+
+void test01()
+{
+ using namespace std;
+
+ bool test = true;
+ char buf[512];
+ const char* strlit = "how to tell a story and other essays: mark twain";
+ const size_t strlitsize = strlen(strlit);
+ filebuf fbuf01;
+
+ fbuf01.pubsetbuf(buf, 512);
+ fbuf01.sputn(strlit, strlitsize);
+ VERIFY( strncmp(strlit, buf, strlitsize) != 0 );
+}
+
+void test02()
+{
+ using namespace std;
+
+ bool test = true;
+ char buf[512];
+ const char* strlit = "how to tell a story and other essays: mark twain";
+ const size_t strlitsize = strlen(strlit);
+ filebuf fbuf01;
+ fbuf01.open("tmp", ios_base::out);
+
+ fbuf01.pubsetbuf(buf, strlitsize);
+ fbuf01.sputn(strlit, strlitsize);
+ VERIFY( strncmp(strlit, buf, strlitsize) == 0 );
+}
+
+main()
+{
+ test01();
+ test02();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/fpos.cc b/libstdc++-v3/testsuite/27_io/fpos.cc
index ef290bc5d8a..2f52fd3c65e 100644
--- a/libstdc++-v3/testsuite/27_io/fpos.cc
+++ b/libstdc++-v3/testsuite/27_io/fpos.cc
@@ -1,6 +1,6 @@
// 1999-09-20 bkoz
-// Copyright (C) 1999 Free Software Foundation, Inc.
+// Copyright (C) 1999, 2001 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
@@ -31,7 +31,7 @@
#include <cwchar> // for mbstate_t
#include <ios>
-#include <debug_assert.h>
+#include <testsuite_hooks.h>
void test01()
{
@@ -107,12 +107,18 @@ void test02()
pos03 = pos03 + off02;
pos04 += off02;
VERIFY( pos03 == pos04 );
+ std::streampos pos05 = pos03;
+ std::streampos pos06 = pos03 + off02;
+ VERIFY ( pos05 == pos03 );
// q = p - o
// p -= o
pos03 = pos03 - off02;
pos04 -= off02;
VERIFY( pos03 == pos04 );
+ std::streampos pos07 = pos03;
+ std::streampos pos08 = pos03 - off02;
+ VERIFY ( pos07 == pos03 );
// o = p - q
VERIFY( 0 == pos03 - pos04 );
@@ -171,7 +177,3 @@ int main() {
test03();
return 0;
}
-
-
-
-
diff --git a/libstdc++-v3/testsuite/27_io/fstream_members.cc b/libstdc++-v3/testsuite/27_io/fstream_members.cc
new file mode 100644
index 00000000000..136252b8efb
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/fstream_members.cc
@@ -0,0 +1,70 @@
+// 2001-05-24 Benjamin Kosnik <bkoz@redhat.com>
+
+// Copyright (C) 2001 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.13 member functions (fstream_members)
+
+#include <fstream>
+#include <testsuite_hooks.h>
+
+void
+redirect_buffer(std::ios& stream, std::streambuf* new_buf)
+{ stream.rdbuf(new_buf); }
+
+std::streambuf*
+active_buffer(std::ios& stream)
+{ return stream.rdbuf(); }
+
+// libstdc++/2832
+void test02()
+{
+ bool test = true;
+ const char* strlit01 = "fuck war";
+ const char* strlit02 = "two less cars abstract riot crew, critical mass/SF";
+ const std::string str00;
+ const std::string str01(strlit01);
+ std::string str02;
+ std::filebuf fbuf;
+ std::streambuf* pbasebuf0 = &fbuf;
+
+ std::fstream sstrm1;
+ // derived rdbuf() always returns original streambuf, even though
+ // it's no longer associated with the stream.
+ std::filebuf* const buf1 = sstrm1.rdbuf();
+ // base rdbuf() returns the currently associated streambuf
+ std::streambuf* pbasebuf1 = active_buffer(sstrm1);
+ redirect_buffer(sstrm1, &fbuf);
+ std::filebuf* const buf2 = sstrm1.rdbuf();
+ std::streambuf* pbasebuf2 = active_buffer(sstrm1);
+ VERIFY( buf1 == buf2 );
+ VERIFY( pbasebuf1 != pbasebuf2 );
+ VERIFY( pbasebuf2 == pbasebuf0 );
+
+ // How confusing and non-intuitive is this?
+ // These semantics are a joke, a serious defect, and incredibly lame.
+}
+
+int main()
+{
+ test02();
+ return 0;
+}
+
+
+
diff --git a/libstdc++-v3/testsuite/27_io/ifstream_members.cc b/libstdc++-v3/testsuite/27_io/ifstream_members.cc
index 3fb7a6d1156..ad21fe5c8d1 100644
--- a/libstdc++-v3/testsuite/27_io/ifstream_members.cc
+++ b/libstdc++-v3/testsuite/27_io/ifstream_members.cc
@@ -1,4 +1,4 @@
-// Copyright (C) 2000 Free Software Foundation, Inc.
+// Copyright (C) 2000, 2001 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
@@ -22,7 +22,7 @@
#include <istream>
#include <fstream>
-#include <debug_assert.h>
+#include <testsuite_hooks.h>
const char name_01[] = "ifstream_members-1.tst";
const char name_02[] = "ifstream_members-1.txt";
@@ -73,9 +73,51 @@ bool test01()
return test;
}
+void
+redirect_buffer(std::ios& stream, std::streambuf* new_buf)
+{ stream.rdbuf(new_buf); }
+
+std::streambuf*
+active_buffer(std::ios& stream)
+{ return stream.rdbuf(); }
+
+// libstdc++/2832
+void test02()
+{
+ bool test = true;
+ const char* strlit01 = "fuck war";
+ const char* strlit02 = "two less cars abstract riot crew, critical mass/SF";
+ const std::string str00;
+ const std::string str01(strlit01);
+ std::string str02;
+ std::filebuf fbuf;
+ std::streambuf* pbasebuf0 = &fbuf;
+
+ std::ifstream sstrm1;
+ // derived rdbuf() always returns original streambuf, even though
+ // it's no longer associated with the stream.
+ std::filebuf* const buf1 = sstrm1.rdbuf();
+ // base rdbuf() returns the currently associated streambuf
+ std::streambuf* pbasebuf1 = active_buffer(sstrm1);
+ redirect_buffer(sstrm1, &fbuf);
+ std::filebuf* const buf2 = sstrm1.rdbuf();
+ std::streambuf* pbasebuf2 = active_buffer(sstrm1);
+ VERIFY( buf1 == buf2 );
+ VERIFY( pbasebuf1 != pbasebuf2 );
+ VERIFY( pbasebuf2 == pbasebuf0 );
+
+ // How confusing and non-intuitive is this?
+ // These semantics are a joke, a serious defect, and incredibly lame.
+}
int main()
{
test00();
test01();
+
+ test02();
+ return 0;
}
+
+
+
diff --git a/libstdc++-v3/testsuite/27_io/ios_base_callbacks.cc b/libstdc++-v3/testsuite/27_io/ios_base_callbacks.cc
index 298574982db..eeed5f4caf4 100644
--- a/libstdc++-v3/testsuite/27_io/ios_base_callbacks.cc
+++ b/libstdc++-v3/testsuite/27_io/ios_base_callbacks.cc
@@ -22,7 +22,7 @@
#include <string>
#include <sstream>
-#include <debug_assert.h>
+#include <testsuite_hooks.h>
const std::string str01("the nubians of plutonia");
std::string str02;
@@ -66,7 +66,3 @@ int main(void)
return 0;
}
-
-
-
-
diff --git a/libstdc++-v3/testsuite/27_io/ios_base_members_static.cc b/libstdc++-v3/testsuite/27_io/ios_base_members_static.cc
index 8a0db0b395f..1e7df6a295f 100644
--- a/libstdc++-v3/testsuite/27_io/ios_base_members_static.cc
+++ b/libstdc++-v3/testsuite/27_io/ios_base_members_static.cc
@@ -28,7 +28,7 @@
#include <sstream>
#include <iostream>
-#include <debug_assert.h>
+#include <testsuite_hooks.h>
// N.B. Once we have called sync_with_stdio(false), we can never go back.
@@ -36,23 +36,19 @@ void
test01()
{
std::ios_base::sync_with_stdio();
-
std::freopen("ios_base_members_static-1.txt", "w", stdout);
for (int i = 0; i < 2; i++)
{
std::printf("1");
std::cout << "2";
- std::putc('3', stdout); // std::stdout doesn't work here
+ std::putc('3', stdout);
std::cout << '4';
std::fputs("5", stdout);
std::cout << 6;
std::putchar('7');
std::cout << 8 << '9';
- if (i)
- std::printf ("0\n");
- else
- std::cout << "0" << std::endl;
+ std::printf("0\n");
}
}
@@ -87,5 +83,3 @@ int main(void)
test02();
return 0;
}
-
-
diff --git a/libstdc++-v3/testsuite/27_io/ios_base_storage.cc b/libstdc++-v3/testsuite/27_io/ios_base_storage.cc
index c116383dc8e..d6b6d983b5f 100644
--- a/libstdc++-v3/testsuite/27_io/ios_base_storage.cc
+++ b/libstdc++-v3/testsuite/27_io/ios_base_storage.cc
@@ -23,7 +23,7 @@
#include <sstream>
#include <iostream>
-#include <debug_assert.h>
+#include <testsuite_hooks.h>
// http://gcc.gnu.org/ml/gcc-bugs/2000-12/msg00413.html
void test01()
@@ -48,7 +48,3 @@ int main(void)
return 0;
}
-
-
-
-
diff --git a/libstdc++-v3/testsuite/27_io/ios_ctor.cc b/libstdc++-v3/testsuite/27_io/ios_ctor.cc
index acebb87fe93..5736aebaa35 100644
--- a/libstdc++-v3/testsuite/27_io/ios_ctor.cc
+++ b/libstdc++-v3/testsuite/27_io/ios_ctor.cc
@@ -31,7 +31,7 @@
#include <ios>
#include <sstream>
-#include <debug_assert.h>
+#include <testsuite_hooks.h>
void test01()
{
@@ -89,4 +89,3 @@ int main() {
test01();
return 0;
}
-
diff --git a/libstdc++-v3/testsuite/27_io/ios_init.cc b/libstdc++-v3/testsuite/27_io/ios_init.cc
new file mode 100644
index 00000000000..ef7cdf49586
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/ios_init.cc
@@ -0,0 +1,88 @@
+// 2001-06-05 Benjamin Kosnik <bkoz@redhat.com>
+
+// Copyright (C) 2001 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.
+
+// 27.4.2.1.6 class ios_base::init
+
+#include <fstream>
+#include <iostream>
+#include <testsuite_hooks.h>
+
+class gnu_filebuf: public std::filebuf
+{
+ int i;
+public:
+ gnu_filebuf(int j = 1): i(j) { }
+ ~gnu_filebuf() { --i; }
+ int get_i() { return i;}
+};
+
+const int initial = 4;
+gnu_filebuf buf(initial);
+
+// libstdc++/3045, in a vague way.
+void test01()
+{
+ bool test = true;
+ int k1;
+
+ // 1 normal
+ k1 = buf.get_i();
+ VERIFY( k1 == initial );
+ {
+ std::cout.rdbuf(&buf);
+ }
+ k1 = buf.get_i();
+ VERIFY( k1 == initial );
+
+ // 2 syncd off
+ k1 = buf.get_i();
+ VERIFY( k1 == initial );
+ {
+ std::cout.rdbuf(&buf);
+ std::ios_base::sync_with_stdio(false); // make sure doesn't clobber buf
+ }
+ k1 = buf.get_i();
+ VERIFY( k1 == initial );
+
+ // 3 callling init
+ k1 = buf.get_i();
+ VERIFY( k1 == initial );
+ {
+ std::cout.rdbuf(&buf);
+ std::ios_base::Init make_sure_initialized;
+ }
+ k1 = buf.get_i();
+ VERIFY( k1 == initial );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/ios_manip_basefield.cc b/libstdc++-v3/testsuite/27_io/ios_manip_basefield.cc
index 717bebb322c..2a3df628873 100644
--- a/libstdc++-v3/testsuite/27_io/ios_manip_basefield.cc
+++ b/libstdc++-v3/testsuite/27_io/ios_manip_basefield.cc
@@ -31,7 +31,7 @@
#include <sstream>
#include <locale>
#include <iomanip>
-#include <debug_assert.h>
+#include <testsuite_hooks.h>
struct MyNP : std::numpunct<char>
{
diff --git a/libstdc++-v3/testsuite/27_io/ios_manip_fmtflags.cc b/libstdc++-v3/testsuite/27_io/ios_manip_fmtflags.cc
index 4dcf748f019..5fe1194c481 100644
--- a/libstdc++-v3/testsuite/27_io/ios_manip_fmtflags.cc
+++ b/libstdc++-v3/testsuite/27_io/ios_manip_fmtflags.cc
@@ -31,7 +31,7 @@
#include <sstream>
#include <locale>
#include <iomanip>
-#include <debug_assert.h>
+#include <testsuite_hooks.h>
struct MyNP : std::numpunct<char>
{
diff --git a/libstdc++-v3/testsuite/27_io/ios_members.cc b/libstdc++-v3/testsuite/27_io/ios_members.cc
index b096d42cf4e..df00c6a4ce5 100644
--- a/libstdc++-v3/testsuite/27_io/ios_members.cc
+++ b/libstdc++-v3/testsuite/27_io/ios_members.cc
@@ -31,7 +31,7 @@
#include <ios>
// NB: Don't include any other headers in this file.
-#include <debug_assert.h>
+#include <testsuite_hooks.h>
void test01()
{
@@ -146,5 +146,3 @@ int main() {
test02();
return 0;
}
-
-
diff --git a/libstdc++-v3/testsuite/27_io/istream.cc b/libstdc++-v3/testsuite/27_io/istream.cc
index 0eaa3e0bb8d..c43aebdeb23 100644
--- a/libstdc++-v3/testsuite/27_io/istream.cc
+++ b/libstdc++-v3/testsuite/27_io/istream.cc
@@ -55,5 +55,3 @@ namespace test {
int main() {
return 0;
}
-
-
diff --git a/libstdc++-v3/testsuite/27_io/istream_extractor_arith.cc b/libstdc++-v3/testsuite/27_io/istream_extractor_arith.cc
index 635e1711ce5..6873dbeee8c 100644
--- a/libstdc++-v3/testsuite/27_io/istream_extractor_arith.cc
+++ b/libstdc++-v3/testsuite/27_io/istream_extractor_arith.cc
@@ -25,7 +25,7 @@
#include <ostream>
#include <sstream>
#include <locale>
-#include <debug_assert.h>
+#include <testsuite_hooks.h>
std::string str_01;
std::string str_02("true false 0 1 110001");
@@ -513,6 +513,84 @@ bool test11()
return test;
}
+// libstdc++/3720
+// excess input should not cause a core dump
+template<typename T>
+bool test12_aux(bool integer_type)
+{
+ bool test = true;
+
+ int digits_overflow;
+ if (integer_type)
+ // This many digits will overflow integer types in base 10.
+ digits_overflow = std::numeric_limits<T>::digits10 + 1;
+ else
+ // This might do it, unsure.
+ digits_overflow = std::numeric_limits<T>::max_exponent10 + 1;
+
+ std::string st;
+ std::string part = "1234567890123456789012345678901234567890";
+ for (int i = 0; i < digits_overflow / part.size() + 1; ++i)
+ st += part;
+ std::stringbuf sb(st);
+ std::istream is(&sb);
+ T t;
+ is >> t;
+ VERIFY(is.fail());
+ return test;
+}
+
+bool test12()
+{
+ bool test = true;
+ VERIFY(test12_aux<short>(true));
+ VERIFY(test12_aux<int>(true));
+ VERIFY(test12_aux<long>(true));
+ VERIFY(test12_aux<float>(false));
+ VERIFY(test12_aux<double>(false));
+ VERIFY(test12_aux<long double>(false));
+ return test;
+}
+
+// libstdc++/3720 part two
+void test13()
+{
+ using namespace std;
+ bool test = true;
+ const char* l1 = "12345678901234567890123456789012345678901234567890123456";
+ const char* l2 = "1.2345678901234567890123456789012345678901234567890123456"
+ " "
+ "1246.9";
+
+ // 1
+ // used to core.
+ double d;
+ istringstream iss1(l2);
+ iss1 >> d;
+ // XXX doesn't work on 3.0 branch
+ // iss1 >> d;
+ // VERIFY (d > 1246 && d < 1247);
+
+ // 2
+ // quick test for failbit on maximum length extraction.
+ int i;
+ int max_digits = numeric_limits<int>::digits10;
+ string digits;
+ for (int j = 0; j < max_digits; ++j)
+ digits += '1';
+ istringstream iss2(digits);
+ iss2 >> i;
+ VERIFY( !iss2.fail() );
+
+ digits += '1';
+ i = 0;
+ iss2.str(digits);
+ iss2.clear();
+ iss2 >> i;
+ VERIFY( i == 0 );
+ VERIFY( iss2.fail() );
+}
+
int main()
{
test01();
@@ -526,24 +604,9 @@ int main()
test10();
test11();
+ test12();
+ test13();
return 0;
}
-
-
-
-
// paul miller was right on with riddim warfare!
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/libstdc++-v3/testsuite/27_io/istream_extractor_char.cc b/libstdc++-v3/testsuite/27_io/istream_extractor_char.cc
index f70d4fb9492..87ab77d88a0 100644
--- a/libstdc++-v3/testsuite/27_io/istream_extractor_char.cc
+++ b/libstdc++-v3/testsuite/27_io/istream_extractor_char.cc
@@ -22,7 +22,7 @@
#include <istream>
#include <sstream>
-#include <debug_assert.h>
+#include <testsuite_hooks.h>
bool test01() {
@@ -227,4 +227,3 @@ int main()
return 0;
}
-
diff --git a/libstdc++-v3/testsuite/27_io/istream_extractor_other.cc b/libstdc++-v3/testsuite/27_io/istream_extractor_other.cc
index 2bd878fabce..fbf8f4293c6 100644
--- a/libstdc++-v3/testsuite/27_io/istream_extractor_other.cc
+++ b/libstdc++-v3/testsuite/27_io/istream_extractor_other.cc
@@ -1,6 +1,6 @@
// 1999-07-28 bkoz
-// Copyright (C) 1999 Free Software Foundation
+// Copyright (C) 1999, 2001 Free Software Foundation
//
// 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
@@ -25,7 +25,7 @@
#include <istream>
#include <sstream>
#include <fstream>
-#include <debug_assert.h>
+#include <testsuite_hooks.h>
// stringbufs.
@@ -55,14 +55,6 @@ bool test01() {
statefail = std::ios_base::failbit;
stateeof = std::ios_base::eofbit;
- // template<_CharT, _Traits>
- // basic_istream& operator>>(basic_istream& (*pf) (basic_istream&))
-
- // template<_CharT, _Traits>
- // basic_istream& operator>>(basic_ios& (*pf) (basic_ios&))
-
- // template<_CharT, _Traits>
- // basic_istream& operator>>(ios_base& (*pf) (ios_base&))
// template<_CharT, _Traits>
// basic_istream& operator>>(basic_streambuf*)
@@ -136,9 +128,9 @@ bool test01() {
state1 = is_04.rdstate();
is_04 >> &isbuf_03;
state2 = is_04.rdstate();
- VERIFY( state1 != state2 );
+ VERIFY( state1 == state2 );
VERIFY( !static_cast<bool>(state2 & statefail) );
- VERIFY( state2 == stateeof );
+ VERIFY( state2 != stateeof );
strtmp = isbuf_03.str();
VERIFY( strtmp == str_02 ); // as only an "in" buffer
VERIFY( isbuf_03.sgetc() == 'a' );
@@ -184,14 +176,33 @@ bool test02() {
return test;
}
-int main()
+void test03()
{
- test01();
- test02();
- return 0;
-}
+ using namespace std;
+ bool test = true;
+ // template<_CharT, _Traits>
+ // basic_istream& operator>>(ios_base& (*pf) (ios_base&))
+ {
+ int i = 0;
+ std::istringstream iss(" 43");
+ iss >> std::noskipws >> i;
+ std::ios::iostate i3 = iss.rdstate();
+ VERIFY ( !iss ); //should set failbit
+ }
+ // template<_CharT, _Traits>
+ // basic_istream& operator>>(basic_ios& (*pf) (basic_ios&))
+ // template<_CharT, _Traits>
+ // basic_istream& operator>>(basic_istream& (*pf) (basic_istream&))
+}
+int main()
+{
+ test01();
+ test02();
+ test03();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/istream_manip.cc b/libstdc++-v3/testsuite/27_io/istream_manip.cc
index ba3826c79bb..75eb79f135a 100644
--- a/libstdc++-v3/testsuite/27_io/istream_manip.cc
+++ b/libstdc++-v3/testsuite/27_io/istream_manip.cc
@@ -23,7 +23,7 @@
#include <istream>
#include <sstream>
#include <stdexcept>
-#include <debug_assert.h>
+#include <testsuite_hooks.h>
bool test01(void)
{
@@ -70,7 +70,7 @@ bool test01(void)
VERIFY( !iss02.eof() );
iss01 >> std::ws;
- VERIFY( iss01.fail() );
+ VERIFY( !iss01.fail() );
VERIFY( iss01.eof() );
#ifdef DEBUG_ASSERT
@@ -83,9 +83,5 @@ bool test01(void)
int main()
{
test01();
+ return 0;
}
-
-
-
-
-
diff --git a/libstdc++-v3/testsuite/27_io/istream_seeks-1.tst b/libstdc++-v3/testsuite/27_io/istream_seeks-1.tst
new file mode 100644
index 00000000000..5d9eafa2a36
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/istream_seeks-1.tst
@@ -0,0 +1,7 @@
+bd2
+456x
+9mzuv>?@ABCDEFGHIJKLMNOPQRSTUVWXYZracadabras, i wannaz
+because because
+because. .
+of the wonderful things he does!!
+ok \ No newline at end of file
diff --git a/libstdc++-v3/testsuite/27_io/istream_seeks-1.txt b/libstdc++-v3/testsuite/27_io/istream_seeks-1.txt
new file mode 100644
index 00000000000..5d9eafa2a36
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/istream_seeks-1.txt
@@ -0,0 +1,7 @@
+bd2
+456x
+9mzuv>?@ABCDEFGHIJKLMNOPQRSTUVWXYZracadabras, i wannaz
+because because
+because. .
+of the wonderful things he does!!
+ok \ No newline at end of file
diff --git a/libjava/doc/java-awt-datatransfer.texi b/libstdc++-v3/testsuite/27_io/istream_seeks-2.tst
index e69de29bb2d..e69de29bb2d 100644
--- a/libjava/doc/java-awt-datatransfer.texi
+++ b/libstdc++-v3/testsuite/27_io/istream_seeks-2.tst
diff --git a/libstdc++-v3/testsuite/27_io/istream_seeks-3.tst b/libstdc++-v3/testsuite/27_io/istream_seeks-3.tst
new file mode 100644
index 00000000000..dc45fc9330a
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/istream_seeks-3.tst
@@ -0,0 +1,10 @@
+0-0 lootpack, peanut butter wolf, rob swift, madlib, quasimoto
+0-1 lootpack, peanut butter wolf, rob swift, madlib, quasimoto
+0-2 lootpack, peanut butter wolf, rob swift, madlib, quasimoto
+0-3 lootpack, peanut butter wolf, rob swift, madlib, quasimoto
+0-4 lootpack, peanut butter wolf, rob swift, madlib, quasimoto
+0-5 lootpack, peanut butter wolf, rob swift, madlib, quasimoto
+0-6 lootpack, peanut butter wolf, rob swift, madlib, quasimoto
+0-7 lootpack, peanut butter wolf, rob swift, madlib, quasimoto
+0-8 lootpack, peanut butter wolf, rob swift, madlib, quasimoto
+0-9 lootpack, peanut butter wolf, rob swift, madlib, quasimoto
diff --git a/libstdc++-v3/testsuite/27_io/istream_seeks.cc b/libstdc++-v3/testsuite/27_io/istream_seeks.cc
index d5fad458af0..dac5f3cf9eb 100644
--- a/libstdc++-v3/testsuite/27_io/istream_seeks.cc
+++ b/libstdc++-v3/testsuite/27_io/istream_seeks.cc
@@ -1,6 +1,6 @@
// 2000-06-29 bkoz
-// Copyright (C) 2000 Free Software Foundation
+// Copyright (C) 2000, 2001 Free Software Foundation
//
// 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
@@ -20,12 +20,13 @@
// 27.6.1.3 unformatted input functions
// NB: ostream has a particular "seeks" category. Adopt this for istreams too.
+// @require@ %-*.tst %-*.txt
+// @diff@ %-*.tst %-*.txt
#include <istream>
#include <sstream>
#include <fstream>
-#include <debug_assert.h>
-
+#include <testsuite_hooks.h>
bool test01()
{
@@ -33,7 +34,7 @@ bool test01()
typedef ios::pos_type pos_type;
bool test = true;
- const char str_lit01[] = "istream_unformatted-1.tst";
+ const char str_lit01[] = "istream_seeks-1.tst";
// in
// test default ctors leave things in the same positions...
@@ -62,14 +63,81 @@ bool test01()
return test;
}
+const char* s = " lootpack, peanut butter wolf, rob swift, madlib, quasimoto";
+const int times = 10;
+
+void write_rewind(std::iostream& stream)
+{
+ for (int j = 0; j < times; j++)
+ {
+ bool test = true;
+ std::streampos begin = stream.tellg();
+
+ for (int i = 0; i < times; ++i)
+ stream << j << '-' << i << s << '\n';
+
+ stream.seekg(begin);
+ std::streampos end = stream.tellg();
+ std::streampos badpos = std::streampos(std::streambuf::off_type(-1));
+ }
+}
+
+void check_contents(std::iostream& stream)
+{
+ bool test = true;
+
+ stream.clear();
+ stream.seekg(0, std::ios::beg);
+ int i = 0;
+ int loop = times * times + 2;
+ while (i < loop)
+ {
+ stream.ignore(80, '\n');
+ if (stream.good())
+ ++i;
+ else
+ break;
+ }
+ VERIFY( i == times );
+}
+
+// fstream
+// libstdc++/2346
+void test02()
+{
+ std::fstream ofstrm;
+ ofstrm.open("istream_seeks-3.txt", std::ios::out);
+ if (!ofstrm)
+ abort();
+ write_rewind(ofstrm);
+ ofstrm.close();
+
+ std::fstream ifstrm;
+ ifstrm.open("istream_seeks-3.txt", std::ios::in);
+ check_contents(ifstrm);
+ ifstrm.close();
+}
+
+// stringstream
+// libstdc++/2346
+void test03()
+{
+ std::stringstream sstrm;
+
+ write_rewind(sstrm);
+ check_contents(sstrm);
+}
+
// fstreams
void test04(void)
{
+ typedef std::istream::off_type off_type;
+
bool test = true;
std::istream::pos_type pos01, pos02, pos03, pos04, pos05, pos06;
std::ios_base::iostate state01, state02;
- const char str_lit01[] = "istream_unformatted-1.txt";
- const char str_lit02[] = "istream_unformatted-2.txt";
+ const char str_lit01[] = "istream_seeks-1.txt";
+ const char str_lit02[] = "istream_seeks-2.txt";
std::ifstream if01(str_lit01, std::ios_base::in | std::ios_base::out);
std::ifstream if02(str_lit01, std::ios_base::in);
std::ifstream if03(str_lit02, std::ios_base::out | std::ios_base::trunc);
@@ -112,7 +180,7 @@ void test04(void)
is01.seekg(10, std::ios_base::cur);
state02 = is01.rdstate();
pos01 = is01.tellg();
- VERIFY( pos01 == pos02 + 10 );
+ VERIFY( pos01 == pos02 + off_type(10) );
VERIFY( state01 == state02 );
pos02 = is01.tellg();
VERIFY( pos02 == pos01 );
@@ -121,7 +189,7 @@ void test04(void)
is02.seekg(10, std::ios_base::cur);
state02 = is02.rdstate();
pos03 = is02.tellg();
- VERIFY( pos03 == pos04 + 10 );
+ VERIFY( pos03 == pos04 + off_type(10) );
VERIFY( state01 == state02 );
pos04 = is02.tellg();
VERIFY( pos03 == pos04 );
@@ -130,7 +198,7 @@ void test04(void)
is03.seekg(10, std::ios_base::cur);
state02 = is03.rdstate();
pos05 = is03.tellg();
- VERIFY( pos05 == pos06 + 10 );
+ VERIFY( pos05 == pos06 + off_type(10) );
VERIFY( state01 == state02 );
pos06 = is03.tellg();
VERIFY( pos05 == pos06 );
@@ -140,7 +208,7 @@ void test04(void)
is01.seekg(20, std::ios_base::beg);
state02 = is01.rdstate();
pos01 = is01.tellg();
- VERIFY( pos01 == pos02 + 10 );
+ VERIFY( pos01 == pos02 + off_type(10) );
VERIFY( state01 == state02 );
pos02 = is01.tellg();
VERIFY( pos02 == pos01 );
@@ -149,7 +217,7 @@ void test04(void)
is02.seekg(20, std::ios_base::beg);
state02 = is02.rdstate();
pos03 = is02.tellg();
- VERIFY( pos03 == pos04 + 10 );
+ VERIFY( pos03 == pos04 + off_type(10) );
VERIFY( state01 == state02 );
pos04 = is02.tellg();
VERIFY( pos03 == pos04 );
@@ -158,7 +226,7 @@ void test04(void)
is03.seekg(20, std::ios_base::beg);
state02 = is03.rdstate();
pos05 = is03.tellg();
- VERIFY( pos05 == pos06 + 10 );
+ VERIFY( pos05 == pos06 + off_type(10) );
VERIFY( state01 == state02 );
pos06 = is03.tellg();
VERIFY( pos05 == pos06 );
@@ -171,10 +239,12 @@ void test04(void)
// stringstreams
void test05(void)
{
+ typedef std::istream::off_type off_type;
+
bool test = true;
std::istream::pos_type pos01, pos02, pos03, pos04, pos05, pos06;
std::ios_base::iostate state01, state02;
- const char str_lit01[] = "istream_unformatted-1.tst";
+ const char str_lit01[] = "istream_seeks-1.tst";
std::ifstream if01(str_lit01);
std::ifstream if02(str_lit01);
std::ifstream if03(str_lit01);
@@ -224,7 +294,7 @@ void test05(void)
is01.seekg(10, std::ios_base::cur);
state02 = is01.rdstate();
pos01 = is01.tellg();
- VERIFY( pos01 == pos02 + 10 );
+ VERIFY( pos01 == pos02 + off_type(10) );
VERIFY( state01 == state02 );
pos02 = is01.tellg();
VERIFY( pos02 == pos01 );
@@ -233,7 +303,7 @@ void test05(void)
is02.seekg(10, std::ios_base::cur);
state02 = is02.rdstate();
pos03 = is02.tellg();
- VERIFY( pos03 == pos04 + 10 );
+ VERIFY( pos03 == pos04 + off_type(10) );
VERIFY( state01 == state02 );
pos04 = is02.tellg();
VERIFY( pos03 == pos04 );
@@ -243,7 +313,7 @@ void test05(void)
state02 = is03.rdstate();
pos05 = is03.tellg();
VERIFY( pos05 == pos06 ); // as only out buffer
- VERIFY( state01 == state02 );
+ VERIFY( state01 != state02 );
pos06 = is03.tellg();
VERIFY( pos05 == pos06 );
@@ -252,7 +322,7 @@ void test05(void)
is01.seekg(20, std::ios_base::beg);
state02 = is01.rdstate();
pos01 = is01.tellg();
- VERIFY( pos01 == pos02 + 10 );
+ VERIFY( pos01 == pos02 + off_type(10) );
VERIFY( state01 == state02 );
pos02 = is01.tellg();
VERIFY( pos02 == pos01 );
@@ -261,7 +331,7 @@ void test05(void)
is02.seekg(20, std::ios_base::beg);
state02 = is02.rdstate();
pos03 = is02.tellg();
- VERIFY( pos03 == pos04 + 10 );
+ VERIFY( pos03 == pos04 + off_type(10) );
VERIFY( state01 == state02 );
pos04 = is02.tellg();
VERIFY( pos03 == pos04 );
@@ -283,15 +353,13 @@ void test05(void)
int main()
{
test01();
+
+ test02();
+ test03();
+
test04();
test05();
return 0;
}
-
-
-
-
-
-
diff --git a/libstdc++-v3/testsuite/27_io/istream_sentry.cc b/libstdc++-v3/testsuite/27_io/istream_sentry.cc
index 4b5634d7078..88dcb91df24 100644
--- a/libstdc++-v3/testsuite/27_io/istream_sentry.cc
+++ b/libstdc++-v3/testsuite/27_io/istream_sentry.cc
@@ -31,7 +31,7 @@
#include <istream>
#include <sstream>
-#include <debug_assert.h>
+#include <testsuite_hooks.h>
void test01()
{
@@ -85,16 +85,3 @@ int main()
test02();
return 0;
}
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/libstdc++-v3/testsuite/27_io/istream_unformatted-1.tst b/libstdc++-v3/testsuite/27_io/istream_unformatted-1.tst
index 5d9eafa2a36..9b770a55c3a 100644
--- a/libstdc++-v3/testsuite/27_io/istream_unformatted-1.tst
+++ b/libstdc++-v3/testsuite/27_io/istream_unformatted-1.tst
@@ -1,7 +1,1500 @@
-bd2
-456x
-9mzuv>?@ABCDEFGHIJKLMNOPQRSTUVWXYZracadabras, i wannaz
-because because
-because. .
-of the wonderful things he does!!
-ok \ No newline at end of file
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
diff --git a/libstdc++-v3/testsuite/27_io/istream_unformatted-1.txt b/libstdc++-v3/testsuite/27_io/istream_unformatted-1.txt
index 5d9eafa2a36..9b770a55c3a 100644
--- a/libstdc++-v3/testsuite/27_io/istream_unformatted-1.txt
+++ b/libstdc++-v3/testsuite/27_io/istream_unformatted-1.txt
@@ -1,7 +1,1500 @@
-bd2
-456x
-9mzuv>?@ABCDEFGHIJKLMNOPQRSTUVWXYZracadabras, i wannaz
-because because
-because. .
-of the wonderful things he does!!
-ok \ No newline at end of file
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
+1234567890
diff --git a/libstdc++-v3/testsuite/27_io/istream_unformatted-2.tst b/libstdc++-v3/testsuite/27_io/istream_unformatted-2.tst
deleted file mode 100644
index e69de29bb2d..00000000000
--- a/libstdc++-v3/testsuite/27_io/istream_unformatted-2.tst
+++ /dev/null
diff --git a/libstdc++-v3/testsuite/27_io/istream_unformatted-3.tst b/libstdc++-v3/testsuite/27_io/istream_unformatted-3.tst
deleted file mode 100644
index 9b770a55c3a..00000000000
--- a/libstdc++-v3/testsuite/27_io/istream_unformatted-3.tst
+++ /dev/null
@@ -1,1500 +0,0 @@
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
diff --git a/libstdc++-v3/testsuite/27_io/istream_unformatted-3.txt b/libstdc++-v3/testsuite/27_io/istream_unformatted-3.txt
deleted file mode 100644
index 9b770a55c3a..00000000000
--- a/libstdc++-v3/testsuite/27_io/istream_unformatted-3.txt
+++ /dev/null
@@ -1,1500 +0,0 @@
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
-1234567890
diff --git a/libstdc++-v3/testsuite/27_io/istream_unformatted.cc b/libstdc++-v3/testsuite/27_io/istream_unformatted.cc
index 77560a59095..19c2c9242e6 100644
--- a/libstdc++-v3/testsuite/27_io/istream_unformatted.cc
+++ b/libstdc++-v3/testsuite/27_io/istream_unformatted.cc
@@ -26,7 +26,7 @@
#include <istream>
#include <sstream>
#include <fstream>
-#include <debug_assert.h>
+#include <testsuite_hooks.h>
int
test01()
@@ -142,10 +142,13 @@ test02()
typedef std::char_traits<char> traits_type;
bool test = true;
- const char str_lit01[] = " sun*ra
- and his myth science arkestra present
- angles and demons @ play
- the nubians of plutonia";
+ const char str_lit01[] = "\t\t\t sun*ra \n"
+ " "
+ "and his myth science arkestra present\n"
+ " "
+ "angles and demons @ play\n"
+ " "
+ "the nubians of plutonia";
std::string str01(str_lit01);
std::string strtmp;
@@ -200,7 +203,9 @@ test02()
VERIFY( is_04.gcount() == 64 );
VERIFY( state1 != state2 );
VERIFY( state2 == statefail );
- VERIFY( !traits_type::compare(" and his myth science arkestra presen", carray1, 65) );
+ VERIFY( !traits_type::compare(
+ " and his myth science arkestra presen",
+ carray1, 65) );
is_04.clear();
state1 = is_04.rdstate();
@@ -232,9 +237,11 @@ test03()
typedef std::char_traits<char> traits_type;
bool test = true;
- const char str_lit01[] = " sun*ra
- & his arkestra, featuring john gilmore:
- jazz in silhouette: images and forecasts of tomorrow";
+ const char str_lit01[] =
+ " sun*ra \n\t\t\t & his arkestra, featuring john gilmore: \n"
+ " "
+ "jazz in silhouette: images and forecasts of tomorrow";
+
std::string str01(str_lit01);
std::string strtmp;
@@ -357,22 +364,21 @@ test04()
int
test05()
{
- const char* charray = "
-a
-aa
-aaa
-aaaa
-aaaaa
-aaaaaa
-aaaaaaa
-aaaaaaaa
-aaaaaaaaa
-aaaaaaaaaa
-aaaaaaaaaaa
-aaaaaaaaaaaa
-aaaaaaaaaaaaa
-aaaaaaaaaaaaaa
-";
+ const char* charray = "\n"
+"a\n"
+"aa\n"
+"aaa\n"
+"aaaa\n"
+"aaaaa\n"
+"aaaaaa\n"
+"aaaaaaa\n"
+"aaaaaaaa\n"
+"aaaaaaaaa\n"
+"aaaaaaaaaa\n"
+"aaaaaaaaaaa\n"
+"aaaaaaaaaaaa\n"
+"aaaaaaaaaaaaa\n"
+"aaaaaaaaaaaaaa\n";
bool test = true;
const std::streamsize it = 5;
@@ -461,7 +467,7 @@ int
test07()
{
bool test = true;
- const char* tfn = "istream_unformatted-3.txt";
+ const char* tfn = "istream_unformatted-1.txt";
std::ifstream infile;
infile.open(tfn);
VERIFY( !(!infile) );
@@ -491,12 +497,3 @@ main()
return 0;
}
-
-
-
-
-
-
-
-
-
diff --git a/libstdc++-v3/testsuite/27_io/istringstream_members.cc b/libstdc++-v3/testsuite/27_io/istringstream_members.cc
index e11b6ab5fff..cfc473621a2 100644
--- a/libstdc++-v3/testsuite/27_io/istringstream_members.cc
+++ b/libstdc++-v3/testsuite/27_io/istringstream_members.cc
@@ -1,6 +1,6 @@
// 2000-01-10 bkoz
-// Copyright (C) 2000 Free Software Foundation, Inc.
+// Copyright (C) 2000, 2001 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
@@ -18,19 +18,16 @@
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
-// 27.7.2 template class basic_istringstream
// 27.7.2.2 member functions (istringstream_members)
-// stringbuf* rdbuf() const
-
#include <sstream>
-#include <debug_assert.h>
-
+#include <testsuite_hooks.h>
void test01()
{
bool test = true;
std::istringstream is01;
+ const std::string str00;
const std::string str01 = "123";
std::string str02;
const int i01 = 123;
@@ -39,9 +36,15 @@ void test01()
std::ios_base::iostate state1, state2, statefail, stateeof;
statefail = std::ios_base::failbit;
stateeof = std::ios_base::eofbit;
-
+
+ // string str() const
+ str02 = is01.str();
+ VERIFY( str00 == str02 );
+
// void str(const basic_string&)
is01.str(str01);
+ str02 = is01.str();
+ VERIFY( str01 == str02 );
state1 = is01.rdstate();
is01 >> a;
state2 = is01.rdstate();
@@ -66,19 +69,63 @@ void test01()
VERIFY( state1 != state2 );
VERIFY( state2 == stateeof );
- // string str() const
- str02 = is01.str();
- VERIFY( str01 == str02 );
-
#ifdef DEBUG_ASSERT
assert(test);
#endif
}
+void
+redirect_buffer(std::ios& stream, std::streambuf* new_buf)
+{ stream.rdbuf(new_buf); }
+
+std::streambuf*
+active_buffer(std::ios& stream)
+{ return stream.rdbuf(); }
+
+// libstdc++/2832
+void test02()
+{
+ bool test = true;
+ const char* strlit01 = "fuck war";
+ const char* strlit02 = "two less cars abstract riot crew, critical mass/SF";
+ const std::string str00;
+ const std::string str01(strlit01);
+ std::string str02;
+ std::stringbuf sbuf(str01);
+ std::streambuf* pbasebuf0 = &sbuf;
+
+ std::istringstream sstrm1;
+ VERIFY( sstrm1.str() == str00 );
+ // derived rdbuf() always returns original streambuf, even though
+ // it's no longer associated with the stream.
+ std::stringbuf* const buf1 = sstrm1.rdbuf();
+ // base rdbuf() returns the currently associated streambuf
+ std::streambuf* pbasebuf1 = active_buffer(sstrm1);
+ redirect_buffer(sstrm1, &sbuf);
+ std::stringbuf* const buf2 = sstrm1.rdbuf();
+ std::streambuf* pbasebuf2 = active_buffer(sstrm1);
+ VERIFY( buf1 == buf2 );
+ VERIFY( pbasebuf1 != pbasebuf2 );
+ VERIFY( pbasebuf2 == pbasebuf0 );
+
+ // derived rdbuf() returns the original buf, so str() doesn't change.
+ VERIFY( sstrm1.str() != str01 );
+ VERIFY( sstrm1.str() == str00 );
+ // however, casting the active streambuf to a stringbuf shows what's up:
+ std::stringbuf* psbuf = dynamic_cast<std::stringbuf*>(pbasebuf2);
+ str02 = psbuf->str();
+ VERIFY( str02 == str01 );
+
+ // How confusing and non-intuitive is this?
+ // These semantics are a joke, a serious defect, and incredibly lame.
+}
+
int main()
{
test01();
+ test02();
return 0;
}
+
diff --git a/libstdc++-v3/testsuite/27_io/narrow_stream_objects.cc b/libstdc++-v3/testsuite/27_io/narrow_stream_objects.cc
index 3fbe3dda243..c420449ae04 100644
--- a/libstdc++-v3/testsuite/27_io/narrow_stream_objects.cc
+++ b/libstdc++-v3/testsuite/27_io/narrow_stream_objects.cc
@@ -1,6 +1,6 @@
// 2000-08-02 bkoz
-// Copyright (C) 2000 Free Software Foundation, Inc.
+// Copyright (C) 2000, 2001 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
@@ -66,7 +66,7 @@
#include <cstdlib>
#include <cstring>
#include <ctime>
-#include <debug_assert.h>
+#include <testsuite_hooks.h>
// Include iostream last, just to make is as difficult as possible to
// properly initialize the standard iostream objects.
@@ -93,11 +93,32 @@ test01()
return 0;
}
+// libstdc++/2523
+void test02()
+{
+ using namespace std;
+ int i;
+ cin >> i;
+ cout << "i == " << i << endl;
+}
+
+// libstdc++/2523
+void test03()
+{
+ using namespace std;
+ ios_base::sync_with_stdio(false);
+
+ int i;
+ cin >> i;
+ cout << "i == " << i << endl;
+}
int
main()
{
test01();
+
+ // test02();
+ // test03();
return 0;
}
-
diff --git a/libstdc++-v3/testsuite/27_io/ofstream_members.cc b/libstdc++-v3/testsuite/27_io/ofstream_members.cc
index d965b3efbfc..79c86e13066 100644
--- a/libstdc++-v3/testsuite/27_io/ofstream_members.cc
+++ b/libstdc++-v3/testsuite/27_io/ofstream_members.cc
@@ -1,4 +1,4 @@
-// Copyright (C) 2000 Free Software Foundation, Inc.
+// Copyright (C) 2000, 2001 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
@@ -22,7 +22,7 @@
#include <ostream>
#include <fstream>
-#include <debug_assert.h>
+#include <testsuite_hooks.h>
const char name_01[] = "ofstream_members-1.tst";
const char name_02[] = "ofstream_members-1.txt";
@@ -74,8 +74,51 @@ bool test01()
return test;
}
+void
+redirect_buffer(std::ios& stream, std::streambuf* new_buf)
+{ stream.rdbuf(new_buf); }
+
+std::streambuf*
+active_buffer(std::ios& stream)
+{ return stream.rdbuf(); }
+
+// libstdc++/2832
+void test02()
+{
+ bool test = true;
+ const char* strlit01 = "fuck war";
+ const char* strlit02 = "two less cars abstract riot crew, critical mass/SF";
+ const std::string str00;
+ const std::string str01(strlit01);
+ std::string str02;
+ std::filebuf fbuf;
+ std::streambuf* pbasebuf0 = &fbuf;
+
+ std::ofstream sstrm1;
+ // derived rdbuf() always returns original streambuf, even though
+ // it's no longer associated with the stream.
+ std::filebuf* const buf1 = sstrm1.rdbuf();
+ // base rdbuf() returns the currently associated streambuf
+ std::streambuf* pbasebuf1 = active_buffer(sstrm1);
+ redirect_buffer(sstrm1, &fbuf);
+ std::filebuf* const buf2 = sstrm1.rdbuf();
+ std::streambuf* pbasebuf2 = active_buffer(sstrm1);
+ VERIFY( buf1 == buf2 );
+ VERIFY( pbasebuf1 != pbasebuf2 );
+ VERIFY( pbasebuf2 == pbasebuf0 );
+
+ // How confusing and non-intuitive is this?
+ // These semantics are a joke, a serious defect, and incredibly lame.
+}
+
int main()
{
test00();
test01();
+
+ test02();
+ return 0;
}
+
+
+
diff --git a/libstdc++-v3/testsuite/27_io/ostream.cc b/libstdc++-v3/testsuite/27_io/ostream.cc
index 33cc3587644..df77421aeaa 100644
--- a/libstdc++-v3/testsuite/27_io/ostream.cc
+++ b/libstdc++-v3/testsuite/27_io/ostream.cc
@@ -46,4 +46,3 @@ namespace test {
int main() {
return 0;
}
-
diff --git a/libstdc++-v3/testsuite/27_io/ostream_inserter_arith.cc b/libstdc++-v3/testsuite/27_io/ostream_inserter_arith.cc
index f503ad37f61..af45aaafaf5 100644
--- a/libstdc++-v3/testsuite/27_io/ostream_inserter_arith.cc
+++ b/libstdc++-v3/testsuite/27_io/ostream_inserter_arith.cc
@@ -25,7 +25,7 @@
#include <locale>
#include <sstream>
#include <limits>
-#include <debug_assert.h>
+#include <testsuite_hooks.h>
using namespace std;
@@ -318,13 +318,3 @@ main()
#endif
return 0;
}
-
-
-
-
-
-
-
-
-
-
diff --git a/libstdc++-v3/testsuite/27_io/ostream_inserter_char.cc b/libstdc++-v3/testsuite/27_io/ostream_inserter_char.cc
index 0c7f18915fc..c8a4a73d4f7 100644
--- a/libstdc++-v3/testsuite/27_io/ostream_inserter_char.cc
+++ b/libstdc++-v3/testsuite/27_io/ostream_inserter_char.cc
@@ -24,7 +24,7 @@
#include <ostream>
#include <sstream>
#include <fstream>
-#include <debug_assert.h>
+#include <testsuite_hooks.h>
// ofstream
bool test01()
@@ -266,4 +266,3 @@ int main()
test06();
return 0;
}
-
diff --git a/libstdc++-v3/testsuite/27_io/ostream_inserter_other.cc b/libstdc++-v3/testsuite/27_io/ostream_inserter_other.cc
index ec3a028e82f..492999dcf8f 100644
--- a/libstdc++-v3/testsuite/27_io/ostream_inserter_other.cc
+++ b/libstdc++-v3/testsuite/27_io/ostream_inserter_other.cc
@@ -1,7 +1,7 @@
// 1999-08-16 bkoz
// 1999-11-01 bkoz
-// Copyright (C) 1999, 2000 Free Software Foundation
+// Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation
//
// 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
@@ -26,7 +26,7 @@
#include <ostream>
#include <sstream>
#include <fstream>
-#include <debug_assert.h>
+#include <testsuite_hooks.h>
const int size = 1000;
const char name_01[] = "ostream_inserter_other-1.tst";
@@ -134,13 +134,28 @@ test03(void)
return 0;
}
+// libstdc++/3272
+void test04()
+{
+ using namespace std;
+ bool test = true;
+ istringstream istr("inside betty carter");
+ ostringstream ostr;
+ ostr << istr.rdbuf() << endl;
+
+ if (ostr.rdstate() & ios_base::eofbit)
+ test = false;
+
+ VERIFY( test );
+}
+
int
main()
{
test01();
test02();
test03();
+ test04();
return 0;
}
-
diff --git a/libstdc++-v3/testsuite/27_io/ostream_manip.cc b/libstdc++-v3/testsuite/27_io/ostream_manip.cc
index ec019e7673d..ee75cad964b 100644
--- a/libstdc++-v3/testsuite/27_io/ostream_manip.cc
+++ b/libstdc++-v3/testsuite/27_io/ostream_manip.cc
@@ -23,7 +23,7 @@
#include <ostream>
#include <sstream>
#include <stdexcept>
-#include <debug_assert.h>
+#include <testsuite_hooks.h>
bool test01(void)
{
@@ -121,9 +121,5 @@ bool test02()
int main()
{
test01();
+ return 0;
}
-
-
-
-
-
diff --git a/libstdc++-v3/testsuite/27_io/ostream_seeks.cc b/libstdc++-v3/testsuite/27_io/ostream_seeks.cc
index df927562a2b..7022a2f594f 100644
--- a/libstdc++-v3/testsuite/27_io/ostream_seeks.cc
+++ b/libstdc++-v3/testsuite/27_io/ostream_seeks.cc
@@ -23,7 +23,7 @@
#include <ostream>
#include <sstream>
#include <fstream>
-#include <debug_assert.h>
+#include <testsuite_hooks.h>
bool test01()
@@ -292,11 +292,3 @@ int main()
// test05();
return 0;
}
-
-
-
-
-
-
-
-
diff --git a/libstdc++-v3/testsuite/27_io/ostream_unformatted.cc b/libstdc++-v3/testsuite/27_io/ostream_unformatted.cc
index 657aa79f372..a55ac3ca45b 100644
--- a/libstdc++-v3/testsuite/27_io/ostream_unformatted.cc
+++ b/libstdc++-v3/testsuite/27_io/ostream_unformatted.cc
@@ -20,7 +20,7 @@
#include <sstream>
#include <ostream>
-#include <debug_assert.h>
+#include <testsuite_hooks.h>
void test01()
@@ -50,4 +50,5 @@ void test01()
int main()
{
test01();
+ return 0;
}
diff --git a/libstdc++-v3/testsuite/27_io/ostringstream_members.cc b/libstdc++-v3/testsuite/27_io/ostringstream_members.cc
new file mode 100644
index 00000000000..4e7f861b516
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/ostringstream_members.cc
@@ -0,0 +1,105 @@
+// 2001-05-23 Benjamin Kosnik <bkoz@redhat.com>
+
+// Copyright (C) 2001 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.7.3.2 member functions (ostringstream_members)
+
+#include <sstream>
+#include <testsuite_hooks.h>
+
+void test01()
+{
+ bool test = true;
+ std::ostringstream os01;
+ const std::string str00;
+ const std::string str01 = "123";
+ std::string str02;
+ const int i01 = 123;
+ int a,b;
+
+ std::ios_base::iostate state1, state2, statefail, stateeof;
+ statefail = std::ios_base::failbit;
+ stateeof = std::ios_base::eofbit;
+
+ // string str() const
+ str02 = os01.str();
+ VERIFY( str00 == str02 );
+
+ // void str(const basic_string&)
+ os01.str(str01);
+ str02 = os01.str();
+ VERIFY( str01 == str02 );
+
+ #ifdef DEBUG_ASSERT
+ assert(test);
+#endif
+}
+
+void
+redirect_buffer(std::ios& stream, std::streambuf* new_buf)
+{ stream.rdbuf(new_buf); }
+
+std::streambuf*
+active_buffer(std::ios& stream)
+{ return stream.rdbuf(); }
+
+// libstdc++/2832
+void test02()
+{
+ bool test = true;
+ const char* strlit01 = "fuck war";
+ const char* strlit02 = "two less cars abstract riot crew, critical mass/SF";
+ const std::string str00;
+ const std::string str01(strlit01);
+ std::string str02;
+ std::stringbuf sbuf(str01);
+ std::streambuf* pbasebuf0 = &sbuf;
+
+ std::ostringstream sstrm1;
+ VERIFY( sstrm1.str() == str00 );
+ // derived rdbuf() always returns original streambuf, even though
+ // it's no longer associated with the stream.
+ std::stringbuf* const buf1 = sstrm1.rdbuf();
+ // base rdbuf() returns the currently associated streambuf
+ std::streambuf* pbasebuf1 = active_buffer(sstrm1);
+ redirect_buffer(sstrm1, &sbuf);
+ std::stringbuf* const buf2 = sstrm1.rdbuf();
+ std::streambuf* pbasebuf2 = active_buffer(sstrm1);
+ VERIFY( buf1 == buf2 );
+ VERIFY( pbasebuf1 != pbasebuf2 );
+ VERIFY( pbasebuf2 == pbasebuf0 );
+
+ // derived rdbuf() returns the original buf, so str() doesn't change.
+ VERIFY( sstrm1.str() != str01 );
+ VERIFY( sstrm1.str() == str00 );
+ // however, casting the active streambuf to a stringbuf shows what's up:
+ std::stringbuf* psbuf = dynamic_cast<std::stringbuf*>(pbasebuf2);
+ str02 = psbuf->str();
+ VERIFY( str02 == str01 );
+
+ // How confusing and non-intuitive is this?
+ // These semantics are a joke, a serious defect, and incredibly lame.
+}
+
+int main()
+{
+ test01();
+ test02();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/streambuf.cc b/libstdc++-v3/testsuite/27_io/streambuf.cc
index 4aaa8958408..b5226108967 100644
--- a/libstdc++-v3/testsuite/27_io/streambuf.cc
+++ b/libstdc++-v3/testsuite/27_io/streambuf.cc
@@ -33,7 +33,7 @@
#include <streambuf>
#include <string>
#include <ostream>
-#include <debug_assert.h>
+#include <testsuite_hooks.h>
class testbuf : public std::streambuf
{
@@ -326,6 +326,17 @@ void test05()
nsp.sputc('a');
}
+// test06
+// XXX this should work, doesn't due to compiler limitations.
+#if 0
+namespace gnu
+{
+ class something_derived;
+}
+
+class gnu::something_derived : std::streambuf { };
+#endif
+
int main()
{
test01();
@@ -336,16 +347,3 @@ int main()
test05();
return 0;
}
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/libstdc++-v3/testsuite/27_io/stringbuf.cc b/libstdc++-v3/testsuite/27_io/stringbuf.cc
index 556b0c09303..540f0af2735 100644
--- a/libstdc++-v3/testsuite/27_io/stringbuf.cc
+++ b/libstdc++-v3/testsuite/27_io/stringbuf.cc
@@ -1,6 +1,6 @@
// 981208 bkoz test functionality of basic_stringbuf for char_type == char
-// Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc.
+// Copyright (C) 1997-2001 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
@@ -19,7 +19,7 @@
// USA.
#include <sstream>
-#include <debug_assert.h>
+#include <testsuite_hooks.h>
std::string str_01("mykonos. . . or what?");
std::string str_02("paris, or sainte-maxime?");
@@ -54,7 +54,6 @@ bool test02() {
// test member functions
bool test03() {
bool test = true;
- std::string str_tmp;
//stringbuf::str()
VERIFY( strb_01.str() == str_01 );
@@ -72,6 +71,18 @@ bool test03() {
VERIFY( str_01.length() == d1 );
VERIFY( strb_01.str() == strb_03.str() ); //ditto
+ // stringbuf::str(string&) and stringbuf::stringbuf(string&), where the
+ // string in question contains embedded NUL characters. Note that in this
+ // embedded-NUL situation, the size must be passed to the string ctor.
+ std::string str_nulls ("eschew \0 obfuscation", 20); // tested in 21_strings
+ std::stringbuf strb_normal (str_01);
+ std::stringbuf strb_nulls (str_nulls);
+ strb_normal.str(str_nulls); // tried using 'strb_01' rather than declaring
+ // another variable, but then test04 broke!
+ VERIFY( strb_nulls.in_avail() == str_nulls.size() );
+ VERIFY( strb_nulls.str().size() == 20 );
+ VERIFY( strb_normal.in_avail() == str_nulls.size() );
+
#ifdef DEBUG_ASSERT
assert(test);
#endif
@@ -441,10 +452,3 @@ int main() {
// more candy!!!
-
-
-
-
-
-
-
diff --git a/libstdc++-v3/testsuite/27_io/stringbuf_virtuals.cc b/libstdc++-v3/testsuite/27_io/stringbuf_virtuals.cc
new file mode 100644
index 00000000000..3e660c35a43
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/stringbuf_virtuals.cc
@@ -0,0 +1,46 @@
+// 2001-05-21 Benjamin Kosnik <bkoz@redhat.com>
+
+// Copyright (C) 2001 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.7.1.3 Overridden virtual functions
+
+#include <sstream>
+#include <testsuite_hooks.h>
+
+void test01()
+{
+ using namespace std;
+
+ bool test = true;
+ char buf[512];
+ const char* strlit = "how to tell a story and other essays: mark twain";
+ const size_t strlitsize = strlen(strlit);
+ stringbuf sbuf(ios_base::out);
+
+ sbuf.pubsetbuf(buf, strlitsize);
+ sbuf.sputn(strlit, strlitsize);
+ VERIFY( strncmp(strlit, buf, strlitsize) != 0 );
+}
+
+int main()
+{
+ test01();
+
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/stringstream.cc b/libstdc++-v3/testsuite/27_io/stringstream.cc
index 2a8f97ea3a1..e66e26749b6 100644
--- a/libstdc++-v3/testsuite/27_io/stringstream.cc
+++ b/libstdc++-v3/testsuite/27_io/stringstream.cc
@@ -28,11 +28,10 @@
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
-
#include <vector>
#include <string>
#include <sstream>
-#include <debug_assert.h>
+#include <testsuite_hooks.h>
// 01: sanity checks for strings, stringbufs
std::string
@@ -49,8 +48,8 @@ test01()
VERIFY( len == 0 );
// Full string sanity check.
- std::string str02("these golden days, i spend waiting for you:\n
- Betty Carter on Verve with I'm Yours and You're Mine.");
+ std::string str02("these golden days, i spend waiting for you:\n"
+ "Betty Carter on Verve with I'm Yours and You're Mine.");
__i_start = str02.begin();
__i_end = str02.end();
len = str02.size();
@@ -159,14 +158,3 @@ main()
return 0;
}
-
-
-
-
-
-
-
-
-
-
-
diff --git a/libstdc++-v3/testsuite/27_io/stringstream_members.cc b/libstdc++-v3/testsuite/27_io/stringstream_members.cc
new file mode 100644
index 00000000000..4de7b8c5241
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/stringstream_members.cc
@@ -0,0 +1,131 @@
+// 2001-05-24 Benjamin Kosnik <bkoz@redhat.com>
+
+// Copyright (C) 2001 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.7.6 member functions (stringstream_members)
+
+#include <sstream>
+#include <testsuite_hooks.h>
+
+void test01()
+{
+ bool test = true;
+ std::stringstream is01;
+ const std::string str00;
+ const std::string str01 = "123";
+ std::string str02;
+ const int i01 = 123;
+ int a,b;
+
+ std::ios_base::iostate state1, state2, statefail, stateeof;
+ statefail = std::ios_base::failbit;
+ stateeof = std::ios_base::eofbit;
+
+ // string str() const
+ str02 = is01.str();
+ VERIFY( str00 == str02 );
+
+ // void str(const basic_string&)
+ is01.str(str01);
+ str02 = is01.str();
+ VERIFY( str01 == str02 );
+ state1 = is01.rdstate();
+ is01 >> a;
+ state2 = is01.rdstate();
+ VERIFY( a = i01 );
+ // 22.2.2.1.2 num_get virtual functions
+ // p 13
+ // in any case, if stage 2 processing was terminated by the test for
+ // in == end then err != ios_base::eofbit is performed.
+ VERIFY( state1 != state2 );
+ VERIFY( state2 == stateeof );
+
+ is01.str(str01);
+ is01 >> b;
+ VERIFY( b != a );
+ // as is01.good() is false, istream::sentry blocks extraction.
+
+ is01.clear();
+ state1 = is01.rdstate();
+ is01 >> b;
+ state2 = is01.rdstate();
+ VERIFY( b == a );
+ VERIFY( state1 != state2 );
+ VERIFY( state2 == stateeof );
+
+ #ifdef DEBUG_ASSERT
+ assert(test);
+#endif
+}
+
+void
+redirect_buffer(std::ios& stream, std::streambuf* new_buf)
+{ stream.rdbuf(new_buf); }
+
+std::streambuf*
+active_buffer(std::ios& stream)
+{ return stream.rdbuf(); }
+
+// libstdc++/2832
+void test02()
+{
+ bool test = true;
+ const char* strlit01 = "fuck war";
+ const char* strlit02 = "two less cars abstract riot crew, critical mass/SF";
+ const std::string str00;
+ const std::string str01(strlit01);
+ std::string str02;
+ std::stringbuf sbuf(str01);
+ std::streambuf* pbasebuf0 = &sbuf;
+
+ std::stringstream sstrm1;
+ VERIFY( sstrm1.str() == str00 );
+ // derived rdbuf() always returns original streambuf, even though
+ // it's no longer associated with the stream.
+ std::stringbuf* const buf1 = sstrm1.rdbuf();
+ // base rdbuf() returns the currently associated streambuf
+ std::streambuf* pbasebuf1 = active_buffer(sstrm1);
+ redirect_buffer(sstrm1, &sbuf);
+ std::stringbuf* const buf2 = sstrm1.rdbuf();
+ std::streambuf* pbasebuf2 = active_buffer(sstrm1);
+ VERIFY( buf1 == buf2 );
+ VERIFY( pbasebuf1 != pbasebuf2 );
+ VERIFY( pbasebuf2 == pbasebuf0 );
+
+ // derived rdbuf() returns the original buf, so str() doesn't change.
+ VERIFY( sstrm1.str() != str01 );
+ VERIFY( sstrm1.str() == str00 );
+ // however, casting the active streambuf to a stringbuf shows what's up:
+ std::stringbuf* psbuf = dynamic_cast<std::stringbuf*>(pbasebuf2);
+ str02 = psbuf->str();
+ VERIFY( str02 == str01 );
+
+ // How confusing and non-intuitive is this?
+ // These semantics are a joke, a serious defect, and incredibly lame.
+}
+
+int main()
+{
+ test01();
+ test02();
+ return 0;
+}
+
+
+
diff --git a/libstdc++-v3/testsuite/27_io/wide_stream_objects.cc b/libstdc++-v3/testsuite/27_io/wide_stream_objects.cc
index 91cb21be765..022f6eff327 100644
--- a/libstdc++-v3/testsuite/27_io/wide_stream_objects.cc
+++ b/libstdc++-v3/testsuite/27_io/wide_stream_objects.cc
@@ -71,7 +71,7 @@
#include <cwchar>
#include <cwctype>
#endif
-#include <debug_assert.h>
+#include <testsuite_hooks.h>
// Include iostream last, just to make is as difficult as possible to
// properly initialize the standard iostream objects.
diff --git a/libstdc++-v3/testsuite/Makefile.am b/libstdc++-v3/testsuite/Makefile.am
index a6a1a78a261..6aecb39485a 100644
--- a/libstdc++-v3/testsuite/Makefile.am
+++ b/libstdc++-v3/testsuite/Makefile.am
@@ -21,8 +21,17 @@
## Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
## USA.
-AUTOMAKE_OPTIONS = 1.3 cygnus dejagnu
+AUTOMAKE_OPTIONS = foreign dejagnu
-DEJATOOL = libstdc++
+DEJATOOL = libstdc++-v3
+
+EXPECT = `if [ -f @glibcpp_builddir@/../../expect/expect ] ; then \
+ echo @glibcpp_builddir@/../../expect/expect ; \
+ else echo expect ; fi`
+
+RUNTEST = `if [ -f @glibcpp_srcdir@/../dejagnu/runtest ] ; then \
+ echo @glibcpp_srcdir@/../dejagnu/runtest ; \
+ else echo runtest; fi`
+
+RUNTESTFLAGS =
-RUNTEST = runtest
diff --git a/libstdc++-v3/testsuite/Makefile.in b/libstdc++-v3/testsuite/Makefile.in
new file mode 100644
index 00000000000..2cdb3687290
--- /dev/null
+++ b/libstdc++-v3/testsuite/Makefile.in
@@ -0,0 +1,282 @@
+# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am
+
+# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+
+SHELL = @SHELL@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+
+bindir = @bindir@
+sbindir = @sbindir@
+libexecdir = @libexecdir@
+datadir = @datadir@
+sysconfdir = @sysconfdir@
+sharedstatedir = @sharedstatedir@
+localstatedir = @localstatedir@
+libdir = @libdir@
+infodir = @infodir@
+mandir = @mandir@
+includedir = @includedir@
+oldincludedir = /usr/include
+
+DESTDIR =
+
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+
+top_builddir = ..
+
+ACLOCAL = @ACLOCAL@
+AUTOCONF = @AUTOCONF@
+AUTOMAKE = @AUTOMAKE@
+AUTOHEADER = @AUTOHEADER@
+
+INSTALL = @INSTALL@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+transform = @program_transform_name@
+
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_alias = @build_alias@
+build_triplet = @build@
+host_alias = @host_alias@
+host_triplet = @host@
+target_alias = @target_alias@
+target_triplet = @target@
+AR = @AR@
+AS = @AS@
+ATOMICITY_INC_SRCDIR = @ATOMICITY_INC_SRCDIR@
+BASIC_FILE_H = @BASIC_FILE_H@
+CC = @CC@
+CCODECVT_C = @CCODECVT_C@
+CLOCALE_H = @CLOCALE_H@
+CPP = @CPP@
+CSHADOW_FLAGS = @CSHADOW_FLAGS@
+CSTDIO_H = @CSTDIO_H@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+C_INCLUDE_DIR = @C_INCLUDE_DIR@
+DEBUG_FLAGS = @DEBUG_FLAGS@
+DLLTOOL = @DLLTOOL@
+EXEEXT = @EXEEXT@
+EXTRA_CXX_FLAGS = @EXTRA_CXX_FLAGS@
+GCJ = @GCJ@
+GCJFLAGS = @GCJFLAGS@
+GLIBCPP_INCLUDES = @GLIBCPP_INCLUDES@
+GLIBCPP_IS_CROSS_COMPILING = @GLIBCPP_IS_CROSS_COMPILING@
+LIBIO_INCLUDES = @LIBIO_INCLUDES@
+LIBMATHOBJS = @LIBMATHOBJS@
+LIBMATH_INCLUDES = @LIBMATH_INCLUDES@
+LIBSTRINGOBJS = @LIBSTRINGOBJS@
+LIBSUPCXX_INCLUDES = @LIBSUPCXX_INCLUDES@
+LIBSUPCXX_PICFLAGS = @LIBSUPCXX_PICFLAGS@
+LIBTOOL = @LIBTOOL@
+LIMITS_INC_SRCDIR = @LIMITS_INC_SRCDIR@
+LN_S = @LN_S@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OPTIMIZE_CXXFLAGS = @OPTIMIZE_CXXFLAGS@
+OPT_LDFLAGS = @OPT_LDFLAGS@
+OS_INC_SRCDIR = @OS_INC_SRCDIR@
+PACKAGE = @PACKAGE@
+RANLIB = @RANLIB@
+SECTION_FLAGS = @SECTION_FLAGS@
+SECTION_LDFLAGS = @SECTION_LDFLAGS@
+STRIP = @STRIP@
+TOPLEVEL_INCLUDES = @TOPLEVEL_INCLUDES@
+USE_COMPLEX_LONG_DOUBLE = @USE_COMPLEX_LONG_DOUBLE@
+VERSION = @VERSION@
+WARN_FLAGS = @WARN_FLAGS@
+WERROR = @WERROR@
+enable_shared = @enable_shared@
+enable_static = @enable_static@
+glibcpp_CXX = @glibcpp_CXX@
+glibcpp_basedir = @glibcpp_basedir@
+glibcpp_builddir = @glibcpp_builddir@
+glibcpp_prefixdir = @glibcpp_prefixdir@
+glibcpp_srcdir = @glibcpp_srcdir@
+glibcpp_thread_h = @glibcpp_thread_h@
+glibcpp_toolexecdir = @glibcpp_toolexecdir@
+glibcpp_toolexeclibdir = @glibcpp_toolexeclibdir@
+gxx_include_dir = @gxx_include_dir@
+ifGNUmake = @ifGNUmake@
+libio_la = @libio_la@
+toplevel_srcdir = @toplevel_srcdir@
+
+AUTOMAKE_OPTIONS = foreign dejagnu
+
+DEJATOOL = libstdc++-v3
+
+EXPECT = `if [ -f @glibcpp_builddir@/../../expect/expect ] ; then \
+ echo @glibcpp_builddir@/../../expect/expect ; \
+ else echo expect ; fi`
+
+
+RUNTEST = `if [ -f @glibcpp_srcdir@/../dejagnu/runtest ] ; then \
+ echo @glibcpp_srcdir@/../dejagnu/runtest ; \
+ else echo runtest; fi`
+
+
+RUNTESTFLAGS =
+mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs
+CONFIG_HEADER = ../config.h
+CONFIG_CLEAN_FILES =
+DIST_COMMON = README Makefile.am Makefile.in
+
+
+DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+
+TAR = gtar
+GZIP_ENV = --best
+all: all-redirect
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+ cd $(top_srcdir) && $(AUTOMAKE) --cygnus testsuite/Makefile
+
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ cd $(top_builddir) \
+ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+tags: TAGS
+TAGS:
+
+
+distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
+
+subdir = testsuite
+
+distdir: $(DISTFILES)
+ @for file in $(DISTFILES); do \
+ if test -f $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ cp -pr $$d/$$file $(distdir)/$$file; \
+ else \
+ test -f $(distdir)/$$file \
+ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
+ || cp -p $$d/$$file $(distdir)/$$file || :; \
+ fi; \
+ done
+
+RUNTESTDEFAULTFLAGS = --tool $(DEJATOOL) --srcdir $$srcdir
+
+check-DEJAGNU: site.exp
+ srcdir=`cd $(srcdir) && pwd`; export srcdir; \
+ EXPECT=$(EXPECT); export EXPECT; \
+ if [ -f $(top_builddir)/../expect/expect ]; then \
+ TCL_LIBRARY=`cd $(top_srcdir)/../tcl/library && pwd`; \
+ export TCL_LIBRARY; \
+ fi; \
+ runtest=$(RUNTEST); \
+ if $(SHELL) -c "$$runtest --version" > /dev/null 2>&1; then \
+ $$runtest $(RUNTESTDEFAULTFLAGS) $(RUNTESTFLAGS); \
+ else echo "WARNING: could not find \`runtest'" 1>&2; :;\
+ fi
+site.exp: Makefile
+ @echo 'Making a new site.exp file...'
+ @test ! -f site.bak || rm -f site.bak
+ @echo '## these variables are automatically generated by make ##' > $@-t
+ @echo '# Do not edit here. If you wish to override these values' >> $@-t
+ @echo '# edit the last section' >> $@-t
+ @echo 'set tool $(DEJATOOL)' >> $@-t
+ @echo 'set srcdir $(srcdir)' >> $@-t
+ @echo 'set objdir' `pwd` >> $@-t
+ @echo 'set host_alias $(host_alias)' >> $@-t
+ @echo 'set host_triplet $(host_triplet)' >> $@-t
+ @echo 'set target_alias $(target_alias)' >> $@-t
+ @echo 'set target_triplet $(target_triplet)' >> $@-t
+ @echo 'set build_alias $(build_alias)' >> $@-t
+ @echo 'set build_triplet $(build_triplet)' >> $@-t
+ @echo '## All variables above are generated by configure. Do Not Edit ##' >> $@-t
+ @test ! -f site.exp || sed '1,/^## All variables above are.*##/ d' site.exp >> $@-t
+ @test ! -f site.exp || mv site.exp site.bak
+ @mv $@-t site.exp
+info-am:
+info: info-am
+dvi-am:
+dvi: dvi-am
+check-am:
+ $(MAKE) $(AM_MAKEFLAGS) check-DEJAGNU
+check: check-am
+installcheck-am:
+installcheck: installcheck-am
+install-info-am:
+install-info: install-info-am
+install-exec-am:
+install-exec: install-exec-am
+
+install-data-am:
+install-data: install-data-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+install: install-am
+uninstall-am:
+uninstall: uninstall-am
+all-am: Makefile
+all-redirect: all-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
+installdirs:
+
+
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -rm -f Makefile $(CONFIG_CLEAN_FILES)
+ -rm -f config.cache config.log stamp-h stamp-h[0-9]*
+
+maintainer-clean-generic:
+mostlyclean-am: mostlyclean-generic
+
+mostlyclean: mostlyclean-am
+
+clean-am: clean-generic mostlyclean-am
+
+clean: clean-am
+
+distclean-am: distclean-generic clean-am
+ -rm -f libtool
+
+distclean: distclean-am
+
+maintainer-clean-am: maintainer-clean-generic distclean-am
+ @echo "This command is intended for maintainers to use;"
+ @echo "it deletes files that may require special tools to rebuild."
+
+maintainer-clean: maintainer-clean-am
+
+.PHONY: 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-redirect all-am all installdirs \
+mostlyclean-generic distclean-generic clean-generic \
+maintainer-clean-generic clean mostlyclean distclean maintainer-clean
+
+
+# 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.
+.NOEXPORT:
diff --git a/libstdc++-v3/testsuite/README b/libstdc++-v3/testsuite/README
index c675e58e907..a52cb312a61 100644
--- a/libstdc++-v3/testsuite/README
+++ b/libstdc++-v3/testsuite/README
@@ -1,14 +1,134 @@
We're in the process of converting the existing testsuite machinery to
use the new style DejaGnu framework. Eventually, we'll abandon
-../mkcheck.in in favor of this new testsuite framework.
+../mkcheck.in in favor of this new testsuite framework.
- Basically, a testcase contains dg-keywords (see dg.exp) indicating
+
+// 1: How to write a testcase
+As per the dejagnu instructions, always return 0 from main to indicate
+success.
+
+Basically, a testcase contains dg-keywords (see dg.exp) indicating
what to do and what kinds of behaviour are to be expected. New
-testcases should be written with the new style DejaGnu framework in mind.
+testcases should be written with the new style DejaGnu framework in
+mind.
+
+To ease transition, here is the list of dg-keyword documentation
+lifted from dg.exp -- eventually we should improve DejaGnu
+documentation, but getting checkin account currently demands Pyrrhic
+effort.
+
+# The currently supported options are:
+#
+# dg-prms-id N
+# set prms_id to N
+#
+# dg-options "options ..." [{ target selector }]
+# specify special options to pass to the tool (eg: compiler)
+#
+# dg-do do-what-keyword [{ target/xfail selector }]
+# `do-what-keyword' is tool specific and is passed unchanged to
+# ${tool}-dg-test. An example is gcc where `keyword' can be any of:
+# preprocess|compile|assemble|link|run
+# and will do one of: produce a .i, produce a .s, produce a .o,
+# produce an a.out, or produce an a.out and run it (the default is
+# compile).
+#
+# dg-error regexp comment [{ target/xfail selector } [{.|0|linenum}]]
+# indicate an error message <regexp> is expected on this line
+# (the test fails if it doesn't occur)
+# Linenum=0 for general tool messages (eg: -V arg missing).
+# "." means the current line.
+#
+# dg-warning regexp comment [{ target/xfail selector } [{.|0|linenum}]]
+# indicate a warning message <regexp> is expected on this line
+# (the test fails if it doesn't occur)
+#
+# dg-bogus regexp comment [{ target/xfail selector } [{.|0|linenum}]]
+# indicate a bogus error message <regexp> use to occur here
+# (the test fails if it does occur)
+#
+# dg-build regexp comment [{ target/xfail selector }]
+# indicate the build use to fail for some reason
+# (errors covered here include bad assembler generated, tool crashes,
+# and link failures)
+# (the test fails if it does occur)
+#
+# dg-excess-errors comment [{ target/xfail selector }]
+# indicate excess errors are expected (any line)
+# (this should only be used sparingly and temporarily)
+#
+# dg-output regexp [{ target selector }]
+# indicate the expected output of the program is <regexp>
+# (there may be multiple occurrences of this, they are concatenated)
+#
+# dg-final { tcl code }
+# add some tcl code to be run at the end
+# (there may be multiple occurrences of this, they are concatenated)
+# (unbalanced braces must be \-escaped)
+#
+# "{ target selector }" is a list of expressions that determine whether the
+# test succeeds or fails for a particular target, or in some cases whether the
+# option applies for a particular target. If the case of `dg-do' it specifies
+# whether the testcase is even attempted on the specified target.
+#
+# The target selector is always optional. The format is one of:
+#
+# { xfail *-*-* ... } - the test is expected to fail for the given targets
+# { target *-*-* ... } - the option only applies to the given targets
+#
+# At least one target must be specified, use *-*-* for "all targets".
+# At present it is not possible to specify both `xfail' and `target'.
+# "native" may be used in place of "*-*-*".
+
+Example 1: Testing compilation only
+(to just have a testcase do compile testing, without linking and executing)
+// { dg-do compile }
+
+Example 2: Testing for expected warings on line 36
+// { dg-warning "string literals" "" { xfail *-*-* } 36
+
+Example 3: Testing for compilation errors on line 41
+// { dg-do compile }
+// { dg-error "no match for" "" { xfail *-*-* } 41 }
+
+More examples can be found in the libstdc++-v3/testsuite/*/*.cc files.
+
+
+// 2: Test harness notes, invocation, and debugging.
+Configuring the dejagnu harness to work with libstdc++-v3 in a cross
+compilation environment has been maddening. However, it does work now,
+and on a variety of platforms. Including solaris, linux, and cygwin.
+
+To debug the test harness during runs, try invoking with
- The V3 testing framework supports additional keywords for the purpose
-of easing the job of writing testcases. All V3-keywords are of the
-form @xxx@. Currently supported keywords include:
+make check-target-libstdc++-v3 RUNTESTFLAGS="-v"
+or
+make check-target-libstdc++-v3 RUNTESTFLAGS="-v -v"
+
+There are two ways to run on a simulator: set up DEJAGNU to point to a
+specially crafted site.exp, or pass down --target_board flags.
+
+Example flags to pass down for various embedded builds are as follows:
+
+--target=powerpc-eabism (libgloss/sim)
+make check-target-libstdc++-v3 RUNTESTFLAGS="--target_board=powerpc-sim"
+
+--target=calmrisc32 (libgloss/sid)
+make check-target-libstdc++-v3 RUNTESTFLAGS="--target_board=calmrisc32-sid"
+
+--target=xscale-elf (newlib/sim)
+make check-target-libstdc++-v3 RUNTESTFLAGS="--target_board=arm-sim"
+
+
+// 3: Future plans, to be done
+Shared runs need to be implemented, for targets that support shared libraries.
+
+Diffing of expected output to standard streams needs to be finished off.
+
+The V3 testing framework supports, or will eventually support,
+additional keywords for the purpose of easing the job of writing
+testcases. All V3-keywords are of the form @xxx@. Currently plans
+for supported keywords include:
@require@ <files>
The existence of <files> is essential for the test to complete
@@ -26,4 +146,24 @@ form @xxx@. Currently supported keywords include:
same length. The test fails if diff returns non-zero a pair of
files.
--- Gaby
+Current testing problems with cygwin-hosted tools:
+
+There are two known problems which I have not addressed. The first is
+that when testing cygwin hosted tools from the unix build dir, it does
+the wrong thing building the wrapper program (testglue.c) because host
+and target are the same in site.exp (host and target are the same from
+the perspective of the target libraries)
+
+Problem number two is a little more annoying. In order for me to make
+v3 testing work on Windows, I had to tell dejagnu to copy over the
+debug_assert.h file to the remote host and then set the includes to
+-I./. This is how all the other tests like this are done so I didn't
+think much of it. However, this had some unfortunate results due to
+gcc having a testcase called "limits" and C++ having an include file
+called "limits". The gcc "limits" binary was in the temporary dir
+when the v3 tests were being built. As a result, the gcc "limits"
+binary was being #included rather than the intended one. The only way
+to fix this is to go through the testsuites and make sure binaries are
+deleted on the remote host when testing is done with them. That is a
+lot more work than I want to do so I worked around it by cleaning out
+D:\kermit on compsognathus and rerunning tests.
diff --git a/libstdc++-v3/testsuite/config/default.exp b/libstdc++-v3/testsuite/config/default.exp
index f2a4554ca3a..dbe227be7a6 100644
--- a/libstdc++-v3/testsuite/config/default.exp
+++ b/libstdc++-v3/testsuite/config/default.exp
@@ -1,4 +1,4 @@
-# Copyright (C) 1997 Free Software Foundation, Inc.
+# Copyright (C) 2001 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -15,6 +15,7 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# Please email any bugs, comments, and/or additions to this file to:
-# bug-gcc@prep.ai.mit.edu
+# libstdc++@gcc.gnu.org
+
+load_lib "standard.exp"
-load_lib "dg.exp"
diff --git a/libstdc++-v3/testsuite/debug_assert.h b/libstdc++-v3/testsuite/debug_assert.h
deleted file mode 100644
index dbd6e984056..00000000000
--- a/libstdc++-v3/testsuite/debug_assert.h
+++ /dev/null
@@ -1,51 +0,0 @@
-// 20000810 Brent Verner <brent@rcfile.org>
-//
-// Copyright (C) 2000 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.
-//
-//
-// Purpose:
-// This file is included in the various testsuite programs to provide
-// #define(able) assert() behavior for debugging/testing. It may be
-// a suitable location for other furry woodland creatures as well.
-//
-// Notes:
-// If you find yourself compiling small test progs as much as I
-// do, you can move this file to a location your compiler(s)
-// will find, and possibly add more cheap debugging stuff...
-//
-
-#ifndef _CPP_DEBUG_ASSERT_H
-#define _CPP_DEBUG_ASSERT_H
-
-#ifdef DEBUG_ASSERT
-# include <cassert>
-# define VERIFY(fn) assert(fn)
-
-#else
-# define VERIFY(fn) test &= (fn)
-// should we define this here to make sure no 'unexpected' failures
-// happen, or do we require that it be defined in any scope where
-// the VERIFY macro is used???
-//
-// static bool test = true;
-#endif
-
-
-#endif // _CPP_DEBUG_ASSERT_H
-
diff --git a/libstdc++-v3/testsuite/ext/headers.cc b/libstdc++-v3/testsuite/ext/headers.cc
index d596bf98b96..297674db1c3 100644
--- a/libstdc++-v3/testsuite/ext/headers.cc
+++ b/libstdc++-v3/testsuite/ext/headers.cc
@@ -1,6 +1,6 @@
// 1999-06-23 bkoz
-// Copyright (C) 1999 Free Software Foundation, Inc.
+// Copyright (C) 1999, 2001 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
@@ -23,11 +23,9 @@
// This should include a list of all headers in the extension
// subdirectory that are meant to be directly included.
-#include <ext/bvector>
#include <ext/hash_map>
#include <ext/hash_set>
#include <ext/rope>
#include <ext/slist>
-#include <ext/tree>
int main() { }
diff --git a/libstdc++-v3/testsuite/lib/libstdc++-v3-dg.exp b/libstdc++-v3/testsuite/lib/libstdc++-v3-dg.exp
new file mode 100644
index 00000000000..9821c9bb974
--- /dev/null
+++ b/libstdc++-v3/testsuite/lib/libstdc++-v3-dg.exp
@@ -0,0 +1,188 @@
+# Copyright (C) 2001 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program 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 program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Define libstdc++-v3 callbacks for dg.exp.
+
+load_lib dg.exp
+load_lib libgloss.exp
+
+proc libstdc++-v3-copy-files {srcfiles dstdir} {
+ foreach f $srcfiles {
+ if { [catch { set symlink [file readlink $f] } x] } then {
+ file copy -force $f $dstdir
+ } else {
+ if { [regexp "^/" "$symlink"] } then {
+ file copy -force $symlink $dstdir
+ } else {
+ set dirname [file dirname $f]
+ file copy -force $dirname/$symlink $dstdir
+ }
+ }
+ }
+}
+
+proc libstdc++-v3-init { args } {
+ global srcdir
+ global outdir
+ global blddir
+ global cxx
+ global includes
+ global cxxflags
+ global objdir
+ global gluefile wrap_flags
+ global ld_library_path
+ global tool_root_dir
+
+ set blddir [lookfor_file [get_multilibs] libstdc++-v3]
+
+ # By default, we assume we want to run program images.
+ global dg-do-what-default
+ set dg-do-what-default run
+
+ # Copy any required data files.
+ libstdc++-v3-copy-files [glob -nocomplain "$srcdir/*/*.tst"] $outdir
+ libstdc++-v3-copy-files [glob -nocomplain "$srcdir/*/*.txt"] $outdir
+
+ # set LD_LIBRARY_PATH so that libgcc_s, libstdc++ binaries can be found.
+ # locate libgcc.a so we don't need to account for different values of
+ # SHLIB_EXT on different platforms
+ set gccdir [lookfor_file $tool_root_dir gcc/libgcc.a]
+ if {$gccdir != ""} {
+ set gccdir [file dirname $gccdir]
+ }
+
+ set ld_library_path "."
+ append ld_library_path ":${gccdir}"
+ append ld_library_path ":${blddir}/src/.libs"
+
+ # Do a bunch of handstands and backflips for cross compiling and
+ # finding simulators...
+ if [is_remote host] {
+ set header [remote_download host ${blddir}/testsuite/testsuite_hooks.h]
+ if { $header == "" } {
+ verbose -log "Unable to download ${blddir}/testsuite/testsuite_hooks.h to host."
+ return "untested"
+ }
+ set cxx [transform "g++"]
+ set cxxflags "-ggdb3 -DDEBUG_ASSERT"
+ set includes "-I./"
+ } else {
+ # If we find a testsuite_flags file, we're testing in the build dir.
+ set flags_file "${blddir}/testsuite_flags"
+ if { [file exists $flags_file] } {
+ set cxx [exec sh $flags_file --build-cxx]
+ set cxxflags [exec sh $flags_file --cxxflags]
+ set includes [exec sh $flags_file --build-includes]
+ } else {
+ set cxx [transform "g++"]
+ set cxxflags "-ggdb3 -DDEBUG_ASSERT"
+ set includes "-I${srcdir}"
+ }
+ }
+
+ if { [target_info needs_status_wrapper]!="" && ![info exists gluefile] } {
+ set gluefile ${objdir}/testglue.o;
+ set result [build_wrapper $gluefile];
+ if { $result != "" } {
+ set gluefile [lindex $result 0];
+ set wrap_flags [lindex $result 1];
+ } else {
+ unset gluefile
+ }
+ }
+}
+
+proc libstdc++-v3-dg-test { prog do_what extra_tool_flags } {
+ # Set up the compiler flags, based on what we're going to do.
+
+ switch $do_what {
+ "preprocess" {
+ set compile_type "preprocess"
+ set output_file "[file rootname [file tail $prog]].i"
+ }
+ "compile" {
+ set compile_type "assembly"
+ set output_file "[file rootname [file tail $prog]].s"
+ }
+ "assemble" {
+ set compile_type "object"
+ set output_file "[file rootname [file tail $prog]].o"
+ }
+ "link" {
+ set compile_type "executable"
+ set output_file "./[file rootname [file tail $prog]]"
+ }
+ "run" {
+ set compile_type "executable"
+ # FIXME: "./" is to cope with "." not being in $PATH.
+ # Should this be handled elsewhere?
+ # YES.
+ set output_file "./[file rootname [file tail $prog]]"
+ # This is the only place where we care if an executable was
+ # created or not. If it was, dg.exp will try to run it.
+ remote_file build delete $output_file;
+ }
+ default {
+ perror "$do_what: not a valid dg-do keyword"
+ return ""
+ }
+ }
+ set options ""
+ if { $extra_tool_flags != "" } {
+ lappend options "additional_flags=$extra_tool_flags"
+ }
+
+ set comp_output [libstdc++-v3_target_compile "$prog" "$output_file" "$compile_type" $options];
+
+ return [list $comp_output $output_file]
+}
+
+
+proc libstdc++-v3_target_compile { source dest type options } {
+ global gluefile
+ global wrap_flags
+ global cxx
+ global cxxflags
+ global includes
+
+ if { [target_info needs_status_wrapper] != "" && [info exists gluefile] } {
+ lappend options "libs=${gluefile}"
+ lappend options "ldflags=${wrap_flags}"
+ }
+
+ set cxx_final $cxx
+ set cxxlibglossflags [libgloss_link_flags]
+ set cxx_final [concat $cxx_final $cxxlibglossflags]
+ set cxx_final [concat $cxx_final $cxxflags]
+ set cxx_final [concat $cxx_final $includes]
+
+ lappend options "compiler=$cxx_final";
+
+ return [target_compile $source $dest $type $options]
+}
+
+# On IRIX 6, we have to set variables akin to LD_LIBRARY_PATH, but
+# called LD_LIBRARYN32_PATH (for the N32 ABI) and LD_LIBRARY64_PATH
+# (for the 64-bit ABI). The right way to do this would be to modify
+# unix.exp -- but that's not an option since it's part of DejaGNU
+# proper, so we do it here, by trickery. We really only need to do
+# this on IRIX, but it shouldn't hurt to do it anywhere else.
+proc libstdc++-v3_set_ld_library_path { name element op } {
+ setenv LD_LIBRARYN32_PATH [getenv LD_LIBRARY_PATH]
+ setenv LD_LIBRARY64_PATH [getenv LD_LIBRARY_PATH]
+}
+
+trace variable env(LD_LIBRARY_PATH) w libstdc++-v3_set_ld_library_path
diff --git a/libstdc++-v3/testsuite/lib/libstdc++.exp b/libstdc++-v3/testsuite/lib/libstdc++.exp
deleted file mode 100644
index edd104410f5..00000000000
--- a/libstdc++-v3/testsuite/lib/libstdc++.exp
+++ /dev/null
@@ -1,304 +0,0 @@
-# Copyright (C) 2001 Free Software Foundation, Inc.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program 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 program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-# Please email any bugs, comments, and/or additions to this file to:
-# libstdc++@gcc.gnu.org
-#
-# This file is contributed by Gabriel Dos Reis <gdr@codesourcery.com>
-
-## This file contains support routines for dg.exp based testsuite
-## framework.
-
-## The global associative array lib_env contains the totality
-## of options necessary to run testcases; the meanings of which are
-## as follows:
-## lib_env(CXX) The compiler used to run testcases.
-## lib_env(CXXFLAGS) Special flags passed to the compiler.
-## lib_env(INCLUDES) Includes options to pass to the compiler.
-## lib_env(LDFLAGS) Additional library flags.
-## lib_env(LIBTOOL) Path to the `libtool' script.
-## lib_env(SRC_DIR) Where V3 master source lives.
-## lib_env(BUILD_DIR) Where V3 is built.
-## lib_env(static) Flags to pass to the linker to build a
-## statically linked executable.
-## lib_env(shared) Flags to pass to the linker to build a
-## dynamically linked executable.
-## lib_env(testcase_options) Options specified by current testcase.
-## These are specified through the @xxx@-keywords.
-
-
-load_lib dg.exp
-
-## Initialization routine.
-proc libstdc++-dg-init { args } {
- global lib_env
- global srcdir
- global outdir
- global dg-do-what-default
-
- # By default, we assume we want to run program images.
- set dg-do-what-default run
-
- # Get out the source and the build directories.
- set src-dir [lookfor_file $srcdir libstdc++-v3]
- set build-dir [lookfor_file $outdir libstdc++-v3]
-
- # Set proper environment variables for the framework.
- libstdc++-setup-flags ${src-dir} ${build-dir}
-
- # mkcheck.in used to output these information.
- set output [remote_exec host $lib_env(CXX) -v]
- if { [lindex $output 0] == 0 } {
- set output [lindex $output 1]
- regexp "gcc version.*$" $output version
- regsub "\n+" $version "" version
- clone_output "Compiler: $version"
- clone_output "Compiler flags: $lib_env(CXXFLAGS)"
- } else {
- perror "Cannot determine compiler version: [lindex $output 1]"
- }
-}
-
-## dg.exp callback. Called from dg-test to run PROGRAM.
-##
-## This is the heart of the framework. For the time being, it is
-## pretty much baroque, but it will improve as time goes.
-proc libstdc++_load { prog } {
- global lib_env
- set opts $lib_env(testcase_options)
- set results [remote_load target $lib_env(LIBTOOL) "--mode=execute $prog"]
-
- if { [lindex $results 0] == "pass" && [info exists opts(diff)] } {
- # FIXME: We should first test for any mentioned @output@ file here
- # before taking any other action.
-
- set firsts [glob -nocomplain [lindex $opts(diff) 0]]
- set seconds [glob -nocomplain [lindex $opts(diff) 1]]
- foreach f $firsts s $seconds {
- if { [diff $f $s] == 0 } {
- # FIXME: Well we should report a message. But for the time
- # being, just pretend there is nothing much to say.
- # Yes, that is silly, I know. But we need, first, to
- # to have a working framework.
- break
- }
- }
- }
- return $results
-}
-
-## Nothing particular to do.
-proc libstdc++_exit { } {
-}
-
-## Output the version of the libs tested.
-proc libstdc++_version { } {
- global lib_env
- set version "undeterminated"
-
- # This file contains the library configuration, built at configure time.
- set config-file $lib_env(BUILD_DIR)/include/bits/c++config.h
-
- set version_pattern "__GLIBCPP__\[ \t\]\+\[0-9\]\+"
- if [file exists ${config-file}] {
- set version [grep ${config-file} $version_pattern]
- regexp "\[0-9\]\+" $version version
- }
- clone_output "$lib_env(SRC_DIR) version $version"
- return 0
-}
-
-## Main loop. Loop over TEST-DIRECTORIES and run each testcase
-## found therein.
-proc libstdc++_runtest { testdirs } {
- global runtests
- global srcdir
- global outdir
-
- set top-tests-dir [pwd]
- foreach d $testdirs {
- set testfiles [glob -nocomplain $d/*.C $d/*.cc]
- if { [llength $testfiles] == 0 } {
- continue
- }
-
- # Make the appropriate test-dirs with related .libs/ subdir
- # to keep libtool happy.
- set td "$outdir/[dg-trim-dirname $srcdir $d]"
- maybe-make-directory $td
- maybe-make-directory $td/.libs
-
- cd $td;
- foreach testfile $testfiles {
- # If we're not supposed to test this file, just skip it.
- if ![runtest_file_p $runtests $testfile] {
- continue
- }
-
-# verbose "Testing [dg-trim-dirname $srcdir $testfile]"
- libstdc++_do_test $testfile static
- libstdc++_do_test $testfile shared
- }
- cd ${top-tests-dir}
- }
-}
-
-## dg.exp callback. Main test-running routine. Called from
-## dg-test.
-##
-## TESTCASE is the file-name of the program to test;
-## COMPILE_TYPE is the kind of compilation to apply to TESTCASE;
-## current compilation kinds are: preprocess, compile,
-## assemble, link, run.
-proc libstdc++-dg-test { testfile compile_type additional-options } {
- global srcdir; global outdir
- global lib_env
- global which_library
-
- # Prepare for compilation output
- set comp_output ""
-
- # By default, we want to use libtool to compile and run tests.
- set lt $lib_env(LIBTOOL)
- set lt_args "--tag=CXX"
-
- libstdc++-process-options $testfile
- set output_file [file rootname [file tail $testfile]]
- switch $compile_type {
- "preprocess" {
- set lt $lib_env(CXX)
- set lt_args "-E $lib_env(INCLUDES) $testfile -o $output_file.ii"
- }
- "compile" {
- set lt $lib_env(CXX)
- set lt_args "-S $lib_env(INCLUDES) $testfile -o $output_file.s"
- }
- "assemble" {
- append lt_args " --mode=compile $lib_env(FLAGS) $testfile"
- }
- "run" -
- "link" {
- # If we're asked to run a testcase, then just do a `link'.
- # Later, the framework will load the program image through
- # libstdc++_load callback.
- if { $which_library == "static" } {
- append output_file ".st-exe"
- } else {
- append output_file ".sh-exe"
- }
- append lt_args " --mode=link $lib_env(FLAGS) \
- $lib_env($which_library) $testfile \
- -o $output_file $lib_env(LDFLAGS)"
- }
- default {
- perror "$compile_type: option not recognized"
- }
- }
-
- set results [remote_exec host $lt "$lt_args ${additional-options}"]
- if { [lindex $results 0] != 0 } {
- set comp_output [lindex $results 1];
- }
- return [list $comp_output $output_file]
-}
-
-## Get options necessary to properly run testcases.
-## SRC-DIR is the library top source directory e.g. something like
-## /codesourcery/egcs/libstdc++
-## BUILD-DIR is top build directory e.g. something like
-## /tmp/egcs/i686-pc-linux-gnu/libstdc++
-proc libstdc++-setup-flags {src-dir build-dir} {
- global lib_env
-
- set tmp [remote_exec host ${build-dir}/tests_flags "--built-library ${build-dir} ${src-dir}"]
- set status [lindex $tmp 0]
- set output [lindex $tmp 1]
- if { $status == 0 } {
- set flags [split $output :]
- set lib_env(BUILD_DIR) [lindex $flags 0]
- set lib_env(SRC_DIR) [lindex $flags 1]
- set lib_env(CXX) [lindex $flags 3]
- set lib_env(CXXFLAGS) [lindex $flags 4]
- set lib_env(INCLUDES) [lindex $flags 5]
- set lib_env(LDFLAGS) [lindex $flags 6]
-
- # This is really really fragile. We should find a better away to
- # tell the framework which flags to use for static/shared libraries.
- set lib_env(static) "-static"
- set lib_env(shared) ""
-
- set lib_env(LIBTOOL) "$lib_env(BUILD_DIR)/libtool"
- set lib_env(FLAGS) "$lib_env(CXX) -B$lib_env(BUILD_DIR)/ \
- $lib_env(INCLUDES) $lib_env(CXXFLAGS)"
- } else {
- perror "$output"
- }
-}
-
-proc maybe-make-directory {dir} {
- if {![file isdirectory $dir]} {
- file mkdir $dir
- }
-}
-
-proc libstdc++_do_test { testfile lib } {
- global which_library; set which_library $lib
- ## Is it planed to handle -keep-output throught @xxx@-option
- dg-test -keep-output $testfile "" ""
-}
-
-## Process @xxx@ options.
-proc libstdc++-process-options { testfile } {
- global lib_env
-
- array set opts { diff {} output {} require {} }
- set percent [file rootname [file tail $testfile]]
- set option-pattern "@.*@.*"
- set results [grep $testfile ${option-pattern}]
-
- if ![string match "" $results] {
- foreach o $results {
- regexp "@(.*)@(.*)" $o o key value
- regsub -all "%" $value "$percent" value
-
- # Not yet supported: keep-output, output, link-against
- switch $key {
- "diff" -
- "keep-output" -
- "link-against" -
- "output" -
- "require" { }
- default {
- perror "libstdc++: Invalid option-specification `$o'"
- }
- }
- set opts($key) $value
- unset key value
- }
- }
- set lib_env(testcase_options) [array get opts]
-
- # copy any required data files.
- if ![string match "" $opts(require)] {
- set src [file dirname $testfile]
- set dst [pwd]
- foreach f $opts(require) {
- foreach t [glob -nocomplain "$src/$f"] {
- file copy -force $t $dst
- }
- }
- }
-}
diff --git a/libstdc++-v3/testsuite/libstdc++-v3.dg/dg.exp b/libstdc++-v3/testsuite/libstdc++-v3.dg/dg.exp
new file mode 100644
index 00000000000..c5c22c3c287
--- /dev/null
+++ b/libstdc++-v3/testsuite/libstdc++-v3.dg/dg.exp
@@ -0,0 +1,47 @@
+# Copyright (C) 2001 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program 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 program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# libstdc++-v3 testsuite that uses the 'dg.exp' driver.
+
+# Load support procs.
+load_lib libstdc++-v3-dg.exp
+
+# If a testcase doesn't have special options, use these.
+global DEFAULT_CXXFLAGS
+if ![info exists DEFAULT_CXXFLAGS] then {
+ set DEFAULT_CXXFLAGS " -DDEBUG_ASSERT"
+}
+
+# Initialize 'dg' last or dejagnu exits with an error...
+libstdc++-v3-init
+dg-init
+
+
+## Set ulimits.
+## This should normally be handled on a per-test basis through @xxx@-keywords.
+## The following limit is expressed in kilobytes. For history, have a
+## look at http://gcc.gnu.org/ml/libstdc++/2000-10/msg00029.html
+set maximum-memory-usage 16384
+set shell-ulimit-command ulimit
+remote_exec host ${shell-ulimit-command} "-d ${maximum-memory-usage}"
+remote_exec host ${shell-ulimit-command} "-v ${maximum-memory-usage}"
+
+# Main loop.
+dg-runtest [lsort [glob -nocomplain $srcdir/*/*.cc]] \
+ "" $DEFAULT_CXXFLAGS
+
+# All done.
+dg-finish
diff --git a/libstdc++-v3/testsuite/testsuite_hooks.h b/libstdc++-v3/testsuite/testsuite_hooks.h
new file mode 100644
index 00000000000..f8bb87b175e
--- /dev/null
+++ b/libstdc++-v3/testsuite/testsuite_hooks.h
@@ -0,0 +1,104 @@
+// Utility subroutines for the C++ library testsuite.
+//
+// Copyright (C) 2000, 2001 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.
+
+// This file provides the following:
+//
+// 1) VERIFY(), via DEBUG_ASSERT, from Brent Verner <brent@rcfile.org>.
+// This file is included in the various testsuite programs to provide
+// #define(able) assert() behavior for debugging/testing. It may be
+// a suitable location for other furry woodland creatures as well.
+//
+// 2) __set_testsuite_memlimit()
+// __set_testsuite_memlimit() uses setrlimit() to restrict dynamic memory
+// allocation. We provide a default memory limit if none is passed by the
+// calling application. The argument to __set_testsuite_memlimit() is the
+// limit in megabytes (a floating-point number). If _GLIBCPP_MEM_LIMITS is
+// #defined before including this header, then no limiting is attempted.
+
+#ifndef _GLIBCPP_TESTSUITE_HOOKS_H
+#define _GLIBCPP_TESTSUITE_HOOKS_H
+
+#ifdef DEBUG_ASSERT
+# include <cassert>
+# define VERIFY(fn) assert(fn)
+#else
+# define VERIFY(fn) test &= (fn)
+# define VERIFY(fn) fn
+#endif
+
+#include <bits/c++config.h>
+
+// Defined in GLIBCPP_CONFIGURE_TESTSUITE.
+#ifndef _GLIBCPP_MEM_LIMITS
+
+// Don't do memory limits.
+void
+__set_testsuite_memlimit(float x = 0)
+{ }
+
+#else
+
+// Do memory limits.
+#include <sys/resource.h>
+#include <unistd.h>
+
+#ifndef MEMLIMIT_MB
+#define MEMLIMIT_MB 16.0
+#endif
+
+void
+__set_testsuite_memlimit(float __size = MEMLIMIT_MB)
+{
+ struct rlimit r;
+ r.rlim_cur = (rlim_t)(__size * 1048576);
+
+ // Heap size, seems to be common.
+#if _GLIBCPP_HAVE_MEMLIMIT_DATA
+ setrlimit(RLIMIT_DATA, &r);
+#endif
+
+ // Resident set size.
+#if _GLIBCPP_HAVE_MEMLIMIT_RSS
+ setrlimit(RLIMIT_RSS, &r);
+#endif
+
+ // Mapped memory (brk + mmap).
+#if _GLIBCPP_HAVE_MEMLIMIT_VMEM
+ setrlimit(RLIMIT_VMEM, &r);
+#endif
+
+ // Virtual memory.
+#if _GLIBCPP_HAVE_MEMLIMIT_AS
+ setrlimit(RLIMIT_AS, &r);
+#endif
+}
+#endif
+
+#endif // _GLIBCPP_TESTSUITE_HOOKS_H
+
diff --git a/libstdc++-v3/testsuite_flags.in b/libstdc++-v3/testsuite_flags.in
new file mode 100755
index 00000000000..3e79b66f188
--- /dev/null
+++ b/libstdc++-v3/testsuite_flags.in
@@ -0,0 +1,60 @@
+#!/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}/testsuite"
+ echo ${INCLUDES}
+ ;;
+ --install-cxx)
+ CXX=${PREFIX_DIR}/bin/g++
+ echo ${CXX}
+ ;;
+ --build-cxx)
+ CC_build="@glibcpp_CXX@"
+ CXX=`echo $CC_build | sed 's/xgcc/g++/g'`
+ echo ${CXX}
+ ;;
+ --cxxflags)
+ CXXFLAGS=" -ggdb3 -DDEBUG_ASSERT @SECTION_FLAGS@ @SECTION_LDFLAGS@"
+ echo ${CXXFLAGS}
+ ;;
+ *)
+ print_usage
+ ;;
+esac
+
+exit 0
+
+
diff --git a/libtool.m4 b/libtool.m4
index cb004e223ab..aa7e62a0e67 100644
--- a/libtool.m4
+++ b/libtool.m4
@@ -22,8 +22,9 @@
## configuration script generated by Autoconf, you may include it under
## the same distribution terms that you use for the rest of that program.
-# serial 45 AC_PROG_LIBTOOL
-AC_DEFUN(AC_PROG_LIBTOOL,[AC_REQUIRE([_AC_PROG_LIBTOOL])
+# serial 46 AC_PROG_LIBTOOL
+AC_DEFUN([AC_PROG_LIBTOOL],
+[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl
dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX
dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX.
AC_PROVIDE_IFELSE([AC_PROG_CXX],
@@ -50,7 +51,7 @@ dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both.
[define([LT_AC_PROG_GCJ], defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ
])])])])])])
-AC_DEFUN(_AC_PROG_LIBTOOL,
+AC_DEFUN([_AC_PROG_LIBTOOL],
[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl
AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl
@@ -84,7 +85,7 @@ AC_SUBST(LIBTOOL)dnl
exec 5>>./config.log
])
-AC_DEFUN(AC_LIBTOOL_SETUP,
+AC_DEFUN([AC_LIBTOOL_SETUP],
[AC_PREREQ(2.13)dnl
AC_REQUIRE([AC_ENABLE_SHARED])dnl
AC_REQUIRE([AC_ENABLE_STATIC])dnl
@@ -103,7 +104,7 @@ AC_REQUIRE([AC_EXEEXT])dnl
dnl
# Only perform the check for file, if the check method requires it
-case "$deplibs_check_method" in
+case $deplibs_check_method in
file_magic*)
if test "$file_magic_cmd" = '$MAGIC_CMD'; then
AC_PATH_MAGIC
@@ -119,8 +120,8 @@ libtool_flags="--cache-file=$cache_file"
test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
-test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
-test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
+test "$GCC" = yes && libtool_flags="$libtool_flags --with-gcc"
+test "$lt_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
[libtool_flags="$libtool_flags --enable-dlopen"])
ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
@@ -138,12 +139,12 @@ test x"$pic_mode" = xno && libtool_flags="$libtool_flags --prefer-non-pic"
# Some flags need to be propagated to the compiler or linker for good
# libtool support.
-case "$host" in
+case $host in
*-*-irix6*)
# Find out which ABI we are using.
echo '[#]line __oline__ "configure"' > conftest.$ac_ext
if AC_TRY_EVAL(ac_compile); then
- case "`/usr/bin/file conftest.o`" in
+ case `/usr/bin/file conftest.$ac_objext` in
*32-bit*)
LD="${LD-ld} -32"
;;
@@ -187,7 +188,7 @@ ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
DllMain (0, 0, 0);],
[lt_cv_need_dllmain=no],[lt_cv_need_dllmain=yes])])
- case "$host/$CC" in
+ case $host/$CC in
*-*-cygwin*/gcc*-mno-cygwin*|*-*-mingw*)
# old mingw systems require "-dll" to link a DLL, while more recent ones
# require "-mdll"
@@ -207,23 +208,23 @@ esac
])
# AC_LIBTOOL_DLOPEN - enable checks for dlopen support
-AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
+AC_DEFUN([AC_LIBTOOL_DLOPEN], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
# AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
-AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
+AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
# AC_ENABLE_SHARED - implement the --enable-shared flag
# Usage: AC_ENABLE_SHARED[(DEFAULT)]
# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
# `yes'.
-AC_DEFUN(AC_ENABLE_SHARED, [dnl
-define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_DEFUN([AC_ENABLE_SHARED],
+[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
AC_ARG_ENABLE(shared,
changequote(<<, >>)dnl
<< --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
changequote([, ])dnl
[p=${PACKAGE-default}
-case "$enableval" in
+case $enableval in
yes) enable_shared=yes ;;
no) enable_shared=no ;;
*)
@@ -242,21 +243,21 @@ enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
])
# AC_DISABLE_SHARED - set the default shared flag to --disable-shared
-AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+AC_DEFUN([AC_DISABLE_SHARED], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
AC_ENABLE_SHARED(no)])
# AC_ENABLE_STATIC - implement the --enable-static flag
# Usage: AC_ENABLE_STATIC[(DEFAULT)]
# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
# `yes'.
-AC_DEFUN(AC_ENABLE_STATIC, [dnl
-define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_DEFUN([AC_ENABLE_STATIC],
+[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
AC_ARG_ENABLE(static,
changequote(<<, >>)dnl
<< --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
changequote([, ])dnl
[p=${PACKAGE-default}
-case "$enableval" in
+case $enableval in
yes) enable_static=yes ;;
no) enable_static=no ;;
*)
@@ -275,7 +276,8 @@ enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
])
# AC_DISABLE_STATIC - set the default static flag to --disable-static
-AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+AC_DEFUN([AC_DISABLE_STATIC],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
AC_ENABLE_STATIC(no)])
@@ -283,14 +285,14 @@ AC_ENABLE_STATIC(no)])
# Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
# `yes'.
-AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl
-define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_DEFUN([AC_ENABLE_FAST_INSTALL],
+[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
AC_ARG_ENABLE(fast-install,
changequote(<<, >>)dnl
<< --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
changequote([, ])dnl
[p=${PACKAGE-default}
-case "$enableval" in
+case $enableval in
yes) enable_fast_install=yes ;;
no) enable_fast_install=no ;;
*)
@@ -309,22 +311,24 @@ enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
])
# AC_DISABLE_FAST_INSTALL - set the default to --disable-fast-install
-AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+AC_DEFUN([AC_DISABLE_FAST_INSTALL],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
AC_ENABLE_FAST_INSTALL(no)])
# AC_LIBTOOL_PICMODE - implement the --with-pic flag
# Usage: AC_LIBTOOL_PICMODE[(MODE)]
# Where MODE is either `yes' or `no'. If omitted, it defaults to
# `both'.
-AC_DEFUN(AC_LIBTOOL_PICMODE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+AC_DEFUN([AC_LIBTOOL_PICMODE],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
pic_mode=ifelse($#,1,$1,default)])
# AC_PATH_TOOL_PREFIX - find a file program which can recognise shared library
-AC_DEFUN(AC_PATH_TOOL_PREFIX,
+AC_DEFUN([AC_PATH_TOOL_PREFIX],
[AC_MSG_CHECKING([for $1])
AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
-[case "$MAGIC_CMD" in
+[case $MAGIC_CMD in
/*)
lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
;;
@@ -343,7 +347,7 @@ dnl not every word. This closes a longstanding sh security hole.
if test -f $ac_dir/$1; then
lt_cv_path_MAGIC_CMD="$ac_dir/$1"
if test -n "$file_magic_test_file"; then
- case "$deplibs_check_method" in
+ case $deplibs_check_method in
"file_magic "*)
file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
@@ -383,7 +387,7 @@ fi
# AC_PATH_MAGIC - find a file program which can recognise a shared library
-AC_DEFUN(AC_PATH_MAGIC,
+AC_DEFUN([AC_PATH_MAGIC],
[AC_REQUIRE([AC_CHECK_TOOL_PREFIX])dnl
AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin:$PATH)
if test -z "$lt_cv_path_MAGIC_CMD"; then
@@ -397,7 +401,7 @@ fi
# AC_PROG_LD - find the path to the GNU or non-GNU linker
-AC_DEFUN(AC_PROG_LD,
+AC_DEFUN([AC_PROG_LD],
[AC_ARG_WITH(gnu-ld,
[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
@@ -405,7 +409,7 @@ AC_REQUIRE([AC_PROG_CC])dnl
AC_REQUIRE([AC_CANONICAL_HOST])dnl
AC_REQUIRE([AC_CANONICAL_BUILD])dnl
ac_prog=ld
-if test "$ac_cv_prog_gcc" = yes; then
+if test "$GCC" = yes; then
# Check if gcc -print-prog-name=ld gives a path.
AC_MSG_CHECKING([for ld used by GCC])
case $host in
@@ -415,12 +419,10 @@ if test "$ac_cv_prog_gcc" = yes; then
*)
ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
esac
- case "$ac_prog" in
+ case $ac_prog in
# Accept absolute paths.
-changequote(,)dnl
- [\\/]* | [A-Za-z]:[\\/]*)
- re_direlt='/[^/][^/]*/\.\./'
-changequote([,])dnl
+ [[\\/]* | [A-Za-z]:[\\/]*)]
+ re_direlt=['/[^/][^/]*/\.\./']
# Canonicalize the path of ld
ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
@@ -442,17 +444,17 @@ elif test "$with_gnu_ld" = yes; then
else
AC_MSG_CHECKING([for non-GNU ld])
fi
-AC_CACHE_VAL(ac_cv_path_LD,
+AC_CACHE_VAL(lt_cv_path_LD,
[if test -z "$LD"; then
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
for ac_dir in $PATH; do
test -z "$ac_dir" && ac_dir=.
if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
- ac_cv_path_LD="$ac_dir/$ac_prog"
+ lt_cv_path_LD="$ac_dir/$ac_prog"
# Check to see if the program is GNU ld. I'd rather use --version,
# but apparently some GNU ld's only accept -v.
# Break only if it was the GNU/non-GNU ld that we prefer.
- if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
+ if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
test "$with_gnu_ld" != no && break
else
test "$with_gnu_ld" != yes && break
@@ -461,9 +463,9 @@ AC_CACHE_VAL(ac_cv_path_LD,
done
IFS="$ac_save_ifs"
else
- ac_cv_path_LD="$LD" # Let the user override the test with a path.
+ lt_cv_path_LD="$LD" # Let the user override the test with a path.
fi])
-LD="$ac_cv_path_LD"
+LD="$lt_cv_path_LD"
if test -n "$LD"; then
AC_MSG_RESULT($LD)
else
@@ -473,20 +475,20 @@ test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
AC_PROG_LD_GNU
])
-AC_DEFUN(AC_PROG_LD_GNU,
-[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
+AC_DEFUN([AC_PROG_LD_GNU],
+[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
- ac_cv_prog_gnu_ld=yes
+ lt_cv_prog_gnu_ld=yes
else
- ac_cv_prog_gnu_ld=no
+ lt_cv_prog_gnu_ld=no
fi])
-with_gnu_ld=$ac_cv_prog_gnu_ld
+with_gnu_ld=$lt_cv_prog_gnu_ld
])
# AC_PROG_LD_RELOAD_FLAG - find reload flag for linker
# -- PORTME Some linkers may need a different reload flag.
-AC_DEFUN(AC_PROG_LD_RELOAD_FLAG,
+AC_DEFUN([AC_PROG_LD_RELOAD_FLAG],
[AC_CACHE_CHECK([for $LD option to reload object files], lt_cv_ld_reload_flag,
[lt_cv_ld_reload_flag='-r'])
reload_flag=$lt_cv_ld_reload_flag
@@ -495,7 +497,7 @@ test -n "$reload_flag" && reload_flag=" $reload_flag"
# AC_DEPLIBS_CHECK_METHOD - how to check for library dependencies
# -- PORTME fill in with the dynamic library characteristics
-AC_DEFUN(AC_DEPLIBS_CHECK_METHOD,
+AC_DEFUN([AC_DEPLIBS_CHECK_METHOD],
[AC_CACHE_CHECK([how to recognise dependant libraries],
lt_cv_deplibs_check_method,
[lt_cv_file_magic_cmd='$MAGIC_CMD'
@@ -512,8 +514,8 @@ lt_cv_deplibs_check_method='unknown'
# If you have `file' or equivalent on your system and you're not sure
# whether `pass_all' will *always* work, you probably want this one.
-case "$host_os" in
-aix4*)
+case $host_os in
+aix*)
lt_cv_deplibs_check_method=pass_all
;;
@@ -522,9 +524,7 @@ beos*)
;;
bsdi4*)
- changequote(,)dnl
- lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
- changequote([, ])dnl
+ lt_cv_deplibs_check_method=['file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)']
lt_cv_file_magic_cmd='/usr/bin/file -L'
lt_cv_file_magic_test_file=/shlib/libc.so
;;
@@ -534,15 +534,26 @@ cygwin* | mingw* |pw32*)
lt_cv_file_magic_cmd='$OBJDUMP -f'
;;
+darwin* | rhapsody*)
+ lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library'
+ lt_cv_file_magic_cmd='/usr/bin/file -L'
+ case "$host_os" in
+ rhapsody* | darwin1.[012])
+ lt_cv_file_magic_test_file='/System/Library/Frameworks/System.framework/System'
+ ;;
+ *) # Darwin 1.3 on
+ lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib'
+ ;;
+ esac
+ ;;
+
freebsd* )
if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
- case "$host_cpu" in
+ case $host_cpu in
i*86 )
# Not sure whether the presence of OpenBSD here was a mistake.
# Let's accept both of them until this is cleared up.
- changequote(,)dnl
- lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library'
- changequote([, ])dnl
+ lt_cv_deplibs_check_method=['file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library']
lt_cv_file_magic_cmd=/usr/bin/file
lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
;;
@@ -556,30 +567,27 @@ gnu*)
lt_cv_deplibs_check_method=pass_all
;;
-hpux10.20*)
- # TODO: Does this work for hpux-11 too?
- lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library'
+hpux10.20*|hpux11*)
+ lt_cv_deplibs_check_method=['file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library']
lt_cv_file_magic_cmd=/usr/bin/file
lt_cv_file_magic_test_file=/usr/lib/libc.sl
;;
irix5* | irix6*)
- case "$host_os" in
+ case $host_os in
irix5*)
# this will be overridden with pass_all, but let us keep it just in case
lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1"
;;
*)
- case "$LD" in
+ case $LD in
*-32|*"-32 ") libmagic=32-bit;;
*-n32|*"-n32 ") libmagic=N32;;
*-64|*"-64 ") libmagic=64-bit;;
*) libmagic=never-match;;
esac
# this will be overridden with pass_all, but let us keep it just in case
- changequote(,)dnl
- lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1"
- changequote([, ])dnl
+ lt_cv_deplibs_check_method=["file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1"]
;;
esac
lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*`
@@ -588,29 +596,30 @@ irix5* | irix6*)
# This must be Linux ELF.
linux-gnu*)
- case "$host_cpu" in
- alpha* | i*86 | powerpc* | sparc* | ia64* )
+ case $host_cpu in
+ alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* )
lt_cv_deplibs_check_method=pass_all ;;
*)
# glibc up to 2.1.1 does not perform some relocations on ARM
- changequote(,)dnl
- lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;;
- changequote([, ])dnl
+ lt_cv_deplibs_check_method=['file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'] ;;
esac
lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
;;
netbsd*)
- if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then :
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ [lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$']
else
- changequote(,)dnl
- lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object'
- changequote([, ])dnl
- lt_cv_file_magic_cmd='/usr/bin/file -L'
- lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+ [lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so$']
fi
;;
+newsos6)
+ [lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)']
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=/usr/lib/libnls.so
+ ;;
+
osf3* | osf4* | osf5*)
# this will be overridden with pass_all, but let us keep it just in case
lt_cv_deplibs_check_method='file_magic COFF format alpha shared library'
@@ -627,15 +636,17 @@ solaris*)
lt_cv_file_magic_test_file=/lib/libc.so
;;
+[sysv5uw[78]* | sysv4*uw2*)]
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
- case "$host_vendor" in
+ case $host_vendor in
ncr)
lt_cv_deplibs_check_method=pass_all
;;
motorola)
- changequote(,)dnl
- lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
- changequote([, ])dnl
+ lt_cv_deplibs_check_method=['file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]']
lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
;;
esac
@@ -648,12 +659,12 @@ deplibs_check_method=$lt_cv_deplibs_check_method
# AC_PROG_NM - find the path to a BSD-compatible name lister
-AC_DEFUN(AC_PROG_NM,
+AC_DEFUN([AC_PROG_NM],
[AC_MSG_CHECKING([for BSD-compatible nm])
-AC_CACHE_VAL(ac_cv_path_NM,
+AC_CACHE_VAL(lt_cv_path_NM,
[if test -n "$NM"; then
# Let the user override the test.
- ac_cv_path_NM="$NM"
+ lt_cv_path_NM="$NM"
else
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
@@ -665,29 +676,29 @@ else
# nm: unknown option "B" ignored
# Tru64's nm complains that /dev/null is an invalid object file
if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then
- ac_cv_path_NM="$tmp_nm -B"
+ lt_cv_path_NM="$tmp_nm -B"
break
elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
- ac_cv_path_NM="$tmp_nm -p"
+ lt_cv_path_NM="$tmp_nm -p"
break
else
- ac_cv_path_NM=${ac_cv_path_NM="$tmp_nm"} # keep the first match, but
+ lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
continue # so that we can try to find one that supports BSD flags
fi
fi
done
IFS="$ac_save_ifs"
- test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
+ test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
fi])
-NM="$ac_cv_path_NM"
+NM="$lt_cv_path_NM"
AC_MSG_RESULT([$NM])
])
# AC_CHECK_LIBM - check for math library
-AC_DEFUN(AC_CHECK_LIBM,
+AC_DEFUN([AC_CHECK_LIBM],
[AC_REQUIRE([AC_CANONICAL_HOST])dnl
LIBM=
-case "$host" in
+case $host in
*-*-beos* | *-*-cygwin* | *-*-pw32*)
# These system don't have libm
;;
@@ -711,8 +722,9 @@ esac
# '${top_srcdir}/' (note the single quotes!). If your package is not
# flat and you're not using automake, define top_builddir and
# top_srcdir appropriately in the Makefiles.
-AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
- case "$enable_ltdl_convenience" in
+AC_DEFUN([AC_LIBLTDL_CONVENIENCE],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+ case $enable_ltdl_convenience in
no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
"") enable_ltdl_convenience=yes
ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
@@ -732,7 +744,8 @@ AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
# not flat and you're not using automake, define top_builddir and
# top_srcdir appropriately in the Makefiles.
# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
-AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+AC_DEFUN([AC_LIBLTDL_INSTALLABLE],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
AC_CHECK_LIB(ltdl, main,
[test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
[if test x"$enable_ltdl_install" = xno; then
@@ -760,10 +773,10 @@ ifdef([AC_PROVIDE_IFELSE],
[$2], [$3])])])
# AC_LIBTOOL_CXX - enable support for C++ libraries
-AC_DEFUN(AC_LIBTOOL_CXX,[AC_REQUIRE([_AC_LIBTOOL_CXX])])
-AC_DEFUN(_AC_LIBTOOL_CXX,
-[AC_REQUIRE([AC_PROG_LIBTOOL])
-AC_REQUIRE([AC_PROG_CXX])
+AC_DEFUN([AC_LIBTOOL_CXX], [AC_REQUIRE([_AC_LIBTOOL_CXX])])
+
+AC_DEFUN([_AC_LIBTOOL_CXX],
+[AC_REQUIRE([AC_PROG_CXX])
AC_REQUIRE([AC_PROG_CXXCPP])
LIBTOOL_DEPS=$LIBTOOL_DEPS" $ac_aux_dir/ltcf-cxx.sh"
lt_save_CC="$CC"
@@ -771,7 +784,7 @@ lt_save_CFLAGS="$CFLAGS"
dnl Make sure LTCC is set to the C compiler, i.e. set LTCC before CC
dnl is set to the C++ compiler.
AR="$AR" LTCC="$CC" CC="$CXX" CXX="$CXX" CFLAGS="$CXXFLAGS" CPPFLAGS="$CPPFLAGS" \
-MAGIC_CMD="$MAGIC_CMD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
+MAGIC_CMD="$MAGIC_CMD" LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" STRIP="$STRIP" \
AS="$AS" DLLTOOL="$DLLTOOL" OBJDUMP="$OBJDUMP" \
objext="$OBJEXT" exeext="$EXEEXT" reload_flag="$reload_flag" \
@@ -789,8 +802,9 @@ exec 5>>./config.log
])
# AC_LIBTOOL_GCJ - enable support for GCJ libraries
-AC_DEFUN(AC_LIBTOOL_GCJ,[AC_REQUIRE([_AC_LIBTOOL_GCJ])])
-AC_DEFUN(_AC_LIBTOOL_GCJ,
+AC_DEFUN([AC_LIBTOOL_GCJ],[AC_REQUIRE([_AC_LIBTOOL_GCJ])])
+
+AC_DEFUN([_AC_LIBTOOL_GCJ],
[AC_REQUIRE([AC_PROG_LIBTOOL])
AC_PROVIDE_IFELSE([AC_PROG_GCJ],[],
[AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[],
@@ -804,7 +818,7 @@ lt_save_CFLAGS="$CFLAGS"
dnl Make sure LTCC is set to the C compiler, i.e. set LTCC before CC
dnl is set to the C++ compiler.
AR="$AR" LTCC="$CC" CC="$GCJ" CFLAGS="$GCJFLAGS" CPPFLAGS="$CPPFLAGS" \
-MAGIC_CMD="$MAGIC_CMD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
+MAGIC_CMD="$MAGIC_CMD" LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" STRIP="$STRIP" \
AS="$AS" DLLTOOL="$DLLTOOL" OBJDUMP="$OBJDUMP" \
objext="$OBJEXT" exeext="$EXEEXT" reload_flag="$reload_flag" \
@@ -822,19 +836,19 @@ exec 5>>./config.log
])
dnl old names
-AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
-AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
-AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
-AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
-AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
-AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
-AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
+AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL])
+AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
+AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
+AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
+AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
+AC_DEFUN([AM_PROG_LD], [AC_PROG_LD])
+AC_DEFUN([AM_PROG_NM], [AC_PROG_NM])
dnl This is just to silence aclocal about the macro not being used
ifelse([AC_DISABLE_FAST_INSTALL])dnl
-AC_DEFUN([LT_AC_PROG_GCJ],[
- AC_CHECK_TOOL(GCJ, gcj, no)
+AC_DEFUN([LT_AC_PROG_GCJ],
+[AC_CHECK_TOOL(GCJ, gcj, no)
test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
AC_SUBST(GCJFLAGS)
])
diff --git a/ltcf-c.sh b/ltcf-c.sh
index 8e1cf87c9eb..f11a0cfdd11 100644
--- a/ltcf-c.sh
+++ b/ltcf-c.sh
@@ -38,7 +38,7 @@ lt_simple_compile_test_code="int some_variable = 0;"
lt_simple_link_test_code='main(){return(0);}'
## Linker Characteristics
-case "$host_os" in
+case $host_os in
cygwin* | mingw*)
# FIXME: the MSVC++ port hasn't been tested in a loooong time
# When not using gcc, we currently assume that we are using
@@ -56,11 +56,12 @@ if test "$with_gnu_ld" = yes; then
wlarc='${wl}'
# See if GNU ld supports shared libraries.
- case "$host_os" in
+ case $host_os in
aix3* | aix4* | aix5*)
- # On AIX, the GNU linker is very broken
- ld_shlibs=no
- cat <<EOF 1>&2
+ # On AIX/PPC, the GNU linker is very broken
+ if test "$host_cpu" != ia64; then
+ ld_shlibs=no
+ cat <<EOF 1>&2
*** Warning: the GNU linker, at least up to release 2.9.1, is reported
*** to be unable to reliably create shared libraries on AIX.
@@ -69,6 +70,7 @@ if test "$with_gnu_ld" = yes; then
*** so that a non-GNU linker is found, and then restart.
EOF
+ fi
;;
amigaos*)
@@ -108,7 +110,7 @@ EOF
test -f $output_objdir/impgen.exe || (cd $output_objdir && \
if test "x$HOST_CC" != "x" ; then $HOST_CC -o impgen impgen.c ; \
else $CC -o impgen impgen.c ; fi)~
- $output_objdir/impgen $dir/$soname > $output_objdir/$soname-def'
+ $output_objdir/impgen $dir/$soroot > $output_objdir/$soname-def'
old_archive_from_expsyms_cmds='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib'
@@ -117,7 +119,7 @@ EOF
# FIXME: what about values for MSVC?
dll_entry=__cygwin_dll_entry@12
dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12~
- case "$host_os" in
+ case $host_os in
mingw*)
# mingw values
dll_entry=_DllMainCRTStartup@12
@@ -148,23 +150,39 @@ EOF
$DLLTOOL --export-all --exclude-symbols '$dll_exclude_symbols' --output-def $output_objdir/$soname-def '$ltdll_obj'$libobjs $convenience~
sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]*//" -e "s/ *;.*$//" < $output_objdir/$soname-def > $export_symbols'
+ # If the export-symbols file already is a .def file (1st line
+ # is EXPORTS), use it as is.
# If DATA tags from a recent dlltool are present, honour them!
- archive_expsym_cmds='echo EXPORTS > $output_objdir/$soname-def~
- _lt_hint=1;
- cat $export_symbols | while read symbol; do
- set dummy \$symbol;
- case \$# in
- 2) echo " \$2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;;
- *) echo " \$2 @ \$_lt_hint \$3 ; " >> $output_objdir/$soname-def;;
- esac;
- _lt_hint=`expr 1 + \$_lt_hint`;
- done~
+ archive_expsym_cmds='if test "x`head -1 $export_symbols`" = xEXPORTS; then
+ cp $export_symbols $output_objdir/$soname-def;
+ else
+ echo EXPORTS > $output_objdir/$soname-def;
+ _lt_hint=1;
+ cat $export_symbols | while read symbol; do
+ set dummy \$symbol;
+ case \[$]# in
+ 2) echo " \[$]2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;;
+ *) echo " \[$]2 @ \$_lt_hint \[$]3 ; " >> $output_objdir/$soname-def;;
+ esac;
+ _lt_hint=`expr 1 + \$_lt_hint`;
+ done;
+ fi~
'"$ltdll_cmds"'
- $CC -Wl,--base-file,$output_objdir/$soname-base '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $lib '$ltdll_obj'$libobjs $deplibs $compiler_flags~
- $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp~
- $CC -Wl,--base-file,$output_objdir/$soname-base $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $lib '$ltdll_obj'$libobjs $deplibs $compiler_flags~
+ $CC -Wl,--base-file,$output_objdir/$soname-base '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~
$DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp~
- $CC $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $lib '$ltdll_obj'$libobjs $deplibs $compiler_flags'
+ $CC -Wl,--base-file,$output_objdir/$soname-base $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~
+ $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp --output-lib $output_objdir/$libname.dll.a~
+ $CC $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags'
+ ;;
+
+ darwin* | rhapsody*)
+ allow_undefined_flag='-undefined suppress'
+ archive_cmds='$CC `test .$module = .yes && echo -bundle || echo -dynamiclib` $allow_undefined_flag -o $lib $libobjs $deplibs $linkopts -install_name $rpath/$soname `test -n "$verstring" -a x$verstring != x0.0 && echo $verstring`'
+ # We need to add '_' to the symbols in $export_symbols first
+ #archive_expsym_cmds="$archive_cmds"' && strip -s $export_symbols'
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ whole_archive_flag_spec='-all_load $convenience'
;;
netbsd*)
@@ -172,8 +190,8 @@ EOF
archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
wlarc=
else
- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ archive_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
fi
;;
@@ -207,9 +225,8 @@ EOF
*)
if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${allow_undefined_flag} ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${allow_undefined_flag} ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- no_undefined_flag='${wl}--no-undefined'
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
else
ld_shlibs=no
fi
@@ -237,7 +254,7 @@ EOF
fi
else
# PORTME fill in a description of your system's linker (not GNU ld)
- case "$host_os" in
+ case $host_os in
aix3*)
allow_undefined_flag=unsupported
always_export_symbols=yes
@@ -253,43 +270,93 @@ else
;;
aix4* | aix5*)
- hardcode_libdir_flag_spec='${wl}-b ${wl}nolibpath ${wl}-b ${wl}libpath:$libdir:/usr/lib:/lib'
+ hardcode_direct=yes
hardcode_libdir_separator=':'
+ link_all_deplibs=yes
+ # When large executables or shared objects are built, AIX ld can
+ # have problems creating the table of contents. If linking a library
+ # or program results in "error TOC overflow" add -mminimal-toc to
+ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
+ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
if test "$with_gcc" = yes; then
- collect2name=`${CC} -print-prog-name=collect2`
- if test -f "$collect2name" && \
- strings "$collect2name" | grep resolve_lib_name >/dev/null
- then
- # We have reworked collect2
- hardcode_direct=yes
+ case $host_os in aix4.[012]|aix4.[012].*)
+ # We only want to do this on AIX 4.2 and lower, the check
+ # below for broken collect2 doesn't work under 4.3+
+ collect2name=`${CC} -print-prog-name=collect2`
+ if test -f "$collect2name" && \
+ strings "$collect2name" | grep resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ hardcode_direct=yes
+ else
+ # We have old collect2
+ hardcode_direct=unsupported
+ # It fails to find uninstalled libraries when the uninstalled
+ # path is not listed in the libpath. Setting hardcode_minus_L
+ # to unsupported forces relinking
+ hardcode_minus_L=yes
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_libdir_separator=
+ fi
+ esac
+ shared_flag='-shared'
+ else
+ # not using gcc
+ if test "$host_cpu" = ia64; then
+ shared_flag='${wl}-G'
else
- # We have old collect2
- hardcode_direct=unsupported
- # It fails to find uninstalled libraries when the uninstalled
- # path is not listed in the libpath. Setting hardcode_minus_L
- # to unsupported forces relinking
- hardcode_minus_L=yes
- hardcode_libdir_flag_spec='-L$libdir'
- hardcode_libdir_separator=
+ shared_flag='${wl}-bM:SRE'
+ fi
+ fi
+
+ if test "$host_cpu" = ia64; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ if test $with_gnu_ld = no; then
+ exp_sym_flag='-Bexport'
+ no_entry_flag=""
fi
- shared_flag='-shared'
else
- shared_flag='${wl}-bM:SRE'
- hardcode_direct=yes
+ # Test if we are trying to use run time linking, or normal AIX style linking.
+ # If -brtl is somewhere in LDFLAGS, we need to do run time linking.
+ aix_use_runtimelinking=no
+ for ld_flag in $LDFLAGS; do
+ if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl" ); then
+ aix_use_runtimelinking=yes
+ break
+ fi
+ done
+ exp_sym_flag='-bexport'
+ no_entry_flag='-bnoentry'
fi
- allow_undefined_flag=' ${wl}-berok'
- archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
# -bexpall does not export symbols beginning with underscore (_)
always_export_symbols=yes
- # Exported symbols can be pulled into shared objects from archives
- whole_archive_flag_spec=' '
- build_libtool_need_lc=yes
-
- # We don't want to build shared libraries on unknown CPU types.
- case $host_cpu in
- powerpc | rs6000) ;;
- *) ld_shlibs=no ;;
- esac
+ if test "$aix_use_runtimelinking" = yes; then
+ # Warning - without using the other run time loading flags (-brtl), -berok will
+ # link without error, but may produce a broken library.
+ allow_undefined_flag=' ${wl}-berok'
+ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib'
+ archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+ else
+ if test "$host_cpu" = ia64; then
+ if test $with_gnu_ld = no; then
+ hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
+ allow_undefined_flag="-z nodefs"
+ archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+ fi
+ else
+ allow_undefined_flag=' ${wl}-berok'
+ # -bexpall does not export symbols beginning with underscore (_)
+ always_export_symbols=yes
+ # Exported symbols can be pulled into shared objects from archives
+ whole_archive_flag_spec=' '
+ build_libtool_need_lc=yes
+ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib'
+ # This is similar to how AIX traditionally builds it's shared libraries.
+ archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ fi
+ fi
;;
amigaos*)
@@ -315,7 +382,7 @@ else
old_archive_from_new_cmds='true'
# FIXME: Should let the user specify the lib program.
old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs'
- fix_srcfile_path='`cygpath -w $srcfile`'
+ fix_srcfile_path='`cygpath -w "$srcfile"`'
;;
freebsd1*)
@@ -350,10 +417,17 @@ else
;;
hpux9* | hpux10* | hpux11*)
- case "$host_os" in
- hpux9*) archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' ;;
- *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;;
- esac
+ if test $with_gcc = yes; then
+ case "$host_os" in
+ hpux9*) archive_cmds='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' ;;
+ *) archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;;
+ esac
+ else
+ case $host_os in
+ hpux9*) archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' ;;
+ *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;;
+ esac
+ fi
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
hardcode_libdir_separator=:
hardcode_direct=yes
@@ -379,8 +453,16 @@ else
else
archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
fi
- hardcode_libdir_flag_spec='${wl}-R$libdir'
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ newsos6)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
hardcode_direct=yes
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
hardcode_shlibpath_var=no
;;
@@ -415,11 +497,16 @@ else
if test "$with_gcc" = yes; then
allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
else
allow_undefined_flag=' -expect_unresolved \*'
archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
+ archive_expsym_cmds='for i in `cat $export_symbols`; do printf "-exported_symbol " >> $lib.exp; echo "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
+ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp'
+
+ # cc supports -rpath directly
+ hardcode_libdir_flag_spec='-rpath $libdir'
fi
- hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
hardcode_libdir_separator=:
;;
@@ -431,7 +518,7 @@ else
;;
solaris*)
- no_undefined_flag=' -z text'
+ no_undefined_flag=' -z defs'
if test "$with_gcc" = yes; then
archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
@@ -443,7 +530,7 @@ else
fi
hardcode_libdir_flag_spec='-R$libdir'
hardcode_shlibpath_var=no
- case "$host_os" in
+ case $host_os in
solaris2.[0-5] | solaris2.[0-5].*) ;;
*) # Supported since Solaris 2.6 (maybe 2.5.1?)
whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;;
@@ -515,8 +602,13 @@ else
runpath_var=LD_RUN_PATH
;;
- unixware7*)
- archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ sysv5uw7* | unixware7*)
+ no_undefined_flag='${wl}-z ${wl}text'
+ if test "$GCC" = yes; then
+ archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
runpath_var='LD_RUN_PATH'
hardcode_shlibpath_var=no
;;
@@ -542,33 +634,38 @@ else
ac_cv_prog_cc_wl='-Wl,'
ac_cv_prog_cc_static='-static'
- case "$host_os" in
- beos* | irix5* | irix6* | osf3* | osf4* | osf5*)
- # PIC is the default for these OSes.
- ;;
+ case $host_os in
aix*)
- # Below there is a dirty hack to force normal static linking with -ldl
- # The problem is because libdl dynamically linked with both libc and
- # libC (AIX C++ library), which obviously doesn't included in libraries
- # list by gcc. This cause undefined symbols with -static flags.
- # This hack allows C programs to be linked with "-static -ldl", but
- # we not sure about C++ programs.
- ac_cv_prog_cc_static="$ac_cv_prog_cc_static ${ac_cv_prog_cc_wl}-lC"
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ lt_cv_prog_cc_static='-Bstatic'
+ else
+ lt_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp'
+ fi
;;
- *djgpp*)
- # DJGPP does not support shared libraries at all
- ac_cv_prog_cc_pic=
+ amigaos*)
+ # FIXME: we need at least 68020 code to build shared libraries, but
+ # adding the `-m68020' flag to GCC prevents building anything better,
+ # like `-m68040'.
+ ac_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4'
+ ;;
+ beos* | irix5* | irix6* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
;;
cygwin* | mingw* | os2*)
# This hack is so that the source file can tell whether it is being
# built for inclusion in a dll (and should export symbols for example).
ac_cv_prog_cc_pic='-DDLL_EXPORT'
;;
- amigaos*)
- # FIXME: we need at least 68020 code to build shared libraries, but
- # adding the `-m68020' flag to GCC prevents building anything better,
- # like `-m68040'.
- ac_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4'
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ lt_cv_prog_cc_pic='-fno-common'
+ ;;
+ *djgpp*)
+ # DJGPP does not support shared libraries at all
+ ac_cv_prog_cc_pic=
;;
sysv4*MP*)
if test -d /usr/nec; then
@@ -581,10 +678,10 @@ else
esac
else
# PORTME Check for PIC flags for the system compiler.
- case "$host_os" in
- aix3* | aix4* | aix5*)
+ case $host_os in
+ aix*)
# All AIX code is PIC.
- ac_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp'
+ ac_cv_prog_cc_static="$ac_cv_prog_cc_static ${ac_cv_prog_cc_wl}-lC"
;;
hpux9* | hpux10* | hpux11*)
@@ -606,6 +703,11 @@ else
ac_cv_prog_cc_pic='-DDLL_EXPORT'
;;
+ newsos6)
+ ac_cv_prog_cc_pic='-KPIC'
+ ac_cv_prog_cc_static='-Bstatic'
+ ;;
+
osf3* | osf4* | osf5*)
# All OSF/1 code is PIC.
ac_cv_prog_cc_wl='-Wl,'
@@ -667,7 +769,7 @@ fi
need_lc=yes
if test "$enable_shared" = yes && test "$with_gcc" = yes; then
- case "$archive_cmds" in
+ case $archive_cmds in
*'~'*)
# FIXME: we may have to deal with multi-command sequences.
;;
@@ -687,7 +789,7 @@ if test "$enable_shared" = yes && test "$with_gcc" = yes; then
cat conftest.err 1>&5
soname=conftest
lib=conftest
- libobjs=conftest.o
+ libobjs=conftest.$objext
deplibs=
wl=$ac_cv_prog_cc_wl
compiler_flags=-v
diff --git a/ltcf-cxx.sh b/ltcf-cxx.sh
index 068f15660f2..22875d06f18 100644
--- a/ltcf-cxx.sh
+++ b/ltcf-cxx.sh
@@ -73,9 +73,8 @@ if { ac_try='${CC-c++} -E conftest.$ac_ext'; { (eval echo \"$ac_try\") 1>&5; (ev
egrep 'GNU ld' > /dev/null; then
with_gnu_ld=yes
- archive_cmds='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${allow_undefined_flag} ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${allow_undefined_flag} ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- no_undefined_flag='${wl}--no-undefined'
+ archive_cmds='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
export_dynamic_flag_spec='${wl}--export-dynamic'
@@ -107,7 +106,7 @@ if { ac_try='${CC-c++} -E conftest.$ac_ext'; { (eval echo \"$ac_try\") 1>&5; (ev
# Commands to make compiler produce verbose output that lists
# what "hidden" libraries, object files and flags are used when
# linking a shared library.
- output_verbose_link_cmds='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep "\-L"'
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep "\-L"'
else
with_gcc=no
@@ -115,50 +114,114 @@ else
wlarc=
fi
-# In general, the C++ compiler should always link C++ objects.
-case $target in
-*aix3* | *aix4* | *aix5*)
- # AIX just has to be different, doesn't it? :-\
- LD=makeC++SharedLib_r
- LDFLAGS="$LDFLAGS -p 0"
- ;;
-*)
- LD="$CC"
- LDFLAGS="$LDFLAGS"
- ;;
-esac
-
-
# PORTME: fill in a description of your system's C++ link characteristics
-case "$host_os" in
+case $host_os in
aix3*)
# FIXME: insert proper C++ library support
ld_shlibs=no
;;
aix4* | aix5*)
- archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
- # -bexpall does not export symbols beginning with underscore (_)
+ archive_cmds=''
+ hardcode_direct=yes
+ hardcode_libdir_separator=':'
+ link_all_deplibs=yes
+ # When large executables or shared objects are built, AIX ld can
+ # have problems creating the table of contents. If linking a library
+ # or program results in "error TOC overflow" add -mminimal-toc to
+ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
+ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+ if test "$with_gcc" = yes; then
+ case $host_os in aix4.[012]|aix4.[012].*)
+ # We only want to do this on AIX 4.2 and lower, the check
+ # below for broken collect2 doesn't work under 4.3+
+ collect2name=`${CC} -print-prog-name=collect2`
+ if test -f "$collect2name" && \
+ strings "$collect2name" | grep resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ hardcode_direct=yes
+ else
+ # We have old collect2
+ hardcode_direct=unsupported
+ # It fails to find uninstalled libraries when the uninstalled
+ # path is not listed in the libpath. Setting hardcode_minus_L
+ # to unsupported forces relinking
+ hardcode_minus_L=yes
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_libdir_separator=
+ fi
+ esac
+ shared_flag='-shared'
+ else
+ # not using gcc
+ if test "$host_cpu" = ia64; then
+ shared_flag='${wl}-G'
+ else
+ shared_flag='${wl}-bM:SRE'
+ fi
+ fi
+
+ if test "$host_cpu" = ia64; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ if test $with_gnu_ld = no; then
+ exp_sym_flag='-Bexport'
+ no_entry_flag=""
+ fi
+ else
+ # Test if we are trying to use run time linking, or normal AIX style linking.
+ # If -brtl is somewhere in LDFLAGS, we need to do run time linking.
+ aix_use_runtimelinking=no
+ for ld_flag in $LDFLAGS; do
+ if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl" ); then
+ aix_use_runtimelinking=yes
+ break
+ fi
+ done
+ exp_sym_flag='-bexport'
+ no_entry_flag='-bnoentry'
+ fi
+ # It seems that -bexpall does not export symbols beginning with
+ # underscore (_), so it is better to generate a list of symbols to export.
always_export_symbols=yes
- # Exported symbols can be pulled into shared objects from archives
- whole_archive_flag_spec=' '
- build_libtool_need_lc=yes
-
- # We don't want to build shared libraries on unknown CPU types.
- case $host_cpu in
- powerpc | rs6000) ;;
- *) ld_shlibs=no ;;
- esac
+ if test "$aix_use_runtimelinking" = yes; then
+ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib'
+ allow_undefined_flag=' -Wl,-G'
+ archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}-brtl \${wl}$exp_sym_flag:\$export_symbols"
+ else
+ if test "$host_cpu" = ia64; then
+ if test $with_gnu_ld = no; then
+ hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
+ allow_undefined_flag="-z nodefs"
+ archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+ fi
+ else
+ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib'
+ # Warning - without using the other run time loading flags, -berok will
+ # link without error, but may produce a broken library.
+ no_undefined_flag=' ${wl}-bnoerok'
+ allow_undefined_flag=' ${wl}-berok'
+ # -bexpall does not export symbols beginning with underscore (_)
+ always_export_symbols=yes
+ # Exported symbols can be pulled into shared objects from archives
+ whole_archive_flag_spec=' '
+ build_libtool_need_lc=yes
+ # This is similar to how AIX traditionally builds it's shared libraries.
+ archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ fi
+ fi
;;
chorus*)
- case "$cc_basename" in
+ case $cc_basename in
*)
# FIXME: insert proper C++ library support
ld_shlibs=no
;;
- esac
+ esac
;;
dgux*)
- case "$cc_basename" in
+ case $cc_basename in
ec++)
# FIXME: insert proper C++ library support
ld_shlibs=no
@@ -183,24 +246,28 @@ case "$host_os" in
# conventions
ld_shlibs=yes
;;
+ gnu*)
+ ;;
hpux*)
- case "$cc_basename" in
+ if test $with_gnu_ld = no; then
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator=:
+ export_dynamic_flag_spec='${wl}-E'
+ fi
+ hardcode_direct=yes
+ hardcode_minus_L=yes # Not in the search PATH, but as the default
+ # location of the library.
+
+ case $cc_basename in
CC)
# FIXME: insert proper C++ library support
ld_shlibs=no
;;
aCC)
- case "$host_os" in
+ case $host_os in
hpux9*) archive_cmds='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' ;;
*) archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;;
esac
- hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
- hardcode_libdir_separator=:
- hardcode_direct=yes
- hardcode_minus_L=yes # Not in the search PATH, but as the default
- # location of the library.
- export_dynamic_flag_spec='${wl}-E'
-
# Commands to make compiler produce verbose output that lists
# what "hidden" libraries, object files and flags are used when
# linking a shared library.
@@ -209,16 +276,25 @@ case "$host_os" in
# explicitly linking system object files so we need to strip them
# from the output so that they don't get included in the library
# dependencies.
- output_verbose_link_cmds='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | egrep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | egrep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
;;
*)
- # FIXME: insert proper C++ library support
- ld_shlibs=no
+ if test $with_gcc = yes; then
+ if test $with_gnu_ld = no; then
+ case "$host_os" in
+ hpux9*) archive_cmds='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' ;;
+ *) archive_cmds='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;;
+ esac
+ fi
+ else
+ # FIXME: insert proper C++ library support
+ ld_shlibs=no
+ fi
;;
esac
;;
irix5* | irix6*)
- case "$cc_basename" in
+ case $cc_basename in
CC)
# SGI C++
archive_cmds='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
@@ -232,9 +308,9 @@ case "$host_os" in
*)
if test "$with_gcc" = yes; then
if test "$with_gnu_ld" = no; then
- archive_cmds='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
+ archive_cmds='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
else
- archive_cmds='$LD -shared $predep_objects $libobjs $deplibs $postdep_objects $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -o $lib'
+ archive_cmds='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -o $lib'
fi
fi
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
@@ -244,7 +320,7 @@ case "$host_os" in
esac
;;
linux*)
- case "$cc_basename" in
+ case $cc_basename in
KCC)
# Kuck and Associates, Inc. (KAI) C++ Compiler
@@ -262,7 +338,7 @@ case "$host_os" in
# explicitly linking system object files so we need to strip them
# from the output so that they don't get included in the library
# dependencies.
- output_verbose_link_cmds='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest.so 2>&1 | egrep "ld"`; rm -f libconftest.so; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+ output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest.so 2>&1 | egrep "ld"`; rm -f libconftest.so; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
hardcode_libdir_flag_spec='${wl}--rpath,$libdir'
export_dynamic_flag_spec='${wl}--export-dynamic'
@@ -288,7 +364,7 @@ case "$host_os" in
# explicitly linking system object files so we need to strip them
# from the output so that they don't get included in the library
# dependencies.
- output_verbose_link_cmds='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | sed "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | sed "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
;;
esac
;;
@@ -301,7 +377,7 @@ case "$host_os" in
ld_shlibs=no
;;
mvs*)
- case "$cc_basename" in
+ case $cc_basename in
cxx)
# FIXME: insert proper C++ library support
ld_shlibs=no
@@ -310,26 +386,13 @@ case "$host_os" in
# FIXME: insert proper C++ library support
ld_shlibs=no
;;
- esac
+ esac
;;
netbsd*)
# NetBSD uses g++ - do we need to do anything?
;;
osf3*)
- if test "$with_gcc" = yes && test "$with_gnu_ld" = no; then
- allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
- archive_cmds='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
-
- hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator=:
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- output_verbose_link_cmds='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep "\-L"'
- fi
-
- case "$cc_basename" in
+ case $cc_basename in
KCC)
# Kuck and Associates, Inc. (KAI) C++ Compiler
@@ -366,29 +429,29 @@ case "$host_os" in
# explicitly linking system object files so we need to strip them
# from the output so that they don't get included in the library
# dependencies.
- output_verbose_link_cmds='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | sed "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | sed "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
;;
*)
- # FIXME: insert proper C++ library support
- ld_shlibs=no
+ if test "$with_gcc" = yes && test "$with_gnu_ld" = no; then
+ allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+ archive_cmds='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
+
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep "\-L"'
+ else
+ # FIXME: insert proper C++ library support
+ ld_shlibs=no
+ fi
;;
esac
;;
osf4* | osf5*)
- if test "$with_gcc" = yes && test "$with_gnu_ld" = no; then
- allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
- archive_cmds='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
-
- hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator=:
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- output_verbose_link_cmds='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep "\-L"'
- fi
-
- case "$cc_basename" in
+ case $cc_basename in
KCC)
# Kuck and Associates, Inc. (KAI) C++ Compiler
@@ -410,10 +473,14 @@ case "$host_os" in
ld_shlibs=no
;;
cxx)
- allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
- archive_cmds='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
-
- hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ allow_undefined_flag=' -expect_unresolved \*'
+ archive_cmds='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
+ archive_expsym_cmds='for i in `cat $export_symbols`; do printf "-exported_symbol " >> $lib.exp; echo "\$i" >> $lib.exp; done~
+ echo "-hidden">> $lib.exp~
+ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry $objdir/so_locations -o $lib~
+ $rm $lib.exp'
+
+ hardcode_libdir_flag_spec='-rpath $libdir'
hardcode_libdir_separator=:
# Commands to make compiler produce verbose output that lists
@@ -424,11 +491,24 @@ case "$host_os" in
# explicitly linking system object files so we need to strip them
# from the output so that they don't get included in the library
# dependencies.
- output_verbose_link_cmds='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | sed "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | sed "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
;;
*)
- # FIXME: insert proper C++ library support
- ld_shlibs=no
+ if test "$with_gcc" = yes && test "$with_gnu_ld" = no; then
+ allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+ archive_cmds='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
+
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep "\-L"'
+ else
+ # FIXME: insert proper C++ library support
+ ld_shlibs=no
+ fi
;;
esac
;;
@@ -437,7 +517,7 @@ case "$host_os" in
ld_shlibs=no
;;
sco*)
- case "$cc_basename" in
+ case $cc_basename in
CC)
# FIXME: insert proper C++ library support
ld_shlibs=no
@@ -449,7 +529,7 @@ case "$host_os" in
esac
;;
sunos4*)
- case "$cc_basename" in
+ case $cc_basename in
CC)
# Sun C++ 4.x
# FIXME: insert proper C++ library support
@@ -467,17 +547,17 @@ case "$host_os" in
esac
;;
solaris*)
- case "$cc_basename" in
+ case $cc_basename in
CC)
# Sun C++ 4.2, 5.x and Centerline C++
- no_undefined_flag=' -ztext'
+ no_undefined_flag=' -zdefs'
archive_cmds='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
$CC -G${allow_undefined_flag} -nolib ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
hardcode_libdir_flag_spec='-R$libdir'
hardcode_shlibpath_var=no
- case "$host_os" in
+ case $host_os in
solaris2.[0-5] | solaris2.[0-5].*) ;;
*)
# The C++ compiler is used as linker so we must use $wl
@@ -497,7 +577,7 @@ case "$host_os" in
# explicitly linking system object files so we need to strip them
# from the output so that they don't get included in the library
# dependencies.
- output_verbose_link_cmds='templist=`$CC -G $CFLAGS -v conftest.$objext 2>&1 | egrep "\-R|\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+ output_verbose_link_cmd='templist=`$CC -G $CFLAGS -v conftest.$objext 2>&1 | egrep "\-R|\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
# Archives containing C++ object files must be created using
# "CC -xar", where "CC" is the Sun C++ compiler. This is
@@ -515,35 +595,36 @@ case "$host_os" in
*)
# GNU C++ compiler with Solaris linker
if test "$with_gcc" = yes && test "$with_gnu_ld" = no; then
+ no_undefined_flag=' ${wl}-z ${wl}defs'
if $CC --version | egrep -v '^2\.7' > /dev/null; then
- archive_cmds='$LD -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $linker_flags ${wl}-h $wl$soname -o $lib'
+ archive_cmds='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $linker_flags ${wl}-h $wl$soname -o $lib'
archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
- $LD -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags~$rm $lib.exp'
+ $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags~$rm $lib.exp'
# Commands to make compiler produce verbose output that lists
# what "hidden" libraries, object files and flags are used when
# linking a shared library.
- output_verbose_link_cmds="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep \"\-L\""
+ output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep \"\-L\""
else
# g++ 2.7 appears to require `-G' NOT `-shared' on this
# platform.
- archive_cmds='$LD -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $linker_flags ${wl}-h $wl$soname -o $lib'
+ archive_cmds='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $linker_flags ${wl}-h $wl$soname -o $lib'
archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
- $LD -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags~$rm $lib.exp'
+ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags~$rm $lib.exp'
# Commands to make compiler produce verbose output that lists
# what "hidden" libraries, object files and flags are used when
# linking a shared library.
- output_verbose_link_cmds="$CC -G $CFLAGS -v conftest.$objext 2>&1 | egrep \"\-L\""
+ output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | egrep \"\-L\""
fi
hardcode_libdir_flag_spec='${wl}-R $wl$libdir'
fi
;;
- esac
+ esac
;;
tandem*)
- case "$cc_basename" in
+ case $cc_basename in
NCC)
# NonStop-UX NCC 3.20
# FIXME: insert proper C++ library support
@@ -553,7 +634,7 @@ case "$host_os" in
# FIXME: insert proper C++ library support
ld_shlibs=no
;;
- esac
+ esac
;;
unixware*)
# FIXME: insert proper C++ library support
@@ -588,33 +669,38 @@ if test "$with_gcc" = yes; then
ac_cv_prog_cc_wl='-Wl,'
ac_cv_prog_cc_static='-static'
- case "$host_os" in
- beos* | irix5* | irix6* | osf3* | osf4* | osf5*)
- # PIC is the default for these OSes.
- ;;
+ case $host_os in
aix*)
- # Below there is a dirty hack to force normal static linking with -ldl
- # The problem is because libdl dynamically linked with both libc and
- # libC (AIX C++ library), which obviously doesn't included in libraries
- # list by gcc. This cause undefined symbols with -static flags.
- # This hack allows C programs to be linked with "-static -ldl", but
- # we not sure about C++ programs.
- ac_cv_prog_cc_static="$ac_cv_prog_cc_static ${ac_cv_prog_cc_wl}-lC"
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ lt_cv_prog_cc_static='-Bstatic'
+ else
+ lt_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp'
+ fi
;;
- *djgpp*)
- # DJGPP does not support shared libraries at all
- ac_cv_prog_cc_pic=
+ amigaos*)
+ # FIXME: we need at least 68020 code to build shared libraries, but
+ # adding the `-m68020' flag to GCC prevents building anything better,
+ # like `-m68040'.
+ ac_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4'
+ ;;
+ beos* | irix5* | irix6* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
;;
cygwin* | mingw* | os2*)
# This hack is so that the source file can tell whether it is being
# built for inclusion in a dll (and should export symbols for example).
ac_cv_prog_cc_pic='-DDLL_EXPORT'
;;
- amigaos*)
- # FIXME: we need at least 68020 code to build shared libraries, but
- # adding the `-m68020' flag to GCC prevents building anything better,
- # like `-m68040'.
- ac_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4'
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ lt_cv_prog_cc_pic='-fno-common'
+ ;;
+ *djgpp*)
+ # DJGPP does not support shared libraries at all
+ ac_cv_prog_cc_pic=
;;
sysv4*MP*)
if test -d /usr/nec; then
@@ -626,20 +712,26 @@ if test "$with_gcc" = yes; then
;;
esac
else
- case "$host_os" in
+ case $host_os in
aix4* | aix5*)
# All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ lt_cv_prog_cc_static='-Bstatic'
+ else
+ lt_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp'
+ fi
;;
chorus*)
- case "$cc_basename" in
+ case $cc_basename in
cxch68)
# Green Hills C++ Compiler
# ac_cv_prog_cc_static="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
;;
- esac
+ esac
;;
dgux*)
- case "$cc_basename" in
+ case $cc_basename in
ec++)
ac_cv_prog_cc_pic='-KPIC'
;;
@@ -654,8 +746,10 @@ else
freebsd*)
# FreeBSD uses GNU C++
;;
+ gnu*)
+ ;;
hpux9* | hpux10* | hpux11*)
- case "$cc_basename" in
+ case $cc_basename in
CC)
ac_cv_prog_cc_wl='-Wl,'
ac_cv_prog_cc_static="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
@@ -671,7 +765,7 @@ else
esac
;;
irix5* | irix6*)
- case "$cc_basename" in
+ case $cc_basename in
CC)
ac_cv_prog_cc_wl='-Wl,'
ac_cv_prog_cc_static='-non_shared'
@@ -682,7 +776,7 @@ else
esac
;;
linux*)
- case "$cc_basename" in
+ case $cc_basename in
KCC)
# KAI C++ Compiler
ac_cv_prog_cc_wl='--backend -Wl,'
@@ -704,18 +798,18 @@ else
m88k*)
;;
mvs*)
- case "$cc_basename" in
+ case $cc_basename in
cxx)
ac_cv_prog_cc_pic='-W c,exportall'
;;
*)
;;
- esac
+ esac
;;
netbsd*)
;;
osf3* | osf4* | osf5*)
- case "$cc_basename" in
+ case $cc_basename in
KCC)
ac_cv_prog_cc_wl='--backend -Wl,'
;;
@@ -738,7 +832,7 @@ else
psos*)
;;
sco*)
- case "$cc_basename" in
+ case $cc_basename in
CC)
ac_cv_prog_cc_pic='-fPIC'
;;
@@ -747,7 +841,7 @@ else
esac
;;
solaris*)
- case "$cc_basename" in
+ case $cc_basename in
CC)
# Sun C++ 4.2, 5.x and Centerline C++
ac_cv_prog_cc_pic='-KPIC'
@@ -760,10 +854,10 @@ else
;;
*)
;;
- esac
+ esac
;;
sunos4*)
- case "$cc_basename" in
+ case $cc_basename in
CC)
# Sun C++ 4.x
ac_cv_prog_cc_pic='-pic'
@@ -778,14 +872,14 @@ else
esac
;;
tandem*)
- case "$cc_basename" in
+ case $cc_basename in
NCC)
# NonStop-UX NCC 3.20
ac_cv_prog_cc_pic='-KPIC'
;;
*)
;;
- esac
+ esac
;;
unixware*)
;;
@@ -830,7 +924,7 @@ if (eval $ac_compile) 2>&5; then
# the conftest object file.
pre_test_object_deps_done=no
- for p in `eval $output_verbose_link_cmds`; do
+ for p in `eval $output_verbose_link_cmd`; do
case $p in
diff --git a/ltcf-gcj.sh b/ltcf-gcj.sh
index fe96fe704d9..7be87123642 100644
--- a/ltcf-gcj.sh
+++ b/ltcf-gcj.sh
@@ -41,7 +41,7 @@ lt_simple_compile_test_code="class foo {}"
lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }'
## Linker Characteristics
-case "$host_os" in
+case $host_os in
cygwin* | mingw*)
# FIXME: the MSVC++ port hasn't been tested in a loooong time
# When not using gcc, we currently assume that we are using
@@ -59,11 +59,12 @@ if test "$with_gnu_ld" = yes; then
wlarc='${wl}'
# See if GNU ld supports shared libraries.
- case "$host_os" in
- aix3* | aix4*)
- # On AIX, the GNU linker is very broken
- ld_shlibs=no
- cat <<EOF 1>&2
+ case $host_os in
+ aix3* | aix4* | aix5*)
+ # On AIX/PPC, the GNU linker is very broken
+ if test "$host_cpu" != ia64; then
+ ld_shlibs=no
+ cat <<EOF 1>&2
*** Warning: the GNU linker, at least up to release 2.9.1, is reported
*** to be unable to reliably create shared libraries on AIX.
@@ -72,6 +73,7 @@ if test "$with_gnu_ld" = yes; then
*** so that a non-GNU linker is found, and then restart.
EOF
+ fi
;;
amigaos*)
@@ -111,7 +113,7 @@ EOF
test -f $output_objdir/impgen.exe || (cd $output_objdir && \
if test "x$HOST_CC" != "x" ; then $HOST_CC -o impgen impgen.c ; \
else $CC -o impgen impgen.c ; fi)~
- $output_objdir/impgen $dir/$soname > $output_objdir/$soname-def'
+ $output_objdir/impgen $dir/$soroot > $output_objdir/$soname-def'
old_archive_from_expsyms_cmds='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib'
@@ -120,7 +122,7 @@ EOF
# FIXME: what about values for MSVC?
dll_entry=__cygwin_dll_entry@12
dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12~
- case "$host_os" in
+ case $host_os in
mingw*)
# mingw values
dll_entry=_DllMainCRTStartup@12
@@ -151,23 +153,29 @@ EOF
$DLLTOOL --export-all --exclude-symbols '$dll_exclude_symbols' --output-def $output_objdir/$soname-def '$ltdll_obj'$libobjs $convenience~
sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]*//" -e "s/ *;.*$//" < $output_objdir/$soname-def > $export_symbols'
+ # If the export-symbols file already is a .def file (1st line
+ # is EXPORTS), use it as is.
# If DATA tags from a recent dlltool are present, honour them!
- archive_expsym_cmds='echo EXPORTS > $output_objdir/$soname-def~
- _lt_hint=1;
- cat $export_symbols | while read symbol; do
- set dummy \$symbol;
- case \$# in
- 2) echo " \$2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;;
- *) echo " \$2 @ \$_lt_hint \$3 ; " >> $output_objdir/$soname-def;;
- esac;
- _lt_hint=`expr 1 + \$_lt_hint`;
- done~
+ archive_expsym_cmds='if test "x`head -1 $export_symbols`" = xEXPORTS; then
+ cp $export_symbols $output_objdir/$soname-def;
+ else
+ echo EXPORTS > $output_objdir/$soname-def;
+ _lt_hint=1;
+ cat $export_symbols | while read symbol; do
+ set dummy \$symbol;
+ case \[$]# in
+ 2) echo " \[$]2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;;
+ *) echo " \[$]2 @ \$_lt_hint \[$]3 ; " >> $output_objdir/$soname-def;;
+ esac;
+ _lt_hint=`expr 1 + \$_lt_hint`;
+ done;
+ fi~
'"$ltdll_cmds"'
- $CC -Wl,--base-file,$output_objdir/$soname-base '$lt_cv_gcj_dll_switch' -Wl,-e,'$dll_entry' -o $lib '$ltdll_obj'$libobjs $deplibs $compiler_flags~
+ $CC -Wl,--base-file,$output_objdir/$soname-base '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~
$DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp~
- $CC -Wl,--base-file,$output_objdir/$soname-base $output_objdir/$soname-exp '$lt_cv_gcj_dll_switch' -Wl,-e,'$dll_entry' -o $lib '$ltdll_obj'$libobjs $deplibs $compiler_flags~
- $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp~
- $CC $output_objdir/$soname-exp '$lt_cv_gcj_dll_switch' -Wl,-e,'$dll_entry' -o $lib '$ltdll_obj'$libobjs $deplibs $compiler_flags'
+ $CC -Wl,--base-file,$output_objdir/$soname-base $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~
+ $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp --output-lib $output_objdir/$libname.dll.a~
+ $CC $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags'
;;
netbsd*)
@@ -175,8 +183,8 @@ EOF
archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
wlarc=
else
- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ archive_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
fi
;;
@@ -239,7 +247,7 @@ EOF
fi
else
# PORTME fill in a description of your system's linker (not GNU ld)
- case "$host_os" in
+ case $host_os in
aix3*)
allow_undefined_flag=unsupported
always_export_symbols=yes
@@ -254,45 +262,95 @@ else
fi
;;
- aix4*)
- hardcode_libdir_flag_spec='${wl}-b ${wl}nolibpath ${wl}-b ${wl}libpath:$libdir:/usr/lib:/lib'
+ aix4* | aix5*)
+ hardcode_direct=yes
hardcode_libdir_separator=':'
+ link_all_deplibs=yes
+ # When large executables or shared objects are built, AIX ld can
+ # have problems creating the table of contents. If linking a library
+ # or program results in "error TOC overflow" add -mminimal-toc to
+ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
+ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
if test "$with_gcc" = yes; then
- collect2name=`${CC} -print-prog-name=collect2`
- if test -f "$collect2name" && \
- strings "$collect2name" | grep resolve_lib_name >/dev/null
- then
- # We have reworked collect2
- hardcode_direct=yes
- else
- # We have old collect2
- hardcode_direct=unsupported
- # It fails to find uninstalled libraries when the uninstalled
- # path is not listed in the libpath. Setting hardcode_minus_L
- # to unsupported forces relinking
- hardcode_minus_L=yes
- hardcode_libdir_flag_spec='-L$libdir'
- hardcode_libdir_separator=
- fi
+ case $host_os in aix4.[012]|aix4.[012].*)
+ # We only want to do this on AIX 4.2 and lower, the check
+ # below for broken collect2 doesn't work under 4.3+
+ collect2name=`${CC} -print-prog-name=collect2`
+ if test -f "$collect2name" && \
+ strings "$collect2name" | grep resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ hardcode_direct=yes
+ else
+ # We have old collect2
+ hardcode_direct=unsupported
+ # It fails to find uninstalled libraries when the uninstalled
+ # path is not listed in the libpath. Setting hardcode_minus_L
+ # to unsupported forces relinking
+ hardcode_minus_L=yes
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_libdir_separator=
+ fi
+ esac
shared_flag='-shared'
else
- shared_flag='${wl}-bM:SRE'
- hardcode_direct=yes
+ # not using gcc
+ if test "$host_cpu" = ia64; then
+ shared_flag='${wl}-G'
+ else
+ shared_flag='${wl}-bM:SRE'
+ fi
fi
- allow_undefined_flag=' ${wl}-berok'
- archive_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bexpall ${wl}-bnoentry${allow_undefined_flag}'
- archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}'
- case "$host_os" in aix4.[01]|aix4.[01].*)
- # According to Greg Wooledge, -bexpall is only supported from AIX 4.2 on
- always_export_symbols=yes ;;
- esac
- # We don't want to build shared libraries on unknown CPU types.
- case $host_cpu in
- powerpc | rs6000) ;;
- *) ld_shlibs=no ;;
- esac
- ;;
+ if test "$host_cpu" = ia64; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ if test $with_gnu_ld = no; then
+ exp_sym_flag='-Bexport'
+ no_entry_flag=""
+ fi
+ else
+ # Test if we are trying to use run time linking, or normal AIX style linking.
+ # If -brtl is somewhere in LDFLAGS, we need to do run time linking.
+ aix_use_runtimelinking=no
+ for ld_flag in $LDFLAGS; do
+ if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl" ); then
+ aix_use_runtimelinking=yes
+ break
+ fi
+ done
+ exp_sym_flag='-bexport'
+ no_entry_flag='-bnoentry'
+ fi
+ # -bexpall does not export symbols beginning with underscore (_)
+ always_export_symbols=yes
+ if test "$aix_use_runtimelinking" = yes; then
+ # Warning - without using the other run time loading flags (-brtl), -berok will
+ # link without error, but may produce a broken library.
+ allow_undefined_flag=' ${wl}-berok'
+ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib'
+ archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+ else
+ if test "$host_cpu" = ia64; then
+ if test $with_gnu_ld = no; then
+ hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
+ allow_undefined_flag="-z nodefs"
+ archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+ fi
+ else
+ allow_undefined_flag=' ${wl}-berok'
+ # -bexpall does not export symbols beginning with underscore (_)
+ always_export_symbols=yes
+ # Exported symbols can be pulled into shared objects from archives
+ whole_archive_flag_spec=' '
+ build_libtool_need_lc=yes
+ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib'
+ # This is similar to how AIX traditionally builds it's shared libraries.
+ archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ fi
+ fi
+ ;;
amigaos*)
archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
@@ -317,7 +375,7 @@ else
old_archive_from_new_cmds='true'
# FIXME: Should let the user specify the lib program.
old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs'
- fix_srcfile_path='`cygpath -w $srcfile`'
+ fix_srcfile_path='`cygpath -w "$srcfile"`'
;;
freebsd1*)
@@ -352,7 +410,7 @@ else
;;
hpux9* | hpux10* | hpux11*)
- case "$host_os" in
+ case $host_os in
hpux9*) archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' ;;
*) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;;
esac
@@ -379,7 +437,7 @@ else
if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
else
- archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
+ archive_cmds='$LD -shared -nodefaultlibs -o $lib $libobjs $deplibs $linker_flags' # ELF
fi
hardcode_libdir_flag_spec='${wl}-R$libdir'
hardcode_direct=yes
@@ -433,18 +491,22 @@ else
;;
solaris*)
- no_undefined_flag=' -z text'
- # $CC -shared without GNU ld will not create a library from C++
- # object files and a static libstdc++, better avoid it by now
- archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ no_undefined_flag=' ${wl}-z ${wl}defs'
+ archive_cmds='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $linker_flags ${wl}-h $wl$soname -o $lib'
archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
- $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
- hardcode_libdir_flag_spec='-R$libdir'
+ $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags~$rm $lib.exp'
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmds="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep \"\-L\""
+
+ hardcode_libdir_flag_spec='${wl}-R $wl$libdir'
hardcode_shlibpath_var=no
- case "$host_os" in
+ case $host_os in
solaris2.[0-5] | solaris2.[0-5].*) ;;
*) # Supported since Solaris 2.6 (maybe 2.5.1?)
- whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;;
+ whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;;
esac
link_all_deplibs=yes
;;
@@ -513,8 +575,13 @@ else
runpath_var=LD_RUN_PATH
;;
- unixware7*)
- archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ sysv5uw7* | unixware7*)
+ no_undefined_flag='${wl}-z ${wl}text'
+ if test "$GCC" = yes; then
+ archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
runpath_var='LD_RUN_PATH'
hardcode_shlibpath_var=no
;;
@@ -539,7 +606,7 @@ fi
ac_cv_prog_cc_wl='-Wl,'
ac_cv_prog_cc_static='-static'
- case "$host_os" in
+ case $host_os in
beos* | irix5* | irix6* | osf3* | osf4* | osf5*)
# PIC is the default for these OSes.
;;
@@ -553,7 +620,7 @@ fi
ac_cv_prog_cc_static="$ac_cv_prog_cc_static ${ac_cv_prog_cc_wl}-lC"
;;
*djgpp*)
- # DJGPP does not support shared libraries at all
+ # DJGPP does not suppot shared libraries at all
ac_cv_prog_cc_pic=
;;
cygwin* | mingw* | os2*)
@@ -579,3 +646,6 @@ fi
# GCJ did not exist at the time GCC didn't implicitly link libc in.
need_lc=no
+
+# All existing releases of GCJ support `-c -o'.
+lt_cv_compiler_c_o=yes
diff --git a/ltconfig b/ltconfig
index 889cf44af9c..746e15b932d 100755
--- a/ltconfig
+++ b/ltconfig
@@ -1,7 +1,8 @@
#! /bin/sh
# ltconfig - Create a system-specific libtool.
-# Copyright (C) 1996-2000 Free Software Foundation, Inc.
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
+# Free Software Foundation, Inc.
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
#
# This file is free software; you can redistribute it and/or modify it
@@ -180,8 +181,8 @@ progname=`$echo "X$0" | $Xsed -e 's%^.*/%%'`
# Constants:
PROGRAM=ltconfig
PACKAGE=libtool
-VERSION=1.4a
-TIMESTAMP=" (1.641.2.122 2000/09/30 05:27:52)"
+VERSION=1.4a-GCC3.0
+TIMESTAMP=" (1.641.2.256 2001/05/28 20:09:07 with GCC-local changes)"
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
rm="rm -f"
@@ -216,6 +217,7 @@ need_locks=yes
ac_ext=c
libext=a
cache_file=
+max_cmd_len=
## Dependencies to place before and after the object being linked:
predep_objects=
@@ -294,7 +296,7 @@ args=
prev=
for option
do
- case "$option" in
+ case $option in
-*=*) optarg=`echo "$option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
*) optarg= ;;
esac
@@ -306,7 +308,7 @@ do
continue
fi
- case "$option" in
+ case $option in
--help) cat <<EOM
Usage: $progname [OPTION]... LTMAIN [HOST]
@@ -422,8 +424,7 @@ fi
if test -n "$tagname"; then
# Check whether tagname contains only valid characters
- case `$echo "X$tagname" |
- $Xsed -e 's/[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]//g'` in
+ case `$echo "X$tagname" | $Xsed -e 's/[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]//g'` in
"") ;;
*)
echo "$progname: invalid tag name: $tagname" 1>&2
@@ -454,7 +455,7 @@ fi
ltconfig_args=
for arg
do
- case "$arg" in
+ case $arg in
*" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
ltconfig_args="$ltconfig_args '$arg'" ;;
*) ltconfig_args="$ltconfig_args $arg" ;;
@@ -537,7 +538,7 @@ if test "$verify_host" = yes; then
echo $ac_n "checking host system type""... $ac_c" 1>&6
host_alias=$host
- case "$host_alias" in
+ case $host_alias in
"")
# Force config.guess to use the C compiler.
# CC_FOR_BUILD overrides the CC variable in config.guess but I had
@@ -565,7 +566,7 @@ if test "$verify_host" = yes; then
echo $ac_n "checking build system type... $ac_c" 1>&6
build_alias=$build
- case "$build_alias" in
+ case $build_alias in
NONE)
case $nonopt in
NONE) build_alias=$host_alias ;;
@@ -600,12 +601,12 @@ host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
# Transform linux* to *-*-linux-gnu*, to support old configure scripts.
-case "$host_os" in
+case $host_os in
linux-gnu*) ;;
linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
esac
-case "$host_os" in
+case $host_os in
aix3*)
# AIX sometimes has problems with the GCC collect2 program. For some
# reason, if we set the COLLECT_NAMES environment variable, the problems
@@ -674,7 +675,7 @@ compiler="$2"
# in isolation, and that seeing it set (from the cache) indicates that
# the associated values are set (in the cache) correctly too.
echo $ac_n "checking for $compiler option to produce PIC... $ac_c" 1>&6
-echo "$progname:675:checking for $compiler option to produce PIC" 1>&5
+echo "$progname:678:checking for $compiler option to produce PIC" 1>&5
if test -z "$ac_cv_prog_cc_pic"; then
echo "$ac_t"none 1>&6
@@ -683,7 +684,7 @@ else
# Check to make sure the pic_flag actually works.
echo $ac_n "checking if $compiler PIC flag $ac_cv_prog_cc_pic works... $ac_c" 1>&6
- echo "$progname:684:checking that $compiler PIC flag $ac_cv_prog_cc_pic works." 1>&5
+ echo "$progname:687:checking that $compiler PIC flag $ac_cv_prog_cc_pic works." 1>&5
if test "X${ac_cv_prog_cc_pic_works+set}" = Xset && \
test "X${ac_cv_prog_cc_pic_works}" != X; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -693,11 +694,11 @@ else
echo $lt_simple_compile_test_code > conftest.$ac_ext
save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $ac_cv_prog_cc_pic -DPIC"
- if { (eval echo $progname:694: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.$objext; then
+ if { (eval echo $progname:697: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.$objext; then
# Append any warnings to the config.log.
cat conftest.err 1>&5
- case "$host_os" in
+ case $host_os in
hpux9* | hpux10* | hpux11*)
# On HP-UX, both CC and GCC only warn that PIC is supported... then
# they create non-PIC objects. So, if there were any warnings, we
@@ -745,7 +746,7 @@ if test -n "$ac_cv_prog_cc_shlib"; then
fi
echo $ac_n "checking if $compiler static flag $ac_cv_prog_cc_static works... $ac_c" 1>&6
-echo "$progname:746: checking if $compiler static flag $ac_cv_prog_cc_static works" >&5
+echo "$progname:749: checking if $compiler static flag $ac_cv_prog_cc_static works" >&5
if test "X${ac_cv_prog_cc_static_works+set}" = Xset && \
test "X${ac_cv_prog_cc_static_works}" != X; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -754,7 +755,7 @@ else
echo $lt_simple_link_test_code > conftest.$ac_ext
save_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS $ac_cv_prog_cc_static"
- if { (eval echo $progname:755: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+ if { (eval echo $progname:758: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
ac_cv_prog_cc_static_works=yes
else
ac_cv_prog_cc_static_works=no
@@ -775,47 +776,85 @@ link_static_flag="$ac_cv_prog_cc_static"
no_builtin_flag="$ac_cv_prog_cc_no_builtin"
can_build_shared="$ac_cv_prog_cc_can_build_shared"
+# find the maximum length of command line arguments
+echo "$progname:780: finding the maximum length of command line arguments" 1>&5
+echo $ac_n "finding the maximum length of command line arguments... $ac_c" 1>&6
+if test "${lt_cv_sys_max_cmd_len+set}" = set; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ i=0
+ testring="ABCD"
+ # If test is not a shell built-in, we'll probably end up computing a
+ # maximum length that is only half of the actual maximum length, but
+ # we can't tell.
+ while test "X"`$CONFIG_SHELL $0 --fallback-echo "X$testring" 2>/dev/null` \
+ = "XX$testring" &&
+ new_result=`expr "X$testring" : ".*" 2>&1` &&
+ lt_cv_sys_max_cmd_len=$new_result &&
+ test $i != 17 # 1/2 MB should be enough
+ do
+ i=`expr $i + 1`
+ testring=$testring$testring
+ done
+ testring=
+ # add a significant safety factor because C++ compilers can tack on massive amounts
+ # of additional arguments before passing them to the linker. 1/4 should be good.
+ len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len - $len`
+fi
+echo "$progname:@lineno@: result: $lt_cv_sys_max_cmd_len" 1>&5
+echo "${ac_t}$lt_cv_sys_max_cmd_len" 1>&6
+
+if test -n $lt_cv_sys_max_cmd_len ; then
+ max_cmd_len=$lt_cv_sys_max_cmd_len
+else
+ max_cmd_len=none
+fi
+
# Check to see if options -o and -c are simultaneously supported by compiler
echo $ac_n "checking if $compiler supports -c -o file.$objext... $ac_c" 1>&6
-$rm -r conftest 2>/dev/null
-mkdir conftest
-cd conftest
-$rm conftest*
-echo $lt_simple_compile_test_code > conftest.$ac_ext
-mkdir out
-# According to Tom Tromey, Ian Lance Taylor reported there are C compilers
-# that will create temporary files in the current directory regardless of
-# the output directory. Thus, making CWD read-only will cause this test
-# to fail, enabling locking or at least warning the user not to do parallel
-# builds.
-chmod -w .
-save_CFLAGS="$CFLAGS"
-CFLAGS="$CFLAGS -o out/conftest2.$objext"
-echo "$progname:792: checking if $compiler supports -c -o file.$objext" >&5
-if { (eval echo $progname:793: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$objext; then
-
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings
- if test -s out/conftest.err; then
- echo "$ac_t"no 1>&6
- compiler_c_o=no
- else
- echo "$ac_t"yes 1>&6
- compiler_c_o=yes
- fi
+if test "${lt_cv_compiler_c_o+set}" = set; then
+ echo $ac_n "(cached) $ac_c" 1>&6
else
- # Append any errors to the config.log.
- cat out/conftest.err 1>&5
- compiler_c_o=no
- echo "$ac_t"no 1>&6
-fi
-CFLAGS="$save_CFLAGS"
-chmod u+w .
-$rm conftest* out/*
-rmdir out
-cd ..
-rmdir conftest
-$rm -r conftest 2>/dev/null
+ $rm -r conftest 2>/dev/null
+ mkdir conftest
+ cd conftest
+ $rm conftest*
+ echo $lt_simple_compile_test_code > conftest.$ac_ext
+ mkdir out
+ # According to Tom Tromey, Ian Lance Taylor reported there are C compilers
+ # that will create temporary files in the current directory regardless of
+ # the output directory. Thus, making CWD read-only will cause this test
+ # to fail, enabling locking or at least warning the user not to do parallel
+ # builds.
+ chmod -w .
+ save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -o out/conftest2.$objext"
+ echo "$progname:833: checking if $compiler supports -c -o file.$objext" >&5
+ if { (eval echo $progname:834: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$objext; then
+
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test -s out/conftest.err; then
+ lt_cv_compiler_c_o=no
+ else
+ lt_cv_compiler_c_o=yes
+ fi
+ else
+ # Append any errors to the config.log.
+ cat out/conftest.err 1>&5
+ lt_cv_compiler_c_o=no
+ fi
+ CFLAGS="$save_CFLAGS"
+ chmod u+w .
+ $rm conftest* out/*
+ rmdir out
+ cd ..
+ rmdir conftest
+ $rm -r conftest 2>/dev/null
+fi
+compiler_c_o=$lt_cv_compiler_c_o
+echo "${ac_t}$compiler_c_o" 1>&6
# Check to see if we can do hard links to lock some files if needed
hard_links="nottested"
@@ -845,8 +884,8 @@ if test "$with_gcc" = yes; then
echo $lt_simple_compile_test_code > conftest.$ac_ext
save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.$ac_ext"
- echo "$progname:846: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
- if { (eval echo $progname:847: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.$objext; then
+ echo "$progname:887: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
+ if { (eval echo $progname:888: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.$objext; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings
@@ -915,6 +954,10 @@ else
echo "${ac_t}no" 1>&6
fi
+case $reload_flag in
+"" | " "*) ;;
+*) reload_flag=" $reload_flag" ;;
+esac
reload_cmds='$LD$reload_flag -o $output$reload_objs'
test -z "$deplibs_check_method" && deplibs_check_method=unknown
@@ -934,27 +977,64 @@ sys_lib_dlsearch_path_spec="/lib /usr/lib"
sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
echo $ac_n "checking dynamic linker characteristics... $ac_c" 1>&6
-case "$host_os" in
+case $host_os in
aix3*)
version_type=linux
library_names_spec='${libname}${release}.so$versuffix $libname.a'
shlibpath_var=LIBPATH
- # AIX has no versioning support, so we append a major version to the name.
+ # AIX 3 has no versioning support, so we append a major version to the name.
soname_spec='${libname}${release}.so$major'
;;
aix4* | aix5*)
version_type=linux
- # AIX has no versioning support, so currently we can not hardcode correct
- # soname into executable. Probably we can add versioning support to
- # collect2, so additional links can be useful in future.
- # We preserve .a as extension for shared libraries though AIX4.2
- # and later linker supports .so
- library_names_spec='${libname}${release}.a $libname.a'
- shlibpath_var=LIBPATH
- soname_spec='${libname}${release}.so$major.o'
- export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+ if test "$host_cpu" = ia64; then
+ # AIX 5 supports IA64
+ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
+ shlibpath_var=LD_LIBRARY_PATH
+ else
+ # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+ # soname into executable. Probably we can add versioning support to
+ # collect2, so additional links can be useful in future.
+ # We preserve .a as extension for shared libraries though AIX4.2
+ # and later linker supports .so
+ if test "$aix_use_runtimelinking" = yes; then
+ # If using run time linking (on AIX 4.2 or later) use lib<name>.so instead of
+ # lib<name>.a to let people know that these are not typical AIX shared libraries.
+ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
+ else
+ # We preserve .a as extension for shared libraries though AIX4.2
+ # and later when we are not doing run time linking.
+ library_names_spec='${libname}${release}.a $libname.a'
+ soname_spec='${libname}${release}.so$major'
+ fi
+ # If we're using GNU nm, then we don't want the "-C" option.
+ # -C means demangle to AIX nm, but means don't demangle with GNU nm
+ if $NM -V 2>&1 | egrep '(GNU)' > /dev/null; then
+ export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+ else
+ export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+ fi
+ shlibpath_var=LIBPATH
+ deplibs_check_method=pass_all
+ case $host_os in
+ aix4 | aix4.[01] | aix4.[01].*)
+ if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+ echo ' yes '
+ echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
+ :
+ else
+ # With GCC up to 2.95.x, collect2 would create an import file
+ # for dependence libraries. The import file would start with
+ # the line `#! .'. This would cause the generated library to
+ # depend on `.', always an invalid library. This was fixed in
+ # development snapshots of GCC prior to 3.0.
+ can_build_shared=no
+ fi
+ ;;
+ esac
+ fi
;;
amigaos*)
@@ -991,11 +1071,28 @@ cygwin* | mingw* | pw32*)
version_type=windows
need_version=no
need_lib_prefix=no
- if test "$with_gcc" = yes; then
+ case $with_gcc,$host_os in
+ yes,cygwin*)
+ library_names_spec='$libname.dll.a'
+ soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | [sed -e 's/[.]/-/g']`${versuffix}.dll'
+ postinstall_cmds='dlpath=`bash 2>&1 -c '\''. $dir/${file}i; echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog .libs/$dlname \$dldir/$dlname'
+ postuninstall_cmds='dldll=`bash 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll; $rm \$dlpath'
+ ;;
+ yes,mingw*)
library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll'
- else
+ sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://" -e "s/;/ /g"`
+ ;;
+ yes,pw32*)
+ library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll'
+;;
+ *)
library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.lib'
- fi
+ ;;
+ esac
dynamic_linker='Win32 ld.exe'
# FIXME: first we should search . and the directory the executable is in
shlibpath_var=PATH
@@ -1003,6 +1100,17 @@ cygwin* | mingw* | pw32*)
lt_cv_dlopen_libs=
;;
+darwin* | rhapsody*)
+ dynamic_linker="$host_os dyld"
+ version_type=darwin
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${versuffix}.`test .$module = .yes && echo so || echo dylib` ${libname}${release}${major}.$`test .$module = .yes && echo so || echo dylib` ${libname}.`test .$module = .yes && echo so || echo dylib`'
+ soname_spec='${libname}${release}${major}.`test .$module = .yes && echo so || echo dylib`'
+ shlibpath_overrides_runpath=yes
+ shlibpath_var=DYLD_LIBRARY_PATH
+ ;;
+
freebsd1*)
dynamic_linker=no
;;
@@ -1010,7 +1118,7 @@ freebsd1*)
freebsd*)
objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
version_type=freebsd-$objformat
- case "$version_type" in
+ case $version_type in
freebsd-elf*)
library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
need_version=no
@@ -1023,7 +1131,7 @@ freebsd*)
;;
esac
shlibpath_var=LD_LIBRARY_PATH
- case "$host_os" in
+ case $host_os in
freebsd2*)
shlibpath_overrides_runpath=yes
;;
@@ -1065,12 +1173,12 @@ irix5* | irix6*)
need_version=no
soname_spec='${libname}${release}.so$major'
library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so $libname.so'
- case "$host_os" in
+ case $host_os in
irix5*)
libsuff= shlibsuff=
;;
*)
- case "$LD" in # libtool.m4 will add one of these switches to LD
+ case $LD in # libtool.m4 will add one of these switches to LD
*-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;;
*-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;;
*-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;;
@@ -1114,6 +1222,8 @@ linux-gnu*)
;;
netbsd*)
+ need_lib_prefix=no
+ need_version=no
version_type=sunos
if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
@@ -1129,6 +1239,13 @@ netbsd*)
hardcode_into_libs=yes
;;
+newsos6)
+ version_type=linux
+ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
openbsd*)
version_type=sunos
if test "$with_gnu_ld" = yes; then
@@ -1195,7 +1312,7 @@ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
soname_spec='${libname}${release}.so$major'
shlibpath_var=LD_LIBRARY_PATH
- case "$host_vendor" in
+ case $host_vendor in
motorola)
need_lib_prefix=no
need_version=no
@@ -1256,7 +1373,7 @@ symxfrm='\1 \2\3 \3'
global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'"
# Define system-specific variables.
-case "$host_os" in
+case $host_os in
aix*)
symcode='[BCDT]'
;;
@@ -1264,7 +1381,7 @@ cygwin* | mingw* | pw32*)
symcode='[ABCDGISTW]'
;;
hpux*) # Its linker distinguishes data from code symbols
- global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^. .* \(.*\)$/extern char \1;/p'"
+ global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
;;
irix*)
symcode='[BCDEGRST]'
@@ -1279,7 +1396,7 @@ esac
# Handle CRLF in mingw tool chain
opt_cr=
-case "$host_os" in
+case $host_os in
mingw*)
opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
;;
@@ -1294,7 +1411,7 @@ fi
for ac_symprfx in "" "_"; do
# Write the raw and C identifiers.
-global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode\)[ ][ ]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'"
+ global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'"
# Check to see that the pipe works correctly.
pipe_works=no
@@ -1308,14 +1425,14 @@ void nm_test_func(){}
#ifdef __cplusplus
}
#endif
-main(){nm_test_var='a';nm_test_func();return(0);}
+int main(){nm_test_var='a';nm_test_func();return(0);}
EOF
- echo "$progname:1309: checking if global_symbol_pipe works" >&5
- if { (eval echo $progname:1310: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && test -s conftest.$objext; then
+ echo "$progname:1431: checking if global_symbol_pipe works" >&5
+ if { (eval echo $progname:1432: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && test -s conftest.$objext; then
# Now try to grab the symbols.
nlist=conftest.nm
- if { echo "$progname:1313: eval \"$NM conftest.$objext | $global_symbol_pipe > $nlist\"" >&5; eval "$NM conftest.$objext | $global_symbol_pipe > $nlist 2>&5"; } && test -s "$nlist"; then
+ if { echo "$progname:1435: eval \"$NM conftest.$objext | $global_symbol_pipe > $nlist\"" >&5; eval "$NM conftest.$objext | $global_symbol_pipe > $nlist 2>&5"; } && test -s "$nlist"; then
# Try sorting and uniquifying the output.
if sort "$nlist" | uniq > "$nlist"T; then
@@ -1352,7 +1469,7 @@ const struct {
lt_preloaded_symbols[] =
{
EOF
- sed 's/^. \(.*\) \(.*\)$/ {"\2", (lt_ptr_t) \&\2},/' < "$nlist" >> conftest.$ac_ext
+ sed "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" >> conftest.$ac_ext
cat <<\EOF >> conftest.$ac_ext
{0, (lt_ptr_t) 0}
};
@@ -1367,7 +1484,7 @@ EOF
save_CFLAGS="$CFLAGS"
LIBS="conftstm.$objext"
CFLAGS="$CFLAGS$no_builtin_flag"
- if { (eval echo $progname:1365: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+ if { (eval echo $progname:1487: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
pipe_works=yes
else
echo "$progname: failed program was:" >&5
@@ -1411,7 +1528,7 @@ echo "checking if libtool supports shared libraries... $can_build_shared" 1>&6
# Only try to build win32 dlls if AC_LIBTOOL_WIN32_DLL was used in
# configure.in, otherwise build static only libraries.
-case "$host_os" in
+case $host_os in
cygwin* | mingw* | pw32* | os2*)
if test x$can_build_shared = xyes; then
test x$enable_win32_dll = xno && can_build_shared=no
@@ -1425,7 +1542,7 @@ test "$can_build_shared" = "no" && enable_shared=no
# On AIX, shared libraries and static libraries use the same namespace, and
# are all built from PIC.
-case "$host_os" in
+case $host_os in
aix3*)
test "$enable_shared" = yes && enable_static=no
if test -n "$RANLIB"; then
@@ -1434,7 +1551,7 @@ aix3*)
fi
;;
-aix4* | aix5*)
+aix4*)
test "$enable_shared" = yes && enable_static=no
;;
esac
@@ -1471,14 +1588,14 @@ else
if test "X${lt_cv_dlopen+set}" != Xset; then
lt_cv_dlopen=no lt_cv_dlopen_libs=
echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
-echo "$progname:1469: checking for dlopen in -ldl" >&5
+echo "$progname:1591: checking for dlopen in -ldl" >&5
if test "X${ac_cv_lib_dl_dlopen+set}" = Xset; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
LIBS="-ldl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1476 "ltconfig"
+#line 1598 "ltconfig"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
@@ -1491,7 +1608,7 @@ int main() {
dlopen()
; return 0; }
EOF
-if { (eval echo $progname:1489: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo $progname:1611: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_lib_dl_dlopen=yes
else
@@ -1510,12 +1627,12 @@ if test "X$ac_cv_lib_dl_dlopen" = Xyes; then
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for dlopen""... $ac_c" 1>&6
-echo "$progname:1508: checking for dlopen" >&5
+echo "$progname:1630: checking for dlopen" >&5
if test "X${ac_cv_func_dlopen+set}" = Xset; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1513 "ltconfig"
+#line 1635 "ltconfig"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char dlopen(); below. */
#include <assert.h>
@@ -1540,7 +1657,7 @@ dlopen();
; return 0; }
EOF
-if { (eval echo $progname:1538: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo $progname:1660: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_func_dlopen=yes
else
@@ -1557,14 +1674,14 @@ if test "X$ac_cv_func_dlopen" = Xyes; then
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for dlopen in -lsvld""... $ac_c" 1>&6
-echo "$progname:1555: checking for dlopen in -lsvld" >&5
+echo "$progname:1677: checking for dlopen in -lsvld" >&5
if test "X${ac_cv_lib_svld_dlopen+set}" = Xset; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
LIBS="-lsvld $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1562 "ltconfig"
+#line 1684 "ltconfig"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
@@ -1577,7 +1694,7 @@ int main() {
dlopen()
; return 0; }
EOF
-if { (eval echo $progname:1575: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo $progname:1697: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_lib_svld_dlopen=yes
else
@@ -1596,14 +1713,14 @@ if test "X$ac_cv_lib_svld_dlopen" = Xyes; then
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for dld_link in -ldld""... $ac_c" 1>&6
-echo "$progname:1594: checking for dld_link in -ldld" >&5
+echo "$progname:1716: checking for dld_link in -ldld" >&5
if test "X${ac_cv_lib_dld_dld_link+set}" = Xset; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
LIBS="-ldld $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1601 "ltconfig"
+#line 1723 "ltconfig"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
@@ -1616,7 +1733,7 @@ int main() {
dld_link()
; return 0; }
EOF
-if { (eval echo $progname:1614: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo $progname:1736: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_lib_dld_dld_link=yes
else
@@ -1635,12 +1752,12 @@ if test "X$ac_cv_lib_dld_dld_link" = Xyes; then
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for shl_load""... $ac_c" 1>&6
-echo "$progname:1633: checking for shl_load" >&5
+echo "$progname:1755: checking for shl_load" >&5
if test "X${ac_cv_func_shl_load+set}" = Xset; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1638 "ltconfig"
+#line 1760 "ltconfig"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char shl_load(); below. */
#include <assert.h>
@@ -1665,7 +1782,7 @@ shl_load();
; return 0; }
EOF
-if { (eval echo $progname:1663: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo $progname:1785: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_func_shl_load=yes
else
@@ -1683,14 +1800,14 @@ if test "X$ac_cv_func_shl_load" = Xyes; then
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6
-echo "$progname:1681: checking for shl_load in -ldld" >&5
+echo "$progname:1803: checking for shl_load in -ldld" >&5
if test "X${ac_cv_lib_dld_shl_load+set}" = Xset; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
LIBS="-ldld $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1688 "ltconfig"
+#line 1810 "ltconfig"
#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
@@ -1704,7 +1821,7 @@ int main() {
shl_load()
; return 0; }
EOF
-if { (eval echo $progname:1702: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo $progname:1824: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_lib_dld_shl_load=yes
else
@@ -1746,23 +1863,23 @@ fi
enable_dlopen=no
fi
- case "$lt_cv_dlopen" in
+ case $lt_cv_dlopen in
dlopen)
for ac_hdr in dlfcn.h; do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "$progname:1749: checking for $ac_hdr" >&5
+echo "$progname:1871: checking for $ac_hdr" >&5
if eval "test \"`echo 'X$''{'ac_cv_header_$ac_safe'+set}'`\" = Xset"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1754 "ltconfig"
+#line 1876 "ltconfig"
#include <$ac_hdr>
int fnord = 0;
int main () { return(0); }
EOF
ac_try="$ac_compile >/dev/null 2>conftest.out"
-{ (eval echo $progname:1760: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo $progname:1882: \"$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*
@@ -1790,7 +1907,7 @@ done
LIBS="$lt_cv_dlopen_libs $LIBS"
echo $ac_n "checking whether a program can dlopen itself""... $ac_c" 1>&6
-echo "$progname:1788: checking whether a program can dlopen itself" >&5
+echo "$progname:1910: checking whether a program can dlopen itself" >&5
if test "X${lt_cv_dlopen_self+set}" = Xset; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1798,7 +1915,7 @@ else
lt_cv_dlopen_self=cross
else
cat > conftest.$ac_ext <<EOF
-#line 1796 "ltconfig"
+#line 1918 "ltconfig"
#if HAVE_DLFCN_H
#include <dlfcn.h>
@@ -1838,13 +1955,14 @@ else
# endif
#endif
-fnord() { int i=42;}
-main() { void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW);
+void fnord() { int i=42; }
+int main() {
+ void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW);
if(self) { ptr1=dlsym(self,"fnord"); ptr2=dlsym(self,"_fnord");
if(ptr1 || ptr2) { dlclose(self); exit(0); } } exit(1); }
EOF
-if { (eval echo $progname:1842: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo $progname:1965: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then
lt_cv_dlopen_self=yes
else
@@ -1863,7 +1981,7 @@ echo "$ac_t""$lt_cv_dlopen_self" 1>&6
if test "$lt_cv_dlopen_self" = yes; then
LDFLAGS="$LDFLAGS $link_static_flag"
echo $ac_n "checking whether a statically linked program can dlopen itself""... $ac_c" 1>&6
-echo "$progname:1861: checking whether a statically linked program can dlopen itself" >&5
+echo "$progname:1984: checking whether a statically linked program can dlopen itself" >&5
if test "X${lt_cv_dlopen_self_static+set}" = Xset; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1871,7 +1989,7 @@ else
lt_cv_dlopen_self_static=cross
else
cat > conftest.$ac_ext <<EOF
-#line 1869 "ltconfig"
+#line 1992 "ltconfig"
#if HAVE_DLFCN_H
#include <dlfcn.h>
@@ -1911,13 +2029,14 @@ else
# endif
#endif
-fnord() { int i=42;}
-main() { void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW);
+void fnord() { int i=42; }
+int main() {
+ void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW);
if(self) { ptr1=dlsym(self,"fnord"); ptr2=dlsym(self,"_fnord");
if(ptr1 || ptr2) { dlclose(self); exit(0); } } exit(1); }
EOF
-if { (eval echo $progname:1915: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo $progname:2039: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then
lt_cv_dlopen_self_static=yes
else
@@ -1936,12 +2055,12 @@ fi
;;
esac
- case "$lt_cv_dlopen_self" in
+ case $lt_cv_dlopen_self in
yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
*) enable_dlopen_self=unknown ;;
esac
- case "$lt_cv_dlopen_self_static" in
+ case $lt_cv_dlopen_self_static in
yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
*) enable_dlopen_self_static=unknown ;;
esac
@@ -1958,7 +2077,7 @@ LTSHELL="$SHELL"
LTCONFIG_VERSION="$VERSION"
# Only quote variables if we're using ltmain.sh.
-case "$ltmain" in
+case $ltmain in
*.sh)
# Now quote all the things that may contain metacharacters.
for var in ltecho old_AR old_AR_FLAGS old_CC old_LTCC old_CFLAGS old_CPPFLAGS \
@@ -1983,7 +2102,7 @@ case "$ltmain" in
sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
compiler_c_o need_locks exclude_expsyms include_expsyms; do
- case "$var" in
+ case $var in
reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \
old_postinstall_cmds | old_postuninstall_cmds | \
export_symbols_cmds | archive_cmds | archive_expsym_cmds | \
@@ -1999,7 +2118,7 @@ case "$ltmain" in
esac
done
- case "$ltecho" in
+ case $ltecho in
*'\$0 --fallback-echo"')
ltecho=`$echo "X$ltecho" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
;;
@@ -2188,6 +2307,9 @@ exeext="$exeext"
pic_flag=$pic_flag
pic_mode=$pic_mode
+# What is the maximum length of a command?
+max_cmd_len=$max_cmd_len
+
# Does compiler simultaneously support -c and -o options?
compiler_c_o=$compiler_c_o
@@ -2376,11 +2498,11 @@ else
echo "### END LIBTOOL TAG CONFIG: $tagname" >> "$ofile"
fi
-case "$ltmain" in
+case $ltmain in
*.sh)
echo >> "$ofile"
if test -z "$tagname"; then
- case "$host_os" in
+ case $host_os in
aix3*)
cat <<\EOF >> "$ofile"
@@ -2394,7 +2516,7 @@ fi
EOF
;;
esac
- case "$host" in
+ case $host in
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
cat <<'EOF' >> "$ofile"
# This is a source program that is used to create dlls on Windows
@@ -2510,7 +2632,7 @@ EOF
# filename = argv[1];
#
# dll = open(filename, O_RDONLY|O_BINARY);
-# if (!dll)
+# if (dll < 1)
# return 1;
#
# dll_name = filename;
diff --git a/ltmain.sh b/ltmain.sh
index 2bccd110f03..bd76cfb4da0 100644
--- a/ltmain.sh
+++ b/ltmain.sh
@@ -1,7 +1,8 @@
# ltmain.sh - Provide generalized library-building support services.
# NOTE: Changing this file will not affect anything until you rerun ltconfig.
#
-# Copyright (C) 1996-2000, 2001 Free Software Foundation, Inc.
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
+# Free Software Foundation, Inc.
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
#
# This program is free software; you can redistribute it and/or modify
@@ -54,8 +55,8 @@ modename="$progname"
# Constants.
PROGRAM=ltmain.sh
PACKAGE=libtool
-VERSION=1.4a
-TIMESTAMP=" (1.641.2.122 2000/09/30 05:27:52)"
+VERSION=1.4a-GCC3.0
+TIMESTAMP=" (1.641.2.256 2001/05/28 20:09:07 with GCC-local changes)"
default_mode=
help="Try \`$progname --help' for more information."
@@ -113,35 +114,43 @@ do
arg="$1"
shift
- case "$arg" in
+ case $arg in
-*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
*) optarg= ;;
esac
# If the previous option needs an argument, assign it.
if test -n "$prev"; then
- case "$prev" in
+ case $prev in
execute_dlfiles)
- eval "$prev=\"\$$prev \$arg\""
+ execute_dlfiles="$execute_dlfiles $arg"
;;
tag)
tagname="$arg"
# Check whether tagname contains only valid characters
- case "$tagname" in
+ case $tagname in
*[!-_A-Za-z0-9,/]*)
echo "$progname: invalid tag name: $tagname" 1>&2
exit 1
;;
esac
- if grep "^### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$0" > /dev/null; then
- taglist="$taglist $tagname"
- # Evaluate the configuration.
- eval "`sed -n -e '/^### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $0`"
- else
- echo "$progname: ignoring unknown tag $tagname" 1>&2
- fi
+ case $tagname in
+ CC)
+ # Don't test for the "default" C tag, as we know, it's there, but
+ # not specially marked.
+ ;;
+ *)
+ if grep "^### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$0" > /dev/null; then
+ taglist="$taglist $tagname"
+ # Evaluate the configuration.
+ eval "`sed -n -e '/^### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $0`"
+ else
+ echo "$progname: ignoring unknown tag $tagname" 1>&2
+ fi
+ ;;
+ esac
;;
*)
eval "$prev=\$arg"
@@ -154,7 +163,7 @@ do
fi
# Have we seen a non-optional argument yet?
- case "$arg" in
+ case $arg in
--help)
show_help=yes
;;
@@ -237,16 +246,21 @@ if test -n "$prevopt"; then
exit 1
fi
+# If this variable is set in any of the actions, the command in it
+# will be execed at the end. This prevents here-documents from being
+# left over by shells.
+exec_cmd=
+
if test -z "$show_help"; then
# Infer the operation mode.
if test -z "$mode"; then
- case "$nonopt" in
+ case $nonopt in
*cc | *++ | gcc* | *-gcc*)
mode=link
for arg
do
- case "$arg" in
+ case $arg in
-c)
mode=compile
break
@@ -291,7 +305,7 @@ if test -z "$show_help"; then
help="Try \`$modename --help --mode=$mode' for more information."
# These modes are in order of execution frequency so that they run quickly.
- case "$mode" in
+ case $mode in
# libtool compile mode
compile)
modename="$modename: compile"
@@ -305,14 +319,14 @@ if test -z "$show_help"; then
user_target=no
for arg
do
- case "$prev" in
+ case $prev in
"") ;;
xcompiler)
# Aesthetically quote the previous argument.
prev=
lastarg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
- case "$arg" in
+ case $arg in
# Double-quote args containing other shell metacharacters.
# Many Bourne shells cannot handle close brackets correctly
# in scan sets, so we specify it separately.
@@ -332,7 +346,7 @@ if test -z "$show_help"; then
esac
# Accept any command-line options.
- case "$arg" in
+ case $arg in
-o)
if test "$user_target" != "no"; then
$echo "$modename: you cannot specify \`-o' more than once" 1>&2
@@ -371,7 +385,7 @@ if test -z "$show_help"; then
# Double-quote args containing other shell metacharacters.
# Many Bourne shells cannot handle close brackets correctly
# in scan sets, so we specify it separately.
- case "$arg" in
+ case $arg in
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
arg="\"$arg\""
;;
@@ -391,7 +405,7 @@ if test -z "$show_help"; then
;;
esac
- case "$user_target" in
+ case $user_target in
next)
# The next one is the -o target name
user_target=yes
@@ -419,7 +433,7 @@ if test -z "$show_help"; then
# Double-quote args containing other shell metacharacters.
# Many Bourne shells cannot handle close brackets correctly
# in scan sets, so we specify it separately.
- case "$lastarg" in
+ case $lastarg in
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
lastarg="\"$lastarg\""
;;
@@ -433,7 +447,7 @@ if test -z "$show_help"; then
fi
done
- case "$user_target" in
+ case $user_target in
set)
;;
no)
@@ -449,7 +463,7 @@ if test -z "$show_help"; then
# Recognize several different file suffixes.
# If the user specifies -o file.o, it is replaced with file.lo
xform='[cCFSfmso]'
- case "$libobj" in
+ case $libobj in
*.ada) xform=ada ;;
*.adb) xform=adb ;;
*.ads) xform=ads ;;
@@ -466,7 +480,7 @@ if test -z "$show_help"; then
libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
- case "$libobj" in
+ case $libobj in
*.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
*)
$echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
@@ -544,7 +558,7 @@ if test -z "$show_help"; then
trap "$run $rm $removelist; exit 1" 1 2 15
# On Cygwin there's no "real" PIC flag so we must build both object types
- case "$host_os" in
+ case $host_os in
cygwin* | mingw* | pw32* | os2*)
pic_mode=default
;;
@@ -777,7 +791,7 @@ EOF
# libtool link mode
link | relink)
modename="$modename: link"
- case "$host" in
+ case $host in
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
# It is impossible to link a dll without this setting, and
# we shouldn't force the makefile maintainer to figure out
@@ -843,7 +857,7 @@ EOF
# We need to know -static, to get the right output filenames.
for arg
do
- case "$arg" in
+ case $arg in
-all-static | -static)
if test "X$arg" = "X-all-static"; then
if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
@@ -873,7 +887,7 @@ EOF
arg="$1"
base_compile="$base_compile $arg"
shift
- case "$arg" in
+ case $arg in
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
;;
@@ -883,14 +897,14 @@ EOF
# If the previous option needs an argument, assign it.
if test -n "$prev"; then
- case "$prev" in
+ case $prev in
output)
compile_command="$compile_command @OUTPUT@"
finalize_command="$finalize_command @OUTPUT@"
;;
esac
- case "$prev" in
+ case $prev in
dlfiles|dlprefiles)
if test "$preload" = no; then
# Add the symbol object into the linking commands.
@@ -898,7 +912,7 @@ EOF
finalize_command="$finalize_command @SYMFILE@"
preload=yes
fi
- case "$arg" in
+ case $arg in
*.la | *.lo) ;; # We handle these cases below.
force)
if test "$dlself" = no; then
@@ -950,9 +964,116 @@ EOF
prev=
continue
;;
+ objectlist)
+ if test -f "$arg"; then
+ save_arg=$arg
+ moreargs=
+ for fil in `cat $save_arg`
+ do
+# moreargs="$moreargs $fil"
+ arg=$fil
+ # A libtool-controlled object.
+
+ # Check to see that this really is a libtool object.
+ if (sed -e '2q' $arg | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+ pic_object=
+ non_pic_object=
+
+ # Read the .lo file
+ # If there is no directory component, then add one.
+ case $arg in
+ */* | *\\*) . $arg ;;
+ *) . ./$arg ;;
+ esac
+
+ if test -z "$pic_object" || \
+ test -z "$non_pic_object" ||
+ test "$pic_object" = none && \
+ test "$non_pic_object" = none; then
+ $echo "$modename: cannot find name of object for \`$arg'" 1>&2
+ exit 1
+ fi
+
+ # Extract subdirectory from the argument.
+ xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
+ if test "X$xdir" = "X$arg"; then
+ xdir=
+ else
+ xdir="$xdir/"
+ fi
+
+ if test "$pic_object" != none; then
+ # Prepend the subdirectory the object is found in.
+ pic_object="$xdir$pic_object"
+
+ if test "$prev" = dlfiles; then
+ if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
+ dlfiles="$dlfiles $pic_object"
+ prev=
+ continue
+ else
+ # If libtool objects are unsupported, then we need to preload.
+ prev=dlprefiles
+ fi
+ fi
+
+ # CHECK ME: I think I busted this. -Ossama
+ if test "$prev" = dlprefiles; then
+ # Preload the old-style object.
+ dlprefiles="$dlprefiles $pic_object"
+ prev=
+ fi
+
+ # A PIC object.
+ libobjs="$libobjs $pic_object"
+ arg="$pic_object"
+ fi
+
+ # Non-PIC object.
+ if test "$non_pic_object" != none; then
+ # Prepend the subdirectory the object is found in.
+ non_pic_object="$xdir$non_pic_object"
+
+ # A standard non-PIC object
+ non_pic_objects="$non_pic_objects $non_pic_object"
+ if test -z "$pic_object" || test "$pic_object" = none ; then
+ arg="$non_pic_object"
+ fi
+ fi
+ else
+ # Only an error if not doing a dry-run.
+ if test -z "$run"; then
+ $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
+ exit 1
+ else
+ # Dry-run case.
+
+ # Extract subdirectory from the argument.
+ xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
+ if test "X$xdir" = "X$arg"; then
+ xdir=
+ else
+ xdir="$xdir/"
+ fi
+
+ pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
+ non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
+ libobjs="$libobjs $pic_object"
+ non_pic_objects="$non_pic_objects $non_pic_object"
+ fi
+ fi
+ done
+ else
+ $echo "$modename: link input file \`$save_arg' does not exist"
+ exit 1
+ fi
+ arg=$save_arg
+ prev=
+ continue
+ ;;
rpath | xrpath)
# We need an absolute path.
- case "$arg" in
+ case $arg in
[\\/]* | [A-Za-z]:[\\/]*) ;;
*)
$echo "$modename: only absolute run-paths are allowed" 1>&2
@@ -994,11 +1115,11 @@ EOF
continue
;;
esac
- fi
+ fi # test -n $prev
prevarg="$arg"
- case "$arg" in
+ case $arg in
-all-static)
if test -n "$link_static_flag"; then
compile_command="$compile_command $link_static_flag"
@@ -1035,7 +1156,7 @@ EOF
-export-symbols | -export-symbols-regex)
if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
- $echo "$modename: not more than one -exported-symbols argument allowed"
+ $echo "$modename: more than one -exported-symbols argument is not allowed"
exit 1
fi
if test "X$arg" = "X-export-symbols"; then
@@ -1057,11 +1178,11 @@ EOF
esac
continue
;;
-
+
-L*)
dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
# We need an absolute path.
- case "$dir" in
+ case $dir in
[\\/]* | [A-Za-z]:[\\/]*) ;;
*)
absdir=`cd "$dir" && pwd`
@@ -1079,9 +1200,9 @@ EOF
lib_search_path="$lib_search_path $dir"
;;
esac
- case "$host" in
+ case $host in
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
- case ":$dllsearchpath:" in
+ case :$dllsearchpath: in
*":$dir:"*) ;;
*) dllsearchpath="$dllsearchpath:$dir";;
esac
@@ -1091,19 +1212,16 @@ EOF
;;
-l*)
- if test "$arg" = "-lc"; then
- case "$host" in
- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
- # These systems don't actually have c library (as such)
- continue
- ;;
- esac
- elif test "$arg" = "-lm"; then
- case "$host" in
+ if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
+ case $host in
*-*-cygwin* | *-*-pw32* | *-*-beos*)
- # These systems don't actually have math library (as such)
+ # These systems don't actually have a C or math library (as such)
continue
;;
+ *-*-mingw* | *-*-os2*)
+ # These systems don't actually have a C library (as such)
+ test "X$arg" = "X-lc" && continue
+ ;;
esac
fi
deplibs="$deplibs $arg"
@@ -1121,7 +1239,7 @@ EOF
;;
-no-install)
- case "$host" in
+ case $host in
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
# The PATH hackery in wrapper scripts is required on Windows
# in order for the loader to find any dlls it needs.
@@ -1129,13 +1247,7 @@ EOF
$echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
fast_install=no
;;
- *-*-rhapsody*)
- # rhapsody is a little odd...
- deplibs="$deplibs -framework System"
- ;;
- *)
- no_install=yes
- ;;
+ *) no_install=yes ;;
esac
continue
;;
@@ -1145,6 +1257,11 @@ EOF
continue
;;
+ -objectlist)
+ prev=objectlist
+ continue
+ ;;
+
-o) prev=output ;;
-release)
@@ -1165,7 +1282,7 @@ EOF
-R*)
dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
# We need an absolute path.
- case "$dir" in
+ case $dir in
[\\/]* | [A-Za-z]:[\\/]*) ;;
*)
$echo "$modename: only absolute run-paths are allowed" 1>&2
@@ -1180,7 +1297,7 @@ EOF
;;
-static)
- # The effects of -static are defined in a previous loop.
+ # The effects of -static are defined in a previous loop.
# We used to do the same as -all-static on platforms that
# didn't have a PIC flag, but the assumption that the effects
# would be equivalent was wrong. It would break on at least
@@ -1204,7 +1321,7 @@ EOF
IFS="${IFS= }"; save_ifs="$IFS"; IFS=','
for flag in $args; do
IFS="$save_ifs"
- case "$flag" in
+ case $flag in
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
flag="\"$flag\""
;;
@@ -1222,7 +1339,7 @@ EOF
IFS="${IFS= }"; save_ifs="$IFS"; IFS=','
for flag in $args; do
IFS="$save_ifs"
- case "$flag" in
+ case $flag in
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
flag="\"$flag\""
;;
@@ -1250,7 +1367,7 @@ EOF
# Unknown arguments in both finalize_command and compile_command need
# to be aesthetically quoted because they are evaled later.
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
- case "$arg" in
+ case $arg in
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
arg="\"$arg\""
;;
@@ -1272,7 +1389,7 @@ EOF
# Read the .lo file
# If there is no directory component, then add one.
- case "$arg" in
+ case $arg in
*/* | *\\*) . $arg ;;
*) . ./$arg ;;
esac
@@ -1384,20 +1501,20 @@ EOF
# Unknown arguments in both finalize_command and compile_command need
# to be aesthetically quoted because they are evaled later.
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
- case "$arg" in
+ case $arg in
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
arg="\"$arg\""
;;
esac
;;
- esac
+ esac # arg
# Now actually substitute the argument into the commands.
if test -n "$arg"; then
compile_command="$compile_command $arg"
finalize_command="$finalize_command $arg"
fi
- done
+ done # argument parsing loop
if test -n "$prev"; then
$echo "$modename: the \`$prevarg' option requires an argument" 1>&2
@@ -1455,7 +1572,6 @@ EOF
finalize_command="$finalize_command $arg"
fi
- oldlibs=
# calculate the name of the file, without its directory
outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
libobjs_save="$libobjs"
@@ -1486,7 +1602,7 @@ EOF
fi
# Determine the type of output
- case "$output" in
+ case $output in
"")
$echo "$modename: you must specify an output file" 1>&2
$echo "$help" 1>&2
@@ -1511,19 +1627,31 @@ EOF
if test $linkmode = lib; then
libs="$predeps $libs $compiler_lib_search_path $postdeps"
+
+ # Compute libraries that are listed more than once in $predeps
+ # $postdeps and mark them as special (i.e., whose duplicates are
+ # not to be eliminated).
+ pre_post_deps=
+ for pre_post_dep in $predeps $postdeps; do
+ case "$pre_post_deps " in
+ *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
+ esac
+ pre_post_deps="$pre_post_deps $pre_post_dep"
+ done
+ pre_post_deps=
fi
deplibs=
newdependency_libs=
newlib_search_path=
need_relink=no # whether we're linking any uninstalled libtool libraries
- uninst_deplibs= # uninstalled libtool libraries
- uninst_path= # paths that contain uninstalled libtool libraries
+ notinst_deplibs= # not-installed libtool libraries
+ notinst_path= # paths that contain not-installed libtool libraries
case $linkmode in
lib)
passes="conv link"
for file in $dlfiles $dlprefiles; do
- case "$file" in
+ case $file in
*.la) ;;
*)
$echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
@@ -1540,34 +1668,29 @@ EOF
newdlprefiles=
passes="conv scan dlopen dlpreopen link"
;;
- *) passes="conv"
+ *) passes="conv"
;;
esac
for pass in $passes; do
- if test "$linkmode,$pass" = "lib,link" ||
- test "$linkmode,$pass" = "prog,scan"; then
- libs="$deplibs"
- deplibs=
- fi
if test $linkmode = prog; then
+ # Determine which files to process
case $pass in
- dlopen) libs="$dlfiles" ;;
+ dlopen)
+ libs="$dlfiles"
+ save_deplibs="$deplibs" # Collect dlpreopened libraries
+ deplibs=
+ ;;
dlpreopen) libs="$dlprefiles" ;;
link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
esac
fi
- if test $pass = dlopen; then
- # Collect dlpreopened libraries
- save_deplibs="$deplibs"
- deplibs=
- fi
for deplib in $libs; do
lib=
found=no
- case "$deplib" in
+ case $deplib in
-l*)
- if test $linkmode != lib && test $linkmode != prog; then
- $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
+ if test $linkmode = oldlib && test $linkmode = obj; then
+ $echo "$modename: warning: \`-l' is ignored for archives/objects: $deplib" 1>&2
continue
fi
if test $pass = conv; then
@@ -1584,6 +1707,7 @@ EOF
fi
done
if test "$found" != yes; then
+ # deplib doesn't seem to be a libtool library
if test "$linkmode,$pass" = "prog,link"; then
compile_deplibs="$deplib $compile_deplibs"
finalize_deplibs="$deplib $finalize_deplibs"
@@ -1593,7 +1717,7 @@ EOF
fi
continue
fi
- ;;
+ ;; # -l
-L*)
case $linkmode in
lib)
@@ -1616,11 +1740,11 @@ EOF
fi
;;
*)
- $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
+ $echo "$modename: warning: \`-L' is ignored for archives/objects: $deplib" 1>&2
;;
- esac
+ esac # linkmode
continue
- ;;
+ ;; # -L
-R*)
if test $pass = link; then
dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
@@ -1664,21 +1788,17 @@ EOF
fi
continue
;;
- esac
- ;;
+ esac # linkmode
+ ;; # *.$libext
*.lo | *.$objext)
- if test $pass = conv; then
- deplibs="$deplib $deplibs"
- elif test $linkmode = prog; then
- if test $pass = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
- # If there is no dlopen support or we're linking statically,
- # we need to preload.
- newdlprefiles="$newdlprefiles $deplib"
- compile_deplibs="$deplib $compile_deplibs"
- finalize_deplibs="$deplib $finalize_deplibs"
- else
- newdlfiles="$newdlfiles $deplib"
- fi
+ if test $pass = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
+ # If there is no dlopen support or we're linking statically,
+ # we need to preload.
+ newdlprefiles="$newdlprefiles $deplib"
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ newdlfiles="$newdlfiles $deplib"
fi
continue
;;
@@ -1686,7 +1806,7 @@ EOF
alldeplibs=yes
continue
;;
- esac
+ esac # case $deplib
if test $found = yes || test -f "$lib"; then :
else
$echo "$modename: cannot find the library \`$lib'" 1>&2
@@ -1714,20 +1834,21 @@ EOF
installed=yes
# Read the .la file
- case "$lib" in
+ case $lib in
*/* | *\\*) . $lib ;;
*) . ./$lib ;;
esac
if test "$linkmode,$pass" = "lib,link" ||
test "$linkmode,$pass" = "prog,scan" ||
- { test $linkmode != prog && test $linkmode != lib; }; then
+ { test $linkmode = oldlib && test $linkmode = obj; }; then
+ # Add dl[pre]opened files of deplib
test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
fi
if test $pass = conv; then
- # only check for convenience libraries
+ # Only check for convenience libraries
deplibs="$lib $deplibs"
if test -z "$libdir"; then
if test -z "$old_library"; then
@@ -1750,7 +1871,7 @@ EOF
exit 1
fi
continue
- fi
+ fi # $pass = conv
# Get the name of the library we link against.
linklib=
@@ -1769,17 +1890,17 @@ EOF
exit 1
fi
if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
- # If there is no dlname, no dlopen support or we're linking statically,
- # we need to preload.
+ # If there is no dlname, no dlopen support or we're linking
+ # statically, we need to preload.
dlprefiles="$dlprefiles $lib"
else
newdlfiles="$newdlfiles $lib"
fi
continue
- fi
+ fi # $pass = dlopen
# We need an absolute path.
- case "$ladir" in
+ case $ladir in
[\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
*)
abs_ladir=`cd "$ladir" && pwd`
@@ -1807,8 +1928,8 @@ EOF
dir="$ladir/$objdir"
absdir="$abs_ladir/$objdir"
# Remove this search path later
- uninst_path="$uninst_path $abs_ladir"
- fi
+ notinst_path="$notinst_path $abs_ladir"
+ fi # $installed = yes
name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
# This library was specified with -dlpreopen.
@@ -1827,17 +1948,17 @@ EOF
else
newdlprefiles="$newdlprefiles $dir/$linklib"
fi
- fi
+ fi # $pass = dlpreopen
if test -z "$libdir"; then
- # link the convenience library
+ # Link the convenience library
if test $linkmode = lib; then
deplibs="$dir/$old_library $deplibs"
elif test "$linkmode,$pass" = "prog,link"; then
compile_deplibs="$dir/$old_library $compile_deplibs"
finalize_deplibs="$dir/$old_library $finalize_deplibs"
else
- deplibs="$lib $deplibs" # used for prog,scan pass
+ deplibs="$lib $deplibs"
fi
continue
fi
@@ -1854,7 +1975,7 @@ EOF
tmp_libs=
for deplib in $dependency_libs; do
- case "$deplib" in
+ case $deplib in
-L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
esac
# Need to link against all dependency_libs?
@@ -1869,23 +1990,17 @@ EOF
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
esac
tmp_libs="$tmp_libs $deplib"
- done
+ done # for deplib
continue
- fi
+ fi # $linkmode = prog...
- if test "$linkmode,$pass" = "prog,link"; then
- if test -n "$library_names" &&
- { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
- # We need to hardcode the library path
- if test -n "$shlibpath_var"; then
- # Make sure the rpath contains only unique directories.
- case "$temp_rpath " in
- *" $dir "*) ;;
- *" $absdir "*) ;;
- *) temp_rpath="$temp_rpath $dir" ;;
- esac
- fi
+ link_static=no # Whether the deplib will be linked statically
+ if test -n "$library_names" &&
+ { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
+ # Link against this shared library
+ if test "$linkmode,$pass" = "prog,link" ||
+ { test $linkmode = lib && test $hardcode_into_libs = yes; }; then
# Hardcode the library path.
# Skip directories that are in the system default run-time
# search path.
@@ -1898,7 +2013,6 @@ EOF
esac
;;
esac
-
case " $sys_lib_dlsearch_path " in
*" $libdir "*) ;;
*)
@@ -1908,7 +2022,18 @@ EOF
esac
;;
esac
- fi
+ if test $linkmode = prog; then
+ # We need to hardcode the library path
+ if test -n "$shlibpath_var"; then
+ # Make sure the rpath contains only unique directories.
+ case "$temp_rpath " in
+ *" $dir "*) ;;
+ *" $absdir "*) ;;
+ *) temp_rpath="$temp_rpath $dir" ;;
+ esac
+ fi
+ fi
+ fi # $linkmode,$pass = prog,link...
if test "$alldeplibs" = yes &&
{ test "$deplibs_check_method" = pass_all ||
@@ -1917,40 +2042,11 @@ EOF
# We only need to search for static libraries
continue
fi
- fi
- link_static=no # Whether the deplib will be linked statically
- if test -n "$library_names" &&
- { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
if test "$installed" = no; then
- uninst_deplibs="$uninst_deplibs $lib"
+ notinst_deplibs="$notinst_deplibs $lib"
need_relink=yes
fi
- # This is a shared library
- if test $linkmode = lib &&
- test $hardcode_into_libs = yes; then
- # Hardcode the library path.
- # Skip directories that are in the system default run-time
- # search path.
- case " $sys_lib_dlsearch_path " in
- *" $absdir "*) ;;
- *)
- case "$compile_rpath " in
- *" $absdir "*) ;;
- *) compile_rpath="$compile_rpath $absdir"
- esac
- ;;
- esac
- case " $sys_lib_dlsearch_path " in
- *" $libdir "*) ;;
- *)
- case "$finalize_rpath " in
- *" $libdir "*) ;;
- *) finalize_rpath="$finalize_rpath $libdir"
- esac
- ;;
- esac
- fi
if test -n "$old_archive_from_expsyms_cmds"; then
# figure out the soname
@@ -1958,13 +2054,25 @@ EOF
realname="$2"
shift; shift
libname=`eval \\$echo \"$libname_spec\"`
- if test -n "$soname_spec"; then
+ # use dlname if we got it. it's perfectly good, no?
+ if test -n "$dlname"; then
+ soname="$dlname"
+ elif test -n "$soname_spec"; then
+ # bleh windows
+ case $host in
+ *cygwin*)
+ major=`expr $current - $age`
+ versuffix="-$major"
+ ;;
+ esac
eval soname=\"$soname_spec\"
else
soname="$realname"
fi
# Make a new name for the extract_expsyms_cmds to use
+ soroot="$soname"
+ soname=`echo $soroot | sed -e 's/^.*\///'`
newlib="libimp-`echo $soname | sed 's/^lib//;s/\.dll$//'`.a"
# If the library has no export list, then create one now
@@ -1996,19 +2104,19 @@ EOF
# make sure the library variables are pointing to the new library
dir=$output_objdir
linklib=$newlib
- fi
+ fi # test -n $old_archive_from_expsyms_cmds
if test $linkmode = prog || test "$mode" != relink; then
add_shlibpath=
add_dir=
add=
lib_linked=yes
- case "$hardcode_action" in
+ case $hardcode_action in
immediate | unsupported)
if test "$hardcode_direct" = no; then
add="$dir/$linklib"
elif test "$hardcode_minus_L" = no; then
- case "$host" in
+ case $host in
*-*-sunos*) add_shlibpath="$dir" ;;
esac
add_dir="-L$dir"
@@ -2042,7 +2150,7 @@ EOF
fi
if test -n "$add_shlibpath"; then
- case ":$compile_shlibpath:" in
+ case :$compile_shlibpath: in
*":$add_shlibpath:"*) ;;
*) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
esac
@@ -2056,7 +2164,7 @@ EOF
if test "$hardcode_direct" != yes && \
test "$hardcode_minus_L" != yes && \
test "$hardcode_shlibpath_var" = yes; then
- case ":$finalize_shlibpath:" in
+ case :$finalize_shlibpath: in
*":$libdir:"*) ;;
*) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
esac
@@ -2075,7 +2183,7 @@ EOF
add_dir="-L$libdir"
add="-l$name"
elif test "$hardcode_shlibpath_var" = yes; then
- case ":$finalize_shlibpath:" in
+ case :$finalize_shlibpath: in
*":$libdir:"*) ;;
*) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
esac
@@ -2095,6 +2203,15 @@ EOF
fi
fi
elif test $linkmode = prog; then
+ if test "$alldeplibs" = yes &&
+ { test "$deplibs_check_method" = pass_all ||
+ { test "$build_libtool_libs" = yes &&
+ test -n "$library_names"; }; }; then
+ # We only need to search for static libraries
+ continue
+ fi
+
+ # Try to link the static library
# Here we assume that one of hardcode_direct or hardcode_minus_L
# is not unsupported. This is valid on all known static and
# shared platforms.
@@ -2111,6 +2228,7 @@ EOF
if test "$deplibs_check_method" != pass_all; then
# We're trying link a shared library against a static one
# but the system doesn't support it.
+
# Just print a warning and add the library to dependency_libs so
# that the program can be linked against the static library.
echo
@@ -2118,13 +2236,30 @@ EOF
echo "*** I have the capability to make that library automatically link in when"
echo "*** you link to this library. But I can only do this if you have a"
echo "*** shared version of the library, which you do not appear to have."
+ if test "$module" = yes; then
+ echo "*** Therefore, libtool will create a static module, that should work "
+ echo "*** as long as the dlopening application is linked with the -dlopen flag."
+ if test -z "$global_symbol_pipe"; then
+ echo
+ echo "*** However, this would only work if libtool was able to extract symbol"
+ echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
+ echo "*** not find such a program. So, this module is probably useless."
+ echo "*** \`nm' from GNU binutils and a full rebuild may help."
+ fi
+ if test "$build_old_libs" = no; then
+ build_libtool_libs=module
+ build_old_libs=yes
+ else
+ build_libtool_libs=no
+ fi
+ fi
else
convenience="$convenience $dir/$old_library"
old_convenience="$old_convenience $dir/$old_library"
deplibs="$dir/$old_library $deplibs"
link_static=yes
fi
- fi
+ fi # link shared/static library?
if test $linkmode = lib; then
if test -n "$dependency_libs" &&
@@ -2133,7 +2268,7 @@ EOF
# Extract -R from dependency_libs
temp_deplibs=
for libdir in $dependency_libs; do
- case "$libdir" in
+ case $libdir in
-R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
case " $xrpath " in
*" $temp_xrpath "*) ;;
@@ -2161,13 +2296,13 @@ EOF
if test $link_all_deplibs != no; then
# Add the search paths of all dependency libraries
for deplib in $dependency_libs; do
- case "$deplib" in
+ case $deplib in
-L*) path="$deplib" ;;
*.la)
dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
test "X$dir" = "X$deplib" && dir="."
# We need an absolute path.
- case "$dir" in
+ case $dir in
[\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
*)
absdir=`cd "$dir" && pwd`
@@ -2198,10 +2333,9 @@ EOF
*) deplibs="$path $deplibs" ;;
esac
done
- fi
- fi
- done
- dependency_libs="$newdependency_libs"
+ fi # link_all_deplibs != no
+ fi # linkmode = lib
+ done # for deplib in $libs
if test $pass = dlpreopen; then
# Link the dlpreopened libraries before other libraries
for deplib in $save_deplibs; do
@@ -2209,6 +2343,7 @@ EOF
done
fi
if test $pass != dlopen; then
+ test $pass != scan && dependency_libs="$newdependency_libs"
if test $pass != conv; then
# Make sure lib_search_path contains only unique directories.
lib_search_path=
@@ -2227,12 +2362,11 @@ EOF
vars="compile_deplibs finalize_deplibs"
fi
for var in $vars dependency_libs; do
- # Make sure that $var contains only unique libraries
- # and add them in reverse order
+ # Add libraries to $var in reverse order
eval tmp_libs=\"\$$var\"
new_libs=
for deplib in $tmp_libs; do
- case "$deplib" in
+ case $deplib in
-L*) new_libs="$deplib $new_libs" ;;
*)
case " $specialdeplibs " in
@@ -2249,7 +2383,7 @@ EOF
done
tmp_libs=
for deplib in $new_libs; do
- case "$deplib" in
+ case $deplib in
-L*)
case " $tmp_libs " in
*" $deplib "*) ;;
@@ -2260,9 +2394,14 @@ EOF
esac
done
eval $var=\"$tmp_libs\"
- done
+ done # for var
fi
- done
+ if test "$pass" = "conv" &&
+ { test "$linkmode" = "lib" || test "$linkmode" = "prog"; }; then
+ libs="$deplibs" # reset libs
+ deplibs=
+ fi
+ done # for pass
if test $linkmode = prog; then
dlfiles="$newdlfiles"
dlprefiles="$newdlprefiles"
@@ -2270,10 +2409,6 @@ EOF
case $linkmode in
oldlib)
- if test -n "$deplibs"; then
- $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
- fi
-
if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
$echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
fi
@@ -2306,7 +2441,7 @@ EOF
lib)
# Make sure we only generate libraries of the form `libNAME.la'.
- case "$outputname" in
+ case $outputname in
lib*)
name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
eval libname=\"$libname_spec\"
@@ -2386,8 +2521,8 @@ EOF
age="$4"
# Check that each of the things are valid numbers.
- case "$current" in
- 0 | [1-9] | [1-9][0-9]*) ;;
+ case $current in
+ 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
*)
$echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
@@ -2395,8 +2530,8 @@ EOF
;;
esac
- case "$revision" in
- 0 | [1-9] | [1-9][0-9]*) ;;
+ case $revision in
+ 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
*)
$echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
@@ -2404,8 +2539,8 @@ EOF
;;
esac
- case "$age" in
- 0 | [1-9] | [1-9][0-9]*) ;;
+ case $age in
+ 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
*)
$echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
@@ -2423,9 +2558,29 @@ EOF
major=
versuffix=
verstring=
- case "$version_type" in
+ case $version_type in
none) ;;
+ darwin)
+ # Like Linux, but with the current version available in
+ # verstring for coding it into the library header
+ major=.`expr $current - $age`
+ versuffix="$major.$age.$revision"
+ # Darwin ld doesn't like 0 for these options...
+ minor_current=`expr $current + 1`
+ verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
+ ;;
+
+ freebsd-aout)
+ major=".$current"
+ versuffix=".$current.$revision";
+ ;;
+
+ freebsd-elf)
+ major=".$current"
+ versuffix=".$current";
+ ;;
+
irix)
major=`expr $current - $age + 1`
verstring="sgi$major.$revision"
@@ -2470,16 +2625,6 @@ EOF
versuffix=".$current.$revision"
;;
- freebsd-aout)
- major=".$current"
- versuffix=".$current.$revision";
- ;;
-
- freebsd-elf)
- major=".$current"
- versuffix=".$current";
- ;;
-
windows)
# Use '-' rather than '.', since we only want one
# extension on DOS 8.3 filesystems.
@@ -2531,7 +2676,7 @@ EOF
removelist=
tempremovelist=`echo "$output_objdir/*"`
for p in $tempremovelist; do
- case "$p" in
+ case $p in
*.$objext)
;;
$output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
@@ -2555,7 +2700,7 @@ EOF
fi
# Eliminate all temporary directories.
- for path in $uninst_path; do
+ for path in $notinst_path; do
lib_search_path=`echo "$lib_search_path " | sed -e 's% $path % %g'`
deplibs=`echo "$deplibs " | sed -e 's% -L$path % %g'`
dependency_libs=`echo "$dependency_libs " | sed -e 's% -L$path % %g'`
@@ -2598,15 +2743,22 @@ EOF
if test "$build_libtool_libs" = yes; then
if test -n "$rpath"; then
- case "$host" in
+ case $host in
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
# these systems don't actually have a c library (as such)!
;;
+ *-*-rhapsody* | *-*-darwin1.[012])
+ # Rhapsody C library is in the System framework
+ deplibs="$deplibs -framework System"
+ ;;
+ *-*-netbsd*)
+ # Don't link with libc until the a.out ld.so is fixed.
+ ;;
*)
- # Add libc to deplibs on all other systems if necessary.
- if test $build_libtool_need_lc = "yes"; then
- deplibs="$deplibs -lc"
- fi
+ # Add libc to deplibs on all other systems if necessary.
+ if test $build_libtool_need_lc = "yes"; then
+ deplibs="$deplibs -lc"
+ fi
;;
esac
fi
@@ -2625,7 +2777,7 @@ EOF
major=""
newdeplibs=
droppeddeps=no
- case "$deplibs_check_method" in
+ case $deplibs_check_method in
pass_all)
# Don't check for shared/static. Everything works.
# This might be a little naive. We might want to check
@@ -2650,7 +2802,7 @@ EOF
for i in $deplibs; do
name="`expr $i : '-l\(.*\)'`"
# If $name is empty we are operating on a -L argument.
- if test "$name" != "" ; then
+ if test -n "$name" && test "$name" != "0"; then
libname=`eval \\$echo \"$libname_spec\"`
deplib_matches=`eval \\$echo \"$library_names_spec\"`
set dummy $deplib_matches
@@ -2675,7 +2827,7 @@ EOF
for i in $deplibs; do
name="`expr $i : '-l\(.*\)'`"
# If $name is empty we are operating on a -L argument.
- if test "$name" != "" ; then
+ if test -n "$name" && test "$name" != "0"; then
$rm conftest
$LTCC -o conftest conftest.c $i
# Did it work?
@@ -2715,7 +2867,7 @@ EOF
for a_deplib in $deplibs; do
name="`expr $a_deplib : '-l\(.*\)'`"
# If $name is empty we are operating on a -L argument.
- if test "$name" != "" ; then
+ if test -n "$name" && test "$name" != "0"; then
libname=`eval \\$echo \"$libname_spec\"`
for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
@@ -2733,7 +2885,7 @@ EOF
potlib="$potent_lib"
while test -h "$potlib" 2>/dev/null; do
potliblink=`ls -ld $potlib | sed 's/.* -> //'`
- case "$potliblink" in
+ case $potliblink in
[\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
*) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
esac
@@ -2761,6 +2913,40 @@ EOF
fi
done # Gone through all deplibs.
;;
+ match_pattern*)
+ set dummy $deplibs_check_method
+ match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
+ for a_deplib in $deplibs; do
+ name="`expr $a_deplib : '-l\(.*\)'`"
+ # If $name is empty we are operating on a -L argument.
+ if test -n "$name" && test "$name" != "0"; then
+ libname=`eval \\$echo \"$libname_spec\"`
+ for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
+ potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
+ for potent_lib in $potential_libs; do
+ if eval echo \"$potent_lib\" 2>/dev/null \
+ | sed 10q \
+ | egrep "$match_pattern_regex" > /dev/null; then
+ newdeplibs="$newdeplibs $a_deplib"
+ a_deplib=""
+ break 2
+ fi
+ done
+ done
+ if test -n "$a_deplib" ; then
+ droppeddeps=yes
+ echo
+ echo "*** Warning: This library needs some functionality provided by $a_deplib."
+ echo "*** I have the capability to make that library automatically link in when"
+ echo "*** you link to this library. But I can only do this if you have a"
+ echo "*** shared version of the library, which you do not appear to have."
+ fi
+ else
+ # Add a -L argument.
+ newdeplibs="$newdeplibs $a_deplib"
+ fi
+ done # Gone through all deplibs.
+ ;;
none | unknown | *)
newdeplibs=""
if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
@@ -2783,6 +2969,13 @@ EOF
libname=$libname_save
name=$name_save
+ case $host in
+ *-*-rhapsody* | *-*-darwin1.[012])
+ # On Rhapsody replace the C library is the System framework
+ newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
+ ;;
+ esac
+
if test "$droppeddeps" = yes; then
if test "$module" = yes; then
echo
@@ -2808,6 +3001,21 @@ EOF
echo "*** The inter-library dependencies that have been dropped here will be"
echo "*** automatically added whenever a program is linked with this library"
echo "*** or is declared to -dlopen it."
+
+ if test $allow_undefined = no; then
+ echo
+ echo "*** Since this library must not contain undefined symbols,"
+ echo "*** because either the platform does not support them or"
+ echo "*** it was explicitly requested with -no-undefined,"
+ echo "*** libtool will only create a static version of it."
+ if test "$build_old_libs" = no; then
+ oldlibs="$output_objdir/$libname.$libext"
+ build_libtool_libs=module
+ build_old_libs=yes
+ else
+ build_libtool_libs=no
+ fi
+ fi
fi
fi
# Done checking deplibs!
@@ -2834,7 +3042,7 @@ EOF
hardcode_libdirs="$libdir"
else
# Just accumulate the unique libdirs.
- case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
+ case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
*"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
;;
*)
@@ -2887,6 +3095,7 @@ EOF
else
soname="$realname"
fi
+ test -z "$dlname" && dlname=$soname
lib="$output_objdir/$realname"
for link
@@ -2943,6 +3152,7 @@ EOF
if test -n "$convenience"; then
if test -n "$whole_archive_flag_spec"; then
+ save_libobjs=$libobjs
eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
else
gentop="$output_objdir/${outputname}x"
@@ -2958,7 +3168,7 @@ EOF
for xlib in $convenience; do
# Extract the objects.
- case "$xlib" in
+ case $xlib in
[\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
*) xabs=`pwd`"/$xlib" ;;
esac
@@ -2997,13 +3207,115 @@ EOF
else
eval cmds=\"$archive_cmds\"
fi
- IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
- for cmd in $cmds; do
- IFS="$save_ifs"
- $show "$cmd"
- $run eval "$cmd" || exit $?
- done
- IFS="$save_ifs"
+ if len=`expr "X$cmds" : ".*"` &&
+ test $len -le $max_cmd_len; then
+ :
+ else
+ # The command line is too long to link in one step, link piecewise.
+ $echo "creating reloadable object files..."
+
+ # Save the value of $output and $libobjs because we want to
+ # use them later. If we have whole_archive_flag_spec, we
+ # want to use save_libobjs as it was before
+ # whole_archive_flag_spec was expanded, because we can't
+ # assume the linker understands whole_archive_flag_spec.
+ # This may have to be revisited, in case too many
+ # convenience libraries get linked in and end up exceeding
+ # the spec.
+ if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
+ save_libobjs=$libobjs
+ fi
+ save_output=$output
+
+ # Clear the reloadable object creation command queue and
+ # initialize k to one.
+ test_cmds=
+ concat_cmds=
+ objlist=
+ delfiles=
+ last_robj=
+ k=1
+ output=$output_objdir/$save_output-${k}.$objext
+ # Loop over the list of objects to be linked.
+ for obj in $save_libobjs
+ do
+ eval test_cmds=\"$reload_cmds $objlist $last_robj\"
+ if test "X$objlist" = X ||
+ { len=`expr "X$test_cmds" : ".*"` &&
+ test $len -le $max_cmd_len; }; then
+ objlist="$objlist $obj"
+ else
+ # The command $test_cmds is almost too long, add a
+ # command to the queue.
+ if test $k -eq 1 ; then
+ # The first file doesn't have a previous command to add.
+ eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
+ else
+ # All subsequent reloadable object files will link in
+ # the last one created.
+ eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
+ fi
+ last_robj=$output_objdir/$save_output-${k}.$objext
+ k=`expr $k + 1`
+ output=$output_objdir/$save_output-${k}.$objext
+ objlist=$obj
+ len=1
+ fi
+ done
+ # Handle the remaining objects by creating one last
+ # reloadable object file. All subsequent reloadable object
+ # files will link in the last one created.
+ test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+ eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
+
+ # Set up a command to remove the reloadale object files
+ # after they are used.
+ i=0
+ while test $i -lt $k
+ do
+ i=`expr $i + 1`
+ delfiles="$delfiles $output_objdir/$save_output-${i}.$objext"
+ done
+
+ $echo "creating a temporary reloadable object file: $output"
+
+ # Loop through the commands generated above and execute them.
+ IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
+ for cmd in $concat_cmds; do
+ IFS="$save_ifs"
+ $show "$cmd"
+ $run eval "$cmd" || exit $?
+ done
+ IFS="$save_ifs"
+
+ libobjs=$output
+ # Restore the value of output.
+ output=$save_output
+
+ if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
+ eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
+ fi
+ # Expand the library linking commands again to reset the
+ # value of $libobjs for piecewise linking.
+
+ # Do each of the archive commands.
+ if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
+ eval cmds=\"$archive_expsym_cmds\"
+ else
+ eval cmds=\"$archive_cmds\"
+ fi
+
+ # Append the command to remove the reloadable object files
+ # to the just-reset $cmds.
+ eval cmds=\"\$cmds~$rm $delfiles\"
+ fi
+ IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ $show "$cmd"
+ $run eval "$cmd" || exit $?
+ done
+ IFS="$save_ifs"
# Restore the uninstalled library and exit
if test "$mode" = relink; then
@@ -3052,7 +3364,7 @@ EOF
$echo "$modename: warning: \`-release' is ignored for objects" 1>&2
fi
- case "$output" in
+ case $output in
*.lo)
if test -n "$objs$old_deplibs"; then
$echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
@@ -3097,7 +3409,7 @@ EOF
for xlib in $convenience; do
# Extract the objects.
- case "$xlib" in
+ case $xlib in
[\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
*) xabs=`pwd`"/$xlib" ;;
esac
@@ -3193,6 +3505,9 @@ EOF
;;
prog)
+ case $host in
+ *cygwin*) output=`echo $output | sed -e 's,.exe$,,;s,$,.exe,'` ;;
+ esac
if test -n "$vinfo"; then
$echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
fi
@@ -3208,6 +3523,14 @@ EOF
fi
fi
+ case $host in
+ *-*-rhapsody* | *-*-darwin1.[012])
+ # On Rhapsody replace the C library is the System framework
+ compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
+ finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
+ ;;
+ esac
+
compile_command="$compile_command $compile_deplibs"
finalize_command="$finalize_command $finalize_deplibs"
@@ -3232,7 +3555,7 @@ EOF
hardcode_libdirs="$libdir"
else
# Just accumulate the unique libdirs.
- case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
+ case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
*"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
;;
*)
@@ -3250,9 +3573,9 @@ EOF
*) perm_rpath="$perm_rpath $libdir" ;;
esac
fi
- case "$host" in
+ case $host in
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
- case ":$dllsearchpath:" in
+ case :$dllsearchpath: in
*":$libdir:"*) ;;
*) dllsearchpath="$dllsearchpath:$libdir";;
esac
@@ -3276,7 +3599,7 @@ EOF
hardcode_libdirs="$libdir"
else
# Just accumulate the unique libdirs.
- case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
+ case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
*"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
;;
*)
@@ -3313,7 +3636,7 @@ EOF
fi
if test -n "$dlsyms"; then
- case "$dlsyms" in
+ case $dlsyms in
"") ;;
*.c)
# Discover the nlist of each of the dlfiles.
@@ -3444,7 +3767,7 @@ static const void *lt_preloaded_setup() {
fi
pic_flag_for_symtable=
- case "$host" in
+ case $host in
# compiling the symbol table file with pic_flag works around
# a FreeBSD bug that causes programs to crash when -lm is
# linked before any other PIC object. But we must not use
@@ -3512,7 +3835,7 @@ static const void *lt_preloaded_setup() {
# We should set the shlibpath_var
rpath=
for dir in $temp_rpath; do
- case "$dir" in
+ case $dir in
[\\/]* | [A-Za-z]:[\\/]*)
# Absolute path.
rpath="$rpath$dir:"
@@ -3620,7 +3943,7 @@ static const void *lt_preloaded_setup() {
# Quote $echo for shipping.
if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
- case "$0" in
+ case $0 in
[\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";;
*) qecho="$SHELL `pwd`/$0 --fallback-echo";;
esac
@@ -3636,6 +3959,11 @@ static const void *lt_preloaded_setup() {
case $output in
*.exe) output=`echo $output|sed 's,.exe$,,'` ;;
esac
+ # test for cygwin because mv fails w/o .exe extensions
+ case $host in
+ *cygwin*) exeext=.exe ;;
+ *) exeext= ;;
+ esac
$rm $output
trap "$rm $output; exit 1" 1 2 15
@@ -3665,7 +3993,7 @@ relink_command=\"$relink_command\"
# This environment variable determines our operation mode.
if test \"\$libtool_install_magic\" = \"$magic\"; then
# install mode needs the following variable:
- uninst_deplibs='$uninst_deplibs'
+ notinst_deplibs='$notinst_deplibs'
else
# When we are sourced in execute mode, \$file and \$echo are already set.
if test \"\$libtool_execute_magic\" != \"$magic\"; then
@@ -3714,7 +4042,7 @@ else
if test "$fast_install" = yes; then
echo >> $output "\
- program=lt-'$outputname'
+ program=lt-'$outputname'$exeext
progdir=\"\$thisdir/$objdir\"
if test ! -f \"\$progdir/\$program\" || \\
@@ -3733,8 +4061,9 @@ else
# relink executable if necessary
if test -n \"\$relink_command\"; then
- if (eval \$relink_command); then :
+ if relink_command_output=\`eval \$relink_command 2>&1\`; then :
else
+ $echo \"\$relink_command_output\" >&2
$rm \"\$progdir/\$file\"
exit 1
fi
@@ -3859,7 +4188,7 @@ fi\
# Add in members from convenience archives.
for xlib in $addlibs; do
# Extract the objects.
- case "$xlib" in
+ case $xlib in
[\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
*) xabs=`pwd`"/$xlib" ;;
esac
@@ -3903,7 +4232,39 @@ fi\
# fi
# done
- eval cmds=\"$old_archive_cmds\"
+ eval cmds=\"$old_archive_cmds\"
+
+ if len=`expr "X$cmds" : ".*"` &&
+ test $len -le $max_cmd_len; then
+ :
+ else
+ # the command line is too long to link in one step, link in parts
+ $echo "using piecewise archive linking..."
+ save_RANLIB=$RANLIB
+ RANLIB=:
+ objlist=
+ concat_cmds=
+ save_oldobjs=$oldobjs
+ for obj in $save_oldobjs
+ do
+ oldobjs="$objlist $obj"
+ objlist="$objlist $obj"
+ eval test_cmds=\"$old_archive_cmds\"
+ if len=`expr "X$test_cmds" : ".*"` &&
+ test $len -le $max_cmd_len; then
+ :
+ else
+ # the above command should be used before it gets too long
+ oldobjs=$objlist
+ test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+ eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
+ objlist=
+ fi
+ done
+ RANLIB=$save_RANLIB
+ oldobjs=$objlist
+ eval cmds=\"\$concat_cmds~$old_archive_cmds\"
+ fi
fi
IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
for cmd in $cmds; do
@@ -3920,7 +4281,7 @@ fi\
fi
# Now create the libtool archive.
- case "$output" in
+ case $output in
*.la)
old_library=
test "$build_old_libs" = yes && old_library="$libname.$libext"
@@ -3952,7 +4313,7 @@ fi\
# Replace all uninstalled libtool libraries with the installed ones
newdependency_libs=
for deplib in $dependency_libs; do
- case "$deplib" in
+ case $deplib in
*.la)
name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
@@ -3990,6 +4351,11 @@ fi\
dlprefiles="$newdlprefiles"
fi
$rm $output
+ # place dlname in correct position for cygwin
+ tdlname=$dlname
+ case $host,$output,$installed,$module,$dlname in
+ *cygwin*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
+ esac
$echo > $output "\
# $outputname - a libtool library file
# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
@@ -3998,7 +4364,7 @@ fi\
# It is necessary for linking the library.
# The name that we can dlopen(3).
-dlname='$dlname'
+dlname='$tdlname'
# Names of this library.
library_names='$library_names'
@@ -4050,7 +4416,7 @@ relink_command=\"$relink_command\""
$echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then
# Aesthetically quote it.
arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
- case "$arg" in
+ case $arg in
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
arg="\"$arg\""
;;
@@ -4066,7 +4432,7 @@ relink_command=\"$relink_command\""
# The real first argument should be the name of the installation program.
# Aesthetically quote it.
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
- case "$arg" in
+ case $arg in
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
arg="\"$arg\""
;;
@@ -4089,7 +4455,7 @@ relink_command=\"$relink_command\""
continue
fi
- case "$arg" in
+ case $arg in
-d) isdir=yes ;;
-f) prev="-f" ;;
-g) prev="-g" ;;
@@ -4114,7 +4480,7 @@ relink_command=\"$relink_command\""
# Aesthetically quote the argument.
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
- case "$arg" in
+ case $arg in
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
arg="\"$arg\""
;;
@@ -4165,11 +4531,11 @@ relink_command=\"$relink_command\""
exit 1
fi
fi
- case "$destdir" in
+ case $destdir in
[\\/]* | [A-Za-z]:[\\/]*) ;;
*)
for file in $files; do
- case "$file" in
+ case $file in
*.lo) ;;
*)
$echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
@@ -4191,7 +4557,7 @@ relink_command=\"$relink_command\""
for file in $files; do
# Do each installation.
- case "$file" in
+ case $file in
*.$libext)
# Do the static libraries later.
staticlibs="$staticlibs $file"
@@ -4210,7 +4576,7 @@ relink_command=\"$relink_command\""
old_library=
relink_command=
# If there is no directory component, then add one.
- case "$file" in
+ case $file in
*/* | *\\*) . $file ;;
*) . ./$file ;;
esac
@@ -4306,7 +4672,7 @@ relink_command=\"$relink_command\""
fi
# Deduce the name of the destination old-style object file.
- case "$destfile" in
+ case $destfile in
*.lo)
staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
;;
@@ -4349,28 +4715,28 @@ relink_command=\"$relink_command\""
# Do a test to see if this is really a libtool program.
if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
- uninst_deplibs=
+ notinst_deplibs=
relink_command=
# If there is no directory component, then add one.
- case "$file" in
+ case $file in
*/* | *\\*) . $file ;;
*) . ./$file ;;
esac
# Check the variables that should have been set.
- if test -z "$uninst_deplibs"; then
+ if test -z "$notinst_deplibs"; then
$echo "$modename: invalid libtool wrapper script \`$file'" 1>&2
exit 1
fi
finalize=yes
- for lib in $uninst_deplibs; do
+ for lib in $notinst_deplibs; do
# Check to see that each library is installed.
libdir=
if test -f "$lib"; then
# If there is no directory component, then add one.
- case "$lib" in
+ case $lib in
*/* | *\\*) . $lib ;;
*) . ./$lib ;;
esac
@@ -4384,7 +4750,7 @@ relink_command=\"$relink_command\""
relink_command=
# If there is no directory component, then add one.
- case "$file" in
+ case $file in
*/* | *\\*) . $file ;;
*) . ./$file ;;
esac
@@ -4422,6 +4788,25 @@ relink_command=\"$relink_command\""
fi
fi
+
+ # remove .exe since cygwin /usr/bin/install will append another
+ # one anyways
+ case $install_prog,$host in
+ */usr/bin/install*,*cygwin*)
+ case $file:$destfile in
+ *.exe:*.exe)
+ # this is ok
+ ;;
+ *.exe:*)
+ destfile=$destfile.exe
+ ;;
+ *:*.exe)
+ destfile=`echo $destfile | sed -e 's,.exe$,,'`
+ ;;
+ esac
+ ;;
+ esac
+
$show "$install_prog$stripme $file $destfile"
$run eval "$install_prog\$stripme \$file \$destfile" || exit $?
test -n "$outputname" && ${rm}r "$tmpdir"
@@ -4461,11 +4846,10 @@ relink_command=\"$relink_command\""
if test -n "$current_libdirs"; then
# Maybe just do a dry run.
test -n "$run" && current_libdirs=" -n$current_libdirs"
- exec $SHELL $0 --finish$current_libdirs
- exit 1
+ exec_cmd='$SHELL $0 --finish$current_libdirs'
+ else
+ exit 0
fi
-
- exit 0
;;
# libtool finish mode
@@ -4503,7 +4887,7 @@ relink_command=\"$relink_command\""
fi
# Exit here if they wanted silent mode.
- test "$show" = : && exit 0
+ test "$show" = ":" && exit 0
echo "----------------------------------------------------------------------"
echo "Libraries have been installed in:"
@@ -4513,7 +4897,7 @@ relink_command=\"$relink_command\""
echo
echo "If you ever happen to want to link against installed libraries"
echo "in a given directory, LIBDIR, you must either use libtool, and"
- echo "specify the full pathname of the library, or use \`-LLIBDIR'"
+ echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
echo "flag during linking and do at least one of the following:"
if test -n "$shlibpath_var"; then
echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
@@ -4563,7 +4947,7 @@ relink_command=\"$relink_command\""
fi
dir=
- case "$file" in
+ case $file in
*.la)
# Check to see that this really is a libtool archive.
if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
@@ -4578,7 +4962,7 @@ relink_command=\"$relink_command\""
library_names=
# If there is no directory component, then add one.
- case "$file" in
+ case $file in
*/* | *\\*) . $file ;;
*) . ./$file ;;
esac
@@ -4633,13 +5017,13 @@ relink_command=\"$relink_command\""
args=
for file
do
- case "$file" in
+ case $file in
-*) ;;
*)
# Do a test to see if this is really a libtool program.
if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
# If there is no directory component, then add one.
- case "$file" in
+ case $file in
*/* | *\\*) . $file ;;
*) . ./$file ;;
esac
@@ -4668,11 +5052,8 @@ relink_command=\"$relink_command\""
LANG="$save_LANG"; export LANG
fi
- # Now actually exec the command.
- eval "exec \$cmd$args"
-
- $echo "$modename: cannot exec \$cmd$args"
- exit 1
+ # Now prepare to actually exec the command.
+ exec_cmd='"$cmd"$args'
else
# Display what would be done.
if test -n "$shlibpath_var"; then
@@ -4689,6 +5070,8 @@ relink_command=\"$relink_command\""
modename="$modename: $mode"
rm="$nonopt"
files=
+ rmforce=
+ exit_status=0
# This variable tells wrapper scripts just to set variables rather
# than running their programs.
@@ -4696,7 +5079,8 @@ relink_command=\"$relink_command\""
for arg
do
- case "$arg" in
+ case $arg in
+ -f) rm="$rm $arg"; rmforce=yes ;;
-*) rm="$rm $arg" ;;
*) files="$files $arg" ;;
esac
@@ -4708,6 +5092,8 @@ relink_command=\"$relink_command\""
exit 1
fi
+ rmdirs=
+
for file in $files; do
dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
if test "X$dir" = "X$file"; then
@@ -4719,9 +5105,29 @@ relink_command=\"$relink_command\""
name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
test $mode = uninstall && objdir="$dir"
+ # Remember objdir for removal later, being careful to avoid duplicates
+ if test $mode = clean; then
+ case " $rmdirs " in
+ *" $objdir "*) ;;
+ *) rmdirs="$rmdirs $objdir" ;;
+ esac
+ fi
+
+ # Don't error if the file doesn't exist and rm -f was used.
+ if (test -L "$file") >/dev/null 2>&1 \
+ || (test -h "$file") >/dev/null 2>&1 \
+ || test -f "$file"; then
+ :
+ elif test -d "$file"; then
+ exit_status=1
+ continue
+ elif test "$rmforce" = yes; then
+ continue
+ fi
+
rmfiles="$file"
- case "$name" in
+ case $name in
*.la)
# Possibly a libtool archive, so verify it.
if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
@@ -4743,6 +5149,9 @@ relink_command=\"$relink_command\""
IFS="$save_ifs"
$show "$cmd"
$run eval "$cmd"
+ if test $? != 0 && test "$rmforce" != yes; then
+ exit_status=1
+ fi
done
IFS="$save_ifs"
fi
@@ -4755,6 +5164,9 @@ relink_command=\"$relink_command\""
IFS="$save_ifs"
$show "$cmd"
$run eval "$cmd"
+ if test $? != 0 && test "$rmforce" != yes; then
+ exit_status=1
+ fi
done
IFS="$save_ifs"
fi
@@ -4765,10 +5177,10 @@ relink_command=\"$relink_command\""
*.lo)
# Possibly a libtool object, so verify it.
- if (sed -e '2q' $arg | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+ if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
# Read the .lo file
- . ./$file
+ . $dir/$name
# Add PIC object to the list of files to remove.
if test -n "$pic_object" \
@@ -4799,9 +5211,18 @@ relink_command=\"$relink_command\""
;;
esac
$show "$rm $rmfiles"
- $run $rm $rmfiles
+ $run $rm $rmfiles || exit_status=1
done
- exit 0
+
+ # Try to remove the ${objdir}s in the directories where we deleted files
+ for dir in $rmdirs; do
+ if test -d "$dir"; then
+ $show "rmdir $dir"
+ $run rmdir $dir >/dev/null 2>&1
+ fi
+ done
+
+ exit $exit_status
;;
"")
@@ -4811,13 +5232,20 @@ relink_command=\"$relink_command\""
;;
esac
- $echo "$modename: invalid operation mode \`$mode'" 1>&2
- $echo "$generic_help" 1>&2
- exit 1
+ if test -z "$exec_cmd"; then
+ $echo "$modename: invalid operation mode \`$mode'" 1>&2
+ $echo "$generic_help" 1>&2
+ exit 1
+ fi
fi # test -z "$show_help"
+if test -n "$exec_cmd"; then
+ eval exec $exec_cmd
+ exit 1
+fi
+
# We need to display help for each of the modes.
-case "$mode" in
+case $mode in
"") $echo \
"Usage: $modename [OPTION]... [MODE-ARG]...
@@ -4873,6 +5301,8 @@ Compile a source file into a libtool library object.
This mode accepts the following additional options:
-o OUTPUT-FILE set the output file name to OUTPUT-FILE
+ -prefer-pic try to building PIC objects only
+ -prefer-non-pic try to building non-PIC objects only
-static always build a \`.o' file suitable for static linking
COMPILE-COMMAND is a command to be used in creating a \`standard' object file
@@ -4956,6 +5386,7 @@ The following components of LINK-COMMAND are treated specially:
-no-install link a not-installable executable
-no-undefined declare that a library does not refer to external symbols
-o OUTPUT-FILE create OUTPUT-FILE from the specified objects
+ -objectlist FILE Use a list of object files found in FILE to specify objects
-release RELEASE specify package release information
-rpath LIBDIR the created library will eventually be installed in LIBDIR
-R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
diff --git a/zlib/ChangeLog b/zlib/ChangeLog
index 57386a26f48..911ba10b835 100644
--- a/zlib/ChangeLog
+++ b/zlib/ChangeLog
@@ -1,3 +1,27 @@
+2002-02-20 Release Manager
+
+ * GCC 3.0.4 Released.
+
+2001-12-20 Release Manager
+
+ * GCC 3.0.3 Released.
+
+2001-10-23 Release Manager
+
+ * GCC 3.0.2 Released.
+
+2001-08-19 Release Manager
+
+ * GCC 3.0.1 Released.
+
+2001-08-19 Release Manager
+
+ * GCC 3.0.1 Released.
+
+20010617 Release Manager
+
+ * GCC 3.0 Released.
+
ChangeLog file for zlib
@@ -215,7 +239,7 @@ Changes in 1.0.6 (19 Jan 1998)
- use _fdopen instead of fdopen for MSC >= 6.0 (Thomas Fanslau)
- added makelcc.bat for lcc-win32 (Tom St Denis)
- in Makefile.dj2, use copy and del instead of install and rm (Frank Donahoe)
-- Avoid expanded $Id$. Use "rcs -kb" or "cvs admin -kb" to avoid Id expansion.
+- Avoid expanded $Id: ChangeLog,v 1.1.8.5 2001/12/20 19:23:17 mmitchel Exp $. Use "rcs -kb" or "cvs admin -kb" to avoid Id expansion.
- check for unistd.h in configure (for off_t)
- remove useless check parameter in inflate_blocks_free
- avoid useless assignment of s->check to itself in inflate_blocks_new
diff --git a/zlib/ChangeLog.gcj b/zlib/ChangeLog.gcj
index 3d05082cd86..18d3abb655f 100644
--- a/zlib/ChangeLog.gcj
+++ b/zlib/ChangeLog.gcj
@@ -1,3 +1,15 @@
+2001-07-03 Tom Tromey <tromey@redhat.com>
+
+ Fix for PR bootstrap/3281:
+ * configure, Makefile.in: Rebuilt.
+ * configure.in: Set mkinstalldirs, for in-tree build.
+
+2001-05-13 Alexandre Oliva <aoliva@redhat.com>
+
+ * acinclude.m4: Use ../libtool.m4.
+ * configure.in: Use ${zlib_basedir}/.. for AC_CONFIG_AUX_DIR.
+ * acinclude.m4, configure, Makefile.in: Rebuilt.
+
2000-10-24 Chris Demetriou <cgd@sibyte.com>
* configure.in: Invoke AC_PROG_CPP unconditionally before
diff --git a/zlib/Makefile.in b/zlib/Makefile.in
index 6c4bb996f07..9f4872a13a7 100644
--- a/zlib/Makefile.in
+++ b/zlib/Makefile.in
@@ -67,18 +67,23 @@ AS = @AS@
CC = @CC@
COMPPATH = @COMPPATH@
CPP = @CPP@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
DLLTOOL = @DLLTOOL@
EXEEXT = @EXEEXT@
-LD = @LD@
+GCJ = @GCJ@
+GCJFLAGS = @GCJFLAGS@
LIBTOOL = @LIBTOOL@
LN_S = @LN_S@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
-NM = @NM@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
RANLIB = @RANLIB@
-USE_SYMBOL_UNDERSCORE = @USE_SYMBOL_UNDERSCORE@
+STRIP = @STRIP@
VERSION = @VERSION@
+mkinstalldirs = @mkinstalldirs@
target_all = @target_all@
zlib_basedir = @zlib_basedir@
@@ -91,9 +96,12 @@ MULTIDIRS =
MULTISUBDIR =
MULTIDO = true
MULTICLEAN = true
-@USE_LIBDIR_TRUE@toolexeclibdir = @USE_LIBDIR_TRUE@$(libdir)$(MULTISUBDIR)
-@USE_LIBDIR_FALSE@toolexeclibdir = @USE_LIBDIR_FALSE@$(toolexecdir)/lib$(MULTISUBDIR)
-@USE_LIBDIR_FALSE@toolexecdir = @USE_LIBDIR_FALSE@$(exec_prefix)/$(target_alias)
+@USE_LIBDIR_TRUE@toolexeclibdir = \
+@USE_LIBDIR_TRUE@$(libdir)$(MULTISUBDIR)
+@USE_LIBDIR_FALSE@toolexeclibdir = \
+@USE_LIBDIR_FALSE@$(toolexecdir)/lib$(MULTISUBDIR)
+@USE_LIBDIR_FALSE@toolexecdir = \
+@USE_LIBDIR_FALSE@$(exec_prefix)/$(target_alias)
ZLIB_SOURCES = adler32.c compress.c crc32.c deflate.c deflate.h \
gzio.c infblock.c infblock.h infcodes.c infcodes.h inffast.c inffast.h \
@@ -101,12 +109,18 @@ inffixed.h inflate.c inftrees.c inftrees.h infutil.c infutil.h trees.c \
trees.h uncompr.c zconf.h zlib.h zutil.c zutil.h
-@TARGET_LIBRARY_TRUE@toolexeclib_LTLIBRARIES = @TARGET_LIBRARY_TRUE@@target_all@
-@TARGET_LIBRARY_TRUE@EXTRA_LTLIBRARIES = @TARGET_LIBRARY_TRUE@libzgcj.la
-@TARGET_LIBRARY_TRUE@libzgcj_la_SOURCES = @TARGET_LIBRARY_TRUE@$(ZLIB_SOURCES)
-@TARGET_LIBRARY_TRUE@libzgcj_la_LDFLAGS = @TARGET_LIBRARY_TRUE@-version-info 0:0:0 -rpath $(toolexeclibdir)
-@TARGET_LIBRARY_FALSE@toolexeclib_LIBRARIES = @TARGET_LIBRARY_FALSE@libz.a
-@TARGET_LIBRARY_FALSE@libz_a_SOURCES = @TARGET_LIBRARY_FALSE@$(ZLIB_SOURCES)
+@TARGET_LIBRARY_TRUE@toolexeclib_LTLIBRARIES = \
+@TARGET_LIBRARY_TRUE@@target_all@
+@TARGET_LIBRARY_TRUE@EXTRA_LTLIBRARIES = \
+@TARGET_LIBRARY_TRUE@libzgcj.la
+@TARGET_LIBRARY_TRUE@libzgcj_la_SOURCES = \
+@TARGET_LIBRARY_TRUE@$(ZLIB_SOURCES)
+@TARGET_LIBRARY_TRUE@libzgcj_la_LDFLAGS = \
+@TARGET_LIBRARY_TRUE@-version-info 0:0:0 -rpath $(toolexeclibdir)
+@TARGET_LIBRARY_FALSE@toolexeclib_LIBRARIES = \
+@TARGET_LIBRARY_FALSE@libz.a
+@TARGET_LIBRARY_FALSE@libz_a_SOURCES = \
+@TARGET_LIBRARY_FALSE@$(ZLIB_SOURCES)
# Work around what appears to be a GNU make bug handling MAKEFLAGS
# values defined in terms of make variables, as is the case for CC and
@@ -150,7 +164,6 @@ AM_MAKEFLAGS = \
"DESTDIR=$(DESTDIR)"
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs
CONFIG_CLEAN_FILES =
LIBRARIES = $(toolexeclib_LIBRARIES)
@@ -160,10 +173,13 @@ CPPFLAGS = @CPPFLAGS@
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
libz_a_LIBADD =
-@TARGET_LIBRARY_FALSE@libz_a_OBJECTS = adler32.o compress.o crc32.o \
-@TARGET_LIBRARY_FALSE@deflate.o gzio.o infblock.o infcodes.o inffast.o \
-@TARGET_LIBRARY_FALSE@inflate.o inftrees.o infutil.o trees.o uncompr.o \
-@TARGET_LIBRARY_FALSE@zutil.o
+@TARGET_LIBRARY_FALSE@libz_a_OBJECTS = adler32.$(OBJEXT) \
+@TARGET_LIBRARY_FALSE@compress.$(OBJEXT) crc32.$(OBJEXT) \
+@TARGET_LIBRARY_FALSE@deflate.$(OBJEXT) gzio.$(OBJEXT) \
+@TARGET_LIBRARY_FALSE@infblock.$(OBJEXT) infcodes.$(OBJEXT) \
+@TARGET_LIBRARY_FALSE@inffast.$(OBJEXT) inflate.$(OBJEXT) \
+@TARGET_LIBRARY_FALSE@inftrees.$(OBJEXT) infutil.$(OBJEXT) \
+@TARGET_LIBRARY_FALSE@trees.$(OBJEXT) uncompr.$(OBJEXT) zutil.$(OBJEXT)
AR = ar
LTLIBRARIES = $(toolexeclib_LTLIBRARIES)
@@ -183,14 +199,14 @@ aclocal.m4 configure configure.in
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
-TAR = gtar
+TAR = tar
GZIP_ENV = --best
SOURCES = $(libz_a_SOURCES) $(libzgcj_la_SOURCES)
OBJECTS = $(libz_a_OBJECTS) $(libzgcj_la_OBJECTS)
all: all-redirect
.SUFFIXES:
-.SUFFIXES: .S .c .lo .o .s
+.SUFFIXES: .S .c .lo .o .obj .s
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile
@@ -241,6 +257,11 @@ uninstall-toolexeclibLIBRARIES:
.c.o:
$(COMPILE) -c $<
+# FIXME: We should only use cygpath when building on Windows,
+# and only if it is available.
+.c.obj:
+ $(COMPILE) -c `cygpath -w $<`
+
.s.o:
$(COMPILE) -c $<
@@ -249,6 +270,7 @@ uninstall-toolexeclibLIBRARIES:
mostlyclean-compile:
-rm -f *.o core *.core
+ -rm -f *.$(OBJEXT)
clean-compile:
@@ -379,7 +401,7 @@ distdir: $(DISTFILES)
@for file in $(DISTFILES); do \
if test -f $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
- cp -pr $$d/$$file $(distdir)/$$file; \
+ cp -pr $$/$$file $(distdir)/$$file; \
else \
test -f $(distdir)/$$file \
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
diff --git a/zlib/acinclude.m4 b/zlib/acinclude.m4
index c304a53a91d..cbbaa3008fb 100644
--- a/zlib/acinclude.m4
+++ b/zlib/acinclude.m4
@@ -37,3 +37,12 @@ else
test "${CFLAGS+set}" = set || CFLAGS="-g"
fi
])
+
+sinclude(../libtool.m4)
+dnl The lines below arrange for aclocal not to bring libtool.m4
+dnl AM_PROG_LIBTOOL into aclocal.m4, while still arranging for automake
+dnl to add a definition of LIBTOOL to Makefile.in.
+ifelse(yes,no,[
+AC_DEFUN([AM_PROG_LIBTOOL],)
+AC_SUBST(LIBTOOL)
+])
diff --git a/zlib/aclocal.m4 b/zlib/aclocal.m4
index 15b36a88404..eae07e4edaf 100644
--- a/zlib/aclocal.m4
+++ b/zlib/aclocal.m4
@@ -50,6 +50,15 @@ else
fi
])
+sinclude(../libtool.m4)
+dnl The lines below arrange for aclocal not to bring libtool.m4
+dnl AM_PROG_LIBTOOL into aclocal.m4, while still arranging for automake
+dnl to add a definition of LIBTOOL to Makefile.in.
+ifelse(yes,no,[
+AC_DEFUN([AM_PROG_LIBTOOL],)
+AC_SUBST(LIBTOOL)
+])
+
# Do all the work for Automake. This macro actually does too much --
# some checks are only needed if your package does certain things.
# But this isn't really a big deal.
@@ -175,607 +184,3 @@ else
$1_FALSE=
fi])
-
-# serial 35 AC_PROG_LIBTOOL
-AC_DEFUN(AC_PROG_LIBTOOL,
-[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
-
-# Save cache, so that ltconfig can load it
-AC_CACHE_SAVE
-
-# Actually configure libtool. ac_aux_dir is where install-sh is found.
-CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
-LD="$LD" NM="$NM" RANLIB="$RANLIB" LN_S="$LN_S" \
-DLLTOOL="$DLLTOOL" AS="$AS" \
-${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
-$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
-|| AC_MSG_ERROR([libtool configure failed])
-
-# Reload cache, that may have been modified by ltconfig
-AC_CACHE_LOAD
-
-# This can be used to rebuild libtool when needed
-LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
-
-# Always use our own libtool.
-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
-AC_SUBST(LIBTOOL)dnl
-
-# Redirect the config.log output again, so that the ltconfig log is not
-# clobbered by the next message.
-exec 5>>./config.log
-])
-
-AC_DEFUN(AC_LIBTOOL_SETUP,
-[AC_PREREQ(2.13)dnl
-AC_REQUIRE([AC_ENABLE_SHARED])dnl
-AC_REQUIRE([AC_ENABLE_STATIC])dnl
-AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
-AC_REQUIRE([AC_CANONICAL_HOST])dnl
-AC_REQUIRE([AC_CANONICAL_BUILD])dnl
-AC_REQUIRE([AC_PROG_RANLIB])dnl
-AC_REQUIRE([AC_PROG_CC])dnl
-AC_REQUIRE([AC_PROG_LD])dnl
-AC_REQUIRE([AC_PROG_NM])dnl
-AC_REQUIRE([AC_SYS_NM_PARSE])dnl
-AC_REQUIRE([AC_SYS_SYMBOL_UNDERSCORE])dnl
-AC_REQUIRE([AC_PROG_LN_S])dnl
-dnl
-
-# Check for any special flags to pass to ltconfig.
-libtool_flags="--cache-file=$cache_file"
-test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
-test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
-test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
-test "$lt_dlopen" = yes && libtool_flags="$libtool_flags --enable-dlopen"
-test "$silent" = yes && libtool_flags="$libtool_flags --silent"
-test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
-test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
-
-# Some flags need to be propagated to the compiler or linker for good
-# libtool support.
-case "$host" in
-*-*-irix6*)
- # Find out which ABI we are using.
- echo '[#]line __oline__ "configure"' > conftest.$ac_ext
- if AC_TRY_EVAL(ac_compile); then
- case "`/usr/bin/file conftest.o`" in
- *32-bit*)
- LD="${LD-ld} -32"
- ;;
- *N32*)
- LD="${LD-ld} -n32"
- ;;
- *64-bit*)
- LD="${LD-ld} -64"
- ;;
- esac
- fi
- rm -rf conftest*
- ;;
-
-*-*-sco3.2v5*)
- # On SCO OpenServer 5, we need -belf to get full-featured binaries.
- SAVE_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS -belf"
- AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
- [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
- if test x"$lt_cv_cc_needs_belf" != x"yes"; then
- # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
- CFLAGS="$SAVE_CFLAGS"
- fi
- ;;
-
-*-*-cygwin*)
- AC_SYS_LIBTOOL_CYGWIN
- ;;
-
-esac
-
-# enable the --disable-libtool-lock switch
-
-AC_ARG_ENABLE(libtool-lock,
-[ --disable-libtool-lock force libtool not to do file locking],
-need_locks=$enableval,
-need_locks=yes)
-
-if test x"$need_locks" = xno; then
- libtool_flags="$libtool_flags --disable-lock"
-fi
-])
-
-# AC_LIBTOOL_DLOPEN - check for dlopen support
-AC_DEFUN(AC_LIBTOOL_DLOPEN, [lt_dlopen=yes])
-
-# AC_ENABLE_SHARED - implement the --enable-shared flag
-# Usage: AC_ENABLE_SHARED[(DEFAULT)]
-# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
-# `yes'.
-AC_DEFUN(AC_ENABLE_SHARED,
-[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
-AC_ARG_ENABLE(shared,
-changequote(<<, >>)dnl
-<< --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
-changequote([, ])dnl
-[p=${PACKAGE-default}
-case "$enableval" in
-yes) enable_shared=yes ;;
-no) enable_shared=no ;;
-*)
- enable_shared=no
- # Look at the argument we got. We use all the common list separators.
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
- for pkg in $enableval; do
- if test "X$pkg" = "X$p"; then
- enable_shared=yes
- fi
- done
- IFS="$ac_save_ifs"
- ;;
-esac],
-enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
-])
-
-# AC_DISABLE_SHARED - set the default shared flag to --disable-shared
-AC_DEFUN(AC_DISABLE_SHARED,
-[AC_ENABLE_SHARED(no)])
-
-# AC_ENABLE_STATIC - implement the --enable-static flag
-# Usage: AC_ENABLE_STATIC[(DEFAULT)]
-# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
-# `yes'.
-AC_DEFUN(AC_ENABLE_STATIC,
-[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
-AC_ARG_ENABLE(static,
-changequote(<<, >>)dnl
-<< --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
-changequote([, ])dnl
-[p=${PACKAGE-default}
-case "$enableval" in
-yes) enable_static=yes ;;
-no) enable_static=no ;;
-*)
- enable_static=no
- # Look at the argument we got. We use all the common list separators.
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
- for pkg in $enableval; do
- if test "X$pkg" = "X$p"; then
- enable_static=yes
- fi
- done
- IFS="$ac_save_ifs"
- ;;
-esac],
-enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
-])
-
-# AC_DISABLE_STATIC - set the default static flag to --disable-static
-AC_DEFUN(AC_DISABLE_STATIC,
-[AC_ENABLE_STATIC(no)])
-
-
-# AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
-# Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
-# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
-# `yes'.
-AC_DEFUN(AC_ENABLE_FAST_INSTALL,
-[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
-AC_ARG_ENABLE(fast-install,
-changequote(<<, >>)dnl
-<< --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
-changequote([, ])dnl
-[p=${PACKAGE-default}
-case "$enableval" in
-yes) enable_fast_install=yes ;;
-no) enable_fast_install=no ;;
-*)
- enable_fast_install=no
- # Look at the argument we got. We use all the common list separators.
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
- for pkg in $enableval; do
- if test "X$pkg" = "X$p"; then
- enable_fast_install=yes
- fi
- done
- IFS="$ac_save_ifs"
- ;;
-esac],
-enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
-])
-
-# AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
-AC_DEFUN(AC_DISABLE_FAST_INSTALL,
-[AC_ENABLE_FAST_INSTALL(no)])
-
-
-# AC_PROG_LD - find the path to the GNU or non-GNU linker
-AC_DEFUN(AC_PROG_LD,
-[AC_ARG_WITH(gnu-ld,
-[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
-test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
-AC_REQUIRE([AC_PROG_CC])dnl
-AC_REQUIRE([AC_CANONICAL_HOST])dnl
-AC_REQUIRE([AC_CANONICAL_BUILD])dnl
-ac_prog=ld
-if test "$ac_cv_prog_gcc" = yes; then
- # Check if gcc -print-prog-name=ld gives a path.
- AC_MSG_CHECKING([for ld used by GCC])
- ac_prog=`($CC -print-prog-name=ld) 2>&5`
- case "$ac_prog" in
- # Accept absolute paths.
-changequote(,)dnl
- /* | [A-Za-z]:[\\/]*)
- re_direlt='/[^/][^/]*/\.\./'
-changequote([,])dnl
- # Canonicalize the path of ld
- ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
- while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
- ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
- done
- test -z "$LD" && LD="$ac_prog"
- ;;
- "")
- # If it fails, then pretend we aren't using GCC.
- ac_prog=ld
- ;;
- *)
- # If it is relative, then search for the first ld in PATH.
- with_gnu_ld=unknown
- ;;
- esac
-elif test "$with_gnu_ld" = yes; then
- AC_MSG_CHECKING([for GNU ld])
-else
- AC_MSG_CHECKING([for non-GNU ld])
-fi
-AC_CACHE_VAL(ac_cv_path_LD,
-[if test -z "$LD"; then
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
- for ac_dir in $PATH; do
- test -z "$ac_dir" && ac_dir=.
- if test -f "$ac_dir/$ac_prog"; then
- ac_cv_path_LD="$ac_dir/$ac_prog"
- # Check to see if the program is GNU ld. I'd rather use --version,
- # but apparently some GNU ld's only accept -v.
- # Break only if it was the GNU/non-GNU ld that we prefer.
- if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
- test "$with_gnu_ld" != no && break
- else
- test "$with_gnu_ld" != yes && break
- fi
- fi
- done
- IFS="$ac_save_ifs"
-else
- ac_cv_path_LD="$LD" # Let the user override the test with a path.
-fi])
-LD="$ac_cv_path_LD"
-if test -n "$LD"; then
- AC_MSG_RESULT($LD)
-else
- AC_MSG_RESULT(no)
-fi
-test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
-AC_SUBST(LD)
-AC_PROG_LD_GNU
-])
-
-AC_DEFUN(AC_PROG_LD_GNU,
-[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
-[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
-if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
- ac_cv_prog_gnu_ld=yes
-else
- ac_cv_prog_gnu_ld=no
-fi])
-])
-
-# AC_PROG_NM - find the path to a BSD-compatible name lister
-AC_DEFUN(AC_PROG_NM,
-[AC_MSG_CHECKING([for BSD-compatible nm])
-AC_CACHE_VAL(ac_cv_path_NM,
-[if test -n "$NM"; then
- # Let the user override the test.
- ac_cv_path_NM="$NM"
-else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
- for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/nm; then
- # Check to see if the nm accepts a BSD-compat flag.
- # Adding the `sed 1q' prevents false positives on HP-UX, which says:
- # nm: unknown option "B" ignored
- if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
- ac_cv_path_NM="$ac_dir/nm -B"
- break
- elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
- ac_cv_path_NM="$ac_dir/nm -p"
- break
- else
- ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
- continue # so that we can try to find one that supports BSD flags
- fi
- fi
- done
- IFS="$ac_save_ifs"
- test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
-fi])
-NM="$ac_cv_path_NM"
-AC_MSG_RESULT([$NM])
-AC_SUBST(NM)
-])
-
-# AC_SYS_NM_PARSE - Check for command to grab the raw symbol name followed
-# by C symbol name from nm.
-AC_DEFUN(AC_SYS_NM_PARSE,
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-AC_REQUIRE([AC_PROG_NM])dnl
-# Check for command to grab the raw symbol name followed by C symbol from nm.
-AC_MSG_CHECKING([command to parse $NM output])
-AC_CACHE_VAL(ac_cv_sys_global_symbol_pipe,
-[# These are sane defaults that work on at least a few old systems.
-# {They come from Ultrix. What could be older than Ultrix?!! ;)}
-
-changequote(,)dnl
-# Character class describing NM global symbol codes.
-ac_symcode='[BCDEGRST]'
-
-# Regexp to match symbols that can be accessed directly from C.
-ac_sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
-
-# Transform the above into a raw symbol and a C symbol.
-ac_symxfrm='\1 \2\3 \3'
-
-# Transform an extracted symbol line into a proper C declaration
-ac_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'"
-
-# Define system-specific variables.
-case "$host_os" in
-aix*)
- ac_symcode='[BCDT]'
- ;;
-cygwin* | mingw*)
- ac_symcode='[ABCDGISTW]'
- ;;
-hpux*)
- ac_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^. .* \(.*\)$/extern char \1;/p'"
- ;;
-irix*)
- ac_symcode='[BCDEGRST]'
- ;;
-solaris*)
- ac_symcode='[BDT]'
- ;;
-esac
-
-# If we're using GNU nm, then use its standard symbol codes.
-if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
- ac_symcode='[ABCDGISTW]'
-fi
-changequote([,])dnl
-
-# Try without a prefix undercore, then with it.
-for ac_symprfx in "" "_"; do
-
- ac_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($ac_symcode\)[ ][ ]*\($ac_symprfx\)$ac_sympat$/$ac_symxfrm/p'"
-
- # Check to see that the pipe works correctly.
- ac_pipe_works=no
- rm -f conftest.$ac_ext
- cat > conftest.$ac_ext <<EOF
-#ifdef __cplusplus
-extern "C" {
-#endif
-char nm_test_var;
-void nm_test_func(){}
-#ifdef __cplusplus
-}
-#endif
-int main(){nm_test_var='a';nm_test_func;return 0;}
-EOF
-
- if AC_TRY_EVAL(ac_compile); then
- # Now try to grab the symbols.
- ac_nlist=conftest.nm
-
- if AC_TRY_EVAL(NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) && test -s "$ac_nlist"; then
-
- # Try sorting and uniquifying the output.
- if sort "$ac_nlist" | uniq > "$ac_nlist"T; then
- mv -f "$ac_nlist"T "$ac_nlist"
- else
- rm -f "$ac_nlist"T
- fi
-
- # Make sure that we snagged all the symbols we need.
- if egrep ' nm_test_var$' "$ac_nlist" >/dev/null; then
- if egrep ' nm_test_func$' "$ac_nlist" >/dev/null; then
- cat <<EOF > conftest.c
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-EOF
- # Now generate the symbol file.
- eval "$ac_global_symbol_to_cdecl"' < "$ac_nlist" >> conftest.c'
-
- cat <<EOF >> conftest.c
-#if defined (__STDC__) && __STDC__
-# define lt_ptr_t void *
-#else
-# define lt_ptr_t char *
-# define const
-#endif
-
-/* The mapping between symbol names and symbols. */
-const struct {
- const char *name;
- lt_ptr_t address;
-}
-changequote(,)dnl
-lt_preloaded_symbols[] =
-changequote([,])dnl
-{
-EOF
- sed 's/^. \(.*\) \(.*\)$/ {"\2", (lt_ptr_t) \&\2},/' < "$ac_nlist" >> conftest.c
- cat <<\EOF >> conftest.c
- {0, (lt_ptr_t) 0}
-};
-
-#ifdef __cplusplus
-}
-#endif
-EOF
- # Now try linking the two files.
- mv conftest.$ac_objext conftestm.$ac_objext
- ac_save_LIBS="$LIBS"
- ac_save_CFLAGS="$CFLAGS"
- LIBS="conftestm.$ac_objext"
- CFLAGS="$CFLAGS$no_builtin_flag"
- if AC_TRY_EVAL(ac_link) && test -s conftest; then
- ac_pipe_works=yes
- else
- echo "configure: failed program was:" >&AC_FD_CC
- cat conftest.c >&AC_FD_CC
- fi
- LIBS="$ac_save_LIBS"
- CFLAGS="$ac_save_CFLAGS"
- else
- echo "cannot find nm_test_func in $ac_nlist" >&AC_FD_CC
- fi
- else
- echo "cannot find nm_test_var in $ac_nlist" >&AC_FD_CC
- fi
- else
- echo "cannot run $ac_cv_sys_global_symbol_pipe" >&AC_FD_CC
- fi
- else
- echo "$progname: failed program was:" >&AC_FD_CC
- cat conftest.c >&AC_FD_CC
- fi
- rm -rf conftest*
-
- # Do not use the global_symbol_pipe unless it works.
- if test "$ac_pipe_works" = yes; then
- if test x"$ac_symprfx" = x"_"; then
- ac_cv_sys_symbol_underscore=yes
- else
- ac_cv_sys_symbol_underscore=no
- fi
- break
- else
- ac_cv_sys_global_symbol_pipe=
- fi
-done
-])
-
-ac_result=yes
-if test -z "$ac_cv_sys_global_symbol_pipe"; then
- ac_result=no
-fi
-AC_MSG_RESULT($ac_result)
-])
-
-# AC_SYS_LIBTOOL_CYGWIN - find tools needed on cygwin
-AC_DEFUN(AC_SYS_LIBTOOL_CYGWIN,
-[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
-AC_CHECK_TOOL(AS, as, false)
-])
-
-# AC_SYS_SYMBOL_UNDERSCORE - does the compiler prefix global symbols
-# with an underscore?
-AC_DEFUN(AC_SYS_SYMBOL_UNDERSCORE,
-[AC_REQUIRE([AC_PROG_NM])dnl
-AC_REQUIRE([AC_SYS_NM_PARSE])dnl
-AC_MSG_CHECKING([for _ prefix in compiled symbols])
-AC_CACHE_VAL(ac_cv_sys_symbol_underscore,
-[ac_cv_sys_symbol_underscore=no
-cat > conftest.$ac_ext <<EOF
-void nm_test_func(){}
-int main(){nm_test_func;return 0;}
-EOF
-if AC_TRY_EVAL(ac_compile); then
- # Now try to grab the symbols.
- ac_nlist=conftest.nm
- if AC_TRY_EVAL(NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) && test -s "$ac_nlist"; then
- # See whether the symbols have a leading underscore.
- if egrep '^. _nm_test_func' "$ac_nlist" >/dev/null; then
- ac_cv_sys_symbol_underscore=yes
- else
- if egrep '^. nm_test_func ' "$ac_nlist" >/dev/null; then
- :
- else
- echo "configure: cannot find nm_test_func in $ac_nlist" >&AC_FD_CC
- fi
- fi
- else
- echo "configure: cannot run $ac_cv_sys_global_symbol_pipe" >&AC_FD_CC
- fi
-else
- echo "configure: failed program was:" >&AC_FD_CC
- cat conftest.c >&AC_FD_CC
-fi
-rm -rf conftest*
-])
-AC_MSG_RESULT($ac_cv_sys_symbol_underscore)
-USE_SYMBOL_UNDERSCORE=${ac_cv_sys_symbol_underscore=no}
-AC_SUBST(USE_SYMBOL_UNDERSCORE)dnl
-])
-
-# AC_CHECK_LIBM - check for math library
-AC_DEFUN(AC_CHECK_LIBM, [
-AC_CHECK_LIB(mw, _mwvalidcheckl)
-AC_CHECK_LIB(m, cos)
-])
-
-# AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
-# the libltdl convenience library, adds --enable-ltdl-convenience to
-# the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
-# is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
-# to be `${top_builddir}/libltdl'. Make sure you start DIR with
-# '${top_builddir}/' (note the single quotes!) if your package is not
-# flat, and, if you're not using automake, define top_builddir as
-# appropriate in the Makefiles.
-AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [
- case "$enable_ltdl_convenience" in
- no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
- "") enable_ltdl_convenience=yes
- ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
- esac
- LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdlc.la
-])
-
-# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
-# the libltdl installable library, and adds --enable-ltdl-install to
-# the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
-# is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
-# to be `${top_builddir}/libltdl'. Make sure you start DIR with
-# '${top_builddir}/' (note the single quotes!) if your package is not
-# flat, and, if you're not using automake, define top_builddir as
-# appropriate in the Makefiles.
-# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
-AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [
- AC_CHECK_LIB(ltdl, main, LIBLTDL="-lltdl", [
- case "$enable_ltdl_install" in
- no) AC_MSG_WARN([libltdl not installed, but installation disabled]) ;;
- "") enable_ltdl_install=yes
- ac_configure_args="$ac_configure_args --enable-ltdl-install" ;;
- esac
- ])
- if test x"$enable_ltdl_install" != x"no"; then
- LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdl.la
- fi
-])
-
-dnl old names
-AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
-AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
-AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
-AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
-AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
-AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
-AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
-AC_DEFUN(AM_SYS_NM_PARSE, [indir([AC_SYS_NM_PARSE])])dnl
-AC_DEFUN(AM_SYS_SYMBOL_UNDERSCORE, [indir([AC_SYS_SYMBOL_UNDERSCORE])])dnl
-AC_DEFUN(AM_SYS_LIBTOOL_CYGWIN, [indir([AC_SYS_LIBTOOL_CYGWIN])])dnl
-
diff --git a/zlib/configure b/zlib/configure
index a453e884551..adabeddf569 100755
--- a/zlib/configure
+++ b/zlib/configure
@@ -32,7 +32,9 @@ ac_help="$ac_help
ac_help="$ac_help
--with-gnu-ld assume the C compiler uses GNU ld [default=no]"
ac_help="$ac_help
- --disable-libtool-lock force libtool not to do file locking"
+ --disable-libtool-lock avoid locking (might break parallel builds)"
+ac_help="$ac_help
+ --with-pic try to use only PIC/non-PIC objects [default=use both]"
# Initialize some variables set by options.
# The variables have the same names as the options, with
@@ -554,8 +556,43 @@ else
fi
+
+
+if test "x${with_target_subdir}" != x && \
+ test "${srcdir}" = "."; then
+ if test "${with_target_subdir}" != "."; then
+ zlib_basedir="${srcdir}/${with_multisrctop}../"
+ else
+ zlib_basedir="${srcdir}/${with_multisrctop}"
+ fi
+else
+ zlib_basedir="${srcdir}/"
+fi
+
ac_aux_dir=
-for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
+for ac_dir in $zlib_basedir.. $srcdir/$zlib_basedir..; do
+ if test -f $ac_dir/install-sh; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install-sh -c"
+ break
+ elif test -f $ac_dir/install.sh; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install.sh -c"
+ break
+ fi
+done
+if test -z "$ac_aux_dir"; then
+ { echo "configure: error: can not find install-sh or install.sh in $zlib_basedir.. $srcdir/$zlib_basedir.." 1>&2; exit 1; }
+fi
+ac_config_guess=$ac_aux_dir/config.guess
+ac_config_sub=$ac_aux_dir/config.sub
+ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
+
+if :; then :; else
+ # This overrides the previous occurrence for automake, but not for
+ # autoconf, which is exactly what we want.
+ ac_aux_dir=
+for ac_dir in .. $srcdir/..; do
if test -f $ac_dir/install-sh; then
ac_aux_dir=$ac_dir
ac_install_sh="$ac_aux_dir/install-sh -c"
@@ -567,12 +604,14 @@ for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
fi
done
if test -z "$ac_aux_dir"; then
- { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
+ { echo "configure: error: can not find install-sh or install.sh in .. $srcdir/.." 1>&2; exit 1; }
fi
ac_config_guess=$ac_aux_dir/config.guess
ac_config_sub=$ac_aux_dir/config.sub
ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
+fi
+
# Do some error checking and defaulting for the host and target type.
# The inputs are:
@@ -601,7 +640,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
fi
echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:605: checking host system type" >&5
+echo "configure:644: checking host system type" >&5
host_alias=$host
case "$host_alias" in
@@ -622,7 +661,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
echo "$ac_t""$host" 1>&6
echo $ac_n "checking target system type""... $ac_c" 1>&6
-echo "configure:626: checking target system type" >&5
+echo "configure:665: checking target system type" >&5
target_alias=$target
case "$target_alias" in
@@ -640,7 +679,7 @@ target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
echo "$ac_t""$target" 1>&6
echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:644: checking build system type" >&5
+echo "configure:683: checking build system type" >&5
build_alias=$build
case "$build_alias" in
@@ -662,6 +701,11 @@ test "$host_alias" != "$target_alias" &&
NONENONEs,x,x, &&
program_prefix=${target_alias}-
+
+# This works around an automake problem.
+mkinstalldirs="`cd $ac_aux_dir && pwd`/mkinstalldirs"
+
+
# Find a good install program. We prefer a C program (faster),
# so one script is as good as another. But avoid the broken or
# incompatible versions:
@@ -674,7 +718,7 @@ test "$host_alias" != "$target_alias" &&
# 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:678: checking for a BSD compatible install" >&5
+echo "configure:722: 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
@@ -727,7 +771,7 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
-echo "configure:731: checking whether build environment is sane" >&5
+echo "configure:775: checking whether build environment is sane" >&5
# Just in case
sleep 1
echo timestamp > conftestfile
@@ -784,7 +828,7 @@ test "$program_suffix" != NONE &&
test "$program_transform_name" = "" && program_transform_name="s,x,x,"
echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:788: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:832: 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
@@ -830,7 +874,7 @@ EOF
missing_dir=`cd $ac_aux_dir && pwd`
echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
-echo "configure:834: checking for working aclocal" >&5
+echo "configure:878: checking for working aclocal" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh.
@@ -843,7 +887,7 @@ else
fi
echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
-echo "configure:847: checking for working autoconf" >&5
+echo "configure:891: checking for working autoconf" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh.
@@ -856,7 +900,7 @@ else
fi
echo $ac_n "checking for working automake""... $ac_c" 1>&6
-echo "configure:860: checking for working automake" >&5
+echo "configure:904: checking for working automake" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh.
@@ -869,7 +913,7 @@ else
fi
echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
-echo "configure:873: checking for working autoheader" >&5
+echo "configure:917: checking for working autoheader" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh.
@@ -882,7 +926,7 @@ else
fi
echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
-echo "configure:886: checking for working makeinfo" >&5
+echo "configure:930: checking for working makeinfo" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh.
@@ -897,7 +941,7 @@ fi
echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
-echo "configure:901: checking whether to enable maintainer-specific portions of Makefiles" >&5
+echo "configure:945: 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"
@@ -920,26 +964,6 @@ fi
-ac_aux_dir=
-for ac_dir in .. $srcdir/..; do
- if test -f $ac_dir/install-sh; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/install-sh -c"
- break
- elif test -f $ac_dir/install.sh; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/install.sh -c"
- break
- fi
-done
-if test -z "$ac_aux_dir"; then
- { echo "configure: error: can not find install-sh or install.sh in .. $srcdir/.." 1>&2; exit 1; }
-fi
-ac_config_guess=$ac_aux_dir/config.guess
-ac_config_sub=$ac_aux_dir/config.sub
-ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
-
-
# Check whether --with-target-subdir or --without-target-subdir was given.
if test "${with_target_subdir+set}" = set; then
withval="$with_target_subdir"
@@ -965,19 +989,6 @@ else
test -z "$with_target_subdir" && multilib=no || multilib=yes
fi
-
-if test "x${with_target_subdir}" != x && \
- test "${srcdir}" = "."; then
- if test "${with_target_subdir}" != "."; then
- zlib_basedir="${srcdir}/${with_multisrctop}../"
- else
- zlib_basedir="${srcdir}/${with_multisrctop}"
- fi
-else
- zlib_basedir="${srcdir}/"
-fi
-
-
# Check whether --with-system-zlib or --without-system-zlib was given.
if test "${with_system_zlib+set}" = set; then
withval="$with_system_zlib"
@@ -989,7 +1000,7 @@ fi
# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:993: checking for $ac_word" >&5
+echo "configure:1004: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1019,7 +1030,7 @@ if test -z "$CC"; then
# Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1023: checking for $ac_word" >&5
+echo "configure:1034: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1068,7 +1079,7 @@ fi
fi
echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:1072: checking whether we are using GNU C" >&5
+echo "configure:1083: checking whether we are using GNU C" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1077,7 +1088,7 @@ else
yes;
#endif
EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1081: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1092: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
ac_cv_prog_gcc=yes
else
ac_cv_prog_gcc=no
@@ -1092,7 +1103,7 @@ if test $ac_cv_prog_gcc = yes; then
ac_save_CFLAGS="$CFLAGS"
CFLAGS=
echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:1096: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:1107: checking whether ${CC-cc} accepts -g" >&5
if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1128,12 +1139,12 @@ fi
# the result.
if false; then
echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
-echo "configure:1132: checking for Cygwin environment" >&5
+echo "configure:1143: checking for Cygwin environment" >&5
if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1137 "configure"
+#line 1148 "configure"
#include "confdefs.h"
int main() {
@@ -1144,7 +1155,7 @@ int main() {
return __CYGWIN__;
; return 0; }
EOF
-if { (eval echo configure:1148: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1159: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_cygwin=yes
else
@@ -1161,19 +1172,19 @@ echo "$ac_t""$ac_cv_cygwin" 1>&6
CYGWIN=
test "$ac_cv_cygwin" = yes && CYGWIN=yes
echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
-echo "configure:1165: checking for mingw32 environment" >&5
+echo "configure:1176: checking for mingw32 environment" >&5
if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1170 "configure"
+#line 1181 "configure"
#include "confdefs.h"
int main() {
return __MINGW32__;
; return 0; }
EOF
-if { (eval echo configure:1177: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1188: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_mingw32=yes
else
@@ -1192,7 +1203,7 @@ test "$ac_cv_mingw32" = yes && MINGW32=yes
echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:1196: checking for executable suffix" >&5
+echo "configure:1207: checking for executable suffix" >&5
if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1202,7 +1213,7 @@ else
rm -f conftest*
echo 'int main () { return 0; }' > conftest.$ac_ext
ac_cv_exeext=
- if { (eval echo configure:1206: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+ if { (eval echo configure:1217: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
for file in conftest.*; do
case $file in
*.c | *.o | *.obj | *.ilk | *.pdb) ;;
@@ -1227,7 +1238,7 @@ fi
if test "${enable_shared+set}" = set; then
enableval="$enable_shared"
p=${PACKAGE-default}
-case "$enableval" in
+case $enableval in
yes) enable_shared=yes ;;
no) enable_shared=no ;;
*)
@@ -1250,7 +1261,7 @@ fi
if test "${enable_static+set}" = set; then
enableval="$enable_static"
p=${PACKAGE-default}
-case "$enableval" in
+case $enableval in
yes) enable_static=yes ;;
no) enable_static=no ;;
*)
@@ -1273,7 +1284,7 @@ fi
if test "${enable_fast_install+set}" = set; then
enableval="$enable_fast_install"
p=${PACKAGE-default}
-case "$enableval" in
+case $enableval in
yes) enable_fast_install=yes ;;
no) enable_fast_install=no ;;
*)
@@ -1292,36 +1303,6 @@ else
enable_fast_install=yes
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:1299: 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
- if test -n "$RANLIB"; then
- ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
-else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
- ac_dummy="$PATH"
- for ac_dir in $ac_dummy; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_prog_RANLIB="ranlib"
- break
- fi
- done
- IFS="$ac_save_ifs"
- test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
-fi
-fi
-RANLIB="$ac_cv_prog_RANLIB"
-if test -n "$RANLIB"; then
- echo "$ac_t""$RANLIB" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
# Check whether --with-gnu-ld or --without-gnu-ld was given.
if test "${with_gnu_ld+set}" = set; then
withval="$with_gnu_ld"
@@ -1331,14 +1312,20 @@ else
fi
ac_prog=ld
-if test "$ac_cv_prog_gcc" = yes; then
+if test "$GCC" = yes; then
# Check if gcc -print-prog-name=ld gives a path.
echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
-echo "configure:1338: checking for ld used by GCC" >&5
- ac_prog=`($CC -print-prog-name=ld) 2>&5`
- case "$ac_prog" in
+echo "configure:1319: checking for ld used by GCC" >&5
+ case $host in
+ *-*-mingw*)
+ # gcc leaves a trailing carriage return which upsets mingw
+ ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+ *)
+ ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+ esac
+ case $ac_prog in
# Accept absolute paths.
- /* | [A-Za-z]:[\\/]*)
+ [\\/]* | [A-Za-z]:[\\/]*)
re_direlt='/[^/][^/]*/\.\./'
# Canonicalize the path of ld
ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
@@ -1358,24 +1345,24 @@ echo "configure:1338: checking for ld used by GCC" >&5
esac
elif test "$with_gnu_ld" = yes; then
echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
-echo "configure:1362: checking for GNU ld" >&5
+echo "configure:1349: checking for GNU ld" >&5
else
echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
-echo "configure:1365: checking for non-GNU ld" >&5
+echo "configure:1352: checking for non-GNU ld" >&5
fi
-if eval "test \"`echo '$''{'ac_cv_path_LD'+set}'`\" = set"; then
+if eval "test \"`echo '$''{'lt_cv_path_LD'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test -z "$LD"; then
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
for ac_dir in $PATH; do
test -z "$ac_dir" && ac_dir=.
- if test -f "$ac_dir/$ac_prog"; then
- ac_cv_path_LD="$ac_dir/$ac_prog"
+ if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+ lt_cv_path_LD="$ac_dir/$ac_prog"
# Check to see if the program is GNU ld. I'd rather use --version,
# but apparently some GNU ld's only accept -v.
# Break only if it was the GNU/non-GNU ld that we prefer.
- if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
+ if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
test "$with_gnu_ld" != no && break
else
test "$with_gnu_ld" != yes && break
@@ -1384,525 +1371,675 @@ else
done
IFS="$ac_save_ifs"
else
- ac_cv_path_LD="$LD" # Let the user override the test with a path.
+ lt_cv_path_LD="$LD" # Let the user override the test with a path.
fi
fi
-LD="$ac_cv_path_LD"
+LD="$lt_cv_path_LD"
if test -n "$LD"; then
echo "$ac_t""$LD" 1>&6
else
echo "$ac_t""no" 1>&6
fi
test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
-
echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
-echo "configure:1401: checking if the linker ($LD) is GNU ld" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_gnu_ld'+set}'`\" = set"; then
+echo "configure:1387: checking if the linker ($LD) is GNU ld" >&5
+if eval "test \"`echo '$''{'lt_cv_prog_gnu_ld'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# I'd rather use --version here, but apparently some GNU ld's only accept -v.
if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
- ac_cv_prog_gnu_ld=yes
+ lt_cv_prog_gnu_ld=yes
else
- ac_cv_prog_gnu_ld=no
+ lt_cv_prog_gnu_ld=no
fi
fi
-echo "$ac_t""$ac_cv_prog_gnu_ld" 1>&6
+echo "$ac_t""$lt_cv_prog_gnu_ld" 1>&6
+with_gnu_ld=$lt_cv_prog_gnu_ld
+echo $ac_n "checking for $LD option to reload object files""... $ac_c" 1>&6
+echo "configure:1404: checking for $LD option to reload object files" >&5
+if eval "test \"`echo '$''{'lt_cv_ld_reload_flag'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ lt_cv_ld_reload_flag='-r'
+fi
+
+echo "$ac_t""$lt_cv_ld_reload_flag" 1>&6
+reload_flag=$lt_cv_ld_reload_flag
+test -n "$reload_flag" && reload_flag=" $reload_flag"
+
echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
-echo "configure:1417: checking for BSD-compatible nm" >&5
-if eval "test \"`echo '$''{'ac_cv_path_NM'+set}'`\" = set"; then
+echo "configure:1416: checking for BSD-compatible nm" >&5
+if eval "test \"`echo '$''{'lt_cv_path_NM'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test -n "$NM"; then
# Let the user override the test.
- ac_cv_path_NM="$NM"
+ lt_cv_path_NM="$NM"
else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/nm; then
+ tmp_nm=$ac_dir/${ac_tool_prefix}nm
+ if test -f $tmp_nm || test -f $tmp_nm$ac_exeext ; then
# Check to see if the nm accepts a BSD-compat flag.
# Adding the `sed 1q' prevents false positives on HP-UX, which says:
# nm: unknown option "B" ignored
- if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
- ac_cv_path_NM="$ac_dir/nm -B"
+ # Tru64's nm complains that /dev/null is an invalid object file
+ if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then
+ lt_cv_path_NM="$tmp_nm -B"
break
- elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
- ac_cv_path_NM="$ac_dir/nm -p"
+ elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
+ lt_cv_path_NM="$tmp_nm -p"
break
else
- ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
+ lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
continue # so that we can try to find one that supports BSD flags
fi
fi
done
IFS="$ac_save_ifs"
- test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
+ test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
fi
fi
-NM="$ac_cv_path_NM"
+NM="$lt_cv_path_NM"
echo "$ac_t""$NM" 1>&6
-
-# Check for command to grab the raw symbol name followed by C symbol from nm.
-echo $ac_n "checking command to parse $NM output""... $ac_c" 1>&6
-echo "configure:1455: checking command to parse $NM output" >&5
-if eval "test \"`echo '$''{'ac_cv_sys_global_symbol_pipe'+set}'`\" = set"; then
+echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
+echo "configure:1454: checking whether ln -s works" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
- # These are sane defaults that work on at least a few old systems.
-# {They come from Ultrix. What could be older than Ultrix?!! ;)}
-
-# Character class describing NM global symbol codes.
-ac_symcode='[BCDEGRST]'
-
-# Regexp to match symbols that can be accessed directly from C.
-ac_sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
-
-# Transform the above into a raw symbol and a C symbol.
-ac_symxfrm='\1 \2\3 \3'
-
-# Transform an extracted symbol line into a proper C declaration
-ac_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'"
+ rm -f conftestdata
+if ln -s X conftestdata 2>/dev/null
+then
+ rm -f conftestdata
+ ac_cv_prog_LN_S="ln -s"
+else
+ ac_cv_prog_LN_S=ln
+fi
+fi
+LN_S="$ac_cv_prog_LN_S"
+if test "$ac_cv_prog_LN_S" = "ln -s"; then
+ echo "$ac_t""yes" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
-# Define system-specific variables.
-case "$host_os" in
+echo $ac_n "checking how to recognise dependant libraries""... $ac_c" 1>&6
+echo "configure:1475: checking how to recognise dependant libraries" >&5
+if eval "test \"`echo '$''{'lt_cv_deplibs_check_method'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ lt_cv_file_magic_cmd='$MAGIC_CMD'
+lt_cv_file_magic_test_file=
+lt_cv_deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# `unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [regex]' -- check by looking for files in library path
+# which responds to the $file_magic_cmd with a given egrep regex.
+# If you have `file' or equivalent on your system and you're not sure
+# whether `pass_all' will *always* work, you probably want this one.
+
+case $host_os in
aix*)
- ac_symcode='[BCDT]'
- ;;
-cygwin* | mingw*)
- ac_symcode='[ABCDGISTW]'
- ;;
-hpux*)
- ac_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^. .* \(.*\)$/extern char \1;/p'"
- ;;
-irix*)
- ac_symcode='[BCDEGRST]'
- ;;
-solaris*)
- ac_symcode='[BDT]'
+ lt_cv_deplibs_check_method=pass_all
;;
-esac
-
-# If we're using GNU nm, then use its standard symbol codes.
-if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
- ac_symcode='[ABCDGISTW]'
-fi
-# Try without a prefix undercore, then with it.
-for ac_symprfx in "" "_"; do
+beos*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
- ac_cv_sys_global_symbol_pipe="sed -n -e 's/^.* \($ac_symcode\) *\($ac_symprfx\)$ac_sympat$/$ac_symxfrm/p'"
+bsdi4*)
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
+ lt_cv_file_magic_cmd='/usr/bin/file -L'
+ lt_cv_file_magic_test_file=/shlib/libc.so
+ ;;
- # Check to see that the pipe works correctly.
- ac_pipe_works=no
- rm -f conftest.$ac_ext
- cat > conftest.$ac_ext <<EOF
-#ifdef __cplusplus
-extern "C" {
-#endif
-char nm_test_var;
-void nm_test_func(){}
-#ifdef __cplusplus
-}
-#endif
-int main(){nm_test_var='a';nm_test_func;return 0;}
-EOF
+cygwin* | mingw* |pw32*)
+ lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
+ lt_cv_file_magic_cmd='$OBJDUMP -f'
+ ;;
- if { (eval echo configure:1518: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- # Now try to grab the symbols.
- ac_nlist=conftest.nm
-
- if { (eval echo configure:1522: \"$NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist\") 1>&5; (eval $NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) 2>&5; } && test -s "$ac_nlist"; then
+darwin* | rhapsody*)
+ lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library'
+ lt_cv_file_magic_cmd='/usr/bin/file -L'
+ case "$host_os" in
+ rhapsody* | darwin1.012)
+ lt_cv_file_magic_test_file='/System/Library/Frameworks/System.framework/System'
+ ;;
+ *) # Darwin 1.3 on
+ lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib'
+ ;;
+ esac
+ ;;
- # Try sorting and uniquifying the output.
- if sort "$ac_nlist" | uniq > "$ac_nlist"T; then
- mv -f "$ac_nlist"T "$ac_nlist"
- else
- rm -f "$ac_nlist"T
- fi
+freebsd* )
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ case $host_cpu in
+ i*86 )
+ # Not sure whether the presence of OpenBSD here was a mistake.
+ # Let's accept both of them until this is cleared up.
+ lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+ ;;
+ esac
+ else
+ lt_cv_deplibs_check_method=pass_all
+ fi
+ ;;
- # Make sure that we snagged all the symbols we need.
- if egrep ' nm_test_var$' "$ac_nlist" >/dev/null; then
- if egrep ' nm_test_func$' "$ac_nlist" >/dev/null; then
- cat <<EOF > conftest.c
-#ifdef __cplusplus
-extern "C" {
-#endif
+gnu*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
-EOF
- # Now generate the symbol file.
- eval "$ac_global_symbol_to_cdecl"' < "$ac_nlist" >> conftest.c'
+hpux10.20*|hpux11*)
+ lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=/usr/lib/libc.sl
+ ;;
- cat <<EOF >> conftest.c
-#if defined (__STDC__) && __STDC__
-# define lt_ptr_t void *
-#else
-# define lt_ptr_t char *
-# define const
-#endif
+irix5* | irix6*)
+ case $host_os in
+ irix5*)
+ # this will be overridden with pass_all, but let us keep it just in case
+ lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1"
+ ;;
+ *)
+ case $LD in
+ *-32|*"-32 ") libmagic=32-bit;;
+ *-n32|*"-n32 ") libmagic=N32;;
+ *-64|*"-64 ") libmagic=64-bit;;
+ *) libmagic=never-match;;
+ esac
+ # this will be overridden with pass_all, but let us keep it just in case
+ lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1"
+ ;;
+ esac
+ lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*`
+ lt_cv_deplibs_check_method=pass_all
+ ;;
-/* The mapping between symbol names and symbols. */
-const struct {
- const char *name;
- lt_ptr_t address;
-}
-lt_preloaded_symbols[] =
-{
-EOF
- sed 's/^. \(.*\) \(.*\)$/ {"\2", (lt_ptr_t) \&\2},/' < "$ac_nlist" >> conftest.c
- cat <<\EOF >> conftest.c
- {0, (lt_ptr_t) 0}
-};
+# This must be Linux ELF.
+linux-gnu*)
+ case $host_cpu in
+ alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* )
+ lt_cv_deplibs_check_method=pass_all ;;
+ *)
+ # glibc up to 2.1.1 does not perform some relocations on ARM
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;;
+ esac
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
-#ifdef __cplusplus
-}
-#endif
-EOF
- # Now try linking the two files.
- mv conftest.$ac_objext conftestm.$ac_objext
- ac_save_LIBS="$LIBS"
- ac_save_CFLAGS="$CFLAGS"
- LIBS="conftestm.$ac_objext"
- CFLAGS="$CFLAGS$no_builtin_flag"
- if { (eval echo configure:1574: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
- ac_pipe_works=yes
- else
- echo "configure: failed program was:" >&5
- cat conftest.c >&5
- fi
- LIBS="$ac_save_LIBS"
- CFLAGS="$ac_save_CFLAGS"
- else
- echo "cannot find nm_test_func in $ac_nlist" >&5
- fi
- else
- echo "cannot find nm_test_var in $ac_nlist" >&5
- fi
- else
- echo "cannot run $ac_cv_sys_global_symbol_pipe" >&5
- fi
+netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
else
- echo "$progname: failed program was:" >&5
- cat conftest.c >&5
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so$'
fi
- rm -rf conftest*
+ ;;
- # Do not use the global_symbol_pipe unless it works.
- if test "$ac_pipe_works" = yes; then
- if test x"$ac_symprfx" = x"_"; then
- ac_cv_sys_symbol_underscore=yes
- else
- ac_cv_sys_symbol_underscore=no
- fi
- break
- else
- ac_cv_sys_global_symbol_pipe=
- fi
-done
+newsos6)
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=/usr/lib/libnls.so
+ ;;
-fi
+osf3* | osf4* | osf5*)
+ # this will be overridden with pass_all, but let us keep it just in case
+ lt_cv_deplibs_check_method='file_magic COFF format alpha shared library'
+ lt_cv_file_magic_test_file=/shlib/libc.so
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+sco3.2v5*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
-ac_result=yes
-if test -z "$ac_cv_sys_global_symbol_pipe"; then
- ac_result=no
-fi
-echo "$ac_t""$ac_result" 1>&6
+solaris*)
+ lt_cv_deplibs_check_method=pass_all
+ lt_cv_file_magic_test_file=/lib/libc.so
+ ;;
-echo $ac_n "checking for _ prefix in compiled symbols""... $ac_c" 1>&6
-echo "configure:1620: checking for _ prefix in compiled symbols" >&5
-if eval "test \"`echo '$''{'ac_cv_sys_symbol_underscore'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- ac_cv_sys_symbol_underscore=no
-cat > conftest.$ac_ext <<EOF
-void nm_test_func(){}
-int main(){nm_test_func;return 0;}
-EOF
-if { (eval echo configure:1629: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- # Now try to grab the symbols.
- ac_nlist=conftest.nm
- if { (eval echo configure:1632: \"$NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist\") 1>&5; (eval $NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) 2>&5; } && test -s "$ac_nlist"; then
- # See whether the symbols have a leading underscore.
- if egrep '^. _nm_test_func' "$ac_nlist" >/dev/null; then
- ac_cv_sys_symbol_underscore=yes
- else
- if egrep '^. nm_test_func ' "$ac_nlist" >/dev/null; then
- :
- else
- echo "configure: cannot find nm_test_func in $ac_nlist" >&5
- fi
- fi
- else
- echo "configure: cannot run $ac_cv_sys_global_symbol_pipe" >&5
- fi
-else
- echo "configure: failed program was:" >&5
- cat conftest.c >&5
-fi
-rm -rf conftest*
+sysv5uw[78]* | sysv4*uw2*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ case $host_vendor in
+ ncr)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ motorola)
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+ ;;
+ esac
+ ;;
+esac
fi
-echo "$ac_t""$ac_cv_sys_symbol_underscore" 1>&6
-USE_SYMBOL_UNDERSCORE=${ac_cv_sys_symbol_underscore=no}
+echo "$ac_t""$lt_cv_deplibs_check_method" 1>&6
+file_magic_cmd=$lt_cv_file_magic_cmd
+deplibs_check_method=$lt_cv_deplibs_check_method
-echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:1658: checking whether ln -s works" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
+echo $ac_n "checking for object suffix""... $ac_c" 1>&6
+echo "configure:1639: checking for object suffix" >&5
+if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
- rm -f conftestdata
-if ln -s X conftestdata 2>/dev/null
-then
- rm -f conftestdata
- ac_cv_prog_LN_S="ln -s"
+ rm -f conftest*
+echo 'int i = 1;' > conftest.$ac_ext
+if { (eval echo configure:1645: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ for ac_file in conftest.*; do
+ case $ac_file in
+ *.c) ;;
+ *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;;
+ esac
+ done
else
- ac_cv_prog_LN_S=ln
-fi
+ { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; }
fi
-LN_S="$ac_cv_prog_LN_S"
-if test "$ac_cv_prog_LN_S" = "ln -s"; then
- echo "$ac_t""yes" 1>&6
-else
- echo "$ac_t""no" 1>&6
+rm -f conftest*
fi
+echo "$ac_t""$ac_cv_objext" 1>&6
+OBJEXT=$ac_cv_objext
+ac_objext=$ac_cv_objext
+
if test $host != $build; then
ac_tool_prefix=${host_alias}-
else
ac_tool_prefix=
fi
+# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
-# Check for any special flags to pass to ltconfig.
-libtool_flags="--cache-file=$cache_file"
-test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
-test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
-test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
-test "$lt_dlopen" = yes && libtool_flags="$libtool_flags --enable-dlopen"
-test "$silent" = yes && libtool_flags="$libtool_flags --silent"
-test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
-test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
+# Only perform the check for file, if the check method requires it
+case $deplibs_check_method in
+file_magic*)
+ if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+ echo $ac_n "checking for ${ac_tool_prefix}file""... $ac_c" 1>&6
+echo "configure:1675: checking for ${ac_tool_prefix}file" >&5
+if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ case $MAGIC_CMD in
+ /*)
+ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+ ;;
+ ?:/*)
+ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path.
+ ;;
+ *)
+ ac_save_MAGIC_CMD="$MAGIC_CMD"
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="/usr/bin:$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/${ac_tool_prefix}file; then
+ lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file"
+ if test -n "$file_magic_test_file"; then
+ case $deplibs_check_method in
+ "file_magic "*)
+ file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
+ MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+ if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+ egrep "$file_magic_regex" > /dev/null; then
+ :
+ else
+ cat <<EOF 1>&2
-# Some flags need to be propagated to the compiler or linker for good
-# libtool support.
-case "$host" in
-*-*-irix6*)
- # Find out which ABI we are using.
- echo '#line 1700 "configure"' > conftest.$ac_ext
- if { (eval echo configure:1701: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- case "`/usr/bin/file conftest.o`" in
- *32-bit*)
- LD="${LD-ld} -32"
- ;;
- *N32*)
- LD="${LD-ld} -n32"
- ;;
- *64-bit*)
- LD="${LD-ld} -64"
- ;;
- esac
- fi
- rm -rf conftest*
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such. This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem. Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool@gnu.org
+
+EOF
+ fi ;;
+ esac
+ fi
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+ MAGIC_CMD="$ac_save_MAGIC_CMD"
;;
+esac
+fi
-*-*-sco3.2v5*)
- # On SCO OpenServer 5, we need -belf to get full-featured binaries.
- SAVE_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS -belf"
- echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6
-echo "configure:1722: checking whether the C compiler needs -belf" >&5
-if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+ echo "$ac_t""$MAGIC_CMD" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+if test -z "$lt_cv_path_MAGIC_CMD"; then
+ if test -n "$ac_tool_prefix"; then
+ echo $ac_n "checking for file""... $ac_c" 1>&6
+echo "configure:1737: checking for file" >&5
+if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
- cat > conftest.$ac_ext <<EOF
-#line 1727 "configure"
-#include "confdefs.h"
+ case $MAGIC_CMD in
+ /*)
+ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+ ;;
+ ?:/*)
+ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path.
+ ;;
+ *)
+ ac_save_MAGIC_CMD="$MAGIC_CMD"
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="/usr/bin:$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/file; then
+ lt_cv_path_MAGIC_CMD="$ac_dir/file"
+ if test -n "$file_magic_test_file"; then
+ case $deplibs_check_method in
+ "file_magic "*)
+ file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
+ MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+ if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+ egrep "$file_magic_regex" > /dev/null; then
+ :
+ else
+ cat <<EOF 1>&2
-int main() {
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such. This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem. Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool@gnu.org
-; return 0; }
EOF
-if { (eval echo configure:1734: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- lt_cv_cc_needs_belf=yes
+ fi ;;
+ esac
+ fi
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+ MAGIC_CMD="$ac_save_MAGIC_CMD"
+ ;;
+esac
+fi
+
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+ echo "$ac_t""$MAGIC_CMD" 1>&6
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- lt_cv_cc_needs_belf=no
+ echo "$ac_t""no" 1>&6
fi
-rm -f conftest*
+
+ else
+ MAGIC_CMD=:
+ fi
fi
-echo "$ac_t""$lt_cv_cc_needs_belf" 1>&6
- if test x"$lt_cv_cc_needs_belf" != x"yes"; then
- # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
- CFLAGS="$SAVE_CFLAGS"
fi
;;
+esac
-*-*-cygwin*)
- # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
-set dummy ${ac_tool_prefix}dlltool; ac_word=$2
+# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1757: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_DLLTOOL'+set}'`\" = set"; then
+echo "configure:1808: 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
- if test -n "$DLLTOOL"; then
- ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
+ if test -n "$RANLIB"; then
+ ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
else
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
ac_dummy="$PATH"
for ac_dir in $ac_dummy; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$ac_word; then
- ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
+ ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
break
fi
done
IFS="$ac_save_ifs"
fi
fi
-DLLTOOL="$ac_cv_prog_DLLTOOL"
-if test -n "$DLLTOOL"; then
- echo "$ac_t""$DLLTOOL" 1>&6
+RANLIB="$ac_cv_prog_RANLIB"
+if test -n "$RANLIB"; then
+ echo "$ac_t""$RANLIB" 1>&6
else
echo "$ac_t""no" 1>&6
fi
-if test -z "$ac_cv_prog_DLLTOOL"; then
+if test -z "$ac_cv_prog_RANLIB"; then
if test -n "$ac_tool_prefix"; then
- # Extract the first word of "dlltool", so it can be a program name with args.
-set dummy dlltool; ac_word=$2
+ # 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:1789: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_DLLTOOL'+set}'`\" = set"; then
+echo "configure:1840: 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
- if test -n "$DLLTOOL"; then
- ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
+ if test -n "$RANLIB"; then
+ ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
else
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
ac_dummy="$PATH"
for ac_dir in $ac_dummy; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$ac_word; then
- ac_cv_prog_DLLTOOL="dlltool"
+ ac_cv_prog_RANLIB="ranlib"
break
fi
done
IFS="$ac_save_ifs"
- test -z "$ac_cv_prog_DLLTOOL" && ac_cv_prog_DLLTOOL="false"
+ test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
fi
fi
-DLLTOOL="$ac_cv_prog_DLLTOOL"
-if test -n "$DLLTOOL"; then
- echo "$ac_t""$DLLTOOL" 1>&6
+RANLIB="$ac_cv_prog_RANLIB"
+if test -n "$RANLIB"; then
+ echo "$ac_t""$RANLIB" 1>&6
else
echo "$ac_t""no" 1>&6
fi
else
- DLLTOOL="false"
+ RANLIB=":"
fi
fi
-# Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args.
-set dummy ${ac_tool_prefix}as; ac_word=$2
+# Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1824: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then
+echo "configure:1875: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
- if test -n "$AS"; then
- ac_cv_prog_AS="$AS" # Let the user override the test.
+ if test -n "$STRIP"; then
+ ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
else
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
ac_dummy="$PATH"
for ac_dir in $ac_dummy; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$ac_word; then
- ac_cv_prog_AS="${ac_tool_prefix}as"
+ ac_cv_prog_STRIP="${ac_tool_prefix}strip"
break
fi
done
IFS="$ac_save_ifs"
fi
fi
-AS="$ac_cv_prog_AS"
-if test -n "$AS"; then
- echo "$ac_t""$AS" 1>&6
+STRIP="$ac_cv_prog_STRIP"
+if test -n "$STRIP"; then
+ echo "$ac_t""$STRIP" 1>&6
else
echo "$ac_t""no" 1>&6
fi
-if test -z "$ac_cv_prog_AS"; then
+if test -z "$ac_cv_prog_STRIP"; then
if test -n "$ac_tool_prefix"; then
- # Extract the first word of "as", so it can be a program name with args.
-set dummy as; ac_word=$2
+ # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1856: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then
+echo "configure:1907: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
- if test -n "$AS"; then
- ac_cv_prog_AS="$AS" # Let the user override the test.
+ if test -n "$STRIP"; then
+ ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
else
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
ac_dummy="$PATH"
for ac_dir in $ac_dummy; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$ac_word; then
- ac_cv_prog_AS="as"
+ ac_cv_prog_STRIP="strip"
break
fi
done
IFS="$ac_save_ifs"
- test -z "$ac_cv_prog_AS" && ac_cv_prog_AS="false"
+ test -z "$ac_cv_prog_STRIP" && ac_cv_prog_STRIP=":"
fi
fi
-AS="$ac_cv_prog_AS"
-if test -n "$AS"; then
- echo "$ac_t""$AS" 1>&6
+STRIP="$ac_cv_prog_STRIP"
+if test -n "$STRIP"; then
+ echo "$ac_t""$STRIP" 1>&6
else
echo "$ac_t""no" 1>&6
fi
else
- AS="false"
+ STRIP=":"
fi
fi
- ;;
-
-esac
+# Check for any special flags to pass to ltconfig.
+libtool_flags="--cache-file=$cache_file"
+test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
+test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
+test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
+test "$GCC" = yes && libtool_flags="$libtool_flags --with-gcc"
+test "$lt_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
-# enable the --disable-libtool-lock switch
# Check whether --enable-libtool-lock or --disable-libtool-lock was given.
if test "${enable_libtool_lock+set}" = set; then
enableval="$enable_libtool_lock"
- need_locks=$enableval
+ :
+fi
+
+test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
+test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
+
+# Check whether --with-pic or --without-pic was given.
+if test "${with_pic+set}" = set; then
+ withval="$with_pic"
+ pic_mode="$withval"
else
- need_locks=yes
+ pic_mode=default
fi
+test x"$pic_mode" = xyes && libtool_flags="$libtool_flags --prefer-pic"
+test x"$pic_mode" = xno && libtool_flags="$libtool_flags --prefer-non-pic"
+
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case $host in
+*-*-irix6*)
+ # Find out which ABI we are using.
+ echo '#line 1974 "configure"' > conftest.$ac_ext
+ if { (eval echo configure:1975: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -32"
+ ;;
+ *N32*)
+ LD="${LD-ld} -n32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -64"
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+
+*-*-sco3.2v5*)
+ # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+ SAVE_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -belf"
+ echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6
+echo "configure:1996: checking whether the C compiler needs -belf" >&5
+if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+
+ ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+ cat > conftest.$ac_ext <<EOF
+#line 2009 "configure"
+#include "confdefs.h"
-if test x"$need_locks" = xno; then
- libtool_flags="$libtool_flags --disable-lock"
+int main() {
+
+; return 0; }
+EOF
+if { (eval echo configure:2016: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ lt_cv_cc_needs_belf=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ lt_cv_cc_needs_belf=no
fi
+rm -f conftest*
+ ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+fi
+
+echo "$ac_t""$lt_cv_cc_needs_belf" 1>&6
+ if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+ # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+ CFLAGS="$SAVE_CFLAGS"
+ fi
+ ;;
+
+
+esac
# Save cache, so that ltconfig can load it
@@ -1955,11 +2092,14 @@ rm -f confcache
# Actually configure libtool. ac_aux_dir is where install-sh is found.
-CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
-LD="$LD" NM="$NM" RANLIB="$RANLIB" LN_S="$LN_S" \
-DLLTOOL="$DLLTOOL" AS="$AS" \
+AR="$AR" LTCC="$CC" CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
+MAGIC_CMD="$MAGIC_CMD" LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
+LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" STRIP="$STRIP" \
+AS="$AS" DLLTOOL="$DLLTOOL" OBJDUMP="$OBJDUMP" \
+objext="$OBJEXT" exeext="$EXEEXT" reload_flag="$reload_flag" \
+deplibs_check_method="$deplibs_check_method" file_magic_cmd="$file_magic_cmd" \
${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
-$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
+$libtool_flags --no-verify --build="$build" $ac_aux_dir/ltmain.sh $host \
|| { echo "configure: error: libtool configure failed" 1>&2; exit 1; }
# Reload cache, that may have been modified by ltconfig
@@ -1973,7 +2113,7 @@ fi
# This can be used to rebuild libtool when needed
-LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
+LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh $ac_aux_dir/ltcf-c.sh"
# Always use our own libtool.
LIBTOOL='$(SHELL) $(top_builddir)/libtool'
@@ -1982,6 +2122,11 @@ LIBTOOL='$(SHELL) $(top_builddir)/libtool'
# clobbered by the next message.
exec 5>>./config.log
+
+
+
+
+
if test -z "$with_target_subdir" || test "$with_target_subdir" = "."; then
COMPPATH=.
@@ -1993,7 +2138,7 @@ fi
# Find CPP now so that any conditional tests below won't do it and
# thereby make the resulting definitions conditional.
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:1997: checking how to run the C preprocessor" >&5
+echo "configure:2142: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
@@ -2008,13 +2153,13 @@ else
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp.
cat > conftest.$ac_ext <<EOF
-#line 2012 "configure"
+#line 2157 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2018: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2163: \"$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
:
@@ -2025,13 +2170,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
-#line 2029 "configure"
+#line 2174 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2035: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2180: \"$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
:
@@ -2042,13 +2187,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -nologo -E"
cat > conftest.$ac_ext <<EOF
-#line 2046 "configure"
+#line 2191 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2052: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2197: \"$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
:
@@ -2096,17 +2241,17 @@ else
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2100: checking for $ac_hdr" >&5
+echo "configure:2245: 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 2105 "configure"
+#line 2250 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2110: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2255: \"$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*
@@ -2135,12 +2280,12 @@ done
for ac_func in getpagesize
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2139: checking for $ac_func" >&5
+echo "configure:2284: 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 2144 "configure"
+#line 2289 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -2163,7 +2308,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:2167: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2312: \"$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
@@ -2188,7 +2333,7 @@ fi
done
echo $ac_n "checking for working mmap""... $ac_c" 1>&6
-echo "configure:2192: checking for working mmap" >&5
+echo "configure:2337: checking for working mmap" >&5
if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2196,7 +2341,7 @@ else
ac_cv_func_mmap_fixed_mapped=no
else
cat > conftest.$ac_ext <<EOF
-#line 2200 "configure"
+#line 2345 "configure"
#include "confdefs.h"
/* Thanks to Mike Haertel and Jim Avera for this test.
@@ -2336,7 +2481,7 @@ main()
}
EOF
-if { (eval echo configure:2340: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2485: \"$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
@@ -2361,12 +2506,12 @@ fi
for ac_func in memcpy strerror
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2365: checking for $ac_func" >&5
+echo "configure:2510: 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 2370 "configure"
+#line 2515 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -2389,7 +2534,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:2393: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2538: \"$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
@@ -2416,7 +2561,7 @@ done
if test "$with_system_zlib" = yes; then
echo $ac_n "checking for deflate in -lz""... $ac_c" 1>&6
-echo "configure:2420: checking for deflate in -lz" >&5
+echo "configure:2565: checking for deflate in -lz" >&5
ac_lib_var=`echo z'_'deflate | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -2424,7 +2569,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lz $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2428 "configure"
+#line 2573 "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
@@ -2435,7 +2580,7 @@ int main() {
deflate()
; return 0; }
EOF
-if { (eval echo configure:2439: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2584: \"$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
@@ -2467,17 +2612,17 @@ for ac_hdr in unistd.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2471: checking for $ac_hdr" >&5
+echo "configure:2616: 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 2476 "configure"
+#line 2621 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2481: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2626: \"$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*
@@ -2674,6 +2819,7 @@ s%@includedir@%$includedir%g
s%@oldincludedir@%$oldincludedir%g
s%@infodir@%$infodir%g
s%@mandir@%$mandir%g
+s%@zlib_basedir@%$zlib_basedir%g
s%@host@%$host%g
s%@host_alias@%$host_alias%g
s%@host_cpu@%$host_cpu%g
@@ -2689,6 +2835,7 @@ s%@build_alias@%$build_alias%g
s%@build_cpu@%$build_cpu%g
s%@build_vendor@%$build_vendor%g
s%@build_os@%$build_os%g
+s%@mkinstalldirs@%$mkinstalldirs%g
s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
s%@INSTALL_DATA@%$INSTALL_DATA%g
@@ -2703,16 +2850,12 @@ s%@SET_MAKE@%$SET_MAKE%g
s%@MAINTAINER_MODE_TRUE@%$MAINTAINER_MODE_TRUE%g
s%@MAINTAINER_MODE_FALSE@%$MAINTAINER_MODE_FALSE%g
s%@MAINT@%$MAINT%g
-s%@zlib_basedir@%$zlib_basedir%g
s%@CC@%$CC%g
s%@EXEEXT@%$EXEEXT%g
-s%@RANLIB@%$RANLIB%g
-s%@LD@%$LD%g
-s%@NM@%$NM%g
-s%@USE_SYMBOL_UNDERSCORE@%$USE_SYMBOL_UNDERSCORE%g
s%@LN_S@%$LN_S%g
-s%@DLLTOOL@%$DLLTOOL%g
-s%@AS@%$AS%g
+s%@OBJEXT@%$OBJEXT%g
+s%@RANLIB@%$RANLIB%g
+s%@STRIP@%$STRIP%g
s%@LIBTOOL@%$LIBTOOL%g
s%@COMPPATH@%$COMPPATH%g
s%@CPP@%$CPP%g
diff --git a/zlib/configure.in b/zlib/configure.in
index 2edccc3b494..a56262ebcd1 100644
--- a/zlib/configure.in
+++ b/zlib/configure.in
@@ -1,13 +1,38 @@
dnl Process this with autoconf to create configure
AC_INIT(zlib.h)
+
+dnl We may get other options which we dont document:
+dnl --with-target-subdir, --with-multisrctop, --with-multisubdir
+
+if test "x[$]{with_target_subdir}" != x && \
+ test "[$]{srcdir}" = "."; then
+ if test "[$]{with_target_subdir}" != "."; then
+ zlib_basedir="[$]{srcdir}/[$]{with_multisrctop}../"
+ else
+ zlib_basedir="[$]{srcdir}/[$]{with_multisrctop}"
+ fi
+else
+ zlib_basedir="[$]{srcdir}/"
+fi
+AC_SUBST(zlib_basedir)
+AC_CONFIG_AUX_DIR($zlib_basedir..)
+if :; then :; else
+ # This overrides the previous occurrence for automake, but not for
+ # autoconf, which is exactly what we want.
+ AC_CONFIG_AUX_DIR(..)
+fi
+
AC_CANONICAL_SYSTEM
+
+# This works around an automake problem.
+mkinstalldirs="`cd $ac_aux_dir && pwd`/mkinstalldirs"
+AC_SUBST(mkinstalldirs)
+
AM_INIT_AUTOMAKE(zlib, 1.1.3)
AM_MAINTAINER_MODE
-AC_CONFIG_AUX_DIR(..)
-
dnl We use these options to decide which functions to include.
AC_ARG_WITH(target-subdir,
[ --with-target-subdir=SUBDIR
@@ -24,21 +49,6 @@ AC_ARG_ENABLE(multilib,
*) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;;
esac], [test -z "$with_target_subdir" && multilib=no || multilib=yes])dnl
-dnl We may get other options which we dont document:
-dnl --with-target-subdir, --with-multisrctop, --with-multisubdir
-
-if test "x[$]{with_target_subdir}" != x && \
- test "[$]{srcdir}" = "."; then
- if test "[$]{with_target_subdir}" != "."; then
- zlib_basedir="[$]{srcdir}/[$]{with_multisrctop}../"
- else
- zlib_basedir="[$]{srcdir}/[$]{with_multisrctop}"
- fi
-else
- zlib_basedir="[$]{srcdir}/"
-fi
-AC_SUBST(zlib_basedir)
-
AC_ARG_WITH(system-zlib,
[ --with-system-zlib use installed libz])